From c97297974ddc6974854cb66c970235f633d91fc2 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sat, 18 Apr 2026 16:01:58 +0200 Subject: [PATCH] add playground --- esbuild.browser.mjs | 254 + package-lock.json | 472 + package.json | 14 +- src/browser/adapters/output.ts | 109 + src/browser/config.ts | 68 + src/browser/generate.ts | 187 + src/browser/index.ts | 27 + src/browser/parser.ts | 67 + src/browser/shims/asyncapi-parser.ts | 95 + src/browser/shims/fs.ts | 194 + src/browser/shims/json-schema-ref-parser.ts | 311 + src/browser/shims/swagger-parser.ts | 43 + src/codegen/configurations.ts | 10 +- .../generators/typescript/channels/index.ts | 38 +- .../generators/typescript/channels/types.ts | 4 +- .../generators/typescript/channels/utils.ts | 20 +- .../generators/typescript/client/index.ts | 19 +- .../typescript/client/protocols/nats.ts | 9 +- .../generators/typescript/client/types.ts | 4 +- src/codegen/generators/typescript/headers.ts | 52 +- src/codegen/generators/typescript/models.ts | 22 +- .../generators/typescript/parameters.ts | 43 +- src/codegen/generators/typescript/payloads.ts | 85 +- src/codegen/generators/typescript/types.ts | 14 +- src/codegen/generators/typescript/utils.ts | 9 +- .../inputs/asyncapi/generators/payloads.ts | 2 + .../inputs/asyncapi/generators/types.ts | 12 +- .../inputs/openapi/generators/types.ts | 12 +- src/codegen/output/filesystem.ts | 63 + src/codegen/output/index.ts | 46 + src/codegen/output/memory.ts | 97 + src/codegen/output/modelina.ts | 67 + src/codegen/output/types.ts | 50 + src/codegen/renderer.ts | 65 +- src/codegen/types.ts | 36 +- src/codegen/utils.ts | 141 +- src/commands/generate.ts | 43 +- test/PersistedConfig.spec.ts | 12 +- test/blackbox/typescript.spec.ts | 2 +- test/browser/generate.spec.ts | 847 + test/browser/modelina.spec.ts | 230 + test/browser/output.spec.ts | 171 + .../__snapshots__/channels.spec.ts.snap | 44 +- .../generators/typescript/channels.spec.ts | 103 +- .../channels/import-extension.spec.ts | 17 +- .../protocols/functionTypeMapping.spec.ts | 18 +- .../generators/typescript/client.spec.ts | 19 +- .../typescript/import-extension.spec.ts | 2 +- .../generators/typescript/jsdoc-utils.spec.ts | 6 +- .../modelina/presets/validation.spec.ts | 36 +- test/codegen/output/adapter.spec.ts | 195 + test/codegen/output/integration.spec.ts | 139 + test/codegen/renderer.spec.ts | 173 +- .../src/openapi/channels/http_client.ts | 6 +- .../typescript/src/openapi/payloads/APet.ts | 2 +- .../src/request-reply/channels/http_client.ts | 20 +- .../src/request-reply/payloads/ItemRequest.ts | 2 +- .../src/request-reply/payloads/Ping.ts | 2 +- test/telemetry/notice.spec.ts | 18 +- test/telemetry/sender.spec.ts | 36 +- tsconfig.browser.json | 12 + tsconfig.test.json | 22 + website/docusaurus.config.ts | 8 + website/package-lock.json | 173 + website/package.json | 16 +- website/plugins/suppress-resize-observer.js | 25 + .../clientModules/suppressResizeObserver.js | 34 + website/src/hooks/useCodegen.ts | 200 + website/src/hooks/useConfigSync.ts | 78 + website/src/hooks/useFileExplorer.ts | 279 + website/src/schemas/asyncapi-2.0.0.json | 2301 + website/src/schemas/asyncapi-2.1.0.json | 2438 + website/src/schemas/asyncapi-2.2.0.json | 2423 + website/src/schemas/asyncapi-2.3.0.json | 2444 + website/src/schemas/asyncapi-2.4.0.json | 2468 + website/src/schemas/asyncapi-2.5.0.json | 2482 + website/src/schemas/asyncapi-2.6.0.json | 3180 + website/src/schemas/asyncapi-3.0.0.json | 8971 + website/src/schemas/asyncapi-3.1.0.json | 9185 + website/src/schemas/index.ts | 127 + website/src/schemas/jsonschema-draft-07.json | 172 + website/src/schemas/openapi-3.0.json | 1662 + website/src/schemas/openapi-3.1.json | 1440 + website/src/utils/configCodegen.ts | 100 + website/src/utils/configParser.ts | 132 + website/src/utils/configTypes.ts | 194 + website/static/codegen.browser.mjs | 1027487 ++++++++++++++ 87 files changed, 1072594 insertions(+), 363 deletions(-) create mode 100644 esbuild.browser.mjs create mode 100644 src/browser/adapters/output.ts create mode 100644 src/browser/config.ts create mode 100644 src/browser/generate.ts create mode 100644 src/browser/index.ts create mode 100644 src/browser/parser.ts create mode 100644 src/browser/shims/asyncapi-parser.ts create mode 100644 src/browser/shims/fs.ts create mode 100644 src/browser/shims/json-schema-ref-parser.ts create mode 100644 src/browser/shims/swagger-parser.ts create mode 100644 src/codegen/output/filesystem.ts create mode 100644 src/codegen/output/index.ts create mode 100644 src/codegen/output/memory.ts create mode 100644 src/codegen/output/modelina.ts create mode 100644 src/codegen/output/types.ts create mode 100644 test/browser/generate.spec.ts create mode 100644 test/browser/modelina.spec.ts create mode 100644 test/browser/output.spec.ts create mode 100644 test/codegen/output/adapter.spec.ts create mode 100644 test/codegen/output/integration.spec.ts create mode 100644 tsconfig.browser.json create mode 100644 tsconfig.test.json create mode 100644 website/plugins/suppress-resize-observer.js create mode 100644 website/src/clientModules/suppressResizeObserver.js create mode 100644 website/src/hooks/useCodegen.ts create mode 100644 website/src/hooks/useConfigSync.ts create mode 100644 website/src/hooks/useFileExplorer.ts create mode 100644 website/src/schemas/asyncapi-2.0.0.json create mode 100644 website/src/schemas/asyncapi-2.1.0.json create mode 100644 website/src/schemas/asyncapi-2.2.0.json create mode 100644 website/src/schemas/asyncapi-2.3.0.json create mode 100644 website/src/schemas/asyncapi-2.4.0.json create mode 100644 website/src/schemas/asyncapi-2.5.0.json create mode 100644 website/src/schemas/asyncapi-2.6.0.json create mode 100644 website/src/schemas/asyncapi-3.0.0.json create mode 100644 website/src/schemas/asyncapi-3.1.0.json create mode 100644 website/src/schemas/index.ts create mode 100644 website/src/schemas/jsonschema-draft-07.json create mode 100644 website/src/schemas/openapi-3.0.json create mode 100644 website/src/schemas/openapi-3.1.json create mode 100644 website/src/utils/configCodegen.ts create mode 100644 website/src/utils/configParser.ts create mode 100644 website/src/utils/configTypes.ts create mode 100644 website/static/codegen.browser.mjs diff --git a/esbuild.browser.mjs b/esbuild.browser.mjs new file mode 100644 index 00000000..83b2e864 --- /dev/null +++ b/esbuild.browser.mjs @@ -0,0 +1,254 @@ +/** + * ESBuild configuration for browser bundle. + * Creates a browser-compatible bundle of the codegen library. + */ +import * as esbuild from 'esbuild'; +import { polyfillNode } from 'esbuild-plugin-polyfill-node'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import { createRequire } from 'module'; + +const require = createRequire(import.meta.url); + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +const isWatch = process.argv.includes('--watch'); +const isMinify = process.argv.includes('--minify'); + +// Custom plugin to alias fs to our browser shim +const fsShimPlugin = { + name: 'fs-shim', + setup(build) { + const shimPath = path.resolve(__dirname, 'src/browser/shims/fs.ts'); + + // Intercept fs imports + build.onResolve({ filter: /^(node:)?fs$/ }, () => { + return { path: shimPath }; + }); + + // Also handle fs/promises + build.onResolve({ filter: /^(node:)?fs\/promises$/ }, () => { + return { path: shimPath }; + }); + }, +}; + +// Custom plugin to redirect lodash to lodash-es for proper ESM support +// The @stoplight/spectral libraries use lodash but expect ES module named exports +const lodashEsPlugin = { + name: 'lodash-es', + setup(build) { + const lodashEsPath = path.dirname(require.resolve('lodash-es/package.json')); + + // Redirect all lodash imports to lodash-es + build.onResolve({ filter: /^lodash$/ }, () => { + return { path: path.join(lodashEsPath, 'lodash.js') }; + }); + + // Also handle lodash/xxx imports -> lodash-es/xxx + build.onResolve({ filter: /^lodash\/(.+)$/ }, (args) => { + const subpath = args.path.replace('lodash/', ''); + return { path: path.join(lodashEsPath, `${subpath}.js`) }; + }); + }, +}; + +// Custom plugin to shim @apidevtools/json-schema-ref-parser for browser +// The library uses Node.js file system APIs that don't work in browsers +const jsonSchemaRefParserShimPlugin = { + name: 'json-schema-ref-parser-shim', + setup(build) { + const shimPath = path.resolve(__dirname, 'src/browser/shims/json-schema-ref-parser.ts'); + + // Intercept @apidevtools/json-schema-ref-parser imports (main and sub-paths) + build.onResolve({ filter: /^@apidevtools\/json-schema-ref-parser(\/.*)?$/ }, () => { + return { path: shimPath }; + }); + }, +}; + +// Custom plugin to shim @apidevtools/swagger-parser for browser +// We don't use swagger-parser directly - we use @readme/openapi-parser +const swaggerParserShimPlugin = { + name: 'swagger-parser-shim', + setup(build) { + const shimPath = path.resolve(__dirname, 'src/browser/shims/swagger-parser.ts'); + + // Intercept @apidevtools/swagger-parser imports + build.onResolve({ filter: /^@apidevtools\/swagger-parser(\/.*)?$/ }, () => { + return { path: shimPath }; + }); + }, +}; + +// Custom plugin to properly handle the @asyncapi/parser/browser UMD bundle +// The browser bundle needs special handling because it's UMD and exports differently +const asyncapiParserBrowserPlugin = { + name: 'asyncapi-parser-browser', + setup(build) { + const browserBundlePath = require.resolve('@asyncapi/parser/browser/index.js'); + + // Handle the browser bundle import in our shim + build.onResolve({ filter: /^@asyncapi\/parser\/browser$/ }, () => { + return { path: browserBundlePath }; + }); + + // Transform the UMD bundle to properly export Parser for ESM + build.onLoad({ filter: /parser[\\/]browser[\\/]index\.js$/ }, async (args) => { + const fs = await import('fs'); + const contents = fs.readFileSync(args.path, 'utf8'); + + // The UMD bundle pattern: sets module.exports in CommonJS, global in browser + // We need to create a proper ESM wrapper that captures the exports + return { + contents: ` + // Create fake module/exports for the UMD bundle to write to + var module = { exports: {} }; + var exports = module.exports; + + // The original UMD bundle + ${contents} + + // Extract the AsyncAPIParser object that was set on module.exports + var AsyncAPIParserExports = module.exports; + + // Re-export Parser for ESM consumption + export var Parser = AsyncAPIParserExports.Parser; + export default AsyncAPIParserExports; + `, + loader: 'js', + }; + }); + }, +}; + +// Custom plugin to add SlowBuffer to the buffer module (for avsc compatibility) +// The polyfill uses @jspm/core which wraps buffer but doesn't export SlowBuffer +const slowBufferPlugin = { + name: 'slowbuffer-patch', + setup(build) { + // Patch the @jspm/core buffer wrapper to export SlowBuffer + build.onLoad({ filter: /@jspm[\\/]core[\\/]nodelibs[\\/]browser[\\/]buffer\.js$/ }, async (args) => { + const fs = await import('fs'); + let contents = fs.readFileSync(args.path, 'utf8'); + + // Add SlowBuffer variable declaration after Buffer + // Original: var Buffer = exports.Buffer; + // Target: var Buffer = exports.Buffer; + // var SlowBuffer = exports.SlowBuffer; + contents = contents.replace( + 'var Buffer = exports.Buffer;', + 'var Buffer = exports.Buffer;\nvar SlowBuffer = exports.SlowBuffer;' + ); + + // Add SlowBuffer to the named exports + // Original: export { Buffer, INSPECT_MAX_BYTES, exports as default, kMaxLength }; + // Target: export { Buffer, SlowBuffer, INSPECT_MAX_BYTES, exports as default, kMaxLength }; + contents = contents.replace( + 'export { Buffer,', + 'export { Buffer, SlowBuffer,' + ); + + return { contents, loader: 'js' }; + }); + }, +}; + +const buildOptions = { + entryPoints: ['src/browser/index.ts'], + bundle: true, + format: 'esm', + outfile: 'dist/browser/codegen.browser.mjs', + platform: 'browser', + target: 'es2020', + sourcemap: true, + minify: isMinify, + plugins: [ + // Our custom shims must come first + fsShimPlugin, + // Shim json-schema-ref-parser for browser (no Node.js file system) + jsonSchemaRefParserShimPlugin, + // Shim swagger-parser (we use @readme/openapi-parser instead) + swaggerParserShimPlugin, + // Handle @asyncapi/parser/browser UMD bundle properly + asyncapiParserBrowserPlugin, + // Redirect lodash to lodash-es for proper ESM support + lodashEsPlugin, + // Add SlowBuffer to buffer module for avsc compatibility + slowBufferPlugin, + // Polyfill other Node.js built-in modules + polyfillNode({ + globals: { + process: true, + Buffer: true, + global: true, + }, + polyfills: { + assert: true, + buffer: true, + crypto: true, + events: true, + // fs is handled by our custom shim + fs: false, + http: true, + https: true, + os: true, + path: true, + process: true, + stream: true, + string_decoder: true, + url: true, + util: true, + zlib: true, + }, + }), + ], + external: [ + // Only mark things that truly can't be polyfilled + 'inspector', + 'node:inspector', + // JSON file that has import issues + 'ajv/lib/refs/json-schema-draft-04.json', + ], + // Define browser-friendly replacements + define: { + 'process.env.NODE_ENV': '"production"', + 'global': 'globalThis', + }, + // Configure main fields resolution - prefer browser field + mainFields: ['browser', 'module', 'main'], + // Resolve extensions + resolveExtensions: ['.ts', '.js', '.mjs', '.cjs', '.json'], + // Handle the banner for ESM + // webapi-parser expects Ajv to be a global variable + banner: { + js: `// Browser bundle for The Codegen Project +// Generated by esbuild with Node.js polyfills + +// Global Ajv placeholder for webapi-parser (will be set by require_ajv4) +var Ajv; +` + }, + logLevel: 'info', +}; + +async function build() { + try { + if (isWatch) { + const context = await esbuild.context(buildOptions); + await context.watch(); + console.log('Watching for changes...'); + } else { + const result = await esbuild.build(buildOptions); + console.log('Browser bundle built successfully'); + if (result.metafile) { + console.log(await esbuild.analyzeMetafile(result.metafile)); + } + } + } catch (error) { + console.error('Build failed:', error); + process.exit(1); + } +} + +build(); diff --git a/package-lock.json b/package-lock.json index 1b0ecbb9..6754e360 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,8 @@ "@typescript-eslint/eslint-plugin": "^8.58.0", "@typescript-eslint/parser": "^8.58.0", "concurrently": "^9.0.1", + "esbuild": "^0.20.2", + "esbuild-plugin-polyfill-node": "^0.3.0", "eslint": "^8.51.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-github": "^4.10.1", @@ -58,6 +60,7 @@ "eslint-plugin-sonarjs": "^0.19.0", "eslint-plugin-unused-imports": "^4.4.1", "graphology-types": "^0.24.7", + "lodash-es": "^4.18.1", "markdown-toc": "1.2.0", "oclif": "^4.8.5", "rimraf": "^5.0.5", @@ -1994,6 +1997,397 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -2989,6 +3383,13 @@ "jsep": "^0.4.0||^1.0.0" } }, + "node_modules/@jspm/core": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@jspm/core/-/core-2.1.0.tgz", + "integrity": "sha512-3sRl+pkyFY/kLmHl0cgHiFp2xEqErA8N3ECjMs7serSUBmoJ70lBa0PG5t0IM6WJgdZNyyI0R8YFfi5wM8+mzg==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -7544,6 +7945,59 @@ "dev": true, "peer": true }, + "node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/esbuild-plugin-polyfill-node": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/esbuild-plugin-polyfill-node/-/esbuild-plugin-polyfill-node-0.3.0.tgz", + "integrity": "sha512-SHG6CKUfWfYyYXGpW143NEZtcVVn8S/WHcEOxk62LuDXnY4Zpmc+WmxJKN6GMTgTClXJXhEM5KQlxKY6YjbucQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jspm/core": "^2.0.1", + "import-meta-resolve": "^3.0.0" + }, + "peerDependencies": { + "esbuild": "*" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -9545,6 +9999,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-meta-resolve": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-3.1.1.tgz", + "integrity": "sha512-qeywsE/KC3w9Fd2ORrRDUw6nS/nLwZpXgfrOc2IILvZYnCaEMd+D56Vfg9k4G29gIeVi3XKql1RQatME8iYsiw==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -11272,6 +11737,13 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash-es": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", + "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", diff --git a/package.json b/package.json index 6289c0a9..3b5dbbf7 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,8 @@ "@typescript-eslint/eslint-plugin": "^8.58.0", "@typescript-eslint/parser": "^8.58.0", "concurrently": "^9.0.1", + "esbuild": "^0.20.2", + "esbuild-plugin-polyfill-node": "^0.3.0", "eslint": "^8.51.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-github": "^4.10.1", @@ -53,6 +55,7 @@ "eslint-plugin-sonarjs": "^0.19.0", "eslint-plugin-unused-imports": "^4.4.1", "graphology-types": "^0.24.7", + "lodash-es": "^4.18.1", "markdown-toc": "1.2.0", "oclif": "^4.8.5", "rimraf": "^5.0.5", @@ -99,14 +102,17 @@ }, "scripts": { "build": "rimraf dist && tsc && oclif manifest && echo \"Build Completed\"", + "build:browser": "node esbuild.browser.mjs", + "build:browser:watch": "node esbuild.browser.mjs --watch", + "build:browser:minify": "node esbuild.browser.mjs --minify", "dev": "tsc --watch", "generate:readme:commands": "oclif readme --readme-path=\"./docs/usage.md\" --output-dir=\"./docs\"", "generate:assets": "npm run generate:readme:toc && npm run generate:commands && npm run generate:schema && npm run format", "generate:schema": "node scripts/generateSchemaFiles.js", "generate:commands": "npm run generate:readme:commands", "generate:readme:toc": "markdown-toc -i README.md && markdown-toc -i ./docs/usage.md && markdown-toc -i ./docs/migrations/v0.md && markdown-toc -i ./docs/README.md && markdown-toc -i ./docs/contributing.md ", - "lint": "eslint --max-warnings 0 --config .eslintrc .", - "lint:fix": "npm run lint -- --fix", + "lint": "eslint --max-warnings 0 --config .eslintrc . && npm run typecheck:test", + "lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix && npm run typecheck:test", "format": "prettier \"./src/**/*.ts\" --write", "pack:all": "npm run pack:macos && npm run pack:linux && npm run pack:tarballs && npm run pack:windows", "pack:macos": "oclif pack macos && npm run pack:rename", @@ -137,7 +143,9 @@ "runtime:amqp:stop": "cd test/runtime && docker compose -f ./docker-compose-amqp.yml down", "test:blackbox": "concurrently --group -n typescript \"npm run test:blackbox:typescript\"", "test:blackbox:typescript": "jest ./test/blackbox/typescript.spec.ts", - "prepare:pr": "npm run build && npm run format && npm run lint:fix && npm run test:update && npm run runtime:typescript:generate" + "prepare:pr": "npm run build && npm run format && npm run lint:fix && npm run test:update && npm run runtime:typescript:generate", + "typecheck": "tsc --noEmit", + "typecheck:test": "tsc --noEmit -p tsconfig.test.json" }, "engines": { "node": ">=22.0.0" diff --git a/src/browser/adapters/output.ts b/src/browser/adapters/output.ts new file mode 100644 index 00000000..af40fe12 --- /dev/null +++ b/src/browser/adapters/output.ts @@ -0,0 +1,109 @@ +/* eslint-disable security/detect-object-injection */ +/** + * In-memory file output adapter for browser environments. + * Replaces filesystem writes with Map storage. + * Implements OutputAdapter interface for compatibility with shared generators. + */ +import {OutputAdapter} from '../../codegen/output/types'; + +export class BrowserOutput implements OutputAdapter { + private files: Map = new Map(); + + /** + * Write a file to memory. + * @param path - The file path (e.g., 'src/models/User.ts') + * @param content - The file content + */ + async write(path: string, content: string): Promise { + this.files.set(path, content); + } + + /** + * No-op for browser - directories are virtual. + */ + async mkdir( + _dirPath: string, + _options?: {recursive?: boolean} + ): Promise { + // No-op - directories are virtual in memory + } + + /** + * Get all file paths that were written. + * Implements OutputAdapter interface. + */ + getWrittenFiles(): string[] { + return Array.from(this.files.keys()); + } + + /** + * Get all files with their content. + * Implements OutputAdapter interface. + */ + getAllFiles(): Record { + const result: Record = {}; + for (const [path, content] of this.files) { + result[path] = content; + } + return result; + } + + /** + * Read a file from memory. + * @param path - The file path + * @returns The file content, or undefined if not found + */ + read(path: string): string | undefined { + return this.files.get(path); + } + + /** + * Get all files as a Record. + * @deprecated Use getAllFiles() instead for OutputAdapter compatibility + * @returns A copy of all files as Record + */ + getAll(): Record { + return this.getAllFiles(); + } + + /** + * Clear all files from memory. + */ + clear(): void { + this.files.clear(); + } + + /** + * Check if a file exists. + * @param path - The file path + * @returns True if the file exists + */ + has(path: string): boolean { + return this.files.has(path); + } + + /** + * Delete a specific file. + * @param path - The file path + * @returns True if the file was deleted, false if it didn't exist + */ + delete(path: string): boolean { + return this.files.delete(path); + } + + /** + * Get all file paths. + * @deprecated Use getWrittenFiles() instead for OutputAdapter compatibility + * @returns Array of file paths + */ + getPaths(): string[] { + return this.getWrittenFiles(); + } + + /** + * Get the number of files. + */ + get size(): number { + return this.files.size; + } +} diff --git a/src/browser/config.ts b/src/browser/config.ts new file mode 100644 index 00000000..21fef66e --- /dev/null +++ b/src/browser/config.ts @@ -0,0 +1,68 @@ +/** + * Parse configuration from string for browser environments. + * Replaces cosmiconfig filesystem search with direct string parsing. + */ +import {parse as parseYaml} from 'yaml'; +import { + TheCodegenConfiguration, + zodTheCodegenConfiguration +} from '../codegen/types'; + +/** + * Parse a configuration string into a validated configuration object. + * + * @param configString - The configuration as a string (JSON or YAML) + * @param format - The format of the string ('json' or 'yaml') + * @returns The validated configuration object + * @throws Error if parsing or validation fails + */ +export function parseConfig( + configString: string, + format: 'json' | 'yaml' +): TheCodegenConfiguration { + let rawConfig: unknown; + + // Parse the string based on format + try { + if (format === 'json') { + rawConfig = JSON.parse(configString); + } else { + rawConfig = parseYaml(configString); + } + } catch (error) { + const message = + error instanceof Error ? error.message : 'Unknown parse error'; + throw new Error(`Failed to parse ${format} configuration: ${message}`); + } + + // Validate with Zod schema + const result = zodTheCodegenConfiguration.safeParse(rawConfig); + + if (!result.success) { + const errors = result.error.issues + .map((issue) => ` - ${issue.path.join('.')}: ${issue.message}`) + .join('\n'); + throw new Error(`Invalid configuration:\n${errors}`); + } + + return result.data; +} + +/** + * Serialize a configuration object to a string. + * + * @param config - The configuration object + * @param format - The output format ('json' or 'yaml') + * @returns The configuration as a string + */ +export function serializeConfig( + config: TheCodegenConfiguration, + format: 'json' | 'yaml' +): string { + if (format === 'json') { + return JSON.stringify(config, null, 2); + } + // For YAML, we'd need to import stringify from yaml + // For now, default to JSON + return JSON.stringify(config, null, 2); +} diff --git a/src/browser/generate.ts b/src/browser/generate.ts new file mode 100644 index 00000000..27c68b7c --- /dev/null +++ b/src/browser/generate.ts @@ -0,0 +1,187 @@ +/** + * Main browser generation function. + * Uses the shared rendering pipeline for in-memory code generation. + * No filesystem I/O - returns generated files as data. + */ +import {parse as parseYaml} from 'yaml'; +import {parse, dereference} from '@readme/openapi-parser'; +import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; +// Use the shim's interface for browser compatibility, cast to any when passing to generators +// that expect @asyncapi/parser.AsyncAPIDocumentInterface +import {AsyncAPIDocumentInterface} from './shims/asyncapi-parser'; +import type {AsyncAPIDocumentInterface as NodeAsyncAPIDocumentInterface} from '@asyncapi/parser'; +import {CodegenError} from '../codegen/errors'; +import {loadAsyncapiFromMemoryBrowser} from './parser'; +import { + loadJsonSchemaFromMemory, + JsonSchemaDocument +} from '../codegen/inputs/jsonschema'; +import { + TheCodegenConfiguration, + TheCodegenConfigurationInternal, + zodTheCodegenConfiguration, + RunGeneratorContext +} from '../codegen/types'; +import {realizeConfiguration} from '../codegen/configurations'; +import {determineRenderGraph, renderGraph} from '../codegen/renderer'; + +export interface BrowserGenerateInput { + /** The API specification as a string (YAML or JSON) */ + spec: string; + /** The format of the specification */ + specFormat: 'asyncapi' | 'openapi' | 'jsonschema'; + /** The codegen configuration */ + config: TheCodegenConfiguration; +} + +export interface BrowserGenerateOutput { + /** Generated files as Record */ + files: Record; + /** Any errors that occurred during generation */ + errors: string[]; +} + +/** + * Generate code from an API specification in the browser. + * This is the main entry point for browser-based code generation. + */ +// eslint-disable-next-line sonarjs/cognitive-complexity +export async function generate( + input: BrowserGenerateInput +): Promise { + const errors: string[] = []; + const files: Record = {}; + + try { + // Validate and realize configuration (adds default generators for dependencies) + const configResult = zodTheCodegenConfiguration.safeParse(input.config); + if (!configResult.success) { + errors.push( + `Invalid configuration: ${configResult.error.issues.map((i) => i.message).join(', ')}` + ); + return {files, errors}; + } + + // Realize configuration to add dependency generators and merge with defaults + const config: TheCodegenConfigurationInternal = realizeConfiguration( + configResult.data + ); + + // Parse the specification + let asyncapiDocument: AsyncAPIDocumentInterface | undefined; + let openapiDocument: + | OpenAPIV3.Document + | OpenAPIV2.Document + | OpenAPIV3_1.Document + | undefined; + let jsonSchemaDocument: JsonSchemaDocument | undefined; + + // Validate spec is not empty + if (!input.spec || input.spec.trim() === '') { + errors.push('Empty specification provided'); + return {files, errors}; + } + + switch (input.specFormat) { + case 'asyncapi': + try { + asyncapiDocument = await loadAsyncapiFromMemoryBrowser(input.spec); + } catch (error) { + // Include details from CodegenError if available + let errorMsg = error instanceof Error ? error.message : String(error); + if (error instanceof CodegenError && error.details) { + errorMsg += `\n${error.details}`; + } + errors.push(`Failed to parse AsyncAPI spec: ${errorMsg}`); + return {files, errors}; + } + break; + + case 'openapi': + try { + openapiDocument = await parseOpenAPIFromMemory(input.spec); + } catch (error) { + errors.push( + `Failed to parse OpenAPI spec: ${error instanceof Error ? error.message : String(error)}` + ); + return {files, errors}; + } + break; + + case 'jsonschema': + try { + const parsed = parseSpecString(input.spec); + jsonSchemaDocument = loadJsonSchemaFromMemory( + parsed as JsonSchemaDocument + ); + } catch (error) { + errors.push( + `Failed to parse JSON Schema: ${error instanceof Error ? error.message : String(error)}` + ); + return {files, errors}; + } + break; + + default: + errors.push(`Unknown spec format: ${input.specFormat}`); + return {files, errors}; + } + + // Cast the browser shim's AsyncAPIDocumentInterface to the Node.js version + // At runtime, the objects are compatible - this is just for TypeScript + const nodeAsyncapiDocument = asyncapiDocument as + | NodeAsyncAPIDocumentInterface + | undefined; + + // Build the context for the shared rendering pipeline + // Use root-level virtual path so output paths don't get 'browser/' prefix + const context: RunGeneratorContext = { + configuration: config, + configFilePath: '/virtual-config.mjs', // Virtual path for browser (root level) + documentPath: '/virtual-spec', + asyncapiDocument: nodeAsyncapiDocument, + openapiDocument, + jsonSchemaDocument + }; + + // Use the shared rendering pipeline + const graph = determineRenderGraph(context); + const result = await renderGraph(context, graph); + + // Convert GeneratedFile[] to Record + for (const file of result.files) { + files[file.path] = file.content; + } + } catch (error) { + errors.push( + `Generation failed: ${error instanceof Error ? error.message : String(error)}` + ); + } + + return {files, errors}; +} + +/** + * Parse an OpenAPI spec from a string. + */ +async function parseOpenAPIFromMemory( + specString: string +): Promise { + const document = parseSpecString(specString); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const parsedDocument = await parse(document as any); + return await dereference(parsedDocument); +} + +/** + * Parse a spec string (YAML or JSON) into an object. + */ +function parseSpecString(specString: string): unknown { + // Try JSON first + try { + return JSON.parse(specString); + } catch { + // Fall back to YAML + return parseYaml(specString); + } +} diff --git a/src/browser/index.ts b/src/browser/index.ts new file mode 100644 index 00000000..e28ab30f --- /dev/null +++ b/src/browser/index.ts @@ -0,0 +1,27 @@ +/** + * Browser bundle entry point. + * Exports browser-compatible generation functions for use in web applications. + * + * This module provides: + * - generate() - Main function to generate code from API specs + * - parseConfig() - Parse configuration from JSON/YAML strings + * - BrowserOutput - In-memory file storage + * - MemoryAdapter - Shared in-memory output adapter + */ + +// Main generation function +export {generate} from './generate'; +export type {BrowserGenerateInput, BrowserGenerateOutput} from './generate'; + +// Configuration parsing +export {parseConfig, serializeConfig} from './config'; + +// Adapters for direct usage +export {BrowserOutput} from './adapters/output'; + +// Re-export shared MemoryAdapter for direct usage +export {MemoryAdapter} from '../codegen/output'; +export type {OutputAdapter} from '../codegen/output'; + +// Re-export types that users might need +export type {TheCodegenConfiguration} from '../codegen/types'; diff --git a/src/browser/parser.ts b/src/browser/parser.ts new file mode 100644 index 00000000..982c25de --- /dev/null +++ b/src/browser/parser.ts @@ -0,0 +1,67 @@ +/** + * Browser-specific AsyncAPI parser. + * + * This module provides the same interface as the Node.js parser but is designed + * to work correctly when bundled for browser environments. + * + * When bundled with esbuild for browser: + * - Uses the shim which loads @asyncapi/parser/browser with proper $ref resolution + * + * When running in Node.js (tests): + * - Uses the regular @asyncapi/parser which works correctly + * + * Reference: https://github.com/asyncapi/parser-js#using-in-the-browserspa-applications + */ +import {createInputDocumentError} from '../codegen/errors'; +import {Parser, AsyncAPIDocumentInterface} from './shims/asyncapi-parser'; + +/** + * Browser parser instance. + * Configured without linting rules for faster parsing. + * The Parser is loaded from our shim which handles browser vs Node.js environments. + */ +const parser = new Parser({ + ruleset: { + core: false, + recommended: false + } +}); + +/** + * Load an AsyncAPI document from a string in the browser environment. + * Uses the browser-specific parser that properly handles $ref resolution. + * + * @param input - The AsyncAPI document as a YAML or JSON string + * @returns The parsed AsyncAPI document + */ +export async function loadAsyncapiFromMemoryBrowser( + input: string +): Promise { + const result = await parser.parse(input); + + // Check for errors (severity 0 = error) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const errors = (result as any).diagnostics?.filter( + (d: {severity: number}) => d.severity === 0 + ); + + if (errors && errors.length > 0) { + throw createInputDocumentError({ + inputPath: 'memory', + inputType: 'asyncapi', + errorMessage: JSON.stringify(errors, null, 2) + }); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (!(result as any).document) { + throw createInputDocumentError({ + inputPath: 'memory', + inputType: 'asyncapi', + errorMessage: 'Failed to parse AsyncAPI document' + }); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (result as any).document; +} diff --git a/src/browser/shims/asyncapi-parser.ts b/src/browser/shims/asyncapi-parser.ts new file mode 100644 index 00000000..1c41a527 --- /dev/null +++ b/src/browser/shims/asyncapi-parser.ts @@ -0,0 +1,95 @@ +/* eslint-disable no-undef, no-console */ +/** + * Shim for @asyncapi/parser that works in both Node.js and browser environments. + * + * - In Node.js (tests): Uses the regular @asyncapi/parser package + * - In browser (bundled): Uses @asyncapi/parser/browser which has proper $ref resolution + * + * The esbuild plugin (asyncapiParserBrowserPlugin) transforms the browser bundle + * to properly export the Parser class. + */ + +// Type definitions for AsyncAPIDocumentInterface +// These match the interface from @asyncapi/parser +export interface AsyncAPIDocumentInterface { + version(): string; + info(): unknown; + servers(): unknown; + channels(): unknown; + operations(): unknown; + messages(): unknown; + schemas(): unknown; + securitySchemes(): unknown; + components(): unknown; + allServers(): unknown; + allChannels(): unknown; + allOperations(): unknown; + allMessages(): unknown; + allSchemas(): unknown; + extensions(): unknown; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + json(): T; +} + +// Detect environment - if we have window/document, we're in browser +const isBrowser = + typeof window !== 'undefined' && typeof document !== 'undefined'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +let ParserClass: any; + +if (isBrowser) { + // In browser: use the browser bundle + // The esbuild plugin transforms this to properly export Parser + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires + const browserBundle = require('@asyncapi/parser/browser'); + + // Debug: log the bundle structure to help diagnose issues + if (typeof console !== 'undefined' && console.debug) { + console.debug( + '[AsyncAPI Parser Shim] Bundle keys:', + Object.keys(browserBundle) + ); + console.debug( + '[AsyncAPI Parser Shim] Parser type:', + typeof browserBundle.Parser + ); + console.debug( + '[AsyncAPI Parser Shim] default type:', + typeof browserBundle.default + ); + if (browserBundle.default) { + console.debug( + '[AsyncAPI Parser Shim] default.Parser type:', + typeof browserBundle.default?.Parser + ); + } + } + + ParserClass = + browserBundle.Parser || + browserBundle.default?.Parser || + browserBundle.default; + + if (!ParserClass || typeof ParserClass !== 'function') { + console.error( + 'AsyncAPI Parser browser bundle structure:', + Object.keys(browserBundle) + ); + console.error('Parser value:', browserBundle.Parser); + console.error('default value:', browserBundle.default); + throw new Error( + `Could not find Parser constructor in @asyncapi/parser/browser bundle. ` + + `Parser type: ${typeof ParserClass}` + ); + } +} else { + // In Node.js: use the regular parser + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires + const parserModule = require('@asyncapi/parser'); + ParserClass = parserModule.Parser; +} + +// Export Parser as both named and default export +export const Parser = ParserClass; +export default ParserClass; diff --git a/src/browser/shims/fs.ts b/src/browser/shims/fs.ts new file mode 100644 index 00000000..45d3af97 --- /dev/null +++ b/src/browser/shims/fs.ts @@ -0,0 +1,194 @@ +/** + * Browser shim for Node.js 'fs' module. + * Provides stub implementations that throw helpful errors. + * + * This module is used for both 'fs' and 'fs/promises' imports. + * All functions return promises since that's what the browser code expects. + */ + +const notSupportedAsync = (name: string) => { + return (..._args: unknown[]): Promise => { + return Promise.reject( + new Error(`fs.${name} is not supported in browser environment`) + ); + }; +}; + +// For sync functions that might be called +const notSupportedSync = (name: string) => { + return (..._args: unknown[]): never => { + throw new Error(`fs.${name} is not supported in browser environment`); + }; +}; + +// Fake Stats object for statSync/lstatSync - returns false for all checks +class FakeStats { + dev = 0; + ino = 0; + mode = 0; + nlink = 0; + uid = 0; + gid = 0; + rdev = 0; + size = 0; + blksize = 0; + blocks = 0; + atimeMs = 0; + mtimeMs = 0; + ctimeMs = 0; + birthtimeMs = 0; + atime = new Date(0); + mtime = new Date(0); + ctime = new Date(0); + birthtime = new Date(0); + + isFile(): boolean { + return false; + } + isDirectory(): boolean { + return false; + } + isBlockDevice(): boolean { + return false; + } + isCharacterDevice(): boolean { + return false; + } + isSymbolicLink(): boolean { + return false; + } + isFIFO(): boolean { + return false; + } + isSocket(): boolean { + return false; + } +} + +// Singleton fake stats instance +const fakeStats = new FakeStats(); + +// Export Stats class for libraries that reference fs.Stats +export const Stats = FakeStats; + +// Async function stubs (used by fs/promises imports) +export const readFile = notSupportedAsync('readFile'); +export const writeFile = notSupportedAsync('writeFile'); +export const mkdir = notSupportedAsync('mkdir'); +export const readdir = notSupportedAsync('readdir'); +export const stat = notSupportedAsync('stat'); +export const unlink = notSupportedAsync('unlink'); +export const rmdir = notSupportedAsync('rmdir'); +export const access = notSupportedAsync('access'); +export const copyFile = notSupportedAsync('copyFile'); +export const rename = notSupportedAsync('rename'); +export const lstat = notSupportedAsync('lstat'); +export const realpath = notSupportedAsync('realpath'); +export const chmod = notSupportedAsync('chmod'); +export const chown = notSupportedAsync('chown'); +export const utimes = notSupportedAsync('utimes'); +export const link = notSupportedAsync('link'); +export const symlink = notSupportedAsync('symlink'); +export const readlink = notSupportedAsync('readlink'); +export const truncate = notSupportedAsync('truncate'); +export const appendFile = notSupportedAsync('appendFile'); +export const open = notSupportedAsync('open'); +export const rm = notSupportedAsync('rm'); + +// Sync function stubs (used by direct fs imports) +export const readFileSync = notSupportedSync('readFileSync'); +export const writeFileSync = notSupportedSync('writeFileSync'); +export const existsSync = () => false; +export const mkdirSync = notSupportedSync('mkdirSync'); +export const readdirSync = (): string[] => []; +// Return fake stats that say "not a file, not a directory" - used by is-directory and similar +export const statSync = (): FakeStats => fakeStats; +export const unlinkSync = notSupportedSync('unlinkSync'); +export const rmdirSync = notSupportedSync('rmdirSync'); +export const accessSync = notSupportedSync('accessSync'); +export const copyFileSync = notSupportedSync('copyFileSync'); +export const renameSync = notSupportedSync('renameSync'); +// Return fake stats for lstatSync too +export const lstatSync = (): FakeStats => fakeStats; +export const realpathSync = notSupportedSync('realpathSync'); + +// Promises namespace (for `import { promises } from 'fs'`) +export const promises = { + readFile, + writeFile, + mkdir, + readdir, + stat, + unlink, + rmdir, + access, + copyFile, + rename, + lstat, + realpath, + chmod, + chown, + utimes, + link, + symlink, + readlink, + truncate, + appendFile, + open, + rm +}; + +// Constants +export const constants = { + F_OK: 0, + R_OK: 4, + W_OK: 2, + X_OK: 1, + COPYFILE_EXCL: 1, + COPYFILE_FICLONE: 2, + COPYFILE_FICLONE_FORCE: 4, + O_RDONLY: 0, + O_WRONLY: 1, + O_RDWR: 2, + O_CREAT: 64, + O_EXCL: 128, + O_TRUNC: 512, + O_APPEND: 1024, + O_DIRECTORY: 65536, + O_NOFOLLOW: 131072, + O_SYNC: 1052672, + O_DSYNC: 4096, + O_SYMLINK: 2097152, + O_NONBLOCK: 2048 +}; + +// Default export (for `import fs from 'fs'`) +export default { + readFile, + writeFile, + mkdir, + readdir, + stat, + unlink, + rmdir, + access, + copyFile, + rename, + readFileSync, + writeFileSync, + existsSync, + mkdirSync, + readdirSync, + statSync, + unlinkSync, + rmdirSync, + accessSync, + copyFileSync, + renameSync, + lstatSync, + realpathSync, + lstat, + promises, + constants, + Stats +}; diff --git a/src/browser/shims/json-schema-ref-parser.ts b/src/browser/shims/json-schema-ref-parser.ts new file mode 100644 index 00000000..c14065ce --- /dev/null +++ b/src/browser/shims/json-schema-ref-parser.ts @@ -0,0 +1,311 @@ +/* eslint-disable security/detect-object-injection */ +/** + * Browser shim for @apidevtools/json-schema-ref-parser. + * The original library uses Node.js file system APIs for dereferencing. + * In the browser, we provide implementations that resolve internal $ref + * references (those starting with #/) without file system access. + */ + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Schema = any; + +/** + * Resolve a JSON pointer (e.g., "#/components/messages/UserCreated") within a schema. + */ +function resolvePointer(schema: Schema, pointer: string): Schema | undefined { + if (!pointer.startsWith('#/')) { + return undefined; // External refs not supported in browser + } + + const parts = pointer + .slice(2) + .split('/') + .map((p) => + // Decode JSON pointer escape sequences + p.replace(/~1/g, '/').replace(/~0/g, '~') + ); + + let current = schema; + for (const part of parts) { + if (current === undefined || current === null) { + return undefined; + } + current = current[part]; + } + return current; +} + +/** + * Deep clone and dereference all internal $ref in a schema. + */ +function dereferenceInternalImpl( + schema: Schema, + root: Schema, + visited = new Set() +): Schema { + if (schema === null || typeof schema !== 'object') { + return schema; + } + + if (Array.isArray(schema)) { + return schema.map((item) => dereferenceInternalImpl(item, root, visited)); + } + + // Handle $ref + if ( + schema.$ref && + typeof schema.$ref === 'string' && + schema.$ref.startsWith('#/') + ) { + const refPath = schema.$ref; + + // Prevent circular reference infinite loops + if (visited.has(refPath)) { + // Return a reference marker for circular refs + return {...schema}; + } + + const resolved = resolvePointer(root, refPath); + if (resolved !== undefined) { + visited.add(refPath); + // Recursively dereference the resolved schema + const dereferenced = dereferenceInternalImpl(resolved, root, visited); + visited.delete(refPath); + return dereferenced; + } + } + + // Recursively process all properties + const result: Schema = {}; + for (const [key, value] of Object.entries(schema)) { + result[key] = dereferenceInternalImpl(value, root, visited); + } + return result; +} + +/** + * Exported dereferenceInternal for @readme/openapi-parser compatibility. + */ +export async function dereferenceInternal( + schema: Schema, + _options?: object +): Promise { + return dereferenceInternalImpl(schema, schema); +} + +/** + * Browser-compatible dereference that resolves internal $ref references. + */ +export async function dereference( + _basePathOrSchema: string | object, + schemaOrOptions?: object, + _options?: object +): Promise { + const schema = + typeof _basePathOrSchema === 'object' + ? _basePathOrSchema + : schemaOrOptions ?? {}; + + return dereferenceInternalImpl(schema, schema); +} + +/** + * Browser-compatible bundle that returns the input unchanged. + */ +export async function bundle( + _basePathOrSchema: string | object, + schemaOrOptions?: object, + _options?: object +): Promise { + if (typeof _basePathOrSchema === 'object') { + return _basePathOrSchema; + } + return schemaOrOptions ?? {}; +} + +/** + * Browser-compatible parse that returns the input unchanged. + */ +export async function parse( + _basePathOrSchema: string | object, + schemaOrOptions?: object, + _options?: object +): Promise { + if (typeof _basePathOrSchema === 'object') { + return _basePathOrSchema; + } + return schemaOrOptions ?? {}; +} + +/** + * Browser-compatible resolve that returns the input unchanged. + */ +export async function resolve( + _basePathOrSchema: string | object, + schemaOrOptions?: object, + _options?: object +): Promise { + if (typeof _basePathOrSchema === 'object') { + return _basePathOrSchema; + } + return schemaOrOptions ?? {}; +} + +/** + * Stub for MissingPointerError + */ +export class MissingPointerError extends Error { + constructor(message?: string) { + super(message || 'Missing pointer'); + this.name = 'MissingPointerError'; + } +} + +/** + * Stub for $RefParser class used by @readme/openapi-parser and @apidevtools/swagger-parser + * Must be a proper constructor function for util.inherits compatibility + */ +export function $RefParser(this: RefParserInstance) { + this.schema = {}; + this.$refs = { + circular: false, + paths: () => [], + values: () => ({}), + get: () => undefined + }; +} + +interface RefParserInstance { + schema: Schema; + $refs: { + circular: boolean; + paths: () => string[]; + values: () => Record; + get: (path: string) => Schema | undefined; + }; +} + +$RefParser.prototype.parse = async function ( + schema: Schema | string, + _options?: object +): Promise { + if (typeof schema === 'string') { + try { + this.schema = JSON.parse(schema); + } catch { + this.schema = {}; + } + } else { + this.schema = schema; + } + return this.schema; +}; + +$RefParser.prototype.resolve = async function ( + schema: Schema | string, + _options?: object +): Promise { + await this.parse(schema, _options); + return this; +}; + +$RefParser.prototype.bundle = async function ( + schema: Schema | string, + _options?: object +): Promise { + await this.parse(schema, _options); + return this.schema; +}; + +$RefParser.prototype.dereference = async function ( + schema: Schema | string, + _options?: object +): Promise { + await this.parse(schema, _options); + return this.schema; +}; + +/** + * Get default options for json-schema-ref-parser + */ +export function getJsonSchemaRefParserDefaultOptions(): object { + return { + parse: { + json: {order: 100}, + yaml: {order: 200}, + text: {order: 300}, + binary: {order: 400} + }, + resolve: { + file: {order: 100}, + http: {order: 200}, + external: true + }, + dereference: { + circular: true, + excludedPathMatcher: () => false + }, + continueOnError: false + }; +} + +/** + * Options constructor for swagger-parser compatibility + * swagger-parser does: util.inherits(ParserOptions, $RefParserOptions) + */ +interface OptionsInstance { + parse: object; + resolve: object; + dereference: object; + [key: string]: unknown; +} + +export function Options(this: OptionsInstance, options?: object) { + const defaults = getJsonSchemaRefParserDefaultOptions() as OptionsInstance; + Object.assign(this, defaults); + if (options) { + Object.assign(this, options); + } +} + +Options.prototype = {}; + +// Alias for backward compatibility +export {Options as $RefParserOptions}; + +/** + * Normalize arguments for parser methods (used by swagger-parser) + */ +export function normalizeArgs(args: IArguments | unknown[]): { + path: string; + schema: Schema; + options: object; + callback?: (err: Error | null, result?: Schema) => void; +} { + const argsArray = Array.from(args); + let path = ''; + let schema: Schema = {}; + let options = {}; + let callback: ((err: Error | null, result?: Schema) => void) | undefined; + + // Parse arguments based on type + for (const arg of argsArray) { + if (typeof arg === 'string') { + path = arg; + } else if (typeof arg === 'function') { + callback = arg as (err: Error | null, result?: Schema) => void; + } else if (typeof arg === 'object' && arg !== null) { + if (!schema || Object.keys(schema).length === 0) { + schema = arg; + } else { + options = arg; + } + } + } + + return {path, schema, options, callback}; +} + +// Default export - must be the $RefParser constructor for CommonJS compatibility +// swagger-parser does: const $RefParser = require('@apidevtools/json-schema-ref-parser') +export default $RefParser; diff --git a/src/browser/shims/swagger-parser.ts b/src/browser/shims/swagger-parser.ts new file mode 100644 index 00000000..819beebe --- /dev/null +++ b/src/browser/shims/swagger-parser.ts @@ -0,0 +1,43 @@ +/** + * Browser shim for @apidevtools/swagger-parser. + * We don't actually use swagger-parser in the browser - we use @readme/openapi-parser. + * This shim prevents bundling issues from transitive dependencies. + */ + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type Schema = any; + +/** + * Stub SwaggerParser that does nothing + */ +export function SwaggerParser() { + // Empty constructor +} + +SwaggerParser.prototype = { + schema: {}, + api: {}, + $refs: { + circular: false, + paths: () => [], + values: () => ({}), + get: () => undefined + }, + parse: async (schema: Schema) => schema, + async resolve() { + return this; + }, + bundle: async (schema: Schema) => schema, + dereference: async (schema: Schema) => schema, + validate: async (schema: Schema) => schema +}; + +// Static methods +SwaggerParser.parse = async (schema: Schema) => schema; +SwaggerParser.resolve = async (schema: Schema) => ({schema, $refs: {}}); +SwaggerParser.bundle = async (schema: Schema) => schema; +SwaggerParser.dereference = async (schema: Schema) => schema; +SwaggerParser.validate = async (schema: Schema) => schema; + +// Default export +export default SwaggerParser; diff --git a/src/codegen/configurations.ts b/src/codegen/configurations.ts index 27952f5e..a871a589 100644 --- a/src/codegen/configurations.ts +++ b/src/codegen/configurations.ts @@ -189,12 +189,18 @@ function ensureProperGenerators(config: TheCodegenConfiguration) { const language = (generator as any).language ?? config.language; if (generator.preset === 'channels' && language === 'typescript') { newGenerators.push( - ...includeTypeScriptChannelDependencies(config, generator) + ...(includeTypeScriptChannelDependencies( + config, + generator + ) as Generators[]) ); } if (generator.preset === 'client' && language === 'typescript') { newGenerators.push( - ...includeTypeScriptClientDependencies(config, generator) + ...(includeTypeScriptClientDependencies( + config, + generator + ) as Generators[]) ); } } diff --git a/src/codegen/generators/typescript/channels/index.ts b/src/codegen/generators/typescript/channels/index.ts index edcfb3f5..7804a8eb 100644 --- a/src/codegen/generators/typescript/channels/index.ts +++ b/src/codegen/generators/typescript/channels/index.ts @@ -1,10 +1,12 @@ /* eslint-disable no-unused-expressions */ /* eslint-disable security/detect-object-injection */ /* eslint-disable sonarjs/no-duplicate-string */ -import {TheCodegenConfiguration} from '../../../types'; -import {appendImportExtension, resolveImportExtension} from '../../../utils'; -import {mkdir, writeFile} from 'node:fs/promises'; -import path from 'node:path'; +import {TheCodegenConfiguration, GeneratedFile} from '../../../types'; +import { + appendImportExtension, + resolveImportExtension, + joinPath +} from '../../../utils'; import { defaultTypeScriptParametersOptions, TypeScriptParameterRenderType, @@ -108,13 +110,11 @@ async function finalizeGeneration( parameters: TypeScriptParameterRenderType, payloads: TypeScriptPayloadRenderType ): Promise { - await mkdir(context.generator.outputPath, {recursive: true}); - + const files: GeneratedFile[] = []; const generatedProtocols: string[] = []; const protocolFiles: Record = {}; - const filesWritten: string[] = []; - // Write one file per protocol + // Generate one file per protocol for (const [protocol, functions] of Object.entries(protocolCodeFunctions)) { if (functions.length === 0) { continue; @@ -137,18 +137,17 @@ async function finalizeGeneration( : ''; const fileContent = `${depsSection}${depsNewline}${functionsSection}${exportSection}\n`; - const protocolFilePath = path.resolve( + const protocolFilePath = joinPath( context.generator.outputPath, `${protocol}.ts` ); - await writeFile(protocolFilePath, fileContent, {}); - filesWritten.push(protocolFilePath); + files.push({path: protocolFilePath, content: fileContent}); generatedProtocols.push(protocol); protocolFiles[protocol] = fileContent; } - // Write index.ts with namespace re-exports + // Generate index.ts with namespace re-exports let indexContent: string; if (generatedProtocols.length > 0) { const ext = resolveImportExtension(context.generator, context.config); @@ -164,9 +163,8 @@ async function finalizeGeneration( indexContent = '// No protocols generated\n'; } - const indexFilePath = path.resolve(context.generator.outputPath, 'index.ts'); - await writeFile(indexFilePath, indexContent, {}); - filesWritten.push(indexFilePath); + const indexFilePath = joinPath(context.generator.outputPath, 'index.ts'); + files.push({path: indexFilePath, content: indexContent}); return { parameterRender: parameters, @@ -175,7 +173,7 @@ async function finalizeGeneration( renderedFunctions: externalProtocolFunctionInformation, result: indexContent, protocolFiles, - filesWritten + files }; } @@ -224,7 +222,7 @@ export function includeTypeScriptChannelDependencies( config: TheCodegenConfiguration, generator: TypeScriptChannelsGenerator ) { - const newGenerators: any[] = []; + const newGenerators: unknown[] = []; const parameterGeneratorId = generator.parameterGeneratorId; const payloadGeneratorId = generator.payloadGeneratorId; const headerGeneratorId = generator.headerGeneratorId; @@ -243,21 +241,21 @@ export function includeTypeScriptChannelDependencies( if (!hasParameterGenerator) { const defaultChannelParameterGenerator: TypescriptParametersGenerator = { ...defaultTypeScriptParametersOptions, - outputPath: path.resolve(generator.outputPath ?? '', './parameter') + outputPath: joinPath(generator.outputPath ?? '', './parameter') }; newGenerators.push(defaultChannelParameterGenerator); } if (!hasPayloadGenerator) { const defaultChannelPayloadGenerator: TypeScriptPayloadGenerator = { ...defaultTypeScriptPayloadGenerator, - outputPath: path.resolve(generator.outputPath ?? '', './payload') + outputPath: joinPath(generator.outputPath ?? '', './payload') }; newGenerators.push(defaultChannelPayloadGenerator); } if (!hasHeaderGenerator) { const defaultChannelHeaderGenerator: TypescriptHeadersGenerator = { ...defaultTypeScriptHeadersOptions, - outputPath: path.resolve(generator.outputPath ?? '', './headers') + outputPath: joinPath(generator.outputPath ?? '', './headers') }; newGenerators.push(defaultChannelHeaderGenerator); } diff --git a/src/codegen/generators/typescript/channels/types.ts b/src/codegen/generators/typescript/channels/types.ts index 1f629743..bce0c9c4 100644 --- a/src/codegen/generators/typescript/channels/types.ts +++ b/src/codegen/generators/typescript/channels/types.ts @@ -205,9 +205,9 @@ export interface TypeScriptChannelRenderType { */ protocolFiles: Record; /** - * Files written by this generator (absolute paths). + * Generated files with path and content. */ - filesWritten: string[]; + files: import('../../../types').GeneratedFile[]; } export interface RenderRegularParameters { diff --git a/src/codegen/generators/typescript/channels/utils.ts b/src/codegen/generators/typescript/channels/utils.ts index 39d10626..57c5908d 100644 --- a/src/codegen/generators/typescript/channels/utils.ts +++ b/src/codegen/generators/typescript/channels/utils.ts @@ -4,11 +4,12 @@ import { OutputModel } from '@asyncapi/modelina'; import {ChannelPayload} from '../../../types'; -import path from 'node:path'; import { ensureRelativePath, appendImportExtension, - ImportExtension + ImportExtension, + joinPath, + relativePath } from '../../../utils'; import {TypeScriptPayloadRenderType} from '../payloads'; import {TypeScriptParameterRenderType} from '../parameters'; @@ -25,12 +26,9 @@ export function addPayloadsToDependencies( models .filter((payload) => payload) .forEach((payload) => { - const payloadImportPath = path.relative( + const payloadImportPath = relativePath( currentGenerator.outputPath, - path.resolve( - payloadGenerator.outputPath, - payload.messageModel.modelName - ) + joinPath(payloadGenerator.outputPath, payload.messageModel.modelName) ); const importPath = appendImportExtension( `./${ensureRelativePath(payloadImportPath)}`, @@ -80,9 +78,9 @@ export function addParametersToDependencies( if (parameter === undefined) { return; } - const parameterImportPath = path.relative( + const parameterImportPath = relativePath( currentGenerator.outputPath, - path.resolve(parameterGenerator.outputPath, parameter.modelName) + joinPath(parameterGenerator.outputPath, parameter.modelName) ); const importPath = appendImportExtension( `./${ensureRelativePath(parameterImportPath)}`, @@ -121,9 +119,9 @@ export function addHeadersToDependencies( if (header === undefined) { return; } - const headerImportPath = path.relative( + const headerImportPath = relativePath( currentGenerator.outputPath, - path.resolve(headerGenerator.outputPath, header.modelName) + joinPath(headerGenerator.outputPath, header.modelName) ); const importPath = appendImportExtension( `./${ensureRelativePath(headerImportPath)}`, diff --git a/src/codegen/generators/typescript/client/index.ts b/src/codegen/generators/typescript/client/index.ts index 954ff051..44628d34 100644 --- a/src/codegen/generators/typescript/client/index.ts +++ b/src/codegen/generators/typescript/client/index.ts @@ -1,13 +1,12 @@ /* eslint-disable security/detect-object-injection */ /* eslint-disable sonarjs/no-duplicate-string */ -import {mkdir, writeFile} from 'node:fs/promises'; -import path from 'node:path'; import { defaultTypeScriptChannelsGenerator, TypeScriptChannelsGenerator } from '../channels'; import {generateNatsClient} from './protocols/nats'; -import {TheCodegenConfiguration} from '../../../types'; +import {TheCodegenConfiguration, GeneratedFile} from '../../../types'; +import {joinPath} from '../../../utils'; import { SupportedProtocols, TypeScriptClientContext, @@ -40,22 +39,20 @@ export async function generateTypeScriptClient( }); } - await mkdir(context.generator.outputPath, {recursive: true}); const renderedProtocols: Record = { nats: '' }; - const filesWritten: string[] = []; + const files: GeneratedFile[] = []; for (const protocol of generator.protocols) { switch (protocol) { case 'nats': { const renderedResult = await generateNatsClient(context); - const filePath = path.resolve( + const filePath = joinPath( context.generator.outputPath, 'NatsClient.ts' ); - await writeFile(filePath, renderedResult); - filesWritten.push(filePath); + files.push({path: filePath, content: renderedResult}); renderedProtocols[protocol] = renderedResult; break; } @@ -65,7 +62,7 @@ export async function generateTypeScriptClient( } return { protocolResult: renderedProtocols, - filesWritten + files }; } @@ -76,7 +73,7 @@ export function includeTypeScriptClientDependencies( config: TheCodegenConfiguration, generator: TypeScriptClientGenerator ) { - const newGenerators: any[] = []; + const newGenerators: unknown[] = []; const channelsGeneratorId = generator.channelsGeneratorId; const hasChannelsGenerator = config.generators.find( @@ -86,7 +83,7 @@ export function includeTypeScriptClientDependencies( const defaultChannelPayloadGenerator: TypeScriptChannelsGenerator = { ...defaultTypeScriptChannelsGenerator, protocols: generator.protocols, - outputPath: path.resolve(generator.outputPath ?? '', './channels') + outputPath: joinPath(generator.outputPath ?? '', './channels') }; newGenerators.push(defaultChannelPayloadGenerator); } diff --git a/src/codegen/generators/typescript/client/protocols/nats.ts b/src/codegen/generators/typescript/client/protocols/nats.ts index 02b527b6..b9e9d7ad 100644 --- a/src/codegen/generators/typescript/client/protocols/nats.ts +++ b/src/codegen/generators/typescript/client/protocols/nats.ts @@ -1,6 +1,5 @@ /* eslint-disable security/detect-object-injection */ /* eslint-disable sonarjs/no-duplicate-string */ -import path from 'node:path'; import { ChannelFunctionTypes, TypeScriptChannelRenderType @@ -8,7 +7,9 @@ import { import { ensureRelativePath, appendImportExtension, - resolveImportExtension + resolveImportExtension, + joinPath, + relativePath } from '../../../../utils'; import {TypeScriptClientContext} from '..'; import {renderCoreSubscribe} from './nats/coreSubscribe'; @@ -114,9 +115,9 @@ export async function generateNatsClient( break; } } - const natsChannelsImportPath = path.relative( + const natsChannelsImportPath = relativePath( context.generator.outputPath, - path.resolve(channels.generator.outputPath, 'nats') + joinPath(channels.generator.outputPath, 'nats') ); const channelImportPath = appendImportExtension( `./${ensureRelativePath(natsChannelsImportPath)}`, diff --git a/src/codegen/generators/typescript/client/types.ts b/src/codegen/generators/typescript/client/types.ts index a9daf954..dea05927 100644 --- a/src/codegen/generators/typescript/client/types.ts +++ b/src/codegen/generators/typescript/client/types.ts @@ -48,7 +48,7 @@ export interface TypeScriptClientContext extends GenericCodegenContext { export interface TypeScriptClientRenderType { protocolResult: Record; /** - * Files written by this generator (absolute paths). + * Generated files with path and content. */ - filesWritten: string[]; + files: import('../../../types').GeneratedFile[]; } diff --git a/src/codegen/generators/typescript/headers.ts b/src/codegen/generators/typescript/headers.ts index 2a6c5eb9..a997259d 100644 --- a/src/codegen/generators/typescript/headers.ts +++ b/src/codegen/generators/typescript/headers.ts @@ -1,7 +1,11 @@ /* eslint-disable security/detect-object-injection */ import {OutputModel, TypeScriptFileGenerator} from '@asyncapi/modelina'; import {AsyncAPIDocumentInterface} from '@asyncapi/parser'; -import {GenericCodegenContext, HeadersRenderType} from '../../types'; +import { + GenericCodegenContext, + HeadersRenderType, + GeneratedFile +} from '../../types'; import {z} from 'zod'; import {defaultCodegenTypescriptModelinaOptions} from './utils'; import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; @@ -14,6 +18,7 @@ import { } from '@asyncapi/modelina'; import {createValidationPreset} from '../../modelina/presets'; import {createMissingInputDocumentError} from '../../errors'; +import {generateModels} from '../../output'; export const zodTypescriptHeadersGenerator = z.object({ id: z.string().optional().default('headers-typescript'), @@ -59,7 +64,7 @@ export interface ProcessedHeadersData { channelHeaders: Record< string, | { - schema: any; + schema: unknown; schemaId: string; } | undefined @@ -75,9 +80,10 @@ export async function generateTypescriptHeadersCore({ context: TypescriptHeadersContext; }): Promise<{ channelModels: Record; - filesWritten: string[]; + files: GeneratedFile[]; }> { const {generator} = context; + const modelinaGenerator = new TypeScriptFileGenerator({ ...defaultCodegenTypescriptModelinaOptions, constraints: { @@ -105,32 +111,36 @@ export async function generateTypescriptHeadersCore({ }); const channelModels: Record = {}; - const filesWritten: string[] = []; + const files: GeneratedFile[] = []; for (const [channelId, headerData] of Object.entries( processedData.channelHeaders )) { if (headerData) { - const models = await modelinaGenerator.generateToFiles( - headerData.schema, - generator.outputPath, - {exportType: 'named'}, - true - ); - channelModels[channelId] = models[0]; - - // Track files written - for (const model of models) { - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } - } + const result = await generateModels({ + generator: modelinaGenerator, + input: headerData.schema, + outputPath: generator.outputPath + }); + channelModels[channelId] = + result.models.length > 0 ? result.models[0] : undefined; + files.push(...result.files); } else { channelModels[channelId] = undefined; } } - return {channelModels, filesWritten: [...new Set(filesWritten)]}; + // Deduplicate files by path + const uniqueFiles: GeneratedFile[] = []; + const seenPaths = new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); + } + } + + return {channelModels, files: uniqueFiles}; } // Main generator function that orchestrates input processing and generation @@ -166,7 +176,7 @@ export async function generateTypescriptHeaders( } // Generate models using processed data - const {channelModels, filesWritten} = await generateTypescriptHeadersCore({ + const {channelModels, files} = await generateTypescriptHeadersCore({ processedData, context }); @@ -174,6 +184,6 @@ export async function generateTypescriptHeaders( return { channelModels, generator, - filesWritten + files }; } diff --git a/src/codegen/generators/typescript/models.ts b/src/codegen/generators/typescript/models.ts index 31dd3eb5..3e47ec52 100644 --- a/src/codegen/generators/typescript/models.ts +++ b/src/codegen/generators/typescript/models.ts @@ -11,6 +11,7 @@ import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; import {zodTypeScriptOptions, zodTypeScriptPresets} from '../../modelina'; import {JsonSchemaDocument} from '../../inputs/jsonschema'; import {CodegenError, ErrorType} from '../../errors'; +import {generateModels} from '../../output'; export const zodTypescriptModelsGenerator = z.object({ id: z.string().optional().default('models-typescript'), @@ -71,23 +72,14 @@ export async function generateTypescriptModels( }); } - const models = await modelGenerator.generateToFiles( - inputDocument, - generator.outputPath, - {exportType: 'named'}, - true - ); - - // Track files written - const filesWritten: string[] = []; - for (const model of models) { - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } - } + const result = await generateModels({ + generator: modelGenerator, + input: inputDocument, + outputPath: generator.outputPath + }); return { generator, - filesWritten: [...new Set(filesWritten)] + files: result.files }; } diff --git a/src/codegen/generators/typescript/parameters.ts b/src/codegen/generators/typescript/parameters.ts index 77eb5320..d4297a6d 100644 --- a/src/codegen/generators/typescript/parameters.ts +++ b/src/codegen/generators/typescript/parameters.ts @@ -1,7 +1,11 @@ /* eslint-disable security/detect-object-injection, sonarjs/cognitive-complexity */ import {OutputModel, TypeScriptFileGenerator} from '@asyncapi/modelina'; import {AsyncAPIDocumentInterface} from '@asyncapi/parser'; -import {GenericCodegenContext, ParameterRenderType} from '../../types'; +import { + GenericCodegenContext, + ParameterRenderType, + GeneratedFile +} from '../../types'; import {z} from 'zod'; import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; import { @@ -14,6 +18,7 @@ import { processOpenAPIParameters } from '../../inputs/openapi/generators/parameters'; import {createMissingInputDocumentError} from '../../errors'; +import {generateModels} from '../../output'; export const zodTypescriptParametersGenerator = z.object({ id: z.string().optional().default('parameters-typescript'), @@ -54,7 +59,7 @@ export async function generateTypescriptParameters( const {asyncapiDocument, openapiDocument, inputType, generator} = context; const channelModels: Record = {}; - const filesWritten: string[] = []; + const files: GeneratedFile[] = []; let processedSchemaData: ProcessedParameterSchemaData; let parameterGenerator: TypeScriptFileGenerator; @@ -93,28 +98,32 @@ export async function generateTypescriptParameters( processedSchemaData.channelParameters )) { if (schemaData) { - const models = await parameterGenerator.generateToFiles( - schemaData.schema, - generator.outputPath, - {exportType: 'named'}, - true - ); - channelModels[channelId] = models.length > 0 ? models[0] : undefined; - - // Track files written - for (const model of models) { - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } - } + const result = await generateModels({ + generator: parameterGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + channelModels[channelId] = + result.models.length > 0 ? result.models[0] : undefined; + files.push(...result.files); } else { channelModels[channelId] = undefined; } } + // Deduplicate files by path + const uniqueFiles: GeneratedFile[] = []; + const seenPaths = new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); + } + } + return { channelModels, generator, - filesWritten: [...new Set(filesWritten)] + files: uniqueFiles }; } diff --git a/src/codegen/generators/typescript/payloads.ts b/src/codegen/generators/typescript/payloads.ts index 9a9e3393..9883e11e 100644 --- a/src/codegen/generators/typescript/payloads.ts +++ b/src/codegen/generators/typescript/payloads.ts @@ -4,7 +4,11 @@ import { OutputModel, ConstrainedObjectModel } from '@asyncapi/modelina'; -import {GenericCodegenContext, PayloadRenderType} from '../../types'; +import { + GenericCodegenContext, + PayloadRenderType, + GeneratedFile +} from '../../types'; import {AsyncAPIDocumentInterface} from '@asyncapi/parser'; import { processAsyncAPIPayloads, @@ -21,6 +25,7 @@ import { createPrimitivesPreset } from '../../modelina/presets'; import {createMissingInputDocumentError} from '../../errors'; +import {generateModels} from '../../output'; export const zodTypeScriptPayloadGenerator = z.object({ id: z.string().optional().default('payloads-typescript'), @@ -113,7 +118,7 @@ export async function generateTypescriptPayloadsCore( operationModels: processedData.operationModels, otherModels: processedData.otherModels, generator, - filesWritten: [] + files: [] }; } @@ -127,6 +132,7 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ context: TypeScriptPayloadContext; }): Promise { const generator = context.generator; + const modelinaGenerator = new TypeScriptFileGenerator({ ...defaultCodegenTypescriptModelinaOptions, presets: [ @@ -172,19 +178,21 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ > = {}; const otherModels: Array<{messageModel: OutputModel; messageType: string}> = []; - const filesWritten: string[] = []; + const files: GeneratedFile[] = []; // Generate models for channel payloads for (const [channelId, schemaData] of Object.entries( processedSchemaData.channelPayloads )) { if (schemaData) { - const models = await modelinaGenerator.generateToFiles( - schemaData.schema, - generator.outputPath, - {exportType: 'named'}, - true - ); + const result = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + const models = result.models; + files.push(...result.files); + if (models.length > 0) { //Use first model as the root message model const messageModel = models[0].model; @@ -197,13 +205,6 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ messageType }; - // Track files written - for (const model of models) { - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } - } - // Add any additional models to otherModels for (let i = 1; i < models.length; i++) { const additionalModel = models[i].model; @@ -221,12 +222,14 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ processedSchemaData.operationPayloads )) { if (schemaData) { - const models = await modelinaGenerator.generateToFiles( - schemaData.schema, - generator.outputPath, - {exportType: 'named'}, - true - ); + const result = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + const models = result.models; + files.push(...result.files); + if (models.length > 0) { //Use first model as the root message model const messageModel = models[0].model; @@ -239,13 +242,6 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ messageType }; - // Track files written - for (const model of models) { - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } - } - // Add any additional models to otherModels for (let i = 1; i < models.length; i++) { const additionalModel = models[i].model; @@ -260,13 +256,14 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ // Generate models for other payloads for (const schemaData of processedSchemaData.otherPayloads) { - const models = await modelinaGenerator.generateToFiles( - schemaData.schema, - generator.outputPath, - {exportType: 'named'}, - true - ); - for (const model of models) { + const result = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + files.push(...result.files); + + for (const model of result.models) { const messageModel = model.model; let messageType = messageModel.type; if (!(messageModel instanceof ConstrainedObjectModel)) { @@ -276,10 +273,16 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ messageModel: model, messageType }); - // Track file written - if (model.modelName) { - filesWritten.push(`${generator.outputPath}/${model.modelName}.ts`); - } + } + } + + // Deduplicate files by path + const uniqueFiles: GeneratedFile[] = []; + const seenPaths = new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); } } @@ -288,7 +291,7 @@ export async function generateTypescriptPayloadsCoreFromSchemas({ operationModels, otherModels, generator, - filesWritten: [...new Set(filesWritten)] // deduplicate + files: uniqueFiles }; } diff --git a/src/codegen/generators/typescript/types.ts b/src/codegen/generators/typescript/types.ts index 6fe93e55..db3ed2a1 100644 --- a/src/codegen/generators/typescript/types.ts +++ b/src/codegen/generators/typescript/types.ts @@ -1,5 +1,9 @@ import {AsyncAPIDocumentInterface} from '@asyncapi/parser'; -import {GenericCodegenContext, TypesRenderType} from '../../types'; +import { + GenericCodegenContext, + TypesRenderType, + GeneratedFile +} from '../../types'; import {z} from 'zod'; import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; import {generateAsyncAPITypes} from '../../inputs/asyncapi/generators/types'; @@ -43,7 +47,7 @@ export async function generateTypescriptTypes( const {asyncapiDocument, openapiDocument, inputType, generator} = context; let result: string; - let filesWritten: string[] = []; + let files: GeneratedFile[] = []; switch (inputType) { case 'asyncapi': @@ -59,7 +63,7 @@ export async function generateTypescriptTypes( generator ); result = asyncAPIResult.result; - filesWritten = asyncAPIResult.filesWritten; + files = asyncAPIResult.files; } break; case 'openapi': @@ -75,7 +79,7 @@ export async function generateTypescriptTypes( generator ); result = openAPIResult.result; - filesWritten = openAPIResult.filesWritten; + files = openAPIResult.files; } break; default: @@ -85,6 +89,6 @@ export async function generateTypescriptTypes( return { result, generator, - filesWritten + files }; } diff --git a/src/codegen/generators/typescript/utils.ts b/src/codegen/generators/typescript/utils.ts index 6625c92b..637d9dd6 100644 --- a/src/codegen/generators/typescript/utils.ts +++ b/src/codegen/generators/typescript/utils.ts @@ -102,7 +102,7 @@ export function realizeChannelName( parameters?: ConstrainedObjectModel ) { let returnString = `\`${channelName}\``; - returnString = returnString.replaceAll('/', '.'); + returnString = returnString.replace(/\//g, '.'); for (const paramName in parameters) { returnString = returnString.replace(`{${paramName}}`, `\${${paramName}}`); } @@ -127,11 +127,8 @@ export function pascalCase(value: string) { return FormatHelpers.toPascalCase(value); } export function findRegexFromChannel(channel: string): string { - let topicWithWildcardGroup = channel.replaceAll(/\//g, '\\/'); - topicWithWildcardGroup = topicWithWildcardGroup.replaceAll( - /{[^}]+}/g, - '([^.]*)' - ); + let topicWithWildcardGroup = channel.replace(/\//g, '\\/'); + topicWithWildcardGroup = topicWithWildcardGroup.replace(/{[^}]+}/g, '([^.]*)'); return `/^${topicWithWildcardGroup}$/`; } export const RESERVED_TYPESCRIPT_KEYWORDS = [ diff --git a/src/codegen/inputs/asyncapi/generators/payloads.ts b/src/codegen/inputs/asyncapi/generators/payloads.ts index 3e42ba7e..4dbc79c3 100644 --- a/src/codegen/inputs/asyncapi/generators/payloads.ts +++ b/src/codegen/inputs/asyncapi/generators/payloads.ts @@ -23,6 +23,8 @@ export async function processAsyncAPIPayloads( const channelPayloads: Record = {}; const operationPayloads: Record = {}; const otherPayloads: {schema: any; schemaId: string}[] = []; + + const allChannels = asyncapiDocument.allChannels().all(); const processMessages = ( messagesToProcess: MessageInterface[], preId: string diff --git a/src/codegen/inputs/asyncapi/generators/types.ts b/src/codegen/inputs/asyncapi/generators/types.ts index 0bfce9e9..1188323c 100644 --- a/src/codegen/inputs/asyncapi/generators/types.ts +++ b/src/codegen/inputs/asyncapi/generators/types.ts @@ -1,11 +1,11 @@ import {AsyncAPIDocumentInterface} from '@asyncapi/parser'; import {TypescriptTypesGeneratorInternal} from '../../../generators/typescript/types'; -import path from 'path'; -import {mkdir, writeFile} from 'fs/promises'; +import {GeneratedFile} from '../../../types'; export interface TypesGeneratorResult { result: string; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export async function generateAsyncAPITypes( @@ -68,12 +68,10 @@ ${allChannels result += topicIdsPart + toTopicIdsPart + toTopicsPart + topicsMap; } - await mkdir(generator.outputPath, {recursive: true}); - const filePath = path.resolve(generator.outputPath, 'Types.ts'); - await writeFile(filePath, result, {}); + const filePath = `${generator.outputPath}/Types.ts`; return { result, - filesWritten: [filePath] + files: [{path: filePath, content: result}] }; } diff --git a/src/codegen/inputs/openapi/generators/types.ts b/src/codegen/inputs/openapi/generators/types.ts index 05a34725..11083679 100644 --- a/src/codegen/inputs/openapi/generators/types.ts +++ b/src/codegen/inputs/openapi/generators/types.ts @@ -1,12 +1,12 @@ /* eslint-disable security/detect-object-injection */ import {OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'openapi-types'; import {TypescriptTypesGeneratorInternal} from '../../../generators/typescript/types'; -import path from 'path'; -import {mkdir, writeFile} from 'fs/promises'; +import {GeneratedFile} from '../../../types'; export interface TypesGeneratorResult { result: string; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export async function generateOpenAPITypes( @@ -113,12 +113,10 @@ ${Object.entries(operationIdToPathMap) result += toPathPart + toOperationIdsPart + pathsMap; } - await mkdir(generator.outputPath, {recursive: true}); - const filePath = path.resolve(generator.outputPath, 'Types.ts'); - await writeFile(filePath, result, {}); + const filePath = `${generator.outputPath}/Types.ts`; return { result, - filesWritten: [filePath] + files: [{path: filePath, content: result}] }; } diff --git a/src/codegen/output/filesystem.ts b/src/codegen/output/filesystem.ts new file mode 100644 index 00000000..d98b5a12 --- /dev/null +++ b/src/codegen/output/filesystem.ts @@ -0,0 +1,63 @@ +/** + * FileSystemAdapter - Output adapter for CLI/Node.js environments. + * Writes files to the local filesystem. + */ +import {mkdir, writeFile} from 'node:fs/promises'; +import {cwd} from 'node:process'; +import path from 'node:path'; +import {OutputAdapter, OutputAdapterOptions} from './types'; + +/** + * FileSystemAdapter writes files to disk using Node.js fs APIs. + * Used in CLI context for actual file generation. + */ +export class FileSystemAdapter implements OutputAdapter { + private writtenFiles: string[] = []; + private basePath: string; + + constructor(options?: OutputAdapterOptions) { + this.basePath = options?.basePath ?? cwd(); + } + + /** + * Write content to a file on disk. + * Creates parent directories if they don't exist. + */ + async write(filePath: string, content: string): Promise { + const resolvedPath = path.isAbsolute(filePath) + ? filePath + : path.resolve(this.basePath, filePath); + + // Ensure parent directory exists + const parentDir = path.dirname(resolvedPath); + await mkdir(parentDir, {recursive: true}); + + await writeFile(resolvedPath, content); + this.writtenFiles.push(resolvedPath); + } + + /** + * Create a directory on disk. + */ + async mkdir(dirPath: string, options?: {recursive?: boolean}): Promise { + const resolvedPath = path.isAbsolute(dirPath) + ? dirPath + : path.resolve(this.basePath, dirPath); + await mkdir(resolvedPath, options); + } + + /** + * Get all file paths that were written. + */ + getWrittenFiles(): string[] { + return [...this.writtenFiles]; + } + + /** + * FileSystemAdapter doesn't keep content in memory. + * Returns empty object - use getWrittenFiles() for paths. + */ + getAllFiles(): Record { + return {}; + } +} diff --git a/src/codegen/output/index.ts b/src/codegen/output/index.ts new file mode 100644 index 00000000..667ec262 --- /dev/null +++ b/src/codegen/output/index.ts @@ -0,0 +1,46 @@ +/** + * Output adapter module. + * Provides abstractions for file output operations that work in both + * CLI (filesystem) and browser (memory) environments. + */ +import path from 'path'; +import {GeneratedFile} from '../types'; +import {FileSystemAdapter} from './filesystem'; + +export * from './types'; +export {FileSystemAdapter} from './filesystem'; +export {MemoryAdapter} from './memory'; +export {generateModels} from './modelina'; +export type {GenerateModelsArgs, GenerateModelsResult} from './modelina'; + +// Re-export GeneratedFile type for convenience +export type {GeneratedFile} from '../types'; + +/** + * Write generated files to disk. + * This is the I/O boundary - called by CLI after pure generation. + * + * @param files - The generated files with path and content + * @param basePath - The base path to resolve relative paths from + * @returns Array of absolute paths that were written + */ +export async function writeGeneratedFiles( + files: GeneratedFile[], + basePath: string +): Promise { + const adapter = new FileSystemAdapter({basePath}); + const writtenPaths: string[] = []; + + for (const file of files) { + // Ensure directory exists + const dirPath = path.dirname(file.path); + if (dirPath && dirPath !== '.') { + await adapter.mkdir(dirPath, {recursive: true}); + } + + await adapter.write(file.path, file.content); + writtenPaths.push(path.resolve(basePath, file.path)); + } + + return writtenPaths; +} diff --git a/src/codegen/output/memory.ts b/src/codegen/output/memory.ts new file mode 100644 index 00000000..1119abb8 --- /dev/null +++ b/src/codegen/output/memory.ts @@ -0,0 +1,97 @@ +/* eslint-disable security/detect-object-injection */ +/** + * MemoryAdapter - Output adapter for browser environments. + * Stores files in memory instead of writing to disk. + */ +import {OutputAdapter, OutputAdapterOptions} from './types'; + +/** + * MemoryAdapter stores files in memory using a Map. + * Used in browser context for in-memory code generation. + */ +export class MemoryAdapter implements OutputAdapter { + private files = new Map(); + private basePath: string; + + constructor(options?: OutputAdapterOptions) { + // Normalize basePath - remove trailing slashes + this.basePath = (options?.basePath ?? '').replace(/\/+$/, ''); + } + + /** + * Write content to memory. + */ + async write(filePath: string, content: string): Promise { + const resolvedPath = this.resolvePath(filePath); + this.files.set(resolvedPath, content); + } + + /** + * No-op for memory adapter - directories are virtual. + */ + async mkdir( + _dirPath: string, + _options?: {recursive?: boolean} + ): Promise { + // No-op - directories are virtual in memory + } + + /** + * Get all file paths that were written. + */ + getWrittenFiles(): string[] { + return [...this.files.keys()]; + } + + /** + * Get all files with their content. + */ + getAllFiles(): Record { + const result: Record = {}; + for (const [filePath, content] of this.files) { + result[filePath] = content; + } + return result; + } + + /** + * Read a file from memory. + * @param filePath - The file path + * @returns The file content, or undefined if not found + */ + read(filePath: string): string | undefined { + return this.files.get(this.resolvePath(filePath)); + } + + /** + * Clear all files from memory. + */ + clear(): void { + this.files.clear(); + } + + /** + * Check if a file exists. + */ + has(filePath: string): boolean { + return this.files.has(this.resolvePath(filePath)); + } + + /** + * Get the number of files. + */ + get size(): number { + return this.files.size; + } + + /** + * Resolve a file path with the base path. + */ + private resolvePath(filePath: string): string { + if (!this.basePath) { + return filePath; + } + // Normalize to avoid double slashes + return `${this.basePath}/${filePath}`.replace(/\/+/g, '/'); + } +} diff --git a/src/codegen/output/modelina.ts b/src/codegen/output/modelina.ts new file mode 100644 index 00000000..e02f41b2 --- /dev/null +++ b/src/codegen/output/modelina.ts @@ -0,0 +1,67 @@ +/* eslint-disable security/detect-object-injection */ +/** + * Modelina integration for pure-core code generation. + * Generates models in-memory and returns them as GeneratedFile[]. + * No I/O is performed - writing files is handled by the CLI layer. + */ +import { + TypeScriptFileGenerator, + TypeScriptRenderCompleteModelOptions, + OutputModel +} from '@asyncapi/modelina'; +import {GeneratedFile} from '../types'; + +export interface GenerateModelsArgs { + /** The Modelina generator instance */ + generator: TypeScriptFileGenerator; + /** The input schema (JSON Schema or any format Modelina accepts) */ + input: unknown; + /** The output path to use for file names (e.g., 'src/models') */ + outputPath: string; + /** Optional render options */ + options?: Partial; +} + +export interface GenerateModelsResult { + /** The generated models */ + models: OutputModel[]; + /** Generated files with path and content */ + files: GeneratedFile[]; +} + +/** + * Generate models using Modelina. + * Returns files as data - no I/O is performed. + * + * @returns The generated models and files + */ +export async function generateModels({ + generator, + input, + outputPath, + options = {} +}: GenerateModelsArgs): Promise { + const files: GeneratedFile[] = []; + + // Use Modelina's generateCompleteModels() which returns OutputModel[] with rendered content + // This is the same method used by generateToFiles() internally, but without writing to disk + const models = await generator.generateCompleteModels(input, { + exportType: options.exportType ?? 'named' + }); + + // Filter out any models that weren't successfully generated + const validModels = models.filter((model) => model.modelName !== ''); + + // Collect files as data (no I/O) + for (const model of validModels) { + const fileName = `${model.modelName}.ts`; + const filePath = `${outputPath}/${fileName}`; + + files.push({path: filePath, content: model.result}); + } + + return { + models: validModels, + files + }; +} diff --git a/src/codegen/output/types.ts b/src/codegen/output/types.ts new file mode 100644 index 00000000..f5215e14 --- /dev/null +++ b/src/codegen/output/types.ts @@ -0,0 +1,50 @@ +/** + * Output adapter types for abstracting file output operations. + * Allows generators to work in both CLI (filesystem) and browser (memory) environments. + */ + +/** + * Abstract interface for file output operations. + * Allows generators to work in both CLI (filesystem) and browser (memory) environments. + */ +export interface OutputAdapter { + /** + * Write content to a file path. + * @param filePath - The file path to write to (relative or absolute) + * @param content - The content to write + */ + write(filePath: string, content: string): Promise; + + /** + * Create a directory. + * @param dirPath - The directory path to create + * @param options - Options (e.g., recursive) + */ + mkdir(dirPath: string, options?: {recursive?: boolean}): Promise; + + /** + * Get all written files (for tracking/reporting). + * @returns Array of file paths that were written + */ + getWrittenFiles(): string[]; + + /** + * Get all files with their content. + * For FileSystemAdapter, this returns an empty object (use getWrittenFiles() for paths). + * For MemoryAdapter, this returns all files with their content. + * @returns Record of path to content + */ + getAllFiles(): Record; +} + +/** + * Options for OutputAdapter implementations. + */ +export interface OutputAdapterOptions { + /** + * Base path for resolving relative paths. + * For FileSystemAdapter: directory on disk + * For MemoryAdapter: prefix for virtual paths + */ + basePath?: string; +} diff --git a/src/codegen/renderer.ts b/src/codegen/renderer.ts index 39c3180d..ccdcaef1 100644 --- a/src/codegen/renderer.ts +++ b/src/codegen/renderer.ts @@ -5,7 +5,8 @@ import { Generators, GeneratorsInternal, RenderTypes, - RunGeneratorContext + RunGeneratorContext, + GeneratedFile } from './types'; import { generateTypeScriptChannels, @@ -36,7 +37,7 @@ type GraphType = Graph; export async function renderGenerator( generator: GeneratorsInternal, context: RunGeneratorContext, - renderedContext: Record + renderedContext: Record ): Promise { const { configuration, @@ -289,19 +290,37 @@ export function determineRenderGraph(context: RunGeneratorContext): GraphType { return graph; } +/** + * Extract files from render result. + * Generators now return `files: GeneratedFile[]` instead of `filesWritten: string[]`. + */ +function extractFilesFromResult(result: RenderTypes): GeneratedFile[] { + // Type guard to check for files property + if ( + result && + typeof result === 'object' && + 'files' in result && + Array.isArray((result as {files: unknown}).files) + ) { + return (result as {files: GeneratedFile[]}).files; + } + return []; +} + /** * Recursively go over all nodes and render those that are ready to be rendered (no dependencies that have not been rendered) and recursively do it until no nodes are left */ +// eslint-disable-next-line sonarjs/cognitive-complexity export async function renderGraph( context: RunGeneratorContext, graph: GraphType ): Promise { const startTime = Date.now(); - const renderedContext: any = {}; + const renderedContext: Record = {}; const generatorResults: GeneratorResult[] = []; const recursivelyRenderGenerators = async ( - nodesToRender: any[], + nodesToRender: Array<{node: string; attributes: {generator: Generators}}>, previousCount?: number ) => { const count = nodesToRender.length; @@ -309,7 +328,7 @@ export async function renderGraph( throw createCircularDependencyError(); } - const nodesToRenderNext: any[] = []; + const nodesToRenderNext: typeof nodesToRender = []; const alreadyRenderedNodes = Object.keys(renderedContext); for (const nodeEntry of nodesToRender) { const dependencies = graph.inEdgeEntries(nodeEntry.node); @@ -324,21 +343,23 @@ export async function renderGraph( if (allRendered) { const generatorStartTime = Date.now(); - Logger.updateSpinner( - `Generating ${nodeEntry.attributes.generator.preset}...` - ); + const generator = nodeEntry.attributes.generator; + Logger.updateSpinner(`Generating ${generator.preset}...`); const result = await renderGenerator( - nodeEntry.attributes.generator, + generator as GeneratorsInternal, context, renderedContext ); renderedContext[nodeEntry.node] = result; - // Record generator result - extract filesWritten from result + // Extract files from result + const files = extractFilesFromResult(result); + + // Record generator result with files generatorResults.push({ - id: nodeEntry.attributes.generator.id, - preset: nodeEntry.attributes.generator.preset, - filesWritten: (result as any)?.filesWritten ?? [], + id: generator.id!, + preset: generator.preset!, + files, duration: Date.now() - generatorStartTime }); } else { @@ -351,15 +372,19 @@ export async function renderGraph( }; await recursivelyRenderGenerators([...graph.nodeEntries()]); - // Collect all files (deduplicated) - const allFiles = [ - ...new Set(generatorResults.flatMap((g) => g.filesWritten)) - ]; + // Collect all files (deduplicated by path) + const allFilesMap = new Map(); + for (const result of generatorResults) { + for (const file of result.files) { + // Later files with same path override earlier ones + allFilesMap.set(file.path, file); + } + } + const allFiles = Array.from(allFilesMap.values()); return { generators: generatorResults, - totalFiles: allFiles.length, - totalDuration: Date.now() - startTime, - allFiles + files: allFiles, + totalDuration: Date.now() - startTime }; } diff --git a/src/codegen/types.ts b/src/codegen/types.ts index dffeb720..8b4da299 100644 --- a/src/codegen/types.ts +++ b/src/codegen/types.ts @@ -62,6 +62,17 @@ export type PresetTypes = | 'models' | 'custom' | 'client'; + +/** + * A generated file with path and content. + * Returned by generators - no I/O performed. + */ +export interface GeneratedFile { + /** Relative path (e.g., 'src/payloads/User.ts') */ + path: string; + /** File content */ + content: string; +} export interface LoadArgument { configPath: string; configType: 'esm' | 'json' | 'yaml'; @@ -142,21 +153,25 @@ export type RenderTypes = export interface ParameterRenderType { channelModels: Record; generator: GeneratorType; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export interface HeadersRenderType { channelModels: Record; generator: GeneratorType; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export interface TypesRenderType { result: string; generator: GeneratorType; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export interface ModelsRenderType { generator: GeneratorType; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export interface ChannelPayload { messageModel: OutputModel; @@ -172,7 +187,8 @@ export interface PayloadRenderType { operationModels: Record; otherModels: ChannelPayload[]; generator: GeneratorType; - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; } export interface SingleFunctionRenderType { functionName: string; @@ -341,8 +357,8 @@ export interface GeneratorResult { id: string; /** Generator preset type */ preset: string; - /** Files written by this generator (absolute paths) */ - filesWritten: string[]; + /** Generated files with path and content */ + files: GeneratedFile[]; /** Duration in milliseconds */ duration: number; } @@ -353,10 +369,8 @@ export interface GeneratorResult { export interface GenerationResult { /** Results from each generator */ generators: GeneratorResult[]; - /** Total number of files written */ - totalFiles: number; + /** All generated files with path and content */ + files: GeneratedFile[]; /** Total duration in milliseconds */ totalDuration: number; - /** All file paths written (deduplicated, absolute) */ - allFiles: string[]; } diff --git a/src/codegen/utils.ts b/src/codegen/utils.ts index eed9ce42..6a5c2379 100644 --- a/src/codegen/utils.ts +++ b/src/codegen/utils.ts @@ -104,7 +104,7 @@ export function getOSType(): 'windows' | 'unix' | 'macos' { */ export function ensureRelativePath(pathToCheck: string) { if (getOSType() === 'windows') { - return pathToCheck.replaceAll('\\', '/'); + return pathToCheck.replace(/\\/g, '/'); } return pathToCheck; } @@ -272,3 +272,142 @@ export function resolveImportExtension( ): ImportExtension { return generator.importExtension ?? config?.importExtension ?? 'none'; } + +/** + * Portable path join function that works in both Node.js and browser environments. + * Joins path segments with forward slashes and normalizes the result. + * + * @param segments - Path segments to join + * @returns Joined path with normalized slashes + * + * @example + * joinPath('src/models', 'User.ts') // => 'src/models/User.ts' + * joinPath('src/models/', '/User.ts') // => 'src/models/User.ts' + * joinPath('./src', './models', 'User.ts') // => './src/models/User.ts' + */ +export function joinPath(...segments: string[]): string { + // Filter out empty segments + const filtered = segments.filter((s) => s !== ''); + if (filtered.length === 0) { + return ''; + } + + // Join all segments, preserving leading ./ if present + const preserveLeadingDot = filtered[0].startsWith('./'); + const preserveLeadingSlash = filtered[0].startsWith('/'); + + // Join and normalize + const joined = filtered + .map((segment, index) => { + // Remove leading slash from non-first segments + if (index > 0 && segment.startsWith('/')) { + segment = segment.slice(1); + } + // Remove leading ./ from non-first segments + if (index > 0 && segment.startsWith('./')) { + segment = segment.slice(2); + } + // Remove trailing slash from all but last segment + if (index < filtered.length - 1 && segment.endsWith('/')) { + segment = segment.slice(0, -1); + } + return segment; + }) + .join('/'); + + // Normalize multiple slashes + let result = joined.replace(/\/+/g, '/'); + + // Restore leading pattern if needed + if (preserveLeadingDot && !result.startsWith('./')) { + result = `./${result}`; + } else if (preserveLeadingSlash && !result.startsWith('/')) { + result = `/${result}`; + } + + return result; +} + +/** + * Checks if a path is absolute (starts with drive letter or /) + */ +function isAbsolutePath(p: string): boolean { + // Windows drive letter (C:/) or Unix absolute (/) + return (/^[a-zA-Z]:[\\/]/).test(p) || p.startsWith('/'); +} + +/** + * Portable relative path function that works in both Node.js and browser environments. + * Computes the relative path from one location to another. + * + * @param from - The starting directory path + * @param to - The target path + * @returns Relative path from 'from' to 'to' + * + * @example + * relativePath('src/channels', 'src/models/User') // => '../models/User' + * relativePath('src/a/b', 'src/a/c') // => '../c' + * relativePath('src/models', 'src/models/User') // => 'User' + */ +export function relativePath(from: string, to: string): string { + // Normalize Windows backslashes to forward slashes first + const normalizedFrom = from.replace(/\\/g, '/'); + const normalizedTo = to.replace(/\\/g, '/'); + + const fromIsAbsolute = isAbsolutePath(normalizedFrom); + const toIsAbsolute = isAbsolutePath(normalizedTo); + + // Handle mixed absolute/relative paths + if (fromIsAbsolute && !toIsAbsolute) { + // 'from' is absolute, 'to' is relative + // This happens in tests where outputPath is resolved to absolute but + // dependency outputPaths are relative. Treat both as relative by stripping + // the absolute prefix from 'from'. + const fromWithoutRoot = normalizedFrom + .replace(/^[a-zA-Z]:\//, '') + .replace(/^\//, ''); + return relativePath(fromWithoutRoot, normalizedTo); + } + + if (!fromIsAbsolute && toIsAbsolute) { + // 'from' is relative, 'to' is absolute - strip absolute prefix from 'to' + const toWithoutRoot = normalizedTo + .replace(/^[a-zA-Z]:\//, '') + .replace(/^\//, ''); + return relativePath(normalizedFrom, toWithoutRoot); + } + + // Normalize paths: remove leading ./ and trailing / + const normFrom = normalizedFrom.replace(/^\.\//, '').replace(/\/$/, ''); + const normTo = normalizedTo.replace(/^\.\//, '').replace(/\/$/, ''); + + const fromParts = normFrom.split('/').filter((p) => p !== ''); + const toParts = normTo.split('/').filter((p) => p !== ''); + + // Find common prefix length + let commonLength = 0; + const minLength = Math.min(fromParts.length, toParts.length); + for (let i = 0; i < minLength; i++) { + if (fromParts[i] === toParts[i]) { + commonLength++; + } else { + break; + } + } + + // Number of directories to go up from 'from' + const upCount = fromParts.length - commonLength; + + // Remaining path in 'to' after common prefix + const remainingTo = toParts.slice(commonLength); + + // Build relative path + const upParts = Array(upCount).fill('..'); + const relativeParts = [...upParts, ...remainingTo]; + + if (relativeParts.length === 0) { + return '.'; + } + + return relativeParts.join('/'); +} diff --git a/src/commands/generate.ts b/src/commands/generate.ts index 08d1b6db..e9ec1ce7 100644 --- a/src/commands/generate.ts +++ b/src/commands/generate.ts @@ -2,6 +2,7 @@ import {Args, Flags} from '@oclif/core'; import {Logger} from '../LoggingInterface'; import {generateWithConfig} from '../codegen/generators'; +import {writeGeneratedFiles} from '../codegen/output'; import chokidar from 'chokidar'; import path from 'path'; import {realizeGeneratorContext} from '../codegen/configurations'; @@ -89,10 +90,15 @@ export default class Generate extends BaseCommand { if (watch) { await this.handleWatchModeStartedTelemetry({context, inputSource}); - await this.runWithWatch({configFile: file, watchPath, flags}); + await this.runWithWatch({configFile: file, watchPath, flags, context}); } else { Logger.startSpinner('Generating code...'); result = await generateWithConfig(context); + + // Write files to disk (pure core returns files, CLI writes) + const basePath = path.dirname(context.configFilePath); + await writeGeneratedFiles(result.files, basePath); + this.handleSuccessOutput(result, flags); } @@ -129,14 +135,15 @@ export default class Generate extends BaseCommand { result: GenerationResult, flags: {verbose?: boolean; json?: boolean; 'no-color'?: boolean} ): void { + const totalFiles = result.files.length; Logger.succeedSpinner( - `Generated ${result.totalFiles} file${result.totalFiles !== 1 ? 's' : ''} in ${result.totalDuration}ms` + `Generated ${totalFiles} file${totalFiles !== 1 ? 's' : ''} in ${result.totalDuration}ms` ); // Verbose: show file list if (flags.verbose && !flags.json) { - for (const file of result.allFiles) { - const relativePath = path.relative(process.cwd(), file); + for (const file of result.files) { + const relativePath = path.relative(process.cwd(), file.path); Logger.verbose(` -> ${relativePath}`); } } @@ -145,18 +152,18 @@ export default class Generate extends BaseCommand { if (flags.json) { Logger.json({ success: true, - files: result.allFiles.map((file) => - path.relative(process.cwd(), file) + files: result.files.map((file) => + path.relative(process.cwd(), file.path) ), generators: result.generators.map((gen) => ({ id: gen.id, preset: gen.preset, - files: gen.filesWritten.map((file) => - path.relative(process.cwd(), file) + files: gen.files.map((file) => + path.relative(process.cwd(), file.path) ), duration: gen.duration })), - totalFiles: result.totalFiles, + totalFiles, duration: result.totalDuration }); } @@ -165,17 +172,23 @@ export default class Generate extends BaseCommand { private async runWithWatch({ configFile, watchPath, - flags + flags, + context }: { configFile?: string; watchPath?: string; flags: {verbose?: boolean; json?: boolean; 'no-color'?: boolean}; + context: RunGeneratorContext; }): Promise { + const basePath = path.dirname(context.configFilePath); + // Initial generation Logger.startSpinner('Generating initial code...'); const initialResult = await generateWithConfig(configFile); + await writeGeneratedFiles(initialResult.files, basePath); + const totalFiles = initialResult.files.length; Logger.succeedSpinner( - `Initial generation complete (${initialResult.totalFiles} file${initialResult.totalFiles !== 1 ? 's' : ''})` + `Initial generation complete (${totalFiles} file${totalFiles !== 1 ? 's' : ''})` ); // Determine what to watch @@ -220,14 +233,16 @@ export default class Generate extends BaseCommand { try { const result = await generateWithConfig(configFile); + await writeGeneratedFiles(result.files, basePath); + const regenTotalFiles = result.files.length; Logger.succeedSpinner( - `Regenerated ${result.totalFiles} file${result.totalFiles !== 1 ? 's' : ''} in ${result.totalDuration}ms` + `Regenerated ${regenTotalFiles} file${regenTotalFiles !== 1 ? 's' : ''} in ${result.totalDuration}ms` ); // Verbose: show file list if (flags.verbose && !flags.json) { - for (const file of result.allFiles) { - const relativePath = path.relative(process.cwd(), file); + for (const file of result.files) { + const relativePath = path.relative(process.cwd(), file.path); Logger.verbose(` -> ${relativePath}`); } } diff --git a/test/PersistedConfig.spec.ts b/test/PersistedConfig.spec.ts index 3af624fc..8c6ee7fe 100644 --- a/test/PersistedConfig.spec.ts +++ b/test/PersistedConfig.spec.ts @@ -31,7 +31,8 @@ describe('PersistedConfig', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: true, lastUpdated: '2024-12-11T10:00:00Z' @@ -106,7 +107,8 @@ describe('PersistedConfig', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: true }; @@ -127,7 +129,8 @@ describe('PersistedConfig', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: true }; @@ -147,7 +150,8 @@ describe('PersistedConfig', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: true }; diff --git a/test/blackbox/typescript.spec.ts b/test/blackbox/typescript.spec.ts index 09b71007..26085be8 100644 --- a/test/blackbox/typescript.spec.ts +++ b/test/blackbox/typescript.spec.ts @@ -8,7 +8,7 @@ jest.setTimeout(100000); describe.each(typescriptConfig)( 'Should be able to handle configuration %s', (configFile) => { - let config, filePath; + let config: any, filePath: string; beforeAll(async () => { const loadedConfig = await loadConfigFile(path.resolve('./test/blackbox/', configFile.file)); config = loadedConfig.config; diff --git a/test/browser/generate.spec.ts b/test/browser/generate.spec.ts new file mode 100644 index 00000000..3867c7ad --- /dev/null +++ b/test/browser/generate.spec.ts @@ -0,0 +1,847 @@ +/** + * Tests for browser generate function. + * Verifies main browser generation function takes string inputs and returns files in memory. + */ +import {generate, BrowserGenerateInput} from '../../src/browser/generate'; +import {parseConfig} from '../../src/browser/config'; + +// Sample AsyncAPI spec (v2.6.0 with inline payloads - no $ref) +const sampleAsyncAPISpec = ` +asyncapi: 2.6.0 +info: + title: Account Service + version: 1.0.0 +channels: + user/signedup: + publish: + message: + payload: + type: object + properties: + displayName: + type: string + email: + type: string + format: email +`; + +// AsyncAPI 3.0 spec with $ref patterns (tests browser $ref resolution) +const asyncapi30WithRefSpec = ` +asyncapi: '3.0.0' +info: + title: Test Service + version: '1.0.0' +channels: + testChannel: + address: test/channel + messages: + TestMessage: + $ref: '#/components/messages/TestMessage' +components: + messages: + TestMessage: + payload: + type: object + properties: + id: + type: string + name: + type: string +`; + +// AsyncAPI 3.0 with channel $ref in operations +const asyncapi30WithChannelRefSpec = ` +asyncapi: '3.0.0' +info: + title: Test Service + version: '1.0.0' +channels: + testChannel: + address: test/channel + messages: + TestMessage: + $ref: '#/components/messages/TestMessage' +operations: + publishTest: + action: send + channel: + $ref: '#/channels/testChannel' +components: + messages: + TestMessage: + payload: + type: object + properties: + id: + type: string + name: + type: string + required: + - id +`; + +// Default playground spec - exact spec from website/src/components/Playground/examples.ts +const playgroundDefaultSpec = `asyncapi: '3.0.0' +info: + title: User Service + version: '1.0.0' + description: Simple user events service + +channels: + userCreated: + address: users/created + messages: + UserCreated: + $ref: '#/components/messages/UserCreated' + userUpdated: + address: users/updated + messages: + UserUpdated: + $ref: '#/components/messages/UserUpdated' + +operations: + publishUserCreated: + action: send + channel: + $ref: '#/channels/userCreated' + subscribeUserUpdated: + action: receive + channel: + $ref: '#/channels/userUpdated' + +components: + messages: + UserCreated: + payload: + type: object + properties: + id: + type: string + format: uuid + email: + type: string + format: email + name: + type: string + createdAt: + type: string + format: date-time + required: + - id + - email + - name + UserUpdated: + payload: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + updatedAt: + type: string + format: date-time + required: + - id +`; + +// Sample OpenAPI spec +const sampleOpenAPISpec = ` +openapi: 3.0.0 +info: + title: Sample API + version: 1.0.0 +paths: + /users: + get: + summary: Get users + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' +components: + schemas: + User: + type: object + properties: + id: + type: string + name: + type: string +`; + +// Sample JSON Schema +const sampleJsonSchema = ` +{ + "$id": "User", + "type": "object", + "properties": { + "id": { "type": "string" }, + "name": { "type": "string" }, + "email": { "type": "string", "format": "email" } + }, + "required": ["id", "name"] +} +`; + +describe('Browser Generate', () => { + describe('generate', () => { + describe('AsyncAPI input', () => { + it('should generate from AsyncAPI string input', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', // Not used in browser + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + }); + + it('should return generated files as Record', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/models' + } + ] + } + }; + + const output = await generate(input); + + // Should be a Record object + expect(typeof output.files).toBe('object'); + + // File paths should be strings + for (const [path, content] of Object.entries(output.files)) { + expect(typeof path).toBe('string'); + expect(typeof content).toBe('string'); + expect(path.endsWith('.ts')).toBe(true); + } + }); + }); + + describe('AsyncAPI 3.0 with $ref (browser $ref resolution)', () => { + it('should generate files from AsyncAPI 3.0 spec with message $ref', async () => { + const input: BrowserGenerateInput = { + spec: asyncapi30WithRefSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + // Verify payload content is actually generated (not empty files) + const fileContents = Object.values(output.files); + expect(fileContents.some((content) => content.includes('class'))).toBe(true); + }); + + it('should generate files from AsyncAPI 3.0 spec with channel $ref in operations', async () => { + const input: BrowserGenerateInput = { + spec: asyncapi30WithChannelRefSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + // Verify the generated file contains expected class + const fileContents = Object.values(output.files); + expect(fileContents.some((content) => content.includes('class'))).toBe(true); + }); + + it('should match the default playground example spec', async () => { + // This is the exact spec from website/src/components/Playground/examples.ts + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + // Should generate UserCreated and UserUpdated payload classes + const fileContents = Object.values(output.files).join('\n'); + expect(fileContents).toContain('class'); + }); + + it('should generate payloads with all properties from $ref resolved messages', async () => { + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + + // Verify the generated code contains expected properties from the resolved $ref + const fileContents = Object.values(output.files).join('\n'); + // UserCreated should have id, email, name, createdAt + expect(fileContents).toContain('id'); + expect(fileContents).toContain('email'); + expect(fileContents).toContain('name'); + }); + }); + + describe('OpenAPI input', () => { + it('should generate from OpenAPI string input', async () => { + const input: BrowserGenerateInput = { + spec: sampleOpenAPISpec, + specFormat: 'openapi', + config: { + inputType: 'openapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + }); + }); + + describe('JSON Schema input', () => { + it('should generate from JSON Schema string input', async () => { + const input: BrowserGenerateInput = { + spec: sampleJsonSchema, + specFormat: 'jsonschema', + config: { + inputType: 'jsonschema', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'models', + outputPath: 'src/models' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + }); + }); + + describe('Error handling', () => { + it('should handle parsing errors gracefully', async () => { + const input: BrowserGenerateInput = { + spec: 'invalid: yaml: content: [', + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + // Should not throw, but return errors + expect(output.errors.length).toBeGreaterThan(0); + }); + + it('should handle invalid spec format gracefully', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + // Mismatch spec format and content + input.spec = '{"not": "a valid asyncapi doc"}'; + + const output = await generate(input); + + // Should handle gracefully + expect(output.errors.length).toBeGreaterThan(0); + }); + + it('should handle empty spec gracefully', async () => { + const input: BrowserGenerateInput = { + spec: '', + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors.length).toBeGreaterThan(0); + }); + }); + + describe('Generator options', () => { + it('should respect output path from generator config', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'custom/output/path' + } + ] + } + }; + + const output = await generate(input); + + const paths = Object.keys(output.files); + // Normalize path separators for cross-platform testing + const normalizedPaths = paths.map((p) => p.replace(/\\/g, '/')); + expect( + normalizedPaths.some((p) => p.includes('custom/output/path')) + ).toBe(true); + }); + + it('should handle multiple generators', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + }, + { + preset: 'types', + outputPath: 'src/types' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + // Should have files from both generators + const paths = Object.keys(output.files); + const hasPayloads = paths.some((p) => p.includes('payloads')); + const hasTypes = paths.some((p) => p.includes('types')); + expect(hasPayloads || hasTypes).toBe(true); + }); + }); + }); + + describe('Generator dependency resolution', () => { + it('should pass payloads output to channels generator', async () => { + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + }, + { + preset: 'parameters', + outputPath: 'src/parameters' + }, + { + preset: 'headers', + outputPath: 'src/headers' + }, + { + preset: 'channels', + outputPath: 'src/channels', + protocols: ['nats'] + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + // Should have channel files that import from payloads + const channelFiles = Object.keys(output.files).filter((f) => + f.includes('channels') + ); + expect(channelFiles.length).toBeGreaterThan(0); + }); + + it('should work with client preset (depends on channels)', async () => { + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + }, + { + preset: 'parameters', + outputPath: 'src/parameters' + }, + { + preset: 'headers', + outputPath: 'src/headers' + }, + { + preset: 'channels', + outputPath: 'src/channels', + protocols: ['nats'] + }, + { + preset: 'client', + outputPath: 'src/client', + protocols: ['nats'] + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + const clientFiles = Object.keys(output.files).filter((f) => + f.includes('client') + ); + expect(clientFiles.length).toBeGreaterThan(0); + }); + + it('should properly resolve dependencies even when generators are listed out of order', async () => { + // List channels before payloads - the dependency should still be resolved + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'channels', + outputPath: 'src/channels', + protocols: ['nats'] + }, + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + // Should not have the "could not determine previous rendered payloads" error + expect(output.errors).toHaveLength(0); + const channelFiles = Object.keys(output.files).filter((f) => + f.includes('channels') + ); + expect(channelFiles.length).toBeGreaterThan(0); + }); + + it('should auto-add dependency generators when only channels is specified', async () => { + // User specifies only channels - payloads, parameters, headers should be auto-added + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'channels', + outputPath: 'src/channels', + protocols: ['nats'] + } + ] + } + }; + + const output = await generate(input); + + // Should not have the "could not determine previous rendered payloads" error + expect(output.errors).toHaveLength(0); + // Should have channel files + const channelFiles = Object.keys(output.files).filter((f) => + f.includes('channels') + ); + expect(channelFiles.length).toBeGreaterThan(0); + // Should also have auto-generated payload files in the channels subdirectory + const payloadFiles = Object.keys(output.files).filter((f) => + f.includes('payload') + ); + expect(payloadFiles.length).toBeGreaterThan(0); + }); + }); + + describe('Pure core integration', () => { + it('should use runGenerators from core pipeline (not duplicate logic)', async () => { + // This test verifies that the browser generate() function uses the shared + // core rendering pipeline. When the refactoring is complete, browser/generate.ts + // should import and use runGenerators() from src/codegen/generators instead + // of duplicating the generator logic. + // + // The test passes if generate() returns correct results - if it's using + // duplicated logic, it will still work but the code will be unmaintainable. + const input: BrowserGenerateInput = { + spec: playgroundDefaultSpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + expect(output.errors).toHaveLength(0); + expect(Object.keys(output.files).length).toBeGreaterThan(0); + }); + + it('should return files without performing any filesystem I/O', async () => { + // Browser generation should be completely pure - no filesystem access + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + // If this runs in Node.js test environment, it should NOT write any files + const output = await generate(input); + + // Files should be returned in memory + expect(output.files).toBeDefined(); + expect(typeof output.files).toBe('object'); + + // Content should be included (not just paths) + const firstFile = Object.values(output.files)[0]; + expect(typeof firstFile).toBe('string'); + expect(firstFile.length).toBeGreaterThan(0); + }); + + it('should include file content in output (not just paths)', async () => { + const input: BrowserGenerateInput = { + spec: sampleAsyncAPISpec, + specFormat: 'asyncapi', + config: { + inputType: 'asyncapi', + inputPath: '', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + } + }; + + const output = await generate(input); + + // Each file should have actual content + for (const [path, content] of Object.entries(output.files)) { + expect(typeof path).toBe('string'); + expect(path.endsWith('.ts')).toBe(true); + expect(typeof content).toBe('string'); + expect(content.length).toBeGreaterThan(0); + // Content should be valid TypeScript (at minimum contain export) + expect(content).toContain('export'); + } + }); + }); + + describe('parseConfig', () => { + it('should parse JSON config string correctly', () => { + const configJson = JSON.stringify({ + inputType: 'asyncapi', + inputPath: './spec.yaml', + language: 'typescript', + generators: [ + { + preset: 'payloads', + outputPath: 'src/payloads' + } + ] + }); + + const config = parseConfig(configJson, 'json'); + + expect(config.inputType).toBe('asyncapi'); + expect(config.language).toBe('typescript'); + expect(config.generators).toHaveLength(1); + expect(config.generators[0].preset).toBe('payloads'); + }); + + it('should parse YAML config string correctly', () => { + const configYaml = ` +inputType: asyncapi +inputPath: ./spec.yaml +language: typescript +generators: + - preset: payloads + outputPath: src/payloads +`; + + const config = parseConfig(configYaml, 'yaml'); + + expect(config.inputType).toBe('asyncapi'); + expect(config.language).toBe('typescript'); + expect(config.generators).toHaveLength(1); + }); + + it('should throw on invalid config format', () => { + expect(() => { + parseConfig('not valid json or yaml {{{{', 'json'); + }).toThrow(); + }); + + it('should validate config structure', () => { + const invalidConfig = JSON.stringify({ + inputType: 'invalid_type' + }); + + expect(() => { + parseConfig(invalidConfig, 'json'); + }).toThrow(); + }); + }); +}); diff --git a/test/browser/modelina.spec.ts b/test/browser/modelina.spec.ts new file mode 100644 index 00000000..9dca3457 --- /dev/null +++ b/test/browser/modelina.spec.ts @@ -0,0 +1,230 @@ +/** + * Tests for Modelina integration with pure-core generation. + * Verifies in-memory model generation using generateModels(). + */ +import {generateModels} from '../../src/codegen/output'; +import {TypeScriptFileGenerator} from '@asyncapi/modelina'; + +describe('Modelina Pure-Core Integration', () => { + describe('generateModels', () => { + it('should generate simple payload model returning files', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'User', + type: 'object', + properties: { + id: {type: 'string'}, + name: {type: 'string'} + }, + required: ['id', 'name'] + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/models' + }); + + // Should have at least one file + expect(result.files.length).toBeGreaterThan(0); + + // Each file should have path and content + const file = result.files[0]; + expect(file).toHaveProperty('path'); + expect(file).toHaveProperty('content'); + + // File should be in the specified output path + expect(file.path.startsWith('src/models/')).toBe(true); + + // Content should contain class definition + expect(file.content).toContain('class'); + expect(file.content).toContain('id'); + // 'name' is a reserved keyword, so Modelina may rename it + expect(file.content).toMatch(/name|reservedName/i); + }); + + it('should generate enum types correctly', async () => { + const generator = new TypeScriptFileGenerator({ + enumType: 'enum' + }); + const schema = { + $id: 'Status', + type: 'string', + enum: ['pending', 'active', 'completed'] + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/types' + }); + + const content = result.files.map((f) => f.content).join('\n'); + expect(content).toContain('enum'); + }); + + it('should handle complex nested types', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'Order', + type: 'object', + properties: { + id: {type: 'string'}, + items: { + type: 'array', + items: { + type: 'object', + properties: { + productId: {type: 'string'}, + quantity: {type: 'number'} + } + } + }, + customer: { + type: 'object', + properties: { + name: {type: 'string'}, + email: {type: 'string', format: 'email'} + } + } + } + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/models' + }); + + // Should generate multiple models for nested types + expect(result.files.length).toBeGreaterThan(0); + + const content = result.files.map((f) => f.content).join('\n'); + expect(content).toContain('Order'); + }); + + it('should return empty result for empty schema', async () => { + const generator = new TypeScriptFileGenerator(); + + // Empty object schema that shouldn't generate anything meaningful + const schema = {}; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/models' + }); + + // Should return result object + expect(result).toBeDefined(); + expect(Array.isArray(result.files)).toBe(true); + }); + + it('should use output path for file names', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'TestModel', + type: 'object', + properties: { + value: {type: 'string'} + } + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'custom/path/to/models' + }); + + expect(result.files.some((f) => f.path.includes('custom/path/to/models'))).toBe( + true + ); + }); + + it('should handle schemas with $ref', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'Container', + type: 'object', + properties: { + item: { + $ref: '#/$defs/Item' + } + }, + $defs: { + Item: { + type: 'object', + properties: { + id: {type: 'string'} + } + } + } + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/models' + }); + + expect(result.files.length).toBeGreaterThan(0); + }); + + it('should handle discriminated unions', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'Event', + oneOf: [ + { + type: 'object', + properties: { + type: {const: 'created'}, + data: {type: 'string'} + } + }, + { + type: 'object', + properties: { + type: {const: 'deleted'}, + id: {type: 'string'} + } + } + ], + discriminator: { + propertyName: 'type' + } + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/events' + }); + + expect(result.files.length).toBeGreaterThan(0); + }); + }); + + describe('renderCompleteModelOptions', () => { + it('should support named export type', async () => { + const generator = new TypeScriptFileGenerator(); + const schema = { + $id: 'NamedExport', + type: 'object', + properties: { + value: {type: 'string'} + } + }; + + const result = await generateModels({ + generator, + input: schema, + outputPath: 'src/models', + options: {exportType: 'named'} + }); + + const content = result.files.map((f) => f.content).join('\n'); + expect(content).toContain('export'); + }); + }); +}); diff --git a/test/browser/output.spec.ts b/test/browser/output.spec.ts new file mode 100644 index 00000000..24807cab --- /dev/null +++ b/test/browser/output.spec.ts @@ -0,0 +1,171 @@ +/** + * Tests for BrowserOutput adapter. + * Verifies in-memory file storage for browser environments. + */ +import {BrowserOutput} from '../../src/browser/adapters/output'; + +describe('BrowserOutput', () => { + let output: BrowserOutput; + + beforeEach(() => { + output = new BrowserOutput(); + }); + + describe('write', () => { + it('should write a single file to memory', () => { + output.write('src/models/User.ts', 'export class User {}'); + + expect(output.read('src/models/User.ts')).toBe('export class User {}'); + }); + + it('should write multiple files preserving directory structure', () => { + output.write('src/models/User.ts', 'export class User {}'); + output.write('src/models/Order.ts', 'export class Order {}'); + output.write('src/index.ts', 'export * from "./models/User";'); + + const files = output.getAll(); + expect(Object.keys(files)).toHaveLength(3); + expect(files['src/models/User.ts']).toBe('export class User {}'); + expect(files['src/models/Order.ts']).toBe('export class Order {}'); + expect(files['src/index.ts']).toBe('export * from "./models/User";'); + }); + + it('should overwrite existing files', () => { + output.write('src/models/User.ts', 'export class User {}'); + output.write('src/models/User.ts', 'export class User { name: string; }'); + + expect(output.read('src/models/User.ts')).toBe( + 'export class User { name: string; }' + ); + }); + + it('should handle files with different directory depths', () => { + output.write('index.ts', 'export * from "./src";'); + output.write('src/index.ts', 'export * from "./models";'); + output.write('src/models/index.ts', 'export * from "./User";'); + output.write('src/models/types/UserType.ts', 'export type UserType = {};'); + + const files = output.getAll(); + expect(Object.keys(files)).toHaveLength(4); + }); + }); + + describe('read', () => { + it('should return undefined for non-existent files', () => { + expect(output.read('non/existent/file.ts')).toBeUndefined(); + }); + + it('should read back written files', () => { + const content = `export interface User { + id: string; + name: string; +}`; + output.write('src/types.ts', content); + + expect(output.read('src/types.ts')).toBe(content); + }); + }); + + describe('getAll', () => { + it('should return empty object when no files written', () => { + expect(output.getAll()).toEqual({}); + }); + + it('should return all files as Record', () => { + output.write('a.ts', 'a content'); + output.write('b.ts', 'b content'); + + const files = output.getAll(); + expect(files).toEqual({ + 'a.ts': 'a content', + 'b.ts': 'b content' + }); + }); + + it('should return a copy, not the internal state', () => { + output.write('test.ts', 'content'); + + const files = output.getAll(); + files['test.ts'] = 'modified'; + + // Original should not be modified + expect(output.read('test.ts')).toBe('content'); + }); + }); + + describe('clear', () => { + it('should remove all files', () => { + output.write('a.ts', 'a'); + output.write('b.ts', 'b'); + + output.clear(); + + expect(output.getAll()).toEqual({}); + expect(output.read('a.ts')).toBeUndefined(); + }); + }); + + describe('has', () => { + it('should return true for existing files', () => { + output.write('test.ts', 'content'); + + expect(output.has('test.ts')).toBe(true); + }); + + it('should return false for non-existent files', () => { + expect(output.has('nonexistent.ts')).toBe(false); + }); + }); + + describe('delete', () => { + it('should remove a specific file', () => { + output.write('a.ts', 'a'); + output.write('b.ts', 'b'); + + output.delete('a.ts'); + + expect(output.has('a.ts')).toBe(false); + expect(output.has('b.ts')).toBe(true); + }); + + it('should return true if file was deleted', () => { + output.write('test.ts', 'content'); + + expect(output.delete('test.ts')).toBe(true); + }); + + it('should return false if file did not exist', () => { + expect(output.delete('nonexistent.ts')).toBe(false); + }); + }); + + describe('getPaths', () => { + it('should return all file paths', () => { + output.write('src/a.ts', 'a'); + output.write('src/b.ts', 'b'); + output.write('index.ts', 'index'); + + const paths = output.getPaths(); + expect(paths).toHaveLength(3); + expect(paths).toContain('src/a.ts'); + expect(paths).toContain('src/b.ts'); + expect(paths).toContain('index.ts'); + }); + + it('should return empty array when no files', () => { + expect(output.getPaths()).toEqual([]); + }); + }); + + describe('size', () => { + it('should return the number of files', () => { + expect(output.size).toBe(0); + + output.write('a.ts', 'a'); + expect(output.size).toBe(1); + + output.write('b.ts', 'b'); + expect(output.size).toBe(2); + }); + }); +}); diff --git a/test/codegen/generators/typescript/__snapshots__/channels.spec.ts.snap b/test/codegen/generators/typescript/__snapshots__/channels.spec.ts.snap index 4d19322f..b38eb1db 100644 --- a/test/codegen/generators/typescript/__snapshots__/channels.spec.ts.snap +++ b/test/codegen/generators/typescript/__snapshots__/channels.spec.ts.snap @@ -8,9 +8,9 @@ export {http_client}; `; exports[`channels typescript OpenAPI input should generate HTTP client protocol code for OpenAPI spec: openapi-http_client-protocol-code 1`] = ` -"import {Pet} from './../../../../../payloads/Pet'; -import * as FindPetsByStatusAndCategoryResponseModule from './../../../../../payloads/FindPetsByStatusAndCategoryResponse'; -import {FindPetsByStatusAndCategoryParameters} from './../../../../../parameters/FindPetsByStatusAndCategoryParameters'; +"import {Pet} from './../../../../../../../payloads/Pet'; +import * as FindPetsByStatusAndCategoryResponseModule from './../../../../../../../payloads/FindPetsByStatusAndCategoryResponse'; +import {FindPetsByStatusAndCategoryParameters} from './../../../../../../../parameters/FindPetsByStatusAndCategoryParameters'; import { URLSearchParams, URL } from 'url'; import * as NodeFetch from 'node-fetch'; @@ -1379,9 +1379,9 @@ export {amqp}; `; exports[`channels typescript protocol-specific code generation should generate AMQP protocol code with parameters and headers: amqp-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import * as Amqp from 'amqplib'; /** @@ -1691,9 +1691,9 @@ export {event_source}; `; exports[`channels typescript protocol-specific code generation should generate EventSource protocol code with parameters and headers: event_source-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import { fetchEventSource, EventStreamContentType, EventSourceMessage } from '@microsoft/fetch-event-source'; import { NextFunction, Request, Response, Router } from 'express'; @@ -1930,7 +1930,7 @@ export {http_client}; `; exports[`channels typescript protocol-specific code generation should generate HTTP client protocol code for request/reply: http_client-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; import { URLSearchParams, URL } from 'url'; import * as NodeFetch from 'node-fetch'; @@ -3068,9 +3068,9 @@ export {kafka}; `; exports[`channels typescript protocol-specific code generation should generate Kafka protocol code with parameters and headers: kafka-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import * as Kafka from 'kafkajs'; /** @@ -3328,9 +3328,9 @@ export {mqtt}; `; exports[`channels typescript protocol-specific code generation should generate MQTT protocol code with parameters and headers: mqtt-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import * as Mqtt from 'mqtt'; /** @@ -3580,9 +3580,9 @@ export {nats}; `; exports[`channels typescript protocol-specific code generation should generate NATS protocol code with parameters and headers: nats-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import * as Nats from 'nats'; /** @@ -4207,9 +4207,9 @@ export {websocket}; `; exports[`channels typescript protocol-specific code generation should generate WebSocket protocol code with parameters and headers: websocket-protocol-code 1`] = ` -"import * as TestPayloadModelModule from './../../../../../payloads/TestPayloadModel'; -import {TestParameter} from './../../../../../parameters/TestParameter'; -import {TestHeaders} from './../../../../../headers/TestHeaders'; +"import * as TestPayloadModelModule from './../../../../../../../payloads/TestPayloadModel'; +import {TestParameter} from './../../../../../../../parameters/TestParameter'; +import {TestHeaders} from './../../../../../../../headers/TestHeaders'; import * as WebSocket from 'ws'; import { IncomingMessage } from 'http'; diff --git a/test/codegen/generators/typescript/channels.spec.ts b/test/codegen/generators/typescript/channels.spec.ts index 7a08708c..db2f090f 100644 --- a/test/codegen/generators/typescript/channels.spec.ts +++ b/test/codegen/generators/typescript/channels.spec.ts @@ -2,12 +2,7 @@ import path from "node:path"; import { defaultTypeScriptChannelsGenerator, generateTypeScriptChannels, TypeScriptParameterRenderType } from "../../../../src/codegen/generators"; import { loadAsyncapiDocument, loadAsyncapiFromMemory } from "../../../../src/codegen/inputs/asyncapi"; import { loadOpenapiDocument } from "../../../../src/codegen/inputs/openapi"; -jest.mock('node:fs/promises', () => ({ - writeFile: jest.fn().mockResolvedValue(undefined), - mkdir: jest.fn().mockResolvedValue(undefined), -})); -import fs from 'node:fs/promises'; -import { ConstrainedAnyModel, ConstrainedArrayModel, ConstrainedIntegerModel, ConstrainedObjectModel, ConstrainedStringModel, OutputModel } from "@asyncapi/modelina"; +import { ConstrainedAnyModel, ConstrainedArrayModel, ConstrainedIntegerModel, ConstrainedObjectModel, ConstrainedObjectPropertyModel, ConstrainedStringModel, OutputModel } from "@asyncapi/modelina"; import { TypeScriptPayloadRenderType } from "../../../../src/codegen/generators/typescript/payloads"; import { TypeScriptHeadersRenderType } from "../../../../src/codegen/generators/typescript/headers"; @@ -19,7 +14,8 @@ describe('channels', () => { // Helper function to create mock headers dependency const createHeadersDependency = (): TypeScriptHeadersRenderType => ({ channelModels: {}, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }); // Helper to create parameter model with properties for channels that have actual parameters @@ -50,7 +46,8 @@ describe('channels', () => { channelModels: { "user/signedup": parameterModel }, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: { @@ -61,7 +58,8 @@ describe('channels', () => { }, operationModels: {}, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ generator: { @@ -79,14 +77,15 @@ describe('channels', () => { 'headers-typescript': createHeadersDependency() } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot(); }); it('should work with request and reply AsyncAPI', async () => { const parsedAsyncAPIDocument = await loadAsyncapiDocument(path.resolve(__dirname, '../../../configs/asyncapi-request.yaml')); const parametersDependency: TypeScriptParameterRenderType = { channelModels: {}, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: { @@ -110,7 +109,8 @@ describe('channels', () => { }, }, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ generator: { @@ -128,7 +128,7 @@ describe('channels', () => { 'headers-typescript': createHeadersDependency() } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot(); }); it('should work with basic AsyncAPI inputs with no parameters', async () => { @@ -137,7 +137,8 @@ describe('channels', () => { const parametersDependency: TypeScriptParameterRenderType = { channelModels: { }, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: { @@ -148,7 +149,8 @@ describe('channels', () => { }, operationModels: {}, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ generator: { @@ -166,7 +168,7 @@ describe('channels', () => { 'headers-typescript': createHeadersDependency() } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot(); }); it('should work with operation extension', async () => { @@ -194,7 +196,8 @@ describe('channels', () => { const parametersDependency: TypeScriptParameterRenderType = { channelModels: { }, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: { @@ -205,7 +208,8 @@ describe('channels', () => { }, operationModels: {}, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ generator: { @@ -223,7 +227,7 @@ describe('channels', () => { 'headers-typescript': createHeadersDependency() } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot(); }); @@ -250,7 +254,8 @@ describe('channels', () => { userSignedup: userSignedupParameterModel, noParameter: undefined }, - generator: {outputPath: './parameters'} as any + generator: {outputPath: './parameters'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { @@ -283,7 +288,8 @@ describe('channels', () => { } }, otherModels: [], - generator: {outputPath: './payloads'} as any + generator: {outputPath: './payloads'} as any, + files: [] }; const headersDependency: TypeScriptHeadersRenderType = { @@ -291,7 +297,8 @@ describe('channels', () => { userSignedup: headerModel, noParameter: headerModel }, - generator: {outputPath: './headers'} as any + generator: {outputPath: './headers'} as any, + files: [] }; return { parsedAsyncAPIDocument, parametersDependency, payloadsDependency, headersDependency }; @@ -317,7 +324,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('nats-index'); expect(generatedChannels.protocolFiles['nats']).toMatchSnapshot('nats-protocol-code'); }); @@ -342,7 +349,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('kafka-index'); expect(generatedChannels.protocolFiles['kafka']).toMatchSnapshot('kafka-protocol-code'); }); @@ -367,7 +374,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('mqtt-index'); expect(generatedChannels.protocolFiles['mqtt']).toMatchSnapshot('mqtt-protocol-code'); }); @@ -392,7 +399,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('amqp-index'); expect(generatedChannels.protocolFiles['amqp']).toMatchSnapshot('amqp-protocol-code'); }); @@ -417,7 +424,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('event_source-index'); expect(generatedChannels.protocolFiles['event_source']).toMatchSnapshot('event_source-protocol-code'); }); @@ -442,7 +449,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('websocket-index'); expect(generatedChannels.protocolFiles['websocket']).toMatchSnapshot('websocket-protocol-code'); }); @@ -454,7 +461,8 @@ describe('channels', () => { const parametersDependency: TypeScriptParameterRenderType = { channelModels: {}, - generator: {outputPath: './parameters'} as any + generator: {outputPath: './parameters'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { @@ -479,7 +487,8 @@ describe('channels', () => { } }, otherModels: [], - generator: {outputPath: './payloads'} as any + generator: {outputPath: './payloads'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ @@ -499,7 +508,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('http_client-index'); expect(generatedChannels.protocolFiles['http_client']).toMatchSnapshot('http_client-protocol-code'); }); @@ -512,11 +521,23 @@ describe('channels', () => { ); // Create parameter model for findPetsByStatusAndCategory operation + const statusProperty = new ConstrainedObjectPropertyModel( + 'status', + 'status', + true, + new ConstrainedStringModel('status', undefined, {}, 'string') + ); + const categoryIdProperty = new ConstrainedObjectPropertyModel( + 'categoryId', + 'categoryId', + true, + new ConstrainedIntegerModel('categoryId', undefined, {}, 'number') + ); const findPetsByStatusAndCategoryParams = new OutputModel( '', new ConstrainedObjectModel('FindPetsByStatusAndCategoryParameters', undefined, {}, 'Parameter', { - status: new ConstrainedStringModel('status', undefined, {}, 'string'), - categoryId: new ConstrainedIntegerModel('categoryId', undefined, {}, 'number') + status: statusProperty, + categoryId: categoryIdProperty }), 'FindPetsByStatusAndCategoryParameters', {models: {}, originalInput: undefined}, @@ -527,7 +548,8 @@ describe('channels', () => { channelModels: { findPetsByStatusAndCategory: findPetsByStatusAndCategoryParams }, - generator: {outputPath: './parameters'} as any + generator: {outputPath: './parameters'} as any, + files: [] }; const petPayloadModel = new OutputModel('', new ConstrainedObjectModel('Pet', undefined, {}, 'object', {}), 'Pet', {models: {}, originalInput: undefined}, []); @@ -576,7 +598,8 @@ describe('channels', () => { } }, otherModels: [], - generator: {outputPath: './payloads'} as any + generator: {outputPath: './payloads'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ @@ -596,7 +619,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); expect(generatedChannels.result).toMatchSnapshot('openapi-http_client-index'); expect(generatedChannels.protocolFiles['http_client']).toMatchSnapshot('openapi-http_client-protocol-code'); }); @@ -608,14 +631,16 @@ describe('channels', () => { const parametersDependency: TypeScriptParameterRenderType = { channelModels: {}, - generator: {outputPath: './parameters'} as any + generator: {outputPath: './parameters'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: {}, operationModels: {}, otherModels: [], - generator: {outputPath: './payloads'} as any + generator: {outputPath: './payloads'} as any, + files: [] }; const generatedChannels = await generateTypeScriptChannels({ @@ -635,7 +660,7 @@ describe('channels', () => { } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(generatedChannels.files.length).toBeGreaterThan(0); // Should not generate any http_client code expect(generatedChannels.protocolFiles['http_client']).toBeUndefined(); }); diff --git a/test/codegen/generators/typescript/channels/import-extension.spec.ts b/test/codegen/generators/typescript/channels/import-extension.spec.ts index aff4097c..83795425 100644 --- a/test/codegen/generators/typescript/channels/import-extension.spec.ts +++ b/test/codegen/generators/typescript/channels/import-extension.spec.ts @@ -9,6 +9,7 @@ import { } from '../../../../../src/codegen/generators/typescript/channels/utils'; import { ConstrainedObjectModel, + ConstrainedObjectPropertyModel, ConstrainedEnumModel, ConstrainedStringModel, ConstrainedAnyModel, @@ -52,10 +53,16 @@ describe('Channels Import Extension', () => { }); const createParameterModel = (name: string): OutputModel => { + const idProperty = new ConstrainedObjectPropertyModel( + 'id', + 'id', + true, + new ConstrainedStringModel('id', undefined, {}, 'string') + ); return new OutputModel( '', new ConstrainedObjectModel(name, undefined, {}, 'object', { - id: new ConstrainedStringModel('id', undefined, {}, 'string') + id: idProperty }), name, {models: {}, originalInput: undefined}, @@ -64,10 +71,16 @@ describe('Channels Import Extension', () => { }; const createHeaderModel = (name: string): OutputModel => { + const contentTypeProperty = new ConstrainedObjectPropertyModel( + 'contentType', + 'contentType', + true, + new ConstrainedStringModel('contentType', undefined, {}, 'string') + ); return new OutputModel( '', new ConstrainedObjectModel(name, undefined, {}, 'object', { - contentType: new ConstrainedStringModel('contentType', undefined, {}, 'string') + contentType: contentTypeProperty }), name, {models: {}, originalInput: undefined}, diff --git a/test/codegen/generators/typescript/channels/protocols/functionTypeMapping.spec.ts b/test/codegen/generators/typescript/channels/protocols/functionTypeMapping.spec.ts index 53f8f897..febaa114 100644 --- a/test/codegen/generators/typescript/channels/protocols/functionTypeMapping.spec.ts +++ b/test/codegen/generators/typescript/channels/protocols/functionTypeMapping.spec.ts @@ -38,12 +38,14 @@ describe('functionTypeMapping undefined bug', () => { const createHeadersDependency = (): TypeScriptHeadersRenderType => ({ channelModels: {}, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }); // Helper to create a generator with functionTypeMapping explicitly set to undefined // This simulates the bug condition where spread operator preserves undefined - const createGeneratorWithUndefinedFunctionTypeMapping = (protocols: string[]) => { + type Protocol = 'http_client' | 'nats' | 'kafka' | 'mqtt' | 'amqp' | 'event_source' | 'websocket'; + const createGeneratorWithUndefinedFunctionTypeMapping = (protocols: Protocol[]) => { const generator = { ...defaultTypeScriptChannelsGenerator, outputPath: path.resolve(__dirname, './output'), @@ -83,7 +85,8 @@ describe('functionTypeMapping undefined bug', () => { channelModels: { 'user/signedup': parameterModel }, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; payloadsDependency = { @@ -95,7 +98,8 @@ describe('functionTypeMapping undefined bug', () => { }, operationModels: {}, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; }); @@ -222,7 +226,8 @@ describe('functionTypeMapping undefined bug', () => { } }, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const httpGenerator = createGeneratorWithUndefinedFunctionTypeMapping([ @@ -239,7 +244,8 @@ describe('functionTypeMapping undefined bug', () => { dependencyOutputs: { 'parameters-typescript': { channelModels: {}, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }, 'payloads-typescript': httpPayloadsDependency, 'headers-typescript': createHeadersDependency() diff --git a/test/codegen/generators/typescript/client.spec.ts b/test/codegen/generators/typescript/client.spec.ts index 99002d99..2d77cc23 100644 --- a/test/codegen/generators/typescript/client.spec.ts +++ b/test/codegen/generators/typescript/client.spec.ts @@ -1,11 +1,6 @@ import path from "node:path"; import { defaultTypeScriptClientGenerator, generateTypeScriptClient, TypeScriptParameterRenderType } from "../../../../src/codegen/generators"; import { loadAsyncapiDocument } from "../../../../src/codegen/inputs/asyncapi"; -jest.mock('node:fs/promises', () => ({ - writeFile: jest.fn().mockResolvedValue(undefined), - mkdir: jest.fn().mockResolvedValue(undefined), -})); -import fs from 'node:fs/promises'; import { ConstrainedAnyModel, ConstrainedObjectModel, OutputModel } from "@asyncapi/modelina"; import { ChannelFunctionTypes, defaultTypeScriptChannelsGenerator, TypeScriptChannelRenderType } from "../../../../src/codegen/generators/typescript/channels"; import { TypeScriptPayloadRenderType } from "../../../../src/codegen/generators/typescript/payloads"; @@ -21,7 +16,8 @@ describe('client', () => { channelModels: { "user/signedup": parameterModel }, - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const payloadsDependency: TypeScriptPayloadRenderType = { channelModels: { @@ -32,7 +28,8 @@ describe('client', () => { }, operationModels: {}, otherModels: [], - generator: {outputPath: './test'} as any + generator: {outputPath: './test'} as any, + files: [] }; const channelsDependency: TypeScriptChannelRenderType = { payloadRender: payloadsDependency, @@ -72,9 +69,11 @@ describe('client', () => { } ] }, - generator: defaultTypeScriptChannelsGenerator + generator: defaultTypeScriptChannelsGenerator, + protocolFiles: {}, + files: [] }; - await generateTypeScriptClient({ + const result = await generateTypeScriptClient({ generator: defaultTypeScriptClientGenerator, inputType: 'asyncapi', asyncapiDocument: parsedAsyncAPIDocument, @@ -84,7 +83,7 @@ describe('client', () => { 'channels-typescript': channelsDependency } }); - expect(fs.writeFile).toHaveBeenCalled(); + expect(result.files.length).toBeGreaterThan(0); }); }); }); diff --git a/test/codegen/generators/typescript/import-extension.spec.ts b/test/codegen/generators/typescript/import-extension.spec.ts index 95ab7b4b..1bb1027e 100644 --- a/test/codegen/generators/typescript/import-extension.spec.ts +++ b/test/codegen/generators/typescript/import-extension.spec.ts @@ -140,7 +140,7 @@ describe('Import Extension Configuration', () => { const config: any = { importExtension: '.ts' }; - const generator = {importExtension: '.js'}; + const generator = {importExtension: '.js' as const}; expect(resolveImportExtension(generator, config)).toBe('.js'); }); diff --git a/test/codegen/generators/typescript/jsdoc-utils.spec.ts b/test/codegen/generators/typescript/jsdoc-utils.spec.ts index f5773b2f..c6660986 100644 --- a/test/codegen/generators/typescript/jsdoc-utils.spec.ts +++ b/test/codegen/generators/typescript/jsdoc-utils.spec.ts @@ -92,8 +92,8 @@ describe('JSDoc Utilities', () => { deprecated: false, fallbackDescription: 'Fallback', parameters: [ - { name: 'userId', jsDoc: ' * @param userId The unique user identifier' }, - { name: 'orderId', jsDoc: ' * @param orderId The order identifier' } + { jsDoc: ' * @param userId The unique user identifier' }, + { jsDoc: ' * @param orderId The order identifier' } ] }); expect(result).toContain('@param userId'); @@ -107,7 +107,7 @@ describe('JSDoc Utilities', () => { description: 'Description here', deprecated: true, fallbackDescription: 'Fallback', - parameters: [{ name: 'param1', jsDoc: ' * @param param1 description' }] + parameters: [{ jsDoc: ' * @param param1 description' }] }); // Should be valid JSDoc expect(result.startsWith('/**')).toBe(true); diff --git a/test/codegen/modelina/presets/validation.spec.ts b/test/codegen/modelina/presets/validation.spec.ts index 4bd85828..71c2ced5 100644 --- a/test/codegen/modelina/presets/validation.spec.ts +++ b/test/codegen/modelina/presets/validation.spec.ts @@ -38,14 +38,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: true, - context + context: context as any }); // Find the ajv-formats dependency @@ -65,14 +66,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: true, - context + context: context as any }); // Find the ajv-formats dependency @@ -90,14 +92,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: true, - context + context: context as any }); // Find the ajv dependency @@ -113,7 +116,8 @@ describe('Validation Preset', () => { it('should return empty additional content when validation disabled', () => { const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: false} + generator: {includeValidation: false}, + dependencyOutputs: {} }; const preset = createValidationPreset( @@ -136,7 +140,8 @@ describe('Validation Preset', () => { it('should add validation code when validation enabled', () => { const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; const preset = createValidationPreset({includeValidation: true}, context); @@ -162,14 +167,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; const code = generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: true, - context + context: context as any }); expect(code).toContain('validate'); @@ -182,14 +188,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'asyncapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; const code = generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: false, - context + context: context as any }); expect(code).toContain('export function validate'); @@ -201,14 +208,15 @@ describe('Validation Preset', () => { const mockModel = createMockModel(); const context = { inputType: 'openapi' as const, - generator: {includeValidation: true} + generator: {includeValidation: true}, + dependencyOutputs: {} }; const code = generateTypescriptValidationCode({ model: mockModel as any, renderer: mockRenderer as any, asClassMethods: true, - context + context: context as any }); expect(code).toContain('addVocabulary'); diff --git a/test/codegen/output/adapter.spec.ts b/test/codegen/output/adapter.spec.ts new file mode 100644 index 00000000..e7cf9a1a --- /dev/null +++ b/test/codegen/output/adapter.spec.ts @@ -0,0 +1,195 @@ +/** + * Unit tests for OutputAdapter implementations. + * Tests both FileSystemAdapter (CLI) and MemoryAdapter (browser) implementations. + */ +import path from 'node:path'; +import {mkdir, rm, readFile} from 'node:fs/promises'; +import { + OutputAdapter, + FileSystemAdapter, + MemoryAdapter +} from '../../../src/codegen/output'; + +describe('OutputAdapter', () => { + describe('FileSystemAdapter', () => { + const testDir = path.join(__dirname, '.test-output'); + let adapter: FileSystemAdapter; + + beforeEach(async () => { + // Create a fresh test directory + await mkdir(testDir, {recursive: true}); + adapter = new FileSystemAdapter({basePath: testDir}); + }); + + afterEach(async () => { + // Clean up test directory + await rm(testDir, {recursive: true, force: true}); + }); + + it('should write files to disk', async () => { + const filePath = 'test-file.ts'; + const content = 'export const test = "hello";'; + + await adapter.write(filePath, content); + + const actualPath = path.resolve(testDir, filePath); + const actualContent = await readFile(actualPath, 'utf-8'); + expect(actualContent).toBe(content); + }); + + it('should create directories recursively', async () => { + const dirPath = 'nested/deep/directory'; + + await adapter.mkdir(dirPath, {recursive: true}); + + // Verify directory exists by writing a file to it + const filePath = path.join(dirPath, 'test.ts'); + await adapter.write(filePath, 'test'); + const actualPath = path.resolve(testDir, filePath); + const actualContent = await readFile(actualPath, 'utf-8'); + expect(actualContent).toBe('test'); + }); + + it('should track written files', async () => { + await adapter.write('file1.ts', 'content1'); + await adapter.write('file2.ts', 'content2'); + await adapter.write('nested/file3.ts', 'content3'); + + const writtenFiles = adapter.getWrittenFiles(); + expect(writtenFiles).toHaveLength(3); + expect(writtenFiles).toContain(path.resolve(testDir, 'file1.ts')); + expect(writtenFiles).toContain(path.resolve(testDir, 'file2.ts')); + expect(writtenFiles).toContain(path.resolve(testDir, 'nested/file3.ts')); + }); + + it('should return empty object from getAllFiles (not supported for filesystem)', () => { + const files = adapter.getAllFiles(); + expect(files).toEqual({}); + }); + + it('should resolve relative paths from basePath', async () => { + const content = 'export const x = 1;'; + await adapter.write('src/models/User.ts', content); + + const actualPath = path.resolve(testDir, 'src/models/User.ts'); + const actualContent = await readFile(actualPath, 'utf-8'); + expect(actualContent).toBe(content); + }); + + it('should handle absolute paths', async () => { + const absolutePath = path.join(testDir, 'absolute', 'path.ts'); + const content = 'export const y = 2;'; + + // When given an absolute path, it should use it directly + await adapter.mkdir(path.dirname(absolutePath), {recursive: true}); + await adapter.write(absolutePath, content); + + const actualContent = await readFile(absolutePath, 'utf-8'); + expect(actualContent).toBe(content); + }); + }); + + describe('MemoryAdapter', () => { + let adapter: MemoryAdapter; + + beforeEach(() => { + adapter = new MemoryAdapter(); + }); + + it('should store files in memory', async () => { + const filePath = 'src/models/User.ts'; + const content = 'export interface User { name: string; }'; + + await adapter.write(filePath, content); + + expect(adapter.read(filePath)).toBe(content); + }); + + it('should return all files', async () => { + await adapter.write('file1.ts', 'content1'); + await adapter.write('file2.ts', 'content2'); + + const files = adapter.getAllFiles(); + expect(files).toEqual({ + 'file1.ts': 'content1', + 'file2.ts': 'content2' + }); + }); + + it('should handle nested paths', async () => { + await adapter.write('src/deep/nested/file.ts', 'nested content'); + + const files = adapter.getAllFiles(); + expect(files['src/deep/nested/file.ts']).toBe('nested content'); + }); + + it('should track written files', async () => { + await adapter.write('a.ts', 'a'); + await adapter.write('b.ts', 'b'); + + const writtenFiles = adapter.getWrittenFiles(); + expect(writtenFiles).toHaveLength(2); + expect(writtenFiles).toContain('a.ts'); + expect(writtenFiles).toContain('b.ts'); + }); + + it('should have no-op mkdir', async () => { + // mkdir should not throw and should be a no-op + await expect( + adapter.mkdir('some/directory', {recursive: true}) + ).resolves.not.toThrow(); + }); + + it('should support clear()', async () => { + await adapter.write('file.ts', 'content'); + expect(adapter.size).toBe(1); + + adapter.clear(); + expect(adapter.size).toBe(0); + }); + + it('should support has()', async () => { + expect(adapter.has('file.ts')).toBe(false); + + await adapter.write('file.ts', 'content'); + expect(adapter.has('file.ts')).toBe(true); + }); + + it('should handle basePath option', async () => { + const adapterWithBase = new MemoryAdapter({basePath: 'output'}); + + await adapterWithBase.write('file.ts', 'content'); + + const files = adapterWithBase.getAllFiles(); + expect(files['output/file.ts']).toBe('content'); + }); + + it('should normalize paths with basePath', async () => { + const adapterWithBase = new MemoryAdapter({basePath: 'output/'}); + + await adapterWithBase.write('file.ts', 'content'); + + const files = adapterWithBase.getAllFiles(); + // Should not have double slashes + expect(files['output/file.ts']).toBe('content'); + }); + }); + + describe('Interface Compliance', () => { + it('FileSystemAdapter implements OutputAdapter interface', () => { + const adapter: OutputAdapter = new FileSystemAdapter(); + expect(adapter.write).toBeDefined(); + expect(adapter.mkdir).toBeDefined(); + expect(adapter.getWrittenFiles).toBeDefined(); + expect(adapter.getAllFiles).toBeDefined(); + }); + + it('MemoryAdapter implements OutputAdapter interface', () => { + const adapter: OutputAdapter = new MemoryAdapter(); + expect(adapter.write).toBeDefined(); + expect(adapter.mkdir).toBeDefined(); + expect(adapter.getWrittenFiles).toBeDefined(); + expect(adapter.getAllFiles).toBeDefined(); + }); + }); +}); diff --git a/test/codegen/output/integration.spec.ts b/test/codegen/output/integration.spec.ts new file mode 100644 index 00000000..86d4f05d --- /dev/null +++ b/test/codegen/output/integration.spec.ts @@ -0,0 +1,139 @@ +/** + * Integration tests for OutputAdapter with generators. + * Tests that generators produce the same output with both FileSystemAdapter and MemoryAdapter. + */ +import path from 'node:path'; +import {mkdir, rm, readFile} from 'node:fs/promises'; +import { + FileSystemAdapter, + MemoryAdapter +} from '../../../src/codegen/output'; +import type {GeneratedFile} from '../../../src/codegen/output'; + +describe('Generator OutputAdapter Integration', () => { + const testDir = path.join(__dirname, '.integration-test-output'); + + beforeEach(async () => { + await mkdir(testDir, {recursive: true}); + }); + + afterEach(async () => { + await rm(testDir, {recursive: true, force: true}); + }); + + describe('OutputAdapter with RenderContext', () => { + it('should be passable through RunGeneratorContext', () => { + // Test that the OutputAdapter type is properly exported and usable + const memoryAdapter = new MemoryAdapter(); + const fsAdapter = new FileSystemAdapter({basePath: testDir}); + + // Both should have the same interface + expect(typeof memoryAdapter.write).toBe('function'); + expect(typeof memoryAdapter.mkdir).toBe('function'); + expect(typeof memoryAdapter.getWrittenFiles).toBe('function'); + expect(typeof memoryAdapter.getAllFiles).toBe('function'); + + expect(typeof fsAdapter.write).toBe('function'); + expect(typeof fsAdapter.mkdir).toBe('function'); + expect(typeof fsAdapter.getWrittenFiles).toBe('function'); + expect(typeof fsAdapter.getAllFiles).toBe('function'); + }); + + it('should allow both adapters to track written files', async () => { + const memoryAdapter = new MemoryAdapter(); + const fsAdapter = new FileSystemAdapter({basePath: testDir}); + + // Write same content to both + const testContent = 'export const test = 1;'; + await memoryAdapter.write('test.ts', testContent); + await fsAdapter.write('test.ts', testContent); + + // Both should track the file + expect(memoryAdapter.getWrittenFiles()).toContain('test.ts'); + expect(fsAdapter.getWrittenFiles()).toContain( + path.resolve(testDir, 'test.ts') + ); + + // Memory adapter should return content + expect(memoryAdapter.getAllFiles()['test.ts']).toBe(testContent); + + // FileSystem adapter content must be read from disk + const diskContent = await readFile( + path.resolve(testDir, 'test.ts'), + 'utf-8' + ); + expect(diskContent).toBe(testContent); + }); + }); + + // Note: Full generator integration tests are in the runtime test suite + // which validates that generated code works correctly with real services. +}); + +describe('writeGeneratedFiles utility', () => { + const testDir = path.join(__dirname, '.write-generated-test'); + + beforeEach(async () => { + await mkdir(testDir, {recursive: true}); + }); + + afterEach(async () => { + await rm(testDir, {recursive: true, force: true}); + }); + + it('should write GeneratedFile[] to disk', async () => { + // Import the new utility function + const {writeGeneratedFiles} = await import('../../../src/codegen/output'); + + const files: GeneratedFile[] = [ + {path: 'src/models/User.ts', content: 'export class User {}'}, + {path: 'src/models/Order.ts', content: 'export class Order {}'} + ]; + + const writtenPaths = await writeGeneratedFiles(files, testDir); + + // Should return the written paths + expect(writtenPaths).toHaveLength(2); + + // Files should exist on disk + const userContent = await readFile( + path.resolve(testDir, 'src/models/User.ts'), + 'utf-8' + ); + expect(userContent).toBe('export class User {}'); + + const orderContent = await readFile( + path.resolve(testDir, 'src/models/Order.ts'), + 'utf-8' + ); + expect(orderContent).toBe('export class Order {}'); + }); + + it('should create directories recursively', async () => { + const {writeGeneratedFiles} = await import('../../../src/codegen/output'); + + const files: GeneratedFile[] = [ + {path: 'deep/nested/path/file.ts', content: 'export const x = 1;'} + ]; + + await writeGeneratedFiles(files, testDir); + + const content = await readFile( + path.resolve(testDir, 'deep/nested/path/file.ts'), + 'utf-8' + ); + expect(content).toBe('export const x = 1;'); + }); + + it('should return absolute paths', async () => { + const {writeGeneratedFiles} = await import('../../../src/codegen/output'); + + const files: GeneratedFile[] = [ + {path: 'test.ts', content: 'content'} + ]; + + const writtenPaths = await writeGeneratedFiles(files, testDir); + + expect(writtenPaths[0]).toBe(path.resolve(testDir, 'test.ts')); + }); +}); diff --git a/test/codegen/renderer.spec.ts b/test/codegen/renderer.spec.ts index 68616e5b..cca1a594 100644 --- a/test/codegen/renderer.spec.ts +++ b/test/codegen/renderer.spec.ts @@ -1,7 +1,10 @@ - +/** + * Tests for the rendering pipeline. + * Verifies generator execution, dependency resolution, and file generation. + */ import * as generators from '../../src/codegen/generators'; import * as renderer from '../../src/codegen/renderer'; -import { RunGeneratorContext } from '../../src/codegen/types'; +import { RunGeneratorContext, GeneratedFile } from '../../src/codegen/types'; jest.mock('../../src/codegen/generators'); describe('Render graph', () => { @@ -157,3 +160,169 @@ describe('Render graph', () => { expect(() => renderer.determineRenderGraph(context)).toThrow('Duplicate generator IDs found: payloads-typescript'); }); }); + +describe('Pure core generation', () => { + beforeEach(() => { + jest.clearAllMocks(); + // Mock generators to return files: GeneratedFile[] instead of filesWritten + const mockGeneratorResult = { + files: [ + { path: 'src/payloads/User.ts', content: 'export class User {}' } + ] as GeneratedFile[] + }; + (generators.generateTypescriptPayload as jest.Mock).mockResolvedValue(mockGeneratorResult); + (generators.generateTypescriptParameters as jest.Mock).mockResolvedValue({ files: [] }); + (generators.generateTypescriptHeaders as jest.Mock).mockResolvedValue({ files: [] }); + (generators.generateTypescriptTypes as jest.Mock).mockResolvedValue({ files: [] }); + (generators.generateTypeScriptChannels as jest.Mock).mockResolvedValue({ files: [] }); + (generators.generateTypeScriptClient as jest.Mock).mockResolvedValue({ files: [] }); + }); + + it('should return files as GeneratedFile[] (path + content)', async () => { + const context: any = { + configuration: { + inputType: 'asyncapi', + inputPath: 'asyncapi.json', + generators: [ + { + preset: 'payloads', + outputPath: './src/payloads', + id: 'payloads-typescript', + language: 'typescript' + } + ] + }, + documentPath: 'test', + configFilePath: __dirname, + asyncapiDocument: {} + }; + + const graph = renderer.determineRenderGraph(context); + const result = await renderer.renderGraph(context, graph); + + // Should return files with path and content + expect(result.files).toBeDefined(); + expect(Array.isArray(result.files)).toBe(true); + expect(result.files.length).toBeGreaterThan(0); + + // Each file should have path and content + const file = result.files[0]; + expect(file).toHaveProperty('path'); + expect(file).toHaveProperty('content'); + expect(typeof file.path).toBe('string'); + expect(typeof file.content).toBe('string'); + }); + + it('should not include filesWritten in result (deprecated)', async () => { + const context: any = { + configuration: { + inputType: 'asyncapi', + inputPath: 'asyncapi.json', + generators: [ + { + preset: 'payloads', + outputPath: './src/payloads', + id: 'payloads-typescript', + language: 'typescript' + } + ] + }, + documentPath: 'test', + configFilePath: __dirname, + asyncapiDocument: {} + }; + + const graph = renderer.determineRenderGraph(context); + const result = await renderer.renderGraph(context, graph); + + // files should be the new format, allFiles (string paths) should be deprecated + expect(result.files).toBeDefined(); + // allFiles should be derived from files[].path for backwards compatibility, or removed + }); + + it('should collect files from all generators', async () => { + // Mock multiple generators returning files + (generators.generateTypescriptPayload as jest.Mock).mockResolvedValue({ + files: [ + { path: 'src/payloads/User.ts', content: 'export class User {}' }, + { path: 'src/payloads/Order.ts', content: 'export class Order {}' } + ] as GeneratedFile[] + }); + (generators.generateTypescriptTypes as jest.Mock).mockResolvedValue({ + files: [ + { path: 'src/types/Types.ts', content: 'export type Topics = "users";' } + ] as GeneratedFile[] + }); + + const context: any = { + configuration: { + inputType: 'asyncapi', + inputPath: 'asyncapi.json', + generators: [ + { + preset: 'payloads', + outputPath: './src/payloads', + id: 'payloads-typescript', + language: 'typescript' + }, + { + preset: 'types', + outputPath: './src/types', + id: 'types-typescript', + language: 'typescript' + } + ] + }, + documentPath: 'test', + configFilePath: __dirname, + asyncapiDocument: {} + }; + + const graph = renderer.determineRenderGraph(context); + const result = await renderer.renderGraph(context, graph); + + // Should have 3 files total (2 from payloads, 1 from types) + expect(result.files).toHaveLength(3); + + // Verify files from both generators are included + const paths = result.files.map(f => f.path); + expect(paths).toContain('src/payloads/User.ts'); + expect(paths).toContain('src/payloads/Order.ts'); + expect(paths).toContain('src/types/Types.ts'); + }); + + it('should track files in generator results', async () => { + (generators.generateTypescriptPayload as jest.Mock).mockResolvedValue({ + files: [ + { path: 'src/payloads/User.ts', content: 'export class User {}' } + ] as GeneratedFile[] + }); + + const context: any = { + configuration: { + inputType: 'asyncapi', + inputPath: 'asyncapi.json', + generators: [ + { + preset: 'payloads', + outputPath: './src/payloads', + id: 'payloads-typescript', + language: 'typescript' + } + ] + }, + documentPath: 'test', + configFilePath: __dirname, + asyncapiDocument: {} + }; + + const graph = renderer.determineRenderGraph(context); + const result = await renderer.renderGraph(context, graph); + + // Generator result should track files too + expect(result.generators).toHaveLength(1); + expect(result.generators[0].files).toBeDefined(); + expect(result.generators[0].files).toHaveLength(1); + expect(result.generators[0].files[0].path).toBe('src/payloads/User.ts'); + }); +}); diff --git a/test/runtime/typescript/src/openapi/channels/http_client.ts b/test/runtime/typescript/src/openapi/channels/http_client.ts index fb3c07b2..fc7b34f0 100644 --- a/test/runtime/typescript/src/openapi/channels/http_client.ts +++ b/test/runtime/typescript/src/openapi/channels/http_client.ts @@ -1004,7 +1004,7 @@ export interface PostAddPetContext extends HttpClientContext { /** * HTTP POST request to /pet */ -export async function postAddPet(context: PostAddPetContext): Promise> { +async function postAddPet(context: PostAddPetContext): Promise> { // Apply defaults const config = { path: '/pet', @@ -1127,7 +1127,7 @@ export interface PutUpdatePetContext extends HttpClientContext { /** * HTTP PUT request to /pet */ -export async function putUpdatePet(context: PutUpdatePetContext): Promise> { +async function putUpdatePet(context: PutUpdatePetContext): Promise> { // Apply defaults const config = { path: '/pet', @@ -1250,7 +1250,7 @@ export interface GetFindPetsByStatusAndCategoryContext extends HttpClientContext /** * Find pets by status and category with additional filtering options */ -export async function getFindPetsByStatusAndCategory(context: GetFindPetsByStatusAndCategoryContext): Promise> { +async function getFindPetsByStatusAndCategory(context: GetFindPetsByStatusAndCategoryContext): Promise> { // Apply defaults const config = { path: '/pet/findByStatus/{status}/{categoryId}', diff --git a/test/runtime/typescript/src/openapi/payloads/APet.ts b/test/runtime/typescript/src/openapi/payloads/APet.ts index e84d8721..7983585d 100644 --- a/test/runtime/typescript/src/openapi/payloads/APet.ts +++ b/test/runtime/typescript/src/openapi/payloads/APet.ts @@ -131,7 +131,7 @@ class APet { } return instance; } - public static theCodeGenSchema = {"title":"a Pet","description":"A pet for sale in the pet store","type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"title":"Pet category","description":"A category for a pet","type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string","pattern":"^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"title":"Pet Tag","description":"A tag for a pet","type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","deprecated":true,"enum":["available","pending","sold"]}},"xml":{"name":"Pet"},"$id":"Pet","$schema":"http://json-schema.org/draft-07/schema"}; + public static theCodeGenSchema = {"title":"a Pet","description":"A pet for sale in the pet store","type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"title":"Pet category","description":"A category for a pet","type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string","pattern":"^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"}},"xml":{"name":"Category"}},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"name":"photoUrl","wrapped":true},"items":{"type":"string"}},"tags":{"type":"array","xml":{"name":"tag","wrapped":true},"items":{"title":"Pet Tag","description":"A tag for a pet","type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}}},"status":{"type":"string","description":"pet status in the store","deprecated":true,"enum":["available","pending","sold"]}},"xml":{"name":"Pet"},"$id":"AddPetRequest","$schema":"http://json-schema.org/draft-07/schema"}; public static validate(context?: {data: any, ajvValidatorFunction?: ValidateFunction, ajvInstance?: Ajv, ajvOptions?: AjvOptions}): { valid: boolean; errors?: ErrorObject[]; } { const {data, ajvValidatorFunction} = context ?? {}; // Intentionally parse JSON strings to support validation of marshalled output. diff --git a/test/runtime/typescript/src/request-reply/channels/http_client.ts b/test/runtime/typescript/src/request-reply/channels/http_client.ts index 2b0e7747..872d0241 100644 --- a/test/runtime/typescript/src/request-reply/channels/http_client.ts +++ b/test/runtime/typescript/src/request-reply/channels/http_client.ts @@ -1021,7 +1021,7 @@ export interface PostPingPostRequestContext extends HttpClientContext { /** * HTTP POST request to /ping */ -export async function postPingPostRequest(context: PostPingPostRequestContext): Promise> { +async function postPingPostRequest(context: PostPingPostRequestContext): Promise> { // Apply defaults const config = { path: '/ping', @@ -1143,7 +1143,7 @@ export interface GetPingGetRequestContext extends HttpClientContext { /** * HTTP GET request to /ping */ -export async function getPingGetRequest(context: GetPingGetRequestContext = {}): Promise> { +async function getPingGetRequest(context: GetPingGetRequestContext = {}): Promise> { // Apply defaults const config = { path: '/ping', @@ -1266,7 +1266,7 @@ export interface PutPingPutRequestContext extends HttpClientContext { /** * HTTP PUT request to /ping */ -export async function putPingPutRequest(context: PutPingPutRequestContext): Promise> { +async function putPingPutRequest(context: PutPingPutRequestContext): Promise> { // Apply defaults const config = { path: '/ping', @@ -1388,7 +1388,7 @@ export interface DeletePingDeleteRequestContext extends HttpClientContext { /** * HTTP DELETE request to /ping */ -export async function deletePingDeleteRequest(context: DeletePingDeleteRequestContext = {}): Promise> { +async function deletePingDeleteRequest(context: DeletePingDeleteRequestContext = {}): Promise> { // Apply defaults const config = { path: '/ping', @@ -1511,7 +1511,7 @@ export interface PatchPingPatchRequestContext extends HttpClientContext { /** * HTTP PATCH request to /ping */ -export async function patchPingPatchRequest(context: PatchPingPatchRequestContext): Promise> { +async function patchPingPatchRequest(context: PatchPingPatchRequestContext): Promise> { // Apply defaults const config = { path: '/ping', @@ -1633,7 +1633,7 @@ export interface HeadPingHeadRequestContext extends HttpClientContext { /** * HTTP HEAD request to /ping */ -export async function headPingHeadRequest(context: HeadPingHeadRequestContext = {}): Promise> { +async function headPingHeadRequest(context: HeadPingHeadRequestContext = {}): Promise> { // Apply defaults const config = { path: '/ping', @@ -1755,7 +1755,7 @@ export interface OptionsPingOptionsRequestContext extends HttpClientContext { /** * HTTP OPTIONS request to /ping */ -export async function optionsPingOptionsRequest(context: OptionsPingOptionsRequestContext = {}): Promise> { +async function optionsPingOptionsRequest(context: OptionsPingOptionsRequestContext = {}): Promise> { // Apply defaults const config = { path: '/ping', @@ -1877,7 +1877,7 @@ export interface GetMultiStatusResponseContext extends HttpClientContext { /** * HTTP GET request to /ping */ -export async function getMultiStatusResponse(context: GetMultiStatusResponseContext = {}): Promise> { +async function getMultiStatusResponse(context: GetMultiStatusResponseContext = {}): Promise> { // Apply defaults const config = { path: '/ping', @@ -2000,7 +2000,7 @@ export interface GetGetUserItemContext extends HttpClientContext { /** * HTTP GET request to /users/{userId}/items/{itemId} */ -export async function getGetUserItem(context: GetGetUserItemContext): Promise> { +async function getGetUserItem(context: GetGetUserItemContext): Promise> { // Apply defaults const config = { path: '/users/{userId}/items/{itemId}', @@ -2124,7 +2124,7 @@ export interface PutUpdateUserItemContext extends HttpClientContext { /** * HTTP PUT request to /users/{userId}/items/{itemId} */ -export async function putUpdateUserItem(context: PutUpdateUserItemContext): Promise> { +async function putUpdateUserItem(context: PutUpdateUserItemContext): Promise> { // Apply defaults const config = { path: '/users/{userId}/items/{itemId}', diff --git a/test/runtime/typescript/src/request-reply/payloads/ItemRequest.ts b/test/runtime/typescript/src/request-reply/payloads/ItemRequest.ts index dd4100fc..c09a8456 100644 --- a/test/runtime/typescript/src/request-reply/payloads/ItemRequest.ts +++ b/test/runtime/typescript/src/request-reply/payloads/ItemRequest.ts @@ -82,7 +82,7 @@ class ItemRequest { } return instance; } - public static theCodeGenSchema = {"type":"object","$schema":"http://json-schema.org/draft-07/schema","properties":{"name":{"type":"string","description":"Name of the item"},"description":{"type":"string","description":"Item description"},"quantity":{"type":"integer","description":"Item quantity"}},"required":["name"],"$id":"itemRequest"}; + public static theCodeGenSchema = {"type":"object","properties":{"name":{"type":"string","description":"Name of the item"},"description":{"type":"string","description":"Item description"},"quantity":{"type":"integer","description":"Item quantity"}},"required":["name"],"$id":"itemRequest"}; public static validate(context?: {data: any, ajvValidatorFunction?: ValidateFunction, ajvInstance?: Ajv, ajvOptions?: AjvOptions}): { valid: boolean; errors?: ErrorObject[]; } { const {data, ajvValidatorFunction} = context ?? {}; // Intentionally parse JSON strings to support validation of marshalled output. diff --git a/test/runtime/typescript/src/request-reply/payloads/Ping.ts b/test/runtime/typescript/src/request-reply/payloads/Ping.ts index f24bc4b5..ff12aea3 100644 --- a/test/runtime/typescript/src/request-reply/payloads/Ping.ts +++ b/test/runtime/typescript/src/request-reply/payloads/Ping.ts @@ -52,7 +52,7 @@ class Ping { } return instance; } - public static theCodeGenSchema = {"type":"object","$schema":"http://json-schema.org/draft-07/schema","properties":{"ping":{"type":"string","description":"ping name"}},"$id":"ping"}; + public static theCodeGenSchema = {"type":"object","properties":{"ping":{"type":"string","description":"ping name"}},"$id":"ping"}; public static validate(context?: {data: any, ajvValidatorFunction?: ValidateFunction, ajvInstance?: Ajv, ajvOptions?: AjvOptions}): { valid: boolean; errors?: ErrorObject[]; } { const {data, ajvValidatorFunction} = context ?? {}; // Intentionally parse JSON strings to support validation of marshalled output. diff --git a/test/telemetry/notice.spec.ts b/test/telemetry/notice.spec.ts index 952ec864..110dd331 100644 --- a/test/telemetry/notice.spec.ts +++ b/test/telemetry/notice.spec.ts @@ -32,7 +32,8 @@ describe('Telemetry Notice', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: false }; @@ -57,7 +58,8 @@ describe('Telemetry Notice', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: true }; @@ -77,7 +79,8 @@ describe('Telemetry Notice', () => { enabled: false, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: false }; @@ -99,7 +102,8 @@ describe('Telemetry Notice', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: false }; @@ -126,7 +130,8 @@ describe('Telemetry Notice', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: false }; @@ -145,7 +150,8 @@ describe('Telemetry Notice', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }, hasShownTelemetryNotice: false }; diff --git a/test/telemetry/sender.spec.ts b/test/telemetry/sender.spec.ts index c7560c2d..f883846f 100644 --- a/test/telemetry/sender.spec.ts +++ b/test/telemetry/sender.spec.ts @@ -21,7 +21,8 @@ describe('Telemetry Sender', () => { enabled: false, anonymousId: '', endpoint: '', - trackingId: '' + trackingId: '', + apiSecret: '' }); await sendEvent({event: 'test_event'}, undefined); @@ -34,7 +35,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: '', endpoint: '', - trackingId: '' + trackingId: '', + apiSecret: '' }); await sendEvent({event: 'test_event'}, undefined); @@ -49,7 +51,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: '', // Missing endpoint: '', // Missing - trackingId: '' // Missing + trackingId: '', // Missing + apiSecret: '' }); await sendEvent({event: 'test_event'}, undefined); @@ -64,7 +67,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); await sendEvent({event: 'test_event'}, undefined); @@ -125,7 +129,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid-123', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); let capturedPayload: any; @@ -170,7 +175,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); const mockReq = { @@ -194,7 +200,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); const mockReq = { @@ -223,7 +230,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); const mockReq = { @@ -249,7 +257,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); const mockReq = { @@ -276,7 +285,8 @@ describe('Telemetry Sender', () => { enabled: true, anonymousId: 'test-uuid', endpoint: 'https://example.com/collect', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); // Mock https.request to throw during construction @@ -301,7 +311,8 @@ describe('Telemetry Sender', () => { enabled: false, anonymousId: 'test-uuid', endpoint: 'https://project.com', - trackingId: 'G-PROJECT123' + trackingId: 'G-PROJECT123', + apiSecret: '' }); await sendEvent({event: 'test_event'}, projectConfig); @@ -318,7 +329,8 @@ describe('Telemetry Sender', () => { enabled: false, anonymousId: 'test-uuid', endpoint: 'https://example.com', - trackingId: 'G-TEST123' + trackingId: 'G-TEST123', + apiSecret: '' }); await sendEvent({event: 'test_event'}, projectConfig); diff --git a/tsconfig.browser.json b/tsconfig.browser.json new file mode 100644 index 00000000..9cb10893 --- /dev/null +++ b/tsconfig.browser.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/browser", + "module": "ESNext", + "moduleResolution": "bundler", + "target": "ES2020", + "lib": ["ES2020", "DOM"], + "declaration": false + }, + "include": ["./src/browser/**/*.ts"] +} diff --git a/tsconfig.test.json b/tsconfig.test.json new file mode 100644 index 00000000..9375c7a2 --- /dev/null +++ b/tsconfig.test.json @@ -0,0 +1,22 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "noEmit": true, + "skipLibCheck": true, + "allowImportingTsExtensions": true, + "module": "ESNext", + "moduleResolution": "bundler" + }, + "include": ["./src/**/*.ts", "./test/**/*.ts"], + "exclude": [ + "node_modules", + "dist", + "website", + "mcp-server", + "test/runtime", + "test/blackbox/output", + "test/codegen/generators/typescript/output", + "tmp" + ] +} diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index ecde519e..5ba4c40d 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -8,6 +8,11 @@ const config: Config = { tagline: 'Next-gen code generator', favicon: 'img/favicon.ico', + // Client modules that run before React hydration + clientModules: [ + require.resolve('./src/clientModules/suppressResizeObserver.js'), + ], + // Set the production url of your site here url: 'https://the-codegen-project.org', // Set the // pathname under which your site is served @@ -56,6 +61,8 @@ const config: Config = { organizationName: 'the-codegen-project', // Usually your GitHub org/user name. projectName: 'cli', // Usually your repo name. plugins: [ + // Suppress ResizeObserver errors from Monaco Editor + require.resolve('./plugins/suppress-resize-observer.js'), // [ // 'docusaurus-plugin-typedoc', // { @@ -159,6 +166,7 @@ const config: Config = { position: 'left', label: 'Docs', }, + {to: '/playground', label: 'Playground', position: 'left'}, {to: '/blog', label: 'Blog', position: 'left'}, { href: 'https://github.com/the-codegen-project/cli', diff --git a/website/package-lock.json b/website/package-lock.json index bf1d7105..7b4893e4 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -11,7 +11,11 @@ "@docusaurus/core": "3.5.2", "@docusaurus/preset-classic": "3.5.2", "@mdx-js/react": "^3.0.0", + "@monaco-editor/react": "^4.6.0", "clsx": "^2.0.0", + "file-saver": "^2.0.5", + "jszip": "^3.10.1", + "lz-string": "^1.5.0", "prism-react-renderer": "^2.3.0", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -20,6 +24,7 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", + "@types/file-saver": "^2.0.7", "typedoc": "^0.26.7", "typedoc-plugin-markdown": "^4.2.9", "typescript": "~5.5.2" @@ -2892,6 +2897,29 @@ "react": ">=16" } }, + "node_modules/@monaco-editor/loader": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/loader/-/loader-1.7.0.tgz", + "integrity": "sha512-gIwR1HrJrrx+vfyOhYmCZ0/JcWqG5kbfG7+d3f/C1LXk2EvzAbHSg3MQ5lO2sMlo9izoAZ04shohfKLVT6crVA==", + "license": "MIT", + "dependencies": { + "state-local": "^1.0.6" + } + }, + "node_modules/@monaco-editor/react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@monaco-editor/react/-/react-4.7.0.tgz", + "integrity": "sha512-cyzXQCtO47ydzxpQtCGSQGOC8Gk3ZUeBXFAxD+CWXYFo5OqZyZUonFl0DwUlTyAfRHntBfw2p3w4s9R6oe1eCA==", + "license": "MIT", + "dependencies": { + "@monaco-editor/loader": "^1.5.0" + }, + "peerDependencies": { + "monaco-editor": ">= 0.25.0 < 1", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3419,6 +3447,13 @@ "@types/send": "*" } }, + "node_modules/@types/file-saver": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz", + "integrity": "sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/gtag.js": { "version": "0.0.12", "resolved": "https://registry.npmjs.org/@types/gtag.js/-/gtag.js-0.0.12.tgz", @@ -3636,6 +3671,14 @@ "@types/node": "*" } }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true, + "peer": true + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -5705,6 +5748,16 @@ "url": "https://github.com/fb55/domhandler?sponsor=1" } }, + "node_modules/dompurify": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.7.tgz", + "integrity": "sha512-WhL/YuveyGXJaerVlMYGWhvQswa7myDG17P7Vu65EWC05o8vfeNbvNf4d/BOvH99+ZW+LlQsc1GDKMa1vNK6dw==", + "license": "(MPL-2.0 OR Apache-2.0)", + "peer": true, + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, "node_modules/domutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", @@ -6338,6 +6391,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==", + "license": "MIT" + }, "node_modules/filesize": { "version": "8.0.7", "resolved": "https://registry.npmjs.org/filesize/-/filesize-8.0.7.tgz", @@ -7536,6 +7595,12 @@ "node": ">=16.x" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "license": "MIT" + }, "node_modules/immer": { "version": "9.0.21", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", @@ -8056,6 +8121,54 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -8111,6 +8224,15 @@ "node": ">=6" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/lilconfig": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", @@ -8244,6 +8366,15 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "license": "MIT", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/markdown-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", @@ -8281,6 +8412,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/marked": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", + "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", + "license": "MIT", + "peer": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/mdast-util-directive": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.0.0.tgz", @@ -10513,6 +10657,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/monaco-editor": { + "version": "0.55.1", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.55.1.tgz", + "integrity": "sha512-jz4x+TJNFHwHtwuV9vA9rMujcZRb0CEilTEwG2rRSpe/A7Jdkuj8xPKttCgOh+v/lkHy7HsZ64oj+q3xoAFl9A==", + "license": "MIT", + "peer": true, + "dependencies": { + "dompurify": "3.2.7", + "marked": "14.0.0" + } + }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -10873,6 +11028,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -13013,6 +13174,12 @@ "node": ">= 0.4" } }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -13286,6 +13453,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/state-local": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/state-local/-/state-local-1.0.7.tgz", + "integrity": "sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==", + "license": "MIT" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/website/package.json b/website/package.json index a946274e..fe1172c7 100644 --- a/website/package.json +++ b/website/package.json @@ -3,11 +3,12 @@ "version": "0.0.0", "private": true, "scripts": { - "dev": "docusaurus start", - "start": "npm run build:resources && docusaurus start", - "build": "npm run build:resources && docusaurus build", - "start:windows": "npm run build:resources:windows && docusaurus start", - "build:windows": "npm run build:resources:windows && docusaurus build", + "dev": "npm run copy:bundle && docusaurus start", + "start": "npm run build:resources && npm run copy:bundle && docusaurus start", + "build": "npm run build:resources && npm run copy:bundle && docusaurus build", + "start:windows": "npm run build:resources:windows && npm run copy:bundle && docusaurus start", + "build:windows": "npm run build:resources:windows && npm run copy:bundle && docusaurus build", + "copy:bundle": "node -e \"const fs=require('fs');const src='../dist/browser/codegen.browser.mjs';const dst='./static/codegen.browser.mjs';if(fs.existsSync(src)){fs.mkdirSync('./static',{recursive:true});fs.copyFileSync(src,dst);console.log('Copied browser bundle to static/');}else{console.log('Browser bundle not found at '+src+'. Run npm run build:browser first.');}\"", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", @@ -26,7 +27,11 @@ "@docusaurus/core": "3.5.2", "@docusaurus/preset-classic": "3.5.2", "@mdx-js/react": "^3.0.0", + "@monaco-editor/react": "^4.6.0", "clsx": "^2.0.0", + "file-saver": "^2.0.5", + "jszip": "^3.10.1", + "lz-string": "^1.5.0", "prism-react-renderer": "^2.3.0", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -35,6 +40,7 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", + "@types/file-saver": "^2.0.7", "typedoc": "^0.26.7", "typedoc-plugin-markdown": "^4.2.9", "typescript": "~5.5.2" diff --git a/website/plugins/suppress-resize-observer.js b/website/plugins/suppress-resize-observer.js new file mode 100644 index 00000000..74a21397 --- /dev/null +++ b/website/plugins/suppress-resize-observer.js @@ -0,0 +1,25 @@ +/** + * Docusaurus plugin to suppress ResizeObserver errors in webpack-dev-server overlay. + */ +module.exports = function () { + return { + name: 'suppress-resize-observer', + configureWebpack() { + return { + devServer: { + client: { + overlay: { + runtimeErrors: (error) => { + // Suppress ResizeObserver loop errors (benign Monaco Editor issue) + if (error?.message === 'ResizeObserver loop completed with undelivered notifications.') { + return false; + } + return true; + }, + }, + }, + }, + }; + }, + }; +}; diff --git a/website/src/clientModules/suppressResizeObserver.js b/website/src/clientModules/suppressResizeObserver.js new file mode 100644 index 00000000..c648439b --- /dev/null +++ b/website/src/clientModules/suppressResizeObserver.js @@ -0,0 +1,34 @@ +/** + * Suppress ResizeObserver loop error. + * This is a benign error from Monaco Editor that doesn't affect functionality. + * Must run early before webpack-dev-server overlay captures it. + */ + +// Suppress the error in the global error handler +const originalError = window.onerror; +window.onerror = function (message, source, lineno, colno, error) { + if (message === 'ResizeObserver loop completed with undelivered notifications.') { + return true; // Prevent default handling + } + if (originalError) { + return originalError(message, source, lineno, colno, error); + } + return false; +}; + +// Also suppress via addEventListener +window.addEventListener('error', (e) => { + if (e.message === 'ResizeObserver loop completed with undelivered notifications.') { + e.stopImmediatePropagation(); + e.preventDefault(); + return true; + } +}, true); // Use capture phase to catch it early + +// Suppress unhandled rejection for ResizeObserver +window.addEventListener('unhandledrejection', (e) => { + if (e.reason?.message === 'ResizeObserver loop completed with undelivered notifications.') { + e.preventDefault(); + return true; + } +}, true); diff --git a/website/src/hooks/useCodegen.ts b/website/src/hooks/useCodegen.ts new file mode 100644 index 00000000..d2796363 --- /dev/null +++ b/website/src/hooks/useCodegen.ts @@ -0,0 +1,200 @@ +/** + * Hook to use the browser codegen bundle. + * Provides generation functions and manages loading/error states. + * + * NOTE: The browser bundle must be available at /codegen.browser.mjs + * in the static folder. Copy it there during build. + */ + +import { useState, useCallback, useRef, useEffect } from 'react'; + +export interface GenerateInput { + /** API specification content (AsyncAPI/OpenAPI/JSON Schema) */ + spec: string; + /** Format of the spec ('asyncapi' | 'openapi' | 'jsonschema') */ + specFormat: 'asyncapi' | 'openapi' | 'jsonschema'; + /** Generator configuration */ + config: { + inputType: string; + generators: Array<{ + preset: string; + outputPath: string; + [key: string]: unknown; + }>; + }; +} + +export interface GenerateOutput { + /** Generated files (path → content) */ + files: Record; + /** Any errors that occurred */ + errors: string[]; +} + +export interface UseCodegenResult { + /** Generate code from spec and config */ + generate: (input: GenerateInput) => Promise; + /** Whether generation is in progress */ + isGenerating: boolean; + /** Whether the bundle is loaded and ready */ + isReady: boolean; + /** Last generation output */ + output: GenerateOutput | null; + /** Last error */ + error: string | null; + /** Clear output and error */ + clear: () => void; +} + +// Type for the browser bundle module +interface BrowserCodegen { + generate: (input: { + spec: string; + specFormat: string; + config: unknown; + }) => Promise<{ + files: Record; + errors: string[]; + }>; +} + +// Global reference to loaded module (survives component re-renders) +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare const window: Window & { __codegen_module?: BrowserCodegen }; + +/** + * Normalize a file path by removing leading ./ and extra slashes. + */ +function normalizePath(path: string): string { + // Remove leading ./ or ././ etc + let normalized = path.replace(/^(\.\/)+/, ''); + // Remove any double slashes + normalized = normalized.replace(/\/+/g, '/'); + // Remove leading slash + normalized = normalized.replace(/^\//, ''); + return normalized; +} + +/** + * Normalize all file paths in the output. + */ +function normalizeFilePaths(files: Record): Record { + const normalized: Record = {}; + for (const [path, content] of Object.entries(files)) { + const normalizedPath = normalizePath(path); + if (normalizedPath) { + normalized[normalizedPath] = content; + } + } + return normalized; +} + +export function useCodegen(): UseCodegenResult { + const [isGenerating, setIsGenerating] = useState(false); + const [isReady, setIsReady] = useState(false); + const [output, setOutput] = useState(null); + const [error, setError] = useState(null); + const loadingRef = useRef(false); + + // Load module on mount + useEffect(() => { + if (typeof window === 'undefined') return; + if (window.__codegen_module) { + setIsReady(true); + return; + } + if (loadingRef.current) return; + + loadingRef.current = true; + + // Use Function constructor to create a dynamic import that Webpack won't analyze + const loadBundle = async () => { + try { + // Load the bundle using a script tag to avoid Webpack analysis + const bundleUrl = '/codegen.browser.mjs'; + + // For ESM modules, we need to use dynamic import + // We use new Function to avoid Webpack static analysis + const dynamicImport = new Function('url', 'return import(url)'); + const module = await dynamicImport(bundleUrl); + + window.__codegen_module = module; + setIsReady(true); + } catch (err) { + console.error('Failed to load codegen bundle:', err); + setError('Failed to load codegen bundle. The playground requires the browser bundle to be built and available.'); + } + }; + + loadBundle(); + }, []); + + const generate = useCallback( + async (input: GenerateInput): Promise => { + console.log('[useCodegen] generate called with input:', input); + + if (!window.__codegen_module) { + console.error('[useCodegen] Bundle not loaded'); + const errorOutput: GenerateOutput = { + files: {}, + errors: ['Codegen bundle not loaded. Please wait for it to load or refresh the page.'] + }; + setError(errorOutput.errors[0]); + setOutput(errorOutput); + return errorOutput; + } + + console.log('[useCodegen] Starting generation...'); + setIsGenerating(true); + setError(null); + + try { + console.log('[useCodegen] Calling bundle generate...'); + const result = await window.__codegen_module.generate({ + spec: input.spec, + specFormat: input.specFormat, + config: { + inputType: input.config.inputType, + inputPath: './spec.yaml', // Virtual path + language: 'typescript', + generators: input.config.generators, + }, + }); + + console.log('[useCodegen] Generation complete:', result); + // Normalize file paths to remove leading ./ and fix double slashes + const normalizedResult: GenerateOutput = { + files: normalizeFilePaths(result.files), + errors: result.errors + }; + console.log('[useCodegen] Normalized result:', normalizedResult); + setOutput(normalizedResult); + return normalizedResult; + } catch (err) { + console.error('[useCodegen] Generation error:', err); + const errorMessage = err instanceof Error ? err.message : 'Generation failed'; + setError(errorMessage); + const errorOutput: GenerateOutput = { files: {}, errors: [errorMessage] }; + setOutput(errorOutput); + return errorOutput; + } finally { + setIsGenerating(false); + } + }, + [] + ); + + const clear = useCallback(() => { + setOutput(null); + setError(null); + }, []); + + return { + generate, + isGenerating, + isReady, + output, + error, + clear, + }; +} diff --git a/website/src/hooks/useConfigSync.ts b/website/src/hooks/useConfigSync.ts new file mode 100644 index 00000000..9e3d3cfe --- /dev/null +++ b/website/src/hooks/useConfigSync.ts @@ -0,0 +1,78 @@ +/** + * Hook to sync config form state with TypeScript code. + * Provides bidirectional sync between visual form and code editor. + */ + +import { useState, useEffect, useCallback } from 'react'; +import type { ConfigFormState } from '../utils/configCodegen'; +import { generateTsConfig, getDefaultFormState, getDefaultTsConfig } from '../utils/configCodegen'; +import { parseTsConfig } from '../utils/configParser'; + +export type ConfigMode = 'form' | 'typescript'; + +export interface UseConfigSyncResult { + /** Current form state */ + formState: ConfigFormState; + /** Update form state (triggers TS regeneration) */ + setFormState: (state: ConfigFormState) => void; + /** Current TypeScript config code */ + tsCode: string; + /** Handle TypeScript code change (parses back to form) */ + handleTsChange: (code: string) => void; + /** Current mode (form or typescript) */ + mode: ConfigMode; + /** Switch between modes */ + setMode: (mode: ConfigMode) => void; + /** Parse error if TypeScript is invalid */ + parseError: string | null; +} + +export function useConfigSync(): UseConfigSyncResult { + const [formState, setFormStateInternal] = useState(getDefaultFormState); + const [tsCode, setTsCode] = useState(getDefaultTsConfig); + const [mode, setMode] = useState('form'); + const [parseError, setParseError] = useState(null); + + // When form state changes in form mode, regenerate TypeScript + const setFormState = useCallback((state: ConfigFormState) => { + setFormStateInternal(state); + if (mode === 'form') { + setTsCode(generateTsConfig(state)); + setParseError(null); + } + }, [mode]); + + // When TypeScript changes, try to parse back to form + const handleTsChange = useCallback((code: string) => { + setTsCode(code); + + const result = parseTsConfig(code); + if (result.success && result.data) { + setFormStateInternal(result.data); + setParseError(null); + } else { + // Keep old form state, show error + setParseError(result.error || 'Invalid config'); + } + }, []); + + // When switching modes, sync state + useEffect(() => { + if (mode === 'form') { + // Regenerate TypeScript from form state + setTsCode(generateTsConfig(formState)); + setParseError(null); + } + // When switching to TypeScript mode, keep current code + }, [mode]); + + return { + formState, + setFormState, + tsCode, + handleTsChange, + mode, + setMode, + parseError, + }; +} diff --git a/website/src/hooks/useFileExplorer.ts b/website/src/hooks/useFileExplorer.ts new file mode 100644 index 00000000..d0db433a --- /dev/null +++ b/website/src/hooks/useFileExplorer.ts @@ -0,0 +1,279 @@ +/** + * Hook to manage file explorer state. + * Handles file tree navigation, tabs, and selection. + */ + +import { useState, useEffect, useCallback, useMemo, useRef } from 'react'; + +export interface TreeNode { + name: string; + path: string; + type: 'file' | 'folder'; + children?: TreeNode[]; +} + +export interface UseFileExplorerResult { + /** File tree structure */ + tree: TreeNode | null; + /** Currently selected file in tree */ + selectedFile: string | null; + /** List of open tab paths */ + openTabs: string[]; + /** Currently active tab */ + activeTab: string | null; + /** Set of pinned tab paths */ + pinnedTabs: Set; + /** Set of expanded folder paths */ + expandedFolders: Set; + /** Open a file (adds to tabs if not open) */ + openFile: (path: string) => void; + /** Pin a tab (prevents auto-close) */ + pinTab: (path: string) => void; + /** Close a tab */ + closeTab: (path: string) => void; + /** Toggle folder expanded state */ + toggleFolder: (path: string) => void; + /** Expand all folders */ + expandAll: () => void; + /** Collapse all folders */ + collapseAll: () => void; +} + +/** + * Normalize a file path by removing leading ./ and extra slashes. + */ +function normalizePath(path: string): string { + // Remove leading ./ or ./ + let normalized = path.replace(/^\.\/+/, ''); + // Remove any double slashes + normalized = normalized.replace(/\/+/g, '/'); + // Remove leading slash + normalized = normalized.replace(/^\//, ''); + return normalized; +} + +/** + * Build a tree structure from flat file map. + */ +export function buildFileTree(files: Record): TreeNode | null { + const paths = Object.keys(files).sort(); + + if (paths.length === 0) { + return null; + } + + const root: TreeNode = { + name: 'generated', + path: '', + type: 'folder', + children: [], + }; + + for (const rawFilePath of paths) { + // Normalize the path to remove leading ./ and fix double slashes + const filePath = normalizePath(rawFilePath); + if (!filePath) continue; // Skip empty paths + + const parts = filePath.split('/').filter(Boolean); + if (parts.length === 0) continue; // Skip if no valid parts + + let current = root; + + for (let i = 0; i < parts.length; i++) { + const part = parts[i]; + const isFile = i === parts.length - 1; + const currentPath = parts.slice(0, i + 1).join('/'); + + if (isFile) { + current.children = current.children || []; + current.children.push({ + name: part, + path: filePath, // Use normalized path + type: 'file', + }); + } else { + current.children = current.children || []; + let folder = current.children.find( + (c) => c.type === 'folder' && c.name === part + ); + + if (!folder) { + folder = { + name: part, + path: currentPath, + type: 'folder', + children: [], + }; + current.children.push(folder); + } + + current = folder; + } + } + } + + // Sort children: folders first, then files, alphabetically + sortTree(root); + + return root; +} + +function sortTree(node: TreeNode): void { + if (!node.children) return; + + node.children.sort((a, b) => { + if (a.type !== b.type) { + return a.type === 'folder' ? -1 : 1; + } + return a.name.localeCompare(b.name); + }); + + for (const child of node.children) { + if (child.type === 'folder') { + sortTree(child); + } + } +} + +/** + * Get all folder paths from a tree. + */ +function getAllFolderPaths(node: TreeNode | null): string[] { + if (!node) return []; + + const paths: string[] = []; + + function traverse(n: TreeNode): void { + if (n.type === 'folder' && n.path) { + paths.push(n.path); + } + if (n.children) { + for (const child of n.children) { + traverse(child); + } + } + } + + traverse(node); + return paths; +} + +export function useFileExplorer( + files: Record +): UseFileExplorerResult { + const [selectedFile, setSelectedFile] = useState(null); + const [openTabs, setOpenTabs] = useState([]); + const [activeTab, setActiveTab] = useState(null); + const [pinnedTabs, setPinnedTabs] = useState>(new Set()); + const [expandedFolders, setExpandedFolders] = useState>(new Set()); + + // Build tree from files + const tree = useMemo(() => buildFileTree(files), [files]); + + // Track previous file keys to detect new generations + const prevFileKeysRef = useRef(''); + + // Auto-open first file and expand folders when files change + useEffect(() => { + const paths = Object.keys(files); + const fileKeys = paths.sort().join('|'); + + // Only act if files actually changed (new generation) + if (paths.length > 0 && fileKeys !== prevFileKeysRef.current) { + prevFileKeysRef.current = fileKeys; + + // Find a good default file to open + const indexFile = paths.find((p) => p.endsWith('index.ts')); + const firstFile = indexFile || paths[0]; + openFile(firstFile); + + // Always expand all folders on new generation + setExpandedFolders(new Set(getAllFolderPaths(tree))); + } + }, [files]); + + const openFile = useCallback( + (path: string) => { + if (!openTabs.includes(path)) { + // Find unpinned preview tab to replace + const unpinnedPreview = openTabs.find((t) => !pinnedTabs.has(t)); + + if (unpinnedPreview && openTabs.length > 0 && !pinnedTabs.has(unpinnedPreview)) { + // Replace the unpinned preview tab + setOpenTabs((tabs) => + tabs.map((t) => (t === unpinnedPreview ? path : t)) + ); + } else { + // Add new tab + setOpenTabs((tabs) => [...tabs, path]); + } + } + + setActiveTab(path); + setSelectedFile(path); + }, + [openTabs, pinnedTabs] + ); + + const pinTab = useCallback((path: string) => { + setPinnedTabs((pins) => { + const next = new Set(pins); + next.add(path); + return next; + }); + }, []); + + const closeTab = useCallback( + (path: string) => { + setOpenTabs((tabs) => tabs.filter((t) => t !== path)); + setPinnedTabs((pins) => { + const next = new Set(pins); + next.delete(path); + return next; + }); + + // Switch to adjacent tab + if (activeTab === path) { + const currentTabs = openTabs.filter((t) => t !== path); + const idx = openTabs.indexOf(path); + setActiveTab(currentTabs[idx - 1] || currentTabs[idx] || null); + } + }, + [openTabs, activeTab] + ); + + const toggleFolder = useCallback((path: string) => { + setExpandedFolders((folders) => { + const next = new Set(folders); + if (next.has(path)) { + next.delete(path); + } else { + next.add(path); + } + return next; + }); + }, []); + + const expandAll = useCallback(() => { + setExpandedFolders(new Set(getAllFolderPaths(tree))); + }, [tree]); + + const collapseAll = useCallback(() => { + setExpandedFolders(new Set()); + }, []); + + return { + tree, + selectedFile, + openTabs, + activeTab, + pinnedTabs, + expandedFolders, + openFile, + pinTab, + closeTab, + toggleFolder, + expandAll, + collapseAll, + }; +} diff --git a/website/src/schemas/asyncapi-2.0.0.json b/website/src/schemas/asyncapi-2.0.0.json new file mode 100644 index 00000000..2a1bf42a --- /dev/null +++ b/website/src/schemas/asyncapi-2.0.0.json @@ -0,0 +1,2301 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.0.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.0.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/server" + } + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/serverVariable" + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {} + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.1.0.json b/website/src/schemas/asyncapi-2.1.0.json new file mode 100644 index 00000000..f2db9a08 --- /dev/null +++ b/website/src/schemas/asyncapi-2.1.0.json @@ -0,0 +1,2438 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.1.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.1.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/server" + } + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/serverVariable" + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {} + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.2.0.json b/website/src/schemas/asyncapi-2.2.0.json new file mode 100644 index 00000000..d2306956 --- /dev/null +++ b/website/src/schemas/asyncapi-2.2.0.json @@ -0,0 +1,2423 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.2.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.2.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/server" + } + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/serverVariable" + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {} + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "servers": { + "type": "array", + "description": "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.3.0.json b/website/src/schemas/asyncapi-2.3.0.json new file mode 100644 index 00000000..e55f77bf --- /dev/null +++ b/website/src/schemas/asyncapi-2.3.0.json @@ -0,0 +1,2444 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.3.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.3.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/serverVariable" + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "servers": { + "type": "array", + "description": "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.4.0.json b/website/src/schemas/asyncapi-2.4.0.json new file mode 100644 index 00000000..a1b83162 --- /dev/null +++ b/website/src/schemas/asyncapi-2.4.0.json @@ -0,0 +1,2468 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.4.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.4.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/serverVariable" + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "servers": { + "type": "array", + "description": "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string" + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "serverVariables": { + "$ref": "#/definitions/serverVariables" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.5.0.json b/website/src/schemas/asyncapi-2.5.0.json new file mode 100644 index 00000000..bd49a22e --- /dev/null +++ b/website/src/schemas/asyncapi-2.5.0.json @@ -0,0 +1,2482 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.5.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.5.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "General information about the API.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + } + }, + "contact": { + "type": "object", + "description": "Contact information for the owners of the API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "server": { + "type": "object", + "description": "An object representing a Server.", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "protocol": { + "type": "string", + "description": "The transfer protocol." + }, + "protocolVersion": { + "type": "string" + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + } + } + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + }, + "examples": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "bindingsObject": { + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, + "tag": { + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "channels": { + "type": "object", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + } + }, + "channelItem": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "servers": { + "type": "array", + "description": "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters." + }, + "parameter": { + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "schema": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "operation": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + } + }, + "operationTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "message": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string" + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object" + }, + "payload": {} + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + "correlationId": { + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "messageTrait": { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": { + "type": "object" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "serverVariables": { + "$ref": "#/definitions/serverVariables" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + } + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Flows": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string" + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-2.6.0.json b/website/src/schemas/asyncapi-2.6.0.json new file mode 100644 index 00000000..6c79b5cc --- /dev/null +++ b/website/src/schemas/asyncapi-2.6.0.json @@ -0,0 +1,3180 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 2.6.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info", + "channels" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "enum": [ + "2.6.0" + ], + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "type": "object", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + } + }, + "examples": [ + { + "title": "AsyncAPI Sample App", + "description": "This is a sample server.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + } + ] + }, + "contact": { + "type": "object", + "description": "Contact information for the exposed API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "description": "License information for the exposed API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "servers": { + "description": "The Servers Object is a map of Server Objects.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + }, + "examples": [ + { + "development": { + "url": "development.gigantic-server.com", + "description": "Development server", + "protocol": "amqp", + "protocolVersion": "0.9.1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests" + } + ] + }, + "staging": { + "url": "staging.gigantic-server.com", + "description": "Staging server", + "protocol": "amqp", + "protocolVersion": "0.9.1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment" + } + ] + }, + "production": { + "url": "api.gigantic-server.com", + "description": "Production server", + "protocol": "amqp", + "protocolVersion": "0.9.1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users" + } + ] + } + } + ] + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + } + } + }, + "ReferenceObject": { + "type": "string", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "format": "uri-reference", + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] + }, + "server": { + "type": "object", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data", + "required": [ + "url", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string", + "description": "A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served." + }, + "description": { + "type": "string", + "description": "An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation." + }, + "protocol": { + "type": "string", + "description": "The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub." + }, + "protocolVersion": { + "type": "string", + "description": "The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc." + }, + "variables": { + "description": "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + "$ref": "#/definitions/serverVariables" + }, + "security": { + "type": "array", + "description": "A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.", + "$ref": "#/definitions/bindingsObject" + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of servers.", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + } + }, + "examples": [ + { + "url": "development.gigantic-server.com", + "description": "Development server", + "protocol": "kafka", + "protocolVersion": "1.0.0" + } + ] + }, + "serverVariables": { + "type": "object", + "description": "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + "description": { + "type": "string", + "description": "An optional description for the server variable. " + }, + "examples": { + "type": "array", + "description": "An array of examples of the server variable.", + "items": { + "type": "string" + } + } + } + }, + "SecurityRequirement": { + "type": "object", + "description": "Lists of the required security schemes that can be used to execute an operation", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "examples": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + }, + "bindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a server.", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {}, + "googlepubsub": {}, + "pulsar": {} + } + }, + "tag": { + "type": "object", + "description": "Allows adding meta data to a single tag.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the tag." + }, + "description": { + "type": "string", + "description": "A short description for the tag." + }, + "externalDocs": { + "description": "Additional external documentation for this tag.", + "$ref": "#/definitions/externalDocs" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "Allows referencing an external resource for extended documentation.", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string", + "description": "A short description of the target documentation." + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] + }, + "channels": { + "type": "object", + "description": "Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.", + "propertyNames": { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + "additionalProperties": { + "$ref": "#/definitions/channelItem" + }, + "examples": [ + { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "channelItem": { + "type": "object", + "description": "Describes the operations available on a single channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "$ref": "#/definitions/ReferenceObject" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "description": { + "type": "string", + "description": "A description of the channel." + }, + "servers": { + "type": "array", + "description": "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "publish": { + "$ref": "#/definitions/operation" + }, + "subscribe": { + "$ref": "#/definitions/operation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + }, + "examples": [ + { + "description": "This channel is used to exchange messages about users signing up", + "subscribe": { + "summary": "A user signed up.", + "message": { + "description": "A longer description of the message", + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/user" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + } + }, + { + "subscribe": { + "message": { + "oneOf": [ + { + "$ref": "#/components/messages/signup" + }, + { + "$ref": "#/components/messages/login" + } + ] + } + } + }, + { + "description": "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.", + "servers": [ + "rabbitmqBrokerInProd", + "rabbitmqBrokerInStaging" + ], + "subscribe": { + "message": { + "$ref": "#/components/messages/WebUICommand" + } + }, + "bindings": { + "amqp": { + "is": "queue" + } + } + } + ] + }, + "parameters": { + "type": "object", + "description": "JSON objects describing reusable channel parameters.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "examples": [ + { + "user/{userId}/signup": { + "parameters": { + "userId": { + "description": "Id of the user.", + "schema": { + "type": "string" + } + } + }, + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "parameter": { + "description": "Describes a parameter included in a channel name.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "#/definitions/schema" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "user/{userId}/signup": { + "parameters": { + "userId": { + "description": "Id of the user.", + "schema": { + "type": "string" + }, + "location": "$message.payload#/user/id" + } + }, + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "schema": { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.", + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. " + }, + "externalDocs": { + "description": "Additional external documentation for this schema.", + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false, + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage" + } + } + } + ], + "examples": [ + { + "type": "string", + "format": "email" + }, + { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "age": { + "type": "integer", + "format": "int32", + "minimum": 0 + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "operation": { + "type": "object", + "description": "Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "traits": { + "type": "array", + "description": "A list of traits to apply to the operation object.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "summary": { + "type": "string", + "description": "A short summary of what the operation is about." + }, + "description": { + "type": "string", + "description": "A verbose explanation of the operation." + }, + "security": { + "type": "array", + "description": "A declaration of which security mechanisms are associated with this operation.", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string" + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "message": { + "$ref": "#/definitions/message" + } + }, + "examples": [ + { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "operationTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "summary": { + "type": "string", + "description": "A short summary of what the operation is about." + }, + "description": { + "type": "string", + "description": "A verbose explanation of the operation." + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "operationId": { + "type": "string", + "description": "Unique string used to identify the operation. The id MUST be unique among all operations described in the API." + }, + "security": { + "type": "array", + "description": "A declaration of which security mechanisms are associated with this operation. ", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + }, + "message": { + "description": "Describes a message received on a given channel and operation.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/message" + } + } + } + }, + { + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "headers": { + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string" + }, + "payload": {}, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Schema definition of the application headers." + }, + "payload": { + "description": "Definition of the message payload. It can be of any type" + } + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + }, + "traits": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "allOf": [ + { + "if": { + "not": { + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "payload": { + "$ref": "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ], + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + }, + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "payload": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + ] + }, + "correlationId": { + "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] + }, + "messageTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaFormat": { + "type": "string", + "description": "A string containing the name of the schema format/language used to define the message payload." + }, + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload." + }, + "headers": { + "description": "Schema definition of the application headers.", + "allOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "properties": { + "type": { + "const": "object" + } + } + } + ] + }, + "messageId": { + "type": "string", + "description": "Unique string used to identify the message. The id MUST be unique among all messages described in the API." + }, + "correlationId": { + "description": "Definition of the correlation ID used for message tracing or matching.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of messages.", + "items": { + "$ref": "#/definitions/tag" + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "$ref": "#/definitions/externalDocs" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Schema definition of the application headers." + }, + "payload": { + "description": "Definition of the message payload. It can be of any type" + } + } + } + }, + "bindings": { + "$ref": "#/definitions/bindingsObject" + } + }, + "examples": [ + { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "contentType": "application/json" + } + ] + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "components": { + "type": "object", + "description": "Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "$ref": "#/definitions/schemas" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "serverVariables": { + "$ref": "#/definitions/serverVariables" + }, + "messages": { + "$ref": "#/definitions/messages" + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "correlationIds": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/operationTrait" + } + }, + "messageTraits": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/messageTrait" + } + }, + "serverBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "channelBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "operationBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + }, + "messageBindings": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/bindingsObject" + } + } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + } + }, + "servers": { + "development": { + "url": "{stage}.gigantic-server.com:{port}", + "description": "Development server", + "protocol": "amqp", + "protocolVersion": "0.9.1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `gigantic-server.com`" + }, + "port": { + "enum": [ + "8883", + "8884" + ], + "default": "8883" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user.", + "schema": { + "type": "string" + } + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] + }, + "schemas": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "description": "JSON objects describing schemas the API uses." + }, + "messages": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/message" + }, + "description": "JSON objects describing the messages being consumed and produced by the API." + }, + "SecurityScheme": { + "description": "Defines a security scheme that can be used by the operations.", + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ], + "examples": [ + { + "type": "userPassword" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. ", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "description": "The location of the API key. ", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ], + "description": "The type of the security scheme." + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "description": "A short description for security scheme.", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "type": { + "type": "string", + "description": "The type of the security scheme. ", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted." + }, + "type": { + "type": "string", + "description": "The type of the security scheme. ", + "enum": [ + "http" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. ", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." + }, + "in": { + "type": "string", + "description": "The location of the API key. ", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] + }, + "oauth2Flows": { + "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "description": "A short description for security scheme.", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "scopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + "additionalProperties": false + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "description": "Configuration details for a supported OAuth Flow", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "tokenUrl": { + "type": "string", + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "refreshUrl": { + "type": "string", + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + "scopes": { + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + "$ref": "#/definitions/oauth2Scopes" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + "authorizationCode": { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "scopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + ] + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string" + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. Valid values", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-3.0.0.json b/website/src/schemas/asyncapi-3.0.0.json new file mode 100644 index 00000000..f7687fdc --- /dev/null +++ b/website/src/schemas/asyncapi-3.0.0.json @@ -0,0 +1,8971 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 3.0.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "asyncapi": { + "type": "string", + "const": "3.0.0", + "description": "The AsyncAPI specification version of this document." + }, + "id": { + "type": "string", + "description": "A unique id representing the application.", + "format": "uri" + }, + "info": { + "$ref": "#/definitions/info" + }, + "servers": { + "$ref": "#/definitions/servers" + }, + "defaultContentType": { + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "operations": { + "$ref": "#/definitions/operations" + }, + "components": { + "$ref": "#/definitions/components" + } + }, + "definitions": { + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalProperties": true, + "additionalItems": true + }, + "info": { + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", + "allOf": [ + { + "type": "object", + "required": [ + "version", + "title" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "type": "string", + "description": "A unique and precise title of the API." + }, + "version": { + "type": "string", + "description": "A semantic version number of the API." + }, + "description": { + "type": "string", + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + "termsOfService": { + "type": "string", + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "format": "uri" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "license": { + "$ref": "#/definitions/license" + }, + "tags": { + "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + } + }, + { + "$ref": "#/definitions/infoExtensions" + } + ], + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] + }, + "contact": { + "type": "object", + "description": "Contact information for the exposed API.", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The identifying name of the contact person/organization." + }, + "url": { + "type": "string", + "description": "The URL pointing to the contact information.", + "format": "uri" + }, + "email": { + "type": "string", + "description": "The email address of the contact person/organization.", + "format": "email" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the license type. It's encouraged to use an OSI compatible license." + }, + "url": { + "type": "string", + "description": "The URL pointing to the license.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "Reference": { + "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "description": "The reference string.", + "$ref": "#/definitions/ReferenceObject" + } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "tag": { + "type": "object", + "description": "Allows adding metadata to a single tag.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the tag." + }, + "description": { + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] + }, + "externalDocs": { + "type": "object", + "additionalProperties": false, + "description": "Allows referencing an external resource for extended documentation.", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + "url": { + "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] + }, + "infoExtensions": { + "type": "object", + "description": "The object that lists all the extensions of Info", + "properties": { + "x-x": { + "$ref": "#/definitions/extensions-x-0.1.0-schema" + }, + "x-linkedin": { + "$ref": "#/definitions/extensions-linkedin-0.1.0-schema" + } + } + }, + "extensions-x-0.1.0-schema": { + "type": "string", + "description": "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + "example": [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + "extensions-linkedin-0.1.0-schema": { + "type": "string", + "pattern": "^http(s)?://(www\\.)?linkedin\\.com.*$", + "description": "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + "example": [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] + }, + "server": { + "type": "object", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + "required": [ + "host", + "protocol" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "host": { + "type": "string", + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "pathname": { + "type": "string", + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the server." + }, + "summary": { + "type": "string", + "description": "A brief summary of the server." + }, + "description": { + "type": "string", + "description": "A longer description of the server. CommonMark is allowed." + }, + "protocol": { + "type": "string", + "description": "The protocol this server supports for connection." + }, + "protocolVersion": { + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." + }, + "variables": { + "$ref": "#/definitions/serverVariables" + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + } + }, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + }, + "serverVariable": { + "type": "object", + "description": "An object representing a Server Variable for server URL template substitution.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "enum": { + "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "default": { + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + "description": { + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + "examples": { + "type": "array", + "description": "An array of examples of the server variable.", + "items": { + "type": "string" + } + } + }, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] + }, + "securityRequirements": { + "description": "An array representing security requirements.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + }, + "SecurityScheme": { + "description": "Defines a security scheme that can be used by the operations.", + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ], + "examples": [ + { + "type": "userPassword" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme", + "enum": [ + "apiKey" + ] + }, + "in": { + "type": "string", + "description": " The location of the API key.", + "enum": [ + "user", + "password" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "X509" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "asymmetricEncryption" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "not": { + "type": "object", + "properties": { + "scheme": { + "type": "string", + "description": "A short description for security scheme.", + "enum": [ + "bearer" + ] + } + } + }, + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "scheme": { + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "enum": [ + "bearer" + ] + }, + "bearerFormat": { + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." + }, + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "http" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "httpApiKey" + ] + }, + "name": { + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." + }, + "in": { + "type": "string", + "description": "The location of the API key", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] + }, + "oauth2Flows": { + "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "oauth2" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + }, + "flows": { + "type": "object", + "properties": { + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + } + }, + "additionalProperties": false + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "type": "object", + "description": "Configuration details for a supported OAuth Flow", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "tokenUrl": { + "type": "string", + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + "refreshUrl": { + "type": "string", + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + "availableScopes": { + "$ref": "#/definitions/oauth2Scopes", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "openIdConnect" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + }, + "scopes": { + "type": "array", + "description": "List of the needed scope names. An empty array means no scopes are needed.", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme. Valid values", + "enum": [ + "plain" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "scramSha256", + "scramSha512" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the security scheme.", + "enum": [ + "gssapi" + ] + }, + "description": { + "type": "string", + "description": "A short description for security scheme." + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "serverBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a server.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-server" + } + } + ] + }, + "anypointmq": {}, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + } + ] + }, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-server" + } + } + ] + }, + "googlepubsub": {}, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + } + ] + } + } + }, + "bindings-mqtt-0.2.0-server": { + "title": "Server Schema", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "sessionExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + "maximumPacketSize": { + "oneOf": [ + { + "type": "integer", + "minimum": 1, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, + "bindingVersion": "0.2.0" + } + ] + }, + "schema": { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ], + "default": {} + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ], + "default": {} + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + }, + "default": {} + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "discriminator": { + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + "default": false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "bindings-kafka-0.5.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-jms-0.0.1-server": { + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "jmsConnectionFactory" + ], + "properties": { + "jmsConnectionFactory": { + "type": "string", + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/definitions/bindings-jms-0.0.1-server/definitions/property" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + "clientID": { + "type": "string", + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-server": { + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-solace-0.4.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "clientName": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "description": "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-solace-0.3.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-solace-0.2.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-pulsar-0.1.0-server": { + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] + }, + "channels": { + "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "channel": { + "type": "object", + "description": "Describes a shared communication channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "address": { + "type": [ + "string", + "null" + ], + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions." + }, + "messages": { + "$ref": "#/definitions/channelMessages" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "title": { + "type": "string", + "description": "A human-friendly title for the channel." + }, + "summary": { + "type": "string", + "description": "A brief summary of the channel." + }, + "description": { + "type": "string", + "description": "A longer description of the channel. CommonMark is allowed." + }, + "servers": { + "type": "array", + "description": "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "items": { + "$ref": "#/definitions/Reference" + }, + "uniqueItems": true + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping of channels.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + } + }, + "examples": [ + { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/rabbitmqInProd" + }, + { + "$ref": "#/servers/rabbitmqInStaging" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ] + }, + "channelMessages": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + }, + "description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**" + }, + "messageObject": { + "type": "object", + "description": "Describes a message received on a given channel and operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "payload": { + "$ref": "#/definitions/anySchema" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "$ref": "#/definitions/messageExampleObject" + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + }, + { + "type": "array", + "items": [ + { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + }, + { + "type": "object", + "additionalItems": true + } + ] + } + ] + } + } + }, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] + }, + "anySchema": { + "if": { + "required": [ + "schema" + ] + }, + "then": { + "$ref": "#/definitions/multiFormatSchema" + }, + "else": { + "$ref": "#/definitions/schema" + }, + "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." + }, + "multiFormatSchema": { + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "if": { + "not": { + "type": "object" + } + }, + "then": { + "$ref": "#/definitions/schema" + }, + "else": { + "properties": { + "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + "anyOf": [ + { + "type": "string" + }, + { + "description": "All the schema formats tooling MUST support", + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + }, + { + "description": "All the schema formats tools are RECOMMENDED to support", + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + }, + "allOf": [ + { + "if": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ] + } + } + } + } + ] + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "correlationId": { + "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] + }, + "messageExampleObject": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "name": { + "type": "string", + "description": "Machine readable name of the message example." + }, + "summary": { + "type": "string", + "description": "A brief summary of the message example." + }, + "headers": { + "type": "object", + "description": "Example of the application headers. It MUST be a map of key-value pairs." + }, + "payload": { + "type": [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + "description": "Example of the message payload. It can be of any type." + } + } + }, + "messageBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-message" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-message" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + } + ] + }, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + } + ] + } + } + }, + "bindings-http-0.3.0-message": { + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "statusCode": { + "type": "number", + "description": "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-http-0.2.0-message": { + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-message": { + "title": "AMQP message bindings object", + "description": "This object contains information about the message representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentEncoding": { + "type": "string", + "description": "A MIME encoding for the message content." + }, + "messageType": { + "type": "string", + "description": "Application-specific message type." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-message": { + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "payloadFormatIndicator": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + "default": 0 + }, + "correlationData": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + "contentType": { + "type": "string", + "description": "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + "responseTopic": { + "oneOf": [ + { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.5.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "anyOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.4.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "$ref": "#/definitions/schema", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-message": { + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-message": { + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } + } + ], + "examples": [ + { + "type": "string", + "bindingVersion": "0.1.0" + }, + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-message": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "messageTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentType": { + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "tags": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "summary": { + "type": "string", + "description": "A brief summary of the message." + }, + "name": { + "type": "string", + "description": "Name of the message." + }, + "title": { + "type": "string", + "description": "A human-friendly title for the message." + }, + "description": { + "type": "string", + "description": "A longer description of the message. CommonMark is allowed." + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "description": "List of examples.", + "items": { + "$ref": "#/definitions/messageExampleObject" + } + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + } + }, + "examples": [ + { + "contentType": "application/json" + } + ] + }, + "parameters": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "description": "JSON objects describing re-usable channel parameters.", + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] + }, + "parameter": { + "description": "Describes a parameter included in a channel address.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the parameter value.", + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] + }, + "channelBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": {}, + "ws": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + } + ] + }, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + } + ] + }, + "amqp1": {}, + "mqtt": {}, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-channel" + } + } + ] + }, + "anypointmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + } + ] + }, + "nats": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + } + ] + }, + "solace": {}, + "googlepubsub": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + } + ] + }, + "pulsar": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + } + ] + } + } + }, + "bindings-websockets-0.1.0-channel": { + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-amqp-0.3.0-channel": { + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-kafka-0.5.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": true, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + }, + "confluent.key.schema.validation": { + "description": "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + "type": "boolean" + }, + "confluent.key.subject.name.strategy": { + "description": "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + "type": "string" + }, + "confluent.value.schema.validation": { + "description": "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + "type": "boolean" + }, + "confluent.value.subject.name.strategy": { + "description": "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + "type": "string" + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": false, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-channel": { + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-channel": { + "title": "Channel Schema", + "description": "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signed-up", + "destinationType": "fifo-queue", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-sns-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/ordering" + }, + "policy": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 900, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } + } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-channel": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + } + }, + "required": [ + "schemaSettings" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "bindings-pulsar-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] + }, + "operations": { + "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "operation": { + "type": "object", + "description": "Describes a specific operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "action", + "channel" + ], + "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": [ + "send", + "receive" + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "#/definitions/Reference" + } + }, + "reply": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + }, + "traits": { + "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + }, + "title": { + "type": "string", + "description": "A human-friendly title for the operation." + }, + "summary": { + "type": "string", + "description": "A brief summary of the operation." + }, + "description": { + "type": "string", + "description": "A longer description of the operation. CommonMark is allowed." + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "tags": { + "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + }, + "uniqueItems": true + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + }, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "operationReply": { + "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "address": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "messages": { + "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "items": { + "$ref": "#/definitions/Reference" + } + } + } + }, + "operationReplyAddress": { + "type": "object", + "description": "An object that specifies where an operation has to send the reply", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "location" + ], + "properties": { + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the reply address.", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "description": { + "type": "string", + "description": "An optional description of the address. CommonMark is allowed." + } + }, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] + }, + "operationTrait": { + "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "$ref": "#/definitions/operation/properties/title" + }, + "summary": { + "description": "A short summary of what the operation is about.", + "$ref": "#/definitions/operation/properties/summary" + }, + "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + "$ref": "#/definitions/operation/properties/description" + }, + "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + "$ref": "#/definitions/operation/properties/security" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "$ref": "#/definitions/operation/properties/tags" + }, + "externalDocs": { + "description": "Additional external documentation for this operation.", + "$ref": "#/definitions/operation/properties/externalDocs" + }, + "bindings": { + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + }, + "operationBindingsObject": { + "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "http": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-operation" + } + } + ] + }, + "ws": {}, + "amqp": { + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + } + ] + }, + "amqp1": {}, + "mqtt": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + } + ] + }, + "kafka": { + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-operation" + } + } + ] + }, + "anypointmq": {}, + "nats": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + } + ] + }, + "jms": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ] + }, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": { + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-operation" + } + } + ] + }, + "googlepubsub": {} + } + }, + "bindings-http-0.3.0-operation": { + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-http-0.2.0-operation": { + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-operation": { + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Like cc but consumers will not receive this information." + }, + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-operation": { + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." + }, + "messageExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Lifetime of the message in seconds" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "messageExpiryInterval": 60, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-sns-0.1.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/consumer" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy" + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ] + }, + "bindings-sqs-0.2.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/queue" + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 900, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ] + }, + "bindings-solace-0.4.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "timeToLive": { + "type": "integer", + "description": "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + "priority": { + "type": "integer", + "minimum": 0, + "maximum": 255, + "description": "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + "dmqEligible": { + "type": "boolean", + "description": "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + "examples": [ + { + "bindingVersion": "0.4.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.3.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.2.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "components": { + "type": "object", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemas": { + "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "$ref": "#/definitions/anySchema" + } + } + }, + "servers": { + "type": "object", + "description": "An object to hold reusable Server Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + } + }, + "channels": { + "type": "object", + "description": "An object to hold reusable Channel Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + } + } + }, + "serverVariables": { + "type": "object", + "description": "An object to hold reusable Server Variable Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + } + }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + } + } + }, + "messages": { + "type": "object", + "description": "An object to hold reusable Message Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + } + } + }, + "securitySchemes": { + "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "parameters": { + "type": "object", + "description": "An object to hold reusable Parameter Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + } + } + }, + "correlationIds": { + "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "operationTraits": { + "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + } + }, + "messageTraits": { + "type": "object", + "description": "An object to hold reusable Message Trait Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "replies": { + "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + } + } + }, + "replyAddresses": { + "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + } + } + }, + "serverBindings": { + "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + } + } + }, + "channelBindings": { + "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + } + } + }, + "operationBindings": { + "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + } + }, + "messageBindings": { + "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + } + } + }, + "tags": { + "type": "object", + "description": "An object to hold reusable Tag Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + } + }, + "externalDocs": { + "type": "object", + "description": "An object to hold reusable External Documentation Objects.", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + } + } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/asyncapi-3.1.0.json b/website/src/schemas/asyncapi-3.1.0.json new file mode 100644 index 00000000..4261a27c --- /dev/null +++ b/website/src/schemas/asyncapi-3.1.0.json @@ -0,0 +1,9185 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "AsyncAPI 3.1.0 schema.", + "type": "object", + "required": [ + "asyncapi", + "info" + ], + "properties": { + "id": { + "description": "A unique id representing the application.", + "type": "string", + "format": "uri" + }, + "asyncapi": { + "description": "The AsyncAPI specification version of this document.", + "type": "string", + "const": "3.1.0" + }, + "channels": { + "$ref": "#/definitions/channels" + }, + "components": { + "$ref": "#/definitions/components" + }, + "defaultContentType": { + "description": "Default content type to use when encoding/decoding a message's payload.", + "type": "string" + }, + "info": { + "$ref": "#/definitions/info" + }, + "operations": { + "$ref": "#/definitions/operations" + }, + "servers": { + "$ref": "#/definitions/servers" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "definitions": { + "channels": { + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "Reference": { + "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", + "required": [ + "$ref" + ], + "properties": { + "$ref": { + "description": "The reference string.", + "$ref": "#/definitions/ReferenceObject" + } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] + }, + "ReferenceObject": { + "type": "string", + "format": "uri-reference" + }, + "channel": { + "description": "Describes a shared communication channel.", + "type": "object", + "properties": { + "title": { + "description": "A human-friendly title for the channel.", + "type": "string" + }, + "description": { + "description": "A longer description of the channel. CommonMark is allowed.", + "type": "string" + }, + "address": { + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions.", + "type": [ + "string", + "null" + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "messages": { + "$ref": "#/definitions/channelMessages" + }, + "parameters": { + "$ref": "#/definitions/parameters" + }, + "servers": { + "description": "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + "type": "array", + "uniqueItems": true, + "items": { + "$ref": "#/definitions/Reference" + } + }, + "summary": { + "description": "A brief summary of the channel.", + "type": "string" + }, + "tags": { + "description": "A list of tags for logical grouping of channels.", + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "address": "users.{userId}", + "title": "Users channel", + "description": "This channel is used to exchange messages about user events.", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + }, + "userCompletedOrder": { + "$ref": "#/components/messages/userCompletedOrder" + } + }, + "parameters": { + "userId": { + "$ref": "#/components/parameters/userId" + } + }, + "servers": [ + { + "$ref": "#/servers/rabbitmqInProd" + }, + { + "$ref": "#/servers/rabbitmqInStaging" + } + ], + "bindings": { + "amqp": { + "is": "queue", + "queue": { + "exclusive": true + } + } + }, + "tags": [ + { + "name": "user", + "description": "User-related messages" + } + ], + "externalDocs": { + "description": "Find more info here", + "url": "https://example.com" + } + } + ] + }, + "channelBindingsObject": { + "description": "Map describing protocol-specific definitions for a channel.", + "type": "object", + "properties": { + "amqp": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + } + }, + "amqp1": {}, + "anypointmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + } + }, + "googlepubsub": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "http": {}, + "ibmmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "jms": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + } + }, + "kafka": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + "mqtt": {}, + "nats": {}, + "pulsar": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "redis": {}, + "sns": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "solace": {}, + "sqs": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "stomp": {}, + "ws": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-websockets-0.1.0-channel" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "bindings-amqp-0.3.0-channel": { + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ] + }, + "specificationExtension": { + "description": "Any property starting with x- is valid.", + "additionalItems": true, + "additionalProperties": true + }, + "bindings-anypointmq-0.0.1-channel": { + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-googlepubsub-0.2.0-channel": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + } + }, + "required": [ + "schemaSettings" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } + } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-channel": { + "title": "Channel Schema", + "description": "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signed-up", + "destinationType": "fifo-queue", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": true, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + }, + "confluent.key.schema.validation": { + "description": "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + "type": "boolean" + }, + "confluent.key.subject.name.strategy": { + "description": "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + "type": "string" + }, + "confluent.value.schema.validation": { + "description": "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + "type": "boolean" + }, + "confluent.value.subject.name.strategy": { + "description": "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + "type": "string" + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "topicConfiguration": { + "description": "Topic configuration properties that are relevant for the API.", + "type": "object", + "additionalProperties": false, + "properties": { + "cleanup.policy": { + "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + "type": "integer", + "minimum": -1 + }, + "retention.bytes": { + "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + "type": "integer", + "minimum": -1 + }, + "delete.retention.ms": { + "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + "type": "integer", + "minimum": 0 + }, + "max.message.bytes": { + "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + "type": "integer", + "minimum": 0 + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-pulsar-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-sns-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/ordering" + }, + "policy": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 900, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "bindings-websockets-0.1.0-channel": { + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "schema": { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "properties": { + "deprecated": { + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + "default": false, + "type": "boolean" + }, + "allOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "anyOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "oneOf": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + }, + "not": { + "$ref": "#/definitions/schema" + }, + "contains": { + "$ref": "#/definitions/schema" + }, + "items": { + "default": {}, + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/schema" + } + } + ] + }, + "propertyNames": { + "$ref": "#/definitions/schema" + }, + "properties": { + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + } + }, + "patternProperties": { + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schema" + } + }, + "additionalProperties": { + "default": {}, + "anyOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "type": "boolean" + } + ] + }, + "discriminator": { + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details.", + "type": "string" + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + } + ] + }, + "json-schema-draft-07-schema": { + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true, + "default": [] + } + }, + "type": [ + "object", + "boolean" + ], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minLength": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "items": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + "default": true + }, + "maxItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minItems": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "maxProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + "required": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "definitions": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "propertyNames": { + "format": "regex" + }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + "propertyNames": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { + "type": "string" + }, + "contentMediaType": { + "type": "string" + }, + "contentEncoding": { + "type": "string" + }, + "if": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "then": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "else": { + "$ref": "#/definitions/json-schema-draft-07-schema" + }, + "allOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "anyOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "oneOf": { + "$ref": "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + "not": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + }, + "default": true + }, + "externalDocs": { + "description": "Allows referencing an external resource for extended documentation.", + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation.", + "type": "string" + }, + "url": { + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] + }, + "channelMessages": { + "description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + } + }, + "messageObject": { + "description": "Describes a message received on a given channel and operation.", + "type": "object", + "properties": { + "title": { + "description": "A human-friendly title for the message.", + "type": "string" + }, + "description": { + "description": "A longer description of the message. CommonMark is allowed.", + "type": "string" + }, + "examples": { + "description": "List of examples.", + "type": "array", + "items": { + "$ref": "#/definitions/messageExampleObject" + } + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + }, + "contentType": { + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + "type": "string" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "name": { + "description": "Name of the message.", + "type": "string" + }, + "payload": { + "$ref": "#/definitions/anySchema" + }, + "summary": { + "description": "A brief summary of the message.", + "type": "string" + }, + "tags": { + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + }, + "traits": { + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + }, + { + "type": "array", + "items": [ + { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + }, + { + "type": "object", + "additionalItems": true + } + ] + } + ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] + }, + "messageExampleObject": { + "type": "object", + "anyOf": [ + { + "required": [ + "payload" + ] + }, + { + "required": [ + "headers" + ] + } + ], + "properties": { + "headers": { + "description": "Example of the application headers. It can be of any type.", + "type": "object" + }, + "name": { + "description": "Machine readable name of the message example.", + "type": "string" + }, + "payload": { + "description": "Example of the message payload. It can be of any type." + }, + "summary": { + "description": "A brief summary of the message example.", + "type": "string" + } + }, + "additionalProperties": false + }, + "messageBindingsObject": { + "description": "Map describing protocol-specific definitions for a message.", + "type": "object", + "properties": { + "amqp": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + } + }, + "amqp1": {}, + "anypointmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-anypointmq-0.0.1-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + } + }, + "googlepubsub": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-googlepubsub-0.2.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "http": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + } + }, + "ibmmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "jms": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + } + }, + "kafka": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + "mqtt": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-message" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "nats": {}, + "redis": {}, + "sns": {}, + "solace": {}, + "sqs": {}, + "stomp": {}, + "ws": {} + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "bindings-amqp-0.3.0-message": { + "title": "AMQP message bindings object", + "description": "This object contains information about the message representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "contentEncoding": { + "type": "string", + "description": "A MIME encoding for the message content." + }, + "messageType": { + "type": "string", + "description": "Application-specific message type." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-message": { + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-googlepubsub-0.2.0-message": { + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "bindings-http-0.3.0-message": { + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "statusCode": { + "type": "number", + "description": "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-http-0.2.0-message": { + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } + } + ], + "examples": [ + { + "type": "string", + "bindingVersion": "0.1.0" + }, + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-message": { + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "headers": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.5.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "anyOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ], + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.4.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.4.0" + } + ] + }, + "avroSchema_v1": { + "definitions": { + "avroSchema": { + "title": "Avro Schema", + "description": "Root Schema", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + "types": { + "title": "Avro Types", + "description": "Allowed Avro types", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + "primitiveType": { + "title": "Primitive Type", + "description": "Basic type primitives.", + "type": "string", + "enum": [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + "primitiveTypeWithMetadata": { + "title": "Primitive Type With Metadata", + "description": "A primitive type with metadata attached.", + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + "required": [ + "type" + ] + }, + "customTypeReference": { + "title": "Custom Type", + "description": "Reference to a ComplexType", + "not": { + "$ref": "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + "avroUnion": { + "title": "Union", + "description": "A Union of types", + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + "minItems": 1 + }, + "avroField": { + "title": "Field", + "description": "A field within a Record", + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "type": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + }, + "doc": { + "type": "string" + }, + "default": true, + "order": { + "enum": [ + "ascending", + "descending", + "ignore" + ] + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "name", + "type" + ] + }, + "avroRecord": { + "title": "Record", + "description": "A Record", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "record" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + "required": [ + "type", + "name", + "fields" + ] + }, + "avroEnum": { + "title": "Enum", + "description": "An enumeration", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "enum" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "symbols": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + "required": [ + "type", + "name", + "symbols" + ] + }, + "avroArray": { + "title": "Array", + "description": "An array", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "array" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "items" + ] + }, + "avroMap": { + "title": "Map", + "description": "A map of values", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "map" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "values": { + "$ref": "#/definitions/avroSchema_v1/definitions/types" + } + }, + "required": [ + "type", + "values" + ] + }, + "avroFixed": { + "title": "Fixed", + "description": "A fixed sized array of bytes", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "fixed" + }, + "name": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + }, + "namespace": { + "$ref": "#/definitions/avroSchema_v1/definitions/namespace" + }, + "doc": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "$ref": "#/definitions/avroSchema_v1/definitions/name" + } + }, + "size": { + "type": "number" + } + }, + "required": [ + "type", + "name", + "size" + ] + }, + "name": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" + }, + "namespace": { + "type": "string", + "pattern": "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + "description": "Json-Schema definition for Avro AVSC files.", + "oneOf": [ + { + "$ref": "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + "title": "Avro Schema Definition" + }, + "bindings-kafka-0.3.0-message": { + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "key": { + "$ref": "#/definitions/schema", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-message": { + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "payloadFormatIndicator": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "description": "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + "default": 0 + }, + "correlationData": { + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + "contentType": { + "type": "string", + "description": "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + "responseTopic": { + "oneOf": [ + { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" + } + ] + }, + "correlationId": { + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", + "type": "object", + "required": [ + "location" + ], + "properties": { + "description": { + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed.", + "type": "string" + }, + "location": { + "description": "A runtime expression that specifies the location of the correlation ID", + "type": "string", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] + }, + "anySchema": { + "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", + "if": { + "required": [ + "schema" + ] + }, + "then": { + "$ref": "#/definitions/multiFormatSchema" + }, + "else": { + "$ref": "#/definitions/schema" + } + }, + "multiFormatSchema": { + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + "type": "object", + "if": { + "not": { + "type": "object" + } + }, + "then": { + "$ref": "#/definitions/schema" + }, + "else": { + "allOf": [ + { + "if": { + "not": { + "description": "If no schemaFormat has been defined, default to schema or reference", + "required": [ + "schemaFormat" + ] + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "description": "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "$ref": "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + "if": { + "required": [ + "schemaFormat" + ], + "properties": { + "schemaFormat": { + "enum": [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + "then": { + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/avroSchema_v1" + } + ] + } + } + } + } + ], + "properties": { + "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + "anyOf": [ + { + "type": "string" + }, + { + "description": "All the schema formats tooling MUST support", + "enum": [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + }, + { + "description": "All the schema formats tools are RECOMMENDED to support", + "enum": [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "openapiSchema_3_0": { + "type": "object", + "definitions": { + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": {} + }, + "additionalProperties": false + } + }, + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/openapiSchema_3_0" + }, + { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": true, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": true, + "externalDocs": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + "patternProperties": { + "^x-": true + }, + "additionalProperties": false + }, + "tag": { + "description": "Allows adding metadata to a single tag.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation.", + "type": "string" + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "name": { + "description": "The name of the tag.", + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] + }, + "messageTrait": { + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + "type": "object", + "properties": { + "title": { + "description": "A human-friendly title for the message.", + "type": "string" + }, + "description": { + "description": "A longer description of the message. CommonMark is allowed.", + "type": "string" + }, + "examples": { + "description": "List of examples.", + "type": "array", + "items": { + "$ref": "#/definitions/messageExampleObject" + } + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + }, + "contentType": { + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + "type": "string" + }, + "correlationId": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "headers": { + "$ref": "#/definitions/anySchema" + }, + "name": { + "description": "Name of the message.", + "type": "string" + }, + "summary": { + "description": "A brief summary of the message.", + "type": "string" + }, + "tags": { + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "contentType": "application/json" + } + ] + }, + "parameters": { + "description": "JSON objects describing re-usable channel parameters.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] + }, + "parameter": { + "description": "Describes a parameter included in a channel address.", + "properties": { + "description": { + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the parameter value.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" + }, + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "items": { + "type": "string" + } + }, + "location": { + "description": "A runtime expression that specifies the location of the parameter value", + "type": "string", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] + }, + "components": { + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + "type": "object", + "properties": { + "channelBindings": { + "description": "An object to hold reusable Channel Bindings Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] + } + } + }, + "channels": { + "description": "An object to hold reusable Channel Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channel" + } + ] + } + } + }, + "correlationIds": { + "description": "An object to hold reusable Correlation ID Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/correlationId" + } + ] + } + } + }, + "externalDocs": { + "description": "An object to hold reusable External Documentation Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + } + } + }, + "messageBindings": { + "description": "An object to hold reusable Message Bindings Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] + } + } + }, + "messageTraits": { + "description": "An object to hold reusable Message Trait Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageTrait" + } + ] + } + } + }, + "messages": { + "description": "An object to hold reusable Message Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageObject" + } + ] + } + } + }, + "operationBindings": { + "description": "An object to hold reusable Operation Bindings Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + } + }, + "operationTraits": { + "description": "An object to hold reusable Operation Trait Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + } + }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + } + } + }, + "parameters": { + "description": "An object to hold reusable Parameter Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/parameter" + } + ] + } + } + }, + "replies": { + "description": "An object to hold reusable Operation Reply Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + } + } + }, + "replyAddresses": { + "description": "An object to hold reusable Operation Reply Address Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + } + } + }, + "schemas": { + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "$ref": "#/definitions/anySchema" + } + } + }, + "securitySchemes": { + "description": "An object to hold reusable Security Scheme Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "serverBindings": { + "description": "An object to hold reusable Server Bindings Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + } + } + }, + "serverVariables": { + "description": "An object to hold reusable Server Variable Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + } + }, + "servers": { + "description": "An object to hold reusable Server Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + } + } + }, + "tags": { + "description": "An object to hold reusable Tag Objects.", + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] + }, + "operationBindingsObject": { + "description": "Map describing protocol-specific definitions for an operation.", + "type": "object", + "properties": { + "amqp": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-amqp-0.3.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.3.0" + ] + } + } + }, + "amqp1": {}, + "anypointmq": {}, + "googlepubsub": {}, + "http": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-http-0.3.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0", + "0.3.0" + ] + } + } + }, + "ibmmq": {}, + "jms": {}, + "kafka": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + "mqtt": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "nats": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-nats-0.1.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "redis": {}, + "ros2": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ros2-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ros2-0.1.0-operation" + } + } + ] + }, + "sns": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "solace": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + "sqs": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "stomp": {}, + "ws": {} + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "bindings-amqp-0.3.0-operation": { + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Like cc but consumers will not receive this information." + }, + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-http-0.3.0-operation": { + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-http-0.2.0-operation": { + "title": "HTTP operation bindings object", + "description": "This object contains information about the operation representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + "query": { + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "#/definitions/schema", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-operation": { + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." + }, + "messageExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Lifetime of the message in seconds" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "messageExpiryInterval": 60, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-ros2-0.1.0-operation": { + "description": "This object contains information about the operation representation in ROS 2.", + "examples": [ + { + "node": "/turtlesim", + "qosPolicies": { + "deadline": "-1", + "durability": "volatile", + "history": "unknown", + "leaseDuration": "-1", + "lifespan": "-1", + "liveliness": "automatic", + "reliability": "reliable" + }, + "role": "subscriber" + } + ], + "type": "object", + "required": [ + "role", + "node" + ], + "properties": { + "bindingVersion": { + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "type": "string", + "enum": [ + "0.1.0" + ] + }, + "node": { + "description": "The name of the ROS 2 node that implements this operation.", + "type": "string" + }, + "qosPolicies": { + "type": "object", + "properties": { + "deadline": { + "description": "The expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite.", + "type": "integer" + }, + "durability": { + "description": "Persistence specification that determines message availability for late-joining subscribers", + "type": "string", + "enum": [ + "transient_local", + "volatile" + ] + }, + "history": { + "description": "Policy parameter that defines the maximum number of samples maintained in the middleware queue", + "type": "string", + "enum": [ + "keep_last", + "keep_all", + "unknown" + ] + }, + "leaseDuration": { + "description": "The maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite.", + "type": "integer" + }, + "lifespan": { + "description": "The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite.", + "type": "integer" + }, + "liveliness": { + "description": "Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network.", + "type": "string", + "enum": [ + "automatic", + "manual" + ] + }, + "reliability": { + "description": "Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required.", + "type": "string", + "enum": [ + "best_effort", + "realiable" + ] + } + } + }, + "role": { + "description": "Specifies the ROS 2 type of the node for this operation.", + "type": "string", + "enum": [ + "publisher", + "action_client", + "service_client", + "subscriber", + "action_server", + "service_server" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "bindings-sns-0.1.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/consumer" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy" + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ] + }, + "bindings-solace-0.4.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "timeToLive": { + "type": "integer", + "description": "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + "priority": { + "type": "integer", + "minimum": 0, + "maximum": 255, + "description": "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + "dmqEligible": { + "type": "boolean", + "description": "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + "examples": [ + { + "bindingVersion": "0.4.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.3.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.2.0-operation": { + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-sqs-0.2.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/queue" + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 900, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ] + }, + "operationTrait": { + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + "type": "object", + "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "$ref": "#/definitions/operation/properties/title" + }, + "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + "$ref": "#/definitions/operation/properties/description" + }, + "bindings": { + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + }, + "externalDocs": { + "description": "Additional external documentation for this operation.", + "$ref": "#/definitions/operation/properties/externalDocs" + }, + "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + "$ref": "#/definitions/operation/properties/security" + }, + "summary": { + "description": "A short summary of what the operation is about.", + "$ref": "#/definitions/operation/properties/summary" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "$ref": "#/definitions/operation/properties/tags" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } + } + ] + }, + "operation": { + "description": "Describes a specific operation.", + "type": "object", + "required": [ + "action", + "channel" + ], + "properties": { + "title": { + "description": "A human-friendly title for the operation.", + "type": "string" + }, + "description": { + "description": "A longer description of the operation. CommonMark is allowed.", + "type": "string" + }, + "action": { + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "type": "string", + "enum": [ + "send", + "receive" + ] + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "messages": { + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + } + }, + "reply": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReply" + } + ] + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "summary": { + "description": "A brief summary of the operation.", + "type": "string" + }, + "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + }, + "traits": { + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationTrait" + } + ] + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "securityRequirements": { + "description": "An array representing security requirements.", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + }, + "SecurityScheme": { + "description": "Defines a security scheme that can be used by the operations.", + "oneOf": [ + { + "$ref": "#/definitions/userPassword" + }, + { + "$ref": "#/definitions/apiKey" + }, + { + "$ref": "#/definitions/X509" + }, + { + "$ref": "#/definitions/symmetricEncryption" + }, + { + "$ref": "#/definitions/asymmetricEncryption" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/oauth2Flows" + }, + { + "$ref": "#/definitions/openIdConnect" + }, + { + "$ref": "#/definitions/SaslSecurityScheme" + } + ], + "examples": [ + { + "type": "userPassword" + } + ] + }, + "userPassword": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userPassword" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] + }, + "apiKey": { + "type": "object", + "required": [ + "type", + "in" + ], + "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme", + "type": "string", + "enum": [ + "apiKey" + ] + }, + "in": { + "description": " The location of the API key.", + "type": "string", + "enum": [ + "user", + "password" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] + }, + "X509": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "X509" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] + }, + "symmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "symmetricEncryption" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] + }, + "asymmetricEncryption": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "asymmetricEncryption" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/BearerHTTPSecurityScheme" + }, + { + "$ref": "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + "NonBearerHTTPSecurityScheme": { + "type": "object", + "not": { + "type": "object", + "properties": { + "scheme": { + "description": "A short description for security scheme.", + "type": "string", + "enum": [ + "bearer" + ] + } + } + }, + "required": [ + "scheme", + "type" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "http" + ] + }, + "scheme": { + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "BearerHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "scheme" + ], + "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "http" + ] + }, + "bearerFormat": { + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.", + "type": "string" + }, + "scheme": { + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + "type": "string", + "enum": [ + "bearer" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "APIKeyHTTPSecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "httpApiKey" + ] + }, + "in": { + "description": "The location of the API key", + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "name": { + "description": "The name of the header, query or cookie parameter to be used.", + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] + }, + "oauth2Flows": { + "description": "Allows configuration of the supported OAuth Flows.", + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "oauth2" + ] + }, + "flows": { + "type": "object", + "properties": { + "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + }, + "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + }, + "implicit": { + "description": "Configuration for the OAuth Implicit flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "authorizationUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "tokenUrl" + ] + } + } + ] + }, + "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", + "allOf": [ + { + "$ref": "#/definitions/oauth2Flow" + }, + { + "required": [ + "tokenUrl", + "availableScopes" + ] + }, + { + "not": { + "required": [ + "authorizationUrl" + ] + } + } + ] + } + }, + "additionalProperties": false + }, + "scopes": { + "description": "List of the needed scope names.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "oauth2Flow": { + "description": "Configuration details for a supported OAuth Flow", + "type": "object", + "properties": { + "authorizationUrl": { + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" + }, + "availableScopes": { + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + "$ref": "#/definitions/oauth2Scopes" + }, + "refreshUrl": { + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "oauth2Scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "openIdConnect": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "description": { + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "openIdConnectUrl": { + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.", + "type": "string", + "format": "uri" + }, + "scopes": { + "description": "List of the needed scope names. An empty array means no scopes are needed.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "SaslSecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/SaslPlainSecurityScheme" + }, + { + "$ref": "#/definitions/SaslScramSecurityScheme" + }, + { + "$ref": "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + "SaslPlainSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme. Valid values", + "type": "string", + "enum": [ + "plain" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslScramSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "scramSha256", + "scramSha512" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "SaslGssapiSecurityScheme": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "description": { + "description": "A short description for security scheme.", + "type": "string" + }, + "type": { + "description": "The type of the security scheme.", + "type": "string", + "enum": [ + "gssapi" + ] + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] + }, + "operationReply": { + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + "type": "object", + "properties": { + "address": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationReplyAddress" + } + ] + }, + "channel": { + "$ref": "#/definitions/Reference" + }, + "messages": { + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + "type": "array", + "items": { + "$ref": "#/definitions/Reference" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "operationReplyAddress": { + "description": "An object that specifies where an operation has to send the reply", + "type": "object", + "required": [ + "location" + ], + "properties": { + "description": { + "description": "An optional description of the address. CommonMark is allowed.", + "type": "string" + }, + "location": { + "description": "A runtime expression that specifies the location of the reply address.", + "type": "string", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] + }, + "serverBindingsObject": { + "description": "Map describing protocol-specific definitions for a server.", + "type": "object", + "properties": { + "amqp": {}, + "amqp1": {}, + "anypointmq": {}, + "googlepubsub": {}, + "http": {}, + "ibmmq": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ibmmq-0.1.0-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "jms": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + } + }, + "kafka": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.5.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-kafka-0.3.0-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + "mqtt": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-mqtt-0.2.0-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + } + }, + "nats": {}, + "pulsar": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-pulsar-0.1.0-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + } + }, + "redis": {}, + "ros2": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-ros2-0.1.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-ros2-0.1.0-server" + } + } + ] + }, + "sns": {}, + "solace": { + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.4.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.3.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-solace-0.2.0-server" + } + } + ], + "properties": { + "bindingVersion": { + "enum": [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + "sqs": {}, + "stomp": {}, + "ws": {} + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + "bindings-ibmmq-0.1.0-server": { + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-server": { + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "required": [ + "jmsConnectionFactory" + ], + "properties": { + "jmsConnectionFactory": { + "type": "string", + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + "properties": { + "type": "array", + "items": { + "$ref": "#/definitions/bindings-jms-0.0.1-server/definitions/property" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + "clientID": { + "type": "string", + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.5.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-server": { + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-server": { + "title": "Server Schema", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "sessionExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + "maximumPacketSize": { + "oneOf": [ + { + "type": "integer", + "minimum": 1, + "maximum": 4294967295 + }, + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, + "bindingVersion": "0.2.0" + } + ] + }, + "bindings-pulsar-0.1.0-server": { + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-ros2-0.1.0-server": { + "description": "This object contains information about the server representation in ROS 2.", + "examples": [ + { + "domainId": "0", + "rmwImplementation": "rmw_fastrtps_cpp" + } + ], + "type": "object", + "properties": { + "bindingVersion": { + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "type": "string", + "enum": [ + "0.1.0" + ] + }, + "domainId": { + "description": "All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID.", + "type": "integer", + "maximum": 231, + "minimum": 0 + }, + "rmwImplementation": { + "description": "Specifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication.", + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + } + }, + "bindings-solace-0.4.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "clientName": { + "type": "string", + "minLength": 1, + "maxLength": 160, + "description": "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.4.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.4.0" + } + ] + }, + "bindings-solace-0.3.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] + }, + "bindings-solace-0.2.0-server": { + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, + "serverVariable": { + "description": "An object representing a Server Variable for server URL template substitution.", + "type": "object", + "properties": { + "description": { + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "examples": { + "description": "An array of examples of the server variable.", + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", + "type": "string" + }, + "enum": { + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] + }, + "server": { + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "title": { + "description": "A human-friendly title for the server.", + "type": "string" + }, + "description": { + "description": "A longer description of the server. CommonMark is allowed.", + "type": "string" + }, + "bindings": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "host": { + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + "type": "string" + }, + "pathname": { + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + "type": "string" + }, + "protocol": { + "description": "The protocol this server supports for connection.", + "type": "string" + }, + "protocolVersion": { + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation.", + "type": "string" + }, + "security": { + "$ref": "#/definitions/securityRequirements" + }, + "summary": { + "description": "A brief summary of the server.", + "type": "string" + }, + "tags": { + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + }, + "variables": { + "$ref": "#/definitions/serverVariables" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "serverVariables": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverVariable" + } + ] + } + }, + "info": { + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", + "allOf": [ + { + "type": "object", + "required": [ + "version", + "title" + ], + "properties": { + "title": { + "description": "A unique and precise title of the API.", + "type": "string" + }, + "description": { + "description": "A longer description of the API. Should be different from the title. CommonMark is allowed.", + "type": "string" + }, + "contact": { + "$ref": "#/definitions/contact" + }, + "externalDocs": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/externalDocs" + } + ] + }, + "license": { + "$ref": "#/definitions/license" + }, + "tags": { + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + "type": "array", + "uniqueItems": true, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/tag" + } + ] + } + }, + "termsOfService": { + "description": "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + "type": "string", + "format": "uri" + }, + "version": { + "description": "A semantic version number of the API.", + "type": "string" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false + }, + { + "$ref": "#/definitions/infoExtensions" + } + ], + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] + }, + "contact": { + "description": "Contact information for the exposed API.", + "type": "object", + "properties": { + "email": { + "description": "The email address of the contact person/organization.", + "type": "string", + "format": "email" + }, + "name": { + "description": "The identifying name of the contact person/organization.", + "type": "string" + }, + "url": { + "description": "The URL pointing to the contact information.", + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] + }, + "license": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "The name of the license type. It's encouraged to use an OSI compatible license.", + "type": "string" + }, + "url": { + "description": "The URL pointing to the license.", + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": false, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "infoExtensions": { + "description": "The object that lists all the extensions of Info", + "type": "object", + "properties": { + "x-linkedin": { + "$ref": "#/definitions/extensions-linkedin-0.1.0-schema" + }, + "x-x": { + "$ref": "#/definitions/extensions-x-0.1.0-schema" + } + } + }, + "extensions-linkedin-0.1.0-schema": { + "type": "string", + "pattern": "^http(s)?://(www\\.)?linkedin\\.com.*$", + "description": "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + "example": [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + "extensions-x-0.1.0-schema": { + "type": "string", + "description": "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + "example": [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + "operations": { + "description": "Holds a dictionary with all the operations this application MUST implement.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "servers": { + "description": "An object representing multiple servers.", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/server" + } + ] + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] + } + }, + "description": "!!Auto generated!! \n Do not manually edit. " +} \ No newline at end of file diff --git a/website/src/schemas/index.ts b/website/src/schemas/index.ts new file mode 100644 index 00000000..691ee695 --- /dev/null +++ b/website/src/schemas/index.ts @@ -0,0 +1,127 @@ +/** + * JSON Schemas for API specification validation. + * Schemas are bundled locally for offline support and faster loading. + */ + +// AsyncAPI schemas +import asyncapi200 from './asyncapi-2.0.0.json'; +import asyncapi210 from './asyncapi-2.1.0.json'; +import asyncapi220 from './asyncapi-2.2.0.json'; +import asyncapi230 from './asyncapi-2.3.0.json'; +import asyncapi240 from './asyncapi-2.4.0.json'; +import asyncapi250 from './asyncapi-2.5.0.json'; +import asyncapi260 from './asyncapi-2.6.0.json'; +import asyncapi300 from './asyncapi-3.0.0.json'; +import asyncapi310 from './asyncapi-3.1.0.json'; + +// OpenAPI schemas +import openapi30 from './openapi-3.0.json'; +import openapi31 from './openapi-3.1.json'; + +// JSON Schema +import jsonschemaDraft07 from './jsonschema-draft-07.json'; + +export const schemas = { + asyncapi: { + '2.0.0': asyncapi200, + '2.1.0': asyncapi210, + '2.2.0': asyncapi220, + '2.3.0': asyncapi230, + '2.4.0': asyncapi240, + '2.5.0': asyncapi250, + '2.6.0': asyncapi260, + '3.0.0': asyncapi300, + '3.1.0': asyncapi310, + }, + openapi: { + '3.0': openapi30, + '3.1': openapi31, + }, + jsonschema: { + 'draft-07': jsonschemaDraft07, + }, +} as const; + +/** + * Detect the schema version from spec content. + * Returns the appropriate schema for the detected version. + * Supports both JSON and YAML content. + */ +export function detectSchema( + content: string, + inputType: 'asyncapi' | 'openapi' | 'jsonschema' +): object | null { + if (!content.trim()) return null; + + try { + if (inputType === 'asyncapi') { + // Look for asyncapi version field (YAML or JSON) + // YAML: asyncapi: '3.0.0' or asyncapi: "3.0.0" + // JSON: "asyncapi": "3.0.0" + const versionMatch = content.match(/["']?asyncapi["']?\s*[:=]\s*["']?(\d+\.\d+\.\d+)["']?/); + if (versionMatch) { + const version = versionMatch[1]; + if (version.startsWith('3.1')) { + return asyncapi310; + } else if (version.startsWith('3.0')) { + return asyncapi300; + } else if (version.startsWith('2.6')) { + return asyncapi260; + } else if (version.startsWith('2.5')) { + return asyncapi250; + } else if (version.startsWith('2.4')) { + return asyncapi240; + } else if (version.startsWith('2.3')) { + return asyncapi230; + } else if (version.startsWith('2.2')) { + return asyncapi220; + } else if (version.startsWith('2.1')) { + return asyncapi210; + } else { + return asyncapi200; + } + } + // Default to 3.0.0 for AsyncAPI + return asyncapi300; + } + + if (inputType === 'openapi') { + // Look for openapi version field (YAML or JSON) + const openapiMatch = content.match(/["']?openapi["']?\s*[:=]\s*["']?(\d+\.\d+)(?:\.\d+)?["']?/); + if (openapiMatch) { + const version = openapiMatch[1]; + if (version === '3.1') { + return openapi31; + } + return openapi30; + } + // Look for swagger version (2.0) + const swaggerMatch = content.match(/["']?swagger["']?\s*[:=]\s*["']?2\.0["']?/); + if (swaggerMatch) { + // No Swagger 2.0 schema bundled, use OpenAPI 3.0 as fallback + return openapi30; + } + // Default to 3.0 for OpenAPI + return openapi30; + } + + if (inputType === 'jsonschema') { + // Check for $schema field (JSON format) + const schemaMatch = content.match(/["']\$schema["']\s*:\s*["']([^"']+)["']/); + if (schemaMatch) { + const schemaUri = schemaMatch[1]; + if (schemaUri.includes('draft-07') || schemaUri.includes('draft/7')) { + return jsonschemaDraft07; + } + } + // Default to draft-07 for JSON Schema + return jsonschemaDraft07; + } + + return null; + } catch { + return null; + } +} + +export type SchemaType = 'asyncapi' | 'openapi' | 'jsonschema'; diff --git a/website/src/schemas/jsonschema-draft-07.json b/website/src/schemas/jsonschema-draft-07.json new file mode 100644 index 00000000..fb92c7f7 --- /dev/null +++ b/website/src/schemas/jsonschema-draft-07.json @@ -0,0 +1,172 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://json-schema.org/draft-07/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": true, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "examples": { + "type": "array", + "items": true + }, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": true + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "propertyNames": { "format": "regex" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": true, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "contentMediaType": { "type": "string" }, + "contentEncoding": { "type": "string" }, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": true +} diff --git a/website/src/schemas/openapi-3.0.json b/website/src/schemas/openapi-3.0.json new file mode 100644 index 00000000..4360553f --- /dev/null +++ b/website/src/schemas/openapi-3.0.json @@ -0,0 +1,1662 @@ +{ + "id": "https://spec.openapis.org/oas/3.0/schema/2021-09-28", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3", + "type": "object", + "required": [ + "openapi", + "info", + "paths" + ], + "properties": { + "openapi": { + "type": "string", + "pattern": "^3\\.0\\.\\d(-.+)?$" + }, + "info": { + "$ref": "#/definitions/Info" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + }, + "uniqueItems": true + }, + "paths": { + "$ref": "#/definitions/Paths" + }, + "components": { + "$ref": "#/definitions/Components" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "definitions": { + "Reference": { + "type": "object", + "required": [ + "$ref" + ], + "patternProperties": { + "^\\$ref$": { + "type": "string", + "format": "uri-reference" + } + } + }, + "Info": { + "type": "object", + "required": [ + "title", + "version" + ], + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "termsOfService": { + "type": "string", + "format": "uri-reference" + }, + "contact": { + "$ref": "#/definitions/Contact" + }, + "license": { + "$ref": "#/definitions/License" + }, + "version": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Contact": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + }, + "email": { + "type": "string", + "format": "email" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "License": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Server": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ServerVariable" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ServerVariable": { + "type": "object", + "required": [ + "default" + ], + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Components": { + "type": "object", + "properties": { + "schemas": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "responses": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Response" + } + ] + } + } + }, + "parameters": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Parameter" + } + ] + } + } + }, + "examples": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Example" + } + ] + } + } + }, + "requestBodies": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/RequestBody" + } + ] + } + } + }, + "headers": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Header" + } + ] + } + } + }, + "securitySchemes": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/SecurityScheme" + } + ] + } + } + }, + "links": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Link" + } + ] + } + } + }, + "callbacks": { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/Callback" + } + ] + } + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { + "type": "integer", + "minimum": 0 + }, + "minLength": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "pattern": { + "type": "string", + "format": "regex" + }, + "maxItems": { + "type": "integer", + "minimum": 0 + }, + "minItems": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { + "type": "integer", + "minimum": 0 + }, + "minProperties": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "required": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "enum": { + "type": "array", + "items": { + }, + "minItems": 1, + "uniqueItems": false + }, + "type": { + "type": "string", + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + "not": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "allOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "oneOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "anyOf": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + }, + { + "type": "boolean" + } + ], + "default": true + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + }, + "default": { + }, + "nullable": { + "type": "boolean", + "default": false + }, + "discriminator": { + "$ref": "#/definitions/Discriminator" + }, + "readOnly": { + "type": "boolean", + "default": false + }, + "writeOnly": { + "type": "boolean", + "default": false + }, + "example": { + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "xml": { + "$ref": "#/definitions/XML" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Discriminator": { + "type": "object", + "required": [ + "propertyName" + ], + "properties": { + "propertyName": { + "type": "string" + }, + "mapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "XML": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "namespace": { + "type": "string", + "format": "uri" + }, + "prefix": { + "type": "string" + }, + "attribute": { + "type": "boolean", + "default": false + }, + "wrapped": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Response": { + "type": "object", + "required": [ + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + } + }, + "links": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Link" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "MediaType": { + "type": "object", + "properties": { + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "encoding": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Encoding" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + } + ] + }, + "Example": { + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "value": { + }, + "externalValue": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Header": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "allowEmptyValue": { + "type": "boolean", + "default": false + }, + "style": { + "type": "string", + "enum": [ + "simple" + ], + "default": "simple" + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + }, + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + }, + { + "$ref": "#/definitions/SchemaXORContent" + } + ] + }, + "Paths": { + "type": "object", + "patternProperties": { + "^\\/": { + "$ref": "#/definitions/PathItem" + }, + "^x-": { + } + }, + "additionalProperties": false + }, + "PathItem": { + "type": "object", + "properties": { + "$ref": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + }, + "parameters": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Parameter" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "uniqueItems": true + } + }, + "patternProperties": { + "^(get|put|post|delete|options|head|patch|trace)$": { + "$ref": "#/definitions/Operation" + }, + "^x-": { + } + }, + "additionalProperties": false + }, + "Operation": { + "type": "object", + "required": [ + "responses" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + }, + "operationId": { + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/Parameter" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "uniqueItems": true + }, + "requestBody": { + "oneOf": [ + { + "$ref": "#/definitions/RequestBody" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "responses": { + "$ref": "#/definitions/Responses" + }, + "callbacks": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Callback" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "security": { + "type": "array", + "items": { + "$ref": "#/definitions/SecurityRequirement" + } + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Responses": { + "type": "object", + "properties": { + "default": { + "oneOf": [ + { + "$ref": "#/definitions/Response" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "patternProperties": { + "^[1-5](?:\\d{2}|XX)$": { + "oneOf": [ + { + "$ref": "#/definitions/Response" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "^x-": { + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "SecurityRequirement": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/definitions/ExternalDocumentation" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ExternalDocumentation": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri-reference" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ExampleXORExamples": { + "description": "Example and examples are mutually exclusive", + "not": { + "required": [ + "example", + "examples" + ] + } + }, + "SchemaXORContent": { + "description": "Schema and content are mutually exclusive, at least one is required", + "not": { + "required": [ + "schema", + "content" + ] + }, + "oneOf": [ + { + "required": [ + "schema" + ] + }, + { + "required": [ + "content" + ], + "description": "Some properties are not allowed if content is present", + "allOf": [ + { + "not": { + "required": [ + "style" + ] + } + }, + { + "not": { + "required": [ + "explode" + ] + } + }, + { + "not": { + "required": [ + "allowReserved" + ] + } + }, + { + "not": { + "required": [ + "example" + ] + } + }, + { + "not": { + "required": [ + "examples" + ] + } + } + ] + } + ] + }, + "Parameter": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "in": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "boolean", + "default": false + }, + "deprecated": { + "type": "boolean", + "default": false + }, + "allowEmptyValue": { + "type": "boolean", + "default": false + }, + "style": { + "type": "string" + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + }, + "schema": { + "oneOf": [ + { + "$ref": "#/definitions/Schema" + }, + { + "$ref": "#/definitions/Reference" + } + ] + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + }, + "minProperties": 1, + "maxProperties": 1 + }, + "example": { + }, + "examples": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Example" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "required": [ + "name", + "in" + ], + "allOf": [ + { + "$ref": "#/definitions/ExampleXORExamples" + }, + { + "$ref": "#/definitions/SchemaXORContent" + }, + { + "$ref": "#/definitions/ParameterLocation" + } + ] + }, + "ParameterLocation": { + "description": "Parameter location", + "oneOf": [ + { + "description": "Parameter in path", + "required": [ + "required" + ], + "properties": { + "in": { + "enum": [ + "path" + ] + }, + "style": { + "enum": [ + "matrix", + "label", + "simple" + ], + "default": "simple" + }, + "required": { + "enum": [ + true + ] + } + } + }, + { + "description": "Parameter in query", + "properties": { + "in": { + "enum": [ + "query" + ] + }, + "style": { + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ], + "default": "form" + } + } + }, + { + "description": "Parameter in header", + "properties": { + "in": { + "enum": [ + "header" + ] + }, + "style": { + "enum": [ + "simple" + ], + "default": "simple" + } + } + }, + { + "description": "Parameter in cookie", + "properties": { + "in": { + "enum": [ + "cookie" + ] + }, + "style": { + "enum": [ + "form" + ], + "default": "form" + } + } + } + ] + }, + "RequestBody": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "description": { + "type": "string" + }, + "content": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MediaType" + } + }, + "required": { + "type": "boolean", + "default": false + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "SecurityScheme": { + "oneOf": [ + { + "$ref": "#/definitions/APIKeySecurityScheme" + }, + { + "$ref": "#/definitions/HTTPSecurityScheme" + }, + { + "$ref": "#/definitions/OAuth2SecurityScheme" + }, + { + "$ref": "#/definitions/OpenIdConnectSecurityScheme" + } + ] + }, + "APIKeySecurityScheme": { + "type": "object", + "required": [ + "type", + "name", + "in" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ] + }, + "name": { + "type": "string" + }, + "in": { + "type": "string", + "enum": [ + "header", + "query", + "cookie" + ] + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "HTTPSecurityScheme": { + "type": "object", + "required": [ + "scheme", + "type" + ], + "properties": { + "scheme": { + "type": "string" + }, + "bearerFormat": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "http" + ] + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "oneOf": [ + { + "description": "Bearer", + "properties": { + "scheme": { + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" + } + } + }, + { + "description": "Non Bearer", + "not": { + "required": [ + "bearerFormat" + ] + }, + "properties": { + "scheme": { + "not": { + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" + } + } + } + } + ] + }, + "OAuth2SecurityScheme": { + "type": "object", + "required": [ + "type", + "flows" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "oauth2" + ] + }, + "flows": { + "$ref": "#/definitions/OAuthFlows" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "OpenIdConnectSecurityScheme": { + "type": "object", + "required": [ + "type", + "openIdConnectUrl" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openIdConnect" + ] + }, + "openIdConnectUrl": { + "type": "string", + "format": "uri-reference" + }, + "description": { + "type": "string" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "OAuthFlows": { + "type": "object", + "properties": { + "implicit": { + "$ref": "#/definitions/ImplicitOAuthFlow" + }, + "password": { + "$ref": "#/definitions/PasswordOAuthFlow" + }, + "clientCredentials": { + "$ref": "#/definitions/ClientCredentialsFlow" + }, + "authorizationCode": { + "$ref": "#/definitions/AuthorizationCodeOAuthFlow" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ImplicitOAuthFlow": { + "type": "object", + "required": [ + "authorizationUrl", + "scopes" + ], + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "PasswordOAuthFlow": { + "type": "object", + "required": [ + "tokenUrl", + "scopes" + ], + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "ClientCredentialsFlow": { + "type": "object", + "required": [ + "tokenUrl", + "scopes" + ], + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "AuthorizationCodeOAuthFlow": { + "type": "object", + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ], + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri-reference" + }, + "tokenUrl": { + "type": "string", + "format": "uri-reference" + }, + "refreshUrl": { + "type": "string", + "format": "uri-reference" + }, + "scopes": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false + }, + "Link": { + "type": "object", + "properties": { + "operationId": { + "type": "string" + }, + "operationRef": { + "type": "string", + "format": "uri-reference" + }, + "parameters": { + "type": "object", + "additionalProperties": { + } + }, + "requestBody": { + }, + "description": { + "type": "string" + }, + "server": { + "$ref": "#/definitions/Server" + } + }, + "patternProperties": { + "^x-": { + } + }, + "additionalProperties": false, + "not": { + "description": "Operation Id and Operation Ref are mutually exclusive", + "required": [ + "operationId", + "operationRef" + ] + } + }, + "Callback": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/PathItem" + }, + "patternProperties": { + "^x-": { + } + } + }, + "Encoding": { + "type": "object", + "properties": { + "contentType": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/definitions/Header" + }, + { + "$ref": "#/definitions/Reference" + } + ] + } + }, + "style": { + "type": "string", + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ] + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + } +} diff --git a/website/src/schemas/openapi-3.1.json b/website/src/schemas/openapi-3.1.json new file mode 100644 index 00000000..468bc7e5 --- /dev/null +++ b/website/src/schemas/openapi-3.1.json @@ -0,0 +1,1440 @@ +{ + "$id": "https://spec.openapis.org/oas/3.1/schema/2022-10-07", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0", + "type": "object", + "properties": { + "openapi": { + "type": "string", + "pattern": "^3\\.1\\.\\d+(-.+)?$" + }, + "info": { + "$ref": "#/$defs/info" + }, + "jsonSchemaDialect": { + "type": "string", + "format": "uri", + "default": "https://spec.openapis.org/oas/3.1/dialect/base" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/$defs/server" + }, + "default": [ + { + "url": "/" + } + ] + }, + "paths": { + "$ref": "#/$defs/paths" + }, + "webhooks": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/path-item-or-reference" + } + }, + "components": { + "$ref": "#/$defs/components" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/$defs/security-requirement" + } + }, + "tags": { + "type": "array", + "items": { + "$ref": "#/$defs/tag" + } + }, + "externalDocs": { + "$ref": "#/$defs/external-documentation" + } + }, + "required": [ + "openapi", + "info" + ], + "anyOf": [ + { + "required": [ + "paths" + ] + }, + { + "required": [ + "components" + ] + }, + { + "required": [ + "webhooks" + ] + } + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false, + "$defs": { + "info": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#info-object", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "termsOfService": { + "type": "string", + "format": "uri" + }, + "contact": { + "$ref": "#/$defs/contact" + }, + "license": { + "$ref": "#/$defs/license" + }, + "version": { + "type": "string" + } + }, + "required": [ + "title", + "version" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "contact": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "email": { + "type": "string", + "format": "email" + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "license": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#license-object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "name" + ], + "dependentSchemas": { + "identifier": { + "not": { + "required": [ + "url" + ] + } + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "server": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#server-object", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri-reference" + }, + "description": { + "type": "string" + }, + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/server-variable" + } + } + }, + "required": [ + "url" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "server-variable": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object", + "type": "object", + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "default": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "default" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "components": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#components-object", + "type": "object", + "properties": { + "schemas": { + "type": "object", + "additionalProperties": { + "$dynamicRef": "#meta" + } + }, + "responses": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/response-or-reference" + } + }, + "parameters": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/parameter-or-reference" + } + }, + "examples": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/example-or-reference" + } + }, + "requestBodies": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/request-body-or-reference" + } + }, + "headers": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/header-or-reference" + } + }, + "securitySchemes": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/security-scheme-or-reference" + } + }, + "links": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/link-or-reference" + } + }, + "callbacks": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/callbacks-or-reference" + } + }, + "pathItems": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/path-item-or-reference" + } + } + }, + "patternProperties": { + "^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": { + "$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected", + "propertyNames": { + "pattern": "^[a-zA-Z0-9._-]+$" + } + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "paths": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object", + "type": "object", + "patternProperties": { + "^/": { + "$ref": "#/$defs/path-item" + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "path-item": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object", + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/$defs/server" + } + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/$defs/parameter-or-reference" + } + }, + "get": { + "$ref": "#/$defs/operation" + }, + "put": { + "$ref": "#/$defs/operation" + }, + "post": { + "$ref": "#/$defs/operation" + }, + "delete": { + "$ref": "#/$defs/operation" + }, + "options": { + "$ref": "#/$defs/operation" + }, + "head": { + "$ref": "#/$defs/operation" + }, + "patch": { + "$ref": "#/$defs/operation" + }, + "trace": { + "$ref": "#/$defs/operation" + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "path-item-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/path-item" + } + }, + "operation": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object", + "type": "object", + "properties": { + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/$defs/external-documentation" + }, + "operationId": { + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/$defs/parameter-or-reference" + } + }, + "requestBody": { + "$ref": "#/$defs/request-body-or-reference" + }, + "responses": { + "$ref": "#/$defs/responses" + }, + "callbacks": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/callbacks-or-reference" + } + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "security": { + "type": "array", + "items": { + "$ref": "#/$defs/security-requirement" + } + }, + "servers": { + "type": "array", + "items": { + "$ref": "#/$defs/server" + } + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "external-documentation": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "parameter": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "in": { + "enum": [ + "query", + "header", + "path", + "cookie" + ] + }, + "description": { + "type": "string" + }, + "required": { + "default": false, + "type": "boolean" + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "schema": { + "$dynamicRef": "#meta" + }, + "content": { + "$ref": "#/$defs/content", + "minProperties": 1, + "maxProperties": 1 + } + }, + "required": [ + "name", + "in" + ], + "oneOf": [ + { + "required": [ + "schema" + ] + }, + { + "required": [ + "content" + ] + } + ], + "if": { + "properties": { + "in": { + "const": "query" + } + }, + "required": [ + "in" + ] + }, + "then": { + "properties": { + "allowEmptyValue": { + "default": false, + "type": "boolean" + } + } + }, + "dependentSchemas": { + "schema": { + "properties": { + "style": { + "type": "string" + }, + "explode": { + "type": "boolean" + } + }, + "allOf": [ + { + "$ref": "#/$defs/examples" + }, + { + "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path" + }, + { + "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header" + }, + { + "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query" + }, + { + "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie" + }, + { + "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form" + } + ], + "$defs": { + "styles-for-path": { + "if": { + "properties": { + "in": { + "const": "path" + } + }, + "required": [ + "in" + ] + }, + "then": { + "properties": { + "name": { + "pattern": "[^/#?]+$" + }, + "style": { + "default": "simple", + "enum": [ + "matrix", + "label", + "simple" + ] + }, + "required": { + "const": true + } + }, + "required": [ + "required" + ] + } + }, + "styles-for-header": { + "if": { + "properties": { + "in": { + "const": "header" + } + }, + "required": [ + "in" + ] + }, + "then": { + "properties": { + "style": { + "default": "simple", + "const": "simple" + } + } + } + }, + "styles-for-query": { + "if": { + "properties": { + "in": { + "const": "query" + } + }, + "required": [ + "in" + ] + }, + "then": { + "properties": { + "style": { + "default": "form", + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ] + }, + "allowReserved": { + "default": false, + "type": "boolean" + } + } + } + }, + "styles-for-cookie": { + "if": { + "properties": { + "in": { + "const": "cookie" + } + }, + "required": [ + "in" + ] + }, + "then": { + "properties": { + "style": { + "default": "form", + "const": "form" + } + } + } + }, + "styles-for-form": { + "if": { + "properties": { + "style": { + "const": "form" + } + }, + "required": [ + "style" + ] + }, + "then": { + "properties": { + "explode": { + "default": true + } + } + }, + "else": { + "properties": { + "explode": { + "default": false + } + } + } + } + } + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "parameter-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/parameter" + } + }, + "request-body": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "content": { + "$ref": "#/$defs/content" + }, + "required": { + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "request-body-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/request-body" + } + }, + "content": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10", + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/media-type" + }, + "propertyNames": { + "format": "media-range" + } + }, + "media-type": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object", + "type": "object", + "properties": { + "schema": { + "$dynamicRef": "#meta" + }, + "encoding": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/encoding" + } + } + }, + "allOf": [ + { + "$ref": "#/$defs/specification-extensions" + }, + { + "$ref": "#/$defs/examples" + } + ], + "unevaluatedProperties": false + }, + "encoding": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object", + "type": "object", + "properties": { + "contentType": { + "type": "string", + "format": "media-range" + }, + "headers": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/header-or-reference" + } + }, + "style": { + "default": "form", + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ] + }, + "explode": { + "type": "boolean" + }, + "allowReserved": { + "default": false, + "type": "boolean" + } + }, + "allOf": [ + { + "$ref": "#/$defs/specification-extensions" + }, + { + "$ref": "#/$defs/encoding/$defs/explode-default" + } + ], + "unevaluatedProperties": false, + "$defs": { + "explode-default": { + "if": { + "properties": { + "style": { + "const": "form" + } + }, + "required": [ + "style" + ] + }, + "then": { + "properties": { + "explode": { + "default": true + } + } + }, + "else": { + "properties": { + "explode": { + "default": false + } + } + } + } + } + }, + "responses": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object", + "type": "object", + "properties": { + "default": { + "$ref": "#/$defs/response-or-reference" + } + }, + "patternProperties": { + "^[1-5](?:[0-9]{2}|XX)$": { + "$ref": "#/$defs/response-or-reference" + } + }, + "minProperties": 1, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "response": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#response-object", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "headers": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/header-or-reference" + } + }, + "content": { + "$ref": "#/$defs/content" + }, + "links": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/link-or-reference" + } + } + }, + "required": [ + "description" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "response-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/response" + } + }, + "callbacks": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object", + "type": "object", + "$ref": "#/$defs/specification-extensions", + "additionalProperties": { + "$ref": "#/$defs/path-item-or-reference" + } + }, + "callbacks-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/callbacks" + } + }, + "example": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#example-object", + "type": "object", + "properties": { + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "value": true, + "externalValue": { + "type": "string", + "format": "uri" + } + }, + "not": { + "required": [ + "value", + "externalValue" + ] + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "example-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/example" + } + }, + "link": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#link-object", + "type": "object", + "properties": { + "operationRef": { + "type": "string", + "format": "uri-reference" + }, + "operationId": { + "type": "string" + }, + "parameters": { + "$ref": "#/$defs/map-of-strings" + }, + "requestBody": true, + "description": { + "type": "string" + }, + "body": { + "$ref": "#/$defs/server" + } + }, + "oneOf": [ + { + "required": [ + "operationRef" + ] + }, + { + "required": [ + "operationId" + ] + } + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "link-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/link" + } + }, + "header": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#header-object", + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "required": { + "default": false, + "type": "boolean" + }, + "deprecated": { + "default": false, + "type": "boolean" + }, + "schema": { + "$dynamicRef": "#meta" + }, + "content": { + "$ref": "#/$defs/content", + "minProperties": 1, + "maxProperties": 1 + } + }, + "oneOf": [ + { + "required": [ + "schema" + ] + }, + { + "required": [ + "content" + ] + } + ], + "dependentSchemas": { + "schema": { + "properties": { + "style": { + "default": "simple", + "const": "simple" + }, + "explode": { + "default": false, + "type": "boolean" + } + }, + "$ref": "#/$defs/examples" + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "header-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/header" + } + }, + "tag": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "#/$defs/external-documentation" + } + }, + "required": [ + "name" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "reference": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object", + "type": "object", + "properties": { + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "unevaluatedProperties": false + }, + "schema": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object", + "$dynamicAnchor": "meta", + "type": [ + "object", + "boolean" + ] + }, + "security-scheme": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object", + "type": "object", + "properties": { + "type": { + "enum": [ + "apiKey", + "http", + "mutualTLS", + "oauth2", + "openIdConnect" + ] + }, + "description": { + "type": "string" + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/$defs/specification-extensions" + }, + { + "$ref": "#/$defs/security-scheme/$defs/type-apikey" + }, + { + "$ref": "#/$defs/security-scheme/$defs/type-http" + }, + { + "$ref": "#/$defs/security-scheme/$defs/type-http-bearer" + }, + { + "$ref": "#/$defs/security-scheme/$defs/type-oauth2" + }, + { + "$ref": "#/$defs/security-scheme/$defs/type-oidc" + } + ], + "unevaluatedProperties": false, + "$defs": { + "type-apikey": { + "if": { + "properties": { + "type": { + "const": "apiKey" + } + }, + "required": [ + "type" + ] + }, + "then": { + "properties": { + "name": { + "type": "string" + }, + "in": { + "enum": [ + "query", + "header", + "cookie" + ] + } + }, + "required": [ + "name", + "in" + ] + } + }, + "type-http": { + "if": { + "properties": { + "type": { + "const": "http" + } + }, + "required": [ + "type" + ] + }, + "then": { + "properties": { + "scheme": { + "type": "string" + } + }, + "required": [ + "scheme" + ] + } + }, + "type-http-bearer": { + "if": { + "properties": { + "type": { + "const": "http" + }, + "scheme": { + "type": "string", + "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" + } + }, + "required": [ + "type", + "scheme" + ] + }, + "then": { + "properties": { + "bearerFormat": { + "type": "string" + } + } + } + }, + "type-oauth2": { + "if": { + "properties": { + "type": { + "const": "oauth2" + } + }, + "required": [ + "type" + ] + }, + "then": { + "properties": { + "flows": { + "$ref": "#/$defs/oauth-flows" + } + }, + "required": [ + "flows" + ] + } + }, + "type-oidc": { + "if": { + "properties": { + "type": { + "const": "openIdConnect" + } + }, + "required": [ + "type" + ] + }, + "then": { + "properties": { + "openIdConnectUrl": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "openIdConnectUrl" + ] + } + } + } + }, + "security-scheme-or-reference": { + "if": { + "type": "object", + "required": [ + "$ref" + ] + }, + "then": { + "$ref": "#/$defs/reference" + }, + "else": { + "$ref": "#/$defs/security-scheme" + } + }, + "oauth-flows": { + "type": "object", + "properties": { + "implicit": { + "$ref": "#/$defs/oauth-flows/$defs/implicit" + }, + "password": { + "$ref": "#/$defs/oauth-flows/$defs/password" + }, + "clientCredentials": { + "$ref": "#/$defs/oauth-flows/$defs/client-credentials" + }, + "authorizationCode": { + "$ref": "#/$defs/oauth-flows/$defs/authorization-code" + } + }, + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false, + "$defs": { + "implicit": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/$defs/map-of-strings" + } + }, + "required": [ + "authorizationUrl", + "scopes" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "password": { + "type": "object", + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/$defs/map-of-strings" + } + }, + "required": [ + "tokenUrl", + "scopes" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "client-credentials": { + "type": "object", + "properties": { + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/$defs/map-of-strings" + } + }, + "required": [ + "tokenUrl", + "scopes" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + }, + "authorization-code": { + "type": "object", + "properties": { + "authorizationUrl": { + "type": "string", + "format": "uri" + }, + "tokenUrl": { + "type": "string", + "format": "uri" + }, + "refreshUrl": { + "type": "string", + "format": "uri" + }, + "scopes": { + "$ref": "#/$defs/map-of-strings" + } + }, + "required": [ + "authorizationUrl", + "tokenUrl", + "scopes" + ], + "$ref": "#/$defs/specification-extensions", + "unevaluatedProperties": false + } + } + }, + "security-requirement": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "specification-extensions": { + "$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions", + "patternProperties": { + "^x-": true + } + }, + "examples": { + "properties": { + "example": true, + "examples": { + "type": "object", + "additionalProperties": { + "$ref": "#/$defs/example-or-reference" + } + } + } + }, + "map-of-strings": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } +} diff --git a/website/src/utils/configCodegen.ts b/website/src/utils/configCodegen.ts new file mode 100644 index 00000000..d1876ffc --- /dev/null +++ b/website/src/utils/configCodegen.ts @@ -0,0 +1,100 @@ +/** + * Generate TypeScript config code from form state. + * Used to sync form changes → TypeScript editor. + */ + +export interface GeneratorFormState { + preset: string; + outputPath: string; + enabled: boolean; + options?: Record; +} + +export interface ConfigFormState { + inputType: 'asyncapi' | 'openapi' | 'jsonschema'; + generators: GeneratorFormState[]; + protocols: string[]; +} + +/** + * Generate TypeScript config from form state. + */ +export function generateTsConfig(state: ConfigFormState): string { + const enabledGenerators = state.generators.filter((g) => g.enabled); + + const generatorConfigs = enabledGenerators.map((g) => { + const config: Record = { + preset: g.preset, + outputPath: g.outputPath, + }; + + // Add protocols for channels/client generators + if (g.preset === 'channels' || g.preset === 'client') { + config.protocols = state.protocols; + } + + // Add any additional options + if (g.options) { + Object.assign(config, g.options); + } + + return formatGeneratorConfig(config); + }); + + return `import type { TheCodegenConfiguration } from '@the-codegen-project/cli'; + +const config: TheCodegenConfiguration = { + inputType: '${state.inputType}', + inputPath: './spec.yaml', + language: 'typescript', + generators: [ +${generatorConfigs.map((c) => ' ' + c).join(',\n')} + ] +}; + +export default config; +`; +} + +function formatGeneratorConfig(config: Record): string { + const lines: string[] = ['{']; + + for (const [key, value] of Object.entries(config)) { + if (Array.isArray(value)) { + lines.push(` ${key}: [${value.map((v) => `'${v}'`).join(', ')}],`); + } else if (typeof value === 'string') { + lines.push(` ${key}: '${value}',`); + } else { + lines.push(` ${key}: ${JSON.stringify(value)},`); + } + } + + lines.push('}'); + return lines.join('\n '); +} + +/** + * Get default form state. + */ +export function getDefaultFormState(): ConfigFormState { + return { + inputType: 'asyncapi', + generators: [ + { preset: 'payloads', outputPath: './src/payloads', enabled: true }, + { preset: 'parameters', outputPath: './src/parameters', enabled: false }, + { preset: 'headers', outputPath: './src/headers', enabled: false }, + { preset: 'types', outputPath: './src/types', enabled: false }, + { preset: 'models', outputPath: './src/models', enabled: false }, + { preset: 'channels', outputPath: './src/channels', enabled: false }, + { preset: 'client', outputPath: './src/client', enabled: false }, + ], + protocols: ['nats'], + }; +} + +/** + * Get default TypeScript config. + */ +export function getDefaultTsConfig(): string { + return generateTsConfig(getDefaultFormState()); +} diff --git a/website/src/utils/configParser.ts b/website/src/utils/configParser.ts new file mode 100644 index 00000000..131e3c79 --- /dev/null +++ b/website/src/utils/configParser.ts @@ -0,0 +1,132 @@ +/** + * Parse TypeScript config code back to form state. + * Used to sync TypeScript editor → form changes. + */ + +import type { ConfigFormState, GeneratorFormState } from './configCodegen'; +import { getDefaultFormState } from './configCodegen'; + +export interface ParseResult { + success: boolean; + data?: T; + error?: string; +} + +/** + * Parse TypeScript config back to form state. + * Uses regex/simple parsing - not full TS execution. + */ +export function parseTsConfig(code: string): ParseResult { + try { + // Extract the default export object + const exportMatch = code.match( + /export\s+default\s+(\{[\s\S]*?\})\s*(?:satisfies|as)/ + ); + if (!exportMatch) { + // Try without satisfies/as + const simpleMatch = code.match(/export\s+default\s+(\{[\s\S]*\});?\s*$/); + if (!simpleMatch) { + return { success: false, error: 'Could not find default export' }; + } + return parseConfigObject(simpleMatch[1]); + } + + return parseConfigObject(exportMatch[1]); + } catch (err) { + return { + success: false, + error: err instanceof Error ? err.message : 'Parse error', + }; + } +} + +function parseConfigObject(objStr: string): ParseResult { + try { + // Extract inputType + const inputTypeMatch = objStr.match(/inputType:\s*['"](\w+)['"]/); + const inputType = (inputTypeMatch?.[1] || 'asyncapi') as ConfigFormState['inputType']; + + // Extract generators array + const generatorsMatch = objStr.match(/generators:\s*\[([\s\S]*?)\]\s*[,}]/); + if (!generatorsMatch) { + return { success: false, error: 'Could not find generators array' }; + } + + const generators = parseGeneratorsArray(generatorsMatch[1]); + const protocols = extractProtocols(generatorsMatch[1]); + + // Merge with default state to fill in disabled generators + const defaultState = getDefaultFormState(); + const mergedGenerators: GeneratorFormState[] = defaultState.generators.map( + (defaultGen) => { + const parsed = generators.find((g) => g.preset === defaultGen.preset); + if (parsed) { + return { ...parsed, enabled: true }; + } + return { ...defaultGen, enabled: false }; + } + ); + + return { + success: true, + data: { + inputType, + generators: mergedGenerators, + protocols, + }, + }; + } catch (err) { + return { + success: false, + error: err instanceof Error ? err.message : 'Parse error', + }; + } +} + +function parseGeneratorsArray(arrayStr: string): GeneratorFormState[] { + const generators: GeneratorFormState[] = []; + + // Match individual generator objects + const objectRegex = /\{[^{}]*\}/g; + let match: RegExpExecArray | null; + + while ((match = objectRegex.exec(arrayStr)) !== null) { + const objStr = match[0]; + + const presetMatch = objStr.match(/preset:\s*['"](\w+)['"]/); + const outputPathMatch = objStr.match(/outputPath:\s*['"]([^'"]+)['"]/); + + if (presetMatch && outputPathMatch) { + generators.push({ + preset: presetMatch[1], + outputPath: outputPathMatch[1], + enabled: true, + }); + } + } + + return generators; +} + +function extractProtocols(generatorsStr: string): string[] { + // Look for protocols array in any generator + const protocolsMatch = generatorsStr.match( + /protocols:\s*\[([^\]]+)\]/ + ); + + if (!protocolsMatch) { + return ['nats']; + } + + const protocolsStr = protocolsMatch[1]; + const protocols: string[] = []; + + const protocolRegex = /['"](\w+)['"]/g; + let match: RegExpExecArray | null; + + while ((match = protocolRegex.exec(protocolsStr)) !== null) { + protocols.push(match[1]); + } + + return protocols.length > 0 ? protocols : ['nats']; +} diff --git a/website/src/utils/configTypes.ts b/website/src/utils/configTypes.ts new file mode 100644 index 00000000..b3ca492e --- /dev/null +++ b/website/src/utils/configTypes.ts @@ -0,0 +1,194 @@ +/** + * TypeScript type definitions for Monaco IntelliSense in the config editor. + * These types are registered with Monaco to provide auto-suggestions. + */ + +/** + * Get the TypeScript definition source for Monaco addExtraLib. + * This provides IntelliSense for TheCodegenConfiguration. + */ +export function getConfigTypeDefinitions(): string { + return ` +// Type definitions for @the-codegen-project/cli +// These provide IntelliSense in the playground config editor + +declare module '@the-codegen-project/cli' { + /** Input specification type */ + export type InputType = 'asyncapi' | 'openapi' | 'jsonschema'; + + /** Target language for code generation */ + export type Language = 'typescript'; + + /** Serialization format for payloads */ + export type SerializationType = 'json' | 'yaml' | 'msgpack' | 'avro' | 'protobuf'; + + /** Supported protocols for channels generator */ + export type ChannelsProtocol = + | 'nats' + | 'kafka' + | 'mqtt' + | 'amqp' + | 'websocket' + | 'http_client' + | 'event_source'; + + /** Supported protocols for client generator (currently only NATS) */ + export type ClientProtocol = 'nats'; + + /** Payloads generator - generates message payload models with validation */ + export interface PayloadsGenerator { + /** Generator preset type */ + preset: 'payloads'; + /** Output directory for generated files */ + outputPath: string; + /** Serialization format (default: 'json') */ + serializationType?: SerializationType; + /** Message ID mapping */ + map?: { + messageId?: string; + }; + } + + /** Parameters generator - generates channel parameter models */ + export interface ParametersGenerator { + /** Generator preset type */ + preset: 'parameters'; + /** Output directory for generated files */ + outputPath: string; + } + + /** Headers generator - generates message header models */ + export interface HeadersGenerator { + /** Generator preset type */ + preset: 'headers'; + /** Output directory for generated files */ + outputPath: string; + } + + /** Types generator - generates simple type definitions */ + export interface TypesGenerator { + /** Generator preset type */ + preset: 'types'; + /** Output directory for generated files */ + outputPath: string; + } + + /** Models generator - generates data models from schemas */ + export interface ModelsGenerator { + /** Generator preset type */ + preset: 'models'; + /** Output directory for generated files */ + outputPath: string; + } + + /** Channels generator - generates protocol-specific publish/subscribe functions */ + export interface ChannelsGenerator { + /** Generator preset type */ + preset: 'channels'; + /** Output directory for generated files */ + outputPath: string; + /** Protocols to generate code for (nats, kafka, mqtt, amqp, websocket, http_client, event_source) */ + protocols: ChannelsProtocol[]; + } + + /** Client generator - generates full client with connection management */ + export interface ClientGenerator { + /** Generator preset type */ + preset: 'client'; + /** Output directory for generated files */ + outputPath: string; + /** Protocols to generate code for (currently only 'nats' is supported) */ + protocols: ClientProtocol[]; + } + + /** Custom generator - user-defined code generation */ + export interface CustomGenerator { + /** Generator preset type */ + preset: 'custom'; + /** Output directory for generated files */ + outputPath: string; + /** Custom render function */ + renderFunction: (context: any) => string; + } + + /** Union of all generator types */ + export type Generator = + | PayloadsGenerator + | ParametersGenerator + | HeadersGenerator + | TypesGenerator + | ModelsGenerator + | ChannelsGenerator + | ClientGenerator + | CustomGenerator; + + /** Main configuration interface for The Codegen Project */ + export interface TheCodegenConfiguration { + /** Type of input specification */ + inputType: InputType; + /** Path to the input specification file */ + inputPath: string; + /** Target language for generated code */ + language: Language; + /** List of generators to run */ + generators: Generator[]; + } +} + +// Global type declarations for better autocomplete +declare global { + type InputType = 'asyncapi' | 'openapi' | 'jsonschema'; + type Language = 'typescript'; + type SerializationType = 'json' | 'yaml' | 'msgpack' | 'avro' | 'protobuf'; + type ChannelsProtocol = 'nats' | 'kafka' | 'mqtt' | 'amqp' | 'websocket' | 'http_client' | 'event_source'; + type ClientProtocol = 'nats'; +} +`; +} + +/** + * Setup Monaco TypeScript IntelliSense with config types. + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function setupMonacoTypes(monaco: any): void { + // Monaco types are available at runtime, but the TypeScript definitions + // from @monaco-editor/react don't fully expose them. We use any here. + const typescript = monaco.languages?.typescript; + if (!typescript?.typescriptDefaults) { + console.warn('Monaco TypeScript not available'); + return; + } + + // Configure TypeScript compiler options + typescript.typescriptDefaults.setCompilerOptions({ + target: typescript.ScriptTarget?.ESNext ?? 99, + module: typescript.ModuleKind?.ESNext ?? 99, + moduleResolution: typescript.ModuleResolutionKind?.NodeJs ?? 2, + allowNonTsExtensions: true, + strict: true, + noEmit: true, + esModuleInterop: true, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + }); + + // Suppress module resolution errors for playground + typescript.typescriptDefaults.setDiagnosticsOptions({ + noSemanticValidation: false, + noSyntaxValidation: false, + // Ignore "Cannot find module" errors (2307) + diagnosticCodesToIgnore: [2307], + }); + + // Add the type definitions for @the-codegen-project/cli + typescript.typescriptDefaults.addExtraLib( + getConfigTypeDefinitions(), + 'file:///node_modules/@types/the-codegen-project__cli/index.d.ts' + ); + + // Also add with the direct module path + typescript.typescriptDefaults.addExtraLib( + getConfigTypeDefinitions(), + 'file:///node_modules/@the-codegen-project/cli/index.d.ts' + ); +} diff --git a/website/static/codegen.browser.mjs b/website/static/codegen.browser.mjs new file mode 100644 index 00000000..fed0b44d --- /dev/null +++ b/website/static/codegen.browser.mjs @@ -0,0 +1,1027487 @@ +// Browser bundle for The Codegen Project +// Generated by esbuild with Node.js polyfills + +// Global Ajv placeholder for webapi-parser (will be set by require_ajv4) +var Ajv; + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2; +var __require = /* @__PURE__ */ ((x7) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x7, { + get: (a7, b8) => (typeof require !== "undefined" ? require : a7)[b8] +}) : x7)(function(x7) { + if (typeof require !== "undefined") + return require.apply(this, arguments); + throw Error('Dynamic require of "' + x7 + '" is not supported'); +}); +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __commonJS = (cb, mod2) => function __require2() { + return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; +}; +var __export = (target, all) => { + for (var name2 in all) + __defProp(target, name2, { get: all[name2], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, + mod2 +)); +var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); +var __publicField = (obj, key, value2) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2); + return value2; +}; +var __accessCheck = (obj, member, msg) => { + if (!member.has(obj)) + throw TypeError("Cannot " + msg); +}; +var __privateGet = (obj, member, getter) => { + __accessCheck(obj, member, "read from private field"); + return getter ? getter.call(obj) : member.get(obj); +}; +var __privateAdd = (obj, member, value2) => { + if (member.has(obj)) + throw TypeError("Cannot add the same private member more than once"); + member instanceof WeakSet ? member.add(obj) : member.set(obj, value2); +}; +var __privateSet = (obj, member, value2, setter) => { + __accessCheck(obj, member, "write to private field"); + setter ? setter.call(obj, value2) : member.set(obj, value2); + return value2; +}; +var __privateMethod = (obj, member, method2) => { + __accessCheck(obj, member, "access private method"); + return method2; +}; + +// node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js +var __dirname; +var init_dirname = __esm({ + "node_modules/esbuild-plugin-polyfill-node/polyfills/__dirname.js"() { + __dirname = "/"; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/process.js +var process = {}; +__export(process, { + _debugEnd: () => _debugEnd, + _debugProcess: () => _debugProcess, + _events: () => _events, + _eventsCount: () => _eventsCount, + _exiting: () => _exiting, + _fatalExceptions: () => _fatalExceptions, + _getActiveHandles: () => _getActiveHandles, + _getActiveRequests: () => _getActiveRequests, + _kill: () => _kill, + _linkedBinding: () => _linkedBinding, + _maxListeners: () => _maxListeners, + _preload_modules: () => _preload_modules, + _rawDebug: () => _rawDebug, + _startProfilerIdleNotifier: () => _startProfilerIdleNotifier, + _stopProfilerIdleNotifier: () => _stopProfilerIdleNotifier, + _tickCallback: () => _tickCallback, + abort: () => abort, + addListener: () => addListener, + allowedNodeEnvironmentFlags: () => allowedNodeEnvironmentFlags, + arch: () => arch, + argv: () => argv, + argv0: () => argv0, + assert: () => assert, + binding: () => binding, + browser: () => browser, + chdir: () => chdir, + config: () => config, + cpuUsage: () => cpuUsage, + cwd: () => cwd, + debugPort: () => debugPort, + default: () => process2, + dlopen: () => dlopen, + domain: () => domain, + emit: () => emit, + emitWarning: () => emitWarning, + env: () => env, + execArgv: () => execArgv, + execPath: () => execPath, + exit: () => exit, + features: () => features, + hasUncaughtExceptionCaptureCallback: () => hasUncaughtExceptionCaptureCallback, + hrtime: () => hrtime, + kill: () => kill, + listeners: () => listeners, + memoryUsage: () => memoryUsage, + moduleLoadList: () => moduleLoadList, + nextTick: () => nextTick, + off: () => off, + on: () => on, + once: () => once, + openStdin: () => openStdin, + pid: () => pid, + platform: () => platform, + ppid: () => ppid, + prependListener: () => prependListener, + prependOnceListener: () => prependOnceListener, + reallyExit: () => reallyExit, + release: () => release, + removeAllListeners: () => removeAllListeners, + removeListener: () => removeListener, + resourceUsage: () => resourceUsage, + setSourceMapsEnabled: () => setSourceMapsEnabled, + setUncaughtExceptionCaptureCallback: () => setUncaughtExceptionCaptureCallback, + stderr: () => stderr, + stdin: () => stdin, + stdout: () => stdout, + title: () => title, + umask: () => umask, + uptime: () => uptime, + version: () => version, + versions: () => versions +}); +function unimplemented(name2) { + throw new Error("Node.js process " + name2 + " is not supported by JSPM core outside of Node.js"); +} +function cleanUpNextTick() { + if (!draining || !currentQueue) + return; + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) + drainQueue(); +} +function drainQueue() { + if (draining) + return; + var timeout = setTimeout(cleanUpNextTick, 0); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) + currentQueue[queueIndex].run(); + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + clearTimeout(timeout); +} +function nextTick(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i7 = 1; i7 < arguments.length; i7++) + args[i7 - 1] = arguments[i7]; + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) + setTimeout(drainQueue, 0); +} +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +function noop() { +} +function _linkedBinding(name2) { + unimplemented("_linkedBinding"); +} +function dlopen(name2) { + unimplemented("dlopen"); +} +function _getActiveRequests() { + return []; +} +function _getActiveHandles() { + return []; +} +function assert(condition, message) { + if (!condition) + throw new Error(message || "assertion error"); +} +function hasUncaughtExceptionCaptureCallback() { + return false; +} +function uptime() { + return _performance.now() / 1e3; +} +function hrtime(previousTimestamp) { + var baseNow = Math.floor((Date.now() - _performance.now()) * 1e-3); + var clocktime = _performance.now() * 1e-3; + var seconds = Math.floor(clocktime) + baseNow; + var nanoseconds = Math.floor(clocktime % 1 * 1e9); + if (previousTimestamp) { + seconds = seconds - previousTimestamp[0]; + nanoseconds = nanoseconds - previousTimestamp[1]; + if (nanoseconds < 0) { + seconds--; + nanoseconds += nanoPerSec; + } + } + return [seconds, nanoseconds]; +} +function on() { + return process2; +} +function listeners(name2) { + return []; +} +var queue, draining, currentQueue, queueIndex, title, arch, platform, env, argv, execArgv, version, versions, emitWarning, binding, umask, cwd, chdir, release, browser, _rawDebug, moduleLoadList, domain, _exiting, config, reallyExit, _kill, cpuUsage, resourceUsage, memoryUsage, kill, exit, openStdin, allowedNodeEnvironmentFlags, features, _fatalExceptions, setUncaughtExceptionCaptureCallback, _tickCallback, _debugProcess, _debugEnd, _startProfilerIdleNotifier, _stopProfilerIdleNotifier, stdout, stderr, stdin, abort, pid, ppid, execPath, debugPort, argv0, _preload_modules, setSourceMapsEnabled, _performance, nowOffset, nanoPerSec, _maxListeners, _events, _eventsCount, addListener, once, off, removeListener, removeAllListeners, emit, prependListener, prependOnceListener, process2; +var init_process = __esm({ + "node_modules/@jspm/core/nodelibs/browser/process.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + queue = []; + draining = false; + queueIndex = -1; + Item.prototype.run = function() { + this.fun.apply(null, this.array); + }; + title = "browser"; + arch = "x64"; + platform = "browser"; + env = { + PATH: "/usr/bin", + LANG: typeof navigator !== "undefined" ? navigator.language + ".UTF-8" : void 0, + PWD: "/", + HOME: "/home", + TMP: "/tmp" + }; + argv = ["/usr/bin/node"]; + execArgv = []; + version = "v16.8.0"; + versions = {}; + emitWarning = function(message, type3) { + console.warn((type3 ? type3 + ": " : "") + message); + }; + binding = function(name2) { + unimplemented("binding"); + }; + umask = function(mask) { + return 0; + }; + cwd = function() { + return "/"; + }; + chdir = function(dir2) { + }; + release = { + name: "node", + sourceUrl: "", + headersUrl: "", + libUrl: "" + }; + browser = true; + _rawDebug = noop; + moduleLoadList = []; + domain = {}; + _exiting = false; + config = {}; + reallyExit = noop; + _kill = noop; + cpuUsage = function() { + return {}; + }; + resourceUsage = cpuUsage; + memoryUsage = cpuUsage; + kill = noop; + exit = noop; + openStdin = noop; + allowedNodeEnvironmentFlags = {}; + features = { + inspector: false, + debug: false, + uv: false, + ipv6: false, + tls_alpn: false, + tls_sni: false, + tls_ocsp: false, + tls: false, + cached_builtins: true + }; + _fatalExceptions = noop; + setUncaughtExceptionCaptureCallback = noop; + _tickCallback = noop; + _debugProcess = noop; + _debugEnd = noop; + _startProfilerIdleNotifier = noop; + _stopProfilerIdleNotifier = noop; + stdout = void 0; + stderr = void 0; + stdin = void 0; + abort = noop; + pid = 2; + ppid = 1; + execPath = "/bin/usr/node"; + debugPort = 9229; + argv0 = "node"; + _preload_modules = []; + setSourceMapsEnabled = noop; + _performance = { + now: typeof performance !== "undefined" ? performance.now.bind(performance) : void 0, + timing: typeof performance !== "undefined" ? performance.timing : void 0 + }; + if (_performance.now === void 0) { + nowOffset = Date.now(); + if (_performance.timing && _performance.timing.navigationStart) { + nowOffset = _performance.timing.navigationStart; + } + _performance.now = () => Date.now() - nowOffset; + } + nanoPerSec = 1e9; + hrtime.bigint = function(time2) { + var diff = hrtime(time2); + if (typeof BigInt === "undefined") { + return diff[0] * nanoPerSec + diff[1]; + } + return BigInt(diff[0] * nanoPerSec) + BigInt(diff[1]); + }; + _maxListeners = 10; + _events = {}; + _eventsCount = 0; + addListener = on; + once = on; + off = on; + removeListener = on; + removeAllListeners = on; + emit = noop; + prependListener = on; + prependOnceListener = on; + process2 = { + version, + versions, + arch, + platform, + browser, + release, + _rawDebug, + moduleLoadList, + binding, + _linkedBinding, + _events, + _eventsCount, + _maxListeners, + on, + addListener, + once, + off, + removeListener, + removeAllListeners, + emit, + prependListener, + prependOnceListener, + listeners, + domain, + _exiting, + config, + dlopen, + uptime, + _getActiveRequests, + _getActiveHandles, + reallyExit, + _kill, + cpuUsage, + resourceUsage, + memoryUsage, + kill, + exit, + openStdin, + allowedNodeEnvironmentFlags, + assert, + features, + _fatalExceptions, + setUncaughtExceptionCaptureCallback, + hasUncaughtExceptionCaptureCallback, + emitWarning, + nextTick, + _tickCallback, + _debugProcess, + _debugEnd, + _startProfilerIdleNotifier, + _stopProfilerIdleNotifier, + stdout, + stdin, + stderr, + abort, + umask, + chdir, + cwd, + env, + title, + argv, + execArgv, + pid, + ppid, + execPath, + debugPort, + hrtime, + argv0, + _preload_modules, + setSourceMapsEnabled + }; + } +}); + +// node_modules/esbuild-plugin-polyfill-node/polyfills/process.js +var init_process2 = __esm({ + "node_modules/esbuild-plugin-polyfill-node/polyfills/process.js"() { + init_process(); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-DtuTasat.js +function dew$2() { + if (_dewExec$2) + return exports$2; + _dewExec$2 = true; + exports$2.byteLength = byteLength; + exports$2.toByteArray = toByteArray; + exports$2.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (var i7 = 0, len = code.length; i7 < len; ++i7) { + lookup[i7] = code[i7]; + revLookup[code.charCodeAt(i7)] = i7; + } + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 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 i8; + for (i8 = 0; i8 < len2; i8 += 4) { + tmp = revLookup[b64.charCodeAt(i8)] << 18 | revLookup[b64.charCodeAt(i8 + 1)] << 12 | revLookup[b64.charCodeAt(i8 + 2)] << 6 | revLookup[b64.charCodeAt(i8 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i8)] << 2 | revLookup[b64.charCodeAt(i8 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i8)] << 10 | revLookup[b64.charCodeAt(i8 + 1)] << 4 | revLookup[b64.charCodeAt(i8 + 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 i8 = start; i8 < end; i8 += 3) { + tmp = (uint8[i8] << 16 & 16711680) + (uint8[i8 + 1] << 8 & 65280) + (uint8[i8 + 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 i8 = 0, len22 = len2 - extraBytes; i8 < len22; i8 += maxChunkLength) { + parts.push(encodeChunk(uint8, i8, i8 + maxChunkLength > len22 ? len22 : i8 + 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(""); + } + return exports$2; +} +function dew$1() { + if (_dewExec$1) + return exports$1; + _dewExec$1 = true; + exports$1.read = function(buffer2, offset, isLE, mLen, nBytes) { + var e10, m7; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i7 = isLE ? nBytes - 1 : 0; + var d7 = isLE ? -1 : 1; + var s7 = buffer2[offset + i7]; + i7 += d7; + e10 = s7 & (1 << -nBits) - 1; + s7 >>= -nBits; + nBits += eLen; + for (; nBits > 0; e10 = e10 * 256 + buffer2[offset + i7], i7 += d7, nBits -= 8) { + } + m7 = e10 & (1 << -nBits) - 1; + e10 >>= -nBits; + nBits += mLen; + for (; nBits > 0; m7 = m7 * 256 + buffer2[offset + i7], i7 += d7, nBits -= 8) { + } + if (e10 === 0) { + e10 = 1 - eBias; + } else if (e10 === eMax) { + return m7 ? NaN : (s7 ? -1 : 1) * Infinity; + } else { + m7 = m7 + Math.pow(2, mLen); + e10 = e10 - eBias; + } + return (s7 ? -1 : 1) * m7 * Math.pow(2, e10 - mLen); + }; + exports$1.write = function(buffer2, value2, offset, isLE, mLen, nBytes) { + var e10, m7, c7; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i7 = isLE ? 0 : nBytes - 1; + var d7 = isLE ? 1 : -1; + var s7 = value2 < 0 || value2 === 0 && 1 / value2 < 0 ? 1 : 0; + value2 = Math.abs(value2); + if (isNaN(value2) || value2 === Infinity) { + m7 = isNaN(value2) ? 1 : 0; + e10 = eMax; + } else { + e10 = Math.floor(Math.log(value2) / Math.LN2); + if (value2 * (c7 = Math.pow(2, -e10)) < 1) { + e10--; + c7 *= 2; + } + if (e10 + eBias >= 1) { + value2 += rt / c7; + } else { + value2 += rt * Math.pow(2, 1 - eBias); + } + if (value2 * c7 >= 2) { + e10++; + c7 /= 2; + } + if (e10 + eBias >= eMax) { + m7 = 0; + e10 = eMax; + } else if (e10 + eBias >= 1) { + m7 = (value2 * c7 - 1) * Math.pow(2, mLen); + e10 = e10 + eBias; + } else { + m7 = value2 * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e10 = 0; + } + } + for (; mLen >= 8; buffer2[offset + i7] = m7 & 255, i7 += d7, m7 /= 256, mLen -= 8) { + } + e10 = e10 << mLen | m7; + eLen += mLen; + for (; eLen > 0; buffer2[offset + i7] = e10 & 255, i7 += d7, e10 /= 256, eLen -= 8) { + } + buffer2[offset + i7 - d7] |= s7 * 128; + }; + return exports$1; +} +function dew() { + if (_dewExec) + return exports2; + _dewExec = true; + const base64 = dew$2(); + const ieee754 = dew$1(); + const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports2.Buffer = Buffer4; + exports2.SlowBuffer = SlowBuffer2; + exports2.INSPECT_MAX_BYTES = 50; + const K_MAX_LENGTH = 2147483647; + exports2.kMaxLength = K_MAX_LENGTH; + Buffer4.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer4.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { + console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); + } + function typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto = { + foo: function() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e10) { + return false; + } + } + Object.defineProperty(Buffer4.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer4.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer4.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer4.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer4.prototype); + return buf; + } + function Buffer4(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe2(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer4.poolSize = 8192; + function from(value2, encodingOrOffset, length) { + if (typeof value2 === "string") { + return fromString(value2, encodingOrOffset); + } + if (ArrayBuffer.isView(value2)) { + return fromArrayView(value2); + } + if (value2 == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + if (isInstance(value2, ArrayBuffer) || value2 && isInstance(value2.buffer, ArrayBuffer)) { + return fromArrayBuffer(value2, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value2, SharedArrayBuffer) || value2 && isInstance(value2.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value2, encodingOrOffset, length); + } + if (typeof value2 === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value2.valueOf && value2.valueOf(); + if (valueOf != null && valueOf !== value2) { + return Buffer4.from(valueOf, encodingOrOffset, length); + } + const b8 = fromObject(value2); + if (b8) + return b8; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value2[Symbol.toPrimitive] === "function") { + return Buffer4.from(value2[Symbol.toPrimitive]("string"), encodingOrOffset, length); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + Buffer4.from = function(value2, encodingOrOffset, length) { + return from(value2, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer4.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer4, Uint8Array); + function assertSize(size2) { + if (typeof size2 !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size2 < 0) { + throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + } + } + function alloc(size2, fill2, encoding) { + assertSize(size2); + if (size2 <= 0) { + return createBuffer(size2); + } + if (fill2 !== void 0) { + return typeof encoding === "string" ? createBuffer(size2).fill(fill2, encoding) : createBuffer(size2).fill(fill2); + } + return createBuffer(size2); + } + Buffer4.alloc = function(size2, fill2, encoding) { + return alloc(size2, fill2, encoding); + }; + function allocUnsafe2(size2) { + assertSize(size2); + return createBuffer(size2 < 0 ? 0 : checked(size2) | 0); + } + Buffer4.allocUnsafe = function(size2) { + return allocUnsafe2(size2); + }; + Buffer4.allocUnsafeSlow = function(size2) { + return allocUnsafe2(size2); + }; + function fromString(string2, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer4.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length = byteLength(string2, encoding) | 0; + let buf = createBuffer(length); + const actual = buf.write(string2, encoding); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i7 = 0; i7 < length; i7 += 1) { + buf[i7] = array[i7] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy4 = new Uint8Array(arrayView); + return fromArrayBuffer(copy4.buffer, copy4.byteOffset, copy4.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array); + } else if (length === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer4.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer4.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer2(length) { + if (+length != length) { + length = 0; + } + return Buffer4.alloc(+length); + } + Buffer4.isBuffer = function isBuffer3(b8) { + return b8 != null && b8._isBuffer === true && b8 !== Buffer4.prototype; + }; + Buffer4.compare = function compare(a7, b8) { + if (isInstance(a7, Uint8Array)) + a7 = Buffer4.from(a7, a7.offset, a7.byteLength); + if (isInstance(b8, Uint8Array)) + b8 = Buffer4.from(b8, b8.offset, b8.byteLength); + if (!Buffer4.isBuffer(a7) || !Buffer4.isBuffer(b8)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a7 === b8) + return 0; + let x7 = a7.length; + let y7 = b8.length; + for (let i7 = 0, len = Math.min(x7, y7); i7 < len; ++i7) { + if (a7[i7] !== b8[i7]) { + x7 = a7[i7]; + y7 = b8[i7]; + break; + } + } + if (x7 < y7) + return -1; + if (y7 < x7) + return 1; + return 0; + }; + Buffer4.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }; + Buffer4.concat = function concat2(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer4.alloc(0); + } + let i7; + if (length === void 0) { + length = 0; + for (i7 = 0; i7 < list.length; ++i7) { + length += list[i7].length; + } + } + const buffer2 = Buffer4.allocUnsafe(length); + let pos = 0; + for (i7 = 0; i7 < list.length; ++i7) { + let buf = list[i7]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer2.length) { + if (!Buffer4.isBuffer(buf)) + buf = Buffer4.from(buf); + buf.copy(buffer2, pos); + } else { + Uint8Array.prototype.set.call(buffer2, buf, pos); + } + } else if (!Buffer4.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer2, pos); + } + pos += buf.length; + } + return buffer2; + }; + function byteLength(string2, encoding) { + if (Buffer4.isBuffer(string2)) { + return string2.length; + } + if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) { + return string2.byteLength; + } + if (typeof string2 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2); + } + const len = string2.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string2).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string2).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string2).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer4.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer4.prototype._isBuffer = true; + function swap(b8, n7, m7) { + const i7 = b8[n7]; + b8[n7] = b8[m7]; + b8[m7] = i7; + } + Buffer4.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i7 = 0; i7 < len; i7 += 2) { + swap(this, i7, i7 + 1); + } + return this; + }; + Buffer4.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i7 = 0; i7 < len; i7 += 4) { + swap(this, i7, i7 + 3); + swap(this, i7 + 1, i7 + 2); + } + return this; + }; + Buffer4.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i7 = 0; i7 < len; i7 += 8) { + swap(this, i7, i7 + 7); + swap(this, i7 + 1, i7 + 6); + swap(this, i7 + 2, i7 + 5); + swap(this, i7 + 3, i7 + 4); + } + return this; + }; + Buffer4.prototype.toString = function toString3() { + const length = this.length; + if (length === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer4.prototype.toLocaleString = Buffer4.prototype.toString; + Buffer4.prototype.equals = function equals(b8) { + if (!Buffer4.isBuffer(b8)) + throw new TypeError("Argument must be a Buffer"); + if (this === b8) + return true; + return Buffer4.compare(this, b8) === 0; + }; + Buffer4.prototype.inspect = function inspect2() { + let str2 = ""; + const max2 = exports2.INSPECT_MAX_BYTES; + str2 = this.toString("hex", 0, max2).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max2) + str2 += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer4.prototype[customInspectSymbol] = Buffer4.prototype.inspect; + } + Buffer4.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer4.from(target, target.offset, target.byteLength); + } + if (!Buffer4.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x7 = thisEnd - thisStart; + let y7 = end - start; + const len = Math.min(x7, y7); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i7 = 0; i7 < len; ++i7) { + if (thisCopy[i7] !== targetCopy[i7]) { + x7 = thisCopy[i7]; + y7 = targetCopy[i7]; + break; + } + } + if (x7 < y7) + return -1; + if (y7 < x7) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir2) { + if (buffer2.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir2 ? 0 : buffer2.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer2.length + byteOffset; + if (byteOffset >= buffer2.length) { + if (dir2) + return -1; + else + byteOffset = buffer2.length - 1; + } else if (byteOffset < 0) { + if (dir2) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer4.from(val, encoding); + } + if (Buffer4.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer2, val, byteOffset, encoding, dir2); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir2) { + return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); + } + } + return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir2); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir2) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i8) { + if (indexSize === 1) { + return buf[i8]; + } else { + return buf.readUInt16BE(i8 * indexSize); + } + } + let i7; + if (dir2) { + let foundIndex = -1; + for (i7 = byteOffset; i7 < arrLength; i7++) { + if (read(arr, i7) === read(val, foundIndex === -1 ? 0 : i7 - foundIndex)) { + if (foundIndex === -1) + foundIndex = i7; + if (i7 - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i7 -= i7 - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i7 = byteOffset; i7 >= 0; i7--) { + let found = true; + for (let j6 = 0; j6 < valLength; j6++) { + if (read(arr, i7 + j6) !== read(val, j6)) { + found = false; + break; + } + } + if (found) + return i7; + } + } + return -1; + } + Buffer4.prototype.includes = function includes2(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer4.prototype.indexOf = function indexOf4(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer4.prototype.lastIndexOf = function lastIndexOf2(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string2, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + const strLen = string2.length; + if (length > strLen / 2) { + length = strLen / 2; + } + let i7; + for (i7 = 0; i7 < length; ++i7) { + const parsed = parseInt(string2.substr(i7 * 2, 2), 16); + if (numberIsNaN(parsed)) + return i7; + buf[offset + i7] = parsed; + } + return i7; + } + function utf8Write(buf, string2, offset, length) { + return blitBuffer(utf8ToBytes(string2, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string2, offset, length) { + return blitBuffer(asciiToBytes(string2), buf, offset, length); + } + function base64Write(buf, string2, offset, length) { + return blitBuffer(base64ToBytes(string2), buf, offset, length); + } + function ucs2Write(buf, string2, offset, length) { + return blitBuffer(utf16leToBytes(string2, buf.length - offset), buf, offset, length); + } + Buffer4.prototype.write = function write(string2, offset, length, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length = this.length; + offset = 0; + } else if (length === void 0 && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length; + length = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length === void 0 || length > remaining) + length = remaining; + if (string2.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string2, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string2, offset, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string2, offset, length); + case "base64": + return base64Write(this, string2, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string2, offset, length); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer4.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i7 = start; + while (i7 < end) { + const firstByte = buf[i7]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i7 + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i7 + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i7 + 1]; + thirdByte = buf[i7 + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i7 + 1]; + thirdByte = buf[i7 + 2]; + fourthByte = buf[i7 + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i7 += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + const MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i7 = 0; + while (i7 < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i7, i7 += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i7 = start; i7 < end; ++i7) { + ret += String.fromCharCode(buf[i7] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i7 = start; i7 < end; ++i7) { + ret += String.fromCharCode(buf[i7]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i7 = start; i7 < end; ++i7) { + out += hexSliceLookupTable[buf[i7]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i7 = 0; i7 < bytes.length - 1; i7 += 2) { + res += String.fromCharCode(bytes[i7] + bytes[i7 + 1] * 256); + } + return res; + } + Buffer4.prototype.slice = function slice2(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer4.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer4.prototype.readUintLE = Buffer4.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i7 = 0; + while (++i7 < byteLength2 && (mul *= 256)) { + val += this[offset + i7] * mul; + } + return val; + }; + Buffer4.prototype.readUintBE = Buffer4.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer4.prototype.readUint8 = Buffer4.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer4.prototype.readUint16LE = Buffer4.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer4.prototype.readUint16BE = Buffer4.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer4.prototype.readUint32LE = Buffer4.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer4.prototype.readUint32BE = Buffer4.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer4.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last2 * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer4.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer4.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i7 = 0; + while (++i7 < byteLength2 && (mul *= 256)) { + val += this[offset + i7] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer4.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i7 = byteLength2; + let mul = 1; + let val = this[offset + --i7]; + while (i7 > 0 && (mul *= 256)) { + val += this[offset + --i7] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer4.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer4.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer4.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer4.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer4.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer4.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last2 << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer4.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2); + }); + Buffer4.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer4.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer4.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer4.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value2, offset, ext, max2, min2) { + if (!Buffer4.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value2 > max2 || value2 < min2) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer4.prototype.writeUintLE = Buffer4.prototype.writeUIntLE = function writeUIntLE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value2, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i7 = 0; + this[offset] = value2 & 255; + while (++i7 < byteLength2 && (mul *= 256)) { + this[offset + i7] = value2 / mul & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeUintBE = Buffer4.prototype.writeUIntBE = function writeUIntBE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value2, offset, byteLength2, maxBytes, 0); + } + let i7 = byteLength2 - 1; + let mul = 1; + this[offset + i7] = value2 & 255; + while (--i7 >= 0 && (mul *= 256)) { + this[offset + i7] = value2 / mul & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeUint8 = Buffer4.prototype.writeUInt8 = function writeUInt8(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 1, 255, 0); + this[offset] = value2 & 255; + return offset + 1; + }; + Buffer4.prototype.writeUint16LE = Buffer4.prototype.writeUInt16LE = function writeUInt16LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 65535, 0); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + return offset + 2; + }; + Buffer4.prototype.writeUint16BE = Buffer4.prototype.writeUInt16BE = function writeUInt16BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 65535, 0); + this[offset] = value2 >>> 8; + this[offset + 1] = value2 & 255; + return offset + 2; + }; + Buffer4.prototype.writeUint32LE = Buffer4.prototype.writeUInt32LE = function writeUInt32LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 4294967295, 0); + this[offset + 3] = value2 >>> 24; + this[offset + 2] = value2 >>> 16; + this[offset + 1] = value2 >>> 8; + this[offset] = value2 & 255; + return offset + 4; + }; + Buffer4.prototype.writeUint32BE = Buffer4.prototype.writeUInt32BE = function writeUInt32BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 4294967295, 0); + this[offset] = value2 >>> 24; + this[offset + 1] = value2 >>> 16; + this[offset + 2] = value2 >>> 8; + this[offset + 3] = value2 & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value2, offset, min2, max2) { + checkIntBI(value2, min2, max2, buf, offset, 7); + let lo = Number(value2 & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value2 >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value2, offset, min2, max2) { + checkIntBI(value2, min2, max2, buf, offset, 7); + let lo = Number(value2 & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value2 >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer4.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value2, offset = 0) { + return wrtBigUInt64LE(this, value2, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer4.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value2, offset = 0) { + return wrtBigUInt64BE(this, value2, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer4.prototype.writeIntLE = function writeIntLE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value2, offset, byteLength2, limit - 1, -limit); + } + let i7 = 0; + let mul = 1; + let sub = 0; + this[offset] = value2 & 255; + while (++i7 < byteLength2 && (mul *= 256)) { + if (value2 < 0 && sub === 0 && this[offset + i7 - 1] !== 0) { + sub = 1; + } + this[offset + i7] = (value2 / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeIntBE = function writeIntBE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value2, offset, byteLength2, limit - 1, -limit); + } + let i7 = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i7] = value2 & 255; + while (--i7 >= 0 && (mul *= 256)) { + if (value2 < 0 && sub === 0 && this[offset + i7 + 1] !== 0) { + sub = 1; + } + this[offset + i7] = (value2 / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeInt8 = function writeInt8(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 1, 127, -128); + if (value2 < 0) + value2 = 255 + value2 + 1; + this[offset] = value2 & 255; + return offset + 1; + }; + Buffer4.prototype.writeInt16LE = function writeInt16LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 32767, -32768); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + return offset + 2; + }; + Buffer4.prototype.writeInt16BE = function writeInt16BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 32767, -32768); + this[offset] = value2 >>> 8; + this[offset + 1] = value2 & 255; + return offset + 2; + }; + Buffer4.prototype.writeInt32LE = function writeInt32LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 2147483647, -2147483648); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + this[offset + 2] = value2 >>> 16; + this[offset + 3] = value2 >>> 24; + return offset + 4; + }; + Buffer4.prototype.writeInt32BE = function writeInt32BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 2147483647, -2147483648); + if (value2 < 0) + value2 = 4294967295 + value2 + 1; + this[offset] = value2 >>> 24; + this[offset + 1] = value2 >>> 16; + this[offset + 2] = value2 >>> 8; + this[offset + 3] = value2 & 255; + return offset + 4; + }; + Buffer4.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value2, offset = 0) { + return wrtBigUInt64LE(this, value2, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer4.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value2, offset = 0) { + return wrtBigUInt64BE(this, value2, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value2, offset, ext, max2, min2) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value2, offset, littleEndian, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value2, offset, 4); + } + ieee754.write(buf, value2, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer4.prototype.writeFloatLE = function writeFloatLE(value2, offset, noAssert) { + return writeFloat(this, value2, offset, true, noAssert); + }; + Buffer4.prototype.writeFloatBE = function writeFloatBE(value2, offset, noAssert) { + return writeFloat(this, value2, offset, false, noAssert); + }; + function writeDouble(buf, value2, offset, littleEndian, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value2, offset, 8); + } + ieee754.write(buf, value2, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer4.prototype.writeDoubleLE = function writeDoubleLE(value2, offset, noAssert) { + return writeDouble(this, value2, offset, true, noAssert); + }; + Buffer4.prototype.writeDoubleBE = function writeDoubleBE(value2, offset, noAssert) { + return writeDouble(this, value2, offset, false, noAssert); + }; + Buffer4.prototype.copy = function copy4(target, targetStart, start, end) { + if (!Buffer4.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer4.prototype.fill = function fill2(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer4.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i7; + if (typeof val === "number") { + for (i7 = start; i7 < end; ++i7) { + this[i7] = val; + } + } else { + const bytes = Buffer4.isBuffer(val) ? val : Buffer4.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i7 = 0; i7 < end - start; ++i7) { + this[i7 + start] = bytes[i7 % len]; + } + } + return this; + }; + const errors = {}; + function E6(sym, getMessage, Base2) { + errors[sym] = class NodeError extends Base2 { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value2) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value: value2, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E6("ERR_BUFFER_OUT_OF_BOUNDS", function(name2) { + if (name2) { + return `${name2} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E6("ERR_INVALID_ARG_TYPE", function(name2, actual) { + return `The "${name2}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E6("ERR_OUT_OF_RANGE", function(str2, range2, input) { + let msg = `The value of "${str2}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range2}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i7 = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i7 >= start + 4; i7 -= 3) { + res = `_${val.slice(i7 - 3, i7)}${res}`; + } + return `${val.slice(0, i7)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value2, min2, max2, buf, offset, byteLength2) { + if (value2 > max2 || value2 < min2) { + const n7 = typeof min2 === "bigint" ? "n" : ""; + let range2; + { + if (min2 === 0 || min2 === BigInt(0)) { + range2 = `>= 0${n7} and < 2${n7} ** ${(byteLength2 + 1) * 8}${n7}`; + } else { + range2 = `>= -(2${n7} ** ${(byteLength2 + 1) * 8 - 1}${n7}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n7}`; + } + } + throw new errors.ERR_OUT_OF_RANGE("value", range2, value2); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value2, name2) { + if (typeof value2 !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name2, "number", value2); + } + } + function boundsError(value2, length, type3) { + if (Math.floor(value2) !== value2) { + validateNumber(value2, type3); + throw new errors.ERR_OUT_OF_RANGE("offset", "an integer", value2); + } + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE("offset", `>= ${0} and <= ${length}`, value2); + } + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str2) { + str2 = str2.split("=")[0]; + str2 = str2.trim().replace(INVALID_BASE64_RE, ""); + if (str2.length < 2) + return ""; + while (str2.length % 4 !== 0) { + str2 = str2 + "="; + } + return str2; + } + function utf8ToBytes(string2, units) { + units = units || Infinity; + let codePoint; + const length = string2.length; + let leadSurrogate = null; + const bytes = []; + for (let i7 = 0; i7 < length; ++i7) { + codePoint = string2.charCodeAt(i7); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i7 + 1 === length) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str2) { + const byteArray = []; + for (let i7 = 0; i7 < str2.length; ++i7) { + byteArray.push(str2.charCodeAt(i7) & 255); + } + return byteArray; + } + function utf16leToBytes(str2, units) { + let c7, hi, lo; + const byteArray = []; + for (let i7 = 0; i7 < str2.length; ++i7) { + if ((units -= 2) < 0) + break; + c7 = str2.charCodeAt(i7); + hi = c7 >> 8; + lo = c7 % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str2) { + return base64.toByteArray(base64clean(str2)); + } + function blitBuffer(src, dst, offset, length) { + let i7; + for (i7 = 0; i7 < length; ++i7) { + if (i7 + offset >= dst.length || i7 >= src.length) + break; + dst[i7 + offset] = src[i7]; + } + return i7; + } + function isInstance(obj, type3) { + return obj instanceof type3 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type3.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + const hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table2 = new Array(256); + for (let i7 = 0; i7 < 16; ++i7) { + const i16 = i7 * 16; + for (let j6 = 0; j6 < 16; ++j6) { + table2[i16 + j6] = alphabet[i7] + alphabet[j6]; + } + } + return table2; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + return exports2; +} +var exports$2, _dewExec$2, exports$1, _dewExec$1, exports2, _dewExec; +var init_chunk_DtuTasat = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-DtuTasat.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports$2 = {}; + _dewExec$2 = false; + exports$1 = {}; + _dewExec$1 = false; + exports2 = {}; + _dewExec = false; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/buffer.js +var buffer_exports = {}; +__export(buffer_exports, { + Buffer: () => Buffer, + INSPECT_MAX_BYTES: () => INSPECT_MAX_BYTES, + SlowBuffer: () => SlowBuffer, + default: () => exports3, + kMaxLength: () => kMaxLength +}); +var exports3, Buffer, SlowBuffer, INSPECT_MAX_BYTES, kMaxLength; +var init_buffer = __esm({ + "node_modules/@jspm/core/nodelibs/browser/buffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtuTasat(); + exports3 = dew(); + exports3["Buffer"]; + exports3["SlowBuffer"]; + exports3["INSPECT_MAX_BYTES"]; + exports3["kMaxLength"]; + Buffer = exports3.Buffer; + SlowBuffer = exports3.SlowBuffer; + INSPECT_MAX_BYTES = exports3.INSPECT_MAX_BYTES; + kMaxLength = exports3.kMaxLength; + } +}); + +// node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js +var init_buffer2 = __esm({ + "node_modules/esbuild-plugin-polyfill-node/polyfills/buffer.js"() { + init_buffer(); + } +}); + +// node_modules/yaml/browser/dist/nodes/identity.js +function isCollection(node) { + if (node && typeof node === "object") + switch (node[NODE_TYPE]) { + case MAP: + case SEQ: + return true; + } + return false; +} +function isNode(node) { + if (node && typeof node === "object") + switch (node[NODE_TYPE]) { + case ALIAS: + case MAP: + case SCALAR: + case SEQ: + return true; + } + return false; +} +var ALIAS, DOC, MAP, PAIR, SCALAR, SEQ, NODE_TYPE, isAlias, isDocument, isMap, isPair, isScalar, isSeq, hasAnchor; +var init_identity = __esm({ + "node_modules/yaml/browser/dist/nodes/identity.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + ALIAS = Symbol.for("yaml.alias"); + DOC = Symbol.for("yaml.document"); + MAP = Symbol.for("yaml.map"); + PAIR = Symbol.for("yaml.pair"); + SCALAR = Symbol.for("yaml.scalar"); + SEQ = Symbol.for("yaml.seq"); + NODE_TYPE = Symbol.for("yaml.node.type"); + isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS; + isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC; + isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP; + isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR; + isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR; + isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ; + hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor; + } +}); + +// node_modules/yaml/browser/dist/visit.js +function visit(node, visitor) { + const visitor_ = initVisitor(visitor); + if (isDocument(node)) { + const cd = visit_(null, node.contents, visitor_, Object.freeze([node])); + if (cd === REMOVE) + node.contents = null; + } else + visit_(null, node, visitor_, Object.freeze([])); +} +function visit_(key, node, visitor, path2) { + const ctrl = callVisitor(key, node, visitor, path2); + if (isNode(ctrl) || isPair(ctrl)) { + replaceNode(key, path2, ctrl); + return visit_(key, ctrl, visitor, path2); + } + if (typeof ctrl !== "symbol") { + if (isCollection(node)) { + path2 = Object.freeze(path2.concat(node)); + for (let i7 = 0; i7 < node.items.length; ++i7) { + const ci = visit_(i7, node.items[i7], visitor, path2); + if (typeof ci === "number") + i7 = ci - 1; + else if (ci === BREAK) + return BREAK; + else if (ci === REMOVE) { + node.items.splice(i7, 1); + i7 -= 1; + } + } + } else if (isPair(node)) { + path2 = Object.freeze(path2.concat(node)); + const ck = visit_("key", node.key, visitor, path2); + if (ck === BREAK) + return BREAK; + else if (ck === REMOVE) + node.key = null; + const cv = visit_("value", node.value, visitor, path2); + if (cv === BREAK) + return BREAK; + else if (cv === REMOVE) + node.value = null; + } + } + return ctrl; +} +async function visitAsync(node, visitor) { + const visitor_ = initVisitor(visitor); + if (isDocument(node)) { + const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node])); + if (cd === REMOVE) + node.contents = null; + } else + await visitAsync_(null, node, visitor_, Object.freeze([])); +} +async function visitAsync_(key, node, visitor, path2) { + const ctrl = await callVisitor(key, node, visitor, path2); + if (isNode(ctrl) || isPair(ctrl)) { + replaceNode(key, path2, ctrl); + return visitAsync_(key, ctrl, visitor, path2); + } + if (typeof ctrl !== "symbol") { + if (isCollection(node)) { + path2 = Object.freeze(path2.concat(node)); + for (let i7 = 0; i7 < node.items.length; ++i7) { + const ci = await visitAsync_(i7, node.items[i7], visitor, path2); + if (typeof ci === "number") + i7 = ci - 1; + else if (ci === BREAK) + return BREAK; + else if (ci === REMOVE) { + node.items.splice(i7, 1); + i7 -= 1; + } + } + } else if (isPair(node)) { + path2 = Object.freeze(path2.concat(node)); + const ck = await visitAsync_("key", node.key, visitor, path2); + if (ck === BREAK) + return BREAK; + else if (ck === REMOVE) + node.key = null; + const cv = await visitAsync_("value", node.value, visitor, path2); + if (cv === BREAK) + return BREAK; + else if (cv === REMOVE) + node.value = null; + } + } + return ctrl; +} +function initVisitor(visitor) { + if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) { + return Object.assign({ + Alias: visitor.Node, + Map: visitor.Node, + Scalar: visitor.Node, + Seq: visitor.Node + }, visitor.Value && { + Map: visitor.Value, + Scalar: visitor.Value, + Seq: visitor.Value + }, visitor.Collection && { + Map: visitor.Collection, + Seq: visitor.Collection + }, visitor); + } + return visitor; +} +function callVisitor(key, node, visitor, path2) { + if (typeof visitor === "function") + return visitor(key, node, path2); + if (isMap(node)) + return visitor.Map?.(key, node, path2); + if (isSeq(node)) + return visitor.Seq?.(key, node, path2); + if (isPair(node)) + return visitor.Pair?.(key, node, path2); + if (isScalar(node)) + return visitor.Scalar?.(key, node, path2); + if (isAlias(node)) + return visitor.Alias?.(key, node, path2); + return void 0; +} +function replaceNode(key, path2, node) { + const parent2 = path2[path2.length - 1]; + if (isCollection(parent2)) { + parent2.items[key] = node; + } else if (isPair(parent2)) { + if (key === "key") + parent2.key = node; + else + parent2.value = node; + } else if (isDocument(parent2)) { + parent2.contents = node; + } else { + const pt = isAlias(parent2) ? "alias" : "scalar"; + throw new Error(`Cannot replace node with ${pt} parent`); + } +} +var BREAK, SKIP, REMOVE; +var init_visit = __esm({ + "node_modules/yaml/browser/dist/visit.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + BREAK = Symbol("break visit"); + SKIP = Symbol("skip children"); + REMOVE = Symbol("remove node"); + visit.BREAK = BREAK; + visit.SKIP = SKIP; + visit.REMOVE = REMOVE; + visitAsync.BREAK = BREAK; + visitAsync.SKIP = SKIP; + visitAsync.REMOVE = REMOVE; + } +}); + +// node_modules/yaml/browser/dist/doc/directives.js +var escapeChars, escapeTagName, Directives; +var init_directives = __esm({ + "node_modules/yaml/browser/dist/doc/directives.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_visit(); + escapeChars = { + "!": "%21", + ",": "%2C", + "[": "%5B", + "]": "%5D", + "{": "%7B", + "}": "%7D" + }; + escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]); + Directives = class _Directives { + constructor(yaml, tags6) { + this.docStart = null; + this.docEnd = false; + this.yaml = Object.assign({}, _Directives.defaultYaml, yaml); + this.tags = Object.assign({}, _Directives.defaultTags, tags6); + } + clone() { + const copy4 = new _Directives(this.yaml, this.tags); + copy4.docStart = this.docStart; + return copy4; + } + /** + * During parsing, get a Directives instance for the current document and + * update the stream state according to the current version's spec. + */ + atDocument() { + const res = new _Directives(this.yaml, this.tags); + switch (this.yaml.version) { + case "1.1": + this.atNextDocument = true; + break; + case "1.2": + this.atNextDocument = false; + this.yaml = { + explicit: _Directives.defaultYaml.explicit, + version: "1.2" + }; + this.tags = Object.assign({}, _Directives.defaultTags); + break; + } + return res; + } + /** + * @param onError - May be called even if the action was successful + * @returns `true` on success + */ + add(line, onError) { + if (this.atNextDocument) { + this.yaml = { explicit: _Directives.defaultYaml.explicit, version: "1.1" }; + this.tags = Object.assign({}, _Directives.defaultTags); + this.atNextDocument = false; + } + const parts = line.trim().split(/[ \t]+/); + const name2 = parts.shift(); + switch (name2) { + case "%TAG": { + if (parts.length !== 2) { + onError(0, "%TAG directive should contain exactly two parts"); + if (parts.length < 2) + return false; + } + const [handle, prefix] = parts; + this.tags[handle] = prefix; + return true; + } + case "%YAML": { + this.yaml.explicit = true; + if (parts.length !== 1) { + onError(0, "%YAML directive should contain exactly one part"); + return false; + } + const [version5] = parts; + if (version5 === "1.1" || version5 === "1.2") { + this.yaml.version = version5; + return true; + } else { + const isValid2 = /^\d+\.\d+$/.test(version5); + onError(6, `Unsupported YAML version ${version5}`, isValid2); + return false; + } + } + default: + onError(0, `Unknown directive ${name2}`, true); + return false; + } + } + /** + * Resolves a tag, matching handles to those defined in %TAG directives. + * + * @returns Resolved tag, which may also be the non-specific tag `'!'` or a + * `'!local'` tag, or `null` if unresolvable. + */ + tagName(source, onError) { + if (source === "!") + return "!"; + if (source[0] !== "!") { + onError(`Not a valid tag: ${source}`); + return null; + } + if (source[1] === "<") { + const verbatim = source.slice(2, -1); + if (verbatim === "!" || verbatim === "!!") { + onError(`Verbatim tags aren't resolved, so ${source} is invalid.`); + return null; + } + if (source[source.length - 1] !== ">") + onError("Verbatim tags must end with a >"); + return verbatim; + } + const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s); + if (!suffix) + onError(`The ${source} tag has no suffix`); + const prefix = this.tags[handle]; + if (prefix) { + try { + return prefix + decodeURIComponent(suffix); + } catch (error2) { + onError(String(error2)); + return null; + } + } + if (handle === "!") + return source; + onError(`Could not resolve tag: ${source}`); + return null; + } + /** + * Given a fully resolved tag, returns its printable string form, + * taking into account current tag prefixes and defaults. + */ + tagString(tag) { + for (const [handle, prefix] of Object.entries(this.tags)) { + if (tag.startsWith(prefix)) + return handle + escapeTagName(tag.substring(prefix.length)); + } + return tag[0] === "!" ? tag : `!<${tag}>`; + } + toString(doc) { + const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : []; + const tagEntries = Object.entries(this.tags); + let tagNames; + if (doc && tagEntries.length > 0 && isNode(doc.contents)) { + const tags6 = {}; + visit(doc.contents, (_key, node) => { + if (isNode(node) && node.tag) + tags6[node.tag] = true; + }); + tagNames = Object.keys(tags6); + } else + tagNames = []; + for (const [handle, prefix] of tagEntries) { + if (handle === "!!" && prefix === "tag:yaml.org,2002:") + continue; + if (!doc || tagNames.some((tn) => tn.startsWith(prefix))) + lines.push(`%TAG ${handle} ${prefix}`); + } + return lines.join("\n"); + } + }; + Directives.defaultYaml = { explicit: false, version: "1.2" }; + Directives.defaultTags = { "!!": "tag:yaml.org,2002:" }; + } +}); + +// node_modules/yaml/browser/dist/doc/anchors.js +function anchorIsValid(anchor) { + if (/[\x00-\x19\s,[\]{}]/.test(anchor)) { + const sa = JSON.stringify(anchor); + const msg = `Anchor must not contain whitespace or control characters: ${sa}`; + throw new Error(msg); + } + return true; +} +function anchorNames(root2) { + const anchors = /* @__PURE__ */ new Set(); + visit(root2, { + Value(_key, node) { + if (node.anchor) + anchors.add(node.anchor); + } + }); + return anchors; +} +function findNewAnchor(prefix, exclude) { + for (let i7 = 1; true; ++i7) { + const name2 = `${prefix}${i7}`; + if (!exclude.has(name2)) + return name2; + } +} +function createNodeAnchors(doc, prefix) { + const aliasObjects = []; + const sourceObjects = /* @__PURE__ */ new Map(); + let prevAnchors = null; + return { + onAnchor: (source) => { + aliasObjects.push(source); + prevAnchors ?? (prevAnchors = anchorNames(doc)); + const anchor = findNewAnchor(prefix, prevAnchors); + prevAnchors.add(anchor); + return anchor; + }, + /** + * With circular references, the source node is only resolved after all + * of its child nodes are. This is why anchors are set only after all of + * the nodes have been created. + */ + setAnchors: () => { + for (const source of aliasObjects) { + const ref = sourceObjects.get(source); + if (typeof ref === "object" && ref.anchor && (isScalar(ref.node) || isCollection(ref.node))) { + ref.node.anchor = ref.anchor; + } else { + const error2 = new Error("Failed to resolve repeated object (this should not happen)"); + error2.source = source; + throw error2; + } + } + }, + sourceObjects + }; +} +var init_anchors = __esm({ + "node_modules/yaml/browser/dist/doc/anchors.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_visit(); + } +}); + +// node_modules/yaml/browser/dist/doc/applyReviver.js +function applyReviver(reviver, obj, key, val) { + if (val && typeof val === "object") { + if (Array.isArray(val)) { + for (let i7 = 0, len = val.length; i7 < len; ++i7) { + const v0 = val[i7]; + const v1 = applyReviver(reviver, val, String(i7), v0); + if (v1 === void 0) + delete val[i7]; + else if (v1 !== v0) + val[i7] = v1; + } + } else if (val instanceof Map) { + for (const k6 of Array.from(val.keys())) { + const v0 = val.get(k6); + const v1 = applyReviver(reviver, val, k6, v0); + if (v1 === void 0) + val.delete(k6); + else if (v1 !== v0) + val.set(k6, v1); + } + } else if (val instanceof Set) { + for (const v0 of Array.from(val)) { + const v1 = applyReviver(reviver, val, v0, v0); + if (v1 === void 0) + val.delete(v0); + else if (v1 !== v0) { + val.delete(v0); + val.add(v1); + } + } + } else { + for (const [k6, v0] of Object.entries(val)) { + const v1 = applyReviver(reviver, val, k6, v0); + if (v1 === void 0) + delete val[k6]; + else if (v1 !== v0) + val[k6] = v1; + } + } + } + return reviver.call(obj, key, val); +} +var init_applyReviver = __esm({ + "node_modules/yaml/browser/dist/doc/applyReviver.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/nodes/toJS.js +function toJS(value2, arg, ctx) { + if (Array.isArray(value2)) + return value2.map((v8, i7) => toJS(v8, String(i7), ctx)); + if (value2 && typeof value2.toJSON === "function") { + if (!ctx || !hasAnchor(value2)) + return value2.toJSON(arg, ctx); + const data = { aliasCount: 0, count: 1, res: void 0 }; + ctx.anchors.set(value2, data); + ctx.onCreate = (res2) => { + data.res = res2; + delete ctx.onCreate; + }; + const res = value2.toJSON(arg, ctx); + if (ctx.onCreate) + ctx.onCreate(res); + return res; + } + if (typeof value2 === "bigint" && !ctx?.keep) + return Number(value2); + return value2; +} +var init_toJS = __esm({ + "node_modules/yaml/browser/dist/nodes/toJS.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + } +}); + +// node_modules/yaml/browser/dist/nodes/Node.js +var NodeBase; +var init_Node = __esm({ + "node_modules/yaml/browser/dist/nodes/Node.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_applyReviver(); + init_identity(); + init_toJS(); + NodeBase = class { + constructor(type3) { + Object.defineProperty(this, NODE_TYPE, { value: type3 }); + } + /** Create a copy of this node. */ + clone() { + const copy4 = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (this.range) + copy4.range = this.range.slice(); + return copy4; + } + /** A plain JavaScript representation of this node. */ + toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + if (!isDocument(doc)) + throw new TypeError("A document argument is required"); + const ctx = { + anchors: /* @__PURE__ */ new Map(), + doc, + keep: true, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 + }; + const res = toJS(this, "", ctx); + if (typeof onAnchor === "function") + for (const { count: count2, res: res2 } of ctx.anchors.values()) + onAnchor(res2, count2); + return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res; + } + }; + } +}); + +// node_modules/yaml/browser/dist/nodes/Alias.js +function getAliasCount(doc, node, anchors) { + if (isAlias(node)) { + const source = node.resolve(doc); + const anchor = anchors && source && anchors.get(source); + return anchor ? anchor.count * anchor.aliasCount : 0; + } else if (isCollection(node)) { + let count2 = 0; + for (const item of node.items) { + const c7 = getAliasCount(doc, item, anchors); + if (c7 > count2) + count2 = c7; + } + return count2; + } else if (isPair(node)) { + const kc = getAliasCount(doc, node.key, anchors); + const vc = getAliasCount(doc, node.value, anchors); + return Math.max(kc, vc); + } + return 1; +} +var Alias; +var init_Alias = __esm({ + "node_modules/yaml/browser/dist/nodes/Alias.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_anchors(); + init_visit(); + init_identity(); + init_Node(); + init_toJS(); + Alias = class extends NodeBase { + constructor(source) { + super(ALIAS); + this.source = source; + Object.defineProperty(this, "tag", { + set() { + throw new Error("Alias nodes cannot have tags"); + } + }); + } + /** + * Resolve the value of this alias within `doc`, finding the last + * instance of the `source` anchor before this node. + */ + resolve(doc, ctx) { + let nodes; + if (ctx?.aliasResolveCache) { + nodes = ctx.aliasResolveCache; + } else { + nodes = []; + visit(doc, { + Node: (_key, node) => { + if (isAlias(node) || hasAnchor(node)) + nodes.push(node); + } + }); + if (ctx) + ctx.aliasResolveCache = nodes; + } + let found = void 0; + for (const node of nodes) { + if (node === this) + break; + if (node.anchor === this.source) + found = node; + } + return found; + } + toJSON(_arg, ctx) { + if (!ctx) + return { source: this.source }; + const { anchors, doc, maxAliasCount } = ctx; + const source = this.resolve(doc, ctx); + if (!source) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new ReferenceError(msg); + } + let data = anchors.get(source); + if (!data) { + toJS(source, null, ctx); + data = anchors.get(source); + } + if (!data || data.res === void 0) { + const msg = "This should not happen: Alias anchor was not resolved?"; + throw new ReferenceError(msg); + } + if (maxAliasCount >= 0) { + data.count += 1; + if (data.aliasCount === 0) + data.aliasCount = getAliasCount(doc, source, anchors); + if (data.count * data.aliasCount > maxAliasCount) { + const msg = "Excessive alias count indicates a resource exhaustion attack"; + throw new ReferenceError(msg); + } + } + return data.res; + } + toString(ctx, _onComment, _onChompKeep) { + const src = `*${this.source}`; + if (ctx) { + anchorIsValid(this.source); + if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) { + const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`; + throw new Error(msg); + } + if (ctx.implicitKey) + return `${src} `; + } + return src; + } + }; + } +}); + +// node_modules/yaml/browser/dist/nodes/Scalar.js +var isScalarValue, Scalar; +var init_Scalar = __esm({ + "node_modules/yaml/browser/dist/nodes/Scalar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Node(); + init_toJS(); + isScalarValue = (value2) => !value2 || typeof value2 !== "function" && typeof value2 !== "object"; + Scalar = class extends NodeBase { + constructor(value2) { + super(SCALAR); + this.value = value2; + } + toJSON(arg, ctx) { + return ctx?.keep ? this.value : toJS(this.value, arg, ctx); + } + toString() { + return String(this.value); + } + }; + Scalar.BLOCK_FOLDED = "BLOCK_FOLDED"; + Scalar.BLOCK_LITERAL = "BLOCK_LITERAL"; + Scalar.PLAIN = "PLAIN"; + Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE"; + Scalar.QUOTE_SINGLE = "QUOTE_SINGLE"; + } +}); + +// node_modules/yaml/browser/dist/doc/createNode.js +function findTagObject(value2, tagName, tags6) { + if (tagName) { + const match = tags6.filter((t8) => t8.tag === tagName); + const tagObj = match.find((t8) => !t8.format) ?? match[0]; + if (!tagObj) + throw new Error(`Tag ${tagName} not found`); + return tagObj; + } + return tags6.find((t8) => t8.identify?.(value2) && !t8.format); +} +function createNode(value2, tagName, ctx) { + if (isDocument(value2)) + value2 = value2.contents; + if (isNode(value2)) + return value2; + if (isPair(value2)) { + const map4 = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx); + map4.items.push(value2); + return map4; + } + if (value2 instanceof String || value2 instanceof Number || value2 instanceof Boolean || typeof BigInt !== "undefined" && value2 instanceof BigInt) { + value2 = value2.valueOf(); + } + const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema8, sourceObjects } = ctx; + let ref = void 0; + if (aliasDuplicateObjects && value2 && typeof value2 === "object") { + ref = sourceObjects.get(value2); + if (ref) { + ref.anchor ?? (ref.anchor = onAnchor(value2)); + return new Alias(ref.anchor); + } else { + ref = { anchor: null, node: null }; + sourceObjects.set(value2, ref); + } + } + if (tagName?.startsWith("!!")) + tagName = defaultTagPrefix + tagName.slice(2); + let tagObj = findTagObject(value2, tagName, schema8.tags); + if (!tagObj) { + if (value2 && typeof value2.toJSON === "function") { + value2 = value2.toJSON(); + } + if (!value2 || typeof value2 !== "object") { + const node2 = new Scalar(value2); + if (ref) + ref.node = node2; + return node2; + } + tagObj = value2 instanceof Map ? schema8[MAP] : Symbol.iterator in Object(value2) ? schema8[SEQ] : schema8[MAP]; + } + if (onTagObj) { + onTagObj(tagObj); + delete ctx.onTagObj; + } + const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value2, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value2, ctx) : new Scalar(value2); + if (tagName) + node.tag = tagName; + else if (!tagObj.default) + node.tag = tagObj.tag; + if (ref) + ref.node = node; + return node; +} +var defaultTagPrefix; +var init_createNode = __esm({ + "node_modules/yaml/browser/dist/doc/createNode.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Alias(); + init_identity(); + init_Scalar(); + defaultTagPrefix = "tag:yaml.org,2002:"; + } +}); + +// node_modules/yaml/browser/dist/nodes/Collection.js +function collectionFromPath(schema8, path2, value2) { + let v8 = value2; + for (let i7 = path2.length - 1; i7 >= 0; --i7) { + const k6 = path2[i7]; + if (typeof k6 === "number" && Number.isInteger(k6) && k6 >= 0) { + const a7 = []; + a7[k6] = v8; + v8 = a7; + } else { + v8 = /* @__PURE__ */ new Map([[k6, v8]]); + } + } + return createNode(v8, void 0, { + aliasDuplicateObjects: false, + keepUndefined: false, + onAnchor: () => { + throw new Error("This should not happen, please report a bug."); + }, + schema: schema8, + sourceObjects: /* @__PURE__ */ new Map() + }); +} +var isEmptyPath, Collection; +var init_Collection = __esm({ + "node_modules/yaml/browser/dist/nodes/Collection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createNode(); + init_identity(); + init_Node(); + isEmptyPath = (path2) => path2 == null || typeof path2 === "object" && !!path2[Symbol.iterator]().next().done; + Collection = class extends NodeBase { + constructor(type3, schema8) { + super(type3); + Object.defineProperty(this, "schema", { + value: schema8, + configurable: true, + enumerable: false, + writable: true + }); + } + /** + * Create a copy of this collection. + * + * @param schema - If defined, overwrites the original's schema + */ + clone(schema8) { + const copy4 = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this)); + if (schema8) + copy4.schema = schema8; + copy4.items = copy4.items.map((it2) => isNode(it2) || isPair(it2) ? it2.clone(schema8) : it2); + if (this.range) + copy4.range = this.range.slice(); + return copy4; + } + /** + * Adds a value to the collection. For `!!map` and `!!omap` the value must + * be a Pair instance or a `{ key, value }` object, which may not have a key + * that already exists in the map. + */ + addIn(path2, value2) { + if (isEmptyPath(path2)) + this.add(value2); + else { + const [key, ...rest2] = path2; + const node = this.get(key, true); + if (isCollection(node)) + node.addIn(rest2, value2); + else if (node === void 0 && this.schema) + this.set(key, collectionFromPath(this.schema, rest2, value2)); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`); + } + } + /** + * Removes a value from the collection. + * @returns `true` if the item was found and removed. + */ + deleteIn(path2) { + const [key, ...rest2] = path2; + if (rest2.length === 0) + return this.delete(key); + const node = this.get(key, true); + if (isCollection(node)) + return node.deleteIn(rest2); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`); + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path2, keepScalar) { + const [key, ...rest2] = path2; + const node = this.get(key, true); + if (rest2.length === 0) + return !keepScalar && isScalar(node) ? node.value : node; + else + return isCollection(node) ? node.getIn(rest2, keepScalar) : void 0; + } + hasAllNullValues(allowScalar) { + return this.items.every((node) => { + if (!isPair(node)) + return false; + const n7 = node.value; + return n7 == null || allowScalar && isScalar(n7) && n7.value == null && !n7.commentBefore && !n7.comment && !n7.tag; + }); + } + /** + * Checks if the collection includes a value with the key `key`. + */ + hasIn(path2) { + const [key, ...rest2] = path2; + if (rest2.length === 0) + return this.has(key); + const node = this.get(key, true); + return isCollection(node) ? node.hasIn(rest2) : false; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path2, value2) { + const [key, ...rest2] = path2; + if (rest2.length === 0) { + this.set(key, value2); + } else { + const node = this.get(key, true); + if (isCollection(node)) + node.setIn(rest2, value2); + else if (node === void 0 && this.schema) + this.set(key, collectionFromPath(this.schema, rest2, value2)); + else + throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest2}`); + } + } + }; + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyComment.js +function indentComment(comment, indent) { + if (/^\n+$/.test(comment)) + return comment.substring(1); + return indent ? comment.replace(/^(?! *$)/gm, indent) : comment; +} +var stringifyComment, lineComment; +var init_stringifyComment = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyComment.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stringifyComment = (str2) => str2.replace(/^(?!$)(?: $)?/gm, "#"); + lineComment = (str2, indent, comment) => str2.endsWith("\n") ? indentComment(comment, indent) : comment.includes("\n") ? "\n" + indentComment(comment, indent) : (str2.endsWith(" ") ? "" : " ") + comment; + } +}); + +// node_modules/yaml/browser/dist/stringify/foldFlowLines.js +function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { + if (!lineWidth || lineWidth < 0) + return text; + if (lineWidth < minContentWidth) + minContentWidth = 0; + const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); + if (text.length <= endStep) + return text; + const folds = []; + const escapedFolds = {}; + let end = lineWidth - indent.length; + if (typeof indentAtStart === "number") { + if (indentAtStart > lineWidth - Math.max(2, minContentWidth)) + folds.push(0); + else + end = lineWidth - indentAtStart; + } + let split3 = void 0; + let prev = void 0; + let overflow = false; + let i7 = -1; + let escStart = -1; + let escEnd = -1; + if (mode === FOLD_BLOCK) { + i7 = consumeMoreIndentedLines(text, i7, indent.length); + if (i7 !== -1) + end = i7 + endStep; + } + for (let ch; ch = text[i7 += 1]; ) { + if (mode === FOLD_QUOTED && ch === "\\") { + escStart = i7; + switch (text[i7 + 1]) { + case "x": + i7 += 3; + break; + case "u": + i7 += 5; + break; + case "U": + i7 += 9; + break; + default: + i7 += 1; + } + escEnd = i7; + } + if (ch === "\n") { + if (mode === FOLD_BLOCK) + i7 = consumeMoreIndentedLines(text, i7, indent.length); + end = i7 + indent.length + endStep; + split3 = void 0; + } else { + if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") { + const next = text[i7 + 1]; + if (next && next !== " " && next !== "\n" && next !== " ") + split3 = i7; + } + if (i7 >= end) { + if (split3) { + folds.push(split3); + end = split3 + endStep; + split3 = void 0; + } else if (mode === FOLD_QUOTED) { + while (prev === " " || prev === " ") { + prev = ch; + ch = text[i7 += 1]; + overflow = true; + } + const j6 = i7 > escEnd + 1 ? i7 - 2 : escStart - 1; + if (escapedFolds[j6]) + return text; + folds.push(j6); + escapedFolds[j6] = true; + end = j6 + endStep; + split3 = void 0; + } else { + overflow = true; + } + } + } + prev = ch; + } + if (overflow && onOverflow) + onOverflow(); + if (folds.length === 0) + return text; + if (onFold) + onFold(); + let res = text.slice(0, folds[0]); + for (let i8 = 0; i8 < folds.length; ++i8) { + const fold = folds[i8]; + const end2 = folds[i8 + 1] || text.length; + if (fold === 0) + res = ` +${indent}${text.slice(0, end2)}`; + else { + if (mode === FOLD_QUOTED && escapedFolds[fold]) + res += `${text[fold]}\\`; + res += ` +${indent}${text.slice(fold + 1, end2)}`; + } + } + return res; +} +function consumeMoreIndentedLines(text, i7, indent) { + let end = i7; + let start = i7 + 1; + let ch = text[start]; + while (ch === " " || ch === " ") { + if (i7 < start + indent) { + ch = text[++i7]; + } else { + do { + ch = text[++i7]; + } while (ch && ch !== "\n"); + end = i7; + start = i7 + 1; + ch = text[start]; + } + } + return end; +} +var FOLD_FLOW, FOLD_BLOCK, FOLD_QUOTED; +var init_foldFlowLines = __esm({ + "node_modules/yaml/browser/dist/stringify/foldFlowLines.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + FOLD_FLOW = "flow"; + FOLD_BLOCK = "block"; + FOLD_QUOTED = "quoted"; + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyString.js +function lineLengthOverLimit(str2, lineWidth, indentLength) { + if (!lineWidth || lineWidth < 0) + return false; + const limit = lineWidth - indentLength; + const strLen = str2.length; + if (strLen <= limit) + return false; + for (let i7 = 0, start = 0; i7 < strLen; ++i7) { + if (str2[i7] === "\n") { + if (i7 - start > limit) + return true; + start = i7 + 1; + if (strLen - start <= limit) + return false; + } + } + return true; +} +function doubleQuotedString(value2, ctx) { + const json2 = JSON.stringify(value2); + if (ctx.options.doubleQuotedAsJSON) + return json2; + const { implicitKey } = ctx; + const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength; + const indent = ctx.indent || (containsDocumentMarker(value2) ? " " : ""); + let str2 = ""; + let start = 0; + for (let i7 = 0, ch = json2[i7]; ch; ch = json2[++i7]) { + if (ch === " " && json2[i7 + 1] === "\\" && json2[i7 + 2] === "n") { + str2 += json2.slice(start, i7) + "\\ "; + i7 += 1; + start = i7; + ch = "\\"; + } + if (ch === "\\") + switch (json2[i7 + 1]) { + case "u": + { + str2 += json2.slice(start, i7); + const code = json2.substr(i7 + 2, 4); + switch (code) { + case "0000": + str2 += "\\0"; + break; + case "0007": + str2 += "\\a"; + break; + case "000b": + str2 += "\\v"; + break; + case "001b": + str2 += "\\e"; + break; + case "0085": + str2 += "\\N"; + break; + case "00a0": + str2 += "\\_"; + break; + case "2028": + str2 += "\\L"; + break; + case "2029": + str2 += "\\P"; + break; + default: + if (code.substr(0, 2) === "00") + str2 += "\\x" + code.substr(2); + else + str2 += json2.substr(i7, 6); + } + i7 += 5; + start = i7 + 1; + } + break; + case "n": + if (implicitKey || json2[i7 + 2] === '"' || json2.length < minMultiLineLength) { + i7 += 1; + } else { + str2 += json2.slice(start, i7) + "\n\n"; + while (json2[i7 + 2] === "\\" && json2[i7 + 3] === "n" && json2[i7 + 4] !== '"') { + str2 += "\n"; + i7 += 2; + } + str2 += indent; + if (json2[i7 + 2] === " ") + str2 += "\\"; + i7 += 1; + start = i7 + 1; + } + break; + default: + i7 += 1; + } + } + str2 = start ? str2 + json2.slice(start) : json2; + return implicitKey ? str2 : foldFlowLines(str2, indent, FOLD_QUOTED, getFoldOptions(ctx, false)); +} +function singleQuotedString(value2, ctx) { + if (ctx.options.singleQuote === false || ctx.implicitKey && value2.includes("\n") || /[ \t]\n|\n[ \t]/.test(value2)) + return doubleQuotedString(value2, ctx); + const indent = ctx.indent || (containsDocumentMarker(value2) ? " " : ""); + const res = "'" + value2.replace(/'/g, "''").replace(/\n+/g, `$& +${indent}`) + "'"; + return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false)); +} +function quotedString(value2, ctx) { + const { singleQuote: singleQuote2 } = ctx.options; + let qs; + if (singleQuote2 === false) + qs = doubleQuotedString; + else { + const hasDouble = value2.includes('"'); + const hasSingle = value2.includes("'"); + if (hasDouble && !hasSingle) + qs = singleQuotedString; + else if (hasSingle && !hasDouble) + qs = doubleQuotedString; + else + qs = singleQuote2 ? singleQuotedString : doubleQuotedString; + } + return qs(value2, ctx); +} +function blockString({ comment, type: type3, value: value2 }, ctx, onComment, onChompKeep) { + const { blockQuote, commentString, lineWidth } = ctx.options; + if (!blockQuote || /\n[\t ]+$/.test(value2) || /^\s*$/.test(value2)) { + return quotedString(value2, ctx); + } + const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value2) ? " " : ""); + const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type3 === Scalar.BLOCK_FOLDED ? false : type3 === Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value2, lineWidth, indent.length); + if (!value2) + return literal ? "|\n" : ">\n"; + let chomp; + let endStart; + for (endStart = value2.length; endStart > 0; --endStart) { + const ch = value2[endStart - 1]; + if (ch !== "\n" && ch !== " " && ch !== " ") + break; + } + let end = value2.substring(endStart); + const endNlPos = end.indexOf("\n"); + if (endNlPos === -1) { + chomp = "-"; + } else if (value2 === end || endNlPos !== end.length - 1) { + chomp = "+"; + if (onChompKeep) + onChompKeep(); + } else { + chomp = ""; + } + if (end) { + value2 = value2.slice(0, -end.length); + if (end[end.length - 1] === "\n") + end = end.slice(0, -1); + end = end.replace(blockEndNewlines, `$&${indent}`); + } + let startWithSpace = false; + let startEnd; + let startNlPos = -1; + for (startEnd = 0; startEnd < value2.length; ++startEnd) { + const ch = value2[startEnd]; + if (ch === " ") + startWithSpace = true; + else if (ch === "\n") + startNlPos = startEnd; + else + break; + } + let start = value2.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd); + if (start) { + value2 = value2.substring(start.length); + start = start.replace(/\n+/g, `$&${indent}`); + } + const indentSize = indent ? "2" : "1"; + let header = (startWithSpace ? indentSize : "") + chomp; + if (comment) { + header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " ")); + if (onComment) + onComment(); + } + if (!literal) { + const foldedValue = value2.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`); + let literalFallback = false; + const foldOptions = getFoldOptions(ctx, true); + if (blockQuote !== "folded" && type3 !== Scalar.BLOCK_FOLDED) { + foldOptions.onOverflow = () => { + literalFallback = true; + }; + } + const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions); + if (!literalFallback) + return `>${header} +${indent}${body}`; + } + value2 = value2.replace(/\n+/g, `$&${indent}`); + return `|${header} +${indent}${start}${value2}${end}`; +} +function plainString(item, ctx, onComment, onChompKeep) { + const { type: type3, value: value2 } = item; + const { actualString, implicitKey, indent, indentStep, inFlow } = ctx; + if (implicitKey && value2.includes("\n") || inFlow && /[[\]{},]/.test(value2)) { + return quotedString(value2, ctx); + } + if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value2)) { + return implicitKey || inFlow || !value2.includes("\n") ? quotedString(value2, ctx) : blockString(item, ctx, onComment, onChompKeep); + } + if (!implicitKey && !inFlow && type3 !== Scalar.PLAIN && value2.includes("\n")) { + return blockString(item, ctx, onComment, onChompKeep); + } + if (containsDocumentMarker(value2)) { + if (indent === "") { + ctx.forceBlockIndent = true; + return blockString(item, ctx, onComment, onChompKeep); + } else if (implicitKey && indent === indentStep) { + return quotedString(value2, ctx); + } + } + const str2 = value2.replace(/\n+/g, `$& +${indent}`); + if (actualString) { + const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str2); + const { compat, tags: tags6 } = ctx.doc.schema; + if (tags6.some(test) || compat?.some(test)) + return quotedString(value2, ctx); + } + return implicitKey ? str2 : foldFlowLines(str2, indent, FOLD_FLOW, getFoldOptions(ctx, false)); +} +function stringifyString(item, ctx, onComment, onChompKeep) { + const { implicitKey, inFlow } = ctx; + const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) }); + let { type: type3 } = item; + if (type3 !== Scalar.QUOTE_DOUBLE) { + if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) + type3 = Scalar.QUOTE_DOUBLE; + } + const _stringify = (_type) => { + switch (_type) { + case Scalar.BLOCK_FOLDED: + case Scalar.BLOCK_LITERAL: + return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep); + case Scalar.QUOTE_DOUBLE: + return doubleQuotedString(ss.value, ctx); + case Scalar.QUOTE_SINGLE: + return singleQuotedString(ss.value, ctx); + case Scalar.PLAIN: + return plainString(ss, ctx, onComment, onChompKeep); + default: + return null; + } + }; + let res = _stringify(type3); + if (res === null) { + const { defaultKeyType, defaultStringType } = ctx.options; + const t8 = implicitKey && defaultKeyType || defaultStringType; + res = _stringify(t8); + if (res === null) + throw new Error(`Unsupported default string type ${t8}`); + } + return res; +} +var getFoldOptions, containsDocumentMarker, blockEndNewlines; +var init_stringifyString = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_foldFlowLines(); + getFoldOptions = (ctx, isBlock2) => ({ + indentAtStart: isBlock2 ? ctx.indent.length : ctx.indentAtStart, + lineWidth: ctx.options.lineWidth, + minContentWidth: ctx.options.minContentWidth + }); + containsDocumentMarker = (str2) => /^(%|---|\.\.\.)/m.test(str2); + try { + blockEndNewlines = new RegExp("(^|(? t8.tag === item.tag); + if (match.length > 0) + return match.find((t8) => t8.format === item.format) ?? match[0]; + } + let tagObj = void 0; + let obj; + if (isScalar(item)) { + obj = item.value; + let match = tags6.filter((t8) => t8.identify?.(obj)); + if (match.length > 1) { + const testMatch = match.filter((t8) => t8.test); + if (testMatch.length > 0) + match = testMatch; + } + tagObj = match.find((t8) => t8.format === item.format) ?? match.find((t8) => !t8.format); + } else { + obj = item; + tagObj = tags6.find((t8) => t8.nodeClass && obj instanceof t8.nodeClass); + } + if (!tagObj) { + const name2 = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj); + throw new Error(`Tag not resolved for ${name2} value`); + } + return tagObj; +} +function stringifyProps(node, tagObj, { anchors, doc }) { + if (!doc.directives) + return ""; + const props = []; + const anchor = (isScalar(node) || isCollection(node)) && node.anchor; + if (anchor && anchorIsValid(anchor)) { + anchors.add(anchor); + props.push(`&${anchor}`); + } + const tag = node.tag ?? (tagObj.default ? null : tagObj.tag); + if (tag) + props.push(doc.directives.tagString(tag)); + return props.join(" "); +} +function stringify(item, ctx, onComment, onChompKeep) { + if (isPair(item)) + return item.toString(ctx, onComment, onChompKeep); + if (isAlias(item)) { + if (ctx.doc.directives) + return item.toString(ctx); + if (ctx.resolvedAliases?.has(item)) { + throw new TypeError(`Cannot stringify circular structure without alias nodes`); + } else { + if (ctx.resolvedAliases) + ctx.resolvedAliases.add(item); + else + ctx.resolvedAliases = /* @__PURE__ */ new Set([item]); + item = item.resolve(ctx.doc); + } + } + let tagObj = void 0; + const node = isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o7) => tagObj = o7 }); + tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node)); + const props = stringifyProps(node, tagObj, ctx); + if (props.length > 0) + ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1; + const str2 = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : isScalar(node) ? stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep); + if (!props) + return str2; + return isScalar(node) || str2[0] === "{" || str2[0] === "[" ? `${props} ${str2}` : `${props} +${ctx.indent}${str2}`; +} +var init_stringify = __esm({ + "node_modules/yaml/browser/dist/stringify/stringify.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_anchors(); + init_identity(); + init_stringifyComment(); + init_stringifyString(); + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyPair.js +function stringifyPair({ key, value: value2 }, ctx, onComment, onChompKeep) { + const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx; + let keyComment = isNode(key) && key.comment || null; + if (simpleKeys) { + if (keyComment) { + throw new Error("With simple keys, key nodes cannot have comments"); + } + if (isCollection(key) || !isNode(key) && typeof key === "object") { + const msg = "With simple keys, collection cannot be used as a key value"; + throw new Error(msg); + } + } + let explicitKey = !simpleKeys && (!key || keyComment && value2 == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === "object")); + ctx = Object.assign({}, ctx, { + allNullValues: false, + implicitKey: !explicitKey && (simpleKeys || !allNullValues), + indent: indent + indentStep + }); + let keyCommentDone = false; + let chompKeep = false; + let str2 = stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true); + if (!explicitKey && !ctx.inFlow && str2.length > 1024) { + if (simpleKeys) + throw new Error("With simple keys, single line scalar must not span more than 1024 characters"); + explicitKey = true; + } + if (ctx.inFlow) { + if (allNullValues || value2 == null) { + if (keyCommentDone && onComment) + onComment(); + return str2 === "" ? "?" : explicitKey ? `? ${str2}` : str2; + } + } else if (allNullValues && !simpleKeys || value2 == null && explicitKey) { + str2 = `? ${str2}`; + if (keyComment && !keyCommentDone) { + str2 += lineComment(str2, ctx.indent, commentString(keyComment)); + } else if (chompKeep && onChompKeep) + onChompKeep(); + return str2; + } + if (keyCommentDone) + keyComment = null; + if (explicitKey) { + if (keyComment) + str2 += lineComment(str2, ctx.indent, commentString(keyComment)); + str2 = `? ${str2} +${indent}:`; + } else { + str2 = `${str2}:`; + if (keyComment) + str2 += lineComment(str2, ctx.indent, commentString(keyComment)); + } + let vsb, vcb, valueComment; + if (isNode(value2)) { + vsb = !!value2.spaceBefore; + vcb = value2.commentBefore; + valueComment = value2.comment; + } else { + vsb = false; + vcb = null; + valueComment = null; + if (value2 && typeof value2 === "object") + value2 = doc.createNode(value2); + } + ctx.implicitKey = false; + if (!explicitKey && !keyComment && isScalar(value2)) + ctx.indentAtStart = str2.length + 1; + chompKeep = false; + if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value2) && !value2.flow && !value2.tag && !value2.anchor) { + ctx.indent = ctx.indent.substring(2); + } + let valueCommentDone = false; + const valueStr = stringify(value2, ctx, () => valueCommentDone = true, () => chompKeep = true); + let ws = " "; + if (keyComment || vsb || vcb) { + ws = vsb ? "\n" : ""; + if (vcb) { + const cs = commentString(vcb); + ws += ` +${indentComment(cs, ctx.indent)}`; + } + if (valueStr === "" && !ctx.inFlow) { + if (ws === "\n") + ws = "\n\n"; + } else { + ws += ` +${ctx.indent}`; + } + } else if (!explicitKey && isCollection(value2)) { + const vs0 = valueStr[0]; + const nl0 = valueStr.indexOf("\n"); + const hasNewline = nl0 !== -1; + const flow2 = ctx.inFlow ?? value2.flow ?? value2.items.length === 0; + if (hasNewline || !flow2) { + let hasPropsLine = false; + if (hasNewline && (vs0 === "&" || vs0 === "!")) { + let sp0 = valueStr.indexOf(" "); + if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") { + sp0 = valueStr.indexOf(" ", sp0 + 1); + } + if (sp0 === -1 || nl0 < sp0) + hasPropsLine = true; + } + if (!hasPropsLine) + ws = ` +${ctx.indent}`; + } + } else if (valueStr === "" || valueStr[0] === "\n") { + ws = ""; + } + str2 += ws + valueStr; + if (ctx.inFlow) { + if (valueCommentDone && onComment) + onComment(); + } else if (valueComment && !valueCommentDone) { + str2 += lineComment(str2, ctx.indent, commentString(valueComment)); + } else if (chompKeep && onChompKeep) { + onChompKeep(); + } + return str2; +} +var init_stringifyPair = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyPair.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Scalar(); + init_stringify(); + init_stringifyComment(); + } +}); + +// node_modules/yaml/browser/dist/log.js +function warn(logLevel, warning) { + if (logLevel === "debug" || logLevel === "warn") { + console.warn(warning); + } +} +var init_log = __esm({ + "node_modules/yaml/browser/dist/log.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +function addMergeToJSMap(ctx, map4, value2) { + value2 = ctx && isAlias(value2) ? value2.resolve(ctx.doc) : value2; + if (isSeq(value2)) + for (const it2 of value2.items) + mergeValue(ctx, map4, it2); + else if (Array.isArray(value2)) + for (const it2 of value2) + mergeValue(ctx, map4, it2); + else + mergeValue(ctx, map4, value2); +} +function mergeValue(ctx, map4, value2) { + const source = ctx && isAlias(value2) ? value2.resolve(ctx.doc) : value2; + if (!isMap(source)) + throw new Error("Merge sources must be maps or map aliases"); + const srcMap = source.toJSON(null, ctx, Map); + for (const [key, value3] of srcMap) { + if (map4 instanceof Map) { + if (!map4.has(key)) + map4.set(key, value3); + } else if (map4 instanceof Set) { + map4.add(key); + } else if (!Object.prototype.hasOwnProperty.call(map4, key)) { + Object.defineProperty(map4, key, { + value: value3, + writable: true, + enumerable: true, + configurable: true + }); + } + } + return map4; +} +var MERGE_KEY, merge, isMergeKey; +var init_merge = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Scalar(); + MERGE_KEY = "<<"; + merge = { + identify: (value2) => value2 === MERGE_KEY || typeof value2 === "symbol" && value2.description === MERGE_KEY, + default: "key", + tag: "tag:yaml.org,2002:merge", + test: /^<<$/, + resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), { + addToJSMap: addMergeToJSMap + }), + stringify: () => MERGE_KEY + }; + isMergeKey = (ctx, key) => (merge.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge.tag && tag.default); + } +}); + +// node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +function addPairToJSMap(ctx, map4, { key, value: value2 }) { + if (isNode(key) && key.addToJSMap) + key.addToJSMap(ctx, map4, value2); + else if (isMergeKey(ctx, key)) + addMergeToJSMap(ctx, map4, value2); + else { + const jsKey = toJS(key, "", ctx); + if (map4 instanceof Map) { + map4.set(jsKey, toJS(value2, jsKey, ctx)); + } else if (map4 instanceof Set) { + map4.add(jsKey); + } else { + const stringKey = stringifyKey(key, jsKey, ctx); + const jsValue = toJS(value2, stringKey, ctx); + if (stringKey in map4) + Object.defineProperty(map4, stringKey, { + value: jsValue, + writable: true, + enumerable: true, + configurable: true + }); + else + map4[stringKey] = jsValue; + } + } + return map4; +} +function stringifyKey(key, jsKey, ctx) { + if (jsKey === null) + return ""; + if (typeof jsKey !== "object") + return String(jsKey); + if (isNode(key) && ctx?.doc) { + const strCtx = createStringifyContext(ctx.doc, {}); + strCtx.anchors = /* @__PURE__ */ new Set(); + for (const node of ctx.anchors.keys()) + strCtx.anchors.add(node.anchor); + strCtx.inFlow = true; + strCtx.inStringifyKey = true; + const strKey = key.toString(strCtx); + if (!ctx.mapKeyWarned) { + let jsonStr = JSON.stringify(strKey); + if (jsonStr.length > 40) + jsonStr = jsonStr.substring(0, 36) + '..."'; + 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; + } + return JSON.stringify(jsKey); +} +var init_addPairToJSMap = __esm({ + "node_modules/yaml/browser/dist/nodes/addPairToJSMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_log(); + init_merge(); + init_stringify(); + init_identity(); + init_toJS(); + } +}); + +// node_modules/yaml/browser/dist/nodes/Pair.js +function createPair(key, value2, ctx) { + const k6 = createNode(key, void 0, ctx); + const v8 = createNode(value2, void 0, ctx); + return new Pair(k6, v8); +} +var Pair; +var init_Pair = __esm({ + "node_modules/yaml/browser/dist/nodes/Pair.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createNode(); + init_stringifyPair(); + init_addPairToJSMap(); + init_identity(); + Pair = class _Pair { + constructor(key, value2 = null) { + Object.defineProperty(this, NODE_TYPE, { value: PAIR }); + this.key = key; + this.value = value2; + } + clone(schema8) { + let { key, value: value2 } = this; + if (isNode(key)) + key = key.clone(schema8); + if (isNode(value2)) + value2 = value2.clone(schema8); + return new _Pair(key, value2); + } + toJSON(_6, ctx) { + const pair = ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; + return addPairToJSMap(ctx, pair, this); + } + toString(ctx, onComment, onChompKeep) { + return ctx?.doc ? stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this); + } + }; + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyCollection.js +function stringifyCollection(collection, ctx, options) { + const flow2 = ctx.inFlow ?? collection.flow; + const stringify5 = flow2 ? stringifyFlowCollection : stringifyBlockCollection; + return stringify5(collection, ctx, options); +} +function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) { + const { indent, options: { commentString } } = ctx; + const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null }); + let chompKeep = false; + const lines = []; + for (let i7 = 0; i7 < items.length; ++i7) { + const item = items[i7]; + let comment2 = null; + if (isNode(item)) { + if (!chompKeep && item.spaceBefore) + lines.push(""); + addCommentBefore(ctx, lines, item.commentBefore, chompKeep); + if (item.comment) + comment2 = item.comment; + } else if (isPair(item)) { + const ik = isNode(item.key) ? item.key : null; + if (ik) { + if (!chompKeep && ik.spaceBefore) + lines.push(""); + addCommentBefore(ctx, lines, ik.commentBefore, chompKeep); + } + } + chompKeep = false; + let str3 = stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true); + if (comment2) + str3 += lineComment(str3, itemIndent, commentString(comment2)); + if (chompKeep && comment2) + chompKeep = false; + lines.push(blockItemPrefix + str3); + } + let str2; + if (lines.length === 0) { + str2 = flowChars.start + flowChars.end; + } else { + str2 = lines[0]; + for (let i7 = 1; i7 < lines.length; ++i7) { + const line = lines[i7]; + str2 += line ? ` +${indent}${line}` : "\n"; + } + } + if (comment) { + str2 += "\n" + indentComment(commentString(comment), indent); + if (onComment) + onComment(); + } else if (chompKeep && onChompKeep) + onChompKeep(); + return str2; +} +function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) { + const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx; + itemIndent += indentStep; + const itemCtx = Object.assign({}, ctx, { + indent: itemIndent, + inFlow: true, + type: null + }); + let reqNewline = false; + let linesAtValue = 0; + const lines = []; + for (let i7 = 0; i7 < items.length; ++i7) { + const item = items[i7]; + let comment = null; + if (isNode(item)) { + if (item.spaceBefore) + lines.push(""); + addCommentBefore(ctx, lines, item.commentBefore, false); + if (item.comment) + comment = item.comment; + } else if (isPair(item)) { + const ik = isNode(item.key) ? item.key : null; + if (ik) { + if (ik.spaceBefore) + lines.push(""); + addCommentBefore(ctx, lines, ik.commentBefore, false); + if (ik.comment) + reqNewline = true; + } + const iv = isNode(item.value) ? item.value : null; + if (iv) { + if (iv.comment) + comment = iv.comment; + if (iv.commentBefore) + reqNewline = true; + } else if (item.value == null && ik?.comment) { + comment = ik.comment; + } + } + if (comment) + reqNewline = true; + let str2 = stringify(item, itemCtx, () => comment = null); + if (i7 < items.length - 1) + str2 += ","; + if (comment) + str2 += lineComment(str2, itemIndent, commentString(comment)); + if (!reqNewline && (lines.length > linesAtValue || str2.includes("\n"))) + reqNewline = true; + lines.push(str2); + linesAtValue = lines.length; + } + const { start, end } = flowChars; + if (lines.length === 0) { + return start + end; + } else { + if (!reqNewline) { + const len = lines.reduce((sum2, line) => sum2 + line.length + 2, 2); + reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth; + } + if (reqNewline) { + let str2 = start; + for (const line of lines) + str2 += line ? ` +${indentStep}${indent}${line}` : "\n"; + return `${str2} +${indent}${end}`; + } else { + return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`; + } + } +} +function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) { + if (comment && chompKeep) + comment = comment.replace(/^\n+/, ""); + if (comment) { + const ic = indentComment(commentString(comment), indent); + lines.push(ic.trimStart()); + } +} +var init_stringifyCollection = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyCollection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_stringify(); + init_stringifyComment(); + } +}); + +// node_modules/yaml/browser/dist/nodes/YAMLMap.js +function findPair(items, key) { + const k6 = isScalar(key) ? key.value : key; + for (const it2 of items) { + if (isPair(it2)) { + if (it2.key === key || it2.key === k6) + return it2; + if (isScalar(it2.key) && it2.key.value === k6) + return it2; + } + } + return void 0; +} +var YAMLMap; +var init_YAMLMap = __esm({ + "node_modules/yaml/browser/dist/nodes/YAMLMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_stringifyCollection(); + init_addPairToJSMap(); + init_Collection(); + init_identity(); + init_Pair(); + init_Scalar(); + YAMLMap = class extends Collection { + static get tagName() { + return "tag:yaml.org,2002:map"; + } + constructor(schema8) { + super(MAP, schema8); + this.items = []; + } + /** + * A generic collection parsing method that can be extended + * to other node classes that inherit from YAMLMap + */ + static from(schema8, obj, ctx) { + const { keepUndefined, replacer } = ctx; + const map4 = new this(schema8); + const add2 = (key, value2) => { + if (typeof replacer === "function") + value2 = replacer.call(obj, key, value2); + else if (Array.isArray(replacer) && !replacer.includes(key)) + return; + if (value2 !== void 0 || keepUndefined) + map4.items.push(createPair(key, value2, ctx)); + }; + if (obj instanceof Map) { + for (const [key, value2] of obj) + add2(key, value2); + } else if (obj && typeof obj === "object") { + for (const key of Object.keys(obj)) + add2(key, obj[key]); + } + if (typeof schema8.sortMapEntries === "function") { + map4.items.sort(schema8.sortMapEntries); + } + return map4; + } + /** + * Adds a value to the collection. + * + * @param overwrite - If not set `true`, using a key that is already in the + * collection will throw. Otherwise, overwrites the previous value. + */ + add(pair, overwrite) { + let _pair; + if (isPair(pair)) + _pair = pair; + else if (!pair || typeof pair !== "object" || !("key" in pair)) { + _pair = new Pair(pair, pair?.value); + } else + _pair = new Pair(pair.key, pair.value); + const prev = findPair(this.items, _pair.key); + const sortEntries = this.schema?.sortMapEntries; + if (prev) { + if (!overwrite) + throw new Error(`Key ${_pair.key} already set`); + if (isScalar(prev.value) && isScalarValue(_pair.value)) + prev.value.value = _pair.value; + else + prev.value = _pair.value; + } else if (sortEntries) { + const i7 = this.items.findIndex((item) => sortEntries(_pair, item) < 0); + if (i7 === -1) + this.items.push(_pair); + else + this.items.splice(i7, 0, _pair); + } else { + this.items.push(_pair); + } + } + delete(key) { + const it2 = findPair(this.items, key); + if (!it2) + return false; + const del = this.items.splice(this.items.indexOf(it2), 1); + return del.length > 0; + } + get(key, keepScalar) { + const it2 = findPair(this.items, key); + const node = it2?.value; + return (!keepScalar && isScalar(node) ? node.value : node) ?? void 0; + } + has(key) { + return !!findPair(this.items, key); + } + set(key, value2) { + this.add(new Pair(key, value2), true); + } + /** + * @param ctx - Conversion context, originally set in Document#toJS() + * @param {Class} Type - If set, forces the returned collection type + * @returns Instance of Type, Map, or Object + */ + toJSON(_6, ctx, Type3) { + const map4 = Type3 ? new Type3() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {}; + if (ctx?.onCreate) + ctx.onCreate(map4); + for (const item of this.items) + addPairToJSMap(ctx, map4, item); + return map4; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + for (const item of this.items) { + if (!isPair(item)) + throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`); + } + if (!ctx.allNullValues && this.hasAllNullValues(false)) + ctx = Object.assign({}, ctx, { allNullValues: true }); + return stringifyCollection(this, ctx, { + blockItemPrefix: "", + flowChars: { start: "{", end: "}" }, + itemIndent: ctx.indent || "", + onChompKeep, + onComment + }); + } + }; + } +}); + +// node_modules/yaml/browser/dist/schema/common/map.js +var map; +var init_map = __esm({ + "node_modules/yaml/browser/dist/schema/common/map.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_YAMLMap(); + map = { + collection: "map", + default: true, + nodeClass: YAMLMap, + tag: "tag:yaml.org,2002:map", + resolve(map4, onError) { + if (!isMap(map4)) + onError("Expected a mapping for this tag"); + return map4; + }, + createNode: (schema8, obj, ctx) => YAMLMap.from(schema8, obj, ctx) + }; + } +}); + +// node_modules/yaml/browser/dist/nodes/YAMLSeq.js +function asItemIndex(key) { + let idx = isScalar(key) ? key.value : key; + if (idx && typeof idx === "string") + idx = Number(idx); + return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null; +} +var YAMLSeq; +var init_YAMLSeq = __esm({ + "node_modules/yaml/browser/dist/nodes/YAMLSeq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createNode(); + init_stringifyCollection(); + init_Collection(); + init_identity(); + init_Scalar(); + init_toJS(); + YAMLSeq = class extends Collection { + static get tagName() { + return "tag:yaml.org,2002:seq"; + } + constructor(schema8) { + super(SEQ, schema8); + this.items = []; + } + add(value2) { + this.items.push(value2); + } + /** + * Removes a value from the collection. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + * + * @returns `true` if the item was found and removed. + */ + delete(key) { + const idx = asItemIndex(key); + if (typeof idx !== "number") + return false; + const del = this.items.splice(idx, 1); + return del.length > 0; + } + get(key, keepScalar) { + const idx = asItemIndex(key); + if (typeof idx !== "number") + return void 0; + const it2 = this.items[idx]; + return !keepScalar && isScalar(it2) ? it2.value : it2; + } + /** + * Checks if the collection includes a value with the key `key`. + * + * `key` must contain a representation of an integer for this to succeed. + * It may be wrapped in a `Scalar`. + */ + has(key) { + const idx = asItemIndex(key); + return typeof idx === "number" && idx < this.items.length; + } + /** + * Sets a value in this collection. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + * + * If `key` does not contain a representation of an integer, this will throw. + * It may be wrapped in a `Scalar`. + */ + set(key, value2) { + const idx = asItemIndex(key); + if (typeof idx !== "number") + throw new Error(`Expected a valid index, not ${key}.`); + const prev = this.items[idx]; + if (isScalar(prev) && isScalarValue(value2)) + prev.value = value2; + else + this.items[idx] = value2; + } + toJSON(_6, ctx) { + const seq3 = []; + if (ctx?.onCreate) + ctx.onCreate(seq3); + let i7 = 0; + for (const item of this.items) + seq3.push(toJS(item, String(i7++), ctx)); + return seq3; + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + return stringifyCollection(this, ctx, { + blockItemPrefix: "- ", + flowChars: { start: "[", end: "]" }, + itemIndent: (ctx.indent || "") + " ", + onChompKeep, + onComment + }); + } + static from(schema8, obj, ctx) { + const { replacer } = ctx; + const seq3 = new this(schema8); + if (obj && Symbol.iterator in Object(obj)) { + let i7 = 0; + for (let it2 of obj) { + if (typeof replacer === "function") { + const key = obj instanceof Set ? it2 : String(i7++); + it2 = replacer.call(obj, key, it2); + } + seq3.items.push(createNode(it2, void 0, ctx)); + } + } + return seq3; + } + }; + } +}); + +// node_modules/yaml/browser/dist/schema/common/seq.js +var seq; +var init_seq = __esm({ + "node_modules/yaml/browser/dist/schema/common/seq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_YAMLSeq(); + seq = { + collection: "seq", + default: true, + nodeClass: YAMLSeq, + tag: "tag:yaml.org,2002:seq", + resolve(seq3, onError) { + if (!isSeq(seq3)) + onError("Expected a sequence for this tag"); + return seq3; + }, + createNode: (schema8, obj, ctx) => YAMLSeq.from(schema8, obj, ctx) + }; + } +}); + +// node_modules/yaml/browser/dist/schema/common/string.js +var string; +var init_string = __esm({ + "node_modules/yaml/browser/dist/schema/common/string.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_stringifyString(); + string = { + identify: (value2) => typeof value2 === "string", + default: true, + tag: "tag:yaml.org,2002:str", + resolve: (str2) => str2, + stringify(item, ctx, onComment, onChompKeep) { + ctx = Object.assign({ actualString: true }, ctx); + return stringifyString(item, ctx, onComment, onChompKeep); + } + }; + } +}); + +// node_modules/yaml/browser/dist/schema/common/null.js +var nullTag; +var init_null = __esm({ + "node_modules/yaml/browser/dist/schema/common/null.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + nullTag = { + identify: (value2) => value2 == null, + createNode: () => new Scalar(null), + default: true, + tag: "tag:yaml.org,2002:null", + test: /^(?:~|[Nn]ull|NULL)?$/, + resolve: () => new Scalar(null), + stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr + }; + } +}); + +// node_modules/yaml/browser/dist/schema/core/bool.js +var boolTag; +var init_bool = __esm({ + "node_modules/yaml/browser/dist/schema/core/bool.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + boolTag = { + identify: (value2) => typeof value2 === "boolean", + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/, + resolve: (str2) => new Scalar(str2[0] === "t" || str2[0] === "T"), + stringify({ source, value: value2 }, ctx) { + if (source && boolTag.test.test(source)) { + const sv = source[0] === "t" || source[0] === "T"; + if (value2 === sv) + return source; + } + return value2 ? ctx.options.trueStr : ctx.options.falseStr; + } + }; + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyNumber.js +function stringifyNumber({ format: format5, minFractionDigits, tag, value: value2 }) { + if (typeof value2 === "bigint") + return String(value2); + const num = typeof value2 === "number" ? value2 : Number(value2); + if (!isFinite(num)) + return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf"; + let n7 = JSON.stringify(value2); + if (!format5 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n7)) { + let i7 = n7.indexOf("."); + if (i7 < 0) { + i7 = n7.length; + n7 += "."; + } + let d7 = minFractionDigits - (n7.length - i7 - 1); + while (d7-- > 0) + n7 += "0"; + } + return n7; +} +var init_stringifyNumber = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyNumber.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/schema/core/float.js +var floatNaN, floatExp, float; +var init_float = __esm({ + "node_modules/yaml/browser/dist/schema/core/float.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_stringifyNumber(); + floatNaN = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber + }; + floatExp = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/, + resolve: (str2) => parseFloat(str2), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber(node); + } + }; + float = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/, + resolve(str2) { + const node = new Scalar(parseFloat(str2)); + const dot = str2.indexOf("."); + if (dot !== -1 && str2[str2.length - 1] === "0") + node.minFractionDigits = str2.length - dot - 1; + return node; + }, + stringify: stringifyNumber + }; + } +}); + +// node_modules/yaml/browser/dist/schema/core/int.js +function intStringify(node, radix, prefix) { + const { value: value2 } = node; + if (intIdentify(value2) && value2 >= 0) + return prefix + value2.toString(radix); + return stringifyNumber(node); +} +var intIdentify, intResolve, intOct, int, intHex; +var init_int = __esm({ + "node_modules/yaml/browser/dist/schema/core/int.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_stringifyNumber(); + intIdentify = (value2) => typeof value2 === "bigint" || Number.isInteger(value2); + intResolve = (str2, offset, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2.substring(offset), radix); + intOct = { + identify: (value2) => intIdentify(value2) && value2 >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^0o[0-7]+$/, + resolve: (str2, _onError, opt) => intResolve(str2, 2, 8, opt), + stringify: (node) => intStringify(node, 8, "0o") + }; + int = { + identify: intIdentify, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9]+$/, + resolve: (str2, _onError, opt) => intResolve(str2, 0, 10, opt), + stringify: stringifyNumber + }; + intHex = { + identify: (value2) => intIdentify(value2) && value2 >= 0, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^0x[0-9a-fA-F]+$/, + resolve: (str2, _onError, opt) => intResolve(str2, 2, 16, opt), + stringify: (node) => intStringify(node, 16, "0x") + }; + } +}); + +// node_modules/yaml/browser/dist/schema/core/schema.js +var schema; +var init_schema = __esm({ + "node_modules/yaml/browser/dist/schema/core/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_map(); + init_null(); + init_seq(); + init_string(); + init_bool(); + init_float(); + init_int(); + schema = [ + map, + seq, + string, + nullTag, + boolTag, + intOct, + int, + intHex, + floatNaN, + floatExp, + float + ]; + } +}); + +// node_modules/yaml/browser/dist/schema/json/schema.js +function intIdentify2(value2) { + return typeof value2 === "bigint" || Number.isInteger(value2); +} +var stringifyJSON, jsonScalars, jsonError, schema2; +var init_schema2 = __esm({ + "node_modules/yaml/browser/dist/schema/json/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_map(); + init_seq(); + stringifyJSON = ({ value: value2 }) => JSON.stringify(value2); + jsonScalars = [ + { + identify: (value2) => typeof value2 === "string", + default: true, + tag: "tag:yaml.org,2002:str", + resolve: (str2) => str2, + stringify: stringifyJSON + }, + { + identify: (value2) => value2 == null, + createNode: () => new Scalar(null), + default: true, + tag: "tag:yaml.org,2002:null", + test: /^null$/, + resolve: () => null, + stringify: stringifyJSON + }, + { + identify: (value2) => typeof value2 === "boolean", + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^true$|^false$/, + resolve: (str2) => str2 === "true", + stringify: stringifyJSON + }, + { + identify: intIdentify2, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^-?(?:0|[1-9][0-9]*)$/, + resolve: (str2, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str2) : parseInt(str2, 10), + stringify: ({ value: value2 }) => intIdentify2(value2) ? value2.toString() : JSON.stringify(value2) + }, + { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/, + resolve: (str2) => parseFloat(str2), + stringify: stringifyJSON + } + ]; + jsonError = { + default: true, + tag: "", + test: /^/, + resolve(str2, onError) { + onError(`Unresolved plain scalar ${JSON.stringify(str2)}`); + return str2; + } + }; + schema2 = [map, seq].concat(jsonScalars, jsonError); + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +var binary; +var init_binary = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_stringifyString(); + binary = { + identify: (value2) => value2 instanceof Uint8Array, + // Buffer inherits from Uint8Array + default: false, + tag: "tag:yaml.org,2002:binary", + /** + * Returns a Buffer in node and an Uint8Array in browsers + * + * To use the resulting buffer as an image, you'll want to do something like: + * + * const blob = new Blob([buffer], { type: 'image/jpeg' }) + * document.querySelector('#photo').src = URL.createObjectURL(blob) + */ + resolve(src, onError) { + if (typeof atob === "function") { + const str2 = atob(src.replace(/[\n\r]/g, "")); + const buffer2 = new Uint8Array(str2.length); + for (let i7 = 0; i7 < str2.length; ++i7) + buffer2[i7] = str2.charCodeAt(i7); + return buffer2; + } else { + onError("This environment does not support reading binary tags; either Buffer or atob is required"); + return src; + } + }, + stringify({ comment, type: type3, value: value2 }, ctx, onComment, onChompKeep) { + if (!value2) + return ""; + const buf = value2; + let str2; + if (typeof btoa === "function") { + let s7 = ""; + for (let i7 = 0; i7 < buf.length; ++i7) + s7 += String.fromCharCode(buf[i7]); + str2 = btoa(s7); + } else { + throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required"); + } + type3 ?? (type3 = Scalar.BLOCK_LITERAL); + if (type3 !== Scalar.QUOTE_DOUBLE) { + const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth); + const n7 = Math.ceil(str2.length / lineWidth); + const lines = new Array(n7); + for (let i7 = 0, o7 = 0; i7 < n7; ++i7, o7 += lineWidth) { + lines[i7] = str2.substr(o7, lineWidth); + } + str2 = lines.join(type3 === Scalar.BLOCK_LITERAL ? "\n" : " "); + } + return stringifyString({ comment, type: type3, value: str2 }, ctx, onComment, onChompKeep); + } + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +function resolvePairs(seq3, onError) { + if (isSeq(seq3)) { + for (let i7 = 0; i7 < seq3.items.length; ++i7) { + let item = seq3.items[i7]; + if (isPair(item)) + continue; + else if (isMap(item)) { + if (item.items.length > 1) + onError("Each pair must have its own sequence indicator"); + const pair = item.items[0] || new Pair(new Scalar(null)); + if (item.commentBefore) + pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore} +${pair.key.commentBefore}` : item.commentBefore; + if (item.comment) { + const cn = pair.value ?? pair.key; + cn.comment = cn.comment ? `${item.comment} +${cn.comment}` : item.comment; + } + item = pair; + } + seq3.items[i7] = isPair(item) ? item : new Pair(item); + } + } else + onError("Expected a sequence for this tag"); + return seq3; +} +function createPairs(schema8, iterable, ctx) { + const { replacer } = ctx; + const pairs3 = new YAMLSeq(schema8); + pairs3.tag = "tag:yaml.org,2002:pairs"; + let i7 = 0; + if (iterable && Symbol.iterator in Object(iterable)) + for (let it2 of iterable) { + if (typeof replacer === "function") + it2 = replacer.call(iterable, String(i7++), it2); + let key, value2; + if (Array.isArray(it2)) { + if (it2.length === 2) { + key = it2[0]; + value2 = it2[1]; + } else + throw new TypeError(`Expected [key, value] tuple: ${it2}`); + } else if (it2 && it2 instanceof Object) { + const keys2 = Object.keys(it2); + if (keys2.length === 1) { + key = keys2[0]; + value2 = it2[key]; + } else { + throw new TypeError(`Expected tuple with one key, not ${keys2.length} keys`); + } + } else { + key = it2; + } + pairs3.items.push(createPair(key, value2, ctx)); + } + return pairs3; +} +var pairs; +var init_pairs = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Pair(); + init_Scalar(); + init_YAMLSeq(); + pairs = { + collection: "seq", + default: false, + tag: "tag:yaml.org,2002:pairs", + resolve: resolvePairs, + createNode: createPairs + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +var YAMLOMap, omap; +var init_omap = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_toJS(); + init_YAMLMap(); + init_YAMLSeq(); + init_pairs(); + YAMLOMap = class _YAMLOMap extends YAMLSeq { + constructor() { + super(); + this.add = YAMLMap.prototype.add.bind(this); + this.delete = YAMLMap.prototype.delete.bind(this); + this.get = YAMLMap.prototype.get.bind(this); + this.has = YAMLMap.prototype.has.bind(this); + this.set = YAMLMap.prototype.set.bind(this); + this.tag = _YAMLOMap.tag; + } + /** + * If `ctx` is given, the return type is actually `Map`, + * but TypeScript won't allow widening the signature of a child method. + */ + toJSON(_6, ctx) { + if (!ctx) + return super.toJSON(_6); + const map4 = /* @__PURE__ */ new Map(); + if (ctx?.onCreate) + ctx.onCreate(map4); + for (const pair of this.items) { + let key, value2; + if (isPair(pair)) { + key = toJS(pair.key, "", ctx); + value2 = toJS(pair.value, key, ctx); + } else { + key = toJS(pair, "", ctx); + } + if (map4.has(key)) + throw new Error("Ordered maps must not include duplicate keys"); + map4.set(key, value2); + } + return map4; + } + static from(schema8, iterable, ctx) { + const pairs3 = createPairs(schema8, iterable, ctx); + const omap3 = new this(); + omap3.items = pairs3.items; + return omap3; + } + }; + YAMLOMap.tag = "tag:yaml.org,2002:omap"; + omap = { + collection: "seq", + identify: (value2) => value2 instanceof Map, + nodeClass: YAMLOMap, + default: false, + tag: "tag:yaml.org,2002:omap", + resolve(seq3, onError) { + const pairs3 = resolvePairs(seq3, onError); + const seenKeys = []; + for (const { key } of pairs3.items) { + if (isScalar(key)) { + if (seenKeys.includes(key.value)) { + onError(`Ordered maps must not include duplicate keys: ${key.value}`); + } else { + seenKeys.push(key.value); + } + } + } + return Object.assign(new YAMLOMap(), pairs3); + }, + createNode: (schema8, iterable, ctx) => YAMLOMap.from(schema8, iterable, ctx) + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +function boolStringify({ value: value2, source }, ctx) { + const boolObj = value2 ? trueTag : falseTag; + if (source && boolObj.test.test(source)) + return source; + return value2 ? ctx.options.trueStr : ctx.options.falseStr; +} +var trueTag, falseTag; +var init_bool2 = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + trueTag = { + identify: (value2) => value2 === true, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/, + resolve: () => new Scalar(true), + stringify: boolStringify + }; + falseTag = { + identify: (value2) => value2 === false, + default: true, + tag: "tag:yaml.org,2002:bool", + test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/, + resolve: () => new Scalar(false), + stringify: boolStringify + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +var floatNaN2, floatExp2, float2; +var init_float2 = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/float.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_stringifyNumber(); + floatNaN2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/, + resolve: (str2) => str2.slice(-3).toLowerCase() === "nan" ? NaN : str2[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, + stringify: stringifyNumber + }; + floatExp2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "EXP", + test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/, + resolve: (str2) => parseFloat(str2.replace(/_/g, "")), + stringify(node) { + const num = Number(node.value); + return isFinite(num) ? num.toExponential() : stringifyNumber(node); + } + }; + float2 = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/, + resolve(str2) { + const node = new Scalar(parseFloat(str2.replace(/_/g, ""))); + const dot = str2.indexOf("."); + if (dot !== -1) { + const f8 = str2.substring(dot + 1).replace(/_/g, ""); + if (f8[f8.length - 1] === "0") + node.minFractionDigits = f8.length; + } + return node; + }, + stringify: stringifyNumber + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +function intResolve2(str2, offset, radix, { intAsBigInt }) { + const sign = str2[0]; + if (sign === "-" || sign === "+") + offset += 1; + str2 = str2.substring(offset).replace(/_/g, ""); + if (intAsBigInt) { + switch (radix) { + case 2: + str2 = `0b${str2}`; + break; + case 8: + str2 = `0o${str2}`; + break; + case 16: + str2 = `0x${str2}`; + break; + } + const n8 = BigInt(str2); + return sign === "-" ? BigInt(-1) * n8 : n8; + } + const n7 = parseInt(str2, radix); + return sign === "-" ? -1 * n7 : n7; +} +function intStringify2(node, radix, prefix) { + const { value: value2 } = node; + if (intIdentify3(value2)) { + const str2 = value2.toString(radix); + return value2 < 0 ? "-" + prefix + str2.substr(1) : prefix + str2; + } + return stringifyNumber(node); +} +var intIdentify3, intBin, intOct2, int2, intHex2; +var init_int2 = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/int.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_stringifyNumber(); + intIdentify3 = (value2) => typeof value2 === "bigint" || Number.isInteger(value2); + intBin = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "BIN", + test: /^[-+]?0b[0-1_]+$/, + resolve: (str2, _onError, opt) => intResolve2(str2, 2, 2, opt), + stringify: (node) => intStringify2(node, 2, "0b") + }; + intOct2 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "OCT", + test: /^[-+]?0[0-7_]+$/, + resolve: (str2, _onError, opt) => intResolve2(str2, 1, 8, opt), + stringify: (node) => intStringify2(node, 8, "0") + }; + int2 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + test: /^[-+]?[0-9][0-9_]*$/, + resolve: (str2, _onError, opt) => intResolve2(str2, 0, 10, opt), + stringify: stringifyNumber + }; + intHex2 = { + identify: intIdentify3, + default: true, + tag: "tag:yaml.org,2002:int", + format: "HEX", + test: /^[-+]?0x[0-9a-fA-F_]+$/, + resolve: (str2, _onError, opt) => intResolve2(str2, 2, 16, opt), + stringify: (node) => intStringify2(node, 16, "0x") + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +var YAMLSet, set; +var init_set = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/set.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Pair(); + init_YAMLMap(); + YAMLSet = class _YAMLSet extends YAMLMap { + constructor(schema8) { + super(schema8); + this.tag = _YAMLSet.tag; + } + add(key) { + let pair; + if (isPair(key)) + pair = key; + else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null) + pair = new Pair(key.key, null); + else + pair = new Pair(key, null); + const prev = findPair(this.items, pair.key); + if (!prev) + this.items.push(pair); + } + /** + * If `keepPair` is `true`, returns the Pair matching `key`. + * Otherwise, returns the value of that Pair's key. + */ + get(key, keepPair) { + const pair = findPair(this.items, key); + return !keepPair && isPair(pair) ? isScalar(pair.key) ? pair.key.value : pair.key : pair; + } + set(key, value2) { + if (typeof value2 !== "boolean") + throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value2}`); + const prev = findPair(this.items, key); + if (prev && !value2) { + this.items.splice(this.items.indexOf(prev), 1); + } else if (!prev && value2) { + this.items.push(new Pair(key)); + } + } + toJSON(_6, ctx) { + return super.toJSON(_6, ctx, Set); + } + toString(ctx, onComment, onChompKeep) { + if (!ctx) + return JSON.stringify(this); + if (this.hasAllNullValues(true)) + return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep); + else + throw new Error("Set items must all have null values"); + } + static from(schema8, iterable, ctx) { + const { replacer } = ctx; + const set4 = new this(schema8); + if (iterable && Symbol.iterator in Object(iterable)) + for (let value2 of iterable) { + if (typeof replacer === "function") + value2 = replacer.call(iterable, value2, value2); + set4.items.push(createPair(value2, null, ctx)); + } + return set4; + } + }; + YAMLSet.tag = "tag:yaml.org,2002:set"; + set = { + collection: "map", + identify: (value2) => value2 instanceof Set, + nodeClass: YAMLSet, + default: false, + tag: "tag:yaml.org,2002:set", + createNode: (schema8, iterable, ctx) => YAMLSet.from(schema8, iterable, ctx), + resolve(map4, onError) { + if (isMap(map4)) { + if (map4.hasAllNullValues(true)) + return Object.assign(new YAMLSet(), map4); + else + onError("Set items must all have null values"); + } else + onError("Expected a mapping for this tag"); + return map4; + } + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +function parseSexagesimal(str2, asBigInt) { + const sign = str2[0]; + const parts = sign === "-" || sign === "+" ? str2.substring(1) : str2; + const num = (n7) => asBigInt ? BigInt(n7) : Number(n7); + const res = parts.replace(/_/g, "").split(":").reduce((res2, p7) => res2 * num(60) + num(p7), num(0)); + return sign === "-" ? num(-1) * res : res; +} +function stringifySexagesimal(node) { + let { value: value2 } = node; + let num = (n7) => n7; + if (typeof value2 === "bigint") + num = (n7) => BigInt(n7); + else if (isNaN(value2) || !isFinite(value2)) + return stringifyNumber(node); + let sign = ""; + if (value2 < 0) { + sign = "-"; + value2 *= num(-1); + } + const _60 = num(60); + const parts = [value2 % _60]; + if (value2 < 60) { + parts.unshift(0); + } else { + value2 = (value2 - parts[0]) / _60; + parts.unshift(value2 % _60); + if (value2 >= 60) { + value2 = (value2 - parts[0]) / _60; + parts.unshift(value2); + } + } + return sign + parts.map((n7) => String(n7).padStart(2, "0")).join(":").replace(/000000\d*$/, ""); +} +var intTime, floatTime, timestamp; +var init_timestamp = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_stringifyNumber(); + intTime = { + identify: (value2) => typeof value2 === "bigint" || Number.isInteger(value2), + default: true, + tag: "tag:yaml.org,2002:int", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/, + resolve: (str2, _onError, { intAsBigInt }) => parseSexagesimal(str2, intAsBigInt), + stringify: stringifySexagesimal + }; + floatTime = { + identify: (value2) => typeof value2 === "number", + default: true, + tag: "tag:yaml.org,2002:float", + format: "TIME", + test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/, + resolve: (str2) => parseSexagesimal(str2, false), + stringify: stringifySexagesimal + }; + timestamp = { + identify: (value2) => value2 instanceof Date, + default: true, + tag: "tag:yaml.org,2002:timestamp", + // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part + // may be omitted altogether, resulting in a date format. In such a case, the time part is + // assumed to be 00:00:00Z (start of day, UTC). + test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"), + resolve(str2) { + const match = str2.match(timestamp.test); + if (!match) + throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd"); + const [, year, month, day, hour, minute, second] = match.map(Number); + const millisec = match[7] ? Number((match[7] + "00").substr(1, 3)) : 0; + let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec); + const tz = match[8]; + if (tz && tz !== "Z") { + let d7 = parseSexagesimal(tz, false); + if (Math.abs(d7) < 30) + d7 *= 60; + date -= 6e4 * d7; + } + return new Date(date); + }, + stringify: ({ value: value2 }) => value2?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? "" + }; + } +}); + +// node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +var schema3; +var init_schema3 = __esm({ + "node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_map(); + init_null(); + init_seq(); + init_string(); + init_binary(); + init_bool2(); + init_float2(); + init_int2(); + init_merge(); + init_omap(); + init_pairs(); + init_set(); + init_timestamp(); + schema3 = [ + map, + seq, + string, + nullTag, + trueTag, + falseTag, + intBin, + intOct2, + int2, + intHex2, + floatNaN2, + floatExp2, + float2, + binary, + merge, + omap, + pairs, + set, + intTime, + floatTime, + timestamp + ]; + } +}); + +// node_modules/yaml/browser/dist/schema/tags.js +function getTags(customTags, schemaName, addMergeTag) { + const schemaTags = schemas.get(schemaName); + if (schemaTags && !customTags) { + return addMergeTag && !schemaTags.includes(merge) ? schemaTags.concat(merge) : schemaTags.slice(); + } + let tags6 = schemaTags; + if (!tags6) { + if (Array.isArray(customTags)) + tags6 = []; + else { + const keys2 = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown schema "${schemaName}"; use one of ${keys2} or define customTags array`); + } + } + if (Array.isArray(customTags)) { + for (const tag of customTags) + tags6 = tags6.concat(tag); + } else if (typeof customTags === "function") { + tags6 = customTags(tags6.slice()); + } + if (addMergeTag) + tags6 = tags6.concat(merge); + return tags6.reduce((tags7, tag) => { + const tagObj = typeof tag === "string" ? tagsByName[tag] : tag; + if (!tagObj) { + const tagName = JSON.stringify(tag); + const keys2 = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", "); + throw new Error(`Unknown custom tag ${tagName}; use one of ${keys2}`); + } + if (!tags7.includes(tagObj)) + tags7.push(tagObj); + return tags7; + }, []); +} +var schemas, tagsByName, coreKnownTags; +var init_tags = __esm({ + "node_modules/yaml/browser/dist/schema/tags.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_map(); + init_null(); + init_seq(); + init_string(); + init_bool(); + init_float(); + init_int(); + init_schema(); + init_schema2(); + init_binary(); + init_merge(); + init_omap(); + init_pairs(); + init_schema3(); + init_set(); + init_timestamp(); + schemas = /* @__PURE__ */ new Map([ + ["core", schema], + ["failsafe", [map, seq, string]], + ["json", schema2], + ["yaml11", schema3], + ["yaml-1.1", schema3] + ]); + tagsByName = { + binary, + bool: boolTag, + float, + floatExp, + floatNaN, + floatTime, + int, + intHex, + intOct, + intTime, + map, + merge, + null: nullTag, + omap, + pairs, + seq, + set, + timestamp + }; + coreKnownTags = { + "tag:yaml.org,2002:binary": binary, + "tag:yaml.org,2002:merge": merge, + "tag:yaml.org,2002:omap": omap, + "tag:yaml.org,2002:pairs": pairs, + "tag:yaml.org,2002:set": set, + "tag:yaml.org,2002:timestamp": timestamp + }; + } +}); + +// node_modules/yaml/browser/dist/schema/Schema.js +var sortMapEntriesByKey, Schema; +var init_Schema = __esm({ + "node_modules/yaml/browser/dist/schema/Schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_map(); + init_seq(); + init_string(); + init_tags(); + sortMapEntriesByKey = (a7, b8) => a7.key < b8.key ? -1 : a7.key > b8.key ? 1 : 0; + Schema = class _Schema { + constructor({ compat, customTags, merge: merge7, resolveKnownTags, schema: schema8, sortMapEntries, toStringDefaults }) { + this.compat = Array.isArray(compat) ? getTags(compat, "compat") : compat ? getTags(null, compat) : null; + this.name = typeof schema8 === "string" && schema8 || "core"; + this.knownTags = resolveKnownTags ? coreKnownTags : {}; + this.tags = getTags(customTags, this.name, merge7); + this.toStringOptions = toStringDefaults ?? null; + Object.defineProperty(this, MAP, { value: map }); + Object.defineProperty(this, SCALAR, { value: string }); + Object.defineProperty(this, SEQ, { value: seq }); + this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null; + } + clone() { + const copy4 = Object.create(_Schema.prototype, Object.getOwnPropertyDescriptors(this)); + copy4.tags = this.tags.slice(); + return copy4; + } + }; + } +}); + +// node_modules/yaml/browser/dist/stringify/stringifyDocument.js +function stringifyDocument(doc, options) { + const lines = []; + let hasDirectives = options.directives === true; + if (options.directives !== false && doc.directives) { + const dir2 = doc.directives.toString(doc); + if (dir2) { + lines.push(dir2); + hasDirectives = true; + } else if (doc.directives.docStart) + hasDirectives = true; + } + if (hasDirectives) + lines.push("---"); + const ctx = createStringifyContext(doc, options); + const { commentString } = ctx.options; + if (doc.commentBefore) { + if (lines.length !== 1) + lines.unshift(""); + const cs = commentString(doc.commentBefore); + lines.unshift(indentComment(cs, "")); + } + let chompKeep = false; + let contentComment = null; + if (doc.contents) { + if (isNode(doc.contents)) { + if (doc.contents.spaceBefore && hasDirectives) + lines.push(""); + if (doc.contents.commentBefore) { + const cs = commentString(doc.contents.commentBefore); + lines.push(indentComment(cs, "")); + } + ctx.forceBlockIndent = !!doc.comment; + contentComment = doc.contents.comment; + } + const onChompKeep = contentComment ? void 0 : () => chompKeep = true; + let body = stringify(doc.contents, ctx, () => contentComment = null, onChompKeep); + if (contentComment) + body += lineComment(body, "", commentString(contentComment)); + if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") { + lines[lines.length - 1] = `--- ${body}`; + } else + lines.push(body); + } else { + lines.push(stringify(doc.contents, ctx)); + } + if (doc.directives?.docEnd) { + if (doc.comment) { + const cs = commentString(doc.comment); + if (cs.includes("\n")) { + lines.push("..."); + lines.push(indentComment(cs, "")); + } else { + lines.push(`... ${cs}`); + } + } else { + lines.push("..."); + } + } else { + let dc = doc.comment; + if (dc && chompKeep) + dc = dc.replace(/^\n+/, ""); + if (dc) { + if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "") + lines.push(""); + lines.push(indentComment(commentString(dc), "")); + } + } + return lines.join("\n") + "\n"; +} +var init_stringifyDocument = __esm({ + "node_modules/yaml/browser/dist/stringify/stringifyDocument.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_stringify(); + init_stringifyComment(); + } +}); + +// node_modules/yaml/browser/dist/doc/Document.js +function assertCollection(contents) { + if (isCollection(contents)) + return true; + throw new Error("Expected a YAML collection as document contents"); +} +var Document; +var init_Document = __esm({ + "node_modules/yaml/browser/dist/doc/Document.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Alias(); + init_Collection(); + init_identity(); + init_Pair(); + init_toJS(); + init_Schema(); + init_stringifyDocument(); + init_anchors(); + init_applyReviver(); + init_createNode(); + init_directives(); + Document = class _Document { + constructor(value2, replacer, options) { + this.commentBefore = null; + this.comment = null; + this.errors = []; + this.warnings = []; + Object.defineProperty(this, NODE_TYPE, { value: DOC }); + let _replacer = null; + if (typeof replacer === "function" || Array.isArray(replacer)) { + _replacer = replacer; + } else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const opt = Object.assign({ + intAsBigInt: false, + keepSourceTokens: false, + logLevel: "warn", + prettyErrors: true, + strict: true, + stringKeys: false, + uniqueKeys: true, + version: "1.2" + }, options); + this.options = opt; + let { version: version5 } = opt; + if (options?._directives) { + this.directives = options._directives.atDocument(); + if (this.directives.yaml.explicit) + version5 = this.directives.yaml.version; + } else + this.directives = new Directives({ version: version5 }); + this.setSchema(version5, options); + this.contents = value2 === void 0 ? null : this.createNode(value2, _replacer, options); + } + /** + * Create a deep copy of this Document and its contents. + * + * Custom Node values that inherit from `Object` still refer to their original instances. + */ + clone() { + const copy4 = Object.create(_Document.prototype, { + [NODE_TYPE]: { value: DOC } + }); + copy4.commentBefore = this.commentBefore; + copy4.comment = this.comment; + copy4.errors = this.errors.slice(); + copy4.warnings = this.warnings.slice(); + copy4.options = Object.assign({}, this.options); + if (this.directives) + copy4.directives = this.directives.clone(); + copy4.schema = this.schema.clone(); + copy4.contents = isNode(this.contents) ? this.contents.clone(copy4.schema) : this.contents; + if (this.range) + copy4.range = this.range.slice(); + return copy4; + } + /** Adds a value to the document. */ + add(value2) { + if (assertCollection(this.contents)) + this.contents.add(value2); + } + /** Adds a value to the document. */ + addIn(path2, value2) { + if (assertCollection(this.contents)) + this.contents.addIn(path2, value2); + } + /** + * Create a new `Alias` node, ensuring that the target `node` has the required anchor. + * + * If `node` already has an anchor, `name` is ignored. + * Otherwise, the `node.anchor` value will be set to `name`, + * or if an anchor with that name is already present in the document, + * `name` will be used as a prefix for a new unique anchor. + * If `name` is undefined, the generated anchor will use 'a' as a prefix. + */ + createAlias(node, name2) { + if (!node.anchor) { + const prev = anchorNames(this); + node.anchor = // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + !name2 || prev.has(name2) ? findNewAnchor(name2 || "a", prev) : name2; + } + return new Alias(node.anchor); + } + createNode(value2, replacer, options) { + let _replacer = void 0; + if (typeof replacer === "function") { + value2 = replacer.call({ "": value2 }, "", value2); + _replacer = replacer; + } else if (Array.isArray(replacer)) { + const keyToStr = (v8) => typeof v8 === "number" || v8 instanceof String || v8 instanceof Number; + const asStr = replacer.filter(keyToStr).map(String); + if (asStr.length > 0) + replacer = replacer.concat(asStr); + _replacer = replacer; + } else if (options === void 0 && replacer) { + options = replacer; + replacer = void 0; + } + const { aliasDuplicateObjects, anchorPrefix, flow: flow2, keepUndefined, onTagObj, tag } = options ?? {}; + const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors( + this, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + anchorPrefix || "a" + ); + const ctx = { + aliasDuplicateObjects: aliasDuplicateObjects ?? true, + keepUndefined: keepUndefined ?? false, + onAnchor, + onTagObj, + replacer: _replacer, + schema: this.schema, + sourceObjects + }; + const node = createNode(value2, tag, ctx); + if (flow2 && isCollection(node)) + node.flow = true; + setAnchors(); + return node; + } + /** + * Convert a key and a value into a `Pair` using the current schema, + * recursively wrapping all values as `Scalar` or `Collection` nodes. + */ + createPair(key, value2, options = {}) { + const k6 = this.createNode(key, null, options); + const v8 = this.createNode(value2, null, options); + return new Pair(k6, v8); + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + delete(key) { + return assertCollection(this.contents) ? this.contents.delete(key) : false; + } + /** + * Removes a value from the document. + * @returns `true` if the item was found and removed. + */ + deleteIn(path2) { + if (isEmptyPath(path2)) { + if (this.contents == null) + return false; + this.contents = null; + return true; + } + return assertCollection(this.contents) ? this.contents.deleteIn(path2) : false; + } + /** + * Returns item at `key`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + get(key, keepScalar) { + return isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0; + } + /** + * Returns item at `path`, or `undefined` if not found. By default unwraps + * scalar values from their surrounding node; to disable set `keepScalar` to + * `true` (collections are always returned intact). + */ + getIn(path2, keepScalar) { + if (isEmptyPath(path2)) + return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents; + return isCollection(this.contents) ? this.contents.getIn(path2, keepScalar) : void 0; + } + /** + * Checks if the document includes a value with the key `key`. + */ + has(key) { + return isCollection(this.contents) ? this.contents.has(key) : false; + } + /** + * Checks if the document includes a value at `path`. + */ + hasIn(path2) { + if (isEmptyPath(path2)) + return this.contents !== void 0; + return isCollection(this.contents) ? this.contents.hasIn(path2) : false; + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + set(key, value2) { + if (this.contents == null) { + this.contents = collectionFromPath(this.schema, [key], value2); + } else if (assertCollection(this.contents)) { + this.contents.set(key, value2); + } + } + /** + * Sets a value in this document. For `!!set`, `value` needs to be a + * boolean to add/remove the item from the set. + */ + setIn(path2, value2) { + if (isEmptyPath(path2)) { + this.contents = value2; + } else if (this.contents == null) { + this.contents = collectionFromPath(this.schema, Array.from(path2), value2); + } else if (assertCollection(this.contents)) { + this.contents.setIn(path2, value2); + } + } + /** + * Change the YAML version and schema used by the document. + * A `null` version disables support for directives, explicit tags, anchors, and aliases. + * It also requires the `schema` option to be given as a `Schema` instance value. + * + * Overrides all previously set schema options. + */ + setSchema(version5, options = {}) { + if (typeof version5 === "number") + version5 = String(version5); + let opt; + switch (version5) { + case "1.1": + if (this.directives) + this.directives.yaml.version = "1.1"; + else + this.directives = new Directives({ version: "1.1" }); + opt = { resolveKnownTags: false, schema: "yaml-1.1" }; + break; + case "1.2": + case "next": + if (this.directives) + this.directives.yaml.version = version5; + else + this.directives = new Directives({ version: version5 }); + opt = { resolveKnownTags: true, schema: "core" }; + break; + case null: + if (this.directives) + delete this.directives; + opt = null; + break; + default: { + const sv = JSON.stringify(version5); + throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`); + } + } + if (options.schema instanceof Object) + this.schema = options.schema; + else if (opt) + this.schema = new Schema(Object.assign(opt, options)); + else + throw new Error(`With a null YAML version, the { schema: Schema } option is required`); + } + // json & jsonArg are only used from toJSON() + toJS({ json: json2, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) { + const ctx = { + anchors: /* @__PURE__ */ new Map(), + doc: this, + keep: !json2, + mapAsMap: mapAsMap === true, + mapKeyWarned: false, + maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100 + }; + const res = toJS(this.contents, jsonArg ?? "", ctx); + if (typeof onAnchor === "function") + for (const { count: count2, res: res2 } of ctx.anchors.values()) + onAnchor(res2, count2); + return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res; + } + /** + * A JSON representation of the document `contents`. + * + * @param jsonArg Used by `JSON.stringify` to indicate the array index or + * property name. + */ + toJSON(jsonArg, onAnchor) { + return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor }); + } + /** A YAML representation of the document. */ + toString(options = {}) { + if (this.errors.length > 0) + throw new Error("Document with errors cannot be stringified"); + if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) { + const s7 = JSON.stringify(options.indent); + throw new Error(`"indent" option must be a positive integer, not ${s7}`); + } + return stringifyDocument(this, options); + } + }; + } +}); + +// node_modules/yaml/browser/dist/errors.js +var YAMLError, YAMLParseError, YAMLWarning, prettifyError; +var init_errors = __esm({ + "node_modules/yaml/browser/dist/errors.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + YAMLError = class extends Error { + constructor(name2, pos, code, message) { + super(); + this.name = name2; + this.code = code; + this.message = message; + this.pos = pos; + } + }; + YAMLParseError = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLParseError", pos, code, message); + } + }; + YAMLWarning = class extends YAMLError { + constructor(pos, code, message) { + super("YAMLWarning", pos, code, message); + } + }; + prettifyError = (src, lc) => (error2) => { + if (error2.pos[0] === -1) + return; + error2.linePos = error2.pos.map((pos) => lc.linePos(pos)); + const { line, col } = error2.linePos[0]; + error2.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) { + const trimStart2 = Math.min(ci - 39, lineStr.length - 79); + lineStr = "\u2026" + lineStr.substring(trimStart2); + ci -= trimStart2 - 1; + } + if (lineStr.length > 80) + lineStr = lineStr.substring(0, 79) + "\u2026"; + if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) { + let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]); + if (prev.length > 80) + prev = prev.substring(0, 79) + "\u2026\n"; + lineStr = prev + lineStr; + } + if (/[^ ]/.test(lineStr)) { + let count2 = 1; + const end = error2.linePos[1]; + if (end && end.line === line && end.col > col) { + count2 = Math.max(1, Math.min(end.col - col, 80 - ci)); + } + const pointer = " ".repeat(ci) + "^".repeat(count2); + error2.message += `: + +${lineStr} +${pointer} +`; + } + }; + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-props.js +function resolveProps(tokens, { flow: flow2, indicator, next, offset, onError, parentIndent, startOnNewline }) { + let spaceBefore = false; + let atNewline = startOnNewline; + let hasSpace = startOnNewline; + let comment = ""; + let commentSep = ""; + let hasNewline = false; + let reqSpace = false; + let tab = null; + let anchor = null; + let tag = null; + let newlineAfterProp = null; + let comma = null; + let found = null; + let start = null; + for (const token of tokens) { + if (reqSpace) { + if (token.type !== "space" && token.type !== "newline" && token.type !== "comma") + onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + reqSpace = false; + } + if (tab) { + if (atNewline && token.type !== "comment" && token.type !== "newline") { + onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + } + tab = null; + } + switch (token.type) { + case "space": + if (!flow2 && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) { + tab = token; + } + hasSpace = true; + break; + case "comment": { + if (!hasSpace) + onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = token.source.substring(1) || " "; + if (!comment) + comment = cb; + else + comment += commentSep + cb; + commentSep = ""; + atNewline = false; + break; + } + case "newline": + if (atNewline) { + if (comment) + comment += token.source; + else if (!found || indicator !== "seq-item-ind") + spaceBefore = true; + } else + commentSep += token.source; + atNewline = true; + hasNewline = true; + if (anchor || tag) + newlineAfterProp = token; + hasSpace = true; + break; + case "anchor": + if (anchor) + onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor"); + if (token.source.endsWith(":")) + onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true); + anchor = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + case "tag": { + if (tag) + onError(token, "MULTIPLE_TAGS", "A node can have at most one tag"); + tag = token; + start ?? (start = token.offset); + atNewline = false; + hasSpace = false; + reqSpace = true; + break; + } + case indicator: + if (anchor || tag) + onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`); + if (found) + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow2 ?? "collection"}`); + found = token; + atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind"; + hasSpace = false; + break; + case "comma": + if (flow2) { + if (comma) + onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow2}`); + comma = token; + atNewline = false; + hasSpace = false; + break; + } + default: + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`); + atNewline = false; + hasSpace = false; + } + } + const last2 = tokens[tokens.length - 1]; + const end = last2 ? last2.offset + last2.source.length : offset; + if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) { + onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"); + } + if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq")) + onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation"); + return { + comma, + found, + spaceBefore, + comment, + hasNewline, + anchor, + tag, + newlineAfterProp, + end, + start: start ?? end + }; +} +var init_resolve_props = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-props.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/compose/util-contains-newline.js +function containsNewline(key) { + if (!key) + return null; + switch (key.type) { + case "alias": + case "scalar": + case "double-quoted-scalar": + case "single-quoted-scalar": + if (key.source.includes("\n")) + return true; + if (key.end) { + for (const st2 of key.end) + if (st2.type === "newline") + return true; + } + return false; + case "flow-collection": + for (const it2 of key.items) { + for (const st2 of it2.start) + if (st2.type === "newline") + return true; + if (it2.sep) { + for (const st2 of it2.sep) + if (st2.type === "newline") + return true; + } + if (containsNewline(it2.key) || containsNewline(it2.value)) + return true; + } + return false; + default: + return true; + } +} +var init_util_contains_newline = __esm({ + "node_modules/yaml/browser/dist/compose/util-contains-newline.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +function flowIndentCheck(indent, fc, onError) { + if (fc?.type === "flow-collection") { + const end = fc.end[0]; + if (end.indent === indent && (end.source === "]" || end.source === "}") && containsNewline(fc)) { + const msg = "Flow end indicator should be more indented than parent"; + onError(end, "BAD_INDENT", msg, true); + } + } +} +var init_util_flow_indent_check = __esm({ + "node_modules/yaml/browser/dist/compose/util-flow-indent-check.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_util_contains_newline(); + } +}); + +// node_modules/yaml/browser/dist/compose/util-map-includes.js +function mapIncludes(ctx, items, search) { + const { uniqueKeys } = ctx.options; + if (uniqueKeys === false) + return false; + const isEqual2 = typeof uniqueKeys === "function" ? uniqueKeys : (a7, b8) => a7 === b8 || isScalar(a7) && isScalar(b8) && a7.value === b8.value; + return items.some((pair) => isEqual2(pair.key, search)); +} +var init_util_map_includes = __esm({ + "node_modules/yaml/browser/dist/compose/util-map-includes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-block-map.js +function resolveBlockMap({ composeNode: composeNode3, composeEmptyNode: composeEmptyNode2 }, ctx, bm, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLMap; + const map4 = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + let offset = bm.offset; + let commentEnd = null; + for (const collItem of bm.items) { + const { start, key, sep: sep2, value: value2 } = collItem; + const keyProps = resolveProps(start, { + indicator: "explicit-key-ind", + next: key ?? sep2?.[0], + offset, + onError, + parentIndent: bm.indent, + startOnNewline: true + }); + const implicitKey = !keyProps.found; + if (implicitKey) { + if (key) { + if (key.type === "block-seq") + onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key"); + else if ("indent" in key && key.indent !== bm.indent) + onError(offset, "BAD_INDENT", startColMsg); + } + if (!keyProps.anchor && !keyProps.tag && !sep2) { + commentEnd = keyProps.end; + if (keyProps.comment) { + if (map4.comment) + map4.comment += "\n" + keyProps.comment; + else + map4.comment = keyProps.comment; + } + continue; + } + if (keyProps.newlineAfterProp || containsNewline(key)) { + onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line"); + } + } else if (keyProps.found?.indent !== bm.indent) { + onError(offset, "BAD_INDENT", startColMsg); + } + ctx.atKey = true; + const keyStart = keyProps.end; + const keyNode = key ? composeNode3(ctx, key, keyProps, onError) : composeEmptyNode2(ctx, keyStart, start, null, keyProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, key, onError); + ctx.atKey = false; + if (mapIncludes(ctx, map4.items, keyNode)) + onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + const valueProps = resolveProps(sep2 ?? [], { + indicator: "map-value-ind", + next: value2, + offset: keyNode.range[2], + onError, + parentIndent: bm.indent, + startOnNewline: !key || key.type === "block-scalar" + }); + offset = valueProps.end; + if (valueProps.found) { + if (implicitKey) { + if (value2?.type === "block-map" && !valueProps.hasNewline) + onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"); + if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) + onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"); + } + const valueNode = value2 ? composeNode3(ctx, value2, valueProps, onError) : composeEmptyNode2(ctx, offset, sep2, null, valueProps, onError); + if (ctx.schema.compat) + flowIndentCheck(bm.indent, value2, onError); + offset = valueNode.range[2]; + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map4.items.push(pair); + } else { + if (implicitKey) + onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"); + if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += "\n" + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + map4.items.push(pair); + } + } + if (commentEnd && commentEnd < offset) + onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content"); + map4.range = [bm.offset, offset, commentEnd ?? offset]; + return map4; +} +var startColMsg; +var init_resolve_block_map = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-block-map.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Pair(); + init_YAMLMap(); + init_resolve_props(); + init_util_contains_newline(); + init_util_flow_indent_check(); + init_util_map_includes(); + startColMsg = "All mapping items must start at the same column"; + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-block-seq.js +function resolveBlockSeq({ composeNode: composeNode3, composeEmptyNode: composeEmptyNode2 }, ctx, bs, onError, tag) { + const NodeClass = tag?.nodeClass ?? YAMLSeq; + const seq3 = new NodeClass(ctx.schema); + if (ctx.atRoot) + ctx.atRoot = false; + if (ctx.atKey) + ctx.atKey = false; + let offset = bs.offset; + let commentEnd = null; + for (const { start, value: value2 } of bs.items) { + const props = resolveProps(start, { + indicator: "seq-item-ind", + next: value2, + offset, + onError, + parentIndent: bs.indent, + startOnNewline: true + }); + if (!props.found) { + if (props.anchor || props.tag || value2) { + if (value2 && value2.type === "block-seq") + onError(props.end, "BAD_INDENT", "All sequence items must start at the same column"); + else + onError(offset, "MISSING_CHAR", "Sequence item without - indicator"); + } else { + commentEnd = props.end; + if (props.comment) + seq3.comment = props.comment; + continue; + } + } + const node = value2 ? composeNode3(ctx, value2, props, onError) : composeEmptyNode2(ctx, props.end, start, null, props, onError); + if (ctx.schema.compat) + flowIndentCheck(bs.indent, value2, onError); + offset = node.range[2]; + seq3.items.push(node); + } + seq3.range = [bs.offset, offset, commentEnd ?? offset]; + return seq3; +} +var init_resolve_block_seq = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-block-seq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_YAMLSeq(); + init_resolve_props(); + init_util_flow_indent_check(); + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-end.js +function resolveEnd(end, offset, reqSpace, onError) { + let comment = ""; + if (end) { + let hasSpace = false; + let sep2 = ""; + for (const token of end) { + const { source, type: type3 } = token; + switch (type3) { + case "space": + hasSpace = true; + break; + case "comment": { + if (reqSpace && !hasSpace) + onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"); + const cb = source.substring(1) || " "; + if (!comment) + comment = cb; + else + comment += sep2 + cb; + sep2 = ""; + break; + } + case "newline": + if (comment) + sep2 += source; + hasSpace = true; + break; + default: + onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type3} at node end`); + } + offset += source.length; + } + } + return { comment, offset }; +} +var init_resolve_end = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-end.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +function resolveFlowCollection({ composeNode: composeNode3, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) { + const isMap3 = fc.start.source === "{"; + const fcName = isMap3 ? "flow map" : "flow sequence"; + const NodeClass = tag?.nodeClass ?? (isMap3 ? YAMLMap : YAMLSeq); + const coll = new NodeClass(ctx.schema); + coll.flow = true; + const atRoot = ctx.atRoot; + if (atRoot) + ctx.atRoot = false; + if (ctx.atKey) + ctx.atKey = false; + let offset = fc.offset + fc.start.source.length; + for (let i7 = 0; i7 < fc.items.length; ++i7) { + const collItem = fc.items[i7]; + const { start, key, sep: sep2, value: value2 } = collItem; + const props = resolveProps(start, { + flow: fcName, + indicator: "explicit-key-ind", + next: key ?? sep2?.[0], + offset, + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (!props.found) { + if (!props.anchor && !props.tag && !sep2 && !value2) { + if (i7 === 0 && props.comma) + onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + else if (i7 < fc.items.length - 1) + onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`); + if (props.comment) { + if (coll.comment) + coll.comment += "\n" + props.comment; + else + coll.comment = props.comment; + } + offset = props.end; + continue; + } + if (!isMap3 && ctx.options.strict && containsNewline(key)) + onError( + key, + // checked by containsNewline() + "MULTILINE_IMPLICIT_KEY", + "Implicit keys of flow sequence pairs need to be on a single line" + ); + } + if (i7 === 0) { + if (props.comma) + onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`); + } else { + if (!props.comma) + onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`); + if (props.comment) { + let prevItemComment = ""; + loop: + for (const st2 of start) { + switch (st2.type) { + case "comma": + case "space": + break; + case "comment": + prevItemComment = st2.source.substring(1); + break loop; + default: + break loop; + } + } + if (prevItemComment) { + let prev = coll.items[coll.items.length - 1]; + if (isPair(prev)) + prev = prev.value ?? prev.key; + if (prev.comment) + prev.comment += "\n" + prevItemComment; + else + prev.comment = prevItemComment; + props.comment = props.comment.substring(prevItemComment.length + 1); + } + } + } + if (!isMap3 && !sep2 && !props.found) { + const valueNode = value2 ? composeNode3(ctx, value2, props, onError) : composeEmptyNode2(ctx, props.end, sep2, null, props, onError); + coll.items.push(valueNode); + offset = valueNode.range[2]; + if (isBlock(value2)) + onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else { + ctx.atKey = true; + const keyStart = props.end; + const keyNode = key ? composeNode3(ctx, key, props, onError) : composeEmptyNode2(ctx, keyStart, start, null, props, onError); + if (isBlock(key)) + onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg); + ctx.atKey = false; + const valueProps = resolveProps(sep2 ?? [], { + flow: fcName, + indicator: "map-value-ind", + next: value2, + offset: keyNode.range[2], + onError, + parentIndent: fc.indent, + startOnNewline: false + }); + if (valueProps.found) { + if (!isMap3 && !props.found && ctx.options.strict) { + if (sep2) + for (const st2 of sep2) { + if (st2 === valueProps.found) + break; + if (st2.type === "newline") { + onError(st2, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line"); + break; + } + } + if (props.start < valueProps.found.offset - 1024) + onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key"); + } + } else if (value2) { + if ("source" in value2 && value2.source && value2.source[0] === ":") + onError(value2, "MISSING_CHAR", `Missing space after : in ${fcName}`); + else + onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`); + } + const valueNode = value2 ? composeNode3(ctx, value2, valueProps, onError) : valueProps.found ? composeEmptyNode2(ctx, valueProps.end, sep2, null, valueProps, onError) : null; + if (valueNode) { + if (isBlock(value2)) + onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg); + } else if (valueProps.comment) { + if (keyNode.comment) + keyNode.comment += "\n" + valueProps.comment; + else + keyNode.comment = valueProps.comment; + } + const pair = new Pair(keyNode, valueNode); + if (ctx.options.keepSourceTokens) + pair.srcToken = collItem; + if (isMap3) { + const map4 = coll; + if (mapIncludes(ctx, map4.items, keyNode)) + onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique"); + map4.items.push(pair); + } else { + const map4 = new YAMLMap(ctx.schema); + map4.flow = true; + map4.items.push(pair); + const endRange = (valueNode ?? keyNode).range; + map4.range = [keyNode.range[0], endRange[1], endRange[2]]; + coll.items.push(map4); + } + offset = valueNode ? valueNode.range[2] : valueProps.end; + } + } + const expectedEnd = isMap3 ? "}" : "]"; + const [ce4, ...ee4] = fc.end; + let cePos = offset; + if (ce4 && ce4.source === expectedEnd) + cePos = ce4.offset + ce4.source.length; + else { + const name2 = fcName[0].toUpperCase() + fcName.substring(1); + const msg = atRoot ? `${name2} must end with a ${expectedEnd}` : `${name2} in block collection must be sufficiently indented and end with a ${expectedEnd}`; + onError(offset, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg); + if (ce4 && ce4.source.length !== 1) + ee4.unshift(ce4); + } + if (ee4.length > 0) { + const end = resolveEnd(ee4, cePos, ctx.options.strict, onError); + if (end.comment) { + if (coll.comment) + coll.comment += "\n" + end.comment; + else + coll.comment = end.comment; + } + coll.range = [fc.offset, cePos, end.offset]; + } else { + coll.range = [fc.offset, cePos, cePos]; + } + return coll; +} +var blockMsg, isBlock; +var init_resolve_flow_collection = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-flow-collection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Pair(); + init_YAMLMap(); + init_YAMLSeq(); + init_resolve_end(); + init_resolve_props(); + init_util_contains_newline(); + init_util_map_includes(); + blockMsg = "Block collections are not allowed within flow collections"; + isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq"); + } +}); + +// node_modules/yaml/browser/dist/compose/compose-collection.js +function resolveCollection(CN2, ctx, token, onError, tagName, tag) { + const coll = token.type === "block-map" ? resolveBlockMap(CN2, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN2, ctx, token, onError, tag) : resolveFlowCollection(CN2, ctx, token, onError, tag); + const Coll = coll.constructor; + if (tagName === "!" || tagName === Coll.tagName) { + coll.tag = Coll.tagName; + return coll; + } + if (tagName) + coll.tag = tagName; + return coll; +} +function composeCollection(CN2, ctx, token, props, onError) { + const tagToken = props.tag; + const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)); + if (token.type === "block-seq") { + const { anchor, newlineAfterProp: nl } = props; + const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken; + if (lastProp && (!nl || nl.offset < lastProp.offset)) { + const message = "Missing newline after block sequence props"; + onError(lastProp, "MISSING_CHAR", message); + } + } + const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq"; + if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.tagName && expType === "seq") { + return resolveCollection(CN2, ctx, token, onError, tagName); + } + let tag = ctx.schema.tags.find((t8) => t8.tag === tagName && t8.collection === expType); + if (!tag) { + const kt = ctx.schema.knownTags[tagName]; + if (kt && kt.collection === expType) { + ctx.schema.tags.push(Object.assign({}, kt, { default: false })); + tag = kt; + } else { + if (kt) { + onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true); + } else { + onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true); + } + return resolveCollection(CN2, ctx, token, onError, tagName); + } + } + const coll = resolveCollection(CN2, ctx, token, onError, tagName, tag); + const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll; + const node = isNode(res) ? res : new Scalar(res); + node.range = coll.range; + node.tag = tagName; + if (tag?.format) + node.format = tag.format; + return node; +} +var init_compose_collection = __esm({ + "node_modules/yaml/browser/dist/compose/compose-collection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Scalar(); + init_YAMLMap(); + init_YAMLSeq(); + init_resolve_block_map(); + init_resolve_block_seq(); + init_resolve_flow_collection(); + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +function resolveBlockScalar(ctx, scalar, onError) { + const start = scalar.offset; + const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError); + if (!header) + return { value: "", type: null, comment: "", range: [start, start, start] }; + const type3 = header.mode === ">" ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL; + const lines = scalar.source ? splitLines(scalar.source) : []; + let chompStart = lines.length; + for (let i7 = lines.length - 1; i7 >= 0; --i7) { + const content = lines[i7][1]; + if (content === "" || content === "\r") + chompStart = i7; + else + break; + } + if (chompStart === 0) { + const value3 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : ""; + let end2 = start + header.length; + if (scalar.source) + end2 += scalar.source.length; + return { value: value3, type: type3, comment: header.comment, range: [start, end2, end2] }; + } + let trimIndent = scalar.indent + header.indent; + let offset = scalar.offset + header.length; + let contentStart = 0; + for (let i7 = 0; i7 < chompStart; ++i7) { + const [indent, content] = lines[i7]; + if (content === "" || content === "\r") { + if (header.indent === 0 && indent.length > trimIndent) + trimIndent = indent.length; + } else { + if (indent.length < trimIndent) { + const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"; + onError(offset + indent.length, "MISSING_CHAR", message); + } + if (header.indent === 0) + trimIndent = indent.length; + contentStart = i7; + if (trimIndent === 0 && !ctx.atRoot) { + const message = "Block scalar values in collections must be indented"; + onError(offset, "BAD_INDENT", message); + } + break; + } + offset += indent.length + content.length + 1; + } + for (let i7 = lines.length - 1; i7 >= chompStart; --i7) { + if (lines[i7][0].length > trimIndent) + chompStart = i7 + 1; + } + let value2 = ""; + let sep2 = ""; + let prevMoreIndented = false; + for (let i7 = 0; i7 < contentStart; ++i7) + value2 += lines[i7][0].slice(trimIndent) + "\n"; + for (let i7 = contentStart; i7 < chompStart; ++i7) { + let [indent, content] = lines[i7]; + offset += indent.length + content.length + 1; + const crlf = content[content.length - 1] === "\r"; + if (crlf) + content = content.slice(0, -1); + if (content && indent.length < trimIndent) { + const src = header.indent ? "explicit indentation indicator" : "first line"; + const message = `Block scalar lines must not be less indented than their ${src}`; + onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message); + indent = ""; + } + if (type3 === Scalar.BLOCK_LITERAL) { + value2 += sep2 + indent.slice(trimIndent) + content; + sep2 = "\n"; + } else if (indent.length > trimIndent || content[0] === " ") { + if (sep2 === " ") + sep2 = "\n"; + else if (!prevMoreIndented && sep2 === "\n") + sep2 = "\n\n"; + value2 += sep2 + indent.slice(trimIndent) + content; + sep2 = "\n"; + prevMoreIndented = true; + } else if (content === "") { + if (sep2 === "\n") + value2 += "\n"; + else + sep2 = "\n"; + } else { + value2 += sep2 + content; + sep2 = " "; + prevMoreIndented = false; + } + } + switch (header.chomp) { + case "-": + break; + case "+": + for (let i7 = chompStart; i7 < lines.length; ++i7) + value2 += "\n" + lines[i7][0].slice(trimIndent); + if (value2[value2.length - 1] !== "\n") + value2 += "\n"; + break; + default: + value2 += "\n"; + } + const end = start + header.length + scalar.source.length; + return { value: value2, type: type3, comment: header.comment, range: [start, end, end] }; +} +function parseBlockScalarHeader({ offset, props }, strict2, onError) { + if (props[0].type !== "block-scalar-header") { + onError(props[0], "IMPOSSIBLE", "Block scalar header not found"); + return null; + } + const { source } = props[0]; + const mode = source[0]; + let indent = 0; + let chomp = ""; + let error2 = -1; + for (let i7 = 1; i7 < source.length; ++i7) { + const ch = source[i7]; + if (!chomp && (ch === "-" || ch === "+")) + chomp = ch; + else { + const n7 = Number(ch); + if (!indent && n7) + indent = n7; + else if (error2 === -1) + error2 = offset + i7; + } + } + if (error2 !== -1) + onError(error2, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`); + let hasSpace = false; + let comment = ""; + let length = source.length; + for (let i7 = 1; i7 < props.length; ++i7) { + const token = props[i7]; + switch (token.type) { + case "space": + hasSpace = true; + case "newline": + length += token.source.length; + break; + case "comment": + if (strict2 && !hasSpace) { + const message = "Comments must be separated from other tokens by white space characters"; + onError(token, "MISSING_CHAR", message); + } + length += token.source.length; + comment = token.source.substring(1); + break; + case "error": + onError(token, "UNEXPECTED_TOKEN", token.message); + length += token.source.length; + break; + default: { + const message = `Unexpected token in block scalar header: ${token.type}`; + onError(token, "UNEXPECTED_TOKEN", message); + const ts = token.source; + if (ts && typeof ts === "string") + length += ts.length; + } + } + } + return { mode, indent, chomp, comment, length }; +} +function splitLines(source) { + const split3 = source.split(/\n( *)/); + const first = split3[0]; + const m7 = first.match(/^( *)/); + const line0 = m7?.[1] ? [m7[1], first.slice(m7[1].length)] : ["", first]; + const lines = [line0]; + for (let i7 = 1; i7 < split3.length; i7 += 2) + lines.push([split3[i7], split3[i7 + 1]]); + return lines; +} +var init_resolve_block_scalar = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-block-scalar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + } +}); + +// node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +function resolveFlowScalar(scalar, strict2, onError) { + const { offset, type: type3, source, end } = scalar; + let _type; + let value2; + const _onError = (rel, code, msg) => onError(offset + rel, code, msg); + switch (type3) { + case "scalar": + _type = Scalar.PLAIN; + value2 = plainValue(source, _onError); + break; + case "single-quoted-scalar": + _type = Scalar.QUOTE_SINGLE; + value2 = singleQuotedValue(source, _onError); + break; + case "double-quoted-scalar": + _type = Scalar.QUOTE_DOUBLE; + value2 = doubleQuotedValue(source, _onError); + break; + default: + onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type3}`); + return { + value: "", + type: null, + comment: "", + range: [offset, offset + source.length, offset + source.length] + }; + } + const valueEnd = offset + source.length; + const re4 = resolveEnd(end, valueEnd, strict2, onError); + return { + value: value2, + type: _type, + comment: re4.comment, + range: [offset, valueEnd, re4.offset] + }; +} +function plainValue(source, onError) { + let badChar = ""; + switch (source[0]) { + case " ": + badChar = "a tab character"; + break; + case ",": + badChar = "flow indicator character ,"; + break; + case "%": + badChar = "directive indicator character %"; + break; + case "|": + case ">": { + badChar = `block scalar indicator ${source[0]}`; + break; + } + case "@": + case "`": { + badChar = `reserved character ${source[0]}`; + break; + } + } + if (badChar) + onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`); + return foldLines(source); +} +function singleQuotedValue(source, onError) { + if (source[source.length - 1] !== "'" || source.length === 1) + onError(source.length, "MISSING_CHAR", "Missing closing 'quote"); + return foldLines(source.slice(1, -1)).replace(/''/g, "'"); +} +function foldLines(source) { + let first, line; + try { + first = new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i7 + 1) : ch; + } else { + res += ch; + } + } + if (source[source.length - 1] !== '"' || source.length === 1) + onError(source.length, "MISSING_CHAR", 'Missing closing "quote'); + return res; +} +function foldNewline(source, offset) { + let fold = ""; + let ch = source[offset + 1]; + while (ch === " " || ch === " " || ch === "\n" || ch === "\r") { + if (ch === "\r" && source[offset + 2] !== "\n") + break; + if (ch === "\n") + fold += "\n"; + offset += 1; + ch = source[offset + 1]; + } + if (!fold) + fold = " "; + return { fold, offset }; +} +function parseCharCode(source, offset, length, onError) { + const cc = source.substr(offset, length); + const ok2 = cc.length === length && /^[0-9a-fA-F]+$/.test(cc); + const code = ok2 ? parseInt(cc, 16) : NaN; + if (isNaN(code)) { + const raw = source.substr(offset - 2, length + 2); + onError(offset - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`); + return raw; + } + return String.fromCodePoint(code); +} +var escapeCodes; +var init_resolve_flow_scalar = __esm({ + "node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Scalar(); + init_resolve_end(); + escapeCodes = { + "0": "\0", + // null character + a: "\x07", + // bell character + b: "\b", + // backspace + e: "\x1B", + // escape character + f: "\f", + // form feed + n: "\n", + // line feed + r: "\r", + // carriage return + t: " ", + // horizontal tab + v: "\v", + // vertical tab + N: "\x85", + // Unicode next line + _: "\xA0", + // Unicode non-breaking space + L: "\u2028", + // Unicode line separator + P: "\u2029", + // Unicode paragraph separator + " ": " ", + '"': '"', + "/": "/", + "\\": "\\", + " ": " " + }; + } +}); + +// node_modules/yaml/browser/dist/compose/compose-scalar.js +function composeScalar(ctx, token, tagToken, onError) { + const { value: value2, type: type3, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError); + const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null; + let tag; + if (ctx.options.stringKeys && ctx.atKey) { + tag = ctx.schema[SCALAR]; + } else if (tagName) + tag = findScalarTagByName(ctx.schema, value2, tagName, tagToken, onError); + else if (token.type === "scalar") + tag = findScalarTagByTest(ctx, value2, token, onError); + else + tag = ctx.schema[SCALAR]; + let scalar; + try { + const res = tag.resolve(value2, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options); + scalar = isScalar(res) ? res : new Scalar(res); + } catch (error2) { + const msg = error2 instanceof Error ? error2.message : String(error2); + onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg); + scalar = new Scalar(value2); + } + scalar.range = range2; + scalar.source = value2; + if (type3) + scalar.type = type3; + if (tagName) + scalar.tag = tagName; + if (tag.format) + scalar.format = tag.format; + if (comment) + scalar.comment = comment; + return scalar; +} +function findScalarTagByName(schema8, value2, tagName, tagToken, onError) { + if (tagName === "!") + return schema8[SCALAR]; + const matchWithTest = []; + for (const tag of schema8.tags) { + if (!tag.collection && tag.tag === tagName) { + if (tag.default && tag.test) + matchWithTest.push(tag); + else + return tag; + } + } + for (const tag of matchWithTest) + if (tag.test?.test(value2)) + return tag; + const kt = schema8.knownTags[tagName]; + if (kt && !kt.collection) { + schema8.tags.push(Object.assign({}, kt, { default: false, test: void 0 })); + return kt; + } + onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str"); + return schema8[SCALAR]; +} +function findScalarTagByTest({ atKey, directives, schema: schema8 }, value2, token, onError) { + const tag = schema8.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value2)) || schema8[SCALAR]; + if (schema8.compat) { + const compat = schema8.compat.find((tag2) => tag2.default && tag2.test?.test(value2)) ?? schema8[SCALAR]; + if (tag.tag !== compat.tag) { + const ts = directives.tagString(tag.tag); + const cs = directives.tagString(compat.tag); + const msg = `Value may be parsed as either ${ts} or ${cs}`; + onError(token, "TAG_RESOLVE_FAILED", msg, true); + } + } + return tag; +} +var init_compose_scalar = __esm({ + "node_modules/yaml/browser/dist/compose/compose-scalar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity(); + init_Scalar(); + init_resolve_block_scalar(); + init_resolve_flow_scalar(); + } +}); + +// node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +function emptyScalarPosition(offset, before2, pos) { + if (before2) { + pos ?? (pos = before2.length); + for (let i7 = pos - 1; i7 >= 0; --i7) { + let st2 = before2[i7]; + switch (st2.type) { + case "space": + case "comment": + case "newline": + offset -= st2.source.length; + continue; + } + st2 = before2[++i7]; + while (st2?.type === "space") { + offset += st2.source.length; + st2 = before2[++i7]; + } + break; + } + } + return offset; +} +var init_util_empty_scalar_position = __esm({ + "node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/compose/compose-node.js +function composeNode(ctx, token, props, onError) { + const atKey = ctx.atKey; + const { spaceBefore, comment, anchor, tag } = props; + let node; + let isSrcToken = true; + switch (token.type) { + case "alias": + node = composeAlias(ctx, token, onError); + if (anchor || tag) + onError(token, "ALIAS_PROPS", "An alias node must not specify any properties"); + break; + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "block-scalar": + node = composeScalar(ctx, token, tag, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + break; + case "block-map": + case "block-seq": + case "flow-collection": + node = composeCollection(CN, ctx, token, props, onError); + if (anchor) + node.anchor = anchor.source.substring(1); + break; + default: { + const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`; + onError(token, "UNEXPECTED_TOKEN", message); + node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError); + isSrcToken = false; + } + } + if (anchor && node.anchor === "") + onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) { + const msg = "With stringKeys, all keys must be strings"; + onError(tag ?? token, "NON_STRING_KEY", msg); + } + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + if (token.type === "scalar" && token.source === "") + node.comment = comment; + else + node.commentBefore = comment; + } + if (ctx.options.keepSourceTokens && isSrcToken) + node.srcToken = token; + return node; +} +function composeEmptyNode(ctx, offset, before2, pos, { spaceBefore, comment, anchor, tag, end }, onError) { + const token = { + type: "scalar", + offset: emptyScalarPosition(offset, before2, pos), + indent: -1, + source: "" + }; + const node = composeScalar(ctx, token, tag, onError); + if (anchor) { + node.anchor = anchor.source.substring(1); + if (node.anchor === "") + onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string"); + } + if (spaceBefore) + node.spaceBefore = true; + if (comment) { + node.comment = comment; + node.range[2] = end; + } + return node; +} +function composeAlias({ options }, { offset, source, end }, onError) { + const alias = new Alias(source.substring(1)); + if (alias.source === "") + onError(offset, "BAD_ALIAS", "Alias cannot be an empty string"); + if (alias.source.endsWith(":")) + onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true); + const valueEnd = offset + source.length; + const re4 = resolveEnd(end, valueEnd, options.strict, onError); + alias.range = [offset, valueEnd, re4.offset]; + if (re4.comment) + alias.comment = re4.comment; + return alias; +} +var CN; +var init_compose_node = __esm({ + "node_modules/yaml/browser/dist/compose/compose-node.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Alias(); + init_identity(); + init_compose_collection(); + init_compose_scalar(); + init_resolve_end(); + init_util_empty_scalar_position(); + CN = { composeNode, composeEmptyNode }; + } +}); + +// node_modules/yaml/browser/dist/compose/compose-doc.js +function composeDoc(options, directives, { offset, start, value: value2, end }, onError) { + const opts = Object.assign({ _directives: directives }, options); + const doc = new Document(void 0, opts); + const ctx = { + atKey: false, + atRoot: true, + directives: doc.directives, + options: doc.options, + schema: doc.schema + }; + const props = resolveProps(start, { + indicator: "doc-start", + next: value2 ?? end?.[0], + offset, + onError, + parentIndent: 0, + startOnNewline: true + }); + if (props.found) { + doc.directives.docStart = true; + if (value2 && (value2.type === "block-map" || value2.type === "block-seq") && !props.hasNewline) + onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker"); + } + doc.contents = value2 ? composeNode(ctx, value2, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError); + const contentEnd = doc.contents.range[2]; + const re4 = resolveEnd(end, contentEnd, false, onError); + if (re4.comment) + doc.comment = re4.comment; + doc.range = [offset, contentEnd, re4.offset]; + return doc; +} +var init_compose_doc = __esm({ + "node_modules/yaml/browser/dist/compose/compose-doc.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Document(); + init_compose_node(); + init_resolve_end(); + init_resolve_props(); + } +}); + +// node_modules/yaml/browser/dist/compose/composer.js +function getErrorPos(src) { + if (typeof src === "number") + return [src, src + 1]; + if (Array.isArray(src)) + return src.length === 2 ? src : [src[0], src[1]]; + const { offset, source } = src; + return [offset, offset + (typeof source === "string" ? source.length : 1)]; +} +function parsePrelude(prelude) { + let comment = ""; + let atComment = false; + let afterEmptyLine = false; + for (let i7 = 0; i7 < prelude.length; ++i7) { + const source = prelude[i7]; + switch (source[0]) { + case "#": + comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " "); + atComment = true; + afterEmptyLine = false; + break; + case "%": + if (prelude[i7 + 1]?.[0] !== "#") + i7 += 1; + atComment = false; + break; + default: + if (!atComment) + afterEmptyLine = true; + atComment = false; + } + } + return { comment, afterEmptyLine }; +} +var Composer; +var init_composer = __esm({ + "node_modules/yaml/browser/dist/compose/composer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_directives(); + init_Document(); + init_errors(); + init_identity(); + init_compose_doc(); + init_resolve_end(); + Composer = class { + constructor(options = {}) { + this.doc = null; + this.atDirectives = false; + this.prelude = []; + this.errors = []; + this.warnings = []; + this.onError = (source, code, message, warning) => { + const pos = getErrorPos(source); + if (warning) + this.warnings.push(new YAMLWarning(pos, code, message)); + else + this.errors.push(new YAMLParseError(pos, code, message)); + }; + this.directives = new Directives({ version: options.version || "1.2" }); + this.options = options; + } + decorate(doc, afterDoc) { + const { comment, afterEmptyLine } = parsePrelude(this.prelude); + if (comment) { + const dc = doc.contents; + if (afterDoc) { + doc.comment = doc.comment ? `${doc.comment} +${comment}` : comment; + } else if (afterEmptyLine || doc.directives.docStart || !dc) { + doc.commentBefore = comment; + } else if (isCollection(dc) && !dc.flow && dc.items.length > 0) { + let it2 = dc.items[0]; + if (isPair(it2)) + it2 = it2.key; + const cb = it2.commentBefore; + it2.commentBefore = cb ? `${comment} +${cb}` : comment; + } else { + const cb = dc.commentBefore; + dc.commentBefore = cb ? `${comment} +${cb}` : comment; + } + } + if (afterDoc) { + Array.prototype.push.apply(doc.errors, this.errors); + Array.prototype.push.apply(doc.warnings, this.warnings); + } else { + doc.errors = this.errors; + doc.warnings = this.warnings; + } + this.prelude = []; + this.errors = []; + this.warnings = []; + } + /** + * Current stream status information. + * + * Mostly useful at the end of input for an empty stream. + */ + streamInfo() { + return { + comment: parsePrelude(this.prelude).comment, + directives: this.directives, + errors: this.errors, + warnings: this.warnings + }; + } + /** + * Compose tokens into documents. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *compose(tokens, forceDoc = false, endOffset = -1) { + for (const token of tokens) + yield* this.next(token); + yield* this.end(forceDoc, endOffset); + } + /** Advance the composer by one CST token. */ + *next(token) { + switch (token.type) { + case "directive": + this.directives.add(token.source, (offset, message, warning) => { + const pos = getErrorPos(token); + pos[0] += offset; + this.onError(pos, "BAD_DIRECTIVE", message, warning); + }); + this.prelude.push(token.source); + this.atDirectives = true; + break; + case "document": { + const doc = composeDoc(this.options, this.directives, token, this.onError); + if (this.atDirectives && !doc.directives.docStart) + this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"); + this.decorate(doc, false); + if (this.doc) + yield this.doc; + this.doc = doc; + this.atDirectives = false; + break; + } + case "byte-order-mark": + case "space": + break; + case "comment": + case "newline": + this.prelude.push(token.source); + break; + case "error": { + const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message; + const error2 = new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg); + if (this.atDirectives || !this.doc) + this.errors.push(error2); + else + this.doc.errors.push(error2); + break; + } + case "doc-end": { + if (!this.doc) { + const msg = "Unexpected doc-end without preceding document"; + this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg)); + break; + } + this.doc.directives.docEnd = true; + const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError); + this.decorate(this.doc, true); + if (end.comment) { + const dc = this.doc.comment; + this.doc.comment = dc ? `${dc} +${end.comment}` : end.comment; + } + this.doc.range[2] = end.offset; + break; + } + default: + this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`)); + } + } + /** + * Call at end of input to yield any remaining document. + * + * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document. + * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly. + */ + *end(forceDoc = false, endOffset = -1) { + if (this.doc) { + this.decorate(this.doc, true); + yield this.doc; + this.doc = null; + } else if (forceDoc) { + const opts = Object.assign({ _directives: this.directives }, this.options); + const doc = new Document(void 0, opts); + if (this.atDirectives) + this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line"); + doc.range = [0, endOffset, endOffset]; + this.decorate(doc, false); + yield doc; + } + } + }; + } +}); + +// node_modules/yaml/browser/dist/parse/cst-scalar.js +var init_cst_scalar = __esm({ + "node_modules/yaml/browser/dist/parse/cst-scalar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_resolve_block_scalar(); + init_resolve_flow_scalar(); + init_errors(); + init_stringifyString(); + } +}); + +// node_modules/yaml/browser/dist/parse/cst-stringify.js +var init_cst_stringify = __esm({ + "node_modules/yaml/browser/dist/parse/cst-stringify.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/yaml/browser/dist/parse/cst-visit.js +function visit2(cst, visitor) { + if ("type" in cst && cst.type === "document") + cst = { start: cst.start, value: cst.value }; + _visit(Object.freeze([]), cst, visitor); +} +function _visit(path2, item, visitor) { + let ctrl = visitor(item, path2); + if (typeof ctrl === "symbol") + return ctrl; + for (const field of ["key", "value"]) { + const token = item[field]; + if (token && "items" in token) { + for (let i7 = 0; i7 < token.items.length; ++i7) { + const ci = _visit(Object.freeze(path2.concat([[field, i7]])), token.items[i7], visitor); + if (typeof ci === "number") + i7 = ci - 1; + else if (ci === BREAK2) + return BREAK2; + else if (ci === REMOVE2) { + token.items.splice(i7, 1); + i7 -= 1; + } + } + if (typeof ctrl === "function" && field === "key") + ctrl = ctrl(item, path2); + } + } + return typeof ctrl === "function" ? ctrl(item, path2) : ctrl; +} +var BREAK2, SKIP2, REMOVE2; +var init_cst_visit = __esm({ + "node_modules/yaml/browser/dist/parse/cst-visit.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + BREAK2 = Symbol("break visit"); + SKIP2 = Symbol("skip children"); + REMOVE2 = Symbol("remove item"); + visit2.BREAK = BREAK2; + visit2.SKIP = SKIP2; + visit2.REMOVE = REMOVE2; + visit2.itemAtPath = (cst, path2) => { + let item = cst; + for (const [field, index4] of path2) { + const tok = item?.[field]; + if (tok && "items" in tok) { + item = tok.items[index4]; + } else + return void 0; + } + return item; + }; + visit2.parentCollection = (cst, path2) => { + const parent2 = visit2.itemAtPath(cst, path2.slice(0, -1)); + const field = path2[path2.length - 1][0]; + const coll = parent2?.[field]; + if (coll && "items" in coll) + return coll; + throw new Error("Parent collection not found"); + }; + } +}); + +// node_modules/yaml/browser/dist/parse/cst.js +function tokenType(source) { + switch (source) { + case BOM: + return "byte-order-mark"; + case DOCUMENT: + return "doc-mode"; + case FLOW_END: + return "flow-error-end"; + case SCALAR2: + return "scalar"; + case "---": + return "doc-start"; + case "...": + return "doc-end"; + case "": + case "\n": + case "\r\n": + return "newline"; + case "-": + return "seq-item-ind"; + case "?": + return "explicit-key-ind"; + case ":": + return "map-value-ind"; + case "{": + return "flow-map-start"; + case "}": + return "flow-map-end"; + case "[": + return "flow-seq-start"; + case "]": + return "flow-seq-end"; + case ",": + return "comma"; + } + switch (source[0]) { + case " ": + case " ": + return "space"; + case "#": + return "comment"; + case "%": + return "directive-line"; + case "*": + return "alias"; + case "&": + return "anchor"; + case "!": + return "tag"; + case "'": + return "single-quoted-scalar"; + case '"': + return "double-quoted-scalar"; + case "|": + case ">": + return "block-scalar-header"; + } + return null; +} +var BOM, DOCUMENT, FLOW_END, SCALAR2; +var init_cst = __esm({ + "node_modules/yaml/browser/dist/parse/cst.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cst_scalar(); + init_cst_stringify(); + init_cst_visit(); + BOM = "\uFEFF"; + DOCUMENT = ""; + FLOW_END = ""; + SCALAR2 = ""; + } +}); + +// node_modules/yaml/browser/dist/parse/lexer.js +function isEmpty(ch) { + switch (ch) { + case void 0: + case " ": + case "\n": + case "\r": + case " ": + return true; + default: + return false; + } +} +var hexDigits, tagChars, flowIndicatorChars, invalidAnchorChars, isNotAnchorChar, Lexer; +var init_lexer = __esm({ + "node_modules/yaml/browser/dist/parse/lexer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cst(); + hexDigits = new Set("0123456789ABCDEFabcdef"); + tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"); + flowIndicatorChars = new Set(",[]{}"); + invalidAnchorChars = new Set(" ,[]{}\n\r "); + isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch); + Lexer = class { + constructor() { + this.atEnd = false; + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + this.buffer = ""; + this.flowKey = false; + this.flowLevel = 0; + this.indentNext = 0; + this.indentValue = 0; + this.lineEndPos = null; + this.next = null; + this.pos = 0; + } + /** + * Generate YAML tokens from the `source` string. If `incomplete`, + * a part of the last line may be left as a buffer for the next call. + * + * @returns A generator of lexical tokens + */ + *lex(source, incomplete = false) { + if (source) { + if (typeof source !== "string") + throw TypeError("source is not a string"); + this.buffer = this.buffer ? this.buffer + source : source; + this.lineEndPos = null; + } + this.atEnd = !incomplete; + let next = this.next ?? "stream"; + while (next && (incomplete || this.hasChars(1))) + next = yield* this.parseNext(next); + } + atLineEnd() { + let i7 = this.pos; + let ch = this.buffer[i7]; + while (ch === " " || ch === " ") + ch = this.buffer[++i7]; + if (!ch || ch === "#" || ch === "\n") + return true; + if (ch === "\r") + return this.buffer[i7 + 1] === "\n"; + return false; + } + charAt(n7) { + return this.buffer[this.pos + n7]; + } + continueScalar(offset) { + let ch = this.buffer[offset]; + if (this.indentNext > 0) { + let indent = 0; + while (ch === " ") + ch = this.buffer[++indent + offset]; + if (ch === "\r") { + const next = this.buffer[indent + offset + 1]; + if (next === "\n" || !next && !this.atEnd) + return offset + indent + 1; + } + return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset + indent : -1; + } + if (ch === "-" || ch === ".") { + const dt = this.buffer.substr(offset, 3); + if ((dt === "---" || dt === "...") && isEmpty(this.buffer[offset + 3])) + return -1; + } + return offset; + } + getLine() { + let end = this.lineEndPos; + if (typeof end !== "number" || end !== -1 && end < this.pos) { + end = this.buffer.indexOf("\n", this.pos); + this.lineEndPos = end; + } + if (end === -1) + return this.atEnd ? this.buffer.substring(this.pos) : null; + if (this.buffer[end - 1] === "\r") + end -= 1; + return this.buffer.substring(this.pos, end); + } + hasChars(n7) { + return this.pos + n7 <= this.buffer.length; + } + setNext(state) { + this.buffer = this.buffer.substring(this.pos); + this.pos = 0; + this.lineEndPos = null; + this.next = state; + return null; + } + peek(n7) { + return this.buffer.substr(this.pos, n7); + } + *parseNext(next) { + switch (next) { + case "stream": + return yield* this.parseStream(); + case "line-start": + return yield* this.parseLineStart(); + case "block-start": + return yield* this.parseBlockStart(); + case "doc": + return yield* this.parseDocument(); + case "flow": + return yield* this.parseFlowCollection(); + case "quoted-scalar": + return yield* this.parseQuotedScalar(); + case "block-scalar": + return yield* this.parseBlockScalar(); + case "plain-scalar": + return yield* this.parsePlainScalar(); + } + } + *parseStream() { + let line = this.getLine(); + if (line === null) + return this.setNext("stream"); + if (line[0] === BOM) { + yield* this.pushCount(1); + line = line.substring(1); + } + if (line[0] === "%") { + let dirEnd = line.length; + let cs = line.indexOf("#"); + while (cs !== -1) { + const ch = line[cs - 1]; + if (ch === " " || ch === " ") { + dirEnd = cs - 1; + break; + } else { + cs = line.indexOf("#", cs + 1); + } + } + while (true) { + const ch = line[dirEnd - 1]; + if (ch === " " || ch === " ") + dirEnd -= 1; + else + break; + } + const n7 = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true)); + yield* this.pushCount(line.length - n7); + this.pushNewline(); + return "stream"; + } + if (this.atLineEnd()) { + const sp = yield* this.pushSpaces(true); + yield* this.pushCount(line.length - sp); + yield* this.pushNewline(); + return "stream"; + } + yield DOCUMENT; + return yield* this.parseLineStart(); + } + *parseLineStart() { + const ch = this.charAt(0); + if (!ch && !this.atEnd) + return this.setNext("line-start"); + if (ch === "-" || ch === ".") { + if (!this.atEnd && !this.hasChars(4)) + return this.setNext("line-start"); + const s7 = this.peek(3); + if ((s7 === "---" || s7 === "...") && isEmpty(this.charAt(3))) { + yield* this.pushCount(3); + this.indentValue = 0; + this.indentNext = 0; + return s7 === "---" ? "doc" : "stream"; + } + } + this.indentValue = yield* this.pushSpaces(false); + if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1))) + this.indentNext = this.indentValue; + return yield* this.parseBlockStart(); + } + *parseBlockStart() { + const [ch0, ch1] = this.peek(2); + if (!ch1 && !this.atEnd) + return this.setNext("block-start"); + if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty(ch1)) { + const n7 = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)); + this.indentNext = this.indentValue + 1; + this.indentValue += n7; + return yield* this.parseBlockStart(); + } + return "doc"; + } + *parseDocument() { + yield* this.pushSpaces(true); + const line = this.getLine(); + if (line === null) + return this.setNext("doc"); + let n7 = yield* this.pushIndicators(); + switch (line[n7]) { + case "#": + yield* this.pushCount(line.length - n7); + case void 0: + yield* this.pushNewline(); + return yield* this.parseLineStart(); + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel = 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + return "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "doc"; + case '"': + case "'": + return yield* this.parseQuotedScalar(); + case "|": + case ">": + n7 += yield* this.parseBlockScalarHeader(); + n7 += yield* this.pushSpaces(true); + yield* this.pushCount(line.length - n7); + yield* this.pushNewline(); + return yield* this.parseBlockScalar(); + default: + return yield* this.parsePlainScalar(); + } + } + *parseFlowCollection() { + let nl, sp; + let indent = -1; + do { + nl = yield* this.pushNewline(); + if (nl > 0) { + sp = yield* this.pushSpaces(false); + this.indentValue = indent = sp; + } else { + sp = 0; + } + sp += yield* this.pushSpaces(true); + } while (nl + sp > 0); + const line = this.getLine(); + if (line === null) + return this.setNext("flow"); + if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty(line[3])) { + const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}"); + if (!atFlowEndMarker) { + this.flowLevel = 0; + yield FLOW_END; + return yield* this.parseLineStart(); + } + } + let n7 = 0; + while (line[n7] === ",") { + n7 += yield* this.pushCount(1); + n7 += yield* this.pushSpaces(true); + this.flowKey = false; + } + n7 += yield* this.pushIndicators(); + switch (line[n7]) { + case void 0: + return "flow"; + case "#": + yield* this.pushCount(line.length - n7); + return "flow"; + case "{": + case "[": + yield* this.pushCount(1); + this.flowKey = false; + this.flowLevel += 1; + return "flow"; + case "}": + case "]": + yield* this.pushCount(1); + this.flowKey = true; + this.flowLevel -= 1; + return this.flowLevel ? "flow" : "doc"; + case "*": + yield* this.pushUntil(isNotAnchorChar); + return "flow"; + case '"': + case "'": + this.flowKey = true; + return yield* this.parseQuotedScalar(); + case ":": { + const next = this.charAt(1); + if (this.flowKey || isEmpty(next) || next === ",") { + this.flowKey = false; + yield* this.pushCount(1); + yield* this.pushSpaces(true); + return "flow"; + } + } + default: + this.flowKey = false; + return yield* this.parsePlainScalar(); + } + } + *parseQuotedScalar() { + const quote = this.charAt(0); + let end = this.buffer.indexOf(quote, this.pos + 1); + if (quote === "'") { + while (end !== -1 && this.buffer[end + 1] === "'") + end = this.buffer.indexOf("'", end + 2); + } else { + while (end !== -1) { + let n7 = 0; + while (this.buffer[end - 1 - n7] === "\\") + n7 += 1; + if (n7 % 2 === 0) + break; + end = this.buffer.indexOf('"', end + 1); + } + } + const qb = this.buffer.substring(0, end); + let nl = qb.indexOf("\n", this.pos); + if (nl !== -1) { + while (nl !== -1) { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = qb.indexOf("\n", cs); + } + if (nl !== -1) { + end = nl - (qb[nl - 1] === "\r" ? 2 : 1); + } + } + if (end === -1) { + if (!this.atEnd) + return this.setNext("quoted-scalar"); + end = this.buffer.length; + } + yield* this.pushToIndex(end + 1, false); + return this.flowLevel ? "flow" : "doc"; + } + *parseBlockScalarHeader() { + this.blockScalarIndent = -1; + this.blockScalarKeep = false; + let i7 = this.pos; + while (true) { + const ch = this.buffer[++i7]; + if (ch === "+") + this.blockScalarKeep = true; + else if (ch > "0" && ch <= "9") + this.blockScalarIndent = Number(ch) - 1; + else if (ch !== "-") + break; + } + return yield* this.pushUntil((ch) => isEmpty(ch) || ch === "#"); + } + *parseBlockScalar() { + let nl = this.pos - 1; + let indent = 0; + let ch; + loop: + for (let i8 = this.pos; ch = this.buffer[i8]; ++i8) { + switch (ch) { + case " ": + indent += 1; + break; + case "\n": + nl = i8; + indent = 0; + break; + case "\r": { + const next = this.buffer[i8 + 1]; + if (!next && !this.atEnd) + return this.setNext("block-scalar"); + if (next === "\n") + break; + } + default: + break loop; + } + } + if (!ch && !this.atEnd) + return this.setNext("block-scalar"); + if (indent >= this.indentNext) { + if (this.blockScalarIndent === -1) + this.indentNext = indent; + else { + this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext); + } + do { + const cs = this.continueScalar(nl + 1); + if (cs === -1) + break; + nl = this.buffer.indexOf("\n", cs); + } while (nl !== -1); + if (nl === -1) { + if (!this.atEnd) + return this.setNext("block-scalar"); + nl = this.buffer.length; + } + } + let i7 = nl + 1; + ch = this.buffer[i7]; + while (ch === " ") + ch = this.buffer[++i7]; + if (ch === " ") { + while (ch === " " || ch === " " || ch === "\r" || ch === "\n") + ch = this.buffer[++i7]; + nl = i7 - 1; + } else if (!this.blockScalarKeep) { + do { + let i8 = nl - 1; + let ch2 = this.buffer[i8]; + if (ch2 === "\r") + ch2 = this.buffer[--i8]; + const lastChar = i8; + while (ch2 === " ") + ch2 = this.buffer[--i8]; + if (ch2 === "\n" && i8 >= this.pos && i8 + 1 + indent > lastChar) + nl = i8; + else + break; + } while (true); + } + yield SCALAR2; + yield* this.pushToIndex(nl + 1, true); + return yield* this.parseLineStart(); + } + *parsePlainScalar() { + const inFlow = this.flowLevel > 0; + let end = this.pos - 1; + let i7 = this.pos - 1; + let ch; + while (ch = this.buffer[++i7]) { + if (ch === ":") { + const next = this.buffer[i7 + 1]; + if (isEmpty(next) || inFlow && flowIndicatorChars.has(next)) + break; + end = i7; + } else if (isEmpty(ch)) { + let next = this.buffer[i7 + 1]; + if (ch === "\r") { + if (next === "\n") { + i7 += 1; + ch = "\n"; + next = this.buffer[i7 + 1]; + } else + end = i7; + } + if (next === "#" || inFlow && flowIndicatorChars.has(next)) + break; + if (ch === "\n") { + const cs = this.continueScalar(i7 + 1); + if (cs === -1) + break; + i7 = Math.max(i7, cs - 2); + } + } else { + if (inFlow && flowIndicatorChars.has(ch)) + break; + end = i7; + } + } + if (!ch && !this.atEnd) + return this.setNext("plain-scalar"); + yield SCALAR2; + yield* this.pushToIndex(end + 1, true); + return inFlow ? "flow" : "doc"; + } + *pushCount(n7) { + if (n7 > 0) { + yield this.buffer.substr(this.pos, n7); + this.pos += n7; + return n7; + } + return 0; + } + *pushToIndex(i7, allowEmpty) { + const s7 = this.buffer.slice(this.pos, i7); + if (s7) { + yield s7; + this.pos += s7.length; + return s7.length; + } else if (allowEmpty) + yield ""; + return 0; + } + *pushIndicators() { + switch (this.charAt(0)) { + case "!": + return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + case "&": + return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + case "-": + case "?": + case ":": { + const inFlow = this.flowLevel > 0; + const ch1 = this.charAt(1); + if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) { + if (!inFlow) + this.indentNext = this.indentValue + 1; + else if (this.flowKey) + this.flowKey = false; + return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators()); + } + } + } + return 0; + } + *pushTag() { + if (this.charAt(1) === "<") { + let i7 = this.pos + 2; + let ch = this.buffer[i7]; + while (!isEmpty(ch) && ch !== ">") + ch = this.buffer[++i7]; + return yield* this.pushToIndex(ch === ">" ? i7 + 1 : i7, false); + } else { + let i7 = this.pos + 1; + let ch = this.buffer[i7]; + while (ch) { + if (tagChars.has(ch)) + ch = this.buffer[++i7]; + else if (ch === "%" && hexDigits.has(this.buffer[i7 + 1]) && hexDigits.has(this.buffer[i7 + 2])) { + ch = this.buffer[i7 += 3]; + } else + break; + } + return yield* this.pushToIndex(i7, false); + } + } + *pushNewline() { + const ch = this.buffer[this.pos]; + if (ch === "\n") + return yield* this.pushCount(1); + else if (ch === "\r" && this.charAt(1) === "\n") + return yield* this.pushCount(2); + else + return 0; + } + *pushSpaces(allowTabs) { + let i7 = this.pos - 1; + let ch; + do { + ch = this.buffer[++i7]; + } while (ch === " " || allowTabs && ch === " "); + const n7 = i7 - this.pos; + if (n7 > 0) { + yield this.buffer.substr(this.pos, n7); + this.pos = i7; + } + return n7; + } + *pushUntil(test) { + let i7 = this.pos; + let ch = this.buffer[i7]; + while (!test(ch)) + ch = this.buffer[++i7]; + return yield* this.pushToIndex(i7, false); + } + }; + } +}); + +// node_modules/yaml/browser/dist/parse/line-counter.js +var LineCounter; +var init_line_counter = __esm({ + "node_modules/yaml/browser/dist/parse/line-counter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + LineCounter = class { + constructor() { + this.lineStarts = []; + this.addNewLine = (offset) => this.lineStarts.push(offset); + this.linePos = (offset) => { + let low = 0; + let high = this.lineStarts.length; + while (low < high) { + const mid = low + high >> 1; + if (this.lineStarts[mid] < offset) + low = mid + 1; + else + high = mid; + } + if (this.lineStarts[low] === offset) + return { line: low + 1, col: 1 }; + if (low === 0) + return { line: 0, col: offset }; + const start = this.lineStarts[low - 1]; + return { line: low, col: offset - start + 1 }; + }; + } + }; + } +}); + +// node_modules/yaml/browser/dist/parse/parser.js +function includesToken(list, type3) { + for (let i7 = 0; i7 < list.length; ++i7) + if (list[i7].type === type3) + return true; + return false; +} +function findNonEmptyIndex(list) { + for (let i7 = 0; i7 < list.length; ++i7) { + switch (list[i7].type) { + case "space": + case "comment": + case "newline": + break; + default: + return i7; + } + } + return -1; +} +function isFlowToken(token) { + switch (token?.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + case "flow-collection": + return true; + default: + return false; + } +} +function getPrevProps(parent2) { + switch (parent2.type) { + case "document": + return parent2.start; + case "block-map": { + const it2 = parent2.items[parent2.items.length - 1]; + return it2.sep ?? it2.start; + } + case "block-seq": + return parent2.items[parent2.items.length - 1].start; + default: + return []; + } +} +function getFirstKeyStartProps(prev) { + if (prev.length === 0) + return []; + let i7 = prev.length; + loop: + while (--i7 >= 0) { + switch (prev[i7].type) { + case "doc-start": + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + case "newline": + break loop; + } + } + while (prev[++i7]?.type === "space") { + } + return prev.splice(i7, prev.length); +} +function fixFlowSeqItems(fc) { + if (fc.start.type === "flow-seq-start") { + for (const it2 of fc.items) { + if (it2.sep && !it2.value && !includesToken(it2.start, "explicit-key-ind") && !includesToken(it2.sep, "map-value-ind")) { + if (it2.key) + it2.value = it2.key; + delete it2.key; + if (isFlowToken(it2.value)) { + if (it2.value.end) + Array.prototype.push.apply(it2.value.end, it2.sep); + else + it2.value.end = it2.sep; + } else + Array.prototype.push.apply(it2.start, it2.sep); + delete it2.sep; + } + } + } +} +var Parser; +var init_parser = __esm({ + "node_modules/yaml/browser/dist/parse/parser.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cst(); + init_lexer(); + Parser = class { + /** + * @param onNewLine - If defined, called separately with the start position of + * each new line (in `parse()`, including the start of input). + */ + constructor(onNewLine) { + this.atNewLine = true; + this.atScalar = false; + this.indent = 0; + this.offset = 0; + this.onKeyLine = false; + this.stack = []; + this.source = ""; + this.type = ""; + this.lexer = new Lexer(); + this.onNewLine = onNewLine; + } + /** + * Parse `source` as a YAML stream. + * If `incomplete`, a part of the last line may be left as a buffer for the next call. + * + * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens. + * + * @returns A generator of tokens representing each directive, document, and other structure. + */ + *parse(source, incomplete = false) { + if (this.onNewLine && this.offset === 0) + this.onNewLine(0); + for (const lexeme of this.lexer.lex(source, incomplete)) + yield* this.next(lexeme); + if (!incomplete) + yield* this.end(); + } + /** + * Advance the parser by the `source` of one lexical token. + */ + *next(source) { + this.source = source; + if (this.atScalar) { + this.atScalar = false; + yield* this.step(); + this.offset += source.length; + return; + } + const type3 = tokenType(source); + if (!type3) { + const message = `Not a YAML token: ${source}`; + yield* this.pop({ type: "error", offset: this.offset, message, source }); + this.offset += source.length; + } else if (type3 === "scalar") { + this.atNewLine = false; + this.atScalar = true; + this.type = "scalar"; + } else { + this.type = type3; + yield* this.step(); + switch (type3) { + case "newline": + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) + this.onNewLine(this.offset + source.length); + break; + case "space": + if (this.atNewLine && source[0] === " ") + this.indent += source.length; + break; + case "explicit-key-ind": + case "map-value-ind": + case "seq-item-ind": + if (this.atNewLine) + this.indent += source.length; + break; + case "doc-mode": + case "flow-error-end": + return; + default: + this.atNewLine = false; + } + this.offset += source.length; + } + } + /** Call at end of input to push out any remaining constructions */ + *end() { + while (this.stack.length > 0) + yield* this.pop(); + } + get sourceToken() { + const st2 = { + type: this.type, + offset: this.offset, + indent: this.indent, + source: this.source + }; + return st2; + } + *step() { + const top = this.peek(1); + if (this.type === "doc-end" && (!top || top.type !== "doc-end")) { + while (this.stack.length > 0) + yield* this.pop(); + this.stack.push({ + type: "doc-end", + offset: this.offset, + source: this.source + }); + return; + } + if (!top) + return yield* this.stream(); + switch (top.type) { + case "document": + return yield* this.document(top); + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + return yield* this.scalar(top); + case "block-scalar": + return yield* this.blockScalar(top); + case "block-map": + return yield* this.blockMap(top); + case "block-seq": + return yield* this.blockSequence(top); + case "flow-collection": + return yield* this.flowCollection(top); + case "doc-end": + return yield* this.documentEnd(top); + } + yield* this.pop(); + } + peek(n7) { + return this.stack[this.stack.length - n7]; + } + *pop(error2) { + const token = error2 ?? this.stack.pop(); + if (!token) { + const message = "Tried to pop an empty stack"; + yield { type: "error", offset: this.offset, source: "", message }; + } else if (this.stack.length === 0) { + yield token; + } else { + const top = this.peek(1); + if (token.type === "block-scalar") { + token.indent = "indent" in top ? top.indent : 0; + } else if (token.type === "flow-collection" && top.type === "document") { + token.indent = 0; + } + if (token.type === "flow-collection") + fixFlowSeqItems(token); + switch (top.type) { + case "document": + top.value = token; + break; + case "block-scalar": + top.props.push(token); + break; + case "block-map": { + const it2 = top.items[top.items.length - 1]; + if (it2.value) { + top.items.push({ start: [], key: token, sep: [] }); + this.onKeyLine = true; + return; + } else if (it2.sep) { + it2.value = token; + } else { + Object.assign(it2, { key: token, sep: [] }); + this.onKeyLine = !it2.explicitKey; + return; + } + break; + } + case "block-seq": { + const it2 = top.items[top.items.length - 1]; + if (it2.value) + top.items.push({ start: [], value: token }); + else + it2.value = token; + break; + } + case "flow-collection": { + const it2 = top.items[top.items.length - 1]; + if (!it2 || it2.value) + top.items.push({ start: [], key: token, sep: [] }); + else if (it2.sep) + it2.value = token; + else + Object.assign(it2, { key: token, sep: [] }); + return; + } + default: + yield* this.pop(); + yield* this.pop(token); + } + if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) { + const last2 = token.items[token.items.length - 1]; + if (last2 && !last2.sep && !last2.value && last2.start.length > 0 && findNonEmptyIndex(last2.start) === -1 && (token.indent === 0 || last2.start.every((st2) => st2.type !== "comment" || st2.indent < token.indent))) { + if (top.type === "document") + top.end = last2.start; + else + top.items.push({ start: last2.start }); + token.items.splice(-1, 1); + } + } + } + } + *stream() { + switch (this.type) { + case "directive-line": + yield { type: "directive", offset: this.offset, source: this.source }; + return; + case "byte-order-mark": + case "space": + case "comment": + case "newline": + yield this.sourceToken; + return; + case "doc-mode": + case "doc-start": { + const doc = { + type: "document", + offset: this.offset, + start: [] + }; + if (this.type === "doc-start") + doc.start.push(this.sourceToken); + this.stack.push(doc); + return; + } + } + yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML stream`, + source: this.source + }; + } + *document(doc) { + if (doc.value) + return yield* this.lineEnd(doc); + switch (this.type) { + case "doc-start": { + if (findNonEmptyIndex(doc.start) !== -1) { + yield* this.pop(); + yield* this.step(); + } else + doc.start.push(this.sourceToken); + return; + } + case "anchor": + case "tag": + case "space": + case "comment": + case "newline": + doc.start.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(doc); + if (bv) + this.stack.push(bv); + else { + yield { + type: "error", + offset: this.offset, + message: `Unexpected ${this.type} token in YAML document`, + source: this.source + }; + } + } + *scalar(scalar) { + if (this.type === "map-value-ind") { + const prev = getPrevProps(this.peek(2)); + const start = getFirstKeyStartProps(prev); + let sep2; + if (scalar.end) { + sep2 = scalar.end; + sep2.push(this.sourceToken); + delete scalar.end; + } else + sep2 = [this.sourceToken]; + const map4 = { + type: "block-map", + offset: scalar.offset, + indent: scalar.indent, + items: [{ start, key: scalar, sep: sep2 }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map4; + } else + yield* this.lineEnd(scalar); + } + *blockScalar(scalar) { + switch (this.type) { + case "space": + case "comment": + case "newline": + scalar.props.push(this.sourceToken); + return; + case "scalar": + scalar.source = this.source; + this.atNewLine = true; + this.indent = 0; + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + yield* this.pop(); + break; + default: + yield* this.pop(); + yield* this.step(); + } + } + *blockMap(map4) { + const it2 = map4.items[map4.items.length - 1]; + switch (this.type) { + case "newline": + this.onKeyLine = false; + if (it2.value) { + const end = "end" in it2.value ? it2.value.end : void 0; + const last2 = Array.isArray(end) ? end[end.length - 1] : void 0; + if (last2?.type === "comment") + end?.push(this.sourceToken); + else + map4.items.push({ start: [this.sourceToken] }); + } else if (it2.sep) { + it2.sep.push(this.sourceToken); + } else { + it2.start.push(this.sourceToken); + } + return; + case "space": + case "comment": + if (it2.value) { + map4.items.push({ start: [this.sourceToken] }); + } else if (it2.sep) { + it2.sep.push(this.sourceToken); + } else { + if (this.atIndentedComment(it2.start, map4.indent)) { + const prev = map4.items[map4.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it2.start); + end.push(this.sourceToken); + map4.items.pop(); + return; + } + } + it2.start.push(this.sourceToken); + } + return; + } + if (this.indent >= map4.indent) { + const atMapIndent = !this.onKeyLine && this.indent === map4.indent; + const atNextItem = atMapIndent && (it2.sep || it2.explicitKey) && this.type !== "seq-item-ind"; + let start = []; + if (atNextItem && it2.sep && !it2.value) { + const nl = []; + for (let i7 = 0; i7 < it2.sep.length; ++i7) { + const st2 = it2.sep[i7]; + switch (st2.type) { + case "newline": + nl.push(i7); + break; + case "space": + break; + case "comment": + if (st2.indent > map4.indent) + nl.length = 0; + break; + default: + nl.length = 0; + } + } + if (nl.length >= 2) + start = it2.sep.splice(nl[1]); + } + switch (this.type) { + case "anchor": + case "tag": + if (atNextItem || it2.value) { + start.push(this.sourceToken); + map4.items.push({ start }); + this.onKeyLine = true; + } else if (it2.sep) { + it2.sep.push(this.sourceToken); + } else { + it2.start.push(this.sourceToken); + } + return; + case "explicit-key-ind": + if (!it2.sep && !it2.explicitKey) { + it2.start.push(this.sourceToken); + it2.explicitKey = true; + } else if (atNextItem || it2.value) { + start.push(this.sourceToken); + map4.items.push({ start, explicitKey: true }); + } else { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken], explicitKey: true }] + }); + } + this.onKeyLine = true; + return; + case "map-value-ind": + if (it2.explicitKey) { + if (!it2.sep) { + if (includesToken(it2.start, "newline")) { + Object.assign(it2, { key: null, sep: [this.sourceToken] }); + } else { + const start2 = getFirstKeyStartProps(it2.start); + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: start2, key: null, sep: [this.sourceToken] }] + }); + } + } else if (it2.value) { + map4.items.push({ start: [], key: null, sep: [this.sourceToken] }); + } else if (includesToken(it2.sep, "map-value-ind")) { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }); + } else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) { + const start2 = getFirstKeyStartProps(it2.start); + const key = it2.key; + const sep2 = it2.sep; + sep2.push(this.sourceToken); + delete it2.key; + delete it2.sep; + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: start2, key, sep: sep2 }] + }); + } else if (start.length > 0) { + it2.sep = it2.sep.concat(start, this.sourceToken); + } else { + it2.sep.push(this.sourceToken); + } + } else { + if (!it2.sep) { + Object.assign(it2, { key: null, sep: [this.sourceToken] }); + } else if (it2.value || atNextItem) { + map4.items.push({ start, key: null, sep: [this.sourceToken] }); + } else if (includesToken(it2.sep, "map-value-ind")) { + this.stack.push({ + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start: [], key: null, sep: [this.sourceToken] }] + }); + } else { + it2.sep.push(this.sourceToken); + } + } + this.onKeyLine = true; + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs = this.flowScalar(this.type); + if (atNextItem || it2.value) { + map4.items.push({ start, key: fs, sep: [] }); + this.onKeyLine = true; + } else if (it2.sep) { + this.stack.push(fs); + } else { + Object.assign(it2, { key: fs, sep: [] }); + this.onKeyLine = true; + } + return; + } + default: { + const bv = this.startBlockValue(map4); + if (bv) { + if (bv.type === "block-seq") { + if (!it2.explicitKey && it2.sep && !includesToken(it2.sep, "newline")) { + yield* this.pop({ + type: "error", + offset: this.offset, + message: "Unexpected block-seq-ind on same line with key", + source: this.source + }); + return; + } + } else if (atMapIndent) { + map4.items.push({ start }); + } + this.stack.push(bv); + return; + } + } + } + } + yield* this.pop(); + yield* this.step(); + } + *blockSequence(seq3) { + const it2 = seq3.items[seq3.items.length - 1]; + switch (this.type) { + case "newline": + if (it2.value) { + const end = "end" in it2.value ? it2.value.end : void 0; + const last2 = Array.isArray(end) ? end[end.length - 1] : void 0; + if (last2?.type === "comment") + end?.push(this.sourceToken); + else + seq3.items.push({ start: [this.sourceToken] }); + } else + it2.start.push(this.sourceToken); + return; + case "space": + case "comment": + if (it2.value) + seq3.items.push({ start: [this.sourceToken] }); + else { + if (this.atIndentedComment(it2.start, seq3.indent)) { + const prev = seq3.items[seq3.items.length - 2]; + const end = prev?.value?.end; + if (Array.isArray(end)) { + Array.prototype.push.apply(end, it2.start); + end.push(this.sourceToken); + seq3.items.pop(); + return; + } + } + it2.start.push(this.sourceToken); + } + return; + case "anchor": + case "tag": + if (it2.value || this.indent <= seq3.indent) + break; + it2.start.push(this.sourceToken); + return; + case "seq-item-ind": + if (this.indent !== seq3.indent) + break; + if (it2.value || includesToken(it2.start, "seq-item-ind")) + seq3.items.push({ start: [this.sourceToken] }); + else + it2.start.push(this.sourceToken); + return; + } + if (this.indent > seq3.indent) { + const bv = this.startBlockValue(seq3); + if (bv) { + this.stack.push(bv); + return; + } + } + yield* this.pop(); + yield* this.step(); + } + *flowCollection(fc) { + const it2 = fc.items[fc.items.length - 1]; + if (this.type === "flow-error-end") { + let top; + do { + yield* this.pop(); + top = this.peek(1); + } while (top && top.type === "flow-collection"); + } else if (fc.end.length === 0) { + switch (this.type) { + case "comma": + case "explicit-key-ind": + if (!it2 || it2.sep) + fc.items.push({ start: [this.sourceToken] }); + else + it2.start.push(this.sourceToken); + return; + case "map-value-ind": + if (!it2 || it2.value) + fc.items.push({ start: [], key: null, sep: [this.sourceToken] }); + else if (it2.sep) + it2.sep.push(this.sourceToken); + else + Object.assign(it2, { key: null, sep: [this.sourceToken] }); + return; + case "space": + case "comment": + case "newline": + case "anchor": + case "tag": + if (!it2 || it2.value) + fc.items.push({ start: [this.sourceToken] }); + else if (it2.sep) + it2.sep.push(this.sourceToken); + else + it2.start.push(this.sourceToken); + return; + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": { + const fs = this.flowScalar(this.type); + if (!it2 || it2.value) + fc.items.push({ start: [], key: fs, sep: [] }); + else if (it2.sep) + this.stack.push(fs); + else + Object.assign(it2, { key: fs, sep: [] }); + return; + } + case "flow-map-end": + case "flow-seq-end": + fc.end.push(this.sourceToken); + return; + } + const bv = this.startBlockValue(fc); + if (bv) + this.stack.push(bv); + else { + yield* this.pop(); + yield* this.step(); + } + } else { + const parent2 = this.peek(2); + if (parent2.type === "block-map" && (this.type === "map-value-ind" && parent2.indent === fc.indent || this.type === "newline" && !parent2.items[parent2.items.length - 1].sep)) { + yield* this.pop(); + yield* this.step(); + } else if (this.type === "map-value-ind" && parent2.type !== "flow-collection") { + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + fixFlowSeqItems(fc); + const sep2 = fc.end.splice(1, fc.end.length); + sep2.push(this.sourceToken); + const map4 = { + type: "block-map", + offset: fc.offset, + indent: fc.indent, + items: [{ start, key: fc, sep: sep2 }] + }; + this.onKeyLine = true; + this.stack[this.stack.length - 1] = map4; + } else { + yield* this.lineEnd(fc); + } + } + } + flowScalar(type3) { + if (this.onNewLine) { + let nl = this.source.indexOf("\n") + 1; + while (nl !== 0) { + this.onNewLine(this.offset + nl); + nl = this.source.indexOf("\n", nl) + 1; + } + } + return { + type: type3, + offset: this.offset, + indent: this.indent, + source: this.source + }; + } + startBlockValue(parent2) { + switch (this.type) { + case "alias": + case "scalar": + case "single-quoted-scalar": + case "double-quoted-scalar": + return this.flowScalar(this.type); + case "block-scalar-header": + return { + type: "block-scalar", + offset: this.offset, + indent: this.indent, + props: [this.sourceToken], + source: "" + }; + case "flow-map-start": + case "flow-seq-start": + return { + type: "flow-collection", + offset: this.offset, + indent: this.indent, + start: this.sourceToken, + items: [], + end: [] + }; + case "seq-item-ind": + return { + type: "block-seq", + offset: this.offset, + indent: this.indent, + items: [{ start: [this.sourceToken] }] + }; + case "explicit-key-ind": { + this.onKeyLine = true; + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + start.push(this.sourceToken); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, explicitKey: true }] + }; + } + case "map-value-ind": { + this.onKeyLine = true; + const prev = getPrevProps(parent2); + const start = getFirstKeyStartProps(prev); + return { + type: "block-map", + offset: this.offset, + indent: this.indent, + items: [{ start, key: null, sep: [this.sourceToken] }] + }; + } + } + return null; + } + atIndentedComment(start, indent) { + if (this.type !== "comment") + return false; + if (this.indent <= indent) + return false; + return start.every((st2) => st2.type === "newline" || st2.type === "space"); + } + *documentEnd(docEnd) { + if (this.type !== "doc-mode") { + if (docEnd.end) + docEnd.end.push(this.sourceToken); + else + docEnd.end = [this.sourceToken]; + if (this.type === "newline") + yield* this.pop(); + } + } + *lineEnd(token) { + switch (this.type) { + case "comma": + case "doc-start": + case "doc-end": + case "flow-seq-end": + case "flow-map-end": + case "map-value-ind": + yield* this.pop(); + yield* this.step(); + break; + case "newline": + this.onKeyLine = false; + case "space": + case "comment": + default: + if (token.end) + token.end.push(this.sourceToken); + else + token.end = [this.sourceToken]; + if (this.type === "newline") + yield* this.pop(); + } + } + }; + } +}); + +// node_modules/yaml/browser/dist/public-api.js +function parseOptions(options) { + const prettyErrors = options.prettyErrors !== false; + const lineCounter = options.lineCounter || prettyErrors && new LineCounter() || null; + return { lineCounter, prettyErrors }; +} +function parseDocument(source, options = {}) { + const { lineCounter, prettyErrors } = parseOptions(options); + const parser3 = new Parser(lineCounter?.addNewLine); + const composer = new Composer(options); + let doc = null; + for (const _doc of composer.compose(parser3.parse(source), true, source.length)) { + if (!doc) + doc = _doc; + else if (doc.options.logLevel !== "silent") { + doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()")); + break; + } + } + if (prettyErrors && lineCounter) { + doc.errors.forEach(prettifyError(source, lineCounter)); + doc.warnings.forEach(prettifyError(source, lineCounter)); + } + return doc; +} +function parse(src, reviver, options) { + let _reviver = void 0; + if (typeof reviver === "function") { + _reviver = reviver; + } else if (options === void 0 && reviver && typeof reviver === "object") { + options = reviver; + } + const doc = parseDocument(src, options); + if (!doc) + return null; + doc.warnings.forEach((warning) => warn(doc.options.logLevel, warning)); + if (doc.errors.length > 0) { + if (doc.options.logLevel !== "silent") + throw doc.errors[0]; + else + doc.errors = []; + } + return doc.toJS(Object.assign({ reviver: _reviver }, options)); +} +var init_public_api = __esm({ + "node_modules/yaml/browser/dist/public-api.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_composer(); + init_Document(); + init_errors(); + init_log(); + init_identity(); + init_line_counter(); + init_parser(); + } +}); + +// node_modules/yaml/browser/dist/index.js +var init_dist = __esm({ + "node_modules/yaml/browser/dist/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_composer(); + init_Document(); + init_Schema(); + init_errors(); + init_Alias(); + init_identity(); + init_Pair(); + init_Scalar(); + init_YAMLMap(); + init_YAMLSeq(); + init_cst(); + init_lexer(); + init_line_counter(); + init_parser(); + init_public_api(); + init_visit(); + } +}); + +// node_modules/yaml/browser/index.js +var init_browser = __esm({ + "node_modules/yaml/browser/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_dist(); + init_dist(); + } +}); + +// node_modules/@babel/runtime/helpers/interopRequireDefault.js +var require_interopRequireDefault = __commonJS({ + "node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _interopRequireDefault(e10) { + return e10 && e10.__esModule ? e10 : { + "default": e10 + }; + } + module5.exports = _interopRequireDefault, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@humanwhocodes/momoa/api.js +var require_api = __commonJS({ + "node_modules/@humanwhocodes/momoa/api.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var LBRACKET = "["; + var RBRACKET = "]"; + var LBRACE = "{"; + var RBRACE = "}"; + var COLON = ":"; + var COMMA = ","; + var TRUE = "true"; + var FALSE = "false"; + var NULL = "null"; + var QUOTE = '"'; + var expectedKeywords = /* @__PURE__ */ new Map([ + ["t", TRUE], + ["f", FALSE], + ["n", NULL] + ]); + var escapeToChar = /* @__PURE__ */ new Map([ + [QUOTE, QUOTE], + ["\\", "\\"], + ["/", "/"], + ["b", "\b"], + ["n", "\n"], + ["f", "\f"], + ["r", "\r"], + ["t", " "] + ]); + var knownTokenTypes = /* @__PURE__ */ new Map([ + [LBRACKET, "Punctuator"], + [RBRACKET, "Punctuator"], + [LBRACE, "Punctuator"], + [RBRACE, "Punctuator"], + [COLON, "Punctuator"], + [COMMA, "Punctuator"], + [TRUE, "Boolean"], + [FALSE, "Boolean"], + [NULL, "Null"] + ]); + var ErrorWithLocation = class extends Error { + /** + * + * @param {string} message The error message to report. + * @param {int} loc.line The line on which the error occurred. + * @param {int} loc.column The column in the line where the error occurrred. + * @param {int} loc.index The index in the string where the error occurred. + */ + constructor(message, { line, column, index: index4 }) { + super(`${message} (${line}:${column})`); + this.line = line; + this.column = column; + this.index = index4; + } + }; + var UnexpectedChar = class extends ErrorWithLocation { + /** + * Creates a new instance. + * @param {string} unexpected The character that was found. + * @param {Object} loc The location information for the found character. + */ + constructor(unexpected, loc) { + super(`Unexpected character ${unexpected} found.`, loc); + } + }; + var UnexpectedToken = class extends ErrorWithLocation { + /** + * Creates a new instance. + * @param {string} expected The character that was expected. + * @param {string} unexpected The character that was found. + * @param {Object} loc The location information for the found character. + */ + constructor(token) { + super(`Unexpected token ${token.type}(${token.value}) found.`, token.loc.start); + } + }; + var UnexpectedEOF = class extends ErrorWithLocation { + /** + * Creates a new instance. + * @param {Object} loc The location information for the found character. + */ + constructor(loc) { + super("Unexpected end of input found.", loc); + } + }; + var QUOTE$1 = '"'; + var SLASH = "/"; + var STAR = "*"; + var DEFAULT_OPTIONS = { + comments: false, + ranges: false + }; + function isWhitespace2(c7) { + return /[\s\n]/.test(c7); + } + function isDigit2(c7) { + return c7 >= "0" && c7 <= "9"; + } + function isHexDigit(c7) { + return isDigit2(c7) || /[a-f]/i.test(c7); + } + function isPositiveDigit(c7) { + return c7 >= "1" && c7 <= "9"; + } + function isKeywordStart(c7) { + return /[tfn]/.test(c7); + } + function isNumberStart(c7) { + return isDigit2(c7) || c7 === "." || c7 === "-"; + } + function tokenize(text, options) { + options = Object.freeze({ + ...DEFAULT_OPTIONS, + ...options + }); + let offset = -1; + let line = 1; + let column = 0; + let newLine = false; + const tokens = []; + function createToken(tokenType2, value2, startLoc, endLoc) { + const endOffset = startLoc.offset + value2.length; + let range2 = options.ranges ? { + range: [startLoc.offset, endOffset] + } : void 0; + return { + type: tokenType2, + value: value2, + loc: { + start: startLoc, + end: endLoc || { + line: startLoc.line, + column: startLoc.column + value2.length, + offset: endOffset + } + }, + ...range2 + }; + } + function next() { + let c8 = text.charAt(++offset); + if (newLine) { + line++; + column = 1; + newLine = false; + } else { + column++; + } + if (c8 === "\r") { + newLine = true; + if (text.charAt(offset + 1) === "\n") { + offset++; + } + } else if (c8 === "\n") { + newLine = true; + } + return c8; + } + function locate() { + return { + line, + column, + offset + }; + } + function readKeyword(c8) { + let value2 = expectedKeywords.get(c8); + if (text.slice(offset, offset + value2.length) === value2) { + offset += value2.length - 1; + column += value2.length - 1; + return { value: value2, c: next() }; + } + for (let j6 = 1; j6 < value2.length; j6++) { + if (value2[j6] !== text.charAt(offset + j6)) { + unexpected(next()); + } + } + } + function readString(c8) { + let value2 = c8; + c8 = next(); + while (c8 && c8 !== QUOTE$1) { + if (c8 === "\\") { + value2 += c8; + c8 = next(); + if (escapeToChar.has(c8)) { + value2 += c8; + } else if (c8 === "u") { + value2 += c8; + for (let i7 = 0; i7 < 4; i7++) { + c8 = next(); + if (isHexDigit(c8)) { + value2 += c8; + } else { + unexpected(c8); + } + } + } else { + unexpected(c8); + } + } else { + value2 += c8; + } + c8 = next(); + } + if (!c8) { + unexpectedEOF(); + } + value2 += c8; + return { value: value2, c: next() }; + } + function readNumber(c8) { + let value2 = ""; + if (c8 === "-") { + value2 += c8; + c8 = next(); + if (!isDigit2(c8)) { + unexpected(c8); + } + } + if (c8 === "0") { + value2 += c8; + c8 = next(); + if (isDigit2(c8)) { + unexpected(c8); + } + } else { + if (!isPositiveDigit(c8)) { + unexpected(c8); + } + do { + value2 += c8; + c8 = next(); + } while (isDigit2(c8)); + } + if (c8 === ".") { + do { + value2 += c8; + c8 = next(); + } while (isDigit2(c8)); + } + if (c8 === "e" || c8 === "E") { + value2 += c8; + c8 = next(); + if (c8 === "+" || c8 === "-") { + value2 += c8; + c8 = next(); + } + if (!isDigit2(c8)) { + unexpected(c8); + } + while (isDigit2(c8)) { + value2 += c8; + c8 = next(); + } + } + return { value: value2, c: c8 }; + } + function readComment(c8) { + let value2 = c8; + c8 = next(); + if (c8 === "/") { + do { + value2 += c8; + c8 = next(); + } while (c8 && c8 !== "\r" && c8 !== "\n"); + return { value: value2, c: c8 }; + } + if (c8 === STAR) { + while (c8) { + value2 += c8; + c8 = next(); + if (c8 === STAR) { + value2 += c8; + c8 = next(); + if (c8 === SLASH) { + value2 += c8; + c8 = next(); + return { value: value2, c: c8 }; + } + } + } + unexpectedEOF(); + } + unexpected(c8); + } + function unexpected(c8) { + throw new UnexpectedChar(c8, locate()); + } + function unexpectedEOF() { + throw new UnexpectedEOF(locate()); + } + let c7 = next(); + while (offset < text.length) { + while (isWhitespace2(c7)) { + c7 = next(); + } + if (!c7) { + break; + } + const start = locate(); + if (knownTokenTypes.has(c7)) { + tokens.push(createToken(knownTokenTypes.get(c7), c7, start)); + c7 = next(); + } else if (isKeywordStart(c7)) { + const result2 = readKeyword(c7); + let value2 = result2.value; + c7 = result2.c; + tokens.push(createToken(knownTokenTypes.get(value2), value2, start)); + } else if (isNumberStart(c7)) { + const result2 = readNumber(c7); + let value2 = result2.value; + c7 = result2.c; + tokens.push(createToken("Number", value2, start)); + } else if (c7 === QUOTE$1) { + const result2 = readString(c7); + let value2 = result2.value; + c7 = result2.c; + tokens.push(createToken("String", value2, start)); + } else if (c7 === SLASH && options.comments) { + const result2 = readComment(c7); + let value2 = result2.value; + c7 = result2.c; + tokens.push(createToken(value2.startsWith("//") ? "LineComment" : "BlockComment", value2, start, locate())); + } else { + unexpected(c7); + } + } + return tokens; + } + var types3 = { + document(body, parts = {}) { + return { + type: "Document", + body, + ...parts + }; + }, + string(value2, parts = {}) { + return { + type: "String", + value: value2, + ...parts + }; + }, + number(value2, parts = {}) { + return { + type: "Number", + value: value2, + ...parts + }; + }, + boolean(value2, parts = {}) { + return { + type: "Boolean", + value: value2, + ...parts + }; + }, + null(parts = {}) { + return { + type: "Null", + value: "null", + ...parts + }; + }, + array(elements, parts = {}) { + return { + type: "Array", + elements, + ...parts + }; + }, + object(members, parts = {}) { + return { + type: "Object", + members, + ...parts + }; + }, + member(name2, value2, parts = {}) { + return { + type: "Member", + name: name2, + value: value2, + ...parts + }; + } + }; + var DEFAULT_OPTIONS$1 = { + tokens: false, + comments: false, + ranges: false + }; + function getStringValue(token) { + let value2 = token.value.slice(1, -1); + let result2 = ""; + let escapeIndex = value2.indexOf("\\"); + let lastIndex = 0; + while (escapeIndex >= 0) { + result2 += value2.slice(lastIndex, escapeIndex); + const escapeChar = value2.charAt(escapeIndex + 1); + if (escapeToChar.has(escapeChar)) { + result2 += escapeToChar.get(escapeChar); + lastIndex = escapeIndex + 2; + } else if (escapeChar === "u") { + const hexCode = value2.slice(escapeIndex + 2, escapeIndex + 6); + if (hexCode.length < 4 || /[^0-9a-f]/i.test(hexCode)) { + throw new ErrorWithLocation( + `Invalid unicode escape \\u${hexCode}.`, + { + line: token.loc.start.line, + column: token.loc.start.column + escapeIndex, + offset: token.loc.start.offset + escapeIndex + } + ); + } + result2 += String.fromCharCode(parseInt(hexCode, 16)); + lastIndex = escapeIndex + 6; + } else { + throw new ErrorWithLocation( + `Invalid escape \\${escapeChar}.`, + { + line: token.loc.start.line, + column: token.loc.start.column + escapeIndex, + offset: token.loc.start.offset + escapeIndex + } + ); + } + escapeIndex = value2.indexOf("\\", lastIndex); + } + result2 += value2.slice(lastIndex); + return result2; + } + function getLiteralValue(token) { + switch (token.type) { + case "Boolean": + return token.value === "true"; + case "Number": + return Number(token.value); + case "Null": + return null; + case "String": + return getStringValue(token); + } + } + function parse17(text, options) { + options = Object.freeze({ + ...DEFAULT_OPTIONS$1, + ...options + }); + const tokens = tokenize(text, { + comments: !!options.comments, + ranges: !!options.ranges + }); + let tokenIndex = 0; + function nextNoComments() { + return tokens[tokenIndex++]; + } + function nextSkipComments() { + const nextToken = tokens[tokenIndex++]; + if (nextToken && nextToken.type.endsWith("Comment")) { + return nextSkipComments(); + } + return nextToken; + } + const next = options.comments ? nextSkipComments : nextNoComments; + function assertTokenValue(token, value2) { + if (!token || token.value !== value2) { + throw new UnexpectedToken(token); + } + } + function assertTokenType(token, type3) { + if (!token || token.type !== type3) { + throw new UnexpectedToken(token); + } + } + function createRange2(start, end) { + return options.ranges ? { + range: [start.offset, end.offset] + } : void 0; + } + function createLiteralNode(token) { + const range2 = createRange2(token.loc.start, token.loc.end); + return { + type: token.type, + value: getLiteralValue(token), + loc: { + start: { + ...token.loc.start + }, + end: { + ...token.loc.end + } + }, + ...range2 + }; + } + function parseProperty(token) { + assertTokenType(token, "String"); + const name2 = createLiteralNode(token); + token = next(); + assertTokenValue(token, ":"); + const value2 = parseValue2(); + const range2 = createRange2(name2.loc.start, value2.loc.end); + return types3.member(name2, value2, { + loc: { + start: { + ...name2.loc.start + }, + end: { + ...value2.loc.end + } + }, + ...range2 + }); + } + function parseObject(firstToken) { + assertTokenValue(firstToken, "{"); + const members = []; + let token = next(); + if (token && token.value !== "}") { + do { + members.push(parseProperty(token)); + token = next(); + if (token.value === ",") { + token = next(); + } else { + break; + } + } while (token); + } + assertTokenValue(token, "}"); + const range2 = createRange2(firstToken.loc.start, token.loc.end); + return types3.object(members, { + loc: { + start: { + ...firstToken.loc.start + }, + end: { + ...token.loc.end + } + }, + ...range2 + }); + } + function parseArray(firstToken) { + assertTokenValue(firstToken, "["); + const elements = []; + let token = next(); + if (token && token.value !== "]") { + do { + elements.push(parseValue2(token)); + token = next(); + if (token.value === ",") { + token = next(); + } else { + break; + } + } while (token); + } + assertTokenValue(token, "]"); + const range2 = createRange2(firstToken.loc.start, token.loc.end); + return types3.array(elements, { + type: "Array", + elements, + loc: { + start: { + ...firstToken.loc.start + }, + end: { + ...token.loc.end + } + }, + ...range2 + }); + } + function parseValue2(token) { + token = token || next(); + switch (token.type) { + case "String": + case "Boolean": + case "Number": + case "Null": + return createLiteralNode(token); + case "Punctuator": + if (token.value === "{") { + return parseObject(token); + } else if (token.value === "[") { + return parseArray(token); + } + default: + throw new UnexpectedToken(token); + } + } + const docBody = parseValue2(); + const unexpectedToken = next(); + if (unexpectedToken) { + throw new UnexpectedToken(unexpectedToken); + } + const docParts = { + loc: { + start: { + line: 1, + column: 1, + offset: 0 + }, + end: { + ...docBody.loc.end + } + } + }; + if (options.tokens) { + docParts.tokens = tokens; + } + if (options.ranges) { + docParts.range = createRange2(docParts.loc.start, docParts.loc.end); + } + return types3.document(docBody, docParts); + } + var childKeys = /* @__PURE__ */ new Map([ + ["Document", ["body"]], + ["Object", ["members"]], + ["Member", ["name", "value"]], + ["Array", ["elements"]], + ["String", []], + ["Number", []], + ["Boolean", []], + ["Null", []] + ]); + function isObject8(value2) { + return value2 && typeof value2 === "object"; + } + function isNode2(value2) { + return isObject8(value2) && typeof value2.type === "string"; + } + function traverse4(root2, visitor) { + function visitNode(node, parent2) { + if (typeof visitor.enter === "function") { + visitor.enter(node, parent2); + } + for (const key of childKeys.get(node.type)) { + const value2 = node[key]; + if (isObject8(value2)) { + if (Array.isArray(value2)) { + value2.forEach((child) => visitNode(child, node)); + } else if (isNode2(value2)) { + visitNode(value2, node); + } + } + } + if (typeof visitor.exit === "function") { + visitor.exit(node, parent2); + } + } + visitNode(root2); + } + function iterator(root2, filter2 = () => true) { + const traversal = []; + traverse4(root2, { + enter(node, parent2) { + traversal.push({ node, parent: parent2, phase: "enter" }); + }, + exit(node, parent2) { + traversal.push({ node, parent: parent2, phase: "exit" }); + } + }); + return traversal.filter(filter2).values(); + } + function evaluate(node) { + switch (node.type) { + case "String": + case "Number": + case "Boolean": + return node.value; + case "Null": + return null; + case "Array": + return node.elements.map(evaluate); + case "Object": { + const object = {}; + node.members.forEach((member) => { + object[evaluate(member.name)] = evaluate(member.value); + }); + return object; + } + case "Document": + return evaluate(node.body); + case "Property": + throw new Error("Cannot evaluate object property outside of an object."); + default: + throw new Error(`Unknown node type ${node.type}.`); + } + } + function print(node, { indent = 0 } = {}) { + const value2 = evaluate(node); + return JSON.stringify(value2, null, indent); + } + exports28.evaluate = evaluate; + exports28.iterator = iterator; + exports28.parse = parse17; + exports28.print = print; + exports28.tokenize = tokenize; + exports28.traverse = traverse4; + exports28.types = types3; + } +}); + +// node_modules/@babel/runtime/helpers/typeof.js +var require_typeof = __commonJS({ + "node_modules/@babel/runtime/helpers/typeof.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _typeof3(o7) { + "@babel/helpers - typeof"; + return module5.exports = _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o8) { + return typeof o8; + } : function(o8) { + return o8 && "function" == typeof Symbol && o8.constructor === Symbol && o8 !== Symbol.prototype ? "symbol" : typeof o8; + }, module5.exports.__esModule = true, module5.exports["default"] = module5.exports, _typeof3(o7); + } + module5.exports = _typeof3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/toPrimitive.js +var require_toPrimitive = __commonJS({ + "node_modules/@babel/runtime/helpers/toPrimitive.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var _typeof3 = require_typeof()["default"]; + function toPrimitive(t8, r8) { + if ("object" != _typeof3(t8) || !t8) + return t8; + var e10 = t8[Symbol.toPrimitive]; + if (void 0 !== e10) { + var i7 = e10.call(t8, r8 || "default"); + if ("object" != _typeof3(i7)) + return i7; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r8 ? String : Number)(t8); + } + module5.exports = toPrimitive, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/toPropertyKey.js +var require_toPropertyKey = __commonJS({ + "node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var _typeof3 = require_typeof()["default"]; + var toPrimitive = require_toPrimitive(); + function toPropertyKey(t8) { + var i7 = toPrimitive(t8, "string"); + return "symbol" == _typeof3(i7) ? i7 : i7 + ""; + } + module5.exports = toPropertyKey, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/defineProperty.js +var require_defineProperty = __commonJS({ + "node_modules/@babel/runtime/helpers/defineProperty.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var toPropertyKey = require_toPropertyKey(); + function _defineProperty(e10, r8, t8) { + return (r8 = toPropertyKey(r8)) in e10 ? Object.defineProperty(e10, r8, { + value: t8, + enumerable: true, + configurable: true, + writable: true + }) : e10[r8] = t8, e10; + } + module5.exports = _defineProperty, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/arrayLikeToArray.js +var require_arrayLikeToArray = __commonJS({ + "node_modules/@babel/runtime/helpers/arrayLikeToArray.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _arrayLikeToArray3(r8, a7) { + (null == a7 || a7 > r8.length) && (a7 = r8.length); + for (var e10 = 0, n7 = Array(a7); e10 < a7; e10++) + n7[e10] = r8[e10]; + return n7; + } + module5.exports = _arrayLikeToArray3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +var require_arrayWithoutHoles = __commonJS({ + "node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var arrayLikeToArray = require_arrayLikeToArray(); + function _arrayWithoutHoles3(r8) { + if (Array.isArray(r8)) + return arrayLikeToArray(r8); + } + module5.exports = _arrayWithoutHoles3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/iterableToArray.js +var require_iterableToArray = __commonJS({ + "node_modules/@babel/runtime/helpers/iterableToArray.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _iterableToArray3(r8) { + if ("undefined" != typeof Symbol && null != r8[Symbol.iterator] || null != r8["@@iterator"]) + return Array.from(r8); + } + module5.exports = _iterableToArray3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +var require_unsupportedIterableToArray = __commonJS({ + "node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var arrayLikeToArray = require_arrayLikeToArray(); + function _unsupportedIterableToArray3(r8, a7) { + if (r8) { + if ("string" == typeof r8) + return arrayLikeToArray(r8, a7); + var t8 = {}.toString.call(r8).slice(8, -1); + return "Object" === t8 && r8.constructor && (t8 = r8.constructor.name), "Map" === t8 || "Set" === t8 ? Array.from(r8) : "Arguments" === t8 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t8) ? arrayLikeToArray(r8, a7) : void 0; + } + } + module5.exports = _unsupportedIterableToArray3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/nonIterableSpread.js +var require_nonIterableSpread = __commonJS({ + "node_modules/@babel/runtime/helpers/nonIterableSpread.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _nonIterableSpread3() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + module5.exports = _nonIterableSpread3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/toConsumableArray.js +var require_toConsumableArray = __commonJS({ + "node_modules/@babel/runtime/helpers/toConsumableArray.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var arrayWithoutHoles = require_arrayWithoutHoles(); + var iterableToArray = require_iterableToArray(); + var unsupportedIterableToArray = require_unsupportedIterableToArray(); + var nonIterableSpread = require_nonIterableSpread(); + function _toConsumableArray3(r8) { + return arrayWithoutHoles(r8) || iterableToArray(r8) || unsupportedIterableToArray(r8) || nonIterableSpread(); + } + module5.exports = _toConsumableArray3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/arrayWithHoles.js +var require_arrayWithHoles = __commonJS({ + "node_modules/@babel/runtime/helpers/arrayWithHoles.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _arrayWithHoles(r8) { + if (Array.isArray(r8)) + return r8; + } + module5.exports = _arrayWithHoles, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +var require_iterableToArrayLimit = __commonJS({ + "node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _iterableToArrayLimit(r8, l7) { + var t8 = null == r8 ? null : "undefined" != typeof Symbol && r8[Symbol.iterator] || r8["@@iterator"]; + if (null != t8) { + var e10, n7, i7, u7, a7 = [], f8 = true, o7 = false; + try { + if (i7 = (t8 = t8.call(r8)).next, 0 === l7) { + if (Object(t8) !== t8) + return; + f8 = false; + } else + for (; !(f8 = (e10 = i7.call(t8)).done) && (a7.push(e10.value), a7.length !== l7); f8 = true) + ; + } catch (r9) { + o7 = true, n7 = r9; + } finally { + try { + if (!f8 && null != t8["return"] && (u7 = t8["return"](), Object(u7) !== u7)) + return; + } finally { + if (o7) + throw n7; + } + } + return a7; + } + } + module5.exports = _iterableToArrayLimit, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/nonIterableRest.js +var require_nonIterableRest = __commonJS({ + "node_modules/@babel/runtime/helpers/nonIterableRest.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + module5.exports = _nonIterableRest, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/slicedToArray.js +var require_slicedToArray = __commonJS({ + "node_modules/@babel/runtime/helpers/slicedToArray.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var arrayWithHoles = require_arrayWithHoles(); + var iterableToArrayLimit = require_iterableToArrayLimit(); + var unsupportedIterableToArray = require_unsupportedIterableToArray(); + var nonIterableRest = require_nonIterableRest(); + function _slicedToArray(r8, e10) { + return arrayWithHoles(r8) || iterableToArrayLimit(r8, e10) || unsupportedIterableToArray(r8, e10) || nonIterableRest(); + } + module5.exports = _slicedToArray, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/utils.js +var require_utils = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/utils.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.notUndefined = exports28.isRequiredError = exports28.isEnumError = exports28.isAnyOfError = exports28.getSiblings = exports28.getErrors = exports28.getChildren = exports28.concatAll = void 0; + var eq2 = function eq3(x7) { + return function(y7) { + return x7 === y7; + }; + }; + var not = function not2(fn) { + return function(x7) { + return !fn(x7); + }; + }; + var getValues = function getValues2(o7) { + return Object.values(o7); + }; + var notUndefined = exports28.notUndefined = function notUndefined2(x7) { + return x7 !== void 0; + }; + var isXError = function isXError2(x7) { + return function(error2) { + return error2.keyword === x7; + }; + }; + var isRequiredError = exports28.isRequiredError = isXError("required"); + var isAnyOfError = exports28.isAnyOfError = isXError("anyOf"); + var isEnumError = exports28.isEnumError = isXError("enum"); + var getErrors = exports28.getErrors = function getErrors2(node) { + return node && node.errors || []; + }; + var getChildren = exports28.getChildren = function getChildren2(node) { + return node && getValues(node.children) || []; + }; + var getSiblings = exports28.getSiblings = function getSiblings2(parent2) { + return function(node) { + return getChildren(parent2).filter(not(eq2(node))); + }; + }; + var concatAll = exports28.concatAll = /* :: */ + function concatAll2(xs) { + return function(ys) { + return ys.reduce(function(zs, z6) { + return zs.concat(z6); + }, xs); + }; + }; + } +}); + +// node_modules/@babel/runtime/helpers/classCallCheck.js +var require_classCallCheck = __commonJS({ + "node_modules/@babel/runtime/helpers/classCallCheck.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _classCallCheck3(a7, n7) { + if (!(a7 instanceof n7)) + throw new TypeError("Cannot call a class as a function"); + } + module5.exports = _classCallCheck3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/createClass.js +var require_createClass = __commonJS({ + "node_modules/@babel/runtime/helpers/createClass.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var toPropertyKey = require_toPropertyKey(); + function _defineProperties3(e10, r8) { + for (var t8 = 0; t8 < r8.length; t8++) { + var o7 = r8[t8]; + o7.enumerable = o7.enumerable || false, o7.configurable = true, "value" in o7 && (o7.writable = true), Object.defineProperty(e10, toPropertyKey(o7.key), o7); + } + } + function _createClass3(e10, r8, t8) { + return r8 && _defineProperties3(e10.prototype, r8), t8 && _defineProperties3(e10, t8), Object.defineProperty(e10, "prototype", { + writable: false + }), e10; + } + module5.exports = _createClass3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/assertThisInitialized.js +var require_assertThisInitialized = __commonJS({ + "node_modules/@babel/runtime/helpers/assertThisInitialized.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _assertThisInitialized3(e10) { + if (void 0 === e10) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e10; + } + module5.exports = _assertThisInitialized3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +var require_possibleConstructorReturn = __commonJS({ + "node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var _typeof3 = require_typeof()["default"]; + var assertThisInitialized = require_assertThisInitialized(); + function _possibleConstructorReturn3(t8, e10) { + if (e10 && ("object" == _typeof3(e10) || "function" == typeof e10)) + return e10; + if (void 0 !== e10) + throw new TypeError("Derived constructors may only return object or undefined"); + return assertThisInitialized(t8); + } + module5.exports = _possibleConstructorReturn3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/getPrototypeOf.js +var require_getPrototypeOf = __commonJS({ + "node_modules/@babel/runtime/helpers/getPrototypeOf.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _getPrototypeOf3(t8) { + return module5.exports = _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t9) { + return t9.__proto__ || Object.getPrototypeOf(t9); + }, module5.exports.__esModule = true, module5.exports["default"] = module5.exports, _getPrototypeOf3(t8); + } + module5.exports = _getPrototypeOf3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/setPrototypeOf.js +var require_setPrototypeOf = __commonJS({ + "node_modules/@babel/runtime/helpers/setPrototypeOf.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function _setPrototypeOf3(t8, e10) { + return module5.exports = _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t9, e11) { + return t9.__proto__ = e11, t9; + }, module5.exports.__esModule = true, module5.exports["default"] = module5.exports, _setPrototypeOf3(t8, e10); + } + module5.exports = _setPrototypeOf3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/inherits.js +var require_inherits = __commonJS({ + "node_modules/@babel/runtime/helpers/inherits.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var setPrototypeOf = require_setPrototypeOf(); + function _inherits3(t8, e10) { + if ("function" != typeof e10 && null !== e10) + throw new TypeError("Super expression must either be null or a function"); + t8.prototype = Object.create(e10 && e10.prototype, { + constructor: { + value: t8, + writable: true, + configurable: true + } + }), Object.defineProperty(t8, "prototype", { + writable: false + }), e10 && setPrototypeOf(t8, e10); + } + module5.exports = _inherits3, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/picocolors/picocolors.browser.js +var require_picocolors_browser = __commonJS({ + "node_modules/picocolors/picocolors.browser.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var x7 = String; + var create2 = function() { + return { isColorSupported: false, reset: x7, bold: x7, dim: x7, italic: x7, underline: x7, inverse: x7, hidden: x7, strikethrough: x7, black: x7, red: x7, green: x7, yellow: x7, blue: x7, magenta: x7, cyan: x7, white: x7, gray: x7, bgBlack: x7, bgRed: x7, bgGreen: x7, bgYellow: x7, bgBlue: x7, bgMagenta: x7, bgCyan: x7, bgWhite: x7, blackBright: x7, redBright: x7, greenBright: x7, yellowBright: x7, blueBright: x7, magentaBright: x7, cyanBright: x7, whiteBright: x7, bgBlackBright: x7, bgRedBright: x7, bgGreenBright: x7, bgYellowBright: x7, bgBlueBright: x7, bgMagentaBright: x7, bgCyanBright: x7, bgWhiteBright: x7 }; + }; + module5.exports = create2(); + module5.exports.createColors = create2; + } +}); + +// node_modules/js-tokens/index.js +var require_js_tokens = __commonJS({ + "node_modules/js-tokens/index.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; + exports28.matchToToken = function(match) { + var token = { type: "invalid", value: match[0], closed: void 0 }; + if (match[1]) + token.type = "string", token.closed = !!(match[3] || match[4]); + else if (match[5]) + token.type = "comment"; + else if (match[6]) + token.type = "comment", token.closed = !!match[7]; + else if (match[8]) + token.type = "regex"; + else if (match[9]) + token.type = "number"; + else if (match[10]) + token.type = "name"; + else if (match[11]) + token.type = "punctuator"; + else if (match[12]) + token.type = "whitespace"; + return token; + }; + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/identifier.js +var require_identifier = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/identifier.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.isIdentifierChar = isIdentifierChar; + exports28.isIdentifierName = isIdentifierName; + exports28.isIdentifierStart = isIdentifierStart; + var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; + var nonASCIIidentifierChars = "\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65"; + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + function isInAstralSet(code, set4) { + let pos = 65536; + for (let i7 = 0, length = set4.length; i7 < length; i7 += 2) { + pos += set4[i7]; + if (pos > code) + return false; + pos += set4[i7 + 1]; + if (pos >= code) + return true; + } + return false; + } + function isIdentifierStart(code) { + if (code < 65) + return code === 36; + if (code <= 90) + return true; + if (code < 97) + return code === 95; + if (code <= 122) + return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); + } + function isIdentifierChar(code) { + if (code < 48) + return code === 36; + if (code < 58) + return true; + if (code < 65) + return false; + if (code <= 90) + return true; + if (code < 97) + return code === 95; + if (code <= 122) + return true; + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); + } + function isIdentifierName(name2) { + let isFirst = true; + for (let i7 = 0; i7 < name2.length; i7++) { + let cp = name2.charCodeAt(i7); + if ((cp & 64512) === 55296 && i7 + 1 < name2.length) { + const trail = name2.charCodeAt(++i7); + if ((trail & 64512) === 56320) { + cp = 65536 + ((cp & 1023) << 10) + (trail & 1023); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/keyword.js +var require_keyword = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/keyword.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.isKeyword = isKeyword; + exports28.isReservedWord = isReservedWord; + exports28.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; + exports28.isStrictBindReservedWord = isStrictBindReservedWord; + exports28.isStrictReservedWord = isStrictReservedWord; + var reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] + }; + var keywords = new Set(reservedWords.keyword); + var reservedWordsStrictSet = new Set(reservedWords.strict); + var reservedWordsStrictBindSet = new Set(reservedWords.strictBind); + function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; + } + function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); + } + function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); + } + function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); + } + function isKeyword(word) { + return keywords.has(word); + } + } +}); + +// node_modules/@babel/helper-validator-identifier/lib/index.js +var require_lib = __commonJS({ + "node_modules/@babel/helper-validator-identifier/lib/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + Object.defineProperty(exports28, "isIdentifierChar", { + enumerable: true, + get: function() { + return _identifier.isIdentifierChar; + } + }); + Object.defineProperty(exports28, "isIdentifierName", { + enumerable: true, + get: function() { + return _identifier.isIdentifierName; + } + }); + Object.defineProperty(exports28, "isIdentifierStart", { + enumerable: true, + get: function() { + return _identifier.isIdentifierStart; + } + }); + Object.defineProperty(exports28, "isKeyword", { + enumerable: true, + get: function() { + return _keyword.isKeyword; + } + }); + Object.defineProperty(exports28, "isReservedWord", { + enumerable: true, + get: function() { + return _keyword.isReservedWord; + } + }); + Object.defineProperty(exports28, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindOnlyReservedWord; + } + }); + Object.defineProperty(exports28, "isStrictBindReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictBindReservedWord; + } + }); + Object.defineProperty(exports28, "isStrictReservedWord", { + enumerable: true, + get: function() { + return _keyword.isStrictReservedWord; + } + }); + var _identifier = require_identifier(); + var _keyword = require_keyword(); + } +}); + +// node_modules/@babel/code-frame/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/@babel/code-frame/lib/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var picocolors = require_picocolors_browser(); + var jsTokens = require_js_tokens(); + var helperValidatorIdentifier = require_lib(); + function isColorSupported() { + return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported; + } + var compose = (f8, g7) => (v8) => f8(g7(v8)); + function buildDefs(colors) { + return { + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: compose(compose(colors.white, colors.bgRed), colors.bold), + gutter: colors.gray, + marker: compose(colors.red, colors.bold), + message: compose(colors.red, colors.bold), + reset: colors.reset + }; + } + var defsOn = buildDefs(picocolors.createColors(true)); + var defsOff = buildDefs(picocolors.createColors(false)); + function getDefs(enabled) { + return enabled ? defsOn : defsOff; + } + var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]); + var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; + var BRACKET = /^[()[\]{}]$/; + var tokenize; + { + const JSX_TAG = /^[a-z][\w-]*$/i; + const getTokenType = function(token, offset, text) { + if (token.type === "name") { + if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type3](str2)).join("\n"); + } else { + highlighted += value2; + } + } + return highlighted; + } + var deprecationWarningShown = false; + var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source.length; + } + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i7 = 0; i7 <= lineDiff; i7++) { + const lineNumber = i7 + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i7 === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i7 === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i7].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; + } + function codeFrameColumns(rawLines, loc, opts = {}) { + const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; + const defs = getDefs(shouldHighlight); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index5) => { + const number = start + 1 + index5; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + defs.message(opts.message); + } + } + return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message} +${frame}`; + } + if (shouldHighlight) { + return defs.reset(frame); + } else { + return frame; + } + } + function index4(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location2 = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location2, opts); + } + exports28.codeFrameColumns = codeFrameColumns; + exports28.default = index4; + exports28.highlight = highlight; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/json/utils.js +var require_utils2 = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/json/utils.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.getPointers = void 0; + var getPointers = exports28.getPointers = function getPointers2(dataPath) { + var pointers = dataPath.split("/").slice(1); + for (var index4 in pointers) { + pointers[index4] = pointers[index4].split("~1").join("/").split("~0").join("~"); + } + return pointers; + }; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/json/get-meta-from-path.js +var require_get_meta_from_path = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/json/get-meta-from-path.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = getMetaFromPath; + var _utils = require_utils2(); + function getMetaFromPath(jsonAst, dataPath, includeIdentifierLocation) { + var pointers = (0, _utils.getPointers)(dataPath); + var lastPointerIndex = pointers.length - 1; + return pointers.reduce(function(obj, pointer, idx) { + switch (obj.type) { + case "Object": { + var filtered = obj.members.filter(function(child) { + return child.name.value === pointer; + }); + if (filtered.length !== 1) { + throw new Error("Couldn't find property ".concat(pointer, " of ").concat(dataPath)); + } + var _filtered$ = filtered[0], name2 = _filtered$.name, value2 = _filtered$.value; + return includeIdentifierLocation && idx === lastPointerIndex ? name2 : value2; + } + case "Array": + return obj.elements[pointer]; + default: + console.log(obj); + } + }, jsonAst.body); + } + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/json/get-decorated-data-path.js +var require_get_decorated_data_path = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/json/get-decorated-data-path.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = getDecoratedDataPath; + var _utils = require_utils2(); + function getTypeName(obj) { + if (!obj || !obj.elements) { + return ""; + } + var type3 = obj.elements.filter(function(child) { + return child && child.name && child.name.value === "type"; + }); + if (!type3.length) { + return ""; + } + return type3[0].value && ":".concat(type3[0].value.value) || ""; + } + function getDecoratedDataPath(jsonAst, dataPath) { + var decoratedPath = ""; + (0, _utils.getPointers)(dataPath).reduce(function(obj, pointer) { + switch (obj.type) { + case "Object": { + decoratedPath += "/".concat(pointer); + var filtered = obj.members.filter(function(child) { + return child.name.value === pointer; + }); + if (filtered.length !== 1) { + throw new Error("Couldn't find property ".concat(pointer, " of ").concat(dataPath)); + } + return filtered[0].value; + } + case "Array": { + decoratedPath += "/".concat(pointer).concat(getTypeName(obj.elements[pointer])); + return obj.elements[pointer]; + } + default: + console.log(obj); + } + }, jsonAst.body); + return decoratedPath; + } + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/json/index.js +var require_json = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/json/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + Object.defineProperty(exports28, "getDecoratedDataPath", { + enumerable: true, + get: function get4() { + return _getDecoratedDataPath["default"]; + } + }); + Object.defineProperty(exports28, "getMetaFromPath", { + enumerable: true, + get: function get4() { + return _getMetaFromPath["default"]; + } + }); + var _getMetaFromPath = _interopRequireDefault(require_get_meta_from_path()); + var _getDecoratedDataPath = _interopRequireDefault(require_get_decorated_data_path()); + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/base.js +var require_base = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/base.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _codeFrame = require_lib2(); + var _picocolors = _interopRequireDefault(require_picocolors_browser()); + var _json = require_json(); + var BaseValidationError = exports28["default"] = /* @__PURE__ */ function() { + function BaseValidationError2() { + var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { + isIdentifierLocation: false + }; + var _ref = arguments.length > 1 ? arguments[1] : void 0, colorize = _ref.colorize, data = _ref.data, schema8 = _ref.schema, jsonAst = _ref.jsonAst, jsonRaw = _ref.jsonRaw; + (0, _classCallCheck22["default"])(this, BaseValidationError2); + this.options = options; + this.colorize = !!(!!colorize || colorize === void 0); + this.data = data; + this.schema = schema8; + this.jsonAst = jsonAst; + this.jsonRaw = jsonRaw; + } + return (0, _createClass22["default"])(BaseValidationError2, [{ + key: "getColorizer", + value: function getColorizer() { + return this.colorize ? _picocolors["default"] : ( + // `picocolors` doesn't have a way to programatically disable the library so we're + // creating an empty proxy that'll just return the arguments of any color functions we + // invoke, sans any colorization. + new Proxy({}, { + get: function get4() { + return function(arg) { + return arg; + }; + } + }) + ); + } + }, { + key: "getLocation", + value: function getLocation2() { + var dataPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.instancePath; + var _this$options = this.options, isIdentifierLocation = _this$options.isIdentifierLocation, isSkipEndLocation = _this$options.isSkipEndLocation; + var _getMetaFromPath = (0, _json.getMetaFromPath)(this.jsonAst, dataPath, isIdentifierLocation), loc = _getMetaFromPath.loc; + return { + start: loc.start, + end: isSkipEndLocation ? void 0 : loc.end + }; + } + }, { + key: "getDecoratedPath", + value: function getDecoratedPath() { + var dataPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.instancePath; + return (0, _json.getDecoratedDataPath)(this.jsonAst, dataPath); + } + }, { + key: "getCodeFrame", + value: function getCodeFrame(message) { + var dataPath = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.instancePath; + return (0, _codeFrame.codeFrameColumns)(this.jsonRaw, this.getLocation(dataPath), { + /** + * `@babel/highlight`, by way of `@babel/code-frame`, highlights out entire block of raw JSON + * instead of just our `location` block -- so if you have a block of raw JSON that's upwards + * of 2mb+ and have a lot of errors to generate code frames for then we're re-highlighting + * the same huge chunk of code over and over and over and over again, all just so + * `@babel/code-frame` will eventually extract a small <10 line chunk out of it to return to + * us. + * + * Disabling `highlightCode` here will only disable highlighting the code we're showing users; + * if `options.colorize` is supplied to this library then the error message we're adding will + * still be highlighted. + */ + highlightCode: false, + message + }); + } + /** + * @return {string} + */ + }, { + key: "instancePath", + get: function get4() { + return typeof this.options.instancePath !== "undefined" ? this.options.instancePath : this.options.dataPath; + } + }, { + key: "print", + value: function print() { + throw new Error("Implement the 'print' method inside ".concat(this.constructor.name, "!")); + } + }, { + key: "getError", + value: function getError() { + throw new Error("Implement the 'getError' method inside ".concat(this.constructor.name, "!")); + } + }]); + }(); + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/additional-prop.js +var require_additional_prop = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/additional-prop.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + var AdditionalPropValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function AdditionalPropValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, AdditionalPropValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, AdditionalPropValidationError2, [].concat(args)); + _this.name = "AdditionalPropValidationError"; + _this.options.isIdentifierLocation = true; + return _this; + } + (0, _inherits22["default"])(AdditionalPropValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(AdditionalPropValidationError2, [{ + key: "print", + value: function print() { + var _this$options = this.options, message = _this$options.message, params = _this$options.params; + var colorizer = this.getColorizer(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold("ADDITIONAL PROPERTY"), " ").concat(message)), "\n")]; + return output.concat(this.getCodeFrame("".concat(colorizer.magentaBright(params.additionalProperty), " is not expected to be here!"), "".concat(this.instancePath, "/").concat(params.additionalProperty))); + } + }, { + key: "getError", + value: function getError() { + var params = this.options.params; + return _objectSpread(_objectSpread({}, this.getLocation("".concat(this.instancePath, "/").concat(params.additionalProperty))), {}, { + error: "".concat(this.getDecoratedPath(), " Property ").concat(params.additionalProperty, " is not expected to be here"), + path: this.instancePath + }); + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/default.js +var require_default = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/default.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + var DefaultValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function DefaultValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, DefaultValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, DefaultValidationError2, [].concat(args)); + _this.name = "DefaultValidationError"; + _this.options.isSkipEndLocation = true; + return _this; + } + (0, _inherits22["default"])(DefaultValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(DefaultValidationError2, [{ + key: "print", + value: function print() { + var _this$options = this.options, keyword = _this$options.keyword, message = _this$options.message; + var colorizer = this.getColorizer(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold(keyword.toUpperCase()), " ").concat(message)), "\n")]; + return output.concat(this.getCodeFrame("".concat(colorizer.magentaBright(keyword), " ").concat(message))); + } + }, { + key: "getError", + value: function getError() { + var _this$options2 = this.options, keyword = _this$options2.keyword, message = _this$options2.message; + return _objectSpread(_objectSpread({}, this.getLocation()), {}, { + error: "".concat(this.getDecoratedPath(), ": ").concat(keyword, " ").concat(message), + path: this.instancePath + }); + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/jsonpointer/jsonpointer.js +var require_jsonpointer = __commonJS({ + "node_modules/jsonpointer/jsonpointer.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + var hasExcape = /~/; + var escapeMatcher = /~[01]/g; + function escapeReplacer(m7) { + switch (m7) { + case "~1": + return "/"; + case "~0": + return "~"; + } + throw new Error("Invalid tilde escape: " + m7); + } + function untilde4(str2) { + if (!hasExcape.test(str2)) + return str2; + return str2.replace(escapeMatcher, escapeReplacer); + } + function setter(obj, pointer, value2) { + var part; + var hasNextPart; + for (var p7 = 1, len = pointer.length; p7 < len; ) { + if (pointer[p7] === "constructor" || pointer[p7] === "prototype" || pointer[p7] === "__proto__") + return obj; + part = untilde4(pointer[p7++]); + hasNextPart = len > p7; + if (typeof obj[part] === "undefined") { + if (Array.isArray(obj) && part === "-") { + part = obj.length; + } + if (hasNextPart) { + if (pointer[p7] !== "" && pointer[p7] < Infinity || pointer[p7] === "-") + obj[part] = []; + else + obj[part] = {}; + } + } + if (!hasNextPart) + break; + obj = obj[part]; + } + var oldValue = obj[part]; + if (value2 === void 0) + delete obj[part]; + else + obj[part] = value2; + return oldValue; + } + function compilePointer(pointer) { + if (typeof pointer === "string") { + pointer = pointer.split("/"); + if (pointer[0] === "") + return pointer; + throw new Error("Invalid JSON pointer."); + } else if (Array.isArray(pointer)) { + for (const part of pointer) { + if (typeof part !== "string" && typeof part !== "number") { + throw new Error("Invalid JSON pointer. Must be of type string or number."); + } + } + return pointer; + } + throw new Error("Invalid JSON pointer."); + } + function get4(obj, pointer) { + if (typeof obj !== "object") + throw new Error("Invalid input object."); + pointer = compilePointer(pointer); + var len = pointer.length; + if (len === 1) + return obj; + for (var p7 = 1; p7 < len; ) { + obj = obj[untilde4(pointer[p7++])]; + if (len === p7) + return obj; + if (typeof obj !== "object" || obj === null) + return void 0; + } + } + function set4(obj, pointer, value2) { + if (typeof obj !== "object") + throw new Error("Invalid input object."); + pointer = compilePointer(pointer); + if (pointer.length === 0) + throw new Error("Invalid JSON pointer for set."); + return setter(obj, pointer, value2); + } + function compile(pointer) { + var compiled = compilePointer(pointer); + return { + get: function(object) { + return get4(object, compiled); + }, + set: function(object, value2) { + return set4(object, compiled, value2); + } + }; + } + exports28.get = get4; + exports28.set = set4; + exports28.compile = compile; + } +}); + +// node_modules/leven/index.js +var require_leven = __commonJS({ + "node_modules/leven/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var array = []; + var charCodeCache = []; + var leven = (left, right) => { + if (left === right) { + return 0; + } + const swap = left; + if (left.length > right.length) { + left = right; + right = swap; + } + let leftLength = left.length; + let rightLength = right.length; + while (leftLength > 0 && left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength)) { + leftLength--; + rightLength--; + } + let start = 0; + while (start < leftLength && left.charCodeAt(start) === right.charCodeAt(start)) { + start++; + } + leftLength -= start; + rightLength -= start; + if (leftLength === 0) { + return rightLength; + } + let bCharCode; + let result2; + let temp; + let temp2; + let i7 = 0; + let j6 = 0; + while (i7 < leftLength) { + charCodeCache[i7] = left.charCodeAt(start + i7); + array[i7] = ++i7; + } + while (j6 < rightLength) { + bCharCode = right.charCodeAt(start + j6); + temp = j6++; + result2 = j6; + for (i7 = 0; i7 < leftLength; i7++) { + temp2 = bCharCode === charCodeCache[i7] ? temp : temp + 1; + temp = array[i7]; + result2 = array[i7] = temp > result2 ? temp2 > result2 ? result2 + 1 : temp2 : temp2 > temp ? temp + 1 : temp2; + } + } + return result2; + }; + module5.exports = leven; + module5.exports.default = leven; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/enum.js +var require_enum = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/enum.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _jsonpointer = _interopRequireDefault(require_jsonpointer()); + var _leven = _interopRequireDefault(require_leven()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + var EnumValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function EnumValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, EnumValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, EnumValidationError2, [].concat(args)); + _this.name = "EnumValidationError"; + return _this; + } + (0, _inherits22["default"])(EnumValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(EnumValidationError2, [{ + key: "print", + value: function print() { + var _this$options = this.options, message = _this$options.message, allowedValues = _this$options.params.allowedValues; + var colorizer = this.getColorizer(); + var bestMatch = this.findBestMatch(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold("ENUM"), " ").concat(message))), "".concat(colorizer.red("(".concat(allowedValues.join(", "), ")")), "\n")]; + return output.concat(this.getCodeFrame(bestMatch !== null ? "Did you mean ".concat(colorizer.magentaBright(bestMatch), " here?") : "Unexpected value, should be equal to one of the allowed values")); + } + }, { + key: "getError", + value: function getError() { + var _this$options2 = this.options, message = _this$options2.message, params = _this$options2.params; + var bestMatch = this.findBestMatch(); + var allowedValues = params.allowedValues.join(", "); + var output = _objectSpread(_objectSpread({}, this.getLocation()), {}, { + error: "".concat(this.getDecoratedPath(), " ").concat(message, ": ").concat(allowedValues), + path: this.instancePath + }); + if (bestMatch !== null) { + output.suggestion = "Did you mean ".concat(bestMatch, "?"); + } + return output; + } + }, { + key: "findBestMatch", + value: function findBestMatch() { + var allowedValues = this.options.params.allowedValues; + var currentValue = this.instancePath === "" ? this.data : _jsonpointer["default"].get(this.data, this.instancePath); + if (!currentValue) { + return null; + } + var bestMatch = allowedValues.map(function(value2) { + return { + value: value2, + weight: (0, _leven["default"])(value2, currentValue.toString()) + }; + }).sort(function(x7, y7) { + return x7.weight > y7.weight ? 1 : x7.weight < y7.weight ? -1 : 0; + })[0]; + return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null; + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/pattern.js +var require_pattern = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/pattern.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + var PatternValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function PatternValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, PatternValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, PatternValidationError2, [].concat(args)); + _this.name = "PatternValidationError"; + _this.options.isIdentifierLocation = true; + return _this; + } + (0, _inherits22["default"])(PatternValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(PatternValidationError2, [{ + key: "print", + value: function print() { + var _this$options = this.options, message = _this$options.message, params = _this$options.params, propertyName = _this$options.propertyName; + var colorizer = this.getColorizer(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold("PROPERTY"), " ").concat(message)), "\n")]; + return output.concat(this.getCodeFrame("must match pattern ".concat(colorizer.magentaBright(params.pattern)), propertyName ? "".concat(this.instancePath, "/").concat(propertyName) : this.instancePath)); + } + }, { + key: "getError", + value: function getError() { + var _this$options2 = this.options, params = _this$options2.params, propertyName = _this$options2.propertyName; + return _objectSpread(_objectSpread({}, this.getLocation()), {}, { + error: "".concat(this.getDecoratedPath(), ' Property "').concat(propertyName, '" must match pattern ').concat(params.pattern), + path: this.instancePath + }); + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/@babel/runtime/helpers/superPropBase.js +var require_superPropBase = __commonJS({ + "node_modules/@babel/runtime/helpers/superPropBase.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var getPrototypeOf = require_getPrototypeOf(); + function _superPropBase(t8, o7) { + for (; !{}.hasOwnProperty.call(t8, o7) && null !== (t8 = getPrototypeOf(t8)); ) + ; + return t8; + } + module5.exports = _superPropBase, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@babel/runtime/helpers/get.js +var require_get = __commonJS({ + "node_modules/@babel/runtime/helpers/get.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var superPropBase = require_superPropBase(); + function _get() { + return module5.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e10, t8, r8) { + var p7 = superPropBase(e10, t8); + if (p7) { + var n7 = Object.getOwnPropertyDescriptor(p7, t8); + return n7.get ? n7.get.call(arguments.length < 3 ? e10 : r8) : n7.value; + } + }, module5.exports.__esModule = true, module5.exports["default"] = module5.exports, _get.apply(null, arguments); + } + module5.exports = _get, module5.exports.__esModule = true, module5.exports["default"] = module5.exports; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/required.js +var require_required = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/required.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _get2 = _interopRequireDefault(require_get()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + function _superPropGet(t8, o7, e10, r8) { + var p7 = (0, _get2["default"])((0, _getPrototypeOf22["default"])(1 & r8 ? t8.prototype : t8), o7, e10); + return 2 & r8 && "function" == typeof p7 ? function(t9) { + return p7.apply(e10, t9); + } : p7; + } + var RequiredValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function RequiredValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, RequiredValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, RequiredValidationError2, [].concat(args)); + _this.name = "RequiredValidationError"; + return _this; + } + (0, _inherits22["default"])(RequiredValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(RequiredValidationError2, [{ + key: "getLocation", + value: function getLocation2() { + var dataPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.instancePath; + var _superPropGet2 = _superPropGet(RequiredValidationError2, "getLocation", this, 3)([dataPath]), start = _superPropGet2.start; + return { + start + }; + } + }, { + key: "print", + value: function print() { + var _this$options = this.options, message = _this$options.message, params = _this$options.params; + var colorizer = this.getColorizer(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold("REQUIRED"), " ").concat(message)), "\n")]; + return output.concat(this.getCodeFrame("".concat(colorizer.magentaBright(params.missingProperty), " is missing here!"))); + } + }, { + key: "getError", + value: function getError() { + var message = this.options.message; + return _objectSpread(_objectSpread({}, this.getLocation()), {}, { + error: "".concat(this.getDecoratedPath(), " ").concat(message), + path: this.instancePath + }); + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/unevaluated-prop.js +var require_unevaluated_prop = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/unevaluated-prop.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = void 0; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _classCallCheck22 = _interopRequireDefault(require_classCallCheck()); + var _createClass22 = _interopRequireDefault(require_createClass()); + var _possibleConstructorReturn22 = _interopRequireDefault(require_possibleConstructorReturn()); + var _getPrototypeOf22 = _interopRequireDefault(require_getPrototypeOf()); + var _inherits22 = _interopRequireDefault(require_inherits()); + var _base = _interopRequireDefault(require_base()); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _callSuper(t8, o7, e10) { + return o7 = (0, _getPrototypeOf22["default"])(o7), (0, _possibleConstructorReturn22["default"])(t8, _isNativeReflectConstruct3() ? Reflect.construct(o7, e10 || [], (0, _getPrototypeOf22["default"])(t8).constructor) : o7.apply(t8, e10)); + } + function _isNativeReflectConstruct3() { + try { + var t8 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + } catch (t9) { + } + return (_isNativeReflectConstruct3 = function _isNativeReflectConstruct4() { + return !!t8; + })(); + } + var UnevaluatedPropValidationError = exports28["default"] = /* @__PURE__ */ function(_BaseValidationError) { + function UnevaluatedPropValidationError2() { + var _this; + (0, _classCallCheck22["default"])(this, UnevaluatedPropValidationError2); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _callSuper(this, UnevaluatedPropValidationError2, [].concat(args)); + _this.name = "UnevaluatedPropValidationError"; + _this.options.isIdentifierLocation = true; + return _this; + } + (0, _inherits22["default"])(UnevaluatedPropValidationError2, _BaseValidationError); + return (0, _createClass22["default"])(UnevaluatedPropValidationError2, [{ + key: "print", + value: function print() { + var _this$options = this.options, message = _this$options.message, params = _this$options.params; + var colorizer = this.getColorizer(); + var output = ["".concat(colorizer.red("".concat(colorizer.bold("UNEVALUATED PROPERTY"), " ").concat(message)), "\n")]; + return output.concat(this.getCodeFrame("".concat(colorizer.magentaBright(params.unevaluatedProperty), " is not expected to be here!"), "".concat(this.instancePath, "/").concat(params.unevaluatedProperty))); + } + }, { + key: "getError", + value: function getError() { + var params = this.options.params; + return _objectSpread(_objectSpread({}, this.getLocation("".concat(this.instancePath, "/").concat(params.unevaluatedProperty))), {}, { + error: "".concat(this.getDecoratedPath(), " Property ").concat(params.unevaluatedProperty, " is not expected to be here"), + path: this.instancePath + }); + } + }]); + }(_base["default"]); + module5.exports = exports28.default; + } +}); + +// node_modules/@readme/better-ajv-errors/lib/validation-errors/index.js +var require_validation_errors = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/validation-errors/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + Object.defineProperty(exports28, "AdditionalPropValidationError", { + enumerable: true, + get: function get4() { + return _additionalProp["default"]; + } + }); + Object.defineProperty(exports28, "DefaultValidationError", { + enumerable: true, + get: function get4() { + return _default2["default"]; + } + }); + Object.defineProperty(exports28, "EnumValidationError", { + enumerable: true, + get: function get4() { + return _enum["default"]; + } + }); + Object.defineProperty(exports28, "PatternValidationError", { + enumerable: true, + get: function get4() { + return _pattern["default"]; + } + }); + Object.defineProperty(exports28, "RequiredValidationError", { + enumerable: true, + get: function get4() { + return _required["default"]; + } + }); + Object.defineProperty(exports28, "UnevaluatedPropValidationError", { + enumerable: true, + get: function get4() { + return _unevaluatedProp["default"]; + } + }); + var _additionalProp = _interopRequireDefault(require_additional_prop()); + var _default2 = _interopRequireDefault(require_default()); + var _enum = _interopRequireDefault(require_enum()); + var _pattern = _interopRequireDefault(require_pattern()); + var _required = _interopRequireDefault(require_required()); + var _unevaluatedProp = _interopRequireDefault(require_unevaluated_prop()); + } +}); + +// node_modules/@readme/better-ajv-errors/lib/helpers.js +var require_helpers = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/helpers.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.createErrorInstances = createErrorInstances; + exports28["default"] = prettify2; + exports28.filterRedundantErrors = filterRedundantErrors; + exports28.makeTree = makeTree; + var _defineProperty2 = _interopRequireDefault(require_defineProperty()); + var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray()); + var _slicedToArray2 = _interopRequireDefault(require_slicedToArray()); + var _utils = require_utils(); + var _validationErrors = require_validation_errors(); + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + (0, _defineProperty2["default"])(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + var JSON_POINTERS_REGEX = /\/[\w_-]+(\/\d+)?/g; + function makeTree() { + var ajvErrors5 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; + var root2 = { + children: {} + }; + ajvErrors5.forEach(function(ajvError) { + var instancePath = typeof ajvError.instancePath !== "undefined" ? ajvError.instancePath : ajvError.dataPath; + var paths = instancePath === "" ? [""] : instancePath.match(JSON_POINTERS_REGEX); + if (paths) { + paths.reduce(function(obj, path2, i7) { + obj.children[path2] = obj.children[path2] || { + children: {}, + errors: [] + }; + if (i7 === paths.length - 1) { + obj.children[path2].errors.push(ajvError); + } + return obj.children[path2]; + }, root2); + } + }); + return root2; + } + function filterRedundantErrors(root2, parent2, key) { + (0, _utils.getErrors)(root2).forEach(function(error2) { + if ((0, _utils.isRequiredError)(error2)) { + root2.errors = [error2]; + root2.children = {}; + } + }); + if ((0, _utils.getErrors)(root2).some(_utils.isAnyOfError)) { + if (Object.keys(root2.children).length > 0) { + delete root2.errors; + } + } + if (root2.errors && root2.errors.length && (0, _utils.getErrors)(root2).every(_utils.isEnumError)) { + if ((0, _utils.getSiblings)(parent2)(root2).filter(_utils.notUndefined).some(_utils.getErrors)) { + delete parent2.children[key]; + } + } + Object.entries(root2.children).forEach(function(_ref) { + var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), k6 = _ref2[0], child = _ref2[1]; + return filterRedundantErrors(child, root2, k6); + }); + } + function createErrorInstances(root2, options) { + var errors = (0, _utils.getErrors)(root2); + if (errors.length && errors.every(_utils.isEnumError)) { + var uniqueValues = new Set((0, _utils.concatAll)([])(errors.map(function(e10) { + return e10.params.allowedValues; + }))); + var allowedValues = (0, _toConsumableArray22["default"])(uniqueValues); + var error2 = errors[0]; + return [new _validationErrors.EnumValidationError(_objectSpread(_objectSpread({}, error2), {}, { + params: { + allowedValues + } + }), options)]; + } + return (0, _utils.concatAll)(errors.reduce(function(ret, error3) { + switch (error3.keyword) { + case "additionalProperties": + return ret.concat(new _validationErrors.AdditionalPropValidationError(error3, options)); + case "pattern": + return ret.concat(new _validationErrors.PatternValidationError(error3, options)); + case "required": + return ret.concat(new _validationErrors.RequiredValidationError(error3, options)); + case "unevaluatedProperties": + return ret.concat(new _validationErrors.UnevaluatedPropValidationError(error3, options)); + default: + return ret.concat(new _validationErrors.DefaultValidationError(error3, options)); + } + }, []))((0, _utils.getChildren)(root2).map(function(child) { + return createErrorInstances(child, options); + })); + } + function prettify2(ajvErrors5, options) { + var tree = makeTree(ajvErrors5 || []); + filterRedundantErrors(tree); + return createErrorInstances(tree, options); + } + } +}); + +// node_modules/@readme/better-ajv-errors/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/@readme/better-ajv-errors/lib/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _interopRequireDefault = require_interopRequireDefault(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28["default"] = betterAjvErrors2; + var _momoa = require_api(); + var _helpers = _interopRequireDefault(require_helpers()); + function betterAjvErrors2(schema8, data, errors) { + var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; + var _options$colorize = options.colorize, colorize = _options$colorize === void 0 ? true : _options$colorize, _options$format = options.format, format5 = _options$format === void 0 ? "cli" : _options$format, _options$indent = options.indent, indent = _options$indent === void 0 ? null : _options$indent, _options$json = options.json, json2 = _options$json === void 0 ? null : _options$json; + var jsonRaw = json2 || JSON.stringify(data, null, indent); + var jsonAst = (0, _momoa.parse)(jsonRaw); + var customErrorToText = function customErrorToText2(error2) { + return error2.print().join("\n"); + }; + var customErrorToStructure = function customErrorToStructure2(error2) { + return error2.getError(); + }; + var customErrors = (0, _helpers["default"])(errors, { + colorize, + data, + schema: schema8, + jsonAst, + jsonRaw + }); + if (format5 === "cli") { + return customErrors.map(customErrorToText).join("\n\n"); + } else if (format5 === "cli-array") { + return customErrors.map(function(error2) { + return { + message: customErrorToText(error2) + }; + }); + } + return customErrors.map(customErrorToStructure); + } + module5.exports = exports28.default; + } +}); + +// node_modules/ajv/dist/compile/codegen/code.js +var require_code = __commonJS({ + "node_modules/ajv/dist/compile/codegen/code.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.regexpCode = exports28.getEsmExportName = exports28.getProperty = exports28.safeStringify = exports28.stringify = exports28.strConcat = exports28.addCodeArg = exports28.str = exports28._ = exports28.nil = exports28._Code = exports28.Name = exports28.IDENTIFIER = exports28._CodeOrName = void 0; + var _CodeOrName = class { + }; + exports28._CodeOrName = _CodeOrName; + exports28.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; + var Name = class extends _CodeOrName { + constructor(s7) { + super(); + if (!exports28.IDENTIFIER.test(s7)) + throw new Error("CodeGen: name must be a valid identifier"); + this.str = s7; + } + toString() { + return this.str; + } + emptyStr() { + return false; + } + get names() { + return { [this.str]: 1 }; + } + }; + exports28.Name = Name; + var _Code = class extends _CodeOrName { + constructor(code) { + super(); + this._items = typeof code === "string" ? [code] : code; + } + toString() { + return this.str; + } + emptyStr() { + if (this._items.length > 1) + return false; + const item = this._items[0]; + return item === "" || item === '""'; + } + get str() { + var _a2; + return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s7, c7) => `${s7}${c7}`, ""); + } + get names() { + var _a2; + return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c7) => { + if (c7 instanceof Name) + names[c7.str] = (names[c7.str] || 0) + 1; + return names; + }, {}); + } + }; + exports28._Code = _Code; + exports28.nil = new _Code(""); + function _6(strs, ...args) { + const code = [strs[0]]; + let i7 = 0; + while (i7 < args.length) { + addCodeArg(code, args[i7]); + code.push(strs[++i7]); + } + return new _Code(code); + } + exports28._ = _6; + var plus = new _Code("+"); + function str2(strs, ...args) { + const expr = [safeStringify2(strs[0])]; + let i7 = 0; + while (i7 < args.length) { + expr.push(plus); + addCodeArg(expr, args[i7]); + expr.push(plus, safeStringify2(strs[++i7])); + } + optimize(expr); + return new _Code(expr); + } + exports28.str = str2; + function addCodeArg(code, arg) { + if (arg instanceof _Code) + code.push(...arg._items); + else if (arg instanceof Name) + code.push(arg); + else + code.push(interpolate(arg)); + } + exports28.addCodeArg = addCodeArg; + function optimize(expr) { + let i7 = 1; + while (i7 < expr.length - 1) { + if (expr[i7] === plus) { + const res = mergeExprItems(expr[i7 - 1], expr[i7 + 1]); + if (res !== void 0) { + expr.splice(i7 - 1, 3, res); + continue; + } + expr[i7++] = "+"; + } + i7++; + } + } + function mergeExprItems(a7, b8) { + if (b8 === '""') + return a7; + if (a7 === '""') + return b8; + if (typeof a7 == "string") { + if (b8 instanceof Name || a7[a7.length - 1] !== '"') + return; + if (typeof b8 != "string") + return `${a7.slice(0, -1)}${b8}"`; + if (b8[0] === '"') + return a7.slice(0, -1) + b8.slice(1); + return; + } + if (typeof b8 == "string" && b8[0] === '"' && !(a7 instanceof Name)) + return `"${a7}${b8.slice(1)}`; + return; + } + function strConcat(c1, c22) { + return c22.emptyStr() ? c1 : c1.emptyStr() ? c22 : str2`${c1}${c22}`; + } + exports28.strConcat = strConcat; + function interpolate(x7) { + return typeof x7 == "number" || typeof x7 == "boolean" || x7 === null ? x7 : safeStringify2(Array.isArray(x7) ? x7.join(",") : x7); + } + function stringify5(x7) { + return new _Code(safeStringify2(x7)); + } + exports28.stringify = stringify5; + function safeStringify2(x7) { + return JSON.stringify(x7).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); + } + exports28.safeStringify = safeStringify2; + function getProperty(key) { + return typeof key == "string" && exports28.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _6`[${key}]`; + } + exports28.getProperty = getProperty; + function getEsmExportName(key) { + if (typeof key == "string" && exports28.IDENTIFIER.test(key)) { + return new _Code(`${key}`); + } + throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); + } + exports28.getEsmExportName = getEsmExportName; + function regexpCode(rx) { + return new _Code(rx.toString()); + } + exports28.regexpCode = regexpCode; + } +}); + +// node_modules/ajv/dist/compile/codegen/scope.js +var require_scope = __commonJS({ + "node_modules/ajv/dist/compile/codegen/scope.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ValueScope = exports28.ValueScopeName = exports28.Scope = exports28.varKinds = exports28.UsedValueState = void 0; + var code_1 = require_code(); + var ValueError = class extends Error { + constructor(name2) { + super(`CodeGen: "code" for ${name2} not defined`); + this.value = name2.value; + } + }; + var UsedValueState; + (function(UsedValueState2) { + UsedValueState2[UsedValueState2["Started"] = 0] = "Started"; + UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed"; + })(UsedValueState || (exports28.UsedValueState = UsedValueState = {})); + exports28.varKinds = { + const: new code_1.Name("const"), + let: new code_1.Name("let"), + var: new code_1.Name("var") + }; + var Scope = class { + constructor({ prefixes, parent: parent2 } = {}) { + this._names = {}; + this._prefixes = prefixes; + this._parent = parent2; + } + toName(nameOrPrefix) { + return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); + } + name(prefix) { + return new code_1.Name(this._newName(prefix)); + } + _newName(prefix) { + const ng = this._names[prefix] || this._nameGroup(prefix); + return `${prefix}${ng.index++}`; + } + _nameGroup(prefix) { + var _a2, _b; + if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _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 }; + } + }; + exports28.Scope = Scope; + var ValueScopeName = class extends code_1.Name { + constructor(prefix, nameStr) { + super(nameStr); + this.prefix = prefix; + } + setValue(value2, { property: property2, itemIndex }) { + this.value = value2; + this.scopePath = (0, code_1._)`.${new code_1.Name(property2)}[${itemIndex}]`; + } + }; + exports28.ValueScopeName = ValueScopeName; + var line = (0, code_1._)`\n`; + var ValueScope = class extends Scope { + constructor(opts) { + super(opts); + this._values = {}; + this._scope = opts.scope; + this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; + } + get() { + return this._scope; + } + name(prefix) { + return new ValueScopeName(prefix, this._newName(prefix)); + } + value(nameOrPrefix, value2) { + var _a2; + if (value2.ref === void 0) + throw new Error("CodeGen: ref must be passed in value"); + const name2 = this.toName(nameOrPrefix); + const { prefix } = name2; + const valueKey = (_a2 = value2.key) !== null && _a2 !== void 0 ? _a2 : value2.ref; + let vs = this._values[prefix]; + if (vs) { + const _name = vs.get(valueKey); + if (_name) + return _name; + } else { + vs = this._values[prefix] = /* @__PURE__ */ new Map(); + } + vs.set(valueKey, name2); + const s7 = this._scope[prefix] || (this._scope[prefix] = []); + const itemIndex = s7.length; + s7[itemIndex] = value2.ref; + name2.setValue(value2, { property: prefix, itemIndex }); + return name2; + } + getValue(prefix, keyOrRef) { + const vs = this._values[prefix]; + if (!vs) + return; + return vs.get(keyOrRef); + } + scopeRefs(scopeName, values2 = this._values) { + return this._reduceValues(values2, (name2) => { + if (name2.scopePath === void 0) + throw new Error(`CodeGen: name "${name2}" has no value`); + return (0, code_1._)`${scopeName}${name2.scopePath}`; + }); + } + scopeCode(values2 = this._values, usedValues, getCode) { + return this._reduceValues(values2, (name2) => { + if (name2.value === void 0) + throw new Error(`CodeGen: name "${name2}" has no value`); + return name2.value.code; + }, usedValues, getCode); + } + _reduceValues(values2, valueCode, usedValues = {}, getCode) { + let code = code_1.nil; + for (const prefix in values2) { + const vs = values2[prefix]; + if (!vs) + continue; + const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map(); + vs.forEach((name2) => { + if (nameSet.has(name2)) + return; + nameSet.set(name2, UsedValueState.Started); + let c7 = valueCode(name2); + if (c7) { + const def = this.opts.es5 ? exports28.varKinds.var : exports28.varKinds.const; + code = (0, code_1._)`${code}${def} ${name2} = ${c7};${this.opts._n}`; + } else if (c7 = getCode === null || getCode === void 0 ? void 0 : getCode(name2)) { + code = (0, code_1._)`${code}${c7}${this.opts._n}`; + } else { + throw new ValueError(name2); + } + nameSet.set(name2, UsedValueState.Completed); + }); + } + return code; + } + }; + exports28.ValueScope = ValueScope; + } +}); + +// node_modules/ajv/dist/compile/codegen/index.js +var require_codegen = __commonJS({ + "node_modules/ajv/dist/compile/codegen/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.or = exports28.and = exports28.not = exports28.CodeGen = exports28.operators = exports28.varKinds = exports28.ValueScopeName = exports28.ValueScope = exports28.Scope = exports28.Name = exports28.regexpCode = exports28.stringify = exports28.getProperty = exports28.nil = exports28.strConcat = exports28.str = exports28._ = void 0; + var code_1 = require_code(); + var scope_1 = require_scope(); + var code_2 = require_code(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return code_2._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return code_2.str; + } }); + Object.defineProperty(exports28, "strConcat", { enumerable: true, get: function() { + return code_2.strConcat; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return code_2.nil; + } }); + Object.defineProperty(exports28, "getProperty", { enumerable: true, get: function() { + return code_2.getProperty; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return code_2.stringify; + } }); + Object.defineProperty(exports28, "regexpCode", { enumerable: true, get: function() { + return code_2.regexpCode; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return code_2.Name; + } }); + var scope_2 = require_scope(); + Object.defineProperty(exports28, "Scope", { enumerable: true, get: function() { + return scope_2.Scope; + } }); + Object.defineProperty(exports28, "ValueScope", { enumerable: true, get: function() { + return scope_2.ValueScope; + } }); + Object.defineProperty(exports28, "ValueScopeName", { enumerable: true, get: function() { + return scope_2.ValueScopeName; + } }); + Object.defineProperty(exports28, "varKinds", { enumerable: true, get: function() { + return scope_2.varKinds; + } }); + exports28.operators = { + GT: new code_1._Code(">"), + GTE: new code_1._Code(">="), + LT: new code_1._Code("<"), + LTE: new code_1._Code("<="), + EQ: new code_1._Code("==="), + NEQ: new code_1._Code("!=="), + NOT: new code_1._Code("!"), + OR: new code_1._Code("||"), + AND: new code_1._Code("&&"), + ADD: new code_1._Code("+") + }; + var Node = class { + optimizeNodes() { + return this; + } + optimizeNames(_names, _constants) { + return this; + } + }; + var Def = class extends Node { + constructor(varKind, name2, rhs) { + super(); + this.varKind = varKind; + this.name = name2; + this.rhs = rhs; + } + render({ es5, _n }) { + const varKind = es5 ? scope_1.varKinds.var : this.varKind; + const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`; + return `${varKind} ${this.name}${rhs};` + _n; + } + optimizeNames(names, constants5) { + if (!names[this.name.str]) + return; + if (this.rhs) + this.rhs = optimizeExpr(this.rhs, names, constants5); + return this; + } + get names() { + return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; + } + }; + var Assign = class extends Node { + constructor(lhs, rhs, sideEffects) { + super(); + this.lhs = lhs; + this.rhs = rhs; + this.sideEffects = sideEffects; + } + render({ _n }) { + return `${this.lhs} = ${this.rhs};` + _n; + } + optimizeNames(names, constants5) { + if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) + return; + this.rhs = optimizeExpr(this.rhs, names, constants5); + return this; + } + get names() { + const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; + return addExprNames(names, this.rhs); + } + }; + var AssignOp = class extends Assign { + constructor(lhs, op, rhs, sideEffects) { + super(lhs, rhs, sideEffects); + this.op = op; + } + render({ _n }) { + return `${this.lhs} ${this.op}= ${this.rhs};` + _n; + } + }; + var Label = class extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + return `${this.label}:` + _n; + } + }; + var Break = class extends Node { + constructor(label) { + super(); + this.label = label; + this.names = {}; + } + render({ _n }) { + const label = this.label ? ` ${this.label}` : ""; + return `break${label};` + _n; + } + }; + var Throw = class extends Node { + constructor(error2) { + super(); + this.error = error2; + } + render({ _n }) { + return `throw ${this.error};` + _n; + } + get names() { + return this.error.names; + } + }; + var AnyCode = class extends Node { + constructor(code) { + super(); + this.code = code; + } + render({ _n }) { + return `${this.code};` + _n; + } + optimizeNodes() { + return `${this.code}` ? this : void 0; + } + optimizeNames(names, constants5) { + this.code = optimizeExpr(this.code, names, constants5); + return this; + } + get names() { + return this.code instanceof code_1._CodeOrName ? this.code.names : {}; + } + }; + var ParentNode = class extends Node { + constructor(nodes = []) { + super(); + this.nodes = nodes; + } + render(opts) { + return this.nodes.reduce((code, n7) => code + n7.render(opts), ""); + } + optimizeNodes() { + const { nodes } = this; + let i7 = nodes.length; + while (i7--) { + const n7 = nodes[i7].optimizeNodes(); + if (Array.isArray(n7)) + nodes.splice(i7, 1, ...n7); + else if (n7) + nodes[i7] = n7; + else + nodes.splice(i7, 1); + } + return nodes.length > 0 ? this : void 0; + } + optimizeNames(names, constants5) { + const { nodes } = this; + let i7 = nodes.length; + while (i7--) { + const n7 = nodes[i7]; + if (n7.optimizeNames(names, constants5)) + continue; + subtractNames(names, n7.names); + nodes.splice(i7, 1); + } + return nodes.length > 0 ? this : void 0; + } + get names() { + return this.nodes.reduce((names, n7) => addNames(names, n7.names), {}); + } + }; + var BlockNode = class extends ParentNode { + render(opts) { + return "{" + opts._n + super.render(opts) + "}" + opts._n; + } + }; + var Root2 = class extends ParentNode { + }; + var Else = class extends BlockNode { + }; + Else.kind = "else"; + var If = class _If extends BlockNode { + constructor(condition, nodes) { + super(nodes); + this.condition = condition; + } + render(opts) { + let code = `if(${this.condition})` + super.render(opts); + if (this.else) + code += "else " + this.else.render(opts); + return code; + } + optimizeNodes() { + super.optimizeNodes(); + const cond2 = this.condition; + if (cond2 === true) + return this.nodes; + let e10 = this.else; + if (e10) { + const ns = e10.optimizeNodes(); + e10 = this.else = Array.isArray(ns) ? new Else(ns) : ns; + } + if (e10) { + if (cond2 === false) + return e10 instanceof _If ? e10 : e10.nodes; + if (this.nodes.length) + return this; + return new _If(not(cond2), e10 instanceof _If ? [e10] : e10.nodes); + } + if (cond2 === false || !this.nodes.length) + return void 0; + return this; + } + optimizeNames(names, constants5) { + var _a2; + this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants5); + if (!(super.optimizeNames(names, constants5) || this.else)) + return; + this.condition = optimizeExpr(this.condition, names, constants5); + return this; + } + get names() { + const names = super.names; + addExprNames(names, this.condition); + if (this.else) + addNames(names, this.else.names); + return names; + } + }; + If.kind = "if"; + var For = class extends BlockNode { + }; + For.kind = "for"; + var ForLoop = class extends For { + constructor(iteration) { + super(); + this.iteration = iteration; + } + render(opts) { + return `for(${this.iteration})` + super.render(opts); + } + optimizeNames(names, constants5) { + if (!super.optimizeNames(names, constants5)) + return; + this.iteration = optimizeExpr(this.iteration, names, constants5); + return this; + } + get names() { + return addNames(super.names, this.iteration.names); + } + }; + var ForRange = class extends For { + constructor(varKind, name2, from, to) { + super(); + this.varKind = varKind; + this.name = name2; + this.from = from; + this.to = to; + } + render(opts) { + const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; + const { name: name2, from, to } = this; + return `for(${varKind} ${name2}=${from}; ${name2}<${to}; ${name2}++)` + super.render(opts); + } + get names() { + const names = addExprNames(super.names, this.from); + return addExprNames(names, this.to); + } + }; + var ForIter = class extends For { + constructor(loop, varKind, name2, iterable) { + super(); + this.loop = loop; + this.varKind = varKind; + this.name = name2; + this.iterable = iterable; + } + render(opts) { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); + } + optimizeNames(names, constants5) { + if (!super.optimizeNames(names, constants5)) + return; + this.iterable = optimizeExpr(this.iterable, names, constants5); + return this; + } + get names() { + return addNames(super.names, this.iterable.names); + } + }; + var Func = class extends BlockNode { + constructor(name2, args, async) { + super(); + this.name = name2; + this.args = args; + this.async = async; + } + render(opts) { + const _async = this.async ? "async " : ""; + return `${_async}function ${this.name}(${this.args})` + super.render(opts); + } + }; + Func.kind = "func"; + var Return = class extends ParentNode { + render(opts) { + return "return " + super.render(opts); + } + }; + Return.kind = "return"; + var Try = class extends BlockNode { + render(opts) { + let code = "try" + super.render(opts); + if (this.catch) + code += this.catch.render(opts); + if (this.finally) + code += this.finally.render(opts); + return code; + } + optimizeNodes() { + var _a2, _b; + super.optimizeNodes(); + (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNodes(); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); + return this; + } + optimizeNames(names, constants5) { + var _a2, _b; + super.optimizeNames(names, constants5); + (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants5); + (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants5); + return this; + } + get names() { + const names = super.names; + if (this.catch) + addNames(names, this.catch.names); + if (this.finally) + addNames(names, this.finally.names); + return names; + } + }; + var Catch = class extends BlockNode { + constructor(error2) { + super(); + this.error = error2; + } + render(opts) { + return `catch(${this.error})` + super.render(opts); + } + }; + Catch.kind = "catch"; + var Finally = class extends BlockNode { + render(opts) { + return "finally" + super.render(opts); + } + }; + Finally.kind = "finally"; + var CodeGen = class { + constructor(extScope, opts = {}) { + this._values = {}; + this._blockStarts = []; + this._constants = {}; + this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; + this._extScope = extScope; + this._scope = new scope_1.Scope({ parent: extScope }); + this._nodes = [new Root2()]; + } + toString() { + return this._root.render(this.opts); + } + // returns unique name in the internal scope + name(prefix) { + return this._scope.name(prefix); + } + // reserves unique name in the external scope + scopeName(prefix) { + return this._extScope.name(prefix); + } + // reserves unique name in the external scope and assigns value to it + scopeValue(prefixOrName, value2) { + const name2 = this._extScope.value(prefixOrName, value2); + const vs = this._values[name2.prefix] || (this._values[name2.prefix] = /* @__PURE__ */ new Set()); + vs.add(name2); + return name2; + } + getScopeValue(prefix, keyOrRef) { + return this._extScope.getValue(prefix, keyOrRef); + } + // return code that assigns values in the external scope to the names that are used internally + // (same names that were returned by gen.scopeName or gen.scopeValue) + scopeRefs(scopeName) { + return this._extScope.scopeRefs(scopeName, this._values); + } + scopeCode() { + return this._extScope.scopeCode(this._values); + } + _def(varKind, nameOrPrefix, rhs, constant2) { + const name2 = this._scope.toName(nameOrPrefix); + if (rhs !== void 0 && constant2) + this._constants[name2.str] = rhs; + this._leafNode(new Def(varKind, name2, rhs)); + return name2; + } + // `const` declaration (`var` in es5 mode) + const(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); + } + // `let` declaration with optional assignment (`var` in es5 mode) + let(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); + } + // `var` declaration with optional assignment + var(nameOrPrefix, rhs, _constant) { + return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); + } + // assignment code + assign(lhs, rhs, sideEffects) { + return this._leafNode(new Assign(lhs, rhs, sideEffects)); + } + // `+=` code + add(lhs, rhs) { + return this._leafNode(new AssignOp(lhs, exports28.operators.ADD, rhs)); + } + // appends passed SafeExpr to code or executes Block + code(c7) { + if (typeof c7 == "function") + c7(); + else if (c7 !== code_1.nil) + this._leafNode(new AnyCode(c7)); + return this; + } + // returns code for object literal for the passed argument list of key-value pairs + object(...keyValues) { + const code = ["{"]; + for (const [key, value2] of keyValues) { + if (code.length > 1) + code.push(","); + code.push(key); + if (key !== value2 || this.opts.es5) { + code.push(":"); + (0, code_1.addCodeArg)(code, value2); + } + } + code.push("}"); + return new code_1._Code(code); + } + // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) + if(condition, thenBody, elseBody) { + this._blockNode(new If(condition)); + if (thenBody && elseBody) { + this.code(thenBody).else().code(elseBody).endIf(); + } else if (thenBody) { + this.code(thenBody).endIf(); + } else if (elseBody) { + throw new Error('CodeGen: "else" body without "then" body'); + } + return this; + } + // `else if` clause - invalid without `if` or after `else` clauses + elseIf(condition) { + return this._elseNode(new If(condition)); + } + // `else` clause - only valid after `if` or `else if` clauses + else() { + return this._elseNode(new Else()); + } + // end `if` statement (needed if gen.if was used only with condition) + endIf() { + return this._endBlockNode(If, Else); + } + _for(node, forBody) { + this._blockNode(node); + if (forBody) + this.code(forBody).endFor(); + return this; + } + // a generic `for` clause (or statement if `forBody` is passed) + for(iteration, forBody) { + return this._for(new ForLoop(iteration), forBody); + } + // `for` statement for a range of values + forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { + const name2 = this._scope.toName(nameOrPrefix); + return this._for(new ForRange(varKind, name2, from, to), () => forBody(name2)); + } + // `for-of` statement (in es5 mode replace with a normal for loop) + forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { + const name2 = 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`, (i7) => { + this.var(name2, (0, code_1._)`${arr}[${i7}]`); + forBody(name2); + }); + } + return this._for(new ForIter("of", varKind, name2, iterable), () => forBody(name2)); + } + // `for-in` statement. + // With option `ownProperties` replaced with a `for-of` loop for object keys + forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { + if (this.opts.ownProperties) { + return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody); + } + const name2 = this._scope.toName(nameOrPrefix); + return this._for(new ForIter("in", varKind, name2, obj), () => forBody(name2)); + } + // end `for` loop + endFor() { + return this._endBlockNode(For); + } + // `label` statement + label(label) { + return this._leafNode(new Label(label)); + } + // `break` statement + break(label) { + return this._leafNode(new Break(label)); + } + // `return` statement + return(value2) { + const node = new Return(); + this._blockNode(node); + this.code(value2); + if (node.nodes.length !== 1) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(Return); + } + // `try` statement + try(tryBody, catchCode, finallyCode) { + if (!catchCode && !finallyCode) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + const node = new Try(); + this._blockNode(node); + this.code(tryBody); + if (catchCode) { + const error2 = this.name("e"); + this._currNode = node.catch = new Catch(error2); + catchCode(error2); + } + if (finallyCode) { + this._currNode = node.finally = new Finally(); + this.code(finallyCode); + } + return this._endBlockNode(Catch, Finally); + } + // `throw` statement + throw(error2) { + return this._leafNode(new Throw(error2)); + } + // start self-balancing block + block(body, nodeCount) { + this._blockStarts.push(this._nodes.length); + if (body) + this.code(body).endBlock(nodeCount); + return this; + } + // end the current self-balancing block + endBlock(nodeCount) { + const len = this._blockStarts.pop(); + if (len === void 0) + throw new Error("CodeGen: not in self-balancing block"); + const toClose = this._nodes.length - len; + if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) { + throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); + } + this._nodes.length = len; + return this; + } + // `function` heading (or definition if funcBody is passed) + func(name2, args = code_1.nil, async, funcBody) { + this._blockNode(new Func(name2, args, async)); + if (funcBody) + this.code(funcBody).endFunc(); + return this; + } + // end function definition + endFunc() { + return this._endBlockNode(Func); + } + optimize(n7 = 1) { + while (n7-- > 0) { + this._root.optimizeNodes(); + this._root.optimizeNames(this._root.names, this._constants); + } + } + _leafNode(node) { + this._currNode.nodes.push(node); + return this; + } + _blockNode(node) { + this._currNode.nodes.push(node); + this._nodes.push(node); + } + _endBlockNode(N1, N22) { + const n7 = this._currNode; + if (n7 instanceof N1 || N22 && n7 instanceof N22) { + this._nodes.pop(); + return this; + } + throw new Error(`CodeGen: not in block "${N22 ? `${N1.kind}/${N22.kind}` : N1.kind}"`); + } + _elseNode(node) { + const n7 = this._currNode; + if (!(n7 instanceof If)) { + throw new Error('CodeGen: "else" without "if"'); + } + this._currNode = n7.else = node; + return this; + } + get _root() { + return this._nodes[0]; + } + get _currNode() { + const ns = this._nodes; + return ns[ns.length - 1]; + } + set _currNode(node) { + const ns = this._nodes; + ns[ns.length - 1] = node; + } + }; + exports28.CodeGen = CodeGen; + function addNames(names, from) { + for (const n7 in from) + names[n7] = (names[n7] || 0) + (from[n7] || 0); + return names; + } + function addExprNames(names, from) { + return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; + } + function optimizeExpr(expr, names, constants5) { + if (expr instanceof code_1.Name) + return replaceName(expr); + if (!canOptimize(expr)) + return expr; + return new code_1._Code(expr._items.reduce((items, c7) => { + if (c7 instanceof code_1.Name) + c7 = replaceName(c7); + if (c7 instanceof code_1._Code) + items.push(...c7._items); + else + items.push(c7); + return items; + }, [])); + function replaceName(n7) { + const c7 = constants5[n7.str]; + if (c7 === void 0 || names[n7.str] !== 1) + return n7; + delete names[n7.str]; + return c7; + } + function canOptimize(e10) { + return e10 instanceof code_1._Code && e10._items.some((c7) => c7 instanceof code_1.Name && names[c7.str] === 1 && constants5[c7.str] !== void 0); + } + } + function subtractNames(names, from) { + for (const n7 in from) + names[n7] = (names[n7] || 0) - (from[n7] || 0); + } + function not(x7) { + return typeof x7 == "boolean" || typeof x7 == "number" || x7 === null ? !x7 : (0, code_1._)`!${par(x7)}`; + } + exports28.not = not; + var andCode = mappend(exports28.operators.AND); + function and(...args) { + return args.reduce(andCode); + } + exports28.and = and; + var orCode = mappend(exports28.operators.OR); + function or(...args) { + return args.reduce(orCode); + } + exports28.or = or; + function mappend(op) { + return (x7, y7) => x7 === code_1.nil ? y7 : y7 === code_1.nil ? x7 : (0, code_1._)`${par(x7)} ${op} ${par(y7)}`; + } + function par(x7) { + return x7 instanceof code_1.Name ? x7 : (0, code_1._)`(${x7})`; + } + } +}); + +// node_modules/ajv/dist/compile/util.js +var require_util = __commonJS({ + "node_modules/ajv/dist/compile/util.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.checkStrictMode = exports28.getErrorPath = exports28.Type = exports28.useFunc = exports28.setEvaluated = exports28.evaluatedPropsToName = exports28.mergeEvaluated = exports28.eachItem = exports28.unescapeJsonPointer = exports28.escapeJsonPointer = exports28.escapeFragment = exports28.unescapeFragment = exports28.schemaRefOrVal = exports28.schemaHasRulesButRef = exports28.schemaHasRules = exports28.checkUnknownRules = exports28.alwaysValidSchema = exports28.toHash = void 0; + var codegen_1 = require_codegen(); + var code_1 = require_code(); + function toHash(arr) { + const hash = {}; + for (const item of arr) + hash[item] = true; + return hash; + } + exports28.toHash = toHash; + function alwaysValidSchema(it2, schema8) { + if (typeof schema8 == "boolean") + return schema8; + if (Object.keys(schema8).length === 0) + return true; + checkUnknownRules(it2, schema8); + return !schemaHasRules(schema8, it2.self.RULES.all); + } + exports28.alwaysValidSchema = alwaysValidSchema; + function checkUnknownRules(it2, schema8 = it2.schema) { + const { opts, self: self2 } = it2; + if (!opts.strictSchema) + return; + if (typeof schema8 === "boolean") + return; + const rules = self2.RULES.keywords; + for (const key in schema8) { + if (!rules[key]) + checkStrictMode(it2, `unknown keyword: "${key}"`); + } + } + exports28.checkUnknownRules = checkUnknownRules; + function schemaHasRules(schema8, rules) { + if (typeof schema8 == "boolean") + return !schema8; + for (const key in schema8) + if (rules[key]) + return true; + return false; + } + exports28.schemaHasRules = schemaHasRules; + function schemaHasRulesButRef(schema8, RULES) { + if (typeof schema8 == "boolean") + return !schema8; + for (const key in schema8) + if (key !== "$ref" && RULES.all[key]) + return true; + return false; + } + exports28.schemaHasRulesButRef = schemaHasRulesButRef; + function schemaRefOrVal({ topSchemaRef, schemaPath }, schema8, keyword, $data) { + if (!$data) { + if (typeof schema8 == "number" || typeof schema8 == "boolean") + return schema8; + if (typeof schema8 == "string") + return (0, codegen_1._)`${schema8}`; + } + return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; + } + exports28.schemaRefOrVal = schemaRefOrVal; + function unescapeFragment(str2) { + return unescapeJsonPointer(decodeURIComponent(str2)); + } + exports28.unescapeFragment = unescapeFragment; + function escapeFragment(str2) { + return encodeURIComponent(escapeJsonPointer(str2)); + } + exports28.escapeFragment = escapeFragment; + function escapeJsonPointer(str2) { + if (typeof str2 == "number") + return `${str2}`; + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + exports28.escapeJsonPointer = escapeJsonPointer; + function unescapeJsonPointer(str2) { + return str2.replace(/~1/g, "/").replace(/~0/g, "~"); + } + exports28.unescapeJsonPointer = unescapeJsonPointer; + function eachItem(xs, f8) { + if (Array.isArray(xs)) { + for (const x7 of xs) + f8(x7); + } else { + f8(xs); + } + } + exports28.eachItem = eachItem; + function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues: mergeValues2, resultToName }) { + return (gen, from, to, toName) => { + const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues2(from, to); + return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; + }; + } + exports28.mergeEvaluated = { + props: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => { + gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`)); + }), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => { + if (from === true) { + gen.assign(to, true); + } else { + gen.assign(to, (0, codegen_1._)`${to} || {}`); + setEvaluated(gen, to, from); + } + }), + mergeValues: (from, to) => from === true ? true : { ...from, ...to }, + resultToName: evaluatedPropsToName + }), + items: makeMergeEvaluated({ + mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), + mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), + mergeValues: (from, to) => from === true ? true : Math.max(from, to), + resultToName: (gen, items) => gen.var("items", items) + }) + }; + function evaluatedPropsToName(gen, ps) { + if (ps === true) + return gen.var("props", true); + const props = gen.var("props", (0, codegen_1._)`{}`); + if (ps !== void 0) + setEvaluated(gen, props, ps); + return props; + } + exports28.evaluatedPropsToName = evaluatedPropsToName; + function setEvaluated(gen, props, ps) { + Object.keys(ps).forEach((p7) => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p7)}`, true)); + } + exports28.setEvaluated = setEvaluated; + var snippets = {}; + function useFunc(gen, f8) { + return gen.scopeValue("func", { + ref: f8, + code: snippets[f8.code] || (snippets[f8.code] = new code_1._Code(f8.code)) + }); + } + exports28.useFunc = useFunc; + var Type3; + (function(Type4) { + Type4[Type4["Num"] = 0] = "Num"; + Type4[Type4["Str"] = 1] = "Str"; + })(Type3 || (exports28.Type = Type3 = {})); + function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { + if (dataProp instanceof codegen_1.Name) { + const isNumber3 = dataPropType === Type3.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); + } + exports28.getErrorPath = getErrorPath; + function checkStrictMode(it2, msg, mode = it2.opts.strictSchema) { + if (!mode) + return; + msg = `strict mode: ${msg}`; + if (mode === true) + throw new Error(msg); + it2.self.logger.warn(msg); + } + exports28.checkStrictMode = checkStrictMode; + } +}); + +// node_modules/ajv/dist/compile/names.js +var require_names = __commonJS({ + "node_modules/ajv/dist/compile/names.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var names = { + // validation function arguments + data: new codegen_1.Name("data"), + // data passed to validation function + // args passed from referencing schema + valCxt: new codegen_1.Name("valCxt"), + // validation/data context - should not be used directly, it is destructured to the names below + instancePath: new codegen_1.Name("instancePath"), + parentData: new codegen_1.Name("parentData"), + parentDataProperty: new codegen_1.Name("parentDataProperty"), + rootData: new codegen_1.Name("rootData"), + // root data - same as the data passed to the first/top validation function + dynamicAnchors: new codegen_1.Name("dynamicAnchors"), + // used to support recursiveRef and dynamicRef + // function scoped variables + vErrors: new codegen_1.Name("vErrors"), + // null or array of validation errors + errors: new codegen_1.Name("errors"), + // counter of validation errors + this: new codegen_1.Name("this"), + // "globals" + self: new codegen_1.Name("self"), + scope: new codegen_1.Name("scope"), + // JTD serialize/parse name for JSON string and position + json: new codegen_1.Name("json"), + jsonPos: new codegen_1.Name("jsonPos"), + jsonLen: new codegen_1.Name("jsonLen"), + jsonPart: new codegen_1.Name("jsonPart") + }; + exports28.default = names; + } +}); + +// node_modules/ajv/dist/compile/errors.js +var require_errors = __commonJS({ + "node_modules/ajv/dist/compile/errors.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.extendErrors = exports28.resetErrorsCount = exports28.reportExtraError = exports28.reportError = exports28.keyword$DataError = exports28.keywordError = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var names_1 = require_names(); + exports28.keywordError = { + message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` + }; + exports28.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 reportError(cxt, error2 = exports28.keywordError, errorPaths, overrideAllErrors) { + const { it: it2 } = cxt; + const { gen, compositeRule, allErrors } = it2; + const errObj = errorObjectCode(cxt, error2, errorPaths); + if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { + addError(gen, errObj); + } else { + returnErrors(it2, (0, codegen_1._)`[${errObj}]`); + } + } + exports28.reportError = reportError; + function reportExtraError(cxt, error2 = exports28.keywordError, errorPaths) { + const { it: it2 } = cxt; + const { gen, compositeRule, allErrors } = it2; + const errObj = errorObjectCode(cxt, error2, errorPaths); + addError(gen, errObj); + if (!(compositeRule || allErrors)) { + returnErrors(it2, names_1.default.vErrors); + } + } + exports28.reportExtraError = reportExtraError; + function resetErrorsCount(gen, errsCount) { + gen.assign(names_1.default.errors, errsCount); + gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); + } + exports28.resetErrorsCount = resetErrorsCount; + function extendErrors({ gen, keyword, schemaValue, data, errsCount, it: it2 }) { + if (errsCount === void 0) + throw new Error("ajv implementation error"); + const err = gen.name("err"); + gen.forRange("i", errsCount, names_1.default.errors, (i7) => { + gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i7}]`); + gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it2.errorPath))); + gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it2.errSchemaPath}/${keyword}`); + if (it2.opts.verbose) { + gen.assign((0, codegen_1._)`${err}.schema`, schemaValue); + gen.assign((0, codegen_1._)`${err}.data`, data); + } + }); + } + exports28.extendErrors = extendErrors; + function addError(gen, errObj) { + const err = gen.const("err", errObj); + gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`); + gen.code((0, codegen_1._)`${names_1.default.errors}++`); + } + function returnErrors(it2, errs) { + const { gen, validateName, schemaEnv } = it2; + if (schemaEnv.$async) { + gen.throw((0, codegen_1._)`new ${it2.ValidationError}(${errs})`); + } else { + gen.assign((0, codegen_1._)`${validateName}.errors`, errs); + gen.return(false); + } + } + var E6 = { + keyword: new codegen_1.Name("keyword"), + schemaPath: new codegen_1.Name("schemaPath"), + // also used in JTD errors + params: new codegen_1.Name("params"), + propertyName: new codegen_1.Name("propertyName"), + message: new codegen_1.Name("message"), + schema: new codegen_1.Name("schema"), + parentSchema: new codegen_1.Name("parentSchema") + }; + function errorObjectCode(cxt, error2, errorPaths) { + const { createErrors } = cxt.it; + if (createErrors === false) + return (0, codegen_1._)`{}`; + return errorObject(cxt, error2, errorPaths); + } + function errorObject(cxt, error2, errorPaths = {}) { + const { gen, it: it2 } = cxt; + const keyValues = [ + errorInstancePath(it2, errorPaths), + errorSchemaPath(cxt, errorPaths) + ]; + extraErrorProps(cxt, error2, keyValues); + return gen.object(...keyValues); + } + function errorInstancePath({ errorPath }, { instancePath }) { + const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; + return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; + } + function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { + let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`; + if (schemaPath) { + schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; + } + return [E6.schemaPath, schPath]; + } + function extraErrorProps(cxt, { params, message }, keyValues) { + const { keyword, data, schemaValue, it: it2 } = cxt; + const { opts, propertyName, topSchemaRef, schemaPath } = it2; + keyValues.push([E6.keyword, keyword], [E6.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); + if (opts.messages) { + keyValues.push([E6.message, typeof message == "function" ? message(cxt) : message]); + } + if (opts.verbose) { + keyValues.push([E6.schema, schemaValue], [E6.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); + } + if (propertyName) + keyValues.push([E6.propertyName, propertyName]); + } + } +}); + +// node_modules/ajv/dist/compile/validate/boolSchema.js +var require_boolSchema = __commonJS({ + "node_modules/ajv/dist/compile/validate/boolSchema.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.boolOrEmptySchema = exports28.topBoolOrEmptySchema = void 0; + var errors_1 = require_errors(); + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var boolError = { + message: "boolean schema is false" + }; + function topBoolOrEmptySchema(it2) { + const { gen, schema: schema8, validateName } = it2; + if (schema8 === false) { + falseSchemaError(it2, false); + } else if (typeof schema8 == "object" && schema8.$async === true) { + gen.return(names_1.default.data); + } else { + gen.assign((0, codegen_1._)`${validateName}.errors`, null); + gen.return(true); + } + } + exports28.topBoolOrEmptySchema = topBoolOrEmptySchema; + function boolOrEmptySchema(it2, valid) { + const { gen, schema: schema8 } = it2; + if (schema8 === false) { + gen.var(valid, false); + falseSchemaError(it2); + } else { + gen.var(valid, true); + } + } + exports28.boolOrEmptySchema = boolOrEmptySchema; + function falseSchemaError(it2, overrideAllErrors) { + const { gen, data } = it2; + const cxt = { + gen, + keyword: "false schema", + data, + schema: false, + schemaCode: false, + schemaValue: false, + params: {}, + it: it2 + }; + (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors); + } + } +}); + +// node_modules/ajv/dist/compile/rules.js +var require_rules = __commonJS({ + "node_modules/ajv/dist/compile/rules.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getRules = exports28.isJSONType = void 0; + var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; + var jsonTypes = new Set(_jsonTypes); + function isJSONType(x7) { + return typeof x7 == "string" && jsonTypes.has(x7); + } + exports28.isJSONType = isJSONType; + function getRules() { + const groups = { + number: { type: "number", rules: [] }, + string: { type: "string", rules: [] }, + array: { type: "array", rules: [] }, + object: { type: "object", rules: [] } + }; + return { + types: { ...groups, integer: true, boolean: true, null: true }, + rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], + post: { rules: [] }, + all: {}, + keywords: {} + }; + } + exports28.getRules = getRules; + } +}); + +// node_modules/ajv/dist/compile/validate/applicability.js +var require_applicability = __commonJS({ + "node_modules/ajv/dist/compile/validate/applicability.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.shouldUseRule = exports28.shouldUseGroup = exports28.schemaHasRulesForType = void 0; + function schemaHasRulesForType({ schema: schema8, self: self2 }, type3) { + const group2 = self2.RULES.types[type3]; + return group2 && group2 !== true && shouldUseGroup(schema8, group2); + } + exports28.schemaHasRulesForType = schemaHasRulesForType; + function shouldUseGroup(schema8, group2) { + return group2.rules.some((rule) => shouldUseRule(schema8, rule)); + } + exports28.shouldUseGroup = shouldUseGroup; + function shouldUseRule(schema8, rule) { + var _a2; + return schema8[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema8[kwd] !== void 0)); + } + exports28.shouldUseRule = shouldUseRule; + } +}); + +// node_modules/ajv/dist/compile/validate/dataType.js +var require_dataType = __commonJS({ + "node_modules/ajv/dist/compile/validate/dataType.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.reportTypeError = exports28.checkDataTypes = exports28.checkDataType = exports28.coerceAndCheckDataType = exports28.getJSONTypes = exports28.getSchemaTypes = exports28.DataType = void 0; + var rules_1 = require_rules(); + var applicability_1 = require_applicability(); + var errors_1 = require_errors(); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var DataType; + (function(DataType2) { + DataType2[DataType2["Correct"] = 0] = "Correct"; + DataType2[DataType2["Wrong"] = 1] = "Wrong"; + })(DataType || (exports28.DataType = DataType = {})); + function getSchemaTypes(schema8) { + const types3 = getJSONTypes(schema8.type); + const hasNull = types3.includes("null"); + if (hasNull) { + if (schema8.nullable === false) + throw new Error("type: null contradicts nullable: false"); + } else { + if (!types3.length && schema8.nullable !== void 0) { + throw new Error('"nullable" cannot be used without "type"'); + } + if (schema8.nullable === true) + types3.push("null"); + } + return types3; + } + exports28.getSchemaTypes = getSchemaTypes; + function getJSONTypes(ts) { + 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(",")); + } + exports28.getJSONTypes = getJSONTypes; + function coerceAndCheckDataType(it2, types3) { + const { gen, data, opts } = it2; + const coerceTo = coerceToTypes(types3, opts.coerceTypes); + const checkTypes = types3.length > 0 && !(coerceTo.length === 0 && types3.length === 1 && (0, applicability_1.schemaHasRulesForType)(it2, types3[0])); + if (checkTypes) { + const wrongType = checkDataTypes(types3, data, opts.strictNumbers, DataType.Wrong); + gen.if(wrongType, () => { + if (coerceTo.length) + coerceData(it2, types3, coerceTo); + else + reportTypeError(it2); + }); + } + return checkTypes; + } + exports28.coerceAndCheckDataType = coerceAndCheckDataType; + var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); + function coerceToTypes(types3, coerceTypes) { + return coerceTypes ? types3.filter((t8) => COERCIBLE.has(t8) || coerceTypes === "array" && t8 === "array") : []; + } + function coerceData(it2, types3, coerceTo) { + const { gen, data, opts } = it2; + 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(types3, data, opts.strictNumbers), () => gen.assign(coerced, data))); + } + gen.if((0, codegen_1._)`${coerced} !== undefined`); + for (const t8 of coerceTo) { + if (COERCIBLE.has(t8) || t8 === "array" && opts.coerceTypes === "array") { + coerceSpecificType(t8); + } + } + gen.else(); + reportTypeError(it2); + gen.endIf(); + gen.if((0, codegen_1._)`${coerced} !== undefined`, () => { + gen.assign(data, coerced); + assignParentData(it2, coerced); + }); + function coerceSpecificType(t8) { + switch (t8) { + case "string": + gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`); + return; + case "number": + gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null + || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`); + return; + case "integer": + gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null + || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`); + return; + case "boolean": + gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true); + return; + case "null": + gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`); + gen.assign(coerced, null); + return; + case "array": + gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number" + || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`); + } + } + } + function assignParentData({ gen, parentData, parentDataProperty }, expr) { + gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr)); + } + function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { + const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; + let cond2; + switch (dataType) { + case "null": + return (0, codegen_1._)`${data} ${EQ} null`; + case "array": + cond2 = (0, codegen_1._)`Array.isArray(${data})`; + break; + case "object": + cond2 = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; + break; + case "integer": + cond2 = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); + break; + case "number": + cond2 = numCond(); + break; + default: + return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; + } + 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); + } + } + exports28.checkDataType = checkDataType; + function checkDataTypes(dataTypes, data, strictNums, correct) { + if (dataTypes.length === 1) { + return checkDataType(dataTypes[0], data, strictNums, correct); + } + let cond2; + const types3 = (0, util_1.toHash)(dataTypes); + if (types3.array && types3.object) { + const notObj = (0, codegen_1._)`typeof ${data} != "object"`; + cond2 = types3.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; + delete types3.null; + delete types3.array; + delete types3.object; + } else { + cond2 = codegen_1.nil; + } + if (types3.number) + delete types3.integer; + for (const t8 in types3) + cond2 = (0, codegen_1.and)(cond2, checkDataType(t8, data, strictNums, correct)); + return cond2; + } + exports28.checkDataTypes = checkDataTypes; + var typeError = { + message: ({ schema: schema8 }) => `must be ${schema8}`, + params: ({ schema: schema8, schemaValue }) => typeof schema8 == "string" ? (0, codegen_1._)`{type: ${schema8}}` : (0, codegen_1._)`{type: ${schemaValue}}` + }; + function reportTypeError(it2) { + const cxt = getTypeErrorContext(it2); + (0, errors_1.reportError)(cxt, typeError); + } + exports28.reportTypeError = reportTypeError; + function getTypeErrorContext(it2) { + const { gen, data, schema: schema8 } = it2; + const schemaCode = (0, util_1.schemaRefOrVal)(it2, schema8, "type"); + return { + gen, + keyword: "type", + data, + schema: schema8.type, + schemaCode, + schemaValue: schemaCode, + parentSchema: schema8, + params: {}, + it: it2 + }; + } + } +}); + +// node_modules/ajv/dist/compile/validate/defaults.js +var require_defaults = __commonJS({ + "node_modules/ajv/dist/compile/validate/defaults.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.assignDefaults = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + function assignDefaults(it2, ty) { + const { properties, items } = it2.schema; + if (ty === "object" && properties) { + for (const key in properties) { + assignDefault(it2, key, properties[key].default); + } + } else if (ty === "array" && Array.isArray(items)) { + items.forEach((sch, i7) => assignDefault(it2, i7, sch.default)); + } + } + exports28.assignDefaults = assignDefaults; + function assignDefault(it2, prop, defaultValue) { + const { gen, compositeRule, data, opts } = it2; + if (defaultValue === void 0) + return; + const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`; + if (compositeRule) { + (0, util_1.checkStrictMode)(it2, `default is ignored for: ${childData}`); + return; + } + let condition = (0, codegen_1._)`${childData} === undefined`; + if (opts.useDefaults === "empty") { + condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`; + } + gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); + } + } +}); + +// node_modules/ajv/dist/vocabularies/code.js +var require_code2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/code.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateUnion = exports28.validateArray = exports28.usePattern = exports28.callValidateCode = exports28.schemaProperties = exports28.allSchemaProperties = exports28.noPropertyInData = exports28.propertyInData = exports28.isOwnProperty = exports28.hasPropFunc = exports28.reportMissingProp = exports28.checkMissingProp = exports28.checkReportMissingProp = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var names_1 = require_names(); + var util_2 = require_util(); + function checkReportMissingProp(cxt, prop) { + const { gen, data, it: it2 } = cxt; + gen.if(noPropertyInData(gen, data, prop, it2.opts.ownProperties), () => { + cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true); + cxt.error(); + }); + } + exports28.checkReportMissingProp = checkReportMissingProp; + function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { + return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`))); + } + exports28.checkMissingProp = checkMissingProp; + function reportMissingProp(cxt, missing) { + cxt.setParams({ missingProperty: missing }, true); + cxt.error(); + } + exports28.reportMissingProp = reportMissingProp; + function hasPropFunc(gen) { + return gen.scopeValue("func", { + // eslint-disable-next-line @typescript-eslint/unbound-method + ref: Object.prototype.hasOwnProperty, + code: (0, codegen_1._)`Object.prototype.hasOwnProperty` + }); + } + exports28.hasPropFunc = hasPropFunc; + function isOwnProperty(gen, data, property2) { + return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property2})`; + } + exports28.isOwnProperty = isOwnProperty; + 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; + } + exports28.propertyInData = propertyInData; + 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; + } + exports28.noPropertyInData = noPropertyInData; + function allSchemaProperties(schemaMap) { + return schemaMap ? Object.keys(schemaMap).filter((p7) => p7 !== "__proto__") : []; + } + exports28.allSchemaProperties = allSchemaProperties; + function schemaProperties(it2, schemaMap) { + return allSchemaProperties(schemaMap).filter((p7) => !(0, util_1.alwaysValidSchema)(it2, schemaMap[p7])); + } + exports28.schemaProperties = schemaProperties; + function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it: it2 }, func, context2, passSchema) { + const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; + const valCxt = [ + [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], + [names_1.default.parentData, it2.parentData], + [names_1.default.parentDataProperty, it2.parentDataProperty], + [names_1.default.rootData, names_1.default.rootData] + ]; + if (it2.opts.dynamicRef) + valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); + const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`; + return context2 !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context2}, ${args})` : (0, codegen_1._)`${func}(${args})`; + } + exports28.callValidateCode = callValidateCode; + var newRegExp = (0, codegen_1._)`new RegExp`; + function usePattern({ gen, it: { opts } }, pattern5) { + const u7 = opts.unicodeRegExp ? "u" : ""; + const { regExp } = opts.code; + const rx = regExp(pattern5, u7); + return gen.scopeValue("pattern", { + key: rx.toString(), + ref: rx, + code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern5}, ${u7})` + }); + } + exports28.usePattern = usePattern; + function validateArray(cxt) { + const { gen, data, keyword, it: it2 } = cxt; + const valid = gen.name("valid"); + if (it2.allErrors) { + const validArr = gen.let("valid", true); + validateItems(() => gen.assign(validArr, false)); + return validArr; + } + gen.var(valid, true); + validateItems(() => gen.break()); + return valid; + function validateItems(notValid) { + const len = gen.const("len", (0, codegen_1._)`${data}.length`); + gen.forRange("i", 0, len, (i7) => { + cxt.subschema({ + keyword, + dataProp: i7, + dataPropType: util_1.Type.Num + }, valid); + gen.if((0, codegen_1.not)(valid), notValid); + }); + } + } + exports28.validateArray = validateArray; + function validateUnion(cxt) { + const { gen, schema: schema8, keyword, it: it2 } = cxt; + if (!Array.isArray(schema8)) + throw new Error("ajv implementation error"); + const alwaysValid = schema8.some((sch) => (0, util_1.alwaysValidSchema)(it2, sch)); + if (alwaysValid && !it2.opts.unevaluated) + return; + const valid = gen.let("valid", false); + const schValid = gen.name("_valid"); + gen.block(() => schema8.forEach((_sch, i7) => { + const schCxt = cxt.subschema({ + keyword, + schemaProp: i7, + compositeRule: true + }, schValid); + gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); + const merged = cxt.mergeValidEvaluated(schCxt, schValid); + if (!merged) + gen.if((0, codegen_1.not)(valid)); + })); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + } + exports28.validateUnion = validateUnion; + } +}); + +// node_modules/ajv/dist/compile/validate/keyword.js +var require_keyword2 = __commonJS({ + "node_modules/ajv/dist/compile/validate/keyword.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateKeywordUsage = exports28.validSchemaType = exports28.funcKeywordCode = exports28.macroKeywordCode = void 0; + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var code_1 = require_code2(); + var errors_1 = require_errors(); + function macroKeywordCode(cxt, def) { + const { gen, keyword, schema: schema8, parentSchema, it: it2 } = cxt; + const macroSchema = def.macro.call(it2.self, schema8, parentSchema, it2); + const schemaRef = useKeyword(gen, keyword, macroSchema); + if (it2.opts.validateSchema !== false) + it2.self.validateSchema(macroSchema, true); + const valid = gen.name("valid"); + cxt.subschema({ + schema: macroSchema, + schemaPath: codegen_1.nil, + errSchemaPath: `${it2.errSchemaPath}/${keyword}`, + topSchemaRef: schemaRef, + compositeRule: true + }, valid); + cxt.pass(valid, () => cxt.error(true)); + } + exports28.macroKeywordCode = macroKeywordCode; + function funcKeywordCode(cxt, def) { + var _a2; + const { gen, keyword, schema: schema8, parentSchema, $data, it: it2 } = cxt; + checkAsyncKeyword(it2, def); + const validate15 = !$data && def.compile ? def.compile.call(it2.self, schema8, parentSchema, it2) : def.validate; + const validateRef = useKeyword(gen, keyword, validate15); + const valid = gen.let("valid"); + cxt.block$data(valid, validateKeyword); + cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid); + function validateKeyword() { + if (def.errors === false) { + assignValid(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => cxt.error()); + } else { + const ruleErrs = def.async ? validateAsync() : validateSync(); + if (def.modifying) + modifyData(cxt); + reportErrs(() => addErrs(cxt, ruleErrs)); + } + } + function validateAsync() { + const ruleErrs = gen.let("ruleErrs", null); + gen.try(() => assignValid((0, codegen_1._)`await `), (e10) => gen.assign(valid, false).if((0, codegen_1._)`${e10} instanceof ${it2.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e10}.errors`), () => gen.throw(e10))); + return ruleErrs; + } + function validateSync() { + const validateErrs = (0, codegen_1._)`${validateRef}.errors`; + gen.assign(validateErrs, null); + assignValid(codegen_1.nil); + return validateErrs; + } + function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { + const passCxt = it2.opts.passContext ? names_1.default.this : names_1.default.self; + const passSchema = !("compile" in def && !$data || def.schema === false); + gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); + } + function reportErrs(errors) { + var _a3; + gen.if((0, codegen_1.not)((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors); + } + } + exports28.funcKeywordCode = funcKeywordCode; + function modifyData(cxt) { + const { gen, data, it: it2 } = cxt; + gen.if(it2.parentData, () => gen.assign(data, (0, codegen_1._)`${it2.parentData}[${it2.parentDataProperty}]`)); + } + function addErrs(cxt, errs) { + const { gen } = cxt; + gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => { + gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); + (0, errors_1.extendErrors)(cxt); + }, () => cxt.error()); + } + function checkAsyncKeyword({ schemaEnv }, def) { + if (def.async && !schemaEnv.$async) + throw new Error("async keyword in sync schema"); + } + function useKeyword(gen, keyword, result2) { + if (result2 === void 0) + throw new Error(`keyword "${keyword}" failed to compile`); + return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1.stringify)(result2) }); + } + function validSchemaType(schema8, schemaType, allowUndefined = false) { + return !schemaType.length || schemaType.some((st2) => st2 === "array" ? Array.isArray(schema8) : st2 === "object" ? schema8 && typeof schema8 == "object" && !Array.isArray(schema8) : typeof schema8 == st2 || allowUndefined && typeof schema8 == "undefined"); + } + exports28.validSchemaType = validSchemaType; + function validateKeywordUsage({ schema: schema8, opts, self: self2, errSchemaPath }, def, keyword) { + if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { + throw new Error("ajv implementation error"); + } + const deps = def.dependencies; + if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema8, kwd))) { + throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); + } + if (def.validateSchema) { + const valid = def.validateSchema(schema8[keyword]); + if (!valid) { + const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def.validateSchema.errors); + if (opts.validateSchema === "log") + self2.logger.error(msg); + else + throw new Error(msg); + } + } + } + exports28.validateKeywordUsage = validateKeywordUsage; + } +}); + +// node_modules/ajv/dist/compile/validate/subschema.js +var require_subschema = __commonJS({ + "node_modules/ajv/dist/compile/validate/subschema.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.extendSubschemaMode = exports28.extendSubschemaData = exports28.getSubschema = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + function getSubschema(it2, { keyword, schemaProp, schema: schema8, schemaPath, errSchemaPath, topSchemaRef }) { + if (keyword !== void 0 && schema8 !== void 0) { + throw new Error('both "keyword" and "schema" passed, only one allowed'); + } + if (keyword !== void 0) { + const sch = it2.schema[keyword]; + return schemaProp === void 0 ? { + schema: sch, + schemaPath: (0, codegen_1._)`${it2.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, + errSchemaPath: `${it2.errSchemaPath}/${keyword}` + } : { + schema: sch[schemaProp], + schemaPath: (0, codegen_1._)`${it2.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, + errSchemaPath: `${it2.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}` + }; + } + if (schema8 !== void 0) { + if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) { + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + } + return { + schema: schema8, + schemaPath, + topSchemaRef, + errSchemaPath + }; + } + throw new Error('either "keyword" or "schema" must be passed'); + } + exports28.getSubschema = getSubschema; + function extendSubschemaData(subschema, it2, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { + if (data !== void 0 && dataProp !== void 0) { + throw new Error('both "data" and "dataProp" passed, only one allowed'); + } + const { gen } = it2; + if (dataProp !== void 0) { + const { errorPath, dataPathArr, opts } = it2; + const nextData = gen.let("data", (0, codegen_1._)`${it2.data}${(0, codegen_1.getProperty)(dataProp)}`, true); + dataContextProps(nextData); + subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; + subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`; + subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; + } + if (data !== void 0) { + const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); + dataContextProps(nextData); + if (propertyName !== void 0) + subschema.propertyName = propertyName; + } + if (dataTypes) + subschema.dataTypes = dataTypes; + function dataContextProps(_nextData) { + subschema.data = _nextData; + subschema.dataLevel = it2.dataLevel + 1; + subschema.dataTypes = []; + it2.definedProperties = /* @__PURE__ */ new Set(); + subschema.parentData = it2.data; + subschema.dataNames = [...it2.dataNames, _nextData]; + } + } + exports28.extendSubschemaData = extendSubschemaData; + function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { + if (compositeRule !== void 0) + subschema.compositeRule = compositeRule; + if (createErrors !== void 0) + subschema.createErrors = createErrors; + if (allErrors !== void 0) + subschema.allErrors = allErrors; + subschema.jtdDiscriminator = jtdDiscriminator; + subschema.jtdMetadata = jtdMetadata; + } + exports28.extendSubschemaMode = extendSubschemaMode; + } +}); + +// node_modules/fast-deep-equal/index.js +var require_fast_deep_equal = __commonJS({ + "node_modules/fast-deep-equal/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function equal2(a7, b8) { + if (a7 === b8) + return true; + if (a7 && b8 && typeof a7 == "object" && typeof b8 == "object") { + if (a7.constructor !== b8.constructor) + return false; + var length, i7, keys2; + if (Array.isArray(a7)) { + length = a7.length; + if (length != b8.length) + return false; + for (i7 = length; i7-- !== 0; ) + if (!equal2(a7[i7], b8[i7])) + return false; + return true; + } + if (a7.constructor === RegExp) + return a7.source === b8.source && a7.flags === b8.flags; + if (a7.valueOf !== Object.prototype.valueOf) + return a7.valueOf() === b8.valueOf(); + if (a7.toString !== Object.prototype.toString) + return a7.toString() === b8.toString(); + keys2 = Object.keys(a7); + length = keys2.length; + if (length !== Object.keys(b8).length) + return false; + for (i7 = length; i7-- !== 0; ) + if (!Object.prototype.hasOwnProperty.call(b8, keys2[i7])) + return false; + for (i7 = length; i7-- !== 0; ) { + var key = keys2[i7]; + if (!equal2(a7[key], b8[key])) + return false; + } + return true; + } + return a7 !== a7 && b8 !== b8; + }; + } +}); + +// node_modules/json-schema-traverse/index.js +var require_json_schema_traverse = __commonJS({ + "node_modules/json-schema-traverse/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var traverse4 = module5.exports = function(schema8, opts, cb) { + if (typeof opts == "function") { + cb = opts; + opts = {}; + } + cb = opts.cb || cb; + var pre = typeof cb == "function" ? cb : cb.pre || function() { + }; + var post = cb.post || function() { + }; + _traverse(opts, pre, post, schema8, "", schema8); + }; + traverse4.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true, + if: true, + then: true, + else: true + }; + traverse4.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true + }; + traverse4.propsKeywords = { + $defs: true, + definitions: true, + properties: true, + patternProperties: true, + dependencies: true + }; + traverse4.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true + }; + function _traverse(opts, pre, post, schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema8 && typeof schema8 == "object" && !Array.isArray(schema8)) { + pre(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema8) { + var sch = schema8[key]; + if (Array.isArray(sch)) { + if (key in traverse4.arrayKeywords) { + for (var i7 = 0; i7 < sch.length; i7++) + _traverse(opts, pre, post, sch[i7], jsonPtr + "/" + key + "/" + i7, rootSchema, jsonPtr, key, schema8, i7); + } + } else if (key in traverse4.propsKeywords) { + if (sch && typeof sch == "object") { + for (var prop in sch) + _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema8, prop); + } + } else if (key in traverse4.keywords || opts.allKeys && !(key in traverse4.skipKeywords)) { + _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema8); + } + } + post(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + } + } + function escapeJsonPtr(str2) { + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + } +}); + +// node_modules/ajv/dist/compile/resolve.js +var require_resolve = __commonJS({ + "node_modules/ajv/dist/compile/resolve.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getSchemaRefs = exports28.resolveUrl = exports28.normalizeId = exports28._getFullPath = exports28.getFullPath = exports28.inlineRef = void 0; + var util_1 = require_util(); + var equal2 = require_fast_deep_equal(); + var traverse4 = require_json_schema_traverse(); + var SIMPLE_INLINED = /* @__PURE__ */ new Set([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum", + "const" + ]); + function inlineRef(schema8, limit = true) { + if (typeof schema8 == "boolean") + return true; + if (limit === true) + return !hasRef(schema8); + if (!limit) + return false; + return countKeys(schema8) <= limit; + } + exports28.inlineRef = inlineRef; + var REF_KEYWORDS = /* @__PURE__ */ new Set([ + "$ref", + "$recursiveRef", + "$recursiveAnchor", + "$dynamicRef", + "$dynamicAnchor" + ]); + function hasRef(schema8) { + for (const key in schema8) { + if (REF_KEYWORDS.has(key)) + return true; + const sch = schema8[key]; + if (Array.isArray(sch) && sch.some(hasRef)) + return true; + if (typeof sch == "object" && hasRef(sch)) + return true; + } + return false; + } + function countKeys(schema8) { + let count2 = 0; + for (const key in schema8) { + if (key === "$ref") + return Infinity; + count2++; + if (SIMPLE_INLINED.has(key)) + continue; + if (typeof schema8[key] == "object") { + (0, util_1.eachItem)(schema8[key], (sch) => count2 += countKeys(sch)); + } + if (count2 === Infinity) + return Infinity; + } + return count2; + } + function getFullPath(resolver, id = "", normalize2) { + if (normalize2 !== false) + id = normalizeId(id); + const p7 = resolver.parse(id); + return _getFullPath(resolver, p7); + } + exports28.getFullPath = getFullPath; + function _getFullPath(resolver, p7) { + const serialized = resolver.serialize(p7); + return serialized.split("#")[0] + "#"; + } + exports28._getFullPath = _getFullPath; + var TRAILING_SLASH_HASH = /#\/?$/; + function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; + } + exports28.normalizeId = normalizeId; + function resolveUrl(resolver, baseId, id) { + id = normalizeId(id); + return resolver.resolve(baseId, id); + } + exports28.resolveUrl = resolveUrl; + var ANCHOR = /^[a-z_][-a-z0-9._]*$/i; + function getSchemaRefs(schema8, baseId) { + if (typeof schema8 == "boolean") + return {}; + const { schemaId, uriResolver } = this.opts; + const schId = normalizeId(schema8[schemaId] || baseId); + const baseIds = { "": schId }; + const pathPrefix = getFullPath(uriResolver, schId, false); + const localRefs = {}; + const schemaRefs = /* @__PURE__ */ new Set(); + traverse4(schema8, { allKeys: true }, (sch, jsonPtr, _6, parentJsonPtr) => { + if (parentJsonPtr === void 0) + return; + const fullPath = pathPrefix + jsonPtr; + let innerBaseId = baseIds[parentJsonPtr]; + if (typeof sch[schemaId] == "string") + innerBaseId = addRef.call(this, sch[schemaId]); + addAnchor.call(this, sch.$anchor); + addAnchor.call(this, sch.$dynamicAnchor); + baseIds[jsonPtr] = innerBaseId; + function addRef(ref) { + const _resolve = this.opts.uriResolver.resolve; + ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); + if (schemaRefs.has(ref)) + throw ambiguos(ref); + schemaRefs.add(ref); + let schOrRef = this.refs[ref]; + if (typeof schOrRef == "string") + schOrRef = this.refs[schOrRef]; + if (typeof schOrRef == "object") { + checkAmbiguosRef(sch, schOrRef.schema, ref); + } else if (ref !== normalizeId(fullPath)) { + if (ref[0] === "#") { + checkAmbiguosRef(sch, localRefs[ref], ref); + localRefs[ref] = sch; + } else { + this.refs[ref] = fullPath; + } + } + return ref; + } + function addAnchor(anchor) { + if (typeof anchor == "string") { + if (!ANCHOR.test(anchor)) + throw new Error(`invalid anchor "${anchor}"`); + addRef.call(this, `#${anchor}`); + } + } + }); + return localRefs; + function checkAmbiguosRef(sch1, sch2, ref) { + if (sch2 !== void 0 && !equal2(sch1, sch2)) + throw ambiguos(ref); + } + function ambiguos(ref) { + return new Error(`reference "${ref}" resolves to more than one schema`); + } + } + exports28.getSchemaRefs = getSchemaRefs; + } +}); + +// node_modules/ajv/dist/compile/validate/index.js +var require_validate = __commonJS({ + "node_modules/ajv/dist/compile/validate/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getData = exports28.KeywordCxt = exports28.validateFunctionCode = void 0; + var boolSchema_1 = require_boolSchema(); + var dataType_1 = require_dataType(); + var applicability_1 = require_applicability(); + var dataType_2 = require_dataType(); + var defaults_1 = require_defaults(); + var keyword_1 = require_keyword2(); + var subschema_1 = require_subschema(); + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var resolve_1 = require_resolve(); + var util_1 = require_util(); + var errors_1 = require_errors(); + function validateFunctionCode(it2) { + if (isSchemaObj(it2)) { + checkKeywords(it2); + if (schemaCxtHasRules(it2)) { + topSchemaObjCode(it2); + return; + } + } + validateFunction(it2, () => (0, boolSchema_1.topBoolOrEmptySchema)(it2)); + } + exports28.validateFunctionCode = validateFunctionCode; + function validateFunction({ gen, validateName, schema: schema8, schemaEnv, opts }, body) { + if (opts.code.es5) { + gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { + gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema8, opts)}`); + destructureValCxtES5(gen, opts); + gen.code(body); + }); + } else { + gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema8, opts)).code(body)); + } + } + function destructureValCxt(opts) { + return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; + } + function destructureValCxtES5(gen, opts) { + gen.if(names_1.default.valCxt, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`); + gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); + gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); + }, () => { + gen.var(names_1.default.instancePath, (0, codegen_1._)`""`); + gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`); + gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); + gen.var(names_1.default.rootData, names_1.default.data); + if (opts.dynamicRef) + gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); + }); + } + function topSchemaObjCode(it2) { + const { schema: schema8, opts, gen } = it2; + validateFunction(it2, () => { + if (opts.$comment && schema8.$comment) + commentKeyword(it2); + checkNoDefault(it2); + gen.let(names_1.default.vErrors, null); + gen.let(names_1.default.errors, 0); + if (opts.unevaluated) + resetEvaluated(it2); + typeAndKeywords(it2); + returnResults(it2); + }); + return; + } + function resetEvaluated(it2) { + const { gen, validateName } = it2; + it2.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`); + gen.if((0, codegen_1._)`${it2.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it2.evaluated}.props`, (0, codegen_1._)`undefined`)); + gen.if((0, codegen_1._)`${it2.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it2.evaluated}.items`, (0, codegen_1._)`undefined`)); + } + function funcSourceUrl(schema8, opts) { + const schId = typeof schema8 == "object" && schema8[opts.schemaId]; + return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; + } + function subschemaCode(it2, valid) { + if (isSchemaObj(it2)) { + checkKeywords(it2); + if (schemaCxtHasRules(it2)) { + subSchemaObjCode(it2, valid); + return; + } + } + (0, boolSchema_1.boolOrEmptySchema)(it2, valid); + } + function schemaCxtHasRules({ schema: schema8, self: self2 }) { + if (typeof schema8 == "boolean") + return !schema8; + for (const key in schema8) + if (self2.RULES.all[key]) + return true; + return false; + } + function isSchemaObj(it2) { + return typeof it2.schema != "boolean"; + } + function subSchemaObjCode(it2, valid) { + const { schema: schema8, gen, opts } = it2; + if (opts.$comment && schema8.$comment) + commentKeyword(it2); + updateContext(it2); + checkAsyncSchema(it2); + const errsCount = gen.const("_errs", names_1.default.errors); + typeAndKeywords(it2, errsCount); + gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); + } + function checkKeywords(it2) { + (0, util_1.checkUnknownRules)(it2); + checkRefsAndKeywords(it2); + } + function typeAndKeywords(it2, errsCount) { + if (it2.opts.jtd) + return schemaKeywords(it2, [], false, errsCount); + const types3 = (0, dataType_1.getSchemaTypes)(it2.schema); + const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it2, types3); + schemaKeywords(it2, types3, !checkedTypes, errsCount); + } + function checkRefsAndKeywords(it2) { + const { schema: schema8, errSchemaPath, opts, self: self2 } = it2; + if (schema8.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema8, self2.RULES)) { + self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); + } + } + function checkNoDefault(it2) { + const { schema: schema8, opts } = it2; + if (schema8.default !== void 0 && opts.useDefaults && opts.strictSchema) { + (0, util_1.checkStrictMode)(it2, "default is ignored in the schema root"); + } + } + function updateContext(it2) { + const schId = it2.schema[it2.opts.schemaId]; + if (schId) + it2.baseId = (0, resolve_1.resolveUrl)(it2.opts.uriResolver, it2.baseId, schId); + } + function checkAsyncSchema(it2) { + if (it2.schema.$async && !it2.schemaEnv.$async) + throw new Error("async schema in sync schema"); + } + function commentKeyword({ gen, schemaEnv, schema: schema8, errSchemaPath, opts }) { + const msg = schema8.$comment; + if (opts.$comment === true) { + gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`); + } else if (typeof opts.$comment == "function") { + const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`; + const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); + gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); + } + } + function returnResults(it2) { + const { gen, schemaEnv, validateName, ValidationError, opts } = it2; + if (schemaEnv.$async) { + gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`)); + } else { + gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors); + if (opts.unevaluated) + assignEvaluated(it2); + gen.return((0, codegen_1._)`${names_1.default.errors} === 0`); + } + } + function assignEvaluated({ gen, evaluated, props, items }) { + if (props instanceof codegen_1.Name) + gen.assign((0, codegen_1._)`${evaluated}.props`, props); + if (items instanceof codegen_1.Name) + gen.assign((0, codegen_1._)`${evaluated}.items`, items); + } + function schemaKeywords(it2, types3, typeErrors, errsCount) { + const { gen, schema: schema8, data, allErrors, opts, self: self2 } = it2; + const { RULES } = self2; + if (schema8.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema8, RULES))) { + gen.block(() => keywordCode(it2, "$ref", RULES.all.$ref.definition)); + return; + } + if (!opts.jtd) + checkStrictTypes(it2, types3); + gen.block(() => { + for (const group2 of RULES.rules) + groupKeywords(group2); + groupKeywords(RULES.post); + }); + function groupKeywords(group2) { + if (!(0, applicability_1.shouldUseGroup)(schema8, group2)) + return; + if (group2.type) { + gen.if((0, dataType_2.checkDataType)(group2.type, data, opts.strictNumbers)); + iterateKeywords(it2, group2); + if (types3.length === 1 && types3[0] === group2.type && typeErrors) { + gen.else(); + (0, dataType_2.reportTypeError)(it2); + } + gen.endIf(); + } else { + iterateKeywords(it2, group2); + } + if (!allErrors) + gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`); + } + } + function iterateKeywords(it2, group2) { + const { gen, schema: schema8, opts: { useDefaults } } = it2; + if (useDefaults) + (0, defaults_1.assignDefaults)(it2, group2.type); + gen.block(() => { + for (const rule of group2.rules) { + if ((0, applicability_1.shouldUseRule)(schema8, rule)) { + keywordCode(it2, rule.keyword, rule.definition, group2.type); + } + } + }); + } + function checkStrictTypes(it2, types3) { + if (it2.schemaEnv.meta || !it2.opts.strictTypes) + return; + checkContextTypes(it2, types3); + if (!it2.opts.allowUnionTypes) + checkMultipleTypes(it2, types3); + checkKeywordTypes(it2, it2.dataTypes); + } + function checkContextTypes(it2, types3) { + if (!types3.length) + return; + if (!it2.dataTypes.length) { + it2.dataTypes = types3; + return; + } + types3.forEach((t8) => { + if (!includesType(it2.dataTypes, t8)) { + strictTypesError(it2, `type "${t8}" not allowed by context "${it2.dataTypes.join(",")}"`); + } + }); + narrowSchemaTypes(it2, types3); + } + function checkMultipleTypes(it2, ts) { + if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { + strictTypesError(it2, "use allowUnionTypes to allow union type keyword"); + } + } + function checkKeywordTypes(it2, ts) { + const rules = it2.self.RULES.all; + for (const keyword in rules) { + const rule = rules[keyword]; + if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it2.schema, rule)) { + const { type: type3 } = rule.definition; + if (type3.length && !type3.some((t8) => hasApplicableType(ts, t8))) { + strictTypesError(it2, `missing type "${type3.join(",")}" for keyword "${keyword}"`); + } + } + } + } + function hasApplicableType(schTs, kwdT) { + return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); + } + function includesType(ts, t8) { + return ts.includes(t8) || t8 === "integer" && ts.includes("number"); + } + function narrowSchemaTypes(it2, withTypes) { + const ts = []; + for (const t8 of it2.dataTypes) { + if (includesType(withTypes, t8)) + ts.push(t8); + else if (withTypes.includes("integer") && t8 === "number") + ts.push("integer"); + } + it2.dataTypes = ts; + } + function strictTypesError(it2, msg) { + const schemaPath = it2.schemaEnv.baseId + it2.errSchemaPath; + msg += ` at "${schemaPath}" (strictTypes)`; + (0, util_1.checkStrictMode)(it2, msg, it2.opts.strictTypes); + } + var KeywordCxt = class { + constructor(it2, def, keyword) { + (0, keyword_1.validateKeywordUsage)(it2, def, keyword); + this.gen = it2.gen; + this.allErrors = it2.allErrors; + this.keyword = keyword; + this.data = it2.data; + this.schema = it2.schema[keyword]; + this.$data = def.$data && it2.opts.$data && this.schema && this.schema.$data; + this.schemaValue = (0, util_1.schemaRefOrVal)(it2, this.schema, keyword, this.$data); + this.schemaType = def.schemaType; + this.parentSchema = it2.schema; + this.params = {}; + this.it = it2; + this.def = def; + if (this.$data) { + this.schemaCode = it2.gen.const("vSchema", getData2(this.$data, it2)); + } else { + this.schemaCode = this.schemaValue; + if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { + throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); + } + } + if ("code" in def ? def.trackErrors : def.errors !== false) { + this.errsCount = it2.gen.const("_errs", names_1.default.errors); + } + } + result(condition, successAction, failAction) { + this.failResult((0, codegen_1.not)(condition), successAction, failAction); + } + failResult(condition, successAction, failAction) { + this.gen.if(condition); + if (failAction) + failAction(); + else + this.error(); + if (successAction) { + this.gen.else(); + successAction(); + if (this.allErrors) + this.gen.endIf(); + } else { + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + } + pass(condition, failAction) { + this.failResult((0, codegen_1.not)(condition), void 0, failAction); + } + fail(condition) { + if (condition === void 0) { + this.error(); + if (!this.allErrors) + this.gen.if(false); + return; + } + this.gen.if(condition); + this.error(); + if (this.allErrors) + this.gen.endIf(); + else + this.gen.else(); + } + fail$data(condition) { + if (!this.$data) + return this.fail(condition); + const { schemaCode } = this; + this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); + } + error(append, errorParams, errorPaths) { + if (errorParams) { + this.setParams(errorParams); + this._error(append, errorPaths); + this.setParams({}); + return; + } + this._error(append, errorPaths); + } + _error(append, errorPaths) { + ; + (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); + } + $dataError() { + (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); + } + reset() { + if (this.errsCount === void 0) + throw new Error('add "trackErrors" to keyword definition'); + (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); + } + ok(cond2) { + if (!this.allErrors) + this.gen.if(cond2); + } + setParams(obj, assign3) { + if (assign3) + Object.assign(this.params, obj); + else + this.params = obj; + } + block$data(valid, codeBlock, $dataValid = codegen_1.nil) { + this.gen.block(() => { + this.check$data(valid, $dataValid); + codeBlock(); + }); + } + check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { + if (!this.$data) + return; + const { gen, schemaCode, schemaType, def } = this; + gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid)); + if (valid !== codegen_1.nil) + gen.assign(valid, true); + if (schemaType.length || def.validateSchema) { + gen.elseIf(this.invalid$data()); + this.$dataError(); + if (valid !== codegen_1.nil) + gen.assign(valid, false); + } + gen.else(); + } + invalid$data() { + const { gen, schemaCode, schemaType, def, it: it2 } = this; + return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); + function wrong$DataType() { + if (schemaType.length) { + if (!(schemaCode instanceof codegen_1.Name)) + throw new Error("ajv implementation error"); + const st2 = Array.isArray(schemaType) ? schemaType : [schemaType]; + return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st2, schemaCode, it2.opts.strictNumbers, dataType_2.DataType.Wrong)}`; + } + return codegen_1.nil; + } + function invalid$DataSchema() { + if (def.validateSchema) { + const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); + return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`; + } + return codegen_1.nil; + } + } + subschema(appl, valid) { + const subschema = (0, subschema_1.getSubschema)(this.it, appl); + (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); + (0, subschema_1.extendSubschemaMode)(subschema, appl); + const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 }; + subschemaCode(nextContext, valid); + return nextContext; + } + mergeEvaluated(schemaCxt, toName) { + const { it: it2, gen } = this; + if (!it2.opts.unevaluated) + return; + if (it2.props !== true && schemaCxt.props !== void 0) { + it2.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it2.props, toName); + } + if (it2.items !== true && schemaCxt.items !== void 0) { + it2.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it2.items, toName); + } + } + mergeValidEvaluated(schemaCxt, valid) { + const { it: it2, gen } = this; + if (it2.opts.unevaluated && (it2.props !== true || it2.items !== true)) { + gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); + return true; + } + } + }; + exports28.KeywordCxt = KeywordCxt; + function keywordCode(it2, keyword, def, ruleType) { + const cxt = new KeywordCxt(it2, def, keyword); + if ("code" in def) { + def.code(cxt, ruleType); + } else if (cxt.$data && def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } else if ("macro" in def) { + (0, keyword_1.macroKeywordCode)(cxt, def); + } else if (def.compile || def.validate) { + (0, keyword_1.funcKeywordCode)(cxt, def); + } + } + var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; + var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; + function getData2($data, { dataLevel, dataNames, dataPathArr }) { + let jsonPointer; + let data; + if ($data === "") + return names_1.default.rootData; + if ($data[0] === "/") { + if (!JSON_POINTER.test($data)) + throw new Error(`Invalid JSON-pointer: ${$data}`); + jsonPointer = $data; + data = names_1.default.rootData; + } else { + const matches2 = RELATIVE_JSON_POINTER.exec($data); + if (!matches2) + throw new Error(`Invalid JSON-pointer: ${$data}`); + const up = +matches2[1]; + jsonPointer = matches2[2]; + if (jsonPointer === "#") { + if (up >= dataLevel) + throw new Error(errorMsg("property/index", up)); + return dataPathArr[dataLevel - up]; + } + if (up > dataLevel) + throw new Error(errorMsg("data", up)); + data = dataNames[dataLevel - up]; + if (!jsonPointer) + return data; + } + let expr = data; + const segments = jsonPointer.split("/"); + for (const segment of segments) { + if (segment) { + data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; + expr = (0, codegen_1._)`${expr} && ${data}`; + } + } + return expr; + function errorMsg(pointerType, up) { + return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; + } + } + exports28.getData = getData2; + } +}); + +// node_modules/ajv/dist/runtime/validation_error.js +var require_validation_error = __commonJS({ + "node_modules/ajv/dist/runtime/validation_error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ValidationError = class extends Error { + constructor(errors) { + super("validation failed"); + this.errors = errors; + this.ajv = this.validation = true; + } + }; + exports28.default = ValidationError; + } +}); + +// node_modules/ajv/dist/compile/ref_error.js +var require_ref_error = __commonJS({ + "node_modules/ajv/dist/compile/ref_error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var resolve_1 = require_resolve(); + var MissingRefError = class extends Error { + constructor(resolver, baseId, ref, msg) { + super(msg || `can't resolve reference ${ref} from id ${baseId}`); + this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); + this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); + } + }; + exports28.default = MissingRefError; + } +}); + +// node_modules/ajv/dist/compile/index.js +var require_compile = __commonJS({ + "node_modules/ajv/dist/compile/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.resolveSchema = exports28.getCompilingSchema = exports28.resolveRef = exports28.compileSchema = exports28.SchemaEnv = void 0; + var codegen_1 = require_codegen(); + var validation_error_1 = require_validation_error(); + var names_1 = require_names(); + var resolve_1 = require_resolve(); + var util_1 = require_util(); + var validate_1 = require_validate(); + var SchemaEnv = class { + constructor(env3) { + var _a2; + this.refs = {}; + this.dynamicAnchors = {}; + let schema8; + if (typeof env3.schema == "object") + schema8 = env3.schema; + this.schema = env3.schema; + this.schemaId = env3.schemaId; + this.root = env3.root || this; + this.baseId = (_a2 = env3.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema8 === null || schema8 === void 0 ? void 0 : schema8[env3.schemaId || "$id"]); + this.schemaPath = env3.schemaPath; + this.localRefs = env3.localRefs; + this.meta = env3.meta; + this.$async = schema8 === null || schema8 === void 0 ? void 0 : schema8.$async; + this.refs = {}; + } + }; + exports28.SchemaEnv = SchemaEnv; + function compileSchema(sch) { + const _sch = getCompilingSchema.call(this, sch); + if (_sch) + return _sch; + const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); + const { es5, lines } = this.opts.code; + const { ownProperties } = this.opts; + const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); + let _ValidationError; + if (sch.$async) { + _ValidationError = gen.scopeValue("Error", { + ref: validation_error_1.default, + code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` + }); + } + const validateName = gen.scopeName("validate"); + sch.validateName = validateName; + const schemaCxt = { + gen, + allErrors: this.opts.allErrors, + data: names_1.default.data, + parentData: names_1.default.parentData, + parentDataProperty: names_1.default.parentDataProperty, + dataNames: [names_1.default.data], + dataPathArr: [codegen_1.nil], + // TODO can its length be used as dataLevel if nil is removed? + dataLevel: 0, + dataTypes: [], + definedProperties: /* @__PURE__ */ new Set(), + topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), + validateName, + ValidationError: _ValidationError, + schema: sch.schema, + schemaEnv: sch, + rootId, + baseId: sch.baseId || rootId, + schemaPath: codegen_1.nil, + errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), + errorPath: (0, codegen_1._)`""`, + opts: this.opts, + self: this + }; + let sourceCode; + try { + this._compilations.add(sch); + (0, validate_1.validateFunctionCode)(schemaCxt); + gen.optimize(this.opts.code.optimize); + const validateCode = gen.toString(); + sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; + 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 validate15 = makeValidate(this, this.scope.get()); + this.scope.value(validateName, { ref: validate15 }); + validate15.errors = null; + validate15.schema = sch.schema; + validate15.schemaEnv = sch; + if (sch.$async) + validate15.$async = true; + if (this.opts.code.source === true) { + validate15.source = { validateName, validateCode, scopeValues: gen._values }; + } + if (this.opts.unevaluated) { + const { props, items } = schemaCxt; + validate15.evaluated = { + props: props instanceof codegen_1.Name ? void 0 : props, + items: items instanceof codegen_1.Name ? void 0 : items, + dynamicProps: props instanceof codegen_1.Name, + dynamicItems: items instanceof codegen_1.Name + }; + if (validate15.source) + validate15.source.evaluated = (0, codegen_1.stringify)(validate15.evaluated); + } + sch.validate = validate15; + return sch; + } catch (e10) { + delete sch.validate; + delete sch.validateName; + if (sourceCode) + this.logger.error("Error compiling schema, function code:", sourceCode); + throw e10; + } finally { + this._compilations.delete(sch); + } + } + exports28.compileSchema = compileSchema; + function resolveRef(root2, baseId, ref) { + var _a2; + ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); + const schOrFunc = root2.refs[ref]; + if (schOrFunc) + return schOrFunc; + let _sch = resolve3.call(this, root2, ref); + if (_sch === void 0) { + const schema8 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref]; + const { schemaId } = this.opts; + if (schema8) + _sch = new SchemaEnv({ schema: schema8, schemaId, root: root2, baseId }); + } + if (_sch === void 0) + return; + return root2.refs[ref] = inlineOrCompile.call(this, _sch); + } + exports28.resolveRef = resolveRef; + function inlineOrCompile(sch) { + if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) + return sch.schema; + return sch.validate ? sch : compileSchema.call(this, sch); + } + function getCompilingSchema(schEnv) { + for (const sch of this._compilations) { + if (sameSchemaEnv(sch, schEnv)) + return sch; + } + } + exports28.getCompilingSchema = getCompilingSchema; + function sameSchemaEnv(s1, s22) { + return s1.schema === s22.schema && s1.root === s22.root && s1.baseId === s22.baseId; + } + function resolve3(root2, ref) { + let sch; + while (typeof (sch = this.refs[ref]) == "string") + ref = sch; + return sch || this.schemas[ref] || resolveSchema.call(this, root2, ref); + } + function resolveSchema(root2, ref) { + const p7 = this.opts.uriResolver.parse(ref); + const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p7); + let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root2.baseId, void 0); + if (Object.keys(root2.schema).length > 0 && refPath === baseId) { + return getJsonPointer.call(this, p7, 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, root2, schOrRef); + if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") + return; + return getJsonPointer.call(this, p7, sch); + } + if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") + return; + if (!schOrRef.validate) + compileSchema.call(this, schOrRef); + if (id === (0, resolve_1.normalizeId)(ref)) { + const { schema: schema8 } = schOrRef; + const { schemaId } = this.opts; + const schId = schema8[schemaId]; + if (schId) + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + return new SchemaEnv({ schema: schema8, schemaId, root: root2, baseId }); + } + return getJsonPointer.call(this, p7, schOrRef); + } + exports28.resolveSchema = resolveSchema; + var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([ + "properties", + "patternProperties", + "enum", + "dependencies", + "definitions" + ]); + function getJsonPointer(parsedRef, { baseId, schema: schema8, root: root2 }) { + var _a2; + if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/") + return; + for (const part of parsedRef.fragment.slice(1).split("/")) { + if (typeof schema8 === "boolean") + return; + const partSchema = schema8[(0, util_1.unescapeFragment)(part)]; + if (partSchema === void 0) + return; + schema8 = partSchema; + const schId = typeof schema8 === "object" && schema8[this.opts.schemaId]; + if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { + baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); + } + } + let env3; + if (typeof schema8 != "boolean" && schema8.$ref && !(0, util_1.schemaHasRulesButRef)(schema8, this.RULES)) { + const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema8.$ref); + env3 = resolveSchema.call(this, root2, $ref); + } + const { schemaId } = this.opts; + env3 = env3 || new SchemaEnv({ schema: schema8, schemaId, root: root2, baseId }); + if (env3.schema !== env3.root.schema) + return env3; + return void 0; + } + } +}); + +// node_modules/ajv/dist/refs/data.json +var require_data = __commonJS({ + "node_modules/ajv/dist/refs/data.json"(exports28, module5) { + module5.exports = { + $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", + description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", + type: "object", + required: ["$data"], + properties: { + $data: { + type: "string", + anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] + } + }, + additionalProperties: false + }; + } +}); + +// node_modules/fast-uri/lib/scopedChars.js +var require_scopedChars = __commonJS({ + "node_modules/fast-uri/lib/scopedChars.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var HEX = { + 0: 0, + 1: 1, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 6: 6, + 7: 7, + 8: 8, + 9: 9, + a: 10, + A: 10, + b: 11, + B: 11, + c: 12, + C: 12, + d: 13, + D: 13, + e: 14, + E: 14, + f: 15, + F: 15 + }; + module5.exports = { + HEX + }; + } +}); + +// node_modules/fast-uri/lib/utils.js +var require_utils3 = __commonJS({ + "node_modules/fast-uri/lib/utils.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { HEX } = require_scopedChars(); + var IPV4_REG = /^(?:(?: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 normalizeIPv4(host) { + if (findToken(host, ".") < 3) { + return { host, isIPV4: false }; + } + const matches2 = host.match(IPV4_REG) || []; + const [address] = matches2; + if (address) { + return { host: stripLeadingZeros(address, "."), isIPV4: true }; + } else { + return { host, isIPV4: false }; + } + } + function stringArrayToHexStripped(input, keepZero = false) { + let acc = ""; + let strip = true; + for (const c7 of input) { + if (HEX[c7] === void 0) + return void 0; + if (c7 !== "0" && strip === true) + strip = false; + if (!strip) + acc += c7; + } + if (keepZero && acc.length === 0) + acc = "0"; + return acc; + } + function getIPV6(input) { + let tokenCount = 0; + const output = { error: false, address: "", zone: "" }; + const address = []; + const buffer2 = []; + let isZone = false; + let endipv6Encountered = false; + let endIpv6 = false; + function consume() { + if (buffer2.length) { + if (isZone === false) { + const hex = stringArrayToHexStripped(buffer2); + if (hex !== void 0) { + address.push(hex); + } else { + output.error = true; + return false; + } + } + buffer2.length = 0; + } + return true; + } + for (let i7 = 0; i7 < input.length; i7++) { + const cursor = input[i7]; + if (cursor === "[" || cursor === "]") { + continue; + } + if (cursor === ":") { + if (endipv6Encountered === true) { + endIpv6 = true; + } + if (!consume()) { + break; + } + tokenCount++; + address.push(":"); + if (tokenCount > 7) { + output.error = true; + break; + } + if (i7 - 1 >= 0 && input[i7 - 1] === ":") { + endipv6Encountered = true; + } + continue; + } else if (cursor === "%") { + if (!consume()) { + break; + } + isZone = true; + } else { + buffer2.push(cursor); + continue; + } + } + if (buffer2.length) { + if (isZone) { + output.zone = buffer2.join(""); + } else if (endIpv6) { + address.push(buffer2.join("")); + } else { + address.push(stringArrayToHexStripped(buffer2)); + } + } + output.address = address.join(""); + return output; + } + function normalizeIPv6(host) { + if (findToken(host, ":") < 2) { + return { host, isIPV6: false }; + } + const ipv6 = getIPV6(host); + if (!ipv6.error) { + let newHost = ipv6.address; + let escapedHost = ipv6.address; + if (ipv6.zone) { + newHost += "%" + ipv6.zone; + escapedHost += "%25" + ipv6.zone; + } + return { host: newHost, escapedHost, isIPV6: true }; + } else { + return { host, isIPV6: false }; + } + } + function stripLeadingZeros(str2, token) { + let out = ""; + let skip = true; + const l7 = str2.length; + for (let i7 = 0; i7 < l7; i7++) { + const c7 = str2[i7]; + if (c7 === "0" && skip) { + if (i7 + 1 <= l7 && str2[i7 + 1] === token || i7 + 1 === l7) { + out += c7; + skip = false; + } + } else { + if (c7 === token) { + skip = true; + } else { + skip = false; + } + out += c7; + } + } + return out; + } + function findToken(str2, token) { + let ind = 0; + for (let i7 = 0; i7 < str2.length; i7++) { + if (str2[i7] === token) + ind++; + } + return ind; + } + var RDS1 = /^\.\.?\//u; + var RDS2 = /^\/\.(?:\/|$)/u; + var RDS3 = /^\/\.\.(?:\/|$)/u; + var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u; + function removeDotSegments(input) { + const output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + const im = input.match(RDS5); + if (im) { + const s7 = im[0]; + input = input.slice(s7.length); + output.push(s7); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); + } + function normalizeComponentEncoding(components, esc) { + const func = esc !== true ? escape : unescape; + if (components.scheme !== void 0) { + components.scheme = func(components.scheme); + } + if (components.userinfo !== void 0) { + components.userinfo = func(components.userinfo); + } + if (components.host !== void 0) { + components.host = func(components.host); + } + if (components.path !== void 0) { + components.path = func(components.path); + } + if (components.query !== void 0) { + components.query = func(components.query); + } + if (components.fragment !== void 0) { + components.fragment = func(components.fragment); + } + return components; + } + function recomposeAuthority(components) { + const uriTokens = []; + if (components.userinfo !== void 0) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== void 0) { + let host = unescape(components.host); + const ipV4res = normalizeIPv4(host); + if (ipV4res.isIPV4) { + host = ipV4res.host; + } else { + const ipV6res = normalizeIPv6(ipV4res.host); + if (ipV6res.isIPV6 === true) { + host = `[${ipV6res.escapedHost}]`; + } else { + host = components.host; + } + } + uriTokens.push(host); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : void 0; + } + module5.exports = { + recomposeAuthority, + normalizeComponentEncoding, + removeDotSegments, + normalizeIPv4, + normalizeIPv6, + stringArrayToHexStripped + }; + } +}); + +// node_modules/fast-uri/lib/schemes.js +var require_schemes = __commonJS({ + "node_modules/fast-uri/lib/schemes.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var UUID_REG = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu; + var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; + function isSecure(wsComponents) { + return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; + } + function httpParse(components) { + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + } + function httpSerialize(components) { + const secure = String(components.scheme).toLowerCase() === "https"; + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = void 0; + } + if (!components.path) { + components.path = "/"; + } + return components; + } + function wsParse(wsComponents) { + wsComponents.secure = isSecure(wsComponents); + wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : ""); + wsComponents.path = void 0; + wsComponents.query = void 0; + return wsComponents; + } + function wsSerialize(wsComponents) { + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = void 0; + } + if (typeof wsComponents.secure === "boolean") { + wsComponents.scheme = wsComponents.secure ? "wss" : "ws"; + wsComponents.secure = void 0; + } + if (wsComponents.resourceName) { + const [path2, query] = wsComponents.resourceName.split("?"); + wsComponents.path = path2 && path2 !== "/" ? path2 : void 0; + wsComponents.query = query; + wsComponents.resourceName = void 0; + } + wsComponents.fragment = void 0; + return wsComponents; + } + function urnParse(urnComponents, options) { + if (!urnComponents.path) { + urnComponents.error = "URN can not be parsed"; + return urnComponents; + } + const matches2 = urnComponents.path.match(URN_REG); + if (matches2) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + urnComponents.nid = matches2[1].toLowerCase(); + urnComponents.nss = matches2[2]; + const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.path = void 0; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + } + function urnSerialize(urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid.toLowerCase(); + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + options.skipEscape = true; + return uriComponents; + } + function urnuuidParse(urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = void 0; + if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + } + function urnuuidSerialize(uuidComponents) { + const urnComponents = uuidComponents; + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } + var http = { + scheme: "http", + domainHost: true, + parse: httpParse, + serialize: httpSerialize + }; + var https = { + scheme: "https", + domainHost: http.domainHost, + parse: httpParse, + serialize: httpSerialize + }; + var ws = { + scheme: "ws", + domainHost: true, + parse: wsParse, + serialize: wsSerialize + }; + var wss = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize + }; + var urn = { + scheme: "urn", + parse: urnParse, + serialize: urnSerialize, + skipNormalize: true + }; + var urnuuid = { + scheme: "urn:uuid", + parse: urnuuidParse, + serialize: urnuuidSerialize, + skipNormalize: true + }; + var SCHEMES = { + http, + https, + ws, + wss, + urn, + "urn:uuid": urnuuid + }; + module5.exports = SCHEMES; + } +}); + +// node_modules/fast-uri/index.js +var require_fast_uri = __commonJS({ + "node_modules/fast-uri/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils3(); + var SCHEMES = require_schemes(); + function normalize2(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse17(uri, options), options); + } else if (typeof uri === "object") { + uri = parse17(serialize(uri, options), options); + } + return uri; + } + function resolve3(baseURI, relativeURI, options) { + const schemelessOptions = Object.assign({ scheme: "null" }, options); + const resolved = resolveComponents(parse17(baseURI, schemelessOptions), parse17(relativeURI, schemelessOptions), schemelessOptions, true); + return serialize(resolved, { ...schemelessOptions, skipEscape: true }); + } + function resolveComponents(base, relative2, options, skipNormalization) { + const target = {}; + if (!skipNormalization) { + base = parse17(serialize(base, options), options); + relative2 = parse17(serialize(relative2, options), options); + } + options = options || {}; + if (!options.tolerant && relative2.scheme) { + target.scheme = relative2.scheme; + target.userinfo = relative2.userinfo; + target.host = relative2.host; + target.port = relative2.port; + target.path = removeDotSegments(relative2.path || ""); + target.query = relative2.query; + } else { + if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) { + target.userinfo = relative2.userinfo; + target.host = relative2.host; + target.port = relative2.port; + target.path = removeDotSegments(relative2.path || ""); + target.query = relative2.query; + } else { + if (!relative2.path) { + target.path = base.path; + if (relative2.query !== void 0) { + target.query = relative2.query; + } else { + target.query = base.query; + } + } else { + if (relative2.path.charAt(0) === "/") { + target.path = removeDotSegments(relative2.path); + } else { + if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) { + target.path = "/" + relative2.path; + } else if (!base.path) { + target.path = relative2.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative2.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative2.query; + } + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative2.fragment; + return target; + } + function equal2(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = unescape(uriA); + uriA = serialize(normalizeComponentEncoding(parse17(uriA, options), true), { ...options, skipEscape: true }); + } else if (typeof uriA === "object") { + uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true }); + } + if (typeof uriB === "string") { + uriB = unescape(uriB); + uriB = serialize(normalizeComponentEncoding(parse17(uriB, options), true), { ...options, skipEscape: true }); + } else if (typeof uriB === "object") { + uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true }); + } + return uriA.toLowerCase() === uriB.toLowerCase(); + } + function serialize(cmpts, opts) { + const components = { + host: cmpts.host, + scheme: cmpts.scheme, + userinfo: cmpts.userinfo, + port: cmpts.port, + path: cmpts.path, + query: cmpts.query, + nid: cmpts.nid, + nss: cmpts.nss, + uuid: cmpts.uuid, + fragment: cmpts.fragment, + reference: cmpts.reference, + resourceName: cmpts.resourceName, + secure: cmpts.secure, + error: "" + }; + const options = Object.assign({}, opts); + const uriTokens = []; + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.path !== void 0) { + if (!options.skipEscape) { + components.path = escape(components.path); + if (components.scheme !== void 0) { + components.path = components.path.split("%3A").join(":"); + } + } else { + components.path = unescape(components.path); + } + } + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme, ":"); + } + const authority = recomposeAuthority(components); + if (authority !== void 0) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== void 0) { + let s7 = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s7 = removeDotSegments(s7); + } + if (authority === void 0) { + s7 = s7.replace(/^\/\//u, "/%2F"); + } + uriTokens.push(s7); + } + if (components.query !== void 0) { + uriTokens.push("?", components.query); + } + if (components.fragment !== void 0) { + uriTokens.push("#", components.fragment); + } + return uriTokens.join(""); + } + var hexLookUp = Array.from({ length: 127 }, (_v, k6) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k6))); + function nonSimpleDomain(value2) { + let code = 0; + for (let i7 = 0, len = value2.length; i7 < len; ++i7) { + code = value2.charCodeAt(i7); + if (code > 126 || hexLookUp[code]) { + return true; + } + } + return false; + } + var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; + function parse17(uri, opts) { + const options = Object.assign({}, opts); + const parsed = { + scheme: void 0, + userinfo: void 0, + host: "", + port: void 0, + path: "", + query: void 0, + fragment: void 0 + }; + const gotEncoding = uri.indexOf("%") !== -1; + let isIP = false; + if (options.reference === "suffix") + uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri; + 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 = matches2[5]; + } + if (parsed.host) { + const ipv4result = normalizeIPv4(parsed.host); + if (ipv4result.isIPV4 === false) { + const ipv6result = normalizeIPv6(ipv4result.host); + parsed.host = ipv6result.host.toLowerCase(); + isIP = ipv6result.isIPV6; + } else { + parsed.host = ipv4result.host; + isIP = true; + } + } + if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) { + parsed.reference = "same-document"; + } else if (parsed.scheme === void 0) { + parsed.reference = "relative"; + } else if (parsed.fragment === void 0) { + parsed.reference = "absolute"; + } else { + parsed.reference = "uri"; + } + if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) { + parsed.error = parsed.error || "URI is not a " + options.reference + " reference."; + } + const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()]; + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { + try { + parsed.host = URL.domainToASCII(parsed.host.toLowerCase()); + } catch (e10) { + parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e10; + } + } + } + if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { + if (gotEncoding && parsed.scheme !== void 0) { + parsed.scheme = unescape(parsed.scheme); + } + if (gotEncoding && parsed.host !== void 0) { + parsed.host = unescape(parsed.host); + } + if (parsed.path) { + parsed.path = escape(unescape(parsed.path)); + } + if (parsed.fragment) { + parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); + } + } + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(parsed, options); + } + } else { + parsed.error = parsed.error || "URI can not be parsed."; + } + return parsed; + } + var fastUri = { + SCHEMES, + normalize: normalize2, + resolve: resolve3, + resolveComponents, + equal: equal2, + serialize, + parse: parse17 + }; + module5.exports = fastUri; + module5.exports.default = fastUri; + module5.exports.fastUri = fastUri; + } +}); + +// node_modules/ajv/dist/runtime/uri.js +var require_uri = __commonJS({ + "node_modules/ajv/dist/runtime/uri.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var uri = require_fast_uri(); + uri.code = 'require("ajv/dist/runtime/uri").default'; + exports28.default = uri; + } +}); + +// node_modules/ajv/dist/core.js +var require_core = __commonJS({ + "node_modules/ajv/dist/core.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.CodeGen = exports28.Name = exports28.nil = exports28.stringify = exports28.str = exports28._ = exports28.KeywordCxt = void 0; + var validate_1 = require_validate(); + Object.defineProperty(exports28, "KeywordCxt", { enumerable: true, get: function() { + return validate_1.KeywordCxt; + } }); + var codegen_1 = require_codegen(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return codegen_1._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return codegen_1.str; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return codegen_1.stringify; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return codegen_1.nil; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return codegen_1.Name; + } }); + Object.defineProperty(exports28, "CodeGen", { enumerable: true, get: function() { + return codegen_1.CodeGen; + } }); + var validation_error_1 = require_validation_error(); + var ref_error_1 = require_ref_error(); + var rules_1 = require_rules(); + var compile_1 = require_compile(); + var codegen_2 = require_codegen(); + var resolve_1 = require_resolve(); + var dataType_1 = require_dataType(); + var util_1 = require_util(); + var $dataRefSchema = require_data(); + var uri_1 = require_uri(); + var defaultRegExp = (str2, flags) => new RegExp(str2, flags); + defaultRegExp.code = "new RegExp"; + var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; + var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([ + "validate", + "serialize", + "parse", + "wrapper", + "root", + "schema", + "keyword", + "pattern", + "formats", + "validate$data", + "func", + "obj", + "Error" + ]); + var removedOptions = { + errorDataPath: "", + format: "`validateFormats: false` can be used instead.", + nullable: '"nullable" keyword is supported by default.', + jsonPointers: "Deprecated jsPropertySyntax can be used instead.", + extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", + missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", + processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", + sourceCode: "Use option `code: {source: true}`", + strictDefaults: "It is default now, see option `strict`.", + strictKeywords: "It is default now, see option `strict`.", + uniqueItems: '"uniqueItems" keyword is always validated.', + unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", + cache: "Map is used as cache, schema object as key.", + serialize: "Map is used as cache, schema object as key.", + ajvErrors: "It is default now." + }; + var deprecatedOptions = { + ignoreKeywordsWithRef: "", + jsPropertySyntax: "", + unicode: '"minLength"/"maxLength" account for unicode characters by default.' + }; + var MAX_EXPRESSION = 200; + function requiredOptions(o7) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y, _z, _0; + const s7 = o7.strict; + const _optz = (_a2 = o7.code) === null || _a2 === void 0 ? void 0 : _a2.optimize; + const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0; + const regExp = (_c = (_b = o7.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; + const uriResolver = (_d = o7.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; + return { + strictSchema: (_f = (_e2 = o7.strictSchema) !== null && _e2 !== void 0 ? _e2 : s7) !== null && _f !== void 0 ? _f : true, + strictNumbers: (_h = (_g = o7.strictNumbers) !== null && _g !== void 0 ? _g : s7) !== null && _h !== void 0 ? _h : true, + strictTypes: (_k = (_j = o7.strictTypes) !== null && _j !== void 0 ? _j : s7) !== null && _k !== void 0 ? _k : "log", + strictTuples: (_m = (_l = o7.strictTuples) !== null && _l !== void 0 ? _l : s7) !== null && _m !== void 0 ? _m : "log", + strictRequired: (_p = (_o = o7.strictRequired) !== null && _o !== void 0 ? _o : s7) !== null && _p !== void 0 ? _p : false, + code: o7.code ? { ...o7.code, optimize, regExp } : { optimize, regExp }, + loopRequired: (_q = o7.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, + loopEnum: (_r = o7.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, + meta: (_s = o7.meta) !== null && _s !== void 0 ? _s : true, + messages: (_t2 = o7.messages) !== null && _t2 !== void 0 ? _t2 : true, + inlineRefs: (_u = o7.inlineRefs) !== null && _u !== void 0 ? _u : true, + schemaId: (_v = o7.schemaId) !== null && _v !== void 0 ? _v : "$id", + addUsedSchema: (_w = o7.addUsedSchema) !== null && _w !== void 0 ? _w : true, + validateSchema: (_x = o7.validateSchema) !== null && _x !== void 0 ? _x : true, + validateFormats: (_y = o7.validateFormats) !== null && _y !== void 0 ? _y : true, + unicodeRegExp: (_z = o7.unicodeRegExp) !== null && _z !== void 0 ? _z : true, + int32range: (_0 = o7.int32range) !== null && _0 !== void 0 ? _0 : true, + uriResolver + }; + } + var Ajv7 = class { + constructor(opts = {}) { + this.schemas = {}; + this.refs = {}; + this.formats = {}; + this._compilations = /* @__PURE__ */ new Set(); + this._loading = {}; + this._cache = /* @__PURE__ */ new Map(); + 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 = getLogger(opts.logger); + const formatOpt = opts.validateFormats; + opts.validateFormats = false; + this.RULES = (0, rules_1.getRules)(); + checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); + checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); + this._metaOpts = getMetaSchemaOptions.call(this); + if (opts.formats) + addInitialFormats.call(this); + this._addVocabularies(); + this._addDefaultMetaSchema(); + if (opts.keywords) + addInitialKeywords.call(this, opts.keywords); + if (typeof opts.meta == "object") + this.addMetaSchema(opts.meta); + addInitialSchemas.call(this); + opts.validateFormats = formatOpt; + } + _addVocabularies() { + this.addKeyword("$async"); + } + _addDefaultMetaSchema() { + const { $data, meta, schemaId } = this.opts; + let _dataRefSchema = $dataRefSchema; + if (schemaId === "id") { + _dataRefSchema = { ...$dataRefSchema }; + _dataRefSchema.id = _dataRefSchema.$id; + delete _dataRefSchema.$id; + } + if (meta && $data) + this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); + } + defaultMeta() { + const { meta, schemaId } = this.opts; + return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0; + } + validate(schemaKeyRef, data) { + let v8; + if (typeof schemaKeyRef == "string") { + v8 = this.getSchema(schemaKeyRef); + if (!v8) + throw new Error(`no schema with key or ref "${schemaKeyRef}"`); + } else { + v8 = this.compile(schemaKeyRef); + } + const valid = v8(data); + if (!("$async" in v8)) + this.errors = v8.errors; + return valid; + } + compile(schema8, _meta) { + const sch = this._addSchema(schema8, _meta); + return sch.validate || this._compileSchemaEnv(sch); + } + compileAsync(schema8, meta) { + if (typeof this.opts.loadSchema != "function") { + throw new Error("options.loadSchema should be a function"); + } + const { loadSchema } = this.opts; + return runCompileAsync.call(this, schema8, meta); + async function runCompileAsync(_schema, _meta) { + await loadMetaSchema.call(this, _schema.$schema); + const sch = this._addSchema(_schema, _meta); + return sch.validate || _compileAsync.call(this, sch); + } + async function loadMetaSchema($ref) { + if ($ref && !this.getSchema($ref)) { + await runCompileAsync.call(this, { $ref }, true); + } + } + async function _compileAsync(sch) { + try { + return this._compileSchemaEnv(sch); + } catch (e10) { + if (!(e10 instanceof ref_error_1.default)) + throw e10; + checkLoaded.call(this, e10); + await loadMissingSchema.call(this, e10.missingSchema); + return _compileAsync.call(this, sch); + } + } + function checkLoaded({ missingSchema: ref, missingRef }) { + if (this.refs[ref]) { + throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); + } + } + async function loadMissingSchema(ref) { + const _schema = await _loadSchema.call(this, ref); + if (!this.refs[ref]) + await loadMetaSchema.call(this, _schema.$schema); + if (!this.refs[ref]) + this.addSchema(_schema, ref, meta); + } + async function _loadSchema(ref) { + const p7 = this._loading[ref]; + if (p7) + return p7; + try { + return await (this._loading[ref] = loadSchema(ref)); + } finally { + delete this._loading[ref]; + } + } + } + // Adds schema to the instance + addSchema(schema8, key, _meta, _validateSchema = this.opts.validateSchema) { + if (Array.isArray(schema8)) { + for (const sch of schema8) + this.addSchema(sch, void 0, _meta, _validateSchema); + return this; + } + let id; + if (typeof schema8 === "object") { + const { schemaId } = this.opts; + id = schema8[schemaId]; + if (id !== void 0 && typeof id != "string") { + throw new Error(`schema ${schemaId} must be string`); + } + } + key = (0, resolve_1.normalizeId)(key || id); + this._checkUnique(key); + this.schemas[key] = this._addSchema(schema8, _meta, key, _validateSchema, true); + return this; + } + // Add schema that will be used to validate other schemas + // options in META_IGNORE_OPTIONS are alway set to false + addMetaSchema(schema8, key, _validateSchema = this.opts.validateSchema) { + this.addSchema(schema8, key, true, _validateSchema); + return this; + } + // Validate schema against its meta-schema + validateSchema(schema8, throwOrLogError) { + if (typeof schema8 == "boolean") + return true; + let $schema; + $schema = schema8.$schema; + if ($schema !== void 0 && typeof $schema != "string") { + throw new Error("$schema must be a string"); + } + $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); + if (!$schema) { + this.logger.warn("meta-schema not available"); + this.errors = null; + return true; + } + const valid = this.validate($schema, schema8); + if (!valid && throwOrLogError) { + const message = "schema is invalid: " + this.errorsText(); + if (this.opts.validateSchema === "log") + this.logger.error(message); + else + throw new Error(message); + } + return valid; + } + // Get compiled schema by `key` or `ref`. + // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) + getSchema(keyRef) { + let sch; + while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") + keyRef = sch; + if (sch === void 0) { + const { schemaId } = this.opts; + const root2 = new compile_1.SchemaEnv({ schema: {}, schemaId }); + sch = compile_1.resolveSchema.call(this, root2, keyRef); + if (!sch) + return; + this.refs[keyRef] = sch; + } + return sch.validate || this._compileSchemaEnv(sch); + } + // Remove cached schema(s). + // If no parameter is passed all schemas but meta-schemas are removed. + // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + removeSchema(schemaKeyRef) { + if (schemaKeyRef instanceof RegExp) { + this._removeAllSchemas(this.schemas, schemaKeyRef); + this._removeAllSchemas(this.refs, schemaKeyRef); + return this; + } + switch (typeof schemaKeyRef) { + case "undefined": + this._removeAllSchemas(this.schemas); + this._removeAllSchemas(this.refs); + this._cache.clear(); + return this; + case "string": { + const sch = getSchEnv.call(this, schemaKeyRef); + if (typeof sch == "object") + this._cache.delete(sch.schema); + delete this.schemas[schemaKeyRef]; + delete this.refs[schemaKeyRef]; + return this; + } + case "object": { + const cacheKey = schemaKeyRef; + this._cache.delete(cacheKey); + let id = schemaKeyRef[this.opts.schemaId]; + if (id) { + id = (0, resolve_1.normalizeId)(id); + delete this.schemas[id]; + delete this.refs[id]; + } + return this; + } + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } + // add "vocabulary" - a collection of keywords + addVocabulary(definitions) { + for (const def of definitions) + this.addKeyword(def); + return this; + } + addKeyword(kwdOrDef, def) { + let keyword; + if (typeof kwdOrDef == "string") { + keyword = kwdOrDef; + if (typeof def == "object") { + this.logger.warn("these parameters are deprecated, see docs for addKeyword"); + def.keyword = keyword; + } + } else if (typeof kwdOrDef == "object" && def === void 0) { + def = kwdOrDef; + keyword = def.keyword; + if (Array.isArray(keyword) && !keyword.length) { + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + } else { + throw new Error("invalid addKeywords parameters"); + } + checkKeyword.call(this, keyword, def); + if (!def) { + (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); + return this; + } + keywordMetaschema.call(this, def); + const definition = { + ...def, + type: (0, dataType_1.getJSONTypes)(def.type), + schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) + }; + (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k6) => addRule.call(this, k6, definition) : (k6) => definition.type.forEach((t8) => addRule.call(this, k6, definition, t8))); + return this; + } + getKeyword(keyword) { + const rule = this.RULES.all[keyword]; + return typeof rule == "object" ? rule.definition : !!rule; + } + // Remove keyword + removeKeyword(keyword) { + const { RULES } = this; + delete RULES.keywords[keyword]; + delete RULES.all[keyword]; + for (const group2 of RULES.rules) { + const i7 = group2.rules.findIndex((rule) => rule.keyword === keyword); + if (i7 >= 0) + group2.rules.splice(i7, 1); + } + return this; + } + // Add format + addFormat(name2, format5) { + if (typeof format5 == "string") + format5 = new RegExp(format5); + this.formats[name2] = format5; + return this; + } + errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) { + if (!errors || errors.length === 0) + return "No errors"; + return errors.map((e10) => `${dataVar}${e10.instancePath} ${e10.message}`).reduce((text, msg) => text + separator + msg); + } + $dataMetaSchema(metaSchema, keywordsJsonPointers) { + const rules = this.RULES.all; + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + for (const jsonPointer of keywordsJsonPointers) { + const segments = jsonPointer.split("/").slice(1); + let keywords = metaSchema; + for (const seg of segments) + keywords = keywords[seg]; + for (const key in rules) { + const rule = rules[key]; + if (typeof rule != "object") + continue; + const { $data } = rule.definition; + const schema8 = keywords[key]; + if ($data && schema8) + keywords[key] = schemaOrData(schema8); + } + } + return metaSchema; + } + _removeAllSchemas(schemas5, regex) { + for (const keyRef in schemas5) { + const sch = schemas5[keyRef]; + if (!regex || regex.test(keyRef)) { + if (typeof sch == "string") { + delete schemas5[keyRef]; + } else if (sch && !sch.meta) { + this._cache.delete(sch.schema); + delete schemas5[keyRef]; + } + } + } + } + _addSchema(schema8, meta, baseId, validateSchema4 = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { + let id; + const { schemaId } = this.opts; + if (typeof schema8 == "object") { + id = schema8[schemaId]; + } else { + if (this.opts.jtd) + throw new Error("schema must be object"); + else if (typeof schema8 != "boolean") + throw new Error("schema must be object or boolean"); + } + let sch = this._cache.get(schema8); + if (sch !== void 0) + return sch; + baseId = (0, resolve_1.normalizeId)(id || baseId); + const localRefs = resolve_1.getSchemaRefs.call(this, schema8, baseId); + sch = new compile_1.SchemaEnv({ schema: schema8, schemaId, meta, baseId, localRefs }); + this._cache.set(sch.schema, sch); + if (addSchema && !baseId.startsWith("#")) { + if (baseId) + this._checkUnique(baseId); + this.refs[baseId] = sch; + } + if (validateSchema4) + this.validateSchema(schema8, true); + return sch; + } + _checkUnique(id) { + if (this.schemas[id] || this.refs[id]) { + throw new Error(`schema with key or id "${id}" already exists`); + } + } + _compileSchemaEnv(sch) { + if (sch.meta) + this._compileMetaSchema(sch); + else + compile_1.compileSchema.call(this, sch); + if (!sch.validate) + throw new Error("ajv implementation error"); + return sch.validate; + } + _compileMetaSchema(sch) { + const currentOpts = this.opts; + this.opts = this._metaOpts; + try { + compile_1.compileSchema.call(this, sch); + } finally { + this.opts = currentOpts; + } + } + }; + Ajv7.ValidationError = validation_error_1.default; + Ajv7.MissingRefError = ref_error_1.default; + exports28.default = Ajv7; + function checkOptions(checkOpts, options, msg, log3 = "error") { + for (const key in checkOpts) { + const opt = key; + if (opt in options) + this.logger[log3](`${msg}: option ${key}. ${checkOpts[opt]}`); + } + } + function getSchEnv(keyRef) { + keyRef = (0, resolve_1.normalizeId)(keyRef); + return this.schemas[keyRef] || this.refs[keyRef]; + } + function addInitialSchemas() { + const optsSchemas = this.opts.schemas; + if (!optsSchemas) + return; + if (Array.isArray(optsSchemas)) + this.addSchema(optsSchemas); + else + for (const key in optsSchemas) + this.addSchema(optsSchemas[key], key); + } + function addInitialFormats() { + for (const name2 in this.opts.formats) { + const format5 = this.opts.formats[name2]; + if (format5) + this.addFormat(name2, format5); + } + } + function addInitialKeywords(defs) { + if (Array.isArray(defs)) { + this.addVocabulary(defs); + return; + } + this.logger.warn("keywords option as map is deprecated, pass array"); + for (const keyword in defs) { + const def = defs[keyword]; + if (!def.keyword) + def.keyword = keyword; + this.addKeyword(def); + } + } + function getMetaSchemaOptions() { + const metaOpts = { ...this.opts }; + for (const opt of META_IGNORE_OPTIONS) + delete metaOpts[opt]; + return metaOpts; + } + var noLogs = { log() { + }, warn() { + }, error() { + } }; + function getLogger(logger) { + if (logger === false) + return noLogs; + if (logger === void 0) + return console; + if (logger.log && logger.warn && logger.error) + return logger; + throw new Error("logger must implement log, warn and error methods"); + } + var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; + function checkKeyword(keyword, def) { + const { RULES } = this; + (0, util_1.eachItem)(keyword, (kwd) => { + if (RULES.keywords[kwd]) + throw new Error(`Keyword ${kwd} is already defined`); + if (!KEYWORD_NAME.test(kwd)) + throw new Error(`Keyword ${kwd} has invalid name`); + }); + if (!def) + return; + if (def.$data && !("code" in def || "validate" in def)) { + throw new Error('$data keyword must have "code" or "validate" function'); + } + } + function addRule(keyword, definition, dataType) { + var _a2; + const post = definition === null || definition === void 0 ? void 0 : definition.post; + if (dataType && post) + throw new Error('keyword with "post" flag cannot have "type"'); + const { RULES } = this; + let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t8 }) => t8 === dataType); + if (!ruleGroup) { + ruleGroup = { type: dataType, rules: [] }; + RULES.rules.push(ruleGroup); + } + RULES.keywords[keyword] = true; + if (!definition) + return; + const rule = { + keyword, + definition: { + ...definition, + type: (0, dataType_1.getJSONTypes)(definition.type), + schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) + } + }; + if (definition.before) + addBeforeRule.call(this, ruleGroup, rule, definition.before); + else + ruleGroup.rules.push(rule); + RULES.all[keyword] = rule; + (_a2 = definition.implements) === null || _a2 === void 0 ? void 0 : _a2.forEach((kwd) => this.addKeyword(kwd)); + } + function addBeforeRule(ruleGroup, rule, before2) { + const i7 = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before2); + if (i7 >= 0) { + ruleGroup.rules.splice(i7, 0, rule); + } else { + ruleGroup.rules.push(rule); + this.logger.warn(`rule ${before2} is not defined`); + } + } + function keywordMetaschema(def) { + let { metaSchema } = def; + if (metaSchema === void 0) + return; + if (def.$data && this.opts.$data) + metaSchema = schemaOrData(metaSchema); + def.validateSchema = this.compile(metaSchema, true); + } + var $dataRef = { + $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" + }; + function schemaOrData(schema8) { + return { anyOf: [schema8, $dataRef] }; + } + } +}); + +// node_modules/ajv/dist/vocabularies/core/id.js +var require_id = __commonJS({ + "node_modules/ajv/dist/vocabularies/core/id.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var def = { + keyword: "id", + code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/core/ref.js +var require_ref = __commonJS({ + "node_modules/ajv/dist/vocabularies/core/ref.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.callRef = exports28.getValidate = void 0; + var ref_error_1 = require_ref_error(); + var code_1 = require_code2(); + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var compile_1 = require_compile(); + var util_1 = require_util(); + var def = { + keyword: "$ref", + schemaType: "string", + code(cxt) { + const { gen, schema: $ref, it: it2 } = cxt; + const { baseId, schemaEnv: env3, validateName, opts, self: self2 } = it2; + const { root: root2 } = env3; + if (($ref === "#" || $ref === "#/") && baseId === root2.baseId) + return callRootRef(); + const schOrEnv = compile_1.resolveRef.call(self2, root2, baseId, $ref); + if (schOrEnv === void 0) + throw new ref_error_1.default(it2.opts.uriResolver, baseId, $ref); + if (schOrEnv instanceof compile_1.SchemaEnv) + return callValidate(schOrEnv); + return inlineRefSchema(schOrEnv); + function callRootRef() { + if (env3 === root2) + return callRef(cxt, validateName, env3, env3.$async); + const rootName = gen.scopeValue("root", { ref: root2 }); + return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root2, root2.$async); + } + function callValidate(sch) { + const v8 = getValidate(cxt, sch); + callRef(cxt, v8, sch, sch.$async); + } + function inlineRefSchema(sch) { + const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); + const valid = gen.name("valid"); + const schCxt = cxt.subschema({ + schema: sch, + dataTypes: [], + schemaPath: codegen_1.nil, + topSchemaRef: schName, + errSchemaPath: $ref + }, valid); + cxt.mergeEvaluated(schCxt); + cxt.ok(valid); + } + } + }; + function getValidate(cxt, sch) { + const { gen } = cxt; + return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`; + } + exports28.getValidate = getValidate; + function callRef(cxt, v8, sch, $async) { + const { gen, it: it2 } = cxt; + const { allErrors, schemaEnv: env3, opts } = it2; + const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; + if ($async) + callAsyncRef(); + else + callSyncRef(); + function callAsyncRef() { + if (!env3.$async) + throw new Error("async schema referenced by sync schema"); + const valid = gen.let("valid"); + gen.try(() => { + gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v8, passCxt)}`); + addEvaluatedFrom(v8); + if (!allErrors) + gen.assign(valid, true); + }, (e10) => { + gen.if((0, codegen_1._)`!(${e10} instanceof ${it2.ValidationError})`, () => gen.throw(e10)); + addErrorsFrom(e10); + if (!allErrors) + gen.assign(valid, false); + }); + cxt.ok(valid); + } + function callSyncRef() { + cxt.result((0, code_1.callValidateCode)(cxt, v8, passCxt), () => addEvaluatedFrom(v8), () => addErrorsFrom(v8)); + } + function addErrorsFrom(source) { + const errs = (0, codegen_1._)`${source}.errors`; + gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); + gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); + } + function addEvaluatedFrom(source) { + var _a2; + if (!it2.opts.unevaluated) + return; + const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated; + if (it2.props !== true) { + if (schEvaluated && !schEvaluated.dynamicProps) { + if (schEvaluated.props !== void 0) { + it2.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it2.props); + } + } else { + const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`); + it2.props = util_1.mergeEvaluated.props(gen, props, it2.props, codegen_1.Name); + } + } + if (it2.items !== true) { + if (schEvaluated && !schEvaluated.dynamicItems) { + if (schEvaluated.items !== void 0) { + it2.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it2.items); + } + } else { + const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`); + it2.items = util_1.mergeEvaluated.items(gen, items, it2.items, codegen_1.Name); + } + } + } + } + exports28.callRef = callRef; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/core/index.js +var require_core2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/core/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var id_1 = require_id(); + var ref_1 = require_ref(); + var core2 = [ + "$schema", + "$id", + "$defs", + "$vocabulary", + { keyword: "$comment" }, + "definitions", + id_1.default, + ref_1.default + ]; + exports28.default = core2; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/limitNumber.js +var require_limitNumber = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var ops = codegen_1.operators; + var KWDs = { + maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, + exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } + }; + var error2 = { + 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}}` + }; + var def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/multipleOf.js +var require_multipleOf = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var error2 = { + message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, + params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` + }; + var def = { + keyword: "multipleOf", + type: "number", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { gen, data, schemaCode, it: it2 } = cxt; + const prec = it2.opts.multipleOfPrecision; + const res = gen.let("res"); + const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`; + cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/runtime/ucs2length.js +var require_ucs2length = __commonJS({ + "node_modules/ajv/dist/runtime/ucs2length.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function ucs2length(str2) { + const len = str2.length; + let length = 0; + let pos = 0; + let value2; + while (pos < len) { + length++; + value2 = str2.charCodeAt(pos++); + if (value2 >= 55296 && value2 <= 56319 && pos < len) { + value2 = str2.charCodeAt(pos); + if ((value2 & 64512) === 56320) + pos++; + } + } + return length; + } + exports28.default = ucs2length; + ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/limitLength.js +var require_limitLength = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var ucs2length_1 = require_ucs2length(); + var error2 = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxLength" ? "more" : "fewer"; + return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; + }, + params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` + }; + var def = { + keyword: ["maxLength", "minLength"], + type: "string", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { keyword, data, schemaCode, it: it2 } = cxt; + const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; + const len = it2.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; + cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/pattern.js +var require_pattern2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var code_1 = require_code2(); + var codegen_1 = require_codegen(); + var error2 = { + message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` + }; + var def = { + keyword: "pattern", + type: "string", + schemaType: "string", + $data: true, + error: error2, + code(cxt) { + const { data, $data, schema: schema8, schemaCode, it: it2 } = cxt; + const u7 = it2.opts.unicodeRegExp ? "u" : ""; + const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u7}))` : (0, code_1.usePattern)(cxt, schema8); + cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/limitProperties.js +var require_limitProperties = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var error2 = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxProperties" ? "more" : "fewer"; + return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; + }, + params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` + }; + var def = { + keyword: ["maxProperties", "minProperties"], + type: "object", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/required.js +var require_required2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/required.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var code_1 = require_code2(); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, + params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` + }; + var def = { + keyword: "required", + type: "object", + schemaType: "array", + $data: true, + error: error2, + code(cxt) { + const { gen, schema: schema8, schemaCode, data, $data, it: it2 } = cxt; + const { opts } = it2; + if (!$data && schema8.length === 0) + return; + const useLoop = schema8.length >= opts.loopRequired; + if (it2.allErrors) + allErrorsMode(); + else + exitOnErrorMode(); + if (opts.strictRequired) { + const props = cxt.parentSchema.properties; + const { definedProperties } = cxt.it; + for (const requiredKey of schema8) { + if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) { + const schemaPath = it2.schemaEnv.baseId + it2.errSchemaPath; + const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; + (0, util_1.checkStrictMode)(it2, msg, it2.opts.strictRequired); + } + } + } + function allErrorsMode() { + if (useLoop || $data) { + cxt.block$data(codegen_1.nil, loopAllRequired); + } else { + for (const prop of schema8) { + (0, code_1.checkReportMissingProp)(cxt, prop); + } + } + } + function exitOnErrorMode() { + const missing = gen.let("missing"); + if (useLoop || $data) { + const valid = gen.let("valid", true); + cxt.block$data(valid, () => loopUntilMissing(missing, valid)); + cxt.ok(valid); + } else { + gen.if((0, code_1.checkMissingProp)(cxt, schema8, missing)); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } + function loopAllRequired() { + gen.forOf("prop", schemaCode, (prop) => { + cxt.setParams({ missingProperty: prop }); + gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); + }); + } + function loopUntilMissing(missing, valid) { + cxt.setParams({ missingProperty: missing }); + gen.forOf(missing, schemaCode, () => { + gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(); + gen.break(); + }); + }, codegen_1.nil); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/limitItems.js +var require_limitItems = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var error2 = { + message({ keyword, schemaCode }) { + const comp = keyword === "maxItems" ? "more" : "fewer"; + return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; + }, + params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` + }; + var def = { + keyword: ["maxItems", "minItems"], + type: "array", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { keyword, data, schemaCode } = cxt; + const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; + cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/runtime/equal.js +var require_equal = __commonJS({ + "node_modules/ajv/dist/runtime/equal.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var equal2 = require_fast_deep_equal(); + equal2.code = 'require("ajv/dist/runtime/equal").default'; + exports28.default = equal2; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +var require_uniqueItems = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dataType_1 = require_dataType(); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var equal_1 = require_equal(); + var error2 = { + message: ({ params: { i: i7, j: j6 } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j6} and ${i7} are identical)`, + params: ({ params: { i: i7, j: j6 } }) => (0, codegen_1._)`{i: ${i7}, j: ${j6}}` + }; + var def = { + keyword: "uniqueItems", + type: "array", + schemaType: "boolean", + $data: true, + error: error2, + code(cxt) { + const { gen, data, $data, schema: schema8, parentSchema, schemaCode, it: it2 } = cxt; + if (!$data && !schema8) + return; + const valid = gen.let("valid"); + const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; + cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); + cxt.ok(valid); + function validateUniqueItems() { + const i7 = gen.let("i", (0, codegen_1._)`${data}.length`); + const j6 = gen.let("j"); + cxt.setParams({ i: i7, j: j6 }); + gen.assign(valid, true); + gen.if((0, codegen_1._)`${i7} > 1`, () => (canOptimize() ? loopN : loopN2)(i7, j6)); + } + function canOptimize() { + return itemTypes.length > 0 && !itemTypes.some((t8) => t8 === "object" || t8 === "array"); + } + function loopN(i7, j6) { + const item = gen.name("item"); + const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it2.opts.strictNumbers, dataType_1.DataType.Wrong); + const indices = gen.const("indices", (0, codegen_1._)`{}`); + gen.for((0, codegen_1._)`;${i7}--;`, () => { + gen.let(item, (0, codegen_1._)`${data}[${i7}]`); + gen.if(wrongType, (0, codegen_1._)`continue`); + if (itemTypes.length > 1) + gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); + gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => { + gen.assign(j6, (0, codegen_1._)`${indices}[${item}]`); + cxt.error(); + gen.assign(valid, false).break(); + }).code((0, codegen_1._)`${indices}[${item}] = ${i7}`); + }); + } + function loopN2(i7, j6) { + const eql = (0, util_1.useFunc)(gen, equal_1.default); + const outer = gen.name("outer"); + gen.label(outer).for((0, codegen_1._)`;${i7}--;`, () => gen.for((0, codegen_1._)`${j6} = ${i7}; ${j6}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i7}], ${data}[${j6}])`, () => { + cxt.error(); + gen.assign(valid, false).break(outer); + }))); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/const.js +var require_const = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/const.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var equal_1 = require_equal(); + var error2 = { + message: "must be equal to constant", + params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` + }; + var def = { + keyword: "const", + $data: true, + error: error2, + code(cxt) { + const { gen, data, $data, schemaCode, schema: schema8 } = cxt; + if ($data || schema8 && typeof schema8 == "object") { + cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); + } else { + cxt.fail((0, codegen_1._)`${schema8} !== ${data}`); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/enum.js +var require_enum2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/enum.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var equal_1 = require_equal(); + var error2 = { + message: "must be equal to one of the allowed values", + params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` + }; + var def = { + keyword: "enum", + schemaType: "array", + $data: true, + error: error2, + code(cxt) { + const { gen, data, $data, schema: schema8, schemaCode, it: it2 } = cxt; + if (!$data && schema8.length === 0) + throw new Error("enum must have non-empty array"); + const useLoop = schema8.length >= it2.opts.loopEnum; + let eql; + const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default); + let valid; + if (useLoop || $data) { + valid = gen.let("valid"); + cxt.block$data(valid, loopEnum); + } else { + if (!Array.isArray(schema8)) + throw new Error("ajv implementation error"); + const vSchema = gen.const("vSchema", schemaCode); + valid = (0, codegen_1.or)(...schema8.map((_x, i7) => equalCode(vSchema, i7))); + } + cxt.pass(valid); + function loopEnum() { + gen.assign(valid, false); + gen.forOf("v", schemaCode, (v8) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v8})`, () => gen.assign(valid, true).break())); + } + function equalCode(vSchema, i7) { + const sch = schema8[i7]; + return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i7}])` : (0, codegen_1._)`${data} === ${sch}`; + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/index.js +var require_validation = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var limitNumber_1 = require_limitNumber(); + var multipleOf_1 = require_multipleOf(); + var limitLength_1 = require_limitLength(); + var pattern_1 = require_pattern2(); + var limitProperties_1 = require_limitProperties(); + var required_1 = require_required2(); + var limitItems_1 = require_limitItems(); + var uniqueItems_1 = require_uniqueItems(); + var const_1 = require_const(); + var enum_1 = require_enum2(); + var validation = [ + // number + limitNumber_1.default, + multipleOf_1.default, + // string + limitLength_1.default, + pattern_1.default, + // object + limitProperties_1.default, + required_1.default, + // array + limitItems_1.default, + uniqueItems_1.default, + // any + { keyword: "type", schemaType: ["string", "array"] }, + { keyword: "nullable", schemaType: "boolean" }, + const_1.default, + enum_1.default + ]; + exports28.default = validation; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +var require_additionalItems = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateAdditionalItems = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` + }; + var def = { + keyword: "additionalItems", + type: "array", + schemaType: ["boolean", "object"], + before: "uniqueItems", + error: error2, + code(cxt) { + const { parentSchema, it: it2 } = cxt; + const { items } = parentSchema; + if (!Array.isArray(items)) { + (0, util_1.checkStrictMode)(it2, '"additionalItems" is ignored when "items" is not an array of schemas'); + return; + } + validateAdditionalItems(cxt, items); + } + }; + function validateAdditionalItems(cxt, items) { + const { gen, schema: schema8, data, keyword, it: it2 } = cxt; + it2.items = true; + const len = gen.const("len", (0, codegen_1._)`${data}.length`); + if (schema8 === false) { + cxt.setParams({ len: items.length }); + cxt.pass((0, codegen_1._)`${len} <= ${items.length}`); + } else if (typeof schema8 == "object" && !(0, util_1.alwaysValidSchema)(it2, schema8)) { + const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`); + gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); + cxt.ok(valid); + } + function validateItems(valid) { + gen.forRange("i", items.length, len, (i7) => { + cxt.subschema({ keyword, dataProp: i7, dataPropType: util_1.Type.Num }, valid); + if (!it2.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } + } + exports28.validateAdditionalItems = validateAdditionalItems; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/items.js +var require_items = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/items.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateTuple = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var code_1 = require_code2(); + var def = { + keyword: "items", + type: "array", + schemaType: ["object", "array", "boolean"], + before: "uniqueItems", + code(cxt) { + const { schema: schema8, it: it2 } = cxt; + if (Array.isArray(schema8)) + return validateTuple(cxt, "additionalItems", schema8); + it2.items = true; + if ((0, util_1.alwaysValidSchema)(it2, schema8)) + return; + cxt.ok((0, code_1.validateArray)(cxt)); + } + }; + function validateTuple(cxt, extraItems, schArr = cxt.schema) { + const { gen, parentSchema, data, keyword, it: it2 } = cxt; + checkStrictTuple(parentSchema); + if (it2.opts.unevaluated && schArr.length && it2.items !== true) { + it2.items = util_1.mergeEvaluated.items(gen, schArr.length, it2.items); + } + const valid = gen.name("valid"); + const len = gen.const("len", (0, codegen_1._)`${data}.length`); + schArr.forEach((sch, i7) => { + if ((0, util_1.alwaysValidSchema)(it2, sch)) + return; + gen.if((0, codegen_1._)`${len} > ${i7}`, () => cxt.subschema({ + keyword, + schemaProp: i7, + dataProp: i7 + }, valid)); + cxt.ok(valid); + }); + function checkStrictTuple(sch) { + const { opts, errSchemaPath } = it2; + const l7 = schArr.length; + const fullTuple = l7 === sch.minItems && (l7 === sch.maxItems || sch[extraItems] === false); + if (opts.strictTuples && !fullTuple) { + const msg = `"${keyword}" is ${l7}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; + (0, util_1.checkStrictMode)(it2, msg, opts.strictTuples); + } + } + } + exports28.validateTuple = validateTuple; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +var require_prefixItems = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var items_1 = require_items(); + var def = { + keyword: "prefixItems", + type: "array", + schemaType: ["array"], + before: "uniqueItems", + code: (cxt) => (0, items_1.validateTuple)(cxt, "items") + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/items2020.js +var require_items2020 = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var code_1 = require_code2(); + var additionalItems_1 = require_additionalItems(); + var error2 = { + message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` + }; + var def = { + keyword: "items", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + error: error2, + code(cxt) { + const { schema: schema8, parentSchema, it: it2 } = cxt; + const { prefixItems } = parentSchema; + it2.items = true; + if ((0, util_1.alwaysValidSchema)(it2, schema8)) + return; + if (prefixItems) + (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); + else + cxt.ok((0, code_1.validateArray)(cxt)); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/contains.js +var require_contains = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: ({ params: { min: min2, max: max2 } }) => max2 === void 0 ? (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 === void 0 ? (0, codegen_1._)`{minContains: ${min2}}` : (0, codegen_1._)`{minContains: ${min2}, maxContains: ${max2}}` + }; + var def = { + keyword: "contains", + type: "array", + schemaType: ["object", "boolean"], + before: "uniqueItems", + trackErrors: true, + error: error2, + code(cxt) { + const { gen, schema: schema8, parentSchema, data, it: it2 } = cxt; + let min2; + let max2; + const { minContains, maxContains } = parentSchema; + if (it2.opts.next) { + min2 = minContains === void 0 ? 1 : minContains; + max2 = maxContains; + } else { + min2 = 1; + } + const len = gen.const("len", (0, codegen_1._)`${data}.length`); + cxt.setParams({ min: min2, max: max2 }); + if (max2 === void 0 && min2 === 0) { + (0, util_1.checkStrictMode)(it2, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); + return; + } + if (max2 !== void 0 && min2 > max2) { + (0, util_1.checkStrictMode)(it2, `"minContains" > "maxContains" is always invalid`); + cxt.fail(); + return; + } + if ((0, util_1.alwaysValidSchema)(it2, schema8)) { + let cond2 = (0, codegen_1._)`${len} >= ${min2}`; + if (max2 !== void 0) + cond2 = (0, codegen_1._)`${cond2} && ${len} <= ${max2}`; + cxt.pass(cond2); + return; + } + it2.items = true; + const valid = gen.name("valid"); + if (max2 === void 0 && min2 === 1) { + validateItems(valid, () => gen.if(valid, () => gen.break())); + } else if (min2 === 0) { + gen.let(valid, true); + if (max2 !== void 0) + gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); + } else { + gen.let(valid, false); + validateItemsWithCount(); + } + cxt.result(valid, () => cxt.reset()); + function validateItemsWithCount() { + const schValid = gen.name("_valid"); + const count2 = gen.let("count", 0); + validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2))); + } + function validateItems(_valid, block) { + gen.forRange("i", 0, len, (i7) => { + cxt.subschema({ + keyword: "contains", + dataProp: i7, + dataPropType: util_1.Type.Num, + compositeRule: true + }, _valid); + block(); + }); + } + function checkLimits(count2) { + gen.code((0, codegen_1._)`${count2}++`); + if (max2 === void 0) { + gen.if((0, codegen_1._)`${count2} >= ${min2}`, () => gen.assign(valid, true).break()); + } else { + gen.if((0, codegen_1._)`${count2} > ${max2}`, () => gen.assign(valid, false).break()); + if (min2 === 1) + gen.assign(valid, true); + else + gen.if((0, codegen_1._)`${count2} >= ${min2}`, () => gen.assign(valid, true)); + } + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/dependencies.js +var require_dependencies = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateSchemaDeps = exports28.validatePropertyDeps = exports28.error = void 0; + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var code_1 = require_code2(); + exports28.error = { + 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 ${property2} is present`; + }, + params: ({ params: { property: property2, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property2}, + missingProperty: ${missingProperty}, + depsCount: ${depsCount}, + deps: ${deps}}` + // TODO change to reference + }; + var def = { + keyword: "dependencies", + type: "object", + schemaType: "object", + error: exports28.error, + code(cxt) { + const [propDeps, schDeps] = splitDependencies(cxt); + validatePropertyDeps(cxt, propDeps); + validateSchemaDeps(cxt, schDeps); + } + }; + function splitDependencies({ schema: schema8 }) { + const propertyDeps = {}; + const schemaDeps = {}; + for (const key in schema8) { + if (key === "__proto__") + continue; + const deps = Array.isArray(schema8[key]) ? propertyDeps : schemaDeps; + deps[key] = schema8[key]; + } + return [propertyDeps, schemaDeps]; + } + function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { + const { gen, data, it: it2 } = cxt; + if (Object.keys(propertyDeps).length === 0) + return; + const missing = gen.let("missing"); + for (const prop in propertyDeps) { + const deps = propertyDeps[prop]; + if (deps.length === 0) + continue; + const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it2.opts.ownProperties); + cxt.setParams({ + property: prop, + depsCount: deps.length, + deps: deps.join(", ") + }); + if (it2.allErrors) { + gen.if(hasProperty, () => { + for (const depProp of deps) { + (0, code_1.checkReportMissingProp)(cxt, depProp); + } + }); + } else { + gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); + (0, code_1.reportMissingProp)(cxt, missing); + gen.else(); + } + } + } + exports28.validatePropertyDeps = validatePropertyDeps; + function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { + const { gen, data, keyword, it: it2 } = cxt; + const valid = gen.name("valid"); + for (const prop in schemaDeps) { + if ((0, util_1.alwaysValidSchema)(it2, schemaDeps[prop])) + continue; + gen.if( + (0, code_1.propertyInData)(gen, data, prop, it2.opts.ownProperties), + () => { + const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); + cxt.mergeValidEvaluated(schCxt, valid); + }, + () => gen.var(valid, true) + // TODO var + ); + cxt.ok(valid); + } + } + exports28.validateSchemaDeps = validateSchemaDeps; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +var require_propertyNames = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: "property name must be valid", + params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` + }; + var def = { + keyword: "propertyNames", + type: "object", + schemaType: ["object", "boolean"], + error: error2, + code(cxt) { + const { gen, schema: schema8, data, it: it2 } = cxt; + if ((0, util_1.alwaysValidSchema)(it2, schema8)) + return; + const valid = gen.name("valid"); + gen.forIn("key", data, (key) => { + cxt.setParams({ propertyName: key }); + cxt.subschema({ + keyword: "propertyNames", + data: key, + dataTypes: ["string"], + propertyName: key, + compositeRule: true + }, valid); + gen.if((0, codegen_1.not)(valid), () => { + cxt.error(true); + if (!it2.allErrors) + gen.break(); + }); + }); + cxt.ok(valid); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +var require_additionalProperties = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var code_1 = require_code2(); + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var util_1 = require_util(); + var error2 = { + message: "must NOT have additional properties", + params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` + }; + var def = { + keyword: "additionalProperties", + type: ["object"], + schemaType: ["boolean", "object"], + allowUndefined: true, + trackErrors: true, + error: error2, + code(cxt) { + const { gen, schema: schema8, parentSchema, data, errsCount, it: it2 } = cxt; + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, opts } = it2; + it2.props = true; + if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it2, schema8)) + return; + const props = (0, code_1.allSchemaProperties)(parentSchema.properties); + const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); + checkAdditionalProperties(); + cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); + function checkAdditionalProperties() { + gen.forIn("key", data, (key) => { + if (!props.length && !patProps.length) + additionalPropertyCode(key); + else + gen.if(isAdditional(key), () => additionalPropertyCode(key)); + }); + } + function isAdditional(key) { + let definedProp; + if (props.length > 8) { + const propsSchema = (0, util_1.schemaRefOrVal)(it2, parentSchema.properties, "properties"); + definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); + } else if (props.length) { + definedProp = (0, codegen_1.or)(...props.map((p7) => (0, codegen_1._)`${key} === ${p7}`)); + } else { + definedProp = codegen_1.nil; + } + if (patProps.length) { + definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p7) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p7)}.test(${key})`)); + } + return (0, codegen_1.not)(definedProp); + } + function deleteAdditional(key) { + gen.code((0, codegen_1._)`delete ${data}[${key}]`); + } + function additionalPropertyCode(key) { + if (opts.removeAdditional === "all" || opts.removeAdditional && schema8 === false) { + deleteAdditional(key); + return; + } + if (schema8 === false) { + cxt.setParams({ additionalProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (typeof schema8 == "object" && !(0, util_1.alwaysValidSchema)(it2, schema8)) { + const valid = gen.name("valid"); + if (opts.removeAdditional === "failing") { + applyAdditionalSchema(key, valid, false); + gen.if((0, codegen_1.not)(valid), () => { + cxt.reset(); + deleteAdditional(key); + }); + } else { + applyAdditionalSchema(key, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + } + function applyAdditionalSchema(key, valid, errors) { + const subschema = { + keyword: "additionalProperties", + dataProp: key, + dataPropType: util_1.Type.Str + }; + if (errors === false) { + Object.assign(subschema, { + compositeRule: true, + createErrors: false, + allErrors: false + }); + } + cxt.subschema(subschema, valid); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/properties.js +var require_properties = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var validate_1 = require_validate(); + var code_1 = require_code2(); + var util_1 = require_util(); + var additionalProperties_1 = require_additionalProperties(); + var def = { + keyword: "properties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema: schema8, parentSchema, data, it: it2 } = cxt; + if (it2.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) { + additionalProperties_1.default.code(new validate_1.KeywordCxt(it2, additionalProperties_1.default, "additionalProperties")); + } + const allProps = (0, code_1.allSchemaProperties)(schema8); + for (const prop of allProps) { + it2.definedProperties.add(prop); + } + if (it2.opts.unevaluated && allProps.length && it2.props !== true) { + it2.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it2.props); + } + const properties = allProps.filter((p7) => !(0, util_1.alwaysValidSchema)(it2, schema8[p7])); + if (properties.length === 0) + return; + const valid = gen.name("valid"); + for (const prop of properties) { + if (hasDefault(prop)) { + applyPropertySchema(prop); + } else { + gen.if((0, code_1.propertyInData)(gen, data, prop, it2.opts.ownProperties)); + applyPropertySchema(prop); + if (!it2.allErrors) + gen.else().var(valid, true); + gen.endIf(); + } + cxt.it.definedProperties.add(prop); + cxt.ok(valid); + } + function hasDefault(prop) { + return it2.opts.useDefaults && !it2.compositeRule && schema8[prop].default !== void 0; + } + function applyPropertySchema(prop) { + cxt.subschema({ + keyword: "properties", + schemaProp: prop, + dataProp: prop + }, valid); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +var require_patternProperties = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var code_1 = require_code2(); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var util_2 = require_util(); + var def = { + keyword: "patternProperties", + type: "object", + schemaType: "object", + code(cxt) { + const { gen, schema: schema8, data, parentSchema, it: it2 } = cxt; + const { opts } = it2; + const patterns = (0, code_1.allSchemaProperties)(schema8); + const alwaysValidPatterns = patterns.filter((p7) => (0, util_1.alwaysValidSchema)(it2, schema8[p7])); + if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it2.opts.unevaluated || it2.props === true)) { + return; + } + const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; + const valid = gen.name("valid"); + if (it2.props !== true && !(it2.props instanceof codegen_1.Name)) { + it2.props = (0, util_2.evaluatedPropsToName)(gen, it2.props); + } + const { props } = it2; + validatePatternProperties(); + function validatePatternProperties() { + for (const pat of patterns) { + if (checkProperties) + checkMatchingProperties(pat); + if (it2.allErrors) { + validateProperties(pat); + } else { + gen.var(valid, true); + validateProperties(pat); + gen.if(valid); + } + } + } + function checkMatchingProperties(pat) { + for (const prop in checkProperties) { + if (new RegExp(pat).test(prop)) { + (0, util_1.checkStrictMode)(it2, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); + } + } + } + function validateProperties(pat) { + gen.forIn("key", data, (key) => { + gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { + const alwaysValid = alwaysValidPatterns.includes(pat); + if (!alwaysValid) { + cxt.subschema({ + keyword: "patternProperties", + schemaProp: pat, + dataProp: key, + dataPropType: util_2.Type.Str + }, valid); + } + if (it2.opts.unevaluated && props !== true) { + gen.assign((0, codegen_1._)`${props}[${key}]`, true); + } else if (!alwaysValid && !it2.allErrors) { + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + }); + }); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/not.js +var require_not = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/not.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var util_1 = require_util(); + var def = { + keyword: "not", + schemaType: ["object", "boolean"], + trackErrors: true, + code(cxt) { + const { gen, schema: schema8, it: it2 } = cxt; + if ((0, util_1.alwaysValidSchema)(it2, schema8)) { + cxt.fail(); + return; + } + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "not", + compositeRule: true, + createErrors: false, + allErrors: false + }, valid); + cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); + }, + error: { message: "must NOT be valid" } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/anyOf.js +var require_anyOf = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var code_1 = require_code2(); + var def = { + keyword: "anyOf", + schemaType: "array", + trackErrors: true, + code: code_1.validateUnion, + error: { message: "must match a schema in anyOf" } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/oneOf.js +var require_oneOf = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: "must match exactly one schema in oneOf", + params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` + }; + var def = { + keyword: "oneOf", + schemaType: "array", + trackErrors: true, + error: error2, + code(cxt) { + const { gen, schema: schema8, parentSchema, it: it2 } = cxt; + if (!Array.isArray(schema8)) + throw new Error("ajv implementation error"); + if (it2.opts.discriminator && parentSchema.discriminator) + return; + const schArr = schema8; + const valid = gen.let("valid", false); + const passing = gen.let("passing", null); + const schValid = gen.name("_valid"); + cxt.setParams({ passing }); + gen.block(validateOneOf); + cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); + function validateOneOf() { + schArr.forEach((sch, i7) => { + let schCxt; + if ((0, util_1.alwaysValidSchema)(it2, sch)) { + gen.var(schValid, true); + } else { + schCxt = cxt.subschema({ + keyword: "oneOf", + schemaProp: i7, + compositeRule: true + }, schValid); + } + if (i7 > 0) { + gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i7}]`).else(); + } + gen.if(schValid, () => { + gen.assign(valid, true); + gen.assign(passing, i7); + if (schCxt) + cxt.mergeEvaluated(schCxt, codegen_1.Name); + }); + }); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/allOf.js +var require_allOf = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var util_1 = require_util(); + var def = { + keyword: "allOf", + schemaType: "array", + code(cxt) { + const { gen, schema: schema8, it: it2 } = cxt; + if (!Array.isArray(schema8)) + throw new Error("ajv implementation error"); + const valid = gen.name("valid"); + schema8.forEach((sch, i7) => { + if ((0, util_1.alwaysValidSchema)(it2, sch)) + return; + const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i7 }, valid); + cxt.ok(valid); + cxt.mergeEvaluated(schCxt); + }); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/if.js +var require_if = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/if.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, + params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` + }; + var def = { + keyword: "if", + schemaType: ["object", "boolean"], + trackErrors: true, + error: error2, + code(cxt) { + const { gen, parentSchema, it: it2 } = cxt; + if (parentSchema.then === void 0 && parentSchema.else === void 0) { + (0, util_1.checkStrictMode)(it2, '"if" without "then" and "else" is ignored'); + } + const hasThen = hasSchema(it2, "then"); + const hasElse = hasSchema(it2, "else"); + if (!hasThen && !hasElse) + return; + const valid = gen.let("valid", true); + const schValid = gen.name("_valid"); + validateIf(); + cxt.reset(); + if (hasThen && hasElse) { + const ifClause = gen.let("ifClause"); + cxt.setParams({ ifClause }); + gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); + } else if (hasThen) { + gen.if(schValid, validateClause("then")); + } else { + gen.if((0, codegen_1.not)(schValid), validateClause("else")); + } + cxt.pass(valid, () => cxt.error(true)); + function validateIf() { + const schCxt = cxt.subschema({ + keyword: "if", + compositeRule: true, + createErrors: false, + allErrors: false + }, schValid); + cxt.mergeEvaluated(schCxt); + } + function validateClause(keyword, ifClause) { + return () => { + const schCxt = cxt.subschema({ keyword }, schValid); + gen.assign(valid, schValid); + cxt.mergeValidEvaluated(schCxt, valid); + if (ifClause) + gen.assign(ifClause, (0, codegen_1._)`${keyword}`); + else + cxt.setParams({ ifClause: keyword }); + }; + } + } + }; + function hasSchema(it2, keyword) { + const schema8 = it2.schema[keyword]; + return schema8 !== void 0 && !(0, util_1.alwaysValidSchema)(it2, schema8); + } + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/thenElse.js +var require_thenElse = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var util_1 = require_util(); + var def = { + keyword: ["then", "else"], + schemaType: ["object", "boolean"], + code({ keyword, parentSchema, it: it2 }) { + if (parentSchema.if === void 0) + (0, util_1.checkStrictMode)(it2, `"${keyword}" without "if" is ignored`); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/index.js +var require_applicator = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var additionalItems_1 = require_additionalItems(); + var prefixItems_1 = require_prefixItems(); + var items_1 = require_items(); + var items2020_1 = require_items2020(); + var contains_1 = require_contains(); + var dependencies_1 = require_dependencies(); + var propertyNames_1 = require_propertyNames(); + var additionalProperties_1 = require_additionalProperties(); + var properties_1 = require_properties(); + var patternProperties_1 = require_patternProperties(); + var not_1 = require_not(); + var anyOf_1 = require_anyOf(); + var oneOf_1 = require_oneOf(); + var allOf_1 = require_allOf(); + var if_1 = require_if(); + var thenElse_1 = require_thenElse(); + function getApplicator(draft2020 = false) { + const applicator = [ + // any + not_1.default, + anyOf_1.default, + oneOf_1.default, + allOf_1.default, + if_1.default, + thenElse_1.default, + // object + propertyNames_1.default, + additionalProperties_1.default, + dependencies_1.default, + properties_1.default, + patternProperties_1.default + ]; + if (draft2020) + applicator.push(prefixItems_1.default, items2020_1.default); + else + applicator.push(additionalItems_1.default, items_1.default); + applicator.push(contains_1.default); + return applicator; + } + exports28.default = getApplicator; + } +}); + +// node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +var require_dynamicAnchor = __commonJS({ + "node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.dynamicAnchor = void 0; + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var compile_1 = require_compile(); + var ref_1 = require_ref(); + var def = { + keyword: "$dynamicAnchor", + schemaType: "string", + code: (cxt) => dynamicAnchor(cxt, cxt.schema) + }; + function dynamicAnchor(cxt, anchor) { + const { gen, it: it2 } = cxt; + it2.schemaEnv.root.dynamicAnchors[anchor] = true; + const v8 = (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`; + const validate15 = it2.errSchemaPath === "#" ? it2.validateName : _getValidate(cxt); + gen.if((0, codegen_1._)`!${v8}`, () => gen.assign(v8, validate15)); + } + exports28.dynamicAnchor = dynamicAnchor; + function _getValidate(cxt) { + const { schemaEnv, schema: schema8, self: self2 } = cxt.it; + const { root: root2, baseId, localRefs, meta } = schemaEnv.root; + const { schemaId } = self2.opts; + const sch = new compile_1.SchemaEnv({ schema: schema8, schemaId, root: root2, baseId, localRefs, meta }); + compile_1.compileSchema.call(self2, sch); + return (0, ref_1.getValidate)(cxt, sch); + } + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +var require_dynamicRef = __commonJS({ + "node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.dynamicRef = void 0; + var codegen_1 = require_codegen(); + var names_1 = require_names(); + var ref_1 = require_ref(); + var def = { + keyword: "$dynamicRef", + schemaType: "string", + code: (cxt) => dynamicRef(cxt, cxt.schema) + }; + function dynamicRef(cxt, ref) { + const { gen, keyword, it: it2 } = cxt; + if (ref[0] !== "#") + throw new Error(`"${keyword}" only supports hash fragment reference`); + const anchor = ref.slice(1); + if (it2.allErrors) { + _dynamicRef(); + } else { + const valid = gen.let("valid", false); + _dynamicRef(valid); + cxt.ok(valid); + } + function _dynamicRef(valid) { + if (it2.schemaEnv.root.dynamicAnchors[anchor]) { + const v8 = gen.let("_v", (0, codegen_1._)`${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`); + gen.if(v8, _callRef(v8, valid), _callRef(it2.validateName, valid)); + } else { + _callRef(it2.validateName, valid)(); + } + } + function _callRef(validate15, valid) { + return valid ? () => gen.block(() => { + (0, ref_1.callRef)(cxt, validate15); + gen.let(valid, true); + }) : () => (0, ref_1.callRef)(cxt, validate15); + } + } + exports28.dynamicRef = dynamicRef; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +var require_recursiveAnchor = __commonJS({ + "node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dynamicAnchor_1 = require_dynamicAnchor(); + var util_1 = require_util(); + var def = { + keyword: "$recursiveAnchor", + schemaType: "boolean", + code(cxt) { + if (cxt.schema) + (0, dynamicAnchor_1.dynamicAnchor)(cxt, ""); + else + (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored"); + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +var require_recursiveRef = __commonJS({ + "node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dynamicRef_1 = require_dynamicRef(); + var def = { + keyword: "$recursiveRef", + schemaType: "string", + code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema) + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/dynamic/index.js +var require_dynamic = __commonJS({ + "node_modules/ajv/dist/vocabularies/dynamic/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dynamicAnchor_1 = require_dynamicAnchor(); + var dynamicRef_1 = require_dynamicRef(); + var recursiveAnchor_1 = require_recursiveAnchor(); + var recursiveRef_1 = require_recursiveRef(); + var dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default]; + exports28.default = dynamic; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +var require_dependentRequired = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/dependentRequired.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dependencies_1 = require_dependencies(); + var def = { + keyword: "dependentRequired", + type: "object", + schemaType: "object", + error: dependencies_1.error, + code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt) + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +var require_dependentSchemas = __commonJS({ + "node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dependencies_1 = require_dependencies(); + var def = { + keyword: "dependentSchemas", + type: "object", + schemaType: "object", + code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt) + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/validation/limitContains.js +var require_limitContains = __commonJS({ + "node_modules/ajv/dist/vocabularies/validation/limitContains.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var util_1 = require_util(); + var def = { + keyword: ["maxContains", "minContains"], + type: "array", + schemaType: "number", + code({ keyword, parentSchema, it: it2 }) { + if (parentSchema.contains === void 0) { + (0, util_1.checkStrictMode)(it2, `"${keyword}" without "contains" is ignored`); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/next.js +var require_next = __commonJS({ + "node_modules/ajv/dist/vocabularies/next.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var dependentRequired_1 = require_dependentRequired(); + var dependentSchemas_1 = require_dependentSchemas(); + var limitContains_1 = require_limitContains(); + var next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default]; + exports28.default = next; + } +}); + +// node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +var require_unevaluatedProperties = __commonJS({ + "node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var names_1 = require_names(); + var error2 = { + message: "must NOT have unevaluated properties", + params: ({ params }) => (0, codegen_1._)`{unevaluatedProperty: ${params.unevaluatedProperty}}` + }; + var def = { + keyword: "unevaluatedProperties", + type: "object", + schemaType: ["boolean", "object"], + trackErrors: true, + error: error2, + code(cxt) { + const { gen, schema: schema8, data, errsCount, it: it2 } = cxt; + if (!errsCount) + throw new Error("ajv implementation error"); + const { allErrors, props } = it2; + if (props instanceof codegen_1.Name) { + gen.if((0, codegen_1._)`${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key)))); + } else if (props !== true) { + gen.forIn("key", data, (key) => props === void 0 ? unevaluatedPropCode(key) : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))); + } + it2.props = true; + cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); + function unevaluatedPropCode(key) { + if (schema8 === false) { + cxt.setParams({ unevaluatedProperty: key }); + cxt.error(); + if (!allErrors) + gen.break(); + return; + } + if (!(0, util_1.alwaysValidSchema)(it2, schema8)) { + const valid = gen.name("valid"); + cxt.subschema({ + keyword: "unevaluatedProperties", + dataProp: key, + dataPropType: util_1.Type.Str + }, valid); + if (!allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + } + } + function unevaluatedDynamic(evaluatedProps, key) { + return (0, codegen_1._)`!${evaluatedProps} || !${evaluatedProps}[${key}]`; + } + function unevaluatedStatic(evaluatedProps, key) { + const ps = []; + for (const p7 in evaluatedProps) { + if (evaluatedProps[p7] === true) + ps.push((0, codegen_1._)`${key} !== ${p7}`); + } + return (0, codegen_1.and)(...ps); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +var require_unevaluatedItems = __commonJS({ + "node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var util_1 = require_util(); + var error2 = { + message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, + params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` + }; + var def = { + keyword: "unevaluatedItems", + type: "array", + schemaType: ["boolean", "object"], + error: error2, + code(cxt) { + const { gen, schema: schema8, data, it: it2 } = cxt; + const items = it2.items || 0; + if (items === true) + return; + const len = gen.const("len", (0, codegen_1._)`${data}.length`); + if (schema8 === false) { + cxt.setParams({ len: items }); + cxt.fail((0, codegen_1._)`${len} > ${items}`); + } else if (typeof schema8 == "object" && !(0, util_1.alwaysValidSchema)(it2, schema8)) { + const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items}`); + gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items)); + cxt.ok(valid); + } + it2.items = true; + function validateItems(valid, from) { + gen.forRange("i", from, len, (i7) => { + cxt.subschema({ keyword: "unevaluatedItems", dataProp: i7, dataPropType: util_1.Type.Num }, valid); + if (!it2.allErrors) + gen.if((0, codegen_1.not)(valid), () => gen.break()); + }); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/unevaluated/index.js +var require_unevaluated = __commonJS({ + "node_modules/ajv/dist/vocabularies/unevaluated/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var unevaluatedProperties_1 = require_unevaluatedProperties(); + var unevaluatedItems_1 = require_unevaluatedItems(); + var unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default]; + exports28.default = unevaluated; + } +}); + +// node_modules/ajv/dist/vocabularies/format/format.js +var require_format = __commonJS({ + "node_modules/ajv/dist/vocabularies/format/format.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var error2 = { + message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, + params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` + }; + var def = { + keyword: "format", + type: ["number", "string"], + schemaType: "string", + $data: true, + error: error2, + code(cxt, ruleType) { + const { gen, data, $data, schema: schema8, schemaCode, it: it2 } = cxt; + const { opts, errSchemaPath, schemaEnv, self: self2 } = it2; + if (!opts.validateFormats) + return; + if ($data) + validate$DataFormat(); + else + validateFormat(); + function validate$DataFormat() { + const fmts = gen.scopeValue("formats", { + ref: self2.formats, + code: opts.code.formats + }); + const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`); + const fType = gen.let("fType"); + const format5 = gen.let("format"); + gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format5, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format5, fDef)); + cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); + function unknownFmt() { + if (opts.strictSchema === false) + return codegen_1.nil; + return (0, codegen_1._)`${schemaCode} && !${format5}`; + } + function invalidFmt() { + const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format5}(${data}) : ${format5}(${data}))` : (0, codegen_1._)`${format5}(${data})`; + const validData = (0, codegen_1._)`(typeof ${format5} == "function" ? ${callFormat} : ${format5}.test(${data}))`; + return (0, codegen_1._)`${format5} && ${format5} !== true && ${fType} === ${ruleType} && !${validData}`; + } + } + function validateFormat() { + const formatDef = self2.formats[schema8]; + if (!formatDef) { + unknownFormat(); + return; + } + if (formatDef === true) + return; + const [fmtType, format5, fmtRef] = getFormat(formatDef); + if (fmtType === ruleType) + cxt.pass(validCondition()); + function unknownFormat() { + if (opts.strictSchema === false) { + self2.logger.warn(unknownMsg()); + return; + } + throw new Error(unknownMsg()); + function unknownMsg() { + return `unknown format "${schema8}" ignored in schema at path "${errSchemaPath}"`; + } + } + function getFormat(fmtDef) { + const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema8)}` : void 0; + const fmt = gen.scopeValue("formats", { key: schema8, ref: fmtDef, code }); + if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { + return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`]; + } + return ["string", fmtDef, fmt]; + } + function validCondition() { + if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { + if (!schemaEnv.$async) + throw new Error("async format in sync schema"); + return (0, codegen_1._)`await ${fmtRef}(${data})`; + } + return typeof format5 == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`; + } + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/vocabularies/format/index.js +var require_format2 = __commonJS({ + "node_modules/ajv/dist/vocabularies/format/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var format_1 = require_format(); + var format5 = [format_1.default]; + exports28.default = format5; + } +}); + +// node_modules/ajv/dist/vocabularies/metadata.js +var require_metadata = __commonJS({ + "node_modules/ajv/dist/vocabularies/metadata.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.contentVocabulary = exports28.metadataVocabulary = void 0; + exports28.metadataVocabulary = [ + "title", + "description", + "default", + "deprecated", + "readOnly", + "writeOnly", + "examples" + ]; + exports28.contentVocabulary = [ + "contentMediaType", + "contentEncoding", + "contentSchema" + ]; + } +}); + +// node_modules/ajv/dist/vocabularies/draft2020.js +var require_draft2020 = __commonJS({ + "node_modules/ajv/dist/vocabularies/draft2020.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var core_1 = require_core2(); + var validation_1 = require_validation(); + var applicator_1 = require_applicator(); + var dynamic_1 = require_dynamic(); + var next_1 = require_next(); + var unevaluated_1 = require_unevaluated(); + var format_1 = require_format2(); + var metadata_1 = require_metadata(); + var draft2020Vocabularies = [ + dynamic_1.default, + core_1.default, + validation_1.default, + (0, applicator_1.default)(true), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary, + next_1.default, + unevaluated_1.default + ]; + exports28.default = draft2020Vocabularies; + } +}); + +// node_modules/ajv/dist/vocabularies/discriminator/types.js +var require_types = __commonJS({ + "node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.DiscrError = void 0; + var DiscrError; + (function(DiscrError2) { + DiscrError2["Tag"] = "tag"; + DiscrError2["Mapping"] = "mapping"; + })(DiscrError || (exports28.DiscrError = DiscrError = {})); + } +}); + +// node_modules/ajv/dist/vocabularies/discriminator/index.js +var require_discriminator = __commonJS({ + "node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var codegen_1 = require_codegen(); + var types_1 = require_types(); + var compile_1 = require_compile(); + var ref_error_1 = require_ref_error(); + var util_1 = require_util(); + var error2 = { + 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, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` + }; + var def = { + keyword: "discriminator", + type: "object", + schemaType: "object", + error: error2, + code(cxt) { + const { gen, data, schema: schema8, parentSchema, it: it2 } = cxt; + const { oneOf } = parentSchema; + if (!it2.opts.discriminator) { + throw new Error("discriminator: requires discriminator option"); + } + const tagName = schema8.propertyName; + if (typeof tagName != "string") + throw new Error("discriminator: requires propertyName"); + if (schema8.mapping) + throw new Error("discriminator: mapping is not supported"); + if (!oneOf) + throw new Error("discriminator: requires oneOf keyword"); + const valid = gen.let("valid", false); + const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`); + gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); + cxt.ok(valid); + function validateMapping() { + const mapping = getMapping(); + gen.if(false); + for (const tagValue in mapping) { + gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); + gen.assign(valid, applyTagSchema(mapping[tagValue])); + } + gen.else(); + cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); + gen.endIf(); + } + function applyTagSchema(schemaProp) { + const _valid = gen.name("valid"); + const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); + cxt.mergeEvaluated(schCxt, codegen_1.Name); + return _valid; + } + function getMapping() { + var _a2; + const oneOfMapping = {}; + const topRequired = hasRequired(parentSchema); + let tagRequired = true; + for (let i7 = 0; i7 < oneOf.length; i7++) { + let sch = oneOf[i7]; + if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it2.self.RULES)) { + const ref = sch.$ref; + sch = compile_1.resolveRef.call(it2.self, it2.schemaEnv.root, it2.baseId, ref); + if (sch instanceof compile_1.SchemaEnv) + sch = sch.schema; + if (sch === void 0) + throw new ref_error_1.default(it2.opts.uriResolver, it2.baseId, ref); + } + const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[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, i7); + } + if (!tagRequired) + throw new Error(`discriminator: "${tagName}" must be required`); + return oneOfMapping; + function hasRequired({ required }) { + return Array.isArray(required) && required.includes(tagName); + } + function addMappings(sch, i7) { + if (sch.const) { + addMapping(sch.const, i7); + } else if (sch.enum) { + for (const tagValue of sch.enum) { + addMapping(tagValue, i7); + } + } else { + throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); + } + } + function addMapping(tagValue, i7) { + if (typeof tagValue != "string" || tagValue in oneOfMapping) { + throw new Error(`discriminator: "${tagName}" values must be unique strings`); + } + oneOfMapping[tagValue] = i7; + } + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +var require_schema = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/schema.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/schema", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/core": true, + "https://json-schema.org/draft/2020-12/vocab/applicator": true, + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, + "https://json-schema.org/draft/2020-12/vocab/validation": true, + "https://json-schema.org/draft/2020-12/vocab/meta-data": true, + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + $dynamicAnchor: "meta", + title: "Core and Validation specifications meta-schema", + allOf: [ + { $ref: "meta/core" }, + { $ref: "meta/applicator" }, + { $ref: "meta/unevaluated" }, + { $ref: "meta/validation" }, + { $ref: "meta/meta-data" }, + { $ref: "meta/format-annotation" }, + { $ref: "meta/content" } + ], + type: ["object", "boolean"], + $comment: "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", + properties: { + definitions: { + $comment: '"definitions" has been replaced by "$defs".', + type: "object", + additionalProperties: { $dynamicRef: "#meta" }, + deprecated: true, + default: {} + }, + dependencies: { + $comment: '"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.', + type: "object", + additionalProperties: { + anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] + }, + deprecated: true, + default: {} + }, + $recursiveAnchor: { + $comment: '"$recursiveAnchor" has been replaced by "$dynamicAnchor".', + $ref: "meta/core#/$defs/anchorString", + deprecated: true + }, + $recursiveRef: { + $comment: '"$recursiveRef" has been replaced by "$dynamicRef".', + $ref: "meta/core#/$defs/uriReferenceString", + deprecated: true + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +var require_applicator2 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/applicator", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/applicator": true + }, + $dynamicAnchor: "meta", + title: "Applicator vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + prefixItems: { $ref: "#/$defs/schemaArray" }, + items: { $dynamicRef: "#meta" }, + contains: { $dynamicRef: "#meta" }, + additionalProperties: { $dynamicRef: "#meta" }, + properties: { + type: "object", + additionalProperties: { $dynamicRef: "#meta" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $dynamicRef: "#meta" }, + propertyNames: { format: "regex" }, + default: {} + }, + dependentSchemas: { + type: "object", + additionalProperties: { $dynamicRef: "#meta" }, + default: {} + }, + propertyNames: { $dynamicRef: "#meta" }, + if: { $dynamicRef: "#meta" }, + then: { $dynamicRef: "#meta" }, + else: { $dynamicRef: "#meta" }, + allOf: { $ref: "#/$defs/schemaArray" }, + anyOf: { $ref: "#/$defs/schemaArray" }, + oneOf: { $ref: "#/$defs/schemaArray" }, + not: { $dynamicRef: "#meta" } + }, + $defs: { + schemaArray: { + type: "array", + minItems: 1, + items: { $dynamicRef: "#meta" } + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +var require_unevaluated2 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/unevaluated", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/unevaluated": true + }, + $dynamicAnchor: "meta", + title: "Unevaluated applicator vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + unevaluatedItems: { $dynamicRef: "#meta" }, + unevaluatedProperties: { $dynamicRef: "#meta" } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +var require_content = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/content", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/content": true + }, + $dynamicAnchor: "meta", + title: "Content vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + contentEncoding: { type: "string" }, + contentMediaType: { type: "string" }, + contentSchema: { $dynamicRef: "#meta" } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +var require_core3 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/core", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/core": true + }, + $dynamicAnchor: "meta", + title: "Core vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + $id: { + $ref: "#/$defs/uriReferenceString", + $comment: "Non-empty fragments not allowed.", + pattern: "^[^#]*#?$" + }, + $schema: { $ref: "#/$defs/uriString" }, + $ref: { $ref: "#/$defs/uriReferenceString" }, + $anchor: { $ref: "#/$defs/anchorString" }, + $dynamicRef: { $ref: "#/$defs/uriReferenceString" }, + $dynamicAnchor: { $ref: "#/$defs/anchorString" }, + $vocabulary: { + type: "object", + propertyNames: { $ref: "#/$defs/uriString" }, + additionalProperties: { + type: "boolean" + } + }, + $comment: { + type: "string" + }, + $defs: { + type: "object", + additionalProperties: { $dynamicRef: "#meta" } + } + }, + $defs: { + anchorString: { + type: "string", + pattern: "^[A-Za-z_][-A-Za-z0-9._]*$" + }, + uriString: { + type: "string", + format: "uri" + }, + uriReferenceString: { + type: "string", + format: "uri-reference" + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +var require_format_annotation = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/format-annotation", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/format-annotation": true + }, + $dynamicAnchor: "meta", + title: "Format vocabulary meta-schema for annotation results", + type: ["object", "boolean"], + properties: { + format: { type: "string" } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +var require_meta_data = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/meta-data", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/meta-data": true + }, + $dynamicAnchor: "meta", + title: "Meta-data vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + deprecated: { + type: "boolean", + default: false + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +var require_validation2 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2020-12/schema", + $id: "https://json-schema.org/draft/2020-12/meta/validation", + $vocabulary: { + "https://json-schema.org/draft/2020-12/vocab/validation": true + }, + $dynamicAnchor: "meta", + title: "Validation vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + type: { + anyOf: [ + { $ref: "#/$defs/simpleTypes" }, + { + type: "array", + items: { $ref: "#/$defs/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + const: true, + enum: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { $ref: "#/$defs/nonNegativeInteger" }, + minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { $ref: "#/$defs/nonNegativeInteger" }, + minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxContains: { $ref: "#/$defs/nonNegativeInteger" }, + minContains: { + $ref: "#/$defs/nonNegativeInteger", + default: 1 + }, + maxProperties: { $ref: "#/$defs/nonNegativeInteger" }, + minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + required: { $ref: "#/$defs/stringArray" }, + dependentRequired: { + type: "object", + additionalProperties: { + $ref: "#/$defs/stringArray" + } + } + }, + $defs: { + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + $ref: "#/$defs/nonNegativeInteger", + default: 0 + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + uniqueItems: true, + default: [] + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2020-12/index.js +var require_json_schema_2020_12 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2020-12/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var metaSchema = require_schema(); + var applicator = require_applicator2(); + var unevaluated = require_unevaluated2(); + var content = require_content(); + var core2 = require_core3(); + var format5 = require_format_annotation(); + var metadata = require_meta_data(); + var validation = require_validation2(); + var META_SUPPORT_DATA = ["/properties"]; + function addMetaSchema2020($data) { + ; + [ + metaSchema, + applicator, + unevaluated, + content, + core2, + with$data(this, format5), + metadata, + with$data(this, validation) + ].forEach((sch) => this.addMetaSchema(sch, void 0, false)); + return this; + function with$data(ajv2, sch) { + return $data ? ajv2.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } + } + exports28.default = addMetaSchema2020; + } +}); + +// node_modules/ajv/dist/2020.js +var require__ = __commonJS({ + "node_modules/ajv/dist/2020.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.MissingRefError = exports28.ValidationError = exports28.CodeGen = exports28.Name = exports28.nil = exports28.stringify = exports28.str = exports28._ = exports28.KeywordCxt = exports28.Ajv2020 = void 0; + var core_1 = require_core(); + var draft2020_1 = require_draft2020(); + var discriminator_1 = require_discriminator(); + var json_schema_2020_12_1 = require_json_schema_2020_12(); + var META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"; + var Ajv2020 = class extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true + }); + } + _addVocabularies() { + super._addVocabularies(); + draft2020_1.default.forEach((v8) => this.addVocabulary(v8)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2020_12_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); + } + }; + exports28.Ajv2020 = Ajv2020; + module5.exports = exports28 = Ajv2020; + module5.exports.Ajv2020 = Ajv2020; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.default = Ajv2020; + var validate_1 = require_validate(); + Object.defineProperty(exports28, "KeywordCxt", { enumerable: true, get: function() { + return validate_1.KeywordCxt; + } }); + var codegen_1 = require_codegen(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return codegen_1._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return codegen_1.str; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return codegen_1.stringify; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return codegen_1.nil; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return codegen_1.Name; + } }); + Object.defineProperty(exports28, "CodeGen", { enumerable: true, get: function() { + return codegen_1.CodeGen; + } }); + var validation_error_1 = require_validation_error(); + Object.defineProperty(exports28, "ValidationError", { enumerable: true, get: function() { + return validation_error_1.default; + } }); + var ref_error_1 = require_ref_error(); + Object.defineProperty(exports28, "MissingRefError", { enumerable: true, get: function() { + return ref_error_1.default; + } }); + } +}); + +// node_modules/ajv-draft-04/dist/vocabulary/core.js +var require_core4 = __commonJS({ + "node_modules/ajv-draft-04/dist/vocabulary/core.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ref_1 = require_ref(); + var core2 = [ + "$schema", + "id", + "$defs", + { keyword: "$comment" }, + "definitions", + ref_1.default + ]; + exports28.default = core2; + } +}); + +// node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js +var require_limitNumber2 = __commonJS({ + "node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var core_1 = require_core(); + var codegen_1 = require_codegen(); + var ops = codegen_1.operators; + var KWDs = { + maximum: { + exclusive: "exclusiveMaximum", + ops: [ + { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + { okStr: "<", ok: ops.LT, fail: ops.GTE } + ] + }, + minimum: { + exclusive: "exclusiveMinimum", + ops: [ + { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + { okStr: ">", ok: ops.GT, fail: ops.LTE } + ] + } + }; + var error2 = { + message: (cxt) => core_1.str`must be ${kwdOp(cxt).okStr} ${cxt.schemaCode}`, + params: (cxt) => core_1._`{comparison: ${kwdOp(cxt).okStr}, limit: ${cxt.schemaCode}}` + }; + var def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "number", + $data: true, + error: error2, + code(cxt) { + const { data, schemaCode } = cxt; + cxt.fail$data(core_1._`${data} ${kwdOp(cxt).fail} ${schemaCode} || isNaN(${data})`); + } + }; + function kwdOp(cxt) { + var _a2; + const keyword = cxt.keyword; + const opsIdx = ((_a2 = cxt.parentSchema) === null || _a2 === void 0 ? void 0 : _a2[KWDs[keyword].exclusive]) ? 1 : 0; + return KWDs[keyword].ops[opsIdx]; + } + exports28.default = def; + } +}); + +// node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js +var require_limitNumberExclusive = __commonJS({ + "node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var KWDs = { + exclusiveMaximum: "maximum", + exclusiveMinimum: "minimum" + }; + var def = { + keyword: Object.keys(KWDs), + type: "number", + schemaType: "boolean", + code({ keyword, parentSchema }) { + const limitKwd = KWDs[keyword]; + if (parentSchema[limitKwd] === void 0) { + throw new Error(`${keyword} can only be used with ${limitKwd}`); + } + } + }; + exports28.default = def; + } +}); + +// node_modules/ajv-draft-04/dist/vocabulary/validation/index.js +var require_validation3 = __commonJS({ + "node_modules/ajv-draft-04/dist/vocabulary/validation/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var limitNumber_1 = require_limitNumber2(); + var limitNumberExclusive_1 = require_limitNumberExclusive(); + var multipleOf_1 = require_multipleOf(); + var limitLength_1 = require_limitLength(); + var pattern_1 = require_pattern2(); + var limitProperties_1 = require_limitProperties(); + var required_1 = require_required2(); + var limitItems_1 = require_limitItems(); + var uniqueItems_1 = require_uniqueItems(); + var const_1 = require_const(); + var enum_1 = require_enum2(); + var validation = [ + // number + limitNumber_1.default, + limitNumberExclusive_1.default, + multipleOf_1.default, + // string + limitLength_1.default, + pattern_1.default, + // object + limitProperties_1.default, + required_1.default, + // array + limitItems_1.default, + uniqueItems_1.default, + // any + { keyword: "type", schemaType: ["string", "array"] }, + { keyword: "nullable", schemaType: "boolean" }, + const_1.default, + enum_1.default + ]; + exports28.default = validation; + } +}); + +// node_modules/ajv-draft-04/dist/vocabulary/draft4.js +var require_draft4 = __commonJS({ + "node_modules/ajv-draft-04/dist/vocabulary/draft4.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var core_1 = require_core4(); + var validation_1 = require_validation3(); + var applicator_1 = require_applicator(); + var format_1 = require_format2(); + var metadataVocabulary = ["title", "description", "default"]; + var draft4Vocabularies = [ + core_1.default, + validation_1.default, + applicator_1.default(), + format_1.default, + metadataVocabulary + ]; + exports28.default = draft4Vocabularies; + } +}); + +// node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json +var require_json_schema_draft_04 = __commonJS({ + "node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json"(exports28, module5) { + module5.exports = { + id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-04/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string", + format: "uri" + }, + $schema: { + type: "string", + format: "uri" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: {}, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [{ type: "boolean" }, { $ref: "#" }], + default: {} + }, + items: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], + default: {} + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [{ type: "boolean" }, { $ref: "#" }], + default: {} + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + dependencies: { + exclusiveMaximum: ["maximum"], + exclusiveMinimum: ["minimum"] + }, + default: {} + }; + } +}); + +// node_modules/ajv-draft-04/dist/index.js +var require_dist = __commonJS({ + "node_modules/ajv-draft-04/dist/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.CodeGen = exports28.Name = exports28.nil = exports28.stringify = exports28.str = exports28._ = exports28.KeywordCxt = void 0; + var core_1 = require_core(); + var draft4_1 = require_draft4(); + var discriminator_1 = require_discriminator(); + var draft4MetaSchema = require_json_schema_draft_04(); + var META_SUPPORT_DATA = ["/properties"]; + var META_SCHEMA_ID = "http://json-schema.org/draft-04/schema"; + var Ajv7 = class extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + schemaId: "id" + }); + } + _addVocabularies() { + super._addVocabularies(); + draft4_1.default.forEach((v8) => this.addVocabulary(v8)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft4MetaSchema, META_SUPPORT_DATA) : draft4MetaSchema; + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); + } + }; + module5.exports = exports28 = Ajv7; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.default = Ajv7; + var core_2 = require_core(); + Object.defineProperty(exports28, "KeywordCxt", { enumerable: true, get: function() { + return core_2.KeywordCxt; + } }); + var core_3 = require_core(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return core_3._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return core_3.str; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return core_3.stringify; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return core_3.nil; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return core_3.Name; + } }); + Object.defineProperty(exports28, "CodeGen", { enumerable: true, get: function() { + return core_3.CodeGen; + } }); + } +}); + +// node_modules/@asyncapi/parser/browser/index.js +var browser_exports = {}; +__export(browser_exports, { + Parser: () => Parser2, + default: () => browser_default +}); +var module2, exports4, AsyncAPIParserExports, Parser2, browser_default; +var init_browser2 = __esm({ + "node_modules/@asyncapi/parser/browser/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + module2 = { exports: {} }; + exports4 = module2.exports; + !function(e10, t8) { + "object" == typeof exports4 && "object" == typeof module2 ? module2.exports = t8() : "function" == typeof define && define.amd ? define([], t8) : "object" == typeof exports4 ? exports4.AsyncAPIParser = t8() : e10.AsyncAPIParser = t8(); + }("undefined" != typeof self ? self : void 0, () => (() => { + var e10 = { 37233: (e11, t9, i8) => { + e11.exports = { schemas: { "2.0.0": i8(4023), "2.1.0": i8(88520), "2.2.0": i8(83105), "2.3.0": i8(11306), "2.4.0": i8(64939), "2.5.0": i8(55708), "2.6.0": i8(11669), "3.0.0": i8(64292), "3.1.0": i8(28243) }, schemasWithoutId: { "2.0.0": i8(69486), "2.1.0": i8(61401), "2.2.0": i8(30192), "2.3.0": i8(85323), "2.4.0": i8(45002), "2.5.0": i8(85765), "2.6.0": i8(94220), "3.0.0": i8(95309), "3.1.0": i8(88178) } }; + }, 64868: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(8839); + t9.resolveFile = function(e12) { + return new Promise((t10, i9) => { + const r8 = e12.href(); + n8.readFile(r8, "utf8", (e13, n9) => { + e13 ? i9(e13) : t10(n9); + }); + }); + }; + }, 71602: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(55478), r8 = i8(98203); + class o7 extends Error { + constructor() { + super(...arguments), this.name = "OpenError"; + } + } + t9.OpenError = o7; + class s7 extends Error { + constructor() { + super(...arguments), this.name = "ReadError"; + } + } + function a7(e12, t10 = {}) { + return n8.__awaiter(this, void 0, void 0, function* () { + const i9 = e12.href(), n9 = yield r8.default(i9, t10); + if (n9.ok) + return n9.text(); + if (404 === n9.status) + throw new o7(`Page not found: ${i9}`); + throw new s7(`${n9.status} ${n9.statusText}`); + }); + } + t9.NetworkError = s7, t9.resolveHttp = a7, t9.createResolveHttp = function(e12 = {}) { + return (t10) => a7(t10, e12); + }; + }, 54668: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(71602); + t9.createResolveHttp = n8.createResolveHttp, t9.resolveHttp = n8.resolveHttp, t9.NetworkError = n8.NetworkError, t9.OpenError = n8.OpenError; + var r8 = i8(64868); + t9.resolveFile = r8.resolveFile; + }, 30924: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Cache = void 0, t9.Cache = class { + constructor(e12 = {}) { + this._stats = { hits: 0, misses: 0 }, this._data = {}, this._stdTTL = e12.stdTTL; + } + get stats() { + return this._stats; + } + get(e12) { + const t10 = this._data[e12]; + if (t10 && (!this._stdTTL || (/* @__PURE__ */ new Date()).getTime() - t10.ts < this._stdTTL)) + return this._stats.hits += 1, t10.val; + this._stats.misses += 1; + } + set(e12, t10) { + this._data[e12] = { ts: (/* @__PURE__ */ new Date()).getTime(), val: t10 }; + } + has(e12) { + return e12 in this._data; + } + purge() { + Object.assign(this._stats, { hits: 0, misses: 0 }), this._data = {}; + } + }; + }, 91226: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.ResolveCrawler = void 0; + const n8 = i8(46734), r8 = i8(30524), o7 = i8(46123), s7 = i8(19899); + t9.ResolveCrawler = class { + constructor(e12, t10, i9) { + this._resolved = i9, this.resolvers = [], this.pointerGraph = new r8.DepGraph({ circular: true }), this.pointerStemGraph = new r8.DepGraph({ circular: true }), this.computeGraph = (e13, t11 = [], i10 = "#", n9 = []) => { + i10 || (i10 = "#"); + let r9 = this._runner.computeRef({ val: e13, jsonPointer: i10, pointerStack: n9 }); + if (void 0 !== r9) + this._resolveRef({ ref: r9, val: e13, parentPath: t11, pointerStack: n9, parentPointer: i10, cacheKey: i10, resolvingPointer: this.jsonPointer }); + else if ("object" == typeof e13) + for (const o8 in e13) { + if (!e13.hasOwnProperty(o8)) + continue; + const a7 = e13[o8], p7 = s7.addToJSONPointer(i10, o8); + r9 = this._runner.computeRef({ key: o8, val: a7, jsonPointer: p7, pointerStack: n9 }), t11.push(o8), void 0 !== r9 ? this._resolveRef({ ref: r9, val: a7, parentPath: t11, parentPointer: p7, pointerStack: n9, cacheKey: s7.uriToJSONPointer(r9), resolvingPointer: this.jsonPointer }) : "object" == typeof a7 && this.computeGraph(a7, t11, p7, n9), t11.pop(); + } + }, this._resolveRef = (e13) => { + const { pointerStack: t11, parentPath: i10, parentPointer: r9, ref: a7 } = e13; + if (s7.uriIsJSONPointer(a7)) { + if (this._runner.dereferenceInline) { + const e14 = s7.uriToJSONPointer(a7); + let p7; + try { + p7 = (0, n8.pointerToPath)(e14); + } catch (e15) { + return void this._resolved.errors.push({ code: "PARSE_POINTER", message: `'${a7}' JSON pointer is invalid`, uri: this._runner.baseUri, uriStack: this._runner.uriStack, pointerStack: [], path: [] }); + } + let c7 = p7.length > 0; + for (const e15 in p7) + if (i10[e15] !== p7[e15]) { + c7 = false; + break; + } + if (c7) + return; + this.pointerStemGraph.hasNode(e14) || this.pointerStemGraph.addNode(e14); + let d7 = "#", f8 = ""; + for (let t12 = 0; t12 < i10.length; t12++) { + const n9 = i10[t12]; + if (n9 === p7[t12]) + d7 += `/${n9}`; + else { + f8 += `/${n9}`; + const t13 = `${d7}${f8}`; + t13 !== r9 && t13 !== e14 && (this.pointerStemGraph.hasNode(t13) || this.pointerStemGraph.addNode(t13), this.pointerStemGraph.addDependency(t13, e14)); + } + } + this.pointerGraph.hasNode(r9) || this.pointerGraph.addNode(r9), this.pointerGraph.hasNode(e14) || this.pointerGraph.addNode(e14); + const l7 = `${this._runner.baseUri.toString()}${e14}`; + this._runner.graph.hasNode(l7) || this._runner.graph.addNode(l7, { refMap: {} }), this._runner.root !== l7 && this._runner.graph.addDependency(this._runner.root, l7), this.pointerGraph.addDependency(r9, e14), this.jsonPointer && (t11.length < 2 || !t11.includes(e14)) && (t11.push(e14), this.computeGraph(o7(this._runner.source, p7), p7, e14, t11), t11.pop()); + } + } else { + const t12 = a7.toString(); + this._runner.graph.hasNode(t12) || this._runner.graph.addNode(t12, { refMap: {} }), this._runner.root !== t12 && this._runner.graph.addDependency(this._runner.root, t12), this._runner.dereferenceRemote && !this._runner.atMaxUriDepth() && this.resolvers.push(this._runner.lookupAndResolveUri(e13)); + } + }, this.jsonPointer = t10, this._runner = e12; + } + }; + }, 16586: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.defaultGetRef = t9.Cache = void 0, i8(70824).__exportStar(i8(65582), t9); + var n8 = i8(30924); + Object.defineProperty(t9, "Cache", { enumerable: true, get: function() { + return n8.Cache; + } }); + var r8 = i8(49850); + Object.defineProperty(t9, "defaultGetRef", { enumerable: true, get: function() { + return r8.defaultGetRef; + } }); + }, 65582: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Resolver = void 0; + const n8 = i8(30524), r8 = i8(30924), o7 = i8(49850); + t9.Resolver = class { + constructor(e12 = {}) { + this.ctx = {}, this.uriCache = e12.uriCache || new r8.Cache(), this.resolvers = e12.resolvers || {}, this.getRef = e12.getRef, this.transformRef = e12.transformRef, this.dereferenceInline = void 0 === e12.dereferenceInline || e12.dereferenceInline, this.dereferenceRemote = void 0 === e12.dereferenceRemote || e12.dereferenceRemote, this.parseResolveResult = e12.parseResolveResult, this.transformDereferenceResult = e12.transformDereferenceResult, this.ctx = e12.ctx; + } + resolve(e12, t10 = {}) { + const i9 = new n8.DepGraph({ circular: true }); + return new o7.ResolveRunner(e12, i9, Object.assign(Object.assign({ uriCache: this.uriCache, resolvers: this.resolvers, getRef: this.getRef, transformRef: this.transformRef, dereferenceInline: this.dereferenceInline, dereferenceRemote: this.dereferenceRemote, parseResolveResult: this.parseResolveResult, transformDereferenceResult: this.transformDereferenceResult }, t10), { ctx: Object.assign({}, this.ctx || {}, t10.ctx || {}) })).resolve(t10); + } + }; + }, 49850: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.ResolveRunner = t9.defaultGetRef = void 0; + const n8 = i8(70824), r8 = i8(46734), o7 = i8(98136), s7 = i8(30524), a7 = i8(79725), p7 = i8(46123), c7 = i8(41263), d7 = i8(99472), f8 = i8(99960), l7 = i8(30924), u7 = i8(91226), m7 = i8(19899), h8 = i8(2940); + let y7 = 0; + t9.defaultGetRef = (e12, t10) => { + if (t10 && "object" == typeof t10 && "string" == typeof t10.$ref) + return t10.$ref; + }; + class g7 { + constructor(e12, i9 = new s7.DepGraph({ circular: true }), a8 = {}) { + this.ctx = {}, this.computeRef = (e13) => { + const t10 = this.getRef(e13.key, e13.val); + if (void 0 === t10) + return; + let i10 = new f8.ExtendedURI(t10); + if ("#" !== t10[0]) + if (this.isFile(i10)) { + let e14 = i10.toString(); + i10.is("absolute") || (e14 = this.baseUri.toString() ? (0, o7.join)((0, o7.dirname)(this.baseUri.toString()), (0, o7.stripRoot)(e14)) : ""), e14 && (i10 = new d7((0, o7.toFSPath)(e14)).fragment(i10.fragment())); + } else + (i10.scheme().includes("http") || "" === i10.scheme() && this.baseUri.scheme().includes("http")) && "" !== this.baseUri.authority() && "" === i10.authority() && (i10 = i10.absoluteTo(this.baseUri)); + return String(i10).length > 0 && this.isFile(this.baseUri) && this.isFile(i10) && this.baseUri.path() === i10.path() && (i10 = new f8.ExtendedURI(`#${i10.fragment()}`)), this.transformRef ? this.transformRef(Object.assign(Object.assign({}, e13), { ref: i10, uri: this.baseUri }), this.ctx) : i10; + }, this.atMaxUriDepth = () => this.uriStack.length >= 100, this.lookupUri = (e13) => n8.__awaiter(this, void 0, void 0, function* () { + const { ref: t10 } = e13; + let i10 = t10.scheme(); + !this.resolvers[i10] && this.isFile(t10) && (i10 = "file"); + const n9 = this.resolvers[i10]; + if (!n9) + throw new Error(`No resolver defined for scheme '${t10.scheme() || "file"}' in ref ${t10.toString()}`); + let r9 = yield n9.resolve(t10, this.ctx); + if (this.parseResolveResult) + try { + r9 = (yield this.parseResolveResult({ uriResult: r9, result: r9, targetAuthority: t10, parentAuthority: this.baseUri, parentPath: e13.parentPath, fragment: e13.fragment })).result; + } catch (e14) { + throw new Error(`Could not parse remote reference response for '${t10.toString()}' - ${String(e14)}`); + } + return new g7(r9, this.graph, { depth: this.depth + 1, baseUri: t10.toString(), root: t10, uriStack: this.uriStack, uriCache: this.uriCache, resolvers: this.resolvers, transformRef: this.transformRef, parseResolveResult: this.parseResolveResult, transformDereferenceResult: this.transformDereferenceResult, dereferenceRemote: this.dereferenceRemote, dereferenceInline: this.dereferenceInline, ctx: this.ctx }); + }), this.lookupAndResolveUri = (e13) => n8.__awaiter(this, void 0, void 0, function* () { + const { val: t10, ref: i10, resolvingPointer: n9, parentPointer: o8, pointerStack: s8 } = e13, a9 = e13.parentPath ? e13.parentPath.slice() : [], p9 = this.computeUriCacheKey(i10), d8 = { uri: i10, pointerStack: s8, targetPath: n9 === o8 ? [] : a9 }; + if (this.uriStack.includes(p9)) + return d8.resolved = { result: t10, graph: this.graph, refMap: {}, errors: [], runner: this }, d8; + { + let e14; + const n10 = this.baseUri.toString(), o9 = n10 && 0 !== this.depth ? n10 : null; + try { + if (this.atMaxUriDepth()) + throw new Error(`Max uri depth (${this.uriStack.length}) reached. Halting, this is probably a circular loop.`); + e14 = yield this.lookupUri({ ref: i10.clone().fragment(""), fragment: i10.fragment(), cacheKey: p9, parentPath: a9 }), o9 && (e14.uriStack = e14.uriStack.concat(o9)); + } catch (e15) { + d8.error = { code: "RESOLVE_URI", message: String(e15), uri: i10, uriStack: o9 ? this.uriStack.concat(o9) : this.uriStack, pointerStack: s8, path: a9 }; + } + if (e14 && (d8.resolved = yield e14.resolve({ jsonPointer: m7.uriToJSONPointer(i10), parentPath: a9 }), d8.resolved.errors.length)) { + for (const e15 of d8.resolved.errors) + if ("POINTER_MISSING" === e15.code && e15.path.join("/") === i10.fragment().slice(1)) { + const n11 = i10.fragment ? (0, r8.trimStart)(e15.path, (0, r8.trimStart)(i10.fragment(), "/").split("/")) : e15.path; + n11 && n11.length ? c7(d8.resolved.result, n11, t10) : d8.resolved.result && (d8.resolved.result = t10); + } + } + } + return d8; + }), this.id = y7 += 1, this.depth = a8.depth || 0, this._source = e12, this.resolvers = a8.resolvers || {}; + const p8 = a8.baseUri || ""; + let u8 = new d7(p8 || ""); + this.isFile(u8) && (u8 = new d7((0, o7.toFSPath)(p8))), this.baseUri = u8, this.uriStack = a8.uriStack || [], this.uriCache = a8.uriCache || new l7.Cache(), this.root = a8.root && a8.root.toString() || this.baseUri.toString() || "root", this.graph = i9, this.graph.hasNode(this.root) || this.graph.addNode(this.root, { refMap: {}, data: this._source }), this.baseUri && 0 === this.depth && this.uriCache.set(this.computeUriCacheKey(this.baseUri), this), this.getRef = a8.getRef || t9.defaultGetRef, this.transformRef = a8.transformRef, this.depth ? this.dereferenceInline = true : this.dereferenceInline = void 0 === a8.dereferenceInline || a8.dereferenceInline, this.dereferenceRemote = void 0 === a8.dereferenceRemote || a8.dereferenceRemote, this.parseResolveResult = a8.parseResolveResult, this.transformDereferenceResult = a8.transformDereferenceResult, this.ctx = a8.ctx, this.lookupUri = h8(this.lookupUri, { serializer: this._cacheKeySerializer, cache: { create: () => this.uriCache } }); + } + get source() { + return this._source; + } + resolve(e12) { + return n8.__awaiter(this, void 0, void 0, function* () { + const t10 = { result: this.source, graph: this.graph, refMap: {}, errors: [], runner: this }; + let i9; + const n9 = e12 && e12.jsonPointer && e12.jsonPointer.trim(); + if (n9 && "#" !== n9 && "#/" !== n9) { + try { + i9 = (0, r8.pointerToPath)(n9); + } catch (e13) { + return t10.errors.push({ code: "PARSE_POINTER", message: `'${n9}' JSON pointer is invalid`, uri: this.baseUri, uriStack: this.uriStack, pointerStack: [], path: [] }), t10; + } + t10.result = p7(t10.result, i9); + } + if (void 0 === t10.result) + return t10.errors.push({ code: "POINTER_MISSING", message: `'${n9}' does not exist @ '${this.baseUri.toString()}'`, uri: this.baseUri, uriStack: this.uriStack, pointerStack: [], path: i9 || [] }), t10; + const o8 = new u7.ResolveCrawler(this, n9, t10); + o8.computeGraph(t10.result, i9, n9 || ""); + let s8 = []; + if (o8.resolvers.length && (s8 = yield Promise.all(o8.resolvers)), s8.length) + for (const e13 of s8) { + let n10 = e13.targetPath; + n10.length || (n10 = i9 || []), t10.refMap[String(this.baseUri.clone().fragment((0, r8.pathToPointer)(n10)))] = String(e13.uri), this._setGraphNodeEdge(String(this.root), (0, r8.pathToPointer)(n10), String(e13.uri)), e13.error && t10.errors.push(e13.error), e13.resolved && (e13.resolved.errors && (t10.errors = t10.errors.concat(e13.resolved.errors)), void 0 !== e13.resolved.result && (this._source = (0, a7.default)(this._source, (t11) => { + if (e13.resolved) { + if (!n10.length) + return e13.resolved.result; + c7(t11, n10, e13.resolved.result), this._setGraphNodeData(String(e13.uri), e13.resolved.result); + } + }))); + } + if ("object" == typeof this._source ? (this.dereferenceInline && (this._source = (0, a7.default)(this._source, (e13) => { + let i10 = []; + try { + i10 = o8.pointerGraph.overallOrder(); + for (const n10 of i10) { + const i11 = o8.pointerGraph.dependantsOf(n10); + if (!i11.length) + continue; + const s9 = (0, r8.pointerToPath)(n10), d8 = 0 === s9.length ? (0, a7.original)(e13) : p7(e13, s9); + for (const a8 of i11) { + let i12; + const p8 = (0, r8.pointerToPath)(a8), f9 = o8.pointerStemGraph.dependenciesOf(n10); + for (const e14 of f9) + if ((0, r8.startsWith)(p8, (0, r8.pointerToPath)(e14))) { + i12 = true; + break; + } + i12 || (t10.refMap[(0, r8.pathToPointer)(p8)] = (0, r8.pathToPointer)(s9), this._setGraphNodeEdge(this.root, (0, r8.pathToPointer)(p8), (0, r8.pathToPointer)(s9)), void 0 !== d8 ? (c7(e13, p8, d8), this._setGraphNodeData((0, r8.pathToPointer)(s9), d8)) : t10.errors.push({ code: "POINTER_MISSING", message: `'${n10}' does not exist`, path: p8, uri: this.baseUri, uriStack: this.uriStack, pointerStack: [] })); + } + } + } catch (e14) { + } + })), t10.result = i9 ? p7(this._source, i9) : this._source) : t10.result = this._source, this.transformDereferenceResult) { + const r9 = new d7(n9 || ""); + try { + const { result: i10, error: n10 } = yield this.transformDereferenceResult({ source: this.source, result: t10.result, targetAuthority: r9, parentAuthority: this.baseUri, parentPath: e12 && e12.parentPath || [], fragment: r9.fragment() }); + if (t10.result = i10, n10) + throw new Error(`Could not transform dereferenced result for '${r9.toString()}' - ${String(n10)}`); + } catch (e13) { + t10.errors.push({ code: "TRANSFORM_DEREFERENCED", message: `Error: Could not transform dereferenced result for '${this.baseUri.toString()}${"" !== r9.fragment() ? `#${r9.fragment()}` : ""}' - ${String(e13)}`, uri: r9, uriStack: this.uriStack, pointerStack: [], path: i9 }); + } + } + return this._setGraphNodeData(this.root, this._source), t10; + }); + } + _cacheKeySerializer(e12) { + return e12 && "object" == typeof e12 && e12.cacheKey ? e12.cacheKey : JSON.stringify(arguments); + } + computeUriCacheKey(e12) { + return e12.clone().fragment("").toString(); + } + isFile(e12) { + const t10 = e12.scheme(); + if ("file" === t10) + return true; + if (t10) { + if (!this.resolvers[t10]) + return true; + } else { + if ("/" === e12.toString().charAt(0)) + return true; + if (this.baseUri) { + const e13 = this.baseUri.scheme(); + return Boolean(!e13 || "file" === e13 || !this.resolvers[e13]); + } + } + return false; + } + _setGraphNodeData(e12, t10) { + if (!this.graph.hasNode(e12)) + return; + const i9 = this.graph.getNodeData(e12) || {}; + i9.data = t10, this.graph.setNodeData(e12, i9); + } + _setGraphNodeEdge(e12, t10, i9) { + if (!this.graph.hasNode(e12)) + return; + const n9 = this.graph.getNodeData(e12) || {}; + n9.refMap = n9.refMap || {}, n9.refMap[t10] = i9, this.graph.setNodeData(e12, n9); + } + } + t9.ResolveRunner = g7; + }, 99960: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.ExtendedURI = void 0; + const n8 = i8(99472); + t9.ExtendedURI = class extends n8 { + constructor(e12) { + super(e12), this._value = e12.trim(); + } + get length() { + return this._value.length; + } + }; + }, 19899: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.uriIsJSONPointer = t9.uriToJSONPointer = t9.addToJSONPointer = void 0; + const i8 = (e12, t10, i9) => { + const n8 = e12.toString(); + let r8 = "", o7 = n8, s7 = 0, a7 = o7.indexOf(t10); + for (; a7 > -1; ) + r8 += n8.substring(s7, s7 + a7) + i9, o7 = o7.substring(a7 + t10.length, o7.length), s7 += a7 + t10.length, a7 = o7.indexOf(t10); + return o7.length > 0 && (r8 += n8.substring(n8.length - o7.length, n8.length)), r8; + }; + t9.addToJSONPointer = (e12, t10) => { + return `${e12}/${n8 = t10, i8(i8(n8, "~", "~0"), "/", "~1")}`; + var n8; + }, t9.uriToJSONPointer = (e12) => "length" in e12 && 0 === e12.length ? "" : "" !== e12.fragment() ? `#${e12.fragment()}` : "" === e12.href() ? "#" : "", t9.uriIsJSONPointer = (e12) => (!("length" in e12) || e12.length > 0) && "" === e12.path(); + }, 46734: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { BUNDLE_ROOT: () => J5, ERRORS_ROOT: () => Z5, KEYS: () => Pe2, bundleTarget: () => Y6, decodePointer: () => V5, decodePointerFragment: () => ee4, decodePointerUriFragment: () => V5, decycle: () => te4, encodePointer: () => ie3, encodePointerFragment: () => I6, encodePointerUriFragment: () => k6, encodeUriPointer: () => q5, extractPointerFromRef: () => ne4, extractSourceFromRef: () => Q5, getFirstPrimitiveProperty: () => re4, getJsonPathForPosition: () => oe4, getLastPathSegment: () => se4, getLocationForJsonPath: () => ae4, hasRef: () => O7, isExternalRef: () => B6, isLocalRef: () => T6, isPlainObject: () => _6, parseTree: () => ce4, parseWithPointers: () => pe4, pathToPointer: () => M6, pointerToPath: () => N6, remapRefs: () => z6, renameObjectKey: () => ue4, reparentBundleTarget: () => he4, resolveExternalRef: () => ge4, resolveExternalRefWithLocation: () => be4, resolveInlineRef: () => G5, resolveInlineRefWithLocation: () => W5, safeParse: () => ve4, safeStringify: () => $e2, startsWith: () => xe2, stringify: () => _e2, toPropertyPath: () => we4, trapAccess: () => Te, traverse: () => L6, trimStart: () => Ae4 }); + var n8, r8 = i8(45250), o7 = i8(98136); + function s7(e12, t10) { + void 0 === t10 && (t10 = false); + var i9 = e12.length, n9 = 0, r9 = "", o8 = 0, s8 = 16, d8 = 0, f9 = 0, l8 = 0, u8 = 0, m8 = 0; + function h9(t11, i10) { + for (var r10 = 0, o9 = 0; r10 < t11 || !i10; ) { + var s9 = e12.charCodeAt(n9); + if (s9 >= 48 && s9 <= 57) + o9 = 16 * o9 + s9 - 48; + else if (s9 >= 65 && s9 <= 70) + o9 = 16 * o9 + s9 - 65 + 10; + else { + if (!(s9 >= 97 && s9 <= 102)) + break; + o9 = 16 * o9 + s9 - 97 + 10; + } + n9++, r10++; + } + return r10 < t11 && (o9 = -1), o9; + } + function y8() { + if (r9 = "", m8 = 0, o8 = n9, f9 = d8, u8 = l8, n9 >= i9) + return o8 = i9, s8 = 17; + var t11 = e12.charCodeAt(n9); + if (a7(t11)) { + do { + n9++, r9 += String.fromCharCode(t11), t11 = e12.charCodeAt(n9); + } while (a7(t11)); + return s8 = 15; + } + if (p7(t11)) + return n9++, r9 += String.fromCharCode(t11), 13 === t11 && 10 === e12.charCodeAt(n9) && (n9++, r9 += "\n"), d8++, l8 = n9, s8 = 14; + switch (t11) { + case 123: + return n9++, s8 = 1; + case 125: + return n9++, s8 = 2; + case 91: + return n9++, s8 = 3; + case 93: + return n9++, s8 = 4; + case 58: + return n9++, s8 = 6; + case 44: + return n9++, s8 = 5; + case 34: + return n9++, r9 = function() { + for (var t12 = "", r10 = n9; ; ) { + if (n9 >= i9) { + t12 += e12.substring(r10, n9), m8 = 2; + break; + } + var o9 = e12.charCodeAt(n9); + if (34 === o9) { + t12 += e12.substring(r10, n9), n9++; + break; + } + if (92 !== o9) { + if (o9 >= 0 && o9 <= 31) { + if (p7(o9)) { + t12 += e12.substring(r10, n9), m8 = 2; + break; + } + m8 = 6; + } + n9++; + } else { + if (t12 += e12.substring(r10, n9), ++n9 >= i9) { + m8 = 2; + break; + } + switch (e12.charCodeAt(n9++)) { + case 34: + t12 += '"'; + break; + case 92: + t12 += "\\"; + break; + case 47: + t12 += "/"; + break; + case 98: + t12 += "\b"; + break; + case 102: + t12 += "\f"; + break; + case 110: + t12 += "\n"; + break; + case 114: + t12 += "\r"; + break; + case 116: + t12 += " "; + break; + case 117: + var s9 = h9(4, true); + s9 >= 0 ? t12 += String.fromCharCode(s9) : m8 = 4; + break; + default: + m8 = 5; + } + r10 = n9; + } + } + return t12; + }(), s8 = 10; + case 47: + var y9 = n9 - 1; + if (47 === e12.charCodeAt(n9 + 1)) { + for (n9 += 2; n9 < i9 && !p7(e12.charCodeAt(n9)); ) + n9++; + return r9 = e12.substring(y9, n9), s8 = 12; + } + if (42 === e12.charCodeAt(n9 + 1)) { + n9 += 2; + for (var b9 = i9 - 1, v9 = false; n9 < b9; ) { + var j7 = e12.charCodeAt(n9); + if (42 === j7 && 47 === e12.charCodeAt(n9 + 1)) { + n9 += 2, v9 = true; + break; + } + n9++, p7(j7) && (13 === j7 && 10 === e12.charCodeAt(n9) && n9++, d8++, l8 = n9); + } + return v9 || (n9++, m8 = 1), r9 = e12.substring(y9, n9), s8 = 13; + } + return r9 += String.fromCharCode(t11), n9++, s8 = 16; + case 45: + if (r9 += String.fromCharCode(t11), ++n9 === i9 || !c7(e12.charCodeAt(n9))) + return s8 = 16; + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return r9 += function() { + var t12 = n9; + if (48 === e12.charCodeAt(n9)) + n9++; + else + for (n9++; n9 < e12.length && c7(e12.charCodeAt(n9)); ) + n9++; + if (n9 < e12.length && 46 === e12.charCodeAt(n9)) { + if (!(++n9 < e12.length && c7(e12.charCodeAt(n9)))) + return m8 = 3, e12.substring(t12, n9); + for (n9++; n9 < e12.length && c7(e12.charCodeAt(n9)); ) + n9++; + } + var i10 = n9; + if (n9 < e12.length && (69 === e12.charCodeAt(n9) || 101 === e12.charCodeAt(n9))) + if ((++n9 < e12.length && 43 === e12.charCodeAt(n9) || 45 === e12.charCodeAt(n9)) && n9++, n9 < e12.length && c7(e12.charCodeAt(n9))) { + for (n9++; n9 < e12.length && c7(e12.charCodeAt(n9)); ) + n9++; + i10 = n9; + } else + m8 = 3; + return e12.substring(t12, i10); + }(), s8 = 11; + default: + for (; n9 < i9 && g8(t11); ) + n9++, t11 = e12.charCodeAt(n9); + if (o8 !== n9) { + switch (r9 = e12.substring(o8, n9)) { + case "true": + return s8 = 8; + case "false": + return s8 = 9; + case "null": + return s8 = 7; + } + return s8 = 16; + } + return r9 += String.fromCharCode(t11), n9++, s8 = 16; + } + } + function g8(e13) { + if (a7(e13) || p7(e13)) + return false; + switch (e13) { + case 125: + case 93: + case 123: + case 91: + case 34: + case 58: + case 44: + case 47: + return false; + } + return true; + } + return { setPosition: function(e13) { + n9 = e13, r9 = "", o8 = 0, s8 = 16, m8 = 0; + }, getPosition: function() { + return n9; + }, scan: t10 ? function() { + var e13; + do { + e13 = y8(); + } while (e13 >= 12 && e13 <= 15); + return e13; + } : y8, getToken: function() { + return s8; + }, getTokenValue: function() { + return r9; + }, getTokenOffset: function() { + return o8; + }, getTokenLength: function() { + return n9 - o8; + }, getTokenStartLine: function() { + return f9; + }, getTokenStartCharacter: function() { + return o8 - u8; + }, getTokenError: function() { + return m8; + } }; + } + function a7(e12) { + return 32 === e12 || 9 === e12 || 11 === e12 || 12 === e12 || 160 === e12 || 5760 === e12 || e12 >= 8192 && e12 <= 8203 || 8239 === e12 || 8287 === e12 || 12288 === e12 || 65279 === e12; + } + function p7(e12) { + return 10 === e12 || 13 === e12 || 8232 === e12 || 8233 === e12; + } + function c7(e12) { + return e12 >= 48 && e12 <= 57; + } + !function(e12) { + e12.DEFAULT = { allowTrailingComma: false }; + }(n8 || (n8 = {})); + var d7 = s7, f8 = function e12(t10, i9, n9) { + if (void 0 === n9 && (n9 = false), function(e13, t11, i10) { + return void 0 === i10 && (i10 = false), t11 >= e13.offset && t11 < e13.offset + e13.length || i10 && t11 === e13.offset + e13.length; + }(t10, i9, n9)) { + var r9 = t10.children; + if (Array.isArray(r9)) + for (var o8 = 0; o8 < r9.length && r9[o8].offset <= i9; o8++) { + var s8 = e12(r9[o8], i9, n9); + if (s8) + return s8; + } + return t10; + } + }, l7 = function e12(t10) { + if (!t10.parent || !t10.parent.children) + return []; + var i9 = e12(t10.parent); + if ("property" === t10.parent.type) { + var n9 = t10.parent.children[0].value; + i9.push(n9); + } else if ("array" === t10.parent.type) { + var r9 = t10.parent.children.indexOf(t10); + -1 !== r9 && i9.push(r9); + } + return i9; + }, u7 = function(e12, t10, i9) { + void 0 === i9 && (i9 = n8.DEFAULT); + var r9 = s7(e12, false); + function o8(e13) { + return e13 ? function() { + return e13(r9.getTokenOffset(), r9.getTokenLength(), r9.getTokenStartLine(), r9.getTokenStartCharacter()); + } : function() { + return true; + }; + } + function a8(e13) { + return e13 ? function(t11) { + return e13(t11, r9.getTokenOffset(), r9.getTokenLength(), r9.getTokenStartLine(), r9.getTokenStartCharacter()); + } : function() { + return true; + }; + } + var p8 = o8(t10.onObjectBegin), c8 = a8(t10.onObjectProperty), d8 = o8(t10.onObjectEnd), f9 = o8(t10.onArrayBegin), l8 = o8(t10.onArrayEnd), u8 = a8(t10.onLiteralValue), m8 = a8(t10.onSeparator), h9 = o8(t10.onComment), y8 = a8(t10.onError), g8 = i9 && i9.disallowComments, b9 = i9 && i9.allowTrailingComma; + function v9() { + for (; ; ) { + var e13 = r9.scan(); + switch (r9.getTokenError()) { + case 4: + j7(14); + break; + case 5: + j7(15); + break; + case 3: + j7(13); + break; + case 1: + g8 || j7(11); + break; + case 2: + j7(12); + break; + case 6: + j7(16); + } + switch (e13) { + case 12: + case 13: + g8 ? j7(10) : h9(); + break; + case 16: + j7(1); + break; + case 15: + case 14: + break; + default: + return e13; + } + } + } + function j7(e13, t11, i10) { + if (void 0 === t11 && (t11 = []), void 0 === i10 && (i10 = []), y8(e13), t11.length + i10.length > 0) + for (var n9 = r9.getToken(); 17 !== n9; ) { + if (-1 !== t11.indexOf(n9)) { + v9(); + break; + } + if (-1 !== i10.indexOf(n9)) + break; + n9 = v9(); + } + } + function $6(e13) { + var t11 = r9.getTokenValue(); + return e13 ? u8(t11) : c8(t11), v9(), true; + } + return v9(), 17 === r9.getToken() ? !!i9.allowEmptyContent || (j7(4, [], []), false) : function e13() { + switch (r9.getToken()) { + case 3: + return function() { + f9(), v9(); + for (var t11 = false; 4 !== r9.getToken() && 17 !== r9.getToken(); ) { + if (5 === r9.getToken()) { + if (t11 || j7(4, [], []), m8(","), v9(), 4 === r9.getToken() && b9) + break; + } else + t11 && j7(6, [], []); + e13() || j7(4, [], [4, 5]), t11 = true; + } + return l8(), 4 !== r9.getToken() ? j7(8, [4], []) : v9(), true; + }(); + case 1: + return function() { + p8(), v9(); + for (var t11 = false; 2 !== r9.getToken() && 17 !== r9.getToken(); ) { + if (5 === r9.getToken()) { + if (t11 || j7(4, [], []), m8(","), v9(), 2 === r9.getToken() && b9) + break; + } else + t11 && j7(6, [], []); + (10 !== r9.getToken() ? (j7(3, [], [2, 5]), 0) : ($6(false), 6 === r9.getToken() ? (m8(":"), v9(), e13() || j7(4, [], [2, 5])) : j7(5, [], [2, 5]), 1)) || j7(4, [], [2, 5]), t11 = true; + } + return d8(), 2 !== r9.getToken() ? j7(7, [2], []) : v9(), true; + }(); + case 10: + return $6(true); + default: + return function() { + switch (r9.getToken()) { + case 11: + var e14 = 0; + try { + "number" != typeof (e14 = JSON.parse(r9.getTokenValue())) && (j7(2), e14 = 0); + } catch (e15) { + j7(2); + } + u8(e14); + break; + case 7: + u8(null); + break; + case 8: + u8(true); + break; + case 9: + u8(false); + break; + default: + return false; + } + return v9(), true; + }(); + } + }() ? (17 !== r9.getToken() && j7(9, [], []), true) : (j7(4, [], []), false); + }; + function m7(e12) { + switch (e12) { + case 1: + return "InvalidSymbol"; + case 2: + return "InvalidNumberFormat"; + case 3: + return "PropertyNameExpected"; + case 4: + return "ValueExpected"; + case 5: + return "ColonExpected"; + case 6: + return "CommaExpected"; + case 7: + return "CloseBraceExpected"; + case 8: + return "CloseBracketExpected"; + case 9: + return "EndOfFileExpected"; + case 10: + return "InvalidCommentToken"; + case 11: + return "UnexpectedEndOfComment"; + case 12: + return "UnexpectedEndOfString"; + case 13: + return "UnexpectedEndOfNumber"; + case 14: + return "InvalidUnicode"; + case 15: + return "InvalidEscapeCharacter"; + case 16: + return "InvalidCharacter"; + } + return ""; + } + const h8 = `__object_order_${Math.floor(Date.now() / 36e5)}__`, y7 = Symbol.for(h8), g7 = (String(y7), { defineProperty: (e12, t10, i9) => (!Object.prototype.hasOwnProperty.call(e12, t10) && y7 in e12 ? e12[y7].push(t10) : "value" in i9 && t10 === y7 && -1 === i9.value.lastIndexOf(y7) && i9.value.push(y7), Reflect.defineProperty(e12, t10, i9)), deleteProperty(e12, t10) { + const i9 = Object.prototype.hasOwnProperty.call(e12, t10), n9 = Reflect.deleteProperty(e12, t10); + if (n9 && i9 && y7 in e12) { + const i10 = e12[y7].indexOf(t10); + -1 !== i10 && e12[y7].splice(i10, 1); + } + return n9; + }, ownKeys: (e12) => y7 in e12 ? e12[y7] : Reflect.ownKeys(e12), set(e12, t10, i9) { + const n9 = Object.prototype.hasOwnProperty.call(e12, t10), r9 = Reflect.set(e12, t10, i9); + return r9 && !n9 && y7 in e12 && e12[y7].push(t10), r9; + } }); + function b8(e12, t10 = Reflect.ownKeys(e12)) { + "undefined" != typeof process && v8(process) && v8(process.env); + const i9 = new Proxy(e12, g7); + return function(e13, t11) { + y7 in e13 ? (e13[y7].length = 0, e13[y7].push(...t11)) : Reflect.defineProperty(e13, y7, { configurable: true, value: t11 }); + }(i9, t10), i9; + } + function v8(e12) { + return null !== e12 && "object" == typeof e12; + } + var j6 = i8(94169), $5 = i8(11145), x7 = i8.n($5); + function _6(e12) { + if ("object" != typeof e12 || null === e12) + return false; + const t10 = Object.getPrototypeOf(e12); + return null === t10 || t10 === Object.prototype || "function" == typeof e12.constructor && Function.toString.call(Object) === Function.toString.call(e12.constructor); + } + function w6(e12, t10, i9) { + if (!_6(e12) && !Array.isArray(e12) || !(t10 in e12)) + throw new ReferenceError(`Could not resolve '${i9}'`); + } + function S6(e12) { + if ("string" != typeof e12.$ref) + throw new TypeError("$ref should be a string"); + } + const P6 = (e12) => _6(e12) && "$ref" in e12, O7 = (e12) => P6(e12) && "string" == typeof e12.$ref, T6 = (e12) => e12.length > 0 && ("#" === e12 || /^#\S*$/.test(e12)), A6 = (e12, t10, i9) => { + const n9 = e12.toString(); + let r9 = "", o8 = n9, s8 = 0, a8 = o8.indexOf(t10); + for (; a8 > -1; ) + r9 += n9.substring(s8, s8 + a8) + i9, o8 = o8.substring(a8 + t10.length, o8.length), s8 += a8 + t10.length, a8 = o8.indexOf(t10); + return o8.length > 0 && (r9 += n9.substring(n9.length - o8.length, n9.length)), r9; + }, I6 = (e12) => "number" == typeof e12 ? e12 : A6(A6(e12, "~", "~0"), "/", "~1"), E6 = /[^a-zA–Z0–9_.!~*'()\/\-\u{D800}-\u{DFFF}]/gu; + function q5(e12) { + return e12.replace(E6, encodeURIComponent); + } + const k6 = (e12) => { + const t10 = I6(e12); + return "number" == typeof t10 ? t10 : q5(t10); + }, M6 = (e12) => R6(e12), R6 = (e12) => { + if (e12 && "object" != typeof e12) + throw new TypeError("Invalid type: path must be an array of segments."); + return 0 === e12.length ? "#" : `#/${e12.map(k6).join("/")}`; + }; + function D6(e12) { + try { + return decodeURIComponent(e12); + } catch (t10) { + return e12; + } + } + const C6 = /%[0-9a-f]+/gi, V5 = (e12) => { + let t10; + try { + t10 = decodeURIComponent(e12); + } catch (i9) { + t10 = e12.replace(C6, D6); + } + return A6(A6(t10, "~1", "/"), "~0", "~"); + }, N6 = (e12) => F6(e12), F6 = (e12) => { + if ("string" != typeof e12) + throw new TypeError("Invalid type: JSON Pointers are represented as strings."); + if (0 === e12.length || "#" !== e12[0]) + throw new URIError("Invalid JSON Pointer syntax; URI fragment identifiers must begin with a hash."); + if (1 === e12.length) + return []; + if ("/" !== e12[1]) + throw new URIError("Invalid JSON Pointer syntax."); + return ((e13) => { + const t10 = e13.length, i9 = []; + let n9 = -1; + for (; ++n9 < t10; ) + i9.push(V5(e13[n9])); + return i9; + })(e12.substring(2).split("/")); + }, U6 = (e12, t10, i9) => { + const n9 = { value: e12, path: i9 }; + t10.onEnter && t10.onEnter(n9); + for (const n10 of Object.keys(e12)) { + const r9 = e12[n10]; + t10.onProperty && t10.onProperty({ parent: e12, parentPath: i9, property: n10, propertyValue: r9 }), "object" == typeof r9 && null !== r9 && U6(r9, t10, i9.concat(n10)); + } + t10.onLeave && t10.onLeave(n9); + }, L6 = (e12, t10) => { + "object" == typeof e12 && null !== e12 && U6(e12, "function" == typeof t10 ? { onProperty: t10 } : t10, []); + }; + function z6(e12, t10, i9) { + L6(e12, { onProperty({ property: e13, propertyValue: n9, parent: r9 }) { + "$ref" === e13 && "string" == typeof n9 && n9.startsWith(t10) && (r9.$ref = `${i9}${n9.slice(t10.length)}`); + } }); + } + const B6 = (e12) => e12.length > 0 && "#" !== e12[0], Q5 = (e12) => { + if ("string" != typeof e12 || 0 === e12.length || !B6(e12)) + return null; + const t10 = e12.indexOf("#"); + return -1 === t10 ? e12 : e12.slice(0, t10); + }; + function K5(e12, t10) { + return _6(t10) && _6(e12) && ("summary" in e12 || "description" in e12) ? Object.assign(Object.assign(Object.assign({}, t10), "description" in e12 ? { description: e12.description } : null), "summary" in e12 ? { summary: e12.summary } : null) : t10; + } + function* H5(e12, t10, i9) { + P6(e12.value) && (S6(e12.value), yield [-1, e12.value]); + for (const [n9, r9] of t10.entries()) + w6(e12.value, r9, i9), e12.value = e12.value[r9], P6(e12.value) && (S6(e12.value), yield [n9, e12.value]); + } + function G5(e12, t10) { + return W5(e12, t10).value; + } + function W5(e12, t10) { + return function e13(t11, i9, n9, r9) { + if (null !== Q5(i9)) + throw new ReferenceError("Cannot resolve external references"); + const o8 = N6(i9); + let s8 = [...o8]; + "#" === i9 && P6(t11) && (S6(t11), o8.unshift(...N6(t11.$ref))); + const a8 = { value: t11 }; + for (const [p8, c8] of H5(a8, o8, i9)) { + if (n9.includes(c8)) + return { source: null, location: null != r9 ? r9 : s8, value: n9[n9.length - 1] }; + n9.push(c8); + const i10 = e13(t11, c8.$ref, n9, s8); + a8.value = i10.value, (s8 = i10.location).push(...o8.slice(p8 + 1)); + } + return { source: null, location: s8, value: n9.length > 0 ? K5(n9[n9.length - 1], a8.value) : a8.value }; + }(e12, t10, []); + } + const J5 = "#/__bundled__", Z5 = "#/__errors__", Y6 = ({ document: e12, path: t10, bundleRoot: i9 = "#/__bundled__", errorsRoot: n9 = "#/__errors__", cloneDocument: o8 = true, keyProvider: s8 }, a8) => { + if (t10 === i9 || t10 === n9) + throw new Error("Roots do not make any sense"); + const p8 = o8 ? (0, r8.cloneDeep)(e12) : e12; + return X5(p8, N6(i9), N6(n9), t10, s8)(t10, { [t10]: true }, a8); + }, X5 = (e12, t10, i9, n9, o8) => { + const s8 = /* @__PURE__ */ new Set(), a8 = (p8, c8, d8, f9 = {}, l8 = {}, u8 = {}) => { + const m8 = N6(p8), h9 = (0, r8.get)(e12, m8); + L6(d8 || h9, { onEnter: ({ value: i10 }) => { + if (O7(i10) && T6(i10.$ref)) { + const d9 = i10.$ref; + if (u8[d9]) + return; + if (d9 === p8 && (f9[d9] = "#"), f9[d9]) + return void (i10.$ref = f9[d9]); + let m9, h10, y9, g8, b9; + try { + let i11; + m9 = N6(d9), o8 && (i11 = o8({ document: e12, path: m9 })), i11 || (i11 = (({ document: e13, path: t11 }) => 0 === t11.length ? "root" : Array.isArray((0, r8.get)(e13, t11.slice(0, -1))) ? `${t11[t11.length - 2]}_${t11[t11.length - 1]}` : String(t11[t11.length - 1]))({ document: e12, path: m9 })), y9 = i11; + let n10 = 1; + for (; s8.has(y9); ) + if (y9 = `${i11}_${++n10}`, n10 > 20) + throw new Error(`Keys ${i11}_2 through ${i11}_20 already taken.`); + s8.add(y9), h10 = [...t10, y9], g8 = M6(h10); + } catch (e13) { + u8[d9] = e13 instanceof Error ? e13.message : String(e13); + } + if (!m9 || !h10 || !g8) + return; + if ("object" == typeof e12 && null !== e12 && !(b9 = (0, r8.get)(e12, m9))) + try { + b9 = G5(Object(e12), d9); + } catch (e13) { + } + void 0 !== b9 && (f9[d9] = g8, i10.$ref = g8, (0, r8.has)(l8, h10) || (Array.isArray(b9) ? (0, r8.set)(l8, h10, new Array(b9.length).fill(null)) : "object" == typeof b9 && (0, r8.setWith)(l8, h10, {}, Object), (0, r8.set)(l8, h10, b9), "#" === d9 ? function(e13, t11, i11, n10) { + const o9 = i11.map((e14) => `[${JSON.stringify(e14)}]`).join(""), s9 = JSON.parse(JSON.stringify((0, r8.omit)(Object(e13), o9))), a9 = {}; + (0, r8.set)(t11, n10, s9), (0, r8.set)(s9, i11, a9), z6(s9, "#", M6(n10)), a9.$ref = "#"; + }(e12, l8, N6(n9), h10) : c8[d9] || (c8[d9] = true, a8(p8, c8, b9, f9, l8, u8), c8[d9] = false))); + } + } }); + const y8 = (0, r8.get)(l8, t10); + return y8 && Object.keys(y8).length && (0, r8.set)(h9, t10, y8), (Object.keys(u8).length || (0, r8.has)(e12, i9)) && (0, r8.set)(h9, i9, (0, r8.has)(e12, i9) ? (0, r8.get)(e12, i9) : u8), h9; + }; + return a8; + }, ee4 = (e12) => A6(A6(e12, "~1", "/"), "~0", "~"), te4 = (e12, t10) => { + const i9 = /* @__PURE__ */ new WeakMap(); + return function e13(n9, r9) { + let o8; + if (t10 && (n9 = t10(n9)), _6(n9) || Array.isArray(n9)) { + const t11 = i9.get(n9); + return t11 ? { $ref: t11 } : (i9.set(n9, M6(r9)), Array.isArray(n9) ? o8 = n9.map((t12, i10) => e13(t12, [...r9, String(i10)])) : (o8 = {}, Object.keys(n9).forEach((t12) => { + o8[t12] = e13(n9[t12], [...r9, t12]); + })), i9.delete(n9), o8); + } + return n9; + }(e12, []); + }, ie3 = (e12) => A6(A6(e12, "~", "~0"), "//", "/~1"), ne4 = (e12) => { + if ("string" != typeof e12 || 0 === e12.length) + return null; + const t10 = e12.indexOf("#"); + return -1 === t10 ? null : e12.slice(t10); + }, re4 = (e12) => { + const t10 = d7(e12, true); + if (t10.scan(), 1 !== t10.getToken()) + return; + if (t10.scan(), 2 === t10.getToken()) + return; + if (10 !== t10.getToken()) + throw new SyntaxError("Unexpected character"); + const i9 = t10.getTokenValue(); + if (t10.scan(), 6 !== t10.getToken()) + throw new SyntaxError("Colon expected"); + switch (t10.scan(), t10.getToken()) { + case 10: + return [i9, t10.getTokenValue()]; + case 11: + return [i9, Number(t10.getTokenValue())]; + case 8: + return [i9, true]; + case 9: + return [i9, false]; + case 7: + return [i9, null]; + case 16: + throw new SyntaxError("Unexpected character"); + case 17: + throw new SyntaxError("Unexpected end of file"); + default: + return; + } + }, oe4 = ({ lineMap: e12, ast: t10 }, i9) => { + const n9 = e12[i9.line], r9 = e12[i9.line + 1]; + if (void 0 === n9) + return; + const o8 = f8(t10, void 0 === r9 ? n9 + i9.character : Math.min(r9, n9 + i9.character), true); + if (void 0 === o8) + return; + const s8 = l7(o8); + return 0 !== s8.length ? s8 : void 0; + }; + function se4(e12) { + return ee4(e12.split("/").pop() || ""); + } + const ae4 = ({ ast: e12 }, t10, i9 = false) => { + const n9 = function(e13, t11, i10) { + e: + for (const n10 of t11) { + const t12 = Number.isInteger(Number(n10)) ? Number(n10) : n10; + if ("string" == typeof t12 || "number" == typeof t12 && "array" !== e13.type) { + if ("object" !== e13.type || !Array.isArray(e13.children)) + return i10 ? e13 : void 0; + for (const i11 of e13.children) + if (Array.isArray(i11.children) && i11.children[0].value === String(t12) && 2 === i11.children.length) { + e13 = i11.children[1]; + continue e; + } + return i10 ? e13 : void 0; + } + if ("array" !== e13.type || t12 < 0 || !Array.isArray(e13.children) || t12 >= e13.children.length) + return i10 ? e13 : void 0; + e13 = e13.children[t12]; + } + return e13; + }(e12, t10, i9); + if (void 0 !== n9 && void 0 !== n9.range) + return { range: n9.range }; + }, pe4 = (e12, t10 = { disallowComments: true }) => { + const i9 = [], { ast: n9, data: r9, lineMap: o8 } = ce4(e12, i9, t10); + return { data: r9, diagnostics: i9, ast: n9, lineMap: o8 }; + }; + function ce4(e12, t10 = [], i9) { + const n9 = fe4(e12); + let r9 = { type: "array", offset: -1, length: -1, children: [], parent: void 0 }, o8 = null, s8 = []; + const a8 = /* @__PURE__ */ new WeakMap(), p8 = []; + function c8(e13) { + "property" === r9.type && (r9.length = e13 - r9.offset, r9 = r9.parent); + } + function d8(e13, t11, i10) { + return { start: { line: e13, character: t11 }, end: { line: e13, character: t11 + i10 } }; + } + function f9(e13) { + return r9.children.push(e13), e13; + } + function l8(e13) { + Array.isArray(s8) ? s8.push(e13) : null !== o8 && (s8[o8] = e13); + } + function h9(e13) { + l8(e13), p8.push(s8), s8 = e13, o8 = null; + } + function g8() { + s8 = p8.pop(); + } + u7(e12, { onObjectBegin: (e13, t11, n10, o9) => { + r9 = f9({ type: "object", offset: e13, length: -1, parent: r9, children: [], range: d8(n10, o9, t11) }), false === i9.ignoreDuplicateKeys && a8.set(r9, []), h9(function(e14) { + return e14 ? b8({}) : {}; + }(true === i9.preserveKeyOrder)); + }, onObjectProperty: (e13, n10, p9, c9, l9) => { + if ((r9 = f9({ type: "property", offset: n10, length: -1, parent: r9, children: [] })).children.push({ type: "string", value: e13, offset: n10, length: p9, parent: r9 }), false === i9.ignoreDuplicateKeys) { + const i10 = a8.get(r9.parent); + i10 && (0 !== i10.length && i10.includes(e13) ? t10.push({ range: d8(c9, l9, p9), message: "DuplicateKey", severity: j6.h_.Error, path: le4(r9), code: 20 }) : i10.push(e13)); + } + true === i9.preserveKeyOrder && function(e14, t11) { + if (!(t11 in e14)) + return; + const i10 = e14[y7], n11 = i10.indexOf(t11); + -1 !== n11 && (i10.splice(n11, 1), i10.push(t11)); + }(s8, e13), o8 = e13; + }, onObjectEnd: (e13, t11, n10, o9) => { + false === i9.ignoreDuplicateKeys && a8.delete(r9), r9.length = e13 + t11 - r9.offset, r9.range && (r9.range.end.line = n10, r9.range.end.character = o9 + t11), r9 = r9.parent, c8(e13 + t11), g8(); + }, onArrayBegin: (e13, t11, i10, n10) => { + r9 = f9({ type: "array", offset: e13, length: -1, parent: r9, children: [], range: d8(i10, n10, t11) }), h9([]); + }, onArrayEnd: (e13, t11, i10, n10) => { + r9.length = e13 + t11 - r9.offset, r9.range && (r9.range.end.line = i10, r9.range.end.character = n10 + t11), r9 = r9.parent, c8(e13 + t11), g8(); + }, onLiteralValue: (e13, t11, i10, n10, o9) => { + f9({ type: de4(e13), offset: t11, length: i10, parent: r9, value: e13, range: d8(n10, o9, i10) }), c8(t11 + i10), l8(e13); + }, onSeparator: (e13, t11) => { + "property" === r9.type && (":" === e13 ? r9.colonOffset = t11 : "," === e13 && c8(t11)); + }, onError: (e13, i10, n10, r10, o9) => { + t10.push({ range: d8(r10, o9, n10), message: m7(e13), severity: j6.h_.Error, code: e13 }); + } }, i9); + const v9 = r9.children[0]; + return v9 && delete v9.parent, { ast: v9, data: s8[0], lineMap: n9 }; + } + function de4(e12) { + switch (typeof e12) { + case "boolean": + return "boolean"; + case "number": + return "number"; + case "string": + return "string"; + default: + return "null"; + } + } + const fe4 = (e12) => { + const t10 = [0]; + let i9 = 0; + for (; i9 < e12.length; i9++) + "\n" === e12[i9] && t10.push(i9 + 1); + return t10.push(i9 + 1), t10; + }; + function le4(e12, t10 = []) { + return "property" === e12.type && t10.unshift(e12.children[0].value), void 0 !== e12.parent ? ("array" === e12.parent.type && void 0 !== e12.parent.parent && t10.unshift(e12.parent.children.indexOf(e12)), le4(e12.parent, t10)) : t10; + } + const ue4 = (e12, t10, i9) => { + if (!e12 || !Object.hasOwnProperty.call(e12, t10) || t10 === i9) + return e12; + const n9 = {}; + for (const [r9, o8] of Object.entries(e12)) + r9 === t10 ? n9[i9] = o8 : r9 in n9 || (n9[r9] = o8); + return n9; + }; + function me4(e12) { + return _6(e12) || Array.isArray(e12); + } + function he4(e12, t10, i9) { + if (i9.length <= 1 || t10.length <= 1) + throw Error("Source/target path must not be empty and point at root"); + if (0 === t10.indexOf(i9)) + throw Error("Target path cannot be contained within source"); + const n9 = N6(t10); + let r9 = e12; + for (const e13 of n9) { + if (!me4(r9)) + return; + r9 = r9[e13]; + } + if (!me4(r9)) + return; + const o8 = N6(i9); + let s8 = e12; + for (const [e13, t11] of o8.entries()) { + if (!me4(s8) || t11 in s8) + return; + const i10 = e13 === o8.length - 1 ? r9 : {}; + s8[t11] = i10, s8 = i10; + } + delete e12[n9[0]], function e13(t11, i10, n10) { + for (const r10 of Object.keys(t11)) { + const o9 = t11[r10]; + if ("$ref" !== r10) + me4(o9) && e13(o9, i10, n10); + else { + if ("string" != typeof o9 || !T6(o9)) + continue; + 0 === o9.indexOf(i10) && (t11[r10] = o9.replace(i10, n10)); + } + } + }(e12, t10, i9); + } + async function ye4(e12, t10, i9, n9, r9) { + let s8 = function(e13, t11) { + const i10 = Q5(t11); + return null === i10 ? e13 : (0, o7.isAbsolute)(i10) ? i10 : (0, o7.join)((0, o7.dirname)(e13), i10); + }(t10, i9); + const a8 = ne4(i9) || "#", p8 = await e12[s8], c8 = N6(a8); + let d8 = [...c8]; + const f9 = { value: p8 }; + for (const [i10, o8] of H5(f9, c8, a8)) { + if (n9.includes(o8)) + return { source: t10, location: null != r9 ? r9 : d8, value: n9[n9.length - 1] }; + n9.push(o8); + const a9 = await ye4(e12, s8, o8.$ref, n9, d8); + ({ source: s8, location: d8 } = a9), f9.value = a9.value, d8.push(...c8.slice(i10 + 1)); + } + return { source: s8, location: d8, value: n9.length > 0 ? K5(n9[n9.length - 1], f9.value) : f9.value }; + } + async function ge4(e12, t10, i9) { + return (await be4(e12, t10, i9)).value; + } + function be4(e12, t10, i9) { + return ye4(e12, t10, i9, []); + } + const ve4 = (e12, t10) => { + if ("string" != typeof e12) + return e12; + try { + const i9 = je4(e12); + return "string" == typeof i9 ? i9 : JSON.parse(e12, t10); + } catch (e13) { + return; + } + }, je4 = (e12) => { + const t10 = Number(e12); + return Number.isFinite(t10) ? String(t10) === e12 ? t10 : e12 : NaN; + }, $e2 = (e12, t10, i9) => { + if ("string" == typeof e12) + return e12; + try { + return JSON.stringify(e12, t10, i9); + } catch (n9) { + return x7()(e12, t10, i9); + } + }, xe2 = (e12, t10) => { + if (e12 instanceof Array) { + if (t10 instanceof Array) { + if (t10.length > e12.length) + return false; + for (const i9 in t10) { + if (!t10.hasOwnProperty(i9)) + continue; + const n9 = parseInt(e12[i9]), r9 = parseInt(t10[i9]); + if (isNaN(n9) && isNaN(r9)) { + if (e12[i9] !== t10[i9]) + return false; + } else if (n9 !== r9) + return false; + } + } + } else { + if ("string" != typeof e12) + return false; + if ("string" == typeof t10) + return e12.startsWith(t10); + } + return true; + }, _e2 = (e12, t10, i9) => { + const n9 = $e2(e12, t10, i9); + if (void 0 === n9) + throw new Error("The value could not be stringified"); + return n9; + }; + function we4(e12) { + return e12.replace(/^(\/|#\/)/, "").split("/").map(ee4).map(Se4).join("."); + } + function Se4(e12) { + return e12.includes(".") ? `["${e12.replace(/"/g, '\\"')}"]` : e12; + } + const Pe2 = Symbol.for(h8), Oe4 = { ownKeys: (e12) => Pe2 in e12 ? e12[Pe2] : Reflect.ownKeys(e12) }, Te = (e12) => new Proxy(e12, Oe4); + function Ae4(e12, t10) { + if ("string" == typeof e12 && "string" == typeof t10) + return (0, r8.trimStart)(e12, t10); + if (!(e12 && Array.isArray(e12) && e12.length && t10 && Array.isArray(t10) && t10.length)) + return e12; + let i9 = 0; + for (const n9 in e12) + if (e12.hasOwnProperty(n9)) { + if (e12[n9] !== t10[n9]) + break; + i9++; + } + return e12.slice(i9); + } + }, 98136: (e11, t9, i8) => { + "use strict"; + function n8(e12) { + let t10 = ""; + return e12.absolute && ("file" === e12.protocol ? (e12.drive && (t10 += e12.drive), t10 += "/") : (t10 += e12.protocol + "://", e12.origin && (t10 += e12.origin + "/"))), "" === (t10 += e12.path.join("/")) && (t10 = "."), t10; + } + function r8(e12, t10, i9, n9) { + this.message = e12, this.expected = t10, this.found = i9, this.location = n9, this.name = "SyntaxError", "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, r8); + } + i8.r(t9), i8.d(t9, { basename: () => d7, deserializeSrn: () => $5, dirname: () => f8, extname: () => l7, format: () => n8, isAbsolute: () => u7, isURL: () => m7, join: () => h8, normalize: () => a7, parse: () => s7, relative: () => y7, resolve: () => g7, sep: () => b8, serializeSrn: () => x7, startsWithWindowsDrive: () => v8, stripRoot: () => j6, toFSPath: () => a7 }), function(e12, t10) { + function i9() { + this.constructor = e12; + } + i9.prototype = t10.prototype, e12.prototype = new i9(); + }(r8, Error), r8.buildMessage = function(e12, t10) { + var i9 = { literal: function(e13) { + return '"' + r9(e13.text) + '"'; + }, class: function(e13) { + var t11, i10 = ""; + for (t11 = 0; t11 < e13.parts.length; t11++) + i10 += e13.parts[t11] instanceof Array ? o8(e13.parts[t11][0]) + "-" + o8(e13.parts[t11][1]) : o8(e13.parts[t11]); + return "[" + (e13.inverted ? "^" : "") + i10 + "]"; + }, any: function(e13) { + return "any character"; + }, end: function(e13) { + return "end of input"; + }, other: function(e13) { + return e13.description; + } }; + function n9(e13) { + return e13.charCodeAt(0).toString(16).toUpperCase(); + } + function r9(e13) { + return e13.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(e14) { + return "\\x0" + n9(e14); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(e14) { + return "\\x" + n9(e14); + }); + } + function o8(e13) { + return e13.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(e14) { + return "\\x0" + n9(e14); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(e14) { + return "\\x" + n9(e14); + }); + } + return "Expected " + function(e13) { + var t11, n10, r10, o9 = new Array(e13.length); + for (t11 = 0; t11 < e13.length; t11++) + o9[t11] = (r10 = e13[t11], i9[r10.type](r10)); + if (o9.sort(), o9.length > 0) { + for (t11 = 1, n10 = 1; t11 < o9.length; t11++) + o9[t11 - 1] !== o9[t11] && (o9[n10] = o9[t11], n10++); + o9.length = n10; + } + switch (o9.length) { + case 1: + return o9[0]; + case 2: + return o9[0] + " or " + o9[1]; + default: + return o9.slice(0, -1).join(", ") + ", or " + o9[o9.length - 1]; + } + }(e12) + " but " + function(e13) { + return e13 ? '"' + r9(e13) + '"' : "end of input"; + }(t10) + " found."; + }; + var o7 = function(e12, t10) { + t10 = void 0 !== t10 ? t10 : {}; + var i9, n9, o8, s8, a8 = {}, p8 = { Path: te4 }, c8 = te4, d8 = function(e13, t11, i10, n10) { + return { protocol: e13, origin: t11, absolute: true, ...i10, ...n10 }; + }, f9 = function(e13, t11, i10) { + return { protocol: e13, origin: t11, absolute: true, ...i10, path: [] }; + }, l8 = "http://", u8 = J5("http://", true), m8 = function(e13) { + return "http"; + }, h9 = "https://", y8 = J5("https://", true), g8 = function(e13) { + return "https"; + }, b9 = "", v9 = function() { + return null; + }, j7 = function(e13, t11, i10) { + return { protocol: e13, origin: null, absolute: true, ...t11, ...i10 }; + }, $6 = "file://", x8 = J5("file://", true), _6 = "file:", w6 = J5("file:", true), S6 = function(e13) { + return "file"; + }, P6 = function(e13, t11) { + return { protocol: "file", origin: null, absolute: true, ...e13, ...t11 }; + }, O7 = /^[A-Za-z]/, T6 = Z5([["A", "Z"], ["a", "z"]], false, false), A6 = ":", I6 = J5(":", false), E6 = function(e13) { + return { drive: e13.toLowerCase() + ":" }; + }, q5 = function() { + return { drive: null }; + }, k6 = function() { + return { drive: null }; + }, M6 = function(e13) { + return { protocol: null, origin: null, absolute: false, drive: null, ...e13 }; + }, R6 = function(e13) { + return { path: e13 }; + }, D6 = function(e13, t11) { + return [e13, ...t11]; + }, C6 = function(e13) { + return [e13]; + }, V5 = ".", N6 = J5(".", false), F6 = "/", U6 = J5("/", false), L6 = "\\", z6 = J5("\\", false), B6 = /^[^\/\\]/, Q5 = Z5(["/", "\\"], true, false), K5 = 0, H5 = [{ line: 1, column: 1 }], G5 = 0, W5 = []; + if ("startRule" in t10) { + if (!(t10.startRule in p8)) + throw new Error(`Can't start parsing from rule "` + t10.startRule + '".'); + c8 = p8[t10.startRule]; + } + function J5(e13, t11) { + return { type: "literal", text: e13, ignoreCase: t11 }; + } + function Z5(e13, t11, i10) { + return { type: "class", parts: e13, inverted: t11, ignoreCase: i10 }; + } + function Y6(t11) { + var i10, n10 = H5[t11]; + if (n10) + return n10; + for (i10 = t11 - 1; !H5[i10]; ) + i10--; + for (n10 = { line: (n10 = H5[i10]).line, column: n10.column }; i10 < t11; ) + 10 === e12.charCodeAt(i10) ? (n10.line++, n10.column = 1) : n10.column++, i10++; + return H5[t11] = n10, n10; + } + function X5(e13, t11) { + var i10 = Y6(e13), n10 = Y6(t11); + return { start: { offset: e13, line: i10.line, column: i10.column }, end: { offset: t11, line: n10.line, column: n10.column } }; + } + function ee4(e13) { + K5 < G5 || (K5 > G5 && (G5 = K5, W5 = []), W5.push(e13)); + } + function te4() { + var t11; + return (t11 = function() { + var e13, t12, i10, n10, r9; + return e13 = K5, (t12 = ie3()) !== a8 && (i10 = ne4()) !== a8 && (n10 = oe4()) !== a8 && (r9 = se4()) !== a8 ? e13 = t12 = d8(t12, i10, n10, r9) : (K5 = e13, e13 = a8), e13 === a8 && (e13 = K5, (t12 = ie3()) !== a8 && (i10 = ne4()) !== a8 && (n10 = function() { + var e14; + return (e14 = b9) !== a8 && (e14 = k6()), e14; + }()) !== a8 ? e13 = t12 = f9(t12, i10, n10) : (K5 = e13, e13 = a8)), e13; + }()) === a8 && (t11 = function() { + var t12, i10, n10, r9; + return t12 = K5, (i10 = function() { + var t13; + return e12.substr(K5, 7).toLowerCase() === $6 ? (t13 = e12.substr(K5, 7), K5 += 7) : (t13 = a8, ee4(x8)), t13 === a8 && (e12.substr(K5, 5).toLowerCase() === _6 ? (t13 = e12.substr(K5, 5), K5 += 5) : (t13 = a8, ee4(w6))), t13 !== a8 && (t13 = S6()), t13; + }()) !== a8 && (n10 = re4()) !== a8 && (r9 = se4()) !== a8 ? t12 = i10 = j7(i10, n10, r9) : (K5 = t12, t12 = a8), t12; + }()) === a8 && (t11 = function() { + var e13, t12, i10; + return e13 = K5, (t12 = re4()) !== a8 && (i10 = se4()) !== a8 ? e13 = t12 = P6(t12, i10) : (K5 = e13, e13 = a8), e13; + }()) === a8 && (t11 = function() { + var t12, i10; + return t12 = K5, function() { + var t13; + return (t13 = function() { + var t14, i11, n10; + return t14 = K5, 46 === e12.charCodeAt(K5) ? (i11 = V5, K5++) : (i11 = a8, ee4(N6)), i11 !== a8 && (n10 = pe4()) !== a8 ? t14 = i11 = [i11, n10] : (K5 = t14, t14 = a8), t14; + }()) === a8 && (t13 = b9), t13; + }() !== a8 && (i10 = se4()) !== a8 ? t12 = M6(i10) : (K5 = t12, t12 = a8), t12; + }()), t11; + } + function ie3() { + var t11, i10; + return e12.substr(K5, 7).toLowerCase() === l8 ? (i10 = e12.substr(K5, 7), K5 += 7) : (i10 = a8, ee4(u8)), i10 !== a8 && (i10 = m8()), (t11 = i10) === a8 && (t11 = function() { + var t12; + return e12.substr(K5, 8).toLowerCase() === h9 ? (t12 = e12.substr(K5, 8), K5 += 8) : (t12 = a8, ee4(y8)), t12 !== a8 && (t12 = g8()), t12; + }()), t11; + } + function ne4() { + var t11, i10, n10; + if (t11 = K5, i10 = [], (n10 = ce4()) !== a8) + for (; n10 !== a8; ) + i10.push(n10), n10 = ce4(); + else + i10 = a8; + return (t11 = i10 !== a8 ? e12.substring(t11, K5) : i10) === a8 && (t11 = K5, (i10 = b9) !== a8 && (i10 = v9()), t11 = i10), t11; + } + function re4() { + var t11; + return (t11 = function() { + var t12, i10, n10, r9; + return t12 = K5, (i10 = pe4()) === a8 && (i10 = null), i10 !== a8 ? (O7.test(e12.charAt(K5)) ? (n10 = e12.charAt(K5), K5++) : (n10 = a8, ee4(T6)), n10 !== a8 ? (58 === e12.charCodeAt(K5) ? (r9 = A6, K5++) : (r9 = a8, ee4(I6)), r9 !== a8 && pe4() !== a8 ? t12 = i10 = E6(n10) : (K5 = t12, t12 = a8)) : (K5 = t12, t12 = a8)) : (K5 = t12, t12 = a8), t12; + }()) === a8 && (t11 = oe4()), t11; + } + function oe4() { + var e13; + return (e13 = pe4()) !== a8 && (e13 = q5()), e13; + } + function se4() { + var e13; + return (e13 = function e14() { + var t11, i10, n10; + return t11 = K5, (i10 = ae4()) !== a8 && pe4() !== a8 && (n10 = e14()) !== a8 ? t11 = i10 = D6(i10, n10) : (K5 = t11, t11 = a8), t11 === a8 && (t11 = K5, (i10 = ae4()) !== a8 && (i10 = C6(i10)), t11 = i10), t11; + }()) !== a8 && (e13 = R6(e13)), e13; + } + function ae4() { + var t11, i10, n10; + if (t11 = K5, i10 = [], (n10 = ce4()) !== a8) + for (; n10 !== a8; ) + i10.push(n10), n10 = ce4(); + else + i10 = a8; + return (t11 = i10 !== a8 ? e12.substring(t11, K5) : i10) === a8 && (t11 = b9), t11; + } + function pe4() { + var t11; + return 47 === e12.charCodeAt(K5) ? (t11 = F6, K5++) : (t11 = a8, ee4(U6)), t11 === a8 && (92 === e12.charCodeAt(K5) ? (t11 = L6, K5++) : (t11 = a8, ee4(z6))), t11; + } + function ce4() { + var t11; + return B6.test(e12.charAt(K5)) ? (t11 = e12.charAt(K5), K5++) : (t11 = a8, ee4(Q5)), t11; + } + if ((i9 = c8()) !== a8 && K5 === e12.length) + return i9; + throw i9 !== a8 && K5 < e12.length && ee4({ type: "end" }), n9 = W5, o8 = G5 < e12.length ? e12.charAt(G5) : null, s8 = G5 < e12.length ? X5(G5, G5 + 1) : X5(G5, G5), new r8(r8.buildMessage(n9, o8), n9, o8, s8); + }; + function s7(e12) { + if ("string" != typeof e12) + throw new Error(`@stoplight/path: Cannot parse ${e12} because it is not a string`); + return o7(e12, {}); + } + function a7(e12) { + return n8(p7(s7(e12))); + } + function p7(e12) { + let t10 = e12.path; + t10 = t10.filter((e13) => "" !== e13 && "." !== e13); + const i9 = []; + for (const n9 of t10) + ".." === n9 && i9.length && ".." !== i9[i9.length - 1] ? i9.pop() : ".." === n9 && e12.absolute || i9.push(n9); + return e12.path = i9, e12; + } + function c7(e12) { + let t10 = e12.lastIndexOf("."); + ".." === e12 && (t10 = -1), "." === e12 && (t10 = -1); + let i9 = e12, n9 = ""; + return t10 > 0 && (i9 = e12.slice(0, t10), n9 = e12.slice(t10)), { name: i9, ext: n9 }; + } + const d7 = (e12, t10) => { + const i9 = p7(s7(e12)).path.pop(); + if (!i9) + return ""; + const { name: n9, ext: r9 } = c7(i9); + return true === t10 || t10 === r9 ? n9 : `${n9}${r9}`; + }, f8 = (e12) => { + const t10 = p7(s7(e12)); + return t10.path.pop(), n8(p7(t10)); + }, l7 = (e12) => { + const t10 = p7(s7(e12)).path.pop(); + if (!t10) + return ""; + const { ext: i9 } = c7(t10); + return i9; + }; + function u7(e12) { + return s7(e12).absolute; + } + function m7(e12) { + const t10 = s7(e12); + return "http" === t10.protocol || "https" === t10.protocol; + } + const h8 = (...e12) => { + if (0 === e12.length) + return "."; + const t10 = e12.map(s7), i9 = Object.assign({}, t10[0]); + for (let n9 = 1; n9 < t10.length; n9++) { + const r9 = t10[n9]; + if (r9.absolute) + throw new Error('Cannot join an absolute path "' + e12[n9] + '" in the middle of other paths.'); + for (const e13 of r9.path) + i9.path.push(e13); + } + return n8(p7(i9)); + }; + function y7(e12, t10) { + const i9 = p7(s7(t10)); + if (!i9.absolute) + return n8(i9); + const r9 = p7(s7(e12)); + if (i9.origin !== r9.origin) + return n8(i9); + if (!r9.absolute) + return n8(i9); + if (r9.drive !== i9.drive) + return n8(i9); + const o8 = Math.min(r9.path.length, i9.path.length); + for (let e13 = 0; e13 < o8 && r9.path[0] === i9.path[0]; e13++) + r9.path.shift(), i9.path.shift(); + return i9.path.unshift(...r9.path.fill("..")), n8({ origin: null, drive: null, absolute: false, protocol: null, path: i9.path }); + } + function g7(...e12) { + if (0 === e12.length) + return "."; + const t10 = p7(s7(e12[e12.length - 1])); + return t10.absolute ? n8(t10) : h8(...e12); + } + const b8 = "/", v8 = (e12) => null !== s7(e12).drive, j6 = (e12) => s7(e12).path.filter(Boolean).join("/"); + function $5(e12) { + const [t10, i9, n9, ...r9] = e12.split("/"), o8 = r9.length ? `/${r9.join("/")}` : void 0; + let s8, a8; + return o8 && (s8 = r9.find((e13) => e13.includes("."))) && (a8 = c7(s8).ext), { shortcode: t10, orgSlug: i9, projectSlug: n9, uri: o8, file: s8, ext: a8 }; + } + function x7({ shortcode: e12, orgSlug: t10, projectSlug: i9, uri: n9 = "" }) { + return [e12, t10, i9, n9.replace(/^\//, "")].filter(Boolean).join("/"); + } + }, 99999: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.aas2_6 = t9.aas2_5 = t9.aas2_4 = t9.aas2_3 = t9.aas2_2 = t9.aas2_1 = t9.aas2_0 = t9.asyncapi2 = t9.asyncApi2 = t9.aas2 = void 0; + const n8 = i8(46734), r8 = /^2\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/, o7 = /^2\.0(?:\.[0-9]*)?$/, s7 = /^2\.1(?:\.[0-9]*)?$/, a7 = /^2\.2(?:\.[0-9]*)?$/, p7 = /^2\.3(?:\.[0-9]*)?$/, c7 = /^2\.4(?:\.[0-9]*)?$/, d7 = /^2\.5(?:\.[0-9]*)?$/, f8 = /^2\.6(?:\.[0-9]*)?$/, l7 = (e12) => (0, n8.isPlainObject)(e12) && "asyncapi" in e12 && r8.test(String(e12.asyncapi)); + t9.aas2 = l7, t9.aas2.displayName = "AsyncAPI 2.x", t9.asyncApi2 = t9.aas2, t9.asyncapi2 = t9.aas2, t9.aas2_0 = (e12) => l7(e12) && o7.test(String(e12.asyncapi)), t9.aas2_0.displayName = "AsyncAPI 2.0.x", t9.aas2_1 = (e12) => l7(e12) && s7.test(String(e12.asyncapi)), t9.aas2_1.displayName = "AsyncAPI 2.1.x", t9.aas2_2 = (e12) => l7(e12) && a7.test(String(e12.asyncapi)), t9.aas2_2.displayName = "AsyncAPI 2.2.x", t9.aas2_3 = (e12) => l7(e12) && p7.test(String(e12.asyncapi)), t9.aas2_3.displayName = "AsyncAPI 2.3.x", t9.aas2_4 = (e12) => l7(e12) && c7.test(String(e12.asyncapi)), t9.aas2_4.displayName = "AsyncAPI 2.4.x", t9.aas2_5 = (e12) => l7(e12) && d7.test(String(e12.asyncapi)), t9.aas2_5.displayName = "AsyncAPI 2.5.x", t9.aas2_6 = (e12) => l7(e12) && f8.test(String(e12.asyncapi)), t9.aas2_6.displayName = "AsyncAPI 2.6.x"; + }, 67423: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(57494); + (0, n8.__exportStar)(i8(59171), t9), (0, n8.__exportStar)(i8(99999), t9), (0, n8.__exportStar)(i8(86202), t9); + }, 86202: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.detectDialect = t9.extractDraftVersion = t9.jsonSchemaDraft2020_12 = t9.jsonSchemaDraft2019_09 = t9.jsonSchemaDraft7 = t9.jsonSchemaDraft6 = t9.jsonSchemaDraft4 = t9.jsonSchemaLoose = t9.jsonSchema = void 0; + const n8 = i8(46734), r8 = ["array", "boolean", "integer", "null", "number", "object", "string"], o7 = ["allOf", "oneOf", "anyOf", "not", "if"], s7 = /^https?:\/\/json-schema.org\/(?:draft-0([467])|draft\/(20(?:19-09|20-12)))\/(?:hyper-)?schema#?$/, a7 = (e12) => function(e13) { + return (0, n8.isPlainObject)(e13) && "$schema" in e13 && "string" == typeof e13.$schema; + }(e12) && e12.$schema.includes("//json-schema.org/"); + function p7(e12, t10) { + const i9 = (t11) => a7(t11) && c7(t11.$schema) === e12; + return i9.displayName = t10, i9; + } + function c7(e12) { + var t10; + const i9 = s7.exec(e12); + return null !== i9 ? `draft${null !== (t10 = i9[1]) && void 0 !== t10 ? t10 : i9[2]}` : null; + } + t9.jsonSchema = a7, t9.jsonSchema.displayName = "JSON Schema", t9.jsonSchemaLoose = (e12) => (0, n8.isPlainObject)(e12) && (a7(e12) || ((e13) => "type" in e13 && ("string" == typeof e13.type ? r8.includes(e13.type) : Array.isArray(e13.type) && e13.type.every((e14) => r8.includes(e14))))(e12) || ((e13) => Array.isArray(e13.enum))(e12) || ((e13) => o7.some((t10) => t10 in e13 && "object" == typeof e13[t10] && null !== e13[t10]))(e12)), t9.jsonSchemaLoose.displayName = "JSON Schema (loose)", t9.jsonSchemaDraft4 = p7("draft4", "JSON Schema Draft 4"), t9.jsonSchemaDraft6 = p7("draft6", "JSON Schema Draft 6"), t9.jsonSchemaDraft7 = p7("draft7", "JSON Schema Draft 7"), t9.jsonSchemaDraft2019_09 = p7("draft2019-09", "JSON Schema Draft 2019-09"), t9.jsonSchemaDraft2020_12 = p7("draft2020-12", "JSON Schema Draft 2020-12"), t9.extractDraftVersion = c7, t9.detectDialect = function(e12) { + return a7(e12) ? c7(e12.$schema) : null; + }; + }, 59171: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.oas3_1 = t9.oas3_0 = t9.oas3 = t9.oas2 = void 0; + const n8 = i8(46734); + t9.oas2 = (e12) => (0, n8.isPlainObject)(e12) && "swagger" in e12 && 2 === parseInt(String(e12.swagger)), t9.oas2.displayName = "OpenAPI 2.0 (Swagger)"; + const r8 = (e12) => (0, n8.isPlainObject)(e12) && "openapi" in e12 && 3 === Number.parseInt(String(e12.openapi)); + t9.oas3 = r8, t9.oas3.displayName = "OpenAPI 3.x", t9.oas3_0 = (e12) => r8(e12) && /^3\.0(?:\.[0-9]*)?$/.test(String(e12.openapi)), t9.oas3_0.displayName = "OpenAPI 3.0.x", t9.oas3_1 = (e12) => r8(e12) && /^3\.1(?:\.[0-9]*)?$/.test(String(e12.openapi)), t9.oas3_1.displayName = "OpenAPI 3.1.x"; + }, 40456: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(45250), r8 = i8(23859), o7 = i8(95955), s7 = i8(9251), a7 = (e12, t10) => "number" != typeof e12 && !Number.isNaN(Number(e12)) || "number" != typeof t10 && Number.isNaN(Number(t10)) ? "string" != typeof e12 || "string" != typeof t10 ? 0 : e12.localeCompare(t10) : Math.min(1, Math.max(-1, Number(e12) - Number(t10))); + function p7(e12) { + return "string" == typeof e12 || "number" == typeof e12; + } + t9.default = (0, r8.createRulesetFunction)({ input: { type: ["object", "array"] }, options: s7.optionSchemas.alphabetical }, function(e12, t10, { path: i9, documentInventory: r9 }) { + var s8, c7; + let d7; + if (d7 = Array.isArray(e12) ? e12 : Object.keys(null !== (c7 = null === (s8 = r9.findAssociatedItemForPath(i9, true)) || void 0 === s8 ? void 0 : s8.document.trapAccess(e12)) && void 0 !== c7 ? c7 : e12), d7.length < 2) + return; + const f8 = null == t10 ? void 0 : t10.keyedBy; + if (void 0 !== f8) { + const e13 = []; + for (const t11 of d7) { + if (!(0, n8.isObject)(t11)) + return [{ message: '#{{print("property")}}must be an object' }]; + e13.push(t11[f8]); + } + d7 = e13; + } + if (!d7.every(p7)) + return [{ message: '#{{print("property")}}must be one of the allowed types: number, string' }]; + const l7 = ((e13, t11) => { + for (let i10 = 0; i10 < e13.length - 1; i10 += 1) + if (t11(e13[i10], e13[i10 + 1]) >= 1) + return [i10, i10 + 1]; + return null; + })(d7, a7); + return null != l7 ? [{ ...void 0 === f8 ? { path: [...i9, Array.isArray(e12) ? l7[0] : d7[l7[0]]] } : null, message: void 0 !== f8 ? "properties must follow the alphabetical order" : `${(0, o7.printValue)(d7[l7[0]])} must be placed after ${(0, o7.printValue)(d7[l7[1]])}` }] : void 0; + }); + }, 97685: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.CasingType = void 0; + const n8 = i8(45250), r8 = i8(23859), o7 = i8(9251), s7 = i8(92805); + Object.defineProperty(t9, "CasingType", { enumerable: true, get: function() { + return s7.CasingType; + } }); + const a7 = { [s7.CasingType.flat]: "[a-z][a-z{__DIGITS__}]*", [s7.CasingType.camel]: "[a-z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*", [s7.CasingType.pascal]: "[A-Z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*", [s7.CasingType.kebab]: "[a-z][a-z{__DIGITS__}]*(?:-[a-z{__DIGITS__}]+)*", [s7.CasingType.cobol]: "[A-Z][A-Z{__DIGITS__}]*(?:-[A-Z{__DIGITS__}]+)*", [s7.CasingType.snake]: "[a-z][a-z{__DIGITS__}]*(?:_[a-z{__DIGITS__}]+)*", [s7.CasingType.macro]: "[A-Z][A-Z{__DIGITS__}]*(?:_[A-Z{__DIGITS__}]+)*" }; + t9.default = (0, r8.createRulesetFunction)({ input: { type: "string", minLength: 1 }, options: o7.optionSchemas.casing }, function(e12, t10) { + if (1 !== e12.length || void 0 === t10.separator || true !== t10.separator.allowLeading || e12 !== t10.separator.char) + return p7(a7[t10.type], t10).test(e12) ? void 0 : [{ message: `must be ${t10.type} case` }]; + }); + const p7 = (e12, t10) => { + const i9 = true !== t10.disallowDigits, r9 = e12.replace(/\{__DIGITS__\}/g, i9 ? "0-9" : ""); + if (void 0 === t10.separator) + return new RegExp(`^${r9}$`); + const o8 = `[${(0, n8.escapeRegExp)(t10.separator.char)}]`, s8 = true === t10.separator.allowLeading ? `${o8}?` : ""; + return new RegExp(`^${s8}${r9}(?:${o8}${r9})*$`); + }; + }, 31181: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: null, options: r8.optionSchemas.defined }, function(e12) { + if (void 0 === e12) + return [{ message: '#{{print("property")}}must be defined' }]; + }); + }, 18315: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(95955), o7 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: { type: ["string", "number", "null", "boolean"] }, options: o7.optionSchemas.enumeration }, function(e12, { values: t10 }) { + if (!t10.includes(e12)) + return [{ message: `#{{print("value")}} must be equal to one of the allowed values: ${t10.map(r8.printValue).join(", ")}` }]; + }); + }, 53547: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: null, options: r8.optionSchemas.falsy }, function(e12) { + if (e12) + return [{ message: '#{{print("property")}}must be falsy' }]; + }); + }, 69248: (e11, t9, i8) => { + "use strict"; + t9.fK = t9.vN = t9.wQ = t9.T1 = void 0; + const n8 = i8(69371), r8 = ((0, n8.__importDefault)(i8(40456)), (0, n8.__importDefault)(i8(97685)), (0, n8.__importDefault)(i8(31181)), (0, n8.__importDefault)(i8(18315)), (0, n8.__importDefault)(i8(53547)), (0, n8.__importDefault)(i8(54782)), (0, n8.__importDefault)(i8(41146))); + Object.defineProperty(t9, "T1", { enumerable: true, get: function() { + return r8.default; + } }); + const o7 = (0, n8.__importDefault)(i8(95818)); + Object.defineProperty(t9, "wQ", { enumerable: true, get: function() { + return o7.default; + } }); + const s7 = (0, n8.__importDefault)(i8(11214)); + Object.defineProperty(t9, "vN", { enumerable: true, get: function() { + return s7.default; + } }); + (0, n8.__importDefault)(i8(60928)); + const a7 = (0, n8.__importDefault)(i8(67884)); + Object.defineProperty(t9, "fK", { enumerable: true, get: function() { + return a7.default; + } }); + (0, n8.__importDefault)(i8(6073)); + }, 54782: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(95955), o7 = i8(46734), s7 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: { type: ["array", "object", "string", "number"] }, options: s7.optionSchemas.length }, function(e12, t10) { + let i9, n9; + return i9 = (0, o7.isPlainObject)(e12) ? Object.keys(e12).length : Array.isArray(e12) ? e12.length : "number" == typeof e12 ? e12 : e12.length, "min" in t10 && i9 < t10.min && (n9 = [{ message: `#{{print("property")}}must be longer than ${(0, r8.printValue)(t10.min)}` }]), "max" in t10 && i9 > t10.max && (null != n9 ? n9 : n9 = []).push({ message: `#{{print("property")}}must be shorter than ${(0, r8.printValue)(t10.max)}` }), n9; + }); + }, 9251: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.optionSchemas = void 0; + const n8 = i8(92805); + t9.optionSchemas = { alphabetical: { type: ["object", "null"], properties: { keyedBy: { type: "string", description: "The key to sort an object by." } }, additionalProperties: false, errorMessage: { type: '"alphabetical" function has invalid options specified. Example valid options: null (no options), { "keyedBy": "my-key" }' } }, casing: { required: ["type"], type: "object", properties: { type: { type: "string", enum: Object.values(n8.CasingType), errorMessage: `"casing" function and its "type" option accept the following values: ${Object.values(n8.CasingType).join(", ")}`, description: "The casing type to match against." }, disallowDigits: { type: "boolean", default: false, description: "If not true, digits are allowed." }, separator: { type: "object", required: ["char"], additionalProperties: false, properties: { char: { type: "string", maxLength: 1, errorMessage: '"casing" function and its "separator.char" option accepts only char, i.e. "I" or "/"', description: "The additional char to separate groups of words." }, allowLeading: { type: "boolean", description: "Can the group separator char be used at the first char?" } } } }, additionalProperties: false, errorMessage: { type: '"casing" function has invalid options specified. Example valid options: { "type": "camel" }, { "type": "pascal", "disallowDigits": true }' } }, defined: null, enumeration: { type: "object", additionalProperties: false, properties: { values: { type: "array", items: { type: ["string", "number", "null", "boolean"] }, errorMessage: '"enumeration" and its "values" option support only arrays of primitive values, i.e. ["Berlin", "London", "Paris"]', description: "An array of possible values." } }, required: ["values"], errorMessage: { type: '"enumeration" function has invalid options specified. Example valid options: { "values": ["Berlin", "London", "Paris"] }, { "values": [2, 3, 5, 8, 13, 21] }' } }, falsy: null, length: { type: "object", properties: { min: { type: "number", description: "The minimum length to match." }, max: { type: "number", description: "The maximum length to match." } }, minProperties: 1, additionalProperties: false, errorMessage: { type: '"length" function has invalid options specified. Example valid options: { "min": 2 }, { "max": 5 }, { "min": 0, "max": 10 }' } }, pattern: { type: "object", additionalProperties: false, properties: { match: { anyOf: [{ type: "string" }, { type: "object", properties: { exec: {}, test: {}, flags: { type: "string" } }, required: ["test", "flags"], "x-internal": true }], errorMessage: '"pattern" function and its "match" option must be string or RegExp instance', description: "If provided, value must match this regex." }, notMatch: { anyOf: [{ type: "string" }, { type: "object", properties: { exec: {}, test: {}, flags: { type: "string" } }, required: ["test", "flags"], "x-internal": true }], errorMessage: '"pattern" function and its "notMatch" option must be string or RegExp instance', description: "If provided, value must _not_ match this regex." } }, minProperties: 1, errorMessage: { type: '"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }', minProperties: '"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }' } }, truthy: null, undefined: null, schema: { additionalProperties: false, properties: { schema: { type: "object", description: "Any valid JSON Schema document." }, dialect: { enum: ["auto", "draft4", "draft6", "draft7", "draft2019-09", "draft2020-12"], default: "auto", description: "The JSON Schema draft used by function." }, allErrors: { type: "boolean", default: false, description: "Returns all errors when true; otherwise only returns the first error." }, prepareResults: { "x-internal": true } }, required: ["schema"], type: "object", errorMessage: { type: '"schema" function has invalid options specified. Example valid options: { "schema": { /* any JSON Schema can be defined here */ } , { "schema": { "type": "object" }, "dialect": "auto" }' } }, unreferencedReusableObject: { type: "object", properties: { reusableObjectsLocation: { type: "string", format: "json-pointer-uri-fragment", errorMessage: '"unreferencedReusableObject" and its "reusableObjectsLocation" option support only valid JSON Pointer fragments, i.e. "#", "#/foo", "#/paths/~1user"', description: "A local json pointer to the document member holding the reusable objects (eg. #/definitions for an OAS2 document, #/components/schemas for an OAS3 document)." } }, additionalProperties: false, required: ["reusableObjectsLocation"], errorMessage: { type: '"unreferencedReusableObject" function has invalid options specified. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }', required: '"unreferencedReusableObject" function is missing "reusableObjectsLocation" option. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }' } }, xor: { type: "object", properties: { properties: { type: "array", items: { type: "string" }, minItems: 2, errorMessage: '"xor" and its "properties" option require at least 2-item tuples, i.e. ["id", "name"]', description: "The properties to check." } }, additionalProperties: false, required: ["properties"], errorMessage: { type: '"xor" function has invalid options specified. Example valid options: { "properties": ["id", "name"] }, { "properties": ["country", "street"] }' } } }; + }, 41146: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(95955), o7 = i8(9251), s7 = /^\/(.+)\/([a-z]*)$/, a7 = /* @__PURE__ */ new Map(); + function p7(e12) { + const t10 = a7.get(e12); + if (void 0 !== t10) + return t10.lastIndex = 0, t10; + const i9 = function(e13) { + const t11 = s7.exec(e13); + return null !== t11 ? new RegExp(t11[1], t11[2]) : new RegExp(e13); + }(e12); + return a7.set(e12, i9), i9; + } + t9.default = (0, n8.createRulesetFunction)({ input: { type: "string" }, options: o7.optionSchemas.pattern }, function(e12, t10) { + let i9; + return "match" in t10 && (p7(t10.match).test(e12) || (i9 = [{ message: `#{{print("value")}} must match the pattern ${(0, r8.printValue)(t10.match)}` }])), "notMatch" in t10 && p7(t10.notMatch).test(e12) && (null != i9 ? i9 : i9 = []).push({ message: `#{{print("value")}} must not match the pattern ${(0, r8.printValue)(t10.notMatch)}` }), i9; + }); + }, 79097: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.createAjvInstances = void 0; + const n8 = i8(69371), r8 = (0, n8.__importDefault)(i8(11601)), o7 = (0, n8.__importDefault)(i8(88856)), s7 = (0, n8.__importDefault)(i8(88728)), a7 = (0, n8.__importDefault)(i8(33467)), p7 = (0, n8.__importDefault)(i8(74421)), c7 = (0, n8.__importDefault)(i8(67156)), d7 = (0, n8.__importStar)(i8(26443)), f8 = (0, n8.__importStar)(i8(33978)), l7 = { warn(...e12) { + const t10 = e12[0]; + if ("string" == typeof t10) { + if (t10.startsWith("unknown format")) + return; + console.warn(...e12); + } + }, log: console.log, error: console.error }; + function u7(e12, t10) { + const i9 = new e12({ allErrors: t10, meta: true, messages: true, strict: false, allowUnionTypes: true, logger: l7, unicodeRegExp: false }); + return (0, p7.default)(i9), t10 && (0, c7.default)(i9), e12 === r8.default && (i9.addSchema(f8), i9.addSchema(d7)), i9; + } + function m7(e12) { + let t10, i9; + return { get default() { + return null != t10 || (t10 = u7(e12, false)), t10; + }, get allErrors() { + return null != i9 || (i9 = u7(e12, true)), i9; + } }; + } + t9.createAjvInstances = function() { + const e12 = { auto: m7(r8.default), draft4: m7(a7.default), "draft2019-09": m7(o7.default), "draft2020-12": m7(s7.default) }, t10 = /* @__PURE__ */ new WeakMap(); + return function(i9, n9, r9) { + var o8, s8, a8, p8; + const c8 = (null !== (o8 = e12[n9]) && void 0 !== o8 ? o8 : e12.auto)[r9 ? "allErrors" : "default"], d8 = i9.$id; + if ("string" == typeof d8) + return null !== (s8 = c8.getSchema(d8)) && void 0 !== s8 ? s8 : c8.compile(i9); + { + const e13 = null !== (a8 = t10.get(c8)) && void 0 !== a8 ? a8 : t10.set(c8, /* @__PURE__ */ new WeakMap()).get(c8); + return null !== (p8 = e13.get(i9)) && void 0 !== p8 ? p8 : e13.set(i9, c8.compile(i9)).get(i9); + } + }; + }; + }, 95818: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(69371), r8 = (0, n8.__importDefault)(i8(58883)), o7 = i8(67423), s7 = i8(79097), a7 = (0, n8.__importDefault)(i8(85748)), p7 = i8(23859), c7 = i8(45250), d7 = i8(9251), f8 = /* @__PURE__ */ new WeakMap(); + t9.default = (0, p7.createRulesetFunction)({ input: null, options: d7.optionSchemas.schema }, function(e12, t10, { path: i9, rule: n9, documentInventory: p8 }) { + var d8, l7, u7; + if (void 0 === e12) + return [{ path: i9, message: '#{{print("property")}}must exist' }]; + const m7 = null !== (d8 = f8.get(p8)) && void 0 !== d8 ? d8 : f8.set(p8, (0, s7.createAjvInstances)()).get(p8), h8 = [], { allErrors: y7 = false, schema: g7 } = t10; + try { + const n10 = m7(g7, null !== (l7 = void 0 === t10.dialect || "auto" === t10.dialect ? (0, o7.detectDialect)(g7) : null == t10 ? void 0 : t10.dialect) && void 0 !== l7 ? l7 : "draft7", y7); + false === (null == n10 ? void 0 : n10(e12)) && Array.isArray(n10.errors) && (null === (u7 = t10.prepareResults) || void 0 === u7 || u7.call(t10, n10.errors), h8.push(...(0, r8.default)(g7, n10.errors, { propertyPath: i9, targetValue: e12 }).map(({ suggestion: e13, error: t11, path: n11 }) => ({ message: void 0 !== e13 ? `${t11}. ${e13}` : t11, path: [...i9, ..."" !== n11 ? n11.replace(/^\//, "").split("/") : []] })))); + } catch (e13) { + if (!(0, c7.isError)(e13)) + throw new Error("Unexpected error"); + (null == n9 ? void 0 : n9.resolved) && e13 instanceof a7.default || h8.push({ message: e13.message, path: i9 }); + } + return h8; + }); + }, 11214: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: null, options: r8.optionSchemas.truthy }, function(e12) { + if (!e12) + return [{ message: '#{{print("property")}}must be truthy' }]; + }); + }, 92805: (e11, t9) => { + "use strict"; + var i8; + Object.defineProperty(t9, "__esModule", { value: true }), t9.CasingType = void 0, (i8 = t9.CasingType || (t9.CasingType = {})).flat = "flat", i8.camel = "camel", i8.pascal = "pascal", i8.kebab = "kebab", i8.cobol = "cobol", i8.snake = "snake", i8.macro = "macro"; + }, 60928: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: null, options: r8.optionSchemas.undefined }, function(e12) { + if (void 0 !== e12) + return [{ message: '#{{print("property")}}must be undefined' }]; + }); + }, 67884: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(95955), o7 = i8(46734), s7 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: { type: "object" }, options: s7.optionSchemas.unreferencedReusableObject }, function(e12, t10, { document: i9, documentInventory: n9 }) { + var s8; + const a7 = n9.graph; + if (null === a7) + throw new Error("unreferencedReusableObject requires dependency graph"); + const p7 = null !== (s8 = i9.source) && void 0 !== s8 ? s8 : "", c7 = Object.keys(e12).map((e13) => `${p7}${t10.reusableObjectsLocation}/${e13}`), d7 = new Set(a7.overallOrder().map((e13) => (0, o7.decodePointer)(e13))); + return c7.filter((e13) => !d7.has(e13)).map((e13) => ({ message: "Potential orphaned reusable object has been detected", path: (0, r8.safePointerToPath)(e13) })); + }); + }, 6073: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(23859), r8 = i8(95955), o7 = i8(9251); + t9.default = (0, n8.createRulesetFunction)({ input: { type: "object" }, options: o7.optionSchemas.xor }, function(e12, { properties: t10 }) { + const i9 = []; + if (1 !== Object.keys(e12).filter((e13) => t10.includes(e13)).length) { + const e13 = t10.map((e14) => (0, r8.printValue)(e14)), n9 = e13.pop(); + let o8 = e13.join(", ") + (null != n9 ? ` and ${n9}` : ""); + o8 += " must not be both defined or both undefined", i9.push({ message: o8 }); + } + return i9; + }); + }, 63083: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(39862); + (0, n8.__exportStar)(i8(50973), t9), (0, n8.__exportStar)(i8(72708), t9), (0, n8.__exportStar)(i8(51562), t9); + }, 50973: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Json = t9.parseJson = void 0; + const n8 = i8(46734); + t9.parseJson = (e12) => (0, n8.parseWithPointers)(e12, { ignoreDuplicateKeys: false, preserveKeyOrder: true }), t9.Json = { parse: t9.parseJson, getLocationForJsonPath: n8.getLocationForJsonPath, trapAccess: n8.trapAccess }; + }, 51562: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + }, 72708: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Yaml = t9.parseYaml = void 0; + const n8 = i8(3740); + t9.parseYaml = (e12) => (0, n8.parseWithPointers)(e12, { ignoreDuplicateKeys: false, mergeKeys: true, preserveKeyOrder: true, attachComments: false }), t9.Yaml = { parse: t9.parseYaml, getLocationForJsonPath: function(e12, t10) { + return (0, n8.getLocationForJsonPath)(e12, t10); + }, trapAccess: n8.trapAccess }; + }, 88601: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.createHttpAndFileResolver = t9.ResolverDepGraph = t9.Resolver = t9.httpAndFileResolver = void 0; + const n8 = i8(2230), r8 = i8(54668), o7 = i8(16586); + Object.defineProperty(t9, "Resolver", { enumerable: true, get: function() { + return o7.Resolver; + } }); + const s7 = i8(95955), a7 = i8(30524); + function p7(e12) { + const t10 = (0, r8.createResolveHttp)({ ...s7.DEFAULT_REQUEST_OPTIONS, ...e12 }); + return new o7.Resolver({ resolvers: { https: { resolve: t10 }, http: { resolve: t10 }, file: { resolve: r8.resolveFile } } }); + } + (0, n8.__exportStar)(i8(7944), t9), t9.httpAndFileResolver = p7(), t9.ResolverDepGraph = a7.DepGraph, t9.createHttpAndFileResolver = p7; + }, 7944: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + }, 86663: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.DEFAULT_REQUEST_OPTIONS = void 0; + const n8 = (0, i8(54078).__importDefault)(i8(98203)); + t9.DEFAULT_REQUEST_OPTIONS = {}, t9.default = async (e12, i9 = {}) => (0, n8.default)(e12, { ...i9, ...t9.DEFAULT_REQUEST_OPTIONS }); + }, 95955: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.DEFAULT_REQUEST_OPTIONS = t9.fetch = void 0; + const n8 = i8(54078); + (0, n8.__exportStar)(i8(14205), t9); + var r8 = i8(86663); + Object.defineProperty(t9, "fetch", { enumerable: true, get: function() { + return (0, n8.__importDefault)(r8).default; + } }), Object.defineProperty(t9, "DEFAULT_REQUEST_OPTIONS", { enumerable: true, get: function() { + return r8.DEFAULT_REQUEST_OPTIONS; + } }), (0, n8.__exportStar)(i8(65744), t9); + }, 65744: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.readParsable = t9.readFile = void 0; + const n8 = i8(54078), r8 = i8(98136), o7 = (0, n8.__importDefault)(i8(67083)), s7 = (0, n8.__importStar)(i8(18248)), a7 = i8(45250), p7 = (0, n8.__importDefault)(i8(86663)), c7 = i8(92918); + async function d7(e12, t10) { + if ((0, r8.isURL)(e12)) { + let i9, n9 = null; + try { + const r9 = {}; + if (r9.agent = t10.agent, void 0 !== t10.timeout) { + const e13 = new o7.default(); + n9 = setTimeout(() => { + e13.abort(); + }, t10.timeout), r9.signal = e13.signal; + } + if (i9 = await (0, p7.default)(e12, r9), !i9.ok) + throw new Error(i9.statusText); + return await i9.text(); + } catch (e13) { + throw (0, a7.isError)(e13) && "AbortError" === e13.name ? new Error("Timeout") : e13; + } finally { + null !== n9 && clearTimeout(n9); + } + } else + try { + return await new Promise((i9, n9) => { + s7.readFile(e12, t10.encoding, (e13, t11) => { + null !== e13 ? n9(e13) : i9(t11); + }); + }); + } catch (t11) { + throw new Error(`Could not read ${e12}: ${(0, c7.printError)(t11)}`); + } + } + t9.readFile = d7, t9.readParsable = async function(e12, t10) { + try { + return await d7(e12, t10); + } catch (t11) { + throw new Error(`Could not parse ${e12}: ${(0, c7.printError)(t11)}`); + } + }; + }, 39090: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.decodeSegmentFragment = void 0; + const n8 = i8(46734); + t9.decodeSegmentFragment = function(e12) { + return "string" != typeof e12 ? String(e12) : (0, n8.decodePointerFragment)(e12); + }; + }, 14205: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(54078); + (0, n8.__exportStar)(i8(39090), t9), (0, n8.__exportStar)(i8(92918), t9), (0, n8.__exportStar)(i8(73389), t9), (0, n8.__exportStar)(i8(24569), t9), (0, n8.__exportStar)(i8(6291), t9); + }, 92918: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.printError = void 0; + const n8 = i8(45250); + t9.printError = function(e12) { + return (0, n8.isError)(e12) ? e12.message : "unknown error"; + }; + }, 73389: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.printPath = t9.PrintStyle = void 0; + const n8 = i8(46734); + var r8; + !function(e12) { + e12.Dot = "dot", e12.Pointer = "pointer", e12.EscapedPointer = "escapedPointer"; + }(r8 = t9.PrintStyle || (t9.PrintStyle = {})); + const o7 = (e12) => "number" == typeof e12 ? e12 : (0, n8.decodePointerFragment)(e12); + t9.printPath = (e12, t10) => { + switch (t10) { + case r8.Dot: + return (0, n8.decodePointerFragment)(((e13) => e13.reduce((e14, t11, i9) => { + var n9; + return `${e14}${null !== (n9 = ((e15) => { + return "number" == typeof e15 ? `[${e15}]` : 0 === e15.length ? "['']" : /\s/.test(e15) ? `['${e15}']` : "number" != typeof (t12 = e15) && Number.isNaN(Number(t12)) ? null : `[${e15}]`; + var t12; + })(t11)) && void 0 !== n9 ? n9 : `${0 === i9 ? "" : "."}${t11}`}`; + }, ""))(e12)); + case r8.Pointer: + return 0 === e12.length ? "#" : `#/${(0, n8.decodePointerFragment)(e12.join("/"))}`; + case r8.EscapedPointer: + return (0, n8.pathToPointer)(e12.map(o7)); + default: + return String(e12); + } + }; + }, 24569: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.printValue = void 0; + const n8 = i8(45250), r8 = i8(46734); + t9.printValue = function(e12) { + return void 0 === e12 ? "undefined" : (0, n8.isObject)(e12) ? Array.isArray(e12) ? "Array[]" : e12 instanceof RegExp ? String(e12.source) : !(0, r8.isPlainObject)(e12) && "constructor" in e12 && "string" == typeof e12.constructor.name ? e12.constructor.name : "Object{}" : JSON.stringify(e12); + }; + }, 6291: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getClosestJsonPath = t9.safePointerToPath = t9.getEndRef = t9.traverseObjUntilRef = t9.isAbsoluteRef = t9.startsWithProtocol = void 0; + const n8 = i8(46734), r8 = i8(98136), o7 = i8(45250), s7 = /^[a-z]+:\/\//i; + t9.startsWithProtocol = (e12) => s7.test(e12), t9.isAbsoluteRef = (e12) => (0, r8.isAbsolute)(e12) || (0, t9.startsWithProtocol)(e12), t9.traverseObjUntilRef = (e12, t10) => { + let i9 = e12; + for (const e13 of t10.slice()) { + if (!(0, o7.isObject)(i9)) + throw new TypeError("Segment is not a part of the object"); + if (!(e13 in i9)) { + if ((0, n8.hasRef)(i9)) + return i9.$ref; + throw new Error("Segment is not a part of the object"); + } + i9 = i9[e13], t10.shift(); + } + return (0, n8.isPlainObject)(i9) && (0, n8.hasRef)(i9) && 1 === Object.keys(i9).length ? i9.$ref : null; + }, t9.getEndRef = (e12, t10) => { + for (; t10 in e12; ) + t10 = e12[t10]; + return t10; + }, t9.safePointerToPath = (e12) => { + const t10 = (0, n8.extractPointerFromRef)(e12); + return null !== t10 ? (0, n8.pointerToPath)(t10) : []; + }, t9.getClosestJsonPath = (e12, t10) => { + const i9 = []; + if (!(0, o7.isObject)(e12)) + return i9; + let n9 = e12; + for (const e13 of t10) { + if (!(0, o7.isObject)(n9) || !(e13 in n9)) + break; + i9.push(e13), n9 = n9[e13]; + } + return i9; + }; + }, 29228: (e11, t9) => { + "use strict"; + function i8(e12) { + return null == e12; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.isNothing = i8, t9.isObject = function(e12) { + return "object" == typeof e12 && null !== e12; + }, t9.toArray = function(e12) { + return Array.isArray(e12) ? e12 : i8(e12) ? [] : [e12]; + }, t9.extend = function(e12, t10) { + var i9, n8, r8, o7; + if (t10) + for (i9 = 0, n8 = (o7 = Object.keys(t10)).length; i9 < n8; i9 += 1) + e12[r8 = o7[i9]] = t10[r8]; + return e12; + }, t9.repeat = function(e12, t10) { + var i9, n8 = ""; + for (i9 = 0; i9 < t10; i9 += 1) + n8 += e12; + return n8; + }, t9.isNegativeZero = function(e12) { + return 0 === e12 && Number.NEGATIVE_INFINITY === 1 / e12; + }; + }, 17128: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(29228), r8 = i8(94716), o7 = i8(80406), s7 = i8(23102), a7 = Object.prototype.toString, p7 = Object.prototype.hasOwnProperty, c7 = 9, d7 = 10, f8 = 13, l7 = 32, u7 = 33, m7 = 34, h8 = 35, y7 = 37, g7 = 38, b8 = 39, v8 = 42, j6 = 44, $5 = 45, x7 = 58, _6 = 61, w6 = 62, S6 = 63, P6 = 64, O7 = 91, T6 = 93, A6 = 96, I6 = 123, E6 = 124, q5 = 125, k6 = { 0: "\\0", 7: "\\a", 8: "\\b", 9: "\\t", 10: "\\n", 11: "\\v", 12: "\\f", 13: "\\r", 27: "\\e", 34: '\\"', 92: "\\\\", 133: "\\N", 160: "\\_", 8232: "\\L", 8233: "\\P" }, M6 = ["y", "Y", "yes", "Yes", "YES", "on", "On", "ON", "n", "N", "no", "No", "NO", "off", "Off", "OFF"]; + function R6(e12) { + var t10, i9, o8; + if (t10 = e12.toString(16).toUpperCase(), e12 <= 255) + i9 = "x", o8 = 2; + else if (e12 <= 65535) + i9 = "u", o8 = 4; + else { + if (!(e12 <= 4294967295)) + throw new r8("code point within a string may not be greater than 0xFFFFFFFF"); + i9 = "U", o8 = 8; + } + return "\\" + i9 + n8.repeat("0", o8 - t10.length) + t10; + } + function D6(e12) { + this.schema = e12.schema || o7, this.indent = Math.max(1, e12.indent || 2), this.noArrayIndent = e12.noArrayIndent || false, this.skipInvalid = e12.skipInvalid || false, this.flowLevel = n8.isNothing(e12.flowLevel) ? -1 : e12.flowLevel, this.styleMap = function(e13, t10) { + var i9, n9, r9, o8, s8, a8, c8; + if (null === t10) + return {}; + for (i9 = {}, r9 = 0, o8 = (n9 = Object.keys(t10)).length; r9 < o8; r9 += 1) + s8 = n9[r9], a8 = String(t10[s8]), "!!" === s8.slice(0, 2) && (s8 = "tag:yaml.org,2002:" + s8.slice(2)), (c8 = e13.compiledTypeMap.fallback[s8]) && p7.call(c8.styleAliases, a8) && (a8 = c8.styleAliases[a8]), i9[s8] = a8; + return i9; + }(this.schema, e12.styles || null), this.sortKeys = e12.sortKeys || false, this.lineWidth = e12.lineWidth || 80, this.noRefs = e12.noRefs || false, this.noCompatMode = e12.noCompatMode || false, this.condenseFlow = e12.condenseFlow || false, this.implicitTypes = this.schema.compiledImplicit, this.explicitTypes = this.schema.compiledExplicit, this.comments = e12.comments || {}, this.tag = null, this.result = "", this.duplicates = [], this.usedDuplicates = null; + } + function C6(e12, t10) { + for (var i9, r9 = n8.repeat(" ", t10), o8 = 0, s8 = -1, a8 = "", p8 = e12.length; o8 < p8; ) + -1 === (s8 = e12.indexOf("\n", o8)) ? (i9 = e12.slice(o8), o8 = p8) : (i9 = e12.slice(o8, s8 + 1), o8 = s8 + 1), i9.length && "\n" !== i9 && (a8 += r9), a8 += i9; + return a8; + } + function V5(e12, t10) { + return "\n" + n8.repeat(" ", e12.indent * t10); + } + function N6(e12) { + return e12 === l7 || e12 === c7; + } + function F6(e12) { + return 32 <= e12 && e12 <= 126 || 161 <= e12 && e12 <= 55295 && 8232 !== e12 && 8233 !== e12 || 57344 <= e12 && e12 <= 65533 && 65279 !== e12 || 65536 <= e12 && e12 <= 1114111; + } + function U6(e12, t10) { + return F6(e12) && 65279 !== e12 && e12 !== j6 && e12 !== O7 && e12 !== T6 && e12 !== I6 && e12 !== q5 && e12 !== x7 && (e12 !== h8 || t10 && function(e13) { + return F6(e13) && !N6(e13) && 65279 !== e13 && e13 !== f8 && e13 !== d7; + }(t10)); + } + function L6(e12) { + return /^\n* /.test(e12); + } + var z6 = 1, B6 = 2, Q5 = 3, K5 = 4, H5 = 5; + function G5(e12, t10, i9, n9, o8) { + var s8 = function() { + if (0 === t10.length) + return "''"; + if (!e12.noCompatMode && -1 !== M6.indexOf(t10)) + return "'" + t10 + "'"; + var o9 = e12.indent * Math.max(1, i9), s9 = -1 === e12.lineWidth ? -1 : Math.max(Math.min(e12.lineWidth, 40), e12.lineWidth - o9), a8 = n9 || e12.flowLevel > -1 && i9 >= e12.flowLevel; + switch (function(e13, t11, i10, n10, r9) { + var o10, s10, a9, p8, c8 = false, f9 = false, l8 = -1 !== n10, k7 = -1, M7 = F6(p8 = e13.charCodeAt(0)) && 65279 !== p8 && !N6(p8) && p8 !== $5 && p8 !== S6 && p8 !== x7 && p8 !== j6 && p8 !== O7 && p8 !== T6 && p8 !== I6 && p8 !== q5 && p8 !== h8 && p8 !== g7 && p8 !== v8 && p8 !== u7 && p8 !== E6 && p8 !== _6 && p8 !== w6 && p8 !== b8 && p8 !== m7 && p8 !== y7 && p8 !== P6 && p8 !== A6 && !N6(e13.charCodeAt(e13.length - 1)); + if (t11) + for (o10 = 0; o10 < e13.length; o10++) { + if (!F6(s10 = e13.charCodeAt(o10))) + return H5; + a9 = o10 > 0 ? e13.charCodeAt(o10 - 1) : null, M7 = M7 && U6(s10, a9); + } + else { + for (o10 = 0; o10 < e13.length; o10++) { + if ((s10 = e13.charCodeAt(o10)) === d7) + c8 = true, l8 && (f9 = f9 || o10 - k7 - 1 > n10 && " " !== e13[k7 + 1], k7 = o10); + else if (!F6(s10)) + return H5; + a9 = o10 > 0 ? e13.charCodeAt(o10 - 1) : null, M7 = M7 && U6(s10, a9); + } + f9 = f9 || l8 && o10 - k7 - 1 > n10 && " " !== e13[k7 + 1]; + } + return c8 || f9 ? i10 > 9 && L6(e13) ? H5 : f9 ? K5 : Q5 : M7 && !r9(e13) ? z6 : B6; + }(t10, a8, e12.indent, s9, function(t11) { + return function(e13, t12) { + var i10, n10; + for (i10 = 0, n10 = e13.implicitTypes.length; i10 < n10; i10 += 1) + if (e13.implicitTypes[i10].resolve(t12)) + return true; + return false; + }(e12, t11); + })) { + case z6: + return t10; + case B6: + return "'" + t10.replace(/'/g, "''") + "'"; + case Q5: + return "|" + W5(t10, e12.indent) + J5(C6(t10, o9)); + case K5: + return ">" + W5(t10, e12.indent) + J5(C6(function(e13, t11) { + for (var i10, n10, r9, o10 = /(\n+)([^\n]*)/g, s10 = (r9 = -1 !== (r9 = e13.indexOf("\n")) ? r9 : e13.length, o10.lastIndex = r9, Z5(e13.slice(0, r9), t11)), a9 = "\n" === e13[0] || " " === e13[0]; n10 = o10.exec(e13); ) { + var p8 = n10[1], c8 = n10[2]; + i10 = " " === c8[0], s10 += p8 + (a9 || i10 || "" === c8 ? "" : "\n") + Z5(c8, t11), a9 = i10; + } + return s10; + }(t10, s9), o9)); + case H5: + return '"' + function(e13) { + for (var t11, i10, n10, r9 = "", o10 = 0; o10 < e13.length; o10++) + (t11 = e13.charCodeAt(o10)) >= 55296 && t11 <= 56319 && (i10 = e13.charCodeAt(o10 + 1)) >= 56320 && i10 <= 57343 ? (r9 += R6(1024 * (t11 - 55296) + i10 - 56320 + 65536), o10++) : r9 += !(n10 = k6[t11]) && F6(t11) ? e13[o10] : n10 || R6(t11); + return r9; + }(t10) + '"'; + default: + throw new r8("impossible error: invalid scalar style"); + } + }(); + if (!n9) { + let t11 = new oe4(e12, o8).write(i9, "before-eol"); + "" !== t11 && (s8 += " " + t11); + } + e12.dump = s8; + } + function W5(e12, t10) { + var i9 = L6(e12) ? String(t10) : "", n9 = "\n" === e12[e12.length - 1]; + return i9 + (!n9 || "\n" !== e12[e12.length - 2] && "\n" !== e12 ? n9 ? "" : "-" : "+") + "\n"; + } + function J5(e12) { + return "\n" === e12[e12.length - 1] ? e12.slice(0, -1) : e12; + } + function Z5(e12, t10) { + if ("" === e12 || " " === e12[0]) + return e12; + for (var i9, n9, r9 = / [^ ]/g, o8 = 0, s8 = 0, a8 = 0, p8 = ""; i9 = r9.exec(e12); ) + (a8 = i9.index) - o8 > t10 && (n9 = s8 > o8 ? s8 : a8, p8 += "\n" + e12.slice(o8, n9), o8 = n9 + 1), s8 = a8; + return p8 += "\n", e12.length - o8 > t10 && s8 > o8 ? p8 += e12.slice(o8, s8) + "\n" + e12.slice(s8 + 1) : p8 += e12.slice(o8), p8.slice(1); + } + function Y6(e12, t10, i9) { + var n9, o8, s8, c8, d8, f9; + for (s8 = 0, c8 = (o8 = i9 ? e12.explicitTypes : e12.implicitTypes).length; s8 < c8; s8 += 1) + if (((d8 = o8[s8]).instanceOf || d8.predicate) && (!d8.instanceOf || "object" == typeof t10 && t10 instanceof d8.instanceOf) && (!d8.predicate || d8.predicate(t10))) { + if (e12.tag = i9 ? d8.tag : "?", d8.represent) { + if (f9 = e12.styleMap[d8.tag] || d8.defaultStyle, "[object Function]" === a7.call(d8.represent)) + n9 = d8.represent(t10, f9); + else { + if (!p7.call(d8.represent, f9)) + throw new r8("!<" + d8.tag + '> tag resolver accepts not "' + f9 + '" style'); + n9 = d8.represent[f9](t10, f9); + } + e12.dump = n9; + } + return true; + } + return false; + } + function X5(e12, t10, i9, n9, o8, s8, p8) { + e12.tag = null, e12.dump = i9, Y6(e12, i9, false) || Y6(e12, i9, true); + var c8 = a7.call(e12.dump); + n9 && (n9 = e12.flowLevel < 0 || e12.flowLevel > t10), (null !== e12.tag && "?" !== e12.tag || 2 !== e12.indent && t10 > 0) && (o8 = false); + var f9, l8, u8 = "[object Object]" === c8 || "[object Array]" === c8; + if (u8 && (l8 = -1 !== (f9 = e12.duplicates.indexOf(i9))), (null !== e12.tag && "?" !== e12.tag || l8 || 2 !== e12.indent && t10 > 0) && (o8 = false), l8 && e12.usedDuplicates[f9]) + e12.dump = "*ref_" + f9; + else { + if (u8 && l8 && !e12.usedDuplicates[f9] && (e12.usedDuplicates[f9] = true), "[object Object]" === c8) + n9 && 0 !== Object.keys(e12.dump).length ? (function(e13, t11, i10, n10, o9) { + var s9, a8, p9, c9, f10, l9, u9 = "", m9 = e13.tag, h9 = Object.keys(i10); + if (true === e13.sortKeys) + h9.sort(); + else if ("function" == typeof e13.sortKeys) + h9.sort(e13.sortKeys); + else if (e13.sortKeys) + throw new r8("sortKeys must be a boolean or a function"); + var y8, g8 = new oe4(e13, o9); + for (u9 += g8.write(t11, "before-eol"), u9 += g8.write(t11, "leading"), s9 = 0, a8 = h9.length; s9 < a8; s9 += 1) + l9 = "", n10 && 0 === s9 || (l9 += V5(e13, t11)), c9 = i10[p9 = h9[s9]], u9 += g8.writeAt(p9, t11, "before"), X5(e13, t11 + 1, p9, true, true, true, o9) && ((f10 = null !== e13.tag && "?" !== e13.tag || e13.dump && e13.dump.length > 1024) && (e13.dump && d7 === e13.dump.charCodeAt(0) ? l9 += "?" : l9 += "? "), l9 += e13.dump, f10 && (l9 += V5(e13, t11)), X5(e13, t11 + 1, c9, true, f10, false, `${o9}/${y8 = p9, y8.replace(ne4, "~0").replace(re4, "~1")}`) && (e13.dump && d7 === e13.dump.charCodeAt(0) ? l9 += ":" : l9 += ": ", u9 += l9 += e13.dump, u9 += g8.writeAt(t11, p9, "after"))); + e13.tag = m9, e13.dump = u9 || "{}", e13.dump += g8.write(t11, "trailing"); + }(e12, t10, e12.dump, o8, p8), l8 && (e12.dump = "&ref_" + f9 + e12.dump)) : (function(e13, t11, i10, n10) { + var r9, o9, s9, a8, p9, c9 = "", d8 = e13.tag, f10 = Object.keys(i10); + for (r9 = 0, o9 = f10.length; r9 < o9; r9 += 1) + p9 = "", 0 !== r9 && (p9 += ", "), e13.condenseFlow && (p9 += '"'), a8 = i10[s9 = f10[r9]], X5(e13, t11, s9, false, false, false, n10) && (e13.dump.length > 1024 && (p9 += "? "), p9 += e13.dump + (e13.condenseFlow ? '"' : "") + ":" + (e13.condenseFlow ? "" : " "), X5(e13, t11, a8, false, false, false, n10) && (c9 += p9 += e13.dump)); + e13.tag = d8, e13.dump = "{" + c9 + "}"; + }(e12, t10, e12.dump, p8), l8 && (e12.dump = "&ref_" + f9 + " " + e12.dump)); + else if ("[object Array]" === c8) { + var m8 = e12.noArrayIndent && t10 > 0 ? t10 - 1 : t10; + n9 && 0 !== e12.dump.length ? (function(e13, t11, i10, n10, r9) { + var o9, s9, a8 = "", p9 = e13.tag, c9 = new oe4(e13, r9); + for (a8 += c9.write(t11, "before-eol"), a8 += c9.write(t11, "leading"), o9 = 0, s9 = i10.length; o9 < s9; o9 += 1) + a8 += c9.writeAt(String(o9), t11, "before"), X5(e13, t11 + 1, i10[o9], true, true, false, `${r9}/${o9}`) && (n10 && 0 === o9 || (a8 += V5(e13, t11)), e13.dump && d7 === e13.dump.charCodeAt(0) ? a8 += "-" : a8 += "- ", a8 += e13.dump), a8 += c9.writeAt(String(o9), t11, "after"); + e13.tag = p9, e13.dump = a8 || "[]", e13.dump += c9.write(t11, "trailing"); + }(e12, m8, e12.dump, o8, p8), l8 && (e12.dump = "&ref_" + f9 + e12.dump)) : (function(e13, t11, i10, n10) { + var r9, o9, s9 = "", a8 = e13.tag; + for (r9 = 0, o9 = i10.length; r9 < o9; r9 += 1) + X5(e13, t11, i10[r9], false, false, false, n10) && (0 !== r9 && (s9 += "," + (e13.condenseFlow ? "" : " ")), s9 += e13.dump); + e13.tag = a8, e13.dump = "[" + s9 + "]"; + }(e12, m8, e12.dump, p8), l8 && (e12.dump = "&ref_" + f9 + " " + e12.dump)); + } else { + if ("[object String]" !== c8) { + if (e12.skipInvalid) + return false; + throw new r8("unacceptable kind of an object to dump " + c8); + } + "?" !== e12.tag && G5(e12, e12.dump, t10, s8, p8); + } + null !== e12.tag && "?" !== e12.tag && (e12.dump = "!<" + e12.tag + "> " + e12.dump); + } + return true; + } + function ee4(e12, t10) { + var i9, n9, r9 = [], o8 = []; + for (te4(e12, r9, o8), i9 = 0, n9 = o8.length; i9 < n9; i9 += 1) + t10.duplicates.push(r9[o8[i9]]); + t10.usedDuplicates = new Array(n9); + } + function te4(e12, t10, i9) { + var n9, r9, o8; + if (null !== e12 && "object" == typeof e12) + if (-1 !== (r9 = t10.indexOf(e12))) + -1 === i9.indexOf(r9) && i9.push(r9); + else if (t10.push(e12), Array.isArray(e12)) + for (r9 = 0, o8 = e12.length; r9 < o8; r9 += 1) + te4(e12[r9], t10, i9); + else + for (r9 = 0, o8 = (n9 = Object.keys(e12)).length; r9 < o8; r9 += 1) + te4(e12[n9[r9]], t10, i9); + } + function ie3(e12, t10) { + var i9 = new D6(t10 = t10 || {}); + return t10.noRefs || ee4(e12, i9), X5(i9, 0, e12, true, true, false, "#") ? i9.dump + "\n" : ""; + } + t9.dump = ie3, t9.safeDump = function(e12, t10) { + return ie3(e12, n8.extend({ schema: s7 }, t10)); + }; + const ne4 = /~/g, re4 = /\//g; + function oe4(e12, t10) { + if (this.state = e12, this.comments = { "before-eol": /* @__PURE__ */ new Set(), leading: /* @__PURE__ */ new Set(), trailing: /* @__PURE__ */ new Set(), before: /* @__PURE__ */ new Map(), after: /* @__PURE__ */ new Map() }, this.written = /* @__PURE__ */ new WeakSet(), null !== e12.comments && t10 in e12.comments) + for (let i9 of e12.comments[t10]) + switch (i9.placement) { + case "before-eol": + case "leading": + case "trailing": + this.comments[i9.placement].add(i9); + break; + case "between": + let e13 = this.comments.before.get(i9.between[1]); + e13 ? e13.add(i9) : this.comments.before.set(i9.between[1], /* @__PURE__ */ new Set([i9])); + let t11 = this.comments.after.get(i9.between[0]); + t11 ? t11.add(i9) : this.comments.after.set(i9.between[0], /* @__PURE__ */ new Set([i9])); + } + } + oe4.prototype.write = function(e12, t10) { + let i9 = ""; + for (let n9 of this.comments[t10]) + i9 += this._write(n9, e12); + return i9; + }, oe4.prototype.writeAt = function(e12, t10, i9) { + let n9 = "", r9 = this.comments[i9].get(e12); + if (r9) + for (let e13 of r9) + n9 += this._write(e13, t10); + return n9; + }, oe4.prototype._write = function(e12, t10) { + if (this.written.has(e12)) + return ""; + this.written.add(e12); + let i9 = "#" + e12.value; + return "before-eol" === e12.placement ? i9 : 0 === t10 && "leading" === e12.placement ? i9 + "\n" : V5(this.state, t10) + i9; + }; + }, 94716: (e11) => { + "use strict"; + class t9 { + constructor(e12, t10 = null, i8 = false) { + this.name = "YAMLException", this.reason = e12, this.mark = t10, this.message = this.toString(false), this.isWarning = i8; + } + static isInstance(e12) { + if (null != e12 && e12.getClassIdentifier && "function" == typeof e12.getClassIdentifier) { + for (let i8 of e12.getClassIdentifier()) + if (i8 == t9.CLASS_IDENTIFIER) + return true; + } + return false; + } + getClassIdentifier() { + return [].concat(t9.CLASS_IDENTIFIER); + } + toString(e12 = false) { + var t10; + return t10 = "JS-YAML: " + (this.reason || "(unknown reason)"), !e12 && this.mark && (t10 += " " + this.mark.toString()), t10; + } + } + t9.CLASS_IDENTIFIER = "yaml-ast-parser.YAMLException", e11.exports = t9; + }, 85725: (e11, t9, i8) => { + "use strict"; + function n8(e12) { + for (var i9 in e12) + t9.hasOwnProperty(i9) || (t9[i9] = e12[i9]); + } + Object.defineProperty(t9, "__esModule", { value: true }); + var r8 = i8(89130); + t9.load = r8.load, t9.loadAll = r8.loadAll, t9.safeLoad = r8.safeLoad, t9.safeLoadAll = r8.safeLoadAll; + var o7 = i8(17128); + t9.dump = o7.dump, t9.safeDump = o7.safeDump, t9.YAMLException = i8(94716), n8(i8(37952)), n8(i8(58198)); + }, 89130: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(37952), r8 = i8(29228), o7 = i8(94716), s7 = i8(57804), a7 = i8(23102), p7 = i8(80406); + var c7 = Object.prototype.hasOwnProperty, d7 = 1, f8 = 2, l7 = 3, u7 = 4, m7 = 1, h8 = 2, y7 = 3, g7 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, b8 = /[\x85\u2028\u2029]/, v8 = /[,\[\]\{\}]/, j6 = /^(?:!|!!|![a-z\-]+!)$/i, $5 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function x7(e12) { + return 10 === e12 || 13 === e12; + } + function _6(e12) { + return 9 === e12 || 32 === e12; + } + function w6(e12) { + return 9 === e12 || 32 === e12 || 10 === e12 || 13 === e12; + } + function S6(e12) { + return 44 === e12 || 91 === e12 || 93 === e12 || 123 === e12 || 125 === e12; + } + function P6(e12) { + var t10; + return 48 <= e12 && e12 <= 57 ? e12 - 48 : 97 <= (t10 = 32 | e12) && t10 <= 102 ? t10 - 97 + 10 : -1; + } + function O7(e12) { + return 120 === e12 ? 2 : 117 === e12 ? 4 : 85 === e12 ? 8 : 0; + } + function T6(e12) { + return 48 <= e12 && e12 <= 57 ? e12 - 48 : -1; + } + function A6(e12) { + return e12 <= 65535 ? String.fromCharCode(e12) : String.fromCharCode(55296 + (e12 - 65536 >> 10), 56320 + (e12 - 65536 & 1023)); + } + for (var I6, E6 = new Array(256), q5 = new Array(256), k6 = new Array(256), M6 = new Array(256), R6 = 0; R6 < 256; R6++) + M6[R6] = q5[R6] = 48 === (I6 = R6) ? "\0" : 97 === I6 ? "\x07" : 98 === I6 ? "\b" : 116 === I6 || 9 === I6 ? " " : 110 === I6 ? "\n" : 118 === I6 ? "\v" : 102 === I6 ? "\f" : 114 === I6 ? "\r" : 101 === I6 ? "\x1B" : 32 === I6 ? " " : 34 === I6 ? '"' : 47 === I6 ? "/" : 92 === I6 ? "\\" : 78 === I6 ? "\x85" : 95 === I6 ? "\xA0" : 76 === I6 ? "\u2028" : 80 === I6 ? "\u2029" : "", E6[R6] = q5[R6] ? 1 : 0, k6[R6] = 1, E6[R6] || (M6[R6] = "\\" + String.fromCharCode(R6)); + class D6 { + constructor(e12, t10) { + this.errorMap = {}, this.errors = [], this.lines = [], this.input = e12, this.filename = t10.filename || null, this.schema = t10.schema || p7, this.onWarning = t10.onWarning || null, this.legacy = t10.legacy || false, this.allowAnyEscape = t10.allowAnyEscape || false, this.ignoreDuplicateKeys = t10.ignoreDuplicateKeys || false, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e12.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.documents = []; + } + } + function C6(e12, t10, i9 = false) { + return new o7(t10, new s7(e12.filename, e12.input, e12.position, e12.line, e12.position - e12.lineStart), i9); + } + function V5(e12, t10, i9, n9 = false, r9 = false) { + var a8 = function(e13, t11) { + for (var i10, n10 = 0; n10 < e13.lines.length && !(e13.lines[n10].start > t11); n10++) + i10 = e13.lines[n10]; + return i10 || { start: 0, line: 0 }; + }(e12, t10); + if (a8) { + var p8 = i9 + t10; + if (!e12.errorMap[p8]) { + var c8 = new s7(e12.filename, e12.input, t10, a8.line, t10 - a8.start); + r9 && (c8.toLineEnd = true); + var d8 = new o7(i9, c8, n9); + e12.errors.push(d8); + } + } + } + function N6(e12, t10) { + var i9 = C6(e12, t10), n9 = i9.message + i9.mark.position; + if (!e12.errorMap[n9]) { + e12.errors.push(i9), e12.errorMap[n9] = 1; + for (var r9 = e12.position; ; ) { + if (e12.position >= e12.input.length - 1) + return; + var o8 = e12.input.charAt(e12.position); + if ("\n" == o8) + return e12.position--, void (e12.position == r9 && (e12.position += 1)); + if ("\r" == o8) + return e12.position--, void (e12.position == r9 && (e12.position += 1)); + e12.position++; + } + } + } + function F6(e12, t10) { + var i9 = C6(e12, t10); + e12.onWarning && e12.onWarning.call(null, i9); + } + var U6 = { YAML: function(e12, t10, i9) { + var n9, r9, o8; + null !== e12.version && N6(e12, "duplication of %YAML directive"), 1 !== i9.length && N6(e12, "YAML directive accepts exactly one argument"), null === (n9 = /^([0-9]+)\.([0-9]+)$/.exec(i9[0])) && N6(e12, "ill-formed argument of the YAML directive"), r9 = parseInt(n9[1], 10), o8 = parseInt(n9[2], 10), 1 !== r9 && N6(e12, "found incompatible YAML document (version 1.2 is required)"), e12.version = i9[0], e12.checkLineBreaks = o8 < 2, 2 !== o8 && N6(e12, "found incompatible YAML document (version 1.2 is required)"); + }, TAG: function(e12, t10, i9) { + var n9, r9; + 2 !== i9.length && N6(e12, "TAG directive accepts exactly two arguments"), n9 = i9[0], r9 = i9[1], j6.test(n9) || N6(e12, "ill-formed tag handle (first argument) of the TAG directive"), c7.call(e12.tagMap, n9) && N6(e12, 'there is a previously declared suffix for "' + n9 + '" tag handle'), $5.test(r9) || N6(e12, "ill-formed tag prefix (second argument) of the TAG directive"), e12.tagMap[n9] = r9; + } }; + function L6(e12, t10, i9, n9) { + var r9, o8, s8, a8, p8 = e12.result; + if (-1 == p8.startPosition && (p8.startPosition = t10), t10 <= i9) { + if (a8 = e12.input.slice(t10, i9), n9) + for (r9 = 0, o8 = a8.length; r9 < o8; r9 += 1) + 9 === (s8 = a8.charCodeAt(r9)) || 32 <= s8 && s8 <= 1114111 || N6(e12, "expected valid JSON character"); + else + g7.test(a8) && N6(e12, "the stream contains non-printable characters"); + p8.value += a8, p8.endPosition = i9; + } + } + function z6(e12, t10, i9, r9, o8) { + if (null != r9) { + null === t10 && (t10 = { startPosition: r9.startPosition, endPosition: o8.endPosition, parent: null, errors: [], mappings: [], kind: n8.Kind.MAP }); + var s8 = n8.newMapping(r9, o8); + return s8.parent = t10, r9.parent = s8, null != o8 && (o8.parent = s8), !e12.ignoreDuplicateKeys && t10.mappings.forEach((t11) => { + t11.key && t11.key.value === (s8.key && s8.key.value) && (V5(e12, s8.key.startPosition, "duplicate key"), V5(e12, t11.key.startPosition, "duplicate key")); + }), t10.mappings.push(s8), t10.endPosition = o8 ? o8.endPosition : r9.endPosition + 1, t10; + } + } + function B6(e12) { + var t10; + 10 === (t10 = e12.input.charCodeAt(e12.position)) ? e12.position++ : 13 === t10 ? (e12.position++, 10 === e12.input.charCodeAt(e12.position) && e12.position++) : N6(e12, "a line break is expected"), e12.line += 1, e12.lineStart = e12.position, e12.lines.push({ start: e12.lineStart, line: e12.line }); + } + function Q5(e12) { + var t10 = 0, i9 = e12.position; + do { + t10 = e12.input.charCodeAt(++e12.position); + } while (0 !== t10 && !x7(t10)); + e12.comments.push({ startPosition: i9, endPosition: e12.position, value: e12.input.slice(i9 + 1, e12.position) }); + } + function K5(e12, t10, i9) { + for (var n9 = 0, r9 = e12.input.charCodeAt(e12.position); 0 !== r9; ) { + for (; _6(r9); ) + 9 === r9 && e12.errors.push(C6(e12, "Using tabs can lead to unpredictable results", true)), r9 = e12.input.charCodeAt(++e12.position); + if (t10 && 35 === r9 && (Q5(e12), r9 = e12.input.charCodeAt(e12.position)), !x7(r9)) + break; + for (B6(e12), r9 = e12.input.charCodeAt(e12.position), n9++, e12.lineIndent = 0; 32 === r9; ) + e12.lineIndent++, r9 = e12.input.charCodeAt(++e12.position); + } + return -1 !== i9 && 0 !== n9 && e12.lineIndent < i9 && F6(e12, "deficient indentation"), n9; + } + function H5(e12) { + var t10, i9 = e12.position; + return !(45 !== (t10 = e12.input.charCodeAt(i9)) && 46 !== t10 || e12.input.charCodeAt(i9 + 1) !== t10 || e12.input.charCodeAt(i9 + 2) !== t10 || (i9 += 3, 0 !== (t10 = e12.input.charCodeAt(i9)) && !w6(t10))); + } + function G5(e12, t10, i9) { + 1 === i9 ? t10.value += " " : i9 > 1 && (t10.value += r8.repeat("\n", i9 - 1)); + } + function W5(e12, t10) { + var i9, r9, o8 = e12.tag, s8 = e12.anchor, a8 = n8.newItems(), p8 = false; + for (null !== e12.anchor && (a8.anchorId = e12.anchor, e12.anchorMap[e12.anchor] = a8), a8.startPosition = e12.position, r9 = e12.input.charCodeAt(e12.position); 0 !== r9 && 45 === r9 && w6(e12.input.charCodeAt(e12.position + 1)); ) + if (p8 = true, e12.position++, K5(e12, true, -1) && e12.lineIndent <= t10) + a8.items.push(null), r9 = e12.input.charCodeAt(e12.position); + else if (i9 = e12.line, Y6(e12, t10, l7, false, true), e12.result && (e12.result.parent = a8, a8.items.push(e12.result)), K5(e12, true, -1), r9 = e12.input.charCodeAt(e12.position), (e12.line === i9 || e12.lineIndent > t10) && 0 !== r9) + N6(e12, "bad indentation of a sequence entry"); + else if (e12.lineIndent < t10) + break; + return a8.endPosition = e12.position, !!p8 && (e12.tag = o8, e12.anchor = s8, e12.kind = "sequence", e12.result = a8, a8.endPosition = e12.position, true); + } + function J5(e12) { + var t10, i9, n9, r9, o8 = false, s8 = false; + if (33 !== (r9 = e12.input.charCodeAt(e12.position))) + return false; + if (null !== e12.tag && N6(e12, "duplication of a tag property"), 60 === (r9 = e12.input.charCodeAt(++e12.position)) ? (o8 = true, r9 = e12.input.charCodeAt(++e12.position)) : 33 === r9 ? (s8 = true, i9 = "!!", r9 = e12.input.charCodeAt(++e12.position)) : i9 = "!", t10 = e12.position, o8) { + do { + r9 = e12.input.charCodeAt(++e12.position); + } while (0 !== r9 && 62 !== r9); + e12.position < e12.length ? (n9 = e12.input.slice(t10, e12.position), r9 = e12.input.charCodeAt(++e12.position)) : N6(e12, "unexpected end of the stream within a verbatim tag"); + } else { + for (; 0 !== r9 && !w6(r9); ) + 33 === r9 && (s8 ? N6(e12, "tag suffix cannot contain exclamation marks") : (i9 = e12.input.slice(t10 - 1, e12.position + 1), j6.test(i9) || N6(e12, "named tag handle cannot contain such characters"), s8 = true, t10 = e12.position + 1)), r9 = e12.input.charCodeAt(++e12.position); + n9 = e12.input.slice(t10, e12.position), v8.test(n9) && N6(e12, "tag suffix cannot contain flow indicator characters"); + } + return n9 && !$5.test(n9) && N6(e12, "tag name cannot contain such characters: " + n9), o8 ? e12.tag = n9 : c7.call(e12.tagMap, i9) ? e12.tag = e12.tagMap[i9] + n9 : "!" === i9 ? e12.tag = "!" + n9 : "!!" === i9 ? e12.tag = "tag:yaml.org,2002:" + n9 : N6(e12, 'undeclared tag handle "' + i9 + '"'), true; + } + function Z5(e12) { + var t10, i9; + if (38 !== (i9 = e12.input.charCodeAt(e12.position))) + return false; + for (null !== e12.anchor && N6(e12, "duplication of an anchor property"), i9 = e12.input.charCodeAt(++e12.position), t10 = e12.position; 0 !== i9 && !w6(i9) && !S6(i9); ) + i9 = e12.input.charCodeAt(++e12.position); + return e12.position === t10 && N6(e12, "name of an anchor node must contain at least one character"), e12.anchor = e12.input.slice(t10, e12.position), true; + } + function Y6(e12, t10, i9, o8, s8) { + var a8, p8, g8, b9, v9, j7, $6, I7, R7 = 1, D7 = false, C7 = false; + e12.tag = null, e12.anchor = null, e12.kind = null, e12.result = null, a8 = p8 = g8 = u7 === i9 || l7 === i9, o8 && K5(e12, true, -1) && (D7 = true, e12.lineIndent > t10 ? R7 = 1 : e12.lineIndent === t10 ? R7 = 0 : e12.lineIndent < t10 && (R7 = -1)); + let F7 = e12.position; + if (e12.position, e12.lineStart, 1 === R7) + for (; J5(e12) || Z5(e12); ) + K5(e12, true, -1) ? (D7 = true, g8 = a8, e12.lineIndent > t10 ? R7 = 1 : e12.lineIndent === t10 ? R7 = 0 : e12.lineIndent < t10 && (R7 = -1)) : g8 = false; + if (g8 && (g8 = D7 || s8), 1 !== R7 && u7 !== i9 || ($6 = d7 === i9 || f8 === i9 ? t10 : t10 + 1, I7 = e12.position - e12.lineStart, 1 === R7 ? g8 && (W5(e12, I7) || function(e13, t11, i10) { + var r9, o9, s9, a9, p9 = e13.tag, c8 = e13.anchor, d8 = n8.newMap(), l8 = null, m8 = null, h9 = false, y8 = false; + for (d8.startPosition = e13.position, null !== e13.anchor && (d8.anchorId = e13.anchor, e13.anchorMap[e13.anchor] = d8), a9 = e13.input.charCodeAt(e13.position); 0 !== a9; ) { + if (r9 = e13.input.charCodeAt(e13.position + 1), s9 = e13.line, 63 !== a9 && 58 !== a9 || !w6(r9)) { + if (!Y6(e13, i10, f8, false, true)) + break; + if (e13.line === s9) { + for (a9 = e13.input.charCodeAt(e13.position); _6(a9); ) + a9 = e13.input.charCodeAt(++e13.position); + if (58 === a9) + w6(a9 = e13.input.charCodeAt(++e13.position)) || N6(e13, "a whitespace character is expected after the key-value separator within a block mapping"), h9 && (z6(e13, d8, 0, l8, null), l8 = m8 = null), y8 = true, h9 = false, o9 = false, e13.tag, l8 = e13.result; + else { + if (e13.position == e13.lineStart && H5(e13)) + break; + if (!y8) + return e13.tag = p9, e13.anchor = c8, true; + N6(e13, "can not read an implicit mapping pair; a colon is missed"); + } + } else { + if (!y8) + return e13.tag = p9, e13.anchor = c8, true; + for (N6(e13, "can not read a block mapping entry; a multiline key may not be an implicit key"); e13.position > 0; ) + if (x7(a9 = e13.input.charCodeAt(--e13.position))) { + e13.position++; + break; + } + } + } else + 63 === a9 ? (h9 && (z6(e13, d8, 0, l8, null), l8 = m8 = null), y8 = true, h9 = true, o9 = true) : h9 ? (h9 = false, o9 = true) : N6(e13, "incomplete explicit mapping pair; a key node is missed"), e13.position += 1, a9 = r9; + if ((e13.line === s9 || e13.lineIndent > t11) && (Y6(e13, t11, u7, true, o9) && (h9 ? l8 = e13.result : m8 = e13.result), h9 || (z6(e13, d8, 0, l8, m8), l8 = m8 = null), K5(e13, true, -1), a9 = e13.input.charCodeAt(e13.position)), e13.lineIndent > t11 && 0 !== a9) + N6(e13, "bad indentation of a mapping entry"); + else if (e13.lineIndent < t11) + break; + } + return h9 && z6(e13, d8, 0, l8, null), y8 && (e13.tag = p9, e13.anchor = c8, e13.kind = "mapping", e13.result = d8), y8; + }(e12, I7, $6)) || function(e13, t11) { + var i10, r9, o9, s9, a9, p9, c8, f9, l8, u8 = true, m8 = e13.tag, h9 = e13.anchor; + if (91 === (l8 = e13.input.charCodeAt(e13.position))) + o9 = 93, p9 = false, (r9 = n8.newItems()).startPosition = e13.position; + else { + if (123 !== l8) + return false; + o9 = 125, p9 = true, (r9 = n8.newMap()).startPosition = e13.position; + } + for (null !== e13.anchor && (r9.anchorId = e13.anchor, e13.anchorMap[e13.anchor] = r9), l8 = e13.input.charCodeAt(++e13.position); 0 !== l8; ) { + if (K5(e13, true, t11), (l8 = e13.input.charCodeAt(e13.position)) === o9) + return e13.position++, e13.tag = m8, e13.anchor = h9, e13.kind = p9 ? "mapping" : "sequence", e13.result = r9, r9.endPosition = e13.position, true; + if (!u8) { + var y8 = e13.position; + N6(e13, "missed comma between flow collection entries"), e13.position = y8 + 1; + } + if (c8 = f9 = null, s9 = a9 = false, 63 === l8 && w6(e13.input.charCodeAt(e13.position + 1)) && (s9 = a9 = true, e13.position++, K5(e13, true, t11)), i10 = e13.line, Y6(e13, t11, d7, false, true), e13.tag, c8 = e13.result, K5(e13, true, t11), l8 = e13.input.charCodeAt(e13.position), !a9 && e13.line !== i10 || 58 !== l8 || (s9 = true, l8 = e13.input.charCodeAt(++e13.position), K5(e13, true, t11), Y6(e13, t11, d7, false, true), f9 = e13.result), p9) + z6(e13, r9, 0, c8, f9); + else if (s9) { + var g9 = z6(e13, null, 0, c8, f9); + g9.parent = r9, r9.items.push(g9); + } else + c8 && (c8.parent = r9), r9.items.push(c8); + r9.endPosition = e13.position + 1, K5(e13, true, t11), 44 === (l8 = e13.input.charCodeAt(e13.position)) ? (u8 = true, l8 = e13.input.charCodeAt(++e13.position)) : u8 = false; + } + N6(e13, "unexpected end of the stream within a flow collection"); + }(e12, $6) ? C7 = true : (p8 && function(e13, t11) { + var i10, o9, s9, a9, p9 = m7, c8 = false, d8 = t11, f9 = 0, l8 = false; + if (124 === (a9 = e13.input.charCodeAt(e13.position))) + o9 = false; + else { + if (62 !== a9) + return false; + o9 = true; + } + var u8 = n8.newScalar(); + for (e13.kind = "scalar", e13.result = u8, u8.startPosition = e13.position; 0 !== a9; ) + if (43 === (a9 = e13.input.charCodeAt(++e13.position)) || 45 === a9) + m7 === p9 ? p9 = 43 === a9 ? y7 : h8 : N6(e13, "repeat of a chomping mode identifier"); + else { + if (!((s9 = T6(a9)) >= 0)) + break; + 0 === s9 ? N6(e13, "bad explicit indentation width of a block scalar; it cannot be less than one") : c8 ? N6(e13, "repeat of an indentation width identifier") : (d8 = t11 + s9 - 1, c8 = true); + } + if (_6(a9)) { + do { + a9 = e13.input.charCodeAt(++e13.position); + } while (_6(a9)); + 35 === a9 && (Q5(e13), a9 = e13.input.charCodeAt(e13.position)); + } + for (; 0 !== a9; ) { + for (B6(e13), e13.lineIndent = 0, a9 = e13.input.charCodeAt(e13.position); (!c8 || e13.lineIndent < d8) && 32 === a9; ) + e13.lineIndent++, a9 = e13.input.charCodeAt(++e13.position); + if (!c8 && e13.lineIndent > d8 && (d8 = e13.lineIndent), x7(a9)) + f9++; + else { + if (e13.lineIndent < d8) { + p9 === y7 ? u8.value += r8.repeat("\n", f9) : p9 === m7 && c8 && (u8.value += "\n"); + break; + } + for (o9 ? _6(a9) ? (l8 = true, u8.value += r8.repeat("\n", f9 + 1)) : l8 ? (l8 = false, u8.value += r8.repeat("\n", f9 + 1)) : 0 === f9 ? c8 && (u8.value += " ") : u8.value += r8.repeat("\n", f9) : c8 && (u8.value += r8.repeat("\n", f9 + 1)), c8 = true, f9 = 0, i10 = e13.position; !x7(a9) && 0 !== a9; ) + a9 = e13.input.charCodeAt(++e13.position); + L6(e13, i10, e13.position, false); + } + } + u8.endPosition = e13.position; + for (var g9 = e13.position - 1; ; ) { + var b10 = e13.input[g9]; + if ("\r" == b10 || "\n" == b10) + break; + if (" " != b10 && " " != b10) + break; + g9--; + } + return u8.endPosition = g9, u8.rawValue = e13.input.substring(u8.startPosition, u8.endPosition), true; + }(e12, $6) || function(e13, t11) { + var i10, r9, o9; + if (39 !== (i10 = e13.input.charCodeAt(e13.position))) + return false; + var s9 = n8.newScalar(); + for (s9.singleQuoted = true, e13.kind = "scalar", e13.result = s9, s9.startPosition = e13.position, e13.position++, r9 = o9 = e13.position; 0 !== (i10 = e13.input.charCodeAt(e13.position)); ) + if (39 === i10) { + if (L6(e13, r9, e13.position, true), i10 = e13.input.charCodeAt(++e13.position), s9.endPosition = e13.position, 39 !== i10) + return true; + r9 = o9 = e13.position, e13.position++; + } else + x7(i10) ? (L6(e13, r9, o9, true), G5(0, s9, K5(e13, false, t11)), r9 = o9 = e13.position) : e13.position === e13.lineStart && H5(e13) ? N6(e13, "unexpected end of the document within a single quoted scalar") : (e13.position++, o9 = e13.position, s9.endPosition = e13.position); + N6(e13, "unexpected end of the stream within a single quoted scalar"); + }(e12, $6) || function(e13, t11) { + var i10, r9, o9, s9, a9, p9; + if (34 !== (p9 = e13.input.charCodeAt(e13.position))) + return false; + e13.kind = "scalar"; + var c8 = n8.newScalar(); + for (c8.doubleQuoted = true, e13.result = c8, c8.startPosition = e13.position, e13.position++, i10 = r9 = e13.position; 0 !== (p9 = e13.input.charCodeAt(e13.position)); ) { + if (34 === p9) + return L6(e13, i10, e13.position, true), e13.position++, c8.endPosition = e13.position, c8.rawValue = e13.input.substring(c8.startPosition, c8.endPosition), true; + if (92 === p9) { + if (L6(e13, i10, e13.position, true), x7(p9 = e13.input.charCodeAt(++e13.position))) + K5(e13, false, t11); + else if (p9 < 256 && (e13.allowAnyEscape ? k6[p9] : E6[p9])) + c8.value += e13.allowAnyEscape ? M6[p9] : q5[p9], e13.position++; + else if ((a9 = O7(p9)) > 0) { + for (o9 = a9, s9 = 0; o9 > 0; o9--) + (a9 = P6(p9 = e13.input.charCodeAt(++e13.position))) >= 0 ? s9 = (s9 << 4) + a9 : N6(e13, "expected hexadecimal character"); + c8.value += A6(s9), e13.position++; + } else + N6(e13, "unknown escape sequence"); + i10 = r9 = e13.position; + } else + x7(p9) ? (L6(e13, i10, r9, true), G5(0, c8, K5(e13, false, t11)), i10 = r9 = e13.position) : e13.position === e13.lineStart && H5(e13) ? N6(e13, "unexpected end of the document within a double quoted scalar") : (e13.position++, r9 = e13.position); + } + N6(e13, "unexpected end of the stream within a double quoted scalar"); + }(e12, $6) ? C7 = true : function(e13) { + var t11, i10, r9; + if (e13.length, e13.input, 42 !== (r9 = e13.input.charCodeAt(e13.position))) + return false; + for (r9 = e13.input.charCodeAt(++e13.position), t11 = e13.position; 0 !== r9 && !w6(r9) && !S6(r9); ) + r9 = e13.input.charCodeAt(++e13.position); + return e13.position <= t11 && (N6(e13, "name of an alias node must contain at least one character"), e13.position = t11 + 1), i10 = e13.input.slice(t11, e13.position), e13.anchorMap.hasOwnProperty(i10) || (N6(e13, 'unidentified alias "' + i10 + '"'), e13.position <= t11 && (e13.position = t11 + 1)), e13.result = n8.newAnchorRef(i10, t11, e13.position, e13.anchorMap[i10]), K5(e13, true, -1), true; + }(e12) ? (C7 = true, null === e12.tag && null === e12.anchor || N6(e12, "alias node should not have any properties")) : function(e13, t11, i10) { + var r9, o9, s9, a9, p9, c8, d8, f9, l8 = e13.kind, u8 = e13.result, m8 = n8.newScalar(); + if (m8.plainScalar = true, e13.result = m8, w6(f9 = e13.input.charCodeAt(e13.position)) || S6(f9) || 35 === f9 || 38 === f9 || 42 === f9 || 33 === f9 || 124 === f9 || 62 === f9 || 39 === f9 || 34 === f9 || 37 === f9 || 64 === f9 || 96 === f9) + return false; + if ((63 === f9 || 45 === f9) && (w6(r9 = e13.input.charCodeAt(e13.position + 1)) || i10 && S6(r9))) + return false; + for (e13.kind = "scalar", o9 = s9 = e13.position, a9 = false; 0 !== f9; ) { + if (58 === f9) { + if (w6(r9 = e13.input.charCodeAt(e13.position + 1)) || i10 && S6(r9)) + break; + } else if (35 === f9) { + if (w6(e13.input.charCodeAt(e13.position - 1))) + break; + } else { + if (e13.position === e13.lineStart && H5(e13) || i10 && S6(f9)) + break; + if (x7(f9)) { + if (p9 = e13.line, c8 = e13.lineStart, d8 = e13.lineIndent, K5(e13, false, -1), e13.lineIndent >= t11) { + a9 = true, f9 = e13.input.charCodeAt(e13.position); + continue; + } + e13.position = s9, e13.line = p9, e13.lineStart = c8, e13.lineIndent = d8; + break; + } + } + if (a9 && (L6(e13, o9, s9, false), G5(0, m8, e13.line - p9), o9 = s9 = e13.position, a9 = false), _6(f9) || (s9 = e13.position + 1), f9 = e13.input.charCodeAt(++e13.position), e13.position >= e13.input.length) + return false; + } + return L6(e13, o9, s9, false), -1 != e13.result.startPosition ? (m8.rawValue = e13.input.substring(m8.startPosition, m8.endPosition), true) : (e13.kind = l8, e13.result = u8, false); + }(e12, $6, d7 === i9) && (C7 = true, null === e12.tag && (e12.tag = "?")), null !== e12.anchor && (e12.anchorMap[e12.anchor] = e12.result, e12.result.anchorId = e12.anchor)) : 0 === R7 && (C7 = g8 && W5(e12, I7))), null !== e12.tag && "!" !== e12.tag) + if ("!include" == e12.tag) + e12.result || (e12.result = n8.newScalar(), e12.result.startPosition = e12.position, e12.result.endPosition = e12.position, N6(e12, "!include without value")), e12.result.kind = n8.Kind.INCLUDE_REF; + else if ("?" === e12.tag) + for (b9 = 0, v9 = e12.implicitTypes.length; b9 < v9; b9 += 1) { + j7 = e12.implicitTypes[b9]; + var U7 = e12.result.value; + if (j7.resolve(U7)) { + e12.result.valueObject = j7.construct(e12.result.value), e12.tag = j7.tag, null !== e12.anchor && (e12.result.anchorId = e12.anchor, e12.anchorMap[e12.anchor] = e12.result); + break; + } + } + else + c7.call(e12.typeMap, e12.tag) ? (j7 = e12.typeMap[e12.tag], null !== e12.result && j7.kind !== e12.kind && N6(e12, "unacceptable node kind for !<" + e12.tag + '> tag; it should be "' + j7.kind + '", not "' + e12.kind + '"'), j7.resolve(e12.result) ? (e12.result = j7.construct(e12.result), null !== e12.anchor && (e12.result.anchorId = e12.anchor, e12.anchorMap[e12.anchor] = e12.result)) : N6(e12, "cannot resolve a node with !<" + e12.tag + "> explicit tag")) : V5(e12, F7, "unknown tag <" + e12.tag + ">", false, true); + return null !== e12.tag || null !== e12.anchor || C7; + } + function X5(e12) { + var t10, i9, n9, r9, o8 = e12.position, s8 = false; + for (e12.version = null, e12.checkLineBreaks = e12.legacy, e12.tagMap = {}, e12.anchorMap = {}, e12.comments = []; 0 !== (r9 = e12.input.charCodeAt(e12.position)) && (K5(e12, true, -1), r9 = e12.input.charCodeAt(e12.position), !(e12.lineIndent > 0 || 37 !== r9)); ) { + for (s8 = true, r9 = e12.input.charCodeAt(++e12.position), t10 = e12.position; 0 !== r9 && !w6(r9); ) + r9 = e12.input.charCodeAt(++e12.position); + for (n9 = [], (i9 = e12.input.slice(t10, e12.position)).length < 1 && N6(e12, "directive name must not be less than one character in length"); 0 !== r9; ) { + for (; _6(r9); ) + r9 = e12.input.charCodeAt(++e12.position); + if (35 === r9) { + Q5(e12), r9 = e12.input.charCodeAt(e12.position); + break; + } + if (x7(r9)) + break; + for (t10 = e12.position; 0 !== r9 && !w6(r9); ) + r9 = e12.input.charCodeAt(++e12.position); + n9.push(e12.input.slice(t10, e12.position)); + } + 0 !== r9 && B6(e12), c7.call(U6, i9) ? U6[i9](e12, i9, n9) : (F6(e12, 'unknown document directive "' + i9 + '"'), e12.position++); + } + K5(e12, true, -1), 0 === e12.lineIndent && 45 === e12.input.charCodeAt(e12.position) && 45 === e12.input.charCodeAt(e12.position + 1) && 45 === e12.input.charCodeAt(e12.position + 2) ? (e12.position += 3, K5(e12, true, -1)) : s8 && N6(e12, "directives end mark is expected"), Y6(e12, e12.lineIndent - 1, u7, false, true), K5(e12, true, -1), e12.checkLineBreaks && b8.test(e12.input.slice(o8, e12.position)) && F6(e12, "non-ASCII line breaks are interpreted as content"), e12.result.comments = e12.comments, e12.documents.push(e12.result), e12.position === e12.lineStart && H5(e12) ? 46 === e12.input.charCodeAt(e12.position) && (e12.position += 3, K5(e12, true, -1)) : e12.position < e12.length - 1 && N6(e12, "end of the stream or a document separator is expected"); + } + function ee4(e12, t10) { + t10 = t10 || {}; + let i9 = (e12 = String(e12)).length; + 0 !== i9 && (10 !== e12.charCodeAt(i9 - 1) && 13 !== e12.charCodeAt(i9 - 1) && (e12 += "\n"), 65279 === e12.charCodeAt(0) && (e12 = e12.slice(1))); + var n9 = new D6(e12, t10); + for (n9.input += "\0"; 32 === n9.input.charCodeAt(n9.position); ) + n9.lineIndent += 1, n9.position += 1; + for (; n9.position < n9.length - 1; ) { + var r9 = n9.position; + if (X5(n9), n9.position <= r9) + for (; n9.position < n9.length - 1 && "\n" != n9.input.charAt(n9.position); n9.position++) + ; + } + let o8 = n9.documents, s8 = o8.length; + s8 > 0 && (o8[s8 - 1].endPosition = i9); + for (let e13 of o8) + e13.errors = n9.errors, e13.startPosition > e13.endPosition && (e13.startPosition = e13.endPosition); + return o8; + } + function te4(e12, t10, i9 = {}) { + var n9, r9, o8 = ee4(e12, i9); + for (n9 = 0, r9 = o8.length; n9 < r9; n9 += 1) + t10(o8[n9]); + } + function ie3(e12, t10 = {}) { + var i9 = ee4(e12, t10); + if (0 !== i9.length) { + if (1 === i9.length) + return i9[0]; + var n9 = new o7("expected a single document in the stream, but found more"); + return n9.mark = new s7("", "", 0, 0, 0), n9.mark.position = i9[0].endPosition, i9[0].errors.push(n9), i9[0]; + } + } + function ne4(e12, t10, i9 = {}) { + te4(e12, t10, r8.extend({ schema: a7 }, i9)); + } + function re4(e12, t10 = {}) { + return ie3(e12, r8.extend({ schema: a7 }, t10)); + } + t9.loadAll = te4, t9.load = ie3, t9.safeLoadAll = ne4, t9.safeLoad = re4, e11.exports.loadAll = te4, e11.exports.load = ie3, e11.exports.safeLoadAll = ne4, e11.exports.safeLoad = re4; + }, 57804: (e11, t9, i8) => { + "use strict"; + const n8 = i8(29228); + e11.exports = class { + constructor(e12, t10, i9, n9, r8) { + this.name = e12, this.buffer = t10, this.position = i9, this.line = n9, this.column = r8; + } + getSnippet(e12 = 0, t10 = 75) { + var i9, r8, o7, s7, a7; + if (!this.buffer) + return null; + for (e12 = e12 || 4, t10 = t10 || 75, i9 = "", r8 = this.position; r8 > 0 && -1 === "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(r8 - 1)); ) + if (r8 -= 1, this.position - r8 > t10 / 2 - 1) { + i9 = " ... ", r8 += 5; + break; + } + for (o7 = "", s7 = this.position; s7 < this.buffer.length && -1 === "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(s7)); ) + if ((s7 += 1) - this.position > t10 / 2 - 1) { + o7 = " ... ", s7 -= 5; + break; + } + return a7 = this.buffer.slice(r8, s7), n8.repeat(" ", e12) + i9 + a7 + o7 + "\n" + n8.repeat(" ", e12 + this.position - r8 + i9.length) + "^"; + } + toString(e12 = true) { + var t10, i9 = ""; + return this.name && (i9 += 'in "' + this.name + '" '), i9 += "at line " + (this.line + 1) + ", column " + (this.column + 1), e12 || (t10 = this.getSnippet()) && (i9 += ":\n" + t10), i9; + } + }; + }, 58198: (e11, t9) => { + "use strict"; + function i8(e12) { + const t10 = function(e13) { + return 0 === e13.lastIndexOf("0o", 0) ? parseInt(e13.substring(2), 8) : parseInt(e13); + }(e12); + if (Number.isNaN(t10)) + throw `Invalid integer "${e12}"`; + return t10; + } + var n8; + Object.defineProperty(t9, "__esModule", { value: true }), t9.parseYamlBoolean = function(e12) { + if (["true", "True", "TRUE"].lastIndexOf(e12) >= 0) + return true; + if (["false", "False", "FALSE"].lastIndexOf(e12) >= 0) + return false; + throw `Invalid boolean "${e12}"`; + }, t9.parseYamlInteger = i8, t9.parseYamlBigInteger = function(e12) { + const t10 = i8(e12); + return t10 > Number.MAX_SAFE_INTEGER && -1 === e12.lastIndexOf("0o", 0) ? BigInt(e12) : t10; + }, t9.parseYamlFloat = function(e12) { + if ([".nan", ".NaN", ".NAN"].lastIndexOf(e12) >= 0) + return NaN; + const t10 = /^([-+])?(?:\.inf|\.Inf|\.INF)$/.exec(e12); + if (t10) + return "-" === t10[1] ? -1 / 0 : 1 / 0; + const i9 = parseFloat(e12); + if (!isNaN(i9)) + return i9; + throw `Invalid float "${e12}"`; + }, function(e12) { + e12[e12.null = 0] = "null", e12[e12.bool = 1] = "bool", e12[e12.int = 2] = "int", e12[e12.float = 3] = "float", e12[e12.string = 4] = "string"; + }(n8 = t9.ScalarType || (t9.ScalarType = {})), t9.determineScalarType = function(e12) { + if (void 0 === e12) + return n8.null; + if (e12.doubleQuoted || !e12.plainScalar || e12.singleQuoted) + return n8.string; + const t10 = e12.value; + return ["null", "Null", "NULL", "~", ""].indexOf(t10) >= 0 || null == t10 ? n8.null : ["true", "True", "TRUE", "false", "False", "FALSE"].indexOf(t10) >= 0 ? n8.bool : /^[-+]?[0-9]+$/.test(t10) || /^0o[0-7]+$/.test(t10) || /^0x[0-9a-fA-F]+$/.test(t10) ? n8.int : /^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$/.test(t10) || /^[-+]?(\.inf|\.Inf|\.INF)$/.test(t10) || [".nan", ".NaN", ".NAN"].indexOf(t10) >= 0 ? n8.float : n8.string; + }; + }, 63114: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(29228), r8 = i8(94716), o7 = i8(23697); + function s7(e12, t10, i9) { + var n9 = []; + return e12.include.forEach(function(e13) { + i9 = s7(e13, t10, i9); + }), e12[t10].forEach(function(e13) { + i9.forEach(function(t11, i10) { + t11.tag === e13.tag && n9.push(i10); + }), i9.push(e13); + }), i9.filter(function(e13, t11) { + return -1 === n9.indexOf(t11); + }); + } + class a7 { + constructor(e12) { + this.include = e12.include || [], this.implicit = e12.implicit || [], this.explicit = e12.explicit || [], this.implicit.forEach(function(e13) { + if (e13.loadKind && "scalar" !== e13.loadKind) + throw new r8("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + }), this.compiledImplicit = s7(this, "implicit", []), this.compiledExplicit = s7(this, "explicit", []), this.compiledTypeMap = function() { + var e13, t10, i9 = {}; + function n9(e14) { + i9[e14.tag] = e14; + } + for (e13 = 0, t10 = arguments.length; e13 < t10; e13 += 1) + arguments[e13].forEach(n9); + return i9; + }(this.compiledImplicit, this.compiledExplicit); + } + } + t9.Schema = a7, a7.DEFAULT = null, a7.create = function() { + var e12, t10; + switch (arguments.length) { + case 1: + e12 = a7.DEFAULT, t10 = arguments[0]; + break; + case 2: + e12 = arguments[0], t10 = arguments[1]; + break; + default: + throw new r8("Wrong number of arguments for Schema.create function"); + } + if (e12 = n8.toArray(e12), t10 = n8.toArray(t10), !e12.every(function(e13) { + return e13 instanceof a7; + })) + throw new r8("Specified list of super schemas (or a single Schema object) contains a non-Schema object."); + if (!t10.every(function(e13) { + return e13 instanceof o7.Type; + })) + throw new r8("Specified list of YAML types (or a single Type object) contains a non-Type object."); + return new a7({ include: e12, explicit: t10 }); + }; + }, 17646: (e11, t9, i8) => { + "use strict"; + const n8 = i8(63114); + e11.exports = new n8.Schema({ include: [i8(24875)] }); + }, 80406: (e11, t9, i8) => { + "use strict"; + const n8 = i8(63114); + var r8 = new n8.Schema({ include: [i8(23102)], explicit: [i8(64520), i8(20903)] }); + n8.Schema.DEFAULT = r8, e11.exports = r8; + }, 23102: (e11, t9, i8) => { + "use strict"; + var n8 = new (i8(63114)).Schema({ include: [i8(17646)], implicit: [i8(25138), i8(67514)], explicit: [i8(27529), i8(6805), i8(95967), i8(33530)] }); + e11.exports = n8; + }, 84452: (e11, t9, i8) => { + "use strict"; + const n8 = i8(63114); + e11.exports = new n8.Schema({ explicit: [i8(41381), i8(62021), i8(35744)] }); + }, 24875: (e11, t9, i8) => { + "use strict"; + const n8 = i8(63114); + e11.exports = new n8.Schema({ include: [i8(84452)], implicit: [i8(99049), i8(86628), i8(84627), i8(77620)] }); + }, 23697: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(94716); + var r8 = ["kind", "resolve", "construct", "instanceOf", "predicate", "represent", "defaultStyle", "styleAliases"], o7 = ["scalar", "sequence", "mapping"]; + t9.Type = class { + constructor(e12, t10) { + var i9, s7; + if (t10 = t10 || {}, Object.keys(t10).forEach(function(t11) { + if (-1 === r8.indexOf(t11)) + throw new n8('Unknown option "' + t11 + '" is met in definition of "' + e12 + '" YAML type.'); + }), this.tag = e12, this.kind = t10.kind || null, this.resolve = t10.resolve || function() { + return true; + }, this.construct = t10.construct || function(e13) { + return e13; + }, this.instanceOf = t10.instanceOf || null, this.predicate = t10.predicate || null, this.represent = t10.represent || null, this.defaultStyle = t10.defaultStyle || null, this.styleAliases = (i9 = t10.styleAliases || null, s7 = {}, null !== i9 && Object.keys(i9).forEach(function(e13) { + i9[e13].forEach(function(t11) { + s7[String(t11)] = e13; + }); + }), s7), -1 === o7.indexOf(this.kind)) + throw new n8('Unknown kind "' + this.kind + '" is specified for "' + e12 + '" YAML type.'); + } + }; + }, 27529: (e11, t9, i8) => { + "use strict"; + var n8 = i8(1048).hp; + const r8 = i8(23697); + var o7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + e11.exports = new r8.Type("tag:yaml.org,2002:binary", { kind: "scalar", resolve: function(e12) { + if (null === e12) + return false; + var t10, i9, n9 = 0, r9 = e12.length, s7 = o7; + for (i9 = 0; i9 < r9; i9++) + if (!((t10 = s7.indexOf(e12.charAt(i9))) > 64)) { + if (t10 < 0) + return false; + n9 += 6; + } + return n9 % 8 == 0; + }, construct: function(e12) { + var t10, i9, r9 = e12.replace(/[\r\n=]/g, ""), s7 = r9.length, a7 = o7, p7 = 0, c7 = []; + for (t10 = 0; t10 < s7; t10++) + t10 % 4 == 0 && t10 && (c7.push(p7 >> 16 & 255), c7.push(p7 >> 8 & 255), c7.push(255 & p7)), p7 = p7 << 6 | a7.indexOf(r9.charAt(t10)); + return 0 == (i9 = s7 % 4 * 6) ? (c7.push(p7 >> 16 & 255), c7.push(p7 >> 8 & 255), c7.push(255 & p7)) : 18 === i9 ? (c7.push(p7 >> 10 & 255), c7.push(p7 >> 2 & 255)) : 12 === i9 && c7.push(p7 >> 4 & 255), n8 ? new n8(c7) : c7; + }, predicate: function(e12) { + return n8 && n8.isBuffer(e12); + }, represent: function(e12) { + var t10, i9, n9 = "", r9 = 0, s7 = e12.length, a7 = o7; + for (t10 = 0; t10 < s7; t10++) + t10 % 3 == 0 && t10 && (n9 += a7[r9 >> 18 & 63], n9 += a7[r9 >> 12 & 63], n9 += a7[r9 >> 6 & 63], n9 += a7[63 & r9]), r9 = (r9 << 8) + e12[t10]; + return 0 == (i9 = s7 % 3) ? (n9 += a7[r9 >> 18 & 63], n9 += a7[r9 >> 12 & 63], n9 += a7[r9 >> 6 & 63], n9 += a7[63 & r9]) : 2 === i9 ? (n9 += a7[r9 >> 10 & 63], n9 += a7[r9 >> 4 & 63], n9 += a7[r9 << 2 & 63], n9 += a7[64]) : 1 === i9 && (n9 += a7[r9 >> 2 & 63], n9 += a7[r9 << 4 & 63], n9 += a7[64], n9 += a7[64]), n9; + } }); + }, 86628: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:bool", { kind: "scalar", resolve: function(e12) { + if (null === e12) + return false; + var t10 = e12.length; + return 4 === t10 && ("true" === e12 || "True" === e12 || "TRUE" === e12) || 5 === t10 && ("false" === e12 || "False" === e12 || "FALSE" === e12); + }, construct: function(e12) { + return "true" === e12 || "True" === e12 || "TRUE" === e12; + }, predicate: function(e12) { + return "[object Boolean]" === Object.prototype.toString.call(e12); + }, represent: { lowercase: function(e12) { + return e12 ? "true" : "false"; + }, uppercase: function(e12) { + return e12 ? "TRUE" : "FALSE"; + }, camelcase: function(e12) { + return e12 ? "True" : "False"; + } }, defaultStyle: "lowercase" }); + }, 77620: (e11, t9, i8) => { + "use strict"; + const n8 = i8(29228), r8 = i8(23697); + var o7 = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); + e11.exports = new r8.Type("tag:yaml.org,2002:float", { kind: "scalar", resolve: function(e12) { + return null !== e12 && !!o7.test(e12); + }, construct: function(e12) { + var t10, i9, n9, r9; + return i9 = "-" === (t10 = e12.replace(/_/g, "").toLowerCase())[0] ? -1 : 1, r9 = [], 0 <= "+-".indexOf(t10[0]) && (t10 = t10.slice(1)), ".inf" === t10 ? 1 === i9 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : ".nan" === t10 ? NaN : 0 <= t10.indexOf(":") ? (t10.split(":").forEach(function(e13) { + r9.unshift(parseFloat(e13, 10)); + }), t10 = 0, n9 = 1, r9.forEach(function(e13) { + t10 += e13 * n9, n9 *= 60; + }), i9 * t10) : i9 * parseFloat(t10, 10); + }, predicate: function(e12) { + return "[object Number]" === Object.prototype.toString.call(e12) && (0 != e12 % 1 || n8.isNegativeZero(e12)); + }, represent: function(e12, t10) { + if (isNaN(e12)) + switch (t10) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + else if (Number.POSITIVE_INFINITY === e12) + switch (t10) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + else if (Number.NEGATIVE_INFINITY === e12) + switch (t10) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + else if (n8.isNegativeZero(e12)) + return "-0.0"; + return e12.toString(10); + }, defaultStyle: "lowercase" }); + }, 84627: (e11, t9, i8) => { + "use strict"; + const n8 = i8(29228), r8 = i8(23697); + function o7(e12) { + return 48 <= e12 && e12 <= 55; + } + function s7(e12) { + return 48 <= e12 && e12 <= 57; + } + e11.exports = new r8.Type("tag:yaml.org,2002:int", { kind: "scalar", resolve: function(e12) { + if (null === e12) + return false; + var t10, i9, n9 = e12.length, r9 = 0, a7 = false; + if (!n9) + return false; + if ("-" !== (t10 = e12[r9]) && "+" !== t10 || (t10 = e12[++r9]), "0" === t10) { + if (r9 + 1 === n9) + return true; + if ("b" === (t10 = e12[++r9])) { + for (r9++; r9 < n9; r9++) + if ("_" !== (t10 = e12[r9])) { + if ("0" !== t10 && "1" !== t10) + return false; + a7 = true; + } + return a7; + } + if ("x" === t10) { + for (r9++; r9 < n9; r9++) + if ("_" !== (t10 = e12[r9])) { + if (!(48 <= (i9 = e12.charCodeAt(r9)) && i9 <= 57 || 65 <= i9 && i9 <= 70 || 97 <= i9 && i9 <= 102)) + return false; + a7 = true; + } + return a7; + } + for (; r9 < n9; r9++) + if ("_" !== (t10 = e12[r9])) { + if (!o7(e12.charCodeAt(r9))) { + a7 = false; + break; + } + a7 = true; + } + if (a7) + return a7; + } + for (; r9 < n9; r9++) + if ("_" !== (t10 = e12[r9])) { + if (":" === t10) + break; + if (!s7(e12.charCodeAt(r9))) + return false; + a7 = true; + } + return !!a7 && (":" !== t10 || /^(:[0-5]?[0-9])+$/.test(e12.slice(r9))); + }, construct: function(e12) { + var t10, i9, n9 = e12, r9 = 1, o8 = []; + return -1 !== n9.indexOf("_") && (n9 = n9.replace(/_/g, "")), "-" !== (t10 = n9[0]) && "+" !== t10 || ("-" === t10 && (r9 = -1), t10 = (n9 = n9.slice(1))[0]), "0" === n9 ? 0 : "0" === t10 ? "b" === n9[1] ? r9 * parseInt(n9.slice(2), 2) : "x" === n9[1] ? r9 * parseInt(n9, 16) : r9 * parseInt(n9, 8) : -1 !== n9.indexOf(":") ? (n9.split(":").forEach(function(e13) { + o8.unshift(parseInt(e13, 10)); + }), n9 = 0, i9 = 1, o8.forEach(function(e13) { + n9 += e13 * i9, i9 *= 60; + }), r9 * n9) : r9 * parseInt(n9, 10); + }, predicate: function(e12) { + const t10 = Object.prototype.toString.call(e12); + return "[object Number]" === t10 && 0 == e12 % 1 && !n8.isNegativeZero(e12) || "[object BigInt]" === t10; + }, represent: { binary: function(e12) { + return "0b" + e12.toString(2); + }, octal: function(e12) { + return "0" + e12.toString(8); + }, decimal: function(e12) { + return e12.toString(10); + }, hexadecimal: function(e12) { + return "0x" + e12.toString(16).toUpperCase(); + } }, defaultStyle: "decimal", styleAliases: { binary: [2, "bin"], octal: [8, "oct"], decimal: [10, "dec"], hexadecimal: [16, "hex"] } }); + }, 20903: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:js/regexp", { kind: "scalar", resolve: function(e12) { + if (null === e12) + return false; + if (0 === e12.length) + return false; + var t10 = e12, i9 = /\/([gim]*)$/.exec(e12), n9 = ""; + if ("/" === t10[0]) { + if (i9 && (n9 = i9[1]), n9.length > 3) + return false; + if ("/" !== t10[t10.length - n9.length - 1]) + return false; + t10 = t10.slice(1, t10.length - n9.length - 1); + } + try { + return new RegExp(t10, n9), true; + } catch (e13) { + return false; + } + }, construct: function(e12) { + var t10 = e12, i9 = /\/([gim]*)$/.exec(e12), n9 = ""; + return "/" === t10[0] && (i9 && (n9 = i9[1]), t10 = t10.slice(1, t10.length - n9.length - 1)), new RegExp(t10, n9); + }, predicate: function(e12) { + return "[object RegExp]" === Object.prototype.toString.call(e12); + }, represent: function(e12) { + var t10 = "/" + e12.source + "/"; + return e12.global && (t10 += "g"), e12.multiline && (t10 += "m"), e12.ignoreCase && (t10 += "i"), t10; + } }); + }, 64520: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:js/undefined", { kind: "scalar", resolve: function() { + return true; + }, construct: function() { + }, predicate: function(e12) { + return void 0 === e12; + }, represent: function() { + return ""; + } }); + }, 35744: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:map", { kind: "mapping", construct: function(e12) { + return null !== e12 ? e12 : {}; + } }); + }, 67514: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:merge", { kind: "scalar", resolve: function(e12) { + return "<<" === e12 || null === e12; + } }); + }, 99049: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:null", { kind: "scalar", resolve: function(e12) { + if (null === e12) + return true; + var t10 = e12.length; + return 1 === t10 && "~" === e12 || 4 === t10 && ("null" === e12 || "Null" === e12 || "NULL" === e12); + }, construct: function() { + return null; + }, predicate: function(e12) { + return null === e12; + }, represent: { canonical: function() { + return "~"; + }, lowercase: function() { + return "null"; + }, uppercase: function() { + return "NULL"; + }, camelcase: function() { + return "Null"; + } }, defaultStyle: "lowercase" }); + }, 6805: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + var r8 = Object.prototype.hasOwnProperty, o7 = Object.prototype.toString; + e11.exports = new n8.Type("tag:yaml.org,2002:omap", { kind: "sequence", resolve: function(e12) { + if (null === e12) + return true; + var t10, i9, n9, s7, a7, p7 = [], c7 = e12; + for (t10 = 0, i9 = c7.length; t10 < i9; t10 += 1) { + if (n9 = c7[t10], a7 = false, "[object Object]" !== o7.call(n9)) + return false; + for (s7 in n9) + if (r8.call(n9, s7)) { + if (a7) + return false; + a7 = true; + } + if (!a7) + return false; + if (-1 !== p7.indexOf(s7)) + return false; + p7.push(s7); + } + return true; + }, construct: function(e12) { + return null !== e12 ? e12 : []; + } }); + }, 95967: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697), r8 = i8(37952); + var o7 = Object.prototype.toString; + e11.exports = new n8.Type("tag:yaml.org,2002:pairs", { kind: "sequence", resolve: function(e12) { + if (null === e12) + return true; + if (e12.kind != r8.Kind.SEQ) + return false; + var t10, i9, n9, s7 = e12.items; + for (t10 = 0, i9 = s7.length; t10 < i9; t10 += 1) { + if (n9 = s7[t10], "[object Object]" !== o7.call(n9)) + return false; + if (!Array.isArray(n9.mappings)) + return false; + if (1 !== n9.mappings.length) + return false; + } + return true; + }, construct: function(e12) { + if (null === e12 || !Array.isArray(e12.items)) + return []; + let t10, i9, n9, o8 = e12.items; + for (n9 = r8.newItems(), n9.parent = e12.parent, n9.startPosition = e12.startPosition, n9.endPosition = e12.endPosition, t10 = 0, i9 = o8.length; t10 < i9; t10 += 1) { + let e13 = o8[t10].mappings[0], i10 = r8.newItems(); + i10.parent = n9, i10.startPosition = e13.key.startPosition, i10.endPosition = e13.value.startPosition, e13.key.parent = i10, e13.value.parent = i10, i10.items = [e13.key, e13.value], n9.items.push(i10); + } + return n9; + } }); + }, 62021: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(e12) { + return null !== e12 ? e12 : []; + } }); + }, 33530: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697), r8 = i8(37952); + Object.prototype.hasOwnProperty, e11.exports = new n8.Type("tag:yaml.org,2002:set", { kind: "mapping", resolve: function(e12) { + return null === e12 || e12.kind == r8.Kind.MAP; + }, construct: function(e12) { + return null !== e12 ? e12 : {}; + } }); + }, 41381: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + e11.exports = new n8.Type("tag:yaml.org,2002:str", { kind: "scalar", construct: function(e12) { + return null !== e12 ? e12 : ""; + } }); + }, 25138: (e11, t9, i8) => { + "use strict"; + const n8 = i8(23697); + var r8 = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$"); + e11.exports = new n8.Type("tag:yaml.org,2002:timestamp", { kind: "scalar", resolve: function(e12) { + return null !== e12 && null !== r8.exec(e12); + }, construct: function(e12) { + var t10, i9, n9, o7, s7, a7, p7, c7, d7 = 0, f8 = null; + if (null === (t10 = r8.exec(e12))) + throw new Error("Date resolve error"); + if (i9 = +t10[1], n9 = +t10[2] - 1, o7 = +t10[3], !t10[4]) + return new Date(Date.UTC(i9, n9, o7)); + if (s7 = +t10[4], a7 = +t10[5], p7 = +t10[6], t10[7]) { + for (d7 = t10[7].slice(0, 3); d7.length < 3; ) + d7 += "0"; + d7 = +d7; + } + return t10[9] && (f8 = 6e4 * (60 * +t10[10] + +(t10[11] || 0)), "-" === t10[9] && (f8 = -f8)), c7 = new Date(Date.UTC(i9, n9, o7, s7, a7, p7, d7)), f8 && c7.setTime(c7.getTime() - f8), c7; + }, instanceOf: Date, represent: function(e12) { + return e12.toISOString(); + } }); + }, 37952: (e11, t9) => { + "use strict"; + var i8; + function n8() { + return { errors: [], startPosition: -1, endPosition: -1, items: [], kind: i8.SEQ, parent: null }; + } + Object.defineProperty(t9, "__esModule", { value: true }), function(e12) { + e12[e12.SCALAR = 0] = "SCALAR", e12[e12.MAPPING = 1] = "MAPPING", e12[e12.MAP = 2] = "MAP", e12[e12.SEQ = 3] = "SEQ", e12[e12.ANCHOR_REF = 4] = "ANCHOR_REF", e12[e12.INCLUDE_REF = 5] = "INCLUDE_REF"; + }(i8 = t9.Kind || (t9.Kind = {})), t9.newMapping = function(e12, t10) { + var n9 = t10 ? t10.endPosition : e12.endPosition + 1; + return { key: e12, value: t10, startPosition: e12.startPosition, endPosition: n9, kind: i8.MAPPING, parent: null, errors: [] }; + }, t9.newAnchorRef = function(e12, t10, n9, r8) { + return { errors: [], referencesAnchor: e12, value: r8, startPosition: t10, endPosition: n9, kind: i8.ANCHOR_REF, parent: null }; + }, t9.newScalar = function(e12 = "") { + const t10 = { errors: [], startPosition: -1, endPosition: -1, value: "" + e12, kind: i8.SCALAR, parent: null, doubleQuoted: false, rawValue: "" + e12 }; + return "string" != typeof e12 && (t10.valueObject = e12), t10; + }, t9.newItems = n8, t9.newSeq = function() { + return n8(); + }, t9.newMap = function(e12) { + return { errors: [], startPosition: -1, endPosition: -1, mappings: e12 || [], kind: i8.MAP, parent: null }; + }; + }, 2185: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(82585), r8 = i8(88725); + t9.buildJsonPath = function(e12) { + const t10 = []; + let i9 = e12; + for (; e12; ) { + switch (e12.kind) { + case n8.Kind.SCALAR: + t10.unshift(e12.value); + break; + case n8.Kind.MAPPING: + i9 !== e12.key && (t10.length > 0 && r8.isObject(e12.value) && e12.value.value === t10[0] ? t10[0] = e12.key.value : t10.unshift(e12.key.value)); + break; + case n8.Kind.SEQ: + if (i9) { + const r9 = e12.items.indexOf(i9); + i9.kind === n8.Kind.SCALAR ? t10[0] = r9 : -1 !== r9 && t10.unshift(r9); + } + } + i9 = e12, e12 = e12.parent; + } + return t10; + }; + }, 79157: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(82585), r8 = i8(88725); + t9.dereferenceAnchor = (e12, i9) => { + if (!r8.isObject(e12)) + return e12; + if (e12.kind === n8.Kind.ANCHOR_REF && e12.referencesAnchor === i9) + return null; + switch (e12.kind) { + case n8.Kind.MAP: + return Object.assign({}, e12, { mappings: e12.mappings.map((e13) => t9.dereferenceAnchor(e13, i9)) }); + case n8.Kind.SEQ: + return Object.assign({}, e12, { items: e12.items.map((e13) => t9.dereferenceAnchor(e13, i9)) }); + case n8.Kind.MAPPING: + return Object.assign({}, e12, { value: t9.dereferenceAnchor(e12.value, i9) }); + case n8.Kind.SCALAR: + return e12; + case n8.Kind.ANCHOR_REF: + return r8.isObject(e12.value) && o7(e12) ? null : e12; + default: + return e12; + } + }; + const o7 = (e12) => { + const { referencesAnchor: t10 } = e12; + let i9 = e12; + for (; i9 = i9.parent; ) + if ("anchorId" in i9 && i9.anchorId === t10) + return true; + return false; + }; + }, 77665: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(2185), r8 = i8(82585), o7 = i8(88725); + function s7(e12, t10, i9) { + const n9 = i9[t10 - 1] + 1, o8 = i9[t10]; + switch (e12.kind) { + case r8.Kind.MAPPING: + return e12.key; + case r8.Kind.MAP: + if (0 !== e12.mappings.length) { + for (const r9 of e12.mappings) + if (r9.startPosition > n9 && r9.startPosition <= o8) + return s7(r9, t10, i9); + } + break; + case r8.Kind.SEQ: + if (0 !== e12.items.length) { + for (const r9 of e12.items) + if (null !== r9 && r9.startPosition > n9 && r9.startPosition <= o8) + return s7(r9, t10, i9); + } + } + return e12; + } + function a7(e12, t10, i9, n9) { + for (const s8 of function* (e13) { + switch (e13.kind) { + case r8.Kind.MAP: + if (0 !== e13.mappings.length) + for (const t11 of e13.mappings) + o7.isObject(t11) && (yield t11); + break; + case r8.Kind.MAPPING: + o7.isObject(e13.key) && (yield e13.key), o7.isObject(e13.value) && (yield e13.value); + break; + case r8.Kind.SEQ: + if (0 !== e13.items.length) + for (const t11 of e13.items) + o7.isObject(t11) && (yield t11); + break; + case r8.Kind.SCALAR: + yield e13; + } + }(e12)) + if (s8.startPosition <= t10 && t10 <= s8.endPosition) + return s8.kind === r8.Kind.SCALAR ? s8 : a7(s8, t10, i9, n9); + if (n9[i9 - 1] === n9[i9] - 1) + return e12; + if (e12.startPosition < n9[i9 - 1] && t10 <= e12.endPosition) { + if (e12.kind !== r8.Kind.MAPPING) + return s7(e12, i9, n9); + if (e12.value && e12.key.endPosition < t10) + return s7(e12.value, i9, n9); + } + return e12; + } + t9.getJsonPathForPosition = ({ ast: e12, lineMap: t10 }, { line: i9, character: r9 }) => { + if (i9 >= t10.length || r9 >= t10[i9]) + return; + const s8 = 0 === i9 ? 0 : t10[i9 - 1] + 1, p7 = a7(e12, Math.min(t10[i9] - 1, s8 + r9), i9, t10); + if (!o7.isObject(p7)) + return; + const c7 = n8.buildJsonPath(p7); + return 0 !== c7.length ? c7 : void 0; + }; + }, 70581: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(61162), r8 = i8(82585), o7 = i8(88725); + function s7(e12, t10) { + if (e12.parent && e12.parent.kind === r8.Kind.MAPPING) { + if (null === e12.parent.value) + return e12.parent.endPosition; + if (e12.kind !== r8.Kind.SCALAR) + return e12.parent.key.endPosition + 1; + } + return null === e12.parent && t10 - e12.startPosition == 0 ? 0 : e12.startPosition; + } + function a7(e12) { + switch (e12.kind) { + case r8.Kind.SEQ: + const { items: t10 } = e12; + if (0 !== t10.length) { + const e13 = t10[t10.length - 1]; + if (null !== e13) + return a7(e13); + } + break; + case r8.Kind.MAPPING: + if (null !== e12.value) + return a7(e12.value); + break; + case r8.Kind.MAP: + if (null !== e12.value && 0 !== e12.mappings.length) + return a7(e12.mappings[e12.mappings.length - 1]); + break; + case r8.Kind.SCALAR: + if (null !== e12.parent && e12.parent.kind === r8.Kind.MAPPING && null === e12.parent.value) + return e12.parent.endPosition; + } + return e12.endPosition; + } + function p7(e12, t10) { + return t10 ? e12.reduce((e13, t11) => (o7.isObject(t11) && ("<<" === t11.key.value ? e13.push(...c7(t11.value)) : e13.push(t11)), e13), []) : e12; + } + function c7(e12) { + if (!o7.isObject(e12)) + return []; + switch (e12.kind) { + case r8.Kind.SEQ: + return e12.items.reduceRight((e13, t10) => (e13.push(...c7(t10)), e13), []); + case r8.Kind.MAP: + return e12.mappings; + case r8.Kind.ANCHOR_REF: + return c7(e12.value); + default: + return []; + } + } + t9.getLocationForJsonPath = ({ ast: e12, lineMap: t10, metadata: i9 }, n9, c8 = false) => { + const f8 = function(e13, t11, { closest: i10, mergeKeys: n10 }) { + e: + for (const s8 of t11) { + if (!o7.isObject(e13)) + return i10 ? e13 : void 0; + switch (e13.kind) { + case r8.Kind.MAP: + const t12 = p7(e13.mappings, n10); + for (let i11 = t12.length - 1; i11 >= 0; i11--) { + const n11 = t12[i11]; + if (n11.key.value === s8) { + e13 = null === n11.value ? n11.key : n11.value; + continue e; + } + } + return i10 ? e13 : void 0; + case r8.Kind.SEQ: + for (let t13 = 0; t13 < e13.items.length; t13++) + if (t13 === Number(s8)) { + const i11 = e13.items[t13]; + if (null === i11) + break; + e13 = i11; + continue e; + } + return i10 ? e13 : void 0; + default: + return i10 ? e13 : void 0; + } + } + return e13; + }(e12, n9, { closest: c8, mergeKeys: void 0 !== i9 && true === i9.mergeKeys }); + if (void 0 !== f8) + return d7(t10, { start: s7(f8, t10.length > 0 ? t10[0] : 0), end: a7(f8) }); + }; + const d7 = (e12, { start: t10 = 0, end: i9 = 0 }) => { + const r9 = n8.lineForPosition(t10, e12), o8 = n8.lineForPosition(i9, e12); + return { range: { start: { line: r9, character: t10 - (0 === r9 ? 0 : e12[r9 - 1]) }, end: { line: o8, character: i9 - (0 === o8 ? 0 : e12[o8 - 1]) } } }; + }; + }, 3740: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(29180); + n8.__exportStar(i8(2185), t9), n8.__exportStar(i8(79157), t9), n8.__exportStar(i8(77665), t9), n8.__exportStar(i8(70581), t9), n8.__exportStar(i8(61162), t9); + var r8 = i8(36527); + t9.parse = r8.parse; + var o7 = i8(53241); + t9.parseWithPointers = o7.parseWithPointers, n8.__exportStar(i8(74958), t9), n8.__exportStar(i8(82585), t9), n8.__exportStar(i8(60519), t9); + }, 61162: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.lineForPosition = (e12, i8, n8 = 0, r8) => { + if (0 === e12 || 0 === i8.length || e12 < i8[0]) + return 0; + void 0 === r8 && (r8 = i8.length); + const o7 = Math.floor((r8 - n8) / 2) + n8; + if (e12 >= i8[o7] && !i8[o7 + 1]) + return o7 + 1; + const s7 = i8[Math.min(o7 + 1, i8.length)]; + return e12 === i8[o7] - 1 ? o7 : e12 >= i8[o7] && e12 <= s7 ? e12 === s7 ? o7 + 2 : o7 + 1 : e12 > i8[o7] ? t9.lineForPosition(e12, i8, o7 + 1, r8) : t9.lineForPosition(e12, i8, n8, o7 - 1); + }; + }, 36527: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(53241); + t9.parse = (e12) => n8.parseWithPointers(e12).data; + }, 53241: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(93643), r8 = i8(29824), o7 = i8(85725), s7 = i8(2185), a7 = i8(79157), p7 = i8(61162), c7 = i8(82585), d7 = i8(88725); + t9.parseWithPointers = (e12, t10) => { + const i9 = h8(e12), n9 = o7.load(e12, Object.assign({}, t10, { ignoreDuplicateKeys: true })), r9 = { ast: n9, lineMap: i9, data: void 0, diagnostics: [], metadata: t10, comments: {} }; + if (!n9) + return r9; + const s8 = function(e13) { + return void 0 === e13 ? { attachComments: false, preserveKeyOrder: false, bigInt: false, mergeKeys: false, json: true, ignoreDuplicateKeys: false } : Object.assign({}, e13, { attachComments: true === e13.attachComments, preserveKeyOrder: true === e13.preserveKeyOrder, bigInt: true === e13.bigInt, mergeKeys: true === e13.mergeKeys, json: false !== e13.json, ignoreDuplicateKeys: false !== e13.ignoreDuplicateKeys }); + }(t10), a8 = new P6(r9.comments, P6.mapComments(s8.attachComments && n9.comments ? n9.comments : [], i9), n9, i9, "#"), p8 = { lineMap: i9, diagnostics: r9.diagnostics }; + return r9.data = u7(p8, n9, a8, s8), n9.errors && r9.diagnostics.push(...g7(n9.errors, i9)), r9.diagnostics.length > 0 && r9.diagnostics.sort((e13, t11) => e13.range.start.line - t11.range.start.line), Array.isArray(r9.ast.errors) && (r9.ast.errors.length = 0), r9; + }; + const f8 = /~/g, l7 = /\//g, u7 = (e12, t10, i9, n9) => { + if (t10) + switch (t10.kind) { + case c7.Kind.MAP: { + const r9 = i9.enter(t10), { lineMap: o8, diagnostics: s8 } = e12, { preserveKeyOrder: a8, ignoreDuplicateKeys: p8, json: c8, mergeKeys: d8 } = n9, h9 = v8(a8), y8 = [], g8 = d8, j7 = !c8, _7 = !p8; + for (const i10 of t10.mappings) { + if (!x7(i10, o8, s8, j7)) + continue; + const t11 = String(m7(i10.key)), p9 = r9.enter(i10, t11.replace(f8, "~0").replace(l7, "~1")); + if ((j7 || _7) && (!g8 || "<<" !== t11)) + if (y8.includes(t11)) { + if (j7) + throw new Error("Duplicate YAML mapping key encountered"); + _7 && s8.push(w6(i10.key, o8, "duplicate key")); + } else + y8.push(t11); + if (g8 && "<<" === t11) { + const t12 = b8(u7(e12, i10.value, p9, n9), a8); + Object.assign(h9, t12); + } else + h9[t11] = u7(e12, i10.value, p9, n9), a8 && $5(h9, t11); + p9.attachComments(); + } + return r9.attachComments(), h9; + } + case c7.Kind.SEQ: { + const r9 = i9.enter(t10), o8 = t10.items.map((t11, i10) => { + if (null !== t11) { + const o9 = r9.enter(t11, i10), s8 = u7(e12, t11, o9, n9); + return o9.attachComments(), s8; + } + return null; + }); + return r9.attachComments(), o8; + } + case c7.Kind.SCALAR: { + const e13 = m7(t10); + return n9.bigInt || "bigint" != typeof e13 ? e13 : Number(e13); + } + case c7.Kind.ANCHOR_REF: + return d7.isObject(t10.value) && (t10.value = a7.dereferenceAnchor(t10.value, t10.referencesAnchor)), u7(e12, t10.value, i9, n9); + default: + return null; + } + return t10; + }; + function m7(e12) { + switch (o7.determineScalarType(e12)) { + case c7.ScalarType.null: + return null; + case c7.ScalarType.string: + return String(e12.value); + case c7.ScalarType.bool: + return o7.parseYamlBoolean(e12.value); + case c7.ScalarType.int: + return o7.parseYamlBigInteger(e12.value); + case c7.ScalarType.float: + return o7.parseYamlFloat(e12.value); + } + } + const h8 = (e12) => { + const t10 = []; + let i9 = 0; + for (; i9 < e12.length; i9++) + "\n" === e12[i9] && t10.push(i9 + 1); + return t10.push(i9 + 1), t10; + }; + function y7(e12, t10) { + return 0 === t10 ? Math.max(0, e12[0] - 1) : Math.max(0, e12[t10] - e12[t10 - 1] - 1); + } + const g7 = (e12, t10) => { + const i9 = []; + let n9 = -1, o8 = 0; + for (const s8 of e12) { + const e13 = { code: s8.name, message: s8.reason, severity: s8.isWarning ? r8.DiagnosticSeverity.Warning : r8.DiagnosticSeverity.Error, range: { start: { line: s8.mark.line, character: s8.mark.column }, end: { line: s8.mark.line, character: s8.mark.toLineEnd ? y7(t10, s8.mark.line) : s8.mark.column } } }; + "missed comma between flow collection entries" === s8.reason ? n9 = -1 === n9 ? o8 : n9 : -1 !== n9 && (i9[n9].range.end = e13.range.end, i9[n9].message = "invalid mixed usage of block and flow styles", i9.length = n9 + 1, o8 = i9.length, n9 = -1), i9.push(e13), o8++; + } + return i9; + }, b8 = (e12, t10) => Array.isArray(e12) ? e12.reduceRight(t10 ? (e13, t11) => { + const i9 = Object.keys(t11); + Object.assign(e13, t11); + for (let t12 = i9.length - 1; t12 >= 0; t12--) + r9 = e13, o8 = i9[t12], j6(r9, o8), n8.getOrder(r9).unshift(o8); + var r9, o8; + return e13; + } : (e13, t11) => Object.assign(e13, t11), v8(t10)) : "object" != typeof e12 || null === e12 ? null : Object(e12); + function v8(e12) { + return e12 ? n8.default({}) : {}; + } + function j6(e12, t10) { + if (!(t10 in e12)) + return; + const i9 = n8.getOrder(e12), r9 = i9.indexOf(t10); + -1 !== r9 && i9.splice(r9, 1); + } + function $5(e12, t10) { + j6(e12, t10), n8.getOrder(e12).push(t10); + } + function x7(e12, t10, i9, n9) { + if (e12.key.kind !== c7.Kind.SCALAR) + return n9 || i9.push(_6(e12.key, t10, "mapping key must be a string scalar", n9)), false; + if (!n9) { + const r9 = typeof m7(e12.key); + "string" !== r9 && i9.push(_6(e12.key, t10, `mapping key must be a string scalar rather than ${null === e12.key.valueObject ? "null" : r9}`, n9)); + } + return true; + } + function _6(e12, t10, i9, n9) { + const o8 = w6(e12, t10, i9); + return o8.code = "YAMLIncompatibleValue", o8.severity = n9 ? r8.DiagnosticSeverity.Hint : r8.DiagnosticSeverity.Warning, o8; + } + function w6(e12, t10, i9) { + return { code: "YAMLException", message: i9, severity: r8.DiagnosticSeverity.Error, path: s7.buildJsonPath(e12), range: S6(t10, e12.startPosition, e12.endPosition) }; + } + function S6(e12, t10, i9) { + const n9 = p7.lineForPosition(t10, e12), r9 = p7.lineForPosition(i9, e12); + return { start: { line: n9, character: 0 === n9 ? t10 : t10 - e12[n9 - 1] }, end: { line: r9, character: 0 === r9 ? i9 : i9 - e12[r9 - 1] } }; + } + class P6 { + constructor(e12, t10, i9, n9, r9) { + if (this.attachedComments = e12, this.node = i9, this.lineMap = n9, this.pointer = r9, 0 === t10.length) + this.comments = []; + else { + const e13 = this.getStartPosition(i9), n10 = this.getEndPosition(i9), r10 = p7.lineForPosition(e13, this.lineMap), o8 = p7.lineForPosition(n10, this.lineMap), s8 = []; + for (let e14 = t10.length - 1; e14 >= 0; e14--) { + const i10 = t10[e14]; + i10.range.start.line >= r10 && i10.range.end.line <= o8 && (s8.push(i10), t10.splice(e14, 1)); + } + this.comments = s8; + } + } + getStartPosition(e12) { + return null === e12.parent ? 0 : e12.kind === c7.Kind.MAPPING ? e12.key.startPosition : e12.startPosition; + } + getEndPosition(e12) { + switch (e12.kind) { + case c7.Kind.MAPPING: + return null === e12.value ? e12.endPosition : this.getEndPosition(e12.value); + case c7.Kind.MAP: + return 0 === e12.mappings.length ? e12.endPosition : e12.mappings[e12.mappings.length - 1].endPosition; + case c7.Kind.SEQ: { + if (0 === e12.items.length) + return e12.endPosition; + const t10 = e12.items[e12.items.length - 1]; + return null === t10 ? e12.endPosition : t10.endPosition; + } + default: + return e12.endPosition; + } + } + static mapComments(e12, t10) { + return e12.map((e13) => ({ value: e13.value, range: S6(t10, e13.startPosition, e13.endPosition), startPosition: e13.startPosition, endPosition: e13.endPosition })); + } + enter(e12, t10) { + return new P6(this.attachedComments, this.comments, e12, this.lineMap, void 0 === t10 ? this.pointer : `${this.pointer}/${t10}`); + } + static isLeading(e12, t10) { + switch (e12.kind) { + case c7.Kind.MAP: + return 0 === e12.mappings.length || e12.mappings[0].startPosition > t10; + case c7.Kind.SEQ: { + if (0 === e12.items.length) + return true; + const i9 = e12.items[0]; + return null === i9 || i9.startPosition > t10; + } + case c7.Kind.MAPPING: + return null === e12.value || e12.value.startPosition > t10; + default: + return false; + } + } + static isTrailing(e12, t10) { + switch (e12.kind) { + case c7.Kind.MAP: + return e12.mappings.length > 0 && t10 > e12.mappings[e12.mappings.length - 1].endPosition; + case c7.Kind.SEQ: + if (0 === e12.items.length) + return false; + const i9 = e12.items[e12.items.length - 1]; + return null !== i9 && t10 > i9.endPosition; + case c7.Kind.MAPPING: + return null !== e12.value && t10 > e12.value.endPosition; + default: + return false; + } + } + static findBetween(e12, t10, i9) { + switch (e12.kind) { + case c7.Kind.MAP: { + let n9; + for (const r9 of e12.mappings) + if (t10 > r9.startPosition) + n9 = r9.key.value; + else if (void 0 !== n9 && r9.startPosition > i9) + return [n9, r9.key.value]; + return null; + } + case c7.Kind.SEQ: { + let n9; + for (let r9 = 0; r9 < e12.items.length; r9++) { + const o8 = e12.items[r9]; + if (null !== o8) { + if (t10 > o8.startPosition) + n9 = String(r9); + else if (void 0 !== n9 && o8.startPosition > i9) + return [n9, String(r9)]; + } + } + return null; + } + default: + return null; + } + } + isBeforeEOL(e12) { + return this.node.kind === c7.Kind.SCALAR || this.node.kind === c7.Kind.MAPPING && e12.range.end.line === p7.lineForPosition(this.node.key.endPosition, this.lineMap); + } + attachComments() { + if (0 === this.comments.length) + return; + const e12 = this.attachedComments[this.pointer] = this.attachedComments[this.pointer] || []; + for (const t10 of this.comments) + if (this.isBeforeEOL(t10)) + e12.push({ value: t10.value, placement: "before-eol" }); + else if (P6.isLeading(this.node, t10.startPosition)) + e12.push({ value: t10.value, placement: "leading" }); + else if (P6.isTrailing(this.node, t10.endPosition)) + e12.push({ value: t10.value, placement: "trailing" }); + else { + const i9 = P6.findBetween(this.node, t10.startPosition, t10.endPosition); + null !== i9 ? e12.push({ value: t10.value, placement: "between", between: i9 }) : e12.push({ value: t10.value, placement: "trailing" }); + } + } + } + }, 74958: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(85725); + t9.safeStringify = (e12, t10) => "string" == typeof e12 ? e12 : n8.safeDump(e12, t10); + }, 60519: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(93643); + t9.KEYS = Symbol.for(n8.ORDER_KEY_ID); + const r8 = { ownKeys: (e12) => t9.KEYS in e12 ? e12[t9.KEYS] : Reflect.ownKeys(e12) }; + t9.trapAccess = (e12) => new Proxy(e12, r8); + }, 82585: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(85725); + t9.Kind = n8.Kind, t9.ScalarType = n8.ScalarType; + }, 88725: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.isObject = (e12) => null !== e12 && "object" == typeof e12; + }, 67083: (e11) => { + "use strict"; + const { AbortController: t9, AbortSignal: i8 } = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0; + e11.exports = t9, e11.exports.AbortSignal = i8, e11.exports.default = t9; + }, 33467: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.CodeGen = t9.Name = t9.nil = t9.stringify = t9.str = t9._ = t9.KeywordCxt = void 0; + const n8 = i8(65319), r8 = i8(61043), o7 = i8(11672), s7 = i8(20048), a7 = ["/properties"], p7 = "http://json-schema.org/draft-04/schema"; + class c7 extends n8.default { + constructor(e12 = {}) { + super({ ...e12, schemaId: "id" }); + } + _addVocabularies() { + super._addVocabularies(), r8.default.forEach((e12) => this.addVocabulary(e12)), this.opts.discriminator && this.addKeyword(o7.default); + } + _addDefaultMetaSchema() { + if (super._addDefaultMetaSchema(), !this.opts.meta) + return; + const e12 = this.opts.$data ? this.$dataMetaSchema(s7, a7) : s7; + this.addMetaSchema(e12, p7, false), this.refs["http://json-schema.org/schema"] = p7; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(p7) ? p7 : void 0); + } + } + e11.exports = t9 = c7, Object.defineProperty(t9, "__esModule", { value: true }), t9.default = c7; + var d7 = i8(65319); + Object.defineProperty(t9, "KeywordCxt", { enumerable: true, get: function() { + return d7.KeywordCxt; + } }); + var f8 = i8(65319); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return f8._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return f8.str; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return f8.stringify; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return f8.nil; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return f8.Name; + } }), Object.defineProperty(t9, "CodeGen", { enumerable: true, get: function() { + return f8.CodeGen; + } }); + }, 73829: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = ["$schema", "id", "$defs", { keyword: "$comment" }, "definitions", i8(26138).default]; + t9.default = n8; + }, 61043: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(73829), r8 = i8(19986), o7 = i8(18225), s7 = i8(26699), a7 = [n8.default, r8.default, o7.default(), s7.default, ["title", "description", "default"]]; + t9.default = a7; + }, 19986: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(10592), r8 = i8(52674), o7 = i8(21230), s7 = i8(3936), a7 = i8(81005), p7 = i8(71589), c7 = i8(29594), d7 = i8(38558), f8 = i8(44058), l7 = i8(79520), u7 = i8(36742), m7 = [n8.default, r8.default, o7.default, s7.default, a7.default, p7.default, c7.default, d7.default, f8.default, { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, l7.default, u7.default]; + t9.default = m7; + }, 10592: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(65319), r8 = i8(17898).operators, o7 = { maximum: { exclusive: "exclusiveMaximum", ops: [{ okStr: "<=", ok: r8.LTE, fail: r8.GT }, { okStr: "<", ok: r8.LT, fail: r8.GTE }] }, minimum: { exclusive: "exclusiveMinimum", ops: [{ okStr: ">=", ok: r8.GTE, fail: r8.LT }, { okStr: ">", ok: r8.GT, fail: r8.LTE }] } }, s7 = { message: (e12) => n8.str`must be ${p7(e12).okStr} ${e12.schemaCode}`, params: (e12) => n8._`{comparison: ${p7(e12).okStr}, limit: ${e12.schemaCode}}` }, a7 = { keyword: Object.keys(o7), type: "number", schemaType: "number", $data: true, error: s7, code(e12) { + const { data: t10, schemaCode: i9 } = e12; + e12.fail$data(n8._`${t10} ${p7(e12).fail} ${i9} || isNaN(${t10})`); + } }; + function p7(e12) { + var t10; + const i9 = e12.keyword, n9 = (null === (t10 = e12.parentSchema) || void 0 === t10 ? void 0 : t10[o7[i9].exclusive]) ? 1 : 0; + return o7[i9].ops[n9]; + } + t9.default = a7; + }, 52674: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const i8 = { exclusiveMaximum: "maximum", exclusiveMinimum: "minimum" }, n8 = { keyword: Object.keys(i8), type: "number", schemaType: "boolean", code({ keyword: e12, parentSchema: t10 }) { + const n9 = i8[e12]; + if (void 0 === t10[n9]) + throw new Error(`${e12} can only be used with ${n9}`); + } }; + t9.default = n8; + }, 67156: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(11601), r8 = i8(17898), o7 = i8(83277), s7 = i8(96223), a7 = i8(49409), p7 = i8(63036), c7 = "errorMessage", d7 = new n8.Name("emUsed"), f8 = { required: "missingProperty", dependencies: "property", dependentRequired: "property" }, l7 = /\$\{[^}]+\}/, u7 = /\$\{([^}]+)\}/g, m7 = /^""\s*\+\s*|\s*\+\s*""$/g; + const h8 = (e12, t10 = {}) => { + if (!e12.opts.allErrors) + throw new Error("ajv-errors: Ajv option allErrors must be true"); + if (e12.opts.jsPropertySyntax) + throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported"); + return e12.addKeyword(/* @__PURE__ */ function(e13) { + return { keyword: c7, schemaType: ["string", "object"], post: true, code(t11) { + const { gen: i9, data: h9, schema: y7, schemaValue: g7, it: b8 } = t11; + if (false === b8.createErrors) + return; + const v8 = y7, j6 = r8.strConcat(p7.default.instancePath, b8.errorPath); + function $5(e14, t12) { + return r8.and(n8._`${e14}.keyword !== ${c7}`, n8._`!${e14}.${d7}`, n8._`${e14}.instancePath === ${j6}`, n8._`${e14}.keyword in ${t12}`, n8._`${e14}.schemaPath.indexOf(${b8.errSchemaPath}) === 0`, n8._`/^\\/[^\\/]*$/.test(${e14}.schemaPath.slice(${b8.errSchemaPath.length}))`); + } + function x7(e14, t12) { + const n9 = []; + for (const i10 in e14) { + const e15 = t12[i10]; + l7.test(e15) && n9.push([i10, w6(e15)]); + } + return i9.object(...n9); + } + function _6(e14) { + return l7.test(e14) ? new o7._Code(o7.safeStringify(e14).replace(u7, (e15, t12) => `" + JSON.stringify(${s7.getData(t12, b8)}) + "`).replace(m7, "")) : n8.stringify(e14); + } + function w6(e14) { + return n8._`function(){return ${_6(e14)}}`; + } + i9.if(n8._`${p7.default.errors} > 0`, () => { + if ("object" == typeof v8) { + const [o9, s8] = function(e14) { + let t12, i10; + for (const n9 in e14) { + if ("properties" === n9 || "items" === n9) + continue; + const r9 = e14[n9]; + if ("object" == typeof r9) { + t12 || (t12 = {}); + const e15 = t12[n9] = {}; + for (const t13 in r9) + e15[t13] = []; + } else + i10 || (i10 = {}), i10[n9] = []; + } + return [t12, i10]; + }(v8); + s8 && function(r9) { + const o10 = i9.const("emErrors", n8.stringify(r9)), s9 = i9.const("templates", x7(r9, y7)); + i9.forOf("err", p7.default.vErrors, (e14) => i9.if($5(e14, o10), () => i9.code(n8._`${o10}[${e14}.keyword].push(${e14})`).assign(n8._`${e14}.${d7}`, true))); + const { singleError: c8 } = e13; + if (c8) { + const e14 = i9.let("message", n8._`""`), r10 = i9.let("paramsErrors", n8._`[]`); + f9((t12) => { + i9.if(e14, () => i9.code(n8._`${e14} += ${"string" == typeof c8 ? c8 : ";"}`)), i9.code(n8._`${e14} += ${l8(t12)}`), i9.assign(r10, n8._`${r10}.concat(${o10}[${t12}])`); + }), a7.reportError(t11, { message: e14, params: n8._`{errors: ${r10}}` }); + } else + f9((e14) => a7.reportError(t11, { message: l8(e14), params: n8._`{errors: ${o10}[${e14}]}` })); + function f9(e14) { + i9.forIn("key", o10, (t12) => i9.if(n8._`${o10}[${t12}].length`, () => e14(t12))); + } + function l8(e14) { + return n8._`${e14} in ${s9} ? ${s9}[${e14}]() : ${g7}[${e14}]`; + } + }(s8), o9 && function(e14) { + const r9 = i9.const("emErrors", n8.stringify(e14)), o10 = []; + for (const t12 in e14) + o10.push([t12, x7(e14[t12], y7[t12])]); + const s9 = i9.const("templates", i9.object(...o10)), c8 = i9.scopeValue("obj", { ref: f8, code: n8.stringify(f8) }), l8 = i9.let("emPropParams"), u8 = i9.let("emParamsErrors"); + i9.forOf("err", p7.default.vErrors, (e15) => i9.if($5(e15, r9), () => { + i9.assign(l8, n8._`${c8}[${e15}.keyword]`), i9.assign(u8, n8._`${r9}[${e15}.keyword][${e15}.params[${l8}]]`), i9.if(u8, () => i9.code(n8._`${u8}.push(${e15})`).assign(n8._`${e15}.${d7}`, true)); + })), i9.forIn("key", r9, (e15) => i9.forIn("keyProp", n8._`${r9}[${e15}]`, (o11) => { + i9.assign(u8, n8._`${r9}[${e15}][${o11}]`), i9.if(n8._`${u8}.length`, () => { + const r10 = i9.const("tmpl", n8._`${s9}[${e15}] && ${s9}[${e15}][${o11}]`); + a7.reportError(t11, { message: n8._`${r10} ? ${r10}() : ${g7}[${e15}][${o11}]`, params: n8._`{errors: ${u8}}` }); + }); + })); + }(o9), function(e14) { + const { props: o10, items: s9 } = e14; + if (!o10 && !s9) + return; + const f9 = n8._`typeof ${h9} == "object"`, l8 = n8._`Array.isArray(${h9})`, u8 = i9.let("emErrors"); + let m8, b9; + const v9 = i9.let("templates"); + function $6(e15, t12) { + i9.assign(u8, n8.stringify(e15)), i9.assign(v9, x7(e15, t12)); + } + o10 && s9 ? (m8 = i9.let("emChildKwd"), i9.if(f9), i9.if(l8, () => { + $6(s9, y7.items), i9.assign(m8, n8.str`items`); + }, () => { + $6(o10, y7.properties), i9.assign(m8, n8.str`properties`); + }), b9 = n8._`[${m8}]`) : s9 ? (i9.if(l8), $6(s9, y7.items), b9 = n8._`.items`) : o10 && (i9.if(r8.and(f9, r8.not(l8))), $6(o10, y7.properties), b9 = n8._`.properties`), i9.forOf("err", p7.default.vErrors, (e15) => function(e16, t12, o11) { + i9.if(r8.and(n8._`${e16}.keyword !== ${c7}`, n8._`!${e16}.${d7}`, n8._`${e16}.instancePath.indexOf(${j6}) === 0`), () => { + const r9 = i9.scopeValue("pattern", { ref: /^\/([^/]*)(?:\/|$)/, code: n8._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")` }), s10 = i9.const("emMatches", n8._`${r9}.exec(${e16}.instancePath.slice(${j6}.length))`), a8 = i9.const("emChild", n8._`${s10} && ${s10}[1].replace(/~1/g, "/").replace(/~0/g, "~")`); + i9.if(n8._`${a8} !== undefined && ${a8} in ${t12}`, () => o11(a8)); + }); + }(e15, u8, (t12) => i9.code(n8._`${u8}[${t12}].push(${e15})`).assign(n8._`${e15}.${d7}`, true))), i9.forIn("key", u8, (e15) => i9.if(n8._`${u8}[${e15}].length`, () => { + a7.reportError(t11, { message: n8._`${e15} in ${v9} ? ${v9}[${e15}]() : ${g7}${b9}[${e15}]`, params: n8._`{errors: ${u8}[${e15}]}` }), i9.assign(n8._`${p7.default.vErrors}[${p7.default.errors}-1].instancePath`, n8._`${j6} + "/" + ${e15}.replace(/~/g, "~0").replace(/\\//g, "~1")`); + })), i9.endIf(); + }(function({ properties: e14, items: t12 }) { + const i10 = {}; + if (e14) { + i10.props = {}; + for (const t13 in e14) + i10.props[t13] = []; + } + if (t12) { + i10.items = {}; + for (let e15 = 0; e15 < t12.length; e15++) + i10.items[e15] = []; + } + return i10; + }(v8)); + } + const o8 = "string" == typeof v8 ? v8 : v8._; + o8 && function(e14) { + const o9 = i9.const("emErrs", n8._`[]`); + i9.forOf("err", p7.default.vErrors, (e15) => i9.if(function(e16) { + return r8.and(n8._`${e16}.keyword !== ${c7}`, n8._`!${e16}.${d7}`, r8.or(n8._`${e16}.instancePath === ${j6}`, r8.and(n8._`${e16}.instancePath.indexOf(${j6}) === 0`, n8._`${e16}.instancePath[${j6}.length] === "/"`)), n8._`${e16}.schemaPath.indexOf(${b8.errSchemaPath}) === 0`, n8._`${e16}.schemaPath[${b8.errSchemaPath}.length] === "/"`); + }(e15), () => i9.code(n8._`${o9}.push(${e15})`).assign(n8._`${e15}.${d7}`, true))), i9.if(n8._`${o9}.length`, () => a7.reportError(t11, { message: _6(e14), params: n8._`{errors: ${o9}}` })); + }(o8), e13.keepErrors || function() { + const e14 = i9.const("emErrs", n8._`[]`); + i9.forOf("err", p7.default.vErrors, (t12) => i9.if(n8._`!${t12}.${d7}`, () => i9.code(n8._`${e14}.push(${t12})`))), i9.assign(p7.default.vErrors, e14).assign(p7.default.errors, n8._`${e14}.length`); + }(); + }); + }, metaSchema: { anyOf: [{ type: "string" }, { type: "object", properties: { properties: { $ref: "#/$defs/stringMap" }, items: { $ref: "#/$defs/stringList" }, required: { $ref: "#/$defs/stringOrMap" }, dependencies: { $ref: "#/$defs/stringOrMap" } }, additionalProperties: { type: "string" } }], $defs: { stringMap: { type: "object", additionalProperties: { type: "string" } }, stringOrMap: { anyOf: [{ type: "string" }, { $ref: "#/$defs/stringMap" }] }, stringList: { type: "array", items: { type: "string" } } } } }; + }(t10)); + }; + t9.default = h8, e11.exports = h8, e11.exports.default = h8; + }, 65733: (e11, t9) => { + "use strict"; + function i8(e12, t10) { + return { validate: e12, compare: t10 }; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.formatNames = t9.fastFormats = t9.fullFormats = void 0, t9.fullFormats = { date: i8(o7, s7), time: i8(p7, c7), "date-time": i8(function(e12) { + const t10 = e12.split(d7); + return 2 === t10.length && o7(t10[0]) && p7(t10[1], true); + }, f8), duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, uri: function(e12) { + return l7.test(e12) && u7.test(e12); + }, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, regex: function(e12) { + if (b8.test(e12)) + return false; + try { + return new RegExp(e12), true; + } catch (e13) { + return false; + } + }, uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, byte: function(e12) { + return m7.lastIndex = 0, m7.test(e12); + }, int32: { type: "number", validate: function(e12) { + return Number.isInteger(e12) && e12 <= y7 && e12 >= h8; + } }, int64: { type: "number", validate: function(e12) { + return Number.isInteger(e12); + } }, float: { type: "number", validate: g7 }, double: { type: "number", validate: g7 }, password: true, binary: true }, t9.fastFormats = { ...t9.fullFormats, date: i8(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, s7), time: i8(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, c7), "date-time": i8(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, f8), uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i }, t9.formatNames = Object.keys(t9.fullFormats); + const n8 = /^(\d\d\d\d)-(\d\d)-(\d\d)$/, r8 = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + function o7(e12) { + const t10 = n8.exec(e12); + if (!t10) + return false; + const i9 = +t10[1], o8 = +t10[2], s8 = +t10[3]; + return o8 >= 1 && o8 <= 12 && s8 >= 1 && s8 <= (2 === o8 && function(e13) { + return e13 % 4 == 0 && (e13 % 100 != 0 || e13 % 400 == 0); + }(i9) ? 29 : r8[o8]); + } + function s7(e12, t10) { + if (e12 && t10) + return e12 > t10 ? 1 : e12 < t10 ? -1 : 0; + } + const a7 = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i; + function p7(e12, t10) { + const i9 = a7.exec(e12); + if (!i9) + return false; + const n9 = +i9[1], r9 = +i9[2], o8 = +i9[3], s8 = i9[5]; + return (n9 <= 23 && r9 <= 59 && o8 <= 59 || 23 === n9 && 59 === r9 && 60 === o8) && (!t10 || "" !== s8); + } + function c7(e12, t10) { + if (!e12 || !t10) + return; + const i9 = a7.exec(e12), n9 = a7.exec(t10); + return i9 && n9 ? (e12 = i9[1] + i9[2] + i9[3] + (i9[4] || "")) > (t10 = n9[1] + n9[2] + n9[3] + (n9[4] || "")) ? 1 : e12 < t10 ? -1 : 0 : void 0; + } + const d7 = /t|\s/i; + function f8(e12, t10) { + if (!e12 || !t10) + return; + const [i9, n9] = e12.split(d7), [r9, o8] = t10.split(d7), a8 = s7(i9, r9); + return void 0 !== a8 ? a8 || c7(n9, o8) : void 0; + } + const l7 = /\/|:/, u7 = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, m7 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm, h8 = -(2 ** 31), y7 = 2 ** 31 - 1; + function g7() { + return true; + } + const b8 = /[^\\]\\Z/; + }, 74421: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(65733), r8 = i8(31038), o7 = i8(17898), s7 = new o7.Name("fullFormats"), a7 = new o7.Name("fastFormats"), p7 = (e12, t10 = { keywords: true }) => { + if (Array.isArray(t10)) + return c7(e12, t10, n8.fullFormats, s7), e12; + const [i9, o8] = "fast" === t10.mode ? [n8.fastFormats, a7] : [n8.fullFormats, s7]; + return c7(e12, t10.formats || n8.formatNames, i9, o8), t10.keywords && r8.default(e12), e12; + }; + function c7(e12, t10, i9, n9) { + var r9, s8; + null !== (r9 = (s8 = e12.opts.code).formats) && void 0 !== r9 || (s8.formats = o7._`require("ajv-formats/dist/formats").${n9}`); + for (const n10 of t10) + e12.addFormat(n10, i9[n10]); + } + p7.get = (e12, t10 = "full") => { + const i9 = ("fast" === t10 ? n8.fastFormats : n8.fullFormats)[e12]; + if (!i9) + throw new Error(`Unknown format "${e12}"`); + return i9; + }, e11.exports = t9 = p7, Object.defineProperty(t9, "__esModule", { value: true }), t9.default = p7; + }, 31038: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.formatLimitDefinition = void 0; + const n8 = i8(11601), r8 = i8(17898), o7 = r8.operators, s7 = { formatMaximum: { okStr: "<=", ok: o7.LTE, fail: o7.GT }, formatMinimum: { okStr: ">=", ok: o7.GTE, fail: o7.LT }, formatExclusiveMaximum: { okStr: "<", ok: o7.LT, fail: o7.GTE }, formatExclusiveMinimum: { okStr: ">", ok: o7.GT, fail: o7.LTE } }, a7 = { message: ({ keyword: e12, schemaCode: t10 }) => r8.str`should be ${s7[e12].okStr} ${t10}`, params: ({ keyword: e12, schemaCode: t10 }) => r8._`{comparison: ${s7[e12].okStr}, limit: ${t10}}` }; + t9.formatLimitDefinition = { keyword: Object.keys(s7), type: "string", schemaType: "string", $data: true, error: a7, code(e12) { + const { gen: t10, data: i9, schemaCode: o8, keyword: a8, it: p7 } = e12, { opts: c7, self: d7 } = p7; + if (!c7.validateFormats) + return; + const f8 = new n8.KeywordCxt(p7, d7.RULES.all.format.definition, "format"); + function l7(e13) { + return r8._`${e13}.compare(${i9}, ${o8}) ${s7[a8].fail} 0`; + } + f8.$data ? function() { + const i10 = t10.scopeValue("formats", { ref: d7.formats, code: c7.code.formats }), n9 = t10.const("fmt", r8._`${i10}[${f8.schemaCode}]`); + e12.fail$data(r8.or(r8._`typeof ${n9} != "object"`, r8._`${n9} instanceof RegExp`, r8._`typeof ${n9}.compare != "function"`, l7(n9))); + }() : function() { + const i10 = f8.schema, n9 = d7.formats[i10]; + if (!n9 || true === n9) + return; + if ("object" != typeof n9 || n9 instanceof RegExp || "function" != typeof n9.compare) + throw new Error(`"${a8}": format "${i10}" does not define "compare" function`); + const o9 = t10.scopeValue("formats", { key: i10, ref: n9, code: c7.code.formats ? r8._`${c7.code.formats}${r8.getProperty(i10)}` : void 0 }); + e12.fail$data(l7(o9)); + }(); + }, dependencies: ["format"] }, t9.default = (e12) => (e12.addKeyword(t9.formatLimitDefinition), e12); + }, 88856: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.MissingRefError = t9.ValidationError = t9.CodeGen = t9.Name = t9.nil = t9.stringify = t9.str = t9._ = t9.KeywordCxt = t9.Ajv2019 = void 0; + const n8 = i8(65319), r8 = i8(2431), o7 = i8(32485), s7 = i8(68774), a7 = i8(83076), p7 = i8(11672), c7 = i8(92905), d7 = "https://json-schema.org/draft/2019-09/schema"; + class f8 extends n8.default { + constructor(e12 = {}) { + super({ ...e12, dynamicRef: true, next: true, unevaluated: true }); + } + _addVocabularies() { + super._addVocabularies(), this.addVocabulary(o7.default), r8.default.forEach((e12) => this.addVocabulary(e12)), this.addVocabulary(s7.default), this.addVocabulary(a7.default), this.opts.discriminator && this.addKeyword(p7.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data: e12, meta: t10 } = this.opts; + t10 && (c7.default.call(this, e12), this.refs["http://json-schema.org/schema"] = d7); + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(d7) ? d7 : void 0); + } + } + t9.Ajv2019 = f8, e11.exports = t9 = f8, e11.exports.Ajv2019 = f8, Object.defineProperty(t9, "__esModule", { value: true }), t9.default = f8; + var l7 = i8(96223); + Object.defineProperty(t9, "KeywordCxt", { enumerable: true, get: function() { + return l7.KeywordCxt; + } }); + var u7 = i8(17898); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return u7._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return u7.str; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return u7.stringify; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return u7.nil; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return u7.Name; + } }), Object.defineProperty(t9, "CodeGen", { enumerable: true, get: function() { + return u7.CodeGen; + } }); + var m7 = i8(95031); + Object.defineProperty(t9, "ValidationError", { enumerable: true, get: function() { + return m7.default; + } }); + var h8 = i8(85748); + Object.defineProperty(t9, "MissingRefError", { enumerable: true, get: function() { + return h8.default; + } }); + }, 88728: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.MissingRefError = t9.ValidationError = t9.CodeGen = t9.Name = t9.nil = t9.stringify = t9.str = t9._ = t9.KeywordCxt = t9.Ajv2020 = void 0; + const n8 = i8(65319), r8 = i8(64404), o7 = i8(11672), s7 = i8(43685), a7 = "https://json-schema.org/draft/2020-12/schema"; + class p7 extends n8.default { + constructor(e12 = {}) { + super({ ...e12, dynamicRef: true, next: true, unevaluated: true }); + } + _addVocabularies() { + super._addVocabularies(), r8.default.forEach((e12) => this.addVocabulary(e12)), this.opts.discriminator && this.addKeyword(o7.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data: e12, meta: t10 } = this.opts; + t10 && (s7.default.call(this, e12), this.refs["http://json-schema.org/schema"] = a7); + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(a7) ? a7 : void 0); + } + } + t9.Ajv2020 = p7, e11.exports = t9 = p7, e11.exports.Ajv2020 = p7, Object.defineProperty(t9, "__esModule", { value: true }), t9.default = p7; + var c7 = i8(96223); + Object.defineProperty(t9, "KeywordCxt", { enumerable: true, get: function() { + return c7.KeywordCxt; + } }); + var d7 = i8(17898); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return d7._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return d7.str; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return d7.stringify; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return d7.nil; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return d7.Name; + } }), Object.defineProperty(t9, "CodeGen", { enumerable: true, get: function() { + return d7.CodeGen; + } }); + var f8 = i8(95031); + Object.defineProperty(t9, "ValidationError", { enumerable: true, get: function() { + return f8.default; + } }); + var l7 = i8(85748); + Object.defineProperty(t9, "MissingRefError", { enumerable: true, get: function() { + return l7.default; + } }); + }, 11601: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.MissingRefError = t9.ValidationError = t9.CodeGen = t9.Name = t9.nil = t9.stringify = t9.str = t9._ = t9.KeywordCxt = t9.Ajv = void 0; + const n8 = i8(65319), r8 = i8(2431), o7 = i8(11672), s7 = i8(33928), a7 = ["/properties"], p7 = "http://json-schema.org/draft-07/schema"; + class c7 extends n8.default { + _addVocabularies() { + super._addVocabularies(), r8.default.forEach((e12) => this.addVocabulary(e12)), this.opts.discriminator && this.addKeyword(o7.default); + } + _addDefaultMetaSchema() { + if (super._addDefaultMetaSchema(), !this.opts.meta) + return; + const e12 = this.opts.$data ? this.$dataMetaSchema(s7, a7) : s7; + this.addMetaSchema(e12, p7, false), this.refs["http://json-schema.org/schema"] = p7; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(p7) ? p7 : void 0); + } + } + t9.Ajv = c7, e11.exports = t9 = c7, e11.exports.Ajv = c7, Object.defineProperty(t9, "__esModule", { value: true }), t9.default = c7; + var d7 = i8(96223); + Object.defineProperty(t9, "KeywordCxt", { enumerable: true, get: function() { + return d7.KeywordCxt; + } }); + var f8 = i8(17898); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return f8._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return f8.str; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return f8.stringify; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return f8.nil; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return f8.Name; + } }), Object.defineProperty(t9, "CodeGen", { enumerable: true, get: function() { + return f8.CodeGen; + } }); + var l7 = i8(95031); + Object.defineProperty(t9, "ValidationError", { enumerable: true, get: function() { + return l7.default; + } }); + var u7 = i8(85748); + Object.defineProperty(t9, "MissingRefError", { enumerable: true, get: function() { + return u7.default; + } }); + }, 83277: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.regexpCode = t9.getEsmExportName = t9.getProperty = t9.safeStringify = t9.stringify = t9.strConcat = t9.addCodeArg = t9.str = t9._ = t9.nil = t9._Code = t9.Name = t9.IDENTIFIER = t9._CodeOrName = void 0; + class i8 { + } + t9._CodeOrName = i8, t9.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; + class n8 extends i8 { + constructor(e12) { + if (super(), !t9.IDENTIFIER.test(e12)) + throw new Error("CodeGen: name must be a valid identifier"); + this.str = e12; + } + toString() { + return this.str; + } + emptyStr() { + return false; + } + get names() { + return { [this.str]: 1 }; + } + } + t9.Name = n8; + class r8 extends i8 { + constructor(e12) { + super(), this._items = "string" == typeof e12 ? [e12] : e12; + } + toString() { + return this.str; + } + emptyStr() { + if (this._items.length > 1) + return false; + const e12 = this._items[0]; + return "" === e12 || '""' === e12; + } + get str() { + var e12; + return null !== (e12 = this._str) && void 0 !== e12 ? e12 : this._str = this._items.reduce((e13, t10) => `${e13}${t10}`, ""); + } + get names() { + var e12; + return null !== (e12 = this._names) && void 0 !== e12 ? e12 : this._names = this._items.reduce((e13, t10) => (t10 instanceof n8 && (e13[t10.str] = (e13[t10.str] || 0) + 1), e13), {}); + } + } + function o7(e12, ...t10) { + const i9 = [e12[0]]; + let n9 = 0; + for (; n9 < t10.length; ) + p7(i9, t10[n9]), i9.push(e12[++n9]); + return new r8(i9); + } + t9._Code = r8, t9.nil = new r8(""), t9._ = o7; + const s7 = new r8("+"); + function a7(e12, ...t10) { + const i9 = [d7(e12[0])]; + let n9 = 0; + for (; n9 < t10.length; ) + i9.push(s7), p7(i9, t10[n9]), i9.push(s7, d7(e12[++n9])); + return function(e13) { + let t11 = 1; + for (; t11 < e13.length - 1; ) { + if (e13[t11] === s7) { + const i10 = c7(e13[t11 - 1], e13[t11 + 1]); + if (void 0 !== i10) { + e13.splice(t11 - 1, 3, i10); + continue; + } + e13[t11++] = "+"; + } + t11++; + } + }(i9), new r8(i9); + } + function p7(e12, t10) { + var i9; + t10 instanceof r8 ? e12.push(...t10._items) : t10 instanceof n8 ? e12.push(t10) : e12.push("number" == typeof (i9 = t10) || "boolean" == typeof i9 || null === i9 ? i9 : d7(Array.isArray(i9) ? i9.join(",") : i9)); + } + function c7(e12, t10) { + if ('""' === t10) + return e12; + if ('""' === e12) + return t10; + if ("string" == typeof e12) { + if (t10 instanceof n8 || '"' !== e12[e12.length - 1]) + return; + return "string" != typeof t10 ? `${e12.slice(0, -1)}${t10}"` : '"' === t10[0] ? e12.slice(0, -1) + t10.slice(1) : void 0; + } + return "string" != typeof t10 || '"' !== t10[0] || e12 instanceof n8 ? void 0 : `"${e12}${t10.slice(1)}`; + } + function d7(e12) { + return JSON.stringify(e12).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); + } + t9.str = a7, t9.addCodeArg = p7, t9.strConcat = function(e12, t10) { + return t10.emptyStr() ? e12 : e12.emptyStr() ? t10 : a7`${e12}${t10}`; + }, t9.stringify = function(e12) { + return new r8(d7(e12)); + }, t9.safeStringify = d7, t9.getProperty = function(e12) { + return "string" == typeof e12 && t9.IDENTIFIER.test(e12) ? new r8(`.${e12}`) : o7`[${e12}]`; + }, t9.getEsmExportName = function(e12) { + if ("string" == typeof e12 && t9.IDENTIFIER.test(e12)) + return new r8(`${e12}`); + throw new Error(`CodeGen: invalid export name: ${e12}, use explicit $id name mapping`); + }, t9.regexpCode = function(e12) { + return new r8(e12.toString()); + }; + }, 17898: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.or = t9.and = t9.not = t9.CodeGen = t9.operators = t9.varKinds = t9.ValueScopeName = t9.ValueScope = t9.Scope = t9.Name = t9.regexpCode = t9.stringify = t9.getProperty = t9.nil = t9.strConcat = t9.str = t9._ = void 0; + const n8 = i8(83277), r8 = i8(76930); + var o7 = i8(83277); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return o7._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return o7.str; + } }), Object.defineProperty(t9, "strConcat", { enumerable: true, get: function() { + return o7.strConcat; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return o7.nil; + } }), Object.defineProperty(t9, "getProperty", { enumerable: true, get: function() { + return o7.getProperty; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return o7.stringify; + } }), Object.defineProperty(t9, "regexpCode", { enumerable: true, get: function() { + return o7.regexpCode; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return o7.Name; + } }); + var s7 = i8(76930); + Object.defineProperty(t9, "Scope", { enumerable: true, get: function() { + return s7.Scope; + } }), Object.defineProperty(t9, "ValueScope", { enumerable: true, get: function() { + return s7.ValueScope; + } }), Object.defineProperty(t9, "ValueScopeName", { enumerable: true, get: function() { + return s7.ValueScopeName; + } }), Object.defineProperty(t9, "varKinds", { enumerable: true, get: function() { + return s7.varKinds; + } }), t9.operators = { GT: new n8._Code(">"), GTE: new n8._Code(">="), LT: new n8._Code("<"), LTE: new n8._Code("<="), EQ: new n8._Code("==="), NEQ: new n8._Code("!=="), NOT: new n8._Code("!"), OR: new n8._Code("||"), AND: new n8._Code("&&"), ADD: new n8._Code("+") }; + class a7 { + optimizeNodes() { + return this; + } + optimizeNames(e12, t10) { + return this; + } + } + class p7 extends a7 { + constructor(e12, t10, i9) { + super(), this.varKind = e12, this.name = t10, this.rhs = i9; + } + render({ es5: e12, _n: t10 }) { + const i9 = e12 ? r8.varKinds.var : this.varKind, n9 = void 0 === this.rhs ? "" : ` = ${this.rhs}`; + return `${i9} ${this.name}${n9};` + t10; + } + optimizeNames(e12, t10) { + if (e12[this.name.str]) + return this.rhs && (this.rhs = E6(this.rhs, e12, t10)), this; + } + get names() { + return this.rhs instanceof n8._CodeOrName ? this.rhs.names : {}; + } + } + class c7 extends a7 { + constructor(e12, t10, i9) { + super(), this.lhs = e12, this.rhs = t10, this.sideEffects = i9; + } + render({ _n: e12 }) { + return `${this.lhs} = ${this.rhs};` + e12; + } + optimizeNames(e12, t10) { + if (!(this.lhs instanceof n8.Name) || e12[this.lhs.str] || this.sideEffects) + return this.rhs = E6(this.rhs, e12, t10), this; + } + get names() { + return I6(this.lhs instanceof n8.Name ? {} : { ...this.lhs.names }, this.rhs); + } + } + class d7 extends c7 { + constructor(e12, t10, i9, n9) { + super(e12, i9, n9), this.op = t10; + } + render({ _n: e12 }) { + return `${this.lhs} ${this.op}= ${this.rhs};` + e12; + } + } + class f8 extends a7 { + constructor(e12) { + super(), this.label = e12, this.names = {}; + } + render({ _n: e12 }) { + return `${this.label}:` + e12; + } + } + class l7 extends a7 { + constructor(e12) { + super(), this.label = e12, this.names = {}; + } + render({ _n: e12 }) { + return `break${this.label ? ` ${this.label}` : ""};` + e12; + } + } + class u7 extends a7 { + constructor(e12) { + super(), this.error = e12; + } + render({ _n: e12 }) { + return `throw ${this.error};` + e12; + } + get names() { + return this.error.names; + } + } + class m7 extends a7 { + constructor(e12) { + super(), this.code = e12; + } + render({ _n: e12 }) { + return `${this.code};` + e12; + } + optimizeNodes() { + return `${this.code}` ? this : void 0; + } + optimizeNames(e12, t10) { + return this.code = E6(this.code, e12, t10), this; + } + get names() { + return this.code instanceof n8._CodeOrName ? this.code.names : {}; + } + } + class h8 extends a7 { + constructor(e12 = []) { + super(), this.nodes = e12; + } + render(e12) { + return this.nodes.reduce((t10, i9) => t10 + i9.render(e12), ""); + } + optimizeNodes() { + const { nodes: e12 } = this; + let t10 = e12.length; + for (; t10--; ) { + const i9 = e12[t10].optimizeNodes(); + Array.isArray(i9) ? e12.splice(t10, 1, ...i9) : i9 ? e12[t10] = i9 : e12.splice(t10, 1); + } + return e12.length > 0 ? this : void 0; + } + optimizeNames(e12, t10) { + const { nodes: i9 } = this; + let n9 = i9.length; + for (; n9--; ) { + const r9 = i9[n9]; + r9.optimizeNames(e12, t10) || (q5(e12, r9.names), i9.splice(n9, 1)); + } + return i9.length > 0 ? this : void 0; + } + get names() { + return this.nodes.reduce((e12, t10) => A6(e12, t10.names), {}); + } + } + class y7 extends h8 { + render(e12) { + return "{" + e12._n + super.render(e12) + "}" + e12._n; + } + } + class g7 extends h8 { + } + class b8 extends y7 { + } + b8.kind = "else"; + class v8 extends y7 { + constructor(e12, t10) { + super(t10), this.condition = e12; + } + render(e12) { + let t10 = `if(${this.condition})` + super.render(e12); + return this.else && (t10 += "else " + this.else.render(e12)), t10; + } + optimizeNodes() { + super.optimizeNodes(); + const e12 = this.condition; + if (true === e12) + return this.nodes; + let t10 = this.else; + if (t10) { + const e13 = t10.optimizeNodes(); + t10 = this.else = Array.isArray(e13) ? new b8(e13) : e13; + } + return t10 ? false === e12 ? t10 instanceof v8 ? t10 : t10.nodes : this.nodes.length ? this : new v8(k6(e12), t10 instanceof v8 ? [t10] : t10.nodes) : false !== e12 && this.nodes.length ? this : void 0; + } + optimizeNames(e12, t10) { + var i9; + if (this.else = null === (i9 = this.else) || void 0 === i9 ? void 0 : i9.optimizeNames(e12, t10), super.optimizeNames(e12, t10) || this.else) + return this.condition = E6(this.condition, e12, t10), this; + } + get names() { + const e12 = super.names; + return I6(e12, this.condition), this.else && A6(e12, this.else.names), e12; + } + } + v8.kind = "if"; + class j6 extends y7 { + } + j6.kind = "for"; + class $5 extends j6 { + constructor(e12) { + super(), this.iteration = e12; + } + render(e12) { + return `for(${this.iteration})` + super.render(e12); + } + optimizeNames(e12, t10) { + if (super.optimizeNames(e12, t10)) + return this.iteration = E6(this.iteration, e12, t10), this; + } + get names() { + return A6(super.names, this.iteration.names); + } + } + class x7 extends j6 { + constructor(e12, t10, i9, n9) { + super(), this.varKind = e12, this.name = t10, this.from = i9, this.to = n9; + } + render(e12) { + const t10 = e12.es5 ? r8.varKinds.var : this.varKind, { name: i9, from: n9, to: o8 } = this; + return `for(${t10} ${i9}=${n9}; ${i9}<${o8}; ${i9}++)` + super.render(e12); + } + get names() { + const e12 = I6(super.names, this.from); + return I6(e12, this.to); + } + } + class _6 extends j6 { + constructor(e12, t10, i9, n9) { + super(), this.loop = e12, this.varKind = t10, this.name = i9, this.iterable = n9; + } + render(e12) { + return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(e12); + } + optimizeNames(e12, t10) { + if (super.optimizeNames(e12, t10)) + return this.iterable = E6(this.iterable, e12, t10), this; + } + get names() { + return A6(super.names, this.iterable.names); + } + } + class w6 extends y7 { + constructor(e12, t10, i9) { + super(), this.name = e12, this.args = t10, this.async = i9; + } + render(e12) { + return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(e12); + } + } + w6.kind = "func"; + class S6 extends h8 { + render(e12) { + return "return " + super.render(e12); + } + } + S6.kind = "return"; + class P6 extends y7 { + render(e12) { + let t10 = "try" + super.render(e12); + return this.catch && (t10 += this.catch.render(e12)), this.finally && (t10 += this.finally.render(e12)), t10; + } + optimizeNodes() { + var e12, t10; + return super.optimizeNodes(), null === (e12 = this.catch) || void 0 === e12 || e12.optimizeNodes(), null === (t10 = this.finally) || void 0 === t10 || t10.optimizeNodes(), this; + } + optimizeNames(e12, t10) { + var i9, n9; + return super.optimizeNames(e12, t10), null === (i9 = this.catch) || void 0 === i9 || i9.optimizeNames(e12, t10), null === (n9 = this.finally) || void 0 === n9 || n9.optimizeNames(e12, t10), this; + } + get names() { + const e12 = super.names; + return this.catch && A6(e12, this.catch.names), this.finally && A6(e12, this.finally.names), e12; + } + } + class O7 extends y7 { + constructor(e12) { + super(), this.error = e12; + } + render(e12) { + return `catch(${this.error})` + super.render(e12); + } + } + O7.kind = "catch"; + class T6 extends y7 { + render(e12) { + return "finally" + super.render(e12); + } + } + function A6(e12, t10) { + for (const i9 in t10) + e12[i9] = (e12[i9] || 0) + (t10[i9] || 0); + return e12; + } + function I6(e12, t10) { + return t10 instanceof n8._CodeOrName ? A6(e12, t10.names) : e12; + } + function E6(e12, t10, i9) { + return e12 instanceof n8.Name ? o8(e12) : (r9 = e12) instanceof n8._Code && r9._items.some((e13) => e13 instanceof n8.Name && 1 === t10[e13.str] && void 0 !== i9[e13.str]) ? new n8._Code(e12._items.reduce((e13, t11) => (t11 instanceof n8.Name && (t11 = o8(t11)), t11 instanceof n8._Code ? e13.push(...t11._items) : e13.push(t11), e13), [])) : e12; + var r9; + function o8(e13) { + const n9 = i9[e13.str]; + return void 0 === n9 || 1 !== t10[e13.str] ? e13 : (delete t10[e13.str], n9); + } + } + function q5(e12, t10) { + for (const i9 in t10) + e12[i9] = (e12[i9] || 0) - (t10[i9] || 0); + } + function k6(e12) { + return "boolean" == typeof e12 || "number" == typeof e12 || null === e12 ? !e12 : n8._`!${C6(e12)}`; + } + T6.kind = "finally", t9.CodeGen = class { + constructor(e12, t10 = {}) { + this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...t10, _n: t10.lines ? "\n" : "" }, this._extScope = e12, this._scope = new r8.Scope({ parent: e12 }), this._nodes = [new g7()]; + } + toString() { + return this._root.render(this.opts); + } + name(e12) { + return this._scope.name(e12); + } + scopeName(e12) { + return this._extScope.name(e12); + } + scopeValue(e12, t10) { + const i9 = this._extScope.value(e12, t10); + return (this._values[i9.prefix] || (this._values[i9.prefix] = /* @__PURE__ */ new Set())).add(i9), i9; + } + getScopeValue(e12, t10) { + return this._extScope.getValue(e12, t10); + } + scopeRefs(e12) { + return this._extScope.scopeRefs(e12, this._values); + } + scopeCode() { + return this._extScope.scopeCode(this._values); + } + _def(e12, t10, i9, n9) { + const r9 = this._scope.toName(t10); + return void 0 !== i9 && n9 && (this._constants[r9.str] = i9), this._leafNode(new p7(e12, r9, i9)), r9; + } + const(e12, t10, i9) { + return this._def(r8.varKinds.const, e12, t10, i9); + } + let(e12, t10, i9) { + return this._def(r8.varKinds.let, e12, t10, i9); + } + var(e12, t10, i9) { + return this._def(r8.varKinds.var, e12, t10, i9); + } + assign(e12, t10, i9) { + return this._leafNode(new c7(e12, t10, i9)); + } + add(e12, i9) { + return this._leafNode(new d7(e12, t9.operators.ADD, i9)); + } + code(e12) { + return "function" == typeof e12 ? e12() : e12 !== n8.nil && this._leafNode(new m7(e12)), this; + } + object(...e12) { + const t10 = ["{"]; + for (const [i9, r9] of e12) + t10.length > 1 && t10.push(","), t10.push(i9), (i9 !== r9 || this.opts.es5) && (t10.push(":"), (0, n8.addCodeArg)(t10, r9)); + return t10.push("}"), new n8._Code(t10); + } + if(e12, t10, i9) { + if (this._blockNode(new v8(e12)), t10 && i9) + this.code(t10).else().code(i9).endIf(); + else if (t10) + this.code(t10).endIf(); + else if (i9) + throw new Error('CodeGen: "else" body without "then" body'); + return this; + } + elseIf(e12) { + return this._elseNode(new v8(e12)); + } + else() { + return this._elseNode(new b8()); + } + endIf() { + return this._endBlockNode(v8, b8); + } + _for(e12, t10) { + return this._blockNode(e12), t10 && this.code(t10).endFor(), this; + } + for(e12, t10) { + return this._for(new $5(e12), t10); + } + forRange(e12, t10, i9, n9, o8 = this.opts.es5 ? r8.varKinds.var : r8.varKinds.let) { + const s8 = this._scope.toName(e12); + return this._for(new x7(o8, s8, t10, i9), () => n9(s8)); + } + forOf(e12, t10, i9, o8 = r8.varKinds.const) { + const s8 = this._scope.toName(e12); + if (this.opts.es5) { + const e13 = t10 instanceof n8.Name ? t10 : this.var("_arr", t10); + return this.forRange("_i", 0, n8._`${e13}.length`, (t11) => { + this.var(s8, n8._`${e13}[${t11}]`), i9(s8); + }); + } + return this._for(new _6("of", o8, s8, t10), () => i9(s8)); + } + forIn(e12, t10, i9, o8 = this.opts.es5 ? r8.varKinds.var : r8.varKinds.const) { + if (this.opts.ownProperties) + return this.forOf(e12, n8._`Object.keys(${t10})`, i9); + const s8 = this._scope.toName(e12); + return this._for(new _6("in", o8, s8, t10), () => i9(s8)); + } + endFor() { + return this._endBlockNode(j6); + } + label(e12) { + return this._leafNode(new f8(e12)); + } + break(e12) { + return this._leafNode(new l7(e12)); + } + return(e12) { + const t10 = new S6(); + if (this._blockNode(t10), this.code(e12), 1 !== t10.nodes.length) + throw new Error('CodeGen: "return" should have one node'); + return this._endBlockNode(S6); + } + try(e12, t10, i9) { + if (!t10 && !i9) + throw new Error('CodeGen: "try" without "catch" and "finally"'); + const n9 = new P6(); + if (this._blockNode(n9), this.code(e12), t10) { + const e13 = this.name("e"); + this._currNode = n9.catch = new O7(e13), t10(e13); + } + return i9 && (this._currNode = n9.finally = new T6(), this.code(i9)), this._endBlockNode(O7, T6); + } + throw(e12) { + return this._leafNode(new u7(e12)); + } + block(e12, t10) { + return this._blockStarts.push(this._nodes.length), e12 && this.code(e12).endBlock(t10), this; + } + endBlock(e12) { + const t10 = this._blockStarts.pop(); + if (void 0 === t10) + throw new Error("CodeGen: not in self-balancing block"); + const i9 = this._nodes.length - t10; + if (i9 < 0 || void 0 !== e12 && i9 !== e12) + throw new Error(`CodeGen: wrong number of nodes: ${i9} vs ${e12} expected`); + return this._nodes.length = t10, this; + } + func(e12, t10 = n8.nil, i9, r9) { + return this._blockNode(new w6(e12, t10, i9)), r9 && this.code(r9).endFunc(), this; + } + endFunc() { + return this._endBlockNode(w6); + } + optimize(e12 = 1) { + for (; e12-- > 0; ) + this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants); + } + _leafNode(e12) { + return this._currNode.nodes.push(e12), this; + } + _blockNode(e12) { + this._currNode.nodes.push(e12), this._nodes.push(e12); + } + _endBlockNode(e12, t10) { + const i9 = this._currNode; + if (i9 instanceof e12 || t10 && i9 instanceof t10) + return this._nodes.pop(), this; + throw new Error(`CodeGen: not in block "${t10 ? `${e12.kind}/${t10.kind}` : e12.kind}"`); + } + _elseNode(e12) { + const t10 = this._currNode; + if (!(t10 instanceof v8)) + throw new Error('CodeGen: "else" without "if"'); + return this._currNode = t10.else = e12, this; + } + get _root() { + return this._nodes[0]; + } + get _currNode() { + const e12 = this._nodes; + return e12[e12.length - 1]; + } + set _currNode(e12) { + const t10 = this._nodes; + t10[t10.length - 1] = e12; + } + }, t9.not = k6; + const M6 = D6(t9.operators.AND); + t9.and = function(...e12) { + return e12.reduce(M6); + }; + const R6 = D6(t9.operators.OR); + function D6(e12) { + return (t10, i9) => t10 === n8.nil ? i9 : i9 === n8.nil ? t10 : n8._`${C6(t10)} ${e12} ${C6(i9)}`; + } + function C6(e12) { + return e12 instanceof n8.Name ? e12 : n8._`(${e12})`; + } + t9.or = function(...e12) { + return e12.reduce(R6); + }; + }, 76930: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.ValueScope = t9.ValueScopeName = t9.Scope = t9.varKinds = t9.UsedValueState = void 0; + const n8 = i8(83277); + class r8 extends Error { + constructor(e12) { + super(`CodeGen: "code" for ${e12} not defined`), this.value = e12.value; + } + } + var o7; + !function(e12) { + e12[e12.Started = 0] = "Started", e12[e12.Completed = 1] = "Completed"; + }(o7 || (t9.UsedValueState = o7 = {})), t9.varKinds = { const: new n8.Name("const"), let: new n8.Name("let"), var: new n8.Name("var") }; + class s7 { + constructor({ prefixes: e12, parent: t10 } = {}) { + this._names = {}, this._prefixes = e12, this._parent = t10; + } + toName(e12) { + return e12 instanceof n8.Name ? e12 : this.name(e12); + } + name(e12) { + return new n8.Name(this._newName(e12)); + } + _newName(e12) { + return `${e12}${(this._names[e12] || this._nameGroup(e12)).index++}`; + } + _nameGroup(e12) { + var t10, i9; + if ((null === (i9 = null === (t10 = this._parent) || void 0 === t10 ? void 0 : t10._prefixes) || void 0 === i9 ? void 0 : i9.has(e12)) || this._prefixes && !this._prefixes.has(e12)) + throw new Error(`CodeGen: prefix "${e12}" is not allowed in this scope`); + return this._names[e12] = { prefix: e12, index: 0 }; + } + } + t9.Scope = s7; + class a7 extends n8.Name { + constructor(e12, t10) { + super(t10), this.prefix = e12; + } + setValue(e12, { property: t10, itemIndex: i9 }) { + this.value = e12, this.scopePath = n8._`.${new n8.Name(t10)}[${i9}]`; + } + } + t9.ValueScopeName = a7; + const p7 = n8._`\n`; + t9.ValueScope = class extends s7 { + constructor(e12) { + super(e12), this._values = {}, this._scope = e12.scope, this.opts = { ...e12, _n: e12.lines ? p7 : n8.nil }; + } + get() { + return this._scope; + } + name(e12) { + return new a7(e12, this._newName(e12)); + } + value(e12, t10) { + var i9; + if (void 0 === t10.ref) + throw new Error("CodeGen: ref must be passed in value"); + const n9 = this.toName(e12), { prefix: r9 } = n9, o8 = null !== (i9 = t10.key) && void 0 !== i9 ? i9 : t10.ref; + let s8 = this._values[r9]; + if (s8) { + const e13 = s8.get(o8); + if (e13) + return e13; + } else + s8 = this._values[r9] = /* @__PURE__ */ new Map(); + s8.set(o8, n9); + const a8 = this._scope[r9] || (this._scope[r9] = []), p8 = a8.length; + return a8[p8] = t10.ref, n9.setValue(t10, { property: r9, itemIndex: p8 }), n9; + } + getValue(e12, t10) { + const i9 = this._values[e12]; + if (i9) + return i9.get(t10); + } + scopeRefs(e12, t10 = this._values) { + return this._reduceValues(t10, (t11) => { + if (void 0 === t11.scopePath) + throw new Error(`CodeGen: name "${t11}" has no value`); + return n8._`${e12}${t11.scopePath}`; + }); + } + scopeCode(e12 = this._values, t10, i9) { + return this._reduceValues(e12, (e13) => { + if (void 0 === e13.value) + throw new Error(`CodeGen: name "${e13}" has no value`); + return e13.value.code; + }, t10, i9); + } + _reduceValues(e12, i9, s8 = {}, a8) { + let p8 = n8.nil; + for (const c7 in e12) { + const d7 = e12[c7]; + if (!d7) + continue; + const f8 = s8[c7] = s8[c7] || /* @__PURE__ */ new Map(); + d7.forEach((e13) => { + if (f8.has(e13)) + return; + f8.set(e13, o7.Started); + let s9 = i9(e13); + if (s9) { + const i10 = this.opts.es5 ? t9.varKinds.var : t9.varKinds.const; + p8 = n8._`${p8}${i10} ${e13} = ${s9};${this.opts._n}`; + } else { + if (!(s9 = null == a8 ? void 0 : a8(e13))) + throw new r8(e13); + p8 = n8._`${p8}${s9}${this.opts._n}`; + } + f8.set(e13, o7.Completed); + }); + } + return p8; + } + }; + }, 49409: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.extendErrors = t9.resetErrorsCount = t9.reportExtraError = t9.reportError = t9.keyword$DataError = t9.keywordError = void 0; + const n8 = i8(17898), r8 = i8(50458), o7 = i8(63036); + function s7(e12, t10) { + const i9 = e12.const("err", t10); + e12.if(n8._`${o7.default.vErrors} === null`, () => e12.assign(o7.default.vErrors, n8._`[${i9}]`), n8._`${o7.default.vErrors}.push(${i9})`), e12.code(n8._`${o7.default.errors}++`); + } + function a7(e12, t10) { + const { gen: i9, validateName: r9, schemaEnv: o8 } = e12; + o8.$async ? i9.throw(n8._`new ${e12.ValidationError}(${t10})`) : (i9.assign(n8._`${r9}.errors`, t10), i9.return(false)); + } + t9.keywordError = { message: ({ keyword: e12 }) => n8.str`must pass "${e12}" keyword validation` }, t9.keyword$DataError = { message: ({ keyword: e12, schemaType: t10 }) => t10 ? n8.str`"${e12}" keyword must be ${t10} ($data)` : n8.str`"${e12}" keyword is invalid ($data)` }, t9.reportError = function(e12, i9 = t9.keywordError, r9, o8) { + const { it: p8 } = e12, { gen: d8, compositeRule: f9, allErrors: l7 } = p8, u7 = c7(e12, i9, r9); + (null != o8 ? o8 : f9 || l7) ? s7(d8, u7) : a7(p8, n8._`[${u7}]`); + }, t9.reportExtraError = function(e12, i9 = t9.keywordError, n9) { + const { it: r9 } = e12, { gen: p8, compositeRule: d8, allErrors: f9 } = r9; + s7(p8, c7(e12, i9, n9)), d8 || f9 || a7(r9, o7.default.vErrors); + }, t9.resetErrorsCount = function(e12, t10) { + e12.assign(o7.default.errors, t10), e12.if(n8._`${o7.default.vErrors} !== null`, () => e12.if(t10, () => e12.assign(n8._`${o7.default.vErrors}.length`, t10), () => e12.assign(o7.default.vErrors, null))); + }, t9.extendErrors = function({ gen: e12, keyword: t10, schemaValue: i9, data: r9, errsCount: s8, it: a8 }) { + if (void 0 === s8) + throw new Error("ajv implementation error"); + const p8 = e12.name("err"); + e12.forRange("i", s8, o7.default.errors, (s9) => { + e12.const(p8, n8._`${o7.default.vErrors}[${s9}]`), e12.if(n8._`${p8}.instancePath === undefined`, () => e12.assign(n8._`${p8}.instancePath`, (0, n8.strConcat)(o7.default.instancePath, a8.errorPath))), e12.assign(n8._`${p8}.schemaPath`, n8.str`${a8.errSchemaPath}/${t10}`), a8.opts.verbose && (e12.assign(n8._`${p8}.schema`, i9), e12.assign(n8._`${p8}.data`, r9)); + }); + }; + const p7 = { keyword: new n8.Name("keyword"), schemaPath: new n8.Name("schemaPath"), params: new n8.Name("params"), propertyName: new n8.Name("propertyName"), message: new n8.Name("message"), schema: new n8.Name("schema"), parentSchema: new n8.Name("parentSchema") }; + function c7(e12, t10, i9) { + const { createErrors: r9 } = e12.it; + return false === r9 ? n8._`{}` : function(e13, t11, i10 = {}) { + const { gen: r10, it: s8 } = e13, a8 = [d7(s8, i10), f8(e13, i10)]; + return function(e14, { params: t12, message: i11 }, r11) { + const { keyword: s9, data: a9, schemaValue: c8, it: d8 } = e14, { opts: f9, propertyName: l7, topSchemaRef: u7, schemaPath: m7 } = d8; + r11.push([p7.keyword, s9], [p7.params, "function" == typeof t12 ? t12(e14) : t12 || n8._`{}`]), f9.messages && r11.push([p7.message, "function" == typeof i11 ? i11(e14) : i11]), f9.verbose && r11.push([p7.schema, c8], [p7.parentSchema, n8._`${u7}${m7}`], [o7.default.data, a9]), l7 && r11.push([p7.propertyName, l7]); + }(e13, t11, a8), r10.object(...a8); + }(e12, t10, i9); + } + function d7({ errorPath: e12 }, { instancePath: t10 }) { + const i9 = t10 ? n8.str`${e12}${(0, r8.getErrorPath)(t10, r8.Type.Str)}` : e12; + return [o7.default.instancePath, (0, n8.strConcat)(o7.default.instancePath, i9)]; + } + function f8({ keyword: e12, it: { errSchemaPath: t10 } }, { schemaPath: i9, parentSchema: o8 }) { + let s8 = o8 ? t10 : n8.str`${t10}/${e12}`; + return i9 && (s8 = n8.str`${s8}${(0, r8.getErrorPath)(i9, r8.Type.Str)}`), [p7.schemaPath, s8]; + } + }, 49392: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.resolveSchema = t9.getCompilingSchema = t9.resolveRef = t9.compileSchema = t9.SchemaEnv = void 0; + const n8 = i8(17898), r8 = i8(95031), o7 = i8(63036), s7 = i8(14856), a7 = i8(50458), p7 = i8(96223); + class c7 { + constructor(e12) { + var t10; + let i9; + this.refs = {}, this.dynamicAnchors = {}, "object" == typeof e12.schema && (i9 = e12.schema), this.schema = e12.schema, this.schemaId = e12.schemaId, this.root = e12.root || this, this.baseId = null !== (t10 = e12.baseId) && void 0 !== t10 ? t10 : (0, s7.normalizeId)(null == i9 ? void 0 : i9[e12.schemaId || "$id"]), this.schemaPath = e12.schemaPath, this.localRefs = e12.localRefs, this.meta = e12.meta, this.$async = null == i9 ? void 0 : i9.$async, this.refs = {}; + } + } + function d7(e12) { + const t10 = l7.call(this, e12); + if (t10) + return t10; + const i9 = (0, s7.getFullPath)(this.opts.uriResolver, e12.root.baseId), { es5: a8, lines: c8 } = this.opts.code, { ownProperties: d8 } = this.opts, f9 = new n8.CodeGen(this.scope, { es5: a8, lines: c8, ownProperties: d8 }); + let u8; + e12.$async && (u8 = f9.scopeValue("Error", { ref: r8.default, code: n8._`require("ajv/dist/runtime/validation_error").default` })); + const m8 = f9.scopeName("validate"); + e12.validateName = m8; + const h9 = { gen: f9, allErrors: this.opts.allErrors, data: o7.default.data, parentData: o7.default.parentData, parentDataProperty: o7.default.parentDataProperty, dataNames: [o7.default.data], dataPathArr: [n8.nil], dataLevel: 0, dataTypes: [], definedProperties: /* @__PURE__ */ new Set(), topSchemaRef: f9.scopeValue("schema", true === this.opts.code.source ? { ref: e12.schema, code: (0, n8.stringify)(e12.schema) } : { ref: e12.schema }), validateName: m8, ValidationError: u8, schema: e12.schema, schemaEnv: e12, rootId: i9, baseId: e12.baseId || i9, schemaPath: n8.nil, errSchemaPath: e12.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: n8._`""`, opts: this.opts, self: this }; + let y8; + try { + this._compilations.add(e12), (0, p7.validateFunctionCode)(h9), f9.optimize(this.opts.code.optimize); + const t11 = f9.toString(); + y8 = `${f9.scopeRefs(o7.default.scope)}return ${t11}`, this.opts.code.process && (y8 = this.opts.code.process(y8, e12)); + const i10 = new Function(`${o7.default.self}`, `${o7.default.scope}`, y8)(this, this.scope.get()); + if (this.scope.value(m8, { ref: i10 }), i10.errors = null, i10.schema = e12.schema, i10.schemaEnv = e12, e12.$async && (i10.$async = true), true === this.opts.code.source && (i10.source = { validateName: m8, validateCode: t11, scopeValues: f9._values }), this.opts.unevaluated) { + const { props: e13, items: t12 } = h9; + i10.evaluated = { props: e13 instanceof n8.Name ? void 0 : e13, items: t12 instanceof n8.Name ? void 0 : t12, dynamicProps: e13 instanceof n8.Name, dynamicItems: t12 instanceof n8.Name }, i10.source && (i10.source.evaluated = (0, n8.stringify)(i10.evaluated)); + } + return e12.validate = i10, e12; + } catch (t11) { + throw delete e12.validate, delete e12.validateName, y8 && this.logger.error("Error compiling schema, function code:", y8), t11; + } finally { + this._compilations.delete(e12); + } + } + function f8(e12) { + return (0, s7.inlineRef)(e12.schema, this.opts.inlineRefs) ? e12.schema : e12.validate ? e12 : d7.call(this, e12); + } + function l7(e12) { + for (const n9 of this._compilations) + if (i9 = e12, (t10 = n9).schema === i9.schema && t10.root === i9.root && t10.baseId === i9.baseId) + return n9; + var t10, i9; + } + function u7(e12, t10) { + let i9; + for (; "string" == typeof (i9 = this.refs[t10]); ) + t10 = i9; + return i9 || this.schemas[t10] || m7.call(this, e12, t10); + } + function m7(e12, t10) { + const i9 = this.opts.uriResolver.parse(t10), n9 = (0, s7._getFullPath)(this.opts.uriResolver, i9); + let r9 = (0, s7.getFullPath)(this.opts.uriResolver, e12.baseId, void 0); + if (Object.keys(e12.schema).length > 0 && n9 === r9) + return y7.call(this, i9, e12); + const o8 = (0, s7.normalizeId)(n9), a8 = this.refs[o8] || this.schemas[o8]; + if ("string" == typeof a8) { + const t11 = m7.call(this, e12, a8); + if ("object" != typeof (null == t11 ? void 0 : t11.schema)) + return; + return y7.call(this, i9, t11); + } + if ("object" == typeof (null == a8 ? void 0 : a8.schema)) { + if (a8.validate || d7.call(this, a8), o8 === (0, s7.normalizeId)(t10)) { + const { schema: t11 } = a8, { schemaId: i10 } = this.opts, n10 = t11[i10]; + return n10 && (r9 = (0, s7.resolveUrl)(this.opts.uriResolver, r9, n10)), new c7({ schema: t11, schemaId: i10, root: e12, baseId: r9 }); + } + return y7.call(this, i9, a8); + } + } + t9.SchemaEnv = c7, t9.compileSchema = d7, t9.resolveRef = function(e12, t10, i9) { + var n9; + i9 = (0, s7.resolveUrl)(this.opts.uriResolver, t10, i9); + const r9 = e12.refs[i9]; + if (r9) + return r9; + let o8 = u7.call(this, e12, i9); + if (void 0 === o8) { + const r10 = null === (n9 = e12.localRefs) || void 0 === n9 ? void 0 : n9[i9], { schemaId: s8 } = this.opts; + r10 && (o8 = new c7({ schema: r10, schemaId: s8, root: e12, baseId: t10 })); + } + return void 0 !== o8 ? e12.refs[i9] = f8.call(this, o8) : void 0; + }, t9.getCompilingSchema = l7, t9.resolveSchema = m7; + const h8 = /* @__PURE__ */ new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]); + function y7(e12, { baseId: t10, schema: i9, root: n9 }) { + var r9; + if ("/" !== (null === (r9 = e12.fragment) || void 0 === r9 ? void 0 : r9[0])) + return; + for (const n10 of e12.fragment.slice(1).split("/")) { + if ("boolean" == typeof i9) + return; + const e13 = i9[(0, a7.unescapeFragment)(n10)]; + if (void 0 === e13) + return; + const r10 = "object" == typeof (i9 = e13) && i9[this.opts.schemaId]; + !h8.has(n10) && r10 && (t10 = (0, s7.resolveUrl)(this.opts.uriResolver, t10, r10)); + } + let o8; + if ("boolean" != typeof i9 && i9.$ref && !(0, a7.schemaHasRulesButRef)(i9, this.RULES)) { + const e13 = (0, s7.resolveUrl)(this.opts.uriResolver, t10, i9.$ref); + o8 = m7.call(this, n9, e13); + } + const { schemaId: p8 } = this.opts; + return o8 = o8 || new c7({ schema: i9, schemaId: p8, root: n9, baseId: t10 }), o8.schema !== o8.root.schema ? o8 : void 0; + } + }, 63036: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = { data: new n8.Name("data"), valCxt: new n8.Name("valCxt"), instancePath: new n8.Name("instancePath"), parentData: new n8.Name("parentData"), parentDataProperty: new n8.Name("parentDataProperty"), rootData: new n8.Name("rootData"), dynamicAnchors: new n8.Name("dynamicAnchors"), vErrors: new n8.Name("vErrors"), errors: new n8.Name("errors"), this: new n8.Name("this"), self: new n8.Name("self"), scope: new n8.Name("scope"), json: new n8.Name("json"), jsonPos: new n8.Name("jsonPos"), jsonLen: new n8.Name("jsonLen"), jsonPart: new n8.Name("jsonPart") }; + t9.default = r8; + }, 85748: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(14856); + class r8 extends Error { + constructor(e12, t10, i9, r9) { + super(r9 || `can't resolve reference ${i9} from id ${t10}`), this.missingRef = (0, n8.resolveUrl)(e12, t10, i9), this.missingSchema = (0, n8.normalizeId)((0, n8.getFullPath)(e12, this.missingRef)); + } + } + t9.default = r8; + }, 14856: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getSchemaRefs = t9.resolveUrl = t9.normalizeId = t9._getFullPath = t9.getFullPath = t9.inlineRef = void 0; + const n8 = i8(50458), r8 = i8(38792), o7 = i8(1645), s7 = /* @__PURE__ */ new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]); + t9.inlineRef = function(e12, t10 = true) { + return "boolean" == typeof e12 || (true === t10 ? !p7(e12) : !!t10 && c7(e12) <= t10); + }; + const a7 = /* @__PURE__ */ new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]); + function p7(e12) { + for (const t10 in e12) { + if (a7.has(t10)) + return true; + const i9 = e12[t10]; + if (Array.isArray(i9) && i9.some(p7)) + return true; + if ("object" == typeof i9 && p7(i9)) + return true; + } + return false; + } + function c7(e12) { + let t10 = 0; + for (const i9 in e12) { + if ("$ref" === i9) + return 1 / 0; + if (t10++, !s7.has(i9) && ("object" == typeof e12[i9] && (0, n8.eachItem)(e12[i9], (e13) => t10 += c7(e13)), t10 === 1 / 0)) + return 1 / 0; + } + return t10; + } + function d7(e12, t10 = "", i9) { + false !== i9 && (t10 = u7(t10)); + const n9 = e12.parse(t10); + return f8(e12, n9); + } + function f8(e12, t10) { + return e12.serialize(t10).split("#")[0] + "#"; + } + t9.getFullPath = d7, t9._getFullPath = f8; + const l7 = /#\/?$/; + function u7(e12) { + return e12 ? e12.replace(l7, "") : ""; + } + t9.normalizeId = u7, t9.resolveUrl = function(e12, t10, i9) { + return i9 = u7(i9), e12.resolve(t10, i9); + }; + const m7 = /^[a-z_][-a-z0-9._]*$/i; + t9.getSchemaRefs = function(e12, t10) { + if ("boolean" == typeof e12) + return {}; + const { schemaId: i9, uriResolver: n9 } = this.opts, s8 = u7(e12[i9] || t10), a8 = { "": s8 }, p8 = d7(n9, s8, false), c8 = {}, f9 = /* @__PURE__ */ new Set(); + return o7(e12, { allKeys: true }, (e13, t11, n10, r9) => { + if (void 0 === r9) + return; + const o8 = p8 + t11; + let s9 = a8[r9]; + function d8(t12) { + const i10 = this.opts.uriResolver.resolve; + if (t12 = u7(s9 ? i10(s9, t12) : t12), f9.has(t12)) + throw h8(t12); + f9.add(t12); + let n11 = this.refs[t12]; + return "string" == typeof n11 && (n11 = this.refs[n11]), "object" == typeof n11 ? l8(e13, n11.schema, t12) : t12 !== u7(o8) && ("#" === t12[0] ? (l8(e13, c8[t12], t12), c8[t12] = e13) : this.refs[t12] = o8), t12; + } + function y7(e14) { + if ("string" == typeof e14) { + if (!m7.test(e14)) + throw new Error(`invalid anchor "${e14}"`); + d8.call(this, `#${e14}`); + } + } + "string" == typeof e13[i9] && (s9 = d8.call(this, e13[i9])), y7.call(this, e13.$anchor), y7.call(this, e13.$dynamicAnchor), a8[t11] = s9; + }), c8; + function l8(e13, t11, i10) { + if (void 0 !== t11 && !r8(e13, t11)) + throw h8(i10); + } + function h8(e13) { + return new Error(`reference "${e13}" resolves to more than one schema`); + } + }; + }, 90383: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getRules = t9.isJSONType = void 0; + const i8 = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null", "object", "array"]); + t9.isJSONType = function(e12) { + return "string" == typeof e12 && i8.has(e12); + }, t9.getRules = function() { + const e12 = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } }; + return { types: { ...e12, integer: true, boolean: true, null: true }, rules: [{ rules: [] }, e12.number, e12.string, e12.array, e12.object], post: { rules: [] }, all: {}, keywords: {} }; + }; + }, 50458: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.checkStrictMode = t9.getErrorPath = t9.Type = t9.useFunc = t9.setEvaluated = t9.evaluatedPropsToName = t9.mergeEvaluated = t9.eachItem = t9.unescapeJsonPointer = t9.escapeJsonPointer = t9.escapeFragment = t9.unescapeFragment = t9.schemaRefOrVal = t9.schemaHasRulesButRef = t9.schemaHasRules = t9.checkUnknownRules = t9.alwaysValidSchema = t9.toHash = void 0; + const n8 = i8(17898), r8 = i8(83277); + function o7(e12, t10 = e12.schema) { + const { opts: i9, self: n9 } = e12; + if (!i9.strictSchema) + return; + if ("boolean" == typeof t10) + return; + const r9 = n9.RULES.keywords; + for (const i10 in t10) + r9[i10] || m7(e12, `unknown keyword: "${i10}"`); + } + function s7(e12, t10) { + if ("boolean" == typeof e12) + return !e12; + for (const i9 in e12) + if (t10[i9]) + return true; + return false; + } + function a7(e12) { + return "number" == typeof e12 ? `${e12}` : e12.replace(/~/g, "~0").replace(/\//g, "~1"); + } + function p7(e12) { + return e12.replace(/~1/g, "/").replace(/~0/g, "~"); + } + function c7({ mergeNames: e12, mergeToName: t10, mergeValues: i9, resultToName: r9 }) { + return (o8, s8, a8, p8) => { + const c8 = void 0 === a8 ? s8 : a8 instanceof n8.Name ? (s8 instanceof n8.Name ? e12(o8, s8, a8) : t10(o8, s8, a8), a8) : s8 instanceof n8.Name ? (t10(o8, a8, s8), s8) : i9(s8, a8); + return p8 !== n8.Name || c8 instanceof n8.Name ? c8 : r9(o8, c8); + }; + } + function d7(e12, t10) { + if (true === t10) + return e12.var("props", true); + const i9 = e12.var("props", n8._`{}`); + return void 0 !== t10 && f8(e12, i9, t10), i9; + } + function f8(e12, t10, i9) { + Object.keys(i9).forEach((i10) => e12.assign(n8._`${t10}${(0, n8.getProperty)(i10)}`, true)); + } + t9.toHash = function(e12) { + const t10 = {}; + for (const i9 of e12) + t10[i9] = true; + return t10; + }, t9.alwaysValidSchema = function(e12, t10) { + return "boolean" == typeof t10 ? t10 : 0 === Object.keys(t10).length || (o7(e12, t10), !s7(t10, e12.self.RULES.all)); + }, t9.checkUnknownRules = o7, t9.schemaHasRules = s7, t9.schemaHasRulesButRef = function(e12, t10) { + if ("boolean" == typeof e12) + return !e12; + for (const i9 in e12) + if ("$ref" !== i9 && t10.all[i9]) + return true; + return false; + }, t9.schemaRefOrVal = function({ topSchemaRef: e12, schemaPath: t10 }, i9, r9, o8) { + if (!o8) { + if ("number" == typeof i9 || "boolean" == typeof i9) + return i9; + if ("string" == typeof i9) + return n8._`${i9}`; + } + return n8._`${e12}${t10}${(0, n8.getProperty)(r9)}`; + }, t9.unescapeFragment = function(e12) { + return p7(decodeURIComponent(e12)); + }, t9.escapeFragment = function(e12) { + return encodeURIComponent(a7(e12)); + }, t9.escapeJsonPointer = a7, t9.unescapeJsonPointer = p7, t9.eachItem = function(e12, t10) { + if (Array.isArray(e12)) + for (const i9 of e12) + t10(i9); + else + t10(e12); + }, t9.mergeEvaluated = { props: c7({ mergeNames: (e12, t10, i9) => e12.if(n8._`${i9} !== true && ${t10} !== undefined`, () => { + e12.if(n8._`${t10} === true`, () => e12.assign(i9, true), () => e12.assign(i9, n8._`${i9} || {}`).code(n8._`Object.assign(${i9}, ${t10})`)); + }), mergeToName: (e12, t10, i9) => e12.if(n8._`${i9} !== true`, () => { + true === t10 ? e12.assign(i9, true) : (e12.assign(i9, n8._`${i9} || {}`), f8(e12, i9, t10)); + }), mergeValues: (e12, t10) => true === e12 || { ...e12, ...t10 }, resultToName: d7 }), items: c7({ mergeNames: (e12, t10, i9) => e12.if(n8._`${i9} !== true && ${t10} !== undefined`, () => e12.assign(i9, n8._`${t10} === true ? true : ${i9} > ${t10} ? ${i9} : ${t10}`)), mergeToName: (e12, t10, i9) => e12.if(n8._`${i9} !== true`, () => e12.assign(i9, true === t10 || n8._`${i9} > ${t10} ? ${i9} : ${t10}`)), mergeValues: (e12, t10) => true === e12 || Math.max(e12, t10), resultToName: (e12, t10) => e12.var("items", t10) }) }, t9.evaluatedPropsToName = d7, t9.setEvaluated = f8; + const l7 = {}; + var u7; + function m7(e12, t10, i9 = e12.opts.strictSchema) { + if (i9) { + if (t10 = `strict mode: ${t10}`, true === i9) + throw new Error(t10); + e12.self.logger.warn(t10); + } + } + t9.useFunc = function(e12, t10) { + return e12.scopeValue("func", { ref: t10, code: l7[t10.code] || (l7[t10.code] = new r8._Code(t10.code)) }); + }, function(e12) { + e12[e12.Num = 0] = "Num", e12[e12.Str = 1] = "Str"; + }(u7 || (t9.Type = u7 = {})), t9.getErrorPath = function(e12, t10, i9) { + if (e12 instanceof n8.Name) { + const r9 = t10 === u7.Num; + return i9 ? r9 ? n8._`"[" + ${e12} + "]"` : n8._`"['" + ${e12} + "']"` : r9 ? n8._`"/" + ${e12}` : n8._`"/" + ${e12}.replace(/~/g, "~0").replace(/\\//g, "~1")`; + } + return i9 ? (0, n8.getProperty)(e12).toString() : "/" + a7(e12); + }, t9.checkStrictMode = m7; + }, 74758: (e11, t9) => { + "use strict"; + function i8(e12, t10) { + return t10.rules.some((t11) => n8(e12, t11)); + } + function n8(e12, t10) { + var i9; + return void 0 !== e12[t10.keyword] || (null === (i9 = t10.definition.implements) || void 0 === i9 ? void 0 : i9.some((t11) => void 0 !== e12[t11])); + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.shouldUseRule = t9.shouldUseGroup = t9.schemaHasRulesForType = void 0, t9.schemaHasRulesForType = function({ schema: e12, self: t10 }, n9) { + const r8 = t10.RULES.types[n9]; + return r8 && true !== r8 && i8(e12, r8); + }, t9.shouldUseGroup = i8, t9.shouldUseRule = n8; + }, 15948: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.boolOrEmptySchema = t9.topBoolOrEmptySchema = void 0; + const n8 = i8(49409), r8 = i8(17898), o7 = i8(63036), s7 = { message: "boolean schema is false" }; + function a7(e12, t10) { + const { gen: i9, data: r9 } = e12, o8 = { gen: i9, keyword: "false schema", data: r9, schema: false, schemaCode: false, schemaValue: false, params: {}, it: e12 }; + (0, n8.reportError)(o8, s7, void 0, t10); + } + t9.topBoolOrEmptySchema = function(e12) { + const { gen: t10, schema: i9, validateName: n9 } = e12; + false === i9 ? a7(e12, false) : "object" == typeof i9 && true === i9.$async ? t10.return(o7.default.data) : (t10.assign(r8._`${n9}.errors`, null), t10.return(true)); + }, t9.boolOrEmptySchema = function(e12, t10) { + const { gen: i9, schema: n9 } = e12; + false === n9 ? (i9.var(t10, false), a7(e12)) : i9.var(t10, true); + }; + }, 69003: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.reportTypeError = t9.checkDataTypes = t9.checkDataType = t9.coerceAndCheckDataType = t9.getJSONTypes = t9.getSchemaTypes = t9.DataType = void 0; + const n8 = i8(90383), r8 = i8(74758), o7 = i8(49409), s7 = i8(17898), a7 = i8(50458); + var p7; + function c7(e12) { + const t10 = Array.isArray(e12) ? e12 : e12 ? [e12] : []; + if (t10.every(n8.isJSONType)) + return t10; + throw new Error("type must be JSONType or JSONType[]: " + t10.join(",")); + } + !function(e12) { + e12[e12.Correct = 0] = "Correct", e12[e12.Wrong = 1] = "Wrong"; + }(p7 || (t9.DataType = p7 = {})), t9.getSchemaTypes = function(e12) { + const t10 = c7(e12.type); + if (t10.includes("null")) { + if (false === e12.nullable) + throw new Error("type: null contradicts nullable: false"); + } else { + if (!t10.length && void 0 !== e12.nullable) + throw new Error('"nullable" cannot be used without "type"'); + true === e12.nullable && t10.push("null"); + } + return t10; + }, t9.getJSONTypes = c7, t9.coerceAndCheckDataType = function(e12, t10) { + const { gen: i9, data: n9, opts: o8 } = e12, a8 = function(e13, t11) { + return t11 ? e13.filter((e14) => d7.has(e14) || "array" === t11 && "array" === e14) : []; + }(t10, o8.coerceTypes), c8 = t10.length > 0 && !(0 === a8.length && 1 === t10.length && (0, r8.schemaHasRulesForType)(e12, t10[0])); + if (c8) { + const r9 = l7(t10, n9, o8.strictNumbers, p7.Wrong); + i9.if(r9, () => { + a8.length ? function(e13, t11, i10) { + const { gen: n10, data: r10, opts: o9 } = e13, a9 = n10.let("dataType", s7._`typeof ${r10}`), p8 = n10.let("coerced", s7._`undefined`); + "array" === o9.coerceTypes && n10.if(s7._`${a9} == 'object' && Array.isArray(${r10}) && ${r10}.length == 1`, () => n10.assign(r10, s7._`${r10}[0]`).assign(a9, s7._`typeof ${r10}`).if(l7(t11, r10, o9.strictNumbers), () => n10.assign(p8, r10))), n10.if(s7._`${p8} !== undefined`); + for (const e14 of i10) + (d7.has(e14) || "array" === e14 && "array" === o9.coerceTypes) && c9(e14); + function c9(e14) { + switch (e14) { + case "string": + return void n10.elseIf(s7._`${a9} == "number" || ${a9} == "boolean"`).assign(p8, s7._`"" + ${r10}`).elseIf(s7._`${r10} === null`).assign(p8, s7._`""`); + case "number": + return void n10.elseIf(s7._`${a9} == "boolean" || ${r10} === null + || (${a9} == "string" && ${r10} && ${r10} == +${r10})`).assign(p8, s7._`+${r10}`); + case "integer": + return void n10.elseIf(s7._`${a9} === "boolean" || ${r10} === null + || (${a9} === "string" && ${r10} && ${r10} == +${r10} && !(${r10} % 1))`).assign(p8, s7._`+${r10}`); + case "boolean": + return void n10.elseIf(s7._`${r10} === "false" || ${r10} === 0 || ${r10} === null`).assign(p8, false).elseIf(s7._`${r10} === "true" || ${r10} === 1`).assign(p8, true); + case "null": + return n10.elseIf(s7._`${r10} === "" || ${r10} === 0 || ${r10} === false`), void n10.assign(p8, null); + case "array": + n10.elseIf(s7._`${a9} === "string" || ${a9} === "number" + || ${a9} === "boolean" || ${r10} === null`).assign(p8, s7._`[${r10}]`); + } + } + n10.else(), m7(e13), n10.endIf(), n10.if(s7._`${p8} !== undefined`, () => { + n10.assign(r10, p8), function({ gen: e14, parentData: t12, parentDataProperty: i11 }, n11) { + e14.if(s7._`${t12} !== undefined`, () => e14.assign(s7._`${t12}[${i11}]`, n11)); + }(e13, p8); + }); + }(e12, t10, a8) : m7(e12); + }); + } + return c8; + }; + const d7 = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); + function f8(e12, t10, i9, n9 = p7.Correct) { + const r9 = n9 === p7.Correct ? s7.operators.EQ : s7.operators.NEQ; + let o8; + switch (e12) { + case "null": + return s7._`${t10} ${r9} null`; + case "array": + o8 = s7._`Array.isArray(${t10})`; + break; + case "object": + o8 = s7._`${t10} && typeof ${t10} == "object" && !Array.isArray(${t10})`; + break; + case "integer": + o8 = a8(s7._`!(${t10} % 1) && !isNaN(${t10})`); + break; + case "number": + o8 = a8(); + break; + default: + return s7._`typeof ${t10} ${r9} ${e12}`; + } + return n9 === p7.Correct ? o8 : (0, s7.not)(o8); + function a8(e13 = s7.nil) { + return (0, s7.and)(s7._`typeof ${t10} == "number"`, e13, i9 ? s7._`isFinite(${t10})` : s7.nil); + } + } + function l7(e12, t10, i9, n9) { + if (1 === e12.length) + return f8(e12[0], t10, i9, n9); + let r9; + const o8 = (0, a7.toHash)(e12); + if (o8.array && o8.object) { + const e13 = s7._`typeof ${t10} != "object"`; + r9 = o8.null ? e13 : s7._`!${t10} || ${e13}`, delete o8.null, delete o8.array, delete o8.object; + } else + r9 = s7.nil; + o8.number && delete o8.integer; + for (const e13 in o8) + r9 = (0, s7.and)(r9, f8(e13, t10, i9, n9)); + return r9; + } + t9.checkDataType = f8, t9.checkDataTypes = l7; + const u7 = { message: ({ schema: e12 }) => `must be ${e12}`, params: ({ schema: e12, schemaValue: t10 }) => "string" == typeof e12 ? s7._`{type: ${e12}}` : s7._`{type: ${t10}}` }; + function m7(e12) { + const t10 = function(e13) { + const { gen: t11, data: i9, schema: n9 } = e13, r9 = (0, a7.schemaRefOrVal)(e13, n9, "type"); + return { gen: t11, keyword: "type", data: i9, schema: n9.type, schemaCode: r9, schemaValue: r9, parentSchema: n9, params: {}, it: e13 }; + }(e12); + (0, o7.reportError)(t10, u7); + } + t9.reportTypeError = m7; + }, 96841: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.assignDefaults = void 0; + const n8 = i8(17898), r8 = i8(50458); + function o7(e12, t10, i9) { + const { gen: o8, compositeRule: s7, data: a7, opts: p7 } = e12; + if (void 0 === i9) + return; + const c7 = n8._`${a7}${(0, n8.getProperty)(t10)}`; + if (s7) + return void (0, r8.checkStrictMode)(e12, `default is ignored for: ${c7}`); + let d7 = n8._`${c7} === undefined`; + "empty" === p7.useDefaults && (d7 = n8._`${d7} || ${c7} === null || ${c7} === ""`), o8.if(d7, n8._`${c7} = ${(0, n8.stringify)(i9)}`); + } + t9.assignDefaults = function(e12, t10) { + const { properties: i9, items: n9 } = e12.schema; + if ("object" === t10 && i9) + for (const t11 in i9) + o7(e12, t11, i9[t11].default); + else + "array" === t10 && Array.isArray(n9) && n9.forEach((t11, i10) => o7(e12, i10, t11.default)); + }; + }, 96223: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getData = t9.KeywordCxt = t9.validateFunctionCode = void 0; + const n8 = i8(15948), r8 = i8(69003), o7 = i8(74758), s7 = i8(69003), a7 = i8(96841), p7 = i8(49348), c7 = i8(53322), d7 = i8(17898), f8 = i8(63036), l7 = i8(14856), u7 = i8(50458), m7 = i8(49409); + function h8({ gen: e12, validateName: t10, schema: i9, schemaEnv: n9, opts: r9 }, o8) { + r9.code.es5 ? e12.func(t10, d7._`${f8.default.data}, ${f8.default.valCxt}`, n9.$async, () => { + e12.code(d7._`"use strict"; ${y7(i9, r9)}`), function(e13, t11) { + e13.if(f8.default.valCxt, () => { + e13.var(f8.default.instancePath, d7._`${f8.default.valCxt}.${f8.default.instancePath}`), e13.var(f8.default.parentData, d7._`${f8.default.valCxt}.${f8.default.parentData}`), e13.var(f8.default.parentDataProperty, d7._`${f8.default.valCxt}.${f8.default.parentDataProperty}`), e13.var(f8.default.rootData, d7._`${f8.default.valCxt}.${f8.default.rootData}`), t11.dynamicRef && e13.var(f8.default.dynamicAnchors, d7._`${f8.default.valCxt}.${f8.default.dynamicAnchors}`); + }, () => { + e13.var(f8.default.instancePath, d7._`""`), e13.var(f8.default.parentData, d7._`undefined`), e13.var(f8.default.parentDataProperty, d7._`undefined`), e13.var(f8.default.rootData, f8.default.data), t11.dynamicRef && e13.var(f8.default.dynamicAnchors, d7._`{}`); + }); + }(e12, r9), e12.code(o8); + }) : e12.func(t10, d7._`${f8.default.data}, ${function(e13) { + return d7._`{${f8.default.instancePath}="", ${f8.default.parentData}, ${f8.default.parentDataProperty}, ${f8.default.rootData}=${f8.default.data}${e13.dynamicRef ? d7._`, ${f8.default.dynamicAnchors}={}` : d7.nil}}={}`; + }(r9)}`, n9.$async, () => e12.code(y7(i9, r9)).code(o8)); + } + function y7(e12, t10) { + const i9 = "object" == typeof e12 && e12[t10.schemaId]; + return i9 && (t10.code.source || t10.code.process) ? d7._`/*# sourceURL=${i9} */` : d7.nil; + } + function g7({ schema: e12, self: t10 }) { + if ("boolean" == typeof e12) + return !e12; + for (const i9 in e12) + if (t10.RULES.all[i9]) + return true; + return false; + } + function b8(e12) { + return "boolean" != typeof e12.schema; + } + function v8(e12) { + (0, u7.checkUnknownRules)(e12), function(e13) { + const { schema: t10, errSchemaPath: i9, opts: n9, self: r9 } = e13; + t10.$ref && n9.ignoreKeywordsWithRef && (0, u7.schemaHasRulesButRef)(t10, r9.RULES) && r9.logger.warn(`$ref: keywords ignored in schema at path "${i9}"`); + }(e12); + } + function j6(e12, t10) { + if (e12.opts.jtd) + return x7(e12, [], false, t10); + const i9 = (0, r8.getSchemaTypes)(e12.schema); + x7(e12, i9, !(0, r8.coerceAndCheckDataType)(e12, i9), t10); + } + function $5({ gen: e12, schemaEnv: t10, schema: i9, errSchemaPath: n9, opts: r9 }) { + const o8 = i9.$comment; + if (true === r9.$comment) + e12.code(d7._`${f8.default.self}.logger.log(${o8})`); + else if ("function" == typeof r9.$comment) { + const i10 = d7.str`${n9}/$comment`, r10 = e12.scopeValue("root", { ref: t10.root }); + e12.code(d7._`${f8.default.self}.opts.$comment(${o8}, ${i10}, ${r10}.schema)`); + } + } + function x7(e12, t10, i9, n9) { + const { gen: r9, schema: a8, data: p8, allErrors: c8, opts: l8, self: m8 } = e12, { RULES: h9 } = m8; + function y8(u8) { + (0, o7.shouldUseGroup)(a8, u8) && (u8.type ? (r9.if((0, s7.checkDataType)(u8.type, p8, l8.strictNumbers)), _6(e12, u8), 1 === t10.length && t10[0] === u8.type && i9 && (r9.else(), (0, s7.reportTypeError)(e12)), r9.endIf()) : _6(e12, u8), c8 || r9.if(d7._`${f8.default.errors} === ${n9 || 0}`)); + } + !a8.$ref || !l8.ignoreKeywordsWithRef && (0, u7.schemaHasRulesButRef)(a8, h9) ? (l8.jtd || function(e13, t11) { + !e13.schemaEnv.meta && e13.opts.strictTypes && (function(e14, t12) { + t12.length && (e14.dataTypes.length ? (t12.forEach((t13) => { + w6(e14.dataTypes, t13) || S6(e14, `type "${t13}" not allowed by context "${e14.dataTypes.join(",")}"`); + }), function(e15, t13) { + const i10 = []; + for (const n10 of e15.dataTypes) + w6(t13, n10) ? i10.push(n10) : t13.includes("integer") && "number" === n10 && i10.push("integer"); + e15.dataTypes = i10; + }(e14, t12)) : e14.dataTypes = t12); + }(e13, t11), e13.opts.allowUnionTypes || function(e14, t12) { + t12.length > 1 && (2 !== t12.length || !t12.includes("null")) && S6(e14, "use allowUnionTypes to allow union type keyword"); + }(e13, t11), function(e14, t12) { + const i10 = e14.self.RULES.all; + for (const n10 in i10) { + const r10 = i10[n10]; + if ("object" == typeof r10 && (0, o7.shouldUseRule)(e14.schema, r10)) { + const { type: i11 } = r10.definition; + i11.length && !i11.some((e15) => { + return n11 = e15, (i12 = t12).includes(n11) || "number" === n11 && i12.includes("integer"); + var i12, n11; + }) && S6(e14, `missing type "${i11.join(",")}" for keyword "${n10}"`); + } + } + }(e13, e13.dataTypes)); + }(e12, t10), r9.block(() => { + for (const e13 of h9.rules) + y8(e13); + y8(h9.post); + })) : r9.block(() => O7(e12, "$ref", h9.all.$ref.definition)); + } + function _6(e12, t10) { + const { gen: i9, schema: n9, opts: { useDefaults: r9 } } = e12; + r9 && (0, a7.assignDefaults)(e12, t10.type), i9.block(() => { + for (const i10 of t10.rules) + (0, o7.shouldUseRule)(n9, i10) && O7(e12, i10.keyword, i10.definition, t10.type); + }); + } + function w6(e12, t10) { + return e12.includes(t10) || "integer" === t10 && e12.includes("number"); + } + function S6(e12, t10) { + t10 += ` at "${e12.schemaEnv.baseId + e12.errSchemaPath}" (strictTypes)`, (0, u7.checkStrictMode)(e12, t10, e12.opts.strictTypes); + } + t9.validateFunctionCode = function(e12) { + b8(e12) && (v8(e12), g7(e12)) ? function(e13) { + const { schema: t10, opts: i9, gen: n9 } = e13; + h8(e13, () => { + i9.$comment && t10.$comment && $5(e13), function(e14) { + const { schema: t11, opts: i10 } = e14; + void 0 !== t11.default && i10.useDefaults && i10.strictSchema && (0, u7.checkStrictMode)(e14, "default is ignored in the schema root"); + }(e13), n9.let(f8.default.vErrors, null), n9.let(f8.default.errors, 0), i9.unevaluated && function(e14) { + const { gen: t11, validateName: i10 } = e14; + e14.evaluated = t11.const("evaluated", d7._`${i10}.evaluated`), t11.if(d7._`${e14.evaluated}.dynamicProps`, () => t11.assign(d7._`${e14.evaluated}.props`, d7._`undefined`)), t11.if(d7._`${e14.evaluated}.dynamicItems`, () => t11.assign(d7._`${e14.evaluated}.items`, d7._`undefined`)); + }(e13), j6(e13), function(e14) { + const { gen: t11, schemaEnv: i10, validateName: n10, ValidationError: r9, opts: o8 } = e14; + i10.$async ? t11.if(d7._`${f8.default.errors} === 0`, () => t11.return(f8.default.data), () => t11.throw(d7._`new ${r9}(${f8.default.vErrors})`)) : (t11.assign(d7._`${n10}.errors`, f8.default.vErrors), o8.unevaluated && function({ gen: e15, evaluated: t12, props: i11, items: n11 }) { + i11 instanceof d7.Name && e15.assign(d7._`${t12}.props`, i11), n11 instanceof d7.Name && e15.assign(d7._`${t12}.items`, n11); + }(e14), t11.return(d7._`${f8.default.errors} === 0`)); + }(e13); + }); + }(e12) : h8(e12, () => (0, n8.topBoolOrEmptySchema)(e12)); + }; + class P6 { + constructor(e12, t10, i9) { + if ((0, p7.validateKeywordUsage)(e12, t10, i9), this.gen = e12.gen, this.allErrors = e12.allErrors, this.keyword = i9, this.data = e12.data, this.schema = e12.schema[i9], this.$data = t10.$data && e12.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, u7.schemaRefOrVal)(e12, this.schema, i9, this.$data), this.schemaType = t10.schemaType, this.parentSchema = e12.schema, this.params = {}, this.it = e12, this.def = t10, this.$data) + this.schemaCode = e12.gen.const("vSchema", I6(this.$data, e12)); + else if (this.schemaCode = this.schemaValue, !(0, p7.validSchemaType)(this.schema, t10.schemaType, t10.allowUndefined)) + throw new Error(`${i9} value must be ${JSON.stringify(t10.schemaType)}`); + ("code" in t10 ? t10.trackErrors : false !== t10.errors) && (this.errsCount = e12.gen.const("_errs", f8.default.errors)); + } + result(e12, t10, i9) { + this.failResult((0, d7.not)(e12), t10, i9); + } + failResult(e12, t10, i9) { + this.gen.if(e12), i9 ? i9() : this.error(), t10 ? (this.gen.else(), t10(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else(); + } + pass(e12, t10) { + this.failResult((0, d7.not)(e12), void 0, t10); + } + fail(e12) { + if (void 0 === e12) + return this.error(), void (this.allErrors || this.gen.if(false)); + this.gen.if(e12), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else(); + } + fail$data(e12) { + if (!this.$data) + return this.fail(e12); + const { schemaCode: t10 } = this; + this.fail(d7._`${t10} !== undefined && (${(0, d7.or)(this.invalid$data(), e12)})`); + } + error(e12, t10, i9) { + if (t10) + return this.setParams(t10), this._error(e12, i9), void this.setParams({}); + this._error(e12, i9); + } + _error(e12, t10) { + (e12 ? m7.reportExtraError : m7.reportError)(this, this.def.error, t10); + } + $dataError() { + (0, m7.reportError)(this, this.def.$dataError || m7.keyword$DataError); + } + reset() { + if (void 0 === this.errsCount) + throw new Error('add "trackErrors" to keyword definition'); + (0, m7.resetErrorsCount)(this.gen, this.errsCount); + } + ok(e12) { + this.allErrors || this.gen.if(e12); + } + setParams(e12, t10) { + t10 ? Object.assign(this.params, e12) : this.params = e12; + } + block$data(e12, t10, i9 = d7.nil) { + this.gen.block(() => { + this.check$data(e12, i9), t10(); + }); + } + check$data(e12 = d7.nil, t10 = d7.nil) { + if (!this.$data) + return; + const { gen: i9, schemaCode: n9, schemaType: r9, def: o8 } = this; + i9.if((0, d7.or)(d7._`${n9} === undefined`, t10)), e12 !== d7.nil && i9.assign(e12, true), (r9.length || o8.validateSchema) && (i9.elseIf(this.invalid$data()), this.$dataError(), e12 !== d7.nil && i9.assign(e12, false)), i9.else(); + } + invalid$data() { + const { gen: e12, schemaCode: t10, schemaType: i9, def: n9, it: r9 } = this; + return (0, d7.or)(function() { + if (i9.length) { + if (!(t10 instanceof d7.Name)) + throw new Error("ajv implementation error"); + const e13 = Array.isArray(i9) ? i9 : [i9]; + return d7._`${(0, s7.checkDataTypes)(e13, t10, r9.opts.strictNumbers, s7.DataType.Wrong)}`; + } + return d7.nil; + }(), function() { + if (n9.validateSchema) { + const i10 = e12.scopeValue("validate$data", { ref: n9.validateSchema }); + return d7._`!${i10}(${t10})`; + } + return d7.nil; + }()); + } + subschema(e12, t10) { + const i9 = (0, c7.getSubschema)(this.it, e12); + (0, c7.extendSubschemaData)(i9, this.it, e12), (0, c7.extendSubschemaMode)(i9, e12); + const r9 = { ...this.it, ...i9, items: void 0, props: void 0 }; + return function(e13, t11) { + b8(e13) && (v8(e13), g7(e13)) ? function(e14, t12) { + const { schema: i10, gen: n9, opts: r10 } = e14; + r10.$comment && i10.$comment && $5(e14), function(e15) { + const t13 = e15.schema[e15.opts.schemaId]; + t13 && (e15.baseId = (0, l7.resolveUrl)(e15.opts.uriResolver, e15.baseId, t13)); + }(e14), function(e15) { + if (e15.schema.$async && !e15.schemaEnv.$async) + throw new Error("async schema in sync schema"); + }(e14); + const o8 = n9.const("_errs", f8.default.errors); + j6(e14, o8), n9.var(t12, d7._`${o8} === ${f8.default.errors}`); + }(e13, t11) : (0, n8.boolOrEmptySchema)(e13, t11); + }(r9, t10), r9; + } + mergeEvaluated(e12, t10) { + const { it: i9, gen: n9 } = this; + i9.opts.unevaluated && (true !== i9.props && void 0 !== e12.props && (i9.props = u7.mergeEvaluated.props(n9, e12.props, i9.props, t10)), true !== i9.items && void 0 !== e12.items && (i9.items = u7.mergeEvaluated.items(n9, e12.items, i9.items, t10))); + } + mergeValidEvaluated(e12, t10) { + const { it: i9, gen: n9 } = this; + if (i9.opts.unevaluated && (true !== i9.props || true !== i9.items)) + return n9.if(t10, () => this.mergeEvaluated(e12, d7.Name)), true; + } + } + function O7(e12, t10, i9, n9) { + const r9 = new P6(e12, i9, t10); + "code" in i9 ? i9.code(r9, n9) : r9.$data && i9.validate ? (0, p7.funcKeywordCode)(r9, i9) : "macro" in i9 ? (0, p7.macroKeywordCode)(r9, i9) : (i9.compile || i9.validate) && (0, p7.funcKeywordCode)(r9, i9); + } + t9.KeywordCxt = P6; + const T6 = /^\/(?:[^~]|~0|~1)*$/, A6 = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; + function I6(e12, { dataLevel: t10, dataNames: i9, dataPathArr: n9 }) { + let r9, o8; + if ("" === e12) + return f8.default.rootData; + if ("/" === e12[0]) { + if (!T6.test(e12)) + throw new Error(`Invalid JSON-pointer: ${e12}`); + r9 = e12, o8 = f8.default.rootData; + } else { + const s9 = A6.exec(e12); + if (!s9) + throw new Error(`Invalid JSON-pointer: ${e12}`); + const a9 = +s9[1]; + if (r9 = s9[2], "#" === r9) { + if (a9 >= t10) + throw new Error(p8("property/index", a9)); + return n9[t10 - a9]; + } + if (a9 > t10) + throw new Error(p8("data", a9)); + if (o8 = i9[t10 - a9], !r9) + return o8; + } + let s8 = o8; + const a8 = r9.split("/"); + for (const e13 of a8) + e13 && (o8 = d7._`${o8}${(0, d7.getProperty)((0, u7.unescapeJsonPointer)(e13))}`, s8 = d7._`${s8} && ${o8}`); + return s8; + function p8(e13, i10) { + return `Cannot access ${e13} ${i10} levels up, current level is ${t10}`; + } + } + t9.getData = I6; + }, 49348: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateKeywordUsage = t9.validSchemaType = t9.funcKeywordCode = t9.macroKeywordCode = void 0; + const n8 = i8(17898), r8 = i8(63036), o7 = i8(94450), s7 = i8(49409); + function a7(e12) { + const { gen: t10, data: i9, it: r9 } = e12; + t10.if(r9.parentData, () => t10.assign(i9, n8._`${r9.parentData}[${r9.parentDataProperty}]`)); + } + function p7(e12, t10, i9) { + if (void 0 === i9) + throw new Error(`keyword "${t10}" failed to compile`); + return e12.scopeValue("keyword", "function" == typeof i9 ? { ref: i9 } : { ref: i9, code: (0, n8.stringify)(i9) }); + } + t9.macroKeywordCode = function(e12, t10) { + const { gen: i9, keyword: r9, schema: o8, parentSchema: s8, it: a8 } = e12, c7 = t10.macro.call(a8.self, o8, s8, a8), d7 = p7(i9, r9, c7); + false !== a8.opts.validateSchema && a8.self.validateSchema(c7, true); + const f8 = i9.name("valid"); + e12.subschema({ schema: c7, schemaPath: n8.nil, errSchemaPath: `${a8.errSchemaPath}/${r9}`, topSchemaRef: d7, compositeRule: true }, f8), e12.pass(f8, () => e12.error(true)); + }, t9.funcKeywordCode = function(e12, t10) { + var i9; + const { gen: c7, keyword: d7, schema: f8, parentSchema: l7, $data: u7, it: m7 } = e12; + !function({ schemaEnv: e13 }, t11) { + if (t11.async && !e13.$async) + throw new Error("async keyword in sync schema"); + }(m7, t10); + const h8 = !u7 && t10.compile ? t10.compile.call(m7.self, f8, l7, m7) : t10.validate, y7 = p7(c7, d7, h8), g7 = c7.let("valid"); + function b8(i10 = t10.async ? n8._`await ` : n8.nil) { + const s8 = m7.opts.passContext ? r8.default.this : r8.default.self, a8 = !("compile" in t10 && !u7 || false === t10.schema); + c7.assign(g7, n8._`${i10}${(0, o7.callValidateCode)(e12, y7, s8, a8)}`, t10.modifying); + } + function v8(e13) { + var i10; + c7.if((0, n8.not)(null !== (i10 = t10.valid) && void 0 !== i10 ? i10 : g7), e13); + } + e12.block$data(g7, function() { + if (false === t10.errors) + b8(), t10.modifying && a7(e12), v8(() => e12.error()); + else { + const i10 = t10.async ? function() { + const e13 = c7.let("ruleErrs", null); + return c7.try(() => b8(n8._`await `), (t11) => c7.assign(g7, false).if(n8._`${t11} instanceof ${m7.ValidationError}`, () => c7.assign(e13, n8._`${t11}.errors`), () => c7.throw(t11))), e13; + }() : function() { + const e13 = n8._`${y7}.errors`; + return c7.assign(e13, null), b8(n8.nil), e13; + }(); + t10.modifying && a7(e12), v8(() => function(e13, t11) { + const { gen: i11 } = e13; + i11.if(n8._`Array.isArray(${t11})`, () => { + i11.assign(r8.default.vErrors, n8._`${r8.default.vErrors} === null ? ${t11} : ${r8.default.vErrors}.concat(${t11})`).assign(r8.default.errors, n8._`${r8.default.vErrors}.length`), (0, s7.extendErrors)(e13); + }, () => e13.error()); + }(e12, i10)); + } + }), e12.ok(null !== (i9 = t10.valid) && void 0 !== i9 ? i9 : g7); + }, t9.validSchemaType = function(e12, t10, i9 = false) { + return !t10.length || t10.some((t11) => "array" === t11 ? Array.isArray(e12) : "object" === t11 ? e12 && "object" == typeof e12 && !Array.isArray(e12) : typeof e12 == t11 || i9 && void 0 === e12); + }, t9.validateKeywordUsage = function({ schema: e12, opts: t10, self: i9, errSchemaPath: n9 }, r9, o8) { + if (Array.isArray(r9.keyword) ? !r9.keyword.includes(o8) : r9.keyword !== o8) + throw new Error("ajv implementation error"); + const s8 = r9.dependencies; + if (null == s8 ? void 0 : s8.some((t11) => !Object.prototype.hasOwnProperty.call(e12, t11))) + throw new Error(`parent schema must have dependencies of ${o8}: ${s8.join(",")}`); + if (r9.validateSchema && !r9.validateSchema(e12[o8])) { + const e13 = `keyword "${o8}" value is invalid at path "${n9}": ` + i9.errorsText(r9.validateSchema.errors); + if ("log" !== t10.validateSchema) + throw new Error(e13); + i9.logger.error(e13); + } + }; + }, 53322: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.extendSubschemaMode = t9.extendSubschemaData = t9.getSubschema = void 0; + const n8 = i8(17898), r8 = i8(50458); + t9.getSubschema = function(e12, { keyword: t10, schemaProp: i9, schema: o7, schemaPath: s7, errSchemaPath: a7, topSchemaRef: p7 }) { + if (void 0 !== t10 && void 0 !== o7) + throw new Error('both "keyword" and "schema" passed, only one allowed'); + if (void 0 !== t10) { + const o8 = e12.schema[t10]; + return void 0 === i9 ? { schema: o8, schemaPath: n8._`${e12.schemaPath}${(0, n8.getProperty)(t10)}`, errSchemaPath: `${e12.errSchemaPath}/${t10}` } : { schema: o8[i9], schemaPath: n8._`${e12.schemaPath}${(0, n8.getProperty)(t10)}${(0, n8.getProperty)(i9)}`, errSchemaPath: `${e12.errSchemaPath}/${t10}/${(0, r8.escapeFragment)(i9)}` }; + } + if (void 0 !== o7) { + if (void 0 === s7 || void 0 === a7 || void 0 === p7) + throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); + return { schema: o7, schemaPath: s7, topSchemaRef: p7, errSchemaPath: a7 }; + } + throw new Error('either "keyword" or "schema" must be passed'); + }, t9.extendSubschemaData = function(e12, t10, { dataProp: i9, dataPropType: o7, data: s7, dataTypes: a7, propertyName: p7 }) { + if (void 0 !== s7 && void 0 !== i9) + throw new Error('both "data" and "dataProp" passed, only one allowed'); + const { gen: c7 } = t10; + if (void 0 !== i9) { + const { errorPath: s8, dataPathArr: a8, opts: p8 } = t10; + d7(c7.let("data", n8._`${t10.data}${(0, n8.getProperty)(i9)}`, true)), e12.errorPath = n8.str`${s8}${(0, r8.getErrorPath)(i9, o7, p8.jsPropertySyntax)}`, e12.parentDataProperty = n8._`${i9}`, e12.dataPathArr = [...a8, e12.parentDataProperty]; + } + function d7(i10) { + e12.data = i10, e12.dataLevel = t10.dataLevel + 1, e12.dataTypes = [], t10.definedProperties = /* @__PURE__ */ new Set(), e12.parentData = t10.data, e12.dataNames = [...t10.dataNames, i10]; + } + void 0 !== s7 && (d7(s7 instanceof n8.Name ? s7 : c7.let("data", s7, true)), void 0 !== p7 && (e12.propertyName = p7)), a7 && (e12.dataTypes = a7); + }, t9.extendSubschemaMode = function(e12, { jtdDiscriminator: t10, jtdMetadata: i9, compositeRule: n9, createErrors: r9, allErrors: o7 }) { + void 0 !== n9 && (e12.compositeRule = n9), void 0 !== r9 && (e12.createErrors = r9), void 0 !== o7 && (e12.allErrors = o7), e12.jtdDiscriminator = t10, e12.jtdMetadata = i9; + }; + }, 65319: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.CodeGen = t9.Name = t9.nil = t9.stringify = t9.str = t9._ = t9.KeywordCxt = void 0; + var n8 = i8(96223); + Object.defineProperty(t9, "KeywordCxt", { enumerable: true, get: function() { + return n8.KeywordCxt; + } }); + var r8 = i8(17898); + Object.defineProperty(t9, "_", { enumerable: true, get: function() { + return r8._; + } }), Object.defineProperty(t9, "str", { enumerable: true, get: function() { + return r8.str; + } }), Object.defineProperty(t9, "stringify", { enumerable: true, get: function() { + return r8.stringify; + } }), Object.defineProperty(t9, "nil", { enumerable: true, get: function() { + return r8.nil; + } }), Object.defineProperty(t9, "Name", { enumerable: true, get: function() { + return r8.Name; + } }), Object.defineProperty(t9, "CodeGen", { enumerable: true, get: function() { + return r8.CodeGen; + } }); + const o7 = i8(95031), s7 = i8(85748), a7 = i8(90383), p7 = i8(49392), c7 = i8(17898), d7 = i8(14856), f8 = i8(69003), l7 = i8(50458), u7 = i8(93770), m7 = i8(7903), h8 = (e12, t10) => new RegExp(e12, t10); + h8.code = "new RegExp"; + const y7 = ["removeAdditional", "useDefaults", "coerceTypes"], g7 = /* @__PURE__ */ new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]), b8 = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }, v8 = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }; + function j6(e12) { + var t10, i9, n9, r9, o8, s8, a8, p8, c8, d8, f9, l8, u8, y8, g8, b9, v9, j7, $6, x8, _7, w7, S7, P7, O8; + const T7 = e12.strict, A7 = null === (t10 = e12.code) || void 0 === t10 ? void 0 : t10.optimize, I7 = true === A7 || void 0 === A7 ? 1 : A7 || 0, E7 = null !== (n9 = null === (i9 = e12.code) || void 0 === i9 ? void 0 : i9.regExp) && void 0 !== n9 ? n9 : h8, q6 = null !== (r9 = e12.uriResolver) && void 0 !== r9 ? r9 : m7.default; + return { strictSchema: null === (s8 = null !== (o8 = e12.strictSchema) && void 0 !== o8 ? o8 : T7) || void 0 === s8 || s8, strictNumbers: null === (p8 = null !== (a8 = e12.strictNumbers) && void 0 !== a8 ? a8 : T7) || void 0 === p8 || p8, strictTypes: null !== (d8 = null !== (c8 = e12.strictTypes) && void 0 !== c8 ? c8 : T7) && void 0 !== d8 ? d8 : "log", strictTuples: null !== (l8 = null !== (f9 = e12.strictTuples) && void 0 !== f9 ? f9 : T7) && void 0 !== l8 ? l8 : "log", strictRequired: null !== (y8 = null !== (u8 = e12.strictRequired) && void 0 !== u8 ? u8 : T7) && void 0 !== y8 && y8, code: e12.code ? { ...e12.code, optimize: I7, regExp: E7 } : { optimize: I7, regExp: E7 }, loopRequired: null !== (g8 = e12.loopRequired) && void 0 !== g8 ? g8 : 200, loopEnum: null !== (b9 = e12.loopEnum) && void 0 !== b9 ? b9 : 200, meta: null === (v9 = e12.meta) || void 0 === v9 || v9, messages: null === (j7 = e12.messages) || void 0 === j7 || j7, inlineRefs: null === ($6 = e12.inlineRefs) || void 0 === $6 || $6, schemaId: null !== (x8 = e12.schemaId) && void 0 !== x8 ? x8 : "$id", addUsedSchema: null === (_7 = e12.addUsedSchema) || void 0 === _7 || _7, validateSchema: null === (w7 = e12.validateSchema) || void 0 === w7 || w7, validateFormats: null === (S7 = e12.validateFormats) || void 0 === S7 || S7, unicodeRegExp: null === (P7 = e12.unicodeRegExp) || void 0 === P7 || P7, int32range: null === (O8 = e12.int32range) || void 0 === O8 || O8, uriResolver: q6 }; + } + class $5 { + constructor(e12 = {}) { + this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), e12 = this.opts = { ...e12, ...j6(e12) }; + const { es5: t10, lines: i9 } = this.opts.code; + this.scope = new c7.ValueScope({ scope: {}, prefixes: g7, es5: t10, lines: i9 }), this.logger = function(e13) { + if (false === e13) + return T6; + if (void 0 === e13) + return console; + if (e13.log && e13.warn && e13.error) + return e13; + throw new Error("logger must implement log, warn and error methods"); + }(e12.logger); + const n9 = e12.validateFormats; + e12.validateFormats = false, this.RULES = (0, a7.getRules)(), x7.call(this, b8, e12, "NOT SUPPORTED"), x7.call(this, v8, e12, "DEPRECATED", "warn"), this._metaOpts = O7.call(this), e12.formats && S6.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), e12.keywords && P6.call(this, e12.keywords), "object" == typeof e12.meta && this.addMetaSchema(e12.meta), w6.call(this), e12.validateFormats = n9; + } + _addVocabularies() { + this.addKeyword("$async"); + } + _addDefaultMetaSchema() { + const { $data: e12, meta: t10, schemaId: i9 } = this.opts; + let n9 = u7; + "id" === i9 && (n9 = { ...u7 }, n9.id = n9.$id, delete n9.$id), t10 && e12 && this.addMetaSchema(n9, n9[i9], false); + } + defaultMeta() { + const { meta: e12, schemaId: t10 } = this.opts; + return this.opts.defaultMeta = "object" == typeof e12 ? e12[t10] || e12 : void 0; + } + validate(e12, t10) { + let i9; + if ("string" == typeof e12) { + if (i9 = this.getSchema(e12), !i9) + throw new Error(`no schema with key or ref "${e12}"`); + } else + i9 = this.compile(e12); + const n9 = i9(t10); + return "$async" in i9 || (this.errors = i9.errors), n9; + } + compile(e12, t10) { + const i9 = this._addSchema(e12, t10); + return i9.validate || this._compileSchemaEnv(i9); + } + compileAsync(e12, t10) { + if ("function" != typeof this.opts.loadSchema) + throw new Error("options.loadSchema should be a function"); + const { loadSchema: i9 } = this.opts; + return n9.call(this, e12, t10); + async function n9(e13, t11) { + await r9.call(this, e13.$schema); + const i10 = this._addSchema(e13, t11); + return i10.validate || o8.call(this, i10); + } + async function r9(e13) { + e13 && !this.getSchema(e13) && await n9.call(this, { $ref: e13 }, true); + } + async function o8(e13) { + try { + return this._compileSchemaEnv(e13); + } catch (t11) { + if (!(t11 instanceof s7.default)) + throw t11; + return a8.call(this, t11), await p8.call(this, t11.missingSchema), o8.call(this, e13); + } + } + function a8({ missingSchema: e13, missingRef: t11 }) { + if (this.refs[e13]) + throw new Error(`AnySchema ${e13} is loaded but ${t11} cannot be resolved`); + } + async function p8(e13) { + const i10 = await c8.call(this, e13); + this.refs[e13] || await r9.call(this, i10.$schema), this.refs[e13] || this.addSchema(i10, e13, t10); + } + async function c8(e13) { + const t11 = this._loading[e13]; + if (t11) + return t11; + try { + return await (this._loading[e13] = i9(e13)); + } finally { + delete this._loading[e13]; + } + } + } + addSchema(e12, t10, i9, n9 = this.opts.validateSchema) { + if (Array.isArray(e12)) { + for (const t11 of e12) + this.addSchema(t11, void 0, i9, n9); + return this; + } + let r9; + if ("object" == typeof e12) { + const { schemaId: t11 } = this.opts; + if (r9 = e12[t11], void 0 !== r9 && "string" != typeof r9) + throw new Error(`schema ${t11} must be string`); + } + return t10 = (0, d7.normalizeId)(t10 || r9), this._checkUnique(t10), this.schemas[t10] = this._addSchema(e12, i9, t10, n9, true), this; + } + addMetaSchema(e12, t10, i9 = this.opts.validateSchema) { + return this.addSchema(e12, t10, true, i9), this; + } + validateSchema(e12, t10) { + if ("boolean" == typeof e12) + return true; + let i9; + if (i9 = e12.$schema, void 0 !== i9 && "string" != typeof i9) + throw new Error("$schema must be a string"); + if (i9 = i9 || this.opts.defaultMeta || this.defaultMeta(), !i9) + return this.logger.warn("meta-schema not available"), this.errors = null, true; + const n9 = this.validate(i9, e12); + if (!n9 && t10) { + const e13 = "schema is invalid: " + this.errorsText(); + if ("log" !== this.opts.validateSchema) + throw new Error(e13); + this.logger.error(e13); + } + return n9; + } + getSchema(e12) { + let t10; + for (; "string" == typeof (t10 = _6.call(this, e12)); ) + e12 = t10; + if (void 0 === t10) { + const { schemaId: i9 } = this.opts, n9 = new p7.SchemaEnv({ schema: {}, schemaId: i9 }); + if (t10 = p7.resolveSchema.call(this, n9, e12), !t10) + return; + this.refs[e12] = t10; + } + return t10.validate || this._compileSchemaEnv(t10); + } + removeSchema(e12) { + if (e12 instanceof RegExp) + return this._removeAllSchemas(this.schemas, e12), this._removeAllSchemas(this.refs, e12), this; + switch (typeof e12) { + case "undefined": + return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this; + case "string": { + const t10 = _6.call(this, e12); + return "object" == typeof t10 && this._cache.delete(t10.schema), delete this.schemas[e12], delete this.refs[e12], this; + } + case "object": { + const t10 = e12; + this._cache.delete(t10); + let i9 = e12[this.opts.schemaId]; + return i9 && (i9 = (0, d7.normalizeId)(i9), delete this.schemas[i9], delete this.refs[i9]), this; + } + default: + throw new Error("ajv.removeSchema: invalid parameter"); + } + } + addVocabulary(e12) { + for (const t10 of e12) + this.addKeyword(t10); + return this; + } + addKeyword(e12, t10) { + let i9; + if ("string" == typeof e12) + i9 = e12, "object" == typeof t10 && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t10.keyword = i9); + else { + if ("object" != typeof e12 || void 0 !== t10) + throw new Error("invalid addKeywords parameters"); + if (i9 = (t10 = e12).keyword, Array.isArray(i9) && !i9.length) + throw new Error("addKeywords: keyword must be string or non-empty array"); + } + if (I6.call(this, i9, t10), !t10) + return (0, l7.eachItem)(i9, (e13) => E6.call(this, e13)), this; + k6.call(this, t10); + const n9 = { ...t10, type: (0, f8.getJSONTypes)(t10.type), schemaType: (0, f8.getJSONTypes)(t10.schemaType) }; + return (0, l7.eachItem)(i9, 0 === n9.type.length ? (e13) => E6.call(this, e13, n9) : (e13) => n9.type.forEach((t11) => E6.call(this, e13, n9, t11))), this; + } + getKeyword(e12) { + const t10 = this.RULES.all[e12]; + return "object" == typeof t10 ? t10.definition : !!t10; + } + removeKeyword(e12) { + const { RULES: t10 } = this; + delete t10.keywords[e12], delete t10.all[e12]; + for (const i9 of t10.rules) { + const t11 = i9.rules.findIndex((t12) => t12.keyword === e12); + t11 >= 0 && i9.rules.splice(t11, 1); + } + return this; + } + addFormat(e12, t10) { + return "string" == typeof t10 && (t10 = new RegExp(t10)), this.formats[e12] = t10, this; + } + errorsText(e12 = this.errors, { separator: t10 = ", ", dataVar: i9 = "data" } = {}) { + return e12 && 0 !== e12.length ? e12.map((e13) => `${i9}${e13.instancePath} ${e13.message}`).reduce((e13, i10) => e13 + t10 + i10) : "No errors"; + } + $dataMetaSchema(e12, t10) { + const i9 = this.RULES.all; + e12 = JSON.parse(JSON.stringify(e12)); + for (const n9 of t10) { + const t11 = n9.split("/").slice(1); + let r9 = e12; + for (const e13 of t11) + r9 = r9[e13]; + for (const e13 in i9) { + const t12 = i9[e13]; + if ("object" != typeof t12) + continue; + const { $data: n10 } = t12.definition, o8 = r9[e13]; + n10 && o8 && (r9[e13] = R6(o8)); + } + } + return e12; + } + _removeAllSchemas(e12, t10) { + for (const i9 in e12) { + const n9 = e12[i9]; + t10 && !t10.test(i9) || ("string" == typeof n9 ? delete e12[i9] : n9 && !n9.meta && (this._cache.delete(n9.schema), delete e12[i9])); + } + } + _addSchema(e12, t10, i9, n9 = this.opts.validateSchema, r9 = this.opts.addUsedSchema) { + let o8; + const { schemaId: s8 } = this.opts; + if ("object" == typeof e12) + o8 = e12[s8]; + else { + if (this.opts.jtd) + throw new Error("schema must be object"); + if ("boolean" != typeof e12) + throw new Error("schema must be object or boolean"); + } + let a8 = this._cache.get(e12); + if (void 0 !== a8) + return a8; + i9 = (0, d7.normalizeId)(o8 || i9); + const c8 = d7.getSchemaRefs.call(this, e12, i9); + return a8 = new p7.SchemaEnv({ schema: e12, schemaId: s8, meta: t10, baseId: i9, localRefs: c8 }), this._cache.set(a8.schema, a8), r9 && !i9.startsWith("#") && (i9 && this._checkUnique(i9), this.refs[i9] = a8), n9 && this.validateSchema(e12, true), a8; + } + _checkUnique(e12) { + if (this.schemas[e12] || this.refs[e12]) + throw new Error(`schema with key or id "${e12}" already exists`); + } + _compileSchemaEnv(e12) { + if (e12.meta ? this._compileMetaSchema(e12) : p7.compileSchema.call(this, e12), !e12.validate) + throw new Error("ajv implementation error"); + return e12.validate; + } + _compileMetaSchema(e12) { + const t10 = this.opts; + this.opts = this._metaOpts; + try { + p7.compileSchema.call(this, e12); + } finally { + this.opts = t10; + } + } + } + function x7(e12, t10, i9, n9 = "error") { + for (const r9 in e12) { + const o8 = r9; + o8 in t10 && this.logger[n9](`${i9}: option ${r9}. ${e12[o8]}`); + } + } + function _6(e12) { + return e12 = (0, d7.normalizeId)(e12), this.schemas[e12] || this.refs[e12]; + } + function w6() { + const e12 = this.opts.schemas; + if (e12) + if (Array.isArray(e12)) + this.addSchema(e12); + else + for (const t10 in e12) + this.addSchema(e12[t10], t10); + } + function S6() { + for (const e12 in this.opts.formats) { + const t10 = this.opts.formats[e12]; + t10 && this.addFormat(e12, t10); + } + } + function P6(e12) { + if (Array.isArray(e12)) + this.addVocabulary(e12); + else { + this.logger.warn("keywords option as map is deprecated, pass array"); + for (const t10 in e12) { + const i9 = e12[t10]; + i9.keyword || (i9.keyword = t10), this.addKeyword(i9); + } + } + } + function O7() { + const e12 = { ...this.opts }; + for (const t10 of y7) + delete e12[t10]; + return e12; + } + $5.ValidationError = o7.default, $5.MissingRefError = s7.default, t9.default = $5; + const T6 = { log() { + }, warn() { + }, error() { + } }, A6 = /^[a-z_$][a-z0-9_$:-]*$/i; + function I6(e12, t10) { + const { RULES: i9 } = this; + if ((0, l7.eachItem)(e12, (e13) => { + if (i9.keywords[e13]) + throw new Error(`Keyword ${e13} is already defined`); + if (!A6.test(e13)) + throw new Error(`Keyword ${e13} has invalid name`); + }), t10 && t10.$data && !("code" in t10) && !("validate" in t10)) + throw new Error('$data keyword must have "code" or "validate" function'); + } + function E6(e12, t10, i9) { + var n9; + const r9 = null == t10 ? void 0 : t10.post; + if (i9 && r9) + throw new Error('keyword with "post" flag cannot have "type"'); + const { RULES: o8 } = this; + let s8 = r9 ? o8.post : o8.rules.find(({ type: e13 }) => e13 === i9); + if (s8 || (s8 = { type: i9, rules: [] }, o8.rules.push(s8)), o8.keywords[e12] = true, !t10) + return; + const a8 = { keyword: e12, definition: { ...t10, type: (0, f8.getJSONTypes)(t10.type), schemaType: (0, f8.getJSONTypes)(t10.schemaType) } }; + t10.before ? q5.call(this, s8, a8, t10.before) : s8.rules.push(a8), o8.all[e12] = a8, null === (n9 = t10.implements) || void 0 === n9 || n9.forEach((e13) => this.addKeyword(e13)); + } + function q5(e12, t10, i9) { + const n9 = e12.rules.findIndex((e13) => e13.keyword === i9); + n9 >= 0 ? e12.rules.splice(n9, 0, t10) : (e12.rules.push(t10), this.logger.warn(`rule ${i9} is not defined`)); + } + function k6(e12) { + let { metaSchema: t10 } = e12; + void 0 !== t10 && (e12.$data && this.opts.$data && (t10 = R6(t10)), e12.validateSchema = this.compile(t10, true)); + } + const M6 = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }; + function R6(e12) { + return { anyOf: [e12, M6] }; + } + }, 92905: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(19065), r8 = i8(32289), o7 = i8(14513), s7 = i8(56703), a7 = i8(18699), p7 = i8(42992), c7 = i8(81275), d7 = ["/properties"]; + t9.default = function(e12) { + return [n8, r8, o7, s7, t10(this, a7), p7, t10(this, c7)].forEach((e13) => this.addMetaSchema(e13, void 0, false)), this; + function t10(t11, i9) { + return e12 ? t11.$dataMetaSchema(i9, d7) : i9; + } + }; + }, 43685: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(46261), r8 = i8(90013), o7 = i8(47388), s7 = i8(60013), a7 = i8(64771), p7 = i8(9567), c7 = i8(68364), d7 = i8(42943), f8 = ["/properties"]; + t9.default = function(e12) { + return [n8, r8, o7, s7, a7, t10(this, p7), c7, t10(this, d7)].forEach((e13) => this.addMetaSchema(e13, void 0, false)), this; + function t10(t11, i9) { + return e12 ? t11.$dataMetaSchema(i9, f8) : i9; + } + }; + }, 72725: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(38792); + n8.code = 'require("ajv/dist/runtime/equal").default', t9.default = n8; + }, 26308: (e11, t9) => { + "use strict"; + function i8(e12) { + const t10 = e12.length; + let i9, n8 = 0, r8 = 0; + for (; r8 < t10; ) + n8++, i9 = e12.charCodeAt(r8++), i9 >= 55296 && i9 <= 56319 && r8 < t10 && (i9 = e12.charCodeAt(r8), 56320 == (64512 & i9) && r8++); + return n8; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.default = i8, i8.code = 'require("ajv/dist/runtime/ucs2length").default'; + }, 7903: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(84800); + n8.code = 'require("ajv/dist/runtime/uri").default', t9.default = n8; + }, 95031: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + class i8 extends Error { + constructor(e12) { + super("validation failed"), this.errors = e12, this.ajv = this.validation = true; + } + } + t9.default = i8; + }, 93426: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateAdditionalItems = void 0; + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error: { message: ({ params: { len: e12 } }) => n8.str`must NOT have more than ${e12} items`, params: ({ params: { len: e12 } }) => n8._`{limit: ${e12}}` }, code(e12) { + const { parentSchema: t10, it: i9 } = e12, { items: n9 } = t10; + Array.isArray(n9) ? s7(e12, n9) : (0, r8.checkStrictMode)(i9, '"additionalItems" is ignored when "items" is not an array of schemas'); + } }; + function s7(e12, t10) { + const { gen: i9, schema: o8, data: s8, keyword: a7, it: p7 } = e12; + p7.items = true; + const c7 = i9.const("len", n8._`${s8}.length`); + if (false === o8) + e12.setParams({ len: t10.length }), e12.pass(n8._`${c7} <= ${t10.length}`); + else if ("object" == typeof o8 && !(0, r8.alwaysValidSchema)(p7, o8)) { + const o9 = i9.var("valid", n8._`${c7} <= ${t10.length}`); + i9.if((0, n8.not)(o9), () => function(o10) { + i9.forRange("i", t10.length, c7, (t11) => { + e12.subschema({ keyword: a7, dataProp: t11, dataPropType: r8.Type.Num }, o10), p7.allErrors || i9.if((0, n8.not)(o10), () => i9.break()); + }); + }(o9)), e12.ok(o9); + } + } + t9.validateAdditionalItems = s7, t9.default = o7; + }, 92697: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(94450), r8 = i8(17898), o7 = i8(63036), s7 = i8(50458), a7 = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, error: { message: "must NOT have additional properties", params: ({ params: e12 }) => r8._`{additionalProperty: ${e12.additionalProperty}}` }, code(e12) { + const { gen: t10, schema: i9, parentSchema: a8, data: p7, errsCount: c7, it: d7 } = e12; + if (!c7) + throw new Error("ajv implementation error"); + const { allErrors: f8, opts: l7 } = d7; + if (d7.props = true, "all" !== l7.removeAdditional && (0, s7.alwaysValidSchema)(d7, i9)) + return; + const u7 = (0, n8.allSchemaProperties)(a8.properties), m7 = (0, n8.allSchemaProperties)(a8.patternProperties); + function h8(e13) { + t10.code(r8._`delete ${p7}[${e13}]`); + } + function y7(n9) { + if ("all" === l7.removeAdditional || l7.removeAdditional && false === i9) + h8(n9); + else { + if (false === i9) + return e12.setParams({ additionalProperty: n9 }), e12.error(), void (f8 || t10.break()); + if ("object" == typeof i9 && !(0, s7.alwaysValidSchema)(d7, i9)) { + const i10 = t10.name("valid"); + "failing" === l7.removeAdditional ? (g7(n9, i10, false), t10.if((0, r8.not)(i10), () => { + e12.reset(), h8(n9); + })) : (g7(n9, i10), f8 || t10.if((0, r8.not)(i10), () => t10.break())); + } + } + } + function g7(t11, i10, n9) { + const r9 = { keyword: "additionalProperties", dataProp: t11, dataPropType: s7.Type.Str }; + false === n9 && Object.assign(r9, { compositeRule: true, createErrors: false, allErrors: false }), e12.subschema(r9, i10); + } + t10.forIn("key", p7, (i10) => { + u7.length || m7.length ? t10.if(function(i11) { + let o8; + if (u7.length > 8) { + const e13 = (0, s7.schemaRefOrVal)(d7, a8.properties, "properties"); + o8 = (0, n8.isOwnProperty)(t10, e13, i11); + } else + o8 = u7.length ? (0, r8.or)(...u7.map((e13) => r8._`${i11} === ${e13}`)) : r8.nil; + return m7.length && (o8 = (0, r8.or)(o8, ...m7.map((t11) => r8._`${(0, n8.usePattern)(e12, t11)}.test(${i11})`))), (0, r8.not)(o8); + }(i10), () => y7(i10)) : y7(i10); + }), e12.ok(r8._`${c7} === ${o7.default.errors}`); + } }; + t9.default = a7; + }, 79355: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(50458), r8 = { keyword: "allOf", schemaType: "array", code(e12) { + const { gen: t10, schema: i9, it: r9 } = e12; + if (!Array.isArray(i9)) + throw new Error("ajv implementation error"); + const o7 = t10.name("valid"); + i9.forEach((t11, i10) => { + if ((0, n8.alwaysValidSchema)(r9, t11)) + return; + const s7 = e12.subschema({ keyword: "allOf", schemaProp: i10 }, o7); + e12.ok(o7), e12.mergeEvaluated(s7); + }); + } }; + t9.default = r8; + }, 19430: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = { keyword: "anyOf", schemaType: "array", trackErrors: true, code: i8(94450).validateUnion, error: { message: "must match a schema in anyOf" } }; + t9.default = n8; + }, 35724: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, error: { message: ({ params: { min: e12, max: t10 } }) => void 0 === t10 ? n8.str`must contain at least ${e12} valid item(s)` : n8.str`must contain at least ${e12} and no more than ${t10} valid item(s)`, params: ({ params: { min: e12, max: t10 } }) => void 0 === t10 ? n8._`{minContains: ${e12}}` : n8._`{minContains: ${e12}, maxContains: ${t10}}` }, code(e12) { + const { gen: t10, schema: i9, parentSchema: o8, data: s7, it: a7 } = e12; + let p7, c7; + const { minContains: d7, maxContains: f8 } = o8; + a7.opts.next ? (p7 = void 0 === d7 ? 1 : d7, c7 = f8) : p7 = 1; + const l7 = t10.const("len", n8._`${s7}.length`); + if (e12.setParams({ min: p7, max: c7 }), void 0 === c7 && 0 === p7) + return void (0, r8.checkStrictMode)(a7, '"minContains" == 0 without "maxContains": "contains" keyword ignored'); + if (void 0 !== c7 && p7 > c7) + return (0, r8.checkStrictMode)(a7, '"minContains" > "maxContains" is always invalid'), void e12.fail(); + if ((0, r8.alwaysValidSchema)(a7, i9)) { + let t11 = n8._`${l7} >= ${p7}`; + return void 0 !== c7 && (t11 = n8._`${t11} && ${l7} <= ${c7}`), void e12.pass(t11); + } + a7.items = true; + const u7 = t10.name("valid"); + function m7() { + const e13 = t10.name("_valid"), i10 = t10.let("count", 0); + h8(e13, () => t10.if(e13, () => function(e14) { + t10.code(n8._`${e14}++`), void 0 === c7 ? t10.if(n8._`${e14} >= ${p7}`, () => t10.assign(u7, true).break()) : (t10.if(n8._`${e14} > ${c7}`, () => t10.assign(u7, false).break()), 1 === p7 ? t10.assign(u7, true) : t10.if(n8._`${e14} >= ${p7}`, () => t10.assign(u7, true))); + }(i10))); + } + function h8(i10, n9) { + t10.forRange("i", 0, l7, (t11) => { + e12.subschema({ keyword: "contains", dataProp: t11, dataPropType: r8.Type.Num, compositeRule: true }, i10), n9(); + }); + } + void 0 === c7 && 1 === p7 ? h8(u7, () => t10.if(u7, () => t10.break())) : 0 === p7 ? (t10.let(u7, true), void 0 !== c7 && t10.if(n8._`${s7}.length > 0`, m7)) : (t10.let(u7, false), m7()), e12.result(u7, () => e12.reset()); + } }; + t9.default = o7; + }, 99868: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateSchemaDeps = t9.validatePropertyDeps = t9.error = void 0; + const n8 = i8(17898), r8 = i8(50458), o7 = i8(94450); + t9.error = { message: ({ params: { property: e12, depsCount: t10, deps: i9 } }) => { + const r9 = 1 === t10 ? "property" : "properties"; + return n8.str`must have ${r9} ${i9} when property ${e12} is present`; + }, params: ({ params: { property: e12, depsCount: t10, deps: i9, missingProperty: r9 } }) => n8._`{property: ${e12}, + missingProperty: ${r9}, + depsCount: ${t10}, + deps: ${i9}}` }; + const s7 = { keyword: "dependencies", type: "object", schemaType: "object", error: t9.error, code(e12) { + const [t10, i9] = function({ schema: e13 }) { + const t11 = {}, i10 = {}; + for (const n9 in e13) + "__proto__" !== n9 && ((Array.isArray(e13[n9]) ? t11 : i10)[n9] = e13[n9]); + return [t11, i10]; + }(e12); + a7(e12, t10), p7(e12, i9); + } }; + function a7(e12, t10 = e12.schema) { + const { gen: i9, data: r9, it: s8 } = e12; + if (0 === Object.keys(t10).length) + return; + const a8 = i9.let("missing"); + for (const p8 in t10) { + const c7 = t10[p8]; + if (0 === c7.length) + continue; + const d7 = (0, o7.propertyInData)(i9, r9, p8, s8.opts.ownProperties); + e12.setParams({ property: p8, depsCount: c7.length, deps: c7.join(", ") }), s8.allErrors ? i9.if(d7, () => { + for (const t11 of c7) + (0, o7.checkReportMissingProp)(e12, t11); + }) : (i9.if(n8._`${d7} && (${(0, o7.checkMissingProp)(e12, c7, a8)})`), (0, o7.reportMissingProp)(e12, a8), i9.else()); + } + } + function p7(e12, t10 = e12.schema) { + const { gen: i9, data: n9, keyword: s8, it: a8 } = e12, p8 = i9.name("valid"); + for (const c7 in t10) + (0, r8.alwaysValidSchema)(a8, t10[c7]) || (i9.if((0, o7.propertyInData)(i9, n9, c7, a8.opts.ownProperties), () => { + const t11 = e12.subschema({ keyword: s8, schemaProp: c7 }, p8); + e12.mergeValidEvaluated(t11, p8); + }, () => i9.var(p8, true)), e12.ok(p8)); + } + t9.validatePropertyDeps = a7, t9.validateSchemaDeps = p7, t9.default = s7; + }, 90776: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(99868), r8 = { keyword: "dependentSchemas", type: "object", schemaType: "object", code: (e12) => (0, n8.validateSchemaDeps)(e12) }; + t9.default = r8; + }, 70510: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, error: { message: ({ params: e12 }) => n8.str`must match "${e12.ifClause}" schema`, params: ({ params: e12 }) => n8._`{failingKeyword: ${e12.ifClause}}` }, code(e12) { + const { gen: t10, parentSchema: i9, it: o8 } = e12; + void 0 === i9.then && void 0 === i9.else && (0, r8.checkStrictMode)(o8, '"if" without "then" and "else" is ignored'); + const a7 = s7(o8, "then"), p7 = s7(o8, "else"); + if (!a7 && !p7) + return; + const c7 = t10.let("valid", true), d7 = t10.name("_valid"); + if (function() { + const t11 = e12.subschema({ keyword: "if", compositeRule: true, createErrors: false, allErrors: false }, d7); + e12.mergeEvaluated(t11); + }(), e12.reset(), a7 && p7) { + const i10 = t10.let("ifClause"); + e12.setParams({ ifClause: i10 }), t10.if(d7, f8("then", i10), f8("else", i10)); + } else + a7 ? t10.if(d7, f8("then")) : t10.if((0, n8.not)(d7), f8("else")); + function f8(i10, r9) { + return () => { + const o9 = e12.subschema({ keyword: i10 }, d7); + t10.assign(c7, d7), e12.mergeValidEvaluated(o9, c7), r9 ? t10.assign(r9, n8._`${i10}`) : e12.setParams({ ifClause: i10 }); + }; + } + e12.pass(c7, () => e12.error(true)); + } }; + function s7(e12, t10) { + const i9 = e12.schema[t10]; + return void 0 !== i9 && !(0, r8.alwaysValidSchema)(e12, i9); + } + t9.default = o7; + }, 18225: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(93426), r8 = i8(61349), o7 = i8(44153), s7 = i8(19753), a7 = i8(35724), p7 = i8(99868), c7 = i8(67486), d7 = i8(92697), f8 = i8(19660), l7 = i8(98422), u7 = i8(65532), m7 = i8(19430), h8 = i8(98768), y7 = i8(79355), g7 = i8(70510), b8 = i8(45255); + t9.default = function(e12 = false) { + const t10 = [u7.default, m7.default, h8.default, y7.default, g7.default, b8.default, c7.default, d7.default, p7.default, f8.default, l7.default]; + return e12 ? t10.push(r8.default, s7.default) : t10.push(n8.default, o7.default), t10.push(a7.default), t10; + }; + }, 44153: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateTuple = void 0; + const n8 = i8(17898), r8 = i8(50458), o7 = i8(94450), s7 = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code(e12) { + const { schema: t10, it: i9 } = e12; + if (Array.isArray(t10)) + return a7(e12, "additionalItems", t10); + i9.items = true, (0, r8.alwaysValidSchema)(i9, t10) || e12.ok((0, o7.validateArray)(e12)); + } }; + function a7(e12, t10, i9 = e12.schema) { + const { gen: o8, parentSchema: s8, data: a8, keyword: p7, it: c7 } = e12; + !function(e13) { + const { opts: n9, errSchemaPath: o9 } = c7, s9 = i9.length, a9 = s9 === e13.minItems && (s9 === e13.maxItems || false === e13[t10]); + if (n9.strictTuples && !a9) { + const e14 = `"${p7}" is ${s9}-tuple, but minItems or maxItems/${t10} are not specified or different at path "${o9}"`; + (0, r8.checkStrictMode)(c7, e14, n9.strictTuples); + } + }(s8), c7.opts.unevaluated && i9.length && true !== c7.items && (c7.items = r8.mergeEvaluated.items(o8, i9.length, c7.items)); + const d7 = o8.name("valid"), f8 = o8.const("len", n8._`${a8}.length`); + i9.forEach((t11, i10) => { + (0, r8.alwaysValidSchema)(c7, t11) || (o8.if(n8._`${f8} > ${i10}`, () => e12.subschema({ keyword: p7, schemaProp: i10, dataProp: i10 }, d7)), e12.ok(d7)); + }); + } + t9.validateTuple = a7, t9.default = s7; + }, 19753: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = i8(94450), s7 = i8(93426), a7 = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error: { message: ({ params: { len: e12 } }) => n8.str`must NOT have more than ${e12} items`, params: ({ params: { len: e12 } }) => n8._`{limit: ${e12}}` }, code(e12) { + const { schema: t10, parentSchema: i9, it: n9 } = e12, { prefixItems: a8 } = i9; + n9.items = true, (0, r8.alwaysValidSchema)(n9, t10) || (a8 ? (0, s7.validateAdditionalItems)(e12, a8) : e12.ok((0, o7.validateArray)(e12))); + } }; + t9.default = a7; + }, 65532: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(50458), r8 = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code(e12) { + const { gen: t10, schema: i9, it: r9 } = e12; + if ((0, n8.alwaysValidSchema)(r9, i9)) + return void e12.fail(); + const o7 = t10.name("valid"); + e12.subschema({ keyword: "not", compositeRule: true, createErrors: false, allErrors: false }, o7), e12.failResult(o7, () => e12.reset(), () => e12.error()); + }, error: { message: "must NOT be valid" } }; + t9.default = r8; + }, 98768: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "oneOf", schemaType: "array", trackErrors: true, error: { message: "must match exactly one schema in oneOf", params: ({ params: e12 }) => n8._`{passingSchemas: ${e12.passing}}` }, code(e12) { + const { gen: t10, schema: i9, parentSchema: o8, it: s7 } = e12; + if (!Array.isArray(i9)) + throw new Error("ajv implementation error"); + if (s7.opts.discriminator && o8.discriminator) + return; + const a7 = i9, p7 = t10.let("valid", false), c7 = t10.let("passing", null), d7 = t10.name("_valid"); + e12.setParams({ passing: c7 }), t10.block(function() { + a7.forEach((i10, o9) => { + let a8; + (0, r8.alwaysValidSchema)(s7, i10) ? t10.var(d7, true) : a8 = e12.subschema({ keyword: "oneOf", schemaProp: o9, compositeRule: true }, d7), o9 > 0 && t10.if(n8._`${d7} && ${p7}`).assign(p7, false).assign(c7, n8._`[${c7}, ${o9}]`).else(), t10.if(d7, () => { + t10.assign(p7, true), t10.assign(c7, o9), a8 && e12.mergeEvaluated(a8, n8.Name); + }); + }); + }), e12.result(p7, () => e12.reset(), () => e12.error(true)); + } }; + t9.default = o7; + }, 98422: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(94450), r8 = i8(17898), o7 = i8(50458), s7 = i8(50458), a7 = { keyword: "patternProperties", type: "object", schemaType: "object", code(e12) { + const { gen: t10, schema: i9, data: a8, parentSchema: p7, it: c7 } = e12, { opts: d7 } = c7, f8 = (0, n8.allSchemaProperties)(i9), l7 = f8.filter((e13) => (0, o7.alwaysValidSchema)(c7, i9[e13])); + if (0 === f8.length || l7.length === f8.length && (!c7.opts.unevaluated || true === c7.props)) + return; + const u7 = d7.strictSchema && !d7.allowMatchingProperties && p7.properties, m7 = t10.name("valid"); + true === c7.props || c7.props instanceof r8.Name || (c7.props = (0, s7.evaluatedPropsToName)(t10, c7.props)); + const { props: h8 } = c7; + function y7(e13) { + for (const t11 in u7) + new RegExp(e13).test(t11) && (0, o7.checkStrictMode)(c7, `property ${t11} matches pattern ${e13} (use allowMatchingProperties)`); + } + function g7(i10) { + t10.forIn("key", a8, (o8) => { + t10.if(r8._`${(0, n8.usePattern)(e12, i10)}.test(${o8})`, () => { + const n9 = l7.includes(i10); + n9 || e12.subschema({ keyword: "patternProperties", schemaProp: i10, dataProp: o8, dataPropType: s7.Type.Str }, m7), c7.opts.unevaluated && true !== h8 ? t10.assign(r8._`${h8}[${o8}]`, true) : n9 || c7.allErrors || t10.if((0, r8.not)(m7), () => t10.break()); + }); + }); + } + !function() { + for (const e13 of f8) + u7 && y7(e13), c7.allErrors ? g7(e13) : (t10.var(m7, true), g7(e13), t10.if(m7)); + }(); + } }; + t9.default = a7; + }, 61349: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(44153), r8 = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: (e12) => (0, n8.validateTuple)(e12, "items") }; + t9.default = r8; + }, 19660: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(96223), r8 = i8(94450), o7 = i8(50458), s7 = i8(92697), a7 = { keyword: "properties", type: "object", schemaType: "object", code(e12) { + const { gen: t10, schema: i9, parentSchema: a8, data: p7, it: c7 } = e12; + "all" === c7.opts.removeAdditional && void 0 === a8.additionalProperties && s7.default.code(new n8.KeywordCxt(c7, s7.default, "additionalProperties")); + const d7 = (0, r8.allSchemaProperties)(i9); + for (const e13 of d7) + c7.definedProperties.add(e13); + c7.opts.unevaluated && d7.length && true !== c7.props && (c7.props = o7.mergeEvaluated.props(t10, (0, o7.toHash)(d7), c7.props)); + const f8 = d7.filter((e13) => !(0, o7.alwaysValidSchema)(c7, i9[e13])); + if (0 === f8.length) + return; + const l7 = t10.name("valid"); + for (const i10 of f8) + u7(i10) ? m7(i10) : (t10.if((0, r8.propertyInData)(t10, p7, i10, c7.opts.ownProperties)), m7(i10), c7.allErrors || t10.else().var(l7, true), t10.endIf()), e12.it.definedProperties.add(i10), e12.ok(l7); + function u7(e13) { + return c7.opts.useDefaults && !c7.compositeRule && void 0 !== i9[e13].default; + } + function m7(t11) { + e12.subschema({ keyword: "properties", schemaProp: t11, dataProp: t11 }, l7); + } + } }; + t9.default = a7; + }, 67486: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error: { message: "property name must be valid", params: ({ params: e12 }) => n8._`{propertyName: ${e12.propertyName}}` }, code(e12) { + const { gen: t10, schema: i9, data: o8, it: s7 } = e12; + if ((0, r8.alwaysValidSchema)(s7, i9)) + return; + const a7 = t10.name("valid"); + t10.forIn("key", o8, (i10) => { + e12.setParams({ propertyName: i10 }), e12.subschema({ keyword: "propertyNames", data: i10, dataTypes: ["string"], propertyName: i10, compositeRule: true }, a7), t10.if((0, n8.not)(a7), () => { + e12.error(true), s7.allErrors || t10.break(); + }); + }), e12.ok(a7); + } }; + t9.default = o7; + }, 45255: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(50458), r8 = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code({ keyword: e12, parentSchema: t10, it: i9 }) { + void 0 === t10.if && (0, n8.checkStrictMode)(i9, `"${e12}" without "if" is ignored`); + } }; + t9.default = r8; + }, 94450: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateUnion = t9.validateArray = t9.usePattern = t9.callValidateCode = t9.schemaProperties = t9.allSchemaProperties = t9.noPropertyInData = t9.propertyInData = t9.isOwnProperty = t9.hasPropFunc = t9.reportMissingProp = t9.checkMissingProp = t9.checkReportMissingProp = void 0; + const n8 = i8(17898), r8 = i8(50458), o7 = i8(63036), s7 = i8(50458); + function a7(e12) { + return e12.scopeValue("func", { ref: Object.prototype.hasOwnProperty, code: n8._`Object.prototype.hasOwnProperty` }); + } + function p7(e12, t10, i9) { + return n8._`${a7(e12)}.call(${t10}, ${i9})`; + } + function c7(e12, t10, i9, r9) { + const o8 = n8._`${t10}${(0, n8.getProperty)(i9)} === undefined`; + return r9 ? (0, n8.or)(o8, (0, n8.not)(p7(e12, t10, i9))) : o8; + } + function d7(e12) { + return e12 ? Object.keys(e12).filter((e13) => "__proto__" !== e13) : []; + } + t9.checkReportMissingProp = function(e12, t10) { + const { gen: i9, data: r9, it: o8 } = e12; + i9.if(c7(i9, r9, t10, o8.opts.ownProperties), () => { + e12.setParams({ missingProperty: n8._`${t10}` }, true), e12.error(); + }); + }, t9.checkMissingProp = function({ gen: e12, data: t10, it: { opts: i9 } }, r9, o8) { + return (0, n8.or)(...r9.map((r10) => (0, n8.and)(c7(e12, t10, r10, i9.ownProperties), n8._`${o8} = ${r10}`))); + }, t9.reportMissingProp = function(e12, t10) { + e12.setParams({ missingProperty: t10 }, true), e12.error(); + }, t9.hasPropFunc = a7, t9.isOwnProperty = p7, t9.propertyInData = function(e12, t10, i9, r9) { + const o8 = n8._`${t10}${(0, n8.getProperty)(i9)} !== undefined`; + return r9 ? n8._`${o8} && ${p7(e12, t10, i9)}` : o8; + }, t9.noPropertyInData = c7, t9.allSchemaProperties = d7, t9.schemaProperties = function(e12, t10) { + return d7(t10).filter((i9) => !(0, r8.alwaysValidSchema)(e12, t10[i9])); + }, t9.callValidateCode = function({ schemaCode: e12, data: t10, it: { gen: i9, topSchemaRef: r9, schemaPath: s8, errorPath: a8 }, it: p8 }, c8, d8, f9) { + const l7 = f9 ? n8._`${e12}, ${t10}, ${r9}${s8}` : t10, u7 = [[o7.default.instancePath, (0, n8.strConcat)(o7.default.instancePath, a8)], [o7.default.parentData, p8.parentData], [o7.default.parentDataProperty, p8.parentDataProperty], [o7.default.rootData, o7.default.rootData]]; + p8.opts.dynamicRef && u7.push([o7.default.dynamicAnchors, o7.default.dynamicAnchors]); + const m7 = n8._`${l7}, ${i9.object(...u7)}`; + return d8 !== n8.nil ? n8._`${c8}.call(${d8}, ${m7})` : n8._`${c8}(${m7})`; + }; + const f8 = n8._`new RegExp`; + t9.usePattern = function({ gen: e12, it: { opts: t10 } }, i9) { + const r9 = t10.unicodeRegExp ? "u" : "", { regExp: o8 } = t10.code, a8 = o8(i9, r9); + return e12.scopeValue("pattern", { key: a8.toString(), ref: a8, code: n8._`${"new RegExp" === o8.code ? f8 : (0, s7.useFunc)(e12, o8)}(${i9}, ${r9})` }); + }, t9.validateArray = function(e12) { + const { gen: t10, data: i9, keyword: o8, it: s8 } = e12, a8 = t10.name("valid"); + if (s8.allErrors) { + const e13 = t10.let("valid", true); + return p8(() => t10.assign(e13, false)), e13; + } + return t10.var(a8, true), p8(() => t10.break()), a8; + function p8(s9) { + const p9 = t10.const("len", n8._`${i9}.length`); + t10.forRange("i", 0, p9, (i10) => { + e12.subschema({ keyword: o8, dataProp: i10, dataPropType: r8.Type.Num }, a8), t10.if((0, n8.not)(a8), s9); + }); + } + }, t9.validateUnion = function(e12) { + const { gen: t10, schema: i9, keyword: o8, it: s8 } = e12; + if (!Array.isArray(i9)) + throw new Error("ajv implementation error"); + if (i9.some((e13) => (0, r8.alwaysValidSchema)(s8, e13)) && !s8.opts.unevaluated) + return; + const a8 = t10.let("valid", false), p8 = t10.name("_valid"); + t10.block(() => i9.forEach((i10, r9) => { + const s9 = e12.subschema({ keyword: o8, schemaProp: r9, compositeRule: true }, p8); + t10.assign(a8, n8._`${a8} || ${p8}`), e12.mergeValidEvaluated(s9, p8) || t10.if((0, n8.not)(a8)); + })), e12.result(a8, () => e12.reset(), () => e12.error(true)); + }; + }, 73946: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const i8 = { keyword: "id", code() { + throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); + } }; + t9.default = i8; + }, 3839: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(73946), r8 = i8(26138), o7 = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", n8.default, r8.default]; + t9.default = o7; + }, 26138: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.callRef = t9.getValidate = void 0; + const n8 = i8(85748), r8 = i8(94450), o7 = i8(17898), s7 = i8(63036), a7 = i8(49392), p7 = i8(50458), c7 = { keyword: "$ref", schemaType: "string", code(e12) { + const { gen: t10, schema: i9, it: r9 } = e12, { baseId: s8, schemaEnv: p8, validateName: c8, opts: l7, self: u7 } = r9, { root: m7 } = p8; + if (("#" === i9 || "#/" === i9) && s8 === m7.baseId) + return function() { + if (p8 === m7) + return f8(e12, c8, p8, p8.$async); + const i10 = t10.scopeValue("root", { ref: m7 }); + return f8(e12, o7._`${i10}.validate`, m7, m7.$async); + }(); + const h8 = a7.resolveRef.call(u7, m7, s8, i9); + if (void 0 === h8) + throw new n8.default(r9.opts.uriResolver, s8, i9); + return h8 instanceof a7.SchemaEnv ? function(t11) { + const i10 = d7(e12, t11); + f8(e12, i10, t11, t11.$async); + }(h8) : function(n9) { + const r10 = t10.scopeValue("schema", true === l7.code.source ? { ref: n9, code: (0, o7.stringify)(n9) } : { ref: n9 }), s9 = t10.name("valid"), a8 = e12.subschema({ schema: n9, dataTypes: [], schemaPath: o7.nil, topSchemaRef: r10, errSchemaPath: i9 }, s9); + e12.mergeEvaluated(a8), e12.ok(s9); + }(h8); + } }; + function d7(e12, t10) { + const { gen: i9 } = e12; + return t10.validate ? i9.scopeValue("validate", { ref: t10.validate }) : o7._`${i9.scopeValue("wrapper", { ref: t10 })}.validate`; + } + function f8(e12, t10, i9, n9) { + const { gen: a8, it: c8 } = e12, { allErrors: d8, schemaEnv: f9, opts: l7 } = c8, u7 = l7.passContext ? s7.default.this : o7.nil; + function m7(e13) { + const t11 = o7._`${e13}.errors`; + a8.assign(s7.default.vErrors, o7._`${s7.default.vErrors} === null ? ${t11} : ${s7.default.vErrors}.concat(${t11})`), a8.assign(s7.default.errors, o7._`${s7.default.vErrors}.length`); + } + function h8(e13) { + var t11; + if (!c8.opts.unevaluated) + return; + const n10 = null === (t11 = null == i9 ? void 0 : i9.validate) || void 0 === t11 ? void 0 : t11.evaluated; + if (true !== c8.props) + if (n10 && !n10.dynamicProps) + void 0 !== n10.props && (c8.props = p7.mergeEvaluated.props(a8, n10.props, c8.props)); + else { + const t12 = a8.var("props", o7._`${e13}.evaluated.props`); + c8.props = p7.mergeEvaluated.props(a8, t12, c8.props, o7.Name); + } + if (true !== c8.items) + if (n10 && !n10.dynamicItems) + void 0 !== n10.items && (c8.items = p7.mergeEvaluated.items(a8, n10.items, c8.items)); + else { + const t12 = a8.var("items", o7._`${e13}.evaluated.items`); + c8.items = p7.mergeEvaluated.items(a8, t12, c8.items, o7.Name); + } + } + n9 ? function() { + if (!f9.$async) + throw new Error("async schema referenced by sync schema"); + const i10 = a8.let("valid"); + a8.try(() => { + a8.code(o7._`await ${(0, r8.callValidateCode)(e12, t10, u7)}`), h8(t10), d8 || a8.assign(i10, true); + }, (e13) => { + a8.if(o7._`!(${e13} instanceof ${c8.ValidationError})`, () => a8.throw(e13)), m7(e13), d8 || a8.assign(i10, false); + }), e12.ok(i10); + }() : e12.result((0, r8.callValidateCode)(e12, t10, u7), () => h8(t10), () => m7(t10)); + } + t9.getValidate = d7, t9.callRef = f8, t9.default = c7; + }, 11672: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(88925), o7 = i8(49392), s7 = i8(85748), a7 = i8(50458), p7 = { keyword: "discriminator", type: "object", schemaType: "object", error: { message: ({ params: { discrError: e12, tagName: t10 } }) => e12 === r8.DiscrError.Tag ? `tag "${t10}" must be string` : `value of tag "${t10}" must be in oneOf`, params: ({ params: { discrError: e12, tag: t10, tagName: i9 } }) => n8._`{error: ${e12}, tag: ${i9}, tagValue: ${t10}}` }, code(e12) { + const { gen: t10, data: i9, schema: p8, parentSchema: c7, it: d7 } = e12, { oneOf: f8 } = c7; + if (!d7.opts.discriminator) + throw new Error("discriminator: requires discriminator option"); + const l7 = p8.propertyName; + if ("string" != typeof l7) + throw new Error("discriminator: requires propertyName"); + if (p8.mapping) + throw new Error("discriminator: mapping is not supported"); + if (!f8) + throw new Error("discriminator: requires oneOf keyword"); + const u7 = t10.let("valid", false), m7 = t10.const("tag", n8._`${i9}${(0, n8.getProperty)(l7)}`); + function h8(i10) { + const r9 = t10.name("valid"), o8 = e12.subschema({ keyword: "oneOf", schemaProp: i10 }, r9); + return e12.mergeEvaluated(o8, n8.Name), r9; + } + t10.if(n8._`typeof ${m7} == "string"`, () => function() { + const i10 = function() { + var e13; + const t11 = {}, i11 = r9(c7); + let n9 = true; + for (let t12 = 0; t12 < f8.length; t12++) { + let c8 = f8[t12]; + if ((null == c8 ? void 0 : c8.$ref) && !(0, a7.schemaHasRulesButRef)(c8, d7.self.RULES)) { + const e14 = c8.$ref; + if (c8 = o7.resolveRef.call(d7.self, d7.schemaEnv.root, d7.baseId, e14), c8 instanceof o7.SchemaEnv && (c8 = c8.schema), void 0 === c8) + throw new s7.default(d7.opts.uriResolver, d7.baseId, e14); + } + const u9 = null === (e13 = null == c8 ? void 0 : c8.properties) || void 0 === e13 ? void 0 : e13[l7]; + if ("object" != typeof u9) + throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l7}"`); + n9 = n9 && (i11 || r9(c8)), p9(u9, t12); + } + if (!n9) + throw new Error(`discriminator: "${l7}" must be required`); + return t11; + function r9({ required: e14 }) { + return Array.isArray(e14) && e14.includes(l7); + } + function p9(e14, t12) { + if (e14.const) + u8(e14.const, t12); + else { + if (!e14.enum) + throw new Error(`discriminator: "properties/${l7}" must have "const" or "enum"`); + for (const i12 of e14.enum) + u8(i12, t12); + } + } + function u8(e14, i12) { + if ("string" != typeof e14 || e14 in t11) + throw new Error(`discriminator: "${l7}" values must be unique strings`); + t11[e14] = i12; + } + }(); + t10.if(false); + for (const e13 in i10) + t10.elseIf(n8._`${m7} === ${e13}`), t10.assign(u7, h8(i10[e13])); + t10.else(), e12.error(false, { discrError: r8.DiscrError.Mapping, tag: m7, tagName: l7 }), t10.endIf(); + }(), () => e12.error(false, { discrError: r8.DiscrError.Tag, tag: m7, tagName: l7 })), e12.ok(u7); + } }; + t9.default = p7; + }, 88925: (e11, t9) => { + "use strict"; + var i8; + Object.defineProperty(t9, "__esModule", { value: true }), t9.DiscrError = void 0, function(e12) { + e12.Tag = "tag", e12.Mapping = "mapping"; + }(i8 || (t9.DiscrError = i8 = {})); + }, 64404: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(3839), r8 = i8(17851), o7 = i8(18225), s7 = i8(32485), a7 = i8(68774), p7 = i8(83076), c7 = i8(26699), d7 = i8(34882), f8 = [s7.default, n8.default, r8.default, (0, o7.default)(true), c7.default, d7.metadataVocabulary, d7.contentVocabulary, a7.default, p7.default]; + t9.default = f8; + }, 2431: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(3839), r8 = i8(17851), o7 = i8(18225), s7 = i8(26699), a7 = i8(34882), p7 = [n8.default, r8.default, (0, o7.default)(), s7.default, a7.metadataVocabulary, a7.contentVocabulary]; + t9.default = p7; + }, 68725: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.dynamicAnchor = void 0; + const n8 = i8(17898), r8 = i8(63036), o7 = i8(49392), s7 = i8(26138), a7 = { keyword: "$dynamicAnchor", schemaType: "string", code: (e12) => p7(e12, e12.schema) }; + function p7(e12, t10) { + const { gen: i9, it: a8 } = e12; + a8.schemaEnv.root.dynamicAnchors[t10] = true; + const p8 = n8._`${r8.default.dynamicAnchors}${(0, n8.getProperty)(t10)}`, c7 = "#" === a8.errSchemaPath ? a8.validateName : function(e13) { + const { schemaEnv: t11, schema: i10, self: n9 } = e13.it, { root: r9, baseId: a9, localRefs: p9, meta: c8 } = t11.root, { schemaId: d7 } = n9.opts, f8 = new o7.SchemaEnv({ schema: i10, schemaId: d7, root: r9, baseId: a9, localRefs: p9, meta: c8 }); + return o7.compileSchema.call(n9, f8), (0, s7.getValidate)(e13, f8); + }(e12); + i9.if(n8._`!${p8}`, () => i9.assign(p8, c7)); + } + t9.dynamicAnchor = p7, t9.default = a7; + }, 36515: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.dynamicRef = void 0; + const n8 = i8(17898), r8 = i8(63036), o7 = i8(26138), s7 = { keyword: "$dynamicRef", schemaType: "string", code: (e12) => a7(e12, e12.schema) }; + function a7(e12, t10) { + const { gen: i9, keyword: s8, it: a8 } = e12; + if ("#" !== t10[0]) + throw new Error(`"${s8}" only supports hash fragment reference`); + const p7 = t10.slice(1); + if (a8.allErrors) + c7(); + else { + const t11 = i9.let("valid", false); + c7(t11), e12.ok(t11); + } + function c7(e13) { + if (a8.schemaEnv.root.dynamicAnchors[p7]) { + const t11 = i9.let("_v", n8._`${r8.default.dynamicAnchors}${(0, n8.getProperty)(p7)}`); + i9.if(t11, d7(t11, e13), d7(a8.validateName, e13)); + } else + d7(a8.validateName, e13)(); + } + function d7(t11, n9) { + return n9 ? () => i9.block(() => { + (0, o7.callRef)(e12, t11), i9.let(n9, true); + }) : () => (0, o7.callRef)(e12, t11); + } + } + t9.dynamicRef = a7, t9.default = s7; + }, 32485: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(68725), r8 = i8(36515), o7 = i8(66792), s7 = i8(7688), a7 = [n8.default, r8.default, o7.default, s7.default]; + t9.default = a7; + }, 66792: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(68725), r8 = i8(50458), o7 = { keyword: "$recursiveAnchor", schemaType: "boolean", code(e12) { + e12.schema ? (0, n8.dynamicAnchor)(e12, "") : (0, r8.checkStrictMode)(e12.it, "$recursiveAnchor: false is ignored"); + } }; + t9.default = o7; + }, 7688: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(36515), r8 = { keyword: "$recursiveRef", schemaType: "string", code: (e12) => (0, n8.dynamicRef)(e12, e12.schema) }; + t9.default = r8; + }, 37072: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: true, error: { message: ({ schemaCode: e12 }) => n8.str`must match format "${e12}"`, params: ({ schemaCode: e12 }) => n8._`{format: ${e12}}` }, code(e12, t10) { + const { gen: i9, data: r9, $data: o7, schema: s7, schemaCode: a7, it: p7 } = e12, { opts: c7, errSchemaPath: d7, schemaEnv: f8, self: l7 } = p7; + c7.validateFormats && (o7 ? function() { + const o8 = i9.scopeValue("formats", { ref: l7.formats, code: c7.code.formats }), s8 = i9.const("fDef", n8._`${o8}[${a7}]`), p8 = i9.let("fType"), d8 = i9.let("format"); + i9.if(n8._`typeof ${s8} == "object" && !(${s8} instanceof RegExp)`, () => i9.assign(p8, n8._`${s8}.type || "string"`).assign(d8, n8._`${s8}.validate`), () => i9.assign(p8, n8._`"string"`).assign(d8, s8)), e12.fail$data((0, n8.or)(false === c7.strictSchema ? n8.nil : n8._`${a7} && !${d8}`, function() { + const e13 = f8.$async ? n8._`(${s8}.async ? await ${d8}(${r9}) : ${d8}(${r9}))` : n8._`${d8}(${r9})`, i10 = n8._`(typeof ${d8} == "function" ? ${e13} : ${d8}.test(${r9}))`; + return n8._`${d8} && ${d8} !== true && ${p8} === ${t10} && !${i10}`; + }())); + }() : function() { + const o8 = l7.formats[s7]; + if (!o8) + return void function() { + if (false !== c7.strictSchema) + throw new Error(e13()); + function e13() { + return `unknown format "${s7}" ignored in schema at path "${d7}"`; + } + l7.logger.warn(e13()); + }(); + if (true === o8) + return; + const [a8, p8, u7] = function(e13) { + const t11 = e13 instanceof RegExp ? (0, n8.regexpCode)(e13) : c7.code.formats ? n8._`${c7.code.formats}${(0, n8.getProperty)(s7)}` : void 0, r10 = i9.scopeValue("formats", { key: s7, ref: e13, code: t11 }); + return "object" != typeof e13 || e13 instanceof RegExp ? ["string", e13, r10] : [e13.type || "string", e13.validate, n8._`${r10}.validate`]; + }(o8); + a8 === t10 && e12.pass(function() { + if ("object" == typeof o8 && !(o8 instanceof RegExp) && o8.async) { + if (!f8.$async) + throw new Error("async format in sync schema"); + return n8._`await ${u7}(${r9})`; + } + return "function" == typeof p8 ? n8._`${u7}(${r9})` : n8._`${u7}.test(${r9})`; + }()); + }()); + } }; + t9.default = r8; + }, 26699: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = [i8(37072).default]; + t9.default = n8; + }, 34882: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.contentVocabulary = t9.metadataVocabulary = void 0, t9.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"], t9.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"]; + }, 68774: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(51097), r8 = i8(90776), o7 = i8(87237), s7 = [n8.default, r8.default, o7.default]; + t9.default = s7; + }, 83076: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(36237), r8 = i8(76374), o7 = [n8.default, r8.default]; + t9.default = o7; + }, 76374: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = { keyword: "unevaluatedItems", type: "array", schemaType: ["boolean", "object"], error: { message: ({ params: { len: e12 } }) => n8.str`must NOT have more than ${e12} items`, params: ({ params: { len: e12 } }) => n8._`{limit: ${e12}}` }, code(e12) { + const { gen: t10, schema: i9, data: o8, it: s7 } = e12, a7 = s7.items || 0; + if (true === a7) + return; + const p7 = t10.const("len", n8._`${o8}.length`); + if (false === i9) + e12.setParams({ len: a7 }), e12.fail(n8._`${p7} > ${a7}`); + else if ("object" == typeof i9 && !(0, r8.alwaysValidSchema)(s7, i9)) { + const i10 = t10.var("valid", n8._`${p7} <= ${a7}`); + t10.if((0, n8.not)(i10), () => function(i11, o9) { + t10.forRange("i", o9, p7, (o10) => { + e12.subschema({ keyword: "unevaluatedItems", dataProp: o10, dataPropType: r8.Type.Num }, i11), s7.allErrors || t10.if((0, n8.not)(i11), () => t10.break()); + }); + }(i10, a7)), e12.ok(i10); + } + s7.items = true; + } }; + t9.default = o7; + }, 36237: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = i8(63036), s7 = { keyword: "unevaluatedProperties", type: "object", schemaType: ["boolean", "object"], trackErrors: true, error: { message: "must NOT have unevaluated properties", params: ({ params: e12 }) => n8._`{unevaluatedProperty: ${e12.unevaluatedProperty}}` }, code(e12) { + const { gen: t10, schema: i9, data: s8, errsCount: a7, it: p7 } = e12; + if (!a7) + throw new Error("ajv implementation error"); + const { allErrors: c7, props: d7 } = p7; + function f8(o8) { + if (false === i9) + return e12.setParams({ unevaluatedProperty: o8 }), e12.error(), void (c7 || t10.break()); + if (!(0, r8.alwaysValidSchema)(p7, i9)) { + const i10 = t10.name("valid"); + e12.subschema({ keyword: "unevaluatedProperties", dataProp: o8, dataPropType: r8.Type.Str }, i10), c7 || t10.if((0, n8.not)(i10), () => t10.break()); + } + } + d7 instanceof n8.Name ? t10.if(n8._`${d7} !== true`, () => t10.forIn("key", s8, (e13) => t10.if(function(e14, t11) { + return n8._`!${e14} || !${e14}[${t11}]`; + }(d7, e13), () => f8(e13)))) : true !== d7 && t10.forIn("key", s8, (e13) => void 0 === d7 ? f8(e13) : t10.if(function(e14, t11) { + const i10 = []; + for (const r9 in e14) + true === e14[r9] && i10.push(n8._`${t11} !== ${r9}`); + return (0, n8.and)(...i10); + }(d7, e13), () => f8(e13))), p7.props = true, e12.ok(n8._`${a7} === ${o7.default.errors}`); + } }; + t9.default = s7; + }, 79520: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = i8(72725), s7 = { keyword: "const", $data: true, error: { message: "must be equal to constant", params: ({ schemaCode: e12 }) => n8._`{allowedValue: ${e12}}` }, code(e12) { + const { gen: t10, data: i9, $data: s8, schemaCode: a7, schema: p7 } = e12; + s8 || p7 && "object" == typeof p7 ? e12.fail$data(n8._`!${(0, r8.useFunc)(t10, o7.default)}(${i9}, ${a7})`) : e12.fail(n8._`${p7} !== ${i9}`); + } }; + t9.default = s7; + }, 51097: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(99868), r8 = { keyword: "dependentRequired", type: "object", schemaType: "object", error: n8.error, code: (e12) => (0, n8.validatePropertyDeps)(e12) }; + t9.default = r8; + }, 36742: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = i8(72725), s7 = { keyword: "enum", schemaType: "array", $data: true, error: { message: "must be equal to one of the allowed values", params: ({ schemaCode: e12 }) => n8._`{allowedValues: ${e12}}` }, code(e12) { + const { gen: t10, data: i9, $data: s8, schema: a7, schemaCode: p7, it: c7 } = e12; + if (!s8 && 0 === a7.length) + throw new Error("enum must have non-empty array"); + const d7 = a7.length >= c7.opts.loopEnum; + let f8; + const l7 = () => null != f8 ? f8 : f8 = (0, r8.useFunc)(t10, o7.default); + let u7; + if (d7 || s8) + u7 = t10.let("valid"), e12.block$data(u7, function() { + t10.assign(u7, false), t10.forOf("v", p7, (e13) => t10.if(n8._`${l7()}(${i9}, ${e13})`, () => t10.assign(u7, true).break())); + }); + else { + if (!Array.isArray(a7)) + throw new Error("ajv implementation error"); + const e13 = t10.const("vSchema", p7); + u7 = (0, n8.or)(...a7.map((t11, r9) => function(e14, t12) { + const r10 = a7[t12]; + return "object" == typeof r10 && null !== r10 ? n8._`${l7()}(${i9}, ${e14}[${t12}])` : n8._`${i9} === ${r10}`; + }(e13, r9))); + } + e12.pass(u7); + } }; + t9.default = s7; + }, 17851: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(72333), r8 = i8(21230), o7 = i8(3936), s7 = i8(81005), a7 = i8(71589), p7 = i8(29594), c7 = i8(38558), d7 = i8(44058), f8 = i8(79520), l7 = i8(36742), u7 = [n8.default, r8.default, o7.default, s7.default, a7.default, p7.default, c7.default, d7.default, { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, f8.default, l7.default]; + t9.default = u7; + }, 87237: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(50458), r8 = { keyword: ["maxContains", "minContains"], type: "array", schemaType: "number", code({ keyword: e12, parentSchema: t10, it: i9 }) { + void 0 === t10.contains && (0, n8.checkStrictMode)(i9, `"${e12}" without "contains" is ignored`); + } }; + t9.default = r8; + }, 38558: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: true, error: { message({ keyword: e12, schemaCode: t10 }) { + const i9 = "maxItems" === e12 ? "more" : "fewer"; + return n8.str`must NOT have ${i9} than ${t10} items`; + }, params: ({ schemaCode: e12 }) => n8._`{limit: ${e12}}` }, code(e12) { + const { keyword: t10, data: i9, schemaCode: r9 } = e12, o7 = "maxItems" === t10 ? n8.operators.GT : n8.operators.LT; + e12.fail$data(n8._`${i9}.length ${o7} ${r9}`); + } }; + t9.default = r8; + }, 3936: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = i8(50458), o7 = i8(26308), s7 = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: true, error: { message({ keyword: e12, schemaCode: t10 }) { + const i9 = "maxLength" === e12 ? "more" : "fewer"; + return n8.str`must NOT have ${i9} than ${t10} characters`; + }, params: ({ schemaCode: e12 }) => n8._`{limit: ${e12}}` }, code(e12) { + const { keyword: t10, data: i9, schemaCode: s8, it: a7 } = e12, p7 = "maxLength" === t10 ? n8.operators.GT : n8.operators.LT, c7 = false === a7.opts.unicode ? n8._`${i9}.length` : n8._`${(0, r8.useFunc)(e12.gen, o7.default)}(${i9})`; + e12.fail$data(n8._`${c7} ${p7} ${s8}`); + } }; + t9.default = s7; + }, 72333: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = n8.operators, o7 = { maximum: { okStr: "<=", ok: r8.LTE, fail: r8.GT }, minimum: { okStr: ">=", ok: r8.GTE, fail: r8.LT }, exclusiveMaximum: { okStr: "<", ok: r8.LT, fail: r8.GTE }, exclusiveMinimum: { okStr: ">", ok: r8.GT, fail: r8.LTE } }, s7 = { message: ({ keyword: e12, schemaCode: t10 }) => n8.str`must be ${o7[e12].okStr} ${t10}`, params: ({ keyword: e12, schemaCode: t10 }) => n8._`{comparison: ${o7[e12].okStr}, limit: ${t10}}` }, a7 = { keyword: Object.keys(o7), type: "number", schemaType: "number", $data: true, error: s7, code(e12) { + const { keyword: t10, data: i9, schemaCode: r9 } = e12; + e12.fail$data(n8._`${i9} ${o7[t10].fail} ${r9} || isNaN(${i9})`); + } }; + t9.default = a7; + }, 71589: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: true, error: { message({ keyword: e12, schemaCode: t10 }) { + const i9 = "maxProperties" === e12 ? "more" : "fewer"; + return n8.str`must NOT have ${i9} than ${t10} properties`; + }, params: ({ schemaCode: e12 }) => n8._`{limit: ${e12}}` }, code(e12) { + const { keyword: t10, data: i9, schemaCode: r9 } = e12, o7 = "maxProperties" === t10 ? n8.operators.GT : n8.operators.LT; + e12.fail$data(n8._`Object.keys(${i9}).length ${o7} ${r9}`); + } }; + t9.default = r8; + }, 21230: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(17898), r8 = { keyword: "multipleOf", type: "number", schemaType: "number", $data: true, error: { message: ({ schemaCode: e12 }) => n8.str`must be multiple of ${e12}`, params: ({ schemaCode: e12 }) => n8._`{multipleOf: ${e12}}` }, code(e12) { + const { gen: t10, data: i9, schemaCode: r9, it: o7 } = e12, s7 = o7.opts.multipleOfPrecision, a7 = t10.let("res"), p7 = s7 ? n8._`Math.abs(Math.round(${a7}) - ${a7}) > 1e-${s7}` : n8._`${a7} !== parseInt(${a7})`; + e12.fail$data(n8._`(${r9} === 0 || (${a7} = ${i9}/${r9}, ${p7}))`); + } }; + t9.default = r8; + }, 81005: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(94450), r8 = i8(17898), o7 = { keyword: "pattern", type: "string", schemaType: "string", $data: true, error: { message: ({ schemaCode: e12 }) => r8.str`must match pattern "${e12}"`, params: ({ schemaCode: e12 }) => r8._`{pattern: ${e12}}` }, code(e12) { + const { data: t10, $data: i9, schema: o8, schemaCode: s7, it: a7 } = e12, p7 = a7.opts.unicodeRegExp ? "u" : "", c7 = i9 ? r8._`(new RegExp(${s7}, ${p7}))` : (0, n8.usePattern)(e12, o8); + e12.fail$data(r8._`!${c7}.test(${t10})`); + } }; + t9.default = o7; + }, 29594: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(94450), r8 = i8(17898), o7 = i8(50458), s7 = { keyword: "required", type: "object", schemaType: "array", $data: true, error: { message: ({ params: { missingProperty: e12 } }) => r8.str`must have required property '${e12}'`, params: ({ params: { missingProperty: e12 } }) => r8._`{missingProperty: ${e12}}` }, code(e12) { + const { gen: t10, schema: i9, schemaCode: s8, data: a7, $data: p7, it: c7 } = e12, { opts: d7 } = c7; + if (!p7 && 0 === i9.length) + return; + const f8 = i9.length >= d7.loopRequired; + if (c7.allErrors ? function() { + if (f8 || p7) + e12.block$data(r8.nil, l7); + else + for (const t11 of i9) + (0, n8.checkReportMissingProp)(e12, t11); + }() : function() { + const o8 = t10.let("missing"); + if (f8 || p7) { + const i10 = t10.let("valid", true); + e12.block$data(i10, () => function(i11, o9) { + e12.setParams({ missingProperty: i11 }), t10.forOf(i11, s8, () => { + t10.assign(o9, (0, n8.propertyInData)(t10, a7, i11, d7.ownProperties)), t10.if((0, r8.not)(o9), () => { + e12.error(), t10.break(); + }); + }, r8.nil); + }(o8, i10)), e12.ok(i10); + } else + t10.if((0, n8.checkMissingProp)(e12, i9, o8)), (0, n8.reportMissingProp)(e12, o8), t10.else(); + }(), d7.strictRequired) { + const t11 = e12.parentSchema.properties, { definedProperties: n9 } = e12.it; + for (const e13 of i9) + if (void 0 === (null == t11 ? void 0 : t11[e13]) && !n9.has(e13)) { + const t12 = `required property "${e13}" is not defined at "${c7.schemaEnv.baseId + c7.errSchemaPath}" (strictRequired)`; + (0, o7.checkStrictMode)(c7, t12, c7.opts.strictRequired); + } + } + function l7() { + t10.forOf("prop", s8, (i10) => { + e12.setParams({ missingProperty: i10 }), t10.if((0, n8.noPropertyInData)(t10, a7, i10, d7.ownProperties), () => e12.error()); + }); + } + } }; + t9.default = s7; + }, 44058: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(69003), r8 = i8(17898), o7 = i8(50458), s7 = i8(72725), a7 = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, error: { message: ({ params: { i: e12, j: t10 } }) => r8.str`must NOT have duplicate items (items ## ${t10} and ${e12} are identical)`, params: ({ params: { i: e12, j: t10 } }) => r8._`{i: ${e12}, j: ${t10}}` }, code(e12) { + const { gen: t10, data: i9, $data: a8, schema: p7, parentSchema: c7, schemaCode: d7, it: f8 } = e12; + if (!a8 && !p7) + return; + const l7 = t10.let("valid"), u7 = c7.items ? (0, n8.getSchemaTypes)(c7.items) : []; + function m7(o8, s8) { + const a9 = t10.name("item"), p8 = (0, n8.checkDataTypes)(u7, a9, f8.opts.strictNumbers, n8.DataType.Wrong), c8 = t10.const("indices", r8._`{}`); + t10.for(r8._`;${o8}--;`, () => { + t10.let(a9, r8._`${i9}[${o8}]`), t10.if(p8, r8._`continue`), u7.length > 1 && t10.if(r8._`typeof ${a9} == "string"`, r8._`${a9} += "_"`), t10.if(r8._`typeof ${c8}[${a9}] == "number"`, () => { + t10.assign(s8, r8._`${c8}[${a9}]`), e12.error(), t10.assign(l7, false).break(); + }).code(r8._`${c8}[${a9}] = ${o8}`); + }); + } + function h8(n9, a9) { + const p8 = (0, o7.useFunc)(t10, s7.default), c8 = t10.name("outer"); + t10.label(c8).for(r8._`;${n9}--;`, () => t10.for(r8._`${a9} = ${n9}; ${a9}--;`, () => t10.if(r8._`${p8}(${i9}[${n9}], ${i9}[${a9}])`, () => { + e12.error(), t10.assign(l7, false).break(c8); + }))); + } + e12.block$data(l7, function() { + const n9 = t10.let("i", r8._`${i9}.length`), o8 = t10.let("j"); + e12.setParams({ i: n9, j: o8 }), t10.assign(l7, true), t10.if(r8._`${n9} > 1`, () => (u7.length > 0 && !u7.some((e13) => "object" === e13 || "array" === e13) ? m7 : h8)(n9, o8)); + }, r8._`${d7} === false`), e12.ok(l7); + } }; + t9.default = a7; + }, 14891: (e11, t9) => { + "use strict"; + function i8(e12, t10) { + for (var i9 = 0; i9 < t10.length; i9++) { + var n9 = t10[i9]; + n9.enumerable = n9.enumerable || false, n9.configurable = true, "value" in n9 && (n9.writable = true), Object.defineProperty(e12, n9.key, n9); + } + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.generate = function(e12, t10) { + var i9 = new x7(t10); + return i9.generator[e12.type](e12, i9), i9.output; + }, t9.baseGenerator = t9.GENERATOR = t9.EXPRESSIONS_PRECEDENCE = t9.NEEDS_PARENTHESES = void 0; + var n8 = JSON.stringify; + if (!String.prototype.repeat) + throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation"); + if (!String.prototype.endsWith) + throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation"); + var r8 = { "||": 2, "??": 3, "&&": 4, "|": 5, "^": 6, "&": 7, "==": 8, "!=": 8, "===": 8, "!==": 8, "<": 9, ">": 9, "<=": 9, ">=": 9, in: 9, instanceof: 9, "<<": 10, ">>": 10, ">>>": 10, "+": 11, "-": 11, "*": 12, "%": 12, "/": 12, "**": 13 }, o7 = 17; + t9.NEEDS_PARENTHESES = o7; + var s7, a7, p7, c7, d7, f8, l7 = { ArrayExpression: 20, TaggedTemplateExpression: 20, ThisExpression: 20, Identifier: 20, PrivateIdentifier: 20, Literal: 18, TemplateLiteral: 20, Super: 20, SequenceExpression: 20, MemberExpression: 19, ChainExpression: 19, CallExpression: 19, NewExpression: 19, ArrowFunctionExpression: o7, ClassExpression: o7, FunctionExpression: o7, ObjectExpression: o7, UpdateExpression: 16, UnaryExpression: 15, AwaitExpression: 15, BinaryExpression: 14, LogicalExpression: 13, ConditionalExpression: 4, AssignmentExpression: 3, YieldExpression: 2, RestElement: 1 }; + function u7(e12, t10) { + var i9 = e12.generator; + if (e12.write("("), null != t10 && t10.length > 0) { + i9[t10[0].type](t10[0], e12); + for (var n9 = t10.length, r9 = 1; r9 < n9; r9++) { + var o8 = t10[r9]; + e12.write(", "), i9[o8.type](o8, e12); + } + } + e12.write(")"); + } + function m7(e12, t10, i9, n9) { + var s8 = e12.expressionsPrecedence[t10.type]; + if (s8 === o7) + return true; + var a8 = e12.expressionsPrecedence[i9.type]; + return s8 !== a8 ? !n9 && 15 === s8 && 14 === a8 && "**" === i9.operator || s8 < a8 : (13 === s8 || 14 === s8) && ("**" === t10.operator && "**" === i9.operator ? !n9 : 13 === s8 && 13 === a8 && ("??" === t10.operator || "??" === i9.operator) || (n9 ? r8[t10.operator] <= r8[i9.operator] : r8[t10.operator] < r8[i9.operator])); + } + function h8(e12, t10, i9, n9) { + var r9 = e12.generator; + m7(e12, t10, i9, n9) ? (e12.write("("), r9[t10.type](t10, e12), e12.write(")")) : r9[t10.type](t10, e12); + } + function y7(e12, t10, i9, n9) { + var r9 = t10.split("\n"), o8 = r9.length - 1; + if (e12.write(r9[0].trim()), o8 > 0) { + e12.write(n9); + for (var s8 = 1; s8 < o8; s8++) + e12.write(i9 + r9[s8].trim() + n9); + e12.write(i9 + r9[o8].trim()); + } + } + function g7(e12, t10, i9, n9) { + for (var r9 = t10.length, o8 = 0; o8 < r9; o8++) { + var s8 = t10[o8]; + e12.write(i9), "L" === s8.type[0] ? e12.write("// " + s8.value.trim() + "\n", s8) : (e12.write("/*"), y7(e12, s8.value, i9, n9), e12.write("*/" + n9)); + } + } + function b8(e12, t10) { + var i9 = e12.generator, n9 = t10.declarations; + e12.write(t10.kind + " "); + var r9 = n9.length; + if (r9 > 0) { + i9.VariableDeclarator(n9[0], e12); + for (var o8 = 1; o8 < r9; o8++) + e12.write(", "), i9.VariableDeclarator(n9[o8], e12); + } + } + t9.EXPRESSIONS_PRECEDENCE = l7; + var v8 = { Program: function(e12, t10) { + var i9 = t10.indent.repeat(t10.indentLevel), n9 = t10.lineEnd, r9 = t10.writeComments; + r9 && null != e12.comments && g7(t10, e12.comments, i9, n9); + for (var o8 = e12.body, s8 = o8.length, a8 = 0; a8 < s8; a8++) { + var p8 = o8[a8]; + r9 && null != p8.comments && g7(t10, p8.comments, i9, n9), t10.write(i9), this[p8.type](p8, t10), t10.write(n9); + } + r9 && null != e12.trailingComments && g7(t10, e12.trailingComments, i9, n9); + }, BlockStatement: f8 = function(e12, t10) { + var i9 = t10.indent.repeat(t10.indentLevel++), n9 = t10.lineEnd, r9 = t10.writeComments, o8 = i9 + t10.indent; + t10.write("{"); + var s8 = e12.body; + if (null != s8 && s8.length > 0) { + t10.write(n9), r9 && null != e12.comments && g7(t10, e12.comments, o8, n9); + for (var a8 = s8.length, p8 = 0; p8 < a8; p8++) { + var c8 = s8[p8]; + r9 && null != c8.comments && g7(t10, c8.comments, o8, n9), t10.write(o8), this[c8.type](c8, t10), t10.write(n9); + } + t10.write(i9); + } else + r9 && null != e12.comments && (t10.write(n9), g7(t10, e12.comments, o8, n9), t10.write(i9)); + r9 && null != e12.trailingComments && g7(t10, e12.trailingComments, o8, n9), t10.write("}"), t10.indentLevel--; + }, ClassBody: f8, StaticBlock: function(e12, t10) { + t10.write("static "), this.BlockStatement(e12, t10); + }, EmptyStatement: function(e12, t10) { + t10.write(";"); + }, ExpressionStatement: function(e12, t10) { + var i9 = t10.expressionsPrecedence[e12.expression.type]; + i9 === o7 || 3 === i9 && "O" === e12.expression.left.type[0] ? (t10.write("("), this[e12.expression.type](e12.expression, t10), t10.write(")")) : this[e12.expression.type](e12.expression, t10), t10.write(";"); + }, IfStatement: function(e12, t10) { + t10.write("if ("), this[e12.test.type](e12.test, t10), t10.write(") "), this[e12.consequent.type](e12.consequent, t10), null != e12.alternate && (t10.write(" else "), this[e12.alternate.type](e12.alternate, t10)); + }, LabeledStatement: function(e12, t10) { + this[e12.label.type](e12.label, t10), t10.write(": "), this[e12.body.type](e12.body, t10); + }, BreakStatement: function(e12, t10) { + t10.write("break"), null != e12.label && (t10.write(" "), this[e12.label.type](e12.label, t10)), t10.write(";"); + }, ContinueStatement: function(e12, t10) { + t10.write("continue"), null != e12.label && (t10.write(" "), this[e12.label.type](e12.label, t10)), t10.write(";"); + }, WithStatement: function(e12, t10) { + t10.write("with ("), this[e12.object.type](e12.object, t10), t10.write(") "), this[e12.body.type](e12.body, t10); + }, SwitchStatement: function(e12, t10) { + var i9 = t10.indent.repeat(t10.indentLevel++), n9 = t10.lineEnd, r9 = t10.writeComments; + t10.indentLevel++; + var o8 = i9 + t10.indent, s8 = o8 + t10.indent; + t10.write("switch ("), this[e12.discriminant.type](e12.discriminant, t10), t10.write(") {" + n9); + for (var a8 = e12.cases, p8 = a8.length, c8 = 0; c8 < p8; c8++) { + var d8 = a8[c8]; + r9 && null != d8.comments && g7(t10, d8.comments, o8, n9), d8.test ? (t10.write(o8 + "case "), this[d8.test.type](d8.test, t10), t10.write(":" + n9)) : t10.write(o8 + "default:" + n9); + for (var f9 = d8.consequent, l8 = f9.length, u8 = 0; u8 < l8; u8++) { + var m8 = f9[u8]; + r9 && null != m8.comments && g7(t10, m8.comments, s8, n9), t10.write(s8), this[m8.type](m8, t10), t10.write(n9); + } + } + t10.indentLevel -= 2, t10.write(i9 + "}"); + }, ReturnStatement: function(e12, t10) { + t10.write("return"), e12.argument && (t10.write(" "), this[e12.argument.type](e12.argument, t10)), t10.write(";"); + }, ThrowStatement: function(e12, t10) { + t10.write("throw "), this[e12.argument.type](e12.argument, t10), t10.write(";"); + }, TryStatement: function(e12, t10) { + if (t10.write("try "), this[e12.block.type](e12.block, t10), e12.handler) { + var i9 = e12.handler; + null == i9.param ? t10.write(" catch ") : (t10.write(" catch ("), this[i9.param.type](i9.param, t10), t10.write(") ")), this[i9.body.type](i9.body, t10); + } + e12.finalizer && (t10.write(" finally "), this[e12.finalizer.type](e12.finalizer, t10)); + }, WhileStatement: function(e12, t10) { + t10.write("while ("), this[e12.test.type](e12.test, t10), t10.write(") "), this[e12.body.type](e12.body, t10); + }, DoWhileStatement: function(e12, t10) { + t10.write("do "), this[e12.body.type](e12.body, t10), t10.write(" while ("), this[e12.test.type](e12.test, t10), t10.write(");"); + }, ForStatement: function(e12, t10) { + if (t10.write("for ("), null != e12.init) { + var i9 = e12.init; + "V" === i9.type[0] ? b8(t10, i9) : this[i9.type](i9, t10); + } + t10.write("; "), e12.test && this[e12.test.type](e12.test, t10), t10.write("; "), e12.update && this[e12.update.type](e12.update, t10), t10.write(") "), this[e12.body.type](e12.body, t10); + }, ForInStatement: s7 = function(e12, t10) { + t10.write("for ".concat(e12.await ? "await " : "", "(")); + var i9 = e12.left; + "V" === i9.type[0] ? b8(t10, i9) : this[i9.type](i9, t10), t10.write("I" === e12.type[3] ? " in " : " of "), this[e12.right.type](e12.right, t10), t10.write(") "), this[e12.body.type](e12.body, t10); + }, ForOfStatement: s7, DebuggerStatement: function(e12, t10) { + t10.write("debugger;", e12); + }, FunctionDeclaration: a7 = function(e12, t10) { + t10.write((e12.async ? "async " : "") + (e12.generator ? "function* " : "function ") + (e12.id ? e12.id.name : ""), e12), u7(t10, e12.params), t10.write(" "), this[e12.body.type](e12.body, t10); + }, FunctionExpression: a7, VariableDeclaration: function(e12, t10) { + b8(t10, e12), t10.write(";"); + }, VariableDeclarator: function(e12, t10) { + this[e12.id.type](e12.id, t10), null != e12.init && (t10.write(" = "), this[e12.init.type](e12.init, t10)); + }, ClassDeclaration: function(e12, t10) { + if (t10.write("class " + (e12.id ? "".concat(e12.id.name, " ") : ""), e12), e12.superClass) { + t10.write("extends "); + var i9 = e12.superClass, n9 = i9.type, r9 = t10.expressionsPrecedence[n9]; + "C" === n9[0] && "l" === n9[1] && "E" === n9[5] || !(r9 === o7 || r9 < t10.expressionsPrecedence.ClassExpression) ? this[i9.type](i9, t10) : (t10.write("("), this[e12.superClass.type](i9, t10), t10.write(")")), t10.write(" "); + } + this.ClassBody(e12.body, t10); + }, ImportDeclaration: function(e12, t10) { + t10.write("import "); + var i9 = e12.specifiers, n9 = i9.length, r9 = 0; + if (n9 > 0) { + for (; r9 < n9; ) { + r9 > 0 && t10.write(", "); + var o8 = i9[r9], s8 = o8.type[6]; + if ("D" === s8) + t10.write(o8.local.name, o8), r9++; + else { + if ("N" !== s8) + break; + t10.write("* as " + o8.local.name, o8), r9++; + } + } + if (r9 < n9) { + for (t10.write("{"); ; ) { + var a8 = i9[r9], p8 = a8.imported.name; + if (t10.write(p8, a8), p8 !== a8.local.name && t10.write(" as " + a8.local.name), !(++r9 < n9)) + break; + t10.write(", "); + } + t10.write("}"); + } + t10.write(" from "); + } + this.Literal(e12.source, t10), t10.write(";"); + }, ImportExpression: function(e12, t10) { + t10.write("import("), this[e12.source.type](e12.source, t10), t10.write(")"); + }, ExportDefaultDeclaration: function(e12, t10) { + t10.write("export default "), this[e12.declaration.type](e12.declaration, t10), null != t10.expressionsPrecedence[e12.declaration.type] && "F" !== e12.declaration.type[0] && t10.write(";"); + }, ExportNamedDeclaration: function(e12, t10) { + if (t10.write("export "), e12.declaration) + this[e12.declaration.type](e12.declaration, t10); + else { + t10.write("{"); + var i9 = e12.specifiers, n9 = i9.length; + if (n9 > 0) + for (var r9 = 0; ; ) { + var o8 = i9[r9], s8 = o8.local.name; + if (t10.write(s8, o8), s8 !== o8.exported.name && t10.write(" as " + o8.exported.name), !(++r9 < n9)) + break; + t10.write(", "); + } + t10.write("}"), e12.source && (t10.write(" from "), this.Literal(e12.source, t10)), t10.write(";"); + } + }, ExportAllDeclaration: function(e12, t10) { + null != e12.exported ? t10.write("export * as " + e12.exported.name + " from ") : t10.write("export * from "), this.Literal(e12.source, t10), t10.write(";"); + }, MethodDefinition: function(e12, t10) { + e12.static && t10.write("static "); + var i9 = e12.kind[0]; + "g" !== i9 && "s" !== i9 || t10.write(e12.kind + " "), e12.value.async && t10.write("async "), e12.value.generator && t10.write("*"), e12.computed ? (t10.write("["), this[e12.key.type](e12.key, t10), t10.write("]")) : this[e12.key.type](e12.key, t10), u7(t10, e12.value.params), t10.write(" "), this[e12.value.body.type](e12.value.body, t10); + }, ClassExpression: function(e12, t10) { + this.ClassDeclaration(e12, t10); + }, ArrowFunctionExpression: function(e12, t10) { + t10.write(e12.async ? "async " : "", e12); + var i9 = e12.params; + null != i9 && (1 === i9.length && "I" === i9[0].type[0] ? t10.write(i9[0].name, i9[0]) : u7(t10, e12.params)), t10.write(" => "), "O" === e12.body.type[0] ? (t10.write("("), this.ObjectExpression(e12.body, t10), t10.write(")")) : this[e12.body.type](e12.body, t10); + }, ThisExpression: function(e12, t10) { + t10.write("this", e12); + }, Super: function(e12, t10) { + t10.write("super", e12); + }, RestElement: p7 = function(e12, t10) { + t10.write("..."), this[e12.argument.type](e12.argument, t10); + }, SpreadElement: p7, YieldExpression: function(e12, t10) { + t10.write(e12.delegate ? "yield*" : "yield"), e12.argument && (t10.write(" "), this[e12.argument.type](e12.argument, t10)); + }, AwaitExpression: function(e12, t10) { + t10.write("await ", e12), h8(t10, e12.argument, e12); + }, TemplateLiteral: function(e12, t10) { + var i9 = e12.quasis, n9 = e12.expressions; + t10.write("`"); + for (var r9 = n9.length, o8 = 0; o8 < r9; o8++) { + var s8 = n9[o8], a8 = i9[o8]; + t10.write(a8.value.raw, a8), t10.write("${"), this[s8.type](s8, t10), t10.write("}"); + } + var p8 = i9[i9.length - 1]; + t10.write(p8.value.raw, p8), t10.write("`"); + }, TemplateElement: function(e12, t10) { + t10.write(e12.value.raw, e12); + }, TaggedTemplateExpression: function(e12, t10) { + h8(t10, e12.tag, e12), this[e12.quasi.type](e12.quasi, t10); + }, ArrayExpression: d7 = function(e12, t10) { + if (t10.write("["), e12.elements.length > 0) + for (var i9 = e12.elements, n9 = i9.length, r9 = 0; ; ) { + var o8 = i9[r9]; + if (null != o8 && this[o8.type](o8, t10), !(++r9 < n9)) { + null == o8 && t10.write(", "); + break; + } + t10.write(", "); + } + t10.write("]"); + }, ArrayPattern: d7, ObjectExpression: function(e12, t10) { + var i9 = t10.indent.repeat(t10.indentLevel++), n9 = t10.lineEnd, r9 = t10.writeComments, o8 = i9 + t10.indent; + if (t10.write("{"), e12.properties.length > 0) { + t10.write(n9), r9 && null != e12.comments && g7(t10, e12.comments, o8, n9); + for (var s8 = "," + n9, a8 = e12.properties, p8 = a8.length, c8 = 0; ; ) { + var d8 = a8[c8]; + if (r9 && null != d8.comments && g7(t10, d8.comments, o8, n9), t10.write(o8), this[d8.type](d8, t10), !(++c8 < p8)) + break; + t10.write(s8); + } + t10.write(n9), r9 && null != e12.trailingComments && g7(t10, e12.trailingComments, o8, n9), t10.write(i9 + "}"); + } else + r9 ? null != e12.comments ? (t10.write(n9), g7(t10, e12.comments, o8, n9), null != e12.trailingComments && g7(t10, e12.trailingComments, o8, n9), t10.write(i9 + "}")) : null != e12.trailingComments ? (t10.write(n9), g7(t10, e12.trailingComments, o8, n9), t10.write(i9 + "}")) : t10.write("}") : t10.write("}"); + t10.indentLevel--; + }, Property: function(e12, t10) { + e12.method || "i" !== e12.kind[0] ? this.MethodDefinition(e12, t10) : (e12.shorthand || (e12.computed ? (t10.write("["), this[e12.key.type](e12.key, t10), t10.write("]")) : this[e12.key.type](e12.key, t10), t10.write(": ")), this[e12.value.type](e12.value, t10)); + }, PropertyDefinition: function(e12, t10) { + e12.static && t10.write("static "), e12.computed && t10.write("["), this[e12.key.type](e12.key, t10), e12.computed && t10.write("]"), null != e12.value ? (t10.write(" = "), this[e12.value.type](e12.value, t10), t10.write(";")) : "F" !== e12.key.type[0] && t10.write(";"); + }, ObjectPattern: function(e12, t10) { + if (t10.write("{"), e12.properties.length > 0) + for (var i9 = e12.properties, n9 = i9.length, r9 = 0; this[i9[r9].type](i9[r9], t10), ++r9 < n9; ) + t10.write(", "); + t10.write("}"); + }, SequenceExpression: function(e12, t10) { + u7(t10, e12.expressions); + }, UnaryExpression: function(e12, t10) { + if (e12.prefix) { + var i9 = e12.operator, n9 = e12.argument, r9 = e12.argument.type; + t10.write(i9); + var o8 = m7(t10, n9, e12); + o8 || !(i9.length > 1) && ("U" !== r9[0] || "n" !== r9[1] && "p" !== r9[1] || !n9.prefix || n9.operator[0] !== i9 || "+" !== i9 && "-" !== i9) || t10.write(" "), o8 ? (t10.write(i9.length > 1 ? " (" : "("), this[r9](n9, t10), t10.write(")")) : this[r9](n9, t10); + } else + this[e12.argument.type](e12.argument, t10), t10.write(e12.operator); + }, UpdateExpression: function(e12, t10) { + e12.prefix ? (t10.write(e12.operator), this[e12.argument.type](e12.argument, t10)) : (this[e12.argument.type](e12.argument, t10), t10.write(e12.operator)); + }, AssignmentExpression: function(e12, t10) { + this[e12.left.type](e12.left, t10), t10.write(" " + e12.operator + " "), this[e12.right.type](e12.right, t10); + }, AssignmentPattern: function(e12, t10) { + this[e12.left.type](e12.left, t10), t10.write(" = "), this[e12.right.type](e12.right, t10); + }, BinaryExpression: c7 = function(e12, t10) { + var i9 = "in" === e12.operator; + i9 && t10.write("("), h8(t10, e12.left, e12, false), t10.write(" " + e12.operator + " "), h8(t10, e12.right, e12, true), i9 && t10.write(")"); + }, LogicalExpression: c7, ConditionalExpression: function(e12, t10) { + var i9 = e12.test, n9 = t10.expressionsPrecedence[i9.type]; + n9 === o7 || n9 <= t10.expressionsPrecedence.ConditionalExpression ? (t10.write("("), this[i9.type](i9, t10), t10.write(")")) : this[i9.type](i9, t10), t10.write(" ? "), this[e12.consequent.type](e12.consequent, t10), t10.write(" : "), this[e12.alternate.type](e12.alternate, t10); + }, NewExpression: function(e12, t10) { + t10.write("new "); + var i9 = t10.expressionsPrecedence[e12.callee.type]; + i9 === o7 || i9 < t10.expressionsPrecedence.CallExpression || function(e13) { + for (var t11 = e13; null != t11; ) { + var i10 = t11.type; + if ("C" === i10[0] && "a" === i10[1]) + return true; + if ("M" !== i10[0] || "e" !== i10[1] || "m" !== i10[2]) + return false; + t11 = t11.object; + } + }(e12.callee) ? (t10.write("("), this[e12.callee.type](e12.callee, t10), t10.write(")")) : this[e12.callee.type](e12.callee, t10), u7(t10, e12.arguments); + }, CallExpression: function(e12, t10) { + var i9 = t10.expressionsPrecedence[e12.callee.type]; + i9 === o7 || i9 < t10.expressionsPrecedence.CallExpression ? (t10.write("("), this[e12.callee.type](e12.callee, t10), t10.write(")")) : this[e12.callee.type](e12.callee, t10), e12.optional && t10.write("?."), u7(t10, e12.arguments); + }, ChainExpression: function(e12, t10) { + this[e12.expression.type](e12.expression, t10); + }, MemberExpression: function(e12, t10) { + var i9 = t10.expressionsPrecedence[e12.object.type]; + i9 === o7 || i9 < t10.expressionsPrecedence.MemberExpression ? (t10.write("("), this[e12.object.type](e12.object, t10), t10.write(")")) : this[e12.object.type](e12.object, t10), e12.computed ? (e12.optional && t10.write("?."), t10.write("["), this[e12.property.type](e12.property, t10), t10.write("]")) : (e12.optional ? t10.write("?.") : t10.write("."), this[e12.property.type](e12.property, t10)); + }, MetaProperty: function(e12, t10) { + t10.write(e12.meta.name + "." + e12.property.name, e12); + }, Identifier: function(e12, t10) { + t10.write(e12.name, e12); + }, PrivateIdentifier: function(e12, t10) { + t10.write("#".concat(e12.name), e12); + }, Literal: function(e12, t10) { + null != e12.raw ? t10.write(e12.raw, e12) : null != e12.regex ? this.RegExpLiteral(e12, t10) : null != e12.bigint ? t10.write(e12.bigint + "n", e12) : t10.write(n8(e12.value), e12); + }, RegExpLiteral: function(e12, t10) { + var i9 = e12.regex; + t10.write("/".concat(i9.pattern, "/").concat(i9.flags), e12); + } }; + t9.GENERATOR = v8; + var j6 = {}, $5 = v8; + t9.baseGenerator = $5; + var x7 = function() { + function e12(t11) { + !function(e13, t12) { + if (!(e13 instanceof t12)) + throw new TypeError("Cannot call a class as a function"); + }(this, e12); + var i9 = null == t11 ? j6 : t11; + this.output = "", null != i9.output ? (this.output = i9.output, this.write = this.writeToStream) : this.output = "", this.generator = null != i9.generator ? i9.generator : v8, this.expressionsPrecedence = null != i9.expressionsPrecedence ? i9.expressionsPrecedence : l7, this.indent = null != i9.indent ? i9.indent : " ", this.lineEnd = null != i9.lineEnd ? i9.lineEnd : "\n", this.indentLevel = null != i9.startingIndentLevel ? i9.startingIndentLevel : 0, this.writeComments = !!i9.comments && i9.comments, null != i9.sourceMap && (this.write = null == i9.output ? this.writeAndMap : this.writeToStreamAndMap, this.sourceMap = i9.sourceMap, this.line = 1, this.column = 0, this.lineEndSize = this.lineEnd.split("\n").length - 1, this.mapping = { original: null, generated: this, name: void 0, source: i9.sourceMap.file || i9.sourceMap._file }); + } + var t10, n9; + return t10 = e12, (n9 = [{ key: "write", value: function(e13) { + this.output += e13; + } }, { key: "writeToStream", value: function(e13) { + this.output.write(e13); + } }, { key: "writeAndMap", value: function(e13, t11) { + this.output += e13, this.map(e13, t11); + } }, { key: "writeToStreamAndMap", value: function(e13, t11) { + this.output.write(e13), this.map(e13, t11); + } }, { key: "map", value: function(e13, t11) { + if (null != t11) { + var i9 = t11.type; + if ("L" === i9[0] && "n" === i9[2]) + return this.column = 0, void this.line++; + if (null != t11.loc) { + var n10 = this.mapping; + n10.original = t11.loc.start, n10.name = t11.name, this.sourceMap.addMapping(n10); + } + if ("T" === i9[0] && "E" === i9[8] || "L" === i9[0] && "i" === i9[1] && "string" == typeof t11.value) { + for (var r9 = e13.length, o8 = this.column, s8 = this.line, a8 = 0; a8 < r9; a8++) + "\n" === e13[a8] ? (o8 = 0, s8++) : o8++; + return this.column = o8, void (this.line = s8); + } + } + var p8 = e13.length, c8 = this.lineEnd; + p8 > 0 && (this.lineEndSize > 0 && (1 === c8.length ? e13[p8 - 1] === c8 : e13.endsWith(c8)) ? (this.line += this.lineEndSize, this.column = 0) : this.column += p8); + } }, { key: "toString", value: function() { + return this.output; + } }]) && i8(t10.prototype, n9), e12; + }(); + }, 7991: (e11, t9) => { + "use strict"; + t9.byteLength = function(e12) { + var t10 = a7(e12), i9 = t10[0], n9 = t10[1]; + return 3 * (i9 + n9) / 4 - n9; + }, t9.toByteArray = function(e12) { + var t10, i9, o8 = a7(e12), s8 = o8[0], p8 = o8[1], c7 = new r8(function(e13, t11, i10) { + return 3 * (t11 + i10) / 4 - i10; + }(0, s8, p8)), d7 = 0, f8 = p8 > 0 ? s8 - 4 : s8; + for (i9 = 0; i9 < f8; i9 += 4) + t10 = n8[e12.charCodeAt(i9)] << 18 | n8[e12.charCodeAt(i9 + 1)] << 12 | n8[e12.charCodeAt(i9 + 2)] << 6 | n8[e12.charCodeAt(i9 + 3)], c7[d7++] = t10 >> 16 & 255, c7[d7++] = t10 >> 8 & 255, c7[d7++] = 255 & t10; + return 2 === p8 && (t10 = n8[e12.charCodeAt(i9)] << 2 | n8[e12.charCodeAt(i9 + 1)] >> 4, c7[d7++] = 255 & t10), 1 === p8 && (t10 = n8[e12.charCodeAt(i9)] << 10 | n8[e12.charCodeAt(i9 + 1)] << 4 | n8[e12.charCodeAt(i9 + 2)] >> 2, c7[d7++] = t10 >> 8 & 255, c7[d7++] = 255 & t10), c7; + }, t9.fromByteArray = function(e12) { + for (var t10, n9 = e12.length, r9 = n9 % 3, o8 = [], s8 = 16383, a8 = 0, c7 = n9 - r9; a8 < c7; a8 += s8) + o8.push(p7(e12, a8, a8 + s8 > c7 ? c7 : a8 + s8)); + return 1 === r9 ? (t10 = e12[n9 - 1], o8.push(i8[t10 >> 2] + i8[t10 << 4 & 63] + "==")) : 2 === r9 && (t10 = (e12[n9 - 2] << 8) + e12[n9 - 1], o8.push(i8[t10 >> 10] + i8[t10 >> 4 & 63] + i8[t10 << 2 & 63] + "=")), o8.join(""); + }; + for (var i8 = [], n8 = [], r8 = "undefined" != typeof Uint8Array ? Uint8Array : Array, o7 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s7 = 0; s7 < 64; ++s7) + i8[s7] = o7[s7], n8[o7.charCodeAt(s7)] = s7; + function a7(e12) { + var t10 = e12.length; + if (t10 % 4 > 0) + throw new Error("Invalid string. Length must be a multiple of 4"); + var i9 = e12.indexOf("="); + return -1 === i9 && (i9 = t10), [i9, i9 === t10 ? 0 : 4 - i9 % 4]; + } + function p7(e12, t10, n9) { + for (var r9, o8, s8 = [], a8 = t10; a8 < n9; a8 += 3) + r9 = (e12[a8] << 16 & 16711680) + (e12[a8 + 1] << 8 & 65280) + (255 & e12[a8 + 2]), s8.push(i8[(o8 = r9) >> 18 & 63] + i8[o8 >> 12 & 63] + i8[o8 >> 6 & 63] + i8[63 & o8]); + return s8.join(""); + } + n8["-".charCodeAt(0)] = 62, n8["_".charCodeAt(0)] = 63; + }, 473: (e11, t9, i8) => { + var n8 = i8(55837), r8 = i8(81293); + e11.exports = function(e12) { + return e12 ? ("{}" === e12.substr(0, 2) && (e12 = "\\{\\}" + e12.substr(2)), g7(function(e13) { + return e13.split("\\\\").join(o7).split("\\{").join(s7).split("\\}").join(a7).split("\\,").join(p7).split("\\.").join(c7); + }(e12), true).map(f8)) : []; + }; + var o7 = "\0SLASH" + Math.random() + "\0", s7 = "\0OPEN" + Math.random() + "\0", a7 = "\0CLOSE" + Math.random() + "\0", p7 = "\0COMMA" + Math.random() + "\0", c7 = "\0PERIOD" + Math.random() + "\0"; + function d7(e12) { + return parseInt(e12, 10) == e12 ? parseInt(e12, 10) : e12.charCodeAt(0); + } + function f8(e12) { + return e12.split(o7).join("\\").split(s7).join("{").split(a7).join("}").split(p7).join(",").split(c7).join("."); + } + function l7(e12) { + if (!e12) + return [""]; + var t10 = [], i9 = r8("{", "}", e12); + if (!i9) + return e12.split(","); + var n9 = i9.pre, o8 = i9.body, s8 = i9.post, a8 = n9.split(","); + a8[a8.length - 1] += "{" + o8 + "}"; + var p8 = l7(s8); + return s8.length && (a8[a8.length - 1] += p8.shift(), a8.push.apply(a8, p8)), t10.push.apply(t10, a8), t10; + } + function u7(e12) { + return "{" + e12 + "}"; + } + function m7(e12) { + return /^-?0\d/.test(e12); + } + function h8(e12, t10) { + return e12 <= t10; + } + function y7(e12, t10) { + return e12 >= t10; + } + function g7(e12, t10) { + var i9 = [], o8 = r8("{", "}", e12); + if (!o8 || /\$$/.test(o8.pre)) + return [e12]; + var s8, p8 = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o8.body), c8 = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o8.body), f9 = p8 || c8, b8 = o8.body.indexOf(",") >= 0; + if (!f9 && !b8) + return o8.post.match(/,.*\}/) ? g7(e12 = o8.pre + "{" + o8.body + a7 + o8.post) : [e12]; + if (f9) + s8 = o8.body.split(/\.\./); + else if (1 === (s8 = l7(o8.body)).length && 1 === (s8 = g7(s8[0], false).map(u7)).length) + return ($5 = o8.post.length ? g7(o8.post, false) : [""]).map(function(e13) { + return o8.pre + s8[0] + e13; + }); + var v8, j6 = o8.pre, $5 = o8.post.length ? g7(o8.post, false) : [""]; + if (f9) { + var x7 = d7(s8[0]), _6 = d7(s8[1]), w6 = Math.max(s8[0].length, s8[1].length), S6 = 3 == s8.length ? Math.abs(d7(s8[2])) : 1, P6 = h8; + _6 < x7 && (S6 *= -1, P6 = y7); + var O7 = s8.some(m7); + v8 = []; + for (var T6 = x7; P6(T6, _6); T6 += S6) { + var A6; + if (c8) + "\\" === (A6 = String.fromCharCode(T6)) && (A6 = ""); + else if (A6 = String(T6), O7) { + var I6 = w6 - A6.length; + if (I6 > 0) { + var E6 = new Array(I6 + 1).join("0"); + A6 = T6 < 0 ? "-" + E6 + A6.slice(1) : E6 + A6; + } + } + v8.push(A6); + } + } else + v8 = n8(s8, function(e13) { + return g7(e13, false); + }); + for (var q5 = 0; q5 < v8.length; q5++) + for (var k6 = 0; k6 < $5.length; k6++) { + var M6 = j6 + v8[q5] + $5[k6]; + (!t10 || f9 || M6) && i9.push(M6); + } + return i9; + } + }, 81293: (e11) => { + "use strict"; + function t9(e12, t10, r8) { + e12 instanceof RegExp && (e12 = i8(e12, r8)), t10 instanceof RegExp && (t10 = i8(t10, r8)); + var o7 = n8(e12, t10, r8); + return o7 && { start: o7[0], end: o7[1], pre: r8.slice(0, o7[0]), body: r8.slice(o7[0] + e12.length, o7[1]), post: r8.slice(o7[1] + t10.length) }; + } + function i8(e12, t10) { + var i9 = t10.match(e12); + return i9 ? i9[0] : null; + } + function n8(e12, t10, i9) { + var n9, r8, o7, s7, a7, p7 = i9.indexOf(e12), c7 = i9.indexOf(t10, p7 + 1), d7 = p7; + if (p7 >= 0 && c7 > 0) { + if (e12 === t10) + return [p7, c7]; + for (n9 = [], o7 = i9.length; d7 >= 0 && !a7; ) + d7 == p7 ? (n9.push(d7), p7 = i9.indexOf(e12, d7 + 1)) : 1 == n9.length ? a7 = [n9.pop(), c7] : ((r8 = n9.pop()) < o7 && (o7 = r8, s7 = c7), c7 = i9.indexOf(t10, d7 + 1)), d7 = p7 < c7 && p7 >= 0 ? p7 : c7; + n9.length && (a7 = [o7, s7]); + } + return a7; + } + e11.exports = t9, t9.range = n8; + }, 1048: (e11, t9, i8) => { + "use strict"; + var n8 = i8(7991), r8 = i8(39318); + t9.hp = a7, t9.IS = 50; + var o7 = 2147483647; + function s7(e12) { + if (e12 > o7) + throw new RangeError('The value "' + e12 + '" is invalid for option "size"'); + var t10 = new Uint8Array(e12); + return t10.__proto__ = a7.prototype, t10; + } + function a7(e12, t10, i9) { + if ("number" == typeof e12) { + if ("string" == typeof t10) + throw new TypeError('The "string" argument must be of type string. Received type number'); + return d7(e12); + } + return p7(e12, t10, i9); + } + function p7(e12, t10, i9) { + if ("string" == typeof e12) + return function(e13, t11) { + if ("string" == typeof t11 && "" !== t11 || (t11 = "utf8"), !a7.isEncoding(t11)) + throw new TypeError("Unknown encoding: " + t11); + var i10 = 0 | u7(e13, t11), n10 = s7(i10), r10 = n10.write(e13, t11); + return r10 !== i10 && (n10 = n10.slice(0, r10)), n10; + }(e12, t10); + if (ArrayBuffer.isView(e12)) + return f8(e12); + if (null == e12) + throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e12); + if (F6(e12, ArrayBuffer) || e12 && F6(e12.buffer, ArrayBuffer)) + return function(e13, t11, i10) { + if (t11 < 0 || e13.byteLength < t11) + throw new RangeError('"offset" is outside of buffer bounds'); + if (e13.byteLength < t11 + (i10 || 0)) + throw new RangeError('"length" is outside of buffer bounds'); + var n10; + return (n10 = void 0 === t11 && void 0 === i10 ? new Uint8Array(e13) : void 0 === i10 ? new Uint8Array(e13, t11) : new Uint8Array(e13, t11, i10)).__proto__ = a7.prototype, n10; + }(e12, t10, i9); + if ("number" == typeof e12) + throw new TypeError('The "value" argument must not be of type number. Received type number'); + var n9 = e12.valueOf && e12.valueOf(); + if (null != n9 && n9 !== e12) + return a7.from(n9, t10, i9); + var r9 = function(e13) { + if (a7.isBuffer(e13)) { + var t11 = 0 | l7(e13.length), i10 = s7(t11); + return 0 === i10.length || e13.copy(i10, 0, 0, t11), i10; + } + return void 0 !== e13.length ? "number" != typeof e13.length || U6(e13.length) ? s7(0) : f8(e13) : "Buffer" === e13.type && Array.isArray(e13.data) ? f8(e13.data) : void 0; + }(e12); + if (r9) + return r9; + if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e12[Symbol.toPrimitive]) + return a7.from(e12[Symbol.toPrimitive]("string"), t10, i9); + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e12); + } + function c7(e12) { + if ("number" != typeof e12) + throw new TypeError('"size" argument must be of type number'); + if (e12 < 0) + throw new RangeError('The value "' + e12 + '" is invalid for option "size"'); + } + function d7(e12) { + return c7(e12), s7(e12 < 0 ? 0 : 0 | l7(e12)); + } + function f8(e12) { + for (var t10 = e12.length < 0 ? 0 : 0 | l7(e12.length), i9 = s7(t10), n9 = 0; n9 < t10; n9 += 1) + i9[n9] = 255 & e12[n9]; + return i9; + } + function l7(e12) { + if (e12 >= o7) + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o7.toString(16) + " bytes"); + return 0 | e12; + } + function u7(e12, t10) { + if (a7.isBuffer(e12)) + return e12.length; + if (ArrayBuffer.isView(e12) || F6(e12, ArrayBuffer)) + return e12.byteLength; + if ("string" != typeof e12) + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e12); + var i9 = e12.length, n9 = arguments.length > 2 && true === arguments[2]; + if (!n9 && 0 === i9) + return 0; + for (var r9 = false; ; ) + switch (t10) { + case "ascii": + case "latin1": + case "binary": + return i9; + case "utf8": + case "utf-8": + return C6(e12).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * i9; + case "hex": + return i9 >>> 1; + case "base64": + return V5(e12).length; + default: + if (r9) + return n9 ? -1 : C6(e12).length; + t10 = ("" + t10).toLowerCase(), r9 = true; + } + } + function m7(e12, t10, i9) { + var n9 = false; + if ((void 0 === t10 || t10 < 0) && (t10 = 0), t10 > this.length) + return ""; + if ((void 0 === i9 || i9 > this.length) && (i9 = this.length), i9 <= 0) + return ""; + if ((i9 >>>= 0) <= (t10 >>>= 0)) + return ""; + for (e12 || (e12 = "utf8"); ; ) + switch (e12) { + case "hex": + return A6(this, t10, i9); + case "utf8": + case "utf-8": + return S6(this, t10, i9); + case "ascii": + return O7(this, t10, i9); + case "latin1": + case "binary": + return T6(this, t10, i9); + case "base64": + return w6(this, t10, i9); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return I6(this, t10, i9); + default: + if (n9) + throw new TypeError("Unknown encoding: " + e12); + e12 = (e12 + "").toLowerCase(), n9 = true; + } + } + function h8(e12, t10, i9) { + var n9 = e12[t10]; + e12[t10] = e12[i9], e12[i9] = n9; + } + function y7(e12, t10, i9, n9, r9) { + if (0 === e12.length) + return -1; + if ("string" == typeof i9 ? (n9 = i9, i9 = 0) : i9 > 2147483647 ? i9 = 2147483647 : i9 < -2147483648 && (i9 = -2147483648), U6(i9 = +i9) && (i9 = r9 ? 0 : e12.length - 1), i9 < 0 && (i9 = e12.length + i9), i9 >= e12.length) { + if (r9) + return -1; + i9 = e12.length - 1; + } else if (i9 < 0) { + if (!r9) + return -1; + i9 = 0; + } + if ("string" == typeof t10 && (t10 = a7.from(t10, n9)), a7.isBuffer(t10)) + return 0 === t10.length ? -1 : g7(e12, t10, i9, n9, r9); + if ("number" == typeof t10) + return t10 &= 255, "function" == typeof Uint8Array.prototype.indexOf ? r9 ? Uint8Array.prototype.indexOf.call(e12, t10, i9) : Uint8Array.prototype.lastIndexOf.call(e12, t10, i9) : g7(e12, [t10], i9, n9, r9); + throw new TypeError("val must be string, number or Buffer"); + } + function g7(e12, t10, i9, n9, r9) { + var o8, s8 = 1, a8 = e12.length, p8 = t10.length; + if (void 0 !== n9 && ("ucs2" === (n9 = String(n9).toLowerCase()) || "ucs-2" === n9 || "utf16le" === n9 || "utf-16le" === n9)) { + if (e12.length < 2 || t10.length < 2) + return -1; + s8 = 2, a8 /= 2, p8 /= 2, i9 /= 2; + } + function c8(e13, t11) { + return 1 === s8 ? e13[t11] : e13.readUInt16BE(t11 * s8); + } + if (r9) { + var d8 = -1; + for (o8 = i9; o8 < a8; o8++) + if (c8(e12, o8) === c8(t10, -1 === d8 ? 0 : o8 - d8)) { + if (-1 === d8 && (d8 = o8), o8 - d8 + 1 === p8) + return d8 * s8; + } else + -1 !== d8 && (o8 -= o8 - d8), d8 = -1; + } else + for (i9 + p8 > a8 && (i9 = a8 - p8), o8 = i9; o8 >= 0; o8--) { + for (var f9 = true, l8 = 0; l8 < p8; l8++) + if (c8(e12, o8 + l8) !== c8(t10, l8)) { + f9 = false; + break; + } + if (f9) + return o8; + } + return -1; + } + function b8(e12, t10, i9, n9) { + i9 = Number(i9) || 0; + var r9 = e12.length - i9; + n9 ? (n9 = Number(n9)) > r9 && (n9 = r9) : n9 = r9; + var o8 = t10.length; + n9 > o8 / 2 && (n9 = o8 / 2); + for (var s8 = 0; s8 < n9; ++s8) { + var a8 = parseInt(t10.substr(2 * s8, 2), 16); + if (U6(a8)) + return s8; + e12[i9 + s8] = a8; + } + return s8; + } + function v8(e12, t10, i9, n9) { + return N6(C6(t10, e12.length - i9), e12, i9, n9); + } + function j6(e12, t10, i9, n9) { + return N6(function(e13) { + for (var t11 = [], i10 = 0; i10 < e13.length; ++i10) + t11.push(255 & e13.charCodeAt(i10)); + return t11; + }(t10), e12, i9, n9); + } + function $5(e12, t10, i9, n9) { + return j6(e12, t10, i9, n9); + } + function x7(e12, t10, i9, n9) { + return N6(V5(t10), e12, i9, n9); + } + function _6(e12, t10, i9, n9) { + return N6(function(e13, t11) { + for (var i10, n10, r9, o8 = [], s8 = 0; s8 < e13.length && !((t11 -= 2) < 0); ++s8) + n10 = (i10 = e13.charCodeAt(s8)) >> 8, r9 = i10 % 256, o8.push(r9), o8.push(n10); + return o8; + }(t10, e12.length - i9), e12, i9, n9); + } + function w6(e12, t10, i9) { + return 0 === t10 && i9 === e12.length ? n8.fromByteArray(e12) : n8.fromByteArray(e12.slice(t10, i9)); + } + function S6(e12, t10, i9) { + i9 = Math.min(e12.length, i9); + for (var n9 = [], r9 = t10; r9 < i9; ) { + var o8, s8, a8, p8, c8 = e12[r9], d8 = null, f9 = c8 > 239 ? 4 : c8 > 223 ? 3 : c8 > 191 ? 2 : 1; + if (r9 + f9 <= i9) + switch (f9) { + case 1: + c8 < 128 && (d8 = c8); + break; + case 2: + 128 == (192 & (o8 = e12[r9 + 1])) && (p8 = (31 & c8) << 6 | 63 & o8) > 127 && (d8 = p8); + break; + case 3: + o8 = e12[r9 + 1], s8 = e12[r9 + 2], 128 == (192 & o8) && 128 == (192 & s8) && (p8 = (15 & c8) << 12 | (63 & o8) << 6 | 63 & s8) > 2047 && (p8 < 55296 || p8 > 57343) && (d8 = p8); + break; + case 4: + o8 = e12[r9 + 1], s8 = e12[r9 + 2], a8 = e12[r9 + 3], 128 == (192 & o8) && 128 == (192 & s8) && 128 == (192 & a8) && (p8 = (15 & c8) << 18 | (63 & o8) << 12 | (63 & s8) << 6 | 63 & a8) > 65535 && p8 < 1114112 && (d8 = p8); + } + null === d8 ? (d8 = 65533, f9 = 1) : d8 > 65535 && (d8 -= 65536, n9.push(d8 >>> 10 & 1023 | 55296), d8 = 56320 | 1023 & d8), n9.push(d8), r9 += f9; + } + return function(e13) { + var t11 = e13.length; + if (t11 <= P6) + return String.fromCharCode.apply(String, e13); + for (var i10 = "", n10 = 0; n10 < t11; ) + i10 += String.fromCharCode.apply(String, e13.slice(n10, n10 += P6)); + return i10; + }(n9); + } + a7.TYPED_ARRAY_SUPPORT = function() { + try { + var e12 = new Uint8Array(1); + return e12.__proto__ = { __proto__: Uint8Array.prototype, foo: function() { + return 42; + } }, 42 === e12.foo(); + } catch (e13) { + return false; + } + }(), a7.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(a7.prototype, "parent", { enumerable: true, get: function() { + if (a7.isBuffer(this)) + return this.buffer; + } }), Object.defineProperty(a7.prototype, "offset", { enumerable: true, get: function() { + if (a7.isBuffer(this)) + return this.byteOffset; + } }), "undefined" != typeof Symbol && null != Symbol.species && a7[Symbol.species] === a7 && Object.defineProperty(a7, Symbol.species, { value: null, configurable: true, enumerable: false, writable: false }), a7.poolSize = 8192, a7.from = function(e12, t10, i9) { + return p7(e12, t10, i9); + }, a7.prototype.__proto__ = Uint8Array.prototype, a7.__proto__ = Uint8Array, a7.alloc = function(e12, t10, i9) { + return function(e13, t11, i10) { + return c7(e13), e13 <= 0 ? s7(e13) : void 0 !== t11 ? "string" == typeof i10 ? s7(e13).fill(t11, i10) : s7(e13).fill(t11) : s7(e13); + }(e12, t10, i9); + }, a7.allocUnsafe = function(e12) { + return d7(e12); + }, a7.allocUnsafeSlow = function(e12) { + return d7(e12); + }, a7.isBuffer = function(e12) { + return null != e12 && true === e12._isBuffer && e12 !== a7.prototype; + }, a7.compare = function(e12, t10) { + if (F6(e12, Uint8Array) && (e12 = a7.from(e12, e12.offset, e12.byteLength)), F6(t10, Uint8Array) && (t10 = a7.from(t10, t10.offset, t10.byteLength)), !a7.isBuffer(e12) || !a7.isBuffer(t10)) + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + if (e12 === t10) + return 0; + for (var i9 = e12.length, n9 = t10.length, r9 = 0, o8 = Math.min(i9, n9); r9 < o8; ++r9) + if (e12[r9] !== t10[r9]) { + i9 = e12[r9], n9 = t10[r9]; + break; + } + return i9 < n9 ? -1 : n9 < i9 ? 1 : 0; + }, a7.isEncoding = function(e12) { + switch (String(e12).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }, a7.concat = function(e12, t10) { + if (!Array.isArray(e12)) + throw new TypeError('"list" argument must be an Array of Buffers'); + if (0 === e12.length) + return a7.alloc(0); + var i9; + if (void 0 === t10) + for (t10 = 0, i9 = 0; i9 < e12.length; ++i9) + t10 += e12[i9].length; + var n9 = a7.allocUnsafe(t10), r9 = 0; + for (i9 = 0; i9 < e12.length; ++i9) { + var o8 = e12[i9]; + if (F6(o8, Uint8Array) && (o8 = a7.from(o8)), !a7.isBuffer(o8)) + throw new TypeError('"list" argument must be an Array of Buffers'); + o8.copy(n9, r9), r9 += o8.length; + } + return n9; + }, a7.byteLength = u7, a7.prototype._isBuffer = true, a7.prototype.swap16 = function() { + var e12 = this.length; + if (e12 % 2 != 0) + throw new RangeError("Buffer size must be a multiple of 16-bits"); + for (var t10 = 0; t10 < e12; t10 += 2) + h8(this, t10, t10 + 1); + return this; + }, a7.prototype.swap32 = function() { + var e12 = this.length; + if (e12 % 4 != 0) + throw new RangeError("Buffer size must be a multiple of 32-bits"); + for (var t10 = 0; t10 < e12; t10 += 4) + h8(this, t10, t10 + 3), h8(this, t10 + 1, t10 + 2); + return this; + }, a7.prototype.swap64 = function() { + var e12 = this.length; + if (e12 % 8 != 0) + throw new RangeError("Buffer size must be a multiple of 64-bits"); + for (var t10 = 0; t10 < e12; t10 += 8) + h8(this, t10, t10 + 7), h8(this, t10 + 1, t10 + 6), h8(this, t10 + 2, t10 + 5), h8(this, t10 + 3, t10 + 4); + return this; + }, a7.prototype.toString = function() { + var e12 = this.length; + return 0 === e12 ? "" : 0 === arguments.length ? S6(this, 0, e12) : m7.apply(this, arguments); + }, a7.prototype.toLocaleString = a7.prototype.toString, a7.prototype.equals = function(e12) { + if (!a7.isBuffer(e12)) + throw new TypeError("Argument must be a Buffer"); + return this === e12 || 0 === a7.compare(this, e12); + }, a7.prototype.inspect = function() { + var e12 = "", i9 = t9.IS; + return e12 = this.toString("hex", 0, i9).replace(/(.{2})/g, "$1 ").trim(), this.length > i9 && (e12 += " ... "), ""; + }, a7.prototype.compare = function(e12, t10, i9, n9, r9) { + if (F6(e12, Uint8Array) && (e12 = a7.from(e12, e12.offset, e12.byteLength)), !a7.isBuffer(e12)) + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e12); + if (void 0 === t10 && (t10 = 0), void 0 === i9 && (i9 = e12 ? e12.length : 0), void 0 === n9 && (n9 = 0), void 0 === r9 && (r9 = this.length), t10 < 0 || i9 > e12.length || n9 < 0 || r9 > this.length) + throw new RangeError("out of range index"); + if (n9 >= r9 && t10 >= i9) + return 0; + if (n9 >= r9) + return -1; + if (t10 >= i9) + return 1; + if (this === e12) + return 0; + for (var o8 = (r9 >>>= 0) - (n9 >>>= 0), s8 = (i9 >>>= 0) - (t10 >>>= 0), p8 = Math.min(o8, s8), c8 = this.slice(n9, r9), d8 = e12.slice(t10, i9), f9 = 0; f9 < p8; ++f9) + if (c8[f9] !== d8[f9]) { + o8 = c8[f9], s8 = d8[f9]; + break; + } + return o8 < s8 ? -1 : s8 < o8 ? 1 : 0; + }, a7.prototype.includes = function(e12, t10, i9) { + return -1 !== this.indexOf(e12, t10, i9); + }, a7.prototype.indexOf = function(e12, t10, i9) { + return y7(this, e12, t10, i9, true); + }, a7.prototype.lastIndexOf = function(e12, t10, i9) { + return y7(this, e12, t10, i9, false); + }, a7.prototype.write = function(e12, t10, i9, n9) { + if (void 0 === t10) + n9 = "utf8", i9 = this.length, t10 = 0; + else if (void 0 === i9 && "string" == typeof t10) + n9 = t10, i9 = this.length, t10 = 0; + else { + if (!isFinite(t10)) + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + t10 >>>= 0, isFinite(i9) ? (i9 >>>= 0, void 0 === n9 && (n9 = "utf8")) : (n9 = i9, i9 = void 0); + } + var r9 = this.length - t10; + if ((void 0 === i9 || i9 > r9) && (i9 = r9), e12.length > 0 && (i9 < 0 || t10 < 0) || t10 > this.length) + throw new RangeError("Attempt to write outside buffer bounds"); + n9 || (n9 = "utf8"); + for (var o8 = false; ; ) + switch (n9) { + case "hex": + return b8(this, e12, t10, i9); + case "utf8": + case "utf-8": + return v8(this, e12, t10, i9); + case "ascii": + return j6(this, e12, t10, i9); + case "latin1": + case "binary": + return $5(this, e12, t10, i9); + case "base64": + return x7(this, e12, t10, i9); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return _6(this, e12, t10, i9); + default: + if (o8) + throw new TypeError("Unknown encoding: " + n9); + n9 = ("" + n9).toLowerCase(), o8 = true; + } + }, a7.prototype.toJSON = function() { + return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; + }; + var P6 = 4096; + function O7(e12, t10, i9) { + var n9 = ""; + i9 = Math.min(e12.length, i9); + for (var r9 = t10; r9 < i9; ++r9) + n9 += String.fromCharCode(127 & e12[r9]); + return n9; + } + function T6(e12, t10, i9) { + var n9 = ""; + i9 = Math.min(e12.length, i9); + for (var r9 = t10; r9 < i9; ++r9) + n9 += String.fromCharCode(e12[r9]); + return n9; + } + function A6(e12, t10, i9) { + var n9, r9 = e12.length; + (!t10 || t10 < 0) && (t10 = 0), (!i9 || i9 < 0 || i9 > r9) && (i9 = r9); + for (var o8 = "", s8 = t10; s8 < i9; ++s8) + o8 += (n9 = e12[s8]) < 16 ? "0" + n9.toString(16) : n9.toString(16); + return o8; + } + function I6(e12, t10, i9) { + for (var n9 = e12.slice(t10, i9), r9 = "", o8 = 0; o8 < n9.length; o8 += 2) + r9 += String.fromCharCode(n9[o8] + 256 * n9[o8 + 1]); + return r9; + } + function E6(e12, t10, i9) { + if (e12 % 1 != 0 || e12 < 0) + throw new RangeError("offset is not uint"); + if (e12 + t10 > i9) + throw new RangeError("Trying to access beyond buffer length"); + } + function q5(e12, t10, i9, n9, r9, o8) { + if (!a7.isBuffer(e12)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (t10 > r9 || t10 < o8) + throw new RangeError('"value" argument is out of bounds'); + if (i9 + n9 > e12.length) + throw new RangeError("Index out of range"); + } + function k6(e12, t10, i9, n9, r9, o8) { + if (i9 + n9 > e12.length) + throw new RangeError("Index out of range"); + if (i9 < 0) + throw new RangeError("Index out of range"); + } + function M6(e12, t10, i9, n9, o8) { + return t10 = +t10, i9 >>>= 0, o8 || k6(e12, 0, i9, 4), r8.write(e12, t10, i9, n9, 23, 4), i9 + 4; + } + function R6(e12, t10, i9, n9, o8) { + return t10 = +t10, i9 >>>= 0, o8 || k6(e12, 0, i9, 8), r8.write(e12, t10, i9, n9, 52, 8), i9 + 8; + } + a7.prototype.slice = function(e12, t10) { + var i9 = this.length; + (e12 = ~~e12) < 0 ? (e12 += i9) < 0 && (e12 = 0) : e12 > i9 && (e12 = i9), (t10 = void 0 === t10 ? i9 : ~~t10) < 0 ? (t10 += i9) < 0 && (t10 = 0) : t10 > i9 && (t10 = i9), t10 < e12 && (t10 = e12); + var n9 = this.subarray(e12, t10); + return n9.__proto__ = a7.prototype, n9; + }, a7.prototype.readUIntLE = function(e12, t10, i9) { + e12 >>>= 0, t10 >>>= 0, i9 || E6(e12, t10, this.length); + for (var n9 = this[e12], r9 = 1, o8 = 0; ++o8 < t10 && (r9 *= 256); ) + n9 += this[e12 + o8] * r9; + return n9; + }, a7.prototype.readUIntBE = function(e12, t10, i9) { + e12 >>>= 0, t10 >>>= 0, i9 || E6(e12, t10, this.length); + for (var n9 = this[e12 + --t10], r9 = 1; t10 > 0 && (r9 *= 256); ) + n9 += this[e12 + --t10] * r9; + return n9; + }, a7.prototype.readUInt8 = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 1, this.length), this[e12]; + }, a7.prototype.readUInt16LE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 2, this.length), this[e12] | this[e12 + 1] << 8; + }, a7.prototype.readUInt16BE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 2, this.length), this[e12] << 8 | this[e12 + 1]; + }, a7.prototype.readUInt32LE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), (this[e12] | this[e12 + 1] << 8 | this[e12 + 2] << 16) + 16777216 * this[e12 + 3]; + }, a7.prototype.readUInt32BE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), 16777216 * this[e12] + (this[e12 + 1] << 16 | this[e12 + 2] << 8 | this[e12 + 3]); + }, a7.prototype.readIntLE = function(e12, t10, i9) { + e12 >>>= 0, t10 >>>= 0, i9 || E6(e12, t10, this.length); + for (var n9 = this[e12], r9 = 1, o8 = 0; ++o8 < t10 && (r9 *= 256); ) + n9 += this[e12 + o8] * r9; + return n9 >= (r9 *= 128) && (n9 -= Math.pow(2, 8 * t10)), n9; + }, a7.prototype.readIntBE = function(e12, t10, i9) { + e12 >>>= 0, t10 >>>= 0, i9 || E6(e12, t10, this.length); + for (var n9 = t10, r9 = 1, o8 = this[e12 + --n9]; n9 > 0 && (r9 *= 256); ) + o8 += this[e12 + --n9] * r9; + return o8 >= (r9 *= 128) && (o8 -= Math.pow(2, 8 * t10)), o8; + }, a7.prototype.readInt8 = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 1, this.length), 128 & this[e12] ? -1 * (255 - this[e12] + 1) : this[e12]; + }, a7.prototype.readInt16LE = function(e12, t10) { + e12 >>>= 0, t10 || E6(e12, 2, this.length); + var i9 = this[e12] | this[e12 + 1] << 8; + return 32768 & i9 ? 4294901760 | i9 : i9; + }, a7.prototype.readInt16BE = function(e12, t10) { + e12 >>>= 0, t10 || E6(e12, 2, this.length); + var i9 = this[e12 + 1] | this[e12] << 8; + return 32768 & i9 ? 4294901760 | i9 : i9; + }, a7.prototype.readInt32LE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), this[e12] | this[e12 + 1] << 8 | this[e12 + 2] << 16 | this[e12 + 3] << 24; + }, a7.prototype.readInt32BE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), this[e12] << 24 | this[e12 + 1] << 16 | this[e12 + 2] << 8 | this[e12 + 3]; + }, a7.prototype.readFloatLE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), r8.read(this, e12, true, 23, 4); + }, a7.prototype.readFloatBE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 4, this.length), r8.read(this, e12, false, 23, 4); + }, a7.prototype.readDoubleLE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 8, this.length), r8.read(this, e12, true, 52, 8); + }, a7.prototype.readDoubleBE = function(e12, t10) { + return e12 >>>= 0, t10 || E6(e12, 8, this.length), r8.read(this, e12, false, 52, 8); + }, a7.prototype.writeUIntLE = function(e12, t10, i9, n9) { + e12 = +e12, t10 >>>= 0, i9 >>>= 0, n9 || q5(this, e12, t10, i9, Math.pow(2, 8 * i9) - 1, 0); + var r9 = 1, o8 = 0; + for (this[t10] = 255 & e12; ++o8 < i9 && (r9 *= 256); ) + this[t10 + o8] = e12 / r9 & 255; + return t10 + i9; + }, a7.prototype.writeUIntBE = function(e12, t10, i9, n9) { + e12 = +e12, t10 >>>= 0, i9 >>>= 0, n9 || q5(this, e12, t10, i9, Math.pow(2, 8 * i9) - 1, 0); + var r9 = i9 - 1, o8 = 1; + for (this[t10 + r9] = 255 & e12; --r9 >= 0 && (o8 *= 256); ) + this[t10 + r9] = e12 / o8 & 255; + return t10 + i9; + }, a7.prototype.writeUInt8 = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 1, 255, 0), this[t10] = 255 & e12, t10 + 1; + }, a7.prototype.writeUInt16LE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 2, 65535, 0), this[t10] = 255 & e12, this[t10 + 1] = e12 >>> 8, t10 + 2; + }, a7.prototype.writeUInt16BE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 2, 65535, 0), this[t10] = e12 >>> 8, this[t10 + 1] = 255 & e12, t10 + 2; + }, a7.prototype.writeUInt32LE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 4, 4294967295, 0), this[t10 + 3] = e12 >>> 24, this[t10 + 2] = e12 >>> 16, this[t10 + 1] = e12 >>> 8, this[t10] = 255 & e12, t10 + 4; + }, a7.prototype.writeUInt32BE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 4, 4294967295, 0), this[t10] = e12 >>> 24, this[t10 + 1] = e12 >>> 16, this[t10 + 2] = e12 >>> 8, this[t10 + 3] = 255 & e12, t10 + 4; + }, a7.prototype.writeIntLE = function(e12, t10, i9, n9) { + if (e12 = +e12, t10 >>>= 0, !n9) { + var r9 = Math.pow(2, 8 * i9 - 1); + q5(this, e12, t10, i9, r9 - 1, -r9); + } + var o8 = 0, s8 = 1, a8 = 0; + for (this[t10] = 255 & e12; ++o8 < i9 && (s8 *= 256); ) + e12 < 0 && 0 === a8 && 0 !== this[t10 + o8 - 1] && (a8 = 1), this[t10 + o8] = (e12 / s8 | 0) - a8 & 255; + return t10 + i9; + }, a7.prototype.writeIntBE = function(e12, t10, i9, n9) { + if (e12 = +e12, t10 >>>= 0, !n9) { + var r9 = Math.pow(2, 8 * i9 - 1); + q5(this, e12, t10, i9, r9 - 1, -r9); + } + var o8 = i9 - 1, s8 = 1, a8 = 0; + for (this[t10 + o8] = 255 & e12; --o8 >= 0 && (s8 *= 256); ) + e12 < 0 && 0 === a8 && 0 !== this[t10 + o8 + 1] && (a8 = 1), this[t10 + o8] = (e12 / s8 | 0) - a8 & 255; + return t10 + i9; + }, a7.prototype.writeInt8 = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 1, 127, -128), e12 < 0 && (e12 = 255 + e12 + 1), this[t10] = 255 & e12, t10 + 1; + }, a7.prototype.writeInt16LE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 2, 32767, -32768), this[t10] = 255 & e12, this[t10 + 1] = e12 >>> 8, t10 + 2; + }, a7.prototype.writeInt16BE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 2, 32767, -32768), this[t10] = e12 >>> 8, this[t10 + 1] = 255 & e12, t10 + 2; + }, a7.prototype.writeInt32LE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 4, 2147483647, -2147483648), this[t10] = 255 & e12, this[t10 + 1] = e12 >>> 8, this[t10 + 2] = e12 >>> 16, this[t10 + 3] = e12 >>> 24, t10 + 4; + }, a7.prototype.writeInt32BE = function(e12, t10, i9) { + return e12 = +e12, t10 >>>= 0, i9 || q5(this, e12, t10, 4, 2147483647, -2147483648), e12 < 0 && (e12 = 4294967295 + e12 + 1), this[t10] = e12 >>> 24, this[t10 + 1] = e12 >>> 16, this[t10 + 2] = e12 >>> 8, this[t10 + 3] = 255 & e12, t10 + 4; + }, a7.prototype.writeFloatLE = function(e12, t10, i9) { + return M6(this, e12, t10, true, i9); + }, a7.prototype.writeFloatBE = function(e12, t10, i9) { + return M6(this, e12, t10, false, i9); + }, a7.prototype.writeDoubleLE = function(e12, t10, i9) { + return R6(this, e12, t10, true, i9); + }, a7.prototype.writeDoubleBE = function(e12, t10, i9) { + return R6(this, e12, t10, false, i9); + }, a7.prototype.copy = function(e12, t10, i9, n9) { + if (!a7.isBuffer(e12)) + throw new TypeError("argument should be a Buffer"); + if (i9 || (i9 = 0), n9 || 0 === n9 || (n9 = this.length), t10 >= e12.length && (t10 = e12.length), t10 || (t10 = 0), n9 > 0 && n9 < i9 && (n9 = i9), n9 === i9) + return 0; + if (0 === e12.length || 0 === this.length) + return 0; + if (t10 < 0) + throw new RangeError("targetStart out of bounds"); + if (i9 < 0 || i9 >= this.length) + throw new RangeError("Index out of range"); + if (n9 < 0) + throw new RangeError("sourceEnd out of bounds"); + n9 > this.length && (n9 = this.length), e12.length - t10 < n9 - i9 && (n9 = e12.length - t10 + i9); + var r9 = n9 - i9; + if (this === e12 && "function" == typeof Uint8Array.prototype.copyWithin) + this.copyWithin(t10, i9, n9); + else if (this === e12 && i9 < t10 && t10 < n9) + for (var o8 = r9 - 1; o8 >= 0; --o8) + e12[o8 + t10] = this[o8 + i9]; + else + Uint8Array.prototype.set.call(e12, this.subarray(i9, n9), t10); + return r9; + }, a7.prototype.fill = function(e12, t10, i9, n9) { + if ("string" == typeof e12) { + if ("string" == typeof t10 ? (n9 = t10, t10 = 0, i9 = this.length) : "string" == typeof i9 && (n9 = i9, i9 = this.length), void 0 !== n9 && "string" != typeof n9) + throw new TypeError("encoding must be a string"); + if ("string" == typeof n9 && !a7.isEncoding(n9)) + throw new TypeError("Unknown encoding: " + n9); + if (1 === e12.length) { + var r9 = e12.charCodeAt(0); + ("utf8" === n9 && r9 < 128 || "latin1" === n9) && (e12 = r9); + } + } else + "number" == typeof e12 && (e12 &= 255); + if (t10 < 0 || this.length < t10 || this.length < i9) + throw new RangeError("Out of range index"); + if (i9 <= t10) + return this; + var o8; + if (t10 >>>= 0, i9 = void 0 === i9 ? this.length : i9 >>> 0, e12 || (e12 = 0), "number" == typeof e12) + for (o8 = t10; o8 < i9; ++o8) + this[o8] = e12; + else { + var s8 = a7.isBuffer(e12) ? e12 : a7.from(e12, n9), p8 = s8.length; + if (0 === p8) + throw new TypeError('The value "' + e12 + '" is invalid for argument "value"'); + for (o8 = 0; o8 < i9 - t10; ++o8) + this[o8 + t10] = s8[o8 % p8]; + } + return this; + }; + var D6 = /[^+/0-9A-Za-z-_]/g; + function C6(e12, t10) { + var i9; + t10 = t10 || 1 / 0; + for (var n9 = e12.length, r9 = null, o8 = [], s8 = 0; s8 < n9; ++s8) { + if ((i9 = e12.charCodeAt(s8)) > 55295 && i9 < 57344) { + if (!r9) { + if (i9 > 56319) { + (t10 -= 3) > -1 && o8.push(239, 191, 189); + continue; + } + if (s8 + 1 === n9) { + (t10 -= 3) > -1 && o8.push(239, 191, 189); + continue; + } + r9 = i9; + continue; + } + if (i9 < 56320) { + (t10 -= 3) > -1 && o8.push(239, 191, 189), r9 = i9; + continue; + } + i9 = 65536 + (r9 - 55296 << 10 | i9 - 56320); + } else + r9 && (t10 -= 3) > -1 && o8.push(239, 191, 189); + if (r9 = null, i9 < 128) { + if ((t10 -= 1) < 0) + break; + o8.push(i9); + } else if (i9 < 2048) { + if ((t10 -= 2) < 0) + break; + o8.push(i9 >> 6 | 192, 63 & i9 | 128); + } else if (i9 < 65536) { + if ((t10 -= 3) < 0) + break; + o8.push(i9 >> 12 | 224, i9 >> 6 & 63 | 128, 63 & i9 | 128); + } else { + if (!(i9 < 1114112)) + throw new Error("Invalid code point"); + if ((t10 -= 4) < 0) + break; + o8.push(i9 >> 18 | 240, i9 >> 12 & 63 | 128, i9 >> 6 & 63 | 128, 63 & i9 | 128); + } + } + return o8; + } + function V5(e12) { + return n8.toByteArray(function(e13) { + if ((e13 = (e13 = e13.split("=")[0]).trim().replace(D6, "")).length < 2) + return ""; + for (; e13.length % 4 != 0; ) + e13 += "="; + return e13; + }(e12)); + } + function N6(e12, t10, i9, n9) { + for (var r9 = 0; r9 < n9 && !(r9 + i9 >= t10.length || r9 >= e12.length); ++r9) + t10[r9 + i9] = e12[r9]; + return r9; + } + function F6(e12, t10) { + return e12 instanceof t10 || null != e12 && null != e12.constructor && null != e12.constructor.name && e12.constructor.name === t10.name; + } + function U6(e12) { + return e12 != e12; + } + }, 79818: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(28498), o7 = r8(n8("String.prototype.indexOf")); + e11.exports = function(e12, t10) { + var i9 = n8(e12, !!t10); + return "function" == typeof i9 && o7(e12, ".prototype.") > -1 ? r8(i9) : i9; + }; + }, 28498: (e11, t9, i8) => { + "use strict"; + var n8 = i8(79138), r8 = i8(528), o7 = i8(26108), s7 = i8(3468), a7 = r8("%Function.prototype.apply%"), p7 = r8("%Function.prototype.call%"), c7 = r8("%Reflect.apply%", true) || n8.call(p7, a7), d7 = i8(64940), f8 = r8("%Math.max%"); + e11.exports = function(e12) { + if ("function" != typeof e12) + throw new s7("a function is required"); + var t10 = c7(n8, p7, arguments); + return o7(t10, 1 + f8(0, e12.length - (arguments.length - 1)), true); + }; + var l7 = function() { + return c7(n8, a7, arguments); + }; + d7 ? d7(e11.exports, "apply", { value: l7 }) : e11.exports.apply = l7; + }, 55837: (e11) => { + e11.exports = function(e12, i8) { + for (var n8 = [], r8 = 0; r8 < e12.length; r8++) { + var o7 = i8(e12[r8], r8); + t9(o7) ? n8.push.apply(n8, o7) : n8.push(o7); + } + return n8; + }; + var t9 = Array.isArray || function(e12) { + return "[object Array]" === Object.prototype.toString.call(e12); + }; + }, 70686: (e11, t9, i8) => { + "use strict"; + var n8 = i8(64940), r8 = i8(5731), o7 = i8(3468), s7 = i8(69336); + e11.exports = function(e12, t10, i9) { + if (!e12 || "object" != typeof e12 && "function" != typeof e12) + throw new o7("`obj` must be an object or a function`"); + if ("string" != typeof t10 && "symbol" != typeof t10) + throw new o7("`property` must be a string or a symbol`"); + if (arguments.length > 3 && "boolean" != typeof arguments[3] && null !== arguments[3]) + throw new o7("`nonEnumerable`, if provided, must be a boolean or null"); + if (arguments.length > 4 && "boolean" != typeof arguments[4] && null !== arguments[4]) + throw new o7("`nonWritable`, if provided, must be a boolean or null"); + if (arguments.length > 5 && "boolean" != typeof arguments[5] && null !== arguments[5]) + throw new o7("`nonConfigurable`, if provided, must be a boolean or null"); + if (arguments.length > 6 && "boolean" != typeof arguments[6]) + throw new o7("`loose`, if provided, must be a boolean"); + var a7 = arguments.length > 3 ? arguments[3] : null, p7 = arguments.length > 4 ? arguments[4] : null, c7 = arguments.length > 5 ? arguments[5] : null, d7 = arguments.length > 6 && arguments[6], f8 = !!s7 && s7(e12, t10); + if (n8) + n8(e12, t10, { configurable: null === c7 && f8 ? f8.configurable : !c7, enumerable: null === a7 && f8 ? f8.enumerable : !a7, value: i9, writable: null === p7 && f8 ? f8.writable : !p7 }); + else { + if (!d7 && (a7 || p7 || c7)) + throw new r8("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + e12[t10] = i9; + } + }; + }, 41857: (e11, t9, i8) => { + "use strict"; + var n8 = i8(49228), r8 = "function" == typeof Symbol && "symbol" == typeof Symbol("foo"), o7 = Object.prototype.toString, s7 = Array.prototype.concat, a7 = i8(70686), p7 = i8(17239)(), c7 = function(e12, t10, i9, n9) { + if (t10 in e12) { + if (true === n9) { + if (e12[t10] === i9) + return; + } else if ("function" != typeof (r9 = n9) || "[object Function]" !== o7.call(r9) || !n9()) + return; + } + var r9; + p7 ? a7(e12, t10, i9, true) : a7(e12, t10, i9); + }, d7 = function(e12, t10) { + var i9 = arguments.length > 2 ? arguments[2] : {}, o8 = n8(t10); + r8 && (o8 = s7.call(o8, Object.getOwnPropertySymbols(t10))); + for (var a8 = 0; a8 < o8.length; a8 += 1) + c7(e12, o8[a8], t10[o8[a8]], i9[o8[a8]]); + }; + d7.supportsDescriptors = !!p7, e11.exports = d7; + }, 30524: (e11, t9) => { + function i8(e12, t10, i9, n9) { + var o7 = {}; + return function(s7) { + if (!o7[s7]) { + var a7 = {}, p7 = [], c7 = []; + for (c7.push({ node: s7, processed: false }); c7.length > 0; ) { + var d7 = c7[c7.length - 1], f8 = d7.processed, l7 = d7.node; + if (f8) + c7.pop(), p7.pop(), a7[l7] = false, o7[l7] = true, t10 && 0 !== e12[l7].length || i9.push(l7); + else { + if (o7[l7]) { + c7.pop(); + continue; + } + if (a7[l7]) { + if (n9) { + c7.pop(); + continue; + } + throw p7.push(l7), new r8(p7); + } + a7[l7] = true, p7.push(l7); + for (var u7 = e12[l7], m7 = u7.length - 1; m7 >= 0; m7--) + c7.push({ node: u7[m7], processed: false }); + d7.processed = true; + } + } + } + }; + } + var n8 = t9.DepGraph = function(e12) { + this.nodes = {}, this.outgoingEdges = {}, this.incomingEdges = {}, this.circular = e12 && !!e12.circular; + }; + n8.prototype = { size: function() { + return Object.keys(this.nodes).length; + }, addNode: function(e12, t10) { + this.hasNode(e12) || (this.nodes[e12] = 2 === arguments.length ? t10 : e12, this.outgoingEdges[e12] = [], this.incomingEdges[e12] = []); + }, removeNode: function(e12) { + this.hasNode(e12) && (delete this.nodes[e12], delete this.outgoingEdges[e12], delete this.incomingEdges[e12], [this.incomingEdges, this.outgoingEdges].forEach(function(t10) { + Object.keys(t10).forEach(function(i9) { + var n9 = t10[i9].indexOf(e12); + n9 >= 0 && t10[i9].splice(n9, 1); + }, this); + })); + }, hasNode: function(e12) { + return this.nodes.hasOwnProperty(e12); + }, getNodeData: function(e12) { + if (this.hasNode(e12)) + return this.nodes[e12]; + throw new Error("Node does not exist: " + e12); + }, setNodeData: function(e12, t10) { + if (!this.hasNode(e12)) + throw new Error("Node does not exist: " + e12); + this.nodes[e12] = t10; + }, addDependency: function(e12, t10) { + if (!this.hasNode(e12)) + throw new Error("Node does not exist: " + e12); + if (!this.hasNode(t10)) + throw new Error("Node does not exist: " + t10); + return -1 === this.outgoingEdges[e12].indexOf(t10) && this.outgoingEdges[e12].push(t10), -1 === this.incomingEdges[t10].indexOf(e12) && this.incomingEdges[t10].push(e12), true; + }, removeDependency: function(e12, t10) { + var i9; + this.hasNode(e12) && (i9 = this.outgoingEdges[e12].indexOf(t10)) >= 0 && this.outgoingEdges[e12].splice(i9, 1), this.hasNode(t10) && (i9 = this.incomingEdges[t10].indexOf(e12)) >= 0 && this.incomingEdges[t10].splice(i9, 1); + }, clone: function() { + var e12 = this, t10 = new n8(); + return Object.keys(e12.nodes).forEach(function(i9) { + t10.nodes[i9] = e12.nodes[i9], t10.outgoingEdges[i9] = e12.outgoingEdges[i9].slice(0), t10.incomingEdges[i9] = e12.incomingEdges[i9].slice(0); + }), t10; + }, directDependenciesOf: function(e12) { + if (this.hasNode(e12)) + return this.outgoingEdges[e12].slice(0); + throw new Error("Node does not exist: " + e12); + }, directDependantsOf: function(e12) { + if (this.hasNode(e12)) + return this.incomingEdges[e12].slice(0); + throw new Error("Node does not exist: " + e12); + }, dependenciesOf: function(e12, t10) { + if (this.hasNode(e12)) { + var n9 = []; + i8(this.outgoingEdges, t10, n9, this.circular)(e12); + var r9 = n9.indexOf(e12); + return r9 >= 0 && n9.splice(r9, 1), n9; + } + throw new Error("Node does not exist: " + e12); + }, dependantsOf: function(e12, t10) { + if (this.hasNode(e12)) { + var n9 = []; + i8(this.incomingEdges, t10, n9, this.circular)(e12); + var r9 = n9.indexOf(e12); + return r9 >= 0 && n9.splice(r9, 1), n9; + } + throw new Error("Node does not exist: " + e12); + }, overallOrder: function(e12) { + var t10 = this, n9 = [], r9 = Object.keys(this.nodes); + if (0 === r9.length) + return n9; + if (!this.circular) { + var o7 = i8(this.outgoingEdges, false, [], this.circular); + r9.forEach(function(e13) { + o7(e13); + }); + } + var s7 = i8(this.outgoingEdges, e12, n9, this.circular); + return r9.filter(function(e13) { + return 0 === t10.incomingEdges[e13].length; + }).forEach(function(e13) { + s7(e13); + }), this.circular && r9.filter(function(e13) { + return -1 === n9.indexOf(e13); + }).forEach(function(e13) { + s7(e13); + }), n9; + }, entryNodes: function() { + var e12 = this; + return Object.keys(this.nodes).filter(function(t10) { + return 0 === e12.incomingEdges[t10].length; + }); + } }, n8.prototype.directDependentsOf = n8.prototype.directDependantsOf, n8.prototype.dependentsOf = n8.prototype.dependantsOf; + var r8 = t9.DepGraphCycleError = function(e12) { + var t10 = "Dependency Cycle Found: " + e12.join(" -> "), i9 = new Error(t10); + return i9.cyclePath = e12, Object.setPrototypeOf(i9, Object.getPrototypeOf(this)), Error.captureStackTrace && Error.captureStackTrace(i9, r8), i9; + }; + r8.prototype = Object.create(Error.prototype, { constructor: { value: Error, enumerable: false, writable: true, configurable: true } }), Object.setPrototypeOf(r8, Error); + }, 71401: (e11, t9, i8) => { + "use strict"; + var n8 = i8(10207), r8 = i8(78464), o7 = i8(22693), s7 = i8(17239)(), a7 = i8(51192), p7 = i8(29954), c7 = i8(29838); + function d7(e12, t10) { + var i9 = new c7(t10); + p7(i9, f8), delete i9.constructor; + var r9 = a7(o7(e12, "SYNC")); + return n8(i9, "errors", r9), i9; + } + s7 && Object.defineProperty(d7, "prototype", { writable: false }); + var f8 = d7.prototype; + if (!r8(f8, "constructor", d7) || !r8(f8, "message", "") || !r8(f8, "name", "AggregateError")) + throw new c7("unable to install AggregateError.prototype properties; please report this!"); + p7(d7.prototype, Error.prototype), e11.exports = d7; + }, 99639: (e11, t9, i8) => { + "use strict"; + var n8 = i8(79138), r8 = i8(41857), o7 = i8(19343), s7 = i8(70686), a7 = i8(71401), p7 = i8(68604), c7 = i8(66614), d7 = p7(), f8 = o7(n8.call(d7), d7.name, true); + s7(f8, "prototype", d7.prototype, true, true, true, true), r8(f8, { getPolyfill: p7, implementation: a7, shim: c7 }), e11.exports = f8; + }, 68604: (e11, t9, i8) => { + "use strict"; + var n8 = i8(71401); + e11.exports = function() { + return "function" == typeof AggregateError ? AggregateError : n8; + }; + }, 66614: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41857), r8 = i8(6541)(), o7 = i8(68604); + e11.exports = function() { + var e12 = o7(); + return n8(r8, { AggregateError: e12 }, { AggregateError: function() { + return r8.AggregateError !== e12; + } }), e12; + }; + }, 64940: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Object.defineProperty%", true) || false; + if (n8) + try { + n8({}, "a", { value: 1 }); + } catch (e12) { + n8 = false; + } + e11.exports = n8; + }, 29110: (e11) => { + "use strict"; + e11.exports = EvalError; + }, 29838: (e11) => { + "use strict"; + e11.exports = Error; + }, 61155: (e11) => { + "use strict"; + e11.exports = RangeError; + }, 94943: (e11) => { + "use strict"; + e11.exports = ReferenceError; + }, 5731: (e11) => { + "use strict"; + e11.exports = SyntaxError; + }, 3468: (e11) => { + "use strict"; + e11.exports = TypeError; + }, 32140: (e11) => { + "use strict"; + e11.exports = URIError; + }, 38792: (e11) => { + "use strict"; + e11.exports = function e12(t9, i8) { + if (t9 === i8) + return true; + if (t9 && i8 && "object" == typeof t9 && "object" == typeof i8) { + if (t9.constructor !== i8.constructor) + return false; + var n8, r8, o7; + if (Array.isArray(t9)) { + if ((n8 = t9.length) != i8.length) + return false; + for (r8 = n8; 0 != r8--; ) + if (!e12(t9[r8], i8[r8])) + return false; + return true; + } + if (t9.constructor === RegExp) + return t9.source === i8.source && t9.flags === i8.flags; + if (t9.valueOf !== Object.prototype.valueOf) + return t9.valueOf() === i8.valueOf(); + if (t9.toString !== Object.prototype.toString) + return t9.toString() === i8.toString(); + if ((n8 = (o7 = Object.keys(t9)).length) !== Object.keys(i8).length) + return false; + for (r8 = n8; 0 != r8--; ) + if (!Object.prototype.hasOwnProperty.call(i8, o7[r8])) + return false; + for (r8 = n8; 0 != r8--; ) { + var s7 = o7[r8]; + if (!e12(t9[s7], i8[s7])) + return false; + } + return true; + } + return t9 != t9 && i8 != i8; + }; + }, 2940: (e11) => { + function t9(e12, t10, i9, n9) { + var r9, o8 = null == (r9 = n9) || "number" == typeof r9 || "boolean" == typeof r9 ? n9 : i9(n9), s8 = t10.get(o8); + return void 0 === s8 && (s8 = e12.call(this, n9), t10.set(o8, s8)), s8; + } + function i8(e12, t10, i9) { + var n9 = Array.prototype.slice.call(arguments, 3), r9 = i9(n9), o8 = t10.get(r9); + return void 0 === o8 && (o8 = e12.apply(this, n9), t10.set(r9, o8)), o8; + } + function n8(e12, t10, i9, n9, r9) { + return i9.bind(t10, e12, n9, r9); + } + function r8(e12, r9) { + return n8(e12, this, 1 === e12.length ? t9 : i8, r9.cache.create(), r9.serializer); + } + function o7() { + return JSON.stringify(arguments); + } + function s7() { + this.cache = /* @__PURE__ */ Object.create(null); + } + s7.prototype.has = function(e12) { + return e12 in this.cache; + }, s7.prototype.get = function(e12) { + return this.cache[e12]; + }, s7.prototype.set = function(e12, t10) { + this.cache[e12] = t10; + }; + var a7 = { create: function() { + return new s7(); + } }; + e11.exports = function(e12, t10) { + var i9 = t10 && t10.cache ? t10.cache : a7, n9 = t10 && t10.serializer ? t10.serializer : o7; + return (t10 && t10.strategy ? t10.strategy : r8)(e12, { cache: i9, serializer: n9 }); + }, e11.exports.strategies = { variadic: function(e12, t10) { + return n8(e12, this, i8, t10.cache.create(), t10.serializer); + }, monadic: function(e12, i9) { + return n8(e12, this, t9, i9.cache.create(), i9.serializer); + } }; + }, 28794: (e11) => { + "use strict"; + var t9 = Object.prototype.toString, i8 = Math.max, n8 = function(e12, t10) { + for (var i9 = [], n9 = 0; n9 < e12.length; n9 += 1) + i9[n9] = e12[n9]; + for (var r8 = 0; r8 < t10.length; r8 += 1) + i9[r8 + e12.length] = t10[r8]; + return i9; + }; + e11.exports = function(e12) { + var r8 = this; + if ("function" != typeof r8 || "[object Function]" !== t9.apply(r8)) + throw new TypeError("Function.prototype.bind called on incompatible " + r8); + for (var o7, s7 = function(e13) { + for (var t10 = [], i9 = 1, n9 = 0; i9 < e13.length; i9 += 1, n9 += 1) + t10[n9] = e13[i9]; + return t10; + }(arguments), a7 = i8(0, r8.length - s7.length), p7 = [], c7 = 0; c7 < a7; c7++) + p7[c7] = "$" + c7; + if (o7 = Function("binder", "return function (" + function(e13) { + for (var t10 = "", i9 = 0; i9 < e13.length; i9 += 1) + t10 += e13[i9], i9 + 1 < e13.length && (t10 += ","); + return t10; + }(p7) + "){ return binder.apply(this,arguments); }")(function() { + if (this instanceof o7) { + var t10 = r8.apply(this, n8(s7, arguments)); + return Object(t10) === t10 ? t10 : this; + } + return r8.apply(e12, n8(s7, arguments)); + }), r8.prototype) { + var d7 = function() { + }; + d7.prototype = r8.prototype, o7.prototype = new d7(), d7.prototype = null; + } + return o7; + }; + }, 79138: (e11, t9, i8) => { + "use strict"; + var n8 = i8(28794); + e11.exports = Function.prototype.bind || n8; + }, 68993: (e11) => { + "use strict"; + var t9 = function() { + return "string" == typeof function() { + }.name; + }, i8 = Object.getOwnPropertyDescriptor; + if (i8) + try { + i8([], "length"); + } catch (e12) { + i8 = null; + } + t9.functionsHaveConfigurableNames = function() { + if (!t9() || !i8) + return false; + var e12 = i8(function() { + }, "name"); + return !!e12 && !!e12.configurable; + }; + var n8 = Function.prototype.bind; + t9.boundFunctionsHaveNames = function() { + return t9() && "function" == typeof n8 && "" !== function() { + }.bind().name; + }, e11.exports = t9; + }, 528: (e11, t9, i8) => { + "use strict"; + var n8, r8 = i8(29838), o7 = i8(29110), s7 = i8(61155), a7 = i8(94943), p7 = i8(5731), c7 = i8(3468), d7 = i8(32140), f8 = Function, l7 = function(e12) { + try { + return f8('"use strict"; return (' + e12 + ").constructor;")(); + } catch (e13) { + } + }, u7 = Object.getOwnPropertyDescriptor; + if (u7) + try { + u7({}, ""); + } catch (e12) { + u7 = null; + } + var m7 = function() { + throw new c7(); + }, h8 = u7 ? function() { + try { + return m7; + } catch (e12) { + try { + return u7(arguments, "callee").get; + } catch (e13) { + return m7; + } + } + }() : m7, y7 = i8(53558)(), g7 = i8(66869)(), b8 = Object.getPrototypeOf || (g7 ? function(e12) { + return e12.__proto__; + } : null), v8 = {}, j6 = "undefined" != typeof Uint8Array && b8 ? b8(Uint8Array) : n8, $5 = { __proto__: null, "%AggregateError%": "undefined" == typeof AggregateError ? n8 : AggregateError, "%Array%": Array, "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? n8 : ArrayBuffer, "%ArrayIteratorPrototype%": y7 && b8 ? b8([][Symbol.iterator]()) : n8, "%AsyncFromSyncIteratorPrototype%": n8, "%AsyncFunction%": v8, "%AsyncGenerator%": v8, "%AsyncGeneratorFunction%": v8, "%AsyncIteratorPrototype%": v8, "%Atomics%": "undefined" == typeof Atomics ? n8 : Atomics, "%BigInt%": "undefined" == typeof BigInt ? n8 : BigInt, "%BigInt64Array%": "undefined" == typeof BigInt64Array ? n8 : BigInt64Array, "%BigUint64Array%": "undefined" == typeof BigUint64Array ? n8 : BigUint64Array, "%Boolean%": Boolean, "%DataView%": "undefined" == typeof DataView ? n8 : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": r8, "%eval%": eval, "%EvalError%": o7, "%Float32Array%": "undefined" == typeof Float32Array ? n8 : Float32Array, "%Float64Array%": "undefined" == typeof Float64Array ? n8 : Float64Array, "%FinalizationRegistry%": "undefined" == typeof FinalizationRegistry ? n8 : FinalizationRegistry, "%Function%": f8, "%GeneratorFunction%": v8, "%Int8Array%": "undefined" == typeof Int8Array ? n8 : Int8Array, "%Int16Array%": "undefined" == typeof Int16Array ? n8 : Int16Array, "%Int32Array%": "undefined" == typeof Int32Array ? n8 : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": y7 && b8 ? b8(b8([][Symbol.iterator]())) : n8, "%JSON%": "object" == typeof JSON ? JSON : n8, "%Map%": "undefined" == typeof Map ? n8 : Map, "%MapIteratorPrototype%": "undefined" != typeof Map && y7 && b8 ? b8((/* @__PURE__ */ new Map())[Symbol.iterator]()) : n8, "%Math%": Math, "%Number%": Number, "%Object%": Object, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": "undefined" == typeof Promise ? n8 : Promise, "%Proxy%": "undefined" == typeof Proxy ? n8 : Proxy, "%RangeError%": s7, "%ReferenceError%": a7, "%Reflect%": "undefined" == typeof Reflect ? n8 : Reflect, "%RegExp%": RegExp, "%Set%": "undefined" == typeof Set ? n8 : Set, "%SetIteratorPrototype%": "undefined" != typeof Set && y7 && b8 ? b8((/* @__PURE__ */ new Set())[Symbol.iterator]()) : n8, "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? n8 : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": y7 && b8 ? b8(""[Symbol.iterator]()) : n8, "%Symbol%": y7 ? Symbol : n8, "%SyntaxError%": p7, "%ThrowTypeError%": h8, "%TypedArray%": j6, "%TypeError%": c7, "%Uint8Array%": "undefined" == typeof Uint8Array ? n8 : Uint8Array, "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? n8 : Uint8ClampedArray, "%Uint16Array%": "undefined" == typeof Uint16Array ? n8 : Uint16Array, "%Uint32Array%": "undefined" == typeof Uint32Array ? n8 : Uint32Array, "%URIError%": d7, "%WeakMap%": "undefined" == typeof WeakMap ? n8 : WeakMap, "%WeakRef%": "undefined" == typeof WeakRef ? n8 : WeakRef, "%WeakSet%": "undefined" == typeof WeakSet ? n8 : WeakSet }; + if (b8) + try { + null.error; + } catch (e12) { + var x7 = b8(b8(e12)); + $5["%Error.prototype%"] = x7; + } + var _6 = function e12(t10) { + var i9; + if ("%AsyncFunction%" === t10) + i9 = l7("async function () {}"); + else if ("%GeneratorFunction%" === t10) + i9 = l7("function* () {}"); + else if ("%AsyncGeneratorFunction%" === t10) + i9 = l7("async function* () {}"); + else if ("%AsyncGenerator%" === t10) { + var n9 = e12("%AsyncGeneratorFunction%"); + n9 && (i9 = n9.prototype); + } else if ("%AsyncIteratorPrototype%" === t10) { + var r9 = e12("%AsyncGenerator%"); + r9 && b8 && (i9 = b8(r9.prototype)); + } + return $5[t10] = i9, i9; + }, w6 = { __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, S6 = i8(79138), P6 = i8(78554), O7 = S6.call(Function.call, Array.prototype.concat), T6 = S6.call(Function.apply, Array.prototype.splice), A6 = S6.call(Function.call, String.prototype.replace), I6 = S6.call(Function.call, String.prototype.slice), E6 = S6.call(Function.call, RegExp.prototype.exec), q5 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, k6 = /\\(\\)?/g, M6 = function(e12, t10) { + var i9, n9 = e12; + if (P6(w6, n9) && (n9 = "%" + (i9 = w6[n9])[0] + "%"), P6($5, n9)) { + var r9 = $5[n9]; + if (r9 === v8 && (r9 = _6(n9)), void 0 === r9 && !t10) + throw new c7("intrinsic " + e12 + " exists, but is not available. Please file an issue!"); + return { alias: i9, name: n9, value: r9 }; + } + throw new p7("intrinsic " + e12 + " does not exist!"); + }; + e11.exports = function(e12, t10) { + if ("string" != typeof e12 || 0 === e12.length) + throw new c7("intrinsic name must be a non-empty string"); + if (arguments.length > 1 && "boolean" != typeof t10) + throw new c7('"allowMissing" argument must be a boolean'); + if (null === E6(/^%?[^%]*%?$/, e12)) + throw new p7("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + var i9 = function(e13) { + var t11 = I6(e13, 0, 1), i10 = I6(e13, -1); + if ("%" === t11 && "%" !== i10) + throw new p7("invalid intrinsic syntax, expected closing `%`"); + if ("%" === i10 && "%" !== t11) + throw new p7("invalid intrinsic syntax, expected opening `%`"); + var n10 = []; + return A6(e13, q5, function(e14, t12, i11, r10) { + n10[n10.length] = i11 ? A6(r10, k6, "$1") : t12 || e14; + }), n10; + }(e12), n9 = i9.length > 0 ? i9[0] : "", r9 = M6("%" + n9 + "%", t10), o8 = r9.name, s8 = r9.value, a8 = false, d8 = r9.alias; + d8 && (n9 = d8[0], T6(i9, O7([0, 1], d8))); + for (var f9 = 1, l8 = true; f9 < i9.length; f9 += 1) { + var m8 = i9[f9], h9 = I6(m8, 0, 1), y8 = I6(m8, -1); + if (('"' === h9 || "'" === h9 || "`" === h9 || '"' === y8 || "'" === y8 || "`" === y8) && h9 !== y8) + throw new p7("property names with quotes must have matching quotes"); + if ("constructor" !== m8 && l8 || (a8 = true), P6($5, o8 = "%" + (n9 += "." + m8) + "%")) + s8 = $5[o8]; + else if (null != s8) { + if (!(m8 in s8)) { + if (!t10) + throw new c7("base intrinsic for " + e12 + " exists, but the property is not available."); + return; + } + if (u7 && f9 + 1 >= i9.length) { + var g8 = u7(s8, m8); + s8 = (l8 = !!g8) && "get" in g8 && !("originalValue" in g8.get) ? g8.get : s8[m8]; + } else + l8 = P6(s8, m8), s8 = s8[m8]; + l8 && !a8 && ($5[o8] = s8); + } + } + return s8; + }; + }, 60285: (e11) => { + "use strict"; + "undefined" != typeof self ? e11.exports = self : "undefined" != typeof window ? e11.exports = window : e11.exports = Function("return this")(); + }, 6541: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41857), r8 = i8(60285), o7 = i8(83658), s7 = i8(74952), a7 = o7(), p7 = function() { + return a7; + }; + n8(p7, { getPolyfill: o7, implementation: r8, shim: s7 }), e11.exports = p7; + }, 83658: (e11, t9, i8) => { + "use strict"; + var n8 = i8(60285); + e11.exports = function() { + return "object" == typeof i8.g && i8.g && i8.g.Math === Math && i8.g.Array === Array ? i8.g : n8; + }; + }, 74952: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41857), r8 = i8(69336), o7 = i8(83658); + e11.exports = function() { + var e12 = o7(); + if (n8.supportsDescriptors) { + var t10 = r8(e12, "globalThis"); + t10 && (!t10.configurable || !t10.enumerable && t10.writable && globalThis === e12) || Object.defineProperty(e12, "globalThis", { configurable: true, enumerable: false, value: e12, writable: true }); + } else + "object" == typeof globalThis && globalThis === e12 || (e12.globalThis = e12); + return e12; + }; + }, 69336: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Object.getOwnPropertyDescriptor%", true); + if (n8) + try { + n8([], "length"); + } catch (e12) { + n8 = null; + } + e11.exports = n8; + }, 17239: (e11, t9, i8) => { + "use strict"; + var n8 = i8(64940), r8 = function() { + return !!n8; + }; + r8.hasArrayLengthDefineBug = function() { + if (!n8) + return null; + try { + return 1 !== n8([], "length", { value: 1 }).length; + } catch (e12) { + return true; + } + }, e11.exports = r8; + }, 66869: (e11) => { + "use strict"; + var t9 = { __proto__: null, foo: {} }, i8 = Object; + e11.exports = function() { + return { __proto__: t9 }.foo === t9.foo && !(t9 instanceof i8); + }; + }, 53558: (e11, t9, i8) => { + "use strict"; + var n8 = "undefined" != typeof Symbol && Symbol, r8 = i8(62908); + e11.exports = function() { + return "function" == typeof n8 && "function" == typeof Symbol && "symbol" == typeof n8("foo") && "symbol" == typeof Symbol("bar") && r8(); + }; + }, 62908: (e11) => { + "use strict"; + e11.exports = function() { + if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) + return false; + if ("symbol" == typeof Symbol.iterator) + return true; + var e12 = {}, t9 = Symbol("test"), i8 = Object(t9); + if ("string" == typeof t9) + return false; + if ("[object Symbol]" !== Object.prototype.toString.call(t9)) + return false; + if ("[object Symbol]" !== Object.prototype.toString.call(i8)) + return false; + for (t9 in e12[t9] = 42, e12) + return false; + if ("function" == typeof Object.keys && 0 !== Object.keys(e12).length) + return false; + if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(e12).length) + return false; + var n8 = Object.getOwnPropertySymbols(e12); + if (1 !== n8.length || n8[0] !== t9) + return false; + if (!Object.prototype.propertyIsEnumerable.call(e12, t9)) + return false; + if ("function" == typeof Object.getOwnPropertyDescriptor) { + var r8 = Object.getOwnPropertyDescriptor(e12, t9); + if (42 !== r8.value || true !== r8.enumerable) + return false; + } + return true; + }; + }, 51913: (e11, t9, i8) => { + "use strict"; + var n8 = i8(62908); + e11.exports = function() { + return n8() && !!Symbol.toStringTag; + }; + }, 78554: (e11, t9, i8) => { + "use strict"; + var n8 = Function.prototype.call, r8 = Object.prototype.hasOwnProperty, o7 = i8(79138); + e11.exports = o7.call(n8, r8); + }, 39318: (e11, t9) => { + t9.read = function(e12, t10, i8, n8, r8) { + var o7, s7, a7 = 8 * r8 - n8 - 1, p7 = (1 << a7) - 1, c7 = p7 >> 1, d7 = -7, f8 = i8 ? r8 - 1 : 0, l7 = i8 ? -1 : 1, u7 = e12[t10 + f8]; + for (f8 += l7, o7 = u7 & (1 << -d7) - 1, u7 >>= -d7, d7 += a7; d7 > 0; o7 = 256 * o7 + e12[t10 + f8], f8 += l7, d7 -= 8) + ; + for (s7 = o7 & (1 << -d7) - 1, o7 >>= -d7, d7 += n8; d7 > 0; s7 = 256 * s7 + e12[t10 + f8], f8 += l7, d7 -= 8) + ; + if (0 === o7) + o7 = 1 - c7; + else { + if (o7 === p7) + return s7 ? NaN : 1 / 0 * (u7 ? -1 : 1); + s7 += Math.pow(2, n8), o7 -= c7; + } + return (u7 ? -1 : 1) * s7 * Math.pow(2, o7 - n8); + }, t9.write = function(e12, t10, i8, n8, r8, o7) { + var s7, a7, p7, c7 = 8 * o7 - r8 - 1, d7 = (1 << c7) - 1, f8 = d7 >> 1, l7 = 23 === r8 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, u7 = n8 ? 0 : o7 - 1, m7 = n8 ? 1 : -1, h8 = t10 < 0 || 0 === t10 && 1 / t10 < 0 ? 1 : 0; + for (t10 = Math.abs(t10), isNaN(t10) || t10 === 1 / 0 ? (a7 = isNaN(t10) ? 1 : 0, s7 = d7) : (s7 = Math.floor(Math.log(t10) / Math.LN2), t10 * (p7 = Math.pow(2, -s7)) < 1 && (s7--, p7 *= 2), (t10 += s7 + f8 >= 1 ? l7 / p7 : l7 * Math.pow(2, 1 - f8)) * p7 >= 2 && (s7++, p7 /= 2), s7 + f8 >= d7 ? (a7 = 0, s7 = d7) : s7 + f8 >= 1 ? (a7 = (t10 * p7 - 1) * Math.pow(2, r8), s7 += f8) : (a7 = t10 * Math.pow(2, f8 - 1) * Math.pow(2, r8), s7 = 0)); r8 >= 8; e12[i8 + u7] = 255 & a7, u7 += m7, a7 /= 256, r8 -= 8) + ; + for (s7 = s7 << r8 | a7, c7 += r8; c7 > 0; e12[i8 + u7] = 255 & s7, u7 += m7, s7 /= 256, c7 -= 8) + ; + e12[i8 + u7 - m7] |= 128 * h8; + }; + }, 58712: (e11, t9) => { + function i8(e12) { + for (var t10 = arguments.length, i9 = Array(t10 > 1 ? t10 - 1 : 0), n9 = 1; n9 < t10; n9++) + i9[n9 - 1] = arguments[n9]; + throw Error("[Immer] minified error nr: " + e12 + (i9.length ? " " + i9.map(function(e13) { + return "'" + e13 + "'"; + }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf"); + } + function n8(e12) { + return !!e12 && !!e12[G5]; + } + function r8(e12) { + var t10; + return !!e12 && (function(e13) { + if (!e13 || "object" != typeof e13) + return false; + var t11 = Object.getPrototypeOf(e13); + if (null === t11) + return true; + var i9 = Object.hasOwnProperty.call(t11, "constructor") && t11.constructor; + return i9 === Object || "function" == typeof i9 && Function.toString.call(i9) === J5; + }(e12) || Array.isArray(e12) || !!e12[H5] || !!(null === (t10 = e12.constructor) || void 0 === t10 ? void 0 : t10[H5]) || f8(e12) || l7(e12)); + } + function o7(e12, t10, i9) { + void 0 === i9 && (i9 = false), 0 === s7(e12) ? (i9 ? Object.keys : Z5)(e12).forEach(function(n9) { + i9 && "symbol" == typeof n9 || t10(n9, e12[n9], e12); + }) : e12.forEach(function(i10, n9) { + return t10(n9, i10, e12); + }); + } + function s7(e12) { + var t10 = e12[G5]; + return t10 ? t10.t > 3 ? t10.t - 4 : t10.t : Array.isArray(e12) ? 1 : f8(e12) ? 2 : l7(e12) ? 3 : 0; + } + function a7(e12, t10) { + return 2 === s7(e12) ? e12.has(t10) : Object.prototype.hasOwnProperty.call(e12, t10); + } + function p7(e12, t10) { + return 2 === s7(e12) ? e12.get(t10) : e12[t10]; + } + function c7(e12, t10, i9) { + var n9 = s7(e12); + 2 === n9 ? e12.set(t10, i9) : 3 === n9 ? e12.add(i9) : e12[t10] = i9; + } + function d7(e12, t10) { + return e12 === t10 ? 0 !== e12 || 1 / e12 == 1 / t10 : e12 != e12 && t10 != t10; + } + function f8(e12) { + return z6 && e12 instanceof Map; + } + function l7(e12) { + return B6 && e12 instanceof Set; + } + function u7(e12) { + return e12.i || e12.u; + } + function m7(e12) { + if (Array.isArray(e12)) + return Array.prototype.slice.call(e12); + var t10 = Y6(e12); + delete t10[G5]; + for (var i9 = Z5(t10), n9 = 0; n9 < i9.length; n9++) { + var r9 = i9[n9], o8 = t10[r9]; + false === o8.writable && (o8.writable = true, o8.configurable = true), (o8.get || o8.set) && (t10[r9] = { configurable: true, writable: true, enumerable: o8.enumerable, value: e12[r9] }); + } + return Object.create(Object.getPrototypeOf(e12), t10); + } + function h8(e12, t10) { + return void 0 === t10 && (t10 = false), g7(e12) || n8(e12) || !r8(e12) || (s7(e12) > 1 && (e12.set = e12.add = e12.clear = e12.delete = y7), Object.freeze(e12), t10 && o7(e12, function(e13, t11) { + return h8(t11, true); + }, true)), e12; + } + function y7() { + i8(2); + } + function g7(e12) { + return null == e12 || "object" != typeof e12 || Object.isFrozen(e12); + } + function b8(e12) { + var t10 = X5[e12]; + return t10 || i8(18, e12), t10; + } + function v8(e12, t10) { + X5[e12] || (X5[e12] = t10); + } + function j6() { + return U6; + } + function $5(e12, t10) { + t10 && (b8("Patches"), e12.o = [], e12.v = [], e12.s = t10); + } + function x7(e12) { + _6(e12), e12.p.forEach(S6), e12.p = null; + } + function _6(e12) { + e12 === U6 && (U6 = e12.l); + } + function w6(e12) { + return U6 = { p: [], l: U6, h: e12, _: true, m: 0 }; + } + function S6(e12) { + var t10 = e12[G5]; + 0 === t10.t || 1 === t10.t ? t10.j() : t10.O = true; + } + function P6(e12, t10) { + t10.m = t10.p.length; + var n9 = t10.p[0], o8 = void 0 !== e12 && e12 !== n9; + return t10.h.S || b8("ES5").P(t10, e12, o8), o8 ? (n9[G5].g && (x7(t10), i8(4)), r8(e12) && (e12 = O7(t10, e12), t10.l || A6(t10, e12)), t10.o && b8("Patches").M(n9[G5].u, e12, t10.o, t10.v)) : e12 = O7(t10, n9, []), x7(t10), t10.o && t10.s(t10.o, t10.v), e12 !== K5 ? e12 : void 0; + } + function O7(e12, t10, i9) { + if (g7(t10)) + return t10; + var n9 = t10[G5]; + if (!n9) + return o7(t10, function(r10, o8) { + return T6(e12, n9, t10, r10, o8, i9); + }, true), t10; + if (n9.A !== e12) + return t10; + if (!n9.g) + return A6(e12, n9.u, true), n9.u; + if (!n9.R) { + n9.R = true, n9.A.m--; + var r9 = 4 === n9.t || 5 === n9.t ? n9.i = m7(n9.k) : n9.i, s8 = r9, a8 = false; + 3 === n9.t && (s8 = new Set(r9), r9.clear(), a8 = true), o7(s8, function(t11, o8) { + return T6(e12, n9, r9, t11, o8, i9, a8); + }), A6(e12, r9, false), i9 && e12.o && b8("Patches").F(n9, i9, e12.o, e12.v); + } + return n9.i; + } + function T6(e12, t10, i9, o8, s8, p8, d8) { + if (n8(s8)) { + var f9 = O7(e12, s8, p8 && t10 && 3 !== t10.t && !a7(t10.N, o8) ? p8.concat(o8) : void 0); + if (c7(i9, o8, f9), !n8(f9)) + return; + e12._ = false; + } else + d8 && i9.add(s8); + if (r8(s8) && !g7(s8)) { + if (!e12.h.D && e12.m < 1) + return; + O7(e12, s8), t10 && t10.A.l || A6(e12, s8); + } + } + function A6(e12, t10, i9) { + void 0 === i9 && (i9 = false), !e12.l && e12.h.D && e12._ && h8(t10, i9); + } + function I6(e12, t10) { + var i9 = e12[G5]; + return (i9 ? u7(i9) : e12)[t10]; + } + function E6(e12, t10) { + if (t10 in e12) + for (var i9 = Object.getPrototypeOf(e12); i9; ) { + var n9 = Object.getOwnPropertyDescriptor(i9, t10); + if (n9) + return n9; + i9 = Object.getPrototypeOf(i9); + } + } + function q5(e12) { + e12.g || (e12.g = true, e12.l && q5(e12.l)); + } + function k6(e12) { + e12.i || (e12.i = m7(e12.u)); + } + function M6(e12, t10, i9) { + var n9 = f8(t10) ? b8("MapSet").K(t10, i9) : l7(t10) ? b8("MapSet").$(t10, i9) : e12.S ? function(e13, t11) { + var i10 = Array.isArray(e13), n10 = { t: i10 ? 1 : 0, A: t11 ? t11.A : j6(), g: false, R: false, N: {}, l: t11, u: e13, k: null, i: null, j: null, C: false }, r9 = n10, o8 = ee4; + i10 && (r9 = [n10], o8 = te4); + var s8 = Proxy.revocable(r9, o8), a8 = s8.revoke, p8 = s8.proxy; + return n10.k = p8, n10.j = a8, p8; + }(t10, i9) : b8("ES5").I(t10, i9); + return (i9 ? i9.A : j6()).p.push(n9), n9; + } + function R6(e12) { + return n8(e12) || i8(22, e12), function e13(t10) { + if (!r8(t10)) + return t10; + var i9, n9 = t10[G5], a8 = s7(t10); + if (n9) { + if (!n9.g && (n9.t < 4 || !b8("ES5").J(n9))) + return n9.u; + n9.R = true, i9 = D6(t10, a8), n9.R = false; + } else + i9 = D6(t10, a8); + return o7(i9, function(t11, r9) { + n9 && p7(n9.u, t11) === r9 || c7(i9, t11, e13(r9)); + }), 3 === a8 ? new Set(i9) : i9; + }(e12); + } + function D6(e12, t10) { + switch (t10) { + case 2: + return new Map(e12); + case 3: + return Array.from(e12); + } + return m7(e12); + } + function C6() { + function e12(e13, t11) { + var i10 = s8[e13]; + return i10 ? i10.enumerable = t11 : s8[e13] = i10 = { configurable: true, enumerable: t11, get: function() { + return ee4.get(this[G5], e13); + }, set: function(t12) { + ee4.set(this[G5], e13, t12); + } }, i10; + } + function t10(e13) { + for (var t11 = e13.length - 1; t11 >= 0; t11--) { + var n9 = e13[t11][G5]; + if (!n9.g) + switch (n9.t) { + case 5: + r9(n9) && q5(n9); + break; + case 4: + i9(n9) && q5(n9); + } + } + } + function i9(e13) { + for (var t11 = e13.u, i10 = e13.k, n9 = Z5(i10), r10 = n9.length - 1; r10 >= 0; r10--) { + var o8 = n9[r10]; + if (o8 !== G5) { + var s9 = t11[o8]; + if (void 0 === s9 && !a7(t11, o8)) + return true; + var p8 = i10[o8], c8 = p8 && p8[G5]; + if (c8 ? c8.u !== s9 : !d7(p8, s9)) + return true; + } + } + var f9 = !!t11[G5]; + return n9.length !== Z5(t11).length + (f9 ? 0 : 1); + } + function r9(e13) { + var t11 = e13.k; + if (t11.length !== e13.u.length) + return true; + var i10 = Object.getOwnPropertyDescriptor(t11, t11.length - 1); + if (i10 && !i10.get) + return true; + for (var n9 = 0; n9 < t11.length; n9++) + if (!t11.hasOwnProperty(n9)) + return true; + return false; + } + var s8 = {}; + v8("ES5", { I: function(t11, i10) { + var n9 = Array.isArray(t11), r10 = function(t12, i11) { + if (t12) { + for (var n10 = Array(i11.length), r11 = 0; r11 < i11.length; r11++) + Object.defineProperty(n10, "" + r11, e12(r11, true)); + return n10; + } + var o9 = Y6(i11); + delete o9[G5]; + for (var s9 = Z5(o9), a8 = 0; a8 < s9.length; a8++) { + var p8 = s9[a8]; + o9[p8] = e12(p8, t12 || !!o9[p8].enumerable); + } + return Object.create(Object.getPrototypeOf(i11), o9); + }(n9, t11), o8 = { t: n9 ? 5 : 4, A: i10 ? i10.A : j6(), g: false, R: false, N: {}, l: i10, u: t11, k: r10, i: null, O: false, C: false }; + return Object.defineProperty(r10, G5, { value: o8, writable: true }), r10; + }, P: function(e13, i10, s9) { + s9 ? n8(i10) && i10[G5].A === e13 && t10(e13.p) : (e13.o && function e14(t11) { + if (t11 && "object" == typeof t11) { + var i11 = t11[G5]; + if (i11) { + var n9 = i11.u, s10 = i11.k, p8 = i11.N, c8 = i11.t; + if (4 === c8) + o7(s10, function(t12) { + t12 !== G5 && (void 0 !== n9[t12] || a7(n9, t12) ? p8[t12] || e14(s10[t12]) : (p8[t12] = true, q5(i11))); + }), o7(n9, function(e15) { + void 0 !== s10[e15] || a7(s10, e15) || (p8[e15] = false, q5(i11)); + }); + else if (5 === c8) { + if (r9(i11) && (q5(i11), p8.length = true), s10.length < n9.length) + for (var d8 = s10.length; d8 < n9.length; d8++) + p8[d8] = false; + else + for (var f9 = n9.length; f9 < s10.length; f9++) + p8[f9] = true; + for (var l8 = Math.min(s10.length, n9.length), u8 = 0; u8 < l8; u8++) + s10.hasOwnProperty(u8) || (p8[u8] = true), void 0 === p8[u8] && e14(s10[u8]); + } + } + } + }(e13.p[0]), t10(e13.p)); + }, J: function(e13) { + return 4 === e13.t ? i9(e13) : r9(e13); + } }); + } + function V5() { + function e12(t11) { + if (!r8(t11)) + return t11; + if (Array.isArray(t11)) + return t11.map(e12); + if (f8(t11)) + return new Map(Array.from(t11.entries()).map(function(t12) { + return [t12[0], e12(t12[1])]; + })); + if (l7(t11)) + return new Set(Array.from(t11).map(e12)); + var i9 = Object.create(Object.getPrototypeOf(t11)); + for (var n9 in t11) + i9[n9] = e12(t11[n9]); + return a7(t11, H5) && (i9[H5] = t11[H5]), i9; + } + function t10(t11) { + return n8(t11) ? e12(t11) : t11; + } + var c8 = "add"; + v8("Patches", { W: function(t11, n9) { + return n9.forEach(function(n10) { + for (var r9 = n10.path, o8 = n10.op, a8 = t11, d8 = 0; d8 < r9.length - 1; d8++) { + var f9 = s7(a8), l8 = r9[d8]; + "string" != typeof l8 && "number" != typeof l8 && (l8 = "" + l8), 0 !== f9 && 1 !== f9 || "__proto__" !== l8 && "constructor" !== l8 || i8(24), "function" == typeof a8 && "prototype" === l8 && i8(24), "object" != typeof (a8 = p7(a8, l8)) && i8(15, r9.join("/")); + } + var u8 = s7(a8), m8 = e12(n10.value), h9 = r9[r9.length - 1]; + switch (o8) { + case "replace": + switch (u8) { + case 2: + return a8.set(h9, m8); + case 3: + i8(16); + default: + return a8[h9] = m8; + } + case c8: + switch (u8) { + case 1: + return "-" === h9 ? a8.push(m8) : a8.splice(h9, 0, m8); + case 2: + return a8.set(h9, m8); + case 3: + return a8.add(m8); + default: + return a8[h9] = m8; + } + case "remove": + switch (u8) { + case 1: + return a8.splice(h9, 1); + case 2: + return a8.delete(h9); + case 3: + return a8.delete(n10.value); + default: + return delete a8[h9]; + } + default: + i8(17, o8); + } + }), t11; + }, F: function(e13, i9, n9, r9) { + switch (e13.t) { + case 0: + case 4: + case 2: + return function(e14, i10, n10, r10) { + var s8 = e14.u, d8 = e14.i; + o7(e14.N, function(e15, o8) { + var f9 = p7(s8, e15), l8 = p7(d8, e15), u8 = o8 ? a7(s8, e15) ? "replace" : c8 : "remove"; + if (f9 !== l8 || "replace" !== u8) { + var m8 = i10.concat(e15); + n10.push("remove" === u8 ? { op: u8, path: m8 } : { op: u8, path: m8, value: l8 }), r10.push(u8 === c8 ? { op: "remove", path: m8 } : "remove" === u8 ? { op: c8, path: m8, value: t10(f9) } : { op: "replace", path: m8, value: t10(f9) }); + } + }); + }(e13, i9, n9, r9); + case 5: + case 1: + return function(e14, i10, n10, r10) { + var o8 = e14.u, s8 = e14.N, a8 = e14.i; + if (a8.length < o8.length) { + var p8 = [a8, o8]; + o8 = p8[0], a8 = p8[1]; + var d8 = [r10, n10]; + n10 = d8[0], r10 = d8[1]; + } + for (var f9 = 0; f9 < o8.length; f9++) + if (s8[f9] && a8[f9] !== o8[f9]) { + var l8 = i10.concat([f9]); + n10.push({ op: "replace", path: l8, value: t10(a8[f9]) }), r10.push({ op: "replace", path: l8, value: t10(o8[f9]) }); + } + for (var u8 = o8.length; u8 < a8.length; u8++) { + var m8 = i10.concat([u8]); + n10.push({ op: c8, path: m8, value: t10(a8[u8]) }); + } + o8.length < a8.length && r10.push({ op: "replace", path: i10.concat(["length"]), value: o8.length }); + }(e13, i9, n9, r9); + case 3: + return function(e14, t11, i10, n10) { + var r10 = e14.u, o8 = e14.i, s8 = 0; + r10.forEach(function(e15) { + if (!o8.has(e15)) { + var r11 = t11.concat([s8]); + i10.push({ op: "remove", path: r11, value: e15 }), n10.unshift({ op: c8, path: r11, value: e15 }); + } + s8++; + }), s8 = 0, o8.forEach(function(e15) { + if (!r10.has(e15)) { + var o9 = t11.concat([s8]); + i10.push({ op: c8, path: o9, value: e15 }), n10.unshift({ op: "remove", path: o9, value: e15 }); + } + s8++; + }); + }(e13, i9, n9, r9); + } + }, M: function(e13, t11, i9, n9) { + i9.push({ op: "replace", path: [], value: t11 === K5 ? void 0 : t11 }), n9.push({ op: "replace", path: [], value: e13 }); + } }); + } + function N6() { + function e12(e13, t11) { + function i9() { + this.constructor = e13; + } + a8(e13, t11), e13.prototype = (i9.prototype = t11.prototype, new i9()); + } + function t10(e13) { + e13.i || (e13.N = /* @__PURE__ */ new Map(), e13.i = new Map(e13.u)); + } + function n9(e13) { + e13.i || (e13.i = /* @__PURE__ */ new Set(), e13.u.forEach(function(t11) { + if (r8(t11)) { + var i9 = M6(e13.A.h, t11, e13); + e13.p.set(t11, i9), e13.i.add(i9); + } else + e13.i.add(t11); + })); + } + function s8(e13) { + e13.O && i8(3, JSON.stringify(u7(e13))); + } + var a8 = function(e13, t11) { + return (a8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e14, t12) { + e14.__proto__ = t12; + } || function(e14, t12) { + for (var i9 in t12) + t12.hasOwnProperty(i9) && (e14[i9] = t12[i9]); + })(e13, t11); + }, p8 = function() { + function i9(e13, t11) { + return this[G5] = { t: 2, l: t11, A: t11 ? t11.A : j6(), g: false, R: false, i: void 0, N: void 0, u: e13, k: this, C: false, O: false }, this; + } + e12(i9, Map); + var n10 = i9.prototype; + return Object.defineProperty(n10, "size", { get: function() { + return u7(this[G5]).size; + } }), n10.has = function(e13) { + return u7(this[G5]).has(e13); + }, n10.set = function(e13, i10) { + var n11 = this[G5]; + return s8(n11), u7(n11).has(e13) && u7(n11).get(e13) === i10 || (t10(n11), q5(n11), n11.N.set(e13, true), n11.i.set(e13, i10), n11.N.set(e13, true)), this; + }, n10.delete = function(e13) { + if (!this.has(e13)) + return false; + var i10 = this[G5]; + return s8(i10), t10(i10), q5(i10), i10.u.has(e13) ? i10.N.set(e13, false) : i10.N.delete(e13), i10.i.delete(e13), true; + }, n10.clear = function() { + var e13 = this[G5]; + s8(e13), u7(e13).size && (t10(e13), q5(e13), e13.N = /* @__PURE__ */ new Map(), o7(e13.u, function(t11) { + e13.N.set(t11, false); + }), e13.i.clear()); + }, n10.forEach = function(e13, t11) { + var i10 = this; + u7(this[G5]).forEach(function(n11, r9) { + e13.call(t11, i10.get(r9), r9, i10); + }); + }, n10.get = function(e13) { + var i10 = this[G5]; + s8(i10); + var n11 = u7(i10).get(e13); + if (i10.R || !r8(n11)) + return n11; + if (n11 !== i10.u.get(e13)) + return n11; + var o8 = M6(i10.A.h, n11, i10); + return t10(i10), i10.i.set(e13, o8), o8; + }, n10.keys = function() { + return u7(this[G5]).keys(); + }, n10.values = function() { + var e13, t11 = this, i10 = this.keys(); + return (e13 = {})[W5] = function() { + return t11.values(); + }, e13.next = function() { + var e14 = i10.next(); + return e14.done ? e14 : { done: false, value: t11.get(e14.value) }; + }, e13; + }, n10.entries = function() { + var e13, t11 = this, i10 = this.keys(); + return (e13 = {})[W5] = function() { + return t11.entries(); + }, e13.next = function() { + var e14 = i10.next(); + if (e14.done) + return e14; + var n11 = t11.get(e14.value); + return { done: false, value: [e14.value, n11] }; + }, e13; + }, n10[W5] = function() { + return this.entries(); + }, i9; + }(), c8 = function() { + function t11(e13, t12) { + return this[G5] = { t: 3, l: t12, A: t12 ? t12.A : j6(), g: false, R: false, i: void 0, u: e13, k: this, p: /* @__PURE__ */ new Map(), O: false, C: false }, this; + } + e12(t11, Set); + var i9 = t11.prototype; + return Object.defineProperty(i9, "size", { get: function() { + return u7(this[G5]).size; + } }), i9.has = function(e13) { + var t12 = this[G5]; + return s8(t12), t12.i ? !!t12.i.has(e13) || !(!t12.p.has(e13) || !t12.i.has(t12.p.get(e13))) : t12.u.has(e13); + }, i9.add = function(e13) { + var t12 = this[G5]; + return s8(t12), this.has(e13) || (n9(t12), q5(t12), t12.i.add(e13)), this; + }, i9.delete = function(e13) { + if (!this.has(e13)) + return false; + var t12 = this[G5]; + return s8(t12), n9(t12), q5(t12), t12.i.delete(e13) || !!t12.p.has(e13) && t12.i.delete(t12.p.get(e13)); + }, i9.clear = function() { + var e13 = this[G5]; + s8(e13), u7(e13).size && (n9(e13), q5(e13), e13.i.clear()); + }, i9.values = function() { + var e13 = this[G5]; + return s8(e13), n9(e13), e13.i.values(); + }, i9.entries = function() { + var e13 = this[G5]; + return s8(e13), n9(e13), e13.i.entries(); + }, i9.keys = function() { + return this.values(); + }, i9[W5] = function() { + return this.values(); + }, i9.forEach = function(e13, t12) { + for (var i10 = this.values(), n10 = i10.next(); !n10.done; ) + e13.call(t12, n10.value, n10.value, this), n10 = i10.next(); + }, t11; + }(); + v8("MapSet", { K: function(e13, t11) { + return new p8(e13, t11); + }, $: function(e13, t11) { + return new c8(e13, t11); + } }); + } + var F6; + Object.defineProperty(t9, "__esModule", { value: true }); + var U6, L6 = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"), z6 = "undefined" != typeof Map, B6 = "undefined" != typeof Set, Q5 = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect, K5 = L6 ? Symbol.for("immer-nothing") : ((F6 = {})["immer-nothing"] = true, F6), H5 = L6 ? Symbol.for("immer-draftable") : "__$immer_draftable", G5 = L6 ? Symbol.for("immer-state") : "__$immer_state", W5 = "undefined" != typeof Symbol && Symbol.iterator || "@@iterator", J5 = "" + Object.prototype.constructor, Z5 = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(e12) { + return Object.getOwnPropertyNames(e12).concat(Object.getOwnPropertySymbols(e12)); + } : Object.getOwnPropertyNames, Y6 = Object.getOwnPropertyDescriptors || function(e12) { + var t10 = {}; + return Z5(e12).forEach(function(i9) { + t10[i9] = Object.getOwnPropertyDescriptor(e12, i9); + }), t10; + }, X5 = {}, ee4 = { get: function(e12, t10) { + if (t10 === G5) + return e12; + var i9 = u7(e12); + if (!a7(i9, t10)) + return function(e13, t11, i10) { + var n10, r9 = E6(t11, i10); + return r9 ? "value" in r9 ? r9.value : null === (n10 = r9.get) || void 0 === n10 ? void 0 : n10.call(e13.k) : void 0; + }(e12, i9, t10); + var n9 = i9[t10]; + return e12.R || !r8(n9) ? n9 : n9 === I6(e12.u, t10) ? (k6(e12), e12.i[t10] = M6(e12.A.h, n9, e12)) : n9; + }, has: function(e12, t10) { + return t10 in u7(e12); + }, ownKeys: function(e12) { + return Reflect.ownKeys(u7(e12)); + }, set: function(e12, t10, i9) { + var n9 = E6(u7(e12), t10); + if (null == n9 ? void 0 : n9.set) + return n9.set.call(e12.k, i9), true; + if (!e12.g) { + var r9 = I6(u7(e12), t10), o8 = null == r9 ? void 0 : r9[G5]; + if (o8 && o8.u === i9) + return e12.i[t10] = i9, e12.N[t10] = false, true; + if (d7(i9, r9) && (void 0 !== i9 || a7(e12.u, t10))) + return true; + k6(e12), q5(e12); + } + return e12.i[t10] === i9 && (void 0 !== i9 || t10 in e12.i) || Number.isNaN(i9) && Number.isNaN(e12.i[t10]) || (e12.i[t10] = i9, e12.N[t10] = true), true; + }, deleteProperty: function(e12, t10) { + return void 0 !== I6(e12.u, t10) || t10 in e12.u ? (e12.N[t10] = false, k6(e12), q5(e12)) : delete e12.N[t10], e12.i && delete e12.i[t10], true; + }, getOwnPropertyDescriptor: function(e12, t10) { + var i9 = u7(e12), n9 = Reflect.getOwnPropertyDescriptor(i9, t10); + return n9 ? { writable: true, configurable: 1 !== e12.t || "length" !== t10, enumerable: n9.enumerable, value: i9[t10] } : n9; + }, defineProperty: function() { + i8(11); + }, getPrototypeOf: function(e12) { + return Object.getPrototypeOf(e12.u); + }, setPrototypeOf: function() { + i8(12); + } }, te4 = {}; + o7(ee4, function(e12, t10) { + te4[e12] = function() { + return arguments[0] = arguments[0][0], t10.apply(this, arguments); + }; + }), te4.deleteProperty = function(e12, t10) { + return te4.set.call(this, e12, t10, void 0); + }, te4.set = function(e12, t10, i9) { + return ee4.set.call(this, e12[0], t10, i9, e12[0]); + }; + var ie3 = function() { + function e12(e13) { + var t11 = this; + this.S = Q5, this.D = true, this.produce = function(e14, n9, o8) { + if ("function" == typeof e14 && "function" != typeof n9) { + var s8 = n9; + n9 = e14; + var a8 = t11; + return function(e15) { + var t12 = this; + void 0 === e15 && (e15 = s8); + for (var i9 = arguments.length, r9 = Array(i9 > 1 ? i9 - 1 : 0), o9 = 1; o9 < i9; o9++) + r9[o9 - 1] = arguments[o9]; + return a8.produce(e15, function(e16) { + var i10; + return (i10 = n9).call.apply(i10, [t12, e16].concat(r9)); + }); + }; + } + var p8; + if ("function" != typeof n9 && i8(6), void 0 !== o8 && "function" != typeof o8 && i8(7), r8(e14)) { + var c8 = w6(t11), d8 = M6(t11, e14, void 0), f9 = true; + try { + p8 = n9(d8), f9 = false; + } finally { + f9 ? x7(c8) : _6(c8); + } + return "undefined" != typeof Promise && p8 instanceof Promise ? p8.then(function(e15) { + return $5(c8, o8), P6(e15, c8); + }, function(e15) { + throw x7(c8), e15; + }) : ($5(c8, o8), P6(p8, c8)); + } + if (!e14 || "object" != typeof e14) { + if (void 0 === (p8 = n9(e14)) && (p8 = e14), p8 === K5 && (p8 = void 0), t11.D && h8(p8, true), o8) { + var l8 = [], u8 = []; + b8("Patches").M(e14, p8, l8, u8), o8(l8, u8); + } + return p8; + } + i8(21, e14); + }, this.produceWithPatches = function(e14, i9) { + if ("function" == typeof e14) + return function(i10) { + for (var n10 = arguments.length, r10 = Array(n10 > 1 ? n10 - 1 : 0), o9 = 1; o9 < n10; o9++) + r10[o9 - 1] = arguments[o9]; + return t11.produceWithPatches(i10, function(t12) { + return e14.apply(void 0, [t12].concat(r10)); + }); + }; + var n9, r9, o8 = t11.produce(e14, i9, function(e15, t12) { + n9 = e15, r9 = t12; + }); + return "undefined" != typeof Promise && o8 instanceof Promise ? o8.then(function(e15) { + return [e15, n9, r9]; + }) : [o8, n9, r9]; + }, "boolean" == typeof (null == e13 ? void 0 : e13.useProxies) && this.setUseProxies(e13.useProxies), "boolean" == typeof (null == e13 ? void 0 : e13.autoFreeze) && this.setAutoFreeze(e13.autoFreeze); + } + var t10 = e12.prototype; + return t10.createDraft = function(e13) { + r8(e13) || i8(8), n8(e13) && (e13 = R6(e13)); + var t11 = w6(this), o8 = M6(this, e13, void 0); + return o8[G5].C = true, _6(t11), o8; + }, t10.finishDraft = function(e13, t11) { + var i9 = (e13 && e13[G5]).A; + return $5(i9, t11), P6(void 0, i9); + }, t10.setAutoFreeze = function(e13) { + this.D = e13; + }, t10.setUseProxies = function(e13) { + e13 && !Q5 && i8(20), this.S = e13; + }, t10.applyPatches = function(e13, t11) { + var i9; + for (i9 = t11.length - 1; i9 >= 0; i9--) { + var r9 = t11[i9]; + if (0 === r9.path.length && "replace" === r9.op) { + e13 = r9.value; + break; + } + } + i9 > -1 && (t11 = t11.slice(i9 + 1)); + var o8 = b8("Patches").W; + return n8(e13) ? o8(e13, t11) : this.produce(e13, function(e14) { + return o8(e14, t11); + }); + }, e12; + }(), ne4 = new ie3(), re4 = ne4.produce, oe4 = ne4.produceWithPatches.bind(ne4), se4 = ne4.setAutoFreeze.bind(ne4), ae4 = ne4.setUseProxies.bind(ne4), pe4 = ne4.applyPatches.bind(ne4), ce4 = ne4.createDraft.bind(ne4), de4 = ne4.finishDraft.bind(ne4); + t9.Immer = ie3, t9.applyPatches = pe4, t9.castDraft = function(e12) { + return e12; + }, t9.castImmutable = function(e12) { + return e12; + }, t9.createDraft = ce4, t9.current = R6, t9.default = re4, t9.enableAllPlugins = function() { + C6(), N6(), V5(); + }, t9.enableES5 = C6, t9.enableMapSet = N6, t9.enablePatches = V5, t9.finishDraft = de4, t9.freeze = h8, t9.immerable = H5, t9.isDraft = n8, t9.isDraftable = r8, t9.nothing = K5, t9.original = function(e12) { + return n8(e12) || i8(23, e12), e12[G5].u; + }, t9.produce = re4, t9.produceWithPatches = oe4, t9.setAutoFreeze = se4, t9.setUseProxies = ae4; + }, 79725: (e11, t9, i8) => { + "use strict"; + e11.exports = i8(58712); + }, 66986: (e11, t9, i8) => { + "use strict"; + var n8 = i8(78554), r8 = i8(77575)(), o7 = i8(3468), s7 = { assert: function(e12, t10) { + if (!e12 || "object" != typeof e12 && "function" != typeof e12) + throw new o7("`O` is not an object"); + if ("string" != typeof t10) + throw new o7("`slot` must be a string"); + if (r8.assert(e12), !s7.has(e12, t10)) + throw new o7("`" + t10 + "` is not present on `O`"); + }, get: function(e12, t10) { + if (!e12 || "object" != typeof e12 && "function" != typeof e12) + throw new o7("`O` is not an object"); + if ("string" != typeof t10) + throw new o7("`slot` must be a string"); + var i9 = r8.get(e12); + return i9 && i9["$" + t10]; + }, has: function(e12, t10) { + if (!e12 || "object" != typeof e12 && "function" != typeof e12) + throw new o7("`O` is not an object"); + if ("string" != typeof t10) + throw new o7("`slot` must be a string"); + var i9 = r8.get(e12); + return !!i9 && n8(i9, "$" + t10); + }, set: function(e12, t10, i9) { + if (!e12 || "object" != typeof e12 && "function" != typeof e12) + throw new o7("`O` is not an object"); + if ("string" != typeof t10) + throw new o7("`slot` must be a string"); + var n9 = r8.get(e12); + n9 || (n9 = {}, r8.set(e12, n9)), n9["$" + t10] = i9; + } }; + Object.freeze && Object.freeze(s7), e11.exports = s7; + }, 89617: (e11) => { + "use strict"; + var t9, i8, n8 = Function.prototype.toString, r8 = "object" == typeof Reflect && null !== Reflect && Reflect.apply; + if ("function" == typeof r8 && "function" == typeof Object.defineProperty) + try { + t9 = Object.defineProperty({}, "length", { get: function() { + throw i8; + } }), i8 = {}, r8(function() { + throw 42; + }, null, t9); + } catch (e12) { + e12 !== i8 && (r8 = null); + } + else + r8 = null; + var o7 = /^\s*class\b/, s7 = function(e12) { + try { + var t10 = n8.call(e12); + return o7.test(t10); + } catch (e13) { + return false; + } + }, a7 = function(e12) { + try { + return !s7(e12) && (n8.call(e12), true); + } catch (e13) { + return false; + } + }, p7 = Object.prototype.toString, c7 = "function" == typeof Symbol && !!Symbol.toStringTag, d7 = !(0 in [,]), f8 = function() { + return false; + }; + if ("object" == typeof document) { + var l7 = document.all; + p7.call(l7) === p7.call(document.all) && (f8 = function(e12) { + if ((d7 || !e12) && (void 0 === e12 || "object" == typeof e12)) + try { + var t10 = p7.call(e12); + return ("[object HTMLAllCollection]" === t10 || "[object HTML document.all class]" === t10 || "[object HTMLCollection]" === t10 || "[object Object]" === t10) && null == e12(""); + } catch (e13) { + } + return false; + }); + } + e11.exports = r8 ? function(e12) { + if (f8(e12)) + return true; + if (!e12) + return false; + if ("function" != typeof e12 && "object" != typeof e12) + return false; + try { + r8(e12, null, t9); + } catch (e13) { + if (e13 !== i8) + return false; + } + return !s7(e12) && a7(e12); + } : function(e12) { + if (f8(e12)) + return true; + if (!e12) + return false; + if ("function" != typeof e12 && "object" != typeof e12) + return false; + if (c7) + return a7(e12); + if (s7(e12)) + return false; + var t10 = p7.call(e12); + return !("[object Function]" !== t10 && "[object GeneratorFunction]" !== t10 && !/^\[object HTML/.test(t10)) && a7(e12); + }; + }, 8120: (e11, t9, i8) => { + "use strict"; + var n8 = String.prototype.valueOf, r8 = Object.prototype.toString, o7 = i8(51913)(); + e11.exports = function(e12) { + return "string" == typeof e12 || "object" == typeof e12 && (o7 ? function(e13) { + try { + return n8.call(e13), true; + } catch (e14) { + return false; + } + }(e12) : "[object String]" === r8.call(e12)); + }; + }, 1645: (e11) => { + "use strict"; + var t9 = e11.exports = function(e12, t10, n8) { + "function" == typeof t10 && (n8 = t10, t10 = {}), i8(t10, "function" == typeof (n8 = t10.cb || n8) ? n8 : n8.pre || function() { + }, n8.post || function() { + }, e12, "", e12); + }; + function i8(e12, n8, r8, o7, s7, a7, p7, c7, d7, f8) { + if (o7 && "object" == typeof o7 && !Array.isArray(o7)) { + for (var l7 in n8(o7, s7, a7, p7, c7, d7, f8), o7) { + var u7 = o7[l7]; + if (Array.isArray(u7)) { + if (l7 in t9.arrayKeywords) + for (var m7 = 0; m7 < u7.length; m7++) + i8(e12, n8, r8, u7[m7], s7 + "/" + l7 + "/" + m7, a7, s7, l7, o7, m7); + } else if (l7 in t9.propsKeywords) { + if (u7 && "object" == typeof u7) + for (var h8 in u7) + i8(e12, n8, r8, u7[h8], s7 + "/" + l7 + "/" + h8.replace(/~/g, "~0").replace(/\//g, "~1"), a7, s7, l7, o7, h8); + } else + (l7 in t9.keywords || e12.allKeys && !(l7 in t9.skipKeywords)) && i8(e12, n8, r8, u7, s7 + "/" + l7, a7, s7, l7, o7); + } + r8(o7, s7, a7, p7, c7, d7, f8); + } + } + t9.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true, if: true, then: true, else: true }, t9.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }, t9.propsKeywords = { $defs: true, definitions: true, properties: true, patternProperties: true, dependencies: true }, t9.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; + }, 45838: (e11, t9) => { + var i8 = /~/, n8 = /~[01]/g; + function r8(e12) { + switch (e12) { + case "~1": + return "/"; + case "~0": + return "~"; + } + throw new Error("Invalid tilde escape: " + e12); + } + function o7(e12) { + return i8.test(e12) ? e12.replace(n8, r8) : e12; + } + function s7(e12) { + if ("string" == typeof e12) { + if ("" === (e12 = e12.split("/"))[0]) + return e12; + throw new Error("Invalid JSON pointer."); + } + if (Array.isArray(e12)) { + for (const t10 of e12) + if ("string" != typeof t10 && "number" != typeof t10) + throw new Error("Invalid JSON pointer. Must be of type string or number."); + return e12; + } + throw new Error("Invalid JSON pointer."); + } + function a7(e12, t10) { + if ("object" != typeof e12) + throw new Error("Invalid input object."); + var i9 = (t10 = s7(t10)).length; + if (1 === i9) + return e12; + for (var n9 = 1; n9 < i9; ) { + if (e12 = e12[o7(t10[n9++])], i9 === n9) + return e12; + if ("object" != typeof e12 || null === e12) + return; + } + } + function p7(e12, t10, i9) { + if ("object" != typeof e12) + throw new Error("Invalid input object."); + if (0 === (t10 = s7(t10)).length) + throw new Error("Invalid JSON pointer for set."); + return function(e13, t11, i10) { + for (var n9, r9, s8 = 1, a8 = t11.length; s8 < a8; ) { + if ("constructor" === t11[s8] || "prototype" === t11[s8] || "__proto__" === t11[s8]) + return e13; + if (n9 = o7(t11[s8++]), r9 = a8 > s8, void 0 === e13[n9] && (Array.isArray(e13) && "-" === n9 && (n9 = e13.length), r9 && ("" !== t11[s8] && t11[s8] < 1 / 0 || "-" === t11[s8] ? e13[n9] = [] : e13[n9] = {})), !r9) + break; + e13 = e13[n9]; + } + var p8 = e13[n9]; + return void 0 === i10 ? delete e13[n9] : e13[n9] = i10, p8; + }(e12, t10, i9); + } + t9.get = a7, t9.set = p7, t9.compile = function(e12) { + var t10 = s7(e12); + return { get: function(e13) { + return a7(e13, t10); + }, set: function(e13, i9) { + return p7(e13, t10, i9); + } }; + }; + }, 76502: (e11) => { + "use strict"; + const t9 = [], i8 = [], n8 = (e12, n9) => { + if (e12 === n9) + return 0; + const r8 = e12; + e12.length > n9.length && (e12 = n9, n9 = r8); + let o7 = e12.length, s7 = n9.length; + for (; o7 > 0 && e12.charCodeAt(~-o7) === n9.charCodeAt(~-s7); ) + o7--, s7--; + let a7, p7, c7, d7, f8 = 0; + for (; f8 < o7 && e12.charCodeAt(f8) === n9.charCodeAt(f8); ) + f8++; + if (o7 -= f8, s7 -= f8, 0 === o7) + return s7; + let l7 = 0, u7 = 0; + for (; l7 < o7; ) + i8[l7] = e12.charCodeAt(f8 + l7), t9[l7] = ++l7; + for (; u7 < s7; ) + for (a7 = n9.charCodeAt(f8 + u7), c7 = u7++, p7 = u7, l7 = 0; l7 < o7; l7++) + d7 = a7 === i8[l7] ? c7 : c7 + 1, c7 = t9[l7], p7 = t9[l7] = c7 > p7 ? d7 > p7 ? p7 + 1 : d7 : d7 > c7 ? c7 + 1 : d7; + return p7; + }; + e11.exports = n8, e11.exports.default = n8; + }, 86981: (e11, t9, i8) => { + var n8, r8 = "__lodash_hash_undefined__", o7 = "[object Function]", s7 = "[object GeneratorFunction]", a7 = "[object Symbol]", p7 = /^\./, c7 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, d7 = /\\(\\)?/g, f8 = /^\[object .+?Constructor\]$/, l7 = "object" == typeof i8.g && i8.g && i8.g.Object === Object && i8.g, u7 = "object" == typeof self && self && self.Object === Object && self, m7 = l7 || u7 || Function("return this")(), h8 = Array.prototype, y7 = Function.prototype, g7 = Object.prototype, b8 = m7["__core-js_shared__"], v8 = (n8 = /[^.]+$/.exec(b8 && b8.keys && b8.keys.IE_PROTO || "")) ? "Symbol(src)_1." + n8 : "", j6 = y7.toString, $5 = g7.hasOwnProperty, x7 = g7.toString, _6 = RegExp("^" + j6.call($5).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), w6 = m7.Symbol, S6 = h8.splice, P6 = R6(m7, "Map"), O7 = R6(Object, "create"), T6 = w6 ? w6.prototype : void 0, A6 = T6 ? T6.toString : void 0; + function I6(e12) { + var t10 = -1, i9 = e12 ? e12.length : 0; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + function E6(e12) { + var t10 = -1, i9 = e12 ? e12.length : 0; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + function q5(e12) { + var t10 = -1, i9 = e12 ? e12.length : 0; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + function k6(e12, t10) { + for (var i9, n9, r9 = e12.length; r9--; ) + if ((i9 = e12[r9][0]) === (n9 = t10) || i9 != i9 && n9 != n9) + return r9; + return -1; + } + function M6(e12, t10) { + var i9, n9, r9 = e12.__data__; + return ("string" == (n9 = typeof (i9 = t10)) || "number" == n9 || "symbol" == n9 || "boolean" == n9 ? "__proto__" !== i9 : null === i9) ? r9["string" == typeof t10 ? "string" : "hash"] : r9.map; + } + function R6(e12, t10) { + var i9 = function(e13, t11) { + return null == e13 ? void 0 : e13[t11]; + }(e12, t10); + return function(e13) { + if (!F6(e13) || v8 && v8 in e13) + return false; + var t11 = function(e14) { + var t12 = F6(e14) ? x7.call(e14) : ""; + return t12 == o7 || t12 == s7; + }(e13) || function(e14) { + var t12 = false; + if (null != e14 && "function" != typeof e14.toString) + try { + t12 = !!(e14 + ""); + } catch (e15) { + } + return t12; + }(e13) ? _6 : f8; + return t11.test(function(e14) { + if (null != e14) { + try { + return j6.call(e14); + } catch (e15) { + } + try { + return e14 + ""; + } catch (e15) { + } + } + return ""; + }(e13)); + }(i9) ? i9 : void 0; + } + I6.prototype.clear = function() { + this.__data__ = O7 ? O7(null) : {}; + }, I6.prototype.delete = function(e12) { + return this.has(e12) && delete this.__data__[e12]; + }, I6.prototype.get = function(e12) { + var t10 = this.__data__; + if (O7) { + var i9 = t10[e12]; + return i9 === r8 ? void 0 : i9; + } + return $5.call(t10, e12) ? t10[e12] : void 0; + }, I6.prototype.has = function(e12) { + var t10 = this.__data__; + return O7 ? void 0 !== t10[e12] : $5.call(t10, e12); + }, I6.prototype.set = function(e12, t10) { + return this.__data__[e12] = O7 && void 0 === t10 ? r8 : t10, this; + }, E6.prototype.clear = function() { + this.__data__ = []; + }, E6.prototype.delete = function(e12) { + var t10 = this.__data__, i9 = k6(t10, e12); + return !(i9 < 0 || (i9 == t10.length - 1 ? t10.pop() : S6.call(t10, i9, 1), 0)); + }, E6.prototype.get = function(e12) { + var t10 = this.__data__, i9 = k6(t10, e12); + return i9 < 0 ? void 0 : t10[i9][1]; + }, E6.prototype.has = function(e12) { + return k6(this.__data__, e12) > -1; + }, E6.prototype.set = function(e12, t10) { + var i9 = this.__data__, n9 = k6(i9, e12); + return n9 < 0 ? i9.push([e12, t10]) : i9[n9][1] = t10, this; + }, q5.prototype.clear = function() { + this.__data__ = { hash: new I6(), map: new (P6 || E6)(), string: new I6() }; + }, q5.prototype.delete = function(e12) { + return M6(this, e12).delete(e12); + }, q5.prototype.get = function(e12) { + return M6(this, e12).get(e12); + }, q5.prototype.has = function(e12) { + return M6(this, e12).has(e12); + }, q5.prototype.set = function(e12, t10) { + return M6(this, e12).set(e12, t10), this; + }; + var D6 = V5(function(e12) { + var t10; + e12 = null == (t10 = e12) ? "" : function(e13) { + if ("string" == typeof e13) + return e13; + if (U6(e13)) + return A6 ? A6.call(e13) : ""; + var t11 = e13 + ""; + return "0" == t11 && 1 / e13 == -1 / 0 ? "-0" : t11; + }(t10); + var i9 = []; + return p7.test(e12) && i9.push(""), e12.replace(c7, function(e13, t11, n9, r9) { + i9.push(n9 ? r9.replace(d7, "$1") : t11 || e13); + }), i9; + }); + function C6(e12) { + if ("string" == typeof e12 || U6(e12)) + return e12; + var t10 = e12 + ""; + return "0" == t10 && 1 / e12 == -1 / 0 ? "-0" : t10; + } + function V5(e12, t10) { + if ("function" != typeof e12 || t10 && "function" != typeof t10) + throw new TypeError("Expected a function"); + var i9 = function() { + var n9 = arguments, r9 = t10 ? t10.apply(this, n9) : n9[0], o8 = i9.cache; + if (o8.has(r9)) + return o8.get(r9); + var s8 = e12.apply(this, n9); + return i9.cache = o8.set(r9, s8), s8; + }; + return i9.cache = new (V5.Cache || q5)(), i9; + } + V5.Cache = q5; + var N6 = Array.isArray; + function F6(e12) { + var t10 = typeof e12; + return !!e12 && ("object" == t10 || "function" == t10); + } + function U6(e12) { + return "symbol" == typeof e12 || /* @__PURE__ */ function(e13) { + return !!e13 && "object" == typeof e13; + }(e12) && x7.call(e12) == a7; + } + e11.exports = function(e12) { + return N6(e12) ? function(e13, t10) { + for (var i9 = -1, n9 = e13 ? e13.length : 0, r9 = Array(n9); ++i9 < n9; ) + r9[i9] = t10(e13[i9], i9, e13); + return r9; + }(e12, C6) : U6(e12) ? [e12] : function(e13, t10) { + var i9 = -1, n9 = e13.length; + for (t10 || (t10 = Array(n9)); ++i9 < n9; ) + t10[i9] = e13[i9]; + return t10; + }(D6(e12)); + }; + }, 25098: (e11, t9, i8) => { + var n8 = i8(23305), r8 = i8(39361), o7 = i8(11112), s7 = i8(25276), a7 = i8(57452); + function p7(e12) { + var t10 = -1, i9 = null == e12 ? 0 : e12.length; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + p7.prototype.clear = n8, p7.prototype.delete = r8, p7.prototype.get = o7, p7.prototype.has = s7, p7.prototype.set = a7, e11.exports = p7; + }, 1386: (e11, t9, i8) => { + var n8 = i8(12393), r8 = i8(62049), o7 = i8(7144), s7 = i8(7452), a7 = i8(13964); + function p7(e12) { + var t10 = -1, i9 = null == e12 ? 0 : e12.length; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + p7.prototype.clear = n8, p7.prototype.delete = r8, p7.prototype.get = o7, p7.prototype.has = s7, p7.prototype.set = a7, e11.exports = p7; + }, 19770: (e11, t9, i8) => { + var n8 = i8(94715)(i8(78942), "Map"); + e11.exports = n8; + }, 68250: (e11, t9, i8) => { + var n8 = i8(49753), r8 = i8(5681), o7 = i8(80088), s7 = i8(54732), a7 = i8(59068); + function p7(e12) { + var t10 = -1, i9 = null == e12 ? 0 : e12.length; + for (this.clear(); ++t10 < i9; ) { + var n9 = e12[t10]; + this.set(n9[0], n9[1]); + } + } + p7.prototype.clear = n8, p7.prototype.delete = r8, p7.prototype.get = o7, p7.prototype.has = s7, p7.prototype.set = a7, e11.exports = p7; + }, 65650: (e11, t9, i8) => { + var n8 = i8(78942).Symbol; + e11.exports = n8; + }, 65111: (e11) => { + e11.exports = function(e12, t9) { + for (var i8 = -1, n8 = null == e12 ? 0 : e12.length, r8 = Array(n8); ++i8 < n8; ) + r8[i8] = t9(e12[i8], i8, e12); + return r8; + }; + }, 3422: (e11, t9, i8) => { + var n8 = i8(57073), r8 = i8(46285), o7 = Object.prototype.hasOwnProperty; + e11.exports = function(e12, t10, i9) { + var s7 = e12[t10]; + o7.call(e12, t10) && r8(s7, i9) && (void 0 !== i9 || t10 in e12) || n8(e12, t10, i9); + }; + }, 97034: (e11, t9, i8) => { + var n8 = i8(46285); + e11.exports = function(e12, t10) { + for (var i9 = e12.length; i9--; ) + if (n8(e12[i9][0], t10)) + return i9; + return -1; + }; + }, 57073: (e11, t9, i8) => { + var n8 = i8(72532); + e11.exports = function(e12, t10, i9) { + "__proto__" == t10 && n8 ? n8(e12, t10, { configurable: true, enumerable: true, value: i9, writable: true }) : e12[t10] = i9; + }; + }, 57923: (e11, t9, i8) => { + var n8 = i8(93526), r8 = i8(66040); + e11.exports = function(e12, t10) { + for (var i9 = 0, o7 = (t10 = n8(t10, e12)).length; null != e12 && i9 < o7; ) + e12 = e12[r8(t10[i9++])]; + return i9 && i9 == o7 ? e12 : void 0; + }; + }, 87379: (e11, t9, i8) => { + var n8 = i8(65650), r8 = i8(8870), o7 = i8(29005), s7 = n8 ? n8.toStringTag : void 0; + e11.exports = function(e12) { + return null == e12 ? void 0 === e12 ? "[object Undefined]" : "[object Null]" : s7 && s7 in Object(e12) ? r8(e12) : o7(e12); + }; + }, 89624: (e11, t9, i8) => { + var n8 = i8(93655), r8 = i8(64759), o7 = i8(41580), s7 = i8(64066), a7 = /^\[object .+?Constructor\]$/, p7 = Function.prototype, c7 = Object.prototype, d7 = p7.toString, f8 = c7.hasOwnProperty, l7 = RegExp("^" + d7.call(f8).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"); + e11.exports = function(e12) { + return !(!o7(e12) || r8(e12)) && (n8(e12) ? l7 : a7).test(s7(e12)); + }; + }, 87655: (e11, t9, i8) => { + var n8 = i8(3422), r8 = i8(93526), o7 = i8(69632), s7 = i8(41580), a7 = i8(66040); + e11.exports = function(e12, t10, i9, p7) { + if (!s7(e12)) + return e12; + for (var c7 = -1, d7 = (t10 = r8(t10, e12)).length, f8 = d7 - 1, l7 = e12; null != l7 && ++c7 < d7; ) { + var u7 = a7(t10[c7]), m7 = i9; + if ("__proto__" === u7 || "constructor" === u7 || "prototype" === u7) + return e12; + if (c7 != f8) { + var h8 = l7[u7]; + void 0 === (m7 = p7 ? p7(h8, u7, l7) : void 0) && (m7 = s7(h8) ? h8 : o7(t10[c7 + 1]) ? [] : {}); + } + n8(l7, u7, m7), l7 = l7[u7]; + } + return e12; + }; + }, 52291: (e11, t9, i8) => { + var n8 = i8(65650), r8 = i8(65111), o7 = i8(53142), s7 = i8(51187), a7 = n8 ? n8.prototype : void 0, p7 = a7 ? a7.toString : void 0; + e11.exports = function e12(t10) { + if ("string" == typeof t10) + return t10; + if (o7(t10)) + return r8(t10, e12) + ""; + if (s7(t10)) + return p7 ? p7.call(t10) : ""; + var i9 = t10 + ""; + return "0" == i9 && 1 / t10 == -1 / 0 ? "-0" : i9; + }; + }, 93526: (e11, t9, i8) => { + var n8 = i8(53142), r8 = i8(65187), o7 = i8(96493), s7 = i8(95243); + e11.exports = function(e12, t10) { + return n8(e12) ? e12 : r8(e12, t10) ? [e12] : o7(s7(e12)); + }; + }, 41950: (e11, t9, i8) => { + var n8 = i8(78942)["__core-js_shared__"]; + e11.exports = n8; + }, 72532: (e11, t9, i8) => { + var n8 = i8(94715), r8 = function() { + try { + var e12 = n8(Object, "defineProperty"); + return e12({}, "", {}), e12; + } catch (e13) { + } + }(); + e11.exports = r8; + }, 74967: (e11, t9, i8) => { + var n8 = "object" == typeof i8.g && i8.g && i8.g.Object === Object && i8.g; + e11.exports = n8; + }, 44700: (e11, t9, i8) => { + var n8 = i8(79067); + e11.exports = function(e12, t10) { + var i9 = e12.__data__; + return n8(t10) ? i9["string" == typeof t10 ? "string" : "hash"] : i9.map; + }; + }, 94715: (e11, t9, i8) => { + var n8 = i8(89624), r8 = i8(20155); + e11.exports = function(e12, t10) { + var i9 = r8(e12, t10); + return n8(i9) ? i9 : void 0; + }; + }, 8870: (e11, t9, i8) => { + var n8 = i8(65650), r8 = Object.prototype, o7 = r8.hasOwnProperty, s7 = r8.toString, a7 = n8 ? n8.toStringTag : void 0; + e11.exports = function(e12) { + var t10 = o7.call(e12, a7), i9 = e12[a7]; + try { + e12[a7] = void 0; + var n9 = true; + } catch (e13) { + } + var r9 = s7.call(e12); + return n9 && (t10 ? e12[a7] = i9 : delete e12[a7]), r9; + }; + }, 20155: (e11) => { + e11.exports = function(e12, t9) { + return null == e12 ? void 0 : e12[t9]; + }; + }, 23305: (e11, t9, i8) => { + var n8 = i8(94497); + e11.exports = function() { + this.__data__ = n8 ? n8(null) : {}, this.size = 0; + }; + }, 39361: (e11) => { + e11.exports = function(e12) { + var t9 = this.has(e12) && delete this.__data__[e12]; + return this.size -= t9 ? 1 : 0, t9; + }; + }, 11112: (e11, t9, i8) => { + var n8 = i8(94497), r8 = Object.prototype.hasOwnProperty; + e11.exports = function(e12) { + var t10 = this.__data__; + if (n8) { + var i9 = t10[e12]; + return "__lodash_hash_undefined__" === i9 ? void 0 : i9; + } + return r8.call(t10, e12) ? t10[e12] : void 0; + }; + }, 25276: (e11, t9, i8) => { + var n8 = i8(94497), r8 = Object.prototype.hasOwnProperty; + e11.exports = function(e12) { + var t10 = this.__data__; + return n8 ? void 0 !== t10[e12] : r8.call(t10, e12); + }; + }, 57452: (e11, t9, i8) => { + var n8 = i8(94497); + e11.exports = function(e12, t10) { + var i9 = this.__data__; + return this.size += this.has(e12) ? 0 : 1, i9[e12] = n8 && void 0 === t10 ? "__lodash_hash_undefined__" : t10, this; + }; + }, 69632: (e11) => { + var t9 = /^(?:0|[1-9]\d*)$/; + e11.exports = function(e12, i8) { + var n8 = typeof e12; + return !!(i8 = null == i8 ? 9007199254740991 : i8) && ("number" == n8 || "symbol" != n8 && t9.test(e12)) && e12 > -1 && e12 % 1 == 0 && e12 < i8; + }; + }, 65187: (e11, t9, i8) => { + var n8 = i8(53142), r8 = i8(51187), o7 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, s7 = /^\w*$/; + e11.exports = function(e12, t10) { + if (n8(e12)) + return false; + var i9 = typeof e12; + return !("number" != i9 && "symbol" != i9 && "boolean" != i9 && null != e12 && !r8(e12)) || s7.test(e12) || !o7.test(e12) || null != t10 && e12 in Object(t10); + }; + }, 79067: (e11) => { + e11.exports = function(e12) { + var t9 = typeof e12; + return "string" == t9 || "number" == t9 || "symbol" == t9 || "boolean" == t9 ? "__proto__" !== e12 : null === e12; + }; + }, 64759: (e11, t9, i8) => { + var n8, r8 = i8(41950), o7 = (n8 = /[^.]+$/.exec(r8 && r8.keys && r8.keys.IE_PROTO || "")) ? "Symbol(src)_1." + n8 : ""; + e11.exports = function(e12) { + return !!o7 && o7 in e12; + }; + }, 12393: (e11) => { + e11.exports = function() { + this.__data__ = [], this.size = 0; + }; + }, 62049: (e11, t9, i8) => { + var n8 = i8(97034), r8 = Array.prototype.splice; + e11.exports = function(e12) { + var t10 = this.__data__, i9 = n8(t10, e12); + return !(i9 < 0 || (i9 == t10.length - 1 ? t10.pop() : r8.call(t10, i9, 1), --this.size, 0)); + }; + }, 7144: (e11, t9, i8) => { + var n8 = i8(97034); + e11.exports = function(e12) { + var t10 = this.__data__, i9 = n8(t10, e12); + return i9 < 0 ? void 0 : t10[i9][1]; + }; + }, 7452: (e11, t9, i8) => { + var n8 = i8(97034); + e11.exports = function(e12) { + return n8(this.__data__, e12) > -1; + }; + }, 13964: (e11, t9, i8) => { + var n8 = i8(97034); + e11.exports = function(e12, t10) { + var i9 = this.__data__, r8 = n8(i9, e12); + return r8 < 0 ? (++this.size, i9.push([e12, t10])) : i9[r8][1] = t10, this; + }; + }, 49753: (e11, t9, i8) => { + var n8 = i8(25098), r8 = i8(1386), o7 = i8(19770); + e11.exports = function() { + this.size = 0, this.__data__ = { hash: new n8(), map: new (o7 || r8)(), string: new n8() }; + }; + }, 5681: (e11, t9, i8) => { + var n8 = i8(44700); + e11.exports = function(e12) { + var t10 = n8(this, e12).delete(e12); + return this.size -= t10 ? 1 : 0, t10; + }; + }, 80088: (e11, t9, i8) => { + var n8 = i8(44700); + e11.exports = function(e12) { + return n8(this, e12).get(e12); + }; + }, 54732: (e11, t9, i8) => { + var n8 = i8(44700); + e11.exports = function(e12) { + return n8(this, e12).has(e12); + }; + }, 59068: (e11, t9, i8) => { + var n8 = i8(44700); + e11.exports = function(e12, t10) { + var i9 = n8(this, e12), r8 = i9.size; + return i9.set(e12, t10), this.size += i9.size == r8 ? 0 : 1, this; + }; + }, 76853: (e11, t9, i8) => { + var n8 = i8(69011); + e11.exports = function(e12) { + var t10 = n8(e12, function(e13) { + return 500 === i9.size && i9.clear(), e13; + }), i9 = t10.cache; + return t10; + }; + }, 94497: (e11, t9, i8) => { + var n8 = i8(94715)(Object, "create"); + e11.exports = n8; + }, 29005: (e11) => { + var t9 = Object.prototype.toString; + e11.exports = function(e12) { + return t9.call(e12); + }; + }, 78942: (e11, t9, i8) => { + var n8 = i8(74967), r8 = "object" == typeof self && self && self.Object === Object && self, o7 = n8 || r8 || Function("return this")(); + e11.exports = o7; + }, 96493: (e11, t9, i8) => { + var n8 = i8(76853), r8 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, o7 = /\\(\\)?/g, s7 = n8(function(e12) { + var t10 = []; + return 46 === e12.charCodeAt(0) && t10.push(""), e12.replace(r8, function(e13, i9, n9, r9) { + t10.push(n9 ? r9.replace(o7, "$1") : i9 || e13); + }), t10; + }); + e11.exports = s7; + }, 66040: (e11, t9, i8) => { + var n8 = i8(51187); + e11.exports = function(e12) { + if ("string" == typeof e12 || n8(e12)) + return e12; + var t10 = e12 + ""; + return "0" == t10 && 1 / e12 == -1 / 0 ? "-0" : t10; + }; + }, 64066: (e11) => { + var t9 = Function.prototype.toString; + e11.exports = function(e12) { + if (null != e12) { + try { + return t9.call(e12); + } catch (e13) { + } + try { + return e12 + ""; + } catch (e13) { + } + } + return ""; + }; + }, 46285: (e11) => { + e11.exports = function(e12, t9) { + return e12 === t9 || e12 != e12 && t9 != t9; + }; + }, 46123: (e11, t9, i8) => { + var n8 = i8(57923); + e11.exports = function(e12, t10, i9) { + var r8 = null == e12 ? void 0 : n8(e12, t10); + return void 0 === r8 ? i9 : r8; + }; + }, 53142: (e11) => { + var t9 = Array.isArray; + e11.exports = t9; + }, 93655: (e11, t9, i8) => { + var n8 = i8(87379), r8 = i8(41580); + e11.exports = function(e12) { + if (!r8(e12)) + return false; + var t10 = n8(e12); + return "[object Function]" == t10 || "[object GeneratorFunction]" == t10 || "[object AsyncFunction]" == t10 || "[object Proxy]" == t10; + }; + }, 41580: (e11) => { + e11.exports = function(e12) { + var t9 = typeof e12; + return null != e12 && ("object" == t9 || "function" == t9); + }; + }, 80547: (e11) => { + e11.exports = function(e12) { + return null != e12 && "object" == typeof e12; + }; + }, 51187: (e11, t9, i8) => { + var n8 = i8(87379), r8 = i8(80547); + e11.exports = function(e12) { + return "symbol" == typeof e12 || r8(e12) && "[object Symbol]" == n8(e12); + }; + }, 45250: function(e11, t9, i8) { + var n8; + e11 = i8.nmd(e11), function() { + var r8, o7 = "Expected a function", s7 = "__lodash_hash_undefined__", a7 = "__lodash_placeholder__", p7 = 32, c7 = 128, d7 = 1 / 0, f8 = 9007199254740991, l7 = NaN, u7 = 4294967295, m7 = [["ary", c7], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", p7], ["partialRight", 64], ["rearg", 256]], h8 = "[object Arguments]", y7 = "[object Array]", g7 = "[object Boolean]", b8 = "[object Date]", v8 = "[object Error]", j6 = "[object Function]", $5 = "[object GeneratorFunction]", x7 = "[object Map]", _6 = "[object Number]", w6 = "[object Object]", S6 = "[object Promise]", P6 = "[object RegExp]", O7 = "[object Set]", T6 = "[object String]", A6 = "[object Symbol]", I6 = "[object WeakMap]", E6 = "[object ArrayBuffer]", q5 = "[object DataView]", k6 = "[object Float32Array]", M6 = "[object Float64Array]", R6 = "[object Int8Array]", D6 = "[object Int16Array]", C6 = "[object Int32Array]", V5 = "[object Uint8Array]", N6 = "[object Uint8ClampedArray]", F6 = "[object Uint16Array]", U6 = "[object Uint32Array]", L6 = /\b__p \+= '';/g, z6 = /\b(__p \+=) '' \+/g, B6 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Q5 = /&(?:amp|lt|gt|quot|#39);/g, K5 = /[&<>"']/g, H5 = RegExp(Q5.source), G5 = RegExp(K5.source), W5 = /<%-([\s\S]+?)%>/g, J5 = /<%([\s\S]+?)%>/g, Z5 = /<%=([\s\S]+?)%>/g, Y6 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, X5 = /^\w*$/, ee4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, te4 = /[\\^$.*+?()[\]{}|]/g, ie3 = RegExp(te4.source), ne4 = /^\s+/, re4 = /\s/, oe4 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, se4 = /\{\n\/\* \[wrapped with (.+)\] \*/, ae4 = /,? & /, pe4 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, ce4 = /[()=,{}\[\]\/\s]/, de4 = /\\(\\)?/g, fe4 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, le4 = /\w*$/, ue4 = /^[-+]0x[0-9a-f]+$/i, me4 = /^0b[01]+$/i, he4 = /^\[object .+?Constructor\]$/, ye4 = /^0o[0-7]+$/i, ge4 = /^(?:0|[1-9]\d*)$/, be4 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, ve4 = /($^)/, je4 = /['\n\r\u2028\u2029\\]/g, $e2 = "\\ud800-\\udfff", xe2 = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", _e2 = "\\u2700-\\u27bf", we4 = "a-z\\xdf-\\xf6\\xf8-\\xff", Se4 = "A-Z\\xc0-\\xd6\\xd8-\\xde", Pe2 = "\\ufe0e\\ufe0f", Oe4 = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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", Te = "[" + $e2 + "]", Ae4 = "[" + Oe4 + "]", Ie2 = "[" + xe2 + "]", Ee4 = "\\d+", qe2 = "[" + _e2 + "]", ke3 = "[" + we4 + "]", Me2 = "[^" + $e2 + Oe4 + Ee4 + _e2 + we4 + Se4 + "]", Re2 = "\\ud83c[\\udffb-\\udfff]", De2 = "[^" + $e2 + "]", Ce = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ve = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ne2 = "[" + Se4 + "]", Fe = "\\u200d", Ue = "(?:" + ke3 + "|" + Me2 + ")", Le2 = "(?:" + Ne2 + "|" + Me2 + ")", ze2 = "(?:['\u2019](?:d|ll|m|re|s|t|ve))?", Be3 = "(?:['\u2019](?:D|LL|M|RE|S|T|VE))?", Qe = "(?:" + Ie2 + "|" + Re2 + ")?", Ke = "[" + Pe2 + "]?", He = Ke + Qe + "(?:" + Fe + "(?:" + [De2, Ce, Ve].join("|") + ")" + Ke + Qe + ")*", Ge = "(?:" + [qe2, Ce, Ve].join("|") + ")" + He, We = "(?:" + [De2 + Ie2 + "?", Ie2, Ce, Ve, Te].join("|") + ")", Je = RegExp("['\u2019]", "g"), Ze = RegExp(Ie2, "g"), Ye = RegExp(Re2 + "(?=" + Re2 + ")|" + We + He, "g"), Xe = RegExp([Ne2 + "?" + ke3 + "+" + ze2 + "(?=" + [Ae4, Ne2, "$"].join("|") + ")", Le2 + "+" + Be3 + "(?=" + [Ae4, Ne2 + Ue, "$"].join("|") + ")", Ne2 + "?" + Ue + "+" + ze2, Ne2 + "+" + Be3, "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Ee4, Ge].join("|"), "g"), et3 = RegExp("[" + Fe + $e2 + xe2 + Pe2 + "]"), tt3 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, it2 = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], nt2 = -1, rt = {}; + rt[k6] = rt[M6] = rt[R6] = rt[D6] = rt[C6] = rt[V5] = rt[N6] = rt[F6] = rt[U6] = true, rt[h8] = rt[y7] = rt[E6] = rt[g7] = rt[q5] = rt[b8] = rt[v8] = rt[j6] = rt[x7] = rt[_6] = rt[w6] = rt[P6] = rt[O7] = rt[T6] = rt[I6] = false; + var ot = {}; + ot[h8] = ot[y7] = ot[E6] = ot[q5] = ot[g7] = ot[b8] = ot[k6] = ot[M6] = ot[R6] = ot[D6] = ot[C6] = ot[x7] = ot[_6] = ot[w6] = ot[P6] = ot[O7] = ot[T6] = ot[A6] = ot[V5] = ot[N6] = ot[F6] = ot[U6] = true, ot[v8] = ot[j6] = ot[I6] = false; + var st2 = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, at2 = parseFloat, pt = parseInt, ct = "object" == typeof i8.g && i8.g && i8.g.Object === Object && i8.g, dt = "object" == typeof self && self && self.Object === Object && self, ft = ct || dt || Function("return this")(), lt2 = t9 && !t9.nodeType && t9, ut = lt2 && e11 && !e11.nodeType && e11, mt = ut && ut.exports === lt2, ht2 = mt && ct.process, yt = function() { + try { + return ut && ut.require && ut.require("util").types || ht2 && ht2.binding && ht2.binding("util"); + } catch (e12) { + } + }(), gt2 = yt && yt.isArrayBuffer, bt = yt && yt.isDate, vt = yt && yt.isMap, jt = yt && yt.isRegExp, $t = yt && yt.isSet, xt = yt && yt.isTypedArray; + function _t2(e12, t10, i9) { + switch (i9.length) { + case 0: + return e12.call(t10); + case 1: + return e12.call(t10, i9[0]); + case 2: + return e12.call(t10, i9[0], i9[1]); + case 3: + return e12.call(t10, i9[0], i9[1], i9[2]); + } + return e12.apply(t10, i9); + } + function wt(e12, t10, i9, n9) { + for (var r9 = -1, o8 = null == e12 ? 0 : e12.length; ++r9 < o8; ) { + var s8 = e12[r9]; + t10(n9, s8, i9(s8), e12); + } + return n9; + } + function St(e12, t10) { + for (var i9 = -1, n9 = null == e12 ? 0 : e12.length; ++i9 < n9 && false !== t10(e12[i9], i9, e12); ) + ; + return e12; + } + function Pt(e12, t10) { + for (var i9 = null == e12 ? 0 : e12.length; i9-- && false !== t10(e12[i9], i9, e12); ) + ; + return e12; + } + function Ot(e12, t10) { + for (var i9 = -1, n9 = null == e12 ? 0 : e12.length; ++i9 < n9; ) + if (!t10(e12[i9], i9, e12)) + return false; + return true; + } + function Tt(e12, t10) { + for (var i9 = -1, n9 = null == e12 ? 0 : e12.length, r9 = 0, o8 = []; ++i9 < n9; ) { + var s8 = e12[i9]; + t10(s8, i9, e12) && (o8[r9++] = s8); + } + return o8; + } + function At(e12, t10) { + return !(null == e12 || !e12.length) && Nt(e12, t10, 0) > -1; + } + function It(e12, t10, i9) { + for (var n9 = -1, r9 = null == e12 ? 0 : e12.length; ++n9 < r9; ) + if (i9(t10, e12[n9])) + return true; + return false; + } + function Et(e12, t10) { + for (var i9 = -1, n9 = null == e12 ? 0 : e12.length, r9 = Array(n9); ++i9 < n9; ) + r9[i9] = t10(e12[i9], i9, e12); + return r9; + } + function qt(e12, t10) { + for (var i9 = -1, n9 = t10.length, r9 = e12.length; ++i9 < n9; ) + e12[r9 + i9] = t10[i9]; + return e12; + } + function kt(e12, t10, i9, n9) { + var r9 = -1, o8 = null == e12 ? 0 : e12.length; + for (n9 && o8 && (i9 = e12[++r9]); ++r9 < o8; ) + i9 = t10(i9, e12[r9], r9, e12); + return i9; + } + function Mt(e12, t10, i9, n9) { + var r9 = null == e12 ? 0 : e12.length; + for (n9 && r9 && (i9 = e12[--r9]); r9--; ) + i9 = t10(i9, e12[r9], r9, e12); + return i9; + } + function Rt(e12, t10) { + for (var i9 = -1, n9 = null == e12 ? 0 : e12.length; ++i9 < n9; ) + if (t10(e12[i9], i9, e12)) + return true; + return false; + } + var Dt = zt("length"); + function Ct(e12, t10, i9) { + var n9; + return i9(e12, function(e13, i10, r9) { + if (t10(e13, i10, r9)) + return n9 = i10, false; + }), n9; + } + function Vt(e12, t10, i9, n9) { + for (var r9 = e12.length, o8 = i9 + (n9 ? 1 : -1); n9 ? o8-- : ++o8 < r9; ) + if (t10(e12[o8], o8, e12)) + return o8; + return -1; + } + function Nt(e12, t10, i9) { + return t10 == t10 ? function(e13, t11, i10) { + for (var n9 = i10 - 1, r9 = e13.length; ++n9 < r9; ) + if (e13[n9] === t11) + return n9; + return -1; + }(e12, t10, i9) : Vt(e12, Ut, i9); + } + function Ft(e12, t10, i9, n9) { + for (var r9 = i9 - 1, o8 = e12.length; ++r9 < o8; ) + if (n9(e12[r9], t10)) + return r9; + return -1; + } + function Ut(e12) { + return e12 != e12; + } + function Lt(e12, t10) { + var i9 = null == e12 ? 0 : e12.length; + return i9 ? Kt(e12, t10) / i9 : l7; + } + function zt(e12) { + return function(t10) { + return null == t10 ? r8 : t10[e12]; + }; + } + function Bt(e12) { + return function(t10) { + return null == e12 ? r8 : e12[t10]; + }; + } + function Qt(e12, t10, i9, n9, r9) { + return r9(e12, function(e13, r10, o8) { + i9 = n9 ? (n9 = false, e13) : t10(i9, e13, r10, o8); + }), i9; + } + function Kt(e12, t10) { + for (var i9, n9 = -1, o8 = e12.length; ++n9 < o8; ) { + var s8 = t10(e12[n9]); + s8 !== r8 && (i9 = i9 === r8 ? s8 : i9 + s8); + } + return i9; + } + function Ht(e12, t10) { + for (var i9 = -1, n9 = Array(e12); ++i9 < e12; ) + n9[i9] = t10(i9); + return n9; + } + function Gt(e12) { + return e12 ? e12.slice(0, fi(e12) + 1).replace(ne4, "") : e12; + } + function Wt(e12) { + return function(t10) { + return e12(t10); + }; + } + function Jt(e12, t10) { + return Et(t10, function(t11) { + return e12[t11]; + }); + } + function Zt(e12, t10) { + return e12.has(t10); + } + function Yt(e12, t10) { + for (var i9 = -1, n9 = e12.length; ++i9 < n9 && Nt(t10, e12[i9], 0) > -1; ) + ; + return i9; + } + function Xt(e12, t10) { + for (var i9 = e12.length; i9-- && Nt(t10, e12[i9], 0) > -1; ) + ; + return i9; + } + var ei = Bt({ \u00C0: "A", \u00C1: "A", \u00C2: "A", \u00C3: "A", \u00C4: "A", \u00C5: "A", \u00E0: "a", \u00E1: "a", \u00E2: "a", \u00E3: "a", \u00E4: "a", \u00E5: "a", \u00C7: "C", \u00E7: "c", \u00D0: "D", \u00F0: "d", \u00C8: "E", \u00C9: "E", \u00CA: "E", \u00CB: "E", \u00E8: "e", \u00E9: "e", \u00EA: "e", \u00EB: "e", \u00CC: "I", \u00CD: "I", \u00CE: "I", \u00CF: "I", \u00EC: "i", \u00ED: "i", \u00EE: "i", \u00EF: "i", \u00D1: "N", \u00F1: "n", \u00D2: "O", \u00D3: "O", \u00D4: "O", \u00D5: "O", \u00D6: "O", \u00D8: "O", \u00F2: "o", \u00F3: "o", \u00F4: "o", \u00F5: "o", \u00F6: "o", \u00F8: "o", \u00D9: "U", \u00DA: "U", \u00DB: "U", \u00DC: "U", \u00F9: "u", \u00FA: "u", \u00FB: "u", \u00FC: "u", \u00DD: "Y", \u00FD: "y", \u00FF: "y", \u00C6: "Ae", \u00E6: "ae", \u00DE: "Th", \u00FE: "th", \u00DF: "ss", \u0100: "A", \u0102: "A", \u0104: "A", \u0101: "a", \u0103: "a", \u0105: "a", \u0106: "C", \u0108: "C", \u010A: "C", \u010C: "C", \u0107: "c", \u0109: "c", \u010B: "c", \u010D: "c", \u010E: "D", \u0110: "D", \u010F: "d", \u0111: "d", \u0112: "E", \u0114: "E", \u0116: "E", \u0118: "E", \u011A: "E", \u0113: "e", \u0115: "e", \u0117: "e", \u0119: "e", \u011B: "e", \u011C: "G", \u011E: "G", \u0120: "G", \u0122: "G", \u011D: "g", \u011F: "g", \u0121: "g", \u0123: "g", \u0124: "H", \u0126: "H", \u0125: "h", \u0127: "h", \u0128: "I", \u012A: "I", \u012C: "I", \u012E: "I", \u0130: "I", \u0129: "i", \u012B: "i", \u012D: "i", \u012F: "i", \u0131: "i", \u0134: "J", \u0135: "j", \u0136: "K", \u0137: "k", \u0138: "k", \u0139: "L", \u013B: "L", \u013D: "L", \u013F: "L", \u0141: "L", \u013A: "l", \u013C: "l", \u013E: "l", \u0140: "l", \u0142: "l", \u0143: "N", \u0145: "N", \u0147: "N", \u014A: "N", \u0144: "n", \u0146: "n", \u0148: "n", \u014B: "n", \u014C: "O", \u014E: "O", \u0150: "O", \u014D: "o", \u014F: "o", \u0151: "o", \u0154: "R", \u0156: "R", \u0158: "R", \u0155: "r", \u0157: "r", \u0159: "r", \u015A: "S", \u015C: "S", \u015E: "S", \u0160: "S", \u015B: "s", \u015D: "s", \u015F: "s", \u0161: "s", \u0162: "T", \u0164: "T", \u0166: "T", \u0163: "t", \u0165: "t", \u0167: "t", \u0168: "U", \u016A: "U", \u016C: "U", \u016E: "U", \u0170: "U", \u0172: "U", \u0169: "u", \u016B: "u", \u016D: "u", \u016F: "u", \u0171: "u", \u0173: "u", \u0174: "W", \u0175: "w", \u0176: "Y", \u0177: "y", \u0178: "Y", \u0179: "Z", \u017B: "Z", \u017D: "Z", \u017A: "z", \u017C: "z", \u017E: "z", \u0132: "IJ", \u0133: "ij", \u0152: "Oe", \u0153: "oe", \u0149: "'n", \u017F: "s" }), ti = Bt({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }); + function ii(e12) { + return "\\" + st2[e12]; + } + function ni(e12) { + return et3.test(e12); + } + function ri(e12) { + var t10 = -1, i9 = Array(e12.size); + return e12.forEach(function(e13, n9) { + i9[++t10] = [n9, e13]; + }), i9; + } + function oi(e12, t10) { + return function(i9) { + return e12(t10(i9)); + }; + } + function si(e12, t10) { + for (var i9 = -1, n9 = e12.length, r9 = 0, o8 = []; ++i9 < n9; ) { + var s8 = e12[i9]; + s8 !== t10 && s8 !== a7 || (e12[i9] = a7, o8[r9++] = i9); + } + return o8; + } + function ai(e12) { + var t10 = -1, i9 = Array(e12.size); + return e12.forEach(function(e13) { + i9[++t10] = e13; + }), i9; + } + function pi(e12) { + var t10 = -1, i9 = Array(e12.size); + return e12.forEach(function(e13) { + i9[++t10] = [e13, e13]; + }), i9; + } + function ci(e12) { + return ni(e12) ? function(e13) { + for (var t10 = Ye.lastIndex = 0; Ye.test(e13); ) + ++t10; + return t10; + }(e12) : Dt(e12); + } + function di(e12) { + return ni(e12) ? function(e13) { + return e13.match(Ye) || []; + }(e12) : function(e13) { + return e13.split(""); + }(e12); + } + function fi(e12) { + for (var t10 = e12.length; t10-- && re4.test(e12.charAt(t10)); ) + ; + return t10; + } + var li = Bt({ "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }), ui = function e12(t10) { + var i9, n9 = (t10 = null == t10 ? ft : ui.defaults(ft.Object(), t10, ui.pick(ft, it2))).Array, re5 = t10.Date, $e3 = t10.Error, xe3 = t10.Function, _e3 = t10.Math, we5 = t10.Object, Se5 = t10.RegExp, Pe3 = t10.String, Oe5 = t10.TypeError, Te2 = n9.prototype, Ae5 = xe3.prototype, Ie3 = we5.prototype, Ee5 = t10["__core-js_shared__"], qe3 = Ae5.toString, ke4 = Ie3.hasOwnProperty, Me3 = 0, Re3 = (i9 = /[^.]+$/.exec(Ee5 && Ee5.keys && Ee5.keys.IE_PROTO || "")) ? "Symbol(src)_1." + i9 : "", De3 = Ie3.toString, Ce2 = qe3.call(we5), Ve2 = ft._, Ne3 = Se5("^" + qe3.call(ke4).replace(te4, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Fe2 = mt ? t10.Buffer : r8, Ue2 = t10.Symbol, Le3 = t10.Uint8Array, ze3 = Fe2 ? Fe2.allocUnsafe : r8, Be4 = oi(we5.getPrototypeOf, we5), Qe2 = we5.create, Ke2 = Ie3.propertyIsEnumerable, He2 = Te2.splice, Ge2 = Ue2 ? Ue2.isConcatSpreadable : r8, We2 = Ue2 ? Ue2.iterator : r8, Ye2 = Ue2 ? Ue2.toStringTag : r8, et4 = function() { + try { + var e13 = po(we5, "defineProperty"); + return e13({}, "", {}), e13; + } catch (e14) { + } + }(), st3 = t10.clearTimeout !== ft.clearTimeout && t10.clearTimeout, ct2 = re5 && re5.now !== ft.Date.now && re5.now, dt2 = t10.setTimeout !== ft.setTimeout && t10.setTimeout, lt3 = _e3.ceil, ut2 = _e3.floor, ht3 = we5.getOwnPropertySymbols, yt2 = Fe2 ? Fe2.isBuffer : r8, Dt2 = t10.isFinite, Bt2 = Te2.join, mi = oi(we5.keys, we5), hi = _e3.max, yi = _e3.min, gi = re5.now, bi = t10.parseInt, vi = _e3.random, ji = Te2.reverse, $i = po(t10, "DataView"), xi = po(t10, "Map"), _i = po(t10, "Promise"), wi = po(t10, "Set"), Si = po(t10, "WeakMap"), Pi = po(we5, "create"), Oi = Si && new Si(), Ti = {}, Ai = Co($i), Ii = Co(xi), Ei = Co(_i), qi = Co(wi), ki = Co(Si), Mi = Ue2 ? Ue2.prototype : r8, Ri = Mi ? Mi.valueOf : r8, Di = Mi ? Mi.toString : r8; + function Ci(e13) { + if (ea(e13) && !zs(e13) && !(e13 instanceof Ui)) { + if (e13 instanceof Fi) + return e13; + if (ke4.call(e13, "__wrapped__")) + return Vo(e13); + } + return new Fi(e13); + } + var Vi = /* @__PURE__ */ function() { + function e13() { + } + return function(t11) { + if (!Xs(t11)) + return {}; + if (Qe2) + return Qe2(t11); + e13.prototype = t11; + var i10 = new e13(); + return e13.prototype = r8, i10; + }; + }(); + function Ni() { + } + function Fi(e13, t11) { + this.__wrapped__ = e13, this.__actions__ = [], this.__chain__ = !!t11, this.__index__ = 0, this.__values__ = r8; + } + function Ui(e13) { + this.__wrapped__ = e13, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = u7, this.__views__ = []; + } + function Li(e13) { + var t11 = -1, i10 = null == e13 ? 0 : e13.length; + for (this.clear(); ++t11 < i10; ) { + var n10 = e13[t11]; + this.set(n10[0], n10[1]); + } + } + function zi(e13) { + var t11 = -1, i10 = null == e13 ? 0 : e13.length; + for (this.clear(); ++t11 < i10; ) { + var n10 = e13[t11]; + this.set(n10[0], n10[1]); + } + } + function Bi(e13) { + var t11 = -1, i10 = null == e13 ? 0 : e13.length; + for (this.clear(); ++t11 < i10; ) { + var n10 = e13[t11]; + this.set(n10[0], n10[1]); + } + } + function Qi(e13) { + var t11 = -1, i10 = null == e13 ? 0 : e13.length; + for (this.__data__ = new Bi(); ++t11 < i10; ) + this.add(e13[t11]); + } + function Ki(e13) { + var t11 = this.__data__ = new zi(e13); + this.size = t11.size; + } + function Hi(e13, t11) { + var i10 = zs(e13), n10 = !i10 && Ls(e13), r9 = !i10 && !n10 && Hs(e13), o8 = !i10 && !n10 && !r9 && pa(e13), s8 = i10 || n10 || r9 || o8, a8 = s8 ? Ht(e13.length, Pe3) : [], p8 = a8.length; + for (var c8 in e13) + !t11 && !ke4.call(e13, c8) || s8 && ("length" == c8 || r9 && ("offset" == c8 || "parent" == c8) || o8 && ("buffer" == c8 || "byteLength" == c8 || "byteOffset" == c8) || yo(c8, p8)) || a8.push(c8); + return a8; + } + function Gi(e13) { + var t11 = e13.length; + return t11 ? e13[Qn(0, t11 - 1)] : r8; + } + function Wi(e13, t11) { + return qo(Pr(e13), on4(t11, 0, e13.length)); + } + function Ji(e13) { + return qo(Pr(e13)); + } + function Zi(e13, t11, i10) { + (i10 !== r8 && !Ns(e13[t11], i10) || i10 === r8 && !(t11 in e13)) && nn(e13, t11, i10); + } + function Yi(e13, t11, i10) { + var n10 = e13[t11]; + ke4.call(e13, t11) && Ns(n10, i10) && (i10 !== r8 || t11 in e13) || nn(e13, t11, i10); + } + function Xi(e13, t11) { + for (var i10 = e13.length; i10--; ) + if (Ns(e13[i10][0], t11)) + return i10; + return -1; + } + function en(e13, t11, i10, n10) { + return dn(e13, function(e14, r9, o8) { + t11(n10, e14, i10(e14), o8); + }), n10; + } + function tn(e13, t11) { + return e13 && Or(t11, Ia(t11), e13); + } + function nn(e13, t11, i10) { + "__proto__" == t11 && et4 ? et4(e13, t11, { configurable: true, enumerable: true, value: i10, writable: true }) : e13[t11] = i10; + } + function rn(e13, t11) { + for (var i10 = -1, o8 = t11.length, s8 = n9(o8), a8 = null == e13; ++i10 < o8; ) + s8[i10] = a8 ? r8 : Sa(e13, t11[i10]); + return s8; + } + function on4(e13, t11, i10) { + return e13 == e13 && (i10 !== r8 && (e13 = e13 <= i10 ? e13 : i10), t11 !== r8 && (e13 = e13 >= t11 ? e13 : t11)), e13; + } + function sn(e13, t11, i10, n10, o8, s8) { + var a8, p8 = 1 & t11, c8 = 2 & t11, d8 = 4 & t11; + if (i10 && (a8 = o8 ? i10(e13, n10, o8, s8) : i10(e13)), a8 !== r8) + return a8; + if (!Xs(e13)) + return e13; + var f9 = zs(e13); + if (f9) { + if (a8 = function(e14) { + var t12 = e14.length, i11 = new e14.constructor(t12); + return t12 && "string" == typeof e14[0] && ke4.call(e14, "index") && (i11.index = e14.index, i11.input = e14.input), i11; + }(e13), !p8) + return Pr(e13, a8); + } else { + var l8 = lo(e13), u8 = l8 == j6 || l8 == $5; + if (Hs(e13)) + return jr(e13, p8); + if (l8 == w6 || l8 == h8 || u8 && !o8) { + if (a8 = c8 || u8 ? {} : mo(e13), !p8) + return c8 ? function(e14, t12) { + return Or(e14, fo(e14), t12); + }(e13, function(e14, t12) { + return e14 && Or(t12, Ea(t12), e14); + }(a8, e13)) : function(e14, t12) { + return Or(e14, co(e14), t12); + }(e13, tn(a8, e13)); + } else { + if (!ot[l8]) + return o8 ? e13 : {}; + a8 = function(e14, t12, i11) { + var n11, r9 = e14.constructor; + switch (t12) { + case E6: + return $r(e14); + case g7: + case b8: + return new r9(+e14); + case q5: + return function(e15, t13) { + var i12 = t13 ? $r(e15.buffer) : e15.buffer; + return new e15.constructor(i12, e15.byteOffset, e15.byteLength); + }(e14, i11); + case k6: + case M6: + case R6: + case D6: + case C6: + case V5: + case N6: + case F6: + case U6: + return xr(e14, i11); + case x7: + return new r9(); + case _6: + case T6: + return new r9(e14); + case P6: + return function(e15) { + var t13 = new e15.constructor(e15.source, le4.exec(e15)); + return t13.lastIndex = e15.lastIndex, t13; + }(e14); + case O7: + return new r9(); + case A6: + return n11 = e14, Ri ? we5(Ri.call(n11)) : {}; + } + }(e13, l8, p8); + } + } + s8 || (s8 = new Ki()); + var m8 = s8.get(e13); + if (m8) + return m8; + s8.set(e13, a8), oa(e13) ? e13.forEach(function(n11) { + a8.add(sn(n11, t11, i10, n11, e13, s8)); + }) : ta(e13) && e13.forEach(function(n11, r9) { + a8.set(r9, sn(n11, t11, i10, r9, e13, s8)); + }); + var y8 = f9 ? r8 : (d8 ? c8 ? to : eo : c8 ? Ea : Ia)(e13); + return St(y8 || e13, function(n11, r9) { + y8 && (n11 = e13[r9 = n11]), Yi(a8, r9, sn(n11, t11, i10, r9, e13, s8)); + }), a8; + } + function an(e13, t11, i10) { + var n10 = i10.length; + if (null == e13) + return !n10; + for (e13 = we5(e13); n10--; ) { + var o8 = i10[n10], s8 = t11[o8], a8 = e13[o8]; + if (a8 === r8 && !(o8 in e13) || !s8(a8)) + return false; + } + return true; + } + function pn(e13, t11, i10) { + if ("function" != typeof e13) + throw new Oe5(o7); + return To(function() { + e13.apply(r8, i10); + }, t11); + } + function cn(e13, t11, i10, n10) { + var r9 = -1, o8 = At, s8 = true, a8 = e13.length, p8 = [], c8 = t11.length; + if (!a8) + return p8; + i10 && (t11 = Et(t11, Wt(i10))), n10 ? (o8 = It, s8 = false) : t11.length >= 200 && (o8 = Zt, s8 = false, t11 = new Qi(t11)); + e: + for (; ++r9 < a8; ) { + var d8 = e13[r9], f9 = null == i10 ? d8 : i10(d8); + if (d8 = n10 || 0 !== d8 ? d8 : 0, s8 && f9 == f9) { + for (var l8 = c8; l8--; ) + if (t11[l8] === f9) + continue e; + p8.push(d8); + } else + o8(t11, f9, n10) || p8.push(d8); + } + return p8; + } + Ci.templateSettings = { escape: W5, evaluate: J5, interpolate: Z5, variable: "", imports: { _: Ci } }, Ci.prototype = Ni.prototype, Ci.prototype.constructor = Ci, Fi.prototype = Vi(Ni.prototype), Fi.prototype.constructor = Fi, Ui.prototype = Vi(Ni.prototype), Ui.prototype.constructor = Ui, Li.prototype.clear = function() { + this.__data__ = Pi ? Pi(null) : {}, this.size = 0; + }, Li.prototype.delete = function(e13) { + var t11 = this.has(e13) && delete this.__data__[e13]; + return this.size -= t11 ? 1 : 0, t11; + }, Li.prototype.get = function(e13) { + var t11 = this.__data__; + if (Pi) { + var i10 = t11[e13]; + return i10 === s7 ? r8 : i10; + } + return ke4.call(t11, e13) ? t11[e13] : r8; + }, Li.prototype.has = function(e13) { + var t11 = this.__data__; + return Pi ? t11[e13] !== r8 : ke4.call(t11, e13); + }, Li.prototype.set = function(e13, t11) { + var i10 = this.__data__; + return this.size += this.has(e13) ? 0 : 1, i10[e13] = Pi && t11 === r8 ? s7 : t11, this; + }, zi.prototype.clear = function() { + this.__data__ = [], this.size = 0; + }, zi.prototype.delete = function(e13) { + var t11 = this.__data__, i10 = Xi(t11, e13); + return !(i10 < 0 || (i10 == t11.length - 1 ? t11.pop() : He2.call(t11, i10, 1), --this.size, 0)); + }, zi.prototype.get = function(e13) { + var t11 = this.__data__, i10 = Xi(t11, e13); + return i10 < 0 ? r8 : t11[i10][1]; + }, zi.prototype.has = function(e13) { + return Xi(this.__data__, e13) > -1; + }, zi.prototype.set = function(e13, t11) { + var i10 = this.__data__, n10 = Xi(i10, e13); + return n10 < 0 ? (++this.size, i10.push([e13, t11])) : i10[n10][1] = t11, this; + }, Bi.prototype.clear = function() { + this.size = 0, this.__data__ = { hash: new Li(), map: new (xi || zi)(), string: new Li() }; + }, Bi.prototype.delete = function(e13) { + var t11 = so(this, e13).delete(e13); + return this.size -= t11 ? 1 : 0, t11; + }, Bi.prototype.get = function(e13) { + return so(this, e13).get(e13); + }, Bi.prototype.has = function(e13) { + return so(this, e13).has(e13); + }, Bi.prototype.set = function(e13, t11) { + var i10 = so(this, e13), n10 = i10.size; + return i10.set(e13, t11), this.size += i10.size == n10 ? 0 : 1, this; + }, Qi.prototype.add = Qi.prototype.push = function(e13) { + return this.__data__.set(e13, s7), this; + }, Qi.prototype.has = function(e13) { + return this.__data__.has(e13); + }, Ki.prototype.clear = function() { + this.__data__ = new zi(), this.size = 0; + }, Ki.prototype.delete = function(e13) { + var t11 = this.__data__, i10 = t11.delete(e13); + return this.size = t11.size, i10; + }, Ki.prototype.get = function(e13) { + return this.__data__.get(e13); + }, Ki.prototype.has = function(e13) { + return this.__data__.has(e13); + }, Ki.prototype.set = function(e13, t11) { + var i10 = this.__data__; + if (i10 instanceof zi) { + var n10 = i10.__data__; + if (!xi || n10.length < 199) + return n10.push([e13, t11]), this.size = ++i10.size, this; + i10 = this.__data__ = new Bi(n10); + } + return i10.set(e13, t11), this.size = i10.size, this; + }; + var dn = Ir(bn), fn = Ir(vn, true); + function ln(e13, t11) { + var i10 = true; + return dn(e13, function(e14, n10, r9) { + return i10 = !!t11(e14, n10, r9); + }), i10; + } + function un(e13, t11, i10) { + for (var n10 = -1, o8 = e13.length; ++n10 < o8; ) { + var s8 = e13[n10], a8 = t11(s8); + if (null != a8 && (p8 === r8 ? a8 == a8 && !aa(a8) : i10(a8, p8))) + var p8 = a8, c8 = s8; + } + return c8; + } + function mn(e13, t11) { + var i10 = []; + return dn(e13, function(e14, n10, r9) { + t11(e14, n10, r9) && i10.push(e14); + }), i10; + } + function hn(e13, t11, i10, n10, r9) { + var o8 = -1, s8 = e13.length; + for (i10 || (i10 = ho), r9 || (r9 = []); ++o8 < s8; ) { + var a8 = e13[o8]; + t11 > 0 && i10(a8) ? t11 > 1 ? hn(a8, t11 - 1, i10, n10, r9) : qt(r9, a8) : n10 || (r9[r9.length] = a8); + } + return r9; + } + var yn = Er(), gn = Er(true); + function bn(e13, t11) { + return e13 && yn(e13, t11, Ia); + } + function vn(e13, t11) { + return e13 && gn(e13, t11, Ia); + } + function jn(e13, t11) { + return Tt(t11, function(t12) { + return Js(e13[t12]); + }); + } + function $n(e13, t11) { + for (var i10 = 0, n10 = (t11 = yr(t11, e13)).length; null != e13 && i10 < n10; ) + e13 = e13[Do(t11[i10++])]; + return i10 && i10 == n10 ? e13 : r8; + } + function xn(e13, t11, i10) { + var n10 = t11(e13); + return zs(e13) ? n10 : qt(n10, i10(e13)); + } + function _n(e13) { + return null == e13 ? e13 === r8 ? "[object Undefined]" : "[object Null]" : Ye2 && Ye2 in we5(e13) ? function(e14) { + var t11 = ke4.call(e14, Ye2), i10 = e14[Ye2]; + try { + e14[Ye2] = r8; + var n10 = true; + } catch (e15) { + } + var o8 = De3.call(e14); + return n10 && (t11 ? e14[Ye2] = i10 : delete e14[Ye2]), o8; + }(e13) : function(e14) { + return De3.call(e14); + }(e13); + } + function wn(e13, t11) { + return e13 > t11; + } + function Sn(e13, t11) { + return null != e13 && ke4.call(e13, t11); + } + function Pn(e13, t11) { + return null != e13 && t11 in we5(e13); + } + function On(e13, t11, i10) { + for (var o8 = i10 ? It : At, s8 = e13[0].length, a8 = e13.length, p8 = a8, c8 = n9(a8), d8 = 1 / 0, f9 = []; p8--; ) { + var l8 = e13[p8]; + p8 && t11 && (l8 = Et(l8, Wt(t11))), d8 = yi(l8.length, d8), c8[p8] = !i10 && (t11 || s8 >= 120 && l8.length >= 120) ? new Qi(p8 && l8) : r8; + } + l8 = e13[0]; + var u8 = -1, m8 = c8[0]; + e: + for (; ++u8 < s8 && f9.length < d8; ) { + var h9 = l8[u8], y8 = t11 ? t11(h9) : h9; + if (h9 = i10 || 0 !== h9 ? h9 : 0, !(m8 ? Zt(m8, y8) : o8(f9, y8, i10))) { + for (p8 = a8; --p8; ) { + var g8 = c8[p8]; + if (!(g8 ? Zt(g8, y8) : o8(e13[p8], y8, i10))) + continue e; + } + m8 && m8.push(y8), f9.push(h9); + } + } + return f9; + } + function Tn(e13, t11, i10) { + var n10 = null == (e13 = So(e13, t11 = yr(t11, e13))) ? e13 : e13[Do(Wo(t11))]; + return null == n10 ? r8 : _t2(n10, e13, i10); + } + function An(e13) { + return ea(e13) && _n(e13) == h8; + } + function In(e13, t11, i10, n10, o8) { + return e13 === t11 || (null == e13 || null == t11 || !ea(e13) && !ea(t11) ? e13 != e13 && t11 != t11 : function(e14, t12, i11, n11, o9, s8) { + var a8 = zs(e14), p8 = zs(t12), c8 = a8 ? y7 : lo(e14), d8 = p8 ? y7 : lo(t12), f9 = (c8 = c8 == h8 ? w6 : c8) == w6, l8 = (d8 = d8 == h8 ? w6 : d8) == w6, u8 = c8 == d8; + if (u8 && Hs(e14)) { + if (!Hs(t12)) + return false; + a8 = true, f9 = false; + } + if (u8 && !f9) + return s8 || (s8 = new Ki()), a8 || pa(e14) ? Yr(e14, t12, i11, n11, o9, s8) : function(e15, t13, i12, n12, r9, o10, s9) { + switch (i12) { + case q5: + if (e15.byteLength != t13.byteLength || e15.byteOffset != t13.byteOffset) + return false; + e15 = e15.buffer, t13 = t13.buffer; + case E6: + return !(e15.byteLength != t13.byteLength || !o10(new Le3(e15), new Le3(t13))); + case g7: + case b8: + case _6: + return Ns(+e15, +t13); + case v8: + return e15.name == t13.name && e15.message == t13.message; + case P6: + case T6: + return e15 == t13 + ""; + case x7: + var a9 = ri; + case O7: + var p9 = 1 & n12; + if (a9 || (a9 = ai), e15.size != t13.size && !p9) + return false; + var c9 = s9.get(e15); + if (c9) + return c9 == t13; + n12 |= 2, s9.set(e15, t13); + var d9 = Yr(a9(e15), a9(t13), n12, r9, o10, s9); + return s9.delete(e15), d9; + case A6: + if (Ri) + return Ri.call(e15) == Ri.call(t13); + } + return false; + }(e14, t12, c8, i11, n11, o9, s8); + if (!(1 & i11)) { + var m8 = f9 && ke4.call(e14, "__wrapped__"), j7 = l8 && ke4.call(t12, "__wrapped__"); + if (m8 || j7) { + var $6 = m8 ? e14.value() : e14, S7 = j7 ? t12.value() : t12; + return s8 || (s8 = new Ki()), o9($6, S7, i11, n11, s8); + } + } + return !!u8 && (s8 || (s8 = new Ki()), function(e15, t13, i12, n12, o10, s9) { + var a9 = 1 & i12, p9 = eo(e15), c9 = p9.length; + if (c9 != eo(t13).length && !a9) + return false; + for (var d9 = c9; d9--; ) { + var f10 = p9[d9]; + if (!(a9 ? f10 in t13 : ke4.call(t13, f10))) + return false; + } + var l9 = s9.get(e15), u9 = s9.get(t13); + if (l9 && u9) + return l9 == t13 && u9 == e15; + var m9 = true; + s9.set(e15, t13), s9.set(t13, e15); + for (var h9 = a9; ++d9 < c9; ) { + var y8 = e15[f10 = p9[d9]], g8 = t13[f10]; + if (n12) + var b9 = a9 ? n12(g8, y8, f10, t13, e15, s9) : n12(y8, g8, f10, e15, t13, s9); + if (!(b9 === r8 ? y8 === g8 || o10(y8, g8, i12, n12, s9) : b9)) { + m9 = false; + break; + } + h9 || (h9 = "constructor" == f10); + } + if (m9 && !h9) { + var v9 = e15.constructor, j8 = t13.constructor; + v9 == j8 || !("constructor" in e15) || !("constructor" in t13) || "function" == typeof v9 && v9 instanceof v9 && "function" == typeof j8 && j8 instanceof j8 || (m9 = false); + } + return s9.delete(e15), s9.delete(t13), m9; + }(e14, t12, i11, n11, o9, s8)); + }(e13, t11, i10, n10, In, o8)); + } + function En(e13, t11, i10, n10) { + var o8 = i10.length, s8 = o8, a8 = !n10; + if (null == e13) + return !s8; + for (e13 = we5(e13); o8--; ) { + var p8 = i10[o8]; + if (a8 && p8[2] ? p8[1] !== e13[p8[0]] : !(p8[0] in e13)) + return false; + } + for (; ++o8 < s8; ) { + var c8 = (p8 = i10[o8])[0], d8 = e13[c8], f9 = p8[1]; + if (a8 && p8[2]) { + if (d8 === r8 && !(c8 in e13)) + return false; + } else { + var l8 = new Ki(); + if (n10) + var u8 = n10(d8, f9, c8, e13, t11, l8); + if (!(u8 === r8 ? In(f9, d8, 3, n10, l8) : u8)) + return false; + } + } + return true; + } + function qn(e13) { + return !(!Xs(e13) || (t11 = e13, Re3 && Re3 in t11)) && (Js(e13) ? Ne3 : he4).test(Co(e13)); + var t11; + } + function kn(e13) { + return "function" == typeof e13 ? e13 : null == e13 ? ip : "object" == typeof e13 ? zs(e13) ? Vn(e13[0], e13[1]) : Cn(e13) : fp(e13); + } + function Mn(e13) { + if (!$o(e13)) + return mi(e13); + var t11 = []; + for (var i10 in we5(e13)) + ke4.call(e13, i10) && "constructor" != i10 && t11.push(i10); + return t11; + } + function Rn(e13, t11) { + return e13 < t11; + } + function Dn(e13, t11) { + var i10 = -1, r9 = Qs(e13) ? n9(e13.length) : []; + return dn(e13, function(e14, n10, o8) { + r9[++i10] = t11(e14, n10, o8); + }), r9; + } + function Cn(e13) { + var t11 = ao(e13); + return 1 == t11.length && t11[0][2] ? _o(t11[0][0], t11[0][1]) : function(i10) { + return i10 === e13 || En(i10, e13, t11); + }; + } + function Vn(e13, t11) { + return bo(e13) && xo(t11) ? _o(Do(e13), t11) : function(i10) { + var n10 = Sa(i10, e13); + return n10 === r8 && n10 === t11 ? Pa(i10, e13) : In(t11, n10, 3); + }; + } + function Nn(e13, t11, i10, n10, o8) { + e13 !== t11 && yn(t11, function(s8, a8) { + if (o8 || (o8 = new Ki()), Xs(s8)) + !function(e14, t12, i11, n11, o9, s9, a9) { + var p9 = Po(e14, i11), c8 = Po(t12, i11), d8 = a9.get(c8); + if (d8) + Zi(e14, i11, d8); + else { + var f9 = s9 ? s9(p9, c8, i11 + "", e14, t12, a9) : r8, l8 = f9 === r8; + if (l8) { + var u8 = zs(c8), m8 = !u8 && Hs(c8), h9 = !u8 && !m8 && pa(c8); + f9 = c8, u8 || m8 || h9 ? zs(p9) ? f9 = p9 : Ks(p9) ? f9 = Pr(p9) : m8 ? (l8 = false, f9 = jr(c8, true)) : h9 ? (l8 = false, f9 = xr(c8, true)) : f9 = [] : na(c8) || Ls(c8) ? (f9 = p9, Ls(p9) ? f9 = ya(p9) : Xs(p9) && !Js(p9) || (f9 = mo(c8))) : l8 = false; + } + l8 && (a9.set(c8, f9), o9(f9, c8, n11, s9, a9), a9.delete(c8)), Zi(e14, i11, f9); + } + }(e13, t11, a8, i10, Nn, n10, o8); + else { + var p8 = n10 ? n10(Po(e13, a8), s8, a8 + "", e13, t11, o8) : r8; + p8 === r8 && (p8 = s8), Zi(e13, a8, p8); + } + }, Ea); + } + function Fn(e13, t11) { + var i10 = e13.length; + if (i10) + return yo(t11 += t11 < 0 ? i10 : 0, i10) ? e13[t11] : r8; + } + function Un(e13, t11, i10) { + t11 = t11.length ? Et(t11, function(e14) { + return zs(e14) ? function(t12) { + return $n(t12, 1 === e14.length ? e14[0] : e14); + } : e14; + }) : [ip]; + var n10 = -1; + t11 = Et(t11, Wt(oo())); + var r9 = Dn(e13, function(e14, i11, r10) { + var o8 = Et(t11, function(t12) { + return t12(e14); + }); + return { criteria: o8, index: ++n10, value: e14 }; + }); + return function(e14) { + var t12 = e14.length; + for (e14.sort(function(e15, t13) { + return function(e16, t14, i11) { + for (var n11 = -1, r10 = e16.criteria, o8 = t14.criteria, s8 = r10.length, a8 = i11.length; ++n11 < s8; ) { + var p8 = _r(r10[n11], o8[n11]); + if (p8) + return n11 >= a8 ? p8 : p8 * ("desc" == i11[n11] ? -1 : 1); + } + return e16.index - t14.index; + }(e15, t13, i10); + }); t12--; ) + e14[t12] = e14[t12].value; + return e14; + }(r9); + } + function Ln(e13, t11, i10) { + for (var n10 = -1, r9 = t11.length, o8 = {}; ++n10 < r9; ) { + var s8 = t11[n10], a8 = $n(e13, s8); + i10(a8, s8) && Jn(o8, yr(s8, e13), a8); + } + return o8; + } + function zn(e13, t11, i10, n10) { + var r9 = n10 ? Ft : Nt, o8 = -1, s8 = t11.length, a8 = e13; + for (e13 === t11 && (t11 = Pr(t11)), i10 && (a8 = Et(e13, Wt(i10))); ++o8 < s8; ) + for (var p8 = 0, c8 = t11[o8], d8 = i10 ? i10(c8) : c8; (p8 = r9(a8, d8, p8, n10)) > -1; ) + a8 !== e13 && He2.call(a8, p8, 1), He2.call(e13, p8, 1); + return e13; + } + function Bn(e13, t11) { + for (var i10 = e13 ? t11.length : 0, n10 = i10 - 1; i10--; ) { + var r9 = t11[i10]; + if (i10 == n10 || r9 !== o8) { + var o8 = r9; + yo(r9) ? He2.call(e13, r9, 1) : pr(e13, r9); + } + } + return e13; + } + function Qn(e13, t11) { + return e13 + ut2(vi() * (t11 - e13 + 1)); + } + function Kn(e13, t11) { + var i10 = ""; + if (!e13 || t11 < 1 || t11 > f8) + return i10; + do { + t11 % 2 && (i10 += e13), (t11 = ut2(t11 / 2)) && (e13 += e13); + } while (t11); + return i10; + } + function Hn(e13, t11) { + return Ao(wo(e13, t11, ip), e13 + ""); + } + function Gn(e13) { + return Gi(Na(e13)); + } + function Wn(e13, t11) { + var i10 = Na(e13); + return qo(i10, on4(t11, 0, i10.length)); + } + function Jn(e13, t11, i10, n10) { + if (!Xs(e13)) + return e13; + for (var o8 = -1, s8 = (t11 = yr(t11, e13)).length, a8 = s8 - 1, p8 = e13; null != p8 && ++o8 < s8; ) { + var c8 = Do(t11[o8]), d8 = i10; + if ("__proto__" === c8 || "constructor" === c8 || "prototype" === c8) + return e13; + if (o8 != a8) { + var f9 = p8[c8]; + (d8 = n10 ? n10(f9, c8, p8) : r8) === r8 && (d8 = Xs(f9) ? f9 : yo(t11[o8 + 1]) ? [] : {}); + } + Yi(p8, c8, d8), p8 = p8[c8]; + } + return e13; + } + var Zn = Oi ? function(e13, t11) { + return Oi.set(e13, t11), e13; + } : ip, Yn = et4 ? function(e13, t11) { + return et4(e13, "toString", { configurable: true, enumerable: false, value: Xa(t11), writable: true }); + } : ip; + function Xn(e13) { + return qo(Na(e13)); + } + function er(e13, t11, i10) { + var r9 = -1, o8 = e13.length; + t11 < 0 && (t11 = -t11 > o8 ? 0 : o8 + t11), (i10 = i10 > o8 ? o8 : i10) < 0 && (i10 += o8), o8 = t11 > i10 ? 0 : i10 - t11 >>> 0, t11 >>>= 0; + for (var s8 = n9(o8); ++r9 < o8; ) + s8[r9] = e13[r9 + t11]; + return s8; + } + function tr(e13, t11) { + var i10; + return dn(e13, function(e14, n10, r9) { + return !(i10 = t11(e14, n10, r9)); + }), !!i10; + } + function ir(e13, t11, i10) { + var n10 = 0, r9 = null == e13 ? n10 : e13.length; + if ("number" == typeof t11 && t11 == t11 && r9 <= 2147483647) { + for (; n10 < r9; ) { + var o8 = n10 + r9 >>> 1, s8 = e13[o8]; + null !== s8 && !aa(s8) && (i10 ? s8 <= t11 : s8 < t11) ? n10 = o8 + 1 : r9 = o8; + } + return r9; + } + return nr(e13, t11, ip, i10); + } + function nr(e13, t11, i10, n10) { + var o8 = 0, s8 = null == e13 ? 0 : e13.length; + if (0 === s8) + return 0; + for (var a8 = (t11 = i10(t11)) != t11, p8 = null === t11, c8 = aa(t11), d8 = t11 === r8; o8 < s8; ) { + var f9 = ut2((o8 + s8) / 2), l8 = i10(e13[f9]), u8 = l8 !== r8, m8 = null === l8, h9 = l8 == l8, y8 = aa(l8); + if (a8) + var g8 = n10 || h9; + else + g8 = d8 ? h9 && (n10 || u8) : p8 ? h9 && u8 && (n10 || !m8) : c8 ? h9 && u8 && !m8 && (n10 || !y8) : !m8 && !y8 && (n10 ? l8 <= t11 : l8 < t11); + g8 ? o8 = f9 + 1 : s8 = f9; + } + return yi(s8, 4294967294); + } + function rr(e13, t11) { + for (var i10 = -1, n10 = e13.length, r9 = 0, o8 = []; ++i10 < n10; ) { + var s8 = e13[i10], a8 = t11 ? t11(s8) : s8; + if (!i10 || !Ns(a8, p8)) { + var p8 = a8; + o8[r9++] = 0 === s8 ? 0 : s8; + } + } + return o8; + } + function or(e13) { + return "number" == typeof e13 ? e13 : aa(e13) ? l7 : +e13; + } + function sr(e13) { + if ("string" == typeof e13) + return e13; + if (zs(e13)) + return Et(e13, sr) + ""; + if (aa(e13)) + return Di ? Di.call(e13) : ""; + var t11 = e13 + ""; + return "0" == t11 && 1 / e13 == -1 / 0 ? "-0" : t11; + } + function ar(e13, t11, i10) { + var n10 = -1, r9 = At, o8 = e13.length, s8 = true, a8 = [], p8 = a8; + if (i10) + s8 = false, r9 = It; + else if (o8 >= 200) { + var c8 = t11 ? null : Kr(e13); + if (c8) + return ai(c8); + s8 = false, r9 = Zt, p8 = new Qi(); + } else + p8 = t11 ? [] : a8; + e: + for (; ++n10 < o8; ) { + var d8 = e13[n10], f9 = t11 ? t11(d8) : d8; + if (d8 = i10 || 0 !== d8 ? d8 : 0, s8 && f9 == f9) { + for (var l8 = p8.length; l8--; ) + if (p8[l8] === f9) + continue e; + t11 && p8.push(f9), a8.push(d8); + } else + r9(p8, f9, i10) || (p8 !== a8 && p8.push(f9), a8.push(d8)); + } + return a8; + } + function pr(e13, t11) { + return null == (e13 = So(e13, t11 = yr(t11, e13))) || delete e13[Do(Wo(t11))]; + } + function cr(e13, t11, i10, n10) { + return Jn(e13, t11, i10($n(e13, t11)), n10); + } + function dr(e13, t11, i10, n10) { + for (var r9 = e13.length, o8 = n10 ? r9 : -1; (n10 ? o8-- : ++o8 < r9) && t11(e13[o8], o8, e13); ) + ; + return i10 ? er(e13, n10 ? 0 : o8, n10 ? o8 + 1 : r9) : er(e13, n10 ? o8 + 1 : 0, n10 ? r9 : o8); + } + function fr(e13, t11) { + var i10 = e13; + return i10 instanceof Ui && (i10 = i10.value()), kt(t11, function(e14, t12) { + return t12.func.apply(t12.thisArg, qt([e14], t12.args)); + }, i10); + } + function lr(e13, t11, i10) { + var r9 = e13.length; + if (r9 < 2) + return r9 ? ar(e13[0]) : []; + for (var o8 = -1, s8 = n9(r9); ++o8 < r9; ) + for (var a8 = e13[o8], p8 = -1; ++p8 < r9; ) + p8 != o8 && (s8[o8] = cn(s8[o8] || a8, e13[p8], t11, i10)); + return ar(hn(s8, 1), t11, i10); + } + function ur(e13, t11, i10) { + for (var n10 = -1, o8 = e13.length, s8 = t11.length, a8 = {}; ++n10 < o8; ) { + var p8 = n10 < s8 ? t11[n10] : r8; + i10(a8, e13[n10], p8); + } + return a8; + } + function mr(e13) { + return Ks(e13) ? e13 : []; + } + function hr(e13) { + return "function" == typeof e13 ? e13 : ip; + } + function yr(e13, t11) { + return zs(e13) ? e13 : bo(e13, t11) ? [e13] : Ro(ga(e13)); + } + var gr = Hn; + function br(e13, t11, i10) { + var n10 = e13.length; + return i10 = i10 === r8 ? n10 : i10, !t11 && i10 >= n10 ? e13 : er(e13, t11, i10); + } + var vr = st3 || function(e13) { + return ft.clearTimeout(e13); + }; + function jr(e13, t11) { + if (t11) + return e13.slice(); + var i10 = e13.length, n10 = ze3 ? ze3(i10) : new e13.constructor(i10); + return e13.copy(n10), n10; + } + function $r(e13) { + var t11 = new e13.constructor(e13.byteLength); + return new Le3(t11).set(new Le3(e13)), t11; + } + function xr(e13, t11) { + var i10 = t11 ? $r(e13.buffer) : e13.buffer; + return new e13.constructor(i10, e13.byteOffset, e13.length); + } + function _r(e13, t11) { + if (e13 !== t11) { + var i10 = e13 !== r8, n10 = null === e13, o8 = e13 == e13, s8 = aa(e13), a8 = t11 !== r8, p8 = null === t11, c8 = t11 == t11, d8 = aa(t11); + if (!p8 && !d8 && !s8 && e13 > t11 || s8 && a8 && c8 && !p8 && !d8 || n10 && a8 && c8 || !i10 && c8 || !o8) + return 1; + if (!n10 && !s8 && !d8 && e13 < t11 || d8 && i10 && o8 && !n10 && !s8 || p8 && i10 && o8 || !a8 && o8 || !c8) + return -1; + } + return 0; + } + function wr(e13, t11, i10, r9) { + for (var o8 = -1, s8 = e13.length, a8 = i10.length, p8 = -1, c8 = t11.length, d8 = hi(s8 - a8, 0), f9 = n9(c8 + d8), l8 = !r9; ++p8 < c8; ) + f9[p8] = t11[p8]; + for (; ++o8 < a8; ) + (l8 || o8 < s8) && (f9[i10[o8]] = e13[o8]); + for (; d8--; ) + f9[p8++] = e13[o8++]; + return f9; + } + function Sr(e13, t11, i10, r9) { + for (var o8 = -1, s8 = e13.length, a8 = -1, p8 = i10.length, c8 = -1, d8 = t11.length, f9 = hi(s8 - p8, 0), l8 = n9(f9 + d8), u8 = !r9; ++o8 < f9; ) + l8[o8] = e13[o8]; + for (var m8 = o8; ++c8 < d8; ) + l8[m8 + c8] = t11[c8]; + for (; ++a8 < p8; ) + (u8 || o8 < s8) && (l8[m8 + i10[a8]] = e13[o8++]); + return l8; + } + function Pr(e13, t11) { + var i10 = -1, r9 = e13.length; + for (t11 || (t11 = n9(r9)); ++i10 < r9; ) + t11[i10] = e13[i10]; + return t11; + } + function Or(e13, t11, i10, n10) { + var o8 = !i10; + i10 || (i10 = {}); + for (var s8 = -1, a8 = t11.length; ++s8 < a8; ) { + var p8 = t11[s8], c8 = n10 ? n10(i10[p8], e13[p8], p8, i10, e13) : r8; + c8 === r8 && (c8 = e13[p8]), o8 ? nn(i10, p8, c8) : Yi(i10, p8, c8); + } + return i10; + } + function Tr(e13, t11) { + return function(i10, n10) { + var r9 = zs(i10) ? wt : en, o8 = t11 ? t11() : {}; + return r9(i10, e13, oo(n10, 2), o8); + }; + } + function Ar(e13) { + return Hn(function(t11, i10) { + var n10 = -1, o8 = i10.length, s8 = o8 > 1 ? i10[o8 - 1] : r8, a8 = o8 > 2 ? i10[2] : r8; + for (s8 = e13.length > 3 && "function" == typeof s8 ? (o8--, s8) : r8, a8 && go(i10[0], i10[1], a8) && (s8 = o8 < 3 ? r8 : s8, o8 = 1), t11 = we5(t11); ++n10 < o8; ) { + var p8 = i10[n10]; + p8 && e13(t11, p8, n10, s8); + } + return t11; + }); + } + function Ir(e13, t11) { + return function(i10, n10) { + if (null == i10) + return i10; + if (!Qs(i10)) + return e13(i10, n10); + for (var r9 = i10.length, o8 = t11 ? r9 : -1, s8 = we5(i10); (t11 ? o8-- : ++o8 < r9) && false !== n10(s8[o8], o8, s8); ) + ; + return i10; + }; + } + function Er(e13) { + return function(t11, i10, n10) { + for (var r9 = -1, o8 = we5(t11), s8 = n10(t11), a8 = s8.length; a8--; ) { + var p8 = s8[e13 ? a8 : ++r9]; + if (false === i10(o8[p8], p8, o8)) + break; + } + return t11; + }; + } + function qr(e13) { + return function(t11) { + var i10 = ni(t11 = ga(t11)) ? di(t11) : r8, n10 = i10 ? i10[0] : t11.charAt(0), o8 = i10 ? br(i10, 1).join("") : t11.slice(1); + return n10[e13]() + o8; + }; + } + function kr(e13) { + return function(t11) { + return kt(Ja(La(t11).replace(Je, "")), e13, ""); + }; + } + function Mr(e13) { + return function() { + var t11 = arguments; + switch (t11.length) { + case 0: + return new e13(); + case 1: + return new e13(t11[0]); + case 2: + return new e13(t11[0], t11[1]); + case 3: + return new e13(t11[0], t11[1], t11[2]); + case 4: + return new e13(t11[0], t11[1], t11[2], t11[3]); + case 5: + return new e13(t11[0], t11[1], t11[2], t11[3], t11[4]); + case 6: + return new e13(t11[0], t11[1], t11[2], t11[3], t11[4], t11[5]); + case 7: + return new e13(t11[0], t11[1], t11[2], t11[3], t11[4], t11[5], t11[6]); + } + var i10 = Vi(e13.prototype), n10 = e13.apply(i10, t11); + return Xs(n10) ? n10 : i10; + }; + } + function Rr(e13) { + return function(t11, i10, n10) { + var o8 = we5(t11); + if (!Qs(t11)) { + var s8 = oo(i10, 3); + t11 = Ia(t11), i10 = function(e14) { + return s8(o8[e14], e14, o8); + }; + } + var a8 = e13(t11, i10, n10); + return a8 > -1 ? o8[s8 ? t11[a8] : a8] : r8; + }; + } + function Dr(e13) { + return Xr(function(t11) { + var i10 = t11.length, n10 = i10, s8 = Fi.prototype.thru; + for (e13 && t11.reverse(); n10--; ) { + var a8 = t11[n10]; + if ("function" != typeof a8) + throw new Oe5(o7); + if (s8 && !p8 && "wrapper" == no(a8)) + var p8 = new Fi([], true); + } + for (n10 = p8 ? n10 : i10; ++n10 < i10; ) { + var c8 = no(a8 = t11[n10]), d8 = "wrapper" == c8 ? io(a8) : r8; + p8 = d8 && vo(d8[0]) && 424 == d8[1] && !d8[4].length && 1 == d8[9] ? p8[no(d8[0])].apply(p8, d8[3]) : 1 == a8.length && vo(a8) ? p8[c8]() : p8.thru(a8); + } + return function() { + var e14 = arguments, n11 = e14[0]; + if (p8 && 1 == e14.length && zs(n11)) + return p8.plant(n11).value(); + for (var r9 = 0, o8 = i10 ? t11[r9].apply(this, e14) : n11; ++r9 < i10; ) + o8 = t11[r9].call(this, o8); + return o8; + }; + }); + } + function Cr(e13, t11, i10, o8, s8, a8, p8, d8, f9, l8) { + var u8 = t11 & c7, m8 = 1 & t11, h9 = 2 & t11, y8 = 24 & t11, g8 = 512 & t11, b9 = h9 ? r8 : Mr(e13); + return function c8() { + for (var v9 = arguments.length, j7 = n9(v9), $6 = v9; $6--; ) + j7[$6] = arguments[$6]; + if (y8) + var x8 = ro(c8), _7 = function(e14, t12) { + for (var i11 = e14.length, n10 = 0; i11--; ) + e14[i11] === t12 && ++n10; + return n10; + }(j7, x8); + if (o8 && (j7 = wr(j7, o8, s8, y8)), a8 && (j7 = Sr(j7, a8, p8, y8)), v9 -= _7, y8 && v9 < l8) { + var w7 = si(j7, x8); + return Br(e13, t11, Cr, c8.placeholder, i10, j7, w7, d8, f9, l8 - v9); + } + var S7 = m8 ? i10 : this, P7 = h9 ? S7[e13] : e13; + return v9 = j7.length, d8 ? j7 = function(e14, t12) { + for (var i11 = e14.length, n10 = yi(t12.length, i11), o9 = Pr(e14); n10--; ) { + var s9 = t12[n10]; + e14[n10] = yo(s9, i11) ? o9[s9] : r8; + } + return e14; + }(j7, d8) : g8 && v9 > 1 && j7.reverse(), u8 && f9 < v9 && (j7.length = f9), this && this !== ft && this instanceof c8 && (P7 = b9 || Mr(P7)), P7.apply(S7, j7); + }; + } + function Vr(e13, t11) { + return function(i10, n10) { + return function(e14, t12, i11, n11) { + return bn(e14, function(e15, r9, o8) { + t12(n11, i11(e15), r9, o8); + }), n11; + }(i10, e13, t11(n10), {}); + }; + } + function Nr(e13, t11) { + return function(i10, n10) { + var o8; + if (i10 === r8 && n10 === r8) + return t11; + if (i10 !== r8 && (o8 = i10), n10 !== r8) { + if (o8 === r8) + return n10; + "string" == typeof i10 || "string" == typeof n10 ? (i10 = sr(i10), n10 = sr(n10)) : (i10 = or(i10), n10 = or(n10)), o8 = e13(i10, n10); + } + return o8; + }; + } + function Fr(e13) { + return Xr(function(t11) { + return t11 = Et(t11, Wt(oo())), Hn(function(i10) { + var n10 = this; + return e13(t11, function(e14) { + return _t2(e14, n10, i10); + }); + }); + }); + } + function Ur(e13, t11) { + var i10 = (t11 = t11 === r8 ? " " : sr(t11)).length; + if (i10 < 2) + return i10 ? Kn(t11, e13) : t11; + var n10 = Kn(t11, lt3(e13 / ci(t11))); + return ni(t11) ? br(di(n10), 0, e13).join("") : n10.slice(0, e13); + } + function Lr(e13) { + return function(t11, i10, o8) { + return o8 && "number" != typeof o8 && go(t11, i10, o8) && (i10 = o8 = r8), t11 = la(t11), i10 === r8 ? (i10 = t11, t11 = 0) : i10 = la(i10), function(e14, t12, i11, r9) { + for (var o9 = -1, s8 = hi(lt3((t12 - e14) / (i11 || 1)), 0), a8 = n9(s8); s8--; ) + a8[r9 ? s8 : ++o9] = e14, e14 += i11; + return a8; + }(t11, i10, o8 = o8 === r8 ? t11 < i10 ? 1 : -1 : la(o8), e13); + }; + } + function zr(e13) { + return function(t11, i10) { + return "string" == typeof t11 && "string" == typeof i10 || (t11 = ha(t11), i10 = ha(i10)), e13(t11, i10); + }; + } + function Br(e13, t11, i10, n10, o8, s8, a8, c8, d8, f9) { + var l8 = 8 & t11; + t11 |= l8 ? p7 : 64, 4 & (t11 &= ~(l8 ? 64 : p7)) || (t11 &= -4); + var u8 = [e13, t11, o8, l8 ? s8 : r8, l8 ? a8 : r8, l8 ? r8 : s8, l8 ? r8 : a8, c8, d8, f9], m8 = i10.apply(r8, u8); + return vo(e13) && Oo(m8, u8), m8.placeholder = n10, Io(m8, e13, t11); + } + function Qr(e13) { + var t11 = _e3[e13]; + return function(e14, i10) { + if (e14 = ha(e14), (i10 = null == i10 ? 0 : yi(ua(i10), 292)) && Dt2(e14)) { + var n10 = (ga(e14) + "e").split("e"); + return +((n10 = (ga(t11(n10[0] + "e" + (+n10[1] + i10))) + "e").split("e"))[0] + "e" + (+n10[1] - i10)); + } + return t11(e14); + }; + } + var Kr = wi && 1 / ai(new wi([, -0]))[1] == d7 ? function(e13) { + return new wi(e13); + } : ap; + function Hr(e13) { + return function(t11) { + var i10 = lo(t11); + return i10 == x7 ? ri(t11) : i10 == O7 ? pi(t11) : function(e14, t12) { + return Et(t12, function(t13) { + return [t13, e14[t13]]; + }); + }(t11, e13(t11)); + }; + } + function Gr(e13, t11, i10, s8, d8, f9, l8, u8) { + var m8 = 2 & t11; + if (!m8 && "function" != typeof e13) + throw new Oe5(o7); + var h9 = s8 ? s8.length : 0; + if (h9 || (t11 &= -97, s8 = d8 = r8), l8 = l8 === r8 ? l8 : hi(ua(l8), 0), u8 = u8 === r8 ? u8 : ua(u8), h9 -= d8 ? d8.length : 0, 64 & t11) { + var y8 = s8, g8 = d8; + s8 = d8 = r8; + } + var b9 = m8 ? r8 : io(e13), v9 = [e13, t11, i10, s8, d8, y8, g8, f9, l8, u8]; + if (b9 && function(e14, t12) { + var i11 = e14[1], n10 = t12[1], r9 = i11 | n10, o8 = r9 < 131, s9 = n10 == c7 && 8 == i11 || n10 == c7 && 256 == i11 && e14[7].length <= t12[8] || 384 == n10 && t12[7].length <= t12[8] && 8 == i11; + if (!o8 && !s9) + return e14; + 1 & n10 && (e14[2] = t12[2], r9 |= 1 & i11 ? 0 : 4); + var p8 = t12[3]; + if (p8) { + var d9 = e14[3]; + e14[3] = d9 ? wr(d9, p8, t12[4]) : p8, e14[4] = d9 ? si(e14[3], a7) : t12[4]; + } + (p8 = t12[5]) && (d9 = e14[5], e14[5] = d9 ? Sr(d9, p8, t12[6]) : p8, e14[6] = d9 ? si(e14[5], a7) : t12[6]), (p8 = t12[7]) && (e14[7] = p8), n10 & c7 && (e14[8] = null == e14[8] ? t12[8] : yi(e14[8], t12[8])), null == e14[9] && (e14[9] = t12[9]), e14[0] = t12[0], e14[1] = r9; + }(v9, b9), e13 = v9[0], t11 = v9[1], i10 = v9[2], s8 = v9[3], d8 = v9[4], !(u8 = v9[9] = v9[9] === r8 ? m8 ? 0 : e13.length : hi(v9[9] - h9, 0)) && 24 & t11 && (t11 &= -25), t11 && 1 != t11) + j7 = 8 == t11 || 16 == t11 ? function(e14, t12, i11) { + var o8 = Mr(e14); + return function s9() { + for (var a8 = arguments.length, p8 = n9(a8), c8 = a8, d9 = ro(s9); c8--; ) + p8[c8] = arguments[c8]; + var f10 = a8 < 3 && p8[0] !== d9 && p8[a8 - 1] !== d9 ? [] : si(p8, d9); + return (a8 -= f10.length) < i11 ? Br(e14, t12, Cr, s9.placeholder, r8, p8, f10, r8, r8, i11 - a8) : _t2(this && this !== ft && this instanceof s9 ? o8 : e14, this, p8); + }; + }(e13, t11, u8) : t11 != p7 && 33 != t11 || d8.length ? Cr.apply(r8, v9) : function(e14, t12, i11, r9) { + var o8 = 1 & t12, s9 = Mr(e14); + return function t13() { + for (var a8 = -1, p8 = arguments.length, c8 = -1, d9 = r9.length, f10 = n9(d9 + p8), l9 = this && this !== ft && this instanceof t13 ? s9 : e14; ++c8 < d9; ) + f10[c8] = r9[c8]; + for (; p8--; ) + f10[c8++] = arguments[++a8]; + return _t2(l9, o8 ? i11 : this, f10); + }; + }(e13, t11, i10, s8); + else + var j7 = function(e14, t12, i11) { + var n10 = 1 & t12, r9 = Mr(e14); + return function t13() { + return (this && this !== ft && this instanceof t13 ? r9 : e14).apply(n10 ? i11 : this, arguments); + }; + }(e13, t11, i10); + return Io((b9 ? Zn : Oo)(j7, v9), e13, t11); + } + function Wr(e13, t11, i10, n10) { + return e13 === r8 || Ns(e13, Ie3[i10]) && !ke4.call(n10, i10) ? t11 : e13; + } + function Jr(e13, t11, i10, n10, o8, s8) { + return Xs(e13) && Xs(t11) && (s8.set(t11, e13), Nn(e13, t11, r8, Jr, s8), s8.delete(t11)), e13; + } + function Zr(e13) { + return na(e13) ? r8 : e13; + } + function Yr(e13, t11, i10, n10, o8, s8) { + var a8 = 1 & i10, p8 = e13.length, c8 = t11.length; + if (p8 != c8 && !(a8 && c8 > p8)) + return false; + var d8 = s8.get(e13), f9 = s8.get(t11); + if (d8 && f9) + return d8 == t11 && f9 == e13; + var l8 = -1, u8 = true, m8 = 2 & i10 ? new Qi() : r8; + for (s8.set(e13, t11), s8.set(t11, e13); ++l8 < p8; ) { + var h9 = e13[l8], y8 = t11[l8]; + if (n10) + var g8 = a8 ? n10(y8, h9, l8, t11, e13, s8) : n10(h9, y8, l8, e13, t11, s8); + if (g8 !== r8) { + if (g8) + continue; + u8 = false; + break; + } + if (m8) { + if (!Rt(t11, function(e14, t12) { + if (!Zt(m8, t12) && (h9 === e14 || o8(h9, e14, i10, n10, s8))) + return m8.push(t12); + })) { + u8 = false; + break; + } + } else if (h9 !== y8 && !o8(h9, y8, i10, n10, s8)) { + u8 = false; + break; + } + } + return s8.delete(e13), s8.delete(t11), u8; + } + function Xr(e13) { + return Ao(wo(e13, r8, Bo), e13 + ""); + } + function eo(e13) { + return xn(e13, Ia, co); + } + function to(e13) { + return xn(e13, Ea, fo); + } + var io = Oi ? function(e13) { + return Oi.get(e13); + } : ap; + function no(e13) { + for (var t11 = e13.name + "", i10 = Ti[t11], n10 = ke4.call(Ti, t11) ? i10.length : 0; n10--; ) { + var r9 = i10[n10], o8 = r9.func; + if (null == o8 || o8 == e13) + return r9.name; + } + return t11; + } + function ro(e13) { + return (ke4.call(Ci, "placeholder") ? Ci : e13).placeholder; + } + function oo() { + var e13 = Ci.iteratee || np; + return e13 = e13 === np ? kn : e13, arguments.length ? e13(arguments[0], arguments[1]) : e13; + } + function so(e13, t11) { + var i10, n10, r9 = e13.__data__; + return ("string" == (n10 = typeof (i10 = t11)) || "number" == n10 || "symbol" == n10 || "boolean" == n10 ? "__proto__" !== i10 : null === i10) ? r9["string" == typeof t11 ? "string" : "hash"] : r9.map; + } + function ao(e13) { + for (var t11 = Ia(e13), i10 = t11.length; i10--; ) { + var n10 = t11[i10], r9 = e13[n10]; + t11[i10] = [n10, r9, xo(r9)]; + } + return t11; + } + function po(e13, t11) { + var i10 = function(e14, t12) { + return null == e14 ? r8 : e14[t12]; + }(e13, t11); + return qn(i10) ? i10 : r8; + } + var co = ht3 ? function(e13) { + return null == e13 ? [] : (e13 = we5(e13), Tt(ht3(e13), function(t11) { + return Ke2.call(e13, t11); + })); + } : mp, fo = ht3 ? function(e13) { + for (var t11 = []; e13; ) + qt(t11, co(e13)), e13 = Be4(e13); + return t11; + } : mp, lo = _n; + function uo(e13, t11, i10) { + for (var n10 = -1, r9 = (t11 = yr(t11, e13)).length, o8 = false; ++n10 < r9; ) { + var s8 = Do(t11[n10]); + if (!(o8 = null != e13 && i10(e13, s8))) + break; + e13 = e13[s8]; + } + return o8 || ++n10 != r9 ? o8 : !!(r9 = null == e13 ? 0 : e13.length) && Ys(r9) && yo(s8, r9) && (zs(e13) || Ls(e13)); + } + function mo(e13) { + return "function" != typeof e13.constructor || $o(e13) ? {} : Vi(Be4(e13)); + } + function ho(e13) { + return zs(e13) || Ls(e13) || !!(Ge2 && e13 && e13[Ge2]); + } + function yo(e13, t11) { + var i10 = typeof e13; + return !!(t11 = null == t11 ? f8 : t11) && ("number" == i10 || "symbol" != i10 && ge4.test(e13)) && e13 > -1 && e13 % 1 == 0 && e13 < t11; + } + function go(e13, t11, i10) { + if (!Xs(i10)) + return false; + var n10 = typeof t11; + return !!("number" == n10 ? Qs(i10) && yo(t11, i10.length) : "string" == n10 && t11 in i10) && Ns(i10[t11], e13); + } + function bo(e13, t11) { + if (zs(e13)) + return false; + var i10 = typeof e13; + return !("number" != i10 && "symbol" != i10 && "boolean" != i10 && null != e13 && !aa(e13)) || X5.test(e13) || !Y6.test(e13) || null != t11 && e13 in we5(t11); + } + function vo(e13) { + var t11 = no(e13), i10 = Ci[t11]; + if ("function" != typeof i10 || !(t11 in Ui.prototype)) + return false; + if (e13 === i10) + return true; + var n10 = io(i10); + return !!n10 && e13 === n10[0]; + } + ($i && lo(new $i(new ArrayBuffer(1))) != q5 || xi && lo(new xi()) != x7 || _i && lo(_i.resolve()) != S6 || wi && lo(new wi()) != O7 || Si && lo(new Si()) != I6) && (lo = function(e13) { + var t11 = _n(e13), i10 = t11 == w6 ? e13.constructor : r8, n10 = i10 ? Co(i10) : ""; + if (n10) + switch (n10) { + case Ai: + return q5; + case Ii: + return x7; + case Ei: + return S6; + case qi: + return O7; + case ki: + return I6; + } + return t11; + }); + var jo = Ee5 ? Js : hp; + function $o(e13) { + var t11 = e13 && e13.constructor; + return e13 === ("function" == typeof t11 && t11.prototype || Ie3); + } + function xo(e13) { + return e13 == e13 && !Xs(e13); + } + function _o(e13, t11) { + return function(i10) { + return null != i10 && i10[e13] === t11 && (t11 !== r8 || e13 in we5(i10)); + }; + } + function wo(e13, t11, i10) { + return t11 = hi(t11 === r8 ? e13.length - 1 : t11, 0), function() { + for (var r9 = arguments, o8 = -1, s8 = hi(r9.length - t11, 0), a8 = n9(s8); ++o8 < s8; ) + a8[o8] = r9[t11 + o8]; + o8 = -1; + for (var p8 = n9(t11 + 1); ++o8 < t11; ) + p8[o8] = r9[o8]; + return p8[t11] = i10(a8), _t2(e13, this, p8); + }; + } + function So(e13, t11) { + return t11.length < 2 ? e13 : $n(e13, er(t11, 0, -1)); + } + function Po(e13, t11) { + if (("constructor" !== t11 || "function" != typeof e13[t11]) && "__proto__" != t11) + return e13[t11]; + } + var Oo = Eo(Zn), To = dt2 || function(e13, t11) { + return ft.setTimeout(e13, t11); + }, Ao = Eo(Yn); + function Io(e13, t11, i10) { + var n10 = t11 + ""; + return Ao(e13, function(e14, t12) { + var i11 = t12.length; + if (!i11) + return e14; + var n11 = i11 - 1; + return t12[n11] = (i11 > 1 ? "& " : "") + t12[n11], t12 = t12.join(i11 > 2 ? ", " : " "), e14.replace(oe4, "{\n/* [wrapped with " + t12 + "] */\n"); + }(n10, function(e14, t12) { + return St(m7, function(i11) { + var n11 = "_." + i11[0]; + t12 & i11[1] && !At(e14, n11) && e14.push(n11); + }), e14.sort(); + }(function(e14) { + var t12 = e14.match(se4); + return t12 ? t12[1].split(ae4) : []; + }(n10), i10))); + } + function Eo(e13) { + var t11 = 0, i10 = 0; + return function() { + var n10 = gi(), o8 = 16 - (n10 - i10); + if (i10 = n10, o8 > 0) { + if (++t11 >= 800) + return arguments[0]; + } else + t11 = 0; + return e13.apply(r8, arguments); + }; + } + function qo(e13, t11) { + var i10 = -1, n10 = e13.length, o8 = n10 - 1; + for (t11 = t11 === r8 ? n10 : t11; ++i10 < t11; ) { + var s8 = Qn(i10, o8), a8 = e13[s8]; + e13[s8] = e13[i10], e13[i10] = a8; + } + return e13.length = t11, e13; + } + var ko, Mo, Ro = (ko = ks(function(e13) { + var t11 = []; + return 46 === e13.charCodeAt(0) && t11.push(""), e13.replace(ee4, function(e14, i10, n10, r9) { + t11.push(n10 ? r9.replace(de4, "$1") : i10 || e14); + }), t11; + }, function(e13) { + return 500 === Mo.size && Mo.clear(), e13; + }), Mo = ko.cache, ko); + function Do(e13) { + if ("string" == typeof e13 || aa(e13)) + return e13; + var t11 = e13 + ""; + return "0" == t11 && 1 / e13 == -1 / 0 ? "-0" : t11; + } + function Co(e13) { + if (null != e13) { + try { + return qe3.call(e13); + } catch (e14) { + } + try { + return e13 + ""; + } catch (e14) { + } + } + return ""; + } + function Vo(e13) { + if (e13 instanceof Ui) + return e13.clone(); + var t11 = new Fi(e13.__wrapped__, e13.__chain__); + return t11.__actions__ = Pr(e13.__actions__), t11.__index__ = e13.__index__, t11.__values__ = e13.__values__, t11; + } + var No = Hn(function(e13, t11) { + return Ks(e13) ? cn(e13, hn(t11, 1, Ks, true)) : []; + }), Fo = Hn(function(e13, t11) { + var i10 = Wo(t11); + return Ks(i10) && (i10 = r8), Ks(e13) ? cn(e13, hn(t11, 1, Ks, true), oo(i10, 2)) : []; + }), Uo = Hn(function(e13, t11) { + var i10 = Wo(t11); + return Ks(i10) && (i10 = r8), Ks(e13) ? cn(e13, hn(t11, 1, Ks, true), r8, i10) : []; + }); + function Lo(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + if (!n10) + return -1; + var r9 = null == i10 ? 0 : ua(i10); + return r9 < 0 && (r9 = hi(n10 + r9, 0)), Vt(e13, oo(t11, 3), r9); + } + function zo(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + if (!n10) + return -1; + var o8 = n10 - 1; + return i10 !== r8 && (o8 = ua(i10), o8 = i10 < 0 ? hi(n10 + o8, 0) : yi(o8, n10 - 1)), Vt(e13, oo(t11, 3), o8, true); + } + function Bo(e13) { + return null != e13 && e13.length ? hn(e13, 1) : []; + } + function Qo(e13) { + return e13 && e13.length ? e13[0] : r8; + } + var Ko = Hn(function(e13) { + var t11 = Et(e13, mr); + return t11.length && t11[0] === e13[0] ? On(t11) : []; + }), Ho = Hn(function(e13) { + var t11 = Wo(e13), i10 = Et(e13, mr); + return t11 === Wo(i10) ? t11 = r8 : i10.pop(), i10.length && i10[0] === e13[0] ? On(i10, oo(t11, 2)) : []; + }), Go = Hn(function(e13) { + var t11 = Wo(e13), i10 = Et(e13, mr); + return (t11 = "function" == typeof t11 ? t11 : r8) && i10.pop(), i10.length && i10[0] === e13[0] ? On(i10, r8, t11) : []; + }); + function Wo(e13) { + var t11 = null == e13 ? 0 : e13.length; + return t11 ? e13[t11 - 1] : r8; + } + var Jo = Hn(Zo); + function Zo(e13, t11) { + return e13 && e13.length && t11 && t11.length ? zn(e13, t11) : e13; + } + var Yo = Xr(function(e13, t11) { + var i10 = null == e13 ? 0 : e13.length, n10 = rn(e13, t11); + return Bn(e13, Et(t11, function(e14) { + return yo(e14, i10) ? +e14 : e14; + }).sort(_r)), n10; + }); + function Xo(e13) { + return null == e13 ? e13 : ji.call(e13); + } + var es = Hn(function(e13) { + return ar(hn(e13, 1, Ks, true)); + }), ts = Hn(function(e13) { + var t11 = Wo(e13); + return Ks(t11) && (t11 = r8), ar(hn(e13, 1, Ks, true), oo(t11, 2)); + }), is = Hn(function(e13) { + var t11 = Wo(e13); + return t11 = "function" == typeof t11 ? t11 : r8, ar(hn(e13, 1, Ks, true), r8, t11); + }); + function ns(e13) { + if (!e13 || !e13.length) + return []; + var t11 = 0; + return e13 = Tt(e13, function(e14) { + if (Ks(e14)) + return t11 = hi(e14.length, t11), true; + }), Ht(t11, function(t12) { + return Et(e13, zt(t12)); + }); + } + function rs(e13, t11) { + if (!e13 || !e13.length) + return []; + var i10 = ns(e13); + return null == t11 ? i10 : Et(i10, function(e14) { + return _t2(t11, r8, e14); + }); + } + var os = Hn(function(e13, t11) { + return Ks(e13) ? cn(e13, t11) : []; + }), ss = Hn(function(e13) { + return lr(Tt(e13, Ks)); + }), as = Hn(function(e13) { + var t11 = Wo(e13); + return Ks(t11) && (t11 = r8), lr(Tt(e13, Ks), oo(t11, 2)); + }), ps = Hn(function(e13) { + var t11 = Wo(e13); + return t11 = "function" == typeof t11 ? t11 : r8, lr(Tt(e13, Ks), r8, t11); + }), cs = Hn(ns), ds = Hn(function(e13) { + var t11 = e13.length, i10 = t11 > 1 ? e13[t11 - 1] : r8; + return i10 = "function" == typeof i10 ? (e13.pop(), i10) : r8, rs(e13, i10); + }); + function fs(e13) { + var t11 = Ci(e13); + return t11.__chain__ = true, t11; + } + function ls(e13, t11) { + return t11(e13); + } + var us = Xr(function(e13) { + var t11 = e13.length, i10 = t11 ? e13[0] : 0, n10 = this.__wrapped__, o8 = function(t12) { + return rn(t12, e13); + }; + return !(t11 > 1 || this.__actions__.length) && n10 instanceof Ui && yo(i10) ? ((n10 = n10.slice(i10, +i10 + (t11 ? 1 : 0))).__actions__.push({ func: ls, args: [o8], thisArg: r8 }), new Fi(n10, this.__chain__).thru(function(e14) { + return t11 && !e14.length && e14.push(r8), e14; + })) : this.thru(o8); + }), ms = Tr(function(e13, t11, i10) { + ke4.call(e13, i10) ? ++e13[i10] : nn(e13, i10, 1); + }), hs = Rr(Lo), ys = Rr(zo); + function gs(e13, t11) { + return (zs(e13) ? St : dn)(e13, oo(t11, 3)); + } + function bs(e13, t11) { + return (zs(e13) ? Pt : fn)(e13, oo(t11, 3)); + } + var vs = Tr(function(e13, t11, i10) { + ke4.call(e13, i10) ? e13[i10].push(t11) : nn(e13, i10, [t11]); + }), js = Hn(function(e13, t11, i10) { + var r9 = -1, o8 = "function" == typeof t11, s8 = Qs(e13) ? n9(e13.length) : []; + return dn(e13, function(e14) { + s8[++r9] = o8 ? _t2(t11, e14, i10) : Tn(e14, t11, i10); + }), s8; + }), $s = Tr(function(e13, t11, i10) { + nn(e13, i10, t11); + }); + function xs(e13, t11) { + return (zs(e13) ? Et : Dn)(e13, oo(t11, 3)); + } + var _s = Tr(function(e13, t11, i10) { + e13[i10 ? 0 : 1].push(t11); + }, function() { + return [[], []]; + }), ws = Hn(function(e13, t11) { + if (null == e13) + return []; + var i10 = t11.length; + return i10 > 1 && go(e13, t11[0], t11[1]) ? t11 = [] : i10 > 2 && go(t11[0], t11[1], t11[2]) && (t11 = [t11[0]]), Un(e13, hn(t11, 1), []); + }), Ss = ct2 || function() { + return ft.Date.now(); + }; + function Ps(e13, t11, i10) { + return t11 = i10 ? r8 : t11, t11 = e13 && null == t11 ? e13.length : t11, Gr(e13, c7, r8, r8, r8, r8, t11); + } + function Os(e13, t11) { + var i10; + if ("function" != typeof t11) + throw new Oe5(o7); + return e13 = ua(e13), function() { + return --e13 > 0 && (i10 = t11.apply(this, arguments)), e13 <= 1 && (t11 = r8), i10; + }; + } + var Ts = Hn(function(e13, t11, i10) { + var n10 = 1; + if (i10.length) { + var r9 = si(i10, ro(Ts)); + n10 |= p7; + } + return Gr(e13, n10, t11, i10, r9); + }), As = Hn(function(e13, t11, i10) { + var n10 = 3; + if (i10.length) { + var r9 = si(i10, ro(As)); + n10 |= p7; + } + return Gr(t11, n10, e13, i10, r9); + }); + function Is(e13, t11, i10) { + var n10, s8, a8, p8, c8, d8, f9 = 0, l8 = false, u8 = false, m8 = true; + if ("function" != typeof e13) + throw new Oe5(o7); + function h9(t12) { + var i11 = n10, o8 = s8; + return n10 = s8 = r8, f9 = t12, p8 = e13.apply(o8, i11); + } + function y8(e14) { + var i11 = e14 - d8; + return d8 === r8 || i11 >= t11 || i11 < 0 || u8 && e14 - f9 >= a8; + } + function g8() { + var e14 = Ss(); + if (y8(e14)) + return b9(e14); + c8 = To(g8, function(e15) { + var i11 = t11 - (e15 - d8); + return u8 ? yi(i11, a8 - (e15 - f9)) : i11; + }(e14)); + } + function b9(e14) { + return c8 = r8, m8 && n10 ? h9(e14) : (n10 = s8 = r8, p8); + } + function v9() { + var e14 = Ss(), i11 = y8(e14); + if (n10 = arguments, s8 = this, d8 = e14, i11) { + if (c8 === r8) + return function(e15) { + return f9 = e15, c8 = To(g8, t11), l8 ? h9(e15) : p8; + }(d8); + if (u8) + return vr(c8), c8 = To(g8, t11), h9(d8); + } + return c8 === r8 && (c8 = To(g8, t11)), p8; + } + return t11 = ha(t11) || 0, Xs(i10) && (l8 = !!i10.leading, a8 = (u8 = "maxWait" in i10) ? hi(ha(i10.maxWait) || 0, t11) : a8, m8 = "trailing" in i10 ? !!i10.trailing : m8), v9.cancel = function() { + c8 !== r8 && vr(c8), f9 = 0, n10 = d8 = s8 = c8 = r8; + }, v9.flush = function() { + return c8 === r8 ? p8 : b9(Ss()); + }, v9; + } + var Es = Hn(function(e13, t11) { + return pn(e13, 1, t11); + }), qs = Hn(function(e13, t11, i10) { + return pn(e13, ha(t11) || 0, i10); + }); + function ks(e13, t11) { + if ("function" != typeof e13 || null != t11 && "function" != typeof t11) + throw new Oe5(o7); + var i10 = function() { + var n10 = arguments, r9 = t11 ? t11.apply(this, n10) : n10[0], o8 = i10.cache; + if (o8.has(r9)) + return o8.get(r9); + var s8 = e13.apply(this, n10); + return i10.cache = o8.set(r9, s8) || o8, s8; + }; + return i10.cache = new (ks.Cache || Bi)(), i10; + } + function Ms(e13) { + if ("function" != typeof e13) + throw new Oe5(o7); + return function() { + var t11 = arguments; + switch (t11.length) { + case 0: + return !e13.call(this); + case 1: + return !e13.call(this, t11[0]); + case 2: + return !e13.call(this, t11[0], t11[1]); + case 3: + return !e13.call(this, t11[0], t11[1], t11[2]); + } + return !e13.apply(this, t11); + }; + } + ks.Cache = Bi; + var Rs = gr(function(e13, t11) { + var i10 = (t11 = 1 == t11.length && zs(t11[0]) ? Et(t11[0], Wt(oo())) : Et(hn(t11, 1), Wt(oo()))).length; + return Hn(function(n10) { + for (var r9 = -1, o8 = yi(n10.length, i10); ++r9 < o8; ) + n10[r9] = t11[r9].call(this, n10[r9]); + return _t2(e13, this, n10); + }); + }), Ds = Hn(function(e13, t11) { + var i10 = si(t11, ro(Ds)); + return Gr(e13, p7, r8, t11, i10); + }), Cs = Hn(function(e13, t11) { + var i10 = si(t11, ro(Cs)); + return Gr(e13, 64, r8, t11, i10); + }), Vs = Xr(function(e13, t11) { + return Gr(e13, 256, r8, r8, r8, t11); + }); + function Ns(e13, t11) { + return e13 === t11 || e13 != e13 && t11 != t11; + } + var Fs = zr(wn), Us = zr(function(e13, t11) { + return e13 >= t11; + }), Ls = An(/* @__PURE__ */ function() { + return arguments; + }()) ? An : function(e13) { + return ea(e13) && ke4.call(e13, "callee") && !Ke2.call(e13, "callee"); + }, zs = n9.isArray, Bs = gt2 ? Wt(gt2) : function(e13) { + return ea(e13) && _n(e13) == E6; + }; + function Qs(e13) { + return null != e13 && Ys(e13.length) && !Js(e13); + } + function Ks(e13) { + return ea(e13) && Qs(e13); + } + var Hs = yt2 || hp, Gs = bt ? Wt(bt) : function(e13) { + return ea(e13) && _n(e13) == b8; + }; + function Ws(e13) { + if (!ea(e13)) + return false; + var t11 = _n(e13); + return t11 == v8 || "[object DOMException]" == t11 || "string" == typeof e13.message && "string" == typeof e13.name && !na(e13); + } + function Js(e13) { + if (!Xs(e13)) + return false; + var t11 = _n(e13); + return t11 == j6 || t11 == $5 || "[object AsyncFunction]" == t11 || "[object Proxy]" == t11; + } + function Zs(e13) { + return "number" == typeof e13 && e13 == ua(e13); + } + function Ys(e13) { + return "number" == typeof e13 && e13 > -1 && e13 % 1 == 0 && e13 <= f8; + } + function Xs(e13) { + var t11 = typeof e13; + return null != e13 && ("object" == t11 || "function" == t11); + } + function ea(e13) { + return null != e13 && "object" == typeof e13; + } + var ta = vt ? Wt(vt) : function(e13) { + return ea(e13) && lo(e13) == x7; + }; + function ia(e13) { + return "number" == typeof e13 || ea(e13) && _n(e13) == _6; + } + function na(e13) { + if (!ea(e13) || _n(e13) != w6) + return false; + var t11 = Be4(e13); + if (null === t11) + return true; + var i10 = ke4.call(t11, "constructor") && t11.constructor; + return "function" == typeof i10 && i10 instanceof i10 && qe3.call(i10) == Ce2; + } + var ra = jt ? Wt(jt) : function(e13) { + return ea(e13) && _n(e13) == P6; + }, oa = $t ? Wt($t) : function(e13) { + return ea(e13) && lo(e13) == O7; + }; + function sa(e13) { + return "string" == typeof e13 || !zs(e13) && ea(e13) && _n(e13) == T6; + } + function aa(e13) { + return "symbol" == typeof e13 || ea(e13) && _n(e13) == A6; + } + var pa = xt ? Wt(xt) : function(e13) { + return ea(e13) && Ys(e13.length) && !!rt[_n(e13)]; + }, ca = zr(Rn), da = zr(function(e13, t11) { + return e13 <= t11; + }); + function fa(e13) { + if (!e13) + return []; + if (Qs(e13)) + return sa(e13) ? di(e13) : Pr(e13); + if (We2 && e13[We2]) + return function(e14) { + for (var t12, i10 = []; !(t12 = e14.next()).done; ) + i10.push(t12.value); + return i10; + }(e13[We2]()); + var t11 = lo(e13); + return (t11 == x7 ? ri : t11 == O7 ? ai : Na)(e13); + } + function la(e13) { + return e13 ? (e13 = ha(e13)) === d7 || e13 === -1 / 0 ? 17976931348623157e292 * (e13 < 0 ? -1 : 1) : e13 == e13 ? e13 : 0 : 0 === e13 ? e13 : 0; + } + function ua(e13) { + var t11 = la(e13), i10 = t11 % 1; + return t11 == t11 ? i10 ? t11 - i10 : t11 : 0; + } + function ma(e13) { + return e13 ? on4(ua(e13), 0, u7) : 0; + } + function ha(e13) { + if ("number" == typeof e13) + return e13; + if (aa(e13)) + return l7; + if (Xs(e13)) { + var t11 = "function" == typeof e13.valueOf ? e13.valueOf() : e13; + e13 = Xs(t11) ? t11 + "" : t11; + } + if ("string" != typeof e13) + return 0 === e13 ? e13 : +e13; + e13 = Gt(e13); + var i10 = me4.test(e13); + return i10 || ye4.test(e13) ? pt(e13.slice(2), i10 ? 2 : 8) : ue4.test(e13) ? l7 : +e13; + } + function ya(e13) { + return Or(e13, Ea(e13)); + } + function ga(e13) { + return null == e13 ? "" : sr(e13); + } + var ba = Ar(function(e13, t11) { + if ($o(t11) || Qs(t11)) + Or(t11, Ia(t11), e13); + else + for (var i10 in t11) + ke4.call(t11, i10) && Yi(e13, i10, t11[i10]); + }), va = Ar(function(e13, t11) { + Or(t11, Ea(t11), e13); + }), ja = Ar(function(e13, t11, i10, n10) { + Or(t11, Ea(t11), e13, n10); + }), $a = Ar(function(e13, t11, i10, n10) { + Or(t11, Ia(t11), e13, n10); + }), xa = Xr(rn), _a2 = Hn(function(e13, t11) { + e13 = we5(e13); + var i10 = -1, n10 = t11.length, o8 = n10 > 2 ? t11[2] : r8; + for (o8 && go(t11[0], t11[1], o8) && (n10 = 1); ++i10 < n10; ) + for (var s8 = t11[i10], a8 = Ea(s8), p8 = -1, c8 = a8.length; ++p8 < c8; ) { + var d8 = a8[p8], f9 = e13[d8]; + (f9 === r8 || Ns(f9, Ie3[d8]) && !ke4.call(e13, d8)) && (e13[d8] = s8[d8]); + } + return e13; + }), wa = Hn(function(e13) { + return e13.push(r8, Jr), _t2(ka, r8, e13); + }); + function Sa(e13, t11, i10) { + var n10 = null == e13 ? r8 : $n(e13, t11); + return n10 === r8 ? i10 : n10; + } + function Pa(e13, t11) { + return null != e13 && uo(e13, t11, Pn); + } + var Oa = Vr(function(e13, t11, i10) { + null != t11 && "function" != typeof t11.toString && (t11 = De3.call(t11)), e13[t11] = i10; + }, Xa(ip)), Ta = Vr(function(e13, t11, i10) { + null != t11 && "function" != typeof t11.toString && (t11 = De3.call(t11)), ke4.call(e13, t11) ? e13[t11].push(i10) : e13[t11] = [i10]; + }, oo), Aa = Hn(Tn); + function Ia(e13) { + return Qs(e13) ? Hi(e13) : Mn(e13); + } + function Ea(e13) { + return Qs(e13) ? Hi(e13, true) : function(e14) { + if (!Xs(e14)) + return function(e15) { + var t12 = []; + if (null != e15) + for (var i11 in we5(e15)) + t12.push(i11); + return t12; + }(e14); + var t11 = $o(e14), i10 = []; + for (var n10 in e14) + ("constructor" != n10 || !t11 && ke4.call(e14, n10)) && i10.push(n10); + return i10; + }(e13); + } + var qa = Ar(function(e13, t11, i10) { + Nn(e13, t11, i10); + }), ka = Ar(function(e13, t11, i10, n10) { + Nn(e13, t11, i10, n10); + }), Ma = Xr(function(e13, t11) { + var i10 = {}; + if (null == e13) + return i10; + var n10 = false; + t11 = Et(t11, function(t12) { + return t12 = yr(t12, e13), n10 || (n10 = t12.length > 1), t12; + }), Or(e13, to(e13), i10), n10 && (i10 = sn(i10, 7, Zr)); + for (var r9 = t11.length; r9--; ) + pr(i10, t11[r9]); + return i10; + }), Ra = Xr(function(e13, t11) { + return null == e13 ? {} : function(e14, t12) { + return Ln(e14, t12, function(t13, i10) { + return Pa(e14, i10); + }); + }(e13, t11); + }); + function Da(e13, t11) { + if (null == e13) + return {}; + var i10 = Et(to(e13), function(e14) { + return [e14]; + }); + return t11 = oo(t11), Ln(e13, i10, function(e14, i11) { + return t11(e14, i11[0]); + }); + } + var Ca = Hr(Ia), Va = Hr(Ea); + function Na(e13) { + return null == e13 ? [] : Jt(e13, Ia(e13)); + } + var Fa = kr(function(e13, t11, i10) { + return t11 = t11.toLowerCase(), e13 + (i10 ? Ua(t11) : t11); + }); + function Ua(e13) { + return Wa(ga(e13).toLowerCase()); + } + function La(e13) { + return (e13 = ga(e13)) && e13.replace(be4, ei).replace(Ze, ""); + } + var za = kr(function(e13, t11, i10) { + return e13 + (i10 ? "-" : "") + t11.toLowerCase(); + }), Ba = kr(function(e13, t11, i10) { + return e13 + (i10 ? " " : "") + t11.toLowerCase(); + }), Qa = qr("toLowerCase"), Ka = kr(function(e13, t11, i10) { + return e13 + (i10 ? "_" : "") + t11.toLowerCase(); + }), Ha = kr(function(e13, t11, i10) { + return e13 + (i10 ? " " : "") + Wa(t11); + }), Ga = kr(function(e13, t11, i10) { + return e13 + (i10 ? " " : "") + t11.toUpperCase(); + }), Wa = qr("toUpperCase"); + function Ja(e13, t11, i10) { + return e13 = ga(e13), (t11 = i10 ? r8 : t11) === r8 ? function(e14) { + return tt3.test(e14); + }(e13) ? function(e14) { + return e14.match(Xe) || []; + }(e13) : function(e14) { + return e14.match(pe4) || []; + }(e13) : e13.match(t11) || []; + } + var Za = Hn(function(e13, t11) { + try { + return _t2(e13, r8, t11); + } catch (e14) { + return Ws(e14) ? e14 : new $e3(e14); + } + }), Ya = Xr(function(e13, t11) { + return St(t11, function(t12) { + t12 = Do(t12), nn(e13, t12, Ts(e13[t12], e13)); + }), e13; + }); + function Xa(e13) { + return function() { + return e13; + }; + } + var ep = Dr(), tp = Dr(true); + function ip(e13) { + return e13; + } + function np(e13) { + return kn("function" == typeof e13 ? e13 : sn(e13, 1)); + } + var rp = Hn(function(e13, t11) { + return function(i10) { + return Tn(i10, e13, t11); + }; + }), op = Hn(function(e13, t11) { + return function(i10) { + return Tn(e13, i10, t11); + }; + }); + function sp(e13, t11, i10) { + var n10 = Ia(t11), r9 = jn(t11, n10); + null != i10 || Xs(t11) && (r9.length || !n10.length) || (i10 = t11, t11 = e13, e13 = this, r9 = jn(t11, Ia(t11))); + var o8 = !(Xs(i10) && "chain" in i10 && !i10.chain), s8 = Js(e13); + return St(r9, function(i11) { + var n11 = t11[i11]; + e13[i11] = n11, s8 && (e13.prototype[i11] = function() { + var t12 = this.__chain__; + if (o8 || t12) { + var i12 = e13(this.__wrapped__); + return (i12.__actions__ = Pr(this.__actions__)).push({ func: n11, args: arguments, thisArg: e13 }), i12.__chain__ = t12, i12; + } + return n11.apply(e13, qt([this.value()], arguments)); + }); + }), e13; + } + function ap() { + } + var pp = Fr(Et), cp = Fr(Ot), dp = Fr(Rt); + function fp(e13) { + return bo(e13) ? zt(Do(e13)) : /* @__PURE__ */ function(e14) { + return function(t11) { + return $n(t11, e14); + }; + }(e13); + } + var lp = Lr(), up = Lr(true); + function mp() { + return []; + } + function hp() { + return false; + } + var yp, gp = Nr(function(e13, t11) { + return e13 + t11; + }, 0), bp = Qr("ceil"), vp = Nr(function(e13, t11) { + return e13 / t11; + }, 1), jp = Qr("floor"), $p = Nr(function(e13, t11) { + return e13 * t11; + }, 1), xp = Qr("round"), _p = Nr(function(e13, t11) { + return e13 - t11; + }, 0); + return Ci.after = function(e13, t11) { + if ("function" != typeof t11) + throw new Oe5(o7); + return e13 = ua(e13), function() { + if (--e13 < 1) + return t11.apply(this, arguments); + }; + }, Ci.ary = Ps, Ci.assign = ba, Ci.assignIn = va, Ci.assignInWith = ja, Ci.assignWith = $a, Ci.at = xa, Ci.before = Os, Ci.bind = Ts, Ci.bindAll = Ya, Ci.bindKey = As, Ci.castArray = function() { + if (!arguments.length) + return []; + var e13 = arguments[0]; + return zs(e13) ? e13 : [e13]; + }, Ci.chain = fs, Ci.chunk = function(e13, t11, i10) { + t11 = (i10 ? go(e13, t11, i10) : t11 === r8) ? 1 : hi(ua(t11), 0); + var o8 = null == e13 ? 0 : e13.length; + if (!o8 || t11 < 1) + return []; + for (var s8 = 0, a8 = 0, p8 = n9(lt3(o8 / t11)); s8 < o8; ) + p8[a8++] = er(e13, s8, s8 += t11); + return p8; + }, Ci.compact = function(e13) { + for (var t11 = -1, i10 = null == e13 ? 0 : e13.length, n10 = 0, r9 = []; ++t11 < i10; ) { + var o8 = e13[t11]; + o8 && (r9[n10++] = o8); + } + return r9; + }, Ci.concat = function() { + var e13 = arguments.length; + if (!e13) + return []; + for (var t11 = n9(e13 - 1), i10 = arguments[0], r9 = e13; r9--; ) + t11[r9 - 1] = arguments[r9]; + return qt(zs(i10) ? Pr(i10) : [i10], hn(t11, 1)); + }, Ci.cond = function(e13) { + var t11 = null == e13 ? 0 : e13.length, i10 = oo(); + return e13 = t11 ? Et(e13, function(e14) { + if ("function" != typeof e14[1]) + throw new Oe5(o7); + return [i10(e14[0]), e14[1]]; + }) : [], Hn(function(i11) { + for (var n10 = -1; ++n10 < t11; ) { + var r9 = e13[n10]; + if (_t2(r9[0], this, i11)) + return _t2(r9[1], this, i11); + } + }); + }, Ci.conforms = function(e13) { + return function(e14) { + var t11 = Ia(e14); + return function(i10) { + return an(i10, e14, t11); + }; + }(sn(e13, 1)); + }, Ci.constant = Xa, Ci.countBy = ms, Ci.create = function(e13, t11) { + var i10 = Vi(e13); + return null == t11 ? i10 : tn(i10, t11); + }, Ci.curry = function e13(t11, i10, n10) { + var o8 = Gr(t11, 8, r8, r8, r8, r8, r8, i10 = n10 ? r8 : i10); + return o8.placeholder = e13.placeholder, o8; + }, Ci.curryRight = function e13(t11, i10, n10) { + var o8 = Gr(t11, 16, r8, r8, r8, r8, r8, i10 = n10 ? r8 : i10); + return o8.placeholder = e13.placeholder, o8; + }, Ci.debounce = Is, Ci.defaults = _a2, Ci.defaultsDeep = wa, Ci.defer = Es, Ci.delay = qs, Ci.difference = No, Ci.differenceBy = Fo, Ci.differenceWith = Uo, Ci.drop = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + return n10 ? er(e13, (t11 = i10 || t11 === r8 ? 1 : ua(t11)) < 0 ? 0 : t11, n10) : []; + }, Ci.dropRight = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + return n10 ? er(e13, 0, (t11 = n10 - (t11 = i10 || t11 === r8 ? 1 : ua(t11))) < 0 ? 0 : t11) : []; + }, Ci.dropRightWhile = function(e13, t11) { + return e13 && e13.length ? dr(e13, oo(t11, 3), true, true) : []; + }, Ci.dropWhile = function(e13, t11) { + return e13 && e13.length ? dr(e13, oo(t11, 3), true) : []; + }, Ci.fill = function(e13, t11, i10, n10) { + var o8 = null == e13 ? 0 : e13.length; + return o8 ? (i10 && "number" != typeof i10 && go(e13, t11, i10) && (i10 = 0, n10 = o8), function(e14, t12, i11, n11) { + var o9 = e14.length; + for ((i11 = ua(i11)) < 0 && (i11 = -i11 > o9 ? 0 : o9 + i11), (n11 = n11 === r8 || n11 > o9 ? o9 : ua(n11)) < 0 && (n11 += o9), n11 = i11 > n11 ? 0 : ma(n11); i11 < n11; ) + e14[i11++] = t12; + return e14; + }(e13, t11, i10, n10)) : []; + }, Ci.filter = function(e13, t11) { + return (zs(e13) ? Tt : mn)(e13, oo(t11, 3)); + }, Ci.flatMap = function(e13, t11) { + return hn(xs(e13, t11), 1); + }, Ci.flatMapDeep = function(e13, t11) { + return hn(xs(e13, t11), d7); + }, Ci.flatMapDepth = function(e13, t11, i10) { + return i10 = i10 === r8 ? 1 : ua(i10), hn(xs(e13, t11), i10); + }, Ci.flatten = Bo, Ci.flattenDeep = function(e13) { + return null != e13 && e13.length ? hn(e13, d7) : []; + }, Ci.flattenDepth = function(e13, t11) { + return null != e13 && e13.length ? hn(e13, t11 = t11 === r8 ? 1 : ua(t11)) : []; + }, Ci.flip = function(e13) { + return Gr(e13, 512); + }, Ci.flow = ep, Ci.flowRight = tp, Ci.fromPairs = function(e13) { + for (var t11 = -1, i10 = null == e13 ? 0 : e13.length, n10 = {}; ++t11 < i10; ) { + var r9 = e13[t11]; + n10[r9[0]] = r9[1]; + } + return n10; + }, Ci.functions = function(e13) { + return null == e13 ? [] : jn(e13, Ia(e13)); + }, Ci.functionsIn = function(e13) { + return null == e13 ? [] : jn(e13, Ea(e13)); + }, Ci.groupBy = vs, Ci.initial = function(e13) { + return null != e13 && e13.length ? er(e13, 0, -1) : []; + }, Ci.intersection = Ko, Ci.intersectionBy = Ho, Ci.intersectionWith = Go, Ci.invert = Oa, Ci.invertBy = Ta, Ci.invokeMap = js, Ci.iteratee = np, Ci.keyBy = $s, Ci.keys = Ia, Ci.keysIn = Ea, Ci.map = xs, Ci.mapKeys = function(e13, t11) { + var i10 = {}; + return t11 = oo(t11, 3), bn(e13, function(e14, n10, r9) { + nn(i10, t11(e14, n10, r9), e14); + }), i10; + }, Ci.mapValues = function(e13, t11) { + var i10 = {}; + return t11 = oo(t11, 3), bn(e13, function(e14, n10, r9) { + nn(i10, n10, t11(e14, n10, r9)); + }), i10; + }, Ci.matches = function(e13) { + return Cn(sn(e13, 1)); + }, Ci.matchesProperty = function(e13, t11) { + return Vn(e13, sn(t11, 1)); + }, Ci.memoize = ks, Ci.merge = qa, Ci.mergeWith = ka, Ci.method = rp, Ci.methodOf = op, Ci.mixin = sp, Ci.negate = Ms, Ci.nthArg = function(e13) { + return e13 = ua(e13), Hn(function(t11) { + return Fn(t11, e13); + }); + }, Ci.omit = Ma, Ci.omitBy = function(e13, t11) { + return Da(e13, Ms(oo(t11))); + }, Ci.once = function(e13) { + return Os(2, e13); + }, Ci.orderBy = function(e13, t11, i10, n10) { + return null == e13 ? [] : (zs(t11) || (t11 = null == t11 ? [] : [t11]), zs(i10 = n10 ? r8 : i10) || (i10 = null == i10 ? [] : [i10]), Un(e13, t11, i10)); + }, Ci.over = pp, Ci.overArgs = Rs, Ci.overEvery = cp, Ci.overSome = dp, Ci.partial = Ds, Ci.partialRight = Cs, Ci.partition = _s, Ci.pick = Ra, Ci.pickBy = Da, Ci.property = fp, Ci.propertyOf = function(e13) { + return function(t11) { + return null == e13 ? r8 : $n(e13, t11); + }; + }, Ci.pull = Jo, Ci.pullAll = Zo, Ci.pullAllBy = function(e13, t11, i10) { + return e13 && e13.length && t11 && t11.length ? zn(e13, t11, oo(i10, 2)) : e13; + }, Ci.pullAllWith = function(e13, t11, i10) { + return e13 && e13.length && t11 && t11.length ? zn(e13, t11, r8, i10) : e13; + }, Ci.pullAt = Yo, Ci.range = lp, Ci.rangeRight = up, Ci.rearg = Vs, Ci.reject = function(e13, t11) { + return (zs(e13) ? Tt : mn)(e13, Ms(oo(t11, 3))); + }, Ci.remove = function(e13, t11) { + var i10 = []; + if (!e13 || !e13.length) + return i10; + var n10 = -1, r9 = [], o8 = e13.length; + for (t11 = oo(t11, 3); ++n10 < o8; ) { + var s8 = e13[n10]; + t11(s8, n10, e13) && (i10.push(s8), r9.push(n10)); + } + return Bn(e13, r9), i10; + }, Ci.rest = function(e13, t11) { + if ("function" != typeof e13) + throw new Oe5(o7); + return Hn(e13, t11 = t11 === r8 ? t11 : ua(t11)); + }, Ci.reverse = Xo, Ci.sampleSize = function(e13, t11, i10) { + return t11 = (i10 ? go(e13, t11, i10) : t11 === r8) ? 1 : ua(t11), (zs(e13) ? Wi : Wn)(e13, t11); + }, Ci.set = function(e13, t11, i10) { + return null == e13 ? e13 : Jn(e13, t11, i10); + }, Ci.setWith = function(e13, t11, i10, n10) { + return n10 = "function" == typeof n10 ? n10 : r8, null == e13 ? e13 : Jn(e13, t11, i10, n10); + }, Ci.shuffle = function(e13) { + return (zs(e13) ? Ji : Xn)(e13); + }, Ci.slice = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + return n10 ? (i10 && "number" != typeof i10 && go(e13, t11, i10) ? (t11 = 0, i10 = n10) : (t11 = null == t11 ? 0 : ua(t11), i10 = i10 === r8 ? n10 : ua(i10)), er(e13, t11, i10)) : []; + }, Ci.sortBy = ws, Ci.sortedUniq = function(e13) { + return e13 && e13.length ? rr(e13) : []; + }, Ci.sortedUniqBy = function(e13, t11) { + return e13 && e13.length ? rr(e13, oo(t11, 2)) : []; + }, Ci.split = function(e13, t11, i10) { + return i10 && "number" != typeof i10 && go(e13, t11, i10) && (t11 = i10 = r8), (i10 = i10 === r8 ? u7 : i10 >>> 0) ? (e13 = ga(e13)) && ("string" == typeof t11 || null != t11 && !ra(t11)) && !(t11 = sr(t11)) && ni(e13) ? br(di(e13), 0, i10) : e13.split(t11, i10) : []; + }, Ci.spread = function(e13, t11) { + if ("function" != typeof e13) + throw new Oe5(o7); + return t11 = null == t11 ? 0 : hi(ua(t11), 0), Hn(function(i10) { + var n10 = i10[t11], r9 = br(i10, 0, t11); + return n10 && qt(r9, n10), _t2(e13, this, r9); + }); + }, Ci.tail = function(e13) { + var t11 = null == e13 ? 0 : e13.length; + return t11 ? er(e13, 1, t11) : []; + }, Ci.take = function(e13, t11, i10) { + return e13 && e13.length ? er(e13, 0, (t11 = i10 || t11 === r8 ? 1 : ua(t11)) < 0 ? 0 : t11) : []; + }, Ci.takeRight = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + return n10 ? er(e13, (t11 = n10 - (t11 = i10 || t11 === r8 ? 1 : ua(t11))) < 0 ? 0 : t11, n10) : []; + }, Ci.takeRightWhile = function(e13, t11) { + return e13 && e13.length ? dr(e13, oo(t11, 3), false, true) : []; + }, Ci.takeWhile = function(e13, t11) { + return e13 && e13.length ? dr(e13, oo(t11, 3)) : []; + }, Ci.tap = function(e13, t11) { + return t11(e13), e13; + }, Ci.throttle = function(e13, t11, i10) { + var n10 = true, r9 = true; + if ("function" != typeof e13) + throw new Oe5(o7); + return Xs(i10) && (n10 = "leading" in i10 ? !!i10.leading : n10, r9 = "trailing" in i10 ? !!i10.trailing : r9), Is(e13, t11, { leading: n10, maxWait: t11, trailing: r9 }); + }, Ci.thru = ls, Ci.toArray = fa, Ci.toPairs = Ca, Ci.toPairsIn = Va, Ci.toPath = function(e13) { + return zs(e13) ? Et(e13, Do) : aa(e13) ? [e13] : Pr(Ro(ga(e13))); + }, Ci.toPlainObject = ya, Ci.transform = function(e13, t11, i10) { + var n10 = zs(e13), r9 = n10 || Hs(e13) || pa(e13); + if (t11 = oo(t11, 4), null == i10) { + var o8 = e13 && e13.constructor; + i10 = r9 ? n10 ? new o8() : [] : Xs(e13) && Js(o8) ? Vi(Be4(e13)) : {}; + } + return (r9 ? St : bn)(e13, function(e14, n11, r10) { + return t11(i10, e14, n11, r10); + }), i10; + }, Ci.unary = function(e13) { + return Ps(e13, 1); + }, Ci.union = es, Ci.unionBy = ts, Ci.unionWith = is, Ci.uniq = function(e13) { + return e13 && e13.length ? ar(e13) : []; + }, Ci.uniqBy = function(e13, t11) { + return e13 && e13.length ? ar(e13, oo(t11, 2)) : []; + }, Ci.uniqWith = function(e13, t11) { + return t11 = "function" == typeof t11 ? t11 : r8, e13 && e13.length ? ar(e13, r8, t11) : []; + }, Ci.unset = function(e13, t11) { + return null == e13 || pr(e13, t11); + }, Ci.unzip = ns, Ci.unzipWith = rs, Ci.update = function(e13, t11, i10) { + return null == e13 ? e13 : cr(e13, t11, hr(i10)); + }, Ci.updateWith = function(e13, t11, i10, n10) { + return n10 = "function" == typeof n10 ? n10 : r8, null == e13 ? e13 : cr(e13, t11, hr(i10), n10); + }, Ci.values = Na, Ci.valuesIn = function(e13) { + return null == e13 ? [] : Jt(e13, Ea(e13)); + }, Ci.without = os, Ci.words = Ja, Ci.wrap = function(e13, t11) { + return Ds(hr(t11), e13); + }, Ci.xor = ss, Ci.xorBy = as, Ci.xorWith = ps, Ci.zip = cs, Ci.zipObject = function(e13, t11) { + return ur(e13 || [], t11 || [], Yi); + }, Ci.zipObjectDeep = function(e13, t11) { + return ur(e13 || [], t11 || [], Jn); + }, Ci.zipWith = ds, Ci.entries = Ca, Ci.entriesIn = Va, Ci.extend = va, Ci.extendWith = ja, sp(Ci, Ci), Ci.add = gp, Ci.attempt = Za, Ci.camelCase = Fa, Ci.capitalize = Ua, Ci.ceil = bp, Ci.clamp = function(e13, t11, i10) { + return i10 === r8 && (i10 = t11, t11 = r8), i10 !== r8 && (i10 = (i10 = ha(i10)) == i10 ? i10 : 0), t11 !== r8 && (t11 = (t11 = ha(t11)) == t11 ? t11 : 0), on4(ha(e13), t11, i10); + }, Ci.clone = function(e13) { + return sn(e13, 4); + }, Ci.cloneDeep = function(e13) { + return sn(e13, 5); + }, Ci.cloneDeepWith = function(e13, t11) { + return sn(e13, 5, t11 = "function" == typeof t11 ? t11 : r8); + }, Ci.cloneWith = function(e13, t11) { + return sn(e13, 4, t11 = "function" == typeof t11 ? t11 : r8); + }, Ci.conformsTo = function(e13, t11) { + return null == t11 || an(e13, t11, Ia(t11)); + }, Ci.deburr = La, Ci.defaultTo = function(e13, t11) { + return null == e13 || e13 != e13 ? t11 : e13; + }, Ci.divide = vp, Ci.endsWith = function(e13, t11, i10) { + e13 = ga(e13), t11 = sr(t11); + var n10 = e13.length, o8 = i10 = i10 === r8 ? n10 : on4(ua(i10), 0, n10); + return (i10 -= t11.length) >= 0 && e13.slice(i10, o8) == t11; + }, Ci.eq = Ns, Ci.escape = function(e13) { + return (e13 = ga(e13)) && G5.test(e13) ? e13.replace(K5, ti) : e13; + }, Ci.escapeRegExp = function(e13) { + return (e13 = ga(e13)) && ie3.test(e13) ? e13.replace(te4, "\\$&") : e13; + }, Ci.every = function(e13, t11, i10) { + var n10 = zs(e13) ? Ot : ln; + return i10 && go(e13, t11, i10) && (t11 = r8), n10(e13, oo(t11, 3)); + }, Ci.find = hs, Ci.findIndex = Lo, Ci.findKey = function(e13, t11) { + return Ct(e13, oo(t11, 3), bn); + }, Ci.findLast = ys, Ci.findLastIndex = zo, Ci.findLastKey = function(e13, t11) { + return Ct(e13, oo(t11, 3), vn); + }, Ci.floor = jp, Ci.forEach = gs, Ci.forEachRight = bs, Ci.forIn = function(e13, t11) { + return null == e13 ? e13 : yn(e13, oo(t11, 3), Ea); + }, Ci.forInRight = function(e13, t11) { + return null == e13 ? e13 : gn(e13, oo(t11, 3), Ea); + }, Ci.forOwn = function(e13, t11) { + return e13 && bn(e13, oo(t11, 3)); + }, Ci.forOwnRight = function(e13, t11) { + return e13 && vn(e13, oo(t11, 3)); + }, Ci.get = Sa, Ci.gt = Fs, Ci.gte = Us, Ci.has = function(e13, t11) { + return null != e13 && uo(e13, t11, Sn); + }, Ci.hasIn = Pa, Ci.head = Qo, Ci.identity = ip, Ci.includes = function(e13, t11, i10, n10) { + e13 = Qs(e13) ? e13 : Na(e13), i10 = i10 && !n10 ? ua(i10) : 0; + var r9 = e13.length; + return i10 < 0 && (i10 = hi(r9 + i10, 0)), sa(e13) ? i10 <= r9 && e13.indexOf(t11, i10) > -1 : !!r9 && Nt(e13, t11, i10) > -1; + }, Ci.indexOf = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + if (!n10) + return -1; + var r9 = null == i10 ? 0 : ua(i10); + return r9 < 0 && (r9 = hi(n10 + r9, 0)), Nt(e13, t11, r9); + }, Ci.inRange = function(e13, t11, i10) { + return t11 = la(t11), i10 === r8 ? (i10 = t11, t11 = 0) : i10 = la(i10), function(e14, t12, i11) { + return e14 >= yi(t12, i11) && e14 < hi(t12, i11); + }(e13 = ha(e13), t11, i10); + }, Ci.invoke = Aa, Ci.isArguments = Ls, Ci.isArray = zs, Ci.isArrayBuffer = Bs, Ci.isArrayLike = Qs, Ci.isArrayLikeObject = Ks, Ci.isBoolean = function(e13) { + return true === e13 || false === e13 || ea(e13) && _n(e13) == g7; + }, Ci.isBuffer = Hs, Ci.isDate = Gs, Ci.isElement = function(e13) { + return ea(e13) && 1 === e13.nodeType && !na(e13); + }, Ci.isEmpty = function(e13) { + if (null == e13) + return true; + if (Qs(e13) && (zs(e13) || "string" == typeof e13 || "function" == typeof e13.splice || Hs(e13) || pa(e13) || Ls(e13))) + return !e13.length; + var t11 = lo(e13); + if (t11 == x7 || t11 == O7) + return !e13.size; + if ($o(e13)) + return !Mn(e13).length; + for (var i10 in e13) + if (ke4.call(e13, i10)) + return false; + return true; + }, Ci.isEqual = function(e13, t11) { + return In(e13, t11); + }, Ci.isEqualWith = function(e13, t11, i10) { + var n10 = (i10 = "function" == typeof i10 ? i10 : r8) ? i10(e13, t11) : r8; + return n10 === r8 ? In(e13, t11, r8, i10) : !!n10; + }, Ci.isError = Ws, Ci.isFinite = function(e13) { + return "number" == typeof e13 && Dt2(e13); + }, Ci.isFunction = Js, Ci.isInteger = Zs, Ci.isLength = Ys, Ci.isMap = ta, Ci.isMatch = function(e13, t11) { + return e13 === t11 || En(e13, t11, ao(t11)); + }, Ci.isMatchWith = function(e13, t11, i10) { + return i10 = "function" == typeof i10 ? i10 : r8, En(e13, t11, ao(t11), i10); + }, Ci.isNaN = function(e13) { + return ia(e13) && e13 != +e13; + }, Ci.isNative = function(e13) { + if (jo(e13)) + throw new $e3("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); + return qn(e13); + }, Ci.isNil = function(e13) { + return null == e13; + }, Ci.isNull = function(e13) { + return null === e13; + }, Ci.isNumber = ia, Ci.isObject = Xs, Ci.isObjectLike = ea, Ci.isPlainObject = na, Ci.isRegExp = ra, Ci.isSafeInteger = function(e13) { + return Zs(e13) && e13 >= -9007199254740991 && e13 <= f8; + }, Ci.isSet = oa, Ci.isString = sa, Ci.isSymbol = aa, Ci.isTypedArray = pa, Ci.isUndefined = function(e13) { + return e13 === r8; + }, Ci.isWeakMap = function(e13) { + return ea(e13) && lo(e13) == I6; + }, Ci.isWeakSet = function(e13) { + return ea(e13) && "[object WeakSet]" == _n(e13); + }, Ci.join = function(e13, t11) { + return null == e13 ? "" : Bt2.call(e13, t11); + }, Ci.kebabCase = za, Ci.last = Wo, Ci.lastIndexOf = function(e13, t11, i10) { + var n10 = null == e13 ? 0 : e13.length; + if (!n10) + return -1; + var o8 = n10; + return i10 !== r8 && (o8 = (o8 = ua(i10)) < 0 ? hi(n10 + o8, 0) : yi(o8, n10 - 1)), t11 == t11 ? function(e14, t12, i11) { + for (var n11 = i11 + 1; n11--; ) + if (e14[n11] === t12) + return n11; + return n11; + }(e13, t11, o8) : Vt(e13, Ut, o8, true); + }, Ci.lowerCase = Ba, Ci.lowerFirst = Qa, Ci.lt = ca, Ci.lte = da, Ci.max = function(e13) { + return e13 && e13.length ? un(e13, ip, wn) : r8; + }, Ci.maxBy = function(e13, t11) { + return e13 && e13.length ? un(e13, oo(t11, 2), wn) : r8; + }, Ci.mean = function(e13) { + return Lt(e13, ip); + }, Ci.meanBy = function(e13, t11) { + return Lt(e13, oo(t11, 2)); + }, Ci.min = function(e13) { + return e13 && e13.length ? un(e13, ip, Rn) : r8; + }, Ci.minBy = function(e13, t11) { + return e13 && e13.length ? un(e13, oo(t11, 2), Rn) : r8; + }, Ci.stubArray = mp, Ci.stubFalse = hp, Ci.stubObject = function() { + return {}; + }, Ci.stubString = function() { + return ""; + }, Ci.stubTrue = function() { + return true; + }, Ci.multiply = $p, Ci.nth = function(e13, t11) { + return e13 && e13.length ? Fn(e13, ua(t11)) : r8; + }, Ci.noConflict = function() { + return ft._ === this && (ft._ = Ve2), this; + }, Ci.noop = ap, Ci.now = Ss, Ci.pad = function(e13, t11, i10) { + e13 = ga(e13); + var n10 = (t11 = ua(t11)) ? ci(e13) : 0; + if (!t11 || n10 >= t11) + return e13; + var r9 = (t11 - n10) / 2; + return Ur(ut2(r9), i10) + e13 + Ur(lt3(r9), i10); + }, Ci.padEnd = function(e13, t11, i10) { + e13 = ga(e13); + var n10 = (t11 = ua(t11)) ? ci(e13) : 0; + return t11 && n10 < t11 ? e13 + Ur(t11 - n10, i10) : e13; + }, Ci.padStart = function(e13, t11, i10) { + e13 = ga(e13); + var n10 = (t11 = ua(t11)) ? ci(e13) : 0; + return t11 && n10 < t11 ? Ur(t11 - n10, i10) + e13 : e13; + }, Ci.parseInt = function(e13, t11, i10) { + return i10 || null == t11 ? t11 = 0 : t11 && (t11 = +t11), bi(ga(e13).replace(ne4, ""), t11 || 0); + }, Ci.random = function(e13, t11, i10) { + if (i10 && "boolean" != typeof i10 && go(e13, t11, i10) && (t11 = i10 = r8), i10 === r8 && ("boolean" == typeof t11 ? (i10 = t11, t11 = r8) : "boolean" == typeof e13 && (i10 = e13, e13 = r8)), e13 === r8 && t11 === r8 ? (e13 = 0, t11 = 1) : (e13 = la(e13), t11 === r8 ? (t11 = e13, e13 = 0) : t11 = la(t11)), e13 > t11) { + var n10 = e13; + e13 = t11, t11 = n10; + } + if (i10 || e13 % 1 || t11 % 1) { + var o8 = vi(); + return yi(e13 + o8 * (t11 - e13 + at2("1e-" + ((o8 + "").length - 1))), t11); + } + return Qn(e13, t11); + }, Ci.reduce = function(e13, t11, i10) { + var n10 = zs(e13) ? kt : Qt, r9 = arguments.length < 3; + return n10(e13, oo(t11, 4), i10, r9, dn); + }, Ci.reduceRight = function(e13, t11, i10) { + var n10 = zs(e13) ? Mt : Qt, r9 = arguments.length < 3; + return n10(e13, oo(t11, 4), i10, r9, fn); + }, Ci.repeat = function(e13, t11, i10) { + return t11 = (i10 ? go(e13, t11, i10) : t11 === r8) ? 1 : ua(t11), Kn(ga(e13), t11); + }, Ci.replace = function() { + var e13 = arguments, t11 = ga(e13[0]); + return e13.length < 3 ? t11 : t11.replace(e13[1], e13[2]); + }, Ci.result = function(e13, t11, i10) { + var n10 = -1, o8 = (t11 = yr(t11, e13)).length; + for (o8 || (o8 = 1, e13 = r8); ++n10 < o8; ) { + var s8 = null == e13 ? r8 : e13[Do(t11[n10])]; + s8 === r8 && (n10 = o8, s8 = i10), e13 = Js(s8) ? s8.call(e13) : s8; + } + return e13; + }, Ci.round = xp, Ci.runInContext = e12, Ci.sample = function(e13) { + return (zs(e13) ? Gi : Gn)(e13); + }, Ci.size = function(e13) { + if (null == e13) + return 0; + if (Qs(e13)) + return sa(e13) ? ci(e13) : e13.length; + var t11 = lo(e13); + return t11 == x7 || t11 == O7 ? e13.size : Mn(e13).length; + }, Ci.snakeCase = Ka, Ci.some = function(e13, t11, i10) { + var n10 = zs(e13) ? Rt : tr; + return i10 && go(e13, t11, i10) && (t11 = r8), n10(e13, oo(t11, 3)); + }, Ci.sortedIndex = function(e13, t11) { + return ir(e13, t11); + }, Ci.sortedIndexBy = function(e13, t11, i10) { + return nr(e13, t11, oo(i10, 2)); + }, Ci.sortedIndexOf = function(e13, t11) { + var i10 = null == e13 ? 0 : e13.length; + if (i10) { + var n10 = ir(e13, t11); + if (n10 < i10 && Ns(e13[n10], t11)) + return n10; + } + return -1; + }, Ci.sortedLastIndex = function(e13, t11) { + return ir(e13, t11, true); + }, Ci.sortedLastIndexBy = function(e13, t11, i10) { + return nr(e13, t11, oo(i10, 2), true); + }, Ci.sortedLastIndexOf = function(e13, t11) { + if (null != e13 && e13.length) { + var i10 = ir(e13, t11, true) - 1; + if (Ns(e13[i10], t11)) + return i10; + } + return -1; + }, Ci.startCase = Ha, Ci.startsWith = function(e13, t11, i10) { + return e13 = ga(e13), i10 = null == i10 ? 0 : on4(ua(i10), 0, e13.length), t11 = sr(t11), e13.slice(i10, i10 + t11.length) == t11; + }, Ci.subtract = _p, Ci.sum = function(e13) { + return e13 && e13.length ? Kt(e13, ip) : 0; + }, Ci.sumBy = function(e13, t11) { + return e13 && e13.length ? Kt(e13, oo(t11, 2)) : 0; + }, Ci.template = function(e13, t11, i10) { + var n10 = Ci.templateSettings; + i10 && go(e13, t11, i10) && (t11 = r8), e13 = ga(e13), t11 = ja({}, t11, n10, Wr); + var o8, s8, a8 = ja({}, t11.imports, n10.imports, Wr), p8 = Ia(a8), c8 = Jt(a8, p8), d8 = 0, f9 = t11.interpolate || ve4, l8 = "__p += '", u8 = Se5((t11.escape || ve4).source + "|" + f9.source + "|" + (f9 === Z5 ? fe4 : ve4).source + "|" + (t11.evaluate || ve4).source + "|$", "g"), m8 = "//# sourceURL=" + (ke4.call(t11, "sourceURL") ? (t11.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++nt2 + "]") + "\n"; + e13.replace(u8, function(t12, i11, n11, r9, a9, p9) { + return n11 || (n11 = r9), l8 += e13.slice(d8, p9).replace(je4, ii), i11 && (o8 = true, l8 += "' +\n__e(" + i11 + ") +\n'"), a9 && (s8 = true, l8 += "';\n" + a9 + ";\n__p += '"), n11 && (l8 += "' +\n((__t = (" + n11 + ")) == null ? '' : __t) +\n'"), d8 = p9 + t12.length, t12; + }), l8 += "';\n"; + var h9 = ke4.call(t11, "variable") && t11.variable; + if (h9) { + if (ce4.test(h9)) + throw new $e3("Invalid `variable` option passed into `_.template`"); + } else + l8 = "with (obj) {\n" + l8 + "\n}\n"; + l8 = (s8 ? l8.replace(L6, "") : l8).replace(z6, "$1").replace(B6, "$1;"), l8 = "function(" + (h9 || "obj") + ") {\n" + (h9 ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (o8 ? ", __e = _.escape" : "") + (s8 ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + l8 + "return __p\n}"; + var y8 = Za(function() { + return xe3(p8, m8 + "return " + l8).apply(r8, c8); + }); + if (y8.source = l8, Ws(y8)) + throw y8; + return y8; + }, Ci.times = function(e13, t11) { + if ((e13 = ua(e13)) < 1 || e13 > f8) + return []; + var i10 = u7, n10 = yi(e13, u7); + t11 = oo(t11), e13 -= u7; + for (var r9 = Ht(n10, t11); ++i10 < e13; ) + t11(i10); + return r9; + }, Ci.toFinite = la, Ci.toInteger = ua, Ci.toLength = ma, Ci.toLower = function(e13) { + return ga(e13).toLowerCase(); + }, Ci.toNumber = ha, Ci.toSafeInteger = function(e13) { + return e13 ? on4(ua(e13), -9007199254740991, f8) : 0 === e13 ? e13 : 0; + }, Ci.toString = ga, Ci.toUpper = function(e13) { + return ga(e13).toUpperCase(); + }, Ci.trim = function(e13, t11, i10) { + if ((e13 = ga(e13)) && (i10 || t11 === r8)) + return Gt(e13); + if (!e13 || !(t11 = sr(t11))) + return e13; + var n10 = di(e13), o8 = di(t11); + return br(n10, Yt(n10, o8), Xt(n10, o8) + 1).join(""); + }, Ci.trimEnd = function(e13, t11, i10) { + if ((e13 = ga(e13)) && (i10 || t11 === r8)) + return e13.slice(0, fi(e13) + 1); + if (!e13 || !(t11 = sr(t11))) + return e13; + var n10 = di(e13); + return br(n10, 0, Xt(n10, di(t11)) + 1).join(""); + }, Ci.trimStart = function(e13, t11, i10) { + if ((e13 = ga(e13)) && (i10 || t11 === r8)) + return e13.replace(ne4, ""); + if (!e13 || !(t11 = sr(t11))) + return e13; + var n10 = di(e13); + return br(n10, Yt(n10, di(t11))).join(""); + }, Ci.truncate = function(e13, t11) { + var i10 = 30, n10 = "..."; + if (Xs(t11)) { + var o8 = "separator" in t11 ? t11.separator : o8; + i10 = "length" in t11 ? ua(t11.length) : i10, n10 = "omission" in t11 ? sr(t11.omission) : n10; + } + var s8 = (e13 = ga(e13)).length; + if (ni(e13)) { + var a8 = di(e13); + s8 = a8.length; + } + if (i10 >= s8) + return e13; + var p8 = i10 - ci(n10); + if (p8 < 1) + return n10; + var c8 = a8 ? br(a8, 0, p8).join("") : e13.slice(0, p8); + if (o8 === r8) + return c8 + n10; + if (a8 && (p8 += c8.length - p8), ra(o8)) { + if (e13.slice(p8).search(o8)) { + var d8, f9 = c8; + for (o8.global || (o8 = Se5(o8.source, ga(le4.exec(o8)) + "g")), o8.lastIndex = 0; d8 = o8.exec(f9); ) + var l8 = d8.index; + c8 = c8.slice(0, l8 === r8 ? p8 : l8); + } + } else if (e13.indexOf(sr(o8), p8) != p8) { + var u8 = c8.lastIndexOf(o8); + u8 > -1 && (c8 = c8.slice(0, u8)); + } + return c8 + n10; + }, Ci.unescape = function(e13) { + return (e13 = ga(e13)) && H5.test(e13) ? e13.replace(Q5, li) : e13; + }, Ci.uniqueId = function(e13) { + var t11 = ++Me3; + return ga(e13) + t11; + }, Ci.upperCase = Ga, Ci.upperFirst = Wa, Ci.each = gs, Ci.eachRight = bs, Ci.first = Qo, sp(Ci, (yp = {}, bn(Ci, function(e13, t11) { + ke4.call(Ci.prototype, t11) || (yp[t11] = e13); + }), yp), { chain: false }), Ci.VERSION = "4.17.21", St(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e13) { + Ci[e13].placeholder = Ci; + }), St(["drop", "take"], function(e13, t11) { + Ui.prototype[e13] = function(i10) { + i10 = i10 === r8 ? 1 : hi(ua(i10), 0); + var n10 = this.__filtered__ && !t11 ? new Ui(this) : this.clone(); + return n10.__filtered__ ? n10.__takeCount__ = yi(i10, n10.__takeCount__) : n10.__views__.push({ size: yi(i10, u7), type: e13 + (n10.__dir__ < 0 ? "Right" : "") }), n10; + }, Ui.prototype[e13 + "Right"] = function(t12) { + return this.reverse()[e13](t12).reverse(); + }; + }), St(["filter", "map", "takeWhile"], function(e13, t11) { + var i10 = t11 + 1, n10 = 1 == i10 || 3 == i10; + Ui.prototype[e13] = function(e14) { + var t12 = this.clone(); + return t12.__iteratees__.push({ iteratee: oo(e14, 3), type: i10 }), t12.__filtered__ = t12.__filtered__ || n10, t12; + }; + }), St(["head", "last"], function(e13, t11) { + var i10 = "take" + (t11 ? "Right" : ""); + Ui.prototype[e13] = function() { + return this[i10](1).value()[0]; + }; + }), St(["initial", "tail"], function(e13, t11) { + var i10 = "drop" + (t11 ? "" : "Right"); + Ui.prototype[e13] = function() { + return this.__filtered__ ? new Ui(this) : this[i10](1); + }; + }), Ui.prototype.compact = function() { + return this.filter(ip); + }, Ui.prototype.find = function(e13) { + return this.filter(e13).head(); + }, Ui.prototype.findLast = function(e13) { + return this.reverse().find(e13); + }, Ui.prototype.invokeMap = Hn(function(e13, t11) { + return "function" == typeof e13 ? new Ui(this) : this.map(function(i10) { + return Tn(i10, e13, t11); + }); + }), Ui.prototype.reject = function(e13) { + return this.filter(Ms(oo(e13))); + }, Ui.prototype.slice = function(e13, t11) { + e13 = ua(e13); + var i10 = this; + return i10.__filtered__ && (e13 > 0 || t11 < 0) ? new Ui(i10) : (e13 < 0 ? i10 = i10.takeRight(-e13) : e13 && (i10 = i10.drop(e13)), t11 !== r8 && (i10 = (t11 = ua(t11)) < 0 ? i10.dropRight(-t11) : i10.take(t11 - e13)), i10); + }, Ui.prototype.takeRightWhile = function(e13) { + return this.reverse().takeWhile(e13).reverse(); + }, Ui.prototype.toArray = function() { + return this.take(u7); + }, bn(Ui.prototype, function(e13, t11) { + var i10 = /^(?:filter|find|map|reject)|While$/.test(t11), n10 = /^(?:head|last)$/.test(t11), o8 = Ci[n10 ? "take" + ("last" == t11 ? "Right" : "") : t11], s8 = n10 || /^find/.test(t11); + o8 && (Ci.prototype[t11] = function() { + var t12 = this.__wrapped__, a8 = n10 ? [1] : arguments, p8 = t12 instanceof Ui, c8 = a8[0], d8 = p8 || zs(t12), f9 = function(e14) { + var t13 = o8.apply(Ci, qt([e14], a8)); + return n10 && l8 ? t13[0] : t13; + }; + d8 && i10 && "function" == typeof c8 && 1 != c8.length && (p8 = d8 = false); + var l8 = this.__chain__, u8 = !!this.__actions__.length, m8 = s8 && !l8, h9 = p8 && !u8; + if (!s8 && d8) { + t12 = h9 ? t12 : new Ui(this); + var y8 = e13.apply(t12, a8); + return y8.__actions__.push({ func: ls, args: [f9], thisArg: r8 }), new Fi(y8, l8); + } + return m8 && h9 ? e13.apply(this, a8) : (y8 = this.thru(f9), m8 ? n10 ? y8.value()[0] : y8.value() : y8); + }); + }), St(["pop", "push", "shift", "sort", "splice", "unshift"], function(e13) { + var t11 = Te2[e13], i10 = /^(?:push|sort|unshift)$/.test(e13) ? "tap" : "thru", n10 = /^(?:pop|shift)$/.test(e13); + Ci.prototype[e13] = function() { + var e14 = arguments; + if (n10 && !this.__chain__) { + var r9 = this.value(); + return t11.apply(zs(r9) ? r9 : [], e14); + } + return this[i10](function(i11) { + return t11.apply(zs(i11) ? i11 : [], e14); + }); + }; + }), bn(Ui.prototype, function(e13, t11) { + var i10 = Ci[t11]; + if (i10) { + var n10 = i10.name + ""; + ke4.call(Ti, n10) || (Ti[n10] = []), Ti[n10].push({ name: t11, func: i10 }); + } + }), Ti[Cr(r8, 2).name] = [{ name: "wrapper", func: r8 }], Ui.prototype.clone = function() { + var e13 = new Ui(this.__wrapped__); + return e13.__actions__ = Pr(this.__actions__), e13.__dir__ = this.__dir__, e13.__filtered__ = this.__filtered__, e13.__iteratees__ = Pr(this.__iteratees__), e13.__takeCount__ = this.__takeCount__, e13.__views__ = Pr(this.__views__), e13; + }, Ui.prototype.reverse = function() { + if (this.__filtered__) { + var e13 = new Ui(this); + e13.__dir__ = -1, e13.__filtered__ = true; + } else + (e13 = this.clone()).__dir__ *= -1; + return e13; + }, Ui.prototype.value = function() { + var e13 = this.__wrapped__.value(), t11 = this.__dir__, i10 = zs(e13), n10 = t11 < 0, r9 = i10 ? e13.length : 0, o8 = function(e14, t12, i11) { + for (var n11 = -1, r10 = i11.length; ++n11 < r10; ) { + var o9 = i11[n11], s9 = o9.size; + switch (o9.type) { + case "drop": + e14 += s9; + break; + case "dropRight": + t12 -= s9; + break; + case "take": + t12 = yi(t12, e14 + s9); + break; + case "takeRight": + e14 = hi(e14, t12 - s9); + } + } + return { start: e14, end: t12 }; + }(0, r9, this.__views__), s8 = o8.start, a8 = o8.end, p8 = a8 - s8, c8 = n10 ? a8 : s8 - 1, d8 = this.__iteratees__, f9 = d8.length, l8 = 0, u8 = yi(p8, this.__takeCount__); + if (!i10 || !n10 && r9 == p8 && u8 == p8) + return fr(e13, this.__actions__); + var m8 = []; + e: + for (; p8-- && l8 < u8; ) { + for (var h9 = -1, y8 = e13[c8 += t11]; ++h9 < f9; ) { + var g8 = d8[h9], b9 = g8.iteratee, v9 = g8.type, j7 = b9(y8); + if (2 == v9) + y8 = j7; + else if (!j7) { + if (1 == v9) + continue e; + break e; + } + } + m8[l8++] = y8; + } + return m8; + }, Ci.prototype.at = us, Ci.prototype.chain = function() { + return fs(this); + }, Ci.prototype.commit = function() { + return new Fi(this.value(), this.__chain__); + }, Ci.prototype.next = function() { + this.__values__ === r8 && (this.__values__ = fa(this.value())); + var e13 = this.__index__ >= this.__values__.length; + return { done: e13, value: e13 ? r8 : this.__values__[this.__index__++] }; + }, Ci.prototype.plant = function(e13) { + for (var t11, i10 = this; i10 instanceof Ni; ) { + var n10 = Vo(i10); + n10.__index__ = 0, n10.__values__ = r8, t11 ? o8.__wrapped__ = n10 : t11 = n10; + var o8 = n10; + i10 = i10.__wrapped__; + } + return o8.__wrapped__ = e13, t11; + }, Ci.prototype.reverse = function() { + var e13 = this.__wrapped__; + if (e13 instanceof Ui) { + var t11 = e13; + return this.__actions__.length && (t11 = new Ui(this)), (t11 = t11.reverse()).__actions__.push({ func: ls, args: [Xo], thisArg: r8 }), new Fi(t11, this.__chain__); + } + return this.thru(Xo); + }, Ci.prototype.toJSON = Ci.prototype.valueOf = Ci.prototype.value = function() { + return fr(this.__wrapped__, this.__actions__); + }, Ci.prototype.first = Ci.prototype.head, We2 && (Ci.prototype[We2] = function() { + return this; + }), Ci; + }(); + ft._ = ui, (n8 = function() { + return ui; + }.call(t9, i8, t9, e11)) === r8 || (e11.exports = n8); + }.call(this); + }, 69011: (e11, t9, i8) => { + var n8 = i8(68250); + function r8(e12, t10) { + if ("function" != typeof e12 || null != t10 && "function" != typeof t10) + throw new TypeError("Expected a function"); + var i9 = function() { + var n9 = arguments, r9 = t10 ? t10.apply(this, n9) : n9[0], o7 = i9.cache; + if (o7.has(r9)) + return o7.get(r9); + var s7 = e12.apply(this, n9); + return i9.cache = o7.set(r9, s7) || o7, s7; + }; + return i9.cache = new (r8.Cache || n8)(), i9; + } + r8.Cache = n8, e11.exports = r8; + }, 41263: (e11, t9, i8) => { + var n8 = i8(87655); + e11.exports = function(e12, t10, i9) { + return null == e12 ? e12 : n8(e12, t10, i9); + }; + }, 95243: (e11, t9, i8) => { + var n8 = i8(52291); + e11.exports = function(e12) { + return null == e12 ? "" : n8(e12); + }; + }, 79914: (e11, t9, i8) => { + e11.exports = l7, l7.Minimatch = u7; + var n8 = function() { + try { + return i8(15253); + } catch (e12) { + } + }() || { sep: "/" }; + l7.sep = n8.sep; + var r8 = l7.GLOBSTAR = u7.GLOBSTAR = {}, o7 = i8(473), s7 = { "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, "?": { open: "(?:", close: ")?" }, "+": { open: "(?:", close: ")+" }, "*": { open: "(?:", close: ")*" }, "@": { open: "(?:", close: ")" } }, a7 = "[^/]", p7 = a7 + "*?", c7 = "().*{}+?[]^$\\!".split("").reduce(function(e12, t10) { + return e12[t10] = true, e12; + }, {}), d7 = /\/+/; + function f8(e12, t10) { + t10 = t10 || {}; + var i9 = {}; + return Object.keys(e12).forEach(function(t11) { + i9[t11] = e12[t11]; + }), Object.keys(t10).forEach(function(e13) { + i9[e13] = t10[e13]; + }), i9; + } + function l7(e12, t10, i9) { + return h8(t10), i9 || (i9 = {}), !(!i9.nocomment && "#" === t10.charAt(0)) && new u7(t10, i9).match(e12); + } + function u7(e12, t10) { + if (!(this instanceof u7)) + return new u7(e12, t10); + h8(e12), t10 || (t10 = {}), e12 = e12.trim(), t10.allowWindowsEscape || "/" === n8.sep || (e12 = e12.split(n8.sep).join("/")), this.options = t10, this.set = [], this.pattern = e12, this.regexp = null, this.negate = false, this.comment = false, this.empty = false, this.partial = !!t10.partial, this.make(); + } + function m7(e12, t10) { + return t10 || (t10 = this instanceof u7 ? this.options : {}), e12 = void 0 === e12 ? this.pattern : e12, h8(e12), t10.nobrace || !/\{(?:(?!\{).)*\}/.test(e12) ? [e12] : o7(e12); + } + l7.filter = function(e12, t10) { + return t10 = t10 || {}, function(i9, n9, r9) { + return l7(i9, e12, t10); + }; + }, l7.defaults = function(e12) { + if (!e12 || "object" != typeof e12 || !Object.keys(e12).length) + return l7; + var t10 = l7, i9 = function(i10, n9, r9) { + return t10(i10, n9, f8(e12, r9)); + }; + return (i9.Minimatch = function(i10, n9) { + return new t10.Minimatch(i10, f8(e12, n9)); + }).defaults = function(i10) { + return t10.defaults(f8(e12, i10)).Minimatch; + }, i9.filter = function(i10, n9) { + return t10.filter(i10, f8(e12, n9)); + }, i9.defaults = function(i10) { + return t10.defaults(f8(e12, i10)); + }, i9.makeRe = function(i10, n9) { + return t10.makeRe(i10, f8(e12, n9)); + }, i9.braceExpand = function(i10, n9) { + return t10.braceExpand(i10, f8(e12, n9)); + }, i9.match = function(i10, n9, r9) { + return t10.match(i10, n9, f8(e12, r9)); + }, i9; + }, u7.defaults = function(e12) { + return l7.defaults(e12).Minimatch; + }, u7.prototype.debug = function() { + }, u7.prototype.make = function() { + var e12 = this.pattern, t10 = this.options; + if (t10.nocomment || "#" !== e12.charAt(0)) + if (e12) { + this.parseNegate(); + var i9 = this.globSet = this.braceExpand(); + t10.debug && (this.debug = function() { + console.error.apply(console, arguments); + }), this.debug(this.pattern, i9), i9 = this.globParts = i9.map(function(e13) { + return e13.split(d7); + }), this.debug(this.pattern, i9), i9 = i9.map(function(e13, t11, i10) { + return e13.map(this.parse, this); + }, this), this.debug(this.pattern, i9), i9 = i9.filter(function(e13) { + return -1 === e13.indexOf(false); + }), this.debug(this.pattern, i9), this.set = i9; + } else + this.empty = true; + else + this.comment = true; + }, u7.prototype.parseNegate = function() { + var e12 = this.pattern, t10 = false, i9 = 0; + if (!this.options.nonegate) { + for (var n9 = 0, r9 = e12.length; n9 < r9 && "!" === e12.charAt(n9); n9++) + t10 = !t10, i9++; + i9 && (this.pattern = e12.substr(i9)), this.negate = t10; + } + }, l7.braceExpand = function(e12, t10) { + return m7(e12, t10); + }, u7.prototype.braceExpand = m7; + var h8 = function(e12) { + if ("string" != typeof e12) + throw new TypeError("invalid pattern"); + if (e12.length > 65536) + throw new TypeError("pattern is too long"); + }; + u7.prototype.parse = function(e12, t10) { + h8(e12); + var i9 = this.options; + if ("**" === e12) { + if (!i9.noglobstar) + return r8; + e12 = "*"; + } + if ("" === e12) + return ""; + var n9, o8 = "", d8 = !!i9.nocase, f9 = false, l8 = [], u8 = [], m8 = false, g7 = -1, b8 = -1, v8 = "." === e12.charAt(0) ? "" : i9.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", j6 = this; + function $5() { + if (n9) { + switch (n9) { + case "*": + o8 += p7, d8 = true; + break; + case "?": + o8 += a7, d8 = true; + break; + default: + o8 += "\\" + n9; + } + j6.debug("clearStateChar %j %j", n9, o8), n9 = false; + } + } + for (var x7, _6 = 0, w6 = e12.length; _6 < w6 && (x7 = e12.charAt(_6)); _6++) + if (this.debug("%s %s %s %j", e12, _6, o8, x7), f9 && c7[x7]) + o8 += "\\" + x7, f9 = false; + else + switch (x7) { + case "/": + return false; + case "\\": + $5(), f9 = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + if (this.debug("%s %s %s %j <-- stateChar", e12, _6, o8, x7), m8) { + this.debug(" in class"), "!" === x7 && _6 === b8 + 1 && (x7 = "^"), o8 += x7; + continue; + } + j6.debug("call clearStateChar %j", n9), $5(), n9 = x7, i9.noext && $5(); + continue; + case "(": + if (m8) { + o8 += "("; + continue; + } + if (!n9) { + o8 += "\\("; + continue; + } + l8.push({ type: n9, start: _6 - 1, reStart: o8.length, open: s7[n9].open, close: s7[n9].close }), o8 += "!" === n9 ? "(?:(?!(?:" : "(?:", this.debug("plType %j %j", n9, o8), n9 = false; + continue; + case ")": + if (m8 || !l8.length) { + o8 += "\\)"; + continue; + } + $5(), d8 = true; + var S6 = l8.pop(); + o8 += S6.close, "!" === S6.type && u8.push(S6), S6.reEnd = o8.length; + continue; + case "|": + if (m8 || !l8.length || f9) { + o8 += "\\|", f9 = false; + continue; + } + $5(), o8 += "|"; + continue; + case "[": + if ($5(), m8) { + o8 += "\\" + x7; + continue; + } + m8 = true, b8 = _6, g7 = o8.length, o8 += x7; + continue; + case "]": + if (_6 === b8 + 1 || !m8) { + o8 += "\\" + x7, f9 = false; + continue; + } + var P6 = e12.substring(b8 + 1, _6); + try { + RegExp("[" + P6 + "]"); + } catch (e13) { + var O7 = this.parse(P6, y7); + o8 = o8.substr(0, g7) + "\\[" + O7[0] + "\\]", d8 = d8 || O7[1], m8 = false; + continue; + } + d8 = true, m8 = false, o8 += x7; + continue; + default: + $5(), f9 ? f9 = false : !c7[x7] || "^" === x7 && m8 || (o8 += "\\"), o8 += x7; + } + for (m8 && (P6 = e12.substr(b8 + 1), O7 = this.parse(P6, y7), o8 = o8.substr(0, g7) + "\\[" + O7[0], d8 = d8 || O7[1]), S6 = l8.pop(); S6; S6 = l8.pop()) { + var T6 = o8.slice(S6.reStart + S6.open.length); + this.debug("setting tail", o8, S6), T6 = T6.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(e13, t11, i10) { + return i10 || (i10 = "\\"), t11 + t11 + i10 + "|"; + }), this.debug("tail=%j\n %s", T6, T6, S6, o8); + var A6 = "*" === S6.type ? p7 : "?" === S6.type ? a7 : "\\" + S6.type; + d8 = true, o8 = o8.slice(0, S6.reStart) + A6 + "\\(" + T6; + } + $5(), f9 && (o8 += "\\\\"); + var I6 = false; + switch (o8.charAt(0)) { + case "[": + case ".": + case "(": + I6 = true; + } + for (var E6 = u8.length - 1; E6 > -1; E6--) { + var q5 = u8[E6], k6 = o8.slice(0, q5.reStart), M6 = o8.slice(q5.reStart, q5.reEnd - 8), R6 = o8.slice(q5.reEnd - 8, q5.reEnd), D6 = o8.slice(q5.reEnd); + R6 += D6; + var C6 = k6.split("(").length - 1, V5 = D6; + for (_6 = 0; _6 < C6; _6++) + V5 = V5.replace(/\)[+*?]?/, ""); + var N6 = ""; + "" === (D6 = V5) && t10 !== y7 && (N6 = "$"), o8 = k6 + M6 + D6 + N6 + R6; + } + if ("" !== o8 && d8 && (o8 = "(?=.)" + o8), I6 && (o8 = v8 + o8), t10 === y7) + return [o8, d8]; + if (!d8) + return e12.replace(/\\(.)/g, "$1"); + var F6 = i9.nocase ? "i" : ""; + try { + var U6 = new RegExp("^" + o8 + "$", F6); + } catch (e13) { + return new RegExp("$."); + } + return U6._glob = e12, U6._src = o8, U6; + }; + var y7 = {}; + l7.makeRe = function(e12, t10) { + return new u7(e12, t10 || {}).makeRe(); + }, u7.prototype.makeRe = function() { + if (this.regexp || false === this.regexp) + return this.regexp; + var e12 = this.set; + if (!e12.length) + return this.regexp = false, this.regexp; + var t10 = this.options, i9 = t10.noglobstar ? p7 : t10.dot ? "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?" : "(?:(?!(?:\\/|^)\\.).)*?", n9 = t10.nocase ? "i" : "", o8 = e12.map(function(e13) { + return e13.map(function(e14) { + return e14 === r8 ? i9 : "string" == typeof e14 ? e14.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : e14._src; + }).join("\\/"); + }).join("|"); + o8 = "^(?:" + o8 + ")$", this.negate && (o8 = "^(?!" + o8 + ").*$"); + try { + this.regexp = new RegExp(o8, n9); + } catch (e13) { + this.regexp = false; + } + return this.regexp; + }, l7.match = function(e12, t10, i9) { + var n9 = new u7(t10, i9 = i9 || {}); + return e12 = e12.filter(function(e13) { + return n9.match(e13); + }), n9.options.nonull && !e12.length && e12.push(t10), e12; + }, u7.prototype.match = function(e12, t10) { + if (void 0 === t10 && (t10 = this.partial), this.debug("match", e12, this.pattern), this.comment) + return false; + if (this.empty) + return "" === e12; + if ("/" === e12 && t10) + return true; + var i9 = this.options; + "/" !== n8.sep && (e12 = e12.split(n8.sep).join("/")), e12 = e12.split(d7), this.debug(this.pattern, "split", e12); + var r9, o8, s8 = this.set; + for (this.debug(this.pattern, "set", s8), o8 = e12.length - 1; o8 >= 0 && !(r9 = e12[o8]); o8--) + ; + for (o8 = 0; o8 < s8.length; o8++) { + var a8 = s8[o8], p8 = e12; + if (i9.matchBase && 1 === a8.length && (p8 = [r9]), this.matchOne(p8, a8, t10)) + return !!i9.flipNegate || !this.negate; + } + return !i9.flipNegate && this.negate; + }, u7.prototype.matchOne = function(e12, t10, i9) { + var n9 = this.options; + this.debug("matchOne", { this: this, file: e12, pattern: t10 }), this.debug("matchOne", e12.length, t10.length); + for (var o8 = 0, s8 = 0, a8 = e12.length, p8 = t10.length; o8 < a8 && s8 < p8; o8++, s8++) { + this.debug("matchOne loop"); + var c8, d8 = t10[s8], f9 = e12[o8]; + if (this.debug(t10, d8, f9), false === d8) + return false; + if (d8 === r8) { + this.debug("GLOBSTAR", [t10, d8, f9]); + var l8 = o8, u8 = s8 + 1; + if (u8 === p8) { + for (this.debug("** at the end"); o8 < a8; o8++) + if ("." === e12[o8] || ".." === e12[o8] || !n9.dot && "." === e12[o8].charAt(0)) + return false; + return true; + } + for (; l8 < a8; ) { + var m8 = e12[l8]; + if (this.debug("\nglobstar while", e12, l8, t10, u8, m8), this.matchOne(e12.slice(l8), t10.slice(u8), i9)) + return this.debug("globstar found match!", l8, a8, m8), true; + if ("." === m8 || ".." === m8 || !n9.dot && "." === m8.charAt(0)) { + this.debug("dot detected!", e12, l8, t10, u8); + break; + } + this.debug("globstar swallow a segment, and continue"), l8++; + } + return !(!i9 || (this.debug("\n>>> no match, partial?", e12, l8, t10, u8), l8 !== a8)); + } + if ("string" == typeof d8 ? (c8 = f9 === d8, this.debug("string match", d8, f9, c8)) : (c8 = f9.match(d8), this.debug("pattern match", d8, f9, c8)), !c8) + return false; + } + if (o8 === a8 && s8 === p8) + return true; + if (o8 === a8) + return i9; + if (s8 === p8) + return o8 === a8 - 1 && "" === e12[o8]; + throw new Error("wtf?"); + }; + }, 98203: (e11, t9) => { + "use strict"; + var i8 = function() { + if ("undefined" != typeof self) + return self; + if ("undefined" != typeof window) + return window; + if (void 0 !== i8) + return i8; + throw new Error("unable to locate global object"); + }(); + e11.exports = t9 = i8.fetch, i8.fetch && (t9.default = i8.fetch.bind(i8)), t9.Headers = i8.Headers, t9.Request = i8.Request, t9.Response = i8.Response; + }, 48660: (e11, t9, i8) => { + var n8 = "function" == typeof Map && Map.prototype, r8 = Object.getOwnPropertyDescriptor && n8 ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, o7 = n8 && r8 && "function" == typeof r8.get ? r8.get : null, s7 = n8 && Map.prototype.forEach, a7 = "function" == typeof Set && Set.prototype, p7 = Object.getOwnPropertyDescriptor && a7 ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, c7 = a7 && p7 && "function" == typeof p7.get ? p7.get : null, d7 = a7 && Set.prototype.forEach, f8 = "function" == typeof WeakMap && WeakMap.prototype ? WeakMap.prototype.has : null, l7 = "function" == typeof WeakSet && WeakSet.prototype ? WeakSet.prototype.has : null, u7 = "function" == typeof WeakRef && WeakRef.prototype ? WeakRef.prototype.deref : null, m7 = Boolean.prototype.valueOf, h8 = Object.prototype.toString, y7 = Function.prototype.toString, g7 = String.prototype.match, b8 = String.prototype.slice, v8 = String.prototype.replace, j6 = String.prototype.toUpperCase, $5 = String.prototype.toLowerCase, x7 = RegExp.prototype.test, _6 = Array.prototype.concat, w6 = Array.prototype.join, S6 = Array.prototype.slice, P6 = Math.floor, O7 = "function" == typeof BigInt ? BigInt.prototype.valueOf : null, T6 = Object.getOwnPropertySymbols, A6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol.prototype.toString : null, I6 = "function" == typeof Symbol && "object" == typeof Symbol.iterator, E6 = "function" == typeof Symbol && Symbol.toStringTag && (Symbol.toStringTag, 1) ? Symbol.toStringTag : null, q5 = Object.prototype.propertyIsEnumerable, k6 = ("function" == typeof Reflect ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e12) { + return e12.__proto__; + } : null); + function M6(e12, t10) { + if (e12 === 1 / 0 || e12 === -1 / 0 || e12 != e12 || e12 && e12 > -1e3 && e12 < 1e3 || x7.call(/e/, t10)) + return t10; + var i9 = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if ("number" == typeof e12) { + var n9 = e12 < 0 ? -P6(-e12) : P6(e12); + if (n9 !== e12) { + var r9 = String(n9), o8 = b8.call(t10, r9.length + 1); + return v8.call(r9, i9, "$&_") + "." + v8.call(v8.call(o8, /([0-9]{3})/g, "$&_"), /_$/, ""); + } + } + return v8.call(t10, i9, "$&_"); + } + var R6 = i8(86973), D6 = R6.custom, C6 = L6(D6) ? D6 : null; + function V5(e12, t10, i9) { + var n9 = "double" === (i9.quoteStyle || t10) ? '"' : "'"; + return n9 + e12 + n9; + } + function N6(e12) { + return v8.call(String(e12), /"/g, """); + } + function F6(e12) { + return !("[object Array]" !== Q5(e12) || E6 && "object" == typeof e12 && E6 in e12); + } + function U6(e12) { + return !("[object RegExp]" !== Q5(e12) || E6 && "object" == typeof e12 && E6 in e12); + } + function L6(e12) { + if (I6) + return e12 && "object" == typeof e12 && e12 instanceof Symbol; + if ("symbol" == typeof e12) + return true; + if (!e12 || "object" != typeof e12 || !A6) + return false; + try { + return A6.call(e12), true; + } catch (e13) { + } + return false; + } + e11.exports = function e12(t10, n9, r9, a8) { + var p8 = n9 || {}; + if (B6(p8, "quoteStyle") && "single" !== p8.quoteStyle && "double" !== p8.quoteStyle) + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + if (B6(p8, "maxStringLength") && ("number" == typeof p8.maxStringLength ? p8.maxStringLength < 0 && p8.maxStringLength !== 1 / 0 : null !== p8.maxStringLength)) + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + var h9 = !B6(p8, "customInspect") || p8.customInspect; + if ("boolean" != typeof h9 && "symbol" !== h9) + throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); + if (B6(p8, "indent") && null !== p8.indent && " " !== p8.indent && !(parseInt(p8.indent, 10) === p8.indent && p8.indent > 0)) + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + if (B6(p8, "numericSeparator") && "boolean" != typeof p8.numericSeparator) + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + var j7 = p8.numericSeparator; + if (void 0 === t10) + return "undefined"; + if (null === t10) + return "null"; + if ("boolean" == typeof t10) + return t10 ? "true" : "false"; + if ("string" == typeof t10) + return H5(t10, p8); + if ("number" == typeof t10) { + if (0 === t10) + return 1 / 0 / t10 > 0 ? "0" : "-0"; + var x8 = String(t10); + return j7 ? M6(t10, x8) : x8; + } + if ("bigint" == typeof t10) { + var P7 = String(t10) + "n"; + return j7 ? M6(t10, P7) : P7; + } + var T7 = void 0 === p8.depth ? 5 : p8.depth; + if (void 0 === r9 && (r9 = 0), r9 >= T7 && T7 > 0 && "object" == typeof t10) + return F6(t10) ? "[Array]" : "[Object]"; + var D7, z7 = function(e13, t11) { + var i9; + if (" " === e13.indent) + i9 = " "; + else { + if (!("number" == typeof e13.indent && e13.indent > 0)) + return null; + i9 = w6.call(Array(e13.indent + 1), " "); + } + return { base: i9, prev: w6.call(Array(t11 + 1), i9) }; + }(p8, r9); + if (void 0 === a8) + a8 = []; + else if (K5(a8, t10) >= 0) + return "[Circular]"; + function G6(t11, i9, n10) { + if (i9 && (a8 = S6.call(a8)).push(i9), n10) { + var o8 = { depth: p8.depth }; + return B6(p8, "quoteStyle") && (o8.quoteStyle = p8.quoteStyle), e12(t11, o8, r9 + 1, a8); + } + return e12(t11, p8, r9 + 1, a8); + } + if ("function" == typeof t10 && !U6(t10)) { + var ee4 = function(e13) { + if (e13.name) + return e13.name; + var t11 = g7.call(y7.call(e13), /^function\s*([\w$]+)/); + return t11 ? t11[1] : null; + }(t10), te4 = X5(t10, G6); + return "[Function" + (ee4 ? ": " + ee4 : " (anonymous)") + "]" + (te4.length > 0 ? " { " + w6.call(te4, ", ") + " }" : ""); + } + if (L6(t10)) { + var ie3 = I6 ? v8.call(String(t10), /^(Symbol\(.*\))_[^)]*$/, "$1") : A6.call(t10); + return "object" != typeof t10 || I6 ? ie3 : W5(ie3); + } + if ((D7 = t10) && "object" == typeof D7 && ("undefined" != typeof HTMLElement && D7 instanceof HTMLElement || "string" == typeof D7.nodeName && "function" == typeof D7.getAttribute)) { + for (var ne4 = "<" + $5.call(String(t10.nodeName)), re4 = t10.attributes || [], oe4 = 0; oe4 < re4.length; oe4++) + ne4 += " " + re4[oe4].name + "=" + V5(N6(re4[oe4].value), "double", p8); + return ne4 += ">", t10.childNodes && t10.childNodes.length && (ne4 += "..."), ne4 + ""; + } + if (F6(t10)) { + if (0 === t10.length) + return "[]"; + var se4 = X5(t10, G6); + return z7 && !function(e13) { + for (var t11 = 0; t11 < e13.length; t11++) + if (K5(e13[t11], "\n") >= 0) + return false; + return true; + }(se4) ? "[" + Y6(se4, z7) + "]" : "[ " + w6.call(se4, ", ") + " ]"; + } + if (function(e13) { + return !("[object Error]" !== Q5(e13) || E6 && "object" == typeof e13 && E6 in e13); + }(t10)) { + var ae4 = X5(t10, G6); + return "cause" in Error.prototype || !("cause" in t10) || q5.call(t10, "cause") ? 0 === ae4.length ? "[" + String(t10) + "]" : "{ [" + String(t10) + "] " + w6.call(ae4, ", ") + " }" : "{ [" + String(t10) + "] " + w6.call(_6.call("[cause]: " + G6(t10.cause), ae4), ", ") + " }"; + } + if ("object" == typeof t10 && h9) { + if (C6 && "function" == typeof t10[C6] && R6) + return R6(t10, { depth: T7 - r9 }); + if ("symbol" !== h9 && "function" == typeof t10.inspect) + return t10.inspect(); + } + if (function(e13) { + if (!o7 || !e13 || "object" != typeof e13) + return false; + try { + o7.call(e13); + try { + c7.call(e13); + } catch (e14) { + return true; + } + return e13 instanceof Map; + } catch (e14) { + } + return false; + }(t10)) { + var pe4 = []; + return s7 && s7.call(t10, function(e13, i9) { + pe4.push(G6(i9, t10, true) + " => " + G6(e13, t10)); + }), Z5("Map", o7.call(t10), pe4, z7); + } + if (function(e13) { + if (!c7 || !e13 || "object" != typeof e13) + return false; + try { + c7.call(e13); + try { + o7.call(e13); + } catch (e14) { + return true; + } + return e13 instanceof Set; + } catch (e14) { + } + return false; + }(t10)) { + var ce4 = []; + return d7 && d7.call(t10, function(e13) { + ce4.push(G6(e13, t10)); + }), Z5("Set", c7.call(t10), ce4, z7); + } + if (function(e13) { + if (!f8 || !e13 || "object" != typeof e13) + return false; + try { + f8.call(e13, f8); + try { + l7.call(e13, l7); + } catch (e14) { + return true; + } + return e13 instanceof WeakMap; + } catch (e14) { + } + return false; + }(t10)) + return J5("WeakMap"); + if (function(e13) { + if (!l7 || !e13 || "object" != typeof e13) + return false; + try { + l7.call(e13, l7); + try { + f8.call(e13, f8); + } catch (e14) { + return true; + } + return e13 instanceof WeakSet; + } catch (e14) { + } + return false; + }(t10)) + return J5("WeakSet"); + if (function(e13) { + if (!u7 || !e13 || "object" != typeof e13) + return false; + try { + return u7.call(e13), true; + } catch (e14) { + } + return false; + }(t10)) + return J5("WeakRef"); + if (function(e13) { + return !("[object Number]" !== Q5(e13) || E6 && "object" == typeof e13 && E6 in e13); + }(t10)) + return W5(G6(Number(t10))); + if (function(e13) { + if (!e13 || "object" != typeof e13 || !O7) + return false; + try { + return O7.call(e13), true; + } catch (e14) { + } + return false; + }(t10)) + return W5(G6(O7.call(t10))); + if (function(e13) { + return !("[object Boolean]" !== Q5(e13) || E6 && "object" == typeof e13 && E6 in e13); + }(t10)) + return W5(m7.call(t10)); + if (function(e13) { + return !("[object String]" !== Q5(e13) || E6 && "object" == typeof e13 && E6 in e13); + }(t10)) + return W5(G6(String(t10))); + if ("undefined" != typeof window && t10 === window) + return "{ [object Window] }"; + if ("undefined" != typeof globalThis && t10 === globalThis || void 0 !== i8.g && t10 === i8.g) + return "{ [object globalThis] }"; + if (!function(e13) { + return !("[object Date]" !== Q5(e13) || E6 && "object" == typeof e13 && E6 in e13); + }(t10) && !U6(t10)) { + var de4 = X5(t10, G6), fe4 = k6 ? k6(t10) === Object.prototype : t10 instanceof Object || t10.constructor === Object, le4 = t10 instanceof Object ? "" : "null prototype", ue4 = !fe4 && E6 && Object(t10) === t10 && E6 in t10 ? b8.call(Q5(t10), 8, -1) : le4 ? "Object" : "", me4 = (fe4 || "function" != typeof t10.constructor ? "" : t10.constructor.name ? t10.constructor.name + " " : "") + (ue4 || le4 ? "[" + w6.call(_6.call([], ue4 || [], le4 || []), ": ") + "] " : ""); + return 0 === de4.length ? me4 + "{}" : z7 ? me4 + "{" + Y6(de4, z7) + "}" : me4 + "{ " + w6.call(de4, ", ") + " }"; + } + return String(t10); + }; + var z6 = Object.prototype.hasOwnProperty || function(e12) { + return e12 in this; + }; + function B6(e12, t10) { + return z6.call(e12, t10); + } + function Q5(e12) { + return h8.call(e12); + } + function K5(e12, t10) { + if (e12.indexOf) + return e12.indexOf(t10); + for (var i9 = 0, n9 = e12.length; i9 < n9; i9++) + if (e12[i9] === t10) + return i9; + return -1; + } + function H5(e12, t10) { + if (e12.length > t10.maxStringLength) { + var i9 = e12.length - t10.maxStringLength, n9 = "... " + i9 + " more character" + (i9 > 1 ? "s" : ""); + return H5(b8.call(e12, 0, t10.maxStringLength), t10) + n9; + } + return V5(v8.call(v8.call(e12, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, G5), "single", t10); + } + function G5(e12) { + var t10 = e12.charCodeAt(0), i9 = { 8: "b", 9: "t", 10: "n", 12: "f", 13: "r" }[t10]; + return i9 ? "\\" + i9 : "\\x" + (t10 < 16 ? "0" : "") + j6.call(t10.toString(16)); + } + function W5(e12) { + return "Object(" + e12 + ")"; + } + function J5(e12) { + return e12 + " { ? }"; + } + function Z5(e12, t10, i9, n9) { + return e12 + " (" + t10 + ") {" + (n9 ? Y6(i9, n9) : w6.call(i9, ", ")) + "}"; + } + function Y6(e12, t10) { + if (0 === e12.length) + return ""; + var i9 = "\n" + t10.prev + t10.base; + return i9 + w6.call(e12, "," + i9) + "\n" + t10.prev; + } + function X5(e12, t10) { + var i9 = F6(e12), n9 = []; + if (i9) { + n9.length = e12.length; + for (var r9 = 0; r9 < e12.length; r9++) + n9[r9] = B6(e12, r9) ? t10(e12[r9], e12) : ""; + } + var o8, s8 = "function" == typeof T6 ? T6(e12) : []; + if (I6) { + o8 = {}; + for (var a8 = 0; a8 < s8.length; a8++) + o8["$" + s8[a8]] = s8[a8]; + } + for (var p8 in e12) + B6(e12, p8) && (i9 && String(Number(p8)) === p8 && p8 < e12.length || I6 && o8["$" + p8] instanceof Symbol || (x7.call(/[^\w$]/, p8) ? n9.push(t10(p8, e12) + ": " + t10(e12[p8], e12)) : n9.push(p8 + ": " + t10(e12[p8], e12)))); + if ("function" == typeof T6) + for (var c8 = 0; c8 < s8.length; c8++) + q5.call(e12, s8[c8]) && n9.push("[" + t10(s8[c8]) + "]: " + t10(e12[s8[c8]], e12)); + return n9; + } + }, 78160: (e11, t9, i8) => { + "use strict"; + var n8; + if (!Object.keys) { + var r8 = Object.prototype.hasOwnProperty, o7 = Object.prototype.toString, s7 = i8(50968), a7 = Object.prototype.propertyIsEnumerable, p7 = !a7.call({ toString: null }, "toString"), c7 = a7.call(function() { + }, "prototype"), d7 = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], f8 = function(e12) { + var t10 = e12.constructor; + return t10 && t10.prototype === e12; + }, l7 = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }, u7 = function() { + if ("undefined" == typeof window) + return false; + for (var e12 in window) + try { + if (!l7["$" + e12] && r8.call(window, e12) && null !== window[e12] && "object" == typeof window[e12]) + try { + f8(window[e12]); + } catch (e13) { + return true; + } + } catch (e13) { + return true; + } + return false; + }(); + n8 = function(e12) { + var t10 = null !== e12 && "object" == typeof e12, i9 = "[object Function]" === o7.call(e12), n9 = s7(e12), a8 = t10 && "[object String]" === o7.call(e12), l8 = []; + if (!t10 && !i9 && !n9) + throw new TypeError("Object.keys called on a non-object"); + var m7 = c7 && i9; + if (a8 && e12.length > 0 && !r8.call(e12, 0)) + for (var h8 = 0; h8 < e12.length; ++h8) + l8.push(String(h8)); + if (n9 && e12.length > 0) + for (var y7 = 0; y7 < e12.length; ++y7) + l8.push(String(y7)); + else + for (var g7 in e12) + m7 && "prototype" === g7 || !r8.call(e12, g7) || l8.push(String(g7)); + if (p7) + for (var b8 = function(e13) { + if ("undefined" == typeof window || !u7) + return f8(e13); + try { + return f8(e13); + } catch (e14) { + return false; + } + }(e12), v8 = 0; v8 < d7.length; ++v8) + b8 && "constructor" === d7[v8] || !r8.call(e12, d7[v8]) || l8.push(d7[v8]); + return l8; + }; + } + e11.exports = n8; + }, 49228: (e11, t9, i8) => { + "use strict"; + var n8 = Array.prototype.slice, r8 = i8(50968), o7 = Object.keys, s7 = o7 ? function(e12) { + return o7(e12); + } : i8(78160), a7 = Object.keys; + s7.shim = function() { + if (Object.keys) { + var e12 = function() { + var e13 = Object.keys(arguments); + return e13 && e13.length === arguments.length; + }(1, 2); + e12 || (Object.keys = function(e13) { + return r8(e13) ? a7(n8.call(e13)) : a7(e13); + }); + } else + Object.keys = s7; + return Object.keys || s7; + }, e11.exports = s7; + }, 50968: (e11) => { + "use strict"; + var t9 = Object.prototype.toString; + e11.exports = function(e12) { + var i8 = t9.call(e12), n8 = "[object Arguments]" === i8; + return n8 || (n8 = "[object Array]" !== i8 && null !== e12 && "object" == typeof e12 && "number" == typeof e12.length && e12.length >= 0 && "[object Function]" === t9.call(e12.callee)), n8; + }; + }, 59756: (e11) => { + "use strict"; + class t9 extends Error { + constructor(e12, { cause: i9 } = {}) { + super(e12), this.name = t9.name, i9 && (this.cause = i9), this.message = e12; + } + } + const i8 = (e12) => { + if (!e12) + return; + const t10 = e12.cause; + if ("function" == typeof t10) { + const t11 = e12.cause(); + return t11 instanceof Error ? t11 : void 0; + } + return t10 instanceof Error ? t10 : void 0; + }, n8 = (e12, t10) => { + if (!(e12 instanceof Error)) + return ""; + const r9 = e12.stack || ""; + if (t10.has(e12)) + return r9 + "\ncauses have become circular..."; + const o7 = i8(e12); + return o7 ? (t10.add(e12), r9 + "\ncaused by: " + n8(o7, t10)) : r9; + }, r8 = (e12, t10, n9) => { + if (!(e12 instanceof Error)) + return ""; + const o7 = n9 ? "" : e12.message || ""; + if (t10.has(e12)) + return o7 + ": ..."; + const s7 = i8(e12); + if (s7) { + t10.add(e12); + const i9 = "function" == typeof e12.cause; + return o7 + (i9 ? "" : ": ") + r8(s7, t10, i9); + } + return o7; + }; + e11.exports = { ErrorWithCause: t9, findCauseByReference: (e12, t10) => { + if (!e12 || !t10) + return; + if (!(e12 instanceof Error)) + return; + if (!(t10.prototype instanceof Error) && t10 !== Error) + return; + const n9 = /* @__PURE__ */ new Set(); + let r9 = e12; + for (; r9 && !n9.has(r9); ) { + if (n9.add(r9), r9 instanceof t10) + return r9; + r9 = i8(r9); + } + }, getErrorCause: i8, stackWithCauses: (e12) => n8(e12, /* @__PURE__ */ new Set()), messageWithCauses: (e12) => r8(e12, /* @__PURE__ */ new Set()) }; + }, 11145: (e11, t9, i8) => { + "use strict"; + const n8 = i8(70998); + e11.exports = n8, n8.default = n8; + }, 70998: (e11) => { + "use strict"; + e11.exports = function(e12, i9, n9) { + var r9, o8 = ""; + if (t9 = "", arguments.length > 1) { + if ("number" == typeof n9) + for (r9 = 0; r9 < n9; r9 += 1) + o8 += " "; + else + "string" == typeof n9 && (o8 = n9); + if ("" !== o8) { + if (null != i9) { + if ("function" == typeof i9) + return a7("", { "": e12 }, [], i9, o8); + if (Array.isArray(i9)) + return p7("", e12, [], i9, o8); + } + return c7("", e12, [], o8); + } + if ("function" == typeof i9) + return f8("", { "": e12 }, [], i9); + if (Array.isArray(i9)) + return d7("", e12, [], i9); + } + return l7("", e12, []); + }; + var t9 = ""; + const i8 = /[\x00-\x1f\x22\x5c]/, n8 = /[\x00-\x1f\x22\x5c]/g, r8 = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\u000b", "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f", "", "", '\\"', "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\\\\"]; + function o7(e12) { + return r8[e12.charCodeAt(0)]; + } + function s7(e12) { + if (e12.length < 5e3 && !i8.test(e12)) + return e12; + if (e12.length > 100) + return e12.replace(n8, o7); + for (var t10 = "", s8 = 0, a8 = 0; a8 < e12.length; a8++) { + const i9 = e12.charCodeAt(a8); + (34 === i9 || 92 === i9 || i9 < 32) && (t10 += s8 === a8 ? r8[i9] : `${e12.slice(s8, a8)}${r8[i9]}`, s8 = a8 + 1); + } + return 0 === s8 ? t10 = e12 : s8 !== a8 && (t10 += e12.slice(s8)), t10; + } + function a7(e12, i9, n9, r9, o8) { + var p8, c8, d8; + const f9 = t9; + var l8 = i9[e12]; + switch ("object" == typeof l8 && null !== l8 && "function" == typeof l8.toJSON && (l8 = l8.toJSON(e12)), typeof (l8 = r9.call(i9, e12, l8))) { + case "object": + if (null === l8) + return "null"; + for (p8 = 0; p8 < n9.length; p8++) + if (n9[p8] === l8) + return '"[Circular]"'; + if (Array.isArray(l8)) { + if (0 === l8.length) + return "[]"; + for (n9.push(l8), c8 = "[", c8 += ` +${t9 += o8}`, d8 = `, +${t9}`, p8 = 0; p8 < l8.length - 1; p8++) { + const e14 = a7(p8, l8, n9, r9, o8); + c8 += void 0 !== e14 ? e14 : "null", c8 += d8; + } + const e13 = a7(p8, l8, n9, r9, o8); + return c8 += void 0 !== e13 ? e13 : "null", "" !== t9 && (c8 += ` +${f9}`), c8 += "]", n9.pop(), t9 = f9, c8; + } + var m7 = u7(Object.keys(l8)); + if (0 === m7.length) + return "{}"; + n9.push(l8), c8 = "{", c8 += ` +${t9 += o8}`, d8 = `, +${t9}`; + var h8 = ""; + for (p8 = 0; p8 < m7.length; p8++) { + const t10 = a7(e12 = m7[p8], l8, n9, r9, o8); + void 0 !== t10 && (c8 += `${h8}"${s7(e12)}": ${t10}`, h8 = d8); + } + return "" !== h8 ? c8 += ` +${f9}` : c8 = "{", c8 += "}", n9.pop(), t9 = f9, c8; + case "string": + return `"${s7(l8)}"`; + case "number": + return isFinite(l8) ? String(l8) : "null"; + case "boolean": + return true === l8 ? "true" : "false"; + } + } + function p7(e12, i9, n9, r9, o8) { + var a8, c8, d8; + const f9 = t9; + switch ("object" == typeof i9 && null !== i9 && "function" == typeof i9.toJSON && (i9 = i9.toJSON(e12)), typeof i9) { + case "object": + if (null === i9) + return "null"; + for (a8 = 0; a8 < n9.length; a8++) + if (n9[a8] === i9) + return '"[Circular]"'; + if (Array.isArray(i9)) { + if (0 === i9.length) + return "[]"; + for (n9.push(i9), c8 = "[", c8 += ` +${t9 += o8}`, d8 = `, +${t9}`, a8 = 0; a8 < i9.length - 1; a8++) { + const e14 = p7(a8, i9[a8], n9, r9, o8); + c8 += void 0 !== e14 ? e14 : "null", c8 += d8; + } + const e13 = p7(a8, i9[a8], n9, r9, o8); + return c8 += void 0 !== e13 ? e13 : "null", "" !== t9 && (c8 += ` +${f9}`), c8 += "]", n9.pop(), t9 = f9, c8; + } + if (0 === r9.length) + return "{}"; + n9.push(i9), c8 = "{", c8 += ` +${t9 += o8}`, d8 = `, +${t9}`; + var l8 = ""; + for (a8 = 0; a8 < r9.length; a8++) + if ("string" == typeof r9[a8] || "number" == typeof r9[a8]) { + const t10 = p7(e12 = r9[a8], i9[e12], n9, r9, o8); + void 0 !== t10 && (c8 += `${l8}"${s7(e12)}": ${t10}`, l8 = d8); + } + return "" !== l8 ? c8 += ` +${f9}` : c8 = "{", c8 += "}", n9.pop(), t9 = f9, c8; + case "string": + return `"${s7(i9)}"`; + case "number": + return isFinite(i9) ? String(i9) : "null"; + case "boolean": + return true === i9 ? "true" : "false"; + } + } + function c7(e12, i9, n9, r9) { + var o8, a8, p8; + const d8 = t9; + switch (typeof i9) { + case "object": + if (null === i9) + return "null"; + if ("function" == typeof i9.toJSON) { + if ("object" != typeof (i9 = i9.toJSON(e12))) + return c7(e12, i9, n9, r9); + if (null === i9) + return "null"; + } + for (o8 = 0; o8 < n9.length; o8++) + if (n9[o8] === i9) + return '"[Circular]"'; + if (Array.isArray(i9)) { + if (0 === i9.length) + return "[]"; + for (n9.push(i9), a8 = "[", a8 += ` +${t9 += r9}`, p8 = `, +${t9}`, o8 = 0; o8 < i9.length - 1; o8++) { + const e14 = c7(o8, i9[o8], n9, r9); + a8 += void 0 !== e14 ? e14 : "null", a8 += p8; + } + const e13 = c7(o8, i9[o8], n9, r9); + return a8 += void 0 !== e13 ? e13 : "null", "" !== t9 && (a8 += ` +${d8}`), a8 += "]", n9.pop(), t9 = d8, a8; + } + var f9 = u7(Object.keys(i9)); + if (0 === f9.length) + return "{}"; + n9.push(i9), a8 = "{", a8 += ` +${t9 += r9}`, p8 = `, +${t9}`; + var l8 = ""; + for (o8 = 0; o8 < f9.length; o8++) { + const t10 = c7(e12 = f9[o8], i9[e12], n9, r9); + void 0 !== t10 && (a8 += `${l8}"${s7(e12)}": ${t10}`, l8 = p8); + } + return "" !== l8 ? a8 += ` +${d8}` : a8 = "{", a8 += "}", n9.pop(), t9 = d8, a8; + case "string": + return `"${s7(i9)}"`; + case "number": + return isFinite(i9) ? String(i9) : "null"; + case "boolean": + return true === i9 ? "true" : "false"; + } + } + function d7(e12, t10, i9, n9) { + var r9, o8; + switch ("object" == typeof t10 && null !== t10 && "function" == typeof t10.toJSON && (t10 = t10.toJSON(e12)), typeof t10) { + case "object": + if (null === t10) + return "null"; + for (r9 = 0; r9 < i9.length; r9++) + if (i9[r9] === t10) + return '"[Circular]"'; + if (Array.isArray(t10)) { + if (0 === t10.length) + return "[]"; + for (i9.push(t10), o8 = "[", r9 = 0; r9 < t10.length - 1; r9++) { + const e14 = d7(r9, t10[r9], i9, n9); + o8 += void 0 !== e14 ? e14 : "null", o8 += ","; + } + const e13 = d7(r9, t10[r9], i9, n9); + return o8 += void 0 !== e13 ? e13 : "null", o8 += "]", i9.pop(), o8; + } + if (0 === n9.length) + return "{}"; + i9.push(t10), o8 = "{"; + var a8 = ""; + for (r9 = 0; r9 < n9.length; r9++) + if ("string" == typeof n9[r9] || "number" == typeof n9[r9]) { + const p8 = d7(e12 = n9[r9], t10[e12], i9, n9); + void 0 !== p8 && (o8 += `${a8}"${s7(e12)}":${p8}`, a8 = ","); + } + return o8 += "}", i9.pop(), o8; + case "string": + return `"${s7(t10)}"`; + case "number": + return isFinite(t10) ? String(t10) : "null"; + case "boolean": + return true === t10 ? "true" : "false"; + } + } + function f8(e12, t10, i9, n9) { + var r9, o8, a8 = t10[e12]; + switch ("object" == typeof a8 && null !== a8 && "function" == typeof a8.toJSON && (a8 = a8.toJSON(e12)), typeof (a8 = n9.call(t10, e12, a8))) { + case "object": + if (null === a8) + return "null"; + for (r9 = 0; r9 < i9.length; r9++) + if (i9[r9] === a8) + return '"[Circular]"'; + if (Array.isArray(a8)) { + if (0 === a8.length) + return "[]"; + for (i9.push(a8), o8 = "[", r9 = 0; r9 < a8.length - 1; r9++) { + const e14 = f8(r9, a8, i9, n9); + o8 += void 0 !== e14 ? e14 : "null", o8 += ","; + } + const e13 = f8(r9, a8, i9, n9); + return o8 += void 0 !== e13 ? e13 : "null", o8 += "]", i9.pop(), o8; + } + var p8 = u7(Object.keys(a8)); + if (0 === p8.length) + return "{}"; + i9.push(a8), o8 = "{"; + var c8 = ""; + for (r9 = 0; r9 < p8.length; r9++) { + const t11 = f8(e12 = p8[r9], a8, i9, n9); + void 0 !== t11 && (o8 += `${c8}"${s7(e12)}":${t11}`, c8 = ","); + } + return o8 += "}", i9.pop(), o8; + case "string": + return `"${s7(a8)}"`; + case "number": + return isFinite(a8) ? String(a8) : "null"; + case "boolean": + return true === a8 ? "true" : "false"; + } + } + function l7(e12, t10, i9) { + var n9, r9; + switch (typeof t10) { + case "object": + if (null === t10) + return "null"; + if ("function" == typeof t10.toJSON) { + if ("object" != typeof (t10 = t10.toJSON(e12))) + return l7(e12, t10, i9); + if (null === t10) + return "null"; + } + for (n9 = 0; n9 < i9.length; n9++) + if (i9[n9] === t10) + return '"[Circular]"'; + if (Array.isArray(t10)) { + if (0 === t10.length) + return "[]"; + for (i9.push(t10), r9 = "[", n9 = 0; n9 < t10.length - 1; n9++) { + const e14 = l7(n9, t10[n9], i9); + r9 += void 0 !== e14 ? e14 : "null", r9 += ","; + } + const e13 = l7(n9, t10[n9], i9); + return r9 += void 0 !== e13 ? e13 : "null", r9 += "]", i9.pop(), r9; + } + var o8 = u7(Object.keys(t10)); + if (0 === o8.length) + return "{}"; + i9.push(t10); + var a8 = ""; + for (r9 = "{", n9 = 0; n9 < o8.length; n9++) { + const p8 = l7(e12 = o8[n9], t10[e12], i9); + void 0 !== p8 && (r9 += `${a8}"${s7(e12)}":${p8}`, a8 = ","); + } + return r9 += "}", i9.pop(), r9; + case "string": + return `"${s7(t10)}"`; + case "number": + return isFinite(t10) ? String(t10) : "null"; + case "boolean": + return true === t10 ? "true" : "false"; + } + } + function u7(e12) { + for (var t10 = 1; t10 < e12.length; t10++) { + const n9 = e12[t10]; + for (var i9 = t10; 0 !== i9 && e12[i9 - 1] > n9; ) + e12[i9] = e12[i9 - 1], i9--; + e12[i9] = n9; + } + return e12; + } + }, 26108: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(70686), o7 = i8(17239)(), s7 = i8(69336), a7 = i8(3468), p7 = n8("%Math.floor%"); + e11.exports = function(e12, t10) { + if ("function" != typeof e12) + throw new a7("`fn` is not a function"); + if ("number" != typeof t10 || t10 < 0 || t10 > 4294967295 || p7(t10) !== t10) + throw new a7("`length` must be a positive 32-bit integer"); + var i9 = arguments.length > 2 && !!arguments[2], n9 = true, c7 = true; + if ("length" in e12 && s7) { + var d7 = s7(e12, "length"); + d7 && !d7.configurable && (n9 = false), d7 && !d7.writable && (c7 = false); + } + return (n9 || c7 || !i9) && (o7 ? r8(e12, "length", t10, true, true) : r8(e12, "length", t10)), e12; + }; + }, 19343: (e11, t9, i8) => { + "use strict"; + var n8 = i8(70686), r8 = i8(17239)(), o7 = i8(68993).functionsHaveConfigurableNames(), s7 = i8(3468); + e11.exports = function(e12, t10) { + if ("function" != typeof e12) + throw new s7("`fn` is not a function"); + return arguments.length > 2 && !!arguments[2] && !o7 || (r8 ? n8(e12, "name", t10, true, true) : n8(e12, "name", t10)), e12; + }; + }, 77575: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(79818), o7 = i8(48660), s7 = i8(3468), a7 = n8("%WeakMap%", true), p7 = n8("%Map%", true), c7 = r8("WeakMap.prototype.get", true), d7 = r8("WeakMap.prototype.set", true), f8 = r8("WeakMap.prototype.has", true), l7 = r8("Map.prototype.get", true), u7 = r8("Map.prototype.set", true), m7 = r8("Map.prototype.has", true), h8 = function(e12, t10) { + for (var i9, n9 = e12; null !== (i9 = n9.next); n9 = i9) + if (i9.key === t10) + return n9.next = i9.next, i9.next = e12.next, e12.next = i9, i9; + }; + e11.exports = function() { + var e12, t10, i9, n9 = { assert: function(e13) { + if (!n9.has(e13)) + throw new s7("Side channel does not contain " + o7(e13)); + }, get: function(n10) { + if (a7 && n10 && ("object" == typeof n10 || "function" == typeof n10)) { + if (e12) + return c7(e12, n10); + } else if (p7) { + if (t10) + return l7(t10, n10); + } else if (i9) + return function(e13, t11) { + var i10 = h8(e13, t11); + return i10 && i10.value; + }(i9, n10); + }, has: function(n10) { + if (a7 && n10 && ("object" == typeof n10 || "function" == typeof n10)) { + if (e12) + return f8(e12, n10); + } else if (p7) { + if (t10) + return m7(t10, n10); + } else if (i9) + return function(e13, t11) { + return !!h8(e13, t11); + }(i9, n10); + return false; + }, set: function(n10, r9) { + a7 && n10 && ("object" == typeof n10 || "function" == typeof n10) ? (e12 || (e12 = new a7()), d7(e12, n10, r9)) : p7 ? (t10 || (t10 = new p7()), u7(t10, n10, r9)) : (i9 || (i9 = { key: {}, next: null }), function(e13, t11, i10) { + var n11 = h8(e13, t11); + n11 ? n11.value = i10 : e13.next = { key: t11, next: e13.next, value: i10 }; + }(i9, n10, r9)); + } }; + return n9; + }; + }, 55478: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __assign: () => o7, __asyncDelegator: () => j6, __asyncGenerator: () => v8, __asyncValues: () => $5, __await: () => b8, __awaiter: () => d7, __classPrivateFieldGet: () => S6, __classPrivateFieldSet: () => P6, __createBinding: () => l7, __decorate: () => a7, __exportStar: () => u7, __extends: () => r8, __generator: () => f8, __importDefault: () => w6, __importStar: () => _6, __makeTemplateObject: () => x7, __metadata: () => c7, __param: () => p7, __read: () => h8, __rest: () => s7, __spread: () => y7, __spreadArrays: () => g7, __values: () => m7 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + t11.hasOwnProperty(i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function d7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function f8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(o9) { + return function(a9) { + return function(o10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & o10[0] ? n9.return : o10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, o10[1])).done) + return r9; + switch (n9 = 0, r9 && (o10 = [2 & o10[0], r9.value]), o10[0]) { + case 0: + case 1: + r9 = o10; + break; + case 4: + return s8.label++, { value: o10[1], done: false }; + case 5: + s8.label++, n9 = o10[1], o10 = [0]; + continue; + case 7: + o10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== o10[0] && 2 !== o10[0])) { + s8 = 0; + continue; + } + if (3 === o10[0] && (!r9 || o10[1] > r9[0] && o10[1] < r9[3])) { + s8.label = o10[1]; + break; + } + if (6 === o10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = o10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(o10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + o10 = t10.call(e12, s8); + } catch (e13) { + o10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & o10[0]) + throw o10[1]; + return { value: o10[0] ? o10[1] : void 0, done: true }; + }([o9, a9]); + }; + } + } + function l7(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + } + function u7(e12, t10) { + for (var i9 in e12) + "default" === i9 || t10.hasOwnProperty(i9) || (t10[i9] = e12[i9]); + } + function m7(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function h8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function y7() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(h8(arguments[t10])); + return e12; + } + function g7() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function b8(e12) { + return this instanceof b8 ? (this.v = e12, this) : new b8(e12); + } + function v8(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return"), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13) { + r9[e13] && (n9[e13] = function(t11) { + return new Promise(function(i10, n10) { + o8.push([e13, t11, i10, n10]) > 1 || a8(e13, t11); + }); + }); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof b8 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function j6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: b8(e12[n10](t11)), done: "return" === n10 } : r9 ? r9(t11) : t11; + } : r9; + } + } + function $5(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = m7(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function x7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + function _6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + Object.hasOwnProperty.call(e12, i9) && (t10[i9] = e12[i9]); + return t10.default = e12, t10; + } + function w6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function S6(e12, t10) { + if (!t10.has(e12)) + throw new TypeError("attempted to get private field on non-instance"); + return t10.get(e12); + } + function P6(e12, t10, i9) { + if (!t10.has(e12)) + throw new TypeError("attempted to set private field on non-instance"); + return t10.set(e12, i9), i9; + } + }, 69825: function(e11, t9, i8) { + var n8, r8; + !function(o7, s7) { + "use strict"; + e11.exports ? e11.exports = s7() : void 0 === (r8 = "function" == typeof (n8 = s7) ? n8.call(t9, i8, t9, e11) : n8) || (e11.exports = r8); + }(0, function(e12) { + "use strict"; + var t10 = e12 && e12.IPv6; + return { best: function(e13) { + var t11, i9, n9 = e13.toLowerCase().split(":"), r9 = n9.length, o7 = 8; + for ("" === n9[0] && "" === n9[1] && "" === n9[2] ? (n9.shift(), n9.shift()) : "" === n9[0] && "" === n9[1] ? n9.shift() : "" === n9[r9 - 1] && "" === n9[r9 - 2] && n9.pop(), -1 !== n9[(r9 = n9.length) - 1].indexOf(".") && (o7 = 7), t11 = 0; t11 < r9 && "" !== n9[t11]; t11++) + ; + if (t11 < o7) + for (n9.splice(t11, 1, "0000"); n9.length < o7; ) + n9.splice(t11, 0, "0000"); + for (var s7 = 0; s7 < o7; s7++) { + i9 = n9[s7].split(""); + for (var a7 = 0; a7 < 3 && "0" === i9[0] && i9.length > 1; a7++) + i9.splice(0, 1); + n9[s7] = i9.join(""); + } + var p7 = -1, c7 = 0, d7 = 0, f8 = -1, l7 = false; + for (s7 = 0; s7 < o7; s7++) + l7 ? "0" === n9[s7] ? d7 += 1 : (l7 = false, d7 > c7 && (p7 = f8, c7 = d7)) : "0" === n9[s7] && (l7 = true, f8 = s7, d7 = 1); + d7 > c7 && (p7 = f8, c7 = d7), c7 > 1 && n9.splice(p7, c7, ""), r9 = n9.length; + var u7 = ""; + for ("" === n9[0] && (u7 = ":"), s7 = 0; s7 < r9 && (u7 += n9[s7], s7 !== r9 - 1); s7++) + u7 += ":"; + return "" === n9[r9 - 1] && (u7 += ":"), u7; + }, noConflict: function() { + return e12.IPv6 === this && (e12.IPv6 = t10), this; + } }; + }); + }, 71811: function(e11, t9, i8) { + var n8, r8; + !function(o7, s7) { + "use strict"; + e11.exports ? e11.exports = s7() : void 0 === (r8 = "function" == typeof (n8 = s7) ? n8.call(t9, i8, t9, e11) : n8) || (e11.exports = r8); + }(0, function(e12) { + "use strict"; + var t10 = e12 && e12.SecondLevelDomains, i9 = { list: { ac: " com gov mil net org ", ae: " ac co gov mil name net org pro sch ", af: " com edu gov net org ", al: " com edu gov mil net org ", ao: " co ed gv it og pb ", ar: " com edu gob gov int mil net org tur ", at: " ac co gv or ", au: " asn com csiro edu gov id net org ", ba: " co com edu gov mil net org rs unbi unmo unsa untz unze ", bb: " biz co com edu gov info net org store tv ", bh: " biz cc com edu gov info net org ", bn: " com edu gov net org ", bo: " com edu gob gov int mil net org tv ", br: " adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ", bs: " com edu gov net org ", bz: " du et om ov rg ", ca: " ab bc mb nb nf nl ns nt nu on pe qc sk yk ", ck: " biz co edu gen gov info net org ", cn: " ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ", co: " com edu gov mil net nom org ", cr: " ac c co ed fi go or sa ", cy: " ac biz com ekloges gov ltd name net org parliament press pro tm ", do: " art com edu gob gov mil net org sld web ", dz: " art asso com edu gov net org pol ", ec: " com edu fin gov info med mil net org pro ", eg: " com edu eun gov mil name net org sci ", er: " com edu gov ind mil net org rochest w ", es: " com edu gob nom org ", et: " biz com edu gov info name net org ", fj: " ac biz com info mil name net org pro ", fk: " ac co gov net nom org ", fr: " asso com f gouv nom prd presse tm ", gg: " co net org ", gh: " com edu gov mil org ", gn: " ac com gov net org ", gr: " com edu gov mil net org ", gt: " com edu gob ind mil net org ", gu: " com edu gov net org ", hk: " com edu gov idv net org ", hu: " 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ", id: " ac co go mil net or sch web ", il: " ac co gov idf k12 muni net org ", in: " ac co edu ernet firm gen gov i ind mil net nic org res ", iq: " com edu gov i mil net org ", ir: " ac co dnssec gov i id net org sch ", it: " edu gov ", je: " co net org ", jo: " com edu gov mil name net org sch ", jp: " ac ad co ed go gr lg ne or ", ke: " ac co go info me mobi ne or sc ", kh: " com edu gov mil net org per ", ki: " biz com de edu gov info mob net org tel ", km: " asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ", kn: " edu gov net org ", kr: " ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ", kw: " com edu gov net org ", ky: " com edu gov net org ", kz: " com edu gov mil net org ", lb: " com edu gov net org ", lk: " assn com edu gov grp hotel int ltd net ngo org sch soc web ", lr: " com edu gov net org ", lv: " asn com conf edu gov id mil net org ", ly: " com edu gov id med net org plc sch ", ma: " ac co gov m net org press ", mc: " asso tm ", me: " ac co edu gov its net org priv ", mg: " com edu gov mil nom org prd tm ", mk: " com edu gov inf name net org pro ", ml: " com edu gov net org presse ", mn: " edu gov org ", mo: " com edu gov net org ", mt: " com edu gov net org ", mv: " aero biz com coop edu gov info int mil museum name net org pro ", mw: " ac co com coop edu gov int museum net org ", mx: " com edu gob net org ", my: " com edu gov mil name net org sch ", nf: " arts com firm info net other per rec store web ", ng: " biz com edu gov mil mobi name net org sch ", ni: " ac co com edu gob mil net nom org ", np: " com edu gov mil net org ", nr: " biz com edu gov info net org ", om: " ac biz co com edu gov med mil museum net org pro sch ", pe: " com edu gob mil net nom org sld ", ph: " com edu gov i mil net ngo org ", pk: " biz com edu fam gob gok gon gop gos gov net org web ", pl: " art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ", pr: " ac biz com edu est gov info isla name net org pro prof ", ps: " com edu gov net org plo sec ", pw: " belau co ed go ne or ", ro: " arts com firm info nom nt org rec store tm www ", rs: " ac co edu gov in org ", sb: " com edu gov net org ", sc: " com edu gov net org ", sh: " co com edu gov net nom org ", sl: " com edu gov net org ", st: " co com consulado edu embaixada gov mil net org principe saotome store ", sv: " com edu gob org red ", sz: " ac co org ", tr: " av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ", tt: " aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ", tw: " club com ebiz edu game gov idv mil net org ", mu: " ac co com gov net or org ", mz: " ac co edu gov org ", na: " co com ", nz: " ac co cri geek gen govt health iwi maori mil net org parliament school ", pa: " abo ac com edu gob ing med net nom org sld ", pt: " com edu gov int net nome org publ ", py: " com edu gov mil net org ", qa: " com edu gov mil net org ", re: " asso com nom ", ru: " ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ", rw: " ac co com edu gouv gov int mil net ", sa: " com edu gov med net org pub sch ", sd: " com edu gov info med net org tv ", se: " a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ", sg: " com edu gov idn net org per ", sn: " art com edu gouv org perso univ ", sy: " com edu gov mil net news org ", th: " ac co go in mi net or ", tj: " ac biz co com edu go gov info int mil name net nic org test web ", tn: " agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ", tz: " ac co go ne or ", ua: " biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ", ug: " ac co go ne or org sc ", uk: " ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ", us: " dni fed isa kids nsn ", uy: " com edu gub mil net org ", ve: " co com edu gob info mil net org web ", vi: " co com k12 net org ", vn: " ac biz com edu gov health info int name net org pro ", ye: " co com gov ltd me net org plc ", yu: " ac co edu gov org ", za: " ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ", zm: " ac co com edu gov net org sch ", com: "ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ", net: "gb jp se uk ", org: "ae", de: "com " }, has: function(e13) { + var t11 = e13.lastIndexOf("."); + if (t11 <= 0 || t11 >= e13.length - 1) + return false; + var n9 = e13.lastIndexOf(".", t11 - 1); + if (n9 <= 0 || n9 >= t11 - 1) + return false; + var r9 = i9.list[e13.slice(t11 + 1)]; + return !!r9 && r9.indexOf(" " + e13.slice(n9 + 1, t11) + " ") >= 0; + }, is: function(e13) { + var t11 = e13.lastIndexOf("."); + if (t11 <= 0 || t11 >= e13.length - 1) + return false; + if (e13.lastIndexOf(".", t11 - 1) >= 0) + return false; + var n9 = i9.list[e13.slice(t11 + 1)]; + return !!n9 && n9.indexOf(" " + e13.slice(0, t11) + " ") >= 0; + }, get: function(e13) { + var t11 = e13.lastIndexOf("."); + if (t11 <= 0 || t11 >= e13.length - 1) + return null; + var n9 = e13.lastIndexOf(".", t11 - 1); + if (n9 <= 0 || n9 >= t11 - 1) + return null; + var r9 = i9.list[e13.slice(t11 + 1)]; + return r9 ? r9.indexOf(" " + e13.slice(n9 + 1, t11) + " ") < 0 ? null : e13.slice(n9 + 1) : null; + }, noConflict: function() { + return e12.SecondLevelDomains === this && (e12.SecondLevelDomains = t10), this; + } }; + return i9; + }); + }, 99472: function(e11, t9, i8) { + var n8, r8, o7; + !function(s7, a7) { + "use strict"; + e11.exports ? e11.exports = a7(i8(62675), i8(69825), i8(71811)) : (r8 = [i8(62675), i8(69825), i8(71811)], void 0 === (o7 = "function" == typeof (n8 = a7) ? n8.apply(t9, r8) : n8) || (e11.exports = o7)); + }(0, function(e12, t10, i9, n9) { + "use strict"; + var r9 = n9 && n9.URI; + function o8(e13, t11) { + var i10 = arguments.length >= 1; + if (!(this instanceof o8)) + return i10 ? arguments.length >= 2 ? new o8(e13, t11) : new o8(e13) : new o8(); + if (void 0 === e13) { + if (i10) + throw new TypeError("undefined is not a valid argument for URI"); + e13 = "undefined" != typeof location ? location.href + "" : ""; + } + if (null === e13 && i10) + throw new TypeError("null is not a valid argument for URI"); + return this.href(e13), void 0 !== t11 ? this.absoluteTo(t11) : this; + } + o8.version = "1.19.11"; + var s7 = o8.prototype, a7 = Object.prototype.hasOwnProperty; + function p7(e13) { + return e13.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1"); + } + function c7(e13) { + return void 0 === e13 ? "Undefined" : String(Object.prototype.toString.call(e13)).slice(8, -1); + } + function d7(e13) { + return "Array" === c7(e13); + } + function f8(e13, t11) { + var i10, n10, r10 = {}; + if ("RegExp" === c7(t11)) + r10 = null; + else if (d7(t11)) + for (i10 = 0, n10 = t11.length; i10 < n10; i10++) + r10[t11[i10]] = true; + else + r10[t11] = true; + for (i10 = 0, n10 = e13.length; i10 < n10; i10++) + (r10 && void 0 !== r10[e13[i10]] || !r10 && t11.test(e13[i10])) && (e13.splice(i10, 1), n10--, i10--); + return e13; + } + function l7(e13, t11) { + var i10, n10; + if (d7(t11)) { + for (i10 = 0, n10 = t11.length; i10 < n10; i10++) + if (!l7(e13, t11[i10])) + return false; + return true; + } + var r10 = c7(t11); + for (i10 = 0, n10 = e13.length; i10 < n10; i10++) + if ("RegExp" === r10) { + if ("string" == typeof e13[i10] && e13[i10].match(t11)) + return true; + } else if (e13[i10] === t11) + return true; + return false; + } + function u7(e13, t11) { + if (!d7(e13) || !d7(t11)) + return false; + if (e13.length !== t11.length) + return false; + e13.sort(), t11.sort(); + for (var i10 = 0, n10 = e13.length; i10 < n10; i10++) + if (e13[i10] !== t11[i10]) + return false; + return true; + } + function m7(e13) { + return e13.replace(/^\/+|\/+$/g, ""); + } + function h8(e13) { + return escape(e13); + } + function y7(e13) { + return encodeURIComponent(e13).replace(/[!'()*]/g, h8).replace(/\*/g, "%2A"); + } + o8._parts = function() { + return { protocol: null, username: null, password: null, hostname: null, urn: null, port: null, path: null, query: null, fragment: null, preventInvalidHostname: o8.preventInvalidHostname, duplicateQueryParameters: o8.duplicateQueryParameters, escapeQuerySpace: o8.escapeQuerySpace }; + }, o8.preventInvalidHostname = false, o8.duplicateQueryParameters = false, o8.escapeQuerySpace = true, o8.protocol_expression = /^[a-z][a-z0-9.+-]*$/i, o8.idn_expression = /[^a-z0-9\._-]/i, o8.punycode_expression = /(xn--)/i, o8.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, o8.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, o8.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi, o8.findUri = { start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi, end: /[\s\r\n]|$/, trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/, parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g }, o8.leading_whitespace_expression = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, o8.ascii_tab_whitespace = /[\u0009\u000A\u000D]+/g, o8.defaultPorts = { http: "80", https: "443", ftp: "21", gopher: "70", ws: "80", wss: "443" }, o8.hostProtocols = ["http", "https"], o8.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/, o8.domAttributes = { a: "href", blockquote: "cite", link: "href", base: "href", script: "src", form: "action", img: "src", area: "href", iframe: "src", embed: "src", source: "src", track: "src", input: "src", audio: "src", video: "src" }, o8.getDomAttribute = function(e13) { + if (e13 && e13.nodeName) { + var t11 = e13.nodeName.toLowerCase(); + if ("input" !== t11 || "image" === e13.type) + return o8.domAttributes[t11]; + } + }, o8.encode = y7, o8.decode = decodeURIComponent, o8.iso8859 = function() { + o8.encode = escape, o8.decode = unescape; + }, o8.unicode = function() { + o8.encode = y7, o8.decode = decodeURIComponent; + }, o8.characters = { pathname: { encode: { expression: /%(24|26|2B|2C|3B|3D|3A|40)/gi, map: { "%24": "$", "%26": "&", "%2B": "+", "%2C": ",", "%3B": ";", "%3D": "=", "%3A": ":", "%40": "@" } }, decode: { expression: /[\/\?#]/g, map: { "/": "%2F", "?": "%3F", "#": "%23" } } }, reserved: { encode: { expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi, map: { "%3A": ":", "%2F": "/", "%3F": "?", "%23": "#", "%5B": "[", "%5D": "]", "%40": "@", "%21": "!", "%24": "$", "%26": "&", "%27": "'", "%28": "(", "%29": ")", "%2A": "*", "%2B": "+", "%2C": ",", "%3B": ";", "%3D": "=" } } }, urnpath: { encode: { expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi, map: { "%21": "!", "%24": "$", "%27": "'", "%28": "(", "%29": ")", "%2A": "*", "%2B": "+", "%2C": ",", "%3B": ";", "%3D": "=", "%40": "@" } }, decode: { expression: /[\/\?#:]/g, map: { "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" } } } }, o8.encodeQuery = function(e13, t11) { + var i10 = o8.encode(e13 + ""); + return void 0 === t11 && (t11 = o8.escapeQuerySpace), t11 ? i10.replace(/%20/g, "+") : i10; + }, o8.decodeQuery = function(e13, t11) { + e13 += "", void 0 === t11 && (t11 = o8.escapeQuerySpace); + try { + return o8.decode(t11 ? e13.replace(/\+/g, "%20") : e13); + } catch (t12) { + return e13; + } + }; + var g7, b8 = { encode: "encode", decode: "decode" }, v8 = function(e13, t11) { + return function(i10) { + try { + return o8[t11](i10 + "").replace(o8.characters[e13][t11].expression, function(i11) { + return o8.characters[e13][t11].map[i11]; + }); + } catch (e14) { + return i10; + } + }; + }; + for (g7 in b8) + o8[g7 + "PathSegment"] = v8("pathname", b8[g7]), o8[g7 + "UrnPathSegment"] = v8("urnpath", b8[g7]); + var j6 = function(e13, t11, i10) { + return function(n10) { + var r10; + r10 = i10 ? function(e14) { + return o8[t11](o8[i10](e14)); + } : o8[t11]; + for (var s8 = (n10 + "").split(e13), a8 = 0, p8 = s8.length; a8 < p8; a8++) + s8[a8] = r10(s8[a8]); + return s8.join(e13); + }; + }; + function $5(e13) { + return function(t11, i10) { + return void 0 === t11 ? this._parts[e13] || "" : (this._parts[e13] = t11 || null, this.build(!i10), this); + }; + } + function x7(e13, t11) { + return function(i10, n10) { + return void 0 === i10 ? this._parts[e13] || "" : (null !== i10 && (i10 += "").charAt(0) === t11 && (i10 = i10.substring(1)), this._parts[e13] = i10, this.build(!n10), this); + }; + } + o8.decodePath = j6("/", "decodePathSegment"), o8.decodeUrnPath = j6(":", "decodeUrnPathSegment"), o8.recodePath = j6("/", "encodePathSegment", "decode"), o8.recodeUrnPath = j6(":", "encodeUrnPathSegment", "decode"), o8.encodeReserved = v8("reserved", "encode"), o8.parse = function(e13, t11) { + var i10; + return t11 || (t11 = { preventInvalidHostname: o8.preventInvalidHostname }), (i10 = (e13 = (e13 = e13.replace(o8.leading_whitespace_expression, "")).replace(o8.ascii_tab_whitespace, "")).indexOf("#")) > -1 && (t11.fragment = e13.substring(i10 + 1) || null, e13 = e13.substring(0, i10)), (i10 = e13.indexOf("?")) > -1 && (t11.query = e13.substring(i10 + 1) || null, e13 = e13.substring(0, i10)), "//" === (e13 = (e13 = e13.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, "$1://")).replace(/^[/\\]{2,}/i, "//")).substring(0, 2) ? (t11.protocol = null, e13 = e13.substring(2), e13 = o8.parseAuthority(e13, t11)) : (i10 = e13.indexOf(":")) > -1 && (t11.protocol = e13.substring(0, i10) || null, t11.protocol && !t11.protocol.match(o8.protocol_expression) ? t11.protocol = void 0 : "//" === e13.substring(i10 + 1, i10 + 3).replace(/\\/g, "/") ? (e13 = e13.substring(i10 + 3), e13 = o8.parseAuthority(e13, t11)) : (e13 = e13.substring(i10 + 1), t11.urn = true)), t11.path = e13, t11; + }, o8.parseHost = function(e13, t11) { + e13 || (e13 = ""); + var i10, n10, r10 = (e13 = e13.replace(/\\/g, "/")).indexOf("/"); + if (-1 === r10 && (r10 = e13.length), "[" === e13.charAt(0)) + i10 = e13.indexOf("]"), t11.hostname = e13.substring(1, i10) || null, t11.port = e13.substring(i10 + 2, r10) || null, "/" === t11.port && (t11.port = null); + else { + var s8 = e13.indexOf(":"), a8 = e13.indexOf("/"), p8 = e13.indexOf(":", s8 + 1); + -1 !== p8 && (-1 === a8 || p8 < a8) ? (t11.hostname = e13.substring(0, r10) || null, t11.port = null) : (n10 = e13.substring(0, r10).split(":"), t11.hostname = n10[0] || null, t11.port = n10[1] || null); + } + return t11.hostname && "/" !== e13.substring(r10).charAt(0) && (r10++, e13 = "/" + e13), t11.preventInvalidHostname && o8.ensureValidHostname(t11.hostname, t11.protocol), t11.port && o8.ensureValidPort(t11.port), e13.substring(r10) || "/"; + }, o8.parseAuthority = function(e13, t11) { + return e13 = o8.parseUserinfo(e13, t11), o8.parseHost(e13, t11); + }, o8.parseUserinfo = function(e13, t11) { + var i10 = e13; + -1 !== e13.indexOf("\\") && (e13 = e13.replace(/\\/g, "/")); + var n10, r10 = e13.indexOf("/"), s8 = e13.lastIndexOf("@", r10 > -1 ? r10 : e13.length - 1); + return s8 > -1 && (-1 === r10 || s8 < r10) ? (n10 = e13.substring(0, s8).split(":"), t11.username = n10[0] ? o8.decode(n10[0]) : null, n10.shift(), t11.password = n10[0] ? o8.decode(n10.join(":")) : null, e13 = i10.substring(s8 + 1)) : (t11.username = null, t11.password = null), e13; + }, o8.parseQuery = function(e13, t11) { + if (!e13) + return {}; + if (!(e13 = e13.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, ""))) + return {}; + for (var i10, n10, r10, s8 = {}, p8 = e13.split("&"), c8 = p8.length, d8 = 0; d8 < c8; d8++) + i10 = p8[d8].split("="), n10 = o8.decodeQuery(i10.shift(), t11), r10 = i10.length ? o8.decodeQuery(i10.join("="), t11) : null, "__proto__" !== n10 && (a7.call(s8, n10) ? ("string" != typeof s8[n10] && null !== s8[n10] || (s8[n10] = [s8[n10]]), s8[n10].push(r10)) : s8[n10] = r10); + return s8; + }, o8.build = function(e13) { + var t11 = "", i10 = false; + return e13.protocol && (t11 += e13.protocol + ":"), e13.urn || !t11 && !e13.hostname || (t11 += "//", i10 = true), t11 += o8.buildAuthority(e13) || "", "string" == typeof e13.path && ("/" !== e13.path.charAt(0) && i10 && (t11 += "/"), t11 += e13.path), "string" == typeof e13.query && e13.query && (t11 += "?" + e13.query), "string" == typeof e13.fragment && e13.fragment && (t11 += "#" + e13.fragment), t11; + }, o8.buildHost = function(e13) { + var t11 = ""; + return e13.hostname ? (o8.ip6_expression.test(e13.hostname) ? t11 += "[" + e13.hostname + "]" : t11 += e13.hostname, e13.port && (t11 += ":" + e13.port), t11) : ""; + }, o8.buildAuthority = function(e13) { + return o8.buildUserinfo(e13) + o8.buildHost(e13); + }, o8.buildUserinfo = function(e13) { + var t11 = ""; + return e13.username && (t11 += o8.encode(e13.username)), e13.password && (t11 += ":" + o8.encode(e13.password)), t11 && (t11 += "@"), t11; + }, o8.buildQuery = function(e13, t11, i10) { + var n10, r10, s8, p8, c8 = ""; + for (r10 in e13) + if ("__proto__" !== r10 && a7.call(e13, r10)) + if (d7(e13[r10])) + for (n10 = {}, s8 = 0, p8 = e13[r10].length; s8 < p8; s8++) + void 0 !== e13[r10][s8] && void 0 === n10[e13[r10][s8] + ""] && (c8 += "&" + o8.buildQueryParameter(r10, e13[r10][s8], i10), true !== t11 && (n10[e13[r10][s8] + ""] = true)); + else + void 0 !== e13[r10] && (c8 += "&" + o8.buildQueryParameter(r10, e13[r10], i10)); + return c8.substring(1); + }, o8.buildQueryParameter = function(e13, t11, i10) { + return o8.encodeQuery(e13, i10) + (null !== t11 ? "=" + o8.encodeQuery(t11, i10) : ""); + }, o8.addQuery = function(e13, t11, i10) { + if ("object" == typeof t11) + for (var n10 in t11) + a7.call(t11, n10) && o8.addQuery(e13, n10, t11[n10]); + else { + if ("string" != typeof t11) + throw new TypeError("URI.addQuery() accepts an object, string as the name parameter"); + if (void 0 === e13[t11]) + return void (e13[t11] = i10); + "string" == typeof e13[t11] && (e13[t11] = [e13[t11]]), d7(i10) || (i10 = [i10]), e13[t11] = (e13[t11] || []).concat(i10); + } + }, o8.setQuery = function(e13, t11, i10) { + if ("object" == typeof t11) + for (var n10 in t11) + a7.call(t11, n10) && o8.setQuery(e13, n10, t11[n10]); + else { + if ("string" != typeof t11) + throw new TypeError("URI.setQuery() accepts an object, string as the name parameter"); + e13[t11] = void 0 === i10 ? null : i10; + } + }, o8.removeQuery = function(e13, t11, i10) { + var n10, r10, s8; + if (d7(t11)) + for (n10 = 0, r10 = t11.length; n10 < r10; n10++) + e13[t11[n10]] = void 0; + else if ("RegExp" === c7(t11)) + for (s8 in e13) + t11.test(s8) && (e13[s8] = void 0); + else if ("object" == typeof t11) + for (s8 in t11) + a7.call(t11, s8) && o8.removeQuery(e13, s8, t11[s8]); + else { + if ("string" != typeof t11) + throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter"); + void 0 !== i10 ? "RegExp" === c7(i10) ? !d7(e13[t11]) && i10.test(e13[t11]) ? e13[t11] = void 0 : e13[t11] = f8(e13[t11], i10) : e13[t11] !== String(i10) || d7(i10) && 1 !== i10.length ? d7(e13[t11]) && (e13[t11] = f8(e13[t11], i10)) : e13[t11] = void 0 : e13[t11] = void 0; + } + }, o8.hasQuery = function(e13, t11, i10, n10) { + switch (c7(t11)) { + case "String": + break; + case "RegExp": + for (var r10 in e13) + if (a7.call(e13, r10) && t11.test(r10) && (void 0 === i10 || o8.hasQuery(e13, r10, i10))) + return true; + return false; + case "Object": + for (var s8 in t11) + if (a7.call(t11, s8) && !o8.hasQuery(e13, s8, t11[s8])) + return false; + return true; + default: + throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter"); + } + switch (c7(i10)) { + case "Undefined": + return t11 in e13; + case "Boolean": + return i10 === Boolean(d7(e13[t11]) ? e13[t11].length : e13[t11]); + case "Function": + return !!i10(e13[t11], t11, e13); + case "Array": + return !!d7(e13[t11]) && (n10 ? l7 : u7)(e13[t11], i10); + case "RegExp": + return d7(e13[t11]) ? !!n10 && l7(e13[t11], i10) : Boolean(e13[t11] && e13[t11].match(i10)); + case "Number": + i10 = String(i10); + case "String": + return d7(e13[t11]) ? !!n10 && l7(e13[t11], i10) : e13[t11] === i10; + default: + throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter"); + } + }, o8.joinPaths = function() { + for (var e13 = [], t11 = [], i10 = 0, n10 = 0; n10 < arguments.length; n10++) { + var r10 = new o8(arguments[n10]); + e13.push(r10); + for (var s8 = r10.segment(), a8 = 0; a8 < s8.length; a8++) + "string" == typeof s8[a8] && t11.push(s8[a8]), s8[a8] && i10++; + } + if (!t11.length || !i10) + return new o8(""); + var p8 = new o8("").segment(t11); + return "" !== e13[0].path() && "/" !== e13[0].path().slice(0, 1) || p8.path("/" + p8.path()), p8.normalize(); + }, o8.commonPath = function(e13, t11) { + var i10, n10 = Math.min(e13.length, t11.length); + for (i10 = 0; i10 < n10; i10++) + if (e13.charAt(i10) !== t11.charAt(i10)) { + i10--; + break; + } + return i10 < 1 ? e13.charAt(0) === t11.charAt(0) && "/" === e13.charAt(0) ? "/" : "" : ("/" === e13.charAt(i10) && "/" === t11.charAt(i10) || (i10 = e13.substring(0, i10).lastIndexOf("/")), e13.substring(0, i10 + 1)); + }, o8.withinString = function(e13, t11, i10) { + i10 || (i10 = {}); + var n10 = i10.start || o8.findUri.start, r10 = i10.end || o8.findUri.end, s8 = i10.trim || o8.findUri.trim, a8 = i10.parens || o8.findUri.parens, p8 = /[a-z0-9-]=["']?$/i; + for (n10.lastIndex = 0; ; ) { + var c8 = n10.exec(e13); + if (!c8) + break; + var d8 = c8.index; + if (i10.ignoreHtml) { + var f9 = e13.slice(Math.max(d8 - 3, 0), d8); + if (f9 && p8.test(f9)) + continue; + } + for (var l8 = d8 + e13.slice(d8).search(r10), u8 = e13.slice(d8, l8), m8 = -1; ; ) { + var h9 = a8.exec(u8); + if (!h9) + break; + var y8 = h9.index + h9[0].length; + m8 = Math.max(m8, y8); + } + if (!((u8 = m8 > -1 ? u8.slice(0, m8) + u8.slice(m8).replace(s8, "") : u8.replace(s8, "")).length <= c8[0].length || i10.ignore && i10.ignore.test(u8))) { + var g8 = t11(u8, d8, l8 = d8 + u8.length, e13); + void 0 !== g8 ? (g8 = String(g8), e13 = e13.slice(0, d8) + g8 + e13.slice(l8), n10.lastIndex = d8 + g8.length) : n10.lastIndex = l8; + } + } + return n10.lastIndex = 0, e13; + }, o8.ensureValidHostname = function(t11, i10) { + var n10 = !!t11, r10 = false; + if (!!i10 && (r10 = l7(o8.hostProtocols, i10)), r10 && !n10) + throw new TypeError("Hostname cannot be empty, if protocol is " + i10); + if (t11 && t11.match(o8.invalid_hostname_characters)) { + if (!e12) + throw new TypeError('Hostname "' + t11 + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available'); + if (e12.toASCII(t11).match(o8.invalid_hostname_characters)) + throw new TypeError('Hostname "' + t11 + '" contains characters other than [A-Z0-9.-:_]'); + } + }, o8.ensureValidPort = function(e13) { + if (e13) { + var t11 = Number(e13); + if (!(/^[0-9]+$/.test(t11) && t11 > 0 && t11 < 65536)) + throw new TypeError('Port "' + e13 + '" is not a valid port'); + } + }, o8.noConflict = function(e13) { + if (e13) { + var t11 = { URI: this.noConflict() }; + return n9.URITemplate && "function" == typeof n9.URITemplate.noConflict && (t11.URITemplate = n9.URITemplate.noConflict()), n9.IPv6 && "function" == typeof n9.IPv6.noConflict && (t11.IPv6 = n9.IPv6.noConflict()), n9.SecondLevelDomains && "function" == typeof n9.SecondLevelDomains.noConflict && (t11.SecondLevelDomains = n9.SecondLevelDomains.noConflict()), t11; + } + return n9.URI === this && (n9.URI = r9), this; + }, s7.build = function(e13) { + return true === e13 ? this._deferred_build = true : (void 0 === e13 || this._deferred_build) && (this._string = o8.build(this._parts), this._deferred_build = false), this; + }, s7.clone = function() { + return new o8(this); + }, s7.valueOf = s7.toString = function() { + return this.build(false)._string; + }, s7.protocol = $5("protocol"), s7.username = $5("username"), s7.password = $5("password"), s7.hostname = $5("hostname"), s7.port = $5("port"), s7.query = x7("query", "?"), s7.fragment = x7("fragment", "#"), s7.search = function(e13, t11) { + var i10 = this.query(e13, t11); + return "string" == typeof i10 && i10.length ? "?" + i10 : i10; + }, s7.hash = function(e13, t11) { + var i10 = this.fragment(e13, t11); + return "string" == typeof i10 && i10.length ? "#" + i10 : i10; + }, s7.pathname = function(e13, t11) { + if (void 0 === e13 || true === e13) { + var i10 = this._parts.path || (this._parts.hostname ? "/" : ""); + return e13 ? (this._parts.urn ? o8.decodeUrnPath : o8.decodePath)(i10) : i10; + } + return this._parts.urn ? this._parts.path = e13 ? o8.recodeUrnPath(e13) : "" : this._parts.path = e13 ? o8.recodePath(e13) : "/", this.build(!t11), this; + }, s7.path = s7.pathname, s7.href = function(e13, t11) { + var i10; + if (void 0 === e13) + return this.toString(); + this._string = "", this._parts = o8._parts(); + var n10 = e13 instanceof o8, r10 = "object" == typeof e13 && (e13.hostname || e13.path || e13.pathname); + if (e13.nodeName && (e13 = e13[o8.getDomAttribute(e13)] || "", r10 = false), !n10 && r10 && void 0 !== e13.pathname && (e13 = e13.toString()), "string" == typeof e13 || e13 instanceof String) + this._parts = o8.parse(String(e13), this._parts); + else { + if (!n10 && !r10) + throw new TypeError("invalid input"); + var s8 = n10 ? e13._parts : e13; + for (i10 in s8) + "query" !== i10 && a7.call(this._parts, i10) && (this._parts[i10] = s8[i10]); + s8.query && this.query(s8.query, false); + } + return this.build(!t11), this; + }, s7.is = function(e13) { + var t11 = false, n10 = false, r10 = false, s8 = false, a8 = false, p8 = false, c8 = false, d8 = !this._parts.urn; + switch (this._parts.hostname && (d8 = false, n10 = o8.ip4_expression.test(this._parts.hostname), r10 = o8.ip6_expression.test(this._parts.hostname), a8 = (s8 = !(t11 = n10 || r10)) && i9 && i9.has(this._parts.hostname), p8 = s8 && o8.idn_expression.test(this._parts.hostname), c8 = s8 && o8.punycode_expression.test(this._parts.hostname)), e13.toLowerCase()) { + case "relative": + return d8; + case "absolute": + return !d8; + case "domain": + case "name": + return s8; + case "sld": + return a8; + case "ip": + return t11; + case "ip4": + case "ipv4": + case "inet4": + return n10; + case "ip6": + case "ipv6": + case "inet6": + return r10; + case "idn": + return p8; + case "url": + return !this._parts.urn; + case "urn": + return !!this._parts.urn; + case "punycode": + return c8; + } + return null; + }; + var _6 = s7.protocol, w6 = s7.port, S6 = s7.hostname; + s7.protocol = function(e13, t11) { + if (e13 && !(e13 = e13.replace(/:(\/\/)?$/, "")).match(o8.protocol_expression)) + throw new TypeError('Protocol "' + e13 + `" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`); + return _6.call(this, e13, t11); + }, s7.scheme = s7.protocol, s7.port = function(e13, t11) { + return this._parts.urn ? void 0 === e13 ? "" : this : (void 0 !== e13 && (0 === e13 && (e13 = null), e13 && (":" === (e13 += "").charAt(0) && (e13 = e13.substring(1)), o8.ensureValidPort(e13))), w6.call(this, e13, t11)); + }, s7.hostname = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 !== e13) { + var i10 = { preventInvalidHostname: this._parts.preventInvalidHostname }; + if ("/" !== o8.parseHost(e13, i10)) + throw new TypeError('Hostname "' + e13 + '" contains characters other than [A-Z0-9.-]'); + e13 = i10.hostname, this._parts.preventInvalidHostname && o8.ensureValidHostname(e13, this._parts.protocol); + } + return S6.call(this, e13, t11); + }, s7.origin = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13) { + var i10 = this.protocol(); + return this.authority() ? (i10 ? i10 + "://" : "") + this.authority() : ""; + } + var n10 = o8(e13); + return this.protocol(n10.protocol()).authority(n10.authority()).build(!t11), this; + }, s7.host = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13) + return this._parts.hostname ? o8.buildHost(this._parts) : ""; + if ("/" !== o8.parseHost(e13, this._parts)) + throw new TypeError('Hostname "' + e13 + '" contains characters other than [A-Z0-9.-]'); + return this.build(!t11), this; + }, s7.authority = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13) + return this._parts.hostname ? o8.buildAuthority(this._parts) : ""; + if ("/" !== o8.parseAuthority(e13, this._parts)) + throw new TypeError('Hostname "' + e13 + '" contains characters other than [A-Z0-9.-]'); + return this.build(!t11), this; + }, s7.userinfo = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13) { + var i10 = o8.buildUserinfo(this._parts); + return i10 ? i10.substring(0, i10.length - 1) : i10; + } + return "@" !== e13[e13.length - 1] && (e13 += "@"), o8.parseUserinfo(e13, this._parts), this.build(!t11), this; + }, s7.resource = function(e13, t11) { + var i10; + return void 0 === e13 ? this.path() + this.search() + this.hash() : (i10 = o8.parse(e13), this._parts.path = i10.path, this._parts.query = i10.query, this._parts.fragment = i10.fragment, this.build(!t11), this); + }, s7.subdomain = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13) { + if (!this._parts.hostname || this.is("IP")) + return ""; + var i10 = this._parts.hostname.length - this.domain().length - 1; + return this._parts.hostname.substring(0, i10) || ""; + } + var n10 = this._parts.hostname.length - this.domain().length, r10 = this._parts.hostname.substring(0, n10), s8 = new RegExp("^" + p7(r10)); + if (e13 && "." !== e13.charAt(e13.length - 1) && (e13 += "."), -1 !== e13.indexOf(":")) + throw new TypeError("Domains cannot contain colons"); + return e13 && o8.ensureValidHostname(e13, this._parts.protocol), this._parts.hostname = this._parts.hostname.replace(s8, e13), this.build(!t11), this; + }, s7.domain = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if ("boolean" == typeof e13 && (t11 = e13, e13 = void 0), void 0 === e13) { + if (!this._parts.hostname || this.is("IP")) + return ""; + var i10 = this._parts.hostname.match(/\./g); + if (i10 && i10.length < 2) + return this._parts.hostname; + var n10 = this._parts.hostname.length - this.tld(t11).length - 1; + return n10 = this._parts.hostname.lastIndexOf(".", n10 - 1) + 1, this._parts.hostname.substring(n10) || ""; + } + if (!e13) + throw new TypeError("cannot set domain empty"); + if (-1 !== e13.indexOf(":")) + throw new TypeError("Domains cannot contain colons"); + if (o8.ensureValidHostname(e13, this._parts.protocol), !this._parts.hostname || this.is("IP")) + this._parts.hostname = e13; + else { + var r10 = new RegExp(p7(this.domain()) + "$"); + this._parts.hostname = this._parts.hostname.replace(r10, e13); + } + return this.build(!t11), this; + }, s7.tld = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if ("boolean" == typeof e13 && (t11 = e13, e13 = void 0), void 0 === e13) { + if (!this._parts.hostname || this.is("IP")) + return ""; + var n10 = this._parts.hostname.lastIndexOf("."), r10 = this._parts.hostname.substring(n10 + 1); + return true !== t11 && i9 && i9.list[r10.toLowerCase()] && i9.get(this._parts.hostname) || r10; + } + var o9; + if (!e13) + throw new TypeError("cannot set TLD empty"); + if (e13.match(/[^a-zA-Z0-9-]/)) { + if (!i9 || !i9.is(e13)) + throw new TypeError('TLD "' + e13 + '" contains characters other than [A-Z0-9]'); + o9 = new RegExp(p7(this.tld()) + "$"), this._parts.hostname = this._parts.hostname.replace(o9, e13); + } else { + if (!this._parts.hostname || this.is("IP")) + throw new ReferenceError("cannot set TLD on non-domain host"); + o9 = new RegExp(p7(this.tld()) + "$"), this._parts.hostname = this._parts.hostname.replace(o9, e13); + } + return this.build(!t11), this; + }, s7.directory = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13 || true === e13) { + if (!this._parts.path && !this._parts.hostname) + return ""; + if ("/" === this._parts.path) + return "/"; + var i10 = this._parts.path.length - this.filename().length - 1, n10 = this._parts.path.substring(0, i10) || (this._parts.hostname ? "/" : ""); + return e13 ? o8.decodePath(n10) : n10; + } + var r10 = this._parts.path.length - this.filename().length, s8 = this._parts.path.substring(0, r10), a8 = new RegExp("^" + p7(s8)); + return this.is("relative") || (e13 || (e13 = "/"), "/" !== e13.charAt(0) && (e13 = "/" + e13)), e13 && "/" !== e13.charAt(e13.length - 1) && (e13 += "/"), e13 = o8.recodePath(e13), this._parts.path = this._parts.path.replace(a8, e13), this.build(!t11), this; + }, s7.filename = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if ("string" != typeof e13) { + if (!this._parts.path || "/" === this._parts.path) + return ""; + var i10 = this._parts.path.lastIndexOf("/"), n10 = this._parts.path.substring(i10 + 1); + return e13 ? o8.decodePathSegment(n10) : n10; + } + var r10 = false; + "/" === e13.charAt(0) && (e13 = e13.substring(1)), e13.match(/\.?\//) && (r10 = true); + var s8 = new RegExp(p7(this.filename()) + "$"); + return e13 = o8.recodePath(e13), this._parts.path = this._parts.path.replace(s8, e13), r10 ? this.normalizePath(t11) : this.build(!t11), this; + }, s7.suffix = function(e13, t11) { + if (this._parts.urn) + return void 0 === e13 ? "" : this; + if (void 0 === e13 || true === e13) { + if (!this._parts.path || "/" === this._parts.path) + return ""; + var i10, n10, r10 = this.filename(), s8 = r10.lastIndexOf("."); + return -1 === s8 ? "" : (i10 = r10.substring(s8 + 1), n10 = /^[a-z0-9%]+$/i.test(i10) ? i10 : "", e13 ? o8.decodePathSegment(n10) : n10); + } + "." === e13.charAt(0) && (e13 = e13.substring(1)); + var a8, c8 = this.suffix(); + if (c8) + a8 = e13 ? new RegExp(p7(c8) + "$") : new RegExp(p7("." + c8) + "$"); + else { + if (!e13) + return this; + this._parts.path += "." + o8.recodePath(e13); + } + return a8 && (e13 = o8.recodePath(e13), this._parts.path = this._parts.path.replace(a8, e13)), this.build(!t11), this; + }, s7.segment = function(e13, t11, i10) { + var n10 = this._parts.urn ? ":" : "/", r10 = this.path(), o9 = "/" === r10.substring(0, 1), s8 = r10.split(n10); + if (void 0 !== e13 && "number" != typeof e13 && (i10 = t11, t11 = e13, e13 = void 0), void 0 !== e13 && "number" != typeof e13) + throw new Error('Bad segment "' + e13 + '", must be 0-based integer'); + if (o9 && s8.shift(), e13 < 0 && (e13 = Math.max(s8.length + e13, 0)), void 0 === t11) + return void 0 === e13 ? s8 : s8[e13]; + if (null === e13 || void 0 === s8[e13]) + if (d7(t11)) { + s8 = []; + for (var a8 = 0, p8 = t11.length; a8 < p8; a8++) + (t11[a8].length || s8.length && s8[s8.length - 1].length) && (s8.length && !s8[s8.length - 1].length && s8.pop(), s8.push(m7(t11[a8]))); + } else + (t11 || "string" == typeof t11) && (t11 = m7(t11), "" === s8[s8.length - 1] ? s8[s8.length - 1] = t11 : s8.push(t11)); + else + t11 ? s8[e13] = m7(t11) : s8.splice(e13, 1); + return o9 && s8.unshift(""), this.path(s8.join(n10), i10); + }, s7.segmentCoded = function(e13, t11, i10) { + var n10, r10, s8; + if ("number" != typeof e13 && (i10 = t11, t11 = e13, e13 = void 0), void 0 === t11) { + if (d7(n10 = this.segment(e13, t11, i10))) + for (r10 = 0, s8 = n10.length; r10 < s8; r10++) + n10[r10] = o8.decode(n10[r10]); + else + n10 = void 0 !== n10 ? o8.decode(n10) : void 0; + return n10; + } + if (d7(t11)) + for (r10 = 0, s8 = t11.length; r10 < s8; r10++) + t11[r10] = o8.encode(t11[r10]); + else + t11 = "string" == typeof t11 || t11 instanceof String ? o8.encode(t11) : t11; + return this.segment(e13, t11, i10); + }; + var P6 = s7.query; + return s7.query = function(e13, t11) { + if (true === e13) + return o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + if ("function" == typeof e13) { + var i10 = o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace), n10 = e13.call(this, i10); + return this._parts.query = o8.buildQuery(n10 || i10, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace), this.build(!t11), this; + } + return void 0 !== e13 && "string" != typeof e13 ? (this._parts.query = o8.buildQuery(e13, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace), this.build(!t11), this) : P6.call(this, e13, t11); + }, s7.setQuery = function(e13, t11, i10) { + var n10 = o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + if ("string" == typeof e13 || e13 instanceof String) + n10[e13] = void 0 !== t11 ? t11 : null; + else { + if ("object" != typeof e13) + throw new TypeError("URI.addQuery() accepts an object, string as the name parameter"); + for (var r10 in e13) + a7.call(e13, r10) && (n10[r10] = e13[r10]); + } + return this._parts.query = o8.buildQuery(n10, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace), "string" != typeof e13 && (i10 = t11), this.build(!i10), this; + }, s7.addQuery = function(e13, t11, i10) { + var n10 = o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + return o8.addQuery(n10, e13, void 0 === t11 ? null : t11), this._parts.query = o8.buildQuery(n10, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace), "string" != typeof e13 && (i10 = t11), this.build(!i10), this; + }, s7.removeQuery = function(e13, t11, i10) { + var n10 = o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + return o8.removeQuery(n10, e13, t11), this._parts.query = o8.buildQuery(n10, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace), "string" != typeof e13 && (i10 = t11), this.build(!i10), this; + }, s7.hasQuery = function(e13, t11, i10) { + var n10 = o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + return o8.hasQuery(n10, e13, t11, i10); + }, s7.setSearch = s7.setQuery, s7.addSearch = s7.addQuery, s7.removeSearch = s7.removeQuery, s7.hasSearch = s7.hasQuery, s7.normalize = function() { + return this._parts.urn ? this.normalizeProtocol(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build() : this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build(); + }, s7.normalizeProtocol = function(e13) { + return "string" == typeof this._parts.protocol && (this._parts.protocol = this._parts.protocol.toLowerCase(), this.build(!e13)), this; + }, s7.normalizeHostname = function(i10) { + return this._parts.hostname && (this.is("IDN") && e12 ? this._parts.hostname = e12.toASCII(this._parts.hostname) : this.is("IPv6") && t10 && (this._parts.hostname = t10.best(this._parts.hostname)), this._parts.hostname = this._parts.hostname.toLowerCase(), this.build(!i10)), this; + }, s7.normalizePort = function(e13) { + return "string" == typeof this._parts.protocol && this._parts.port === o8.defaultPorts[this._parts.protocol] && (this._parts.port = null, this.build(!e13)), this; + }, s7.normalizePath = function(e13) { + var t11, i10 = this._parts.path; + if (!i10) + return this; + if (this._parts.urn) + return this._parts.path = o8.recodeUrnPath(this._parts.path), this.build(!e13), this; + if ("/" === this._parts.path) + return this; + var n10, r10, s8 = ""; + for ("/" !== (i10 = o8.recodePath(i10)).charAt(0) && (t11 = true, i10 = "/" + i10), "/.." !== i10.slice(-3) && "/." !== i10.slice(-2) || (i10 += "/"), i10 = i10.replace(/(\/(\.\/)+)|(\/\.$)/g, "/").replace(/\/{2,}/g, "/"), t11 && (s8 = i10.substring(1).match(/^(\.\.\/)+/) || "") && (s8 = s8[0]); -1 !== (n10 = i10.search(/\/\.\.(\/|$)/)); ) + 0 !== n10 ? (-1 === (r10 = i10.substring(0, n10).lastIndexOf("/")) && (r10 = n10), i10 = i10.substring(0, r10) + i10.substring(n10 + 3)) : i10 = i10.substring(3); + return t11 && this.is("relative") && (i10 = s8 + i10.substring(1)), this._parts.path = i10, this.build(!e13), this; + }, s7.normalizePathname = s7.normalizePath, s7.normalizeQuery = function(e13) { + return "string" == typeof this._parts.query && (this._parts.query.length ? this.query(o8.parseQuery(this._parts.query, this._parts.escapeQuerySpace)) : this._parts.query = null, this.build(!e13)), this; + }, s7.normalizeFragment = function(e13) { + return this._parts.fragment || (this._parts.fragment = null, this.build(!e13)), this; + }, s7.normalizeSearch = s7.normalizeQuery, s7.normalizeHash = s7.normalizeFragment, s7.iso8859 = function() { + var e13 = o8.encode, t11 = o8.decode; + o8.encode = escape, o8.decode = decodeURIComponent; + try { + this.normalize(); + } finally { + o8.encode = e13, o8.decode = t11; + } + return this; + }, s7.unicode = function() { + var e13 = o8.encode, t11 = o8.decode; + o8.encode = y7, o8.decode = unescape; + try { + this.normalize(); + } finally { + o8.encode = e13, o8.decode = t11; + } + return this; + }, s7.readable = function() { + var t11 = this.clone(); + t11.username("").password("").normalize(); + var i10 = ""; + if (t11._parts.protocol && (i10 += t11._parts.protocol + "://"), t11._parts.hostname && (t11.is("punycode") && e12 ? (i10 += e12.toUnicode(t11._parts.hostname), t11._parts.port && (i10 += ":" + t11._parts.port)) : i10 += t11.host()), t11._parts.hostname && t11._parts.path && "/" !== t11._parts.path.charAt(0) && (i10 += "/"), i10 += t11.path(true), t11._parts.query) { + for (var n10 = "", r10 = 0, s8 = t11._parts.query.split("&"), a8 = s8.length; r10 < a8; r10++) { + var p8 = (s8[r10] || "").split("="); + n10 += "&" + o8.decodeQuery(p8[0], this._parts.escapeQuerySpace).replace(/&/g, "%26"), void 0 !== p8[1] && (n10 += "=" + o8.decodeQuery(p8[1], this._parts.escapeQuerySpace).replace(/&/g, "%26")); + } + i10 += "?" + n10.substring(1); + } + return i10 + o8.decodeQuery(t11.hash(), true); + }, s7.absoluteTo = function(e13) { + var t11, i10, n10, r10 = this.clone(), s8 = ["protocol", "username", "password", "hostname", "port"]; + if (this._parts.urn) + throw new Error("URNs do not have any generally defined hierarchical components"); + if (e13 instanceof o8 || (e13 = new o8(e13)), r10._parts.protocol) + return r10; + if (r10._parts.protocol = e13._parts.protocol, this._parts.hostname) + return r10; + for (i10 = 0; n10 = s8[i10]; i10++) + r10._parts[n10] = e13._parts[n10]; + return r10._parts.path ? (".." === r10._parts.path.substring(-2) && (r10._parts.path += "/"), "/" !== r10.path().charAt(0) && (t11 = (t11 = e13.directory()) || (0 === e13.path().indexOf("/") ? "/" : ""), r10._parts.path = (t11 ? t11 + "/" : "") + r10._parts.path, r10.normalizePath())) : (r10._parts.path = e13._parts.path, r10._parts.query || (r10._parts.query = e13._parts.query)), r10.build(), r10; + }, s7.relativeTo = function(e13) { + var t11, i10, n10, r10, s8, a8 = this.clone().normalize(); + if (a8._parts.urn) + throw new Error("URNs do not have any generally defined hierarchical components"); + if (e13 = new o8(e13).normalize(), t11 = a8._parts, i10 = e13._parts, r10 = a8.path(), s8 = e13.path(), "/" !== r10.charAt(0)) + throw new Error("URI is already relative"); + if ("/" !== s8.charAt(0)) + throw new Error("Cannot calculate a URI relative to another relative URI"); + if (t11.protocol === i10.protocol && (t11.protocol = null), t11.username !== i10.username || t11.password !== i10.password) + return a8.build(); + if (null !== t11.protocol || null !== t11.username || null !== t11.password) + return a8.build(); + if (t11.hostname !== i10.hostname || t11.port !== i10.port) + return a8.build(); + if (t11.hostname = null, t11.port = null, r10 === s8) + return t11.path = "", a8.build(); + if (!(n10 = o8.commonPath(r10, s8))) + return a8.build(); + var p8 = i10.path.substring(n10.length).replace(/[^\/]*$/, "").replace(/.*?\//g, "../"); + return t11.path = p8 + t11.path.substring(n10.length) || "./", a8.build(); + }, s7.equals = function(e13) { + var t11, i10, n10, r10, s8, p8 = this.clone(), c8 = new o8(e13), f9 = {}; + if (p8.normalize(), c8.normalize(), p8.toString() === c8.toString()) + return true; + if (n10 = p8.query(), r10 = c8.query(), p8.query(""), c8.query(""), p8.toString() !== c8.toString()) + return false; + if (n10.length !== r10.length) + return false; + for (s8 in t11 = o8.parseQuery(n10, this._parts.escapeQuerySpace), i10 = o8.parseQuery(r10, this._parts.escapeQuerySpace), t11) + if (a7.call(t11, s8)) { + if (d7(t11[s8])) { + if (!u7(t11[s8], i10[s8])) + return false; + } else if (t11[s8] !== i10[s8]) + return false; + f9[s8] = true; + } + for (s8 in i10) + if (a7.call(i10, s8) && !f9[s8]) + return false; + return true; + }, s7.preventInvalidHostname = function(e13) { + return this._parts.preventInvalidHostname = !!e13, this; + }, s7.duplicateQueryParameters = function(e13) { + return this._parts.duplicateQueryParameters = !!e13, this; + }, s7.escapeQuerySpace = function(e13) { + return this._parts.escapeQuerySpace = !!e13, this; + }, o8; + }); + }, 62675: function(e11, t9, i8) { + var n8; + e11 = i8.nmd(e11), function() { + t9 && t9.nodeType, e11 && e11.nodeType; + var r8 = "object" == typeof i8.g && i8.g; + r8.global !== r8 && r8.window !== r8 && r8.self; + var o7, s7 = 2147483647, a7 = 36, p7 = 26, c7 = 38, d7 = 700, f8 = /^xn--/, l7 = /[^\x20-\x7E]/, u7 = /[\x2E\u3002\uFF0E\uFF61]/g, m7 = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, h8 = a7 - 1, y7 = Math.floor, g7 = String.fromCharCode; + function b8(e12) { + throw new RangeError(m7[e12]); + } + function v8(e12, t10) { + for (var i9 = e12.length, n9 = []; i9--; ) + n9[i9] = t10(e12[i9]); + return n9; + } + function j6(e12, t10) { + var i9 = e12.split("@"), n9 = ""; + return i9.length > 1 && (n9 = i9[0] + "@", e12 = i9[1]), n9 + v8((e12 = e12.replace(u7, ".")).split("."), t10).join("."); + } + function $5(e12) { + for (var t10, i9, n9 = [], r9 = 0, o8 = e12.length; r9 < o8; ) + (t10 = e12.charCodeAt(r9++)) >= 55296 && t10 <= 56319 && r9 < o8 ? 56320 == (64512 & (i9 = e12.charCodeAt(r9++))) ? n9.push(((1023 & t10) << 10) + (1023 & i9) + 65536) : (n9.push(t10), r9--) : n9.push(t10); + return n9; + } + function x7(e12) { + return v8(e12, function(e13) { + var t10 = ""; + return e13 > 65535 && (t10 += g7((e13 -= 65536) >>> 10 & 1023 | 55296), e13 = 56320 | 1023 & e13), t10 + g7(e13); + }).join(""); + } + function _6(e12, t10) { + return e12 + 22 + 75 * (e12 < 26) - ((0 != t10) << 5); + } + function w6(e12, t10, i9) { + var n9 = 0; + for (e12 = i9 ? y7(e12 / d7) : e12 >> 1, e12 += y7(e12 / t10); e12 > h8 * p7 >> 1; n9 += a7) + e12 = y7(e12 / h8); + return y7(n9 + (h8 + 1) * e12 / (e12 + c7)); + } + function S6(e12) { + var t10, i9, n9, r9, o8, c8, d8, f9, l8, u8, m8, h9 = [], g8 = e12.length, v9 = 0, j7 = 128, $6 = 72; + for ((i9 = e12.lastIndexOf("-")) < 0 && (i9 = 0), n9 = 0; n9 < i9; ++n9) + e12.charCodeAt(n9) >= 128 && b8("not-basic"), h9.push(e12.charCodeAt(n9)); + for (r9 = i9 > 0 ? i9 + 1 : 0; r9 < g8; ) { + for (o8 = v9, c8 = 1, d8 = a7; r9 >= g8 && b8("invalid-input"), ((f9 = (m8 = e12.charCodeAt(r9++)) - 48 < 10 ? m8 - 22 : m8 - 65 < 26 ? m8 - 65 : m8 - 97 < 26 ? m8 - 97 : a7) >= a7 || f9 > y7((s7 - v9) / c8)) && b8("overflow"), v9 += f9 * c8, !(f9 < (l8 = d8 <= $6 ? 1 : d8 >= $6 + p7 ? p7 : d8 - $6)); d8 += a7) + c8 > y7(s7 / (u8 = a7 - l8)) && b8("overflow"), c8 *= u8; + $6 = w6(v9 - o8, t10 = h9.length + 1, 0 == o8), y7(v9 / t10) > s7 - j7 && b8("overflow"), j7 += y7(v9 / t10), v9 %= t10, h9.splice(v9++, 0, j7); + } + return x7(h9); + } + function P6(e12) { + var t10, i9, n9, r9, o8, c8, d8, f9, l8, u8, m8, h9, v9, j7, x8, S7 = []; + for (h9 = (e12 = $5(e12)).length, t10 = 128, i9 = 0, o8 = 72, c8 = 0; c8 < h9; ++c8) + (m8 = e12[c8]) < 128 && S7.push(g7(m8)); + for (n9 = r9 = S7.length, r9 && S7.push("-"); n9 < h9; ) { + for (d8 = s7, c8 = 0; c8 < h9; ++c8) + (m8 = e12[c8]) >= t10 && m8 < d8 && (d8 = m8); + for (d8 - t10 > y7((s7 - i9) / (v9 = n9 + 1)) && b8("overflow"), i9 += (d8 - t10) * v9, t10 = d8, c8 = 0; c8 < h9; ++c8) + if ((m8 = e12[c8]) < t10 && ++i9 > s7 && b8("overflow"), m8 == t10) { + for (f9 = i9, l8 = a7; !(f9 < (u8 = l8 <= o8 ? 1 : l8 >= o8 + p7 ? p7 : l8 - o8)); l8 += a7) + x8 = f9 - u8, j7 = a7 - u8, S7.push(g7(_6(u8 + x8 % j7, 0))), f9 = y7(x8 / j7); + S7.push(g7(_6(f9, 0))), o8 = w6(i9, v9, n9 == r9), i9 = 0, ++n9; + } + ++i9, ++t10; + } + return S7.join(""); + } + o7 = { version: "1.3.2", ucs2: { decode: $5, encode: x7 }, decode: S6, encode: P6, toASCII: function(e12) { + return j6(e12, function(e13) { + return l7.test(e13) ? "xn--" + P6(e13) : e13; + }); + }, toUnicode: function(e12) { + return j6(e12, function(e13) { + return f8.test(e13) ? S6(e13.slice(4).toLowerCase()) : e13; + }); + } }, void 0 === (n8 = function() { + return o7; + }.call(t9, i8, t9, e11)) || (e11.exports = n8); + }(); + }, 8839: () => { + }, 18248: () => { + }, 15253: () => { + }, 86973: () => { + }, 58883: (e11, t9, i8) => { + "use strict"; + var n8 = i8(45838), r8 = i8(76502); + function o7(e12) { + return e12 && "object" == typeof e12 && "default" in e12 ? e12 : { default: e12 }; + } + var s7 = o7(n8), a7 = o7(r8); + const p7 = (e12) => void 0 !== e12, c7 = (e12) => (t10) => t10.keyword === e12, d7 = c7("anyOf"), f8 = c7("enum"), l7 = (e12) => e12 && e12.errors || [], u7 = (e12) => { + return e12 && (t10 = e12.children, Object.values(t10)) || []; + var t10; + }, m7 = (e12) => (t10) => t10.reduce((e13, t11) => e13.concat(t11), e12), h8 = /['"]/g, y7 = /NOT/g, g7 = /^[a-z]/; + function b8(e12) { + return e12.replace(h8, '"').replace(y7, "not"); + } + function v8(e12) { + return e12.toUpperCase(); + } + class j6 { + constructor(e12 = { isIdentifierLocation: false }, { data: t10, schema: i9, propPath: n9 }) { + this.options = e12, this.data = t10, this.schema = i9, this.propPath = n9; + } + getError() { + throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`); + } + getPrettyPropertyName(e12) { + const t10 = this.getPropertyName(e12); + return null === t10 ? (typeof this.getPropertyValue(e12)).replace(g7, v8) : `"${t10}" property`; + } + getPropertyName(e12) { + const t10 = function(e13) { + const t11 = e13.lastIndexOf("/"); + return -1 !== t11 ? e13.slice(t11 + 1) : null; + }(e12); + return null !== t10 ? t10 : 0 === this.propPath.length ? null : this.propPath[this.propPath.length - 1]; + } + getPropertyValue(e12) { + return "" === e12 ? this.data : s7.default.get(this.data, e12); + } + } + class $5 extends j6 { + getError() { + const { message: e12, instancePath: t10 } = this.options; + return { error: `${this.getPrettyPropertyName(t10)} ${b8(e12)}`, path: t10 }; + } + } + class x7 extends j6 { + constructor(...e12) { + super(...e12); + } + getError() { + const { params: e12, instancePath: t10 } = this.options; + return { error: `Property "${e12.additionalProperty}" is not expected to be here`, path: t10 }; + } + } + class _6 extends j6 { + getError() { + const { message: e12, instancePath: t10, params: i9 } = this.options, n9 = this.findBestMatch(), r9 = { error: `${this.getPrettyPropertyName(t10)} ${e12}: ${i9.allowedValues.map((e13) => "string" == typeof e13 ? `"${e13}"` : JSON.stringify(e13)).join(", ")}`, path: t10 }; + return null !== n9 && (r9.suggestion = `Did you mean "${n9}"?`), r9; + } + findBestMatch() { + const { instancePath: e12, params: { allowedValues: t10 } } = this.options, i9 = this.getPropertyValue(e12); + if ("string" != typeof i9) + return null; + const n9 = t10.filter((e13) => "string" == typeof e13).map((e13) => ({ value: e13, weight: a7.default(e13, i9.toString()) })).sort((e13, t11) => e13.weight > t11.weight ? 1 : e13.weight < t11.weight ? -1 : 0); + if (0 === n9.length) + return null; + const r9 = n9[0]; + return 1 === t10.length || r9.weight < r9.value.length ? r9.value : null; + } + } + class w6 extends j6 { + getError() { + const { message: e12, instancePath: t10 } = this.options; + return { error: `${this.getPrettyPropertyName(t10)} ${b8(e12)}`, path: t10 }; + } + } + class S6 extends j6 { + getError() { + const { message: e12, instancePath: t10 } = this.options, i9 = this.getPropertyName(t10); + return { error: null === i9 ? `Value type ${e12}` : `"${i9}" property type ${e12}`, path: t10 }; + } + } + class P6 extends j6 { + getError() { + const { message: e12, instancePath: t10 } = this.options; + return { error: e12, path: t10 }; + } + } + const O7 = /\/[\w$_-]+(\/\d+)?/g; + function T6(e12, t10, i9) { + l7(e12).some(d7) && Object.keys(e12.children).length > 0 && delete e12.errors, e12.errors && e12.errors.length && l7(e12).every(f8) && (/* @__PURE__ */ ((e13) => (t11) => { + return u7(e13).filter((n9 = t11, i10 = (e14) => n9 === e14, (e14) => !i10(e14))); + var i10, n9; + })(t10))(e12).filter(p7).some(l7) && delete t10.children[i9], Object.entries(e12.children).forEach(([t11, i10]) => T6(i10, e12, t11)); + } + function A6(e12, t10) { + const i9 = l7(e12); + if (i9.length && i9.every(f8)) { + const e13 = [...new Set(m7([])(i9.map((e14) => e14.params.allowedValues)))], n9 = i9[0]; + return [new _6({ ...n9, params: { allowedValues: e13 } }, t10)]; + } + return m7(i9.reduce((e13, i10) => { + switch (i10.keyword) { + case "additionalProperties": + return e13.concat(new x7(i10, t10)); + case "required": + return e13.concat(new $5(i10, t10)); + case "type": + return e13.concat(new S6(i10, t10)); + case "errorMessage": + return e13.concat(new P6(i10, t10)); + default: + return e13.concat(new w6(i10, t10)); + } + }, []))(u7(e12).map((e13) => A6(e13, t10))); + } + var I6 = (e12, t10) => { + const i9 = function(e13 = []) { + const t11 = { children: {} }; + return e13.forEach((e14) => { + const { instancePath: i10 } = e14, n9 = "" === i10 ? [""] : i10.match(O7); + n9 && n9.reduce((t12, i11, r9) => (t12.children[i11] = t12.children[i11] || { children: {}, errors: [] }, r9 === n9.length - 1 && t12.children[i11].errors.push(e14), t12.children[i11]), t11); + }), t11; + }(e12 || []); + return T6(i9), A6(i9, t10); + }; + const E6 = (e12) => e12.getError(); + e11.exports = (e12, t10, { propertyPath: i9, targetValue: n9 }) => I6(t10, { data: n9, schema: e12, propPath: i9 }).map(E6); + }, 93643: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const i8 = `__object_order_${Math.floor(Date.now() / 36e5)}__`, n8 = Symbol.for(i8), r8 = String(n8), o7 = { defineProperty: (e12, t10, i9) => (!Object.prototype.hasOwnProperty.call(e12, t10) && n8 in e12 ? e12[n8].push(t10) : "value" in i9 && t10 === n8 && -1 === i9.value.lastIndexOf(n8) && i9.value.push(n8), Reflect.defineProperty(e12, t10, i9)), deleteProperty(e12, t10) { + const i9 = Object.prototype.hasOwnProperty.call(e12, t10), r9 = Reflect.deleteProperty(e12, t10); + if (r9 && i9 && n8 in e12) { + const i10 = e12[n8].indexOf(t10); + -1 !== i10 && e12[n8].splice(i10, 1); + } + return r9; + }, ownKeys: (e12) => n8 in e12 ? e12[n8] : Reflect.ownKeys(e12), set(e12, t10, i9) { + const r9 = Object.prototype.hasOwnProperty.call(e12, t10), o8 = Reflect.set(e12, t10, i9); + return o8 && !r9 && n8 in e12 && e12[n8].push(t10), o8; + } }; + function s7(e12, t10 = Reflect.ownKeys(e12)) { + u7(e12); + const i9 = new Proxy(e12, o7); + return a7(i9, t10), i9; + } + function a7(e12, t10) { + return n8 in e12 ? (e12[n8].length = 0, e12[n8].push(...t10), true) : Reflect.defineProperty(e12, n8, { configurable: true, value: t10 }); + } + function p7(e12) { + const t10 = e12.slice(); + for (let e13 = 0; e13 < t10.length; e13 += 1) { + const i9 = t10[e13]; + l7(i9) && (t10[e13] = Array.isArray(i9) ? p7(i9) : c7(i9, true)); + } + return t10; + } + function c7(e12, t10) { + u7(e12, "Invalid target provided"); + const i9 = { ...e12 }; + if (n8 in e12 && Object.defineProperty(i9, r8, { enumerable: true, value: e12[n8].filter((e13) => e13 !== n8) }), t10) + for (const t11 of Object.keys(e12)) { + if (t11 === r8) + continue; + const n9 = e12[t11]; + l7(n9) && (i9[t11] = Array.isArray(n9) ? p7(n9) : c7(n9, true)); + } + return i9; + } + function d7(e12) { + for (let t10 = 0; t10 < e12.length; t10 += 1) { + const i9 = e12[t10]; + l7(i9) && (e12[t10] = Array.isArray(i9) ? d7(i9) : f8(i9, true)); + } + return e12; + } + function f8(e12, t10) { + u7(e12, "Invalid target provided"); + const i9 = s7(e12, r8 in e12 ? e12[r8] : Reflect.ownKeys(e12)); + if (delete i9[r8], t10) + for (const t11 of Object.keys(e12)) { + const i10 = e12[t11]; + l7(i10) && (e12[t11] = Array.isArray(i10) ? d7(i10) : f8(i10, true)); + } + return i9; + } + function l7(e12) { + return null !== e12 && "object" == typeof e12; + } + function u7(e12, t10) { + "undefined" != typeof process && l7(process) && l7(process.env), 0; + } + t9.ORDER_KEY_ID = i8, t9.default = s7, t9.deserialize = f8, t9.getOrder = function(e12) { + return e12[n8]; + }, t9.isOrderedObject = function(e12) { + return n8 in e12; + }, t9.serialize = c7, t9.setOrder = a7; + }, 45559: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.DEFAULT_PARSER_OPTIONS = void 0; + const n8 = i8(20613); + t9.DEFAULT_PARSER_OPTIONS = Object.freeze({ incompatibleValues: n8.DiagnosticSeverity.Error, duplicateKeys: n8.DiagnosticSeverity.Error }); + }, 84474: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.isParsedResult = t9.ParsedDocument = t9.Document = t9.normalizeSource = void 0; + const n8 = i8(98136), r8 = i8(30333), o7 = i8(95955), s7 = i8(46734); + function a7(e12) { + return void 0 === e12 ? null : e12.length > 0 && !(0, o7.startsWithProtocol)(e12) ? (0, n8.normalize)(e12) : e12; + } + t9.normalizeSource = a7, t9.Document = class { + constructor(e12, t10, i9) { + this.input = e12, this.parser = t10, this.parserResult = t10.parse(e12), this.source = a7(i9), this.diagnostics = (0, r8.formatParserDiagnostics)(this.parserResult.diagnostics, this.source); + } + getRangeForJsonPath(e12, t10) { + var i9; + return null === (i9 = this.parser.getLocationForJsonPath(this.parserResult, e12, t10)) || void 0 === i9 ? void 0 : i9.range; + } + trapAccess(e12) { + return this.parser.trapAccess(e12); + } + static get DEFAULT_RANGE() { + return { start: { character: 0, line: 0 }, end: { character: 0, line: 0 } }; + } + get data() { + return this.parserResult.data; + } + }, t9.ParsedDocument = class { + constructor(e12) { + this.parserResult = e12, this.source = a7(e12.source), this.diagnostics = (0, r8.formatParserDiagnostics)(this.parserResult.parsed.diagnostics, this.source); + } + trapAccess(e12) { + return e12; + } + getRangeForJsonPath(e12, t10) { + var i9; + return null === (i9 = this.parserResult.getLocationForJsonPath(this.parserResult.parsed, e12, t10)) || void 0 === i9 ? void 0 : i9.range; + } + get data() { + return this.parserResult.parsed.data; + } + }, t9.isParsedResult = (e12) => (0, s7.isPlainObject)(e12) && (0, s7.isPlainObject)(e12.parsed) && "function" == typeof e12.getLocationForJsonPath; + }, 47600: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.DocumentInventory = void 0; + const n8 = i8(99747), r8 = i8(46734), o7 = i8(98136), s7 = i8(45250), a7 = i8(84474), p7 = i8(30333), c7 = (0, n8.__importStar)(i8(63083)), d7 = i8(95955); + class f8 { + constructor(e12, t10) { + this.document = e12, this.resolver = t10, this.diagnostics = [], this.parseResolveResult = (e13) => { + const t11 = e13.targetAuthority.href().replace(/\/$/, ""), i10 = (0, o7.extname)(t11), n10 = String(e13.result), r9 = ".json" === i10 ? c7.Json : c7.Yaml, s8 = new a7.Document(n10, r9, t11); + return e13.result = s8.data, s8.diagnostics.length > 0 && this.diagnostics.push(...(0, p7.formatParserDiagnostics)(s8.diagnostics, s8.source)), this.referencedDocuments[t11] = s8, Promise.resolve(e13); + }, this.graph = null, this.errors = null; + const i9 = t10.uriCache, n9 = f8._cachedRemoteDocuments.get(i9); + void 0 !== n9 ? this.referencedDocuments = n9 : (this.referencedDocuments = {}, f8._cachedRemoteDocuments.set(i9, this.referencedDocuments)); + } + get source() { + return this.document.source; + } + get unresolved() { + return this.document.data; + } + get formats() { + var e12; + return null !== (e12 = this.document.formats) && void 0 !== e12 ? e12 : null; + } + async resolve() { + if (!(0, s7.isObjectLike)(this.document.data)) + return this.graph = null, this.resolved = this.document.data, void (this.errors = null); + const e12 = await this.resolver.resolve(this.document.data, { ...null !== this.document.source ? { baseUri: this.document.source } : null, parseResolveResult: this.parseResolveResult }); + this.graph = e12.graph, this.resolved = e12.result, this.errors = (0, p7.formatResolverErrors)(this.document, e12.errors); + } + findAssociatedItemForPath(e12, t10) { + if (!t10) { + const t11 = (0, d7.getClosestJsonPath)(this.unresolved, e12); + return { document: this.document, path: t11, missingPropertyPath: e12 }; + } + try { + const t11 = (0, d7.getClosestJsonPath)(this.resolved, e12); + if (null === (0, d7.traverseObjUntilRef)(this.unresolved, t11)) + return { document: this.document, path: (0, d7.getClosestJsonPath)(this.unresolved, e12), missingPropertyPath: e12 }; + const i9 = 0 === t11.length ? [] : e12.slice(e12.lastIndexOf(t11[t11.length - 1]) + 1); + let { source: n9 } = this; + if (null === n9 || null === this.graph) + return null; + let s8 = this.graph.getNodeData(n9).refMap, a8 = this.document; + const p8 = ["#", ...e12.map(r8.encodePointerUriFragment).map(String)]; + let c8 = ""; + for (const t12 of p8) + for (c8.length > 0 && (c8 += "/"), c8 += t12; c8 in s8; ) { + const t13 = s8[c8]; + if ((0, r8.isLocalRef)(t13)) + c8 = t13; + else { + const i10 = (0, r8.extractSourceFromRef)(t13); + if (null === i10) + return { document: a8, path: (0, d7.getClosestJsonPath)(a8.data, e12), missingPropertyPath: e12 }; + n9 = (0, d7.isAbsoluteRef)(i10) ? i10 : (0, o7.resolve)(n9, "..", i10); + const p9 = n9 === this.document.source ? this.document : this.referencedDocuments[n9]; + if (null == p9) + return { document: a8, path: (0, d7.getClosestJsonPath)(a8.data, e12), missingPropertyPath: e12 }; + a8 = p9, s8 = this.graph.getNodeData(n9).refMap, c8 = t13.indexOf("#") >= 0 ? t13.slice(t13.indexOf("#")) : "#"; + } + } + const f9 = (0, d7.getClosestJsonPath)(a8.data, this.convertRefMapKeyToPath(c8)); + return { document: a8, path: f9, missingPropertyPath: [...f9, ...i9] }; + } catch { + return null; + } + } + convertRefMapKeyToPath(e12) { + return e12.startsWith("#/") && (e12 = e12.slice(2)), e12.split("/").map(r8.decodePointerFragment); + } + } + t9.DocumentInventory = f8, f8._cachedRemoteDocuments = /* @__PURE__ */ new WeakMap(); + }, 30333: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.formatResolverErrors = t9.formatParserDiagnostics = t9.prettyPrintResolverErrorMessage = t9.getDiagnosticErrorMessage = void 0; + const n8 = i8(20613), r8 = i8(45250), o7 = i8(84474), s7 = (e12) => e12.toUpperCase(), a7 = (e12, t10, i9) => `${t10} ${i9.toLowerCase()}`; + function p7(e12) { + const t10 = c7(e12.path); + let i9 = e12.message.replace(/^[a-z]/, s7); + return "YAMLException" !== e12.code && (i9 = i9.replace(/([a-z])([A-Z])/g, a7)), void 0 !== t10 && (i9 = i9.replace(/(Duplicate key)/, `$1: ${t10}`)), i9; + } + t9.getDiagnosticErrorMessage = p7, t9.prettyPrintResolverErrorMessage = (e12) => e12.replace(/^Error\s*:\s*/, ""); + const c7 = (e12) => { + if (void 0 !== e12 && e12.length > 0) + return e12[e12.length - 1]; + }; + t9.formatParserDiagnostics = function(e12, t10) { + return e12.map((e13) => { + var i9; + return { ...e13, code: "parser", message: p7(e13), path: null !== (i9 = e13.path) && void 0 !== i9 ? i9 : [], ...null !== t10 ? { source: t10 } : null }; + }); + }, t9.formatResolverErrors = (e12, i9) => (0, r8.uniqBy)(i9, "message").map((i10) => { + var r9; + const s8 = [...i10.path, "$ref"], a8 = null !== (r9 = e12.getRangeForJsonPath(s8, true)) && void 0 !== r9 ? r9 : o7.Document.DEFAULT_RANGE, p8 = i10.uriStack.length > 0 ? i10.uriStack[i10.uriStack.length - 1] : e12.source; + return { code: "invalid-ref", path: s8, message: (0, t9.prettyPrintResolverErrorMessage)(i10.message), severity: n8.DiagnosticSeverity.Error, range: a8, ...null !== p8 ? { source: p8 } : null }; + }); + }, 71267: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.isAggregateError = void 0; + const n8 = i8(45250); + t9.isAggregateError = function(e12) { + return (0, n8.isError)(e12) && "AggregateError" === e12.constructor.name; + }; + }, 23859: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.ParsedDocument = t9.Document = void 0; + const n8 = i8(99747); + (0, n8.__exportStar)(i8(45559), t9), (0, n8.__exportStar)(i8(77327), t9); + var r8 = i8(84474); + Object.defineProperty(t9, "Document", { enumerable: true, get: function() { + return r8.Document; + } }), Object.defineProperty(t9, "ParsedDocument", { enumerable: true, get: function() { + return r8.ParsedDocument; + } }), (0, n8.__exportStar)(i8(16090), t9); + }, 36246: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.resolveAlias = t9.resolveAliasForFormats = void 0; + const n8 = i8(1336), r8 = /^#([A-Za-z0-9_-]+)/; + function o7({ targets: e12 }, t10) { + if (null === t10 || 0 === t10.size) + return null; + for (let i9 = e12.length - 1; i9 >= 0; i9--) { + const n9 = e12[i9]; + for (const e13 of n9.formats) + if (t10.has(e13)) + return n9.given; + } + return null; + } + function s7(e12, t10, i9, a7) { + var p7; + const c7 = []; + if (t10.startsWith("#")) { + const d7 = null === (p7 = r8.exec(t10)) || void 0 === p7 ? void 0 : p7[1]; + if (null == d7) + throw new TypeError("Alias must match /^#([A-Za-z0-9_-]+)/"); + if (a7.has(d7)) { + const e13 = [...a7, d7]; + throw new Error(`Alias "${e13[0]}" is circular. Resolution stack: ${e13.join(" -> ")}`); + } + if (a7.add(d7), null === e12 || !(d7 in e12)) + throw new ReferenceError(`Alias "${d7}" does not exist`); + const f8 = e12[d7]; + let l7; + l7 = (0, n8.isSimpleAliasDefinition)(f8) ? f8 : (0, n8.isScopedAliasDefinition)(f8) ? o7(f8, i9) : null, null !== l7 && c7.push(...l7.flatMap((n9) => s7(e12, n9 + t10.slice(d7.length + 1), i9, /* @__PURE__ */ new Set([...a7])))); + } else + c7.push(t10); + return c7; + } + t9.resolveAliasForFormats = o7, t9.resolveAlias = function(e12, t10, i9) { + return s7(e12, t10, i9, /* @__PURE__ */ new Set()); + }; + }, 83486: (e11, t9) => { + "use strict"; + function i8(e12) { + var t10; + return null !== (t10 = e12.displayName) && void 0 !== t10 ? t10 : e12.name; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.Formats = void 0; + class n8 extends Set { + toJSON() { + return Array.from(this).map(i8); + } + } + t9.Formats = n8; + }, 95152: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.createRulesetFunction = t9.RulesetFunctionValidationError = void 0; + const n8 = i8(99747), r8 = (0, n8.__importDefault)(i8(11601)), o7 = (0, n8.__importDefault)(i8(74421)), s7 = (0, n8.__importDefault)(i8(67156)), a7 = i8(95955), p7 = i8(572), c7 = i8(45250), d7 = i8(99639), f8 = new r8.default({ allErrors: true, allowUnionTypes: true, strict: true, keywords: ["x-internal"] }); + (0, s7.default)(f8), (0, o7.default)(f8); + class l7 extends p7.RulesetValidationError { + constructor(e12, t10) { + super("invalid-function-options", l7.printMessage(e12, t10), l7.getPath(t10)); + } + static getPath(e12) { + const t10 = ["functionOptions", ..."" === e12.instancePath ? [] : e12.instancePath.slice(1).split("/")]; + switch (e12.keyword) { + case "additionalProperties": { + const i9 = e12.params.additionalProperty; + t10.push(i9); + break; + } + } + return t10; + } + static printMessage(e12, t10) { + var i9; + switch (t10.keyword) { + case "type": + return `"${e12}" function and its "${(0, a7.printPath)(t10.instancePath.slice(1).split("/"), a7.PrintStyle.Dot)}" option accepts only the following types: ${Array.isArray(t10.params.type) ? t10.params.type.join(", ") : String(t10.params.type)}`; + case "required": { + const i10 = t10.params.missingProperty; + return `"${e12}" function is missing "${"" === t10.instancePath ? i10 : (0, a7.printPath)([...t10.instancePath.slice(1).split("/"), i10], a7.PrintStyle.Dot)}" option`; + } + case "additionalProperties": { + const i10 = t10.params.additionalProperty; + return `"${e12}" function does not support "${"" === t10.instancePath ? i10 : (0, a7.printPath)([...t10.instancePath.slice(1).split("/"), i10], a7.PrintStyle.Dot)}" option`; + } + case "enum": + return `"${e12}" function and its "${(0, a7.printPath)(t10.instancePath.slice(1).split("/"), a7.PrintStyle.Dot)}" option accepts only the following values: ${t10.params.allowedValues.map(a7.printValue).join(", ")}`; + default: + return null !== (i9 = t10.message) && void 0 !== i9 ? i9 : "unknown error"; + } + } + } + t9.RulesetFunctionValidationError = l7; + const u7 = (e12) => null === e12; + t9.createRulesetFunction = function({ input: e12, errorOnInvalidInput: t10 = false, options: i9 }, n9) { + const r9 = null === i9 ? u7 : f8.compile(i9), o8 = null !== e12 ? f8.compile(e12) : e12, s8 = function(e13, i10, ...r10) { + var a9, p8, c8; + return false === (null == o8 ? void 0 : o8(e13)) ? t10 ? [{ message: null !== (c8 = null === (p8 = null === (a9 = o8.errors) || void 0 === a9 ? void 0 : a9.find((e14) => "errorMessage" === e14.keyword)) || void 0 === p8 ? void 0 : p8.message) && void 0 !== c8 ? c8 : "invalid input" }] : void 0 : (s8.validator(i10), n9(e13, i10, ...r10)); + }; + Reflect.defineProperty(s8, "name", { value: n9.name }); + const a8 = /* @__PURE__ */ new WeakSet(); + return s8.validator = function(e13) { + if (!(0, c7.isObject)(e13) || !a8.has(e13)) { + if (!r9(e13)) + throw null === i9 ? new p7.RulesetValidationError("invalid-function-options", `"${n9.name || ""}" function does not accept any options`, ["functionOptions"]) : "errors" in r9 && Array.isArray(r9.errors) && r9.errors.length > 0 ? new d7(r9.errors.map((e14) => new l7(n9.name || "", e14))) : new p7.RulesetValidationError("invalid-function-options", `"functionOptions" of "${n9.name || ""}" function must be valid`, ["functionOptions"]); + (0, c7.isObject)(e13) && a8.add(e13); + } + }, Reflect.defineProperty(s8, "schemas", { enumerable: false, value: { input: e12, options: i9 } }), s8; + }; + }, 16090: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Rule = t9.Formats = t9.Ruleset = t9.createRulesetFunction = t9.getDiagnosticSeverity = t9.RulesetValidationError = t9.assertValidRuleset = void 0; + var n8 = i8(572); + Object.defineProperty(t9, "assertValidRuleset", { enumerable: true, get: function() { + return n8.assertValidRuleset; + } }), Object.defineProperty(t9, "RulesetValidationError", { enumerable: true, get: function() { + return n8.RulesetValidationError; + } }); + var r8 = i8(92393); + Object.defineProperty(t9, "getDiagnosticSeverity", { enumerable: true, get: function() { + return r8.getDiagnosticSeverity; + } }); + var o7 = i8(95152); + Object.defineProperty(t9, "createRulesetFunction", { enumerable: true, get: function() { + return o7.createRulesetFunction; + } }); + var s7 = i8(73368); + Object.defineProperty(t9, "Ruleset", { enumerable: true, get: function() { + return s7.Ruleset; + } }); + var a7 = i8(83486); + Object.defineProperty(t9, "Formats", { enumerable: true, get: function() { + return a7.Formats; + } }); + var p7 = i8(82846); + Object.defineProperty(t9, "Rule", { enumerable: true, get: function() { + return p7.Rule; + } }); + }, 92237: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.mergeRule = void 0; + const n8 = i8(38647), r8 = i8(82846); + function o7(e12, t10) { + if (void 0 === e12) + throw new ReferenceError(`Cannot extend non-existing rule: "${t10}"`); + } + t9.mergeRule = function(e12, t10, i9, s7) { + switch (typeof i9) { + case "boolean": + o7(e12, t10), e12.enabled = i9; + break; + case "string": + case "number": + o7(e12, t10), e12.severity = i9, "off" === i9 ? e12.enabled = false : e12.enabled || (e12.enabled = true); + break; + case "object": + if (void 0 === e12) + return (0, n8.assertValidRule)(i9, t10), new r8.Rule(t10, i9, s7); + Object.assign(e12, i9, { enabled: true, owner: e12.owner }); + break; + default: + throw new Error("Invalid value"); + } + return e12; + }; + }, 1679: (e11, t9) => { + "use strict"; + function i8(e12) { + return Array.isArray(e12) ? e12[0] : e12; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.mergeRulesets = void 0, t9.mergeRulesets = function(e12, t10, n8) { + const r8 = { ...e12, ...t10 }; + if ("extends" in r8 && "extends" in r8) { + const e13 = (o7 = r8.extends, (Array.isArray(o7) ? o7 : [o7]).map(i8)); + r8.extends = [...(Array.isArray(r8.extends) ? r8.extends : [r8.extends]).filter((t11) => !e13.includes(i8(t11))), ...Array.isArray(r8.extends) ? r8.extends : [r8.extends]]; + } + var o7; + if ("aliases" in e12 && "aliases" in t10 && (r8.aliases = { ...e12.aliases, ...t10.aliases }), !("rules" in e12) || !("rules" in t10)) + return r8; + if (n8) + r8.rules = { ...e12.rules, ...t10.rules }; + else { + const t11 = r8; + "extends" in t11 ? Array.isArray(t11.extends) ? t11.extends = [...t11.extends, e12] : t11.extends = [t11.extends, e12] : t11.extends = e12; + } + return r8; + }; + }, 82846: (e11, t9, i8) => { + "use strict"; + var n8, r8, o7, s7; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Rule = void 0; + const a7 = i8(99747), p7 = i8(45250), c7 = i8(98136), d7 = i8(46734), f8 = i8(92393), l7 = i8(64100), u7 = i8(83486), m7 = i8(36246); + class h8 { + constructor(e12, t10, i9) { + var p8, c8, d8, f9; + this.name = e12, this.definition = t10, this.owner = i9, n8.set(this, void 0), r8.set(this, void 0), o7.set(this, void 0), s7.set(this, void 0), this.recommended = false !== t10.recommended, (0, a7.__classPrivateFieldSet)(this, r8, this.recommended, "f"), this.description = null !== (p8 = t10.description) && void 0 !== p8 ? p8 : null, this.message = null !== (c8 = t10.message) && void 0 !== c8 ? c8 : null, this.documentationUrl = null !== (d8 = t10.documentationUrl) && void 0 !== d8 ? d8 : null, this.severity = t10.severity, this.resolved = false !== t10.resolved, this.formats = "formats" in t10 ? new u7.Formats(t10.formats) : null, this.then = t10.then, this.given = t10.given, this.extensions = null !== (f9 = t10.extensions) && void 0 !== f9 ? f9 : null; + } + get enabled() { + return (0, a7.__classPrivateFieldGet)(this, r8, "f") || void 0 !== this.overrides; + } + set enabled(e12) { + (0, a7.__classPrivateFieldSet)(this, r8, e12, "f"); + } + static isEnabled(e12, t10) { + return "all" === t10 || "recommended" === t10 && e12.recommended; + } + getSeverityForSource(e12, t10) { + if (void 0 === this.overrides || 0 === this.overrides.definition.size) + return this.severity; + const i9 = (0, c7.relative)((0, c7.dirname)(this.overrides.rulesetSource), e12), n9 = []; + for (const [e13, t11] of this.overrides.definition.entries()) + (0, l7.minimatch)(i9, e13) && n9.push(t11); + if (0 === n9.length) + return this.severity; + let r9 = this.severity, o8 = ""; + const s8 = (0, d7.pathToPointer)(t10); + for (const e13 of n9) + for (const [t11, i10] of e13.entries()) + t11.length >= o8.length && (s8 === t11 || s8.startsWith(`${t11}/`)) && (o8 = t11, r9 = i10); + return r9; + } + get severity() { + return (0, a7.__classPrivateFieldGet)(this, n8, "f"); + } + set severity(e12) { + void 0 === e12 ? (0, a7.__classPrivateFieldSet)(this, n8, f8.DEFAULT_SEVERITY_LEVEL, "f") : (0, a7.__classPrivateFieldSet)(this, n8, (0, f8.getDiagnosticSeverity)(e12), "f"); + } + get then() { + return (0, a7.__classPrivateFieldGet)(this, o7, "f"); + } + set then(e12) { + (0, a7.__classPrivateFieldSet)(this, o7, Array.isArray(e12) ? e12 : [e12], "f"); + } + get given() { + return (0, a7.__classPrivateFieldGet)(this, s7, "f"); + } + set given(e12) { + const t10 = Array.isArray(e12) ? e12 : [e12]; + (0, a7.__classPrivateFieldSet)(this, s7, this.owner.hasComplexAliases ? t10 : t10.flatMap((e13) => (0, m7.resolveAlias)(this.owner.aliases, e13, null)).filter(p7.isString), "f"); + } + getGivenForFormats(e12) { + return this.owner.hasComplexAliases ? (0, a7.__classPrivateFieldGet)(this, s7, "f").flatMap((t10) => (0, m7.resolveAlias)(this.owner.aliases, t10, e12)) : (0, a7.__classPrivateFieldGet)(this, s7, "f"); + } + matchesFormat(e12) { + if (null === this.formats) + return true; + if (null === e12) + return false; + for (const t10 of e12) + if (this.formats.has(t10)) + return true; + return false; + } + clone() { + return new h8(this.name, this.definition, this.owner); + } + toJSON() { + return { name: this.name, recommended: this.recommended, enabled: this.enabled, description: this.description, message: this.message, documentationUrl: this.documentationUrl, severity: this.severity, resolved: this.resolved, formats: this.formats, then: this.then.map((e12) => ({ ...e12, function: e12.function.name })), given: Array.isArray(this.definition.given) ? this.definition.given : [this.definition.given], owner: this.owner.id, extensions: this.extensions }; + } + } + t9.Rule = h8, n8 = /* @__PURE__ */ new WeakMap(), r8 = /* @__PURE__ */ new WeakMap(), o7 = /* @__PURE__ */ new WeakMap(), s7 = /* @__PURE__ */ new WeakMap(); + }, 73368: (e11, t9, i8) => { + "use strict"; + var n8, r8, o7; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Ruleset = void 0; + const s7 = i8(99747), a7 = i8(98136), p7 = i8(46734), c7 = i8(64100), d7 = i8(82846), f8 = i8(572), l7 = i8(92237), u7 = i8(23859), m7 = i8(1679), h8 = i8(83486), y7 = i8(1336), g7 = Symbol("@stoplight/spectral/ruleset/#stack"), b8 = Symbol("@stoplight/spectral/ruleset/#explicit-severity"), v8 = /^\.?spectral\.(ya?ml|json|m?js)$/; + let j6 = 1; + class $5 { + constructor(e12, t10) { + var i9; + let a8; + if (this.maybeDefinition = e12, n8.add(this), this.id = j6++, this.formats = new h8.Formats(), r8.set(this, void 0), (0, p7.isPlainObject)(e12) && "extends" in e12) { + const { extends: t11, ...i10 } = e12; + (0, f8.assertValidRuleset)({ extends: [], ...i10 }, "js"), a8 = e12; + } else + (0, f8.assertValidRuleset)(e12, "js"), a8 = e12; + this.definition = a8, (0, s7.__classPrivateFieldSet)(this, r8, { severity: "recommended", ...t10 }, "f"); + let c8 = false; + this.aliases = void 0 === a8.aliases ? null : Object.fromEntries(Object.entries(a8.aliases).map((e13) => { + const [t11, i10] = e13; + if ((0, y7.isSimpleAliasDefinition)(i10)) + return e13; + c8 = true; + const n9 = i10.targets.map((e14) => ({ formats: new h8.Formats(e14.formats), given: e14.given })); + return [t11, { ...i10, targets: n9 }]; + })), this.hasComplexAliases = c8; + const d8 = null !== (i9 = null == t10 ? void 0 : t10[g7]) && void 0 !== i9 ? i9 : /* @__PURE__ */ new Map(); + if (d8.set(this.definition, this), this.extends = "extends" in a8 ? (Array.isArray(a8.extends) ? a8.extends : [a8.extends]).reduce((e13, t11) => { + let i10, n9 = "recommended"; + const r9 = Array.isArray(t11); + return r9 ? [i10, n9] = t11 : i10 = t11, void 0 !== d8.get(i10) || e13.push(new $5(i10, { severity: n9, [g7]: d8, [b8]: r9 })), e13; + }, []) : null, 1 === d8.size && a8.overrides ? this.overrides = a8.overrides : this.overrides = null, d8.delete(this.definition), Array.isArray(this.definition.formats)) + for (const e13 of this.definition.formats) + this.formats.add(e13); + if (Array.isArray(this.extends)) + for (const { formats: e13 } of this.extends) + for (const t11 of e13) + this.formats.add(t11); + this.rules = (0, s7.__classPrivateFieldGet)(this, n8, "m", o7).call(this); + } + get source() { + var e12; + return null !== (e12 = (0, s7.__classPrivateFieldGet)(this, r8, "f").source) && void 0 !== e12 ? e12 : null; + } + fromSource(e12) { + if (null === this.overrides) + return this; + const { source: t10 } = this; + if (null === e12) + throw new Error("Document must have some source assigned. If you use Spectral programmatically make sure to pass the source to Document"); + if (null === t10) + throw new Error("Ruleset must have some source assigned. If you use Spectral programmatically make sure to pass the source to Ruleset"); + const i9 = (0, a7.relative)((0, a7.dirname)(t10), e12), n9 = {}, r9 = this.overrides.flatMap(({ files: e13, ...r10 }) => { + var o9, s9; + const a8 = []; + for (const d9 of e13) { + const e14 = null !== (o9 = (0, p7.extractSourceFromRef)(d9)) && void 0 !== o9 ? o9 : d9; + if (!(0, c7.minimatch)(i9, e14)) + continue; + const f10 = (0, p7.extractPointerFromRef)(d9); + if (e14 === d9) + a8.push(d9); + else { + if (!("rules" in r10) || null === f10) + throw new Error("Unknown error. The ruleset is presumably invalid."); + for (const [i10, o10] of Object.entries(r10.rules)) { + if ("object" == typeof o10 || "boolean" == typeof o10) + throw new Error("Unknown error. The ruleset is presumably invalid."); + const { definition: r11 } = null !== (s9 = n9[i10]) && void 0 !== s9 ? s9 : n9[i10] = { rulesetSource: t10, definition: /* @__PURE__ */ new Map() }, a9 = (0, u7.getDiagnosticSeverity)(o10); + let p8 = r11.get(e14); + void 0 === p8 && (p8 = /* @__PURE__ */ new Map(), r11.set(e14, p8)), p8.set(f10, a9); + } + } + } + return 0 === a8.length ? [] : r10; + }), { overrides: o8, ...s8 } = this.definition; + if (0 === r9.length && 0 === Object.keys(n9).length) + return this; + const d8 = 0 === r9.length ? null : r9.length > 1 ? r9.slice(1).reduce((e13, t11) => (0, m7.mergeRulesets)(e13, t11, true), r9[0]) : r9[0], f9 = new $5(null === d8 ? s8 : (0, m7.mergeRulesets)(s8, d8, false), { severity: "recommended", source: t10 }); + for (const [e13, t11] of Object.entries(n9)) + e13 in f9.rules && (f9.rules[e13].overrides = t11); + return f9; + } + get parserOptions() { + return { ...u7.DEFAULT_PARSER_OPTIONS, ...this.definition.parserOptions }; + } + static isDefaultRulesetFile(e12) { + return v8.test(e12); + } + toJSON() { + return { id: this.id, extends: this.extends, source: this.source, aliases: this.aliases, formats: 0 === this.formats.size ? null : this.formats, rules: this.rules, overrides: this.overrides, parserOptions: this.parserOptions }; + } + } + t9.Ruleset = $5, r8 = /* @__PURE__ */ new WeakMap(), n8 = /* @__PURE__ */ new WeakSet(), o7 = function() { + const e12 = {}; + if (null !== this.extends && this.extends.length > 0) { + for (const t10 of this.extends) + if (t10 !== this) + for (const i9 of Object.values(t10.rules)) + e12[i9.name] = i9, void 0 !== (0, s7.__classPrivateFieldGet)(this, r8, "f")[g7] && true === (0, s7.__classPrivateFieldGet)(this, r8, "f")[b8] && (i9.enabled = d7.Rule.isEnabled(i9, (0, s7.__classPrivateFieldGet)(this, r8, "f").severity)); + } + if ("rules" in this.definition) + for (const [t10, i9] of Object.entries(this.definition.rules)) { + const n9 = (0, l7.mergeRule)(e12[t10], t10, i9, this); + if (e12[t10] = n9, n9.owner === this && (n9.enabled = d7.Rule.isEnabled(n9, (0, s7.__classPrivateFieldGet)(this, r8, "f").severity)), null !== n9.formats) + for (const e13 of n9.formats) + this.formats.add(e13); + else + n9.owner !== this ? n9.formats = void 0 === n9.owner.definition.formats ? null : new h8.Formats(n9.owner.definition.formats) : void 0 !== this.definition.formats && (n9.formats = new h8.Formats(this.definition.formats)); + void 0 !== this.definition.documentationUrl && null === n9.documentationUrl && (n9.documentationUrl = `${this.definition.documentationUrl}#${t10}`); + } + return e12; + }; + }, 1336: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.isScopedAliasDefinition = t9.isValidAliasTarget = t9.isSimpleAliasDefinition = void 0; + const n8 = i8(46734), r8 = i8(45250); + function o7(e12) { + const t10 = e12.formats; + return !!(Array.isArray(t10) || t10 instanceof Set) && Array.isArray(e12.given) && e12.given.every(r8.isString); + } + t9.isSimpleAliasDefinition = function(e12) { + return Array.isArray(e12); + }, t9.isValidAliasTarget = o7, t9.isScopedAliasDefinition = function(e12) { + return (0, n8.isPlainObject)(e12) && Array.isArray(e12.targets) && e12.targets.every(o7); + }; + }, 64100: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.minimatch = void 0; + const n8 = (0, i8(99747).__importDefault)(i8(79914)), r8 = { matchBase: true }; + t9.minimatch = function(e12, t10) { + return (0, n8.default)(e12, t10, r8); + }; + }, 92393: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getDiagnosticSeverity = t9.DEFAULT_SEVERITY_LEVEL = void 0; + const n8 = i8(20613); + t9.DEFAULT_SEVERITY_LEVEL = n8.DiagnosticSeverity.Warning; + const r8 = { error: n8.DiagnosticSeverity.Error, warn: n8.DiagnosticSeverity.Warning, info: n8.DiagnosticSeverity.Information, hint: n8.DiagnosticSeverity.Hint, off: -1 }; + t9.getDiagnosticSeverity = function(e12) { + return Number.isNaN(Number(e12)) ? r8[e12] : Number(e12); + }; + }, 55823: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.createValidator = void 0; + const n8 = i8(99747), r8 = (0, n8.__importStar)(i8(11601)), o7 = (0, n8.__importDefault)(i8(63036)), s7 = (0, n8.__importDefault)(i8(74421)), a7 = (0, n8.__importDefault)(i8(67156)), p7 = (0, n8.__importStar)(i8(91361)), c7 = (0, n8.__importStar)(i8(82691)), d7 = (0, n8.__importStar)(i8(84185)), f8 = (0, n8.__importStar)(i8(3054)), l7 = (0, n8.__importStar)(i8(50421)), u7 = i8(28658), m7 = i8(59868), h8 = { js: null, json: null }; + t9.createValidator = function(e12) { + const t10 = h8[e12]; + if (null !== t10) + return t10; + const i9 = new r8.default({ allErrors: true, strict: true, strictRequired: false, keywords: ["$anchor"], schemas: [p7, c7], passContext: true }); + (0, s7.default)(i9), (0, a7.default)(i9), i9.addKeyword({ keyword: "x-spectral-runtime", schemaType: "string", error: { message(e13) { + var t11; + return r8._`${void 0 !== (null === (t11 = e13.params) || void 0 === t11 ? void 0 : t11.message) ? e13.params.message : ""}`; + }, params(e13) { + var t11; + return r8._`{ errors: ${void 0 !== (null === (t11 = e13.params) || void 0 === t11 ? void 0 : t11.errors) && e13.params.errors} || [] }`; + } }, code(e13) { + const { data: t11 } = e13; + switch (e13.schema) { + case "format": + e13.fail(r8._`typeof ${t11} !== "function"`); + break; + case "ruleset-function": { + const i10 = e13.gen.const("spectralFunction", r8._`this.validateFunction(${t11}.function, ${t11}.functionOptions === void 0 ? null : ${t11}.functionOptions, ${o7.default.instancePath})`); + e13.gen.if(r8._`${i10} !== void 0`), e13.error(false, { errors: i10 }), e13.gen.endIf(); + break; + } + case "alias": { + const i10 = e13.gen.const("spectralAlias", r8._`this.validateAlias(${o7.default.rootData}, ${t11}, ${o7.default.instancePath})`); + e13.gen.if(r8._`${i10} !== void 0`), e13.error(false, { errors: i10 }), e13.gen.endIf(); + break; + } + } + } }), "js" === e12 ? i9.addSchema(f8) : i9.addSchema(l7); + const n9 = new Proxy(i9.compile(d7), { apply: (e13, t11, i10) => Reflect.apply(e13, { validateAlias: u7.validateAlias, validateFunction: m7.validateFunction }, i10) }); + return h8[e12] = n9, n9; + }; + }, 38647: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.assertValidRule = t9.assertValidRuleset = void 0; + const n8 = i8(99747), r8 = i8(46734), o7 = i8(55823), s7 = i8(78253), a7 = (0, n8.__importDefault)(i8(99639)); + t9.assertValidRuleset = function(e12, t10 = "js") { + var i9; + if (!(0, r8.isPlainObject)(e12)) + throw new s7.RulesetValidationError("invalid-ruleset-definition", "Provided ruleset is not an object", []); + if (!("rules" in e12) && !("extends" in e12) && !("overrides" in e12)) + throw new s7.RulesetValidationError("invalid-ruleset-definition", "Ruleset must have rules or extends or overrides defined", []); + const n9 = (0, o7.createValidator)(t10); + if (!n9(e12)) + throw new a7.default((0, s7.convertAjvErrors)(null !== (i9 = n9.errors) && void 0 !== i9 ? i9 : [])); + }, t9.assertValidRule = function(e12, t10) { + if (!function(e13) { + return "object" == typeof e13 && null !== e13 && !Array.isArray(e13) && ("given" in e13 || "then" in e13); + }(e12)) + throw new s7.RulesetValidationError("invalid-rule-definition", "Rule definition expected", ["rules", t10]); + }; + }, 78253: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.convertAjvErrors = t9.RulesetValidationError = void 0; + const n8 = i8(71267); + class r8 extends Error { + constructor(e12, t10, i9) { + super(t10), this.code = e12, this.message = t10, this.path = i9; + } + } + t9.RulesetValidationError = r8; + const o7 = /^\/rules\/[^/]+/, s7 = /^\/(?:aliases|extends|overrides(?:\/\d+\/extends)?)/; + function a7(e12) { + return (0, n8.isAggregateError)(e12) ? e12.errors.flatMap(a7) : e12; + } + function p7(e12, t10) { + if (0 === e12.length) + return "generic-validation-error"; + if (1 === e12.length && "errorMessage" !== t10) + return "invalid-ruleset-definition"; + switch (e12[0]) { + case "rules": + return function(e13) { + return 3 === e13.length && "severity" === e13[2] ? "invalid-severity" : 4 === e13.length && "formats" === e13[2] ? "invalid-format" : 4 === e13.length && "given" === e13[2] ? "invalid-given-definition" : "invalid-rule-definition"; + }(e12); + case "parserOptions": + return "invalid-parser-options-definition"; + case "aliases": + return function(e13) { + if (6 === e13.length) { + if ("given" === e13[4]) + return "invalid-given-definition"; + if ("formats" === e13[4]) + return "invalid-format"; + } + return "invalid-alias-definition"; + }(e12); + case "extends": + return "invalid-extend-definition"; + case "overrides": + return function(e13, t11) { + return e13.length >= 3 ? p7(e13.slice(2), t11) : "invalid-override-definition"; + }(e12, t10); + case "formats": + return 1 === e12.length ? "invalid-ruleset-definition" : "invalid-format"; + default: + return "generic-validation-error"; + } + } + t9.convertAjvErrors = function(e12) { + const t10 = [...e12].sort((e13, t11) => { + const i10 = e13.instancePath.length - t11.instancePath.length; + return 0 === i10 ? "errorMessage" === e13.keyword && "errorMessage" !== t11.keyword ? -1 : 0 : i10; + }).filter((e13, t11, i10) => 0 === t11 || i10[t11 - 1].instancePath !== e13.instancePath), i9 = []; + e: + for (let e13 = 0; e13 < t10.length; e13++) { + const n9 = t10[e13], r9 = 0 === i9.length ? null : i9[i9.length - 1]; + if ("if" !== n9.keyword) { + if (s7.test(n9.instancePath)) { + let i10 = 1; + for (; e13 + i10 < t10.length; ) { + if (t10[e13 + i10].instancePath.startsWith(n9.instancePath) || !s7.test(t10[e13 + i10].instancePath)) + continue e; + i10++; + } + } else { + if (null === r9) { + i9.push(n9); + continue; + } + { + const e14 = o7.exec(n9.instancePath); + null !== e14 && e14[0] !== e14.input && e14[0] === r9.instancePath && i9.pop(); + } + } + i9.push(n9); + } + } + return i9.flatMap((e13) => { + var t11; + if ("x-spectral-runtime" === e13.keyword) + return a7(e13.params.errors); + const i10 = e13.instancePath.slice(1).split("/"); + return new r8(p7(i10, e13.keyword), null !== (t11 = e13.message) && void 0 !== t11 ? t11 : "unknown error", i10); + }); + }; + }, 572: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.assertValidRuleset = t9.RulesetValidationError = void 0; + var n8 = i8(78253); + Object.defineProperty(t9, "RulesetValidationError", { enumerable: true, get: function() { + return n8.RulesetValidationError; + } }); + var r8 = i8(38647); + Object.defineProperty(t9, "assertValidRuleset", { enumerable: true, get: function() { + return r8.assertValidRuleset; + } }); + }, 28658: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateAlias = void 0; + const n8 = i8(46734), r8 = i8(45250), o7 = i8(36246), s7 = i8(83486), a7 = i8(5688), p7 = i8(78253); + function c7(e12, t10) { + if (!Array.isArray(e12)) + return null; + const i9 = Number(t10); + if (Number.isNaN(i9)) + return null; + if (i9 < 0 && i9 >= e12.length) + return null; + const r9 = e12[i9]; + return (0, n8.isPlainObject)(r9) && (0, n8.isPlainObject)(r9.aliases) ? r9.aliases : null; + } + t9.validateAlias = function(e12, t10, i9) { + const n9 = (0, a7.toParsedPath)(i9); + try { + const i10 = (0, r8.get)(e12, [...n9.slice(0, n9.indexOf("rules") + 2), "formats"]), a8 = "overrides" === n9[0] ? { ...e12.aliases, ...c7(e12.overrides, n9[1]) } : e12.aliases; + (0, o7.resolveAlias)(null != a8 ? a8 : null, t10, Array.isArray(i10) ? new s7.Formats(i10) : null); + } catch (e13) { + return e13 instanceof ReferenceError ? new p7.RulesetValidationError("undefined-alias", e13.message, n9) : (0, a7.wrapError)(e13, i9); + } + }; + }, 5688: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.toParsedPath = t9.wrapError = void 0; + const n8 = i8(99747), r8 = i8(45250), o7 = (0, n8.__importDefault)(i8(99639)), s7 = i8(78253), a7 = i8(71267); + function p7(e12) { + return e12 instanceof s7.RulesetValidationError ? (e12.path.unshift(...this), e12) : new s7.RulesetValidationError("generic-validation-error", (0, r8.isError)(e12) ? e12.message : String(e12), [...this]); + } + function c7(e12) { + return e12.slice(1).split("/"); + } + t9.wrapError = function(e12, t10) { + const i9 = c7(t10); + return (0, a7.isAggregateError)(e12) ? new o7.default(e12.errors.map(p7, i9)) : p7.call(i9, e12); + }, t9.toParsedPath = c7; + }, 59868: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.validateFunction = void 0; + const n8 = i8(5688), r8 = i8(78253); + t9.validateFunction = function(e12, t10, i9) { + try { + if (function(e13) { + if ("function" != typeof e13) + throw ReferenceError("Function is not defined"); + }(e12), !("validator" in e12)) + return; + e12.validator.bind(e12)(t10); + } catch (e13) { + return e13 instanceof ReferenceError ? new r8.RulesetValidationError("undefined-function", e13.message, [...(0, n8.toParsedPath)(i9), "function"]) : (0, n8.wrapError)(e13, i9); + } + }; + }, 35046: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Runner = void 0; + var n8 = i8(59446); + Object.defineProperty(t9, "Runner", { enumerable: true, get: function() { + return n8.Runner; + } }); + }, 32185: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.lintNode = void 0; + const n8 = i8(95955), r8 = i8(45250), o7 = i8(59756), s7 = i8(84474), a7 = i8(32704); + function p7(e12, t10, i9) { + var o8, p8, c7, d7, f8; + const { rule: l7, path: u7 } = t10; + for (const t11 of i9) { + const i10 = (null !== (o8 = t11.path) && void 0 !== o8 ? o8 : u7).map(n8.decodeSegmentFragment), m7 = e12.documentInventory.findAssociatedItemForPath(i10, l7.resolved), h8 = null !== (p8 = null == m7 ? void 0 : m7.path) && void 0 !== p8 ? p8 : (0, n8.getClosestJsonPath)(e12.documentInventory.resolved, i10), y7 = null == m7 ? void 0 : m7.document.source, g7 = null !== (c7 = null == m7 ? void 0 : m7.document) && void 0 !== c7 ? c7 : e12.documentInventory.document, b8 = null !== (d7 = g7.getRangeForJsonPath(h8, true)) && void 0 !== d7 ? d7 : s7.Document.DEFAULT_RANGE, v8 = 0 === h8.length ? g7.data : (0, r8.get)(g7.data, h8), j6 = { property: void 0 !== (null == m7 ? void 0 : m7.missingPropertyPath) && m7.missingPropertyPath.length > h8.length ? (0, n8.printPath)(m7.missingPropertyPath.slice(h8.length - 1), n8.PrintStyle.Dot) : h8.length > 0 ? h8[h8.length - 1] : "", error: t11.message, path: (0, n8.printPath)(h8, n8.PrintStyle.EscapedPointer), description: l7.description, value: v8 }, $5 = (0, a7.message)(t11.message, j6); + j6.error = $5; + const x7 = null != y7 ? l7.getSeverityForSource(y7, h8) : l7.severity; + -1 !== x7 && e12.results.push({ code: l7.name, message: (null === l7.message ? null !== (f8 = l7.description) && void 0 !== f8 ? f8 : $5 : (0, a7.message)(l7.message, j6)).trim(), path: h8, severity: x7, ...null !== y7 ? { source: y7 } : null, range: b8 }); + } + } + t9.lintNode = (e12, t10, i9) => { + var n9; + const s8 = t10.path.length > 0 && "$" === t10.path[0] ? t10.path.slice(1) : t10.path.slice(), c7 = { document: e12.documentInventory.document, documentInventory: e12.documentInventory, rule: i9, path: s8 }; + for (const d7 of i9.then) { + const i10 = (0, a7.getLintTargets)(t10.value, d7.field); + for (const t11 of i10) { + let i11; + t11.path.length > 0 ? c7.path = [...s8, ...t11.path] : c7.path = s8; + try { + i11 = d7.function(t11.value, null !== (n9 = d7.functionOptions) && void 0 !== n9 ? n9 : null, c7); + } catch (e13) { + throw new o7.ErrorWithCause(`Function "${d7.function.name}" threw an exception${(0, r8.isError)(e13) ? `: ${e13.message}` : ""}`, { cause: e13 }); + } + if (void 0 !== i11) + if ("then" in i11) { + const t12 = { ...c7 }; + e12.promises.push(i11.then((i12) => void 0 === i12 ? void 0 : p7(e12, t12, i12))); + } else + p7(e12, c7, i11); + } + } + }; + }, 59446: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Runner = void 0; + const n8 = i8(99747), r8 = i8(41150), o7 = i8(32185), s7 = (0, n8.__importDefault)(i8(22001)), a7 = i8(1847), p7 = i8(46734); + function c7(e12, t10, i9) { + var n9; + if ((0, p7.isPlainObject)(e12) || Array.isArray(e12)) + new s7.default(i9, { fallback: a7.jsonPathPlus, unsafe: false, output: "auto", customShorthands: {} }).query(e12, Object.entries(t10).reduce((e13, [t11, i10]) => (e13[t11] = (e14) => { + for (const t12 of i10) + t12(e14); + }, e13), {})); + else + for (const i10 of null !== (n9 = t10.$) && void 0 !== n9 ? n9 : []) + i10({ path: [], value: e12 }); + } + t9.Runner = class { + constructor(e12) { + var t10; + this.inventory = e12, this.results = [...this.inventory.diagnostics, ...null !== (t10 = this.inventory.errors) && void 0 !== t10 ? t10 : []]; + } + get document() { + return this.inventory.document; + } + addResult(e12) { + this.results.push(e12); + } + async run(e12) { + var t10, i9, n9; + const { inventory: r9 } = this, { rules: s8 } = e12, a8 = null !== (t10 = this.document.formats) && void 0 !== t10 ? t10 : null, p8 = { ruleset: e12, documentInventory: r9, results: this.results, promises: [] }, d7 = Object.values(s8).filter((e13) => e13.enabled).filter((e13) => e13.matchesFormat(r9.formats)), f8 = { resolved: {}, unresolved: {} }; + for (const e13 of d7) + for (const t11 of e13.getGivenForFormats(a8)) { + const r10 = (t12) => { + (0, o7.lintNode)(p8, t12, e13); + }; + (null !== (i9 = (n9 = f8[e13.resolved ? "resolved" : "unresolved"])[t11]) && void 0 !== i9 ? i9 : n9[t11] = []).push(r10); + } + const l7 = Object.keys(f8.resolved), u7 = Object.keys(f8.unresolved); + l7.length > 0 && c7(p8.documentInventory.resolved, f8.resolved, l7), u7.length > 0 && c7(p8.documentInventory.unresolved, f8.unresolved, u7), p8.promises.length > 0 && await Promise.all(p8.promises); + } + getResults() { + return (0, r8.prepareResults)(this.results); + } + }; + }, 68111: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.getLintTargets = void 0; + const n8 = i8(73522), r8 = i8(45250); + t9.getLintTargets = (e12, t10) => { + const i9 = []; + if ((0, r8.isObject)(e12) && "string" == typeof t10) + if ("@key" === t10) + for (const t11 of Object.keys(e12)) + i9.push({ path: [t11], value: t11 }); + else + t10.startsWith("$") ? (0, n8.JSONPath)({ path: t10, json: e12, resultType: "all", callback(e13) { + i9.push({ path: (0, r8.toPath)(e13.path.slice(1)), value: e13.value }); + } }) : i9.push({ path: (0, r8.toPath)(t10), value: (0, r8.get)(e12, t10) }); + else + i9.push({ path: [], value: e12 }); + return 0 === i9.length && i9.push({ path: [], value: void 0 }), i9; + }; + }, 32704: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(99747); + (0, n8.__exportStar)(i8(68111), t9), (0, n8.__exportStar)(i8(15155), t9); + }, 15155: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.message = void 0; + const n8 = i8(95955), r8 = new (i8(63687)).Replacer(2); + r8.addFunction("print", function(e12) { + if ("string" != typeof e12) + return ""; + const { property: t10, value: i9 } = this; + switch (e12) { + case "property": + return void 0 !== t10 && "" !== t10 ? `"${t10}" property ` : "The document "; + case "value": + return (0, n8.printValue)(i9); + default: + return e12 in this && null !== this[e12] ? String(this[e12]) : ""; + } + }), t9.message = r8.print.bind(r8); + }, 41150: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.sortResults = t9.compareResults = t9.comparePosition = t9.prepareResults = void 0, t9.prepareResults = (e12) => (0, t9.sortResults)(i8(e12)); + const i8 = (e12) => { + const t10 = /* @__PURE__ */ new Set(); + return e12.filter((e13) => { + const i9 = ((e14) => { + let t11 = String(e14.code); + return e14.path.length > 0 ? t11 += JSON.stringify(e14.path) : t11 += JSON.stringify(e14.range), void 0 !== e14.source && (t11 += e14.source), void 0 !== e14.message && (t11 += e14.message), t11; + })(e13); + return !t10.has(i9) && (t10.add(i9), true); + }); + }, n8 = (e12) => e12 < 0 ? -1 : e12 > 0 ? 1 : 0; + t9.comparePosition = (e12, t10) => { + const i9 = e12.line - t10.line; + if (0 !== i9) + return n8(i9); + const r8 = e12.character - t10.character; + return n8(r8); + }, t9.compareResults = (e12, i9) => { + const r8 = ((e13, t10) => void 0 === e13 && void 0 === t10 ? 0 : void 0 === e13 ? -1 : void 0 === t10 ? 1 : e13.localeCompare(t10))(e12.source, i9.source); + if (0 !== r8) + return n8(r8); + const o7 = (0, t9.comparePosition)(e12.range.start, i9.range.start); + if (0 !== o7) + return o7; + const s7 = ((e13, t10) => void 0 === e13 && void 0 === t10 ? 0 : void 0 === e13 ? -1 : void 0 === t10 ? 1 : String(e13).localeCompare(String(t10), void 0, { numeric: true }))(e12.code, i9.code); + if (0 !== s7) + return n8(s7); + const a7 = e12.path.join().localeCompare(i9.path.join()); + return n8(a7); + }, t9.sortResults = (e12) => [...e12].sort(t9.compareResults); + }, 77327: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Spectral = void 0; + const n8 = i8(99747), r8 = i8(46734), o7 = i8(20613), s7 = (0, n8.__importStar)(i8(63083)), a7 = i8(88601), p7 = i8(84474), c7 = i8(47600), d7 = i8(35046), f8 = i8(73368), l7 = i8(98833), u7 = i8(16090); + (0, n8.__exportStar)(i8(86065), t9), t9.Spectral = class { + constructor(e12) { + this.opts = e12, void 0 !== (null == e12 ? void 0 : e12.resolver) ? this._resolver = e12.resolver : this._resolver = (0, a7.createHttpAndFileResolver)(); + } + parseDocument(e12) { + return e12 instanceof p7.Document ? e12 : (0, p7.isParsedResult)(e12) ? new p7.ParsedDocument(e12) : new p7.Document("string" == typeof e12 ? e12 : (0, r8.stringify)(e12, void 0, 2), s7.Yaml); + } + async runWithResolved(e12, t10 = {}) { + if (void 0 === this.ruleset) + throw new Error("No ruleset has been defined. Have you called setRuleset()?"); + const i9 = this.parseDocument(e12), n9 = this.ruleset.fromSource(i9.source), r9 = new c7.DocumentInventory(i9, this._resolver); + await r9.resolve(); + const o8 = new d7.Runner(r9); + if (o8.results.push(...this._filterParserErrors(i9.diagnostics, n9.parserOptions)), void 0 === i9.formats) { + const e13 = [...n9.formats].filter((e14) => e14(r9.resolved, i9.source)); + 0 === e13.length && true !== t10.ignoreUnknownFormat ? (i9.formats = null, n9.formats.size > 0 && o8.addResult(this._generateUnrecognizedFormatError(i9, Array.from(n9.formats)))) : i9.formats = new Set(e13); + } + await o8.run(n9); + const s8 = o8.getResults(); + return { resolved: r9.resolved, results: s8 }; + } + async run(e12, t10 = {}) { + return (await this.runWithResolved(e12, t10)).results; + } + setRuleset(e12) { + this.ruleset = e12 instanceof f8.Ruleset ? e12 : new f8.Ruleset(e12); + } + _generateUnrecognizedFormatError(e12, t10) { + return (0, l7.generateDocumentWideResult)(e12, `The provided document does not match any of the registered formats [${t10.map((e13) => { + var t11; + return null !== (t11 = e13.displayName) && void 0 !== t11 ? t11 : e13.name; + }).join(", ")}]`, o7.DiagnosticSeverity.Warning, "unrecognized-format"); + } + _filterParserErrors(e12, t10) { + return e12.reduce((e13, i9) => { + if ("parser" !== i9.code) + return e13; + let n9; + if (i9.message.startsWith("Mapping key must be a string scalar rather than")) + n9 = (0, u7.getDiagnosticSeverity)(t10.incompatibleValues); + else { + if (!i9.message.startsWith("Duplicate key")) + return e13.push(i9), e13; + n9 = (0, u7.getDiagnosticSeverity)(t10.duplicateKeys); + } + return -1 !== n9 && (e13.push(i9), i9.severity = n9), e13; + }, []); + } + }; + }, 32385: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + }, 86065: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(99747); + (0, n8.__exportStar)(i8(17937), t9), (0, n8.__exportStar)(i8(32385), t9); + }, 17937: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + }, 98833: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.generateDocumentWideResult = void 0; + const n8 = i8(84474); + t9.generateDocumentWideResult = (e12, t10, i9, r8) => { + var o7; + return { range: null !== (o7 = e12.getRangeForJsonPath([], true)) && void 0 !== o7 ? o7 : n8.Document.DEFAULT_RANGE, message: t10, code: r8, severity: i9, ...null !== e12.source ? { source: e12.source } : null, path: [] }; + }; + }, 63687: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.Replacer = void 0; + const n8 = (0, i8(99747).__importDefault)(i8(46065)); + t9.Replacer = class { + constructor(e12) { + this.regex = new RegExp(`#?${"{".repeat(e12)}([^} +]+)${"}".repeat(e12)}`, "g"), this.functions = {}; + } + addFunction(e12, t10) { + this.functions[e12] = t10; + } + print(e12, t10) { + return e12.replace(this.regex, (i9, r8, o7) => "#" === e12[o7] ? String((0, n8.default)(r8, { ...Object.entries(this.functions).reduce((e13, [i10, n9]) => (e13[i10] = n9.bind(t10), e13), {}), ...t10 })) : r8 in t10 ? String(t10[r8]) : ""); + } + }; + }, 20613: (e11, t9) => { + "use strict"; + var i8, n8, r8, o7; + Object.defineProperty(t9, "__esModule", { value: true }), t9.HttpParamStyles = void 0, (i8 = t9.HttpParamStyles || (t9.HttpParamStyles = {})).Simple = "simple", i8.Matrix = "matrix", i8.Label = "label", i8.Form = "form", i8.CommaDelimited = "commaDelimited", i8.SpaceDelimited = "spaceDelimited", i8.PipeDelimited = "pipeDelimited", i8.DeepObject = "deepObject", t9.DiagnosticSeverity = void 0, (n8 = t9.DiagnosticSeverity || (t9.DiagnosticSeverity = {}))[n8.Error = 0] = "Error", n8[n8.Warning = 1] = "Warning", n8[n8.Information = 2] = "Information", n8[n8.Hint = 3] = "Hint", t9.NodeType = void 0, (r8 = t9.NodeType || (t9.NodeType = {})).Article = "article", r8.HttpService = "http_service", r8.HttpServer = "http_server", r8.HttpOperation = "http_operation", r8.Model = "model", r8.Generic = "generic", r8.Unknown = "unknown", r8.TableOfContents = "table_of_contents", r8.SpectralRuleset = "spectral_ruleset", r8.Styleguide = "styleguide", r8.Image = "image", t9.NodeFormat = void 0, (o7 = t9.NodeFormat || (t9.NodeFormat = {})).Json = "json", o7.Markdown = "markdown", o7.Yaml = "yaml", o7.Apng = "apng", o7.Avif = "avif", o7.Bmp = "bmp", o7.Gif = "gif", o7.Jpeg = "jpeg", o7.Png = "png", o7.Svg = "svg", o7.Webp = "webp"; + }, 29824: (e11, t9) => { + "use strict"; + var i8, n8, r8, o7, s7; + Object.defineProperty(t9, "__esModule", { value: true }), t9.HttpOperationSecurityDeclarationTypes = void 0, (i8 = t9.HttpOperationSecurityDeclarationTypes || (t9.HttpOperationSecurityDeclarationTypes = {})).None = "none", i8.Declared = "declared", i8.InheritedFromService = "inheritedFromService", t9.HttpParamStyles = void 0, (n8 = t9.HttpParamStyles || (t9.HttpParamStyles = {})).Unspecified = "unspecified", n8.Simple = "simple", n8.Matrix = "matrix", n8.Label = "label", n8.Form = "form", n8.CommaDelimited = "commaDelimited", n8.SpaceDelimited = "spaceDelimited", n8.PipeDelimited = "pipeDelimited", n8.DeepObject = "deepObject", n8.TabDelimited = "tabDelimited", t9.DiagnosticSeverity = void 0, (r8 = t9.DiagnosticSeverity || (t9.DiagnosticSeverity = {}))[r8.Error = 0] = "Error", r8[r8.Warning = 1] = "Warning", r8[r8.Information = 2] = "Information", r8[r8.Hint = 3] = "Hint", t9.NodeType = void 0, (o7 = t9.NodeType || (t9.NodeType = {})).Article = "article", o7.HttpService = "http_service", o7.HttpServer = "http_server", o7.HttpOperation = "http_operation", o7.HttpCallback = "http_callback", o7.HttpWebhook = "http_webhook", o7.Model = "model", o7.Generic = "generic", o7.Unknown = "unknown", o7.TableOfContents = "table_of_contents", o7.SpectralRuleset = "spectral_ruleset", o7.Styleguide = "styleguide", o7.Image = "image", o7.StoplightResolutions = "stoplight_resolutions", o7.StoplightOverride = "stoplight_override", t9.NodeFormat = void 0, (s7 = t9.NodeFormat || (t9.NodeFormat = {})).Json = "json", s7.Markdown = "markdown", s7.Yaml = "yaml", s7.Javascript = "javascript", s7.Apng = "apng", s7.Avif = "avif", s7.Bmp = "bmp", s7.Gif = "gif", s7.Jpeg = "jpeg", s7.Png = "png", s7.Svg = "svg", s7.Webp = "webp"; + }, 78464: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(20700), o7 = i8(79828), s7 = i8(17189), a7 = i8(67594), p7 = i8(58481), c7 = i8(66684); + e11.exports = function(e12, t10, i9) { + if ("Object" !== c7(e12)) + throw new n8("Assertion failed: Type(O) is not Object"); + if (!a7(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true"); + return r8(s7, p7, o7, e12, t10, { "[[Configurable]]": true, "[[Enumerable]]": false, "[[Value]]": i9, "[[Writable]]": true }); + }; + }, 79828: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(47604), o7 = i8(290); + e11.exports = function(e12) { + if (void 0 !== e12 && !r8(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return o7(e12); + }; + }, 17189: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(78554), o7 = i8(47604); + e11.exports = function(e12) { + if (void 0 === e12) + return false; + if (!o7(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return !(!r8(e12, "[[Value]]") && !r8(e12, "[[Writable]]")); + }; + }, 67594: (e11) => { + "use strict"; + e11.exports = function(e12) { + return "string" == typeof e12 || "symbol" == typeof e12; + }; + }, 58481: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41445); + e11.exports = function(e12, t10) { + return e12 === t10 ? 0 !== e12 || 1 / e12 == 1 / t10 : n8(e12) && n8(t10); + }; + }, 66684: (e11, t9, i8) => { + "use strict"; + var n8 = i8(61216); + e11.exports = function(e12) { + return "symbol" == typeof e12 ? "Symbol" : "bigint" == typeof e12 ? "BigInt" : n8(e12); + }; + }, 80238: (e11, t9, i8) => { + "use strict"; + var n8 = i8(39911), r8 = i8(76982), o7 = i8(2625), s7 = i8(3468); + e11.exports = function(e12, t10, i9) { + if ("string" != typeof e12) + throw new s7("Assertion failed: `S` must be a String"); + if (!r8(t10) || t10 < 0 || t10 > o7) + throw new s7("Assertion failed: `length` must be an integer >= 0 and <= 2**53"); + if ("boolean" != typeof i9) + throw new s7("Assertion failed: `unicode` must be a Boolean"); + return i9 ? t10 + 1 >= e12.length ? t10 + 1 : t10 + n8(e12, t10)["[[CodeUnitCount]]"] : t10 + 1; + }; + }, 9081: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(5731), o7 = i8(3468), s7 = n8("%Promise%", true), a7 = i8(79818), p7 = i8(90307), c7 = i8(158), d7 = i8(56188), f8 = i8(69896), l7 = i8(52795), u7 = a7("Promise.prototype.then", true); + e11.exports = function(e12) { + if ("Object" !== l7(e12)) + throw new o7("Assertion failed: Type(O) is not Object"); + if (arguments.length > 1) + throw new r8("although AsyncFromSyncIteratorContinuation should take a second argument, it is not used in this implementation"); + if (!s7) + throw new r8("This environment does not support Promises."); + return new s7(function(t10) { + var i9 = c7(e12), n9 = d7(e12), r9 = f8(s7, n9); + t10(u7(r9, function(e13) { + return p7(e13, i9); + })); + }); + }; + }, 53347: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(79818), o7 = i8(3468), s7 = i8(80234), a7 = n8("%Reflect.apply%", true) || r8("Function.prototype.apply"); + e11.exports = function(e12, t10) { + var i9 = arguments.length > 2 ? arguments[2] : []; + if (!s7(i9)) + throw new o7("Assertion failed: optional `argumentsList`, if provided, must be a List"); + return a7(e12, t10, i9); + }; + }, 39911: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(79818), o7 = i8(91318), s7 = i8(86186), a7 = i8(79041), p7 = r8("String.prototype.charAt"), c7 = r8("String.prototype.charCodeAt"); + e11.exports = function(e12, t10) { + if ("string" != typeof e12) + throw new n8("Assertion failed: `string` must be a String"); + var i9 = e12.length; + if (t10 < 0 || t10 >= i9) + throw new n8("Assertion failed: `position` must be >= 0, and < the length of `string`"); + var r9 = c7(e12, t10), d7 = p7(e12, t10), f8 = o7(r9), l7 = s7(r9); + if (!f8 && !l7) + return { "[[CodePoint]]": d7, "[[CodeUnitCount]]": 1, "[[IsUnpairedSurrogate]]": false }; + if (l7 || t10 + 1 === i9) + return { "[[CodePoint]]": d7, "[[CodeUnitCount]]": 1, "[[IsUnpairedSurrogate]]": true }; + var u7 = c7(e12, t10 + 1); + return s7(u7) ? { "[[CodePoint]]": a7(r9, u7), "[[CodeUnitCount]]": 2, "[[IsUnpairedSurrogate]]": false } : { "[[CodePoint]]": d7, "[[CodeUnitCount]]": 1, "[[IsUnpairedSurrogate]]": true }; + }; + }, 55286: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(5731), o7 = i8(3468), s7 = n8("%Promise%", true), a7 = i8(9081), p7 = i8(53347), c7 = i8(90307), d7 = i8(52903), f8 = i8(18666), l7 = i8(24600), u7 = i8(77394), m7 = i8(52795), h8 = i8(66986), y7 = i8(66381), g7 = n8("%AsyncFromSyncIteratorPrototype%", true) || { next: function(e12) { + if (!s7) + throw new r8("This environment does not support Promises."); + var t10 = this; + h8.assert(t10, "[[SyncIteratorRecord]]"); + var i9 = arguments.length; + return new s7(function(n9) { + var r9, o8 = h8.get(t10, "[[SyncIteratorRecord]]"); + r9 = i9 > 0 ? l7(o8, e12) : l7(o8), n9(a7(r9)); + }); + }, return: function() { + if (!s7) + throw new r8("This environment does not support Promises."); + var e12 = this; + h8.assert(e12, "[[SyncIteratorRecord]]"); + var t10 = arguments.length > 0, i9 = t10 ? arguments[0] : void 0; + return new s7(function(n9, r9) { + var s8 = h8.get(e12, "[[SyncIteratorRecord]]")["[[Iterator]]"], d8 = f8(s8, "return"); + if (void 0 !== d8) { + var l8; + l8 = t10 ? p7(d8, s8, [i9]) : p7(d8, s8), "Object" === m7(l8) ? n9(a7(l8)) : p7(r9, void 0, [new o7("Iterator `return` method returned a non-object value.")]); + } else { + var u8 = c7(i9, true); + p7(n9, void 0, [u8]); + } + }); + }, throw: function() { + if (!s7) + throw new r8("This environment does not support Promises."); + var e12 = this; + h8.assert(e12, "[[SyncIteratorRecord]]"); + var t10 = arguments.length > 0, i9 = t10 ? arguments[0] : void 0; + return new s7(function(n9, r9) { + var s8, c8 = h8.get(e12, "[[SyncIteratorRecord]]")["[[Iterator]]"], d8 = f8(c8, "throw"); + void 0 !== d8 ? (s8 = t10 ? p7(d8, c8, [i9]) : p7(d8, c8), "Object" === m7(s8) ? n9(a7(s8)) : p7(r9, void 0, [new o7("Iterator `throw` method returned a non-object value.")])) : p7(r9, void 0, [i9]); + }); + } }; + e11.exports = function(e12) { + if (!y7(e12)) + throw new o7("Assertion failed: `syncIteratorRecord` must be an Iterator Record"); + var t10 = u7(g7); + return h8.set(t10, "[[SyncIteratorRecord]]", e12), { "[[Iterator]]": t10, "[[NextMethod]]": d7(t10, "next"), "[[Done]]": false }; + }; + }, 92210: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(52731), o7 = i8(35521), s7 = i8(52795); + e11.exports = function(e12, t10, i9) { + if ("Object" !== s7(e12)) + throw new n8("Assertion failed: Type(O) is not Object"); + if (!r8(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true"); + return o7(e12, t10, { "[[Configurable]]": true, "[[Enumerable]]": true, "[[Value]]": i9, "[[Writable]]": true }); + }; + }, 10207: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(92210), o7 = i8(52731), s7 = i8(52795); + e11.exports = function(e12, t10, i9) { + if ("Object" !== s7(e12)) + throw new n8("Assertion failed: Type(O) is not Object"); + if (!o7(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true"); + if (!r8(e12, t10, i9)) + throw new n8("unable to create data property"); + }; + }, 90307: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468); + e11.exports = function(e12, t10) { + if ("boolean" != typeof t10) + throw new n8("Assertion failed: Type(done) is not Boolean"); + return { value: e12, done: t10 }; + }; + }, 84063: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(47604), o7 = i8(290); + e11.exports = function(e12) { + if (void 0 !== e12 && !r8(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return o7(e12); + }; + }, 52903: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(48660), o7 = i8(52731), s7 = i8(52795); + e11.exports = function(e12, t10) { + if ("Object" !== s7(e12)) + throw new n8("Assertion failed: Type(O) is not Object"); + if (!o7(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true, got " + r8(t10)); + return e12[t10]; + }; + }, 22693: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(3468), o7 = n8("%Symbol.asyncIterator%", true), s7 = i8(48660), a7 = i8(53558)(), p7 = i8(80238), c7 = i8(55286), d7 = i8(21088), f8 = i8(18666), l7 = i8(80234), u7 = i8(76959); + e11.exports = function(e12, t10) { + if ("SYNC" !== t10 && "ASYNC" !== t10) + throw new r8("Assertion failed: `kind` must be one of 'sync' or 'async', got " + s7(t10)); + var i9; + if ("ASYNC" === t10 && a7 && o7 && (i9 = f8(e12, o7)), void 0 === i9) { + var n9 = u7({ AdvanceStringIndex: p7, GetMethod: f8, IsArray: l7 }, e12); + if ("ASYNC" === t10) { + if (void 0 === n9) + throw new r8("iterator method is `undefined`"); + var m7 = d7(e12, n9); + return c7(m7); + } + i9 = n9; + } + if (void 0 === i9) + throw new r8("iterator method is `undefined`"); + return d7(e12, i9); + }; + }, 21088: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(53347), o7 = i8(52903), s7 = i8(46627), a7 = i8(52795); + e11.exports = function(e12, t10) { + if (!s7(t10)) + throw new n8("method must be a function"); + var i9 = r8(t10, e12); + if ("Object" !== a7(i9)) + throw new n8("iterator must return an object"); + return { "[[Iterator]]": i9, "[[NextMethod]]": o7(i9, "next"), "[[Done]]": false }; + }; + }, 18666: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(32157), o7 = i8(46627), s7 = i8(52731), a7 = i8(48660); + e11.exports = function(e12, t10) { + if (!s7(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true"); + var i9 = r8(e12, t10); + if (null != i9) { + if (!o7(i9)) + throw new n8(a7(t10) + " is not a function: " + a7(i9)); + return i9; + } + }; + }, 32157: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(48660), o7 = i8(52731); + e11.exports = function(e12, t10) { + if (!o7(t10)) + throw new n8("Assertion failed: IsPropertyKey(P) is not true, got " + r8(t10)); + return e12[t10]; + }; + }, 67093: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(78554), o7 = i8(47604); + e11.exports = function(e12) { + if (void 0 === e12) + return false; + if (!o7(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return !(!r8(e12, "[[Get]]") && !r8(e12, "[[Set]]")); + }; + }, 80234: (e11, t9, i8) => { + "use strict"; + e11.exports = i8(66009); + }, 46627: (e11, t9, i8) => { + "use strict"; + e11.exports = i8(89617); + }, 57326: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(78554), o7 = i8(47604); + e11.exports = function(e12) { + if (void 0 === e12) + return false; + if (!o7(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return !(!r8(e12, "[[Value]]") && !r8(e12, "[[Writable]]")); + }; + }, 11482: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = n8("%Object.preventExtensions%", true), o7 = n8("%Object.isExtensible%", true), s7 = i8(8809); + e11.exports = r8 ? function(e12) { + return !s7(e12) && o7(e12); + } : function(e12) { + return !s7(e12); + }; + }, 4579: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(67093), o7 = i8(57326), s7 = i8(47604); + e11.exports = function(e12) { + if (void 0 === e12) + return false; + if (!s7(e12)) + throw new n8("Assertion failed: `Desc` must be a Property Descriptor"); + return !r8(e12) && !o7(e12); + }; + }, 52731: (e11) => { + "use strict"; + e11.exports = function(e12) { + return "string" == typeof e12 || "symbol" == typeof e12; + }; + }, 158: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(52903), o7 = i8(64124), s7 = i8(52795); + e11.exports = function(e12) { + if ("Object" !== s7(e12)) + throw new n8("Assertion failed: Type(iterResult) is not Object"); + return o7(r8(e12, "done")); + }; + }, 24600: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(53347), o7 = i8(52795), s7 = i8(66381); + e11.exports = function(e12) { + if (!s7(e12)) + throw new n8("Assertion failed: `iteratorRecord` must be an Iterator Record"); + var t10; + if (t10 = arguments.length < 2 ? r8(e12["[[NextMethod]]"], e12["[[Iterator]]"]) : r8(e12["[[NextMethod]]"], e12["[[Iterator]]"], [arguments[1]]), "Object" !== o7(t10)) + throw new n8("iterator next must return an object"); + return t10; + }; + }, 37259: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(158), o7 = i8(24600), s7 = i8(66381); + e11.exports = function(e12) { + if (!s7(e12)) + throw new n8("Assertion failed: `iteratorRecord` must be an Iterator Record"); + var t10 = o7(e12); + return true !== r8(t10) && t10; + }; + }, 51192: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(79818)("Array.prototype.push"), o7 = i8(37259), s7 = i8(56188), a7 = i8(66381); + e11.exports = function(e12) { + if (!a7(e12)) + throw new n8("Assertion failed: `iteratorRecord` must be an Iterator Record"); + for (var t10 = [], i9 = true; i9; ) + if (i9 = o7(e12)) { + var p7 = s7(i9); + r8(t10, p7); + } + return t10; + }; + }, 56188: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(52903), o7 = i8(52795); + e11.exports = function(e12) { + if ("Object" !== o7(e12)) + throw new n8("Assertion failed: Type(iterResult) is not Object"); + return r8(e12, "value"); + }; + }, 35521: (e11, t9, i8) => { + "use strict"; + var n8 = i8(69336), r8 = i8(5731), o7 = i8(3468), s7 = i8(47604), a7 = i8(67093), p7 = i8(11482), c7 = i8(52731), d7 = i8(45722), f8 = i8(11328), l7 = i8(52795), u7 = i8(85442); + e11.exports = function(e12, t10, i9) { + if ("Object" !== l7(e12)) + throw new o7("Assertion failed: O must be an Object"); + if (!c7(t10)) + throw new o7("Assertion failed: P must be a Property Key"); + if (!s7(i9)) + throw new o7("Assertion failed: Desc must be a Property Descriptor"); + if (!n8) { + if (a7(i9)) + throw new r8("This environment does not support accessor property descriptors."); + var m7 = !(t10 in e12) && i9["[[Writable]]"] && i9["[[Enumerable]]"] && i9["[[Configurable]]"] && "[[Value]]" in i9, h8 = t10 in e12 && (!("[[Configurable]]" in i9) || i9["[[Configurable]]"]) && (!("[[Enumerable]]" in i9) || i9["[[Enumerable]]"]) && (!("[[Writable]]" in i9) || i9["[[Writable]]"]) && "[[Value]]" in i9; + if (m7 || h8) + return e12[t10] = i9["[[Value]]"], f8(e12[t10], i9["[[Value]]"]); + throw new r8("This environment does not support defining non-writable, non-enumerable, or non-configurable properties"); + } + var y7 = n8(e12, t10), g7 = y7 && d7(y7), b8 = p7(e12); + return u7(e12, t10, b8, i9, g7); + }; + }, 11246: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(49944), o7 = i8(52795); + e11.exports = function(e12) { + if ("Object" !== o7(e12)) + throw new n8("Assertion failed: O must be an Object"); + if (!r8) + throw new n8("This environment does not support fetching prototypes."); + return r8(e12); + }; + }, 77394: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Object.create%", true), r8 = i8(3468), o7 = i8(5731), s7 = i8(80234), a7 = i8(52795), p7 = i8(90626), c7 = i8(66986), d7 = i8(66869)(); + e11.exports = function(e12) { + if (null !== e12 && "Object" !== a7(e12)) + throw new r8("Assertion failed: `proto` must be null or an object"); + var t10, i9 = arguments.length < 2 ? [] : arguments[1]; + if (!s7(i9)) + throw new r8("Assertion failed: `additionalInternalSlotsList` must be an Array"); + if (n8) + t10 = n8(e12); + else if (d7) + t10 = { __proto__: e12 }; + else { + if (null === e12) + throw new o7("native Object.create support is required to create null objects"); + var f8 = function() { + }; + f8.prototype = e12, t10 = new f8(); + } + return i9.length > 0 && p7(i9, function(e13) { + c7.set(t10, e13, void 0); + }), t10; + }; + }, 29954: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(64116), o7 = i8(11246); + e11.exports = function(e12, t10) { + if ("object" != typeof t10) + throw new n8("Assertion failed: V must be Object or Null"); + try { + r8(e12, t10); + } catch (e13) { + return false; + } + return o7(e12) === t10; + }; + }, 69896: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(28498), o7 = i8(5731), s7 = n8("%Promise.resolve%", true), a7 = s7 && r8(s7); + e11.exports = function(e12, t10) { + if (!a7) + throw new o7("This environment does not support Promises."); + return a7(e12, t10); + }; + }, 11328: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41445); + e11.exports = function(e12, t10) { + return e12 === t10 ? 0 !== e12 || 1 / e12 == 1 / t10 : n8(e12) && n8(t10); + }; + }, 64124: (e11) => { + "use strict"; + e11.exports = function(e12) { + return !!e12; + }; + }, 45722: (e11, t9, i8) => { + "use strict"; + var n8 = i8(78554), r8 = i8(3468), o7 = i8(52795), s7 = i8(64124), a7 = i8(46627); + e11.exports = function(e12) { + if ("Object" !== o7(e12)) + throw new r8("ToPropertyDescriptor requires an object"); + var t10 = {}; + if (n8(e12, "enumerable") && (t10["[[Enumerable]]"] = s7(e12.enumerable)), n8(e12, "configurable") && (t10["[[Configurable]]"] = s7(e12.configurable)), n8(e12, "value") && (t10["[[Value]]"] = e12.value), n8(e12, "writable") && (t10["[[Writable]]"] = s7(e12.writable)), n8(e12, "get")) { + var i9 = e12.get; + if (void 0 !== i9 && !a7(i9)) + throw new r8("getter must be a function"); + t10["[[Get]]"] = i9; + } + if (n8(e12, "set")) { + var p7 = e12.set; + if (void 0 !== p7 && !a7(p7)) + throw new r8("setter must be a function"); + t10["[[Set]]"] = p7; + } + if ((n8(t10, "[[Get]]") || n8(t10, "[[Set]]")) && (n8(t10, "[[Value]]") || n8(t10, "[[Writable]]"))) + throw new r8("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute"); + return t10; + }; + }, 52795: (e11, t9, i8) => { + "use strict"; + var n8 = i8(61216); + e11.exports = function(e12) { + return "symbol" == typeof e12 ? "Symbol" : "bigint" == typeof e12 ? "BigInt" : n8(e12); + }; + }, 79041: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = i8(3468), o7 = n8("%String.fromCharCode%"), s7 = i8(91318), a7 = i8(86186); + e11.exports = function(e12, t10) { + if (!s7(e12) || !a7(t10)) + throw new r8("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code"); + return o7(e12) + o7(t10); + }; + }, 85442: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(20700), o7 = i8(49040), s7 = i8(47604), a7 = i8(84063), p7 = i8(67093), c7 = i8(57326), d7 = i8(4579), f8 = i8(52731), l7 = i8(11328), u7 = i8(52795); + e11.exports = function(e12, t10, i9, m7, h8) { + var y7, g7, b8 = u7(e12); + if ("Undefined" !== b8 && "Object" !== b8) + throw new n8("Assertion failed: O must be undefined or an Object"); + if (!f8(t10)) + throw new n8("Assertion failed: P must be a Property Key"); + if ("boolean" != typeof i9) + throw new n8("Assertion failed: extensible must be a Boolean"); + if (!s7(m7)) + throw new n8("Assertion failed: Desc must be a Property Descriptor"); + if (void 0 !== h8 && !s7(h8)) + throw new n8("Assertion failed: current must be a Property Descriptor, or undefined"); + if (void 0 === h8) + return !!i9 && ("Undefined" === b8 || (p7(m7) ? r8(c7, l7, a7, e12, t10, m7) : r8(c7, l7, a7, e12, t10, { "[[Configurable]]": !!m7["[[Configurable]]"], "[[Enumerable]]": !!m7["[[Enumerable]]"], "[[Value]]": m7["[[Value]]"], "[[Writable]]": !!m7["[[Writable]]"] }))); + if (!o7({ IsAccessorDescriptor: p7, IsDataDescriptor: c7 }, h8)) + throw new n8("`current`, when present, must be a fully populated and valid Property Descriptor"); + if (!h8["[[Configurable]]"]) { + if ("[[Configurable]]" in m7 && m7["[[Configurable]]"]) + return false; + if ("[[Enumerable]]" in m7 && !l7(m7["[[Enumerable]]"], h8["[[Enumerable]]"])) + return false; + if (!d7(m7) && !l7(p7(m7), p7(h8))) + return false; + if (p7(h8)) { + if ("[[Get]]" in m7 && !l7(m7["[[Get]]"], h8["[[Get]]"])) + return false; + if ("[[Set]]" in m7 && !l7(m7["[[Set]]"], h8["[[Set]]"])) + return false; + } else if (!h8["[[Writable]]"]) { + if ("[[Writable]]" in m7 && m7["[[Writable]]"]) + return false; + if ("[[Value]]" in m7 && !l7(m7["[[Value]]"], h8["[[Value]]"])) + return false; + } + } + return "Undefined" === b8 || (c7(h8) && p7(m7) ? (y7 = ("[[Configurable]]" in m7 ? m7 : h8)["[[Configurable]]"], g7 = ("[[Enumerable]]" in m7 ? m7 : h8)["[[Enumerable]]"], r8(c7, l7, a7, e12, t10, { "[[Configurable]]": !!y7, "[[Enumerable]]": !!g7, "[[Get]]": ("[[Get]]" in m7 ? m7 : h8)["[[Get]]"], "[[Set]]": ("[[Set]]" in m7 ? m7 : h8)["[[Set]]"] })) : p7(h8) && c7(m7) ? (y7 = ("[[Configurable]]" in m7 ? m7 : h8)["[[Configurable]]"], g7 = ("[[Enumerable]]" in m7 ? m7 : h8)["[[Enumerable]]"], r8(c7, l7, a7, e12, t10, { "[[Configurable]]": !!y7, "[[Enumerable]]": !!g7, "[[Value]]": ("[[Value]]" in m7 ? m7 : h8)["[[Value]]"], "[[Writable]]": !!("[[Writable]]" in m7 ? m7 : h8)["[[Writable]]"] })) : r8(c7, l7, a7, e12, t10, m7)); + }; + }, 61216: (e11) => { + "use strict"; + e11.exports = function(e12) { + return null === e12 ? "Null" : void 0 === e12 ? "Undefined" : "function" == typeof e12 || "object" == typeof e12 ? "Object" : "number" == typeof e12 ? "Number" : "boolean" == typeof e12 ? "Boolean" : "string" == typeof e12 ? "String" : void 0; + }; + }, 20700: (e11, t9, i8) => { + "use strict"; + var n8 = i8(17239), r8 = i8(64940), o7 = n8.hasArrayLengthDefineBug(), s7 = o7 && i8(66009), a7 = i8(79818)("Object.prototype.propertyIsEnumerable"); + e11.exports = function(e12, t10, i9, n9, p7, c7) { + if (!r8) { + if (!e12(c7)) + return false; + if (!c7["[[Configurable]]"] || !c7["[[Writable]]"]) + return false; + if (p7 in n9 && a7(n9, p7) !== !!c7["[[Enumerable]]"]) + return false; + var d7 = c7["[[Value]]"]; + return n9[p7] = d7, t10(n9[p7], d7); + } + return o7 && "length" === p7 && "[[Value]]" in c7 && s7(n9) && n9.length !== c7["[[Value]]"] ? (n9.length = c7["[[Value]]"], n9.length === c7["[[Value]]"]) : (r8(n9, p7, i9(c7)), true); + }; + }, 66009: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Array%"), r8 = !n8.isArray && i8(79818)("Object.prototype.toString"); + e11.exports = n8.isArray || function(e12) { + return "[object Array]" === r8(e12); + }; + }, 90626: (e11) => { + "use strict"; + e11.exports = function(e12, t9) { + for (var i8 = 0; i8 < e12.length; i8 += 1) + t9(e12[i8], i8, e12); + }; + }, 290: (e11) => { + "use strict"; + e11.exports = function(e12) { + if (void 0 === e12) + return e12; + var t9 = {}; + return "[[Value]]" in e12 && (t9.value = e12["[[Value]]"]), "[[Writable]]" in e12 && (t9.writable = !!e12["[[Writable]]"]), "[[Get]]" in e12 && (t9.get = e12["[[Get]]"]), "[[Set]]" in e12 && (t9.set = e12["[[Set]]"]), "[[Enumerable]]" in e12 && (t9.enumerable = !!e12["[[Enumerable]]"]), "[[Configurable]]" in e12 && (t9.configurable = !!e12["[[Configurable]]"]), t9; + }; + }, 76959: (e11, t9, i8) => { + "use strict"; + var n8 = i8(53558)(), r8 = i8(528), o7 = i8(79818), s7 = i8(8120), a7 = r8("%Symbol.iterator%", true), p7 = o7("String.prototype.slice"), c7 = r8("%String%"); + e11.exports = function(e12, t10) { + var i9; + return n8 ? i9 = e12.GetMethod(t10, a7) : e12.IsArray(t10) ? i9 = function() { + var e13 = -1, t11 = this; + return { next: function() { + return { done: (e13 += 1) >= t11.length, value: t11[e13] }; + } }; + } : s7(t10) && (i9 = function() { + var i10 = 0; + return { next: function() { + var n9 = e12.AdvanceStringIndex(c7(t10), i10, true), r9 = p7(t10, i10, n9); + return i10 = n9, { done: n9 > t10.length, value: r9 }; + } }; + }), i9; + }; + }, 49944: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Object.getPrototypeOf%", true), r8 = i8(66869)(); + e11.exports = n8 || (r8 ? function(e12) { + return e12.__proto__; + } : null); + }, 27185: (e11, t9, i8) => { + "use strict"; + var n8 = i8(41445); + e11.exports = function(e12) { + return ("number" == typeof e12 || "bigint" == typeof e12) && !n8(e12) && e12 !== 1 / 0 && e12 !== -1 / 0; + }; + }, 49040: (e11, t9, i8) => { + "use strict"; + var n8 = i8(47604); + e11.exports = function(e12, t10) { + return n8(t10) && "object" == typeof t10 && "[[Enumerable]]" in t10 && "[[Configurable]]" in t10 && (e12.IsAccessorDescriptor(t10) || e12.IsDataDescriptor(t10)); + }; + }, 76982: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528), r8 = n8("%Math.abs%"), o7 = n8("%Math.floor%"), s7 = i8(41445), a7 = i8(27185); + e11.exports = function(e12) { + if ("number" != typeof e12 || s7(e12) || !a7(e12)) + return false; + var t10 = r8(e12); + return o7(t10) === t10; + }; + }, 91318: (e11) => { + "use strict"; + e11.exports = function(e12) { + return "number" == typeof e12 && e12 >= 55296 && e12 <= 56319; + }; + }, 41445: (e11) => { + "use strict"; + e11.exports = Number.isNaN || function(e12) { + return e12 != e12; + }; + }, 8809: (e11) => { + "use strict"; + e11.exports = function(e12) { + return null === e12 || "function" != typeof e12 && "object" != typeof e12; + }; + }, 86186: (e11) => { + "use strict"; + e11.exports = function(e12) { + return "number" == typeof e12 && e12 >= 56320 && e12 <= 57343; + }; + }, 2625: (e11) => { + "use strict"; + e11.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; + }, 66381: (e11, t9, i8) => { + "use strict"; + var n8 = i8(78554); + e11.exports = function(e12) { + return !!e12 && "object" == typeof e12 && n8(e12, "[[Iterator]]") && n8(e12, "[[NextMethod]]") && "function" == typeof e12["[[NextMethod]]"] && n8(e12, "[[Done]]") && "boolean" == typeof e12["[[Done]]"]; + }; + }, 47604: (e11, t9, i8) => { + "use strict"; + var n8 = i8(3468), r8 = i8(78554), o7 = { __proto__: null, "[[Configurable]]": true, "[[Enumerable]]": true, "[[Get]]": true, "[[Set]]": true, "[[Value]]": true, "[[Writable]]": true }; + e11.exports = function(e12) { + if (!e12 || "object" != typeof e12) + return false; + for (var t10 in e12) + if (r8(e12, t10) && !o7[t10]) + return false; + var i9 = r8(e12, "[[Value]]") || r8(e12, "[[Writable]]"), s7 = r8(e12, "[[Get]]") || r8(e12, "[[Set]]"); + if (i9 && s7) + throw new n8("Property Descriptors may not be both accessor and data descriptors"); + return true; + }; + }, 64116: (e11, t9, i8) => { + "use strict"; + var n8 = i8(528)("%Object.setPrototypeOf%", true), r8 = i8(66869)(); + e11.exports = n8 || (r8 ? function(e12, t10) { + return e12.__proto__ = t10, e12; + } : null); + }, 84800: (e11, t9, i8) => { + "use strict"; + const { normalizeIPv6: n8, normalizeIPv4: r8, removeDotSegments: o7, recomposeAuthority: s7, normalizeComponentEncoding: a7 } = i8(75365), p7 = i8(13956); + function c7(e12, t10, i9, n9) { + const r9 = {}; + return n9 || (e12 = u7(d7(e12, i9), i9), t10 = u7(d7(t10, i9), i9)), !(i9 = i9 || {}).tolerant && t10.scheme ? (r9.scheme = t10.scheme, r9.userinfo = t10.userinfo, r9.host = t10.host, r9.port = t10.port, r9.path = o7(t10.path || ""), r9.query = t10.query) : (void 0 !== t10.userinfo || void 0 !== t10.host || void 0 !== t10.port ? (r9.userinfo = t10.userinfo, r9.host = t10.host, r9.port = t10.port, r9.path = o7(t10.path || ""), r9.query = t10.query) : (t10.path ? ("/" === t10.path.charAt(0) ? r9.path = o7(t10.path) : (void 0 === e12.userinfo && void 0 === e12.host && void 0 === e12.port || e12.path ? e12.path ? r9.path = e12.path.slice(0, e12.path.lastIndexOf("/") + 1) + t10.path : r9.path = t10.path : r9.path = "/" + t10.path, r9.path = o7(r9.path)), r9.query = t10.query) : (r9.path = e12.path, void 0 !== t10.query ? r9.query = t10.query : r9.query = e12.query), r9.userinfo = e12.userinfo, r9.host = e12.host, r9.port = e12.port), r9.scheme = e12.scheme), r9.fragment = t10.fragment, r9; + } + function d7(e12, t10) { + const i9 = { host: e12.host, scheme: e12.scheme, userinfo: e12.userinfo, port: e12.port, path: e12.path, query: e12.query, nid: e12.nid, nss: e12.nss, uuid: e12.uuid, fragment: e12.fragment, reference: e12.reference, resourceName: e12.resourceName, secure: e12.secure, error: "" }, n9 = Object.assign({}, t10), r9 = [], a8 = p7[(n9.scheme || i9.scheme || "").toLowerCase()]; + a8 && a8.serialize && a8.serialize(i9, n9), void 0 !== i9.path && (n9.skipEscape ? i9.path = unescape(i9.path) : (i9.path = escape(i9.path), void 0 !== i9.scheme && (i9.path = i9.path.split("%3A").join(":")))), "suffix" !== n9.reference && i9.scheme && (r9.push(i9.scheme), r9.push(":")); + const c8 = s7(i9, n9); + if (void 0 !== c8 && ("suffix" !== n9.reference && r9.push("//"), r9.push(c8), i9.path && "/" !== i9.path.charAt(0) && r9.push("/")), void 0 !== i9.path) { + let e13 = i9.path; + n9.absolutePath || a8 && a8.absolutePath || (e13 = o7(e13)), void 0 === c8 && (e13 = e13.replace(/^\/\//u, "/%2F")), r9.push(e13); + } + return void 0 !== i9.query && (r9.push("?"), r9.push(i9.query)), void 0 !== i9.fragment && (r9.push("#"), r9.push(i9.fragment)), r9.join(""); + } + const f8 = Array.from({ length: 127 }, (e12, t10) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t10))), l7 = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; + function u7(e12, t10) { + const i9 = Object.assign({}, t10), o8 = { scheme: void 0, userinfo: void 0, host: "", port: void 0, path: "", query: void 0, fragment: void 0 }, s8 = -1 !== e12.indexOf("%"); + let a8 = false; + "suffix" === i9.reference && (e12 = (i9.scheme ? i9.scheme + ":" : "") + "//" + e12); + const c8 = e12.match(l7); + if (c8) { + if (o8.scheme = c8[1], o8.userinfo = c8[3], o8.host = c8[4], o8.port = parseInt(c8[5], 10), o8.path = c8[6] || "", o8.query = c8[7], o8.fragment = c8[8], isNaN(o8.port) && (o8.port = c8[5]), o8.host) { + const e14 = r8(o8.host); + if (false === e14.isIPV4) { + const t11 = n8(e14.host, { isIPV4: false }); + o8.host = t11.host.toLowerCase(), a8 = t11.isIPV6; + } else + o8.host = e14.host, a8 = true; + } + void 0 !== o8.scheme || void 0 !== o8.userinfo || void 0 !== o8.host || void 0 !== o8.port || o8.path || void 0 !== o8.query ? void 0 === o8.scheme ? o8.reference = "relative" : void 0 === o8.fragment ? o8.reference = "absolute" : o8.reference = "uri" : o8.reference = "same-document", i9.reference && "suffix" !== i9.reference && i9.reference !== o8.reference && (o8.error = o8.error || "URI is not a " + i9.reference + " reference."); + const e13 = p7[(i9.scheme || o8.scheme || "").toLowerCase()]; + if (!(i9.unicodeSupport || e13 && e13.unicodeSupport) && o8.host && (i9.domainHost || e13 && e13.domainHost) && false === a8 && function(e14) { + let t11 = 0; + for (let i10 = 0, n9 = e14.length; i10 < n9; ++i10) + if (t11 = e14.charCodeAt(i10), t11 > 126 || f8[t11]) + return true; + return false; + }(o8.host)) + try { + o8.host = URL.domainToASCII(o8.host.toLowerCase()); + } catch (e14) { + o8.error = o8.error || "Host's domain name can not be converted to ASCII: " + e14; + } + (!e13 || e13 && !e13.skipNormalize) && (s8 && void 0 !== o8.scheme && (o8.scheme = unescape(o8.scheme)), s8 && void 0 !== o8.userinfo && (o8.userinfo = unescape(o8.userinfo)), s8 && void 0 !== o8.host && (o8.host = unescape(o8.host)), void 0 !== o8.path && o8.path.length && (o8.path = escape(unescape(o8.path))), void 0 !== o8.fragment && o8.fragment.length && (o8.fragment = encodeURI(decodeURIComponent(o8.fragment)))), e13 && e13.parse && e13.parse(o8, i9); + } else + o8.error = o8.error || "URI can not be parsed."; + return o8; + } + const m7 = { SCHEMES: p7, normalize: function(e12, t10) { + return "string" == typeof e12 ? e12 = d7(u7(e12, t10), t10) : "object" == typeof e12 && (e12 = u7(d7(e12, t10), t10)), e12; + }, resolve: function(e12, t10, i9) { + const n9 = Object.assign({ scheme: "null" }, i9); + return d7(c7(u7(e12, n9), u7(t10, n9), n9, true), { ...n9, skipEscape: true }); + }, resolveComponents: c7, equal: function(e12, t10, i9) { + return "string" == typeof e12 ? (e12 = unescape(e12), e12 = d7(a7(u7(e12, i9), true), { ...i9, skipEscape: true })) : "object" == typeof e12 && (e12 = d7(a7(e12, true), { ...i9, skipEscape: true })), "string" == typeof t10 ? (t10 = unescape(t10), t10 = d7(a7(u7(t10, i9), true), { ...i9, skipEscape: true })) : "object" == typeof t10 && (t10 = d7(a7(t10, true), { ...i9, skipEscape: true })), e12.toLowerCase() === t10.toLowerCase(); + }, serialize: d7, parse: u7 }; + e11.exports = m7, e11.exports.default = m7, e11.exports.fastUri = m7; + }, 13956: (e11) => { + "use strict"; + const t9 = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu, i8 = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; + function n8(e12) { + return "boolean" == typeof e12.secure ? e12.secure : "wss" === String(e12.scheme).toLowerCase(); + } + function r8(e12) { + return e12.host || (e12.error = e12.error || "HTTP URIs must have a host."), e12; + } + function o7(e12) { + const t10 = "https" === String(e12.scheme).toLowerCase(); + return e12.port !== (t10 ? 443 : 80) && "" !== e12.port || (e12.port = void 0), e12.path || (e12.path = "/"), e12; + } + const s7 = { scheme: "http", domainHost: true, parse: r8, serialize: o7 }, a7 = { scheme: "ws", domainHost: true, parse: function(e12) { + return e12.secure = n8(e12), e12.resourceName = (e12.path || "/") + (e12.query ? "?" + e12.query : ""), e12.path = void 0, e12.query = void 0, e12; + }, serialize: function(e12) { + if (e12.port !== (n8(e12) ? 443 : 80) && "" !== e12.port || (e12.port = void 0), "boolean" == typeof e12.secure && (e12.scheme = e12.secure ? "wss" : "ws", e12.secure = void 0), e12.resourceName) { + const [t10, i9] = e12.resourceName.split("?"); + e12.path = t10 && "/" !== t10 ? t10 : void 0, e12.query = i9, e12.resourceName = void 0; + } + return e12.fragment = void 0, e12; + } }, p7 = { http: s7, https: { scheme: "https", domainHost: s7.domainHost, parse: r8, serialize: o7 }, ws: a7, wss: { scheme: "wss", domainHost: a7.domainHost, parse: a7.parse, serialize: a7.serialize }, urn: { scheme: "urn", parse: function(e12, t10) { + if (!e12.path) + return e12.error = "URN can not be parsed", e12; + const n9 = e12.path.match(i8); + if (n9) { + const i9 = t10.scheme || e12.scheme || "urn"; + e12.nid = n9[1].toLowerCase(), e12.nss = n9[2]; + const r9 = `${i9}:${t10.nid || e12.nid}`, o8 = p7[r9]; + e12.path = void 0, o8 && (e12 = o8.parse(e12, t10)); + } else + e12.error = e12.error || "URN can not be parsed."; + return e12; + }, serialize: function(e12, t10) { + const i9 = t10.scheme || e12.scheme || "urn", n9 = e12.nid.toLowerCase(), r9 = `${i9}:${t10.nid || n9}`, o8 = p7[r9]; + o8 && (e12 = o8.serialize(e12, t10)); + const s8 = e12, a8 = e12.nss; + return s8.path = `${n9 || t10.nid}:${a8}`, t10.skipEscape = true, s8; + }, skipNormalize: true }, "urn:uuid": { scheme: "urn:uuid", parse: function(e12, i9) { + const n9 = e12; + return n9.uuid = n9.nss, n9.nss = void 0, i9.tolerant || n9.uuid && t9.test(n9.uuid) || (n9.error = n9.error || "UUID is not valid."), n9; + }, serialize: function(e12) { + const t10 = e12; + return t10.nss = (e12.uuid || "").toLowerCase(), t10; + }, skipNormalize: true } }; + e11.exports = p7; + }, 5073: (e11) => { + "use strict"; + e11.exports = { HEX: { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, a: 10, A: 10, b: 11, B: 11, c: 12, C: 12, d: 13, D: 13, e: 14, E: 14, f: 15, F: 15 } }; + }, 75365: (e11, t9, i8) => { + "use strict"; + const { HEX: n8 } = i8(5073); + function r8(e12) { + if (p7(e12, ".") < 3) + return { host: e12, isIPV4: false }; + const t10 = e12.match(/^(?:(?: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])$/u) || [], [i9] = t10; + return i9 ? { host: a7(i9, "."), isIPV4: true } : { host: e12, isIPV4: false }; + } + function o7(e12, t10 = false) { + let i9 = "", r9 = true; + for (const t11 of e12) { + if (void 0 === n8[t11]) + return; + "0" !== t11 && true === r9 && (r9 = false), r9 || (i9 += t11); + } + return t10 && 0 === i9.length && (i9 = "0"), i9; + } + function s7(e12, t10 = {}) { + if (p7(e12, ":") < 2) + return { host: e12, isIPV6: false }; + const i9 = function(e13) { + let t11 = 0; + const i10 = { error: false, address: "", zone: "" }, n9 = [], r9 = []; + let s8 = false, a8 = false, p8 = false; + function c8() { + if (r9.length) { + if (false === s8) { + const e14 = o7(r9); + if (void 0 === e14) + return i10.error = true, false; + n9.push(e14); + } + r9.length = 0; + } + return true; + } + for (let o8 = 0; o8 < e13.length; o8++) { + const d8 = e13[o8]; + if ("[" !== d8 && "]" !== d8) + if (":" !== d8) + if ("%" === d8) { + if (!c8()) + break; + s8 = true; + } else + r9.push(d8); + else { + if (true === a8 && (p8 = true), !c8()) + break; + if (t11++, n9.push(":"), t11 > 7) { + i10.error = true; + break; + } + o8 - 1 >= 0 && ":" === e13[o8 - 1] && (a8 = true); + } + } + return r9.length && (s8 ? i10.zone = r9.join("") : p8 ? n9.push(r9.join("")) : n9.push(o7(r9))), i10.address = n9.join(""), i10; + }(e12); + if (i9.error) + return { host: e12, isIPV6: false }; + { + let e13 = i9.address, t11 = i9.address; + return i9.zone && (e13 += "%" + i9.zone, t11 += "%25" + i9.zone), { host: e13, escapedHost: t11, isIPV6: true }; + } + } + function a7(e12, t10) { + let i9 = "", n9 = true; + const r9 = e12.length; + for (let o8 = 0; o8 < r9; o8++) { + const s8 = e12[o8]; + "0" === s8 && n9 ? (o8 + 1 <= r9 && e12[o8 + 1] === t10 || o8 + 1 === r9) && (i9 += s8, n9 = false) : (n9 = s8 === t10, i9 += s8); + } + return i9; + } + function p7(e12, t10) { + let i9 = 0; + for (let n9 = 0; n9 < e12.length; n9++) + e12[n9] === t10 && i9++; + return i9; + } + const c7 = /^\.\.?\//u, d7 = /^\/\.(?:\/|$)/u, f8 = /^\/\.\.(?:\/|$)/u, l7 = /^\/?(?:.|\n)*?(?=\/|$)/u; + e11.exports = { recomposeAuthority: function(e12, t10) { + const i9 = []; + if (void 0 !== e12.userinfo && (i9.push(e12.userinfo), i9.push("@")), void 0 !== e12.host) { + let t11 = unescape(e12.host); + const n9 = r8(t11); + if (n9.isIPV4) + t11 = n9.host; + else { + const i10 = s7(n9.host, { isIPV4: false }); + t11 = true === i10.isIPV6 ? `[${i10.escapedHost}]` : e12.host; + } + i9.push(t11); + } + return "number" != typeof e12.port && "string" != typeof e12.port || (i9.push(":"), i9.push(String(e12.port))), i9.length ? i9.join("") : void 0; + }, normalizeComponentEncoding: function(e12, t10) { + const i9 = true !== t10 ? escape : unescape; + return void 0 !== e12.scheme && (e12.scheme = i9(e12.scheme)), void 0 !== e12.userinfo && (e12.userinfo = i9(e12.userinfo)), void 0 !== e12.host && (e12.host = i9(e12.host)), void 0 !== e12.path && (e12.path = i9(e12.path)), void 0 !== e12.query && (e12.query = i9(e12.query)), void 0 !== e12.fragment && (e12.fragment = i9(e12.fragment)), e12; + }, removeDotSegments: function(e12) { + const t10 = []; + for (; e12.length; ) + if (e12.match(c7)) + e12 = e12.replace(c7, ""); + else if (e12.match(d7)) + e12 = e12.replace(d7, "/"); + else if (e12.match(f8)) + e12 = e12.replace(f8, "/"), t10.pop(); + else if ("." === e12 || ".." === e12) + e12 = ""; + else { + const i9 = e12.match(l7); + if (!i9) + throw new Error("Unexpected dot segment condition"); + { + const n9 = i9[0]; + e12 = e12.slice(n9.length), t10.push(n9); + } + } + return t10.join(""); + }, normalizeIPv4: r8, normalizeIPv6: s7, stringArrayToHexStripped: o7 }; + }, 17547: (e11) => { + "use strict"; + class t9 { + static get version() { + return "1.3.9"; + } + static toString() { + return "JavaScript Expression Parser (JSEP) v" + t9.version; + } + static addUnaryOp(e12) { + return t9.max_unop_len = Math.max(e12.length, t9.max_unop_len), t9.unary_ops[e12] = 1, t9; + } + static addBinaryOp(e12, i9, n9) { + return t9.max_binop_len = Math.max(e12.length, t9.max_binop_len), t9.binary_ops[e12] = i9, n9 ? t9.right_associative.add(e12) : t9.right_associative.delete(e12), t9; + } + static addIdentifierChar(e12) { + return t9.additional_identifier_chars.add(e12), t9; + } + static addLiteral(e12, i9) { + return t9.literals[e12] = i9, t9; + } + static removeUnaryOp(e12) { + return delete t9.unary_ops[e12], e12.length === t9.max_unop_len && (t9.max_unop_len = t9.getMaxKeyLen(t9.unary_ops)), t9; + } + static removeAllUnaryOps() { + return t9.unary_ops = {}, t9.max_unop_len = 0, t9; + } + static removeIdentifierChar(e12) { + return t9.additional_identifier_chars.delete(e12), t9; + } + static removeBinaryOp(e12) { + return delete t9.binary_ops[e12], e12.length === t9.max_binop_len && (t9.max_binop_len = t9.getMaxKeyLen(t9.binary_ops)), t9.right_associative.delete(e12), t9; + } + static removeAllBinaryOps() { + return t9.binary_ops = {}, t9.max_binop_len = 0, t9; + } + static removeLiteral(e12) { + return delete t9.literals[e12], t9; + } + static removeAllLiterals() { + return t9.literals = {}, t9; + } + get char() { + return this.expr.charAt(this.index); + } + get code() { + return this.expr.charCodeAt(this.index); + } + constructor(e12) { + this.expr = e12, this.index = 0; + } + static parse(e12) { + return new t9(e12).parse(); + } + static getMaxKeyLen(e12) { + return Math.max(0, ...Object.keys(e12).map((e13) => e13.length)); + } + static isDecimalDigit(e12) { + return e12 >= 48 && e12 <= 57; + } + static binaryPrecedence(e12) { + return t9.binary_ops[e12] || 0; + } + static isIdentifierStart(e12) { + return e12 >= 65 && e12 <= 90 || e12 >= 97 && e12 <= 122 || e12 >= 128 && !t9.binary_ops[String.fromCharCode(e12)] || t9.additional_identifier_chars.has(String.fromCharCode(e12)); + } + static isIdentifierPart(e12) { + return t9.isIdentifierStart(e12) || t9.isDecimalDigit(e12); + } + throwError(e12) { + const t10 = new Error(e12 + " at character " + this.index); + throw t10.index = this.index, t10.description = e12, t10; + } + runHook(e12, i9) { + if (t9.hooks[e12]) { + const n9 = { context: this, node: i9 }; + return t9.hooks.run(e12, n9), n9.node; + } + return i9; + } + searchHook(e12) { + if (t9.hooks[e12]) { + const i9 = { context: this }; + return t9.hooks[e12].find(function(e13) { + return e13.call(i9.context, i9), i9.node; + }), i9.node; + } + } + gobbleSpaces() { + let e12 = this.code; + for (; e12 === t9.SPACE_CODE || e12 === t9.TAB_CODE || e12 === t9.LF_CODE || e12 === t9.CR_CODE; ) + e12 = this.expr.charCodeAt(++this.index); + this.runHook("gobble-spaces"); + } + parse() { + this.runHook("before-all"); + const e12 = this.gobbleExpressions(), i9 = 1 === e12.length ? e12[0] : { type: t9.COMPOUND, body: e12 }; + return this.runHook("after-all", i9); + } + gobbleExpressions(e12) { + let i9, n9, r9 = []; + for (; this.index < this.expr.length; ) + if (i9 = this.code, i9 === t9.SEMCOL_CODE || i9 === t9.COMMA_CODE) + this.index++; + else if (n9 = this.gobbleExpression()) + r9.push(n9); + else if (this.index < this.expr.length) { + if (i9 === e12) + break; + this.throwError('Unexpected "' + this.char + '"'); + } + return r9; + } + gobbleExpression() { + const e12 = this.searchHook("gobble-expression") || this.gobbleBinaryExpression(); + return this.gobbleSpaces(), this.runHook("after-expression", e12); + } + gobbleBinaryOp() { + this.gobbleSpaces(); + let e12 = this.expr.substr(this.index, t9.max_binop_len), i9 = e12.length; + for (; i9 > 0; ) { + if (t9.binary_ops.hasOwnProperty(e12) && (!t9.isIdentifierStart(this.code) || this.index + e12.length < this.expr.length && !t9.isIdentifierPart(this.expr.charCodeAt(this.index + e12.length)))) + return this.index += i9, e12; + e12 = e12.substr(0, --i9); + } + return false; + } + gobbleBinaryExpression() { + let e12, i9, n9, r9, o8, s7, a7, p7, c7; + if (s7 = this.gobbleToken(), !s7) + return s7; + if (i9 = this.gobbleBinaryOp(), !i9) + return s7; + for (o8 = { value: i9, prec: t9.binaryPrecedence(i9), right_a: t9.right_associative.has(i9) }, a7 = this.gobbleToken(), a7 || this.throwError("Expected expression after " + i9), r9 = [s7, o8, a7]; i9 = this.gobbleBinaryOp(); ) { + if (n9 = t9.binaryPrecedence(i9), 0 === n9) { + this.index -= i9.length; + break; + } + o8 = { value: i9, prec: n9, right_a: t9.right_associative.has(i9) }, c7 = i9; + const p8 = (e13) => o8.right_a && e13.right_a ? n9 > e13.prec : n9 <= e13.prec; + for (; r9.length > 2 && p8(r9[r9.length - 2]); ) + a7 = r9.pop(), i9 = r9.pop().value, s7 = r9.pop(), e12 = { type: t9.BINARY_EXP, operator: i9, left: s7, right: a7 }, r9.push(e12); + e12 = this.gobbleToken(), e12 || this.throwError("Expected expression after " + c7), r9.push(o8, e12); + } + for (p7 = r9.length - 1, e12 = r9[p7]; p7 > 1; ) + e12 = { type: t9.BINARY_EXP, operator: r9[p7 - 1].value, left: r9[p7 - 2], right: e12 }, p7 -= 2; + return e12; + } + gobbleToken() { + let e12, i9, n9, r9; + if (this.gobbleSpaces(), r9 = this.searchHook("gobble-token"), r9) + return this.runHook("after-token", r9); + if (e12 = this.code, t9.isDecimalDigit(e12) || e12 === t9.PERIOD_CODE) + return this.gobbleNumericLiteral(); + if (e12 === t9.SQUOTE_CODE || e12 === t9.DQUOTE_CODE) + r9 = this.gobbleStringLiteral(); + else if (e12 === t9.OBRACK_CODE) + r9 = this.gobbleArray(); + else { + for (i9 = this.expr.substr(this.index, t9.max_unop_len), n9 = i9.length; n9 > 0; ) { + if (t9.unary_ops.hasOwnProperty(i9) && (!t9.isIdentifierStart(this.code) || this.index + i9.length < this.expr.length && !t9.isIdentifierPart(this.expr.charCodeAt(this.index + i9.length)))) { + this.index += n9; + const e13 = this.gobbleToken(); + return e13 || this.throwError("missing unaryOp argument"), this.runHook("after-token", { type: t9.UNARY_EXP, operator: i9, argument: e13, prefix: true }); + } + i9 = i9.substr(0, --n9); + } + t9.isIdentifierStart(e12) ? (r9 = this.gobbleIdentifier(), t9.literals.hasOwnProperty(r9.name) ? r9 = { type: t9.LITERAL, value: t9.literals[r9.name], raw: r9.name } : r9.name === t9.this_str && (r9 = { type: t9.THIS_EXP })) : e12 === t9.OPAREN_CODE && (r9 = this.gobbleGroup()); + } + return r9 ? (r9 = this.gobbleTokenProperty(r9), this.runHook("after-token", r9)) : this.runHook("after-token", false); + } + gobbleTokenProperty(e12) { + this.gobbleSpaces(); + let i9 = this.code; + for (; i9 === t9.PERIOD_CODE || i9 === t9.OBRACK_CODE || i9 === t9.OPAREN_CODE || i9 === t9.QUMARK_CODE; ) { + let n9; + if (i9 === t9.QUMARK_CODE) { + if (this.expr.charCodeAt(this.index + 1) !== t9.PERIOD_CODE) + break; + n9 = true, this.index += 2, this.gobbleSpaces(), i9 = this.code; + } + this.index++, i9 === t9.OBRACK_CODE ? ((e12 = { type: t9.MEMBER_EXP, computed: true, object: e12, property: this.gobbleExpression() }).property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), i9 = this.code, i9 !== t9.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : i9 === t9.OPAREN_CODE ? e12 = { type: t9.CALL_EXP, arguments: this.gobbleArguments(t9.CPAREN_CODE), callee: e12 } : (i9 === t9.PERIOD_CODE || n9) && (n9 && this.index--, this.gobbleSpaces(), e12 = { type: t9.MEMBER_EXP, computed: false, object: e12, property: this.gobbleIdentifier() }), n9 && (e12.optional = true), this.gobbleSpaces(), i9 = this.code; + } + return e12; + } + gobbleNumericLiteral() { + let e12, i9, n9 = ""; + for (; t9.isDecimalDigit(this.code); ) + n9 += this.expr.charAt(this.index++); + if (this.code === t9.PERIOD_CODE) + for (n9 += this.expr.charAt(this.index++); t9.isDecimalDigit(this.code); ) + n9 += this.expr.charAt(this.index++); + if (e12 = this.char, "e" === e12 || "E" === e12) { + for (n9 += this.expr.charAt(this.index++), e12 = this.char, "+" !== e12 && "-" !== e12 || (n9 += this.expr.charAt(this.index++)); t9.isDecimalDigit(this.code); ) + n9 += this.expr.charAt(this.index++); + t9.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + n9 + this.char + ")"); + } + return i9 = this.code, t9.isIdentifierStart(i9) ? this.throwError("Variable names cannot start with a number (" + n9 + this.char + ")") : (i9 === t9.PERIOD_CODE || 1 === n9.length && n9.charCodeAt(0) === t9.PERIOD_CODE) && this.throwError("Unexpected period"), { type: t9.LITERAL, value: parseFloat(n9), raw: n9 }; + } + gobbleStringLiteral() { + let e12 = ""; + const i9 = this.index, n9 = this.expr.charAt(this.index++); + let r9 = false; + for (; this.index < this.expr.length; ) { + let t10 = this.expr.charAt(this.index++); + if (t10 === n9) { + r9 = true; + break; + } + if ("\\" === t10) + switch (t10 = this.expr.charAt(this.index++), t10) { + case "n": + e12 += "\n"; + break; + case "r": + e12 += "\r"; + break; + case "t": + e12 += " "; + break; + case "b": + e12 += "\b"; + break; + case "f": + e12 += "\f"; + break; + case "v": + e12 += "\v"; + break; + default: + e12 += t10; + } + else + e12 += t10; + } + return r9 || this.throwError('Unclosed quote after "' + e12 + '"'), { type: t9.LITERAL, value: e12, raw: this.expr.substring(i9, this.index) }; + } + gobbleIdentifier() { + let e12 = this.code, i9 = this.index; + for (t9.isIdentifierStart(e12) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e12 = this.code, t9.isIdentifierPart(e12)); ) + this.index++; + return { type: t9.IDENTIFIER, name: this.expr.slice(i9, this.index) }; + } + gobbleArguments(e12) { + const i9 = []; + let n9 = false, r9 = 0; + for (; this.index < this.expr.length; ) { + this.gobbleSpaces(); + let o8 = this.code; + if (o8 === e12) { + n9 = true, this.index++, e12 === t9.CPAREN_CODE && r9 && r9 >= i9.length && this.throwError("Unexpected token " + String.fromCharCode(e12)); + break; + } + if (o8 === t9.COMMA_CODE) { + if (this.index++, r9++, r9 !== i9.length) { + if (e12 === t9.CPAREN_CODE) + this.throwError("Unexpected token ,"); + else if (e12 === t9.CBRACK_CODE) + for (let e13 = i9.length; e13 < r9; e13++) + i9.push(null); + } + } else if (i9.length !== r9 && 0 !== r9) + this.throwError("Expected comma"); + else { + const e13 = this.gobbleExpression(); + e13 && e13.type !== t9.COMPOUND || this.throwError("Expected comma"), i9.push(e13); + } + } + return n9 || this.throwError("Expected " + String.fromCharCode(e12)), i9; + } + gobbleGroup() { + this.index++; + let e12 = this.gobbleExpressions(t9.CPAREN_CODE); + if (this.code === t9.CPAREN_CODE) + return this.index++, 1 === e12.length ? e12[0] : !!e12.length && { type: t9.SEQUENCE_EXP, expressions: e12 }; + this.throwError("Unclosed ("); + } + gobbleArray() { + return this.index++, { type: t9.ARRAY_EXP, elements: this.gobbleArguments(t9.CBRACK_CODE) }; + } + } + const i8 = new class { + add(e12, t10, i9) { + if ("string" != typeof arguments[0]) + for (let e13 in arguments[0]) + this.add(e13, arguments[0][e13], arguments[1]); + else + (Array.isArray(e12) ? e12 : [e12]).forEach(function(e13) { + this[e13] = this[e13] || [], t10 && this[e13][i9 ? "unshift" : "push"](t10); + }, this); + } + run(e12, t10) { + this[e12] = this[e12] || [], this[e12].forEach(function(e13) { + e13.call(t10 && t10.context ? t10.context : t10, t10); + }); + } + }(); + Object.assign(t9, { hooks: i8, plugins: new class { + constructor(e12) { + this.jsep = e12, this.registered = {}; + } + register(...e12) { + e12.forEach((e13) => { + if ("object" != typeof e13 || !e13.name || !e13.init) + throw new Error("Invalid JSEP plugin format"); + this.registered[e13.name] || (e13.init(this.jsep), this.registered[e13.name] = e13); + }); + } + }(t9), COMPOUND: "Compound", SEQUENCE_EXP: "SequenceExpression", IDENTIFIER: "Identifier", MEMBER_EXP: "MemberExpression", LITERAL: "Literal", THIS_EXP: "ThisExpression", CALL_EXP: "CallExpression", UNARY_EXP: "UnaryExpression", BINARY_EXP: "BinaryExpression", ARRAY_EXP: "ArrayExpression", TAB_CODE: 9, LF_CODE: 10, CR_CODE: 13, SPACE_CODE: 32, PERIOD_CODE: 46, COMMA_CODE: 44, SQUOTE_CODE: 39, DQUOTE_CODE: 34, OPAREN_CODE: 40, CPAREN_CODE: 41, OBRACK_CODE: 91, CBRACK_CODE: 93, QUMARK_CODE: 63, SEMCOL_CODE: 59, COLON_CODE: 58, unary_ops: { "-": 1, "!": 1, "~": 1, "+": 1 }, binary_ops: { "||": 1, "&&": 2, "|": 3, "^": 4, "&": 5, "==": 6, "!=": 6, "===": 6, "!==": 6, "<": 7, ">": 7, "<=": 7, ">=": 7, "<<": 8, ">>": 8, ">>>": 8, "+": 9, "-": 9, "*": 10, "/": 10, "%": 10 }, right_associative: /* @__PURE__ */ new Set(), additional_identifier_chars: /* @__PURE__ */ new Set(["$", "_"]), literals: { true: true, false: false, null: null }, this_str: "this" }), t9.max_unop_len = t9.getMaxKeyLen(t9.unary_ops), t9.max_binop_len = t9.getMaxKeyLen(t9.binary_ops); + const n8 = (e12) => new t9(e12).parse(), r8 = Object.getOwnPropertyNames(class { + }); + Object.getOwnPropertyNames(t9).filter((e12) => !r8.includes(e12) && void 0 === n8[e12]).forEach((e12) => { + n8[e12] = t9[e12]; + }), n8.Jsep = t9; + var o7 = { name: "ternary", init(e12) { + e12.hooks.add("after-expression", function(t10) { + if (t10.node && this.code === e12.QUMARK_CODE) { + this.index++; + const i9 = t10.node, n9 = this.gobbleExpression(); + if (n9 || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === e12.COLON_CODE) { + this.index++; + const r9 = this.gobbleExpression(); + if (r9 || this.throwError("Expected expression"), t10.node = { type: "ConditionalExpression", test: i9, consequent: n9, alternate: r9 }, i9.operator && e12.binary_ops[i9.operator] <= 0.9) { + let n10 = i9; + for (; n10.right.operator && e12.binary_ops[n10.right.operator] <= 0.9; ) + n10 = n10.right; + t10.node.test = n10.right, n10.right = t10.node, t10.node = i9; + } + } else + this.throwError("Expected :"); + } + }); + } }; + n8.plugins.register(o7), e11.exports = n8; + }, 25568: (e11, t9) => { + "use strict"; + function i8(e12) { + return { type: "StringLiteral", value: e12 }; + } + function n8(e12) { + return { type: "BooleanLiteral", value: e12 }; + } + function r8(e12) { + return { type: "NumericLiteral", value: e12 }; + } + function o7(e12) { + return { type: "Identifier", name: e12 }; + } + function s7(e12, t10) { + return { type: "CallExpression", callee: e12, arguments: t10 }; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.arrayExpression = function(e12) { + return { type: "ArrayExpression", elements: e12 }; + }, t9.arrowFunctionExpression = function(e12, t10, i9 = false) { + return { type: "ArrowFunctionExpression", params: e12, body: t10, async: i9 }; + }, t9.assignmentExpression = function(e12, t10, i9) { + return { type: "AssignmentExpression", operator: e12, left: t10, right: i9 }; + }, t9.binaryExpression = function(e12, t10, i9) { + return { type: "BinaryExpression", operator: e12, left: t10, right: i9 }; + }, t9.blockStatement = function(e12, t10) { + return { type: "BlockStatement", body: e12, directives: t10 }; + }, t9.booleanLiteral = n8, t9.callExpression = s7, t9.conditionalExpression = function(e12, t10, i9) { + return { type: "ConditionalExpression", test: e12, consequent: t10, alternate: i9 }; + }, t9.exportDefaultDeclaration = function(e12) { + return { type: "ExportDefaultDeclaration", declaration: e12 }; + }, t9.expressionStatement = function(e12) { + return { type: "ExpressionStatement", expression: e12 }; + }, t9.forOfStatement = function(e12, t10, i9, n9) { + return { type: "ForOfStatement", left: e12, right: t10, body: i9, await: n9 }; + }, t9.functionDeclaration = function(e12, t10, i9) { + return { type: "FunctionDeclaration", id: e12, params: t10, body: i9 }; + }, t9.identifier = o7, t9.ifStatement = function(e12, t10, i9) { + return { type: "IfStatement", test: e12, consequent: t10, alternate: i9 }; + }, t9.importDeclaration = function(e12, t10) { + return { type: "ImportDeclaration", specifiers: e12, source: t10 }; + }, t9.importSpecifier = function(e12, t10) { + return { type: "ImportSpecifier", local: e12, imported: t10 }; + }, t9.literal = function(e12) { + switch (typeof e12) { + case "number": + return r8(e12); + case "string": + return i8(e12); + case "boolean": + return n8(e12); + } + }, t9.logicalExpression = function(e12, t10, i9) { + return { type: "LogicalExpression", operator: e12, left: t10, right: i9 }; + }, t9.memberExpression = function(e12, t10, i9 = false, n9 = null) { + return { type: "MemberExpression", object: e12, property: t10, computed: i9, optional: n9 }; + }, t9.newExpression = function(e12, t10) { + return { type: "NewExpression", callee: e12, arguments: t10 }; + }, t9.nullLiteral = function() { + return { type: "NullLiteral", value: null }; + }, t9.numericLiteral = r8, t9.objectExpression = function(e12) { + return { type: "ObjectExpression", properties: e12 }; + }, t9.objectMethod = function(e12, t10, i9, n9, r9 = false, o8 = false, s8 = false) { + return { type: "ObjectMethod", kind: e12, key: t10, params: i9, body: n9, computed: r9, generator: o8, async: s8 }; + }, t9.objectProperty = function(e12, t10, i9 = false, n9 = false, r9 = null) { + return { type: "ObjectProperty", key: e12, value: t10, computed: i9, shorthand: n9, decorators: r9 }; + }, t9.program = function(e12) { + return { type: "Program", body: e12 }; + }, t9.regExpLiteral = function(e12, t10 = "") { + return { type: "RegExpLiteral", pattern: e12, flags: t10 }; + }, t9.returnStatement = function(e12) { + return { type: "ReturnStatement", argument: e12 }; + }, t9.safeBinaryExpression = function(e12, t10, n9) { + let r9 = n9; + return ("NumericLiteral" === n9.type || "StringLiteral" === n9.type && Number.isSafeInteger(Number(n9.value))) && (r9 = i8(String(n9.value))), { type: "BinaryExpression", operator: e12, left: r9 === n9 ? t10 : s7(o7("String"), [t10]), right: r9 }; + }, t9.sequenceExpression = function(e12) { + return { type: "SequenceExpression", expressions: e12 }; + }, t9.stringLiteral = i8, t9.templateElement = function(e12, t10 = false) { + return { type: "TemplateElement", value: e12, tail: t10 }; + }, t9.templateLiteral = function(e12, t10) { + return { type: "TemplateLiteral", quasis: e12, expressions: t10 }; + }, t9.tryStatement = function(e12, t10 = null, i9 = null) { + return { type: "TryStatement", block: e12, handler: t10, finalizer: i9 }; + }, t9.unaryExpression = function(e12, t10, i9 = true) { + return { type: "UnaryExpression", operator: e12, argument: t10, prefix: i9 }; + }, t9.variableDeclaration = function(e12, t10) { + return { type: "VariableDeclaration", kind: e12, declarations: t10 }; + }, t9.variableDeclarator = function(e12, t10) { + return { type: "VariableDeclarator", id: e12, init: t10 }; + }; + }, 30687: (e11, t9, i8) => { + "use strict"; + var _e2, _t2, _i, _n, _a2; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(25568); + function r8(e12) { + return `nimma_${e12}`; + } + function o7(e12) { + return n8.identifier(r8(e12)); + } + t9.default = (_a2 = class { + constructor(e12, t10) { + __privateAdd(this, _e2, /* @__PURE__ */ new Set()); + __privateAdd(this, _t2, /* @__PURE__ */ new Map()); + __privateAdd(this, _i, void 0); + __privateAdd(this, _n, ""); + __publicField(this, "runtimeDeps", /* @__PURE__ */ new Map()); + __privateSet(this, _i, t10); + for (const [t11, i9] of Object.entries(e12)) { + const e13 = []; + for (const { imported: s7, local: a7, value: p7 } of i9) + __privateGet(this, _t2).set(a7, p7), this.runtimeDeps.set(r8(a7), p7), e13.push(n8.importSpecifier(o7(a7), n8.identifier(s7))), __privateGet(this, _e2).add(n8.importDeclaration(e13, n8.stringLiteral(t11))); + } + } + get extraCode() { + return __privateGet(this, _n) || __privateSet(this, _n, function(e12) { + const t10 = Reflect.apply(Function.toString, e12, []), i9 = t10.indexOf(")") + 1, n9 = t10.slice(i9).replace(/^\s*(=>\s*)?/, ""); + return `${t10.slice(t10.indexOf("("), i9).split(/[,\s]+/).splice(0, 3).join(", ")} => ${n9}`; + }(__privateGet(this, _i))), __privateGet(this, _n); + } + attach(e12) { + for (const t11 of __privateGet(this, _e2)) + e12.push(t11, "program"); + const t10 = n8.identifier("fallback"), i9 = Array.from(__privateGet(this, _t2).keys()); + return e12.push(n8.variableDeclaration("const", [n8.variableDeclarator(t10, n8.callExpression(n8.memberExpression(n8.callExpression(n8.identifier("Function"), [n8.templateLiteral([n8.templateElement({ raw: `return ${this.extraCode}` })], [])]), n8.identifier("call")), [n8.objectExpression(i9.map((e13) => n8.objectProperty(n8.stringLiteral(e13), o7(e13))))]))]), "program"), t10; + } + }, _e2 = new WeakMap(), _t2 = new WeakMap(), _i = new WeakMap(), _n = new WeakMap(), _a2); + }, 1847: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(36575); + t9.jsonPathPlus = n8.default; + }, 36575: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(34321), r8 = i8(86981), o7 = i8(30687); + function s7(e12) { + return e12 && "object" == typeof e12 && "default" in e12 ? e12 : { default: e12 }; + } + var a7 = s7(r8), p7 = new o7.default({ "jsonpath-plus": [{ imported: "JSONPath", local: "JSONPath", value: n8.JSONPath }], "lodash.topath": [{ imported: "default", local: "toPath", value: a7.default }] }, function(e12, t10, i9) { + this.JSONPath({ callback: (e13) => { + i9({ path: this.toPath(e13.path.slice(1)), value: e13.value }); + }, json: e12, path: t10, resultType: "all" }); + }); + t9.default = p7; + }, 9679: (e11, t9) => { + "use strict"; + function i8(e12, t10, i9) { + if (!t10.has(e12)) + throw new TypeError("attempted to " + i9 + " private field on non-instance"); + return t10.get(e12); + } + function n8(e12, t10) { + return t10.get ? t10.get.call(e12) : t10.value; + } + function r8(e12, t10, i9) { + if (t10.set) + t10.set.call(e12, i9); + else { + if (!t10.writable) + throw new TypeError("attempted to set read only private field"); + t10.value = i9; + } + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.classApplyDescriptorGet = n8, t9.classApplyDescriptorSet = r8, t9.classExtractFieldDescriptor = i8, t9.classPrivateFieldGet = function(e12, t10) { + return n8(e12, i8(e12, t10, "get")); + }, t9.classPrivateFieldSet = function(e12, t10, n9) { + return r8(e12, i8(e12, t10, "set"), n9), n9; + }, t9.defineProperty = function(e12, t10, i9) { + return t10 in e12 ? Object.defineProperty(e12, t10, { value: i9, enumerable: true, configurable: true, writable: true }) : e12[t10] = i9, e12; + }; + }, 63658: (e11, t9) => { + "use strict"; + function i8(e12) { + return { type: "StringLiteral", value: e12 }; + } + function n8(e12) { + return { type: "BooleanLiteral", value: e12 }; + } + function r8(e12) { + return { type: "NumericLiteral", value: e12 }; + } + function o7(e12) { + return { type: "Identifier", name: e12 }; + } + function s7(e12, t10) { + return { type: "CallExpression", callee: e12, arguments: t10 }; + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.arrayExpression = function(e12) { + return { type: "ArrayExpression", elements: e12 }; + }, t9.arrowFunctionExpression = function(e12, t10, i9 = false) { + return { type: "ArrowFunctionExpression", params: e12, body: t10, async: i9 }; + }, t9.assignmentExpression = function(e12, t10, i9) { + return { type: "AssignmentExpression", operator: e12, left: t10, right: i9 }; + }, t9.binaryExpression = function(e12, t10, i9) { + return { type: "BinaryExpression", operator: e12, left: t10, right: i9 }; + }, t9.blockStatement = function(e12, t10) { + return { type: "BlockStatement", body: e12, directives: t10 }; + }, t9.booleanLiteral = n8, t9.callExpression = s7, t9.conditionalExpression = function(e12, t10, i9) { + return { type: "ConditionalExpression", test: e12, consequent: t10, alternate: i9 }; + }, t9.exportDefaultDeclaration = function(e12) { + return { type: "ExportDefaultDeclaration", declaration: e12 }; + }, t9.expressionStatement = function(e12) { + return { type: "ExpressionStatement", expression: e12 }; + }, t9.forOfStatement = function(e12, t10, i9, n9) { + return { type: "ForOfStatement", left: e12, right: t10, body: i9, await: n9 }; + }, t9.functionDeclaration = function(e12, t10, i9) { + return { type: "FunctionDeclaration", id: e12, params: t10, body: i9 }; + }, t9.identifier = o7, t9.ifStatement = function(e12, t10, i9) { + return { type: "IfStatement", test: e12, consequent: t10, alternate: i9 }; + }, t9.importDeclaration = function(e12, t10) { + return { type: "ImportDeclaration", specifiers: e12, source: t10 }; + }, t9.importSpecifier = function(e12, t10) { + return { type: "ImportSpecifier", local: e12, imported: t10 }; + }, t9.literal = function(e12) { + switch (typeof e12) { + case "number": + return r8(e12); + case "string": + return i8(e12); + case "boolean": + return n8(e12); + } + }, t9.logicalExpression = function(e12, t10, i9) { + return { type: "LogicalExpression", operator: e12, left: t10, right: i9 }; + }, t9.memberExpression = function(e12, t10, i9 = false, n9 = null) { + return { type: "MemberExpression", object: e12, property: t10, computed: i9, optional: n9 }; + }, t9.newExpression = function(e12, t10) { + return { type: "NewExpression", callee: e12, arguments: t10 }; + }, t9.nullLiteral = function() { + return { type: "NullLiteral", value: null }; + }, t9.numericLiteral = r8, t9.objectExpression = function(e12) { + return { type: "ObjectExpression", properties: e12 }; + }, t9.objectMethod = function(e12, t10, i9, n9, r9 = false, o8 = false, s8 = false) { + return { type: "ObjectMethod", kind: e12, key: t10, params: i9, body: n9, computed: r9, generator: o8, async: s8 }; + }, t9.objectProperty = function(e12, t10, i9 = false, n9 = false, r9 = null) { + return { type: "ObjectProperty", key: e12, value: t10, computed: i9, shorthand: n9, decorators: r9 }; + }, t9.program = function(e12) { + return { type: "Program", body: e12 }; + }, t9.regExpLiteral = function(e12, t10 = "") { + return { type: "RegExpLiteral", pattern: e12, flags: t10 }; + }, t9.returnStatement = function(e12) { + return { type: "ReturnStatement", argument: e12 }; + }, t9.safeBinaryExpression = function(e12, t10, n9) { + let r9 = n9; + return ("NumericLiteral" === n9.type || "StringLiteral" === n9.type && Number.isSafeInteger(Number(n9.value))) && (r9 = i8(String(n9.value))), { type: "BinaryExpression", operator: e12, left: r9 === n9 ? t10 : s7(o7("String"), [t10]), right: r9 }; + }, t9.sequenceExpression = function(e12) { + return { type: "SequenceExpression", expressions: e12 }; + }, t9.stringLiteral = i8, t9.templateElement = function(e12, t10 = false) { + return { type: "TemplateElement", value: e12, tail: t10 }; + }, t9.templateLiteral = function(e12, t10) { + return { type: "TemplateLiteral", quasis: e12, expressions: t10 }; + }, t9.tryStatement = function(e12, t10 = null, i9 = null) { + return { type: "TryStatement", block: e12, handler: t10, finalizer: i9 }; + }, t9.unaryExpression = function(e12, t10, i9 = true) { + return { type: "UnaryExpression", operator: e12, argument: t10, prefix: i9 }; + }, t9.variableDeclaration = function(e12, t10) { + return { type: "VariableDeclaration", kind: e12, declarations: t10 }; + }, t9.variableDeclarator = function(e12, t10) { + return { type: "VariableDeclarator", id: e12, init: t10 }; + }; + }, 20737: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(96711), r8 = i8(63658), o7 = i8(46079), s7 = i8(66284), a7 = i8(1027); + function p7(e12, { deep: t10, value: i9 }) { + if (e12.feedback.bailed) + return r8.safeBinaryExpression("!==", a7.default.property, r8.literal(i9)); + if (e12.state.inverted) + return r8.safeBinaryExpression("!==", 0 === e12.state.pos ? a7.default.property : r8.memberExpression(a7.default.path, r8.binaryExpression("-", a7.default.depth, r8.numericLiteral(Math.abs(e12.state.pos))), true), r8.literal(i9)); + if (t10) { + var n9; + const t11 = null === e12.nextNode || "KeyExpression" === e12.nextNode; + (n9 = e12.feedback).mutatesPos || (n9.mutatesPos = !t11); + const s9 = r8.sequenceExpression([r8.assignmentExpression("=", o7.default.pos, t11 ? r8.conditionalExpression(r8.safeBinaryExpression("!==", a7.default.property, r8.literal(i9)), r8.numericLiteral(-1), a7.default.depth) : r8.callExpression(r8.memberExpression(a7.default.path, r8.identifier("indexOf")), [r8.literal(i9), 0 === e12.state.pos ? o7.default.pos : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(1))])), r8.binaryExpression("===", o7.default.pos, r8.numericLiteral(-1))]); + return t11 ? r8.logicalExpression("||", r8.binaryExpression("<", a7.default.depth, 0 === e12.state.pos ? o7.default.pos : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(e12.state.pos))), s9) : s9; + } + let s8; + e12.feedback.fixed || 0 === e12.state.absolutePos || (s8 = r8.binaryExpression("<", a7.default.depth, 0 === e12.state.pos ? o7.default.pos : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(e12.state.pos)))); + const p8 = r8.safeBinaryExpression("!==", r8.memberExpression(a7.default.path, 0 === e12.state.pos ? r8.numericLiteral(0) : e12.feedback.fixed ? r8.numericLiteral(e12.state.pos) : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(e12.state.pos)), true), r8.literal(i9)); + return void 0 !== s8 ? r8.logicalExpression("||", s8, p8) : p8; + } + const c7 = r8.identifier("inBounds"); + function d7(e12, t10, i9) { + switch (t10.type) { + case "LogicalExpression": + case "BinaryExpression": + if ("in" === t10.operator) + t10.operator = "===", t10.left = r8.callExpression(r8.memberExpression(t10.right, r8.identifier("includes")), [d7(e12, t10.left, i9)]), t10.right = r8.booleanLiteral(true); + else if ("~=" === t10.operator) { + if (t10.operator = "===", "Literal" !== t10.right.type) + throw SyntaxError("Expected string"); + t10.left = r8.callExpression(r8.memberExpression(r8.regExpLiteral(t10.right.value, ""), r8.identifier("test")), [d7(e12, t10.left, i9)]), t10.right = r8.booleanLiteral(true); + } else + t10.left = d7(e12, t10.left, i9), t10.right = d7(e12, t10.right, i9), u7(t10.left), u7(t10.right); + break; + case "UnaryExpression": + return t10.argument = d7(e12, t10.argument, i9), u7(t10.argument), t10; + case "MemberExpression": + t10.object = d7(e12, t10.object, i9), u7(t10.object), t10.property = d7(e12, t10.property, i9), t10.computed && u7(t10.property); + break; + case "CallExpression": + if ("Identifier" === t10.callee.type && t10.callee.name.startsWith("@")) + return f8(e12, t10.callee.name, i9); + t10.callee = d7(e12, t10.callee, i9), t10.arguments = t10.arguments.map((t11) => d7(e12, t11, i9)), "MemberExpression" === t10.callee.type && t10.callee.object === s7.default.property && t10.callee.property.name in String.prototype && (t10.callee.object = r8.callExpression(r8.identifier("String"), [t10.callee.object])), u7(t10.callee); + break; + case "Identifier": + if (t10.name.startsWith("@")) + return f8(e12, t10.name, i9); + if ("undefined" === t10.name) + return r8.unaryExpression("void", r8.numericLiteral(0)); + if ("index" === t10.name) + return s7.default.index; + } + return t10; + } + function f8(e12, t10, i9) { + switch (t10) { + case "@": + return m7(s7.default.value, i9); + case "@root": + return m7(s7.default.root, i9); + case "@path": + return m7(s7.default.path, i9); + case "@property": + return m7(s7.default.property, i9); + case "@parent": + return m7(s7.default.parentValue, i9); + case "@parentProperty": + return m7(s7.default.parentProperty, i9); + case "@string": + case "@number": + case "@boolean": + return r8.binaryExpression("===", r8.unaryExpression("typeof", m7(s7.default.value, i9)), r8.stringLiteral(t10.slice(1))); + case "@scalar": + return r8.logicalExpression("||", r8.binaryExpression("===", m7(s7.default.value, i9), r8.nullLiteral()), r8.binaryExpression("!==", r8.unaryExpression("typeof", m7(s7.default.value, i9)), r8.stringLiteral("object"))); + case "@array": + return r8.callExpression(r8.memberExpression(r8.identifier("Array"), r8.identifier("isArray")), [m7(s7.default.value, i9)]); + case "@null": + return r8.binaryExpression("===", m7(s7.default.value, i9), r8.nullLiteral()); + case "@object": + return r8.logicalExpression("&&", r8.binaryExpression("!==", m7(s7.default.value, i9), r8.nullLiteral()), r8.binaryExpression("===", r8.unaryExpression("typeof", m7(s7.default.value, i9)), r8.stringLiteral("object"))); + case "@integer": + return r8.callExpression(r8.memberExpression(r8.identifier("Number"), r8.identifier("isInteger")), [m7(s7.default.value, i9)]); + default: + if (t10.startsWith("@@")) { + const i10 = t10.slice(2); + return e12.attachCustomShorthand(i10), r8.callExpression(r8.memberExpression(o7.default.shorthands, r8.identifier(i10)), [a7.default._]); + } + throw new SyntaxError(`Unsupported shorthand '${t10}'`); + } + } + const l7 = [a7.default._.name, "index"]; + function u7(e12) { + if ("Identifier" === e12.type && !l7.includes(e12.name)) + throw ReferenceError(`'${e12.name}' is not defined`); + } + function m7(e12, t10) { + return "MemberExpression" === e12.type && 0 !== t10 ? { ...e12, object: r8.callExpression(s7.default.at, [r8.numericLiteral(t10)]) } : e12; + } + t9.generateFilterScriptExpression = function(e12, { deep: t10, value: i9 }, s8) { + var p8; + const c8 = n8.default(i9); + u7(c8); + const f9 = r8.unaryExpression("!", d7(s8, c8, e12.state.fixed && e12.state.pos > 0 && null !== e12.nextNode ? e12.state.pos + 1 : e12.state.inverted && 0 !== e12.state.pos ? e12.state.pos - 1 : 0)); + if (e12.feedback.bailed || !t10 || e12.state.inverted) + return f9; + (p8 = e12.feedback).mutatesPos || (p8.mutatesPos = null !== e12.nextNode && "KeyExpression" !== e12.nextNode); + const l8 = r8.sequenceExpression([r8.assignmentExpression("=", o7.default.pos, r8.conditionalExpression(f9, r8.numericLiteral(-1), a7.default.depth)), r8.binaryExpression("===", o7.default.pos, r8.numericLiteral(-1))]); + return 0 === e12.state.pos ? l8 : r8.logicalExpression("||", r8.binaryExpression("<", a7.default.depth, 0 === e12.state.pos ? o7.default.pos : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(e12.state.pos))), l8); + }, t9.generateMemberExpression = p7, t9.generateMultipleMemberExpression = function(e12, t10) { + return t10.value.slice(1).reduce((i9, n9) => r8.logicalExpression("&&", i9, p7(e12, { type: "MemberExpression", value: n9, deep: t10.deep })), p7(e12, { type: "MemberExpression", value: t10.value[0], deep: t10.deep })); + }, t9.generateSliceExpression = function(e12, t10, i9) { + const n9 = e12.state.inverted ? r8.binaryExpression("-", a7.default.depth, r8.numericLiteral(e12.state.pos)) : 0 === e12.state.pos ? r8.numericLiteral(0) : e12.feedback.fixed ? r8.numericLiteral(e12.state.pos) : r8.binaryExpression("+", o7.default.pos, r8.numericLiteral(e12.state.pos)), p8 = e12.feedback.bailed ? a7.default.property : r8.memberExpression(a7.default.path, n9, true), d8 = r8.binaryExpression("!==", r8.unaryExpression("typeof", p8), r8.stringLiteral("number")); + return t10.value.some((e13) => Number.isFinite(e13) && e13 < 0) ? (i9.addRuntimeDependency(c7.name), r8.binaryExpression("||", d8, r8.unaryExpression("!", r8.callExpression(c7, [0 === e12.state.absolutePos ? m7(s7.default.value, e12.state.absolutePos - 2) : m7(s7.default.value, e12.state.absolutePos), r8.memberExpression(a7.default.path, e12.feedback.bailed ? r8.binaryExpression("-", r8.memberExpression(a7.default.path, r8.identifier("length")), r8.numericLiteral(1)) : n9, true), ...t10.value.map((e13) => r8.numericLiteral(e13))])))) : t10.value.reduce((e13, i10, n10) => { + if (0 === n10 && 0 === i10) + return e13; + if (1 === n10 && !Number.isFinite(i10)) + return e13; + if (2 === n10 && 1 === i10) + return e13; + const o8 = 0 === n10 ? "<" : 1 === n10 ? ">=" : "%", s8 = r8.binaryExpression(o8, p8, r8.numericLiteral(Number(i10))); + return r8.logicalExpression("||", e13, "%" === o8 ? r8.logicalExpression("&&", r8.binaryExpression("!==", p8, r8.numericLiteral(t10.value[0])), r8.binaryExpression("!==", s8, r8.numericLiteral(t10.value[0]))) : s8); + }, d8); + }, t9.generateWildcardExpression = function(e12) { + return e12.feedback.bailed ? r8.booleanLiteral(false) : null !== e12.nextNode || e12.feedback.fixed ? null : r8.sequenceExpression([r8.assignmentExpression("=", o7.default.pos, r8.conditionalExpression(r8.binaryExpression("<", a7.default.depth, r8.numericLiteral(e12.state.pos)), r8.numericLiteral(-1), a7.default.depth)), r8.binaryExpression("===", o7.default.pos, r8.numericLiteral(-1))]); + }, t9.rewriteESTree = d7; + }, 9047: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(779), o7 = i8(11009), s7 = i8(70953), a7 = i8(29207), p7 = i8(61753), c7 = i8(56370), d7 = i8(46079), f8 = i8(1027), l7 = i8(5522), u7 = i8(20737); + const m7 = n8.variableDeclaration("let", [n8.variableDeclarator(d7.default.pos, n8.numericLiteral(0))]); + t9.default = function(e12, t10) { + const i9 = new l7.default(t10), h8 = /* @__PURE__ */ new Map(), y7 = /* @__PURE__ */ new Map(); + e: + for (const [t11, l8] of e12) { + const e13 = new s7.default(l8); + if (-1 === e13.length) + continue; + const v8 = JSON.stringify(e13.nodes), j6 = h8.get(v8); + if (void 0 !== j6) { + var g7, b8; + null !== (g7 = null === (b8 = y7.get(j6)) || void 0 === b8 ? void 0 : b8.push(t11)) && void 0 !== g7 || y7.set(j6, [t11]); + let n9 = i9.getMethodByHash(j6).body.body; + e13.feedback.bailed && (n9 = n9[0].expression.arguments[1].body.body), n9.push(p7.default(t11, e13.modifiers)); + continue; + } + h8.set(v8, t11), (e13.feedback.bailed || l8.length > 0 && o7.isDeep(l8[0])) && i9.traversalZones.destroy(); + const $5 = { id: t11, iterator: e13 }; + i9.ctx = $5; + for (const e14 of r8.default) + if (e14(l8, i9, $5)) + continue e; + const x7 = e13.feedback.bailed ? [] : [n8.ifStatement(n8.binaryExpression(e13.feedback.fixed ? "!==" : "<", f8.default.depth, n8.numericLiteral(e13.length - 1)), n8.returnStatement())].concat(e13.feedback.fixed ? [] : m7), _6 = e13.feedback.bailed ? null : i9.traversalZones.create(), w6 = e13.feedback.inverseAt; + for (const t12 of e13) { + let r9; + switch ((o7.isDeep(t12) || w6 === e13.state.absolutePos) && (null == _6 || _6.allIn()), t12.type) { + case "MemberExpression": + r9 = u7.generateMemberExpression(e13, t12), null == _6 || _6.expand(t12.value); + break; + case "MultipleMemberExpression": + r9 = u7.generateMultipleMemberExpression(e13, t12), null == _6 || _6.expandMultiple(t12.value); + break; + case "SliceExpression": + r9 = u7.generateSliceExpression(e13, t12, i9), null == _6 || _6.resize(); + break; + case "ScriptFilterExpression": + r9 = u7.generateFilterScriptExpression(e13, t12, i9), null == _6 || _6.resize(); + break; + case "WildcardExpression": + if (r9 = u7.generateWildcardExpression(e13), null == _6 || _6.resize(), null === r9) + continue; + } + e13.feedback.bailed ? x7.push(n8.objectExpression([n8.objectProperty(n8.identifier("fn"), n8.arrowFunctionExpression([f8.default._], r9)), n8.objectProperty(n8.identifier("deep"), n8.booleanLiteral(t12.deep))])) : x7.push(n8.ifStatement(r9, n8.returnStatement())); + } + e13.feedback.fixed || e13.feedback.bailed || e13.state.inverted || x7.push(n8.ifStatement(n8.binaryExpression("!==", f8.default.depth, 0 === e13.state.pos ? d7.default.pos : n8.binaryExpression("+", d7.default.pos, n8.numericLiteral(e13.state.pos))), n8.returnStatement())); + const S6 = e13.feedback.bailed ? "body" : "traverse"; + e13.feedback.bailed ? x7.splice(0, x7.length, n8.expressionStatement(n8.callExpression(f8.default.bail, [n8.stringLiteral(t11), n8.arrowFunctionExpression([f8.default._], n8.blockStatement([n8.expressionStatement(p7.default($5.id, e13.modifiers).expression)])), n8.arrayExpression([...x7])]))) : x7.push(p7.default($5.id, e13.modifiers)), "body" === S6 ? i9.push(n8.expressionStatement(n8.callExpression(n8.memberExpression(d7.default.tree, n8.stringLiteral(t11), true), c7.default)), S6) : i9.push(n8.stringLiteral(t11), S6), a7.default(x7, e13), i9.push(n8.blockStatement(x7), "tree-method"), null == _6 || _6.attach(); + } + return i9; + }; + }, 31037: (e11, t9, i8) => { + "use strict"; + function n8(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = /* @__PURE__ */ Object.create(null); + return e12 && Object.keys(e12).forEach(function(i9) { + if ("default" !== i9) { + var n9 = Object.getOwnPropertyDescriptor(e12, i9); + Object.defineProperty(t10, i9, n9.get ? n9 : { enumerable: true, get: function() { + return e12[i9]; + } }); + } + }), t10.default = e12, Object.freeze(t10); + } + Object.defineProperty(t9, "__esModule", { value: true }); + var r8 = n8(i8(14891)); + const o7 = { ...r8.baseGenerator, BooleanLiteral(e12, t10) { + t10.write(`${e12.value}`, e12); + }, NullLiteral(e12, t10) { + t10.write("null", e12); + }, NumericLiteral(e12, t10) { + t10.write(e12.value, e12); + }, ObjectMethod(e12, t10) { + const { key: i9, type: n9, ...r9 } = e12; + return this.ObjectProperty({ key: e12.key, value: { type: "FunctionExpression", ...r9 } }, t10); + }, ObjectProperty(e12, t10) { + return this.Property({ ...e12, kind: "init" }, t10); + }, RegExpLiteral(e12, t10) { + t10.write(`/${e12.pattern}/${e12.flags}`, e12); + }, StringLiteral(e12, t10) { + t10.write(JSON.stringify(e12.value), e12); + } }; + t9.default = function(e12) { + return r8.generate(e12, { generator: o7 }); + }; + }, 89784: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(61753), o7 = i8(66284); + const s7 = n8.identifier("isObject"), a7 = n8.ifStatement(n8.unaryExpression("!", n8.callExpression(s7, [o7.default.value])), n8.returnStatement()), p7 = r8.default("$..", { keyed: false, parents: 0 }); + t9.default = (e12, t10, i9) => 1 === e12.length && "AllParentExpression" === e12[0].type && (t10.addRuntimeDependency(s7.name), t10.push(n8.blockStatement([a7, r8.default(i9.id, i9.iterator.modifiers)]), "tree-method"), t10.push(n8.stringLiteral(i9.id), "traverse"), t10.push(p7, "body"), true); + }, 64469: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(11009), o7 = i8(61753), s7 = i8(1027); + t9.default = (e12, t10, i9) => !(1 !== e12.length || !r8.isDeep(e12[0]) || !r8.isMemberExpression(e12[0]) || (t10.push(n8.blockStatement([n8.ifStatement(n8.safeBinaryExpression("!==", s7.default.property, n8.stringLiteral(e12[0].value)), n8.returnStatement()), o7.default(i9.id, i9.iterator.modifiers)]), "tree-method"), t10.push(n8.stringLiteral(i9.id), "traverse"), 0)); + }, 18872: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(11009), o7 = i8(61753); + t9.default = (e12, t10, i9) => !(1 !== e12.length || !r8.isWildcardExpression(e12[0]) || !r8.isDeep(e12[0]) || (t10.push(n8.blockStatement([o7.default(i9.id, i9.iterator.modifiers)]), "tree-method"), t10.push(n8.stringLiteral(i9.id), "traverse"), 0)); + }, 73093: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(11009), o7 = i8(61753), s7 = i8(66284), a7 = i8(1027), p7 = i8(5302); + const c7 = n8.identifier("value"), d7 = n8.identifier("isObject"), f8 = n8.identifier("get"), l7 = n8.ifStatement(n8.unaryExpression("!", n8.callExpression(d7, [c7])), n8.returnStatement()), u7 = n8.ifStatement(n8.binaryExpression("===", a7.default._, n8.nullLiteral()), n8.returnStatement()); + function m7(e12) { + return n8.literal(e12.value); + } + t9.default = (e12, t10, i9) => { + if (!e12.every(r8.isMemberExpression) || e12.some(r8.isDeep)) + return false; + const h8 = n8.variableDeclaration("const", [n8.variableDeclarator(c7, e12.slice(0, -1).reduce((e13, i10) => "ES2018" === t10.format ? (e13.arguments[1].elements.push(n8.literal(i10.value)), e13) : n8.memberExpression(e13, n8.literal(i10.value), true, true), "ES2018" === t10.format && e12.length > 0 ? n8.callExpression(n8.identifier("get"), [s7.default.root, n8.arrayExpression([])]) : s7.default.root))]); + return t10.addRuntimeDependency(d7.name), "ES2018" === t10.format && t10.addRuntimeDependency(f8.name), t10.pushAll([[n8.blockStatement([h8, l7, n8.expressionStatement(n8.assignmentExpression("=", a7.default._, n8.callExpression(a7.default.fork, [n8.arrayExpression(e12.map(m7))]))), u7, o7.default(i9.id, i9.iterator.modifiers)]), "tree-method"], [p7.default(i9.id), "body"]]), true; + }; + }, 779: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(89784), r8 = i8(64469), o7 = i8(18872), s7 = i8(73093), a7 = i8(59749), p7 = i8(25367), c7 = i8(35574), d7 = [p7.default, a7.default, r8.default, o7.default, c7.default, s7.default, n8.default]; + t9.default = d7; + }, 59749: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(96711), r8 = i8(63658), o7 = i8(20737), s7 = i8(11009), a7 = i8(61753), p7 = i8(1027); + const c7 = r8.ifStatement(r8.binaryExpression("!==", p7.default.depth, r8.numericLiteral(0)), r8.returnStatement()); + t9.default = (e12, t10, i9) => { + if (1 !== e12.length || !s7.isScriptFilterExpression(e12[0])) + return false; + const p8 = r8.unaryExpression("!", o7.rewriteESTree(t10, n8.default(e12[0].value), 0), true); + var d7; + return t10.pushAll([[r8.blockStatement([...s7.isDeep(e12[0]) ? [] : [c7], r8.ifStatement(p8, r8.returnStatement()), a7.default(i9.id, i9.iterator.modifiers)]), "tree-method"], [r8.stringLiteral(i9.id), "traverse"]]), s7.isDeep(e12[0]) || null === (d7 = t10.traversalZones.create()) || void 0 === d7 || d7.resize().attach(), true; + }; + }, 25367: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + const n8 = i8(61753).default("$", { keyed: false, parents: 0 }); + t9.default = (e12, t10) => !(e12.length > 0 || (t10.push(n8, "body"), 0)); + }, 35574: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(11009), o7 = i8(61753), s7 = i8(1027); + const a7 = n8.ifStatement(n8.binaryExpression("!==", s7.default.depth, n8.numericLiteral(0)), n8.returnStatement()); + t9.default = (e12, t10, i9) => { + var s8; + return !(1 !== e12.length || !r8.isWildcardExpression(e12[0]) || r8.isDeep(e12[0]) || (t10.push(n8.blockStatement([a7, o7.default(i9.id, i9.iterator.modifiers)]), "tree-method"), t10.push(n8.stringLiteral(i9.id), "traverse"), null === (s8 = t10.traversalZones.create()) || void 0 === s8 || s8.resize().attach(), 0)); + }; + }, 11009: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.isDeep = function(e12) { + return e12.deep; + }, t9.isMemberExpression = function(e12) { + return "MemberExpression" === e12.type; + }, t9.isModifierExpression = function(e12) { + return "KeyExpression" === e12.type || "ParentExpression" === e12.type; + }, t9.isScriptFilterExpression = function(e12) { + return "ScriptFilterExpression" === e12.type; + }, t9.isWildcardExpression = function(e12) { + return "WildcardExpression" === e12.type; + }; + }, 70953: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(11009); + let o7; + function s7(e12) { + let t10 = false; + for (let i9 = 0; i9 < e12.length; i9++) { + const n9 = e12[i9]; + if (r8.isDeep(n9)) { + if (t10) + return true; + if (r8.isMemberExpression(n9)) { + i9++; + let t11 = false, n10 = 1; + for (; i9 < e12.length - 1; i9++) { + const o8 = e12[i9]; + if (r8.isDeep(o8)) { + if (n10++, !r8.isMemberExpression(o8) && !r8.isWildcardExpression(o8)) + return true; + if (t11) + return true; + } else + t11 || (t11 = r8.isMemberExpression(o8) || r8.isWildcardExpression(o8)); + } + return r8.isDeep(e12[e12.length - 1]) ? t11 || r8.isWildcardExpression(e12[e12.length - 1]) : n10 > 1; + } + t10 = true; + } + } + return false; + } + var a7 = /* @__PURE__ */ new WeakMap(); + o7 = Symbol.iterator; + class p7 { + constructor(e12) { + n8.defineProperty(this, "nodes", void 0), a7.set(this, { writable: true, value: void 0 }), this.modifiers = p7.trim(e12), this.nodes = p7.compact(e12), n8.classPrivateFieldSet(this, a7, -1), this.feedback = p7.analyze(this.nodes, this.modifiers.keyed || this.modifiers.parents > 0), this.length = this.nodes.length, this.state = { absolutePos: -1, fixed: true, inverted: false, pos: -1 }, this.feedback.fixed && this.modifiers.parents > this.length && (this.length = -1); + } + get nextNode() { + return n8.classPrivateFieldGet(this, a7) + 1 < this.nodes.length ? this.nodes[n8.classPrivateFieldGet(this, a7) + 1] : null; + } + static compact(e12) { + let t10; + for (let n10 = 0; n10 < e12.length; n10++) { + var i9; + r8.isWildcardExpression(e12[n10]) && r8.isDeep(e12[n10]) && n10 !== e12.length - 1 && (null !== (i9 = t10) && void 0 !== i9 ? i9 : t10 = []).push(n10); + } + if (void 0 === t10) + return e12; + const n9 = e12.slice(); + for (let e13 = 0; e13 < t10.length; e13++) + n9[t10[e13] - e13 + 1].deep = true, n9.splice(t10[e13] - e13, 1); + return n9; + } + static trim(e12) { + const t10 = { keyed: false, parents: 0 }; + for (; e12.length > 0 && r8.isModifierExpression(e12[e12.length - 1]); ) + switch (e12.pop().type) { + case "KeyExpression": + t10.keyed = true, t10.parents = 0; + break; + case "ParentExpression": + t10.parents++; + } + return t10; + } + static analyze(e12) { + const t10 = { bailed: s7(e12), fixed: true, inverseAt: -1 }; + if (t10.bailed) + return t10.fixed = false, t10; + let i9 = -1; + for (let n9 = 0; n9 < e12.length; n9++) { + const o8 = e12[n9]; + if (r8.isDeep(o8)) + for (t10.fixed = false, n9++, i9 = n9 - 1; n9 < e12.length; n9++) { + const t11 = e12[n9]; + r8.isDeep(t11) && (i9 = -1); + } + } + return e12.length > 1 && -1 !== i9 && i9 < e12.length - 1 && (t10.inverseAt = i9), t10; + } + *[o7]() { + if (this.feedback.bailed) + return yield* this.nodes; + const { ...e12 } = this.feedback; + let t10 = 1; + const i9 = -1 !== this.feedback.inverseAt ? this.nodes.slice() : this.nodes; + for (let e13 = 0; e13 < i9.length; e13++) { + -1 !== this.feedback.inverseAt && e13 === this.feedback.inverseAt && (i9.splice(0, e13), i9.reverse(), this.state.pos = 1, e13 = 0, this.feedback.inverseAt = -1, this.state.inverted = true, t10 = -1); + const o8 = i9[e13]; + this.state.pos += t10, n8.classPrivateFieldSet(this, a7, +n8.classPrivateFieldGet(this, a7) + 1), this.state.absolutePos++, r8.isDeep(o8) ? (this.state.fixed = false, yield o8, this.state.pos = 0) : yield o8; + } + Object.assign(this.feedback, { ...e12, mutatesPos: this.feedback.mutatesPos }); + } + } + t9.default = p7; + }, 29207: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(46079), r8 = i8(1027); + function o7(e12, t10) { + return e12.splice(t10, 1), t10 - 1; + } + function s7(e12, t10, i9) { + return null === t10 ? i9 : null === i9 ? t10 : (e12.left = t10, e12.right = i9, e12); + } + function a7(e12) { + switch (e12.type) { + case "AssignmentExpression": + return e12.left !== n8.default.pos ? e12 : a7(e12.right); + case "ConditionalExpression": + return "NumericLiteral" === e12.consequent.type && -1 === e12.consequent.value ? a7(e12.test) : e12; + case "SequenceExpression": + return a7(e12.expressions[0]); + case "LogicalExpression": + return s7(e12, a7(e12.left), a7(e12.right)); + case "BinaryExpression": + return function(e13) { + return "<" === e13.operator && e13.left === r8.default.depth ? null : s7(e13, a7(e13.left), a7(e13.right)); + }(e12); + case "IfStatement": + return a7(e12.test); + case "Identifier": + return e12 === n8.default.pos ? null : e12; + case "MemberExpression": + return e12.property = a7(e12.property), e12; + default: + return e12; + } + } + t9.default = function(e12, t10) { + if (t10.feedback.mutatesPos) + return; + let i9 = Math.max(0, Math.min(1, t10.length)); + for (; i9 < e12.length; i9++) { + const t11 = e12[i9]; + if ("VariableDeclaration" === t11.type && "let" === t11.kind && t11.declarations[0].id === n8.default.pos) { + i9 = o7(e12, i9); + continue; + } + const s8 = a7(t11); + null === s8 || s8 === r8.default.depth ? i9 = o7(e12, i9) : t11.test = s8; + } + }; + }, 28198: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658); + t9.default = function e12(t10) { + switch (typeof t10) { + case "boolean": + return n8.booleanLiteral(t10); + case "string": + return n8.stringLiteral(t10); + case "number": + return n8.numericLiteral(t10); + case "object": + return null === t10 ? n8.nullLiteral() : Array.isArray(t10) ? n8.arrayExpression(t10.map(e12)) : n8.objectExpression(Object.keys(t10).map((i9) => n8.objectProperty(n8.stringLiteral(i9), e12(t10[i9])))); + } + }; + }, 61753: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(1027); + t9.default = function(e12, { parents: t10, keyed: i9 }) { + return n8.expressionStatement(n8.callExpression(r8.default.emit, [n8.stringLiteral(e12), n8.numericLiteral(t10), n8.booleanLiteral(i9)])); + }; + }, 93395: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(1027); + t9.default = function(e12, t10) { + const i9 = n8.identifier("path"); + return n8.forOfStatement(n8.variableDeclaration("const", [n8.variableDeclarator(i9)]), n8.arrayExpression(t10.map(n8.stringLiteral)), n8.blockStatement([n8.callExpression(e12, [n8.identifier("input"), i9, n8.memberExpression(r8.default.callbacks, i9, true)])])); + }; + }, 56370: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = [i8(1027).default._]; + t9.default = n8; + }, 46079: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = { pos: n8.identifier("pos"), shorthands: n8.identifier("shorthands"), tree: n8.identifier("tree") }; + t9.default = r8; + }, 66284: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(1027), o7 = { at: n8.memberExpression(r8.default.sandbox, n8.identifier("at")), index: n8.memberExpression(r8.default.sandbox, n8.identifier("index")), parent: n8.memberExpression(r8.default.sandbox, n8.identifier("parent")), parentProperty: n8.memberExpression(r8.default.sandbox, n8.identifier("parentProperty")), parentValue: n8.memberExpression(r8.default.sandbox, n8.identifier("parentValue")), path: n8.memberExpression(r8.default.sandbox, n8.identifier("path")), property: n8.memberExpression(r8.default.sandbox, n8.identifier("property")), root: n8.memberExpression(r8.default.sandbox, n8.identifier("root")), value: n8.memberExpression(r8.default.sandbox, n8.identifier("value")) }; + t9.default = o7; + }, 1027: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658); + const r8 = n8.identifier("scope"); + var o7 = { _: r8, bail: n8.memberExpression(r8, n8.identifier("bail")), callbacks: n8.memberExpression(r8, n8.identifier("callbacks")), depth: n8.memberExpression(r8, n8.identifier("depth")), destroy: n8.memberExpression(r8, n8.identifier("destroy")), emit: n8.memberExpression(r8, n8.identifier("emit")), fork: n8.memberExpression(r8, n8.identifier("fork")), path: n8.memberExpression(r8, n8.identifier("path")), property: n8.memberExpression(r8, n8.identifier("property")), sandbox: n8.memberExpression(r8, n8.identifier("sandbox")), traverse: n8.memberExpression(r8, n8.identifier("traverse")), value: n8.memberExpression(r8, n8.identifier("value")) }; + t9.default = o7; + }, 5302: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(63658), r8 = i8(56370), o7 = i8(46079); + t9.default = function(e12) { + const t10 = n8.stringLiteral(e12); + return n8.expressionStatement(n8.callExpression(n8.memberExpression(o7.default.tree, t10, true), r8.default)); + }; + }, 49124: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(29148); + i8(32512); + var o7 = i8(63658), s7 = i8(28198), a7 = /* @__PURE__ */ new WeakMap(), p7 = /* @__PURE__ */ new WeakMap(), c7 = /* @__PURE__ */ new WeakMap(), d7 = /* @__PURE__ */ new WeakMap(), f8 = /* @__PURE__ */ new WeakMap(); + class l7 { + constructor(e12) { + c7.set(this, { writable: true, value: void 0 }), d7.set(this, { writable: true, value: void 0 }), f8.set(this, { writable: true, value: void 0 }), n8.classPrivateFieldSet(this, c7, e12), this.root = {}, n8.classPrivateFieldSet(this, d7, [this.root]), n8.classPrivateFieldSet(this, f8, /* @__PURE__ */ new Map()); + } + attach() { + n8.classPrivateFieldGet(this, c7).attach(this.root), n8.classPrivateFieldGet(this, f8).clear(); + } + expand(e12) { + let t10 = 0; + for (const i9 of n8.classPrivateFieldGet(this, d7)) + if (null !== i9) { + if ("**" === e12) { + const t11 = n8.classPrivateFieldGet(this, f8).get(i9); + if (void 0 !== t11 && "*" in t11) { + delete t11["*"], t11["**"] = null; + continue; + } + i9[e12] = null; + } else + i9[e12] = {}, n8.classPrivateFieldGet(this, f8).set(i9[e12], i9); + n8.classPrivateFieldGet(this, d7)[t10++] = i9[e12]; + } + return this; + } + expandMultiple(e12) { + const t10 = n8.classPrivateFieldGet(this, d7)[0]; + if (null === t10) + return this; + let i9 = 0; + for (const r9 of e12) + t10[r9] = "**" === r9 ? null : {}, n8.classPrivateFieldGet(this, d7).length < i9 ? n8.classPrivateFieldGet(this, d7).push(t10[r9]) : n8.classPrivateFieldGet(this, d7)[i9++] = t10[r9]; + return this; + } + resize() { + return this.expand("*"); + } + allIn() { + return this.expand("**"); + } + } + function u7(e12) { + return Object.keys(e12).reduce((t10, i9) => Object.assign(t10, e12[i9]), {}); + } + function m7(e12, t10) { + if ("*" in t10) { + const i9 = u7(e12); + m7(i9, u7(t10)), e12["*"] = "*" in i9 ? { "*": i9["*"] } : i9; + } else + for (const i9 of Object.keys(t10)) + i9 in e12 ? r8.default(t10[i9]) && m7(e12[i9], t10[i9]) : e12[i9] = t10[i9]; + } + function h8(e12) { + const t10 = e12[0]; + for (let i9 = 1; i9 < e12.length; i9++) + m7(t10, e12[i9]); + return t10; + } + t9.default = class { + constructor() { + a7.set(this, { writable: true, value: false }), p7.set(this, { writable: true, value: [] }); + } + get root() { + if (n8.classPrivateFieldGet(this, a7) || 0 === n8.classPrivateFieldGet(this, p7).length) + return null; + const e12 = o7.identifier("zones"); + return o7.variableDeclaration("const", [o7.variableDeclarator(e12, s7.default(h8(n8.classPrivateFieldGet(this, p7))))]); + } + destroy() { + n8.classPrivateFieldSet(this, a7, true); + } + attach(e12) { + n8.classPrivateFieldGet(this, p7).push(e12); + } + create() { + return n8.classPrivateFieldGet(this, a7) ? null : new l7(this); + } + }; + }, 5522: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(96711), o7 = i8(63658), s7 = i8(31037), a7 = i8(93395), p7 = i8(56370), c7 = i8(46079), d7 = i8(1027), f8 = i8(5302), l7 = i8(49124); + const u7 = [o7.identifier("input"), o7.identifier("callbacks")], m7 = o7.variableDeclaration("const", [o7.variableDeclarator(d7.default._, o7.newExpression(o7.identifier("Scope"), u7))]); + var h8 = /* @__PURE__ */ new WeakMap(), y7 = /* @__PURE__ */ new WeakMap(), g7 = /* @__PURE__ */ new WeakMap(), b8 = /* @__PURE__ */ new WeakMap(), v8 = /* @__PURE__ */ new WeakMap(), j6 = /* @__PURE__ */ new WeakMap(), $5 = /* @__PURE__ */ new WeakMap(); + t9.default = class { + constructor({ customShorthands: e12, format: t10, npmProvider: i9 }) { + h8.set(this, { writable: true, value: o7.objectExpression([]) }), y7.set(this, { writable: true, value: o7.objectExpression([]) }), g7.set(this, { writable: true, value: /* @__PURE__ */ new Set(["Scope"]) }), b8.set(this, { writable: true, value: /* @__PURE__ */ new Set() }), v8.set(this, { writable: true, value: /* @__PURE__ */ new Set() }), j6.set(this, { writable: true, value: /* @__PURE__ */ new Set() }), $5.set(this, { writable: true, value: void 0 }), this.format = t10, this.npmProvider = i9, this.ctx = null, this.traversalZones = new l7.default(), n8.classPrivateFieldSet(this, $5, e12); + } + addRuntimeDependency(e12) { + n8.classPrivateFieldGet(this, g7).has(e12) || n8.classPrivateFieldGet(this, g7).add(e12); + } + attachFallbackExpressions(e12, t10) { + this.push(a7.default(e12.attach(this), t10), "body"); + } + attachCustomShorthand(e12) { + if (null === n8.classPrivateFieldGet(this, $5) || !(e12 in n8.classPrivateFieldGet(this, $5))) + throw new ReferenceError(`Shorthand '${e12}' is not defined`); + n8.classPrivateFieldGet(this, y7).properties.push(o7.objectMethod("method", o7.identifier(e12), p7.default, o7.blockStatement([o7.returnStatement(r8.default(n8.classPrivateFieldGet(this, $5)[e12]))]))); + } + getMethodByHash(e12) { + return n8.classPrivateFieldGet(this, h8).properties.find((t10) => t10.key.value === e12); + } + push(e12, t10) { + switch (t10) { + case "tree-method": + n8.classPrivateFieldGet(this, h8).properties.push(o7.objectMethod("method", o7.stringLiteral(this.ctx.id), p7.default, e12)); + break; + case "program": + n8.classPrivateFieldGet(this, b8).has(e12) || n8.classPrivateFieldGet(this, b8).add(e12); + break; + case "body": + n8.classPrivateFieldGet(this, v8).has(e12) || n8.classPrivateFieldGet(this, v8).add(e12); + break; + case "traverse": + n8.classPrivateFieldGet(this, j6).add(f8.default(e12.value)); + } + } + pushAll(e12) { + for (const t10 of e12) + this.push(...t10); + } + toString() { + var e12; + const t10 = this.traversalZones.root; + return s7.default(o7.program([o7.importDeclaration([...n8.classPrivateFieldGet(this, g7)].map((e13) => o7.importSpecifier(o7.identifier(e13), o7.identifier(e13))), o7.stringLiteral(`${null !== (e12 = this.npmProvider) && void 0 !== e12 ? e12 : ""}nimma/legacy/runtime`)), ...n8.classPrivateFieldGet(this, b8), t10, 0 === n8.classPrivateFieldGet(this, h8).properties.length ? null : o7.variableDeclaration("const", [o7.variableDeclarator(c7.default.tree, n8.classPrivateFieldGet(this, h8))]), 0 === n8.classPrivateFieldGet(this, y7).properties.length ? null : o7.variableDeclaration("const", [o7.variableDeclarator(c7.default.shorthands, n8.classPrivateFieldGet(this, y7))]), o7.exportDefaultDeclaration(o7.functionDeclaration(null, u7, o7.blockStatement([m7, o7.tryStatement(o7.blockStatement([...n8.classPrivateFieldGet(this, v8), 0 === n8.classPrivateFieldGet(this, j6).size ? null : o7.expressionStatement(o7.callExpression(d7.default.traverse, [o7.arrowFunctionExpression([], o7.blockStatement(Array.from(n8.classPrivateFieldGet(this, j6)))), null === t10 ? o7.nullLiteral() : t10.declarations[0].id]))].filter(Boolean)), null, o7.blockStatement([o7.expressionStatement(o7.callExpression(d7.default.destroy, []))]))].filter(Boolean))))].filter(Boolean))); + } + }; + }, 65717: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(9047), o7 = i8(57190), s7 = i8(51404), a7 = i8(16922); + const p7 = /import\s*({[^}]+})\s*from\s*['"][^'"]+['"];?/; + var c7 = /* @__PURE__ */ new WeakMap(), d7 = /* @__PURE__ */ new WeakMap(); + t9.default = class { + constructor(e12, { fallback: t10 = null, unsafe: i9 = true, output: o8 = "auto", npmProvider: p8 = null, customShorthands: f8 = null } = {}) { + c7.set(this, { writable: true, value: void 0 }), d7.set(this, { writable: true, value: void 0 }), n8.classPrivateFieldSet(this, c7, t10), n8.classPrivateFieldSet(this, d7, null); + const { erroredExpressions: l7, mappedExpressions: u7 } = a7.default(e12, i9, null !== t10); + this.tree = r8.default(u7, { customShorthands: f8, format: "auto" === o8 ? s7.default() : o8, npmProvider: p8 }), l7.length > 0 && this.tree.attachFallbackExpressions(t10, l7), this.sourceCode = String(this.tree); + } + query(e12, t10) { + if (null !== n8.classPrivateFieldGet(this, d7)) + return void n8.classPrivateFieldGet(this, d7).call(this, e12, t10); + const i9 = "__nimma_globals__", r9 = this.sourceCode.replace("export default function", "return function").replace(p7, `const $1 = ${i9};`).replace(RegExp(p7.source, "g"), ""); + n8.classPrivateFieldSet(this, d7, Function(i9, ...null === n8.classPrivateFieldGet(this, c7) ? [] : Array.from(n8.classPrivateFieldGet(this, c7).runtimeDeps.keys()), r9)(o7, ...null === n8.classPrivateFieldGet(this, c7) ? [] : Array.from(n8.classPrivateFieldGet(this, c7).runtimeDeps.values()))), n8.classPrivateFieldGet(this, d7).call(this, e12, t10); + } + }; + }, 51404: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.default = function() { + try { + return Function("a", "a?.b")({}), "ES2021"; + } catch { + return "ES2018"; + } + }; + }, 16922: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(70953), r8 = i8(15613), o7 = i8(32512); + function s7([, e12]) { + return e12; + } + function a7([e12]) { + return e12; + } + t9.default = function(e12, t10, i9) { + const p7 = [], c7 = []; + for (const i10 of new Set(e12)) + try { + const e13 = r8.default(i10); + if (false === t10 && n8.default.analyze(e13).bailed) + throw SyntaxError("Unsafe expressions are ignored, but no fallback was specified"); + p7.push([i10, e13]); + } catch (e13) { + c7.push([i10, e13]); + } + if (!i9 && c7.length > 0) + throw new o7.default(c7.map(s7), `Error parsing ${c7.map(a7).join(", ")}`); + return { erroredExpressions: c7.map(a7), mappedExpressions: p7 }; + }; + }, 22001: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(65717); + t9.default = n8.default; + }, 15613: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(19422), r8 = i8(91218); + const { parse: o7 } = r8; + t9.default = function(e12) { + try { + return o7(e12); + } catch (t10) { + throw new n8.default(t10.message, e12, { cause: t10 }); + } + }; + }, 96711: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(4910), r8 = i8(6270), o7 = i8(17547); + function s7(e12) { + return e12 && "object" == typeof e12 && "default" in e12 ? e12 : { default: e12 }; + } + var a7 = s7(n8), p7 = s7(r8), c7 = s7(o7); + c7.default.addIdentifierChar("@"), c7.default.addUnaryOp("void"), c7.default.addBinaryOp("in", 12), c7.default.addBinaryOp("~=", 20), c7.default.plugins.register(a7.default, p7.default), t9.default = (e12) => c7.default.parse(e12); + }, 91218: (e11, t9) => { + "use strict"; + function i8(e12, t10, n9, r8) { + var o7 = Error.call(this, e12); + return Object.setPrototypeOf && Object.setPrototypeOf(o7, i8.prototype), o7.expected = t10, o7.found = n9, o7.location = r8, o7.name = "SyntaxError", o7; + } + function n8(e12, t10, i9) { + return i9 = i9 || " ", e12.length > t10 ? e12 : (t10 -= e12.length, e12 + (i9 += i9.repeat(t10)).slice(0, t10)); + } + Object.defineProperty(t9, "__esModule", { value: true }), function(e12, t10) { + function i9() { + this.constructor = e12; + } + i9.prototype = t10.prototype, e12.prototype = new i9(); + }(i8, Error), i8.prototype.format = function(e12) { + var t10 = "Error: " + this.message; + if (this.location) { + var i9, r8 = null; + for (i9 = 0; i9 < e12.length; i9++) + if (e12[i9].source === this.location.source) { + r8 = e12[i9].text.split(/\r\n|\n|\r/g); + break; + } + var o7 = this.location.start, s7 = this.location.source + ":" + o7.line + ":" + o7.column; + if (r8) { + var a7 = this.location.end, p7 = n8("", o7.line.toString().length), c7 = r8[o7.line - 1], d7 = o7.line === a7.line ? a7.column : c7.length + 1; + t10 += "\n --> " + s7 + "\n" + p7 + " |\n" + o7.line + " | " + c7 + "\n" + p7 + " | " + n8("", o7.column - 1) + n8("", d7 - o7.column, "^"); + } else + t10 += "\n at " + s7; + } + return t10; + }, i8.buildMessage = function(e12, t10) { + var i9 = { literal: function(e13) { + return '"' + r8(e13.text) + '"'; + }, class: function(e13) { + var t11 = e13.parts.map(function(e14) { + return Array.isArray(e14) ? o7(e14[0]) + "-" + o7(e14[1]) : o7(e14); + }); + return "[" + (e13.inverted ? "^" : "") + t11 + "]"; + }, any: function() { + return "any character"; + }, end: function() { + return "end of input"; + }, other: function(e13) { + return e13.description; + } }; + function n9(e13) { + return e13.charCodeAt(0).toString(16).toUpperCase(); + } + function r8(e13) { + return e13.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(e14) { + return "\\x0" + n9(e14); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(e14) { + return "\\x" + n9(e14); + }); + } + function o7(e13) { + return e13.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(e14) { + return "\\x0" + n9(e14); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(e14) { + return "\\x" + n9(e14); + }); + } + function s7(e13) { + return i9[e13.type](e13); + } + return "Expected " + function(e13) { + var t11, i10, n10 = e13.map(s7); + if (n10.sort(), n10.length > 0) { + for (t11 = 1, i10 = 1; t11 < n10.length; t11++) + n10[t11 - 1] !== n10[t11] && (n10[i10] = n10[t11], i10++); + n10.length = i10; + } + switch (n10.length) { + case 1: + return n10[0]; + case 2: + return n10[0] + " or " + n10[1]; + default: + return n10.slice(0, -1).join(", ") + ", or " + n10[n10.length - 1]; + } + }(e12) + " but " + function(e13) { + return e13 ? '"' + r8(e13) + '"' : "end of input"; + }(t10) + " found."; + }, t9.SyntaxError = i8, t9.parse = function(e12, t10) { + var n9, r8 = {}, o7 = (t10 = void 0 !== t10 ? t10 : {}).grammarSource, s7 = { JSONPath: Ke }, a7 = Ke, p7 = "$", c7 = "[", d7 = "]", f8 = "..", l7 = "(", u7 = ")", m7 = "?(", h8 = ":", y7 = "@", g7 = "()", b8 = "~", v8 = "^", j6 = ".", $5 = '"', x7 = "'", _6 = "-", w6 = "*", S6 = ".length", P6 = /^[a-z]/, O7 = /^[@[]/, T6 = /^[$_\-]/, A6 = /^[^"]/, I6 = /^[^']/, E6 = /^[A-Za-z]/, q5 = /^[0-9]/, k6 = /^[ \t]/, M6 = /^["]/, R6 = /^[']/, D6 = /^[ $@.,_=<>!|&+~%\^*\/;\-[\]]/, C6 = Ue("$", false), V5 = Ue("[", false), N6 = Ue("]", false), F6 = Ue(",", false), U6 = Ue("..", false), L6 = Ue("(", false), z6 = Ue(")", false), B6 = Ue("?(", false), Q5 = Ue(":", false), K5 = Ue("@", false), H5 = Le2([["a", "z"]], false, false), G5 = Ue("()", false), W5 = Ue("~", false), J5 = Ue("^", false), Z5 = Ue(".", false), Y6 = Le2(["@", "["], false, false), X5 = Le2(["$", "_", "-"], false, false), ee4 = Ue('"', false), te4 = Le2(['"'], true, false), ie3 = Ue("'", false), ne4 = Le2(["'"], true, false), re4 = Ue("-", false), oe4 = Ue("*", false), se4 = Le2([["A", "Z"], ["a", "z"]], false, false), ae4 = Le2([["0", "9"]], false, false), pe4 = Le2([" ", " "], false, false), ce4 = Le2(['"'], false, false), de4 = Le2(["'"], false, false), fe4 = Le2([" ", "$", "@", ".", ",", "_", "=", "<", ">", "!", "|", "&", "+", "~", "%", "^", "*", "/", ";", "-", "[", "]"], false, false), le4 = Ue(".length", false), ue4 = function(e13, t11) { + return { ...t11, deep: e13 }; + }, me4 = function(e13, t11) { + return e13.concat(Array.isArray(t11) ? t11 : null === t11 ? [] : t11); + }, he4 = function() { + return { type: "WildcardExpression" }; + }, ye4 = function(e13) { + return e13; + }, ge4 = function(e13) { + return e13; + }, be4 = function(e13) { + return { type: "MultipleMemberExpression", value: [...new Set(e13)] }; + }, ve4 = function() { + return /^\$\.{2}[~^]*$/.test(e12); + }, je4 = function() { + return { type: "AllParentExpression" }; + }, $e2 = function(e13) { + return { type: "MemberExpression", value: e13 }; + }, xe2 = function(e13) { + return { type: "ScriptFilterExpression", value: e13 }; + }, _e2 = function(e13) { + return { type: "SliceExpression", value: e13.split(":").reduce((e14, t11, i9) => ("" !== t11 && (e14[i9] = Number(t11)), e14), [0, 1 / 0, 1]) }; + }, we4 = function(e13) { + return { type: "ScriptFilterExpression", value: e13 }; + }, Se4 = function(e13) { + return e13.value; + }, Pe2 = function() { + return { type: "KeyExpression" }; + }, Oe4 = function() { + return { type: "ParentExpression" }; + }, Te = function() { + return true; + }, Ae4 = function() { + return false; + }, Ie2 = function(e13) { + return e13.length > 0 && Number.isSafeInteger(Number(e13)) ? Number(e13) : e13; + }, Ee4 = function() { + return Fe().slice(1, -1); + }, qe2 = function() { + return Number(Fe()); + }, ke3 = function(e13) { + return { type: "SliceExpression", value: [-e13, 1 / 0, 1] }; + }, Me2 = 0, Re2 = 0, De2 = [{ line: 1, column: 1 }], Ce = 0, Ve = [], Ne2 = 0; + if ("startRule" in t10) { + if (!(t10.startRule in s7)) + throw new Error(`Can't start parsing from rule "` + t10.startRule + '".'); + a7 = s7[t10.startRule]; + } + function Fe() { + return e12.substring(Re2, Me2); + } + function Ue(e13, t11) { + return { type: "literal", text: e13, ignoreCase: t11 }; + } + function Le2(e13, t11, i9) { + return { type: "class", parts: e13, inverted: t11, ignoreCase: i9 }; + } + function ze2(t11) { + var i9, n10 = De2[t11]; + if (n10) + return n10; + for (i9 = t11 - 1; !De2[i9]; ) + i9--; + for (n10 = { line: (n10 = De2[i9]).line, column: n10.column }; i9 < t11; ) + 10 === e12.charCodeAt(i9) ? (n10.line++, n10.column = 1) : n10.column++, i9++; + return De2[t11] = n10, n10; + } + function Be3(e13, t11) { + var i9 = ze2(e13), n10 = ze2(t11); + return { source: o7, start: { offset: e13, line: i9.line, column: i9.column }, end: { offset: t11, line: n10.line, column: n10.column } }; + } + function Qe(e13) { + Me2 < Ce || (Me2 > Ce && (Ce = Me2, Ve = []), Ve.push(e13)); + } + function Ke() { + var t11, i9, n10, o8, s8, a8; + if (t11 = Me2, i9 = function() { + var t12; + return 36 === e12.charCodeAt(Me2) ? (t12 = p7, Me2++) : (t12 = r8, 0 === Ne2 && Qe(C6)), t12; + }(), i9 !== r8) { + for (n10 = [], (o8 = Ge()) === r8 && (o8 = Me2, (s8 = Ze()) !== r8 && (a8 = He()) !== r8 ? (Re2 = o8, o8 = ue4(s8, a8)) : (Me2 = o8, o8 = r8)); o8 !== r8; ) + n10.push(o8), (o8 = Ge()) === r8 && (o8 = Me2, (s8 = Ze()) !== r8 && (a8 = He()) !== r8 ? (Re2 = o8, o8 = ue4(s8, a8)) : (Me2 = o8, o8 = r8)); + if (o8 = [], (s8 = Je()) !== r8) + for (; s8 !== r8; ) + o8.push(s8), s8 = Je(); + else + o8 = r8; + o8 === r8 && (o8 = null), Re2 = t11, t11 = me4(n10, o8); + } else + Me2 = t11, t11 = r8; + return t11; + } + function He() { + var t11, i9, n10, o8, s8; + if (t11 = function() { + var t12, i10, n11, o9, s9; + return t12 = Me2, (i10 = Ye()) === r8 && (i10 = Me2, 91 === e12.charCodeAt(Me2) ? (n11 = c7, Me2++) : (n11 = r8, 0 === Ne2 && Qe(V5)), n11 !== r8 && (o9 = Xe()) !== r8 ? (93 === e12.charCodeAt(Me2) ? (s9 = d7, Me2++) : (s9 = r8, 0 === Ne2 && Qe(N6)), s9 !== r8 ? (Re2 = i10, i10 = ge4(o9)) : (Me2 = i10, i10 = r8)) : (Me2 = i10, i10 = r8)), i10 !== r8 && (Re2 = t12, i10 = $e2(i10)), t12 = i10; + }(), t11 === r8 && (t11 = Me2, (i9 = tt3()) === r8 && (i9 = Me2, 91 === e12.charCodeAt(Me2) ? (n10 = c7, Me2++) : (n10 = r8, 0 === Ne2 && Qe(V5)), n10 !== r8 && (o8 = tt3()) !== r8 ? (93 === e12.charCodeAt(Me2) ? (s8 = d7, Me2++) : (s8 = r8, 0 === Ne2 && Qe(N6)), s8 !== r8 ? i9 = n10 = [n10, o8, s8] : (Me2 = i9, i9 = r8)) : (Me2 = i9, i9 = r8)), i9 !== r8 && (Re2 = t11, i9 = he4()), (t11 = i9) === r8 && (t11 = Me2, 91 === e12.charCodeAt(Me2) ? (i9 = c7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(V5)), i9 !== r8 ? (n10 = function() { + var t12, i10, n11, o9; + return t12 = Me2, 40 === e12.charCodeAt(Me2) ? (i10 = l7, Me2++) : (i10 = r8, 0 === Ne2 && Qe(L6)), i10 !== r8 ? (n11 = function() { + var t13, i11, n12; + return t13 = Me2, 64 === e12.charCodeAt(Me2) ? (i11 = y7, Me2++) : (i11 = r8, 0 === Ne2 && Qe(K5)), i11 !== r8 ? (n12 = function() { + var t14, i12, n13, o10, s9, a8, p8, c8; + if (t14 = Me2, e12.substr(Me2, 7) === S6 ? (i12 = S6, Me2 += 7) : (i12 = r8, 0 === Ne2 && Qe(le4)), i12 !== r8) { + for (n13 = [], o10 = rt(); o10 !== r8; ) + n13.push(o10), o10 = rt(); + if (45 === e12.charCodeAt(Me2) ? (o10 = _6, Me2++) : (o10 = r8, 0 === Ne2 && Qe(re4)), o10 !== r8) { + for (s9 = [], a8 = rt(); a8 !== r8; ) + s9.push(a8), a8 = rt(); + if (a8 = Me2, p8 = [], (c8 = nt2()) !== r8) + for (; c8 !== r8; ) + p8.push(c8), c8 = nt2(); + else + p8 = r8; + (a8 = p8 !== r8 ? e12.substring(a8, Me2) : p8) !== r8 ? (Re2 = t14, t14 = ke3(a8)) : (Me2 = t14, t14 = r8); + } else + Me2 = t14, t14 = r8; + } else + Me2 = t14, t14 = r8; + return t14; + }(), n12 !== r8 ? (Re2 = t13, t13 = ge4(n12)) : (Me2 = t13, t13 = r8)) : (Me2 = t13, t13 = r8), t13; + }(), n11 !== r8 ? (41 === e12.charCodeAt(Me2) ? (o9 = u7, Me2++) : (o9 = r8, 0 === Ne2 && Qe(z6)), o9 !== r8 ? (Re2 = t12, t12 = ge4(n11)) : (Me2 = t12, t12 = r8)) : (Me2 = t12, t12 = r8)) : (Me2 = t12, t12 = r8), t12; + }(), n10 !== r8 ? (93 === e12.charCodeAt(Me2) ? (o8 = d7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(N6)), o8 !== r8 ? (Re2 = t11, t11 = ye4(n10)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8), t11 === r8 && (t11 = Me2, 91 === e12.charCodeAt(Me2) ? (i9 = c7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(V5)), i9 !== r8 ? (n10 = function() { + var t12, i10, n11, o9; + return t12 = Me2, e12.substr(Me2, 2) === m7 ? (i10 = m7, Me2 += 2) : (i10 = r8, 0 === Ne2 && Qe(B6)), i10 !== r8 ? (n11 = function() { + var t13, i11, n12; + if (t13 = Me2, i11 = [], (n12 = it2()) === r8 && (n12 = nt2()) === r8 && (n12 = rt()) === r8 && (n12 = at2()) === r8 && (n12 = st2()) === r8 && (n12 = ot()) === r8 && (n12 = pt()), n12 !== r8) + for (; n12 !== r8; ) + i11.push(n12), (n12 = it2()) === r8 && (n12 = nt2()) === r8 && (n12 = rt()) === r8 && (n12 = at2()) === r8 && (n12 = st2()) === r8 && (n12 = ot()) === r8 && (n12 = pt()); + else + i11 = r8; + return t13 = i11 !== r8 ? e12.substring(t13, Me2) : i11; + }(), n11 !== r8 ? (41 === e12.charCodeAt(Me2) ? (o9 = u7, Me2++) : (o9 = r8, 0 === Ne2 && Qe(z6)), o9 !== r8 ? (Re2 = t12, t12 = xe2(n11)) : (Me2 = t12, t12 = r8)) : (Me2 = t12, t12 = r8)) : (Me2 = t12, t12 = r8), t12; + }(), n10 !== r8 ? (93 === e12.charCodeAt(Me2) ? (o8 = d7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(N6)), o8 !== r8 ? (Re2 = t11, t11 = ye4(n10)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8), t11 === r8 && (t11 = Me2, (i9 = We()) === r8 && (i9 = function() { + var t12, i10, n11, o9, s9; + return t12 = Me2, i10 = Me2, n11 = Me2, 64 === e12.charCodeAt(Me2) ? (o9 = y7, Me2++) : (o9 = r8, 0 === Ne2 && Qe(K5)), o9 !== r8 && (s9 = We()) !== r8 ? (Re2 = n11, n11 = Se4(s9)) : (Me2 = n11, n11 = r8), (i10 = n11 !== r8 ? e12.substring(i10, Me2) : n11) !== r8 && (Re2 = t12, i10 = we4(i10)), t12 = i10; + }()), i9 !== r8 && (Re2 = t11, i9 = ye4(i9)), (t11 = i9) === r8))))) { + if (t11 = Me2, 91 === e12.charCodeAt(Me2) ? (i9 = c7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(V5)), i9 !== r8) { + for (n10 = [], o8 = Me2, (s8 = Xe()) !== r8 ? (44 === e12.charCodeAt(Me2) ? Me2++ : 0 === Ne2 && Qe(F6), Re2 = o8, o8 = ge4(s8)) : (Me2 = o8, o8 = r8); o8 !== r8; ) + n10.push(o8), o8 = Me2, (s8 = Xe()) !== r8 ? (44 === e12.charCodeAt(Me2) ? Me2++ : 0 === Ne2 && Qe(F6), Re2 = o8, o8 = ge4(s8)) : (Me2 = o8, o8 = r8); + 93 === e12.charCodeAt(Me2) ? (o8 = d7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(N6)), o8 !== r8 ? (Re2 = t11, t11 = be4(n10)) : (Me2 = t11, t11 = r8); + } else + Me2 = t11, t11 = r8; + t11 === r8 && (t11 = Me2, 91 === e12.charCodeAt(Me2) ? (i9 = c7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(V5)), i9 !== r8 ? (n10 = function() { + var t12, i10, n11, o9, s9, a8, p8; + return t12 = Me2, i10 = Me2, n11 = Me2, o9 = Me2, (s9 = et3()) !== r8 ? (58 === e12.charCodeAt(Me2) ? (a8 = h8, Me2++) : (a8 = r8, 0 === Ne2 && Qe(Q5)), a8 !== r8 ? ((p8 = et3()) === r8 && (p8 = null), o9 = s9 = [s9, a8, p8]) : (Me2 = o9, o9 = r8)) : (Me2 = o9, o9 = r8), o9 === r8 && (o9 = Me2, 58 === e12.charCodeAt(Me2) ? (s9 = h8, Me2++) : (s9 = r8, 0 === Ne2 && Qe(Q5)), s9 !== r8 ? ((a8 = et3()) === r8 && (a8 = null), o9 = s9 = [s9, a8]) : (Me2 = o9, o9 = r8), o9 === r8 && (o9 = et3())), o9 !== r8 ? (s9 = Me2, 58 === e12.charCodeAt(Me2) ? (a8 = h8, Me2++) : (a8 = r8, 0 === Ne2 && Qe(Q5)), a8 !== r8 && (p8 = et3()) !== r8 ? s9 = a8 = [a8, p8] : (Me2 = s9, s9 = r8), s9 === r8 && (s9 = null), n11 = o9 = [o9, s9]) : (Me2 = n11, n11 = r8), (i10 = n11 !== r8 ? e12.substring(i10, Me2) : n11) !== r8 && (Re2 = t12, i10 = _e2(i10)), t12 = i10; + }(), n10 !== r8 ? (93 === e12.charCodeAt(Me2) ? (o8 = d7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(N6)), o8 !== r8 ? (Re2 = t11, t11 = ye4(n10)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8)); + } + return t11; + } + function Ge() { + var t11, i9; + return t11 = Me2, Re2 = Me2, (ve4() ? void 0 : r8) !== r8 ? (e12.substr(Me2, 2) === f8 ? (i9 = f8, Me2 += 2) : (i9 = r8, 0 === Ne2 && Qe(U6)), i9 !== r8 ? (Re2 = t11, t11 = je4()) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8), t11; + } + function We() { + var t11, i9, n10, o8, s8, a8; + if (t11 = Me2, i9 = Me2, n10 = Me2, 64 === e12.charCodeAt(Me2) ? (o8 = y7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(K5)), o8 !== r8) { + if (s8 = [], P6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(H5)), a8 !== r8) + for (; a8 !== r8; ) + s8.push(a8), P6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(H5)); + else + s8 = r8; + s8 !== r8 ? (e12.substr(Me2, 2) === g7 ? (a8 = g7, Me2 += 2) : (a8 = r8, 0 === Ne2 && Qe(G5)), a8 !== r8 ? n10 = o8 = [o8, s8, a8] : (Me2 = n10, n10 = r8)) : (Me2 = n10, n10 = r8); + } else + Me2 = n10, n10 = r8; + return (i9 = n10 !== r8 ? e12.substring(i9, Me2) : n10) !== r8 && (Re2 = t11, i9 = we4(i9)), i9; + } + function Je() { + var t11; + return (t11 = function() { + var t12, i9; + return t12 = Me2, 126 === e12.charCodeAt(Me2) ? (i9 = b8, Me2++) : (i9 = r8, 0 === Ne2 && Qe(W5)), i9 !== r8 && (Re2 = t12, i9 = Pe2()), i9; + }()) === r8 && (t11 = function() { + var t12, i9; + return t12 = Me2, 94 === e12.charCodeAt(Me2) ? (i9 = v8, Me2++) : (i9 = r8, 0 === Ne2 && Qe(J5)), i9 !== r8 && (Re2 = t12, i9 = Oe4()), i9; + }()), t11; + } + function Ze() { + var t11, i9, n10, o8; + return t11 = Me2, e12.substr(Me2, 2) === f8 ? (i9 = f8, Me2 += 2) : (i9 = r8, 0 === Ne2 && Qe(U6)), i9 !== r8 && (Re2 = t11, i9 = Te()), (t11 = i9) === r8 && (t11 = Me2, 46 === e12.charCodeAt(Me2) ? (i9 = j6, Me2++) : (i9 = r8, 0 === Ne2 && Qe(Z5)), i9 !== r8 ? (n10 = Me2, Ne2++, 91 === e12.charCodeAt(Me2) ? (o8 = c7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(V5)), Ne2--, o8 !== r8 ? (Me2 = n10, n10 = void 0) : n10 = r8, n10 !== r8 ? (Re2 = t11, t11 = Te()) : (Me2 = t11, t11 = r8)) : (Me2 = t11, t11 = r8), t11 === r8 && (t11 = Me2, 46 === e12.charCodeAt(Me2) ? (i9 = j6, Me2++) : (i9 = r8, 0 === Ne2 && Qe(Z5)), i9 !== r8 && (Re2 = t11, i9 = Ae4()), (t11 = i9) === r8 && (t11 = Me2, i9 = Me2, Ne2++, O7.test(e12.charAt(Me2)) ? (n10 = e12.charAt(Me2), Me2++) : (n10 = r8, 0 === Ne2 && Qe(Y6)), Ne2--, n10 !== r8 ? (Me2 = i9, i9 = void 0) : i9 = r8, i9 !== r8 && (Re2 = t11, i9 = Ae4()), t11 = i9))), t11; + } + function Ye() { + var t11, i9, n10; + if (t11 = Me2, i9 = [], T6.test(e12.charAt(Me2)) ? (n10 = e12.charAt(Me2), Me2++) : (n10 = r8, 0 === Ne2 && Qe(X5)), n10 === r8 && (n10 = it2()) === r8 && (n10 = nt2()), n10 !== r8) + for (; n10 !== r8; ) + i9.push(n10), T6.test(e12.charAt(Me2)) ? (n10 = e12.charAt(Me2), Me2++) : (n10 = r8, 0 === Ne2 && Qe(X5)), n10 === r8 && (n10 = it2()) === r8 && (n10 = nt2()); + else + i9 = r8; + return i9 !== r8 ? e12.substring(t11, Me2) : i9; + } + function Xe() { + var t11, i9, n10, o8, s8, a8; + if (t11 = Me2, (i9 = Ye()) !== r8 && (Re2 = t11, i9 = Ie2(i9)), (t11 = i9) === r8) { + if (t11 = Me2, i9 = Me2, 34 === e12.charCodeAt(Me2) ? (n10 = $5, Me2++) : (n10 = r8, 0 === Ne2 && Qe(ee4)), n10 !== r8) { + for (o8 = Me2, s8 = [], A6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(te4)); a8 !== r8; ) + s8.push(a8), A6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(te4)); + o8 = e12.substring(o8, Me2), 34 === e12.charCodeAt(Me2) ? (s8 = $5, Me2++) : (s8 = r8, 0 === Ne2 && Qe(ee4)), s8 !== r8 ? i9 = n10 = [n10, o8, s8] : (Me2 = i9, i9 = r8); + } else + Me2 = i9, i9 = r8; + if (i9 === r8) + if (i9 = Me2, 39 === e12.charCodeAt(Me2) ? (n10 = x7, Me2++) : (n10 = r8, 0 === Ne2 && Qe(ie3)), n10 !== r8) { + for (o8 = Me2, s8 = [], I6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(ne4)); a8 !== r8; ) + s8.push(a8), I6.test(e12.charAt(Me2)) ? (a8 = e12.charAt(Me2), Me2++) : (a8 = r8, 0 === Ne2 && Qe(ne4)); + o8 = e12.substring(o8, Me2), 39 === e12.charCodeAt(Me2) ? (s8 = x7, Me2++) : (s8 = r8, 0 === Ne2 && Qe(ie3)), s8 !== r8 ? i9 = n10 = [n10, o8, s8] : (Me2 = i9, i9 = r8); + } else + Me2 = i9, i9 = r8; + i9 !== r8 && (Re2 = t11, i9 = Ee4()), t11 = i9; + } + return t11; + } + function et3() { + var t11, i9, n10; + if (t11 = Me2, 45 === e12.charCodeAt(Me2) ? Me2++ : 0 === Ne2 && Qe(re4), i9 = [], (n10 = nt2()) !== r8) + for (; n10 !== r8; ) + i9.push(n10), n10 = nt2(); + else + i9 = r8; + return i9 !== r8 ? (Re2 = t11, t11 = qe2()) : (Me2 = t11, t11 = r8), t11; + } + function tt3() { + var t11; + return 42 === e12.charCodeAt(Me2) ? (t11 = w6, Me2++) : (t11 = r8, 0 === Ne2 && Qe(oe4)), t11; + } + function it2() { + var t11; + return E6.test(e12.charAt(Me2)) ? (t11 = e12.charAt(Me2), Me2++) : (t11 = r8, 0 === Ne2 && Qe(se4)), t11; + } + function nt2() { + var t11; + return q5.test(e12.charAt(Me2)) ? (t11 = e12.charAt(Me2), Me2++) : (t11 = r8, 0 === Ne2 && Qe(ae4)), t11; + } + function rt() { + var t11; + return k6.test(e12.charAt(Me2)) ? (t11 = e12.charAt(Me2), Me2++) : (t11 = r8, 0 === Ne2 && Qe(pe4)), t11; + } + function ot() { + var t11, i9, n10, o8; + if (t11 = Me2, 91 === e12.charCodeAt(Me2) ? (i9 = c7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(V5)), i9 !== r8) { + for (n10 = [], (o8 = nt2()) === r8 && (o8 = it2()) === r8 && (o8 = st2()) === r8 && (o8 = pt()); o8 !== r8; ) + n10.push(o8), (o8 = nt2()) === r8 && (o8 = it2()) === r8 && (o8 = st2()) === r8 && (o8 = pt()); + 93 === e12.charCodeAt(Me2) ? (o8 = d7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(N6)), o8 !== r8 ? t11 = i9 = [i9, n10, o8] : (Me2 = t11, t11 = r8); + } else + Me2 = t11, t11 = r8; + return t11; + } + function st2() { + var t11, i9, n10, o8; + if (t11 = Me2, M6.test(e12.charAt(Me2)) ? (i9 = e12.charAt(Me2), Me2++) : (i9 = r8, 0 === Ne2 && Qe(ce4)), i9 !== r8) { + for (n10 = [], A6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(te4)); o8 !== r8; ) + n10.push(o8), A6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(te4)); + M6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(ce4)), o8 !== r8 ? t11 = i9 = [i9, n10, o8] : (Me2 = t11, t11 = r8); + } else + Me2 = t11, t11 = r8; + if (t11 === r8) + if (t11 = Me2, R6.test(e12.charAt(Me2)) ? (i9 = e12.charAt(Me2), Me2++) : (i9 = r8, 0 === Ne2 && Qe(de4)), i9 !== r8) { + for (n10 = [], I6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(ne4)); o8 !== r8; ) + n10.push(o8), I6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(ne4)); + R6.test(e12.charAt(Me2)) ? (o8 = e12.charAt(Me2), Me2++) : (o8 = r8, 0 === Ne2 && Qe(de4)), o8 !== r8 ? t11 = i9 = [i9, n10, o8] : (Me2 = t11, t11 = r8); + } else + Me2 = t11, t11 = r8; + return t11; + } + function at2() { + var t11; + return D6.test(e12.charAt(Me2)) ? (t11 = e12.charAt(Me2), Me2++) : (t11 = r8, 0 === Ne2 && Qe(fe4)), t11; + } + function pt() { + var t11, i9, n10, o8; + if (t11 = Me2, 40 === e12.charCodeAt(Me2) ? (i9 = l7, Me2++) : (i9 = r8, 0 === Ne2 && Qe(L6)), i9 !== r8) { + for (n10 = [], (o8 = st2()) === r8 && (o8 = it2()) === r8 && (o8 = nt2()) === r8 && (o8 = ot()) === r8 && (o8 = at2()) === r8 && (o8 = rt()) === r8 && (o8 = pt()); o8 !== r8; ) + n10.push(o8), (o8 = st2()) === r8 && (o8 = it2()) === r8 && (o8 = nt2()) === r8 && (o8 = ot()) === r8 && (o8 = at2()) === r8 && (o8 = rt()) === r8 && (o8 = pt()); + 41 === e12.charCodeAt(Me2) ? (o8 = u7, Me2++) : (o8 = r8, 0 === Ne2 && Qe(z6)), o8 !== r8 ? t11 = i9 = [i9, n10, o8] : (Me2 = t11, t11 = r8); + } else + Me2 = t11, t11 = r8; + return t11; + } + if ((n9 = a7()) !== r8 && Me2 === e12.length) + return n9; + throw n9 !== r8 && Me2 < e12.length && Qe({ type: "end" }), function(e13, t11, n10) { + return new i8(i8.buildMessage(e13, t11), e13, t11, n10); + }(Ve, Ce < e12.length ? e12.charAt(Ce) : null, Ce < e12.length ? Be3(Ce, Ce + 1) : Be3(Ce, Ce)); + }; + }, 64684: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(29148); + t9.default = function(e12, t10) { + if (0 === t10.length || !n8.default(e12)) + return e12; + let i9 = e12; + for (const e13 of t10.slice(0, t10.length - 1)) + if (i9 = i9[e13], !n8.default(i9)) + return; + return i9[t10[t10.length - 1]]; + }; + }, 99331: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.default = function(e12, t10, i8, n8, r8) { + const o7 = i8 < 0 ? Math.max(0, i8 + e12.length) : Math.min(e12.length, i8), s7 = n8 < 0 ? Math.max(0, n8 + e12.length) : Math.min(e12.length, n8); + return t10 >= o7 && t10 < s7 && (1 === r8 || s7 - Math.abs(r8) > 0 && (t10 + i8) % r8 == 0); + }; + }, 29148: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }), t9.default = function(e12) { + return "object" == typeof e12 && null !== e12; + }; + }, 32512: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8, r8 = i8(29148), o7 = null !== (n8 = globalThis.AggregateError) && void 0 !== n8 ? n8 : class extends Error { + constructor(e12, t10 = "") { + if (super(t10), !Array.isArray(e12) && (i9 = e12, !r8.default(i9) || "function" != typeof i9[Symbol.iterator])) + throw new TypeError(`${e12} is not an iterable`); + var i9; + this.errors = [...e12]; + } + }; + t9.default = o7; + }, 32152: (e11, t9) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + class i8 extends Error { + constructor(e12, t10) { + super(e12), void 0 !== t10 && "cause" in t10 && (this.cause = t10.cause); + } + } + t9.default = i8; + }, 19422: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(32152); + class r8 extends n8.default { + constructor(e12, t10, i9) { + super(e12, i9), this.input = t10; + } + } + t9.default = r8; + }, 32639: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(32152); + class r8 extends n8.default { + } + t9.default = r8; + }, 57190: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(64684), r8 = i8(99331), o7 = i8(29148), s7 = i8(78342); + t9.get = n8.default, t9.inBounds = r8.default, t9.isObject = o7.default, t9.Scope = s7.default; + }, 20491: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(32639); + function r8(e12) { + return "string" == typeof e12 || "number" == typeof e12 ? JSON.stringify(e12) : "unknown"; + } + function o7(e12) { + return e12 instanceof Error ? `${e12.constructor.name}(${r8(e12.message)})` : r8(e12); + } + t9.default = function(e12, t10) { + const i9 = {}; + for (const r9 of Object.keys(e12)) { + const s7 = e12[r9]; + i9[r9] = (...e13) => { + try { + s7(...e13); + } catch (e14) { + const i10 = `${s7.name || r9} threw: ${o7(e14)}`; + t10.push(new n8.default(i10, { cause: e14 })); + } + }; + } + return i9; + }; + }, 51717: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(29148); + function o7(e12, t10) { + return e12 + `[${"string" == typeof t10 ? `'${t10}'` : t10}]`; + } + var s7 = /* @__PURE__ */ new WeakMap(), a7 = /* @__PURE__ */ new WeakMap(), p7 = /* @__PURE__ */ new WeakMap(), c7 = /* @__PURE__ */ new WeakMap(); + class d7 { + constructor(e12, t10, i9 = null) { + c7.set(this, { get: f8, set: void 0 }), s7.set(this, { writable: true, value: void 0 }), a7.set(this, { writable: true, value: void 0 }), p7.set(this, { writable: true, value: void 0 }), this.root = t10, n8.classPrivateFieldSet(this, a7, e12), n8.classPrivateFieldSet(this, s7, null != i9 ? i9 : [[0, t10]]), n8.classPrivateFieldSet(this, p7, void 0); + } + get path() { + return `$${n8.classPrivateFieldGet(this, a7).reduce(o7, "")}`; + } + get depth() { + return n8.classPrivateFieldGet(this, a7).length - 1; + } + get value() { + var e12; + return void 0 !== n8.classPrivateFieldGet(this, p7) ? n8.classPrivateFieldGet(this, p7) : null !== (e12 = n8.classPrivateFieldGet(this, p7)) && void 0 !== e12 ? e12 : n8.classPrivateFieldSet(this, p7, n8.classPrivateFieldGet(this, s7)[n8.classPrivateFieldGet(this, s7).length - 1][1]); + } + get property() { + return e12 = n8.classPrivateFieldGet(this, a7), (t10 = this.depth) >= 0 && e12.length > t10 ? e12[t10] : null; + var e12, t10; + } + get parentValue() { + var e12; + return null === (e12 = n8.classPrivateFieldGet(this, c7)) || void 0 === e12 ? void 0 : e12[1]; + } + get parentProperty() { + var e12; + return n8.classPrivateFieldGet(this, a7)[null === (e12 = n8.classPrivateFieldGet(this, c7)) || void 0 === e12 ? void 0 : e12[0]]; + } + destroy() { + n8.classPrivateFieldGet(this, s7).length = 0; + } + push() { + const e12 = null !== this.property && r8.default(this.value) ? this.value[this.property] : null; + return n8.classPrivateFieldGet(this, s7).push([n8.classPrivateFieldGet(this, a7).length, e12]), n8.classPrivateFieldSet(this, p7, e12), this; + } + pop() { + const e12 = Math.max(0, n8.classPrivateFieldGet(this, a7).length + 1); + for (; n8.classPrivateFieldGet(this, s7).length > e12; ) + n8.classPrivateFieldGet(this, s7).pop(); + return n8.classPrivateFieldSet(this, p7, void 0), this; + } + at(e12) { + if (Math.abs(e12) > n8.classPrivateFieldGet(this, s7).length) + return null; + const t10 = (e12 < 0 ? n8.classPrivateFieldGet(this, s7).length : 0) + e12, i9 = n8.classPrivateFieldGet(this, s7).slice(0, t10 + 1); + return new d7(n8.classPrivateFieldGet(this, a7).slice(0, i9[i9.length - 1][0]), i9[i9.length - 1][1], i9); + } + } + function f8() { + if (!(n8.classPrivateFieldGet(this, s7).length < 3)) + return n8.classPrivateFieldGet(this, s7)[n8.classPrivateFieldGet(this, s7).length - 3]; + } + t9.Sandbox = d7; + }, 78342: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(9679), r8 = i8(32512), o7 = i8(20491), s7 = i8(51717), a7 = i8(95214), p7 = /* @__PURE__ */ new WeakMap(), c7 = /* @__PURE__ */ new WeakMap(); + class d7 { + constructor(e12, t10, i9 = null) { + p7.set(this, { writable: true, value: void 0 }), c7.set(this, { writable: true, value: void 0 }), this.root = e12, n8.classPrivateFieldSet(this, p7, i9), this.path = [], this.errors = [], this.sandbox = new s7.Sandbox(this.path, e12, null), this.callbacks = o7.default(t10, this.errors); + const r9 = this; + n8.classPrivateFieldSet(this, c7, { path: this.path, get value() { + return r9.value; + } }); + } + get depth() { + return this.path.length - 1; + } + get property() { + return this.sandbox.property; + } + get value() { + return this.sandbox.value; + } + enter(e12) { + return this.path.push(e12), this.sandbox = this.sandbox.push(), this.path.length; + } + exit(e12) { + const t10 = Math.max(0, e12 - 1); + for (; this.path.length > t10; ) + this.path.pop(); + return this.sandbox = this.sandbox.pop(), this.path.length; + } + fork(e12) { + const t10 = new d7(this.root, this.callbacks, this); + for (const i9 of e12) + if (t10.enter(i9), void 0 === t10.value) + return null; + return t10; + } + traverse(e12, t10) { + null !== t10 ? a7.zonedTraverse.call(this, e12, t10) : a7.traverse.call(this, e12); + } + bail(e12, t10, i9) { + const n9 = this.fork(this.path); + a7.bailedTraverse.call(n9, t10, i9); + } + emit(e12, t10, i9) { + var r9; + const o8 = this.callbacks[e12]; + if (0 === t10 && !i9) + return void o8(n8.classPrivateFieldGet(this, c7)); + if (0 !== t10 && t10 > this.depth + 1) + return; + const s8 = 0 === t10 ? n8.classPrivateFieldGet(this, c7) : { path: n8.classPrivateFieldGet(this, c7).path.slice(0, Math.max(0, n8.classPrivateFieldGet(this, c7).path.length - t10)), value: (null !== (r9 = this.sandbox.at(-t10 - 1)) && void 0 !== r9 ? r9 : this.sandbox.at(0)).value }; + o8(i9 ? { path: s8.path, value: 0 === s8.path.length ? void 0 : s8.path[s8.path.length - 1] } : s8); + } + destroy() { + if (this.path.length = 0, this.sandbox.destroy(), this.sandbox = null, this.errors.length > 0) + throw new r8.default(this.errors, "Error running Nimma"); + } + } + t9.default = d7; + }, 95214: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(29148); + function r8(e12, t10, i9, r9, s8) { + const a8 = t10[e12], p8 = i9.enter(e12), c7 = null !== s8 && s8.length > 0 && !s8[0].fn(i9); + (null === s8 || 1 === s8.length && c7) && r9(i9), n8.default(a8) && (null === s8 ? o7(a8, i9, r9, s8) : s8.length > 0 && (c7 && o7(a8, i9, r9, s8.slice(1)), s8[0].deep && (i9.exit(p8), i9.enter(e12), o7(a8, i9, r9, s8)))), i9.exit(p8); + } + function o7(e12, t10, i9, n9) { + if (Array.isArray(e12)) + for (let o8 = 0; o8 < e12.length; o8++) + r8(o8, e12, t10, i9, n9); + else + for (const o8 of Object.keys(e12)) + r8(o8, e12, t10, i9, n9); + } + const s7 = /* @__PURE__ */ new WeakMap(), a7 = { get(e12, t10) { + const i9 = e12[t10]; + if (Array.isArray(e12)) { + if ("length" === t10) + return e12.length; + const r9 = s7.get(e12); + return t10 in r9 && n8.default(i9) && s7.set(i9, r9[t10]), i9; + } + if (!n8.default(i9)) + return i9; + if (!p7(i9)) + return i9; + if (Array.isArray(i9)) + for (const e13 of i9) + n8.default(e13) && s7.set(e13, s7.get(i9)); + return "**" in s7.get(i9) ? i9 : new Proxy(i9, a7); + }, ownKeys(e12) { + const t10 = s7.get(e12); + if (s7.delete(e12), "*" in t10) { + const i10 = Object.keys(e12); + for (const r9 of i10) { + const i11 = e12[r9]; + n8.default(i11) && s7.set(i11, t10["*"]); + } + return i10; + } + const i9 = Object.keys(t10); + for (let r9 = 0; r9 < i9.length; r9++) { + const o8 = i9[r9]; + if (!Object.hasOwnProperty.call(e12, o8)) { + i9.splice(r9, 1), r9--; + continue; + } + const a8 = e12[o8]; + n8.default(a8) && s7.set(a8, t10[o8]); + } + return i9; + } }; + function p7(e12) { + return !(Object.isFrozen(e12) || Object.isSealed(e12) || !Object.isExtensible(e12)); + } + t9.bailedTraverse = function(e12, t10) { + o7(this.value, this, e12, t10); + }, t9.traverse = function(e12) { + o7(this.root, this, e12, null); + }, t9.zonedTraverse = function(e12, t10) { + p7(this.root) ? (s7.set(this.root, t10), o7(new Proxy(this.root, a7), this, e12, null)) : o7(this.root, this, e12, null); + }; + }, 46065: (e11, t9, i8) => { + "use strict"; + Object.defineProperty(t9, "__esModule", { value: true }); + var n8 = i8(17547), r8 = i8(56135); + function o7(e12) { + return e12 && "object" == typeof e12 && "default" in e12 ? e12 : { default: e12 }; + } + var s7 = o7(n8); + t9.default = (e12, t10) => { + const i9 = "object" == typeof e12 ? e12 : function(e13) { + try { + return s7.default(e13); + } catch (e14) { + throw SyntaxError(e14.message); + } + }(e12); + return r8.default(i9, Object.freeze(t10)); + }; + }, 56135: (e11, t9) => { + "use strict"; + function i8(e12, t10) { + switch (e12.type) { + case "Program": + return function(e13, t11) { + if (1 !== e13.body.length) + throw SyntaxError("Too complex expression"); + return i8(e13.body[0], t11); + }(e12, t10); + case "ExpressionStatement": + return i8(e12.expression, t10); + case "MemberExpression": + return function(e13, t11) { + const n8 = i8(e13.object, t11), r8 = "Identifier" === e13.property.type ? e13.property.name : i8(e13.property, t11); + return "function" == typeof n8[r8] ? n8[r8].bind(n8) : n8[r8]; + }(e12, t10); + case "LogicalExpression": + case "BinaryExpression": + return function(e13, t11) { + return function(e14, t12) { + return Function("lhs, rhs", `return lhs ${e14.operator} rhs`)(i8(e14.left, t12), i8(e14.right, t12)); + }(e13, t11); + }(e12, t10); + case "ConditionalExpression": + return function(e13, t11) { + return Function("t, c, a", "return t ? c : a")(i8(e13.test, t11), i8(e13.consequent, t11), i8(e13.alternate, t11)); + }(e12, t10); + case "UnaryExpression": + return function(e13, t11) { + if (!e13.prefix || "UnaryExpression" === e13.argument.type) + throw SyntaxError("Unexpected operator"); + return Function("v", `return ${e13.operator}v`)(i8(e13.argument, t11)); + }(e12, t10); + case "CallExpression": + return function(e13, t11) { + return Reflect.apply(i8(e13.callee, t11), null, e13.arguments.map((e14) => i8(e14, t11))); + }(e12, t10); + case "NewExpression": + return function(e13, t11) { + return Reflect.construct(i8(e13.callee, t11), e13.arguments.map((e14) => i8(e14, t11))); + }(e12, t10); + case "ArrayExpression": + return function(e13, t11) { + return e13.elements.map((e14) => i8(e14, t11)); + }(e12, t10); + case "ThisExpression": + return t10; + case "Identifier": + return function(e13, t11) { + if (void 0 === t11 || !(e13 in t11)) + throw ReferenceError(`${e13} is not defined`); + return Reflect.get(t11, e13, t11); + }(e12.name, t10); + case "Literal": + return e12.value; + default: + throw SyntaxError("Unexpected node"); + } + } + Object.defineProperty(t9, "__esModule", { value: true }), t9.default = i8; + }, 4910: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { default: () => n8 }); + var n8 = { name: "regex", init(e12) { + e12.hooks.add("gobble-token", function(t10) { + if (47 === this.code) { + const i9 = ++this.index; + let n9 = false; + for (; this.index < this.expr.length; ) { + if (47 === this.code && !n9) { + const n10 = this.expr.slice(i9, this.index); + let r8, o7 = ""; + for (; ++this.index < this.expr.length; ) { + const e13 = this.code; + if (!(e13 >= 97 && e13 <= 122 || e13 >= 65 && e13 <= 90 || e13 >= 48 && e13 <= 57)) + break; + o7 += this.char; + } + try { + r8 = new RegExp(n10, o7); + } catch (e13) { + this.throwError(e13.message); + } + return t10.node = { type: e12.LITERAL, value: r8, raw: this.expr.slice(i9 - 1, this.index) }, t10.node = this.gobbleTokenProperty(t10.node), t10.node; + } + this.code === e12.OBRACK_CODE ? n9 = true : n9 && this.code === e12.CBRACK_CODE && (n9 = false), this.index += 92 === this.code ? 2 : 1; + } + this.throwError("Unclosed Regex"); + } + }); + } }; + }, 6270: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { default: () => n8 }); + var n8 = { name: "ternary", init(e12) { + e12.hooks.add("after-expression", function(t10) { + if (t10.node && this.code === e12.QUMARK_CODE) { + this.index++; + const i9 = t10.node, n9 = this.gobbleExpression(); + if (n9 || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === e12.COLON_CODE) { + this.index++; + const r8 = this.gobbleExpression(); + if (r8 || this.throwError("Expected expression"), t10.node = { type: "ConditionalExpression", test: i9, consequent: n9, alternate: r8 }, i9.operator && e12.binary_ops[i9.operator] <= 0.9) { + let n10 = i9; + for (; n10.right.operator && e12.binary_ops[n10.right.operator] <= 0.9; ) + n10 = n10.right; + t10.node.test = n10.right, n10.right = t10.node, t10.node = i9; + } + } else + this.throwError("Expected :"); + } + }); + } }; + }, 70824: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 73522: (e11, t9, i8) => { + "use strict"; + function n8(e12) { + return n8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e13) { + return typeof e13; + } : function(e13) { + return e13 && "function" == typeof Symbol && e13.constructor === Symbol && e13 !== Symbol.prototype ? "symbol" : typeof e13; + }, n8(e12); + } + function r8(e12, t10) { + if (!(e12 instanceof t10)) + throw new TypeError("Cannot call a class as a function"); + } + function o7(e12, t10) { + for (var i9 = 0; i9 < t10.length; i9++) { + var n9 = t10[i9]; + n9.enumerable = n9.enumerable || false, n9.configurable = true, "value" in n9 && (n9.writable = true), Object.defineProperty(e12, n9.key, n9); + } + } + function s7(e12, t10, i9) { + return t10 && o7(e12.prototype, t10), i9 && o7(e12, i9), Object.defineProperty(e12, "prototype", { writable: false }), e12; + } + function a7(e12) { + return a7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e13) { + return e13.__proto__ || Object.getPrototypeOf(e13); + }, a7(e12); + } + function p7(e12, t10) { + return p7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e13, t11) { + return e13.__proto__ = t11, e13; + }, p7(e12, t10); + } + function c7() { + if ("undefined" == typeof Reflect || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if ("function" == typeof Proxy) + return true; + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })), true; + } catch (e12) { + return false; + } + } + function d7(e12, t10, i9) { + return d7 = c7() ? Reflect.construct.bind() : function(e13, t11, i10) { + var n9 = [null]; + n9.push.apply(n9, t11); + var r9 = new (Function.bind.apply(e13, n9))(); + return i10 && p7(r9, i10.prototype), r9; + }, d7.apply(null, arguments); + } + function f8(e12) { + var t10 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; + return f8 = function(e13) { + if (null === e13 || (i9 = e13, -1 === Function.toString.call(i9).indexOf("[native code]"))) + return e13; + var i9; + if ("function" != typeof e13) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== t10) { + if (t10.has(e13)) + return t10.get(e13); + t10.set(e13, n9); + } + function n9() { + return d7(e13, arguments, a7(this).constructor); + } + return n9.prototype = Object.create(e13.prototype, { constructor: { value: n9, enumerable: false, writable: true, configurable: true } }), p7(n9, e13); + }, f8(e12); + } + function l7(e12, t10) { + if (e12) { + if ("string" == typeof e12) + return u7(e12, t10); + var i9 = Object.prototype.toString.call(e12).slice(8, -1); + return "Object" === i9 && e12.constructor && (i9 = e12.constructor.name), "Map" === i9 || "Set" === i9 ? Array.from(e12) : "Arguments" === i9 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i9) ? u7(e12, t10) : void 0; + } + } + function u7(e12, t10) { + (null == t10 || t10 > e12.length) && (t10 = e12.length); + for (var i9 = 0, n9 = new Array(t10); i9 < t10; i9++) + n9[i9] = e12[i9]; + return n9; + } + i8.r(t9), i8.d(t9, { JSONPath: () => b8 }); + var m7 = Object.prototype.hasOwnProperty; + function h8(e12, t10) { + return (e12 = e12.slice()).push(t10), e12; + } + function y7(e12, t10) { + return (t10 = t10.slice()).unshift(e12), t10; + } + var g7 = function(e12) { + !function(e13, t11) { + if ("function" != typeof t11 && null !== t11) + throw new TypeError("Super expression must either be null or a function"); + e13.prototype = Object.create(t11 && t11.prototype, { constructor: { value: e13, writable: true, configurable: true } }), Object.defineProperty(e13, "prototype", { writable: false }), t11 && p7(e13, t11); + }(o8, e12); + var t10, i9, n9 = (t10 = o8, i9 = c7(), function() { + var e13, n10 = a7(t10); + if (i9) { + var r9 = a7(this).constructor; + e13 = Reflect.construct(n10, arguments, r9); + } else + e13 = n10.apply(this, arguments); + return function(e14, t11) { + if (t11 && ("object" == typeof t11 || "function" == typeof t11)) + return t11; + if (void 0 !== t11) + throw new TypeError("Derived constructors may only return object or undefined"); + return function(e15) { + if (void 0 === e15) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e15; + }(e14); + }(this, e13); + }); + function o8(e13) { + var t11; + return r8(this, o8), (t11 = n9.call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew = true, t11.value = e13, t11.name = "NewError", t11; + } + return s7(o8); + }(f8(Error)); + function b8(e12, t10, i9, r9, o8) { + if (!(this instanceof b8)) + try { + return new b8(e12, t10, i9, r9, o8); + } catch (e13) { + if (!e13.avoidNew) + throw e13; + return e13.value; + } + "string" == typeof e12 && (o8 = r9, r9 = i9, i9 = t10, t10 = e12, e12 = null); + var s8 = e12 && "object" === n8(e12); + if (e12 = e12 || {}, this.json = e12.json || i9, this.path = e12.path || t10, this.resultType = e12.resultType || "value", this.flatten = e12.flatten || false, this.wrap = !m7.call(e12, "wrap") || e12.wrap, this.sandbox = e12.sandbox || {}, this.preventEval = e12.preventEval || false, this.parent = e12.parent || null, this.parentProperty = e12.parentProperty || null, this.callback = e12.callback || r9 || null, this.otherTypeCallback = e12.otherTypeCallback || o8 || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }, false !== e12.autostart) { + var a8 = { path: s8 ? e12.path : t10 }; + s8 ? "json" in e12 && (a8.json = e12.json) : a8.json = i9; + var p8 = this.evaluate(a8); + if (!p8 || "object" !== n8(p8)) + throw new g7(p8); + return p8; + } + } + b8.prototype.evaluate = function(e12, t10, i9, r9) { + var o8 = this, s8 = this.parent, a8 = this.parentProperty, p8 = this.flatten, c8 = this.wrap; + if (this.currResultType = this.resultType, this.currPreventEval = this.preventEval, this.currSandbox = this.sandbox, i9 = i9 || this.callback, this.currOtherTypeCallback = r9 || this.otherTypeCallback, t10 = t10 || this.json, (e12 = e12 || this.path) && "object" === n8(e12) && !Array.isArray(e12)) { + if (!e12.path && "" !== e12.path) + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + if (!m7.call(e12, "json")) + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + t10 = e12.json, p8 = m7.call(e12, "flatten") ? e12.flatten : p8, this.currResultType = m7.call(e12, "resultType") ? e12.resultType : this.currResultType, this.currSandbox = m7.call(e12, "sandbox") ? e12.sandbox : this.currSandbox, c8 = m7.call(e12, "wrap") ? e12.wrap : c8, this.currPreventEval = m7.call(e12, "preventEval") ? e12.preventEval : this.currPreventEval, i9 = m7.call(e12, "callback") ? e12.callback : i9, this.currOtherTypeCallback = m7.call(e12, "otherTypeCallback") ? e12.otherTypeCallback : this.currOtherTypeCallback, s8 = m7.call(e12, "parent") ? e12.parent : s8, a8 = m7.call(e12, "parentProperty") ? e12.parentProperty : a8, e12 = e12.path; + } + if (s8 = s8 || null, a8 = a8 || null, Array.isArray(e12) && (e12 = b8.toPathString(e12)), (e12 || "" === e12) && t10) { + var d8 = b8.toPathArray(e12); + "$" === d8[0] && d8.length > 1 && d8.shift(), this._hasParentSelector = null; + var f9 = this._trace(d8, t10, ["$"], s8, a8, i9).filter(function(e13) { + return e13 && !e13.isParentSelector; + }); + return f9.length ? c8 || 1 !== f9.length || f9[0].hasArrExpr ? f9.reduce(function(e13, t11) { + var i10 = o8._getPreferredOutput(t11); + return p8 && Array.isArray(i10) ? e13 = e13.concat(i10) : e13.push(i10), e13; + }, []) : this._getPreferredOutput(f9[0]) : c8 ? [] : void 0; + } + }, b8.prototype._getPreferredOutput = function(e12) { + var t10 = this.currResultType; + switch (t10) { + case "all": + var i9 = Array.isArray(e12.path) ? e12.path : b8.toPathArray(e12.path); + return e12.pointer = b8.toPointer(i9), e12.path = "string" == typeof e12.path ? e12.path : b8.toPathString(e12.path), e12; + case "value": + case "parent": + case "parentProperty": + return e12[t10]; + case "path": + return b8.toPathString(e12[t10]); + case "pointer": + return b8.toPointer(e12.path); + default: + throw new TypeError("Unknown result type"); + } + }, b8.prototype._handleCallback = function(e12, t10, i9) { + if (t10) { + var n9 = this._getPreferredOutput(e12); + e12.path = "string" == typeof e12.path ? e12.path : b8.toPathString(e12.path), t10(n9, i9, e12); + } + }, b8.prototype._trace = function(e12, t10, i9, r9, o8, s8, a8, p8) { + var c8, d8 = this; + if (!e12.length) + return c8 = { path: i9, value: t10, parent: r9, parentProperty: o8, hasArrExpr: a8 }, this._handleCallback(c8, s8, "value"), c8; + var f9 = e12[0], u8 = e12.slice(1), g8 = []; + function b9(e13) { + Array.isArray(e13) ? e13.forEach(function(e14) { + g8.push(e14); + }) : g8.push(e13); + } + if (("string" != typeof f9 || p8) && t10 && m7.call(t10, f9)) + b9(this._trace(u8, t10[f9], h8(i9, f9), t10, f9, s8, a8)); + else if ("*" === f9) + this._walk(f9, u8, t10, i9, r9, o8, s8, function(e13, t11, i10, n9, r10, o9, s9, a9) { + b9(d8._trace(y7(e13, i10), n9, r10, o9, s9, a9, true, true)); + }); + else if (".." === f9) + b9(this._trace(u8, t10, i9, r9, o8, s8, a8)), this._walk(f9, u8, t10, i9, r9, o8, s8, function(e13, t11, i10, r10, o9, s9, a9, p9) { + "object" === n8(r10[e13]) && b9(d8._trace(y7(t11, i10), r10[e13], h8(o9, e13), r10, e13, p9, true)); + }); + else { + if ("^" === f9) + return this._hasParentSelector = true, { path: i9.slice(0, -1), expr: u8, isParentSelector: true }; + if ("~" === f9) + return c8 = { path: h8(i9, f9), value: o8, parent: r9, parentProperty: null }, this._handleCallback(c8, s8, "property"), c8; + if ("$" === f9) + b9(this._trace(u8, t10, i9, null, null, s8, a8)); + else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(f9)) + b9(this._slice(f9, u8, t10, i9, r9, o8, s8)); + else if (0 === f9.indexOf("?(")) { + if (this.currPreventEval) + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + this._walk(f9, u8, t10, i9, r9, o8, s8, function(e13, t11, i10, n9, r10, o9, s9, a9) { + d8._eval(t11.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, "$1"), n9[e13], e13, r10, o9, s9) && b9(d8._trace(y7(e13, i10), n9, r10, o9, s9, a9, true)); + }); + } else if ("(" === f9[0]) { + if (this.currPreventEval) + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + b9(this._trace(y7(this._eval(f9, t10, i9[i9.length - 1], i9.slice(0, -1), r9, o8), u8), t10, i9, r9, o8, s8, a8)); + } else if ("@" === f9[0]) { + var v9 = false, j6 = f9.slice(1, -2); + switch (j6) { + case "scalar": + t10 && ["object", "function"].includes(n8(t10)) || (v9 = true); + break; + case "boolean": + case "string": + case "undefined": + case "function": + n8(t10) === j6 && (v9 = true); + break; + case "integer": + !Number.isFinite(t10) || t10 % 1 || (v9 = true); + break; + case "number": + Number.isFinite(t10) && (v9 = true); + break; + case "nonFinite": + "number" != typeof t10 || Number.isFinite(t10) || (v9 = true); + break; + case "object": + t10 && n8(t10) === j6 && (v9 = true); + break; + case "array": + Array.isArray(t10) && (v9 = true); + break; + case "other": + v9 = this.currOtherTypeCallback(t10, i9, r9, o8); + break; + case "null": + null === t10 && (v9 = true); + break; + default: + throw new TypeError("Unknown value type " + j6); + } + if (v9) + return c8 = { path: i9, value: t10, parent: r9, parentProperty: o8 }, this._handleCallback(c8, s8, "value"), c8; + } else if ("`" === f9[0] && t10 && m7.call(t10, f9.slice(1))) { + var $5 = f9.slice(1); + b9(this._trace(u8, t10[$5], h8(i9, $5), t10, $5, s8, a8, true)); + } else if (f9.includes(",")) { + var x7, _6 = function(e13) { + var t11 = "undefined" != typeof Symbol && e13[Symbol.iterator] || e13["@@iterator"]; + if (!t11) { + if (Array.isArray(e13) || (t11 = l7(e13))) { + t11 && (e13 = t11); + var i10 = 0, n9 = function() { + }; + return { s: n9, n: function() { + return i10 >= e13.length ? { done: true } : { done: false, value: e13[i10++] }; + }, e: function(e14) { + throw e14; + }, f: n9 }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var r10, o9 = true, s9 = false; + return { s: function() { + t11 = t11.call(e13); + }, n: function() { + var e14 = t11.next(); + return o9 = e14.done, e14; + }, e: function(e14) { + s9 = true, r10 = e14; + }, f: function() { + try { + o9 || null == t11.return || t11.return(); + } finally { + if (s9) + throw r10; + } + } }; + }(f9.split(",")); + try { + for (_6.s(); !(x7 = _6.n()).done; ) { + var w6 = x7.value; + b9(this._trace(y7(w6, u8), t10, i9, r9, o8, s8, true)); + } + } catch (e13) { + _6.e(e13); + } finally { + _6.f(); + } + } else + !p8 && t10 && m7.call(t10, f9) && b9(this._trace(u8, t10[f9], h8(i9, f9), t10, f9, s8, a8, true)); + } + if (this._hasParentSelector) + for (var S6 = 0; S6 < g8.length; S6++) { + var P6 = g8[S6]; + if (P6 && P6.isParentSelector) { + var O7 = this._trace(P6.expr, t10, P6.path, r9, o8, s8, a8); + if (Array.isArray(O7)) { + g8[S6] = O7[0]; + for (var T6 = O7.length, A6 = 1; A6 < T6; A6++) + S6++, g8.splice(S6, 0, O7[A6]); + } else + g8[S6] = O7; + } + } + return g8; + }, b8.prototype._walk = function(e12, t10, i9, r9, o8, s8, a8, p8) { + if (Array.isArray(i9)) + for (var c8 = i9.length, d8 = 0; d8 < c8; d8++) + p8(d8, e12, t10, i9, r9, o8, s8, a8); + else + i9 && "object" === n8(i9) && Object.keys(i9).forEach(function(n9) { + p8(n9, e12, t10, i9, r9, o8, s8, a8); + }); + }, b8.prototype._slice = function(e12, t10, i9, n9, r9, o8, s8) { + if (Array.isArray(i9)) { + var a8 = i9.length, p8 = e12.split(":"), c8 = p8[2] && Number.parseInt(p8[2]) || 1, d8 = p8[0] && Number.parseInt(p8[0]) || 0, f9 = p8[1] && Number.parseInt(p8[1]) || a8; + d8 = d8 < 0 ? Math.max(0, d8 + a8) : Math.min(a8, d8), f9 = f9 < 0 ? Math.max(0, f9 + a8) : Math.min(a8, f9); + for (var l8 = [], u8 = d8; u8 < f9; u8 += c8) + this._trace(y7(u8, t10), i9, n9, r9, o8, s8, true).forEach(function(e13) { + l8.push(e13); + }); + return l8; + } + }, b8.prototype._eval = function(e12, t10, i9, n9, r9, o8) { + this.currSandbox._$_parentProperty = o8, this.currSandbox._$_parent = r9, this.currSandbox._$_property = i9, this.currSandbox._$_root = this.json, this.currSandbox._$_v = t10; + var s8 = e12.includes("@path"); + s8 && (this.currSandbox._$_path = b8.toPathString(n9.concat([i9]))); + var a8 = "script:" + e12; + if (!b8.cache[a8]) { + var p8 = e12.replace(/@parentProperty/g, "_$_parentProperty").replace(/@parent/g, "_$_parent").replace(/@property/g, "_$_property").replace(/@root/g, "_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, "_$_v$1"); + s8 && (p8 = p8.replace(/@path/g, "_$_path")), b8.cache[a8] = new this.vm.Script(p8); + } + try { + return b8.cache[a8].runInNewContext(this.currSandbox); + } catch (t11) { + throw new Error("jsonPath: " + t11.message + ": " + e12); + } + }, b8.cache = {}, b8.toPathString = function(e12) { + for (var t10 = e12, i9 = t10.length, n9 = "$", r9 = 1; r9 < i9; r9++) + /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t10[r9]) || (n9 += /^[\*0-9]+$/.test(t10[r9]) ? "[" + t10[r9] + "]" : "['" + t10[r9] + "']"); + return n9; + }, b8.toPointer = function(e12) { + for (var t10 = e12, i9 = t10.length, n9 = "", r9 = 1; r9 < i9; r9++) + /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t10[r9]) || (n9 += "/" + t10[r9].toString().replace(/~/g, "~0").replace(/\//g, "~1")); + return n9; + }, b8.toPathArray = function(e12) { + var t10 = b8.cache; + if (t10[e12]) + return t10[e12].concat(); + var i9 = [], n9 = e12.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g, function(e13, t11) { + return "[#" + (i9.push(t11) - 1) + "]"; + }).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g, function(e13, t11) { + return "['" + t11.replace(/\./g, "%@%").replace(/~/g, "%%@@%%") + "']"; + }).replace(/~/g, ";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g, ";").replace(/%@%/g, ".").replace(/%%@@%%/g, "~").replace(/(?:;)?(\^+)(?:;)?/g, function(e13, t11) { + return ";" + t11.split("").join(";") + ";"; + }).replace(/;;;|;;/g, ";..;").replace(/;$|'?\]|'$/g, "").split(";").map(function(e13) { + var t11 = e13.match(/#([0-9]+)/); + return t11 && t11[1] ? i9[t11[1]] : e13; + }); + return t10[e12] = n9, t10[e12].concat(); + }; + var v8 = function() { + function e12(t10) { + r8(this, e12), this.code = t10; + } + return s7(e12, [{ key: "runInNewContext", value: function(e13) { + var t10 = this.code, i9 = Object.keys(e13), n9 = []; + !function(t11, i10) { + for (var n10 = t11.length, r10 = 0; r10 < n10; r10++) + o9 = t11[r10], "function" == typeof e13[o9] && i10.push(t11.splice(r10--, 1)[0]); + var o9; + }(i9, n9); + var r9 = i9.map(function(t11, i10) { + return e13[t11]; + }), o8 = n9.reduce(function(t11, i10) { + var n10 = e13[i10].toString(); + return /function/.test(n10) || (n10 = "function " + n10), "var " + i10 + "=" + n10 + ";" + t11; + }, ""); + /(["'])use strict\1/.test(t10 = o8 + t10) || i9.includes("arguments") || (t10 = "var arguments = undefined;" + t10); + var s8, a8 = (t10 = t10.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, "")).lastIndexOf(";"), p8 = a8 > -1 ? t10.slice(0, a8 + 1) + " return " + t10.slice(a8 + 1) : " return " + t10; + return d7(Function, i9.concat([p8])).apply(void 0, function(e14) { + if (Array.isArray(e14)) + return u7(e14); + }(s8 = r9) || function(e14) { + if ("undefined" != typeof Symbol && null != e14[Symbol.iterator] || null != e14["@@iterator"]) + return Array.from(e14); + }(s8) || l7(s8) || function() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + }()); + } }]), e12; + }(); + b8.prototype.vm = { Script: v8 }; + }, 99747: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 57494: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 69371: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 39862: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 2230: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 54078: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 94169: (e11, t9, i8) => { + "use strict"; + var n8, r8, o7, s7, a7; + i8.d(t9, { h_: () => o7 }), function(e12) { + e12.None = "none", e12.Declared = "declared", e12.InheritedFromService = "inheritedFromService"; + }(n8 || (n8 = {})), function(e12) { + e12.Unspecified = "unspecified", e12.Simple = "simple", e12.Matrix = "matrix", e12.Label = "label", e12.Form = "form", e12.CommaDelimited = "commaDelimited", e12.SpaceDelimited = "spaceDelimited", e12.PipeDelimited = "pipeDelimited", e12.DeepObject = "deepObject", e12.TabDelimited = "tabDelimited"; + }(r8 || (r8 = {})), function(e12) { + e12[e12.Error = 0] = "Error", e12[e12.Warning = 1] = "Warning", e12[e12.Information = 2] = "Information", e12[e12.Hint = 3] = "Hint"; + }(o7 || (o7 = {})), function(e12) { + e12.Article = "article", e12.HttpService = "http_service", e12.HttpServer = "http_server", e12.HttpOperation = "http_operation", e12.HttpCallback = "http_callback", e12.Model = "model", e12.Generic = "generic", e12.Unknown = "unknown", e12.TableOfContents = "table_of_contents", e12.SpectralRuleset = "spectral_ruleset", e12.Styleguide = "styleguide", e12.Image = "image", e12.StoplightResolutions = "stoplight_resolutions", e12.StoplightOverride = "stoplight_override"; + }(s7 || (s7 = {})), function(e12) { + e12.Json = "json", e12.Markdown = "markdown", e12.Yaml = "yaml", e12.Javascript = "javascript", e12.Apng = "apng", e12.Avif = "avif", e12.Bmp = "bmp", e12.Gif = "gif", e12.Jpeg = "jpeg", e12.Png = "png", e12.Svg = "svg", e12.Webp = "webp"; + }(a7 || (a7 = {})); + }, 29180: (e11, t9, i8) => { + "use strict"; + i8.r(t9), i8.d(t9, { __addDisposableResource: () => M6, __assign: () => o7, __asyncDelegator: () => S6, __asyncGenerator: () => w6, __asyncValues: () => P6, __await: () => _6, __awaiter: () => m7, __classPrivateFieldGet: () => E6, __classPrivateFieldIn: () => k6, __classPrivateFieldSet: () => q5, __createBinding: () => y7, __decorate: () => a7, __disposeResources: () => D6, __esDecorate: () => c7, __exportStar: () => g7, __extends: () => r8, __generator: () => h8, __importDefault: () => I6, __importStar: () => A6, __makeTemplateObject: () => O7, __metadata: () => u7, __param: () => p7, __propKey: () => f8, __read: () => v8, __rest: () => s7, __runInitializers: () => d7, __setFunctionName: () => l7, __spread: () => j6, __spreadArray: () => x7, __spreadArrays: () => $5, __values: () => b8, default: () => C6 }); + var n8 = function(e12, t10) { + return n8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e13, t11) { + e13.__proto__ = t11; + } || function(e13, t11) { + for (var i9 in t11) + Object.prototype.hasOwnProperty.call(t11, i9) && (e13[i9] = t11[i9]); + }, n8(e12, t10); + }; + function r8(e12, t10) { + if ("function" != typeof t10 && null !== t10) + throw new TypeError("Class extends value " + String(t10) + " is not a constructor or null"); + function i9() { + this.constructor = e12; + } + n8(e12, t10), e12.prototype = null === t10 ? Object.create(t10) : (i9.prototype = t10.prototype, new i9()); + } + var o7 = function() { + return o7 = Object.assign || function(e12) { + for (var t10, i9 = 1, n9 = arguments.length; i9 < n9; i9++) + for (var r9 in t10 = arguments[i9]) + Object.prototype.hasOwnProperty.call(t10, r9) && (e12[r9] = t10[r9]); + return e12; + }, o7.apply(this, arguments); + }; + function s7(e12, t10) { + var i9 = {}; + for (var n9 in e12) + Object.prototype.hasOwnProperty.call(e12, n9) && t10.indexOf(n9) < 0 && (i9[n9] = e12[n9]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n9 = Object.getOwnPropertySymbols(e12); r9 < n9.length; r9++) + t10.indexOf(n9[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n9[r9]) && (i9[n9[r9]] = e12[n9[r9]]); + } + return i9; + } + function a7(e12, t10, i9, n9) { + var r9, o8 = arguments.length, s8 = o8 < 3 ? t10 : null === n9 ? n9 = Object.getOwnPropertyDescriptor(t10, i9) : n9; + if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) + s8 = Reflect.decorate(e12, t10, i9, n9); + else + for (var a8 = e12.length - 1; a8 >= 0; a8--) + (r9 = e12[a8]) && (s8 = (o8 < 3 ? r9(s8) : o8 > 3 ? r9(t10, i9, s8) : r9(t10, i9)) || s8); + return o8 > 3 && s8 && Object.defineProperty(t10, i9, s8), s8; + } + function p7(e12, t10) { + return function(i9, n9) { + t10(i9, n9, e12); + }; + } + function c7(e12, t10, i9, n9, r9, o8) { + function s8(e13) { + if (void 0 !== e13 && "function" != typeof e13) + throw new TypeError("Function expected"); + return e13; + } + for (var a8, p8 = n9.kind, c8 = "getter" === p8 ? "get" : "setter" === p8 ? "set" : "value", d8 = !t10 && e12 ? n9.static ? e12 : e12.prototype : null, f9 = t10 || (d8 ? Object.getOwnPropertyDescriptor(d8, n9.name) : {}), l8 = false, u8 = i9.length - 1; u8 >= 0; u8--) { + var m8 = {}; + for (var h9 in n9) + m8[h9] = "access" === h9 ? {} : n9[h9]; + for (var h9 in n9.access) + m8.access[h9] = n9.access[h9]; + m8.addInitializer = function(e13) { + if (l8) + throw new TypeError("Cannot add initializers after decoration has completed"); + o8.push(s8(e13 || null)); + }; + var y8 = (0, i9[u8])("accessor" === p8 ? { get: f9.get, set: f9.set } : f9[c8], m8); + if ("accessor" === p8) { + if (void 0 === y8) + continue; + if (null === y8 || "object" != typeof y8) + throw new TypeError("Object expected"); + (a8 = s8(y8.get)) && (f9.get = a8), (a8 = s8(y8.set)) && (f9.set = a8), (a8 = s8(y8.init)) && r9.unshift(a8); + } else + (a8 = s8(y8)) && ("field" === p8 ? r9.unshift(a8) : f9[c8] = a8); + } + d8 && Object.defineProperty(d8, n9.name, f9), l8 = true; + } + function d7(e12, t10, i9) { + for (var n9 = arguments.length > 2, r9 = 0; r9 < t10.length; r9++) + i9 = n9 ? t10[r9].call(e12, i9) : t10[r9].call(e12); + return n9 ? i9 : void 0; + } + function f8(e12) { + return "symbol" == typeof e12 ? e12 : "".concat(e12); + } + function l7(e12, t10, i9) { + return "symbol" == typeof t10 && (t10 = t10.description ? "[".concat(t10.description, "]") : ""), Object.defineProperty(e12, "name", { configurable: true, value: i9 ? "".concat(i9, " ", t10) : t10 }); + } + function u7(e12, t10) { + if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) + return Reflect.metadata(e12, t10); + } + function m7(e12, t10, i9, n9) { + return new (i9 || (i9 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n9.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n9.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i9 ? t11 : new i9(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n9 = n9.apply(e12, t10 || [])).next()); + }); + } + function h8(e12, t10) { + var i9, n9, r9, o8, s8 = { label: 0, sent: function() { + if (1 & r9[0]) + throw r9[1]; + return r9[1]; + }, trys: [], ops: [] }; + return o8 = { next: a8(0), throw: a8(1), return: a8(2) }, "function" == typeof Symbol && (o8[Symbol.iterator] = function() { + return this; + }), o8; + function a8(a9) { + return function(p8) { + return function(a10) { + if (i9) + throw new TypeError("Generator is already executing."); + for (; o8 && (o8 = 0, a10[0] && (s8 = 0)), s8; ) + try { + if (i9 = 1, n9 && (r9 = 2 & a10[0] ? n9.return : a10[0] ? n9.throw || ((r9 = n9.return) && r9.call(n9), 0) : n9.next) && !(r9 = r9.call(n9, a10[1])).done) + return r9; + switch (n9 = 0, r9 && (a10 = [2 & a10[0], r9.value]), a10[0]) { + case 0: + case 1: + r9 = a10; + break; + case 4: + return s8.label++, { value: a10[1], done: false }; + case 5: + s8.label++, n9 = a10[1], a10 = [0]; + continue; + case 7: + a10 = s8.ops.pop(), s8.trys.pop(); + continue; + default: + if (!((r9 = (r9 = s8.trys).length > 0 && r9[r9.length - 1]) || 6 !== a10[0] && 2 !== a10[0])) { + s8 = 0; + continue; + } + if (3 === a10[0] && (!r9 || a10[1] > r9[0] && a10[1] < r9[3])) { + s8.label = a10[1]; + break; + } + if (6 === a10[0] && s8.label < r9[1]) { + s8.label = r9[1], r9 = a10; + break; + } + if (r9 && s8.label < r9[2]) { + s8.label = r9[2], s8.ops.push(a10); + break; + } + r9[2] && s8.ops.pop(), s8.trys.pop(); + continue; + } + a10 = t10.call(e12, s8); + } catch (e13) { + a10 = [6, e13], n9 = 0; + } finally { + i9 = r9 = 0; + } + if (5 & a10[0]) + throw a10[1]; + return { value: a10[0] ? a10[1] : void 0, done: true }; + }([a9, p8]); + }; + } + } + var y7 = Object.create ? function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9); + var r9 = Object.getOwnPropertyDescriptor(t10, i9); + r9 && !("get" in r9 ? !t10.__esModule : r9.writable || r9.configurable) || (r9 = { enumerable: true, get: function() { + return t10[i9]; + } }), Object.defineProperty(e12, n9, r9); + } : function(e12, t10, i9, n9) { + void 0 === n9 && (n9 = i9), e12[n9] = t10[i9]; + }; + function g7(e12, t10) { + for (var i9 in e12) + "default" === i9 || Object.prototype.hasOwnProperty.call(t10, i9) || y7(t10, e12, i9); + } + function b8(e12) { + var t10 = "function" == typeof Symbol && Symbol.iterator, i9 = t10 && e12[t10], n9 = 0; + if (i9) + return i9.call(e12); + if (e12 && "number" == typeof e12.length) + return { next: function() { + return e12 && n9 >= e12.length && (e12 = void 0), { value: e12 && e12[n9++], done: !e12 }; + } }; + throw new TypeError(t10 ? "Object is not iterable." : "Symbol.iterator is not defined."); + } + function v8(e12, t10) { + var i9 = "function" == typeof Symbol && e12[Symbol.iterator]; + if (!i9) + return e12; + var n9, r9, o8 = i9.call(e12), s8 = []; + try { + for (; (void 0 === t10 || t10-- > 0) && !(n9 = o8.next()).done; ) + s8.push(n9.value); + } catch (e13) { + r9 = { error: e13 }; + } finally { + try { + n9 && !n9.done && (i9 = o8.return) && i9.call(o8); + } finally { + if (r9) + throw r9.error; + } + } + return s8; + } + function j6() { + for (var e12 = [], t10 = 0; t10 < arguments.length; t10++) + e12 = e12.concat(v8(arguments[t10])); + return e12; + } + function $5() { + for (var e12 = 0, t10 = 0, i9 = arguments.length; t10 < i9; t10++) + e12 += arguments[t10].length; + var n9 = Array(e12), r9 = 0; + for (t10 = 0; t10 < i9; t10++) + for (var o8 = arguments[t10], s8 = 0, a8 = o8.length; s8 < a8; s8++, r9++) + n9[r9] = o8[s8]; + return n9; + } + function x7(e12, t10, i9) { + if (i9 || 2 === arguments.length) + for (var n9, r9 = 0, o8 = t10.length; r9 < o8; r9++) + !n9 && r9 in t10 || (n9 || (n9 = Array.prototype.slice.call(t10, 0, r9)), n9[r9] = t10[r9]); + return e12.concat(n9 || Array.prototype.slice.call(t10)); + } + function _6(e12) { + return this instanceof _6 ? (this.v = e12, this) : new _6(e12); + } + function w6(e12, t10, i9) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var n9, r9 = i9.apply(e12, t10 || []), o8 = []; + return n9 = {}, s8("next"), s8("throw"), s8("return", function(e13) { + return function(t11) { + return Promise.resolve(t11).then(e13, c8); + }; + }), n9[Symbol.asyncIterator] = function() { + return this; + }, n9; + function s8(e13, t11) { + r9[e13] && (n9[e13] = function(t12) { + return new Promise(function(i10, n10) { + o8.push([e13, t12, i10, n10]) > 1 || a8(e13, t12); + }); + }, t11 && (n9[e13] = t11(n9[e13]))); + } + function a8(e13, t11) { + try { + (i10 = r9[e13](t11)).value instanceof _6 ? Promise.resolve(i10.value.v).then(p8, c8) : d8(o8[0][2], i10); + } catch (e14) { + d8(o8[0][3], e14); + } + var i10; + } + function p8(e13) { + a8("next", e13); + } + function c8(e13) { + a8("throw", e13); + } + function d8(e13, t11) { + e13(t11), o8.shift(), o8.length && a8(o8[0][0], o8[0][1]); + } + } + function S6(e12) { + var t10, i9; + return t10 = {}, n9("next"), n9("throw", function(e13) { + throw e13; + }), n9("return"), t10[Symbol.iterator] = function() { + return this; + }, t10; + function n9(n10, r9) { + t10[n10] = e12[n10] ? function(t11) { + return (i9 = !i9) ? { value: _6(e12[n10](t11)), done: false } : r9 ? r9(t11) : t11; + } : r9; + } + } + function P6(e12) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var t10, i9 = e12[Symbol.asyncIterator]; + return i9 ? i9.call(e12) : (e12 = b8(e12), t10 = {}, n9("next"), n9("throw"), n9("return"), t10[Symbol.asyncIterator] = function() { + return this; + }, t10); + function n9(i10) { + t10[i10] = e12[i10] && function(t11) { + return new Promise(function(n10, r9) { + !function(e13, t12, i11, n11) { + Promise.resolve(n11).then(function(t13) { + e13({ value: t13, done: i11 }); + }, t12); + }(n10, r9, (t11 = e12[i10](t11)).done, t11.value); + }); + }; + } + } + function O7(e12, t10) { + return Object.defineProperty ? Object.defineProperty(e12, "raw", { value: t10 }) : e12.raw = t10, e12; + } + var T6 = Object.create ? function(e12, t10) { + Object.defineProperty(e12, "default", { enumerable: true, value: t10 }); + } : function(e12, t10) { + e12.default = t10; + }; + function A6(e12) { + if (e12 && e12.__esModule) + return e12; + var t10 = {}; + if (null != e12) + for (var i9 in e12) + "default" !== i9 && Object.prototype.hasOwnProperty.call(e12, i9) && y7(t10, e12, i9); + return T6(t10, e12), t10; + } + function I6(e12) { + return e12 && e12.__esModule ? e12 : { default: e12 }; + } + function E6(e12, t10, i9, n9) { + if ("a" === i9 && !n9) + throw new TypeError("Private accessor was defined without a getter"); + if ("function" == typeof t10 ? e12 !== t10 || !n9 : !t10.has(e12)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return "m" === i9 ? n9 : "a" === i9 ? n9.call(e12) : n9 ? n9.value : t10.get(e12); + } + function q5(e12, t10, i9, n9, r9) { + if ("m" === n9) + throw new TypeError("Private method is not writable"); + if ("a" === n9 && !r9) + throw new TypeError("Private accessor was defined without a setter"); + if ("function" == typeof t10 ? e12 !== t10 || !r9 : !t10.has(e12)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return "a" === n9 ? r9.call(e12, i9) : r9 ? r9.value = i9 : t10.set(e12, i9), i9; + } + function k6(e12, t10) { + if (null === t10 || "object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Cannot use 'in' operator on non-object"); + return "function" == typeof e12 ? t10 === e12 : e12.has(t10); + } + function M6(e12, t10, i9) { + if (null != t10) { + if ("object" != typeof t10 && "function" != typeof t10) + throw new TypeError("Object expected."); + var n9, r9; + if (i9) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + n9 = t10[Symbol.asyncDispose]; + } + if (void 0 === n9) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + n9 = t10[Symbol.dispose], i9 && (r9 = n9); + } + if ("function" != typeof n9) + throw new TypeError("Object not disposable."); + r9 && (n9 = function() { + try { + r9.call(this); + } catch (e13) { + return Promise.reject(e13); + } + }), e12.stack.push({ value: t10, dispose: n9, async: i9 }); + } else + i9 && e12.stack.push({ async: true }); + return t10; + } + var R6 = "function" == typeof SuppressedError ? SuppressedError : function(e12, t10, i9) { + var n9 = new Error(i9); + return n9.name = "SuppressedError", n9.error = e12, n9.suppressed = t10, n9; + }; + function D6(e12) { + function t10(t11) { + e12.error = e12.hasError ? new R6(t11, e12.error, "An error was suppressed during disposal.") : t11, e12.hasError = true; + } + return function i9() { + for (; e12.stack.length; ) { + var n9 = e12.stack.pop(); + try { + var r9 = n9.dispose && n9.dispose.call(n9.value); + if (n9.async) + return Promise.resolve(r9).then(i9, function(e13) { + return t10(e13), i9(); + }); + } catch (e13) { + t10(e13); + } + } + if (e12.hasError) + throw e12.error; + }(); + } + const C6 = { __extends: r8, __assign: o7, __rest: s7, __decorate: a7, __param: p7, __metadata: u7, __awaiter: m7, __generator: h8, __createBinding: y7, __exportStar: g7, __values: b8, __read: v8, __spread: j6, __spreadArrays: $5, __spreadArray: x7, __await: _6, __asyncGenerator: w6, __asyncDelegator: S6, __asyncValues: P6, __makeTemplateObject: O7, __importStar: A6, __importDefault: I6, __classPrivateFieldGet: E6, __classPrivateFieldSet: q5, __classPrivateFieldIn: k6, __addDisposableResource: M6, __disposeResources: D6 }; + }, 34321: (e11, t9, i8) => { + "use strict"; + function n8(e12) { + return n8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e13) { + return typeof e13; + } : function(e13) { + return e13 && "function" == typeof Symbol && e13.constructor === Symbol && e13 !== Symbol.prototype ? "symbol" : typeof e13; + }, n8(e12); + } + function r8(e12) { + return r8 = Object.setPrototypeOf ? Object.getPrototypeOf : function(e13) { + return e13.__proto__ || Object.getPrototypeOf(e13); + }, r8(e12); + } + function o7(e12, t10) { + return o7 = Object.setPrototypeOf || function(e13, t11) { + return e13.__proto__ = t11, e13; + }, o7(e12, t10); + } + function s7() { + if ("undefined" == typeof Reflect || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if ("function" == typeof Proxy) + return true; + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })), true; + } catch (e12) { + return false; + } + } + function a7(e12, t10, i9) { + return a7 = s7() ? Reflect.construct : function(e13, t11, i10) { + var n9 = [null]; + n9.push.apply(n9, t11); + var r9 = new (Function.bind.apply(e13, n9))(); + return i10 && o7(r9, i10.prototype), r9; + }, a7.apply(null, arguments); + } + function p7(e12) { + var t10 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; + return p7 = function(e13) { + if (null === e13 || (i9 = e13, -1 === Function.toString.call(i9).indexOf("[native code]"))) + return e13; + var i9; + if ("function" != typeof e13) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== t10) { + if (t10.has(e13)) + return t10.get(e13); + t10.set(e13, n9); + } + function n9() { + return a7(e13, arguments, r8(this).constructor); + } + return n9.prototype = Object.create(e13.prototype, { constructor: { value: n9, enumerable: false, writable: true, configurable: true } }), o7(n9, e13); + }, p7(e12); + } + function c7(e12) { + return function(e13) { + if (Array.isArray(e13)) + return f8(e13); + }(e12) || function(e13) { + if ("undefined" != typeof Symbol && null != e13[Symbol.iterator] || null != e13["@@iterator"]) + return Array.from(e13); + }(e12) || d7(e12) || function() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + }(); + } + function d7(e12, t10) { + if (e12) { + if ("string" == typeof e12) + return f8(e12, t10); + var i9 = Object.prototype.toString.call(e12).slice(8, -1); + return "Object" === i9 && e12.constructor && (i9 = e12.constructor.name), "Map" === i9 || "Set" === i9 ? Array.from(e12) : "Arguments" === i9 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i9) ? f8(e12, t10) : void 0; + } + } + function f8(e12, t10) { + (null == t10 || t10 > e12.length) && (t10 = e12.length); + for (var i9 = 0, n9 = new Array(t10); i9 < t10; i9++) + n9[i9] = e12[i9]; + return n9; + } + i8.r(t9), i8.d(t9, { JSONPath: () => y7 }); + var l7 = Object.prototype.hasOwnProperty; + function u7(e12, t10) { + return (e12 = e12.slice()).push(t10), e12; + } + function m7(e12, t10) { + return (t10 = t10.slice()).unshift(e12), t10; + } + var h8 = function(e12) { + !function(e13, t11) { + if ("function" != typeof t11 && null !== t11) + throw new TypeError("Super expression must either be null or a function"); + e13.prototype = Object.create(t11 && t11.prototype, { constructor: { value: e13, writable: true, configurable: true } }), t11 && o7(e13, t11); + }(a8, e12); + var t10, i9, n9 = (t10 = a8, i9 = s7(), function() { + var e13, n10 = r8(t10); + if (i9) { + var o8 = r8(this).constructor; + e13 = Reflect.construct(n10, arguments, o8); + } else + e13 = n10.apply(this, arguments); + return function(e14, t11) { + return !t11 || "object" != typeof t11 && "function" != typeof t11 ? function(e15) { + if (void 0 === e15) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e15; + }(e14) : t11; + }(this, e13); + }); + function a8(e13) { + var t11; + return function(e14, t12) { + if (!(e14 instanceof t12)) + throw new TypeError("Cannot call a class as a function"); + }(this, a8), (t11 = n9.call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew = true, t11.value = e13, t11.name = "NewError", t11; + } + return a8; + }(p7(Error)); + function y7(e12, t10, i9, r9, o8) { + if (!(this instanceof y7)) + try { + return new y7(e12, t10, i9, r9, o8); + } catch (e13) { + if (!e13.avoidNew) + throw e13; + return e13.value; + } + "string" == typeof e12 && (o8 = r9, r9 = i9, i9 = t10, t10 = e12, e12 = null); + var s8 = e12 && "object" === n8(e12); + if (e12 = e12 || {}, this.json = e12.json || i9, this.path = e12.path || t10, this.resultType = e12.resultType || "value", this.flatten = e12.flatten || false, this.wrap = !l7.call(e12, "wrap") || e12.wrap, this.sandbox = e12.sandbox || {}, this.preventEval = e12.preventEval || false, this.parent = e12.parent || null, this.parentProperty = e12.parentProperty || null, this.callback = e12.callback || r9 || null, this.otherTypeCallback = e12.otherTypeCallback || o8 || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }, false !== e12.autostart) { + var a8 = { path: s8 ? e12.path : t10 }; + s8 ? "json" in e12 && (a8.json = e12.json) : a8.json = i9; + var p8 = this.evaluate(a8); + if (!p8 || "object" !== n8(p8)) + throw new h8(p8); + return p8; + } + } + y7.prototype.evaluate = function(e12, t10, i9, r9) { + var o8 = this, s8 = this.parent, a8 = this.parentProperty, p8 = this.flatten, c8 = this.wrap; + if (this.currResultType = this.resultType, this.currPreventEval = this.preventEval, this.currSandbox = this.sandbox, i9 = i9 || this.callback, this.currOtherTypeCallback = r9 || this.otherTypeCallback, t10 = t10 || this.json, (e12 = e12 || this.path) && "object" === n8(e12) && !Array.isArray(e12)) { + if (!e12.path && "" !== e12.path) + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + if (!l7.call(e12, "json")) + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + t10 = e12.json, p8 = l7.call(e12, "flatten") ? e12.flatten : p8, this.currResultType = l7.call(e12, "resultType") ? e12.resultType : this.currResultType, this.currSandbox = l7.call(e12, "sandbox") ? e12.sandbox : this.currSandbox, c8 = l7.call(e12, "wrap") ? e12.wrap : c8, this.currPreventEval = l7.call(e12, "preventEval") ? e12.preventEval : this.currPreventEval, i9 = l7.call(e12, "callback") ? e12.callback : i9, this.currOtherTypeCallback = l7.call(e12, "otherTypeCallback") ? e12.otherTypeCallback : this.currOtherTypeCallback, s8 = l7.call(e12, "parent") ? e12.parent : s8, a8 = l7.call(e12, "parentProperty") ? e12.parentProperty : a8, e12 = e12.path; + } + if (s8 = s8 || null, a8 = a8 || null, Array.isArray(e12) && (e12 = y7.toPathString(e12)), (e12 || "" === e12) && t10) { + var d8 = y7.toPathArray(e12); + "$" === d8[0] && d8.length > 1 && d8.shift(), this._hasParentSelector = null; + var f9 = this._trace(d8, t10, ["$"], s8, a8, i9).filter(function(e13) { + return e13 && !e13.isParentSelector; + }); + return f9.length ? c8 || 1 !== f9.length || f9[0].hasArrExpr ? f9.reduce(function(e13, t11) { + var i10 = o8._getPreferredOutput(t11); + return p8 && Array.isArray(i10) ? e13 = e13.concat(i10) : e13.push(i10), e13; + }, []) : this._getPreferredOutput(f9[0]) : c8 ? [] : void 0; + } + }, y7.prototype._getPreferredOutput = function(e12) { + var t10 = this.currResultType; + switch (t10) { + case "all": + var i9 = Array.isArray(e12.path) ? e12.path : y7.toPathArray(e12.path); + return e12.pointer = y7.toPointer(i9), e12.path = "string" == typeof e12.path ? e12.path : y7.toPathString(e12.path), e12; + case "value": + case "parent": + case "parentProperty": + return e12[t10]; + case "path": + return y7.toPathString(e12[t10]); + case "pointer": + return y7.toPointer(e12.path); + default: + throw new TypeError("Unknown result type"); + } + }, y7.prototype._handleCallback = function(e12, t10, i9) { + if (t10) { + var n9 = this._getPreferredOutput(e12); + e12.path = "string" == typeof e12.path ? e12.path : y7.toPathString(e12.path), t10(n9, i9, e12); + } + }, y7.prototype._trace = function(e12, t10, i9, r9, o8, s8, a8, p8) { + var c8, f9 = this; + if (!e12.length) + return c8 = { path: i9, value: t10, parent: r9, parentProperty: o8, hasArrExpr: a8 }, this._handleCallback(c8, s8, "value"), c8; + var h9 = e12[0], y8 = e12.slice(1), g7 = []; + function b8(e13) { + Array.isArray(e13) ? e13.forEach(function(e14) { + g7.push(e14); + }) : g7.push(e13); + } + if (("string" != typeof h9 || p8) && t10 && l7.call(t10, h9)) + b8(this._trace(y8, t10[h9], u7(i9, h9), t10, h9, s8, a8)); + else if ("*" === h9) + this._walk(h9, y8, t10, i9, r9, o8, s8, function(e13, t11, i10, n9, r10, o9, s9, a9) { + b8(f9._trace(m7(e13, i10), n9, r10, o9, s9, a9, true, true)); + }); + else if (".." === h9) + b8(this._trace(y8, t10, i9, r9, o8, s8, a8)), this._walk(h9, y8, t10, i9, r9, o8, s8, function(e13, t11, i10, r10, o9, s9, a9, p9) { + "object" === n8(r10[e13]) && b8(f9._trace(m7(t11, i10), r10[e13], u7(o9, e13), r10, e13, p9, true)); + }); + else { + if ("^" === h9) + return this._hasParentSelector = true, { path: i9.slice(0, -1), expr: y8, isParentSelector: true }; + if ("~" === h9) + return c8 = { path: u7(i9, h9), value: o8, parent: r9, parentProperty: null }, this._handleCallback(c8, s8, "property"), c8; + if ("$" === h9) + b8(this._trace(y8, t10, i9, null, null, s8, a8)); + else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(h9)) + b8(this._slice(h9, y8, t10, i9, r9, o8, s8)); + else if (0 === h9.indexOf("?(")) { + if (this.currPreventEval) + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + this._walk(h9, y8, t10, i9, r9, o8, s8, function(e13, t11, i10, n9, r10, o9, s9, a9) { + f9._eval(t11.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, "$1"), n9[e13], e13, r10, o9, s9) && b8(f9._trace(m7(e13, i10), n9, r10, o9, s9, a9, true)); + }); + } else if ("(" === h9[0]) { + if (this.currPreventEval) + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + b8(this._trace(m7(this._eval(h9, t10, i9[i9.length - 1], i9.slice(0, -1), r9, o8), y8), t10, i9, r9, o8, s8, a8)); + } else if ("@" === h9[0]) { + var v8 = false, j6 = h9.slice(1, -2); + switch (j6) { + case "scalar": + t10 && ["object", "function"].includes(n8(t10)) || (v8 = true); + break; + case "boolean": + case "string": + case "undefined": + case "function": + n8(t10) === j6 && (v8 = true); + break; + case "integer": + !Number.isFinite(t10) || t10 % 1 || (v8 = true); + break; + case "number": + Number.isFinite(t10) && (v8 = true); + break; + case "nonFinite": + "number" != typeof t10 || Number.isFinite(t10) || (v8 = true); + break; + case "object": + t10 && n8(t10) === j6 && (v8 = true); + break; + case "array": + Array.isArray(t10) && (v8 = true); + break; + case "other": + v8 = this.currOtherTypeCallback(t10, i9, r9, o8); + break; + case "null": + null === t10 && (v8 = true); + break; + default: + throw new TypeError("Unknown value type " + j6); + } + if (v8) + return c8 = { path: i9, value: t10, parent: r9, parentProperty: o8 }, this._handleCallback(c8, s8, "value"), c8; + } else if ("`" === h9[0] && t10 && l7.call(t10, h9.slice(1))) { + var $5 = h9.slice(1); + b8(this._trace(y8, t10[$5], u7(i9, $5), t10, $5, s8, a8, true)); + } else if (h9.includes(",")) { + var x7, _6 = function(e13) { + var t11 = "undefined" != typeof Symbol && e13[Symbol.iterator] || e13["@@iterator"]; + if (!t11) { + if (Array.isArray(e13) || (t11 = d7(e13))) { + t11 && (e13 = t11); + var i10 = 0, n9 = function() { + }; + return { s: n9, n: function() { + return i10 >= e13.length ? { done: true } : { done: false, value: e13[i10++] }; + }, e: function(e14) { + throw e14; + }, f: n9 }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var r10, o9 = true, s9 = false; + return { s: function() { + t11 = t11.call(e13); + }, n: function() { + var e14 = t11.next(); + return o9 = e14.done, e14; + }, e: function(e14) { + s9 = true, r10 = e14; + }, f: function() { + try { + o9 || null == t11.return || t11.return(); + } finally { + if (s9) + throw r10; + } + } }; + }(h9.split(",")); + try { + for (_6.s(); !(x7 = _6.n()).done; ) { + var w6 = x7.value; + b8(this._trace(m7(w6, y8), t10, i9, r9, o8, s8, true)); + } + } catch (e13) { + _6.e(e13); + } finally { + _6.f(); + } + } else + !p8 && t10 && l7.call(t10, h9) && b8(this._trace(y8, t10[h9], u7(i9, h9), t10, h9, s8, a8, true)); + } + if (this._hasParentSelector) + for (var S6 = 0; S6 < g7.length; S6++) { + var P6 = g7[S6]; + if (P6 && P6.isParentSelector) { + var O7 = this._trace(P6.expr, t10, P6.path, r9, o8, s8, a8); + if (Array.isArray(O7)) { + g7[S6] = O7[0]; + for (var T6 = O7.length, A6 = 1; A6 < T6; A6++) + S6++, g7.splice(S6, 0, O7[A6]); + } else + g7[S6] = O7; + } + } + return g7; + }, y7.prototype._walk = function(e12, t10, i9, r9, o8, s8, a8, p8) { + if (Array.isArray(i9)) + for (var c8 = i9.length, d8 = 0; d8 < c8; d8++) + p8(d8, e12, t10, i9, r9, o8, s8, a8); + else + i9 && "object" === n8(i9) && Object.keys(i9).forEach(function(n9) { + p8(n9, e12, t10, i9, r9, o8, s8, a8); + }); + }, y7.prototype._slice = function(e12, t10, i9, n9, r9, o8, s8) { + if (Array.isArray(i9)) { + var a8 = i9.length, p8 = e12.split(":"), c8 = p8[2] && Number.parseInt(p8[2]) || 1, d8 = p8[0] && Number.parseInt(p8[0]) || 0, f9 = p8[1] && Number.parseInt(p8[1]) || a8; + d8 = d8 < 0 ? Math.max(0, d8 + a8) : Math.min(a8, d8), f9 = f9 < 0 ? Math.max(0, f9 + a8) : Math.min(a8, f9); + for (var l8 = [], u8 = d8; u8 < f9; u8 += c8) + this._trace(m7(u8, t10), i9, n9, r9, o8, s8, true).forEach(function(e13) { + l8.push(e13); + }); + return l8; + } + }, y7.prototype._eval = function(e12, t10, i9, n9, r9, o8) { + e12.includes("@parentProperty") && (this.currSandbox._$_parentProperty = o8, e12 = e12.replace(/@parentProperty/g, "_$_parentProperty")), e12.includes("@parent") && (this.currSandbox._$_parent = r9, e12 = e12.replace(/@parent/g, "_$_parent")), e12.includes("@property") && (this.currSandbox._$_property = i9, e12 = e12.replace(/@property/g, "_$_property")), e12.includes("@path") && (this.currSandbox._$_path = y7.toPathString(n9.concat([i9])), e12 = e12.replace(/@path/g, "_$_path")), e12.includes("@root") && (this.currSandbox._$_root = this.json, e12 = e12.replace(/@root/g, "_$_root")), /@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(e12) && (this.currSandbox._$_v = t10, e12 = e12.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, "_$_v$1")); + try { + return this.vm.runInNewContext(e12, this.currSandbox); + } catch (t11) { + throw console.log(t11), new Error("jsonPath: " + t11.message + ": " + e12); + } + }, y7.cache = {}, y7.toPathString = function(e12) { + for (var t10 = e12, i9 = t10.length, n9 = "$", r9 = 1; r9 < i9; r9++) + /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t10[r9]) || (n9 += /^[\*0-9]+$/.test(t10[r9]) ? "[" + t10[r9] + "]" : "['" + t10[r9] + "']"); + return n9; + }, y7.toPointer = function(e12) { + for (var t10 = e12, i9 = t10.length, n9 = "", r9 = 1; r9 < i9; r9++) + /^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t10[r9]) || (n9 += "/" + t10[r9].toString().replace(/~/g, "~0").replace(/\//g, "~1")); + return n9; + }, y7.toPathArray = function(e12) { + var t10 = y7.cache; + if (t10[e12]) + return t10[e12].concat(); + var i9 = [], n9 = e12.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g, function(e13, t11) { + return "[#" + (i9.push(t11) - 1) + "]"; + }).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g, function(e13, t11) { + return "['" + t11.replace(/\./g, "%@%").replace(/~/g, "%%@@%%") + "']"; + }).replace(/~/g, ";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g, ";").replace(/%@%/g, ".").replace(/%%@@%%/g, "~").replace(/(?:;)?(\^+)(?:;)?/g, function(e13, t11) { + return ";" + t11.split("").join(";") + ";"; + }).replace(/;;;|;;/g, ";..;").replace(/;$|'?\]|'$/g, "").split(";").map(function(e13) { + var t11 = e13.match(/#([0-9]+)/); + return t11 && t11[1] ? i9[t11[1]] : e13; + }); + return t10[e12] = n9, t10[e12].concat(); + }, y7.prototype.vm = { runInNewContext: function(e12, t10) { + var i9 = Object.keys(t10), n9 = []; + !function(e13, i10) { + for (var n10 = e13.length, r10 = 0; r10 < n10; r10++) + o9 = e13[r10], "function" == typeof t10[o9] && i10.push(e13.splice(r10--, 1)[0]); + var o9; + }(i9, n9); + var r9 = i9.map(function(e13, i10) { + return t10[e13]; + }), o8 = n9.reduce(function(e13, i10) { + var n10 = t10[i10].toString(); + return /function/.test(n10) || (n10 = "function " + n10), "var " + i10 + "=" + n10 + ";" + e13; + }, ""); + /(["'])use strict\1/.test(e12 = o8 + e12) || i9.includes("arguments") || (e12 = "var arguments = undefined;" + e12); + var s8 = (e12 = e12.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, "")).lastIndexOf(";"), p8 = s8 > -1 ? e12.slice(0, s8 + 1) + " return " + e12.slice(s8 + 1) : " return " + e12; + return a7(Function, c7(i9).concat([p8])).apply(void 0, c7(r9)); + } }; + }, 69486: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.0.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.0.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"object","additionalProperties":{"$ref":"#/definitions/server"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 4023: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.0.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.0.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.0.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.0.0/info.json"},"servers":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/server.json"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.0.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.0.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.0.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.0.0/info.json":{"$id":"http://asyncapi.com/definitions/2.0.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.0.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.0.0/license.json"}}},"http://asyncapi.com/definitions/2.0.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.0.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.0.0/license.json":{"$id":"http://asyncapi.com/definitions/2.0.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.0.0/server.json":{"$id":"http://asyncapi.com/definitions/2.0.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.0.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.0.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.0.0/serverVariables.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/serverVariable.json"}},"http://asyncapi.com/definitions/2.0.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.0.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.0.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{}}},"http://asyncapi.com/definitions/2.0.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.0.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/channelItem.json"}},"http://asyncapi.com/definitions/2.0.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.0.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.0.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.0.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"http://asyncapi.com/definitions/2.0.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.0.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.0.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.0.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.0.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.0.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.0.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.0.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.0.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.0.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.0.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"http://asyncapi.com/definitions/2.0.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.0.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.0.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.0.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.0.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.0.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.0.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.0.0/message.json"}}},"http://asyncapi.com/definitions/2.0.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.0.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.0.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.0.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.0.0/message.json":{"$id":"http://asyncapi.com/definitions/2.0.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.0.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.0.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.0.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.0.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.0.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.0.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.0.0/components.json":{"$id":"http://asyncapi.com/definitions/2.0.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.0.0/schemas.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.0.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.0.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.0.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.0.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.0.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.0.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.0.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.0.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.0.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/openIdConnect.json"}]},"http://asyncapi.com/definitions/2.0.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.0.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.0.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.0.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.0.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.0.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.0.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.0.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.0.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 61401: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.1.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.1.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"object","additionalProperties":{"$ref":"#/definitions/server"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 88520: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.1.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.1.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.1.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.1.0/info.json"},"servers":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/server.json"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.1.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.1.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.1.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.1.0/info.json":{"$id":"http://asyncapi.com/definitions/2.1.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.1.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.1.0/license.json"}}},"http://asyncapi.com/definitions/2.1.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.1.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.1.0/license.json":{"$id":"http://asyncapi.com/definitions/2.1.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.1.0/server.json":{"$id":"http://asyncapi.com/definitions/2.1.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.1.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.1.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.1.0/serverVariables.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/serverVariable.json"}},"http://asyncapi.com/definitions/2.1.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.1.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.1.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{}}},"http://asyncapi.com/definitions/2.1.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.1.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/channelItem.json"}},"http://asyncapi.com/definitions/2.1.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.1.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.1.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.1.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"publish":{"$ref":"http://asyncapi.com/definitions/2.1.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.1.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.1.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.1.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.1.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.1.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.1.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.1.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.1.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.1.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.1.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"http://asyncapi.com/definitions/2.1.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.1.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.1.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.1.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.1.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.1.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.1.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.1.0/message.json"}}},"http://asyncapi.com/definitions/2.1.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.1.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.1.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.1.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.1.0/message.json":{"$id":"http://asyncapi.com/definitions/2.1.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.1.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.1.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.1.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.1.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.1.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.1.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.1.0/components.json":{"$id":"http://asyncapi.com/definitions/2.1.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.1.0/schemas.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.1.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.1.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.1.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.1.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.1.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.1.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.1.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.1.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.1.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.1.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.1.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.1.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.1.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.1.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.1.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.1.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.1.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 30192: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.2.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.2.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"type":"object","additionalProperties":{"$ref":"#/definitions/server"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 83105: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.2.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.2.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.2.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.2.0/info.json"},"servers":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/server.json"}},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.2.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.2.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.2.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.2.0/info.json":{"$id":"http://asyncapi.com/definitions/2.2.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.2.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.2.0/license.json"}}},"http://asyncapi.com/definitions/2.2.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.2.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.2.0/license.json":{"$id":"http://asyncapi.com/definitions/2.2.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.2.0/server.json":{"$id":"http://asyncapi.com/definitions/2.2.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.2.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.2.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.2.0/serverVariables.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/serverVariable.json"}},"http://asyncapi.com/definitions/2.2.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.2.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.2.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{}}},"http://asyncapi.com/definitions/2.2.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.2.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/channelItem.json"}},"http://asyncapi.com/definitions/2.2.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.2.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.2.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.2.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"http://asyncapi.com/definitions/2.2.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.2.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.2.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.2.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.2.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.2.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.2.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.2.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.2.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.2.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.2.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"http://asyncapi.com/definitions/2.2.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.2.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.2.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.2.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.2.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.2.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.2.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.2.0/message.json"}}},"http://asyncapi.com/definitions/2.2.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.2.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.2.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.2.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.2.0/message.json":{"$id":"http://asyncapi.com/definitions/2.2.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.2.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.2.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.2.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.2.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.2.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.2.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.2.0/components.json":{"$id":"http://asyncapi.com/definitions/2.2.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.2.0/schemas.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.2.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.2.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.2.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.2.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.2.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.2.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.2.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.2.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.2.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.2.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.2.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.2.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.2.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.2.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.2.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.2.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.2.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 85323: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.3.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.3.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"$ref":"#/definitions/servers"},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"servers":{"description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]}},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"servers":{"$ref":"#/definitions/servers"},"channels":{"$ref":"#/definitions/channels"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 11306: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.3.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.3.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.3.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.3.0/info.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.3.0/servers.json"},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.3.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.3.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.3.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.3.0/info.json":{"$id":"http://asyncapi.com/definitions/2.3.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.3.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.3.0/license.json"}}},"http://asyncapi.com/definitions/2.3.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.3.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.3.0/license.json":{"$id":"http://asyncapi.com/definitions/2.3.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.3.0/servers.json":{"$id":"http://asyncapi.com/definitions/2.3.0/servers.json","description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/server.json"}]}},"http://asyncapi.com/definitions/2.3.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.3.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.3.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.3.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.3.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.3.0/server.json":{"$id":"http://asyncapi.com/definitions/2.3.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.3.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.3.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.3.0/serverVariables.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/serverVariable.json"}},"http://asyncapi.com/definitions/2.3.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.3.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.3.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"http://asyncapi.com/definitions/2.3.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.3.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/channelItem.json"}},"http://asyncapi.com/definitions/2.3.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.3.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.3.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.3.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"http://asyncapi.com/definitions/2.3.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.3.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.3.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.3.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.3.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.3.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"http://asyncapi.com/definitions/2.3.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.3.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.3.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.3.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.3.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.3.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.3.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.3.0/message.json"}}},"http://asyncapi.com/definitions/2.3.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.3.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.3.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.3.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.3.0/message.json":{"$id":"http://asyncapi.com/definitions/2.3.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.3.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.3.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.3.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.3.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.3.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.3.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.3.0/components.json":{"$id":"http://asyncapi.com/definitions/2.3.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.3.0/schemas.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.3.0/servers.json"},"channels":{"$ref":"http://asyncapi.com/definitions/2.3.0/channels.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.3.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.3.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.3.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.3.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.3.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.3.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.3.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.3.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.3.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.3.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.3.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.3.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.3.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.3.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.3.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.3.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.3.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 45002: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.4.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.4.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"$ref":"#/definitions/servers"},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"servers":{"description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]}},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"serverVariables":{"type":"object","additionalProperties":{"$ref":"#/definitions/serverVariable"}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"servers":{"$ref":"#/definitions/servers"},"channels":{"$ref":"#/definitions/channels"},"serverVariables":{"$ref":"#/definitions/serverVariables"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 64939: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.4.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.4.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.4.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.4.0/info.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.4.0/servers.json"},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.4.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.4.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.4.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.4.0/info.json":{"$id":"http://asyncapi.com/definitions/2.4.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.4.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.4.0/license.json"}}},"http://asyncapi.com/definitions/2.4.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.4.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.4.0/license.json":{"$id":"http://asyncapi.com/definitions/2.4.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.4.0/servers.json":{"$id":"http://asyncapi.com/definitions/2.4.0/servers.json","description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/server.json"}]}},"http://asyncapi.com/definitions/2.4.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.4.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.4.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.4.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.4.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.4.0/server.json":{"$id":"http://asyncapi.com/definitions/2.4.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.4.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.4.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.4.0/serverVariables.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/serverVariable.json"}},"http://asyncapi.com/definitions/2.4.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.4.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.4.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"http://asyncapi.com/definitions/2.4.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.4.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/channelItem.json"}},"http://asyncapi.com/definitions/2.4.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.4.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.4.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.4.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"http://asyncapi.com/definitions/2.4.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.4.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.4.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.4.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.4.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.4.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"$ref":{"$ref":"http://asyncapi.com/definitions/2.4.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.4.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.4.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.4.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.4.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.4.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.4.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json"}},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.4.0/message.json"}}},"http://asyncapi.com/definitions/2.4.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.4.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"},"operationId":{"type":"string"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.4.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.4.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.4.0/message.json":{"$id":"http://asyncapi.com/definitions/2.4.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.4.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.4.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.4.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.4.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.4.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.4.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.4.0/components.json":{"$id":"http://asyncapi.com/definitions/2.4.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.4.0/schemas.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.4.0/servers.json"},"channels":{"$ref":"http://asyncapi.com/definitions/2.4.0/channels.json"},"serverVariables":{"$ref":"http://asyncapi.com/definitions/2.4.0/serverVariables.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.4.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.4.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.4.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.4.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.4.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.4.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.4.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.4.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.4.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.4.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.4.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.4.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.4.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.4.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.4.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.4.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.4.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 85765: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.5.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.5.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"$ref":"#/definitions/servers"},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}}},"contact":{"type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"servers":{"description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]}},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","format":"uri-reference"},"server":{"type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true}}},"serverVariables":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"bindingsObject":{"type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"tag":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"externalDocs":{"type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"channels":{"type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"}},"channelItem":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters."},"parameter":{"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"schema":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"operation":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string"},"description":{"type":"string"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}}},"operationTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"security":{"type":"array","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"message":{"oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}]},"correlationId":{"type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"messageTrait":{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"#/definitions/bindingsObject"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"servers":{"$ref":"#/definitions/servers"},"channels":{"$ref":"#/definitions/channels"},"serverVariables":{"$ref":"#/definitions/serverVariables"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Flows":{"type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 55708: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.5.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.5.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.5.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.5.0/info.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.5.0/servers.json"},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.5.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.5.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.5.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.5.0/info.json":{"$id":"http://asyncapi.com/definitions/2.5.0/info.json","type":"object","description":"General information about the API.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.5.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.5.0/license.json"}}},"http://asyncapi.com/definitions/2.5.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.5.0/contact.json","type":"object","description":"Contact information for the owners of the API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.5.0/license.json":{"$id":"http://asyncapi.com/definitions/2.5.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.5.0/servers.json":{"$id":"http://asyncapi.com/definitions/2.5.0/servers.json","description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/server.json"}]}},"http://asyncapi.com/definitions/2.5.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.5.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.5.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.5.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.5.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/2.5.0/server.json":{"$id":"http://asyncapi.com/definitions/2.5.0/server.json","type":"object","description":"An object representing a Server.","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"url":{"type":"string"},"description":{"type":"string"},"protocol":{"type":"string","description":"The transfer protocol."},"protocolVersion":{"type":"string"},"variables":{"$ref":"http://asyncapi.com/definitions/2.5.0/serverVariables.json"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true}}},"http://asyncapi.com/definitions/2.5.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.5.0/serverVariables.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/serverVariable.json"}]}},"http://asyncapi.com/definitions/2.5.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.5.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json","type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true}},"http://asyncapi.com/definitions/2.5.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json","type":"object","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{}}},"http://asyncapi.com/definitions/2.5.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.5.0/tag.json","type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.5.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.5.0/externalDocs.json","type":"object","additionalProperties":false,"description":"information about external documentation","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.5.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.5.0/channels.json","type":"object","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/channelItem.json"}},"http://asyncapi.com/definitions/2.5.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.5.0/channelItem.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.5.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.5.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"http://asyncapi.com/definitions/2.5.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.5.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.5.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.5.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters."},"http://asyncapi.com/definitions/2.5.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.5.0/parameter.json","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.5.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.5.0/schema.json","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"discriminator":{"type":"string"},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.5.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.5.0/operation.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/operationTrait.json"}]}},"summary":{"type":"string"},"description":{"type":"string"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json"}},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.5.0/message.json"}}},"http://asyncapi.com/definitions/2.5.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.5.0/operationTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"summary":{"type":"string"},"description":{"type":"string"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"},"operationId":{"type":"string"},"security":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.5.0/message.json":{"$id":"http://asyncapi.com/definitions/2.5.0/message.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object"},"payload":{}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json"}}}}]}]}]},"http://asyncapi.com/definitions/2.5.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.5.0/correlationId.json","type":"object","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}}},"http://asyncapi.com/definitions/2.5.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.5.0/messageTrait.json","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.5.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.5.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","items":{"type":"object"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}}},"http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.5.0/components.json":{"$id":"http://asyncapi.com/definitions/2.5.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.5.0/schemas.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.5.0/servers.json"},"channels":{"$ref":"http://asyncapi.com/definitions/2.5.0/channels.json"},"serverVariables":{"$ref":"http://asyncapi.com/definitions/2.5.0/serverVariables.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.5.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.5.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/bindingsObject.json"}}}},"http://asyncapi.com/definitions/2.5.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.5.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.5.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.5.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.5.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.5.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.5.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.5.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.5.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","enum":["apiKey"]},"in":{"type":"string","enum":["user","password"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.5.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["asymmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","enum":["bearer"]},"bearerFormat":{"type":"string"},"type":{"type":"string","enum":["http"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","enum":["httpApiKey"]},"name":{"type":"string"},"in":{"type":"string","enum":["header","query","cookie"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.5.0/oauth2Flows.json","type":"object","required":["type","flows"],"properties":{"type":{"type":"string","enum":["oauth2"]},"description":{"type":"string"},"flows":{"type":"object","properties":{"implicit":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.5.0/oauth2Flow.json","type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"},"tokenUrl":{"type":"string","format":"uri"},"refreshUrl":{"type":"string","format":"uri"},"scopes":{"$ref":"http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.5.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.5.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["plain"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["scramSha256","scramSha512"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["gssapi"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.5.0/specificationExtension.json"}},"additionalProperties":false}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 94220: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.6.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","enum":["2.6.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"$ref":"#/definitions/servers"},"defaultContentType":{"type":"string"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"type":"object","description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"}},"examples":[{"title":"AsyncAPI Sample App","description":"This is a sample server.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}}]},"contact":{"type":"object","description":"Contact information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"license":{"type":"object","required":["name"],"description":"License information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"servers":{"description":"The Servers Object is a map of Server Objects.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]},"examples":[{"development":{"url":"development.gigantic-server.com","description":"Development server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests"}]},"staging":{"url":"staging.gigantic-server.com","description":"Staging server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment"}]},"production":{"url":"api.gigantic-server.com","description":"Production server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users"}]}}]},"Reference":{"type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"}}},"ReferenceObject":{"type":"string","description":"A simple object to allow referencing other components in the specification, internally and externally.","format":"uri-reference","examples":[{"$ref":"#/components/schemas/Pet"}]},"server":{"type":"object","description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string","description":"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served."},"description":{"type":"string","description":"An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation."},"protocol":{"type":"string","description":"The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub."},"protocolVersion":{"type":"string","description":"The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc."},"variables":{"description":"A map between a variable name and its value. The value is used for substitution in the server's URL template.","$ref":"#/definitions/serverVariables"},"security":{"type":"array","description":"A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.","$ref":"#/definitions/bindingsObject"},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of servers.","items":{"$ref":"#/definitions/tag"},"uniqueItems":true}},"examples":[{"url":"development.gigantic-server.com","description":"Development server","protocol":"kafka","protocolVersion":"1.0.0"}]},"serverVariables":{"type":"object","description":"A map between a variable name and its value. The value is used for substitution in the server's URL template.","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","description":"An enumeration of string values to be used if the substitution options are from a limited set.","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string","description":"The default value to use for substitution, and to send, if an alternate value is not supplied."},"description":{"type":"string","description":"An optional description for the server variable. "},"examples":{"type":"array","description":"An array of examples of the server variable.","items":{"type":"string"}}}},"SecurityRequirement":{"type":"object","description":"Lists of the required security schemes that can be used to execute an operation","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true},"examples":[{"petstore_auth":["write:pets","read:pets"]}]},"bindingsObject":{"type":"object","description":"Map describing protocol-specific definitions for a server.","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{},"googlepubsub":{},"pulsar":{}}},"tag":{"type":"object","description":"Allows adding meta data to a single tag.","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the tag."},"description":{"type":"string","description":"A short description for the tag."},"externalDocs":{"description":"Additional external documentation for this tag.","$ref":"#/definitions/externalDocs"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"user","description":"User-related messages"}]},"externalDocs":{"type":"object","additionalProperties":false,"description":"Allows referencing an external resource for extended documentation.","required":["url"],"properties":{"description":{"type":"string","description":"A short description of the target documentation."},"url":{"type":"string","format":"uri","description":"The URL for the target documentation. This MUST be in the form of an absolute URL."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"description":"Find more info here","url":"https://example.com"}]},"channels":{"type":"object","description":"Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"#/definitions/channelItem"},"examples":[{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"channelItem":{"type":"object","description":"Describes the operations available on a single channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"$ref":"#/definitions/ReferenceObject"},"parameters":{"$ref":"#/definitions/parameters"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"#/definitions/operation"},"subscribe":{"$ref":"#/definitions/operation"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"#/definitions/bindingsObject"}},"examples":[{"description":"This channel is used to exchange messages about users signing up","subscribe":{"summary":"A user signed up.","message":{"description":"A longer description of the message","payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/user"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}}},{"subscribe":{"message":{"oneOf":[{"$ref":"#/components/messages/signup"},{"$ref":"#/components/messages/login"}]}}},{"description":"This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.","servers":["rabbitmqBrokerInProd","rabbitmqBrokerInStaging"],"subscribe":{"message":{"$ref":"#/components/messages/WebUICommand"}},"bindings":{"amqp":{"is":"queue"}}}]},"parameters":{"type":"object","description":"JSON objects describing reusable channel parameters.","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"examples":[{"user/{userId}/signup":{"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"}}},"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"parameter":{"description":"Describes a parameter included in a channel name.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"#/definitions/schema"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"user/{userId}/signup":{"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"},"location":"$message.payload#/user/id"}},"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"schema":{"description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.","allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string","description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. "},"externalDocs":{"description":"Additional external documentation for this schema.","$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false,"description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage"}}}],"examples":[{"type":"string","format":"email"},{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"age":{"type":"integer","format":"int32","minimum":0}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"operation":{"type":"object","description":"Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"traits":{"type":"array","description":"A list of traits to apply to the operation object.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"summary":{"type":"string","description":"A short summary of what the operation is about."},"description":{"type":"string","description":"A verbose explanation of the operation."},"security":{"type":"array","description":"A declaration of which security mechanisms are associated with this operation.","items":{"$ref":"#/definitions/SecurityRequirement"}},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string"},"bindings":{"$ref":"#/definitions/bindingsObject"},"message":{"$ref":"#/definitions/message"}},"examples":[{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"operationTrait":{"type":"object","description":"Describes a trait that MAY be applied to an Operation Object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"summary":{"type":"string","description":"A short summary of what the operation is about."},"description":{"type":"string","description":"A verbose explanation of the operation."},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"externalDocs":{"$ref":"#/definitions/externalDocs"},"operationId":{"type":"string","description":"Unique string used to identify the operation. The id MUST be unique among all operations described in the API."},"security":{"type":"array","description":"A declaration of which security mechanisms are associated with this operation. ","items":{"$ref":"#/definitions/SecurityRequirement"}},"bindings":{"$ref":"#/definitions/bindingsObject"}},"examples":[{"bindings":{"amqp":{"ack":false}}}]},"message":{"description":"Describes a message received on a given channel and operation.","oneOf":[{"$ref":"#/definitions/Reference"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"#/definitions/message"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Schema definition of the application headers."},"payload":{"description":"Definition of the message payload. It can be of any type"}}}},"bindings":{"$ref":"#/definitions/bindingsObject"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/openapiSchema_3_0"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"#/definitions/avroSchema_v1"}}}}]}]}],"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]},{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","payload":{"$ref":"path/to/user-create.avsc#/UserCreate"}}]},"correlationId":{"type":"object","description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"messageTrait":{"type":"object","description":"Describes a trait that MAY be applied to a Message Object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaFormat":{"type":"string","description":"A string containing the name of the schema format/language used to define the message payload."},"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload."},"headers":{"description":"Schema definition of the application headers.","allOf":[{"$ref":"#/definitions/schema"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string","description":"Unique string used to identify the message. The id MUST be unique among all messages described in the API."},"correlationId":{"description":"Definition of the correlation ID used for message tracing or matching.","oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of messages.","items":{"$ref":"#/definitions/tag"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"#/definitions/externalDocs"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Schema definition of the application headers."},"payload":{"description":"Definition of the message payload. It can be of any type"}}}},"bindings":{"$ref":"#/definitions/bindingsObject"}},"examples":[{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","contentType":"application/json"}]},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"components":{"type":"object","description":"Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"$ref":"#/definitions/schemas"},"servers":{"$ref":"#/definitions/servers"},"channels":{"$ref":"#/definitions/channels"},"serverVariables":{"$ref":"#/definitions/serverVariables"},"messages":{"$ref":"#/definitions/messages"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"$ref":"#/definitions/parameters"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/operationTrait"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"#/definitions/messageTrait"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"#/definitions/bindingsObject"}}},"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}},"servers":{"development":{"url":"{stage}.gigantic-server.com:{port}","description":"Development server","protocol":"amqp","protocolVersion":"0.9.1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`gigantic-server.com\`"},"port":{"enum":["8883","8884"],"default":"8883"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"}}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]},"schemas":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"description":"JSON objects describing schemas the API uses."},"messages":{"type":"object","additionalProperties":{"$ref":"#/definitions/message"},"description":"JSON objects describing the messages being consumed and produced by the API."},"SecurityScheme":{"description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}],"examples":[{"type":"userPassword"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. ","enum":["userPassword"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["apiKey"]},"in":{"type":"string","description":"The location of the API key. ","enum":["user","password"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"],"description":"The type of the security scheme."},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["symmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["asymmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","description":"A short description for security scheme.","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235."},"description":{"type":"string","description":"A short description for security scheme."},"type":{"type":"string","description":"The type of the security scheme. ","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","enum":["bearer"]},"bearerFormat":{"type":"string","description":"A hint to the client to identify how the bearer token is formatted."},"type":{"type":"string","description":"The type of the security scheme. ","enum":["http"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme. ","enum":["httpApiKey"]},"name":{"type":"string","description":"The name of the header, query or cookie parameter to be used."},"in":{"type":"string","description":"The location of the API key. ","enum":["header","query","cookie"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"oauth2Flows":{"type":"object","description":"Allows configuration of the supported OAuth Flows.","required":["type","flows"],"properties":{"type":{"type":"string","description":"A short description for security scheme.","enum":["oauth2"]},"description":{"type":"string","description":"A short description for security scheme."},"flows":{"type":"object","properties":{"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","description":"Configuration details for a supported OAuth Flow","properties":{"authorizationUrl":{"type":"string","format":"uri","description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL."},"tokenUrl":{"type":"string","format":"uri","description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL."},"refreshUrl":{"type":"string","format":"uri","description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL."},"scopes":{"description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.","$ref":"#/definitions/oauth2Scopes"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://example.com/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}},"authorizationCode":{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}}]},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. Valid values","enum":["plain"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["scramSha256","scramSha512"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["gssapi"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 11669: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/2.6.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 2.6.0 schema.","type":"object","required":["asyncapi","info","channels"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","enum":["2.6.0"],"description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/2.6.0/info.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.6.0/servers.json"},"defaultContentType":{"type":"string"},"channels":{"$ref":"http://asyncapi.com/definitions/2.6.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/2.6.0/components.json"},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"}},"definitions":{"http://asyncapi.com/definitions/2.6.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/2.6.0/info.json":{"$id":"http://asyncapi.com/definitions/2.6.0/info.json","type":"object","description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/2.6.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/2.6.0/license.json"}},"examples":[{"title":"AsyncAPI Sample App","description":"This is a sample server.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}}]},"http://asyncapi.com/definitions/2.6.0/contact.json":{"$id":"http://asyncapi.com/definitions/2.6.0/contact.json","type":"object","description":"Contact information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"http://asyncapi.com/definitions/2.6.0/license.json":{"$id":"http://asyncapi.com/definitions/2.6.0/license.json","type":"object","required":["name"],"description":"License information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"http://asyncapi.com/definitions/2.6.0/servers.json":{"$id":"http://asyncapi.com/definitions/2.6.0/servers.json","description":"The Servers Object is a map of Server Objects.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/server.json"}]},"examples":[{"development":{"url":"development.gigantic-server.com","description":"Development server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests"}]},"staging":{"url":"staging.gigantic-server.com","description":"Staging server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment"}]},"production":{"url":"api.gigantic-server.com","description":"Production server","protocol":"amqp","protocolVersion":"0.9.1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users"}]}}]},"http://asyncapi.com/definitions/2.6.0/Reference.json":{"$id":"http://asyncapi.com/definitions/2.6.0/Reference.json","type":"object","required":["$ref"],"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.6.0/ReferenceObject.json"}}},"http://asyncapi.com/definitions/2.6.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/2.6.0/ReferenceObject.json","type":"string","description":"A simple object to allow referencing other components in the specification, internally and externally.","format":"uri-reference","examples":[{"$ref":"#/components/schemas/Pet"}]},"http://asyncapi.com/definitions/2.6.0/server.json":{"$id":"http://asyncapi.com/definitions/2.6.0/server.json","type":"object","description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data","required":["url","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"url":{"type":"string","description":"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served."},"description":{"type":"string","description":"An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation."},"protocol":{"type":"string","description":"The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub."},"protocolVersion":{"type":"string","description":"The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc."},"variables":{"description":"A map between a variable name and its value. The value is used for substitution in the server's URL template.","$ref":"http://asyncapi.com/definitions/2.6.0/serverVariables.json"},"security":{"type":"array","description":"A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json"}},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.","$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of servers.","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true}},"examples":[{"url":"development.gigantic-server.com","description":"Development server","protocol":"kafka","protocolVersion":"1.0.0"}]},"http://asyncapi.com/definitions/2.6.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/2.6.0/serverVariables.json","type":"object","description":"A map between a variable name and its value. The value is used for substitution in the server's URL template.","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/serverVariable.json"}]}},"http://asyncapi.com/definitions/2.6.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/2.6.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","description":"An enumeration of string values to be used if the substitution options are from a limited set.","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string","description":"The default value to use for substitution, and to send, if an alternate value is not supplied."},"description":{"type":"string","description":"An optional description for the server variable. "},"examples":{"type":"array","description":"An array of examples of the server variable.","items":{"type":"string"}}}},"http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json","type":"object","description":"Lists of the required security schemes that can be used to execute an operation","additionalProperties":{"type":"array","items":{"type":"string"},"uniqueItems":true},"examples":[{"petstore_auth":["write:pets","read:pets"]}]},"http://asyncapi.com/definitions/2.6.0/bindingsObject.json":{"$id":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json","type":"object","description":"Map describing protocol-specific definitions for a server.","additionalProperties":true,"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{},"mqtt5":{},"kafka":{},"anypointmq":{},"nats":{},"jms":{},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{},"solace":{},"googlepubsub":{},"pulsar":{}}},"http://asyncapi.com/definitions/2.6.0/tag.json":{"$id":"http://asyncapi.com/definitions/2.6.0/tag.json","type":"object","description":"Allows adding meta data to a single tag.","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the tag."},"description":{"type":"string","description":"A short description for the tag."},"externalDocs":{"description":"Additional external documentation for this tag.","$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"examples":[{"name":"user","description":"User-related messages"}]},"http://asyncapi.com/definitions/2.6.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/2.6.0/externalDocs.json","type":"object","additionalProperties":false,"description":"Allows referencing an external resource for extended documentation.","required":["url"],"properties":{"description":{"type":"string","description":"A short description of the target documentation."},"url":{"type":"string","format":"uri","description":"The URL for the target documentation. This MUST be in the form of an absolute URL."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"examples":[{"description":"Find more info here","url":"https://example.com"}]},"http://asyncapi.com/definitions/2.6.0/channels.json":{"$id":"http://asyncapi.com/definitions/2.6.0/channels.json","type":"object","description":"Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.","propertyNames":{"type":"string","format":"uri-template","minLength":1},"additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/channelItem.json"},"examples":[{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/2.6.0/channelItem.json":{"$id":"http://asyncapi.com/definitions/2.6.0/channelItem.json","type":"object","description":"Describes the operations available on a single channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"$ref":{"$ref":"http://asyncapi.com/definitions/2.6.0/ReferenceObject.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/2.6.0/parameters.json"},"description":{"type":"string","description":"A description of the channel."},"servers":{"type":"array","description":"The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"type":"string"},"uniqueItems":true},"publish":{"$ref":"http://asyncapi.com/definitions/2.6.0/operation.json"},"subscribe":{"$ref":"http://asyncapi.com/definitions/2.6.0/operation.json"},"deprecated":{"type":"boolean","default":false},"bindings":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"examples":[{"description":"This channel is used to exchange messages about users signing up","subscribe":{"summary":"A user signed up.","message":{"description":"A longer description of the message","payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/user"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}}},{"subscribe":{"message":{"oneOf":[{"$ref":"#/components/messages/signup"},{"$ref":"#/components/messages/login"}]}}},{"description":"This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.","servers":["rabbitmqBrokerInProd","rabbitmqBrokerInStaging"],"subscribe":{"message":{"$ref":"#/components/messages/WebUICommand"}},"bindings":{"amqp":{"is":"queue"}}}]},"http://asyncapi.com/definitions/2.6.0/parameters.json":{"$id":"http://asyncapi.com/definitions/2.6.0/parameters.json","type":"object","description":"JSON objects describing reusable channel parameters.","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/parameter.json"}]},"examples":[{"user/{userId}/signup":{"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"}}},"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/2.6.0/parameter.json":{"$id":"http://asyncapi.com/definitions/2.6.0/parameter.json","description":"Describes a parameter included in a channel name.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"schema":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"user/{userId}/signup":{"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"},"location":"$message.payload#/user/id"}},"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/2.6.0/schema.json":{"$id":"http://asyncapi.com/definitions/2.6.0/schema.json","description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"discriminator":{"type":"string","description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. "},"externalDocs":{"description":"Additional external documentation for this schema.","$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false,"description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage"}}}],"examples":[{"type":"string","format":"email"},{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"age":{"type":"integer","format":"int32","minimum":0}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/2.6.0/operation.json":{"$id":"http://asyncapi.com/definitions/2.6.0/operation.json","type":"object","description":"Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"traits":{"type":"array","description":"A list of traits to apply to the operation object.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/operationTrait.json"}]}},"summary":{"type":"string","description":"A short summary of what the operation is about."},"description":{"type":"string","description":"A verbose explanation of the operation."},"security":{"type":"array","description":"A declaration of which security mechanisms are associated with this operation.","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json"}},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"},"operationId":{"type":"string"},"bindings":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"},"message":{"$ref":"http://asyncapi.com/definitions/2.6.0/message.json"}},"examples":[{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/2.6.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/2.6.0/operationTrait.json","type":"object","description":"Describes a trait that MAY be applied to an Operation Object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"summary":{"type":"string","description":"A short summary of what the operation is about."},"description":{"type":"string","description":"A verbose explanation of the operation."},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"},"operationId":{"type":"string","description":"Unique string used to identify the operation. The id MUST be unique among all operations described in the API."},"security":{"type":"array","description":"A declaration of which security mechanisms are associated with this operation. ","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json"}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"examples":[{"bindings":{"amqp":{"ack":false}}}]},"http://asyncapi.com/definitions/2.6.0/message.json":{"$id":"http://asyncapi.com/definitions/2.6.0/message.json","description":"Describes a message received on a given channel and operation.","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"oneOf":[{"type":"object","required":["oneOf"],"additionalProperties":false,"properties":{"oneOf":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/message.json"}}}},{"type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string"},"contentType":{"type":"string"},"headers":{"allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string"},"payload":{},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/correlationId.json"}]},"tags":{"type":"array","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Schema definition of the application headers."},"payload":{"description":"Definition of the message payload. It can be of any type"}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"},"traits":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/messageTrait.json"}]}}},"allOf":[{"if":{"not":{"required":["schemaFormat"]}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"payload":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"payload":{"$ref":"http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json"}}}}]}]}],"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]},{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","payload":{"$ref":"path/to/user-create.avsc#/UserCreate"}}]},"http://asyncapi.com/definitions/2.6.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/2.6.0/correlationId.json","type":"object","description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"http://asyncapi.com/definitions/2.6.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/2.6.0/messageTrait.json","type":"object","description":"Describes a trait that MAY be applied to a Message Object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"schemaFormat":{"type":"string","description":"A string containing the name of the schema format/language used to define the message payload."},"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload."},"headers":{"description":"Schema definition of the application headers.","allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},{"properties":{"type":{"const":"object"}}}]},"messageId":{"type":"string","description":"Unique string used to identify the message. The id MUST be unique among all messages described in the API."},"correlationId":{"description":"Definition of the correlation ID used for message tracing or matching.","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/correlationId.json"}]},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of messages.","items":{"$ref":"http://asyncapi.com/definitions/2.6.0/tag.json"},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"$ref":"http://asyncapi.com/definitions/2.6.0/externalDocs.json"},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Schema definition of the application headers."},"payload":{"description":"Definition of the message payload. It can be of any type"}}}},"bindings":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"examples":[{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","contentType":"application/json"}]},"http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/2.6.0/components.json":{"$id":"http://asyncapi.com/definitions/2.6.0/components.json","type":"object","description":"Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"properties":{"schemas":{"$ref":"http://asyncapi.com/definitions/2.6.0/schemas.json"},"servers":{"$ref":"http://asyncapi.com/definitions/2.6.0/servers.json"},"channels":{"$ref":"http://asyncapi.com/definitions/2.6.0/channels.json"},"serverVariables":{"$ref":"http://asyncapi.com/definitions/2.6.0/serverVariables.json"},"messages":{"$ref":"http://asyncapi.com/definitions/2.6.0/messages.json"},"securitySchemes":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/SecurityScheme.json"}]}}},"parameters":{"$ref":"http://asyncapi.com/definitions/2.6.0/parameters.json"},"correlationIds":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/correlationId.json"}]}}},"operationTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/operationTrait.json"}},"messageTraits":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/messageTrait.json"}},"serverBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"channelBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"operationBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}},"messageBindings":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/bindingsObject.json"}}},"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}},"servers":{"development":{"url":"{stage}.gigantic-server.com:{port}","description":"Development server","protocol":"amqp","protocolVersion":"0.9.1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`gigantic-server.com\`"},"port":{"enum":["8883","8884"],"default":"8883"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user.","schema":{"type":"string"}}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]},"http://asyncapi.com/definitions/2.6.0/schemas.json":{"$id":"http://asyncapi.com/definitions/2.6.0/schemas.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/schema.json"},"description":"JSON objects describing schemas the API uses."},"http://asyncapi.com/definitions/2.6.0/messages.json":{"$id":"http://asyncapi.com/definitions/2.6.0/messages.json","type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/2.6.0/message.json"},"description":"JSON objects describing the messages being consumed and produced by the API."},"http://asyncapi.com/definitions/2.6.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SecurityScheme.json","description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json"}],"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/2.6.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/2.6.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. ","enum":["userPassword"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/2.6.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/2.6.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["apiKey"]},"in":{"type":"string","description":"The location of the API key. ","enum":["user","password"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"http://asyncapi.com/definitions/2.6.0/X509.json":{"$id":"http://asyncapi.com/definitions/2.6.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"],"description":"The type of the security scheme."},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["symmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["asymmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","description":"A short description for security scheme.","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235."},"description":{"type":"string","description":"A short description for security scheme."},"type":{"type":"string","description":"The type of the security scheme. ","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","enum":["bearer"]},"bearerFormat":{"type":"string","description":"A hint to the client to identify how the bearer token is formatted."},"type":{"type":"string","description":"The type of the security scheme. ","enum":["http"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme. ","enum":["httpApiKey"]},"name":{"type":"string","description":"The name of the header, query or cookie parameter to be used."},"in":{"type":"string","description":"The location of the API key. ","enum":["header","query","cookie"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"http://asyncapi.com/definitions/2.6.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/2.6.0/oauth2Flows.json","type":"object","description":"Allows configuration of the supported OAuth Flows.","required":["type","flows"],"properties":{"type":{"type":"string","description":"A short description for security scheme.","enum":["oauth2"]},"description":{"type":"string","description":"A short description for security scheme."},"flows":{"type":"object","properties":{"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json"},{"required":["authorizationUrl","scopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json"},{"required":["tokenUrl","scopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","scopes"]}]}},"additionalProperties":false}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/2.6.0/oauth2Flow.json","type":"object","description":"Configuration details for a supported OAuth Flow","properties":{"authorizationUrl":{"type":"string","format":"uri","description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL."},"tokenUrl":{"type":"string","format":"uri","description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL."},"refreshUrl":{"type":"string","format":"uri","description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL."},"scopes":{"description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.","$ref":"http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://example.com/api/oauth/dialog","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}},"authorizationCode":{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}}]},"http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/2.6.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/2.6.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","enum":["openIdConnect"]},"description":{"type":"string"},"openIdConnectUrl":{"type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. Valid values","enum":["plain"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["scramSha256","scramSha512"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["gssapi"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/2.6.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 95309: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 3.0.0 schema.","type":"object","required":["asyncapi","info"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"asyncapi":{"type":"string","const":"3.0.0","description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"#/definitions/info"},"servers":{"$ref":"#/definitions/servers"},"defaultContentType":{"type":"string","description":"Default content type to use when encoding/decoding a message's payload."},"channels":{"$ref":"#/definitions/channels"},"operations":{"$ref":"#/definitions/operations"},"components":{"$ref":"#/definitions/components"}},"definitions":{"specificationExtension":{"description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"info":{"description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","allOf":[{"type":"object","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"#/definitions/contact"},"license":{"$ref":"#/definitions/license"},"tags":{"type":"array","description":"A list of tags for application API documentation control. Tags can be used for logical grouping of applications.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]}}},{"$ref":"#/definitions/infoExtensions"}],"examples":[{"title":"AsyncAPI Sample App","version":"1.0.1","description":"This is a sample app.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.asyncapi.org/support","email":"support@asyncapi.org"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocs":{"description":"Find more info here","url":"https://www.asyncapi.org"},"tags":[{"name":"e-commerce"}]}]},"contact":{"type":"object","description":"Contact information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"license":{"type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"Reference":{"type":"object","description":"A simple object to allow referencing other components in the specification, internally and externally.","required":["$ref"],"properties":{"$ref":{"description":"The reference string.","$ref":"#/definitions/ReferenceObject"}},"examples":[{"$ref":"#/components/schemas/Pet"}]},"ReferenceObject":{"type":"string","format":"uri-reference"},"tag":{"type":"object","description":"Allows adding metadata to a single tag.","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the tag."},"description":{"type":"string","description":"A short description for the tag. CommonMark syntax can be used for rich text representation."},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"name":"user","description":"User-related messages"}]},"externalDocs":{"type":"object","additionalProperties":false,"description":"Allows referencing an external resource for extended documentation.","required":["url"],"properties":{"description":{"type":"string","description":"A short description of the target documentation. CommonMark syntax can be used for rich text representation."},"url":{"type":"string","description":"The URL for the target documentation. This MUST be in the form of an absolute URL.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"examples":[{"description":"Find more info here","url":"https://example.com"}]},"infoExtensions":{"type":"object","description":"The object that lists all the extensions of Info","properties":{"x-x":{"$ref":"#/definitions/extensions-x-0.1.0-schema"},"x-linkedin":{"$ref":"#/definitions/extensions-linkedin-0.1.0-schema"}}},"extensions-x-0.1.0-schema":{"type":"string","description":"This extension allows you to provide the Twitter username of the account representing the team/company of the API.","example":["sambhavgupta75","AsyncAPISpec"]},"extensions-linkedin-0.1.0-schema":{"type":"string","pattern":"^http(s)?://(www\\\\.)?linkedin\\\\.com.*$","description":"This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.","example":["https://www.linkedin.com/company/asyncapi/","https://www.linkedin.com/in/sambhavgupta0705/"]},"servers":{"description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]},"examples":[{"development":{"host":"localhost:5672","description":"Development AMQP broker.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests."}]},"staging":{"host":"rabbitmq-staging.in.mycompany.com:5672","description":"RabbitMQ broker for the staging environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment."}]},"production":{"host":"rabbitmq.in.mycompany.com:5672","description":"RabbitMQ broker for the production environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users."}]}}]},"server":{"type":"object","description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.","required":["host","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"host":{"type":"string","description":"The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}."},"pathname":{"type":"string","description":"The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}."},"title":{"type":"string","description":"A human-friendly title for the server."},"summary":{"type":"string","description":"A brief summary of the server."},"description":{"type":"string","description":"A longer description of the server. CommonMark is allowed."},"protocol":{"type":"string","description":"The protocol this server supports for connection."},"protocolVersion":{"type":"string","description":"An optional string describing the server. CommonMark syntax MAY be used for rich text representation."},"variables":{"$ref":"#/definitions/serverVariables"},"security":{"$ref":"#/definitions/securityRequirements"},"tags":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverBindingsObject"}]}},"examples":[{"host":"kafka.in.mycompany.com:9092","description":"Production Kafka broker.","protocol":"kafka","protocolVersion":"3.2"},{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/production","protocol":"amqp","description":"Production RabbitMQ broker (uses the \`production\` vhost)."}]},"serverVariables":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}},"serverVariable":{"type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"enum":{"type":"array","description":"An enumeration of string values to be used if the substitution options are from a limited set.","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string","description":"The default value to use for substitution, and to send, if an alternate value is not supplied."},"description":{"type":"string","description":"An optional description for the server variable. CommonMark syntax MAY be used for rich text representation."},"examples":{"type":"array","description":"An array of examples of the server variable.","items":{"type":"string"}}},"examples":[{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/{env}","protocol":"amqp","description":"RabbitMQ broker. Use the \`env\` variable to point to either \`production\` or \`staging\`.","variables":{"env":{"description":"Environment to connect to. It can be either \`production\` or \`staging\`.","enum":["production","staging"]}}}]},"securityRequirements":{"description":"An array representing security requirements.","type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}},"SecurityScheme":{"description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}],"examples":[{"type":"userPassword"}]},"userPassword":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"apiKey":{"type":"object","required":["type","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme","enum":["apiKey"]},"in":{"type":"string","description":" The location of the API key.","enum":["user","password"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"X509":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["asymmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"not":{"type":"object","properties":{"scheme":{"type":"string","description":"A short description for security scheme.","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235."},"description":{"type":"string","description":"A short description for security scheme."},"type":{"type":"string","description":"The type of the security scheme.","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","enum":["bearer"]},"bearerFormat":{"type":"string","description":"A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes."},"type":{"type":"string","description":"The type of the security scheme.","enum":["http"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["httpApiKey"]},"name":{"type":"string","description":"The name of the header, query or cookie parameter to be used."},"in":{"type":"string","description":"The location of the API key","enum":["header","query","cookie"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"oauth2Flows":{"type":"object","description":"Allows configuration of the supported OAuth Flows.","required":["type","flows"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["oauth2"]},"description":{"type":"string","description":"A short description for security scheme."},"flows":{"type":"object","properties":{"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","availableScopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","availableScopes"]}]}},"additionalProperties":false},"scopes":{"type":"array","description":"List of the needed scope names.","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"type":"object","description":"Configuration details for a supported OAuth Flow","properties":{"authorizationUrl":{"type":"string","format":"uri","description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL."},"tokenUrl":{"type":"string","format":"uri","description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL."},"refreshUrl":{"type":"string","format":"uri","description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL."},"availableScopes":{"$ref":"#/definitions/oauth2Scopes","description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","availableScopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}]},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["openIdConnect"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."},"openIdConnectUrl":{"type":"string","format":"uri","description":"OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL."},"scopes":{"type":"array","description":"List of the needed scope names. An empty array means no scopes are needed.","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. Valid values","enum":["plain"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["scramSha256","scramSha512"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["gssapi"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"serverBindingsObject":{"type":"object","description":"Map describing protocol-specific definitions for a server.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-server"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-server"}}]},"anypointmq":{},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-server"}}]},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-server"}}]},"solace":{"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.3.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.2.0-server"}}]},"googlepubsub":{},"pulsar":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-server"}}]}}},"bindings-mqtt-0.2.0-server":{"title":"Server Schema","description":"This object contains information about the server representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"clientId":{"type":"string","description":"The client identifier."},"cleanSession":{"type":"boolean","description":"Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5."},"lastWill":{"type":"object","description":"Last Will and Testament configuration.","properties":{"topic":{"type":"string","description":"The topic where the Last Will and Testament message will be sent."},"qos":{"type":"integer","enum":[0,1,2],"description":"Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2."},"message":{"type":"string","description":"Last Will message."},"retain":{"type":"boolean","description":"Whether the broker should retain the Last Will and Testament message or not."}}},"keepAlive":{"type":"integer","description":"Interval in seconds of the longest period of time the broker and the client can endure without sending a message."},"sessionExpiryInterval":{"oneOf":[{"type":"integer","minimum":0},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires."},"maximumPacketSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":4294967295},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"clientId":"guest","cleanSession":true,"lastWill":{"topic":"/last-wills","qos":2,"message":"Guest gone offline.","retain":false},"keepAlive":60,"sessionExpiryInterval":120,"maximumPacketSize":1024,"bindingVersion":"0.2.0"}]},"schema":{"description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.","allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/schema"},"default":{}},"propertyNames":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"discriminator":{"type":"string","description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details."},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"deprecated":{"type":"boolean","description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.","default":false}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"bindings-kafka-0.5.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.3.0"}]},"bindings-jms-0.0.1-server":{"title":"Server Schema","description":"This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["jmsConnectionFactory"],"properties":{"jmsConnectionFactory":{"type":"string","description":"The classname of the ConnectionFactory implementation for the JMS Provider."},"properties":{"type":"array","items":{"$ref":"#/definitions/bindings-jms-0.0.1-server/definitions/property"},"description":"Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider."},"clientID":{"type":"string","description":"A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"definitions":{"property":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of a property"},"value":{"type":["string","boolean","number","null"],"description":"The name of a property"}}}},"examples":[{"jmsConnectionFactory":"org.apache.activemq.ActiveMQConnectionFactory","properties":[{"name":"disableTimeStampsByDefault","value":false}],"clientID":"my-application-1","bindingVersion":"0.0.1"}]},"bindings-ibmmq-0.1.0-server":{"title":"IBM MQ server bindings object","description":"This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"type":"string","description":"Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group."},"ccdtQueueManagerName":{"type":"string","default":"*","description":"The name of the IBM MQ queue manager to bind to in the CCDT file."},"cipherSpec":{"type":"string","description":"The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center."},"multiEndpointServer":{"type":"boolean","default":false,"description":"If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required."},"heartBeatInterval":{"type":"integer","minimum":0,"maximum":999999,"default":300,"description":"The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"examples":[{"groupId":"PRODCLSTR1","cipherSpec":"ANY_TLS12_OR_HIGHER","bindingVersion":"0.1.0"},{"groupId":"PRODCLSTR1","bindingVersion":"0.1.0"}]},"bindings-solace-0.4.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"clientName":{"type":"string","minLength":1,"maxLength":160,"description":"A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.4.0"}]},"bindings-solace-0.3.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.3.0"}]},"bindings-solace-0.2.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msvVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.2.0"}]},"bindings-pulsar-0.1.0-server":{"title":"Server Schema","description":"This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"tenant":{"type":"string","description":"The pulsar tenant. If omitted, 'public' MUST be assumed."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"tenant":"contoso","bindingVersion":"0.1.0"}]},"channels":{"type":"object","description":"An object containing all the Channel Object definitions the Application MUST use during runtime.","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channel"}]},"examples":[{"userSignedUp":{"address":"user.signedup","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"}}}}]},"channel":{"type":"object","description":"Describes a shared communication channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"address":{"type":["string","null"],"description":"An optional string representation of this channel's address. The address is typically the \\"topic name\\", \\"routing key\\", \\"event type\\", or \\"path\\". When \`null\` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions."},"messages":{"$ref":"#/definitions/channelMessages"},"parameters":{"$ref":"#/definitions/parameters"},"title":{"type":"string","description":"A human-friendly title for the channel."},"summary":{"type":"string","description":"A brief summary of the channel."},"description":{"type":"string","description":"A longer description of the channel. CommonMark is allowed."},"servers":{"type":"array","description":"The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"$ref":"#/definitions/Reference"},"uniqueItems":true},"tags":{"type":"array","description":"A list of tags for logical grouping of channels.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channelBindingsObject"}]}},"examples":[{"address":"users.{userId}","title":"Users channel","description":"This channel is used to exchange messages about user events.","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"},"userCompletedOrder":{"$ref":"#/components/messages/userCompletedOrder"}},"parameters":{"userId":{"$ref":"#/components/parameters/userId"}},"servers":[{"$ref":"#/servers/rabbitmqInProd"},{"$ref":"#/servers/rabbitmqInStaging"}],"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}},"tags":[{"name":"user","description":"User-related messages"}],"externalDocs":{"description":"Find more info here","url":"https://example.com"}}]},"channelMessages":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageObject"}]},"description":"A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**"},"messageObject":{"type":"object","description":"Describes a message received on a given channel and operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field."},"headers":{"$ref":"#/definitions/anySchema"},"payload":{"$ref":"#/definitions/anySchema"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"$ref":"#/definitions/messageExampleObject"}},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]},"traits":{"type":"array","description":"A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]},{"type":"object","additionalItems":true}]}]}}},"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]}]},"anySchema":{"if":{"required":["schema"]},"then":{"$ref":"#/definitions/multiFormatSchema"},"else":{"$ref":"#/definitions/schema"},"description":"An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise."},"multiFormatSchema":{"description":"The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).","type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"if":{"not":{"type":"object"}},"then":{"$ref":"#/definitions/schema"},"else":{"properties":{"schemaFormat":{"description":"A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.","anyOf":[{"type":"string"},{"description":"All the schema formats tooling MUST support","enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0"]},{"description":"All the schema formats tools are RECOMMENDED to support","enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/raml+yaml;version=1.0"]}]}},"allOf":[{"if":{"not":{"description":"If no schemaFormat has been defined, default to schema or reference","required":["schemaFormat"]}},"then":{"properties":{"schema":{"$ref":"#/definitions/schema"}}}},{"if":{"description":"If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats","required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"schema":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/openapiSchema_3_0"}]}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/avroSchema_v1"}]}}}}]}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"correlationId":{"type":"object","description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"messageExampleObject":{"type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Example of the application headers. It MUST be a map of key-value pairs."},"payload":{"type":["number","string","boolean","object","array","null"],"description":"Example of the message payload. It can be of any type."}}},"messageBindingsObject":{"type":"object","description":"Map describing protocol-specific definitions for a message.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"http":{"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-message"}}]},"ws":{},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-message"}}]},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-message"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-message"}}]},"anypointmq":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-message"}}]},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-message"}}]},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-message"}}]},"solace":{},"googlepubsub":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-message"}}]}}},"bindings-http-0.3.0-message":{"title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"statusCode":{"type":"number","description":"The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). \`statusCode\` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.3.0"}]},"bindings-http-0.2.0-message":{"title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.2.0"}]},"bindings-amqp-0.3.0-message":{"title":"AMQP message bindings object","description":"This object contains information about the message representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"contentEncoding":{"type":"string","description":"A MIME encoding for the message content."},"messageType":{"type":"string","description":"Application-specific message type."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"contentEncoding":"gzip","messageType":"user.signup","bindingVersion":"0.3.0"}]},"bindings-mqtt-0.2.0-message":{"title":"MQTT message bindings object","description":"This object contains information about the message representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"payloadFormatIndicator":{"type":"integer","enum":[0,1],"description":"1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.","default":0},"correlationData":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received."},"contentType":{"type":"string","description":"String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object."},"responseTopic":{"oneOf":[{"type":"string","format":"uri-template","minLength":1},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"The topic (channel URI) to be used for a response message."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0"},{"contentType":"application/json","correlationData":{"type":"string","format":"uuid"},"responseTopic":"application/responses","bindingVersion":"0.2.0"}]},"bindings-kafka-0.5.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.5.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"anyOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/avroSchema_v1"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.4.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"$ref":"#/definitions/schema","description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.3.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.3.0"}]},"bindings-anypointmq-0.0.1-message":{"title":"Anypoint MQ message bindings object","description":"This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"messageId":{"type":"string"}}},"bindingVersion":"0.0.1"}]},"bindings-jms-0.0.1-message":{"title":"Message Schema","description":"This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","required":["JMSMessageID"],"properties":{"JMSMessageID":{"type":["string","null"],"description":"A unique message identifier. This may be set by your JMS Provider on your behalf."},"JMSTimestamp":{"type":"integer","description":"The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC."},"JMSDeliveryMode":{"type":"string","enum":["PERSISTENT","NON_PERSISTENT"],"default":"PERSISTENT","description":"Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf."},"JMSPriority":{"type":"integer","default":4,"description":"The priority of the message. This may be set by your JMS Provider on your behalf."},"JMSExpires":{"type":"integer","description":"The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire."},"JMSType":{"type":["string","null"],"description":"The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it."},"JMSCorrelationID":{"type":["string","null"],"description":"The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values."},"JMSReplyTo":{"type":"string","description":"The queue or topic that the message sender expects replies to."}}},"bindingVersion":"0.0.1"}]},"bindings-ibmmq-0.1.0-message":{"title":"IBM MQ message bindings object","description":"This object contains information about the message representation in IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"type":{"type":"string","enum":["string","jms","binary"],"default":"string","description":"The type of the message."},"headers":{"type":"string","description":"Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center."},"description":{"type":"string","description":"Provides additional information for application developers: describes the message type or format."},"expiry":{"type":"integer","minimum":0,"default":0,"description":"The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"type":{"const":"binary"}}},{"properties":{"type":{"const":"jms"}},"not":{"required":["headers"]}},{"properties":{"type":{"const":"string"}},"not":{"required":["headers"]}}],"examples":[{"type":"string","bindingVersion":"0.1.0"},{"type":"jms","description":"JMS stream message","bindingVersion":"0.1.0"}]},"bindings-googlepubsub-0.2.0-message":{"title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the message representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"attributes":{"type":"object"},"orderingKey":{"type":"string"},"schema":{"type":"object","additionalItems":false,"properties":{"name":{"type":"string"}},"required":["name"]}},"examples":[{"schema":{"name":"projects/your-project-id/schemas/your-avro-schema-id"}},{"schema":{"name":"projects/your-project-id/schemas/your-protobuf-schema-id"}}]},"messageTrait":{"type":"object","description":"Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field."},"headers":{"$ref":"#/definitions/anySchema"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"tags":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"$ref":"#/definitions/messageExampleObject"}},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]}},"examples":[{"contentType":"application/json"}]},"parameters":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"description":"JSON objects describing re-usable channel parameters.","examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user."}}}]},"parameter":{"description":"Describes a parameter included in a channel address.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"examples":{"description":"An array of examples of the parameter value.","type":"array","items":{"type":"string"}},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user.","location":"$message.payload#/user/id"}}}]},"channelBindingsObject":{"type":"object","description":"Map describing protocol-specific definitions for a channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"http":{},"ws":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-websockets-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-websockets-0.1.0-channel"}}]},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-channel"}}]},"amqp1":{},"mqtt":{},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-channel"}}]},"anypointmq":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-channel"}}]},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-channel"}}]},"sns":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-channel"}}]},"sqs":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel"}}]},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-channel"}}]},"solace":{},"googlepubsub":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-channel"}}]},"pulsar":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-channel"}}]}}},"bindings-websockets-0.1.0-channel":{"title":"WebSockets channel bindings object","description":"When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","POST"],"description":"The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'."},"query":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key."},"headers":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"method":"POST","bindingVersion":"0.1.0"}]},"bindings-amqp-0.3.0-channel":{"title":"AMQP channel bindings object","description":"This object contains information about the channel representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"is":{"type":"string","enum":["queue","routingKey"],"description":"Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)."},"exchange":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the exchange. It MUST NOT exceed 255 characters long."},"type":{"type":"string","enum":["topic","direct","fanout","default","headers"],"description":"The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'."},"durable":{"type":"boolean","description":"Whether the exchange should survive broker restarts or not."},"autoDelete":{"type":"boolean","description":"Whether the exchange should be deleted when the last queue is unbound from it."},"vhost":{"type":"string","default":"/","description":"The virtual host of the exchange. Defaults to '/'."}},"description":"When is=routingKey, this object defines the exchange properties."},"queue":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the queue. It MUST NOT exceed 255 characters long."},"durable":{"type":"boolean","description":"Whether the queue should survive broker restarts or not."},"exclusive":{"type":"boolean","description":"Whether the queue should be used only by one connection or not."},"autoDelete":{"type":"boolean","description":"Whether the queue should be deleted when the last consumer unsubscribes."},"vhost":{"type":"string","default":"/","description":"The virtual host of the queue. Defaults to '/'."}},"description":"When is=queue, this object defines the queue properties."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"oneOf":[{"properties":{"is":{"const":"routingKey"}},"required":["exchange"],"not":{"required":["queue"]}},{"properties":{"is":{"const":"queue"}},"required":["queue"],"not":{"required":["exchange"]}}],"examples":[{"is":"routingKey","exchange":{"name":"myExchange","type":"topic","durable":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"},{"is":"queue","queue":{"name":"my-queue-name","durable":true,"exclusive":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"}]},"bindings-kafka-0.5.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":true,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0},"confluent.key.schema.validation":{"description":"It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)","type":"boolean"},"confluent.key.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)","type":"string"},"confluent.value.schema.validation":{"description":"It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)","type":"boolean"},"confluent.value.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)","type":"string"}}},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":false,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0}}},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.3.0"}]},"bindings-anypointmq-0.0.1-channel":{"title":"Anypoint MQ channel bindings object","description":"This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destination":{"type":"string","description":"The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name."},"destinationType":{"type":"string","enum":["exchange","queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signup-exchg","destinationType":"exchange","bindingVersion":"0.0.1"}]},"bindings-jms-0.0.1-channel":{"title":"Channel Schema","description":"This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destination":{"type":"string","description":"The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name."},"destinationType":{"type":"string","enum":["queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signed-up","destinationType":"fifo-queue","bindingVersion":"0.0.1"}]},"bindings-sns-0.1.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"name":{"type":"string","description":"The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations."},"ordering":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/ordering"},"policy":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the topic."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["name"],"definitions":{"ordering":{"type":"object","description":"By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"type":{"type":"string","description":"Defines the type of SNS Topic.","enum":["standard","FIFO"]},"contentBasedDeduplication":{"type":"boolean","description":"True to turn on de-duplication of messages for a channel."}},"required":["type"]},"policy":{"type":"object","description":"The security policy for the SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this topic","items":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SNS permission being allowed or denied e.g. sns:Publish","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"name":"my-sns-topic","policy":{"statements":[{"effect":"Allow","principal":"*","action":"SNS:Publish"}]}}]},"bindings-sqs-0.2.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queue":{"description":"A definition of the queue that will be used as the channel.","$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/queue"},"deadLetterQueue":{"description":"A definition of the queue that will be used for un-processable messages.","$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/queue"},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queue"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy"},"policy":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name","fifoQueue"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queue":{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":15,"visibilityTimeout":60,"receiveMessageWaitTime":0,"messageRetentionPeriod":86400,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]},"tags":{"owner":"AsyncAPI.NET","platform":"AsyncAPIOrg"}},"deadLetterQueue":{"name":"myQueue_error","deliveryDelay":0,"visibilityTimeout":0,"receiveMessageWaitTime":0,"messageRetentionPeriod":604800}}]},"bindings-ibmmq-0.1.0-channel":{"title":"IBM MQ channel bindings object","description":"This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destinationType":{"type":"string","enum":["topic","queue"],"default":"topic","description":"Defines the type of AsyncAPI channel."},"queue":{"type":"object","description":"Defines the properties of a queue.","properties":{"objectName":{"type":"string","maxLength":48,"description":"Defines the name of the IBM MQ queue associated with the channel."},"isPartitioned":{"type":"boolean","default":false,"description":"Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center."},"exclusive":{"type":"boolean","default":false,"description":"Specifies if it is recommended to open the queue exclusively."}},"required":["objectName"]},"topic":{"type":"object","description":"Defines the properties of a topic.","properties":{"string":{"type":"string","maxLength":10240,"description":"The value of the IBM MQ topic string to be used."},"objectName":{"type":"string","maxLength":48,"description":"The name of the IBM MQ topic object."},"durablePermitted":{"type":"boolean","default":true,"description":"Defines if the subscription may be durable."},"lastMsgRetained":{"type":"boolean","default":false,"description":"Defines if the last message published will be made available to new subscriptions."}}},"maxMsgLength":{"type":"integer","minimum":0,"maximum":104857600,"description":"The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"destinationType":{"const":"topic"}},"not":{"required":["queue"]}},{"properties":{"destinationType":{"const":"queue"}},"required":["queue"],"not":{"required":["topic"]}}],"examples":[{"destinationType":"topic","topic":{"objectName":"myTopicName"},"bindingVersion":"0.1.0"},{"destinationType":"queue","queue":{"objectName":"myQueueName","exclusive":true},"bindingVersion":"0.1.0"}]},"bindings-googlepubsub-0.2.0-channel":{"title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the channel representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"labels":{"type":"object"},"messageRetentionDuration":{"type":"string"},"messageStoragePolicy":{"type":"object","additionalProperties":false,"properties":{"allowedPersistenceRegions":{"type":"array","items":{"type":"string"}}}},"schemaSettings":{"type":"object","additionalItems":false,"properties":{"encoding":{"type":"string"},"firstRevisionId":{"type":"string"},"lastRevisionId":{"type":"string"},"name":{"type":"string"}},"required":["encoding","name"]}},"required":["schemaSettings"],"examples":[{"labels":{"label1":"value1","label2":"value2"},"messageRetentionDuration":"86400s","messageStoragePolicy":{"allowedPersistenceRegions":["us-central1","us-east1"]},"schemaSettings":{"encoding":"json","name":"projects/your-project-id/schemas/your-schema"}}]},"bindings-pulsar-0.1.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["namespace","persistence"],"properties":{"namespace":{"type":"string","description":"The namespace, the channel is associated with."},"persistence":{"type":"string","enum":["persistent","non-persistent"],"description":"persistence of the topic in Pulsar."},"compaction":{"type":"integer","minimum":0,"description":"Topic compaction threshold given in MB"},"geo-replication":{"type":"array","description":"A list of clusters the topic is replicated to.","items":{"type":"string"}},"retention":{"type":"object","additionalProperties":false,"properties":{"time":{"type":"integer","minimum":0,"description":"Time given in Minutes. \`0\` = Disable message retention."},"size":{"type":"integer","minimum":0,"description":"Size given in MegaBytes. \`0\` = Disable message retention."}}},"ttl":{"type":"integer","description":"TTL in seconds for the specified topic"},"deduplication":{"type":"boolean","description":"Whether deduplication of events is enabled or not."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"namespace":"ns1","persistence":"persistent","compaction":1000,"retention":{"time":15,"size":1000},"ttl":360,"geo-replication":["us-west","us-east"],"deduplication":true,"bindingVersion":"0.1.0"}]},"operations":{"type":"object","description":"Holds a dictionary with all the operations this application MUST implement.","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operation"}]},"examples":[{"onUserSignUp":{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}]}}]},"operation":{"type":"object","description":"Describes a specific operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["action","channel"],"properties":{"action":{"type":"string","description":"Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.","enum":["send","receive"]},"channel":{"$ref":"#/definitions/Reference"},"messages":{"type":"array","description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","items":{"$ref":"#/definitions/Reference"}},"reply":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReply"}]},"traits":{"type":"array","description":"A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}},"title":{"type":"string","description":"A human-friendly title for the operation."},"summary":{"type":"string","description":"A brief summary of the operation."},"description":{"type":"string","description":"A longer description of the operation. CommonMark is allowed."},"security":{"$ref":"#/definitions/securityRequirements"},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]}},"examples":[{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","security":[{"petstore_auth":["write:pets","read:pets"]}],"tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}],"messages":[{"$ref":"/components/messages/userSignedUp"}],"reply":{"address":{"location":"$message.header#/replyTo"},"channel":{"$ref":"#/channels/userSignupReply"},"messages":[{"$ref":"/components/messages/userSignedUpReply"}]}}]},"operationReply":{"type":"object","description":"Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"address":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReplyAddress"}]},"channel":{"$ref":"#/definitions/Reference"},"messages":{"type":"array","description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","items":{"$ref":"#/definitions/Reference"}}}},"operationReplyAddress":{"type":"object","description":"An object that specifies where an operation has to send the reply","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["location"],"properties":{"location":{"type":"string","description":"A runtime expression that specifies the location of the reply address.","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"description":{"type":"string","description":"An optional description of the address. CommonMark is allowed."}},"examples":[{"description":"Consumer inbox","location":"$message.header#/replyTo"}]},"operationTrait":{"type":"object","description":"Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"title":{"description":"A human-friendly title for the operation.","$ref":"#/definitions/operation/properties/title"},"summary":{"description":"A short summary of what the operation is about.","$ref":"#/definitions/operation/properties/summary"},"description":{"description":"A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.","$ref":"#/definitions/operation/properties/description"},"security":{"description":"A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.","$ref":"#/definitions/operation/properties/security"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","$ref":"#/definitions/operation/properties/tags"},"externalDocs":{"description":"Additional external documentation for this operation.","$ref":"#/definitions/operation/properties/externalDocs"},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.","oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]}},"examples":[{"bindings":{"amqp":{"ack":false}}}]},"operationBindingsObject":{"type":"object","description":"Map describing protocol-specific definitions for an operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"http":{"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-operation"}}]},"ws":{},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-operation"}}]},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-operation"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-operation"}}]},"anypointmq":{},"nats":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-nats-0.1.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-nats-0.1.0-operation"}}]},"jms":{},"sns":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-operation"}}]},"sqs":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation"}}]},"stomp":{},"redis":{},"ibmmq":{},"solace":{"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.2.0-operation"}}]},"googlepubsub":{}}},"bindings-http-0.3.0-operation":{"title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"}]},"bindings-http-0.2.0-operation":{"title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"}]},"bindings-amqp-0.3.0-operation":{"title":"AMQP operation bindings object","description":"This object contains information about the operation representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"expiration":{"type":"integer","minimum":0,"description":"TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero."},"userId":{"type":"string","description":"Identifies the user who has sent the message."},"cc":{"type":"array","items":{"type":"string"},"description":"The routing keys the message should be routed to at the time of publishing."},"priority":{"type":"integer","description":"A priority for the message."},"deliveryMode":{"type":"integer","enum":[1,2],"description":"Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)."},"mandatory":{"type":"boolean","description":"Whether the message is mandatory or not."},"bcc":{"type":"array","items":{"type":"string"},"description":"Like cc but consumers will not receive this information."},"timestamp":{"type":"boolean","description":"Whether the message should include a timestamp or not."},"ack":{"type":"boolean","description":"Whether the consumer should ack the message or not."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"expiration":100000,"userId":"guest","cc":["user.logs"],"priority":10,"deliveryMode":2,"mandatory":false,"bcc":["external.audit"],"timestamp":true,"ack":false,"bindingVersion":"0.3.0"}]},"bindings-mqtt-0.2.0-operation":{"title":"MQTT operation bindings object","description":"This object contains information about the operation representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"qos":{"type":"integer","enum":[0,1,2],"description":"Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)."},"retain":{"type":"boolean","description":"Whether the broker should retain the message or not."},"messageExpiryInterval":{"oneOf":[{"type":"integer","minimum":0,"maximum":4294967295},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Lifetime of the message in seconds"},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"qos":2,"retain":true,"messageExpiryInterval":60,"bindingVersion":"0.2.0"}]},"bindings-kafka-0.5.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.3.0"}]},"bindings-nats-0.1.0-operation":{"title":"NATS operation bindings object","description":"This object contains information about the operation representation in NATS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queue":{"type":"string","description":"Defines the name of the queue to use. It MUST NOT exceed 255 characters.","maxLength":255},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"queue":"MyCustomQueue","bindingVersion":"0.1.0"}]},"bindings-sns-0.1.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier","description":"Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document."},"consumers":{"type":"array","description":"The protocols that listen to this topic and their endpoints.","items":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/consumer"},"minItems":1},"deliveryPolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["consumers"],"definitions":{"identifier":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string","description":"The endpoint is a URL."},"email":{"type":"string","description":"The endpoint is an email address."},"phone":{"type":"string","description":"The endpoint is a phone number."},"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including."}}},"consumer":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"protocol":{"description":"The protocol that this endpoint receives messages by.","type":"string","enum":["http","https","email","email-json","sms","sqs","application","lambda","firehose"]},"endpoint":{"description":"The endpoint messages are delivered to.","$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier"},"filterPolicy":{"type":"object","description":"Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"},{"type":"object"}]}},"filterPolicyScope":{"type":"string","description":"Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.","enum":["MessageAttributes","MessageBody"],"default":"MessageAttributes"},"rawMessageDelivery":{"type":"boolean","description":"If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body."},"redrivePolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy"},"deliveryPolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic."},"displayName":{"type":"string","description":"The display name to use with an SNS subscription"}},"required":["protocol","endpoint","rawMessageDelivery"]},"deliveryPolicy":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"minDelayTarget":{"type":"integer","description":"The minimum delay for a retry in seconds."},"maxDelayTarget":{"type":"integer","description":"The maximum delay for a retry in seconds."},"numRetries":{"type":"integer","description":"The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries."},"numNoDelayRetries":{"type":"integer","description":"The number of immediate retries (with no delay)."},"numMinDelayRetries":{"type":"integer","description":"The number of immediate retries (with delay)."},"numMaxDelayRetries":{"type":"integer","description":"The number of post-backoff phase retries, with the maximum delay between retries."},"backoffFunction":{"type":"string","description":"The algorithm for backoff between retries.","enum":["arithmetic","exponential","geometric","linear"]},"maxReceivesPerSecond":{"type":"integer","description":"The maximum number of deliveries per second, per subscription."}}},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier","description":"The SQS queue to use as a dead letter queue (DLQ)."},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]}},"examples":[{"topic":{"name":"someTopic"},"consumers":[{"protocol":"sqs","endpoint":{"name":"someQueue"},"filterPolicy":{"store":["asyncapi_corp"],"event":[{"anything-but":"order_cancelled"}],"customer_interests":["rugby","football","baseball"]},"filterPolicyScope":"MessageAttributes","rawMessageDelivery":false,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":25},"deliveryPolicy":{"minDelayTarget":10,"maxDelayTarget":100,"numRetries":5,"numNoDelayRetries":2,"numMinDelayRetries":3,"numMaxDelayRetries":5,"backoffFunction":"linear","maxReceivesPerSecond":2}}]}]},"bindings-sqs-0.2.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queues":{"type":"array","description":"Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/queue"}},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queues"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"type":"string","description":"Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined."},"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy"},"policy":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queues":[{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":10,"redrivePolicy":{"deadLetterQueue":{"name":"myQueue_error"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]}},{"name":"myQueue_error","deliveryDelay":10}]}]},"bindings-solace-0.4.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."},"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"timeToLive":{"type":"integer","description":"Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message."},"priority":{"type":"integer","minimum":0,"maximum":255,"description":"The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority."},"dmqEligible":{"type":"boolean","description":"Set the message to be eligible to be moved to a Dead Message Queue. The default value is false."}},"examples":[{"bindingVersion":"0.4.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"bindings-solace-0.3.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.3.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"bindings-solace-0.2.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"components":{"type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemas":{"type":"object","description":"An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"$ref":"#/definitions/anySchema"}}},"servers":{"type":"object","description":"An object to hold reusable Server Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]}}},"channels":{"type":"object","description":"An object to hold reusable Channel Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channel"}]}}},"serverVariables":{"type":"object","description":"An object to hold reusable Server Variable Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}}},"operations":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operation"}]}}},"messages":{"type":"object","description":"An object to hold reusable Message Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageObject"}]}}},"securitySchemes":{"type":"object","description":"An object to hold reusable Security Scheme Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"parameters":{"type":"object","description":"An object to hold reusable Parameter Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]}}},"correlationIds":{"type":"object","description":"An object to hold reusable Correlation ID Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"operationTraits":{"type":"object","description":"An object to hold reusable Operation Trait Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}}},"messageTraits":{"type":"object","description":"An object to hold reusable Message Trait Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"replies":{"type":"object","description":"An object to hold reusable Operation Reply Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReply"}]}}},"replyAddresses":{"type":"object","description":"An object to hold reusable Operation Reply Address Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReplyAddress"}]}}},"serverBindings":{"type":"object","description":"An object to hold reusable Server Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverBindingsObject"}]}}},"channelBindings":{"type":"object","description":"An object to hold reusable Channel Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channelBindingsObject"}]}}},"operationBindings":{"type":"object","description":"An object to hold reusable Operation Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]}}},"messageBindings":{"type":"object","description":"An object to hold reusable Message Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]}}},"tags":{"type":"object","description":"An object to hold reusable Tag Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}}},"externalDocs":{"type":"object","description":"An object to hold reusable External Documentation Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]}}}},"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"AvroExample":{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","schema":{"$ref":"path/to/user-create.avsc#/UserCreate"}}},"servers":{"development":{"host":"{stage}.in.mycompany.com:{port}","description":"RabbitMQ broker","protocol":"amqp","protocolVersion":"0-9-1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`mycompany.com\`"},"port":{"enum":["5671","5672"],"default":"5672"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user."}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 64292: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/3.0.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 3.0.0 schema.","type":"object","required":["asyncapi","info"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"asyncapi":{"type":"string","const":"3.0.0","description":"The AsyncAPI specification version of this document."},"id":{"type":"string","description":"A unique id representing the application.","format":"uri"},"info":{"$ref":"http://asyncapi.com/definitions/3.0.0/info.json"},"servers":{"$ref":"http://asyncapi.com/definitions/3.0.0/servers.json"},"defaultContentType":{"type":"string","description":"Default content type to use when encoding/decoding a message's payload."},"channels":{"$ref":"http://asyncapi.com/definitions/3.0.0/channels.json"},"operations":{"$ref":"http://asyncapi.com/definitions/3.0.0/operations.json"},"components":{"$ref":"http://asyncapi.com/definitions/3.0.0/components.json"}},"definitions":{"http://asyncapi.com/definitions/3.0.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/definitions/3.0.0/info.json":{"$id":"http://asyncapi.com/definitions/3.0.0/info.json","description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","allOf":[{"type":"object","required":["version","title"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"title":{"type":"string","description":"A unique and precise title of the API."},"version":{"type":"string","description":"A semantic version number of the API."},"description":{"type":"string","description":"A longer description of the API. Should be different from the title. CommonMark is allowed."},"termsOfService":{"type":"string","description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","format":"uri"},"contact":{"$ref":"http://asyncapi.com/definitions/3.0.0/contact.json"},"license":{"$ref":"http://asyncapi.com/definitions/3.0.0/license.json"},"tags":{"type":"array","description":"A list of tags for application API documentation control. Tags can be used for logical grouping of applications.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]}}},{"$ref":"http://asyncapi.com/definitions/3.0.0/infoExtensions.json"}],"examples":[{"title":"AsyncAPI Sample App","version":"1.0.1","description":"This is a sample app.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.asyncapi.org/support","email":"support@asyncapi.org"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocs":{"description":"Find more info here","url":"https://www.asyncapi.org"},"tags":[{"name":"e-commerce"}]}]},"http://asyncapi.com/definitions/3.0.0/contact.json":{"$id":"http://asyncapi.com/definitions/3.0.0/contact.json","type":"object","description":"Contact information for the exposed API.","additionalProperties":false,"properties":{"name":{"type":"string","description":"The identifying name of the contact person/organization."},"url":{"type":"string","description":"The URL pointing to the contact information.","format":"uri"},"email":{"type":"string","description":"The email address of the contact person/organization.","format":"email"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"http://asyncapi.com/definitions/3.0.0/license.json":{"$id":"http://asyncapi.com/definitions/3.0.0/license.json","type":"object","required":["name"],"additionalProperties":false,"properties":{"name":{"type":"string","description":"The name of the license type. It's encouraged to use an OSI compatible license."},"url":{"type":"string","description":"The URL pointing to the license.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"http://asyncapi.com/definitions/3.0.0/Reference.json":{"$id":"http://asyncapi.com/definitions/3.0.0/Reference.json","type":"object","description":"A simple object to allow referencing other components in the specification, internally and externally.","required":["$ref"],"properties":{"$ref":{"description":"The reference string.","$ref":"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json"}},"examples":[{"$ref":"#/components/schemas/Pet"}]},"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/3.0.0/tag.json":{"$id":"http://asyncapi.com/definitions/3.0.0/tag.json","type":"object","description":"Allows adding metadata to a single tag.","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","description":"The name of the tag."},"description":{"type":"string","description":"A short description for the tag. CommonMark syntax can be used for rich text representation."},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"examples":[{"name":"user","description":"User-related messages"}]},"http://asyncapi.com/definitions/3.0.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/3.0.0/externalDocs.json","type":"object","additionalProperties":false,"description":"Allows referencing an external resource for extended documentation.","required":["url"],"properties":{"description":{"type":"string","description":"A short description of the target documentation. CommonMark syntax can be used for rich text representation."},"url":{"type":"string","description":"The URL for the target documentation. This MUST be in the form of an absolute URL.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"examples":[{"description":"Find more info here","url":"https://example.com"}]},"http://asyncapi.com/definitions/3.0.0/infoExtensions.json":{"$id":"http://asyncapi.com/definitions/3.0.0/infoExtensions.json","type":"object","description":"The object that lists all the extensions of Info","properties":{"x-x":{"$ref":"http://asyncapi.com/extensions/x/0.1.0/schema.json"},"x-linkedin":{"$ref":"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json"}}},"http://asyncapi.com/extensions/x/0.1.0/schema.json":{"$id":"http://asyncapi.com/extensions/x/0.1.0/schema.json","type":"string","description":"This extension allows you to provide the Twitter username of the account representing the team/company of the API.","example":["sambhavgupta75","AsyncAPISpec"]},"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json":{"$id":"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json","type":"string","pattern":"^http(s)?://(www\\\\.)?linkedin\\\\.com.*$","description":"This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.","example":["https://www.linkedin.com/company/asyncapi/","https://www.linkedin.com/in/sambhavgupta0705/"]},"http://asyncapi.com/definitions/3.0.0/servers.json":{"$id":"http://asyncapi.com/definitions/3.0.0/servers.json","description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/server.json"}]},"examples":[{"development":{"host":"localhost:5672","description":"Development AMQP broker.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests."}]},"staging":{"host":"rabbitmq-staging.in.mycompany.com:5672","description":"RabbitMQ broker for the staging environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment."}]},"production":{"host":"rabbitmq.in.mycompany.com:5672","description":"RabbitMQ broker for the production environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users."}]}}]},"http://asyncapi.com/definitions/3.0.0/server.json":{"$id":"http://asyncapi.com/definitions/3.0.0/server.json","type":"object","description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.","required":["host","protocol"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"host":{"type":"string","description":"The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}."},"pathname":{"type":"string","description":"The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}."},"title":{"type":"string","description":"A human-friendly title for the server."},"summary":{"type":"string","description":"A brief summary of the server."},"description":{"type":"string","description":"A longer description of the server. CommonMark is allowed."},"protocol":{"type":"string","description":"The protocol this server supports for connection."},"protocolVersion":{"type":"string","description":"An optional string describing the server. CommonMark syntax MAY be used for rich text representation."},"variables":{"$ref":"http://asyncapi.com/definitions/3.0.0/serverVariables.json"},"security":{"$ref":"http://asyncapi.com/definitions/3.0.0/securityRequirements.json"},"tags":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"}]}},"examples":[{"host":"kafka.in.mycompany.com:9092","description":"Production Kafka broker.","protocol":"kafka","protocolVersion":"3.2"},{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/production","protocol":"amqp","description":"Production RabbitMQ broker (uses the \`production\` vhost)."}]},"http://asyncapi.com/definitions/3.0.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/3.0.0/serverVariables.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/serverVariable.json"}]}},"http://asyncapi.com/definitions/3.0.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/3.0.0/serverVariable.json","type":"object","description":"An object representing a Server Variable for server URL template substitution.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"enum":{"type":"array","description":"An enumeration of string values to be used if the substitution options are from a limited set.","items":{"type":"string"},"uniqueItems":true},"default":{"type":"string","description":"The default value to use for substitution, and to send, if an alternate value is not supplied."},"description":{"type":"string","description":"An optional description for the server variable. CommonMark syntax MAY be used for rich text representation."},"examples":{"type":"array","description":"An array of examples of the server variable.","items":{"type":"string"}}},"examples":[{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/{env}","protocol":"amqp","description":"RabbitMQ broker. Use the \`env\` variable to point to either \`production\` or \`staging\`.","variables":{"env":{"description":"Environment to connect to. It can be either \`production\` or \`staging\`.","enum":["production","staging"]}}}]},"http://asyncapi.com/definitions/3.0.0/securityRequirements.json":{"$id":"http://asyncapi.com/definitions/3.0.0/securityRequirements.json","description":"An array representing security requirements.","type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/SecurityScheme.json"}]}},"http://asyncapi.com/definitions/3.0.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/SecurityScheme.json","description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json"}],"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/3.0.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/3.0.0/userPassword.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["userPassword"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/3.0.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/3.0.0/apiKey.json","type":"object","required":["type","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme","enum":["apiKey"]},"in":{"type":"string","description":" The location of the API key.","enum":["user","password"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"http://asyncapi.com/definitions/3.0.0/X509.json":{"$id":"http://asyncapi.com/definitions/3.0.0/X509.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["X509"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["symmetricEncryption"]},"description":{"type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["asymmetricEncryption"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json","not":{"type":"object","properties":{"scheme":{"type":"string","description":"A short description for security scheme.","enum":["bearer"]}}},"type":"object","required":["scheme","type"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235."},"description":{"type":"string","description":"A short description for security scheme."},"type":{"type":"string","description":"The type of the security scheme.","enum":["http"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"scheme":{"type":"string","description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","enum":["bearer"]},"bearerFormat":{"type":"string","description":"A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes."},"type":{"type":"string","description":"The type of the security scheme.","enum":["http"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["httpApiKey"]},"name":{"type":"string","description":"The name of the header, query or cookie parameter to be used."},"in":{"type":"string","description":"The location of the API key","enum":["header","query","cookie"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"http://asyncapi.com/definitions/3.0.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/3.0.0/oauth2Flows.json","type":"object","description":"Allows configuration of the supported OAuth Flows.","required":["type","flows"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["oauth2"]},"description":{"type":"string","description":"A short description for security scheme."},"flows":{"type":"object","properties":{"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json"},{"required":["authorizationUrl","availableScopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","availableScopes"]}]}},"additionalProperties":false},"scopes":{"type":"array","description":"List of the needed scope names.","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/3.0.0/oauth2Flow.json","type":"object","description":"Configuration details for a supported OAuth Flow","properties":{"authorizationUrl":{"type":"string","format":"uri","description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL."},"tokenUrl":{"type":"string","format":"uri","description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL."},"refreshUrl":{"type":"string","format":"uri","description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL."},"availableScopes":{"$ref":"http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json","description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","availableScopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}]},"http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/3.0.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/3.0.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["openIdConnect"]},"description":{"type":"string","description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation."},"openIdConnectUrl":{"type":"string","format":"uri","description":"OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL."},"scopes":{"type":"array","description":"List of the needed scope names. An empty array means no scopes are needed.","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme. Valid values","enum":["plain"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["scramSha256","scramSha512"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"type":{"type":"string","description":"The type of the security scheme.","enum":["gssapi"]},"description":{"type":"string","description":"A short description for security scheme."}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json","type":"object","description":"Map describing protocol-specific definitions for a server.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"http":{},"ws":{},"amqp":{},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/server.json"}}]},"anypointmq":{},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json"}}]},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json"}}]},"solace":{"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.3.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.2.0/server.json"}}]},"googlepubsub":{},"pulsar":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json"}}]}}},"http://asyncapi.com/bindings/mqtt/0.2.0/server.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json","title":"Server Schema","description":"This object contains information about the server representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"clientId":{"type":"string","description":"The client identifier."},"cleanSession":{"type":"boolean","description":"Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5."},"lastWill":{"type":"object","description":"Last Will and Testament configuration.","properties":{"topic":{"type":"string","description":"The topic where the Last Will and Testament message will be sent."},"qos":{"type":"integer","enum":[0,1,2],"description":"Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2."},"message":{"type":"string","description":"Last Will message."},"retain":{"type":"boolean","description":"Whether the broker should retain the Last Will and Testament message or not."}}},"keepAlive":{"type":"integer","description":"Interval in seconds of the longest period of time the broker and the client can endure without sending a message."},"sessionExpiryInterval":{"oneOf":[{"type":"integer","minimum":0},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires."},"maximumPacketSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":4294967295},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"clientId":"guest","cleanSession":true,"lastWill":{"topic":"/last-wills","qos":2,"message":"Guest gone offline.","retain":false},"keepAlive":60,"sessionExpiryInterval":120,"maximumPacketSize":1024,"bindingVersion":"0.2.0"}]},"http://asyncapi.com/definitions/3.0.0/schema.json":{"$id":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"discriminator":{"type":"string","description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details."},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"deprecated":{"type":"boolean","description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/bindings/kafka/0.5.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/jms/0.0.1/server.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/server.json","title":"Server Schema","description":"This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["jmsConnectionFactory"],"properties":{"jmsConnectionFactory":{"type":"string","description":"The classname of the ConnectionFactory implementation for the JMS Provider."},"properties":{"type":"array","items":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property"},"description":"Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider."},"clientID":{"type":"string","description":"A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"definitions":{"property":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of a property"},"value":{"type":["string","boolean","number","null"],"description":"The name of a property"}}}},"examples":[{"jmsConnectionFactory":"org.apache.activemq.ActiveMQConnectionFactory","properties":[{"name":"disableTimeStampsByDefault","value":false}],"clientID":"my-application-1","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json","title":"IBM MQ server bindings object","description":"This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"type":"string","description":"Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group."},"ccdtQueueManagerName":{"type":"string","default":"*","description":"The name of the IBM MQ queue manager to bind to in the CCDT file."},"cipherSpec":{"type":"string","description":"The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center."},"multiEndpointServer":{"type":"boolean","default":false,"description":"If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required."},"heartBeatInterval":{"type":"integer","minimum":0,"maximum":999999,"default":300,"description":"The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"examples":[{"groupId":"PRODCLSTR1","cipherSpec":"ANY_TLS12_OR_HIGHER","bindingVersion":"0.1.0"},{"groupId":"PRODCLSTR1","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/solace/0.4.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.4.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"clientName":{"type":"string","minLength":1,"maxLength":160,"description":"A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/solace/0.3.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.3.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/solace/0.2.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.2.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msvVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/pulsar/0.1.0/server.json":{"$id":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json","title":"Server Schema","description":"This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"tenant":{"type":"string","description":"The pulsar tenant. If omitted, 'public' MUST be assumed."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"tenant":"contoso","bindingVersion":"0.1.0"}]},"http://asyncapi.com/definitions/3.0.0/channels.json":{"$id":"http://asyncapi.com/definitions/3.0.0/channels.json","type":"object","description":"An object containing all the Channel Object definitions the Application MUST use during runtime.","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/channel.json"}]},"examples":[{"userSignedUp":{"address":"user.signedup","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/3.0.0/channel.json":{"$id":"http://asyncapi.com/definitions/3.0.0/channel.json","type":"object","description":"Describes a shared communication channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"address":{"type":["string","null"],"description":"An optional string representation of this channel's address. The address is typically the \\"topic name\\", \\"routing key\\", \\"event type\\", or \\"path\\". When \`null\` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions."},"messages":{"$ref":"http://asyncapi.com/definitions/3.0.0/channelMessages.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/3.0.0/parameters.json"},"title":{"type":"string","description":"A human-friendly title for the channel."},"summary":{"type":"string","description":"A brief summary of the channel."},"description":{"type":"string","description":"A longer description of the channel. CommonMark is allowed."},"servers":{"type":"array","description":"The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","items":{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},"uniqueItems":true},"tags":{"type":"array","description":"A list of tags for logical grouping of channels.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"}]}},"examples":[{"address":"users.{userId}","title":"Users channel","description":"This channel is used to exchange messages about user events.","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"},"userCompletedOrder":{"$ref":"#/components/messages/userCompletedOrder"}},"parameters":{"userId":{"$ref":"#/components/parameters/userId"}},"servers":[{"$ref":"#/servers/rabbitmqInProd"},{"$ref":"#/servers/rabbitmqInStaging"}],"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}},"tags":[{"name":"user","description":"User-related messages"}],"externalDocs":{"description":"Find more info here","url":"https://example.com"}}]},"http://asyncapi.com/definitions/3.0.0/channelMessages.json":{"$id":"http://asyncapi.com/definitions/3.0.0/channelMessages.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageObject.json"}]},"description":"A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**"},"http://asyncapi.com/definitions/3.0.0/messageObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/messageObject.json","type":"object","description":"Describes a message received on a given channel and operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field."},"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/anySchema.json"},"payload":{"$ref":"http://asyncapi.com/definitions/3.0.0/anySchema.json"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/correlationId.json"}]},"tags":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"$ref":"http://asyncapi.com/definitions/3.0.0/messageExampleObject.json"}},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json"}]},"traits":{"type":"array","description":"A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageTrait.json"},{"type":"array","items":[{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageTrait.json"}]},{"type":"object","additionalItems":true}]}]}}},"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]}]},"http://asyncapi.com/definitions/3.0.0/anySchema.json":{"$id":"http://asyncapi.com/definitions/3.0.0/anySchema.json","if":{"required":["schema"]},"then":{"$ref":"http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json"},"else":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"description":"An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise."},"http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json":{"$id":"http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json","description":"The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).","type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"if":{"not":{"type":"object"}},"then":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"else":{"properties":{"schemaFormat":{"description":"A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.","anyOf":[{"type":"string"},{"description":"All the schema formats tooling MUST support","enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0"]},{"description":"All the schema formats tools are RECOMMENDED to support","enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/raml+yaml;version=1.0"]}]}},"allOf":[{"if":{"not":{"description":"If no schemaFormat has been defined, default to schema or reference","required":["schemaFormat"]}},"then":{"properties":{"schema":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}}}},{"if":{"description":"If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats","required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"schema":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json"}]}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json"}]}}}}]}},"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/definitions/3.0.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/3.0.0/correlationId.json","type":"object","description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","required":["location"],"additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed."},"location":{"type":"string","description":"A runtime expression that specifies the location of the correlation ID","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"http://asyncapi.com/definitions/3.0.0/messageExampleObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/messageExampleObject.json","type":"object","additionalProperties":false,"anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"name":{"type":"string","description":"Machine readable name of the message example."},"summary":{"type":"string","description":"A brief summary of the message example."},"headers":{"type":"object","description":"Example of the application headers. It MUST be a map of key-value pairs."},"payload":{"type":["number","string","boolean","object","array","null"],"description":"Example of the message payload. It can be of any type."}}},"http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json","type":"object","description":"Map describing protocol-specific definitions for a message.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"http":{"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/message.json"}}]},"ws":{},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/message.json"}}]},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/message.json"}}]},"anypointmq":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json"}}]},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/message.json"}}]},"sns":{},"sqs":{},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json"}}]},"solace":{},"googlepubsub":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json"}}]}}},"http://asyncapi.com/bindings/http/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/http/0.3.0/message.json","title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"statusCode":{"type":"number","description":"The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). \`statusCode\` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/http/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/http/0.2.0/message.json","title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/amqp/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/message.json","title":"AMQP message bindings object","description":"This object contains information about the message representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"contentEncoding":{"type":"string","description":"A MIME encoding for the message content."},"messageType":{"type":"string","description":"Application-specific message type."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"contentEncoding":"gzip","messageType":"user.signup","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/mqtt/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json","title":"MQTT message bindings object","description":"This object contains information about the message representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"payloadFormatIndicator":{"type":"integer","enum":[0,1],"description":"1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.","default":0},"correlationData":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received."},"contentType":{"type":"string","description":"String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object."},"responseTopic":{"oneOf":[{"type":"string","format":"uri-template","minLength":1},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"The topic (channel URI) to be used for a response message."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0"},{"contentType":"application/json","correlationData":{"type":"string","format":"uuid"},"responseTopic":"application/responses","bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/kafka/0.5.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.5.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.4.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.3.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json":{"$id":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json","title":"Anypoint MQ message bindings object","description":"This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"messageId":{"type":"string"}}},"bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/jms/0.0.1/message.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/message.json","title":"Message Schema","description":"This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","required":["JMSMessageID"],"properties":{"JMSMessageID":{"type":["string","null"],"description":"A unique message identifier. This may be set by your JMS Provider on your behalf."},"JMSTimestamp":{"type":"integer","description":"The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC."},"JMSDeliveryMode":{"type":"string","enum":["PERSISTENT","NON_PERSISTENT"],"default":"PERSISTENT","description":"Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf."},"JMSPriority":{"type":"integer","default":4,"description":"The priority of the message. This may be set by your JMS Provider on your behalf."},"JMSExpires":{"type":"integer","description":"The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire."},"JMSType":{"type":["string","null"],"description":"The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it."},"JMSCorrelationID":{"type":["string","null"],"description":"The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values."},"JMSReplyTo":{"type":"string","description":"The queue or topic that the message sender expects replies to."}}},"bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json","title":"IBM MQ message bindings object","description":"This object contains information about the message representation in IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"type":{"type":"string","enum":["string","jms","binary"],"default":"string","description":"The type of the message."},"headers":{"type":"string","description":"Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center."},"description":{"type":"string","description":"Provides additional information for application developers: describes the message type or format."},"expiry":{"type":"integer","minimum":0,"default":0,"description":"The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"type":{"const":"binary"}}},{"properties":{"type":{"const":"jms"}},"not":{"required":["headers"]}},{"properties":{"type":{"const":"string"}},"not":{"required":["headers"]}}],"examples":[{"type":"string","bindingVersion":"0.1.0"},{"type":"jms","description":"JMS stream message","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json","title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the message representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"attributes":{"type":"object"},"orderingKey":{"type":"string"},"schema":{"type":"object","additionalItems":false,"properties":{"name":{"type":"string"}},"required":["name"]}},"examples":[{"schema":{"name":"projects/your-project-id/schemas/your-avro-schema-id"}},{"schema":{"name":"projects/your-project-id/schemas/your-protobuf-schema-id"}}]},"http://asyncapi.com/definitions/3.0.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/3.0.0/messageTrait.json","type":"object","description":"Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"contentType":{"type":"string","description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field."},"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/anySchema.json"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/correlationId.json"}]},"tags":{"type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"summary":{"type":"string","description":"A brief summary of the message."},"name":{"type":"string","description":"Name of the message."},"title":{"type":"string","description":"A human-friendly title for the message."},"description":{"type":"string","description":"A longer description of the message. CommonMark is allowed."},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"deprecated":{"type":"boolean","default":false},"examples":{"type":"array","description":"List of examples.","items":{"$ref":"http://asyncapi.com/definitions/3.0.0/messageExampleObject.json"}},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json"}]}},"examples":[{"contentType":"application/json"}]},"http://asyncapi.com/definitions/3.0.0/parameters.json":{"$id":"http://asyncapi.com/definitions/3.0.0/parameters.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/parameter.json"}]},"description":"JSON objects describing re-usable channel parameters.","examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user."}}}]},"http://asyncapi.com/definitions/3.0.0/parameter.json":{"$id":"http://asyncapi.com/definitions/3.0.0/parameter.json","description":"Describes a parameter included in a channel address.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"description":{"type":"string","description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"examples":{"description":"An array of examples of the parameter value.","type":"array","items":{"type":"string"}},"location":{"type":"string","description":"A runtime expression that specifies the location of the parameter value","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user.","location":"$message.payload#/user/id"}}}]},"http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json","type":"object","description":"Map describing protocol-specific definitions for a channel.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"http":{},"ws":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json"}}]},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json"}}]},"amqp1":{},"mqtt":{},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/channel.json"}}]},"anypointmq":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json"}}]},"nats":{},"jms":{"properties":{"bindingVersion":{"enum":["0.0.1"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/channel.json"}}]},"sns":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json"}}]},"sqs":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json"}}]},"stomp":{},"redis":{},"ibmmq":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json"}}]},"solace":{},"googlepubsub":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json"}}]},"pulsar":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json"}}]}}},"http://asyncapi.com/bindings/websockets/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json","title":"WebSockets channel bindings object","description":"When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","POST"],"description":"The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'."},"query":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key."},"headers":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"method":"POST","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/amqp/0.3.0/channel.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json","title":"AMQP channel bindings object","description":"This object contains information about the channel representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"is":{"type":"string","enum":["queue","routingKey"],"description":"Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)."},"exchange":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the exchange. It MUST NOT exceed 255 characters long."},"type":{"type":"string","enum":["topic","direct","fanout","default","headers"],"description":"The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'."},"durable":{"type":"boolean","description":"Whether the exchange should survive broker restarts or not."},"autoDelete":{"type":"boolean","description":"Whether the exchange should be deleted when the last queue is unbound from it."},"vhost":{"type":"string","default":"/","description":"The virtual host of the exchange. Defaults to '/'."}},"description":"When is=routingKey, this object defines the exchange properties."},"queue":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the queue. It MUST NOT exceed 255 characters long."},"durable":{"type":"boolean","description":"Whether the queue should survive broker restarts or not."},"exclusive":{"type":"boolean","description":"Whether the queue should be used only by one connection or not."},"autoDelete":{"type":"boolean","description":"Whether the queue should be deleted when the last consumer unsubscribes."},"vhost":{"type":"string","default":"/","description":"The virtual host of the queue. Defaults to '/'."}},"description":"When is=queue, this object defines the queue properties."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"oneOf":[{"properties":{"is":{"const":"routingKey"}},"required":["exchange"],"not":{"required":["queue"]}},{"properties":{"is":{"const":"queue"}},"required":["queue"],"not":{"required":["exchange"]}}],"examples":[{"is":"routingKey","exchange":{"name":"myExchange","type":"topic","durable":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"},{"is":"queue","queue":{"name":"my-queue-name","durable":true,"exclusive":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/kafka/0.5.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":true,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0},"confluent.key.schema.validation":{"description":"It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)","type":"boolean"},"confluent.key.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)","type":"string"},"confluent.value.schema.validation":{"description":"It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)","type":"boolean"},"confluent.value.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)","type":"string"}}},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":false,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0}}},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json":{"$id":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json","title":"Anypoint MQ channel bindings object","description":"This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destination":{"type":"string","description":"The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name."},"destinationType":{"type":"string","enum":["exchange","queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signup-exchg","destinationType":"exchange","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/jms/0.0.1/channel.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/channel.json","title":"Channel Schema","description":"This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destination":{"type":"string","description":"The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name."},"destinationType":{"type":"string","enum":["queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signed-up","destinationType":"fifo-queue","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/sns/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/sns/0.1.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"name":{"type":"string","description":"The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations."},"ordering":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering"},"policy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the topic."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["name"],"definitions":{"ordering":{"type":"object","description":"By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"type":{"type":"string","description":"Defines the type of SNS Topic.","enum":["standard","FIFO"]},"contentBasedDeduplication":{"type":"boolean","description":"True to turn on de-duplication of messages for a channel."}},"required":["type"]},"policy":{"type":"object","description":"The security policy for the SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this topic","items":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SNS permission being allowed or denied e.g. sns:Publish","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"name":"my-sns-topic","policy":{"statements":[{"effect":"Allow","principal":"*","action":"SNS:Publish"}]}}]},"http://asyncapi.com/bindings/sqs/0.2.0/channel.json":{"$id":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queue":{"description":"A definition of the queue that will be used as the channel.","$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue"},"deadLetterQueue":{"description":"A definition of the queue that will be used for un-processable messages.","$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue"},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queue"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy"},"policy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name","fifoQueue"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queue":{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":15,"visibilityTimeout":60,"receiveMessageWaitTime":0,"messageRetentionPeriod":86400,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]},"tags":{"owner":"AsyncAPI.NET","platform":"AsyncAPIOrg"}},"deadLetterQueue":{"name":"myQueue_error","deliveryDelay":0,"visibilityTimeout":0,"receiveMessageWaitTime":0,"messageRetentionPeriod":604800}}]},"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json","title":"IBM MQ channel bindings object","description":"This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destinationType":{"type":"string","enum":["topic","queue"],"default":"topic","description":"Defines the type of AsyncAPI channel."},"queue":{"type":"object","description":"Defines the properties of a queue.","properties":{"objectName":{"type":"string","maxLength":48,"description":"Defines the name of the IBM MQ queue associated with the channel."},"isPartitioned":{"type":"boolean","default":false,"description":"Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center."},"exclusive":{"type":"boolean","default":false,"description":"Specifies if it is recommended to open the queue exclusively."}},"required":["objectName"]},"topic":{"type":"object","description":"Defines the properties of a topic.","properties":{"string":{"type":"string","maxLength":10240,"description":"The value of the IBM MQ topic string to be used."},"objectName":{"type":"string","maxLength":48,"description":"The name of the IBM MQ topic object."},"durablePermitted":{"type":"boolean","default":true,"description":"Defines if the subscription may be durable."},"lastMsgRetained":{"type":"boolean","default":false,"description":"Defines if the last message published will be made available to new subscriptions."}}},"maxMsgLength":{"type":"integer","minimum":0,"maximum":104857600,"description":"The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"destinationType":{"const":"topic"}},"not":{"required":["queue"]}},{"properties":{"destinationType":{"const":"queue"}},"required":["queue"],"not":{"required":["topic"]}}],"examples":[{"destinationType":"topic","topic":{"objectName":"myTopicName"},"bindingVersion":"0.1.0"},{"destinationType":"queue","queue":{"objectName":"myQueueName","exclusive":true},"bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json":{"$id":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json","title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the channel representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"labels":{"type":"object"},"messageRetentionDuration":{"type":"string"},"messageStoragePolicy":{"type":"object","additionalProperties":false,"properties":{"allowedPersistenceRegions":{"type":"array","items":{"type":"string"}}}},"schemaSettings":{"type":"object","additionalItems":false,"properties":{"encoding":{"type":"string"},"firstRevisionId":{"type":"string"},"lastRevisionId":{"type":"string"},"name":{"type":"string"}},"required":["encoding","name"]}},"required":["schemaSettings"],"examples":[{"labels":{"label1":"value1","label2":"value2"},"messageRetentionDuration":"86400s","messageStoragePolicy":{"allowedPersistenceRegions":["us-central1","us-east1"]},"schemaSettings":{"encoding":"json","name":"projects/your-project-id/schemas/your-schema"}}]},"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["namespace","persistence"],"properties":{"namespace":{"type":"string","description":"The namespace, the channel is associated with."},"persistence":{"type":"string","enum":["persistent","non-persistent"],"description":"persistence of the topic in Pulsar."},"compaction":{"type":"integer","minimum":0,"description":"Topic compaction threshold given in MB"},"geo-replication":{"type":"array","description":"A list of clusters the topic is replicated to.","items":{"type":"string"}},"retention":{"type":"object","additionalProperties":false,"properties":{"time":{"type":"integer","minimum":0,"description":"Time given in Minutes. \`0\` = Disable message retention."},"size":{"type":"integer","minimum":0,"description":"Size given in MegaBytes. \`0\` = Disable message retention."}}},"ttl":{"type":"integer","description":"TTL in seconds for the specified topic"},"deduplication":{"type":"boolean","description":"Whether deduplication of events is enabled or not."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"namespace":"ns1","persistence":"persistent","compaction":1000,"retention":{"time":15,"size":1000},"ttl":360,"geo-replication":["us-west","us-east"],"deduplication":true,"bindingVersion":"0.1.0"}]},"http://asyncapi.com/definitions/3.0.0/operations.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operations.json","type":"object","description":"Holds a dictionary with all the operations this application MUST implement.","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operation.json"}]},"examples":[{"onUserSignUp":{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}]}}]},"http://asyncapi.com/definitions/3.0.0/operation.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operation.json","type":"object","description":"Describes a specific operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["action","channel"],"properties":{"action":{"type":"string","description":"Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.","enum":["send","receive"]},"channel":{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},"messages":{"type":"array","description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","items":{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}},"reply":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationReply.json"}]},"traits":{"type":"array","description":"A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationTrait.json"}]}},"title":{"type":"string","description":"A human-friendly title for the operation."},"summary":{"type":"string","description":"A brief summary of the operation."},"description":{"type":"string","description":"A longer description of the operation. CommonMark is allowed."},"security":{"$ref":"http://asyncapi.com/definitions/3.0.0/securityRequirements.json"},"tags":{"type":"array","description":"A list of tags for logical grouping and categorization of operations.","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]},"uniqueItems":true},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"}]}},"examples":[{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","security":[{"petstore_auth":["write:pets","read:pets"]}],"tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}],"messages":[{"$ref":"/components/messages/userSignedUp"}],"reply":{"address":{"location":"$message.header#/replyTo"},"channel":{"$ref":"#/channels/userSignupReply"},"messages":[{"$ref":"/components/messages/userSignedUpReply"}]}}]},"http://asyncapi.com/definitions/3.0.0/operationReply.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operationReply.json","type":"object","description":"Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"address":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json"}]},"channel":{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},"messages":{"type":"array","description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","items":{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}}}},"http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json","type":"object","description":"An object that specifies where an operation has to send the reply","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["location"],"properties":{"location":{"type":"string","description":"A runtime expression that specifies the location of the reply address.","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"},"description":{"type":"string","description":"An optional description of the address. CommonMark is allowed."}},"examples":[{"description":"Consumer inbox","location":"$message.header#/replyTo"}]},"http://asyncapi.com/definitions/3.0.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operationTrait.json","type":"object","description":"Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"title":{"description":"A human-friendly title for the operation.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title"},"summary":{"description":"A short summary of what the operation is about.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary"},"description":{"description":"A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description"},"security":{"description":"A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags"},"externalDocs":{"description":"Additional external documentation for this operation.","$ref":"http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs"},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"}]}},"examples":[{"bindings":{"amqp":{"ack":false}}}]},"http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json","type":"object","description":"Map describing protocol-specific definitions for an operation.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"http":{"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/operation.json"}}]},"ws":{},"amqp":{"properties":{"bindingVersion":{"enum":["0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json"}}]},"amqp1":{},"mqtt":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json"}}]},"kafka":{"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/operation.json"}}]},"anypointmq":{},"nats":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/nats/0.1.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/nats/0.1.0/operation.json"}}]},"jms":{},"sns":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json"}}]},"sqs":{"properties":{"bindingVersion":{"enum":["0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json"}}]},"stomp":{},"redis":{},"ibmmq":{},"solace":{"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.2.0/operation.json"}}]},"googlepubsub":{}}},"http://asyncapi.com/bindings/http/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/http/0.3.0/operation.json","title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/http/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/http/0.2.0/operation.json","title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/amqp/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json","title":"AMQP operation bindings object","description":"This object contains information about the operation representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"expiration":{"type":"integer","minimum":0,"description":"TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero."},"userId":{"type":"string","description":"Identifies the user who has sent the message."},"cc":{"type":"array","items":{"type":"string"},"description":"The routing keys the message should be routed to at the time of publishing."},"priority":{"type":"integer","description":"A priority for the message."},"deliveryMode":{"type":"integer","enum":[1,2],"description":"Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)."},"mandatory":{"type":"boolean","description":"Whether the message is mandatory or not."},"bcc":{"type":"array","items":{"type":"string"},"description":"Like cc but consumers will not receive this information."},"timestamp":{"type":"boolean","description":"Whether the message should include a timestamp or not."},"ack":{"type":"boolean","description":"Whether the consumer should ack the message or not."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"expiration":100000,"userId":"guest","cc":["user.logs"],"priority":10,"deliveryMode":2,"mandatory":false,"bcc":["external.audit"],"timestamp":true,"ack":false,"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json","title":"MQTT operation bindings object","description":"This object contains information about the operation representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"qos":{"type":"integer","enum":[0,1,2],"description":"Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)."},"retain":{"type":"boolean","description":"Whether the broker should retain the message or not."},"messageExpiryInterval":{"oneOf":[{"type":"integer","minimum":0,"maximum":4294967295},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Lifetime of the message in seconds"},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"qos":2,"retain":true,"messageExpiryInterval":60,"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/kafka/0.5.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/nats/0.1.0/operation.json":{"$id":"http://asyncapi.com/bindings/nats/0.1.0/operation.json","title":"NATS operation bindings object","description":"This object contains information about the operation representation in NATS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queue":{"type":"string","description":"Defines the name of the queue to use. It MUST NOT exceed 255 characters.","maxLength":255},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"queue":"MyCustomQueue","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/sns/0.1.0/operation.json":{"$id":"http://asyncapi.com/bindings/sns/0.1.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier","description":"Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document."},"consumers":{"type":"array","description":"The protocols that listen to this topic and their endpoints.","items":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer"},"minItems":1},"deliveryPolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["consumers"],"definitions":{"identifier":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"url":{"type":"string","description":"The endpoint is a URL."},"email":{"type":"string","description":"The endpoint is an email address."},"phone":{"type":"string","description":"The endpoint is a phone number."},"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including."}}},"consumer":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"protocol":{"description":"The protocol that this endpoint receives messages by.","type":"string","enum":["http","https","email","email-json","sms","sqs","application","lambda","firehose"]},"endpoint":{"description":"The endpoint messages are delivered to.","$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier"},"filterPolicy":{"type":"object","description":"Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"},{"type":"object"}]}},"filterPolicyScope":{"type":"string","description":"Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.","enum":["MessageAttributes","MessageBody"],"default":"MessageAttributes"},"rawMessageDelivery":{"type":"boolean","description":"If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body."},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy"},"deliveryPolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic."},"displayName":{"type":"string","description":"The display name to use with an SNS subscription"}},"required":["protocol","endpoint","rawMessageDelivery"]},"deliveryPolicy":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"minDelayTarget":{"type":"integer","description":"The minimum delay for a retry in seconds."},"maxDelayTarget":{"type":"integer","description":"The maximum delay for a retry in seconds."},"numRetries":{"type":"integer","description":"The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries."},"numNoDelayRetries":{"type":"integer","description":"The number of immediate retries (with no delay)."},"numMinDelayRetries":{"type":"integer","description":"The number of immediate retries (with delay)."},"numMaxDelayRetries":{"type":"integer","description":"The number of post-backoff phase retries, with the maximum delay between retries."},"backoffFunction":{"type":"string","description":"The algorithm for backoff between retries.","enum":["arithmetic","exponential","geometric","linear"]},"maxReceivesPerSecond":{"type":"integer","description":"The maximum number of deliveries per second, per subscription."}}},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier","description":"The SQS queue to use as a dead letter queue (DLQ)."},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]}},"examples":[{"topic":{"name":"someTopic"},"consumers":[{"protocol":"sqs","endpoint":{"name":"someQueue"},"filterPolicy":{"store":["asyncapi_corp"],"event":[{"anything-but":"order_cancelled"}],"customer_interests":["rugby","football","baseball"]},"filterPolicyScope":"MessageAttributes","rawMessageDelivery":false,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":25},"deliveryPolicy":{"minDelayTarget":10,"maxDelayTarget":100,"numRetries":5,"numNoDelayRetries":2,"numMinDelayRetries":3,"numMaxDelayRetries":5,"backoffFunction":"linear","maxReceivesPerSecond":2}}]}]},"http://asyncapi.com/bindings/sqs/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queues":{"type":"array","description":"Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue"}},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queues"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"$ref":{"type":"string","description":"Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined."},"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy"},"policy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queues":[{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":10,"redrivePolicy":{"deadLetterQueue":{"name":"myQueue_error"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]}},{"name":"myQueue_error","deliveryDelay":10}]}]},"http://asyncapi.com/bindings/solace/0.4.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.4.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."},"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"timeToLive":{"type":"integer","description":"Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message."},"priority":{"type":"integer","minimum":0,"maximum":255,"description":"The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority."},"dmqEligible":{"type":"boolean","description":"Set the message to be eligible to be moved to a Dead Message Queue. The default value is false."}},"examples":[{"bindingVersion":"0.4.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/bindings/solace/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.3.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.3.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/bindings/solace/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.2.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/definitions/3.0.0/components.json":{"$id":"http://asyncapi.com/definitions/3.0.0/components.json","type":"object","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemas":{"type":"object","description":"An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/anySchema.json"}}},"servers":{"type":"object","description":"An object to hold reusable Server Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/server.json"}]}}},"channels":{"type":"object","description":"An object to hold reusable Channel Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/channel.json"}]}}},"serverVariables":{"type":"object","description":"An object to hold reusable Server Variable Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/serverVariable.json"}]}}},"operations":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operation.json"}]}}},"messages":{"type":"object","description":"An object to hold reusable Message Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageObject.json"}]}}},"securitySchemes":{"type":"object","description":"An object to hold reusable Security Scheme Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/SecurityScheme.json"}]}}},"parameters":{"type":"object","description":"An object to hold reusable Parameter Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/parameter.json"}]}}},"correlationIds":{"type":"object","description":"An object to hold reusable Correlation ID Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/correlationId.json"}]}}},"operationTraits":{"type":"object","description":"An object to hold reusable Operation Trait Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationTrait.json"}]}}},"messageTraits":{"type":"object","description":"An object to hold reusable Message Trait Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageTrait.json"}]}}},"replies":{"type":"object","description":"An object to hold reusable Operation Reply Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationReply.json"}]}}},"replyAddresses":{"type":"object","description":"An object to hold reusable Operation Reply Address Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json"}]}}},"serverBindings":{"type":"object","description":"An object to hold reusable Server Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"}]}}},"channelBindings":{"type":"object","description":"An object to hold reusable Channel Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"}]}}},"operationBindings":{"type":"object","description":"An object to hold reusable Operation Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"}]}}},"messageBindings":{"type":"object","description":"An object to hold reusable Message Bindings Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json"}]}}},"tags":{"type":"object","description":"An object to hold reusable Tag Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/tag.json"}]}}},"externalDocs":{"type":"object","description":"An object to hold reusable External Documentation Objects.","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]}}}},"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"AvroExample":{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","schema":{"$ref":"path/to/user-create.avsc#/UserCreate"}}},"servers":{"development":{"host":"{stage}.in.mycompany.com:{port}","description":"RabbitMQ broker","protocol":"amqp","protocolVersion":"0-9-1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`mycompany.com\`"},"port":{"enum":["5671","5672"],"default":"5672"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user."}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 88178: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 3.1.0 schema.","type":"object","required":["asyncapi","info"],"properties":{"id":{"description":"A unique id representing the application.","type":"string","format":"uri"},"asyncapi":{"description":"The AsyncAPI specification version of this document.","type":"string","const":"3.1.0"},"channels":{"$ref":"#/definitions/channels"},"components":{"$ref":"#/definitions/components"},"defaultContentType":{"description":"Default content type to use when encoding/decoding a message's payload.","type":"string"},"info":{"$ref":"#/definitions/info"},"operations":{"$ref":"#/definitions/operations"},"servers":{"$ref":"#/definitions/servers"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"definitions":{"channels":{"description":"An object containing all the Channel Object definitions the Application MUST use during runtime.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channel"}]},"examples":[{"userSignedUp":{"address":"user.signedup","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"}}}}]},"Reference":{"type":"object","description":"A simple object to allow referencing other components in the specification, internally and externally.","required":["$ref"],"properties":{"$ref":{"description":"The reference string.","$ref":"#/definitions/ReferenceObject"}},"examples":[{"$ref":"#/components/schemas/Pet"}]},"ReferenceObject":{"type":"string","format":"uri-reference"},"channel":{"description":"Describes a shared communication channel.","type":"object","properties":{"title":{"description":"A human-friendly title for the channel.","type":"string"},"description":{"description":"A longer description of the channel. CommonMark is allowed.","type":"string"},"address":{"description":"An optional string representation of this channel's address. The address is typically the \\"topic name\\", \\"routing key\\", \\"event type\\", or \\"path\\". When \`null\` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions.","type":["string","null"]},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channelBindingsObject"}]},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"messages":{"$ref":"#/definitions/channelMessages"},"parameters":{"$ref":"#/definitions/parameters"},"servers":{"description":"The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","type":"array","uniqueItems":true,"items":{"$ref":"#/definitions/Reference"}},"summary":{"description":"A brief summary of the channel.","type":"string"},"tags":{"description":"A list of tags for logical grouping of channels.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"address":"users.{userId}","title":"Users channel","description":"This channel is used to exchange messages about user events.","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"},"userCompletedOrder":{"$ref":"#/components/messages/userCompletedOrder"}},"parameters":{"userId":{"$ref":"#/components/parameters/userId"}},"servers":[{"$ref":"#/servers/rabbitmqInProd"},{"$ref":"#/servers/rabbitmqInStaging"}],"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}},"tags":[{"name":"user","description":"User-related messages"}],"externalDocs":{"description":"Find more info here","url":"https://example.com"}}]},"channelBindingsObject":{"description":"Map describing protocol-specific definitions for a channel.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-channel"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"googlepubsub":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"http":{},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-channel"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{},"nats":{},"pulsar":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"sns":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"solace":{},"sqs":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"stomp":{},"ws":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-websockets-0.1.0-channel"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-websockets-0.1.0-channel"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"bindings-amqp-0.3.0-channel":{"title":"AMQP channel bindings object","description":"This object contains information about the channel representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"is":{"type":"string","enum":["queue","routingKey"],"description":"Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)."},"exchange":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the exchange. It MUST NOT exceed 255 characters long."},"type":{"type":"string","enum":["topic","direct","fanout","default","headers"],"description":"The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'."},"durable":{"type":"boolean","description":"Whether the exchange should survive broker restarts or not."},"autoDelete":{"type":"boolean","description":"Whether the exchange should be deleted when the last queue is unbound from it."},"vhost":{"type":"string","default":"/","description":"The virtual host of the exchange. Defaults to '/'."}},"description":"When is=routingKey, this object defines the exchange properties."},"queue":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the queue. It MUST NOT exceed 255 characters long."},"durable":{"type":"boolean","description":"Whether the queue should survive broker restarts or not."},"exclusive":{"type":"boolean","description":"Whether the queue should be used only by one connection or not."},"autoDelete":{"type":"boolean","description":"Whether the queue should be deleted when the last consumer unsubscribes."},"vhost":{"type":"string","default":"/","description":"The virtual host of the queue. Defaults to '/'."}},"description":"When is=queue, this object defines the queue properties."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"oneOf":[{"properties":{"is":{"const":"routingKey"}},"required":["exchange"],"not":{"required":["queue"]}},{"properties":{"is":{"const":"queue"}},"required":["queue"],"not":{"required":["exchange"]}}],"examples":[{"is":"routingKey","exchange":{"name":"myExchange","type":"topic","durable":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"},{"is":"queue","queue":{"name":"my-queue-name","durable":true,"exclusive":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"}]},"specificationExtension":{"description":"Any property starting with x- is valid.","additionalItems":true,"additionalProperties":true},"bindings-anypointmq-0.0.1-channel":{"title":"Anypoint MQ channel bindings object","description":"This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destination":{"type":"string","description":"The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name."},"destinationType":{"type":"string","enum":["exchange","queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signup-exchg","destinationType":"exchange","bindingVersion":"0.0.1"}]},"bindings-googlepubsub-0.2.0-channel":{"title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the channel representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"labels":{"type":"object"},"messageRetentionDuration":{"type":"string"},"messageStoragePolicy":{"type":"object","additionalProperties":false,"properties":{"allowedPersistenceRegions":{"type":"array","items":{"type":"string"}}}},"schemaSettings":{"type":"object","additionalItems":false,"properties":{"encoding":{"type":"string"},"firstRevisionId":{"type":"string"},"lastRevisionId":{"type":"string"},"name":{"type":"string"}},"required":["encoding","name"]}},"required":["schemaSettings"],"examples":[{"labels":{"label1":"value1","label2":"value2"},"messageRetentionDuration":"86400s","messageStoragePolicy":{"allowedPersistenceRegions":["us-central1","us-east1"]},"schemaSettings":{"encoding":"json","name":"projects/your-project-id/schemas/your-schema"}}]},"bindings-ibmmq-0.1.0-channel":{"title":"IBM MQ channel bindings object","description":"This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destinationType":{"type":"string","enum":["topic","queue"],"default":"topic","description":"Defines the type of AsyncAPI channel."},"queue":{"type":"object","description":"Defines the properties of a queue.","properties":{"objectName":{"type":"string","maxLength":48,"description":"Defines the name of the IBM MQ queue associated with the channel."},"isPartitioned":{"type":"boolean","default":false,"description":"Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center."},"exclusive":{"type":"boolean","default":false,"description":"Specifies if it is recommended to open the queue exclusively."}},"required":["objectName"]},"topic":{"type":"object","description":"Defines the properties of a topic.","properties":{"string":{"type":"string","maxLength":10240,"description":"The value of the IBM MQ topic string to be used."},"objectName":{"type":"string","maxLength":48,"description":"The name of the IBM MQ topic object."},"durablePermitted":{"type":"boolean","default":true,"description":"Defines if the subscription may be durable."},"lastMsgRetained":{"type":"boolean","default":false,"description":"Defines if the last message published will be made available to new subscriptions."}}},"maxMsgLength":{"type":"integer","minimum":0,"maximum":104857600,"description":"The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"destinationType":{"const":"topic"}},"not":{"required":["queue"]}},{"properties":{"destinationType":{"const":"queue"}},"required":["queue"],"not":{"required":["topic"]}}],"examples":[{"destinationType":"topic","topic":{"objectName":"myTopicName"},"bindingVersion":"0.1.0"},{"destinationType":"queue","queue":{"objectName":"myQueueName","exclusive":true},"bindingVersion":"0.1.0"}]},"bindings-jms-0.0.1-channel":{"title":"Channel Schema","description":"This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"destination":{"type":"string","description":"The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name."},"destinationType":{"type":"string","enum":["queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signed-up","destinationType":"fifo-queue","bindingVersion":"0.0.1"}]},"bindings-kafka-0.5.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":true,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0},"confluent.key.schema.validation":{"description":"It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)","type":"boolean"},"confluent.key.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)","type":"string"},"confluent.value.schema.validation":{"description":"It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)","type":"boolean"},"confluent.value.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)","type":"string"}}},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":false,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0}}},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.3.0"}]},"bindings-pulsar-0.1.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["namespace","persistence"],"properties":{"namespace":{"type":"string","description":"The namespace, the channel is associated with."},"persistence":{"type":"string","enum":["persistent","non-persistent"],"description":"persistence of the topic in Pulsar."},"compaction":{"type":"integer","minimum":0,"description":"Topic compaction threshold given in MB"},"geo-replication":{"type":"array","description":"A list of clusters the topic is replicated to.","items":{"type":"string"}},"retention":{"type":"object","additionalProperties":false,"properties":{"time":{"type":"integer","minimum":0,"description":"Time given in Minutes. \`0\` = Disable message retention."},"size":{"type":"integer","minimum":0,"description":"Size given in MegaBytes. \`0\` = Disable message retention."}}},"ttl":{"type":"integer","description":"TTL in seconds for the specified topic"},"deduplication":{"type":"boolean","description":"Whether deduplication of events is enabled or not."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"namespace":"ns1","persistence":"persistent","compaction":1000,"retention":{"time":15,"size":1000},"ttl":360,"geo-replication":["us-west","us-east"],"deduplication":true,"bindingVersion":"0.1.0"}]},"bindings-sns-0.1.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"name":{"type":"string","description":"The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations."},"ordering":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/ordering"},"policy":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the topic."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["name"],"definitions":{"ordering":{"type":"object","description":"By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"type":{"type":"string","description":"Defines the type of SNS Topic.","enum":["standard","FIFO"]},"contentBasedDeduplication":{"type":"boolean","description":"True to turn on de-duplication of messages for a channel."}},"required":["type"]},"policy":{"type":"object","description":"The security policy for the SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this topic","items":{"$ref":"#/definitions/bindings-sns-0.1.0-channel/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SNS permission being allowed or denied e.g. sns:Publish","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"name":"my-sns-topic","policy":{"statements":[{"effect":"Allow","principal":"*","action":"SNS:Publish"}]}}]},"bindings-sqs-0.2.0-channel":{"title":"Channel Schema","description":"This object contains information about the channel representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queue":{"description":"A definition of the queue that will be used as the channel.","$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/queue"},"deadLetterQueue":{"description":"A definition of the queue that will be used for un-processable messages.","$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/queue"},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queue"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy"},"policy":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name","fifoQueue"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-channel/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queue":{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":15,"visibilityTimeout":60,"receiveMessageWaitTime":0,"messageRetentionPeriod":86400,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]},"tags":{"owner":"AsyncAPI.NET","platform":"AsyncAPIOrg"}},"deadLetterQueue":{"name":"myQueue_error","deliveryDelay":0,"visibilityTimeout":0,"receiveMessageWaitTime":0,"messageRetentionPeriod":604800}}]},"bindings-websockets-0.1.0-channel":{"title":"WebSockets channel bindings object","description":"When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","POST"],"description":"The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'."},"query":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key."},"headers":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"method":"POST","bindingVersion":"0.1.0"}]},"schema":{"description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.","allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"properties":{"deprecated":{"description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.","default":false,"type":"boolean"},"allOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}},"not":{"$ref":"#/definitions/schema"},"contains":{"$ref":"#/definitions/schema"},"items":{"default":{},"anyOf":[{"$ref":"#/definitions/schema"},{"type":"array","minItems":1,"items":{"$ref":"#/definitions/schema"}}]},"propertyNames":{"$ref":"#/definitions/schema"},"properties":{"default":{},"type":"object","additionalProperties":{"$ref":"#/definitions/schema"}},"patternProperties":{"default":{},"type":"object","additionalProperties":{"$ref":"#/definitions/schema"}},"additionalProperties":{"default":{},"anyOf":[{"$ref":"#/definitions/schema"},{"type":"boolean"}]},"discriminator":{"description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details.","type":"string"},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}}]},"json-schema-draft-07-schema":{"title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#/definitions/json-schema-draft-07-schema"},"items":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#/definitions/json-schema-draft-07-schema"},"maxProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"},"additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"definitions":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#/definitions/json-schema-draft-07-schema"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema"},{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/stringArray"}]}},"propertyNames":{"$ref":"#/definitions/json-schema-draft-07-schema"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#/definitions/json-schema-draft-07-schema"},"then":{"$ref":"#/definitions/json-schema-draft-07-schema"},"else":{"$ref":"#/definitions/json-schema-draft-07-schema"},"allOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/json-schema-draft-07-schema/definitions/schemaArray"},"not":{"$ref":"#/definitions/json-schema-draft-07-schema"}},"default":true},"externalDocs":{"description":"Allows referencing an external resource for extended documentation.","type":"object","required":["url"],"properties":{"description":{"description":"A short description of the target documentation. CommonMark syntax can be used for rich text representation.","type":"string"},"url":{"description":"The URL for the target documentation. This MUST be in the form of an absolute URL.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"description":"Find more info here","url":"https://example.com"}]},"channelMessages":{"description":"A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageObject"}]}},"messageObject":{"description":"Describes a message received on a given channel and operation.","type":"object","properties":{"title":{"description":"A human-friendly title for the message.","type":"string"},"description":{"description":"A longer description of the message. CommonMark is allowed.","type":"string"},"examples":{"description":"List of examples.","type":"array","items":{"$ref":"#/definitions/messageExampleObject"}},"deprecated":{"default":false,"type":"boolean"},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]},"contentType":{"description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.","type":"string"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"headers":{"$ref":"#/definitions/anySchema"},"name":{"description":"Name of the message.","type":"string"},"payload":{"$ref":"#/definitions/anySchema"},"summary":{"description":"A brief summary of the message.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}},"traits":{"description":"A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.","type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"},{"type":"array","items":[{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]},{"type":"object","additionalItems":true}]}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]}]},"messageExampleObject":{"type":"object","anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"headers":{"description":"Example of the application headers. It can be of any type.","type":"object"},"name":{"description":"Machine readable name of the message example.","type":"string"},"payload":{"description":"Example of the message payload. It can be of any type."},"summary":{"description":"A brief summary of the message example.","type":"string"}},"additionalProperties":false},"messageBindingsObject":{"description":"Map describing protocol-specific definitions for a message.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-message"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-anypointmq-0.0.1-message"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"googlepubsub":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-googlepubsub-0.2.0-message"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"http":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-message"}}],"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}}},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-message"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-message"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-message"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-message"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-message"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{},"redis":{},"sns":{},"solace":{},"sqs":{},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"bindings-amqp-0.3.0-message":{"title":"AMQP message bindings object","description":"This object contains information about the message representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"contentEncoding":{"type":"string","description":"A MIME encoding for the message content."},"messageType":{"type":"string","description":"Application-specific message type."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"contentEncoding":"gzip","messageType":"user.signup","bindingVersion":"0.3.0"}]},"bindings-anypointmq-0.0.1-message":{"title":"Anypoint MQ message bindings object","description":"This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"messageId":{"type":"string"}}},"bindingVersion":"0.0.1"}]},"bindings-googlepubsub-0.2.0-message":{"title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the message representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"attributes":{"type":"object"},"orderingKey":{"type":"string"},"schema":{"type":"object","additionalItems":false,"properties":{"name":{"type":"string"}},"required":["name"]}},"examples":[{"schema":{"name":"projects/your-project-id/schemas/your-avro-schema-id"}},{"schema":{"name":"projects/your-project-id/schemas/your-protobuf-schema-id"}}]},"bindings-http-0.3.0-message":{"title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"statusCode":{"type":"number","description":"The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). \`statusCode\` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.3.0"}]},"bindings-http-0.2.0-message":{"title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.2.0"}]},"bindings-ibmmq-0.1.0-message":{"title":"IBM MQ message bindings object","description":"This object contains information about the message representation in IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"type":{"type":"string","enum":["string","jms","binary"],"default":"string","description":"The type of the message."},"headers":{"type":"string","description":"Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center."},"description":{"type":"string","description":"Provides additional information for application developers: describes the message type or format."},"expiry":{"type":"integer","minimum":0,"default":0,"description":"The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"type":{"const":"binary"}}},{"properties":{"type":{"const":"jms"}},"not":{"required":["headers"]}},{"properties":{"type":{"const":"string"}},"not":{"required":["headers"]}}],"examples":[{"type":"string","bindingVersion":"0.1.0"},{"type":"jms","description":"JMS stream message","bindingVersion":"0.1.0"}]},"bindings-jms-0.0.1-message":{"title":"Message Schema","description":"This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"headers":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","required":["JMSMessageID"],"properties":{"JMSMessageID":{"type":["string","null"],"description":"A unique message identifier. This may be set by your JMS Provider on your behalf."},"JMSTimestamp":{"type":"integer","description":"The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC."},"JMSDeliveryMode":{"type":"string","enum":["PERSISTENT","NON_PERSISTENT"],"default":"PERSISTENT","description":"Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf."},"JMSPriority":{"type":"integer","default":4,"description":"The priority of the message. This may be set by your JMS Provider on your behalf."},"JMSExpires":{"type":"integer","description":"The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire."},"JMSType":{"type":["string","null"],"description":"The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it."},"JMSCorrelationID":{"type":["string","null"],"description":"The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values."},"JMSReplyTo":{"type":"string","description":"The queue or topic that the message sender expects replies to."}}},"bindingVersion":"0.0.1"}]},"bindings-kafka-0.5.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.5.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"anyOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/avroSchema_v1"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.4.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.4.0"}]},"avroSchema_v1":{"definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/avroSchema_v1/definitions/customTypeReference"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroRecord"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroEnum"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroArray"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroMap"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroFixed"},{"$ref":"#/definitions/avroSchema_v1/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/avroSchema_v1/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"type":{"$ref":"#/definitions/avroSchema_v1/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"items":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"values":{"$ref":"#/definitions/avroSchema_v1/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/avroSchema_v1/definitions/name"},"namespace":{"$ref":"#/definitions/avroSchema_v1/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/avroSchema_v1/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema_v1/definitions/avroSchema"}],"title":"Avro Schema Definition"},"bindings-kafka-0.3.0-message":{"title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"key":{"$ref":"#/definitions/schema","description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.3.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.3.0"}]},"bindings-mqtt-0.2.0-message":{"title":"MQTT message bindings object","description":"This object contains information about the message representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"payloadFormatIndicator":{"type":"integer","enum":[0,1],"description":"1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.","default":0},"correlationData":{"oneOf":[{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received."},"contentType":{"type":"string","description":"String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object."},"responseTopic":{"oneOf":[{"type":"string","format":"uri-template","minLength":1},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"The topic (channel URI) to be used for a response message."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0"},{"contentType":"application/json","correlationData":{"type":"string","format":"uuid"},"responseTopic":"application/responses","bindingVersion":"0.2.0"}]},"correlationId":{"description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","type":"object","required":["location"],"properties":{"description":{"description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed.","type":"string"},"location":{"description":"A runtime expression that specifies the location of the correlation ID","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"anySchema":{"description":"An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.","if":{"required":["schema"]},"then":{"$ref":"#/definitions/multiFormatSchema"},"else":{"$ref":"#/definitions/schema"}},"multiFormatSchema":{"description":"The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).","type":"object","if":{"not":{"type":"object"}},"then":{"$ref":"#/definitions/schema"},"else":{"allOf":[{"if":{"not":{"description":"If no schemaFormat has been defined, default to schema or reference","required":["schemaFormat"]}},"then":{"properties":{"schema":{"$ref":"#/definitions/schema"}}}},{"if":{"description":"If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats","required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0","application/vnd.aai.asyncapi;version=3.1.0","application/vnd.aai.asyncapi+json;version=3.1.0","application/vnd.aai.asyncapi+yaml;version=3.1.0"]}}},"then":{"properties":{"schema":{"$ref":"#/definitions/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"schema":{"$ref":"#/definitions/json-schema-draft-07-schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/openapiSchema_3_0"}]}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/avroSchema_v1"}]}}}}],"properties":{"schemaFormat":{"description":"A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.","anyOf":[{"type":"string"},{"description":"All the schema formats tooling MUST support","enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0","application/vnd.aai.asyncapi;version=3.1.0","application/vnd.aai.asyncapi+json;version=3.1.0","application/vnd.aai.asyncapi+yaml;version=3.1.0"]},{"description":"All the schema formats tools are RECOMMENDED to support","enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/raml+yaml;version=1.0"]}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"openapiSchema_3_0":{"type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#/definitions/openapiSchema_3_0"},{"$ref":"#/definitions/openapiSchema_3_0/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/openapiSchema_3_0/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/openapiSchema_3_0/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"tag":{"description":"Allows adding metadata to a single tag.","type":"object","required":["name"],"properties":{"description":{"description":"A short description for the tag. CommonMark syntax can be used for rich text representation.","type":"string"},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"name":{"description":"The name of the tag.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"name":"user","description":"User-related messages"}]},"messageTrait":{"description":"Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.","type":"object","properties":{"title":{"description":"A human-friendly title for the message.","type":"string"},"description":{"description":"A longer description of the message. CommonMark is allowed.","type":"string"},"examples":{"description":"List of examples.","type":"array","items":{"$ref":"#/definitions/messageExampleObject"}},"deprecated":{"default":false,"type":"boolean"},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]},"contentType":{"description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.","type":"string"},"correlationId":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"headers":{"$ref":"#/definitions/anySchema"},"name":{"description":"Name of the message.","type":"string"},"summary":{"description":"A brief summary of the message.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"contentType":"application/json"}]},"parameters":{"description":"JSON objects describing re-usable channel parameters.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]},"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user."}}}]},"parameter":{"description":"Describes a parameter included in a channel address.","properties":{"description":{"description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.","type":"string"},"examples":{"description":"An array of examples of the parameter value.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","items":{"type":"string"}},"location":{"description":"A runtime expression that specifies the location of the parameter value","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user.","location":"$message.payload#/user/id"}}}]},"components":{"description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","type":"object","properties":{"channelBindings":{"description":"An object to hold reusable Channel Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channelBindingsObject"}]}}},"channels":{"description":"An object to hold reusable Channel Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/channel"}]}}},"correlationIds":{"description":"An object to hold reusable Correlation ID Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/correlationId"}]}}},"externalDocs":{"description":"An object to hold reusable External Documentation Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]}}},"messageBindings":{"description":"An object to hold reusable Message Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageBindingsObject"}]}}},"messageTraits":{"description":"An object to hold reusable Message Trait Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageTrait"}]}}},"messages":{"description":"An object to hold reusable Message Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/messageObject"}]}}},"operationBindings":{"description":"An object to hold reusable Operation Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]}}},"operationTraits":{"description":"An object to hold reusable Operation Trait Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}}},"operations":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operation"}]}}},"parameters":{"description":"An object to hold reusable Parameter Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/parameter"}]}}},"replies":{"description":"An object to hold reusable Operation Reply Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReply"}]}}},"replyAddresses":{"description":"An object to hold reusable Operation Reply Address Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReplyAddress"}]}}},"schemas":{"description":"An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"$ref":"#/definitions/anySchema"}}},"securitySchemes":{"description":"An object to hold reusable Security Scheme Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}}},"serverBindings":{"description":"An object to hold reusable Server Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverBindingsObject"}]}}},"serverVariables":{"description":"An object to hold reusable Server Variable Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}}},"servers":{"description":"An object to hold reusable Server Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]}}},"tags":{"description":"An object to hold reusable Tag Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"AvroExample":{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","schema":{"$ref":"path/to/user-create.avsc#/UserCreate"}}},"servers":{"development":{"host":"{stage}.in.mycompany.com:{port}","description":"RabbitMQ broker","protocol":"amqp","protocolVersion":"0-9-1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`mycompany.com\`"},"port":{"enum":["5671","5672"],"default":"5672"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user."}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]},"operationBindingsObject":{"description":"Map describing protocol-specific definitions for an operation.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-amqp-0.3.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{},"googlepubsub":{},"http":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-http-0.3.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}}},"ibmmq":{},"jms":{},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-nats-0.1.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-nats-0.1.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"ros2":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ros2-0.1.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ros2-0.1.0-operation"}}]},"sns":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-sns-0.1.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"solace":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.3.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.2.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}}},"sqs":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"bindings-amqp-0.3.0-operation":{"title":"AMQP operation bindings object","description":"This object contains information about the operation representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"expiration":{"type":"integer","minimum":0,"description":"TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero."},"userId":{"type":"string","description":"Identifies the user who has sent the message."},"cc":{"type":"array","items":{"type":"string"},"description":"The routing keys the message should be routed to at the time of publishing."},"priority":{"type":"integer","description":"A priority for the message."},"deliveryMode":{"type":"integer","enum":[1,2],"description":"Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)."},"mandatory":{"type":"boolean","description":"Whether the message is mandatory or not."},"bcc":{"type":"array","items":{"type":"string"},"description":"Like cc but consumers will not receive this information."},"timestamp":{"type":"boolean","description":"Whether the message should include a timestamp or not."},"ack":{"type":"boolean","description":"Whether the consumer should ack the message or not."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"expiration":100000,"userId":"guest","cc":["user.logs"],"priority":10,"deliveryMode":2,"mandatory":false,"bcc":["external.audit"],"timestamp":true,"ack":false,"bindingVersion":"0.3.0"}]},"bindings-http-0.3.0-operation":{"title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"}]},"bindings-http-0.2.0-operation":{"title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"#/definitions/schema","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"}]},"bindings-kafka-0.5.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"$ref":"#/definitions/schema","description":"Id of the consumer group."},"clientId":{"$ref":"#/definitions/schema","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.3.0"}]},"bindings-mqtt-0.2.0-operation":{"title":"MQTT operation bindings object","description":"This object contains information about the operation representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"qos":{"type":"integer","enum":[0,1,2],"description":"Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)."},"retain":{"type":"boolean","description":"Whether the broker should retain the message or not."},"messageExpiryInterval":{"oneOf":[{"type":"integer","minimum":0,"maximum":4294967295},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Lifetime of the message in seconds"},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"qos":2,"retain":true,"messageExpiryInterval":60,"bindingVersion":"0.2.0"}]},"bindings-nats-0.1.0-operation":{"title":"NATS operation bindings object","description":"This object contains information about the operation representation in NATS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queue":{"type":"string","description":"Defines the name of the queue to use. It MUST NOT exceed 255 characters.","maxLength":255},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"queue":"MyCustomQueue","bindingVersion":"0.1.0"}]},"bindings-ros2-0.1.0-operation":{"description":"This object contains information about the operation representation in ROS 2.","examples":[{"node":"/turtlesim","qosPolicies":{"deadline":"-1","durability":"volatile","history":"unknown","leaseDuration":"-1","lifespan":"-1","liveliness":"automatic","reliability":"reliable"},"role":"subscriber"}],"type":"object","required":["role","node"],"properties":{"bindingVersion":{"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","type":"string","enum":["0.1.0"]},"node":{"description":"The name of the ROS 2 node that implements this operation.","type":"string"},"qosPolicies":{"type":"object","properties":{"deadline":{"description":"The expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite.","type":"integer"},"durability":{"description":"Persistence specification that determines message availability for late-joining subscribers","type":"string","enum":["transient_local","volatile"]},"history":{"description":"Policy parameter that defines the maximum number of samples maintained in the middleware queue","type":"string","enum":["keep_last","keep_all","unknown"]},"leaseDuration":{"description":"The maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite.","type":"integer"},"lifespan":{"description":"The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite.","type":"integer"},"liveliness":{"description":"Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network.","type":"string","enum":["automatic","manual"]},"reliability":{"description":"Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required.","type":"string","enum":["best_effort","realiable"]}}},"role":{"description":"Specifies the ROS 2 type of the node for this operation.","type":"string","enum":["publisher","action_client","service_client","subscriber","action_server","service_server"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"bindings-sns-0.1.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"topic":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier","description":"Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document."},"consumers":{"type":"array","description":"The protocols that listen to this topic and their endpoints.","items":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/consumer"},"minItems":1},"deliveryPolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["consumers"],"definitions":{"identifier":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"url":{"type":"string","description":"The endpoint is a URL."},"email":{"type":"string","description":"The endpoint is an email address."},"phone":{"type":"string","description":"The endpoint is a phone number."},"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including."}}},"consumer":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"protocol":{"description":"The protocol that this endpoint receives messages by.","type":"string","enum":["http","https","email","email-json","sms","sqs","application","lambda","firehose"]},"endpoint":{"description":"The endpoint messages are delivered to.","$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier"},"filterPolicy":{"type":"object","description":"Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"},{"type":"object"}]}},"filterPolicyScope":{"type":"string","description":"Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.","enum":["MessageAttributes","MessageBody"],"default":"MessageAttributes"},"rawMessageDelivery":{"type":"boolean","description":"If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body."},"redrivePolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy"},"deliveryPolicy":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic."},"displayName":{"type":"string","description":"The display name to use with an SNS subscription"}},"required":["protocol","endpoint","rawMessageDelivery"]},"deliveryPolicy":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"minDelayTarget":{"type":"integer","description":"The minimum delay for a retry in seconds."},"maxDelayTarget":{"type":"integer","description":"The maximum delay for a retry in seconds."},"numRetries":{"type":"integer","description":"The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries."},"numNoDelayRetries":{"type":"integer","description":"The number of immediate retries (with no delay)."},"numMinDelayRetries":{"type":"integer","description":"The number of immediate retries (with delay)."},"numMaxDelayRetries":{"type":"integer","description":"The number of post-backoff phase retries, with the maximum delay between retries."},"backoffFunction":{"type":"string","description":"The algorithm for backoff between retries.","enum":["arithmetic","exponential","geometric","linear"]},"maxReceivesPerSecond":{"type":"integer","description":"The maximum number of deliveries per second, per subscription."}}},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sns-0.1.0-operation/definitions/identifier","description":"The SQS queue to use as a dead letter queue (DLQ)."},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]}},"examples":[{"topic":{"name":"someTopic"},"consumers":[{"protocol":"sqs","endpoint":{"name":"someQueue"},"filterPolicy":{"store":["asyncapi_corp"],"event":[{"anything-but":"order_cancelled"}],"customer_interests":["rugby","football","baseball"]},"filterPolicyScope":"MessageAttributes","rawMessageDelivery":false,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":25},"deliveryPolicy":{"minDelayTarget":10,"maxDelayTarget":100,"numRetries":5,"numNoDelayRetries":2,"numMinDelayRetries":3,"numMaxDelayRetries":5,"backoffFunction":"linear","maxReceivesPerSecond":2}}]}]},"bindings-solace-0.4.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."},"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"timeToLive":{"type":"integer","description":"Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message."},"priority":{"type":"integer","minimum":0,"maximum":255,"description":"The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority."},"dmqEligible":{"type":"boolean","description":"Set the message to be eligible to be moved to a Dead Message Queue. The default value is false."}},"examples":[{"bindingVersion":"0.4.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"bindings-solace-0.3.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.3.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"bindings-solace-0.2.0-operation":{"title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"bindings-sqs-0.2.0-operation":{"title":"Operation Schema","description":"This object contains information about the operation representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"queues":{"type":"array","description":"Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/queue"}},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queues"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"$ref":{"type":"string","description":"Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined."},"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy"},"policy":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"deadLetterQueue":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"#/definitions/bindings-sqs-0.2.0-operation/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queues":[{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":10,"redrivePolicy":{"deadLetterQueue":{"name":"myQueue_error"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]}},{"name":"myQueue_error","deliveryDelay":10}]}]},"operationTrait":{"description":"Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.","type":"object","properties":{"title":{"description":"A human-friendly title for the operation.","$ref":"#/definitions/operation/properties/title"},"description":{"description":"A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.","$ref":"#/definitions/operation/properties/description"},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.","oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]},"externalDocs":{"description":"Additional external documentation for this operation.","$ref":"#/definitions/operation/properties/externalDocs"},"security":{"description":"A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.","$ref":"#/definitions/operation/properties/security"},"summary":{"description":"A short summary of what the operation is about.","$ref":"#/definitions/operation/properties/summary"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","$ref":"#/definitions/operation/properties/tags"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"bindings":{"amqp":{"ack":false}}}]},"operation":{"description":"Describes a specific operation.","type":"object","required":["action","channel"],"properties":{"title":{"description":"A human-friendly title for the operation.","type":"string"},"description":{"description":"A longer description of the operation. CommonMark is allowed.","type":"string"},"action":{"description":"Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.","type":"string","enum":["send","receive"]},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationBindingsObject"}]},"channel":{"$ref":"#/definitions/Reference"},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"messages":{"description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","type":"array","items":{"$ref":"#/definitions/Reference"}},"reply":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReply"}]},"security":{"$ref":"#/definitions/securityRequirements"},"summary":{"description":"A brief summary of the operation.","type":"string"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}},"traits":{"description":"A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.","type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationTrait"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","security":[{"petstore_auth":["write:pets","read:pets"]}],"tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}],"messages":[{"$ref":"/components/messages/userSignedUp"}],"reply":{"address":{"location":"$message.header#/replyTo"},"channel":{"$ref":"#/channels/userSignupReply"},"messages":[{"$ref":"/components/messages/userSignedUpReply"}]}}]},"securityRequirements":{"description":"An array representing security requirements.","type":"array","items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/SecurityScheme"}]}},"SecurityScheme":{"description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"#/definitions/userPassword"},{"$ref":"#/definitions/apiKey"},{"$ref":"#/definitions/X509"},{"$ref":"#/definitions/symmetricEncryption"},{"$ref":"#/definitions/asymmetricEncryption"},{"$ref":"#/definitions/HTTPSecurityScheme"},{"$ref":"#/definitions/oauth2Flows"},{"$ref":"#/definitions/openIdConnect"},{"$ref":"#/definitions/SaslSecurityScheme"}],"examples":[{"type":"userPassword"}]},"userPassword":{"type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["userPassword"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"apiKey":{"type":"object","required":["type","in"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme","type":"string","enum":["apiKey"]},"in":{"description":" The location of the API key.","type":"string","enum":["user","password"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"X509":{"type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["X509"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"symmetricEncryption":{"type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["symmetricEncryption"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"asymmetricEncryption":{"type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["asymmetricEncryption"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"HTTPSecurityScheme":{"oneOf":[{"$ref":"#/definitions/NonBearerHTTPSecurityScheme"},{"$ref":"#/definitions/BearerHTTPSecurityScheme"},{"$ref":"#/definitions/APIKeyHTTPSecurityScheme"}]},"NonBearerHTTPSecurityScheme":{"type":"object","not":{"type":"object","properties":{"scheme":{"description":"A short description for security scheme.","type":"string","enum":["bearer"]}}},"required":["scheme","type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["http"]},"scheme":{"description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"BearerHTTPSecurityScheme":{"type":"object","required":["type","scheme"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["http"]},"bearerFormat":{"description":"A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.","type":"string"},"scheme":{"description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","type":"string","enum":["bearer"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"APIKeyHTTPSecurityScheme":{"type":"object","required":["type","name","in"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["httpApiKey"]},"in":{"description":"The location of the API key","type":"string","enum":["header","query","cookie"]},"name":{"description":"The name of the header, query or cookie parameter to be used.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"oauth2Flows":{"description":"Allows configuration of the supported OAuth Flows.","type":"object","required":["type","flows"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["oauth2"]},"flows":{"type":"object","properties":{"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","tokenUrl","availableScopes"]}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["authorizationUrl","availableScopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"#/definitions/oauth2Flow"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]}},"additionalProperties":false},"scopes":{"description":"List of the needed scope names.","type":"array","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"oauth2Flow":{"description":"Configuration details for a supported OAuth Flow","type":"object","properties":{"authorizationUrl":{"description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"availableScopes":{"description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.","$ref":"#/definitions/oauth2Scopes"},"refreshUrl":{"description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"tokenUrl":{"description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","availableScopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}]},"oauth2Scopes":{"type":"object","additionalProperties":{"type":"string"}},"openIdConnect":{"type":"object","required":["type","openIdConnectUrl"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["openIdConnect"]},"openIdConnectUrl":{"description":"OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"scopes":{"description":"List of the needed scope names. An empty array means no scopes are needed.","type":"array","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"SaslSecurityScheme":{"oneOf":[{"$ref":"#/definitions/SaslPlainSecurityScheme"},{"$ref":"#/definitions/SaslScramSecurityScheme"},{"$ref":"#/definitions/SaslGssapiSecurityScheme"}]},"SaslPlainSecurityScheme":{"type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme. Valid values","type":"string","enum":["plain"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslScramSecurityScheme":{"type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["scramSha256","scramSha512"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"SaslGssapiSecurityScheme":{"type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["gssapi"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"operationReply":{"description":"Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.","type":"object","properties":{"address":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operationReplyAddress"}]},"channel":{"$ref":"#/definitions/Reference"},"messages":{"description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","type":"array","items":{"$ref":"#/definitions/Reference"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"operationReplyAddress":{"description":"An object that specifies where an operation has to send the reply","type":"object","required":["location"],"properties":{"description":{"description":"An optional description of the address. CommonMark is allowed.","type":"string"},"location":{"description":"A runtime expression that specifies the location of the reply address.","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"description":"Consumer inbox","location":"$message.header#/replyTo"}]},"serverBindingsObject":{"description":"Map describing protocol-specific definitions for a server.","type":"object","properties":{"amqp":{},"amqp1":{},"anypointmq":{},"googlepubsub":{},"http":{},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ibmmq-0.1.0-server"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"#/definitions/bindings-jms-0.0.1-server"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.5.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-kafka-0.3.0-server"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-mqtt-0.2.0-server"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{},"pulsar":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-pulsar-0.1.0-server"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"ros2":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-ros2-0.1.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"#/definitions/bindings-ros2-0.1.0-server"}}]},"sns":{},"solace":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.4.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.3.0-server"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"#/definitions/bindings-solace-0.2.0-server"}}],"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}}},"sqs":{},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},"bindings-ibmmq-0.1.0-server":{"title":"IBM MQ server bindings object","description":"This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"groupId":{"type":"string","description":"Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group."},"ccdtQueueManagerName":{"type":"string","default":"*","description":"The name of the IBM MQ queue manager to bind to in the CCDT file."},"cipherSpec":{"type":"string","description":"The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center."},"multiEndpointServer":{"type":"boolean","default":false,"description":"If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required."},"heartBeatInterval":{"type":"integer","minimum":0,"maximum":999999,"default":300,"description":"The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"examples":[{"groupId":"PRODCLSTR1","cipherSpec":"ANY_TLS12_OR_HIGHER","bindingVersion":"0.1.0"},{"groupId":"PRODCLSTR1","bindingVersion":"0.1.0"}]},"bindings-jms-0.0.1-server":{"title":"Server Schema","description":"This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"required":["jmsConnectionFactory"],"properties":{"jmsConnectionFactory":{"type":"string","description":"The classname of the ConnectionFactory implementation for the JMS Provider."},"properties":{"type":"array","items":{"$ref":"#/definitions/bindings-jms-0.0.1-server/definitions/property"},"description":"Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider."},"clientID":{"type":"string","description":"A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"definitions":{"property":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of a property"},"value":{"type":["string","boolean","number","null"],"description":"The name of a property"}}}},"examples":[{"jmsConnectionFactory":"org.apache.activemq.ActiveMQConnectionFactory","properties":[{"name":"disableTimeStampsByDefault","value":false}],"clientID":"my-application-1","bindingVersion":"0.0.1"}]},"bindings-kafka-0.5.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.5.0"}]},"bindings-kafka-0.4.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.4.0"}]},"bindings-kafka-0.3.0-server":{"title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.3.0"}]},"bindings-mqtt-0.2.0-server":{"title":"Server Schema","description":"This object contains information about the server representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"clientId":{"type":"string","description":"The client identifier."},"cleanSession":{"type":"boolean","description":"Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5."},"lastWill":{"type":"object","description":"Last Will and Testament configuration.","properties":{"topic":{"type":"string","description":"The topic where the Last Will and Testament message will be sent."},"qos":{"type":"integer","enum":[0,1,2],"description":"Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2."},"message":{"type":"string","description":"Last Will message."},"retain":{"type":"boolean","description":"Whether the broker should retain the Last Will and Testament message or not."}}},"keepAlive":{"type":"integer","description":"Interval in seconds of the longest period of time the broker and the client can endure without sending a message."},"sessionExpiryInterval":{"oneOf":[{"type":"integer","minimum":0},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires."},"maximumPacketSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":4294967295},{"$ref":"#/definitions/schema"},{"$ref":"#/definitions/Reference"}],"description":"Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"clientId":"guest","cleanSession":true,"lastWill":{"topic":"/last-wills","qos":2,"message":"Guest gone offline.","retain":false},"keepAlive":60,"sessionExpiryInterval":120,"maximumPacketSize":1024,"bindingVersion":"0.2.0"}]},"bindings-pulsar-0.1.0-server":{"title":"Server Schema","description":"This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"tenant":{"type":"string","description":"The pulsar tenant. If omitted, 'public' MUST be assumed."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"tenant":"contoso","bindingVersion":"0.1.0"}]},"bindings-ros2-0.1.0-server":{"description":"This object contains information about the server representation in ROS 2.","examples":[{"domainId":"0","rmwImplementation":"rmw_fastrtps_cpp"}],"type":"object","properties":{"bindingVersion":{"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","type":"string","enum":["0.1.0"]},"domainId":{"description":"All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID.","type":"integer","maximum":231,"minimum":0},"rmwImplementation":{"description":"Specifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}}},"bindings-solace-0.4.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"clientName":{"type":"string","minLength":1,"maxLength":160,"description":"A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.4.0"}]},"bindings-solace-0.3.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.3.0"}]},"bindings-solace-0.2.0-server":{"title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"properties":{"msvVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.2.0"}]},"serverVariable":{"description":"An object representing a Server Variable for server URL template substitution.","type":"object","properties":{"description":{"description":"An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.","type":"string"},"examples":{"description":"An array of examples of the server variable.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","uniqueItems":true,"items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/{env}","protocol":"amqp","description":"RabbitMQ broker. Use the \`env\` variable to point to either \`production\` or \`staging\`.","variables":{"env":{"description":"Environment to connect to. It can be either \`production\` or \`staging\`.","enum":["production","staging"]}}}]},"server":{"description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.","type":"object","required":["host","protocol"],"properties":{"title":{"description":"A human-friendly title for the server.","type":"string"},"description":{"description":"A longer description of the server. CommonMark is allowed.","type":"string"},"bindings":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverBindingsObject"}]},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"host":{"description":"The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.","type":"string"},"pathname":{"description":"The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.","type":"string"},"protocol":{"description":"The protocol this server supports for connection.","type":"string"},"protocolVersion":{"description":"An optional string describing the server. CommonMark syntax MAY be used for rich text representation.","type":"string"},"security":{"$ref":"#/definitions/securityRequirements"},"summary":{"description":"A brief summary of the server.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}},"variables":{"$ref":"#/definitions/serverVariables"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"host":"kafka.in.mycompany.com:9092","description":"Production Kafka broker.","protocol":"kafka","protocolVersion":"3.2"},{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/production","protocol":"amqp","description":"Production RabbitMQ broker (uses the \`production\` vhost)."}]},"serverVariables":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/serverVariable"}]}},"info":{"description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","allOf":[{"type":"object","required":["version","title"],"properties":{"title":{"description":"A unique and precise title of the API.","type":"string"},"description":{"description":"A longer description of the API. Should be different from the title. CommonMark is allowed.","type":"string"},"contact":{"$ref":"#/definitions/contact"},"externalDocs":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/externalDocs"}]},"license":{"$ref":"#/definitions/license"},"tags":{"description":"A list of tags for application API documentation control. Tags can be used for logical grouping of applications.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/tag"}]}},"termsOfService":{"description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","type":"string","format":"uri"},"version":{"description":"A semantic version number of the API.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false},{"$ref":"#/definitions/infoExtensions"}],"examples":[{"title":"AsyncAPI Sample App","version":"1.0.1","description":"This is a sample app.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.asyncapi.org/support","email":"support@asyncapi.org"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocs":{"description":"Find more info here","url":"https://www.asyncapi.org"},"tags":[{"name":"e-commerce"}]}]},"contact":{"description":"Contact information for the exposed API.","type":"object","properties":{"email":{"description":"The email address of the contact person/organization.","type":"string","format":"email"},"name":{"description":"The identifying name of the contact person/organization.","type":"string"},"url":{"description":"The URL pointing to the contact information.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"license":{"type":"object","required":["name"],"properties":{"name":{"description":"The name of the license type. It's encouraged to use an OSI compatible license.","type":"string"},"url":{"description":"The URL pointing to the license.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"#/definitions/specificationExtension"}},"additionalProperties":false,"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"infoExtensions":{"description":"The object that lists all the extensions of Info","type":"object","properties":{"x-linkedin":{"$ref":"#/definitions/extensions-linkedin-0.1.0-schema"},"x-x":{"$ref":"#/definitions/extensions-x-0.1.0-schema"}}},"extensions-linkedin-0.1.0-schema":{"type":"string","pattern":"^http(s)?://(www\\\\.)?linkedin\\\\.com.*$","description":"This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.","example":["https://www.linkedin.com/company/asyncapi/","https://www.linkedin.com/in/sambhavgupta0705/"]},"extensions-x-0.1.0-schema":{"type":"string","description":"This extension allows you to provide the Twitter username of the account representing the team/company of the API.","example":["sambhavgupta75","AsyncAPISpec"]},"operations":{"description":"Holds a dictionary with all the operations this application MUST implement.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/operation"}]},"examples":[{"onUserSignUp":{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}]}}]},"servers":{"description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"#/definitions/Reference"},{"$ref":"#/definitions/server"}]},"examples":[{"development":{"host":"localhost:5672","description":"Development AMQP broker.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests."}]},"staging":{"host":"rabbitmq-staging.in.mycompany.com:5672","description":"RabbitMQ broker for the staging environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment."}]},"production":{"host":"rabbitmq.in.mycompany.com:5672","description":"RabbitMQ broker for the production environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users."}]}}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 28243: (e11) => { + "use strict"; + e11.exports = JSON.parse(`{"$id":"http://asyncapi.com/definitions/3.1.0/asyncapi.json","$schema":"http://json-schema.org/draft-07/schema","title":"AsyncAPI 3.1.0 schema.","type":"object","required":["asyncapi","info"],"properties":{"id":{"description":"A unique id representing the application.","type":"string","format":"uri"},"asyncapi":{"description":"The AsyncAPI specification version of this document.","type":"string","const":"3.1.0"},"channels":{"$ref":"http://asyncapi.com/definitions/3.1.0/channels.json"},"components":{"$ref":"http://asyncapi.com/definitions/3.1.0/components.json"},"defaultContentType":{"description":"Default content type to use when encoding/decoding a message's payload.","type":"string"},"info":{"$ref":"http://asyncapi.com/definitions/3.1.0/info.json"},"operations":{"$ref":"http://asyncapi.com/definitions/3.1.0/operations.json"},"servers":{"$ref":"http://asyncapi.com/definitions/3.1.0/servers.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"definitions":{"http://asyncapi.com/definitions/3.1.0/channels.json":{"$id":"http://asyncapi.com/definitions/3.1.0/channels.json","description":"An object containing all the Channel Object definitions the Application MUST use during runtime.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/channel.json"}]},"examples":[{"userSignedUp":{"address":"user.signedup","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"}}}}]},"http://asyncapi.com/definitions/3.1.0/Reference.json":{"$id":"http://asyncapi.com/definitions/3.1.0/Reference.json","description":"A simple object to allow referencing other components in the specification, internally and externally.","type":"object","required":["$ref"],"properties":{"$ref":{"description":"The reference string.","$ref":"http://asyncapi.com/definitions/3.1.0/ReferenceObject.json"}},"examples":[{"$ref":"#/components/schemas/Pet"}]},"http://asyncapi.com/definitions/3.1.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/3.1.0/channel.json":{"$id":"http://asyncapi.com/definitions/3.1.0/channel.json","description":"Describes a shared communication channel.","type":"object","properties":{"title":{"description":"A human-friendly title for the channel.","type":"string"},"description":{"description":"A longer description of the channel. CommonMark is allowed.","type":"string"},"address":{"description":"An optional string representation of this channel's address. The address is typically the \\"topic name\\", \\"routing key\\", \\"event type\\", or \\"path\\". When \`null\` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions.","type":["string","null"]},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json"}]},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"messages":{"$ref":"http://asyncapi.com/definitions/3.1.0/channelMessages.json"},"parameters":{"$ref":"http://asyncapi.com/definitions/3.1.0/parameters.json"},"servers":{"description":"The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.","type":"array","uniqueItems":true,"items":{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"}},"summary":{"description":"A brief summary of the channel.","type":"string"},"tags":{"description":"A list of tags for logical grouping of channels.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"address":"users.{userId}","title":"Users channel","description":"This channel is used to exchange messages about user events.","messages":{"userSignedUp":{"$ref":"#/components/messages/userSignedUp"},"userCompletedOrder":{"$ref":"#/components/messages/userCompletedOrder"}},"parameters":{"userId":{"$ref":"#/components/parameters/userId"}},"servers":[{"$ref":"#/servers/rabbitmqInProd"},{"$ref":"#/servers/rabbitmqInStaging"}],"bindings":{"amqp":{"is":"queue","queue":{"exclusive":true}}},"tags":[{"name":"user","description":"User-related messages"}],"externalDocs":{"description":"Find more info here","url":"https://example.com"}}]},"http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json","description":"Map describing protocol-specific definitions for a channel.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"googlepubsub":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"http":{},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{},"nats":{},"pulsar":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"sns":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"solace":{},"sqs":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"stomp":{},"ws":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/bindings/amqp/0.3.0/channel.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/channel.json","title":"AMQP channel bindings object","description":"This object contains information about the channel representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"is":{"type":"string","enum":["queue","routingKey"],"description":"Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)."},"exchange":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the exchange. It MUST NOT exceed 255 characters long."},"type":{"type":"string","enum":["topic","direct","fanout","default","headers"],"description":"The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'."},"durable":{"type":"boolean","description":"Whether the exchange should survive broker restarts or not."},"autoDelete":{"type":"boolean","description":"Whether the exchange should be deleted when the last queue is unbound from it."},"vhost":{"type":"string","default":"/","description":"The virtual host of the exchange. Defaults to '/'."}},"description":"When is=routingKey, this object defines the exchange properties."},"queue":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The name of the queue. It MUST NOT exceed 255 characters long."},"durable":{"type":"boolean","description":"Whether the queue should survive broker restarts or not."},"exclusive":{"type":"boolean","description":"Whether the queue should be used only by one connection or not."},"autoDelete":{"type":"boolean","description":"Whether the queue should be deleted when the last consumer unsubscribes."},"vhost":{"type":"string","default":"/","description":"The virtual host of the queue. Defaults to '/'."}},"description":"When is=queue, this object defines the queue properties."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"oneOf":[{"properties":{"is":{"const":"routingKey"}},"required":["exchange"],"not":{"required":["queue"]}},{"properties":{"is":{"const":"queue"}},"required":["queue"],"not":{"required":["exchange"]}}],"examples":[{"is":"routingKey","exchange":{"name":"myExchange","type":"topic","durable":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"},{"is":"queue","queue":{"name":"my-queue-name","durable":true,"exclusive":true,"autoDelete":false,"vhost":"/"},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/definitions/3.0.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalProperties":true,"additionalItems":true},"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json":{"$id":"http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json","title":"Anypoint MQ channel bindings object","description":"This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destination":{"type":"string","description":"The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name."},"destinationType":{"type":"string","enum":["exchange","queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signup-exchg","destinationType":"exchange","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json":{"$id":"http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json","title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the channel representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"labels":{"type":"object"},"messageRetentionDuration":{"type":"string"},"messageStoragePolicy":{"type":"object","additionalProperties":false,"properties":{"allowedPersistenceRegions":{"type":"array","items":{"type":"string"}}}},"schemaSettings":{"type":"object","additionalItems":false,"properties":{"encoding":{"type":"string"},"firstRevisionId":{"type":"string"},"lastRevisionId":{"type":"string"},"name":{"type":"string"}},"required":["encoding","name"]}},"required":["schemaSettings"],"examples":[{"labels":{"label1":"value1","label2":"value2"},"messageRetentionDuration":"86400s","messageStoragePolicy":{"allowedPersistenceRegions":["us-central1","us-east1"]},"schemaSettings":{"encoding":"json","name":"projects/your-project-id/schemas/your-schema"}}]},"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json","title":"IBM MQ channel bindings object","description":"This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destinationType":{"type":"string","enum":["topic","queue"],"default":"topic","description":"Defines the type of AsyncAPI channel."},"queue":{"type":"object","description":"Defines the properties of a queue.","properties":{"objectName":{"type":"string","maxLength":48,"description":"Defines the name of the IBM MQ queue associated with the channel."},"isPartitioned":{"type":"boolean","default":false,"description":"Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center."},"exclusive":{"type":"boolean","default":false,"description":"Specifies if it is recommended to open the queue exclusively."}},"required":["objectName"]},"topic":{"type":"object","description":"Defines the properties of a topic.","properties":{"string":{"type":"string","maxLength":10240,"description":"The value of the IBM MQ topic string to be used."},"objectName":{"type":"string","maxLength":48,"description":"The name of the IBM MQ topic object."},"durablePermitted":{"type":"boolean","default":true,"description":"Defines if the subscription may be durable."},"lastMsgRetained":{"type":"boolean","default":false,"description":"Defines if the last message published will be made available to new subscriptions."}}},"maxMsgLength":{"type":"integer","minimum":0,"maximum":104857600,"description":"The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"destinationType":{"const":"topic"}},"not":{"required":["queue"]}},{"properties":{"destinationType":{"const":"queue"}},"required":["queue"],"not":{"required":["topic"]}}],"examples":[{"destinationType":"topic","topic":{"objectName":"myTopicName"},"bindingVersion":"0.1.0"},{"destinationType":"queue","queue":{"objectName":"myQueueName","exclusive":true},"bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/jms/0.0.1/channel.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/channel.json","title":"Channel Schema","description":"This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"destination":{"type":"string","description":"The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name."},"destinationType":{"type":"string","enum":["queue","fifo-queue"],"default":"queue","description":"The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"destination":"user-signed-up","destinationType":"fifo-queue","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/kafka/0.5.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":true,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0},"confluent.key.schema.validation":{"description":"It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)","type":"boolean"},"confluent.key.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)","type":"string"},"confluent.value.schema.validation":{"description":"It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)","type":"boolean"},"confluent.value.subject.name.strategy":{"description":"The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)","type":"string"}}},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"topicConfiguration":{"description":"Topic configuration properties that are relevant for the API.","type":"object","additionalProperties":false,"properties":{"cleanup.policy":{"description":"The [\`cleanup.policy\`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.","type":"array","items":{"type":"string","enum":["compact","delete"]}},"retention.ms":{"description":"The [\`retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.","type":"integer","minimum":-1},"retention.bytes":{"description":"The [\`retention.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.","type":"integer","minimum":-1},"delete.retention.ms":{"description":"The [\`delete.retention.ms\`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.","type":"integer","minimum":0},"max.message.bytes":{"description":"The [\`max.message.bytes\`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.","type":"integer","minimum":0}}},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/channel.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"type":"string","description":"Kafka topic name if different from channel name."},"partitions":{"type":"integer","minimum":1,"description":"Number of partitions configured on this topic."},"replicas":{"type":"integer","minimum":1,"description":"Number of replicas configured on this topic."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"topic":"my-specific-topic","partitions":20,"replicas":3,"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/pulsar/0.1.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["namespace","persistence"],"properties":{"namespace":{"type":"string","description":"The namespace, the channel is associated with."},"persistence":{"type":"string","enum":["persistent","non-persistent"],"description":"persistence of the topic in Pulsar."},"compaction":{"type":"integer","minimum":0,"description":"Topic compaction threshold given in MB"},"geo-replication":{"type":"array","description":"A list of clusters the topic is replicated to.","items":{"type":"string"}},"retention":{"type":"object","additionalProperties":false,"properties":{"time":{"type":"integer","minimum":0,"description":"Time given in Minutes. \`0\` = Disable message retention."},"size":{"type":"integer","minimum":0,"description":"Size given in MegaBytes. \`0\` = Disable message retention."}}},"ttl":{"type":"integer","description":"TTL in seconds for the specified topic"},"deduplication":{"type":"boolean","description":"Whether deduplication of events is enabled or not."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"namespace":"ns1","persistence":"persistent","compaction":1000,"retention":{"time":15,"size":1000},"ttl":360,"geo-replication":["us-west","us-east"],"deduplication":true,"bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/sns/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/sns/0.1.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"name":{"type":"string","description":"The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations."},"ordering":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering"},"policy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the topic."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["name"],"definitions":{"ordering":{"type":"object","description":"By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"type":{"type":"string","description":"Defines the type of SNS Topic.","enum":["standard","FIFO"]},"contentBasedDeduplication":{"type":"boolean","description":"True to turn on de-duplication of messages for a channel."}},"required":["type"]},"policy":{"type":"object","description":"The security policy for the SNS Topic.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this topic","items":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SNS permission being allowed or denied e.g. sns:Publish","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"name":"my-sns-topic","policy":{"statements":[{"effect":"Allow","principal":"*","action":"SNS:Publish"}]}}]},"http://asyncapi.com/bindings/sqs/0.2.0/channel.json":{"$id":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json","title":"Channel Schema","description":"This object contains information about the channel representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queue":{"description":"A definition of the queue that will be used as the channel.","$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue"},"deadLetterQueue":{"description":"A definition of the queue that will be used for un-processable messages.","$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue"},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queue"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy"},"policy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name","fifoQueue"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queue":{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":15,"visibilityTimeout":60,"receiveMessageWaitTime":0,"messageRetentionPeriod":86400,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]},"tags":{"owner":"AsyncAPI.NET","platform":"AsyncAPIOrg"}},"deadLetterQueue":{"name":"myQueue_error","deliveryDelay":0,"visibilityTimeout":0,"receiveMessageWaitTime":0,"messageRetentionPeriod":604800}}]},"http://asyncapi.com/bindings/websockets/0.1.0/channel.json":{"$id":"http://asyncapi.com/bindings/websockets/0.1.0/channel.json","title":"WebSockets channel bindings object","description":"When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","POST"],"description":"The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'."},"query":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key."},"headers":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"method":"POST","bindingVersion":"0.1.0"}]},"http://asyncapi.com/definitions/3.0.0/schema.json":{"$id":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"additionalProperties":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"type":"boolean"}],"default":{}},"items":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}}],"default":{}},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"properties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"default":{}},"propertyNames":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},"discriminator":{"type":"string","description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details."},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/externalDocs.json"}]},"deprecated":{"type":"boolean","description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.","default":false}}}]},"http://json-schema.org/draft-07/schema":{"$id":"http://json-schema.org/draft-07/schema","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true},"http://asyncapi.com/definitions/3.0.0/Reference.json":{"$id":"http://asyncapi.com/definitions/3.0.0/Reference.json","type":"object","description":"A simple object to allow referencing other components in the specification, internally and externally.","required":["$ref"],"properties":{"$ref":{"description":"The reference string.","$ref":"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json"}},"examples":[{"$ref":"#/components/schemas/Pet"}]},"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json":{"$id":"http://asyncapi.com/definitions/3.0.0/ReferenceObject.json","type":"string","format":"uri-reference"},"http://asyncapi.com/definitions/3.0.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/3.0.0/externalDocs.json","type":"object","additionalProperties":false,"description":"Allows referencing an external resource for extended documentation.","required":["url"],"properties":{"description":{"type":"string","description":"A short description of the target documentation. CommonMark syntax can be used for rich text representation."},"url":{"type":"string","description":"The URL for the target documentation. This MUST be in the form of an absolute URL.","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"examples":[{"description":"Find more info here","url":"https://example.com"}]},"http://asyncapi.com/definitions/3.1.0/specificationExtension.json":{"$id":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json","description":"Any property starting with x- is valid.","additionalItems":true,"additionalProperties":true},"http://asyncapi.com/definitions/3.1.0/externalDocs.json":{"$id":"http://asyncapi.com/definitions/3.1.0/externalDocs.json","description":"Allows referencing an external resource for extended documentation.","type":"object","required":["url"],"properties":{"description":{"description":"A short description of the target documentation. CommonMark syntax can be used for rich text representation.","type":"string"},"url":{"description":"The URL for the target documentation. This MUST be in the form of an absolute URL.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"description":"Find more info here","url":"https://example.com"}]},"http://asyncapi.com/definitions/3.1.0/channelMessages.json":{"$id":"http://asyncapi.com/definitions/3.1.0/channelMessages.json","description":"A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageObject.json"}]}},"http://asyncapi.com/definitions/3.1.0/messageObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/messageObject.json","description":"Describes a message received on a given channel and operation.","type":"object","properties":{"title":{"description":"A human-friendly title for the message.","type":"string"},"description":{"description":"A longer description of the message. CommonMark is allowed.","type":"string"},"examples":{"description":"List of examples.","type":"array","items":{"$ref":"http://asyncapi.com/definitions/3.1.0/messageExampleObject.json"}},"deprecated":{"default":false,"type":"boolean"},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json"}]},"contentType":{"description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.","type":"string"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/correlationId.json"}]},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"headers":{"$ref":"http://asyncapi.com/definitions/3.1.0/anySchema.json"},"name":{"description":"Name of the message.","type":"string"},"payload":{"$ref":"http://asyncapi.com/definitions/3.1.0/anySchema.json"},"summary":{"description":"A brief summary of the message.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}},"traits":{"description":"A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.","type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageTrait.json"},{"type":"array","items":[{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageTrait.json"}]},{"type":"object","additionalItems":true}]}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"messageId":"userSignup","name":"UserSignup","title":"User signup","summary":"Action to sign a user up.","description":"A longer description","contentType":"application/json","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"headers":{"type":"object","properties":{"correlationId":{"description":"Correlation ID set by application","type":"string"},"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}},"correlationId":{"description":"Default Correlation ID","location":"$message.header#/correlationId"},"traits":[{"$ref":"#/components/messageTraits/commonHeaders"}],"examples":[{"name":"SimpleSignup","summary":"A simple UserSignup example message","headers":{"correlationId":"my-correlation-id","applicationInstanceId":"myInstanceId"},"payload":{"user":{"someUserKey":"someUserValue"},"signup":{"someSignupKey":"someSignupValue"}}}]}]},"http://asyncapi.com/definitions/3.1.0/messageExampleObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/messageExampleObject.json","type":"object","anyOf":[{"required":["payload"]},{"required":["headers"]}],"properties":{"headers":{"description":"Example of the application headers. It can be of any type.","type":"object"},"name":{"description":"Machine readable name of the message example.","type":"string"},"payload":{"description":"Example of the message payload. It can be of any type."},"summary":{"description":"A brief summary of the message example.","type":"string"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json","description":"Map describing protocol-specific definitions for a message.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"googlepubsub":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"http":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}}},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/message.json"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{},"redis":{},"sns":{},"solace":{},"sqs":{},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/bindings/amqp/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/message.json","title":"AMQP message bindings object","description":"This object contains information about the message representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"contentEncoding":{"type":"string","description":"A MIME encoding for the message content."},"messageType":{"type":"string","description":"Application-specific message type."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"contentEncoding":"gzip","messageType":"user.signup","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json":{"$id":"http://asyncapi.com/bindings/anypointmq/0.0.1/message.json","title":"Anypoint MQ message bindings object","description":"This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"messageId":{"type":"string"}}},"bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json","title":"Cloud Pub/Sub Channel Schema","description":"This object contains information about the message representation for Google Cloud Pub/Sub.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."},"attributes":{"type":"object"},"orderingKey":{"type":"string"},"schema":{"type":"object","additionalItems":false,"properties":{"name":{"type":"string"}},"required":["name"]}},"examples":[{"schema":{"name":"projects/your-project-id/schemas/your-avro-schema-id"}},{"schema":{"name":"projects/your-project-id/schemas/your-protobuf-schema-id"}}]},"http://asyncapi.com/bindings/http/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/http/0.3.0/message.json","title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"statusCode":{"type":"number","description":"The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). \`statusCode\` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/http/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/http/0.2.0/message.json","title":"HTTP message bindings object","description":"This object contains information about the message representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"\\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"headers":{"type":"object","properties":{"Content-Type":{"type":"string","enum":["application/json"]}}},"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/message.json","title":"IBM MQ message bindings object","description":"This object contains information about the message representation in IBM MQ.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"type":{"type":"string","enum":["string","jms","binary"],"default":"string","description":"The type of the message."},"headers":{"type":"string","description":"Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center."},"description":{"type":"string","description":"Provides additional information for application developers: describes the message type or format."},"expiry":{"type":"integer","minimum":0,"default":0,"description":"The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"oneOf":[{"properties":{"type":{"const":"binary"}}},{"properties":{"type":{"const":"jms"}},"not":{"required":["headers"]}},{"properties":{"type":{"const":"string"}},"not":{"required":["headers"]}}],"examples":[{"type":"string","bindingVersion":"0.1.0"},{"type":"jms","description":"JMS stream message","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/jms/0.0.1/message.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/message.json","title":"Message Schema","description":"This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"headers":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"headers":{"type":"object","required":["JMSMessageID"],"properties":{"JMSMessageID":{"type":["string","null"],"description":"A unique message identifier. This may be set by your JMS Provider on your behalf."},"JMSTimestamp":{"type":"integer","description":"The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC."},"JMSDeliveryMode":{"type":"string","enum":["PERSISTENT","NON_PERSISTENT"],"default":"PERSISTENT","description":"Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf."},"JMSPriority":{"type":"integer","default":4,"description":"The priority of the message. This may be set by your JMS Provider on your behalf."},"JMSExpires":{"type":"integer","description":"The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire."},"JMSType":{"type":["string","null"],"description":"The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it."},"JMSCorrelationID":{"type":["string","null"],"description":"The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values."},"JMSReplyTo":{"type":"string","description":"The queue or topic that the message sender expects replies to."}}},"bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/kafka/0.5.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.5.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json"}],"description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.4.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.4.0"}]},"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json":{"$id":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json","definitions":{"avroSchema":{"title":"Avro Schema","description":"Root Schema","oneOf":[{"$ref":"#/definitions/types"}]},"types":{"title":"Avro Types","description":"Allowed Avro types","oneOf":[{"$ref":"#/definitions/primitiveType"},{"$ref":"#/definitions/primitiveTypeWithMetadata"},{"$ref":"#/definitions/customTypeReference"},{"$ref":"#/definitions/avroRecord"},{"$ref":"#/definitions/avroEnum"},{"$ref":"#/definitions/avroArray"},{"$ref":"#/definitions/avroMap"},{"$ref":"#/definitions/avroFixed"},{"$ref":"#/definitions/avroUnion"}]},"primitiveType":{"title":"Primitive Type","description":"Basic type primitives.","type":"string","enum":["null","boolean","int","long","float","double","bytes","string"]},"primitiveTypeWithMetadata":{"title":"Primitive Type With Metadata","description":"A primitive type with metadata attached.","type":"object","properties":{"type":{"$ref":"#/definitions/primitiveType"}},"required":["type"]},"customTypeReference":{"title":"Custom Type","description":"Reference to a ComplexType","not":{"$ref":"#/definitions/primitiveType"},"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*$"},"avroUnion":{"title":"Union","description":"A Union of types","type":"array","items":{"$ref":"#/definitions/avroSchema"},"minItems":1},"avroField":{"title":"Field","description":"A field within a Record","type":"object","properties":{"name":{"$ref":"#/definitions/name"},"type":{"$ref":"#/definitions/types"},"doc":{"type":"string"},"default":true,"order":{"enum":["ascending","descending","ignore"]},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["name","type"]},"avroRecord":{"title":"Record","description":"A Record","type":"object","properties":{"type":{"type":"string","const":"record"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"fields":{"type":"array","items":{"$ref":"#/definitions/avroField"}}},"required":["type","name","fields"]},"avroEnum":{"title":"Enum","description":"An enumeration","type":"object","properties":{"type":{"type":"string","const":"enum"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"symbols":{"type":"array","items":{"$ref":"#/definitions/name"}}},"required":["type","name","symbols"]},"avroArray":{"title":"Array","description":"An array","type":"object","properties":{"type":{"type":"string","const":"array"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"items":{"$ref":"#/definitions/types"}},"required":["type","items"]},"avroMap":{"title":"Map","description":"A map of values","type":"object","properties":{"type":{"type":"string","const":"map"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"values":{"$ref":"#/definitions/types"}},"required":["type","values"]},"avroFixed":{"title":"Fixed","description":"A fixed sized array of bytes","type":"object","properties":{"type":{"type":"string","const":"fixed"},"name":{"$ref":"#/definitions/name"},"namespace":{"$ref":"#/definitions/namespace"},"doc":{"type":"string"},"aliases":{"type":"array","items":{"$ref":"#/definitions/name"}},"size":{"type":"number"}},"required":["type","name","size"]},"name":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"namespace":{"type":"string","pattern":"^([A-Za-z_][A-Za-z0-9_]*(\\\\.[A-Za-z_][A-Za-z0-9_]*)*)*$"}},"description":"Json-Schema definition for Avro AVSC files.","oneOf":[{"$ref":"#/definitions/avroSchema"}],"title":"Avro Schema Definition"},"http://asyncapi.com/bindings/kafka/0.3.0/message.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/message.json","title":"Message Schema","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"key":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"The message key."},"schemaIdLocation":{"type":"string","description":"If a Schema Registry is used when performing this operation, tells where the id of schema is stored.","enum":["header","payload"]},"schemaIdPayloadEncoding":{"type":"string","description":"Number of bytes or vendor specific values when schema id is encoded in payload."},"schemaLookupStrategy":{"type":"string","description":"Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"key":{"type":"string","enum":["myKey"]},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"apicurio-new","schemaLookupStrategy":"TopicIdStrategy","bindingVersion":"0.3.0"},{"key":{"$ref":"path/to/user-create.avsc#/UserCreate"},"schemaIdLocation":"payload","schemaIdPayloadEncoding":"4","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/mqtt/0.2.0/message.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/message.json","title":"MQTT message bindings object","description":"This object contains information about the message representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"payloadFormatIndicator":{"type":"integer","enum":[0,1],"description":"1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.","default":0},"correlationData":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received."},"contentType":{"type":"string","description":"String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object."},"responseTopic":{"oneOf":[{"type":"string","format":"uri-template","minLength":1},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"The topic (channel URI) to be used for a response message."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0"},{"contentType":"application/json","correlationData":{"type":"string","format":"uuid"},"responseTopic":"application/responses","bindingVersion":"0.2.0"}]},"http://asyncapi.com/definitions/3.1.0/correlationId.json":{"$id":"http://asyncapi.com/definitions/3.1.0/correlationId.json","description":"An object that specifies an identifier at design time that can used for message tracing and correlation.","type":"object","required":["location"],"properties":{"description":{"description":"A optional description of the correlation ID. GitHub Flavored Markdown is allowed.","type":"string"},"location":{"description":"A runtime expression that specifies the location of the correlation ID","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"description":"Default Correlation ID","location":"$message.header#/correlationId"}]},"http://asyncapi.com/definitions/3.1.0/anySchema.json":{"$id":"http://asyncapi.com/definitions/3.1.0/anySchema.json","description":"An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.","if":{"required":["schema"]},"then":{"$ref":"http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json"},"else":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json":{"$id":"http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json","description":"The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).","type":"object","if":{"not":{"type":"object"}},"then":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},"else":{"allOf":[{"if":{"not":{"description":"If no schemaFormat has been defined, default to schema or reference","required":["schemaFormat"]}},"then":{"properties":{"schema":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}}}},{"if":{"description":"If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats","required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.aai.asyncapi;version=2.0.0","application/vnd.aai.asyncapi+json;version=2.0.0","application/vnd.aai.asyncapi+yaml;version=2.0.0","application/vnd.aai.asyncapi;version=2.1.0","application/vnd.aai.asyncapi+json;version=2.1.0","application/vnd.aai.asyncapi+yaml;version=2.1.0","application/vnd.aai.asyncapi;version=2.2.0","application/vnd.aai.asyncapi+json;version=2.2.0","application/vnd.aai.asyncapi+yaml;version=2.2.0","application/vnd.aai.asyncapi;version=2.3.0","application/vnd.aai.asyncapi+json;version=2.3.0","application/vnd.aai.asyncapi+yaml;version=2.3.0","application/vnd.aai.asyncapi;version=2.4.0","application/vnd.aai.asyncapi+json;version=2.4.0","application/vnd.aai.asyncapi+yaml;version=2.4.0","application/vnd.aai.asyncapi;version=2.5.0","application/vnd.aai.asyncapi+json;version=2.5.0","application/vnd.aai.asyncapi+yaml;version=2.5.0","application/vnd.aai.asyncapi;version=2.6.0","application/vnd.aai.asyncapi+json;version=2.6.0","application/vnd.aai.asyncapi+yaml;version=2.6.0","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0","application/vnd.aai.asyncapi;version=3.1.0","application/vnd.aai.asyncapi+json;version=3.1.0","application/vnd.aai.asyncapi+yaml;version=3.1.0"]}}},"then":{"properties":{"schema":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07"]}}},"then":{"properties":{"schema":{"$ref":"http://json-schema.org/draft-07/schema"}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json"}]}}}},{"if":{"required":["schemaFormat"],"properties":{"schemaFormat":{"enum":["application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0"]}}},"then":{"properties":{"schema":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json"}]}}}}],"properties":{"schemaFormat":{"description":"A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.","anyOf":[{"type":"string"},{"description":"All the schema formats tooling MUST support","enum":["application/schema+json;version=draft-07","application/schema+yaml;version=draft-07","application/vnd.aai.asyncapi;version=3.0.0","application/vnd.aai.asyncapi+json;version=3.0.0","application/vnd.aai.asyncapi+yaml;version=3.0.0","application/vnd.aai.asyncapi;version=3.1.0","application/vnd.aai.asyncapi+json;version=3.1.0","application/vnd.aai.asyncapi+yaml;version=3.1.0"]},{"description":"All the schema formats tools are RECOMMENDED to support","enum":["application/vnd.oai.openapi;version=3.0.0","application/vnd.oai.openapi+json;version=3.0.0","application/vnd.oai.openapi+yaml;version=3.0.0","application/vnd.apache.avro;version=1.9.0","application/vnd.apache.avro+json;version=1.9.0","application/vnd.apache.avro+yaml;version=1.9.0","application/raml+yaml;version=1.0"]}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/3.1.0/schema.json":{"$id":"http://asyncapi.com/definitions/3.1.0/schema.json","description":"The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.","allOf":[{"$ref":"http://json-schema.org/draft-07/schema#"},{"properties":{"deprecated":{"description":"Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.","default":false,"type":"boolean"},"allOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"anyOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"oneOf":{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"not":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},"contains":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},"items":{"default":{},"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},{"type":"array","minItems":1,"items":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}}]},"propertyNames":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},"properties":{"default":{},"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"patternProperties":{"default":{},"type":"object","additionalProperties":{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"}},"additionalProperties":{"default":{},"anyOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/schema.json"},{"type":"boolean"}]},"discriminator":{"description":"Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details.","type":"string"},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}}}]},"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json":{"$id":"http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json","type":"object","definitions":{"ExternalDocumentation":{"type":"object","required":["url"],"properties":{"description":{"type":"string"},"url":{"type":"string","format":"uri-reference"}},"patternProperties":{"^x-":{}},"additionalProperties":false},"Discriminator":{"type":"object","required":["propertyName"],"properties":{"propertyName":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}}}},"Reference":{"type":"object","required":["$ref"],"patternProperties":{"^\\\\$ref$":{"type":"string","format":"uri-reference"}}},"XML":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string","format":"uri"},"prefix":{"type":"string"},"attribute":{"type":"boolean","default":false},"wrapped":{"type":"boolean","default":false}},"patternProperties":{"^x-":{}},"additionalProperties":false}},"properties":{"title":{"type":"string"},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"type":"integer","minimum":0},"minLength":{"type":"integer","minimum":0,"default":0},"pattern":{"type":"string","format":"regex"},"maxItems":{"type":"integer","minimum":0},"minItems":{"type":"integer","minimum":0,"default":0},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"type":"integer","minimum":0},"minProperties":{"type":"integer","minimum":0,"default":0},"required":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true},"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":false},"type":{"type":"string","enum":["array","boolean","integer","number","object","string"]},"not":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"allOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"oneOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"anyOf":{"type":"array","items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"items":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]},"properties":{"type":"object","additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"}]}},"additionalProperties":{"oneOf":[{"$ref":"#"},{"$ref":"#/definitions/Reference"},{"type":"boolean"}],"default":true},"description":{"type":"string"},"format":{"type":"string"},"default":true,"nullable":{"type":"boolean","default":false},"discriminator":{"$ref":"#/definitions/Discriminator"},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"example":true,"externalDocs":{"$ref":"#/definitions/ExternalDocumentation"},"deprecated":{"type":"boolean","default":false},"xml":{"$ref":"#/definitions/XML"}},"patternProperties":{"^x-":true},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/tag.json":{"$id":"http://asyncapi.com/definitions/3.1.0/tag.json","description":"Allows adding metadata to a single tag.","type":"object","required":["name"],"properties":{"description":{"description":"A short description for the tag. CommonMark syntax can be used for rich text representation.","type":"string"},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"name":{"description":"The name of the tag.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"name":"user","description":"User-related messages"}]},"http://asyncapi.com/definitions/3.1.0/messageTrait.json":{"$id":"http://asyncapi.com/definitions/3.1.0/messageTrait.json","description":"Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.","type":"object","properties":{"title":{"description":"A human-friendly title for the message.","type":"string"},"description":{"description":"A longer description of the message. CommonMark is allowed.","type":"string"},"examples":{"description":"List of examples.","type":"array","items":{"$ref":"http://asyncapi.com/definitions/3.1.0/messageExampleObject.json"}},"deprecated":{"default":false,"type":"boolean"},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json"}]},"contentType":{"description":"The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.","type":"string"},"correlationId":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/correlationId.json"}]},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"headers":{"$ref":"http://asyncapi.com/definitions/3.1.0/anySchema.json"},"name":{"description":"Name of the message.","type":"string"},"summary":{"description":"A brief summary of the message.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"contentType":"application/json"}]},"http://asyncapi.com/definitions/3.1.0/parameters.json":{"$id":"http://asyncapi.com/definitions/3.1.0/parameters.json","description":"JSON objects describing re-usable channel parameters.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/parameter.json"}]},"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user."}}}]},"http://asyncapi.com/definitions/3.1.0/parameter.json":{"$id":"http://asyncapi.com/definitions/3.1.0/parameter.json","description":"Describes a parameter included in a channel address.","properties":{"description":{"description":"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.","type":"string"},"examples":{"description":"An array of examples of the parameter value.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","items":{"type":"string"}},"location":{"description":"A runtime expression that specifies the location of the parameter value","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"address":"user/{userId}/signedup","parameters":{"userId":{"description":"Id of the user.","location":"$message.payload#/user/id"}}}]},"http://asyncapi.com/definitions/3.1.0/components.json":{"$id":"http://asyncapi.com/definitions/3.1.0/components.json","description":"An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.","type":"object","properties":{"channelBindings":{"description":"An object to hold reusable Channel Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json"}]}}},"channels":{"description":"An object to hold reusable Channel Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/channel.json"}]}}},"correlationIds":{"description":"An object to hold reusable Correlation ID Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/correlationId.json"}]}}},"externalDocs":{"description":"An object to hold reusable External Documentation Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]}}},"messageBindings":{"description":"An object to hold reusable Message Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json"}]}}},"messageTraits":{"description":"An object to hold reusable Message Trait Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageTrait.json"}]}}},"messages":{"description":"An object to hold reusable Message Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/messageObject.json"}]}}},"operationBindings":{"description":"An object to hold reusable Operation Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json"}]}}},"operationTraits":{"description":"An object to hold reusable Operation Trait Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationTrait.json"}]}}},"operations":{"type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operation.json"}]}}},"parameters":{"description":"An object to hold reusable Parameter Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/parameter.json"}]}}},"replies":{"description":"An object to hold reusable Operation Reply Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationReply.json"}]}}},"replyAddresses":{"description":"An object to hold reusable Operation Reply Address Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json"}]}}},"schemas":{"description":"An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/anySchema.json"}}},"securitySchemes":{"description":"An object to hold reusable Security Scheme Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/SecurityScheme.json"}]}}},"serverBindings":{"description":"An object to hold reusable Server Bindings Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json"}]}}},"serverVariables":{"description":"An object to hold reusable Server Variable Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/serverVariable.json"}]}}},"servers":{"description":"An object to hold reusable Server Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/server.json"}]}}},"tags":{"description":"An object to hold reusable Tag Objects.","type":"object","patternProperties":{"^[\\\\w\\\\d\\\\.\\\\-_]+$":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"components":{"schemas":{"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}},"AvroExample":{"schemaFormat":"application/vnd.apache.avro+json;version=1.9.0","schema":{"$ref":"path/to/user-create.avsc#/UserCreate"}}},"servers":{"development":{"host":"{stage}.in.mycompany.com:{port}","description":"RabbitMQ broker","protocol":"amqp","protocolVersion":"0-9-1","variables":{"stage":{"$ref":"#/components/serverVariables/stage"},"port":{"$ref":"#/components/serverVariables/port"}}}},"serverVariables":{"stage":{"default":"demo","description":"This value is assigned by the service provider, in this example \`mycompany.com\`"},"port":{"enum":["5671","5672"],"default":"5672"}},"channels":{"user/signedup":{"subscribe":{"message":{"$ref":"#/components/messages/userSignUp"}}}},"messages":{"userSignUp":{"summary":"Action to sign a user up.","description":"Multiline description of what this action does.\\nHere you have another line.\\n","tags":[{"name":"user"},{"name":"signup"}],"headers":{"type":"object","properties":{"applicationInstanceId":{"description":"Unique identifier for a given instance of the publishing application","type":"string"}}},"payload":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/userCreate"},"signup":{"$ref":"#/components/schemas/signup"}}}}},"parameters":{"userId":{"description":"Id of the user."}},"correlationIds":{"default":{"description":"Default Correlation ID","location":"$message.header#/correlationId"}},"messageTraits":{"commonHeaders":{"headers":{"type":"object","properties":{"my-app-header":{"type":"integer","minimum":0,"maximum":100}}}}}}}]},"http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json","description":"Map describing protocol-specific definitions for an operation.","type":"object","properties":{"amqp":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.3.0"]}}},"amqp1":{},"anypointmq":{},"googlepubsub":{},"http":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/http/0.3.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0","0.3.0"]}}},"ibmmq":{},"jms":{},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/nats/0.1.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/nats/0.1.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"ros2":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ros2/0.1.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ros2/0.1.0/operation.json"}}]},"sns":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"solace":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.3.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.2.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}}},"sqs":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/bindings/amqp/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/amqp/0.3.0/operation.json","title":"AMQP operation bindings object","description":"This object contains information about the operation representation in AMQP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"expiration":{"type":"integer","minimum":0,"description":"TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero."},"userId":{"type":"string","description":"Identifies the user who has sent the message."},"cc":{"type":"array","items":{"type":"string"},"description":"The routing keys the message should be routed to at the time of publishing."},"priority":{"type":"integer","description":"A priority for the message."},"deliveryMode":{"type":"integer","enum":[1,2],"description":"Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)."},"mandatory":{"type":"boolean","description":"Whether the message is mandatory or not."},"bcc":{"type":"array","items":{"type":"string"},"description":"Like cc but consumers will not receive this information."},"timestamp":{"type":"boolean","description":"Whether the message should include a timestamp or not."},"ack":{"type":"boolean","description":"Whether the consumer should ack the message or not."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"expiration":100000,"userId":"guest","cc":["user.logs"],"priority":10,"deliveryMode":2,"mandatory":false,"bcc":["external.audit"],"timestamp":true,"ack":false,"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/http/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/http/0.3.0/operation.json","title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/http/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/http/0.2.0/operation.json","title":"HTTP operation bindings object","description":"This object contains information about the operation representation in HTTP.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"method":{"type":"string","enum":["GET","PUT","POST","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],"description":"When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'."},"query":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"},{"method":"GET","query":{"type":"object","required":["companyId"],"properties":{"companyId":{"type":"number","minimum":1,"description":"The Id of the company."}},"additionalProperties":false},"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/kafka/0.5.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in Kafka.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer group."},"clientId":{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json","description":"Id of the consumer inside a consumer group."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"groupId":{"type":"string","enum":["myGroupId"]},"clientId":{"type":"string","enum":["myClientId"]},"bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/operation.json","title":"MQTT operation bindings object","description":"This object contains information about the operation representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"qos":{"type":"integer","enum":[0,1,2],"description":"Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)."},"retain":{"type":"boolean","description":"Whether the broker should retain the message or not."},"messageExpiryInterval":{"oneOf":[{"type":"integer","minimum":0,"maximum":4294967295},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Lifetime of the message in seconds"},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"qos":2,"retain":true,"messageExpiryInterval":60,"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/nats/0.1.0/operation.json":{"$id":"http://asyncapi.com/bindings/nats/0.1.0/operation.json","title":"NATS operation bindings object","description":"This object contains information about the operation representation in NATS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queue":{"type":"string","description":"Defines the name of the queue to use. It MUST NOT exceed 255 characters.","maxLength":255},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"queue":"MyCustomQueue","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/ros2/0.1.0/operation.json":{"$id":"http://asyncapi.com/bindings/ros2/0.1.0/operation.json","description":"This object contains information about the operation representation in ROS 2.","examples":[{"node":"/turtlesim","qosPolicies":{"deadline":"-1","durability":"volatile","history":"unknown","leaseDuration":"-1","lifespan":"-1","liveliness":"automatic","reliability":"reliable"},"role":"subscriber"}],"type":"object","required":["role","node"],"properties":{"bindingVersion":{"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","type":"string","enum":["0.1.0"]},"node":{"description":"The name of the ROS 2 node that implements this operation.","type":"string"},"qosPolicies":{"type":"object","properties":{"deadline":{"description":"The expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite.","type":"integer"},"durability":{"description":"Persistence specification that determines message availability for late-joining subscribers","type":"string","enum":["transient_local","volatile"]},"history":{"description":"Policy parameter that defines the maximum number of samples maintained in the middleware queue","type":"string","enum":["keep_last","keep_all","unknown"]},"leaseDuration":{"description":"The maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite.","type":"integer"},"lifespan":{"description":"The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite.","type":"integer"},"liveliness":{"description":"Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network.","type":"string","enum":["automatic","manual"]},"reliability":{"description":"Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required.","type":"string","enum":["best_effort","realiable"]}}},"role":{"description":"Specifies the ROS 2 type of the node for this operation.","type":"string","enum":["publisher","action_client","service_client","subscriber","action_server","service_server"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/bindings/sns/0.1.0/operation.json":{"$id":"http://asyncapi.com/bindings/sns/0.1.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in SNS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"topic":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier","description":"Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document."},"consumers":{"type":"array","description":"The protocols that listen to this topic and their endpoints.","items":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer"},"minItems":1},"deliveryPolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer."},"bindingVersion":{"type":"string","description":"The version of this binding.","default":"latest"}},"required":["consumers"],"definitions":{"identifier":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"url":{"type":"string","description":"The endpoint is a URL."},"email":{"type":"string","description":"The endpoint is an email address."},"phone":{"type":"string","description":"The endpoint is a phone number."},"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including."}}},"consumer":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"protocol":{"description":"The protocol that this endpoint receives messages by.","type":"string","enum":["http","https","email","email-json","sms","sqs","application","lambda","firehose"]},"endpoint":{"description":"The endpoint messages are delivered to.","$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier"},"filterPolicy":{"type":"object","description":"Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"additionalProperties":{"oneOf":[{"type":"array","items":{"type":"string"}},{"type":"string"},{"type":"object"}]}},"filterPolicyScope":{"type":"string","description":"Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.","enum":["MessageAttributes","MessageBody"],"default":"MessageAttributes"},"rawMessageDelivery":{"type":"boolean","description":"If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body."},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy"},"deliveryPolicy":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy","description":"Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic."},"displayName":{"type":"string","description":"The display name to use with an SNS subscription"}},"required":["protocol","endpoint","rawMessageDelivery"]},"deliveryPolicy":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"minDelayTarget":{"type":"integer","description":"The minimum delay for a retry in seconds."},"maxDelayTarget":{"type":"integer","description":"The maximum delay for a retry in seconds."},"numRetries":{"type":"integer","description":"The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries."},"numNoDelayRetries":{"type":"integer","description":"The number of immediate retries (with no delay)."},"numMinDelayRetries":{"type":"integer","description":"The number of immediate retries (with delay)."},"numMaxDelayRetries":{"type":"integer","description":"The number of post-backoff phase retries, with the maximum delay between retries."},"backoffFunction":{"type":"string","description":"The algorithm for backoff between retries.","enum":["arithmetic","exponential","geometric","linear"]},"maxReceivesPerSecond":{"type":"integer","description":"The maximum number of deliveries per second, per subscription."}}},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier","description":"The SQS queue to use as a dead letter queue (DLQ)."},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]}},"examples":[{"topic":{"name":"someTopic"},"consumers":[{"protocol":"sqs","endpoint":{"name":"someQueue"},"filterPolicy":{"store":["asyncapi_corp"],"event":[{"anything-but":"order_cancelled"}],"customer_interests":["rugby","football","baseball"]},"filterPolicyScope":"MessageAttributes","rawMessageDelivery":false,"redrivePolicy":{"deadLetterQueue":{"arn":"arn:aws:SQS:eu-west-1:0000000:123456789"},"maxReceiveCount":25},"deliveryPolicy":{"minDelayTarget":10,"maxDelayTarget":100,"numRetries":5,"numNoDelayRetries":2,"numMinDelayRetries":3,"numMaxDelayRetries":5,"backoffFunction":"linear","maxReceivesPerSecond":2}}]}]},"http://asyncapi.com/bindings/solace/0.4.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.4.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."},"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"timeToLive":{"type":"integer","description":"Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message."},"priority":{"type":"integer","minimum":0,"maximum":255,"description":"The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority."},"dmqEligible":{"type":"boolean","description":"Set the message to be eligible to be moved to a Dead Message Queue. The default value is false."}},"examples":[{"bindingVersion":"0.4.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/bindings/solace/0.3.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.3.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]},"maxTtl":{"type":"string","description":"The maximum TTL to apply to messages to be spooled."},"maxMsgSpoolUsage":{"type":"string","description":"The maximum amount of message spool that the given queue may use"}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.3.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/bindings/solace/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/solace/0.2.0/operation.json","title":"Solace operation bindings object","description":"This object contains information about the operation representation in Solace.","type":"object","additionalProperties":false,"properties":{"destinations":{"description":"The list of Solace destinations referenced in the operation.","type":"array","items":{"type":"object","properties":{"deliveryMode":{"type":"string","enum":["direct","persistent"]}},"oneOf":[{"properties":{"destinationType":{"type":"string","const":"queue","description":"If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name."},"queue":{"type":"object","properties":{"name":{"type":"string","description":"The name of the queue"},"topicSubscriptions":{"type":"array","description":"The list of topics that the queue subscribes to.","items":{"type":"string"}},"accessType":{"type":"string","enum":["exclusive","nonexclusive"]}}}}},{"properties":{"destinationType":{"type":"string","const":"topic","description":"If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name."},"topicSubscriptions":{"type":"array","description":"The list of topics that the client subscribes to.","items":{"type":"string"}}}}]}},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, \\"latest\\" MUST be assumed."}},"examples":[{"bindingVersion":"0.2.0","destinations":[{"destinationType":"queue","queue":{"name":"sampleQueue","topicSubscriptions":["samples/*"],"accessType":"nonexclusive"}},{"destinationType":"topic","topicSubscriptions":["samples/*"]}]}]},"http://asyncapi.com/bindings/sqs/0.2.0/operation.json":{"$id":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json","title":"Operation Schema","description":"This object contains information about the operation representation in SQS.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"queues":{"type":"array","description":"Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue"}},"bindingVersion":{"type":"string","enum":["0.1.0","0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","default":"latest"}},"required":["queues"],"definitions":{"queue":{"type":"object","description":"A definition of a queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"$ref":{"type":"string","description":"Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined."},"name":{"type":"string","description":"The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field."},"fifoQueue":{"type":"boolean","description":"Is this a FIFO queue?","default":false},"deduplicationScope":{"type":"string","enum":["queue","messageGroup"],"description":"Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).","default":"queue"},"fifoThroughputLimit":{"type":"string","enum":["perQueue","perMessageGroupId"],"description":"Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.","default":"perQueue"},"deliveryDelay":{"type":"integer","description":"The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.","minimum":0,"maximum":900,"default":0},"visibilityTimeout":{"type":"integer","description":"The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.","minimum":0,"maximum":43200,"default":30},"receiveMessageWaitTime":{"type":"integer","description":"Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.","default":0},"messageRetentionPeriod":{"type":"integer","description":"How long to retain a message on the queue in seconds, unless deleted.","minimum":60,"maximum":1209600,"default":345600},"redrivePolicy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy"},"policy":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy"},"tags":{"type":"object","description":"Key-value pairs that represent AWS tags on the queue."}},"required":["name"]},"redrivePolicy":{"type":"object","description":"Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"deadLetterQueue":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier"},"maxReceiveCount":{"type":"integer","description":"The number of times a message is delivered to the source queue before being moved to the dead-letter queue.","default":10}},"required":["deadLetterQueue"]},"identifier":{"type":"object","description":"The SQS queue to use as a dead letter queue (DLQ).","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"arn":{"type":"string","description":"The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}"},"name":{"type":"string","description":"The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding."}}},"policy":{"type":"object","description":"The security policy for the SQS Queue","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"statements":{"type":"array","description":"An array of statement objects, each of which controls a permission for this queue.","items":{"$ref":"http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement"}}},"required":["statements"]},"statement":{"type":"object","patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"effect":{"type":"string","enum":["Allow","Deny"]},"principal":{"description":"The AWS account or resource ARN that this statement applies to.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"action":{"description":"The SQS permission being allowed or denied e.g. sqs:ReceiveMessage","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["effect","principal","action"]}},"examples":[{"queues":[{"name":"myQueue","fifoQueue":true,"deduplicationScope":"messageGroup","fifoThroughputLimit":"perMessageGroupId","deliveryDelay":10,"redrivePolicy":{"deadLetterQueue":{"name":"myQueue_error"},"maxReceiveCount":15},"policy":{"statements":[{"effect":"Deny","principal":"arn:aws:iam::123456789012:user/dec.kolakowski","action":["sqs:SendMessage","sqs:ReceiveMessage"]}]}},{"name":"myQueue_error","deliveryDelay":10}]}]},"http://asyncapi.com/definitions/3.1.0/operationTrait.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operationTrait.json","description":"Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.","type":"object","properties":{"title":{"description":"A human-friendly title for the operation.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/title"},"description":{"description":"A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/description"},"bindings":{"description":"A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json"}]},"externalDocs":{"description":"Additional external documentation for this operation.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/externalDocs"},"security":{"description":"A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/security"},"summary":{"description":"A short summary of what the operation is about.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/summary"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","$ref":"http://asyncapi.com/definitions/3.1.0/operation.json#/properties/tags"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"bindings":{"amqp":{"ack":false}}}]},"http://asyncapi.com/definitions/3.1.0/operation.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operation.json","description":"Describes a specific operation.","type":"object","required":["action","channel"],"properties":{"title":{"description":"A human-friendly title for the operation.","type":"string"},"description":{"description":"A longer description of the operation. CommonMark is allowed.","type":"string"},"action":{"description":"Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.","type":"string","enum":["send","receive"]},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json"}]},"channel":{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"messages":{"description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","type":"array","items":{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"}},"reply":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationReply.json"}]},"security":{"$ref":"http://asyncapi.com/definitions/3.1.0/securityRequirements.json"},"summary":{"description":"A brief summary of the operation.","type":"string"},"tags":{"description":"A list of tags for logical grouping and categorization of operations.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}},"traits":{"description":"A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.","type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationTrait.json"}]}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","security":[{"petstore_auth":["write:pets","read:pets"]}],"tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}],"messages":[{"$ref":"/components/messages/userSignedUp"}],"reply":{"address":{"location":"$message.header#/replyTo"},"channel":{"$ref":"#/channels/userSignupReply"},"messages":[{"$ref":"/components/messages/userSignedUpReply"}]}}]},"http://asyncapi.com/definitions/3.1.0/securityRequirements.json":{"$id":"http://asyncapi.com/definitions/3.1.0/securityRequirements.json","description":"An array representing security requirements.","type":"array","items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/SecurityScheme.json"}]}},"http://asyncapi.com/definitions/3.1.0/SecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/SecurityScheme.json","description":"Defines a security scheme that can be used by the operations.","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/userPassword.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/apiKey.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/X509.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Flows.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/openIdConnect.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json"}],"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/3.1.0/userPassword.json":{"$id":"http://asyncapi.com/definitions/3.1.0/userPassword.json","type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["userPassword"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"userPassword"}]},"http://asyncapi.com/definitions/3.1.0/apiKey.json":{"$id":"http://asyncapi.com/definitions/3.1.0/apiKey.json","type":"object","required":["type","in"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme","type":"string","enum":["apiKey"]},"in":{"description":" The location of the API key.","type":"string","enum":["user","password"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"apiKey","in":"user"}]},"http://asyncapi.com/definitions/3.1.0/X509.json":{"$id":"http://asyncapi.com/definitions/3.1.0/X509.json","type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["X509"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"X509"}]},"http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json","type":"object","required":["type"],"properties":{"description":{"type":"string"},"type":{"type":"string","enum":["symmetricEncryption"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"symmetricEncryption"}]},"http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json":{"$id":"http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json","type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["asymmetricEncryption"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json"}]},"http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json","type":"object","not":{"type":"object","properties":{"scheme":{"description":"A short description for security scheme.","type":"string","enum":["bearer"]}}},"required":["scheme","type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["http"]},"scheme":{"description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json","type":"object","required":["type","scheme"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["http"]},"bearerFormat":{"description":"A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.","type":"string"},"scheme":{"description":"The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.","type":"string","enum":["bearer"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json","type":"object","required":["type","name","in"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["httpApiKey"]},"in":{"description":"The location of the API key","type":"string","enum":["header","query","cookie"]},"name":{"description":"The name of the header, query or cookie parameter to be used.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"httpApiKey","name":"api_key","in":"header"}]},"http://asyncapi.com/definitions/3.1.0/oauth2Flows.json":{"$id":"http://asyncapi.com/definitions/3.1.0/oauth2Flows.json","description":"Allows configuration of the supported OAuth Flows.","type":"object","required":["type","flows"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["oauth2"]},"flows":{"type":"object","properties":{"authorizationCode":{"description":"Configuration for the OAuth Authorization Code flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json"},{"required":["authorizationUrl","tokenUrl","availableScopes"]}]},"clientCredentials":{"description":"Configuration for the OAuth Client Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]},"implicit":{"description":"Configuration for the OAuth Implicit flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json"},{"required":["authorizationUrl","availableScopes"]},{"not":{"required":["tokenUrl"]}}]},"password":{"description":"Configuration for the OAuth Resource Owner Protected Credentials flow.","allOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json"},{"required":["tokenUrl","availableScopes"]},{"not":{"required":["authorizationUrl"]}}]}},"additionalProperties":false},"scopes":{"description":"List of the needed scope names.","type":"array","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}}},"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json":{"$id":"http://asyncapi.com/definitions/3.1.0/oauth2Flow.json","description":"Configuration details for a supported OAuth Flow","type":"object","properties":{"authorizationUrl":{"description":"The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"availableScopes":{"description":"The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.","$ref":"http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json"},"refreshUrl":{"description":"The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"tokenUrl":{"description":"The token URL to be used for this flow. This MUST be in the form of an absolute URL.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"authorizationUrl":"https://example.com/api/oauth/dialog","tokenUrl":"https://example.com/api/oauth/token","availableScopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}}]},"http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json":{"$id":"http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json","type":"object","additionalProperties":{"type":"string"}},"http://asyncapi.com/definitions/3.1.0/openIdConnect.json":{"$id":"http://asyncapi.com/definitions/3.1.0/openIdConnect.json","type":"object","required":["type","openIdConnectUrl"],"properties":{"description":{"description":"A short description for security scheme. CommonMark syntax MAY be used for rich text representation.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["openIdConnect"]},"openIdConnectUrl":{"description":"OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.","type":"string","format":"uri"},"scopes":{"description":"List of the needed scope names. An empty array means no scopes are needed.","type":"array","items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json","oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json"}]},"http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json","type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme. Valid values","type":"string","enum":["plain"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json","type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["scramSha256","scramSha512"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json":{"$id":"http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json","type":"object","required":["type"],"properties":{"description":{"description":"A short description for security scheme.","type":"string"},"type":{"description":"The type of the security scheme.","type":"string","enum":["gssapi"]}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"type":"scramSha512"}]},"http://asyncapi.com/definitions/3.1.0/operationReply.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operationReply.json","description":"Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.","type":"object","properties":{"address":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json"}]},"channel":{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},"messages":{"description":"A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.","type":"array","items":{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json","description":"An object that specifies where an operation has to send the reply","type":"object","required":["location"],"properties":{"description":{"description":"An optional description of the address. CommonMark is allowed.","type":"string"},"location":{"description":"A runtime expression that specifies the location of the reply address.","type":"string","pattern":"^\\\\$message\\\\.(header|payload)#(\\\\/(([^\\\\/~])|(~[01]))*)*"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"description":"Consumer inbox","location":"$message.header#/replyTo"}]},"http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json":{"$id":"http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json","description":"Map describing protocol-specific definitions for a server.","type":"object","properties":{"amqp":{},"amqp1":{},"anypointmq":{},"googlepubsub":{},"http":{},"ibmmq":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"jms":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.0.1"}}},"then":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json"}}],"properties":{"bindingVersion":{"enum":["0.0.1"]}}},"kafka":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.5.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.5.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/kafka/0.3.0/server.json"}}],"properties":{"bindingVersion":{"enum":["0.5.0","0.4.0","0.3.0"]}}},"mqtt":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json"}}],"properties":{"bindingVersion":{"enum":["0.2.0"]}}},"nats":{},"pulsar":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json"}}],"properties":{"bindingVersion":{"enum":["0.1.0"]}}},"redis":{},"ros2":{"properties":{"bindingVersion":{"enum":["0.1.0"]}},"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/ros2/0.1.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.1.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/ros2/0.1.0/server.json"}}]},"sns":{},"solace":{"allOf":[{"description":"If no bindingVersion specified, use the latest binding","if":{"not":{"required":["bindingVersion"]}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.4.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.4.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.3.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.3.0/server.json"}},{"if":{"required":["bindingVersion"],"properties":{"bindingVersion":{"const":"0.2.0"}}},"then":{"$ref":"http://asyncapi.com/bindings/solace/0.2.0/server.json"}}],"properties":{"bindingVersion":{"enum":["0.4.0","0.3.0","0.2.0"]}}},"sqs":{},"stomp":{},"ws":{}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json":{"$id":"http://asyncapi.com/bindings/ibmmq/0.1.0/server.json","title":"IBM MQ server bindings object","description":"This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"groupId":{"type":"string","description":"Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group."},"ccdtQueueManagerName":{"type":"string","default":"*","description":"The name of the IBM MQ queue manager to bind to in the CCDT file."},"cipherSpec":{"type":"string","description":"The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center."},"multiEndpointServer":{"type":"boolean","default":false,"description":"If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required."},"heartBeatInterval":{"type":"integer","minimum":0,"maximum":999999,"default":300,"description":"The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding."}},"examples":[{"groupId":"PRODCLSTR1","cipherSpec":"ANY_TLS12_OR_HIGHER","bindingVersion":"0.1.0"},{"groupId":"PRODCLSTR1","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/jms/0.0.1/server.json":{"$id":"http://asyncapi.com/bindings/jms/0.0.1/server.json","title":"Server Schema","description":"This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"required":["jmsConnectionFactory"],"properties":{"jmsConnectionFactory":{"type":"string","description":"The classname of the ConnectionFactory implementation for the JMS Provider."},"properties":{"type":"array","items":{"$ref":"http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property"},"description":"Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider."},"clientID":{"type":"string","description":"A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory."},"bindingVersion":{"type":"string","enum":["0.0.1"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"definitions":{"property":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","description":"The name of a property"},"value":{"type":["string","boolean","number","null"],"description":"The name of a property"}}}},"examples":[{"jmsConnectionFactory":"org.apache.activemq.ActiveMQConnectionFactory","properties":[{"name":"disableTimeStampsByDefault","value":false}],"clientID":"my-application-1","bindingVersion":"0.0.1"}]},"http://asyncapi.com/bindings/kafka/0.5.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.5.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.5.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.5.0"}]},"http://asyncapi.com/bindings/kafka/0.4.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.4.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/kafka/0.3.0/server.json":{"$id":"http://asyncapi.com/bindings/kafka/0.3.0/server.json","title":"Server Schema","description":"This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"schemaRegistryUrl":{"type":"string","description":"API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."},"schemaRegistryVendor":{"type":"string","description":"The vendor of the Schema Registry and Kafka serdes library that should be used."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"schemaRegistryUrl":"https://my-schema-registry.com","schemaRegistryVendor":"confluent","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/mqtt/0.2.0/server.json":{"$id":"http://asyncapi.com/bindings/mqtt/0.2.0/server.json","title":"Server Schema","description":"This object contains information about the server representation in MQTT.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"clientId":{"type":"string","description":"The client identifier."},"cleanSession":{"type":"boolean","description":"Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5."},"lastWill":{"type":"object","description":"Last Will and Testament configuration.","properties":{"topic":{"type":"string","description":"The topic where the Last Will and Testament message will be sent."},"qos":{"type":"integer","enum":[0,1,2],"description":"Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2."},"message":{"type":"string","description":"Last Will message."},"retain":{"type":"boolean","description":"Whether the broker should retain the Last Will and Testament message or not."}}},"keepAlive":{"type":"integer","description":"Interval in seconds of the longest period of time the broker and the client can endure without sending a message."},"sessionExpiryInterval":{"oneOf":[{"type":"integer","minimum":0},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires."},"maximumPacketSize":{"oneOf":[{"type":"integer","minimum":1,"maximum":4294967295},{"$ref":"http://asyncapi.com/definitions/3.0.0/schema.json"},{"$ref":"http://asyncapi.com/definitions/3.0.0/Reference.json"}],"description":"Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"clientId":"guest","cleanSession":true,"lastWill":{"topic":"/last-wills","qos":2,"message":"Guest gone offline.","retain":false},"keepAlive":60,"sessionExpiryInterval":120,"maximumPacketSize":1024,"bindingVersion":"0.2.0"}]},"http://asyncapi.com/bindings/pulsar/0.1.0/server.json":{"$id":"http://asyncapi.com/bindings/pulsar/0.1.0/server.json","title":"Server Schema","description":"This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"tenant":{"type":"string","description":"The pulsar tenant. If omitted, 'public' MUST be assumed."},"bindingVersion":{"type":"string","enum":["0.1.0"],"description":"The version of this binding. If omitted, 'latest' MUST be assumed."}},"examples":[{"tenant":"contoso","bindingVersion":"0.1.0"}]},"http://asyncapi.com/bindings/ros2/0.1.0/server.json":{"$id":"http://asyncapi.com/bindings/ros2/0.1.0/server.json","description":"This object contains information about the server representation in ROS 2.","examples":[{"domainId":"0","rmwImplementation":"rmw_fastrtps_cpp"}],"type":"object","properties":{"bindingVersion":{"description":"The version of this binding. If omitted, 'latest' MUST be assumed.","type":"string","enum":["0.1.0"]},"domainId":{"description":"All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID.","type":"integer","maximum":231,"minimum":0},"rmwImplementation":{"description":"Specifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}}},"http://asyncapi.com/bindings/solace/0.4.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.4.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"clientName":{"type":"string","minLength":1,"maxLength":160,"description":"A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8."},"bindingVersion":{"type":"string","enum":["0.4.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.4.0"}]},"http://asyncapi.com/bindings/solace/0.3.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.3.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msgVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.3.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.3.0"}]},"http://asyncapi.com/bindings/solace/0.2.0/server.json":{"$id":"http://asyncapi.com/bindings/solace/0.2.0/server.json","title":"Solace server bindings object","description":"This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.","type":"object","additionalProperties":false,"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.0.0/specificationExtension.json"}},"properties":{"msvVpn":{"type":"string","description":"The name of the Virtual Private Network to connect to on the Solace broker."},"bindingVersion":{"type":"string","enum":["0.2.0"],"description":"The version of this binding."}},"examples":[{"msgVpn":"ProdVPN","bindingVersion":"0.2.0"}]},"http://asyncapi.com/definitions/3.1.0/serverVariable.json":{"$id":"http://asyncapi.com/definitions/3.1.0/serverVariable.json","description":"An object representing a Server Variable for server URL template substitution.","type":"object","properties":{"description":{"description":"An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.","type":"string"},"examples":{"description":"An array of examples of the server variable.","type":"array","items":{"type":"string"}},"default":{"description":"The default value to use for substitution, and to send, if an alternate value is not supplied.","type":"string"},"enum":{"description":"An enumeration of string values to be used if the substitution options are from a limited set.","type":"array","uniqueItems":true,"items":{"type":"string"}}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/{env}","protocol":"amqp","description":"RabbitMQ broker. Use the \`env\` variable to point to either \`production\` or \`staging\`.","variables":{"env":{"description":"Environment to connect to. It can be either \`production\` or \`staging\`.","enum":["production","staging"]}}}]},"http://asyncapi.com/definitions/3.1.0/server.json":{"$id":"http://asyncapi.com/definitions/3.1.0/server.json","description":"An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.","type":"object","required":["host","protocol"],"properties":{"title":{"description":"A human-friendly title for the server.","type":"string"},"description":{"description":"A longer description of the server. CommonMark is allowed.","type":"string"},"bindings":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json"}]},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"host":{"description":"The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.","type":"string"},"pathname":{"description":"The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.","type":"string"},"protocol":{"description":"The protocol this server supports for connection.","type":"string"},"protocolVersion":{"description":"An optional string describing the server. CommonMark syntax MAY be used for rich text representation.","type":"string"},"security":{"$ref":"http://asyncapi.com/definitions/3.1.0/securityRequirements.json"},"summary":{"description":"A brief summary of the server.","type":"string"},"tags":{"type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}},"variables":{"$ref":"http://asyncapi.com/definitions/3.1.0/serverVariables.json"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"host":"kafka.in.mycompany.com:9092","description":"Production Kafka broker.","protocol":"kafka","protocolVersion":"3.2"},{"host":"rabbitmq.in.mycompany.com:5672","pathname":"/production","protocol":"amqp","description":"Production RabbitMQ broker (uses the \`production\` vhost)."}]},"http://asyncapi.com/definitions/3.1.0/serverVariables.json":{"$id":"http://asyncapi.com/definitions/3.1.0/serverVariables.json","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/serverVariable.json"}]}},"http://asyncapi.com/definitions/3.1.0/info.json":{"$id":"http://asyncapi.com/definitions/3.1.0/info.json","description":"The object provides metadata about the API. The metadata can be used by the clients if needed.","allOf":[{"type":"object","required":["version","title"],"properties":{"title":{"description":"A unique and precise title of the API.","type":"string"},"description":{"description":"A longer description of the API. Should be different from the title. CommonMark is allowed.","type":"string"},"contact":{"$ref":"http://asyncapi.com/definitions/3.1.0/contact.json"},"externalDocs":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/externalDocs.json"}]},"license":{"$ref":"http://asyncapi.com/definitions/3.1.0/license.json"},"tags":{"description":"A list of tags for application API documentation control. Tags can be used for logical grouping of applications.","type":"array","uniqueItems":true,"items":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/tag.json"}]}},"termsOfService":{"description":"A URL to the Terms of Service for the API. MUST be in the format of a URL.","type":"string","format":"uri"},"version":{"description":"A semantic version number of the API.","type":"string"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false},{"$ref":"http://asyncapi.com/definitions/3.1.0/infoExtensions.json"}],"examples":[{"title":"AsyncAPI Sample App","version":"1.0.1","description":"This is a sample app.","termsOfService":"https://asyncapi.org/terms/","contact":{"name":"API Support","url":"https://www.asyncapi.org/support","email":"support@asyncapi.org"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocs":{"description":"Find more info here","url":"https://www.asyncapi.org"},"tags":[{"name":"e-commerce"}]}]},"http://asyncapi.com/definitions/3.1.0/contact.json":{"$id":"http://asyncapi.com/definitions/3.1.0/contact.json","description":"Contact information for the exposed API.","type":"object","properties":{"email":{"description":"The email address of the contact person/organization.","type":"string","format":"email"},"name":{"description":"The identifying name of the contact person/organization.","type":"string"},"url":{"description":"The URL pointing to the contact information.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"name":"API Support","url":"https://www.example.com/support","email":"support@example.com"}]},"http://asyncapi.com/definitions/3.1.0/license.json":{"$id":"http://asyncapi.com/definitions/3.1.0/license.json","type":"object","required":["name"],"properties":{"name":{"description":"The name of the license type. It's encouraged to use an OSI compatible license.","type":"string"},"url":{"description":"The URL pointing to the license.","type":"string","format":"uri"}},"patternProperties":{"^x-[\\\\w\\\\d\\\\.\\\\x2d_]+$":{"$ref":"http://asyncapi.com/definitions/3.1.0/specificationExtension.json"}},"additionalProperties":false,"examples":[{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"}]},"http://asyncapi.com/definitions/3.1.0/infoExtensions.json":{"$id":"http://asyncapi.com/definitions/3.1.0/infoExtensions.json","description":"The object that lists all the extensions of Info","type":"object","properties":{"x-linkedin":{"$ref":"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json"},"x-x":{"$ref":"http://asyncapi.com/extensions/x/0.1.0/schema.json"}}},"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json":{"$id":"http://asyncapi.com/extensions/linkedin/0.1.0/schema.json","type":"string","pattern":"^http(s)?://(www\\\\.)?linkedin\\\\.com.*$","description":"This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.","example":["https://www.linkedin.com/company/asyncapi/","https://www.linkedin.com/in/sambhavgupta0705/"]},"http://asyncapi.com/extensions/x/0.1.0/schema.json":{"$id":"http://asyncapi.com/extensions/x/0.1.0/schema.json","type":"string","description":"This extension allows you to provide the Twitter username of the account representing the team/company of the API.","example":["sambhavgupta75","AsyncAPISpec"]},"http://asyncapi.com/definitions/3.1.0/operations.json":{"$id":"http://asyncapi.com/definitions/3.1.0/operations.json","description":"Holds a dictionary with all the operations this application MUST implement.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/operation.json"}]},"examples":[{"onUserSignUp":{"title":"User sign up","summary":"Action to sign a user up.","description":"A longer description","channel":{"$ref":"#/channels/userSignup"},"action":"send","tags":[{"name":"user"},{"name":"signup"},{"name":"register"}],"bindings":{"amqp":{"ack":false}},"traits":[{"$ref":"#/components/operationTraits/kafka"}]}}]},"http://asyncapi.com/definitions/3.1.0/servers.json":{"$id":"http://asyncapi.com/definitions/3.1.0/servers.json","description":"An object representing multiple servers.","type":"object","additionalProperties":{"oneOf":[{"$ref":"http://asyncapi.com/definitions/3.1.0/Reference.json"},{"$ref":"http://asyncapi.com/definitions/3.1.0/server.json"}]},"examples":[{"development":{"host":"localhost:5672","description":"Development AMQP broker.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:development","description":"This environment is meant for developers to run their own tests."}]},"staging":{"host":"rabbitmq-staging.in.mycompany.com:5672","description":"RabbitMQ broker for the staging environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:staging","description":"This environment is a replica of the production environment."}]},"production":{"host":"rabbitmq.in.mycompany.com:5672","description":"RabbitMQ broker for the production environment.","protocol":"amqp","protocolVersion":"0-9-1","tags":[{"name":"env:production","description":"This environment is the live environment available for final users."}]}}]}},"description":"!!Auto generated!! \\n Do not manually edit. "}`); + }, 3054: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"@stoplight/spectral-core/meta/extensions","$defs":{"Extends":{"$anchor":"extends","oneOf":[{"$id":"ruleset","$ref":"ruleset.schema#","errorMessage":"must be a valid ruleset"},{"type":"array","items":{"anyOf":[{"$ref":"ruleset"},{"type":"array","minItems":2,"additionalItems":false,"items":[{"$ref":"ruleset"},{"type":"string","enum":["off","recommended","all"],"errorMessage":"allowed types are \\"off\\", \\"recommended\\" and \\"all\\""}]}]}}],"errorMessage":"must be a valid ruleset"},"Format":{"$anchor":"format","x-spectral-runtime":"format","errorMessage":"must be a valid format"},"Function":{"$anchor":"function","x-spectral-runtime":"ruleset-function","type":"object","properties":{"function":true},"required":["function"]},"Functions":{"$anchor":"functions","not":{}},"FunctionsDir":{"$anchor":"functionsDir","not":{}}}}'); + }, 50421: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"@stoplight/spectral-core/meta/extensions","$defs":{"Extends":{"$anchor":"extends","oneOf":[{"type":"string"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"array","minItems":2,"additionalItems":false,"items":[{"type":"string"},{"enum":["all","recommended","off"],"errorMessage":"allowed types are \\"off\\", \\"recommended\\" and \\"all\\""}]}]}}]},"Format":{"$anchor":"format","type":"string","errorMessage":"must be a valid format"},"Functions":{"$anchor":"functions","type":"array","items":{"type":"string"}},"FunctionsDir":{"$anchor":"functionsDir","type":"string"},"Function":{"$anchor":"function","type":"object","properties":{"function":{"type":"string"}},"required":["function"]}}}'); + }, 91361: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"@stoplight/spectral-core/meta/rule.schema","$defs":{"Then":{"type":"object","allOf":[{"properties":{"field":{"type":"string"}}},{"$ref":"extensions#function"}]},"Severity":{"$ref":"shared#severity"}},"if":{"type":"object"},"then":{"type":"object","properties":{"description":{"type":"string"},"documentationUrl":{"type":"string","format":"url","errorMessage":"must be a valid URL"},"recommended":{"type":"boolean"},"given":{"$ref":"shared#given"},"resolved":{"type":"boolean"},"severity":{"$ref":"#/$defs/Severity"},"message":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"formats":{"$ref":"shared#formats"},"then":{"if":{"type":"array"},"then":{"type":"array","items":{"$ref":"#/$defs/Then"}},"else":{"$ref":"#/$defs/Then"}},"type":{"enum":["style","validation"],"type":"string","errorMessage":"allowed types are \\"style\\" and \\"validation\\""},"extensions":{"type":"object"}},"required":["given","then"],"additionalProperties":false,"patternProperties":{"^x-":true},"errorMessage":{"required":"the rule must have at least \\"given\\" and \\"then\\" properties"}},"else":{"oneOf":[{"$ref":"shared#/$defs/HumanReadableSeverity"},{"type":"boolean"}]}}'); + }, 84185: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"@stoplight/spectral-core/meta/ruleset.schema","type":"object","additionalProperties":false,"properties":{"documentationUrl":{"type":"string","format":"url","errorMessage":"must be a valid URL"},"description":{"type":"string"},"rules":{"type":"object","additionalProperties":{"$ref":"rule.schema#"}},"functions":{"$ref":"extensions#functions"},"functionsDir":{"$ref":"extensions#functionsDir"},"formats":{"$ref":"shared#formats"},"extends":{"$ref":"extensions#extends"},"parserOptions":{"type":"object","properties":{"duplicateKeys":{"$ref":"shared#severity"},"incompatibleValues":{"$ref":"shared#severity"}},"additionalProperties":false},"overrides":{"type":"array","minItems":1,"items":{"if":{"type":"object","properties":{"files":{"type":"array","minItems":1,"items":{"type":"string","minLength":1,"pattern":"^[^#]+#"},"errorMessage":"must be an non-empty array of glob patterns"}},"required":["files"]},"then":{"type":"object","properties":{"files":true,"rules":{"type":"object","additionalProperties":{"$ref":"shared#severity"},"errorMessage":{"enum":"must be a valid severity level"}}},"required":["rules"],"additionalProperties":false,"errorMessage":{"required":"must contain rules when JSON Pointers are defined","additionalProperties":"must not override any other property than rules when JSON Pointers are defined"}},"else":{"allOf":[{"type":"object","properties":{"files":{"type":"array","minItems":1,"items":{"type":"string","pattern":"[^#]","minLength":1},"errorMessage":"must be an non-empty array of glob patterns"}},"required":["files"],"errorMessage":{"type":"must be an override, i.e. { \\"files\\": [\\"v2/**/*.json\\"], \\"rules\\": {} }"}},{"type":"object","properties":{"formats":{"$ref":"shared#formats"},"extends":{"$ref":"#/properties/extends"},"rules":{"$ref":"#/properties/rules"},"parserOptions":{"$ref":"#/properties/parserOptions"},"aliases":{"$ref":"#/properties/aliases"}},"anyOf":[{"required":["extends"]},{"required":["rules"]}]}]}},"errorMessage":{"minItems":"must not be empty"}},"aliases":{"type":"object","propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9_-]*$","errorMessage":{"pattern":"to avoid confusion the name must match /^[A-Za-z][A-Za-z0-9_-]*$/ regular expression","minLength":"the name of an alias must not be empty"}},"additionalProperties":{"if":{"type":"object"},"then":{"type":"object","properties":{"description":{"type":"string"},"targets":{"type":"array","minItems":1,"items":{"type":"object","properties":{"formats":{"$ref":"shared#formats"},"given":{"$ref":"shared#arrayish-given"}},"required":["formats","given"],"errorMessage":"a valid target must contain given and non-empty formats"},"errorMessage":{"minItems":"targets must have at least a single alias definition"}}},"required":["targets"],"errorMessage":{"required":"targets must be present and have at least a single alias definition"}},"else":{"$ref":"shared#arrayish-given"}}}},"patternProperties":{"^x-":true},"anyOf":[{"required":["extends"]},{"required":["rules"]},{"required":["overrides"]}]}'); + }, 82691: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"@stoplight/spectral-core/meta/shared","$defs":{"Formats":{"$anchor":"formats","type":"array","items":{"$ref":"extensions#format"},"errorMessage":"must be an array of formats"},"DiagnosticSeverity":{"enum":[-1,0,1,2,3]},"HumanReadableSeverity":{"enum":["error","warn","info","hint","off"]},"Severity":{"$anchor":"severity","oneOf":[{"$ref":"#/$defs/DiagnosticSeverity"},{"$ref":"#/$defs/HumanReadableSeverity"}],"errorMessage":"the value has to be one of: 0, 1, 2, 3 or \\"error\\", \\"warn\\", \\"info\\", \\"hint\\", \\"off\\""},"Given":{"$anchor":"given","if":{"type":"array"},"then":{"$anchor":"arrayish-given","type":"array","items":{"$ref":"path-expression"},"minItems":1,"errorMessage":{"minItems":"must be a non-empty array of expressions"}},"else":{"$ref":"path-expression"}},"PathExpression":{"$id":"path-expression","if":{"type":"string"},"then":{"type":"string","if":{"pattern":"^#"},"then":{"x-spectral-runtime":"alias"},"else":{"pattern":"^\\\\$","errorMessage":"must be a valid JSON Path expression or a reference to the existing Alias optionally paired with a JSON Path expression subset"}},"else":{"not":{},"errorMessage":"must be a valid JSON Path expression or a reference to the existing Alias optionally paired with a JSON Path expression subset"}}}}'); + }, 33978: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-07/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string","format":"uri"},"$schema":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"deprecationMessage":{"type":"string","description":"Non-standard: deprecation message for a property, if it is deprecated"},"default":{},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}'); + }, 20048: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string","format":"uri"},"$schema":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}'); + }, 93770: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}'); + }, 32289: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/applicator":true},"$recursiveAnchor":true,"title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"additionalItems":{"$recursiveRef":"#"},"unevaluatedItems":{"$recursiveRef":"#"},"items":{"anyOf":[{"$recursiveRef":"#"},{"$ref":"#/$defs/schemaArray"}]},"contains":{"$recursiveRef":"#"},"additionalProperties":{"$recursiveRef":"#"},"unevaluatedProperties":{"$recursiveRef":"#"},"properties":{"type":"object","additionalProperties":{"$recursiveRef":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$recursiveRef":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$recursiveRef":"#"}},"propertyNames":{"$recursiveRef":"#"},"if":{"$recursiveRef":"#"},"then":{"$recursiveRef":"#"},"else":{"$recursiveRef":"#"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$recursiveRef":"#"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$recursiveRef":"#"}}}}'); + }, 14513: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/content","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/content":true},"$recursiveAnchor":true,"title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"contentSchema":{"$recursiveRef":"#"}}}'); + }, 56703: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/core","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/core":true},"$recursiveAnchor":true,"title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"type":"string","format":"uri"},"$anchor":{"type":"string","pattern":"^[A-Za-z][-A-Za-z0-9.:_]*$"},"$ref":{"type":"string","format":"uri-reference"},"$recursiveRef":{"type":"string","format":"uri-reference"},"$recursiveAnchor":{"type":"boolean","default":false},"$vocabulary":{"type":"object","propertyNames":{"type":"string","format":"uri"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$recursiveRef":"#"},"default":{}}}}'); + }, 18699: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/format","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/format":true},"$recursiveAnchor":true,"title":"Format vocabulary meta-schema","type":["object","boolean"],"properties":{"format":{"type":"string"}}}'); + }, 42992: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/meta-data":true},"$recursiveAnchor":true,"title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}'); + }, 81275: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/meta/validation","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/validation":true},"$recursiveAnchor":true,"title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}},"const":true,"enum":{"type":"array","items":true},"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}'); + }, 19065: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2019-09/schema","$id":"https://json-schema.org/draft/2019-09/schema","$vocabulary":{"https://json-schema.org/draft/2019-09/vocab/core":true,"https://json-schema.org/draft/2019-09/vocab/applicator":true,"https://json-schema.org/draft/2019-09/vocab/validation":true,"https://json-schema.org/draft/2019-09/vocab/meta-data":true,"https://json-schema.org/draft/2019-09/vocab/format":false,"https://json-schema.org/draft/2019-09/vocab/content":true},"$recursiveAnchor":true,"title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format"},{"$ref":"meta/content"}],"type":["object","boolean"],"properties":{"definitions":{"$comment":"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.","type":"object","additionalProperties":{"$recursiveRef":"#"},"default":{}},"dependencies":{"$comment":"\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"","type":"object","additionalProperties":{"anyOf":[{"$recursiveRef":"#"},{"$ref":"meta/validation#/$defs/stringArray"}]}}}}'); + }, 90013: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}'); + }, 60013: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}'); + }, 64771: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}'); + }, 9567: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}'); + }, 68364: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}'); + }, 47388: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}'); + }, 42943: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}'); + }, 46261: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}'); + }, 26443: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}'); + }, 33928: (e11) => { + "use strict"; + e11.exports = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}'); + } }, t8 = {}; + function i7(n8) { + var r8 = t8[n8]; + if (void 0 !== r8) + return r8.exports; + var o7 = t8[n8] = { id: n8, loaded: false, exports: {} }; + return e10[n8].call(o7.exports, o7, o7.exports, i7), o7.loaded = true, o7.exports; + } + i7.n = (e11) => { + var t9 = e11 && e11.__esModule ? () => e11.default : () => e11; + return i7.d(t9, { a: t9 }), t9; + }, i7.d = (e11, t9) => { + for (var n8 in t9) + i7.o(t9, n8) && !i7.o(e11, n8) && Object.defineProperty(e11, n8, { enumerable: true, get: t9[n8] }); + }, i7.g = function() { + if ("object" == typeof globalThis) + return globalThis; + try { + return this || new Function("return this")(); + } catch (e11) { + if ("object" == typeof window) + return window; + } + }(), i7.o = (e11, t9) => Object.prototype.hasOwnProperty.call(e11, t9), i7.r = (e11) => { + "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e11, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e11, "__esModule", { value: true }); + }, i7.nmd = (e11) => (e11.paths = [], e11.children || (e11.children = []), e11); + var n7 = {}; + return (() => { + "use strict"; + i7.d(n7, { default: () => kn }); + class e11 { + constructor(e12, t10 = {}) { + this._json = e12, this._meta = t10; + } + json(e12) { + return void 0 === e12 || null === this._json || void 0 === this._json ? this._json : this._json[e12]; + } + meta(e12) { + return void 0 === e12 ? this._meta : this._meta ? this._meta[e12] : void 0; + } + jsonPath(e12) { + return "string" != typeof e12 ? this._meta.pointer : `${this._meta.pointer}/${e12}`; + } + createModel(e12, t10, i8) { + return new e12(t10, Object.assign(Object.assign({}, i8), { asyncapi: this._meta.asyncapi })); + } + } + class t9 extends Array { + constructor(e12, t10 = {}) { + super(...e12), this.collections = e12, this._meta = t10; + } + has(e12) { + return void 0 !== this.get(e12); + } + all() { + return this.collections; + } + isEmpty() { + return 0 === this.collections.length; + } + filterBy(e12) { + return this.collections.filter(e12); + } + meta(e12) { + return void 0 === e12 ? this._meta : this._meta ? this._meta[String(e12)] : void 0; + } + } + class r8 extends t9 { + get(e12) { + return e12 = e12.startsWith("x-") ? e12 : `x-${e12}`, this.collections.find((t10) => t10.id() === e12); + } + } + class o7 extends e11 { + id() { + return this._meta.id; + } + value() { + return this._json; + } + } + var s7, a7; + function p7(e12, t10, i8 = []) { + 0 === i8.length && (i8 = Object.values(a7)); + const n8 = { callback: t10, schemaTypesToIterate: i8, seenSchemas: /* @__PURE__ */ new Set() }; + if (e12.channels().isEmpty() || e12.channels().all().forEach((e13) => { + !function(e14, t11) { + if (!e14) + return; + const { schemaTypesToIterate: i9 } = t11; + i9.includes(a7.Parameters) && Object.values(e14.parameters().filterBy((e15) => e15.hasSchema()) || {}).forEach((e15) => { + c7(e15.schema(), null, t11); + }), e14.messages().all().forEach((e15) => { + d7(e15, t11); + }); + }(e13, n8); + }), i8.includes(a7.Components) && !e12.components().isEmpty()) { + const t11 = e12.components(); + Object.values(t11.messages().all() || {}).forEach((e13) => { + d7(e13, n8); + }), Object.values(t11.schemas().all() || {}).forEach((e13) => { + c7(e13, null, n8); + }), i8.includes(a7.Parameters) && Object.values(t11.channelParameters().filterBy((e13) => e13.hasSchema())).forEach((e13) => { + c7(e13.schema(), null, n8); + }), Object.values(t11.messageTraits().all() || {}).forEach((e13) => { + !function(e14, t12) { + if (!e14) + return; + const { schemaTypesToIterate: i9 } = t12; + i9.includes(a7.Headers) && e14.hasHeaders() && c7(e14.headers(), null, t12); + }(e13, n8); + }); + } + } + function c7(e12, t10, i8) { + if (!e12) + return; + const { schemaTypesToIterate: n8, callback: r9, seenSchemas: o8 } = i8, p8 = e12.json(); + if (o8.has(p8)) + return; + o8.add(p8); + let d8 = e12.type() || []; + Array.isArray(d8) || (d8 = [d8]), !n8.includes(a7.Objects) && d8.includes("object") || !n8.includes(a7.Arrays) && d8.includes("array") || false !== r9(e12, t10, s7.NEW_SCHEMA) && (n8.includes(a7.Objects) && d8.includes("object") && function(e13, t11) { + Object.entries(e13.properties() || {}).forEach(([e14, i10]) => { + c7(i10, e14, t11); + }); + const i9 = e13.additionalProperties(); + "object" == typeof i9 && c7(i9, null, t11); + const n9 = t11.schemaTypesToIterate; + n9.includes(a7.PropertyNames) && e13.propertyNames() && c7(e13.propertyNames(), null, t11), n9.includes(a7.PatternProperties) && Object.entries(e13.patternProperties() || {}).forEach(([e14, i10]) => { + c7(i10, e14, t11); + }); + }(e12, i8), n8.includes(a7.Arrays) && d8.includes("array") && function(e13, t11) { + const i9 = e13.items(); + i9 && (Array.isArray(i9) ? i9.forEach((e14, i10) => { + c7(e14, i10, t11); + }) : c7(i9, null, t11)); + const n9 = e13.additionalItems(); + "object" == typeof n9 && c7(n9, null, t11), t11.schemaTypesToIterate.includes("contains") && e13.contains() && c7(e13.contains(), null, t11); + }(e12, i8), n8.includes(a7.OneOfs) && (e12.oneOf() || []).forEach((e13, t11) => { + c7(e13, t11, i8); + }), n8.includes(a7.AnyOfs) && (e12.anyOf() || []).forEach((e13, t11) => { + c7(e13, t11, i8); + }), n8.includes(a7.AllOfs) && (e12.allOf() || []).forEach((e13, t11) => { + c7(e13, t11, i8); + }), n8.includes(a7.Nots) && e12.not() && c7(e12.not(), null, i8), n8.includes(a7.Ifs) && e12.if() && c7(e12.if(), null, i8), n8.includes(a7.Thenes) && e12.then() && c7(e12.then(), null, i8), n8.includes(a7.Elses) && e12.else() && c7(e12.else(), null, i8), n8.includes(a7.Dependencies) && Object.entries(e12.dependencies() || {}).forEach(([e13, t11]) => { + t11 && !Array.isArray(t11) && c7(t11, e13, i8); + }), n8.includes(a7.Definitions) && Object.entries(e12.definitions() || {}).forEach(([e13, t11]) => { + c7(t11, e13, i8); + }), r9(e12, t10, s7.END_SCHEMA), o8.delete(p8)); + } + function d7(e12, t10) { + if (!e12) + return; + const { schemaTypesToIterate: i8 } = t10; + i8.includes(a7.Headers) && e12.hasHeaders() && c7(e12.headers(), null, t10), i8.includes(a7.Payloads) && e12.hasPayload() && c7(e12.payload(), null, t10); + } + function f8(e12, t10, i8, n8) { + return new e12(t10, Object.assign(Object.assign({}, i8), { asyncapi: i8.asyncapi || (null == n8 ? void 0 : n8.meta().asyncapi) })); + } + function l7(e12, t10, i8) { + const n8 = /* @__PURE__ */ new Set(), r9 = /* @__PURE__ */ new Set(); + let o8 = Object.values(a7); + return i8 || (o8 = o8.filter((e13) => e13 !== a7.Components)), p7(e12, function(e13) { + n8.has(e13.json()) || (n8.add(e13.json()), r9.add(e13)); + }, o8), new t10(Array.from(r9)); + } + !function(e12) { + e12.NEW_SCHEMA = "NEW_SCHEMA", e12.END_SCHEMA = "END_SCHEMA"; + }(s7 || (s7 = {})), function(e12) { + e12.Parameters = "parameters", e12.Payloads = "payloads", e12.Headers = "headers", e12.Components = "components", e12.Objects = "objects", e12.Arrays = "arrays", e12.OneOfs = "oneOfs", e12.AllOfs = "allOfs", e12.AnyOfs = "anyOfs", e12.Nots = "nots", e12.PropertyNames = "propertyNames", e12.PatternProperties = "patternProperties", e12.Contains = "contains", e12.Ifs = "ifs", e12.Thenes = "thenes", e12.Elses = "elses", e12.Dependencies = "dependencies", e12.Definitions = "definitions"; + }(a7 || (a7 = {})); + var u7 = i7(37233), m7 = i7.n(u7); + const h8 = "x-parser-spec-parsed", y7 = "x-parser-spec-stringified", g7 = "x-parser-api-version", b8 = "x-parser-message-name", v8 = "x-parser-schema-id", j6 = "x-parser-original-payload", $5 = "x-parser-circular", x7 = "x-parser-unique-object-id", _6 = /^x-[\w\d.\-_]+$/, w6 = Object.keys(m7().schemas), S6 = w6[w6.length - 1]; + class P6 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.protocol() === e12); + } + extensions() { + const e12 = []; + return Object.entries(this._meta.originalData || {}).forEach(([t10, i8]) => { + _6.test(t10) && e12.push(f8(o7, i8, { id: t10, pointer: `${this._meta.pointer}/${t10}`, asyncapi: this._meta.asyncapi })); + }), new r8(e12); + } + } + class O7 extends e11 { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const e12 = Object.assign({}, this._json); + return delete e12.bindingVersion, e12; + } + extensions() { + return M6(this); + } + } + class T6 extends e11 { + url() { + return this._json.url; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + extensions() { + return M6(this); + } + } + class A6 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.name() === e12); + } + } + class I6 extends e11 { + name() { + return this._json.name; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + extensions() { + return M6(this); + } + hasExternalDocs() { + return R6(this); + } + externalDocs() { + return D6(this); + } + } + function E6(e12) { + const t10 = e12.json("bindings") || {}; + return new P6(Object.entries(t10 || {}).map(([t11, i8]) => f8(O7, i8, { protocol: t11, pointer: e12.jsonPath(`bindings/${t11}`) }, e12)), { originalData: t10, asyncapi: e12.meta("asyncapi"), pointer: e12.jsonPath("bindings") }); + } + function q5(e12) { + return Boolean(k6(e12)); + } + function k6(e12) { + return e12.json("description"); + } + function M6(e12) { + const t10 = []; + return Object.entries(e12.json()).forEach(([i8, n8]) => { + _6.test(i8) && t10.push(f8(o7, n8, { id: i8, pointer: e12.jsonPath(i8) }, e12)); + }), new r8(t10); + } + function R6(e12) { + return Object.keys(e12.json("externalDocs") || {}).length > 0; + } + function D6(e12) { + if (R6(e12)) + return new T6(e12.json("externalDocs")); + } + function C6(e12) { + return new A6((e12.json("tags") || []).map((t10, i8) => f8(I6, t10, { pointer: e12.jsonPath(`tags/${i8}`) }, e12))); + } + class V5 extends e11 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return M6(this); + } + } + class N6 extends e11 { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return M6(this); + } + } + class F6 extends e11 { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const e12 = this._json.contact; + return e12 && this.createModel(V5, e12, { pointer: "/info/contact" }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const e12 = this._json.license; + return e12 && this.createModel(N6, e12, { pointer: "/info/license" }); + } + hasExternalDocs() { + const e12 = this._meta.asyncapi.parsed; + return Object.keys(e12.externalDocs || {}).length > 0; + } + externalDocs() { + if (this.hasExternalDocs()) { + const e12 = this._meta.asyncapi.parsed; + return this.createModel(T6, e12.externalDocs, { pointer: "/externalDocs" }); + } + } + tags() { + const e12 = this._meta.asyncapi.parsed.tags || []; + return new A6(e12.map((e13, t10) => this.createModel(I6, e13, { pointer: `/tags/${t10}` }))); + } + extensions() { + return M6(this); + } + } + class U6 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + class L6 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + var z6 = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function B6(e12, t10) { + return z6(this, void 0, void 0, function* () { + const i8 = e12.parserRegistry.get(t10.schemaFormat); + if (void 0 === i8) + throw new Error("Unknown schema format"); + return i8.parse(t10); + }); + } + function Q5(e12, t10) { + return "string" == typeof e12 ? e12 : K5(t10); + } + function K5(e12) { + return `application/vnd.aai.asyncapi;version=${e12}`; + } + class H5 extends e11 { + id() { + return this.$id() || this._meta.id || this.json(v8); + } + $comment() { + if ("boolean" != typeof this._json) + return this._json.$comment; + } + $id() { + if ("boolean" != typeof this._json) + return this._json.$id; + } + $schema() { + return "boolean" == typeof this._json ? "http://json-schema.org/draft-07/schema#" : this._json.$schema || "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + return "boolean" == typeof this._json ? this._json : "boolean" == typeof this._json.additionalItems ? this._json.additionalItems : void 0 === this._json.additionalItems || null !== this._json.additionalItems && this.createModel(H5, this._json.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + return "boolean" == typeof this._json ? this._json : "boolean" == typeof this._json.additionalProperties ? this._json.additionalProperties : void 0 === this._json.additionalProperties || null !== this._json.additionalProperties && this.createModel(H5, this._json.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if ("boolean" != typeof this._json && Array.isArray(this._json.allOf)) + return this._json.allOf.map((e12, t10) => this.createModel(H5, e12, { pointer: `${this._meta.pointer}/allOf/${t10}`, parent: this })); + } + anyOf() { + if ("boolean" != typeof this._json && Array.isArray(this._json.anyOf)) + return this._json.anyOf.map((e12, t10) => this.createModel(H5, e12, { pointer: `${this._meta.pointer}/anyOf/${t10}`, parent: this })); + } + const() { + if ("boolean" != typeof this._json) + return this._json.const; + } + contains() { + if ("boolean" != typeof this._json && "object" == typeof this._json.contains) + return this.createModel(H5, this._json.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if ("boolean" != typeof this._json) + return this._json.contentEncoding; + } + contentMediaType() { + if ("boolean" != typeof this._json) + return this._json.contentMediaType; + } + default() { + if ("boolean" != typeof this._json) + return this._json.default; + } + definitions() { + if ("boolean" != typeof this._json && "object" == typeof this._json.definitions) + return Object.entries(this._json.definitions).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(H5, i8, { pointer: `${this._meta.pointer}/definitions/${t10}`, parent: this }), e12), {}); + } + description() { + if ("boolean" != typeof this._json) + return this._json.description; + } + dependencies() { + if ("boolean" != typeof this._json && "object" == typeof this._json.dependencies) + return Object.entries(this._json.dependencies).reduce((e12, [t10, i8]) => (e12[t10] = Array.isArray(i8) ? i8 : this.createModel(H5, i8, { pointer: `${this._meta.pointer}/dependencies/${t10}`, parent: this }), e12), {}); + } + deprecated() { + return "boolean" != typeof this._json && (this._json.deprecated || false); + } + discriminator() { + if ("boolean" != typeof this._json) + return this._json.discriminator; + } + else() { + if ("boolean" != typeof this._json && "object" == typeof this._json.else) + return this.createModel(H5, this._json.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if ("boolean" != typeof this._json) + return this._json.enum; + } + examples() { + if ("boolean" != typeof this._json) + return this._json.examples; + } + exclusiveMaximum() { + if ("boolean" != typeof this._json) + return this._json.exclusiveMaximum; + } + exclusiveMinimum() { + if ("boolean" != typeof this._json) + return this._json.exclusiveMinimum; + } + format() { + if ("boolean" != typeof this._json) + return this._json.format; + } + isBooleanSchema() { + return "boolean" == typeof this._json; + } + if() { + if ("boolean" != typeof this._json && "object" == typeof this._json.if) + return this.createModel(H5, this._json.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let e12 = this._meta.parent; + for (; e12; ) { + if (e12._json === this._json) + return true; + e12 = e12._meta.parent; + } + return false; + } + items() { + if ("boolean" != typeof this._json && "object" == typeof this._json.items) + return Array.isArray(this._json.items) ? this._json.items.map((e12, t10) => this.createModel(H5, e12, { pointer: `${this._meta.pointer}/items/${t10}`, parent: this })) : this.createModel(H5, this._json.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if ("boolean" != typeof this._json) + return this._json.maximum; + } + maxItems() { + if ("boolean" != typeof this._json) + return this._json.maxItems; + } + maxLength() { + if ("boolean" != typeof this._json) + return this._json.maxLength; + } + maxProperties() { + if ("boolean" != typeof this._json) + return this._json.maxProperties; + } + minimum() { + if ("boolean" != typeof this._json) + return this._json.minimum; + } + minItems() { + if ("boolean" != typeof this._json) + return this._json.minItems; + } + minLength() { + if ("boolean" != typeof this._json) + return this._json.minLength; + } + minProperties() { + if ("boolean" != typeof this._json) + return this._json.minProperties; + } + multipleOf() { + if ("boolean" != typeof this._json) + return this._json.multipleOf; + } + not() { + if ("boolean" != typeof this._json && "object" == typeof this._json.not) + return this.createModel(H5, this._json.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if ("boolean" != typeof this._json && Array.isArray(this._json.oneOf)) + return this._json.oneOf.map((e12, t10) => this.createModel(H5, e12, { pointer: `${this._meta.pointer}/oneOf/${t10}`, parent: this })); + } + pattern() { + if ("boolean" != typeof this._json) + return this._json.pattern; + } + patternProperties() { + if ("boolean" != typeof this._json && "object" == typeof this._json.patternProperties) + return Object.entries(this._json.patternProperties).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(H5, i8, { pointer: `${this._meta.pointer}/patternProperties/${t10}`, parent: this }), e12), {}); + } + properties() { + if ("boolean" != typeof this._json && "object" == typeof this._json.properties) + return Object.entries(this._json.properties).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(H5, i8, { pointer: `${this._meta.pointer}/properties/${t10}`, parent: this }), e12), {}); + } + property(e12) { + if ("boolean" != typeof this._json && "object" == typeof this._json.properties && "object" == typeof this._json.properties[e12]) + return this.createModel(H5, this._json.properties[e12], { pointer: `${this._meta.pointer}/properties/${e12}`, parent: this }); + } + propertyNames() { + if ("boolean" != typeof this._json && "object" == typeof this._json.propertyNames) + return this.createModel(H5, this._json.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + return "boolean" != typeof this._json && (this._json.readOnly || false); + } + required() { + if ("boolean" != typeof this._json) + return this._json.required; + } + schemaFormat() { + return this._meta.schemaFormat || K5(this._meta.asyncapi.semver.version); + } + then() { + if ("boolean" != typeof this._json && "object" == typeof this._json.then) + return this.createModel(H5, this._json.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if ("boolean" != typeof this._json) + return this._json.title; + } + type() { + if ("boolean" != typeof this._json) + return this._json.type; + } + uniqueItems() { + return "boolean" != typeof this._json && (this._json.uniqueItems || false); + } + writeOnly() { + return "boolean" != typeof this._json && (this._json.writeOnly || false); + } + hasExternalDocs() { + return R6(this); + } + externalDocs() { + return D6(this); + } + extensions() { + return M6(this); + } + } + class G5 extends e11 { + id() { + return this._meta.id; + } + hasSchema() { + return !!this._json.schema; + } + schema() { + if (this._json.schema) + return this.createModel(H5, this._json.schema, { pointer: `${this._meta.pointer}/schema` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + extensions() { + return M6(this); + } + } + class W5 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + class J5 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.isSend()); + } + filterByReceive() { + return this.filterBy((e12) => e12.isReceive()); + } + } + class Z5 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Y6 extends e11 { + location() { + return this._json.location; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + extensions() { + return M6(this); + } + } + class X5 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.name() === e12); + } + } + class ee4 extends e11 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return M6(this); + } + } + class te4 extends e11 { + id() { + return this._json.messageId || this._meta.id || this.json(b8); + } + hasSchemaFormat() { + return void 0 !== this.schemaFormat(); + } + schemaFormat() { + return this._json.schemaFormat || K5(this._meta.asyncapi.semver.version); + } + hasMessageId() { + return !!this._json.messageId; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (this._json.correlationId) + return this.createModel(Y6, this._json.correlationId, { pointer: `${this._meta.pointer}/correlationId` }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var e12; + return this._json.contentType || (null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (this._json.headers) + return this.createModel(H5, this._json.headers, { pointer: `${this._meta.pointer}/headers` }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + hasExternalDocs() { + return R6(this); + } + externalDocs() { + return D6(this); + } + examples() { + return new X5((this._json.examples || []).map((e12, t10) => this.createModel(ee4, e12, { pointer: `${this._meta.pointer}/examples/${t10}` }))); + } + tags() { + return C6(this); + } + bindings() { + return E6(this); + } + extensions() { + return M6(this); + } + } + class ie3 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + var ne4 = i7(23859), re4 = i7(94169); + function oe4(e12, t10, i8) { + return { source: i8, input: t10, parsed: e12, semver: se4(e12.asyncapi) }; + } + function se4(e12) { + const [t10, i8, n8] = e12.split("."), [r9, o8] = n8.split("-rc"); + return { version: e12, major: Number(t10), minor: Number(i8), patch: Number(r9), rc: o8 && Number(o8) }; + } + function ae4(e12, t10, i8) { + pe4(e12, t10, i8.json()); + } + function pe4(e12, t10, i8) { + "object" == typeof i8 && i8 && (e12 = e12.startsWith("x-") ? e12 : `x-${e12}`, i8[String(e12)] = t10); + } + function ce4(e12, t10) { + if (!de4(t10)) + return t10; + const i8 = de4(e12) ? Object.assign({}, e12) : {}; + return Object.keys(t10).forEach((e13) => { + const n8 = t10[e13]; + null === n8 ? delete i8[e13] : i8[e13] = ce4(i8[e13], n8); + }), i8; + } + function de4(e12) { + return Boolean(e12) && "object" == typeof e12 && false === Array.isArray(e12); + } + function fe4(e12, t10, i8) { + if (!(e12 instanceof Error)) + return []; + const n8 = i8 ? i8.getRangeForJsonPath([]) : ne4.Document.DEFAULT_RANGE; + return [{ code: "uncaught-error", message: `${t10}. Name: ${e12.name}, message: ${e12.message}, stack: ${e12.stack}`, path: [], severity: re4.h_.Error, range: n8 }]; + } + function le4(e12) { + return e12.replace(/[~/]{1}/g, (e13) => { + switch (e13) { + case "/": + return "~1"; + case "~": + return "~0"; + } + return e13; + }); + } + function ue4(e12) { + return e12.includes("~") ? e12.replace(/~[01]/g, (e13) => { + switch (e13) { + case "~1": + return "/"; + case "~0": + return "~"; + } + return e13; + }) : e12; + } + function me4(e12, t10) { + let i8 = 0; + const n8 = t10.length; + for (; "object" == typeof e12 && e12 && i8 < n8; ) + e12 = e12[t10[i8++]]; + return i8 === n8 ? e12 : void 0; + } + class he4 extends te4 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (this._json.payload) + return this.createModel(H5, this._json.payload, { pointer: `${this._meta.pointer}/payload`, schemaFormat: this._json.schemaFormat }); + } + servers() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.servers().forEach((i9) => { + t10.includes(i9.json()) || (t10.push(i9.json()), e12.push(i9)); + }); + }), new ie3(e12); + } + channels() { + const e12 = [], t10 = []; + return this.operations().all().forEach((i8) => { + i8.channels().forEach((i9) => { + t10.includes(i9.json()) || (t10.push(i9.json()), e12.push(i9)); + }); + }), new U6(e12); + } + operations() { + var e12; + const t10 = []; + return Object.entries((null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed.channels) || {}).forEach(([e13, i8]) => { + ["subscribe", "publish"].forEach((n8) => { + const r9 = i8[n8]; + r9 && (r9.message === this._json || (r9.message.oneOf || []).includes(this._json)) && t10.push(this.createModel(_e2, r9, { id: "", pointer: `/channels/${le4(e13)}/${n8}`, action: n8 })); + }); + }), new J5(t10); + } + traits() { + return new Z5((this._json.traits || []).map((e12, t10) => this.createModel(te4, e12, { id: "", pointer: `${this._meta.pointer}/traits/${t10}` }))); + } + } + class ye4 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class ge4 extends e11 { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.scopes; + } + extensions() { + return M6(this); + } + } + class be4 extends e11 { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (this._json.authorizationCode) + return new ge4(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (this._json.clientCredentials) + return new ge4(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (this._json.implicit) + return new ge4(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (this._json.password) + return new ge4(this._json.password); + } + extensions() { + return M6(this); + } + } + class ve4 extends e11 { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (this._json.flows) + return new be4(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return M6(this); + } + } + class je4 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.meta("id") === e12); + } + } + class $e2 extends e11 { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } + } + class xe2 extends e11 { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._json.operationId; + } + operationId() { + return this._json.operationId; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + hasExternalDocs() { + return R6(this); + } + externalDocs() { + return D6(this); + } + security() { + var e12, t10, i8, n8; + const r9 = (null === (n8 = null === (i8 = null === (t10 = null === (e12 = this._meta) || void 0 === e12 ? void 0 : e12.asyncapi) || void 0 === t10 ? void 0 : t10.parsed) || void 0 === i8 ? void 0 : i8.components) || void 0 === n8 ? void 0 : n8.securitySchemes) || {}; + return (this._json.security || []).map((e13, t11) => { + const i9 = []; + return Object.entries(e13).forEach(([e14, n9]) => { + const o8 = this.createModel(ve4, r9[e14], { id: e14, pointer: `/components/securitySchemes/${e14}` }); + i9.push(this.createModel($e2, { scheme: o8, scopes: n9 }, { id: e14, pointer: `${this.meta().pointer}/security/${t11}/${e14}` })); + }), new je4(i9); + }); + } + tags() { + return C6(this); + } + bindings() { + return E6(this); + } + extensions() { + return M6(this); + } + } + class _e2 extends xe2 { + action() { + return this._meta.action; + } + isSend() { + return "subscribe" === this.action(); + } + isReceive() { + return "publish" === this.action(); + } + servers() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.servers().forEach((i9) => { + t10.includes(i9.json()) || (t10.push(i9.json()), e12.push(i9)); + }); + }), new ie3(e12); + } + channels() { + const e12 = []; + return Object.entries(this._meta.asyncapi.parsed.channels || {}).forEach(([t10, i8]) => { + i8.subscribe !== this._json && i8.publish !== this._json || e12.push(this.createModel(Oe4, i8, { id: t10, address: t10, pointer: `/channels/${le4(t10)}` })); + }), new U6(e12); + } + messages() { + let e12 = false, t10 = []; + return this._json.message && (Array.isArray(this._json.message.oneOf) ? (t10 = this._json.message.oneOf, e12 = true) : t10 = [this._json.message]), new W5(t10.map((t11, i8) => this.createModel(he4, t11, { id: "", pointer: `${this._meta.pointer}/message${e12 ? `/oneOf/${i8}` : ""}` }))); + } + reply() { + } + traits() { + return new ye4((this._json.traits || []).map((e12, t10) => this.createModel(xe2, e12, { id: "", pointer: `${this._meta.pointer}/traits/${t10}`, action: "" }))); + } + } + class we4 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Se4 extends e11 { + id() { + return this._meta.id; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return M6(this); + } + } + class Pe2 extends e11 { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + host() { + return new URL(this.url()).host; + } + hasPathname() { + return !!this.pathname(); + } + pathname() { + return new URL(this.url()).pathname; + } + protocol() { + return this._json.protocol; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + channels() { + var e12; + const t10 = []; + return Object.entries((null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed.channels) || {}).forEach(([e13, i8]) => { + const n8 = i8.servers || []; + (0 === n8.length || n8.includes(this._meta.id)) && t10.push(this.createModel(Oe4, i8, { id: e13, address: e13, pointer: `/channels/${le4(e13)}` })); + }), new U6(t10); + } + operations() { + const e12 = []; + return this.channels().forEach((t10) => { + e12.push(...t10.operations().all()); + }), new J5(e12); + } + messages() { + const e12 = []; + return this.operations().forEach((t10) => e12.push(...t10.messages().all())), new W5(e12); + } + variables() { + return new we4(Object.entries(this._json.variables || {}).map(([e12, t10]) => this.createModel(Se4, t10, { id: e12, pointer: `${this._meta.pointer}/variables/${e12}` }))); + } + security() { + var e12, t10, i8, n8; + const r9 = (null === (n8 = null === (i8 = null === (t10 = null === (e12 = this._meta) || void 0 === e12 ? void 0 : e12.asyncapi) || void 0 === t10 ? void 0 : t10.parsed) || void 0 === i8 ? void 0 : i8.components) || void 0 === n8 ? void 0 : n8.securitySchemes) || {}; + return (this._json.security || []).map((e13, t11) => { + const i9 = []; + return Object.entries(e13).forEach(([e14, n9]) => { + const o8 = this.createModel(ve4, r9[e14], { id: e14, pointer: `/components/securitySchemes/${e14}` }); + i9.push(this.createModel($e2, { scheme: o8, scopes: n9 }, { id: e14, pointer: `${this.meta().pointer}/security/${t11}/${e14}` })); + }), new je4(i9); + }); + } + tags() { + return C6(this); + } + bindings() { + return E6(this); + } + extensions() { + return M6(this); + } + } + class Oe4 extends e11 { + id() { + return this._meta.id; + } + address() { + return this._meta.address; + } + hasDescription() { + return q5(this); + } + description() { + return k6(this); + } + servers() { + var e12; + const t10 = [], i8 = this._json.servers || []; + return Object.entries((null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed.servers) || {}).forEach(([e13, n8]) => { + (0 === i8.length || i8.includes(e13)) && t10.push(this.createModel(Pe2, n8, { id: e13, pointer: `/servers/${e13}` })); + }), new ie3(t10); + } + operations() { + const e12 = []; + return ["publish", "subscribe"].forEach((t10) => { + const i8 = this._json[t10], n8 = i8 && i8.operationId || t10; + i8 && e12.push(this.createModel(_e2, i8, { id: n8, action: t10, pointer: `${this._meta.pointer}/${t10}` })); + }), new J5(e12); + } + messages() { + const e12 = []; + return this.operations().forEach((t10) => e12.push(...t10.messages().all())), new W5(e12); + } + parameters() { + return new L6(Object.entries(this._json.parameters || {}).map(([e12, t10]) => this.createModel(G5, t10, { id: e12, pointer: `${this._meta.pointer}/parameters/${e12}` }))); + } + bindings() { + return E6(this); + } + extensions() { + return M6(this); + } + } + class Te extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Ae4 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Ie2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.meta("id") === e12); + } + } + class Ee4 extends e11 { + servers() { + return this.createCollection("servers", ie3, Pe2); + } + channels() { + return new U6(Object.entries(this._json.channels || {}).map(([e12, t10]) => this.createModel(Oe4, t10, { id: e12, address: "", pointer: `/components/channels/${le4(e12)}` }))); + } + operations() { + return new J5([]); + } + messages() { + return this.createCollection("messages", W5, he4); + } + schemas() { + return this.createCollection("schemas", Te, H5); + } + channelParameters() { + return this.createCollection("parameters", L6, G5); + } + serverVariables() { + return this.createCollection("serverVariables", we4, Se4); + } + operationTraits() { + return this.createCollection("operationTraits", ye4, xe2); + } + messageTraits() { + return this.createCollection("messageTraits", Z5, te4); + } + correlationIds() { + return this.createCollection("correlationIds", Ie2, Y6); + } + securitySchemes() { + return this.createCollection("securitySchemes", Ae4, ve4); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return M6(this); + } + isEmpty() { + return 0 === Object.keys(this._json).length; + } + createCollection(e12, t10, i8) { + const n8 = []; + return Object.entries(this._json[e12] || {}).forEach(([t11, r9]) => { + n8.push(this.createModel(i8, r9, { id: t11, pointer: `/components/${e12}/${t11}` })); + }), new t10(n8); + } + createBindings(e12) { + return Object.entries(this._json[e12] || {}).reduce((t10, [i8, n8]) => { + const r9 = n8 || {}, o8 = this.meta("asyncapi"), s8 = `components/${e12}/${i8}`; + return t10[i8] = new P6(Object.entries(r9).map(([e13, t11]) => this.createModel(O7, t11, { protocol: e13, pointer: `${s8}/${e13}` })), { originalData: r9, asyncapi: o8, pointer: s8 }), t10; + }, {}); + } + } + class qe2 extends e11 { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(F6, this._json.info, { pointer: "/info" }); + } + servers() { + return new ie3(Object.entries(this._json.servers || {}).map(([e12, t10]) => this.createModel(Pe2, t10, { id: e12, pointer: `/servers/${e12}` }))); + } + channels() { + return new U6(Object.entries(this._json.channels || {}).map(([e12, t10]) => this.createModel(Oe4, t10, { id: e12, address: e12, pointer: `/channels/${le4(e12)}` }))); + } + operations() { + const e12 = []; + return this.channels().forEach((t10) => e12.push(...t10.operations())), new J5(e12); + } + messages() { + const e12 = []; + return this.operations().forEach((t10) => t10.messages().forEach((t11) => !e12.some((e13) => e13.json() === t11.json()) && e12.push(t11))), new W5(e12); + } + schemas() { + return l7(this, Te, false); + } + securitySchemes() { + var e12; + return new Ae4(Object.entries((null === (e12 = this._json.components) || void 0 === e12 ? void 0 : e12.securitySchemes) || {}).map(([e13, t10]) => this.createModel(ve4, t10, { id: e13, pointer: `/components/securitySchemes/${e13}` }))); + } + components() { + return this.createModel(Ee4, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const e12 = this.servers().all(); + return this.components().servers().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new ie3(e12); + } + allChannels() { + const e12 = this.channels().all(); + return this.components().channels().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new U6(e12); + } + allOperations() { + const e12 = []; + return this.allChannels().forEach((t10) => e12.push(...t10.operations())), new J5(e12); + } + allMessages() { + const e12 = []; + return this.allOperations().forEach((t10) => t10.messages().forEach((t11) => !e12.some((e13) => e13.json() === t11.json()) && e12.push(t11))), this.components().messages().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new W5(e12); + } + allSchemas() { + return l7(this, Te, true); + } + extensions() { + return M6(this); + } + } + class ke3 extends t9 { + get(e12) { + return e12 = e12.startsWith("x-") ? e12 : `x-${e12}`, this.collections.find((t10) => t10.id() === e12); + } + } + class Me2 extends e11 { + id() { + return this._meta.id; + } + version() { + return "to implement"; + } + value() { + return this._json; + } + } + class Re2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.protocol() === e12); + } + extensions() { + const e12 = []; + return Object.entries(this._meta.originalData || {}).forEach(([t10, i8]) => { + _6.test(t10) && e12.push(f8(Me2, i8, { id: t10, pointer: `${this._meta.pointer}/${t10}`, asyncapi: this._meta.asyncapi })); + }), new ke3(e12); + } + } + class De2 extends e11 { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const e12 = Object.assign({}, this._json); + return delete e12.bindingVersion, e12; + } + extensions() { + return ze2(this); + } + } + class Ce extends e11 { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + extensions() { + return ze2(this); + } + } + class Ve extends t9 { + get(e12) { + return this.collections.find((t10) => t10.name() === e12); + } + } + class Ne2 extends e11 { + id() { + return this._meta.id; + } + name() { + return this._json.name; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + extensions() { + return ze2(this); + } + hasExternalDocs() { + return Be3(this); + } + externalDocs() { + return Qe(this); + } + } + class Fe extends e11 { + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + hasExternalDocs() { + return Be3(this); + } + externalDocs() { + return Qe(this); + } + tags() { + return Ke(this); + } + bindings() { + return function(e12) { + const t10 = e12.json("bindings") || {}; + return new Re2(Object.entries(t10 || {}).map(([t11, i8]) => f8(De2, i8, { protocol: t11, pointer: e12.jsonPath(`bindings/${t11}`) }, e12)), { originalData: t10, asyncapi: e12.meta("asyncapi"), pointer: e12.jsonPath("bindings") }); + }(this); + } + extensions() { + return ze2(this); + } + } + function Ue(e12) { + return Boolean(Le2(e12)); + } + function Le2(e12) { + return e12.json("description"); + } + function ze2(e12) { + const t10 = []; + return Object.entries(e12.json()).forEach(([i8, n8]) => { + _6.test(i8) && t10.push(f8(Me2, n8, { id: i8, pointer: e12.jsonPath(i8) }, e12)); + }), new ke3(t10); + } + function Be3(e12) { + return Object.keys(e12.json("externalDocs") || {}).length > 0; + } + function Qe(e12) { + if (Be3(e12)) + return new Ce(e12.json("externalDocs")); + } + function Ke(e12) { + return new Ve((e12.json("tags") || []).map((t10, i8) => f8(Ne2, t10, { pointer: e12.jsonPath(`tags/${i8}`) }, e12))); + } + class He extends e11 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return ze2(this); + } + } + class Ge extends e11 { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return ze2(this); + } + } + class We extends e11 { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const e12 = this._json.contact; + return e12 && this.createModel(He, e12, { pointer: this.jsonPath("contact") }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const e12 = this._json.license; + return e12 && this.createModel(Ge, e12, { pointer: this.jsonPath("license") }); + } + hasExternalDocs() { + return Be3(this); + } + externalDocs() { + return Qe(this); + } + tags() { + return Ke(this); + } + extensions() { + return ze2(this); + } + } + class Je extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + class Ze extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + class Ye extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Xe extends e11 { + constructor(e12, t10 = {}) { + var i8, n8; + super(e12, t10), this._json = e12, this._meta = t10, "object" == typeof e12 && "object" == typeof e12.schema ? (this._schemaObject = e12.schema, this._schemaFormat = e12.schemaFormat) : (this._schemaObject = e12, this._schemaFormat = K5(null === (n8 = null === (i8 = t10.asyncapi) || void 0 === i8 ? void 0 : i8.semver) || void 0 === n8 ? void 0 : n8.version)); + } + id() { + return this.$id() || this._meta.id || this._schemaObject[v8]; + } + $comment() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.$comment; + } + $id() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.$id; + } + $schema() { + var e12; + return "boolean" == typeof this._schemaObject ? "http://json-schema.org/draft-07/schema#" : null !== (e12 = this._schemaObject.$schema) && void 0 !== e12 ? e12 : "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + return "boolean" == typeof this._schemaObject ? this._schemaObject : void 0 === this._schemaObject.additionalItems || ("boolean" == typeof this._schemaObject.additionalItems ? this._schemaObject.additionalItems : this.createModel(Xe, this._schemaObject.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this })); + } + additionalProperties() { + return "boolean" == typeof this._schemaObject ? this._schemaObject : void 0 === this._schemaObject.additionalProperties || ("boolean" == typeof this._schemaObject.additionalProperties ? this._schemaObject.additionalProperties : this.createModel(Xe, this._schemaObject.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this })); + } + allOf() { + if ("boolean" != typeof this._schemaObject && Array.isArray(this._schemaObject.allOf)) + return this._schemaObject.allOf.map((e12, t10) => this.createModel(Xe, e12, { pointer: `${this._meta.pointer}/allOf/${t10}`, parent: this })); + } + anyOf() { + if ("boolean" != typeof this._schemaObject && Array.isArray(this._schemaObject.anyOf)) + return this._schemaObject.anyOf.map((e12, t10) => this.createModel(Xe, e12, { pointer: `${this._meta.pointer}/anyOf/${t10}`, parent: this })); + } + const() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.const; + } + contains() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.contains) + return this.createModel(Xe, this._schemaObject.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.contentEncoding; + } + contentMediaType() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.contentMediaType; + } + default() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.default; + } + definitions() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.definitions) + return Object.entries(this._schemaObject.definitions).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(Xe, i8, { pointer: `${this._meta.pointer}/definitions/${t10}`, parent: this }), e12), {}); + } + description() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.description; + } + dependencies() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.dependencies) + return Object.entries(this._schemaObject.dependencies).reduce((e12, [t10, i8]) => (e12[t10] = Array.isArray(i8) ? i8 : this.createModel(Xe, i8, { pointer: `${this._meta.pointer}/dependencies/${t10}`, parent: this }), e12), {}); + } + deprecated() { + return "boolean" != typeof this._schemaObject && (this._schemaObject.deprecated || false); + } + discriminator() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.discriminator; + } + else() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.else) + return this.createModel(Xe, this._schemaObject.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.enum; + } + examples() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.examples; + } + exclusiveMaximum() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.exclusiveMaximum; + } + exclusiveMinimum() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.exclusiveMinimum; + } + format() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.format; + } + isBooleanSchema() { + return "boolean" == typeof this._schemaObject; + } + if() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.if) + return this.createModel(Xe, this._schemaObject.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let e12 = this._meta.parent; + for (; e12; ) { + if (e12._json === this._schemaObject) + return true; + e12 = e12._meta.parent; + } + return false; + } + items() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.items) + return Array.isArray(this._schemaObject.items) ? this._schemaObject.items.map((e12, t10) => this.createModel(Xe, e12, { pointer: `${this._meta.pointer}/items/${t10}`, parent: this })) : this.createModel(Xe, this._schemaObject.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.maximum; + } + maxItems() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.maxItems; + } + maxLength() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.maxLength; + } + maxProperties() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.maxProperties; + } + minimum() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.minimum; + } + minItems() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.minItems; + } + minLength() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.minLength; + } + minProperties() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.minProperties; + } + multipleOf() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.multipleOf; + } + not() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.not) + return this.createModel(Xe, this._schemaObject.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if ("boolean" != typeof this._schemaObject && Array.isArray(this._schemaObject.oneOf)) + return this._schemaObject.oneOf.map((e12, t10) => this.createModel(Xe, e12, { pointer: `${this._meta.pointer}/oneOf/${t10}`, parent: this })); + } + pattern() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.pattern; + } + patternProperties() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.patternProperties) + return Object.entries(this._schemaObject.patternProperties).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(Xe, i8, { pointer: `${this._meta.pointer}/patternProperties/${t10}`, parent: this }), e12), {}); + } + properties() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.properties) + return Object.entries(this._schemaObject.properties).reduce((e12, [t10, i8]) => (e12[t10] = this.createModel(Xe, i8, { pointer: `${this._meta.pointer}/properties/${t10}`, parent: this }), e12), {}); + } + property(e12) { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.properties && "object" == typeof this._schemaObject.properties[e12]) + return this.createModel(Xe, this._schemaObject.properties[e12], { pointer: `${this._meta.pointer}/properties/${e12}`, parent: this }); + } + propertyNames() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.propertyNames) + return this.createModel(Xe, this._schemaObject.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + return "boolean" != typeof this._schemaObject && (this._schemaObject.readOnly || false); + } + required() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.required; + } + schemaFormat() { + return this._schemaFormat; + } + then() { + if ("boolean" != typeof this._schemaObject && "object" == typeof this._schemaObject.then) + return this.createModel(Xe, this._schemaObject.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.title; + } + type() { + if ("boolean" != typeof this._schemaObject) + return this._schemaObject.type; + } + uniqueItems() { + return "boolean" != typeof this._schemaObject && (this._schemaObject.uniqueItems || false); + } + writeOnly() { + return "boolean" != typeof this._schemaObject && (this._schemaObject.writeOnly || false); + } + hasExternalDocs() { + return Be3(this); + } + externalDocs() { + return Qe(this); + } + extensions() { + return ze2(this); + } + } + class et3 extends e11 { + id() { + return this._meta.id; + } + hasSchema() { + return true; + } + schema() { + return this.createModel(Xe, { type: "string", description: this._json.description, enum: this._json.enum, default: this._json.default, examples: this._json.examples }, { pointer: `${this._meta.pointer}` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + extensions() { + return ze2(this); + } + } + class tt3 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((e12) => e12.operations().filterByReceive().length > 0); + } + } + class it2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + filterBySend() { + return this.filterBy((e12) => e12.isSend()); + } + filterByReceive() { + return this.filterBy((e12) => e12.isReceive()); + } + } + class nt2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class rt extends e11 { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.availableScopes; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + extensions() { + return ze2(this); + } + } + class ot extends e11 { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (this._json.authorizationCode) + return new rt(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (this._json.clientCredentials) + return new rt(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (this._json.implicit) + return new rt(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (this._json.password) + return new rt(this._json.password); + } + extensions() { + return ze2(this); + } + } + class st2 extends e11 { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (this._json.flows) + return new ot(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return ze2(this); + } + } + class at2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.meta("id") === e12); + } + } + class pt extends e11 { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } + } + class ct extends Fe { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._meta.id; + } + operationId() { + return this._meta.id; + } + security() { + return (this._json.security || []).map((e12, t10) => { + const i8 = this.createModel(st2, e12, { id: "", pointer: this.jsonPath(`security/${t10}`) }), n8 = this.createModel(pt, { scheme: i8, scopes: e12.scopes }, { id: "", pointer: this.jsonPath(`security/${t10}`) }); + return new at2([n8]); + }); + } + } + class dt extends e11 { + id() { + return this._meta.id; + } + location() { + return this._json.location; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + extensions() { + return ze2(this); + } + } + class ft extends e11 { + id() { + return this._meta.id; + } + hasAddress() { + return !!this._json.address; + } + address() { + if (this._json.address) + return this.createModel(dt, this._json.address, { pointer: this.jsonPath("address") }); + } + hasChannel() { + return !!this._json.channel; + } + channel() { + if (this._json.channel) { + const e12 = this._json.channel[x7]; + return this.createModel(vt, this._json.channel, { id: e12, pointer: this.jsonPath("channel") }); + } + return this._json.channel; + } + messages() { + var e12; + return new tt3(Object.values(null !== (e12 = this._json.messages) && void 0 !== e12 ? e12 : {}).map((e13) => { + const t10 = e13[x7]; + return this.createModel(bt, e13, { id: t10, pointer: this.jsonPath(`messages/${t10}`) }); + })); + } + extensions() { + return ze2(this); + } + } + class lt2 extends ct { + action() { + return this._json.action; + } + isSend() { + return "send" === this.action(); + } + isReceive() { + return "receive" === this.action(); + } + servers() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.servers().forEach((i9) => { + const n8 = i9.json(); + t10.includes(n8) || (t10.push(n8), e12.push(i9)); + }); + }), new Je(e12); + } + channels() { + if (this._json.channel) { + const e12 = this._json.channel[x7]; + return new Ze([this.createModel(vt, this._json.channel, { id: e12, pointer: `/channels/${e12}` })]); + } + return new Ze([]); + } + messages() { + const e12 = []; + return Array.isArray(this._json.messages) ? (this._json.messages.forEach((t10, i8) => { + const n8 = t10[x7]; + e12.push(this.createModel(bt, t10, { id: n8, pointer: this.jsonPath(`messages/${i8}`) })); + }), new tt3(e12)) : (this.channels().forEach((t10) => { + e12.push(...t10.messages()); + }), new tt3(e12)); + } + hasReply() { + return !!this._json.reply; + } + reply() { + if (this._json.reply) + return this.createModel(ft, this._json.reply, { pointer: this.jsonPath("reply") }); + } + traits() { + return new nt2((this._json.traits || []).map((e12, t10) => this.createModel(ct, e12, { id: "", pointer: this.jsonPath(`traits/${t10}`) }))); + } + } + class ut extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class mt extends e11 { + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + extensions() { + return ze2(this); + } + } + class ht2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.name() === e12); + } + } + class yt extends e11 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return ze2(this); + } + } + class gt2 extends Fe { + id() { + var e12; + return this._meta.id || (null === (e12 = this.extensions().get(b8)) || void 0 === e12 ? void 0 : e12.value()); + } + hasMessageId() { + return false; + } + hasSchemaFormat() { + return false; + } + schemaFormat() { + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (this._json.correlationId) + return this.createModel(mt, this._json.correlationId, { pointer: this.jsonPath("correlationId") }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var e12, t10; + return this._json.contentType || (null === (t10 = null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed) || void 0 === t10 ? void 0 : t10.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (this._json.headers) + return this.createModel(Xe, this._json.headers, { pointer: this.jsonPath("headers") }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + examples() { + return new ht2((this._json.examples || []).map((e12, t10) => this.createModel(yt, e12, { pointer: this.jsonPath(`examples/${t10}`) }))); + } + } + class bt extends gt2 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (this._json.payload) + return this.createModel(Xe, this._json.payload, { pointer: this.jsonPath("payload") }); + } + hasSchemaFormat() { + return this.hasPayload(); + } + schemaFormat() { + var e12; + if (this.hasSchemaFormat()) + return null === (e12 = this.payload()) || void 0 === e12 ? void 0 : e12.schemaFormat(); + } + servers() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.servers().forEach((i9) => { + const n8 = i9.json(); + t10.includes(n8) || (t10.push(n8), e12.push(i9)); + }); + }), new Je(e12); + } + channels() { + var e12, t10; + const i8 = this._json[x7], n8 = [], r9 = []; + return this.operations().forEach((e13) => { + e13.channels().forEach((e14) => { + const t11 = e14.json(); + r9.includes(t11) || (r9.push(t11), n8.push(e14)); + }); + }), Object.entries((null === (t10 = null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed) || void 0 === t10 ? void 0 : t10.channels) || {}).forEach(([e13, t11]) => { + const o8 = this.createModel(vt, t11, { id: e13, pointer: `/channels/${e13}` }); + !r9.includes(t11) && o8.messages().some((e14) => e14[x7] === i8) && (r9.push(t11), n8.push(o8)); + }), new Ze(n8); + } + operations() { + var e12, t10; + const i8 = this._json[x7], n8 = []; + return Object.entries((null === (t10 = null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed) || void 0 === t10 ? void 0 : t10.operations) || {}).forEach(([e13, t11]) => { + const r9 = this.createModel(lt2, t11, { id: e13, pointer: `/operations/${e13}` }); + r9.messages().some((e14) => e14[x7] === i8) && n8.push(r9); + }), new it2(n8); + } + traits() { + return new ut((this._json.traits || []).map((e12, t10) => this.createModel(gt2, e12, { id: "", pointer: this.jsonPath(`traits/${t10}`) }))); + } + } + class vt extends Fe { + id() { + return this._meta.id; + } + address() { + return this._json.address; + } + servers() { + var e12, t10, i8; + const n8 = [], r9 = null !== (e12 = this._json.servers) && void 0 !== e12 ? e12 : []; + return Object.entries(null !== (i8 = null === (t10 = this._meta.asyncapi) || void 0 === t10 ? void 0 : t10.parsed.servers) && void 0 !== i8 ? i8 : {}).forEach(([e13, t11]) => { + (0 === r9.length || r9.includes(t11)) && n8.push(this.createModel(xt, t11, { id: e13, pointer: `/servers/${e13}` })); + }), new Je(n8); + } + operations() { + var e12, t10, i8; + const n8 = []; + return Object.entries(null !== (i8 = null === (t10 = null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed) || void 0 === t10 ? void 0 : t10.operations) && void 0 !== i8 ? i8 : {}).forEach(([e13, t11]) => { + t11.channel[x7] === this._json[x7] && n8.push(this.createModel(lt2, t11, { id: e13, pointer: `/operations/${e13}` })); + }), new it2(n8); + } + messages() { + var e12; + return new tt3(Object.entries(null !== (e12 = this._json.messages) && void 0 !== e12 ? e12 : {}).map(([e13, t10]) => this.createModel(bt, t10, { id: e13, pointer: this.jsonPath(`messages/${e13}`) }))); + } + parameters() { + var e12; + return new Ye(Object.entries(null !== (e12 = this._json.parameters) && void 0 !== e12 ? e12 : {}).map(([e13, t10]) => this.createModel(et3, t10, { id: e13, pointer: this.jsonPath(`parameters/${e13}`) }))); + } + } + class jt extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class $t extends e11 { + id() { + return this._meta.id; + } + hasDescription() { + return Ue(this); + } + description() { + return Le2(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return ze2(this); + } + } + class xt extends Fe { + id() { + return this._meta.id; + } + url() { + let e12 = this.host(); + e12.endsWith("/") || (e12 = `${e12}/`); + let t10 = this.pathname() || ""; + return t10.startsWith("/") && (t10 = t10.substring(1)), `${this.protocol()}://${e12}${t10}`; + } + host() { + return this._json.host; + } + protocol() { + return this._json.protocol; + } + hasPathname() { + return !!this._json.pathname; + } + pathname() { + return this._json.pathname; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + channels() { + var e12, t10; + const i8 = []; + return Object.entries((null === (t10 = null === (e12 = this._meta.asyncapi) || void 0 === e12 ? void 0 : e12.parsed) || void 0 === t10 ? void 0 : t10.channels) || {}).forEach(([e13, t11]) => { + const n8 = t11.servers || []; + (0 === n8.length || n8.includes(this._json)) && i8.push(this.createModel(vt, t11, { id: e13, pointer: `/channels/${le4(e13)}` })); + }), new Ze(i8); + } + operations() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.operations().forEach((i9) => { + const n8 = i9.json(); + t10.includes(n8) || (e12.push(i9), t10.push(n8)); + }); + }), new it2(e12); + } + messages() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.messages().forEach((i9) => { + const n8 = i9.json(); + t10.includes(n8) || (e12.push(i9), t10.push(n8)); + }); + }), new tt3(e12); + } + variables() { + return new jt(Object.entries(this._json.variables || {}).map(([e12, t10]) => this.createModel($t, t10, { id: e12, pointer: this.jsonPath(`variables/${e12}`) }))); + } + security() { + return (this._json.security || []).map((e12, t10) => { + const i8 = this.createModel(st2, e12, { id: "", pointer: this.jsonPath(`security/${t10}`) }), n8 = this.createModel(pt, { scheme: i8, scopes: e12.scopes }, { id: "", pointer: this.jsonPath(`security/${t10}`) }); + return new at2([n8]); + }); + } + } + class _t2 extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class wt extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class St extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Pt extends t9 { + get(e12) { + return this.collections.find((t10) => t10.id() === e12); + } + } + class Ot extends t9 { + get(e12) { + return this.collections.find((t10) => t10.meta("id") === e12); + } + } + class Tt extends t9 { + get(e12) { + return this.collections.find((t10) => t10.meta("id") === e12); + } + } + class At extends e11 { + servers() { + return this.createCollection("servers", Je, xt); + } + channels() { + return this.createCollection("channels", Ze, vt); + } + operations() { + return this.createCollection("operations", it2, lt2); + } + messages() { + return this.createCollection("messages", tt3, bt); + } + schemas() { + return this.createCollection("schemas", wt, Xe); + } + channelParameters() { + return this.createCollection("parameters", Ye, et3); + } + serverVariables() { + return this.createCollection("serverVariables", jt, $t); + } + operationTraits() { + return this.createCollection("operationTraits", nt2, ct); + } + messageTraits() { + return this.createCollection("messageTraits", ut, gt2); + } + replies() { + return this.createCollection("replies", St, ft); + } + replyAddresses() { + return this.createCollection("replyAddresses", Pt, dt); + } + correlationIds() { + return this.createCollection("correlationIds", Ot, mt); + } + securitySchemes() { + return this.createCollection("securitySchemes", _t2, st2); + } + tags() { + return this.createCollection("tags", Ve, Ne2); + } + externalDocs() { + return this.createCollection("externalDocs", Tt, Ce); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return ze2(this); + } + isEmpty() { + return 0 === Object.keys(this._json).length; + } + createCollection(e12, t10, i8) { + const n8 = []; + return Object.entries(this._json[e12] || {}).forEach(([t11, r9]) => { + n8.push(this.createModel(i8, r9, { id: t11, pointer: `/components/${e12}/${le4(t11)}` })); + }), new t10(n8); + } + createBindings(e12) { + return Object.entries(this._json[e12] || {}).reduce((t10, [i8, n8]) => { + const r9 = n8 || {}, o8 = this.meta("asyncapi"), s8 = `components/${e12}/${i8}`; + return t10[i8] = new Re2(Object.entries(r9).map(([e13, t11]) => this.createModel(De2, t11, { protocol: e13, pointer: `${s8}/${e13}` })), { originalData: r9, asyncapi: o8, pointer: s8 }), t10; + }, {}); + } + } + class It extends e11 { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(We, this._json.info, { pointer: "/info" }); + } + servers() { + return new Je(Object.entries(this._json.servers || {}).map(([e12, t10]) => this.createModel(xt, t10, { id: e12, pointer: `/servers/${le4(e12)}` }))); + } + channels() { + return new Ze(Object.entries(this._json.channels || {}).map(([e12, t10]) => this.createModel(vt, t10, { id: e12, pointer: `/channels/${le4(e12)}` }))); + } + operations() { + return new it2(Object.entries(this._json.operations || {}).map(([e12, t10]) => this.createModel(lt2, t10, { id: e12, pointer: `/operations/${le4(e12)}` }))); + } + messages() { + const e12 = [], t10 = []; + return this.channels().forEach((i8) => { + i8.messages().forEach((i9) => { + const n8 = i9.json(); + t10.includes(n8) || (t10.push(n8), e12.push(i9)); + }); + }), new tt3(e12); + } + schemas() { + return l7(this, wt, false); + } + securitySchemes() { + var e12; + return new _t2(Object.entries((null === (e12 = this._json.components) || void 0 === e12 ? void 0 : e12.securitySchemes) || {}).map(([e13, t10]) => this.createModel(st2, t10, { id: e13, pointer: `/components/securitySchemes/${e13}` }))); + } + components() { + return this.createModel(At, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const e12 = this.servers().all(); + return this.components().servers().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new Je(e12); + } + allChannels() { + const e12 = this.channels().all(); + return this.components().channels().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new Ze(e12); + } + allOperations() { + const e12 = this.operations().all(); + return this.components().operations().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new it2(e12); + } + allMessages() { + const e12 = this.messages().all(); + return this.components().messages().forEach((t10) => !e12.some((e13) => e13.json() === t10.json()) && e12.push(t10)), new tt3(e12); + } + allSchemas() { + return l7(this, wt, true); + } + extensions() { + return ze2(this); + } + } + const Et = "$ref:$"; + function qt(e12, t10, i8, n8, r9) { + let o8 = e12, s8 = Et; + if (void 0 !== t10) { + o8 = e12[String(t10)]; + const i9 = t10 ? `.${t10}` : ""; + s8 = n8.get(e12) + (Array.isArray(e12) ? `[${t10}]` : i9); + } + n8.set(o8, s8), r9.set(s8, o8); + const a8 = r9.get(o8); + if (a8 && (e12[String(t10)] = a8), o8 !== Et && a8 !== Et || (e12[String(t10)] = i8), o8 === Object(o8)) + for (const e13 in o8) + qt(o8, e13, i8, n8, r9); + } + function kt(e12) { + switch (e12.semver.major) { + case 2: + return new qe2(e12.parsed, { asyncapi: e12, pointer: "/" }); + case 3: + return new It(e12.parsed, { asyncapi: e12, pointer: "/" }); + default: + throw new Error(`Unsupported AsyncAPI version: ${e12.semver.version}`); + } + } + function Mt(e12) { + return function(e13) { + return !!e13 && (e13 instanceof qe2 || e13 instanceof It || !(!e13 || "function" != typeof e13.json) && 3 === e13.json()[g7]); + }(e12) ? e12 : function(e13) { + return "object" == typeof e13 && null !== e13 && Boolean(e13[h8]); + }(e12) ? kt(oe4(e12, e12)) : function(e13) { + let t10 = e13; + if ("string" == typeof e13) + try { + t10 = JSON.parse(e13); + } catch (e14) { + return; + } + if (function(e14) { + try { + return "object" == typeof (e14 = "string" == typeof e14 ? JSON.parse(e14) : e14) && null !== e14 && Boolean(e14[h8]) && Boolean(e14[y7]); + } catch (e15) { + return false; + } + }(t10)) + return t10 = Object.assign({}, t10), delete t10[String(y7)], qt(e13, void 0, e13, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()), kt(oe4(t10, e13)); + }(e12); + } + function Rt(e12) { + for (const [t10, i8] of Object.entries(null != e12 ? e12 : {})) + i8[x7] || (i8[x7] = t10), Dt(i8.messages); + } + function Dt(e12) { + for (const [t10, i8] of Object.entries(null != e12 ? e12 : {})) + i8[x7] || (i8[x7] = t10); + } + class Ct { + static get version() { + return "1.3.9"; + } + static toString() { + return "JavaScript Expression Parser (JSEP) v" + Ct.version; + } + static addUnaryOp(e12) { + return Ct.max_unop_len = Math.max(e12.length, Ct.max_unop_len), Ct.unary_ops[e12] = 1, Ct; + } + static addBinaryOp(e12, t10, i8) { + return Ct.max_binop_len = Math.max(e12.length, Ct.max_binop_len), Ct.binary_ops[e12] = t10, i8 ? Ct.right_associative.add(e12) : Ct.right_associative.delete(e12), Ct; + } + static addIdentifierChar(e12) { + return Ct.additional_identifier_chars.add(e12), Ct; + } + static addLiteral(e12, t10) { + return Ct.literals[e12] = t10, Ct; + } + static removeUnaryOp(e12) { + return delete Ct.unary_ops[e12], e12.length === Ct.max_unop_len && (Ct.max_unop_len = Ct.getMaxKeyLen(Ct.unary_ops)), Ct; + } + static removeAllUnaryOps() { + return Ct.unary_ops = {}, Ct.max_unop_len = 0, Ct; + } + static removeIdentifierChar(e12) { + return Ct.additional_identifier_chars.delete(e12), Ct; + } + static removeBinaryOp(e12) { + return delete Ct.binary_ops[e12], e12.length === Ct.max_binop_len && (Ct.max_binop_len = Ct.getMaxKeyLen(Ct.binary_ops)), Ct.right_associative.delete(e12), Ct; + } + static removeAllBinaryOps() { + return Ct.binary_ops = {}, Ct.max_binop_len = 0, Ct; + } + static removeLiteral(e12) { + return delete Ct.literals[e12], Ct; + } + static removeAllLiterals() { + return Ct.literals = {}, Ct; + } + get char() { + return this.expr.charAt(this.index); + } + get code() { + return this.expr.charCodeAt(this.index); + } + constructor(e12) { + this.expr = e12, this.index = 0; + } + static parse(e12) { + return new Ct(e12).parse(); + } + static getMaxKeyLen(e12) { + return Math.max(0, ...Object.keys(e12).map((e13) => e13.length)); + } + static isDecimalDigit(e12) { + return e12 >= 48 && e12 <= 57; + } + static binaryPrecedence(e12) { + return Ct.binary_ops[e12] || 0; + } + static isIdentifierStart(e12) { + return e12 >= 65 && e12 <= 90 || e12 >= 97 && e12 <= 122 || e12 >= 128 && !Ct.binary_ops[String.fromCharCode(e12)] || Ct.additional_identifier_chars.has(String.fromCharCode(e12)); + } + static isIdentifierPart(e12) { + return Ct.isIdentifierStart(e12) || Ct.isDecimalDigit(e12); + } + throwError(e12) { + const t10 = new Error(e12 + " at character " + this.index); + throw t10.index = this.index, t10.description = e12, t10; + } + runHook(e12, t10) { + if (Ct.hooks[e12]) { + const i8 = { context: this, node: t10 }; + return Ct.hooks.run(e12, i8), i8.node; + } + return t10; + } + searchHook(e12) { + if (Ct.hooks[e12]) { + const t10 = { context: this }; + return Ct.hooks[e12].find(function(e13) { + return e13.call(t10.context, t10), t10.node; + }), t10.node; + } + } + gobbleSpaces() { + let e12 = this.code; + for (; e12 === Ct.SPACE_CODE || e12 === Ct.TAB_CODE || e12 === Ct.LF_CODE || e12 === Ct.CR_CODE; ) + e12 = this.expr.charCodeAt(++this.index); + this.runHook("gobble-spaces"); + } + parse() { + this.runHook("before-all"); + const e12 = this.gobbleExpressions(), t10 = 1 === e12.length ? e12[0] : { type: Ct.COMPOUND, body: e12 }; + return this.runHook("after-all", t10); + } + gobbleExpressions(e12) { + let t10, i8, n8 = []; + for (; this.index < this.expr.length; ) + if (t10 = this.code, t10 === Ct.SEMCOL_CODE || t10 === Ct.COMMA_CODE) + this.index++; + else if (i8 = this.gobbleExpression()) + n8.push(i8); + else if (this.index < this.expr.length) { + if (t10 === e12) + break; + this.throwError('Unexpected "' + this.char + '"'); + } + return n8; + } + gobbleExpression() { + const e12 = this.searchHook("gobble-expression") || this.gobbleBinaryExpression(); + return this.gobbleSpaces(), this.runHook("after-expression", e12); + } + gobbleBinaryOp() { + this.gobbleSpaces(); + let e12 = this.expr.substr(this.index, Ct.max_binop_len), t10 = e12.length; + for (; t10 > 0; ) { + if (Ct.binary_ops.hasOwnProperty(e12) && (!Ct.isIdentifierStart(this.code) || this.index + e12.length < this.expr.length && !Ct.isIdentifierPart(this.expr.charCodeAt(this.index + e12.length)))) + return this.index += t10, e12; + e12 = e12.substr(0, --t10); + } + return false; + } + gobbleBinaryExpression() { + let e12, t10, i8, n8, r9, o8, s8, a8, p8; + if (o8 = this.gobbleToken(), !o8) + return o8; + if (t10 = this.gobbleBinaryOp(), !t10) + return o8; + for (r9 = { value: t10, prec: Ct.binaryPrecedence(t10), right_a: Ct.right_associative.has(t10) }, s8 = this.gobbleToken(), s8 || this.throwError("Expected expression after " + t10), n8 = [o8, r9, s8]; t10 = this.gobbleBinaryOp(); ) { + if (i8 = Ct.binaryPrecedence(t10), 0 === i8) { + this.index -= t10.length; + break; + } + r9 = { value: t10, prec: i8, right_a: Ct.right_associative.has(t10) }, p8 = t10; + const a9 = (e13) => r9.right_a && e13.right_a ? i8 > e13.prec : i8 <= e13.prec; + for (; n8.length > 2 && a9(n8[n8.length - 2]); ) + s8 = n8.pop(), t10 = n8.pop().value, o8 = n8.pop(), e12 = { type: Ct.BINARY_EXP, operator: t10, left: o8, right: s8 }, n8.push(e12); + e12 = this.gobbleToken(), e12 || this.throwError("Expected expression after " + p8), n8.push(r9, e12); + } + for (a8 = n8.length - 1, e12 = n8[a8]; a8 > 1; ) + e12 = { type: Ct.BINARY_EXP, operator: n8[a8 - 1].value, left: n8[a8 - 2], right: e12 }, a8 -= 2; + return e12; + } + gobbleToken() { + let e12, t10, i8, n8; + if (this.gobbleSpaces(), n8 = this.searchHook("gobble-token"), n8) + return this.runHook("after-token", n8); + if (e12 = this.code, Ct.isDecimalDigit(e12) || e12 === Ct.PERIOD_CODE) + return this.gobbleNumericLiteral(); + if (e12 === Ct.SQUOTE_CODE || e12 === Ct.DQUOTE_CODE) + n8 = this.gobbleStringLiteral(); + else if (e12 === Ct.OBRACK_CODE) + n8 = this.gobbleArray(); + else { + for (t10 = this.expr.substr(this.index, Ct.max_unop_len), i8 = t10.length; i8 > 0; ) { + if (Ct.unary_ops.hasOwnProperty(t10) && (!Ct.isIdentifierStart(this.code) || this.index + t10.length < this.expr.length && !Ct.isIdentifierPart(this.expr.charCodeAt(this.index + t10.length)))) { + this.index += i8; + const e13 = this.gobbleToken(); + return e13 || this.throwError("missing unaryOp argument"), this.runHook("after-token", { type: Ct.UNARY_EXP, operator: t10, argument: e13, prefix: true }); + } + t10 = t10.substr(0, --i8); + } + Ct.isIdentifierStart(e12) ? (n8 = this.gobbleIdentifier(), Ct.literals.hasOwnProperty(n8.name) ? n8 = { type: Ct.LITERAL, value: Ct.literals[n8.name], raw: n8.name } : n8.name === Ct.this_str && (n8 = { type: Ct.THIS_EXP })) : e12 === Ct.OPAREN_CODE && (n8 = this.gobbleGroup()); + } + return n8 ? (n8 = this.gobbleTokenProperty(n8), this.runHook("after-token", n8)) : this.runHook("after-token", false); + } + gobbleTokenProperty(e12) { + this.gobbleSpaces(); + let t10 = this.code; + for (; t10 === Ct.PERIOD_CODE || t10 === Ct.OBRACK_CODE || t10 === Ct.OPAREN_CODE || t10 === Ct.QUMARK_CODE; ) { + let i8; + if (t10 === Ct.QUMARK_CODE) { + if (this.expr.charCodeAt(this.index + 1) !== Ct.PERIOD_CODE) + break; + i8 = true, this.index += 2, this.gobbleSpaces(), t10 = this.code; + } + this.index++, t10 === Ct.OBRACK_CODE ? ((e12 = { type: Ct.MEMBER_EXP, computed: true, object: e12, property: this.gobbleExpression() }).property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), t10 = this.code, t10 !== Ct.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t10 === Ct.OPAREN_CODE ? e12 = { type: Ct.CALL_EXP, arguments: this.gobbleArguments(Ct.CPAREN_CODE), callee: e12 } : (t10 === Ct.PERIOD_CODE || i8) && (i8 && this.index--, this.gobbleSpaces(), e12 = { type: Ct.MEMBER_EXP, computed: false, object: e12, property: this.gobbleIdentifier() }), i8 && (e12.optional = true), this.gobbleSpaces(), t10 = this.code; + } + return e12; + } + gobbleNumericLiteral() { + let e12, t10, i8 = ""; + for (; Ct.isDecimalDigit(this.code); ) + i8 += this.expr.charAt(this.index++); + if (this.code === Ct.PERIOD_CODE) + for (i8 += this.expr.charAt(this.index++); Ct.isDecimalDigit(this.code); ) + i8 += this.expr.charAt(this.index++); + if (e12 = this.char, "e" === e12 || "E" === e12) { + for (i8 += this.expr.charAt(this.index++), e12 = this.char, "+" !== e12 && "-" !== e12 || (i8 += this.expr.charAt(this.index++)); Ct.isDecimalDigit(this.code); ) + i8 += this.expr.charAt(this.index++); + Ct.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + i8 + this.char + ")"); + } + return t10 = this.code, Ct.isIdentifierStart(t10) ? this.throwError("Variable names cannot start with a number (" + i8 + this.char + ")") : (t10 === Ct.PERIOD_CODE || 1 === i8.length && i8.charCodeAt(0) === Ct.PERIOD_CODE) && this.throwError("Unexpected period"), { type: Ct.LITERAL, value: parseFloat(i8), raw: i8 }; + } + gobbleStringLiteral() { + let e12 = ""; + const t10 = this.index, i8 = this.expr.charAt(this.index++); + let n8 = false; + for (; this.index < this.expr.length; ) { + let t11 = this.expr.charAt(this.index++); + if (t11 === i8) { + n8 = true; + break; + } + if ("\\" === t11) + switch (t11 = this.expr.charAt(this.index++), t11) { + case "n": + e12 += "\n"; + break; + case "r": + e12 += "\r"; + break; + case "t": + e12 += " "; + break; + case "b": + e12 += "\b"; + break; + case "f": + e12 += "\f"; + break; + case "v": + e12 += "\v"; + break; + default: + e12 += t11; + } + else + e12 += t11; + } + return n8 || this.throwError('Unclosed quote after "' + e12 + '"'), { type: Ct.LITERAL, value: e12, raw: this.expr.substring(t10, this.index) }; + } + gobbleIdentifier() { + let e12 = this.code, t10 = this.index; + for (Ct.isIdentifierStart(e12) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e12 = this.code, Ct.isIdentifierPart(e12)); ) + this.index++; + return { type: Ct.IDENTIFIER, name: this.expr.slice(t10, this.index) }; + } + gobbleArguments(e12) { + const t10 = []; + let i8 = false, n8 = 0; + for (; this.index < this.expr.length; ) { + this.gobbleSpaces(); + let r9 = this.code; + if (r9 === e12) { + i8 = true, this.index++, e12 === Ct.CPAREN_CODE && n8 && n8 >= t10.length && this.throwError("Unexpected token " + String.fromCharCode(e12)); + break; + } + if (r9 === Ct.COMMA_CODE) { + if (this.index++, n8++, n8 !== t10.length) { + if (e12 === Ct.CPAREN_CODE) + this.throwError("Unexpected token ,"); + else if (e12 === Ct.CBRACK_CODE) + for (let e13 = t10.length; e13 < n8; e13++) + t10.push(null); + } + } else if (t10.length !== n8 && 0 !== n8) + this.throwError("Expected comma"); + else { + const e13 = this.gobbleExpression(); + e13 && e13.type !== Ct.COMPOUND || this.throwError("Expected comma"), t10.push(e13); + } + } + return i8 || this.throwError("Expected " + String.fromCharCode(e12)), t10; + } + gobbleGroup() { + this.index++; + let e12 = this.gobbleExpressions(Ct.CPAREN_CODE); + if (this.code === Ct.CPAREN_CODE) + return this.index++, 1 === e12.length ? e12[0] : !!e12.length && { type: Ct.SEQUENCE_EXP, expressions: e12 }; + this.throwError("Unclosed ("); + } + gobbleArray() { + return this.index++, { type: Ct.ARRAY_EXP, elements: this.gobbleArguments(Ct.CBRACK_CODE) }; + } + } + const Vt = new class { + add(e12, t10, i8) { + if ("string" != typeof arguments[0]) + for (let e13 in arguments[0]) + this.add(e13, arguments[0][e13], arguments[1]); + else + (Array.isArray(e12) ? e12 : [e12]).forEach(function(e13) { + this[e13] = this[e13] || [], t10 && this[e13][i8 ? "unshift" : "push"](t10); + }, this); + } + run(e12, t10) { + this[e12] = this[e12] || [], this[e12].forEach(function(e13) { + e13.call(t10 && t10.context ? t10.context : t10, t10); + }); + } + }(); + Object.assign(Ct, { hooks: Vt, plugins: new class { + constructor(e12) { + this.jsep = e12, this.registered = {}; + } + register() { + for (var e12 = arguments.length, t10 = new Array(e12), i8 = 0; i8 < e12; i8++) + t10[i8] = arguments[i8]; + t10.forEach((e13) => { + if ("object" != typeof e13 || !e13.name || !e13.init) + throw new Error("Invalid JSEP plugin format"); + this.registered[e13.name] || (e13.init(this.jsep), this.registered[e13.name] = e13); + }); + } + }(Ct), COMPOUND: "Compound", SEQUENCE_EXP: "SequenceExpression", IDENTIFIER: "Identifier", MEMBER_EXP: "MemberExpression", LITERAL: "Literal", THIS_EXP: "ThisExpression", CALL_EXP: "CallExpression", UNARY_EXP: "UnaryExpression", BINARY_EXP: "BinaryExpression", ARRAY_EXP: "ArrayExpression", TAB_CODE: 9, LF_CODE: 10, CR_CODE: 13, SPACE_CODE: 32, PERIOD_CODE: 46, COMMA_CODE: 44, SQUOTE_CODE: 39, DQUOTE_CODE: 34, OPAREN_CODE: 40, CPAREN_CODE: 41, OBRACK_CODE: 91, CBRACK_CODE: 93, QUMARK_CODE: 63, SEMCOL_CODE: 59, COLON_CODE: 58, unary_ops: { "-": 1, "!": 1, "~": 1, "+": 1 }, binary_ops: { "||": 1, "&&": 2, "|": 3, "^": 4, "&": 5, "==": 6, "!=": 6, "===": 6, "!==": 6, "<": 7, ">": 7, "<=": 7, ">=": 7, "<<": 8, ">>": 8, ">>>": 8, "+": 9, "-": 9, "*": 10, "/": 10, "%": 10 }, right_associative: /* @__PURE__ */ new Set(), additional_identifier_chars: /* @__PURE__ */ new Set(["$", "_"]), literals: { true: true, false: false, null: null }, this_str: "this" }), Ct.max_unop_len = Ct.getMaxKeyLen(Ct.unary_ops), Ct.max_binop_len = Ct.getMaxKeyLen(Ct.binary_ops); + const Nt = (e12) => new Ct(e12).parse(), Ft = Object.getOwnPropertyNames(class { + }); + Object.getOwnPropertyNames(Ct).filter((e12) => !Ft.includes(e12) && void 0 === Nt[e12]).forEach((e12) => { + Nt[e12] = Ct[e12]; + }), Nt.Jsep = Ct; + var Ut = { name: "ternary", init(e12) { + e12.hooks.add("after-expression", function(t10) { + if (t10.node && this.code === e12.QUMARK_CODE) { + this.index++; + const i8 = t10.node, n8 = this.gobbleExpression(); + if (n8 || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === e12.COLON_CODE) { + this.index++; + const r9 = this.gobbleExpression(); + if (r9 || this.throwError("Expected expression"), t10.node = { type: "ConditionalExpression", test: i8, consequent: n8, alternate: r9 }, i8.operator && e12.binary_ops[i8.operator] <= 0.9) { + let n9 = i8; + for (; n9.right.operator && e12.binary_ops[n9.right.operator] <= 0.9; ) + n9 = n9.right; + t10.node.test = n9.right, n9.right = t10.node, t10.node = i8; + } + } else + this.throwError("Expected :"); + } + }); + } }; + Nt.plugins.register(Ut); + var Lt = { name: "regex", init(e12) { + e12.hooks.add("gobble-token", function(t10) { + if (47 === this.code) { + const i8 = ++this.index; + let n8 = false; + for (; this.index < this.expr.length; ) { + if (47 === this.code && !n8) { + const n9 = this.expr.slice(i8, this.index); + let r9, o8 = ""; + for (; ++this.index < this.expr.length; ) { + const e13 = this.code; + if (!(e13 >= 97 && e13 <= 122 || e13 >= 65 && e13 <= 90 || e13 >= 48 && e13 <= 57)) + break; + o8 += this.char; + } + try { + r9 = new RegExp(n9, o8); + } catch (e13) { + this.throwError(e13.message); + } + return t10.node = { type: e12.LITERAL, value: r9, raw: this.expr.slice(i8 - 1, this.index) }, t10.node = this.gobbleTokenProperty(t10.node), t10.node; + } + this.code === e12.OBRACK_CODE ? n8 = true : n8 && this.code === e12.CBRACK_CODE && (n8 = false), this.index += 92 === this.code ? 2 : 1; + } + this.throwError("Unclosed Regex"); + } + }); + } }; + const zt = { name: "assignment", assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|="]), updateOperators: [43, 45], assignmentPrecedence: 0.9, init(e12) { + const t10 = [e12.IDENTIFIER, e12.MEMBER_EXP]; + function i8(e13) { + zt.assignmentOperators.has(e13.operator) ? (e13.type = "AssignmentExpression", i8(e13.left), i8(e13.right)) : e13.operator || Object.values(e13).forEach((e14) => { + e14 && "object" == typeof e14 && i8(e14); + }); + } + zt.assignmentOperators.forEach((t11) => e12.addBinaryOp(t11, zt.assignmentPrecedence, true)), e12.hooks.add("gobble-token", function(e13) { + const i9 = this.code; + zt.updateOperators.some((e14) => e14 === i9 && e14 === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, e13.node = { type: "UpdateExpression", operator: 43 === i9 ? "++" : "--", argument: this.gobbleTokenProperty(this.gobbleIdentifier()), prefix: true }, e13.node.argument && t10.includes(e13.node.argument.type) || this.throwError(`Unexpected ${e13.node.operator}`)); + }), e12.hooks.add("after-token", function(e13) { + if (e13.node) { + const i9 = this.code; + zt.updateOperators.some((e14) => e14 === i9 && e14 === this.expr.charCodeAt(this.index + 1)) && (t10.includes(e13.node.type) || this.throwError(`Unexpected ${e13.node.operator}`), this.index += 2, e13.node = { type: "UpdateExpression", operator: 43 === i9 ? "++" : "--", argument: e13.node, prefix: false }); + } + }), e12.hooks.add("after-expression", function(e13) { + e13.node && i8(e13.node); + }); + } }; + Nt.plugins.register(Lt, zt); + const Bt = { evalAst(e12, t10) { + switch (e12.type) { + case "BinaryExpression": + case "LogicalExpression": + return Bt.evalBinaryExpression(e12, t10); + case "Compound": + return Bt.evalCompound(e12, t10); + case "ConditionalExpression": + return Bt.evalConditionalExpression(e12, t10); + case "Identifier": + return Bt.evalIdentifier(e12, t10); + case "Literal": + return Bt.evalLiteral(e12, t10); + case "MemberExpression": + return Bt.evalMemberExpression(e12, t10); + case "UnaryExpression": + return Bt.evalUnaryExpression(e12, t10); + case "ArrayExpression": + return Bt.evalArrayExpression(e12, t10); + case "CallExpression": + return Bt.evalCallExpression(e12, t10); + case "AssignmentExpression": + return Bt.evalAssignmentExpression(e12, t10); + default: + throw SyntaxError("Unexpected expression", e12); + } + }, evalBinaryExpression: (e12, t10) => ({ "||": (e13, t11) => e13 || t11(), "&&": (e13, t11) => e13 && t11(), "|": (e13, t11) => e13 | t11(), "^": (e13, t11) => e13 ^ t11(), "&": (e13, t11) => e13 & t11(), "==": (e13, t11) => e13 == t11(), "!=": (e13, t11) => e13 != t11(), "===": (e13, t11) => e13 === t11(), "!==": (e13, t11) => e13 !== t11(), "<": (e13, t11) => e13 < t11(), ">": (e13, t11) => e13 > t11(), "<=": (e13, t11) => e13 <= t11(), ">=": (e13, t11) => e13 >= t11(), "<<": (e13, t11) => e13 << t11(), ">>": (e13, t11) => e13 >> t11(), ">>>": (e13, t11) => e13 >>> t11(), "+": (e13, t11) => e13 + t11(), "-": (e13, t11) => e13 - t11(), "*": (e13, t11) => e13 * t11(), "/": (e13, t11) => e13 / t11(), "%": (e13, t11) => e13 % t11() })[e12.operator](Bt.evalAst(e12.left, t10), () => Bt.evalAst(e12.right, t10)), evalCompound(e12, t10) { + let i8; + for (let n8 = 0; n8 < e12.body.length; n8++) { + "Identifier" === e12.body[n8].type && ["var", "let", "const"].includes(e12.body[n8].name) && e12.body[n8 + 1] && "AssignmentExpression" === e12.body[n8 + 1].type && (n8 += 1); + const r9 = e12.body[n8]; + i8 = Bt.evalAst(r9, t10); + } + return i8; + }, evalConditionalExpression: (e12, t10) => Bt.evalAst(e12.test, t10) ? Bt.evalAst(e12.consequent, t10) : Bt.evalAst(e12.alternate, t10), evalIdentifier(e12, t10) { + if (e12.name in t10) + return t10[e12.name]; + throw ReferenceError(`${e12.name} is not defined`); + }, evalLiteral: (e12) => e12.value, evalMemberExpression(e12, t10) { + if ("Identifier" === e12.property.type && "constructor" === e12.property.name || "Identifier" === e12.object.type && "constructor" === e12.object.name) + throw new Error("'constructor' property is disabled"); + const i8 = e12.computed ? Bt.evalAst(e12.property) : e12.property.name, n8 = Bt.evalAst(e12.object, t10), r9 = n8[i8]; + if ("function" == typeof r9) { + if (n8 === Function && "bind" === i8) + throw new Error("Function.prototype.bind is disabled"); + if (n8 === Function && ("call" === i8 || "apply" === i8)) + throw new Error("Function.prototype.call and Function.prototype.apply are disabled"); + return r9 === Function ? r9 : r9.bind(n8); + } + return r9; + }, evalUnaryExpression: (e12, t10) => ({ "-": (e13) => -Bt.evalAst(e13, t10), "!": (e13) => !Bt.evalAst(e13, t10), "~": (e13) => ~Bt.evalAst(e13, t10), "+": (e13) => +Bt.evalAst(e13, t10) })[e12.operator](e12.argument), evalArrayExpression: (e12, t10) => e12.elements.map((e13) => Bt.evalAst(e13, t10)), evalCallExpression(e12, t10) { + const i8 = e12.arguments.map((e13) => Bt.evalAst(e13, t10)), n8 = Bt.evalAst(e12.callee, t10); + if (n8 === Function) + throw new Error("Function constructor is disabled"); + return n8(...i8); + }, evalAssignmentExpression(e12, t10) { + if ("Identifier" !== e12.left.type) + throw SyntaxError("Invalid left-hand side in assignment"); + const i8 = e12.left.name; + if ("__proto__" === i8) + throw new Error("Assignment to __proto__ is disabled"); + const n8 = Bt.evalAst(e12.right, t10); + return t10[i8] = n8, t10[i8]; + } }; + function Qt(e12, t10) { + return (e12 = e12.slice()).push(t10), e12; + } + function Kt(e12, t10) { + return (t10 = t10.slice()).unshift(e12), t10; + } + class Ht extends Error { + constructor(e12) { + super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = true, this.value = e12, this.name = "NewError"; + } + } + function Gt(e12, t10, i8, n8, r9) { + if (!(this instanceof Gt)) + try { + return new Gt(e12, t10, i8, n8, r9); + } catch (e13) { + if (!e13.avoidNew) + throw e13; + return e13.value; + } + "string" == typeof e12 && (r9 = n8, n8 = i8, i8 = t10, t10 = e12, e12 = null); + const o8 = e12 && "object" == typeof e12; + if (e12 = e12 || {}, this.json = e12.json || i8, this.path = e12.path || t10, this.resultType = e12.resultType || "value", this.flatten = e12.flatten || false, this.wrap = !Object.hasOwn(e12, "wrap") || e12.wrap, this.sandbox = e12.sandbox || {}, this.eval = void 0 === e12.eval ? "safe" : e12.eval, this.ignoreEvalErrors = void 0 !== e12.ignoreEvalErrors && e12.ignoreEvalErrors, this.parent = e12.parent || null, this.parentProperty = e12.parentProperty || null, this.callback = e12.callback || n8 || null, this.otherTypeCallback = e12.otherTypeCallback || r9 || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }, false !== e12.autostart) { + const n9 = { path: o8 ? e12.path : t10 }; + o8 ? "json" in e12 && (n9.json = e12.json) : n9.json = i8; + const r10 = this.evaluate(n9); + if (!r10 || "object" != typeof r10) + throw new Ht(r10); + return r10; + } + } + Gt.prototype.evaluate = function(e12, t10, i8, n8) { + let r9 = this.parent, o8 = this.parentProperty, { flatten: s8, wrap: a8 } = this; + if (this.currResultType = this.resultType, this.currEval = this.eval, this.currSandbox = this.sandbox, i8 = i8 || this.callback, this.currOtherTypeCallback = n8 || this.otherTypeCallback, t10 = t10 || this.json, (e12 = e12 || this.path) && "object" == typeof e12 && !Array.isArray(e12)) { + if (!e12.path && "" !== e12.path) + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + if (!Object.hasOwn(e12, "json")) + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + ({ json: t10 } = e12), s8 = Object.hasOwn(e12, "flatten") ? e12.flatten : s8, this.currResultType = Object.hasOwn(e12, "resultType") ? e12.resultType : this.currResultType, this.currSandbox = Object.hasOwn(e12, "sandbox") ? e12.sandbox : this.currSandbox, a8 = Object.hasOwn(e12, "wrap") ? e12.wrap : a8, this.currEval = Object.hasOwn(e12, "eval") ? e12.eval : this.currEval, i8 = Object.hasOwn(e12, "callback") ? e12.callback : i8, this.currOtherTypeCallback = Object.hasOwn(e12, "otherTypeCallback") ? e12.otherTypeCallback : this.currOtherTypeCallback, r9 = Object.hasOwn(e12, "parent") ? e12.parent : r9, o8 = Object.hasOwn(e12, "parentProperty") ? e12.parentProperty : o8, e12 = e12.path; + } + if (r9 = r9 || null, o8 = o8 || null, Array.isArray(e12) && (e12 = Gt.toPathString(e12)), !e12 && "" !== e12 || !t10) + return; + const p8 = Gt.toPathArray(e12); + "$" === p8[0] && p8.length > 1 && p8.shift(), this._hasParentSelector = null; + const c8 = this._trace(p8, t10, ["$"], r9, o8, i8).filter(function(e13) { + return e13 && !e13.isParentSelector; + }); + return c8.length ? a8 || 1 !== c8.length || c8[0].hasArrExpr ? c8.reduce((e13, t11) => { + const i9 = this._getPreferredOutput(t11); + return s8 && Array.isArray(i9) ? e13 = e13.concat(i9) : e13.push(i9), e13; + }, []) : this._getPreferredOutput(c8[0]) : a8 ? [] : void 0; + }, Gt.prototype._getPreferredOutput = function(e12) { + const t10 = this.currResultType; + switch (t10) { + case "all": { + const t11 = Array.isArray(e12.path) ? e12.path : Gt.toPathArray(e12.path); + return e12.pointer = Gt.toPointer(t11), e12.path = "string" == typeof e12.path ? e12.path : Gt.toPathString(e12.path), e12; + } + case "value": + case "parent": + case "parentProperty": + return e12[t10]; + case "path": + return Gt.toPathString(e12[t10]); + case "pointer": + return Gt.toPointer(e12.path); + default: + throw new TypeError("Unknown result type"); + } + }, Gt.prototype._handleCallback = function(e12, t10, i8) { + if (t10) { + const n8 = this._getPreferredOutput(e12); + e12.path = "string" == typeof e12.path ? e12.path : Gt.toPathString(e12.path), t10(n8, i8, e12); + } + }, Gt.prototype._trace = function(e12, t10, i8, n8, r9, o8, s8, a8) { + let p8; + if (!e12.length) + return p8 = { path: i8, value: t10, parent: n8, parentProperty: r9, hasArrExpr: s8 }, this._handleCallback(p8, o8, "value"), p8; + const c8 = e12[0], d8 = e12.slice(1), f9 = []; + function l8(e13) { + Array.isArray(e13) ? e13.forEach((e14) => { + f9.push(e14); + }) : f9.push(e13); + } + if (("string" != typeof c8 || a8) && t10 && Object.hasOwn(t10, c8)) + l8(this._trace(d8, t10[c8], Qt(i8, c8), t10, c8, o8, s8)); + else if ("*" === c8) + this._walk(t10, (e13) => { + l8(this._trace(d8, t10[e13], Qt(i8, e13), t10, e13, o8, true, true)); + }); + else if (".." === c8) + l8(this._trace(d8, t10, i8, n8, r9, o8, s8)), this._walk(t10, (n9) => { + "object" == typeof t10[n9] && l8(this._trace(e12.slice(), t10[n9], Qt(i8, n9), t10, n9, o8, true)); + }); + else { + if ("^" === c8) + return this._hasParentSelector = true, { path: i8.slice(0, -1), expr: d8, isParentSelector: true }; + if ("~" === c8) + return p8 = { path: Qt(i8, c8), value: r9, parent: n8, parentProperty: null }, this._handleCallback(p8, o8, "property"), p8; + if ("$" === c8) + l8(this._trace(d8, t10, i8, null, null, o8, s8)); + else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(c8)) + l8(this._slice(c8, d8, t10, i8, n8, r9, o8)); + else if (0 === c8.indexOf("?(")) { + if (false === this.currEval) + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + const e13 = c8.replace(/^\?\((.*?)\)$/u, "$1"), s9 = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e13); + s9 ? this._walk(t10, (e14) => { + const a9 = [s9[2]], p9 = s9[1] ? t10[e14][s9[1]] : t10[e14]; + this._trace(a9, p9, i8, n8, r9, o8, true).length > 0 && l8(this._trace(d8, t10[e14], Qt(i8, e14), t10, e14, o8, true)); + }) : this._walk(t10, (s10) => { + this._eval(e13, t10[s10], s10, i8, n8, r9) && l8(this._trace(d8, t10[s10], Qt(i8, s10), t10, s10, o8, true)); + }); + } else if ("(" === c8[0]) { + if (false === this.currEval) + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + l8(this._trace(Kt(this._eval(c8, t10, i8.at(-1), i8.slice(0, -1), n8, r9), d8), t10, i8, n8, r9, o8, s8)); + } else if ("@" === c8[0]) { + let e13 = false; + const s9 = c8.slice(1, -2); + switch (s9) { + case "scalar": + t10 && ["object", "function"].includes(typeof t10) || (e13 = true); + break; + case "boolean": + case "string": + case "undefined": + case "function": + typeof t10 === s9 && (e13 = true); + break; + case "integer": + !Number.isFinite(t10) || t10 % 1 || (e13 = true); + break; + case "number": + Number.isFinite(t10) && (e13 = true); + break; + case "nonFinite": + "number" != typeof t10 || Number.isFinite(t10) || (e13 = true); + break; + case "object": + t10 && typeof t10 === s9 && (e13 = true); + break; + case "array": + Array.isArray(t10) && (e13 = true); + break; + case "other": + e13 = this.currOtherTypeCallback(t10, i8, n8, r9); + break; + case "null": + null === t10 && (e13 = true); + break; + default: + throw new TypeError("Unknown value type " + s9); + } + if (e13) + return p8 = { path: i8, value: t10, parent: n8, parentProperty: r9 }, this._handleCallback(p8, o8, "value"), p8; + } else if ("`" === c8[0] && t10 && Object.hasOwn(t10, c8.slice(1))) { + const e13 = c8.slice(1); + l8(this._trace(d8, t10[e13], Qt(i8, e13), t10, e13, o8, s8, true)); + } else if (c8.includes(",")) { + const e13 = c8.split(","); + for (const s9 of e13) + l8(this._trace(Kt(s9, d8), t10, i8, n8, r9, o8, true)); + } else + !a8 && t10 && Object.hasOwn(t10, c8) && l8(this._trace(d8, t10[c8], Qt(i8, c8), t10, c8, o8, s8, true)); + } + if (this._hasParentSelector) + for (let e13 = 0; e13 < f9.length; e13++) { + const i9 = f9[e13]; + if (i9 && i9.isParentSelector) { + const a9 = this._trace(i9.expr, t10, i9.path, n8, r9, o8, s8); + if (Array.isArray(a9)) { + f9[e13] = a9[0]; + const t11 = a9.length; + for (let i10 = 1; i10 < t11; i10++) + e13++, f9.splice(e13, 0, a9[i10]); + } else + f9[e13] = a9; + } + } + return f9; + }, Gt.prototype._walk = function(e12, t10) { + if (Array.isArray(e12)) { + const i8 = e12.length; + for (let e13 = 0; e13 < i8; e13++) + t10(e13); + } else + e12 && "object" == typeof e12 && Object.keys(e12).forEach((e13) => { + t10(e13); + }); + }, Gt.prototype._slice = function(e12, t10, i8, n8, r9, o8, s8) { + if (!Array.isArray(i8)) + return; + const a8 = i8.length, p8 = e12.split(":"), c8 = p8[2] && Number.parseInt(p8[2]) || 1; + let d8 = p8[0] && Number.parseInt(p8[0]) || 0, f9 = p8[1] && Number.parseInt(p8[1]) || a8; + d8 = d8 < 0 ? Math.max(0, d8 + a8) : Math.min(a8, d8), f9 = f9 < 0 ? Math.max(0, f9 + a8) : Math.min(a8, f9); + const l8 = []; + for (let e13 = d8; e13 < f9; e13 += c8) + this._trace(Kt(e13, t10), i8, n8, r9, o8, s8, true).forEach((e14) => { + l8.push(e14); + }); + return l8; + }, Gt.prototype._eval = function(e12, t10, i8, n8, r9, o8) { + this.currSandbox._$_parentProperty = o8, this.currSandbox._$_parent = r9, this.currSandbox._$_property = i8, this.currSandbox._$_root = this.json, this.currSandbox._$_v = t10; + const s8 = e12.includes("@path"); + s8 && (this.currSandbox._$_path = Gt.toPathString(n8.concat([i8]))); + const a8 = this.currEval + "Script:" + e12; + if (!Gt.cache[a8]) { + let t11 = e12.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1"); + if (s8 && (t11 = t11.replaceAll("@path", "_$_path")), "safe" === this.currEval || true === this.currEval || void 0 === this.currEval) + Gt.cache[a8] = new this.safeVm.Script(t11); + else if ("native" === this.currEval) + Gt.cache[a8] = new this.vm.Script(t11); + else if ("function" == typeof this.currEval && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) { + const e13 = this.currEval; + Gt.cache[a8] = new e13(t11); + } else { + if ("function" != typeof this.currEval) + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + Gt.cache[a8] = { runInNewContext: (e13) => this.currEval(t11, e13) }; + } + } + try { + return Gt.cache[a8].runInNewContext(this.currSandbox); + } catch (t11) { + if (this.ignoreEvalErrors) + return false; + throw new Error("jsonPath: " + t11.message + ": " + e12); + } + }, Gt.cache = {}, Gt.toPathString = function(e12) { + const t10 = e12, i8 = t10.length; + let n8 = "$"; + for (let e13 = 1; e13 < i8; e13++) + /^(~|\^|@.*?\(\))$/u.test(t10[e13]) || (n8 += /^[0-9*]+$/u.test(t10[e13]) ? "[" + t10[e13] + "]" : "['" + t10[e13] + "']"); + return n8; + }, Gt.toPointer = function(e12) { + const t10 = e12, i8 = t10.length; + let n8 = ""; + for (let e13 = 1; e13 < i8; e13++) + /^(~|\^|@.*?\(\))$/u.test(t10[e13]) || (n8 += "/" + t10[e13].toString().replaceAll("~", "~0").replaceAll("/", "~1")); + return n8; + }, Gt.toPathArray = function(e12) { + const { cache: t10 } = Gt; + if (t10[e12]) + return t10[e12].concat(); + const i8 = [], n8 = e12.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(e13, t11) { + return "[#" + (i8.push(t11) - 1) + "]"; + }).replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function(e13, t11) { + return "['" + t11.replaceAll(".", "%@%").replaceAll("~", "%%@@%%") + "']"; + }).replaceAll("~", ";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ";").replaceAll("%@%", ".").replaceAll("%%@@%%", "~").replaceAll(/(?:;)?(\^+)(?:;)?/gu, function(e13, t11) { + return ";" + t11.split("").join(";") + ";"; + }).replaceAll(/;;;|;;/gu, ";..;").replaceAll(/;$|'?\]|'$/gu, "").split(";").map(function(e13) { + const t11 = e13.match(/#(\d+)/u); + return t11 && t11[1] ? i8[t11[1]] : e13; + }); + return t10[e12] = n8, t10[e12].concat(); + }, Gt.prototype.safeVm = { Script: class { + constructor(e12) { + this.code = e12, this.ast = Nt(this.code); + } + runInNewContext(e12) { + const t10 = { ...e12 }; + return Bt.evalAst(this.ast, t10); + } + } }, Gt.prototype.vm = { Script: class { + constructor(e12) { + this.code = e12; + } + runInNewContext(e12) { + let t10 = this.code; + const i8 = Object.keys(e12), n8 = []; + !function(t11, i9) { + const n9 = t11.length; + for (let o9 = 0; o9 < n9; o9++) + r10 = t11[o9], "function" == typeof e12[r10] && i9.push(t11.splice(o9--, 1)[0]); + var r10; + }(i8, n8); + const r9 = i8.map((t11) => e12[t11]); + t10 = n8.reduce((t11, i9) => { + let n9 = e12[i9].toString(); + return /function/u.test(n9) || (n9 = "function " + n9), "var " + i9 + "=" + n9 + ";" + t11; + }, "") + t10, /(['"])use strict\1/u.test(t10) || i8.includes("arguments") || (t10 = "var arguments = undefined;" + t10), t10 = t10.replace(/;\s*$/u, ""); + const o8 = t10.lastIndexOf(";"), s8 = o8 > -1 ? t10.slice(0, o8 + 1) + " return " + t10.slice(o8 + 1) : " return " + t10; + return new Function(...i8, s8)(...r9); + } + } }; + const Wt = ["$.channels.*.[publish,subscribe]", "$.components.channels.*.[publish,subscribe]", "$.channels.*.[publish,subscribe].message", "$.channels.*.[publish,subscribe].message.oneOf.*", "$.components.channels.*.[publish,subscribe].message", "$.components.channels.*.[publish,subscribe].message.oneOf.*", "$.components.messages.*"]; + const Jt = ["$.operations.*", "$.operations.*.channel.messages.*", "$.operations.*.messages.*", "$.components.operations.*", "$.components.operations.*.channel.messages.*", "$.components.operations.*.messages.*", "$.channels.*.messages.*", "$.components.channels.*.messages.*", "$.components.messages.*"]; + function Zt(e12, t10) { + const i8 = e12.json(), n8 = { document: i8, hasCircular: false, inventory: t10, visited: /* @__PURE__ */ new Set() }; + Yt(i8, [], null, "", n8), n8.hasCircular && ae4($5, true, e12); + } + function Yt(e12, t10, i8, n8, r9) { + if ("object" == typeof e12 && e12 && !r9.visited.has(e12)) { + if (r9.visited.add(e12), Array.isArray(e12) && e12.forEach((i9, n9) => Yt(i9, [...t10, n9], e12, n9, r9)), "$ref" in e12) { + r9.hasCircular = true; + const o8 = function(e13, t11, i9) { + const n9 = function(e14) { + return function(e15) { + return e15.split("/").filter(Boolean).map(ue4); + }((t12 = e14).startsWith("#") ? t12.substring(1) : t12); + var t12; + }(e13.$ref), r10 = i9.inventory.findAssociatedItemForPath(t11, true); + if (null === r10) + return me4(i9.document, n9); + if (r10) { + const e14 = function(e15, t12, i10 = 0) { + let n10, r11, o10; + for (n10 = i10; n10 < e15.length - t12.length + 1; ++n10) { + for (r11 = true, o10 = 0; o10 < t12.length; ++o10) + if (e15[n10 + o10] !== t12[o10]) { + r11 = false; + break; + } + if (r11) + return n10; + } + return -1; + }(t11, n9); + let o9; + return o9 = -1 === e14 ? [...t11.slice(0, t11.length - r10.path.length), ...n9] : t11.slice(0, e14 + n9.length), me4(i9.document, o9); + } + }(e12, t10, r9); + o8 && (i8[n8] = o8); + } else + for (const i9 in e12) + Yt(e12[i9], [...t10, i9], e12, i9, r9); + r9.visited.delete(e12); + } + } + var Xt = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + const ei = ["$.channels.*.[publish,subscribe].message", "$.channels.*.[publish,subscribe].message.oneOf.*", "$.components.channels.*.[publish,subscribe].message", "$.components.channels.*.[publish,subscribe].message.oneOf.*", "$.components.messages.*"], ti = ["$.channels.*.messages.*.payload", "$.channels.*.messages.*.headers", "$.components.channels.*.messages.*.payload", "$.components.channels.*.messages.*.headers", "$.operations.*.messages.*.payload", "$.operations.*.messages.*.headers", "$.components.operations.*.messages.*.payload", "$.components.operations.*.messages.*.headers", "$.components.messages.*.payload", "$.components.messages.*.headers.*", "$.components.schemas.*"]; + function ii(e12) { + return e12.slice(3).slice(0, -2).split("']['"); + } + function ni(e12) { + !function(e13) { + e13.components().messages().forEach((e14) => { + void 0 === e14.name() && ae4(b8, e14.id(), e14); + }); + }(e12), function(e13) { + let t10 = 0; + e13.messages().forEach((e14) => { + var i8; + void 0 === e14.name() && void 0 === (null === (i8 = e14.extensions().get(b8)) || void 0 === i8 ? void 0 : i8.value()) && ae4(b8, e14.id() || ``, e14); + }); + }(e12), function(e13) { + e13.components().schemas().forEach((e14) => { + ae4(v8, e14.id(), e14); + }); + }(e12), function(e13) { + e13.components().channelParameters().forEach((e14) => { + const t10 = e14.schema(); + t10 && !t10.id() && ae4(v8, e14.id(), t10); + }); + }(e12), function(e13) { + e13.channels().forEach((e14) => { + e14.parameters().forEach((e15) => { + const t10 = e15.schema(); + t10 && !t10.id() && ae4(v8, e15.id(), t10); + }); + }); + }(e12), function(e13) { + let t10 = 0; + p7(e13, function(e14) { + const i8 = e14.json(), n8 = void 0 !== i8.schema ? i8.schema : i8; + e14.id() || pe4(v8, ``, n8); + }); + }(e12); + } + function ri(e12) { + oi(e12.json()) && ae4($5, true, e12); + } + function oi(e12) { + if (e12 && "object" == typeof e12 && !Array.isArray(e12)) { + if (Object.prototype.hasOwnProperty.call(e12, "$ref")) + return true; + for (const t10 in e12) + if (oi(e12[t10])) + return true; + } + return false; + } + var si = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function ai(e12, t10, i8, n8, r9) { + return si(this, void 0, void 0, function* () { + switch (i8.semver.major) { + case 2: + return function(e13, t11, i9, n9, r10) { + return si(this, void 0, void 0, function* () { + ri(t11), r10.applyTraits && function(e14, t12) { + const i10 = /* @__PURE__ */ new Set(); + t12.forEach((t13) => { + Gt({ path: t13, json: e14, resultType: "value", callback(e15) { + i10.has(e15) || (i10.add(e15), function(e16) { + if (Array.isArray(e16.traits)) + for (const t14 of e16.traits) + for (const i11 in t14) + e16[String(i11)] = ce4(e16[String(i11)], t14[String(i11)]); + }(e15)); + } }); + }); + }(i9.parsed, Wt), r10.parseSchemas && (yield function(e14, t12) { + return Xt(this, void 0, void 0, function* () { + const i10 = K5(t12.semver.version), n10 = [], r11 = /* @__PURE__ */ new Set(); + return ei.forEach((e15) => { + Gt({ path: e15, json: t12.parsed, resultType: "all", callback(e16) { + const o8 = e16.value; + if (r11.has(o8)) + return; + r11.add(o8); + const s8 = o8.payload; + if (!s8) + return; + const a8 = Q5(o8.schemaFormat, t12.semver.version); + n10.push({ input: { asyncapi: t12, data: s8, meta: { message: o8 }, path: [...ii(e16.path), "payload"], schemaFormat: a8, defaultSchemaFormat: i10 }, value: o8 }); + } }); + }), Promise.all(n10.map((t13) => function(e15, t14) { + return Xt(this, void 0, void 0, function* () { + const i11 = t14.input.data; + i11 !== (t14.value.payload = yield B6(e15, t14.input)) && (t14.value[j6] = i11); + }); + }(e14, t13))); + }); + }(e13, i9)), n9 && Zt(t11, n9), ni(t11); + }); + }(e12, t10, i8, n8, r9); + case 3: + return function(e13, t11, i9, n9, r10) { + return si(this, void 0, void 0, function* () { + ri(t11), r10.applyTraits && function(e14, t12) { + const i10 = /* @__PURE__ */ new Set(); + t12.forEach((t13) => { + Gt({ path: t13, json: e14, resultType: "value", callback(e15) { + i10.has(e15) || (i10.add(e15), function(e16) { + if (!Array.isArray(e16.traits)) + return; + const t14 = Object.assign({}, e16); + for (const t15 in e16) + delete e16[t15]; + for (const i11 of [...t14.traits, t14]) + for (const t15 in i11) + e16[String(t15)] = ce4(e16[String(t15)], i11[String(t15)]); + }(e15)); + } }); + }); + }(i9.parsed, Jt), r10.parseSchemas && (yield function(e14, t12) { + return Xt(this, void 0, void 0, function* () { + const i10 = K5(t12.semver.version), n10 = [], r11 = /* @__PURE__ */ new Set(); + return ti.forEach((e15) => { + Gt({ path: e15, json: t12.parsed, resultType: "all", callback(e16) { + const o8 = e16.value; + if (r11.has(o8)) + return; + r11.add(o8); + const s8 = o8.schema; + if (!s8) + return; + let a8 = o8.schemaFormat; + a8 && (a8 = Q5(o8.schemaFormat, t12.semver.version), n10.push({ input: { asyncapi: t12, data: s8, meta: { message: o8 }, path: [...ii(e16.path), "schema"], schemaFormat: a8, defaultSchemaFormat: i10 }, value: o8 })); + } }); + }), Promise.all(n10.map((t13) => function(e15, t14) { + var i11; + return Xt(this, void 0, void 0, function* () { + const n11 = t14.input.data, r12 = yield B6(e15, t14.input); + void 0 !== (null === (i11 = t14.value) || void 0 === i11 ? void 0 : i11.schema) ? t14.value.schema = r12 : t14.value = r12, n11 !== r12 && (t14.value[j6] = n11); + }); + }(e14, t13))); + }); + }(e13, i9)), n9 && Zt(t11, n9), ni(t11); + }); + }(e12, t10, i8, n8, r9); + } + }); + } + var pi = i7(63083), ci = i7(69248); + class di extends Map { + filterByMajorVersions(e12) { + return new di([...this.entries()].filter((t10) => e12.includes(t10[0].split(".")[0]))); + } + excludeByVersions(e12) { + return new di([...this.entries()].filter((t10) => !e12.includes(t10[0]))); + } + find(e12) { + return this.get(ui(e12)); + } + formats() { + return [...this.values()]; + } + } + const fi = new di(Object.entries(u7.schemas).reverse().map(([e12]) => [e12, li(e12)])); + function li(e12) { + const t10 = (t11) => function(e13, t12) { + if (!t12) + return false; + const i9 = String(t12.asyncapi); + return de4(t12) && "asyncapi" in t12 && function(e14) { + const t13 = se4(e14); + return new RegExp(`^(${t13.major})\\.(${t13.minor})\\.(0|[1-9][0-9]*)$`).test(e14); + }(i9) && e13 === ui(i9); + }(e12, t11), i8 = se4(e12); + return t10.displayName = `AsyncAPI ${i8.major}.${i8.minor}.x`, t10; + } + const ui = function(e12) { + const t10 = se4(e12); + return `${t10.major}.${t10.minor}.0`; + }; + function mi(e12) { + return "oneOf" === e12.keyword || "required" === e12.keyword && "$ref" === e12.params.missingProperty; + } + function hi(e12) { + for (let t10 = 0; t10 < e12.length; t10++) { + const i8 = e12[t10]; + "additionalProperties" === i8.keyword ? i8.instancePath = `${i8.instancePath}/${String(i8.params.additionalProperty)}` : "required" === i8.keyword && "$ref" === i8.params.missingProperty && (e12.splice(t10, 1), t10--); + } + for (let t10 = 0; t10 < e12.length; t10++) { + const i8 = e12[t10]; + t10 + 1 < e12.length && e12[t10 + 1].instancePath === i8.instancePath ? (e12.splice(t10 + 1, 1), t10--) : t10 > 0 && mi(i8) && e12[t10 - 1].instancePath.startsWith(i8.instancePath) && (e12.splice(t10, 1), t10--); + } + } + const yi = /* @__PURE__ */ new Map(); + function gi(e12, t10) { + const i8 = t10 ? `${e12}-resolved` : `${e12}-unresolved`, n8 = yi.get(i8); + if (n8) + return n8; + let r9 = function(e13) { + return JSON.parse(JSON.stringify(m7().schemas[e13])); + }(e12); + delete r9.definitions["http://json-schema.org/draft-07/schema"], delete r9.definitions["http://json-schema.org/draft-04/schema"], r9.$id = r9.$id.replace("asyncapi.json", `asyncapi-${t10 ? "resolved" : "unresolved"}.json`); + const { major: o8 } = se4(e12); + return t10 && 3 === o8 && (r9 = function(e13, t11) { + var i9, n9, r10, o9, s8, a8, p8, c8; + const d8 = e13.definitions[`http://asyncapi.com/definitions/${t11}/channel.json`]; + (null === (n9 = null === (i9 = null == d8 ? void 0 : d8.properties) || void 0 === i9 ? void 0 : i9.servers) || void 0 === n9 ? void 0 : n9.items) && (d8.properties.servers.items.$ref = `http://asyncapi.com/definitions/${t11}/server.json`); + const f9 = e13.definitions[`http://asyncapi.com/definitions/${t11}/operation.json`]; + (null === (r10 = null == f9 ? void 0 : f9.properties) || void 0 === r10 ? void 0 : r10.channel) && (f9.properties.channel.$ref = `http://asyncapi.com/definitions/${t11}/channel.json`), (null === (s8 = null === (o9 = null == f9 ? void 0 : f9.properties) || void 0 === o9 ? void 0 : o9.messages) || void 0 === s8 ? void 0 : s8.items) && (f9.properties.messages.items.$ref = `http://asyncapi.com/definitions/${t11}/messageObject.json`); + const l8 = e13.definitions[`http://asyncapi.com/definitions/${t11}/operationReply.json`]; + return (null === (a8 = null == l8 ? void 0 : l8.properties) || void 0 === a8 ? void 0 : a8.channel) && (l8.properties.channel.$ref = `http://asyncapi.com/definitions/${t11}/channel.json`), (null === (c8 = null === (p8 = null == l8 ? void 0 : l8.properties) || void 0 === p8 ? void 0 : p8.messages) || void 0 === c8 ? void 0 : c8.items) && (l8.properties.messages.items.$ref = `http://asyncapi.com/definitions/${t11}/messageObject.json`), e13; + }(r9, e12)), yi.set(i8, r9), r9; + } + const bi = 'Property "$ref" is not expected to be here', vi = (0, ne4.createRulesetFunction)({ input: null, options: { type: "object", properties: { resolved: { type: "boolean" } }, required: ["resolved"] } }, (e12, t10, i8) => { + var n8; + const r9 = null === (n8 = i8.document) || void 0 === n8 ? void 0 : n8.formats; + if (!r9) + return; + const o8 = t10.resolved, s8 = function(e13, t11) { + for (const [i9, n9] of fi) + if (e13.has(n9)) + return gi(i9, t11); + }(r9, o8); + if (!s8) + return; + const a8 = (0, ci.wQ)(e12, { allErrors: true, schema: s8, prepareResults: o8 ? hi : void 0 }, i8); + return Array.isArray(a8) ? function(e13, t11) { + return t11 ? e13.filter((e14) => e14.message !== bi) : e13.filter((e14) => e14.message === bi).map((e14) => (e14.message = "Referencing in this place is not allowed", e14)); + }(a8, o8) : void 0; + }), ji = (0, ne4.createRulesetFunction)({ input: null, options: null }, (e12, t10, { document: i8, documentInventory: n8 }) => { + i8.__documentInventory = n8; + }), $i = (0, ne4.createRulesetFunction)({ input: null, options: null }, (e12) => de4(e12) && "string" == typeof e12.asyncapi ? w6.includes(e12.asyncapi) ? void 0 : [{ message: `Version "${e12.asyncapi}" is not supported. Please use "${S6}" (latest) version of the specification.`, path: [] }] : [{ message: 'This is not an AsyncAPI document. The "asyncapi" field as string is missing.', path: [] }]), xi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { components: { type: "object" } }, required: ["components"] }, options: null }, (e12, t10, i8) => { + const n8 = e12.components, r9 = []; + return Object.keys(n8).forEach((e13) => { + if ("securitySchemes" === e13) + return; + const t11 = n8[e13]; + if (!de4(t11)) + return; + const o8 = (0, ci.fK)(t11, { reusableObjectsLocation: `#/components/${e13}` }, i8); + o8 && Array.isArray(o8) && r9.push(...o8); + }), r9; + }), _i = { description: "Core AsyncAPI x.x.x ruleset.", formats: fi.formats(), rules: { "asyncapi-is-asyncapi": { description: "The input must be a document with a supported version of AsyncAPI.", formats: [() => true], message: "{{error}}", severity: "error", recommended: true, given: "$", then: { function: $i } }, "asyncapi-latest-version": { description: "Checking if the AsyncAPI document is using the latest version.", message: `The latest version of AsyncAPi is not used. It is recommended update to the "${S6}" version.`, recommended: true, severity: "info", given: "$.asyncapi", then: { function: ci.wQ, functionOptions: { schema: { const: S6 } } } }, "asyncapi-document-resolved": { description: "Checking if the AsyncAPI document has valid resolved structure.", message: "{{error}}", severity: "error", recommended: true, given: "$", then: { function: vi, functionOptions: { resolved: true } } }, "asyncapi-document-unresolved": { description: "Checking if the AsyncAPI document has valid unresolved structure.", message: "{{error}}", severity: "error", recommended: true, resolved: false, given: "$", then: { function: vi, functionOptions: { resolved: false } } }, "asyncapi-internal": { description: "That rule is internal to extend Spectral functionality for Parser purposes.", recommended: true, given: "$", then: { function: ji } } } }, wi = { description: "Recommended AsyncAPI x.x.x ruleset.", formats: fi.filterByMajorVersions(["2"]).formats(), rules: { "asyncapi-id": { description: 'AsyncAPI document should have "id" field.', recommended: true, given: "$", then: { field: "id", function: ci.vN } }, "asyncapi-defaultContentType": { description: 'AsyncAPI document should have "defaultContentType" field.', recommended: true, given: "$", then: { field: "defaultContentType", function: ci.vN } }, "asyncapi-info-description": { description: 'Info "description" should be present and non-empty string.', recommended: true, given: "$", then: { field: "info.description", function: ci.vN } }, "asyncapi-info-contact": { description: 'Info object should have "contact" object.', recommended: true, given: "$", then: { field: "info.contact", function: ci.vN } }, "asyncapi-info-contact-properties": { description: 'Contact object should have "name", "url" and "email" fields.', recommended: true, given: "$.info.contact", then: [{ field: "name", function: ci.vN }, { field: "url", function: ci.vN }, { field: "email", function: ci.vN }] }, "asyncapi-info-license": { description: 'Info object should have "license" object.', recommended: true, given: "$", then: { field: "info.license", function: ci.vN } }, "asyncapi-info-license-url": { description: 'License object should have "url" field.', recommended: false, given: "$", then: { field: "info.license.url", function: ci.vN } }, "asyncapi-servers": { description: 'AsyncAPI document should have non-empty "servers" object.', recommended: true, given: "$", then: { field: "servers", function: ci.wQ, functionOptions: { schema: { type: "object", minProperties: 1 }, allErrors: true } } }, "asyncapi-unused-component": { description: "Potentially unused component has been detected in AsyncAPI document.", formats: fi.filterByMajorVersions(["2"]).formats(), recommended: true, resolved: false, severity: "info", given: "$", then: { function: xi } } } }; + function Si(e12) { + if ("string" != typeof e12) + return []; + const t10 = e12.match(/{(.+?)}/g); + return t10 && 0 !== t10.length ? t10.map((e13) => e13.slice(1, -1)) : []; + } + function Pi(e12 = [], t10 = {}) { + return Object.keys(t10).length ? e12.filter((e13) => !Object.prototype.hasOwnProperty.call(t10, e13)) : e12; + } + function Oi(e12 = [], t10 = {}) { + return e12.length ? Object.keys(t10).filter((t11) => !e12.includes(t11)) : Object.keys(t10); + } + const Ti = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { parameters: { type: "object" } }, required: ["parameters"] }, options: null }, (e12, t10, i8) => { + const n8 = i8.path[i8.path.length - 1], r9 = [], o8 = Si(n8); + if (0 === o8.length) + return; + const s8 = Pi(o8, e12.parameters); + s8.length && r9.push({ message: `Not all channel's parameters are described with "parameters" object. Missed: ${s8.join(", ")}.`, path: [...i8.path, "parameters"] }); + const a8 = Oi(o8, e12.parameters); + return a8.length && a8.forEach((e13) => { + r9.push({ message: `Channel's "parameters" object has redundant defined "${e13}" parameter.`, path: [...i8.path, "parameters", e13] }); + }), r9; + }), Ai = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { servers: { type: "object" }, channels: { type: "object", additionalProperties: { type: "object", properties: { servers: { type: "array", items: { type: "string" } } } } } } }, options: null }, (e12) => { + var t10, i8; + const n8 = []; + if (!e12.channels) + return n8; + const r9 = Object.keys(null !== (t10 = e12.servers) && void 0 !== t10 ? t10 : {}); + return Object.entries(null !== (i8 = e12.channels) && void 0 !== i8 ? i8 : {}).forEach(([e13, t11]) => { + t11.servers && t11.servers.forEach((t12, i9) => { + r9.includes(t12) || n8.push({ message: 'Channel contains server that are not defined on the "servers" object.', path: ["channels", e13, "servers", i9] }); + }); + }), n8; + }); + var Ii = i7(46734); + function Ei(e12, t10) { + if (!(0, Ii.isPlainObject)(t10)) + return t10; + const i8 = (0, Ii.isPlainObject)(e12) ? Object.assign({}, e12) : {}; + return Object.keys(t10).forEach((e13) => { + const n8 = t10[e13]; + null === n8 ? delete i8[e13] : i8[e13] = Ei(i8[e13], n8); + }), i8; + } + const qi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { traits: { type: "array", items: { type: "object" } } } }, options: { type: "object", properties: { idField: { type: "string", enum: ["operationId", "messageId"] } } } }, (e12, t10, i8) => { + const n8 = function(e13) { + if (Array.isArray(e13.traits)) { + e13 = Object.assign({}, e13); + for (const t11 of e13.traits) + for (const i9 in t11) + e13[i9] = Ei(e13[i9], t11[i9]); + } + return e13; + }(e12); + return (0, ci.vN)(n8[t10.idField], null, i8); + }); + function ki(e12, t10) { + return e12 || "boolean" == typeof e12 ? "boolean" == typeof e12 && (e12 = true === e12 ? {} : { not: {} }) : e12 = "headers" === t10 ? { type: "object" } : {}, e12; + } + function Mi(e12) { + var t10; + return Array.isArray(e12.examples) && null !== (t10 = e12.examples.map((e13, t11) => ({ path: ["examples", t11], value: e13 }))) && void 0 !== t10 ? t10 : []; + } + function Ri(e12, t10, i8, n8, r9) { + return (0, ci.wQ)(e12, { allErrors: true, schema: n8 }, Object.assign(Object.assign({}, r9), { path: [...r9.path, ...t10, i8] })); + } + const Di = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { name: { type: "string" }, summary: { type: "string" } } }, options: null }, (e12, t10, i8) => { + if (!e12.examples) + return; + const n8 = [], r9 = ki(e12.payload, "payload"), o8 = ki(e12.headers, "headers"); + for (const t11 of Mi(e12)) { + const { path: e13, value: s8 } = t11; + if (void 0 !== s8.payload) { + const t12 = Ri(s8.payload, e13, "payload", r9, i8); + Array.isArray(t12) && n8.push(...t12); + } + if (void 0 !== s8.headers) { + const t12 = Ri(s8.headers, e13, "headers", o8, i8); + Array.isArray(t12) && n8.push(...t12); + } + } + return n8; + }); + var Ci = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function Vi(e12) { + return { description: "Examples of message object should validate against a payload with an explicit schemaFormat.", message: "{{error}}", severity: "error", recommended: true, given: ["$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat !== void 0)]", "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", "$.components.channels.*.[publish,subscribe].message[?(@property === 'message' && @.schemaFormat !== void 0)]", "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", "$.components.messages[?(!@null && @.schemaFormat !== void 0)]", "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", "$.components.messages.*.traits[?(!@null && @.schemaFormat !== void 0)]", "$.components.messageTraits[?(!@null && @.schemaFormat !== void 0)]"], then: { function: Ni(e12) } }; + } + function Ni(e12) { + return (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { name: { type: "string" }, summary: { type: "string" } } }, options: null }, (t10, i8, n8) => Ci(this, void 0, void 0, function* () { + if (!t10.examples) + return; + if (!t10.payload) + return; + const i9 = n8.document, r9 = i9.data, o8 = Q5(t10.schemaFormat, r9.asyncapi), s8 = K5(r9.asyncapi), a8 = { asyncapi: oe4(r9, i9.__parserInput, i9.source || void 0), rootPath: n8.path, schemaFormat: o8, defaultSchemaFormat: s8 }, p8 = [], c8 = yield function(e13, t11, i10) { + return Ci(this, void 0, void 0, function* () { + const n9 = [...i10.rootPath, "payload"]; + if (void 0 === t11) + return { path: n9, schema: void 0, errors: [] }; + try { + const r10 = { asyncapi: i10.asyncapi, data: t11, meta: {}, path: n9, schemaFormat: i10.schemaFormat, defaultSchemaFormat: i10.defaultSchemaFormat }; + return { path: n9, schema: yield B6(e13, r10), errors: [] }; + } catch (e14) { + return { path: n9, schema: void 0, errors: [{ message: `Error thrown during schema validation. Name: ${e14.name}, message: ${e14.message}, stack: ${e14.stack}`, path: n9 }] }; + } + }); + }(e12, t10.payload, a8), d8 = c8.schema; + p8.push(...c8.errors); + for (const e13 of Mi(t10)) { + const { path: t11, value: i10 } = e13; + if (void 0 !== i10.payload && void 0 !== d8) { + const e14 = Ri(i10.payload, t11, "payload", d8, n8); + Array.isArray(e14) && p8.push(...e14); + } + } + return p8; + })); + } + function* Fi(e12) { + const t10 = null == e12 ? void 0 : e12.channels; + if (!de4(t10)) + return {}; + for (const [e13, i8] of Object.entries(t10)) + de4(i8) && (de4(i8.subscribe) && (yield { path: ["channels", e13, "subscribe"], kind: "subscribe", operation: i8.subscribe }), de4(i8.publish) && (yield { path: ["channels", e13, "publish"], kind: "publish", operation: i8.publish })); + } + function Ui(e12) { + if (Array.isArray(e12.traits)) + for (let t10 = e12.traits.length - 1; t10 >= 0; t10--) { + const i8 = e12.traits[t10]; + if (de4(i8) && "string" == typeof i8.messageId) + return { messageId: i8.messageId, path: ["traits", t10, "messageId"] }; + } + if ("string" == typeof e12.messageId) + return { messageId: e12.messageId, path: ["messageId"] }; + } + const Li = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { channels: { type: "object", properties: { subscribe: { type: "object", properties: { message: { oneOf: [{ type: "object" }, { type: "object", properties: { oneOf: { type: "array" } } }] } } }, publish: { type: "object", properties: { message: { oneOf: [{ type: "object" }, { type: "object", properties: { oneOf: { type: "array" } } }] } } } } } } }, options: null }, (e12) => { + const t10 = [], i8 = function* (e13) { + for (const { path: t11, operation: i9 } of Fi(e13)) { + if (!de4(i9)) + continue; + const e14 = i9.message; + if (!de4(e14)) + continue; + const n9 = e14.oneOf; + if (Array.isArray(n9)) + for (const [e15, i10] of n9.entries()) + de4(i10) && (yield { path: [...t11, "message", "oneOf", e15], message: i10 }); + else + yield { path: [...t11, "message"], message: e14 }; + } + }(e12), n8 = []; + for (const { path: e13, message: r9 } of i8) { + const i9 = Ui(r9); + void 0 !== i9 && (n8.includes(i9.messageId) ? t10.push({ message: '"messageId" must be unique across all the messages.', path: [...e13, ...i9.path] }) : n8.push(i9.messageId)); + } + return t10; + }); + function zi(e12) { + if (Array.isArray(e12.traits)) + for (let t10 = e12.traits.length - 1; t10 >= 0; t10--) { + const i8 = e12.traits[t10]; + if (de4(i8) && "string" == typeof i8.operationId) + return { operationId: i8.operationId, path: ["traits", t10, "operationId"] }; + } + if ("string" == typeof e12.operationId) + return { operationId: e12.operationId, path: ["operationId"] }; + } + const Bi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { channels: { type: "object", properties: { subscribe: { type: "object" }, publish: { type: "object" } } } } }, options: null }, (e12) => { + const t10 = [], i8 = Fi(e12), n8 = []; + for (const { path: e13, operation: r9 } of i8) { + const i9 = zi(r9); + void 0 !== i9 && (n8.includes(i9.operationId) ? t10.push({ message: '"operationId" must be unique across all the operations.', path: [...e13, ...i9.path] }) : n8.push(i9.operationId)); + } + return t10; + }), Qi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { default: {}, examples: { type: "array" } }, errorMessage: '#{{print("property")}must be an object containing "default" or an "examples" array' }, errorOnInvalidInput: true, options: { type: "object", properties: { type: { enum: ["default", "examples"] } }, additionalProperties: false, required: ["type"] } }, (e12, t10, i8) => { + const n8 = e12, r9 = []; + for (const s8 of (o8 = e12, "default" === t10.type ? [{ path: ["default"], value: o8.default }] : Array.isArray(o8.examples) ? Array.from(o8.examples.entries()).map(([e13, t11]) => ({ path: ["examples", e13], value: t11 })) : [])) { + const e13 = (0, ci.wQ)(s8.value, { schema: n8, allErrors: true }, Object.assign(Object.assign({}, i8), { path: [...i8.path, ...s8.path] })); + Array.isArray(e13) && "string" != typeof s8.value && r9.push(...e13); + } + var o8; + return r9; + }), Ki = ["implicit", "password", "clientCredentials", "authorizationCode"], Hi = (0, ne4.createRulesetFunction)({ input: { type: "object", additionalProperties: { type: "array", items: { type: "string" } } }, options: { type: "object", properties: { objectType: { type: "string", enum: ["Server", "Operation"] } } } }, (e12 = {}, { objectType: t10 }, i8) => { + var n8, r9; + const o8 = [], s8 = i8.document.data, a8 = null !== (r9 = null === (n8 = null == s8 ? void 0 : s8.components) || void 0 === n8 ? void 0 : n8.securitySchemes) && void 0 !== r9 ? r9 : {}, p8 = Object.keys(a8); + return Object.keys(e12).forEach((n9) => { + var r10; + p8.includes(n9) || o8.push({ message: `${t10} must not reference an undefined security scheme.`, path: [...i8.path, n9] }); + const s9 = a8[n9]; + if ("oauth2" === (null == s9 ? void 0 : s9.type)) { + const t11 = function(e13) { + const t12 = []; + return Ki.forEach((i9) => { + const n10 = e13[i9]; + de4(n10) && t12.push(...Object.keys(n10.scopes)); + }), Array.from(new Set(t12)); + }(null !== (r10 = s9.flows) && void 0 !== r10 ? r10 : {}); + e12[n9].forEach((e13, r11) => { + t11.includes(e13) || o8.push({ message: `Non-existing security scope for the specified security scheme. Available: [${t11.join(", ")}]`, path: [...i8.path, n9, r11] }); + }); + } + }), o8; + }), Gi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { url: { type: "string" }, variables: { type: "object" } }, required: ["url", "variables"] }, options: null }, (e12, t10, i8) => { + const n8 = [], r9 = Si(e12.url); + if (0 === r9.length) + return n8; + const o8 = Pi(r9, e12.variables); + o8.length && n8.push({ message: `Not all server's variables are described with "variables" object. Missed: ${o8.join(", ")}.`, path: [...i8.path, "variables"] }); + const s8 = Oi(r9, e12.variables); + return s8.length && s8.forEach((e13) => { + n8.push({ message: `Server's "variables" object has redundant defined "${e13}" url variable.`, path: [...i8.path, "variables", e13] }); + }), n8; + }), Wi = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { components: { type: "object" } }, required: ["components"] }, options: null }, (e12) => { + var t10; + const i8 = null === (t10 = e12.components) || void 0 === t10 ? void 0 : t10.securitySchemes; + if (!de4(i8)) + return; + const n8 = []; + de4(e12.servers) && Object.values(e12.servers).forEach((e13) => { + Array.isArray(e13.security) && e13.security.forEach((e14) => { + n8.push(...Object.keys(e14)); + }); + }); + const r9 = Fi(e12); + for (const { operation: e13 } of r9) + Array.isArray(e13.security) && e13.security.forEach((e14) => { + n8.push(...Object.keys(e14)); + }); + const o8 = new Set(n8), s8 = Object.keys(i8), a8 = []; + return s8.forEach((e13) => { + o8.has(e13) || a8.push({ message: "Potentially unused security scheme has been detected in AsyncAPI document.", path: ["components", "securitySchemes", e13] }); + }), a8; + }), Ji = (0, ne4.createRulesetFunction)({ input: { type: "array", items: { type: "object", properties: { name: { type: "string" } }, required: ["name"] } }, options: null }, (e12, t10, i8) => { + const n8 = function(e13) { + return e13.map((e14) => e14.name).reduce((e14, t11, i9, n9) => (n9.indexOf(t11) !== i9 && e14.push(i9), e14), []); + }(e12); + if (0 === n8.length) + return []; + const r9 = []; + for (const t11 of n8) { + const n9 = e12[t11].name; + r9.push({ message: `"tags" object contains duplicate tag name "${n9}".`, path: [...i8.path, t11, "name"] }); + } + return r9; + }); + var Zi = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function Yi(e12) { + return { description: "Custom schema must be correctly formatted from the point of view of the used format.", message: "{{error}}", severity: "error", recommended: true, given: ["$.channels.*.[publish,subscribe].message", "$.channels.*.[publish,subscribe].message.oneOf.*", "$.components.channels.*.[publish,subscribe].message", "$.components.channels.*.[publish,subscribe].message.oneOf.*", "$.components.messages.*"], then: { function: Xi(e12) } }; + } + function Xi(e12) { + return (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { schemaFormat: { type: "string" }, payload: true } }, options: null }, (t10 = {}, i8, n8) => Zi(this, void 0, void 0, function* () { + if (!t10.payload) + return []; + const i9 = [...n8.path, "payload"], r9 = n8.document, o8 = r9.data, s8 = Q5(t10.schemaFormat, o8.asyncapi), a8 = K5(o8.asyncapi), p8 = { asyncapi: oe4(o8, r9.__parserInput, r9.source || void 0), data: t10.payload, meta: {}, path: i9, schemaFormat: s8, defaultSchemaFormat: a8 }; + try { + return yield function(e13, t11) { + return z6(this, void 0, void 0, function* () { + const i10 = e13.parserRegistry.get(t11.schemaFormat); + if (void 0 === i10) { + const { path: e14, schemaFormat: i11 } = t11; + return e14.pop(), [{ message: `Unknown schema format: "${i11}"`, path: [...e14, "schemaFormat"] }, { message: `Cannot validate and parse given schema due to unknown schema format: "${i11}"`, path: [...e14, "payload"] }]; + } + return i10.validate(t11); + }); + }(e12, p8); + } catch (e13) { + return [{ message: `Error thrown during schema validation. Name: ${e13.name}, message: ${e13.message}, stack: ${e13.stack}`, path: i9 }]; + } + })); + } + const en = { description: "Core AsyncAPI 2.x.x ruleset.", formats: fi.filterByMajorVersions(["2"]).formats(), rules: { "asyncapi2-server-security": { description: "Server have to reference a defined security schemes.", message: "{{error}}", severity: "error", recommended: true, given: "$.servers.*.security.*", then: { function: Hi, functionOptions: { objectType: "Server" } } }, "asyncapi2-server-variables": { description: "Server variables must be defined and there must be no redundant variables.", message: "{{error}}", severity: "error", recommended: true, given: ["$.servers.*", "$.components.servers.*"], then: { function: Gi } }, "asyncapi2-channel-parameters": { description: "Channel parameters must be defined and there must be no redundant parameters.", message: "{{error}}", severity: "error", recommended: true, given: "$.channels.*", then: { function: Ti } }, "asyncapi2-channel-servers": { description: 'Channel servers must be defined in the "servers" object.', message: "{{error}}", severity: "error", recommended: true, given: "$", then: { function: Ai } }, "asyncapi2-channel-no-query-nor-fragment": { description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', severity: "error", recommended: true, given: "$.channels", then: { field: "@key", function: ci.T1, functionOptions: { notMatch: "[\\?#]" } } }, "asyncapi2-operation-operationId-uniqueness": { description: '"operationId" must be unique across all the operations.', severity: "error", recommended: true, given: "$", then: { function: Bi } }, "asyncapi2-operation-security": { description: "Operation have to reference a defined security schemes.", message: "{{error}}", severity: "error", recommended: true, given: "$.channels[*][publish,subscribe].security.*", then: { function: Hi, functionOptions: { objectType: "Operation" } } }, "asyncapi2-message-examples": { description: 'Examples of message object should validate againt the "payload" and "headers" schemas.', message: "{{error}}", severity: "error", recommended: true, given: ["$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", "$.components.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", "$.components.messages[?(!@null && @.schemaFormat === void 0)]", "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", "$.components.messages.*.traits[?(!@null && @.schemaFormat === void 0)]", "$.components.messageTraits[?(!@null && @.schemaFormat === void 0)]"], then: { function: Di } }, "asyncapi2-message-messageId-uniqueness": { description: '"messageId" must be unique across all the messages.', severity: "error", recommended: true, given: "$", then: { function: Li } }, "asyncapi2-tags-uniqueness": { description: "Each tag must have a unique name.", message: "{{error}}", severity: "error", recommended: true, given: ["$.tags", "$.channels.*.[publish,subscribe].tags", "$.components.channels.*.[publish,subscribe].tags", "$.channels.*.[publish,subscribe].traits.*.tags", "$.components.channels.*.[publish,subscribe].traits.*.tags", "$.components.operationTraits.*.tags", "$.channels.*.[publish,subscribe].message.tags", "$.channels.*.[publish,subscribe].message.oneOf.*.tags", "$.components.channels.*.[publish,subscribe].message.tags", "$.components.channels.*.[publish,subscribe].message.oneOf.*.tags", "$.components.messages.*.tags", "$.channels.*.[publish,subscribe].message.traits.*.tags", "$.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", "$.components.channels.*.[publish,subscribe].message.traits.*.tags", "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", "$.components.messages.*.traits.*.tags", "$.components.messageTraits.*.tags"], then: { function: Ji } } } }, tn = (e12) => ({ description: "Schemas AsyncAPI 2.x.x ruleset.", formats: fi.filterByMajorVersions(["2"]).formats(), rules: { "asyncapi2-schemas": Yi(e12), "asyncapi2-schema-default": { description: "Default must be valid against its defined schema.", message: "{{error}}", severity: "error", recommended: true, given: ["$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", "$.channels.*.parameters.*.schema.default^", "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", "$.components.channels.*.parameters.*.schema.default^", "$.components.schemas.*.default^", "$.components.parameters.*.schema.default^", "$.components.messages[?(@.schemaFormat === void 0)].payload.default^", "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.default^"], then: { function: Qi, functionOptions: { type: "default" } } }, "asyncapi2-schema-examples": { description: "Examples must be valid against their defined schema.", message: "{{error}}", severity: "error", recommended: true, given: ["$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", "$.channels.*.parameters.*.schema.examples^", "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", "$.components.channels.*.parameters.*.schema.examples^", "$.components.schemas.*.examples^", "$.components.parameters.*.schema.examples^", "$.components.messages[?(@.schemaFormat === void 0)].payload.examples^", "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.examples^"], then: { function: Qi, functionOptions: { type: "examples" } } }, "asyncapi2-message-examples-custom-format": Vi(e12) } }), nn = { description: "Recommended AsyncAPI 2.x.x ruleset.", formats: fi.filterByMajorVersions(["2"]).formats(), rules: { "asyncapi2-tags": { description: 'AsyncAPI object should have non-empty "tags" array.', recommended: true, given: "$", then: { field: "tags", function: ci.vN } }, "asyncapi2-server-no-empty-variable": { description: "Server URL should not have empty variable substitution pattern.", recommended: true, given: "$.servers[*].url", then: { function: ci.T1, functionOptions: { notMatch: "{}" } } }, "asyncapi2-server-no-trailing-slash": { description: "Server URL should not end with slash.", recommended: true, given: "$.servers[*].url", then: { function: ci.T1, functionOptions: { notMatch: "/$" } } }, "asyncapi2-channel-no-empty-parameter": { description: "Channel address should not have empty parameter substitution pattern.", recommended: true, given: "$.channels", then: { field: "@key", function: ci.T1, functionOptions: { notMatch: "{}" } } }, "asyncapi2-channel-no-trailing-slash": { description: "Channel address should not end with slash.", recommended: true, given: "$.channels", then: { field: "@key", function: ci.T1, functionOptions: { notMatch: ".+\\/$" } } }, "asyncapi2-operation-operationId": { description: 'Operation should have an "operationId" field defined.', recommended: true, given: ["$.channels[*][publish,subscribe]", "$.components.channels[*][publish,subscribe]"], then: { function: qi, functionOptions: { idField: "operationId" } } }, "asyncapi2-message-messageId": { description: 'Message should have a "messageId" field defined.', recommended: true, formats: fi.filterByMajorVersions(["2"]).excludeByVersions(["2.0.0", "2.1.0", "2.2.0", "2.3.0"]).formats(), given: ['$.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', "$.channels.*.[publish,subscribe].message.oneOf.*", '$.components.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', "$.components.channels.*.[publish,subscribe].message.oneOf.*", "$.components.messages.*"], then: { function: qi, functionOptions: { idField: "messageId" } } }, "asyncapi2-unused-securityScheme": { description: "Potentially unused security scheme has been detected in AsyncAPI document.", recommended: true, resolved: false, severity: "info", given: "$", then: { function: Wi } } } }, rn = { type: "object", properties: { $ref: { type: "string", format: "uri-reference" } } }, on4 = (0, ne4.createRulesetFunction)({ input: { type: "object", properties: { channel: rn, messages: { type: "array", items: rn } } }, options: null }, (e12, t10, i8) => { + var n8, r9; + const o8 = [], s8 = null === (n8 = e12.channel) || void 0 === n8 ? void 0 : n8.$ref; + return null === (r9 = e12.messages) || void 0 === r9 || r9.forEach((e13, t11) => { + e13.$ref && !e13.$ref.startsWith(`${s8}/messages`) && o8.push({ message: "Operation message does not belong to the specified channel.", path: [...i8.path, "messages", t11] }); + }), o8; + }), sn = { description: "Core AsyncAPI 3.x.x ruleset.", formats: fi.filterByMajorVersions(["3"]).formats(), rules: { "asyncapi3-operation-messages-from-referred-channel": { description: 'Operation "messages" must be a subset of the messages defined in the channel referenced in this operation.', message: "{{error}}", severity: "error", recommended: true, resolved: false, given: ["$.operations.*", "$.components.operations.*"], then: { function: on4 } }, "asyncapi3-required-operation-channel-unambiguity": { description: 'The "channel" field of an operation under the root "operations" object must always reference a channel under the root "channels" object.', severity: "error", recommended: true, resolved: false, given: "$.operations.*", then: { field: "channel.$ref", function: ci.T1, functionOptions: { match: "#\\/channels\\/" } } }, "asyncapi3-required-channel-servers-unambiguity": { description: 'The "servers" field of a channel under the root "channels" object must always reference a subset of the servers under the root "servers" object.', severity: "error", recommended: true, resolved: false, given: "$.channels.*", then: { field: "$.servers.*.$ref", function: ci.T1, functionOptions: { match: "#\\/servers\\/" } } }, "asyncapi3-channel-servers": { description: 'Channel servers must be defined in the "servers" object.', message: "{{error}}", severity: "error", recommended: true, given: "$", then: { function: Ai } }, "asyncapi3-channel-no-query-nor-fragment": { description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', severity: "error", recommended: true, given: "$.channels", then: { field: "@key", function: ci.T1, functionOptions: { notMatch: "[\\?#]" } } } } }; + var an = function(e12, t10) { + var i8 = {}; + for (var n8 in e12) + Object.prototype.hasOwnProperty.call(e12, n8) && t10.indexOf(n8) < 0 && (i8[n8] = e12[n8]); + if (null != e12 && "function" == typeof Object.getOwnPropertySymbols) { + var r9 = 0; + for (n8 = Object.getOwnPropertySymbols(e12); r9 < n8.length; r9++) + t10.indexOf(n8[r9]) < 0 && Object.prototype.propertyIsEnumerable.call(e12, n8[r9]) && (i8[n8[r9]] = e12[n8[r9]]); + } + return i8; + }, pn = i7(88601), cn = i7(30924), dn = i7(54668), fn = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function ln(e12 = {}) { + const t10 = [{ schema: "file", read: dn.resolveFile }, { schema: "https", read: dn.resolveHttp }, { schema: "http", read: dn.resolveHttp }, ...e12.resolvers || []].map((e13) => Object.assign(Object.assign({}, e13), { order: e13.order || Number.MAX_SAFE_INTEGER, canRead: void 0 === e13.canRead || e13.canRead })), i8 = [...new Set(t10.map((e13) => e13.schema))].reduce((e13, i9) => (e13[i9] = { resolve: un(i9, t10) }, e13), {}), n8 = false !== e12.cache; + return new pn.Resolver({ uriCache: n8 ? void 0 : new cn.Cache({ stdTTL: 1 }), resolvers: i8 }); + } + function un(e12, t10) { + const i8 = t10.filter((t11) => t11.schema === e12).sort((e13, t11) => e13.order - t11.order); + return (t11, n8) => fn(this, void 0, void 0, function* () { + let r9, o8; + for (const e13 of i8) + try { + if (!mn(e13, t11, n8)) + continue; + if (r9 = yield e13.read(t11, n8), "string" == typeof r9) + break; + } catch (e14) { + o8 = e14; + continue; + } + if ("string" != typeof r9) + throw o8 || new Error(`None of the available resolvers for "${e12}" can resolve the given reference.`); + return r9; + }); + } + function mn(e12, t10, i8) { + return "function" == typeof e12.canRead ? e12.canRead(t10, i8) : e12.canRead; + } + function hn(e12, t10 = {}) { + var i8; + const n8 = null === (i8 = t10.__unstable) || void 0 === i8 ? void 0 : i8.resolver, r9 = new ne4.Spectral({ resolver: ln(n8) }), o8 = function(e13, t11) { + var i9; + const n9 = t11 || {}, { core: r10 = true, recommended: o9 = true } = n9, s8 = an(n9, ["core", "recommended"]), a8 = [r10 && _i, o9 && wi, r10 && en, r10 && tn(e13), o9 && nn, r10 && sn, ...(null === (i9 = t11 || {}) || void 0 === i9 ? void 0 : i9.extends) || []].filter(Boolean); + return Object.assign(Object.assign({}, s8 || {}), { extends: a8 }); + }(e12, t10.ruleset); + return r9.setRuleset(o8), r9; + } + var yn = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + const gn = { allowedSeverity: { error: false, warning: true, info: true, hint: true }, __unstable: {} }; + function bn(e12, t10, i8, n8 = {}) { + var r9; + return yn(this, void 0, void 0, function* () { + let o8; + try { + const { allowedSeverity: s8 } = ce4(gn, n8), a8 = function(e13) { + return "string" == typeof e13 ? e13 : JSON.stringify(e13, void 0, 2); + }(i8); + o8 = new ne4.Document(a8, pi.Yaml, n8.source), o8.__parserInput = i8; + const p8 = (null === (r9 = n8.__unstable) || void 0 === r9 ? void 0 : r9.resolver) ? hn(e12, n8) : t10; + let { resolved: c8, results: d8 } = yield p8.runWithResolved(o8, {}); + return (!(null == s8 ? void 0 : s8.error) && d8.some((e13) => e13.severity === re4.h_.Error) || !(null == s8 ? void 0 : s8.warning) && d8.some((e13) => e13.severity === re4.h_.Warning) || !(null == s8 ? void 0 : s8.info) && function(e13) { + return e13.some((e14) => e14.severity === re4.h_.Information); + }(d8) || !(null == s8 ? void 0 : s8.hint) && function(e13) { + return e13.some((e14) => e14.severity === re4.h_.Hint); + }(d8)) && (c8 = void 0), { validated: c8, diagnostics: d8, extras: { document: o8 } }; + } catch (e13) { + return { validated: void 0, diagnostics: fe4(e13, "Error thrown during AsyncAPI document validation", o8), extras: { document: o8 } }; + } + }); + } + const vn = { applyTraits: true, parseSchemas: true, validateOptions: {}, __unstable: {} }; + function jn(e12, t10, i8, n8 = {}) { + return r9 = this, o8 = void 0, a8 = function* () { + let r10; + try { + n8 = ce4(vn, n8); + const { validated: s9, diagnostics: a9, extras: p8 } = yield bn(e12, t10, i8, Object.assign(Object.assign({}, n8.validateOptions), { source: n8.source, __unstable: n8.__unstable })); + if (void 0 === s9) + return { document: void 0, diagnostics: a9, extras: p8 }; + r10 = p8.document; + const c8 = r10.__documentInventory, d8 = function(e13) { + const t11 = JSON.stringify(e13, /* @__PURE__ */ function() { + const e14 = /* @__PURE__ */ new Map(), t12 = /* @__PURE__ */ new Map(); + let i10 = null; + return function(n9, r11) { + const o10 = e14.get(this) + (Array.isArray(this) ? `[${n9}]` : `.${n9}`), s10 = r11 === Object(r11); + s10 && e14.set(r11, o10); + const a10 = t12.get(r11) || ""; + if (!a10 && s10) { + const e15 = o10.replace(/undefined\.\.?/, ""); + t12.set(r11, e15); + } + const p9 = "[" === a10[0] ? "$" : "$."; + let c9 = a10 ? `$ref:${p9}${a10}` : r11; + return null === i10 ? i10 = r11 : c9 === i10 && (c9 = "$ref:$"), c9; + }; + }()), i9 = JSON.parse(t11); + return qt(i9, void 0, i9, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()), i9; + }(s9); + "3" === (o9 = d8).asyncapi.charAt(0) && (Rt(o9.channels), Dt(o9.operations), o9.components && (Dt(o9.components.messages), Dt(o9.components.operations), Rt(o9.components.channels))); + const f9 = oe4(d8, i8, n8.source), l8 = kt(f9); + return ae4(h8, true, l8), ae4(g7, 3, l8), yield ai(e12, l8, f9, c8, n8), { document: l8, diagnostics: a9, extras: p8 }; + } catch (e13) { + return { document: void 0, diagnostics: fe4(e13, "Error thrown during AsyncAPI document parsing", r10), extras: void 0 }; + } + var o9; + }, new ((s8 = void 0) || (s8 = Promise))(function(e13, t11) { + function i9(e14) { + try { + p8(a8.next(e14)); + } catch (e15) { + t11(e15); + } + } + function n9(e14) { + try { + p8(a8.throw(e14)); + } catch (e15) { + t11(e15); + } + } + function p8(t12) { + var r10; + t12.done ? e13(t12.value) : (r10 = t12.value, r10 instanceof s8 ? r10 : new s8(function(e14) { + e14(r10); + })).then(i9, n9); + } + p8((a8 = a8.apply(r9, o8 || [])).next()); + }); + var r9, o8, s8, a8; + } + var $n = i7(11601), xn = i7.n($n), _n = i7(74421), wn = i7.n(_n), Sn = i7(67156), Pn = i7.n(Sn), On = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + function Tn(e12) { + return On(this, void 0, void 0, function* () { + const t10 = function(e13) { + const t11 = En || (En = new (xn())({ allErrors: true, meta: true, messages: true, strict: false, allowUnionTypes: true, unicodeRegExp: false }), wn()(En), Pn()(En), En); + let i9 = t11.getSchema(e13); + if (!i9) { + const n9 = function(e14, t12) { + const i10 = `http://asyncapi.com/definitions/${t12}/schema.json`, n10 = e14.definitions; + if (void 0 === n10) + throw new Error("AsyncAPI schema must contain definitions"); + return delete n10["http://json-schema.org/draft-07/schema"], delete n10["http://json-schema.org/draft-04/schema"], { $ref: i10, definitions: n10 }; + }(m7().schemas[e13], e13); + t11.addSchema(n9, e13), i9 = t11.getSchema(e13); + } + return i9; + }(e12.asyncapi.semver.version); + let i8 = []; + var n8; + return !t10(e12.data) && t10.errors && (n8 = e12.path, i8 = [...t10.errors].map((e13) => ({ message: e13.message, path: [...n8, ...e13.instancePath.replace(/^\//, "").split("/")] }))), i8; + }); + } + function An(e12) { + return On(this, void 0, void 0, function* () { + return e12.data; + }); + } + function In() { + const e12 = ["application/schema;version=draft-07", "application/schema+json;version=draft-07", "application/schema+yaml;version=draft-07"]; + return w6.forEach((t10) => { + e12.push(`application/vnd.aai.asyncapi;version=${t10}`, `application/vnd.aai.asyncapi+json;version=${t10}`, `application/vnd.aai.asyncapi+yaml;version=${t10}`); + }), e12; + } + let En; + var qn = function(e12, t10, i8, n8) { + return new (i8 || (i8 = Promise))(function(r9, o8) { + function s8(e13) { + try { + p8(n8.next(e13)); + } catch (e14) { + o8(e14); + } + } + function a8(e13) { + try { + p8(n8.throw(e13)); + } catch (e14) { + o8(e14); + } + } + function p8(e13) { + var t11; + e13.done ? r9(e13.value) : (t11 = e13.value, t11 instanceof i8 ? t11 : new i8(function(e14) { + e14(t11); + })).then(s8, a8); + } + p8((n8 = n8.apply(e12, t10 || [])).next()); + }); + }; + const kn = class { + constructor(e12 = {}) { + var t10; + this.options = e12, this.parserRegistry = /* @__PURE__ */ new Map(), this.spectral = hn(this, e12), this.registerSchemaParser({ validate: Tn, parse: An, getMimeTypes: In }), null === (t10 = this.options.schemaParsers) || void 0 === t10 || t10.forEach((e13) => this.registerSchemaParser(e13)); + } + parse(e12, t10) { + return qn(this, void 0, void 0, function* () { + const i8 = Mt(e12); + return i8 ? { document: i8, diagnostics: [] } : jn(this, this.spectral, e12, t10); + }); + } + validate(e12, t10) { + return qn(this, void 0, void 0, function* () { + return Mt(e12) ? [] : (yield bn(this, this.spectral, e12, t10)).diagnostics; + }); + } + registerSchemaParser(e12) { + return function(e13, t10) { + if ("object" != typeof t10 || "function" != typeof t10.validate || "function" != typeof t10.parse || "function" != typeof t10.getMimeTypes) + throw new Error('Custom parser must have "parse()", "validate()" and "getMimeTypes()" functions.'); + t10.getMimeTypes().forEach((i8) => { + e13.parserRegistry.set(i8, t10); + }); + }(this, e12); + } + }; + })(), n7.default; + })()); + AsyncAPIParserExports = module2.exports; + Parser2 = AsyncAPIParserExports.Parser; + browser_default = AsyncAPIParserExports; + } +}); + +// node_modules/@stoplight/types/dist/index.mjs +var HttpOperationSecurityDeclarationTypes, HttpParamStyles, DiagnosticSeverity, NodeType, NodeFormat; +var init_dist2 = __esm({ + "node_modules/@stoplight/types/dist/index.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + (function(HttpOperationSecurityDeclarationTypes2) { + HttpOperationSecurityDeclarationTypes2["None"] = "none"; + HttpOperationSecurityDeclarationTypes2["Declared"] = "declared"; + HttpOperationSecurityDeclarationTypes2["InheritedFromService"] = "inheritedFromService"; + })(HttpOperationSecurityDeclarationTypes || (HttpOperationSecurityDeclarationTypes = {})); + (function(HttpParamStyles2) { + HttpParamStyles2["Unspecified"] = "unspecified"; + HttpParamStyles2["Simple"] = "simple"; + HttpParamStyles2["Matrix"] = "matrix"; + HttpParamStyles2["Label"] = "label"; + HttpParamStyles2["Form"] = "form"; + HttpParamStyles2["CommaDelimited"] = "commaDelimited"; + HttpParamStyles2["SpaceDelimited"] = "spaceDelimited"; + HttpParamStyles2["PipeDelimited"] = "pipeDelimited"; + HttpParamStyles2["DeepObject"] = "deepObject"; + HttpParamStyles2["TabDelimited"] = "tabDelimited"; + })(HttpParamStyles || (HttpParamStyles = {})); + (function(DiagnosticSeverity2) { + DiagnosticSeverity2[DiagnosticSeverity2["Error"] = 0] = "Error"; + DiagnosticSeverity2[DiagnosticSeverity2["Warning"] = 1] = "Warning"; + DiagnosticSeverity2[DiagnosticSeverity2["Information"] = 2] = "Information"; + DiagnosticSeverity2[DiagnosticSeverity2["Hint"] = 3] = "Hint"; + })(DiagnosticSeverity || (DiagnosticSeverity = {})); + (function(NodeType2) { + NodeType2["Article"] = "article"; + NodeType2["HttpService"] = "http_service"; + NodeType2["HttpServer"] = "http_server"; + NodeType2["HttpOperation"] = "http_operation"; + NodeType2["HttpCallback"] = "http_callback"; + NodeType2["Model"] = "model"; + NodeType2["Generic"] = "generic"; + NodeType2["Unknown"] = "unknown"; + NodeType2["TableOfContents"] = "table_of_contents"; + NodeType2["SpectralRuleset"] = "spectral_ruleset"; + NodeType2["Styleguide"] = "styleguide"; + NodeType2["Image"] = "image"; + NodeType2["StoplightResolutions"] = "stoplight_resolutions"; + NodeType2["StoplightOverride"] = "stoplight_override"; + })(NodeType || (NodeType = {})); + (function(NodeFormat2) { + NodeFormat2["Json"] = "json"; + NodeFormat2["Markdown"] = "markdown"; + NodeFormat2["Yaml"] = "yaml"; + NodeFormat2["Javascript"] = "javascript"; + NodeFormat2["Apng"] = "apng"; + NodeFormat2["Avif"] = "avif"; + NodeFormat2["Bmp"] = "bmp"; + NodeFormat2["Gif"] = "gif"; + NodeFormat2["Jpeg"] = "jpeg"; + NodeFormat2["Png"] = "png"; + NodeFormat2["Svg"] = "svg"; + NodeFormat2["Webp"] = "webp"; + })(NodeFormat || (NodeFormat = {})); + } +}); + +// node_modules/@asyncapi/parser/esm/models/base.js +var BaseModel; +var init_base = __esm({ + "node_modules/@asyncapi/parser/esm/models/base.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + BaseModel = class { + constructor(_json, _meta = {}) { + this._json = _json; + this._meta = _meta; + } + json(key) { + if (key === void 0) + return this._json; + if (this._json === null || this._json === void 0) + return this._json; + return this._json[key]; + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[key]; + } + jsonPath(field) { + if (typeof field !== "string") { + return this._meta.pointer; + } + return `${this._meta.pointer}/${field}`; + } + createModel(Model, value2, meta) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: this._meta.asyncapi })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/collection.js +var Collection2; +var init_collection = __esm({ + "node_modules/@asyncapi/parser/esm/models/collection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + Collection2 = class extends Array { + constructor(collections, _meta = {}) { + super(...collections); + this.collections = collections; + this._meta = _meta; + } + has(id) { + return typeof this.get(id) !== "undefined"; + } + all() { + return this.collections; + } + isEmpty() { + return this.collections.length === 0; + } + filterBy(filter2) { + return this.collections.filter(filter2); + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[String(key)]; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/extensions.js +var Extensions; +var init_extensions = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/extensions.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Extensions = class extends Collection2 { + get(id) { + id = id.startsWith("x-") ? id : `x-${id}`; + return this.collections.find((ext) => ext.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/extension.js +var Extension; +var init_extension = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/extension.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + Extension = class extends BaseModel { + id() { + return this._meta.id; + } + value() { + return this._json; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/iterator.js +function traverseAsyncApiDocument(doc, callback, schemaTypesToIterate = []) { + if (schemaTypesToIterate.length === 0) { + schemaTypesToIterate = Object.values(SchemaTypesToIterate); + } + const options = { callback, schemaTypesToIterate, seenSchemas: /* @__PURE__ */ new Set() }; + if (!doc.channels().isEmpty()) { + doc.channels().all().forEach((channel) => { + traverseChannel(channel, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Components) && !doc.components().isEmpty()) { + const components = doc.components(); + Object.values(components.messages().all() || {}).forEach((message) => { + traverseMessage(message, options); + }); + Object.values(components.schemas().all() || {}).forEach((schema8) => { + traverseSchema(schema8, null, options); + }); + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Parameters)) { + Object.values(components.channelParameters().filterBy((param) => { + return param.hasSchema(); + })).forEach((parameter) => { + traverseSchema(parameter.schema(), null, options); + }); + } + Object.values(components.messageTraits().all() || {}).forEach((messageTrait) => { + traverseMessageTrait(messageTrait, options); + }); + } +} +function traverseSchema(schema8, propOrIndex, options) { + if (!schema8) + return; + const { schemaTypesToIterate, callback, seenSchemas } = options; + const jsonSchema = schema8.json(); + if (seenSchemas.has(jsonSchema)) + return; + seenSchemas.add(jsonSchema); + let types3 = schema8.type() || []; + if (!Array.isArray(types3)) { + types3 = [types3]; + } + if (!schemaTypesToIterate.includes(SchemaTypesToIterate.Objects) && types3.includes("object")) + return; + if (!schemaTypesToIterate.includes(SchemaTypesToIterate.Arrays) && types3.includes("array")) + return; + if (callback(schema8, propOrIndex, SchemaIteratorCallbackType.NEW_SCHEMA) === false) + return; + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Objects) && types3.includes("object")) { + recursiveSchemaObject(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Arrays) && types3.includes("array")) { + recursiveSchemaArray(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.OneOfs)) { + (schema8.oneOf() || []).forEach((combineSchema, idx) => { + traverseSchema(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.AnyOfs)) { + (schema8.anyOf() || []).forEach((combineSchema, idx) => { + traverseSchema(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.AllOfs)) { + (schema8.allOf() || []).forEach((combineSchema, idx) => { + traverseSchema(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Nots) && schema8.not()) { + traverseSchema(schema8.not(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Ifs) && schema8.if()) { + traverseSchema(schema8.if(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Thenes) && schema8.then()) { + traverseSchema(schema8.then(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Elses) && schema8.else()) { + traverseSchema(schema8.else(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Dependencies)) { + Object.entries(schema8.dependencies() || {}).forEach(([depName, dep]) => { + if (dep && !Array.isArray(dep)) { + traverseSchema(dep, depName, options); + } + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Definitions)) { + Object.entries(schema8.definitions() || {}).forEach(([defName, def]) => { + traverseSchema(def, defName, options); + }); + } + callback(schema8, propOrIndex, SchemaIteratorCallbackType.END_SCHEMA); + seenSchemas.delete(jsonSchema); +} +function recursiveSchemaObject(schema8, options) { + Object.entries(schema8.properties() || {}).forEach(([propertyName, property2]) => { + traverseSchema(property2, propertyName, options); + }); + const additionalProperties = schema8.additionalProperties(); + if (typeof additionalProperties === "object") { + traverseSchema(additionalProperties, null, options); + } + const schemaTypesToIterate = options.schemaTypesToIterate; + if (schemaTypesToIterate.includes(SchemaTypesToIterate.PropertyNames) && schema8.propertyNames()) { + traverseSchema(schema8.propertyNames(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.PatternProperties)) { + Object.entries(schema8.patternProperties() || {}).forEach(([propertyName, property2]) => { + traverseSchema(property2, propertyName, options); + }); + } +} +function recursiveSchemaArray(schema8, options) { + const items = schema8.items(); + if (items) { + if (Array.isArray(items)) { + items.forEach((item, idx) => { + traverseSchema(item, idx, options); + }); + } else { + traverseSchema(items, null, options); + } + } + const additionalItems = schema8.additionalItems(); + if (typeof additionalItems === "object") { + traverseSchema(additionalItems, null, options); + } + if (options.schemaTypesToIterate.includes("contains") && schema8.contains()) { + traverseSchema(schema8.contains(), null, options); + } +} +function traverseChannel(channel, options) { + if (!channel) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Parameters)) { + Object.values(channel.parameters().filterBy((param) => { + return param.hasSchema(); + }) || {}).forEach((parameter) => { + traverseSchema(parameter.schema(), null, options); + }); + } + channel.messages().all().forEach((message) => { + traverseMessage(message, options); + }); +} +function traverseMessage(message, options) { + if (!message) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Headers) && message.hasHeaders()) { + traverseSchema(message.headers(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Payloads) && message.hasPayload()) { + traverseSchema(message.payload(), null, options); + } +} +function traverseMessageTrait(messageTrait, options) { + if (!messageTrait) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate.Headers) && messageTrait.hasHeaders()) { + traverseSchema(messageTrait.headers(), null, options); + } +} +var SchemaIteratorCallbackType, SchemaTypesToIterate; +var init_iterator = __esm({ + "node_modules/@asyncapi/parser/esm/iterator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + (function(SchemaIteratorCallbackType5) { + SchemaIteratorCallbackType5["NEW_SCHEMA"] = "NEW_SCHEMA"; + SchemaIteratorCallbackType5["END_SCHEMA"] = "END_SCHEMA"; + })(SchemaIteratorCallbackType || (SchemaIteratorCallbackType = {})); + (function(SchemaTypesToIterate5) { + SchemaTypesToIterate5["Parameters"] = "parameters"; + SchemaTypesToIterate5["Payloads"] = "payloads"; + SchemaTypesToIterate5["Headers"] = "headers"; + SchemaTypesToIterate5["Components"] = "components"; + SchemaTypesToIterate5["Objects"] = "objects"; + SchemaTypesToIterate5["Arrays"] = "arrays"; + SchemaTypesToIterate5["OneOfs"] = "oneOfs"; + SchemaTypesToIterate5["AllOfs"] = "allOfs"; + SchemaTypesToIterate5["AnyOfs"] = "anyOfs"; + SchemaTypesToIterate5["Nots"] = "nots"; + SchemaTypesToIterate5["PropertyNames"] = "propertyNames"; + SchemaTypesToIterate5["PatternProperties"] = "patternProperties"; + SchemaTypesToIterate5["Contains"] = "contains"; + SchemaTypesToIterate5["Ifs"] = "ifs"; + SchemaTypesToIterate5["Thenes"] = "thenes"; + SchemaTypesToIterate5["Elses"] = "elses"; + SchemaTypesToIterate5["Dependencies"] = "dependencies"; + SchemaTypesToIterate5["Definitions"] = "definitions"; + })(SchemaTypesToIterate || (SchemaTypesToIterate = {})); + } +}); + +// node_modules/@asyncapi/parser/esm/models/utils.js +function createModel(Model, value2, meta, parent2) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: meta.asyncapi || (parent2 === null || parent2 === void 0 ? void 0 : parent2.meta().asyncapi) })); +} +function schemasFromDocument(document2, SchemasModel, includeComponents) { + const jsonInstances = /* @__PURE__ */ new Set(); + const schemas5 = /* @__PURE__ */ new Set(); + function callback(schema8) { + if (!jsonInstances.has(schema8.json())) { + jsonInstances.add(schema8.json()); + schemas5.add(schema8); + } + } + let toIterate = Object.values(SchemaTypesToIterate); + if (!includeComponents) { + toIterate = toIterate.filter((s7) => s7 !== SchemaTypesToIterate.Components); + } + traverseAsyncApiDocument(document2, callback, toIterate); + return new SchemasModel(Array.from(schemas5)); +} +var init_utils = __esm({ + "node_modules/@asyncapi/parser/esm/models/utils.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_iterator(); + } +}); + +// node_modules/@asyncapi/specs/schemas/2.0.0.json +var require__2 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.0.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.0.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.0.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.0.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.0.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.0.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.0.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.0.0/info.json": { + $id: "http://asyncapi.com/definitions/2.0.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.0.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.0.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.0.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/license.json": { + $id: "http://asyncapi.com/definitions/2.0.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/server.json": { + $id: "http://asyncapi.com/definitions/2.0.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.0.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.0.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.0.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.0.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.0.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {} + } + }, + "http://asyncapi.com/definitions/2.0.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.0.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.0.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.0.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.0.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.0.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.0.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.0.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.0.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.0.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.0.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.0.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.0.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.0.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.0.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.0.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.0.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.0.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/message.json": { + $id: "http://asyncapi.com/definitions/2.0.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + properties: { + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.0.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.0.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.0.0/components.json": { + $id: "http://asyncapi.com/definitions/2.0.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.0.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.0.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.0.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.0.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.0.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.0.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.0.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/openIdConnect.json" + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.0.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.0.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.0.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.0.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.0.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.1.0.json +var require__3 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.1.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.1.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.1.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.1.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.1.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.1.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.1.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.1.0/info.json": { + $id: "http://asyncapi.com/definitions/2.1.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.1.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.1.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.1.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/license.json": { + $id: "http://asyncapi.com/definitions/2.1.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/server.json": { + $id: "http://asyncapi.com/definitions/2.1.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.1.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.1.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.1.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.1.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.1.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + "http://asyncapi.com/definitions/2.1.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.1.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.1.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.1.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.1.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.1.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.1.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.1.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.1.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.1.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.1.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.1.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.1.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.1.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.1.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.1.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.1.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.1.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/message.json": { + $id: "http://asyncapi.com/definitions/2.1.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.1.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.1.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.1.0/components.json": { + $id: "http://asyncapi.com/definitions/2.1.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.1.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.1.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.1.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.1.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.1.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.1.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.1.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.1.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.1.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.1.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.1.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.1.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.2.0.json +var require__4 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.2.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.2.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.2.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.2.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.2.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.2.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.2.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.2.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.2.0/info.json": { + $id: "http://asyncapi.com/definitions/2.2.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.2.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.2.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.2.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/license.json": { + $id: "http://asyncapi.com/definitions/2.2.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/server.json": { + $id: "http://asyncapi.com/definitions/2.2.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.2.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.2.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.2.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.2.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.2.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + "http://asyncapi.com/definitions/2.2.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.2.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.2.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.2.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.2.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.2.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.2.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.2.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.2.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.2.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.2.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.2.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.2.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.2.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.2.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.2.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.2.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.2.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/message.json": { + $id: "http://asyncapi.com/definitions/2.2.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.2.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.2.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.2.0/components.json": { + $id: "http://asyncapi.com/definitions/2.2.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.2.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.2.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.2.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.2.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.2.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.2.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.2.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.2.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.2.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.2.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.2.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.2.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.3.0.json +var require__5 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.3.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.3.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.3.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.3.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.3.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.3.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.3.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.3.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.3.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.3.0/info.json": { + $id: "http://asyncapi.com/definitions/2.3.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.3.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.3.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.3.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/license.json": { + $id: "http://asyncapi.com/definitions/2.3.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.3.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.3.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.3.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.3.0/server.json": { + $id: "http://asyncapi.com/definitions/2.3.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.3.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.3.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.3.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.3.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.3.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.3.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.3.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.3.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.3.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.3.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.3.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.3.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.3.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.3.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.3.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.3.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.3.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.3.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.3.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.3.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.3.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/message.json": { + $id: "http://asyncapi.com/definitions/2.3.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.3.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.3.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.3.0/components.json": { + $id: "http://asyncapi.com/definitions/2.3.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.3.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.3.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.3.0/channels.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.3.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.3.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.3.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.3.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.3.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.3.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.3.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.3.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.3.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.3.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.3.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.4.0.json +var require__6 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.4.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.4.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.4.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.4.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.4.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.4.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.4.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.4.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.4.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.4.0/info.json": { + $id: "http://asyncapi.com/definitions/2.4.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.4.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.4.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.4.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/license.json": { + $id: "http://asyncapi.com/definitions/2.4.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.4.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.4.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.4.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.4.0/server.json": { + $id: "http://asyncapi.com/definitions/2.4.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.4.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.4.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.4.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.4.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.4.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.4.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.4.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.4.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.4.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.4.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.4.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.4.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.4.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.4.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.4.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.4.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.4.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.4.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.4.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.4.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/message.json": { + $id: "http://asyncapi.com/definitions/2.4.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.4.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.4.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.4.0/components.json": { + $id: "http://asyncapi.com/definitions/2.4.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.4.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.4.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.4.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.4.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.4.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.4.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.4.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.4.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.4.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.4.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.4.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.4.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.4.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.4.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.5.0.json +var require__7 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.5.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.5.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.5.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.5.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.5.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.5.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.5.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.5.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.5.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.5.0/info.json": { + $id: "http://asyncapi.com/definitions/2.5.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.5.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.5.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.5.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/license.json": { + $id: "http://asyncapi.com/definitions/2.5.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.5.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.5.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.5.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.5.0/server.json": { + $id: "http://asyncapi.com/definitions/2.5.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + } + } + }, + "http://asyncapi.com/definitions/2.5.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.5.0/serverVariables.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.5.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.5.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.5.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.5.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.5.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.5.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.5.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.5.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.5.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.5.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.5.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.5.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.5.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.5.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.5.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.5.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.5.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.5.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.5.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/message.json": { + $id: "http://asyncapi.com/definitions/2.5.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.5.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.5.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.5.0/components.json": { + $id: "http://asyncapi.com/definitions/2.5.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.5.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.5.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.5.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.5.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.5.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.5.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.5.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.5.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.5.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.5.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.5.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.5.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.5.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.5.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.6.0.json +var require__8 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.6.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.6.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.6.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.6.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.6.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.6.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.6.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.6.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.6.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.6.0/info.json": { + $id: "http://asyncapi.com/definitions/2.6.0/info.json", + type: "object", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.6.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.6.0/license.json" + } + }, + examples: [ + { + title: "AsyncAPI Sample App", + description: "This is a sample server.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.6.0/contact.json", + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/license.json": { + $id: "http://asyncapi.com/definitions/2.6.0/license.json", + type: "object", + required: [ + "name" + ], + description: "License information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.6.0/servers.json", + description: "The Servers Object is a map of Server Objects.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/server.json" + } + ] + }, + examples: [ + { + development: { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests" + } + ] + }, + staging: { + url: "staging.gigantic-server.com", + description: "Staging server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment" + } + ] + }, + production: { + url: "api.gigantic-server.com", + description: "Production server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.6.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json", + type: "string", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + format: "uri-reference", + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/server.json": { + $id: "http://asyncapi.com/definitions/2.6.0/server.json", + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string", + description: "A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served." + }, + description: { + type: "string", + description: "An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation." + }, + protocol: { + type: "string", + description: "The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub." + }, + protocolVersion: { + type: "string", + description: "The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc." + }, + variables: { + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariables.json" + }, + security: { + type: "array", + description: "A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.", + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of servers.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + } + }, + examples: [ + { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "kafka", + protocolVersion: "1.0.0" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.6.0/serverVariables.json", + type: "object", + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.6.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.6.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. " + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json", + type: "object", + description: "Lists of the required security schemes that can be used to execute an operation", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + examples: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {}, + googlepubsub: {}, + pulsar: {} + } + }, + "http://asyncapi.com/definitions/2.6.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.6.0/tag.json", + type: "object", + description: "Allows adding meta data to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag." + }, + externalDocs: { + description: "Additional external documentation for this tag.", + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.6.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation." + }, + url: { + type: "string", + format: "uri", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.6.0/channels.json", + type: "object", + description: "Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/channelItem.json" + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.6.0/channelItem.json", + type: "object", + description: "Describes the operations available on a single channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.6.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.6.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.6.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + description: "This channel is used to exchange messages about users signing up", + subscribe: { + summary: "A user signed up.", + message: { + description: "A longer description of the message", + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/user" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + } + }, + { + subscribe: { + message: { + oneOf: [ + { + $ref: "#/components/messages/signup" + }, + { + $ref: "#/components/messages/login" + } + ] + } + } + }, + { + description: "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.", + servers: [ + "rabbitmqBrokerInProd", + "rabbitmqBrokerInStaging" + ], + subscribe: { + message: { + $ref: "#/components/messages/WebUICommand" + } + }, + bindings: { + amqp: { + is: "queue" + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.6.0/parameters.json", + type: "object", + description: "JSON objects describing reusable channel parameters.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/parameter.json" + } + ] + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.6.0/parameter.json", + description: "Describes a parameter included in a channel name.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + }, + location: "$message.payload#/user/id" + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.6.0/schema.json", + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. " + }, + externalDocs: { + description: "Additional external documentation for this schema.", + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false, + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage" + } + } + } + ], + examples: [ + { + type: "string", + format: "email" + }, + { + type: "object", + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + address: { + $ref: "#/components/schemas/Address" + }, + age: { + type: "integer", + format: "int32", + minimum: 0 + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.6.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.6.0/operation.json", + type: "object", + description: "Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + description: "A list of traits to apply to the operation object.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + } + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.6.0/operationTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + operationId: { + type: "string", + description: "Unique string used to identify the operation. The id MUST be unique among all operations described in the API." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation. ", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/message.json": { + $id: "http://asyncapi.com/definitions/2.6.0/message.json", + description: "Describes a message received on a given channel and operation.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ], + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + }, + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + payload: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.6.0/correlationId.json", + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.6.0/messageTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to a Message Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string", + description: "A string containing the name of the schema format/language used to define the message payload." + }, + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload." + }, + headers: { + description: "Schema definition of the application headers.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string", + description: "Unique string used to identify the message. The id MUST be unique among all messages described in the API." + }, + correlationId: { + description: "Definition of the correlation ID used for message tracing or matching.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of messages.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + contentType: "application/json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.6.0/components.json": { + $id: "http://asyncapi.com/definitions/2.6.0/components.json", + type: "object", + description: "Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.6.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.6.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.6.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.6.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.6.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + } + }, + servers: { + development: { + url: "{stage}.gigantic-server.com:{port}", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `gigantic-server.com`" + }, + port: { + enum: [ + "8883", + "8884" + ], + default: "8883" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.6.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.6.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.6.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json", + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.6.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "userPassword" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.6.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.6.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ], + description: "The type of the security scheme." + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json", + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json", + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + scopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.6.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.6.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/3.0.0.json +var require__9 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/3.0.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/3.0.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 3.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + const: "3.0.0", + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/3.0.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/3.0.0/servers.json" + }, + defaultContentType: { + type: "string", + description: "Default content type to use when encoding/decoding a message's payload." + }, + channels: { + $ref: "http://asyncapi.com/definitions/3.0.0/channels.json" + }, + operations: { + $ref: "http://asyncapi.com/definitions/3.0.0/operations.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/3.0.0/components.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/3.0.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/3.0.0/info.json": { + $id: "http://asyncapi.com/definitions/3.0.0/info.json", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + allOf: [ + { + type: "object", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/3.0.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/3.0.0/license.json" + }, + tags: { + type: "array", + description: "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + } + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/infoExtensions.json" + } + ], + examples: [ + { + title: "AsyncAPI Sample App", + version: "1.0.1", + description: "This is a sample app.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.asyncapi.org/support", + email: "support@asyncapi.org" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + externalDocs: { + description: "Find more info here", + url: "https://www.asyncapi.org" + }, + tags: [ + { + name: "e-commerce" + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/contact.json": { + $id: "http://asyncapi.com/definitions/3.0.0/contact.json", + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/license.json": { + $id: "http://asyncapi.com/definitions/3.0.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/Reference.json": { + $id: "http://asyncapi.com/definitions/3.0.0/Reference.json", + type: "object", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + required: [ + "$ref" + ], + properties: { + $ref: { + description: "The reference string.", + $ref: "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + } + }, + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/3.0.0/tag.json": { + $id: "http://asyncapi.com/definitions/3.0.0/tag.json", + type: "object", + description: "Allows adding metadata to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag. CommonMark syntax can be used for rich text representation." + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/3.0.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + url: { + type: "string", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/infoExtensions.json": { + $id: "http://asyncapi.com/definitions/3.0.0/infoExtensions.json", + type: "object", + description: "The object that lists all the extensions of Info", + properties: { + "x-x": { + $ref: "http://asyncapi.com/extensions/x/0.1.0/schema.json" + }, + "x-linkedin": { + $ref: "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json" + } + } + }, + "http://asyncapi.com/extensions/x/0.1.0/schema.json": { + $id: "http://asyncapi.com/extensions/x/0.1.0/schema.json", + type: "string", + description: "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + example: [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json": { + $id: "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json", + type: "string", + pattern: "^http(s)?://(www\\.)?linkedin\\.com.*$", + description: "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + example: [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + "http://asyncapi.com/definitions/3.0.0/servers.json": { + $id: "http://asyncapi.com/definitions/3.0.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/server.json" + } + ] + }, + examples: [ + { + development: { + host: "localhost:5672", + description: "Development AMQP broker.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests." + } + ] + }, + staging: { + host: "rabbitmq-staging.in.mycompany.com:5672", + description: "RabbitMQ broker for the staging environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment." + } + ] + }, + production: { + host: "rabbitmq.in.mycompany.com:5672", + description: "RabbitMQ broker for the production environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users." + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/server.json": { + $id: "http://asyncapi.com/definitions/3.0.0/server.json", + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + required: [ + "host", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + host: { + type: "string", + description: "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + pathname: { + type: "string", + description: "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + title: { + type: "string", + description: "A human-friendly title for the server." + }, + summary: { + type: "string", + description: "A brief summary of the server." + }, + description: { + type: "string", + description: "A longer description of the server. CommonMark is allowed." + }, + protocol: { + type: "string", + description: "The protocol this server supports for connection." + }, + protocolVersion: { + type: "string", + description: "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." + }, + variables: { + $ref: "http://asyncapi.com/definitions/3.0.0/serverVariables.json" + }, + security: { + $ref: "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] + } + }, + examples: [ + { + host: "kafka.in.mycompany.com:9092", + description: "Production Kafka broker.", + protocol: "kafka", + protocolVersion: "3.2" + }, + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/production", + protocol: "amqp", + description: "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/3.0.0/serverVariables.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/3.0.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + }, + examples: [ + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/{env}", + protocol: "amqp", + description: "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + variables: { + env: { + description: "Environment to connect to. It can be either `production` or `staging`.", + enum: [ + "production", + "staging" + ] + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/securityRequirements.json": { + $id: "http://asyncapi.com/definitions/3.0.0/securityRequirements.json", + description: "An array representing security requirements.", + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json", + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/3.0.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/3.0.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: " The location of the API key.", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/X509.json": { + $id: "http://asyncapi.com/definitions/3.0.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." + }, + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json", + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + } + }, + additionalProperties: false + }, + scopes: { + type: "array", + description: "List of the needed scope names.", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json", + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + availableScopes: { + $ref: "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + availableScopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/3.0.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/3.0.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + }, + openIdConnectUrl: { + type: "string", + format: "uri", + description: "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + }, + scopes: { + type: "array", + description: "List of the needed scope names. An empty array means no scopes are needed.", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/server.json" + } + } + ] + }, + anypointmq: {}, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + } + ] + }, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + } + ] + }, + solace: { + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.3.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.2.0/server.json" + } + } + ] + }, + googlepubsub: {}, + pulsar: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/server.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json", + title: "Server Schema", + description: "This object contains information about the server representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + clientId: { + type: "string", + description: "The client identifier." + }, + cleanSession: { + type: "boolean", + description: "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + lastWill: { + type: "object", + description: "Last Will and Testament configuration.", + properties: { + topic: { + type: "string", + description: "The topic where the Last Will and Testament message will be sent." + }, + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + message: { + type: "string", + description: "Last Will message." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + keepAlive: { + type: "integer", + description: "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + sessionExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + maximumPacketSize: { + oneOf: [ + { + type: "integer", + minimum: 1, + maximum: 4294967295 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + clientId: "guest", + cleanSession: true, + lastWill: { + topic: "/last-wills", + qos: 2, + message: "Guest gone offline.", + retain: false + }, + keepAlive: 60, + sessionExpiryInterval: 120, + maximumPacketSize: 1024, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/schema.json": { + $id: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + deprecated: { + type: "boolean", + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/bindings/kafka/0.5.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/server.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/server.json", + title: "Server Schema", + description: "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "jmsConnectionFactory" + ], + properties: { + jmsConnectionFactory: { + type: "string", + description: "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + properties: { + type: "array", + items: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property" + }, + description: "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + clientID: { + type: "string", + description: "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + definitions: { + property: { + type: "object", + required: [ + "name", + "value" + ], + properties: { + name: { + type: "string", + description: "The name of a property" + }, + value: { + type: [ + "string", + "boolean", + "number", + "null" + ], + description: "The name of a property" + } + } + } + }, + examples: [ + { + jmsConnectionFactory: "org.apache.activemq.ActiveMQConnectionFactory", + properties: [ + { + name: "disableTimeStampsByDefault", + value: false + } + ], + clientID: "my-application-1", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + title: "IBM MQ server bindings object", + description: "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + type: "string", + description: "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + ccdtQueueManagerName: { + type: "string", + default: "*", + description: "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + cipherSpec: { + type: "string", + description: "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + multiEndpointServer: { + type: "boolean", + default: false, + description: "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + heartBeatInterval: { + type: "integer", + minimum: 0, + maximum: 999999, + default: 300, + description: "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + groupId: "PRODCLSTR1", + cipherSpec: "ANY_TLS12_OR_HIGHER", + bindingVersion: "0.1.0" + }, + { + groupId: "PRODCLSTR1", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.4.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.4.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + clientName: { + type: "string", + minLength: 1, + maxLength: 160, + description: "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.3.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.2.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msvVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/server.json": { + $id: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json", + title: "Server Schema", + description: "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + tenant: { + type: "string", + description: "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + tenant: "contoso", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channels.json": { + $id: "http://asyncapi.com/definitions/3.0.0/channels.json", + type: "object", + description: "An object containing all the Channel Object definitions the Application MUST use during runtime.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/channel.json" + } + ] + }, + examples: [ + { + userSignedUp: { + address: "user.signedup", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channel.json": { + $id: "http://asyncapi.com/definitions/3.0.0/channel.json", + type: "object", + description: "Describes a shared communication channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + address: { + type: [ + "string", + "null" + ], + description: 'An optional string representation of this channel\'s address. The address is typically the "topic name", "routing key", "event type", or "path". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can\'t be known upfront. It MAY contain Channel Address Expressions.' + }, + messages: { + $ref: "http://asyncapi.com/definitions/3.0.0/channelMessages.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/3.0.0/parameters.json" + }, + title: { + type: "string", + description: "A human-friendly title for the channel." + }, + summary: { + type: "string", + description: "A brief summary of the channel." + }, + description: { + type: "string", + description: "A longer description of the channel. CommonMark is allowed." + }, + servers: { + type: "array", + description: "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + uniqueItems: true + }, + tags: { + type: "array", + description: "A list of tags for logical grouping of channels.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] + } + }, + examples: [ + { + address: "users.{userId}", + title: "Users channel", + description: "This channel is used to exchange messages about user events.", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + }, + userCompletedOrder: { + $ref: "#/components/messages/userCompletedOrder" + } + }, + parameters: { + userId: { + $ref: "#/components/parameters/userId" + } + }, + servers: [ + { + $ref: "#/servers/rabbitmqInProd" + }, + { + $ref: "#/servers/rabbitmqInStaging" + } + ], + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + }, + tags: [ + { + name: "user", + description: "User-related messages" + } + ], + externalDocs: { + description: "Find more info here", + url: "https://example.com" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channelMessages.json": { + $id: "http://asyncapi.com/definitions/3.0.0/channelMessages.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageObject.json" + } + ] + }, + description: "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**" + }, + "http://asyncapi.com/definitions/3.0.0/messageObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/messageObject.json", + type: "object", + description: "Describes a message received on a given channel and operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + payload: { + $ref: "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" + } + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + }, + traits: { + type: "array", + description: "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + }, + { + type: "array", + items: [ + { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + } + ] + }, + { + type: "object", + additionalItems: true + } + ] + } + ] + } + } + }, + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/anySchema.json": { + $id: "http://asyncapi.com/definitions/3.0.0/anySchema.json", + if: { + required: [ + "schema" + ] + }, + then: { + $ref: "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" + }, + else: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + description: "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." + }, + "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json": { + $id: "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", + description: "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + if: { + not: { + type: "object" + } + }, + then: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + else: { + properties: { + schemaFormat: { + description: "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + anyOf: [ + { + type: "string" + }, + { + description: "All the schema formats tooling MUST support", + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + }, + { + description: "All the schema formats tools are RECOMMENDED to support", + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + }, + allOf: [ + { + if: { + not: { + description: "If no schemaFormat has been defined, default to schema or reference", + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + schema: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + } + }, + { + if: { + description: "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] + } + } + } + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/3.0.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/3.0.0/correlationId.json", + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json", + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Example of the application headers. It MUST be a map of key-value pairs." + }, + payload: { + type: [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + description: "Example of the message payload. It can be of any type." + } + } + }, + "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for a message.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + http: { + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/message.json" + } + } + ] + }, + ws: {}, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + } + ] + }, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + } + } + ] + }, + anypointmq: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + } + ] + }, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + } + ] + }, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + } + ] + }, + solace: {}, + googlepubsub: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/http/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/http/0.3.0/message.json", + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + statusCode: { + type: "number", + description: "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/http/0.2.0/message.json", + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/message.json", + title: "AMQP message bindings object", + description: "This object contains information about the message representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + contentEncoding: { + type: "string", + description: "A MIME encoding for the message content." + }, + messageType: { + type: "string", + description: "Application-specific message type." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + contentEncoding: "gzip", + messageType: "user.signup", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json", + title: "MQTT message bindings object", + description: "This object contains information about the message representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + payloadFormatIndicator: { + type: "integer", + enum: [ + 0, + 1 + ], + description: "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + default: 0 + }, + correlationData: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + contentType: { + type: "string", + description: "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + responseTopic: { + oneOf: [ + { + type: "string", + format: "uri-template", + minLength: 1 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "The topic (channel URI) to be used for a response message." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + bindingVersion: "0.2.0" + }, + { + contentType: "application/json", + correlationData: { + type: "string", + format: "uuid" + }, + responseTopic: "application/responses", + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.5.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.4.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.3.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json": { + $id: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", + title: "Anypoint MQ message bindings object", + description: "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + messageId: { + type: "string" + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/message.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/message.json", + title: "Message Schema", + description: "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + required: [ + "JMSMessageID" + ], + properties: { + JMSMessageID: { + type: [ + "string", + "null" + ], + description: "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + JMSTimestamp: { + type: "integer", + description: "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + JMSDeliveryMode: { + type: "string", + enum: [ + "PERSISTENT", + "NON_PERSISTENT" + ], + default: "PERSISTENT", + description: "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + JMSPriority: { + type: "integer", + default: 4, + description: "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + JMSExpires: { + type: "integer", + description: "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + JMSType: { + type: [ + "string", + "null" + ], + description: "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + JMSCorrelationID: { + type: [ + "string", + "null" + ], + description: "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + JMSReplyTo: { + type: "string", + description: "The queue or topic that the message sender expects replies to." + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + title: "IBM MQ message bindings object", + description: "This object contains information about the message representation in IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + type: { + type: "string", + enum: [ + "string", + "jms", + "binary" + ], + default: "string", + description: "The type of the message." + }, + headers: { + type: "string", + description: "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + description: { + type: "string", + description: "Provides additional information for application developers: describes the message type or format." + }, + expiry: { + type: "integer", + minimum: 0, + default: 0, + description: "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + type: { + const: "binary" + } + } + }, + { + properties: { + type: { + const: "jms" + } + }, + not: { + required: [ + "headers" + ] + } + }, + { + properties: { + type: { + const: "string" + } + }, + not: { + required: [ + "headers" + ] + } + } + ], + examples: [ + { + type: "string", + bindingVersion: "0.1.0" + }, + { + type: "jms", + description: "JMS stream message", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json", + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the message representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + attributes: { + type: "object" + }, + orderingKey: { + type: "string" + }, + schema: { + type: "object", + additionalItems: false, + properties: { + name: { + type: "string" + } + }, + required: [ + "name" + ] + } + }, + examples: [ + { + schema: { + name: "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + schema: { + name: "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/3.0.0/messageTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/anySchema.json" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/messageExampleObject.json" + } + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + } + }, + examples: [ + { + contentType: "application/json" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/parameters.json": { + $id: "http://asyncapi.com/definitions/3.0.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters.", + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user." + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/parameter.json": { + $id: "http://asyncapi.com/definitions/3.0.0/parameter.json", + description: "Describes a parameter included in a channel address.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + examples: { + description: "An array of examples of the parameter value.", + type: "array", + items: { + type: "string" + } + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user.", + location: "$message.payload#/user/id" + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for a channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + http: {}, + ws: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + } + ] + }, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + } + ] + }, + amqp1: {}, + mqtt: {}, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + } + } + ] + }, + anypointmq: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + } + ] + }, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + } + ] + }, + sns: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + } + ] + }, + sqs: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + } + ] + }, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + } + ] + }, + solace: {}, + googlepubsub: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + } + ] + }, + pulsar: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + } + ] + } + } + }, + "http://asyncapi.com/bindings/websockets/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", + title: "WebSockets channel bindings object", + description: "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "POST" + ], + description: "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + query: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + headers: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + method: "POST", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/channel.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json", + title: "AMQP channel bindings object", + description: "This object contains information about the channel representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + is: { + type: "string", + enum: [ + "queue", + "routingKey" + ], + description: "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + exchange: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + type: { + type: "string", + enum: [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + description: "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + durable: { + type: "boolean", + description: "Whether the exchange should survive broker restarts or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the exchange should be deleted when the last queue is unbound from it." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the exchange. Defaults to '/'." + } + }, + description: "When is=routingKey, this object defines the exchange properties." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the queue. It MUST NOT exceed 255 characters long." + }, + durable: { + type: "boolean", + description: "Whether the queue should survive broker restarts or not." + }, + exclusive: { + type: "boolean", + description: "Whether the queue should be used only by one connection or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the queue should be deleted when the last consumer unsubscribes." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the queue. Defaults to '/'." + } + }, + description: "When is=queue, this object defines the queue properties." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + oneOf: [ + { + properties: { + is: { + const: "routingKey" + } + }, + required: [ + "exchange" + ], + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + is: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "exchange" + ] + } + } + ], + examples: [ + { + is: "routingKey", + exchange: { + name: "myExchange", + type: "topic", + durable: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + }, + { + is: "queue", + queue: { + name: "my-queue-name", + durable: true, + exclusive: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: true, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + }, + "confluent.key.schema.validation": { + description: "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + type: "boolean" + }, + "confluent.key.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + type: "string" + }, + "confluent.value.schema.validation": { + description: "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + type: "boolean" + }, + "confluent.value.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + type: "string" + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: false, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json": { + $id: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", + title: "Anypoint MQ channel bindings object", + description: "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "exchange", + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signup-exchg", + destinationType: "exchange", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/channel.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/channel.json", + title: "Channel Schema", + description: "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signed-up", + destinationType: "fifo-queue", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/sns/0.1.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + name: { + type: "string", + description: "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + ordering: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the topic." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "name" + ], + definitions: { + ordering: { + type: "object", + description: "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + type: { + type: "string", + description: "Defines the type of SNS Topic.", + enum: [ + "standard", + "FIFO" + ] + }, + contentBasedDeduplication: { + type: "boolean", + description: "True to turn on de-duplication of messages for a channel." + } + }, + required: [ + "type" + ] + }, + policy: { + type: "object", + description: "The security policy for the SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this topic", + items: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SNS permission being allowed or denied e.g. sns:Publish", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + name: "my-sns-topic", + policy: { + statements: [ + { + effect: "Allow", + principal: "*", + action: "SNS:Publish" + } + ] + } + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/channel.json": { + $id: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queue: { + description: "A definition of the queue that will be used as the channel.", + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + deadLetterQueue: { + description: "A definition of the queue that will be used for un-processable messages.", + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queue" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name", + "fifoQueue" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queue: { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 15, + visibilityTimeout: 60, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 86400, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + tags: { + owner: "AsyncAPI.NET", + platform: "AsyncAPIOrg" + } + }, + deadLetterQueue: { + name: "myQueue_error", + deliveryDelay: 0, + visibilityTimeout: 0, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 604800 + } + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", + title: "IBM MQ channel bindings object", + description: "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destinationType: { + type: "string", + enum: [ + "topic", + "queue" + ], + default: "topic", + description: "Defines the type of AsyncAPI channel." + }, + queue: { + type: "object", + description: "Defines the properties of a queue.", + properties: { + objectName: { + type: "string", + maxLength: 48, + description: "Defines the name of the IBM MQ queue associated with the channel." + }, + isPartitioned: { + type: "boolean", + default: false, + description: "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + exclusive: { + type: "boolean", + default: false, + description: "Specifies if it is recommended to open the queue exclusively." + } + }, + required: [ + "objectName" + ] + }, + topic: { + type: "object", + description: "Defines the properties of a topic.", + properties: { + string: { + type: "string", + maxLength: 10240, + description: "The value of the IBM MQ topic string to be used." + }, + objectName: { + type: "string", + maxLength: 48, + description: "The name of the IBM MQ topic object." + }, + durablePermitted: { + type: "boolean", + default: true, + description: "Defines if the subscription may be durable." + }, + lastMsgRetained: { + type: "boolean", + default: false, + description: "Defines if the last message published will be made available to new subscriptions." + } + } + }, + maxMsgLength: { + type: "integer", + minimum: 0, + maximum: 104857600, + description: "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + destinationType: { + const: "topic" + } + }, + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + destinationType: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "topic" + ] + } + } + ], + examples: [ + { + destinationType: "topic", + topic: { + objectName: "myTopicName" + }, + bindingVersion: "0.1.0" + }, + { + destinationType: "queue", + queue: { + objectName: "myQueueName", + exclusive: true + }, + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json": { + $id: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json", + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the channel representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + labels: { + type: "object" + }, + messageRetentionDuration: { + type: "string" + }, + messageStoragePolicy: { + type: "object", + additionalProperties: false, + properties: { + allowedPersistenceRegions: { + type: "array", + items: { + type: "string" + } + } + } + }, + schemaSettings: { + type: "object", + additionalItems: false, + properties: { + encoding: { + type: "string" + }, + firstRevisionId: { + type: "string" + }, + lastRevisionId: { + type: "string" + }, + name: { + type: "string" + } + }, + required: [ + "encoding", + "name" + ] + } + }, + required: [ + "schemaSettings" + ], + examples: [ + { + labels: { + label1: "value1", + label2: "value2" + }, + messageRetentionDuration: "86400s", + messageStoragePolicy: { + allowedPersistenceRegions: [ + "us-central1", + "us-east1" + ] + }, + schemaSettings: { + encoding: "json", + name: "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "namespace", + "persistence" + ], + properties: { + namespace: { + type: "string", + description: "The namespace, the channel is associated with." + }, + persistence: { + type: "string", + enum: [ + "persistent", + "non-persistent" + ], + description: "persistence of the topic in Pulsar." + }, + compaction: { + type: "integer", + minimum: 0, + description: "Topic compaction threshold given in MB" + }, + "geo-replication": { + type: "array", + description: "A list of clusters the topic is replicated to.", + items: { + type: "string" + } + }, + retention: { + type: "object", + additionalProperties: false, + properties: { + time: { + type: "integer", + minimum: 0, + description: "Time given in Minutes. `0` = Disable message retention." + }, + size: { + type: "integer", + minimum: 0, + description: "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + ttl: { + type: "integer", + description: "TTL in seconds for the specified topic" + }, + deduplication: { + type: "boolean", + description: "Whether deduplication of events is enabled or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + namespace: "ns1", + persistence: "persistent", + compaction: 1e3, + retention: { + time: 15, + size: 1e3 + }, + ttl: 360, + "geo-replication": [ + "us-west", + "us-east" + ], + deduplication: true, + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operations.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operations.json", + type: "object", + description: "Holds a dictionary with all the operations this application MUST implement.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + }, + examples: [ + { + onUserSignUp: { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operation.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operation.json", + type: "object", + description: "Describes a specific operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "action", + "channel" + ], + properties: { + action: { + type: "string", + description: "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + enum: [ + "send", + "receive" + ] + }, + channel: { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + messages: { + type: "array", + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + }, + reply: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + }, + traits: { + type: "array", + description: "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + } + ] + } + }, + title: { + type: "string", + description: "A human-friendly title for the operation." + }, + summary: { + type: "string", + description: "A brief summary of the operation." + }, + description: { + type: "string", + description: "A longer description of the operation. CommonMark is allowed." + }, + security: { + $ref: "http://asyncapi.com/definitions/3.0.0/securityRequirements.json" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + }, + examples: [ + { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + security: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ], + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ], + messages: [ + { + $ref: "/components/messages/userSignedUp" + } + ], + reply: { + address: { + location: "$message.header#/replyTo" + }, + channel: { + $ref: "#/channels/userSignupReply" + }, + messages: [ + { + $ref: "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationReply.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operationReply.json", + type: "object", + description: "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + address: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + }, + channel: { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + messages: { + type: "array", + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + } + } + }, + "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json", + type: "object", + description: "An object that specifies where an operation has to send the reply", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "location" + ], + properties: { + location: { + type: "string", + description: "A runtime expression that specifies the location of the reply address.", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + description: { + type: "string", + description: "An optional description of the address. CommonMark is allowed." + } + }, + examples: [ + { + description: "Consumer inbox", + location: "$message.header#/replyTo" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operationTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + title: { + description: "A human-friendly title for the operation.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title" + }, + summary: { + description: "A short summary of what the operation is about.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + }, + description: { + description: "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" + }, + security: { + description: "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + }, + externalDocs: { + description: "Additional external documentation for this operation.", + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for an operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + http: { + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/operation.json" + } + } + ] + }, + ws: {}, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + } + ] + }, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" + } + } + ] + }, + anypointmq: {}, + nats: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + } + ] + }, + jms: {}, + sns: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + } + ] + }, + sqs: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ] + }, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: { + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + } + } + ] + }, + googlepubsub: {} + } + }, + "http://asyncapi.com/bindings/http/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/http/0.3.0/operation.json", + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/http/0.2.0/operation.json", + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json", + title: "AMQP operation bindings object", + description: "This object contains information about the operation representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + expiration: { + type: "integer", + minimum: 0, + description: "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + userId: { + type: "string", + description: "Identifies the user who has sent the message." + }, + cc: { + type: "array", + items: { + type: "string" + }, + description: "The routing keys the message should be routed to at the time of publishing." + }, + priority: { + type: "integer", + description: "A priority for the message." + }, + deliveryMode: { + type: "integer", + enum: [ + 1, + 2 + ], + description: "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + mandatory: { + type: "boolean", + description: "Whether the message is mandatory or not." + }, + bcc: { + type: "array", + items: { + type: "string" + }, + description: "Like cc but consumers will not receive this information." + }, + timestamp: { + type: "boolean", + description: "Whether the message should include a timestamp or not." + }, + ack: { + type: "boolean", + description: "Whether the consumer should ack the message or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + expiration: 1e5, + userId: "guest", + cc: [ + "user.logs" + ], + priority: 10, + deliveryMode: 2, + mandatory: false, + bcc: [ + "external.audit" + ], + timestamp: true, + ack: false, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json", + title: "MQTT operation bindings object", + description: "This object contains information about the operation representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the message or not." + }, + messageExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0, + maximum: 4294967295 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Lifetime of the message in seconds" + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + qos: 2, + retain: true, + messageExpiryInterval: 60, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + $id: "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + title: "NATS operation bindings object", + description: "This object contains information about the operation representation in NATS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queue: { + type: "string", + description: "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + maxLength: 255 + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + queue: "MyCustomQueue", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/operation.json": { + $id: "http://asyncapi.com/bindings/sns/0.1.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + description: "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + consumers: { + type: "array", + description: "The protocols that listen to this topic and their endpoints.", + items: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer" + }, + minItems: 1 + }, + deliveryPolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "consumers" + ], + definitions: { + identifier: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string", + description: "The endpoint is a URL." + }, + email: { + type: "string", + description: "The endpoint is an email address." + }, + phone: { + type: "string", + description: "The endpoint is a phone number." + }, + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + consumer: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + protocol: { + description: "The protocol that this endpoint receives messages by.", + type: "string", + enum: [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + endpoint: { + description: "The endpoint messages are delivered to.", + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier" + }, + filterPolicy: { + type: "object", + description: "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: { + oneOf: [ + { + type: "array", + items: { + type: "string" + } + }, + { + type: "string" + }, + { + type: "object" + } + ] + } + }, + filterPolicyScope: { + type: "string", + description: "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + enum: [ + "MessageAttributes", + "MessageBody" + ], + default: "MessageAttributes" + }, + rawMessageDelivery: { + type: "boolean", + description: "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy" + }, + deliveryPolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + displayName: { + type: "string", + description: "The display name to use with an SNS subscription" + } + }, + required: [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + deliveryPolicy: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + minDelayTarget: { + type: "integer", + description: "The minimum delay for a retry in seconds." + }, + maxDelayTarget: { + type: "integer", + description: "The maximum delay for a retry in seconds." + }, + numRetries: { + type: "integer", + description: "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + numNoDelayRetries: { + type: "integer", + description: "The number of immediate retries (with no delay)." + }, + numMinDelayRetries: { + type: "integer", + description: "The number of immediate retries (with delay)." + }, + numMaxDelayRetries: { + type: "integer", + description: "The number of post-backoff phase retries, with the maximum delay between retries." + }, + backoffFunction: { + type: "string", + description: "The algorithm for backoff between retries.", + enum: [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + maxReceivesPerSecond: { + type: "integer", + description: "The maximum number of deliveries per second, per subscription." + } + } + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + description: "The SQS queue to use as a dead letter queue (DLQ)." + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + } + }, + examples: [ + { + topic: { + name: "someTopic" + }, + consumers: [ + { + protocol: "sqs", + endpoint: { + name: "someQueue" + }, + filterPolicy: { + store: [ + "asyncapi_corp" + ], + event: [ + { + "anything-but": "order_cancelled" + } + ], + customer_interests: [ + "rugby", + "football", + "baseball" + ] + }, + filterPolicyScope: "MessageAttributes", + rawMessageDelivery: false, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 25 + }, + deliveryPolicy: { + minDelayTarget: 10, + maxDelayTarget: 100, + numRetries: 5, + numNoDelayRetries: 2, + numMinDelayRetries: 3, + numMaxDelayRetries: 5, + backoffFunction: "linear", + maxReceivesPerSecond: 2 + } + } + ] + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queues: { + type: "array", + description: "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue" + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queues" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + $ref: { + type: "string", + description: "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queues: [ + { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 10, + redrivePolicy: { + deadLetterQueue: { + name: "myQueue_error" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + name: "myQueue_error", + deliveryDelay: 10 + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.4.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.4.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + }, + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + timeToLive: { + type: "integer", + description: "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + priority: { + type: "integer", + minimum: 0, + maximum: 255, + description: "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + dmqEligible: { + type: "boolean", + description: "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + examples: [ + { + bindingVersion: "0.4.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.3.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.3.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.2.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.2.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/components.json": { + $id: "http://asyncapi.com/definitions/3.0.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemas: { + type: "object", + description: "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/anySchema.json" + } + } + }, + servers: { + type: "object", + description: "An object to hold reusable Server Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/server.json" + } + ] + } + } + }, + channels: { + type: "object", + description: "An object to hold reusable Channel Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/channel.json" + } + ] + } + } + }, + serverVariables: { + type: "object", + description: "An object to hold reusable Server Variable Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/serverVariable.json" + } + ] + } + } + }, + operations: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + } + } + }, + messages: { + type: "object", + description: "An object to hold reusable Message Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageObject.json" + } + ] + } + } + }, + securitySchemes: { + type: "object", + description: "An object to hold reusable Security Scheme Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + type: "object", + description: "An object to hold reusable Parameter Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/parameter.json" + } + ] + } + } + }, + correlationIds: { + type: "object", + description: "An object to hold reusable Correlation ID Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + description: "An object to hold reusable Operation Trait Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationTrait.json" + } + ] + } + } + }, + messageTraits: { + type: "object", + description: "An object to hold reusable Message Trait Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageTrait.json" + } + ] + } + } + }, + replies: { + type: "object", + description: "An object to hold reusable Operation Reply Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationReply.json" + } + ] + } + } + }, + replyAddresses: { + type: "object", + description: "An object to hold reusable Operation Reply Address Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" + } + ] + } + } + }, + serverBindings: { + type: "object", + description: "An object to hold reusable Server Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] + } + } + }, + channelBindings: { + type: "object", + description: "An object to hold reusable Channel Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] + } + } + }, + operationBindings: { + type: "object", + description: "An object to hold reusable Operation Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + } + }, + messageBindings: { + type: "object", + description: "An object to hold reusable Message Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] + } + } + }, + tags: { + type: "object", + description: "An object to hold reusable Tag Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] + } + } + }, + externalDocs: { + type: "object", + description: "An object to hold reusable External Documentation Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + } + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + AvroExample: { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + schema: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + }, + servers: { + development: { + host: "{stage}.in.mycompany.com:{port}", + description: "RabbitMQ broker", + protocol: "amqp", + protocolVersion: "0-9-1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `mycompany.com`" + }, + port: { + enum: [ + "5671", + "5672" + ], + default: "5672" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user." + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/3.1.0.json +var require__10 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/3.1.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/3.1.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 3.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info" + ], + properties: { + id: { + description: "A unique id representing the application.", + type: "string", + format: "uri" + }, + asyncapi: { + description: "The AsyncAPI specification version of this document.", + type: "string", + const: "3.1.0" + }, + channels: { + $ref: "http://asyncapi.com/definitions/3.1.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/3.1.0/components.json" + }, + defaultContentType: { + description: "Default content type to use when encoding/decoding a message's payload.", + type: "string" + }, + info: { + $ref: "http://asyncapi.com/definitions/3.1.0/info.json" + }, + operations: { + $ref: "http://asyncapi.com/definitions/3.1.0/operations.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/3.1.0/servers.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + definitions: { + "http://asyncapi.com/definitions/3.1.0/channels.json": { + $id: "http://asyncapi.com/definitions/3.1.0/channels.json", + description: "An object containing all the Channel Object definitions the Application MUST use during runtime.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/channel.json" + } + ] + }, + examples: [ + { + userSignedUp: { + address: "user.signedup", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/Reference.json": { + $id: "http://asyncapi.com/definitions/3.1.0/Reference.json", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + description: "The reference string.", + $ref: "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json" + } + }, + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/3.1.0/channel.json": { + $id: "http://asyncapi.com/definitions/3.1.0/channel.json", + description: "Describes a shared communication channel.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the channel.", + type: "string" + }, + description: { + description: "A longer description of the channel. CommonMark is allowed.", + type: "string" + }, + address: { + description: 'An optional string representation of this channel\'s address. The address is typically the "topic name", "routing key", "event type", or "path". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can\'t be known upfront. It MAY contain Channel Address Expressions.', + type: [ + "string", + "null" + ] + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + messages: { + $ref: "http://asyncapi.com/definitions/3.1.0/channelMessages.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/3.1.0/parameters.json" + }, + servers: { + description: "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + type: "array", + uniqueItems: true, + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + } + }, + summary: { + description: "A brief summary of the channel.", + type: "string" + }, + tags: { + description: "A list of tags for logical grouping of channels.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + address: "users.{userId}", + title: "Users channel", + description: "This channel is used to exchange messages about user events.", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + }, + userCompletedOrder: { + $ref: "#/components/messages/userCompletedOrder" + } + }, + parameters: { + userId: { + $ref: "#/components/parameters/userId" + } + }, + servers: [ + { + $ref: "#/servers/rabbitmqInProd" + }, + { + $ref: "#/servers/rabbitmqInStaging" + } + ], + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + }, + tags: [ + { + name: "user", + description: "User-related messages" + } + ], + externalDocs: { + description: "Find more info here", + url: "https://example.com" + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json", + description: "Map describing protocol-specific definitions for a channel.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + googlepubsub: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + http: {}, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: {}, + nats: {}, + pulsar: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + sns: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + solace: {}, + sqs: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + stomp: {}, + ws: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/bindings/amqp/0.3.0/channel.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/channel.json", + title: "AMQP channel bindings object", + description: "This object contains information about the channel representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + is: { + type: "string", + enum: [ + "queue", + "routingKey" + ], + description: "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + exchange: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + type: { + type: "string", + enum: [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + description: "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + durable: { + type: "boolean", + description: "Whether the exchange should survive broker restarts or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the exchange should be deleted when the last queue is unbound from it." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the exchange. Defaults to '/'." + } + }, + description: "When is=routingKey, this object defines the exchange properties." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the queue. It MUST NOT exceed 255 characters long." + }, + durable: { + type: "boolean", + description: "Whether the queue should survive broker restarts or not." + }, + exclusive: { + type: "boolean", + description: "Whether the queue should be used only by one connection or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the queue should be deleted when the last consumer unsubscribes." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the queue. Defaults to '/'." + } + }, + description: "When is=queue, this object defines the queue properties." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + oneOf: [ + { + properties: { + is: { + const: "routingKey" + } + }, + required: [ + "exchange" + ], + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + is: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "exchange" + ] + } + } + ], + examples: [ + { + is: "routingKey", + exchange: { + name: "myExchange", + type: "topic", + durable: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + }, + { + is: "queue", + queue: { + name: "my-queue-name", + durable: true, + exclusive: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json": { + $id: "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", + title: "Anypoint MQ channel bindings object", + description: "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "exchange", + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signup-exchg", + destinationType: "exchange", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json": { + $id: "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json", + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the channel representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + labels: { + type: "object" + }, + messageRetentionDuration: { + type: "string" + }, + messageStoragePolicy: { + type: "object", + additionalProperties: false, + properties: { + allowedPersistenceRegions: { + type: "array", + items: { + type: "string" + } + } + } + }, + schemaSettings: { + type: "object", + additionalItems: false, + properties: { + encoding: { + type: "string" + }, + firstRevisionId: { + type: "string" + }, + lastRevisionId: { + type: "string" + }, + name: { + type: "string" + } + }, + required: [ + "encoding", + "name" + ] + } + }, + required: [ + "schemaSettings" + ], + examples: [ + { + labels: { + label1: "value1", + label2: "value2" + }, + messageRetentionDuration: "86400s", + messageStoragePolicy: { + allowedPersistenceRegions: [ + "us-central1", + "us-east1" + ] + }, + schemaSettings: { + encoding: "json", + name: "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", + title: "IBM MQ channel bindings object", + description: "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destinationType: { + type: "string", + enum: [ + "topic", + "queue" + ], + default: "topic", + description: "Defines the type of AsyncAPI channel." + }, + queue: { + type: "object", + description: "Defines the properties of a queue.", + properties: { + objectName: { + type: "string", + maxLength: 48, + description: "Defines the name of the IBM MQ queue associated with the channel." + }, + isPartitioned: { + type: "boolean", + default: false, + description: "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + exclusive: { + type: "boolean", + default: false, + description: "Specifies if it is recommended to open the queue exclusively." + } + }, + required: [ + "objectName" + ] + }, + topic: { + type: "object", + description: "Defines the properties of a topic.", + properties: { + string: { + type: "string", + maxLength: 10240, + description: "The value of the IBM MQ topic string to be used." + }, + objectName: { + type: "string", + maxLength: 48, + description: "The name of the IBM MQ topic object." + }, + durablePermitted: { + type: "boolean", + default: true, + description: "Defines if the subscription may be durable." + }, + lastMsgRetained: { + type: "boolean", + default: false, + description: "Defines if the last message published will be made available to new subscriptions." + } + } + }, + maxMsgLength: { + type: "integer", + minimum: 0, + maximum: 104857600, + description: "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + destinationType: { + const: "topic" + } + }, + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + destinationType: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "topic" + ] + } + } + ], + examples: [ + { + destinationType: "topic", + topic: { + objectName: "myTopicName" + }, + bindingVersion: "0.1.0" + }, + { + destinationType: "queue", + queue: { + objectName: "myQueueName", + exclusive: true + }, + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/channel.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/channel.json", + title: "Channel Schema", + description: "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signed-up", + destinationType: "fifo-queue", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: true, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + }, + "confluent.key.schema.validation": { + description: "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + type: "boolean" + }, + "confluent.key.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + type: "string" + }, + "confluent.value.schema.validation": { + description: "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + type: "boolean" + }, + "confluent.value.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + type: "string" + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: false, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/channel.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "namespace", + "persistence" + ], + properties: { + namespace: { + type: "string", + description: "The namespace, the channel is associated with." + }, + persistence: { + type: "string", + enum: [ + "persistent", + "non-persistent" + ], + description: "persistence of the topic in Pulsar." + }, + compaction: { + type: "integer", + minimum: 0, + description: "Topic compaction threshold given in MB" + }, + "geo-replication": { + type: "array", + description: "A list of clusters the topic is replicated to.", + items: { + type: "string" + } + }, + retention: { + type: "object", + additionalProperties: false, + properties: { + time: { + type: "integer", + minimum: 0, + description: "Time given in Minutes. `0` = Disable message retention." + }, + size: { + type: "integer", + minimum: 0, + description: "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + ttl: { + type: "integer", + description: "TTL in seconds for the specified topic" + }, + deduplication: { + type: "boolean", + description: "Whether deduplication of events is enabled or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + namespace: "ns1", + persistence: "persistent", + compaction: 1e3, + retention: { + time: 15, + size: 1e3 + }, + ttl: 360, + "geo-replication": [ + "us-west", + "us-east" + ], + deduplication: true, + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/sns/0.1.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + name: { + type: "string", + description: "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + ordering: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the topic." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "name" + ], + definitions: { + ordering: { + type: "object", + description: "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + type: { + type: "string", + description: "Defines the type of SNS Topic.", + enum: [ + "standard", + "FIFO" + ] + }, + contentBasedDeduplication: { + type: "boolean", + description: "True to turn on de-duplication of messages for a channel." + } + }, + required: [ + "type" + ] + }, + policy: { + type: "object", + description: "The security policy for the SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this topic", + items: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SNS permission being allowed or denied e.g. sns:Publish", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + name: "my-sns-topic", + policy: { + statements: [ + { + effect: "Allow", + principal: "*", + action: "SNS:Publish" + } + ] + } + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/channel.json": { + $id: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json", + title: "Channel Schema", + description: "This object contains information about the channel representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queue: { + description: "A definition of the queue that will be used as the channel.", + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + deadLetterQueue: { + description: "A definition of the queue that will be used for un-processable messages.", + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queue" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name", + "fifoQueue" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queue: { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 15, + visibilityTimeout: 60, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 86400, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + tags: { + owner: "AsyncAPI.NET", + platform: "AsyncAPIOrg" + } + }, + deadLetterQueue: { + name: "myQueue_error", + deliveryDelay: 0, + visibilityTimeout: 0, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 604800 + } + } + ] + }, + "http://asyncapi.com/bindings/websockets/0.1.0/channel.json": { + $id: "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", + title: "WebSockets channel bindings object", + description: "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "POST" + ], + description: "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + query: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + headers: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + method: "POST", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/schema.json": { + $id: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + deprecated: { + type: "boolean", + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/3.0.0/Reference.json": { + $id: "http://asyncapi.com/definitions/3.0.0/Reference.json", + type: "object", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + required: [ + "$ref" + ], + properties: { + $ref: { + description: "The reference string.", + $ref: "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + } + }, + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/3.0.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + url: { + type: "string", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalItems: true, + additionalProperties: true + }, + "http://asyncapi.com/definitions/3.1.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/3.1.0/externalDocs.json", + description: "Allows referencing an external resource for extended documentation.", + type: "object", + required: [ + "url" + ], + properties: { + description: { + description: "A short description of the target documentation. CommonMark syntax can be used for rich text representation.", + type: "string" + }, + url: { + description: "The URL for the target documentation. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/channelMessages.json": { + $id: "http://asyncapi.com/definitions/3.1.0/channelMessages.json", + description: "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageObject.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.1.0/messageObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/messageObject.json", + description: "Describes a message received on a given channel and operation.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the message.", + type: "string" + }, + description: { + description: "A longer description of the message. CommonMark is allowed.", + type: "string" + }, + examples: { + description: "List of examples.", + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/messageExampleObject.json" + } + }, + deprecated: { + default: false, + type: "boolean" + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json" + } + ] + }, + contentType: { + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/correlationId.json" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + headers: { + $ref: "http://asyncapi.com/definitions/3.1.0/anySchema.json" + }, + name: { + description: "Name of the message.", + type: "string" + }, + payload: { + $ref: "http://asyncapi.com/definitions/3.1.0/anySchema.json" + }, + summary: { + description: "A brief summary of the message.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + }, + traits: { + description: "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageTrait.json" + }, + { + type: "array", + items: [ + { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageTrait.json" + } + ] + }, + { + type: "object", + additionalItems: true + } + ] + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/messageExampleObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/messageExampleObject.json", + type: "object", + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + headers: { + description: "Example of the application headers. It can be of any type.", + type: "object" + }, + name: { + description: "Machine readable name of the message example.", + type: "string" + }, + payload: { + description: "Example of the message payload. It can be of any type." + }, + summary: { + description: "A brief summary of the message example.", + type: "string" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json", + description: "Map describing protocol-specific definitions for a message.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + googlepubsub: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + http: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + } + }, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: {}, + redis: {}, + sns: {}, + solace: {}, + sqs: {}, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/bindings/amqp/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/message.json", + title: "AMQP message bindings object", + description: "This object contains information about the message representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + contentEncoding: { + type: "string", + description: "A MIME encoding for the message content." + }, + messageType: { + type: "string", + description: "Application-specific message type." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + contentEncoding: "gzip", + messageType: "user.signup", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json": { + $id: "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", + title: "Anypoint MQ message bindings object", + description: "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + messageId: { + type: "string" + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/googlepubsub/0.2.0/message.json", + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the message representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + attributes: { + type: "object" + }, + orderingKey: { + type: "string" + }, + schema: { + type: "object", + additionalItems: false, + properties: { + name: { + type: "string" + } + }, + required: [ + "name" + ] + } + }, + examples: [ + { + schema: { + name: "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + schema: { + name: "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "http://asyncapi.com/bindings/http/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/http/0.3.0/message.json", + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + statusCode: { + type: "number", + description: "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/http/0.2.0/message.json", + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + title: "IBM MQ message bindings object", + description: "This object contains information about the message representation in IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + type: { + type: "string", + enum: [ + "string", + "jms", + "binary" + ], + default: "string", + description: "The type of the message." + }, + headers: { + type: "string", + description: "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + description: { + type: "string", + description: "Provides additional information for application developers: describes the message type or format." + }, + expiry: { + type: "integer", + minimum: 0, + default: 0, + description: "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + type: { + const: "binary" + } + } + }, + { + properties: { + type: { + const: "jms" + } + }, + not: { + required: [ + "headers" + ] + } + }, + { + properties: { + type: { + const: "string" + } + }, + not: { + required: [ + "headers" + ] + } + } + ], + examples: [ + { + type: "string", + bindingVersion: "0.1.0" + }, + { + type: "jms", + description: "JMS stream message", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/message.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/message.json", + title: "Message Schema", + description: "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + headers: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + required: [ + "JMSMessageID" + ], + properties: { + JMSMessageID: { + type: [ + "string", + "null" + ], + description: "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + JMSTimestamp: { + type: "integer", + description: "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + JMSDeliveryMode: { + type: "string", + enum: [ + "PERSISTENT", + "NON_PERSISTENT" + ], + default: "PERSISTENT", + description: "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + JMSPriority: { + type: "integer", + default: 4, + description: "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + JMSExpires: { + type: "integer", + description: "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + JMSType: { + type: [ + "string", + "null" + ], + description: "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + JMSCorrelationID: { + type: [ + "string", + "null" + ], + description: "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + JMSReplyTo: { + type: "string", + description: "The queue or topic that the message sender expects replies to." + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.5.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.4.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/bindings/kafka/0.3.0/message.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/message.json", + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + key: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.3.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/message.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/message.json", + title: "MQTT message bindings object", + description: "This object contains information about the message representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + payloadFormatIndicator: { + type: "integer", + enum: [ + 0, + 1 + ], + description: "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + default: 0 + }, + correlationData: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + contentType: { + type: "string", + description: "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + responseTopic: { + oneOf: [ + { + type: "string", + format: "uri-template", + minLength: 1 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "The topic (channel URI) to be used for a response message." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + bindingVersion: "0.2.0" + }, + { + contentType: "application/json", + correlationData: { + type: "string", + format: "uuid" + }, + responseTopic: "application/responses", + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/3.1.0/correlationId.json", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + type: "object", + required: [ + "location" + ], + properties: { + description: { + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed.", + type: "string" + }, + location: { + description: "A runtime expression that specifies the location of the correlation ID", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/anySchema.json": { + $id: "http://asyncapi.com/definitions/3.1.0/anySchema.json", + description: "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", + if: { + required: [ + "schema" + ] + }, + then: { + $ref: "http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json" + }, + else: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + "http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json": { + $id: "http://asyncapi.com/definitions/3.1.0/multiFormatSchema.json", + description: "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + type: "object", + if: { + not: { + type: "object" + } + }, + then: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + else: { + allOf: [ + { + if: { + not: { + description: "If no schemaFormat has been defined, default to schema or reference", + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + schema: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + } + } + }, + { + if: { + description: "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json" + } + ] + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json" + } + ] + } + } + } + } + ], + properties: { + schemaFormat: { + description: "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + anyOf: [ + { + type: "string" + }, + { + description: "All the schema formats tooling MUST support", + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + }, + { + description: "All the schema formats tools are RECOMMENDED to support", + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/3.1.0/schema.json": { + $id: "http://asyncapi.com/definitions/3.1.0/schema.json", + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + properties: { + deprecated: { + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + default: false, + type: "boolean" + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + items: { + default: {}, + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + } + ] + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + properties: { + default: {}, + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + patternProperties: { + default: {}, + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + } + }, + additionalProperties: { + default: {}, + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/schema.json" + }, + { + type: "boolean" + } + ] + }, + discriminator: { + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details.", + type: "string" + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/3.0.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/tag.json": { + $id: "http://asyncapi.com/definitions/3.1.0/tag.json", + description: "Allows adding metadata to a single tag.", + type: "object", + required: [ + "name" + ], + properties: { + description: { + description: "A short description for the tag. CommonMark syntax can be used for rich text representation.", + type: "string" + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + name: { + description: "The name of the tag.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/3.1.0/messageTrait.json", + description: "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the message.", + type: "string" + }, + description: { + description: "A longer description of the message. CommonMark is allowed.", + type: "string" + }, + examples: { + description: "List of examples.", + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/messageExampleObject.json" + } + }, + deprecated: { + default: false, + type: "boolean" + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json" + } + ] + }, + contentType: { + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/correlationId.json" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + headers: { + $ref: "http://asyncapi.com/definitions/3.1.0/anySchema.json" + }, + name: { + description: "Name of the message.", + type: "string" + }, + summary: { + description: "A brief summary of the message.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + contentType: "application/json" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/parameters.json": { + $id: "http://asyncapi.com/definitions/3.1.0/parameters.json", + description: "JSON objects describing re-usable channel parameters.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/parameter.json" + } + ] + }, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user." + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/parameter.json": { + $id: "http://asyncapi.com/definitions/3.1.0/parameter.json", + description: "Describes a parameter included in a channel address.", + properties: { + description: { + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.", + type: "string" + }, + examples: { + description: "An array of examples of the parameter value.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + items: { + type: "string" + } + }, + location: { + description: "A runtime expression that specifies the location of the parameter value", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user.", + location: "$message.payload#/user/id" + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/components.json": { + $id: "http://asyncapi.com/definitions/3.1.0/components.json", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + type: "object", + properties: { + channelBindings: { + description: "An object to hold reusable Channel Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json" + } + ] + } + } + }, + channels: { + description: "An object to hold reusable Channel Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/channel.json" + } + ] + } + } + }, + correlationIds: { + description: "An object to hold reusable Correlation ID Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/correlationId.json" + } + ] + } + } + }, + externalDocs: { + description: "An object to hold reusable External Documentation Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + } + } + }, + messageBindings: { + description: "An object to hold reusable Message Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageBindingsObject.json" + } + ] + } + } + }, + messageTraits: { + description: "An object to hold reusable Message Trait Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageTrait.json" + } + ] + } + } + }, + messages: { + description: "An object to hold reusable Message Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/messageObject.json" + } + ] + } + } + }, + operationBindings: { + description: "An object to hold reusable Operation Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json" + } + ] + } + } + }, + operationTraits: { + description: "An object to hold reusable Operation Trait Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationTrait.json" + } + ] + } + } + }, + operations: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json" + } + ] + } + } + }, + parameters: { + description: "An object to hold reusable Parameter Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/parameter.json" + } + ] + } + } + }, + replies: { + description: "An object to hold reusable Operation Reply Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationReply.json" + } + ] + } + } + }, + replyAddresses: { + description: "An object to hold reusable Operation Reply Address Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json" + } + ] + } + } + }, + schemas: { + description: "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/anySchema.json" + } + } + }, + securitySchemes: { + description: "An object to hold reusable Security Scheme Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/SecurityScheme.json" + } + ] + } + } + }, + serverBindings: { + description: "An object to hold reusable Server Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json" + } + ] + } + } + }, + serverVariables: { + description: "An object to hold reusable Server Variable Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/serverVariable.json" + } + ] + } + } + }, + servers: { + description: "An object to hold reusable Server Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/server.json" + } + ] + } + } + }, + tags: { + description: "An object to hold reusable Tag Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + AvroExample: { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + schema: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + }, + servers: { + development: { + host: "{stage}.in.mycompany.com:{port}", + description: "RabbitMQ broker", + protocol: "amqp", + protocolVersion: "0-9-1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `mycompany.com`" + }, + port: { + enum: [ + "5671", + "5672" + ], + default: "5672" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user." + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json", + description: "Map describing protocol-specific definitions for an operation.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: {}, + googlepubsub: {}, + http: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/http/0.3.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + } + }, + ibmmq: {}, + jms: {}, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + ros2: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ros2/0.1.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ros2/0.1.0/operation.json" + } + } + ] + }, + sns: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + solace: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.3.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + sqs: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/bindings/amqp/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/amqp/0.3.0/operation.json", + title: "AMQP operation bindings object", + description: "This object contains information about the operation representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + expiration: { + type: "integer", + minimum: 0, + description: "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + userId: { + type: "string", + description: "Identifies the user who has sent the message." + }, + cc: { + type: "array", + items: { + type: "string" + }, + description: "The routing keys the message should be routed to at the time of publishing." + }, + priority: { + type: "integer", + description: "A priority for the message." + }, + deliveryMode: { + type: "integer", + enum: [ + 1, + 2 + ], + description: "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + mandatory: { + type: "boolean", + description: "Whether the message is mandatory or not." + }, + bcc: { + type: "array", + items: { + type: "string" + }, + description: "Like cc but consumers will not receive this information." + }, + timestamp: { + type: "boolean", + description: "Whether the message should include a timestamp or not." + }, + ack: { + type: "boolean", + description: "Whether the consumer should ack the message or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + expiration: 1e5, + userId: "guest", + cc: [ + "user.logs" + ], + priority: 10, + deliveryMode: 2, + mandatory: false, + bcc: [ + "external.audit" + ], + timestamp: true, + ack: false, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/http/0.3.0/operation.json", + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/http/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/http/0.2.0/operation.json", + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer group." + }, + clientId: { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json", + title: "MQTT operation bindings object", + description: "This object contains information about the operation representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the message or not." + }, + messageExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0, + maximum: 4294967295 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Lifetime of the message in seconds" + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + qos: 2, + retain: true, + messageExpiryInterval: 60, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + $id: "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + title: "NATS operation bindings object", + description: "This object contains information about the operation representation in NATS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queue: { + type: "string", + description: "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + maxLength: 255 + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + queue: "MyCustomQueue", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/ros2/0.1.0/operation.json": { + $id: "http://asyncapi.com/bindings/ros2/0.1.0/operation.json", + description: "This object contains information about the operation representation in ROS 2.", + examples: [ + { + node: "/turtlesim", + qosPolicies: { + deadline: "-1", + durability: "volatile", + history: "unknown", + leaseDuration: "-1", + lifespan: "-1", + liveliness: "automatic", + reliability: "reliable" + }, + role: "subscriber" + } + ], + type: "object", + required: [ + "role", + "node" + ], + properties: { + bindingVersion: { + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + type: "string", + enum: [ + "0.1.0" + ] + }, + node: { + description: "The name of the ROS 2 node that implements this operation.", + type: "string" + }, + qosPolicies: { + type: "object", + properties: { + deadline: { + description: "The expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite.", + type: "integer" + }, + durability: { + description: "Persistence specification that determines message availability for late-joining subscribers", + type: "string", + enum: [ + "transient_local", + "volatile" + ] + }, + history: { + description: "Policy parameter that defines the maximum number of samples maintained in the middleware queue", + type: "string", + enum: [ + "keep_last", + "keep_all", + "unknown" + ] + }, + leaseDuration: { + description: "The maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite.", + type: "integer" + }, + lifespan: { + description: "The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite.", + type: "integer" + }, + liveliness: { + description: "Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network.", + type: "string", + enum: [ + "automatic", + "manual" + ] + }, + reliability: { + description: "Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required.", + type: "string", + enum: [ + "best_effort", + "realiable" + ] + } + } + }, + role: { + description: "Specifies the ROS 2 type of the node for this operation.", + type: "string", + enum: [ + "publisher", + "action_client", + "service_client", + "subscriber", + "action_server", + "service_server" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/bindings/sns/0.1.0/operation.json": { + $id: "http://asyncapi.com/bindings/sns/0.1.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + topic: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + description: "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + consumers: { + type: "array", + description: "The protocols that listen to this topic and their endpoints.", + items: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer" + }, + minItems: 1 + }, + deliveryPolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "consumers" + ], + definitions: { + identifier: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string", + description: "The endpoint is a URL." + }, + email: { + type: "string", + description: "The endpoint is an email address." + }, + phone: { + type: "string", + description: "The endpoint is a phone number." + }, + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + consumer: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + protocol: { + description: "The protocol that this endpoint receives messages by.", + type: "string", + enum: [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + endpoint: { + description: "The endpoint messages are delivered to.", + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier" + }, + filterPolicy: { + type: "object", + description: "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + additionalProperties: { + oneOf: [ + { + type: "array", + items: { + type: "string" + } + }, + { + type: "string" + }, + { + type: "object" + } + ] + } + }, + filterPolicyScope: { + type: "string", + description: "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + enum: [ + "MessageAttributes", + "MessageBody" + ], + default: "MessageAttributes" + }, + rawMessageDelivery: { + type: "boolean", + description: "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy" + }, + deliveryPolicy: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + displayName: { + type: "string", + description: "The display name to use with an SNS subscription" + } + }, + required: [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + deliveryPolicy: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + minDelayTarget: { + type: "integer", + description: "The minimum delay for a retry in seconds." + }, + maxDelayTarget: { + type: "integer", + description: "The maximum delay for a retry in seconds." + }, + numRetries: { + type: "integer", + description: "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + numNoDelayRetries: { + type: "integer", + description: "The number of immediate retries (with no delay)." + }, + numMinDelayRetries: { + type: "integer", + description: "The number of immediate retries (with delay)." + }, + numMaxDelayRetries: { + type: "integer", + description: "The number of post-backoff phase retries, with the maximum delay between retries." + }, + backoffFunction: { + type: "string", + description: "The algorithm for backoff between retries.", + enum: [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + maxReceivesPerSecond: { + type: "integer", + description: "The maximum number of deliveries per second, per subscription." + } + } + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + description: "The SQS queue to use as a dead letter queue (DLQ)." + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + } + }, + examples: [ + { + topic: { + name: "someTopic" + }, + consumers: [ + { + protocol: "sqs", + endpoint: { + name: "someQueue" + }, + filterPolicy: { + store: [ + "asyncapi_corp" + ], + event: [ + { + "anything-but": "order_cancelled" + } + ], + customer_interests: [ + "rugby", + "football", + "baseball" + ] + }, + filterPolicyScope: "MessageAttributes", + rawMessageDelivery: false, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 25 + }, + deliveryPolicy: { + minDelayTarget: 10, + maxDelayTarget: 100, + numRetries: 5, + numNoDelayRetries: 2, + numMinDelayRetries: 3, + numMaxDelayRetries: 5, + backoffFunction: "linear", + maxReceivesPerSecond: 2 + } + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.4.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.4.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + }, + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + timeToLive: { + type: "integer", + description: "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + priority: { + type: "integer", + minimum: 0, + maximum: 255, + description: "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + dmqEligible: { + type: "boolean", + description: "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + examples: [ + { + bindingVersion: "0.4.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.3.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.3.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/solace/0.2.0/operation.json", + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.2.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/operation.json": { + $id: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json", + title: "Operation Schema", + description: "This object contains information about the operation representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + queues: { + type: "array", + description: "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue" + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queues" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + $ref: { + type: "string", + description: "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy" + }, + policy: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + deadLetterQueue: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queues: [ + { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 10, + redrivePolicy: { + deadLetterQueue: { + name: "myQueue_error" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + name: "myQueue_error", + deliveryDelay: 10 + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operationTrait.json", + description: "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the operation.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/title" + }, + description: { + description: "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/description" + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json" + } + ] + }, + externalDocs: { + description: "Additional external documentation for this operation.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/externalDocs" + }, + security: { + description: "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/security" + }, + summary: { + description: "A short summary of what the operation is about.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/summary" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json#/properties/tags" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/operation.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operation.json", + description: "Describes a specific operation.", + type: "object", + required: [ + "action", + "channel" + ], + properties: { + title: { + description: "A human-friendly title for the operation.", + type: "string" + }, + description: { + description: "A longer description of the operation. CommonMark is allowed.", + type: "string" + }, + action: { + description: "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + type: "string", + enum: [ + "send", + "receive" + ] + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationBindingsObject.json" + } + ] + }, + channel: { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + messages: { + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + } + }, + reply: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationReply.json" + } + ] + }, + security: { + $ref: "http://asyncapi.com/definitions/3.1.0/securityRequirements.json" + }, + summary: { + description: "A brief summary of the operation.", + type: "string" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + }, + traits: { + description: "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationTrait.json" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + security: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ], + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ], + messages: [ + { + $ref: "/components/messages/userSignedUp" + } + ], + reply: { + address: { + location: "$message.header#/replyTo" + }, + channel: { + $ref: "#/channels/userSignupReply" + }, + messages: [ + { + $ref: "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/securityRequirements.json": { + $id: "http://asyncapi.com/definitions/3.1.0/securityRequirements.json", + description: "An array representing security requirements.", + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/SecurityScheme.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.1.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/SecurityScheme.json", + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/3.1.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "userPassword" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/3.1.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme", + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + description: " The location of the API key.", + type: "string", + enum: [ + "user", + "password" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/X509.json": { + $id: "http://asyncapi.com/definitions/3.1.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "X509" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/3.1.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/3.1.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "asymmetricEncryption" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/NonBearerHTTPSecurityScheme.json", + type: "object", + not: { + type: "object", + properties: { + scheme: { + description: "A short description for security scheme.", + type: "string", + enum: [ + "bearer" + ] + } + } + }, + required: [ + "scheme", + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "http" + ] + }, + scheme: { + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "http" + ] + }, + bearerFormat: { + description: "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.", + type: "string" + }, + scheme: { + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + type: "string", + enum: [ + "bearer" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "httpApiKey" + ] + }, + in: { + description: "The location of the API key", + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + name: { + description: "The name of the header, query or cookie parameter to be used.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/3.1.0/oauth2Flows.json", + description: "Allows configuration of the supported OAuth Flows.", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "oauth2" + ] + }, + flows: { + type: "object", + properties: { + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + } + }, + additionalProperties: false + }, + scopes: { + description: "List of the needed scope names.", + type: "array", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/3.1.0/oauth2Flow.json", + description: "Configuration details for a supported OAuth Flow", + type: "object", + properties: { + authorizationUrl: { + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + availableScopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json" + }, + refreshUrl: { + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + tokenUrl: { + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + availableScopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/3.1.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/3.1.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/3.1.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "openIdConnect" + ] + }, + openIdConnectUrl: { + description: "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + scopes: { + description: "List of the needed scope names. An empty array means no scopes are needed.", + type: "array", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme. Valid values", + type: "string", + enum: [ + "plain" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/3.1.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "gssapi" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/operationReply.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operationReply.json", + description: "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + type: "object", + properties: { + address: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json" + } + ] + }, + channel: { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + messages: { + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operationReplyAddress.json", + description: "An object that specifies where an operation has to send the reply", + type: "object", + required: [ + "location" + ], + properties: { + description: { + description: "An optional description of the address. CommonMark is allowed.", + type: "string" + }, + location: { + description: "A runtime expression that specifies the location of the reply address.", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + description: "Consumer inbox", + location: "$message.header#/replyTo" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json": { + $id: "http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json", + description: "Map describing protocol-specific definitions for a server.", + type: "object", + properties: { + amqp: {}, + amqp1: {}, + anypointmq: {}, + googlepubsub: {}, + http: {}, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.5.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/kafka/0.3.0/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: {}, + pulsar: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + ros2: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ros2/0.1.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/ros2/0.1.0/server.json" + } + } + ] + }, + sns: {}, + solace: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.4.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.3.0/server.json" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "http://asyncapi.com/bindings/solace/0.2.0/server.json" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + sqs: {}, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + $id: "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + title: "IBM MQ server bindings object", + description: "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + groupId: { + type: "string", + description: "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + ccdtQueueManagerName: { + type: "string", + default: "*", + description: "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + cipherSpec: { + type: "string", + description: "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + multiEndpointServer: { + type: "boolean", + default: false, + description: "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + heartBeatInterval: { + type: "integer", + minimum: 0, + maximum: 999999, + default: 300, + description: "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + groupId: "PRODCLSTR1", + cipherSpec: "ANY_TLS12_OR_HIGHER", + bindingVersion: "0.1.0" + }, + { + groupId: "PRODCLSTR1", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/jms/0.0.1/server.json": { + $id: "http://asyncapi.com/bindings/jms/0.0.1/server.json", + title: "Server Schema", + description: "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + required: [ + "jmsConnectionFactory" + ], + properties: { + jmsConnectionFactory: { + type: "string", + description: "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + properties: { + type: "array", + items: { + $ref: "http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property" + }, + description: "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + clientID: { + type: "string", + description: "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + definitions: { + property: { + type: "object", + required: [ + "name", + "value" + ], + properties: { + name: { + type: "string", + description: "The name of a property" + }, + value: { + type: [ + "string", + "boolean", + "number", + "null" + ], + description: "The name of a property" + } + } + } + }, + examples: [ + { + jmsConnectionFactory: "org.apache.activemq.ActiveMQConnectionFactory", + properties: [ + { + name: "disableTimeStampsByDefault", + value: false + } + ], + clientID: "my-application-1", + bindingVersion: "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.5.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.5.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.5.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.4.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.4.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/server.json": { + $id: "http://asyncapi.com/bindings/kafka/0.3.0/server.json", + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.2.0/server.json": { + $id: "http://asyncapi.com/bindings/mqtt/0.2.0/server.json", + title: "Server Schema", + description: "This object contains information about the server representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + clientId: { + type: "string", + description: "The client identifier." + }, + cleanSession: { + type: "boolean", + description: "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + lastWill: { + type: "object", + description: "Last Will and Testament configuration.", + properties: { + topic: { + type: "string", + description: "The topic where the Last Will and Testament message will be sent." + }, + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + message: { + type: "string", + description: "Last Will message." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + keepAlive: { + type: "integer", + description: "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + sessionExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + maximumPacketSize: { + oneOf: [ + { + type: "integer", + minimum: 1, + maximum: 4294967295 + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + description: "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + clientId: "guest", + cleanSession: true, + lastWill: { + topic: "/last-wills", + qos: 2, + message: "Guest gone offline.", + retain: false + }, + keepAlive: 60, + sessionExpiryInterval: 120, + maximumPacketSize: 1024, + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/pulsar/0.1.0/server.json": { + $id: "http://asyncapi.com/bindings/pulsar/0.1.0/server.json", + title: "Server Schema", + description: "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + tenant: { + type: "string", + description: "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + tenant: "contoso", + bindingVersion: "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/ros2/0.1.0/server.json": { + $id: "http://asyncapi.com/bindings/ros2/0.1.0/server.json", + description: "This object contains information about the server representation in ROS 2.", + examples: [ + { + domainId: "0", + rmwImplementation: "rmw_fastrtps_cpp" + } + ], + type: "object", + properties: { + bindingVersion: { + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + type: "string", + enum: [ + "0.1.0" + ] + }, + domainId: { + description: "All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID.", + type: "integer", + maximum: 231, + minimum: 0 + }, + rmwImplementation: { + description: "Specifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/bindings/solace/0.4.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.4.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + clientName: { + type: "string", + minLength: 1, + maxLength: 160, + description: "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.4.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.3.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/server.json": { + $id: "http://asyncapi.com/bindings/solace/0.2.0/server.json", + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + properties: { + msvVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.2.0" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/3.1.0/serverVariable.json", + description: "An object representing a Server Variable for server URL template substitution.", + type: "object", + properties: { + description: { + description: "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + examples: { + description: "An array of examples of the server variable.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + uniqueItems: true, + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/{env}", + protocol: "amqp", + description: "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + variables: { + env: { + description: "Environment to connect to. It can be either `production` or `staging`.", + enum: [ + "production", + "staging" + ] + } + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/server.json": { + $id: "http://asyncapi.com/definitions/3.1.0/server.json", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + type: "object", + required: [ + "host", + "protocol" + ], + properties: { + title: { + description: "A human-friendly title for the server.", + type: "string" + }, + description: { + description: "A longer description of the server. CommonMark is allowed.", + type: "string" + }, + bindings: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/serverBindingsObject.json" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + host: { + description: "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + type: "string" + }, + pathname: { + description: "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + type: "string" + }, + protocol: { + description: "The protocol this server supports for connection.", + type: "string" + }, + protocolVersion: { + description: "An optional string describing the server. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + security: { + $ref: "http://asyncapi.com/definitions/3.1.0/securityRequirements.json" + }, + summary: { + description: "A brief summary of the server.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + }, + variables: { + $ref: "http://asyncapi.com/definitions/3.1.0/serverVariables.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + host: "kafka.in.mycompany.com:9092", + description: "Production Kafka broker.", + protocol: "kafka", + protocolVersion: "3.2" + }, + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/production", + protocol: "amqp", + description: "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/3.1.0/serverVariables.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.1.0/info.json": { + $id: "http://asyncapi.com/definitions/3.1.0/info.json", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + allOf: [ + { + type: "object", + required: [ + "version", + "title" + ], + properties: { + title: { + description: "A unique and precise title of the API.", + type: "string" + }, + description: { + description: "A longer description of the API. Should be different from the title. CommonMark is allowed.", + type: "string" + }, + contact: { + $ref: "http://asyncapi.com/definitions/3.1.0/contact.json" + }, + externalDocs: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/externalDocs.json" + } + ] + }, + license: { + $ref: "http://asyncapi.com/definitions/3.1.0/license.json" + }, + tags: { + description: "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/tag.json" + } + ] + } + }, + termsOfService: { + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + type: "string", + format: "uri" + }, + version: { + description: "A semantic version number of the API.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/infoExtensions.json" + } + ], + examples: [ + { + title: "AsyncAPI Sample App", + version: "1.0.1", + description: "This is a sample app.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.asyncapi.org/support", + email: "support@asyncapi.org" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + externalDocs: { + description: "Find more info here", + url: "https://www.asyncapi.org" + }, + tags: [ + { + name: "e-commerce" + } + ] + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/contact.json": { + $id: "http://asyncapi.com/definitions/3.1.0/contact.json", + description: "Contact information for the exposed API.", + type: "object", + properties: { + email: { + description: "The email address of the contact person/organization.", + type: "string", + format: "email" + }, + name: { + description: "The identifying name of the contact person/organization.", + type: "string" + }, + url: { + description: "The URL pointing to the contact information.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/license.json": { + $id: "http://asyncapi.com/definitions/3.1.0/license.json", + type: "object", + required: [ + "name" + ], + properties: { + name: { + description: "The name of the license type. It's encouraged to use an OSI compatible license.", + type: "string" + }, + url: { + description: "The URL pointing to the license.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/infoExtensions.json": { + $id: "http://asyncapi.com/definitions/3.1.0/infoExtensions.json", + description: "The object that lists all the extensions of Info", + type: "object", + properties: { + "x-linkedin": { + $ref: "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json" + }, + "x-x": { + $ref: "http://asyncapi.com/extensions/x/0.1.0/schema.json" + } + } + }, + "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json": { + $id: "http://asyncapi.com/extensions/linkedin/0.1.0/schema.json", + type: "string", + pattern: "^http(s)?://(www\\.)?linkedin\\.com.*$", + description: "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + example: [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + "http://asyncapi.com/extensions/x/0.1.0/schema.json": { + $id: "http://asyncapi.com/extensions/x/0.1.0/schema.json", + type: "string", + description: "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + example: [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + "http://asyncapi.com/definitions/3.1.0/operations.json": { + $id: "http://asyncapi.com/definitions/3.1.0/operations.json", + description: "Holds a dictionary with all the operations this application MUST implement.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/operation.json" + } + ] + }, + examples: [ + { + onUserSignUp: { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/3.1.0/servers.json": { + $id: "http://asyncapi.com/definitions/3.1.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/3.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/3.1.0/server.json" + } + ] + }, + examples: [ + { + development: { + host: "localhost:5672", + description: "Development AMQP broker.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests." + } + ] + }, + staging: { + host: "rabbitmq-staging.in.mycompany.com:5672", + description: "RabbitMQ broker for the staging environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment." + } + ] + }, + production: { + host: "rabbitmq.in.mycompany.com:5672", + description: "RabbitMQ broker for the production environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users." + } + ] + } + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.0.0-without-$id.json +var require_without_id = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.0.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.0.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + properties: { + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.1.0-without-$id.json +var require_without_id2 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.1.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.1.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.2.0-without-$id.json +var require_without_id3 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.2.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.2.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.2.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.3.0-without-$id.json +var require_without_id4 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.3.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.3.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.3.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.4.0-without-$id.json +var require_without_id5 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.4.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.4.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.4.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.5.0-without-$id.json +var require_without_id6 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.5.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.5.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.5.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/2.6.0-without-$id.json +var require_without_id7 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/2.6.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.6.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.6.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + }, + examples: [ + { + title: "AsyncAPI Sample App", + description: "This is a sample server.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + } + ] + }, + contact: { + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + license: { + type: "object", + required: [ + "name" + ], + description: "License information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + servers: { + description: "The Servers Object is a map of Server Objects.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + }, + examples: [ + { + development: { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests" + } + ] + }, + staging: { + url: "staging.gigantic-server.com", + description: "Staging server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment" + } + ] + }, + production: { + url: "api.gigantic-server.com", + description: "Production server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users" + } + ] + } + } + ] + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + format: "uri-reference", + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + server: { + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string", + description: "A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served." + }, + description: { + type: "string", + description: "An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation." + }, + protocol: { + type: "string", + description: "The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub." + }, + protocolVersion: { + type: "string", + description: "The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc." + }, + variables: { + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + description: "A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.", + $ref: "#/definitions/bindingsObject" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of servers.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + } + }, + examples: [ + { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "kafka", + protocolVersion: "1.0.0" + } + ] + }, + serverVariables: { + type: "object", + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. " + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + description: "Lists of the required security schemes that can be used to execute an operation", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + examples: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ] + }, + bindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {}, + googlepubsub: {}, + pulsar: {} + } + }, + tag: { + type: "object", + description: "Allows adding meta data to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag." + }, + externalDocs: { + description: "Additional external documentation for this tag.", + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation." + }, + url: { + type: "string", + format: "uri", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + channels: { + type: "object", + description: "Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + channelItem: { + type: "object", + description: "Describes the operations available on a single channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + description: "This channel is used to exchange messages about users signing up", + subscribe: { + summary: "A user signed up.", + message: { + description: "A longer description of the message", + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/user" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + } + }, + { + subscribe: { + message: { + oneOf: [ + { + $ref: "#/components/messages/signup" + }, + { + $ref: "#/components/messages/login" + } + ] + } + } + }, + { + description: "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.", + servers: [ + "rabbitmqBrokerInProd", + "rabbitmqBrokerInStaging" + ], + subscribe: { + message: { + $ref: "#/components/messages/WebUICommand" + } + }, + bindings: { + amqp: { + is: "queue" + } + } + } + ] + }, + parameters: { + type: "object", + description: "JSON objects describing reusable channel parameters.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + parameter: { + description: "Describes a parameter included in a channel name.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + }, + location: "$message.payload#/user/id" + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + schema: { + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.", + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. " + }, + externalDocs: { + description: "Additional external documentation for this schema.", + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false, + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage" + } + } + } + ], + examples: [ + { + type: "string", + format: "email" + }, + { + type: "object", + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + address: { + $ref: "#/components/schemas/Address" + }, + age: { + type: "integer", + format: "int32", + minimum: 0 + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + operation: { + type: "object", + description: "Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + description: "A list of traits to apply to the operation object.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation.", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + operationTrait: { + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string", + description: "Unique string used to identify the operation. The id MUST be unique among all operations described in the API." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation. ", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + message: { + description: "Describes a message received on a given channel and operation.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ], + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + }, + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + payload: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + ] + }, + correlationId: { + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + messageTrait: { + type: "object", + description: "Describes a trait that MAY be applied to a Message Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string", + description: "A string containing the name of the schema format/language used to define the message payload." + }, + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload." + }, + headers: { + description: "Schema definition of the application headers.", + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string", + description: "Unique string used to identify the message. The id MUST be unique among all messages described in the API." + }, + correlationId: { + description: "Definition of the correlation ID used for message tracing or matching.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of messages.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + contentType: "application/json" + } + ] + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + } + }, + servers: { + development: { + url: "{stage}.gigantic-server.com:{port}", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `gigantic-server.com`" + }, + port: { + enum: [ + "8883", + "8884" + ], + default: "8883" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "userPassword" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ], + description: "The type of the security scheme." + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + oauth2Flows: { + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + scopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + ] + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/3.0.0-without-$id.json +var require_without_id8 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/3.0.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 3.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + const: "3.0.0", + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string", + description: "Default content type to use when encoding/decoding a message's payload." + }, + channels: { + $ref: "#/definitions/channels" + }, + operations: { + $ref: "#/definitions/operations" + }, + components: { + $ref: "#/definitions/components" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + allOf: [ + { + type: "object", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + }, + tags: { + type: "array", + description: "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + } + } + }, + { + $ref: "#/definitions/infoExtensions" + } + ], + examples: [ + { + title: "AsyncAPI Sample App", + version: "1.0.1", + description: "This is a sample app.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.asyncapi.org/support", + email: "support@asyncapi.org" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + externalDocs: { + description: "Find more info here", + url: "https://www.asyncapi.org" + }, + tags: [ + { + name: "e-commerce" + } + ] + } + ] + }, + contact: { + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + Reference: { + type: "object", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + required: [ + "$ref" + ], + properties: { + $ref: { + description: "The reference string.", + $ref: "#/definitions/ReferenceObject" + } + }, + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + tag: { + type: "object", + description: "Allows adding metadata to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag. CommonMark syntax can be used for rich text representation." + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation. CommonMark syntax can be used for rich text representation." + }, + url: { + type: "string", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + infoExtensions: { + type: "object", + description: "The object that lists all the extensions of Info", + properties: { + "x-x": { + $ref: "#/definitions/extensions-x-0.1.0-schema" + }, + "x-linkedin": { + $ref: "#/definitions/extensions-linkedin-0.1.0-schema" + } + } + }, + "extensions-x-0.1.0-schema": { + type: "string", + description: "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + example: [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + "extensions-linkedin-0.1.0-schema": { + type: "string", + pattern: "^http(s)?://(www\\.)?linkedin\\.com.*$", + description: "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + example: [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + }, + examples: [ + { + development: { + host: "localhost:5672", + description: "Development AMQP broker.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests." + } + ] + }, + staging: { + host: "rabbitmq-staging.in.mycompany.com:5672", + description: "RabbitMQ broker for the staging environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment." + } + ] + }, + production: { + host: "rabbitmq.in.mycompany.com:5672", + description: "RabbitMQ broker for the production environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users." + } + ] + } + } + ] + }, + server: { + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + required: [ + "host", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + host: { + type: "string", + description: "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + pathname: { + type: "string", + description: "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." + }, + title: { + type: "string", + description: "A human-friendly title for the server." + }, + summary: { + type: "string", + description: "A brief summary of the server." + }, + description: { + type: "string", + description: "A longer description of the server. CommonMark is allowed." + }, + protocol: { + type: "string", + description: "The protocol this server supports for connection." + }, + protocolVersion: { + type: "string", + description: "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + $ref: "#/definitions/securityRequirements" + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverBindingsObject" + } + ] + } + }, + examples: [ + { + host: "kafka.in.mycompany.com:9092", + description: "Production Kafka broker.", + protocol: "kafka", + protocolVersion: "3.2" + }, + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/production", + protocol: "amqp", + description: "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + serverVariables: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + }, + examples: [ + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/{env}", + protocol: "amqp", + description: "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + variables: { + env: { + description: "Environment to connect to. It can be either `production` or `staging`.", + enum: [ + "production", + "staging" + ] + } + } + } + ] + }, + securityRequirements: { + description: "An array representing security requirements.", + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + }, + SecurityScheme: { + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: " The location of the API key.", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." + }, + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + oauth2Flows: { + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + } + }, + additionalProperties: false + }, + scopes: { + type: "array", + description: "List of the needed scope names.", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + availableScopes: { + $ref: "#/definitions/oauth2Scopes", + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + availableScopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string", + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." + }, + openIdConnectUrl: { + type: "string", + format: "uri", + description: "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." + }, + scopes: { + type: "array", + description: "List of the needed scope names. An empty array means no scopes are needed.", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + serverBindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-server" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-server" + } + } + ] + }, + anypointmq: {}, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-server" + } + } + ] + }, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-server" + } + } + ] + }, + solace: { + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.2.0-server" + } + } + ] + }, + googlepubsub: {}, + pulsar: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-server" + } + } + ] + } + } + }, + "bindings-mqtt-0.2.0-server": { + title: "Server Schema", + description: "This object contains information about the server representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + clientId: { + type: "string", + description: "The client identifier." + }, + cleanSession: { + type: "boolean", + description: "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + lastWill: { + type: "object", + description: "Last Will and Testament configuration.", + properties: { + topic: { + type: "string", + description: "The topic where the Last Will and Testament message will be sent." + }, + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + message: { + type: "string", + description: "Last Will message." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + keepAlive: { + type: "integer", + description: "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + sessionExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + maximumPacketSize: { + oneOf: [ + { + type: "integer", + minimum: 1, + maximum: 4294967295 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + clientId: "guest", + cleanSession: true, + lastWill: { + topic: "/last-wills", + qos: 2, + message: "Guest gone offline.", + retain: false + }, + keepAlive: 60, + sessionExpiryInterval: 120, + maximumPacketSize: 1024, + bindingVersion: "0.2.0" + } + ] + }, + schema: { + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + deprecated: { + type: "boolean", + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + "bindings-kafka-0.5.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-jms-0.0.1-server": { + title: "Server Schema", + description: "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "jmsConnectionFactory" + ], + properties: { + jmsConnectionFactory: { + type: "string", + description: "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + properties: { + type: "array", + items: { + $ref: "#/definitions/bindings-jms-0.0.1-server/definitions/property" + }, + description: "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + clientID: { + type: "string", + description: "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + definitions: { + property: { + type: "object", + required: [ + "name", + "value" + ], + properties: { + name: { + type: "string", + description: "The name of a property" + }, + value: { + type: [ + "string", + "boolean", + "number", + "null" + ], + description: "The name of a property" + } + } + } + }, + examples: [ + { + jmsConnectionFactory: "org.apache.activemq.ActiveMQConnectionFactory", + properties: [ + { + name: "disableTimeStampsByDefault", + value: false + } + ], + clientID: "my-application-1", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-server": { + title: "IBM MQ server bindings object", + description: "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + type: "string", + description: "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + ccdtQueueManagerName: { + type: "string", + default: "*", + description: "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + cipherSpec: { + type: "string", + description: "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + multiEndpointServer: { + type: "boolean", + default: false, + description: "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + heartBeatInterval: { + type: "integer", + minimum: 0, + maximum: 999999, + default: 300, + description: "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + groupId: "PRODCLSTR1", + cipherSpec: "ANY_TLS12_OR_HIGHER", + bindingVersion: "0.1.0" + }, + { + groupId: "PRODCLSTR1", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-solace-0.4.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + clientName: { + type: "string", + minLength: 1, + maxLength: 160, + description: "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.4.0" + } + ] + }, + "bindings-solace-0.3.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-solace-0.2.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msvVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.2.0" + } + ] + }, + "bindings-pulsar-0.1.0-server": { + title: "Server Schema", + description: "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + tenant: { + type: "string", + description: "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + tenant: "contoso", + bindingVersion: "0.1.0" + } + ] + }, + channels: { + type: "object", + description: "An object containing all the Channel Object definitions the Application MUST use during runtime.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channel" + } + ] + }, + examples: [ + { + userSignedUp: { + address: "user.signedup", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + channel: { + type: "object", + description: "Describes a shared communication channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + address: { + type: [ + "string", + "null" + ], + description: 'An optional string representation of this channel\'s address. The address is typically the "topic name", "routing key", "event type", or "path". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can\'t be known upfront. It MAY contain Channel Address Expressions.' + }, + messages: { + $ref: "#/definitions/channelMessages" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + title: { + type: "string", + description: "A human-friendly title for the channel." + }, + summary: { + type: "string", + description: "A brief summary of the channel." + }, + description: { + type: "string", + description: "A longer description of the channel. CommonMark is allowed." + }, + servers: { + type: "array", + description: "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + $ref: "#/definitions/Reference" + }, + uniqueItems: true + }, + tags: { + type: "array", + description: "A list of tags for logical grouping of channels.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channelBindingsObject" + } + ] + } + }, + examples: [ + { + address: "users.{userId}", + title: "Users channel", + description: "This channel is used to exchange messages about user events.", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + }, + userCompletedOrder: { + $ref: "#/components/messages/userCompletedOrder" + } + }, + parameters: { + userId: { + $ref: "#/components/parameters/userId" + } + }, + servers: [ + { + $ref: "#/servers/rabbitmqInProd" + }, + { + $ref: "#/servers/rabbitmqInStaging" + } + ], + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + }, + tags: [ + { + name: "user", + description: "User-related messages" + } + ], + externalDocs: { + description: "Find more info here", + url: "https://example.com" + } + } + ] + }, + channelMessages: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageObject" + } + ] + }, + description: "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**" + }, + messageObject: { + type: "object", + description: "Describes a message received on a given channel and operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + headers: { + $ref: "#/definitions/anySchema" + }, + payload: { + $ref: "#/definitions/anySchema" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + $ref: "#/definitions/messageExampleObject" + } + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + }, + traits: { + type: "array", + description: "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + }, + { + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + }, + { + type: "object", + additionalItems: true + } + ] + } + ] + } + } + }, + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + } + ] + }, + anySchema: { + if: { + required: [ + "schema" + ] + }, + then: { + $ref: "#/definitions/multiFormatSchema" + }, + else: { + $ref: "#/definitions/schema" + }, + description: "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." + }, + multiFormatSchema: { + description: "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + if: { + not: { + type: "object" + } + }, + then: { + $ref: "#/definitions/schema" + }, + else: { + properties: { + schemaFormat: { + description: "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + anyOf: [ + { + type: "string" + }, + { + description: "All the schema formats tooling MUST support", + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + }, + { + description: "All the schema formats tools are RECOMMENDED to support", + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + }, + allOf: [ + { + if: { + not: { + description: "If no schemaFormat has been defined, default to schema or reference", + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + description: "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/avroSchema_v1" + } + ] + } + } + } + } + ] + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + correlationId: { + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + messageExampleObject: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Example of the application headers. It MUST be a map of key-value pairs." + }, + payload: { + type: [ + "number", + "string", + "boolean", + "object", + "array", + "null" + ], + description: "Example of the message payload. It can be of any type." + } + } + }, + messageBindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for a message.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + http: { + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-message" + } + } + ] + }, + ws: {}, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-message" + } + } + ] + }, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-message" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-message" + } + } + ] + }, + anypointmq: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-message" + } + } + ] + }, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-message" + } + } + ] + }, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-message" + } + } + ] + }, + solace: {}, + googlepubsub: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-message" + } + } + ] + } + } + }, + "bindings-http-0.3.0-message": { + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + statusCode: { + type: "number", + description: "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-http-0.2.0-message": { + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-message": { + title: "AMQP message bindings object", + description: "This object contains information about the message representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + contentEncoding: { + type: "string", + description: "A MIME encoding for the message content." + }, + messageType: { + type: "string", + description: "Application-specific message type." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + contentEncoding: "gzip", + messageType: "user.signup", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-message": { + title: "MQTT message bindings object", + description: "This object contains information about the message representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + payloadFormatIndicator: { + type: "integer", + enum: [ + 0, + 1 + ], + description: "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + default: 0 + }, + correlationData: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + contentType: { + type: "string", + description: "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + responseTopic: { + oneOf: [ + { + type: "string", + format: "uri-template", + minLength: 1 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "The topic (channel URI) to be used for a response message." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + bindingVersion: "0.2.0" + }, + { + contentType: "application/json", + correlationData: { + type: "string", + format: "uuid" + }, + responseTopic: "application/responses", + bindingVersion: "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/schema" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.5.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + anyOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/avroSchema_v1" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.4.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + $ref: "#/definitions/schema", + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.3.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-message": { + title: "Anypoint MQ message bindings object", + description: "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + messageId: { + type: "string" + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-message": { + title: "Message Schema", + description: "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + required: [ + "JMSMessageID" + ], + properties: { + JMSMessageID: { + type: [ + "string", + "null" + ], + description: "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + JMSTimestamp: { + type: "integer", + description: "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + JMSDeliveryMode: { + type: "string", + enum: [ + "PERSISTENT", + "NON_PERSISTENT" + ], + default: "PERSISTENT", + description: "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + JMSPriority: { + type: "integer", + default: 4, + description: "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + JMSExpires: { + type: "integer", + description: "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + JMSType: { + type: [ + "string", + "null" + ], + description: "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + JMSCorrelationID: { + type: [ + "string", + "null" + ], + description: "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + JMSReplyTo: { + type: "string", + description: "The queue or topic that the message sender expects replies to." + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + title: "IBM MQ message bindings object", + description: "This object contains information about the message representation in IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + type: { + type: "string", + enum: [ + "string", + "jms", + "binary" + ], + default: "string", + description: "The type of the message." + }, + headers: { + type: "string", + description: "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + description: { + type: "string", + description: "Provides additional information for application developers: describes the message type or format." + }, + expiry: { + type: "integer", + minimum: 0, + default: 0, + description: "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + type: { + const: "binary" + } + } + }, + { + properties: { + type: { + const: "jms" + } + }, + not: { + required: [ + "headers" + ] + } + }, + { + properties: { + type: { + const: "string" + } + }, + not: { + required: [ + "headers" + ] + } + } + ], + examples: [ + { + type: "string", + bindingVersion: "0.1.0" + }, + { + type: "jms", + description: "JMS stream message", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-message": { + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the message representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + attributes: { + type: "object" + }, + orderingKey: { + type: "string" + }, + schema: { + type: "object", + additionalItems: false, + properties: { + name: { + type: "string" + } + }, + required: [ + "name" + ] + } + }, + examples: [ + { + schema: { + name: "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + schema: { + name: "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + messageTrait: { + type: "object", + description: "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." + }, + headers: { + $ref: "#/definitions/anySchema" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + $ref: "#/definitions/messageExampleObject" + } + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + } + }, + examples: [ + { + contentType: "application/json" + } + ] + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters.", + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user." + } + } + } + ] + }, + parameter: { + description: "Describes a parameter included in a channel address.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + examples: { + description: "An array of examples of the parameter value.", + type: "array", + items: { + type: "string" + } + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user.", + location: "$message.payload#/user/id" + } + } + } + ] + }, + channelBindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for a channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + http: {}, + ws: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-websockets-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-websockets-0.1.0-channel" + } + } + ] + }, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-channel" + } + } + ] + }, + amqp1: {}, + mqtt: {}, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-channel" + } + } + ] + }, + anypointmq: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-channel" + } + } + ] + }, + nats: {}, + jms: { + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-channel" + } + } + ] + }, + sns: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-channel" + } + } + ] + }, + sqs: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ] + }, + stomp: {}, + redis: {}, + ibmmq: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-channel" + } + } + ] + }, + solace: {}, + googlepubsub: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + } + ] + }, + pulsar: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-channel" + } + } + ] + } + } + }, + "bindings-websockets-0.1.0-channel": { + title: "WebSockets channel bindings object", + description: "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "POST" + ], + description: "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + query: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + headers: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + method: "POST", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-amqp-0.3.0-channel": { + title: "AMQP channel bindings object", + description: "This object contains information about the channel representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + is: { + type: "string", + enum: [ + "queue", + "routingKey" + ], + description: "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + exchange: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + type: { + type: "string", + enum: [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + description: "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + durable: { + type: "boolean", + description: "Whether the exchange should survive broker restarts or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the exchange should be deleted when the last queue is unbound from it." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the exchange. Defaults to '/'." + } + }, + description: "When is=routingKey, this object defines the exchange properties." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the queue. It MUST NOT exceed 255 characters long." + }, + durable: { + type: "boolean", + description: "Whether the queue should survive broker restarts or not." + }, + exclusive: { + type: "boolean", + description: "Whether the queue should be used only by one connection or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the queue should be deleted when the last consumer unsubscribes." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the queue. Defaults to '/'." + } + }, + description: "When is=queue, this object defines the queue properties." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + oneOf: [ + { + properties: { + is: { + const: "routingKey" + } + }, + required: [ + "exchange" + ], + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + is: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "exchange" + ] + } + } + ], + examples: [ + { + is: "routingKey", + exchange: { + name: "myExchange", + type: "topic", + durable: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + }, + { + is: "queue", + queue: { + name: "my-queue-name", + durable: true, + exclusive: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-kafka-0.5.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: true, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + }, + "confluent.key.schema.validation": { + description: "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + type: "boolean" + }, + "confluent.key.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + type: "string" + }, + "confluent.value.schema.validation": { + description: "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + type: "boolean" + }, + "confluent.value.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + type: "string" + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: false, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-channel": { + title: "Anypoint MQ channel bindings object", + description: "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "exchange", + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signup-exchg", + destinationType: "exchange", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-jms-0.0.1-channel": { + title: "Channel Schema", + description: "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signed-up", + destinationType: "fifo-queue", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-sns-0.1.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + name: { + type: "string", + description: "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + ordering: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/ordering" + }, + policy: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the topic." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "name" + ], + definitions: { + ordering: { + type: "object", + description: "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + type: { + type: "string", + description: "Defines the type of SNS Topic.", + enum: [ + "standard", + "FIFO" + ] + }, + contentBasedDeduplication: { + type: "boolean", + description: "True to turn on de-duplication of messages for a channel." + } + }, + required: [ + "type" + ] + }, + policy: { + type: "object", + description: "The security policy for the SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this topic", + items: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SNS permission being allowed or denied e.g. sns:Publish", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + name: "my-sns-topic", + policy: { + statements: [ + { + effect: "Allow", + principal: "*", + action: "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queue: { + description: "A definition of the queue that will be used as the channel.", + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + deadLetterQueue: { + description: "A definition of the queue that will be used for un-processable messages.", + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queue" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy" + }, + policy: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name", + "fifoQueue" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queue: { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 15, + visibilityTimeout: 60, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 86400, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + tags: { + owner: "AsyncAPI.NET", + platform: "AsyncAPIOrg" + } + }, + deadLetterQueue: { + name: "myQueue_error", + deliveryDelay: 0, + visibilityTimeout: 0, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 604800 + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + title: "IBM MQ channel bindings object", + description: "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destinationType: { + type: "string", + enum: [ + "topic", + "queue" + ], + default: "topic", + description: "Defines the type of AsyncAPI channel." + }, + queue: { + type: "object", + description: "Defines the properties of a queue.", + properties: { + objectName: { + type: "string", + maxLength: 48, + description: "Defines the name of the IBM MQ queue associated with the channel." + }, + isPartitioned: { + type: "boolean", + default: false, + description: "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + exclusive: { + type: "boolean", + default: false, + description: "Specifies if it is recommended to open the queue exclusively." + } + }, + required: [ + "objectName" + ] + }, + topic: { + type: "object", + description: "Defines the properties of a topic.", + properties: { + string: { + type: "string", + maxLength: 10240, + description: "The value of the IBM MQ topic string to be used." + }, + objectName: { + type: "string", + maxLength: 48, + description: "The name of the IBM MQ topic object." + }, + durablePermitted: { + type: "boolean", + default: true, + description: "Defines if the subscription may be durable." + }, + lastMsgRetained: { + type: "boolean", + default: false, + description: "Defines if the last message published will be made available to new subscriptions." + } + } + }, + maxMsgLength: { + type: "integer", + minimum: 0, + maximum: 104857600, + description: "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + destinationType: { + const: "topic" + } + }, + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + destinationType: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "topic" + ] + } + } + ], + examples: [ + { + destinationType: "topic", + topic: { + objectName: "myTopicName" + }, + bindingVersion: "0.1.0" + }, + { + destinationType: "queue", + queue: { + objectName: "myQueueName", + exclusive: true + }, + bindingVersion: "0.1.0" + } + ] + }, + "bindings-googlepubsub-0.2.0-channel": { + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the channel representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + labels: { + type: "object" + }, + messageRetentionDuration: { + type: "string" + }, + messageStoragePolicy: { + type: "object", + additionalProperties: false, + properties: { + allowedPersistenceRegions: { + type: "array", + items: { + type: "string" + } + } + } + }, + schemaSettings: { + type: "object", + additionalItems: false, + properties: { + encoding: { + type: "string" + }, + firstRevisionId: { + type: "string" + }, + lastRevisionId: { + type: "string" + }, + name: { + type: "string" + } + }, + required: [ + "encoding", + "name" + ] + } + }, + required: [ + "schemaSettings" + ], + examples: [ + { + labels: { + label1: "value1", + label2: "value2" + }, + messageRetentionDuration: "86400s", + messageStoragePolicy: { + allowedPersistenceRegions: [ + "us-central1", + "us-east1" + ] + }, + schemaSettings: { + encoding: "json", + name: "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "bindings-pulsar-0.1.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "namespace", + "persistence" + ], + properties: { + namespace: { + type: "string", + description: "The namespace, the channel is associated with." + }, + persistence: { + type: "string", + enum: [ + "persistent", + "non-persistent" + ], + description: "persistence of the topic in Pulsar." + }, + compaction: { + type: "integer", + minimum: 0, + description: "Topic compaction threshold given in MB" + }, + "geo-replication": { + type: "array", + description: "A list of clusters the topic is replicated to.", + items: { + type: "string" + } + }, + retention: { + type: "object", + additionalProperties: false, + properties: { + time: { + type: "integer", + minimum: 0, + description: "Time given in Minutes. `0` = Disable message retention." + }, + size: { + type: "integer", + minimum: 0, + description: "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + ttl: { + type: "integer", + description: "TTL in seconds for the specified topic" + }, + deduplication: { + type: "boolean", + description: "Whether deduplication of events is enabled or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + namespace: "ns1", + persistence: "persistent", + compaction: 1e3, + retention: { + time: 15, + size: 1e3 + }, + ttl: 360, + "geo-replication": [ + "us-west", + "us-east" + ], + deduplication: true, + bindingVersion: "0.1.0" + } + ] + }, + operations: { + type: "object", + description: "Holds a dictionary with all the operations this application MUST implement.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operation" + } + ] + }, + examples: [ + { + onUserSignUp: { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + operation: { + type: "object", + description: "Describes a specific operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "action", + "channel" + ], + properties: { + action: { + type: "string", + description: "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + enum: [ + "send", + "receive" + ] + }, + channel: { + $ref: "#/definitions/Reference" + }, + messages: { + type: "array", + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + items: { + $ref: "#/definitions/Reference" + } + }, + reply: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReply" + } + ] + }, + traits: { + type: "array", + description: "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + title: { + type: "string", + description: "A human-friendly title for the operation." + }, + summary: { + type: "string", + description: "A brief summary of the operation." + }, + description: { + type: "string", + description: "A longer description of the operation. CommonMark is allowed." + }, + security: { + $ref: "#/definitions/securityRequirements" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + }, + uniqueItems: true + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + } + }, + examples: [ + { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + security: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ], + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ], + messages: [ + { + $ref: "/components/messages/userSignedUp" + } + ], + reply: { + address: { + location: "$message.header#/replyTo" + }, + channel: { + $ref: "#/channels/userSignupReply" + }, + messages: [ + { + $ref: "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + operationReply: { + type: "object", + description: "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + address: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReplyAddress" + } + ] + }, + channel: { + $ref: "#/definitions/Reference" + }, + messages: { + type: "array", + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + items: { + $ref: "#/definitions/Reference" + } + } + } + }, + operationReplyAddress: { + type: "object", + description: "An object that specifies where an operation has to send the reply", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "location" + ], + properties: { + location: { + type: "string", + description: "A runtime expression that specifies the location of the reply address.", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + description: { + type: "string", + description: "An optional description of the address. CommonMark is allowed." + } + }, + examples: [ + { + description: "Consumer inbox", + location: "$message.header#/replyTo" + } + ] + }, + operationTrait: { + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + description: "A human-friendly title for the operation.", + $ref: "#/definitions/operation/properties/title" + }, + summary: { + description: "A short summary of what the operation is about.", + $ref: "#/definitions/operation/properties/summary" + }, + description: { + description: "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + $ref: "#/definitions/operation/properties/description" + }, + security: { + description: "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + $ref: "#/definitions/operation/properties/security" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + $ref: "#/definitions/operation/properties/tags" + }, + externalDocs: { + description: "Additional external documentation for this operation.", + $ref: "#/definitions/operation/properties/externalDocs" + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + operationBindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for an operation.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + http: { + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-operation" + } + } + ] + }, + ws: {}, + amqp: { + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-operation" + } + } + ] + }, + amqp1: {}, + mqtt: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-operation" + } + } + ] + }, + kafka: { + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-operation" + } + } + ] + }, + anypointmq: {}, + nats: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-nats-0.1.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-nats-0.1.0-operation" + } + } + ] + }, + jms: {}, + sns: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-operation" + } + } + ] + }, + sqs: { + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ] + }, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: { + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.2.0-operation" + } + } + ] + }, + googlepubsub: {} + } + }, + "bindings-http-0.3.0-operation": { + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-http-0.2.0-operation": { + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-amqp-0.3.0-operation": { + title: "AMQP operation bindings object", + description: "This object contains information about the operation representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + expiration: { + type: "integer", + minimum: 0, + description: "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + userId: { + type: "string", + description: "Identifies the user who has sent the message." + }, + cc: { + type: "array", + items: { + type: "string" + }, + description: "The routing keys the message should be routed to at the time of publishing." + }, + priority: { + type: "integer", + description: "A priority for the message." + }, + deliveryMode: { + type: "integer", + enum: [ + 1, + 2 + ], + description: "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + mandatory: { + type: "boolean", + description: "Whether the message is mandatory or not." + }, + bcc: { + type: "array", + items: { + type: "string" + }, + description: "Like cc but consumers will not receive this information." + }, + timestamp: { + type: "boolean", + description: "Whether the message should include a timestamp or not." + }, + ack: { + type: "boolean", + description: "Whether the consumer should ack the message or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + expiration: 1e5, + userId: "guest", + cc: [ + "user.logs" + ], + priority: 10, + deliveryMode: 2, + mandatory: false, + bcc: [ + "external.audit" + ], + timestamp: true, + ack: false, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-operation": { + title: "MQTT operation bindings object", + description: "This object contains information about the operation representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the message or not." + }, + messageExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0, + maximum: 4294967295 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Lifetime of the message in seconds" + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + qos: 2, + retain: true, + messageExpiryInterval: 60, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + title: "NATS operation bindings object", + description: "This object contains information about the operation representation in NATS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queue: { + type: "string", + description: "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + maxLength: 255 + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + queue: "MyCustomQueue", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-sns-0.1.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + description: "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + consumers: { + type: "array", + description: "The protocols that listen to this topic and their endpoints.", + items: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/consumer" + }, + minItems: 1 + }, + deliveryPolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "consumers" + ], + definitions: { + identifier: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string", + description: "The endpoint is a URL." + }, + email: { + type: "string", + description: "The endpoint is an email address." + }, + phone: { + type: "string", + description: "The endpoint is a phone number." + }, + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + consumer: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + protocol: { + description: "The protocol that this endpoint receives messages by.", + type: "string", + enum: [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + endpoint: { + description: "The endpoint messages are delivered to.", + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier" + }, + filterPolicy: { + type: "object", + description: "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: { + oneOf: [ + { + type: "array", + items: { + type: "string" + } + }, + { + type: "string" + }, + { + type: "object" + } + ] + } + }, + filterPolicyScope: { + type: "string", + description: "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + enum: [ + "MessageAttributes", + "MessageBody" + ], + default: "MessageAttributes" + }, + rawMessageDelivery: { + type: "boolean", + description: "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy" + }, + deliveryPolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + displayName: { + type: "string", + description: "The display name to use with an SNS subscription" + } + }, + required: [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + deliveryPolicy: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + minDelayTarget: { + type: "integer", + description: "The minimum delay for a retry in seconds." + }, + maxDelayTarget: { + type: "integer", + description: "The maximum delay for a retry in seconds." + }, + numRetries: { + type: "integer", + description: "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + numNoDelayRetries: { + type: "integer", + description: "The number of immediate retries (with no delay)." + }, + numMinDelayRetries: { + type: "integer", + description: "The number of immediate retries (with delay)." + }, + numMaxDelayRetries: { + type: "integer", + description: "The number of post-backoff phase retries, with the maximum delay between retries." + }, + backoffFunction: { + type: "string", + description: "The algorithm for backoff between retries.", + enum: [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + maxReceivesPerSecond: { + type: "integer", + description: "The maximum number of deliveries per second, per subscription." + } + } + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + description: "The SQS queue to use as a dead letter queue (DLQ)." + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + } + }, + examples: [ + { + topic: { + name: "someTopic" + }, + consumers: [ + { + protocol: "sqs", + endpoint: { + name: "someQueue" + }, + filterPolicy: { + store: [ + "asyncapi_corp" + ], + event: [ + { + "anything-but": "order_cancelled" + } + ], + customer_interests: [ + "rugby", + "football", + "baseball" + ] + }, + filterPolicyScope: "MessageAttributes", + rawMessageDelivery: false, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 25 + }, + deliveryPolicy: { + minDelayTarget: 10, + maxDelayTarget: 100, + numRetries: 5, + numNoDelayRetries: 2, + numMinDelayRetries: 3, + numMaxDelayRetries: 5, + backoffFunction: "linear", + maxReceivesPerSecond: 2 + } + } + ] + } + ] + }, + "bindings-sqs-0.2.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queues: { + type: "array", + description: "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/queue" + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queues" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + type: "string", + description: "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy" + }, + policy: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queues: [ + { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 10, + redrivePolicy: { + deadLetterQueue: { + name: "myQueue_error" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + name: "myQueue_error", + deliveryDelay: 10 + } + ] + } + ] + }, + "bindings-solace-0.4.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + }, + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + timeToLive: { + type: "integer", + description: "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + priority: { + type: "integer", + minimum: 0, + maximum: 255, + description: "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + dmqEligible: { + type: "boolean", + description: "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + examples: [ + { + bindingVersion: "0.4.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.3.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.3.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.2.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.2.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + type: "object", + description: "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + $ref: "#/definitions/anySchema" + } + } + }, + servers: { + type: "object", + description: "An object to hold reusable Server Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + } + }, + channels: { + type: "object", + description: "An object to hold reusable Channel Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channel" + } + ] + } + } + }, + serverVariables: { + type: "object", + description: "An object to hold reusable Server Variable Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + } + }, + operations: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operation" + } + ] + } + } + }, + messages: { + type: "object", + description: "An object to hold reusable Message Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageObject" + } + ] + } + } + }, + securitySchemes: { + type: "object", + description: "An object to hold reusable Security Scheme Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + type: "object", + description: "An object to hold reusable Parameter Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + } + } + }, + correlationIds: { + type: "object", + description: "An object to hold reusable Correlation ID Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + description: "An object to hold reusable Operation Trait Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + } + }, + messageTraits: { + type: "object", + description: "An object to hold reusable Message Trait Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + replies: { + type: "object", + description: "An object to hold reusable Operation Reply Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReply" + } + ] + } + } + }, + replyAddresses: { + type: "object", + description: "An object to hold reusable Operation Reply Address Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReplyAddress" + } + ] + } + } + }, + serverBindings: { + type: "object", + description: "An object to hold reusable Server Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverBindingsObject" + } + ] + } + } + }, + channelBindings: { + type: "object", + description: "An object to hold reusable Channel Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channelBindingsObject" + } + ] + } + } + }, + operationBindings: { + type: "object", + description: "An object to hold reusable Operation Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + } + } + }, + messageBindings: { + type: "object", + description: "An object to hold reusable Message Bindings Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + } + } + }, + tags: { + type: "object", + description: "An object to hold reusable Tag Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + } + }, + externalDocs: { + type: "object", + description: "An object to hold reusable External Documentation Objects.", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + } + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + AvroExample: { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + schema: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + }, + servers: { + development: { + host: "{stage}.in.mycompany.com:{port}", + description: "RabbitMQ broker", + protocol: "amqp", + protocolVersion: "0-9-1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `mycompany.com`" + }, + port: { + enum: [ + "5671", + "5672" + ], + default: "5672" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user." + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/schemas/3.1.0-without-$id.json +var require_without_id9 = __commonJS({ + "node_modules/@asyncapi/specs/schemas/3.1.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 3.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info" + ], + properties: { + id: { + description: "A unique id representing the application.", + type: "string", + format: "uri" + }, + asyncapi: { + description: "The AsyncAPI specification version of this document.", + type: "string", + const: "3.1.0" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + defaultContentType: { + description: "Default content type to use when encoding/decoding a message's payload.", + type: "string" + }, + info: { + $ref: "#/definitions/info" + }, + operations: { + $ref: "#/definitions/operations" + }, + servers: { + $ref: "#/definitions/servers" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + definitions: { + channels: { + description: "An object containing all the Channel Object definitions the Application MUST use during runtime.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channel" + } + ] + }, + examples: [ + { + userSignedUp: { + address: "user.signedup", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + Reference: { + type: "object", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + required: [ + "$ref" + ], + properties: { + $ref: { + description: "The reference string.", + $ref: "#/definitions/ReferenceObject" + } + }, + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + channel: { + description: "Describes a shared communication channel.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the channel.", + type: "string" + }, + description: { + description: "A longer description of the channel. CommonMark is allowed.", + type: "string" + }, + address: { + description: 'An optional string representation of this channel\'s address. The address is typically the "topic name", "routing key", "event type", or "path". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can\'t be known upfront. It MAY contain Channel Address Expressions.', + type: [ + "string", + "null" + ] + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channelBindingsObject" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + messages: { + $ref: "#/definitions/channelMessages" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + servers: { + description: "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + type: "array", + uniqueItems: true, + items: { + $ref: "#/definitions/Reference" + } + }, + summary: { + description: "A brief summary of the channel.", + type: "string" + }, + tags: { + description: "A list of tags for logical grouping of channels.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + address: "users.{userId}", + title: "Users channel", + description: "This channel is used to exchange messages about user events.", + messages: { + userSignedUp: { + $ref: "#/components/messages/userSignedUp" + }, + userCompletedOrder: { + $ref: "#/components/messages/userCompletedOrder" + } + }, + parameters: { + userId: { + $ref: "#/components/parameters/userId" + } + }, + servers: [ + { + $ref: "#/servers/rabbitmqInProd" + }, + { + $ref: "#/servers/rabbitmqInStaging" + } + ], + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + }, + tags: [ + { + name: "user", + description: "User-related messages" + } + ], + externalDocs: { + description: "Find more info here", + url: "https://example.com" + } + } + ] + }, + channelBindingsObject: { + description: "Map describing protocol-specific definitions for a channel.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + googlepubsub: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + http: {}, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: {}, + nats: {}, + pulsar: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + sns: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + solace: {}, + sqs: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + stomp: {}, + ws: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-websockets-0.1.0-channel" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-websockets-0.1.0-channel" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + "bindings-amqp-0.3.0-channel": { + title: "AMQP channel bindings object", + description: "This object contains information about the channel representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + is: { + type: "string", + enum: [ + "queue", + "routingKey" + ], + description: "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + exchange: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + type: { + type: "string", + enum: [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + description: "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + durable: { + type: "boolean", + description: "Whether the exchange should survive broker restarts or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the exchange should be deleted when the last queue is unbound from it." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the exchange. Defaults to '/'." + } + }, + description: "When is=routingKey, this object defines the exchange properties." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + maxLength: 255, + description: "The name of the queue. It MUST NOT exceed 255 characters long." + }, + durable: { + type: "boolean", + description: "Whether the queue should survive broker restarts or not." + }, + exclusive: { + type: "boolean", + description: "Whether the queue should be used only by one connection or not." + }, + autoDelete: { + type: "boolean", + description: "Whether the queue should be deleted when the last consumer unsubscribes." + }, + vhost: { + type: "string", + default: "/", + description: "The virtual host of the queue. Defaults to '/'." + } + }, + description: "When is=queue, this object defines the queue properties." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + oneOf: [ + { + properties: { + is: { + const: "routingKey" + } + }, + required: [ + "exchange" + ], + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + is: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "exchange" + ] + } + } + ], + examples: [ + { + is: "routingKey", + exchange: { + name: "myExchange", + type: "topic", + durable: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + }, + { + is: "queue", + queue: { + name: "my-queue-name", + durable: true, + exclusive: true, + autoDelete: false, + vhost: "/" + }, + bindingVersion: "0.3.0" + } + ] + }, + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalItems: true, + additionalProperties: true + }, + "bindings-anypointmq-0.0.1-channel": { + title: "Anypoint MQ channel bindings object", + description: "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "exchange", + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signup-exchg", + destinationType: "exchange", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-googlepubsub-0.2.0-channel": { + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the channel representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + labels: { + type: "object" + }, + messageRetentionDuration: { + type: "string" + }, + messageStoragePolicy: { + type: "object", + additionalProperties: false, + properties: { + allowedPersistenceRegions: { + type: "array", + items: { + type: "string" + } + } + } + }, + schemaSettings: { + type: "object", + additionalItems: false, + properties: { + encoding: { + type: "string" + }, + firstRevisionId: { + type: "string" + }, + lastRevisionId: { + type: "string" + }, + name: { + type: "string" + } + }, + required: [ + "encoding", + "name" + ] + } + }, + required: [ + "schemaSettings" + ], + examples: [ + { + labels: { + label1: "value1", + label2: "value2" + }, + messageRetentionDuration: "86400s", + messageStoragePolicy: { + allowedPersistenceRegions: [ + "us-central1", + "us-east1" + ] + }, + schemaSettings: { + encoding: "json", + name: "projects/your-project-id/schemas/your-schema" + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + title: "IBM MQ channel bindings object", + description: "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destinationType: { + type: "string", + enum: [ + "topic", + "queue" + ], + default: "topic", + description: "Defines the type of AsyncAPI channel." + }, + queue: { + type: "object", + description: "Defines the properties of a queue.", + properties: { + objectName: { + type: "string", + maxLength: 48, + description: "Defines the name of the IBM MQ queue associated with the channel." + }, + isPartitioned: { + type: "boolean", + default: false, + description: "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + exclusive: { + type: "boolean", + default: false, + description: "Specifies if it is recommended to open the queue exclusively." + } + }, + required: [ + "objectName" + ] + }, + topic: { + type: "object", + description: "Defines the properties of a topic.", + properties: { + string: { + type: "string", + maxLength: 10240, + description: "The value of the IBM MQ topic string to be used." + }, + objectName: { + type: "string", + maxLength: 48, + description: "The name of the IBM MQ topic object." + }, + durablePermitted: { + type: "boolean", + default: true, + description: "Defines if the subscription may be durable." + }, + lastMsgRetained: { + type: "boolean", + default: false, + description: "Defines if the last message published will be made available to new subscriptions." + } + } + }, + maxMsgLength: { + type: "integer", + minimum: 0, + maximum: 104857600, + description: "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + destinationType: { + const: "topic" + } + }, + not: { + required: [ + "queue" + ] + } + }, + { + properties: { + destinationType: { + const: "queue" + } + }, + required: [ + "queue" + ], + not: { + required: [ + "topic" + ] + } + } + ], + examples: [ + { + destinationType: "topic", + topic: { + objectName: "myTopicName" + }, + bindingVersion: "0.1.0" + }, + { + destinationType: "queue", + queue: { + objectName: "myQueueName", + exclusive: true + }, + bindingVersion: "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-channel": { + title: "Channel Schema", + description: "This object contains configuration for describing a JMS queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + destination: { + type: "string", + description: "The destination (queue) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name according to the JMS Provider. Defaults to the channel name." + }, + destinationType: { + type: "string", + enum: [ + "queue", + "fifo-queue" + ], + default: "queue", + description: "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or strict message ordering) supported by this channel." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + destination: "user-signed-up", + destinationType: "fifo-queue", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: true, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + }, + "confluent.key.schema.validation": { + description: "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)", + type: "boolean" + }, + "confluent.key.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)", + type: "string" + }, + "confluent.value.schema.validation": { + description: "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)", + type: "boolean" + }, + "confluent.value.subject.name.strategy": { + description: "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)", + type: "string" + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + topicConfiguration: { + description: "Topic configuration properties that are relevant for the API.", + type: "object", + additionalProperties: false, + properties: { + "cleanup.policy": { + description: "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", + type: "array", + items: { + type: "string", + enum: [ + "compact", + "delete" + ] + } + }, + "retention.ms": { + description: "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", + type: "integer", + minimum: -1 + }, + "retention.bytes": { + description: "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", + type: "integer", + minimum: -1 + }, + "delete.retention.ms": { + description: "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", + type: "integer", + minimum: 0 + }, + "max.message.bytes": { + description: "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.", + type: "integer", + minimum: 0 + } + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + type: "string", + description: "Kafka topic name if different from channel name." + }, + partitions: { + type: "integer", + minimum: 1, + description: "Number of partitions configured on this topic." + }, + replicas: { + type: "integer", + minimum: 1, + description: "Number of replicas configured on this topic." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + topic: "my-specific-topic", + partitions: 20, + replicas: 3, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-pulsar-0.1.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "namespace", + "persistence" + ], + properties: { + namespace: { + type: "string", + description: "The namespace, the channel is associated with." + }, + persistence: { + type: "string", + enum: [ + "persistent", + "non-persistent" + ], + description: "persistence of the topic in Pulsar." + }, + compaction: { + type: "integer", + minimum: 0, + description: "Topic compaction threshold given in MB" + }, + "geo-replication": { + type: "array", + description: "A list of clusters the topic is replicated to.", + items: { + type: "string" + } + }, + retention: { + type: "object", + additionalProperties: false, + properties: { + time: { + type: "integer", + minimum: 0, + description: "Time given in Minutes. `0` = Disable message retention." + }, + size: { + type: "integer", + minimum: 0, + description: "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + ttl: { + type: "integer", + description: "TTL in seconds for the specified topic" + }, + deduplication: { + type: "boolean", + description: "Whether deduplication of events is enabled or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + namespace: "ns1", + persistence: "persistent", + compaction: 1e3, + retention: { + time: 15, + size: 1e3 + }, + ttl: 360, + "geo-replication": [ + "us-west", + "us-east" + ], + deduplication: true, + bindingVersion: "0.1.0" + } + ] + }, + "bindings-sns-0.1.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + name: { + type: "string", + description: "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + ordering: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/ordering" + }, + policy: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the topic." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "name" + ], + definitions: { + ordering: { + type: "object", + description: "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + type: { + type: "string", + description: "Defines the type of SNS Topic.", + enum: [ + "standard", + "FIFO" + ] + }, + contentBasedDeduplication: { + type: "boolean", + description: "True to turn on de-duplication of messages for a channel." + } + }, + required: [ + "type" + ] + }, + policy: { + type: "object", + description: "The security policy for the SNS Topic.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this topic", + items: { + $ref: "#/definitions/bindings-sns-0.1.0-channel/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SNS permission being allowed or denied e.g. sns:Publish", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + name: "my-sns-topic", + policy: { + statements: [ + { + effect: "Allow", + principal: "*", + action: "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + title: "Channel Schema", + description: "This object contains information about the channel representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queue: { + description: "A definition of the queue that will be used as the channel.", + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + deadLetterQueue: { + description: "A definition of the queue that will be used for un-processable messages.", + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/queue" + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queue" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/redrivePolicy" + }, + policy: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name", + "fifoQueue" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-channel/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queue: { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 15, + visibilityTimeout: 60, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 86400, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + tags: { + owner: "AsyncAPI.NET", + platform: "AsyncAPIOrg" + } + }, + deadLetterQueue: { + name: "myQueue_error", + deliveryDelay: 0, + visibilityTimeout: 0, + receiveMessageWaitTime: 0, + messageRetentionPeriod: 604800 + } + } + ] + }, + "bindings-websockets-0.1.0-channel": { + title: "WebSockets channel bindings object", + description: "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "POST" + ], + description: "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + query: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + headers: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + method: "POST", + bindingVersion: "0.1.0" + } + ] + }, + schema: { + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + properties: { + deprecated: { + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", + default: false, + type: "boolean" + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + items: { + default: {}, + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ] + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + properties: { + default: {}, + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + } + }, + patternProperties: { + default: {}, + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + } + }, + additionalProperties: { + default: {}, + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ] + }, + discriminator: { + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details.", + type: "string" + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + description: "Allows referencing an external resource for extended documentation.", + type: "object", + required: [ + "url" + ], + properties: { + description: { + description: "A short description of the target documentation. CommonMark syntax can be used for rich text representation.", + type: "string" + }, + url: { + description: "The URL for the target documentation. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + channelMessages: { + description: "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageObject" + } + ] + } + }, + messageObject: { + description: "Describes a message received on a given channel and operation.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the message.", + type: "string" + }, + description: { + description: "A longer description of the message. CommonMark is allowed.", + type: "string" + }, + examples: { + description: "List of examples.", + type: "array", + items: { + $ref: "#/definitions/messageExampleObject" + } + }, + deprecated: { + default: false, + type: "boolean" + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + }, + contentType: { + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + headers: { + $ref: "#/definitions/anySchema" + }, + name: { + description: "Name of the message.", + type: "string" + }, + payload: { + $ref: "#/definitions/anySchema" + }, + summary: { + description: "A brief summary of the message.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + }, + traits: { + description: "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + }, + { + type: "array", + items: [ + { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + }, + { + type: "object", + additionalItems: true + } + ] + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + } + ] + }, + messageExampleObject: { + type: "object", + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + headers: { + description: "Example of the application headers. It can be of any type.", + type: "object" + }, + name: { + description: "Machine readable name of the message example.", + type: "string" + }, + payload: { + description: "Example of the message payload. It can be of any type." + }, + summary: { + description: "A brief summary of the message example.", + type: "string" + } + }, + additionalProperties: false + }, + messageBindingsObject: { + description: "Map describing protocol-specific definitions for a message.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-anypointmq-0.0.1-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + googlepubsub: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-googlepubsub-0.2.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + http: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + } + }, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-message" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-message" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: {}, + redis: {}, + sns: {}, + solace: {}, + sqs: {}, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + "bindings-amqp-0.3.0-message": { + title: "AMQP message bindings object", + description: "This object contains information about the message representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + contentEncoding: { + type: "string", + description: "A MIME encoding for the message content." + }, + messageType: { + type: "string", + description: "Application-specific message type." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + contentEncoding: "gzip", + messageType: "user.signup", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-anypointmq-0.0.1-message": { + title: "Anypoint MQ message bindings object", + description: "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + messageId: { + type: "string" + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "bindings-googlepubsub-0.2.0-message": { + title: "Cloud Pub/Sub Channel Schema", + description: "This object contains information about the message representation for Google Cloud Pub/Sub.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + }, + attributes: { + type: "object" + }, + orderingKey: { + type: "string" + }, + schema: { + type: "object", + additionalItems: false, + properties: { + name: { + type: "string" + } + }, + required: [ + "name" + ] + } + }, + examples: [ + { + schema: { + name: "projects/your-project-id/schemas/your-avro-schema-id" + } + }, + { + schema: { + name: "projects/your-project-id/schemas/your-protobuf-schema-id" + } + } + ] + }, + "bindings-http-0.3.0-message": { + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + statusCode: { + type: "number", + description: "The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-http-0.2.0-message": { + title: "HTTP message bindings object", + description: "This object contains information about the message representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: " A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + headers: { + type: "object", + properties: { + "Content-Type": { + type: "string", + enum: [ + "application/json" + ] + } + } + }, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + title: "IBM MQ message bindings object", + description: "This object contains information about the message representation in IBM MQ.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + type: { + type: "string", + enum: [ + "string", + "jms", + "binary" + ], + default: "string", + description: "The type of the message." + }, + headers: { + type: "string", + description: "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + description: { + type: "string", + description: "Provides additional information for application developers: describes the message type or format." + }, + expiry: { + type: "integer", + minimum: 0, + default: 0, + description: "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + oneOf: [ + { + properties: { + type: { + const: "binary" + } + } + }, + { + properties: { + type: { + const: "jms" + } + }, + not: { + required: [ + "headers" + ] + } + }, + { + properties: { + type: { + const: "string" + } + }, + not: { + required: [ + "headers" + ] + } + } + ], + examples: [ + { + type: "string", + bindingVersion: "0.1.0" + }, + { + type: "jms", + description: "JMS stream message", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-message": { + title: "Message Schema", + description: "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + headers: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + headers: { + type: "object", + required: [ + "JMSMessageID" + ], + properties: { + JMSMessageID: { + type: [ + "string", + "null" + ], + description: "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + JMSTimestamp: { + type: "integer", + description: "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + JMSDeliveryMode: { + type: "string", + enum: [ + "PERSISTENT", + "NON_PERSISTENT" + ], + default: "PERSISTENT", + description: "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + JMSPriority: { + type: "integer", + default: 4, + description: "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + JMSExpires: { + type: "integer", + description: "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + JMSType: { + type: [ + "string", + "null" + ], + description: "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + JMSCorrelationID: { + type: [ + "string", + "null" + ], + description: "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + JMSReplyTo: { + type: "string", + description: "The queue or topic that the message sender expects replies to." + } + } + }, + bindingVersion: "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/schema" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.5.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + anyOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/avroSchema_v1" + } + ], + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.4.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.4.0" + } + ] + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "bindings-kafka-0.3.0-message": { + title: "Message Schema", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + key: { + $ref: "#/definitions/schema", + description: "The message key." + }, + schemaIdLocation: { + type: "string", + description: "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + enum: [ + "header", + "payload" + ] + }, + schemaIdPayloadEncoding: { + type: "string", + description: "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + schemaLookupStrategy: { + type: "string", + description: "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + key: { + type: "string", + enum: [ + "myKey" + ] + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "apicurio-new", + schemaLookupStrategy: "TopicIdStrategy", + bindingVersion: "0.3.0" + }, + { + key: { + $ref: "path/to/user-create.avsc#/UserCreate" + }, + schemaIdLocation: "payload", + schemaIdPayloadEncoding: "4", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-message": { + title: "MQTT message bindings object", + description: "This object contains information about the message representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + payloadFormatIndicator: { + type: "integer", + enum: [ + 0, + 1 + ], + description: "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + default: 0 + }, + correlationData: { + oneOf: [ + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + contentType: { + type: "string", + description: "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + responseTopic: { + oneOf: [ + { + type: "string", + format: "uri-template", + minLength: 1 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "The topic (channel URI) to be used for a response message." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + bindingVersion: "0.2.0" + }, + { + contentType: "application/json", + correlationData: { + type: "string", + format: "uuid" + }, + responseTopic: "application/responses", + bindingVersion: "0.2.0" + } + ] + }, + correlationId: { + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + type: "object", + required: [ + "location" + ], + properties: { + description: { + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed.", + type: "string" + }, + location: { + description: "A runtime expression that specifies the location of the correlation ID", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + anySchema: { + description: "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", + if: { + required: [ + "schema" + ] + }, + then: { + $ref: "#/definitions/multiFormatSchema" + }, + else: { + $ref: "#/definitions/schema" + } + }, + multiFormatSchema: { + description: "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", + type: "object", + if: { + not: { + type: "object" + } + }, + then: { + $ref: "#/definitions/schema" + }, + else: { + allOf: [ + { + if: { + not: { + description: "If no schemaFormat has been defined, default to schema or reference", + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + description: "If schemaFormat has been defined check if it's one of the AsyncAPI Schema Object formats", + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + schema: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/openapiSchema_3_0" + } + ] + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + schema: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/avroSchema_v1" + } + ] + } + } + } + } + ], + properties: { + schemaFormat: { + description: "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", + anyOf: [ + { + type: "string" + }, + { + description: "All the schema formats tooling MUST support", + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07", + "application/vnd.aai.asyncapi;version=3.0.0", + "application/vnd.aai.asyncapi+json;version=3.0.0", + "application/vnd.aai.asyncapi+yaml;version=3.0.0", + "application/vnd.aai.asyncapi;version=3.1.0", + "application/vnd.aai.asyncapi+json;version=3.1.0", + "application/vnd.aai.asyncapi+yaml;version=3.1.0" + ] + }, + { + description: "All the schema formats tools are RECOMMENDED to support", + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0", + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/raml+yaml;version=1.0" + ] + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + tag: { + description: "Allows adding metadata to a single tag.", + type: "object", + required: [ + "name" + ], + properties: { + description: { + description: "A short description for the tag. CommonMark syntax can be used for rich text representation.", + type: "string" + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + name: { + description: "The name of the tag.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + messageTrait: { + description: "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the message.", + type: "string" + }, + description: { + description: "A longer description of the message. CommonMark is allowed.", + type: "string" + }, + examples: { + description: "List of examples.", + type: "array", + items: { + $ref: "#/definitions/messageExampleObject" + } + }, + deprecated: { + default: false, + type: "boolean" + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + }, + contentType: { + description: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field.", + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + headers: { + $ref: "#/definitions/anySchema" + }, + name: { + description: "Name of the message.", + type: "string" + }, + summary: { + description: "A brief summary of the message.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + contentType: "application/json" + } + ] + }, + parameters: { + description: "JSON objects describing re-usable channel parameters.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user." + } + } + } + ] + }, + parameter: { + description: "Describes a parameter included in a channel address.", + properties: { + description: { + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed.", + type: "string" + }, + examples: { + description: "An array of examples of the parameter value.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + items: { + type: "string" + } + }, + location: { + description: "A runtime expression that specifies the location of the parameter value", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + address: "user/{userId}/signedup", + parameters: { + userId: { + description: "Id of the user.", + location: "$message.payload#/user/id" + } + } + } + ] + }, + components: { + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + type: "object", + properties: { + channelBindings: { + description: "An object to hold reusable Channel Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channelBindingsObject" + } + ] + } + } + }, + channels: { + description: "An object to hold reusable Channel Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/channel" + } + ] + } + } + }, + correlationIds: { + description: "An object to hold reusable Correlation ID Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + externalDocs: { + description: "An object to hold reusable External Documentation Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + } + } + }, + messageBindings: { + description: "An object to hold reusable Message Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageBindingsObject" + } + ] + } + } + }, + messageTraits: { + description: "An object to hold reusable Message Trait Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + messages: { + description: "An object to hold reusable Message Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageObject" + } + ] + } + } + }, + operationBindings: { + description: "An object to hold reusable Operation Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + } + } + }, + operationTraits: { + description: "An object to hold reusable Operation Trait Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + } + }, + operations: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operation" + } + ] + } + } + }, + parameters: { + description: "An object to hold reusable Parameter Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + } + } + }, + replies: { + description: "An object to hold reusable Operation Reply Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReply" + } + ] + } + } + }, + replyAddresses: { + description: "An object to hold reusable Operation Reply Address Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReplyAddress" + } + ] + } + } + }, + schemas: { + description: "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + $ref: "#/definitions/anySchema" + } + } + }, + securitySchemes: { + description: "An object to hold reusable Security Scheme Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + serverBindings: { + description: "An object to hold reusable Server Bindings Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverBindingsObject" + } + ] + } + } + }, + serverVariables: { + description: "An object to hold reusable Server Variable Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + } + }, + servers: { + description: "An object to hold reusable Server Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + } + }, + tags: { + description: "An object to hold reusable Tag Objects.", + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + AvroExample: { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + schema: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + }, + servers: { + development: { + host: "{stage}.in.mycompany.com:{port}", + description: "RabbitMQ broker", + protocol: "amqp", + protocolVersion: "0-9-1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `mycompany.com`" + }, + port: { + enum: [ + "5671", + "5672" + ], + default: "5672" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user." + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + operationBindingsObject: { + description: "Map describing protocol-specific definitions for an operation.", + type: "object", + properties: { + amqp: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-amqp-0.3.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.3.0" + ] + } + } + }, + amqp1: {}, + anypointmq: {}, + googlepubsub: {}, + http: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-http-0.3.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0", + "0.3.0" + ] + } + } + }, + ibmmq: {}, + jms: {}, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-nats-0.1.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-nats-0.1.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + ros2: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ros2-0.1.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ros2-0.1.0-operation" + } + } + ] + }, + sns: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sns-0.1.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + solace: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.3.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.2.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + sqs: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + "bindings-amqp-0.3.0-operation": { + title: "AMQP operation bindings object", + description: "This object contains information about the operation representation in AMQP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + expiration: { + type: "integer", + minimum: 0, + description: "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + userId: { + type: "string", + description: "Identifies the user who has sent the message." + }, + cc: { + type: "array", + items: { + type: "string" + }, + description: "The routing keys the message should be routed to at the time of publishing." + }, + priority: { + type: "integer", + description: "A priority for the message." + }, + deliveryMode: { + type: "integer", + enum: [ + 1, + 2 + ], + description: "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + mandatory: { + type: "boolean", + description: "Whether the message is mandatory or not." + }, + bcc: { + type: "array", + items: { + type: "string" + }, + description: "Like cc but consumers will not receive this information." + }, + timestamp: { + type: "boolean", + description: "Whether the message should include a timestamp or not." + }, + ack: { + type: "boolean", + description: "Whether the consumer should ack the message or not." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + expiration: 1e5, + userId: "guest", + cc: [ + "user.logs" + ], + priority: 10, + deliveryMode: 2, + mandatory: false, + bcc: [ + "external.audit" + ], + timestamp: true, + ack: false, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-http-0.3.0-operation": { + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-http-0.2.0-operation": { + title: "HTTP operation bindings object", + description: "This object contains information about the operation representation in HTTP.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + method: { + type: "string", + enum: [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + description: "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." + }, + query: { + $ref: "#/definitions/schema", + description: "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + }, + { + method: "GET", + query: { + type: "object", + required: [ + "companyId" + ], + properties: { + companyId: { + type: "number", + minimum: 1, + description: "The Id of the company." + } + }, + additionalProperties: false + }, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-kafka-0.5.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in Kafka.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + $ref: "#/definitions/schema", + description: "Id of the consumer group." + }, + clientId: { + $ref: "#/definitions/schema", + description: "Id of the consumer inside a consumer group." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + groupId: { + type: "string", + enum: [ + "myGroupId" + ] + }, + clientId: { + type: "string", + enum: [ + "myClientId" + ] + }, + bindingVersion: "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-operation": { + title: "MQTT operation bindings object", + description: "This object contains information about the operation representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the message or not." + }, + messageExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0, + maximum: 4294967295 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Lifetime of the message in seconds" + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + qos: 2, + retain: true, + messageExpiryInterval: 60, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + title: "NATS operation bindings object", + description: "This object contains information about the operation representation in NATS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queue: { + type: "string", + description: "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + maxLength: 255 + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + queue: "MyCustomQueue", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-ros2-0.1.0-operation": { + description: "This object contains information about the operation representation in ROS 2.", + examples: [ + { + node: "/turtlesim", + qosPolicies: { + deadline: "-1", + durability: "volatile", + history: "unknown", + leaseDuration: "-1", + lifespan: "-1", + liveliness: "automatic", + reliability: "reliable" + }, + role: "subscriber" + } + ], + type: "object", + required: [ + "role", + "node" + ], + properties: { + bindingVersion: { + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + type: "string", + enum: [ + "0.1.0" + ] + }, + node: { + description: "The name of the ROS 2 node that implements this operation.", + type: "string" + }, + qosPolicies: { + type: "object", + properties: { + deadline: { + description: "The expected maximum amount of time between subsequent messages being published to a topic. -1 means infinite.", + type: "integer" + }, + durability: { + description: "Persistence specification that determines message availability for late-joining subscribers", + type: "string", + enum: [ + "transient_local", + "volatile" + ] + }, + history: { + description: "Policy parameter that defines the maximum number of samples maintained in the middleware queue", + type: "string", + enum: [ + "keep_last", + "keep_all", + "unknown" + ] + }, + leaseDuration: { + description: "The maximum period of time a publisher has to indicate that it is alive before the system considers it to have lost liveliness. -1 means infinite.", + type: "integer" + }, + lifespan: { + description: "The maximum amount of time between the publishing and the reception of a message without the message being considered stale or expired. -1 means infinite.", + type: "integer" + }, + liveliness: { + description: "Defines the mechanism by which the system monitors and determines the operational status of communication entities within the network.", + type: "string", + enum: [ + "automatic", + "manual" + ] + }, + reliability: { + description: "Specifies the communication guarantee model that determines whether message delivery confirmation between publisher and subscriber is required.", + type: "string", + enum: [ + "best_effort", + "realiable" + ] + } + } + }, + role: { + description: "Specifies the ROS 2 type of the node for this operation.", + type: "string", + enum: [ + "publisher", + "action_client", + "service_client", + "subscriber", + "action_server", + "service_server" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + "bindings-sns-0.1.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in SNS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + topic: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + description: "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + consumers: { + type: "array", + description: "The protocols that listen to this topic and their endpoints.", + items: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/consumer" + }, + minItems: 1 + }, + deliveryPolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + bindingVersion: { + type: "string", + description: "The version of this binding.", + default: "latest" + } + }, + required: [ + "consumers" + ], + definitions: { + identifier: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string", + description: "The endpoint is a URL." + }, + email: { + type: "string", + description: "The endpoint is an email address." + }, + phone: { + type: "string", + description: "The endpoint is a phone number." + }, + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + consumer: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + protocol: { + description: "The protocol that this endpoint receives messages by.", + type: "string", + enum: [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + endpoint: { + description: "The endpoint messages are delivered to.", + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier" + }, + filterPolicy: { + type: "object", + description: "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: { + oneOf: [ + { + type: "array", + items: { + type: "string" + } + }, + { + type: "string" + }, + { + type: "object" + } + ] + } + }, + filterPolicyScope: { + type: "string", + description: "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + enum: [ + "MessageAttributes", + "MessageBody" + ], + default: "MessageAttributes" + }, + rawMessageDelivery: { + type: "boolean", + description: "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/redrivePolicy" + }, + deliveryPolicy: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/deliveryPolicy", + description: "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + displayName: { + type: "string", + description: "The display name to use with an SNS subscription" + } + }, + required: [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + deliveryPolicy: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + minDelayTarget: { + type: "integer", + description: "The minimum delay for a retry in seconds." + }, + maxDelayTarget: { + type: "integer", + description: "The maximum delay for a retry in seconds." + }, + numRetries: { + type: "integer", + description: "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + numNoDelayRetries: { + type: "integer", + description: "The number of immediate retries (with no delay)." + }, + numMinDelayRetries: { + type: "integer", + description: "The number of immediate retries (with delay)." + }, + numMaxDelayRetries: { + type: "integer", + description: "The number of post-backoff phase retries, with the maximum delay between retries." + }, + backoffFunction: { + type: "string", + description: "The algorithm for backoff between retries.", + enum: [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + maxReceivesPerSecond: { + type: "integer", + description: "The maximum number of deliveries per second, per subscription." + } + } + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sns-0.1.0-operation/definitions/identifier", + description: "The SQS queue to use as a dead letter queue (DLQ)." + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + } + }, + examples: [ + { + topic: { + name: "someTopic" + }, + consumers: [ + { + protocol: "sqs", + endpoint: { + name: "someQueue" + }, + filterPolicy: { + store: [ + "asyncapi_corp" + ], + event: [ + { + "anything-but": "order_cancelled" + } + ], + customer_interests: [ + "rugby", + "football", + "baseball" + ] + }, + filterPolicyScope: "MessageAttributes", + rawMessageDelivery: false, + redrivePolicy: { + deadLetterQueue: { + arn: "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + maxReceiveCount: 25 + }, + deliveryPolicy: { + minDelayTarget: 10, + maxDelayTarget: 100, + numRetries: 5, + numNoDelayRetries: 2, + numMinDelayRetries: 3, + numMaxDelayRetries: 5, + backoffFunction: "linear", + maxReceivesPerSecond: 2 + } + } + ] + } + ] + }, + "bindings-solace-0.4.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + }, + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + timeToLive: { + type: "integer", + description: "Interval in milliseconds or a Schema Object containing the definition of the lifetime of the message." + }, + priority: { + type: "integer", + minimum: 0, + maximum: 255, + description: "The valid priority value range is 0-255 with 0 as the lowest priority and 255 as the highest or a Schema Object containing the definition of the priority." + }, + dmqEligible: { + type: "boolean", + description: "Set the message to be eligible to be moved to a Dead Message Queue. The default value is false." + } + }, + examples: [ + { + bindingVersion: "0.4.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.3.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + }, + maxTtl: { + type: "string", + description: "The maximum TTL to apply to messages to be spooled." + }, + maxMsgSpoolUsage: { + type: "string", + description: "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.3.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-solace-0.2.0-operation": { + title: "Solace operation bindings object", + description: "This object contains information about the operation representation in Solace.", + type: "object", + additionalProperties: false, + properties: { + destinations: { + description: "The list of Solace destinations referenced in the operation.", + type: "array", + items: { + type: "object", + properties: { + deliveryMode: { + type: "string", + enum: [ + "direct", + "persistent" + ] + } + }, + oneOf: [ + { + properties: { + destinationType: { + type: "string", + const: "queue", + description: "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + queue: { + type: "object", + properties: { + name: { + type: "string", + description: "The name of the queue" + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the queue subscribes to.", + items: { + type: "string" + } + }, + accessType: { + type: "string", + enum: [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + properties: { + destinationType: { + type: "string", + const: "topic", + description: "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + topicSubscriptions: { + type: "array", + description: "The list of topics that the client subscribes to.", + items: { + type: "string" + } + } + } + } + ] + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: 'The version of this binding. If omitted, "latest" MUST be assumed.' + } + }, + examples: [ + { + bindingVersion: "0.2.0", + destinations: [ + { + destinationType: "queue", + queue: { + name: "sampleQueue", + topicSubscriptions: [ + "samples/*" + ], + accessType: "nonexclusive" + } + }, + { + destinationType: "topic", + topicSubscriptions: [ + "samples/*" + ] + } + ] + } + ] + }, + "bindings-sqs-0.2.0-operation": { + title: "Operation Schema", + description: "This object contains information about the operation representation in SQS.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + queues: { + type: "array", + description: "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/queue" + } + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0", + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + default: "latest" + } + }, + required: [ + "queues" + ], + definitions: { + queue: { + type: "object", + description: "A definition of a queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + type: "string", + description: "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + name: { + type: "string", + description: "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + fifoQueue: { + type: "boolean", + description: "Is this a FIFO queue?", + default: false + }, + deduplicationScope: { + type: "string", + enum: [ + "queue", + "messageGroup" + ], + description: "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + default: "queue" + }, + fifoThroughputLimit: { + type: "string", + enum: [ + "perQueue", + "perMessageGroupId" + ], + description: "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + default: "perQueue" + }, + deliveryDelay: { + type: "integer", + description: "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + minimum: 0, + maximum: 900, + default: 0 + }, + visibilityTimeout: { + type: "integer", + description: "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + minimum: 0, + maximum: 43200, + default: 30 + }, + receiveMessageWaitTime: { + type: "integer", + description: "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + default: 0 + }, + messageRetentionPeriod: { + type: "integer", + description: "How long to retain a message on the queue in seconds, unless deleted.", + minimum: 60, + maximum: 1209600, + default: 345600 + }, + redrivePolicy: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/redrivePolicy" + }, + policy: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/policy" + }, + tags: { + type: "object", + description: "Key-value pairs that represent AWS tags on the queue." + } + }, + required: [ + "name" + ] + }, + redrivePolicy: { + type: "object", + description: "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + deadLetterQueue: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/identifier" + }, + maxReceiveCount: { + type: "integer", + description: "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + default: 10 + } + }, + required: [ + "deadLetterQueue" + ] + }, + identifier: { + type: "object", + description: "The SQS queue to use as a dead letter queue (DLQ).", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + arn: { + type: "string", + description: "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + name: { + type: "string", + description: "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + policy: { + type: "object", + description: "The security policy for the SQS Queue", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + statements: { + type: "array", + description: "An array of statement objects, each of which controls a permission for this queue.", + items: { + $ref: "#/definitions/bindings-sqs-0.2.0-operation/definitions/statement" + } + } + }, + required: [ + "statements" + ] + }, + statement: { + type: "object", + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + effect: { + type: "string", + enum: [ + "Allow", + "Deny" + ] + }, + principal: { + description: "The AWS account or resource ARN that this statement applies to.", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + }, + action: { + description: "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + type: "string" + } + } + ] + } + }, + required: [ + "effect", + "principal", + "action" + ] + } + }, + examples: [ + { + queues: [ + { + name: "myQueue", + fifoQueue: true, + deduplicationScope: "messageGroup", + fifoThroughputLimit: "perMessageGroupId", + deliveryDelay: 10, + redrivePolicy: { + deadLetterQueue: { + name: "myQueue_error" + }, + maxReceiveCount: 15 + }, + policy: { + statements: [ + { + effect: "Deny", + principal: "arn:aws:iam::123456789012:user/dec.kolakowski", + action: [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + name: "myQueue_error", + deliveryDelay: 10 + } + ] + } + ] + }, + operationTrait: { + description: "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", + type: "object", + properties: { + title: { + description: "A human-friendly title for the operation.", + $ref: "#/definitions/operation/properties/title" + }, + description: { + description: "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", + $ref: "#/definitions/operation/properties/description" + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + }, + externalDocs: { + description: "Additional external documentation for this operation.", + $ref: "#/definitions/operation/properties/externalDocs" + }, + security: { + description: "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", + $ref: "#/definitions/operation/properties/security" + }, + summary: { + description: "A short summary of what the operation is about.", + $ref: "#/definitions/operation/properties/summary" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + $ref: "#/definitions/operation/properties/tags" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + operation: { + description: "Describes a specific operation.", + type: "object", + required: [ + "action", + "channel" + ], + properties: { + title: { + description: "A human-friendly title for the operation.", + type: "string" + }, + description: { + description: "A longer description of the operation. CommonMark is allowed.", + type: "string" + }, + action: { + description: "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + type: "string", + enum: [ + "send", + "receive" + ] + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationBindingsObject" + } + ] + }, + channel: { + $ref: "#/definitions/Reference" + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + messages: { + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + type: "array", + items: { + $ref: "#/definitions/Reference" + } + }, + reply: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReply" + } + ] + }, + security: { + $ref: "#/definitions/securityRequirements" + }, + summary: { + description: "A brief summary of the operation.", + type: "string" + }, + tags: { + description: "A list of tags for logical grouping and categorization of operations.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + }, + traits: { + description: "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + security: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ], + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ], + messages: [ + { + $ref: "/components/messages/userSignedUp" + } + ], + reply: { + address: { + location: "$message.header#/replyTo" + }, + channel: { + $ref: "#/channels/userSignupReply" + }, + messages: [ + { + $ref: "/components/messages/userSignedUpReply" + } + ] + } + } + ] + }, + securityRequirements: { + description: "An array representing security requirements.", + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + }, + SecurityScheme: { + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "userPassword" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme", + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + description: " The location of the API key.", + type: "string", + enum: [ + "user", + "password" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "X509" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "asymmetricEncryption" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + type: "object", + not: { + type: "object", + properties: { + scheme: { + description: "A short description for security scheme.", + type: "string", + enum: [ + "bearer" + ] + } + } + }, + required: [ + "scheme", + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "http" + ] + }, + scheme: { + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "http" + ] + }, + bearerFormat: { + description: "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.", + type: "string" + }, + scheme: { + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + type: "string", + enum: [ + "bearer" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "httpApiKey" + ] + }, + in: { + description: "The location of the API key", + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + name: { + description: "The name of the header, query or cookie parameter to be used.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + oauth2Flows: { + description: "Allows configuration of the supported OAuth Flows.", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "oauth2" + ] + }, + flows: { + type: "object", + properties: { + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "availableScopes" + ] + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "availableScopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + } + }, + additionalProperties: false + }, + scopes: { + description: "List of the needed scope names.", + type: "array", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + description: "Configuration details for a supported OAuth Flow", + type: "object", + properties: { + authorizationUrl: { + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + availableScopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "#/definitions/oauth2Scopes" + }, + refreshUrl: { + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + tokenUrl: { + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + availableScopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + description: { + description: "A short description for security scheme. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "openIdConnect" + ] + }, + openIdConnectUrl: { + description: "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL.", + type: "string", + format: "uri" + }, + scopes: { + description: "List of the needed scope names. An empty array means no scopes are needed.", + type: "array", + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme. Valid values", + type: "string", + enum: [ + "plain" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + description: { + description: "A short description for security scheme.", + type: "string" + }, + type: { + description: "The type of the security scheme.", + type: "string", + enum: [ + "gssapi" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + operationReply: { + description: "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", + type: "object", + properties: { + address: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationReplyAddress" + } + ] + }, + channel: { + $ref: "#/definitions/Reference" + }, + messages: { + description: "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", + type: "array", + items: { + $ref: "#/definitions/Reference" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + operationReplyAddress: { + description: "An object that specifies where an operation has to send the reply", + type: "object", + required: [ + "location" + ], + properties: { + description: { + description: "An optional description of the address. CommonMark is allowed.", + type: "string" + }, + location: { + description: "A runtime expression that specifies the location of the reply address.", + type: "string", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + description: "Consumer inbox", + location: "$message.header#/replyTo" + } + ] + }, + serverBindingsObject: { + description: "Map describing protocol-specific definitions for a server.", + type: "object", + properties: { + amqp: {}, + amqp1: {}, + anypointmq: {}, + googlepubsub: {}, + http: {}, + ibmmq: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ibmmq-0.1.0-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + jms: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.0.1" + } + } + }, + then: { + $ref: "#/definitions/bindings-jms-0.0.1-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.0.1" + ] + } + } + }, + kafka: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.5.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.5.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-kafka-0.3.0-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.5.0", + "0.4.0", + "0.3.0" + ] + } + } + }, + mqtt: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-mqtt-0.2.0-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.2.0" + ] + } + } + }, + nats: {}, + pulsar: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-pulsar-0.1.0-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + } + }, + redis: {}, + ros2: { + properties: { + bindingVersion: { + enum: [ + "0.1.0" + ] + } + }, + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-ros2-0.1.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.1.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-ros2-0.1.0-server" + } + } + ] + }, + sns: {}, + solace: { + allOf: [ + { + description: "If no bindingVersion specified, use the latest binding", + if: { + not: { + required: [ + "bindingVersion" + ] + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.4.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.4.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.3.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.3.0-server" + } + }, + { + if: { + required: [ + "bindingVersion" + ], + properties: { + bindingVersion: { + const: "0.2.0" + } + } + }, + then: { + $ref: "#/definitions/bindings-solace-0.2.0-server" + } + } + ], + properties: { + bindingVersion: { + enum: [ + "0.4.0", + "0.3.0", + "0.2.0" + ] + } + } + }, + sqs: {}, + stomp: {}, + ws: {} + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + "bindings-ibmmq-0.1.0-server": { + title: "IBM MQ server bindings object", + description: "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + groupId: { + type: "string", + description: "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + ccdtQueueManagerName: { + type: "string", + default: "*", + description: "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + cipherSpec: { + type: "string", + description: "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + multiEndpointServer: { + type: "boolean", + default: false, + description: "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + heartBeatInterval: { + type: "integer", + minimum: 0, + maximum: 999999, + default: 300, + description: "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + groupId: "PRODCLSTR1", + cipherSpec: "ANY_TLS12_OR_HIGHER", + bindingVersion: "0.1.0" + }, + { + groupId: "PRODCLSTR1", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-jms-0.0.1-server": { + title: "Server Schema", + description: "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + required: [ + "jmsConnectionFactory" + ], + properties: { + jmsConnectionFactory: { + type: "string", + description: "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + properties: { + type: "array", + items: { + $ref: "#/definitions/bindings-jms-0.0.1-server/definitions/property" + }, + description: "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + clientID: { + type: "string", + description: "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + bindingVersion: { + type: "string", + enum: [ + "0.0.1" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + definitions: { + property: { + type: "object", + required: [ + "name", + "value" + ], + properties: { + name: { + type: "string", + description: "The name of a property" + }, + value: { + type: [ + "string", + "boolean", + "number", + "null" + ], + description: "The name of a property" + } + } + } + }, + examples: [ + { + jmsConnectionFactory: "org.apache.activemq.ActiveMQConnectionFactory", + properties: [ + { + name: "disableTimeStampsByDefault", + value: false + } + ], + clientID: "my-application-1", + bindingVersion: "0.0.1" + } + ] + }, + "bindings-kafka-0.5.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.5.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.5.0" + } + ] + }, + "bindings-kafka-0.4.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.4.0" + } + ] + }, + "bindings-kafka-0.3.0-server": { + title: "Server Schema", + description: "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaRegistryUrl: { + type: "string", + description: "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + schemaRegistryVendor: { + type: "string", + description: "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + schemaRegistryUrl: "https://my-schema-registry.com", + schemaRegistryVendor: "confluent", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-mqtt-0.2.0-server": { + title: "Server Schema", + description: "This object contains information about the server representation in MQTT.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + clientId: { + type: "string", + description: "The client identifier." + }, + cleanSession: { + type: "boolean", + description: "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." + }, + lastWill: { + type: "object", + description: "Last Will and Testament configuration.", + properties: { + topic: { + type: "string", + description: "The topic where the Last Will and Testament message will be sent." + }, + qos: { + type: "integer", + enum: [ + 0, + 1, + 2 + ], + description: "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + message: { + type: "string", + description: "Last Will message." + }, + retain: { + type: "boolean", + description: "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + keepAlive: { + type: "integer", + description: "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + sessionExpiryInterval: { + oneOf: [ + { + type: "integer", + minimum: 0 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + maximumPacketSize: { + oneOf: [ + { + type: "integer", + minimum: 1, + maximum: 4294967295 + }, + { + $ref: "#/definitions/schema" + }, + { + $ref: "#/definitions/Reference" + } + ], + description: "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + clientId: "guest", + cleanSession: true, + lastWill: { + topic: "/last-wills", + qos: 2, + message: "Guest gone offline.", + retain: false + }, + keepAlive: 60, + sessionExpiryInterval: 120, + maximumPacketSize: 1024, + bindingVersion: "0.2.0" + } + ] + }, + "bindings-pulsar-0.1.0-server": { + title: "Server Schema", + description: "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + tenant: { + type: "string", + description: "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + bindingVersion: { + type: "string", + enum: [ + "0.1.0" + ], + description: "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + examples: [ + { + tenant: "contoso", + bindingVersion: "0.1.0" + } + ] + }, + "bindings-ros2-0.1.0-server": { + description: "This object contains information about the server representation in ROS 2.", + examples: [ + { + domainId: "0", + rmwImplementation: "rmw_fastrtps_cpp" + } + ], + type: "object", + properties: { + bindingVersion: { + description: "The version of this binding. If omitted, 'latest' MUST be assumed.", + type: "string", + enum: [ + "0.1.0" + ] + }, + domainId: { + description: "All ROS 2 nodes use domain ID 0 by default. To prevent interference between different groups of computers running ROS 2 on the same network, a group can be set with a unique domain ID.", + type: "integer", + maximum: 231, + minimum: 0 + }, + rmwImplementation: { + description: "Specifies the ROS 2 middleware implementation to be used. This determines the underlying middleware implementation that handles communication.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + "bindings-solace-0.4.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + clientName: { + type: "string", + minLength: 1, + maxLength: 160, + description: "A unique client name to use to register to the appliance. If specified, it must be a valid Topic name, and a maximum of 160 bytes in length when encoded as UTF-8." + }, + bindingVersion: { + type: "string", + enum: [ + "0.4.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.4.0" + } + ] + }, + "bindings-solace-0.3.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msgVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.3.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.3.0" + } + ] + }, + "bindings-solace-0.2.0-server": { + title: "Solace server bindings object", + description: "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + msvVpn: { + type: "string", + description: "The name of the Virtual Private Network to connect to on the Solace broker." + }, + bindingVersion: { + type: "string", + enum: [ + "0.2.0" + ], + description: "The version of this binding." + } + }, + examples: [ + { + msgVpn: "ProdVPN", + bindingVersion: "0.2.0" + } + ] + }, + serverVariable: { + description: "An object representing a Server Variable for server URL template substitution.", + type: "object", + properties: { + description: { + description: "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + examples: { + description: "An array of examples of the server variable.", + type: "array", + items: { + type: "string" + } + }, + default: { + description: "The default value to use for substitution, and to send, if an alternate value is not supplied.", + type: "string" + }, + enum: { + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + type: "array", + uniqueItems: true, + items: { + type: "string" + } + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/{env}", + protocol: "amqp", + description: "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + variables: { + env: { + description: "Environment to connect to. It can be either `production` or `staging`.", + enum: [ + "production", + "staging" + ] + } + } + } + ] + }, + server: { + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + type: "object", + required: [ + "host", + "protocol" + ], + properties: { + title: { + description: "A human-friendly title for the server.", + type: "string" + }, + description: { + description: "A longer description of the server. CommonMark is allowed.", + type: "string" + }, + bindings: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverBindingsObject" + } + ] + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + host: { + description: "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + type: "string" + }, + pathname: { + description: "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}.", + type: "string" + }, + protocol: { + description: "The protocol this server supports for connection.", + type: "string" + }, + protocolVersion: { + description: "An optional string describing the server. CommonMark syntax MAY be used for rich text representation.", + type: "string" + }, + security: { + $ref: "#/definitions/securityRequirements" + }, + summary: { + description: "A brief summary of the server.", + type: "string" + }, + tags: { + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + }, + variables: { + $ref: "#/definitions/serverVariables" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + host: "kafka.in.mycompany.com:9092", + description: "Production Kafka broker.", + protocol: "kafka", + protocolVersion: "3.2" + }, + { + host: "rabbitmq.in.mycompany.com:5672", + pathname: "/production", + protocol: "amqp", + description: "Production RabbitMQ broker (uses the `production` vhost)." + } + ] + }, + serverVariables: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + info: { + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + allOf: [ + { + type: "object", + required: [ + "version", + "title" + ], + properties: { + title: { + description: "A unique and precise title of the API.", + type: "string" + }, + description: { + description: "A longer description of the API. Should be different from the title. CommonMark is allowed.", + type: "string" + }, + contact: { + $ref: "#/definitions/contact" + }, + externalDocs: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/externalDocs" + } + ] + }, + license: { + $ref: "#/definitions/license" + }, + tags: { + description: "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", + type: "array", + uniqueItems: true, + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/tag" + } + ] + } + }, + termsOfService: { + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + type: "string", + format: "uri" + }, + version: { + description: "A semantic version number of the API.", + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + { + $ref: "#/definitions/infoExtensions" + } + ], + examples: [ + { + title: "AsyncAPI Sample App", + version: "1.0.1", + description: "This is a sample app.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.asyncapi.org/support", + email: "support@asyncapi.org" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + externalDocs: { + description: "Find more info here", + url: "https://www.asyncapi.org" + }, + tags: [ + { + name: "e-commerce" + } + ] + } + ] + }, + contact: { + description: "Contact information for the exposed API.", + type: "object", + properties: { + email: { + description: "The email address of the contact person/organization.", + type: "string", + format: "email" + }, + name: { + description: "The identifying name of the contact person/organization.", + type: "string" + }, + url: { + description: "The URL pointing to the contact information.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + license: { + type: "object", + required: [ + "name" + ], + properties: { + name: { + description: "The name of the license type. It's encouraged to use an OSI compatible license.", + type: "string" + }, + url: { + description: "The URL pointing to the license.", + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + infoExtensions: { + description: "The object that lists all the extensions of Info", + type: "object", + properties: { + "x-linkedin": { + $ref: "#/definitions/extensions-linkedin-0.1.0-schema" + }, + "x-x": { + $ref: "#/definitions/extensions-x-0.1.0-schema" + } + } + }, + "extensions-linkedin-0.1.0-schema": { + type: "string", + pattern: "^http(s)?://(www\\.)?linkedin\\.com.*$", + description: "This extension allows you to provide the Linkedin profile URL of the account representing the team/company of the API.", + example: [ + "https://www.linkedin.com/company/asyncapi/", + "https://www.linkedin.com/in/sambhavgupta0705/" + ] + }, + "extensions-x-0.1.0-schema": { + type: "string", + description: "This extension allows you to provide the Twitter username of the account representing the team/company of the API.", + example: [ + "sambhavgupta75", + "AsyncAPISpec" + ] + }, + operations: { + description: "Holds a dictionary with all the operations this application MUST implement.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operation" + } + ] + }, + examples: [ + { + onUserSignUp: { + title: "User sign up", + summary: "Action to sign a user up.", + description: "A longer description", + channel: { + $ref: "#/channels/userSignup" + }, + action: "send", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + bindings: { + amqp: { + ack: false + } + }, + traits: [ + { + $ref: "#/components/operationTraits/kafka" + } + ] + } + } + ] + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + }, + examples: [ + { + development: { + host: "localhost:5672", + description: "Development AMQP broker.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests." + } + ] + }, + staging: { + host: "rabbitmq-staging.in.mycompany.com:5672", + description: "RabbitMQ broker for the staging environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment." + } + ] + }, + production: { + host: "rabbitmq.in.mycompany.com:5672", + description: "RabbitMQ broker for the production environment.", + protocol: "amqp", + protocolVersion: "0-9-1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users." + } + ] + } + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/@asyncapi/specs/index.js +var require_specs = __commonJS({ + "node_modules/@asyncapi/specs/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + schemas: { + "2.0.0": require__2(), + "2.1.0": require__3(), + "2.2.0": require__4(), + "2.3.0": require__5(), + "2.4.0": require__6(), + "2.5.0": require__7(), + "2.6.0": require__8(), + "3.0.0": require__9(), + "3.1.0": require__10() + }, + schemasWithoutId: { + "2.0.0": require_without_id(), + "2.1.0": require_without_id2(), + "2.2.0": require_without_id3(), + "2.3.0": require_without_id4(), + "2.4.0": require_without_id5(), + "2.5.0": require_without_id6(), + "2.6.0": require_without_id7(), + "3.0.0": require_without_id8(), + "3.1.0": require_without_id9() + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/constants.js +var import_specs, xParserSpecParsed, xParserSpecStringified, xParserApiVersion, xParserMessageName, xParserMessageParsed, xParserSchemaId, xParserOriginalSchemaFormat, xParserOriginalPayload, xParserOriginalTraits, xParserCircular, xParserCircularProps, xParserObjectUniqueId, EXTENSION_REGEX, specVersions, lastVersion; +var init_constants = __esm({ + "node_modules/@asyncapi/parser/esm/constants.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_specs = __toESM(require_specs()); + xParserSpecParsed = "x-parser-spec-parsed"; + xParserSpecStringified = "x-parser-spec-stringified"; + xParserApiVersion = "x-parser-api-version"; + xParserMessageName = "x-parser-message-name"; + xParserMessageParsed = "x-parser-message-parsed"; + xParserSchemaId = "x-parser-schema-id"; + xParserOriginalSchemaFormat = "x-parser-original-schema-format"; + xParserOriginalPayload = "x-parser-original-payload"; + xParserOriginalTraits = "x-parser-original-traits"; + xParserCircular = "x-parser-circular"; + xParserCircularProps = "x-parser-circular-props"; + xParserObjectUniqueId = "x-parser-unique-object-id"; + EXTENSION_REGEX = /^x-[\w\d.\-_]+$/; + specVersions = Object.keys(import_specs.default.schemas); + lastVersion = specVersions[specVersions.length - 1]; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/bindings.js +var Bindings; +var init_bindings = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/bindings.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + init_extensions(); + init_extension(); + init_utils(); + init_constants(); + Bindings = class extends Collection2 { + get(name2) { + return this.collections.find((binding3) => binding3.protocol() === name2); + } + extensions() { + const extensions6 = []; + Object.entries(this._meta.originalData || {}).forEach(([id, value2]) => { + if (EXTENSION_REGEX.test(id)) { + extensions6.push(createModel(Extension, value2, { id, pointer: `${this._meta.pointer}/${id}`, asyncapi: this._meta.asyncapi })); + } + }); + return new Extensions(extensions6); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/binding.js +var Binding; +var init_binding = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/binding.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + Binding = class extends BaseModel { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const value2 = Object.assign({}, this._json); + delete value2.bindingVersion; + return value2; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/external-docs.js +var ExternalDocumentation; +var init_external_docs = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/external-docs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + ExternalDocumentation = class extends BaseModel { + url() { + return this._json.url; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/tags.js +var Tags; +var init_tags2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/tags.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Tags = class extends Collection2 { + get(name2) { + return this.collections.find((tag) => tag.name() === name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/tag.js +var Tag; +var init_tag = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/tag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + Tag = class extends BaseModel { + name() { + return this._json.name; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + extensions() { + return extensions(this); + } + hasExternalDocs() { + return hasExternalDocs(this); + } + externalDocs() { + return externalDocs(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/mixins.js +function bindings(model) { + const bindings6 = model.json("bindings") || {}; + return new Bindings(Object.entries(bindings6 || {}).map(([protocol, binding3]) => createModel(Binding, binding3, { protocol, pointer: model.jsonPath(`bindings/${protocol}`) }, model)), { originalData: bindings6, asyncapi: model.meta("asyncapi"), pointer: model.jsonPath("bindings") }); +} +function hasDescription(model) { + return Boolean(description(model)); +} +function description(model) { + return model.json("description"); +} +function extensions(model) { + const extensions6 = []; + Object.entries(model.json()).forEach(([id, value2]) => { + if (EXTENSION_REGEX.test(id)) { + extensions6.push(createModel(Extension, value2, { id, pointer: model.jsonPath(id) }, model)); + } + }); + return new Extensions(extensions6); +} +function hasExternalDocs(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs(model) { + if (hasExternalDocs(model)) { + return new ExternalDocumentation(model.json("externalDocs")); + } +} +function tags(model) { + return new Tags((model.json("tags") || []).map((tag, idx) => createModel(Tag, tag, { pointer: model.jsonPath(`tags/${idx}`) }, model))); +} +var init_mixins = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/mixins.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_bindings(); + init_binding(); + init_extensions(); + init_extension(); + init_external_docs(); + init_tags2(); + init_tag(); + init_utils(); + init_constants(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/contact.js +var Contact; +var init_contact = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/contact.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + Contact = class extends BaseModel { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/license.js +var License; +var init_license = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/license.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + License = class extends BaseModel { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/info.js +var Info; +var init_info = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/info.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_contact(); + init_external_docs(); + init_license(); + init_tags2(); + init_tag(); + init_mixins(); + Info = class extends BaseModel { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const contact = this._json.contact; + return contact && this.createModel(Contact, contact, { pointer: "/info/contact" }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const license = this._json.license; + return license && this.createModel(License, license, { pointer: "/info/license" }); + } + hasExternalDocs() { + const asyncapiV2 = this._meta.asyncapi.parsed; + return Object.keys(asyncapiV2.externalDocs || {}).length > 0; + } + externalDocs() { + if (this.hasExternalDocs()) { + const asyncapiV2 = this._meta.asyncapi.parsed; + return this.createModel(ExternalDocumentation, asyncapiV2.externalDocs, { pointer: "/externalDocs" }); + } + } + tags() { + const asyncapiV2 = this._meta.asyncapi.parsed; + const tags6 = asyncapiV2.tags || []; + return new Tags(tags6.map((tag, idx) => this.createModel(Tag, tag, { pointer: `/tags/${idx}` }))); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/channels.js +var Channels; +var init_channels = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/channels.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Channels = class extends Collection2 { + get(id) { + return this.collections.find((channel) => channel.id() === id); + } + filterBySend() { + return this.filterBy((channel) => channel.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((channel) => channel.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/channel-parameters.js +var ChannelParameters; +var init_channel_parameters = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/channel-parameters.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + ChannelParameters = class extends Collection2 { + get(id) { + return this.collections.find((parameter) => parameter.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/schema-parser/index.js +function validateSchema(parser3, input) { + return __awaiter(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + const { path: path2, schemaFormat } = input; + path2.pop(); + return [ + { + message: `Unknown schema format: "${schemaFormat}"`, + path: [...path2, "schemaFormat"] + }, + { + message: `Cannot validate and parse given schema due to unknown schema format: "${schemaFormat}"`, + path: [...path2, "payload"] + } + ]; + } + return schemaParser.validate(input); + }); +} +function parseSchema(parser3, input) { + return __awaiter(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + throw new Error("Unknown schema format"); + } + return schemaParser.parse(input); + }); +} +function registerSchemaParser(parser3, schemaParser) { + if (typeof schemaParser !== "object" || typeof schemaParser.validate !== "function" || typeof schemaParser.parse !== "function" || typeof schemaParser.getMimeTypes !== "function") { + throw new Error('Custom parser must have "parse()", "validate()" and "getMimeTypes()" functions.'); + } + schemaParser.getMimeTypes().forEach((schemaFormat) => { + parser3.parserRegistry.set(schemaFormat, schemaParser); + }); +} +function getSchemaFormat(schematFormat, asyncapiVersion) { + if (typeof schematFormat === "string") { + return schematFormat; + } + return getDefaultSchemaFormat(asyncapiVersion); +} +function getDefaultSchemaFormat(asyncapiVersion) { + return `application/vnd.aai.asyncapi;version=${asyncapiVersion}`; +} +var __awaiter; +var init_schema_parser = __esm({ + "node_modules/@asyncapi/parser/esm/schema-parser/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + __awaiter = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/schema.js +var Schema2; +var init_schema4 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_constants(); + init_mixins(); + init_schema_parser(); + Schema2 = class _Schema extends BaseModel { + id() { + return this.$id() || this._meta.id || this.json(xParserSchemaId); + } + $comment() { + if (typeof this._json === "boolean") + return; + return this._json.$comment; + } + $id() { + if (typeof this._json === "boolean") + return; + return this._json.$id; + } + $schema() { + if (typeof this._json === "boolean") + return "http://json-schema.org/draft-07/schema#"; + return this._json.$schema || "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalItems === "boolean") + return this._json.additionalItems; + if (this._json.additionalItems === void 0) + return true; + if (this._json.additionalItems === null) + return false; + return this.createModel(_Schema, this._json.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalProperties === "boolean") + return this._json.additionalProperties; + if (this._json.additionalProperties === void 0) + return true; + if (this._json.additionalProperties === null) + return false; + return this.createModel(_Schema, this._json.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.allOf)) + return void 0; + return this._json.allOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/allOf/${index4}`, parent: this })); + } + anyOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.anyOf)) + return void 0; + return this._json.anyOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/anyOf/${index4}`, parent: this })); + } + const() { + if (typeof this._json === "boolean") + return; + return this._json.const; + } + contains() { + if (typeof this._json === "boolean" || typeof this._json.contains !== "object") + return; + return this.createModel(_Schema, this._json.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if (typeof this._json === "boolean") + return; + return this._json.contentEncoding; + } + contentMediaType() { + if (typeof this._json === "boolean") + return; + return this._json.contentMediaType; + } + default() { + if (typeof this._json === "boolean") + return; + return this._json.default; + } + definitions() { + if (typeof this._json === "boolean" || typeof this._json.definitions !== "object") + return; + return Object.entries(this._json.definitions).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/definitions/${key}`, parent: this }); + return acc; + }, {}); + } + description() { + if (typeof this._json === "boolean") + return; + return this._json.description; + } + dependencies() { + if (typeof this._json === "boolean") + return; + if (typeof this._json.dependencies !== "object") + return void 0; + return Object.entries(this._json.dependencies).reduce((acc, [key, s7]) => { + acc[key] = Array.isArray(s7) ? s7 : this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/dependencies/${key}`, parent: this }); + return acc; + }, {}); + } + deprecated() { + if (typeof this._json === "boolean") + return false; + return this._json.deprecated || false; + } + discriminator() { + if (typeof this._json === "boolean") + return; + return this._json.discriminator; + } + else() { + if (typeof this._json === "boolean" || typeof this._json.else !== "object") + return; + return this.createModel(_Schema, this._json.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if (typeof this._json === "boolean") + return; + return this._json.enum; + } + examples() { + if (typeof this._json === "boolean") + return; + return this._json.examples; + } + exclusiveMaximum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMaximum; + } + exclusiveMinimum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMinimum; + } + format() { + if (typeof this._json === "boolean") + return; + return this._json.format; + } + isBooleanSchema() { + return typeof this._json === "boolean"; + } + if() { + if (typeof this._json === "boolean" || typeof this._json.if !== "object") + return; + return this.createModel(_Schema, this._json.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._json) + return true; + parent2 = parent2._meta.parent; + } + return false; + } + items() { + if (typeof this._json === "boolean" || typeof this._json.items !== "object") + return; + if (Array.isArray(this._json.items)) { + return this._json.items.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/items/${index4}`, parent: this })); + } + return this.createModel(_Schema, this._json.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if (typeof this._json === "boolean") + return; + return this._json.maximum; + } + maxItems() { + if (typeof this._json === "boolean") + return; + return this._json.maxItems; + } + maxLength() { + if (typeof this._json === "boolean") + return; + return this._json.maxLength; + } + maxProperties() { + if (typeof this._json === "boolean") + return; + return this._json.maxProperties; + } + minimum() { + if (typeof this._json === "boolean") + return; + return this._json.minimum; + } + minItems() { + if (typeof this._json === "boolean") + return; + return this._json.minItems; + } + minLength() { + if (typeof this._json === "boolean") + return; + return this._json.minLength; + } + minProperties() { + if (typeof this._json === "boolean") + return; + return this._json.minProperties; + } + multipleOf() { + if (typeof this._json === "boolean") + return; + return this._json.multipleOf; + } + not() { + if (typeof this._json === "boolean" || typeof this._json.not !== "object") + return; + return this.createModel(_Schema, this._json.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.oneOf)) + return void 0; + return this._json.oneOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/oneOf/${index4}`, parent: this })); + } + pattern() { + if (typeof this._json === "boolean") + return; + return this._json.pattern; + } + patternProperties() { + if (typeof this._json === "boolean" || typeof this._json.patternProperties !== "object") + return; + return Object.entries(this._json.patternProperties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/patternProperties/${key}`, parent: this }); + return acc; + }, {}); + } + properties() { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object") + return; + return Object.entries(this._json.properties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/properties/${key}`, parent: this }); + return acc; + }, {}); + } + property(name2) { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object" || typeof this._json.properties[name2] !== "object") + return; + return this.createModel(_Schema, this._json.properties[name2], { pointer: `${this._meta.pointer}/properties/${name2}`, parent: this }); + } + propertyNames() { + if (typeof this._json === "boolean" || typeof this._json.propertyNames !== "object") + return; + return this.createModel(_Schema, this._json.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.readOnly || false; + } + required() { + if (typeof this._json === "boolean") + return; + return this._json.required; + } + schemaFormat() { + return this._meta.schemaFormat || getDefaultSchemaFormat(this._meta.asyncapi.semver.version); + } + then() { + if (typeof this._json === "boolean" || typeof this._json.then !== "object") + return; + return this.createModel(_Schema, this._json.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if (typeof this._json === "boolean") + return; + return this._json.title; + } + type() { + if (typeof this._json === "boolean") + return; + return this._json.type; + } + uniqueItems() { + if (typeof this._json === "boolean") + return false; + return this._json.uniqueItems || false; + } + writeOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.writeOnly || false; + } + hasExternalDocs() { + return hasExternalDocs(this); + } + externalDocs() { + return externalDocs(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/channel-parameter.js +var ChannelParameter; +var init_channel_parameter = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/channel-parameter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_schema4(); + init_mixins(); + ChannelParameter = class extends BaseModel { + id() { + return this._meta.id; + } + hasSchema() { + return !!this._json.schema; + } + schema() { + if (!this._json.schema) + return void 0; + return this.createModel(Schema2, this._json.schema, { pointer: `${this._meta.pointer}/schema` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/messages.js +var Messages; +var init_messages = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/messages.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Messages = class extends Collection2 { + get(name2) { + return this.collections.find((message) => message.id() === name2); + } + filterBySend() { + return this.filterBy((message) => message.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((message) => message.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/operations.js +var Operations; +var init_operations = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/operations.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Operations = class extends Collection2 { + get(id) { + return this.collections.find((operation) => operation.id() === id); + } + filterBySend() { + return this.filterBy((operation) => operation.isSend()); + } + filterByReceive() { + return this.filterBy((operation) => operation.isReceive()); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/message-traits.js +var MessageTraits; +var init_message_traits = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/message-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + MessageTraits = class extends Collection2 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/correlation-id.js +var CorrelationId; +var init_correlation_id = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/correlation-id.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + CorrelationId = class extends BaseModel { + location() { + return this._json.location; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/message-examples.js +var MessageExamples; +var init_message_examples = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/message-examples.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + MessageExamples = class extends Collection2 { + get(name2) { + return this.collections.find((example) => example.name() === name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/message-example.js +var MessageExample; +var init_message_example = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/message-example.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + MessageExample = class extends BaseModel { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/message-trait.js +var MessageTrait; +var init_message_trait = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/message-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_correlation_id(); + init_message_examples(); + init_message_example(); + init_schema4(); + init_constants(); + init_mixins(); + init_schema_parser(); + MessageTrait = class extends BaseModel { + id() { + return this._json.messageId || this._meta.id || this.json(xParserMessageName); + } + hasSchemaFormat() { + return this.schemaFormat() !== void 0; + } + schemaFormat() { + return this._json.schemaFormat || getDefaultSchemaFormat(this._meta.asyncapi.semver.version); + } + hasMessageId() { + return !!this._json.messageId; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (!this._json.correlationId) + return void 0; + return this.createModel(CorrelationId, this._json.correlationId, { pointer: `${this._meta.pointer}/correlationId` }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var _a2; + return this._json.contentType || ((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (!this._json.headers) + return void 0; + return this.createModel(Schema2, this._json.headers, { pointer: `${this._meta.pointer}/headers` }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + hasExternalDocs() { + return hasExternalDocs(this); + } + externalDocs() { + return externalDocs(this); + } + examples() { + return new MessageExamples((this._json.examples || []).map((example, index4) => { + return this.createModel(MessageExample, example, { pointer: `${this._meta.pointer}/examples/${index4}` }); + })); + } + tags() { + return tags(this); + } + bindings() { + return bindings(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/servers.js +var Servers; +var init_servers = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/servers.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Servers = class extends Collection2 { + get(id) { + return this.collections.find((server) => server.id() === id); + } + filterBySend() { + return this.filterBy((server) => server.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((server) => server.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@stoplight/spectral-core/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports = {}; +__export(tslib_es6_exports, { + __addDisposableResource: () => __addDisposableResource, + __assign: () => __assign, + __asyncDelegator: () => __asyncDelegator, + __asyncGenerator: () => __asyncGenerator, + __asyncValues: () => __asyncValues, + __await: () => __await, + __awaiter: () => __awaiter2, + __classPrivateFieldGet: () => __classPrivateFieldGet, + __classPrivateFieldIn: () => __classPrivateFieldIn, + __classPrivateFieldSet: () => __classPrivateFieldSet, + __createBinding: () => __createBinding, + __decorate: () => __decorate, + __disposeResources: () => __disposeResources, + __esDecorate: () => __esDecorate, + __exportStar: () => __exportStar, + __extends: () => __extends, + __generator: () => __generator, + __importDefault: () => __importDefault, + __importStar: () => __importStar, + __makeTemplateObject: () => __makeTemplateObject, + __metadata: () => __metadata, + __param: () => __param, + __propKey: () => __propKey, + __read: () => __read, + __rest: () => __rest, + __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, + __runInitializers: () => __runInitializers, + __setFunctionName: () => __setFunctionName, + __spread: () => __spread, + __spreadArray: () => __spreadArray, + __spreadArrays: () => __spreadArrays, + __values: () => __values, + default: () => tslib_es6_default +}); +function __extends(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter2(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g7.next = verb(0), g7["throw"] = verb(1), g7["return"] = verb(2), typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding(o7, m7, p7); +} +function __values(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read(arguments[i7])); + return ar; +} +function __spreadArrays() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await(v8) { + return this instanceof __await ? (this.v = v8, this) : new __await(v8); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function awaitReturn(f8) { + return function(v8) { + return Promise.resolve(v8).then(f8, reject2); + }; + } + function verb(n7, f8) { + if (g7[n7]) { + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + if (f8) + i7[n7] = f8(i7[n7]); + } + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values === "function" ? __values(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 = ownKeys(mod2), i7 = 0; i7 < k6.length; i7++) + if (k6[i7] !== "default") + __createBinding(result2, mod2, k6[i7]); + } + __setModuleDefault(result2, mod2); + return result2; +} +function __importDefault(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn(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); +} +function __addDisposableResource(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[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 (e10) { + return Promise.reject(e10); + } + }; + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + var r8, s7 = 0; + function next() { + while (r8 = env3.stack.pop()) { + try { + if (!r8.async && s7 === 1) + return s7 = 0, env3.stack.push(r8), Promise.resolve().then(next); + if (r8.dispose) { + var result2 = r8.dispose.call(r8.value); + if (r8.async) + return s7 |= 2, Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } else + s7 |= 1; + } catch (e10) { + fail2(e10); + } + } + if (s7 === 1) + return env3.hasError ? Promise.reject(env3.error) : Promise.resolve(); + if (env3.hasError) + throw env3.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m7, tsx, d7, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d7 && (!ext || !cm) ? m7 : d7 + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path2; +} +var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; +var init_tslib_es6 = __esm({ + "node_modules/@stoplight/spectral-core/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics = function(d7, b8) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics(d7, b8); + }; + __assign = function() { + __assign = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign.apply(this, arguments); + }; + __createBinding = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + ownKeys = function(o7) { + ownKeys = Object.getOwnPropertyNames || function(o8) { + var ar = []; + for (var k6 in o8) + if (Object.prototype.hasOwnProperty.call(o8, k6)) + ar[ar.length] = k6; + return ar; + }; + return ownKeys(o7); + }; + _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default = { + __extends, + __assign, + __rest, + __decorate, + __param, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata, + __awaiter: __awaiter2, + __generator, + __createBinding, + __exportStar, + __values, + __read, + __spread, + __spreadArrays, + __spreadArray, + __await, + __asyncGenerator, + __asyncDelegator, + __asyncValues, + __makeTemplateObject, + __importStar, + __importDefault, + __classPrivateFieldGet, + __classPrivateFieldSet, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension + }; + } +}); + +// node_modules/@stoplight/spectral-core/node_modules/@stoplight/types/dist/index.js +var require_dist2 = __commonJS({ + "node_modules/@stoplight/spectral-core/node_modules/@stoplight/types/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.HttpParamStyles = void 0; + (function(HttpParamStyles2) { + HttpParamStyles2["Simple"] = "simple"; + HttpParamStyles2["Matrix"] = "matrix"; + HttpParamStyles2["Label"] = "label"; + HttpParamStyles2["Form"] = "form"; + HttpParamStyles2["CommaDelimited"] = "commaDelimited"; + HttpParamStyles2["SpaceDelimited"] = "spaceDelimited"; + HttpParamStyles2["PipeDelimited"] = "pipeDelimited"; + HttpParamStyles2["DeepObject"] = "deepObject"; + })(exports28.HttpParamStyles || (exports28.HttpParamStyles = {})); + exports28.DiagnosticSeverity = void 0; + (function(DiagnosticSeverity2) { + DiagnosticSeverity2[DiagnosticSeverity2["Error"] = 0] = "Error"; + DiagnosticSeverity2[DiagnosticSeverity2["Warning"] = 1] = "Warning"; + DiagnosticSeverity2[DiagnosticSeverity2["Information"] = 2] = "Information"; + DiagnosticSeverity2[DiagnosticSeverity2["Hint"] = 3] = "Hint"; + })(exports28.DiagnosticSeverity || (exports28.DiagnosticSeverity = {})); + exports28.NodeType = void 0; + (function(NodeType2) { + NodeType2["Article"] = "article"; + NodeType2["HttpService"] = "http_service"; + NodeType2["HttpServer"] = "http_server"; + NodeType2["HttpOperation"] = "http_operation"; + NodeType2["Model"] = "model"; + NodeType2["Generic"] = "generic"; + NodeType2["Unknown"] = "unknown"; + NodeType2["TableOfContents"] = "table_of_contents"; + NodeType2["SpectralRuleset"] = "spectral_ruleset"; + NodeType2["Styleguide"] = "styleguide"; + NodeType2["Image"] = "image"; + })(exports28.NodeType || (exports28.NodeType = {})); + exports28.NodeFormat = void 0; + (function(NodeFormat2) { + NodeFormat2["Json"] = "json"; + NodeFormat2["Markdown"] = "markdown"; + NodeFormat2["Yaml"] = "yaml"; + NodeFormat2["Apng"] = "apng"; + NodeFormat2["Avif"] = "avif"; + NodeFormat2["Bmp"] = "bmp"; + NodeFormat2["Gif"] = "gif"; + NodeFormat2["Jpeg"] = "jpeg"; + NodeFormat2["Png"] = "png"; + NodeFormat2["Svg"] = "svg"; + NodeFormat2["Webp"] = "webp"; + })(exports28.NodeFormat || (exports28.NodeFormat = {})); + } +}); + +// node_modules/@stoplight/spectral-core/dist/consts.js +var require_consts = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/consts.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.DEFAULT_PARSER_OPTIONS = void 0; + var types_1 = require_dist2(); + exports28.DEFAULT_PARSER_OPTIONS = Object.freeze({ + incompatibleValues: types_1.DiagnosticSeverity.Error, + duplicateKeys: types_1.DiagnosticSeverity.Error + }); + } +}); + +// node_modules/lodash-es/_freeGlobal.js +var freeGlobal, freeGlobal_default; +var init_freeGlobal = __esm({ + "node_modules/lodash-es/_freeGlobal.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + freeGlobal = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis; + freeGlobal_default = freeGlobal; + } +}); + +// node_modules/lodash-es/_root.js +var freeSelf, root, root_default; +var init_root = __esm({ + "node_modules/lodash-es/_root.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_freeGlobal(); + freeSelf = typeof self == "object" && self && self.Object === Object && self; + root = freeGlobal_default || freeSelf || Function("return this")(); + root_default = root; + } +}); + +// node_modules/lodash-es/_Symbol.js +var Symbol2, Symbol_default; +var init_Symbol = __esm({ + "node_modules/lodash-es/_Symbol.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + Symbol2 = root_default.Symbol; + Symbol_default = Symbol2; + } +}); + +// node_modules/lodash-es/_getRawTag.js +function getRawTag(value2) { + var isOwn = hasOwnProperty.call(value2, symToStringTag), tag = value2[symToStringTag]; + try { + value2[symToStringTag] = void 0; + var unmasked = true; + } catch (e10) { + } + var result2 = nativeObjectToString.call(value2); + if (unmasked) { + if (isOwn) { + value2[symToStringTag] = tag; + } else { + delete value2[symToStringTag]; + } + } + return result2; +} +var objectProto, hasOwnProperty, nativeObjectToString, symToStringTag, getRawTag_default; +var init_getRawTag = __esm({ + "node_modules/lodash-es/_getRawTag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + objectProto = Object.prototype; + hasOwnProperty = objectProto.hasOwnProperty; + nativeObjectToString = objectProto.toString; + symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0; + getRawTag_default = getRawTag; + } +}); + +// node_modules/lodash-es/_objectToString.js +function objectToString(value2) { + return nativeObjectToString2.call(value2); +} +var objectProto2, nativeObjectToString2, objectToString_default; +var init_objectToString = __esm({ + "node_modules/lodash-es/_objectToString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + objectProto2 = Object.prototype; + nativeObjectToString2 = objectProto2.toString; + objectToString_default = objectToString; + } +}); + +// node_modules/lodash-es/_baseGetTag.js +function baseGetTag(value2) { + if (value2 == null) { + return value2 === void 0 ? undefinedTag : nullTag2; + } + return symToStringTag2 && symToStringTag2 in Object(value2) ? getRawTag_default(value2) : objectToString_default(value2); +} +var nullTag2, undefinedTag, symToStringTag2, baseGetTag_default; +var init_baseGetTag = __esm({ + "node_modules/lodash-es/_baseGetTag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + init_getRawTag(); + init_objectToString(); + nullTag2 = "[object Null]"; + undefinedTag = "[object Undefined]"; + symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0; + baseGetTag_default = baseGetTag; + } +}); + +// node_modules/lodash-es/isObjectLike.js +function isObjectLike(value2) { + return value2 != null && typeof value2 == "object"; +} +var isObjectLike_default; +var init_isObjectLike = __esm({ + "node_modules/lodash-es/isObjectLike.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isObjectLike_default = isObjectLike; + } +}); + +// node_modules/lodash-es/isSymbol.js +function isSymbol(value2) { + return typeof value2 == "symbol" || isObjectLike_default(value2) && baseGetTag_default(value2) == symbolTag; +} +var symbolTag, isSymbol_default; +var init_isSymbol = __esm({ + "node_modules/lodash-es/isSymbol.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + symbolTag = "[object Symbol]"; + isSymbol_default = isSymbol; + } +}); + +// node_modules/lodash-es/_baseToNumber.js +function baseToNumber(value2) { + if (typeof value2 == "number") { + return value2; + } + if (isSymbol_default(value2)) { + return NAN; + } + return +value2; +} +var NAN, baseToNumber_default; +var init_baseToNumber = __esm({ + "node_modules/lodash-es/_baseToNumber.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isSymbol(); + NAN = 0 / 0; + baseToNumber_default = baseToNumber; + } +}); + +// node_modules/lodash-es/_arrayMap.js +function arrayMap(array, iteratee2) { + var index4 = -1, length = array == null ? 0 : array.length, result2 = Array(length); + while (++index4 < length) { + result2[index4] = iteratee2(array[index4], index4, array); + } + return result2; +} +var arrayMap_default; +var init_arrayMap = __esm({ + "node_modules/lodash-es/_arrayMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayMap_default = arrayMap; + } +}); + +// node_modules/lodash-es/isArray.js +var isArray, isArray_default; +var init_isArray = __esm({ + "node_modules/lodash-es/isArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isArray = Array.isArray; + isArray_default = isArray; + } +}); + +// node_modules/lodash-es/_baseToString.js +function baseToString(value2) { + if (typeof value2 == "string") { + return value2; + } + if (isArray_default(value2)) { + return arrayMap_default(value2, baseToString) + ""; + } + if (isSymbol_default(value2)) { + return symbolToString ? symbolToString.call(value2) : ""; + } + var result2 = value2 + ""; + return result2 == "0" && 1 / value2 == -INFINITY ? "-0" : result2; +} +var INFINITY, symbolProto, symbolToString, baseToString_default; +var init_baseToString = __esm({ + "node_modules/lodash-es/_baseToString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + init_arrayMap(); + init_isArray(); + init_isSymbol(); + INFINITY = 1 / 0; + symbolProto = Symbol_default ? Symbol_default.prototype : void 0; + symbolToString = symbolProto ? symbolProto.toString : void 0; + baseToString_default = baseToString; + } +}); + +// node_modules/lodash-es/_createMathOperation.js +function createMathOperation(operator, defaultValue) { + return function(value2, other) { + var result2; + if (value2 === void 0 && other === void 0) { + return defaultValue; + } + if (value2 !== void 0) { + result2 = value2; + } + if (other !== void 0) { + if (result2 === void 0) { + return other; + } + if (typeof value2 == "string" || typeof other == "string") { + value2 = baseToString_default(value2); + other = baseToString_default(other); + } else { + value2 = baseToNumber_default(value2); + other = baseToNumber_default(other); + } + result2 = operator(value2, other); + } + return result2; + }; +} +var createMathOperation_default; +var init_createMathOperation = __esm({ + "node_modules/lodash-es/_createMathOperation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToNumber(); + init_baseToString(); + createMathOperation_default = createMathOperation; + } +}); + +// node_modules/lodash-es/add.js +var add, add_default; +var init_add = __esm({ + "node_modules/lodash-es/add.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createMathOperation(); + add = createMathOperation_default(function(augend, addend) { + return augend + addend; + }, 0); + add_default = add; + } +}); + +// node_modules/lodash-es/_trimmedEndIndex.js +function trimmedEndIndex(string2) { + var index4 = string2.length; + while (index4-- && reWhitespace.test(string2.charAt(index4))) { + } + return index4; +} +var reWhitespace, trimmedEndIndex_default; +var init_trimmedEndIndex = __esm({ + "node_modules/lodash-es/_trimmedEndIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reWhitespace = /\s/; + trimmedEndIndex_default = trimmedEndIndex; + } +}); + +// node_modules/lodash-es/_baseTrim.js +function baseTrim(string2) { + return string2 ? string2.slice(0, trimmedEndIndex_default(string2) + 1).replace(reTrimStart, "") : string2; +} +var reTrimStart, baseTrim_default; +var init_baseTrim = __esm({ + "node_modules/lodash-es/_baseTrim.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_trimmedEndIndex(); + reTrimStart = /^\s+/; + baseTrim_default = baseTrim; + } +}); + +// node_modules/lodash-es/isObject.js +function isObject(value2) { + var type3 = typeof value2; + return value2 != null && (type3 == "object" || type3 == "function"); +} +var isObject_default; +var init_isObject = __esm({ + "node_modules/lodash-es/isObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isObject_default = isObject; + } +}); + +// node_modules/lodash-es/toNumber.js +function toNumber(value2) { + if (typeof value2 == "number") { + return value2; + } + if (isSymbol_default(value2)) { + return NAN2; + } + if (isObject_default(value2)) { + var other = typeof value2.valueOf == "function" ? value2.valueOf() : value2; + value2 = isObject_default(other) ? other + "" : other; + } + if (typeof value2 != "string") { + return value2 === 0 ? value2 : +value2; + } + value2 = baseTrim_default(value2); + var isBinary2 = reIsBinary.test(value2); + return isBinary2 || reIsOctal.test(value2) ? freeParseInt(value2.slice(2), isBinary2 ? 2 : 8) : reIsBadHex.test(value2) ? NAN2 : +value2; +} +var NAN2, reIsBadHex, reIsBinary, reIsOctal, freeParseInt, toNumber_default; +var init_toNumber = __esm({ + "node_modules/lodash-es/toNumber.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseTrim(); + init_isObject(); + init_isSymbol(); + NAN2 = 0 / 0; + reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + reIsBinary = /^0b[01]+$/i; + reIsOctal = /^0o[0-7]+$/i; + freeParseInt = parseInt; + toNumber_default = toNumber; + } +}); + +// node_modules/lodash-es/toFinite.js +function toFinite(value2) { + if (!value2) { + return value2 === 0 ? value2 : 0; + } + value2 = toNumber_default(value2); + if (value2 === INFINITY2 || value2 === -INFINITY2) { + var sign = value2 < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value2 === value2 ? value2 : 0; +} +var INFINITY2, MAX_INTEGER, toFinite_default; +var init_toFinite = __esm({ + "node_modules/lodash-es/toFinite.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toNumber(); + INFINITY2 = 1 / 0; + MAX_INTEGER = 17976931348623157e292; + toFinite_default = toFinite; + } +}); + +// node_modules/lodash-es/toInteger.js +function toInteger(value2) { + var result2 = toFinite_default(value2), remainder = result2 % 1; + return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; +} +var toInteger_default; +var init_toInteger = __esm({ + "node_modules/lodash-es/toInteger.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toFinite(); + toInteger_default = toInteger; + } +}); + +// node_modules/lodash-es/after.js +function after(n7, func) { + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + n7 = toInteger_default(n7); + return function() { + if (--n7 < 1) { + return func.apply(this, arguments); + } + }; +} +var FUNC_ERROR_TEXT, after_default; +var init_after = __esm({ + "node_modules/lodash-es/after.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toInteger(); + FUNC_ERROR_TEXT = "Expected a function"; + after_default = after; + } +}); + +// node_modules/lodash-es/identity.js +function identity(value2) { + return value2; +} +var identity_default; +var init_identity2 = __esm({ + "node_modules/lodash-es/identity.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + identity_default = identity; + } +}); + +// node_modules/lodash-es/isFunction.js +function isFunction(value2) { + if (!isObject_default(value2)) { + return false; + } + var tag = baseGetTag_default(value2); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} +var asyncTag, funcTag, genTag, proxyTag, isFunction_default; +var init_isFunction = __esm({ + "node_modules/lodash-es/isFunction.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObject(); + asyncTag = "[object AsyncFunction]"; + funcTag = "[object Function]"; + genTag = "[object GeneratorFunction]"; + proxyTag = "[object Proxy]"; + isFunction_default = isFunction; + } +}); + +// node_modules/lodash-es/_coreJsData.js +var coreJsData, coreJsData_default; +var init_coreJsData = __esm({ + "node_modules/lodash-es/_coreJsData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + coreJsData = root_default["__core-js_shared__"]; + coreJsData_default = coreJsData; + } +}); + +// node_modules/lodash-es/_isMasked.js +function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; +} +var maskSrcKey, isMasked_default; +var init_isMasked = __esm({ + "node_modules/lodash-es/_isMasked.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_coreJsData(); + maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + isMasked_default = isMasked; + } +}); + +// node_modules/lodash-es/_toSource.js +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e10) { + } + try { + return func + ""; + } catch (e10) { + } + } + return ""; +} +var funcProto, funcToString, toSource_default; +var init_toSource = __esm({ + "node_modules/lodash-es/_toSource.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + funcProto = Function.prototype; + funcToString = funcProto.toString; + toSource_default = toSource; + } +}); + +// node_modules/lodash-es/_baseIsNative.js +function baseIsNative(value2) { + if (!isObject_default(value2) || isMasked_default(value2)) { + return false; + } + var pattern5 = isFunction_default(value2) ? reIsNative : reIsHostCtor; + return pattern5.test(toSource_default(value2)); +} +var reRegExpChar, reIsHostCtor, funcProto2, objectProto3, funcToString2, hasOwnProperty2, reIsNative, baseIsNative_default; +var init_baseIsNative = __esm({ + "node_modules/lodash-es/_baseIsNative.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isFunction(); + init_isMasked(); + init_isObject(); + init_toSource(); + reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + reIsHostCtor = /^\[object .+?Constructor\]$/; + funcProto2 = Function.prototype; + objectProto3 = Object.prototype; + funcToString2 = funcProto2.toString; + hasOwnProperty2 = objectProto3.hasOwnProperty; + reIsNative = RegExp( + "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + baseIsNative_default = baseIsNative; + } +}); + +// node_modules/lodash-es/_getValue.js +function getValue(object, key) { + return object == null ? void 0 : object[key]; +} +var getValue_default; +var init_getValue = __esm({ + "node_modules/lodash-es/_getValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + getValue_default = getValue; + } +}); + +// node_modules/lodash-es/_getNative.js +function getNative(object, key) { + var value2 = getValue_default(object, key); + return baseIsNative_default(value2) ? value2 : void 0; +} +var getNative_default; +var init_getNative = __esm({ + "node_modules/lodash-es/_getNative.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsNative(); + init_getValue(); + getNative_default = getNative; + } +}); + +// node_modules/lodash-es/_WeakMap.js +var WeakMap2, WeakMap_default; +var init_WeakMap = __esm({ + "node_modules/lodash-es/_WeakMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + init_root(); + WeakMap2 = getNative_default(root_default, "WeakMap"); + WeakMap_default = WeakMap2; + } +}); + +// node_modules/lodash-es/_metaMap.js +var metaMap, metaMap_default; +var init_metaMap = __esm({ + "node_modules/lodash-es/_metaMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_WeakMap(); + metaMap = WeakMap_default && new WeakMap_default(); + metaMap_default = metaMap; + } +}); + +// node_modules/lodash-es/_baseSetData.js +var baseSetData, baseSetData_default; +var init_baseSetData = __esm({ + "node_modules/lodash-es/_baseSetData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity2(); + init_metaMap(); + baseSetData = !metaMap_default ? identity_default : function(func, data) { + metaMap_default.set(func, data); + return func; + }; + baseSetData_default = baseSetData; + } +}); + +// node_modules/lodash-es/_baseCreate.js +var objectCreate, baseCreate, baseCreate_default; +var init_baseCreate = __esm({ + "node_modules/lodash-es/_baseCreate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isObject(); + objectCreate = Object.create; + baseCreate = /* @__PURE__ */ function() { + function object() { + } + return function(proto) { + if (!isObject_default(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result2 = new object(); + object.prototype = void 0; + return result2; + }; + }(); + baseCreate_default = baseCreate; + } +}); + +// node_modules/lodash-es/_createCtor.js +function createCtor(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_default(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); + return isObject_default(result2) ? result2 : thisBinding; + }; +} +var createCtor_default; +var init_createCtor = __esm({ + "node_modules/lodash-es/_createCtor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseCreate(); + init_isObject(); + createCtor_default = createCtor; + } +}); + +// node_modules/lodash-es/_createBind.js +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor_default(func); + function wrapper() { + var fn = this && this !== root_default && this instanceof wrapper ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} +var WRAP_BIND_FLAG, createBind_default; +var init_createBind = __esm({ + "node_modules/lodash-es/_createBind.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCtor(); + init_root(); + WRAP_BIND_FLAG = 1; + createBind_default = createBind; + } +}); + +// node_modules/lodash-es/_apply.js +function apply(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_default; +var init_apply = __esm({ + "node_modules/lodash-es/_apply.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + apply_default = apply; + } +}); + +// node_modules/lodash-es/_composeArgs.js +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(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 nativeMax, composeArgs_default; +var init_composeArgs = __esm({ + "node_modules/lodash-es/_composeArgs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeMax = Math.max; + composeArgs_default = composeArgs; + } +}); + +// node_modules/lodash-es/_composeArgsRight.js +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax2(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 nativeMax2, composeArgsRight_default; +var init_composeArgsRight = __esm({ + "node_modules/lodash-es/_composeArgsRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeMax2 = Math.max; + composeArgsRight_default = composeArgsRight; + } +}); + +// node_modules/lodash-es/_countHolders.js +function countHolders(array, placeholder) { + var length = array.length, result2 = 0; + while (length--) { + if (array[length] === placeholder) { + ++result2; + } + } + return result2; +} +var countHolders_default; +var init_countHolders = __esm({ + "node_modules/lodash-es/_countHolders.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + countHolders_default = countHolders; + } +}); + +// node_modules/lodash-es/_baseLodash.js +function baseLodash() { +} +var baseLodash_default; +var init_baseLodash = __esm({ + "node_modules/lodash-es/_baseLodash.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseLodash_default = baseLodash; + } +}); + +// node_modules/lodash-es/_LazyWrapper.js +function LazyWrapper(value2) { + this.__wrapped__ = value2; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} +var MAX_ARRAY_LENGTH, LazyWrapper_default; +var init_LazyWrapper = __esm({ + "node_modules/lodash-es/_LazyWrapper.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseCreate(); + init_baseLodash(); + MAX_ARRAY_LENGTH = 4294967295; + LazyWrapper.prototype = baseCreate_default(baseLodash_default.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + LazyWrapper_default = LazyWrapper; + } +}); + +// node_modules/lodash-es/noop.js +function noop2() { +} +var noop_default; +var init_noop = __esm({ + "node_modules/lodash-es/noop.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + noop_default = noop2; + } +}); + +// node_modules/lodash-es/_getData.js +var getData, getData_default; +var init_getData = __esm({ + "node_modules/lodash-es/_getData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_metaMap(); + init_noop(); + getData = !metaMap_default ? noop_default : function(func) { + return metaMap_default.get(func); + }; + getData_default = getData; + } +}); + +// node_modules/lodash-es/_realNames.js +var realNames, realNames_default; +var init_realNames = __esm({ + "node_modules/lodash-es/_realNames.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + realNames = {}; + realNames_default = realNames; + } +}); + +// node_modules/lodash-es/_getFuncName.js +function getFuncName(func) { + var result2 = func.name + "", array = realNames_default[result2], length = hasOwnProperty3.call(realNames_default, result2) ? array.length : 0; + while (length--) { + var data = array[length], otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result2; +} +var objectProto4, hasOwnProperty3, getFuncName_default; +var init_getFuncName = __esm({ + "node_modules/lodash-es/_getFuncName.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_realNames(); + objectProto4 = Object.prototype; + hasOwnProperty3 = objectProto4.hasOwnProperty; + getFuncName_default = getFuncName; + } +}); + +// node_modules/lodash-es/_LodashWrapper.js +function LodashWrapper(value2, chainAll) { + this.__wrapped__ = value2; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = void 0; +} +var LodashWrapper_default; +var init_LodashWrapper = __esm({ + "node_modules/lodash-es/_LodashWrapper.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseCreate(); + init_baseLodash(); + LodashWrapper.prototype = baseCreate_default(baseLodash_default.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + LodashWrapper_default = LodashWrapper; + } +}); + +// node_modules/lodash-es/_copyArray.js +function copyArray(source, array) { + var index4 = -1, length = source.length; + array || (array = Array(length)); + while (++index4 < length) { + array[index4] = source[index4]; + } + return array; +} +var copyArray_default; +var init_copyArray = __esm({ + "node_modules/lodash-es/_copyArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + copyArray_default = copyArray; + } +}); + +// node_modules/lodash-es/_wrapperClone.js +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper_default) { + return wrapper.clone(); + } + var result2 = new LodashWrapper_default(wrapper.__wrapped__, wrapper.__chain__); + result2.__actions__ = copyArray_default(wrapper.__actions__); + result2.__index__ = wrapper.__index__; + result2.__values__ = wrapper.__values__; + return result2; +} +var wrapperClone_default; +var init_wrapperClone = __esm({ + "node_modules/lodash-es/_wrapperClone.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_LodashWrapper(); + init_copyArray(); + wrapperClone_default = wrapperClone; + } +}); + +// node_modules/lodash-es/wrapperLodash.js +function lodash(value2) { + if (isObjectLike_default(value2) && !isArray_default(value2) && !(value2 instanceof LazyWrapper_default)) { + if (value2 instanceof LodashWrapper_default) { + return value2; + } + if (hasOwnProperty4.call(value2, "__wrapped__")) { + return wrapperClone_default(value2); + } + } + return new LodashWrapper_default(value2); +} +var objectProto5, hasOwnProperty4, wrapperLodash_default; +var init_wrapperLodash = __esm({ + "node_modules/lodash-es/wrapperLodash.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_LodashWrapper(); + init_baseLodash(); + init_isArray(); + init_isObjectLike(); + init_wrapperClone(); + objectProto5 = Object.prototype; + hasOwnProperty4 = objectProto5.hasOwnProperty; + lodash.prototype = baseLodash_default.prototype; + lodash.prototype.constructor = lodash; + wrapperLodash_default = lodash; + } +}); + +// node_modules/lodash-es/_isLaziable.js +function isLaziable(func) { + var funcName = getFuncName_default(func), other = wrapperLodash_default[funcName]; + if (typeof other != "function" || !(funcName in LazyWrapper_default.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData_default(other); + return !!data && func === data[0]; +} +var isLaziable_default; +var init_isLaziable = __esm({ + "node_modules/lodash-es/_isLaziable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_getData(); + init_getFuncName(); + init_wrapperLodash(); + isLaziable_default = isLaziable; + } +}); + +// node_modules/lodash-es/_shortOut.js +function shortOut(func) { + var count2 = 0, lastCalled = 0; + return function() { + var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count2 >= HOT_COUNT) { + return arguments[0]; + } + } else { + count2 = 0; + } + return func.apply(void 0, arguments); + }; +} +var HOT_COUNT, HOT_SPAN, nativeNow, shortOut_default; +var init_shortOut = __esm({ + "node_modules/lodash-es/_shortOut.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + HOT_COUNT = 800; + HOT_SPAN = 16; + nativeNow = Date.now; + shortOut_default = shortOut; + } +}); + +// node_modules/lodash-es/_setData.js +var setData, setData_default; +var init_setData = __esm({ + "node_modules/lodash-es/_setData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSetData(); + init_shortOut(); + setData = shortOut_default(baseSetData_default); + setData_default = setData; + } +}); + +// node_modules/lodash-es/_getWrapDetails.js +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} +var reWrapDetails, reSplitDetails, getWrapDetails_default; +var init_getWrapDetails = __esm({ + "node_modules/lodash-es/_getWrapDetails.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/; + reSplitDetails = /,? & /; + getWrapDetails_default = getWrapDetails; + } +}); + +// node_modules/lodash-es/_insertWrapDetails.js +function insertWrapDetails(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(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); +} +var reWrapComment, insertWrapDetails_default; +var init_insertWrapDetails = __esm({ + "node_modules/lodash-es/_insertWrapDetails.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + insertWrapDetails_default = insertWrapDetails; + } +}); + +// node_modules/lodash-es/constant.js +function constant(value2) { + return function() { + return value2; + }; +} +var constant_default; +var init_constant = __esm({ + "node_modules/lodash-es/constant.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + constant_default = constant; + } +}); + +// node_modules/lodash-es/_defineProperty.js +var defineProperty, defineProperty_default; +var init_defineProperty = __esm({ + "node_modules/lodash-es/_defineProperty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + defineProperty = function() { + try { + var func = getNative_default(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e10) { + } + }(); + defineProperty_default = defineProperty; + } +}); + +// node_modules/lodash-es/_baseSetToString.js +var baseSetToString, baseSetToString_default; +var init_baseSetToString = __esm({ + "node_modules/lodash-es/_baseSetToString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_constant(); + init_defineProperty(); + init_identity2(); + baseSetToString = !defineProperty_default ? identity_default : function(func, string2) { + return defineProperty_default(func, "toString", { + "configurable": true, + "enumerable": false, + "value": constant_default(string2), + "writable": true + }); + }; + baseSetToString_default = baseSetToString; + } +}); + +// node_modules/lodash-es/_setToString.js +var setToString, setToString_default; +var init_setToString = __esm({ + "node_modules/lodash-es/_setToString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSetToString(); + init_shortOut(); + setToString = shortOut_default(baseSetToString_default); + setToString_default = setToString; + } +}); + +// node_modules/lodash-es/_arrayEach.js +function arrayEach(array, iteratee2) { + var index4 = -1, length = array == null ? 0 : array.length; + while (++index4 < length) { + if (iteratee2(array[index4], index4, array) === false) { + break; + } + } + return array; +} +var arrayEach_default; +var init_arrayEach = __esm({ + "node_modules/lodash-es/_arrayEach.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayEach_default = arrayEach; + } +}); + +// node_modules/lodash-es/_baseFindIndex.js +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, index4 = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index4-- : ++index4 < length) { + if (predicate(array[index4], index4, array)) { + return index4; + } + } + return -1; +} +var baseFindIndex_default; +var init_baseFindIndex = __esm({ + "node_modules/lodash-es/_baseFindIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseFindIndex_default = baseFindIndex; + } +}); + +// node_modules/lodash-es/_baseIsNaN.js +function baseIsNaN(value2) { + return value2 !== value2; +} +var baseIsNaN_default; +var init_baseIsNaN = __esm({ + "node_modules/lodash-es/_baseIsNaN.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseIsNaN_default = baseIsNaN; + } +}); + +// node_modules/lodash-es/_strictIndexOf.js +function strictIndexOf(array, value2, fromIndex) { + var index4 = fromIndex - 1, length = array.length; + while (++index4 < length) { + if (array[index4] === value2) { + return index4; + } + } + return -1; +} +var strictIndexOf_default; +var init_strictIndexOf = __esm({ + "node_modules/lodash-es/_strictIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + strictIndexOf_default = strictIndexOf; + } +}); + +// node_modules/lodash-es/_baseIndexOf.js +function baseIndexOf(array, value2, fromIndex) { + return value2 === value2 ? strictIndexOf_default(array, value2, fromIndex) : baseFindIndex_default(array, baseIsNaN_default, fromIndex); +} +var baseIndexOf_default; +var init_baseIndexOf = __esm({ + "node_modules/lodash-es/_baseIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindIndex(); + init_baseIsNaN(); + init_strictIndexOf(); + baseIndexOf_default = baseIndexOf; + } +}); + +// node_modules/lodash-es/_arrayIncludes.js +function arrayIncludes(array, value2) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf_default(array, value2, 0) > -1; +} +var arrayIncludes_default; +var init_arrayIncludes = __esm({ + "node_modules/lodash-es/_arrayIncludes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIndexOf(); + arrayIncludes_default = arrayIncludes; + } +}); + +// node_modules/lodash-es/_updateWrapDetails.js +function updateWrapDetails(details, bitmask) { + arrayEach_default(wrapFlags, function(pair) { + var value2 = "_." + pair[0]; + if (bitmask & pair[1] && !arrayIncludes_default(details, value2)) { + details.push(value2); + } + }); + return details.sort(); +} +var WRAP_BIND_FLAG2, WRAP_BIND_KEY_FLAG, WRAP_CURRY_FLAG, WRAP_CURRY_RIGHT_FLAG, WRAP_PARTIAL_FLAG, WRAP_PARTIAL_RIGHT_FLAG, WRAP_ARY_FLAG, WRAP_REARG_FLAG, WRAP_FLIP_FLAG, wrapFlags, updateWrapDetails_default; +var init_updateWrapDetails = __esm({ + "node_modules/lodash-es/_updateWrapDetails.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_arrayIncludes(); + WRAP_BIND_FLAG2 = 1; + WRAP_BIND_KEY_FLAG = 2; + WRAP_CURRY_FLAG = 8; + WRAP_CURRY_RIGHT_FLAG = 16; + WRAP_PARTIAL_FLAG = 32; + WRAP_PARTIAL_RIGHT_FLAG = 64; + WRAP_ARY_FLAG = 128; + WRAP_REARG_FLAG = 256; + WRAP_FLIP_FLAG = 512; + wrapFlags = [ + ["ary", WRAP_ARY_FLAG], + ["bind", WRAP_BIND_FLAG2], + ["bindKey", WRAP_BIND_KEY_FLAG], + ["curry", WRAP_CURRY_FLAG], + ["curryRight", WRAP_CURRY_RIGHT_FLAG], + ["flip", WRAP_FLIP_FLAG], + ["partial", WRAP_PARTIAL_FLAG], + ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], + ["rearg", WRAP_REARG_FLAG] + ]; + updateWrapDetails_default = updateWrapDetails; + } +}); + +// node_modules/lodash-es/_setWrapToString.js +function setWrapToString(wrapper, reference, bitmask) { + var source = reference + ""; + return setToString_default(wrapper, insertWrapDetails_default(source, updateWrapDetails_default(getWrapDetails_default(source), bitmask))); +} +var setWrapToString_default; +var init_setWrapToString = __esm({ + "node_modules/lodash-es/_setWrapToString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getWrapDetails(); + init_insertWrapDetails(); + init_setToString(); + init_updateWrapDetails(); + setWrapToString_default = setWrapToString; + } +}); + +// node_modules/lodash-es/_createRecurry.js +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG2, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials; + bitmask |= isCurry ? WRAP_PARTIAL_FLAG2 : WRAP_PARTIAL_RIGHT_FLAG2; + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG2 : WRAP_PARTIAL_FLAG2); + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG3 | WRAP_BIND_KEY_FLAG2); + } + var newData = [ + func, + bitmask, + thisArg, + newPartials, + newHolders, + newPartialsRight, + newHoldersRight, + argPos, + ary2, + arity + ]; + var result2 = wrapFunc.apply(void 0, newData); + if (isLaziable_default(func)) { + setData_default(result2, newData); + } + result2.placeholder = placeholder; + return setWrapToString_default(result2, func, bitmask); +} +var WRAP_BIND_FLAG3, WRAP_BIND_KEY_FLAG2, WRAP_CURRY_BOUND_FLAG, WRAP_CURRY_FLAG2, WRAP_PARTIAL_FLAG2, WRAP_PARTIAL_RIGHT_FLAG2, createRecurry_default; +var init_createRecurry = __esm({ + "node_modules/lodash-es/_createRecurry.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isLaziable(); + init_setData(); + init_setWrapToString(); + WRAP_BIND_FLAG3 = 1; + WRAP_BIND_KEY_FLAG2 = 2; + WRAP_CURRY_BOUND_FLAG = 4; + WRAP_CURRY_FLAG2 = 8; + WRAP_PARTIAL_FLAG2 = 32; + WRAP_PARTIAL_RIGHT_FLAG2 = 64; + createRecurry_default = createRecurry; + } +}); + +// node_modules/lodash-es/_getHolder.js +function getHolder(func) { + var object = func; + return object.placeholder; +} +var getHolder_default; +var init_getHolder = __esm({ + "node_modules/lodash-es/_getHolder.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + getHolder_default = getHolder; + } +}); + +// node_modules/lodash-es/_isIndex.js +function isIndex(value2, length) { + var type3 = typeof value2; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type3 == "number" || type3 != "symbol" && reIsUint.test(value2)) && (value2 > -1 && value2 % 1 == 0 && value2 < length); +} +var MAX_SAFE_INTEGER, reIsUint, isIndex_default; +var init_isIndex = __esm({ + "node_modules/lodash-es/_isIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + MAX_SAFE_INTEGER = 9007199254740991; + reIsUint = /^(?:0|[1-9]\d*)$/; + isIndex_default = isIndex; + } +}); + +// node_modules/lodash-es/_reorder.js +function reorder(array, indexes) { + var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray_default(array); + while (length--) { + var index4 = indexes[length]; + array[length] = isIndex_default(index4, arrLength) ? oldArray[index4] : void 0; + } + return array; +} +var nativeMin, reorder_default; +var init_reorder = __esm({ + "node_modules/lodash-es/_reorder.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyArray(); + init_isIndex(); + nativeMin = Math.min; + reorder_default = reorder; + } +}); + +// node_modules/lodash-es/_replaceHolders.js +function replaceHolders(array, placeholder) { + var index4 = -1, length = array.length, resIndex = 0, result2 = []; + while (++index4 < length) { + var value2 = array[index4]; + if (value2 === placeholder || value2 === PLACEHOLDER) { + array[index4] = PLACEHOLDER; + result2[resIndex++] = index4; + } + } + return result2; +} +var PLACEHOLDER, replaceHolders_default; +var init_replaceHolders = __esm({ + "node_modules/lodash-es/_replaceHolders.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + PLACEHOLDER = "__lodash_placeholder__"; + replaceHolders_default = replaceHolders; + } +}); + +// node_modules/lodash-es/_createHybrid.js +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { + var isAry = bitmask & WRAP_ARY_FLAG2, isBind = bitmask & WRAP_BIND_FLAG4, isBindKey = bitmask & WRAP_BIND_KEY_FLAG3, isCurried = bitmask & (WRAP_CURRY_FLAG3 | WRAP_CURRY_RIGHT_FLAG2), isFlip = bitmask & WRAP_FLIP_FLAG2, Ctor = isBindKey ? void 0 : createCtor_default(func); + function wrapper() { + var length = arguments.length, args = Array(length), index4 = length; + while (index4--) { + args[index4] = arguments[index4]; + } + if (isCurried) { + var placeholder = getHolder_default(wrapper), holdersCount = countHolders_default(args, placeholder); + } + if (partials) { + args = composeArgs_default(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight_default(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders_default(args, placeholder); + return createRecurry_default( + func, + bitmask, + createHybrid, + 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_default(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary2 < length) { + args.length = ary2; + } + if (this && this !== root_default && this instanceof wrapper) { + fn = Ctor || createCtor_default(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} +var WRAP_BIND_FLAG4, WRAP_BIND_KEY_FLAG3, WRAP_CURRY_FLAG3, WRAP_CURRY_RIGHT_FLAG2, WRAP_ARY_FLAG2, WRAP_FLIP_FLAG2, createHybrid_default; +var init_createHybrid = __esm({ + "node_modules/lodash-es/_createHybrid.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_composeArgs(); + init_composeArgsRight(); + init_countHolders(); + init_createCtor(); + init_createRecurry(); + init_getHolder(); + init_reorder(); + init_replaceHolders(); + init_root(); + WRAP_BIND_FLAG4 = 1; + WRAP_BIND_KEY_FLAG3 = 2; + WRAP_CURRY_FLAG3 = 8; + WRAP_CURRY_RIGHT_FLAG2 = 16; + WRAP_ARY_FLAG2 = 128; + WRAP_FLIP_FLAG2 = 512; + createHybrid_default = createHybrid; + } +}); + +// node_modules/lodash-es/_createCurry.js +function createCurry(func, bitmask, arity) { + var Ctor = createCtor_default(func); + function wrapper() { + var length = arguments.length, args = Array(length), index4 = length, placeholder = getHolder_default(wrapper); + while (index4--) { + args[index4] = arguments[index4]; + } + var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders_default(args, placeholder); + length -= holders.length; + if (length < arity) { + return createRecurry_default( + func, + bitmask, + createHybrid_default, + wrapper.placeholder, + void 0, + args, + holders, + void 0, + void 0, + arity - length + ); + } + var fn = this && this !== root_default && this instanceof wrapper ? Ctor : func; + return apply_default(fn, this, args); + } + return wrapper; +} +var createCurry_default; +var init_createCurry = __esm({ + "node_modules/lodash-es/_createCurry.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_createCtor(); + init_createHybrid(); + init_createRecurry(); + init_getHolder(); + init_replaceHolders(); + init_root(); + createCurry_default = createCurry; + } +}); + +// node_modules/lodash-es/_createPartial.js +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG5, Ctor = createCtor_default(func); + function wrapper() { + var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root_default && this instanceof wrapper ? Ctor : func; + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply_default(fn, isBind ? thisArg : this, args); + } + return wrapper; +} +var WRAP_BIND_FLAG5, createPartial_default; +var init_createPartial = __esm({ + "node_modules/lodash-es/_createPartial.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_createCtor(); + init_root(); + WRAP_BIND_FLAG5 = 1; + createPartial_default = createPartial; + } +}); + +// node_modules/lodash-es/_mergeData.js +function mergeData(data, source) { + var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG6 | WRAP_BIND_KEY_FLAG4 | WRAP_ARY_FLAG3); + var isCombo = srcBitmask == WRAP_ARY_FLAG3 && bitmask == WRAP_CURRY_FLAG4 || srcBitmask == WRAP_ARY_FLAG3 && bitmask == WRAP_REARG_FLAG2 && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG3 | WRAP_REARG_FLAG2) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG4; + if (!(isCommon || isCombo)) { + return data; + } + if (srcBitmask & WRAP_BIND_FLAG6) { + data[2] = source[2]; + newBitmask |= bitmask & WRAP_BIND_FLAG6 ? 0 : WRAP_CURRY_BOUND_FLAG2; + } + var value2 = source[3]; + if (value2) { + var partials = data[3]; + data[3] = partials ? composeArgs_default(partials, value2, source[4]) : value2; + data[4] = partials ? replaceHolders_default(data[3], PLACEHOLDER2) : source[4]; + } + value2 = source[5]; + if (value2) { + partials = data[5]; + data[5] = partials ? composeArgsRight_default(partials, value2, source[6]) : value2; + data[6] = partials ? replaceHolders_default(data[5], PLACEHOLDER2) : source[6]; + } + value2 = source[7]; + if (value2) { + data[7] = value2; + } + if (srcBitmask & WRAP_ARY_FLAG3) { + data[8] = data[8] == null ? source[8] : nativeMin2(data[8], source[8]); + } + if (data[9] == null) { + data[9] = source[9]; + } + data[0] = source[0]; + data[1] = newBitmask; + return data; +} +var PLACEHOLDER2, WRAP_BIND_FLAG6, WRAP_BIND_KEY_FLAG4, WRAP_CURRY_BOUND_FLAG2, WRAP_CURRY_FLAG4, WRAP_ARY_FLAG3, WRAP_REARG_FLAG2, nativeMin2, mergeData_default; +var init_mergeData = __esm({ + "node_modules/lodash-es/_mergeData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_composeArgs(); + init_composeArgsRight(); + init_replaceHolders(); + PLACEHOLDER2 = "__lodash_placeholder__"; + WRAP_BIND_FLAG6 = 1; + WRAP_BIND_KEY_FLAG4 = 2; + WRAP_CURRY_BOUND_FLAG2 = 4; + WRAP_CURRY_FLAG4 = 8; + WRAP_ARY_FLAG3 = 128; + WRAP_REARG_FLAG2 = 256; + nativeMin2 = Math.min; + mergeData_default = mergeData; + } +}); + +// node_modules/lodash-es/_createWrap.js +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG5; + if (!isBindKey && typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT2); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG3 | WRAP_PARTIAL_RIGHT_FLAG3); + partials = holders = void 0; + } + ary2 = ary2 === void 0 ? ary2 : nativeMax3(toInteger_default(ary2), 0); + arity = arity === void 0 ? arity : toInteger_default(arity); + length -= holders ? holders.length : 0; + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG3) { + var partialsRight = partials, holdersRight = holders; + partials = holders = void 0; + } + var data = isBindKey ? void 0 : getData_default(func); + var newData = [ + func, + bitmask, + thisArg, + partials, + holders, + partialsRight, + holdersRight, + argPos, + ary2, + arity + ]; + if (data) { + mergeData_default(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === void 0 ? isBindKey ? 0 : func.length : nativeMax3(newData[9] - length, 0); + if (!arity && bitmask & (WRAP_CURRY_FLAG5 | WRAP_CURRY_RIGHT_FLAG3)) { + bitmask &= ~(WRAP_CURRY_FLAG5 | WRAP_CURRY_RIGHT_FLAG3); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG7) { + var result2 = createBind_default(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG5 || bitmask == WRAP_CURRY_RIGHT_FLAG3) { + result2 = createCurry_default(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG3 || bitmask == (WRAP_BIND_FLAG7 | WRAP_PARTIAL_FLAG3)) && !holders.length) { + result2 = createPartial_default(func, bitmask, thisArg, partials); + } else { + result2 = createHybrid_default.apply(void 0, newData); + } + var setter = data ? baseSetData_default : setData_default; + return setWrapToString_default(setter(result2, newData), func, bitmask); +} +var FUNC_ERROR_TEXT2, WRAP_BIND_FLAG7, WRAP_BIND_KEY_FLAG5, WRAP_CURRY_FLAG5, WRAP_CURRY_RIGHT_FLAG3, WRAP_PARTIAL_FLAG3, WRAP_PARTIAL_RIGHT_FLAG3, nativeMax3, createWrap_default; +var init_createWrap = __esm({ + "node_modules/lodash-es/_createWrap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSetData(); + init_createBind(); + init_createCurry(); + init_createHybrid(); + init_createPartial(); + init_getData(); + init_mergeData(); + init_setData(); + init_setWrapToString(); + init_toInteger(); + FUNC_ERROR_TEXT2 = "Expected a function"; + WRAP_BIND_FLAG7 = 1; + WRAP_BIND_KEY_FLAG5 = 2; + WRAP_CURRY_FLAG5 = 8; + WRAP_CURRY_RIGHT_FLAG3 = 16; + WRAP_PARTIAL_FLAG3 = 32; + WRAP_PARTIAL_RIGHT_FLAG3 = 64; + nativeMax3 = Math.max; + createWrap_default = createWrap; + } +}); + +// node_modules/lodash-es/ary.js +function ary(func, n7, guard) { + n7 = guard ? void 0 : n7; + n7 = func && n7 == null ? func.length : n7; + return createWrap_default(func, WRAP_ARY_FLAG4, void 0, void 0, void 0, void 0, n7); +} +var WRAP_ARY_FLAG4, ary_default; +var init_ary = __esm({ + "node_modules/lodash-es/ary.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createWrap(); + WRAP_ARY_FLAG4 = 128; + ary_default = ary; + } +}); + +// node_modules/lodash-es/_baseAssignValue.js +function baseAssignValue(object, key, value2) { + if (key == "__proto__" && defineProperty_default) { + defineProperty_default(object, key, { + "configurable": true, + "enumerable": true, + "value": value2, + "writable": true + }); + } else { + object[key] = value2; + } +} +var baseAssignValue_default; +var init_baseAssignValue = __esm({ + "node_modules/lodash-es/_baseAssignValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_defineProperty(); + baseAssignValue_default = baseAssignValue; + } +}); + +// node_modules/lodash-es/eq.js +function eq(value2, other) { + return value2 === other || value2 !== value2 && other !== other; +} +var eq_default; +var init_eq = __esm({ + "node_modules/lodash-es/eq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + eq_default = eq; + } +}); + +// node_modules/lodash-es/_assignValue.js +function assignValue(object, key, value2) { + var objValue = object[key]; + if (!(hasOwnProperty5.call(object, key) && eq_default(objValue, value2)) || value2 === void 0 && !(key in object)) { + baseAssignValue_default(object, key, value2); + } +} +var objectProto6, hasOwnProperty5, assignValue_default; +var init_assignValue = __esm({ + "node_modules/lodash-es/_assignValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_eq(); + objectProto6 = Object.prototype; + hasOwnProperty5 = objectProto6.hasOwnProperty; + assignValue_default = assignValue; + } +}); + +// node_modules/lodash-es/_copyObject.js +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + var index4 = -1, length = props.length; + while (++index4 < length) { + var key = props[index4]; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0; + if (newValue === void 0) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue_default(object, key, newValue); + } else { + assignValue_default(object, key, newValue); + } + } + return object; +} +var copyObject_default; +var init_copyObject = __esm({ + "node_modules/lodash-es/_copyObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignValue(); + init_baseAssignValue(); + copyObject_default = copyObject; + } +}); + +// node_modules/lodash-es/_overRest.js +function overRest(func, start, transform2) { + start = nativeMax4(start === void 0 ? func.length - 1 : start, 0); + return function() { + var args = arguments, index4 = -1, length = nativeMax4(args.length - start, 0), array = Array(length); + while (++index4 < length) { + array[index4] = args[start + index4]; + } + index4 = -1; + var otherArgs = Array(start + 1); + while (++index4 < start) { + otherArgs[index4] = args[index4]; + } + otherArgs[start] = transform2(array); + return apply_default(func, this, otherArgs); + }; +} +var nativeMax4, overRest_default; +var init_overRest = __esm({ + "node_modules/lodash-es/_overRest.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + nativeMax4 = Math.max; + overRest_default = overRest; + } +}); + +// node_modules/lodash-es/_baseRest.js +function baseRest(func, start) { + return setToString_default(overRest_default(func, start, identity_default), func + ""); +} +var baseRest_default; +var init_baseRest = __esm({ + "node_modules/lodash-es/_baseRest.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity2(); + init_overRest(); + init_setToString(); + baseRest_default = baseRest; + } +}); + +// node_modules/lodash-es/isLength.js +function isLength(value2) { + return typeof value2 == "number" && value2 > -1 && value2 % 1 == 0 && value2 <= MAX_SAFE_INTEGER2; +} +var MAX_SAFE_INTEGER2, isLength_default; +var init_isLength = __esm({ + "node_modules/lodash-es/isLength.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + MAX_SAFE_INTEGER2 = 9007199254740991; + isLength_default = isLength; + } +}); + +// node_modules/lodash-es/isArrayLike.js +function isArrayLike(value2) { + return value2 != null && isLength_default(value2.length) && !isFunction_default(value2); +} +var isArrayLike_default; +var init_isArrayLike = __esm({ + "node_modules/lodash-es/isArrayLike.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isFunction(); + init_isLength(); + isArrayLike_default = isArrayLike; + } +}); + +// node_modules/lodash-es/_isIterateeCall.js +function isIterateeCall(value2, index4, object) { + if (!isObject_default(object)) { + return false; + } + var type3 = typeof index4; + if (type3 == "number" ? isArrayLike_default(object) && isIndex_default(index4, object.length) : type3 == "string" && index4 in object) { + return eq_default(object[index4], value2); + } + return false; +} +var isIterateeCall_default; +var init_isIterateeCall = __esm({ + "node_modules/lodash-es/_isIterateeCall.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_eq(); + init_isArrayLike(); + init_isIndex(); + init_isObject(); + isIterateeCall_default = isIterateeCall; + } +}); + +// node_modules/lodash-es/_createAssigner.js +function createAssigner(assigner) { + return baseRest_default(function(object, sources) { + var index4 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0; + customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0; + if (guard && isIterateeCall_default(sources[0], sources[1], guard)) { + customizer = length < 3 ? void 0 : customizer; + length = 1; + } + object = Object(object); + while (++index4 < length) { + var source = sources[index4]; + if (source) { + assigner(object, source, index4, customizer); + } + } + return object; + }); +} +var createAssigner_default; +var init_createAssigner = __esm({ + "node_modules/lodash-es/_createAssigner.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_isIterateeCall(); + createAssigner_default = createAssigner; + } +}); + +// node_modules/lodash-es/_isPrototype.js +function isPrototype(value2) { + var Ctor = value2 && value2.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto7; + return value2 === proto; +} +var objectProto7, isPrototype_default; +var init_isPrototype = __esm({ + "node_modules/lodash-es/_isPrototype.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + objectProto7 = Object.prototype; + isPrototype_default = isPrototype; + } +}); + +// node_modules/lodash-es/_baseTimes.js +function baseTimes(n7, iteratee2) { + var index4 = -1, result2 = Array(n7); + while (++index4 < n7) { + result2[index4] = iteratee2(index4); + } + return result2; +} +var baseTimes_default; +var init_baseTimes = __esm({ + "node_modules/lodash-es/_baseTimes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseTimes_default = baseTimes; + } +}); + +// node_modules/lodash-es/_baseIsArguments.js +function baseIsArguments(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == argsTag; +} +var argsTag, baseIsArguments_default; +var init_baseIsArguments = __esm({ + "node_modules/lodash-es/_baseIsArguments.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + argsTag = "[object Arguments]"; + baseIsArguments_default = baseIsArguments; + } +}); + +// node_modules/lodash-es/isArguments.js +var objectProto8, hasOwnProperty6, propertyIsEnumerable, isArguments, isArguments_default; +var init_isArguments = __esm({ + "node_modules/lodash-es/isArguments.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsArguments(); + init_isObjectLike(); + objectProto8 = Object.prototype; + hasOwnProperty6 = objectProto8.hasOwnProperty; + propertyIsEnumerable = objectProto8.propertyIsEnumerable; + isArguments = baseIsArguments_default(/* @__PURE__ */ function() { + return arguments; + }()) ? baseIsArguments_default : function(value2) { + return isObjectLike_default(value2) && hasOwnProperty6.call(value2, "callee") && !propertyIsEnumerable.call(value2, "callee"); + }; + isArguments_default = isArguments; + } +}); + +// node_modules/lodash-es/stubFalse.js +function stubFalse() { + return false; +} +var stubFalse_default; +var init_stubFalse = __esm({ + "node_modules/lodash-es/stubFalse.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stubFalse_default = stubFalse; + } +}); + +// node_modules/lodash-es/isBuffer.js +var freeExports, freeModule, moduleExports, Buffer2, nativeIsBuffer, isBuffer, isBuffer_default; +var init_isBuffer = __esm({ + "node_modules/lodash-es/isBuffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + init_stubFalse(); + freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + moduleExports = freeModule && freeModule.exports === freeExports; + Buffer2 = moduleExports ? root_default.Buffer : void 0; + nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0; + isBuffer = nativeIsBuffer || stubFalse_default; + isBuffer_default = isBuffer; + } +}); + +// node_modules/lodash-es/_baseIsTypedArray.js +function baseIsTypedArray(value2) { + return isObjectLike_default(value2) && isLength_default(value2.length) && !!typedArrayTags[baseGetTag_default(value2)]; +} +var argsTag2, arrayTag, boolTag2, dateTag, errorTag, funcTag2, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, weakMapTag, arrayBufferTag, dataViewTag, float32Tag, float64Tag, int8Tag, int16Tag, int32Tag, uint8Tag, uint8ClampedTag, uint16Tag, uint32Tag, typedArrayTags, baseIsTypedArray_default; +var init_baseIsTypedArray = __esm({ + "node_modules/lodash-es/_baseIsTypedArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isLength(); + init_isObjectLike(); + argsTag2 = "[object Arguments]"; + arrayTag = "[object Array]"; + boolTag2 = "[object Boolean]"; + dateTag = "[object Date]"; + errorTag = "[object Error]"; + funcTag2 = "[object Function]"; + mapTag = "[object Map]"; + numberTag = "[object Number]"; + objectTag = "[object Object]"; + regexpTag = "[object RegExp]"; + setTag = "[object Set]"; + stringTag = "[object String]"; + weakMapTag = "[object WeakMap]"; + arrayBufferTag = "[object ArrayBuffer]"; + dataViewTag = "[object DataView]"; + float32Tag = "[object Float32Array]"; + float64Tag = "[object Float64Array]"; + int8Tag = "[object Int8Array]"; + int16Tag = "[object Int16Array]"; + int32Tag = "[object Int32Array]"; + uint8Tag = "[object Uint8Array]"; + uint8ClampedTag = "[object Uint8ClampedArray]"; + uint16Tag = "[object Uint16Array]"; + uint32Tag = "[object Uint32Array]"; + typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag2] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag2] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag2] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + baseIsTypedArray_default = baseIsTypedArray; + } +}); + +// node_modules/lodash-es/_baseUnary.js +function baseUnary(func) { + return function(value2) { + return func(value2); + }; +} +var baseUnary_default; +var init_baseUnary = __esm({ + "node_modules/lodash-es/_baseUnary.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseUnary_default = baseUnary; + } +}); + +// node_modules/lodash-es/_nodeUtil.js +var freeExports2, freeModule2, moduleExports2, freeProcess, nodeUtil, nodeUtil_default; +var init_nodeUtil = __esm({ + "node_modules/lodash-es/_nodeUtil.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_freeGlobal(); + freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module; + moduleExports2 = freeModule2 && freeModule2.exports === freeExports2; + freeProcess = moduleExports2 && freeGlobal_default.process; + nodeUtil = function() { + try { + var types3 = freeModule2 && freeModule2.require && freeModule2.require("util").types; + if (types3) { + return types3; + } + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch (e10) { + } + }(); + nodeUtil_default = nodeUtil; + } +}); + +// node_modules/lodash-es/isTypedArray.js +var nodeIsTypedArray, isTypedArray, isTypedArray_default; +var init_isTypedArray = __esm({ + "node_modules/lodash-es/isTypedArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsTypedArray(); + init_baseUnary(); + init_nodeUtil(); + nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray; + isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default; + isTypedArray_default = isTypedArray; + } +}); + +// node_modules/lodash-es/_arrayLikeKeys.js +function arrayLikeKeys(value2, inherited) { + var isArr = isArray_default(value2), isArg = !isArr && isArguments_default(value2), isBuff = !isArr && !isArg && isBuffer_default(value2), isType = !isArr && !isArg && !isBuff && isTypedArray_default(value2), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes_default(value2.length, String) : [], length = result2.length; + for (var key in value2) { + if ((inherited || hasOwnProperty7.call(value2, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. + (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. + isIndex_default(key, length)))) { + result2.push(key); + } + } + return result2; +} +var objectProto9, hasOwnProperty7, arrayLikeKeys_default; +var init_arrayLikeKeys = __esm({ + "node_modules/lodash-es/_arrayLikeKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseTimes(); + init_isArguments(); + init_isArray(); + init_isBuffer(); + init_isIndex(); + init_isTypedArray(); + objectProto9 = Object.prototype; + hasOwnProperty7 = objectProto9.hasOwnProperty; + arrayLikeKeys_default = arrayLikeKeys; + } +}); + +// node_modules/lodash-es/_overArg.js +function overArg(func, transform2) { + return function(arg) { + return func(transform2(arg)); + }; +} +var overArg_default; +var init_overArg = __esm({ + "node_modules/lodash-es/_overArg.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + overArg_default = overArg; + } +}); + +// node_modules/lodash-es/_nativeKeys.js +var nativeKeys, nativeKeys_default; +var init_nativeKeys = __esm({ + "node_modules/lodash-es/_nativeKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_overArg(); + nativeKeys = overArg_default(Object.keys, Object); + nativeKeys_default = nativeKeys; + } +}); + +// node_modules/lodash-es/_baseKeys.js +function baseKeys(object) { + if (!isPrototype_default(object)) { + return nativeKeys_default(object); + } + var result2 = []; + for (var key in Object(object)) { + if (hasOwnProperty8.call(object, key) && key != "constructor") { + result2.push(key); + } + } + return result2; +} +var objectProto10, hasOwnProperty8, baseKeys_default; +var init_baseKeys = __esm({ + "node_modules/lodash-es/_baseKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isPrototype(); + init_nativeKeys(); + objectProto10 = Object.prototype; + hasOwnProperty8 = objectProto10.hasOwnProperty; + baseKeys_default = baseKeys; + } +}); + +// node_modules/lodash-es/keys.js +function keys(object) { + return isArrayLike_default(object) ? arrayLikeKeys_default(object) : baseKeys_default(object); +} +var keys_default; +var init_keys = __esm({ + "node_modules/lodash-es/keys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayLikeKeys(); + init_baseKeys(); + init_isArrayLike(); + keys_default = keys; + } +}); + +// node_modules/lodash-es/assign.js +var objectProto11, hasOwnProperty9, assign, assign_default; +var init_assign = __esm({ + "node_modules/lodash-es/assign.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignValue(); + init_copyObject(); + init_createAssigner(); + init_isArrayLike(); + init_isPrototype(); + init_keys(); + objectProto11 = Object.prototype; + hasOwnProperty9 = objectProto11.hasOwnProperty; + assign = createAssigner_default(function(object, source) { + if (isPrototype_default(source) || isArrayLike_default(source)) { + copyObject_default(source, keys_default(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty9.call(source, key)) { + assignValue_default(object, key, source[key]); + } + } + }); + assign_default = assign; + } +}); + +// node_modules/lodash-es/_nativeKeysIn.js +function nativeKeysIn(object) { + var result2 = []; + if (object != null) { + for (var key in Object(object)) { + result2.push(key); + } + } + return result2; +} +var nativeKeysIn_default; +var init_nativeKeysIn = __esm({ + "node_modules/lodash-es/_nativeKeysIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeKeysIn_default = nativeKeysIn; + } +}); + +// node_modules/lodash-es/_baseKeysIn.js +function baseKeysIn(object) { + if (!isObject_default(object)) { + return nativeKeysIn_default(object); + } + var isProto = isPrototype_default(object), result2 = []; + for (var key in object) { + if (!(key == "constructor" && (isProto || !hasOwnProperty10.call(object, key)))) { + result2.push(key); + } + } + return result2; +} +var objectProto12, hasOwnProperty10, baseKeysIn_default; +var init_baseKeysIn = __esm({ + "node_modules/lodash-es/_baseKeysIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isObject(); + init_isPrototype(); + init_nativeKeysIn(); + objectProto12 = Object.prototype; + hasOwnProperty10 = objectProto12.hasOwnProperty; + baseKeysIn_default = baseKeysIn; + } +}); + +// node_modules/lodash-es/keysIn.js +function keysIn(object) { + return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object); +} +var keysIn_default; +var init_keysIn = __esm({ + "node_modules/lodash-es/keysIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayLikeKeys(); + init_baseKeysIn(); + init_isArrayLike(); + keysIn_default = keysIn; + } +}); + +// node_modules/lodash-es/assignIn.js +var assignIn, assignIn_default; +var init_assignIn = __esm({ + "node_modules/lodash-es/assignIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_createAssigner(); + init_keysIn(); + assignIn = createAssigner_default(function(object, source) { + copyObject_default(source, keysIn_default(source), object); + }); + assignIn_default = assignIn; + } +}); + +// node_modules/lodash-es/assignInWith.js +var assignInWith, assignInWith_default; +var init_assignInWith = __esm({ + "node_modules/lodash-es/assignInWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_createAssigner(); + init_keysIn(); + assignInWith = createAssigner_default(function(object, source, srcIndex, customizer) { + copyObject_default(source, keysIn_default(source), object, customizer); + }); + assignInWith_default = assignInWith; + } +}); + +// node_modules/lodash-es/assignWith.js +var assignWith, assignWith_default; +var init_assignWith = __esm({ + "node_modules/lodash-es/assignWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_createAssigner(); + init_keys(); + assignWith = createAssigner_default(function(object, source, srcIndex, customizer) { + copyObject_default(source, keys_default(source), object, customizer); + }); + assignWith_default = assignWith; + } +}); + +// node_modules/lodash-es/_isKey.js +function isKey(value2, object) { + if (isArray_default(value2)) { + return false; + } + var type3 = typeof value2; + if (type3 == "number" || type3 == "symbol" || type3 == "boolean" || value2 == null || isSymbol_default(value2)) { + return true; + } + return reIsPlainProp.test(value2) || !reIsDeepProp.test(value2) || object != null && value2 in Object(object); +} +var reIsDeepProp, reIsPlainProp, isKey_default; +var init_isKey = __esm({ + "node_modules/lodash-es/_isKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArray(); + init_isSymbol(); + reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + reIsPlainProp = /^\w*$/; + isKey_default = isKey; + } +}); + +// node_modules/lodash-es/_nativeCreate.js +var nativeCreate, nativeCreate_default; +var init_nativeCreate = __esm({ + "node_modules/lodash-es/_nativeCreate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + nativeCreate = getNative_default(Object, "create"); + nativeCreate_default = nativeCreate; + } +}); + +// node_modules/lodash-es/_hashClear.js +function hashClear() { + this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {}; + this.size = 0; +} +var hashClear_default; +var init_hashClear = __esm({ + "node_modules/lodash-es/_hashClear.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_nativeCreate(); + hashClear_default = hashClear; + } +}); + +// node_modules/lodash-es/_hashDelete.js +function hashDelete(key) { + var result2 = this.has(key) && delete this.__data__[key]; + this.size -= result2 ? 1 : 0; + return result2; +} +var hashDelete_default; +var init_hashDelete = __esm({ + "node_modules/lodash-es/_hashDelete.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + hashDelete_default = hashDelete; + } +}); + +// node_modules/lodash-es/_hashGet.js +function hashGet(key) { + var data = this.__data__; + if (nativeCreate_default) { + var result2 = data[key]; + return result2 === HASH_UNDEFINED ? void 0 : result2; + } + return hasOwnProperty11.call(data, key) ? data[key] : void 0; +} +var HASH_UNDEFINED, objectProto13, hasOwnProperty11, hashGet_default; +var init_hashGet = __esm({ + "node_modules/lodash-es/_hashGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_nativeCreate(); + HASH_UNDEFINED = "__lodash_hash_undefined__"; + objectProto13 = Object.prototype; + hasOwnProperty11 = objectProto13.hasOwnProperty; + hashGet_default = hashGet; + } +}); + +// node_modules/lodash-es/_hashHas.js +function hashHas(key) { + var data = this.__data__; + return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty12.call(data, key); +} +var objectProto14, hasOwnProperty12, hashHas_default; +var init_hashHas = __esm({ + "node_modules/lodash-es/_hashHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_nativeCreate(); + objectProto14 = Object.prototype; + hasOwnProperty12 = objectProto14.hasOwnProperty; + hashHas_default = hashHas; + } +}); + +// node_modules/lodash-es/_hashSet.js +function hashSet(key, value2) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate_default && value2 === void 0 ? HASH_UNDEFINED2 : value2; + return this; +} +var HASH_UNDEFINED2, hashSet_default; +var init_hashSet = __esm({ + "node_modules/lodash-es/_hashSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_nativeCreate(); + HASH_UNDEFINED2 = "__lodash_hash_undefined__"; + hashSet_default = hashSet; + } +}); + +// node_modules/lodash-es/_Hash.js +function Hash(entries) { + var index4 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } +} +var Hash_default; +var init_Hash = __esm({ + "node_modules/lodash-es/_Hash.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_hashClear(); + init_hashDelete(); + init_hashGet(); + init_hashHas(); + init_hashSet(); + Hash.prototype.clear = hashClear_default; + Hash.prototype["delete"] = hashDelete_default; + Hash.prototype.get = hashGet_default; + Hash.prototype.has = hashHas_default; + Hash.prototype.set = hashSet_default; + Hash_default = Hash; + } +}); + +// node_modules/lodash-es/_listCacheClear.js +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} +var listCacheClear_default; +var init_listCacheClear = __esm({ + "node_modules/lodash-es/_listCacheClear.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + listCacheClear_default = listCacheClear; + } +}); + +// node_modules/lodash-es/_assocIndexOf.js +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq_default(array[length][0], key)) { + return length; + } + } + return -1; +} +var assocIndexOf_default; +var init_assocIndexOf = __esm({ + "node_modules/lodash-es/_assocIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_eq(); + assocIndexOf_default = assocIndexOf; + } +}); + +// node_modules/lodash-es/_listCacheDelete.js +function listCacheDelete(key) { + var data = this.__data__, index4 = assocIndexOf_default(data, key); + if (index4 < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index4 == lastIndex) { + data.pop(); + } else { + splice.call(data, index4, 1); + } + --this.size; + return true; +} +var arrayProto, splice, listCacheDelete_default; +var init_listCacheDelete = __esm({ + "node_modules/lodash-es/_listCacheDelete.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assocIndexOf(); + arrayProto = Array.prototype; + splice = arrayProto.splice; + listCacheDelete_default = listCacheDelete; + } +}); + +// node_modules/lodash-es/_listCacheGet.js +function listCacheGet(key) { + var data = this.__data__, index4 = assocIndexOf_default(data, key); + return index4 < 0 ? void 0 : data[index4][1]; +} +var listCacheGet_default; +var init_listCacheGet = __esm({ + "node_modules/lodash-es/_listCacheGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assocIndexOf(); + listCacheGet_default = listCacheGet; + } +}); + +// node_modules/lodash-es/_listCacheHas.js +function listCacheHas(key) { + return assocIndexOf_default(this.__data__, key) > -1; +} +var listCacheHas_default; +var init_listCacheHas = __esm({ + "node_modules/lodash-es/_listCacheHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assocIndexOf(); + listCacheHas_default = listCacheHas; + } +}); + +// node_modules/lodash-es/_listCacheSet.js +function listCacheSet(key, value2) { + var data = this.__data__, index4 = assocIndexOf_default(data, key); + if (index4 < 0) { + ++this.size; + data.push([key, value2]); + } else { + data[index4][1] = value2; + } + return this; +} +var listCacheSet_default; +var init_listCacheSet = __esm({ + "node_modules/lodash-es/_listCacheSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assocIndexOf(); + listCacheSet_default = listCacheSet; + } +}); + +// node_modules/lodash-es/_ListCache.js +function ListCache(entries) { + var index4 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } +} +var ListCache_default; +var init_ListCache = __esm({ + "node_modules/lodash-es/_ListCache.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_listCacheClear(); + init_listCacheDelete(); + init_listCacheGet(); + init_listCacheHas(); + init_listCacheSet(); + ListCache.prototype.clear = listCacheClear_default; + ListCache.prototype["delete"] = listCacheDelete_default; + ListCache.prototype.get = listCacheGet_default; + ListCache.prototype.has = listCacheHas_default; + ListCache.prototype.set = listCacheSet_default; + ListCache_default = ListCache; + } +}); + +// node_modules/lodash-es/_Map.js +var Map2, Map_default; +var init_Map = __esm({ + "node_modules/lodash-es/_Map.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + init_root(); + Map2 = getNative_default(root_default, "Map"); + Map_default = Map2; + } +}); + +// node_modules/lodash-es/_mapCacheClear.js +function mapCacheClear() { + this.size = 0; + this.__data__ = { + "hash": new Hash_default(), + "map": new (Map_default || ListCache_default)(), + "string": new Hash_default() + }; +} +var mapCacheClear_default; +var init_mapCacheClear = __esm({ + "node_modules/lodash-es/_mapCacheClear.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Hash(); + init_ListCache(); + init_Map(); + mapCacheClear_default = mapCacheClear; + } +}); + +// node_modules/lodash-es/_isKeyable.js +function isKeyable(value2) { + var type3 = typeof value2; + return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null; +} +var isKeyable_default; +var init_isKeyable = __esm({ + "node_modules/lodash-es/_isKeyable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isKeyable_default = isKeyable; + } +}); + +// node_modules/lodash-es/_getMapData.js +function getMapData(map4, key) { + var data = map4.__data__; + return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; +} +var getMapData_default; +var init_getMapData = __esm({ + "node_modules/lodash-es/_getMapData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isKeyable(); + getMapData_default = getMapData; + } +}); + +// node_modules/lodash-es/_mapCacheDelete.js +function mapCacheDelete(key) { + var result2 = getMapData_default(this, key)["delete"](key); + this.size -= result2 ? 1 : 0; + return result2; +} +var mapCacheDelete_default; +var init_mapCacheDelete = __esm({ + "node_modules/lodash-es/_mapCacheDelete.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getMapData(); + mapCacheDelete_default = mapCacheDelete; + } +}); + +// node_modules/lodash-es/_mapCacheGet.js +function mapCacheGet(key) { + return getMapData_default(this, key).get(key); +} +var mapCacheGet_default; +var init_mapCacheGet = __esm({ + "node_modules/lodash-es/_mapCacheGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getMapData(); + mapCacheGet_default = mapCacheGet; + } +}); + +// node_modules/lodash-es/_mapCacheHas.js +function mapCacheHas(key) { + return getMapData_default(this, key).has(key); +} +var mapCacheHas_default; +var init_mapCacheHas = __esm({ + "node_modules/lodash-es/_mapCacheHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getMapData(); + mapCacheHas_default = mapCacheHas; + } +}); + +// node_modules/lodash-es/_mapCacheSet.js +function mapCacheSet(key, value2) { + var data = getMapData_default(this, key), size2 = data.size; + data.set(key, value2); + this.size += data.size == size2 ? 0 : 1; + return this; +} +var mapCacheSet_default; +var init_mapCacheSet = __esm({ + "node_modules/lodash-es/_mapCacheSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getMapData(); + mapCacheSet_default = mapCacheSet; + } +}); + +// node_modules/lodash-es/_MapCache.js +function MapCache(entries) { + var index4 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } +} +var MapCache_default; +var init_MapCache = __esm({ + "node_modules/lodash-es/_MapCache.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mapCacheClear(); + init_mapCacheDelete(); + init_mapCacheGet(); + init_mapCacheHas(); + init_mapCacheSet(); + MapCache.prototype.clear = mapCacheClear_default; + MapCache.prototype["delete"] = mapCacheDelete_default; + MapCache.prototype.get = mapCacheGet_default; + MapCache.prototype.has = mapCacheHas_default; + MapCache.prototype.set = mapCacheSet_default; + MapCache_default = MapCache; + } +}); + +// node_modules/lodash-es/memoize.js +function memoize(func, resolver) { + if (typeof func != "function" || resolver != null && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT3); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result2 = func.apply(this, args); + memoized.cache = cache.set(key, result2) || cache; + return result2; + }; + memoized.cache = new (memoize.Cache || MapCache_default)(); + return memoized; +} +var FUNC_ERROR_TEXT3, memoize_default; +var init_memoize = __esm({ + "node_modules/lodash-es/memoize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_MapCache(); + FUNC_ERROR_TEXT3 = "Expected a function"; + memoize.Cache = MapCache_default; + memoize_default = memoize; + } +}); + +// node_modules/lodash-es/_memoizeCapped.js +function memoizeCapped(func) { + var result2 = memoize_default(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + var cache = result2.cache; + return result2; +} +var MAX_MEMOIZE_SIZE, memoizeCapped_default; +var init_memoizeCapped = __esm({ + "node_modules/lodash-es/_memoizeCapped.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_memoize(); + MAX_MEMOIZE_SIZE = 500; + memoizeCapped_default = memoizeCapped; + } +}); + +// node_modules/lodash-es/_stringToPath.js +var rePropName, reEscapeChar, stringToPath, stringToPath_default; +var init_stringToPath = __esm({ + "node_modules/lodash-es/_stringToPath.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_memoizeCapped(); + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + reEscapeChar = /\\(\\)?/g; + stringToPath = memoizeCapped_default(function(string2) { + var result2 = []; + if (string2.charCodeAt(0) === 46) { + result2.push(""); + } + string2.replace(rePropName, function(match, number, quote, subString) { + result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); + }); + return result2; + }); + stringToPath_default = stringToPath; + } +}); + +// node_modules/lodash-es/toString.js +function toString(value2) { + return value2 == null ? "" : baseToString_default(value2); +} +var toString_default; +var init_toString = __esm({ + "node_modules/lodash-es/toString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + toString_default = toString; + } +}); + +// node_modules/lodash-es/_castPath.js +function castPath(value2, object) { + if (isArray_default(value2)) { + return value2; + } + return isKey_default(value2, object) ? [value2] : stringToPath_default(toString_default(value2)); +} +var castPath_default; +var init_castPath = __esm({ + "node_modules/lodash-es/_castPath.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArray(); + init_isKey(); + init_stringToPath(); + init_toString(); + castPath_default = castPath; + } +}); + +// node_modules/lodash-es/_toKey.js +function toKey(value2) { + if (typeof value2 == "string" || isSymbol_default(value2)) { + return value2; + } + var result2 = value2 + ""; + return result2 == "0" && 1 / value2 == -INFINITY3 ? "-0" : result2; +} +var INFINITY3, toKey_default; +var init_toKey = __esm({ + "node_modules/lodash-es/_toKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isSymbol(); + INFINITY3 = 1 / 0; + toKey_default = toKey; + } +}); + +// node_modules/lodash-es/_baseGet.js +function baseGet(object, path2) { + path2 = castPath_default(path2, object); + var index4 = 0, length = path2.length; + while (object != null && index4 < length) { + object = object[toKey_default(path2[index4++])]; + } + return index4 && index4 == length ? object : void 0; +} +var baseGet_default; +var init_baseGet = __esm({ + "node_modules/lodash-es/_baseGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castPath(); + init_toKey(); + baseGet_default = baseGet; + } +}); + +// node_modules/lodash-es/get.js +var get_exports = {}; +__export(get_exports, { + default: () => get_default +}); +function get(object, path2, defaultValue) { + var result2 = object == null ? void 0 : baseGet_default(object, path2); + return result2 === void 0 ? defaultValue : result2; +} +var get_default; +var init_get = __esm({ + "node_modules/lodash-es/get.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + get_default = get; + } +}); + +// node_modules/lodash-es/_baseAt.js +function baseAt(object, paths) { + var index4 = -1, length = paths.length, result2 = Array(length), skip = object == null; + while (++index4 < length) { + result2[index4] = skip ? void 0 : get_default(object, paths[index4]); + } + return result2; +} +var baseAt_default; +var init_baseAt = __esm({ + "node_modules/lodash-es/_baseAt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_get(); + baseAt_default = baseAt; + } +}); + +// node_modules/lodash-es/_arrayPush.js +function arrayPush(array, values2) { + var index4 = -1, length = values2.length, offset = array.length; + while (++index4 < length) { + array[offset + index4] = values2[index4]; + } + return array; +} +var arrayPush_default; +var init_arrayPush = __esm({ + "node_modules/lodash-es/_arrayPush.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayPush_default = arrayPush; + } +}); + +// node_modules/lodash-es/_isFlattenable.js +function isFlattenable(value2) { + return isArray_default(value2) || isArguments_default(value2) || !!(spreadableSymbol && value2 && value2[spreadableSymbol]); +} +var spreadableSymbol, isFlattenable_default; +var init_isFlattenable = __esm({ + "node_modules/lodash-es/_isFlattenable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + init_isArguments(); + init_isArray(); + spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0; + isFlattenable_default = isFlattenable; + } +}); + +// node_modules/lodash-es/_baseFlatten.js +function baseFlatten(array, depth, predicate, isStrict, result2) { + var index4 = -1, length = array.length; + predicate || (predicate = isFlattenable_default); + result2 || (result2 = []); + while (++index4 < length) { + var value2 = array[index4]; + if (depth > 0 && predicate(value2)) { + if (depth > 1) { + baseFlatten(value2, depth - 1, predicate, isStrict, result2); + } else { + arrayPush_default(result2, value2); + } + } else if (!isStrict) { + result2[result2.length] = value2; + } + } + return result2; +} +var baseFlatten_default; +var init_baseFlatten = __esm({ + "node_modules/lodash-es/_baseFlatten.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayPush(); + init_isFlattenable(); + baseFlatten_default = baseFlatten; + } +}); + +// node_modules/lodash-es/flatten.js +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten_default(array, 1) : []; +} +var flatten_default; +var init_flatten = __esm({ + "node_modules/lodash-es/flatten.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + flatten_default = flatten; + } +}); + +// node_modules/lodash-es/_flatRest.js +function flatRest(func) { + return setToString_default(overRest_default(func, void 0, flatten_default), func + ""); +} +var flatRest_default; +var init_flatRest = __esm({ + "node_modules/lodash-es/_flatRest.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_flatten(); + init_overRest(); + init_setToString(); + flatRest_default = flatRest; + } +}); + +// node_modules/lodash-es/at.js +var at, at_default; +var init_at = __esm({ + "node_modules/lodash-es/at.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAt(); + init_flatRest(); + at = flatRest_default(baseAt_default); + at_default = at; + } +}); + +// node_modules/lodash-es/_getPrototype.js +var getPrototype, getPrototype_default; +var init_getPrototype = __esm({ + "node_modules/lodash-es/_getPrototype.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_overArg(); + getPrototype = overArg_default(Object.getPrototypeOf, Object); + getPrototype_default = getPrototype; + } +}); + +// node_modules/lodash-es/isPlainObject.js +function isPlainObject(value2) { + if (!isObjectLike_default(value2) || baseGetTag_default(value2) != objectTag2) { + return false; + } + var proto = getPrototype_default(value2); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty13.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString; +} +var objectTag2, funcProto3, objectProto15, funcToString3, hasOwnProperty13, objectCtorString, isPlainObject_default; +var init_isPlainObject = __esm({ + "node_modules/lodash-es/isPlainObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_getPrototype(); + init_isObjectLike(); + objectTag2 = "[object Object]"; + funcProto3 = Function.prototype; + objectProto15 = Object.prototype; + funcToString3 = funcProto3.toString; + hasOwnProperty13 = objectProto15.hasOwnProperty; + objectCtorString = funcToString3.call(Object); + isPlainObject_default = isPlainObject; + } +}); + +// node_modules/lodash-es/isError.js +function isError(value2) { + if (!isObjectLike_default(value2)) { + return false; + } + var tag = baseGetTag_default(value2); + return tag == errorTag2 || tag == domExcTag || typeof value2.message == "string" && typeof value2.name == "string" && !isPlainObject_default(value2); +} +var domExcTag, errorTag2, isError_default; +var init_isError = __esm({ + "node_modules/lodash-es/isError.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + init_isPlainObject(); + domExcTag = "[object DOMException]"; + errorTag2 = "[object Error]"; + isError_default = isError; + } +}); + +// node_modules/lodash-es/attempt.js +var attempt, attempt_default; +var init_attempt = __esm({ + "node_modules/lodash-es/attempt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_baseRest(); + init_isError(); + attempt = baseRest_default(function(func, args) { + try { + return apply_default(func, void 0, args); + } catch (e10) { + return isError_default(e10) ? e10 : new Error(e10); + } + }); + attempt_default = attempt; + } +}); + +// node_modules/lodash-es/before.js +function before(n7, func) { + var result2; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT4); + } + n7 = toInteger_default(n7); + return function() { + if (--n7 > 0) { + result2 = func.apply(this, arguments); + } + if (n7 <= 1) { + func = void 0; + } + return result2; + }; +} +var FUNC_ERROR_TEXT4, before_default; +var init_before = __esm({ + "node_modules/lodash-es/before.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toInteger(); + FUNC_ERROR_TEXT4 = "Expected a function"; + before_default = before; + } +}); + +// node_modules/lodash-es/bind.js +var WRAP_BIND_FLAG8, WRAP_PARTIAL_FLAG4, bind, bind_default; +var init_bind = __esm({ + "node_modules/lodash-es/bind.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_createWrap(); + init_getHolder(); + init_replaceHolders(); + WRAP_BIND_FLAG8 = 1; + WRAP_PARTIAL_FLAG4 = 32; + bind = baseRest_default(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG8; + if (partials.length) { + var holders = replaceHolders_default(partials, getHolder_default(bind)); + bitmask |= WRAP_PARTIAL_FLAG4; + } + return createWrap_default(func, bitmask, thisArg, partials, holders); + }); + bind.placeholder = {}; + bind_default = bind; + } +}); + +// node_modules/lodash-es/bindAll.js +var bindAll, bindAll_default; +var init_bindAll = __esm({ + "node_modules/lodash-es/bindAll.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_baseAssignValue(); + init_bind(); + init_flatRest(); + init_toKey(); + bindAll = flatRest_default(function(object, methodNames) { + arrayEach_default(methodNames, function(key) { + key = toKey_default(key); + baseAssignValue_default(object, key, bind_default(object[key], object)); + }); + return object; + }); + bindAll_default = bindAll; + } +}); + +// node_modules/lodash-es/bindKey.js +var WRAP_BIND_FLAG9, WRAP_BIND_KEY_FLAG6, WRAP_PARTIAL_FLAG5, bindKey, bindKey_default; +var init_bindKey = __esm({ + "node_modules/lodash-es/bindKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_createWrap(); + init_getHolder(); + init_replaceHolders(); + WRAP_BIND_FLAG9 = 1; + WRAP_BIND_KEY_FLAG6 = 2; + WRAP_PARTIAL_FLAG5 = 32; + bindKey = baseRest_default(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG9 | WRAP_BIND_KEY_FLAG6; + if (partials.length) { + var holders = replaceHolders_default(partials, getHolder_default(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG5; + } + return createWrap_default(key, bitmask, object, partials, holders); + }); + bindKey.placeholder = {}; + bindKey_default = bindKey; + } +}); + +// node_modules/lodash-es/_baseSlice.js +function baseSlice(array, start, end) { + var index4 = -1, length = array.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 (++index4 < length) { + result2[index4] = array[index4 + start]; + } + return result2; +} +var baseSlice_default; +var init_baseSlice = __esm({ + "node_modules/lodash-es/_baseSlice.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseSlice_default = baseSlice; + } +}); + +// node_modules/lodash-es/_castSlice.js +function castSlice(array, start, end) { + var length = array.length; + end = end === void 0 ? length : end; + return !start && end >= length ? array : baseSlice_default(array, start, end); +} +var castSlice_default; +var init_castSlice = __esm({ + "node_modules/lodash-es/_castSlice.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + castSlice_default = castSlice; + } +}); + +// node_modules/lodash-es/_hasUnicode.js +function hasUnicode(string2) { + return reHasUnicode.test(string2); +} +var rsAstralRange, rsComboMarksRange, reComboHalfMarksRange, rsComboSymbolsRange, rsComboRange, rsVarRange, rsZWJ, reHasUnicode, hasUnicode_default; +var init_hasUnicode = __esm({ + "node_modules/lodash-es/_hasUnicode.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + rsAstralRange = "\\ud800-\\udfff"; + rsComboMarksRange = "\\u0300-\\u036f"; + reComboHalfMarksRange = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange = "\\u20d0-\\u20ff"; + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + rsVarRange = "\\ufe0e\\ufe0f"; + rsZWJ = "\\u200d"; + reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); + hasUnicode_default = hasUnicode; + } +}); + +// node_modules/lodash-es/_asciiToArray.js +function asciiToArray(string2) { + return string2.split(""); +} +var asciiToArray_default; +var init_asciiToArray = __esm({ + "node_modules/lodash-es/_asciiToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + asciiToArray_default = asciiToArray; + } +}); + +// node_modules/lodash-es/_unicodeToArray.js +function unicodeToArray(string2) { + return string2.match(reUnicode) || []; +} +var rsAstralRange2, rsComboMarksRange2, reComboHalfMarksRange2, rsComboSymbolsRange2, rsComboRange2, rsVarRange2, rsAstral, rsCombo, rsFitz, rsModifier, rsNonAstral, rsRegional, rsSurrPair, rsZWJ2, reOptMod, rsOptVar, rsOptJoin, rsSeq, rsSymbol, reUnicode, unicodeToArray_default; +var init_unicodeToArray = __esm({ + "node_modules/lodash-es/_unicodeToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + rsAstralRange2 = "\\ud800-\\udfff"; + rsComboMarksRange2 = "\\u0300-\\u036f"; + reComboHalfMarksRange2 = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange2 = "\\u20d0-\\u20ff"; + rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2; + rsVarRange2 = "\\ufe0e\\ufe0f"; + rsAstral = "[" + rsAstralRange2 + "]"; + rsCombo = "[" + rsComboRange2 + "]"; + rsFitz = "\\ud83c[\\udffb-\\udfff]"; + rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + rsNonAstral = "[^" + rsAstralRange2 + "]"; + rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + rsZWJ2 = "\\u200d"; + reOptMod = rsModifier + "?"; + rsOptVar = "[" + rsVarRange2 + "]?"; + rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + rsSeq = rsOptVar + reOptMod + rsOptJoin; + rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + unicodeToArray_default = unicodeToArray; + } +}); + +// node_modules/lodash-es/_stringToArray.js +function stringToArray(string2) { + return hasUnicode_default(string2) ? unicodeToArray_default(string2) : asciiToArray_default(string2); +} +var stringToArray_default; +var init_stringToArray = __esm({ + "node_modules/lodash-es/_stringToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asciiToArray(); + init_hasUnicode(); + init_unicodeToArray(); + stringToArray_default = stringToArray; + } +}); + +// node_modules/lodash-es/_createCaseFirst.js +function createCaseFirst(methodName) { + return function(string2) { + string2 = toString_default(string2); + var strSymbols = hasUnicode_default(string2) ? stringToArray_default(string2) : void 0; + var chr = strSymbols ? strSymbols[0] : string2.charAt(0); + var trailing = strSymbols ? castSlice_default(strSymbols, 1).join("") : string2.slice(1); + return chr[methodName]() + trailing; + }; +} +var createCaseFirst_default; +var init_createCaseFirst = __esm({ + "node_modules/lodash-es/_createCaseFirst.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castSlice(); + init_hasUnicode(); + init_stringToArray(); + init_toString(); + createCaseFirst_default = createCaseFirst; + } +}); + +// node_modules/lodash-es/upperFirst.js +var upperFirst, upperFirst_default; +var init_upperFirst = __esm({ + "node_modules/lodash-es/upperFirst.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCaseFirst(); + upperFirst = createCaseFirst_default("toUpperCase"); + upperFirst_default = upperFirst; + } +}); + +// node_modules/lodash-es/capitalize.js +function capitalize(string2) { + return upperFirst_default(toString_default(string2).toLowerCase()); +} +var capitalize_default; +var init_capitalize = __esm({ + "node_modules/lodash-es/capitalize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + init_upperFirst(); + capitalize_default = capitalize; + } +}); + +// node_modules/lodash-es/_arrayReduce.js +function arrayReduce(array, iteratee2, accumulator, initAccum) { + var index4 = -1, length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[++index4]; + } + while (++index4 < length) { + accumulator = iteratee2(accumulator, array[index4], index4, array); + } + return accumulator; +} +var arrayReduce_default; +var init_arrayReduce = __esm({ + "node_modules/lodash-es/_arrayReduce.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayReduce_default = arrayReduce; + } +}); + +// node_modules/lodash-es/_basePropertyOf.js +function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; +} +var basePropertyOf_default; +var init_basePropertyOf = __esm({ + "node_modules/lodash-es/_basePropertyOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + basePropertyOf_default = basePropertyOf; + } +}); + +// node_modules/lodash-es/_deburrLetter.js +var deburredLetters, deburrLetter, deburrLetter_default; +var init_deburrLetter = __esm({ + "node_modules/lodash-es/_deburrLetter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePropertyOf(); + deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "s" + }; + deburrLetter = basePropertyOf_default(deburredLetters); + deburrLetter_default = deburrLetter; + } +}); + +// node_modules/lodash-es/deburr.js +function deburr(string2) { + string2 = toString_default(string2); + return string2 && string2.replace(reLatin, deburrLetter_default).replace(reComboMark, ""); +} +var reLatin, rsComboMarksRange3, reComboHalfMarksRange3, rsComboSymbolsRange3, rsComboRange3, rsCombo2, reComboMark, deburr_default; +var init_deburr = __esm({ + "node_modules/lodash-es/deburr.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_deburrLetter(); + init_toString(); + reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + rsComboMarksRange3 = "\\u0300-\\u036f"; + reComboHalfMarksRange3 = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange3 = "\\u20d0-\\u20ff"; + rsComboRange3 = rsComboMarksRange3 + reComboHalfMarksRange3 + rsComboSymbolsRange3; + rsCombo2 = "[" + rsComboRange3 + "]"; + reComboMark = RegExp(rsCombo2, "g"); + deburr_default = deburr; + } +}); + +// node_modules/lodash-es/_asciiWords.js +function asciiWords(string2) { + return string2.match(reAsciiWord) || []; +} +var reAsciiWord, asciiWords_default; +var init_asciiWords = __esm({ + "node_modules/lodash-es/_asciiWords.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + asciiWords_default = asciiWords; + } +}); + +// node_modules/lodash-es/_hasUnicodeWord.js +function hasUnicodeWord(string2) { + return reHasUnicodeWord.test(string2); +} +var reHasUnicodeWord, hasUnicodeWord_default; +var init_hasUnicodeWord = __esm({ + "node_modules/lodash-es/_hasUnicodeWord.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + hasUnicodeWord_default = hasUnicodeWord; + } +}); + +// node_modules/lodash-es/_unicodeWords.js +function unicodeWords(string2) { + return string2.match(reUnicodeWord) || []; +} +var rsAstralRange3, rsComboMarksRange4, reComboHalfMarksRange4, rsComboSymbolsRange4, rsComboRange4, rsDingbatRange, rsLowerRange, rsMathOpRange, rsNonCharRange, rsPunctuationRange, rsSpaceRange, rsUpperRange, rsVarRange3, rsBreakRange, rsApos, rsBreak, rsCombo3, rsDigits, rsDingbat, rsLower, rsMisc, rsFitz2, rsModifier2, rsNonAstral2, rsRegional2, rsSurrPair2, rsUpper, rsZWJ3, rsMiscLower, rsMiscUpper, rsOptContrLower, rsOptContrUpper, reOptMod2, rsOptVar2, rsOptJoin2, rsOrdLower, rsOrdUpper, rsSeq2, rsEmoji, reUnicodeWord, unicodeWords_default; +var init_unicodeWords = __esm({ + "node_modules/lodash-es/_unicodeWords.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + rsAstralRange3 = "\\ud800-\\udfff"; + rsComboMarksRange4 = "\\u0300-\\u036f"; + reComboHalfMarksRange4 = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange4 = "\\u20d0-\\u20ff"; + rsComboRange4 = rsComboMarksRange4 + reComboHalfMarksRange4 + rsComboSymbolsRange4; + rsDingbatRange = "\\u2700-\\u27bf"; + rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff"; + rsMathOpRange = "\\xac\\xb1\\xd7\\xf7"; + rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"; + rsPunctuationRange = "\\u2000-\\u206f"; + 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"; + rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + rsVarRange3 = "\\ufe0e\\ufe0f"; + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + rsApos = "['\u2019]"; + rsBreak = "[" + rsBreakRange + "]"; + rsCombo3 = "[" + rsComboRange4 + "]"; + rsDigits = "\\d+"; + rsDingbat = "[" + rsDingbatRange + "]"; + rsLower = "[" + rsLowerRange + "]"; + rsMisc = "[^" + rsAstralRange3 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]"; + rsFitz2 = "\\ud83c[\\udffb-\\udfff]"; + rsModifier2 = "(?:" + rsCombo3 + "|" + rsFitz2 + ")"; + rsNonAstral2 = "[^" + rsAstralRange3 + "]"; + rsRegional2 = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + rsSurrPair2 = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + rsUpper = "[" + rsUpperRange + "]"; + rsZWJ3 = "\\u200d"; + rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")"; + rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")"; + rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?"; + rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?"; + reOptMod2 = rsModifier2 + "?"; + rsOptVar2 = "[" + rsVarRange3 + "]?"; + rsOptJoin2 = "(?:" + rsZWJ3 + "(?:" + [rsNonAstral2, rsRegional2, rsSurrPair2].join("|") + ")" + rsOptVar2 + reOptMod2 + ")*"; + rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])"; + rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])"; + rsSeq2 = rsOptVar2 + reOptMod2 + rsOptJoin2; + rsEmoji = "(?:" + [rsDingbat, rsRegional2, rsSurrPair2].join("|") + ")" + rsSeq2; + reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", + rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, + rsUpper + "+" + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join("|"), "g"); + unicodeWords_default = unicodeWords; + } +}); + +// node_modules/lodash-es/words.js +function words(string2, pattern5, guard) { + string2 = toString_default(string2); + pattern5 = guard ? void 0 : pattern5; + if (pattern5 === void 0) { + return hasUnicodeWord_default(string2) ? unicodeWords_default(string2) : asciiWords_default(string2); + } + return string2.match(pattern5) || []; +} +var words_default; +var init_words = __esm({ + "node_modules/lodash-es/words.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asciiWords(); + init_hasUnicodeWord(); + init_toString(); + init_unicodeWords(); + words_default = words; + } +}); + +// node_modules/lodash-es/_createCompounder.js +function createCompounder(callback) { + return function(string2) { + return arrayReduce_default(words_default(deburr_default(string2).replace(reApos, "")), callback, ""); + }; +} +var rsApos2, reApos, createCompounder_default; +var init_createCompounder = __esm({ + "node_modules/lodash-es/_createCompounder.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayReduce(); + init_deburr(); + init_words(); + rsApos2 = "['\u2019]"; + reApos = RegExp(rsApos2, "g"); + createCompounder_default = createCompounder; + } +}); + +// node_modules/lodash-es/camelCase.js +var camelCase, camelCase_default; +var init_camelCase = __esm({ + "node_modules/lodash-es/camelCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_capitalize(); + init_createCompounder(); + camelCase = createCompounder_default(function(result2, word, index4) { + word = word.toLowerCase(); + return result2 + (index4 ? capitalize_default(word) : word); + }); + camelCase_default = camelCase; + } +}); + +// node_modules/lodash-es/castArray.js +function castArray() { + if (!arguments.length) { + return []; + } + var value2 = arguments[0]; + return isArray_default(value2) ? value2 : [value2]; +} +var castArray_default; +var init_castArray = __esm({ + "node_modules/lodash-es/castArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArray(); + castArray_default = castArray; + } +}); + +// node_modules/lodash-es/_createRound.js +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber_default(number); + precision = precision == null ? 0 : nativeMin3(toInteger_default(precision), 292); + if (precision && nativeIsFinite(number)) { + var pair = (toString_default(number) + "e").split("e"), value2 = func(pair[0] + "e" + (+pair[1] + precision)); + pair = (toString_default(value2) + "e").split("e"); + return +(pair[0] + "e" + (+pair[1] - precision)); + } + return func(number); + }; +} +var nativeIsFinite, nativeMin3, createRound_default; +var init_createRound = __esm({ + "node_modules/lodash-es/_createRound.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + init_toInteger(); + init_toNumber(); + init_toString(); + nativeIsFinite = root_default.isFinite; + nativeMin3 = Math.min; + createRound_default = createRound; + } +}); + +// node_modules/lodash-es/ceil.js +var ceil, ceil_default; +var init_ceil = __esm({ + "node_modules/lodash-es/ceil.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRound(); + ceil = createRound_default("ceil"); + ceil_default = ceil; + } +}); + +// node_modules/lodash-es/chain.js +function chain(value2) { + var result2 = wrapperLodash_default(value2); + result2.__chain__ = true; + return result2; +} +var chain_default; +var init_chain = __esm({ + "node_modules/lodash-es/chain.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_wrapperLodash(); + chain_default = chain; + } +}); + +// node_modules/lodash-es/chunk.js +function chunk(array, size2, guard) { + if (guard ? isIterateeCall_default(array, size2, guard) : size2 === void 0) { + size2 = 1; + } else { + size2 = nativeMax5(toInteger_default(size2), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size2 < 1) { + return []; + } + var index4 = 0, resIndex = 0, result2 = Array(nativeCeil(length / size2)); + while (index4 < length) { + result2[resIndex++] = baseSlice_default(array, index4, index4 += size2); + } + return result2; +} +var nativeCeil, nativeMax5, chunk_default; +var init_chunk = __esm({ + "node_modules/lodash-es/chunk.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_isIterateeCall(); + init_toInteger(); + nativeCeil = Math.ceil; + nativeMax5 = Math.max; + chunk_default = chunk; + } +}); + +// node_modules/lodash-es/_baseClamp.js +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== void 0) { + number = number <= upper ? number : upper; + } + if (lower !== void 0) { + number = number >= lower ? number : lower; + } + } + return number; +} +var baseClamp_default; +var init_baseClamp = __esm({ + "node_modules/lodash-es/_baseClamp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseClamp_default = baseClamp; + } +}); + +// node_modules/lodash-es/clamp.js +function clamp(number, lower, upper) { + if (upper === void 0) { + upper = lower; + lower = void 0; + } + if (upper !== void 0) { + upper = toNumber_default(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== void 0) { + lower = toNumber_default(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp_default(toNumber_default(number), lower, upper); +} +var clamp_default; +var init_clamp = __esm({ + "node_modules/lodash-es/clamp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_toNumber(); + clamp_default = clamp; + } +}); + +// node_modules/lodash-es/_stackClear.js +function stackClear() { + this.__data__ = new ListCache_default(); + this.size = 0; +} +var stackClear_default; +var init_stackClear = __esm({ + "node_modules/lodash-es/_stackClear.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ListCache(); + stackClear_default = stackClear; + } +}); + +// node_modules/lodash-es/_stackDelete.js +function stackDelete(key) { + var data = this.__data__, result2 = data["delete"](key); + this.size = data.size; + return result2; +} +var stackDelete_default; +var init_stackDelete = __esm({ + "node_modules/lodash-es/_stackDelete.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stackDelete_default = stackDelete; + } +}); + +// node_modules/lodash-es/_stackGet.js +function stackGet(key) { + return this.__data__.get(key); +} +var stackGet_default; +var init_stackGet = __esm({ + "node_modules/lodash-es/_stackGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stackGet_default = stackGet; + } +}); + +// node_modules/lodash-es/_stackHas.js +function stackHas(key) { + return this.__data__.has(key); +} +var stackHas_default; +var init_stackHas = __esm({ + "node_modules/lodash-es/_stackHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stackHas_default = stackHas; + } +}); + +// node_modules/lodash-es/_stackSet.js +function stackSet(key, value2) { + var data = this.__data__; + if (data instanceof ListCache_default) { + var pairs3 = data.__data__; + if (!Map_default || pairs3.length < LARGE_ARRAY_SIZE - 1) { + pairs3.push([key, value2]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache_default(pairs3); + } + data.set(key, value2); + this.size = data.size; + return this; +} +var LARGE_ARRAY_SIZE, stackSet_default; +var init_stackSet = __esm({ + "node_modules/lodash-es/_stackSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ListCache(); + init_Map(); + init_MapCache(); + LARGE_ARRAY_SIZE = 200; + stackSet_default = stackSet; + } +}); + +// node_modules/lodash-es/_Stack.js +function Stack(entries) { + var data = this.__data__ = new ListCache_default(entries); + this.size = data.size; +} +var Stack_default; +var init_Stack = __esm({ + "node_modules/lodash-es/_Stack.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ListCache(); + init_stackClear(); + init_stackDelete(); + init_stackGet(); + init_stackHas(); + init_stackSet(); + Stack.prototype.clear = stackClear_default; + Stack.prototype["delete"] = stackDelete_default; + Stack.prototype.get = stackGet_default; + Stack.prototype.has = stackHas_default; + Stack.prototype.set = stackSet_default; + Stack_default = Stack; + } +}); + +// node_modules/lodash-es/_baseAssign.js +function baseAssign(object, source) { + return object && copyObject_default(source, keys_default(source), object); +} +var baseAssign_default; +var init_baseAssign = __esm({ + "node_modules/lodash-es/_baseAssign.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_keys(); + baseAssign_default = baseAssign; + } +}); + +// node_modules/lodash-es/_baseAssignIn.js +function baseAssignIn(object, source) { + return object && copyObject_default(source, keysIn_default(source), object); +} +var baseAssignIn_default; +var init_baseAssignIn = __esm({ + "node_modules/lodash-es/_baseAssignIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_keysIn(); + baseAssignIn_default = baseAssignIn; + } +}); + +// node_modules/lodash-es/_cloneBuffer.js +function cloneBuffer(buffer2, isDeep) { + if (isDeep) { + return buffer2.slice(); + } + var length = buffer2.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer2.constructor(length); + buffer2.copy(result2); + return result2; +} +var freeExports3, freeModule3, moduleExports3, Buffer3, allocUnsafe, cloneBuffer_default; +var init_cloneBuffer = __esm({ + "node_modules/lodash-es/_cloneBuffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports; + freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module; + moduleExports3 = freeModule3 && freeModule3.exports === freeExports3; + Buffer3 = moduleExports3 ? root_default.Buffer : void 0; + allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : void 0; + cloneBuffer_default = cloneBuffer; + } +}); + +// node_modules/lodash-es/_arrayFilter.js +function arrayFilter(array, predicate) { + var index4 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; + while (++index4 < length) { + var value2 = array[index4]; + if (predicate(value2, index4, array)) { + result2[resIndex++] = value2; + } + } + return result2; +} +var arrayFilter_default; +var init_arrayFilter = __esm({ + "node_modules/lodash-es/_arrayFilter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayFilter_default = arrayFilter; + } +}); + +// node_modules/lodash-es/stubArray.js +function stubArray() { + return []; +} +var stubArray_default; +var init_stubArray = __esm({ + "node_modules/lodash-es/stubArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stubArray_default = stubArray; + } +}); + +// node_modules/lodash-es/_getSymbols.js +var objectProto16, propertyIsEnumerable2, nativeGetSymbols, getSymbols, getSymbols_default; +var init_getSymbols = __esm({ + "node_modules/lodash-es/_getSymbols.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_stubArray(); + objectProto16 = Object.prototype; + propertyIsEnumerable2 = objectProto16.propertyIsEnumerable; + nativeGetSymbols = Object.getOwnPropertySymbols; + getSymbols = !nativeGetSymbols ? stubArray_default : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter_default(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable2.call(object, symbol); + }); + }; + getSymbols_default = getSymbols; + } +}); + +// node_modules/lodash-es/_copySymbols.js +function copySymbols(source, object) { + return copyObject_default(source, getSymbols_default(source), object); +} +var copySymbols_default; +var init_copySymbols = __esm({ + "node_modules/lodash-es/_copySymbols.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_getSymbols(); + copySymbols_default = copySymbols; + } +}); + +// node_modules/lodash-es/_getSymbolsIn.js +var nativeGetSymbols2, getSymbolsIn, getSymbolsIn_default; +var init_getSymbolsIn = __esm({ + "node_modules/lodash-es/_getSymbolsIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayPush(); + init_getPrototype(); + init_getSymbols(); + init_stubArray(); + nativeGetSymbols2 = Object.getOwnPropertySymbols; + getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object) { + var result2 = []; + while (object) { + arrayPush_default(result2, getSymbols_default(object)); + object = getPrototype_default(object); + } + return result2; + }; + getSymbolsIn_default = getSymbolsIn; + } +}); + +// node_modules/lodash-es/_copySymbolsIn.js +function copySymbolsIn(source, object) { + return copyObject_default(source, getSymbolsIn_default(source), object); +} +var copySymbolsIn_default; +var init_copySymbolsIn = __esm({ + "node_modules/lodash-es/_copySymbolsIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_getSymbolsIn(); + copySymbolsIn_default = copySymbolsIn; + } +}); + +// node_modules/lodash-es/_baseGetAllKeys.js +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result2 = keysFunc(object); + return isArray_default(object) ? result2 : arrayPush_default(result2, symbolsFunc(object)); +} +var baseGetAllKeys_default; +var init_baseGetAllKeys = __esm({ + "node_modules/lodash-es/_baseGetAllKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayPush(); + init_isArray(); + baseGetAllKeys_default = baseGetAllKeys; + } +}); + +// node_modules/lodash-es/_getAllKeys.js +function getAllKeys(object) { + return baseGetAllKeys_default(object, keys_default, getSymbols_default); +} +var getAllKeys_default; +var init_getAllKeys = __esm({ + "node_modules/lodash-es/_getAllKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetAllKeys(); + init_getSymbols(); + init_keys(); + getAllKeys_default = getAllKeys; + } +}); + +// node_modules/lodash-es/_getAllKeysIn.js +function getAllKeysIn(object) { + return baseGetAllKeys_default(object, keysIn_default, getSymbolsIn_default); +} +var getAllKeysIn_default; +var init_getAllKeysIn = __esm({ + "node_modules/lodash-es/_getAllKeysIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetAllKeys(); + init_getSymbolsIn(); + init_keysIn(); + getAllKeysIn_default = getAllKeysIn; + } +}); + +// node_modules/lodash-es/_DataView.js +var DataView2, DataView_default; +var init_DataView = __esm({ + "node_modules/lodash-es/_DataView.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + init_root(); + DataView2 = getNative_default(root_default, "DataView"); + DataView_default = DataView2; + } +}); + +// node_modules/lodash-es/_Promise.js +var Promise2, Promise_default; +var init_Promise = __esm({ + "node_modules/lodash-es/_Promise.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + init_root(); + Promise2 = getNative_default(root_default, "Promise"); + Promise_default = Promise2; + } +}); + +// node_modules/lodash-es/_Set.js +var Set2, Set_default; +var init_Set = __esm({ + "node_modules/lodash-es/_Set.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getNative(); + init_root(); + Set2 = getNative_default(root_default, "Set"); + Set_default = Set2; + } +}); + +// node_modules/lodash-es/_getTag.js +var mapTag2, objectTag3, promiseTag, setTag2, weakMapTag2, dataViewTag2, dataViewCtorString, mapCtorString, promiseCtorString, setCtorString, weakMapCtorString, getTag, getTag_default; +var init_getTag = __esm({ + "node_modules/lodash-es/_getTag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_DataView(); + init_Map(); + init_Promise(); + init_Set(); + init_WeakMap(); + init_baseGetTag(); + init_toSource(); + mapTag2 = "[object Map]"; + objectTag3 = "[object Object]"; + promiseTag = "[object Promise]"; + setTag2 = "[object Set]"; + weakMapTag2 = "[object WeakMap]"; + dataViewTag2 = "[object DataView]"; + dataViewCtorString = toSource_default(DataView_default); + mapCtorString = toSource_default(Map_default); + promiseCtorString = toSource_default(Promise_default); + setCtorString = toSource_default(Set_default); + weakMapCtorString = toSource_default(WeakMap_default); + getTag = baseGetTag_default; + if (DataView_default && getTag(new DataView_default(new ArrayBuffer(1))) != dataViewTag2 || Map_default && getTag(new Map_default()) != mapTag2 || Promise_default && getTag(Promise_default.resolve()) != promiseTag || Set_default && getTag(new Set_default()) != setTag2 || WeakMap_default && getTag(new WeakMap_default()) != weakMapTag2) { + getTag = function(value2) { + var result2 = baseGetTag_default(value2), Ctor = result2 == objectTag3 ? value2.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : ""; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag2; + case mapCtorString: + return mapTag2; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag2; + case weakMapCtorString: + return weakMapTag2; + } + } + return result2; + }; + } + getTag_default = getTag; + } +}); + +// node_modules/lodash-es/_initCloneArray.js +function initCloneArray(array) { + var length = array.length, result2 = new array.constructor(length); + if (length && typeof array[0] == "string" && hasOwnProperty14.call(array, "index")) { + result2.index = array.index; + result2.input = array.input; + } + return result2; +} +var objectProto17, hasOwnProperty14, initCloneArray_default; +var init_initCloneArray = __esm({ + "node_modules/lodash-es/_initCloneArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + objectProto17 = Object.prototype; + hasOwnProperty14 = objectProto17.hasOwnProperty; + initCloneArray_default = initCloneArray; + } +}); + +// node_modules/lodash-es/_Uint8Array.js +var Uint8Array2, Uint8Array_default; +var init_Uint8Array = __esm({ + "node_modules/lodash-es/_Uint8Array.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + Uint8Array2 = root_default.Uint8Array; + Uint8Array_default = Uint8Array2; + } +}); + +// node_modules/lodash-es/_cloneArrayBuffer.js +function cloneArrayBuffer(arrayBuffer) { + var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array_default(result2).set(new Uint8Array_default(arrayBuffer)); + return result2; +} +var cloneArrayBuffer_default; +var init_cloneArrayBuffer = __esm({ + "node_modules/lodash-es/_cloneArrayBuffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Uint8Array(); + cloneArrayBuffer_default = cloneArrayBuffer; + } +}); + +// node_modules/lodash-es/_cloneDataView.js +function cloneDataView(dataView, isDeep) { + var buffer2 = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength); +} +var cloneDataView_default; +var init_cloneDataView = __esm({ + "node_modules/lodash-es/_cloneDataView.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cloneArrayBuffer(); + cloneDataView_default = cloneDataView; + } +}); + +// node_modules/lodash-es/_cloneRegExp.js +function cloneRegExp(regexp) { + var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result2.lastIndex = regexp.lastIndex; + return result2; +} +var reFlags, cloneRegExp_default; +var init_cloneRegExp = __esm({ + "node_modules/lodash-es/_cloneRegExp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reFlags = /\w*$/; + cloneRegExp_default = cloneRegExp; + } +}); + +// node_modules/lodash-es/_cloneSymbol.js +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} +var symbolProto2, symbolValueOf, cloneSymbol_default; +var init_cloneSymbol = __esm({ + "node_modules/lodash-es/_cloneSymbol.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0; + symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0; + cloneSymbol_default = cloneSymbol; + } +}); + +// node_modules/lodash-es/_cloneTypedArray.js +function cloneTypedArray(typedArray, isDeep) { + var buffer2 = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length); +} +var cloneTypedArray_default; +var init_cloneTypedArray = __esm({ + "node_modules/lodash-es/_cloneTypedArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cloneArrayBuffer(); + cloneTypedArray_default = cloneTypedArray; + } +}); + +// node_modules/lodash-es/_initCloneByTag.js +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag2: + return cloneArrayBuffer_default(object); + case boolTag3: + case dateTag2: + return new Ctor(+object); + case dataViewTag3: + return cloneDataView_default(object, isDeep); + case float32Tag2: + case float64Tag2: + case int8Tag2: + case int16Tag2: + case int32Tag2: + case uint8Tag2: + case uint8ClampedTag2: + case uint16Tag2: + case uint32Tag2: + return cloneTypedArray_default(object, isDeep); + case mapTag3: + return new Ctor(); + case numberTag2: + case stringTag2: + return new Ctor(object); + case regexpTag2: + return cloneRegExp_default(object); + case setTag3: + return new Ctor(); + case symbolTag2: + return cloneSymbol_default(object); + } +} +var boolTag3, dateTag2, mapTag3, numberTag2, regexpTag2, setTag3, stringTag2, symbolTag2, arrayBufferTag2, dataViewTag3, float32Tag2, float64Tag2, int8Tag2, int16Tag2, int32Tag2, uint8Tag2, uint8ClampedTag2, uint16Tag2, uint32Tag2, initCloneByTag_default; +var init_initCloneByTag = __esm({ + "node_modules/lodash-es/_initCloneByTag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_cloneArrayBuffer(); + init_cloneDataView(); + init_cloneRegExp(); + init_cloneSymbol(); + init_cloneTypedArray(); + boolTag3 = "[object Boolean]"; + dateTag2 = "[object Date]"; + mapTag3 = "[object Map]"; + numberTag2 = "[object Number]"; + regexpTag2 = "[object RegExp]"; + setTag3 = "[object Set]"; + stringTag2 = "[object String]"; + symbolTag2 = "[object Symbol]"; + arrayBufferTag2 = "[object ArrayBuffer]"; + dataViewTag3 = "[object DataView]"; + float32Tag2 = "[object Float32Array]"; + float64Tag2 = "[object Float64Array]"; + int8Tag2 = "[object Int8Array]"; + int16Tag2 = "[object Int16Array]"; + int32Tag2 = "[object Int32Array]"; + uint8Tag2 = "[object Uint8Array]"; + uint8ClampedTag2 = "[object Uint8ClampedArray]"; + uint16Tag2 = "[object Uint16Array]"; + uint32Tag2 = "[object Uint32Array]"; + initCloneByTag_default = initCloneByTag; + } +}); + +// node_modules/lodash-es/_initCloneObject.js +function initCloneObject(object) { + return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {}; +} +var initCloneObject_default; +var init_initCloneObject = __esm({ + "node_modules/lodash-es/_initCloneObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseCreate(); + init_getPrototype(); + init_isPrototype(); + initCloneObject_default = initCloneObject; + } +}); + +// node_modules/lodash-es/_baseIsMap.js +function baseIsMap(value2) { + return isObjectLike_default(value2) && getTag_default(value2) == mapTag4; +} +var mapTag4, baseIsMap_default; +var init_baseIsMap = __esm({ + "node_modules/lodash-es/_baseIsMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getTag(); + init_isObjectLike(); + mapTag4 = "[object Map]"; + baseIsMap_default = baseIsMap; + } +}); + +// node_modules/lodash-es/isMap.js +var nodeIsMap, isMap2, isMap_default; +var init_isMap = __esm({ + "node_modules/lodash-es/isMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsMap(); + init_baseUnary(); + init_nodeUtil(); + nodeIsMap = nodeUtil_default && nodeUtil_default.isMap; + isMap2 = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default; + isMap_default = isMap2; + } +}); + +// node_modules/lodash-es/_baseIsSet.js +function baseIsSet(value2) { + return isObjectLike_default(value2) && getTag_default(value2) == setTag4; +} +var setTag4, baseIsSet_default; +var init_baseIsSet = __esm({ + "node_modules/lodash-es/_baseIsSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getTag(); + init_isObjectLike(); + setTag4 = "[object Set]"; + baseIsSet_default = baseIsSet; + } +}); + +// node_modules/lodash-es/isSet.js +var nodeIsSet, isSet, isSet_default; +var init_isSet = __esm({ + "node_modules/lodash-es/isSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsSet(); + init_baseUnary(); + init_nodeUtil(); + nodeIsSet = nodeUtil_default && nodeUtil_default.isSet; + isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default; + isSet_default = isSet; + } +}); + +// node_modules/lodash-es/_baseClone.js +function baseClone(value2, bitmask, customizer, key, object, stack) { + var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; + if (customizer) { + result2 = object ? customizer(value2, key, object, stack) : customizer(value2); + } + if (result2 !== void 0) { + return result2; + } + if (!isObject_default(value2)) { + return value2; + } + var isArr = isArray_default(value2); + if (isArr) { + result2 = initCloneArray_default(value2); + if (!isDeep) { + return copyArray_default(value2, result2); + } + } else { + var tag = getTag_default(value2), isFunc = tag == funcTag3 || tag == genTag2; + if (isBuffer_default(value2)) { + return cloneBuffer_default(value2, isDeep); + } + if (tag == objectTag4 || tag == argsTag3 || isFunc && !object) { + result2 = isFlat || isFunc ? {} : initCloneObject_default(value2); + if (!isDeep) { + return isFlat ? copySymbolsIn_default(value2, baseAssignIn_default(result2, value2)) : copySymbols_default(value2, baseAssign_default(result2, value2)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value2 : {}; + } + result2 = initCloneByTag_default(value2, tag, isDeep); + } + } + stack || (stack = new Stack_default()); + var stacked = stack.get(value2); + if (stacked) { + return stacked; + } + stack.set(value2, result2); + if (isSet_default(value2)) { + value2.forEach(function(subValue) { + result2.add(baseClone(subValue, bitmask, customizer, subValue, value2, stack)); + }); + } else if (isMap_default(value2)) { + value2.forEach(function(subValue, key2) { + result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); + }); + } + var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default; + var props = isArr ? void 0 : keysFunc(value2); + arrayEach_default(props || value2, function(subValue, key2) { + if (props) { + key2 = subValue; + subValue = value2[key2]; + } + assignValue_default(result2, key2, baseClone(subValue, bitmask, customizer, key2, value2, stack)); + }); + return result2; +} +var CLONE_DEEP_FLAG, CLONE_FLAT_FLAG, CLONE_SYMBOLS_FLAG, argsTag3, arrayTag2, boolTag4, dateTag3, errorTag3, funcTag3, genTag2, mapTag5, numberTag3, objectTag4, regexpTag3, setTag5, stringTag3, symbolTag3, weakMapTag3, arrayBufferTag3, dataViewTag4, float32Tag3, float64Tag3, int8Tag3, int16Tag3, int32Tag3, uint8Tag3, uint8ClampedTag3, uint16Tag3, uint32Tag3, cloneableTags, baseClone_default; +var init_baseClone = __esm({ + "node_modules/lodash-es/_baseClone.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Stack(); + init_arrayEach(); + init_assignValue(); + init_baseAssign(); + init_baseAssignIn(); + init_cloneBuffer(); + init_copyArray(); + init_copySymbols(); + init_copySymbolsIn(); + init_getAllKeys(); + init_getAllKeysIn(); + init_getTag(); + init_initCloneArray(); + init_initCloneByTag(); + init_initCloneObject(); + init_isArray(); + init_isBuffer(); + init_isMap(); + init_isObject(); + init_isSet(); + init_keys(); + init_keysIn(); + CLONE_DEEP_FLAG = 1; + CLONE_FLAT_FLAG = 2; + CLONE_SYMBOLS_FLAG = 4; + argsTag3 = "[object Arguments]"; + arrayTag2 = "[object Array]"; + boolTag4 = "[object Boolean]"; + dateTag3 = "[object Date]"; + errorTag3 = "[object Error]"; + funcTag3 = "[object Function]"; + genTag2 = "[object GeneratorFunction]"; + mapTag5 = "[object Map]"; + numberTag3 = "[object Number]"; + objectTag4 = "[object Object]"; + regexpTag3 = "[object RegExp]"; + setTag5 = "[object Set]"; + stringTag3 = "[object String]"; + symbolTag3 = "[object Symbol]"; + weakMapTag3 = "[object WeakMap]"; + arrayBufferTag3 = "[object ArrayBuffer]"; + dataViewTag4 = "[object DataView]"; + float32Tag3 = "[object Float32Array]"; + float64Tag3 = "[object Float64Array]"; + int8Tag3 = "[object Int8Array]"; + int16Tag3 = "[object Int16Array]"; + int32Tag3 = "[object Int32Array]"; + uint8Tag3 = "[object Uint8Array]"; + uint8ClampedTag3 = "[object Uint8ClampedArray]"; + uint16Tag3 = "[object Uint16Array]"; + uint32Tag3 = "[object Uint32Array]"; + cloneableTags = {}; + cloneableTags[argsTag3] = cloneableTags[arrayTag2] = cloneableTags[arrayBufferTag3] = cloneableTags[dataViewTag4] = cloneableTags[boolTag4] = cloneableTags[dateTag3] = cloneableTags[float32Tag3] = cloneableTags[float64Tag3] = cloneableTags[int8Tag3] = cloneableTags[int16Tag3] = cloneableTags[int32Tag3] = cloneableTags[mapTag5] = cloneableTags[numberTag3] = cloneableTags[objectTag4] = cloneableTags[regexpTag3] = cloneableTags[setTag5] = cloneableTags[stringTag3] = cloneableTags[symbolTag3] = cloneableTags[uint8Tag3] = cloneableTags[uint8ClampedTag3] = cloneableTags[uint16Tag3] = cloneableTags[uint32Tag3] = true; + cloneableTags[errorTag3] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false; + baseClone_default = baseClone; + } +}); + +// node_modules/lodash-es/clone.js +function clone(value2) { + return baseClone_default(value2, CLONE_SYMBOLS_FLAG2); +} +var CLONE_SYMBOLS_FLAG2, clone_default; +var init_clone = __esm({ + "node_modules/lodash-es/clone.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + CLONE_SYMBOLS_FLAG2 = 4; + clone_default = clone; + } +}); + +// node_modules/lodash-es/cloneDeep.js +function cloneDeep(value2) { + return baseClone_default(value2, CLONE_DEEP_FLAG2 | CLONE_SYMBOLS_FLAG3); +} +var CLONE_DEEP_FLAG2, CLONE_SYMBOLS_FLAG3, cloneDeep_default; +var init_cloneDeep = __esm({ + "node_modules/lodash-es/cloneDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + CLONE_DEEP_FLAG2 = 1; + CLONE_SYMBOLS_FLAG3 = 4; + cloneDeep_default = cloneDeep; + } +}); + +// node_modules/lodash-es/cloneDeepWith.js +function cloneDeepWith(value2, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + return baseClone_default(value2, CLONE_DEEP_FLAG3 | CLONE_SYMBOLS_FLAG4, customizer); +} +var CLONE_DEEP_FLAG3, CLONE_SYMBOLS_FLAG4, cloneDeepWith_default; +var init_cloneDeepWith = __esm({ + "node_modules/lodash-es/cloneDeepWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + CLONE_DEEP_FLAG3 = 1; + CLONE_SYMBOLS_FLAG4 = 4; + cloneDeepWith_default = cloneDeepWith; + } +}); + +// node_modules/lodash-es/cloneWith.js +function cloneWith(value2, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + return baseClone_default(value2, CLONE_SYMBOLS_FLAG5, customizer); +} +var CLONE_SYMBOLS_FLAG5, cloneWith_default; +var init_cloneWith = __esm({ + "node_modules/lodash-es/cloneWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + CLONE_SYMBOLS_FLAG5 = 4; + cloneWith_default = cloneWith; + } +}); + +// node_modules/lodash-es/commit.js +function wrapperCommit() { + return new LodashWrapper_default(this.value(), this.__chain__); +} +var commit_default; +var init_commit = __esm({ + "node_modules/lodash-es/commit.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LodashWrapper(); + commit_default = wrapperCommit; + } +}); + +// node_modules/lodash-es/compact.js +function compact(array) { + var index4 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; + while (++index4 < length) { + var value2 = array[index4]; + if (value2) { + result2[resIndex++] = value2; + } + } + return result2; +} +var compact_default; +var init_compact = __esm({ + "node_modules/lodash-es/compact.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + compact_default = compact; + } +}); + +// node_modules/lodash-es/concat.js +function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), array = arguments[0], index4 = length; + while (index4--) { + args[index4 - 1] = arguments[index4]; + } + return arrayPush_default(isArray_default(array) ? copyArray_default(array) : [array], baseFlatten_default(args, 1)); +} +var concat_default; +var init_concat = __esm({ + "node_modules/lodash-es/concat.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayPush(); + init_baseFlatten(); + init_copyArray(); + init_isArray(); + concat_default = concat; + } +}); + +// node_modules/lodash-es/_setCacheAdd.js +function setCacheAdd(value2) { + this.__data__.set(value2, HASH_UNDEFINED3); + return this; +} +var HASH_UNDEFINED3, setCacheAdd_default; +var init_setCacheAdd = __esm({ + "node_modules/lodash-es/_setCacheAdd.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + HASH_UNDEFINED3 = "__lodash_hash_undefined__"; + setCacheAdd_default = setCacheAdd; + } +}); + +// node_modules/lodash-es/_setCacheHas.js +function setCacheHas(value2) { + return this.__data__.has(value2); +} +var setCacheHas_default; +var init_setCacheHas = __esm({ + "node_modules/lodash-es/_setCacheHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + setCacheHas_default = setCacheHas; + } +}); + +// node_modules/lodash-es/_SetCache.js +function SetCache(values2) { + var index4 = -1, length = values2 == null ? 0 : values2.length; + this.__data__ = new MapCache_default(); + while (++index4 < length) { + this.add(values2[index4]); + } +} +var SetCache_default; +var init_SetCache = __esm({ + "node_modules/lodash-es/_SetCache.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_MapCache(); + init_setCacheAdd(); + init_setCacheHas(); + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default; + SetCache.prototype.has = setCacheHas_default; + SetCache_default = SetCache; + } +}); + +// node_modules/lodash-es/_arraySome.js +function arraySome(array, predicate) { + var index4 = -1, length = array == null ? 0 : array.length; + while (++index4 < length) { + if (predicate(array[index4], index4, array)) { + return true; + } + } + return false; +} +var arraySome_default; +var init_arraySome = __esm({ + "node_modules/lodash-es/_arraySome.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arraySome_default = arraySome; + } +}); + +// node_modules/lodash-es/_cacheHas.js +function cacheHas(cache, key) { + return cache.has(key); +} +var cacheHas_default; +var init_cacheHas = __esm({ + "node_modules/lodash-es/_cacheHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + cacheHas_default = cacheHas; + } +}); + +// node_modules/lodash-es/_equalArrays.js +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index4 = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0; + stack.set(array, other); + stack.set(other, array); + while (++index4 < arrLength) { + var arrValue = array[index4], othValue = other[index4]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index4, other, array, stack) : customizer(arrValue, othValue, index4, array, other, stack); + } + if (compared !== void 0) { + if (compared) { + continue; + } + result2 = false; + break; + } + if (seen) { + if (!arraySome_default(other, function(othValue2, othIndex) { + if (!cacheHas_default(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"](array); + stack["delete"](other); + return result2; +} +var COMPARE_PARTIAL_FLAG, COMPARE_UNORDERED_FLAG, equalArrays_default; +var init_equalArrays = __esm({ + "node_modules/lodash-es/_equalArrays.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_SetCache(); + init_arraySome(); + init_cacheHas(); + COMPARE_PARTIAL_FLAG = 1; + COMPARE_UNORDERED_FLAG = 2; + equalArrays_default = equalArrays; + } +}); + +// node_modules/lodash-es/_mapToArray.js +function mapToArray(map4) { + var index4 = -1, result2 = Array(map4.size); + map4.forEach(function(value2, key) { + result2[++index4] = [key, value2]; + }); + return result2; +} +var mapToArray_default; +var init_mapToArray = __esm({ + "node_modules/lodash-es/_mapToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + mapToArray_default = mapToArray; + } +}); + +// node_modules/lodash-es/_setToArray.js +function setToArray(set4) { + var index4 = -1, result2 = Array(set4.size); + set4.forEach(function(value2) { + result2[++index4] = value2; + }); + return result2; +} +var setToArray_default; +var init_setToArray = __esm({ + "node_modules/lodash-es/_setToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + setToArray_default = setToArray; + } +}); + +// node_modules/lodash-es/_equalByTag.js +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag5: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag4: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object), new Uint8Array_default(other))) { + return false; + } + return true; + case boolTag5: + case dateTag4: + case numberTag4: + return eq_default(+object, +other); + case errorTag4: + return object.name == other.name && object.message == other.message; + case regexpTag4: + case stringTag4: + return object == other + ""; + case mapTag6: + var convert = mapToArray_default; + case setTag6: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG2; + convert || (convert = setToArray_default); + if (object.size != other.size && !isPartial) { + return false; + } + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG2; + stack.set(object, other); + var result2 = equalArrays_default(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack["delete"](object); + return result2; + case symbolTag4: + if (symbolValueOf2) { + return symbolValueOf2.call(object) == symbolValueOf2.call(other); + } + } + return false; +} +var COMPARE_PARTIAL_FLAG2, COMPARE_UNORDERED_FLAG2, boolTag5, dateTag4, errorTag4, mapTag6, numberTag4, regexpTag4, setTag6, stringTag4, symbolTag4, arrayBufferTag4, dataViewTag5, symbolProto3, symbolValueOf2, equalByTag_default; +var init_equalByTag = __esm({ + "node_modules/lodash-es/_equalByTag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + init_Uint8Array(); + init_eq(); + init_equalArrays(); + init_mapToArray(); + init_setToArray(); + COMPARE_PARTIAL_FLAG2 = 1; + COMPARE_UNORDERED_FLAG2 = 2; + boolTag5 = "[object Boolean]"; + dateTag4 = "[object Date]"; + errorTag4 = "[object Error]"; + mapTag6 = "[object Map]"; + numberTag4 = "[object Number]"; + regexpTag4 = "[object RegExp]"; + setTag6 = "[object Set]"; + stringTag4 = "[object String]"; + symbolTag4 = "[object Symbol]"; + arrayBufferTag4 = "[object ArrayBuffer]"; + dataViewTag5 = "[object DataView]"; + symbolProto3 = Symbol_default ? Symbol_default.prototype : void 0; + symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : void 0; + equalByTag_default = equalByTag; + } +}); + +// node_modules/lodash-es/_equalObjects.js +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index4 = objLength; + while (index4--) { + var key = objProps[index4]; + if (!(isPartial ? key in other : hasOwnProperty15.call(other, key))) { + return false; + } + } + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result2 = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index4 < objLength) { + key = objProps[index4]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result2 = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result2 && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result2 = false; + } + } + stack["delete"](object); + stack["delete"](other); + return result2; +} +var COMPARE_PARTIAL_FLAG3, objectProto18, hasOwnProperty15, equalObjects_default; +var init_equalObjects = __esm({ + "node_modules/lodash-es/_equalObjects.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getAllKeys(); + COMPARE_PARTIAL_FLAG3 = 1; + objectProto18 = Object.prototype; + hasOwnProperty15 = objectProto18.hasOwnProperty; + equalObjects_default = equalObjects; + } +}); + +// node_modules/lodash-es/_baseIsEqualDeep.js +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray_default(object), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag3 : getTag_default(object), othTag = othIsArr ? arrayTag3 : getTag_default(other); + objTag = objTag == argsTag4 ? objectTag5 : objTag; + othTag = othTag == argsTag4 ? objectTag5 : othTag; + var objIsObj = objTag == objectTag5, othIsObj = othTag == objectTag5, isSameTag = objTag == othTag; + if (isSameTag && isBuffer_default(object)) { + if (!isBuffer_default(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack_default()); + return objIsArr || isTypedArray_default(object) ? equalArrays_default(object, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG4)) { + var objIsWrapped = objIsObj && hasOwnProperty16.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty16.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack_default()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack_default()); + return equalObjects_default(object, other, bitmask, customizer, equalFunc, stack); +} +var COMPARE_PARTIAL_FLAG4, argsTag4, arrayTag3, objectTag5, objectProto19, hasOwnProperty16, baseIsEqualDeep_default; +var init_baseIsEqualDeep = __esm({ + "node_modules/lodash-es/_baseIsEqualDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Stack(); + init_equalArrays(); + init_equalByTag(); + init_equalObjects(); + init_getTag(); + init_isArray(); + init_isBuffer(); + init_isTypedArray(); + COMPARE_PARTIAL_FLAG4 = 1; + argsTag4 = "[object Arguments]"; + arrayTag3 = "[object Array]"; + objectTag5 = "[object Object]"; + objectProto19 = Object.prototype; + hasOwnProperty16 = objectProto19.hasOwnProperty; + baseIsEqualDeep_default = baseIsEqualDeep; + } +}); + +// node_modules/lodash-es/_baseIsEqual.js +function baseIsEqual(value2, other, bitmask, customizer, stack) { + if (value2 === other) { + return true; + } + if (value2 == null || other == null || !isObjectLike_default(value2) && !isObjectLike_default(other)) { + return value2 !== value2 && other !== other; + } + return baseIsEqualDeep_default(value2, other, bitmask, customizer, baseIsEqual, stack); +} +var baseIsEqual_default; +var init_baseIsEqual = __esm({ + "node_modules/lodash-es/_baseIsEqual.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsEqualDeep(); + init_isObjectLike(); + baseIsEqual_default = baseIsEqual; + } +}); + +// node_modules/lodash-es/_baseIsMatch.js +function baseIsMatch(object, source, matchData, customizer) { + var index4 = matchData.length, length = index4, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object(object); + while (index4--) { + var data = matchData[index4]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; + } + } + while (++index4 < length) { + data = matchData[index4]; + var key = data[0], objValue = object[key], srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === void 0 && !(key in object)) { + return false; + } + } else { + var stack = new Stack_default(); + if (customizer) { + var result2 = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result2 === void 0 ? baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG5 | COMPARE_UNORDERED_FLAG3, customizer, stack) : result2)) { + return false; + } + } + } + return true; +} +var COMPARE_PARTIAL_FLAG5, COMPARE_UNORDERED_FLAG3, baseIsMatch_default; +var init_baseIsMatch = __esm({ + "node_modules/lodash-es/_baseIsMatch.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Stack(); + init_baseIsEqual(); + COMPARE_PARTIAL_FLAG5 = 1; + COMPARE_UNORDERED_FLAG3 = 2; + baseIsMatch_default = baseIsMatch; + } +}); + +// node_modules/lodash-es/_isStrictComparable.js +function isStrictComparable(value2) { + return value2 === value2 && !isObject_default(value2); +} +var isStrictComparable_default; +var init_isStrictComparable = __esm({ + "node_modules/lodash-es/_isStrictComparable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isObject(); + isStrictComparable_default = isStrictComparable; + } +}); + +// node_modules/lodash-es/_getMatchData.js +function getMatchData(object) { + var result2 = keys_default(object), length = result2.length; + while (length--) { + var key = result2[length], value2 = object[key]; + result2[length] = [key, value2, isStrictComparable_default(value2)]; + } + return result2; +} +var getMatchData_default; +var init_getMatchData = __esm({ + "node_modules/lodash-es/_getMatchData.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isStrictComparable(); + init_keys(); + getMatchData_default = getMatchData; + } +}); + +// node_modules/lodash-es/_matchesStrictComparable.js +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && (srcValue !== void 0 || key in Object(object)); + }; +} +var matchesStrictComparable_default; +var init_matchesStrictComparable = __esm({ + "node_modules/lodash-es/_matchesStrictComparable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + matchesStrictComparable_default = matchesStrictComparable; + } +}); + +// node_modules/lodash-es/_baseMatches.js +function baseMatches(source) { + var matchData = getMatchData_default(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable_default(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch_default(object, source, matchData); + }; +} +var baseMatches_default; +var init_baseMatches = __esm({ + "node_modules/lodash-es/_baseMatches.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsMatch(); + init_getMatchData(); + init_matchesStrictComparable(); + baseMatches_default = baseMatches; + } +}); + +// node_modules/lodash-es/_baseHasIn.js +function baseHasIn(object, key) { + return object != null && key in Object(object); +} +var baseHasIn_default; +var init_baseHasIn = __esm({ + "node_modules/lodash-es/_baseHasIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseHasIn_default = baseHasIn; + } +}); + +// node_modules/lodash-es/_hasPath.js +function hasPath(object, path2, hasFunc) { + path2 = castPath_default(path2, object); + var index4 = -1, length = path2.length, result2 = false; + while (++index4 < length) { + var key = toKey_default(path2[index4]); + if (!(result2 = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result2 || ++index4 != length) { + return result2; + } + length = object == null ? 0 : object.length; + return !!length && isLength_default(length) && isIndex_default(key, length) && (isArray_default(object) || isArguments_default(object)); +} +var hasPath_default; +var init_hasPath = __esm({ + "node_modules/lodash-es/_hasPath.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castPath(); + init_isArguments(); + init_isArray(); + init_isIndex(); + init_isLength(); + init_toKey(); + hasPath_default = hasPath; + } +}); + +// node_modules/lodash-es/hasIn.js +function hasIn(object, path2) { + return object != null && hasPath_default(object, path2, baseHasIn_default); +} +var hasIn_default; +var init_hasIn = __esm({ + "node_modules/lodash-es/hasIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseHasIn(); + init_hasPath(); + hasIn_default = hasIn; + } +}); + +// node_modules/lodash-es/_baseMatchesProperty.js +function baseMatchesProperty(path2, srcValue) { + if (isKey_default(path2) && isStrictComparable_default(srcValue)) { + return matchesStrictComparable_default(toKey_default(path2), srcValue); + } + return function(object) { + var objValue = get_default(object, path2); + return objValue === void 0 && objValue === srcValue ? hasIn_default(object, path2) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4); + }; +} +var COMPARE_PARTIAL_FLAG6, COMPARE_UNORDERED_FLAG4, baseMatchesProperty_default; +var init_baseMatchesProperty = __esm({ + "node_modules/lodash-es/_baseMatchesProperty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsEqual(); + init_get(); + init_hasIn(); + init_isKey(); + init_isStrictComparable(); + init_matchesStrictComparable(); + init_toKey(); + COMPARE_PARTIAL_FLAG6 = 1; + COMPARE_UNORDERED_FLAG4 = 2; + baseMatchesProperty_default = baseMatchesProperty; + } +}); + +// node_modules/lodash-es/_baseProperty.js +function baseProperty(key) { + return function(object) { + return object == null ? void 0 : object[key]; + }; +} +var baseProperty_default; +var init_baseProperty = __esm({ + "node_modules/lodash-es/_baseProperty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseProperty_default = baseProperty; + } +}); + +// node_modules/lodash-es/_basePropertyDeep.js +function basePropertyDeep(path2) { + return function(object) { + return baseGet_default(object, path2); + }; +} +var basePropertyDeep_default; +var init_basePropertyDeep = __esm({ + "node_modules/lodash-es/_basePropertyDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + basePropertyDeep_default = basePropertyDeep; + } +}); + +// node_modules/lodash-es/property.js +function property(path2) { + return isKey_default(path2) ? baseProperty_default(toKey_default(path2)) : basePropertyDeep_default(path2); +} +var property_default; +var init_property = __esm({ + "node_modules/lodash-es/property.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseProperty(); + init_basePropertyDeep(); + init_isKey(); + init_toKey(); + property_default = property; + } +}); + +// node_modules/lodash-es/_baseIteratee.js +function baseIteratee(value2) { + if (typeof value2 == "function") { + return value2; + } + if (value2 == null) { + return identity_default; + } + if (typeof value2 == "object") { + return isArray_default(value2) ? baseMatchesProperty_default(value2[0], value2[1]) : baseMatches_default(value2); + } + return property_default(value2); +} +var baseIteratee_default; +var init_baseIteratee = __esm({ + "node_modules/lodash-es/_baseIteratee.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseMatches(); + init_baseMatchesProperty(); + init_identity2(); + init_isArray(); + init_property(); + baseIteratee_default = baseIteratee; + } +}); + +// node_modules/lodash-es/cond.js +function cond(pairs3) { + var length = pairs3 == null ? 0 : pairs3.length, toIteratee = baseIteratee_default; + pairs3 = !length ? [] : arrayMap_default(pairs3, function(pair) { + if (typeof pair[1] != "function") { + throw new TypeError(FUNC_ERROR_TEXT5); + } + return [toIteratee(pair[0]), pair[1]]; + }); + return baseRest_default(function(args) { + var index4 = -1; + while (++index4 < length) { + var pair = pairs3[index4]; + if (apply_default(pair[0], this, args)) { + return apply_default(pair[1], this, args); + } + } + }); +} +var FUNC_ERROR_TEXT5, cond_default; +var init_cond = __esm({ + "node_modules/lodash-es/cond.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_arrayMap(); + init_baseIteratee(); + init_baseRest(); + FUNC_ERROR_TEXT5 = "Expected a function"; + cond_default = cond; + } +}); + +// node_modules/lodash-es/_baseConformsTo.js +function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], predicate = source[key], value2 = object[key]; + if (value2 === void 0 && !(key in object) || !predicate(value2)) { + return false; + } + } + return true; +} +var baseConformsTo_default; +var init_baseConformsTo = __esm({ + "node_modules/lodash-es/_baseConformsTo.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseConformsTo_default = baseConformsTo; + } +}); + +// node_modules/lodash-es/_baseConforms.js +function baseConforms(source) { + var props = keys_default(source); + return function(object) { + return baseConformsTo_default(object, source, props); + }; +} +var baseConforms_default; +var init_baseConforms = __esm({ + "node_modules/lodash-es/_baseConforms.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseConformsTo(); + init_keys(); + baseConforms_default = baseConforms; + } +}); + +// node_modules/lodash-es/conforms.js +function conforms(source) { + return baseConforms_default(baseClone_default(source, CLONE_DEEP_FLAG4)); +} +var CLONE_DEEP_FLAG4, conforms_default; +var init_conforms = __esm({ + "node_modules/lodash-es/conforms.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + init_baseConforms(); + CLONE_DEEP_FLAG4 = 1; + conforms_default = conforms; + } +}); + +// node_modules/lodash-es/conformsTo.js +function conformsTo(object, source) { + return source == null || baseConformsTo_default(object, source, keys_default(source)); +} +var conformsTo_default; +var init_conformsTo = __esm({ + "node_modules/lodash-es/conformsTo.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseConformsTo(); + init_keys(); + conformsTo_default = conformsTo; + } +}); + +// node_modules/lodash-es/_arrayAggregator.js +function arrayAggregator(array, setter, iteratee2, accumulator) { + var index4 = -1, length = array == null ? 0 : array.length; + while (++index4 < length) { + var value2 = array[index4]; + setter(accumulator, value2, iteratee2(value2), array); + } + return accumulator; +} +var arrayAggregator_default; +var init_arrayAggregator = __esm({ + "node_modules/lodash-es/_arrayAggregator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayAggregator_default = arrayAggregator; + } +}); + +// node_modules/lodash-es/_createBaseFor.js +function createBaseFor(fromRight) { + return function(object, iteratee2, keysFunc) { + var index4 = -1, iterable = Object(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index4]; + if (iteratee2(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} +var createBaseFor_default; +var init_createBaseFor = __esm({ + "node_modules/lodash-es/_createBaseFor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + createBaseFor_default = createBaseFor; + } +}); + +// node_modules/lodash-es/_baseFor.js +var baseFor, baseFor_default; +var init_baseFor = __esm({ + "node_modules/lodash-es/_baseFor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createBaseFor(); + baseFor = createBaseFor_default(); + baseFor_default = baseFor; + } +}); + +// node_modules/lodash-es/_baseForOwn.js +function baseForOwn(object, iteratee2) { + return object && baseFor_default(object, iteratee2, keys_default); +} +var baseForOwn_default; +var init_baseForOwn = __esm({ + "node_modules/lodash-es/_baseForOwn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFor(); + init_keys(); + baseForOwn_default = baseForOwn; + } +}); + +// node_modules/lodash-es/_createBaseEach.js +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee2) { + if (collection == null) { + return collection; + } + if (!isArrayLike_default(collection)) { + return eachFunc(collection, iteratee2); + } + var length = collection.length, index4 = fromRight ? length : -1, iterable = Object(collection); + while (fromRight ? index4-- : ++index4 < length) { + if (iteratee2(iterable[index4], index4, iterable) === false) { + break; + } + } + return collection; + }; +} +var createBaseEach_default; +var init_createBaseEach = __esm({ + "node_modules/lodash-es/_createBaseEach.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArrayLike(); + createBaseEach_default = createBaseEach; + } +}); + +// node_modules/lodash-es/_baseEach.js +var baseEach, baseEach_default; +var init_baseEach = __esm({ + "node_modules/lodash-es/_baseEach.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForOwn(); + init_createBaseEach(); + baseEach = createBaseEach_default(baseForOwn_default); + baseEach_default = baseEach; + } +}); + +// node_modules/lodash-es/_baseAggregator.js +function baseAggregator(collection, setter, iteratee2, accumulator) { + baseEach_default(collection, function(value2, key, collection2) { + setter(accumulator, value2, iteratee2(value2), collection2); + }); + return accumulator; +} +var baseAggregator_default; +var init_baseAggregator = __esm({ + "node_modules/lodash-es/_baseAggregator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseEach(); + baseAggregator_default = baseAggregator; + } +}); + +// node_modules/lodash-es/_createAggregator.js +function createAggregator(setter, initializer) { + return function(collection, iteratee2) { + var func = isArray_default(collection) ? arrayAggregator_default : baseAggregator_default, accumulator = initializer ? initializer() : {}; + return func(collection, setter, baseIteratee_default(iteratee2, 2), accumulator); + }; +} +var createAggregator_default; +var init_createAggregator = __esm({ + "node_modules/lodash-es/_createAggregator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayAggregator(); + init_baseAggregator(); + init_baseIteratee(); + init_isArray(); + createAggregator_default = createAggregator; + } +}); + +// node_modules/lodash-es/countBy.js +var objectProto20, hasOwnProperty17, countBy, countBy_default; +var init_countBy = __esm({ + "node_modules/lodash-es/countBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_createAggregator(); + objectProto20 = Object.prototype; + hasOwnProperty17 = objectProto20.hasOwnProperty; + countBy = createAggregator_default(function(result2, value2, key) { + if (hasOwnProperty17.call(result2, key)) { + ++result2[key]; + } else { + baseAssignValue_default(result2, key, 1); + } + }); + countBy_default = countBy; + } +}); + +// node_modules/lodash-es/create.js +function create(prototype, properties) { + var result2 = baseCreate_default(prototype); + return properties == null ? result2 : baseAssign_default(result2, properties); +} +var create_default; +var init_create = __esm({ + "node_modules/lodash-es/create.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssign(); + init_baseCreate(); + create_default = create; + } +}); + +// node_modules/lodash-es/curry.js +function curry(func, arity, guard) { + arity = guard ? void 0 : arity; + var result2 = createWrap_default(func, WRAP_CURRY_FLAG6, void 0, void 0, void 0, void 0, void 0, arity); + result2.placeholder = curry.placeholder; + return result2; +} +var WRAP_CURRY_FLAG6, curry_default; +var init_curry = __esm({ + "node_modules/lodash-es/curry.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createWrap(); + WRAP_CURRY_FLAG6 = 8; + curry.placeholder = {}; + curry_default = curry; + } +}); + +// node_modules/lodash-es/curryRight.js +function curryRight(func, arity, guard) { + arity = guard ? void 0 : arity; + var result2 = createWrap_default(func, WRAP_CURRY_RIGHT_FLAG4, void 0, void 0, void 0, void 0, void 0, arity); + result2.placeholder = curryRight.placeholder; + return result2; +} +var WRAP_CURRY_RIGHT_FLAG4, curryRight_default; +var init_curryRight = __esm({ + "node_modules/lodash-es/curryRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createWrap(); + WRAP_CURRY_RIGHT_FLAG4 = 16; + curryRight.placeholder = {}; + curryRight_default = curryRight; + } +}); + +// node_modules/lodash-es/now.js +var now, now_default; +var init_now = __esm({ + "node_modules/lodash-es/now.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + now = function() { + return root_default.Date.now(); + }; + now_default = now; + } +}); + +// node_modules/lodash-es/debounce.js +function debounce(func, wait, options) { + var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT6); + } + wait = toNumber_default(wait) || 0; + if (isObject_default(options)) { + leading = !!options.leading; + maxing = "maxWait" in options; + maxWait = maxing ? nativeMax6(toNumber_default(options.maxWait) || 0, wait) : maxWait; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + function invokeFunc(time2) { + var args = lastArgs, thisArg = lastThis; + lastArgs = lastThis = void 0; + lastInvokeTime = time2; + result2 = func.apply(thisArg, args); + return result2; + } + function leadingEdge(time2) { + lastInvokeTime = time2; + timerId = setTimeout(timerExpired, wait); + return leading ? invokeFunc(time2) : result2; + } + function remainingWait(time2) { + var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; + return maxing ? nativeMin4(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; + } + function shouldInvoke(time2) { + var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime; + return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; + } + function timerExpired() { + var time2 = now_default(); + if (shouldInvoke(time2)) { + return trailingEdge(time2); + } + timerId = setTimeout(timerExpired, remainingWait(time2)); + } + function trailingEdge(time2) { + timerId = void 0; + if (trailing && lastArgs) { + return invokeFunc(time2); + } + lastArgs = lastThis = void 0; + return result2; + } + function cancel() { + if (timerId !== void 0) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = void 0; + } + function flush() { + return timerId === void 0 ? result2 : trailingEdge(now_default()); + } + function debounced() { + var time2 = now_default(), isInvoking = shouldInvoke(time2); + lastArgs = arguments; + lastThis = this; + lastCallTime = time2; + if (isInvoking) { + if (timerId === void 0) { + return leadingEdge(lastCallTime); + } + if (maxing) { + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === void 0) { + timerId = setTimeout(timerExpired, wait); + } + return result2; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} +var FUNC_ERROR_TEXT6, nativeMax6, nativeMin4, debounce_default; +var init_debounce = __esm({ + "node_modules/lodash-es/debounce.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isObject(); + init_now(); + init_toNumber(); + FUNC_ERROR_TEXT6 = "Expected a function"; + nativeMax6 = Math.max; + nativeMin4 = Math.min; + debounce_default = debounce; + } +}); + +// node_modules/lodash-es/defaultTo.js +function defaultTo(value2, defaultValue) { + return value2 == null || value2 !== value2 ? defaultValue : value2; +} +var defaultTo_default; +var init_defaultTo = __esm({ + "node_modules/lodash-es/defaultTo.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + defaultTo_default = defaultTo; + } +}); + +// node_modules/lodash-es/defaults.js +var objectProto21, hasOwnProperty18, defaults, defaults_default; +var init_defaults = __esm({ + "node_modules/lodash-es/defaults.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_eq(); + init_isIterateeCall(); + init_keysIn(); + objectProto21 = Object.prototype; + hasOwnProperty18 = objectProto21.hasOwnProperty; + defaults = baseRest_default(function(object, sources) { + object = Object(object); + var index4 = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : void 0; + if (guard && isIterateeCall_default(sources[0], sources[1], guard)) { + length = 1; + } + while (++index4 < length) { + var source = sources[index4]; + var props = keysIn_default(source); + var propsIndex = -1; + var propsLength = props.length; + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value2 = object[key]; + if (value2 === void 0 || eq_default(value2, objectProto21[key]) && !hasOwnProperty18.call(object, key)) { + object[key] = source[key]; + } + } + } + return object; + }); + defaults_default = defaults; + } +}); + +// node_modules/lodash-es/_assignMergeValue.js +function assignMergeValue(object, key, value2) { + if (value2 !== void 0 && !eq_default(object[key], value2) || value2 === void 0 && !(key in object)) { + baseAssignValue_default(object, key, value2); + } +} +var assignMergeValue_default; +var init_assignMergeValue = __esm({ + "node_modules/lodash-es/_assignMergeValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_eq(); + assignMergeValue_default = assignMergeValue; + } +}); + +// node_modules/lodash-es/isArrayLikeObject.js +function isArrayLikeObject(value2) { + return isObjectLike_default(value2) && isArrayLike_default(value2); +} +var isArrayLikeObject_default; +var init_isArrayLikeObject = __esm({ + "node_modules/lodash-es/isArrayLikeObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArrayLike(); + init_isObjectLike(); + isArrayLikeObject_default = isArrayLikeObject; + } +}); + +// node_modules/lodash-es/_safeGet.js +function safeGet(object, key) { + if (key === "constructor" && typeof object[key] === "function") { + return; + } + if (key == "__proto__") { + return; + } + return object[key]; +} +var safeGet_default; +var init_safeGet = __esm({ + "node_modules/lodash-es/_safeGet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + safeGet_default = safeGet; + } +}); + +// node_modules/lodash-es/toPlainObject.js +function toPlainObject(value2) { + return copyObject_default(value2, keysIn_default(value2)); +} +var toPlainObject_default; +var init_toPlainObject = __esm({ + "node_modules/lodash-es/toPlainObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyObject(); + init_keysIn(); + toPlainObject_default = toPlainObject; + } +}); + +// node_modules/lodash-es/_baseMergeDeep.js +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet_default(object, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue); + if (stacked) { + assignMergeValue_default(object, key, stacked); + return; + } + var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0; + var isCommon = newValue === void 0; + if (isCommon) { + var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue); + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray_default(objValue)) { + newValue = objValue; + } else if (isArrayLikeObject_default(objValue)) { + newValue = copyArray_default(objValue); + } else if (isBuff) { + isCommon = false; + newValue = cloneBuffer_default(srcValue, true); + } else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray_default(srcValue, true); + } else { + newValue = []; + } + } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) { + newValue = objValue; + if (isArguments_default(objValue)) { + newValue = toPlainObject_default(objValue); + } else if (!isObject_default(objValue) || isFunction_default(objValue)) { + newValue = initCloneObject_default(srcValue); + } + } else { + isCommon = false; + } + } + if (isCommon) { + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack["delete"](srcValue); + } + assignMergeValue_default(object, key, newValue); +} +var baseMergeDeep_default; +var init_baseMergeDeep = __esm({ + "node_modules/lodash-es/_baseMergeDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignMergeValue(); + init_cloneBuffer(); + init_cloneTypedArray(); + init_copyArray(); + init_initCloneObject(); + init_isArguments(); + init_isArray(); + init_isArrayLikeObject(); + init_isBuffer(); + init_isFunction(); + init_isObject(); + init_isPlainObject(); + init_isTypedArray(); + init_safeGet(); + init_toPlainObject(); + baseMergeDeep_default = baseMergeDeep; + } +}); + +// node_modules/lodash-es/_baseMerge.js +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor_default(source, function(srcValue, key) { + stack || (stack = new Stack_default()); + if (isObject_default(srcValue)) { + baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack); + } else { + var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0; + if (newValue === void 0) { + newValue = srcValue; + } + assignMergeValue_default(object, key, newValue); + } + }, keysIn_default); +} +var baseMerge_default; +var init_baseMerge = __esm({ + "node_modules/lodash-es/_baseMerge.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Stack(); + init_assignMergeValue(); + init_baseFor(); + init_baseMergeDeep(); + init_isObject(); + init_keysIn(); + init_safeGet(); + baseMerge_default = baseMerge; + } +}); + +// node_modules/lodash-es/_customDefaultsMerge.js +function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject_default(objValue) && isObject_default(srcValue)) { + stack.set(srcValue, objValue); + baseMerge_default(objValue, srcValue, void 0, customDefaultsMerge, stack); + stack["delete"](srcValue); + } + return objValue; +} +var customDefaultsMerge_default; +var init_customDefaultsMerge = __esm({ + "node_modules/lodash-es/_customDefaultsMerge.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseMerge(); + init_isObject(); + customDefaultsMerge_default = customDefaultsMerge; + } +}); + +// node_modules/lodash-es/mergeWith.js +var mergeWith, mergeWith_default; +var init_mergeWith = __esm({ + "node_modules/lodash-es/mergeWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseMerge(); + init_createAssigner(); + mergeWith = createAssigner_default(function(object, source, srcIndex, customizer) { + baseMerge_default(object, source, srcIndex, customizer); + }); + mergeWith_default = mergeWith; + } +}); + +// node_modules/lodash-es/defaultsDeep.js +var defaultsDeep, defaultsDeep_default; +var init_defaultsDeep = __esm({ + "node_modules/lodash-es/defaultsDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_baseRest(); + init_customDefaultsMerge(); + init_mergeWith(); + defaultsDeep = baseRest_default(function(args) { + args.push(void 0, customDefaultsMerge_default); + return apply_default(mergeWith_default, void 0, args); + }); + defaultsDeep_default = defaultsDeep; + } +}); + +// node_modules/lodash-es/_baseDelay.js +function baseDelay(func, wait, args) { + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT7); + } + return setTimeout(function() { + func.apply(void 0, args); + }, wait); +} +var FUNC_ERROR_TEXT7, baseDelay_default; +var init_baseDelay = __esm({ + "node_modules/lodash-es/_baseDelay.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + FUNC_ERROR_TEXT7 = "Expected a function"; + baseDelay_default = baseDelay; + } +}); + +// node_modules/lodash-es/defer.js +var defer, defer_default; +var init_defer = __esm({ + "node_modules/lodash-es/defer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDelay(); + init_baseRest(); + defer = baseRest_default(function(func, args) { + return baseDelay_default(func, 1, args); + }); + defer_default = defer; + } +}); + +// node_modules/lodash-es/delay.js +var delay, delay_default; +var init_delay = __esm({ + "node_modules/lodash-es/delay.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDelay(); + init_baseRest(); + init_toNumber(); + delay = baseRest_default(function(func, wait, args) { + return baseDelay_default(func, toNumber_default(wait) || 0, args); + }); + delay_default = delay; + } +}); + +// node_modules/lodash-es/_arrayIncludesWith.js +function arrayIncludesWith(array, value2, comparator) { + var index4 = -1, length = array == null ? 0 : array.length; + while (++index4 < length) { + if (comparator(value2, array[index4])) { + return true; + } + } + return false; +} +var arrayIncludesWith_default; +var init_arrayIncludesWith = __esm({ + "node_modules/lodash-es/_arrayIncludesWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayIncludesWith_default = arrayIncludesWith; + } +}); + +// node_modules/lodash-es/_baseDifference.js +function baseDifference(array, values2, iteratee2, comparator) { + var index4 = -1, includes2 = arrayIncludes_default, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; + if (!length) { + return result2; + } + if (iteratee2) { + values2 = arrayMap_default(values2, baseUnary_default(iteratee2)); + } + if (comparator) { + includes2 = arrayIncludesWith_default; + isCommon = false; + } else if (values2.length >= LARGE_ARRAY_SIZE2) { + includes2 = cacheHas_default; + isCommon = false; + values2 = new SetCache_default(values2); + } + outer: + while (++index4 < length) { + var value2 = array[index4], computed = iteratee2 == null ? value2 : iteratee2(value2); + value2 = comparator || value2 !== 0 ? value2 : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values2[valuesIndex] === computed) { + continue outer; + } + } + result2.push(value2); + } else if (!includes2(values2, computed, comparator)) { + result2.push(value2); + } + } + return result2; +} +var LARGE_ARRAY_SIZE2, baseDifference_default; +var init_baseDifference = __esm({ + "node_modules/lodash-es/_baseDifference.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_SetCache(); + init_arrayIncludes(); + init_arrayIncludesWith(); + init_arrayMap(); + init_baseUnary(); + init_cacheHas(); + LARGE_ARRAY_SIZE2 = 200; + baseDifference_default = baseDifference; + } +}); + +// node_modules/lodash-es/difference.js +var difference, difference_default; +var init_difference = __esm({ + "node_modules/lodash-es/difference.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDifference(); + init_baseFlatten(); + init_baseRest(); + init_isArrayLikeObject(); + difference = baseRest_default(function(array, values2) { + return isArrayLikeObject_default(array) ? baseDifference_default(array, baseFlatten_default(values2, 1, isArrayLikeObject_default, true)) : []; + }); + difference_default = difference; + } +}); + +// node_modules/lodash-es/last.js +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : void 0; +} +var last_default; +var init_last = __esm({ + "node_modules/lodash-es/last.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + last_default = last; + } +}); + +// node_modules/lodash-es/differenceBy.js +var differenceBy, differenceBy_default; +var init_differenceBy = __esm({ + "node_modules/lodash-es/differenceBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDifference(); + init_baseFlatten(); + init_baseIteratee(); + init_baseRest(); + init_isArrayLikeObject(); + init_last(); + differenceBy = baseRest_default(function(array, values2) { + var iteratee2 = last_default(values2); + if (isArrayLikeObject_default(iteratee2)) { + iteratee2 = void 0; + } + return isArrayLikeObject_default(array) ? baseDifference_default(array, baseFlatten_default(values2, 1, isArrayLikeObject_default, true), baseIteratee_default(iteratee2, 2)) : []; + }); + differenceBy_default = differenceBy; + } +}); + +// node_modules/lodash-es/differenceWith.js +var differenceWith, differenceWith_default; +var init_differenceWith = __esm({ + "node_modules/lodash-es/differenceWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDifference(); + init_baseFlatten(); + init_baseRest(); + init_isArrayLikeObject(); + init_last(); + differenceWith = baseRest_default(function(array, values2) { + var comparator = last_default(values2); + if (isArrayLikeObject_default(comparator)) { + comparator = void 0; + } + return isArrayLikeObject_default(array) ? baseDifference_default(array, baseFlatten_default(values2, 1, isArrayLikeObject_default, true), void 0, comparator) : []; + }); + differenceWith_default = differenceWith; + } +}); + +// node_modules/lodash-es/divide.js +var divide, divide_default; +var init_divide = __esm({ + "node_modules/lodash-es/divide.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createMathOperation(); + divide = createMathOperation_default(function(dividend, divisor) { + return dividend / divisor; + }, 1); + divide_default = divide; + } +}); + +// node_modules/lodash-es/drop.js +function drop(array, n7, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n7 = guard || n7 === void 0 ? 1 : toInteger_default(n7); + return baseSlice_default(array, n7 < 0 ? 0 : n7, length); +} +var drop_default; +var init_drop = __esm({ + "node_modules/lodash-es/drop.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_toInteger(); + drop_default = drop; + } +}); + +// node_modules/lodash-es/dropRight.js +function dropRight(array, n7, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n7 = guard || n7 === void 0 ? 1 : toInteger_default(n7); + n7 = length - n7; + return baseSlice_default(array, 0, n7 < 0 ? 0 : n7); +} +var dropRight_default; +var init_dropRight = __esm({ + "node_modules/lodash-es/dropRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_toInteger(); + dropRight_default = dropRight; + } +}); + +// node_modules/lodash-es/_baseWhile.js +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, index4 = fromRight ? length : -1; + while ((fromRight ? index4-- : ++index4 < length) && predicate(array[index4], index4, array)) { + } + return isDrop ? baseSlice_default(array, fromRight ? 0 : index4, fromRight ? index4 + 1 : length) : baseSlice_default(array, fromRight ? index4 + 1 : 0, fromRight ? length : index4); +} +var baseWhile_default; +var init_baseWhile = __esm({ + "node_modules/lodash-es/_baseWhile.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + baseWhile_default = baseWhile; + } +}); + +// node_modules/lodash-es/dropRightWhile.js +function dropRightWhile(array, predicate) { + return array && array.length ? baseWhile_default(array, baseIteratee_default(predicate, 3), true, true) : []; +} +var dropRightWhile_default; +var init_dropRightWhile = __esm({ + "node_modules/lodash-es/dropRightWhile.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseWhile(); + dropRightWhile_default = dropRightWhile; + } +}); + +// node_modules/lodash-es/dropWhile.js +function dropWhile(array, predicate) { + return array && array.length ? baseWhile_default(array, baseIteratee_default(predicate, 3), true) : []; +} +var dropWhile_default; +var init_dropWhile = __esm({ + "node_modules/lodash-es/dropWhile.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseWhile(); + dropWhile_default = dropWhile; + } +}); + +// node_modules/lodash-es/_castFunction.js +function castFunction(value2) { + return typeof value2 == "function" ? value2 : identity_default; +} +var castFunction_default; +var init_castFunction = __esm({ + "node_modules/lodash-es/_castFunction.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_identity2(); + castFunction_default = castFunction; + } +}); + +// node_modules/lodash-es/forEach.js +function forEach2(collection, iteratee2) { + var func = isArray_default(collection) ? arrayEach_default : baseEach_default; + return func(collection, castFunction_default(iteratee2)); +} +var forEach_default; +var init_forEach = __esm({ + "node_modules/lodash-es/forEach.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_baseEach(); + init_castFunction(); + init_isArray(); + forEach_default = forEach2; + } +}); + +// node_modules/lodash-es/each.js +var init_each = __esm({ + "node_modules/lodash-es/each.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_forEach(); + } +}); + +// node_modules/lodash-es/_arrayEachRight.js +function arrayEachRight(array, iteratee2) { + var length = array == null ? 0 : array.length; + while (length--) { + if (iteratee2(array[length], length, array) === false) { + break; + } + } + return array; +} +var arrayEachRight_default; +var init_arrayEachRight = __esm({ + "node_modules/lodash-es/_arrayEachRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayEachRight_default = arrayEachRight; + } +}); + +// node_modules/lodash-es/_baseForRight.js +var baseForRight, baseForRight_default; +var init_baseForRight = __esm({ + "node_modules/lodash-es/_baseForRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createBaseFor(); + baseForRight = createBaseFor_default(true); + baseForRight_default = baseForRight; + } +}); + +// node_modules/lodash-es/_baseForOwnRight.js +function baseForOwnRight(object, iteratee2) { + return object && baseForRight_default(object, iteratee2, keys_default); +} +var baseForOwnRight_default; +var init_baseForOwnRight = __esm({ + "node_modules/lodash-es/_baseForOwnRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForRight(); + init_keys(); + baseForOwnRight_default = baseForOwnRight; + } +}); + +// node_modules/lodash-es/_baseEachRight.js +var baseEachRight, baseEachRight_default; +var init_baseEachRight = __esm({ + "node_modules/lodash-es/_baseEachRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForOwnRight(); + init_createBaseEach(); + baseEachRight = createBaseEach_default(baseForOwnRight_default, true); + baseEachRight_default = baseEachRight; + } +}); + +// node_modules/lodash-es/forEachRight.js +function forEachRight(collection, iteratee2) { + var func = isArray_default(collection) ? arrayEachRight_default : baseEachRight_default; + return func(collection, castFunction_default(iteratee2)); +} +var forEachRight_default; +var init_forEachRight = __esm({ + "node_modules/lodash-es/forEachRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEachRight(); + init_baseEachRight(); + init_castFunction(); + init_isArray(); + forEachRight_default = forEachRight; + } +}); + +// node_modules/lodash-es/eachRight.js +var init_eachRight = __esm({ + "node_modules/lodash-es/eachRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_forEachRight(); + } +}); + +// node_modules/lodash-es/endsWith.js +function endsWith(string2, target, position) { + string2 = toString_default(string2); + target = baseToString_default(target); + var length = string2.length; + position = position === void 0 ? length : baseClamp_default(toInteger_default(position), 0, length); + var end = position; + position -= target.length; + return position >= 0 && string2.slice(position, end) == target; +} +var endsWith_default; +var init_endsWith = __esm({ + "node_modules/lodash-es/endsWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_baseToString(); + init_toInteger(); + init_toString(); + endsWith_default = endsWith; + } +}); + +// node_modules/lodash-es/_baseToPairs.js +function baseToPairs(object, props) { + return arrayMap_default(props, function(key) { + return [key, object[key]]; + }); +} +var baseToPairs_default; +var init_baseToPairs = __esm({ + "node_modules/lodash-es/_baseToPairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + baseToPairs_default = baseToPairs; + } +}); + +// node_modules/lodash-es/_setToPairs.js +function setToPairs(set4) { + var index4 = -1, result2 = Array(set4.size); + set4.forEach(function(value2) { + result2[++index4] = [value2, value2]; + }); + return result2; +} +var setToPairs_default; +var init_setToPairs = __esm({ + "node_modules/lodash-es/_setToPairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + setToPairs_default = setToPairs; + } +}); + +// node_modules/lodash-es/_createToPairs.js +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag_default(object); + if (tag == mapTag7) { + return mapToArray_default(object); + } + if (tag == setTag7) { + return setToPairs_default(object); + } + return baseToPairs_default(object, keysFunc(object)); + }; +} +var mapTag7, setTag7, createToPairs_default; +var init_createToPairs = __esm({ + "node_modules/lodash-es/_createToPairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToPairs(); + init_getTag(); + init_mapToArray(); + init_setToPairs(); + mapTag7 = "[object Map]"; + setTag7 = "[object Set]"; + createToPairs_default = createToPairs; + } +}); + +// node_modules/lodash-es/toPairs.js +var toPairs, toPairs_default; +var init_toPairs = __esm({ + "node_modules/lodash-es/toPairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createToPairs(); + init_keys(); + toPairs = createToPairs_default(keys_default); + toPairs_default = toPairs; + } +}); + +// node_modules/lodash-es/entries.js +var init_entries = __esm({ + "node_modules/lodash-es/entries.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toPairs(); + } +}); + +// node_modules/lodash-es/toPairsIn.js +var toPairsIn, toPairsIn_default; +var init_toPairsIn = __esm({ + "node_modules/lodash-es/toPairsIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createToPairs(); + init_keysIn(); + toPairsIn = createToPairs_default(keysIn_default); + toPairsIn_default = toPairsIn; + } +}); + +// node_modules/lodash-es/entriesIn.js +var init_entriesIn = __esm({ + "node_modules/lodash-es/entriesIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toPairsIn(); + } +}); + +// node_modules/lodash-es/_escapeHtmlChar.js +var htmlEscapes, escapeHtmlChar, escapeHtmlChar_default; +var init_escapeHtmlChar = __esm({ + "node_modules/lodash-es/_escapeHtmlChar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePropertyOf(); + htmlEscapes = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + escapeHtmlChar = basePropertyOf_default(htmlEscapes); + escapeHtmlChar_default = escapeHtmlChar; + } +}); + +// node_modules/lodash-es/escape.js +function escape2(string2) { + string2 = toString_default(string2); + return string2 && reHasUnescapedHtml.test(string2) ? string2.replace(reUnescapedHtml, escapeHtmlChar_default) : string2; +} +var reUnescapedHtml, reHasUnescapedHtml, escape_default; +var init_escape = __esm({ + "node_modules/lodash-es/escape.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_escapeHtmlChar(); + init_toString(); + reUnescapedHtml = /[&<>"']/g; + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + escape_default = escape2; + } +}); + +// node_modules/lodash-es/escapeRegExp.js +function escapeRegExp(string2) { + string2 = toString_default(string2); + return string2 && reHasRegExpChar.test(string2) ? string2.replace(reRegExpChar2, "\\$&") : string2; +} +var reRegExpChar2, reHasRegExpChar, escapeRegExp_default; +var init_escapeRegExp = __esm({ + "node_modules/lodash-es/escapeRegExp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g; + reHasRegExpChar = RegExp(reRegExpChar2.source); + escapeRegExp_default = escapeRegExp; + } +}); + +// node_modules/lodash-es/_arrayEvery.js +function arrayEvery(array, predicate) { + var index4 = -1, length = array == null ? 0 : array.length; + while (++index4 < length) { + if (!predicate(array[index4], index4, array)) { + return false; + } + } + return true; +} +var arrayEvery_default; +var init_arrayEvery = __esm({ + "node_modules/lodash-es/_arrayEvery.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayEvery_default = arrayEvery; + } +}); + +// node_modules/lodash-es/_baseEvery.js +function baseEvery(collection, predicate) { + var result2 = true; + baseEach_default(collection, function(value2, index4, collection2) { + result2 = !!predicate(value2, index4, collection2); + return result2; + }); + return result2; +} +var baseEvery_default; +var init_baseEvery = __esm({ + "node_modules/lodash-es/_baseEvery.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseEach(); + baseEvery_default = baseEvery; + } +}); + +// node_modules/lodash-es/every.js +function every(collection, predicate, guard) { + var func = isArray_default(collection) ? arrayEvery_default : baseEvery_default; + if (guard && isIterateeCall_default(collection, predicate, guard)) { + predicate = void 0; + } + return func(collection, baseIteratee_default(predicate, 3)); +} +var every_default; +var init_every = __esm({ + "node_modules/lodash-es/every.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEvery(); + init_baseEvery(); + init_baseIteratee(); + init_isArray(); + init_isIterateeCall(); + every_default = every; + } +}); + +// node_modules/lodash-es/extend.js +var init_extend = __esm({ + "node_modules/lodash-es/extend.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignIn(); + } +}); + +// node_modules/lodash-es/extendWith.js +var init_extendWith = __esm({ + "node_modules/lodash-es/extendWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignInWith(); + } +}); + +// node_modules/lodash-es/toLength.js +function toLength(value2) { + return value2 ? baseClamp_default(toInteger_default(value2), 0, MAX_ARRAY_LENGTH2) : 0; +} +var MAX_ARRAY_LENGTH2, toLength_default; +var init_toLength = __esm({ + "node_modules/lodash-es/toLength.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_toInteger(); + MAX_ARRAY_LENGTH2 = 4294967295; + toLength_default = toLength; + } +}); + +// node_modules/lodash-es/_baseFill.js +function baseFill(array, value2, start, end) { + var length = array.length; + start = toInteger_default(start); + if (start < 0) { + start = -start > length ? 0 : length + start; + } + end = end === void 0 || end > length ? length : toInteger_default(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength_default(end); + while (start < end) { + array[start++] = value2; + } + return array; +} +var baseFill_default; +var init_baseFill = __esm({ + "node_modules/lodash-es/_baseFill.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toInteger(); + init_toLength(); + baseFill_default = baseFill; + } +}); + +// node_modules/lodash-es/fill.js +function fill(array, value2, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != "number" && isIterateeCall_default(array, value2, start)) { + start = 0; + end = length; + } + return baseFill_default(array, value2, start, end); +} +var fill_default; +var init_fill = __esm({ + "node_modules/lodash-es/fill.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFill(); + init_isIterateeCall(); + fill_default = fill; + } +}); + +// node_modules/lodash-es/_baseFilter.js +function baseFilter(collection, predicate) { + var result2 = []; + baseEach_default(collection, function(value2, index4, collection2) { + if (predicate(value2, index4, collection2)) { + result2.push(value2); + } + }); + return result2; +} +var baseFilter_default; +var init_baseFilter = __esm({ + "node_modules/lodash-es/_baseFilter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseEach(); + baseFilter_default = baseFilter; + } +}); + +// node_modules/lodash-es/filter.js +function filter(collection, predicate) { + var func = isArray_default(collection) ? arrayFilter_default : baseFilter_default; + return func(collection, baseIteratee_default(predicate, 3)); +} +var filter_default; +var init_filter = __esm({ + "node_modules/lodash-es/filter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_baseFilter(); + init_baseIteratee(); + init_isArray(); + filter_default = filter; + } +}); + +// node_modules/lodash-es/_createFind.js +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike_default(collection)) { + var iteratee2 = baseIteratee_default(predicate, 3); + collection = keys_default(collection); + predicate = function(key) { + return iteratee2(iterable[key], key, iterable); + }; + } + var index4 = findIndexFunc(collection, predicate, fromIndex); + return index4 > -1 ? iterable[iteratee2 ? collection[index4] : index4] : void 0; + }; +} +var createFind_default; +var init_createFind = __esm({ + "node_modules/lodash-es/_createFind.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_isArrayLike(); + init_keys(); + createFind_default = createFind; + } +}); + +// node_modules/lodash-es/findIndex.js +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index4 = fromIndex == null ? 0 : toInteger_default(fromIndex); + if (index4 < 0) { + index4 = nativeMax7(length + index4, 0); + } + return baseFindIndex_default(array, baseIteratee_default(predicate, 3), index4); +} +var nativeMax7, findIndex_default; +var init_findIndex = __esm({ + "node_modules/lodash-es/findIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindIndex(); + init_baseIteratee(); + init_toInteger(); + nativeMax7 = Math.max; + findIndex_default = findIndex; + } +}); + +// node_modules/lodash-es/find.js +var find, find_default; +var init_find = __esm({ + "node_modules/lodash-es/find.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createFind(); + init_findIndex(); + find = createFind_default(findIndex_default); + find_default = find; + } +}); + +// node_modules/lodash-es/_baseFindKey.js +function baseFindKey(collection, predicate, eachFunc) { + var result2; + eachFunc(collection, function(value2, key, collection2) { + if (predicate(value2, key, collection2)) { + result2 = key; + return false; + } + }); + return result2; +} +var baseFindKey_default; +var init_baseFindKey = __esm({ + "node_modules/lodash-es/_baseFindKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseFindKey_default = baseFindKey; + } +}); + +// node_modules/lodash-es/findKey.js +function findKey(object, predicate) { + return baseFindKey_default(object, baseIteratee_default(predicate, 3), baseForOwn_default); +} +var findKey_default; +var init_findKey = __esm({ + "node_modules/lodash-es/findKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindKey(); + init_baseForOwn(); + init_baseIteratee(); + findKey_default = findKey; + } +}); + +// node_modules/lodash-es/findLastIndex.js +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index4 = length - 1; + if (fromIndex !== void 0) { + index4 = toInteger_default(fromIndex); + index4 = fromIndex < 0 ? nativeMax8(length + index4, 0) : nativeMin5(index4, length - 1); + } + return baseFindIndex_default(array, baseIteratee_default(predicate, 3), index4, true); +} +var nativeMax8, nativeMin5, findLastIndex_default; +var init_findLastIndex = __esm({ + "node_modules/lodash-es/findLastIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindIndex(); + init_baseIteratee(); + init_toInteger(); + nativeMax8 = Math.max; + nativeMin5 = Math.min; + findLastIndex_default = findLastIndex; + } +}); + +// node_modules/lodash-es/findLast.js +var findLast, findLast_default; +var init_findLast = __esm({ + "node_modules/lodash-es/findLast.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createFind(); + init_findLastIndex(); + findLast = createFind_default(findLastIndex_default); + findLast_default = findLast; + } +}); + +// node_modules/lodash-es/findLastKey.js +function findLastKey(object, predicate) { + return baseFindKey_default(object, baseIteratee_default(predicate, 3), baseForOwnRight_default); +} +var findLastKey_default; +var init_findLastKey = __esm({ + "node_modules/lodash-es/findLastKey.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindKey(); + init_baseForOwnRight(); + init_baseIteratee(); + findLastKey_default = findLastKey; + } +}); + +// node_modules/lodash-es/head.js +function head(array) { + return array && array.length ? array[0] : void 0; +} +var head_default; +var init_head = __esm({ + "node_modules/lodash-es/head.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + head_default = head; + } +}); + +// node_modules/lodash-es/first.js +var init_first = __esm({ + "node_modules/lodash-es/first.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_head(); + } +}); + +// node_modules/lodash-es/_baseMap.js +function baseMap(collection, iteratee2) { + var index4 = -1, result2 = isArrayLike_default(collection) ? Array(collection.length) : []; + baseEach_default(collection, function(value2, key, collection2) { + result2[++index4] = iteratee2(value2, key, collection2); + }); + return result2; +} +var baseMap_default; +var init_baseMap = __esm({ + "node_modules/lodash-es/_baseMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseEach(); + init_isArrayLike(); + baseMap_default = baseMap; + } +}); + +// node_modules/lodash-es/map.js +function map2(collection, iteratee2) { + var func = isArray_default(collection) ? arrayMap_default : baseMap_default; + return func(collection, baseIteratee_default(iteratee2, 3)); +} +var map_default; +var init_map2 = __esm({ + "node_modules/lodash-es/map.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIteratee(); + init_baseMap(); + init_isArray(); + map_default = map2; + } +}); + +// node_modules/lodash-es/flatMap.js +function flatMap(collection, iteratee2) { + return baseFlatten_default(map_default(collection, iteratee2), 1); +} +var flatMap_default; +var init_flatMap = __esm({ + "node_modules/lodash-es/flatMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_map2(); + flatMap_default = flatMap; + } +}); + +// node_modules/lodash-es/flatMapDeep.js +function flatMapDeep(collection, iteratee2) { + return baseFlatten_default(map_default(collection, iteratee2), INFINITY4); +} +var INFINITY4, flatMapDeep_default; +var init_flatMapDeep = __esm({ + "node_modules/lodash-es/flatMapDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_map2(); + INFINITY4 = 1 / 0; + flatMapDeep_default = flatMapDeep; + } +}); + +// node_modules/lodash-es/flatMapDepth.js +function flatMapDepth(collection, iteratee2, depth) { + depth = depth === void 0 ? 1 : toInteger_default(depth); + return baseFlatten_default(map_default(collection, iteratee2), depth); +} +var flatMapDepth_default; +var init_flatMapDepth = __esm({ + "node_modules/lodash-es/flatMapDepth.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_map2(); + init_toInteger(); + flatMapDepth_default = flatMapDepth; + } +}); + +// node_modules/lodash-es/flattenDeep.js +function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten_default(array, INFINITY5) : []; +} +var INFINITY5, flattenDeep_default; +var init_flattenDeep = __esm({ + "node_modules/lodash-es/flattenDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + INFINITY5 = 1 / 0; + flattenDeep_default = flattenDeep; + } +}); + +// node_modules/lodash-es/flattenDepth.js +function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === void 0 ? 1 : toInteger_default(depth); + return baseFlatten_default(array, depth); +} +var flattenDepth_default; +var init_flattenDepth = __esm({ + "node_modules/lodash-es/flattenDepth.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_toInteger(); + flattenDepth_default = flattenDepth; + } +}); + +// node_modules/lodash-es/flip.js +function flip(func) { + return createWrap_default(func, WRAP_FLIP_FLAG3); +} +var WRAP_FLIP_FLAG3, flip_default; +var init_flip = __esm({ + "node_modules/lodash-es/flip.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createWrap(); + WRAP_FLIP_FLAG3 = 512; + flip_default = flip; + } +}); + +// node_modules/lodash-es/floor.js +var floor, floor_default; +var init_floor = __esm({ + "node_modules/lodash-es/floor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRound(); + floor = createRound_default("floor"); + floor_default = floor; + } +}); + +// node_modules/lodash-es/_createFlow.js +function createFlow(fromRight) { + return flatRest_default(function(funcs) { + var length = funcs.length, index4 = length, prereq = LodashWrapper_default.prototype.thru; + if (fromRight) { + funcs.reverse(); + } + while (index4--) { + var func = funcs[index4]; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT8); + } + if (prereq && !wrapper && getFuncName_default(func) == "wrapper") { + var wrapper = new LodashWrapper_default([], true); + } + } + index4 = wrapper ? index4 : length; + while (++index4 < length) { + func = funcs[index4]; + var funcName = getFuncName_default(func), data = funcName == "wrapper" ? getData_default(func) : void 0; + if (data && isLaziable_default(data[0]) && data[1] == (WRAP_ARY_FLAG5 | WRAP_CURRY_FLAG7 | WRAP_PARTIAL_FLAG6 | WRAP_REARG_FLAG3) && !data[4].length && data[9] == 1) { + wrapper = wrapper[getFuncName_default(data[0])].apply(wrapper, data[3]); + } else { + wrapper = func.length == 1 && isLaziable_default(func) ? wrapper[funcName]() : wrapper.thru(func); + } + } + return function() { + var args = arguments, value2 = args[0]; + if (wrapper && args.length == 1 && isArray_default(value2)) { + return wrapper.plant(value2).value(); + } + var index5 = 0, result2 = length ? funcs[index5].apply(this, args) : value2; + while (++index5 < length) { + result2 = funcs[index5].call(this, result2); + } + return result2; + }; + }); +} +var FUNC_ERROR_TEXT8, WRAP_CURRY_FLAG7, WRAP_PARTIAL_FLAG6, WRAP_ARY_FLAG5, WRAP_REARG_FLAG3, createFlow_default; +var init_createFlow = __esm({ + "node_modules/lodash-es/_createFlow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LodashWrapper(); + init_flatRest(); + init_getData(); + init_getFuncName(); + init_isArray(); + init_isLaziable(); + FUNC_ERROR_TEXT8 = "Expected a function"; + WRAP_CURRY_FLAG7 = 8; + WRAP_PARTIAL_FLAG6 = 32; + WRAP_ARY_FLAG5 = 128; + WRAP_REARG_FLAG3 = 256; + createFlow_default = createFlow; + } +}); + +// node_modules/lodash-es/flow.js +var flow, flow_default; +var init_flow = __esm({ + "node_modules/lodash-es/flow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createFlow(); + flow = createFlow_default(); + flow_default = flow; + } +}); + +// node_modules/lodash-es/flowRight.js +var flowRight, flowRight_default; +var init_flowRight = __esm({ + "node_modules/lodash-es/flowRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createFlow(); + flowRight = createFlow_default(true); + flowRight_default = flowRight; + } +}); + +// node_modules/lodash-es/forIn.js +function forIn(object, iteratee2) { + return object == null ? object : baseFor_default(object, castFunction_default(iteratee2), keysIn_default); +} +var forIn_default; +var init_forIn = __esm({ + "node_modules/lodash-es/forIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFor(); + init_castFunction(); + init_keysIn(); + forIn_default = forIn; + } +}); + +// node_modules/lodash-es/forInRight.js +function forInRight(object, iteratee2) { + return object == null ? object : baseForRight_default(object, castFunction_default(iteratee2), keysIn_default); +} +var forInRight_default; +var init_forInRight = __esm({ + "node_modules/lodash-es/forInRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForRight(); + init_castFunction(); + init_keysIn(); + forInRight_default = forInRight; + } +}); + +// node_modules/lodash-es/forOwn.js +function forOwn(object, iteratee2) { + return object && baseForOwn_default(object, castFunction_default(iteratee2)); +} +var forOwn_default; +var init_forOwn = __esm({ + "node_modules/lodash-es/forOwn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForOwn(); + init_castFunction(); + forOwn_default = forOwn; + } +}); + +// node_modules/lodash-es/forOwnRight.js +function forOwnRight(object, iteratee2) { + return object && baseForOwnRight_default(object, castFunction_default(iteratee2)); +} +var forOwnRight_default; +var init_forOwnRight = __esm({ + "node_modules/lodash-es/forOwnRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForOwnRight(); + init_castFunction(); + forOwnRight_default = forOwnRight; + } +}); + +// node_modules/lodash-es/fromPairs.js +function fromPairs(pairs3) { + var index4 = -1, length = pairs3 == null ? 0 : pairs3.length, result2 = {}; + while (++index4 < length) { + var pair = pairs3[index4]; + baseAssignValue_default(result2, pair[0], pair[1]); + } + return result2; +} +var fromPairs_default; +var init_fromPairs = __esm({ + "node_modules/lodash-es/fromPairs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + fromPairs_default = fromPairs; + } +}); + +// node_modules/lodash-es/_baseFunctions.js +function baseFunctions(object, props) { + return arrayFilter_default(props, function(key) { + return isFunction_default(object[key]); + }); +} +var baseFunctions_default; +var init_baseFunctions = __esm({ + "node_modules/lodash-es/_baseFunctions.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_isFunction(); + baseFunctions_default = baseFunctions; + } +}); + +// node_modules/lodash-es/functions.js +function functions(object) { + return object == null ? [] : baseFunctions_default(object, keys_default(object)); +} +var functions_default; +var init_functions = __esm({ + "node_modules/lodash-es/functions.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFunctions(); + init_keys(); + functions_default = functions; + } +}); + +// node_modules/lodash-es/functionsIn.js +function functionsIn(object) { + return object == null ? [] : baseFunctions_default(object, keysIn_default(object)); +} +var functionsIn_default; +var init_functionsIn = __esm({ + "node_modules/lodash-es/functionsIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFunctions(); + init_keysIn(); + functionsIn_default = functionsIn; + } +}); + +// node_modules/lodash-es/groupBy.js +var objectProto22, hasOwnProperty19, groupBy, groupBy_default; +var init_groupBy = __esm({ + "node_modules/lodash-es/groupBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_createAggregator(); + objectProto22 = Object.prototype; + hasOwnProperty19 = objectProto22.hasOwnProperty; + groupBy = createAggregator_default(function(result2, value2, key) { + if (hasOwnProperty19.call(result2, key)) { + result2[key].push(value2); + } else { + baseAssignValue_default(result2, key, [value2]); + } + }); + groupBy_default = groupBy; + } +}); + +// node_modules/lodash-es/_baseGt.js +function baseGt(value2, other) { + return value2 > other; +} +var baseGt_default; +var init_baseGt = __esm({ + "node_modules/lodash-es/_baseGt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseGt_default = baseGt; + } +}); + +// node_modules/lodash-es/_createRelationalOperation.js +function createRelationalOperation(operator) { + return function(value2, other) { + if (!(typeof value2 == "string" && typeof other == "string")) { + value2 = toNumber_default(value2); + other = toNumber_default(other); + } + return operator(value2, other); + }; +} +var createRelationalOperation_default; +var init_createRelationalOperation = __esm({ + "node_modules/lodash-es/_createRelationalOperation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toNumber(); + createRelationalOperation_default = createRelationalOperation; + } +}); + +// node_modules/lodash-es/gt.js +var gt, gt_default; +var init_gt = __esm({ + "node_modules/lodash-es/gt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGt(); + init_createRelationalOperation(); + gt = createRelationalOperation_default(baseGt_default); + gt_default = gt; + } +}); + +// node_modules/lodash-es/gte.js +var gte, gte_default; +var init_gte = __esm({ + "node_modules/lodash-es/gte.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRelationalOperation(); + gte = createRelationalOperation_default(function(value2, other) { + return value2 >= other; + }); + gte_default = gte; + } +}); + +// node_modules/lodash-es/_baseHas.js +function baseHas(object, key) { + return object != null && hasOwnProperty20.call(object, key); +} +var objectProto23, hasOwnProperty20, baseHas_default; +var init_baseHas = __esm({ + "node_modules/lodash-es/_baseHas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + objectProto23 = Object.prototype; + hasOwnProperty20 = objectProto23.hasOwnProperty; + baseHas_default = baseHas; + } +}); + +// node_modules/lodash-es/has.js +function has(object, path2) { + return object != null && hasPath_default(object, path2, baseHas_default); +} +var has_default; +var init_has = __esm({ + "node_modules/lodash-es/has.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseHas(); + init_hasPath(); + has_default = has; + } +}); + +// node_modules/lodash-es/_baseInRange.js +function baseInRange(number, start, end) { + return number >= nativeMin6(start, end) && number < nativeMax9(start, end); +} +var nativeMax9, nativeMin6, baseInRange_default; +var init_baseInRange = __esm({ + "node_modules/lodash-es/_baseInRange.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeMax9 = Math.max; + nativeMin6 = Math.min; + baseInRange_default = baseInRange; + } +}); + +// node_modules/lodash-es/inRange.js +function inRange(number, start, end) { + start = toFinite_default(start); + if (end === void 0) { + end = start; + start = 0; + } else { + end = toFinite_default(end); + } + number = toNumber_default(number); + return baseInRange_default(number, start, end); +} +var inRange_default; +var init_inRange = __esm({ + "node_modules/lodash-es/inRange.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseInRange(); + init_toFinite(); + init_toNumber(); + inRange_default = inRange; + } +}); + +// node_modules/lodash-es/isString.js +function isString(value2) { + return typeof value2 == "string" || !isArray_default(value2) && isObjectLike_default(value2) && baseGetTag_default(value2) == stringTag5; +} +var stringTag5, isString_default; +var init_isString = __esm({ + "node_modules/lodash-es/isString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isArray(); + init_isObjectLike(); + stringTag5 = "[object String]"; + isString_default = isString; + } +}); + +// node_modules/lodash-es/_baseValues.js +function baseValues(object, props) { + return arrayMap_default(props, function(key) { + return object[key]; + }); +} +var baseValues_default; +var init_baseValues = __esm({ + "node_modules/lodash-es/_baseValues.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + baseValues_default = baseValues; + } +}); + +// node_modules/lodash-es/values.js +function values(object) { + return object == null ? [] : baseValues_default(object, keys_default(object)); +} +var values_default; +var init_values = __esm({ + "node_modules/lodash-es/values.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseValues(); + init_keys(); + values_default = values; + } +}); + +// node_modules/lodash-es/includes.js +function includes(collection, value2, fromIndex, guard) { + collection = isArrayLike_default(collection) ? collection : values_default(collection); + fromIndex = fromIndex && !guard ? toInteger_default(fromIndex) : 0; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax10(length + fromIndex, 0); + } + return isString_default(collection) ? fromIndex <= length && collection.indexOf(value2, fromIndex) > -1 : !!length && baseIndexOf_default(collection, value2, fromIndex) > -1; +} +var nativeMax10, includes_default; +var init_includes = __esm({ + "node_modules/lodash-es/includes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIndexOf(); + init_isArrayLike(); + init_isString(); + init_toInteger(); + init_values(); + nativeMax10 = Math.max; + includes_default = includes; + } +}); + +// node_modules/lodash-es/indexOf.js +function indexOf2(array, value2, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index4 = fromIndex == null ? 0 : toInteger_default(fromIndex); + if (index4 < 0) { + index4 = nativeMax11(length + index4, 0); + } + return baseIndexOf_default(array, value2, index4); +} +var nativeMax11, indexOf_default; +var init_indexOf = __esm({ + "node_modules/lodash-es/indexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIndexOf(); + init_toInteger(); + nativeMax11 = Math.max; + indexOf_default = indexOf2; + } +}); + +// node_modules/lodash-es/initial.js +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice_default(array, 0, -1) : []; +} +var initial_default; +var init_initial = __esm({ + "node_modules/lodash-es/initial.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + initial_default = initial; + } +}); + +// node_modules/lodash-es/_baseIntersection.js +function baseIntersection(arrays, iteratee2, comparator) { + var includes2 = comparator ? arrayIncludesWith_default : arrayIncludes_default, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result2 = []; + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee2) { + array = arrayMap_default(array, baseUnary_default(iteratee2)); + } + maxLength = nativeMin7(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache_default(othIndex && array) : void 0; + } + array = arrays[0]; + var index4 = -1, seen = caches[0]; + outer: + while (++index4 < length && result2.length < maxLength) { + var value2 = array[index4], computed = iteratee2 ? iteratee2(value2) : value2; + value2 = comparator || value2 !== 0 ? value2 : 0; + if (!(seen ? cacheHas_default(seen, computed) : includes2(result2, computed, comparator))) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache ? cacheHas_default(cache, computed) : includes2(arrays[othIndex], computed, comparator))) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result2.push(value2); + } + } + return result2; +} +var nativeMin7, baseIntersection_default; +var init_baseIntersection = __esm({ + "node_modules/lodash-es/_baseIntersection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_SetCache(); + init_arrayIncludes(); + init_arrayIncludesWith(); + init_arrayMap(); + init_baseUnary(); + init_cacheHas(); + nativeMin7 = Math.min; + baseIntersection_default = baseIntersection; + } +}); + +// node_modules/lodash-es/_castArrayLikeObject.js +function castArrayLikeObject(value2) { + return isArrayLikeObject_default(value2) ? value2 : []; +} +var castArrayLikeObject_default; +var init_castArrayLikeObject = __esm({ + "node_modules/lodash-es/_castArrayLikeObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isArrayLikeObject(); + castArrayLikeObject_default = castArrayLikeObject; + } +}); + +// node_modules/lodash-es/intersection.js +var intersection, intersection_default; +var init_intersection = __esm({ + "node_modules/lodash-es/intersection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIntersection(); + init_baseRest(); + init_castArrayLikeObject(); + intersection = baseRest_default(function(arrays) { + var mapped = arrayMap_default(arrays, castArrayLikeObject_default); + return mapped.length && mapped[0] === arrays[0] ? baseIntersection_default(mapped) : []; + }); + intersection_default = intersection; + } +}); + +// node_modules/lodash-es/intersectionBy.js +var intersectionBy, intersectionBy_default; +var init_intersectionBy = __esm({ + "node_modules/lodash-es/intersectionBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIntersection(); + init_baseIteratee(); + init_baseRest(); + init_castArrayLikeObject(); + init_last(); + intersectionBy = baseRest_default(function(arrays) { + var iteratee2 = last_default(arrays), mapped = arrayMap_default(arrays, castArrayLikeObject_default); + if (iteratee2 === last_default(mapped)) { + iteratee2 = void 0; + } else { + mapped.pop(); + } + return mapped.length && mapped[0] === arrays[0] ? baseIntersection_default(mapped, baseIteratee_default(iteratee2, 2)) : []; + }); + intersectionBy_default = intersectionBy; + } +}); + +// node_modules/lodash-es/intersectionWith.js +var intersectionWith, intersectionWith_default; +var init_intersectionWith = __esm({ + "node_modules/lodash-es/intersectionWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIntersection(); + init_baseRest(); + init_castArrayLikeObject(); + init_last(); + intersectionWith = baseRest_default(function(arrays) { + var comparator = last_default(arrays), mapped = arrayMap_default(arrays, castArrayLikeObject_default); + comparator = typeof comparator == "function" ? comparator : void 0; + if (comparator) { + mapped.pop(); + } + return mapped.length && mapped[0] === arrays[0] ? baseIntersection_default(mapped, void 0, comparator) : []; + }); + intersectionWith_default = intersectionWith; + } +}); + +// node_modules/lodash-es/_baseInverter.js +function baseInverter(object, setter, iteratee2, accumulator) { + baseForOwn_default(object, function(value2, key, object2) { + setter(accumulator, iteratee2(value2), key, object2); + }); + return accumulator; +} +var baseInverter_default; +var init_baseInverter = __esm({ + "node_modules/lodash-es/_baseInverter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseForOwn(); + baseInverter_default = baseInverter; + } +}); + +// node_modules/lodash-es/_createInverter.js +function createInverter(setter, toIteratee) { + return function(object, iteratee2) { + return baseInverter_default(object, setter, toIteratee(iteratee2), {}); + }; +} +var createInverter_default; +var init_createInverter = __esm({ + "node_modules/lodash-es/_createInverter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseInverter(); + createInverter_default = createInverter; + } +}); + +// node_modules/lodash-es/invert.js +var objectProto24, nativeObjectToString3, invert, invert_default; +var init_invert = __esm({ + "node_modules/lodash-es/invert.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_constant(); + init_createInverter(); + init_identity2(); + objectProto24 = Object.prototype; + nativeObjectToString3 = objectProto24.toString; + invert = createInverter_default(function(result2, value2, key) { + if (value2 != null && typeof value2.toString != "function") { + value2 = nativeObjectToString3.call(value2); + } + result2[value2] = key; + }, constant_default(identity_default)); + invert_default = invert; + } +}); + +// node_modules/lodash-es/invertBy.js +var objectProto25, hasOwnProperty21, nativeObjectToString4, invertBy, invertBy_default; +var init_invertBy = __esm({ + "node_modules/lodash-es/invertBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_createInverter(); + objectProto25 = Object.prototype; + hasOwnProperty21 = objectProto25.hasOwnProperty; + nativeObjectToString4 = objectProto25.toString; + invertBy = createInverter_default(function(result2, value2, key) { + if (value2 != null && typeof value2.toString != "function") { + value2 = nativeObjectToString4.call(value2); + } + if (hasOwnProperty21.call(result2, value2)) { + result2[value2].push(key); + } else { + result2[value2] = [key]; + } + }, baseIteratee_default); + invertBy_default = invertBy; + } +}); + +// node_modules/lodash-es/_parent.js +function parent(object, path2) { + return path2.length < 2 ? object : baseGet_default(object, baseSlice_default(path2, 0, -1)); +} +var parent_default; +var init_parent = __esm({ + "node_modules/lodash-es/_parent.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + init_baseSlice(); + parent_default = parent; + } +}); + +// node_modules/lodash-es/_baseInvoke.js +function baseInvoke(object, path2, args) { + path2 = castPath_default(path2, object); + object = parent_default(object, path2); + var func = object == null ? object : object[toKey_default(last_default(path2))]; + return func == null ? void 0 : apply_default(func, object, args); +} +var baseInvoke_default; +var init_baseInvoke = __esm({ + "node_modules/lodash-es/_baseInvoke.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_castPath(); + init_last(); + init_parent(); + init_toKey(); + baseInvoke_default = baseInvoke; + } +}); + +// node_modules/lodash-es/invoke.js +var invoke, invoke_default; +var init_invoke = __esm({ + "node_modules/lodash-es/invoke.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseInvoke(); + init_baseRest(); + invoke = baseRest_default(baseInvoke_default); + invoke_default = invoke; + } +}); + +// node_modules/lodash-es/invokeMap.js +var invokeMap, invokeMap_default; +var init_invokeMap = __esm({ + "node_modules/lodash-es/invokeMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_baseEach(); + init_baseInvoke(); + init_baseRest(); + init_isArrayLike(); + invokeMap = baseRest_default(function(collection, path2, args) { + var index4 = -1, isFunc = typeof path2 == "function", result2 = isArrayLike_default(collection) ? Array(collection.length) : []; + baseEach_default(collection, function(value2) { + result2[++index4] = isFunc ? apply_default(path2, value2, args) : baseInvoke_default(value2, path2, args); + }); + return result2; + }); + invokeMap_default = invokeMap; + } +}); + +// node_modules/lodash-es/_baseIsArrayBuffer.js +function baseIsArrayBuffer(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == arrayBufferTag5; +} +var arrayBufferTag5, baseIsArrayBuffer_default; +var init_baseIsArrayBuffer = __esm({ + "node_modules/lodash-es/_baseIsArrayBuffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + arrayBufferTag5 = "[object ArrayBuffer]"; + baseIsArrayBuffer_default = baseIsArrayBuffer; + } +}); + +// node_modules/lodash-es/isArrayBuffer.js +var nodeIsArrayBuffer, isArrayBuffer, isArrayBuffer_default; +var init_isArrayBuffer = __esm({ + "node_modules/lodash-es/isArrayBuffer.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsArrayBuffer(); + init_baseUnary(); + init_nodeUtil(); + nodeIsArrayBuffer = nodeUtil_default && nodeUtil_default.isArrayBuffer; + isArrayBuffer = nodeIsArrayBuffer ? baseUnary_default(nodeIsArrayBuffer) : baseIsArrayBuffer_default; + isArrayBuffer_default = isArrayBuffer; + } +}); + +// node_modules/lodash-es/isBoolean.js +function isBoolean(value2) { + return value2 === true || value2 === false || isObjectLike_default(value2) && baseGetTag_default(value2) == boolTag6; +} +var boolTag6, isBoolean_default; +var init_isBoolean = __esm({ + "node_modules/lodash-es/isBoolean.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + boolTag6 = "[object Boolean]"; + isBoolean_default = isBoolean; + } +}); + +// node_modules/lodash-es/_baseIsDate.js +function baseIsDate(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == dateTag5; +} +var dateTag5, baseIsDate_default; +var init_baseIsDate = __esm({ + "node_modules/lodash-es/_baseIsDate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + dateTag5 = "[object Date]"; + baseIsDate_default = baseIsDate; + } +}); + +// node_modules/lodash-es/isDate.js +var nodeIsDate, isDate, isDate_default; +var init_isDate = __esm({ + "node_modules/lodash-es/isDate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsDate(); + init_baseUnary(); + init_nodeUtil(); + nodeIsDate = nodeUtil_default && nodeUtil_default.isDate; + isDate = nodeIsDate ? baseUnary_default(nodeIsDate) : baseIsDate_default; + isDate_default = isDate; + } +}); + +// node_modules/lodash-es/isElement.js +function isElement(value2) { + return isObjectLike_default(value2) && value2.nodeType === 1 && !isPlainObject_default(value2); +} +var isElement_default; +var init_isElement = __esm({ + "node_modules/lodash-es/isElement.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isObjectLike(); + init_isPlainObject(); + isElement_default = isElement; + } +}); + +// node_modules/lodash-es/isEmpty.js +function isEmpty2(value2) { + if (value2 == null) { + return true; + } + if (isArrayLike_default(value2) && (isArray_default(value2) || typeof value2 == "string" || typeof value2.splice == "function" || isBuffer_default(value2) || isTypedArray_default(value2) || isArguments_default(value2))) { + return !value2.length; + } + var tag = getTag_default(value2); + if (tag == mapTag8 || tag == setTag8) { + return !value2.size; + } + if (isPrototype_default(value2)) { + return !baseKeys_default(value2).length; + } + for (var key in value2) { + if (hasOwnProperty22.call(value2, key)) { + return false; + } + } + return true; +} +var mapTag8, setTag8, objectProto26, hasOwnProperty22, isEmpty_default; +var init_isEmpty = __esm({ + "node_modules/lodash-es/isEmpty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseKeys(); + init_getTag(); + init_isArguments(); + init_isArray(); + init_isArrayLike(); + init_isBuffer(); + init_isPrototype(); + init_isTypedArray(); + mapTag8 = "[object Map]"; + setTag8 = "[object Set]"; + objectProto26 = Object.prototype; + hasOwnProperty22 = objectProto26.hasOwnProperty; + isEmpty_default = isEmpty2; + } +}); + +// node_modules/lodash-es/isEqual.js +function isEqual(value2, other) { + return baseIsEqual_default(value2, other); +} +var isEqual_default; +var init_isEqual = __esm({ + "node_modules/lodash-es/isEqual.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsEqual(); + isEqual_default = isEqual; + } +}); + +// node_modules/lodash-es/isEqualWith.js +function isEqualWith(value2, other, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + var result2 = customizer ? customizer(value2, other) : void 0; + return result2 === void 0 ? baseIsEqual_default(value2, other, void 0, customizer) : !!result2; +} +var isEqualWith_default; +var init_isEqualWith = __esm({ + "node_modules/lodash-es/isEqualWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsEqual(); + isEqualWith_default = isEqualWith; + } +}); + +// node_modules/lodash-es/isFinite.js +function isFinite2(value2) { + return typeof value2 == "number" && nativeIsFinite2(value2); +} +var nativeIsFinite2, isFinite_default; +var init_isFinite = __esm({ + "node_modules/lodash-es/isFinite.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + nativeIsFinite2 = root_default.isFinite; + isFinite_default = isFinite2; + } +}); + +// node_modules/lodash-es/isInteger.js +function isInteger(value2) { + return typeof value2 == "number" && value2 == toInteger_default(value2); +} +var isInteger_default; +var init_isInteger = __esm({ + "node_modules/lodash-es/isInteger.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toInteger(); + isInteger_default = isInteger; + } +}); + +// node_modules/lodash-es/isMatch.js +function isMatch(object, source) { + return object === source || baseIsMatch_default(object, source, getMatchData_default(source)); +} +var isMatch_default; +var init_isMatch = __esm({ + "node_modules/lodash-es/isMatch.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsMatch(); + init_getMatchData(); + isMatch_default = isMatch; + } +}); + +// node_modules/lodash-es/isMatchWith.js +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + return baseIsMatch_default(object, source, getMatchData_default(source), customizer); +} +var isMatchWith_default; +var init_isMatchWith = __esm({ + "node_modules/lodash-es/isMatchWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsMatch(); + init_getMatchData(); + isMatchWith_default = isMatchWith; + } +}); + +// node_modules/lodash-es/isNumber.js +function isNumber(value2) { + return typeof value2 == "number" || isObjectLike_default(value2) && baseGetTag_default(value2) == numberTag5; +} +var numberTag5, isNumber_default; +var init_isNumber = __esm({ + "node_modules/lodash-es/isNumber.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + numberTag5 = "[object Number]"; + isNumber_default = isNumber; + } +}); + +// node_modules/lodash-es/isNaN.js +function isNaN2(value2) { + return isNumber_default(value2) && value2 != +value2; +} +var isNaN_default; +var init_isNaN = __esm({ + "node_modules/lodash-es/isNaN.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isNumber(); + isNaN_default = isNaN2; + } +}); + +// node_modules/lodash-es/_isMaskable.js +var isMaskable, isMaskable_default; +var init_isMaskable = __esm({ + "node_modules/lodash-es/_isMaskable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_coreJsData(); + init_isFunction(); + init_stubFalse(); + isMaskable = coreJsData_default ? isFunction_default : stubFalse_default; + isMaskable_default = isMaskable; + } +}); + +// node_modules/lodash-es/isNative.js +function isNative(value2) { + if (isMaskable_default(value2)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative_default(value2); +} +var CORE_ERROR_TEXT, isNative_default; +var init_isNative = __esm({ + "node_modules/lodash-es/isNative.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsNative(); + init_isMaskable(); + CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill."; + isNative_default = isNative; + } +}); + +// node_modules/lodash-es/isNil.js +function isNil(value2) { + return value2 == null; +} +var isNil_default; +var init_isNil = __esm({ + "node_modules/lodash-es/isNil.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isNil_default = isNil; + } +}); + +// node_modules/lodash-es/isNull.js +function isNull(value2) { + return value2 === null; +} +var isNull_default; +var init_isNull = __esm({ + "node_modules/lodash-es/isNull.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isNull_default = isNull; + } +}); + +// node_modules/lodash-es/_baseIsRegExp.js +function baseIsRegExp(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == regexpTag5; +} +var regexpTag5, baseIsRegExp_default; +var init_baseIsRegExp = __esm({ + "node_modules/lodash-es/_baseIsRegExp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + regexpTag5 = "[object RegExp]"; + baseIsRegExp_default = baseIsRegExp; + } +}); + +// node_modules/lodash-es/isRegExp.js +var nodeIsRegExp, isRegExp, isRegExp_default; +var init_isRegExp = __esm({ + "node_modules/lodash-es/isRegExp.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIsRegExp(); + init_baseUnary(); + init_nodeUtil(); + nodeIsRegExp = nodeUtil_default && nodeUtil_default.isRegExp; + isRegExp = nodeIsRegExp ? baseUnary_default(nodeIsRegExp) : baseIsRegExp_default; + isRegExp_default = isRegExp; + } +}); + +// node_modules/lodash-es/isSafeInteger.js +function isSafeInteger(value2) { + return isInteger_default(value2) && value2 >= -MAX_SAFE_INTEGER3 && value2 <= MAX_SAFE_INTEGER3; +} +var MAX_SAFE_INTEGER3, isSafeInteger_default; +var init_isSafeInteger = __esm({ + "node_modules/lodash-es/isSafeInteger.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isInteger(); + MAX_SAFE_INTEGER3 = 9007199254740991; + isSafeInteger_default = isSafeInteger; + } +}); + +// node_modules/lodash-es/isUndefined.js +function isUndefined(value2) { + return value2 === void 0; +} +var isUndefined_default; +var init_isUndefined = __esm({ + "node_modules/lodash-es/isUndefined.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + isUndefined_default = isUndefined; + } +}); + +// node_modules/lodash-es/isWeakMap.js +function isWeakMap(value2) { + return isObjectLike_default(value2) && getTag_default(value2) == weakMapTag4; +} +var weakMapTag4, isWeakMap_default; +var init_isWeakMap = __esm({ + "node_modules/lodash-es/isWeakMap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getTag(); + init_isObjectLike(); + weakMapTag4 = "[object WeakMap]"; + isWeakMap_default = isWeakMap; + } +}); + +// node_modules/lodash-es/isWeakSet.js +function isWeakSet(value2) { + return isObjectLike_default(value2) && baseGetTag_default(value2) == weakSetTag; +} +var weakSetTag, isWeakSet_default; +var init_isWeakSet = __esm({ + "node_modules/lodash-es/isWeakSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGetTag(); + init_isObjectLike(); + weakSetTag = "[object WeakSet]"; + isWeakSet_default = isWeakSet; + } +}); + +// node_modules/lodash-es/iteratee.js +function iteratee(func) { + return baseIteratee_default(typeof func == "function" ? func : baseClone_default(func, CLONE_DEEP_FLAG5)); +} +var CLONE_DEEP_FLAG5, iteratee_default; +var init_iteratee = __esm({ + "node_modules/lodash-es/iteratee.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + init_baseIteratee(); + CLONE_DEEP_FLAG5 = 1; + iteratee_default = iteratee; + } +}); + +// node_modules/lodash-es/join.js +function join(array, separator) { + return array == null ? "" : nativeJoin.call(array, separator); +} +var arrayProto2, nativeJoin, join_default; +var init_join = __esm({ + "node_modules/lodash-es/join.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayProto2 = Array.prototype; + nativeJoin = arrayProto2.join; + join_default = join; + } +}); + +// node_modules/lodash-es/kebabCase.js +var kebabCase, kebabCase_default; +var init_kebabCase = __esm({ + "node_modules/lodash-es/kebabCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCompounder(); + kebabCase = createCompounder_default(function(result2, word, index4) { + return result2 + (index4 ? "-" : "") + word.toLowerCase(); + }); + kebabCase_default = kebabCase; + } +}); + +// node_modules/lodash-es/keyBy.js +var keyBy, keyBy_default; +var init_keyBy = __esm({ + "node_modules/lodash-es/keyBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_createAggregator(); + keyBy = createAggregator_default(function(result2, value2, key) { + baseAssignValue_default(result2, key, value2); + }); + keyBy_default = keyBy; + } +}); + +// node_modules/lodash-es/_strictLastIndexOf.js +function strictLastIndexOf(array, value2, fromIndex) { + var index4 = fromIndex + 1; + while (index4--) { + if (array[index4] === value2) { + return index4; + } + } + return index4; +} +var strictLastIndexOf_default; +var init_strictLastIndexOf = __esm({ + "node_modules/lodash-es/_strictLastIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + strictLastIndexOf_default = strictLastIndexOf; + } +}); + +// node_modules/lodash-es/lastIndexOf.js +function lastIndexOf(array, value2, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index4 = length; + if (fromIndex !== void 0) { + index4 = toInteger_default(fromIndex); + index4 = index4 < 0 ? nativeMax12(length + index4, 0) : nativeMin8(index4, length - 1); + } + return value2 === value2 ? strictLastIndexOf_default(array, value2, index4) : baseFindIndex_default(array, baseIsNaN_default, index4, true); +} +var nativeMax12, nativeMin8, lastIndexOf_default; +var init_lastIndexOf = __esm({ + "node_modules/lodash-es/lastIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFindIndex(); + init_baseIsNaN(); + init_strictLastIndexOf(); + init_toInteger(); + nativeMax12 = Math.max; + nativeMin8 = Math.min; + lastIndexOf_default = lastIndexOf; + } +}); + +// node_modules/lodash-es/lowerCase.js +var lowerCase, lowerCase_default; +var init_lowerCase = __esm({ + "node_modules/lodash-es/lowerCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCompounder(); + lowerCase = createCompounder_default(function(result2, word, index4) { + return result2 + (index4 ? " " : "") + word.toLowerCase(); + }); + lowerCase_default = lowerCase; + } +}); + +// node_modules/lodash-es/lowerFirst.js +var lowerFirst, lowerFirst_default; +var init_lowerFirst = __esm({ + "node_modules/lodash-es/lowerFirst.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCaseFirst(); + lowerFirst = createCaseFirst_default("toLowerCase"); + lowerFirst_default = lowerFirst; + } +}); + +// node_modules/lodash-es/_baseLt.js +function baseLt(value2, other) { + return value2 < other; +} +var baseLt_default; +var init_baseLt = __esm({ + "node_modules/lodash-es/_baseLt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseLt_default = baseLt; + } +}); + +// node_modules/lodash-es/lt.js +var lt, lt_default; +var init_lt = __esm({ + "node_modules/lodash-es/lt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseLt(); + init_createRelationalOperation(); + lt = createRelationalOperation_default(baseLt_default); + lt_default = lt; + } +}); + +// node_modules/lodash-es/lte.js +var lte, lte_default; +var init_lte = __esm({ + "node_modules/lodash-es/lte.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRelationalOperation(); + lte = createRelationalOperation_default(function(value2, other) { + return value2 <= other; + }); + lte_default = lte; + } +}); + +// node_modules/lodash-es/mapKeys.js +function mapKeys(object, iteratee2) { + var result2 = {}; + iteratee2 = baseIteratee_default(iteratee2, 3); + baseForOwn_default(object, function(value2, key, object2) { + baseAssignValue_default(result2, iteratee2(value2, key, object2), value2); + }); + return result2; +} +var mapKeys_default; +var init_mapKeys = __esm({ + "node_modules/lodash-es/mapKeys.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_baseForOwn(); + init_baseIteratee(); + mapKeys_default = mapKeys; + } +}); + +// node_modules/lodash-es/mapValues.js +function mapValues(object, iteratee2) { + var result2 = {}; + iteratee2 = baseIteratee_default(iteratee2, 3); + baseForOwn_default(object, function(value2, key, object2) { + baseAssignValue_default(result2, key, iteratee2(value2, key, object2)); + }); + return result2; +} +var mapValues_default; +var init_mapValues = __esm({ + "node_modules/lodash-es/mapValues.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseAssignValue(); + init_baseForOwn(); + init_baseIteratee(); + mapValues_default = mapValues; + } +}); + +// node_modules/lodash-es/matches.js +function matches(source) { + return baseMatches_default(baseClone_default(source, CLONE_DEEP_FLAG6)); +} +var CLONE_DEEP_FLAG6, matches_default; +var init_matches = __esm({ + "node_modules/lodash-es/matches.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + init_baseMatches(); + CLONE_DEEP_FLAG6 = 1; + matches_default = matches; + } +}); + +// node_modules/lodash-es/matchesProperty.js +function matchesProperty(path2, srcValue) { + return baseMatchesProperty_default(path2, baseClone_default(srcValue, CLONE_DEEP_FLAG7)); +} +var CLONE_DEEP_FLAG7, matchesProperty_default; +var init_matchesProperty = __esm({ + "node_modules/lodash-es/matchesProperty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClone(); + init_baseMatchesProperty(); + CLONE_DEEP_FLAG7 = 1; + matchesProperty_default = matchesProperty; + } +}); + +// node_modules/lodash-es/_baseExtremum.js +function baseExtremum(array, iteratee2, comparator) { + var index4 = -1, length = array.length; + while (++index4 < length) { + var value2 = array[index4], current = iteratee2(value2); + if (current != null && (computed === void 0 ? current === current && !isSymbol_default(current) : comparator(current, computed))) { + var computed = current, result2 = value2; + } + } + return result2; +} +var baseExtremum_default; +var init_baseExtremum = __esm({ + "node_modules/lodash-es/_baseExtremum.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isSymbol(); + baseExtremum_default = baseExtremum; + } +}); + +// node_modules/lodash-es/max.js +function max(array) { + return array && array.length ? baseExtremum_default(array, identity_default, baseGt_default) : void 0; +} +var max_default; +var init_max = __esm({ + "node_modules/lodash-es/max.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseExtremum(); + init_baseGt(); + init_identity2(); + max_default = max; + } +}); + +// node_modules/lodash-es/maxBy.js +function maxBy(array, iteratee2) { + return array && array.length ? baseExtremum_default(array, baseIteratee_default(iteratee2, 2), baseGt_default) : void 0; +} +var maxBy_default; +var init_maxBy = __esm({ + "node_modules/lodash-es/maxBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseExtremum(); + init_baseGt(); + init_baseIteratee(); + maxBy_default = maxBy; + } +}); + +// node_modules/lodash-es/_baseSum.js +function baseSum(array, iteratee2) { + var result2, index4 = -1, length = array.length; + while (++index4 < length) { + var current = iteratee2(array[index4]); + if (current !== void 0) { + result2 = result2 === void 0 ? current : result2 + current; + } + } + return result2; +} +var baseSum_default; +var init_baseSum = __esm({ + "node_modules/lodash-es/_baseSum.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseSum_default = baseSum; + } +}); + +// node_modules/lodash-es/_baseMean.js +function baseMean(array, iteratee2) { + var length = array == null ? 0 : array.length; + return length ? baseSum_default(array, iteratee2) / length : NAN3; +} +var NAN3, baseMean_default; +var init_baseMean = __esm({ + "node_modules/lodash-es/_baseMean.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSum(); + NAN3 = 0 / 0; + baseMean_default = baseMean; + } +}); + +// node_modules/lodash-es/mean.js +function mean(array) { + return baseMean_default(array, identity_default); +} +var mean_default; +var init_mean = __esm({ + "node_modules/lodash-es/mean.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseMean(); + init_identity2(); + mean_default = mean; + } +}); + +// node_modules/lodash-es/meanBy.js +function meanBy(array, iteratee2) { + return baseMean_default(array, baseIteratee_default(iteratee2, 2)); +} +var meanBy_default; +var init_meanBy = __esm({ + "node_modules/lodash-es/meanBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseMean(); + meanBy_default = meanBy; + } +}); + +// node_modules/lodash-es/merge.js +var merge2, merge_default; +var init_merge2 = __esm({ + "node_modules/lodash-es/merge.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseMerge(); + init_createAssigner(); + merge2 = createAssigner_default(function(object, source, srcIndex) { + baseMerge_default(object, source, srcIndex); + }); + merge_default = merge2; + } +}); + +// node_modules/lodash-es/method.js +var method, method_default; +var init_method = __esm({ + "node_modules/lodash-es/method.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseInvoke(); + init_baseRest(); + method = baseRest_default(function(path2, args) { + return function(object) { + return baseInvoke_default(object, path2, args); + }; + }); + method_default = method; + } +}); + +// node_modules/lodash-es/methodOf.js +var methodOf, methodOf_default; +var init_methodOf = __esm({ + "node_modules/lodash-es/methodOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseInvoke(); + init_baseRest(); + methodOf = baseRest_default(function(object, args) { + return function(path2) { + return baseInvoke_default(object, path2, args); + }; + }); + methodOf_default = methodOf; + } +}); + +// node_modules/lodash-es/min.js +function min(array) { + return array && array.length ? baseExtremum_default(array, identity_default, baseLt_default) : void 0; +} +var min_default; +var init_min = __esm({ + "node_modules/lodash-es/min.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseExtremum(); + init_baseLt(); + init_identity2(); + min_default = min; + } +}); + +// node_modules/lodash-es/minBy.js +function minBy(array, iteratee2) { + return array && array.length ? baseExtremum_default(array, baseIteratee_default(iteratee2, 2), baseLt_default) : void 0; +} +var minBy_default; +var init_minBy = __esm({ + "node_modules/lodash-es/minBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseExtremum(); + init_baseIteratee(); + init_baseLt(); + minBy_default = minBy; + } +}); + +// node_modules/lodash-es/mixin.js +function mixin(object, source, options) { + var props = keys_default(source), methodNames = baseFunctions_default(source, props); + var chain3 = !(isObject_default(options) && "chain" in options) || !!options.chain, isFunc = isFunction_default(object); + arrayEach_default(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain3 || chainAll) { + var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray_default(this.__actions__); + actions.push({ "func": func, "args": arguments, "thisArg": object }); + result2.__chain__ = chainAll; + return result2; + } + return func.apply(object, arrayPush_default([this.value()], arguments)); + }; + } + }); + return object; +} +var mixin_default; +var init_mixin = __esm({ + "node_modules/lodash-es/mixin.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_arrayPush(); + init_baseFunctions(); + init_copyArray(); + init_isFunction(); + init_isObject(); + init_keys(); + mixin_default = mixin; + } +}); + +// node_modules/lodash-es/multiply.js +var multiply, multiply_default; +var init_multiply = __esm({ + "node_modules/lodash-es/multiply.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createMathOperation(); + multiply = createMathOperation_default(function(multiplier, multiplicand) { + return multiplier * multiplicand; + }, 1); + multiply_default = multiply; + } +}); + +// node_modules/lodash-es/negate.js +function negate(predicate) { + if (typeof predicate != "function") { + throw new TypeError(FUNC_ERROR_TEXT9); + } + 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_TEXT9, negate_default; +var init_negate = __esm({ + "node_modules/lodash-es/negate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + FUNC_ERROR_TEXT9 = "Expected a function"; + negate_default = negate; + } +}); + +// node_modules/lodash-es/_iteratorToArray.js +function iteratorToArray(iterator) { + var data, result2 = []; + while (!(data = iterator.next()).done) { + result2.push(data.value); + } + return result2; +} +var iteratorToArray_default; +var init_iteratorToArray = __esm({ + "node_modules/lodash-es/_iteratorToArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + iteratorToArray_default = iteratorToArray; + } +}); + +// node_modules/lodash-es/toArray.js +function toArray(value2) { + if (!value2) { + return []; + } + if (isArrayLike_default(value2)) { + return isString_default(value2) ? stringToArray_default(value2) : copyArray_default(value2); + } + if (symIterator && value2[symIterator]) { + return iteratorToArray_default(value2[symIterator]()); + } + var tag = getTag_default(value2), func = tag == mapTag9 ? mapToArray_default : tag == setTag9 ? setToArray_default : values_default; + return func(value2); +} +var mapTag9, setTag9, symIterator, toArray_default; +var init_toArray = __esm({ + "node_modules/lodash-es/toArray.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Symbol(); + init_copyArray(); + init_getTag(); + init_isArrayLike(); + init_isString(); + init_iteratorToArray(); + init_mapToArray(); + init_setToArray(); + init_stringToArray(); + init_values(); + mapTag9 = "[object Map]"; + setTag9 = "[object Set]"; + symIterator = Symbol_default ? Symbol_default.iterator : void 0; + toArray_default = toArray; + } +}); + +// node_modules/lodash-es/next.js +function wrapperNext() { + if (this.__values__ === void 0) { + this.__values__ = toArray_default(this.value()); + } + var done = this.__index__ >= this.__values__.length, value2 = done ? void 0 : this.__values__[this.__index__++]; + return { "done": done, "value": value2 }; +} +var next_default; +var init_next = __esm({ + "node_modules/lodash-es/next.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toArray(); + next_default = wrapperNext; + } +}); + +// node_modules/lodash-es/_baseNth.js +function baseNth(array, n7) { + var length = array.length; + if (!length) { + return; + } + n7 += n7 < 0 ? length : 0; + return isIndex_default(n7, length) ? array[n7] : void 0; +} +var baseNth_default; +var init_baseNth = __esm({ + "node_modules/lodash-es/_baseNth.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isIndex(); + baseNth_default = baseNth; + } +}); + +// node_modules/lodash-es/nth.js +function nth(array, n7) { + return array && array.length ? baseNth_default(array, toInteger_default(n7)) : void 0; +} +var nth_default; +var init_nth = __esm({ + "node_modules/lodash-es/nth.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseNth(); + init_toInteger(); + nth_default = nth; + } +}); + +// node_modules/lodash-es/nthArg.js +function nthArg(n7) { + n7 = toInteger_default(n7); + return baseRest_default(function(args) { + return baseNth_default(args, n7); + }); +} +var nthArg_default; +var init_nthArg = __esm({ + "node_modules/lodash-es/nthArg.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseNth(); + init_baseRest(); + init_toInteger(); + nthArg_default = nthArg; + } +}); + +// node_modules/lodash-es/_baseUnset.js +function baseUnset(object, path2) { + path2 = castPath_default(path2, object); + var index4 = -1, length = path2.length; + if (!length) { + return true; + } + while (++index4 < length) { + var key = toKey_default(path2[index4]); + if (key === "__proto__" && !hasOwnProperty23.call(object, "__proto__")) { + return false; + } + if ((key === "constructor" || key === "prototype") && index4 < length - 1) { + return false; + } + } + var obj = parent_default(object, path2); + return obj == null || delete obj[toKey_default(last_default(path2))]; +} +var objectProto27, hasOwnProperty23, baseUnset_default; +var init_baseUnset = __esm({ + "node_modules/lodash-es/_baseUnset.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castPath(); + init_last(); + init_parent(); + init_toKey(); + objectProto27 = Object.prototype; + hasOwnProperty23 = objectProto27.hasOwnProperty; + baseUnset_default = baseUnset; + } +}); + +// node_modules/lodash-es/_customOmitClone.js +function customOmitClone(value2) { + return isPlainObject_default(value2) ? void 0 : value2; +} +var customOmitClone_default; +var init_customOmitClone = __esm({ + "node_modules/lodash-es/_customOmitClone.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isPlainObject(); + customOmitClone_default = customOmitClone; + } +}); + +// node_modules/lodash-es/omit.js +var CLONE_DEEP_FLAG8, CLONE_FLAT_FLAG2, CLONE_SYMBOLS_FLAG6, omit, omit_default; +var init_omit = __esm({ + "node_modules/lodash-es/omit.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseClone(); + init_baseUnset(); + init_castPath(); + init_copyObject(); + init_customOmitClone(); + init_flatRest(); + init_getAllKeysIn(); + CLONE_DEEP_FLAG8 = 1; + CLONE_FLAT_FLAG2 = 2; + CLONE_SYMBOLS_FLAG6 = 4; + omit = flatRest_default(function(object, paths) { + var result2 = {}; + if (object == null) { + return result2; + } + var isDeep = false; + paths = arrayMap_default(paths, function(path2) { + path2 = castPath_default(path2, object); + isDeep || (isDeep = path2.length > 1); + return path2; + }); + copyObject_default(object, getAllKeysIn_default(object), result2); + if (isDeep) { + result2 = baseClone_default(result2, CLONE_DEEP_FLAG8 | CLONE_FLAT_FLAG2 | CLONE_SYMBOLS_FLAG6, customOmitClone_default); + } + var length = paths.length; + while (length--) { + baseUnset_default(result2, paths[length]); + } + return result2; + }); + omit_default = omit; + } +}); + +// node_modules/lodash-es/_baseSet.js +function baseSet(object, path2, value2, customizer) { + if (!isObject_default(object)) { + return object; + } + path2 = castPath_default(path2, object); + var index4 = -1, length = path2.length, lastIndex = length - 1, nested = object; + while (nested != null && ++index4 < length) { + var key = toKey_default(path2[index4]), newValue = value2; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object; + } + if (index4 != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : void 0; + if (newValue === void 0) { + newValue = isObject_default(objValue) ? objValue : isIndex_default(path2[index4 + 1]) ? [] : {}; + } + } + assignValue_default(nested, key, newValue); + nested = nested[key]; + } + return object; +} +var baseSet_default; +var init_baseSet = __esm({ + "node_modules/lodash-es/_baseSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignValue(); + init_castPath(); + init_isIndex(); + init_isObject(); + init_toKey(); + baseSet_default = baseSet; + } +}); + +// node_modules/lodash-es/_basePickBy.js +function basePickBy(object, paths, predicate) { + var index4 = -1, length = paths.length, result2 = {}; + while (++index4 < length) { + var path2 = paths[index4], value2 = baseGet_default(object, path2); + if (predicate(value2, path2)) { + baseSet_default(result2, castPath_default(path2, object), value2); + } + } + return result2; +} +var basePickBy_default; +var init_basePickBy = __esm({ + "node_modules/lodash-es/_basePickBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + init_baseSet(); + init_castPath(); + basePickBy_default = basePickBy; + } +}); + +// node_modules/lodash-es/pickBy.js +function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap_default(getAllKeysIn_default(object), function(prop) { + return [prop]; + }); + predicate = baseIteratee_default(predicate); + return basePickBy_default(object, props, function(value2, path2) { + return predicate(value2, path2[0]); + }); +} +var pickBy_default; +var init_pickBy = __esm({ + "node_modules/lodash-es/pickBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIteratee(); + init_basePickBy(); + init_getAllKeysIn(); + pickBy_default = pickBy; + } +}); + +// node_modules/lodash-es/omitBy.js +function omitBy(object, predicate) { + return pickBy_default(object, negate_default(baseIteratee_default(predicate))); +} +var omitBy_default; +var init_omitBy = __esm({ + "node_modules/lodash-es/omitBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_negate(); + init_pickBy(); + omitBy_default = omitBy; + } +}); + +// node_modules/lodash-es/once.js +function once2(func) { + return before_default(2, func); +} +var once_default; +var init_once = __esm({ + "node_modules/lodash-es/once.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_before(); + once_default = once2; + } +}); + +// node_modules/lodash-es/_baseSortBy.js +function baseSortBy(array, comparer) { + var length = array.length; + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} +var baseSortBy_default; +var init_baseSortBy = __esm({ + "node_modules/lodash-es/_baseSortBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseSortBy_default = baseSortBy; + } +}); + +// node_modules/lodash-es/_compareAscending.js +function compareAscending(value2, other) { + if (value2 !== other) { + var valIsDefined = value2 !== void 0, valIsNull = value2 === null, valIsReflexive = value2 === value2, valIsSymbol = isSymbol_default(value2); + var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol_default(other); + if (!othIsNull && !othIsSymbol && !valIsSymbol && value2 > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { + return 1; + } + if (!valIsNull && !valIsSymbol && !othIsSymbol && value2 < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; + } + } + return 0; +} +var compareAscending_default; +var init_compareAscending = __esm({ + "node_modules/lodash-es/_compareAscending.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isSymbol(); + compareAscending_default = compareAscending; + } +}); + +// node_modules/lodash-es/_compareMultiple.js +function compareMultiple(object, other, orders) { + var index4 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; + while (++index4 < length) { + var result2 = compareAscending_default(objCriteria[index4], othCriteria[index4]); + if (result2) { + if (index4 >= ordersLength) { + return result2; + } + var order = orders[index4]; + return result2 * (order == "desc" ? -1 : 1); + } + } + return object.index - other.index; +} +var compareMultiple_default; +var init_compareMultiple = __esm({ + "node_modules/lodash-es/_compareMultiple.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_compareAscending(); + compareMultiple_default = compareMultiple; + } +}); + +// node_modules/lodash-es/_baseOrderBy.js +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap_default(iteratees, function(iteratee2) { + if (isArray_default(iteratee2)) { + return function(value2) { + return baseGet_default(value2, iteratee2.length === 1 ? iteratee2[0] : iteratee2); + }; + } + return iteratee2; + }); + } else { + iteratees = [identity_default]; + } + var index4 = -1; + iteratees = arrayMap_default(iteratees, baseUnary_default(baseIteratee_default)); + var result2 = baseMap_default(collection, function(value2, key, collection2) { + var criteria = arrayMap_default(iteratees, function(iteratee2) { + return iteratee2(value2); + }); + return { "criteria": criteria, "index": ++index4, "value": value2 }; + }); + return baseSortBy_default(result2, function(object, other) { + return compareMultiple_default(object, other, orders); + }); +} +var baseOrderBy_default; +var init_baseOrderBy = __esm({ + "node_modules/lodash-es/_baseOrderBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseGet(); + init_baseIteratee(); + init_baseMap(); + init_baseSortBy(); + init_baseUnary(); + init_compareMultiple(); + init_identity2(); + init_isArray(); + baseOrderBy_default = baseOrderBy; + } +}); + +// node_modules/lodash-es/orderBy.js +function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray_default(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? void 0 : orders; + if (!isArray_default(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy_default(collection, iteratees, orders); +} +var orderBy_default; +var init_orderBy = __esm({ + "node_modules/lodash-es/orderBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseOrderBy(); + init_isArray(); + orderBy_default = orderBy; + } +}); + +// node_modules/lodash-es/_createOver.js +function createOver(arrayFunc) { + return flatRest_default(function(iteratees) { + iteratees = arrayMap_default(iteratees, baseUnary_default(baseIteratee_default)); + return baseRest_default(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee2) { + return apply_default(iteratee2, thisArg, args); + }); + }); + }); +} +var createOver_default; +var init_createOver = __esm({ + "node_modules/lodash-es/_createOver.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_arrayMap(); + init_baseIteratee(); + init_baseRest(); + init_baseUnary(); + init_flatRest(); + createOver_default = createOver; + } +}); + +// node_modules/lodash-es/over.js +var over, over_default; +var init_over = __esm({ + "node_modules/lodash-es/over.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_createOver(); + over = createOver_default(arrayMap_default); + over_default = over; + } +}); + +// node_modules/lodash-es/_castRest.js +var castRest, castRest_default; +var init_castRest = __esm({ + "node_modules/lodash-es/_castRest.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + castRest = baseRest_default; + castRest_default = castRest; + } +}); + +// node_modules/lodash-es/overArgs.js +var nativeMin9, overArgs, overArgs_default; +var init_overArgs = __esm({ + "node_modules/lodash-es/overArgs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_arrayMap(); + init_baseFlatten(); + init_baseIteratee(); + init_baseRest(); + init_baseUnary(); + init_castRest(); + init_isArray(); + nativeMin9 = Math.min; + overArgs = castRest_default(function(func, transforms) { + transforms = transforms.length == 1 && isArray_default(transforms[0]) ? arrayMap_default(transforms[0], baseUnary_default(baseIteratee_default)) : arrayMap_default(baseFlatten_default(transforms, 1), baseUnary_default(baseIteratee_default)); + var funcsLength = transforms.length; + return baseRest_default(function(args) { + var index4 = -1, length = nativeMin9(args.length, funcsLength); + while (++index4 < length) { + args[index4] = transforms[index4].call(this, args[index4]); + } + return apply_default(func, this, args); + }); + }); + overArgs_default = overArgs; + } +}); + +// node_modules/lodash-es/overEvery.js +var overEvery, overEvery_default; +var init_overEvery = __esm({ + "node_modules/lodash-es/overEvery.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEvery(); + init_createOver(); + overEvery = createOver_default(arrayEvery_default); + overEvery_default = overEvery; + } +}); + +// node_modules/lodash-es/overSome.js +var overSome, overSome_default; +var init_overSome = __esm({ + "node_modules/lodash-es/overSome.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arraySome(); + init_createOver(); + overSome = createOver_default(arraySome_default); + overSome_default = overSome; + } +}); + +// node_modules/lodash-es/_baseRepeat.js +function baseRepeat(string2, n7) { + var result2 = ""; + if (!string2 || n7 < 1 || n7 > MAX_SAFE_INTEGER4) { + return result2; + } + do { + if (n7 % 2) { + result2 += string2; + } + n7 = nativeFloor(n7 / 2); + if (n7) { + string2 += string2; + } + } while (n7); + return result2; +} +var MAX_SAFE_INTEGER4, nativeFloor, baseRepeat_default; +var init_baseRepeat = __esm({ + "node_modules/lodash-es/_baseRepeat.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + MAX_SAFE_INTEGER4 = 9007199254740991; + nativeFloor = Math.floor; + baseRepeat_default = baseRepeat; + } +}); + +// node_modules/lodash-es/_asciiSize.js +var asciiSize, asciiSize_default; +var init_asciiSize = __esm({ + "node_modules/lodash-es/_asciiSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseProperty(); + asciiSize = baseProperty_default("length"); + asciiSize_default = asciiSize; + } +}); + +// node_modules/lodash-es/_unicodeSize.js +function unicodeSize(string2) { + var result2 = reUnicode2.lastIndex = 0; + while (reUnicode2.test(string2)) { + ++result2; + } + return result2; +} +var rsAstralRange4, rsComboMarksRange5, reComboHalfMarksRange5, rsComboSymbolsRange5, rsComboRange5, rsVarRange4, rsAstral2, rsCombo4, rsFitz3, rsModifier3, rsNonAstral3, rsRegional3, rsSurrPair3, rsZWJ4, reOptMod3, rsOptVar3, rsOptJoin3, rsSeq3, rsSymbol2, reUnicode2, unicodeSize_default; +var init_unicodeSize = __esm({ + "node_modules/lodash-es/_unicodeSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + rsAstralRange4 = "\\ud800-\\udfff"; + rsComboMarksRange5 = "\\u0300-\\u036f"; + reComboHalfMarksRange5 = "\\ufe20-\\ufe2f"; + rsComboSymbolsRange5 = "\\u20d0-\\u20ff"; + rsComboRange5 = rsComboMarksRange5 + reComboHalfMarksRange5 + rsComboSymbolsRange5; + rsVarRange4 = "\\ufe0e\\ufe0f"; + rsAstral2 = "[" + rsAstralRange4 + "]"; + rsCombo4 = "[" + rsComboRange5 + "]"; + rsFitz3 = "\\ud83c[\\udffb-\\udfff]"; + rsModifier3 = "(?:" + rsCombo4 + "|" + rsFitz3 + ")"; + rsNonAstral3 = "[^" + rsAstralRange4 + "]"; + rsRegional3 = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + rsSurrPair3 = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + rsZWJ4 = "\\u200d"; + reOptMod3 = rsModifier3 + "?"; + rsOptVar3 = "[" + rsVarRange4 + "]?"; + rsOptJoin3 = "(?:" + rsZWJ4 + "(?:" + [rsNonAstral3, rsRegional3, rsSurrPair3].join("|") + ")" + rsOptVar3 + reOptMod3 + ")*"; + rsSeq3 = rsOptVar3 + reOptMod3 + rsOptJoin3; + rsSymbol2 = "(?:" + [rsNonAstral3 + rsCombo4 + "?", rsCombo4, rsRegional3, rsSurrPair3, rsAstral2].join("|") + ")"; + reUnicode2 = RegExp(rsFitz3 + "(?=" + rsFitz3 + ")|" + rsSymbol2 + rsSeq3, "g"); + unicodeSize_default = unicodeSize; + } +}); + +// node_modules/lodash-es/_stringSize.js +function stringSize(string2) { + return hasUnicode_default(string2) ? unicodeSize_default(string2) : asciiSize_default(string2); +} +var stringSize_default; +var init_stringSize = __esm({ + "node_modules/lodash-es/_stringSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asciiSize(); + init_hasUnicode(); + init_unicodeSize(); + stringSize_default = stringSize; + } +}); + +// node_modules/lodash-es/_createPadding.js +function createPadding(length, chars) { + chars = chars === void 0 ? " " : baseToString_default(chars); + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat_default(chars, length) : chars; + } + var result2 = baseRepeat_default(chars, nativeCeil2(length / stringSize_default(chars))); + return hasUnicode_default(chars) ? castSlice_default(stringToArray_default(result2), 0, length).join("") : result2.slice(0, length); +} +var nativeCeil2, createPadding_default; +var init_createPadding = __esm({ + "node_modules/lodash-es/_createPadding.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRepeat(); + init_baseToString(); + init_castSlice(); + init_hasUnicode(); + init_stringSize(); + init_stringToArray(); + nativeCeil2 = Math.ceil; + createPadding_default = createPadding; + } +}); + +// node_modules/lodash-es/pad.js +function pad(string2, length, chars) { + string2 = toString_default(string2); + length = toInteger_default(length); + var strLength = length ? stringSize_default(string2) : 0; + if (!length || strLength >= length) { + return string2; + } + var mid = (length - strLength) / 2; + return createPadding_default(nativeFloor2(mid), chars) + string2 + createPadding_default(nativeCeil3(mid), chars); +} +var nativeCeil3, nativeFloor2, pad_default; +var init_pad = __esm({ + "node_modules/lodash-es/pad.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createPadding(); + init_stringSize(); + init_toInteger(); + init_toString(); + nativeCeil3 = Math.ceil; + nativeFloor2 = Math.floor; + pad_default = pad; + } +}); + +// node_modules/lodash-es/padEnd.js +function padEnd(string2, length, chars) { + string2 = toString_default(string2); + length = toInteger_default(length); + var strLength = length ? stringSize_default(string2) : 0; + return length && strLength < length ? string2 + createPadding_default(length - strLength, chars) : string2; +} +var padEnd_default; +var init_padEnd = __esm({ + "node_modules/lodash-es/padEnd.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createPadding(); + init_stringSize(); + init_toInteger(); + init_toString(); + padEnd_default = padEnd; + } +}); + +// node_modules/lodash-es/padStart.js +function padStart(string2, length, chars) { + string2 = toString_default(string2); + length = toInteger_default(length); + var strLength = length ? stringSize_default(string2) : 0; + return length && strLength < length ? createPadding_default(length - strLength, chars) + string2 : string2; +} +var padStart_default; +var init_padStart = __esm({ + "node_modules/lodash-es/padStart.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createPadding(); + init_stringSize(); + init_toInteger(); + init_toString(); + padStart_default = padStart; + } +}); + +// node_modules/lodash-es/parseInt.js +function parseInt2(string2, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString_default(string2).replace(reTrimStart2, ""), radix || 0); +} +var reTrimStart2, nativeParseInt, parseInt_default; +var init_parseInt = __esm({ + "node_modules/lodash-es/parseInt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_root(); + init_toString(); + reTrimStart2 = /^\s+/; + nativeParseInt = root_default.parseInt; + parseInt_default = parseInt2; + } +}); + +// node_modules/lodash-es/partial.js +var WRAP_PARTIAL_FLAG7, partial, partial_default; +var init_partial = __esm({ + "node_modules/lodash-es/partial.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_createWrap(); + init_getHolder(); + init_replaceHolders(); + WRAP_PARTIAL_FLAG7 = 32; + partial = baseRest_default(function(func, partials) { + var holders = replaceHolders_default(partials, getHolder_default(partial)); + return createWrap_default(func, WRAP_PARTIAL_FLAG7, void 0, partials, holders); + }); + partial.placeholder = {}; + partial_default = partial; + } +}); + +// node_modules/lodash-es/partialRight.js +var WRAP_PARTIAL_RIGHT_FLAG4, partialRight, partialRight_default; +var init_partialRight = __esm({ + "node_modules/lodash-es/partialRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_createWrap(); + init_getHolder(); + init_replaceHolders(); + WRAP_PARTIAL_RIGHT_FLAG4 = 64; + partialRight = baseRest_default(function(func, partials) { + var holders = replaceHolders_default(partials, getHolder_default(partialRight)); + return createWrap_default(func, WRAP_PARTIAL_RIGHT_FLAG4, void 0, partials, holders); + }); + partialRight.placeholder = {}; + partialRight_default = partialRight; + } +}); + +// node_modules/lodash-es/partition.js +var partition, partition_default; +var init_partition = __esm({ + "node_modules/lodash-es/partition.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createAggregator(); + partition = createAggregator_default(function(result2, value2, key) { + result2[key ? 0 : 1].push(value2); + }, function() { + return [[], []]; + }); + partition_default = partition; + } +}); + +// node_modules/lodash-es/_basePick.js +function basePick(object, paths) { + return basePickBy_default(object, paths, function(value2, path2) { + return hasIn_default(object, path2); + }); +} +var basePick_default; +var init_basePick = __esm({ + "node_modules/lodash-es/_basePick.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePickBy(); + init_hasIn(); + basePick_default = basePick; + } +}); + +// node_modules/lodash-es/pick.js +var pick, pick_default; +var init_pick = __esm({ + "node_modules/lodash-es/pick.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePick(); + init_flatRest(); + pick = flatRest_default(function(object, paths) { + return object == null ? {} : basePick_default(object, paths); + }); + pick_default = pick; + } +}); + +// node_modules/lodash-es/plant.js +function wrapperPlant(value2) { + var result2, parent2 = this; + while (parent2 instanceof baseLodash_default) { + var clone2 = wrapperClone_default(parent2); + clone2.__index__ = 0; + clone2.__values__ = void 0; + if (result2) { + previous.__wrapped__ = clone2; + } else { + result2 = clone2; + } + var previous = clone2; + parent2 = parent2.__wrapped__; + } + previous.__wrapped__ = value2; + return result2; +} +var plant_default; +var init_plant = __esm({ + "node_modules/lodash-es/plant.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseLodash(); + init_wrapperClone(); + plant_default = wrapperPlant; + } +}); + +// node_modules/lodash-es/propertyOf.js +function propertyOf(object) { + return function(path2) { + return object == null ? void 0 : baseGet_default(object, path2); + }; +} +var propertyOf_default; +var init_propertyOf = __esm({ + "node_modules/lodash-es/propertyOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + propertyOf_default = propertyOf; + } +}); + +// node_modules/lodash-es/_baseIndexOfWith.js +function baseIndexOfWith(array, value2, fromIndex, comparator) { + var index4 = fromIndex - 1, length = array.length; + while (++index4 < length) { + if (comparator(array[index4], value2)) { + return index4; + } + } + return -1; +} +var baseIndexOfWith_default; +var init_baseIndexOfWith = __esm({ + "node_modules/lodash-es/_baseIndexOfWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseIndexOfWith_default = baseIndexOfWith; + } +}); + +// node_modules/lodash-es/_basePullAll.js +function basePullAll(array, values2, iteratee2, comparator) { + var indexOf4 = comparator ? baseIndexOfWith_default : baseIndexOf_default, index4 = -1, length = values2.length, seen = array; + if (array === values2) { + values2 = copyArray_default(values2); + } + if (iteratee2) { + seen = arrayMap_default(array, baseUnary_default(iteratee2)); + } + while (++index4 < length) { + var fromIndex = 0, value2 = values2[index4], computed = iteratee2 ? iteratee2(value2) : value2; + while ((fromIndex = indexOf4(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice2.call(seen, fromIndex, 1); + } + splice2.call(array, fromIndex, 1); + } + } + return array; +} +var arrayProto3, splice2, basePullAll_default; +var init_basePullAll = __esm({ + "node_modules/lodash-es/_basePullAll.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseIndexOf(); + init_baseIndexOfWith(); + init_baseUnary(); + init_copyArray(); + arrayProto3 = Array.prototype; + splice2 = arrayProto3.splice; + basePullAll_default = basePullAll; + } +}); + +// node_modules/lodash-es/pullAll.js +function pullAll(array, values2) { + return array && array.length && values2 && values2.length ? basePullAll_default(array, values2) : array; +} +var pullAll_default; +var init_pullAll = __esm({ + "node_modules/lodash-es/pullAll.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePullAll(); + pullAll_default = pullAll; + } +}); + +// node_modules/lodash-es/pull.js +var pull, pull_default; +var init_pull = __esm({ + "node_modules/lodash-es/pull.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_pullAll(); + pull = baseRest_default(pullAll_default); + pull_default = pull; + } +}); + +// node_modules/lodash-es/pullAllBy.js +function pullAllBy(array, values2, iteratee2) { + return array && array.length && values2 && values2.length ? basePullAll_default(array, values2, baseIteratee_default(iteratee2, 2)) : array; +} +var pullAllBy_default; +var init_pullAllBy = __esm({ + "node_modules/lodash-es/pullAllBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_basePullAll(); + pullAllBy_default = pullAllBy; + } +}); + +// node_modules/lodash-es/pullAllWith.js +function pullAllWith(array, values2, comparator) { + return array && array.length && values2 && values2.length ? basePullAll_default(array, values2, void 0, comparator) : array; +} +var pullAllWith_default; +var init_pullAllWith = __esm({ + "node_modules/lodash-es/pullAllWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePullAll(); + pullAllWith_default = pullAllWith; + } +}); + +// node_modules/lodash-es/_basePullAt.js +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, lastIndex = length - 1; + while (length--) { + var index4 = indexes[length]; + if (length == lastIndex || index4 !== previous) { + var previous = index4; + if (isIndex_default(index4)) { + splice3.call(array, index4, 1); + } else { + baseUnset_default(array, index4); + } + } + } + return array; +} +var arrayProto4, splice3, basePullAt_default; +var init_basePullAt = __esm({ + "node_modules/lodash-es/_basePullAt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUnset(); + init_isIndex(); + arrayProto4 = Array.prototype; + splice3 = arrayProto4.splice; + basePullAt_default = basePullAt; + } +}); + +// node_modules/lodash-es/pullAt.js +var pullAt, pullAt_default; +var init_pullAt = __esm({ + "node_modules/lodash-es/pullAt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_baseAt(); + init_basePullAt(); + init_compareAscending(); + init_flatRest(); + init_isIndex(); + pullAt = flatRest_default(function(array, indexes) { + var length = array == null ? 0 : array.length, result2 = baseAt_default(array, indexes); + basePullAt_default(array, arrayMap_default(indexes, function(index4) { + return isIndex_default(index4, length) ? +index4 : index4; + }).sort(compareAscending_default)); + return result2; + }); + pullAt_default = pullAt; + } +}); + +// node_modules/lodash-es/_baseRandom.js +function baseRandom(lower, upper) { + return lower + nativeFloor3(nativeRandom() * (upper - lower + 1)); +} +var nativeFloor3, nativeRandom, baseRandom_default; +var init_baseRandom = __esm({ + "node_modules/lodash-es/_baseRandom.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeFloor3 = Math.floor; + nativeRandom = Math.random; + baseRandom_default = baseRandom; + } +}); + +// node_modules/lodash-es/random.js +function random(lower, upper, floating) { + if (floating && typeof floating != "boolean" && isIterateeCall_default(lower, upper, floating)) { + upper = floating = void 0; + } + if (floating === void 0) { + if (typeof upper == "boolean") { + floating = upper; + upper = void 0; + } else if (typeof lower == "boolean") { + floating = lower; + lower = void 0; + } + } + if (lower === void 0 && upper === void 0) { + lower = 0; + upper = 1; + } else { + lower = toFinite_default(lower); + if (upper === void 0) { + upper = lower; + lower = 0; + } else { + upper = toFinite_default(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom2(); + return nativeMin10(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); + } + return baseRandom_default(lower, upper); +} +var freeParseFloat, nativeMin10, nativeRandom2, random_default; +var init_random = __esm({ + "node_modules/lodash-es/random.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRandom(); + init_isIterateeCall(); + init_toFinite(); + freeParseFloat = parseFloat; + nativeMin10 = Math.min; + nativeRandom2 = Math.random; + random_default = random; + } +}); + +// node_modules/lodash-es/_baseRange.js +function baseRange(start, end, step, fromRight) { + var index4 = -1, length = nativeMax13(nativeCeil4((end - start) / (step || 1)), 0), result2 = Array(length); + while (length--) { + result2[fromRight ? length : ++index4] = start; + start += step; + } + return result2; +} +var nativeCeil4, nativeMax13, baseRange_default; +var init_baseRange = __esm({ + "node_modules/lodash-es/_baseRange.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeCeil4 = Math.ceil; + nativeMax13 = Math.max; + baseRange_default = baseRange; + } +}); + +// node_modules/lodash-es/_createRange.js +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != "number" && isIterateeCall_default(start, end, step)) { + end = step = void 0; + } + start = toFinite_default(start); + if (end === void 0) { + end = start; + start = 0; + } else { + end = toFinite_default(end); + } + step = step === void 0 ? start < end ? 1 : -1 : toFinite_default(step); + return baseRange_default(start, end, step, fromRight); + }; +} +var createRange_default; +var init_createRange = __esm({ + "node_modules/lodash-es/_createRange.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRange(); + init_isIterateeCall(); + init_toFinite(); + createRange_default = createRange; + } +}); + +// node_modules/lodash-es/range.js +var range, range_default; +var init_range = __esm({ + "node_modules/lodash-es/range.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRange(); + range = createRange_default(); + range_default = range; + } +}); + +// node_modules/lodash-es/rangeRight.js +var rangeRight, rangeRight_default; +var init_rangeRight = __esm({ + "node_modules/lodash-es/rangeRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRange(); + rangeRight = createRange_default(true); + rangeRight_default = rangeRight; + } +}); + +// node_modules/lodash-es/rearg.js +var WRAP_REARG_FLAG4, rearg, rearg_default; +var init_rearg = __esm({ + "node_modules/lodash-es/rearg.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createWrap(); + init_flatRest(); + WRAP_REARG_FLAG4 = 256; + rearg = flatRest_default(function(func, indexes) { + return createWrap_default(func, WRAP_REARG_FLAG4, void 0, void 0, void 0, indexes); + }); + rearg_default = rearg; + } +}); + +// node_modules/lodash-es/_baseReduce.js +function baseReduce(collection, iteratee2, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value2, index4, collection2) { + accumulator = initAccum ? (initAccum = false, value2) : iteratee2(accumulator, value2, index4, collection2); + }); + return accumulator; +} +var baseReduce_default; +var init_baseReduce = __esm({ + "node_modules/lodash-es/_baseReduce.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseReduce_default = baseReduce; + } +}); + +// node_modules/lodash-es/reduce.js +function reduce(collection, iteratee2, accumulator) { + var func = isArray_default(collection) ? arrayReduce_default : baseReduce_default, initAccum = arguments.length < 3; + return func(collection, baseIteratee_default(iteratee2, 4), accumulator, initAccum, baseEach_default); +} +var reduce_default; +var init_reduce = __esm({ + "node_modules/lodash-es/reduce.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayReduce(); + init_baseEach(); + init_baseIteratee(); + init_baseReduce(); + init_isArray(); + reduce_default = reduce; + } +}); + +// node_modules/lodash-es/_arrayReduceRight.js +function arrayReduceRight(array, iteratee2, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee2(accumulator, array[length], length, array); + } + return accumulator; +} +var arrayReduceRight_default; +var init_arrayReduceRight = __esm({ + "node_modules/lodash-es/_arrayReduceRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayReduceRight_default = arrayReduceRight; + } +}); + +// node_modules/lodash-es/reduceRight.js +function reduceRight(collection, iteratee2, accumulator) { + var func = isArray_default(collection) ? arrayReduceRight_default : baseReduce_default, initAccum = arguments.length < 3; + return func(collection, baseIteratee_default(iteratee2, 4), accumulator, initAccum, baseEachRight_default); +} +var reduceRight_default; +var init_reduceRight = __esm({ + "node_modules/lodash-es/reduceRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayReduceRight(); + init_baseEachRight(); + init_baseIteratee(); + init_baseReduce(); + init_isArray(); + reduceRight_default = reduceRight; + } +}); + +// node_modules/lodash-es/reject.js +function reject(collection, predicate) { + var func = isArray_default(collection) ? arrayFilter_default : baseFilter_default; + return func(collection, negate_default(baseIteratee_default(predicate, 3))); +} +var reject_default; +var init_reject = __esm({ + "node_modules/lodash-es/reject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_baseFilter(); + init_baseIteratee(); + init_isArray(); + init_negate(); + reject_default = reject; + } +}); + +// node_modules/lodash-es/remove.js +function remove(array, predicate) { + var result2 = []; + if (!(array && array.length)) { + return result2; + } + var index4 = -1, indexes = [], length = array.length; + predicate = baseIteratee_default(predicate, 3); + while (++index4 < length) { + var value2 = array[index4]; + if (predicate(value2, index4, array)) { + result2.push(value2); + indexes.push(index4); + } + } + basePullAt_default(array, indexes); + return result2; +} +var remove_default; +var init_remove = __esm({ + "node_modules/lodash-es/remove.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_basePullAt(); + remove_default = remove; + } +}); + +// node_modules/lodash-es/repeat.js +function repeat(string2, n7, guard) { + if (guard ? isIterateeCall_default(string2, n7, guard) : n7 === void 0) { + n7 = 1; + } else { + n7 = toInteger_default(n7); + } + return baseRepeat_default(toString_default(string2), n7); +} +var repeat_default; +var init_repeat = __esm({ + "node_modules/lodash-es/repeat.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRepeat(); + init_isIterateeCall(); + init_toInteger(); + init_toString(); + repeat_default = repeat; + } +}); + +// node_modules/lodash-es/replace.js +function replace() { + var args = arguments, string2 = toString_default(args[0]); + return args.length < 3 ? string2 : string2.replace(args[1], args[2]); +} +var replace_default; +var init_replace = __esm({ + "node_modules/lodash-es/replace.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + replace_default = replace; + } +}); + +// node_modules/lodash-es/rest.js +function rest(func, start) { + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT10); + } + start = start === void 0 ? start : toInteger_default(start); + return baseRest_default(func, start); +} +var FUNC_ERROR_TEXT10, rest_default; +var init_rest = __esm({ + "node_modules/lodash-es/rest.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_toInteger(); + FUNC_ERROR_TEXT10 = "Expected a function"; + rest_default = rest; + } +}); + +// node_modules/lodash-es/result.js +function result(object, path2, defaultValue) { + path2 = castPath_default(path2, object); + var index4 = -1, length = path2.length; + if (!length) { + length = 1; + object = void 0; + } + while (++index4 < length) { + var value2 = object == null ? void 0 : object[toKey_default(path2[index4])]; + if (value2 === void 0) { + index4 = length; + value2 = defaultValue; + } + object = isFunction_default(value2) ? value2.call(object) : value2; + } + return object; +} +var result_default; +var init_result = __esm({ + "node_modules/lodash-es/result.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castPath(); + init_isFunction(); + init_toKey(); + result_default = result; + } +}); + +// node_modules/lodash-es/reverse.js +function reverse(array) { + return array == null ? array : nativeReverse.call(array); +} +var arrayProto5, nativeReverse, reverse_default; +var init_reverse = __esm({ + "node_modules/lodash-es/reverse.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + arrayProto5 = Array.prototype; + nativeReverse = arrayProto5.reverse; + reverse_default = reverse; + } +}); + +// node_modules/lodash-es/round.js +var round, round_default; +var init_round = __esm({ + "node_modules/lodash-es/round.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createRound(); + round = createRound_default("round"); + round_default = round; + } +}); + +// node_modules/lodash-es/_arraySample.js +function arraySample(array) { + var length = array.length; + return length ? array[baseRandom_default(0, length - 1)] : void 0; +} +var arraySample_default; +var init_arraySample = __esm({ + "node_modules/lodash-es/_arraySample.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRandom(); + arraySample_default = arraySample; + } +}); + +// node_modules/lodash-es/_baseSample.js +function baseSample(collection) { + return arraySample_default(values_default(collection)); +} +var baseSample_default; +var init_baseSample = __esm({ + "node_modules/lodash-es/_baseSample.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arraySample(); + init_values(); + baseSample_default = baseSample; + } +}); + +// node_modules/lodash-es/sample.js +function sample(collection) { + var func = isArray_default(collection) ? arraySample_default : baseSample_default; + return func(collection); +} +var sample_default; +var init_sample = __esm({ + "node_modules/lodash-es/sample.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arraySample(); + init_baseSample(); + init_isArray(); + sample_default = sample; + } +}); + +// node_modules/lodash-es/_shuffleSelf.js +function shuffleSelf(array, size2) { + var index4 = -1, length = array.length, lastIndex = length - 1; + size2 = size2 === void 0 ? length : size2; + while (++index4 < size2) { + var rand = baseRandom_default(index4, lastIndex), value2 = array[rand]; + array[rand] = array[index4]; + array[index4] = value2; + } + array.length = size2; + return array; +} +var shuffleSelf_default; +var init_shuffleSelf = __esm({ + "node_modules/lodash-es/_shuffleSelf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRandom(); + shuffleSelf_default = shuffleSelf; + } +}); + +// node_modules/lodash-es/_arraySampleSize.js +function arraySampleSize(array, n7) { + return shuffleSelf_default(copyArray_default(array), baseClamp_default(n7, 0, array.length)); +} +var arraySampleSize_default; +var init_arraySampleSize = __esm({ + "node_modules/lodash-es/_arraySampleSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_copyArray(); + init_shuffleSelf(); + arraySampleSize_default = arraySampleSize; + } +}); + +// node_modules/lodash-es/_baseSampleSize.js +function baseSampleSize(collection, n7) { + var array = values_default(collection); + return shuffleSelf_default(array, baseClamp_default(n7, 0, array.length)); +} +var baseSampleSize_default; +var init_baseSampleSize = __esm({ + "node_modules/lodash-es/_baseSampleSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_shuffleSelf(); + init_values(); + baseSampleSize_default = baseSampleSize; + } +}); + +// node_modules/lodash-es/sampleSize.js +function sampleSize(collection, n7, guard) { + if (guard ? isIterateeCall_default(collection, n7, guard) : n7 === void 0) { + n7 = 1; + } else { + n7 = toInteger_default(n7); + } + var func = isArray_default(collection) ? arraySampleSize_default : baseSampleSize_default; + return func(collection, n7); +} +var sampleSize_default; +var init_sampleSize = __esm({ + "node_modules/lodash-es/sampleSize.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arraySampleSize(); + init_baseSampleSize(); + init_isArray(); + init_isIterateeCall(); + init_toInteger(); + sampleSize_default = sampleSize; + } +}); + +// node_modules/lodash-es/set.js +var set_exports = {}; +__export(set_exports, { + default: () => set_default +}); +function set2(object, path2, value2) { + return object == null ? object : baseSet_default(object, path2, value2); +} +var set_default; +var init_set2 = __esm({ + "node_modules/lodash-es/set.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSet(); + set_default = set2; + } +}); + +// node_modules/lodash-es/setWith.js +function setWith(object, path2, value2, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + return object == null ? object : baseSet_default(object, path2, value2, customizer); +} +var setWith_default; +var init_setWith = __esm({ + "node_modules/lodash-es/setWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSet(); + setWith_default = setWith; + } +}); + +// node_modules/lodash-es/_arrayShuffle.js +function arrayShuffle(array) { + return shuffleSelf_default(copyArray_default(array)); +} +var arrayShuffle_default; +var init_arrayShuffle = __esm({ + "node_modules/lodash-es/_arrayShuffle.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_copyArray(); + init_shuffleSelf(); + arrayShuffle_default = arrayShuffle; + } +}); + +// node_modules/lodash-es/_baseShuffle.js +function baseShuffle(collection) { + return shuffleSelf_default(values_default(collection)); +} +var baseShuffle_default; +var init_baseShuffle = __esm({ + "node_modules/lodash-es/_baseShuffle.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_shuffleSelf(); + init_values(); + baseShuffle_default = baseShuffle; + } +}); + +// node_modules/lodash-es/shuffle.js +function shuffle(collection) { + var func = isArray_default(collection) ? arrayShuffle_default : baseShuffle_default; + return func(collection); +} +var shuffle_default; +var init_shuffle = __esm({ + "node_modules/lodash-es/shuffle.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayShuffle(); + init_baseShuffle(); + init_isArray(); + shuffle_default = shuffle; + } +}); + +// node_modules/lodash-es/size.js +function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike_default(collection)) { + return isString_default(collection) ? stringSize_default(collection) : collection.length; + } + var tag = getTag_default(collection); + if (tag == mapTag10 || tag == setTag10) { + return collection.size; + } + return baseKeys_default(collection).length; +} +var mapTag10, setTag10, size_default; +var init_size = __esm({ + "node_modules/lodash-es/size.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseKeys(); + init_getTag(); + init_isArrayLike(); + init_isString(); + init_stringSize(); + mapTag10 = "[object Map]"; + setTag10 = "[object Set]"; + size_default = size; + } +}); + +// node_modules/lodash-es/slice.js +function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != "number" && isIterateeCall_default(array, start, end)) { + start = 0; + end = length; + } else { + start = start == null ? 0 : toInteger_default(start); + end = end === void 0 ? length : toInteger_default(end); + } + return baseSlice_default(array, start, end); +} +var slice_default; +var init_slice = __esm({ + "node_modules/lodash-es/slice.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_isIterateeCall(); + init_toInteger(); + slice_default = slice; + } +}); + +// node_modules/lodash-es/snakeCase.js +var snakeCase, snakeCase_default; +var init_snakeCase = __esm({ + "node_modules/lodash-es/snakeCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCompounder(); + snakeCase = createCompounder_default(function(result2, word, index4) { + return result2 + (index4 ? "_" : "") + word.toLowerCase(); + }); + snakeCase_default = snakeCase; + } +}); + +// node_modules/lodash-es/_baseSome.js +function baseSome(collection, predicate) { + var result2; + baseEach_default(collection, function(value2, index4, collection2) { + result2 = predicate(value2, index4, collection2); + return !result2; + }); + return !!result2; +} +var baseSome_default; +var init_baseSome = __esm({ + "node_modules/lodash-es/_baseSome.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseEach(); + baseSome_default = baseSome; + } +}); + +// node_modules/lodash-es/some.js +function some(collection, predicate, guard) { + var func = isArray_default(collection) ? arraySome_default : baseSome_default; + if (guard && isIterateeCall_default(collection, predicate, guard)) { + predicate = void 0; + } + return func(collection, baseIteratee_default(predicate, 3)); +} +var some_default; +var init_some = __esm({ + "node_modules/lodash-es/some.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arraySome(); + init_baseIteratee(); + init_baseSome(); + init_isArray(); + init_isIterateeCall(); + some_default = some; + } +}); + +// node_modules/lodash-es/sortBy.js +var sortBy, sortBy_default; +var init_sortBy = __esm({ + "node_modules/lodash-es/sortBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_baseOrderBy(); + init_baseRest(); + init_isIterateeCall(); + sortBy = baseRest_default(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall_default(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall_default(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy_default(collection, baseFlatten_default(iteratees, 1), []); + }); + sortBy_default = sortBy; + } +}); + +// node_modules/lodash-es/_baseSortedIndexBy.js +function baseSortedIndexBy(array, value2, iteratee2, retHighest) { + var low = 0, high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + value2 = iteratee2(value2); + var valIsNaN = value2 !== value2, valIsNull = value2 === null, valIsSymbol = isSymbol_default(value2), valIsUndefined = value2 === void 0; + while (low < high) { + var mid = nativeFloor4((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== void 0, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol_default(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 <= value2 : computed < value2; + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin11(high, MAX_ARRAY_INDEX); +} +var MAX_ARRAY_LENGTH3, MAX_ARRAY_INDEX, nativeFloor4, nativeMin11, baseSortedIndexBy_default; +var init_baseSortedIndexBy = __esm({ + "node_modules/lodash-es/_baseSortedIndexBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_isSymbol(); + MAX_ARRAY_LENGTH3 = 4294967295; + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH3 - 1; + nativeFloor4 = Math.floor; + nativeMin11 = Math.min; + baseSortedIndexBy_default = baseSortedIndexBy; + } +}); + +// node_modules/lodash-es/_baseSortedIndex.js +function baseSortedIndex(array, value2, retHighest) { + var low = 0, high = array == null ? low : array.length; + if (typeof value2 == "number" && value2 === value2 && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = low + high >>> 1, computed = array[mid]; + if (computed !== null && !isSymbol_default(computed) && (retHighest ? computed <= value2 : computed < value2)) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy_default(array, value2, identity_default, retHighest); +} +var MAX_ARRAY_LENGTH4, HALF_MAX_ARRAY_LENGTH, baseSortedIndex_default; +var init_baseSortedIndex = __esm({ + "node_modules/lodash-es/_baseSortedIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedIndexBy(); + init_identity2(); + init_isSymbol(); + MAX_ARRAY_LENGTH4 = 4294967295; + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH4 >>> 1; + baseSortedIndex_default = baseSortedIndex; + } +}); + +// node_modules/lodash-es/sortedIndex.js +function sortedIndex(array, value2) { + return baseSortedIndex_default(array, value2); +} +var sortedIndex_default; +var init_sortedIndex = __esm({ + "node_modules/lodash-es/sortedIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedIndex(); + sortedIndex_default = sortedIndex; + } +}); + +// node_modules/lodash-es/sortedIndexBy.js +function sortedIndexBy(array, value2, iteratee2) { + return baseSortedIndexBy_default(array, value2, baseIteratee_default(iteratee2, 2)); +} +var sortedIndexBy_default; +var init_sortedIndexBy = __esm({ + "node_modules/lodash-es/sortedIndexBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseSortedIndexBy(); + sortedIndexBy_default = sortedIndexBy; + } +}); + +// node_modules/lodash-es/sortedIndexOf.js +function sortedIndexOf(array, value2) { + var length = array == null ? 0 : array.length; + if (length) { + var index4 = baseSortedIndex_default(array, value2); + if (index4 < length && eq_default(array[index4], value2)) { + return index4; + } + } + return -1; +} +var sortedIndexOf_default; +var init_sortedIndexOf = __esm({ + "node_modules/lodash-es/sortedIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedIndex(); + init_eq(); + sortedIndexOf_default = sortedIndexOf; + } +}); + +// node_modules/lodash-es/sortedLastIndex.js +function sortedLastIndex(array, value2) { + return baseSortedIndex_default(array, value2, true); +} +var sortedLastIndex_default; +var init_sortedLastIndex = __esm({ + "node_modules/lodash-es/sortedLastIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedIndex(); + sortedLastIndex_default = sortedLastIndex; + } +}); + +// node_modules/lodash-es/sortedLastIndexBy.js +function sortedLastIndexBy(array, value2, iteratee2) { + return baseSortedIndexBy_default(array, value2, baseIteratee_default(iteratee2, 2), true); +} +var sortedLastIndexBy_default; +var init_sortedLastIndexBy = __esm({ + "node_modules/lodash-es/sortedLastIndexBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseSortedIndexBy(); + sortedLastIndexBy_default = sortedLastIndexBy; + } +}); + +// node_modules/lodash-es/sortedLastIndexOf.js +function sortedLastIndexOf(array, value2) { + var length = array == null ? 0 : array.length; + if (length) { + var index4 = baseSortedIndex_default(array, value2, true) - 1; + if (eq_default(array[index4], value2)) { + return index4; + } + } + return -1; +} +var sortedLastIndexOf_default; +var init_sortedLastIndexOf = __esm({ + "node_modules/lodash-es/sortedLastIndexOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedIndex(); + init_eq(); + sortedLastIndexOf_default = sortedLastIndexOf; + } +}); + +// node_modules/lodash-es/_baseSortedUniq.js +function baseSortedUniq(array, iteratee2) { + var index4 = -1, length = array.length, resIndex = 0, result2 = []; + while (++index4 < length) { + var value2 = array[index4], computed = iteratee2 ? iteratee2(value2) : value2; + if (!index4 || !eq_default(computed, seen)) { + var seen = computed; + result2[resIndex++] = value2 === 0 ? 0 : value2; + } + } + return result2; +} +var baseSortedUniq_default; +var init_baseSortedUniq = __esm({ + "node_modules/lodash-es/_baseSortedUniq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_eq(); + baseSortedUniq_default = baseSortedUniq; + } +}); + +// node_modules/lodash-es/sortedUniq.js +function sortedUniq(array) { + return array && array.length ? baseSortedUniq_default(array) : []; +} +var sortedUniq_default; +var init_sortedUniq = __esm({ + "node_modules/lodash-es/sortedUniq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSortedUniq(); + sortedUniq_default = sortedUniq; + } +}); + +// node_modules/lodash-es/sortedUniqBy.js +function sortedUniqBy(array, iteratee2) { + return array && array.length ? baseSortedUniq_default(array, baseIteratee_default(iteratee2, 2)) : []; +} +var sortedUniqBy_default; +var init_sortedUniqBy = __esm({ + "node_modules/lodash-es/sortedUniqBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseSortedUniq(); + sortedUniqBy_default = sortedUniqBy; + } +}); + +// node_modules/lodash-es/split.js +function split(string2, separator, limit) { + if (limit && typeof limit != "number" && isIterateeCall_default(string2, separator, limit)) { + separator = limit = void 0; + } + limit = limit === void 0 ? MAX_ARRAY_LENGTH5 : limit >>> 0; + if (!limit) { + return []; + } + string2 = toString_default(string2); + if (string2 && (typeof separator == "string" || separator != null && !isRegExp_default(separator))) { + separator = baseToString_default(separator); + if (!separator && hasUnicode_default(string2)) { + return castSlice_default(stringToArray_default(string2), 0, limit); + } + } + return string2.split(separator, limit); +} +var MAX_ARRAY_LENGTH5, split_default; +var init_split = __esm({ + "node_modules/lodash-es/split.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + init_castSlice(); + init_hasUnicode(); + init_isIterateeCall(); + init_isRegExp(); + init_stringToArray(); + init_toString(); + MAX_ARRAY_LENGTH5 = 4294967295; + split_default = split; + } +}); + +// node_modules/lodash-es/spread.js +function spread(func, start) { + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT11); + } + start = start == null ? 0 : nativeMax14(toInteger_default(start), 0); + return baseRest_default(function(args) { + var array = args[start], otherArgs = castSlice_default(args, 0, start); + if (array) { + arrayPush_default(otherArgs, array); + } + return apply_default(func, this, otherArgs); + }); +} +var FUNC_ERROR_TEXT11, nativeMax14, spread_default; +var init_spread = __esm({ + "node_modules/lodash-es/spread.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_arrayPush(); + init_baseRest(); + init_castSlice(); + init_toInteger(); + FUNC_ERROR_TEXT11 = "Expected a function"; + nativeMax14 = Math.max; + spread_default = spread; + } +}); + +// node_modules/lodash-es/startCase.js +var startCase, startCase_default; +var init_startCase = __esm({ + "node_modules/lodash-es/startCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCompounder(); + init_upperFirst(); + startCase = createCompounder_default(function(result2, word, index4) { + return result2 + (index4 ? " " : "") + upperFirst_default(word); + }); + startCase_default = startCase; + } +}); + +// node_modules/lodash-es/startsWith.js +function startsWith(string2, target, position) { + string2 = toString_default(string2); + position = position == null ? 0 : baseClamp_default(toInteger_default(position), 0, string2.length); + target = baseToString_default(target); + return string2.slice(position, position + target.length) == target; +} +var startsWith_default; +var init_startsWith = __esm({ + "node_modules/lodash-es/startsWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_baseToString(); + init_toInteger(); + init_toString(); + startsWith_default = startsWith; + } +}); + +// node_modules/lodash-es/stubObject.js +function stubObject() { + return {}; +} +var stubObject_default; +var init_stubObject = __esm({ + "node_modules/lodash-es/stubObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stubObject_default = stubObject; + } +}); + +// node_modules/lodash-es/stubString.js +function stubString() { + return ""; +} +var stubString_default; +var init_stubString = __esm({ + "node_modules/lodash-es/stubString.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stubString_default = stubString; + } +}); + +// node_modules/lodash-es/stubTrue.js +function stubTrue() { + return true; +} +var stubTrue_default; +var init_stubTrue = __esm({ + "node_modules/lodash-es/stubTrue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stubTrue_default = stubTrue; + } +}); + +// node_modules/lodash-es/subtract.js +var subtract, subtract_default; +var init_subtract = __esm({ + "node_modules/lodash-es/subtract.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createMathOperation(); + subtract = createMathOperation_default(function(minuend, subtrahend) { + return minuend - subtrahend; + }, 0); + subtract_default = subtract; + } +}); + +// node_modules/lodash-es/sum.js +function sum(array) { + return array && array.length ? baseSum_default(array, identity_default) : 0; +} +var sum_default; +var init_sum = __esm({ + "node_modules/lodash-es/sum.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSum(); + init_identity2(); + sum_default = sum; + } +}); + +// node_modules/lodash-es/sumBy.js +function sumBy(array, iteratee2) { + return array && array.length ? baseSum_default(array, baseIteratee_default(iteratee2, 2)) : 0; +} +var sumBy_default; +var init_sumBy = __esm({ + "node_modules/lodash-es/sumBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseSum(); + sumBy_default = sumBy; + } +}); + +// node_modules/lodash-es/tail.js +function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice_default(array, 1, length) : []; +} +var tail_default; +var init_tail = __esm({ + "node_modules/lodash-es/tail.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + tail_default = tail; + } +}); + +// node_modules/lodash-es/take.js +function take(array, n7, guard) { + if (!(array && array.length)) { + return []; + } + n7 = guard || n7 === void 0 ? 1 : toInteger_default(n7); + return baseSlice_default(array, 0, n7 < 0 ? 0 : n7); +} +var take_default; +var init_take = __esm({ + "node_modules/lodash-es/take.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_toInteger(); + take_default = take; + } +}); + +// node_modules/lodash-es/takeRight.js +function takeRight(array, n7, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n7 = guard || n7 === void 0 ? 1 : toInteger_default(n7); + n7 = length - n7; + return baseSlice_default(array, n7 < 0 ? 0 : n7, length); +} +var takeRight_default; +var init_takeRight = __esm({ + "node_modules/lodash-es/takeRight.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSlice(); + init_toInteger(); + takeRight_default = takeRight; + } +}); + +// node_modules/lodash-es/takeRightWhile.js +function takeRightWhile(array, predicate) { + return array && array.length ? baseWhile_default(array, baseIteratee_default(predicate, 3), false, true) : []; +} +var takeRightWhile_default; +var init_takeRightWhile = __esm({ + "node_modules/lodash-es/takeRightWhile.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseWhile(); + takeRightWhile_default = takeRightWhile; + } +}); + +// node_modules/lodash-es/takeWhile.js +function takeWhile(array, predicate) { + return array && array.length ? baseWhile_default(array, baseIteratee_default(predicate, 3)) : []; +} +var takeWhile_default; +var init_takeWhile = __esm({ + "node_modules/lodash-es/takeWhile.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseWhile(); + takeWhile_default = takeWhile; + } +}); + +// node_modules/lodash-es/tap.js +function tap(value2, interceptor) { + interceptor(value2); + return value2; +} +var tap_default; +var init_tap = __esm({ + "node_modules/lodash-es/tap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + tap_default = tap; + } +}); + +// node_modules/lodash-es/_customDefaultsAssignIn.js +function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === void 0 || eq_default(objValue, objectProto28[key]) && !hasOwnProperty24.call(object, key)) { + return srcValue; + } + return objValue; +} +var objectProto28, hasOwnProperty24, customDefaultsAssignIn_default; +var init_customDefaultsAssignIn = __esm({ + "node_modules/lodash-es/_customDefaultsAssignIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_eq(); + objectProto28 = Object.prototype; + hasOwnProperty24 = objectProto28.hasOwnProperty; + customDefaultsAssignIn_default = customDefaultsAssignIn; + } +}); + +// node_modules/lodash-es/_escapeStringChar.js +function escapeStringChar(chr) { + return "\\" + stringEscapes[chr]; +} +var stringEscapes, escapeStringChar_default; +var init_escapeStringChar = __esm({ + "node_modules/lodash-es/_escapeStringChar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + stringEscapes = { + "\\": "\\", + "'": "'", + "\n": "n", + "\r": "r", + "\u2028": "u2028", + "\u2029": "u2029" + }; + escapeStringChar_default = escapeStringChar; + } +}); + +// node_modules/lodash-es/_reInterpolate.js +var reInterpolate, reInterpolate_default; +var init_reInterpolate = __esm({ + "node_modules/lodash-es/_reInterpolate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reInterpolate = /<%=([\s\S]+?)%>/g; + reInterpolate_default = reInterpolate; + } +}); + +// node_modules/lodash-es/_reEscape.js +var reEscape, reEscape_default; +var init_reEscape = __esm({ + "node_modules/lodash-es/_reEscape.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reEscape = /<%-([\s\S]+?)%>/g; + reEscape_default = reEscape; + } +}); + +// node_modules/lodash-es/_reEvaluate.js +var reEvaluate, reEvaluate_default; +var init_reEvaluate = __esm({ + "node_modules/lodash-es/_reEvaluate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + reEvaluate = /<%([\s\S]+?)%>/g; + reEvaluate_default = reEvaluate; + } +}); + +// node_modules/lodash-es/templateSettings.js +var templateSettings, templateSettings_default; +var init_templateSettings = __esm({ + "node_modules/lodash-es/templateSettings.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_escape(); + init_reEscape(); + init_reEvaluate(); + init_reInterpolate(); + templateSettings = { + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "escape": reEscape_default, + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "evaluate": reEvaluate_default, + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "interpolate": reInterpolate_default, + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + "variable": "", + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + "imports": { + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + "_": { "escape": escape_default } + } + }; + templateSettings_default = templateSettings; + } +}); + +// node_modules/lodash-es/template.js +function template(string2, options, guard) { + var settings = templateSettings_default.imports._.templateSettings || templateSettings_default; + if (guard && isIterateeCall_default(string2, options, guard)) { + options = void 0; + } + string2 = toString_default(string2); + options = assignWith_default({}, options, settings, customDefaultsAssignIn_default); + var imports = assignWith_default({}, options.imports, settings.imports, customDefaultsAssignIn_default), importsKeys = keys_default(imports), importsValues = baseValues_default(imports, importsKeys); + arrayEach_default(importsKeys, function(key) { + if (reForbiddenIdentifierChars.test(key)) { + throw new Error(INVALID_TEMPL_IMPORTS_ERROR_TEXT); + } + }); + var isEscaping, isEvaluating, index4 = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; + var reDelimiters = RegExp( + (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate_default ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", + "g" + ); + var sourceURL = hasOwnProperty25.call(options, "sourceURL") ? "//# sourceURL=" + (options.sourceURL + "").replace(/\s/g, " ") + "\n" : ""; + string2.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + interpolateValue || (interpolateValue = esTemplateValue); + source += string2.slice(index4, offset).replace(reUnescapedString, escapeStringChar_default); + if (escapeValue) { + isEscaping = true; + source += "' +\n__e(" + escapeValue + ") +\n'"; + } + if (evaluateValue) { + isEvaluating = true; + source += "';\n" + evaluateValue + ";\n__p += '"; + } + if (interpolateValue) { + source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; + } + index4 = offset + match.length; + return match; + }); + source += "';\n"; + var variable = hasOwnProperty25.call(options, "variable") && options.variable; + if (!variable) { + source = "with (obj) {\n" + source + "\n}\n"; + } else if (reForbiddenIdentifierChars.test(variable)) { + throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); + } + source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); + source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; + var result2 = attempt_default(function() { + return Function(importsKeys, sourceURL + "return " + source).apply(void 0, importsValues); + }); + result2.source = source; + if (isError_default(result2)) { + throw result2; + } + return result2; +} +var INVALID_TEMPL_VAR_ERROR_TEXT, INVALID_TEMPL_IMPORTS_ERROR_TEXT, reEmptyStringLeading, reEmptyStringMiddle, reEmptyStringTrailing, reForbiddenIdentifierChars, reEsTemplate, reNoMatch, reUnescapedString, objectProto29, hasOwnProperty25, template_default; +var init_template = __esm({ + "node_modules/lodash-es/template.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_assignWith(); + init_attempt(); + init_baseValues(); + init_customDefaultsAssignIn(); + init_escapeStringChar(); + init_isError(); + init_isIterateeCall(); + init_keys(); + init_reInterpolate(); + init_templateSettings(); + init_toString(); + INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; + INVALID_TEMPL_IMPORTS_ERROR_TEXT = "Invalid `imports` option passed into `_.template`"; + reEmptyStringLeading = /\b__p \+= '';/g; + reEmptyStringMiddle = /\b(__p \+=) '' \+/g; + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + reNoMatch = /($^)/; + reUnescapedString = /['\n\r\u2028\u2029\\]/g; + objectProto29 = Object.prototype; + hasOwnProperty25 = objectProto29.hasOwnProperty; + template_default = template; + } +}); + +// node_modules/lodash-es/throttle.js +function throttle(func, wait, options) { + var leading = true, trailing = true; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT12); + } + if (isObject_default(options)) { + leading = "leading" in options ? !!options.leading : leading; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + return debounce_default(func, wait, { + "leading": leading, + "maxWait": wait, + "trailing": trailing + }); +} +var FUNC_ERROR_TEXT12, throttle_default; +var init_throttle = __esm({ + "node_modules/lodash-es/throttle.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_debounce(); + init_isObject(); + FUNC_ERROR_TEXT12 = "Expected a function"; + throttle_default = throttle; + } +}); + +// node_modules/lodash-es/thru.js +function thru(value2, interceptor) { + return interceptor(value2); +} +var thru_default; +var init_thru = __esm({ + "node_modules/lodash-es/thru.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + thru_default = thru; + } +}); + +// node_modules/lodash-es/times.js +function times(n7, iteratee2) { + n7 = toInteger_default(n7); + if (n7 < 1 || n7 > MAX_SAFE_INTEGER5) { + return []; + } + var index4 = MAX_ARRAY_LENGTH6, length = nativeMin12(n7, MAX_ARRAY_LENGTH6); + iteratee2 = castFunction_default(iteratee2); + n7 -= MAX_ARRAY_LENGTH6; + var result2 = baseTimes_default(length, iteratee2); + while (++index4 < n7) { + iteratee2(index4); + } + return result2; +} +var MAX_SAFE_INTEGER5, MAX_ARRAY_LENGTH6, nativeMin12, times_default; +var init_times = __esm({ + "node_modules/lodash-es/times.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseTimes(); + init_castFunction(); + init_toInteger(); + MAX_SAFE_INTEGER5 = 9007199254740991; + MAX_ARRAY_LENGTH6 = 4294967295; + nativeMin12 = Math.min; + times_default = times; + } +}); + +// node_modules/lodash-es/toIterator.js +function wrapperToIterator() { + return this; +} +var toIterator_default; +var init_toIterator = __esm({ + "node_modules/lodash-es/toIterator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + toIterator_default = wrapperToIterator; + } +}); + +// node_modules/lodash-es/_baseWrapperValue.js +function baseWrapperValue(value2, actions) { + var result2 = value2; + if (result2 instanceof LazyWrapper_default) { + result2 = result2.value(); + } + return arrayReduce_default(actions, function(result3, action) { + return action.func.apply(action.thisArg, arrayPush_default([result3], action.args)); + }, result2); +} +var baseWrapperValue_default; +var init_baseWrapperValue = __esm({ + "node_modules/lodash-es/_baseWrapperValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_arrayPush(); + init_arrayReduce(); + baseWrapperValue_default = baseWrapperValue; + } +}); + +// node_modules/lodash-es/wrapperValue.js +function wrapperValue() { + return baseWrapperValue_default(this.__wrapped__, this.__actions__); +} +var wrapperValue_default; +var init_wrapperValue = __esm({ + "node_modules/lodash-es/wrapperValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseWrapperValue(); + wrapperValue_default = wrapperValue; + } +}); + +// node_modules/lodash-es/toJSON.js +var init_toJSON = __esm({ + "node_modules/lodash-es/toJSON.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_wrapperValue(); + } +}); + +// node_modules/lodash-es/toLower.js +function toLower(value2) { + return toString_default(value2).toLowerCase(); +} +var toLower_default; +var init_toLower = __esm({ + "node_modules/lodash-es/toLower.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + toLower_default = toLower; + } +}); + +// node_modules/lodash-es/toPath.js +function toPath(value2) { + if (isArray_default(value2)) { + return arrayMap_default(value2, toKey_default); + } + return isSymbol_default(value2) ? [value2] : copyArray_default(stringToPath_default(toString_default(value2))); +} +var toPath_default; +var init_toPath = __esm({ + "node_modules/lodash-es/toPath.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayMap(); + init_copyArray(); + init_isArray(); + init_isSymbol(); + init_stringToPath(); + init_toKey(); + init_toString(); + toPath_default = toPath; + } +}); + +// node_modules/lodash-es/toSafeInteger.js +function toSafeInteger(value2) { + return value2 ? baseClamp_default(toInteger_default(value2), -MAX_SAFE_INTEGER6, MAX_SAFE_INTEGER6) : value2 === 0 ? value2 : 0; +} +var MAX_SAFE_INTEGER6, toSafeInteger_default; +var init_toSafeInteger = __esm({ + "node_modules/lodash-es/toSafeInteger.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseClamp(); + init_toInteger(); + MAX_SAFE_INTEGER6 = 9007199254740991; + toSafeInteger_default = toSafeInteger; + } +}); + +// node_modules/lodash-es/toUpper.js +function toUpper(value2) { + return toString_default(value2).toUpperCase(); +} +var toUpper_default; +var init_toUpper = __esm({ + "node_modules/lodash-es/toUpper.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + toUpper_default = toUpper; + } +}); + +// node_modules/lodash-es/transform.js +function transform(object, iteratee2, accumulator) { + var isArr = isArray_default(object), isArrLike = isArr || isBuffer_default(object) || isTypedArray_default(object); + iteratee2 = baseIteratee_default(iteratee2, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor() : []; + } else if (isObject_default(object)) { + accumulator = isFunction_default(Ctor) ? baseCreate_default(getPrototype_default(object)) : {}; + } else { + accumulator = {}; + } + } + (isArrLike ? arrayEach_default : baseForOwn_default)(object, function(value2, index4, object2) { + return iteratee2(accumulator, value2, index4, object2); + }); + return accumulator; +} +var transform_default; +var init_transform = __esm({ + "node_modules/lodash-es/transform.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayEach(); + init_baseCreate(); + init_baseForOwn(); + init_baseIteratee(); + init_getPrototype(); + init_isArray(); + init_isBuffer(); + init_isFunction(); + init_isObject(); + init_isTypedArray(); + transform_default = transform; + } +}); + +// node_modules/lodash-es/_charsEndIndex.js +function charsEndIndex(strSymbols, chrSymbols) { + var index4 = strSymbols.length; + while (index4-- && baseIndexOf_default(chrSymbols, strSymbols[index4], 0) > -1) { + } + return index4; +} +var charsEndIndex_default; +var init_charsEndIndex = __esm({ + "node_modules/lodash-es/_charsEndIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIndexOf(); + charsEndIndex_default = charsEndIndex; + } +}); + +// node_modules/lodash-es/_charsStartIndex.js +function charsStartIndex(strSymbols, chrSymbols) { + var index4 = -1, length = strSymbols.length; + while (++index4 < length && baseIndexOf_default(chrSymbols, strSymbols[index4], 0) > -1) { + } + return index4; +} +var charsStartIndex_default; +var init_charsStartIndex = __esm({ + "node_modules/lodash-es/_charsStartIndex.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIndexOf(); + charsStartIndex_default = charsStartIndex; + } +}); + +// node_modules/lodash-es/trim.js +function trim(string2, chars, guard) { + string2 = toString_default(string2); + if (string2 && (guard || chars === void 0)) { + return baseTrim_default(string2); + } + if (!string2 || !(chars = baseToString_default(chars))) { + return string2; + } + var strSymbols = stringToArray_default(string2), chrSymbols = stringToArray_default(chars), start = charsStartIndex_default(strSymbols, chrSymbols), end = charsEndIndex_default(strSymbols, chrSymbols) + 1; + return castSlice_default(strSymbols, start, end).join(""); +} +var trim_default; +var init_trim = __esm({ + "node_modules/lodash-es/trim.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + init_baseTrim(); + init_castSlice(); + init_charsEndIndex(); + init_charsStartIndex(); + init_stringToArray(); + init_toString(); + trim_default = trim; + } +}); + +// node_modules/lodash-es/trimEnd.js +function trimEnd(string2, chars, guard) { + string2 = toString_default(string2); + if (string2 && (guard || chars === void 0)) { + return string2.slice(0, trimmedEndIndex_default(string2) + 1); + } + if (!string2 || !(chars = baseToString_default(chars))) { + return string2; + } + var strSymbols = stringToArray_default(string2), end = charsEndIndex_default(strSymbols, stringToArray_default(chars)) + 1; + return castSlice_default(strSymbols, 0, end).join(""); +} +var trimEnd_default; +var init_trimEnd = __esm({ + "node_modules/lodash-es/trimEnd.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + init_castSlice(); + init_charsEndIndex(); + init_stringToArray(); + init_toString(); + init_trimmedEndIndex(); + trimEnd_default = trimEnd; + } +}); + +// node_modules/lodash-es/trimStart.js +function trimStart(string2, chars, guard) { + string2 = toString_default(string2); + if (string2 && (guard || chars === void 0)) { + return string2.replace(reTrimStart3, ""); + } + if (!string2 || !(chars = baseToString_default(chars))) { + return string2; + } + var strSymbols = stringToArray_default(string2), start = charsStartIndex_default(strSymbols, stringToArray_default(chars)); + return castSlice_default(strSymbols, start).join(""); +} +var reTrimStart3, trimStart_default; +var init_trimStart = __esm({ + "node_modules/lodash-es/trimStart.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + init_castSlice(); + init_charsStartIndex(); + init_stringToArray(); + init_toString(); + reTrimStart3 = /^\s+/; + trimStart_default = trimStart; + } +}); + +// node_modules/lodash-es/truncate.js +function truncate(string2, options) { + var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; + if (isObject_default(options)) { + var separator = "separator" in options ? options.separator : separator; + length = "length" in options ? toInteger_default(options.length) : length; + omission = "omission" in options ? baseToString_default(options.omission) : omission; + } + string2 = toString_default(string2); + var strLength = string2.length; + if (hasUnicode_default(string2)) { + var strSymbols = stringToArray_default(string2); + strLength = strSymbols.length; + } + if (length >= strLength) { + return string2; + } + var end = length - stringSize_default(omission); + if (end < 1) { + return omission; + } + var result2 = strSymbols ? castSlice_default(strSymbols, 0, end).join("") : string2.slice(0, end); + if (separator === void 0) { + return result2 + omission; + } + if (strSymbols) { + end += result2.length - end; + } + if (isRegExp_default(separator)) { + if (string2.slice(end).search(separator)) { + var match, substring = result2; + if (!separator.global) { + separator = RegExp(separator.source, toString_default(reFlags2.exec(separator)) + "g"); + } + separator.lastIndex = 0; + while (match = separator.exec(substring)) { + var newEnd = match.index; + } + result2 = result2.slice(0, newEnd === void 0 ? end : newEnd); + } + } else if (string2.indexOf(baseToString_default(separator), end) != end) { + var index4 = result2.lastIndexOf(separator); + if (index4 > -1) { + result2 = result2.slice(0, index4); + } + } + return result2 + omission; +} +var DEFAULT_TRUNC_LENGTH, DEFAULT_TRUNC_OMISSION, reFlags2, truncate_default; +var init_truncate = __esm({ + "node_modules/lodash-es/truncate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseToString(); + init_castSlice(); + init_hasUnicode(); + init_isObject(); + init_isRegExp(); + init_stringSize(); + init_stringToArray(); + init_toInteger(); + init_toString(); + DEFAULT_TRUNC_LENGTH = 30; + DEFAULT_TRUNC_OMISSION = "..."; + reFlags2 = /\w*$/; + truncate_default = truncate; + } +}); + +// node_modules/lodash-es/unary.js +function unary(func) { + return ary_default(func, 1); +} +var unary_default; +var init_unary = __esm({ + "node_modules/lodash-es/unary.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ary(); + unary_default = unary; + } +}); + +// node_modules/lodash-es/_unescapeHtmlChar.js +var htmlUnescapes, unescapeHtmlChar, unescapeHtmlChar_default; +var init_unescapeHtmlChar = __esm({ + "node_modules/lodash-es/_unescapeHtmlChar.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_basePropertyOf(); + htmlUnescapes = { + "&": "&", + "<": "<", + ">": ">", + """: '"', + "'": "'" + }; + unescapeHtmlChar = basePropertyOf_default(htmlUnescapes); + unescapeHtmlChar_default = unescapeHtmlChar; + } +}); + +// node_modules/lodash-es/unescape.js +function unescape2(string2) { + string2 = toString_default(string2); + return string2 && reHasEscapedHtml.test(string2) ? string2.replace(reEscapedHtml, unescapeHtmlChar_default) : string2; +} +var reEscapedHtml, reHasEscapedHtml, unescape_default; +var init_unescape = __esm({ + "node_modules/lodash-es/unescape.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + init_unescapeHtmlChar(); + reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g; + reHasEscapedHtml = RegExp(reEscapedHtml.source); + unescape_default = unescape2; + } +}); + +// node_modules/lodash-es/_createSet.js +var INFINITY6, createSet, createSet_default; +var init_createSet = __esm({ + "node_modules/lodash-es/_createSet.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_Set(); + init_noop(); + init_setToArray(); + INFINITY6 = 1 / 0; + createSet = !(Set_default && 1 / setToArray_default(new Set_default([, -0]))[1] == INFINITY6) ? noop_default : function(values2) { + return new Set_default(values2); + }; + createSet_default = createSet; + } +}); + +// node_modules/lodash-es/_baseUniq.js +function baseUniq(array, iteratee2, comparator) { + var index4 = -1, includes2 = arrayIncludes_default, length = array.length, isCommon = true, result2 = [], seen = result2; + if (comparator) { + isCommon = false; + includes2 = arrayIncludesWith_default; + } else if (length >= LARGE_ARRAY_SIZE3) { + var set4 = iteratee2 ? null : createSet_default(array); + if (set4) { + return setToArray_default(set4); + } + isCommon = false; + includes2 = cacheHas_default; + seen = new SetCache_default(); + } else { + seen = iteratee2 ? [] : result2; + } + outer: + while (++index4 < length) { + var value2 = array[index4], computed = iteratee2 ? iteratee2(value2) : value2; + value2 = comparator || value2 !== 0 ? value2 : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee2) { + seen.push(computed); + } + result2.push(value2); + } else if (!includes2(seen, computed, comparator)) { + if (seen !== result2) { + seen.push(computed); + } + result2.push(value2); + } + } + return result2; +} +var LARGE_ARRAY_SIZE3, baseUniq_default; +var init_baseUniq = __esm({ + "node_modules/lodash-es/_baseUniq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_SetCache(); + init_arrayIncludes(); + init_arrayIncludesWith(); + init_cacheHas(); + init_createSet(); + init_setToArray(); + LARGE_ARRAY_SIZE3 = 200; + baseUniq_default = baseUniq; + } +}); + +// node_modules/lodash-es/union.js +var union, union_default; +var init_union = __esm({ + "node_modules/lodash-es/union.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_baseRest(); + init_baseUniq(); + init_isArrayLikeObject(); + union = baseRest_default(function(arrays) { + return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true)); + }); + union_default = union; + } +}); + +// node_modules/lodash-es/unionBy.js +var unionBy, unionBy_default; +var init_unionBy = __esm({ + "node_modules/lodash-es/unionBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_baseIteratee(); + init_baseRest(); + init_baseUniq(); + init_isArrayLikeObject(); + init_last(); + unionBy = baseRest_default(function(arrays) { + var iteratee2 = last_default(arrays); + if (isArrayLikeObject_default(iteratee2)) { + iteratee2 = void 0; + } + return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true), baseIteratee_default(iteratee2, 2)); + }); + unionBy_default = unionBy; + } +}); + +// node_modules/lodash-es/unionWith.js +var unionWith, unionWith_default; +var init_unionWith = __esm({ + "node_modules/lodash-es/unionWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseFlatten(); + init_baseRest(); + init_baseUniq(); + init_isArrayLikeObject(); + init_last(); + unionWith = baseRest_default(function(arrays) { + var comparator = last_default(arrays); + comparator = typeof comparator == "function" ? comparator : void 0; + return baseUniq_default(baseFlatten_default(arrays, 1, isArrayLikeObject_default, true), void 0, comparator); + }); + unionWith_default = unionWith; + } +}); + +// node_modules/lodash-es/uniq.js +function uniq(array) { + return array && array.length ? baseUniq_default(array) : []; +} +var uniq_default; +var init_uniq = __esm({ + "node_modules/lodash-es/uniq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUniq(); + uniq_default = uniq; + } +}); + +// node_modules/lodash-es/uniqBy.js +function uniqBy(array, iteratee2) { + return array && array.length ? baseUniq_default(array, baseIteratee_default(iteratee2, 2)) : []; +} +var uniqBy_default; +var init_uniqBy = __esm({ + "node_modules/lodash-es/uniqBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseIteratee(); + init_baseUniq(); + uniqBy_default = uniqBy; + } +}); + +// node_modules/lodash-es/uniqWith.js +function uniqWith(array, comparator) { + comparator = typeof comparator == "function" ? comparator : void 0; + return array && array.length ? baseUniq_default(array, void 0, comparator) : []; +} +var uniqWith_default; +var init_uniqWith = __esm({ + "node_modules/lodash-es/uniqWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUniq(); + uniqWith_default = uniqWith; + } +}); + +// node_modules/lodash-es/uniqueId.js +function uniqueId(prefix) { + var id = ++idCounter; + return toString_default(prefix) + id; +} +var idCounter, uniqueId_default; +var init_uniqueId = __esm({ + "node_modules/lodash-es/uniqueId.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_toString(); + idCounter = 0; + uniqueId_default = uniqueId; + } +}); + +// node_modules/lodash-es/unset.js +function unset(object, path2) { + return object == null ? true : baseUnset_default(object, path2); +} +var unset_default; +var init_unset = __esm({ + "node_modules/lodash-es/unset.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUnset(); + unset_default = unset; + } +}); + +// node_modules/lodash-es/unzip.js +function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter_default(array, function(group2) { + if (isArrayLikeObject_default(group2)) { + length = nativeMax15(group2.length, length); + return true; + } + }); + return baseTimes_default(length, function(index4) { + return arrayMap_default(array, baseProperty_default(index4)); + }); +} +var nativeMax15, unzip_default; +var init_unzip = __esm({ + "node_modules/lodash-es/unzip.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_arrayMap(); + init_baseProperty(); + init_baseTimes(); + init_isArrayLikeObject(); + nativeMax15 = Math.max; + unzip_default = unzip; + } +}); + +// node_modules/lodash-es/unzipWith.js +function unzipWith(array, iteratee2) { + if (!(array && array.length)) { + return []; + } + var result2 = unzip_default(array); + if (iteratee2 == null) { + return result2; + } + return arrayMap_default(result2, function(group2) { + return apply_default(iteratee2, void 0, group2); + }); +} +var unzipWith_default; +var init_unzipWith = __esm({ + "node_modules/lodash-es/unzipWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply(); + init_arrayMap(); + init_unzip(); + unzipWith_default = unzipWith; + } +}); + +// node_modules/lodash-es/_baseUpdate.js +function baseUpdate(object, path2, updater, customizer) { + return baseSet_default(object, path2, updater(baseGet_default(object, path2)), customizer); +} +var baseUpdate_default; +var init_baseUpdate = __esm({ + "node_modules/lodash-es/_baseUpdate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseGet(); + init_baseSet(); + baseUpdate_default = baseUpdate; + } +}); + +// node_modules/lodash-es/update.js +function update(object, path2, updater) { + return object == null ? object : baseUpdate_default(object, path2, castFunction_default(updater)); +} +var update_default; +var init_update = __esm({ + "node_modules/lodash-es/update.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUpdate(); + init_castFunction(); + update_default = update; + } +}); + +// node_modules/lodash-es/updateWith.js +function updateWith(object, path2, updater, customizer) { + customizer = typeof customizer == "function" ? customizer : void 0; + return object == null ? object : baseUpdate_default(object, path2, castFunction_default(updater), customizer); +} +var updateWith_default; +var init_updateWith = __esm({ + "node_modules/lodash-es/updateWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseUpdate(); + init_castFunction(); + updateWith_default = updateWith; + } +}); + +// node_modules/lodash-es/upperCase.js +var upperCase, upperCase_default; +var init_upperCase = __esm({ + "node_modules/lodash-es/upperCase.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_createCompounder(); + upperCase = createCompounder_default(function(result2, word, index4) { + return result2 + (index4 ? " " : "") + word.toUpperCase(); + }); + upperCase_default = upperCase; + } +}); + +// node_modules/lodash-es/value.js +var init_value = __esm({ + "node_modules/lodash-es/value.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_wrapperValue(); + } +}); + +// node_modules/lodash-es/valueOf.js +var init_valueOf = __esm({ + "node_modules/lodash-es/valueOf.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_wrapperValue(); + } +}); + +// node_modules/lodash-es/valuesIn.js +function valuesIn(object) { + return object == null ? [] : baseValues_default(object, keysIn_default(object)); +} +var valuesIn_default; +var init_valuesIn = __esm({ + "node_modules/lodash-es/valuesIn.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseValues(); + init_keysIn(); + valuesIn_default = valuesIn; + } +}); + +// node_modules/lodash-es/without.js +var without, without_default; +var init_without = __esm({ + "node_modules/lodash-es/without.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDifference(); + init_baseRest(); + init_isArrayLikeObject(); + without = baseRest_default(function(array, values2) { + return isArrayLikeObject_default(array) ? baseDifference_default(array, values2) : []; + }); + without_default = without; + } +}); + +// node_modules/lodash-es/wrap.js +function wrap(value2, wrapper) { + return partial_default(castFunction_default(wrapper), value2); +} +var wrap_default; +var init_wrap = __esm({ + "node_modules/lodash-es/wrap.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castFunction(); + init_partial(); + wrap_default = wrap; + } +}); + +// node_modules/lodash-es/wrapperAt.js +var wrapperAt, wrapperAt_default; +var init_wrapperAt = __esm({ + "node_modules/lodash-es/wrapperAt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_LodashWrapper(); + init_baseAt(); + init_flatRest(); + init_isIndex(); + init_thru(); + wrapperAt = flatRest_default(function(paths) { + var length = paths.length, start = length ? paths[0] : 0, value2 = this.__wrapped__, interceptor = function(object) { + return baseAt_default(object, paths); + }; + if (length > 1 || this.__actions__.length || !(value2 instanceof LazyWrapper_default) || !isIndex_default(start)) { + return this.thru(interceptor); + } + value2 = value2.slice(start, +start + (length ? 1 : 0)); + value2.__actions__.push({ + "func": thru_default, + "args": [interceptor], + "thisArg": void 0 + }); + return new LodashWrapper_default(value2, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(void 0); + } + return array; + }); + }); + wrapperAt_default = wrapperAt; + } +}); + +// node_modules/lodash-es/wrapperChain.js +function wrapperChain() { + return chain_default(this); +} +var wrapperChain_default; +var init_wrapperChain = __esm({ + "node_modules/lodash-es/wrapperChain.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chain(); + wrapperChain_default = wrapperChain; + } +}); + +// node_modules/lodash-es/wrapperReverse.js +function wrapperReverse() { + var value2 = this.__wrapped__; + if (value2 instanceof LazyWrapper_default) { + var wrapped = value2; + if (this.__actions__.length) { + wrapped = new LazyWrapper_default(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + "func": thru_default, + "args": [reverse_default], + "thisArg": void 0 + }); + return new LodashWrapper_default(wrapped, this.__chain__); + } + return this.thru(reverse_default); +} +var wrapperReverse_default; +var init_wrapperReverse = __esm({ + "node_modules/lodash-es/wrapperReverse.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_LodashWrapper(); + init_reverse(); + init_thru(); + wrapperReverse_default = wrapperReverse; + } +}); + +// node_modules/lodash-es/_baseXor.js +function baseXor(arrays, iteratee2, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq_default(arrays[0]) : []; + } + var index4 = -1, result2 = Array(length); + while (++index4 < length) { + var array = arrays[index4], othIndex = -1; + while (++othIndex < length) { + if (othIndex != index4) { + result2[index4] = baseDifference_default(result2[index4] || array, arrays[othIndex], iteratee2, comparator); + } + } + } + return baseUniq_default(baseFlatten_default(result2, 1), iteratee2, comparator); +} +var baseXor_default; +var init_baseXor = __esm({ + "node_modules/lodash-es/_baseXor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseDifference(); + init_baseFlatten(); + init_baseUniq(); + baseXor_default = baseXor; + } +}); + +// node_modules/lodash-es/xor.js +var xor, xor_default; +var init_xor = __esm({ + "node_modules/lodash-es/xor.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_baseRest(); + init_baseXor(); + init_isArrayLikeObject(); + xor = baseRest_default(function(arrays) { + return baseXor_default(arrayFilter_default(arrays, isArrayLikeObject_default)); + }); + xor_default = xor; + } +}); + +// node_modules/lodash-es/xorBy.js +var xorBy, xorBy_default; +var init_xorBy = __esm({ + "node_modules/lodash-es/xorBy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_baseIteratee(); + init_baseRest(); + init_baseXor(); + init_isArrayLikeObject(); + init_last(); + xorBy = baseRest_default(function(arrays) { + var iteratee2 = last_default(arrays); + if (isArrayLikeObject_default(iteratee2)) { + iteratee2 = void 0; + } + return baseXor_default(arrayFilter_default(arrays, isArrayLikeObject_default), baseIteratee_default(iteratee2, 2)); + }); + xorBy_default = xorBy; + } +}); + +// node_modules/lodash-es/xorWith.js +var xorWith, xorWith_default; +var init_xorWith = __esm({ + "node_modules/lodash-es/xorWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_arrayFilter(); + init_baseRest(); + init_baseXor(); + init_isArrayLikeObject(); + init_last(); + xorWith = baseRest_default(function(arrays) { + var comparator = last_default(arrays); + comparator = typeof comparator == "function" ? comparator : void 0; + return baseXor_default(arrayFilter_default(arrays, isArrayLikeObject_default), void 0, comparator); + }); + xorWith_default = xorWith; + } +}); + +// node_modules/lodash-es/zip.js +var zip, zip_default; +var init_zip = __esm({ + "node_modules/lodash-es/zip.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_unzip(); + zip = baseRest_default(unzip_default); + zip_default = zip; + } +}); + +// node_modules/lodash-es/_baseZipObject.js +function baseZipObject(props, values2, assignFunc) { + var index4 = -1, length = props.length, valsLength = values2.length, result2 = {}; + while (++index4 < length) { + var value2 = index4 < valsLength ? values2[index4] : void 0; + assignFunc(result2, props[index4], value2); + } + return result2; +} +var baseZipObject_default; +var init_baseZipObject = __esm({ + "node_modules/lodash-es/_baseZipObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + baseZipObject_default = baseZipObject; + } +}); + +// node_modules/lodash-es/zipObject.js +function zipObject(props, values2) { + return baseZipObject_default(props || [], values2 || [], assignValue_default); +} +var zipObject_default; +var init_zipObject = __esm({ + "node_modules/lodash-es/zipObject.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assignValue(); + init_baseZipObject(); + zipObject_default = zipObject; + } +}); + +// node_modules/lodash-es/zipObjectDeep.js +function zipObjectDeep(props, values2) { + return baseZipObject_default(props || [], values2 || [], baseSet_default); +} +var zipObjectDeep_default; +var init_zipObjectDeep = __esm({ + "node_modules/lodash-es/zipObjectDeep.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseSet(); + init_baseZipObject(); + zipObjectDeep_default = zipObjectDeep; + } +}); + +// node_modules/lodash-es/zipWith.js +var zipWith, zipWith_default; +var init_zipWith = __esm({ + "node_modules/lodash-es/zipWith.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseRest(); + init_unzipWith(); + zipWith = baseRest_default(function(arrays) { + var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : void 0; + iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : void 0; + return unzipWith_default(arrays, iteratee2); + }); + zipWith_default = zipWith; + } +}); + +// node_modules/lodash-es/array.default.js +var array_default_default; +var init_array_default = __esm({ + "node_modules/lodash-es/array.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk(); + init_compact(); + init_concat(); + init_difference(); + init_differenceBy(); + init_differenceWith(); + init_drop(); + init_dropRight(); + init_dropRightWhile(); + init_dropWhile(); + init_fill(); + init_findIndex(); + init_findLastIndex(); + init_first(); + init_flatten(); + init_flattenDeep(); + init_flattenDepth(); + init_fromPairs(); + init_head(); + init_indexOf(); + init_initial(); + init_intersection(); + init_intersectionBy(); + init_intersectionWith(); + init_join(); + init_last(); + init_lastIndexOf(); + init_nth(); + init_pull(); + init_pullAll(); + init_pullAllBy(); + init_pullAllWith(); + init_pullAt(); + init_remove(); + init_reverse(); + init_slice(); + init_sortedIndex(); + init_sortedIndexBy(); + init_sortedIndexOf(); + init_sortedLastIndex(); + init_sortedLastIndexBy(); + init_sortedLastIndexOf(); + init_sortedUniq(); + init_sortedUniqBy(); + init_tail(); + init_take(); + init_takeRight(); + init_takeRightWhile(); + init_takeWhile(); + init_union(); + init_unionBy(); + init_unionWith(); + init_uniq(); + init_uniqBy(); + init_uniqWith(); + init_unzip(); + init_unzipWith(); + init_without(); + init_xor(); + init_xorBy(); + init_xorWith(); + init_zip(); + init_zipObject(); + init_zipObjectDeep(); + init_zipWith(); + array_default_default = { + chunk: chunk_default, + compact: compact_default, + concat: concat_default, + difference: difference_default, + differenceBy: differenceBy_default, + differenceWith: differenceWith_default, + drop: drop_default, + dropRight: dropRight_default, + dropRightWhile: dropRightWhile_default, + dropWhile: dropWhile_default, + fill: fill_default, + findIndex: findIndex_default, + findLastIndex: findLastIndex_default, + first: head_default, + flatten: flatten_default, + flattenDeep: flattenDeep_default, + flattenDepth: flattenDepth_default, + fromPairs: fromPairs_default, + head: head_default, + indexOf: indexOf_default, + initial: initial_default, + intersection: intersection_default, + intersectionBy: intersectionBy_default, + intersectionWith: intersectionWith_default, + join: join_default, + last: last_default, + lastIndexOf: lastIndexOf_default, + nth: nth_default, + pull: pull_default, + pullAll: pullAll_default, + pullAllBy: pullAllBy_default, + pullAllWith: pullAllWith_default, + pullAt: pullAt_default, + remove: remove_default, + reverse: reverse_default, + slice: slice_default, + sortedIndex: sortedIndex_default, + sortedIndexBy: sortedIndexBy_default, + sortedIndexOf: sortedIndexOf_default, + sortedLastIndex: sortedLastIndex_default, + sortedLastIndexBy: sortedLastIndexBy_default, + sortedLastIndexOf: sortedLastIndexOf_default, + sortedUniq: sortedUniq_default, + sortedUniqBy: sortedUniqBy_default, + tail: tail_default, + take: take_default, + takeRight: takeRight_default, + takeRightWhile: takeRightWhile_default, + takeWhile: takeWhile_default, + union: union_default, + unionBy: unionBy_default, + unionWith: unionWith_default, + uniq: uniq_default, + uniqBy: uniqBy_default, + uniqWith: uniqWith_default, + unzip: unzip_default, + unzipWith: unzipWith_default, + without: without_default, + xor: xor_default, + xorBy: xorBy_default, + xorWith: xorWith_default, + zip: zip_default, + zipObject: zipObject_default, + zipObjectDeep: zipObjectDeep_default, + zipWith: zipWith_default + }; + } +}); + +// node_modules/lodash-es/array.js +var init_array = __esm({ + "node_modules/lodash-es/array.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_array_default(); + } +}); + +// node_modules/lodash-es/collection.default.js +var collection_default_default; +var init_collection_default = __esm({ + "node_modules/lodash-es/collection.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_countBy(); + init_each(); + init_eachRight(); + init_every(); + init_filter(); + init_find(); + init_findLast(); + init_flatMap(); + init_flatMapDeep(); + init_flatMapDepth(); + init_forEach(); + init_forEachRight(); + init_groupBy(); + init_includes(); + init_invokeMap(); + init_keyBy(); + init_map2(); + init_orderBy(); + init_partition(); + init_reduce(); + init_reduceRight(); + init_reject(); + init_sample(); + init_sampleSize(); + init_shuffle(); + init_size(); + init_some(); + init_sortBy(); + collection_default_default = { + countBy: countBy_default, + each: forEach_default, + eachRight: forEachRight_default, + every: every_default, + filter: filter_default, + find: find_default, + findLast: findLast_default, + flatMap: flatMap_default, + flatMapDeep: flatMapDeep_default, + flatMapDepth: flatMapDepth_default, + forEach: forEach_default, + forEachRight: forEachRight_default, + groupBy: groupBy_default, + includes: includes_default, + invokeMap: invokeMap_default, + keyBy: keyBy_default, + map: map_default, + orderBy: orderBy_default, + partition: partition_default, + reduce: reduce_default, + reduceRight: reduceRight_default, + reject: reject_default, + sample: sample_default, + sampleSize: sampleSize_default, + shuffle: shuffle_default, + size: size_default, + some: some_default, + sortBy: sortBy_default + }; + } +}); + +// node_modules/lodash-es/collection.js +var init_collection2 = __esm({ + "node_modules/lodash-es/collection.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection_default(); + } +}); + +// node_modules/lodash-es/date.default.js +var date_default_default; +var init_date_default = __esm({ + "node_modules/lodash-es/date.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_now(); + date_default_default = { + now: now_default + }; + } +}); + +// node_modules/lodash-es/date.js +var init_date = __esm({ + "node_modules/lodash-es/date.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_date_default(); + } +}); + +// node_modules/lodash-es/function.default.js +var function_default_default; +var init_function_default = __esm({ + "node_modules/lodash-es/function.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_after(); + init_ary(); + init_before(); + init_bind(); + init_bindKey(); + init_curry(); + init_curryRight(); + init_debounce(); + init_defer(); + init_delay(); + init_flip(); + init_memoize(); + init_negate(); + init_once(); + init_overArgs(); + init_partial(); + init_partialRight(); + init_rearg(); + init_rest(); + init_spread(); + init_throttle(); + init_unary(); + init_wrap(); + function_default_default = { + after: after_default, + ary: ary_default, + before: before_default, + bind: bind_default, + bindKey: bindKey_default, + curry: curry_default, + curryRight: curryRight_default, + debounce: debounce_default, + defer: defer_default, + delay: delay_default, + flip: flip_default, + memoize: memoize_default, + negate: negate_default, + once: once_default, + overArgs: overArgs_default, + partial: partial_default, + partialRight: partialRight_default, + rearg: rearg_default, + rest: rest_default, + spread: spread_default, + throttle: throttle_default, + unary: unary_default, + wrap: wrap_default + }; + } +}); + +// node_modules/lodash-es/function.js +var init_function = __esm({ + "node_modules/lodash-es/function.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_function_default(); + } +}); + +// node_modules/lodash-es/lang.default.js +var lang_default_default; +var init_lang_default = __esm({ + "node_modules/lodash-es/lang.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_castArray(); + init_clone(); + init_cloneDeep(); + init_cloneDeepWith(); + init_cloneWith(); + init_conformsTo(); + init_eq(); + init_gt(); + init_gte(); + init_isArguments(); + init_isArray(); + init_isArrayBuffer(); + init_isArrayLike(); + init_isArrayLikeObject(); + init_isBoolean(); + init_isBuffer(); + init_isDate(); + init_isElement(); + init_isEmpty(); + init_isEqual(); + init_isEqualWith(); + init_isError(); + init_isFinite(); + init_isFunction(); + init_isInteger(); + init_isLength(); + init_isMap(); + init_isMatch(); + init_isMatchWith(); + init_isNaN(); + init_isNative(); + init_isNil(); + init_isNull(); + init_isNumber(); + init_isObject(); + init_isObjectLike(); + init_isPlainObject(); + init_isRegExp(); + init_isSafeInteger(); + init_isSet(); + init_isString(); + init_isSymbol(); + init_isTypedArray(); + init_isUndefined(); + init_isWeakMap(); + init_isWeakSet(); + init_lt(); + init_lte(); + init_toArray(); + init_toFinite(); + init_toInteger(); + init_toLength(); + init_toNumber(); + init_toPlainObject(); + init_toSafeInteger(); + init_toString(); + lang_default_default = { + castArray: castArray_default, + clone: clone_default, + cloneDeep: cloneDeep_default, + cloneDeepWith: cloneDeepWith_default, + cloneWith: cloneWith_default, + conformsTo: conformsTo_default, + eq: eq_default, + gt: gt_default, + gte: gte_default, + isArguments: isArguments_default, + isArray: isArray_default, + isArrayBuffer: isArrayBuffer_default, + isArrayLike: isArrayLike_default, + isArrayLikeObject: isArrayLikeObject_default, + isBoolean: isBoolean_default, + isBuffer: isBuffer_default, + isDate: isDate_default, + isElement: isElement_default, + isEmpty: isEmpty_default, + isEqual: isEqual_default, + isEqualWith: isEqualWith_default, + isError: isError_default, + isFinite: isFinite_default, + isFunction: isFunction_default, + isInteger: isInteger_default, + isLength: isLength_default, + isMap: isMap_default, + isMatch: isMatch_default, + isMatchWith: isMatchWith_default, + isNaN: isNaN_default, + isNative: isNative_default, + isNil: isNil_default, + isNull: isNull_default, + isNumber: isNumber_default, + isObject: isObject_default, + isObjectLike: isObjectLike_default, + isPlainObject: isPlainObject_default, + isRegExp: isRegExp_default, + isSafeInteger: isSafeInteger_default, + isSet: isSet_default, + isString: isString_default, + isSymbol: isSymbol_default, + isTypedArray: isTypedArray_default, + isUndefined: isUndefined_default, + isWeakMap: isWeakMap_default, + isWeakSet: isWeakSet_default, + lt: lt_default, + lte: lte_default, + toArray: toArray_default, + toFinite: toFinite_default, + toInteger: toInteger_default, + toLength: toLength_default, + toNumber: toNumber_default, + toPlainObject: toPlainObject_default, + toSafeInteger: toSafeInteger_default, + toString: toString_default + }; + } +}); + +// node_modules/lodash-es/lang.js +var init_lang = __esm({ + "node_modules/lodash-es/lang.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_lang_default(); + } +}); + +// node_modules/lodash-es/math.default.js +var math_default_default; +var init_math_default = __esm({ + "node_modules/lodash-es/math.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_add(); + init_ceil(); + init_divide(); + init_floor(); + init_max(); + init_maxBy(); + init_mean(); + init_meanBy(); + init_min(); + init_minBy(); + init_multiply(); + init_round(); + init_subtract(); + init_sum(); + init_sumBy(); + math_default_default = { + add: add_default, + ceil: ceil_default, + divide: divide_default, + floor: floor_default, + max: max_default, + maxBy: maxBy_default, + mean: mean_default, + meanBy: meanBy_default, + min: min_default, + minBy: minBy_default, + multiply: multiply_default, + round: round_default, + subtract: subtract_default, + sum: sum_default, + sumBy: sumBy_default + }; + } +}); + +// node_modules/lodash-es/math.js +var init_math = __esm({ + "node_modules/lodash-es/math.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_math_default(); + } +}); + +// node_modules/lodash-es/number.default.js +var number_default_default; +var init_number_default = __esm({ + "node_modules/lodash-es/number.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_clamp(); + init_inRange(); + init_random(); + number_default_default = { + clamp: clamp_default, + inRange: inRange_default, + random: random_default + }; + } +}); + +// node_modules/lodash-es/number.js +var init_number = __esm({ + "node_modules/lodash-es/number.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_number_default(); + } +}); + +// node_modules/lodash-es/object.default.js +var object_default_default; +var init_object_default = __esm({ + "node_modules/lodash-es/object.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_assign(); + init_assignIn(); + init_assignInWith(); + init_assignWith(); + init_at(); + init_create(); + init_defaults(); + init_defaultsDeep(); + init_entries(); + init_entriesIn(); + init_extend(); + init_extendWith(); + init_findKey(); + init_findLastKey(); + init_forIn(); + init_forInRight(); + init_forOwn(); + init_forOwnRight(); + init_functions(); + init_functionsIn(); + init_get(); + init_has(); + init_hasIn(); + init_invert(); + init_invertBy(); + init_invoke(); + init_keys(); + init_keysIn(); + init_mapKeys(); + init_mapValues(); + init_merge2(); + init_mergeWith(); + init_omit(); + init_omitBy(); + init_pick(); + init_pickBy(); + init_result(); + init_set2(); + init_setWith(); + init_toPairs(); + init_toPairsIn(); + init_transform(); + init_unset(); + init_update(); + init_updateWith(); + init_values(); + init_valuesIn(); + object_default_default = { + assign: assign_default, + assignIn: assignIn_default, + assignInWith: assignInWith_default, + assignWith: assignWith_default, + at: at_default, + create: create_default, + defaults: defaults_default, + defaultsDeep: defaultsDeep_default, + entries: toPairs_default, + entriesIn: toPairsIn_default, + extend: assignIn_default, + extendWith: assignInWith_default, + findKey: findKey_default, + findLastKey: findLastKey_default, + forIn: forIn_default, + forInRight: forInRight_default, + forOwn: forOwn_default, + forOwnRight: forOwnRight_default, + functions: functions_default, + functionsIn: functionsIn_default, + get: get_default, + has: has_default, + hasIn: hasIn_default, + invert: invert_default, + invertBy: invertBy_default, + invoke: invoke_default, + keys: keys_default, + keysIn: keysIn_default, + mapKeys: mapKeys_default, + mapValues: mapValues_default, + merge: merge_default, + mergeWith: mergeWith_default, + omit: omit_default, + omitBy: omitBy_default, + pick: pick_default, + pickBy: pickBy_default, + result: result_default, + set: set_default, + setWith: setWith_default, + toPairs: toPairs_default, + toPairsIn: toPairsIn_default, + transform: transform_default, + unset: unset_default, + update: update_default, + updateWith: updateWith_default, + values: values_default, + valuesIn: valuesIn_default + }; + } +}); + +// node_modules/lodash-es/object.js +var init_object = __esm({ + "node_modules/lodash-es/object.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_get(); + init_set2(); + init_object_default(); + } +}); + +// node_modules/lodash-es/seq.default.js +var seq_default_default; +var init_seq_default = __esm({ + "node_modules/lodash-es/seq.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_wrapperAt(); + init_chain(); + init_commit(); + init_wrapperLodash(); + init_next(); + init_plant(); + init_wrapperReverse(); + init_tap(); + init_thru(); + init_toIterator(); + init_toJSON(); + init_wrapperValue(); + init_valueOf(); + init_wrapperChain(); + seq_default_default = { + at: wrapperAt_default, + chain: chain_default, + commit: commit_default, + lodash: wrapperLodash_default, + next: next_default, + plant: plant_default, + reverse: wrapperReverse_default, + tap: tap_default, + thru: thru_default, + toIterator: toIterator_default, + toJSON: wrapperValue_default, + value: wrapperValue_default, + valueOf: wrapperValue_default, + wrapperChain: wrapperChain_default + }; + } +}); + +// node_modules/lodash-es/seq.js +var init_seq2 = __esm({ + "node_modules/lodash-es/seq.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_seq_default(); + } +}); + +// node_modules/lodash-es/string.default.js +var string_default_default; +var init_string_default = __esm({ + "node_modules/lodash-es/string.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_camelCase(); + init_capitalize(); + init_deburr(); + init_endsWith(); + init_escape(); + init_escapeRegExp(); + init_kebabCase(); + init_lowerCase(); + init_lowerFirst(); + init_pad(); + init_padEnd(); + init_padStart(); + init_parseInt(); + init_repeat(); + init_replace(); + init_snakeCase(); + init_split(); + init_startCase(); + init_startsWith(); + init_template(); + init_templateSettings(); + init_toLower(); + init_toUpper(); + init_trim(); + init_trimEnd(); + init_trimStart(); + init_truncate(); + init_unescape(); + init_upperCase(); + init_upperFirst(); + init_words(); + string_default_default = { + camelCase: camelCase_default, + capitalize: capitalize_default, + deburr: deburr_default, + endsWith: endsWith_default, + escape: escape_default, + escapeRegExp: escapeRegExp_default, + kebabCase: kebabCase_default, + lowerCase: lowerCase_default, + lowerFirst: lowerFirst_default, + pad: pad_default, + padEnd: padEnd_default, + padStart: padStart_default, + parseInt: parseInt_default, + repeat: repeat_default, + replace: replace_default, + snakeCase: snakeCase_default, + split: split_default, + startCase: startCase_default, + startsWith: startsWith_default, + template: template_default, + templateSettings: templateSettings_default, + toLower: toLower_default, + toUpper: toUpper_default, + trim: trim_default, + trimEnd: trimEnd_default, + trimStart: trimStart_default, + truncate: truncate_default, + unescape: unescape_default, + upperCase: upperCase_default, + upperFirst: upperFirst_default, + words: words_default + }; + } +}); + +// node_modules/lodash-es/string.js +var init_string2 = __esm({ + "node_modules/lodash-es/string.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_string_default(); + } +}); + +// node_modules/lodash-es/util.default.js +var util_default_default; +var init_util_default = __esm({ + "node_modules/lodash-es/util.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_attempt(); + init_bindAll(); + init_cond(); + init_conforms(); + init_constant(); + init_defaultTo(); + init_flow(); + init_flowRight(); + init_identity2(); + init_iteratee(); + init_matches(); + init_matchesProperty(); + init_method(); + init_methodOf(); + init_mixin(); + init_noop(); + init_nthArg(); + init_over(); + init_overEvery(); + init_overSome(); + init_property(); + init_propertyOf(); + init_range(); + init_rangeRight(); + init_stubArray(); + init_stubFalse(); + init_stubObject(); + init_stubString(); + init_stubTrue(); + init_times(); + init_toPath(); + init_uniqueId(); + util_default_default = { + attempt: attempt_default, + bindAll: bindAll_default, + cond: cond_default, + conforms: conforms_default, + constant: constant_default, + defaultTo: defaultTo_default, + flow: flow_default, + flowRight: flowRight_default, + identity: identity_default, + iteratee: iteratee_default, + matches: matches_default, + matchesProperty: matchesProperty_default, + method: method_default, + methodOf: methodOf_default, + mixin: mixin_default, + noop: noop_default, + nthArg: nthArg_default, + over: over_default, + overEvery: overEvery_default, + overSome: overSome_default, + property: property_default, + propertyOf: propertyOf_default, + range: range_default, + rangeRight: rangeRight_default, + stubArray: stubArray_default, + stubFalse: stubFalse_default, + stubObject: stubObject_default, + stubString: stubString_default, + stubTrue: stubTrue_default, + times: times_default, + toPath: toPath_default, + uniqueId: uniqueId_default + }; + } +}); + +// node_modules/lodash-es/util.js +var init_util = __esm({ + "node_modules/lodash-es/util.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_util_default(); + } +}); + +// node_modules/lodash-es/_lazyClone.js +function lazyClone() { + var result2 = new LazyWrapper_default(this.__wrapped__); + result2.__actions__ = copyArray_default(this.__actions__); + result2.__dir__ = this.__dir__; + result2.__filtered__ = this.__filtered__; + result2.__iteratees__ = copyArray_default(this.__iteratees__); + result2.__takeCount__ = this.__takeCount__; + result2.__views__ = copyArray_default(this.__views__); + return result2; +} +var lazyClone_default; +var init_lazyClone = __esm({ + "node_modules/lodash-es/_lazyClone.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + init_copyArray(); + lazyClone_default = lazyClone; + } +}); + +// node_modules/lodash-es/_lazyReverse.js +function lazyReverse() { + if (this.__filtered__) { + var result2 = new LazyWrapper_default(this); + result2.__dir__ = -1; + result2.__filtered__ = true; + } else { + result2 = this.clone(); + result2.__dir__ *= -1; + } + return result2; +} +var lazyReverse_default; +var init_lazyReverse = __esm({ + "node_modules/lodash-es/_lazyReverse.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_LazyWrapper(); + lazyReverse_default = lazyReverse; + } +}); + +// node_modules/lodash-es/_getView.js +function getView(start, end, transforms) { + var index4 = -1, length = transforms.length; + while (++index4 < length) { + var data = transforms[index4], size2 = data.size; + switch (data.type) { + case "drop": + start += size2; + break; + case "dropRight": + end -= size2; + break; + case "take": + end = nativeMin13(end, start + size2); + break; + case "takeRight": + start = nativeMax16(start, end - size2); + break; + } + } + return { "start": start, "end": end }; +} +var nativeMax16, nativeMin13, getView_default; +var init_getView = __esm({ + "node_modules/lodash-es/_getView.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + nativeMax16 = Math.max; + nativeMin13 = Math.min; + getView_default = getView; + } +}); + +// node_modules/lodash-es/_lazyValue.js +function lazyValue() { + var array = this.__wrapped__.value(), dir2 = this.__dir__, isArr = isArray_default(array), isRight = dir2 < 0, arrLength = isArr ? array.length : 0, view = getView_default(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index4 = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin14(length, this.__takeCount__); + if (!isArr || !isRight && arrLength == length && takeCount == length) { + return baseWrapperValue_default(array, this.__actions__); + } + var result2 = []; + outer: + while (length-- && resIndex < takeCount) { + index4 += dir2; + var iterIndex = -1, value2 = array[index4]; + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], iteratee2 = data.iteratee, type3 = data.type, computed = iteratee2(value2); + if (type3 == LAZY_MAP_FLAG) { + value2 = computed; + } else if (!computed) { + if (type3 == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result2[resIndex++] = value2; + } + return result2; +} +var LAZY_FILTER_FLAG, LAZY_MAP_FLAG, nativeMin14, lazyValue_default; +var init_lazyValue = __esm({ + "node_modules/lodash-es/_lazyValue.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_baseWrapperValue(); + init_getView(); + init_isArray(); + LAZY_FILTER_FLAG = 1; + LAZY_MAP_FLAG = 2; + nativeMin14 = Math.min; + lazyValue_default = lazyValue; + } +}); + +// node_modules/lodash-es/lodash.default.js +var VERSION, WRAP_BIND_KEY_FLAG7, LAZY_FILTER_FLAG2, LAZY_WHILE_FLAG, MAX_ARRAY_LENGTH7, arrayProto6, objectProto30, hasOwnProperty26, symIterator2, nativeMax17, nativeMin15, mixin2, lodash_default_default; +var init_lodash_default = __esm({ + "node_modules/lodash-es/lodash.default.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_array(); + init_collection2(); + init_date(); + init_function(); + init_lang(); + init_math(); + init_number(); + init_object(); + init_seq2(); + init_string2(); + init_util(); + init_LazyWrapper(); + init_LodashWrapper(); + init_Symbol(); + init_arrayEach(); + init_arrayPush(); + init_baseForOwn(); + init_baseFunctions(); + init_baseInvoke(); + init_baseIteratee(); + init_baseRest(); + init_createHybrid(); + init_identity2(); + init_isArray(); + init_isObject(); + init_keys(); + init_last(); + init_lazyClone(); + init_lazyReverse(); + init_lazyValue(); + init_mixin(); + init_negate(); + init_realNames(); + init_thru(); + init_toInteger(); + init_wrapperLodash(); + VERSION = "4.18.1"; + WRAP_BIND_KEY_FLAG7 = 2; + LAZY_FILTER_FLAG2 = 1; + LAZY_WHILE_FLAG = 3; + MAX_ARRAY_LENGTH7 = 4294967295; + arrayProto6 = Array.prototype; + objectProto30 = Object.prototype; + hasOwnProperty26 = objectProto30.hasOwnProperty; + symIterator2 = Symbol_default ? Symbol_default.iterator : void 0; + nativeMax17 = Math.max; + nativeMin15 = Math.min; + mixin2 = /* @__PURE__ */ function(func) { + return function(object, source, options) { + if (options == null) { + var isObj = isObject_default(source), props = isObj && keys_default(source), methodNames = props && props.length && baseFunctions_default(source, props); + if (!(methodNames ? methodNames.length : isObj)) { + options = source; + source = object; + object = this; + } + } + return func(object, source, options); + }; + }(mixin_default); + wrapperLodash_default.after = function_default_default.after; + wrapperLodash_default.ary = function_default_default.ary; + wrapperLodash_default.assign = object_default_default.assign; + wrapperLodash_default.assignIn = object_default_default.assignIn; + wrapperLodash_default.assignInWith = object_default_default.assignInWith; + wrapperLodash_default.assignWith = object_default_default.assignWith; + wrapperLodash_default.at = object_default_default.at; + wrapperLodash_default.before = function_default_default.before; + wrapperLodash_default.bind = function_default_default.bind; + wrapperLodash_default.bindAll = util_default_default.bindAll; + wrapperLodash_default.bindKey = function_default_default.bindKey; + wrapperLodash_default.castArray = lang_default_default.castArray; + wrapperLodash_default.chain = seq_default_default.chain; + wrapperLodash_default.chunk = array_default_default.chunk; + wrapperLodash_default.compact = array_default_default.compact; + wrapperLodash_default.concat = array_default_default.concat; + wrapperLodash_default.cond = util_default_default.cond; + wrapperLodash_default.conforms = util_default_default.conforms; + wrapperLodash_default.constant = util_default_default.constant; + wrapperLodash_default.countBy = collection_default_default.countBy; + wrapperLodash_default.create = object_default_default.create; + wrapperLodash_default.curry = function_default_default.curry; + wrapperLodash_default.curryRight = function_default_default.curryRight; + wrapperLodash_default.debounce = function_default_default.debounce; + wrapperLodash_default.defaults = object_default_default.defaults; + wrapperLodash_default.defaultsDeep = object_default_default.defaultsDeep; + wrapperLodash_default.defer = function_default_default.defer; + wrapperLodash_default.delay = function_default_default.delay; + wrapperLodash_default.difference = array_default_default.difference; + wrapperLodash_default.differenceBy = array_default_default.differenceBy; + wrapperLodash_default.differenceWith = array_default_default.differenceWith; + wrapperLodash_default.drop = array_default_default.drop; + wrapperLodash_default.dropRight = array_default_default.dropRight; + wrapperLodash_default.dropRightWhile = array_default_default.dropRightWhile; + wrapperLodash_default.dropWhile = array_default_default.dropWhile; + wrapperLodash_default.fill = array_default_default.fill; + wrapperLodash_default.filter = collection_default_default.filter; + wrapperLodash_default.flatMap = collection_default_default.flatMap; + wrapperLodash_default.flatMapDeep = collection_default_default.flatMapDeep; + wrapperLodash_default.flatMapDepth = collection_default_default.flatMapDepth; + wrapperLodash_default.flatten = array_default_default.flatten; + wrapperLodash_default.flattenDeep = array_default_default.flattenDeep; + wrapperLodash_default.flattenDepth = array_default_default.flattenDepth; + wrapperLodash_default.flip = function_default_default.flip; + wrapperLodash_default.flow = util_default_default.flow; + wrapperLodash_default.flowRight = util_default_default.flowRight; + wrapperLodash_default.fromPairs = array_default_default.fromPairs; + wrapperLodash_default.functions = object_default_default.functions; + wrapperLodash_default.functionsIn = object_default_default.functionsIn; + wrapperLodash_default.groupBy = collection_default_default.groupBy; + wrapperLodash_default.initial = array_default_default.initial; + wrapperLodash_default.intersection = array_default_default.intersection; + wrapperLodash_default.intersectionBy = array_default_default.intersectionBy; + wrapperLodash_default.intersectionWith = array_default_default.intersectionWith; + wrapperLodash_default.invert = object_default_default.invert; + wrapperLodash_default.invertBy = object_default_default.invertBy; + wrapperLodash_default.invokeMap = collection_default_default.invokeMap; + wrapperLodash_default.iteratee = util_default_default.iteratee; + wrapperLodash_default.keyBy = collection_default_default.keyBy; + wrapperLodash_default.keys = keys_default; + wrapperLodash_default.keysIn = object_default_default.keysIn; + wrapperLodash_default.map = collection_default_default.map; + wrapperLodash_default.mapKeys = object_default_default.mapKeys; + wrapperLodash_default.mapValues = object_default_default.mapValues; + wrapperLodash_default.matches = util_default_default.matches; + wrapperLodash_default.matchesProperty = util_default_default.matchesProperty; + wrapperLodash_default.memoize = function_default_default.memoize; + wrapperLodash_default.merge = object_default_default.merge; + wrapperLodash_default.mergeWith = object_default_default.mergeWith; + wrapperLodash_default.method = util_default_default.method; + wrapperLodash_default.methodOf = util_default_default.methodOf; + wrapperLodash_default.mixin = mixin2; + wrapperLodash_default.negate = negate_default; + wrapperLodash_default.nthArg = util_default_default.nthArg; + wrapperLodash_default.omit = object_default_default.omit; + wrapperLodash_default.omitBy = object_default_default.omitBy; + wrapperLodash_default.once = function_default_default.once; + wrapperLodash_default.orderBy = collection_default_default.orderBy; + wrapperLodash_default.over = util_default_default.over; + wrapperLodash_default.overArgs = function_default_default.overArgs; + wrapperLodash_default.overEvery = util_default_default.overEvery; + wrapperLodash_default.overSome = util_default_default.overSome; + wrapperLodash_default.partial = function_default_default.partial; + wrapperLodash_default.partialRight = function_default_default.partialRight; + wrapperLodash_default.partition = collection_default_default.partition; + wrapperLodash_default.pick = object_default_default.pick; + wrapperLodash_default.pickBy = object_default_default.pickBy; + wrapperLodash_default.property = util_default_default.property; + wrapperLodash_default.propertyOf = util_default_default.propertyOf; + wrapperLodash_default.pull = array_default_default.pull; + wrapperLodash_default.pullAll = array_default_default.pullAll; + wrapperLodash_default.pullAllBy = array_default_default.pullAllBy; + wrapperLodash_default.pullAllWith = array_default_default.pullAllWith; + wrapperLodash_default.pullAt = array_default_default.pullAt; + wrapperLodash_default.range = util_default_default.range; + wrapperLodash_default.rangeRight = util_default_default.rangeRight; + wrapperLodash_default.rearg = function_default_default.rearg; + wrapperLodash_default.reject = collection_default_default.reject; + wrapperLodash_default.remove = array_default_default.remove; + wrapperLodash_default.rest = function_default_default.rest; + wrapperLodash_default.reverse = array_default_default.reverse; + wrapperLodash_default.sampleSize = collection_default_default.sampleSize; + wrapperLodash_default.set = object_default_default.set; + wrapperLodash_default.setWith = object_default_default.setWith; + wrapperLodash_default.shuffle = collection_default_default.shuffle; + wrapperLodash_default.slice = array_default_default.slice; + wrapperLodash_default.sortBy = collection_default_default.sortBy; + wrapperLodash_default.sortedUniq = array_default_default.sortedUniq; + wrapperLodash_default.sortedUniqBy = array_default_default.sortedUniqBy; + wrapperLodash_default.split = string_default_default.split; + wrapperLodash_default.spread = function_default_default.spread; + wrapperLodash_default.tail = array_default_default.tail; + wrapperLodash_default.take = array_default_default.take; + wrapperLodash_default.takeRight = array_default_default.takeRight; + wrapperLodash_default.takeRightWhile = array_default_default.takeRightWhile; + wrapperLodash_default.takeWhile = array_default_default.takeWhile; + wrapperLodash_default.tap = seq_default_default.tap; + wrapperLodash_default.throttle = function_default_default.throttle; + wrapperLodash_default.thru = thru_default; + wrapperLodash_default.toArray = lang_default_default.toArray; + wrapperLodash_default.toPairs = object_default_default.toPairs; + wrapperLodash_default.toPairsIn = object_default_default.toPairsIn; + wrapperLodash_default.toPath = util_default_default.toPath; + wrapperLodash_default.toPlainObject = lang_default_default.toPlainObject; + wrapperLodash_default.transform = object_default_default.transform; + wrapperLodash_default.unary = function_default_default.unary; + wrapperLodash_default.union = array_default_default.union; + wrapperLodash_default.unionBy = array_default_default.unionBy; + wrapperLodash_default.unionWith = array_default_default.unionWith; + wrapperLodash_default.uniq = array_default_default.uniq; + wrapperLodash_default.uniqBy = array_default_default.uniqBy; + wrapperLodash_default.uniqWith = array_default_default.uniqWith; + wrapperLodash_default.unset = object_default_default.unset; + wrapperLodash_default.unzip = array_default_default.unzip; + wrapperLodash_default.unzipWith = array_default_default.unzipWith; + wrapperLodash_default.update = object_default_default.update; + wrapperLodash_default.updateWith = object_default_default.updateWith; + wrapperLodash_default.values = object_default_default.values; + wrapperLodash_default.valuesIn = object_default_default.valuesIn; + wrapperLodash_default.without = array_default_default.without; + wrapperLodash_default.words = string_default_default.words; + wrapperLodash_default.wrap = function_default_default.wrap; + wrapperLodash_default.xor = array_default_default.xor; + wrapperLodash_default.xorBy = array_default_default.xorBy; + wrapperLodash_default.xorWith = array_default_default.xorWith; + wrapperLodash_default.zip = array_default_default.zip; + wrapperLodash_default.zipObject = array_default_default.zipObject; + wrapperLodash_default.zipObjectDeep = array_default_default.zipObjectDeep; + wrapperLodash_default.zipWith = array_default_default.zipWith; + wrapperLodash_default.entries = object_default_default.toPairs; + wrapperLodash_default.entriesIn = object_default_default.toPairsIn; + wrapperLodash_default.extend = object_default_default.assignIn; + wrapperLodash_default.extendWith = object_default_default.assignInWith; + mixin2(wrapperLodash_default, wrapperLodash_default); + wrapperLodash_default.add = math_default_default.add; + wrapperLodash_default.attempt = util_default_default.attempt; + wrapperLodash_default.camelCase = string_default_default.camelCase; + wrapperLodash_default.capitalize = string_default_default.capitalize; + wrapperLodash_default.ceil = math_default_default.ceil; + wrapperLodash_default.clamp = number_default_default.clamp; + wrapperLodash_default.clone = lang_default_default.clone; + wrapperLodash_default.cloneDeep = lang_default_default.cloneDeep; + wrapperLodash_default.cloneDeepWith = lang_default_default.cloneDeepWith; + wrapperLodash_default.cloneWith = lang_default_default.cloneWith; + wrapperLodash_default.conformsTo = lang_default_default.conformsTo; + wrapperLodash_default.deburr = string_default_default.deburr; + wrapperLodash_default.defaultTo = util_default_default.defaultTo; + wrapperLodash_default.divide = math_default_default.divide; + wrapperLodash_default.endsWith = string_default_default.endsWith; + wrapperLodash_default.eq = lang_default_default.eq; + wrapperLodash_default.escape = string_default_default.escape; + wrapperLodash_default.escapeRegExp = string_default_default.escapeRegExp; + wrapperLodash_default.every = collection_default_default.every; + wrapperLodash_default.find = collection_default_default.find; + wrapperLodash_default.findIndex = array_default_default.findIndex; + wrapperLodash_default.findKey = object_default_default.findKey; + wrapperLodash_default.findLast = collection_default_default.findLast; + wrapperLodash_default.findLastIndex = array_default_default.findLastIndex; + wrapperLodash_default.findLastKey = object_default_default.findLastKey; + wrapperLodash_default.floor = math_default_default.floor; + wrapperLodash_default.forEach = collection_default_default.forEach; + wrapperLodash_default.forEachRight = collection_default_default.forEachRight; + wrapperLodash_default.forIn = object_default_default.forIn; + wrapperLodash_default.forInRight = object_default_default.forInRight; + wrapperLodash_default.forOwn = object_default_default.forOwn; + wrapperLodash_default.forOwnRight = object_default_default.forOwnRight; + wrapperLodash_default.get = object_default_default.get; + wrapperLodash_default.gt = lang_default_default.gt; + wrapperLodash_default.gte = lang_default_default.gte; + wrapperLodash_default.has = object_default_default.has; + wrapperLodash_default.hasIn = object_default_default.hasIn; + wrapperLodash_default.head = array_default_default.head; + wrapperLodash_default.identity = identity_default; + wrapperLodash_default.includes = collection_default_default.includes; + wrapperLodash_default.indexOf = array_default_default.indexOf; + wrapperLodash_default.inRange = number_default_default.inRange; + wrapperLodash_default.invoke = object_default_default.invoke; + wrapperLodash_default.isArguments = lang_default_default.isArguments; + wrapperLodash_default.isArray = isArray_default; + wrapperLodash_default.isArrayBuffer = lang_default_default.isArrayBuffer; + wrapperLodash_default.isArrayLike = lang_default_default.isArrayLike; + wrapperLodash_default.isArrayLikeObject = lang_default_default.isArrayLikeObject; + wrapperLodash_default.isBoolean = lang_default_default.isBoolean; + wrapperLodash_default.isBuffer = lang_default_default.isBuffer; + wrapperLodash_default.isDate = lang_default_default.isDate; + wrapperLodash_default.isElement = lang_default_default.isElement; + wrapperLodash_default.isEmpty = lang_default_default.isEmpty; + wrapperLodash_default.isEqual = lang_default_default.isEqual; + wrapperLodash_default.isEqualWith = lang_default_default.isEqualWith; + wrapperLodash_default.isError = lang_default_default.isError; + wrapperLodash_default.isFinite = lang_default_default.isFinite; + wrapperLodash_default.isFunction = lang_default_default.isFunction; + wrapperLodash_default.isInteger = lang_default_default.isInteger; + wrapperLodash_default.isLength = lang_default_default.isLength; + wrapperLodash_default.isMap = lang_default_default.isMap; + wrapperLodash_default.isMatch = lang_default_default.isMatch; + wrapperLodash_default.isMatchWith = lang_default_default.isMatchWith; + wrapperLodash_default.isNaN = lang_default_default.isNaN; + wrapperLodash_default.isNative = lang_default_default.isNative; + wrapperLodash_default.isNil = lang_default_default.isNil; + wrapperLodash_default.isNull = lang_default_default.isNull; + wrapperLodash_default.isNumber = lang_default_default.isNumber; + wrapperLodash_default.isObject = isObject_default; + wrapperLodash_default.isObjectLike = lang_default_default.isObjectLike; + wrapperLodash_default.isPlainObject = lang_default_default.isPlainObject; + wrapperLodash_default.isRegExp = lang_default_default.isRegExp; + wrapperLodash_default.isSafeInteger = lang_default_default.isSafeInteger; + wrapperLodash_default.isSet = lang_default_default.isSet; + wrapperLodash_default.isString = lang_default_default.isString; + wrapperLodash_default.isSymbol = lang_default_default.isSymbol; + wrapperLodash_default.isTypedArray = lang_default_default.isTypedArray; + wrapperLodash_default.isUndefined = lang_default_default.isUndefined; + wrapperLodash_default.isWeakMap = lang_default_default.isWeakMap; + wrapperLodash_default.isWeakSet = lang_default_default.isWeakSet; + wrapperLodash_default.join = array_default_default.join; + wrapperLodash_default.kebabCase = string_default_default.kebabCase; + wrapperLodash_default.last = last_default; + wrapperLodash_default.lastIndexOf = array_default_default.lastIndexOf; + wrapperLodash_default.lowerCase = string_default_default.lowerCase; + wrapperLodash_default.lowerFirst = string_default_default.lowerFirst; + wrapperLodash_default.lt = lang_default_default.lt; + wrapperLodash_default.lte = lang_default_default.lte; + wrapperLodash_default.max = math_default_default.max; + wrapperLodash_default.maxBy = math_default_default.maxBy; + wrapperLodash_default.mean = math_default_default.mean; + wrapperLodash_default.meanBy = math_default_default.meanBy; + wrapperLodash_default.min = math_default_default.min; + wrapperLodash_default.minBy = math_default_default.minBy; + wrapperLodash_default.stubArray = util_default_default.stubArray; + wrapperLodash_default.stubFalse = util_default_default.stubFalse; + wrapperLodash_default.stubObject = util_default_default.stubObject; + wrapperLodash_default.stubString = util_default_default.stubString; + wrapperLodash_default.stubTrue = util_default_default.stubTrue; + wrapperLodash_default.multiply = math_default_default.multiply; + wrapperLodash_default.nth = array_default_default.nth; + wrapperLodash_default.noop = util_default_default.noop; + wrapperLodash_default.now = date_default_default.now; + wrapperLodash_default.pad = string_default_default.pad; + wrapperLodash_default.padEnd = string_default_default.padEnd; + wrapperLodash_default.padStart = string_default_default.padStart; + wrapperLodash_default.parseInt = string_default_default.parseInt; + wrapperLodash_default.random = number_default_default.random; + wrapperLodash_default.reduce = collection_default_default.reduce; + wrapperLodash_default.reduceRight = collection_default_default.reduceRight; + wrapperLodash_default.repeat = string_default_default.repeat; + wrapperLodash_default.replace = string_default_default.replace; + wrapperLodash_default.result = object_default_default.result; + wrapperLodash_default.round = math_default_default.round; + wrapperLodash_default.sample = collection_default_default.sample; + wrapperLodash_default.size = collection_default_default.size; + wrapperLodash_default.snakeCase = string_default_default.snakeCase; + wrapperLodash_default.some = collection_default_default.some; + wrapperLodash_default.sortedIndex = array_default_default.sortedIndex; + wrapperLodash_default.sortedIndexBy = array_default_default.sortedIndexBy; + wrapperLodash_default.sortedIndexOf = array_default_default.sortedIndexOf; + wrapperLodash_default.sortedLastIndex = array_default_default.sortedLastIndex; + wrapperLodash_default.sortedLastIndexBy = array_default_default.sortedLastIndexBy; + wrapperLodash_default.sortedLastIndexOf = array_default_default.sortedLastIndexOf; + wrapperLodash_default.startCase = string_default_default.startCase; + wrapperLodash_default.startsWith = string_default_default.startsWith; + wrapperLodash_default.subtract = math_default_default.subtract; + wrapperLodash_default.sum = math_default_default.sum; + wrapperLodash_default.sumBy = math_default_default.sumBy; + wrapperLodash_default.template = string_default_default.template; + wrapperLodash_default.times = util_default_default.times; + wrapperLodash_default.toFinite = lang_default_default.toFinite; + wrapperLodash_default.toInteger = toInteger_default; + wrapperLodash_default.toLength = lang_default_default.toLength; + wrapperLodash_default.toLower = string_default_default.toLower; + wrapperLodash_default.toNumber = lang_default_default.toNumber; + wrapperLodash_default.toSafeInteger = lang_default_default.toSafeInteger; + wrapperLodash_default.toString = lang_default_default.toString; + wrapperLodash_default.toUpper = string_default_default.toUpper; + wrapperLodash_default.trim = string_default_default.trim; + wrapperLodash_default.trimEnd = string_default_default.trimEnd; + wrapperLodash_default.trimStart = string_default_default.trimStart; + wrapperLodash_default.truncate = string_default_default.truncate; + wrapperLodash_default.unescape = string_default_default.unescape; + wrapperLodash_default.uniqueId = util_default_default.uniqueId; + wrapperLodash_default.upperCase = string_default_default.upperCase; + wrapperLodash_default.upperFirst = string_default_default.upperFirst; + wrapperLodash_default.each = collection_default_default.forEach; + wrapperLodash_default.eachRight = collection_default_default.forEachRight; + wrapperLodash_default.first = array_default_default.head; + mixin2(wrapperLodash_default, function() { + var source = {}; + baseForOwn_default(wrapperLodash_default, function(func, methodName) { + if (!hasOwnProperty26.call(wrapperLodash_default.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }(), { "chain": false }); + wrapperLodash_default.VERSION = VERSION; + (wrapperLodash_default.templateSettings = string_default_default.templateSettings).imports._ = wrapperLodash_default; + arrayEach_default(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { + wrapperLodash_default[methodName].placeholder = wrapperLodash_default; + }); + arrayEach_default(["drop", "take"], function(methodName, index4) { + LazyWrapper_default.prototype[methodName] = function(n7) { + n7 = n7 === void 0 ? 1 : nativeMax17(toInteger_default(n7), 0); + var result2 = this.__filtered__ && !index4 ? new LazyWrapper_default(this) : this.clone(); + if (result2.__filtered__) { + result2.__takeCount__ = nativeMin15(n7, result2.__takeCount__); + } else { + result2.__views__.push({ + "size": nativeMin15(n7, MAX_ARRAY_LENGTH7), + "type": methodName + (result2.__dir__ < 0 ? "Right" : "") + }); + } + return result2; + }; + LazyWrapper_default.prototype[methodName + "Right"] = function(n7) { + return this.reverse()[methodName](n7).reverse(); + }; + }); + arrayEach_default(["filter", "map", "takeWhile"], function(methodName, index4) { + var type3 = index4 + 1, isFilter = type3 == LAZY_FILTER_FLAG2 || type3 == LAZY_WHILE_FLAG; + LazyWrapper_default.prototype[methodName] = function(iteratee2) { + var result2 = this.clone(); + result2.__iteratees__.push({ + "iteratee": baseIteratee_default(iteratee2, 3), + "type": type3 + }); + result2.__filtered__ = result2.__filtered__ || isFilter; + return result2; + }; + }); + arrayEach_default(["head", "last"], function(methodName, index4) { + var takeName = "take" + (index4 ? "Right" : ""); + LazyWrapper_default.prototype[methodName] = function() { + return this[takeName](1).value()[0]; + }; + }); + arrayEach_default(["initial", "tail"], function(methodName, index4) { + var dropName = "drop" + (index4 ? "" : "Right"); + LazyWrapper_default.prototype[methodName] = function() { + return this.__filtered__ ? new LazyWrapper_default(this) : this[dropName](1); + }; + }); + LazyWrapper_default.prototype.compact = function() { + return this.filter(identity_default); + }; + LazyWrapper_default.prototype.find = function(predicate) { + return this.filter(predicate).head(); + }; + LazyWrapper_default.prototype.findLast = function(predicate) { + return this.reverse().find(predicate); + }; + LazyWrapper_default.prototype.invokeMap = baseRest_default(function(path2, args) { + if (typeof path2 == "function") { + return new LazyWrapper_default(this); + } + return this.map(function(value2) { + return baseInvoke_default(value2, path2, args); + }); + }); + LazyWrapper_default.prototype.reject = function(predicate) { + return this.filter(negate_default(baseIteratee_default(predicate))); + }; + LazyWrapper_default.prototype.slice = function(start, end) { + start = toInteger_default(start); + var result2 = this; + if (result2.__filtered__ && (start > 0 || end < 0)) { + return new LazyWrapper_default(result2); + } + if (start < 0) { + result2 = result2.takeRight(-start); + } else if (start) { + result2 = result2.drop(start); + } + if (end !== void 0) { + end = toInteger_default(end); + result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start); + } + return result2; + }; + LazyWrapper_default.prototype.takeRightWhile = function(predicate) { + return this.reverse().takeWhile(predicate).reverse(); + }; + LazyWrapper_default.prototype.toArray = function() { + return this.take(MAX_ARRAY_LENGTH7); + }; + baseForOwn_default(LazyWrapper_default.prototype, function(func, methodName) { + var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = wrapperLodash_default[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); + if (!lodashFunc) { + return; + } + wrapperLodash_default.prototype[methodName] = function() { + var value2 = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value2 instanceof LazyWrapper_default, iteratee2 = args[0], useLazy = isLazy || isArray_default(value2); + var interceptor = function(value3) { + var result3 = lodashFunc.apply(wrapperLodash_default, arrayPush_default([value3], args)); + return isTaker && chainAll ? result3[0] : result3; + }; + if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { + isLazy = useLazy = false; + } + var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; + if (!retUnwrapped && useLazy) { + value2 = onlyLazy ? value2 : new LazyWrapper_default(this); + var result2 = func.apply(value2, args); + result2.__actions__.push({ "func": thru_default, "args": [interceptor], "thisArg": void 0 }); + return new LodashWrapper_default(result2, chainAll); + } + if (isUnwrapped && onlyLazy) { + return func.apply(this, args); + } + result2 = this.thru(interceptor); + return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; + }; + }); + arrayEach_default(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { + var func = arrayProto6[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); + wrapperLodash_default.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value2 = this.value(); + return func.apply(isArray_default(value2) ? value2 : [], args); + } + return this[chainName](function(value3) { + return func.apply(isArray_default(value3) ? value3 : [], args); + }); + }; + }); + baseForOwn_default(LazyWrapper_default.prototype, function(func, methodName) { + var lodashFunc = wrapperLodash_default[methodName]; + if (lodashFunc) { + var key = lodashFunc.name + ""; + if (!hasOwnProperty26.call(realNames_default, key)) { + realNames_default[key] = []; + } + realNames_default[key].push({ "name": methodName, "func": lodashFunc }); + } + }); + realNames_default[createHybrid_default(void 0, WRAP_BIND_KEY_FLAG7).name] = [{ + "name": "wrapper", + "func": void 0 + }]; + LazyWrapper_default.prototype.clone = lazyClone_default; + LazyWrapper_default.prototype.reverse = lazyReverse_default; + LazyWrapper_default.prototype.value = lazyValue_default; + wrapperLodash_default.prototype.at = seq_default_default.at; + wrapperLodash_default.prototype.chain = seq_default_default.wrapperChain; + wrapperLodash_default.prototype.commit = seq_default_default.commit; + wrapperLodash_default.prototype.next = seq_default_default.next; + wrapperLodash_default.prototype.plant = seq_default_default.plant; + wrapperLodash_default.prototype.reverse = seq_default_default.reverse; + wrapperLodash_default.prototype.toJSON = wrapperLodash_default.prototype.valueOf = wrapperLodash_default.prototype.value = seq_default_default.value; + wrapperLodash_default.prototype.first = wrapperLodash_default.prototype.head; + if (symIterator2) { + wrapperLodash_default.prototype[symIterator2] = seq_default_default.toIterator; + } + lodash_default_default = wrapperLodash_default; + } +}); + +// node_modules/lodash-es/lodash.js +var lodash_exports = {}; +__export(lodash_exports, { + add: () => add_default, + after: () => after_default, + ary: () => ary_default, + assign: () => assign_default, + assignIn: () => assignIn_default, + assignInWith: () => assignInWith_default, + assignWith: () => assignWith_default, + at: () => at_default, + attempt: () => attempt_default, + before: () => before_default, + bind: () => bind_default, + bindAll: () => bindAll_default, + bindKey: () => bindKey_default, + camelCase: () => camelCase_default, + capitalize: () => capitalize_default, + castArray: () => castArray_default, + ceil: () => ceil_default, + chain: () => chain_default, + chunk: () => chunk_default, + clamp: () => clamp_default, + clone: () => clone_default, + cloneDeep: () => cloneDeep_default, + cloneDeepWith: () => cloneDeepWith_default, + cloneWith: () => cloneWith_default, + commit: () => commit_default, + compact: () => compact_default, + concat: () => concat_default, + cond: () => cond_default, + conforms: () => conforms_default, + conformsTo: () => conformsTo_default, + constant: () => constant_default, + countBy: () => countBy_default, + create: () => create_default, + curry: () => curry_default, + curryRight: () => curryRight_default, + debounce: () => debounce_default, + deburr: () => deburr_default, + default: () => lodash_default_default, + defaultTo: () => defaultTo_default, + defaults: () => defaults_default, + defaultsDeep: () => defaultsDeep_default, + defer: () => defer_default, + delay: () => delay_default, + difference: () => difference_default, + differenceBy: () => differenceBy_default, + differenceWith: () => differenceWith_default, + divide: () => divide_default, + drop: () => drop_default, + dropRight: () => dropRight_default, + dropRightWhile: () => dropRightWhile_default, + dropWhile: () => dropWhile_default, + each: () => forEach_default, + eachRight: () => forEachRight_default, + endsWith: () => endsWith_default, + entries: () => toPairs_default, + entriesIn: () => toPairsIn_default, + eq: () => eq_default, + escape: () => escape_default, + escapeRegExp: () => escapeRegExp_default, + every: () => every_default, + extend: () => assignIn_default, + extendWith: () => assignInWith_default, + fill: () => fill_default, + filter: () => filter_default, + find: () => find_default, + findIndex: () => findIndex_default, + findKey: () => findKey_default, + findLast: () => findLast_default, + findLastIndex: () => findLastIndex_default, + findLastKey: () => findLastKey_default, + first: () => head_default, + flatMap: () => flatMap_default, + flatMapDeep: () => flatMapDeep_default, + flatMapDepth: () => flatMapDepth_default, + flatten: () => flatten_default, + flattenDeep: () => flattenDeep_default, + flattenDepth: () => flattenDepth_default, + flip: () => flip_default, + floor: () => floor_default, + flow: () => flow_default, + flowRight: () => flowRight_default, + forEach: () => forEach_default, + forEachRight: () => forEachRight_default, + forIn: () => forIn_default, + forInRight: () => forInRight_default, + forOwn: () => forOwn_default, + forOwnRight: () => forOwnRight_default, + fromPairs: () => fromPairs_default, + functions: () => functions_default, + functionsIn: () => functionsIn_default, + get: () => get_default, + groupBy: () => groupBy_default, + gt: () => gt_default, + gte: () => gte_default, + has: () => has_default, + hasIn: () => hasIn_default, + head: () => head_default, + identity: () => identity_default, + inRange: () => inRange_default, + includes: () => includes_default, + indexOf: () => indexOf_default, + initial: () => initial_default, + intersection: () => intersection_default, + intersectionBy: () => intersectionBy_default, + intersectionWith: () => intersectionWith_default, + invert: () => invert_default, + invertBy: () => invertBy_default, + invoke: () => invoke_default, + invokeMap: () => invokeMap_default, + isArguments: () => isArguments_default, + isArray: () => isArray_default, + isArrayBuffer: () => isArrayBuffer_default, + isArrayLike: () => isArrayLike_default, + isArrayLikeObject: () => isArrayLikeObject_default, + isBoolean: () => isBoolean_default, + isBuffer: () => isBuffer_default, + isDate: () => isDate_default, + isElement: () => isElement_default, + isEmpty: () => isEmpty_default, + isEqual: () => isEqual_default, + isEqualWith: () => isEqualWith_default, + isError: () => isError_default, + isFinite: () => isFinite_default, + isFunction: () => isFunction_default, + isInteger: () => isInteger_default, + isLength: () => isLength_default, + isMap: () => isMap_default, + isMatch: () => isMatch_default, + isMatchWith: () => isMatchWith_default, + isNaN: () => isNaN_default, + isNative: () => isNative_default, + isNil: () => isNil_default, + isNull: () => isNull_default, + isNumber: () => isNumber_default, + isObject: () => isObject_default, + isObjectLike: () => isObjectLike_default, + isPlainObject: () => isPlainObject_default, + isRegExp: () => isRegExp_default, + isSafeInteger: () => isSafeInteger_default, + isSet: () => isSet_default, + isString: () => isString_default, + isSymbol: () => isSymbol_default, + isTypedArray: () => isTypedArray_default, + isUndefined: () => isUndefined_default, + isWeakMap: () => isWeakMap_default, + isWeakSet: () => isWeakSet_default, + iteratee: () => iteratee_default, + join: () => join_default, + kebabCase: () => kebabCase_default, + keyBy: () => keyBy_default, + keys: () => keys_default, + keysIn: () => keysIn_default, + last: () => last_default, + lastIndexOf: () => lastIndexOf_default, + lodash: () => wrapperLodash_default, + lowerCase: () => lowerCase_default, + lowerFirst: () => lowerFirst_default, + lt: () => lt_default, + lte: () => lte_default, + map: () => map_default, + mapKeys: () => mapKeys_default, + mapValues: () => mapValues_default, + matches: () => matches_default, + matchesProperty: () => matchesProperty_default, + max: () => max_default, + maxBy: () => maxBy_default, + mean: () => mean_default, + meanBy: () => meanBy_default, + memoize: () => memoize_default, + merge: () => merge_default, + mergeWith: () => mergeWith_default, + method: () => method_default, + methodOf: () => methodOf_default, + min: () => min_default, + minBy: () => minBy_default, + mixin: () => mixin_default, + multiply: () => multiply_default, + negate: () => negate_default, + next: () => next_default, + noop: () => noop_default, + now: () => now_default, + nth: () => nth_default, + nthArg: () => nthArg_default, + omit: () => omit_default, + omitBy: () => omitBy_default, + once: () => once_default, + orderBy: () => orderBy_default, + over: () => over_default, + overArgs: () => overArgs_default, + overEvery: () => overEvery_default, + overSome: () => overSome_default, + pad: () => pad_default, + padEnd: () => padEnd_default, + padStart: () => padStart_default, + parseInt: () => parseInt_default, + partial: () => partial_default, + partialRight: () => partialRight_default, + partition: () => partition_default, + pick: () => pick_default, + pickBy: () => pickBy_default, + plant: () => plant_default, + property: () => property_default, + propertyOf: () => propertyOf_default, + pull: () => pull_default, + pullAll: () => pullAll_default, + pullAllBy: () => pullAllBy_default, + pullAllWith: () => pullAllWith_default, + pullAt: () => pullAt_default, + random: () => random_default, + range: () => range_default, + rangeRight: () => rangeRight_default, + rearg: () => rearg_default, + reduce: () => reduce_default, + reduceRight: () => reduceRight_default, + reject: () => reject_default, + remove: () => remove_default, + repeat: () => repeat_default, + replace: () => replace_default, + rest: () => rest_default, + result: () => result_default, + reverse: () => reverse_default, + round: () => round_default, + sample: () => sample_default, + sampleSize: () => sampleSize_default, + set: () => set_default, + setWith: () => setWith_default, + shuffle: () => shuffle_default, + size: () => size_default, + slice: () => slice_default, + snakeCase: () => snakeCase_default, + some: () => some_default, + sortBy: () => sortBy_default, + sortedIndex: () => sortedIndex_default, + sortedIndexBy: () => sortedIndexBy_default, + sortedIndexOf: () => sortedIndexOf_default, + sortedLastIndex: () => sortedLastIndex_default, + sortedLastIndexBy: () => sortedLastIndexBy_default, + sortedLastIndexOf: () => sortedLastIndexOf_default, + sortedUniq: () => sortedUniq_default, + sortedUniqBy: () => sortedUniqBy_default, + split: () => split_default, + spread: () => spread_default, + startCase: () => startCase_default, + startsWith: () => startsWith_default, + stubArray: () => stubArray_default, + stubFalse: () => stubFalse_default, + stubObject: () => stubObject_default, + stubString: () => stubString_default, + stubTrue: () => stubTrue_default, + subtract: () => subtract_default, + sum: () => sum_default, + sumBy: () => sumBy_default, + tail: () => tail_default, + take: () => take_default, + takeRight: () => takeRight_default, + takeRightWhile: () => takeRightWhile_default, + takeWhile: () => takeWhile_default, + tap: () => tap_default, + template: () => template_default, + templateSettings: () => templateSettings_default, + throttle: () => throttle_default, + thru: () => thru_default, + times: () => times_default, + toArray: () => toArray_default, + toFinite: () => toFinite_default, + toInteger: () => toInteger_default, + toIterator: () => toIterator_default, + toJSON: () => wrapperValue_default, + toLength: () => toLength_default, + toLower: () => toLower_default, + toNumber: () => toNumber_default, + toPairs: () => toPairs_default, + toPairsIn: () => toPairsIn_default, + toPath: () => toPath_default, + toPlainObject: () => toPlainObject_default, + toSafeInteger: () => toSafeInteger_default, + toString: () => toString_default, + toUpper: () => toUpper_default, + transform: () => transform_default, + trim: () => trim_default, + trimEnd: () => trimEnd_default, + trimStart: () => trimStart_default, + truncate: () => truncate_default, + unary: () => unary_default, + unescape: () => unescape_default, + union: () => union_default, + unionBy: () => unionBy_default, + unionWith: () => unionWith_default, + uniq: () => uniq_default, + uniqBy: () => uniqBy_default, + uniqWith: () => uniqWith_default, + uniqueId: () => uniqueId_default, + unset: () => unset_default, + unzip: () => unzip_default, + unzipWith: () => unzipWith_default, + update: () => update_default, + updateWith: () => updateWith_default, + upperCase: () => upperCase_default, + upperFirst: () => upperFirst_default, + value: () => wrapperValue_default, + valueOf: () => wrapperValue_default, + values: () => values_default, + valuesIn: () => valuesIn_default, + without: () => without_default, + words: () => words_default, + wrap: () => wrap_default, + wrapperAt: () => wrapperAt_default, + wrapperChain: () => wrapperChain_default, + wrapperCommit: () => commit_default, + wrapperLodash: () => wrapperLodash_default, + wrapperNext: () => next_default, + wrapperPlant: () => plant_default, + wrapperReverse: () => wrapperReverse_default, + wrapperToIterator: () => toIterator_default, + wrapperValue: () => wrapperValue_default, + xor: () => xor_default, + xorBy: () => xorBy_default, + xorWith: () => xorWith_default, + zip: () => zip_default, + zipObject: () => zipObject_default, + zipObjectDeep: () => zipObjectDeep_default, + zipWith: () => zipWith_default +}); +var init_lodash = __esm({ + "node_modules/lodash-es/lodash.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_add(); + init_after(); + init_ary(); + init_assign(); + init_assignIn(); + init_assignInWith(); + init_assignWith(); + init_at(); + init_attempt(); + init_before(); + init_bind(); + init_bindAll(); + init_bindKey(); + init_camelCase(); + init_capitalize(); + init_castArray(); + init_ceil(); + init_chain(); + init_chunk(); + init_clamp(); + init_clone(); + init_cloneDeep(); + init_cloneDeepWith(); + init_cloneWith(); + init_commit(); + init_compact(); + init_concat(); + init_cond(); + init_conforms(); + init_conformsTo(); + init_constant(); + init_countBy(); + init_create(); + init_curry(); + init_curryRight(); + init_debounce(); + init_deburr(); + init_defaultTo(); + init_defaults(); + init_defaultsDeep(); + init_defer(); + init_delay(); + init_difference(); + init_differenceBy(); + init_differenceWith(); + init_divide(); + init_drop(); + init_dropRight(); + init_dropRightWhile(); + init_dropWhile(); + init_each(); + init_eachRight(); + init_endsWith(); + init_entries(); + init_entriesIn(); + init_eq(); + init_escape(); + init_escapeRegExp(); + init_every(); + init_extend(); + init_extendWith(); + init_fill(); + init_filter(); + init_find(); + init_findIndex(); + init_findKey(); + init_findLast(); + init_findLastIndex(); + init_findLastKey(); + init_first(); + init_flatMap(); + init_flatMapDeep(); + init_flatMapDepth(); + init_flatten(); + init_flattenDeep(); + init_flattenDepth(); + init_flip(); + init_floor(); + init_flow(); + init_flowRight(); + init_forEach(); + init_forEachRight(); + init_forIn(); + init_forInRight(); + init_forOwn(); + init_forOwnRight(); + init_fromPairs(); + init_functions(); + init_functionsIn(); + init_get(); + init_groupBy(); + init_gt(); + init_gte(); + init_has(); + init_hasIn(); + init_head(); + init_identity2(); + init_inRange(); + init_includes(); + init_indexOf(); + init_initial(); + init_intersection(); + init_intersectionBy(); + init_intersectionWith(); + init_invert(); + init_invertBy(); + init_invoke(); + init_invokeMap(); + init_isArguments(); + init_isArray(); + init_isArrayBuffer(); + init_isArrayLike(); + init_isArrayLikeObject(); + init_isBoolean(); + init_isBuffer(); + init_isDate(); + init_isElement(); + init_isEmpty(); + init_isEqual(); + init_isEqualWith(); + init_isError(); + init_isFinite(); + init_isFunction(); + init_isInteger(); + init_isLength(); + init_isMap(); + init_isMatch(); + init_isMatchWith(); + init_isNaN(); + init_isNative(); + init_isNil(); + init_isNull(); + init_isNumber(); + init_isObject(); + init_isObjectLike(); + init_isPlainObject(); + init_isRegExp(); + init_isSafeInteger(); + init_isSet(); + init_isString(); + init_isSymbol(); + init_isTypedArray(); + init_isUndefined(); + init_isWeakMap(); + init_isWeakSet(); + init_iteratee(); + init_join(); + init_kebabCase(); + init_keyBy(); + init_keys(); + init_keysIn(); + init_last(); + init_lastIndexOf(); + init_wrapperLodash(); + init_lowerCase(); + init_lowerFirst(); + init_lt(); + init_lte(); + init_map2(); + init_mapKeys(); + init_mapValues(); + init_matches(); + init_matchesProperty(); + init_max(); + init_maxBy(); + init_mean(); + init_meanBy(); + init_memoize(); + init_merge2(); + init_mergeWith(); + init_method(); + init_methodOf(); + init_min(); + init_minBy(); + init_mixin(); + init_multiply(); + init_negate(); + init_next(); + init_noop(); + init_now(); + init_nth(); + init_nthArg(); + init_omit(); + init_omitBy(); + init_once(); + init_orderBy(); + init_over(); + init_overArgs(); + init_overEvery(); + init_overSome(); + init_pad(); + init_padEnd(); + init_padStart(); + init_parseInt(); + init_partial(); + init_partialRight(); + init_partition(); + init_pick(); + init_pickBy(); + init_plant(); + init_property(); + init_propertyOf(); + init_pull(); + init_pullAll(); + init_pullAllBy(); + init_pullAllWith(); + init_pullAt(); + init_random(); + init_range(); + init_rangeRight(); + init_rearg(); + init_reduce(); + init_reduceRight(); + init_reject(); + init_remove(); + init_repeat(); + init_replace(); + init_rest(); + init_result(); + init_reverse(); + init_round(); + init_sample(); + init_sampleSize(); + init_set2(); + init_setWith(); + init_shuffle(); + init_size(); + init_slice(); + init_snakeCase(); + init_some(); + init_sortBy(); + init_sortedIndex(); + init_sortedIndexBy(); + init_sortedIndexOf(); + init_sortedLastIndex(); + init_sortedLastIndexBy(); + init_sortedLastIndexOf(); + init_sortedUniq(); + init_sortedUniqBy(); + init_split(); + init_spread(); + init_startCase(); + init_startsWith(); + init_stubArray(); + init_stubFalse(); + init_stubObject(); + init_stubString(); + init_stubTrue(); + init_subtract(); + init_sum(); + init_sumBy(); + init_tail(); + init_take(); + init_takeRight(); + init_takeRightWhile(); + init_takeWhile(); + init_tap(); + init_template(); + init_templateSettings(); + init_throttle(); + init_thru(); + init_times(); + init_toArray(); + init_toFinite(); + init_toInteger(); + init_toIterator(); + init_toJSON(); + init_toLength(); + init_toLower(); + init_toNumber(); + init_toPairs(); + init_toPairsIn(); + init_toPath(); + init_toPlainObject(); + init_toSafeInteger(); + init_toString(); + init_toUpper(); + init_transform(); + init_trim(); + init_trimEnd(); + init_trimStart(); + init_truncate(); + init_unary(); + init_unescape(); + init_union(); + init_unionBy(); + init_unionWith(); + init_uniq(); + init_uniqBy(); + init_uniqWith(); + init_uniqueId(); + init_unset(); + init_unzip(); + init_unzipWith(); + init_update(); + init_updateWith(); + init_upperCase(); + init_upperFirst(); + init_value(); + init_valueOf(); + init_values(); + init_valuesIn(); + init_without(); + init_words(); + init_wrap(); + init_wrapperAt(); + init_wrapperChain(); + init_commit(); + init_wrapperLodash(); + init_next(); + init_plant(); + init_wrapperReverse(); + init_toIterator(); + init_wrapperValue(); + init_xor(); + init_xorBy(); + init_xorWith(); + init_zip(); + init_zipObject(); + init_zipObjectDeep(); + init_zipWith(); + init_lodash_default(); + } +}); + +// node_modules/@stoplight/path/index.es.js +var index_es_exports = {}; +__export(index_es_exports, { + basename: () => c, + deserializeSrn: () => x, + dirname: () => a, + extname: () => l, + format: () => t, + isAbsolute: () => s, + isURL: () => f, + join: () => p, + normalize: () => o, + parse: () => e, + relative: () => h, + resolve: () => g, + sep: () => v, + serializeSrn: () => m, + startsWithWindowsDrive: () => d, + stripRoot: () => b, + toFSPath: () => o +}); +function t(t8) { + let n7 = ""; + return t8.absolute && ("file" === t8.protocol ? (t8.drive && (n7 += t8.drive), n7 += "/") : (n7 += t8.protocol + "://", t8.origin && (n7 += t8.origin + "/"))), "" === (n7 += t8.path.join("/")) && (n7 = "."), n7; +} +function n(t8, r8, e10, o7) { + this.message = t8, this.expected = r8, this.found = e10, this.location = o7, this.name = "SyntaxError", "function" == typeof Error.captureStackTrace && Error.captureStackTrace(this, n); +} +function e(t8) { + if ("string" != typeof t8) + throw new Error(`@stoplight/path: Cannot parse ${t8} because it is not a string`); + return r(t8, {}); +} +function o(n7) { + return t(u(e(n7))); +} +function u(t8) { + let n7 = t8.path; + n7 = n7.filter((t9) => "" !== t9 && "." !== t9); + const r8 = []; + for (const e10 of n7) + ".." === e10 && r8.length && ".." !== r8[r8.length - 1] ? r8.pop() : ".." === e10 && t8.absolute || r8.push(e10); + return t8.path = r8, t8; +} +function i(t8) { + let n7 = t8.lastIndexOf("."); + ".." === t8 && (n7 = -1), "." === t8 && (n7 = -1); + let r8 = t8, e10 = ""; + return n7 > 0 && (r8 = t8.slice(0, n7), e10 = t8.slice(n7)), { name: r8, ext: e10 }; +} +function s(t8) { + return e(t8).absolute; +} +function f(t8) { + const n7 = e(t8); + return "http" === n7.protocol || "https" === n7.protocol; +} +function h(n7, r8) { + const o7 = u(e(r8)); + if (!o7.absolute) + return t(o7); + const i7 = u(e(n7)); + if (o7.origin !== i7.origin) + return t(o7); + if (!i7.absolute) + return t(o7); + if (i7.drive !== o7.drive) + return t(o7); + const c7 = Math.min(i7.path.length, o7.path.length); + for (let t8 = 0; t8 < c7 && i7.path[0] === o7.path[0]; t8++) + i7.path.shift(), o7.path.shift(); + return o7.path.unshift(...i7.path.fill("..")), t({ origin: null, drive: null, absolute: false, protocol: null, path: o7.path }); +} +function g(...n7) { + if (0 === n7.length) + return "."; + const r8 = u(e(n7[n7.length - 1])); + return r8.absolute ? t(r8) : p(...n7); +} +function x(t8) { + const [n7, r8, e10, ...o7] = t8.split("/"), u7 = o7.length ? `/${o7.join("/")}` : void 0; + let c7, a7; + return u7 && (c7 = o7.find((t9) => t9.includes("."))) && (a7 = i(c7).ext), { shortcode: n7, orgSlug: r8, projectSlug: e10, uri: u7, file: c7, ext: a7 }; +} +function m({ shortcode: t8, orgSlug: n7, projectSlug: r8, uri: e10 = "" }) { + return [t8, n7, r8, e10.replace(/^\//, "")].filter(Boolean).join("/"); +} +var r, c, a, l, p, v, d, b; +var init_index_es = __esm({ + "node_modules/@stoplight/path/index.es.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + !function(t8, n7) { + function r8() { + this.constructor = t8; + } + r8.prototype = n7.prototype, t8.prototype = new r8(); + }(n, Error), n.buildMessage = function(t8, n7) { + var r8 = { literal: function(t9) { + return '"' + o7(t9.text) + '"'; + }, class: function(t9) { + var n8, r9 = ""; + for (n8 = 0; n8 < t9.parts.length; n8++) + r9 += t9.parts[n8] instanceof Array ? u7(t9.parts[n8][0]) + "-" + u7(t9.parts[n8][1]) : u7(t9.parts[n8]); + return "[" + (t9.inverted ? "^" : "") + r9 + "]"; + }, any: function(t9) { + return "any character"; + }, end: function(t9) { + return "end of input"; + }, other: function(t9) { + return t9.description; + } }; + function e10(t9) { + return t9.charCodeAt(0).toString(16).toUpperCase(); + } + function o7(t9) { + return t9.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(t10) { + return "\\x0" + e10(t10); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t10) { + return "\\x" + e10(t10); + }); + } + function u7(t9) { + return t9.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(t10) { + return "\\x0" + e10(t10); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(t10) { + return "\\x" + e10(t10); + }); + } + return "Expected " + function(t9) { + var n8, e11, o8, u8 = new Array(t9.length); + for (n8 = 0; n8 < t9.length; n8++) + u8[n8] = (o8 = t9[n8], r8[o8.type](o8)); + if (u8.sort(), u8.length > 0) { + for (n8 = 1, e11 = 1; n8 < u8.length; n8++) + u8[n8 - 1] !== u8[n8] && (u8[e11] = u8[n8], e11++); + u8.length = e11; + } + switch (u8.length) { + case 1: + return u8[0]; + case 2: + return u8[0] + " or " + u8[1]; + default: + return u8.slice(0, -1).join(", ") + ", or " + u8[u8.length - 1]; + } + }(t8) + " but " + function(t9) { + return t9 ? '"' + o7(t9) + '"' : "end of input"; + }(n7) + " found."; + }; + r = function(t8, r8) { + r8 = void 0 !== r8 ? r8 : {}; + var e10, o7, u7, i7, c7 = {}, a7 = { Path: nt2 }, l7 = nt2, s7 = function(t9, n7, r9, e11) { + return { protocol: t9, origin: n7, absolute: true, ...r9, ...e11 }; + }, f8 = function(t9, n7, r9) { + return { protocol: t9, origin: n7, absolute: true, ...r9, path: [] }; + }, p7 = "http://", h8 = W5("http://", true), g7 = function(t9) { + return "http"; + }, v8 = "https://", d7 = W5("https://", true), b8 = function(t9) { + return "https"; + }, x7 = "", m7 = function() { + return null; + }, C6 = function(t9, n7, r9) { + return { protocol: t9, origin: null, absolute: true, ...n7, ...r9 }; + }, w6 = "file://", A6 = W5("file://", true), y7 = "file:", j6 = W5("file:", true), F6 = function(t9) { + return "file"; + }, S6 = function(t9, n7) { + return { protocol: "file", origin: null, absolute: true, ...t9, ...n7 }; + }, E6 = /^[A-Za-z]/, L6 = X5([["A", "Z"], ["a", "z"]], false, false), R6 = ":", $5 = W5(":", false), M6 = function(t9) { + return { drive: t9.toLowerCase() + ":" }; + }, k6 = function() { + return { drive: null }; + }, z6 = function() { + return { drive: null }; + }, B6 = function(t9) { + return { protocol: null, origin: null, absolute: false, drive: null, ...t9 }; + }, O7 = function(t9) { + return { path: t9 }; + }, P6 = function(t9, n7) { + return [t9, ...n7]; + }, T6 = function(t9) { + return [t9]; + }, Z5 = ".", I6 = W5(".", false), U6 = "/", q5 = W5("/", false), D6 = "\\", G5 = W5("\\", false), H5 = /^[^\/\\]/, J5 = X5(["/", "\\"], true, false), K5 = 0, N6 = [{ line: 1, column: 1 }], Q5 = 0, V5 = []; + if ("startRule" in r8) { + if (!(r8.startRule in a7)) + throw new Error(`Can't start parsing from rule "` + r8.startRule + '".'); + l7 = a7[r8.startRule]; + } + function W5(t9, n7) { + return { type: "literal", text: t9, ignoreCase: n7 }; + } + function X5(t9, n7, r9) { + return { type: "class", parts: t9, inverted: n7, ignoreCase: r9 }; + } + function Y6(n7) { + var r9, e11 = N6[n7]; + if (e11) + return e11; + for (r9 = n7 - 1; !N6[r9]; ) + r9--; + for (e11 = { line: (e11 = N6[r9]).line, column: e11.column }; r9 < n7; ) + 10 === t8.charCodeAt(r9) ? (e11.line++, e11.column = 1) : e11.column++, r9++; + return N6[n7] = e11, e11; + } + function _6(t9, n7) { + var r9 = Y6(t9), e11 = Y6(n7); + return { start: { offset: t9, line: r9.line, column: r9.column }, end: { offset: n7, line: e11.line, column: e11.column } }; + } + function tt3(t9) { + K5 < Q5 || (K5 > Q5 && (Q5 = K5, V5 = []), V5.push(t9)); + } + function nt2() { + var n7; + return (n7 = function() { + var t9, n8, r9, e11, o8; + return t9 = K5, (n8 = rt()) !== c7 && (r9 = et3()) !== c7 && (e11 = ut()) !== c7 && (o8 = it2()) !== c7 ? (n8 = s7(n8, r9, e11, o8), t9 = n8) : (K5 = t9, t9 = c7), t9 === c7 && (t9 = K5, (n8 = rt()) !== c7 && (r9 = et3()) !== c7 && (e11 = function() { + var t10; + return (t10 = x7) !== c7 && (t10 = z6()), t10; + }()) !== c7 ? (n8 = f8(n8, r9, e11), t9 = n8) : (K5 = t9, t9 = c7)), t9; + }()) === c7 && (n7 = function() { + var n8, r9, e11, o8; + return n8 = K5, (r9 = function() { + var n9; + return t8.substr(K5, 7).toLowerCase() === w6 ? (n9 = t8.substr(K5, 7), K5 += 7) : (n9 = c7, tt3(A6)), n9 === c7 && (t8.substr(K5, 5).toLowerCase() === y7 ? (n9 = t8.substr(K5, 5), K5 += 5) : (n9 = c7, tt3(j6))), n9 !== c7 && (n9 = F6()), n9; + }()) !== c7 && (e11 = ot()) !== c7 && (o8 = it2()) !== c7 ? (r9 = C6(r9, e11, o8), n8 = r9) : (K5 = n8, n8 = c7), n8; + }()) === c7 && (n7 = function() { + var t9, n8, r9; + return t9 = K5, (n8 = ot()) !== c7 && (r9 = it2()) !== c7 ? (n8 = S6(n8, r9), t9 = n8) : (K5 = t9, t9 = c7), t9; + }()) === c7 && (n7 = function() { + var n8, r9, e11; + return n8 = K5, (r9 = function() { + var n9; + return (n9 = function() { + var n10, r10, e12; + return n10 = K5, 46 === t8.charCodeAt(K5) ? (r10 = Z5, K5++) : (r10 = c7, tt3(I6)), r10 !== c7 && (e12 = at2()) !== c7 ? n10 = r10 = [r10, e12] : (K5 = n10, n10 = c7), n10; + }()) === c7 && (n9 = x7), n9; + }()) !== c7 && (e11 = it2()) !== c7 ? (r9 = B6(e11), n8 = r9) : (K5 = n8, n8 = c7), n8; + }()), n7; + } + function rt() { + var n7, r9; + return t8.substr(K5, 7).toLowerCase() === p7 ? (r9 = t8.substr(K5, 7), K5 += 7) : (r9 = c7, tt3(h8)), r9 !== c7 && (r9 = g7()), (n7 = r9) === c7 && (n7 = function() { + var n8; + return t8.substr(K5, 8).toLowerCase() === v8 ? (n8 = t8.substr(K5, 8), K5 += 8) : (n8 = c7, tt3(d7)), n8 !== c7 && (n8 = b8()), n8; + }()), n7; + } + function et3() { + var n7, r9, e11; + if (n7 = K5, r9 = [], (e11 = lt2()) !== c7) + for (; e11 !== c7; ) + r9.push(e11), e11 = lt2(); + else + r9 = c7; + return (n7 = r9 !== c7 ? t8.substring(n7, K5) : r9) === c7 && (n7 = K5, (r9 = x7) !== c7 && (r9 = m7()), n7 = r9), n7; + } + function ot() { + var n7; + return (n7 = function() { + var n8, r9, e11, o8; + return n8 = K5, (r9 = at2()) === c7 && (r9 = null), r9 !== c7 ? (E6.test(t8.charAt(K5)) ? (e11 = t8.charAt(K5), K5++) : (e11 = c7, tt3(L6)), e11 !== c7 ? (58 === t8.charCodeAt(K5) ? (o8 = R6, K5++) : (o8 = c7, tt3($5)), o8 !== c7 && at2() !== c7 ? (r9 = M6(e11), n8 = r9) : (K5 = n8, n8 = c7)) : (K5 = n8, n8 = c7)) : (K5 = n8, n8 = c7), n8; + }()) === c7 && (n7 = ut()), n7; + } + function ut() { + var t9; + return (t9 = at2()) !== c7 && (t9 = k6()), t9; + } + function it2() { + var t9; + return (t9 = function t10() { + var n7, r9, e11; + return n7 = K5, (r9 = ct()) !== c7 && at2() !== c7 && (e11 = t10()) !== c7 ? (r9 = P6(r9, e11), n7 = r9) : (K5 = n7, n7 = c7), n7 === c7 && (n7 = K5, (r9 = ct()) !== c7 && (r9 = T6(r9)), n7 = r9), n7; + }()) !== c7 && (t9 = O7(t9)), t9; + } + function ct() { + var n7, r9, e11; + if (n7 = K5, r9 = [], (e11 = lt2()) !== c7) + for (; e11 !== c7; ) + r9.push(e11), e11 = lt2(); + else + r9 = c7; + return (n7 = r9 !== c7 ? t8.substring(n7, K5) : r9) === c7 && (n7 = x7), n7; + } + function at2() { + var n7; + return 47 === t8.charCodeAt(K5) ? (n7 = U6, K5++) : (n7 = c7, tt3(q5)), n7 === c7 && (92 === t8.charCodeAt(K5) ? (n7 = D6, K5++) : (n7 = c7, tt3(G5))), n7; + } + function lt2() { + var n7; + return H5.test(t8.charAt(K5)) ? (n7 = t8.charAt(K5), K5++) : (n7 = c7, tt3(J5)), n7; + } + if ((e10 = l7()) !== c7 && K5 === t8.length) + return e10; + throw e10 !== c7 && K5 < t8.length && tt3({ type: "end" }), o7 = V5, u7 = Q5 < t8.length ? t8.charAt(Q5) : null, i7 = Q5 < t8.length ? _6(Q5, Q5 + 1) : _6(Q5, Q5), new n(n.buildMessage(o7, u7), o7, u7, i7); + }; + c = (t8, n7) => { + const r8 = u(e(t8)).path.pop(); + if (!r8) + return ""; + const { name: o7, ext: c7 } = i(r8); + return true === n7 || n7 === c7 ? o7 : `${o7}${c7}`; + }; + a = (n7) => { + const r8 = u(e(n7)); + return r8.path.pop(), t(u(r8)); + }; + l = (t8) => { + const n7 = u(e(t8)).path.pop(); + if (!n7) + return ""; + const { ext: r8 } = i(n7); + return r8; + }; + p = (...n7) => { + if (0 === n7.length) + return "."; + const r8 = n7.map(e), o7 = Object.assign({}, r8[0]); + for (let t8 = 1; t8 < r8.length; t8++) { + const e10 = r8[t8]; + if (e10.absolute) + throw new Error('Cannot join an absolute path "' + n7[t8] + '" in the middle of other paths.'); + for (const t9 of e10.path) + o7.path.push(t9); + } + return t(u(o7)); + }; + v = "/"; + d = (t8) => { + return null !== e(t8).drive; + }; + b = (t8) => e(t8).path.filter(Boolean).join("/"); + } +}); + +// node_modules/jsonc-parser/lib/esm/impl/scanner.js +function createScanner(text, ignoreTrivia) { + if (ignoreTrivia === void 0) { + ignoreTrivia = false; + } + var len = text.length; + var pos = 0, value2 = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0; + function scanHexDigits(count2, exact) { + var digits = 0; + var value3 = 0; + while (digits < count2 || !exact) { + var ch = text.charCodeAt(pos); + if (ch >= 48 && ch <= 57) { + value3 = value3 * 16 + ch - 48; + } else if (ch >= 65 && ch <= 70) { + value3 = value3 * 16 + ch - 65 + 10; + } else if (ch >= 97 && ch <= 102) { + value3 = value3 * 16 + ch - 97 + 10; + } else { + break; + } + pos++; + digits++; + } + if (digits < count2) { + value3 = -1; + } + return value3; + } + function setPosition(newPosition) { + pos = newPosition; + value2 = ""; + tokenOffset = 0; + token = 16; + scanError = 0; + } + function scanNumber() { + var start = pos; + if (text.charCodeAt(pos) === 48) { + pos++; + } else { + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + } + } + if (pos < text.length && text.charCodeAt(pos) === 46) { + pos++; + if (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + } + } else { + scanError = 3; + return text.substring(start, pos); + } + } + var end = pos; + if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) { + pos++; + if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) { + pos++; + } + if (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + } + end = pos; + } else { + scanError = 3; + } + } + return text.substring(start, end); + } + function scanString() { + var result2 = "", start = pos; + while (true) { + if (pos >= len) { + result2 += text.substring(start, pos); + scanError = 2; + break; + } + var ch = text.charCodeAt(pos); + if (ch === 34) { + result2 += text.substring(start, pos); + pos++; + break; + } + if (ch === 92) { + result2 += text.substring(start, pos); + pos++; + if (pos >= len) { + scanError = 2; + break; + } + var ch2 = text.charCodeAt(pos++); + switch (ch2) { + case 34: + result2 += '"'; + break; + case 92: + result2 += "\\"; + break; + case 47: + result2 += "/"; + break; + case 98: + result2 += "\b"; + break; + case 102: + result2 += "\f"; + break; + case 110: + result2 += "\n"; + break; + case 114: + result2 += "\r"; + break; + case 116: + result2 += " "; + break; + case 117: + var ch3 = scanHexDigits(4, true); + if (ch3 >= 0) { + result2 += String.fromCharCode(ch3); + } else { + scanError = 4; + } + break; + default: + scanError = 5; + } + start = pos; + continue; + } + if (ch >= 0 && ch <= 31) { + if (isLineBreak(ch)) { + result2 += text.substring(start, pos); + scanError = 2; + break; + } else { + scanError = 6; + } + } + pos++; + } + return result2; + } + function scanNext() { + value2 = ""; + scanError = 0; + tokenOffset = pos; + lineStartOffset = lineNumber; + prevTokenLineStartOffset = tokenLineStartOffset; + if (pos >= len) { + tokenOffset = len; + return token = 17; + } + var code = text.charCodeAt(pos); + if (isWhiteSpace(code)) { + do { + pos++; + value2 += String.fromCharCode(code); + code = text.charCodeAt(pos); + } while (isWhiteSpace(code)); + return token = 15; + } + if (isLineBreak(code)) { + pos++; + value2 += String.fromCharCode(code); + if (code === 13 && text.charCodeAt(pos) === 10) { + pos++; + value2 += "\n"; + } + lineNumber++; + tokenLineStartOffset = pos; + return token = 14; + } + switch (code) { + case 123: + pos++; + return token = 1; + case 125: + pos++; + return token = 2; + case 91: + pos++; + return token = 3; + case 93: + pos++; + return token = 4; + case 58: + pos++; + return token = 6; + case 44: + pos++; + return token = 5; + case 34: + pos++; + value2 = scanString(); + return token = 10; + case 47: + var start = pos - 1; + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; + } + value2 = text.substring(start, pos); + return token = 12; + } + if (text.charCodeAt(pos + 1) === 42) { + pos += 2; + var safeLength = len - 1; + var commentClosed = false; + while (pos < safeLength) { + var ch = text.charCodeAt(pos); + if (ch === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + commentClosed = true; + break; + } + pos++; + if (isLineBreak(ch)) { + if (ch === 13 && text.charCodeAt(pos) === 10) { + pos++; + } + lineNumber++; + tokenLineStartOffset = pos; + } + } + if (!commentClosed) { + pos++; + scanError = 1; + } + value2 = text.substring(start, pos); + return token = 13; + } + value2 += String.fromCharCode(code); + pos++; + return token = 16; + case 45: + value2 += String.fromCharCode(code); + pos++; + if (pos === len || !isDigit(text.charCodeAt(pos))) { + return token = 16; + } + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + value2 += scanNumber(); + return token = 11; + default: + while (pos < len && isUnknownContentCharacter(code)) { + pos++; + code = text.charCodeAt(pos); + } + if (tokenOffset !== pos) { + value2 = text.substring(tokenOffset, pos); + switch (value2) { + case "true": + return token = 8; + case "false": + return token = 9; + case "null": + return token = 7; + } + return token = 16; + } + value2 += String.fromCharCode(code); + pos++; + return token = 16; + } + } + function isUnknownContentCharacter(code) { + if (isWhiteSpace(code) || isLineBreak(code)) { + return false; + } + switch (code) { + case 125: + case 93: + case 123: + case 91: + case 34: + case 58: + case 44: + case 47: + return false; + } + return true; + } + function scanNextNonTrivia() { + var result2; + do { + result2 = scanNext(); + } while (result2 >= 12 && result2 <= 15); + return result2; + } + return { + setPosition, + getPosition: function() { + return pos; + }, + scan: ignoreTrivia ? scanNextNonTrivia : scanNext, + getToken: function() { + return token; + }, + getTokenValue: function() { + return value2; + }, + getTokenOffset: function() { + return tokenOffset; + }, + getTokenLength: function() { + return pos - tokenOffset; + }, + getTokenStartLine: function() { + return lineStartOffset; + }, + getTokenStartCharacter: function() { + return tokenOffset - prevTokenLineStartOffset; + }, + getTokenError: function() { + return scanError; + } + }; +} +function isWhiteSpace(ch) { + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; +} +function isLineBreak(ch) { + return ch === 10 || ch === 13 || ch === 8232 || ch === 8233; +} +function isDigit(ch) { + return ch >= 48 && ch <= 57; +} +var init_scanner = __esm({ + "node_modules/jsonc-parser/lib/esm/impl/scanner.js"() { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/jsonc-parser/lib/esm/impl/format.js +var init_format = __esm({ + "node_modules/jsonc-parser/lib/esm/impl/format.js"() { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + init_scanner(); + } +}); + +// node_modules/jsonc-parser/lib/esm/impl/parser.js +function getNodePath(node) { + if (!node.parent || !node.parent.children) { + return []; + } + var path2 = getNodePath(node.parent); + if (node.parent.type === "property") { + var key = node.parent.children[0].value; + path2.push(key); + } else if (node.parent.type === "array") { + var index4 = node.parent.children.indexOf(node); + if (index4 !== -1) { + path2.push(index4); + } + } + return path2; +} +function contains(node, offset, includeRightBound) { + if (includeRightBound === void 0) { + includeRightBound = false; + } + return offset >= node.offset && offset < node.offset + node.length || includeRightBound && offset === node.offset + node.length; +} +function findNodeAtOffset(node, offset, includeRightBound) { + if (includeRightBound === void 0) { + includeRightBound = false; + } + if (contains(node, offset, includeRightBound)) { + var children = node.children; + if (Array.isArray(children)) { + for (var i7 = 0; i7 < children.length && children[i7].offset <= offset; i7++) { + var item = findNodeAtOffset(children[i7], offset, includeRightBound); + if (item) { + return item; + } + } + } + return node; + } + return void 0; +} +function visit3(text, visitor, options) { + if (options === void 0) { + options = ParseOptions.DEFAULT; + } + var _scanner = createScanner(text, false); + function toNoArgVisit(visitFunction) { + return visitFunction ? function() { + return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); + } : function() { + return true; + }; + } + function toOneArgVisit(visitFunction) { + return visitFunction ? function(arg) { + return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); + } : function() { + return true; + }; + } + var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError); + var disallowComments = options && options.disallowComments; + var allowTrailingComma = options && options.allowTrailingComma; + function scanNext() { + while (true) { + var token = _scanner.scan(); + switch (_scanner.getTokenError()) { + case 4: + handleError( + 14 + /* InvalidUnicode */ + ); + break; + case 5: + handleError( + 15 + /* InvalidEscapeCharacter */ + ); + break; + case 3: + handleError( + 13 + /* UnexpectedEndOfNumber */ + ); + break; + case 1: + if (!disallowComments) { + handleError( + 11 + /* UnexpectedEndOfComment */ + ); + } + break; + case 2: + handleError( + 12 + /* UnexpectedEndOfString */ + ); + break; + case 6: + handleError( + 16 + /* InvalidCharacter */ + ); + break; + } + switch (token) { + case 12: + case 13: + if (disallowComments) { + handleError( + 10 + /* InvalidCommentToken */ + ); + } else { + onComment(); + } + break; + case 16: + handleError( + 1 + /* InvalidSymbol */ + ); + break; + case 15: + case 14: + break; + default: + return token; + } + } + } + function handleError(error2, skipUntilAfter, skipUntil) { + if (skipUntilAfter === void 0) { + skipUntilAfter = []; + } + if (skipUntil === void 0) { + skipUntil = []; + } + onError(error2); + if (skipUntilAfter.length + skipUntil.length > 0) { + var token = _scanner.getToken(); + while (token !== 17) { + if (skipUntilAfter.indexOf(token) !== -1) { + scanNext(); + break; + } else if (skipUntil.indexOf(token) !== -1) { + break; + } + token = scanNext(); + } + } + } + function parseString(isValue) { + var value2 = _scanner.getTokenValue(); + if (isValue) { + onLiteralValue(value2); + } else { + onObjectProperty(value2); + } + scanNext(); + return true; + } + function parseLiteral() { + switch (_scanner.getToken()) { + case 11: + var value2 = 0; + try { + value2 = JSON.parse(_scanner.getTokenValue()); + if (typeof value2 !== "number") { + handleError( + 2 + /* InvalidNumberFormat */ + ); + value2 = 0; + } + } catch (e10) { + handleError( + 2 + /* InvalidNumberFormat */ + ); + } + onLiteralValue(value2); + break; + case 7: + onLiteralValue(null); + break; + case 8: + onLiteralValue(true); + break; + case 9: + onLiteralValue(false); + break; + default: + return false; + } + scanNext(); + return true; + } + function parseProperty() { + if (_scanner.getToken() !== 10) { + handleError(3, [], [ + 2, + 5 + /* CommaToken */ + ]); + return false; + } + parseString(false); + if (_scanner.getToken() === 6) { + onSeparator(":"); + scanNext(); + if (!parseValue2()) { + handleError(4, [], [ + 2, + 5 + /* CommaToken */ + ]); + } + } else { + handleError(5, [], [ + 2, + 5 + /* CommaToken */ + ]); + } + return true; + } + function parseObject() { + onObjectBegin(); + scanNext(); + var needsComma = false; + while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) { + if (_scanner.getToken() === 5) { + if (!needsComma) { + handleError(4, [], []); + } + onSeparator(","); + scanNext(); + if (_scanner.getToken() === 2 && allowTrailingComma) { + break; + } + } else if (needsComma) { + handleError(6, [], []); + } + if (!parseProperty()) { + handleError(4, [], [ + 2, + 5 + /* CommaToken */ + ]); + } + needsComma = true; + } + onObjectEnd(); + if (_scanner.getToken() !== 2) { + handleError(7, [ + 2 + /* CloseBraceToken */ + ], []); + } else { + scanNext(); + } + return true; + } + function parseArray() { + onArrayBegin(); + scanNext(); + var needsComma = false; + while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) { + if (_scanner.getToken() === 5) { + if (!needsComma) { + handleError(4, [], []); + } + onSeparator(","); + scanNext(); + if (_scanner.getToken() === 4 && allowTrailingComma) { + break; + } + } else if (needsComma) { + handleError(6, [], []); + } + if (!parseValue2()) { + handleError(4, [], [ + 4, + 5 + /* CommaToken */ + ]); + } + needsComma = true; + } + onArrayEnd(); + if (_scanner.getToken() !== 4) { + handleError(8, [ + 4 + /* CloseBracketToken */ + ], []); + } else { + scanNext(); + } + return true; + } + function parseValue2() { + switch (_scanner.getToken()) { + case 3: + return parseArray(); + case 1: + return parseObject(); + case 10: + return parseString(true); + default: + return parseLiteral(); + } + } + scanNext(); + if (_scanner.getToken() === 17) { + if (options.allowEmptyContent) { + return true; + } + handleError(4, [], []); + return false; + } + if (!parseValue2()) { + handleError(4, [], []); + return false; + } + if (_scanner.getToken() !== 17) { + handleError(9, [], []); + } + return true; +} +var ParseOptions; +var init_parser2 = __esm({ + "node_modules/jsonc-parser/lib/esm/impl/parser.js"() { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + init_scanner(); + (function(ParseOptions2) { + ParseOptions2.DEFAULT = { + allowTrailingComma: false + }; + })(ParseOptions || (ParseOptions = {})); + } +}); + +// node_modules/jsonc-parser/lib/esm/impl/edit.js +var init_edit = __esm({ + "node_modules/jsonc-parser/lib/esm/impl/edit.js"() { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + init_format(); + init_parser2(); + } +}); + +// node_modules/jsonc-parser/lib/esm/main.js +function printParseErrorCode(code) { + switch (code) { + case 1: + return "InvalidSymbol"; + case 2: + return "InvalidNumberFormat"; + case 3: + return "PropertyNameExpected"; + case 4: + return "ValueExpected"; + case 5: + return "ColonExpected"; + case 6: + return "CommaExpected"; + case 7: + return "CloseBraceExpected"; + case 8: + return "CloseBracketExpected"; + case 9: + return "EndOfFileExpected"; + case 10: + return "InvalidCommentToken"; + case 11: + return "UnexpectedEndOfComment"; + case 12: + return "UnexpectedEndOfString"; + case 13: + return "UnexpectedEndOfNumber"; + case 14: + return "InvalidUnicode"; + case 15: + return "InvalidEscapeCharacter"; + case 16: + return "InvalidCharacter"; + } + return ""; +} +var createScanner2, findNodeAtOffset2, getNodePath2, visit4; +var init_main = __esm({ + "node_modules/jsonc-parser/lib/esm/main.js"() { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + init_format(); + init_edit(); + init_scanner(); + init_parser2(); + createScanner2 = createScanner; + findNodeAtOffset2 = findNodeAtOffset; + getNodePath2 = getNodePath; + visit4 = visit3; + } +}); + +// node_modules/@stoplight/ordered-object-literal/src/index.mjs +function createObj(target, order = Reflect.ownKeys(target)) { + assertObjectLiteral(target); + const t8 = new Proxy(target, traps); + setOrder(t8, order); + return t8; +} +function setOrder(target, order) { + if (ORDER_KEY in target) { + target[ORDER_KEY].length = 0; + target[ORDER_KEY].push(...order); + return true; + } else { + return Reflect.defineProperty(target, ORDER_KEY, { + configurable: true, + value: order + }); + } +} +function getOrder(target) { + return target[ORDER_KEY]; +} +function isObject2(maybeObj) { + return maybeObj !== null && typeof maybeObj === "object"; +} +function isObjectLiteral(obj) { + if (!isObject2(obj)) + return false; + if (obj[Symbol.toStringTag] !== void 0) { + const proto = Object.getPrototypeOf(obj); + return proto === null || proto === Object.prototype; + } + return toStringTag(obj) === "Object"; +} +function toStringTag(obj) { + const tag = obj[Symbol.toStringTag]; + if (typeof tag === "string") { + return tag; + } + const name2 = Reflect.apply(Object.prototype.toString, obj, []); + return name2.slice(8, name2.length - 1); +} +function assertObjectLiteral(maybeObj, message) { + if (isDevEnv() && !isObjectLiteral(maybeObj)) { + throw new TypeError(message); + } +} +function isDevEnv() { + if (typeof process === "undefined" || !isObject2(process) || !isObject2(process.env)) { + return false; + } + return false; +} +var TIMESTAMP, ORDER_KEY_ID, ORDER_KEY, STRINGIFIED_ORDER_KEY, traps; +var init_src = __esm({ + "node_modules/@stoplight/ordered-object-literal/src/index.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + TIMESTAMP = Math.floor(Date.now() / 36e5); + ORDER_KEY_ID = `__object_order_${TIMESTAMP}__`; + ORDER_KEY = Symbol.for(ORDER_KEY_ID); + STRINGIFIED_ORDER_KEY = String(ORDER_KEY); + traps = { + defineProperty(target, key, descriptor) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + if (!hasKey && ORDER_KEY in target) { + target[ORDER_KEY].push(key); + } else if ("value" in descriptor && key === ORDER_KEY && descriptor.value.lastIndexOf(ORDER_KEY) === -1) { + descriptor.value.push(ORDER_KEY); + } + return Reflect.defineProperty(target, key, descriptor); + }, + deleteProperty(target, key) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + const deleted = Reflect.deleteProperty(target, key); + if (deleted && hasKey && ORDER_KEY in target) { + const index4 = target[ORDER_KEY].indexOf(key); + if (index4 !== -1) { + target[ORDER_KEY].splice(index4, 1); + } + } + return deleted; + }, + ownKeys(target) { + if (ORDER_KEY in target) { + return target[ORDER_KEY]; + } + return Reflect.ownKeys(target); + }, + set(target, key, value2) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + const set4 = Reflect.set(target, key, value2); + if (set4 && !hasKey && ORDER_KEY in target) { + target[ORDER_KEY].push(key); + } + return set4; + } + }; + } +}); + +// node_modules/safe-stable-stringify/stable.js +var require_stable = __commonJS({ + "node_modules/safe-stable-stringify/stable.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = stringify5; + var indentation = ""; + var strEscapeSequencesRegExp = /[\x00-\x1f\x22\x5c]/; + var strEscapeSequencesReplacer = /[\x00-\x1f\x22\x5c]/g; + var meta = [ + "\\u0000", + "\\u0001", + "\\u0002", + "\\u0003", + "\\u0004", + "\\u0005", + "\\u0006", + "\\u0007", + "\\b", + "\\t", + "\\n", + "\\u000b", + "\\f", + "\\r", + "\\u000e", + "\\u000f", + "\\u0010", + "\\u0011", + "\\u0012", + "\\u0013", + "\\u0014", + "\\u0015", + "\\u0016", + "\\u0017", + "\\u0018", + "\\u0019", + "\\u001a", + "\\u001b", + "\\u001c", + "\\u001d", + "\\u001e", + "\\u001f", + "", + "", + '\\"', + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\\\\" + ]; + function escapeFn(str2) { + return meta[str2.charCodeAt(0)]; + } + function strEscape(str2) { + if (str2.length < 5e3 && !strEscapeSequencesRegExp.test(str2)) { + return str2; + } + if (str2.length > 100) { + return str2.replace(strEscapeSequencesReplacer, escapeFn); + } + var result2 = ""; + var last2 = 0; + for (var i7 = 0; i7 < str2.length; i7++) { + const point = str2.charCodeAt(i7); + if (point === 34 || point === 92 || point < 32) { + if (last2 === i7) { + result2 += meta[point]; + } else { + result2 += `${str2.slice(last2, i7)}${meta[point]}`; + } + last2 = i7 + 1; + } + } + if (last2 === 0) { + result2 = str2; + } else if (last2 !== i7) { + result2 += str2.slice(last2); + } + return result2; + } + function stringifyFullFn(key, parent2, stack, replacer, indent) { + var i7, res, join3; + const originalIndentation = indentation; + var value2 = parent2[key]; + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + value2 = replacer.call(parent2, key, value2); + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifyFullFn(i7, value2, stack, replacer, indent); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join3; + } + const tmp = stringifyFullFn(i7, value2, stack, replacer, indent); + res += tmp !== void 0 ? tmp : "null"; + if (indentation !== "") { + res += ` +${originalIndentation}`; + } + res += "]"; + stack.pop(); + indentation = originalIndentation; + return res; + } + var keys2 = insertSort(Object.keys(value2)); + if (keys2.length === 0) { + return "{}"; + } + stack.push(value2); + res = "{"; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + var separator = ""; + for (i7 = 0; i7 < keys2.length; i7++) { + key = keys2[i7]; + const tmp = stringifyFullFn(key, value2, stack, replacer, indent); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}": ${tmp}`; + separator = join3; + } + } + if (separator !== "") { + res += ` +${originalIndentation}`; + } else { + res = "{"; + } + res += "}"; + stack.pop(); + indentation = originalIndentation; + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function stringifyFullArr(key, value2, stack, replacer, indent) { + var i7, res, join3; + const originalIndentation = indentation; + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifyFullArr(i7, value2[i7], stack, replacer, indent); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join3; + } + const tmp = stringifyFullArr(i7, value2[i7], stack, replacer, indent); + res += tmp !== void 0 ? tmp : "null"; + if (indentation !== "") { + res += ` +${originalIndentation}`; + } + res += "]"; + stack.pop(); + indentation = originalIndentation; + return res; + } + if (replacer.length === 0) { + return "{}"; + } + stack.push(value2); + res = "{"; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + var separator = ""; + for (i7 = 0; i7 < replacer.length; i7++) { + if (typeof replacer[i7] === "string" || typeof replacer[i7] === "number") { + key = replacer[i7]; + const tmp = stringifyFullArr(key, value2[key], stack, replacer, indent); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}": ${tmp}`; + separator = join3; + } + } + } + if (separator !== "") { + res += ` +${originalIndentation}`; + } else { + res = "{"; + } + res += "}"; + stack.pop(); + indentation = originalIndentation; + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function stringifyIndent(key, value2, stack, indent) { + var i7, res, join3; + const originalIndentation = indentation; + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + if (typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + if (typeof value2 !== "object") { + return stringifyIndent(key, value2, stack, indent); + } + if (value2 === null) { + return "null"; + } + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifyIndent(i7, value2[i7], stack, indent); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join3; + } + const tmp = stringifyIndent(i7, value2[i7], stack, indent); + res += tmp !== void 0 ? tmp : "null"; + if (indentation !== "") { + res += ` +${originalIndentation}`; + } + res += "]"; + stack.pop(); + indentation = originalIndentation; + return res; + } + var keys2 = insertSort(Object.keys(value2)); + if (keys2.length === 0) { + return "{}"; + } + stack.push(value2); + res = "{"; + indentation += indent; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + var separator = ""; + for (i7 = 0; i7 < keys2.length; i7++) { + key = keys2[i7]; + const tmp = stringifyIndent(key, value2[key], stack, indent); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}": ${tmp}`; + separator = join3; + } + } + if (separator !== "") { + res += ` +${originalIndentation}`; + } else { + res = "{"; + } + res += "}"; + stack.pop(); + indentation = originalIndentation; + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function stringifyReplacerArr(key, value2, stack, replacer) { + var i7, res; + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifyReplacerArr(i7, value2[i7], stack, replacer); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifyReplacerArr(i7, value2[i7], stack, replacer); + res += tmp !== void 0 ? tmp : "null"; + res += "]"; + stack.pop(); + return res; + } + if (replacer.length === 0) { + return "{}"; + } + stack.push(value2); + res = "{"; + var separator = ""; + for (i7 = 0; i7 < replacer.length; i7++) { + if (typeof replacer[i7] === "string" || typeof replacer[i7] === "number") { + key = replacer[i7]; + const tmp = stringifyReplacerArr(key, value2[key], stack, replacer); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}":${tmp}`; + separator = ","; + } + } + } + res += "}"; + stack.pop(); + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function stringifyReplacerFn(key, parent2, stack, replacer) { + var i7, res; + var value2 = parent2[key]; + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + value2 = replacer.call(parent2, key, value2); + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifyReplacerFn(i7, value2, stack, replacer); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifyReplacerFn(i7, value2, stack, replacer); + res += tmp !== void 0 ? tmp : "null"; + res += "]"; + stack.pop(); + return res; + } + var keys2 = insertSort(Object.keys(value2)); + if (keys2.length === 0) { + return "{}"; + } + stack.push(value2); + res = "{"; + var separator = ""; + for (i7 = 0; i7 < keys2.length; i7++) { + key = keys2[i7]; + const tmp = stringifyReplacerFn(key, value2, stack, replacer); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}":${tmp}`; + separator = ","; + } + } + res += "}"; + stack.pop(); + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function stringifySimple(key, value2, stack) { + var i7, res; + switch (typeof value2) { + case "object": + if (value2 === null) { + return "null"; + } + if (typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + if (typeof value2 !== "object") { + return stringifySimple(key, value2, stack); + } + if (value2 === null) { + return "null"; + } + } + for (i7 = 0; i7 < stack.length; i7++) { + if (stack[i7] === value2) { + return '"[Circular]"'; + } + } + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + stack.push(value2); + res = "["; + for (i7 = 0; i7 < value2.length - 1; i7++) { + const tmp2 = stringifySimple(i7, value2[i7], stack); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifySimple(i7, value2[i7], stack); + res += tmp !== void 0 ? tmp : "null"; + res += "]"; + stack.pop(); + return res; + } + var keys2 = insertSort(Object.keys(value2)); + if (keys2.length === 0) { + return "{}"; + } + stack.push(value2); + var separator = ""; + res = "{"; + for (i7 = 0; i7 < keys2.length; i7++) { + key = keys2[i7]; + const tmp = stringifySimple(key, value2[key], stack); + if (tmp !== void 0) { + res += `${separator}"${strEscape(key)}":${tmp}`; + separator = ","; + } + } + res += "}"; + stack.pop(); + return res; + case "string": + return `"${strEscape(value2)}"`; + case "number": + return isFinite(value2) ? String(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + } + } + function insertSort(arr) { + for (var i7 = 1; i7 < arr.length; i7++) { + const tmp = arr[i7]; + var j6 = i7; + while (j6 !== 0 && arr[j6 - 1] > tmp) { + arr[j6] = arr[j6 - 1]; + j6--; + } + arr[j6] = tmp; + } + return arr; + } + function stringify5(value2, replacer, spacer) { + var i7; + var indent = ""; + indentation = ""; + if (arguments.length > 1) { + if (typeof spacer === "number") { + for (i7 = 0; i7 < spacer; i7 += 1) { + indent += " "; + } + } else if (typeof spacer === "string") { + indent = spacer; + } + if (indent !== "") { + if (replacer !== void 0 && replacer !== null) { + if (typeof replacer === "function") { + return stringifyFullFn("", { "": value2 }, [], replacer, indent); + } + if (Array.isArray(replacer)) { + return stringifyFullArr("", value2, [], replacer, indent); + } + } + return stringifyIndent("", value2, [], indent); + } + if (typeof replacer === "function") { + return stringifyReplacerFn("", { "": value2 }, [], replacer); + } + if (Array.isArray(replacer)) { + return stringifyReplacerArr("", value2, [], replacer); + } + } + return stringifySimple("", value2, []); + } + } +}); + +// node_modules/safe-stable-stringify/index.js +var require_safe_stable_stringify = __commonJS({ + "node_modules/safe-stable-stringify/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var stringify5 = require_stable(); + module5.exports = stringify5; + stringify5.default = stringify5; + } +}); + +// node_modules/@stoplight/json/index.es.js +var index_es_exports2 = {}; +__export(index_es_exports2, { + BUNDLE_ROOT: () => Z, + ERRORS_ROOT: () => q, + KEYS: () => Ae, + bundleTarget: () => G, + decodePointer: () => U, + decodePointerFragment: () => Q, + decodePointerUriFragment: () => U, + decycle: () => X, + encodePointer: () => Y, + encodePointerFragment: () => x2, + encodePointerUriFragment: () => k, + encodeUriPointer: () => N, + extractPointerFromRef: () => ee, + extractSourceFromRef: () => V, + getFirstPrimitiveProperty: () => te, + getJsonPathForPosition: () => re, + getLastPathSegment: () => ne, + getLocationForJsonPath: () => oe, + hasRef: () => $, + isExternalRef: () => M, + isLocalRef: () => E, + isPlainObject: () => w, + parseTree: () => ae, + parseWithPointers: () => ie, + pathToPointer: () => P, + pointerToPath: () => K, + remapRefs: () => F, + renameObjectKey: () => le, + reparentBundleTarget: () => pe, + resolveExternalRef: () => ye, + resolveExternalRefWithLocation: () => ge, + resolveInlineRef: () => B, + resolveInlineRefWithLocation: () => z, + safeParse: () => de, + safeStringify: () => ve, + startsWith: () => be, + stringify: () => we, + toPropertyPath: () => Oe, + trapAccess: () => Ee, + traverse: () => D, + trimStart: () => Se +}); +function w(e10) { + if ("object" != typeof e10 || null === e10) + return false; + const t8 = Object.getPrototypeOf(e10); + return null === t8 || t8 === Object.prototype || "function" == typeof e10.constructor && Function.toString.call(Object) === Function.toString.call(e10.constructor); +} +function O(e10, t8, r8) { + if (!w(e10) && !Array.isArray(e10) || !(t8 in e10)) + throw new ReferenceError(`Could not resolve '${r8}'`); +} +function j(e10) { + if ("string" != typeof e10.$ref) + throw new TypeError("$ref should be a string"); +} +function N(e10) { + return e10.replace(_, encodeURIComponent); +} +function T(e10) { + try { + return decodeURIComponent(e10); + } catch (t8) { + return e10; + } +} +function F(e10, t8, r8) { + D(e10, { onProperty({ property: e11, propertyValue: n7, parent: o7 }) { + "$ref" === e11 && "string" == typeof n7 && n7.startsWith(t8) && (o7.$ref = `${r8}${n7.slice(t8.length)}`); + } }); +} +function W(e10, t8) { + return w(t8) && w(e10) && ("summary" in e10 || "description" in e10) ? Object.assign(Object.assign(Object.assign({}, t8), "description" in e10 ? { description: e10.description } : null), "summary" in e10 ? { summary: e10.summary } : null) : t8; +} +function* L(e10, t8, r8) { + A(e10.value) && (j(e10.value), yield [-1, e10.value]); + for (const [n7, o7] of t8.entries()) + O(e10.value, o7, r8), e10.value = e10.value[o7], A(e10.value) && (j(e10.value), yield [n7, e10.value]); +} +function B(e10, t8) { + return z(e10, t8).value; +} +function z(e10, t8) { + return function e11(t9, r8, n7, o7) { + if (null !== V(r8)) + throw new ReferenceError("Cannot resolve external references"); + const i7 = K(r8); + let a7 = [...i7]; + "#" === r8 && A(t9) && (j(t9), i7.unshift(...K(t9.$ref))); + const s7 = { value: t9 }; + for (const [c7, u7] of L(s7, i7, r8)) { + if (n7.includes(u7)) + return { source: null, location: null != o7 ? o7 : a7, value: n7[n7.length - 1] }; + n7.push(u7); + const r9 = e11(t9, u7.$ref, n7, a7); + s7.value = r9.value, (a7 = r9.location).push(...i7.slice(c7 + 1)); + } + return { source: null, location: a7, value: n7.length > 0 ? W(n7[n7.length - 1], s7.value) : s7.value }; + }(e10, t8, []); +} +function ne(e10) { + return Q(e10.split("/").pop() || ""); +} +function ae(e10, t8 = [], r8) { + const n7 = ce(e10); + let o7 = { type: "array", offset: -1, length: -1, children: [], parent: void 0 }, i7 = null, a7 = []; + const s7 = /* @__PURE__ */ new WeakMap(), c7 = []; + function u7(e11) { + "property" === o7.type && (o7.length = e11 - o7.offset, o7 = o7.parent); + } + function l7(e11, t9, r9) { + return { start: { line: e11, character: t9 }, end: { line: e11, character: t9 + r9 } }; + } + function f8(e11) { + return o7.children.push(e11), e11; + } + function p7(e11) { + Array.isArray(a7) ? a7.push(e11) : null !== i7 && (a7[i7] = e11); + } + function m7(e11) { + p7(e11), c7.push(a7), a7 = e11, i7 = null; + } + function b8() { + a7 = c7.pop(); + } + visit4(e10, { onObjectBegin: (e11, t9, n8, i8) => { + o7 = f8({ type: "object", offset: e11, length: -1, parent: o7, children: [], range: l7(n8, i8, t9) }), false === r8.ignoreDuplicateKeys && s7.set(o7, []), m7(function(e12) { + return e12 ? createObj({}) : {}; + }(true === r8.preserveKeyOrder)); + }, onObjectProperty: (e11, n8, c8, u8, p8) => { + if ((o7 = f8({ type: "property", offset: n8, length: -1, parent: o7, children: [] })).children.push({ type: "string", value: e11, offset: n8, length: c8, parent: o7 }), false === r8.ignoreDuplicateKeys) { + const r9 = s7.get(o7.parent); + r9 && (0 !== r9.length && r9.includes(e11) ? t8.push({ range: l7(u8, p8, c8), message: "DuplicateKey", severity: DiagnosticSeverity.Error, path: ue(o7), code: 20 }) : r9.push(e11)); + } + true === r8.preserveKeyOrder && function(e12, t9) { + if (!(t9 in e12)) + return; + const r9 = getOrder(e12), n9 = r9.indexOf(t9); + -1 !== n9 && (r9.splice(n9, 1), r9.push(t9)); + }(a7, e11), i7 = e11; + }, onObjectEnd: (e11, t9, n8, i8) => { + false === r8.ignoreDuplicateKeys && s7.delete(o7), o7.length = e11 + t9 - o7.offset, o7.range && (o7.range.end.line = n8, o7.range.end.character = i8 + t9), o7 = o7.parent, u7(e11 + t9), b8(); + }, onArrayBegin: (e11, t9, r9, n8) => { + o7 = f8({ type: "array", offset: e11, length: -1, parent: o7, children: [], range: l7(r9, n8, t9) }), m7([]); + }, onArrayEnd: (e11, t9, r9, n8) => { + o7.length = e11 + t9 - o7.offset, o7.range && (o7.range.end.line = r9, o7.range.end.character = n8 + t9), o7 = o7.parent, u7(e11 + t9), b8(); + }, onLiteralValue: (e11, t9, r9, n8, i8) => { + f8({ type: se(e11), offset: t9, length: r9, parent: o7, value: e11, range: l7(n8, i8, r9) }), u7(t9 + r9), p7(e11); + }, onSeparator: (e11, t9) => { + "property" === o7.type && (":" === e11 ? o7.colonOffset = t9 : "," === e11 && u7(t9)); + }, onError: (e11, r9, n8, o8, i8) => { + t8.push({ range: l7(o8, i8, n8), message: printParseErrorCode(e11), severity: DiagnosticSeverity.Error, code: e11 }); + } }, r8); + const w6 = o7.children[0]; + return w6 && delete w6.parent, { ast: w6, data: a7[0], lineMap: n7 }; +} +function se(e10) { + switch (typeof e10) { + case "boolean": + return "boolean"; + case "number": + return "number"; + case "string": + return "string"; + default: + return "null"; + } +} +function ue(e10, t8 = []) { + return "property" === e10.type && t8.unshift(e10.children[0].value), void 0 !== e10.parent ? ("array" === e10.parent.type && void 0 !== e10.parent.parent && t8.unshift(e10.parent.children.indexOf(e10)), ue(e10.parent, t8)) : t8; +} +function fe(e10) { + return w(e10) || Array.isArray(e10); +} +function pe(e10, t8, r8) { + if (r8.length <= 1 || t8.length <= 1) + throw Error("Source/target path must not be empty and point at root"); + if (0 === t8.indexOf(r8)) + throw Error("Target path cannot be contained within source"); + const n7 = K(t8); + let o7 = e10; + for (const e11 of n7) { + if (!fe(o7)) + return; + o7 = o7[e11]; + } + if (!fe(o7)) + return; + const i7 = K(r8); + let a7 = e10; + for (const [e11, t9] of i7.entries()) { + if (!fe(a7) || t9 in a7) + return; + const r9 = e11 === i7.length - 1 ? o7 : {}; + a7[t9] = r9, a7 = r9; + } + delete e10[n7[0]], function e11(t9, r9, n8) { + for (const o8 of Object.keys(t9)) { + const i8 = t9[o8]; + if ("$ref" !== o8) + fe(i8) && e11(i8, r9, n8); + else { + if ("string" != typeof i8 || !E(i8)) + continue; + 0 === i8.indexOf(r9) && (t9[o8] = i8.replace(r9, n8)); + } + } + }(e10, t8, r8); +} +async function he(e10, t8, r8, n7, o7) { + let i7 = function(e11, t9) { + const r9 = V(t9); + return null === r9 ? e11 : s(r9) ? r9 : p(a(e11), r9); + }(t8, r8); + const a7 = ee(r8) || "#", l7 = await e10[i7], f8 = K(a7); + let p7 = [...f8]; + const h8 = { value: l7 }; + for (const [r9, s7] of L(h8, f8, a7)) { + if (n7.includes(s7)) + return { source: t8, location: null != o7 ? o7 : p7, value: n7[n7.length - 1] }; + n7.push(s7); + const a8 = await he(e10, i7, s7.$ref, n7, p7); + ({ source: i7, location: p7 } = a8), h8.value = a8.value, p7.push(...f8.slice(r9 + 1)); + } + return { source: i7, location: p7, value: n7.length > 0 ? W(n7[n7.length - 1], h8.value) : h8.value }; +} +async function ye(e10, t8, r8) { + return (await ge(e10, t8, r8)).value; +} +function ge(e10, t8, r8) { + return he(e10, t8, r8, []); +} +function Oe(e10) { + return e10.replace(/^(\/|#\/)/, "").split("/").map(Q).map(je).join("."); +} +function je(e10) { + return e10.includes(".") ? `["${e10.replace(/"/g, '\\"')}"]` : e10; +} +function Se(e10, t8) { + if ("string" == typeof e10 && "string" == typeof t8) + return trimStart_default(e10, t8); + if (!(e10 && Array.isArray(e10) && e10.length && t8 && Array.isArray(t8) && t8.length)) + return e10; + let r8 = 0; + for (const n7 in e10) + if (e10.hasOwnProperty(n7)) { + if (e10[n7] !== t8[n7]) + break; + r8++; + } + return e10.slice(r8); +} +var import_safe_stable_stringify, A, $, E, S, x2, _, k, P, I, R, U, K, J, C, D, M, V, Z, q, G, H, Q, X, Y, ee, te, re, oe, ie, ce, le, de, me, ve, be, we, Ae, $e, Ee; +var init_index_es2 = __esm({ + "node_modules/@stoplight/json/index.es.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_lodash(); + init_index_es(); + init_main(); + init_src(); + init_dist2(); + import_safe_stable_stringify = __toESM(require_safe_stable_stringify()); + A = (e10) => w(e10) && "$ref" in e10; + $ = (e10) => A(e10) && "string" == typeof e10.$ref; + E = (e10) => e10.length > 0 && ("#" === e10 || /^#\S*$/.test(e10)); + S = (e10, t8, r8) => { + const n7 = e10.toString(); + let o7 = "", i7 = n7, a7 = 0, s7 = i7.indexOf(t8); + for (; s7 > -1; ) + o7 += n7.substring(a7, a7 + s7) + r8, i7 = i7.substring(s7 + t8.length, i7.length), a7 += s7 + t8.length, s7 = i7.indexOf(t8); + return i7.length > 0 && (o7 += n7.substring(n7.length - i7.length, n7.length)), o7; + }; + x2 = (e10) => "number" == typeof e10 ? e10 : S(S(e10, "~", "~0"), "/", "~1"); + _ = /[^a-zA–Z0–9_.!~*'()\/\-\u{D800}-\u{DFFF}]/gu; + k = (e10) => { + const t8 = x2(e10); + return "number" == typeof t8 ? t8 : N(t8); + }; + P = (e10) => I(e10); + I = (e10) => { + if (e10 && "object" != typeof e10) + throw new TypeError("Invalid type: path must be an array of segments."); + return 0 === e10.length ? "#" : `#/${e10.map(k).join("/")}`; + }; + R = /%[0-9a-f]+/gi; + U = (e10) => { + let t8; + try { + t8 = decodeURIComponent(e10); + } catch (r8) { + t8 = e10.replace(R, T); + } + return S(S(t8, "~1", "/"), "~0", "~"); + }; + K = (e10) => J(e10); + J = (e10) => { + if ("string" != typeof e10) + throw new TypeError("Invalid type: JSON Pointers are represented as strings."); + if (0 === e10.length || "#" !== e10[0]) + throw new URIError("Invalid JSON Pointer syntax; URI fragment identifiers must begin with a hash."); + if (1 === e10.length) + return []; + if ("/" !== e10[1]) + throw new URIError("Invalid JSON Pointer syntax."); + return ((e11) => { + const t8 = e11.length, r8 = []; + let n7 = -1; + for (; ++n7 < t8; ) + r8.push(U(e11[n7])); + return r8; + })(e10.substring(2).split("/")); + }; + C = (e10, t8, r8) => { + const n7 = { value: e10, path: r8 }; + t8.onEnter && t8.onEnter(n7); + for (const n8 of Object.keys(e10)) { + const o7 = e10[n8]; + t8.onProperty && t8.onProperty({ parent: e10, parentPath: r8, property: n8, propertyValue: o7 }), "object" == typeof o7 && null !== o7 && C(o7, t8, r8.concat(n8)); + } + t8.onLeave && t8.onLeave(n7); + }; + D = (e10, t8) => { + "object" == typeof e10 && null !== e10 && C(e10, "function" == typeof t8 ? { onProperty: t8 } : t8, []); + }; + M = (e10) => e10.length > 0 && "#" !== e10[0]; + V = (e10) => { + if ("string" != typeof e10 || 0 === e10.length || !M(e10)) + return null; + const t8 = e10.indexOf("#"); + return -1 === t8 ? e10 : e10.slice(0, t8); + }; + Z = "#/__bundled__"; + q = "#/__errors__"; + G = ({ document: t8, path: r8, bundleRoot: n7 = "#/__bundled__", errorsRoot: o7 = "#/__errors__", cloneDocument: i7 = true, keyProvider: a7 }, s7) => { + if (r8 === n7 || r8 === o7) + throw new Error("Roots do not make any sense"); + const c7 = i7 ? cloneDeep_default(t8) : t8; + return H(c7, K(n7), K(o7), r8, a7)(r8, { [r8]: true }, s7); + }; + H = (e10, a7, s7, c7, u7) => { + const l7 = /* @__PURE__ */ new Set(), f8 = (p7, h8, y7, g7 = {}, d7 = {}, m7 = {}) => { + const v8 = K(p7), b8 = get_default(e10, v8); + D(y7 || b8, { onEnter: ({ value: s8 }) => { + if ($(s8) && E(s8.$ref)) { + const y8 = s8.$ref; + if (m7[y8]) + return; + if (y8 === p7 && (g7[y8] = "#"), g7[y8]) + return void (s8.$ref = g7[y8]); + let v9, b9, w7, O7, j6; + try { + let r8; + v9 = K(y8), u7 && (r8 = u7({ document: e10, path: v9 })), r8 || (r8 = (({ document: e11, path: r9 }) => { + if (0 === r9.length) + return "root"; + if (Array.isArray(get_default(e11, r9.slice(0, -1)))) + return `${r9[r9.length - 2]}_${r9[r9.length - 1]}`; + return String(r9[r9.length - 1]); + })({ document: e10, path: v9 })), w7 = r8; + let n7 = 1; + for (; l7.has(w7); ) + if (w7 = `${r8}_${++n7}`, n7 > 20) + throw new Error(`Keys ${r8}_2 through ${r8}_20 already taken.`); + l7.add(w7), b9 = [...a7, w7], O7 = P(b9); + } catch (e11) { + m7[y8] = e11 instanceof Error ? e11.message : String(e11); + } + if (!v9 || !b9 || !O7) + return; + if ("object" == typeof e10 && null !== e10 && !(j6 = get_default(e10, v9))) + try { + j6 = B(Object(e10), y8); + } catch (e11) { + } + void 0 !== j6 && (g7[y8] = O7, s8.$ref = O7, has_default(d7, b9) || (Array.isArray(j6) ? set_default(d7, b9, new Array(j6.length).fill(null)) : "object" == typeof j6 && setWith_default(d7, b9, {}, Object), set_default(d7, b9, j6), "#" === y8 ? function(e11, t8, n7, o7) { + const a8 = n7.map((e12) => `[${JSON.stringify(e12)}]`).join(""), s9 = JSON.parse(JSON.stringify(omit_default(Object(e11), a8))), c8 = {}; + set_default(t8, o7, s9), set_default(s9, n7, c8), F(s9, "#", P(o7)), c8.$ref = "#"; + }(e10, d7, K(c7), b9) : h8[y8] || (h8[y8] = true, f8(p7, h8, j6, g7, d7, m7), h8[y8] = false))); + } + } }); + const w6 = get_default(d7, a7); + return w6 && Object.keys(w6).length && set_default(b8, a7, w6), (Object.keys(m7).length || has_default(e10, s7)) && set_default(b8, s7, has_default(e10, s7) ? get_default(e10, s7) : m7), b8; + }; + return f8; + }; + Q = (e10) => S(S(e10, "~1", "/"), "~0", "~"); + X = (e10, t8) => { + const r8 = /* @__PURE__ */ new WeakMap(); + return function e11(n7, o7) { + let i7; + if (t8 && (n7 = t8(n7)), w(n7) || Array.isArray(n7)) { + const t9 = r8.get(n7); + return t9 ? { $ref: t9 } : (r8.set(n7, P(o7)), Array.isArray(n7) ? i7 = n7.map((t10, r9) => e11(t10, [...o7, String(r9)])) : (i7 = {}, Object.keys(n7).forEach((t10) => { + i7[t10] = e11(n7[t10], [...o7, t10]); + })), r8.delete(n7), i7); + } + return n7; + }(e10, []); + }; + Y = (e10) => S(S(e10, "~", "~0"), "//", "/~1"); + ee = (e10) => { + if ("string" != typeof e10 || 0 === e10.length) + return null; + const t8 = e10.indexOf("#"); + return -1 === t8 ? null : e10.slice(t8); + }; + te = (e10) => { + const t8 = createScanner2(e10, true); + if (t8.scan(), 1 !== t8.getToken()) + return; + if (t8.scan(), 2 === t8.getToken()) + return; + if (10 !== t8.getToken()) + throw new SyntaxError("Unexpected character"); + const r8 = t8.getTokenValue(); + if (t8.scan(), 6 !== t8.getToken()) + throw new SyntaxError("Colon expected"); + switch (t8.scan(), t8.getToken()) { + case 10: + return [r8, t8.getTokenValue()]; + case 11: + return [r8, Number(t8.getTokenValue())]; + case 8: + return [r8, true]; + case 9: + return [r8, false]; + case 7: + return [r8, null]; + case 16: + throw new SyntaxError("Unexpected character"); + case 17: + throw new SyntaxError("Unexpected end of file"); + default: + return; + } + }; + re = ({ lineMap: e10, ast: t8 }, r8) => { + const n7 = e10[r8.line], o7 = e10[r8.line + 1]; + if (void 0 === n7) + return; + const i7 = findNodeAtOffset2(t8, void 0 === o7 ? n7 + r8.character : Math.min(o7, n7 + r8.character), true); + if (void 0 === i7) + return; + const a7 = getNodePath2(i7); + return 0 !== a7.length ? a7 : void 0; + }; + oe = ({ ast: e10 }, t8, r8 = false) => { + const n7 = function(e11, t9, r9) { + e: + for (const n8 of t9) { + const t10 = Number.isInteger(Number(n8)) ? Number(n8) : n8; + if ("string" == typeof t10 || "number" == typeof t10 && "array" !== e11.type) { + if ("object" !== e11.type || !Array.isArray(e11.children)) + return r9 ? e11 : void 0; + for (const r10 of e11.children) + if (Array.isArray(r10.children) && r10.children[0].value === String(t10) && 2 === r10.children.length) { + e11 = r10.children[1]; + continue e; + } + return r9 ? e11 : void 0; + } + if ("array" !== e11.type || t10 < 0 || !Array.isArray(e11.children) || t10 >= e11.children.length) + return r9 ? e11 : void 0; + e11 = e11.children[t10]; + } + return e11; + }(e10, t8, r8); + if (void 0 !== n7 && void 0 !== n7.range) + return { range: n7.range }; + }; + ie = (e10, t8 = { disallowComments: true }) => { + const r8 = [], { ast: n7, data: o7, lineMap: i7 } = ae(e10, r8, t8); + return { data: o7, diagnostics: r8, ast: n7, lineMap: i7 }; + }; + ce = (e10) => { + const t8 = [0]; + let r8 = 0; + for (; r8 < e10.length; r8++) + "\n" === e10[r8] && t8.push(r8 + 1); + return t8.push(r8 + 1), t8; + }; + le = (e10, t8, r8) => { + if (!e10 || !Object.hasOwnProperty.call(e10, t8) || t8 === r8) + return e10; + const n7 = {}; + for (const [o7, i7] of Object.entries(e10)) + o7 === t8 ? n7[r8] = i7 : o7 in n7 || (n7[o7] = i7); + return n7; + }; + de = (e10, t8) => { + if ("string" != typeof e10) + return e10; + try { + const r8 = me(e10); + return "string" == typeof r8 ? r8 : JSON.parse(e10, t8); + } catch (e11) { + return; + } + }; + me = (e10) => { + const t8 = Number(e10); + return Number.isFinite(t8) ? String(t8) === e10 ? t8 : e10 : NaN; + }; + ve = (e10, t8, r8) => { + if ("string" == typeof e10) + return e10; + try { + return JSON.stringify(e10, t8, r8); + } catch (n7) { + return (0, import_safe_stable_stringify.default)(e10, t8, r8); + } + }; + be = (e10, t8) => { + if (e10 instanceof Array) { + if (t8 instanceof Array) { + if (t8.length > e10.length) + return false; + for (const r8 in t8) { + if (!t8.hasOwnProperty(r8)) + continue; + const n7 = parseInt(e10[r8]), o7 = parseInt(t8[r8]); + if (isNaN(n7) && isNaN(o7)) { + if (e10[r8] !== t8[r8]) + return false; + } else if (n7 !== o7) + return false; + } + } + } else { + if ("string" != typeof e10) + return false; + if ("string" == typeof t8) + return e10.startsWith(t8); + } + return true; + }; + we = (e10, t8, r8) => { + const n7 = ve(e10, t8, r8); + if (void 0 === n7) + throw new Error("The value could not be stringified"); + return n7; + }; + Ae = Symbol.for(ORDER_KEY_ID); + $e = { ownKeys: (e10) => Ae in e10 ? e10[Ae] : Reflect.ownKeys(e10) }; + Ee = (e10) => new Proxy(e10, $e); + } +}); + +// node_modules/@stoplight/spectral-parsers/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports2 = {}; +__export(tslib_es6_exports2, { + __addDisposableResource: () => __addDisposableResource2, + __assign: () => __assign2, + __asyncDelegator: () => __asyncDelegator2, + __asyncGenerator: () => __asyncGenerator2, + __asyncValues: () => __asyncValues2, + __await: () => __await2, + __awaiter: () => __awaiter3, + __classPrivateFieldGet: () => __classPrivateFieldGet2, + __classPrivateFieldIn: () => __classPrivateFieldIn2, + __classPrivateFieldSet: () => __classPrivateFieldSet2, + __createBinding: () => __createBinding2, + __decorate: () => __decorate2, + __disposeResources: () => __disposeResources2, + __esDecorate: () => __esDecorate2, + __exportStar: () => __exportStar2, + __extends: () => __extends2, + __generator: () => __generator2, + __importDefault: () => __importDefault2, + __importStar: () => __importStar2, + __makeTemplateObject: () => __makeTemplateObject2, + __metadata: () => __metadata2, + __param: () => __param2, + __propKey: () => __propKey2, + __read: () => __read2, + __rest: () => __rest2, + __runInitializers: () => __runInitializers2, + __setFunctionName: () => __setFunctionName2, + __spread: () => __spread2, + __spreadArray: () => __spreadArray2, + __spreadArrays: () => __spreadArrays2, + __values: () => __values2, + default: () => tslib_es6_default2 +}); +function __extends2(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics2(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest2(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate2(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param2(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate2(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers2(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey2(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName2(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata2(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter3(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator2(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar2(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding2(o7, m7, p7); +} +function __values2(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read2(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread2() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read2(arguments[i7])); + return ar; +} +function __spreadArrays2() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray2(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await2(v8) { + return this instanceof __await2 ? (this.v = v8, this) : new __await2(v8); +} +function __asyncGenerator2(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await2 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator2(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await2(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues2(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values2 === "function" ? __values2(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject2(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar2(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding2(result2, mod2, k6); + } + __setModuleDefault2(result2, mod2); + return result2; +} +function __importDefault2(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet2(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet2(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn2(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); +} +function __addDisposableResource2(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources2(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError2(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; +var init_tslib_es62 = __esm({ + "node_modules/@stoplight/spectral-parsers/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics2 = function(d7, b8) { + extendStatics2 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics2(d7, b8); + }; + __assign2 = function() { + __assign2 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign2.apply(this, arguments); + }; + __createBinding2 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault2 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default2 = { + __extends: __extends2, + __assign: __assign2, + __rest: __rest2, + __decorate: __decorate2, + __param: __param2, + __metadata: __metadata2, + __awaiter: __awaiter3, + __generator: __generator2, + __createBinding: __createBinding2, + __exportStar: __exportStar2, + __values: __values2, + __read: __read2, + __spread: __spread2, + __spreadArrays: __spreadArrays2, + __spreadArray: __spreadArray2, + __await: __await2, + __asyncGenerator: __asyncGenerator2, + __asyncDelegator: __asyncDelegator2, + __asyncValues: __asyncValues2, + __makeTemplateObject: __makeTemplateObject2, + __importStar: __importStar2, + __importDefault: __importDefault2, + __classPrivateFieldGet: __classPrivateFieldGet2, + __classPrivateFieldSet: __classPrivateFieldSet2, + __classPrivateFieldIn: __classPrivateFieldIn2, + __addDisposableResource: __addDisposableResource2, + __disposeResources: __disposeResources2 + }; + } +}); + +// node_modules/@stoplight/spectral-parsers/dist/json.js +var require_json2 = __commonJS({ + "node_modules/@stoplight/spectral-parsers/dist/json.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Json = exports28.parseJson = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var parseJson = (input) => (0, json_1.parseWithPointers)(input, { + ignoreDuplicateKeys: false, + preserveKeyOrder: true + }); + exports28.parseJson = parseJson; + exports28.Json = { + parse: exports28.parseJson, + getLocationForJsonPath: json_1.getLocationForJsonPath, + trapAccess: json_1.trapAccess + }; + } +}); + +// node_modules/@stoplight/yaml/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports3 = {}; +__export(tslib_es6_exports3, { + __addDisposableResource: () => __addDisposableResource3, + __assign: () => __assign3, + __asyncDelegator: () => __asyncDelegator3, + __asyncGenerator: () => __asyncGenerator3, + __asyncValues: () => __asyncValues3, + __await: () => __await3, + __awaiter: () => __awaiter4, + __classPrivateFieldGet: () => __classPrivateFieldGet3, + __classPrivateFieldIn: () => __classPrivateFieldIn3, + __classPrivateFieldSet: () => __classPrivateFieldSet3, + __createBinding: () => __createBinding3, + __decorate: () => __decorate3, + __disposeResources: () => __disposeResources3, + __esDecorate: () => __esDecorate3, + __exportStar: () => __exportStar3, + __extends: () => __extends3, + __generator: () => __generator3, + __importDefault: () => __importDefault3, + __importStar: () => __importStar3, + __makeTemplateObject: () => __makeTemplateObject3, + __metadata: () => __metadata3, + __param: () => __param3, + __propKey: () => __propKey3, + __read: () => __read3, + __rest: () => __rest3, + __runInitializers: () => __runInitializers3, + __setFunctionName: () => __setFunctionName3, + __spread: () => __spread3, + __spreadArray: () => __spreadArray3, + __spreadArrays: () => __spreadArrays3, + __values: () => __values3, + default: () => tslib_es6_default3 +}); +function __extends3(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics3(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest3(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate3(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param3(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate3(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers3(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey3(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName3(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata3(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter4(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator3(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar3(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding3(o7, m7, p7); +} +function __values3(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read3(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread3() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read3(arguments[i7])); + return ar; +} +function __spreadArrays3() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray3(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await3(v8) { + return this instanceof __await3 ? (this.v = v8, this) : new __await3(v8); +} +function __asyncGenerator3(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await3 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator3(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await3(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues3(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values3 === "function" ? __values3(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject3(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar3(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding3(result2, mod2, k6); + } + __setModuleDefault3(result2, mod2); + return result2; +} +function __importDefault3(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet3(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet3(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn3(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); +} +function __addDisposableResource3(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources3(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError3(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; +var init_tslib_es63 = __esm({ + "node_modules/@stoplight/yaml/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics3 = function(d7, b8) { + extendStatics3 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics3(d7, b8); + }; + __assign3 = function() { + __assign3 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign3.apply(this, arguments); + }; + __createBinding3 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault3 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default3 = { + __extends: __extends3, + __assign: __assign3, + __rest: __rest3, + __decorate: __decorate3, + __param: __param3, + __metadata: __metadata3, + __awaiter: __awaiter4, + __generator: __generator3, + __createBinding: __createBinding3, + __exportStar: __exportStar3, + __values: __values3, + __read: __read3, + __spread: __spread3, + __spreadArrays: __spreadArrays3, + __spreadArray: __spreadArray3, + __await: __await3, + __asyncGenerator: __asyncGenerator3, + __asyncDelegator: __asyncDelegator3, + __asyncValues: __asyncValues3, + __makeTemplateObject: __makeTemplateObject3, + __importStar: __importStar3, + __importDefault: __importDefault3, + __classPrivateFieldGet: __classPrivateFieldGet3, + __classPrivateFieldSet: __classPrivateFieldSet3, + __classPrivateFieldIn: __classPrivateFieldIn3, + __addDisposableResource: __addDisposableResource3, + __disposeResources: __disposeResources3 + }; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/yamlAST.js +var require_yamlAST = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/yamlAST.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var Kind; + (function(Kind2) { + Kind2[Kind2["SCALAR"] = 0] = "SCALAR"; + Kind2[Kind2["MAPPING"] = 1] = "MAPPING"; + Kind2[Kind2["MAP"] = 2] = "MAP"; + Kind2[Kind2["SEQ"] = 3] = "SEQ"; + Kind2[Kind2["ANCHOR_REF"] = 4] = "ANCHOR_REF"; + Kind2[Kind2["INCLUDE_REF"] = 5] = "INCLUDE_REF"; + })(Kind = exports28.Kind || (exports28.Kind = {})); + function newMapping(key, value2) { + var end = value2 ? value2.endPosition : key.endPosition + 1; + var node = { + key, + value: value2, + startPosition: key.startPosition, + endPosition: end, + kind: Kind.MAPPING, + parent: null, + errors: [] + }; + return node; + } + exports28.newMapping = newMapping; + function newAnchorRef(key, start, end, value2) { + return { + errors: [], + referencesAnchor: key, + value: value2, + startPosition: start, + endPosition: end, + kind: Kind.ANCHOR_REF, + parent: null + }; + } + exports28.newAnchorRef = newAnchorRef; + function newScalar(v8 = "") { + const result2 = { + errors: [], + startPosition: -1, + endPosition: -1, + value: "" + v8, + kind: Kind.SCALAR, + parent: null, + doubleQuoted: false, + rawValue: "" + v8 + }; + if (typeof v8 !== "string") { + result2.valueObject = v8; + } + return result2; + } + exports28.newScalar = newScalar; + function newItems() { + return { + errors: [], + startPosition: -1, + endPosition: -1, + items: [], + kind: Kind.SEQ, + parent: null + }; + } + exports28.newItems = newItems; + function newSeq() { + return newItems(); + } + exports28.newSeq = newSeq; + function newMap(mappings) { + return { + errors: [], + startPosition: -1, + endPosition: -1, + mappings: mappings ? mappings : [], + kind: Kind.MAP, + parent: null + }; + } + exports28.newMap = newMap; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/common.js +var require_common = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/common.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function isNothing2(subject) { + return typeof subject === "undefined" || null === subject; + } + exports28.isNothing = isNothing2; + function isObject8(subject) { + return typeof subject === "object" && null !== subject; + } + exports28.isObject = isObject8; + function toArray3(sequence) { + if (Array.isArray(sequence)) { + return sequence; + } else if (isNothing2(sequence)) { + return []; + } + return [sequence]; + } + exports28.toArray = toArray3; + function extend3(target, source) { + var index4, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index4 = 0, length = sourceKeys.length; index4 < length; index4 += 1) { + key = sourceKeys[index4]; + target[key] = source[key]; + } + } + return target; + } + exports28.extend = extend3; + function repeat3(string2, count2) { + var result2 = "", cycle; + for (cycle = 0; cycle < count2; cycle += 1) { + result2 += string2; + } + return result2; + } + exports28.repeat = repeat3; + function isNegativeZero2(number) { + return 0 === number && Number.NEGATIVE_INFINITY === 1 / number; + } + exports28.isNegativeZero = isNegativeZero2; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js +var require_exception = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var YAMLException2 = class _YAMLException { + constructor(reason, mark = null, isWarning = false) { + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = this.toString(false); + this.isWarning = isWarning; + } + static isInstance(instance) { + if (instance != null && instance.getClassIdentifier && typeof instance.getClassIdentifier == "function") { + for (let currentIdentifier of instance.getClassIdentifier()) { + if (currentIdentifier == _YAMLException.CLASS_IDENTIFIER) + return true; + } + } + return false; + } + getClassIdentifier() { + var superIdentifiers = []; + return superIdentifiers.concat(_YAMLException.CLASS_IDENTIFIER); + } + toString(compact2 = false) { + var result2; + result2 = "JS-YAML: " + (this.reason || "(unknown reason)"); + if (!compact2 && this.mark) { + result2 += " " + this.mark.toString(); + } + return result2; + } + }; + YAMLException2.CLASS_IDENTIFIER = "yaml-ast-parser.YAMLException"; + module5.exports = YAMLException2; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js +var require_mark = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common(); + var Mark = class { + constructor(name2, buffer2, position, line, column) { + this.name = name2; + this.buffer = buffer2; + this.position = position; + this.line = line; + this.column = column; + } + getSnippet(indent = 0, maxLength = 75) { + var head2, start, tail2, end, snippet2; + if (!this.buffer) { + return null; + } + indent = indent || 4; + maxLength = maxLength || 75; + head2 = ""; + start = this.position; + while (start > 0 && -1 === "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1))) { + start -= 1; + if (this.position - start > maxLength / 2 - 1) { + head2 = " ... "; + start += 5; + break; + } + } + tail2 = ""; + end = this.position; + while (end < this.buffer.length && -1 === "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end))) { + end += 1; + if (end - this.position > maxLength / 2 - 1) { + tail2 = " ... "; + end -= 5; + break; + } + } + snippet2 = this.buffer.slice(start, end); + return common3.repeat(" ", indent) + head2 + snippet2 + tail2 + "\n" + common3.repeat(" ", indent + this.position - start + head2.length) + "^"; + } + toString(compact2 = true) { + var snippet2, where = ""; + if (this.name) { + where += 'in "' + this.name + '" '; + } + where += "at line " + (this.line + 1) + ", column " + (this.column + 1); + if (!compact2) { + snippet2 = this.getSnippet(); + if (snippet2) { + where += ":\n" + snippet2; + } + } + return where; + } + }; + module5.exports = Mark; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type.js +var require_type = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var YAMLException2 = require_exception(); + var TYPE_CONSTRUCTOR_OPTIONS2 = [ + "kind", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS2 = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases2(map4) { + var result2 = {}; + if (null !== map4) { + Object.keys(map4).forEach(function(style) { + map4[style].forEach(function(alias) { + result2[String(alias)] = style; + }); + }); + } + return result2; + } + var Type3 = class { + constructor(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name2) { + if (-1 === TYPE_CONSTRUCTOR_OPTIONS2.indexOf(name2)) { + throw new YAMLException2('Unknown option "' + name2 + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.styleAliases = compileStyleAliases2(options["styleAliases"] || null); + if (-1 === YAML_NODE_KINDS2.indexOf(this.kind)) { + throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + }; + exports28.Type = Type3; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js +var require_schema2 = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var common3 = require_common(); + var YAMLException2 = require_exception(); + var type_1 = require_type(); + function compileList2(schema8, name2, result2) { + var exclude = []; + schema8.include.forEach(function(includedSchema) { + result2 = compileList2(includedSchema, name2, result2); + }); + schema8[name2].forEach(function(currentType) { + result2.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag) { + exclude.push(previousIndex); + } + }); + result2.push(currentType); + }); + return result2.filter(function(type3, index4) { + return -1 === exclude.indexOf(index4); + }); + } + function compileMap2() { + var result2 = {}, index4, length; + function collectType(type3) { + result2[type3.tag] = type3; + } + for (index4 = 0, length = arguments.length; index4 < length; index4 += 1) { + arguments[index4].forEach(collectType); + } + return result2; + } + var Schema9 = class { + constructor(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + this.implicit.forEach(function(type3) { + if (type3.loadKind && "scalar" !== type3.loadKind) { + throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + }); + this.compiledImplicit = compileList2(this, "implicit", []); + this.compiledExplicit = compileList2(this, "explicit", []); + this.compiledTypeMap = compileMap2(this.compiledImplicit, this.compiledExplicit); + } + }; + exports28.Schema = Schema9; + Schema9.DEFAULT = null; + Schema9.create = function createSchema() { + var schemas5, types3; + switch (arguments.length) { + case 1: + schemas5 = Schema9.DEFAULT; + types3 = arguments[0]; + break; + case 2: + schemas5 = arguments[0]; + types3 = arguments[1]; + break; + default: + throw new YAMLException2("Wrong number of arguments for Schema.create function"); + } + schemas5 = common3.toArray(schemas5); + types3 = common3.toArray(types3); + if (!schemas5.every(function(schema8) { + return schema8 instanceof Schema9; + })) { + throw new YAMLException2("Specified list of super schemas (or a single Schema object) contains a non-Schema object."); + } + if (!types3.every(function(type3) { + return type3 instanceof type_1.Type; + })) { + throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + return new Schema9({ + include: schemas5, + explicit: types3 + }); + }; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js +var require_str = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + module5.exports = new type_1.Type("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return null !== data ? data : ""; + } + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js +var require_seq = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + module5.exports = new type_1.Type("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return null !== data ? data : []; + } + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js +var require_map = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + module5.exports = new type_1.Type("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return null !== data ? data : {}; + } + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js +var require_failsafe = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var schema_1 = require_schema2(); + module5.exports = new schema_1.Schema({ + explicit: [ + require_str(), + require_seq(), + require_map() + ] + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js +var require_null = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + function resolveYamlNull2(data) { + if (null === data) { + return true; + } + var max2 = data.length; + return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); + } + function constructYamlNull2() { + return null; + } + function isNull4(object) { + return null === object; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull2, + construct: constructYamlNull2, + predicate: isNull4, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js +var require_bool = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + function resolveYamlBoolean2(data) { + if (null === data) { + return false; + } + var max2 = data.length; + return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); + } + function constructYamlBoolean2(data) { + return data === "true" || data === "True" || data === "TRUE"; + } + function isBoolean4(object) { + return "[object Boolean]" === Object.prototype.toString.call(object); + } + module5.exports = new type_1.Type("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean2, + construct: constructYamlBoolean2, + predicate: isBoolean4, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js +var require_int = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common(); + var type_1 = require_type(); + function isHexCode2(c7) { + return 48 <= c7 && c7 <= 57 || 65 <= c7 && c7 <= 70 || 97 <= c7 && c7 <= 102; + } + function isOctCode2(c7) { + return 48 <= c7 && c7 <= 55; + } + function isDecCode2(c7) { + return 48 <= c7 && c7 <= 57; + } + function resolveYamlInteger2(data) { + if (null === data) { + return false; + } + var max2 = data.length, index4 = 0, hasDigits = false, ch; + if (!max2) { + return false; + } + ch = data[index4]; + if (ch === "-" || ch === "+") { + ch = data[++index4]; + } + if (ch === "0") { + if (index4 + 1 === max2) { + return true; + } + ch = data[++index4]; + if (ch === "b") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") { + continue; + } + if (ch !== "0" && ch !== "1") { + return false; + } + hasDigits = true; + } + return hasDigits; + } + if (ch === "x") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") { + continue; + } + if (!isHexCode2(data.charCodeAt(index4))) { + return false; + } + hasDigits = true; + } + return hasDigits; + } + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") { + continue; + } + if (!isOctCode2(data.charCodeAt(index4))) { + hasDigits = false; + break; + } + hasDigits = true; + } + if (hasDigits) { + return hasDigits; + } + } + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") { + continue; + } + if (ch === ":") { + break; + } + if (!isDecCode2(data.charCodeAt(index4))) { + return false; + } + hasDigits = true; + } + if (!hasDigits) { + return false; + } + if (ch !== ":") { + return true; + } + return /^(:[0-5]?[0-9])+$/.test(data.slice(index4)); + } + function constructYamlInteger2(data) { + var value2 = data, sign = 1, ch, base, digits = []; + if (value2.indexOf("_") !== -1) { + value2 = value2.replace(/_/g, ""); + } + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") { + sign = -1; + } + value2 = value2.slice(1); + ch = value2[0]; + } + if ("0" === value2) { + return 0; + } + if (ch === "0") { + if (value2[1] === "b") { + return sign * parseInt(value2.slice(2), 2); + } + if (value2[1] === "x") { + return sign * parseInt(value2, 16); + } + return sign * parseInt(value2, 8); + } + if (value2.indexOf(":") !== -1) { + value2.split(":").forEach(function(v8) { + digits.unshift(parseInt(v8, 10)); + }); + value2 = 0; + base = 1; + digits.forEach(function(d7) { + value2 += d7 * base; + base *= 60; + }); + return sign * value2; + } + return sign * parseInt(value2, 10); + } + function isInteger3(object) { + const type3 = Object.prototype.toString.call(object); + return "[object Number]" === type3 && (0 === object % 1 && !common3.isNegativeZero(object)) || "[object BigInt]" === type3; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger2, + construct: constructYamlInteger2, + predicate: isInteger3, + represent: { + binary: function(object) { + return "0b" + object.toString(2); + }, + octal: function(object) { + return "0" + object.toString(8); + }, + decimal: function(object) { + return object.toString(10); + }, + hexadecimal: function(object) { + return "0x" + object.toString(16).toUpperCase(); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js +var require_float = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common(); + var type_1 = require_type(); + var YAML_FLOAT_PATTERN2 = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"); + function resolveYamlFloat2(data) { + if (null === data) { + return false; + } + var value2, sign, base, digits; + if (!YAML_FLOAT_PATTERN2.test(data)) { + return false; + } + return true; + } + function constructYamlFloat2(data) { + var value2, sign, base, digits; + value2 = data.replace(/_/g, "").toLowerCase(); + sign = "-" === value2[0] ? -1 : 1; + digits = []; + if (0 <= "+-".indexOf(value2[0])) { + value2 = value2.slice(1); + } + if (".inf" === value2) { + return 1 === sign ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (".nan" === value2) { + return NaN; + } else if (0 <= value2.indexOf(":")) { + value2.split(":").forEach(function(v8) { + digits.unshift(parseFloat(v8, 10)); + }); + value2 = 0; + base = 1; + digits.forEach(function(d7) { + value2 += d7 * base; + base *= 60; + }); + return sign * value2; + } + return sign * parseFloat(value2, 10); + } + function representYamlFloat2(object, style) { + if (isNaN(object)) { + switch (style) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common3.isNegativeZero(object)) { + return "-0.0"; + } + return object.toString(10); + } + function isFloat2(object) { + return "[object Number]" === Object.prototype.toString.call(object) && (0 !== object % 1 || common3.isNegativeZero(object)); + } + module5.exports = new type_1.Type("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat2, + construct: constructYamlFloat2, + predicate: isFloat2, + represent: representYamlFloat2, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js +var require_json3 = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var schema_1 = require_schema2(); + module5.exports = new schema_1.Schema({ + include: [ + require_failsafe() + ], + implicit: [ + require_null(), + require_bool(), + require_int(), + require_float() + ] + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js +var require_core5 = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var schema_1 = require_schema2(); + module5.exports = new schema_1.Schema({ + include: [ + require_json3() + ] + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js +var require_timestamp = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + var YAML_TIMESTAMP_REGEXP2 = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$"); + function resolveYamlTimestamp2(data) { + if (null === data) { + return false; + } + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_TIMESTAMP_REGEXP2.exec(data); + if (null === match) { + return false; + } + return true; + } + function constructYamlTimestamp2(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_TIMESTAMP_REGEXP2.exec(data); + if (null === match) { + throw new Error("Date resolve error"); + } + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { + fraction = fraction + "0"; + } + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if ("-" === match[9]) { + delta = -delta; + } + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) { + date.setTime(date.getTime() - delta); + } + return date; + } + function representYamlTimestamp2(object) { + return object.toISOString(); + } + module5.exports = new type_1.Type("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp2, + construct: constructYamlTimestamp2, + instanceOf: Date, + represent: representYamlTimestamp2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js +var require_merge = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + function resolveYamlMerge2(data) { + return "<<" === data || null === data; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js +var require_binary = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var NodeBuffer = (init_buffer(), __toCommonJS(buffer_exports)).Buffer; + var type_1 = require_type(); + var BASE64_MAP2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + function resolveYamlBinary2(data) { + if (null === data) { + return false; + } + var code, idx, bitlen = 0, len = 0, max2 = data.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + code = map4.indexOf(data.charAt(idx)); + if (code > 64) { + continue; + } + if (code < 0) { + return false; + } + bitlen += 6; + } + return bitlen % 8 === 0; + } + function constructYamlBinary2(data) { + var code, idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map4 = BASE64_MAP2, bits = 0, result2 = []; + for (idx = 0; idx < max2; idx++) { + if (idx % 4 === 0 && idx) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } + bits = bits << 6 | map4.indexOf(input.charAt(idx)); + } + tailbits = max2 % 4 * 6; + if (tailbits === 0) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } else if (tailbits === 18) { + result2.push(bits >> 10 & 255); + result2.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result2.push(bits >> 4 & 255); + } + if (NodeBuffer) { + return new NodeBuffer(result2); + } + return result2; + } + function representYamlBinary2(object) { + var result2 = "", bits = 0, idx, tail2, max2 = object.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + if (idx % 3 === 0 && idx) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail2 = max2 % 3; + if (tail2 === 0) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } else if (tail2 === 2) { + result2 += map4[bits >> 10 & 63]; + result2 += map4[bits >> 4 & 63]; + result2 += map4[bits << 2 & 63]; + result2 += map4[64]; + } else if (tail2 === 1) { + result2 += map4[bits >> 2 & 63]; + result2 += map4[bits << 4 & 63]; + result2 += map4[64]; + result2 += map4[64]; + } + return result2; + } + function isBinary2(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); + } + module5.exports = new type_1.Type("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary2, + construct: constructYamlBinary2, + predicate: isBinary2, + represent: representYamlBinary2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js +var require_omap = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var _toString2 = Object.prototype.toString; + function resolveYamlOmap2(data) { + if (null === data) { + return true; + } + var objectKeys = [], index4, length, pair, pairKey, pairHasKey, object = data; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + pairHasKey = false; + if ("[object Object]" !== _toString2.call(pair)) { + return false; + } + for (pairKey in pair) { + if (_hasOwnProperty2.call(pair, pairKey)) { + if (!pairHasKey) { + pairHasKey = true; + } else { + return false; + } + } + } + if (!pairHasKey) { + return false; + } + if (-1 === objectKeys.indexOf(pairKey)) { + objectKeys.push(pairKey); + } else { + return false; + } + } + return true; + } + function constructYamlOmap2(data) { + return null !== data ? data : []; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap2, + construct: constructYamlOmap2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js +var require_pairs = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + var ast = require_yamlAST(); + var _toString2 = Object.prototype.toString; + function resolveYamlPairs2(data) { + if (null === data) { + return true; + } + if (data.kind != ast.Kind.SEQ) { + return false; + } + var index4, length, pair, keys2, result2, object = data.items; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + if ("[object Object]" !== _toString2.call(pair)) { + return false; + } + if (!Array.isArray(pair.mappings)) { + return false; + } + if (1 !== pair.mappings.length) { + return false; + } + } + return true; + } + function constructYamlPairs2(data) { + if (null === data || !Array.isArray(data.items)) { + return []; + } + let index4, length, keys2, result2, object = data.items; + result2 = ast.newItems(); + result2.parent = data.parent; + result2.startPosition = data.startPosition; + result2.endPosition = data.endPosition; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + let pair = object[index4]; + let mapping = pair.mappings[0]; + let pairSeq = ast.newItems(); + pairSeq.parent = result2; + pairSeq.startPosition = mapping.key.startPosition; + pairSeq.endPosition = mapping.value.startPosition; + mapping.key.parent = pairSeq; + mapping.value.parent = pairSeq; + pairSeq.items = [mapping.key, mapping.value]; + result2.items.push(pairSeq); + } + return result2; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs2, + construct: constructYamlPairs2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js +var require_set = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + var ast = require_yamlAST(); + function resolveYamlSet2(data) { + if (null === data) { + return true; + } + if (data.kind != ast.Kind.MAP) { + return false; + } + return true; + } + function constructYamlSet2(data) { + return null !== data ? data : {}; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet2, + construct: constructYamlSet2 + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js +var require_default_safe = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var schema_1 = require_schema2(); + var schema8 = new schema_1.Schema({ + include: [ + require_core5() + ], + implicit: [ + require_timestamp(), + require_merge() + ], + explicit: [ + require_binary(), + require_omap(), + require_pairs(), + require_set() + ] + }); + module5.exports = schema8; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js +var require_undefined = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + function resolveJavascriptUndefined() { + return true; + } + function constructJavascriptUndefined() { + return void 0; + } + function representJavascriptUndefined() { + return ""; + } + function isUndefined3(object) { + return "undefined" === typeof object; + } + module5.exports = new type_1.Type("tag:yaml.org,2002:js/undefined", { + kind: "scalar", + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined3, + represent: representJavascriptUndefined + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/regexp.js +var require_regexp = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/regexp.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var type_1 = require_type(); + function resolveJavascriptRegExp(data) { + if (null === data) { + return false; + } + if (0 === data.length) { + return false; + } + var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = ""; + if ("/" === regexp[0]) { + if (tail2) { + modifiers = tail2[1]; + } + if (modifiers.length > 3) { + return false; + } + if (regexp[regexp.length - modifiers.length - 1] !== "/") { + return false; + } + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + try { + var dummy = new RegExp(regexp, modifiers); + return true; + } catch (error2) { + return false; + } + } + function constructJavascriptRegExp(data) { + var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = ""; + if ("/" === regexp[0]) { + if (tail2) { + modifiers = tail2[1]; + } + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + return new RegExp(regexp, modifiers); + } + function representJavascriptRegExp(object) { + var result2 = "/" + object.source + "/"; + if (object.global) { + result2 += "g"; + } + if (object.multiline) { + result2 += "m"; + } + if (object.ignoreCase) { + result2 += "i"; + } + return result2; + } + function isRegExp3(object) { + return "[object RegExp]" === Object.prototype.toString.call(object); + } + module5.exports = new type_1.Type("tag:yaml.org,2002:js/regexp", { + kind: "scalar", + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp3, + represent: representJavascriptRegExp + }); + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_full.js +var require_default_full = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_full.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var schema_1 = require_schema2(); + var schema8 = new schema_1.Schema({ + include: [ + require_default_safe() + ], + explicit: [ + require_undefined(), + require_regexp() + ] + }); + schema_1.Schema.DEFAULT = schema8; + module5.exports = schema8; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/loader.js +var require_loader = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/loader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ast = require_yamlAST(); + var common3 = require_common(); + var YAMLException2 = require_exception(); + var Mark = require_mark(); + var DEFAULT_SAFE_SCHEMA = require_default_safe(); + var DEFAULT_FULL_SCHEMA = require_default_full(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CONTEXT_FLOW_IN2 = 1; + var CONTEXT_FLOW_OUT2 = 2; + var CONTEXT_BLOCK_IN2 = 3; + var CONTEXT_BLOCK_OUT2 = 4; + var CHOMPING_CLIP2 = 1; + var CHOMPING_STRIP2 = 2; + var CHOMPING_KEEP2 = 3; + var PATTERN_NON_PRINTABLE2 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS2 = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS2 = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE2 = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI2 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function is_EOL2(c7) { + return c7 === 10 || c7 === 13; + } + function is_WHITE_SPACE2(c7) { + return c7 === 9 || c7 === 32; + } + function is_WS_OR_EOL2(c7) { + return c7 === 9 || c7 === 32 || c7 === 10 || c7 === 13; + } + function is_FLOW_INDICATOR2(c7) { + return 44 === c7 || 91 === c7 || 93 === c7 || 123 === c7 || 125 === c7; + } + function fromHexCode2(c7) { + var lc; + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + lc = c7 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; + } + function escapedHexLen2(c7) { + if (c7 === 120) { + return 2; + } + if (c7 === 117) { + return 4; + } + if (c7 === 85) { + return 8; + } + return 0; + } + function fromDecimalCode2(c7) { + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + return -1; + } + function simpleEscapeSequence2(c7) { + return c7 === 48 ? "\0" : c7 === 97 ? "\x07" : c7 === 98 ? "\b" : c7 === 116 ? " " : c7 === 9 ? " " : c7 === 110 ? "\n" : c7 === 118 ? "\v" : c7 === 102 ? "\f" : c7 === 114 ? "\r" : c7 === 101 ? "\x1B" : c7 === 32 ? " " : c7 === 34 ? '"' : c7 === 47 ? "/" : c7 === 92 ? "\\" : c7 === 78 ? "\x85" : c7 === 95 ? "\xA0" : c7 === 76 ? "\u2028" : c7 === 80 ? "\u2029" : ""; + } + function charFromCodepoint2(c7) { + if (c7 <= 65535) { + return String.fromCharCode(c7); + } + return String.fromCharCode((c7 - 65536 >> 10) + 55296, (c7 - 65536 & 1023) + 56320); + } + var simpleEscapeCheck2 = new Array(256); + var simpleEscapeMap2 = new Array(256); + var customEscapeCheck = new Array(256); + var customEscapeMap = new Array(256); + for (i7 = 0; i7 < 256; i7++) { + customEscapeMap[i7] = simpleEscapeMap2[i7] = simpleEscapeSequence2(i7); + simpleEscapeCheck2[i7] = simpleEscapeMap2[i7] ? 1 : 0; + customEscapeCheck[i7] = 1; + if (!simpleEscapeCheck2[i7]) { + customEscapeMap[i7] = "\\" + String.fromCharCode(i7); + } + } + var i7; + var State2 = class { + constructor(input, options) { + this.errorMap = {}; + this.errors = []; + this.lines = []; + this.input = input; + this.filename = options["filename"] || null; + this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; + this.onWarning = options["onWarning"] || null; + this.legacy = options["legacy"] || false; + this.allowAnyEscape = options["allowAnyEscape"] || false; + this.ignoreDuplicateKeys = options["ignoreDuplicateKeys"] || false; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.documents = []; + } + }; + function generateError2(state, message, isWarning = false) { + return new YAMLException2(message, new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart), isWarning); + } + function throwErrorFromPosition(state, position, message, isWarning = false, toLineEnd = false) { + var line = positionToLine(state, position); + if (!line) { + return; + } + var hash = message + position; + if (state.errorMap[hash]) { + return; + } + var mark = new Mark(state.filename, state.input, position, line.line, position - line.start); + if (toLineEnd) { + mark.toLineEnd = true; + } + var error2 = new YAMLException2(message, mark, isWarning); + state.errors.push(error2); + } + function throwError2(state, message) { + var error2 = generateError2(state, message); + var hash = error2.message + error2.mark.position; + if (state.errorMap[hash]) { + return; + } + state.errors.push(error2); + state.errorMap[hash] = 1; + var or = state.position; + while (true) { + if (state.position >= state.input.length - 1) { + return; + } + var c7 = state.input.charAt(state.position); + if (c7 == "\n") { + state.position--; + if (state.position == or) { + state.position += 1; + } + return; + } + if (c7 == "\r") { + state.position--; + if (state.position == or) { + state.position += 1; + } + return; + } + state.position++; + } + } + function throwWarning2(state, message) { + var error2 = generateError2(state, message); + if (state.onWarning) { + state.onWarning.call(null, error2); + } else { + } + } + var directiveHandlers2 = { + YAML: function handleYamlDirective2(state, name2, args) { + var match, major, minor; + if (null !== state.version) { + throwError2(state, "duplication of %YAML directive"); + } + if (1 !== args.length) { + throwError2(state, "YAML directive accepts exactly one argument"); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (null === match) { + throwError2(state, "ill-formed argument of the YAML directive"); + } + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (1 !== major) { + throwError2(state, "found incompatible YAML document (version 1.2 is required)"); + } + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (2 !== minor) { + throwError2(state, "found incompatible YAML document (version 1.2 is required)"); + } + }, + TAG: function handleTagDirective2(state, name2, args) { + var handle, prefix; + if (2 !== args.length) { + throwError2(state, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE2.test(handle)) { + throwError2(state, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty2.call(state.tagMap, handle)) { + throwError2(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI2.test(prefix)) { + throwError2(state, "ill-formed tag prefix (second argument) of the TAG directive"); + } + state.tagMap[handle] = prefix; + } + }; + function captureSegment2(state, start, end, checkJson) { + var _position, _length, _character, _result; + var scalar = state.result; + if (scalar.startPosition == -1) { + scalar.startPosition = start; + } + if (start <= end) { + _result = state.input.slice(start, end); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(9 === _character || 32 <= _character && _character <= 1114111)) { + throwError2(state, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE2.test(_result)) { + throwError2(state, "the stream contains non-printable characters"); + } + scalar.value += _result; + scalar.endPosition = end; + } + } + function storeMappingPair2(state, _result, keyTag, keyNode, valueNode) { + var index4, quantity; + if (keyNode == null) { + return; + } + if (null === _result) { + _result = { + startPosition: keyNode.startPosition, + endPosition: valueNode.endPosition, + parent: null, + errors: [], + mappings: [], + kind: ast.Kind.MAP + }; + } + var mapping = ast.newMapping(keyNode, valueNode); + mapping.parent = _result; + keyNode.parent = mapping; + if (valueNode != null) { + valueNode.parent = mapping; + } + !state.ignoreDuplicateKeys && _result.mappings.forEach((sibling) => { + if (sibling.key && sibling.key.value === (mapping.key && mapping.key.value)) { + throwErrorFromPosition(state, mapping.key.startPosition, "duplicate key"); + throwErrorFromPosition(state, sibling.key.startPosition, "duplicate key"); + } + }); + _result.mappings.push(mapping); + _result.endPosition = valueNode ? valueNode.endPosition : keyNode.endPosition + 1; + return _result; + } + function readLineBreak2(state) { + var ch; + ch = state.input.charCodeAt(state.position); + if (10 === ch) { + state.position++; + } else if (13 === ch) { + state.position++; + if (10 === state.input.charCodeAt(state.position)) { + state.position++; + } + } else { + throwError2(state, "a line break is expected"); + } + state.line += 1; + state.lineStart = state.position; + state.lines.push({ + start: state.lineStart, + line: state.line + }); + } + function positionToLine(state, position) { + var line; + for (var i8 = 0; i8 < state.lines.length; i8++) { + if (state.lines[i8].start > position) { + break; + } + line = state.lines[i8]; + } + if (!line) { + return { + start: 0, + line: 0 + }; + } + return line; + } + function readComment(state) { + var ch = 0, _position = state.position; + do { + ch = state.input.charCodeAt(++state.position); + } while (0 !== ch && !is_EOL2(ch)); + state.comments.push({ + startPosition: _position, + endPosition: state.position, + value: state.input.slice(_position + 1, state.position) + }); + } + function skipSeparationSpace2(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (0 !== ch) { + while (is_WHITE_SPACE2(ch)) { + if (ch === 9) { + state.errors.push(generateError2(state, "Using tabs can lead to unpredictable results", true)); + } + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && 35 === ch) { + readComment(state); + ch = state.input.charCodeAt(state.position); + } + if (is_EOL2(ch)) { + readLineBreak2(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (32 === ch) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { + throwWarning2(state, "deficient indentation"); + } + return lineBreaks; + } + function testDocumentSeparator2(state) { + var _position = state.position, ch; + ch = state.input.charCodeAt(_position); + if ((45 === ch || 46 === ch) && state.input.charCodeAt(_position + 1) === ch && state.input.charCodeAt(_position + 2) === ch) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL2(ch)) { + return true; + } + } + return false; + } + function writeFoldedLines2(state, scalar, count2) { + if (1 === count2) { + scalar.value += " "; + } else if (count2 > 1) { + scalar.value += common3.repeat("\n", count2 - 1); + } + } + function readPlainScalar2(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; + var state_result = ast.newScalar(); + state_result.plainScalar = true; + state.result = state_result; + ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL2(ch) || is_FLOW_INDICATOR2(ch) || 35 === ch || 38 === ch || 42 === ch || 33 === ch || 124 === ch || 62 === ch || 39 === ch || 34 === ch || 37 === ch || 64 === ch || 96 === ch) { + return false; + } + if (63 === ch || 45 === ch) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + return false; + } + } + state.kind = "scalar"; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (0 !== ch) { + if (58 === ch) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + break; + } + } else if (35 === ch) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL2(preceding)) { + break; + } + } else if (state.position === state.lineStart && testDocumentSeparator2(state) || withinFlowCollection && is_FLOW_INDICATOR2(ch)) { + break; + } else if (is_EOL2(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace2(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment2(state, captureStart, captureEnd, false); + writeFoldedLines2(state, state_result, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE2(ch)) { + captureEnd = state.position + 1; + } + ch = state.input.charCodeAt(++state.position); + if (state.position >= state.input.length) { + return false; + } + } + captureSegment2(state, captureStart, captureEnd, false); + if (state.result.startPosition != -1) { + state_result.rawValue = state.input.substring(state_result.startPosition, state_result.endPosition); + return true; + } + state.kind = _kind; + state.result = _result; + return false; + } + function readSingleQuotedScalar2(state, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state.input.charCodeAt(state.position); + if (39 !== ch) { + return false; + } + var scalar = ast.newScalar(); + scalar.singleQuoted = true; + state.kind = "scalar"; + state.result = scalar; + scalar.startPosition = state.position; + state.position++; + captureStart = captureEnd = state.position; + while (0 !== (ch = state.input.charCodeAt(state.position))) { + if (39 === ch) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + scalar.endPosition = state.position; + if (39 === ch) { + captureStart = captureEnd = state.position; + state.position++; + } else { + return true; + } + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, scalar, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a single quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + scalar.endPosition = state.position; + } + } + throwError2(state, "unexpected end of the stream within a single quoted scalar"); + } + function readDoubleQuotedScalar2(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, tmpEsc, ch; + ch = state.input.charCodeAt(state.position); + if (34 !== ch) { + return false; + } + state.kind = "scalar"; + var scalar = ast.newScalar(); + scalar.doubleQuoted = true; + state.result = scalar; + scalar.startPosition = state.position; + state.position++; + captureStart = captureEnd = state.position; + while (0 !== (ch = state.input.charCodeAt(state.position))) { + if (34 === ch) { + captureSegment2(state, captureStart, state.position, true); + state.position++; + scalar.endPosition = state.position; + scalar.rawValue = state.input.substring(scalar.startPosition, scalar.endPosition); + return true; + } else if (92 === ch) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL2(ch)) { + skipSeparationSpace2(state, false, nodeIndent); + } else if (ch < 256 && (state.allowAnyEscape ? customEscapeCheck[ch] : simpleEscapeCheck2[ch])) { + scalar.value += state.allowAnyEscape ? customEscapeMap[ch] : simpleEscapeMap2[ch]; + state.position++; + } else if ((tmp = escapedHexLen2(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode2(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError2(state, "expected hexadecimal character"); + } + } + scalar.value += charFromCodepoint2(hexResult); + state.position++; + } else { + throwError2(state, "unknown escape sequence"); + } + captureStart = captureEnd = state.position; + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, scalar, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a double quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError2(state, "unexpected end of the stream within a double quoted scalar"); + } + function readFlowCollection2(state, nodeIndent) { + var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair2, isExplicitPair, isMapping, keyNode, keyTag, valueNode, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = ast.newItems(); + _result.startPosition = state.position; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = ast.newMap(); + _result.startPosition = state.position; + } else { + return false; + } + if (null !== state.anchor) { + _result.anchorId = state.anchor; + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(++state.position); + while (0 !== ch) { + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + _result.endPosition = state.position; + return true; + } else if (!readNext) { + var p7 = state.position; + throwError2(state, "missed comma between flow collection entries"); + state.position = p7 + 1; + } + keyTag = keyNode = valueNode = null; + isPair2 = isExplicitPair = false; + if (63 === ch) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following)) { + isPair2 = isExplicitPair = true; + state.position++; + skipSeparationSpace2(state, true, nodeIndent); + } + } + _line = state.line; + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && 58 === ch) { + isPair2 = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace2(state, true, nodeIndent); + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair2(state, _result, keyTag, keyNode, valueNode); + } else if (isPair2) { + var mp = storeMappingPair2(state, null, keyTag, keyNode, valueNode); + mp.parent = _result; + _result.items.push(mp); + } else { + if (keyNode) { + keyNode.parent = _result; + } + _result.items.push(keyNode); + } + _result.endPosition = state.position + 1; + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (44 === ch) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + throwError2(state, "unexpected end of the stream within a flow collection"); + } + function readBlockScalar2(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP2, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + var sc = ast.newScalar(); + state.kind = "scalar"; + state.result = sc; + sc.startPosition = state.position; + while (0 !== ch) { + ch = state.input.charCodeAt(++state.position); + if (43 === ch || 45 === ch) { + if (CHOMPING_CLIP2 === chomping) { + chomping = 43 === ch ? CHOMPING_KEEP2 : CHOMPING_STRIP2; + } else { + throwError2(state, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode2(ch)) >= 0) { + if (tmp === 0) { + throwError2(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError2(state, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE2(ch)) { + do { + ch = state.input.charCodeAt(++state.position); + } while (is_WHITE_SPACE2(ch)); + if (35 === ch) { + readComment(state); + ch = state.input.charCodeAt(state.position); + } + } + while (0 !== ch) { + readLineBreak2(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && 32 === ch) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + if (is_EOL2(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP2) { + sc.value += common3.repeat("\n", emptyLines); + } else if (chomping === CHOMPING_CLIP2) { + if (detectedIndent) { + sc.value += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE2(ch)) { + atMoreIndented = true; + sc.value += common3.repeat("\n", emptyLines + 1); + } else if (atMoreIndented) { + atMoreIndented = false; + sc.value += common3.repeat("\n", emptyLines + 1); + } else if (0 === emptyLines) { + if (detectedIndent) { + sc.value += " "; + } + } else { + sc.value += common3.repeat("\n", emptyLines); + } + } else if (detectedIndent) { + sc.value += common3.repeat("\n", emptyLines + 1); + } else { + } + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL2(ch) && 0 !== ch) { + ch = state.input.charCodeAt(++state.position); + } + captureSegment2(state, captureStart, state.position, false); + } + sc.endPosition = state.position; + var i8 = state.position - 1; + var needMinus = false; + while (true) { + var c7 = state.input[i8]; + if (c7 == "\r" || c7 == "\n") { + if (needMinus) { + i8--; + } + break; + } + if (c7 != " " && c7 != " ") { + break; + } + i8--; + } + sc.endPosition = i8; + sc.rawValue = state.input.substring(sc.startPosition, sc.endPosition); + return true; + } + function readBlockSequence2(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newItems(), following, detected = false, ch; + if (null !== state.anchor) { + _result.anchorId = state.anchor; + state.anchorMap[state.anchor] = _result; + } + _result.startPosition = state.position; + ch = state.input.charCodeAt(state.position); + while (0 !== ch) { + if (45 !== ch) { + break; + } + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL2(following)) { + break; + } + detected = true; + state.position++; + if (skipSeparationSpace2(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.items.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode3(state, nodeIndent, CONTEXT_BLOCK_IN2, false, true); + if (state.result) { + state.result.parent = _result; + _result.items.push(state.result); + } + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && 0 !== ch) { + throwError2(state, "bad indentation of a sequence entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + _result.endPosition = state.position; + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + _result.endPosition = state.position; + return true; + } + return false; + } + function readBlockMapping2(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newMap(), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + _result.startPosition = state.position; + if (null !== state.anchor) { + _result.anchorId = state.anchor; + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (0 !== ch) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + if ((63 === ch || 58 === ch) && is_WS_OR_EOL2(following)) { + if (63 === ch) { + if (atExplicitKey) { + storeMappingPair2(state, _result, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else { + throwError2(state, "incomplete explicit mapping pair; a key node is missed"); + } + state.position += 1; + ch = following; + } else if (composeNode3(state, flowIndent, CONTEXT_FLOW_OUT2, false, true)) { + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (58 === ch) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL2(ch)) { + throwError2(state, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair2(state, _result, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (state.position == state.lineStart && testDocumentSeparator2(state)) { + break; + } else if (detected) { + throwError2(state, "can not read an implicit mapping pair; a colon is missed"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) { + throwError2(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + while (state.position > 0) { + ch = state.input.charCodeAt(--state.position); + if (is_EOL2(ch)) { + state.position++; + break; + } + } + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else { + break; + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode3(state, nodeIndent, CONTEXT_BLOCK_OUT2, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + if (!atExplicitKey) { + storeMappingPair2(state, _result, keyTag, keyNode, valueNode); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if (state.lineIndent > nodeIndent && 0 !== ch) { + throwError2(state, "bad indentation of a mapping entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair2(state, _result, keyTag, keyNode, null); + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; + } + function readTagProperty2(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; + ch = state.input.charCodeAt(state.position); + if (33 !== ch) { + return false; + } + if (null !== state.tag) { + throwError2(state, "duplication of a tag property"); + } + ch = state.input.charCodeAt(++state.position); + if (60 === ch) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (33 === ch) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else { + tagHandle = "!"; + } + _position = state.position; + if (isVerbatim) { + do { + ch = state.input.charCodeAt(++state.position); + } while (0 !== ch && 62 !== ch); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError2(state, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (0 !== ch && !is_WS_OR_EOL2(ch)) { + if (33 === ch) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE2.test(tagHandle)) { + throwError2(state, "named tag handle cannot contain such characters"); + } + isNamed = true; + _position = state.position + 1; + } else { + throwError2(state, "tag suffix cannot contain exclamation marks"); + } + } + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS2.test(tagName)) { + throwError2(state, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI2.test(tagName)) { + throwError2(state, "tag name cannot contain such characters: " + tagName); + } + if (isVerbatim) { + state.tag = tagName; + } else if (_hasOwnProperty2.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + } else if ("!" === tagHandle) { + state.tag = "!" + tagName; + } else if ("!!" === tagHandle) { + state.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError2(state, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; + } + function readAnchorProperty2(state) { + var _position, ch; + ch = state.input.charCodeAt(state.position); + if (38 !== ch) { + return false; + } + if (null !== state.anchor) { + throwError2(state, "duplication of an anchor property"); + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (0 !== ch && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError2(state, "name of an anchor node must contain at least one character"); + } + state.anchor = state.input.slice(_position, state.position); + return true; + } + function readAlias2(state) { + var _position, alias, len = state.length, input = state.input, ch; + ch = state.input.charCodeAt(state.position); + if (42 !== ch) { + return false; + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (0 !== ch && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position <= _position) { + throwError2(state, "name of an alias node must contain at least one character"); + state.position = _position + 1; + } + alias = state.input.slice(_position, state.position); + if (!state.anchorMap.hasOwnProperty(alias)) { + throwError2(state, 'unidentified alias "' + alias + '"'); + if (state.position <= _position) { + state.position = _position + 1; + } + } + state.result = ast.newAnchorRef(alias, _position, state.position, state.anchorMap[alias]); + skipSeparationSpace2(state, true, -1); + return true; + } + function composeNode3(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type3, flowIndent, blockIndent, _result; + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT2 === nodeContext || CONTEXT_BLOCK_IN2 === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + let tagStart = state.position; + let tagColumn = state.position - state.lineStart; + if (1 === indentStatus) { + while (readTagProperty2(state) || readAnchorProperty2(state)) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (1 === indentStatus || CONTEXT_BLOCK_OUT2 === nodeContext) { + if (CONTEXT_FLOW_IN2 === nodeContext || CONTEXT_FLOW_OUT2 === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state.position - state.lineStart; + if (1 === indentStatus) { + if (allowBlockCollections && (readBlockSequence2(state, blockIndent) || readBlockMapping2(state, blockIndent, flowIndent)) || readFlowCollection2(state, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar2(state, flowIndent) || readSingleQuotedScalar2(state, flowIndent) || readDoubleQuotedScalar2(state, flowIndent)) { + hasContent = true; + } else if (readAlias2(state)) { + hasContent = true; + if (null !== state.tag || null !== state.anchor) { + throwError2(state, "alias node should not have any properties"); + } + } else if (readPlainScalar2(state, flowIndent, CONTEXT_FLOW_IN2 === nodeContext)) { + hasContent = true; + if (null === state.tag) { + state.tag = "?"; + } + } + if (null !== state.anchor) { + state.anchorMap[state.anchor] = state.result; + state.result.anchorId = state.anchor; + } + } + } else if (0 === indentStatus) { + hasContent = allowBlockCollections && readBlockSequence2(state, blockIndent); + } + } + if (null !== state.tag && "!" !== state.tag) { + if (state.tag == "!include") { + if (!state.result) { + state.result = ast.newScalar(); + state.result.startPosition = state.position; + state.result.endPosition = state.position; + throwError2(state, "!include without value"); + } + state.result.kind = ast.Kind.INCLUDE_REF; + } else if ("?" === state.tag) { + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state.implicitTypes[typeIndex]; + var vl = state.result["value"]; + if (type3.resolve(vl)) { + state.result.valueObject = type3.construct(state.result["value"]); + state.tag = type3.tag; + if (null !== state.anchor) { + state.result.anchorId = state.anchor; + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty2.call(state.typeMap, state.tag)) { + type3 = state.typeMap[state.tag]; + if (null !== state.result && type3.kind !== state.kind) { + throwError2(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type3.kind + '", not "' + state.kind + '"'); + } + if (!type3.resolve(state.result)) { + throwError2(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + } else { + state.result = type3.construct(state.result); + if (null !== state.anchor) { + state.result.anchorId = state.anchor; + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwErrorFromPosition(state, tagStart, "unknown tag <" + state.tag + ">", false, true); + } + } + return null !== state.tag || null !== state.anchor || hasContent; + } + function readDocument2(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + state.comments = []; + while (0 !== (ch = state.input.charCodeAt(state.position))) { + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || 37 !== ch) { + break; + } + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (0 !== ch && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError2(state, "directive name must not be less than one character in length"); + } + while (0 !== ch) { + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (35 === ch) { + readComment(state); + ch = state.input.charCodeAt(state.position); + break; + } + if (is_EOL2(ch)) { + break; + } + _position = state.position; + while (0 !== ch && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (0 !== ch) { + readLineBreak2(state); + } + if (_hasOwnProperty2.call(directiveHandlers2, directiveName)) { + directiveHandlers2[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning2(state, 'unknown document directive "' + directiveName + '"'); + state.position++; + } + } + skipSeparationSpace2(state, true, -1); + if (0 === state.lineIndent && 45 === state.input.charCodeAt(state.position) && 45 === state.input.charCodeAt(state.position + 1) && 45 === state.input.charCodeAt(state.position + 2)) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } else if (hasDirectives) { + throwError2(state, "directives end mark is expected"); + } + composeNode3(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT2, false, true); + skipSeparationSpace2(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS2.test(state.input.slice(documentStart, state.position))) { + throwWarning2(state, "non-ASCII line breaks are interpreted as content"); + } + state.result.comments = state.comments; + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator2(state)) { + if (46 === state.input.charCodeAt(state.position)) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } + return; + } + if (state.position < state.length - 1) { + throwError2(state, "end of the stream or a document separator is expected"); + } else { + return; + } + } + function loadDocuments2(input, options) { + input = String(input); + options = options || {}; + let inputLength = input.length; + if (inputLength !== 0) { + if (10 !== input.charCodeAt(inputLength - 1) && 13 !== input.charCodeAt(inputLength - 1)) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state = new State2(input, options); + state.input += "\0"; + while (32 === state.input.charCodeAt(state.position)) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) { + var q5 = state.position; + readDocument2(state); + if (state.position <= q5) { + for (; state.position < state.length - 1; state.position++) { + var c7 = state.input.charAt(state.position); + if (c7 == "\n") { + break; + } + } + } + } + let documents = state.documents; + let docsCount = documents.length; + if (docsCount > 0) { + documents[docsCount - 1].endPosition = inputLength; + } + for (let x7 of documents) { + x7.errors = state.errors; + if (x7.startPosition > x7.endPosition) { + x7.startPosition = x7.endPosition; + } + } + return documents; + } + function loadAll2(input, iterator, options = {}) { + var documents = loadDocuments2(input, options), index4, length; + for (index4 = 0, length = documents.length; index4 < length; index4 += 1) { + iterator(documents[index4]); + } + } + exports28.loadAll = loadAll2; + function load2(input, options = {}) { + var documents = loadDocuments2(input, options), index4, length; + if (0 === documents.length) { + return void 0; + } else if (1 === documents.length) { + return documents[0]; + } + var e10 = new YAMLException2("expected a single document in the stream, but found more"); + e10.mark = new Mark("", "", 0, 0, 0); + e10.mark.position = documents[0].endPosition; + documents[0].errors.push(e10); + return documents[0]; + } + exports28.load = load2; + function safeLoadAll2(input, output, options = {}) { + loadAll2(input, output, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + exports28.safeLoadAll = safeLoadAll2; + function safeLoad2(input, options = {}) { + return load2(input, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + exports28.safeLoad = safeLoad2; + module5.exports.loadAll = loadAll2; + module5.exports.load = load2; + module5.exports.safeLoadAll = safeLoadAll2; + module5.exports.safeLoad = safeLoad2; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/dumper.js +var require_dumper = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/dumper.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var common3 = require_common(); + var YAMLException2 = require_exception(); + var DEFAULT_FULL_SCHEMA = require_default_full(); + var DEFAULT_SAFE_SCHEMA = require_default_safe(); + var _toString2 = Object.prototype.toString; + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CHAR_TAB2 = 9; + var CHAR_LINE_FEED2 = 10; + var CHAR_CARRIAGE_RETURN2 = 13; + var CHAR_SPACE2 = 32; + var CHAR_EXCLAMATION2 = 33; + var CHAR_DOUBLE_QUOTE2 = 34; + var CHAR_SHARP2 = 35; + var CHAR_PERCENT2 = 37; + var CHAR_AMPERSAND2 = 38; + var CHAR_SINGLE_QUOTE2 = 39; + var CHAR_ASTERISK2 = 42; + var CHAR_COMMA2 = 44; + var CHAR_MINUS2 = 45; + var CHAR_COLON2 = 58; + var CHAR_EQUALS2 = 61; + var CHAR_GREATER_THAN2 = 62; + var CHAR_QUESTION2 = 63; + var CHAR_COMMERCIAL_AT2 = 64; + var CHAR_LEFT_SQUARE_BRACKET2 = 91; + var CHAR_RIGHT_SQUARE_BRACKET2 = 93; + var CHAR_GRAVE_ACCENT2 = 96; + var CHAR_LEFT_CURLY_BRACKET2 = 123; + var CHAR_VERTICAL_LINE2 = 124; + var CHAR_RIGHT_CURLY_BRACKET2 = 125; + var ESCAPE_SEQUENCES2 = {}; + ESCAPE_SEQUENCES2[0] = "\\0"; + ESCAPE_SEQUENCES2[7] = "\\a"; + ESCAPE_SEQUENCES2[8] = "\\b"; + ESCAPE_SEQUENCES2[9] = "\\t"; + ESCAPE_SEQUENCES2[10] = "\\n"; + ESCAPE_SEQUENCES2[11] = "\\v"; + ESCAPE_SEQUENCES2[12] = "\\f"; + ESCAPE_SEQUENCES2[13] = "\\r"; + ESCAPE_SEQUENCES2[27] = "\\e"; + ESCAPE_SEQUENCES2[34] = '\\"'; + ESCAPE_SEQUENCES2[92] = "\\\\"; + ESCAPE_SEQUENCES2[133] = "\\N"; + ESCAPE_SEQUENCES2[160] = "\\_"; + ESCAPE_SEQUENCES2[8232] = "\\L"; + ESCAPE_SEQUENCES2[8233] = "\\P"; + var DEPRECATED_BOOLEANS_SYNTAX2 = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" + ]; + function compileStyleMap2(schema8, map4) { + var result2, keys2, index4, length, tag, style, type3; + if (map4 === null) + return {}; + result2 = {}; + keys2 = Object.keys(map4); + for (index4 = 0, length = keys2.length; index4 < length; index4 += 1) { + tag = keys2[index4]; + style = String(map4[tag]); + if (tag.slice(0, 2) === "!!") { + tag = "tag:yaml.org,2002:" + tag.slice(2); + } + type3 = schema8.compiledTypeMap["fallback"][tag]; + if (type3 && _hasOwnProperty2.call(type3.styleAliases, style)) { + style = type3.styleAliases[style]; + } + result2[tag] = style; + } + return result2; + } + function encodeHex2(character) { + var string2, handle, length; + string2 = character.toString(16).toUpperCase(); + if (character <= 255) { + handle = "x"; + length = 2; + } else if (character <= 65535) { + handle = "u"; + length = 4; + } else if (character <= 4294967295) { + handle = "U"; + length = 8; + } else { + throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF"); + } + return "\\" + handle + common3.repeat("0", length - string2.length) + string2; + } + function State2(options) { + this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, options["indent"] || 2); + this.noArrayIndent = options["noArrayIndent"] || false; + this.skipInvalid = options["skipInvalid"] || false; + this.flowLevel = common3.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; + this.styleMap = compileStyleMap2(this.schema, options["styles"] || null); + this.sortKeys = options["sortKeys"] || false; + this.lineWidth = options["lineWidth"] || 80; + this.noRefs = options["noRefs"] || false; + this.noCompatMode = options["noCompatMode"] || false; + this.condenseFlow = options["condenseFlow"] || false; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.comments = options["comments"] || {}; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; + } + function indentString2(string2, spaces) { + var ind = common3.repeat(" ", spaces), position = 0, next = -1, result2 = "", line, length = string2.length; + while (position < length) { + next = string2.indexOf("\n", position); + if (next === -1) { + line = string2.slice(position); + position = length; + } else { + line = string2.slice(position, next + 1); + position = next + 1; + } + if (line.length && line !== "\n") + result2 += ind; + result2 += line; + } + return result2; + } + function generateNextLine2(state, level) { + return "\n" + common3.repeat(" ", state.indent * level); + } + function testImplicitResolving2(state, str2) { + var index4, length, type3; + for (index4 = 0, length = state.implicitTypes.length; index4 < length; index4 += 1) { + type3 = state.implicitTypes[index4]; + if (type3.resolve(str2)) { + return true; + } + } + return false; + } + function isWhitespace2(c7) { + return c7 === CHAR_SPACE2 || c7 === CHAR_TAB2; + } + function isPrintable2(c7) { + return 32 <= c7 && c7 <= 126 || 161 <= c7 && c7 <= 55295 && c7 !== 8232 && c7 !== 8233 || 57344 <= c7 && c7 <= 65533 && c7 !== 65279 || 65536 <= c7 && c7 <= 1114111; + } + function isNsChar(c7) { + return isPrintable2(c7) && !isWhitespace2(c7) && c7 !== 65279 && c7 !== CHAR_CARRIAGE_RETURN2 && c7 !== CHAR_LINE_FEED2; + } + function isPlainSafe2(c7, prev) { + return isPrintable2(c7) && c7 !== 65279 && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2 && c7 !== CHAR_COLON2 && (c7 !== CHAR_SHARP2 || prev && isNsChar(prev)); + } + function isPlainSafeFirst2(c7) { + return isPrintable2(c7) && c7 !== 65279 && !isWhitespace2(c7) && c7 !== CHAR_MINUS2 && c7 !== CHAR_QUESTION2 && c7 !== CHAR_COLON2 && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2 && c7 !== CHAR_SHARP2 && c7 !== CHAR_AMPERSAND2 && c7 !== CHAR_ASTERISK2 && c7 !== CHAR_EXCLAMATION2 && c7 !== CHAR_VERTICAL_LINE2 && c7 !== CHAR_EQUALS2 && c7 !== CHAR_GREATER_THAN2 && c7 !== CHAR_SINGLE_QUOTE2 && c7 !== CHAR_DOUBLE_QUOTE2 && c7 !== CHAR_PERCENT2 && c7 !== CHAR_COMMERCIAL_AT2 && c7 !== CHAR_GRAVE_ACCENT2; + } + function needIndentIndicator2(string2) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string2); + } + var STYLE_PLAIN2 = 1; + var STYLE_SINGLE2 = 2; + var STYLE_LITERAL2 = 3; + var STYLE_FOLDED2 = 4; + var STYLE_DOUBLE2 = 5; + function chooseScalarStyle2(string2, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i7; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst2(string2.charCodeAt(0)) && !isWhitespace2(string2.charCodeAt(string2.length - 1)); + if (singleLineOnly) { + for (i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + prev_char = i7 > 0 ? string2.charCodeAt(i7 - 1) : null; + plain = plain && isPlainSafe2(char, prev_char); + } + } else { + for (i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (char === CHAR_LINE_FEED2) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "; + previousLineBreak = i7; + } + } else if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + prev_char = i7 > 0 ? string2.charCodeAt(i7 - 1) : null; + plain = plain && isPlainSafe2(char, prev_char); + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "); + } + if (!hasLineBreak && !hasFoldableLine) { + return plain && !testAmbiguousType(string2) ? STYLE_PLAIN2 : STYLE_SINGLE2; + } + if (indentPerLevel > 9 && needIndentIndicator2(string2)) { + return STYLE_DOUBLE2; + } + return hasFoldableLine ? STYLE_FOLDED2 : STYLE_LITERAL2; + } + function writeScalar2(state, string2, level, iskey, pointer) { + var _result = function() { + if (string2.length === 0) { + return "''"; + } + if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX2.indexOf(string2) !== -1) { + return "'" + string2 + "'"; + } + var indent = state.indent * Math.max(1, level); + var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; + function testAmbiguity(string3) { + return testImplicitResolving2(state, string3); + } + switch (chooseScalarStyle2(string2, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN2: + return string2; + case STYLE_SINGLE2: + return "'" + string2.replace(/'/g, "''") + "'"; + case STYLE_LITERAL2: + return "|" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(string2, indent)); + case STYLE_FOLDED2: + return ">" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(foldString2(string2, lineWidth), indent)); + case STYLE_DOUBLE2: + return '"' + escapeString2(string2) + '"'; + default: + throw new YAMLException2("impossible error: invalid scalar style"); + } + }(); + if (!iskey) { + let comments = new Comments(state, pointer); + let comment = comments.write(level, "before-eol"); + if (comment !== "") { + _result += " " + comment; + } + } + state.dump = _result; + } + function blockHeader2(string2, indentPerLevel) { + var indentIndicator = needIndentIndicator2(string2) ? String(indentPerLevel) : ""; + var clip = string2[string2.length - 1] === "\n"; + var keep = clip && (string2[string2.length - 2] === "\n" || string2 === "\n"); + var chomp = keep ? "+" : clip ? "" : "-"; + return indentIndicator + chomp + "\n"; + } + function dropEndingNewline2(string2) { + return string2[string2.length - 1] === "\n" ? string2.slice(0, -1) : string2; + } + function foldString2(string2, width) { + var lineRe = /(\n+)([^\n]*)/g; + var result2 = function() { + var nextLF = string2.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string2.length; + lineRe.lastIndex = nextLF; + return foldLine2(string2.slice(0, nextLF), width); + }(); + var prevMoreIndented = string2[0] === "\n" || string2[0] === " "; + var moreIndented; + var match; + while (match = lineRe.exec(string2)) { + var prefix = match[1], line = match[2]; + moreIndented = line[0] === " "; + result2 += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine2(line, width); + prevMoreIndented = moreIndented; + } + return result2; + } + function foldLine2(line, width) { + if (line === "" || line[0] === " ") + return line; + var breakRe = / [^ ]/g; + var match; + var start = 0, end, curr = 0, next = 0; + var result2 = ""; + while (match = breakRe.exec(line)) { + next = match.index; + if (next - start > width) { + end = curr > start ? curr : next; + result2 += "\n" + line.slice(start, end); + start = end + 1; + } + curr = next; + } + result2 += "\n"; + if (line.length - start > width && curr > start) { + result2 += line.slice(start, curr) + "\n" + line.slice(curr + 1); + } else { + result2 += line.slice(start); + } + return result2.slice(1); + } + function escapeString2(string2) { + var result2 = ""; + var char, nextChar; + var escapeSeq; + for (var i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (char >= 55296 && char <= 56319) { + nextChar = string2.charCodeAt(i7 + 1); + if (nextChar >= 56320 && nextChar <= 57343) { + result2 += encodeHex2((char - 55296) * 1024 + nextChar - 56320 + 65536); + i7++; + continue; + } + } + escapeSeq = ESCAPE_SEQUENCES2[char]; + result2 += !escapeSeq && isPrintable2(char) ? string2[i7] : escapeSeq || encodeHex2(char); + } + return result2; + } + function writeFlowSequence2(state, level, object, pointer) { + var _result = "", _tag = state.tag, index4, length; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + if (writeNode2(state, level, object[index4], false, false, false, pointer)) { + if (index4 !== 0) + _result += "," + (!state.condenseFlow ? " " : ""); + _result += state.dump; + } + } + state.tag = _tag; + state.dump = "[" + _result + "]"; + } + function writeBlockSequence2(state, level, object, compact2, pointer) { + var _result = "", _tag = state.tag, index4, length; + var comments = new Comments(state, pointer); + _result += comments.write(level, "before-eol"); + _result += comments.write(level, "leading"); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + _result += comments.writeAt(String(index4), level, "before"); + if (writeNode2(state, level + 1, object[index4], true, true, false, `${pointer}/${index4}`)) { + if (!compact2 || index4 !== 0) { + _result += generateNextLine2(state, level); + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state.dump; + } + _result += comments.writeAt(String(index4), level, "after"); + } + state.tag = _tag; + state.dump = _result || "[]"; + state.dump += comments.write(level, "trailing"); + } + function writeFlowMapping2(state, level, object, pointer) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, pairBuffer; + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (index4 !== 0) + pairBuffer += ", "; + if (state.condenseFlow) + pairBuffer += '"'; + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (!writeNode2(state, level, objectKey, false, false, false, pointer)) { + continue; + } + if (state.dump.length > 1024) + pairBuffer += "? "; + pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " "); + if (!writeNode2(state, level, objectValue, false, false, false, pointer)) { + continue; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = "{" + _result + "}"; + } + function writeBlockMapping2(state, level, object, compact2, pointer) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, explicitPair, pairBuffer; + if (state.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state.sortKeys === "function") { + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + throw new YAMLException2("sortKeys must be a boolean or a function"); + } + var comments = new Comments(state, pointer); + _result += comments.write(level, "before-eol"); + _result += comments.write(level, "leading"); + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (!compact2 || index4 !== 0) { + pairBuffer += generateNextLine2(state, level); + } + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + _result += comments.writeAt(objectKey, level, "before"); + if (!writeNode2(state, level + 1, objectKey, true, true, true, pointer)) { + continue; + } + explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; + } + } + pairBuffer += state.dump; + if (explicitPair) { + pairBuffer += generateNextLine2(state, level); + } + if (!writeNode2(state, level + 1, objectValue, true, explicitPair, false, `${pointer}/${encodeSegment(objectKey)}`)) { + continue; + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state.dump; + _result += pairBuffer; + _result += comments.writeAt(level, objectKey, "after"); + } + state.tag = _tag; + state.dump = _result || "{}"; + state.dump += comments.write(level, "trailing"); + } + function detectType2(state, object, explicit) { + var _result, typeList, index4, length, type3, style; + typeList = explicit ? state.explicitTypes : state.implicitTypes; + for (index4 = 0, length = typeList.length; index4 < length; index4 += 1) { + type3 = typeList[index4]; + if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object === "object" && object instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object))) { + state.tag = explicit ? type3.tag : "?"; + if (type3.represent) { + style = state.styleMap[type3.tag] || type3.defaultStyle; + if (_toString2.call(type3.represent) === "[object Function]") { + _result = type3.represent(object, style); + } else if (_hasOwnProperty2.call(type3.represent, style)) { + _result = type3.represent[style](object, style); + } else { + throw new YAMLException2("!<" + type3.tag + '> tag resolver accepts not "' + style + '" style'); + } + state.dump = _result; + } + return true; + } + } + return false; + } + function writeNode2(state, level, object, block, compact2, iskey, pointer) { + state.tag = null; + state.dump = object; + if (!detectType2(state, object, false)) { + detectType2(state, object, true); + } + var type3 = _toString2.call(state.dump); + if (block) { + block = state.flowLevel < 0 || state.flowLevel > level; + } + if (state.tag !== null && state.tag !== "?" || state.indent !== 2 && level > 0) { + compact2 = false; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block && Object.keys(state.dump).length !== 0) { + writeBlockMapping2(state, level, state.dump, compact2, pointer); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowMapping2(state, level, state.dump, pointer); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object Array]") { + var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level; + if (block && state.dump.length !== 0) { + writeBlockSequence2(state, arrayLevel, state.dump, compact2, pointer); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowSequence2(state, arrayLevel, state.dump, pointer); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object String]") { + if (state.tag !== "?") { + writeScalar2(state, state.dump, level, iskey, pointer); + } + } else { + if (state.skipInvalid) + return false; + throw new YAMLException2("unacceptable kind of an object to dump " + type3); + } + if (state.tag !== null && state.tag !== "?") { + state.dump = "!<" + state.tag + "> " + state.dump; + } + } + return true; + } + function getDuplicateReferences2(object, state) { + var objects = [], duplicatesIndexes = [], index4, length; + inspectNode2(object, objects, duplicatesIndexes); + for (index4 = 0, length = duplicatesIndexes.length; index4 < length; index4 += 1) { + state.duplicates.push(objects[duplicatesIndexes[index4]]); + } + state.usedDuplicates = new Array(length); + } + function inspectNode2(object, objects, duplicatesIndexes) { + var objectKeyList, index4, length; + if (object !== null && typeof object === "object") { + index4 = objects.indexOf(object); + if (index4 !== -1) { + if (duplicatesIndexes.indexOf(index4) === -1) { + duplicatesIndexes.push(index4); + } + } else { + objects.push(object); + if (Array.isArray(object)) { + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + inspectNode2(object[index4], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + inspectNode2(object[objectKeyList[index4]], objects, duplicatesIndexes); + } + } + } + } + } + function dump2(input, options) { + options = options || {}; + var state = new State2(options); + if (!options.noRefs) + getDuplicateReferences2(input, state); + if (writeNode2(state, 0, input, true, true, false, "#")) { + return state.dump + "\n"; + } + return ""; + } + exports28.dump = dump2; + function safeDump2(input, options) { + return dump2(input, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + exports28.safeDump = safeDump2; + var TILDE_REGEXP = /~/g; + var SLASH_REGEXP = /\//g; + function encodeSegment(input) { + return input.replace(TILDE_REGEXP, "~0").replace(SLASH_REGEXP, "~1"); + } + function Comments(state, pointer) { + this.state = state; + this.comments = { + "before-eol": /* @__PURE__ */ new Set(), + leading: /* @__PURE__ */ new Set(), + trailing: /* @__PURE__ */ new Set(), + before: /* @__PURE__ */ new Map(), + after: /* @__PURE__ */ new Map() + }; + this.written = /* @__PURE__ */ new WeakSet(); + if (state.comments !== null && pointer in state.comments) { + for (let comment of state.comments[pointer]) { + switch (comment.placement) { + case "before-eol": + case "leading": + case "trailing": + this.comments[comment.placement].add(comment); + break; + case "between": + let before2 = this.comments.before.get(comment.between[1]); + if (!before2) { + this.comments.before.set(comment.between[1], /* @__PURE__ */ new Set([comment])); + } else { + before2.add(comment); + } + let after2 = this.comments.after.get(comment.between[0]); + if (!after2) { + this.comments.after.set(comment.between[0], /* @__PURE__ */ new Set([comment])); + } else { + after2.add(comment); + } + break; + } + } + } + } + Comments.prototype.write = function(level, placement) { + let result2 = ""; + for (let comment of this.comments[placement]) { + result2 += this._write(comment, level); + } + return result2; + }; + Comments.prototype.writeAt = function(key, level, placement) { + let result2 = ""; + let comments = this.comments[placement].get(key); + if (comments) { + for (let comment of comments) { + result2 += this._write(comment, level); + } + } + return result2; + }; + Comments.prototype._write = function(comment, level) { + if (this.written.has(comment)) + return ""; + this.written.add(comment); + let result2 = "#" + comment.value; + if (comment.placement === "before-eol") { + return result2; + } else if (level === 0 && comment.placement === "leading") { + return result2 + "\n"; + } else { + return generateNextLine2(this.state, level) + result2; + } + }; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/scalarInference.js +var require_scalarInference = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/scalarInference.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function parseYamlBoolean(input) { + if (["true", "True", "TRUE"].lastIndexOf(input) >= 0) { + return true; + } else if (["false", "False", "FALSE"].lastIndexOf(input) >= 0) { + return false; + } + throw `Invalid boolean "${input}"`; + } + exports28.parseYamlBoolean = parseYamlBoolean; + function safeParseYamlInteger(input) { + if (input.lastIndexOf("0o", 0) === 0) { + return parseInt(input.substring(2), 8); + } + return parseInt(input); + } + function parseYamlInteger(input) { + const result2 = safeParseYamlInteger(input); + if (Number.isNaN(result2)) { + throw `Invalid integer "${input}"`; + } + return result2; + } + exports28.parseYamlInteger = parseYamlInteger; + function parseYamlBigInteger(input) { + const result2 = parseYamlInteger(input); + if (result2 > Number.MAX_SAFE_INTEGER && input.lastIndexOf("0o", 0) === -1) { + return BigInt(input); + } + return result2; + } + exports28.parseYamlBigInteger = parseYamlBigInteger; + function parseYamlFloat(input) { + if ([".nan", ".NaN", ".NAN"].lastIndexOf(input) >= 0) { + return NaN; + } + const infinity = /^([-+])?(?:\.inf|\.Inf|\.INF)$/; + const match = infinity.exec(input); + if (match) { + return match[1] === "-" ? -Infinity : Infinity; + } + const result2 = parseFloat(input); + if (!isNaN(result2)) { + return result2; + } + throw `Invalid float "${input}"`; + } + exports28.parseYamlFloat = parseYamlFloat; + var ScalarType; + (function(ScalarType2) { + ScalarType2[ScalarType2["null"] = 0] = "null"; + ScalarType2[ScalarType2["bool"] = 1] = "bool"; + ScalarType2[ScalarType2["int"] = 2] = "int"; + ScalarType2[ScalarType2["float"] = 3] = "float"; + ScalarType2[ScalarType2["string"] = 4] = "string"; + })(ScalarType = exports28.ScalarType || (exports28.ScalarType = {})); + function determineScalarType(node) { + if (node === void 0) { + return ScalarType.null; + } + if (node.doubleQuoted || !node.plainScalar || node["singleQuoted"]) { + return ScalarType.string; + } + const value2 = node.value; + if (["null", "Null", "NULL", "~", ""].indexOf(value2) >= 0) { + return ScalarType.null; + } + if (value2 === null || value2 === void 0) { + return ScalarType.null; + } + if (["true", "True", "TRUE", "false", "False", "FALSE"].indexOf(value2) >= 0) { + return ScalarType.bool; + } + const base10 = /^[-+]?[0-9]+$/; + const base8 = /^0o[0-7]+$/; + const base16 = /^0x[0-9a-fA-F]+$/; + if (base10.test(value2) || base8.test(value2) || base16.test(value2)) { + return ScalarType.int; + } + const float4 = /^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$/; + const infinity = /^[-+]?(\.inf|\.Inf|\.INF)$/; + if (float4.test(value2) || infinity.test(value2) || [".nan", ".NaN", ".NAN"].indexOf(value2) >= 0) { + return ScalarType.float; + } + return ScalarType.string; + } + exports28.determineScalarType = determineScalarType; + } +}); + +// node_modules/@stoplight/yaml-ast-parser/dist/src/index.js +var require_src = __commonJS({ + "node_modules/@stoplight/yaml-ast-parser/dist/src/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function __export2(m7) { + for (var p7 in m7) + if (!exports28.hasOwnProperty(p7)) + exports28[p7] = m7[p7]; + } + Object.defineProperty(exports28, "__esModule", { value: true }); + var loader_1 = require_loader(); + exports28.load = loader_1.load; + exports28.loadAll = loader_1.loadAll; + exports28.safeLoad = loader_1.safeLoad; + exports28.safeLoadAll = loader_1.safeLoadAll; + var dumper_1 = require_dumper(); + exports28.dump = dumper_1.dump; + exports28.safeDump = dumper_1.safeDump; + exports28.YAMLException = require_exception(); + __export2(require_yamlAST()); + __export2(require_scalarInference()); + } +}); + +// node_modules/@stoplight/yaml/types.js +var require_types2 = __commonJS({ + "node_modules/@stoplight/yaml/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var yaml_ast_parser_1 = require_src(); + exports28.Kind = yaml_ast_parser_1.Kind; + exports28.ScalarType = yaml_ast_parser_1.ScalarType; + } +}); + +// node_modules/@stoplight/yaml/utils.js +var require_utils4 = __commonJS({ + "node_modules/@stoplight/yaml/utils.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.isObject = (sth) => sth !== null && typeof sth === "object"; + } +}); + +// node_modules/@stoplight/yaml/buildJsonPath.js +var require_buildJsonPath = __commonJS({ + "node_modules/@stoplight/yaml/buildJsonPath.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var types_1 = require_types2(); + var utils_1 = require_utils4(); + function buildJsonPath(node) { + const path2 = []; + let prevNode = node; + while (node) { + switch (node.kind) { + case types_1.Kind.SCALAR: + path2.unshift(node.value); + break; + case types_1.Kind.MAPPING: + if (prevNode !== node.key) { + if (path2.length > 0 && utils_1.isObject(node.value) && node.value.value === path2[0]) { + path2[0] = node.key.value; + } else { + path2.unshift(node.key.value); + } + } + break; + case types_1.Kind.SEQ: + if (prevNode) { + const index4 = node.items.indexOf(prevNode); + if (prevNode.kind === types_1.Kind.SCALAR) { + path2[0] = index4; + } else if (index4 !== -1) { + path2.unshift(index4); + } + } + break; + } + prevNode = node; + node = node.parent; + } + return path2; + } + exports28.buildJsonPath = buildJsonPath; + } +}); + +// node_modules/@stoplight/yaml/dereferenceAnchor.js +var require_dereferenceAnchor = __commonJS({ + "node_modules/@stoplight/yaml/dereferenceAnchor.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var types_1 = require_types2(); + var utils_1 = require_utils4(); + exports28.dereferenceAnchor = (node, anchorId) => { + if (!utils_1.isObject(node)) + return node; + if (node.kind === types_1.Kind.ANCHOR_REF && node.referencesAnchor === anchorId) + return null; + switch (node.kind) { + case types_1.Kind.MAP: + return Object.assign({}, node, { mappings: node.mappings.map((mapping) => exports28.dereferenceAnchor(mapping, anchorId)) }); + case types_1.Kind.SEQ: + return Object.assign({}, node, { items: node.items.map((item) => exports28.dereferenceAnchor(item, anchorId)) }); + case types_1.Kind.MAPPING: + return Object.assign({}, node, { value: exports28.dereferenceAnchor(node.value, anchorId) }); + case types_1.Kind.SCALAR: + return node; + case types_1.Kind.ANCHOR_REF: + if (utils_1.isObject(node.value) && isSelfReferencingAnchorRef(node)) { + return null; + } + return node; + default: + return node; + } + }; + var isSelfReferencingAnchorRef = (anchorRef) => { + const { referencesAnchor } = anchorRef; + let node = anchorRef; + while (node = node.parent) { + if ("anchorId" in node && node.anchorId === referencesAnchor) { + return true; + } + } + return false; + }; + } +}); + +// node_modules/@stoplight/yaml/getJsonPathForPosition.js +var require_getJsonPathForPosition = __commonJS({ + "node_modules/@stoplight/yaml/getJsonPathForPosition.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var buildJsonPath_1 = require_buildJsonPath(); + var types_1 = require_types2(); + var utils_1 = require_utils4(); + exports28.getJsonPathForPosition = ({ ast, lineMap }, { line, character }) => { + if (line >= lineMap.length || character >= lineMap[line]) { + return; + } + const startOffset = line === 0 ? 0 : lineMap[line - 1] + 1; + const node = findClosestScalar(ast, Math.min(lineMap[line] - 1, startOffset + character), line, lineMap); + if (!utils_1.isObject(node)) + return; + const path2 = buildJsonPath_1.buildJsonPath(node); + if (path2.length === 0) + return; + return path2; + }; + function* walk(node) { + switch (node.kind) { + case types_1.Kind.MAP: + if (node.mappings.length !== 0) { + for (const mapping of node.mappings) { + if (utils_1.isObject(mapping)) { + yield mapping; + } + } + } + break; + case types_1.Kind.MAPPING: + if (utils_1.isObject(node.key)) { + yield node.key; + } + if (utils_1.isObject(node.value)) { + yield node.value; + } + break; + case types_1.Kind.SEQ: + if (node.items.length !== 0) { + for (const item of node.items) { + if (utils_1.isObject(item)) { + yield item; + } + } + } + break; + case types_1.Kind.SCALAR: + yield node; + break; + } + } + function getFirstScalarChild(node, line, lineMap) { + const startOffset = lineMap[line - 1] + 1; + const endOffset = lineMap[line]; + switch (node.kind) { + case types_1.Kind.MAPPING: + return node.key; + case types_1.Kind.MAP: + if (node.mappings.length !== 0) { + for (const mapping of node.mappings) { + if (mapping.startPosition > startOffset && mapping.startPosition <= endOffset) { + return getFirstScalarChild(mapping, line, lineMap); + } + } + } + break; + case types_1.Kind.SEQ: + if (node.items.length !== 0) { + for (const item of node.items) { + if (item !== null && item.startPosition > startOffset && item.startPosition <= endOffset) { + return getFirstScalarChild(item, line, lineMap); + } + } + } + break; + } + return node; + } + function findClosestScalar(container, offset, line, lineMap) { + for (const node of walk(container)) { + if (node.startPosition <= offset && offset <= node.endPosition) { + return node.kind === types_1.Kind.SCALAR ? node : findClosestScalar(node, offset, line, lineMap); + } + } + if (lineMap[line - 1] === lineMap[line] - 1) { + return container; + } + if (container.startPosition < lineMap[line - 1] && offset <= container.endPosition) { + if (container.kind !== types_1.Kind.MAPPING) { + return getFirstScalarChild(container, line, lineMap); + } + if (container.value && container.key.endPosition < offset) { + return getFirstScalarChild(container.value, line, lineMap); + } + } + return container; + } + } +}); + +// node_modules/@stoplight/yaml/lineForPosition.js +var require_lineForPosition = __commonJS({ + "node_modules/@stoplight/yaml/lineForPosition.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.lineForPosition = (pos, lines, start = 0, end) => { + if (pos === 0 || lines.length === 0 || pos < lines[0]) { + return 0; + } + if (typeof end === "undefined") { + end = lines.length; + } + const target = Math.floor((end - start) / 2) + start; + if (pos >= lines[target] && !lines[target + 1]) { + return target + 1; + } + const nextLinePos = lines[Math.min(target + 1, lines.length)]; + if (pos === lines[target] - 1) { + return target; + } + if (pos >= lines[target] && pos <= nextLinePos) { + if (pos === nextLinePos) { + return target + 2; + } + return target + 1; + } + if (pos > lines[target]) { + return exports28.lineForPosition(pos, lines, target + 1, end); + } else { + return exports28.lineForPosition(pos, lines, start, target - 1); + } + }; + } +}); + +// node_modules/@stoplight/yaml/getLocationForJsonPath.js +var require_getLocationForJsonPath = __commonJS({ + "node_modules/@stoplight/yaml/getLocationForJsonPath.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var lineForPosition_1 = require_lineForPosition(); + var types_1 = require_types2(); + var utils_1 = require_utils4(); + exports28.getLocationForJsonPath = ({ ast, lineMap, metadata }, path2, closest = false) => { + const node = findNodeAtPath(ast, path2, { closest, mergeKeys: metadata !== void 0 && metadata.mergeKeys === true }); + if (node === void 0) + return; + return getLoc(lineMap, { + start: getStartPosition(node, lineMap.length > 0 ? lineMap[0] : 0), + end: getEndPosition(node) + }); + }; + function getStartPosition(node, offset) { + if (node.parent && node.parent.kind === types_1.Kind.MAPPING) { + if (node.parent.value === null) { + return node.parent.endPosition; + } + if (node.kind !== types_1.Kind.SCALAR) { + return node.parent.key.endPosition + 1; + } + } + if (node.parent === null && offset - node.startPosition === 0) { + return 0; + } + return node.startPosition; + } + function getEndPosition(node) { + switch (node.kind) { + case types_1.Kind.SEQ: + const { items } = node; + if (items.length !== 0) { + const lastItem = items[items.length - 1]; + if (lastItem !== null) { + return getEndPosition(lastItem); + } + } + break; + case types_1.Kind.MAPPING: + if (node.value !== null) { + return getEndPosition(node.value); + } + break; + case types_1.Kind.MAP: + if (node.value !== null && node.mappings.length !== 0) { + return getEndPosition(node.mappings[node.mappings.length - 1]); + } + break; + case types_1.Kind.SCALAR: + if (node.parent !== null && node.parent.kind === types_1.Kind.MAPPING && node.parent.value === null) { + return node.parent.endPosition; + } + break; + } + return node.endPosition; + } + function findNodeAtPath(node, path2, { closest, mergeKeys }) { + pathLoop: + for (const segment of path2) { + if (!utils_1.isObject(node)) { + return closest ? node : void 0; + } + switch (node.kind) { + case types_1.Kind.MAP: + const mappings = getMappings(node.mappings, mergeKeys); + for (let i7 = mappings.length - 1; i7 >= 0; i7--) { + const item = mappings[i7]; + if (item.key.value === segment) { + if (item.value === null) { + node = item.key; + } else { + node = item.value; + } + continue pathLoop; + } + } + return closest ? node : void 0; + case types_1.Kind.SEQ: + for (let i7 = 0; i7 < node.items.length; i7++) { + if (i7 === Number(segment)) { + const item = node.items[i7]; + if (item === null) { + break; + } + node = item; + continue pathLoop; + } + } + return closest ? node : void 0; + default: + return closest ? node : void 0; + } + } + return node; + } + function getMappings(mappings, mergeKeys) { + if (!mergeKeys) + return mappings; + return mappings.reduce((mergedMappings, mapping) => { + if (utils_1.isObject(mapping)) { + if (mapping.key.value === "<<") { + mergedMappings.push(...reduceMergeKeys(mapping.value)); + } else { + mergedMappings.push(mapping); + } + } + return mergedMappings; + }, []); + } + function reduceMergeKeys(node) { + if (!utils_1.isObject(node)) + return []; + switch (node.kind) { + case types_1.Kind.SEQ: + return node.items.reduceRight((items, item) => { + items.push(...reduceMergeKeys(item)); + return items; + }, []); + case types_1.Kind.MAP: + return node.mappings; + case types_1.Kind.ANCHOR_REF: + return reduceMergeKeys(node.value); + default: + return []; + } + } + var getLoc = (lineMap, { start = 0, end = 0 }) => { + const startLine = lineForPosition_1.lineForPosition(start, lineMap); + const endLine = lineForPosition_1.lineForPosition(end, lineMap); + return { + range: { + start: { + line: startLine, + character: start - (startLine === 0 ? 0 : lineMap[startLine - 1]) + }, + end: { + line: endLine, + character: end - (endLine === 0 ? 0 : lineMap[endLine - 1]) + } + } + }; + }; + } +}); + +// node_modules/@stoplight/ordered-object-literal/src/index.cjs +var require_src2 = __commonJS({ + "node_modules/@stoplight/ordered-object-literal/src/index.cjs"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var TIMESTAMP2 = Math.floor(Date.now() / 36e5); + var ORDER_KEY_ID2 = `__object_order_${TIMESTAMP2}__`; + var ORDER_KEY2 = Symbol.for(ORDER_KEY_ID2); + var STRINGIFIED_ORDER_KEY2 = String(ORDER_KEY2); + var traps2 = { + defineProperty(target, key, descriptor) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + if (!hasKey && ORDER_KEY2 in target) { + target[ORDER_KEY2].push(key); + } else if ("value" in descriptor && key === ORDER_KEY2 && descriptor.value.lastIndexOf(ORDER_KEY2) === -1) { + descriptor.value.push(ORDER_KEY2); + } + return Reflect.defineProperty(target, key, descriptor); + }, + deleteProperty(target, key) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + const deleted = Reflect.deleteProperty(target, key); + if (deleted && hasKey && ORDER_KEY2 in target) { + const index4 = target[ORDER_KEY2].indexOf(key); + if (index4 !== -1) { + target[ORDER_KEY2].splice(index4, 1); + } + } + return deleted; + }, + ownKeys(target) { + if (ORDER_KEY2 in target) { + return target[ORDER_KEY2]; + } + return Reflect.ownKeys(target); + }, + set(target, key, value2) { + const hasKey = Object.prototype.hasOwnProperty.call(target, key); + const set4 = Reflect.set(target, key, value2); + if (set4 && !hasKey && ORDER_KEY2 in target) { + target[ORDER_KEY2].push(key); + } + return set4; + } + }; + function createObj2(target, order = Reflect.ownKeys(target)) { + assertObjectLiteral2(target); + const t8 = new Proxy(target, traps2); + setOrder2(t8, order); + return t8; + } + function setOrder2(target, order) { + if (ORDER_KEY2 in target) { + target[ORDER_KEY2].length = 0; + target[ORDER_KEY2].push(...order); + return true; + } else { + return Reflect.defineProperty(target, ORDER_KEY2, { + configurable: true, + value: order + }); + } + } + function getOrder2(target) { + return target[ORDER_KEY2]; + } + function serializeArray(target) { + const newTarget = target.slice(); + for (let i7 = 0; i7 < newTarget.length; i7 += 1) { + const value2 = newTarget[i7]; + if (isObject8(value2)) { + newTarget[i7] = Array.isArray(value2) ? serializeArray(value2) : serialize(value2, true); + } + } + return newTarget; + } + function serialize(target, deep) { + assertObjectLiteral2(target, "Invalid target provided"); + const newTarget = { ...target }; + if (ORDER_KEY2 in target) { + Object.defineProperty(newTarget, STRINGIFIED_ORDER_KEY2, { + enumerable: true, + value: target[ORDER_KEY2].filter((item) => item !== ORDER_KEY2) + }); + } + if (deep) { + for (const key of Object.keys(target)) { + if (key === STRINGIFIED_ORDER_KEY2) + continue; + const value2 = target[key]; + if (isObject8(value2)) { + newTarget[key] = Array.isArray(value2) ? serializeArray(value2) : serialize(value2, true); + } + } + } + return newTarget; + } + function deserializeArray(target) { + for (let i7 = 0; i7 < target.length; i7 += 1) { + const value2 = target[i7]; + if (isObject8(value2)) { + target[i7] = Array.isArray(value2) ? deserializeArray(value2) : deserialize(value2, true); + } + } + return target; + } + function deserialize(target, deep) { + assertObjectLiteral2(target, "Invalid target provided"); + const newTarget = createObj2( + target, + STRINGIFIED_ORDER_KEY2 in target ? target[STRINGIFIED_ORDER_KEY2] : Reflect.ownKeys(target) + ); + delete newTarget[STRINGIFIED_ORDER_KEY2]; + if (deep) { + for (const key of Object.keys(target)) { + const value2 = target[key]; + if (isObject8(value2)) { + target[key] = Array.isArray(value2) ? deserializeArray(value2) : deserialize(value2, true); + } + } + } + return newTarget; + } + function isOrderedObject(target) { + return ORDER_KEY2 in target; + } + function isObject8(maybeObj) { + return maybeObj !== null && typeof maybeObj === "object"; + } + function isObjectLiteral2(obj) { + if (!isObject8(obj)) + return false; + if (obj[Symbol.toStringTag] !== void 0) { + const proto = Object.getPrototypeOf(obj); + return proto === null || proto === Object.prototype; + } + return toStringTag2(obj) === "Object"; + } + function toStringTag2(obj) { + const tag = obj[Symbol.toStringTag]; + if (typeof tag === "string") { + return tag; + } + const name2 = Reflect.apply(Object.prototype.toString, obj, []); + return name2.slice(8, name2.length - 1); + } + function assertObjectLiteral2(maybeObj, message) { + if (isDevEnv2() && !isObjectLiteral2(maybeObj)) { + throw new TypeError(message); + } + } + function isDevEnv2() { + if (typeof process === "undefined" || !isObject8(process) || !isObject8(process.env)) { + return false; + } + return false; + } + exports28.ORDER_KEY_ID = ORDER_KEY_ID2; + exports28.default = createObj2; + exports28.deserialize = deserialize; + exports28.getOrder = getOrder2; + exports28.isOrderedObject = isOrderedObject; + exports28.serialize = serialize; + exports28.setOrder = setOrder2; + } +}); + +// node_modules/@stoplight/yaml/node_modules/@stoplight/types/dist/index.js +var require_dist3 = __commonJS({ + "node_modules/@stoplight/yaml/node_modules/@stoplight/types/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.HttpOperationSecurityDeclarationTypes = void 0; + (function(HttpOperationSecurityDeclarationTypes2) { + HttpOperationSecurityDeclarationTypes2["None"] = "none"; + HttpOperationSecurityDeclarationTypes2["Declared"] = "declared"; + HttpOperationSecurityDeclarationTypes2["InheritedFromService"] = "inheritedFromService"; + })(exports28.HttpOperationSecurityDeclarationTypes || (exports28.HttpOperationSecurityDeclarationTypes = {})); + exports28.HttpParamStyles = void 0; + (function(HttpParamStyles2) { + HttpParamStyles2["Unspecified"] = "unspecified"; + HttpParamStyles2["Simple"] = "simple"; + HttpParamStyles2["Matrix"] = "matrix"; + HttpParamStyles2["Label"] = "label"; + HttpParamStyles2["Form"] = "form"; + HttpParamStyles2["CommaDelimited"] = "commaDelimited"; + HttpParamStyles2["SpaceDelimited"] = "spaceDelimited"; + HttpParamStyles2["PipeDelimited"] = "pipeDelimited"; + HttpParamStyles2["DeepObject"] = "deepObject"; + HttpParamStyles2["TabDelimited"] = "tabDelimited"; + })(exports28.HttpParamStyles || (exports28.HttpParamStyles = {})); + exports28.DiagnosticSeverity = void 0; + (function(DiagnosticSeverity2) { + DiagnosticSeverity2[DiagnosticSeverity2["Error"] = 0] = "Error"; + DiagnosticSeverity2[DiagnosticSeverity2["Warning"] = 1] = "Warning"; + DiagnosticSeverity2[DiagnosticSeverity2["Information"] = 2] = "Information"; + DiagnosticSeverity2[DiagnosticSeverity2["Hint"] = 3] = "Hint"; + })(exports28.DiagnosticSeverity || (exports28.DiagnosticSeverity = {})); + exports28.NodeType = void 0; + (function(NodeType2) { + NodeType2["Article"] = "article"; + NodeType2["HttpService"] = "http_service"; + NodeType2["HttpServer"] = "http_server"; + NodeType2["HttpOperation"] = "http_operation"; + NodeType2["HttpCallback"] = "http_callback"; + NodeType2["HttpWebhook"] = "http_webhook"; + NodeType2["Model"] = "model"; + NodeType2["Generic"] = "generic"; + NodeType2["Unknown"] = "unknown"; + NodeType2["TableOfContents"] = "table_of_contents"; + NodeType2["SpectralRuleset"] = "spectral_ruleset"; + NodeType2["Styleguide"] = "styleguide"; + NodeType2["Image"] = "image"; + NodeType2["StoplightResolutions"] = "stoplight_resolutions"; + NodeType2["StoplightOverride"] = "stoplight_override"; + })(exports28.NodeType || (exports28.NodeType = {})); + exports28.NodeFormat = void 0; + (function(NodeFormat2) { + NodeFormat2["Json"] = "json"; + NodeFormat2["Markdown"] = "markdown"; + NodeFormat2["Yaml"] = "yaml"; + NodeFormat2["Javascript"] = "javascript"; + NodeFormat2["Apng"] = "apng"; + NodeFormat2["Avif"] = "avif"; + NodeFormat2["Bmp"] = "bmp"; + NodeFormat2["Gif"] = "gif"; + NodeFormat2["Jpeg"] = "jpeg"; + NodeFormat2["Png"] = "png"; + NodeFormat2["Svg"] = "svg"; + NodeFormat2["Webp"] = "webp"; + })(exports28.NodeFormat || (exports28.NodeFormat = {})); + } +}); + +// node_modules/@stoplight/yaml/parseWithPointers.js +var require_parseWithPointers = __commonJS({ + "node_modules/@stoplight/yaml/parseWithPointers.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ordered_object_literal_1 = require_src2(); + var types_1 = require_dist3(); + var yaml_ast_parser_1 = require_src(); + var buildJsonPath_1 = require_buildJsonPath(); + var dereferenceAnchor_1 = require_dereferenceAnchor(); + var lineForPosition_1 = require_lineForPosition(); + var types_2 = require_types2(); + var utils_1 = require_utils4(); + exports28.parseWithPointers = (value2, options) => { + const lineMap = computeLineMap(value2); + const ast = yaml_ast_parser_1.load(value2, Object.assign({}, options, { ignoreDuplicateKeys: true })); + const parsed = { + ast, + lineMap, + data: void 0, + diagnostics: [], + metadata: options, + comments: {} + }; + if (!ast) + return parsed; + const normalizedOptions = normalizeOptions(options); + const comments = new Comments(parsed.comments, Comments.mapComments(normalizedOptions.attachComments && ast.comments ? ast.comments : [], lineMap), ast, lineMap, "#"); + const ctx = { + lineMap, + diagnostics: parsed.diagnostics + }; + parsed.data = walkAST(ctx, ast, comments, normalizedOptions); + if (ast.errors) { + parsed.diagnostics.push(...transformErrors(ast.errors, lineMap)); + } + if (parsed.diagnostics.length > 0) { + parsed.diagnostics.sort((itemA, itemB) => itemA.range.start.line - itemB.range.start.line); + } + if (Array.isArray(parsed.ast.errors)) { + parsed.ast.errors.length = 0; + } + return parsed; + }; + var TILDE_REGEXP = /~/g; + var SLASH_REGEXP = /\//g; + function encodeSegment(input) { + return input.replace(TILDE_REGEXP, "~0").replace(SLASH_REGEXP, "~1"); + } + var walkAST = (ctx, node, comments, options) => { + if (node) { + switch (node.kind) { + case types_2.Kind.MAP: { + const mapComments = comments.enter(node); + const { lineMap, diagnostics } = ctx; + const { preserveKeyOrder, ignoreDuplicateKeys, json: json2, mergeKeys } = options; + const container = createMapContainer(preserveKeyOrder); + const seenKeys = []; + const handleMergeKeys = mergeKeys; + const yamlMode = !json2; + const handleDuplicates = !ignoreDuplicateKeys; + for (const mapping of node.mappings) { + if (!validateMappingKey(mapping, lineMap, diagnostics, yamlMode)) + continue; + const key = String(getScalarValue(mapping.key)); + const mappingComments = mapComments.enter(mapping, encodeSegment(key)); + if ((yamlMode || handleDuplicates) && (!handleMergeKeys || key !== "<<")) { + if (seenKeys.includes(key)) { + if (yamlMode) { + throw new Error("Duplicate YAML mapping key encountered"); + } + if (handleDuplicates) { + diagnostics.push(createYAMLException(mapping.key, lineMap, "duplicate key")); + } + } else { + seenKeys.push(key); + } + } + if (handleMergeKeys && key === "<<") { + const reduced = reduceMergeKeys(walkAST(ctx, mapping.value, mappingComments, options), preserveKeyOrder); + Object.assign(container, reduced); + } else { + container[key] = walkAST(ctx, mapping.value, mappingComments, options); + if (preserveKeyOrder) { + pushKey(container, key); + } + } + mappingComments.attachComments(); + } + mapComments.attachComments(); + return container; + } + case types_2.Kind.SEQ: { + const nodeComments = comments.enter(node); + const container = node.items.map((item, i7) => { + if (item !== null) { + const sequenceItemComments = nodeComments.enter(item, i7); + const walked = walkAST(ctx, item, sequenceItemComments, options); + sequenceItemComments.attachComments(); + return walked; + } else { + return null; + } + }); + nodeComments.attachComments(); + return container; + } + case types_2.Kind.SCALAR: { + const value2 = getScalarValue(node); + return !options.bigInt && typeof value2 === "bigint" ? Number(value2) : value2; + } + case types_2.Kind.ANCHOR_REF: { + if (utils_1.isObject(node.value)) { + node.value = dereferenceAnchor_1.dereferenceAnchor(node.value, node.referencesAnchor); + } + return walkAST(ctx, node.value, comments, options); + } + default: + return null; + } + } + return node; + }; + function getScalarValue(node) { + switch (yaml_ast_parser_1.determineScalarType(node)) { + case types_2.ScalarType.null: + return null; + case types_2.ScalarType.string: + return String(node.value); + case types_2.ScalarType.bool: + return yaml_ast_parser_1.parseYamlBoolean(node.value); + case types_2.ScalarType.int: + return yaml_ast_parser_1.parseYamlBigInteger(node.value); + case types_2.ScalarType.float: + return yaml_ast_parser_1.parseYamlFloat(node.value); + } + } + var computeLineMap = (input) => { + const lineMap = []; + let i7 = 0; + for (; i7 < input.length; i7++) { + if (input[i7] === "\n") { + lineMap.push(i7 + 1); + } + } + lineMap.push(i7 + 1); + return lineMap; + }; + function getLineLength(lineMap, line) { + if (line === 0) { + return Math.max(0, lineMap[0] - 1); + } + return Math.max(0, lineMap[line] - lineMap[line - 1] - 1); + } + var transformErrors = (errors, lineMap) => { + const validations = []; + let possiblyUnexpectedFlow = -1; + let i7 = 0; + for (const error2 of errors) { + const validation = { + code: error2.name, + message: error2.reason, + severity: error2.isWarning ? types_1.DiagnosticSeverity.Warning : types_1.DiagnosticSeverity.Error, + range: { + start: { + line: error2.mark.line, + character: error2.mark.column + }, + end: { + line: error2.mark.line, + character: error2.mark.toLineEnd ? getLineLength(lineMap, error2.mark.line) : error2.mark.column + } + } + }; + const isBrokenFlow = error2.reason === "missed comma between flow collection entries"; + if (isBrokenFlow) { + possiblyUnexpectedFlow = possiblyUnexpectedFlow === -1 ? i7 : possiblyUnexpectedFlow; + } else if (possiblyUnexpectedFlow !== -1) { + validations[possiblyUnexpectedFlow].range.end = validation.range.end; + validations[possiblyUnexpectedFlow].message = "invalid mixed usage of block and flow styles"; + validations.length = possiblyUnexpectedFlow + 1; + i7 = validations.length; + possiblyUnexpectedFlow = -1; + } + validations.push(validation); + i7++; + } + return validations; + }; + var reduceMergeKeys = (items, preserveKeyOrder) => { + if (Array.isArray(items)) { + const reduced = items.reduceRight(preserveKeyOrder ? (merged, item) => { + const keys2 = Object.keys(item); + Object.assign(merged, item); + for (let i7 = keys2.length - 1; i7 >= 0; i7--) { + unshiftKey(merged, keys2[i7]); + } + return merged; + } : (merged, item) => Object.assign(merged, item), createMapContainer(preserveKeyOrder)); + return reduced; + } + return typeof items !== "object" || items === null ? null : Object(items); + }; + function createMapContainer(preserveKeyOrder) { + return preserveKeyOrder ? ordered_object_literal_1.default({}) : {}; + } + function deleteKey(container, key) { + if (!(key in container)) + return; + const order = ordered_object_literal_1.getOrder(container); + const index4 = order.indexOf(key); + if (index4 !== -1) { + order.splice(index4, 1); + } + } + function unshiftKey(container, key) { + deleteKey(container, key); + ordered_object_literal_1.getOrder(container).unshift(key); + } + function pushKey(container, key) { + deleteKey(container, key); + ordered_object_literal_1.getOrder(container).push(key); + } + function validateMappingKey(mapping, lineMap, diagnostics, yamlMode) { + if (mapping.key.kind !== types_2.Kind.SCALAR) { + if (!yamlMode) { + diagnostics.push(createYAMLIncompatibilityException(mapping.key, lineMap, "mapping key must be a string scalar", yamlMode)); + } + return false; + } + if (!yamlMode) { + const type3 = typeof getScalarValue(mapping.key); + if (type3 !== "string") { + diagnostics.push(createYAMLIncompatibilityException(mapping.key, lineMap, `mapping key must be a string scalar rather than ${mapping.key.valueObject === null ? "null" : type3}`, yamlMode)); + } + } + return true; + } + function createYAMLIncompatibilityException(node, lineMap, message, yamlMode) { + const exception2 = createYAMLException(node, lineMap, message); + exception2.code = "YAMLIncompatibleValue"; + exception2.severity = yamlMode ? types_1.DiagnosticSeverity.Hint : types_1.DiagnosticSeverity.Warning; + return exception2; + } + function createYAMLException(node, lineMap, message) { + return { + code: "YAMLException", + message, + severity: types_1.DiagnosticSeverity.Error, + path: buildJsonPath_1.buildJsonPath(node), + range: getRange(lineMap, node.startPosition, node.endPosition) + }; + } + function getRange(lineMap, startPosition, endPosition) { + const startLine = lineForPosition_1.lineForPosition(startPosition, lineMap); + const endLine = lineForPosition_1.lineForPosition(endPosition, lineMap); + return { + start: { + line: startLine, + character: startLine === 0 ? startPosition : startPosition - lineMap[startLine - 1] + }, + end: { + line: endLine, + character: endLine === 0 ? endPosition : endPosition - lineMap[endLine - 1] + } + }; + } + var Comments = class _Comments { + constructor(attachedComments, comments, node, lineMap, pointer) { + this.attachedComments = attachedComments; + this.node = node; + this.lineMap = lineMap; + this.pointer = pointer; + if (comments.length === 0) { + this.comments = []; + } else { + const startPosition = this.getStartPosition(node); + const endPosition = this.getEndPosition(node); + const startLine = lineForPosition_1.lineForPosition(startPosition, this.lineMap); + const endLine = lineForPosition_1.lineForPosition(endPosition, this.lineMap); + const matchingComments = []; + for (let i7 = comments.length - 1; i7 >= 0; i7--) { + const comment = comments[i7]; + if (comment.range.start.line >= startLine && comment.range.end.line <= endLine) { + matchingComments.push(comment); + comments.splice(i7, 1); + } + } + this.comments = matchingComments; + } + } + getStartPosition(node) { + if (node.parent === null) { + return 0; + } + return node.kind === types_2.Kind.MAPPING ? node.key.startPosition : node.startPosition; + } + getEndPosition(node) { + switch (node.kind) { + case types_2.Kind.MAPPING: + return node.value === null ? node.endPosition : this.getEndPosition(node.value); + case types_2.Kind.MAP: + return node.mappings.length === 0 ? node.endPosition : node.mappings[node.mappings.length - 1].endPosition; + case types_2.Kind.SEQ: { + if (node.items.length === 0) { + return node.endPosition; + } + const lastItem = node.items[node.items.length - 1]; + return lastItem === null ? node.endPosition : lastItem.endPosition; + } + default: + return node.endPosition; + } + } + static mapComments(comments, lineMap) { + return comments.map((comment) => ({ + value: comment.value, + range: getRange(lineMap, comment.startPosition, comment.endPosition), + startPosition: comment.startPosition, + endPosition: comment.endPosition + })); + } + enter(node, key) { + return new _Comments(this.attachedComments, this.comments, node, this.lineMap, key === void 0 ? this.pointer : `${this.pointer}/${key}`); + } + static isLeading(node, startPosition) { + switch (node.kind) { + case types_2.Kind.MAP: + return node.mappings.length === 0 || node.mappings[0].startPosition > startPosition; + case types_2.Kind.SEQ: { + if (node.items.length === 0) { + return true; + } + const firstItem = node.items[0]; + return firstItem === null || firstItem.startPosition > startPosition; + } + case types_2.Kind.MAPPING: + return node.value === null || node.value.startPosition > startPosition; + default: + return false; + } + } + static isTrailing(node, endPosition) { + switch (node.kind) { + case types_2.Kind.MAP: + return node.mappings.length > 0 && endPosition > node.mappings[node.mappings.length - 1].endPosition; + case types_2.Kind.SEQ: + if (node.items.length === 0) { + return false; + } + const lastItem = node.items[node.items.length - 1]; + return lastItem !== null && endPosition > lastItem.endPosition; + case types_2.Kind.MAPPING: + return node.value !== null && endPosition > node.value.endPosition; + default: + return false; + } + } + static findBetween(node, startPosition, endPosition) { + switch (node.kind) { + case types_2.Kind.MAP: { + let left; + for (const mapping of node.mappings) { + if (startPosition > mapping.startPosition) { + left = mapping.key.value; + } else if (left !== void 0 && mapping.startPosition > endPosition) { + return [left, mapping.key.value]; + } + } + return null; + } + case types_2.Kind.SEQ: { + let left; + for (let i7 = 0; i7 < node.items.length; i7++) { + const item = node.items[i7]; + if (item === null) + continue; + if (startPosition > item.startPosition) { + left = String(i7); + } else if (left !== void 0 && item.startPosition > endPosition) { + return [left, String(i7)]; + } + } + return null; + } + default: + return null; + } + } + isBeforeEOL(comment) { + return this.node.kind === types_2.Kind.SCALAR || this.node.kind === types_2.Kind.MAPPING && comment.range.end.line === lineForPosition_1.lineForPosition(this.node.key.endPosition, this.lineMap); + } + attachComments() { + if (this.comments.length === 0) + return; + const attachedComments = this.attachedComments[this.pointer] = this.attachedComments[this.pointer] || []; + for (const comment of this.comments) { + if (this.isBeforeEOL(comment)) { + attachedComments.push({ + value: comment.value, + placement: "before-eol" + }); + } else if (_Comments.isLeading(this.node, comment.startPosition)) { + attachedComments.push({ + value: comment.value, + placement: "leading" + }); + } else if (_Comments.isTrailing(this.node, comment.endPosition)) { + attachedComments.push({ + value: comment.value, + placement: "trailing" + }); + } else { + const between = _Comments.findBetween(this.node, comment.startPosition, comment.endPosition); + if (between !== null) { + attachedComments.push({ + value: comment.value, + placement: "between", + between + }); + } else { + attachedComments.push({ + value: comment.value, + placement: "trailing" + }); + } + } + } + } + }; + function normalizeOptions(options) { + if (options === void 0) { + return { + attachComments: false, + preserveKeyOrder: false, + bigInt: false, + mergeKeys: false, + json: true, + ignoreDuplicateKeys: false + }; + } + return Object.assign({}, options, { attachComments: options.attachComments === true, preserveKeyOrder: options.preserveKeyOrder === true, bigInt: options.bigInt === true, mergeKeys: options.mergeKeys === true, json: options.json !== false, ignoreDuplicateKeys: options.ignoreDuplicateKeys !== false }); + } + } +}); + +// node_modules/@stoplight/yaml/parse.js +var require_parse = __commonJS({ + "node_modules/@stoplight/yaml/parse.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var parseWithPointers_1 = require_parseWithPointers(); + exports28.parse = (value2) => parseWithPointers_1.parseWithPointers(value2).data; + } +}); + +// node_modules/@stoplight/yaml/safeStringify.js +var require_safeStringify = __commonJS({ + "node_modules/@stoplight/yaml/safeStringify.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var yaml_ast_parser_1 = require_src(); + exports28.safeStringify = (value2, options) => typeof value2 === "string" ? value2 : yaml_ast_parser_1.safeDump(value2, options); + } +}); + +// node_modules/@stoplight/yaml/trapAccess.js +var require_trapAccess = __commonJS({ + "node_modules/@stoplight/yaml/trapAccess.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ordered_object_literal_1 = require_src2(); + exports28.KEYS = Symbol.for(ordered_object_literal_1.ORDER_KEY_ID); + var traps2 = { + ownKeys(target) { + return exports28.KEYS in target ? target[exports28.KEYS] : Reflect.ownKeys(target); + } + }; + exports28.trapAccess = (target) => new Proxy(target, traps2); + } +}); + +// node_modules/@stoplight/yaml/index.js +var require_yaml = __commonJS({ + "node_modules/@stoplight/yaml/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); + tslib_1.__exportStar(require_buildJsonPath(), exports28); + tslib_1.__exportStar(require_dereferenceAnchor(), exports28); + tslib_1.__exportStar(require_getJsonPathForPosition(), exports28); + tslib_1.__exportStar(require_getLocationForJsonPath(), exports28); + tslib_1.__exportStar(require_lineForPosition(), exports28); + var parse_1 = require_parse(); + exports28.parse = parse_1.parse; + var parseWithPointers_1 = require_parseWithPointers(); + exports28.parseWithPointers = parseWithPointers_1.parseWithPointers; + tslib_1.__exportStar(require_safeStringify(), exports28); + tslib_1.__exportStar(require_types2(), exports28); + tslib_1.__exportStar(require_trapAccess(), exports28); + } +}); + +// node_modules/@stoplight/spectral-parsers/dist/yaml.js +var require_yaml2 = __commonJS({ + "node_modules/@stoplight/spectral-parsers/dist/yaml.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Yaml = exports28.parseYaml = void 0; + var yaml_1 = require_yaml(); + function getLocationForJsonPath(result2, path2) { + return (0, yaml_1.getLocationForJsonPath)(result2, path2); + } + var parseYaml = (input) => (0, yaml_1.parseWithPointers)(input, { + ignoreDuplicateKeys: false, + mergeKeys: true, + preserveKeyOrder: true, + attachComments: false + }); + exports28.parseYaml = parseYaml; + exports28.Yaml = { + parse: exports28.parseYaml, + getLocationForJsonPath, + trapAccess: yaml_1.trapAccess + }; + } +}); + +// node_modules/@stoplight/spectral-parsers/dist/types.js +var require_types3 = __commonJS({ + "node_modules/@stoplight/spectral-parsers/dist/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + } +}); + +// node_modules/@stoplight/spectral-parsers/dist/index.js +var require_dist4 = __commonJS({ + "node_modules/@stoplight/spectral-parsers/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); + (0, tslib_1.__exportStar)(require_json2(), exports28); + (0, tslib_1.__exportStar)(require_yaml2(), exports28); + (0, tslib_1.__exportStar)(require_types3(), exports28); + } +}); + +// node_modules/@stoplight/spectral-ref-resolver/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports4 = {}; +__export(tslib_es6_exports4, { + __addDisposableResource: () => __addDisposableResource4, + __assign: () => __assign4, + __asyncDelegator: () => __asyncDelegator4, + __asyncGenerator: () => __asyncGenerator4, + __asyncValues: () => __asyncValues4, + __await: () => __await4, + __awaiter: () => __awaiter5, + __classPrivateFieldGet: () => __classPrivateFieldGet4, + __classPrivateFieldIn: () => __classPrivateFieldIn4, + __classPrivateFieldSet: () => __classPrivateFieldSet4, + __createBinding: () => __createBinding4, + __decorate: () => __decorate4, + __disposeResources: () => __disposeResources4, + __esDecorate: () => __esDecorate4, + __exportStar: () => __exportStar4, + __extends: () => __extends4, + __generator: () => __generator4, + __importDefault: () => __importDefault4, + __importStar: () => __importStar4, + __makeTemplateObject: () => __makeTemplateObject4, + __metadata: () => __metadata4, + __param: () => __param4, + __propKey: () => __propKey4, + __read: () => __read4, + __rest: () => __rest4, + __runInitializers: () => __runInitializers4, + __setFunctionName: () => __setFunctionName4, + __spread: () => __spread4, + __spreadArray: () => __spreadArray4, + __spreadArrays: () => __spreadArrays4, + __values: () => __values4, + default: () => tslib_es6_default4 +}); +function __extends4(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics4(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest4(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate4(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param4(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate4(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers4(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey4(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName4(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata4(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter5(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator4(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar4(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding4(o7, m7, p7); +} +function __values4(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read4(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread4() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read4(arguments[i7])); + return ar; +} +function __spreadArrays4() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray4(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await4(v8) { + return this instanceof __await4 ? (this.v = v8, this) : new __await4(v8); +} +function __asyncGenerator4(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await4 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator4(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await4(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues4(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values4 === "function" ? __values4(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject4(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar4(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding4(result2, mod2, k6); + } + __setModuleDefault4(result2, mod2); + return result2; +} +function __importDefault4(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet4(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet4(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn4(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); +} +function __addDisposableResource4(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources4(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError4(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics4, __assign4, __createBinding4, __setModuleDefault4, _SuppressedError4, tslib_es6_default4; +var init_tslib_es64 = __esm({ + "node_modules/@stoplight/spectral-ref-resolver/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics4 = function(d7, b8) { + extendStatics4 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics4(d7, b8); + }; + __assign4 = function() { + __assign4 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign4.apply(this, arguments); + }; + __createBinding4 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault4 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError4 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default4 = { + __extends: __extends4, + __assign: __assign4, + __rest: __rest4, + __decorate: __decorate4, + __param: __param4, + __metadata: __metadata4, + __awaiter: __awaiter5, + __generator: __generator4, + __createBinding: __createBinding4, + __exportStar: __exportStar4, + __values: __values4, + __read: __read4, + __spread: __spread4, + __spreadArrays: __spreadArrays4, + __spreadArray: __spreadArray4, + __await: __await4, + __asyncGenerator: __asyncGenerator4, + __asyncDelegator: __asyncDelegator4, + __asyncValues: __asyncValues4, + __makeTemplateObject: __makeTemplateObject4, + __importStar: __importStar4, + __importDefault: __importDefault4, + __classPrivateFieldGet: __classPrivateFieldGet4, + __classPrivateFieldSet: __classPrivateFieldSet4, + __classPrivateFieldIn: __classPrivateFieldIn4, + __addDisposableResource: __addDisposableResource4, + __disposeResources: __disposeResources4 + }; + } +}); + +// node_modules/tslib/tslib.es6.js +var tslib_es6_exports5 = {}; +__export(tslib_es6_exports5, { + __assign: () => __assign5, + __asyncDelegator: () => __asyncDelegator5, + __asyncGenerator: () => __asyncGenerator5, + __asyncValues: () => __asyncValues5, + __await: () => __await5, + __awaiter: () => __awaiter6, + __classPrivateFieldGet: () => __classPrivateFieldGet5, + __classPrivateFieldSet: () => __classPrivateFieldSet5, + __createBinding: () => __createBinding5, + __decorate: () => __decorate5, + __exportStar: () => __exportStar5, + __extends: () => __extends5, + __generator: () => __generator5, + __importDefault: () => __importDefault5, + __importStar: () => __importStar5, + __makeTemplateObject: () => __makeTemplateObject5, + __metadata: () => __metadata5, + __param: () => __param5, + __read: () => __read5, + __rest: () => __rest5, + __spread: () => __spread5, + __spreadArrays: () => __spreadArrays5, + __values: () => __values5 +}); +function __extends5(d7, b8) { + extendStatics5(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest5(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate5(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param5(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __metadata5(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter6(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator5(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (_6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __createBinding5(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; +} +function __exportStar5(m7, exports28) { + for (var p7 in m7) + if (p7 !== "default" && !exports28.hasOwnProperty(p7)) + exports28[p7] = m7[p7]; +} +function __values5(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read5(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread5() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read5(arguments[i7])); + return ar; +} +function __spreadArrays5() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __await5(v8) { + return this instanceof __await5 ? (this.v = v8, this) : new __await5(v8); +} +function __asyncGenerator5(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await5 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator5(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await5(o7[n7](v8)), done: n7 === "return" } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues5(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values5 === "function" ? __values5(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject5(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar5(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (Object.hasOwnProperty.call(mod2, k6)) + result2[k6] = mod2[k6]; + } + result2.default = mod2; + return result2; +} +function __importDefault5(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet5(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} +function __classPrivateFieldSet5(receiver, privateMap, value2) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value2); + return value2; +} +var extendStatics5, __assign5; +var init_tslib_es65 = __esm({ + "node_modules/tslib/tslib.es6.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics5 = function(d7, b8) { + extendStatics5 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (b9.hasOwnProperty(p7)) + d8[p7] = b9[p7]; + }; + return extendStatics5(d7, b8); + }; + __assign5 = function() { + __assign5 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign5.apply(this, arguments); + }; + } +}); + +// node_modules/node-fetch/browser.js +var require_browser = __commonJS({ + "node_modules/node-fetch/browser.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var getGlobal = function() { + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof globalThis !== "undefined") { + return globalThis; + } + throw new Error("unable to locate global object"); + }; + var globalObject = getGlobal(); + module5.exports = exports28 = globalObject.fetch; + if (globalObject.fetch) { + exports28.default = globalObject.fetch.bind(globalObject); + } + exports28.Headers = globalObject.Headers; + exports28.Request = globalObject.Request; + exports28.Response = globalObject.Response; + } +}); + +// node_modules/@stoplight/json-ref-readers/http.js +var require_http = __commonJS({ + "node_modules/@stoplight/json-ref-readers/http.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es65(), __toCommonJS(tslib_es6_exports5)); + var node_fetch_1 = require_browser(); + var OpenError = class extends Error { + constructor() { + super(...arguments); + this.name = "OpenError"; + } + }; + exports28.OpenError = OpenError; + var NetworkError = class extends Error { + constructor() { + super(...arguments); + this.name = "ReadError"; + } + }; + exports28.NetworkError = NetworkError; + function resolveHttp4(ref, opts = {}) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const uri = ref.href(); + const response = yield node_fetch_1.default(uri, opts); + if (response.ok) { + return response.text(); + } + if (response.status === 404) { + throw new OpenError(`Page not found: ${uri}`); + } + throw new NetworkError(`${response.status} ${response.statusText}`); + }); + } + exports28.resolveHttp = resolveHttp4; + function createResolveHttp(defaultRequestOptions = {}) { + return (ref) => resolveHttp4(ref, defaultRequestOptions); + } + exports28.createResolveHttp = createResolveHttp; + } +}); + +// src/browser/shims/fs.ts +var fs_exports = {}; +__export(fs_exports, { + Stats: () => Stats, + access: () => access, + accessSync: () => accessSync, + appendFile: () => appendFile, + chmod: () => chmod, + chown: () => chown, + constants: () => constants, + copyFile: () => copyFile, + copyFileSync: () => copyFileSync, + default: () => fs_default, + existsSync: () => existsSync, + link: () => link, + lstat: () => lstat, + lstatSync: () => lstatSync, + mkdir: () => mkdir, + mkdirSync: () => mkdirSync, + open: () => open, + promises: () => promises, + readFile: () => readFile, + readFileSync: () => readFileSync, + readdir: () => readdir, + readdirSync: () => readdirSync, + readlink: () => readlink, + realpath: () => realpath, + realpathSync: () => realpathSync, + rename: () => rename, + renameSync: () => renameSync, + rm: () => rm, + rmdir: () => rmdir, + rmdirSync: () => rmdirSync, + stat: () => stat, + statSync: () => statSync, + symlink: () => symlink, + truncate: () => truncate2, + unlink: () => unlink, + unlinkSync: () => unlinkSync, + utimes: () => utimes, + writeFile: () => writeFile, + writeFileSync: () => writeFileSync +}); +var notSupportedAsync, notSupportedSync, FakeStats, fakeStats, Stats, readFile, writeFile, mkdir, readdir, stat, unlink, rmdir, access, copyFile, rename, lstat, realpath, chmod, chown, utimes, link, symlink, readlink, truncate2, appendFile, open, rm, readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, unlinkSync, rmdirSync, accessSync, copyFileSync, renameSync, lstatSync, realpathSync, promises, constants, fs_default; +var init_fs = __esm({ + "src/browser/shims/fs.ts"() { + init_dirname(); + init_buffer2(); + init_process2(); + notSupportedAsync = (name2) => { + return (..._args) => { + return Promise.reject( + new Error(`fs.${name2} is not supported in browser environment`) + ); + }; + }; + notSupportedSync = (name2) => { + return (..._args) => { + throw new Error(`fs.${name2} is not supported in browser environment`); + }; + }; + FakeStats = class { + constructor() { + __publicField(this, "dev", 0); + __publicField(this, "ino", 0); + __publicField(this, "mode", 0); + __publicField(this, "nlink", 0); + __publicField(this, "uid", 0); + __publicField(this, "gid", 0); + __publicField(this, "rdev", 0); + __publicField(this, "size", 0); + __publicField(this, "blksize", 0); + __publicField(this, "blocks", 0); + __publicField(this, "atimeMs", 0); + __publicField(this, "mtimeMs", 0); + __publicField(this, "ctimeMs", 0); + __publicField(this, "birthtimeMs", 0); + __publicField(this, "atime", /* @__PURE__ */ new Date(0)); + __publicField(this, "mtime", /* @__PURE__ */ new Date(0)); + __publicField(this, "ctime", /* @__PURE__ */ new Date(0)); + __publicField(this, "birthtime", /* @__PURE__ */ new Date(0)); + } + isFile() { + return false; + } + isDirectory() { + return false; + } + isBlockDevice() { + return false; + } + isCharacterDevice() { + return false; + } + isSymbolicLink() { + return false; + } + isFIFO() { + return false; + } + isSocket() { + return false; + } + }; + fakeStats = new FakeStats(); + Stats = FakeStats; + readFile = notSupportedAsync("readFile"); + writeFile = notSupportedAsync("writeFile"); + mkdir = notSupportedAsync("mkdir"); + readdir = notSupportedAsync("readdir"); + stat = notSupportedAsync("stat"); + unlink = notSupportedAsync("unlink"); + rmdir = notSupportedAsync("rmdir"); + access = notSupportedAsync("access"); + copyFile = notSupportedAsync("copyFile"); + rename = notSupportedAsync("rename"); + lstat = notSupportedAsync("lstat"); + realpath = notSupportedAsync("realpath"); + chmod = notSupportedAsync("chmod"); + chown = notSupportedAsync("chown"); + utimes = notSupportedAsync("utimes"); + link = notSupportedAsync("link"); + symlink = notSupportedAsync("symlink"); + readlink = notSupportedAsync("readlink"); + truncate2 = notSupportedAsync("truncate"); + appendFile = notSupportedAsync("appendFile"); + open = notSupportedAsync("open"); + rm = notSupportedAsync("rm"); + readFileSync = notSupportedSync("readFileSync"); + writeFileSync = notSupportedSync("writeFileSync"); + existsSync = () => false; + mkdirSync = notSupportedSync("mkdirSync"); + readdirSync = () => []; + statSync = () => fakeStats; + unlinkSync = notSupportedSync("unlinkSync"); + rmdirSync = notSupportedSync("rmdirSync"); + accessSync = notSupportedSync("accessSync"); + copyFileSync = notSupportedSync("copyFileSync"); + renameSync = notSupportedSync("renameSync"); + lstatSync = () => fakeStats; + realpathSync = notSupportedSync("realpathSync"); + promises = { + readFile, + writeFile, + mkdir, + readdir, + stat, + unlink, + rmdir, + access, + copyFile, + rename, + lstat, + realpath, + chmod, + chown, + utimes, + link, + symlink, + readlink, + truncate: truncate2, + appendFile, + open, + rm + }; + constants = { + F_OK: 0, + R_OK: 4, + W_OK: 2, + X_OK: 1, + COPYFILE_EXCL: 1, + COPYFILE_FICLONE: 2, + COPYFILE_FICLONE_FORCE: 4, + O_RDONLY: 0, + O_WRONLY: 1, + O_RDWR: 2, + O_CREAT: 64, + O_EXCL: 128, + O_TRUNC: 512, + O_APPEND: 1024, + O_DIRECTORY: 65536, + O_NOFOLLOW: 131072, + O_SYNC: 1052672, + O_DSYNC: 4096, + O_SYMLINK: 2097152, + O_NONBLOCK: 2048 + }; + fs_default = { + readFile, + writeFile, + mkdir, + readdir, + stat, + unlink, + rmdir, + access, + copyFile, + rename, + readFileSync, + writeFileSync, + existsSync, + mkdirSync, + readdirSync, + statSync, + unlinkSync, + rmdirSync, + accessSync, + copyFileSync, + renameSync, + lstatSync, + realpathSync, + lstat, + promises, + constants, + Stats + }; + } +}); + +// node_modules/@stoplight/json-ref-readers/file.js +var require_file = __commonJS({ + "node_modules/@stoplight/json-ref-readers/file.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var fs_1 = (init_fs(), __toCommonJS(fs_exports)); + function resolveFile4(ref) { + return new Promise((resolve3, reject2) => { + const path2 = ref.href(); + fs_1.readFile(path2, "utf8", (err, data) => { + if (err) { + reject2(err); + } else { + resolve3(data); + } + }); + }); + } + exports28.resolveFile = resolveFile4; + } +}); + +// node_modules/@stoplight/json-ref-readers/index.js +var require_json_ref_readers = __commonJS({ + "node_modules/@stoplight/json-ref-readers/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var http_1 = require_http(); + exports28.createResolveHttp = http_1.createResolveHttp; + exports28.resolveHttp = http_1.resolveHttp; + exports28.NetworkError = http_1.NetworkError; + exports28.OpenError = http_1.OpenError; + var file_1 = require_file(); + exports28.resolveFile = file_1.resolveFile; + } +}); + +// node_modules/@stoplight/json-ref-resolver/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports6 = {}; +__export(tslib_es6_exports6, { + __addDisposableResource: () => __addDisposableResource5, + __assign: () => __assign6, + __asyncDelegator: () => __asyncDelegator6, + __asyncGenerator: () => __asyncGenerator6, + __asyncValues: () => __asyncValues6, + __await: () => __await6, + __awaiter: () => __awaiter7, + __classPrivateFieldGet: () => __classPrivateFieldGet6, + __classPrivateFieldIn: () => __classPrivateFieldIn5, + __classPrivateFieldSet: () => __classPrivateFieldSet6, + __createBinding: () => __createBinding6, + __decorate: () => __decorate6, + __disposeResources: () => __disposeResources5, + __esDecorate: () => __esDecorate5, + __exportStar: () => __exportStar6, + __extends: () => __extends6, + __generator: () => __generator6, + __importDefault: () => __importDefault6, + __importStar: () => __importStar6, + __makeTemplateObject: () => __makeTemplateObject6, + __metadata: () => __metadata6, + __param: () => __param6, + __propKey: () => __propKey5, + __read: () => __read6, + __rest: () => __rest6, + __runInitializers: () => __runInitializers5, + __setFunctionName: () => __setFunctionName5, + __spread: () => __spread6, + __spreadArray: () => __spreadArray5, + __spreadArrays: () => __spreadArrays6, + __values: () => __values6, + default: () => tslib_es6_default5 +}); +function __extends6(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics6(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest6(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate6(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param6(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate5(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers5(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey5(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName5(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata6(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter7(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator6(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar6(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding6(o7, m7, p7); +} +function __values6(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read6(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread6() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read6(arguments[i7])); + return ar; +} +function __spreadArrays6() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray5(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await6(v8) { + return this instanceof __await6 ? (this.v = v8, this) : new __await6(v8); +} +function __asyncGenerator6(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await6 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator6(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await6(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues6(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values6 === "function" ? __values6(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject6(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar6(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding6(result2, mod2, k6); + } + __setModuleDefault5(result2, mod2); + return result2; +} +function __importDefault6(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet6(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet6(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn5(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); +} +function __addDisposableResource5(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources5(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError5(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics6, __assign6, __createBinding6, __setModuleDefault5, _SuppressedError5, tslib_es6_default5; +var init_tslib_es66 = __esm({ + "node_modules/@stoplight/json-ref-resolver/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics6 = function(d7, b8) { + extendStatics6 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics6(d7, b8); + }; + __assign6 = function() { + __assign6 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign6.apply(this, arguments); + }; + __createBinding6 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault5 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError5 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default5 = { + __extends: __extends6, + __assign: __assign6, + __rest: __rest6, + __decorate: __decorate6, + __param: __param6, + __metadata: __metadata6, + __awaiter: __awaiter7, + __generator: __generator6, + __createBinding: __createBinding6, + __exportStar: __exportStar6, + __values: __values6, + __read: __read6, + __spread: __spread6, + __spreadArrays: __spreadArrays6, + __spreadArray: __spreadArray5, + __await: __await6, + __asyncGenerator: __asyncGenerator6, + __asyncDelegator: __asyncDelegator6, + __asyncValues: __asyncValues6, + __makeTemplateObject: __makeTemplateObject6, + __importStar: __importStar6, + __importDefault: __importDefault6, + __classPrivateFieldGet: __classPrivateFieldGet6, + __classPrivateFieldSet: __classPrivateFieldSet6, + __classPrivateFieldIn: __classPrivateFieldIn5, + __addDisposableResource: __addDisposableResource5, + __disposeResources: __disposeResources5 + }; + } +}); + +// node_modules/dependency-graph/lib/dep_graph.js +var require_dep_graph = __commonJS({ + "node_modules/dependency-graph/lib/dep_graph.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + function createDFS(edges, leavesOnly, result2, circular) { + var visited = {}; + return function(start) { + if (visited[start]) { + return; + } + var inCurrentPath = {}; + var currentPath = []; + var todo = []; + todo.push({ node: start, processed: false }); + while (todo.length > 0) { + var current = todo[todo.length - 1]; + var processed = current.processed; + var node = current.node; + if (!processed) { + if (visited[node]) { + todo.pop(); + continue; + } else if (inCurrentPath[node]) { + if (circular) { + todo.pop(); + continue; + } + currentPath.push(node); + throw new DepGraphCycleError(currentPath); + } + inCurrentPath[node] = true; + currentPath.push(node); + var nodeEdges = edges[node]; + for (var i7 = nodeEdges.length - 1; i7 >= 0; i7--) { + todo.push({ node: nodeEdges[i7], processed: false }); + } + current.processed = true; + } else { + todo.pop(); + currentPath.pop(); + inCurrentPath[node] = false; + visited[node] = true; + if (!leavesOnly || edges[node].length === 0) { + result2.push(node); + } + } + } + }; + } + var DepGraph = exports28.DepGraph = function DepGraph2(opts) { + this.nodes = {}; + this.outgoingEdges = {}; + this.incomingEdges = {}; + this.circular = opts && !!opts.circular; + }; + DepGraph.prototype = { + /** + * The number of nodes in the graph. + */ + size: function() { + return Object.keys(this.nodes).length; + }, + /** + * Add a node to the dependency graph. If a node already exists, this method will do nothing. + */ + addNode: function(node, data) { + if (!this.hasNode(node)) { + if (arguments.length === 2) { + this.nodes[node] = data; + } else { + this.nodes[node] = node; + } + this.outgoingEdges[node] = []; + this.incomingEdges[node] = []; + } + }, + /** + * Remove a node from the dependency graph. If a node does not exist, this method will do nothing. + */ + removeNode: function(node) { + if (this.hasNode(node)) { + delete this.nodes[node]; + delete this.outgoingEdges[node]; + delete this.incomingEdges[node]; + [this.incomingEdges, this.outgoingEdges].forEach(function(edgeList) { + Object.keys(edgeList).forEach(function(key) { + var idx = edgeList[key].indexOf(node); + if (idx >= 0) { + edgeList[key].splice(idx, 1); + } + }, this); + }); + } + }, + /** + * Check if a node exists in the graph + */ + hasNode: function(node) { + return this.nodes.hasOwnProperty(node); + }, + /** + * Get the data associated with a node name + */ + getNodeData: function(node) { + if (this.hasNode(node)) { + return this.nodes[node]; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Set the associated data for a given node name. If the node does not exist, this method will throw an error + */ + setNodeData: function(node, data) { + if (this.hasNode(node)) { + this.nodes[node] = data; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Add a dependency between two nodes. If either of the nodes does not exist, + * an Error will be thrown. + */ + addDependency: function(from, to) { + if (!this.hasNode(from)) { + throw new Error("Node does not exist: " + from); + } + if (!this.hasNode(to)) { + throw new Error("Node does not exist: " + to); + } + if (this.outgoingEdges[from].indexOf(to) === -1) { + this.outgoingEdges[from].push(to); + } + if (this.incomingEdges[to].indexOf(from) === -1) { + this.incomingEdges[to].push(from); + } + return true; + }, + /** + * Remove a dependency between two nodes. + */ + removeDependency: function(from, to) { + var idx; + if (this.hasNode(from)) { + idx = this.outgoingEdges[from].indexOf(to); + if (idx >= 0) { + this.outgoingEdges[from].splice(idx, 1); + } + } + if (this.hasNode(to)) { + idx = this.incomingEdges[to].indexOf(from); + if (idx >= 0) { + this.incomingEdges[to].splice(idx, 1); + } + } + }, + /** + * Return a clone of the dependency graph. If any custom data is attached + * to the nodes, it will only be shallow copied. + */ + clone: function() { + var source = this; + var result2 = new DepGraph(); + var keys2 = Object.keys(source.nodes); + keys2.forEach(function(n7) { + result2.nodes[n7] = source.nodes[n7]; + result2.outgoingEdges[n7] = source.outgoingEdges[n7].slice(0); + result2.incomingEdges[n7] = source.incomingEdges[n7].slice(0); + }); + return result2; + }, + /** + * Get an array containing the direct dependencies of the specified node. + * + * Throws an Error if the specified node does not exist. + */ + directDependenciesOf: function(node) { + if (this.hasNode(node)) { + return this.outgoingEdges[node].slice(0); + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Get an array containing the nodes that directly depend on the specified node. + * + * Throws an Error if the specified node does not exist. + */ + directDependantsOf: function(node) { + if (this.hasNode(node)) { + return this.incomingEdges[node].slice(0); + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Get an array containing the nodes that the specified node depends on (transitively). + * + * Throws an Error if the graph has a cycle, or the specified node does not exist. + * + * If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned + * in the array. + */ + dependenciesOf: function(node, leavesOnly) { + if (this.hasNode(node)) { + var result2 = []; + var DFS = createDFS( + this.outgoingEdges, + leavesOnly, + result2, + this.circular + ); + DFS(node); + var idx = result2.indexOf(node); + if (idx >= 0) { + result2.splice(idx, 1); + } + return result2; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * get an array containing the nodes that depend on the specified node (transitively). + * + * Throws an Error if the graph has a cycle, or the specified node does not exist. + * + * If `leavesOnly` is true, only nodes that do not have any dependants will be returned in the array. + */ + dependantsOf: function(node, leavesOnly) { + if (this.hasNode(node)) { + var result2 = []; + var DFS = createDFS( + this.incomingEdges, + leavesOnly, + result2, + this.circular + ); + DFS(node); + var idx = result2.indexOf(node); + if (idx >= 0) { + result2.splice(idx, 1); + } + return result2; + } else { + throw new Error("Node does not exist: " + node); + } + }, + /** + * Construct the overall processing order for the dependency graph. + * + * Throws an Error if the graph has a cycle. + * + * If `leavesOnly` is true, only nodes that do not depend on any other nodes will be returned. + */ + overallOrder: function(leavesOnly) { + var self2 = this; + var result2 = []; + var keys2 = Object.keys(this.nodes); + if (keys2.length === 0) { + return result2; + } else { + if (!this.circular) { + var CycleDFS = createDFS(this.outgoingEdges, false, [], this.circular); + keys2.forEach(function(n7) { + CycleDFS(n7); + }); + } + var DFS = createDFS( + this.outgoingEdges, + leavesOnly, + result2, + this.circular + ); + keys2.filter(function(node) { + return self2.incomingEdges[node].length === 0; + }).forEach(function(n7) { + DFS(n7); + }); + if (this.circular) { + keys2.filter(function(node) { + return result2.indexOf(node) === -1; + }).forEach(function(n7) { + DFS(n7); + }); + } + return result2; + } + }, + /** + * Get an array of nodes that have no dependants (i.e. nothing depends on them). + */ + entryNodes: function() { + var self2 = this; + return Object.keys(this.nodes).filter(function(node) { + return self2.incomingEdges[node].length === 0; + }); + } + }; + DepGraph.prototype.directDependentsOf = DepGraph.prototype.directDependantsOf; + DepGraph.prototype.dependentsOf = DepGraph.prototype.dependantsOf; + var DepGraphCycleError = exports28.DepGraphCycleError = function(cyclePath) { + var message = "Dependency Cycle Found: " + cyclePath.join(" -> "); + var instance = new Error(message); + instance.cyclePath = cyclePath; + Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); + if (Error.captureStackTrace) { + Error.captureStackTrace(instance, DepGraphCycleError); + } + return instance; + }; + DepGraphCycleError.prototype = Object.create(Error.prototype, { + constructor: { + value: Error, + enumerable: false, + writable: true, + configurable: true + } + }); + Object.setPrototypeOf(DepGraphCycleError, Error); + } +}); + +// node_modules/@stoplight/json-ref-resolver/cache.js +var require_cache = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/cache.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Cache = void 0; + var Cache4 = class { + constructor(opts = {}) { + this._stats = { + hits: 0, + misses: 0 + }; + this._data = {}; + this._stdTTL = opts.stdTTL; + } + get stats() { + return this._stats; + } + get(key) { + const d7 = this._data[key]; + if (d7 && (!this._stdTTL || (/* @__PURE__ */ new Date()).getTime() - d7.ts < this._stdTTL)) { + this._stats.hits += 1; + return d7.val; + } + this._stats.misses += 1; + } + set(key, val) { + this._data[key] = { + ts: (/* @__PURE__ */ new Date()).getTime(), + val + }; + } + has(key) { + return key in this._data; + } + purge() { + Object.assign(this._stats, { + hits: 0, + misses: 0 + }); + this._data = {}; + } + }; + exports28.Cache = Cache4; + } +}); + +// node_modules/immer/dist/immer.cjs.production.min.js +var require_immer_cjs_production_min = __commonJS({ + "node_modules/immer/dist/immer.cjs.production.min.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + function n7(n8) { + for (var r9 = arguments.length, t9 = Array(r9 > 1 ? r9 - 1 : 0), e11 = 1; e11 < r9; e11++) + t9[e11 - 1] = arguments[e11]; + throw Error("[Immer] minified error nr: " + n8 + (t9.length ? " " + t9.map(function(n9) { + return "'" + n9 + "'"; + }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf"); + } + function r8(n8) { + return !!n8 && !!n8[H5]; + } + function t8(n8) { + var r9; + return !!n8 && (function(n9) { + if (!n9 || "object" != typeof n9) + return false; + var r10 = Object.getPrototypeOf(n9); + if (null === r10) + return true; + var t9 = Object.hasOwnProperty.call(r10, "constructor") && r10.constructor; + return t9 === Object || "function" == typeof t9 && Function.toString.call(t9) === Q5; + }(n8) || Array.isArray(n8) || !!n8[G5] || !!(null === (r9 = n8.constructor) || void 0 === r9 ? void 0 : r9[G5]) || c7(n8) || v8(n8)); + } + function e10(n8, r9, t9) { + void 0 === t9 && (t9 = false), 0 === i7(n8) ? (t9 ? Object.keys : T6)(n8).forEach(function(e11) { + t9 && "symbol" == typeof e11 || r9(e11, n8[e11], n8); + }) : n8.forEach(function(t10, e11) { + return r9(e11, t10, n8); + }); + } + function i7(n8) { + var r9 = n8[H5]; + return r9 ? r9.t > 3 ? r9.t - 4 : r9.t : Array.isArray(n8) ? 1 : c7(n8) ? 2 : v8(n8) ? 3 : 0; + } + function u7(n8, r9) { + return 2 === i7(n8) ? n8.has(r9) : Object.prototype.hasOwnProperty.call(n8, r9); + } + function o7(n8, r9) { + return 2 === i7(n8) ? n8.get(r9) : n8[r9]; + } + function f8(n8, r9, t9) { + var e11 = i7(n8); + 2 === e11 ? n8.set(r9, t9) : 3 === e11 ? n8.add(t9) : n8[r9] = t9; + } + function a7(n8, r9) { + return n8 === r9 ? 0 !== n8 || 1 / n8 == 1 / r9 : n8 != n8 && r9 != r9; + } + function c7(n8) { + return W5 && n8 instanceof Map; + } + function v8(n8) { + return X5 && n8 instanceof Set; + } + function s7(n8) { + return n8.i || n8.u; + } + function p7(n8) { + if (Array.isArray(n8)) + return Array.prototype.slice.call(n8); + var r9 = U6(n8); + delete r9[H5]; + for (var t9 = T6(r9), e11 = 0; e11 < t9.length; e11++) { + var i8 = t9[e11], u8 = r9[i8]; + false === u8.writable && (u8.writable = true, u8.configurable = true), (u8.get || u8.set) && (r9[i8] = { configurable: true, writable: true, enumerable: u8.enumerable, value: n8[i8] }); + } + return Object.create(Object.getPrototypeOf(n8), r9); + } + function l7(n8, u8) { + return void 0 === u8 && (u8 = false), h8(n8) || r8(n8) || !t8(n8) || (i7(n8) > 1 && (n8.set = n8.add = n8.clear = n8.delete = d7), Object.freeze(n8), u8 && e10(n8, function(n9, r9) { + return l7(r9, true); + }, true)), n8; + } + function d7() { + n7(2); + } + function h8(n8) { + return null == n8 || "object" != typeof n8 || Object.isFrozen(n8); + } + function y7(r9) { + var t9 = V5[r9]; + return t9 || n7(18, r9), t9; + } + function _6(n8, r9) { + V5[n8] || (V5[n8] = r9); + } + function b8() { + return I6; + } + function m7(n8, r9) { + r9 && (y7("Patches"), n8.o = [], n8.v = [], n8.s = r9); + } + function j6(n8) { + O7(n8), n8.p.forEach(w6), n8.p = null; + } + function O7(n8) { + n8 === I6 && (I6 = n8.l); + } + function x7(n8) { + return I6 = { p: [], l: I6, h: n8, _: true, m: 0 }; + } + function w6(n8) { + var r9 = n8[H5]; + 0 === r9.t || 1 === r9.t ? r9.j() : r9.O = true; + } + function S6(r9, e11) { + e11.m = e11.p.length; + var i8 = e11.p[0], u8 = void 0 !== r9 && r9 !== i8; + return e11.h.S || y7("ES5").P(e11, r9, u8), u8 ? (i8[H5].g && (j6(e11), n7(4)), t8(r9) && (r9 = P6(e11, r9), e11.l || M6(e11, r9)), e11.o && y7("Patches").M(i8[H5].u, r9, e11.o, e11.v)) : r9 = P6(e11, i8, []), j6(e11), e11.o && e11.s(e11.o, e11.v), r9 !== B6 ? r9 : void 0; + } + function P6(n8, r9, t9) { + if (h8(r9)) + return r9; + var i8 = r9[H5]; + if (!i8) + return e10(r9, function(e11, u9) { + return g7(n8, i8, r9, e11, u9, t9); + }, true), r9; + if (i8.A !== n8) + return r9; + if (!i8.g) + return M6(n8, i8.u, true), i8.u; + if (!i8.R) { + i8.R = true, i8.A.m--; + var u8 = 4 === i8.t || 5 === i8.t ? i8.i = p7(i8.k) : i8.i, o8 = u8, f9 = false; + 3 === i8.t && (o8 = new Set(u8), u8.clear(), f9 = true), e10(o8, function(r10, e11) { + return g7(n8, i8, u8, r10, e11, t9, f9); + }), M6(n8, u8, false), t9 && n8.o && y7("Patches").F(i8, t9, n8.o, n8.v); + } + return i8.i; + } + function g7(n8, e11, i8, o8, a8, c8, v9) { + if (r8(a8)) { + var s8 = P6(n8, a8, c8 && e11 && 3 !== e11.t && !u7(e11.N, o8) ? c8.concat(o8) : void 0); + if (f8(i8, o8, s8), !r8(s8)) + return; + n8._ = false; + } else + v9 && i8.add(a8); + if (t8(a8) && !h8(a8)) { + if (!n8.h.D && n8.m < 1) + return; + P6(n8, a8), e11 && e11.A.l || M6(n8, a8); + } + } + function M6(n8, r9, t9) { + void 0 === t9 && (t9 = false), !n8.l && n8.h.D && n8._ && l7(r9, t9); + } + function A6(n8, r9) { + var t9 = n8[H5]; + return (t9 ? s7(t9) : n8)[r9]; + } + function z6(n8, r9) { + if (r9 in n8) + for (var t9 = Object.getPrototypeOf(n8); t9; ) { + var e11 = Object.getOwnPropertyDescriptor(t9, r9); + if (e11) + return e11; + t9 = Object.getPrototypeOf(t9); + } + } + function E6(n8) { + n8.g || (n8.g = true, n8.l && E6(n8.l)); + } + function R6(n8) { + n8.i || (n8.i = p7(n8.u)); + } + function k6(n8, r9, t9) { + var e11 = c7(r9) ? y7("MapSet").K(r9, t9) : v8(r9) ? y7("MapSet").$(r9, t9) : n8.S ? function(n9, r10) { + var t10 = Array.isArray(n9), e12 = { t: t10 ? 1 : 0, A: r10 ? r10.A : b8(), g: false, R: false, N: {}, l: r10, u: n9, k: null, i: null, j: null, C: false }, i8 = e12, u8 = Y6; + t10 && (i8 = [e12], u8 = Z5); + var o8 = Proxy.revocable(i8, u8), f9 = o8.revoke, a8 = o8.proxy; + return e12.k = a8, e12.j = f9, a8; + }(r9, t9) : y7("ES5").I(r9, t9); + return (t9 ? t9.A : b8()).p.push(e11), e11; + } + function F6(u8) { + return r8(u8) || n7(22, u8), function n8(r9) { + if (!t8(r9)) + return r9; + var u9, a8 = r9[H5], c8 = i7(r9); + if (a8) { + if (!a8.g && (a8.t < 4 || !y7("ES5").J(a8))) + return a8.u; + a8.R = true, u9 = N6(r9, c8), a8.R = false; + } else + u9 = N6(r9, c8); + return e10(u9, function(r10, t9) { + a8 && o7(a8.u, r10) === t9 || f8(u9, r10, n8(t9)); + }), 3 === c8 ? new Set(u9) : u9; + }(u8); + } + function N6(n8, r9) { + switch (r9) { + case 2: + return new Map(n8); + case 3: + return Array.from(n8); + } + return p7(n8); + } + function D6() { + function n8(n9, r9) { + var t10 = f9[n9]; + return t10 ? t10.enumerable = r9 : f9[n9] = t10 = { configurable: true, enumerable: r9, get: function() { + return Y6.get(this[H5], n9); + }, set: function(r10) { + Y6.set(this[H5], n9, r10); + } }, t10; + } + function t9(n9) { + for (var r9 = n9.length - 1; r9 >= 0; r9--) { + var t10 = n9[r9][H5]; + if (!t10.g) + switch (t10.t) { + case 5: + o8(t10) && E6(t10); + break; + case 4: + i8(t10) && E6(t10); + } + } + } + function i8(n9) { + for (var r9 = n9.u, t10 = n9.k, e11 = T6(t10), i9 = e11.length - 1; i9 >= 0; i9--) { + var o9 = e11[i9]; + if (o9 !== H5) { + var f10 = r9[o9]; + if (void 0 === f10 && !u7(r9, o9)) + return true; + var c8 = t10[o9], v9 = c8 && c8[H5]; + if (v9 ? v9.u !== f10 : !a7(c8, f10)) + return true; + } + } + var s8 = !!r9[H5]; + return e11.length !== T6(r9).length + (s8 ? 0 : 1); + } + function o8(n9) { + var r9 = n9.k; + if (r9.length !== n9.u.length) + return true; + var t10 = Object.getOwnPropertyDescriptor(r9, r9.length - 1); + if (t10 && !t10.get) + return true; + for (var e11 = 0; e11 < r9.length; e11++) + if (!r9.hasOwnProperty(e11)) + return true; + return false; + } + var f9 = {}; + _6("ES5", { I: function(r9, t10) { + var e11 = Array.isArray(r9), i9 = function(r10, t11) { + if (r10) { + for (var e12 = Array(t11.length), i10 = 0; i10 < t11.length; i10++) + Object.defineProperty(e12, "" + i10, n8(i10, true)); + return e12; + } + var u9 = U6(t11); + delete u9[H5]; + for (var o9 = T6(u9), f10 = 0; f10 < o9.length; f10++) { + var a8 = o9[f10]; + u9[a8] = n8(a8, r10 || !!u9[a8].enumerable); + } + return Object.create(Object.getPrototypeOf(t11), u9); + }(e11, r9), u8 = { t: e11 ? 5 : 4, A: t10 ? t10.A : b8(), g: false, R: false, N: {}, l: t10, u: r9, k: i9, i: null, O: false, C: false }; + return Object.defineProperty(i9, H5, { value: u8, writable: true }), i9; + }, P: function(n9, i9, f10) { + f10 ? r8(i9) && i9[H5].A === n9 && t9(n9.p) : (n9.o && function n10(r9) { + if (r9 && "object" == typeof r9) { + var t10 = r9[H5]; + if (t10) { + var i10 = t10.u, f11 = t10.k, a8 = t10.N, c8 = t10.t; + if (4 === c8) + e10(f11, function(r10) { + r10 !== H5 && (void 0 !== i10[r10] || u7(i10, r10) ? a8[r10] || n10(f11[r10]) : (a8[r10] = true, E6(t10))); + }), e10(i10, function(n11) { + void 0 !== f11[n11] || u7(f11, n11) || (a8[n11] = false, E6(t10)); + }); + else if (5 === c8) { + if (o8(t10) && (E6(t10), a8.length = true), f11.length < i10.length) + for (var v9 = f11.length; v9 < i10.length; v9++) + a8[v9] = false; + else + for (var s8 = i10.length; s8 < f11.length; s8++) + a8[s8] = true; + for (var p8 = Math.min(f11.length, i10.length), l8 = 0; l8 < p8; l8++) + f11.hasOwnProperty(l8) || (a8[l8] = true), void 0 === a8[l8] && n10(f11[l8]); + } + } + } + }(n9.p[0]), t9(n9.p)); + }, J: function(n9) { + return 4 === n9.t ? i8(n9) : o8(n9); + } }); + } + function K5() { + function f9(n8) { + if (!t8(n8)) + return n8; + if (Array.isArray(n8)) + return n8.map(f9); + if (c7(n8)) + return new Map(Array.from(n8.entries()).map(function(n9) { + return [n9[0], f9(n9[1])]; + })); + if (v8(n8)) + return new Set(Array.from(n8).map(f9)); + var r9 = Object.create(Object.getPrototypeOf(n8)); + for (var e11 in n8) + r9[e11] = f9(n8[e11]); + return u7(n8, G5) && (r9[G5] = n8[G5]), r9; + } + function a8(n8) { + return r8(n8) ? f9(n8) : n8; + } + var s8 = "add"; + _6("Patches", { W: function(r9, t9) { + return t9.forEach(function(t10) { + for (var e11 = t10.path, u8 = t10.op, a9 = r9, c8 = 0; c8 < e11.length - 1; c8++) { + var v9 = i7(a9), p8 = e11[c8]; + "string" != typeof p8 && "number" != typeof p8 && (p8 = "" + p8), 0 !== v9 && 1 !== v9 || "__proto__" !== p8 && "constructor" !== p8 || n7(24), "function" == typeof a9 && "prototype" === p8 && n7(24), "object" != typeof (a9 = o7(a9, p8)) && n7(15, e11.join("/")); + } + var l8 = i7(a9), d8 = f9(t10.value), h9 = e11[e11.length - 1]; + switch (u8) { + case "replace": + switch (l8) { + case 2: + return a9.set(h9, d8); + case 3: + n7(16); + default: + return a9[h9] = d8; + } + case s8: + switch (l8) { + case 1: + return "-" === h9 ? a9.push(d8) : a9.splice(h9, 0, d8); + case 2: + return a9.set(h9, d8); + case 3: + return a9.add(d8); + default: + return a9[h9] = d8; + } + case "remove": + switch (l8) { + case 1: + return a9.splice(h9, 1); + case 2: + return a9.delete(h9); + case 3: + return a9.delete(t10.value); + default: + return delete a9[h9]; + } + default: + n7(17, u8); + } + }), r9; + }, F: function(n8, r9, t9, i8) { + switch (n8.t) { + case 0: + case 4: + case 2: + return function(n9, r10, t10, i9) { + var f10 = n9.u, c8 = n9.i; + e10(n9.N, function(n10, e11) { + var v9 = o7(f10, n10), p8 = o7(c8, n10), l8 = e11 ? u7(f10, n10) ? "replace" : s8 : "remove"; + if (v9 !== p8 || "replace" !== l8) { + var d8 = r10.concat(n10); + t10.push("remove" === l8 ? { op: l8, path: d8 } : { op: l8, path: d8, value: p8 }), i9.push(l8 === s8 ? { op: "remove", path: d8 } : "remove" === l8 ? { op: s8, path: d8, value: a8(v9) } : { op: "replace", path: d8, value: a8(v9) }); + } + }); + }(n8, r9, t9, i8); + case 5: + case 1: + return function(n9, r10, t10, e11) { + var i9 = n9.u, u8 = n9.N, o8 = n9.i; + if (o8.length < i9.length) { + var f10 = [o8, i9]; + i9 = f10[0], o8 = f10[1]; + var c8 = [e11, t10]; + t10 = c8[0], e11 = c8[1]; + } + for (var v9 = 0; v9 < i9.length; v9++) + if (u8[v9] && o8[v9] !== i9[v9]) { + var p8 = r10.concat([v9]); + t10.push({ op: "replace", path: p8, value: a8(o8[v9]) }), e11.push({ op: "replace", path: p8, value: a8(i9[v9]) }); + } + for (var l8 = i9.length; l8 < o8.length; l8++) { + var d8 = r10.concat([l8]); + t10.push({ op: s8, path: d8, value: a8(o8[l8]) }); + } + i9.length < o8.length && e11.push({ op: "replace", path: r10.concat(["length"]), value: i9.length }); + }(n8, r9, t9, i8); + case 3: + return function(n9, r10, t10, e11) { + var i9 = n9.u, u8 = n9.i, o8 = 0; + i9.forEach(function(n10) { + if (!u8.has(n10)) { + var i10 = r10.concat([o8]); + t10.push({ op: "remove", path: i10, value: n10 }), e11.unshift({ op: s8, path: i10, value: n10 }); + } + o8++; + }), o8 = 0, u8.forEach(function(n10) { + if (!i9.has(n10)) { + var u9 = r10.concat([o8]); + t10.push({ op: s8, path: u9, value: n10 }), e11.unshift({ op: "remove", path: u9, value: n10 }); + } + o8++; + }); + }(n8, r9, t9, i8); + } + }, M: function(n8, r9, t9, e11) { + t9.push({ op: "replace", path: [], value: r9 === B6 ? void 0 : r9 }), e11.push({ op: "replace", path: [], value: n8 }); + } }); + } + function $5() { + function r9(n8, r10) { + function t9() { + this.constructor = n8; + } + f9(n8, r10), n8.prototype = (t9.prototype = r10.prototype, new t9()); + } + function i8(n8) { + n8.i || (n8.N = /* @__PURE__ */ new Map(), n8.i = new Map(n8.u)); + } + function u8(n8) { + n8.i || (n8.i = /* @__PURE__ */ new Set(), n8.u.forEach(function(r10) { + if (t8(r10)) { + var e11 = k6(n8.A.h, r10, n8); + n8.p.set(r10, e11), n8.i.add(e11); + } else + n8.i.add(r10); + })); + } + function o8(r10) { + r10.O && n7(3, JSON.stringify(s7(r10))); + } + var f9 = function(n8, r10) { + return (f9 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n9, r11) { + n9.__proto__ = r11; + } || function(n9, r11) { + for (var t9 in r11) + r11.hasOwnProperty(t9) && (n9[t9] = r11[t9]); + })(n8, r10); + }, a8 = function() { + function n8(n9, r10) { + return this[H5] = { t: 2, l: r10, A: r10 ? r10.A : b8(), g: false, R: false, i: void 0, N: void 0, u: n9, k: this, C: false, O: false }, this; + } + r9(n8, Map); + var u9 = n8.prototype; + return Object.defineProperty(u9, "size", { get: function() { + return s7(this[H5]).size; + } }), u9.has = function(n9) { + return s7(this[H5]).has(n9); + }, u9.set = function(n9, r10) { + var t9 = this[H5]; + return o8(t9), s7(t9).has(n9) && s7(t9).get(n9) === r10 || (i8(t9), E6(t9), t9.N.set(n9, true), t9.i.set(n9, r10), t9.N.set(n9, true)), this; + }, u9.delete = function(n9) { + if (!this.has(n9)) + return false; + var r10 = this[H5]; + return o8(r10), i8(r10), E6(r10), r10.u.has(n9) ? r10.N.set(n9, false) : r10.N.delete(n9), r10.i.delete(n9), true; + }, u9.clear = function() { + var n9 = this[H5]; + o8(n9), s7(n9).size && (i8(n9), E6(n9), n9.N = /* @__PURE__ */ new Map(), e10(n9.u, function(r10) { + n9.N.set(r10, false); + }), n9.i.clear()); + }, u9.forEach = function(n9, r10) { + var t9 = this; + s7(this[H5]).forEach(function(e11, i9) { + n9.call(r10, t9.get(i9), i9, t9); + }); + }, u9.get = function(n9) { + var r10 = this[H5]; + o8(r10); + var e11 = s7(r10).get(n9); + if (r10.R || !t8(e11)) + return e11; + if (e11 !== r10.u.get(n9)) + return e11; + var u10 = k6(r10.A.h, e11, r10); + return i8(r10), r10.i.set(n9, u10), u10; + }, u9.keys = function() { + return s7(this[H5]).keys(); + }, u9.values = function() { + var n9, r10 = this, t9 = this.keys(); + return (n9 = {})[L6] = function() { + return r10.values(); + }, n9.next = function() { + var n10 = t9.next(); + return n10.done ? n10 : { done: false, value: r10.get(n10.value) }; + }, n9; + }, u9.entries = function() { + var n9, r10 = this, t9 = this.keys(); + return (n9 = {})[L6] = function() { + return r10.entries(); + }, n9.next = function() { + var n10 = t9.next(); + if (n10.done) + return n10; + var e11 = r10.get(n10.value); + return { done: false, value: [n10.value, e11] }; + }, n9; + }, u9[L6] = function() { + return this.entries(); + }, n8; + }(), c8 = function() { + function n8(n9, r10) { + return this[H5] = { t: 3, l: r10, A: r10 ? r10.A : b8(), g: false, R: false, i: void 0, u: n9, k: this, p: /* @__PURE__ */ new Map(), O: false, C: false }, this; + } + r9(n8, Set); + var t9 = n8.prototype; + return Object.defineProperty(t9, "size", { get: function() { + return s7(this[H5]).size; + } }), t9.has = function(n9) { + var r10 = this[H5]; + return o8(r10), r10.i ? !!r10.i.has(n9) || !(!r10.p.has(n9) || !r10.i.has(r10.p.get(n9))) : r10.u.has(n9); + }, t9.add = function(n9) { + var r10 = this[H5]; + return o8(r10), this.has(n9) || (u8(r10), E6(r10), r10.i.add(n9)), this; + }, t9.delete = function(n9) { + if (!this.has(n9)) + return false; + var r10 = this[H5]; + return o8(r10), u8(r10), E6(r10), r10.i.delete(n9) || !!r10.p.has(n9) && r10.i.delete(r10.p.get(n9)); + }, t9.clear = function() { + var n9 = this[H5]; + o8(n9), s7(n9).size && (u8(n9), E6(n9), n9.i.clear()); + }, t9.values = function() { + var n9 = this[H5]; + return o8(n9), u8(n9), n9.i.values(); + }, t9.entries = function() { + var n9 = this[H5]; + return o8(n9), u8(n9), n9.i.entries(); + }, t9.keys = function() { + return this.values(); + }, t9[L6] = function() { + return this.values(); + }, t9.forEach = function(n9, r10) { + for (var t10 = this.values(), e11 = t10.next(); !e11.done; ) + n9.call(r10, e11.value, e11.value, this), e11 = t10.next(); + }, n8; + }(); + _6("MapSet", { K: function(n8, r10) { + return new a8(n8, r10); + }, $: function(n8, r10) { + return new c8(n8, r10); + } }); + } + var C6; + Object.defineProperty(exports28, "__esModule", { value: true }); + var I6; + var J5 = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"); + var W5 = "undefined" != typeof Map; + var X5 = "undefined" != typeof Set; + var q5 = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect; + var B6 = J5 ? Symbol.for("immer-nothing") : ((C6 = {})["immer-nothing"] = true, C6); + var G5 = J5 ? Symbol.for("immer-draftable") : "__$immer_draftable"; + var H5 = J5 ? Symbol.for("immer-state") : "__$immer_state"; + var L6 = "undefined" != typeof Symbol && Symbol.iterator || "@@iterator"; + var Q5 = "" + Object.prototype.constructor; + var T6 = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n8) { + return Object.getOwnPropertyNames(n8).concat(Object.getOwnPropertySymbols(n8)); + } : Object.getOwnPropertyNames; + var U6 = Object.getOwnPropertyDescriptors || function(n8) { + var r9 = {}; + return T6(n8).forEach(function(t9) { + r9[t9] = Object.getOwnPropertyDescriptor(n8, t9); + }), r9; + }; + var V5 = {}; + var Y6 = { get: function(n8, r9) { + if (r9 === H5) + return n8; + var e11 = s7(n8); + if (!u7(e11, r9)) + return function(n9, r10, t9) { + var e12, i9 = z6(r10, t9); + return i9 ? "value" in i9 ? i9.value : null === (e12 = i9.get) || void 0 === e12 ? void 0 : e12.call(n9.k) : void 0; + }(n8, e11, r9); + var i8 = e11[r9]; + return n8.R || !t8(i8) ? i8 : i8 === A6(n8.u, r9) ? (R6(n8), n8.i[r9] = k6(n8.A.h, i8, n8)) : i8; + }, has: function(n8, r9) { + return r9 in s7(n8); + }, ownKeys: function(n8) { + return Reflect.ownKeys(s7(n8)); + }, set: function(n8, r9, t9) { + var e11 = z6(s7(n8), r9); + if (null == e11 ? void 0 : e11.set) + return e11.set.call(n8.k, t9), true; + if (!n8.g) { + var i8 = A6(s7(n8), r9), o8 = null == i8 ? void 0 : i8[H5]; + if (o8 && o8.u === t9) + return n8.i[r9] = t9, n8.N[r9] = false, true; + if (a7(t9, i8) && (void 0 !== t9 || u7(n8.u, r9))) + return true; + R6(n8), E6(n8); + } + return n8.i[r9] === t9 && (void 0 !== t9 || r9 in n8.i) || Number.isNaN(t9) && Number.isNaN(n8.i[r9]) || (n8.i[r9] = t9, n8.N[r9] = true), true; + }, deleteProperty: function(n8, r9) { + return void 0 !== A6(n8.u, r9) || r9 in n8.u ? (n8.N[r9] = false, R6(n8), E6(n8)) : delete n8.N[r9], n8.i && delete n8.i[r9], true; + }, getOwnPropertyDescriptor: function(n8, r9) { + var t9 = s7(n8), e11 = Reflect.getOwnPropertyDescriptor(t9, r9); + return e11 ? { writable: true, configurable: 1 !== n8.t || "length" !== r9, enumerable: e11.enumerable, value: t9[r9] } : e11; + }, defineProperty: function() { + n7(11); + }, getPrototypeOf: function(n8) { + return Object.getPrototypeOf(n8.u); + }, setPrototypeOf: function() { + n7(12); + } }; + var Z5 = {}; + e10(Y6, function(n8, r9) { + Z5[n8] = function() { + return arguments[0] = arguments[0][0], r9.apply(this, arguments); + }; + }), Z5.deleteProperty = function(n8, r9) { + return Z5.set.call(this, n8, r9, void 0); + }, Z5.set = function(n8, r9, t9) { + return Y6.set.call(this, n8[0], r9, t9, n8[0]); + }; + var nn = function() { + function e11(r9) { + var e12 = this; + this.S = q5, this.D = true, this.produce = function(r10, i9, u8) { + if ("function" == typeof r10 && "function" != typeof i9) { + var o8 = i9; + i9 = r10; + var f9 = e12; + return function(n8) { + var r11 = this; + void 0 === n8 && (n8 = o8); + for (var t9 = arguments.length, e13 = Array(t9 > 1 ? t9 - 1 : 0), u9 = 1; u9 < t9; u9++) + e13[u9 - 1] = arguments[u9]; + return f9.produce(n8, function(n9) { + var t10; + return (t10 = i9).call.apply(t10, [r11, n9].concat(e13)); + }); + }; + } + var a8; + if ("function" != typeof i9 && n7(6), void 0 !== u8 && "function" != typeof u8 && n7(7), t8(r10)) { + var c8 = x7(e12), v9 = k6(e12, r10, void 0), s8 = true; + try { + a8 = i9(v9), s8 = false; + } finally { + s8 ? j6(c8) : O7(c8); + } + return "undefined" != typeof Promise && a8 instanceof Promise ? a8.then(function(n8) { + return m7(c8, u8), S6(n8, c8); + }, function(n8) { + throw j6(c8), n8; + }) : (m7(c8, u8), S6(a8, c8)); + } + if (!r10 || "object" != typeof r10) { + if (void 0 === (a8 = i9(r10)) && (a8 = r10), a8 === B6 && (a8 = void 0), e12.D && l7(a8, true), u8) { + var p8 = [], d8 = []; + y7("Patches").M(r10, a8, p8, d8), u8(p8, d8); + } + return a8; + } + n7(21, r10); + }, this.produceWithPatches = function(n8, r10) { + if ("function" == typeof n8) + return function(r11) { + for (var t10 = arguments.length, i10 = Array(t10 > 1 ? t10 - 1 : 0), u9 = 1; u9 < t10; u9++) + i10[u9 - 1] = arguments[u9]; + return e12.produceWithPatches(r11, function(r12) { + return n8.apply(void 0, [r12].concat(i10)); + }); + }; + var t9, i9, u8 = e12.produce(n8, r10, function(n9, r11) { + t9 = n9, i9 = r11; + }); + return "undefined" != typeof Promise && u8 instanceof Promise ? u8.then(function(n9) { + return [n9, t9, i9]; + }) : [u8, t9, i9]; + }, "boolean" == typeof (null == r9 ? void 0 : r9.useProxies) && this.setUseProxies(r9.useProxies), "boolean" == typeof (null == r9 ? void 0 : r9.autoFreeze) && this.setAutoFreeze(r9.autoFreeze); + } + var i8 = e11.prototype; + return i8.createDraft = function(e12) { + t8(e12) || n7(8), r8(e12) && (e12 = F6(e12)); + var i9 = x7(this), u8 = k6(this, e12, void 0); + return u8[H5].C = true, O7(i9), u8; + }, i8.finishDraft = function(n8, r9) { + var t9 = (n8 && n8[H5]).A; + return m7(t9, r9), S6(void 0, t9); + }, i8.setAutoFreeze = function(n8) { + this.D = n8; + }, i8.setUseProxies = function(r9) { + r9 && !q5 && n7(20), this.S = r9; + }, i8.applyPatches = function(n8, t9) { + var e12; + for (e12 = t9.length - 1; e12 >= 0; e12--) { + var i9 = t9[e12]; + if (0 === i9.path.length && "replace" === i9.op) { + n8 = i9.value; + break; + } + } + e12 > -1 && (t9 = t9.slice(e12 + 1)); + var u8 = y7("Patches").W; + return r8(n8) ? u8(n8, t9) : this.produce(n8, function(n9) { + return u8(n9, t9); + }); + }, e11; + }(); + var rn = new nn(); + var tn = rn.produce; + var en = rn.produceWithPatches.bind(rn); + var un = rn.setAutoFreeze.bind(rn); + var on4 = rn.setUseProxies.bind(rn); + var fn = rn.applyPatches.bind(rn); + var an = rn.createDraft.bind(rn); + var cn = rn.finishDraft.bind(rn); + exports28.Immer = nn, exports28.applyPatches = fn, exports28.castDraft = function(n8) { + return n8; + }, exports28.castImmutable = function(n8) { + return n8; + }, exports28.createDraft = an, exports28.current = F6, exports28.default = tn, exports28.enableAllPlugins = function() { + D6(), $5(), K5(); + }, exports28.enableES5 = D6, exports28.enableMapSet = $5, exports28.enablePatches = K5, exports28.finishDraft = cn, exports28.freeze = l7, exports28.immerable = G5, exports28.isDraft = r8, exports28.isDraftable = t8, exports28.nothing = B6, exports28.original = function(t9) { + return r8(t9) || n7(23, t9), t9[H5].u; + }, exports28.produce = tn, exports28.produceWithPatches = en, exports28.setAutoFreeze = un, exports28.setUseProxies = on4; + } +}); + +// node_modules/immer/dist/index.js +var require_dist5 = __commonJS({ + "node_modules/immer/dist/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + if (true) { + module5.exports = require_immer_cjs_production_min(); + } else { + module5.exports = null; + } + } +}); + +// node_modules/urijs/src/punycode.js +var require_punycode = __commonJS({ + "node_modules/urijs/src/punycode.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(root2) { + var freeExports4 = typeof exports28 == "object" && exports28 && !exports28.nodeType && exports28; + var freeModule4 = typeof module5 == "object" && module5 && !module5.nodeType && module5; + var freeGlobal2 = typeof globalThis == "object" && globalThis; + if (freeGlobal2.global === freeGlobal2 || freeGlobal2.window === freeGlobal2 || freeGlobal2.self === freeGlobal2) { + root2 = freeGlobal2; + } + var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter2 = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = { + "overflow": "Overflow: input needs wider integers to process", + "not-basic": "Illegal input >= 0x80 (not a basic code point)", + "invalid-input": "Invalid input" + }, baseMinusTMin = base - tMin, floor2 = Math.floor, stringFromCharCode = String.fromCharCode, key; + function error2(type3) { + throw new RangeError(errors[type3]); + } + function map4(array, fn) { + var length = array.length; + var result2 = []; + while (length--) { + result2[length] = fn(array[length]); + } + return result2; + } + function mapDomain(string2, fn) { + var parts = string2.split("@"); + var result2 = ""; + if (parts.length > 1) { + result2 = parts[0] + "@"; + string2 = parts[1]; + } + string2 = string2.replace(regexSeparators, "."); + var labels = string2.split("."); + var encoded = map4(labels, fn).join("."); + return result2 + encoded; + } + function ucs2decode(string2) { + var output = [], counter = 0, length = string2.length, value2, extra; + while (counter < length) { + value2 = string2.charCodeAt(counter++); + if (value2 >= 55296 && value2 <= 56319 && counter < length) { + extra = string2.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + output.push(((value2 & 1023) << 10) + (extra & 1023) + 65536); + } else { + output.push(value2); + counter--; + } + } else { + output.push(value2); + } + } + return output; + } + function ucs2encode(array) { + return map4(array, function(value2) { + var output = ""; + if (value2 > 65535) { + value2 -= 65536; + output += stringFromCharCode(value2 >>> 10 & 1023 | 55296); + value2 = 56320 | value2 & 1023; + } + output += stringFromCharCode(value2); + return output; + }).join(""); + } + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + function digitToBasic(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + function adapt(delta, numPoints, firstTime) { + var k6 = 0; + delta = firstTime ? floor2(delta / damp) : delta >> 1; + delta += floor2(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k6 += base) { + delta = floor2(delta / baseMinusTMin); + } + return floor2(k6 + (baseMinusTMin + 1) * delta / (delta + skew)); + } + function decode2(input) { + var output = [], inputLength = input.length, out, i7 = 0, n7 = initialN, bias = initialBias, basic, j6, index4, oldi, w6, k6, digit, t8, baseMinusT; + basic = input.lastIndexOf(delimiter2); + if (basic < 0) { + basic = 0; + } + for (j6 = 0; j6 < basic; ++j6) { + if (input.charCodeAt(j6) >= 128) { + error2("not-basic"); + } + output.push(input.charCodeAt(j6)); + } + for (index4 = basic > 0 ? basic + 1 : 0; index4 < inputLength; ) { + for (oldi = i7, w6 = 1, k6 = base; ; k6 += base) { + if (index4 >= inputLength) { + error2("invalid-input"); + } + digit = basicToDigit(input.charCodeAt(index4++)); + if (digit >= base || digit > floor2((maxInt - i7) / w6)) { + error2("overflow"); + } + i7 += digit * w6; + t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (digit < t8) { + break; + } + baseMinusT = base - t8; + if (w6 > floor2(maxInt / baseMinusT)) { + error2("overflow"); + } + w6 *= baseMinusT; + } + out = output.length + 1; + bias = adapt(i7 - oldi, out, oldi == 0); + if (floor2(i7 / out) > maxInt - n7) { + error2("overflow"); + } + n7 += floor2(i7 / out); + i7 %= out; + output.splice(i7++, 0, n7); + } + return ucs2encode(output); + } + function encode2(input) { + var n7, delta, handledCPCount, basicLength, bias, j6, m7, q5, k6, t8, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT; + input = ucs2decode(input); + inputLength = input.length; + n7 = initialN; + delta = 0; + bias = initialBias; + for (j6 = 0; j6 < inputLength; ++j6) { + currentValue = input[j6]; + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + handledCPCount = basicLength = output.length; + if (basicLength) { + output.push(delimiter2); + } + while (handledCPCount < inputLength) { + for (m7 = maxInt, j6 = 0; j6 < inputLength; ++j6) { + currentValue = input[j6]; + if (currentValue >= n7 && currentValue < m7) { + m7 = currentValue; + } + } + handledCPCountPlusOne = handledCPCount + 1; + if (m7 - n7 > floor2((maxInt - delta) / handledCPCountPlusOne)) { + error2("overflow"); + } + delta += (m7 - n7) * handledCPCountPlusOne; + n7 = m7; + for (j6 = 0; j6 < inputLength; ++j6) { + currentValue = input[j6]; + if (currentValue < n7 && ++delta > maxInt) { + error2("overflow"); + } + if (currentValue == n7) { + for (q5 = delta, k6 = base; ; k6 += base) { + t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (q5 < t8) { + break; + } + qMinusT = q5 - t8; + baseMinusT = base - t8; + output.push( + stringFromCharCode(digitToBasic(t8 + qMinusT % baseMinusT, 0)) + ); + q5 = floor2(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q5, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n7; + } + return output.join(""); + } + function toUnicode2(input) { + return mapDomain(input, function(string2) { + return regexPunycode.test(string2) ? decode2(string2.slice(4).toLowerCase()) : string2; + }); + } + function toASCII2(input) { + return mapDomain(input, function(string2) { + return regexNonASCII.test(string2) ? "xn--" + encode2(string2) : string2; + }); + } + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + "version": "1.3.2", + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + "ucs2": { + "decode": ucs2decode, + "encode": ucs2encode + }, + "decode": decode2, + "encode": encode2, + "toASCII": toASCII2, + "toUnicode": toUnicode2 + }; + if (typeof define == "function" && typeof define.amd == "object" && define.amd) { + define("punycode", function() { + return punycode; + }); + } else if (freeExports4 && freeModule4) { + if (module5.exports == freeExports4) { + freeModule4.exports = punycode; + } else { + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports4[key] = punycode[key]); + } + } + } else { + root2.punycode = punycode; + } + })(exports28); + } +}); + +// node_modules/urijs/src/IPv6.js +var require_IPv6 = __commonJS({ + "node_modules/urijs/src/IPv6.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(root2, factory) { + "use strict"; + if (typeof module5 === "object" && module5.exports) { + module5.exports = factory(); + } else if (typeof define === "function" && define.amd) { + define(factory); + } else { + root2.IPv6 = factory(root2); + } + })(exports28, function(root2) { + "use strict"; + var _IPv6 = root2 && root2.IPv6; + function bestPresentation(address) { + var _address = address.toLowerCase(); + var segments = _address.split(":"); + var length = segments.length; + var total = 8; + if (segments[0] === "" && segments[1] === "" && segments[2] === "") { + segments.shift(); + segments.shift(); + } else if (segments[0] === "" && segments[1] === "") { + segments.shift(); + } else if (segments[length - 1] === "" && segments[length - 2] === "") { + segments.pop(); + } + length = segments.length; + if (segments[length - 1].indexOf(".") !== -1) { + total = 7; + } + var pos; + for (pos = 0; pos < length; pos++) { + if (segments[pos] === "") { + break; + } + } + if (pos < total) { + segments.splice(pos, 1, "0000"); + while (segments.length < total) { + segments.splice(pos, 0, "0000"); + } + } + var _segments; + for (var i7 = 0; i7 < total; i7++) { + _segments = segments[i7].split(""); + for (var j6 = 0; j6 < 3; j6++) { + if (_segments[0] === "0" && _segments.length > 1) { + _segments.splice(0, 1); + } else { + break; + } + } + segments[i7] = _segments.join(""); + } + var best = -1; + var _best = 0; + var _current = 0; + var current = -1; + var inzeroes = false; + for (i7 = 0; i7 < total; i7++) { + if (inzeroes) { + if (segments[i7] === "0") { + _current += 1; + } else { + inzeroes = false; + if (_current > _best) { + best = current; + _best = _current; + } + } + } else { + if (segments[i7] === "0") { + inzeroes = true; + current = i7; + _current = 1; + } + } + } + if (_current > _best) { + best = current; + _best = _current; + } + if (_best > 1) { + segments.splice(best, _best, ""); + } + length = segments.length; + var result2 = ""; + if (segments[0] === "") { + result2 = ":"; + } + for (i7 = 0; i7 < length; i7++) { + result2 += segments[i7]; + if (i7 === length - 1) { + break; + } + result2 += ":"; + } + if (segments[length - 1] === "") { + result2 += ":"; + } + return result2; + } + function noConflict() { + if (root2.IPv6 === this) { + root2.IPv6 = _IPv6; + } + return this; + } + return { + best: bestPresentation, + noConflict + }; + }); + } +}); + +// node_modules/urijs/src/SecondLevelDomains.js +var require_SecondLevelDomains = __commonJS({ + "node_modules/urijs/src/SecondLevelDomains.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(root2, factory) { + "use strict"; + if (typeof module5 === "object" && module5.exports) { + module5.exports = factory(); + } else if (typeof define === "function" && define.amd) { + define(factory); + } else { + root2.SecondLevelDomains = factory(root2); + } + })(exports28, function(root2) { + "use strict"; + var _SecondLevelDomains = root2 && root2.SecondLevelDomains; + var SLD = { + // list of known Second Level Domains + // converted list of SLDs from https://github.com/gavingmiller/second-level-domains + // ---- + // publicsuffix.org is more current and actually used by a couple of browsers internally. + // downside is it also contains domains like "dyndns.org" - which is fine for the security + // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js + // ---- + list: { + "ac": " com gov mil net org ", + "ae": " ac co gov mil name net org pro sch ", + "af": " com edu gov net org ", + "al": " com edu gov mil net org ", + "ao": " co ed gv it og pb ", + "ar": " com edu gob gov int mil net org tur ", + "at": " ac co gv or ", + "au": " asn com csiro edu gov id net org ", + "ba": " co com edu gov mil net org rs unbi unmo unsa untz unze ", + "bb": " biz co com edu gov info net org store tv ", + "bh": " biz cc com edu gov info net org ", + "bn": " com edu gov net org ", + "bo": " com edu gob gov int mil net org tv ", + "br": " adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ", + "bs": " com edu gov net org ", + "bz": " du et om ov rg ", + "ca": " ab bc mb nb nf nl ns nt nu on pe qc sk yk ", + "ck": " biz co edu gen gov info net org ", + "cn": " ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ", + "co": " com edu gov mil net nom org ", + "cr": " ac c co ed fi go or sa ", + "cy": " ac biz com ekloges gov ltd name net org parliament press pro tm ", + "do": " art com edu gob gov mil net org sld web ", + "dz": " art asso com edu gov net org pol ", + "ec": " com edu fin gov info med mil net org pro ", + "eg": " com edu eun gov mil name net org sci ", + "er": " com edu gov ind mil net org rochest w ", + "es": " com edu gob nom org ", + "et": " biz com edu gov info name net org ", + "fj": " ac biz com info mil name net org pro ", + "fk": " ac co gov net nom org ", + "fr": " asso com f gouv nom prd presse tm ", + "gg": " co net org ", + "gh": " com edu gov mil org ", + "gn": " ac com gov net org ", + "gr": " com edu gov mil net org ", + "gt": " com edu gob ind mil net org ", + "gu": " com edu gov net org ", + "hk": " com edu gov idv net org ", + "hu": " 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ", + "id": " ac co go mil net or sch web ", + "il": " ac co gov idf k12 muni net org ", + "in": " ac co edu ernet firm gen gov i ind mil net nic org res ", + "iq": " com edu gov i mil net org ", + "ir": " ac co dnssec gov i id net org sch ", + "it": " edu gov ", + "je": " co net org ", + "jo": " com edu gov mil name net org sch ", + "jp": " ac ad co ed go gr lg ne or ", + "ke": " ac co go info me mobi ne or sc ", + "kh": " com edu gov mil net org per ", + "ki": " biz com de edu gov info mob net org tel ", + "km": " asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ", + "kn": " edu gov net org ", + "kr": " ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ", + "kw": " com edu gov net org ", + "ky": " com edu gov net org ", + "kz": " com edu gov mil net org ", + "lb": " com edu gov net org ", + "lk": " assn com edu gov grp hotel int ltd net ngo org sch soc web ", + "lr": " com edu gov net org ", + "lv": " asn com conf edu gov id mil net org ", + "ly": " com edu gov id med net org plc sch ", + "ma": " ac co gov m net org press ", + "mc": " asso tm ", + "me": " ac co edu gov its net org priv ", + "mg": " com edu gov mil nom org prd tm ", + "mk": " com edu gov inf name net org pro ", + "ml": " com edu gov net org presse ", + "mn": " edu gov org ", + "mo": " com edu gov net org ", + "mt": " com edu gov net org ", + "mv": " aero biz com coop edu gov info int mil museum name net org pro ", + "mw": " ac co com coop edu gov int museum net org ", + "mx": " com edu gob net org ", + "my": " com edu gov mil name net org sch ", + "nf": " arts com firm info net other per rec store web ", + "ng": " biz com edu gov mil mobi name net org sch ", + "ni": " ac co com edu gob mil net nom org ", + "np": " com edu gov mil net org ", + "nr": " biz com edu gov info net org ", + "om": " ac biz co com edu gov med mil museum net org pro sch ", + "pe": " com edu gob mil net nom org sld ", + "ph": " com edu gov i mil net ngo org ", + "pk": " biz com edu fam gob gok gon gop gos gov net org web ", + "pl": " art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ", + "pr": " ac biz com edu est gov info isla name net org pro prof ", + "ps": " com edu gov net org plo sec ", + "pw": " belau co ed go ne or ", + "ro": " arts com firm info nom nt org rec store tm www ", + "rs": " ac co edu gov in org ", + "sb": " com edu gov net org ", + "sc": " com edu gov net org ", + "sh": " co com edu gov net nom org ", + "sl": " com edu gov net org ", + "st": " co com consulado edu embaixada gov mil net org principe saotome store ", + "sv": " com edu gob org red ", + "sz": " ac co org ", + "tr": " av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ", + "tt": " aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ", + "tw": " club com ebiz edu game gov idv mil net org ", + "mu": " ac co com gov net or org ", + "mz": " ac co edu gov org ", + "na": " co com ", + "nz": " ac co cri geek gen govt health iwi maori mil net org parliament school ", + "pa": " abo ac com edu gob ing med net nom org sld ", + "pt": " com edu gov int net nome org publ ", + "py": " com edu gov mil net org ", + "qa": " com edu gov mil net org ", + "re": " asso com nom ", + "ru": " ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ", + "rw": " ac co com edu gouv gov int mil net ", + "sa": " com edu gov med net org pub sch ", + "sd": " com edu gov info med net org tv ", + "se": " a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ", + "sg": " com edu gov idn net org per ", + "sn": " art com edu gouv org perso univ ", + "sy": " com edu gov mil net news org ", + "th": " ac co go in mi net or ", + "tj": " ac biz co com edu go gov info int mil name net nic org test web ", + "tn": " agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ", + "tz": " ac co go ne or ", + "ua": " biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ", + "ug": " ac co go ne or org sc ", + "uk": " ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ", + "us": " dni fed isa kids nsn ", + "uy": " com edu gub mil net org ", + "ve": " co com edu gob info mil net org web ", + "vi": " co com k12 net org ", + "vn": " ac biz com edu gov health info int name net org pro ", + "ye": " co com gov ltd me net org plc ", + "yu": " ac co edu gov org ", + "za": " ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ", + "zm": " ac co com edu gov net org sch ", + // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains + "com": "ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ", + "net": "gb jp se uk ", + "org": "ae", + "de": "com " + }, + // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost + // in both performance and memory footprint. No initialization required. + // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4 + // Following methods use lastIndexOf() rather than array.split() in order + // to avoid any memory allocations. + has: function(domain3) { + var tldOffset = domain3.lastIndexOf("."); + if (tldOffset <= 0 || tldOffset >= domain3.length - 1) { + return false; + } + var sldOffset = domain3.lastIndexOf(".", tldOffset - 1); + if (sldOffset <= 0 || sldOffset >= tldOffset - 1) { + return false; + } + var sldList = SLD.list[domain3.slice(tldOffset + 1)]; + if (!sldList) { + return false; + } + return sldList.indexOf(" " + domain3.slice(sldOffset + 1, tldOffset) + " ") >= 0; + }, + is: function(domain3) { + var tldOffset = domain3.lastIndexOf("."); + if (tldOffset <= 0 || tldOffset >= domain3.length - 1) { + return false; + } + var sldOffset = domain3.lastIndexOf(".", tldOffset - 1); + if (sldOffset >= 0) { + return false; + } + var sldList = SLD.list[domain3.slice(tldOffset + 1)]; + if (!sldList) { + return false; + } + return sldList.indexOf(" " + domain3.slice(0, tldOffset) + " ") >= 0; + }, + get: function(domain3) { + var tldOffset = domain3.lastIndexOf("."); + if (tldOffset <= 0 || tldOffset >= domain3.length - 1) { + return null; + } + var sldOffset = domain3.lastIndexOf(".", tldOffset - 1); + if (sldOffset <= 0 || sldOffset >= tldOffset - 1) { + return null; + } + var sldList = SLD.list[domain3.slice(tldOffset + 1)]; + if (!sldList) { + return null; + } + if (sldList.indexOf(" " + domain3.slice(sldOffset + 1, tldOffset) + " ") < 0) { + return null; + } + return domain3.slice(sldOffset + 1); + }, + noConflict: function() { + if (root2.SecondLevelDomains === this) { + root2.SecondLevelDomains = _SecondLevelDomains; + } + return this; + } + }; + return SLD; + }); + } +}); + +// node_modules/urijs/src/URI.js +var require_URI = __commonJS({ + "node_modules/urijs/src/URI.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(root2, factory) { + "use strict"; + if (typeof module5 === "object" && module5.exports) { + module5.exports = factory(require_punycode(), require_IPv6(), require_SecondLevelDomains()); + } else if (typeof define === "function" && define.amd) { + define(["./punycode", "./IPv6", "./SecondLevelDomains"], factory); + } else { + root2.URI = factory(root2.punycode, root2.IPv6, root2.SecondLevelDomains, root2); + } + })(exports28, function(punycode, IPv6, SLD, root2) { + "use strict"; + var _URI = root2 && root2.URI; + function URI(url, base) { + var _urlSupplied = arguments.length >= 1; + var _baseSupplied = arguments.length >= 2; + if (!(this instanceof URI)) { + if (_urlSupplied) { + if (_baseSupplied) { + return new URI(url, base); + } + return new URI(url); + } + return new URI(); + } + if (url === void 0) { + if (_urlSupplied) { + throw new TypeError("undefined is not a valid argument for URI"); + } + if (typeof location !== "undefined") { + url = location.href + ""; + } else { + url = ""; + } + } + if (url === null) { + if (_urlSupplied) { + throw new TypeError("null is not a valid argument for URI"); + } + } + this.href(url); + if (base !== void 0) { + return this.absoluteTo(base); + } + return this; + } + function isInteger3(value2) { + return /^[0-9]+$/.test(value2); + } + URI.version = "1.19.11"; + var p7 = URI.prototype; + var hasOwn = Object.prototype.hasOwnProperty; + function escapeRegEx(string2) { + return string2.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1"); + } + function getType(value2) { + if (value2 === void 0) { + return "Undefined"; + } + return String(Object.prototype.toString.call(value2)).slice(8, -1); + } + function isArray3(obj) { + return getType(obj) === "Array"; + } + function filterArrayValues(data, value2) { + var lookup = {}; + var i7, length; + if (getType(value2) === "RegExp") { + lookup = null; + } else if (isArray3(value2)) { + for (i7 = 0, length = value2.length; i7 < length; i7++) { + lookup[value2[i7]] = true; + } + } else { + lookup[value2] = true; + } + for (i7 = 0, length = data.length; i7 < length; i7++) { + var _match = lookup && lookup[data[i7]] !== void 0 || !lookup && value2.test(data[i7]); + if (_match) { + data.splice(i7, 1); + length--; + i7--; + } + } + return data; + } + function arrayContains(list, value2) { + var i7, length; + if (isArray3(value2)) { + for (i7 = 0, length = value2.length; i7 < length; i7++) { + if (!arrayContains(list, value2[i7])) { + return false; + } + } + return true; + } + var _type = getType(value2); + for (i7 = 0, length = list.length; i7 < length; i7++) { + if (_type === "RegExp") { + if (typeof list[i7] === "string" && list[i7].match(value2)) { + return true; + } + } else if (list[i7] === value2) { + return true; + } + } + return false; + } + function arraysEqual(one, two) { + if (!isArray3(one) || !isArray3(two)) { + return false; + } + if (one.length !== two.length) { + return false; + } + one.sort(); + two.sort(); + for (var i7 = 0, l7 = one.length; i7 < l7; i7++) { + if (one[i7] !== two[i7]) { + return false; + } + } + return true; + } + function trimSlashes(text) { + var trim_expression = /^\/+|\/+$/g; + return text.replace(trim_expression, ""); + } + URI._parts = function() { + return { + protocol: null, + username: null, + password: null, + hostname: null, + urn: null, + port: null, + path: null, + query: null, + fragment: null, + // state + preventInvalidHostname: URI.preventInvalidHostname, + duplicateQueryParameters: URI.duplicateQueryParameters, + escapeQuerySpace: URI.escapeQuerySpace + }; + }; + URI.preventInvalidHostname = false; + URI.duplicateQueryParameters = false; + URI.escapeQuerySpace = true; + URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i; + URI.idn_expression = /[^a-z0-9\._-]/i; + URI.punycode_expression = /(xn--)/i; + URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; + URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; + URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig; + URI.findUri = { + // valid "scheme://" or "www." + start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi, + // everything up to the next whitespace + end: /[\s\r\n]|$/, + // trim trailing punctuation captured by end RegExp + trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/, + // balanced parens inclusion (), [], {}, <> + parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g + }; + URI.leading_whitespace_expression = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/; + URI.ascii_tab_whitespace = /[\u0009\u000A\u000D]+/g; + URI.defaultPorts = { + http: "80", + https: "443", + ftp: "21", + gopher: "70", + ws: "80", + wss: "443" + }; + URI.hostProtocols = [ + "http", + "https" + ]; + URI.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/; + URI.domAttributes = { + "a": "href", + "blockquote": "cite", + "link": "href", + "base": "href", + "script": "src", + "form": "action", + "img": "src", + "area": "href", + "iframe": "src", + "embed": "src", + "source": "src", + "track": "src", + "input": "src", + // but only if type="image" + "audio": "src", + "video": "src" + }; + URI.getDomAttribute = function(node) { + if (!node || !node.nodeName) { + return void 0; + } + var nodeName = node.nodeName.toLowerCase(); + if (nodeName === "input" && node.type !== "image") { + return void 0; + } + return URI.domAttributes[nodeName]; + }; + function escapeForDumbFirefox36(value2) { + return escape(value2); + } + function strictEncodeURIComponent(string2) { + return encodeURIComponent(string2).replace(/[!'()*]/g, escapeForDumbFirefox36).replace(/\*/g, "%2A"); + } + URI.encode = strictEncodeURIComponent; + URI.decode = decodeURIComponent; + URI.iso8859 = function() { + URI.encode = escape; + URI.decode = unescape; + }; + URI.unicode = function() { + URI.encode = strictEncodeURIComponent; + URI.decode = decodeURIComponent; + }; + URI.characters = { + pathname: { + encode: { + // RFC3986 2.1: For consistency, URI producers and normalizers should + // use uppercase hexadecimal digits for all percent-encodings. + expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig, + map: { + // -._~!'()* + "%24": "$", + "%26": "&", + "%2B": "+", + "%2C": ",", + "%3B": ";", + "%3D": "=", + "%3A": ":", + "%40": "@" + } + }, + decode: { + expression: /[\/\?#]/g, + map: { + "/": "%2F", + "?": "%3F", + "#": "%23" + } + } + }, + reserved: { + encode: { + // RFC3986 2.1: For consistency, URI producers and normalizers should + // use uppercase hexadecimal digits for all percent-encodings. + expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig, + map: { + // gen-delims + "%3A": ":", + "%2F": "/", + "%3F": "?", + "%23": "#", + "%5B": "[", + "%5D": "]", + "%40": "@", + // sub-delims + "%21": "!", + "%24": "$", + "%26": "&", + "%27": "'", + "%28": "(", + "%29": ")", + "%2A": "*", + "%2B": "+", + "%2C": ",", + "%3B": ";", + "%3D": "=" + } + } + }, + urnpath: { + // The characters under `encode` are the characters called out by RFC 2141 as being acceptable + // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but + // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also + // note that the colon character is not featured in the encoding map; this is because URI.js + // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it + // should not appear unencoded in a segment itself. + // See also the note above about RFC3986 and capitalalized hex digits. + encode: { + expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig, + map: { + "%21": "!", + "%24": "$", + "%27": "'", + "%28": "(", + "%29": ")", + "%2A": "*", + "%2B": "+", + "%2C": ",", + "%3B": ";", + "%3D": "=", + "%40": "@" + } + }, + // These characters are the characters called out by RFC2141 as "reserved" characters that + // should never appear in a URN, plus the colon character (see note above). + decode: { + expression: /[\/\?#:]/g, + map: { + "/": "%2F", + "?": "%3F", + "#": "%23", + ":": "%3A" + } + } + } + }; + URI.encodeQuery = function(string2, escapeQuerySpace) { + var escaped = URI.encode(string2 + ""); + if (escapeQuerySpace === void 0) { + escapeQuerySpace = URI.escapeQuerySpace; + } + return escapeQuerySpace ? escaped.replace(/%20/g, "+") : escaped; + }; + URI.decodeQuery = function(string2, escapeQuerySpace) { + string2 += ""; + if (escapeQuerySpace === void 0) { + escapeQuerySpace = URI.escapeQuerySpace; + } + try { + return URI.decode(escapeQuerySpace ? string2.replace(/\+/g, "%20") : string2); + } catch (e10) { + return string2; + } + }; + var _parts = { "encode": "encode", "decode": "decode" }; + var _part; + var generateAccessor = function(_group, _part2) { + return function(string2) { + try { + return URI[_part2](string2 + "").replace(URI.characters[_group][_part2].expression, function(c7) { + return URI.characters[_group][_part2].map[c7]; + }); + } catch (e10) { + return string2; + } + }; + }; + for (_part in _parts) { + URI[_part + "PathSegment"] = generateAccessor("pathname", _parts[_part]); + URI[_part + "UrnPathSegment"] = generateAccessor("urnpath", _parts[_part]); + } + var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) { + return function(string2) { + var actualCodingFunc; + if (!_innerCodingFuncName) { + actualCodingFunc = URI[_codingFuncName]; + } else { + actualCodingFunc = function(string3) { + return URI[_codingFuncName](URI[_innerCodingFuncName](string3)); + }; + } + var segments = (string2 + "").split(_sep); + for (var i7 = 0, length = segments.length; i7 < length; i7++) { + segments[i7] = actualCodingFunc(segments[i7]); + } + return segments.join(_sep); + }; + }; + URI.decodePath = generateSegmentedPathFunction("/", "decodePathSegment"); + URI.decodeUrnPath = generateSegmentedPathFunction(":", "decodeUrnPathSegment"); + URI.recodePath = generateSegmentedPathFunction("/", "encodePathSegment", "decode"); + URI.recodeUrnPath = generateSegmentedPathFunction(":", "encodeUrnPathSegment", "decode"); + URI.encodeReserved = generateAccessor("reserved", "encode"); + URI.parse = function(string2, parts) { + var pos; + if (!parts) { + parts = { + preventInvalidHostname: URI.preventInvalidHostname + }; + } + string2 = string2.replace(URI.leading_whitespace_expression, ""); + string2 = string2.replace(URI.ascii_tab_whitespace, ""); + pos = string2.indexOf("#"); + if (pos > -1) { + parts.fragment = string2.substring(pos + 1) || null; + string2 = string2.substring(0, pos); + } + pos = string2.indexOf("?"); + if (pos > -1) { + parts.query = string2.substring(pos + 1) || null; + string2 = string2.substring(0, pos); + } + string2 = string2.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, "$1://"); + string2 = string2.replace(/^[/\\]{2,}/i, "//"); + if (string2.substring(0, 2) === "//") { + parts.protocol = null; + string2 = string2.substring(2); + string2 = URI.parseAuthority(string2, parts); + } else { + pos = string2.indexOf(":"); + if (pos > -1) { + parts.protocol = string2.substring(0, pos) || null; + if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) { + parts.protocol = void 0; + } else if (string2.substring(pos + 1, pos + 3).replace(/\\/g, "/") === "//") { + string2 = string2.substring(pos + 3); + string2 = URI.parseAuthority(string2, parts); + } else { + string2 = string2.substring(pos + 1); + parts.urn = true; + } + } + } + parts.path = string2; + return parts; + }; + URI.parseHost = function(string2, parts) { + if (!string2) { + string2 = ""; + } + string2 = string2.replace(/\\/g, "/"); + var pos = string2.indexOf("/"); + var bracketPos; + var t8; + if (pos === -1) { + pos = string2.length; + } + if (string2.charAt(0) === "[") { + bracketPos = string2.indexOf("]"); + parts.hostname = string2.substring(1, bracketPos) || null; + parts.port = string2.substring(bracketPos + 2, pos) || null; + if (parts.port === "/") { + parts.port = null; + } + } else { + var firstColon = string2.indexOf(":"); + var firstSlash = string2.indexOf("/"); + var nextColon = string2.indexOf(":", firstColon + 1); + if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) { + parts.hostname = string2.substring(0, pos) || null; + parts.port = null; + } else { + t8 = string2.substring(0, pos).split(":"); + parts.hostname = t8[0] || null; + parts.port = t8[1] || null; + } + } + if (parts.hostname && string2.substring(pos).charAt(0) !== "/") { + pos++; + string2 = "/" + string2; + } + if (parts.preventInvalidHostname) { + URI.ensureValidHostname(parts.hostname, parts.protocol); + } + if (parts.port) { + URI.ensureValidPort(parts.port); + } + return string2.substring(pos) || "/"; + }; + URI.parseAuthority = function(string2, parts) { + string2 = URI.parseUserinfo(string2, parts); + return URI.parseHost(string2, parts); + }; + URI.parseUserinfo = function(string2, parts) { + var _string = string2; + var firstBackSlash = string2.indexOf("\\"); + if (firstBackSlash !== -1) { + string2 = string2.replace(/\\/g, "/"); + } + var firstSlash = string2.indexOf("/"); + var pos = string2.lastIndexOf("@", firstSlash > -1 ? firstSlash : string2.length - 1); + var t8; + if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) { + t8 = string2.substring(0, pos).split(":"); + parts.username = t8[0] ? URI.decode(t8[0]) : null; + t8.shift(); + parts.password = t8[0] ? URI.decode(t8.join(":")) : null; + string2 = _string.substring(pos + 1); + } else { + parts.username = null; + parts.password = null; + } + return string2; + }; + URI.parseQuery = function(string2, escapeQuerySpace) { + if (!string2) { + return {}; + } + string2 = string2.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, ""); + if (!string2) { + return {}; + } + var items = {}; + var splits = string2.split("&"); + var length = splits.length; + var v8, name2, value2; + for (var i7 = 0; i7 < length; i7++) { + v8 = splits[i7].split("="); + name2 = URI.decodeQuery(v8.shift(), escapeQuerySpace); + value2 = v8.length ? URI.decodeQuery(v8.join("="), escapeQuerySpace) : null; + if (name2 === "__proto__") { + continue; + } else if (hasOwn.call(items, name2)) { + if (typeof items[name2] === "string" || items[name2] === null) { + items[name2] = [items[name2]]; + } + items[name2].push(value2); + } else { + items[name2] = value2; + } + } + return items; + }; + URI.build = function(parts) { + var t8 = ""; + var requireAbsolutePath = false; + if (parts.protocol) { + t8 += parts.protocol + ":"; + } + if (!parts.urn && (t8 || parts.hostname)) { + t8 += "//"; + requireAbsolutePath = true; + } + t8 += URI.buildAuthority(parts) || ""; + if (typeof parts.path === "string") { + if (parts.path.charAt(0) !== "/" && requireAbsolutePath) { + t8 += "/"; + } + t8 += parts.path; + } + if (typeof parts.query === "string" && parts.query) { + t8 += "?" + parts.query; + } + if (typeof parts.fragment === "string" && parts.fragment) { + t8 += "#" + parts.fragment; + } + return t8; + }; + URI.buildHost = function(parts) { + var t8 = ""; + if (!parts.hostname) { + return ""; + } else if (URI.ip6_expression.test(parts.hostname)) { + t8 += "[" + parts.hostname + "]"; + } else { + t8 += parts.hostname; + } + if (parts.port) { + t8 += ":" + parts.port; + } + return t8; + }; + URI.buildAuthority = function(parts) { + return URI.buildUserinfo(parts) + URI.buildHost(parts); + }; + URI.buildUserinfo = function(parts) { + var t8 = ""; + if (parts.username) { + t8 += URI.encode(parts.username); + } + if (parts.password) { + t8 += ":" + URI.encode(parts.password); + } + if (t8) { + t8 += "@"; + } + return t8; + }; + URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) { + var t8 = ""; + var unique, key, i7, length; + for (key in data) { + if (key === "__proto__") { + continue; + } else if (hasOwn.call(data, key)) { + if (isArray3(data[key])) { + unique = {}; + for (i7 = 0, length = data[key].length; i7 < length; i7++) { + if (data[key][i7] !== void 0 && unique[data[key][i7] + ""] === void 0) { + t8 += "&" + URI.buildQueryParameter(key, data[key][i7], escapeQuerySpace); + if (duplicateQueryParameters !== true) { + unique[data[key][i7] + ""] = true; + } + } + } + } else if (data[key] !== void 0) { + t8 += "&" + URI.buildQueryParameter(key, data[key], escapeQuerySpace); + } + } + } + return t8.substring(1); + }; + URI.buildQueryParameter = function(name2, value2, escapeQuerySpace) { + return URI.encodeQuery(name2, escapeQuerySpace) + (value2 !== null ? "=" + URI.encodeQuery(value2, escapeQuerySpace) : ""); + }; + URI.addQuery = function(data, name2, value2) { + if (typeof name2 === "object") { + for (var key in name2) { + if (hasOwn.call(name2, key)) { + URI.addQuery(data, key, name2[key]); + } + } + } else if (typeof name2 === "string") { + if (data[name2] === void 0) { + data[name2] = value2; + return; + } else if (typeof data[name2] === "string") { + data[name2] = [data[name2]]; + } + if (!isArray3(value2)) { + value2 = [value2]; + } + data[name2] = (data[name2] || []).concat(value2); + } else { + throw new TypeError("URI.addQuery() accepts an object, string as the name parameter"); + } + }; + URI.setQuery = function(data, name2, value2) { + if (typeof name2 === "object") { + for (var key in name2) { + if (hasOwn.call(name2, key)) { + URI.setQuery(data, key, name2[key]); + } + } + } else if (typeof name2 === "string") { + data[name2] = value2 === void 0 ? null : value2; + } else { + throw new TypeError("URI.setQuery() accepts an object, string as the name parameter"); + } + }; + URI.removeQuery = function(data, name2, value2) { + var i7, length, key; + if (isArray3(name2)) { + for (i7 = 0, length = name2.length; i7 < length; i7++) { + data[name2[i7]] = void 0; + } + } else if (getType(name2) === "RegExp") { + for (key in data) { + if (name2.test(key)) { + data[key] = void 0; + } + } + } else if (typeof name2 === "object") { + for (key in name2) { + if (hasOwn.call(name2, key)) { + URI.removeQuery(data, key, name2[key]); + } + } + } else if (typeof name2 === "string") { + if (value2 !== void 0) { + if (getType(value2) === "RegExp") { + if (!isArray3(data[name2]) && value2.test(data[name2])) { + data[name2] = void 0; + } else { + data[name2] = filterArrayValues(data[name2], value2); + } + } else if (data[name2] === String(value2) && (!isArray3(value2) || value2.length === 1)) { + data[name2] = void 0; + } else if (isArray3(data[name2])) { + data[name2] = filterArrayValues(data[name2], value2); + } + } else { + data[name2] = void 0; + } + } else { + throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter"); + } + }; + URI.hasQuery = function(data, name2, value2, withinArray) { + switch (getType(name2)) { + case "String": + break; + case "RegExp": + for (var key in data) { + if (hasOwn.call(data, key)) { + if (name2.test(key) && (value2 === void 0 || URI.hasQuery(data, key, value2))) { + return true; + } + } + } + return false; + case "Object": + for (var _key in name2) { + if (hasOwn.call(name2, _key)) { + if (!URI.hasQuery(data, _key, name2[_key])) { + return false; + } + } + } + return true; + default: + throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter"); + } + switch (getType(value2)) { + case "Undefined": + return name2 in data; + case "Boolean": + var _booly = Boolean(isArray3(data[name2]) ? data[name2].length : data[name2]); + return value2 === _booly; + case "Function": + return !!value2(data[name2], name2, data); + case "Array": + if (!isArray3(data[name2])) { + return false; + } + var op = withinArray ? arrayContains : arraysEqual; + return op(data[name2], value2); + case "RegExp": + if (!isArray3(data[name2])) { + return Boolean(data[name2] && data[name2].match(value2)); + } + if (!withinArray) { + return false; + } + return arrayContains(data[name2], value2); + case "Number": + value2 = String(value2); + case "String": + if (!isArray3(data[name2])) { + return data[name2] === value2; + } + if (!withinArray) { + return false; + } + return arrayContains(data[name2], value2); + default: + throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter"); + } + }; + URI.joinPaths = function() { + var input = []; + var segments = []; + var nonEmptySegments = 0; + for (var i7 = 0; i7 < arguments.length; i7++) { + var url = new URI(arguments[i7]); + input.push(url); + var _segments = url.segment(); + for (var s7 = 0; s7 < _segments.length; s7++) { + if (typeof _segments[s7] === "string") { + segments.push(_segments[s7]); + } + if (_segments[s7]) { + nonEmptySegments++; + } + } + } + if (!segments.length || !nonEmptySegments) { + return new URI(""); + } + var uri = new URI("").segment(segments); + if (input[0].path() === "" || input[0].path().slice(0, 1) === "/") { + uri.path("/" + uri.path()); + } + return uri.normalize(); + }; + URI.commonPath = function(one, two) { + var length = Math.min(one.length, two.length); + var pos; + for (pos = 0; pos < length; pos++) { + if (one.charAt(pos) !== two.charAt(pos)) { + pos--; + break; + } + } + if (pos < 1) { + return one.charAt(0) === two.charAt(0) && one.charAt(0) === "/" ? "/" : ""; + } + if (one.charAt(pos) !== "/" || two.charAt(pos) !== "/") { + pos = one.substring(0, pos).lastIndexOf("/"); + } + return one.substring(0, pos + 1); + }; + URI.withinString = function(string2, callback, options) { + options || (options = {}); + var _start = options.start || URI.findUri.start; + var _end = options.end || URI.findUri.end; + var _trim = options.trim || URI.findUri.trim; + var _parens = options.parens || URI.findUri.parens; + var _attributeOpen = /[a-z0-9-]=["']?$/i; + _start.lastIndex = 0; + while (true) { + var match = _start.exec(string2); + if (!match) { + break; + } + var start = match.index; + if (options.ignoreHtml) { + var attributeOpen = string2.slice(Math.max(start - 3, 0), start); + if (attributeOpen && _attributeOpen.test(attributeOpen)) { + continue; + } + } + var end = start + string2.slice(start).search(_end); + var slice2 = string2.slice(start, end); + var parensEnd = -1; + while (true) { + var parensMatch = _parens.exec(slice2); + if (!parensMatch) { + break; + } + var parensMatchEnd = parensMatch.index + parensMatch[0].length; + parensEnd = Math.max(parensEnd, parensMatchEnd); + } + if (parensEnd > -1) { + slice2 = slice2.slice(0, parensEnd) + slice2.slice(parensEnd).replace(_trim, ""); + } else { + slice2 = slice2.replace(_trim, ""); + } + if (slice2.length <= match[0].length) { + continue; + } + if (options.ignore && options.ignore.test(slice2)) { + continue; + } + end = start + slice2.length; + var result2 = callback(slice2, start, end, string2); + if (result2 === void 0) { + _start.lastIndex = end; + continue; + } + result2 = String(result2); + string2 = string2.slice(0, start) + result2 + string2.slice(end); + _start.lastIndex = start + result2.length; + } + _start.lastIndex = 0; + return string2; + }; + URI.ensureValidHostname = function(v8, protocol) { + var hasHostname = !!v8; + var hasProtocol = !!protocol; + var rejectEmptyHostname = false; + if (hasProtocol) { + rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol); + } + if (rejectEmptyHostname && !hasHostname) { + throw new TypeError("Hostname cannot be empty, if protocol is " + protocol); + } else if (v8 && v8.match(URI.invalid_hostname_characters)) { + if (!punycode) { + throw new TypeError('Hostname "' + v8 + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available'); + } + if (punycode.toASCII(v8).match(URI.invalid_hostname_characters)) { + throw new TypeError('Hostname "' + v8 + '" contains characters other than [A-Z0-9.-:_]'); + } + } + }; + URI.ensureValidPort = function(v8) { + if (!v8) { + return; + } + var port = Number(v8); + if (isInteger3(port) && port > 0 && port < 65536) { + return; + } + throw new TypeError('Port "' + v8 + '" is not a valid port'); + }; + URI.noConflict = function(removeAll) { + if (removeAll) { + var unconflicted = { + URI: this.noConflict() + }; + if (root2.URITemplate && typeof root2.URITemplate.noConflict === "function") { + unconflicted.URITemplate = root2.URITemplate.noConflict(); + } + if (root2.IPv6 && typeof root2.IPv6.noConflict === "function") { + unconflicted.IPv6 = root2.IPv6.noConflict(); + } + if (root2.SecondLevelDomains && typeof root2.SecondLevelDomains.noConflict === "function") { + unconflicted.SecondLevelDomains = root2.SecondLevelDomains.noConflict(); + } + return unconflicted; + } else if (root2.URI === this) { + root2.URI = _URI; + } + return this; + }; + p7.build = function(deferBuild) { + if (deferBuild === true) { + this._deferred_build = true; + } else if (deferBuild === void 0 || this._deferred_build) { + this._string = URI.build(this._parts); + this._deferred_build = false; + } + return this; + }; + p7.clone = function() { + return new URI(this); + }; + p7.valueOf = p7.toString = function() { + return this.build(false)._string; + }; + function generateSimpleAccessor(_part2) { + return function(v8, build) { + if (v8 === void 0) { + return this._parts[_part2] || ""; + } else { + this._parts[_part2] = v8 || null; + this.build(!build); + return this; + } + }; + } + function generatePrefixAccessor(_part2, _key) { + return function(v8, build) { + if (v8 === void 0) { + return this._parts[_part2] || ""; + } else { + if (v8 !== null) { + v8 = v8 + ""; + if (v8.charAt(0) === _key) { + v8 = v8.substring(1); + } + } + this._parts[_part2] = v8; + this.build(!build); + return this; + } + }; + } + p7.protocol = generateSimpleAccessor("protocol"); + p7.username = generateSimpleAccessor("username"); + p7.password = generateSimpleAccessor("password"); + p7.hostname = generateSimpleAccessor("hostname"); + p7.port = generateSimpleAccessor("port"); + p7.query = generatePrefixAccessor("query", "?"); + p7.fragment = generatePrefixAccessor("fragment", "#"); + p7.search = function(v8, build) { + var t8 = this.query(v8, build); + return typeof t8 === "string" && t8.length ? "?" + t8 : t8; + }; + p7.hash = function(v8, build) { + var t8 = this.fragment(v8, build); + return typeof t8 === "string" && t8.length ? "#" + t8 : t8; + }; + p7.pathname = function(v8, build) { + if (v8 === void 0 || v8 === true) { + var res = this._parts.path || (this._parts.hostname ? "/" : ""); + return v8 ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res; + } else { + if (this._parts.urn) { + this._parts.path = v8 ? URI.recodeUrnPath(v8) : ""; + } else { + this._parts.path = v8 ? URI.recodePath(v8) : "/"; + } + this.build(!build); + return this; + } + }; + p7.path = p7.pathname; + p7.href = function(href, build) { + var key; + if (href === void 0) { + return this.toString(); + } + this._string = ""; + this._parts = URI._parts(); + var _URI2 = href instanceof URI; + var _object = typeof href === "object" && (href.hostname || href.path || href.pathname); + if (href.nodeName) { + var attribute = URI.getDomAttribute(href); + href = href[attribute] || ""; + _object = false; + } + if (!_URI2 && _object && href.pathname !== void 0) { + href = href.toString(); + } + if (typeof href === "string" || href instanceof String) { + this._parts = URI.parse(String(href), this._parts); + } else if (_URI2 || _object) { + var src = _URI2 ? href._parts : href; + for (key in src) { + if (key === "query") { + continue; + } + if (hasOwn.call(this._parts, key)) { + this._parts[key] = src[key]; + } + } + if (src.query) { + this.query(src.query, false); + } + } else { + throw new TypeError("invalid input"); + } + this.build(!build); + return this; + }; + p7.is = function(what) { + var ip = false; + var ip4 = false; + var ip6 = false; + var name2 = false; + var sld = false; + var idn = false; + var punycode2 = false; + var relative2 = !this._parts.urn; + if (this._parts.hostname) { + relative2 = false; + ip4 = URI.ip4_expression.test(this._parts.hostname); + ip6 = URI.ip6_expression.test(this._parts.hostname); + ip = ip4 || ip6; + name2 = !ip; + sld = name2 && SLD && SLD.has(this._parts.hostname); + idn = name2 && URI.idn_expression.test(this._parts.hostname); + punycode2 = name2 && URI.punycode_expression.test(this._parts.hostname); + } + switch (what.toLowerCase()) { + case "relative": + return relative2; + case "absolute": + return !relative2; + case "domain": + case "name": + return name2; + case "sld": + return sld; + case "ip": + return ip; + case "ip4": + case "ipv4": + case "inet4": + return ip4; + case "ip6": + case "ipv6": + case "inet6": + return ip6; + case "idn": + return idn; + case "url": + return !this._parts.urn; + case "urn": + return !!this._parts.urn; + case "punycode": + return punycode2; + } + return null; + }; + var _protocol = p7.protocol; + var _port = p7.port; + var _hostname = p7.hostname; + p7.protocol = function(v8, build) { + if (v8) { + v8 = v8.replace(/:(\/\/)?$/, ""); + if (!v8.match(URI.protocol_expression)) { + throw new TypeError('Protocol "' + v8 + `" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`); + } + } + return _protocol.call(this, v8, build); + }; + p7.scheme = p7.protocol; + p7.port = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 !== void 0) { + if (v8 === 0) { + v8 = null; + } + if (v8) { + v8 += ""; + if (v8.charAt(0) === ":") { + v8 = v8.substring(1); + } + URI.ensureValidPort(v8); + } + } + return _port.call(this, v8, build); + }; + p7.hostname = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 !== void 0) { + var x7 = { preventInvalidHostname: this._parts.preventInvalidHostname }; + var res = URI.parseHost(v8, x7); + if (res !== "/") { + throw new TypeError('Hostname "' + v8 + '" contains characters other than [A-Z0-9.-]'); + } + v8 = x7.hostname; + if (this._parts.preventInvalidHostname) { + URI.ensureValidHostname(v8, this._parts.protocol); + } + } + return _hostname.call(this, v8, build); + }; + p7.origin = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0) { + var protocol = this.protocol(); + var authority = this.authority(); + if (!authority) { + return ""; + } + return (protocol ? protocol + "://" : "") + this.authority(); + } else { + var origin = URI(v8); + this.protocol(origin.protocol()).authority(origin.authority()).build(!build); + return this; + } + }; + p7.host = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0) { + return this._parts.hostname ? URI.buildHost(this._parts) : ""; + } else { + var res = URI.parseHost(v8, this._parts); + if (res !== "/") { + throw new TypeError('Hostname "' + v8 + '" contains characters other than [A-Z0-9.-]'); + } + this.build(!build); + return this; + } + }; + p7.authority = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0) { + return this._parts.hostname ? URI.buildAuthority(this._parts) : ""; + } else { + var res = URI.parseAuthority(v8, this._parts); + if (res !== "/") { + throw new TypeError('Hostname "' + v8 + '" contains characters other than [A-Z0-9.-]'); + } + this.build(!build); + return this; + } + }; + p7.userinfo = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0) { + var t8 = URI.buildUserinfo(this._parts); + return t8 ? t8.substring(0, t8.length - 1) : t8; + } else { + if (v8[v8.length - 1] !== "@") { + v8 += "@"; + } + URI.parseUserinfo(v8, this._parts); + this.build(!build); + return this; + } + }; + p7.resource = function(v8, build) { + var parts; + if (v8 === void 0) { + return this.path() + this.search() + this.hash(); + } + parts = URI.parse(v8); + this._parts.path = parts.path; + this._parts.query = parts.query; + this._parts.fragment = parts.fragment; + this.build(!build); + return this; + }; + p7.subdomain = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0) { + if (!this._parts.hostname || this.is("IP")) { + return ""; + } + var end = this._parts.hostname.length - this.domain().length - 1; + return this._parts.hostname.substring(0, end) || ""; + } else { + var e10 = this._parts.hostname.length - this.domain().length; + var sub = this._parts.hostname.substring(0, e10); + var replace3 = new RegExp("^" + escapeRegEx(sub)); + if (v8 && v8.charAt(v8.length - 1) !== ".") { + v8 += "."; + } + if (v8.indexOf(":") !== -1) { + throw new TypeError("Domains cannot contain colons"); + } + if (v8) { + URI.ensureValidHostname(v8, this._parts.protocol); + } + this._parts.hostname = this._parts.hostname.replace(replace3, v8); + this.build(!build); + return this; + } + }; + p7.domain = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (typeof v8 === "boolean") { + build = v8; + v8 = void 0; + } + if (v8 === void 0) { + if (!this._parts.hostname || this.is("IP")) { + return ""; + } + var t8 = this._parts.hostname.match(/\./g); + if (t8 && t8.length < 2) { + return this._parts.hostname; + } + var end = this._parts.hostname.length - this.tld(build).length - 1; + end = this._parts.hostname.lastIndexOf(".", end - 1) + 1; + return this._parts.hostname.substring(end) || ""; + } else { + if (!v8) { + throw new TypeError("cannot set domain empty"); + } + if (v8.indexOf(":") !== -1) { + throw new TypeError("Domains cannot contain colons"); + } + URI.ensureValidHostname(v8, this._parts.protocol); + if (!this._parts.hostname || this.is("IP")) { + this._parts.hostname = v8; + } else { + var replace3 = new RegExp(escapeRegEx(this.domain()) + "$"); + this._parts.hostname = this._parts.hostname.replace(replace3, v8); + } + this.build(!build); + return this; + } + }; + p7.tld = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (typeof v8 === "boolean") { + build = v8; + v8 = void 0; + } + if (v8 === void 0) { + if (!this._parts.hostname || this.is("IP")) { + return ""; + } + var pos = this._parts.hostname.lastIndexOf("."); + var tld = this._parts.hostname.substring(pos + 1); + if (build !== true && SLD && SLD.list[tld.toLowerCase()]) { + return SLD.get(this._parts.hostname) || tld; + } + return tld; + } else { + var replace3; + if (!v8) { + throw new TypeError("cannot set TLD empty"); + } else if (v8.match(/[^a-zA-Z0-9-]/)) { + if (SLD && SLD.is(v8)) { + replace3 = new RegExp(escapeRegEx(this.tld()) + "$"); + this._parts.hostname = this._parts.hostname.replace(replace3, v8); + } else { + throw new TypeError('TLD "' + v8 + '" contains characters other than [A-Z0-9]'); + } + } else if (!this._parts.hostname || this.is("IP")) { + throw new ReferenceError("cannot set TLD on non-domain host"); + } else { + replace3 = new RegExp(escapeRegEx(this.tld()) + "$"); + this._parts.hostname = this._parts.hostname.replace(replace3, v8); + } + this.build(!build); + return this; + } + }; + p7.directory = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0 || v8 === true) { + if (!this._parts.path && !this._parts.hostname) { + return ""; + } + if (this._parts.path === "/") { + return "/"; + } + var end = this._parts.path.length - this.filename().length - 1; + var res = this._parts.path.substring(0, end) || (this._parts.hostname ? "/" : ""); + return v8 ? URI.decodePath(res) : res; + } else { + var e10 = this._parts.path.length - this.filename().length; + var directory = this._parts.path.substring(0, e10); + var replace3 = new RegExp("^" + escapeRegEx(directory)); + if (!this.is("relative")) { + if (!v8) { + v8 = "/"; + } + if (v8.charAt(0) !== "/") { + v8 = "/" + v8; + } + } + if (v8 && v8.charAt(v8.length - 1) !== "/") { + v8 += "/"; + } + v8 = URI.recodePath(v8); + this._parts.path = this._parts.path.replace(replace3, v8); + this.build(!build); + return this; + } + }; + p7.filename = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (typeof v8 !== "string") { + if (!this._parts.path || this._parts.path === "/") { + return ""; + } + var pos = this._parts.path.lastIndexOf("/"); + var res = this._parts.path.substring(pos + 1); + return v8 ? URI.decodePathSegment(res) : res; + } else { + var mutatedDirectory = false; + if (v8.charAt(0) === "/") { + v8 = v8.substring(1); + } + if (v8.match(/\.?\//)) { + mutatedDirectory = true; + } + var replace3 = new RegExp(escapeRegEx(this.filename()) + "$"); + v8 = URI.recodePath(v8); + this._parts.path = this._parts.path.replace(replace3, v8); + if (mutatedDirectory) { + this.normalizePath(build); + } else { + this.build(!build); + } + return this; + } + }; + p7.suffix = function(v8, build) { + if (this._parts.urn) { + return v8 === void 0 ? "" : this; + } + if (v8 === void 0 || v8 === true) { + if (!this._parts.path || this._parts.path === "/") { + return ""; + } + var filename = this.filename(); + var pos = filename.lastIndexOf("."); + var s7, res; + if (pos === -1) { + return ""; + } + s7 = filename.substring(pos + 1); + res = /^[a-z0-9%]+$/i.test(s7) ? s7 : ""; + return v8 ? URI.decodePathSegment(res) : res; + } else { + if (v8.charAt(0) === ".") { + v8 = v8.substring(1); + } + var suffix = this.suffix(); + var replace3; + if (!suffix) { + if (!v8) { + return this; + } + this._parts.path += "." + URI.recodePath(v8); + } else if (!v8) { + replace3 = new RegExp(escapeRegEx("." + suffix) + "$"); + } else { + replace3 = new RegExp(escapeRegEx(suffix) + "$"); + } + if (replace3) { + v8 = URI.recodePath(v8); + this._parts.path = this._parts.path.replace(replace3, v8); + } + this.build(!build); + return this; + } + }; + p7.segment = function(segment, v8, build) { + var separator = this._parts.urn ? ":" : "/"; + var path2 = this.path(); + var absolute = path2.substring(0, 1) === "/"; + var segments = path2.split(separator); + if (segment !== void 0 && typeof segment !== "number") { + build = v8; + v8 = segment; + segment = void 0; + } + if (segment !== void 0 && typeof segment !== "number") { + throw new Error('Bad segment "' + segment + '", must be 0-based integer'); + } + if (absolute) { + segments.shift(); + } + if (segment < 0) { + segment = Math.max(segments.length + segment, 0); + } + if (v8 === void 0) { + return segment === void 0 ? segments : segments[segment]; + } else if (segment === null || segments[segment] === void 0) { + if (isArray3(v8)) { + segments = []; + for (var i7 = 0, l7 = v8.length; i7 < l7; i7++) { + if (!v8[i7].length && (!segments.length || !segments[segments.length - 1].length)) { + continue; + } + if (segments.length && !segments[segments.length - 1].length) { + segments.pop(); + } + segments.push(trimSlashes(v8[i7])); + } + } else if (v8 || typeof v8 === "string") { + v8 = trimSlashes(v8); + if (segments[segments.length - 1] === "") { + segments[segments.length - 1] = v8; + } else { + segments.push(v8); + } + } + } else { + if (v8) { + segments[segment] = trimSlashes(v8); + } else { + segments.splice(segment, 1); + } + } + if (absolute) { + segments.unshift(""); + } + return this.path(segments.join(separator), build); + }; + p7.segmentCoded = function(segment, v8, build) { + var segments, i7, l7; + if (typeof segment !== "number") { + build = v8; + v8 = segment; + segment = void 0; + } + if (v8 === void 0) { + segments = this.segment(segment, v8, build); + if (!isArray3(segments)) { + segments = segments !== void 0 ? URI.decode(segments) : void 0; + } else { + for (i7 = 0, l7 = segments.length; i7 < l7; i7++) { + segments[i7] = URI.decode(segments[i7]); + } + } + return segments; + } + if (!isArray3(v8)) { + v8 = typeof v8 === "string" || v8 instanceof String ? URI.encode(v8) : v8; + } else { + for (i7 = 0, l7 = v8.length; i7 < l7; i7++) { + v8[i7] = URI.encode(v8[i7]); + } + } + return this.segment(segment, v8, build); + }; + var q5 = p7.query; + p7.query = function(v8, build) { + if (v8 === true) { + return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + } else if (typeof v8 === "function") { + var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + var result2 = v8.call(this, data); + this._parts.query = URI.buildQuery(result2 || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace); + this.build(!build); + return this; + } else if (v8 !== void 0 && typeof v8 !== "string") { + this._parts.query = URI.buildQuery(v8, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace); + this.build(!build); + return this; + } else { + return q5.call(this, v8, build); + } + }; + p7.setQuery = function(name2, value2, build) { + var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + if (typeof name2 === "string" || name2 instanceof String) { + data[name2] = value2 !== void 0 ? value2 : null; + } else if (typeof name2 === "object") { + for (var key in name2) { + if (hasOwn.call(name2, key)) { + data[key] = name2[key]; + } + } + } else { + throw new TypeError("URI.addQuery() accepts an object, string as the name parameter"); + } + this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace); + if (typeof name2 !== "string") { + build = value2; + } + this.build(!build); + return this; + }; + p7.addQuery = function(name2, value2, build) { + var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + URI.addQuery(data, name2, value2 === void 0 ? null : value2); + this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace); + if (typeof name2 !== "string") { + build = value2; + } + this.build(!build); + return this; + }; + p7.removeQuery = function(name2, value2, build) { + var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + URI.removeQuery(data, name2, value2); + this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace); + if (typeof name2 !== "string") { + build = value2; + } + this.build(!build); + return this; + }; + p7.hasQuery = function(name2, value2, withinArray) { + var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace); + return URI.hasQuery(data, name2, value2, withinArray); + }; + p7.setSearch = p7.setQuery; + p7.addSearch = p7.addQuery; + p7.removeSearch = p7.removeQuery; + p7.hasSearch = p7.hasQuery; + p7.normalize = function() { + if (this._parts.urn) { + return this.normalizeProtocol(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build(); + } + return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build(); + }; + p7.normalizeProtocol = function(build) { + if (typeof this._parts.protocol === "string") { + this._parts.protocol = this._parts.protocol.toLowerCase(); + this.build(!build); + } + return this; + }; + p7.normalizeHostname = function(build) { + if (this._parts.hostname) { + if (this.is("IDN") && punycode) { + this._parts.hostname = punycode.toASCII(this._parts.hostname); + } else if (this.is("IPv6") && IPv6) { + this._parts.hostname = IPv6.best(this._parts.hostname); + } + this._parts.hostname = this._parts.hostname.toLowerCase(); + this.build(!build); + } + return this; + }; + p7.normalizePort = function(build) { + if (typeof this._parts.protocol === "string" && this._parts.port === URI.defaultPorts[this._parts.protocol]) { + this._parts.port = null; + this.build(!build); + } + return this; + }; + p7.normalizePath = function(build) { + var _path = this._parts.path; + if (!_path) { + return this; + } + if (this._parts.urn) { + this._parts.path = URI.recodeUrnPath(this._parts.path); + this.build(!build); + return this; + } + if (this._parts.path === "/") { + return this; + } + _path = URI.recodePath(_path); + var _was_relative; + var _leadingParents = ""; + var _parent, _pos; + if (_path.charAt(0) !== "/") { + _was_relative = true; + _path = "/" + _path; + } + if (_path.slice(-3) === "/.." || _path.slice(-2) === "/.") { + _path += "/"; + } + _path = _path.replace(/(\/(\.\/)+)|(\/\.$)/g, "/").replace(/\/{2,}/g, "/"); + if (_was_relative) { + _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || ""; + if (_leadingParents) { + _leadingParents = _leadingParents[0]; + } + } + while (true) { + _parent = _path.search(/\/\.\.(\/|$)/); + if (_parent === -1) { + break; + } else if (_parent === 0) { + _path = _path.substring(3); + continue; + } + _pos = _path.substring(0, _parent).lastIndexOf("/"); + if (_pos === -1) { + _pos = _parent; + } + _path = _path.substring(0, _pos) + _path.substring(_parent + 3); + } + if (_was_relative && this.is("relative")) { + _path = _leadingParents + _path.substring(1); + } + this._parts.path = _path; + this.build(!build); + return this; + }; + p7.normalizePathname = p7.normalizePath; + p7.normalizeQuery = function(build) { + if (typeof this._parts.query === "string") { + if (!this._parts.query.length) { + this._parts.query = null; + } else { + this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace)); + } + this.build(!build); + } + return this; + }; + p7.normalizeFragment = function(build) { + if (!this._parts.fragment) { + this._parts.fragment = null; + this.build(!build); + } + return this; + }; + p7.normalizeSearch = p7.normalizeQuery; + p7.normalizeHash = p7.normalizeFragment; + p7.iso8859 = function() { + var e10 = URI.encode; + var d7 = URI.decode; + URI.encode = escape; + URI.decode = decodeURIComponent; + try { + this.normalize(); + } finally { + URI.encode = e10; + URI.decode = d7; + } + return this; + }; + p7.unicode = function() { + var e10 = URI.encode; + var d7 = URI.decode; + URI.encode = strictEncodeURIComponent; + URI.decode = unescape; + try { + this.normalize(); + } finally { + URI.encode = e10; + URI.decode = d7; + } + return this; + }; + p7.readable = function() { + var uri = this.clone(); + uri.username("").password("").normalize(); + var t8 = ""; + if (uri._parts.protocol) { + t8 += uri._parts.protocol + "://"; + } + if (uri._parts.hostname) { + if (uri.is("punycode") && punycode) { + t8 += punycode.toUnicode(uri._parts.hostname); + if (uri._parts.port) { + t8 += ":" + uri._parts.port; + } + } else { + t8 += uri.host(); + } + } + if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== "/") { + t8 += "/"; + } + t8 += uri.path(true); + if (uri._parts.query) { + var q6 = ""; + for (var i7 = 0, qp = uri._parts.query.split("&"), l7 = qp.length; i7 < l7; i7++) { + var kv = (qp[i7] || "").split("="); + q6 += "&" + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace).replace(/&/g, "%26"); + if (kv[1] !== void 0) { + q6 += "=" + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace).replace(/&/g, "%26"); + } + } + t8 += "?" + q6.substring(1); + } + t8 += URI.decodeQuery(uri.hash(), true); + return t8; + }; + p7.absoluteTo = function(base) { + var resolved = this.clone(); + var properties = ["protocol", "username", "password", "hostname", "port"]; + var basedir, i7, p8; + if (this._parts.urn) { + throw new Error("URNs do not have any generally defined hierarchical components"); + } + if (!(base instanceof URI)) { + base = new URI(base); + } + if (resolved._parts.protocol) { + return resolved; + } else { + resolved._parts.protocol = base._parts.protocol; + } + if (this._parts.hostname) { + return resolved; + } + for (i7 = 0; p8 = properties[i7]; i7++) { + resolved._parts[p8] = base._parts[p8]; + } + if (!resolved._parts.path) { + resolved._parts.path = base._parts.path; + if (!resolved._parts.query) { + resolved._parts.query = base._parts.query; + } + } else { + if (resolved._parts.path.substring(-2) === "..") { + resolved._parts.path += "/"; + } + if (resolved.path().charAt(0) !== "/") { + basedir = base.directory(); + basedir = basedir ? basedir : base.path().indexOf("/") === 0 ? "/" : ""; + resolved._parts.path = (basedir ? basedir + "/" : "") + resolved._parts.path; + resolved.normalizePath(); + } + } + resolved.build(); + return resolved; + }; + p7.relativeTo = function(base) { + var relative2 = this.clone().normalize(); + var relativeParts, baseParts, common3, relativePath2, basePath; + if (relative2._parts.urn) { + throw new Error("URNs do not have any generally defined hierarchical components"); + } + base = new URI(base).normalize(); + relativeParts = relative2._parts; + baseParts = base._parts; + relativePath2 = relative2.path(); + basePath = base.path(); + if (relativePath2.charAt(0) !== "/") { + throw new Error("URI is already relative"); + } + if (basePath.charAt(0) !== "/") { + throw new Error("Cannot calculate a URI relative to another relative URI"); + } + if (relativeParts.protocol === baseParts.protocol) { + relativeParts.protocol = null; + } + if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) { + return relative2.build(); + } + if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) { + return relative2.build(); + } + if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) { + relativeParts.hostname = null; + relativeParts.port = null; + } else { + return relative2.build(); + } + if (relativePath2 === basePath) { + relativeParts.path = ""; + return relative2.build(); + } + common3 = URI.commonPath(relativePath2, basePath); + if (!common3) { + return relative2.build(); + } + var parents = baseParts.path.substring(common3.length).replace(/[^\/]*$/, "").replace(/.*?\//g, "../"); + relativeParts.path = parents + relativeParts.path.substring(common3.length) || "./"; + return relative2.build(); + }; + p7.equals = function(uri) { + var one = this.clone(); + var two = new URI(uri); + var one_map = {}; + var two_map = {}; + var checked = {}; + var one_query, two_query, key; + one.normalize(); + two.normalize(); + if (one.toString() === two.toString()) { + return true; + } + one_query = one.query(); + two_query = two.query(); + one.query(""); + two.query(""); + if (one.toString() !== two.toString()) { + return false; + } + if (one_query.length !== two_query.length) { + return false; + } + one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace); + two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace); + for (key in one_map) { + if (hasOwn.call(one_map, key)) { + if (!isArray3(one_map[key])) { + if (one_map[key] !== two_map[key]) { + return false; + } + } else if (!arraysEqual(one_map[key], two_map[key])) { + return false; + } + checked[key] = true; + } + } + for (key in two_map) { + if (hasOwn.call(two_map, key)) { + if (!checked[key]) { + return false; + } + } + } + return true; + }; + p7.preventInvalidHostname = function(v8) { + this._parts.preventInvalidHostname = !!v8; + return this; + }; + p7.duplicateQueryParameters = function(v8) { + this._parts.duplicateQueryParameters = !!v8; + return this; + }; + p7.escapeQuerySpace = function(v8) { + this._parts.escapeQuerySpace = !!v8; + return this; + }; + return URI; + }); + } +}); + +// node_modules/@stoplight/json-ref-resolver/uri.js +var require_uri2 = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/uri.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ExtendedURI = void 0; + var BaseURI = require_URI(); + var ExtendedURI = class extends BaseURI { + constructor(_value) { + super(_value); + this._value = _value.trim(); + } + get length() { + return this._value.length; + } + }; + exports28.ExtendedURI = ExtendedURI; + } +}); + +// node_modules/@stoplight/json-ref-resolver/utils.js +var require_utils5 = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/utils.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.uriIsJSONPointer = exports28.uriToJSONPointer = exports28.addToJSONPointer = void 0; + var replace3 = (str2, find2, repl) => { + const orig = str2.toString(); + let res = ""; + let rem = orig; + let beg = 0; + let end = rem.indexOf(find2); + while (end > -1) { + res += orig.substring(beg, beg + end) + repl; + rem = rem.substring(end + find2.length, rem.length); + beg += end + find2.length; + end = rem.indexOf(find2); + } + if (rem.length > 0) { + res += orig.substring(orig.length - rem.length, orig.length); + } + return res; + }; + var encodeFragmentSegment = (segment) => { + return replace3(replace3(segment, "~", "~0"), "/", "~1"); + }; + var addToJSONPointer = (pointer, part) => { + return `${pointer}/${encodeFragmentSegment(part)}`; + }; + exports28.addToJSONPointer = addToJSONPointer; + var uriToJSONPointer = (uri) => { + if ("length" in uri && uri.length === 0) { + return ""; + } + return uri.fragment() !== "" ? `#${uri.fragment()}` : uri.href() === "" ? "#" : ""; + }; + exports28.uriToJSONPointer = uriToJSONPointer; + var uriIsJSONPointer = (ref) => { + return (!("length" in ref) || ref.length > 0) && ref.path() === ""; + }; + exports28.uriIsJSONPointer = uriIsJSONPointer; + } +}); + +// node_modules/@stoplight/json-ref-resolver/crawler.js +var require_crawler = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/crawler.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ResolveCrawler = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var dependency_graph_1 = require_dep_graph(); + var get4 = (init_get(), __toCommonJS(get_exports)); + var Utils = require_utils5(); + var ResolveCrawler = class { + constructor(runner, jsonPointer, _resolved) { + this._resolved = _resolved; + this.resolvers = []; + this.pointerGraph = new dependency_graph_1.DepGraph({ circular: true }); + this.pointerStemGraph = new dependency_graph_1.DepGraph({ circular: true }); + this.computeGraph = (target, parentPath = [], parentPointer = "#", pointerStack = []) => { + if (!parentPointer) + parentPointer = "#"; + let ref = this._runner.computeRef({ + val: target, + jsonPointer: parentPointer, + pointerStack + }); + if (ref !== void 0) { + this._resolveRef({ + ref, + val: target, + parentPath, + pointerStack, + parentPointer, + cacheKey: parentPointer, + resolvingPointer: this.jsonPointer + }); + } else if (typeof target === "object") { + for (const key in target) { + if (!target.hasOwnProperty(key)) + continue; + const val = target[key]; + const currentPointer = Utils.addToJSONPointer(parentPointer, key); + ref = this._runner.computeRef({ + key, + val, + jsonPointer: currentPointer, + pointerStack + }); + parentPath.push(key); + if (ref !== void 0) { + this._resolveRef({ + ref, + val, + parentPath, + parentPointer: currentPointer, + pointerStack, + cacheKey: Utils.uriToJSONPointer(ref), + resolvingPointer: this.jsonPointer + }); + } else if (typeof val === "object") { + this.computeGraph(val, parentPath, currentPointer, pointerStack); + } + parentPath.pop(); + } + } + }; + this._resolveRef = (opts) => { + const { pointerStack, parentPath, parentPointer, ref } = opts; + if (Utils.uriIsJSONPointer(ref)) { + if (this._runner.dereferenceInline) { + const targetPointer = Utils.uriToJSONPointer(ref); + let targetPath; + try { + targetPath = (0, json_1.pointerToPath)(targetPointer); + } catch (_a2) { + this._resolved.errors.push({ + code: "PARSE_POINTER", + message: `'${ref}' JSON pointer is invalid`, + uri: this._runner.baseUri, + uriStack: this._runner.uriStack, + pointerStack: [], + path: [] + }); + return; + } + let referencesParent = targetPath.length > 0; + for (const i7 in targetPath) { + if (parentPath[i7] !== targetPath[i7]) { + referencesParent = false; + break; + } + } + if (referencesParent) + return; + if (!this.pointerStemGraph.hasNode(targetPointer)) { + this.pointerStemGraph.addNode(targetPointer); + } + let stem = "#"; + let tail2 = ""; + for (let i7 = 0; i7 < parentPath.length; i7++) { + const part = parentPath[i7]; + if (part === targetPath[i7]) { + stem += `/${part}`; + } else { + tail2 += `/${part}`; + const dep = `${stem}${tail2}`; + if (dep !== parentPointer && dep !== targetPointer) { + if (!this.pointerStemGraph.hasNode(dep)) { + this.pointerStemGraph.addNode(dep); + } + this.pointerStemGraph.addDependency(dep, targetPointer); + } + } + } + if (!this.pointerGraph.hasNode(parentPointer)) { + this.pointerGraph.addNode(parentPointer); + } + if (!this.pointerGraph.hasNode(targetPointer)) { + this.pointerGraph.addNode(targetPointer); + } + const targetRef = `${this._runner.baseUri.toString()}${targetPointer}`; + if (!this._runner.graph.hasNode(targetRef)) + this._runner.graph.addNode(targetRef, { refMap: {} }); + if (this._runner.root !== targetRef) + this._runner.graph.addDependency(this._runner.root, targetRef); + this.pointerGraph.addDependency(parentPointer, targetPointer); + if (this.jsonPointer && (pointerStack.length < 2 || !pointerStack.includes(targetPointer))) { + pointerStack.push(targetPointer); + this.computeGraph(get4(this._runner.source, targetPath), targetPath, targetPointer, pointerStack); + pointerStack.pop(); + } + } + } else { + const remoteRef = ref.toString(); + if (!this._runner.graph.hasNode(remoteRef)) + this._runner.graph.addNode(remoteRef, { refMap: {} }); + if (this._runner.root !== remoteRef) + this._runner.graph.addDependency(this._runner.root, remoteRef); + if (this._runner.dereferenceRemote && !this._runner.atMaxUriDepth()) { + this.resolvers.push(this._runner.lookupAndResolveUri(opts)); + } + } + }; + this.jsonPointer = jsonPointer; + this._runner = runner; + } + }; + exports28.ResolveCrawler = ResolveCrawler; + } +}); + +// node_modules/fast-memoize/src/index.js +var require_src3 = __commonJS({ + "node_modules/fast-memoize/src/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + function memoize2(fn, options) { + var cache = options && options.cache ? options.cache : cacheDefault; + var serializer = options && options.serializer ? options.serializer : serializerDefault; + var strategy = options && options.strategy ? options.strategy : strategyDefault; + return strategy(fn, { + cache, + serializer + }); + } + function isPrimitive2(value2) { + return value2 == null || typeof value2 === "number" || typeof value2 === "boolean"; + } + function monadic(fn, cache, serializer, arg) { + var cacheKey = isPrimitive2(arg) ? arg : serializer(arg); + var computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn.call(this, arg); + cache.set(cacheKey, computedValue); + } + return computedValue; + } + function variadic(fn, cache, serializer) { + var args = Array.prototype.slice.call(arguments, 3); + var cacheKey = serializer(args); + var computedValue = cache.get(cacheKey); + if (typeof computedValue === "undefined") { + computedValue = fn.apply(this, args); + cache.set(cacheKey, computedValue); + } + return computedValue; + } + function assemble(fn, context2, strategy, cache, serialize) { + return strategy.bind( + context2, + fn, + cache, + serialize + ); + } + function strategyDefault(fn, options) { + var strategy = fn.length === 1 ? monadic : variadic; + return assemble( + fn, + this, + strategy, + options.cache.create(), + options.serializer + ); + } + function strategyVariadic(fn, options) { + var strategy = variadic; + return assemble( + fn, + this, + strategy, + options.cache.create(), + options.serializer + ); + } + function strategyMonadic(fn, options) { + var strategy = monadic; + return assemble( + fn, + this, + strategy, + options.cache.create(), + options.serializer + ); + } + function serializerDefault() { + return JSON.stringify(arguments); + } + function ObjectWithoutPrototypeCache() { + this.cache = /* @__PURE__ */ Object.create(null); + } + ObjectWithoutPrototypeCache.prototype.has = function(key) { + return key in this.cache; + }; + ObjectWithoutPrototypeCache.prototype.get = function(key) { + return this.cache[key]; + }; + ObjectWithoutPrototypeCache.prototype.set = function(key, value2) { + this.cache[key] = value2; + }; + var cacheDefault = { + create: function create2() { + return new ObjectWithoutPrototypeCache(); + } + }; + module5.exports = memoize2; + module5.exports.strategies = { + variadic: strategyVariadic, + monadic: strategyMonadic + }; + } +}); + +// node_modules/@stoplight/json-ref-resolver/runner.js +var require_runner = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/runner.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ResolveRunner = exports28.defaultGetRef = void 0; + var tslib_1 = (init_tslib_es66(), __toCommonJS(tslib_es6_exports6)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var dependency_graph_1 = require_dep_graph(); + var immer_1 = require_dist5(); + var get4 = (init_get(), __toCommonJS(get_exports)); + var set4 = (init_set2(), __toCommonJS(set_exports)); + var URI = require_URI(); + var uri_1 = require_uri2(); + var cache_1 = require_cache(); + var crawler_1 = require_crawler(); + var Utils = require_utils5(); + var memoize2 = require_src3(); + var resolveRunnerCount = 0; + var defaultGetRef = (key, val) => { + if (val && typeof val === "object" && typeof val.$ref === "string") + return val.$ref; + return; + }; + exports28.defaultGetRef = defaultGetRef; + var ResolveRunner = class _ResolveRunner { + constructor(source, graph = new dependency_graph_1.DepGraph({ circular: true }), opts = {}) { + this.ctx = {}; + this.computeRef = (opts2) => { + const refStr = this.getRef(opts2.key, opts2.val); + if (refStr === void 0) + return; + let ref = new uri_1.ExtendedURI(refStr); + if (refStr[0] !== "#") { + const isFile = this.isFile(ref); + if (isFile) { + let absRef = ref.toString(); + if (!ref.is("absolute")) { + if (this.baseUri.toString()) { + absRef = (0, path_1.join)((0, path_1.dirname)(this.baseUri.toString()), (0, path_1.stripRoot)(absRef)); + } else { + absRef = ""; + } + } + if (absRef) { + ref = new URI((0, path_1.toFSPath)(absRef)).fragment(ref.fragment()); + } + } else if (ref.scheme().includes("http") || ref.scheme() === "" && this.baseUri.scheme().includes("http")) { + if (this.baseUri.authority() !== "" && ref.authority() === "") { + ref = ref.absoluteTo(this.baseUri); + } + } + } + if (String(ref).length > 0 && this.isFile(this.baseUri) && this.isFile(ref) && this.baseUri.path() === ref.path()) { + ref = new uri_1.ExtendedURI(`#${ref.fragment()}`); + } + if (this.transformRef) { + return this.transformRef(Object.assign(Object.assign({}, opts2), { ref, uri: this.baseUri }), this.ctx); + } + return ref; + }; + this.atMaxUriDepth = () => { + return this.uriStack.length >= 100; + }; + this.lookupUri = (opts2) => tslib_1.__awaiter(this, void 0, void 0, function* () { + const { ref } = opts2; + let scheme = ref.scheme(); + if (!this.resolvers[scheme] && this.isFile(ref)) { + scheme = "file"; + } + const resolver = this.resolvers[scheme]; + if (!resolver) { + throw new Error(`No resolver defined for scheme '${ref.scheme() || "file"}' in ref ${ref.toString()}`); + } + let result2 = yield resolver.resolve(ref, this.ctx); + if (this.parseResolveResult) { + try { + const parsed = yield this.parseResolveResult({ + uriResult: result2, + result: result2, + targetAuthority: ref, + parentAuthority: this.baseUri, + parentPath: opts2.parentPath, + fragment: opts2.fragment + }); + result2 = parsed.result; + } catch (e10) { + throw new Error(`Could not parse remote reference response for '${ref.toString()}' - ${String(e10)}`); + } + } + return new _ResolveRunner(result2, this.graph, { + depth: this.depth + 1, + baseUri: ref.toString(), + root: ref, + uriStack: this.uriStack, + uriCache: this.uriCache, + resolvers: this.resolvers, + transformRef: this.transformRef, + parseResolveResult: this.parseResolveResult, + transformDereferenceResult: this.transformDereferenceResult, + dereferenceRemote: this.dereferenceRemote, + dereferenceInline: this.dereferenceInline, + ctx: this.ctx + }); + }); + this.lookupAndResolveUri = (opts2) => tslib_1.__awaiter(this, void 0, void 0, function* () { + const { val, ref, resolvingPointer, parentPointer, pointerStack } = opts2; + const parentPath = opts2.parentPath ? opts2.parentPath.slice() : []; + const uriCacheKey = this.computeUriCacheKey(ref); + const lookupResult = { + uri: ref, + pointerStack, + targetPath: resolvingPointer === parentPointer ? [] : parentPath + }; + if (this.uriStack.includes(uriCacheKey)) { + lookupResult.resolved = { + result: val, + graph: this.graph, + refMap: {}, + errors: [], + runner: this + }; + return lookupResult; + } else { + let uriResolver; + const currentAuthority = this.baseUri.toString(); + const newUriStack = currentAuthority && this.depth !== 0 ? currentAuthority : null; + try { + if (this.atMaxUriDepth()) { + throw new Error(`Max uri depth (${this.uriStack.length}) reached. Halting, this is probably a circular loop.`); + } + uriResolver = yield this.lookupUri({ + ref: ref.clone().fragment(""), + fragment: ref.fragment(), + cacheKey: uriCacheKey, + parentPath + }); + if (newUriStack) { + uriResolver.uriStack = uriResolver.uriStack.concat(newUriStack); + } + } catch (e10) { + lookupResult.error = { + code: "RESOLVE_URI", + message: String(e10), + uri: ref, + uriStack: newUriStack ? this.uriStack.concat(newUriStack) : this.uriStack, + pointerStack, + path: parentPath + }; + } + if (uriResolver) { + lookupResult.resolved = yield uriResolver.resolve({ + jsonPointer: Utils.uriToJSONPointer(ref), + parentPath + }); + if (lookupResult.resolved.errors.length) { + for (const error2 of lookupResult.resolved.errors) { + if (error2.code === "POINTER_MISSING" && error2.path.join("/") === ref.fragment().slice(1)) { + const errorPathInResult = ref.fragment ? (0, json_1.trimStart)(error2.path, (0, json_1.trimStart)(ref.fragment(), "/").split("/")) : error2.path; + if (errorPathInResult && errorPathInResult.length) { + set4(lookupResult.resolved.result, errorPathInResult, val); + } else if (lookupResult.resolved.result) { + lookupResult.resolved.result = val; + } + } + } + } + } + } + return lookupResult; + }); + this.id = resolveRunnerCount += 1; + this.depth = opts.depth || 0; + this._source = source; + this.resolvers = opts.resolvers || {}; + const baseUri = opts.baseUri || ""; + let uri = new URI(baseUri || ""); + if (this.isFile(uri)) { + uri = new URI((0, path_1.toFSPath)(baseUri)); + } + this.baseUri = uri; + this.uriStack = opts.uriStack || []; + this.uriCache = opts.uriCache || new cache_1.Cache(); + this.root = opts.root && opts.root.toString() || this.baseUri.toString() || "root"; + this.graph = graph; + if (!this.graph.hasNode(this.root)) { + this.graph.addNode(this.root, { refMap: {}, data: this._source }); + } + if (this.baseUri && this.depth === 0) { + this.uriCache.set(this.computeUriCacheKey(this.baseUri), this); + } + this.getRef = opts.getRef || exports28.defaultGetRef; + this.transformRef = opts.transformRef; + if (this.depth) { + this.dereferenceInline = true; + } else { + this.dereferenceInline = typeof opts.dereferenceInline !== "undefined" ? opts.dereferenceInline : true; + } + this.dereferenceRemote = typeof opts.dereferenceRemote !== "undefined" ? opts.dereferenceRemote : true; + this.parseResolveResult = opts.parseResolveResult; + this.transformDereferenceResult = opts.transformDereferenceResult; + this.ctx = opts.ctx; + this.lookupUri = memoize2(this.lookupUri, { + serializer: this._cacheKeySerializer, + cache: { + create: () => { + return this.uriCache; + } + } + }); + } + get source() { + return this._source; + } + resolve(opts) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const resolved = { + result: this.source, + graph: this.graph, + refMap: {}, + errors: [], + runner: this + }; + let targetPath; + const jsonPointer = opts && opts.jsonPointer && opts.jsonPointer.trim(); + if (jsonPointer && jsonPointer !== "#" && jsonPointer !== "#/") { + try { + targetPath = (0, json_1.pointerToPath)(jsonPointer); + } catch (_a2) { + resolved.errors.push({ + code: "PARSE_POINTER", + message: `'${jsonPointer}' JSON pointer is invalid`, + uri: this.baseUri, + uriStack: this.uriStack, + pointerStack: [], + path: [] + }); + return resolved; + } + resolved.result = get4(resolved.result, targetPath); + } + if (resolved.result === void 0) { + resolved.errors.push({ + code: "POINTER_MISSING", + message: `'${jsonPointer}' does not exist @ '${this.baseUri.toString()}'`, + uri: this.baseUri, + uriStack: this.uriStack, + pointerStack: [], + path: targetPath || [] + }); + return resolved; + } + const crawler = new crawler_1.ResolveCrawler(this, jsonPointer, resolved); + crawler.computeGraph(resolved.result, targetPath, jsonPointer || ""); + let uriResults = []; + if (crawler.resolvers.length) { + uriResults = yield Promise.all(crawler.resolvers); + } + if (uriResults.length) { + for (const r8 of uriResults) { + let resolvedTargetPath = r8.targetPath; + if (!resolvedTargetPath.length) + resolvedTargetPath = targetPath || []; + resolved.refMap[String(this.baseUri.clone().fragment((0, json_1.pathToPointer)(resolvedTargetPath)))] = String(r8.uri); + this._setGraphNodeEdge(String(this.root), (0, json_1.pathToPointer)(resolvedTargetPath), String(r8.uri)); + if (r8.error) { + resolved.errors.push(r8.error); + } + if (!r8.resolved) + continue; + if (r8.resolved.errors) { + resolved.errors = resolved.errors.concat(r8.resolved.errors); + } + if (r8.resolved.result === void 0) + continue; + this._source = (0, immer_1.default)(this._source, (draft) => { + if (r8.resolved) { + if (!resolvedTargetPath.length) { + return r8.resolved.result; + } else { + set4(draft, resolvedTargetPath, r8.resolved.result); + this._setGraphNodeData(String(r8.uri), r8.resolved.result); + } + } + }); + } + } + if (typeof this._source === "object") { + if (this.dereferenceInline) { + this._source = (0, immer_1.default)(this._source, (draft) => { + let processOrder = []; + try { + processOrder = crawler.pointerGraph.overallOrder(); + for (const pointer of processOrder) { + const dependants = crawler.pointerGraph.dependantsOf(pointer); + if (!dependants.length) + continue; + const pointerPath = (0, json_1.pointerToPath)(pointer); + const val = pointerPath.length === 0 ? (0, immer_1.original)(draft) : get4(draft, pointerPath); + for (const dependant of dependants) { + let isCircular; + const dependantPath = (0, json_1.pointerToPath)(dependant); + const dependantStems = crawler.pointerStemGraph.dependenciesOf(pointer); + for (const stem of dependantStems) { + if ((0, json_1.startsWith)(dependantPath, (0, json_1.pointerToPath)(stem))) { + isCircular = true; + break; + } + } + if (isCircular) + continue; + resolved.refMap[(0, json_1.pathToPointer)(dependantPath)] = (0, json_1.pathToPointer)(pointerPath); + this._setGraphNodeEdge(this.root, (0, json_1.pathToPointer)(dependantPath), (0, json_1.pathToPointer)(pointerPath)); + if (val !== void 0) { + set4(draft, dependantPath, val); + this._setGraphNodeData((0, json_1.pathToPointer)(pointerPath), val); + } else { + resolved.errors.push({ + code: "POINTER_MISSING", + message: `'${pointer}' does not exist`, + path: dependantPath, + uri: this.baseUri, + uriStack: this.uriStack, + pointerStack: [] + }); + } + } + } + } catch (e10) { + } + }); + } + if (targetPath) { + resolved.result = get4(this._source, targetPath); + } else { + resolved.result = this._source; + } + } else { + resolved.result = this._source; + } + if (this.transformDereferenceResult) { + const ref = new URI(jsonPointer || ""); + try { + const { result: result2, error: error2 } = yield this.transformDereferenceResult({ + source: this.source, + result: resolved.result, + targetAuthority: ref, + parentAuthority: this.baseUri, + parentPath: opts ? opts.parentPath || [] : [], + fragment: ref.fragment() + }); + resolved.result = result2; + if (error2) { + throw new Error(`Could not transform dereferenced result for '${ref.toString()}' - ${String(error2)}`); + } + } catch (e10) { + resolved.errors.push({ + code: "TRANSFORM_DEREFERENCED", + message: `Error: Could not transform dereferenced result for '${this.baseUri.toString()}${ref.fragment() !== "" ? `#${ref.fragment()}` : ``}' - ${String(e10)}`, + uri: ref, + uriStack: this.uriStack, + pointerStack: [], + path: targetPath + }); + } + } + this._setGraphNodeData(this.root, this._source); + return resolved; + }); + } + _cacheKeySerializer(sOpts) { + return sOpts && typeof sOpts === "object" && sOpts.cacheKey ? sOpts.cacheKey : JSON.stringify(arguments); + } + computeUriCacheKey(ref) { + return ref.clone().fragment("").toString(); + } + isFile(ref) { + const scheme = ref.scheme(); + if (scheme === "file") + return true; + if (!scheme) { + if (ref.toString().charAt(0) === "/") + return true; + if (this.baseUri) { + const uriScheme = this.baseUri.scheme(); + return Boolean(!uriScheme || uriScheme === "file" || !this.resolvers[uriScheme]); + } + } else if (!this.resolvers[scheme]) { + return true; + } + return false; + } + _setGraphNodeData(nodeId, data) { + if (!this.graph.hasNode(nodeId)) + return; + const graphNodeData = this.graph.getNodeData(nodeId) || {}; + graphNodeData.data = data; + this.graph.setNodeData(nodeId, graphNodeData); + } + _setGraphNodeEdge(nodeId, fromPointer, toNodeId) { + if (!this.graph.hasNode(nodeId)) + return; + const graphNodeData = this.graph.getNodeData(nodeId) || {}; + graphNodeData.refMap = graphNodeData.refMap || {}; + graphNodeData.refMap[fromPointer] = toNodeId; + this.graph.setNodeData(nodeId, graphNodeData); + } + }; + exports28.ResolveRunner = ResolveRunner; + } +}); + +// node_modules/@stoplight/json-ref-resolver/resolver.js +var require_resolver = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/resolver.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Resolver = void 0; + var dependency_graph_1 = require_dep_graph(); + var cache_1 = require_cache(); + var runner_1 = require_runner(); + var Resolver = class { + constructor(opts = {}) { + this.ctx = {}; + this.uriCache = opts.uriCache || new cache_1.Cache(); + this.resolvers = opts.resolvers || {}; + this.getRef = opts.getRef; + this.transformRef = opts.transformRef; + this.dereferenceInline = typeof opts.dereferenceInline !== "undefined" ? opts.dereferenceInline : true; + this.dereferenceRemote = typeof opts.dereferenceRemote !== "undefined" ? opts.dereferenceRemote : true; + this.parseResolveResult = opts.parseResolveResult; + this.transformDereferenceResult = opts.transformDereferenceResult; + this.ctx = opts.ctx; + } + resolve(source, opts = {}) { + const graph = new dependency_graph_1.DepGraph({ circular: true }); + const runner = new runner_1.ResolveRunner(source, graph, Object.assign(Object.assign({ uriCache: this.uriCache, resolvers: this.resolvers, getRef: this.getRef, transformRef: this.transformRef, dereferenceInline: this.dereferenceInline, dereferenceRemote: this.dereferenceRemote, parseResolveResult: this.parseResolveResult, transformDereferenceResult: this.transformDereferenceResult }, opts), { ctx: Object.assign({}, this.ctx || {}, opts.ctx || {}) })); + return runner.resolve(opts); + } + }; + exports28.Resolver = Resolver; + } +}); + +// node_modules/@stoplight/json-ref-resolver/index.js +var require_json_ref_resolver = __commonJS({ + "node_modules/@stoplight/json-ref-resolver/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.defaultGetRef = exports28.Cache = void 0; + var tslib_1 = (init_tslib_es66(), __toCommonJS(tslib_es6_exports6)); + tslib_1.__exportStar(require_resolver(), exports28); + var cache_1 = require_cache(); + Object.defineProperty(exports28, "Cache", { enumerable: true, get: function() { + return cache_1.Cache; + } }); + var runner_1 = require_runner(); + Object.defineProperty(exports28, "defaultGetRef", { enumerable: true, get: function() { + return runner_1.defaultGetRef; + } }); + } +}); + +// node_modules/@stoplight/spectral-runtime/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports7 = {}; +__export(tslib_es6_exports7, { + __addDisposableResource: () => __addDisposableResource6, + __assign: () => __assign7, + __asyncDelegator: () => __asyncDelegator7, + __asyncGenerator: () => __asyncGenerator7, + __asyncValues: () => __asyncValues7, + __await: () => __await7, + __awaiter: () => __awaiter8, + __classPrivateFieldGet: () => __classPrivateFieldGet7, + __classPrivateFieldIn: () => __classPrivateFieldIn6, + __classPrivateFieldSet: () => __classPrivateFieldSet7, + __createBinding: () => __createBinding7, + __decorate: () => __decorate7, + __disposeResources: () => __disposeResources6, + __esDecorate: () => __esDecorate6, + __exportStar: () => __exportStar7, + __extends: () => __extends7, + __generator: () => __generator7, + __importDefault: () => __importDefault7, + __importStar: () => __importStar7, + __makeTemplateObject: () => __makeTemplateObject7, + __metadata: () => __metadata7, + __param: () => __param7, + __propKey: () => __propKey6, + __read: () => __read7, + __rest: () => __rest7, + __runInitializers: () => __runInitializers6, + __setFunctionName: () => __setFunctionName6, + __spread: () => __spread7, + __spreadArray: () => __spreadArray6, + __spreadArrays: () => __spreadArrays7, + __values: () => __values7, + default: () => tslib_es6_default6 +}); +function __extends7(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics7(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest7(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate7(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param7(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate6(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers6(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey6(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName6(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata7(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter8(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator7(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar7(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding7(o7, m7, p7); +} +function __values7(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read7(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread7() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read7(arguments[i7])); + return ar; +} +function __spreadArrays7() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray6(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await7(v8) { + return this instanceof __await7 ? (this.v = v8, this) : new __await7(v8); +} +function __asyncGenerator7(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await7 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator7(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await7(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues7(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values7 === "function" ? __values7(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject7(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar7(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding7(result2, mod2, k6); + } + __setModuleDefault6(result2, mod2); + return result2; +} +function __importDefault7(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet7(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet7(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn6(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); +} +function __addDisposableResource6(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources6(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError6(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics7, __assign7, __createBinding7, __setModuleDefault6, _SuppressedError6, tslib_es6_default6; +var init_tslib_es67 = __esm({ + "node_modules/@stoplight/spectral-runtime/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics7 = function(d7, b8) { + extendStatics7 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics7(d7, b8); + }; + __assign7 = function() { + __assign7 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign7.apply(this, arguments); + }; + __createBinding7 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault6 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError6 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default6 = { + __extends: __extends7, + __assign: __assign7, + __rest: __rest7, + __decorate: __decorate7, + __param: __param7, + __metadata: __metadata7, + __awaiter: __awaiter8, + __generator: __generator7, + __createBinding: __createBinding7, + __exportStar: __exportStar7, + __values: __values7, + __read: __read7, + __spread: __spread7, + __spreadArrays: __spreadArrays7, + __spreadArray: __spreadArray6, + __await: __await7, + __asyncGenerator: __asyncGenerator7, + __asyncDelegator: __asyncDelegator7, + __asyncValues: __asyncValues7, + __makeTemplateObject: __makeTemplateObject7, + __importStar: __importStar7, + __importDefault: __importDefault7, + __classPrivateFieldGet: __classPrivateFieldGet7, + __classPrivateFieldSet: __classPrivateFieldSet7, + __classPrivateFieldIn: __classPrivateFieldIn6, + __addDisposableResource: __addDisposableResource6, + __disposeResources: __disposeResources6 + }; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/decodeSegmentFragment.js +var require_decodeSegmentFragment = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/decodeSegmentFragment.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.decodeSegmentFragment = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + function decodeSegmentFragment(segment) { + return typeof segment !== "string" ? String(segment) : (0, json_1.decodePointerFragment)(segment); + } + exports28.decodeSegmentFragment = decodeSegmentFragment; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/printError.js +var require_printError = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/printError.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.printError = void 0; + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + function printError(maybeError) { + if ((0, lodash_1.isError)(maybeError)) { + return maybeError.message; + } + return "unknown error"; + } + exports28.printError = printError; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/printPath.js +var require_printPath = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/printPath.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.printPath = exports28.PrintStyle = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var PrintStyle; + (function(PrintStyle2) { + PrintStyle2["Dot"] = "dot"; + PrintStyle2["Pointer"] = "pointer"; + PrintStyle2["EscapedPointer"] = "escapedPointer"; + })(PrintStyle = exports28.PrintStyle || (exports28.PrintStyle = {})); + var isNumeric = (input) => typeof input === "number" || !Number.isNaN(Number(input)); + var hasWhitespace = (input) => /\s/.test(input); + var safeDecodePointerFragment = (segment) => typeof segment === "number" ? segment : (0, json_1.decodePointerFragment)(segment); + var printDotBracketsSegment = (segment) => { + if (typeof segment === "number") { + return `[${segment}]`; + } + if (segment.length === 0) { + return `['']`; + } + if (hasWhitespace(segment)) { + return `['${segment}']`; + } + if (isNumeric(segment)) { + return `[${segment}]`; + } + return null; + }; + var pathToDotString = (path2) => path2.reduce((output, segment, index4) => { + var _a2; + return `${output}${(_a2 = printDotBracketsSegment(segment)) !== null && _a2 !== void 0 ? _a2 : `${index4 === 0 ? "" : "."}${segment}`}`; + }, ""); + var printPath = (path2, style) => { + switch (style) { + case PrintStyle.Dot: + return (0, json_1.decodePointerFragment)(pathToDotString(path2)); + case PrintStyle.Pointer: + if (path2.length === 0) { + return "#"; + } + return `#/${(0, json_1.decodePointerFragment)(path2.join("/"))}`; + case PrintStyle.EscapedPointer: + return (0, json_1.pathToPointer)(path2.map(safeDecodePointerFragment)); + default: + return String(path2); + } + }; + exports28.printPath = printPath; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/printValue.js +var require_printValue = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/printValue.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.printValue = void 0; + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + function printValue(value2) { + if (value2 === void 0) { + return "undefined"; + } + if ((0, lodash_1.isObject)(value2)) { + if (Array.isArray(value2)) { + return "Array[]"; + } + if (value2 instanceof RegExp) { + return String(value2.source); + } + if (!(0, json_1.isPlainObject)(value2) && "constructor" in value2 && typeof value2.constructor.name === "string") { + return value2.constructor.name; + } + return "Object{}"; + } + return JSON.stringify(value2); + } + exports28.printValue = printValue; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/refs.js +var require_refs = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/refs.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getClosestJsonPath = exports28.safePointerToPath = exports28.getEndRef = exports28.traverseObjUntilRef = exports28.isAbsoluteRef = exports28.startsWithProtocol = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var PROTOCOL_REGEX = /^[a-z]+:\/\//i; + var startsWithProtocol = (input) => PROTOCOL_REGEX.test(input); + exports28.startsWithProtocol = startsWithProtocol; + var isAbsoluteRef = (ref) => (0, path_1.isAbsolute)(ref) || (0, exports28.startsWithProtocol)(ref); + exports28.isAbsoluteRef = isAbsoluteRef; + var traverseObjUntilRef = (obj, path2) => { + let piece = obj; + for (const segment of path2.slice()) { + if (!(0, lodash_1.isObject)(piece)) { + throw new TypeError("Segment is not a part of the object"); + } + if (segment in piece) { + piece = piece[segment]; + } else if ((0, json_1.hasRef)(piece)) { + return piece.$ref; + } else { + throw new Error("Segment is not a part of the object"); + } + path2.shift(); + } + if ((0, json_1.isPlainObject)(piece) && (0, json_1.hasRef)(piece) && Object.keys(piece).length === 1) { + return piece.$ref; + } + return null; + }; + exports28.traverseObjUntilRef = traverseObjUntilRef; + var getEndRef = (refMap, $ref) => { + while ($ref in refMap) { + $ref = refMap[$ref]; + } + return $ref; + }; + exports28.getEndRef = getEndRef; + var safePointerToPath = (pointer) => { + const rawPointer = (0, json_1.extractPointerFromRef)(pointer); + return rawPointer !== null ? (0, json_1.pointerToPath)(rawPointer) : []; + }; + exports28.safePointerToPath = safePointerToPath; + var getClosestJsonPath = (data, path2) => { + const closestPath = []; + if (!(0, lodash_1.isObject)(data)) + return closestPath; + let piece = data; + for (const segment of path2) { + if (!(0, lodash_1.isObject)(piece) || !(segment in piece)) + break; + closestPath.push(segment); + piece = piece[segment]; + } + return closestPath; + }; + exports28.getClosestJsonPath = getClosestJsonPath; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/utils/index.js +var require_utils6 = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/utils/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es67(), __toCommonJS(tslib_es6_exports7)); + (0, tslib_1.__exportStar)(require_decodeSegmentFragment(), exports28); + (0, tslib_1.__exportStar)(require_printError(), exports28); + (0, tslib_1.__exportStar)(require_printPath(), exports28); + (0, tslib_1.__exportStar)(require_printValue(), exports28); + (0, tslib_1.__exportStar)(require_refs(), exports28); + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/fetch.js +var require_fetch = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/fetch.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.DEFAULT_REQUEST_OPTIONS = void 0; + var tslib_1 = (init_tslib_es67(), __toCommonJS(tslib_es6_exports7)); + var node_fetch_1 = (0, tslib_1.__importDefault)(require_browser()); + exports28.DEFAULT_REQUEST_OPTIONS = {}; + exports28.default = async (uri, opts = {}) => { + return (0, node_fetch_1.default)(uri, { ...opts, ...exports28.DEFAULT_REQUEST_OPTIONS }); + }; + } +}); + +// node_modules/abort-controller/browser.js +var require_browser2 = __commonJS({ + "node_modules/abort-controller/browser.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { AbortController: AbortController2, AbortSignal } = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : ( + /* otherwise */ + void 0 + ); + module5.exports = AbortController2; + module5.exports.AbortSignal = AbortSignal; + module5.exports.default = AbortController2; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/reader.js +var require_reader = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/reader.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.readParsable = exports28.readFile = void 0; + var tslib_1 = (init_tslib_es67(), __toCommonJS(tslib_es6_exports7)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var abort_controller_1 = (0, tslib_1.__importDefault)(require_browser2()); + var fs = (0, tslib_1.__importStar)((init_fs(), __toCommonJS(fs_exports))); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var fetch_1 = (0, tslib_1.__importDefault)(require_fetch()); + var printError_1 = require_printError(); + async function readFile2(name2, opts) { + if ((0, path_1.isURL)(name2)) { + let response; + let timeout = null; + try { + const requestOpts = {}; + requestOpts.agent = opts.agent; + if (opts.timeout !== void 0) { + const controller = new abort_controller_1.default(); + timeout = setTimeout(() => { + controller.abort(); + }, opts.timeout); + requestOpts.signal = controller.signal; + } + response = await (0, fetch_1.default)(name2, requestOpts); + if (!response.ok) + throw new Error(response.statusText); + return await response.text(); + } catch (ex) { + if ((0, lodash_1.isError)(ex) && ex.name === "AbortError") { + throw new Error("Timeout"); + } else { + throw ex; + } + } finally { + if (timeout !== null) { + clearTimeout(timeout); + } + } + } else { + try { + return await new Promise((resolve3, reject2) => { + fs.readFile(name2, opts.encoding, (err, data) => { + if (err !== null) { + reject2(err); + } else { + resolve3(data); + } + }); + }); + } catch (ex) { + throw new Error(`Could not read ${name2}: ${(0, printError_1.printError)(ex)}`); + } + } + } + exports28.readFile = readFile2; + async function readParsable(name2, opts) { + try { + return await readFile2(name2, opts); + } catch (ex) { + throw new Error(`Could not parse ${name2}: ${(0, printError_1.printError)(ex)}`); + } + } + exports28.readParsable = readParsable; + } +}); + +// node_modules/@stoplight/spectral-runtime/dist/index.js +var require_dist6 = __commonJS({ + "node_modules/@stoplight/spectral-runtime/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.DEFAULT_REQUEST_OPTIONS = exports28.fetch = void 0; + var tslib_1 = (init_tslib_es67(), __toCommonJS(tslib_es6_exports7)); + (0, tslib_1.__exportStar)(require_utils6(), exports28); + var fetch_1 = require_fetch(); + Object.defineProperty(exports28, "fetch", { enumerable: true, get: function() { + return (0, tslib_1.__importDefault)(fetch_1).default; + } }); + Object.defineProperty(exports28, "DEFAULT_REQUEST_OPTIONS", { enumerable: true, get: function() { + return fetch_1.DEFAULT_REQUEST_OPTIONS; + } }); + (0, tslib_1.__exportStar)(require_reader(), exports28); + } +}); + +// node_modules/@stoplight/spectral-ref-resolver/dist/types.js +var require_types4 = __commonJS({ + "node_modules/@stoplight/spectral-ref-resolver/dist/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + } +}); + +// node_modules/@stoplight/spectral-ref-resolver/dist/index.js +var require_dist7 = __commonJS({ + "node_modules/@stoplight/spectral-ref-resolver/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createHttpAndFileResolver = exports28.ResolverDepGraph = exports28.Resolver = exports28.httpAndFileResolver = void 0; + var tslib_1 = (init_tslib_es64(), __toCommonJS(tslib_es6_exports4)); + var json_ref_readers_1 = require_json_ref_readers(); + var json_ref_resolver_1 = require_json_ref_resolver(); + Object.defineProperty(exports28, "Resolver", { enumerable: true, get: function() { + return json_ref_resolver_1.Resolver; + } }); + var spectral_runtime_1 = require_dist6(); + var dependency_graph_1 = require_dep_graph(); + (0, tslib_1.__exportStar)(require_types4(), exports28); + exports28.httpAndFileResolver = createHttpAndFileResolver(); + exports28.ResolverDepGraph = dependency_graph_1.DepGraph; + function createHttpAndFileResolver(opts) { + const resolveHttp4 = (0, json_ref_readers_1.createResolveHttp)({ ...spectral_runtime_1.DEFAULT_REQUEST_OPTIONS, ...opts }); + return new json_ref_resolver_1.Resolver({ + resolvers: { + https: { resolve: resolveHttp4 }, + http: { resolve: resolveHttp4 }, + file: { resolve: json_ref_readers_1.resolveFile } + } + }); + } + exports28.createHttpAndFileResolver = createHttpAndFileResolver; + } +}); + +// node_modules/@stoplight/spectral-core/dist/errorMessages.js +var require_errorMessages = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/errorMessages.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.formatResolverErrors = exports28.formatParserDiagnostics = exports28.prettyPrintResolverErrorMessage = exports28.getDiagnosticErrorMessage = void 0; + var types_1 = require_dist2(); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var document_1 = require_document(); + var toUpperCase = (word) => word.toUpperCase(); + var splitWord = (word, end, start) => `${end} ${start.toLowerCase()}`; + function getDiagnosticErrorMessage(diagnostic) { + const key = getPropertyKey(diagnostic.path); + let prettifiedMessage = diagnostic.message.replace(/^[a-z]/, toUpperCase); + if (diagnostic.code !== "YAMLException") { + prettifiedMessage = prettifiedMessage.replace(/([a-z])([A-Z])/g, splitWord); + } + if (key !== void 0) { + prettifiedMessage = prettifiedMessage.replace(/(Duplicate key)/, `$1: ${key}`); + } + return prettifiedMessage; + } + exports28.getDiagnosticErrorMessage = getDiagnosticErrorMessage; + var prettyPrintResolverErrorMessage = (message) => message.replace(/^Error\s*:\s*/, ""); + exports28.prettyPrintResolverErrorMessage = prettyPrintResolverErrorMessage; + var getPropertyKey = (path2) => { + if (path2 !== void 0 && path2.length > 0) { + return path2[path2.length - 1]; + } + }; + function formatParserDiagnostics(diagnostics, source) { + return diagnostics.map((diagnostic) => { + var _a2; + return { + ...diagnostic, + code: "parser", + message: getDiagnosticErrorMessage(diagnostic), + path: (_a2 = diagnostic.path) !== null && _a2 !== void 0 ? _a2 : [], + ...source !== null ? { source } : null + }; + }); + } + exports28.formatParserDiagnostics = formatParserDiagnostics; + var formatResolverErrors = (document2, diagnostics) => { + return (0, lodash_1.uniqBy)(diagnostics, "message").map((error2) => { + var _a2; + const path2 = [...error2.path, "$ref"]; + const range2 = (_a2 = document2.getRangeForJsonPath(path2, true)) !== null && _a2 !== void 0 ? _a2 : document_1.Document.DEFAULT_RANGE; + const source = error2.uriStack.length > 0 ? error2.uriStack[error2.uriStack.length - 1] : document2.source; + return { + code: "invalid-ref", + path: path2, + message: (0, exports28.prettyPrintResolverErrorMessage)(error2.message), + severity: types_1.DiagnosticSeverity.Error, + range: range2, + ...source !== null ? { source } : null + }; + }); + }; + exports28.formatResolverErrors = formatResolverErrors; + } +}); + +// node_modules/@stoplight/spectral-core/dist/document.js +var require_document = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/document.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.isParsedResult = exports28.ParsedDocument = exports28.Document = exports28.normalizeSource = void 0; + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var errorMessages_1 = require_errorMessages(); + var spectral_runtime_1 = require_dist6(); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + function normalizeSource(source) { + if (source === void 0) + return null; + return source.length > 0 && !(0, spectral_runtime_1.startsWithProtocol)(source) ? (0, path_1.normalize)(source) : source; + } + exports28.normalizeSource = normalizeSource; + var Document8 = class { + constructor(input, parser3, source) { + this.input = input; + this.parser = parser3; + this.parserResult = parser3.parse(input); + this.source = normalizeSource(source); + this.diagnostics = (0, errorMessages_1.formatParserDiagnostics)(this.parserResult.diagnostics, this.source); + } + getRangeForJsonPath(path2, closest) { + var _a2; + return (_a2 = this.parser.getLocationForJsonPath(this.parserResult, path2, closest)) === null || _a2 === void 0 ? void 0 : _a2.range; + } + trapAccess(obj) { + return this.parser.trapAccess(obj); + } + static get DEFAULT_RANGE() { + return { + start: { + character: 0, + line: 0 + }, + end: { + character: 0, + line: 0 + } + }; + } + get data() { + return this.parserResult.data; + } + }; + exports28.Document = Document8; + var ParsedDocument = class { + constructor(parserResult) { + this.parserResult = parserResult; + this.source = normalizeSource(parserResult.source); + this.diagnostics = (0, errorMessages_1.formatParserDiagnostics)(this.parserResult.parsed.diagnostics, this.source); + } + trapAccess(obj) { + return obj; + } + getRangeForJsonPath(path2, closest) { + var _a2; + return (_a2 = this.parserResult.getLocationForJsonPath(this.parserResult.parsed, path2, closest)) === null || _a2 === void 0 ? void 0 : _a2.range; + } + get data() { + return this.parserResult.parsed.data; + } + }; + exports28.ParsedDocument = ParsedDocument; + var isParsedResult = (obj) => (0, json_1.isPlainObject)(obj) && (0, json_1.isPlainObject)(obj.parsed) && typeof obj.getLocationForJsonPath === "function"; + exports28.isParsedResult = isParsedResult; + } +}); + +// node_modules/@stoplight/spectral-core/dist/documentInventory.js +var require_documentInventory = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/documentInventory.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.DocumentInventory = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var document_1 = require_document(); + var errorMessages_1 = require_errorMessages(); + var Parsers = (0, tslib_1.__importStar)(require_dist4()); + var spectral_runtime_1 = require_dist6(); + var DocumentInventory = class _DocumentInventory { + constructor(document2, resolver) { + this.document = document2; + this.resolver = resolver; + this.diagnostics = []; + this.parseResolveResult = (resolveOpts) => { + const source = resolveOpts.targetAuthority.href().replace(/\/$/, ""); + const ext = (0, path_1.extname)(source); + const content = String(resolveOpts.result); + const parser3 = ext === ".json" ? Parsers.Json : Parsers.Yaml; + const document3 = new document_1.Document(content, parser3, source); + resolveOpts.result = document3.data; + if (document3.diagnostics.length > 0) { + this.diagnostics.push(...(0, errorMessages_1.formatParserDiagnostics)(document3.diagnostics, document3.source)); + } + this.referencedDocuments[source] = document3; + return Promise.resolve(resolveOpts); + }; + this.graph = null; + this.errors = null; + const cacheKey = resolver.uriCache; + const cachedDocuments = _DocumentInventory._cachedRemoteDocuments.get(cacheKey); + if (cachedDocuments !== void 0) { + this.referencedDocuments = cachedDocuments; + } else { + this.referencedDocuments = {}; + _DocumentInventory._cachedRemoteDocuments.set(cacheKey, this.referencedDocuments); + } + } + get source() { + return this.document.source; + } + get unresolved() { + return this.document.data; + } + get formats() { + var _a2; + return (_a2 = this.document.formats) !== null && _a2 !== void 0 ? _a2 : null; + } + async resolve() { + if (!(0, lodash_1.isObjectLike)(this.document.data)) { + this.graph = null; + this.resolved = this.document.data; + this.errors = null; + return; + } + const resolveResult = await this.resolver.resolve(this.document.data, { + ...this.document.source !== null ? { baseUri: this.document.source } : null, + parseResolveResult: this.parseResolveResult + }); + this.graph = resolveResult.graph; + this.resolved = resolveResult.result; + this.errors = (0, errorMessages_1.formatResolverErrors)(this.document, resolveResult.errors); + } + findAssociatedItemForPath(path2, resolved) { + if (!resolved) { + const newPath = (0, spectral_runtime_1.getClosestJsonPath)(this.unresolved, path2); + const item = { + document: this.document, + path: newPath, + missingPropertyPath: path2 + }; + return item; + } + try { + const newPath = (0, spectral_runtime_1.getClosestJsonPath)(this.resolved, path2); + const $ref = (0, spectral_runtime_1.traverseObjUntilRef)(this.unresolved, newPath); + if ($ref === null) { + const item2 = { + document: this.document, + path: (0, spectral_runtime_1.getClosestJsonPath)(this.unresolved, path2), + missingPropertyPath: path2 + }; + return item2; + } + const missingPropertyPath = newPath.length === 0 ? [] : path2.slice(path2.lastIndexOf(newPath[newPath.length - 1]) + 1); + let { source } = this; + if (source === null || this.graph === null) { + return null; + } + let refMap = this.graph.getNodeData(source).refMap; + let resolvedDoc = this.document; + const adjustedPath = ["#", ...path2.map(json_1.encodePointerUriFragment).map(String)]; + let refMapKey = ""; + for (const segment of adjustedPath) { + if (refMapKey.length > 0) { + refMapKey += "/"; + } + refMapKey += segment; + while (refMapKey in refMap) { + const newRef = refMap[refMapKey]; + if ((0, json_1.isLocalRef)(newRef)) { + refMapKey = newRef; + } else { + const extractedSource = (0, json_1.extractSourceFromRef)(newRef); + if (extractedSource === null) { + const item2 = { + document: resolvedDoc, + path: (0, spectral_runtime_1.getClosestJsonPath)(resolvedDoc.data, path2), + missingPropertyPath: path2 + }; + return item2; + } + source = (0, spectral_runtime_1.isAbsoluteRef)(extractedSource) ? extractedSource : (0, path_1.resolve)(source, "..", extractedSource); + const newResolvedDoc = source === this.document.source ? this.document : this.referencedDocuments[source]; + if (newResolvedDoc === null || newResolvedDoc === void 0) { + const item2 = { + document: resolvedDoc, + path: (0, spectral_runtime_1.getClosestJsonPath)(resolvedDoc.data, path2), + missingPropertyPath: path2 + }; + return item2; + } + resolvedDoc = newResolvedDoc; + refMap = this.graph.getNodeData(source).refMap; + refMapKey = newRef.indexOf("#") >= 0 ? newRef.slice(newRef.indexOf("#")) : "#"; + } + } + } + const closestPath = (0, spectral_runtime_1.getClosestJsonPath)(resolvedDoc.data, this.convertRefMapKeyToPath(refMapKey)); + const item = { + document: resolvedDoc, + path: closestPath, + missingPropertyPath: [...closestPath, ...missingPropertyPath] + }; + return item; + } catch { + return null; + } + } + convertRefMapKeyToPath(refPath) { + if (refPath.startsWith("#/")) { + refPath = refPath.slice(2); + } + return refPath.split("/").map(json_1.decodePointerFragment); + } + }; + exports28.DocumentInventory = DocumentInventory; + DocumentInventory._cachedRemoteDocuments = /* @__PURE__ */ new WeakMap(); + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/utils/results.js +var require_results = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/utils/results.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.sortResults = exports28.compareResults = exports28.comparePosition = exports28.prepareResults = void 0; + var computeResultFingerprint = (rule) => { + let id = String(rule.code); + if (rule.path.length > 0) { + id += JSON.stringify(rule.path); + } else { + id += JSON.stringify(rule.range); + } + if (rule.source !== void 0) { + id += rule.source; + } + if (rule.message !== void 0) { + id += rule.message; + } + return id; + }; + var prepareResults4 = (results) => { + return (0, exports28.sortResults)(deduplicateResults(results)); + }; + exports28.prepareResults = prepareResults4; + var deduplicateResults = (results) => { + const fingerprints = /* @__PURE__ */ new Set(); + return results.filter((result2) => { + const fingerprint = computeResultFingerprint(result2); + if (fingerprints.has(fingerprint)) { + return false; + } + fingerprints.add(fingerprint); + return true; + }); + }; + var compareCode = (left, right) => { + if (left === void 0 && right === void 0) { + return 0; + } + if (left === void 0) { + return -1; + } + if (right === void 0) { + return 1; + } + return String(left).localeCompare(String(right), void 0, { numeric: true }); + }; + var compareSource = (left, right) => { + if (left === void 0 && right === void 0) { + return 0; + } + if (left === void 0) { + return -1; + } + if (right === void 0) { + return 1; + } + return left.localeCompare(right); + }; + var normalize2 = (value2) => { + if (value2 < 0) { + return -1; + } + if (value2 > 0) { + return 1; + } + return 0; + }; + var comparePosition = (left, right) => { + const diffLine = left.line - right.line; + if (diffLine !== 0) { + return normalize2(diffLine); + } + const diffChar = left.character - right.character; + return normalize2(diffChar); + }; + exports28.comparePosition = comparePosition; + var compareResults = (left, right) => { + const diffSource = compareSource(left.source, right.source); + if (diffSource !== 0) { + return normalize2(diffSource); + } + const diffStart = (0, exports28.comparePosition)(left.range.start, right.range.start); + if (diffStart !== 0) { + return diffStart; + } + const diffCode = compareCode(left.code, right.code); + if (diffCode !== 0) { + return normalize2(diffCode); + } + const diffPath = left.path.join().localeCompare(right.path.join()); + return normalize2(diffPath); + }; + exports28.compareResults = compareResults; + var sortResults = (results) => { + return [...results].sort(exports28.compareResults); + }; + exports28.sortResults = sortResults; + } +}); + +// node_modules/pony-cause/index.js +var require_pony_cause = __commonJS({ + "node_modules/pony-cause/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ErrorWithCause = class _ErrorWithCause extends Error { + /** + * @param {string} message + * @param {{ cause?: T }} [options] + */ + constructor(message, { cause } = {}) { + super(message); + this.name = _ErrorWithCause.name; + if (cause) { + this.cause = cause; + } + this.message = message; + } + }; + var findCauseByReference = (err, reference) => { + if (!err || !reference) + return; + if (!(err instanceof Error)) + return; + if (!(reference.prototype instanceof Error) && // @ts-ignore + reference !== Error) + return; + const seen = /* @__PURE__ */ new Set(); + let currentErr = err; + while (currentErr && !seen.has(currentErr)) { + seen.add(currentErr); + if (currentErr instanceof reference) { + return currentErr; + } + currentErr = getErrorCause(currentErr); + } + }; + var getErrorCause = (err) => { + if (!err) + return; + const cause = err.cause; + if (typeof cause === "function") { + const causeResult = err.cause(); + return causeResult instanceof Error ? causeResult : void 0; + } else { + return cause instanceof Error ? cause : void 0; + } + }; + var _stackWithCauses = (err, seen) => { + if (!(err instanceof Error)) + return ""; + const stack = err.stack || ""; + if (seen.has(err)) { + return stack + "\ncauses have become circular..."; + } + const cause = getErrorCause(err); + if (cause) { + seen.add(err); + return stack + "\ncaused by: " + _stackWithCauses(cause, seen); + } else { + return stack; + } + }; + var stackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set()); + var _messageWithCauses = (err, seen, skip) => { + if (!(err instanceof Error)) + return ""; + const message = skip ? "" : err.message || ""; + if (seen.has(err)) { + return message + ": ..."; + } + const cause = getErrorCause(err); + if (cause) { + seen.add(err); + const skipIfVErrorStyleCause = typeof err.cause === "function"; + return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause); + } else { + return message; + } + }; + var messageWithCauses = (err) => _messageWithCauses(err, /* @__PURE__ */ new Set()); + module5.exports = { + ErrorWithCause, + findCauseByReference, + getErrorCause, + stackWithCauses, + messageWithCauses + }; + } +}); + +// node_modules/jsonpath-plus/dist/index-browser-esm.js +var index_browser_esm_exports = {}; +__export(index_browser_esm_exports, { + JSONPath: () => JSONPath +}); +function push(arr, item) { + arr = arr.slice(); + arr.push(item); + return arr; +} +function unshift(item, arr) { + arr = arr.slice(); + arr.unshift(item); + return arr; +} +function JSONPath(opts, expr, obj, callback, otherTypeCallback) { + if (!(this instanceof JSONPath)) { + try { + return new JSONPath(opts, expr, obj, callback, otherTypeCallback); + } catch (e10) { + if (!e10.avoidNew) { + throw e10; + } + return e10.value; + } + } + if (typeof opts === "string") { + otherTypeCallback = callback; + callback = obj; + obj = expr; + expr = opts; + opts = null; + } + const optObj = opts && typeof opts === "object"; + opts = opts || {}; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || "value"; + this.flatten = opts.flatten || false; + this.wrap = Object.hasOwn(opts, "wrap") ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.eval = opts.eval === void 0 ? "safe" : opts.eval; + this.ignoreEvalErrors = typeof opts.ignoreEvalErrors === "undefined" ? false : opts.ignoreEvalErrors; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || callback || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }; + if (opts.autostart !== false) { + const args = { + path: optObj ? opts.path : expr + }; + if (!optObj) { + args.json = obj; + } else if ("json" in opts) { + args.json = opts.json; + } + const ret = this.evaluate(args); + if (!ret || typeof ret !== "object") { + throw new NewError(ret); + } + return ret; + } +} +var Hooks, Plugins, Jsep, hooks, jsep, stdClassProps, CONDITIONAL_EXP, ternary, FSLASH_CODE, BSLASH_CODE, index, PLUS_CODE, MINUS_CODE, plugin, BLOCKED_PROTO_PROPERTIES, SafeEval, SafeScript, NewError, moveToAnotherArray, Script2; +var init_index_browser_esm = __esm({ + "node_modules/jsonpath-plus/dist/index-browser-esm.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + Hooks = class { + /** + * @callback HookCallback + * @this {*|Jsep} this + * @param {Jsep} env + * @returns: void + */ + /** + * Adds the given callback to the list of callbacks for the given hook. + * + * The callback will be invoked when the hook it is registered for is run. + * + * One callback function can be registered to multiple hooks and the same hook multiple times. + * + * @param {string|object} name The name of the hook, or an object of callbacks keyed by name + * @param {HookCallback|boolean} callback The callback function which is given environment variables. + * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom) + * @public + */ + add(name2, callback, first) { + if (typeof arguments[0] != "string") { + for (let name3 in arguments[0]) { + this.add(name3, arguments[0][name3], arguments[1]); + } + } else { + (Array.isArray(name2) ? name2 : [name2]).forEach(function(name3) { + this[name3] = this[name3] || []; + if (callback) { + this[name3][first ? "unshift" : "push"](callback); + } + }, this); + } + } + /** + * Runs a hook invoking all registered callbacks with the given environment variables. + * + * Callbacks will be invoked synchronously and in the order in which they were registered. + * + * @param {string} name The name of the hook. + * @param {Object} env The environment variables of the hook passed to all callbacks registered. + * @public + */ + run(name2, env3) { + this[name2] = this[name2] || []; + this[name2].forEach(function(callback) { + callback.call(env3 && env3.context ? env3.context : env3, env3); + }); + } + }; + Plugins = class { + constructor(jsep2) { + this.jsep = jsep2; + this.registered = {}; + } + /** + * @callback PluginSetup + * @this {Jsep} jsep + * @returns: void + */ + /** + * Adds the given plugin(s) to the registry + * + * @param {object} plugins + * @param {string} plugins.name The name of the plugin + * @param {PluginSetup} plugins.init The init function + * @public + */ + register() { + for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) { + plugins[_key] = arguments[_key]; + } + plugins.forEach((plugin2) => { + if (typeof plugin2 !== "object" || !plugin2.name || !plugin2.init) { + throw new Error("Invalid JSEP plugin format"); + } + if (this.registered[plugin2.name]) { + return; + } + plugin2.init(this.jsep); + this.registered[plugin2.name] = plugin2; + }); + } + }; + Jsep = class _Jsep { + /** + * @returns {string} + */ + static get version() { + return "1.4.0"; + } + /** + * @returns {string} + */ + static toString() { + return "JavaScript Expression Parser (JSEP) v" + _Jsep.version; + } + // ==================== CONFIG ================================ + /** + * @method addUnaryOp + * @param {string} op_name The name of the unary op to add + * @returns {Jsep} + */ + static addUnaryOp(op_name) { + _Jsep.max_unop_len = Math.max(op_name.length, _Jsep.max_unop_len); + _Jsep.unary_ops[op_name] = 1; + return _Jsep; + } + /** + * @method jsep.addBinaryOp + * @param {string} op_name The name of the binary op to add + * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence + * @param {boolean} [isRightAssociative=false] whether operator is right-associative + * @returns {Jsep} + */ + static addBinaryOp(op_name, precedence, isRightAssociative) { + _Jsep.max_binop_len = Math.max(op_name.length, _Jsep.max_binop_len); + _Jsep.binary_ops[op_name] = precedence; + if (isRightAssociative) { + _Jsep.right_associative.add(op_name); + } else { + _Jsep.right_associative.delete(op_name); + } + return _Jsep; + } + /** + * @method addIdentifierChar + * @param {string} char The additional character to treat as a valid part of an identifier + * @returns {Jsep} + */ + static addIdentifierChar(char) { + _Jsep.additional_identifier_chars.add(char); + return _Jsep; + } + /** + * @method addLiteral + * @param {string} literal_name The name of the literal to add + * @param {*} literal_value The value of the literal + * @returns {Jsep} + */ + static addLiteral(literal_name, literal_value) { + _Jsep.literals[literal_name] = literal_value; + return _Jsep; + } + /** + * @method removeUnaryOp + * @param {string} op_name The name of the unary op to remove + * @returns {Jsep} + */ + static removeUnaryOp(op_name) { + delete _Jsep.unary_ops[op_name]; + if (op_name.length === _Jsep.max_unop_len) { + _Jsep.max_unop_len = _Jsep.getMaxKeyLen(_Jsep.unary_ops); + } + return _Jsep; + } + /** + * @method removeAllUnaryOps + * @returns {Jsep} + */ + static removeAllUnaryOps() { + _Jsep.unary_ops = {}; + _Jsep.max_unop_len = 0; + return _Jsep; + } + /** + * @method removeIdentifierChar + * @param {string} char The additional character to stop treating as a valid part of an identifier + * @returns {Jsep} + */ + static removeIdentifierChar(char) { + _Jsep.additional_identifier_chars.delete(char); + return _Jsep; + } + /** + * @method removeBinaryOp + * @param {string} op_name The name of the binary op to remove + * @returns {Jsep} + */ + static removeBinaryOp(op_name) { + delete _Jsep.binary_ops[op_name]; + if (op_name.length === _Jsep.max_binop_len) { + _Jsep.max_binop_len = _Jsep.getMaxKeyLen(_Jsep.binary_ops); + } + _Jsep.right_associative.delete(op_name); + return _Jsep; + } + /** + * @method removeAllBinaryOps + * @returns {Jsep} + */ + static removeAllBinaryOps() { + _Jsep.binary_ops = {}; + _Jsep.max_binop_len = 0; + return _Jsep; + } + /** + * @method removeLiteral + * @param {string} literal_name The name of the literal to remove + * @returns {Jsep} + */ + static removeLiteral(literal_name) { + delete _Jsep.literals[literal_name]; + return _Jsep; + } + /** + * @method removeAllLiterals + * @returns {Jsep} + */ + static removeAllLiterals() { + _Jsep.literals = {}; + return _Jsep; + } + // ==================== END CONFIG ============================ + /** + * @returns {string} + */ + get char() { + return this.expr.charAt(this.index); + } + /** + * @returns {number} + */ + get code() { + return this.expr.charCodeAt(this.index); + } + /** + * @param {string} expr a string with the passed in express + * @returns Jsep + */ + constructor(expr) { + this.expr = expr; + this.index = 0; + } + /** + * static top-level parser + * @returns {jsep.Expression} + */ + static parse(expr) { + return new _Jsep(expr).parse(); + } + /** + * Get the longest key length of any object + * @param {object} obj + * @returns {number} + */ + static getMaxKeyLen(obj) { + return Math.max(0, ...Object.keys(obj).map((k6) => k6.length)); + } + /** + * `ch` is a character code in the next three functions + * @param {number} ch + * @returns {boolean} + */ + static isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; + } + /** + * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float. + * @param {string} op_val + * @returns {number} + */ + static binaryPrecedence(op_val) { + return _Jsep.binary_ops[op_val] || 0; + } + /** + * Looks for start of identifier + * @param {number} ch + * @returns {boolean} + */ + static isIdentifierStart(ch) { + return ch >= 65 && ch <= 90 || // A...Z + ch >= 97 && ch <= 122 || // a...z + ch >= 128 && !_Jsep.binary_ops[String.fromCharCode(ch)] || // any non-ASCII that is not an operator + _Jsep.additional_identifier_chars.has(String.fromCharCode(ch)); + } + /** + * @param {number} ch + * @returns {boolean} + */ + static isIdentifierPart(ch) { + return _Jsep.isIdentifierStart(ch) || _Jsep.isDecimalDigit(ch); + } + /** + * throw error at index of the expression + * @param {string} message + * @throws + */ + throwError(message) { + const error2 = new Error(message + " at character " + this.index); + error2.index = this.index; + error2.description = message; + throw error2; + } + /** + * Run a given hook + * @param {string} name + * @param {jsep.Expression|false} [node] + * @returns {?jsep.Expression} + */ + runHook(name2, node) { + if (_Jsep.hooks[name2]) { + const env3 = { + context: this, + node + }; + _Jsep.hooks.run(name2, env3); + return env3.node; + } + return node; + } + /** + * Runs a given hook until one returns a node + * @param {string} name + * @returns {?jsep.Expression} + */ + searchHook(name2) { + if (_Jsep.hooks[name2]) { + const env3 = { + context: this + }; + _Jsep.hooks[name2].find(function(callback) { + callback.call(env3.context, env3); + return env3.node; + }); + return env3.node; + } + } + /** + * Push `index` up to the next non-space character + */ + gobbleSpaces() { + let ch = this.code; + while (ch === _Jsep.SPACE_CODE || ch === _Jsep.TAB_CODE || ch === _Jsep.LF_CODE || ch === _Jsep.CR_CODE) { + ch = this.expr.charCodeAt(++this.index); + } + this.runHook("gobble-spaces"); + } + /** + * Top-level method to parse all expressions and returns compound or single node + * @returns {jsep.Expression} + */ + parse() { + this.runHook("before-all"); + const nodes = this.gobbleExpressions(); + const node = nodes.length === 1 ? nodes[0] : { + type: _Jsep.COMPOUND, + body: nodes + }; + return this.runHook("after-all", node); + } + /** + * top-level parser (but can be reused within as well) + * @param {number} [untilICode] + * @returns {jsep.Expression[]} + */ + gobbleExpressions(untilICode) { + let nodes = [], ch_i, node; + while (this.index < this.expr.length) { + ch_i = this.code; + if (ch_i === _Jsep.SEMCOL_CODE || ch_i === _Jsep.COMMA_CODE) { + this.index++; + } else { + if (node = this.gobbleExpression()) { + nodes.push(node); + } else if (this.index < this.expr.length) { + if (ch_i === untilICode) { + break; + } + this.throwError('Unexpected "' + this.char + '"'); + } + } + } + return nodes; + } + /** + * The main parsing function. + * @returns {?jsep.Expression} + */ + gobbleExpression() { + const node = this.searchHook("gobble-expression") || this.gobbleBinaryExpression(); + this.gobbleSpaces(); + return this.runHook("after-expression", node); + } + /** + * Search for the operation portion of the string (e.g. `+`, `===`) + * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`) + * and move down from 3 to 2 to 1 character until a matching binary operation is found + * then, return that binary operation + * @returns {string|boolean} + */ + gobbleBinaryOp() { + this.gobbleSpaces(); + let to_check = this.expr.substr(this.index, _Jsep.max_binop_len); + let tc_len = to_check.length; + while (tc_len > 0) { + if (_Jsep.binary_ops.hasOwnProperty(to_check) && (!_Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !_Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { + this.index += tc_len; + return to_check; + } + to_check = to_check.substr(0, --tc_len); + } + return false; + } + /** + * This function is responsible for gobbling an individual expression, + * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)` + * @returns {?jsep.BinaryExpression} + */ + gobbleBinaryExpression() { + let node, biop, prec, stack, biop_info, left, right, i7, cur_biop; + left = this.gobbleToken(); + if (!left) { + return left; + } + biop = this.gobbleBinaryOp(); + if (!biop) { + return left; + } + biop_info = { + value: biop, + prec: _Jsep.binaryPrecedence(biop), + right_a: _Jsep.right_associative.has(biop) + }; + right = this.gobbleToken(); + if (!right) { + this.throwError("Expected expression after " + biop); + } + stack = [left, biop_info, right]; + while (biop = this.gobbleBinaryOp()) { + prec = _Jsep.binaryPrecedence(biop); + if (prec === 0) { + this.index -= biop.length; + break; + } + biop_info = { + value: biop, + prec, + right_a: _Jsep.right_associative.has(biop) + }; + cur_biop = biop; + const comparePrev = (prev) => biop_info.right_a && prev.right_a ? prec > prev.prec : prec <= prev.prec; + while (stack.length > 2 && comparePrev(stack[stack.length - 2])) { + right = stack.pop(); + biop = stack.pop().value; + left = stack.pop(); + node = { + type: _Jsep.BINARY_EXP, + operator: biop, + left, + right + }; + stack.push(node); + } + node = this.gobbleToken(); + if (!node) { + this.throwError("Expected expression after " + cur_biop); + } + stack.push(biop_info, node); + } + i7 = stack.length - 1; + node = stack[i7]; + while (i7 > 1) { + node = { + type: _Jsep.BINARY_EXP, + operator: stack[i7 - 1].value, + left: stack[i7 - 2], + right: node + }; + i7 -= 2; + } + return node; + } + /** + * An individual part of a binary expression: + * e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis) + * @returns {boolean|jsep.Expression} + */ + gobbleToken() { + let ch, to_check, tc_len, node; + this.gobbleSpaces(); + node = this.searchHook("gobble-token"); + if (node) { + return this.runHook("after-token", node); + } + ch = this.code; + if (_Jsep.isDecimalDigit(ch) || ch === _Jsep.PERIOD_CODE) { + return this.gobbleNumericLiteral(); + } + if (ch === _Jsep.SQUOTE_CODE || ch === _Jsep.DQUOTE_CODE) { + node = this.gobbleStringLiteral(); + } else if (ch === _Jsep.OBRACK_CODE) { + node = this.gobbleArray(); + } else { + to_check = this.expr.substr(this.index, _Jsep.max_unop_len); + tc_len = to_check.length; + while (tc_len > 0) { + if (_Jsep.unary_ops.hasOwnProperty(to_check) && (!_Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !_Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { + this.index += tc_len; + const argument = this.gobbleToken(); + if (!argument) { + this.throwError("missing unaryOp argument"); + } + return this.runHook("after-token", { + type: _Jsep.UNARY_EXP, + operator: to_check, + argument, + prefix: true + }); + } + to_check = to_check.substr(0, --tc_len); + } + if (_Jsep.isIdentifierStart(ch)) { + node = this.gobbleIdentifier(); + if (_Jsep.literals.hasOwnProperty(node.name)) { + node = { + type: _Jsep.LITERAL, + value: _Jsep.literals[node.name], + raw: node.name + }; + } else if (node.name === _Jsep.this_str) { + node = { + type: _Jsep.THIS_EXP + }; + } + } else if (ch === _Jsep.OPAREN_CODE) { + node = this.gobbleGroup(); + } + } + if (!node) { + return this.runHook("after-token", false); + } + node = this.gobbleTokenProperty(node); + return this.runHook("after-token", node); + } + /** + * Gobble properties of of identifiers/strings/arrays/groups. + * e.g. `foo`, `bar.baz`, `foo['bar'].baz` + * It also gobbles function calls: + * e.g. `Math.acos(obj.angle)` + * @param {jsep.Expression} node + * @returns {jsep.Expression} + */ + gobbleTokenProperty(node) { + this.gobbleSpaces(); + let ch = this.code; + while (ch === _Jsep.PERIOD_CODE || ch === _Jsep.OBRACK_CODE || ch === _Jsep.OPAREN_CODE || ch === _Jsep.QUMARK_CODE) { + let optional; + if (ch === _Jsep.QUMARK_CODE) { + if (this.expr.charCodeAt(this.index + 1) !== _Jsep.PERIOD_CODE) { + break; + } + optional = true; + this.index += 2; + this.gobbleSpaces(); + ch = this.code; + } + this.index++; + if (ch === _Jsep.OBRACK_CODE) { + node = { + type: _Jsep.MEMBER_EXP, + computed: true, + object: node, + property: this.gobbleExpression() + }; + if (!node.property) { + this.throwError('Unexpected "' + this.char + '"'); + } + this.gobbleSpaces(); + ch = this.code; + if (ch !== _Jsep.CBRACK_CODE) { + this.throwError("Unclosed ["); + } + this.index++; + } else if (ch === _Jsep.OPAREN_CODE) { + node = { + type: _Jsep.CALL_EXP, + "arguments": this.gobbleArguments(_Jsep.CPAREN_CODE), + callee: node + }; + } else if (ch === _Jsep.PERIOD_CODE || optional) { + if (optional) { + this.index--; + } + this.gobbleSpaces(); + node = { + type: _Jsep.MEMBER_EXP, + computed: false, + object: node, + property: this.gobbleIdentifier() + }; + } + if (optional) { + node.optional = true; + } + this.gobbleSpaces(); + ch = this.code; + } + return node; + } + /** + * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to + * keep track of everything in the numeric literal and then calling `parseFloat` on that string + * @returns {jsep.Literal} + */ + gobbleNumericLiteral() { + let number = "", ch, chCode; + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + if (this.code === _Jsep.PERIOD_CODE) { + number += this.expr.charAt(this.index++); + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + } + ch = this.char; + if (ch === "e" || ch === "E") { + number += this.expr.charAt(this.index++); + ch = this.char; + if (ch === "+" || ch === "-") { + number += this.expr.charAt(this.index++); + } + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + if (!_Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1))) { + this.throwError("Expected exponent (" + number + this.char + ")"); + } + } + chCode = this.code; + if (_Jsep.isIdentifierStart(chCode)) { + this.throwError("Variable names cannot start with a number (" + number + this.char + ")"); + } else if (chCode === _Jsep.PERIOD_CODE || number.length === 1 && number.charCodeAt(0) === _Jsep.PERIOD_CODE) { + this.throwError("Unexpected period"); + } + return { + type: _Jsep.LITERAL, + value: parseFloat(number), + raw: number + }; + } + /** + * Parses a string literal, staring with single or double quotes with basic support for escape codes + * e.g. `"hello world"`, `'this is\nJSEP'` + * @returns {jsep.Literal} + */ + gobbleStringLiteral() { + let str2 = ""; + const startIndex = this.index; + const quote = this.expr.charAt(this.index++); + let closed = false; + while (this.index < this.expr.length) { + let ch = this.expr.charAt(this.index++); + if (ch === quote) { + closed = true; + break; + } else if (ch === "\\") { + ch = this.expr.charAt(this.index++); + switch (ch) { + case "n": + str2 += "\n"; + break; + case "r": + str2 += "\r"; + break; + case "t": + str2 += " "; + break; + case "b": + str2 += "\b"; + break; + case "f": + str2 += "\f"; + break; + case "v": + str2 += "\v"; + break; + default: + str2 += ch; + } + } else { + str2 += ch; + } + } + if (!closed) { + this.throwError('Unclosed quote after "' + str2 + '"'); + } + return { + type: _Jsep.LITERAL, + value: str2, + raw: this.expr.substring(startIndex, this.index) + }; + } + /** + * Gobbles only identifiers + * e.g.: `foo`, `_value`, `$x1` + * Also, this function checks if that identifier is a literal: + * (e.g. `true`, `false`, `null`) or `this` + * @returns {jsep.Identifier} + */ + gobbleIdentifier() { + let ch = this.code, start = this.index; + if (_Jsep.isIdentifierStart(ch)) { + this.index++; + } else { + this.throwError("Unexpected " + this.char); + } + while (this.index < this.expr.length) { + ch = this.code; + if (_Jsep.isIdentifierPart(ch)) { + this.index++; + } else { + break; + } + } + return { + type: _Jsep.IDENTIFIER, + name: this.expr.slice(start, this.index) + }; + } + /** + * Gobbles a list of arguments within the context of a function call + * or array literal. This function also assumes that the opening character + * `(` or `[` has already been gobbled, and gobbles expressions and commas + * until the terminator character `)` or `]` is encountered. + * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]` + * @param {number} termination + * @returns {jsep.Expression[]} + */ + gobbleArguments(termination) { + const args = []; + let closed = false; + let separator_count = 0; + while (this.index < this.expr.length) { + this.gobbleSpaces(); + let ch_i = this.code; + if (ch_i === termination) { + closed = true; + this.index++; + if (termination === _Jsep.CPAREN_CODE && separator_count && separator_count >= args.length) { + this.throwError("Unexpected token " + String.fromCharCode(termination)); + } + break; + } else if (ch_i === _Jsep.COMMA_CODE) { + this.index++; + separator_count++; + if (separator_count !== args.length) { + if (termination === _Jsep.CPAREN_CODE) { + this.throwError("Unexpected token ,"); + } else if (termination === _Jsep.CBRACK_CODE) { + for (let arg = args.length; arg < separator_count; arg++) { + args.push(null); + } + } + } + } else if (args.length !== separator_count && separator_count !== 0) { + this.throwError("Expected comma"); + } else { + const node = this.gobbleExpression(); + if (!node || node.type === _Jsep.COMPOUND) { + this.throwError("Expected comma"); + } + args.push(node); + } + } + if (!closed) { + this.throwError("Expected " + String.fromCharCode(termination)); + } + return args; + } + /** + * Responsible for parsing a group of things within parentheses `()` + * that have no identifier in front (so not a function call) + * This function assumes that it needs to gobble the opening parenthesis + * and then tries to gobble everything within that parenthesis, assuming + * that the next thing it should see is the close parenthesis. If not, + * then the expression probably doesn't have a `)` + * @returns {boolean|jsep.Expression} + */ + gobbleGroup() { + this.index++; + let nodes = this.gobbleExpressions(_Jsep.CPAREN_CODE); + if (this.code === _Jsep.CPAREN_CODE) { + this.index++; + if (nodes.length === 1) { + return nodes[0]; + } else if (!nodes.length) { + return false; + } else { + return { + type: _Jsep.SEQUENCE_EXP, + expressions: nodes + }; + } + } else { + this.throwError("Unclosed ("); + } + } + /** + * Responsible for parsing Array literals `[1, 2, 3]` + * This function assumes that it needs to gobble the opening bracket + * and then tries to gobble the expressions as arguments. + * @returns {jsep.ArrayExpression} + */ + gobbleArray() { + this.index++; + return { + type: _Jsep.ARRAY_EXP, + elements: this.gobbleArguments(_Jsep.CBRACK_CODE) + }; + } + }; + hooks = new Hooks(); + Object.assign(Jsep, { + hooks, + plugins: new Plugins(Jsep), + // Node Types + // ---------- + // This is the full set of types that any JSEP node can be. + // Store them here to save space when minified + COMPOUND: "Compound", + SEQUENCE_EXP: "SequenceExpression", + IDENTIFIER: "Identifier", + MEMBER_EXP: "MemberExpression", + LITERAL: "Literal", + THIS_EXP: "ThisExpression", + CALL_EXP: "CallExpression", + UNARY_EXP: "UnaryExpression", + BINARY_EXP: "BinaryExpression", + ARRAY_EXP: "ArrayExpression", + TAB_CODE: 9, + LF_CODE: 10, + CR_CODE: 13, + SPACE_CODE: 32, + PERIOD_CODE: 46, + // '.' + COMMA_CODE: 44, + // ',' + SQUOTE_CODE: 39, + // single quote + DQUOTE_CODE: 34, + // double quotes + OPAREN_CODE: 40, + // ( + CPAREN_CODE: 41, + // ) + OBRACK_CODE: 91, + // [ + CBRACK_CODE: 93, + // ] + QUMARK_CODE: 63, + // ? + SEMCOL_CODE: 59, + // ; + COLON_CODE: 58, + // : + // Operations + // ---------- + // Use a quickly-accessible map to store all of the unary operators + // Values are set to `1` (it really doesn't matter) + unary_ops: { + "-": 1, + "!": 1, + "~": 1, + "+": 1 + }, + // Also use a map for the binary operations but set their values to their + // binary precedence for quick reference (higher number = higher precedence) + // see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) + binary_ops: { + "||": 1, + "??": 1, + "&&": 2, + "|": 3, + "^": 4, + "&": 5, + "==": 6, + "!=": 6, + "===": 6, + "!==": 6, + "<": 7, + ">": 7, + "<=": 7, + ">=": 7, + "<<": 8, + ">>": 8, + ">>>": 8, + "+": 9, + "-": 9, + "*": 10, + "/": 10, + "%": 10, + "**": 11 + }, + // sets specific binary_ops as right-associative + right_associative: /* @__PURE__ */ new Set(["**"]), + // Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char) + additional_identifier_chars: /* @__PURE__ */ new Set(["$", "_"]), + // Literals + // ---------- + // Store the values to return for the various literals we may encounter + literals: { + "true": true, + "false": false, + "null": null + }, + // Except for `this`, which is special. This could be changed to something like `'self'` as well + this_str: "this" + }); + Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops); + Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops); + jsep = (expr) => new Jsep(expr).parse(); + stdClassProps = Object.getOwnPropertyNames(class Test { + }); + Object.getOwnPropertyNames(Jsep).filter((prop) => !stdClassProps.includes(prop) && jsep[prop] === void 0).forEach((m7) => { + jsep[m7] = Jsep[m7]; + }); + jsep.Jsep = Jsep; + CONDITIONAL_EXP = "ConditionalExpression"; + ternary = { + name: "ternary", + init(jsep2) { + jsep2.hooks.add("after-expression", function gobbleTernary(env3) { + if (env3.node && this.code === jsep2.QUMARK_CODE) { + this.index++; + const test = env3.node; + const consequent = this.gobbleExpression(); + if (!consequent) { + this.throwError("Expected expression"); + } + this.gobbleSpaces(); + if (this.code === jsep2.COLON_CODE) { + this.index++; + const alternate = this.gobbleExpression(); + if (!alternate) { + this.throwError("Expected expression"); + } + env3.node = { + type: CONDITIONAL_EXP, + test, + consequent, + alternate + }; + if (test.operator && jsep2.binary_ops[test.operator] <= 0.9) { + let newTest = test; + while (newTest.right.operator && jsep2.binary_ops[newTest.right.operator] <= 0.9) { + newTest = newTest.right; + } + env3.node.test = newTest.right; + newTest.right = env3.node; + env3.node = test; + } + } else { + this.throwError("Expected :"); + } + } + }); + } + }; + jsep.plugins.register(ternary); + FSLASH_CODE = 47; + BSLASH_CODE = 92; + index = { + name: "regex", + init(jsep2) { + jsep2.hooks.add("gobble-token", function gobbleRegexLiteral(env3) { + if (this.code === FSLASH_CODE) { + const patternIndex = ++this.index; + let inCharSet = false; + while (this.index < this.expr.length) { + if (this.code === FSLASH_CODE && !inCharSet) { + const pattern5 = this.expr.slice(patternIndex, this.index); + let flags = ""; + while (++this.index < this.expr.length) { + const code = this.code; + if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57) { + flags += this.char; + } else { + break; + } + } + let value2; + try { + value2 = new RegExp(pattern5, flags); + } catch (e10) { + this.throwError(e10.message); + } + env3.node = { + type: jsep2.LITERAL, + value: value2, + raw: this.expr.slice(patternIndex - 1, this.index) + }; + env3.node = this.gobbleTokenProperty(env3.node); + return env3.node; + } + if (this.code === jsep2.OBRACK_CODE) { + inCharSet = true; + } else if (inCharSet && this.code === jsep2.CBRACK_CODE) { + inCharSet = false; + } + this.index += this.code === BSLASH_CODE ? 2 : 1; + } + this.throwError("Unclosed Regex"); + } + }); + } + }; + PLUS_CODE = 43; + MINUS_CODE = 45; + plugin = { + name: "assignment", + assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]), + updateOperators: [PLUS_CODE, MINUS_CODE], + assignmentPrecedence: 0.9, + init(jsep2) { + const updateNodeTypes = [jsep2.IDENTIFIER, jsep2.MEMBER_EXP]; + plugin.assignmentOperators.forEach((op) => jsep2.addBinaryOp(op, plugin.assignmentPrecedence, true)); + jsep2.hooks.add("gobble-token", function gobbleUpdatePrefix(env3) { + const code = this.code; + if (plugin.updateOperators.some((c7) => c7 === code && c7 === this.expr.charCodeAt(this.index + 1))) { + this.index += 2; + env3.node = { + type: "UpdateExpression", + operator: code === PLUS_CODE ? "++" : "--", + argument: this.gobbleTokenProperty(this.gobbleIdentifier()), + prefix: true + }; + if (!env3.node.argument || !updateNodeTypes.includes(env3.node.argument.type)) { + this.throwError(`Unexpected ${env3.node.operator}`); + } + } + }); + jsep2.hooks.add("after-token", function gobbleUpdatePostfix(env3) { + if (env3.node) { + const code = this.code; + if (plugin.updateOperators.some((c7) => c7 === code && c7 === this.expr.charCodeAt(this.index + 1))) { + if (!updateNodeTypes.includes(env3.node.type)) { + this.throwError(`Unexpected ${env3.node.operator}`); + } + this.index += 2; + env3.node = { + type: "UpdateExpression", + operator: code === PLUS_CODE ? "++" : "--", + argument: env3.node, + prefix: false + }; + } + } + }); + jsep2.hooks.add("after-expression", function gobbleAssignment(env3) { + if (env3.node) { + updateBinariesToAssignments(env3.node); + } + }); + function updateBinariesToAssignments(node) { + if (plugin.assignmentOperators.has(node.operator)) { + node.type = "AssignmentExpression"; + updateBinariesToAssignments(node.left); + updateBinariesToAssignments(node.right); + } else if (!node.operator) { + Object.values(node).forEach((val) => { + if (val && typeof val === "object") { + updateBinariesToAssignments(val); + } + }); + } + } + } + }; + jsep.plugins.register(index, plugin); + jsep.addUnaryOp("typeof"); + jsep.addLiteral("null", null); + jsep.addLiteral("undefined", void 0); + BLOCKED_PROTO_PROPERTIES = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]); + SafeEval = { + /** + * @param {jsep.Expression} ast + * @param {Record} subs + */ + evalAst(ast, subs) { + switch (ast.type) { + case "BinaryExpression": + case "LogicalExpression": + return SafeEval.evalBinaryExpression(ast, subs); + case "Compound": + return SafeEval.evalCompound(ast, subs); + case "ConditionalExpression": + return SafeEval.evalConditionalExpression(ast, subs); + case "Identifier": + return SafeEval.evalIdentifier(ast, subs); + case "Literal": + return SafeEval.evalLiteral(ast, subs); + case "MemberExpression": + return SafeEval.evalMemberExpression(ast, subs); + case "UnaryExpression": + return SafeEval.evalUnaryExpression(ast, subs); + case "ArrayExpression": + return SafeEval.evalArrayExpression(ast, subs); + case "CallExpression": + return SafeEval.evalCallExpression(ast, subs); + case "AssignmentExpression": + return SafeEval.evalAssignmentExpression(ast, subs); + default: + throw SyntaxError("Unexpected expression", ast); + } + }, + evalBinaryExpression(ast, subs) { + const result2 = { + "||": (a7, b8) => a7 || b8(), + "&&": (a7, b8) => a7 && b8(), + "|": (a7, b8) => a7 | b8(), + "^": (a7, b8) => a7 ^ b8(), + "&": (a7, b8) => a7 & b8(), + // eslint-disable-next-line eqeqeq -- API + "==": (a7, b8) => a7 == b8(), + // eslint-disable-next-line eqeqeq -- API + "!=": (a7, b8) => a7 != b8(), + "===": (a7, b8) => a7 === b8(), + "!==": (a7, b8) => a7 !== b8(), + "<": (a7, b8) => a7 < b8(), + ">": (a7, b8) => a7 > b8(), + "<=": (a7, b8) => a7 <= b8(), + ">=": (a7, b8) => a7 >= b8(), + "<<": (a7, b8) => a7 << b8(), + ">>": (a7, b8) => a7 >> b8(), + ">>>": (a7, b8) => a7 >>> b8(), + "+": (a7, b8) => a7 + b8(), + "-": (a7, b8) => a7 - b8(), + "*": (a7, b8) => a7 * b8(), + "/": (a7, b8) => a7 / b8(), + "%": (a7, b8) => a7 % b8() + }[ast.operator](SafeEval.evalAst(ast.left, subs), () => SafeEval.evalAst(ast.right, subs)); + return result2; + }, + evalCompound(ast, subs) { + let last2; + for (let i7 = 0; i7 < ast.body.length; i7++) { + if (ast.body[i7].type === "Identifier" && ["var", "let", "const"].includes(ast.body[i7].name) && ast.body[i7 + 1] && ast.body[i7 + 1].type === "AssignmentExpression") { + i7 += 1; + } + const expr = ast.body[i7]; + last2 = SafeEval.evalAst(expr, subs); + } + return last2; + }, + evalConditionalExpression(ast, subs) { + if (SafeEval.evalAst(ast.test, subs)) { + return SafeEval.evalAst(ast.consequent, subs); + } + return SafeEval.evalAst(ast.alternate, subs); + }, + evalIdentifier(ast, subs) { + if (Object.hasOwn(subs, ast.name)) { + return subs[ast.name]; + } + throw ReferenceError(`${ast.name} is not defined`); + }, + evalLiteral(ast) { + return ast.value; + }, + evalMemberExpression(ast, subs) { + const prop = String( + // NOTE: `String(value)` throws error when + // value has overwritten the toString method to return non-string + // i.e. `value = {toString: () => []}` + ast.computed ? SafeEval.evalAst(ast.property) : ast.property.name + // `object.property` property is Identifier + ); + const obj = SafeEval.evalAst(ast.object, subs); + if (obj === void 0 || obj === null) { + throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + } + if (!Object.hasOwn(obj, prop) && BLOCKED_PROTO_PROPERTIES.has(prop)) { + throw TypeError(`Cannot read properties of ${obj} (reading '${prop}')`); + } + const result2 = obj[prop]; + if (typeof result2 === "function") { + return result2.bind(obj); + } + return result2; + }, + evalUnaryExpression(ast, subs) { + const result2 = { + "-": (a7) => -SafeEval.evalAst(a7, subs), + "!": (a7) => !SafeEval.evalAst(a7, subs), + "~": (a7) => ~SafeEval.evalAst(a7, subs), + // eslint-disable-next-line no-implicit-coercion -- API + "+": (a7) => +SafeEval.evalAst(a7, subs), + typeof: (a7) => typeof SafeEval.evalAst(a7, subs) + }[ast.operator](ast.argument); + return result2; + }, + evalArrayExpression(ast, subs) { + return ast.elements.map((el) => SafeEval.evalAst(el, subs)); + }, + evalCallExpression(ast, subs) { + const args = ast.arguments.map((arg) => SafeEval.evalAst(arg, subs)); + const func = SafeEval.evalAst(ast.callee, subs); + return func(...args); + }, + evalAssignmentExpression(ast, subs) { + if (ast.left.type !== "Identifier") { + throw SyntaxError("Invalid left-hand side in assignment"); + } + const id = ast.left.name; + const value2 = SafeEval.evalAst(ast.right, subs); + subs[id] = value2; + return subs[id]; + } + }; + SafeScript = class { + /** + * @param {string} expr Expression to evaluate + */ + constructor(expr) { + this.code = expr; + this.ast = jsep(this.code); + } + /** + * @param {object} context Object whose items will be added + * to evaluation + * @returns {EvaluatedResult} Result of evaluated code + */ + runInNewContext(context2) { + const keyMap = Object.assign(/* @__PURE__ */ Object.create(null), context2); + return SafeEval.evalAst(this.ast, keyMap); + } + }; + NewError = class extends Error { + /** + * @param {AnyResult} value The evaluated scalar value + */ + constructor(value2) { + super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'); + this.avoidNew = true; + this.value = value2; + this.name = "NewError"; + } + }; + JSONPath.prototype.evaluate = function(expr, json2, callback, otherTypeCallback) { + let currParent = this.parent, currParentProperty = this.parentProperty; + let { + flatten: flatten2, + wrap: wrap2 + } = this; + this.currResultType = this.resultType; + this.currEval = this.eval; + this.currSandbox = this.sandbox; + callback = callback || this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + json2 = json2 || this.json; + expr = expr || this.path; + if (expr && typeof expr === "object" && !Array.isArray(expr)) { + if (!expr.path && expr.path !== "") { + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + } + if (!Object.hasOwn(expr, "json")) { + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + } + ({ + json: json2 + } = expr); + flatten2 = Object.hasOwn(expr, "flatten") ? expr.flatten : flatten2; + this.currResultType = Object.hasOwn(expr, "resultType") ? expr.resultType : this.currResultType; + this.currSandbox = Object.hasOwn(expr, "sandbox") ? expr.sandbox : this.currSandbox; + wrap2 = Object.hasOwn(expr, "wrap") ? expr.wrap : wrap2; + this.currEval = Object.hasOwn(expr, "eval") ? expr.eval : this.currEval; + callback = Object.hasOwn(expr, "callback") ? expr.callback : callback; + this.currOtherTypeCallback = Object.hasOwn(expr, "otherTypeCallback") ? expr.otherTypeCallback : this.currOtherTypeCallback; + currParent = Object.hasOwn(expr, "parent") ? expr.parent : currParent; + currParentProperty = Object.hasOwn(expr, "parentProperty") ? expr.parentProperty : currParentProperty; + expr = expr.path; + } + currParent = currParent || null; + currParentProperty = currParentProperty || null; + if (Array.isArray(expr)) { + expr = JSONPath.toPathString(expr); + } + if (!expr && expr !== "" || !json2) { + return void 0; + } + const exprList = JSONPath.toPathArray(expr); + if (exprList[0] === "$" && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = null; + const result2 = this._trace(exprList, json2, ["$"], currParent, currParentProperty, callback).filter(function(ea) { + return ea && !ea.isParentSelector; + }); + if (!result2.length) { + return wrap2 ? [] : void 0; + } + if (!wrap2 && result2.length === 1 && !result2[0].hasArrExpr) { + return this._getPreferredOutput(result2[0]); + } + return result2.reduce((rslt, ea) => { + const valOrPath = this._getPreferredOutput(ea); + if (flatten2 && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, []); + }; + JSONPath.prototype._getPreferredOutput = function(ea) { + const resultType = this.currResultType; + switch (resultType) { + case "all": { + const path2 = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path); + ea.pointer = JSONPath.toPointer(path2); + ea.path = typeof ea.path === "string" ? ea.path : JSONPath.toPathString(ea.path); + return ea; + } + case "value": + case "parent": + case "parentProperty": + return ea[resultType]; + case "path": + return JSONPath.toPathString(ea[resultType]); + case "pointer": + return JSONPath.toPointer(ea.path); + default: + throw new TypeError("Unknown result type"); + } + }; + JSONPath.prototype._handleCallback = function(fullRetObj, callback, type3) { + if (callback) { + const preferredOutput = this._getPreferredOutput(fullRetObj); + fullRetObj.path = typeof fullRetObj.path === "string" ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); + callback(preferredOutput, type3, fullRetObj); + } + }; + JSONPath.prototype._trace = function(expr, val, path2, parent2, parentPropName, callback, hasArrExpr, literalPriority) { + let retObj; + if (!expr.length) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + const loc = expr[0], x7 = expr.slice(1); + const ret = []; + function addRet(elems) { + if (Array.isArray(elems)) { + elems.forEach((t8) => { + ret.push(t8); + }); + } else { + ret.push(elems); + } + } + if ((typeof loc !== "string" || literalPriority) && val && Object.hasOwn(val, loc)) { + addRet(this._trace(x7, val[loc], push(path2, loc), val, loc, callback, hasArrExpr)); + } else if (loc === "*") { + this._walk(val, (m7) => { + addRet(this._trace(x7, val[m7], push(path2, m7), val, m7, callback, true, true)); + }); + } else if (loc === "..") { + addRet(this._trace(x7, val, path2, parent2, parentPropName, callback, hasArrExpr)); + this._walk(val, (m7) => { + if (typeof val[m7] === "object") { + addRet(this._trace(expr.slice(), val[m7], push(path2, m7), val, m7, callback, true)); + } + }); + } else if (loc === "^") { + this._hasParentSelector = true; + return { + path: path2.slice(0, -1), + expr: x7, + isParentSelector: true + }; + } else if (loc === "~") { + retObj = { + path: push(path2, loc), + value: parentPropName, + parent: parent2, + parentProperty: null + }; + this._handleCallback(retObj, callback, "property"); + return retObj; + } else if (loc === "$") { + addRet(this._trace(x7, val, path2, null, null, callback, hasArrExpr)); + } else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) { + addRet(this._slice(loc, x7, val, path2, parent2, parentPropName, callback)); + } else if (loc.indexOf("?(") === 0) { + if (this.currEval === false) { + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + } + const safeLoc = loc.replace(/^\?\((.*?)\)$/u, "$1"); + const nested = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(safeLoc); + if (nested) { + this._walk(val, (m7) => { + const npath = [nested[2]]; + const nvalue = nested[1] ? val[m7][nested[1]] : val[m7]; + const filterResults = this._trace(npath, nvalue, path2, parent2, parentPropName, callback, true); + if (filterResults.length > 0) { + addRet(this._trace(x7, val[m7], push(path2, m7), val, m7, callback, true)); + } + }); + } else { + this._walk(val, (m7) => { + if (this._eval(safeLoc, val[m7], m7, path2, parent2, parentPropName)) { + addRet(this._trace(x7, val[m7], push(path2, m7), val, m7, callback, true)); + } + }); + } + } else if (loc[0] === "(") { + if (this.currEval === false) { + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + } + addRet(this._trace(unshift(this._eval(loc, val, path2.at(-1), path2.slice(0, -1), parent2, parentPropName), x7), val, path2, parent2, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === "@") { + let addType = false; + const valueType = loc.slice(1, -2); + switch (valueType) { + case "scalar": + if (!val || !["object", "function"].includes(typeof val)) { + addType = true; + } + break; + case "boolean": + case "string": + case "undefined": + case "function": + if (typeof val === valueType) { + addType = true; + } + break; + case "integer": + if (Number.isFinite(val) && !(val % 1)) { + addType = true; + } + break; + case "number": + if (Number.isFinite(val)) { + addType = true; + } + break; + case "nonFinite": + if (typeof val === "number" && !Number.isFinite(val)) { + addType = true; + } + break; + case "object": + if (val && typeof val === valueType) { + addType = true; + } + break; + case "array": + if (Array.isArray(val)) { + addType = true; + } + break; + case "other": + addType = this.currOtherTypeCallback(val, path2, parent2, parentPropName); + break; + case "null": + if (val === null) { + addType = true; + } + break; + default: + throw new TypeError("Unknown value type " + valueType); + } + if (addType) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + } else if (loc[0] === "`" && val && Object.hasOwn(val, loc.slice(1))) { + const locProp = loc.slice(1); + addRet(this._trace(x7, val[locProp], push(path2, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(",")) { + const parts = loc.split(","); + for (const part of parts) { + addRet(this._trace(unshift(part, x7), val, path2, parent2, parentPropName, callback, true)); + } + } else if (!literalPriority && val && Object.hasOwn(val, loc)) { + addRet(this._trace(x7, val[loc], push(path2, loc), val, loc, callback, hasArrExpr, true)); + } + if (this._hasParentSelector) { + for (let t8 = 0; t8 < ret.length; t8++) { + const rett = ret[t8]; + if (rett && rett.isParentSelector) { + const tmp = this._trace(rett.expr, val, rett.path, parent2, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t8] = tmp[0]; + const tl = tmp.length; + for (let tt3 = 1; tt3 < tl; tt3++) { + t8++; + ret.splice(t8, 0, tmp[tt3]); + } + } else { + ret[t8] = tmp; + } + } + } + } + return ret; + }; + JSONPath.prototype._walk = function(val, f8) { + if (Array.isArray(val)) { + const n7 = val.length; + for (let i7 = 0; i7 < n7; i7++) { + f8(i7); + } + } else if (val && typeof val === "object") { + Object.keys(val).forEach((m7) => { + f8(m7); + }); + } + }; + JSONPath.prototype._slice = function(loc, expr, val, path2, parent2, parentPropName, callback) { + if (!Array.isArray(val)) { + return void 0; + } + const len = val.length, parts = loc.split(":"), step = parts[2] && Number.parseInt(parts[2]) || 1; + let start = parts[0] && Number.parseInt(parts[0]) || 0, end = parts[1] && Number.parseInt(parts[1]) || len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + const ret = []; + for (let i7 = start; i7 < end; i7 += step) { + const tmp = this._trace(unshift(i7, expr), val, path2, parent2, parentPropName, callback, true); + tmp.forEach((t8) => { + ret.push(t8); + }); + } + return ret; + }; + JSONPath.prototype._eval = function(code, _v, _vname, path2, parent2, parentPropName) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent2; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + const containsPath = code.includes("@path"); + if (containsPath) { + this.currSandbox._$_path = JSONPath.toPathString(path2.concat([_vname])); + } + const scriptCacheKey = this.currEval + "Script:" + code; + if (!JSONPath.cache[scriptCacheKey]) { + let script = code.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1"); + if (containsPath) { + script = script.replaceAll("@path", "_$_path"); + } + if (this.currEval === "safe" || this.currEval === true || this.currEval === void 0) { + JSONPath.cache[scriptCacheKey] = new this.safeVm.Script(script); + } else if (this.currEval === "native") { + JSONPath.cache[scriptCacheKey] = new this.vm.Script(script); + } else if (typeof this.currEval === "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) { + const CurrEval = this.currEval; + JSONPath.cache[scriptCacheKey] = new CurrEval(script); + } else if (typeof this.currEval === "function") { + JSONPath.cache[scriptCacheKey] = { + runInNewContext: (context2) => this.currEval(script, context2) + }; + } else { + throw new TypeError(`Unknown "eval" property "${this.currEval}"`); + } + } + try { + return JSONPath.cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e10) { + if (this.ignoreEvalErrors) { + return false; + } + throw new Error("jsonPath: " + e10.message + ": " + code); + } + }; + JSONPath.cache = {}; + JSONPath.toPathString = function(pathArr) { + const x7 = pathArr, n7 = x7.length; + let p7 = "$"; + for (let i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@.*?\(\))$/u.test(x7[i7])) { + p7 += /^[0-9*]+$/u.test(x7[i7]) ? "[" + x7[i7] + "]" : "['" + x7[i7] + "']"; + } + } + return p7; + }; + JSONPath.toPointer = function(pointer) { + const x7 = pointer, n7 = x7.length; + let p7 = ""; + for (let i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@.*?\(\))$/u.test(x7[i7])) { + p7 += "/" + x7[i7].toString().replaceAll("~", "~0").replaceAll("/", "~1"); + } + } + return p7; + }; + JSONPath.toPathArray = function(expr) { + const { + cache + } = JSONPath; + if (cache[expr]) { + return cache[expr].concat(); + } + const subx = []; + const normalized = expr.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function($0, $1) { + return "[#" + (subx.push($1) - 1) + "]"; + }).replaceAll(/\[['"]([^'\]]*)['"]\]/gu, function($0, prop) { + return "['" + prop.replaceAll(".", "%@%").replaceAll("~", "%%@@%%") + "']"; + }).replaceAll("~", ";~;").replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu, ";").replaceAll("%@%", ".").replaceAll("%%@@%%", "~").replaceAll(/(?:;)?(\^+)(?:;)?/gu, function($0, ups) { + return ";" + ups.split("").join(";") + ";"; + }).replaceAll(/;;;|;;/gu, ";..;").replaceAll(/;$|'?\]|'$/gu, ""); + const exprList = normalized.split(";").map(function(exp) { + const match = exp.match(/#(\d+)/u); + return !match || !match[1] ? exp : subx[match[1]]; + }); + cache[expr] = exprList; + return cache[expr].concat(); + }; + JSONPath.prototype.safeVm = { + Script: SafeScript + }; + moveToAnotherArray = function(source, target, conditionCb) { + const il = source.length; + for (let i7 = 0; i7 < il; i7++) { + const item = source[i7]; + if (conditionCb(item)) { + target.push(source.splice(i7--, 1)[0]); + } + } + }; + Script2 = class { + /** + * @param {string} expr Expression to evaluate + */ + constructor(expr) { + this.code = expr; + } + /** + * @param {object} context Object whose items will be added + * to evaluation + * @returns {EvaluatedResult} Result of evaluated code + */ + runInNewContext(context2) { + let expr = this.code; + const keys2 = Object.keys(context2); + const funcs = []; + moveToAnotherArray(keys2, funcs, (key) => { + return typeof context2[key] === "function"; + }); + const values2 = keys2.map((vr) => { + return context2[vr]; + }); + const funcString = funcs.reduce((s7, func) => { + let fString = context2[func].toString(); + if (!/function/u.test(fString)) { + fString = "function " + fString; + } + return "var " + func + "=" + fString + ";" + s7; + }, ""); + expr = funcString + expr; + if (!/(['"])use strict\1/u.test(expr) && !keys2.includes("arguments")) { + expr = "var arguments = undefined;" + expr; + } + expr = expr.replace(/;\s*$/u, ""); + const lastStatementEnd = expr.lastIndexOf(";"); + const code = lastStatementEnd !== -1 ? expr.slice(0, lastStatementEnd + 1) + " return " + expr.slice(lastStatementEnd + 1) : " return " + expr; + return new Function(...keys2, code)(...values2); + } + }; + JSONPath.prototype.vm = { + Script: Script2 + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/utils/getLintTargets.js +var require_getLintTargets = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/utils/getLintTargets.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getLintTargets = void 0; + var jsonpath_plus_1 = (init_index_browser_esm(), __toCommonJS(index_browser_esm_exports)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var getLintTargets = (targetValue, field) => { + const targets = []; + if ((0, lodash_1.isObject)(targetValue) && typeof field === "string") { + if (field === "@key") { + for (const key of Object.keys(targetValue)) { + targets.push({ + path: [key], + value: key + }); + } + } else if (field.startsWith("$")) { + (0, jsonpath_plus_1.JSONPath)({ + path: field, + json: targetValue, + resultType: "all", + callback(result2) { + targets.push({ + path: (0, lodash_1.toPath)(result2.path.slice(1)), + value: result2.value + }); + } + }); + } else { + targets.push({ + path: (0, lodash_1.toPath)(field), + value: (0, lodash_1.get)(targetValue, field) + }); + } + } else { + targets.push({ + path: [], + value: targetValue + }); + } + if (targets.length === 0) { + targets.push({ + path: [], + value: void 0 + }); + } + return targets; + }; + exports28.getLintTargets = getLintTargets; + } +}); + +// node_modules/jsep/dist/cjs/jsep.cjs.js +var require_jsep_cjs = __commonJS({ + "node_modules/jsep/dist/cjs/jsep.cjs.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Hooks2 = class { + /** + * @callback HookCallback + * @this {*|Jsep} this + * @param {Jsep} env + * @returns: void + */ + /** + * Adds the given callback to the list of callbacks for the given hook. + * + * The callback will be invoked when the hook it is registered for is run. + * + * One callback function can be registered to multiple hooks and the same hook multiple times. + * + * @param {string|object} name The name of the hook, or an object of callbacks keyed by name + * @param {HookCallback|boolean} callback The callback function which is given environment variables. + * @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom) + * @public + */ + add(name2, callback, first) { + if (typeof arguments[0] != "string") { + for (let name3 in arguments[0]) { + this.add(name3, arguments[0][name3], arguments[1]); + } + } else { + (Array.isArray(name2) ? name2 : [name2]).forEach(function(name3) { + this[name3] = this[name3] || []; + if (callback) { + this[name3][first ? "unshift" : "push"](callback); + } + }, this); + } + } + /** + * Runs a hook invoking all registered callbacks with the given environment variables. + * + * Callbacks will be invoked synchronously and in the order in which they were registered. + * + * @param {string} name The name of the hook. + * @param {Object} env The environment variables of the hook passed to all callbacks registered. + * @public + */ + run(name2, env3) { + this[name2] = this[name2] || []; + this[name2].forEach(function(callback) { + callback.call(env3 && env3.context ? env3.context : env3, env3); + }); + } + }; + var Plugins2 = class { + constructor(jsep3) { + this.jsep = jsep3; + this.registered = {}; + } + /** + * @callback PluginSetup + * @this {Jsep} jsep + * @returns: void + */ + /** + * Adds the given plugin(s) to the registry + * + * @param {object} plugins + * @param {string} plugins.name The name of the plugin + * @param {PluginSetup} plugins.init The init function + * @public + */ + register(...plugins) { + plugins.forEach((plugin2) => { + if (typeof plugin2 !== "object" || !plugin2.name || !plugin2.init) { + throw new Error("Invalid JSEP plugin format"); + } + if (this.registered[plugin2.name]) { + return; + } + plugin2.init(this.jsep); + this.registered[plugin2.name] = plugin2; + }); + } + }; + var Jsep2 = class _Jsep { + /** + * @returns {string} + */ + static get version() { + return "1.4.0"; + } + /** + * @returns {string} + */ + static toString() { + return "JavaScript Expression Parser (JSEP) v" + _Jsep.version; + } + // ==================== CONFIG ================================ + /** + * @method addUnaryOp + * @param {string} op_name The name of the unary op to add + * @returns {Jsep} + */ + static addUnaryOp(op_name) { + _Jsep.max_unop_len = Math.max(op_name.length, _Jsep.max_unop_len); + _Jsep.unary_ops[op_name] = 1; + return _Jsep; + } + /** + * @method jsep.addBinaryOp + * @param {string} op_name The name of the binary op to add + * @param {number} precedence The precedence of the binary op (can be a float). Higher number = higher precedence + * @param {boolean} [isRightAssociative=false] whether operator is right-associative + * @returns {Jsep} + */ + static addBinaryOp(op_name, precedence, isRightAssociative) { + _Jsep.max_binop_len = Math.max(op_name.length, _Jsep.max_binop_len); + _Jsep.binary_ops[op_name] = precedence; + if (isRightAssociative) { + _Jsep.right_associative.add(op_name); + } else { + _Jsep.right_associative.delete(op_name); + } + return _Jsep; + } + /** + * @method addIdentifierChar + * @param {string} char The additional character to treat as a valid part of an identifier + * @returns {Jsep} + */ + static addIdentifierChar(char) { + _Jsep.additional_identifier_chars.add(char); + return _Jsep; + } + /** + * @method addLiteral + * @param {string} literal_name The name of the literal to add + * @param {*} literal_value The value of the literal + * @returns {Jsep} + */ + static addLiteral(literal_name, literal_value) { + _Jsep.literals[literal_name] = literal_value; + return _Jsep; + } + /** + * @method removeUnaryOp + * @param {string} op_name The name of the unary op to remove + * @returns {Jsep} + */ + static removeUnaryOp(op_name) { + delete _Jsep.unary_ops[op_name]; + if (op_name.length === _Jsep.max_unop_len) { + _Jsep.max_unop_len = _Jsep.getMaxKeyLen(_Jsep.unary_ops); + } + return _Jsep; + } + /** + * @method removeAllUnaryOps + * @returns {Jsep} + */ + static removeAllUnaryOps() { + _Jsep.unary_ops = {}; + _Jsep.max_unop_len = 0; + return _Jsep; + } + /** + * @method removeIdentifierChar + * @param {string} char The additional character to stop treating as a valid part of an identifier + * @returns {Jsep} + */ + static removeIdentifierChar(char) { + _Jsep.additional_identifier_chars.delete(char); + return _Jsep; + } + /** + * @method removeBinaryOp + * @param {string} op_name The name of the binary op to remove + * @returns {Jsep} + */ + static removeBinaryOp(op_name) { + delete _Jsep.binary_ops[op_name]; + if (op_name.length === _Jsep.max_binop_len) { + _Jsep.max_binop_len = _Jsep.getMaxKeyLen(_Jsep.binary_ops); + } + _Jsep.right_associative.delete(op_name); + return _Jsep; + } + /** + * @method removeAllBinaryOps + * @returns {Jsep} + */ + static removeAllBinaryOps() { + _Jsep.binary_ops = {}; + _Jsep.max_binop_len = 0; + return _Jsep; + } + /** + * @method removeLiteral + * @param {string} literal_name The name of the literal to remove + * @returns {Jsep} + */ + static removeLiteral(literal_name) { + delete _Jsep.literals[literal_name]; + return _Jsep; + } + /** + * @method removeAllLiterals + * @returns {Jsep} + */ + static removeAllLiterals() { + _Jsep.literals = {}; + return _Jsep; + } + // ==================== END CONFIG ============================ + /** + * @returns {string} + */ + get char() { + return this.expr.charAt(this.index); + } + /** + * @returns {number} + */ + get code() { + return this.expr.charCodeAt(this.index); + } + /** + * @param {string} expr a string with the passed in express + * @returns Jsep + */ + constructor(expr) { + this.expr = expr; + this.index = 0; + } + /** + * static top-level parser + * @returns {jsep.Expression} + */ + static parse(expr) { + return new _Jsep(expr).parse(); + } + /** + * Get the longest key length of any object + * @param {object} obj + * @returns {number} + */ + static getMaxKeyLen(obj) { + return Math.max(0, ...Object.keys(obj).map((k6) => k6.length)); + } + /** + * `ch` is a character code in the next three functions + * @param {number} ch + * @returns {boolean} + */ + static isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; + } + /** + * Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float. + * @param {string} op_val + * @returns {number} + */ + static binaryPrecedence(op_val) { + return _Jsep.binary_ops[op_val] || 0; + } + /** + * Looks for start of identifier + * @param {number} ch + * @returns {boolean} + */ + static isIdentifierStart(ch) { + return ch >= 65 && ch <= 90 || // A...Z + ch >= 97 && ch <= 122 || // a...z + ch >= 128 && !_Jsep.binary_ops[String.fromCharCode(ch)] || // any non-ASCII that is not an operator + _Jsep.additional_identifier_chars.has(String.fromCharCode(ch)); + } + /** + * @param {number} ch + * @returns {boolean} + */ + static isIdentifierPart(ch) { + return _Jsep.isIdentifierStart(ch) || _Jsep.isDecimalDigit(ch); + } + /** + * throw error at index of the expression + * @param {string} message + * @throws + */ + throwError(message) { + const error2 = new Error(message + " at character " + this.index); + error2.index = this.index; + error2.description = message; + throw error2; + } + /** + * Run a given hook + * @param {string} name + * @param {jsep.Expression|false} [node] + * @returns {?jsep.Expression} + */ + runHook(name2, node) { + if (_Jsep.hooks[name2]) { + const env3 = { context: this, node }; + _Jsep.hooks.run(name2, env3); + return env3.node; + } + return node; + } + /** + * Runs a given hook until one returns a node + * @param {string} name + * @returns {?jsep.Expression} + */ + searchHook(name2) { + if (_Jsep.hooks[name2]) { + const env3 = { context: this }; + _Jsep.hooks[name2].find(function(callback) { + callback.call(env3.context, env3); + return env3.node; + }); + return env3.node; + } + } + /** + * Push `index` up to the next non-space character + */ + gobbleSpaces() { + let ch = this.code; + while (ch === _Jsep.SPACE_CODE || ch === _Jsep.TAB_CODE || ch === _Jsep.LF_CODE || ch === _Jsep.CR_CODE) { + ch = this.expr.charCodeAt(++this.index); + } + this.runHook("gobble-spaces"); + } + /** + * Top-level method to parse all expressions and returns compound or single node + * @returns {jsep.Expression} + */ + parse() { + this.runHook("before-all"); + const nodes = this.gobbleExpressions(); + const node = nodes.length === 1 ? nodes[0] : { + type: _Jsep.COMPOUND, + body: nodes + }; + return this.runHook("after-all", node); + } + /** + * top-level parser (but can be reused within as well) + * @param {number} [untilICode] + * @returns {jsep.Expression[]} + */ + gobbleExpressions(untilICode) { + let nodes = [], ch_i, node; + while (this.index < this.expr.length) { + ch_i = this.code; + if (ch_i === _Jsep.SEMCOL_CODE || ch_i === _Jsep.COMMA_CODE) { + this.index++; + } else { + if (node = this.gobbleExpression()) { + nodes.push(node); + } else if (this.index < this.expr.length) { + if (ch_i === untilICode) { + break; + } + this.throwError('Unexpected "' + this.char + '"'); + } + } + } + return nodes; + } + /** + * The main parsing function. + * @returns {?jsep.Expression} + */ + gobbleExpression() { + const node = this.searchHook("gobble-expression") || this.gobbleBinaryExpression(); + this.gobbleSpaces(); + return this.runHook("after-expression", node); + } + /** + * Search for the operation portion of the string (e.g. `+`, `===`) + * Start by taking the longest possible binary operations (3 characters: `===`, `!==`, `>>>`) + * and move down from 3 to 2 to 1 character until a matching binary operation is found + * then, return that binary operation + * @returns {string|boolean} + */ + gobbleBinaryOp() { + this.gobbleSpaces(); + let to_check = this.expr.substr(this.index, _Jsep.max_binop_len); + let tc_len = to_check.length; + while (tc_len > 0) { + if (_Jsep.binary_ops.hasOwnProperty(to_check) && (!_Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !_Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { + this.index += tc_len; + return to_check; + } + to_check = to_check.substr(0, --tc_len); + } + return false; + } + /** + * This function is responsible for gobbling an individual expression, + * e.g. `1`, `1+2`, `a+(b*2)-Math.sqrt(2)` + * @returns {?jsep.BinaryExpression} + */ + gobbleBinaryExpression() { + let node, biop, prec, stack, biop_info, left, right, i7, cur_biop; + left = this.gobbleToken(); + if (!left) { + return left; + } + biop = this.gobbleBinaryOp(); + if (!biop) { + return left; + } + biop_info = { value: biop, prec: _Jsep.binaryPrecedence(biop), right_a: _Jsep.right_associative.has(biop) }; + right = this.gobbleToken(); + if (!right) { + this.throwError("Expected expression after " + biop); + } + stack = [left, biop_info, right]; + while (biop = this.gobbleBinaryOp()) { + prec = _Jsep.binaryPrecedence(biop); + if (prec === 0) { + this.index -= biop.length; + break; + } + biop_info = { value: biop, prec, right_a: _Jsep.right_associative.has(biop) }; + cur_biop = biop; + const comparePrev = (prev) => biop_info.right_a && prev.right_a ? prec > prev.prec : prec <= prev.prec; + while (stack.length > 2 && comparePrev(stack[stack.length - 2])) { + right = stack.pop(); + biop = stack.pop().value; + left = stack.pop(); + node = { + type: _Jsep.BINARY_EXP, + operator: biop, + left, + right + }; + stack.push(node); + } + node = this.gobbleToken(); + if (!node) { + this.throwError("Expected expression after " + cur_biop); + } + stack.push(biop_info, node); + } + i7 = stack.length - 1; + node = stack[i7]; + while (i7 > 1) { + node = { + type: _Jsep.BINARY_EXP, + operator: stack[i7 - 1].value, + left: stack[i7 - 2], + right: node + }; + i7 -= 2; + } + return node; + } + /** + * An individual part of a binary expression: + * e.g. `foo.bar(baz)`, `1`, `"abc"`, `(a % 2)` (because it's in parenthesis) + * @returns {boolean|jsep.Expression} + */ + gobbleToken() { + let ch, to_check, tc_len, node; + this.gobbleSpaces(); + node = this.searchHook("gobble-token"); + if (node) { + return this.runHook("after-token", node); + } + ch = this.code; + if (_Jsep.isDecimalDigit(ch) || ch === _Jsep.PERIOD_CODE) { + return this.gobbleNumericLiteral(); + } + if (ch === _Jsep.SQUOTE_CODE || ch === _Jsep.DQUOTE_CODE) { + node = this.gobbleStringLiteral(); + } else if (ch === _Jsep.OBRACK_CODE) { + node = this.gobbleArray(); + } else { + to_check = this.expr.substr(this.index, _Jsep.max_unop_len); + tc_len = to_check.length; + while (tc_len > 0) { + if (_Jsep.unary_ops.hasOwnProperty(to_check) && (!_Jsep.isIdentifierStart(this.code) || this.index + to_check.length < this.expr.length && !_Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + to_check.length)))) { + this.index += tc_len; + const argument = this.gobbleToken(); + if (!argument) { + this.throwError("missing unaryOp argument"); + } + return this.runHook("after-token", { + type: _Jsep.UNARY_EXP, + operator: to_check, + argument, + prefix: true + }); + } + to_check = to_check.substr(0, --tc_len); + } + if (_Jsep.isIdentifierStart(ch)) { + node = this.gobbleIdentifier(); + if (_Jsep.literals.hasOwnProperty(node.name)) { + node = { + type: _Jsep.LITERAL, + value: _Jsep.literals[node.name], + raw: node.name + }; + } else if (node.name === _Jsep.this_str) { + node = { type: _Jsep.THIS_EXP }; + } + } else if (ch === _Jsep.OPAREN_CODE) { + node = this.gobbleGroup(); + } + } + if (!node) { + return this.runHook("after-token", false); + } + node = this.gobbleTokenProperty(node); + return this.runHook("after-token", node); + } + /** + * Gobble properties of of identifiers/strings/arrays/groups. + * e.g. `foo`, `bar.baz`, `foo['bar'].baz` + * It also gobbles function calls: + * e.g. `Math.acos(obj.angle)` + * @param {jsep.Expression} node + * @returns {jsep.Expression} + */ + gobbleTokenProperty(node) { + this.gobbleSpaces(); + let ch = this.code; + while (ch === _Jsep.PERIOD_CODE || ch === _Jsep.OBRACK_CODE || ch === _Jsep.OPAREN_CODE || ch === _Jsep.QUMARK_CODE) { + let optional; + if (ch === _Jsep.QUMARK_CODE) { + if (this.expr.charCodeAt(this.index + 1) !== _Jsep.PERIOD_CODE) { + break; + } + optional = true; + this.index += 2; + this.gobbleSpaces(); + ch = this.code; + } + this.index++; + if (ch === _Jsep.OBRACK_CODE) { + node = { + type: _Jsep.MEMBER_EXP, + computed: true, + object: node, + property: this.gobbleExpression() + }; + if (!node.property) { + this.throwError('Unexpected "' + this.char + '"'); + } + this.gobbleSpaces(); + ch = this.code; + if (ch !== _Jsep.CBRACK_CODE) { + this.throwError("Unclosed ["); + } + this.index++; + } else if (ch === _Jsep.OPAREN_CODE) { + node = { + type: _Jsep.CALL_EXP, + "arguments": this.gobbleArguments(_Jsep.CPAREN_CODE), + callee: node + }; + } else if (ch === _Jsep.PERIOD_CODE || optional) { + if (optional) { + this.index--; + } + this.gobbleSpaces(); + node = { + type: _Jsep.MEMBER_EXP, + computed: false, + object: node, + property: this.gobbleIdentifier() + }; + } + if (optional) { + node.optional = true; + } + this.gobbleSpaces(); + ch = this.code; + } + return node; + } + /** + * Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to + * keep track of everything in the numeric literal and then calling `parseFloat` on that string + * @returns {jsep.Literal} + */ + gobbleNumericLiteral() { + let number = "", ch, chCode; + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + if (this.code === _Jsep.PERIOD_CODE) { + number += this.expr.charAt(this.index++); + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + } + ch = this.char; + if (ch === "e" || ch === "E") { + number += this.expr.charAt(this.index++); + ch = this.char; + if (ch === "+" || ch === "-") { + number += this.expr.charAt(this.index++); + } + while (_Jsep.isDecimalDigit(this.code)) { + number += this.expr.charAt(this.index++); + } + if (!_Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1))) { + this.throwError("Expected exponent (" + number + this.char + ")"); + } + } + chCode = this.code; + if (_Jsep.isIdentifierStart(chCode)) { + this.throwError("Variable names cannot start with a number (" + number + this.char + ")"); + } else if (chCode === _Jsep.PERIOD_CODE || number.length === 1 && number.charCodeAt(0) === _Jsep.PERIOD_CODE) { + this.throwError("Unexpected period"); + } + return { + type: _Jsep.LITERAL, + value: parseFloat(number), + raw: number + }; + } + /** + * Parses a string literal, staring with single or double quotes with basic support for escape codes + * e.g. `"hello world"`, `'this is\nJSEP'` + * @returns {jsep.Literal} + */ + gobbleStringLiteral() { + let str2 = ""; + const startIndex = this.index; + const quote = this.expr.charAt(this.index++); + let closed = false; + while (this.index < this.expr.length) { + let ch = this.expr.charAt(this.index++); + if (ch === quote) { + closed = true; + break; + } else if (ch === "\\") { + ch = this.expr.charAt(this.index++); + switch (ch) { + case "n": + str2 += "\n"; + break; + case "r": + str2 += "\r"; + break; + case "t": + str2 += " "; + break; + case "b": + str2 += "\b"; + break; + case "f": + str2 += "\f"; + break; + case "v": + str2 += "\v"; + break; + default: + str2 += ch; + } + } else { + str2 += ch; + } + } + if (!closed) { + this.throwError('Unclosed quote after "' + str2 + '"'); + } + return { + type: _Jsep.LITERAL, + value: str2, + raw: this.expr.substring(startIndex, this.index) + }; + } + /** + * Gobbles only identifiers + * e.g.: `foo`, `_value`, `$x1` + * Also, this function checks if that identifier is a literal: + * (e.g. `true`, `false`, `null`) or `this` + * @returns {jsep.Identifier} + */ + gobbleIdentifier() { + let ch = this.code, start = this.index; + if (_Jsep.isIdentifierStart(ch)) { + this.index++; + } else { + this.throwError("Unexpected " + this.char); + } + while (this.index < this.expr.length) { + ch = this.code; + if (_Jsep.isIdentifierPart(ch)) { + this.index++; + } else { + break; + } + } + return { + type: _Jsep.IDENTIFIER, + name: this.expr.slice(start, this.index) + }; + } + /** + * Gobbles a list of arguments within the context of a function call + * or array literal. This function also assumes that the opening character + * `(` or `[` has already been gobbled, and gobbles expressions and commas + * until the terminator character `)` or `]` is encountered. + * e.g. `foo(bar, baz)`, `my_func()`, or `[bar, baz]` + * @param {number} termination + * @returns {jsep.Expression[]} + */ + gobbleArguments(termination) { + const args = []; + let closed = false; + let separator_count = 0; + while (this.index < this.expr.length) { + this.gobbleSpaces(); + let ch_i = this.code; + if (ch_i === termination) { + closed = true; + this.index++; + if (termination === _Jsep.CPAREN_CODE && separator_count && separator_count >= args.length) { + this.throwError("Unexpected token " + String.fromCharCode(termination)); + } + break; + } else if (ch_i === _Jsep.COMMA_CODE) { + this.index++; + separator_count++; + if (separator_count !== args.length) { + if (termination === _Jsep.CPAREN_CODE) { + this.throwError("Unexpected token ,"); + } else if (termination === _Jsep.CBRACK_CODE) { + for (let arg = args.length; arg < separator_count; arg++) { + args.push(null); + } + } + } + } else if (args.length !== separator_count && separator_count !== 0) { + this.throwError("Expected comma"); + } else { + const node = this.gobbleExpression(); + if (!node || node.type === _Jsep.COMPOUND) { + this.throwError("Expected comma"); + } + args.push(node); + } + } + if (!closed) { + this.throwError("Expected " + String.fromCharCode(termination)); + } + return args; + } + /** + * Responsible for parsing a group of things within parentheses `()` + * that have no identifier in front (so not a function call) + * This function assumes that it needs to gobble the opening parenthesis + * and then tries to gobble everything within that parenthesis, assuming + * that the next thing it should see is the close parenthesis. If not, + * then the expression probably doesn't have a `)` + * @returns {boolean|jsep.Expression} + */ + gobbleGroup() { + this.index++; + let nodes = this.gobbleExpressions(_Jsep.CPAREN_CODE); + if (this.code === _Jsep.CPAREN_CODE) { + this.index++; + if (nodes.length === 1) { + return nodes[0]; + } else if (!nodes.length) { + return false; + } else { + return { + type: _Jsep.SEQUENCE_EXP, + expressions: nodes + }; + } + } else { + this.throwError("Unclosed ("); + } + } + /** + * Responsible for parsing Array literals `[1, 2, 3]` + * This function assumes that it needs to gobble the opening bracket + * and then tries to gobble the expressions as arguments. + * @returns {jsep.ArrayExpression} + */ + gobbleArray() { + this.index++; + return { + type: _Jsep.ARRAY_EXP, + elements: this.gobbleArguments(_Jsep.CBRACK_CODE) + }; + } + }; + var hooks2 = new Hooks2(); + Object.assign(Jsep2, { + hooks: hooks2, + plugins: new Plugins2(Jsep2), + // Node Types + // ---------- + // This is the full set of types that any JSEP node can be. + // Store them here to save space when minified + COMPOUND: "Compound", + SEQUENCE_EXP: "SequenceExpression", + IDENTIFIER: "Identifier", + MEMBER_EXP: "MemberExpression", + LITERAL: "Literal", + THIS_EXP: "ThisExpression", + CALL_EXP: "CallExpression", + UNARY_EXP: "UnaryExpression", + BINARY_EXP: "BinaryExpression", + ARRAY_EXP: "ArrayExpression", + TAB_CODE: 9, + LF_CODE: 10, + CR_CODE: 13, + SPACE_CODE: 32, + PERIOD_CODE: 46, + // '.' + COMMA_CODE: 44, + // ',' + SQUOTE_CODE: 39, + // single quote + DQUOTE_CODE: 34, + // double quotes + OPAREN_CODE: 40, + // ( + CPAREN_CODE: 41, + // ) + OBRACK_CODE: 91, + // [ + CBRACK_CODE: 93, + // ] + QUMARK_CODE: 63, + // ? + SEMCOL_CODE: 59, + // ; + COLON_CODE: 58, + // : + // Operations + // ---------- + // Use a quickly-accessible map to store all of the unary operators + // Values are set to `1` (it really doesn't matter) + unary_ops: { + "-": 1, + "!": 1, + "~": 1, + "+": 1 + }, + // Also use a map for the binary operations but set their values to their + // binary precedence for quick reference (higher number = higher precedence) + // see [Order of operations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) + binary_ops: { + "||": 1, + "??": 1, + "&&": 2, + "|": 3, + "^": 4, + "&": 5, + "==": 6, + "!=": 6, + "===": 6, + "!==": 6, + "<": 7, + ">": 7, + "<=": 7, + ">=": 7, + "<<": 8, + ">>": 8, + ">>>": 8, + "+": 9, + "-": 9, + "*": 10, + "/": 10, + "%": 10, + "**": 11 + }, + // sets specific binary_ops as right-associative + right_associative: /* @__PURE__ */ new Set(["**"]), + // Additional valid identifier chars, apart from a-z, A-Z and 0-9 (except on the starting char) + additional_identifier_chars: /* @__PURE__ */ new Set(["$", "_"]), + // Literals + // ---------- + // Store the values to return for the various literals we may encounter + literals: { + "true": true, + "false": false, + "null": null + }, + // Except for `this`, which is special. This could be changed to something like `'self'` as well + this_str: "this" + }); + Jsep2.max_unop_len = Jsep2.getMaxKeyLen(Jsep2.unary_ops); + Jsep2.max_binop_len = Jsep2.getMaxKeyLen(Jsep2.binary_ops); + var jsep2 = (expr) => new Jsep2(expr).parse(); + var stdClassProps2 = Object.getOwnPropertyNames(class Test { + }); + Object.getOwnPropertyNames(Jsep2).filter((prop) => !stdClassProps2.includes(prop) && jsep2[prop] === void 0).forEach((m7) => { + jsep2[m7] = Jsep2[m7]; + }); + jsep2.Jsep = Jsep2; + var CONDITIONAL_EXP3 = "ConditionalExpression"; + var ternary2 = { + name: "ternary", + init(jsep3) { + jsep3.hooks.add("after-expression", function gobbleTernary(env3) { + if (env3.node && this.code === jsep3.QUMARK_CODE) { + this.index++; + const test = env3.node; + const consequent = this.gobbleExpression(); + if (!consequent) { + this.throwError("Expected expression"); + } + this.gobbleSpaces(); + if (this.code === jsep3.COLON_CODE) { + this.index++; + const alternate = this.gobbleExpression(); + if (!alternate) { + this.throwError("Expected expression"); + } + env3.node = { + type: CONDITIONAL_EXP3, + test, + consequent, + alternate + }; + if (test.operator && jsep3.binary_ops[test.operator] <= 0.9) { + let newTest = test; + while (newTest.right.operator && jsep3.binary_ops[newTest.right.operator] <= 0.9) { + newTest = newTest.right; + } + env3.node.test = newTest.right; + newTest.right = env3.node; + env3.node = test; + } + } else { + this.throwError("Expected :"); + } + } + }); + } + }; + jsep2.plugins.register(ternary2); + module5.exports = jsep2; + } +}); + +// node_modules/simple-eval/dist/reduce.js +var require_reduce = __commonJS({ + "node_modules/simple-eval/dist/reduce.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function reduce2(node, ctx) { + switch (node.type) { + case "Program": + return reduceProgram(node, ctx); + case "ExpressionStatement": + return reduce2(node.expression, ctx); + case "MemberExpression": + return reduceMemExpr(node, ctx); + case "LogicalExpression": + return reduceLogExpr(node, ctx); + case "ConditionalExpression": + return reduceConExpr(node, ctx); + case "BinaryExpression": + return reduceBinExpr(node, ctx); + case "UnaryExpression": + return reduceUnExpr(node, ctx); + case "CallExpression": + return reduceCallExpr(node, ctx); + case "NewExpression": + return reduceNewExpr(node, ctx); + case "ArrayExpression": + return reduceArrExpr(node, ctx); + case "ThisExpression": + return ctx; + case "Identifier": + return resolveIdentifier(node.name, ctx); + case "Literal": + return node.value; + default: + throw SyntaxError("Unexpected node"); + } + } + function reduceProgram(node, ctx) { + if (node.body.length !== 1) { + throw SyntaxError("Too complex expression"); + } + return reduce2(node.body[0], ctx); + } + function reduceMemExpr(node, ctx) { + const value2 = reduce2(node.object, ctx); + const key = node.property.type === "Identifier" ? node.property.name : reduce2(node.property, ctx); + if (typeof value2[key] === "function") { + return value2[key].bind(value2); + } + return value2[key]; + } + function reduceCallExpr(node, ctx) { + return Reflect.apply( + reduce2(node.callee, ctx), + null, + node.arguments.map((arg) => reduce2(arg, ctx)) + ); + } + function reduceNewExpr(node, ctx) { + return Reflect.construct( + reduce2(node.callee, ctx), + node.arguments.map((arg) => reduce2(arg, ctx)) + ); + } + function reduceUnExpr(node, ctx) { + if (!node.prefix || node.argument.type === "UnaryExpression") { + throw SyntaxError("Unexpected operator"); + } + return Function("v", `return ${node.operator}v`)(reduce2(node.argument, ctx)); + } + function reduceConExpr(node, ctx) { + return Function("t, c, a", `return t ? c : a`)( + reduce2(node.test, ctx), + reduce2(node.consequent, ctx), + reduce2(node.alternate, ctx) + ); + } + function reduceBinExpr(node, ctx) { + return evalLhsRhs(node, ctx); + } + function reduceLogExpr(node, ctx) { + return evalLhsRhs(node, ctx); + } + function reduceArrExpr(node, ctx) { + return node.elements.map((el) => reduce2(el, ctx)); + } + function evalLhsRhs(node, ctx) { + return Function("lhs, rhs", `return lhs ${node.operator} rhs`)( + reduce2(node.left, ctx), + reduce2(node.right, ctx) + ); + } + function resolveIdentifier(name2, ctx) { + if (ctx === void 0 || !(name2 in ctx)) { + throw ReferenceError(`${name2} is not defined`); + } + return Reflect.get(ctx, name2, ctx); + } + exports28.default = reduce2; + } +}); + +// node_modules/simple-eval/dist/index.js +var require_dist8 = __commonJS({ + "node_modules/simple-eval/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var jsep2 = require_jsep_cjs(); + var reduce2 = require_reduce(); + function _interopDefaultLegacy(e10) { + return e10 && typeof e10 === "object" && "default" in e10 ? e10 : { "default": e10 }; + } + var jsep__default = /* @__PURE__ */ _interopDefaultLegacy(jsep2); + function parse17(expr) { + try { + return jsep__default["default"](expr); + } catch (ex) { + throw SyntaxError(ex.message); + } + } + var index4 = (expr, ctx) => { + const tree = typeof expr === "object" ? expr : parse17(expr); + return reduce2["default"](tree, Object.freeze(ctx)); + }; + exports28.default = index4; + } +}); + +// node_modules/@stoplight/spectral-core/dist/utils/replacer.js +var require_replacer = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/utils/replacer.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Replacer = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var simple_eval_1 = (0, tslib_1.__importDefault)(require_dist8()); + var Replacer = class { + constructor(count2) { + this.regex = new RegExp(`#?${"{".repeat(count2)}([^} +]+)${"}".repeat(count2)}`, "g"); + this.functions = {}; + } + addFunction(name2, filter2) { + this.functions[name2] = filter2; + } + print(input, values2) { + return input.replace(this.regex, (substr, identifier, index4) => { + const shouldEvaluate = input[index4] === "#"; + if (shouldEvaluate) { + return String((0, simple_eval_1.default)(identifier, { + ...Object.entries(this.functions).reduce((fns, [name2, fn]) => { + fns[name2] = fn.bind(values2); + return fns; + }, {}), + ...values2 + })); + } + if (!(identifier in values2)) { + return ""; + } + return String(values2[identifier]); + }); + } + }; + exports28.Replacer = Replacer; + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/utils/message.js +var require_message = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/utils/message.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.message = void 0; + var spectral_runtime_1 = require_dist6(); + var replacer_1 = require_replacer(); + var MessageReplacer = new replacer_1.Replacer(2); + MessageReplacer.addFunction("print", function(type3) { + if (typeof type3 !== "string") + return ""; + const { property: property2, value: value2 } = this; + switch (type3) { + case "property": + if (property2 !== void 0 && property2 !== "") { + return `"${property2}" property `; + } + return `The document `; + case "value": + return (0, spectral_runtime_1.printValue)(value2); + default: + if (type3 in this && this[type3] !== null) { + return String(this[type3]); + } + return ""; + } + }); + exports28.message = MessageReplacer.print.bind(MessageReplacer); + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/utils/index.js +var require_utils7 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/utils/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + (0, tslib_1.__exportStar)(require_getLintTargets(), exports28); + (0, tslib_1.__exportStar)(require_message(), exports28); + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/lintNode.js +var require_lintNode = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/lintNode.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.lintNode = void 0; + var spectral_runtime_1 = require_dist6(); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var pony_cause_1 = require_pony_cause(); + var document_1 = require_document(); + var utils_1 = require_utils7(); + var lintNode = (context2, node, rule) => { + var _a2; + const givenPath = node.path.length > 0 && node.path[0] === "$" ? node.path.slice(1) : node.path.slice(); + const fnContext = { + document: context2.documentInventory.document, + documentInventory: context2.documentInventory, + rule, + path: givenPath + }; + for (const then of rule.then) { + const targets = (0, utils_1.getLintTargets)(node.value, then.field); + for (const target of targets) { + if (target.path.length > 0) { + fnContext.path = [...givenPath, ...target.path]; + } else { + fnContext.path = givenPath; + } + let targetResults; + try { + targetResults = then.function(target.value, (_a2 = then.functionOptions) !== null && _a2 !== void 0 ? _a2 : null, fnContext); + } catch (e10) { + throw new pony_cause_1.ErrorWithCause(`Function "${then.function.name}" threw an exception${(0, lodash_1.isError)(e10) ? `: ${e10.message}` : ""}`, { + cause: e10 + }); + } + if (targetResults === void 0) + continue; + if ("then" in targetResults) { + const _fnContext = { ...fnContext }; + context2.promises.push(targetResults.then((results) => results === void 0 ? void 0 : processTargetResults(context2, _fnContext, results))); + } else { + processTargetResults(context2, fnContext, targetResults); + } + } + } + }; + exports28.lintNode = lintNode; + function processTargetResults(context2, fnContext, results) { + var _a2, _b, _c, _d, _e2; + const { rule, path: targetPath } = fnContext; + for (const result2 of results) { + const escapedJsonPath = ((_a2 = result2.path) !== null && _a2 !== void 0 ? _a2 : targetPath).map(spectral_runtime_1.decodeSegmentFragment); + const associatedItem = context2.documentInventory.findAssociatedItemForPath(escapedJsonPath, rule.resolved); + const path2 = (_b = associatedItem === null || associatedItem === void 0 ? void 0 : associatedItem.path) !== null && _b !== void 0 ? _b : (0, spectral_runtime_1.getClosestJsonPath)(context2.documentInventory.resolved, escapedJsonPath); + const source = associatedItem === null || associatedItem === void 0 ? void 0 : associatedItem.document.source; + const document2 = (_c = associatedItem === null || associatedItem === void 0 ? void 0 : associatedItem.document) !== null && _c !== void 0 ? _c : context2.documentInventory.document; + const range2 = (_d = document2.getRangeForJsonPath(path2, true)) !== null && _d !== void 0 ? _d : document_1.Document.DEFAULT_RANGE; + const value2 = path2.length === 0 ? document2.data : (0, lodash_1.get)(document2.data, path2); + const vars = { + property: (associatedItem === null || associatedItem === void 0 ? void 0 : associatedItem.missingPropertyPath) !== void 0 && associatedItem.missingPropertyPath.length > path2.length ? (0, spectral_runtime_1.printPath)(associatedItem.missingPropertyPath.slice(path2.length - 1), spectral_runtime_1.PrintStyle.Dot) : path2.length > 0 ? path2[path2.length - 1] : "", + error: result2.message, + path: (0, spectral_runtime_1.printPath)(path2, spectral_runtime_1.PrintStyle.EscapedPointer), + description: rule.description, + value: value2 + }; + const resultMessage = (0, utils_1.message)(result2.message, vars); + vars.error = resultMessage; + const severity = source !== null && source !== void 0 ? rule.getSeverityForSource(source, path2) : rule.severity; + if (severity === -1) + continue; + context2.results.push({ + code: rule.name, + message: (rule.message === null ? (_e2 = rule.description) !== null && _e2 !== void 0 ? _e2 : resultMessage : (0, utils_1.message)(rule.message, vars)).trim(), + path: path2, + severity, + ...source !== null ? { source } : null, + range: range2 + }); + } + } + } +}); + +// node_modules/nimma/dist/legacy/cjs/_virtual/_rollupPluginBabelHelpers.js +var require_rollupPluginBabelHelpers = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/_virtual/_rollupPluginBabelHelpers.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function _defineProperty(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _classPrivateFieldGet(receiver, privateMap) { + var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); + return _classApplyDescriptorGet(receiver, descriptor); + } + function _classPrivateFieldSet(receiver, privateMap, value2) { + var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); + _classApplyDescriptorSet(receiver, descriptor, value2); + return value2; + } + function _classExtractFieldDescriptor(receiver, privateMap, action) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to " + action + " private field on non-instance"); + } + return privateMap.get(receiver); + } + function _classApplyDescriptorGet(receiver, descriptor) { + if (descriptor.get) { + return descriptor.get.call(receiver); + } + return descriptor.value; + } + function _classApplyDescriptorSet(receiver, descriptor, value2) { + if (descriptor.set) { + descriptor.set.call(receiver, value2); + } else { + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + descriptor.value = value2; + } + } + exports28.classApplyDescriptorGet = _classApplyDescriptorGet; + exports28.classApplyDescriptorSet = _classApplyDescriptorSet; + exports28.classExtractFieldDescriptor = _classExtractFieldDescriptor; + exports28.classPrivateFieldGet = _classPrivateFieldGet; + exports28.classPrivateFieldSet = _classPrivateFieldSet; + exports28.defineProperty = _defineProperty; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/ast/builders.js +var require_builders = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/ast/builders.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function program(body) { + return { + type: "Program", + body + }; + } + function blockStatement(body, directives) { + return { + type: "BlockStatement", + body, + directives + }; + } + function expressionStatement(expression) { + return { + type: "ExpressionStatement", + expression + }; + } + function literal(value2) { + switch (typeof value2) { + case "number": + return numericLiteral(value2); + case "string": + return stringLiteral(value2); + case "boolean": + return booleanLiteral(value2); + } + } + function stringLiteral(value2) { + return { + type: "StringLiteral", + value: value2 + }; + } + function booleanLiteral(value2) { + return { + type: "BooleanLiteral", + value: value2 + }; + } + function numericLiteral(value2) { + return { + type: "NumericLiteral", + value: value2 + }; + } + function nullLiteral() { + return { + type: "NullLiteral", + value: null + }; + } + function regExpLiteral(pattern5, flags = "") { + return { + type: "RegExpLiteral", + pattern: pattern5, + flags + }; + } + function identifier(name2) { + return { + type: "Identifier", + name: name2 + }; + } + function logicalExpression(operator, left, right) { + return { + type: "LogicalExpression", + operator, + left, + right + }; + } + function conditionalExpression(test, consequent, alternate) { + return { + type: "ConditionalExpression", + test, + consequent, + alternate + }; + } + function ifStatement(test, consequent, alternate) { + return { + type: "IfStatement", + test, + consequent, + alternate + }; + } + function binaryExpression(operator, left, right) { + return { + type: "BinaryExpression", + operator, + left, + right + }; + } + function safeBinaryExpression(operator, left, right) { + let actualRight = right; + if (right.type === "NumericLiteral") { + actualRight = stringLiteral(String(right.value)); + } else if (right.type === "StringLiteral" && Number.isSafeInteger(Number(right.value))) { + actualRight = stringLiteral(String(right.value)); + } + return { + type: "BinaryExpression", + operator, + left: actualRight === right ? left : callExpression(identifier("String"), [left]), + right: actualRight + }; + } + function unaryExpression(operator, argument, prefix = true) { + return { + type: "UnaryExpression", + operator, + argument, + prefix + }; + } + function memberExpression(object, property2, computed = false, optional = null) { + return { + type: "MemberExpression", + object, + property: property2, + computed, + optional + }; + } + function assignmentExpression(operator, left, right) { + return { + type: "AssignmentExpression", + operator, + left, + right + }; + } + function callExpression(callee, _arguments) { + return { + type: "CallExpression", + callee, + arguments: _arguments + }; + } + function functionDeclaration(id, params, body) { + return { + type: "FunctionDeclaration", + id, + params, + body + }; + } + function returnStatement(argument) { + return { + type: "ReturnStatement", + argument + }; + } + function sequenceExpression(expressions) { + return { + type: "SequenceExpression", + expressions + }; + } + function forOfStatement(left, right, body, _await) { + return { + type: "ForOfStatement", + left, + right, + body, + await: _await + }; + } + function arrayExpression(elements) { + return { + type: "ArrayExpression", + elements + }; + } + function objectExpression(properties) { + return { + type: "ObjectExpression", + properties + }; + } + function objectMethod(kind, key, params, body, computed = false, generator = false, _async = false) { + return { + type: "ObjectMethod", + kind, + key, + params, + body, + computed, + generator, + async: _async + }; + } + function objectProperty(key, value2, computed = false, shorthand = false, decorators = null) { + return { + type: "ObjectProperty", + key, + value: value2, + computed, + shorthand, + decorators + }; + } + function variableDeclaration(kind, declarations) { + return { + type: "VariableDeclaration", + kind, + declarations + }; + } + function variableDeclarator(id, init2) { + return { + type: "VariableDeclarator", + id, + init: init2 + }; + } + function newExpression(callee, _arguments) { + return { + type: "NewExpression", + callee, + arguments: _arguments + }; + } + function importDeclaration(specifiers, source) { + return { + type: "ImportDeclaration", + specifiers, + source + }; + } + function importSpecifier(local, imported) { + return { + type: "ImportSpecifier", + local, + imported + }; + } + function exportDefaultDeclaration(declaration) { + return { + type: "ExportDefaultDeclaration", + declaration + }; + } + function arrowFunctionExpression(params, body, _async = false) { + return { + type: "ArrowFunctionExpression", + params, + body, + async: _async + }; + } + function tryStatement(block, handler = null, finalizer = null) { + return { + type: "TryStatement", + block, + handler, + finalizer + }; + } + function templateElement(value2, tail2 = false) { + return { + type: "TemplateElement", + value: value2, + tail: tail2 + }; + } + function templateLiteral(quasis, expressions) { + return { + type: "TemplateLiteral", + quasis, + expressions + }; + } + exports28.arrayExpression = arrayExpression; + exports28.arrowFunctionExpression = arrowFunctionExpression; + exports28.assignmentExpression = assignmentExpression; + exports28.binaryExpression = binaryExpression; + exports28.blockStatement = blockStatement; + exports28.booleanLiteral = booleanLiteral; + exports28.callExpression = callExpression; + exports28.conditionalExpression = conditionalExpression; + exports28.exportDefaultDeclaration = exportDefaultDeclaration; + exports28.expressionStatement = expressionStatement; + exports28.forOfStatement = forOfStatement; + exports28.functionDeclaration = functionDeclaration; + exports28.identifier = identifier; + exports28.ifStatement = ifStatement; + exports28.importDeclaration = importDeclaration; + exports28.importSpecifier = importSpecifier; + exports28.literal = literal; + exports28.logicalExpression = logicalExpression; + exports28.memberExpression = memberExpression; + exports28.newExpression = newExpression; + exports28.nullLiteral = nullLiteral; + exports28.numericLiteral = numericLiteral; + exports28.objectExpression = objectExpression; + exports28.objectMethod = objectMethod; + exports28.objectProperty = objectProperty; + exports28.program = program; + exports28.regExpLiteral = regExpLiteral; + exports28.returnStatement = returnStatement; + exports28.safeBinaryExpression = safeBinaryExpression; + exports28.sequenceExpression = sequenceExpression; + exports28.stringLiteral = stringLiteral; + exports28.templateElement = templateElement; + exports28.templateLiteral = templateLiteral; + exports28.tryStatement = tryStatement; + exports28.unaryExpression = unaryExpression; + exports28.variableDeclaration = variableDeclaration; + exports28.variableDeclarator = variableDeclarator; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/scope.js +var require_scope2 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/scope.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var SCOPE_IDENTIFIER = builders.identifier("scope"); + var scope = { + _: SCOPE_IDENTIFIER, + bail: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("bail")), + callbacks: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("callbacks")), + depth: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("depth")), + destroy: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("destroy")), + emit: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("emit")), + fork: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("fork")), + path: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("path")), + property: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("property")), + sandbox: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("sandbox")), + traverse: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("traverse")), + value: builders.memberExpression(SCOPE_IDENTIFIER, builders.identifier("value")) + }; + exports28["default"] = scope; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/emit-call.js +var require_emit_call = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/emit-call.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var scope = require_scope2(); + function generateEmitCall(id, { + parents, + keyed + }) { + return builders.expressionStatement(builders.callExpression(scope["default"].emit, [builders.stringLiteral(id), builders.numericLiteral(parents), builders.booleanLiteral(keyed)])); + } + exports28["default"] = generateEmitCall; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/sandbox.js +var require_sandbox = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/sandbox.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var scope = require_scope2(); + var sandbox = { + at: builders.memberExpression(scope["default"].sandbox, builders.identifier("at")), + index: builders.memberExpression(scope["default"].sandbox, builders.identifier("index")), + parent: builders.memberExpression(scope["default"].sandbox, builders.identifier("parent")), + parentProperty: builders.memberExpression(scope["default"].sandbox, builders.identifier("parentProperty")), + parentValue: builders.memberExpression(scope["default"].sandbox, builders.identifier("parentValue")), + path: builders.memberExpression(scope["default"].sandbox, builders.identifier("path")), + property: builders.memberExpression(scope["default"].sandbox, builders.identifier("property")), + root: builders.memberExpression(scope["default"].sandbox, builders.identifier("root")), + value: builders.memberExpression(scope["default"].sandbox, builders.identifier("value")) + }; + exports28["default"] = sandbox; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/all-parents.js +var require_all_parents = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/all-parents.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var emitCall = require_emit_call(); + var sandbox = require_sandbox(); + var IS_OBJECT_IDENTIFIER = builders.identifier("isObject"); + var IS_NOT_OBJECT_IF_STATEMENT = builders.ifStatement(builders.unaryExpression("!", builders.callExpression(IS_OBJECT_IDENTIFIER, [sandbox["default"].value])), builders.returnStatement()); + var EMIT_ROOT_CALL_EXPRESSION = emitCall["default"]("$..", { + keyed: false, + parents: 0 + }); + var allParents = (nodes, tree, ctx) => { + if (nodes.length !== 1 || nodes[0].type !== "AllParentExpression") { + return false; + } + tree.addRuntimeDependency(IS_OBJECT_IDENTIFIER.name); + tree.push(builders.blockStatement([IS_NOT_OBJECT_IF_STATEMENT, emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"); + tree.push(builders.stringLiteral(ctx.id), "traverse"); + tree.push(EMIT_ROOT_CALL_EXPRESSION, "body"); + return true; + }; + exports28["default"] = allParents; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/guards.js +var require_guards = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/guards.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function isMemberExpression(node) { + return node.type === "MemberExpression"; + } + function isScriptFilterExpression(node) { + return node.type === "ScriptFilterExpression"; + } + function isModifierExpression(node) { + return node.type === "KeyExpression" || node.type === "ParentExpression"; + } + function isWildcardExpression(node) { + return node.type === "WildcardExpression"; + } + function isDeep(node) { + return node.deep; + } + exports28.isDeep = isDeep; + exports28.isMemberExpression = isMemberExpression; + exports28.isModifierExpression = isModifierExpression; + exports28.isScriptFilterExpression = isScriptFilterExpression; + exports28.isWildcardExpression = isWildcardExpression; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/deep-single-member.js +var require_deep_single_member = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/deep-single-member.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var guards = require_guards(); + var emitCall = require_emit_call(); + var scope = require_scope2(); + var deepSingleMember = (nodes, tree, ctx) => { + if (nodes.length !== 1 || !guards.isDeep(nodes[0]) || !guards.isMemberExpression(nodes[0])) { + return false; + } + tree.push(builders.blockStatement([builders.ifStatement(builders.safeBinaryExpression("!==", scope["default"].property, builders.stringLiteral(nodes[0].value)), builders.returnStatement()), emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"); + tree.push(builders.stringLiteral(ctx.id), "traverse"); + return true; + }; + exports28["default"] = deepSingleMember; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/deep-wildcard.js +var require_deep_wildcard = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/deep-wildcard.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var guards = require_guards(); + var emitCall = require_emit_call(); + var deepWildcard = (nodes, tree, ctx) => { + if (nodes.length !== 1 || !guards.isWildcardExpression(nodes[0]) || !guards.isDeep(nodes[0])) { + return false; + } + tree.push(builders.blockStatement([emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"); + tree.push(builders.stringLiteral(ctx.id), "traverse"); + return true; + }; + exports28["default"] = deepWildcard; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/fn-params.js +var require_fn_params = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/fn-params.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var scope = require_scope2(); + var fnParams = [scope["default"]._]; + exports28["default"] = fnParams; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/internal-scope.js +var require_internal_scope = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/internal-scope.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var internalScope = { + pos: builders.identifier("pos"), + shorthands: builders.identifier("shorthands"), + tree: builders.identifier("tree") + }; + exports28["default"] = internalScope; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/tree-method-call.js +var require_tree_method_call = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/tree-method-call.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var fnParams = require_fn_params(); + var internalScope = require_internal_scope(); + function treeMethodCall(id) { + const property2 = builders.stringLiteral(id); + return builders.expressionStatement(builders.callExpression(builders.memberExpression(internalScope["default"].tree, property2, true), fnParams["default"])); + } + exports28["default"] = treeMethodCall; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/fixed.js +var require_fixed = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/fixed.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var guards = require_guards(); + var emitCall = require_emit_call(); + var sandbox = require_sandbox(); + var scope = require_scope2(); + var treeMethodCall = require_tree_method_call(); + var VALUE_IDENTIFIER = builders.identifier("value"); + var IS_OBJECT_IDENTIFIER = builders.identifier("isObject"); + var GET_IDENTIFIER = builders.identifier("get"); + var IS_NOT_OBJECT_IF_STATEMENT = builders.ifStatement(builders.unaryExpression("!", builders.callExpression(IS_OBJECT_IDENTIFIER, [VALUE_IDENTIFIER])), builders.returnStatement()); + var IS_NULL_SCOPE_IF_STATEMENT = builders.ifStatement(builders.binaryExpression("===", scope["default"]._, builders.nullLiteral()), builders.returnStatement()); + function toLiteral(node) { + return builders.literal(node.value); + } + var fixed = (nodes, tree, ctx) => { + if (!nodes.every(guards.isMemberExpression) || nodes.some(guards.isDeep)) { + return false; + } + const valueVariableDeclaration = builders.variableDeclaration("const", [builders.variableDeclarator(VALUE_IDENTIFIER, nodes.slice(0, -1).reduce((object, node) => { + if (tree.format === "ES2018") { + object.arguments[1].elements.push(builders.literal(node.value)); + return object; + } + return builders.memberExpression(object, builders.literal(node.value), true, true); + }, tree.format === "ES2018" && nodes.length > 0 ? builders.callExpression(builders.identifier("get"), [sandbox["default"].root, builders.arrayExpression([])]) : sandbox["default"].root))]); + tree.addRuntimeDependency(IS_OBJECT_IDENTIFIER.name); + if (tree.format === "ES2018") { + tree.addRuntimeDependency(GET_IDENTIFIER.name); + } + tree.pushAll([[builders.blockStatement([valueVariableDeclaration, IS_NOT_OBJECT_IF_STATEMENT, builders.expressionStatement(builders.assignmentExpression("=", scope["default"]._, builders.callExpression(scope["default"].fork, [builders.arrayExpression(nodes.map(toLiteral))]))), IS_NULL_SCOPE_IF_STATEMENT, emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"], [treeMethodCall["default"](ctx.id), "body"]]); + return true; + }; + exports28["default"] = fixed; + } +}); + +// node_modules/@jsep-plugin/regex/dist/index.js +var dist_exports2 = {}; +__export(dist_exports2, { + default: () => index2 +}); +var FSLASH_CODE2, BSLASH_CODE2, index2; +var init_dist3 = __esm({ + "node_modules/@jsep-plugin/regex/dist/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + FSLASH_CODE2 = 47; + BSLASH_CODE2 = 92; + index2 = { + name: "regex", + init(jsep2) { + jsep2.hooks.add("gobble-token", function gobbleRegexLiteral(env3) { + if (this.code === FSLASH_CODE2) { + const patternIndex = ++this.index; + let inCharSet = false; + while (this.index < this.expr.length) { + if (this.code === FSLASH_CODE2 && !inCharSet) { + const pattern5 = this.expr.slice(patternIndex, this.index); + let flags = ""; + while (++this.index < this.expr.length) { + const code = this.code; + if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57) { + flags += this.char; + } else { + break; + } + } + let value2; + try { + value2 = new RegExp(pattern5, flags); + } catch (e10) { + this.throwError(e10.message); + } + env3.node = { + type: jsep2.LITERAL, + value: value2, + raw: this.expr.slice(patternIndex - 1, this.index) + }; + env3.node = this.gobbleTokenProperty(env3.node); + return env3.node; + } + if (this.code === jsep2.OBRACK_CODE) { + inCharSet = true; + } else if (inCharSet && this.code === jsep2.CBRACK_CODE) { + inCharSet = false; + } + this.index += this.code === BSLASH_CODE2 ? 2 : 1; + } + this.throwError("Unclosed Regex"); + } + }); + } + }; + } +}); + +// node_modules/@jsep-plugin/ternary/dist/index.js +var dist_exports3 = {}; +__export(dist_exports3, { + default: () => index3 +}); +var CONDITIONAL_EXP2, index3; +var init_dist4 = __esm({ + "node_modules/@jsep-plugin/ternary/dist/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + CONDITIONAL_EXP2 = "ConditionalExpression"; + index3 = { + name: "ternary", + init(jsep2) { + jsep2.hooks.add("after-expression", function gobbleTernary(env3) { + if (env3.node && this.code === jsep2.QUMARK_CODE) { + this.index++; + const test = env3.node; + const consequent = this.gobbleExpression(); + if (!consequent) { + this.throwError("Expected expression"); + } + this.gobbleSpaces(); + if (this.code === jsep2.COLON_CODE) { + this.index++; + const alternate = this.gobbleExpression(); + if (!alternate) { + this.throwError("Expected expression"); + } + env3.node = { + type: CONDITIONAL_EXP2, + test, + consequent, + alternate + }; + if (test.operator && jsep2.binary_ops[test.operator] <= 0.9) { + let newTest = test; + while (newTest.right.operator && jsep2.binary_ops[newTest.right.operator] <= 0.9) { + newTest = newTest.right; + } + env3.node.test = newTest.right; + newTest.right = env3.node; + env3.node = test; + } + } else { + this.throwError("Expected :"); + } + } + }); + } + }; + } +}); + +// node_modules/nimma/dist/legacy/cjs/parser/jsep.js +var require_jsep = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/parser/jsep.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var regex = (init_dist3(), __toCommonJS(dist_exports2)); + var ternary2 = (init_dist4(), __toCommonJS(dist_exports3)); + var Jsep2 = require_jsep_cjs(); + function _interopDefaultLegacy(e10) { + return e10 && typeof e10 === "object" && "default" in e10 ? e10 : { "default": e10 }; + } + var regex__default = /* @__PURE__ */ _interopDefaultLegacy(regex); + var ternary__default = /* @__PURE__ */ _interopDefaultLegacy(ternary2); + var Jsep__default = /* @__PURE__ */ _interopDefaultLegacy(Jsep2); + Jsep__default["default"].addIdentifierChar("@"); + Jsep__default["default"].addUnaryOp("void"); + Jsep__default["default"].addBinaryOp("in", 12); + Jsep__default["default"].addBinaryOp("~=", 20); + Jsep__default["default"].plugins.register(regex__default["default"], ternary__default["default"]); + var jsep2 = (expr) => Jsep__default["default"].parse(expr); + exports28["default"] = jsep2; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/baseline/generators.js +var require_generators = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/baseline/generators.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var jsep2 = require_jsep(); + var builders = require_builders(); + var internalScope = require_internal_scope(); + var sandbox = require_sandbox(); + var scope = require_scope2(); + function generateMemberExpression(iterator, { + deep, + value: value2 + }) { + if (iterator.feedback.bailed) { + return builders.safeBinaryExpression("!==", scope["default"].property, builders.literal(value2)); + } + if (iterator.state.inverted) { + return builders.safeBinaryExpression("!==", iterator.state.pos === 0 ? scope["default"].property : builders.memberExpression(scope["default"].path, builders.binaryExpression("-", scope["default"].depth, builders.numericLiteral(Math.abs(iterator.state.pos))), true), builders.literal(value2)); + } + if (deep) { + var _iterator$feedback; + const isLastNode = iterator.nextNode === null || iterator.nextNode === "KeyExpression"; + (_iterator$feedback = iterator.feedback).mutatesPos || (_iterator$feedback.mutatesPos = !isLastNode); + const right2 = builders.sequenceExpression([builders.assignmentExpression("=", internalScope["default"].pos, isLastNode ? builders.conditionalExpression(builders.safeBinaryExpression("!==", scope["default"].property, builders.literal(value2)), builders.numericLiteral(-1), scope["default"].depth) : builders.callExpression(builders.memberExpression(scope["default"].path, builders.identifier("indexOf")), [builders.literal(value2), iterator.state.pos === 0 ? internalScope["default"].pos : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(1))])), builders.binaryExpression("===", internalScope["default"].pos, builders.numericLiteral(-1))]); + if (isLastNode) { + return builders.logicalExpression("||", builders.binaryExpression("<", scope["default"].depth, iterator.state.pos === 0 ? internalScope["default"].pos : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator.state.pos))), right2); + } + return right2; + } + let left; + if (!iterator.feedback.fixed && iterator.state.absolutePos !== 0) { + left = builders.binaryExpression("<", scope["default"].depth, iterator.state.pos === 0 ? internalScope["default"].pos : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator.state.pos))); + } + const right = builders.safeBinaryExpression("!==", builders.memberExpression(scope["default"].path, iterator.state.pos === 0 ? builders.numericLiteral(0) : iterator.feedback.fixed ? builders.numericLiteral(iterator.state.pos) : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator.state.pos)), true), builders.literal(value2)); + return left !== void 0 ? builders.logicalExpression("||", left, right) : right; + } + function generateMultipleMemberExpression(iterator, node) { + return node.value.slice(1).reduce((concat2, member) => builders.logicalExpression("&&", concat2, generateMemberExpression(iterator, { + type: "MemberExpression", + value: member, + // eslint-disable-next-line sort-keys + deep: node.deep + })), generateMemberExpression(iterator, { + type: "MemberExpression", + value: node.value[0], + // eslint-disable-next-line sort-keys + deep: node.deep + })); + } + var IN_BOUNDS_IDENTIFIER = builders.identifier("inBounds"); + function generateSliceExpression(iterator, node, tree) { + const member = iterator.state.inverted ? builders.binaryExpression("-", scope["default"].depth, builders.numericLiteral(iterator.state.pos)) : iterator.state.pos === 0 ? builders.numericLiteral(0) : iterator.feedback.fixed ? builders.numericLiteral(iterator.state.pos) : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator.state.pos)); + const path2 = iterator.feedback.bailed ? scope["default"].property : builders.memberExpression(scope["default"].path, member, true); + const isNumberBinaryExpression = builders.binaryExpression("!==", builders.unaryExpression("typeof", path2), builders.stringLiteral("number")); + const hasNegativeIndex = node.value.some((value2) => Number.isFinite(value2) && value2 < 0); + if (hasNegativeIndex) { + tree.addRuntimeDependency(IN_BOUNDS_IDENTIFIER.name); + return builders.binaryExpression("||", isNumberBinaryExpression, builders.unaryExpression("!", builders.callExpression(IN_BOUNDS_IDENTIFIER, [iterator.state.absolutePos === 0 ? remapSandbox(sandbox["default"].value, iterator.state.absolutePos - 2) : remapSandbox(sandbox["default"].value, iterator.state.absolutePos), builders.memberExpression(scope["default"].path, iterator.feedback.bailed ? builders.binaryExpression("-", builders.memberExpression(scope["default"].path, builders.identifier("length")), builders.numericLiteral(1)) : member, true), ...node.value.map((value2) => builders.numericLiteral(value2))]))); + } + return node.value.reduce((merged, value2, i7) => { + if (i7 === 0 && value2 === 0) { + return merged; + } + if (i7 === 1 && !Number.isFinite(value2)) { + return merged; + } + if (i7 === 2 && value2 === 1) { + return merged; + } + const operator = i7 === 0 ? "<" : i7 === 1 ? ">=" : "%"; + const expression = builders.binaryExpression(operator, path2, builders.numericLiteral(Number(value2))); + return builders.logicalExpression("||", merged, operator === "%" ? builders.logicalExpression("&&", builders.binaryExpression("!==", path2, builders.numericLiteral(node.value[0])), builders.binaryExpression("!==", expression, builders.numericLiteral(node.value[0]))) : expression); + }, isNumberBinaryExpression); + } + function generateWildcardExpression(iterator) { + if (iterator.feedback.bailed) { + return builders.booleanLiteral(false); + } else if (iterator.nextNode === null && !iterator.feedback.fixed) { + return builders.sequenceExpression([builders.assignmentExpression("=", internalScope["default"].pos, builders.conditionalExpression(builders.binaryExpression("<", scope["default"].depth, builders.numericLiteral(iterator.state.pos)), builders.numericLiteral(-1), scope["default"].depth)), builders.binaryExpression("===", internalScope["default"].pos, builders.numericLiteral(-1))]); + } else { + return null; + } + } + function generateFilterScriptExpression(iterator, { + deep, + value: value2 + }, tree) { + var _iterator$feedback2; + const esTree = jsep2["default"](value2); + assertDefinedIdentifier(esTree); + const node = builders.unaryExpression("!", rewriteESTree(tree, esTree, iterator.state.fixed && iterator.state.pos > 0 && iterator.nextNode !== null ? iterator.state.pos + 1 : iterator.state.inverted && iterator.state.pos !== 0 ? iterator.state.pos - 1 : 0)); + if (iterator.feedback.bailed || !deep || iterator.state.inverted) + return node; + (_iterator$feedback2 = iterator.feedback).mutatesPos || (_iterator$feedback2.mutatesPos = iterator.nextNode !== null && iterator.nextNode !== "KeyExpression"); + const assignment = builders.sequenceExpression([builders.assignmentExpression("=", internalScope["default"].pos, builders.conditionalExpression(node, builders.numericLiteral(-1), scope["default"].depth)), builders.binaryExpression("===", internalScope["default"].pos, builders.numericLiteral(-1))]); + if (iterator.state.pos === 0) + return assignment; + return builders.logicalExpression("||", builders.binaryExpression("<", scope["default"].depth, iterator.state.pos === 0 ? internalScope["default"].pos : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator.state.pos))), assignment); + } + function rewriteESTree(tree, node, pos) { + switch (node.type) { + case "LogicalExpression": + case "BinaryExpression": + if (node.operator === "in") { + node.operator = "==="; + node.left = builders.callExpression(builders.memberExpression(node.right, builders.identifier("includes")), [rewriteESTree(tree, node.left, pos)]); + node.right = builders.booleanLiteral(true); + } else if (node.operator === "~=") { + node.operator = "==="; + if (node.right.type !== "Literal") { + throw SyntaxError("Expected string"); + } + node.left = builders.callExpression(builders.memberExpression(builders.regExpLiteral(node.right.value, ""), builders.identifier("test")), [rewriteESTree(tree, node.left, pos)]); + node.right = builders.booleanLiteral(true); + } else { + node.left = rewriteESTree(tree, node.left, pos); + node.right = rewriteESTree(tree, node.right, pos); + assertDefinedIdentifier(node.left); + assertDefinedIdentifier(node.right); + } + break; + case "UnaryExpression": + node.argument = rewriteESTree(tree, node.argument, pos); + assertDefinedIdentifier(node.argument); + return node; + case "MemberExpression": + node.object = rewriteESTree(tree, node.object, pos); + assertDefinedIdentifier(node.object); + node.property = rewriteESTree(tree, node.property, pos); + if (node.computed) { + assertDefinedIdentifier(node.property); + } + break; + case "CallExpression": + if (node.callee.type === "Identifier" && node.callee.name.startsWith("@")) { + return processAtIdentifier(tree, node.callee.name, pos); + } + node.callee = rewriteESTree(tree, node.callee, pos); + node.arguments = node.arguments.map((argument) => rewriteESTree(tree, argument, pos)); + if (node.callee.type === "MemberExpression" && node.callee.object === sandbox["default"].property && node.callee.property.name in String.prototype) { + node.callee.object = builders.callExpression(builders.identifier("String"), [node.callee.object]); + } + assertDefinedIdentifier(node.callee); + break; + case "Identifier": + if (node.name.startsWith("@")) { + return processAtIdentifier(tree, node.name, pos); + } + if (node.name === "undefined") { + return builders.unaryExpression("void", builders.numericLiteral(0)); + } + if (node.name === "index") { + return sandbox["default"].index; + } + break; + } + return node; + } + function processAtIdentifier(tree, name2, pos) { + switch (name2) { + case "@": + return remapSandbox(sandbox["default"].value, pos); + case "@root": + return remapSandbox(sandbox["default"].root, pos); + case "@path": + return remapSandbox(sandbox["default"].path, pos); + case "@property": + return remapSandbox(sandbox["default"].property, pos); + case "@parent": + return remapSandbox(sandbox["default"].parentValue, pos); + case "@parentProperty": + return remapSandbox(sandbox["default"].parentProperty, pos); + case "@string": + case "@number": + case "@boolean": + return builders.binaryExpression("===", builders.unaryExpression("typeof", remapSandbox(sandbox["default"].value, pos)), builders.stringLiteral(name2.slice(1))); + case "@scalar": + return builders.logicalExpression("||", builders.binaryExpression("===", remapSandbox(sandbox["default"].value, pos), builders.nullLiteral()), builders.binaryExpression("!==", builders.unaryExpression("typeof", remapSandbox(sandbox["default"].value, pos)), builders.stringLiteral("object"))); + case "@array": + return builders.callExpression(builders.memberExpression(builders.identifier("Array"), builders.identifier("isArray")), [remapSandbox(sandbox["default"].value, pos)]); + case "@null": + return builders.binaryExpression("===", remapSandbox(sandbox["default"].value, pos), builders.nullLiteral()); + case "@object": + return builders.logicalExpression("&&", builders.binaryExpression("!==", remapSandbox(sandbox["default"].value, pos), builders.nullLiteral()), builders.binaryExpression("===", builders.unaryExpression("typeof", remapSandbox(sandbox["default"].value, pos)), builders.stringLiteral("object"))); + case "@integer": + return builders.callExpression(builders.memberExpression(builders.identifier("Number"), builders.identifier("isInteger")), [remapSandbox(sandbox["default"].value, pos)]); + default: + if (name2.startsWith("@@")) { + const shorthandName = name2.slice(2); + tree.attachCustomShorthand(shorthandName); + return builders.callExpression(builders.memberExpression(internalScope["default"].shorthands, builders.identifier(shorthandName)), [scope["default"]._]); + } + throw new SyntaxError(`Unsupported shorthand '${name2}'`); + } + } + var KNOWN_IDENTIFIERS = [scope["default"]._.name, "index"]; + function assertDefinedIdentifier(node) { + if (node.type !== "Identifier") + return; + if (KNOWN_IDENTIFIERS.includes(node.name)) + return; + throw ReferenceError(`'${node.name}' is not defined`); + } + function remapSandbox(node, pos) { + if (node.type === "MemberExpression" && pos !== 0) { + return { + ...node, + object: builders.callExpression(sandbox["default"].at, [builders.numericLiteral(pos)]) + }; + } + return node; + } + exports28.generateFilterScriptExpression = generateFilterScriptExpression; + exports28.generateMemberExpression = generateMemberExpression; + exports28.generateMultipleMemberExpression = generateMultipleMemberExpression; + exports28.generateSliceExpression = generateSliceExpression; + exports28.generateWildcardExpression = generateWildcardExpression; + exports28.rewriteESTree = rewriteESTree; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/only-filter-script-expression.js +var require_only_filter_script_expression = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/only-filter-script-expression.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var jsep2 = require_jsep(); + var builders = require_builders(); + var generators = require_generators(); + var guards = require_guards(); + var emitCall = require_emit_call(); + var scope = require_scope2(); + var TOP_LEVEL_DEPTH_IF_STATEMENT = builders.ifStatement(builders.binaryExpression("!==", scope["default"].depth, builders.numericLiteral(0)), builders.returnStatement()); + var onlyFilterScriptExpression = (nodes, tree, ctx) => { + if (nodes.length !== 1 || !guards.isScriptFilterExpression(nodes[0])) { + return false; + } + const condition = builders.unaryExpression("!", generators.rewriteESTree(tree, jsep2["default"](nodes[0].value), 0), true); + tree.pushAll([[builders.blockStatement([...guards.isDeep(nodes[0]) ? [] : [TOP_LEVEL_DEPTH_IF_STATEMENT], builders.ifStatement(condition, builders.returnStatement()), emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"], [builders.stringLiteral(ctx.id), "traverse"]]); + if (!guards.isDeep(nodes[0])) { + var _tree$traversalZones$; + (_tree$traversalZones$ = tree.traversalZones.create()) === null || _tree$traversalZones$ === void 0 ? void 0 : _tree$traversalZones$.resize().attach(); + } + return true; + }; + exports28["default"] = onlyFilterScriptExpression; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/root.js +var require_root = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/root.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var emitCall = require_emit_call(); + var EMIT_ROOT_CALL_EXPRESSION = emitCall["default"]("$", { + keyed: false, + parents: 0 + }); + var root2 = (nodes, tree) => { + if (nodes.length > 0) { + return false; + } + tree.push(EMIT_ROOT_CALL_EXPRESSION, "body"); + return true; + }; + exports28["default"] = root2; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/top-level-wildcard.js +var require_top_level_wildcard = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/top-level-wildcard.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var guards = require_guards(); + var emitCall = require_emit_call(); + var scope = require_scope2(); + var IS_NOT_ZERO_DEPTH_IF_STATEMENT = builders.ifStatement(builders.binaryExpression("!==", scope["default"].depth, builders.numericLiteral(0)), builders.returnStatement()); + var topLevelWildcard = (nodes, tree, ctx) => { + var _tree$traversalZones$; + if (nodes.length !== 1 || !guards.isWildcardExpression(nodes[0]) || guards.isDeep(nodes[0])) { + return false; + } + tree.push(builders.blockStatement([IS_NOT_ZERO_DEPTH_IF_STATEMENT, emitCall["default"](ctx.id, ctx.iterator.modifiers)]), "tree-method"); + tree.push(builders.stringLiteral(ctx.id), "traverse"); + (_tree$traversalZones$ = tree.traversalZones.create()) === null || _tree$traversalZones$ === void 0 ? void 0 : _tree$traversalZones$.resize().attach(); + return true; + }; + exports28["default"] = topLevelWildcard; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/index.js +var require_fast_paths = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/fast-paths/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var allParents = require_all_parents(); + var deepSingleMember = require_deep_single_member(); + var deepWildcard = require_deep_wildcard(); + var fixed = require_fixed(); + var onlyFilterScriptExpression = require_only_filter_script_expression(); + var root2 = require_root(); + var topLevelWildcard = require_top_level_wildcard(); + var fastPaths = [root2["default"], onlyFilterScriptExpression["default"], deepSingleMember["default"], deepWildcard["default"], topLevelWildcard["default"], fixed["default"], allParents["default"]]; + exports28["default"] = fastPaths; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/iterator.js +var require_iterator = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/iterator.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var guards = require_guards(); + var _Symbol$iterator; + function isBailable(nodes) { + let deep = false; + for (let i7 = 0; i7 < nodes.length; i7++) { + const node = nodes[i7]; + if (!guards.isDeep(node)) + continue; + if (deep) { + return true; + } else if (guards.isMemberExpression(node)) { + i7++; + let hadFlatMemberExpressions = false; + let deepNodes = 1; + for (; i7 < nodes.length - 1; i7++) { + const node2 = nodes[i7]; + if (guards.isDeep(node2)) { + deepNodes++; + } else { + hadFlatMemberExpressions || (hadFlatMemberExpressions = guards.isMemberExpression(node2) || guards.isWildcardExpression(node2)); + continue; + } + if (guards.isMemberExpression(node2) || guards.isWildcardExpression(node2)) { + if (hadFlatMemberExpressions) + return true; + continue; + } + return true; + } + return guards.isDeep(nodes[nodes.length - 1]) ? hadFlatMemberExpressions || guards.isWildcardExpression(nodes[nodes.length - 1]) : deepNodes > 1; + } else { + deep = true; + } + } + return false; + } + var _i = /* @__PURE__ */ new WeakMap(); + _Symbol$iterator = Symbol.iterator; + var Iterator2 = class _Iterator { + constructor(nodes) { + _rollupPluginBabelHelpers.defineProperty(this, "nodes", void 0); + _i.set(this, { + writable: true, + value: void 0 + }); + this.modifiers = _Iterator.trim(nodes); + this.nodes = _Iterator.compact(nodes); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _i, -1); + this.feedback = _Iterator.analyze(this.nodes, this.modifiers.keyed || this.modifiers.parents > 0); + this.length = this.nodes.length; + this.state = { + absolutePos: -1, + fixed: true, + inverted: false, + pos: -1 + }; + if (this.feedback.fixed && this.modifiers.parents > this.length) { + this.length = -1; + } + } + get nextNode() { + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _i) + 1 < this.nodes.length ? this.nodes[_rollupPluginBabelHelpers.classPrivateFieldGet(this, _i) + 1] : null; + } + static compact(nodes) { + let marked; + for (let i7 = 0; i7 < nodes.length; i7++) { + if (guards.isWildcardExpression(nodes[i7]) && guards.isDeep(nodes[i7]) && i7 !== nodes.length - 1) { + var _marked; + ((_marked = marked) !== null && _marked !== void 0 ? _marked : marked = []).push(i7); + } + } + if (marked === void 0) { + return nodes; + } + const _nodes = nodes.slice(); + for (let i7 = 0; i7 < marked.length; i7++) { + _nodes[marked[i7] - i7 + 1].deep = true; + _nodes.splice(marked[i7] - i7, 1); + } + return _nodes; + } + static trim(nodes) { + const modifiers = { + keyed: false, + parents: 0 + }; + while (nodes.length > 0 && guards.isModifierExpression(nodes[nodes.length - 1])) { + switch (nodes.pop().type) { + case "KeyExpression": + modifiers.keyed = true; + modifiers.parents = 0; + break; + case "ParentExpression": + modifiers.parents++; + break; + } + } + return modifiers; + } + static analyze(nodes) { + const feedback = { + bailed: isBailable(nodes), + fixed: true, + inverseAt: -1 + }; + if (feedback.bailed) { + feedback.fixed = false; + return feedback; + } + let potentialInvertAtPoint = -1; + for (let i7 = 0; i7 < nodes.length; i7++) { + const node = nodes[i7]; + if (!guards.isDeep(node)) + continue; + feedback.fixed = false; + i7++; + potentialInvertAtPoint = i7 - 1; + for (; i7 < nodes.length; i7++) { + const nextNode = nodes[i7]; + if (guards.isDeep(nextNode)) { + potentialInvertAtPoint = -1; + } + } + } + if (nodes.length > 1 && potentialInvertAtPoint !== -1 && potentialInvertAtPoint < nodes.length - 1) { + feedback.inverseAt = potentialInvertAtPoint; + } + return feedback; + } + *[_Symbol$iterator]() { + if (this.feedback.bailed) { + return yield* this.nodes; + } + const { + ...feedback + } = this.feedback; + let order = 1; + const nodes = this.feedback.inverseAt !== -1 ? this.nodes.slice() : this.nodes; + for (let i7 = 0; i7 < nodes.length; i7++) { + if (this.feedback.inverseAt !== -1 && i7 === this.feedback.inverseAt) { + nodes.splice(0, i7); + nodes.reverse(); + this.state.pos = 1; + i7 = 0; + this.feedback.inverseAt = -1; + this.state.inverted = true; + order = -1; + } + const node = nodes[i7]; + this.state.pos += order; + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _i, +_rollupPluginBabelHelpers.classPrivateFieldGet(this, _i) + 1); + this.state.absolutePos++; + if (guards.isDeep(node)) { + this.state.fixed = false; + yield node; + this.state.pos = 0; + } else { + yield node; + } + } + Object.assign(this.feedback, { + ...feedback, + mutatesPos: this.feedback.mutatesPos + }); + } + }; + exports28["default"] = Iterator2; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/optimizer/index.js +var require_optimizer = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/optimizer/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var internalScope = require_internal_scope(); + var scope = require_scope2(); + function dropNode(branch, i7) { + branch.splice(i7, 1); + return i7 - 1; + } + function leftOrRight(node, left, right) { + if (left === null) { + return right; + } else if (right === null) { + return left; + } + node.left = left; + node.right = right; + return node; + } + function reduceBinaryExpression(node) { + if (node.operator === "<" && node.left === scope["default"].depth) { + return null; + } + return leftOrRight(node, eliminate(node.left), eliminate(node.right)); + } + function eliminate(node) { + switch (node.type) { + case "AssignmentExpression": + if (node.left !== internalScope["default"].pos) { + return node; + } + return eliminate(node.right); + case "ConditionalExpression": + if (node.consequent.type === "NumericLiteral" && node.consequent.value === -1) { + return eliminate(node.test); + } + return node; + case "SequenceExpression": + return eliminate(node.expressions[0]); + case "LogicalExpression": + return leftOrRight(node, eliminate(node.left), eliminate(node.right)); + case "BinaryExpression": + return reduceBinaryExpression(node); + case "IfStatement": + return eliminate(node.test); + case "Identifier": + if (node === internalScope["default"].pos) { + return null; + } + return node; + case "MemberExpression": + node.property = eliminate(node.property); + return node; + default: + return node; + } + } + function optimizer(branch, iterator) { + if (iterator.feedback.mutatesPos) + return; + let i7 = Math.max(0, Math.min(1, iterator.length)); + for (; i7 < branch.length; i7++) { + const node = branch[i7]; + if (node.type === "VariableDeclaration" && node.kind === "let" && node.declarations[0].id === internalScope["default"].pos) { + i7 = dropNode(branch, i7); + continue; + } + const test = eliminate(node); + if (test === null || test === scope["default"].depth) { + i7 = dropNode(branch, i7); + } else { + node.test = test; + } + } + } + exports28["default"] = optimizer; + } +}); + +// node_modules/astring/dist/astring.js +var require_astring = __commonJS({ + "node_modules/astring/dist/astring.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { + value: true + }); + exports28.generate = generate2; + exports28.baseGenerator = exports28.GENERATOR = exports28.EXPRESSIONS_PRECEDENCE = exports28.NEEDS_PARENTHESES = void 0; + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties3(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass3(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties3(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties3(Constructor, staticProps); + return Constructor; + } + var stringify5 = JSON.stringify; + if (!String.prototype.repeat) { + throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation"); + } + if (!String.prototype.endsWith) { + throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation"); + } + var OPERATOR_PRECEDENCE = { + "||": 2, + "??": 3, + "&&": 4, + "|": 5, + "^": 6, + "&": 7, + "==": 8, + "!=": 8, + "===": 8, + "!==": 8, + "<": 9, + ">": 9, + "<=": 9, + ">=": 9, + "in": 9, + "instanceof": 9, + "<<": 10, + ">>": 10, + ">>>": 10, + "+": 11, + "-": 11, + "*": 12, + "%": 12, + "/": 12, + "**": 13 + }; + var NEEDS_PARENTHESES = 17; + exports28.NEEDS_PARENTHESES = NEEDS_PARENTHESES; + var EXPRESSIONS_PRECEDENCE = { + ArrayExpression: 20, + TaggedTemplateExpression: 20, + ThisExpression: 20, + Identifier: 20, + PrivateIdentifier: 20, + Literal: 18, + TemplateLiteral: 20, + Super: 20, + SequenceExpression: 20, + MemberExpression: 19, + ChainExpression: 19, + CallExpression: 19, + NewExpression: 19, + ArrowFunctionExpression: NEEDS_PARENTHESES, + ClassExpression: NEEDS_PARENTHESES, + FunctionExpression: NEEDS_PARENTHESES, + ObjectExpression: NEEDS_PARENTHESES, + UpdateExpression: 16, + UnaryExpression: 15, + AwaitExpression: 15, + BinaryExpression: 14, + LogicalExpression: 13, + ConditionalExpression: 4, + AssignmentExpression: 3, + YieldExpression: 2, + RestElement: 1 + }; + exports28.EXPRESSIONS_PRECEDENCE = EXPRESSIONS_PRECEDENCE; + function formatSequence(state, nodes) { + var generator = state.generator; + state.write("("); + if (nodes != null && nodes.length > 0) { + generator[nodes[0].type](nodes[0], state); + var length = nodes.length; + for (var i7 = 1; i7 < length; i7++) { + var param = nodes[i7]; + state.write(", "); + generator[param.type](param, state); + } + } + state.write(")"); + } + function expressionNeedsParenthesis(state, node, parentNode, isRightHand) { + var nodePrecedence = state.expressionsPrecedence[node.type]; + if (nodePrecedence === NEEDS_PARENTHESES) { + return true; + } + var parentNodePrecedence = state.expressionsPrecedence[parentNode.type]; + if (nodePrecedence !== parentNodePrecedence) { + return !isRightHand && nodePrecedence === 15 && parentNodePrecedence === 14 && parentNode.operator === "**" || nodePrecedence < parentNodePrecedence; + } + if (nodePrecedence !== 13 && nodePrecedence !== 14) { + return false; + } + if (node.operator === "**" && parentNode.operator === "**") { + return !isRightHand; + } + if (nodePrecedence === 13 && parentNodePrecedence === 13 && (node.operator === "??" || parentNode.operator === "??")) { + return true; + } + if (isRightHand) { + return OPERATOR_PRECEDENCE[node.operator] <= OPERATOR_PRECEDENCE[parentNode.operator]; + } + return OPERATOR_PRECEDENCE[node.operator] < OPERATOR_PRECEDENCE[parentNode.operator]; + } + function formatExpression(state, node, parentNode, isRightHand) { + var generator = state.generator; + if (expressionNeedsParenthesis(state, node, parentNode, isRightHand)) { + state.write("("); + generator[node.type](node, state); + state.write(")"); + } else { + generator[node.type](node, state); + } + } + function reindent(state, text, indent, lineEnd) { + var lines = text.split("\n"); + var end = lines.length - 1; + state.write(lines[0].trim()); + if (end > 0) { + state.write(lineEnd); + for (var i7 = 1; i7 < end; i7++) { + state.write(indent + lines[i7].trim() + lineEnd); + } + state.write(indent + lines[end].trim()); + } + } + function formatComments(state, comments, indent, lineEnd) { + var length = comments.length; + for (var i7 = 0; i7 < length; i7++) { + var comment = comments[i7]; + state.write(indent); + if (comment.type[0] === "L") { + state.write("// " + comment.value.trim() + "\n", comment); + } else { + state.write("/*"); + reindent(state, comment.value, indent, lineEnd); + state.write("*/" + lineEnd); + } + } + } + function hasCallExpression(node) { + var currentNode = node; + while (currentNode != null) { + var _currentNode = currentNode, type3 = _currentNode.type; + if (type3[0] === "C" && type3[1] === "a") { + return true; + } else if (type3[0] === "M" && type3[1] === "e" && type3[2] === "m") { + currentNode = currentNode.object; + } else { + return false; + } + } + } + function formatVariableDeclaration(state, node) { + var generator = state.generator; + var declarations = node.declarations; + state.write(node.kind + " "); + var length = declarations.length; + if (length > 0) { + generator.VariableDeclarator(declarations[0], state); + for (var i7 = 1; i7 < length; i7++) { + state.write(", "); + generator.VariableDeclarator(declarations[i7], state); + } + } + } + var ForInStatement; + var FunctionDeclaration; + var RestElement; + var BinaryExpression; + var ArrayExpression; + var BlockStatement; + var GENERATOR = { + Program: function Program(node, state) { + var indent = state.indent.repeat(state.indentLevel); + var lineEnd = state.lineEnd, writeComments = state.writeComments; + if (writeComments && node.comments != null) { + formatComments(state, node.comments, indent, lineEnd); + } + var statements = node.body; + var length = statements.length; + for (var i7 = 0; i7 < length; i7++) { + var statement = statements[i7]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, indent, lineEnd); + } + state.write(indent); + this[statement.type](statement, state); + state.write(lineEnd); + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, indent, lineEnd); + } + }, + BlockStatement: BlockStatement = function BlockStatement2(node, state) { + var indent = state.indent.repeat(state.indentLevel++); + var lineEnd = state.lineEnd, writeComments = state.writeComments; + var statementIndent = indent + state.indent; + state.write("{"); + var statements = node.body; + if (statements != null && statements.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, statementIndent, lineEnd); + } + var length = statements.length; + for (var i7 = 0; i7 < length; i7++) { + var statement = statements[i7]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + state.write(indent); + } else { + if (writeComments && node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, statementIndent, lineEnd); + state.write(indent); + } + } + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, statementIndent, lineEnd); + } + state.write("}"); + state.indentLevel--; + }, + ClassBody: BlockStatement, + StaticBlock: function StaticBlock(node, state) { + state.write("static "); + this.BlockStatement(node, state); + }, + EmptyStatement: function EmptyStatement(node, state) { + state.write(";"); + }, + ExpressionStatement: function ExpressionStatement(node, state) { + var precedence = state.expressionsPrecedence[node.expression.type]; + if (precedence === NEEDS_PARENTHESES || precedence === 3 && node.expression.left.type[0] === "O") { + state.write("("); + this[node.expression.type](node.expression, state); + state.write(")"); + } else { + this[node.expression.type](node.expression, state); + } + state.write(";"); + }, + IfStatement: function IfStatement(node, state) { + state.write("if ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.consequent.type](node.consequent, state); + if (node.alternate != null) { + state.write(" else "); + this[node.alternate.type](node.alternate, state); + } + }, + LabeledStatement: function LabeledStatement(node, state) { + this[node.label.type](node.label, state); + state.write(": "); + this[node.body.type](node.body, state); + }, + BreakStatement: function BreakStatement(node, state) { + state.write("break"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + ContinueStatement: function ContinueStatement(node, state) { + state.write("continue"); + if (node.label != null) { + state.write(" "); + this[node.label.type](node.label, state); + } + state.write(";"); + }, + WithStatement: function WithStatement(node, state) { + state.write("with ("); + this[node.object.type](node.object, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + SwitchStatement: function SwitchStatement(node, state) { + var indent = state.indent.repeat(state.indentLevel++); + var lineEnd = state.lineEnd, writeComments = state.writeComments; + state.indentLevel++; + var caseIndent = indent + state.indent; + var statementIndent = caseIndent + state.indent; + state.write("switch ("); + this[node.discriminant.type](node.discriminant, state); + state.write(") {" + lineEnd); + var occurences = node.cases; + var occurencesCount = occurences.length; + for (var i7 = 0; i7 < occurencesCount; i7++) { + var occurence = occurences[i7]; + if (writeComments && occurence.comments != null) { + formatComments(state, occurence.comments, caseIndent, lineEnd); + } + if (occurence.test) { + state.write(caseIndent + "case "); + this[occurence.test.type](occurence.test, state); + state.write(":" + lineEnd); + } else { + state.write(caseIndent + "default:" + lineEnd); + } + var consequent = occurence.consequent; + var consequentCount = consequent.length; + for (var _i = 0; _i < consequentCount; _i++) { + var statement = consequent[_i]; + if (writeComments && statement.comments != null) { + formatComments(state, statement.comments, statementIndent, lineEnd); + } + state.write(statementIndent); + this[statement.type](statement, state); + state.write(lineEnd); + } + } + state.indentLevel -= 2; + state.write(indent + "}"); + }, + ReturnStatement: function ReturnStatement(node, state) { + state.write("return"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + state.write(";"); + }, + ThrowStatement: function ThrowStatement(node, state) { + state.write("throw "); + this[node.argument.type](node.argument, state); + state.write(";"); + }, + TryStatement: function TryStatement(node, state) { + state.write("try "); + this[node.block.type](node.block, state); + if (node.handler) { + var handler = node.handler; + if (handler.param == null) { + state.write(" catch "); + } else { + state.write(" catch ("); + this[handler.param.type](handler.param, state); + state.write(") "); + } + this[handler.body.type](handler.body, state); + } + if (node.finalizer) { + state.write(" finally "); + this[node.finalizer.type](node.finalizer, state); + } + }, + WhileStatement: function WhileStatement(node, state) { + state.write("while ("); + this[node.test.type](node.test, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + DoWhileStatement: function DoWhileStatement(node, state) { + state.write("do "); + this[node.body.type](node.body, state); + state.write(" while ("); + this[node.test.type](node.test, state); + state.write(");"); + }, + ForStatement: function ForStatement(node, state) { + state.write("for ("); + if (node.init != null) { + var init2 = node.init; + if (init2.type[0] === "V") { + formatVariableDeclaration(state, init2); + } else { + this[init2.type](init2, state); + } + } + state.write("; "); + if (node.test) { + this[node.test.type](node.test, state); + } + state.write("; "); + if (node.update) { + this[node.update.type](node.update, state); + } + state.write(") "); + this[node.body.type](node.body, state); + }, + ForInStatement: ForInStatement = function ForInStatement2(node, state) { + state.write("for ".concat(node["await"] ? "await " : "", "(")); + var left = node.left; + if (left.type[0] === "V") { + formatVariableDeclaration(state, left); + } else { + this[left.type](left, state); + } + state.write(node.type[3] === "I" ? " in " : " of "); + this[node.right.type](node.right, state); + state.write(") "); + this[node.body.type](node.body, state); + }, + ForOfStatement: ForInStatement, + DebuggerStatement: function DebuggerStatement(node, state) { + state.write("debugger;", node); + }, + FunctionDeclaration: FunctionDeclaration = function FunctionDeclaration2(node, state) { + state.write((node.async ? "async " : "") + (node.generator ? "function* " : "function ") + (node.id ? node.id.name : ""), node); + formatSequence(state, node.params); + state.write(" "); + this[node.body.type](node.body, state); + }, + FunctionExpression: FunctionDeclaration, + VariableDeclaration: function VariableDeclaration(node, state) { + formatVariableDeclaration(state, node); + state.write(";"); + }, + VariableDeclarator: function VariableDeclarator(node, state) { + this[node.id.type](node.id, state); + if (node.init != null) { + state.write(" = "); + this[node.init.type](node.init, state); + } + }, + ClassDeclaration: function ClassDeclaration(node, state) { + state.write("class " + (node.id ? "".concat(node.id.name, " ") : ""), node); + if (node.superClass) { + state.write("extends "); + var superClass = node.superClass; + var type3 = superClass.type; + var precedence = state.expressionsPrecedence[type3]; + if ((type3[0] !== "C" || type3[1] !== "l" || type3[5] !== "E") && (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.ClassExpression)) { + state.write("("); + this[node.superClass.type](superClass, state); + state.write(")"); + } else { + this[superClass.type](superClass, state); + } + state.write(" "); + } + this.ClassBody(node.body, state); + }, + ImportDeclaration: function ImportDeclaration(node, state) { + state.write("import "); + var specifiers = node.specifiers, attributes = node.attributes; + var length = specifiers.length; + var i7 = 0; + if (length > 0) { + for (; i7 < length; ) { + if (i7 > 0) { + state.write(", "); + } + var specifier = specifiers[i7]; + var type3 = specifier.type[6]; + if (type3 === "D") { + state.write(specifier.local.name, specifier); + i7++; + } else if (type3 === "N") { + state.write("* as " + specifier.local.name, specifier); + i7++; + } else { + break; + } + } + if (i7 < length) { + state.write("{"); + for (; ; ) { + var _specifier = specifiers[i7]; + var name2 = _specifier.imported.name; + state.write(name2, _specifier); + if (name2 !== _specifier.local.name) { + state.write(" as " + _specifier.local.name); + } + if (++i7 < length) { + state.write(", "); + } else { + break; + } + } + state.write("}"); + } + state.write(" from "); + } + this.Literal(node.source, state); + if (attributes && attributes.length > 0) { + state.write(" with { "); + for (var _i2 = 0; _i2 < attributes.length; _i2++) { + this.ImportAttribute(attributes[_i2], state); + if (_i2 < attributes.length - 1) + state.write(", "); + } + state.write(" }"); + } + state.write(";"); + }, + ImportAttribute: function ImportAttribute(node, state) { + this.Identifier(node.key, state); + state.write(": "); + this.Literal(node.value, state); + }, + ImportExpression: function ImportExpression(node, state) { + state.write("import("); + this[node.source.type](node.source, state); + state.write(")"); + }, + ExportDefaultDeclaration: function ExportDefaultDeclaration(node, state) { + state.write("export default "); + this[node.declaration.type](node.declaration, state); + if (state.expressionsPrecedence[node.declaration.type] != null && node.declaration.type[0] !== "F") { + state.write(";"); + } + }, + ExportNamedDeclaration: function ExportNamedDeclaration(node, state) { + state.write("export "); + if (node.declaration) { + this[node.declaration.type](node.declaration, state); + } else { + state.write("{"); + var specifiers = node.specifiers, length = specifiers.length; + if (length > 0) { + for (var i7 = 0; ; ) { + var specifier = specifiers[i7]; + var name2 = specifier.local.name; + state.write(name2, specifier); + if (name2 !== specifier.exported.name) { + state.write(" as " + specifier.exported.name); + } + if (++i7 < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + if (node.source) { + state.write(" from "); + this.Literal(node.source, state); + } + if (node.attributes && node.attributes.length > 0) { + state.write(" with { "); + for (var _i3 = 0; _i3 < node.attributes.length; _i3++) { + this.ImportAttribute(node.attributes[_i3], state); + if (_i3 < node.attributes.length - 1) + state.write(", "); + } + state.write(" }"); + } + state.write(";"); + } + }, + ExportAllDeclaration: function ExportAllDeclaration(node, state) { + if (node.exported != null) { + state.write("export * as " + node.exported.name + " from "); + } else { + state.write("export * from "); + } + this.Literal(node.source, state); + if (node.attributes && node.attributes.length > 0) { + state.write(" with { "); + for (var i7 = 0; i7 < node.attributes.length; i7++) { + this.ImportAttribute(node.attributes[i7], state); + if (i7 < node.attributes.length - 1) + state.write(", "); + } + state.write(" }"); + } + state.write(";"); + }, + MethodDefinition: function MethodDefinition(node, state) { + if (node["static"]) { + state.write("static "); + } + var kind = node.kind[0]; + if (kind === "g" || kind === "s") { + state.write(node.kind + " "); + } + if (node.value.async) { + state.write("async "); + } + if (node.value.generator) { + state.write("*"); + } + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + formatSequence(state, node.value.params); + state.write(" "); + this[node.value.body.type](node.value.body, state); + }, + ClassExpression: function ClassExpression(node, state) { + this.ClassDeclaration(node, state); + }, + ArrowFunctionExpression: function ArrowFunctionExpression(node, state) { + state.write(node.async ? "async " : "", node); + var params = node.params; + if (params != null) { + if (params.length === 1 && params[0].type[0] === "I") { + state.write(params[0].name, params[0]); + } else { + formatSequence(state, node.params); + } + } + state.write(" => "); + if (node.body.type[0] === "O") { + state.write("("); + this.ObjectExpression(node.body, state); + state.write(")"); + } else { + this[node.body.type](node.body, state); + } + }, + ThisExpression: function ThisExpression(node, state) { + state.write("this", node); + }, + Super: function Super(node, state) { + state.write("super", node); + }, + RestElement: RestElement = function RestElement2(node, state) { + state.write("..."); + this[node.argument.type](node.argument, state); + }, + SpreadElement: RestElement, + YieldExpression: function YieldExpression(node, state) { + state.write(node.delegate ? "yield*" : "yield"); + if (node.argument) { + state.write(" "); + this[node.argument.type](node.argument, state); + } + }, + AwaitExpression: function AwaitExpression(node, state) { + state.write("await ", node); + formatExpression(state, node.argument, node); + }, + TemplateLiteral: function TemplateLiteral(node, state) { + var quasis = node.quasis, expressions = node.expressions; + state.write("`"); + var length = expressions.length; + for (var i7 = 0; i7 < length; i7++) { + var expression = expressions[i7]; + var _quasi = quasis[i7]; + state.write(_quasi.value.raw, _quasi); + state.write("${"); + this[expression.type](expression, state); + state.write("}"); + } + var quasi = quasis[quasis.length - 1]; + state.write(quasi.value.raw, quasi); + state.write("`"); + }, + TemplateElement: function TemplateElement(node, state) { + state.write(node.value.raw, node); + }, + TaggedTemplateExpression: function TaggedTemplateExpression(node, state) { + formatExpression(state, node.tag, node); + this[node.quasi.type](node.quasi, state); + }, + ArrayExpression: ArrayExpression = function ArrayExpression2(node, state) { + state.write("["); + if (node.elements.length > 0) { + var elements = node.elements, length = elements.length; + for (var i7 = 0; ; ) { + var element = elements[i7]; + if (element != null) { + this[element.type](element, state); + } + if (++i7 < length) { + state.write(", "); + } else { + if (element == null) { + state.write(", "); + } + break; + } + } + } + state.write("]"); + }, + ArrayPattern: ArrayExpression, + ObjectExpression: function ObjectExpression(node, state) { + var indent = state.indent.repeat(state.indentLevel++); + var lineEnd = state.lineEnd, writeComments = state.writeComments; + var propertyIndent = indent + state.indent; + state.write("{"); + if (node.properties.length > 0) { + state.write(lineEnd); + if (writeComments && node.comments != null) { + formatComments(state, node.comments, propertyIndent, lineEnd); + } + var comma = "," + lineEnd; + var properties = node.properties, length = properties.length; + for (var i7 = 0; ; ) { + var property2 = properties[i7]; + if (writeComments && property2.comments != null) { + formatComments(state, property2.comments, propertyIndent, lineEnd); + } + state.write(propertyIndent); + this[property2.type](property2, state); + if (++i7 < length) { + state.write(comma); + } else { + break; + } + } + state.write(lineEnd); + if (writeComments && node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (writeComments) { + if (node.comments != null) { + state.write(lineEnd); + formatComments(state, node.comments, propertyIndent, lineEnd); + if (node.trailingComments != null) { + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + } + state.write(indent + "}"); + } else if (node.trailingComments != null) { + state.write(lineEnd); + formatComments(state, node.trailingComments, propertyIndent, lineEnd); + state.write(indent + "}"); + } else { + state.write("}"); + } + } else { + state.write("}"); + } + state.indentLevel--; + }, + Property: function Property(node, state) { + if (node.method || node.kind[0] !== "i") { + this.MethodDefinition(node, state); + } else { + if (!node.shorthand) { + if (node.computed) { + state.write("["); + this[node.key.type](node.key, state); + state.write("]"); + } else { + this[node.key.type](node.key, state); + } + state.write(": "); + } + this[node.value.type](node.value, state); + } + }, + PropertyDefinition: function PropertyDefinition(node, state) { + if (node["static"]) { + state.write("static "); + } + if (node.computed) { + state.write("["); + } + this[node.key.type](node.key, state); + if (node.computed) { + state.write("]"); + } + if (node.value == null) { + if (node.key.type[0] !== "F") { + state.write(";"); + } + return; + } + state.write(" = "); + this[node.value.type](node.value, state); + state.write(";"); + }, + ObjectPattern: function ObjectPattern(node, state) { + state.write("{"); + if (node.properties.length > 0) { + var properties = node.properties, length = properties.length; + for (var i7 = 0; ; ) { + this[properties[i7].type](properties[i7], state); + if (++i7 < length) { + state.write(", "); + } else { + break; + } + } + } + state.write("}"); + }, + SequenceExpression: function SequenceExpression(node, state) { + formatSequence(state, node.expressions); + }, + UnaryExpression: function UnaryExpression(node, state) { + if (node.prefix) { + var operator = node.operator, argument = node.argument, type3 = node.argument.type; + state.write(operator); + var needsParentheses = expressionNeedsParenthesis(state, argument, node); + if (!needsParentheses && (operator.length > 1 || type3[0] === "U" && (type3[1] === "n" || type3[1] === "p") && argument.prefix && argument.operator[0] === operator && (operator === "+" || operator === "-"))) { + state.write(" "); + } + if (needsParentheses) { + state.write(operator.length > 1 ? " (" : "("); + this[type3](argument, state); + state.write(")"); + } else { + this[type3](argument, state); + } + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + UpdateExpression: function UpdateExpression(node, state) { + if (node.prefix) { + state.write(node.operator); + this[node.argument.type](node.argument, state); + } else { + this[node.argument.type](node.argument, state); + state.write(node.operator); + } + }, + AssignmentExpression: function AssignmentExpression(node, state) { + this[node.left.type](node.left, state); + state.write(" " + node.operator + " "); + this[node.right.type](node.right, state); + }, + AssignmentPattern: function AssignmentPattern(node, state) { + this[node.left.type](node.left, state); + state.write(" = "); + this[node.right.type](node.right, state); + }, + BinaryExpression: BinaryExpression = function BinaryExpression2(node, state) { + var isIn = node.operator === "in"; + if (isIn) { + state.write("("); + } + formatExpression(state, node.left, node, false); + state.write(" " + node.operator + " "); + formatExpression(state, node.right, node, true); + if (isIn) { + state.write(")"); + } + }, + LogicalExpression: BinaryExpression, + ConditionalExpression: function ConditionalExpression(node, state) { + var test = node.test; + var precedence = state.expressionsPrecedence[test.type]; + if (precedence === NEEDS_PARENTHESES || precedence <= state.expressionsPrecedence.ConditionalExpression) { + state.write("("); + this[test.type](test, state); + state.write(")"); + } else { + this[test.type](test, state); + } + state.write(" ? "); + this[node.consequent.type](node.consequent, state); + state.write(" : "); + this[node.alternate.type](node.alternate, state); + }, + NewExpression: function NewExpression(node, state) { + state.write("new "); + var precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression || hasCallExpression(node.callee)) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + formatSequence(state, node["arguments"]); + }, + CallExpression: function CallExpression(node, state) { + var precedence = state.expressionsPrecedence[node.callee.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.CallExpression) { + state.write("("); + this[node.callee.type](node.callee, state); + state.write(")"); + } else { + this[node.callee.type](node.callee, state); + } + if (node.optional) { + state.write("?."); + } + formatSequence(state, node["arguments"]); + }, + ChainExpression: function ChainExpression(node, state) { + this[node.expression.type](node.expression, state); + }, + MemberExpression: function MemberExpression(node, state) { + var precedence = state.expressionsPrecedence[node.object.type]; + if (precedence === NEEDS_PARENTHESES || precedence < state.expressionsPrecedence.MemberExpression) { + state.write("("); + this[node.object.type](node.object, state); + state.write(")"); + } else { + this[node.object.type](node.object, state); + } + if (node.computed) { + if (node.optional) { + state.write("?."); + } + state.write("["); + this[node.property.type](node.property, state); + state.write("]"); + } else { + if (node.optional) { + state.write("?."); + } else { + state.write("."); + } + this[node.property.type](node.property, state); + } + }, + MetaProperty: function MetaProperty(node, state) { + state.write(node.meta.name + "." + node.property.name, node); + }, + Identifier: function Identifier(node, state) { + state.write(node.name, node); + }, + PrivateIdentifier: function PrivateIdentifier(node, state) { + state.write("#".concat(node.name), node); + }, + Literal: function Literal(node, state) { + if (node.raw != null) { + state.write(node.raw, node); + } else if (node.regex != null) { + this.RegExpLiteral(node, state); + } else if (node.bigint != null) { + state.write(node.bigint + "n", node); + } else { + state.write(stringify5(node.value), node); + } + }, + RegExpLiteral: function RegExpLiteral(node, state) { + var regex = node.regex; + state.write("/".concat(regex.pattern, "/").concat(regex.flags), node); + } + }; + exports28.GENERATOR = GENERATOR; + var EMPTY_OBJECT = {}; + var baseGenerator = GENERATOR; + exports28.baseGenerator = baseGenerator; + var State2 = function() { + function State3(options) { + _classCallCheck3(this, State3); + var setup = options == null ? EMPTY_OBJECT : options; + this.output = ""; + if (setup.output != null) { + this.output = setup.output; + this.write = this.writeToStream; + } else { + this.output = ""; + } + this.generator = setup.generator != null ? setup.generator : GENERATOR; + this.expressionsPrecedence = setup.expressionsPrecedence != null ? setup.expressionsPrecedence : EXPRESSIONS_PRECEDENCE; + this.indent = setup.indent != null ? setup.indent : " "; + this.lineEnd = setup.lineEnd != null ? setup.lineEnd : "\n"; + this.indentLevel = setup.startingIndentLevel != null ? setup.startingIndentLevel : 0; + this.writeComments = setup.comments ? setup.comments : false; + if (setup.sourceMap != null) { + this.write = setup.output == null ? this.writeAndMap : this.writeToStreamAndMap; + this.sourceMap = setup.sourceMap; + this.line = 1; + this.column = 0; + this.lineEndSize = this.lineEnd.split("\n").length - 1; + this.mapping = { + original: null, + generated: this, + name: void 0, + source: setup.sourceMap.file || setup.sourceMap._file + }; + } + } + _createClass3(State3, [{ + key: "write", + value: function write(code) { + this.output += code; + } + }, { + key: "writeToStream", + value: function writeToStream(code) { + this.output.write(code); + } + }, { + key: "writeAndMap", + value: function writeAndMap(code, node) { + this.output += code; + this.map(code, node); + } + }, { + key: "writeToStreamAndMap", + value: function writeToStreamAndMap(code, node) { + this.output.write(code); + this.map(code, node); + } + }, { + key: "map", + value: function map4(code, node) { + if (node != null) { + var type3 = node.type; + if (type3[0] === "L" && type3[2] === "n") { + this.column = 0; + this.line++; + return; + } + if (node.loc != null) { + var mapping = this.mapping; + mapping.original = node.loc.start; + mapping.name = node.name; + this.sourceMap.addMapping(mapping); + } + if (type3[0] === "T" && type3[8] === "E" || type3[0] === "L" && type3[1] === "i" && typeof node.value === "string") { + var _length = code.length; + var column = this.column, line = this.line; + for (var i7 = 0; i7 < _length; i7++) { + if (code[i7] === "\n") { + column = 0; + line++; + } else { + column++; + } + } + this.column = column; + this.line = line; + return; + } + } + var length = code.length; + var lineEnd = this.lineEnd; + if (length > 0) { + if (this.lineEndSize > 0 && (lineEnd.length === 1 ? code[length - 1] === lineEnd : code.endsWith(lineEnd))) { + this.line += this.lineEndSize; + this.column = 0; + } else { + this.column += length; + } + } + } + }, { + key: "toString", + value: function toString3() { + return this.output; + } + }]); + return State3; + }(); + function generate2(node, options) { + var state = new State2(options); + state.generator[node.type](node, state); + return state.output; + } + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/dump.js +var require_dump = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/dump.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var astring$1 = require_astring(); + function _interopNamespace(e10) { + if (e10 && e10.__esModule) + return e10; + var n7 = /* @__PURE__ */ Object.create(null); + if (e10) { + Object.keys(e10).forEach(function(k6) { + if (k6 !== "default") { + var d7 = Object.getOwnPropertyDescriptor(e10, k6); + Object.defineProperty(n7, k6, d7.get ? d7 : { + enumerable: true, + get: function() { + return e10[k6]; + } + }); + } + }); + } + n7["default"] = e10; + return Object.freeze(n7); + } + var astring__namespace = /* @__PURE__ */ _interopNamespace(astring$1); + var customGenerator = { + ...astring__namespace.baseGenerator, + BooleanLiteral(node, state) { + state.write(`${node.value}`, node); + }, + NullLiteral(node, state) { + state.write("null", node); + }, + NumericLiteral(node, state) { + state.write(node.value, node); + }, + ObjectMethod(node, state) { + const { + key, + type: type3, + ...value2 + } = node; + return this.ObjectProperty({ + key: node.key, + value: { + type: "FunctionExpression", + ...value2 + } + }, state); + }, + ObjectProperty(node, state) { + return this.Property({ + ...node, + kind: "init" + }, state); + }, + RegExpLiteral(node, state) { + state.write(`/${node.pattern}/${node.flags}`, node); + }, + StringLiteral(node, state) { + state.write(JSON.stringify(node.value), node); + } + }; + function astring(tree) { + return astring__namespace.generate(tree, { + generator: customGenerator + }); + } + exports28["default"] = astring; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/fallback-expressions.js +var require_fallback_expressions = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/fallback-expressions.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var scope = require_scope2(); + function generateFallbackExpressions(fallback, expressions) { + const path2 = builders.identifier("path"); + return builders.forOfStatement(builders.variableDeclaration("const", [builders.variableDeclarator(path2)]), builders.arrayExpression(expressions.map(builders.stringLiteral)), builders.blockStatement([builders.callExpression(fallback, [builders.identifier("input"), path2, builders.memberExpression(scope["default"].callbacks, path2, true)])])); + } + exports28["default"] = generateFallbackExpressions; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/is-object.js +var require_is_object = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/is-object.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function isObject8(maybeObj) { + return typeof maybeObj === "object" && maybeObj !== null; + } + exports28["default"] = isObject8; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/errors/aggregate-error.js +var require_aggregate_error = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/errors/aggregate-error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var isObject8 = require_is_object(); + var _globalThis$Aggregate; + function isIterable(value2) { + return isObject8["default"](value2) && typeof value2[Symbol.iterator] === "function"; + } + var AggregateError2 = (_globalThis$Aggregate = globalThis.AggregateError) !== null && _globalThis$Aggregate !== void 0 ? _globalThis$Aggregate : class AggregateError extends Error { + constructor(errors, message = "") { + super(message); + if (!Array.isArray(errors) && !isIterable(errors)) { + throw new TypeError(`${errors} is not an iterable`); + } + this.errors = [...errors]; + } + }; + exports28["default"] = AggregateError2; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/templates/build-json.js +var require_build_json = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/templates/build-json.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + function buildJson(input) { + switch (typeof input) { + case "boolean": + return builders.booleanLiteral(input); + case "string": + return builders.stringLiteral(input); + case "number": + return builders.numericLiteral(input); + case "object": + if (input === null) { + return builders.nullLiteral(); + } + if (Array.isArray(input)) { + return builders.arrayExpression(input.map(buildJson)); + } + return builders.objectExpression(Object.keys(input).map((key) => builders.objectProperty(builders.stringLiteral(key), buildJson(input[key])))); + } + } + exports28["default"] = buildJson; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/tree/traversal-zones.js +var require_traversal_zones = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/tree/traversal-zones.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var isObject8 = require_is_object(); + require_aggregate_error(); + var builders = require_builders(); + var buildJson = require_build_json(); + var _isDestroyed = /* @__PURE__ */ new WeakMap(); + var _zones = /* @__PURE__ */ new WeakMap(); + var TraversalZones = class { + constructor() { + _isDestroyed.set(this, { + writable: true, + value: false + }); + _zones.set(this, { + writable: true, + value: [] + }); + } + get root() { + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _isDestroyed) || _rollupPluginBabelHelpers.classPrivateFieldGet(this, _zones).length === 0) { + return null; + } + const zonesIdentifier = builders.identifier("zones"); + return builders.variableDeclaration("const", [builders.variableDeclarator(zonesIdentifier, buildJson["default"](mergeZones(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _zones))))]); + } + destroy() { + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _isDestroyed, true); + } + attach(zone) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _zones).push(zone); + } + create() { + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _isDestroyed)) { + return null; + } + return new Zone(this); + } + }; + var _zones2 = /* @__PURE__ */ new WeakMap(); + var _localZones = /* @__PURE__ */ new WeakMap(); + var _relationships = /* @__PURE__ */ new WeakMap(); + var Zone = class { + constructor(zones) { + _zones2.set(this, { + writable: true, + value: void 0 + }); + _localZones.set(this, { + writable: true, + value: void 0 + }); + _relationships.set(this, { + writable: true, + value: void 0 + }); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _zones2, zones); + this.root = {}; + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _localZones, [this.root]); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _relationships, /* @__PURE__ */ new Map()); + } + attach() { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _zones2).attach(this.root); + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _relationships).clear(); + } + expand(property2) { + let i7 = 0; + for (const value2 of _rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones)) { + if (value2 === null) + continue; + if (property2 === "**") { + const parent2 = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _relationships).get(value2); + if (parent2 !== void 0 && "*" in parent2) { + delete parent2["*"]; + parent2["**"] = null; + continue; + } + value2[property2] = null; + } else { + value2[property2] = {}; + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _relationships).set(value2[property2], value2); + } + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones)[i7++] = value2[property2]; + } + return this; + } + expandMultiple(properties) { + const root2 = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones)[0]; + if (root2 === null) { + return this; + } + let i7 = 0; + for (const property2 of properties) { + root2[property2] = property2 === "**" ? null : {}; + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones).length < i7) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones).push(root2[property2]); + } else { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _localZones)[i7++] = root2[property2]; + } + } + return this; + } + resize() { + return this.expand("*"); + } + allIn() { + return this.expand("**"); + } + }; + function pullAll2(target) { + return Object.keys(target).reduce((obj, key) => Object.assign(obj, target[key]), {}); + } + function _mergeZones(target, source) { + if ("*" in source) { + const pulled = pullAll2(target); + _mergeZones(pulled, pullAll2(source)); + target["*"] = "*" in pulled ? { + "*": pulled["*"] + } : pulled; + } else { + for (const key of Object.keys(source)) { + if (!(key in target)) { + target[key] = source[key]; + } else if (isObject8["default"](source[key])) { + _mergeZones(target[key], source[key]); + } + } + } + } + function mergeZones(zones) { + const target = zones[0]; + for (let i7 = 1; i7 < zones.length; i7++) { + _mergeZones(target, zones[i7]); + } + return target; + } + exports28["default"] = TraversalZones; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/tree/tree.js +var require_tree = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/tree/tree.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var jsep2 = require_jsep(); + var builders = require_builders(); + var dump2 = require_dump(); + var fallbackExpressions = require_fallback_expressions(); + var fnParams = require_fn_params(); + var internalScope = require_internal_scope(); + var scope = require_scope2(); + var treeMethodCall = require_tree_method_call(); + var traversalZones = require_traversal_zones(); + var params = [builders.identifier("input"), builders.identifier("callbacks")]; + var NEW_SCOPE_VARIABLE_DECLARATION = builders.variableDeclaration("const", [builders.variableDeclarator(scope["default"]._, builders.newExpression(builders.identifier("Scope"), params))]); + var _tree = /* @__PURE__ */ new WeakMap(); + var _shorthands = /* @__PURE__ */ new WeakMap(); + var _runtimeDependencies = /* @__PURE__ */ new WeakMap(); + var _program = /* @__PURE__ */ new WeakMap(); + var _body = /* @__PURE__ */ new WeakMap(); + var _traverse = /* @__PURE__ */ new WeakMap(); + var _availableShorthands = /* @__PURE__ */ new WeakMap(); + var ESTree = class { + constructor({ + customShorthands, + format: format5, + npmProvider + }) { + _tree.set(this, { + writable: true, + value: builders.objectExpression([]) + }); + _shorthands.set(this, { + writable: true, + value: builders.objectExpression([]) + }); + _runtimeDependencies.set(this, { + writable: true, + value: /* @__PURE__ */ new Set(["Scope"]) + }); + _program.set(this, { + writable: true, + value: /* @__PURE__ */ new Set() + }); + _body.set(this, { + writable: true, + value: /* @__PURE__ */ new Set() + }); + _traverse.set(this, { + writable: true, + value: /* @__PURE__ */ new Set() + }); + _availableShorthands.set(this, { + writable: true, + value: void 0 + }); + this.format = format5; + this.npmProvider = npmProvider; + this.ctx = null; + this.traversalZones = new traversalZones["default"](); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _availableShorthands, customShorthands); + } + addRuntimeDependency(specifier) { + if (!_rollupPluginBabelHelpers.classPrivateFieldGet(this, _runtimeDependencies).has(specifier)) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _runtimeDependencies).add(specifier); + } + } + attachFallbackExpressions(fallback, expressions) { + this.push(fallbackExpressions["default"](fallback.attach(this), expressions), "body"); + } + attachCustomShorthand(name2) { + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _availableShorthands) === null || !(name2 in _rollupPluginBabelHelpers.classPrivateFieldGet(this, _availableShorthands))) { + throw new ReferenceError(`Shorthand '${name2}' is not defined`); + } + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _shorthands).properties.push(builders.objectMethod("method", builders.identifier(name2), fnParams["default"], builders.blockStatement([builders.returnStatement(jsep2["default"](_rollupPluginBabelHelpers.classPrivateFieldGet(this, _availableShorthands)[name2]))]))); + } + getMethodByHash(hash) { + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _tree).properties.find((prop) => prop.key.value === hash); + } + push(node, placement) { + switch (placement) { + case "tree-method": + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _tree).properties.push(builders.objectMethod("method", builders.stringLiteral(this.ctx.id), fnParams["default"], node)); + break; + case "program": + if (!_rollupPluginBabelHelpers.classPrivateFieldGet(this, _program).has(node)) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _program).add(node); + } + break; + case "body": + if (!_rollupPluginBabelHelpers.classPrivateFieldGet(this, _body).has(node)) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _body).add(node); + } + break; + case "traverse": + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _traverse).add(treeMethodCall["default"](node.value)); + break; + } + } + pushAll(items) { + for (const item of items) { + this.push(...item); + } + } + toString() { + var _this$npmProvider; + const traversalZones2 = this.traversalZones.root; + return dump2["default"](builders.program([builders.importDeclaration([..._rollupPluginBabelHelpers.classPrivateFieldGet(this, _runtimeDependencies)].map((dep) => builders.importSpecifier(builders.identifier(dep), builders.identifier(dep))), builders.stringLiteral(`${(_this$npmProvider = this.npmProvider) !== null && _this$npmProvider !== void 0 ? _this$npmProvider : ""}nimma/legacy/runtime`)), ..._rollupPluginBabelHelpers.classPrivateFieldGet(this, _program), traversalZones2, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _tree).properties.length === 0 ? null : builders.variableDeclaration("const", [builders.variableDeclarator(internalScope["default"].tree, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _tree))]), _rollupPluginBabelHelpers.classPrivateFieldGet(this, _shorthands).properties.length === 0 ? null : builders.variableDeclaration("const", [builders.variableDeclarator(internalScope["default"].shorthands, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _shorthands))]), builders.exportDefaultDeclaration(builders.functionDeclaration(null, params, builders.blockStatement([NEW_SCOPE_VARIABLE_DECLARATION, builders.tryStatement(builders.blockStatement([..._rollupPluginBabelHelpers.classPrivateFieldGet(this, _body), _rollupPluginBabelHelpers.classPrivateFieldGet(this, _traverse).size === 0 ? null : builders.expressionStatement(builders.callExpression(scope["default"].traverse, [builders.arrowFunctionExpression([], builders.blockStatement(Array.from(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _traverse)))), traversalZones2 === null ? builders.nullLiteral() : traversalZones2.declarations[0].id]))].filter(Boolean)), null, builders.blockStatement([builders.expressionStatement(builders.callExpression(scope["default"].destroy, []))]))].filter(Boolean))))].filter(Boolean))); + } + }; + exports28["default"] = ESTree; + } +}); + +// node_modules/nimma/dist/legacy/cjs/codegen/baseline/index.js +var require_baseline = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/codegen/baseline/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders(); + var index4 = require_fast_paths(); + var guards = require_guards(); + var iterator = require_iterator(); + var index$1 = require_optimizer(); + var emitCall = require_emit_call(); + var fnParams = require_fn_params(); + var internalScope = require_internal_scope(); + var scope = require_scope2(); + var tree = require_tree(); + var generators = require_generators(); + var POS_VARIABLE_DECLARATION = builders.variableDeclaration("let", [builders.variableDeclarator(internalScope["default"].pos, builders.numericLiteral(0))]); + function baseline(jsonPaths, opts) { + const tree$1 = new tree["default"](opts); + const hashes = /* @__PURE__ */ new Map(); + const callbacks = /* @__PURE__ */ new Map(); + traverse: + for (const [id, nodes] of jsonPaths) { + const iterator$1 = new iterator["default"](nodes); + if (iterator$1.length === -1) { + continue; + } + const hash = JSON.stringify(iterator$1.nodes); + const existingHash = hashes.get(hash); + if (existingHash !== void 0) { + var _callbacks$get$push, _callbacks$get; + void ((_callbacks$get$push = (_callbacks$get = callbacks.get(existingHash)) === null || _callbacks$get === void 0 ? void 0 : _callbacks$get.push(id)) !== null && _callbacks$get$push !== void 0 ? _callbacks$get$push : callbacks.set(existingHash, [id])); + const method2 = tree$1.getMethodByHash(existingHash); + let body = method2.body.body; + if (iterator$1.feedback.bailed) { + body = body[0].expression.arguments[1].body.body; + } + body.push(emitCall["default"](id, iterator$1.modifiers)); + continue; + } else { + hashes.set(hash, id); + } + if (iterator$1.feedback.bailed || nodes.length > 0 && guards.isDeep(nodes[0])) { + tree$1.traversalZones.destroy(); + } + const ctx = { + id, + iterator: iterator$1 + }; + tree$1.ctx = ctx; + for (const fastPath of index4["default"]) { + if (fastPath(nodes, tree$1, ctx)) { + continue traverse; + } + } + const branch = iterator$1.feedback.bailed ? [] : [builders.ifStatement(builders.binaryExpression(iterator$1.feedback.fixed ? "!==" : "<", scope["default"].depth, builders.numericLiteral(iterator$1.length - 1)), builders.returnStatement())].concat(iterator$1.feedback.fixed ? [] : POS_VARIABLE_DECLARATION); + const zone = iterator$1.feedback.bailed ? null : tree$1.traversalZones.create(); + const inverseAt = iterator$1.feedback.inverseAt; + for (const node of iterator$1) { + if (guards.isDeep(node) || inverseAt === iterator$1.state.absolutePos) { + zone === null || zone === void 0 ? void 0 : zone.allIn(); + } + let treeNode; + switch (node.type) { + case "MemberExpression": + treeNode = generators.generateMemberExpression(iterator$1, node); + zone === null || zone === void 0 ? void 0 : zone.expand(node.value); + break; + case "MultipleMemberExpression": + treeNode = generators.generateMultipleMemberExpression(iterator$1, node); + zone === null || zone === void 0 ? void 0 : zone.expandMultiple(node.value); + break; + case "SliceExpression": + treeNode = generators.generateSliceExpression(iterator$1, node, tree$1); + zone === null || zone === void 0 ? void 0 : zone.resize(); + break; + case "ScriptFilterExpression": + treeNode = generators.generateFilterScriptExpression(iterator$1, node, tree$1); + zone === null || zone === void 0 ? void 0 : zone.resize(); + break; + case "WildcardExpression": + treeNode = generators.generateWildcardExpression(iterator$1); + zone === null || zone === void 0 ? void 0 : zone.resize(); + if (treeNode === null) { + continue; + } + break; + } + if (iterator$1.feedback.bailed) { + branch.push(builders.objectExpression([builders.objectProperty(builders.identifier("fn"), builders.arrowFunctionExpression([scope["default"]._], treeNode)), builders.objectProperty(builders.identifier("deep"), builders.booleanLiteral(node.deep))])); + } else { + branch.push(builders.ifStatement(treeNode, builders.returnStatement())); + } + } + if (!iterator$1.feedback.fixed && !iterator$1.feedback.bailed && !iterator$1.state.inverted) { + branch.push(builders.ifStatement(builders.binaryExpression("!==", scope["default"].depth, iterator$1.state.pos === 0 ? internalScope["default"].pos : builders.binaryExpression("+", internalScope["default"].pos, builders.numericLiteral(iterator$1.state.pos))), builders.returnStatement())); + } + const placement = iterator$1.feedback.bailed ? "body" : "traverse"; + if (iterator$1.feedback.bailed) { + branch.splice(0, branch.length, builders.expressionStatement(builders.callExpression(scope["default"].bail, [builders.stringLiteral(id), builders.arrowFunctionExpression([scope["default"]._], builders.blockStatement([builders.expressionStatement(emitCall["default"](ctx.id, iterator$1.modifiers).expression)])), builders.arrayExpression([...branch])]))); + } else { + branch.push(emitCall["default"](ctx.id, iterator$1.modifiers)); + } + if (placement === "body") { + tree$1.push(builders.expressionStatement(builders.callExpression(builders.memberExpression(internalScope["default"].tree, builders.stringLiteral(id), true), fnParams["default"])), placement); + } else { + tree$1.push(builders.stringLiteral(id), placement); + } + index$1["default"](branch, iterator$1); + tree$1.push(builders.blockStatement(branch), "tree-method"); + zone === null || zone === void 0 ? void 0 : zone.attach(); + } + return tree$1; + } + exports28["default"] = baseline; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/get.js +var require_get2 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/get.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var isObject8 = require_is_object(); + function get4(input, path2) { + if (path2.length === 0 || !isObject8["default"](input)) + return input; + let value2 = input; + for (const segment of path2.slice(0, path2.length - 1)) { + value2 = value2[segment]; + if (!isObject8["default"](value2)) + return; + } + return value2[path2[path2.length - 1]]; + } + exports28["default"] = get4; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/in-bounds.js +var require_in_bounds = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/in-bounds.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function inBounds(value2, pos, start, end, step) { + const actualStart = start < 0 ? Math.max(0, start + value2.length) : Math.min(value2.length, start); + const actualEnd = end < 0 ? Math.max(0, end + value2.length) : Math.min(value2.length, end); + return pos >= actualStart && pos < actualEnd && (step === 1 || actualEnd - Math.abs(step) > 0 && (pos + start) % step === 0); + } + exports28["default"] = inBounds; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/errors/cause-error.js +var require_cause_error = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/errors/cause-error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var CauseError = class extends Error { + constructor(message, extra) { + super(message); + if (extra !== void 0 && "cause" in extra) { + this.cause = extra.cause; + } + } + }; + exports28["default"] = CauseError; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/errors/runtime-error.js +var require_runtime_error = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/errors/runtime-error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var causeError = require_cause_error(); + var RuntimeError = class extends causeError["default"] { + }; + exports28["default"] = RuntimeError; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/proxy-callbacks.js +var require_proxy_callbacks = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/proxy-callbacks.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var runtimeError = require_runtime_error(); + function printPrimitive(value2) { + if (typeof value2 === "string" || typeof value2 === "number") { + return JSON.stringify(value2); + } + return "unknown"; + } + function printError(e10) { + if (e10 instanceof Error) { + return `${e10.constructor.name}(${printPrimitive(e10.message)})`; + } + return printPrimitive(e10); + } + function proxyCallbacks(callbacks, errors) { + const _callbacks = {}; + for (const key of Object.keys(callbacks)) { + const fn = callbacks[key]; + _callbacks[key] = (...args) => { + try { + fn(...args); + } catch (e10) { + const message = `${fn.name || key} threw: ${printError(e10)}`; + errors.push(new runtimeError["default"](message, { + cause: e10 + })); + } + }; + } + return _callbacks; + } + exports28["default"] = proxyCallbacks; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/sandbox.js +var require_sandbox2 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/sandbox.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var isObject8 = require_is_object(); + function printSegment(path2, segment) { + return path2 + `[${typeof segment === "string" ? `'${segment}'` : segment}]`; + } + function dumpPath(path2) { + return `$${path2.reduce(printSegment, "")}`; + } + var _history = /* @__PURE__ */ new WeakMap(); + var _path = /* @__PURE__ */ new WeakMap(); + var _value = /* @__PURE__ */ new WeakMap(); + var _parent = /* @__PURE__ */ new WeakMap(); + var Sandbox = class _Sandbox { + constructor(path2, root2, history = null) { + _parent.set(this, { + get: _get_parent, + set: void 0 + }); + _history.set(this, { + writable: true, + value: void 0 + }); + _path.set(this, { + writable: true, + value: void 0 + }); + _value.set(this, { + writable: true, + value: void 0 + }); + this.root = root2; + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _path, path2); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _history, history !== null && history !== void 0 ? history : [[0, root2]]); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _value, void 0); + } + get path() { + return dumpPath(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _path)); + } + get depth() { + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _path).length - 1; + } + get value() { + var _classPrivateFieldGet2; + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _value) !== void 0) { + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _value); + } + return (_classPrivateFieldGet2 = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _value)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : _rollupPluginBabelHelpers.classPrivateFieldSet(this, _value, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history)[_rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length - 1][1]); + } + get property() { + return unwrapOrNull(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _path), this.depth); + } + get parentValue() { + var _classPrivateFieldGet3; + return (_classPrivateFieldGet3 = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _parent)) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[1]; + } + get parentProperty() { + var _classPrivateFieldGet4; + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _path)[(_classPrivateFieldGet4 = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _parent)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4[0]]; + } + destroy() { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length = 0; + } + push() { + const root2 = this.property !== null && isObject8["default"](this.value) ? this.value[this.property] : null; + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).push([_rollupPluginBabelHelpers.classPrivateFieldGet(this, _path).length, root2]); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _value, root2); + return this; + } + pop() { + const length = Math.max(0, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _path).length + 1); + while (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length > length) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).pop(); + } + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _value, void 0); + return this; + } + at(pos) { + if (Math.abs(pos) > _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length) { + return null; + } + const actualPos = (pos < 0 ? _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length : 0) + pos; + const history = _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).slice(0, actualPos + 1); + return new _Sandbox(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _path).slice(0, history[history.length - 1][0]), history[history.length - 1][1], history); + } + }; + function _get_parent() { + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length < 3) { + return void 0; + } + return _rollupPluginBabelHelpers.classPrivateFieldGet(this, _history)[_rollupPluginBabelHelpers.classPrivateFieldGet(this, _history).length - 3]; + } + function unwrapOrNull(collection, pos) { + return pos >= 0 && collection.length > pos ? collection[pos] : null; + } + exports28.Sandbox = Sandbox; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/traverse.js +var require_traverse = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/traverse.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var isObject8 = require_is_object(); + function _traverseBody(key, curObj, scope, cb, deps) { + const value2 = curObj[key]; + const pos = scope.enter(key); + const matched = deps !== null && deps.length > 0 && !deps[0].fn(scope); + if (deps === null || deps.length === 1 && matched) { + cb(scope); + } + if (!isObject8["default"](value2)) + ; + else if (deps === null) { + _traverse(value2, scope, cb, deps); + } else if (deps.length > 0) { + if (matched) { + _traverse(value2, scope, cb, deps.slice(1)); + } + if (deps[0].deep) { + scope.exit(pos); + scope.enter(key); + _traverse(value2, scope, cb, deps); + } + } + scope.exit(pos); + } + function _traverse(curObj, scope, cb, deps) { + if (Array.isArray(curObj)) { + for (let i7 = 0; i7 < curObj.length; i7++) { + _traverseBody(i7, curObj, scope, cb, deps); + } + } else { + for (const key of Object.keys(curObj)) { + _traverseBody(key, curObj, scope, cb, deps); + } + } + } + function traverse4(cb) { + _traverse(this.root, this, cb, null); + } + function bailedTraverse(cb, deps) { + _traverse(this.value, this, cb, deps); + } + function zonedTraverse(cb, zones) { + if (isSaneObject(this.root)) { + zonesRegistry.set(this.root, zones); + _traverse(new Proxy(this.root, traps2), this, cb, null); + } else { + _traverse(this.root, this, cb, null); + } + } + var zonesRegistry = /* @__PURE__ */ new WeakMap(); + var traps2 = { + get(target, prop) { + const value2 = target[prop]; + if (Array.isArray(target)) { + if (prop === "length") { + return target.length; + } + const stored2 = zonesRegistry.get(target); + if (prop in stored2 && isObject8["default"](value2)) { + zonesRegistry.set(value2, stored2[prop]); + } + return value2; + } + if (!isObject8["default"](value2)) { + return value2; + } + if (!isSaneObject(value2)) { + return value2; + } + if (Array.isArray(value2)) { + for (const item of value2) { + if (isObject8["default"](item)) { + zonesRegistry.set(item, zonesRegistry.get(value2)); + } + } + } + const stored = zonesRegistry.get(value2); + return "**" in stored ? value2 : new Proxy(value2, traps2); + }, + ownKeys(target) { + const stored = zonesRegistry.get(target); + zonesRegistry.delete(target); + if ("*" in stored) { + const actualKeys2 = Object.keys(target); + for (const key of actualKeys2) { + const value2 = target[key]; + if (isObject8["default"](value2)) { + zonesRegistry.set(value2, stored["*"]); + } + } + return actualKeys2; + } + const actualKeys = Object.keys(stored); + for (let i7 = 0; i7 < actualKeys.length; i7++) { + const key = actualKeys[i7]; + if (!Object.hasOwnProperty.call(target, key)) { + actualKeys.splice(i7, 1); + i7--; + continue; + } + const value2 = target[key]; + if (isObject8["default"](value2)) { + zonesRegistry.set(value2, stored[key]); + } + } + return actualKeys; + } + }; + function isSaneObject(object) { + return !(Object.isFrozen(object) || Object.isSealed(object) || !Object.isExtensible(object)); + } + exports28.bailedTraverse = bailedTraverse; + exports28.traverse = traverse4; + exports28.zonedTraverse = zonedTraverse; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/scope.js +var require_scope3 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/scope.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var aggregateError = require_aggregate_error(); + var proxyCallbacks = require_proxy_callbacks(); + var sandbox = require_sandbox2(); + var traverse4 = require_traverse(); + var _parent = /* @__PURE__ */ new WeakMap(); + var _output = /* @__PURE__ */ new WeakMap(); + var Scope = class _Scope { + constructor(root2, callbacks, parent2 = null) { + _parent.set(this, { + writable: true, + value: void 0 + }); + _output.set(this, { + writable: true, + value: void 0 + }); + this.root = root2; + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _parent, parent2); + this.path = []; + this.errors = []; + this.sandbox = new sandbox.Sandbox(this.path, root2, null); + this.callbacks = proxyCallbacks["default"](callbacks, this.errors); + const self2 = this; + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _output, { + path: this.path, + get value() { + return self2.value; + } + }); + } + get depth() { + return this.path.length - 1; + } + get property() { + return this.sandbox.property; + } + get value() { + return this.sandbox.value; + } + enter(key) { + this.path.push(key); + this.sandbox = this.sandbox.push(); + return this.path.length; + } + exit(depth) { + const length = Math.max(0, depth - 1); + while (this.path.length > length) { + this.path.pop(); + } + this.sandbox = this.sandbox.pop(); + return this.path.length; + } + fork(path2) { + const newScope = new _Scope(this.root, this.callbacks, this); + for (const segment of path2) { + newScope.enter(segment); + if (newScope.value === void 0) { + return null; + } + } + return newScope; + } + traverse(fn, zones) { + if (zones !== null) { + traverse4.zonedTraverse.call(this, fn, zones); + } else { + traverse4.traverse.call(this, fn); + } + } + bail(id, fn, deps) { + const scope = this.fork(this.path); + traverse4.bailedTraverse.call(scope, fn, deps); + } + emit(id, pos, withKeys) { + var _this$sandbox$at; + const fn = this.callbacks[id]; + if (pos === 0 && !withKeys) { + return void fn(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _output)); + } + if (pos !== 0 && pos > this.depth + 1) { + return; + } + const output = pos === 0 ? _rollupPluginBabelHelpers.classPrivateFieldGet(this, _output) : { + path: _rollupPluginBabelHelpers.classPrivateFieldGet(this, _output).path.slice(0, Math.max(0, _rollupPluginBabelHelpers.classPrivateFieldGet(this, _output).path.length - pos)), + value: ((_this$sandbox$at = this.sandbox.at(-pos - 1)) !== null && _this$sandbox$at !== void 0 ? _this$sandbox$at : this.sandbox.at(0)).value + }; + if (!withKeys) { + fn(output); + } else { + fn({ + path: output.path, + value: output.path.length === 0 ? void 0 : output.path[output.path.length - 1] + }); + } + } + destroy() { + this.path.length = 0; + this.sandbox.destroy(); + this.sandbox = null; + if (this.errors.length > 0) { + throw new aggregateError["default"](this.errors, "Error running Nimma"); + } + } + }; + exports28["default"] = Scope; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/index.js +var require_runtime = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var get4 = require_get2(); + var inBounds = require_in_bounds(); + var isObject8 = require_is_object(); + var scope = require_scope3(); + exports28.get = get4["default"]; + exports28.inBounds = inBounds["default"]; + exports28.isObject = isObject8["default"]; + exports28.Scope = scope["default"]; + } +}); + +// node_modules/nimma/dist/legacy/cjs/core/utils/determine-format.js +var require_determine_format = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/core/utils/determine-format.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function getOutputFormat() { + try { + Function("a", "a?.b")({}); + return "ES2021"; + } catch { + return "ES2018"; + } + } + exports28["default"] = getOutputFormat; + } +}); + +// node_modules/nimma/dist/legacy/cjs/runtime/errors/parser-error.js +var require_parser_error = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/runtime/errors/parser-error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var causeError = require_cause_error(); + var ParserError = class extends causeError["default"] { + constructor(message, expression, extra) { + super(message, extra); + this.input = expression; + } + }; + exports28["default"] = ParserError; + } +}); + +// node_modules/nimma/dist/legacy/cjs/parser/parser.js +var require_parser = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/parser/parser.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function peg$subclass(child, parent2) { + function C6() { + this.constructor = child; + } + C6.prototype = parent2.prototype; + child.prototype = new C6(); + } + function peg$SyntaxError(message, expected, found, location2) { + var self2 = Error.call(this, message); + if (Object.setPrototypeOf) { + Object.setPrototypeOf(self2, peg$SyntaxError.prototype); + } + self2.expected = expected; + self2.found = found; + self2.location = location2; + self2.name = "SyntaxError"; + return self2; + } + peg$subclass(peg$SyntaxError, Error); + function peg$padEnd(str2, targetLength, padString) { + padString = padString || " "; + if (str2.length > targetLength) { + return str2; + } + targetLength -= str2.length; + padString += padString.repeat(targetLength); + return str2 + padString.slice(0, targetLength); + } + peg$SyntaxError.prototype.format = function(sources) { + var str2 = "Error: " + this.message; + if (this.location) { + var src = null; + var k6; + for (k6 = 0; k6 < sources.length; k6++) { + if (sources[k6].source === this.location.source) { + src = sources[k6].text.split(/\r\n|\n|\r/g); + break; + } + } + var s7 = this.location.start; + var loc = this.location.source + ":" + s7.line + ":" + s7.column; + if (src) { + var e10 = this.location.end; + var filler = peg$padEnd("", s7.line.toString().length); + var line = src[s7.line - 1]; + var last2 = s7.line === e10.line ? e10.column : line.length + 1; + str2 += "\n --> " + loc + "\n" + filler + " |\n" + s7.line + " | " + line + "\n" + filler + " | " + peg$padEnd("", s7.column - 1) + peg$padEnd("", last2 - s7.column, "^"); + } else { + str2 += "\n at " + loc; + } + } + return str2; + }; + peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return '"' + literalEscape(expectation.text) + '"'; + }, + class: function(expectation) { + var escapedParts = expectation.parts.map(function(part) { + return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part); + }); + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function() { + return "any character"; + }, + end: function() { + return "end of input"; + }, + other: function(expectation) { + return expectation.description; + } + }; + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + function literalEscape(s7) { + return s7.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { + return "\\x" + hex(ch); + }); + } + function classEscape(s7) { + return s7.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(ch) { + return "\\x0" + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { + return "\\x" + hex(ch); + }); + } + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + function describeExpected(expected2) { + var descriptions = expected2.map(describeExpectation); + var i7, j6; + descriptions.sort(); + if (descriptions.length > 0) { + for (i7 = 1, j6 = 1; i7 < descriptions.length; i7++) { + if (descriptions[i7 - 1] !== descriptions[i7]) { + descriptions[j6] = descriptions[i7]; + j6++; + } + } + descriptions.length = j6; + } + switch (descriptions.length) { + case 1: + return descriptions[0]; + case 2: + return descriptions[0] + " or " + descriptions[1]; + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + function describeFound(found2) { + return found2 ? '"' + literalEscape(found2) + '"' : "end of input"; + } + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + var peg$FAILED = {}; + var peg$source = options.grammarSource; + var peg$startRuleFunctions = { + JSONPath: peg$parseJSONPath + }; + var peg$startRuleFunction = peg$parseJSONPath; + var peg$c0 = "$"; + var peg$c1 = "["; + var peg$c2 = "]"; + var peg$c4 = ".."; + var peg$c5 = "("; + var peg$c6 = ")"; + var peg$c7 = "?("; + var peg$c8 = ":"; + var peg$c9 = "@"; + var peg$c10 = "()"; + var peg$c11 = "~"; + var peg$c12 = "^"; + var peg$c13 = "."; + var peg$c14 = '"'; + var peg$c15 = "'"; + var peg$c16 = "-"; + var peg$c17 = "*"; + var peg$c18 = ".length"; + var peg$r0 = /^[a-z]/; + var peg$r1 = /^[@[]/; + var peg$r2 = /^[$_\-]/; + var peg$r3 = /^[^"]/; + var peg$r4 = /^[^']/; + var peg$r5 = /^[A-Za-z]/; + var peg$r6 = /^[0-9]/; + var peg$r7 = /^[ \t]/; + var peg$r8 = /^["]/; + var peg$r9 = /^[']/; + var peg$r10 = /^[ $@.,_=<>!|&+~%\^*\/;\-[\]]/; + var peg$e0 = peg$literalExpectation("$", false); + var peg$e1 = peg$literalExpectation("[", false); + var peg$e2 = peg$literalExpectation("]", false); + var peg$e3 = peg$literalExpectation(",", false); + var peg$e4 = peg$literalExpectation("..", false); + var peg$e5 = peg$literalExpectation("(", false); + var peg$e6 = peg$literalExpectation(")", false); + var peg$e7 = peg$literalExpectation("?(", false); + var peg$e8 = peg$literalExpectation(":", false); + var peg$e9 = peg$literalExpectation("@", false); + var peg$e10 = peg$classExpectation([["a", "z"]], false, false); + var peg$e11 = peg$literalExpectation("()", false); + var peg$e12 = peg$literalExpectation("~", false); + var peg$e13 = peg$literalExpectation("^", false); + var peg$e14 = peg$literalExpectation(".", false); + var peg$e15 = peg$classExpectation(["@", "["], false, false); + var peg$e16 = peg$classExpectation(["$", "_", "-"], false, false); + var peg$e17 = peg$literalExpectation('"', false); + var peg$e18 = peg$classExpectation(['"'], true, false); + var peg$e19 = peg$literalExpectation("'", false); + var peg$e20 = peg$classExpectation(["'"], true, false); + var peg$e21 = peg$literalExpectation("-", false); + var peg$e22 = peg$literalExpectation("*", false); + var peg$e23 = peg$classExpectation([["A", "Z"], ["a", "z"]], false, false); + var peg$e24 = peg$classExpectation([["0", "9"]], false, false); + var peg$e25 = peg$classExpectation([" ", " "], false, false); + var peg$e26 = peg$classExpectation(['"'], false, false); + var peg$e27 = peg$classExpectation(["'"], false, false); + var peg$e28 = peg$classExpectation([" ", "$", "@", ".", ",", "_", "=", "<", ">", "!", "|", "&", "+", "~", "%", "^", "*", "/", ";", "-", "[", "]"], false, false); + var peg$e29 = peg$literalExpectation(".length", false); + var peg$f0 = function(deep, step) { + return { + ...step, + deep + }; + }; + var peg$f1 = function(nodes, modifiers) { + return nodes.concat(Array.isArray(modifiers) ? modifiers : modifiers === null ? [] : modifiers); + }; + var peg$f2 = function() { + return { + type: "WildcardExpression" + }; + }; + var peg$f3 = function(expression) { + return expression; + }; + var peg$f4 = function(value2) { + return value2; + }; + var peg$f5 = function(value2) { + return { + type: "MultipleMemberExpression", + value: [...new Set(value2)] + }; + }; + var peg$f6 = function() { + return /^\$\.{2}[~^]*$/.test(input); + }; + var peg$f7 = function() { + return { + type: "AllParentExpression" + }; + }; + var peg$f8 = function(value2) { + return { + type: "MemberExpression", + value: value2 + }; + }; + var peg$f9 = function(value2) { + return { + type: "ScriptFilterExpression", + value: value2 + }; + }; + var peg$f10 = function(value2) { + return { + type: "SliceExpression", + value: value2.split(":").reduce((values2, val, i7) => { + if (val !== "") + values2[i7] = Number(val); + return values2; + }, [0, Infinity, 1]) + }; + }; + var peg$f11 = function(value2) { + return { + type: "ScriptFilterExpression", + value: value2 + }; + }; + var peg$f12 = function(node) { + return node.value; + }; + var peg$f13 = function() { + return { + type: "KeyExpression" + }; + }; + var peg$f14 = function() { + return { + type: "ParentExpression" + }; + }; + var peg$f15 = function() { + return true; + }; + var peg$f16 = function() { + return false; + }; + var peg$f17 = function(value2) { + return value2.length > 0 && Number.isSafeInteger(Number(value2)) ? Number(value2) : value2; + }; + var peg$f18 = function() { + return text().slice(1, -1); + }; + var peg$f19 = function() { + return Number(text()); + }; + var peg$f20 = function(value2) { + return { + type: "SliceExpression", + value: [-value2, Infinity, 1] + }; + }; + var peg$currPos = 0; + var peg$savedPos = 0; + var peg$posDetailsCache = [{ + line: 1, + column: 1 + }]; + var peg$maxFailPos = 0; + var peg$maxFailExpected = []; + var peg$silentFails = 0; + var peg$result; + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error(`Can't start parsing from rule "` + options.startRule + '".'); + } + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + function text() { + return input.substring(peg$savedPos, peg$currPos); + } + function peg$literalExpectation(text2, ignoreCase) { + return { + type: "literal", + text: text2, + ignoreCase + }; + } + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts, + inverted, + ignoreCase + }; + } + function peg$endExpectation() { + return { + type: "end" + }; + } + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos]; + var p7; + if (details) { + return details; + } else { + p7 = pos - 1; + while (!peg$posDetailsCache[p7]) { + p7--; + } + details = peg$posDetailsCache[p7]; + details = { + line: details.line, + column: details.column + }; + while (p7 < pos) { + if (input.charCodeAt(p7) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + p7++; + } + peg$posDetailsCache[pos] = details; + return details; + } + } + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos); + var endPosDetails = peg$computePosDetails(endPos); + return { + source: peg$source, + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + peg$maxFailExpected.push(expected); + } + function peg$buildStructuredError(expected, found, location2) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location2); + } + function peg$parseJSONPath() { + var s0, s1, s22, s32, s42, s52; + s0 = peg$currPos; + s1 = peg$parseRoot(); + if (s1 !== peg$FAILED) { + s22 = []; + s32 = peg$parseAllParentExpression(); + if (s32 === peg$FAILED) { + s32 = peg$currPos; + s42 = peg$parseDescendant(); + if (s42 !== peg$FAILED) { + s52 = peg$parseNode(); + if (s52 !== peg$FAILED) { + peg$savedPos = s32; + s32 = peg$f0(s42, s52); + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$parseAllParentExpression(); + if (s32 === peg$FAILED) { + s32 = peg$currPos; + s42 = peg$parseDescendant(); + if (s42 !== peg$FAILED) { + s52 = peg$parseNode(); + if (s52 !== peg$FAILED) { + peg$savedPos = s32; + s32 = peg$f0(s42, s52); + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } + } + s32 = []; + s42 = peg$parseModifier(); + if (s42 !== peg$FAILED) { + while (s42 !== peg$FAILED) { + s32.push(s42); + s42 = peg$parseModifier(); + } + } else { + s32 = peg$FAILED; + } + if (s32 === peg$FAILED) { + s32 = null; + } + peg$savedPos = s0; + s0 = peg$f1(s22, s32); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseRoot() { + var s0; + if (input.charCodeAt(peg$currPos) === 36) { + s0 = peg$c0; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e0); + } + } + return s0; + } + function peg$parseNode() { + var s0, s1, s22, s32, s42; + s0 = peg$parseMemberExpression(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseWildcard(); + if (s1 === peg$FAILED) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s22 = peg$c1; + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s22 !== peg$FAILED) { + s32 = peg$parseWildcard(); + if (s32 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s42 = peg$c2; + peg$currPos++; + } else { + s42 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s42 !== peg$FAILED) { + s22 = [s22, s32, s42]; + s1 = s22; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f2(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c1; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseScriptExpression(); + if (s22 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s32 = peg$c2; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f3(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c1; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseScriptFilterExpression(); + if (s22 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s32 = peg$c2; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f3(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parseJsonPathPlusFilterFunction(); + if (s1 === peg$FAILED) { + s1 = peg$parseCustomScriptFilterExpression(); + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f3(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c1; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + s32 = peg$currPos; + s42 = peg$parseMemberIdentifier(); + if (s42 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + peg$currPos++; + } else { + if (peg$silentFails === 0) { + peg$fail(peg$e3); + } + } + peg$savedPos = s32; + s32 = peg$f4(s42); + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$currPos; + s42 = peg$parseMemberIdentifier(); + if (s42 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + peg$currPos++; + } else { + if (peg$silentFails === 0) { + peg$fail(peg$e3); + } + } + peg$savedPos = s32; + s32 = peg$f4(s42); + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } + if (input.charCodeAt(peg$currPos) === 93) { + s32 = peg$c2; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f5(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c1; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseSliceExpression(); + if (s22 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s32 = peg$c2; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f3(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + } + } + } + return s0; + } + function peg$parseAllParentExpression() { + var s0, s1, s22; + s0 = peg$currPos; + peg$savedPos = peg$currPos; + s1 = peg$f6(); + if (s1) { + s1 = void 0; + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 2) === peg$c4) { + s22 = peg$c4; + peg$currPos += 2; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + if (s22 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f7(); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseMemberExpression() { + var s0, s1, s22, s32, s42; + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 === peg$FAILED) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s22 = peg$c1; + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s22 !== peg$FAILED) { + s32 = peg$parseMemberIdentifier(); + if (s32 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 93) { + s42 = peg$c2; + peg$currPos++; + } else { + s42 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s42 !== peg$FAILED) { + peg$savedPos = s1; + s1 = peg$f4(s32); + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f8(s1); + } + s0 = s1; + return s0; + } + function peg$parseScriptExpression() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c5; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e5); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseEvalExpression(); + if (s22 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s32 = peg$c6; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f4(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseScriptFilterExpression() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c7) { + s1 = peg$c7; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e7); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseJSScript(); + if (s22 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s32 = peg$c6; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + if (s32 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f9(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseSliceExpression() { + var s0, s1, s22, s32, s42, s52, s62; + s0 = peg$currPos; + s1 = peg$currPos; + s22 = peg$currPos; + s32 = peg$currPos; + s42 = peg$parseNumber(); + if (s42 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s52 = peg$c8; + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + } + if (s52 !== peg$FAILED) { + s62 = peg$parseNumber(); + if (s62 === peg$FAILED) { + s62 = null; + } + s42 = [s42, s52, s62]; + s32 = s42; + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + if (s32 === peg$FAILED) { + s32 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s42 = peg$c8; + peg$currPos++; + } else { + s42 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + } + if (s42 !== peg$FAILED) { + s52 = peg$parseNumber(); + if (s52 === peg$FAILED) { + s52 = null; + } + s42 = [s42, s52]; + s32 = s42; + } else { + peg$currPos = s32; + s32 = peg$FAILED; + } + if (s32 === peg$FAILED) { + s32 = peg$parseNumber(); + } + } + if (s32 !== peg$FAILED) { + s42 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 58) { + s52 = peg$c8; + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e8); + } + } + if (s52 !== peg$FAILED) { + s62 = peg$parseNumber(); + if (s62 !== peg$FAILED) { + s52 = [s52, s62]; + s42 = s52; + } else { + peg$currPos = s42; + s42 = peg$FAILED; + } + } else { + peg$currPos = s42; + s42 = peg$FAILED; + } + if (s42 === peg$FAILED) { + s42 = null; + } + s32 = [s32, s42]; + s22 = s32; + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + if (s22 !== peg$FAILED) { + s1 = input.substring(s1, peg$currPos); + } else { + s1 = s22; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f10(s1); + } + s0 = s1; + return s0; + } + function peg$parseJsonPathPlusFilterFunction() { + var s0, s1, s22, s32, s42, s52; + s0 = peg$currPos; + s1 = peg$currPos; + s22 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 64) { + s32 = peg$c9; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + if (s32 !== peg$FAILED) { + s42 = []; + if (peg$r0.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e10); + } + } + if (s52 !== peg$FAILED) { + while (s52 !== peg$FAILED) { + s42.push(s52); + if (peg$r0.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e10); + } + } + } + } else { + s42 = peg$FAILED; + } + if (s42 !== peg$FAILED) { + if (input.substr(peg$currPos, 2) === peg$c10) { + s52 = peg$c10; + peg$currPos += 2; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e11); + } + } + if (s52 !== peg$FAILED) { + s32 = [s32, s42, s52]; + s22 = s32; + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + if (s22 !== peg$FAILED) { + s1 = input.substring(s1, peg$currPos); + } else { + s1 = s22; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f11(s1); + } + s0 = s1; + return s0; + } + function peg$parseCustomScriptFilterExpression() { + var s0, s1, s22, s32, s42; + s0 = peg$currPos; + s1 = peg$currPos; + s22 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 64) { + s32 = peg$c9; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + if (s32 !== peg$FAILED) { + s42 = peg$parseJsonPathPlusFilterFunction(); + if (s42 !== peg$FAILED) { + peg$savedPos = s22; + s22 = peg$f12(s42); + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + } else { + peg$currPos = s22; + s22 = peg$FAILED; + } + if (s22 !== peg$FAILED) { + s1 = input.substring(s1, peg$currPos); + } else { + s1 = s22; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f11(s1); + } + s0 = s1; + return s0; + } + function peg$parseKeyExpression() { + var s0, s1; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 126) { + s1 = peg$c11; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e12); + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f13(); + } + s0 = s1; + return s0; + } + function peg$parseParentExpression() { + var s0, s1; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 94) { + s1 = peg$c12; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e13); + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f14(); + } + s0 = s1; + return s0; + } + function peg$parseModifier() { + var s0; + s0 = peg$parseKeyExpression(); + if (s0 === peg$FAILED) { + s0 = peg$parseParentExpression(); + } + return s0; + } + function peg$parseDescendant() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c4) { + s1 = peg$c4; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e4); + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f15(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e14); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 91) { + s32 = peg$c1; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + peg$silentFails--; + if (s32 !== peg$FAILED) { + peg$currPos = s22; + s22 = void 0; + } else { + s22 = peg$FAILED; + } + if (s22 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f15(); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c13; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e14); + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f16(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (peg$r1.test(input.charAt(peg$currPos))) { + s22 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e15); + } + } + peg$silentFails--; + if (s22 !== peg$FAILED) { + peg$currPos = s1; + s1 = void 0; + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f16(); + } + s0 = s1; + } + } + } + return s0; + } + function peg$parseIdentifier() { + var s0, s1, s22; + s0 = peg$currPos; + s1 = []; + if (peg$r2.test(input.charAt(peg$currPos))) { + s22 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + if (s22 === peg$FAILED) { + s22 = peg$parseChar(); + if (s22 === peg$FAILED) { + s22 = peg$parseDigit(); + } + } + if (s22 !== peg$FAILED) { + while (s22 !== peg$FAILED) { + s1.push(s22); + if (peg$r2.test(input.charAt(peg$currPos))) { + s22 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e16); + } + } + if (s22 === peg$FAILED) { + s22 = peg$parseChar(); + if (s22 === peg$FAILED) { + s22 = peg$parseDigit(); + } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + return s0; + } + function peg$parseMemberIdentifier() { + var s0, s1, s22, s32, s42, s52; + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f17(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s22 = peg$c14; + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + if (s22 !== peg$FAILED) { + s32 = peg$currPos; + s42 = []; + if (peg$r3.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + while (s52 !== peg$FAILED) { + s42.push(s52); + if (peg$r3.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + } + s32 = input.substring(s32, peg$currPos); + if (input.charCodeAt(peg$currPos) === 34) { + s42 = peg$c14; + peg$currPos++; + } else { + s42 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e17); + } + } + if (s42 !== peg$FAILED) { + s22 = [s22, s32, s42]; + s1 = s22; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 === peg$FAILED) { + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s22 = peg$c15; + peg$currPos++; + } else { + s22 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + if (s22 !== peg$FAILED) { + s32 = peg$currPos; + s42 = []; + if (peg$r4.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + while (s52 !== peg$FAILED) { + s42.push(s52); + if (peg$r4.test(input.charAt(peg$currPos))) { + s52 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s52 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + } + s32 = input.substring(s32, peg$currPos); + if (input.charCodeAt(peg$currPos) === 39) { + s42 = peg$c15; + peg$currPos++; + } else { + s42 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e19); + } + } + if (s42 !== peg$FAILED) { + s22 = [s22, s32, s42]; + s1 = s22; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f18(); + } + s0 = s1; + } + return s0; + } + function peg$parseNumber() { + var s0, s22, s32; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 45) { + peg$currPos++; + } else { + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + s22 = []; + s32 = peg$parseDigit(); + if (s32 !== peg$FAILED) { + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$parseDigit(); + } + } else { + s22 = peg$FAILED; + } + if (s22 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f19(); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseWildcard() { + var s0; + if (input.charCodeAt(peg$currPos) === 42) { + s0 = peg$c17; + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e22); + } + } + return s0; + } + function peg$parseChar() { + var s0; + if (peg$r5.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e23); + } + } + return s0; + } + function peg$parseDigit() { + var s0; + if (peg$r6.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e24); + } + } + return s0; + } + function peg$parseSpace() { + var s0; + if (peg$r7.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e25); + } + } + return s0; + } + function peg$parseJSScript() { + var s0, s1, s22; + s0 = peg$currPos; + s1 = []; + s22 = peg$parseChar(); + if (s22 === peg$FAILED) { + s22 = peg$parseDigit(); + if (s22 === peg$FAILED) { + s22 = peg$parseSpace(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSToken(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSString(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSScriptElementAccess(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSFnCall(); + } + } + } + } + } + } + if (s22 !== peg$FAILED) { + while (s22 !== peg$FAILED) { + s1.push(s22); + s22 = peg$parseChar(); + if (s22 === peg$FAILED) { + s22 = peg$parseDigit(); + if (s22 === peg$FAILED) { + s22 = peg$parseSpace(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSToken(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSString(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSScriptElementAccess(); + if (s22 === peg$FAILED) { + s22 = peg$parseJSFnCall(); + } + } + } + } + } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + return s0; + } + function peg$parseJSScriptElementAccess() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 91) { + s1 = peg$c1; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e1); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + s32 = peg$parseDigit(); + if (s32 === peg$FAILED) { + s32 = peg$parseChar(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSString(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSFnCall(); + } + } + } + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$parseDigit(); + if (s32 === peg$FAILED) { + s32 = peg$parseChar(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSString(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSFnCall(); + } + } + } + } + if (input.charCodeAt(peg$currPos) === 93) { + s32 = peg$c2; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e2); + } + } + if (s32 !== peg$FAILED) { + s1 = [s1, s22, s32]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseJSString() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (peg$r8.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e26); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + if (peg$r3.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + while (s32 !== peg$FAILED) { + s22.push(s32); + if (peg$r3.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e18); + } + } + } + if (peg$r8.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e26); + } + } + if (s32 !== peg$FAILED) { + s1 = [s1, s22, s32]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (peg$r9.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e27); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + if (peg$r4.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + while (s32 !== peg$FAILED) { + s22.push(s32); + if (peg$r4.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e20); + } + } + } + if (peg$r9.test(input.charAt(peg$currPos))) { + s32 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e27); + } + } + if (s32 !== peg$FAILED) { + s1 = [s1, s22, s32]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + return s0; + } + function peg$parseJSToken() { + var s0; + if (peg$r10.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e28); + } + } + return s0; + } + function peg$parseJSFnCall() { + var s0, s1, s22, s32; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c5; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e5); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + s32 = peg$parseJSString(); + if (s32 === peg$FAILED) { + s32 = peg$parseChar(); + if (s32 === peg$FAILED) { + s32 = peg$parseDigit(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSScriptElementAccess(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSToken(); + if (s32 === peg$FAILED) { + s32 = peg$parseSpace(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSFnCall(); + } + } + } + } + } + } + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$parseJSString(); + if (s32 === peg$FAILED) { + s32 = peg$parseChar(); + if (s32 === peg$FAILED) { + s32 = peg$parseDigit(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSScriptElementAccess(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSToken(); + if (s32 === peg$FAILED) { + s32 = peg$parseSpace(); + if (s32 === peg$FAILED) { + s32 = peg$parseJSFnCall(); + } + } + } + } + } + } + } + if (input.charCodeAt(peg$currPos) === 41) { + s32 = peg$c6; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e6); + } + } + if (s32 !== peg$FAILED) { + s1 = [s1, s22, s32]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseEvalExpression() { + var s0, s1, s22; + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 64) { + s1 = peg$c9; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e9); + } + } + if (s1 !== peg$FAILED) { + s22 = peg$parseLengthEvalExpression(); + if (s22 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f4(s22); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + function peg$parseLengthEvalExpression() { + var s0, s1, s22, s32, s42, s52, s62, s7; + s0 = peg$currPos; + if (input.substr(peg$currPos, 7) === peg$c18) { + s1 = peg$c18; + peg$currPos += 7; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e29); + } + } + if (s1 !== peg$FAILED) { + s22 = []; + s32 = peg$parseSpace(); + while (s32 !== peg$FAILED) { + s22.push(s32); + s32 = peg$parseSpace(); + } + if (input.charCodeAt(peg$currPos) === 45) { + s32 = peg$c16; + peg$currPos++; + } else { + s32 = peg$FAILED; + if (peg$silentFails === 0) { + peg$fail(peg$e21); + } + } + if (s32 !== peg$FAILED) { + s42 = []; + s52 = peg$parseSpace(); + while (s52 !== peg$FAILED) { + s42.push(s52); + s52 = peg$parseSpace(); + } + s52 = peg$currPos; + s62 = []; + s7 = peg$parseDigit(); + if (s7 !== peg$FAILED) { + while (s7 !== peg$FAILED) { + s62.push(s7); + s7 = peg$parseDigit(); + } + } else { + s62 = peg$FAILED; + } + if (s62 !== peg$FAILED) { + s52 = input.substring(s52, peg$currPos); + } else { + s52 = s62; + } + if (s52 !== peg$FAILED) { + peg$savedPos = s0; + s0 = peg$f20(s52); + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + return s0; + } + peg$result = peg$startRuleFunction(); + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + exports28.SyntaxError = peg$SyntaxError; + exports28.parse = peg$parse; + } +}); + +// node_modules/nimma/dist/legacy/cjs/parser/index.js +var require_parser2 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/parser/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var parserError = require_parser_error(); + var parser3 = require_parser(); + var { + parse: parse17 + } = parser3; + function parse$1(input) { + try { + return parse17(input); + } catch (e10) { + throw new parserError["default"](e10.message, input, { + cause: e10 + }); + } + } + exports28["default"] = parse$1; + } +}); + +// node_modules/nimma/dist/legacy/cjs/core/utils/parse-expressions.js +var require_parse_expressions = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/core/utils/parse-expressions.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var iterator = require_iterator(); + var index4 = require_parser2(); + var aggregateError = require_aggregate_error(); + function pickException([, ex]) { + return ex; + } + function pickExpression([expression]) { + return expression; + } + function parseExpressions(expressions, unsafe, hasFallback) { + const mappedExpressions = []; + const erroredExpressions = []; + for (const expression of new Set(expressions)) { + try { + const parsed = index4["default"](expression); + if (unsafe === false && iterator["default"].analyze(parsed).bailed) { + throw SyntaxError("Unsafe expressions are ignored, but no fallback was specified"); + } + mappedExpressions.push([expression, parsed]); + } catch (e10) { + erroredExpressions.push([expression, e10]); + } + } + if (!hasFallback && erroredExpressions.length > 0) { + throw new aggregateError["default"](erroredExpressions.map(pickException), `Error parsing ${erroredExpressions.map(pickExpression).join(", ")}`); + } + return { + erroredExpressions: erroredExpressions.map(pickExpression), + mappedExpressions + }; + } + exports28["default"] = parseExpressions; + } +}); + +// node_modules/nimma/dist/legacy/cjs/core/index.js +var require_core6 = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/core/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var _rollupPluginBabelHelpers = require_rollupPluginBabelHelpers(); + var index4 = require_baseline(); + var index$1 = require_runtime(); + var determineFormat = require_determine_format(); + var parseExpressions = require_parse_expressions(); + var IMPORT_DECLARATIONS_REGEXP = /import\s*({[^}]+})\s*from\s*['"][^'"]+['"];?/; + var _fallback = /* @__PURE__ */ new WeakMap(); + var _compiledFn = /* @__PURE__ */ new WeakMap(); + var Nimma = class { + constructor(expressions, { + fallback = null, + unsafe = true, + output = "auto", + npmProvider = null, + customShorthands = null + } = {}) { + _fallback.set(this, { + writable: true, + value: void 0 + }); + _compiledFn.set(this, { + writable: true, + value: void 0 + }); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _fallback, fallback); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _compiledFn, null); + const { + erroredExpressions, + mappedExpressions + } = parseExpressions["default"](expressions, unsafe, fallback !== null); + this.tree = index4["default"](mappedExpressions, { + customShorthands, + format: output === "auto" ? determineFormat["default"]() : output, + npmProvider + }); + if (erroredExpressions.length > 0) { + this.tree.attachFallbackExpressions(fallback, erroredExpressions); + } + this.sourceCode = String(this.tree); + } + query(input, callbacks) { + if (_rollupPluginBabelHelpers.classPrivateFieldGet(this, _compiledFn) !== null) { + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _compiledFn).call(this, input, callbacks); + return; + } + const globals3 = "__nimma_globals__"; + const code = this.sourceCode.replace("export default function", `return function`).replace(IMPORT_DECLARATIONS_REGEXP, `const $1 = ${globals3};`).replace(RegExp(IMPORT_DECLARATIONS_REGEXP.source, "g"), ""); + _rollupPluginBabelHelpers.classPrivateFieldSet(this, _compiledFn, Function(globals3, ..._rollupPluginBabelHelpers.classPrivateFieldGet(this, _fallback) === null ? [] : Array.from(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _fallback).runtimeDeps.keys()), code)(index$1, ..._rollupPluginBabelHelpers.classPrivateFieldGet(this, _fallback) === null ? [] : Array.from(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _fallback).runtimeDeps.values()))); + _rollupPluginBabelHelpers.classPrivateFieldGet(this, _compiledFn).call(this, input, callbacks); + } + }; + exports28["default"] = Nimma; + } +}); + +// node_modules/nimma/dist/legacy/cjs/index.js +var require_cjs = __commonJS({ + "node_modules/nimma/dist/legacy/cjs/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var index4 = require_core6(); + exports28.default = index4["default"]; + } +}); + +// node_modules/lodash.topath/index.js +var require_lodash = __commonJS({ + "node_modules/lodash.topath/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var FUNC_ERROR_TEXT13 = "Expected a function"; + var HASH_UNDEFINED4 = "__lodash_hash_undefined__"; + var INFINITY7 = 1 / 0; + var funcTag4 = "[object Function]"; + var genTag3 = "[object GeneratorFunction]"; + var symbolTag5 = "[object Symbol]"; + var reLeadingDot = /^\./; + var rePropName2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar3 = /[\\^$.*+?()[\]{}|]/g; + var reEscapeChar2 = /\\(\\)?/g; + var reIsHostCtor2 = /^\[object .+?Constructor\]$/; + var freeGlobal2 = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis; + var freeSelf2 = typeof self == "object" && self && self.Object === Object && self; + var root2 = freeGlobal2 || freeSelf2 || Function("return this")(); + function arrayMap2(array, iteratee2) { + var index4 = -1, length = array ? array.length : 0, result2 = Array(length); + while (++index4 < length) { + result2[index4] = iteratee2(array[index4], index4, array); + } + return result2; + } + function getValue2(object, key) { + return object == null ? void 0 : object[key]; + } + function isHostObject(value2) { + var result2 = false; + if (value2 != null && typeof value2.toString != "function") { + try { + result2 = !!(value2 + ""); + } catch (e10) { + } + } + return result2; + } + var arrayProto7 = Array.prototype; + var funcProto4 = Function.prototype; + var objectProto31 = Object.prototype; + var coreJsData2 = root2["__core-js_shared__"]; + var maskSrcKey2 = function() { + var uid = /[^.]+$/.exec(coreJsData2 && coreJsData2.keys && coreJsData2.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var funcToString4 = funcProto4.toString; + var hasOwnProperty27 = objectProto31.hasOwnProperty; + var objectToString2 = objectProto31.toString; + var reIsNative2 = RegExp( + "^" + funcToString4.call(hasOwnProperty27).replace(reRegExpChar3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Symbol3 = root2.Symbol; + var splice4 = arrayProto7.splice; + var Map3 = getNative2(root2, "Map"); + var nativeCreate2 = getNative2(Object, "create"); + var symbolProto4 = Symbol3 ? Symbol3.prototype : void 0; + var symbolToString2 = symbolProto4 ? symbolProto4.toString : void 0; + function Hash3(entries) { + var index4 = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } + } + function hashClear2() { + this.__data__ = nativeCreate2 ? nativeCreate2(null) : {}; + } + function hashDelete2(key) { + return this.has(key) && delete this.__data__[key]; + } + function hashGet2(key) { + var data = this.__data__; + if (nativeCreate2) { + var result2 = data[key]; + return result2 === HASH_UNDEFINED4 ? void 0 : result2; + } + return hasOwnProperty27.call(data, key) ? data[key] : void 0; + } + function hashHas2(key) { + var data = this.__data__; + return nativeCreate2 ? data[key] !== void 0 : hasOwnProperty27.call(data, key); + } + function hashSet2(key, value2) { + var data = this.__data__; + data[key] = nativeCreate2 && value2 === void 0 ? HASH_UNDEFINED4 : value2; + return this; + } + Hash3.prototype.clear = hashClear2; + Hash3.prototype["delete"] = hashDelete2; + Hash3.prototype.get = hashGet2; + Hash3.prototype.has = hashHas2; + Hash3.prototype.set = hashSet2; + function ListCache2(entries) { + var index4 = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } + } + function listCacheClear2() { + this.__data__ = []; + } + function listCacheDelete2(key) { + var data = this.__data__, index4 = assocIndexOf2(data, key); + if (index4 < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index4 == lastIndex) { + data.pop(); + } else { + splice4.call(data, index4, 1); + } + return true; + } + function listCacheGet2(key) { + var data = this.__data__, index4 = assocIndexOf2(data, key); + return index4 < 0 ? void 0 : data[index4][1]; + } + function listCacheHas2(key) { + return assocIndexOf2(this.__data__, key) > -1; + } + function listCacheSet2(key, value2) { + var data = this.__data__, index4 = assocIndexOf2(data, key); + if (index4 < 0) { + data.push([key, value2]); + } else { + data[index4][1] = value2; + } + return this; + } + ListCache2.prototype.clear = listCacheClear2; + ListCache2.prototype["delete"] = listCacheDelete2; + ListCache2.prototype.get = listCacheGet2; + ListCache2.prototype.has = listCacheHas2; + ListCache2.prototype.set = listCacheSet2; + function MapCache2(entries) { + var index4 = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index4 < length) { + var entry = entries[index4]; + this.set(entry[0], entry[1]); + } + } + function mapCacheClear2() { + this.__data__ = { + "hash": new Hash3(), + "map": new (Map3 || ListCache2)(), + "string": new Hash3() + }; + } + function mapCacheDelete2(key) { + return getMapData2(this, key)["delete"](key); + } + function mapCacheGet2(key) { + return getMapData2(this, key).get(key); + } + function mapCacheHas2(key) { + return getMapData2(this, key).has(key); + } + function mapCacheSet2(key, value2) { + getMapData2(this, key).set(key, value2); + return this; + } + MapCache2.prototype.clear = mapCacheClear2; + MapCache2.prototype["delete"] = mapCacheDelete2; + MapCache2.prototype.get = mapCacheGet2; + MapCache2.prototype.has = mapCacheHas2; + MapCache2.prototype.set = mapCacheSet2; + function assocIndexOf2(array, key) { + var length = array.length; + while (length--) { + if (eq2(array[length][0], key)) { + return length; + } + } + return -1; + } + function baseIsNative2(value2) { + if (!isObject8(value2) || isMasked2(value2)) { + return false; + } + var pattern5 = isFunction3(value2) || isHostObject(value2) ? reIsNative2 : reIsHostCtor2; + return pattern5.test(toSource2(value2)); + } + function baseToString2(value2) { + if (typeof value2 == "string") { + return value2; + } + if (isSymbol3(value2)) { + return symbolToString2 ? symbolToString2.call(value2) : ""; + } + var result2 = value2 + ""; + return result2 == "0" && 1 / value2 == -INFINITY7 ? "-0" : result2; + } + function copyArray2(source, array) { + var index4 = -1, length = source.length; + array || (array = Array(length)); + while (++index4 < length) { + array[index4] = source[index4]; + } + return array; + } + function getMapData2(map4, key) { + var data = map4.__data__; + return isKeyable2(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + function getNative2(object, key) { + var value2 = getValue2(object, key); + return baseIsNative2(value2) ? value2 : void 0; + } + function isKeyable2(value2) { + var type3 = typeof value2; + return type3 == "string" || type3 == "number" || type3 == "symbol" || type3 == "boolean" ? value2 !== "__proto__" : value2 === null; + } + function isMasked2(func) { + return !!maskSrcKey2 && maskSrcKey2 in func; + } + var stringToPath2 = memoize2(function(string2) { + string2 = toString3(string2); + var result2 = []; + if (reLeadingDot.test(string2)) { + result2.push(""); + } + string2.replace(rePropName2, function(match, number, quote, string3) { + result2.push(quote ? string3.replace(reEscapeChar2, "$1") : number || match); + }); + return result2; + }); + function toKey2(value2) { + if (typeof value2 == "string" || isSymbol3(value2)) { + return value2; + } + var result2 = value2 + ""; + return result2 == "0" && 1 / value2 == -INFINITY7 ? "-0" : result2; + } + function toSource2(func) { + if (func != null) { + try { + return funcToString4.call(func); + } catch (e10) { + } + try { + return func + ""; + } catch (e10) { + } + } + return ""; + } + function memoize2(func, resolver) { + if (typeof func != "function" || resolver && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT13); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result2 = func.apply(this, args); + memoized.cache = cache.set(key, result2); + return result2; + }; + memoized.cache = new (memoize2.Cache || MapCache2)(); + return memoized; + } + memoize2.Cache = MapCache2; + function eq2(value2, other) { + return value2 === other || value2 !== value2 && other !== other; + } + var isArray3 = Array.isArray; + function isFunction3(value2) { + var tag = isObject8(value2) ? objectToString2.call(value2) : ""; + return tag == funcTag4 || tag == genTag3; + } + function isObject8(value2) { + var type3 = typeof value2; + return !!value2 && (type3 == "object" || type3 == "function"); + } + function isObjectLike2(value2) { + return !!value2 && typeof value2 == "object"; + } + function isSymbol3(value2) { + return typeof value2 == "symbol" || isObjectLike2(value2) && objectToString2.call(value2) == symbolTag5; + } + function toString3(value2) { + return value2 == null ? "" : baseToString2(value2); + } + function toPath2(value2) { + if (isArray3(value2)) { + return arrayMap2(value2, toKey2); + } + return isSymbol3(value2) ? [value2] : copyArray2(stringToPath2(value2)); + } + module5.exports = toPath2; + } +}); + +// node_modules/nimma/dist/cjs/codegen/ast/builders.js +var require_builders2 = __commonJS({ + "node_modules/nimma/dist/cjs/codegen/ast/builders.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + function program(body) { + return { + type: "Program", + body + }; + } + function blockStatement(body, directives) { + return { + type: "BlockStatement", + body, + directives + }; + } + function expressionStatement(expression) { + return { + type: "ExpressionStatement", + expression + }; + } + function literal(value2) { + switch (typeof value2) { + case "number": + return numericLiteral(value2); + case "string": + return stringLiteral(value2); + case "boolean": + return booleanLiteral(value2); + } + } + function stringLiteral(value2) { + return { + type: "StringLiteral", + value: value2 + }; + } + function booleanLiteral(value2) { + return { + type: "BooleanLiteral", + value: value2 + }; + } + function numericLiteral(value2) { + return { + type: "NumericLiteral", + value: value2 + }; + } + function nullLiteral() { + return { + type: "NullLiteral", + value: null + }; + } + function regExpLiteral(pattern5, flags = "") { + return { + type: "RegExpLiteral", + pattern: pattern5, + flags + }; + } + function identifier(name2) { + return { + type: "Identifier", + name: name2 + }; + } + function logicalExpression(operator, left, right) { + return { + type: "LogicalExpression", + operator, + left, + right + }; + } + function conditionalExpression(test, consequent, alternate) { + return { + type: "ConditionalExpression", + test, + consequent, + alternate + }; + } + function ifStatement(test, consequent, alternate) { + return { + type: "IfStatement", + test, + consequent, + alternate + }; + } + function binaryExpression(operator, left, right) { + return { + type: "BinaryExpression", + operator, + left, + right + }; + } + function safeBinaryExpression(operator, left, right) { + let actualRight = right; + if (right.type === "NumericLiteral") { + actualRight = stringLiteral(String(right.value)); + } else if (right.type === "StringLiteral" && Number.isSafeInteger(Number(right.value))) { + actualRight = stringLiteral(String(right.value)); + } + return { + type: "BinaryExpression", + operator, + left: actualRight === right ? left : callExpression(identifier("String"), [left]), + right: actualRight + }; + } + function unaryExpression(operator, argument, prefix = true) { + return { + type: "UnaryExpression", + operator, + argument, + prefix + }; + } + function memberExpression(object, property2, computed = false, optional = null) { + return { + type: "MemberExpression", + object, + property: property2, + computed, + optional + }; + } + function assignmentExpression(operator, left, right) { + return { + type: "AssignmentExpression", + operator, + left, + right + }; + } + function callExpression(callee, _arguments) { + return { + type: "CallExpression", + callee, + arguments: _arguments + }; + } + function functionDeclaration(id, params, body) { + return { + type: "FunctionDeclaration", + id, + params, + body + }; + } + function returnStatement(argument) { + return { + type: "ReturnStatement", + argument + }; + } + function sequenceExpression(expressions) { + return { + type: "SequenceExpression", + expressions + }; + } + function forOfStatement(left, right, body, _await) { + return { + type: "ForOfStatement", + left, + right, + body, + await: _await + }; + } + function arrayExpression(elements) { + return { + type: "ArrayExpression", + elements + }; + } + function objectExpression(properties) { + return { + type: "ObjectExpression", + properties + }; + } + function objectMethod(kind, key, params, body, computed = false, generator = false, _async = false) { + return { + type: "ObjectMethod", + kind, + key, + params, + body, + computed, + generator, + async: _async + }; + } + function objectProperty(key, value2, computed = false, shorthand = false, decorators = null) { + return { + type: "ObjectProperty", + key, + value: value2, + computed, + shorthand, + decorators + }; + } + function variableDeclaration(kind, declarations) { + return { + type: "VariableDeclaration", + kind, + declarations + }; + } + function variableDeclarator(id, init2) { + return { + type: "VariableDeclarator", + id, + init: init2 + }; + } + function newExpression(callee, _arguments) { + return { + type: "NewExpression", + callee, + arguments: _arguments + }; + } + function importDeclaration(specifiers, source) { + return { + type: "ImportDeclaration", + specifiers, + source + }; + } + function importSpecifier(local, imported) { + return { + type: "ImportSpecifier", + local, + imported + }; + } + function exportDefaultDeclaration(declaration) { + return { + type: "ExportDefaultDeclaration", + declaration + }; + } + function arrowFunctionExpression(params, body, _async = false) { + return { + type: "ArrowFunctionExpression", + params, + body, + async: _async + }; + } + function tryStatement(block, handler = null, finalizer = null) { + return { + type: "TryStatement", + block, + handler, + finalizer + }; + } + function templateElement(value2, tail2 = false) { + return { + type: "TemplateElement", + value: value2, + tail: tail2 + }; + } + function templateLiteral(quasis, expressions) { + return { + type: "TemplateLiteral", + quasis, + expressions + }; + } + exports28.arrayExpression = arrayExpression; + exports28.arrowFunctionExpression = arrowFunctionExpression; + exports28.assignmentExpression = assignmentExpression; + exports28.binaryExpression = binaryExpression; + exports28.blockStatement = blockStatement; + exports28.booleanLiteral = booleanLiteral; + exports28.callExpression = callExpression; + exports28.conditionalExpression = conditionalExpression; + exports28.exportDefaultDeclaration = exportDefaultDeclaration; + exports28.expressionStatement = expressionStatement; + exports28.forOfStatement = forOfStatement; + exports28.functionDeclaration = functionDeclaration; + exports28.identifier = identifier; + exports28.ifStatement = ifStatement; + exports28.importDeclaration = importDeclaration; + exports28.importSpecifier = importSpecifier; + exports28.literal = literal; + exports28.logicalExpression = logicalExpression; + exports28.memberExpression = memberExpression; + exports28.newExpression = newExpression; + exports28.nullLiteral = nullLiteral; + exports28.numericLiteral = numericLiteral; + exports28.objectExpression = objectExpression; + exports28.objectMethod = objectMethod; + exports28.objectProperty = objectProperty; + exports28.program = program; + exports28.regExpLiteral = regExpLiteral; + exports28.returnStatement = returnStatement; + exports28.safeBinaryExpression = safeBinaryExpression; + exports28.sequenceExpression = sequenceExpression; + exports28.stringLiteral = stringLiteral; + exports28.templateElement = templateElement; + exports28.templateLiteral = templateLiteral; + exports28.tryStatement = tryStatement; + exports28.unaryExpression = unaryExpression; + exports28.variableDeclaration = variableDeclaration; + exports28.variableDeclarator = variableDeclarator; + } +}); + +// node_modules/nimma/dist/cjs/codegen/fallback.js +var require_fallback = __commonJS({ + "node_modules/nimma/dist/cjs/codegen/fallback.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var builders = require_builders2(); + function safeName(name2) { + return `nimma_${name2}`; + } + function safeIdentifier(name2) { + return builders.identifier(safeName(name2)); + } + function getFunctionBody(fn) { + const source = Reflect.apply(Function.toString, fn, []); + const paramsDefEnd = source.indexOf(")") + 1; + const body = source.slice(paramsDefEnd).replace(/^\s*(=>\s*)?/, ""); + const arr = source.slice(source.indexOf("("), paramsDefEnd).split(/[,\s]+/).splice(0, 3); + return `${arr.join(", ")} => ${body}`; + } + var _modules, _deps, _fn, _extraCode; + var Fallback = class { + constructor(deps, fn) { + __privateAdd(this, _modules, /* @__PURE__ */ new Set()); + __privateAdd(this, _deps, /* @__PURE__ */ new Map()); + __privateAdd(this, _fn, void 0); + __privateAdd(this, _extraCode, ""); + __publicField(this, "runtimeDeps", /* @__PURE__ */ new Map()); + __privateSet(this, _fn, fn); + for (const [source, specifiers] of Object.entries(deps)) { + const importSpecifiers = []; + for (const { + imported, + local, + value: value2 + } of specifiers) { + __privateGet(this, _deps).set(local, value2); + this.runtimeDeps.set(safeName(local), value2); + importSpecifiers.push(builders.importSpecifier(safeIdentifier(local), builders.identifier(imported))); + __privateGet(this, _modules).add(builders.importDeclaration(importSpecifiers, builders.stringLiteral(source))); + } + } + } + get extraCode() { + __privateGet(this, _extraCode) || __privateSet(this, _extraCode, getFunctionBody(__privateGet(this, _fn))); + return __privateGet(this, _extraCode); + } + attach(tree) { + for (const mod2 of __privateGet(this, _modules)) { + tree.push(mod2, "program"); + } + const id = builders.identifier("fallback"); + const args = Array.from(__privateGet(this, _deps).keys()); + tree.push(builders.variableDeclaration("const", [builders.variableDeclarator(id, builders.callExpression(builders.memberExpression(builders.callExpression(builders.identifier("Function"), [builders.templateLiteral([builders.templateElement({ + raw: `return ${this.extraCode}` + })], [])]), builders.identifier("call")), [builders.objectExpression(args.map((arg) => builders.objectProperty(builders.stringLiteral(arg), safeIdentifier(arg))))]))]), "program"); + return id; + } + }; + _modules = new WeakMap(); + _deps = new WeakMap(); + _fn = new WeakMap(); + _extraCode = new WeakMap(); + exports28["default"] = Fallback; + } +}); + +// node_modules/nimma/dist/cjs/fallbacks/jsonpath-plus.js +var require_jsonpath_plus = __commonJS({ + "node_modules/nimma/dist/cjs/fallbacks/jsonpath-plus.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var jsonpathPlus$1 = (init_index_browser_esm(), __toCommonJS(index_browser_esm_exports)); + var toPath2 = require_lodash(); + var fallback = require_fallback(); + function _interopDefaultLegacy(e10) { + return e10 && typeof e10 === "object" && "default" in e10 ? e10 : { "default": e10 }; + } + var toPath__default = /* @__PURE__ */ _interopDefaultLegacy(toPath2); + var jsonpathPlus = new fallback["default"]( + { + "jsonpath-plus": [{ + imported: "JSONPath", + local: "JSONPath", + value: jsonpathPlus$1.JSONPath + }], + "lodash.topath": [{ + imported: "default", + local: "toPath", + value: toPath__default["default"] + }] + }, + // this part is tested, but cannot be covered because we never get to execute the actual fn + // what we do is we get the source code of it and construct a new fn based on that code + /* c8 ignore start */ + function(input, path2, fn) { + this.JSONPath({ + callback: (result2) => { + fn({ + path: this.toPath(result2.path.slice(1)), + value: result2.value + }); + }, + json: input, + path: path2, + resultType: "all" + }); + } + ); + exports28["default"] = jsonpathPlus; + } +}); + +// node_modules/nimma/dist/cjs/fallbacks/index.js +var require_fallbacks = __commonJS({ + "node_modules/nimma/dist/cjs/fallbacks/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var jsonpathPlus = require_jsonpath_plus(); + exports28.jsonPathPlus = jsonpathPlus["default"]; + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/runner.js +var require_runner2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/runner.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Runner = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var results_1 = require_results(); + var lintNode_1 = require_lintNode(); + var legacy_1 = (0, tslib_1.__importDefault)(require_cjs()); + var fallbacks_1 = require_fallbacks(); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var Runner = class { + constructor(inventory) { + var _a2; + this.inventory = inventory; + this.results = [...this.inventory.diagnostics, ...(_a2 = this.inventory.errors) !== null && _a2 !== void 0 ? _a2 : []]; + } + get document() { + return this.inventory.document; + } + addResult(result2) { + this.results.push(result2); + } + async run(ruleset) { + var _a2, _b; + var _c; + const { inventory: documentInventory } = this; + const { rules } = ruleset; + const formats = (_a2 = this.document.formats) !== null && _a2 !== void 0 ? _a2 : null; + const runnerContext = { + ruleset, + documentInventory, + results: this.results, + promises: [] + }; + const enabledRules = Object.values(rules).filter((rule) => rule.enabled); + const relevantRules = enabledRules.filter((rule) => rule.matchesFormat(documentInventory.formats)); + const callbacks = { + resolved: {}, + unresolved: {} + }; + for (const rule of relevantRules) { + for (const given of rule.getGivenForFormats(formats)) { + const cb = (scope) => { + (0, lintNode_1.lintNode)(runnerContext, scope, rule); + }; + ((_b = (_c = callbacks[rule.resolved ? "resolved" : "unresolved"])[given]) !== null && _b !== void 0 ? _b : _c[given] = []).push(cb); + } + } + const resolvedJsonPaths = Object.keys(callbacks.resolved); + const unresolvedJsonPaths = Object.keys(callbacks.unresolved); + if (resolvedJsonPaths.length > 0) { + execute(runnerContext.documentInventory.resolved, callbacks.resolved, resolvedJsonPaths); + } + if (unresolvedJsonPaths.length > 0) { + execute(runnerContext.documentInventory.unresolved, callbacks.unresolved, unresolvedJsonPaths); + } + if (runnerContext.promises.length > 0) { + await Promise.all(runnerContext.promises); + } + } + getResults() { + return (0, results_1.prepareResults)(this.results); + } + }; + exports28.Runner = Runner; + function execute(input, callbacks, jsonPathExpressions) { + var _a2; + if (!(0, json_1.isPlainObject)(input) && !Array.isArray(input)) { + for (const cb of (_a2 = callbacks.$) !== null && _a2 !== void 0 ? _a2 : []) { + cb({ + path: [], + value: input + }); + } + return; + } + const nimma = new legacy_1.default(jsonPathExpressions, { + fallback: fallbacks_1.jsonPathPlus, + unsafe: false, + output: "auto", + customShorthands: {} + }); + nimma.query(input, Object.entries(callbacks).reduce((mapped, [key, cbs]) => { + mapped[key] = (scope) => { + for (const cb of cbs) { + cb(scope); + } + }; + return mapped; + }, {})); + } + } +}); + +// node_modules/@stoplight/spectral-core/dist/runner/index.js +var require_runner3 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/runner/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Runner = void 0; + var runner_1 = require_runner2(); + Object.defineProperty(exports28, "Runner", { enumerable: true, get: function() { + return runner_1.Runner; + } }); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-DEMDiNwt.js +function unimplemented2(name2) { + throw new Error("Node.js process " + name2 + " is not supported by JSPM core outside of Node.js"); +} +function cleanUpNextTick2() { + if (!draining2 || !currentQueue2) + return; + draining2 = false; + if (currentQueue2.length) { + queue2 = currentQueue2.concat(queue2); + } else { + queueIndex2 = -1; + } + if (queue2.length) + drainQueue2(); +} +function drainQueue2() { + if (draining2) + return; + var timeout = setTimeout(cleanUpNextTick2, 0); + draining2 = true; + var len = queue2.length; + while (len) { + currentQueue2 = queue2; + queue2 = []; + while (++queueIndex2 < len) { + if (currentQueue2) + currentQueue2[queueIndex2].run(); + } + queueIndex2 = -1; + len = queue2.length; + } + currentQueue2 = null; + draining2 = false; + clearTimeout(timeout); +} +function nextTick2(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i7 = 1; i7 < arguments.length; i7++) + args[i7 - 1] = arguments[i7]; + } + queue2.push(new Item2(fun, args)); + if (queue2.length === 1 && !draining2) + setTimeout(drainQueue2, 0); +} +function Item2(fun, array) { + this.fun = fun; + this.array = array; +} +function noop3() { +} +function _linkedBinding2(name2) { + unimplemented2("_linkedBinding"); +} +function dlopen2(name2) { + unimplemented2("dlopen"); +} +function _getActiveRequests2() { + return []; +} +function _getActiveHandles2() { + return []; +} +function assert2(condition, message) { + if (!condition) + throw new Error(message || "assertion error"); +} +function hasUncaughtExceptionCaptureCallback2() { + return false; +} +function uptime2() { + return _performance2.now() / 1e3; +} +function hrtime2(previousTimestamp) { + var baseNow = Math.floor((Date.now() - _performance2.now()) * 1e-3); + var clocktime = _performance2.now() * 1e-3; + var seconds = Math.floor(clocktime) + baseNow; + var nanoseconds = Math.floor(clocktime % 1 * 1e9); + if (previousTimestamp) { + seconds = seconds - previousTimestamp[0]; + nanoseconds = nanoseconds - previousTimestamp[1]; + if (nanoseconds < 0) { + seconds--; + nanoseconds += nanoPerSec2; + } + } + return [seconds, nanoseconds]; +} +function on2() { + return process3; +} +function listeners2(name2) { + return []; +} +var queue2, draining2, currentQueue2, queueIndex2, title2, arch2, platform2, env2, argv2, execArgv2, version2, versions2, emitWarning2, binding2, umask2, cwd2, chdir2, release2, _rawDebug2, moduleLoadList2, domain2, _exiting2, config2, reallyExit2, _kill2, cpuUsage2, resourceUsage2, memoryUsage2, kill2, exit2, openStdin2, allowedNodeEnvironmentFlags2, features2, _fatalExceptions2, setUncaughtExceptionCaptureCallback2, _tickCallback2, _debugProcess2, _debugEnd2, _startProfilerIdleNotifier2, _stopProfilerIdleNotifier2, stdout2, stderr2, stdin2, abort2, pid2, ppid2, execPath2, debugPort2, argv02, _preload_modules2, setSourceMapsEnabled2, _performance2, nowOffset, nanoPerSec2, _maxListeners2, _events2, _eventsCount2, addListener2, once3, off2, removeListener2, removeAllListeners2, emit2, prependListener2, prependOnceListener2, process3; +var init_chunk_DEMDiNwt = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-DEMDiNwt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + queue2 = []; + draining2 = false; + queueIndex2 = -1; + Item2.prototype.run = function() { + this.fun.apply(null, this.array); + }; + title2 = "browser"; + arch2 = "x64"; + platform2 = "browser"; + env2 = { + PATH: "/usr/bin", + LANG: navigator.language + ".UTF-8", + PWD: "/", + HOME: "/home", + TMP: "/tmp" + }; + argv2 = ["/usr/bin/node"]; + execArgv2 = []; + version2 = "v16.8.0"; + versions2 = {}; + emitWarning2 = function(message, type3) { + console.warn((type3 ? type3 + ": " : "") + message); + }; + binding2 = function(name2) { + unimplemented2("binding"); + }; + umask2 = function(mask) { + return 0; + }; + cwd2 = function() { + return "/"; + }; + chdir2 = function(dir2) { + }; + release2 = { + name: "node", + sourceUrl: "", + headersUrl: "", + libUrl: "" + }; + _rawDebug2 = noop3; + moduleLoadList2 = []; + domain2 = {}; + _exiting2 = false; + config2 = {}; + reallyExit2 = noop3; + _kill2 = noop3; + cpuUsage2 = function() { + return {}; + }; + resourceUsage2 = cpuUsage2; + memoryUsage2 = cpuUsage2; + kill2 = noop3; + exit2 = noop3; + openStdin2 = noop3; + allowedNodeEnvironmentFlags2 = {}; + features2 = { + inspector: false, + debug: false, + uv: false, + ipv6: false, + tls_alpn: false, + tls_sni: false, + tls_ocsp: false, + tls: false, + cached_builtins: true + }; + _fatalExceptions2 = noop3; + setUncaughtExceptionCaptureCallback2 = noop3; + _tickCallback2 = noop3; + _debugProcess2 = noop3; + _debugEnd2 = noop3; + _startProfilerIdleNotifier2 = noop3; + _stopProfilerIdleNotifier2 = noop3; + stdout2 = void 0; + stderr2 = void 0; + stdin2 = void 0; + abort2 = noop3; + pid2 = 2; + ppid2 = 1; + execPath2 = "/bin/usr/node"; + debugPort2 = 9229; + argv02 = "node"; + _preload_modules2 = []; + setSourceMapsEnabled2 = noop3; + _performance2 = { + now: typeof performance !== "undefined" ? performance.now.bind(performance) : void 0, + timing: typeof performance !== "undefined" ? performance.timing : void 0 + }; + if (_performance2.now === void 0) { + nowOffset = Date.now(); + if (_performance2.timing && _performance2.timing.navigationStart) { + nowOffset = _performance2.timing.navigationStart; + } + _performance2.now = () => Date.now() - nowOffset; + } + nanoPerSec2 = 1e9; + hrtime2.bigint = function(time2) { + var diff = hrtime2(time2); + if (typeof BigInt === "undefined") { + return diff[0] * nanoPerSec2 + diff[1]; + } + return BigInt(diff[0] * nanoPerSec2) + BigInt(diff[1]); + }; + _maxListeners2 = 10; + _events2 = {}; + _eventsCount2 = 0; + addListener2 = on2; + once3 = on2; + off2 = on2; + removeListener2 = on2; + removeAllListeners2 = on2; + emit2 = noop3; + prependListener2 = on2; + prependOnceListener2 = on2; + process3 = { + version: version2, + versions: versions2, + arch: arch2, + platform: platform2, + release: release2, + _rawDebug: _rawDebug2, + moduleLoadList: moduleLoadList2, + binding: binding2, + _linkedBinding: _linkedBinding2, + _events: _events2, + _eventsCount: _eventsCount2, + _maxListeners: _maxListeners2, + on: on2, + addListener: addListener2, + once: once3, + off: off2, + removeListener: removeListener2, + removeAllListeners: removeAllListeners2, + emit: emit2, + prependListener: prependListener2, + prependOnceListener: prependOnceListener2, + listeners: listeners2, + domain: domain2, + _exiting: _exiting2, + config: config2, + dlopen: dlopen2, + uptime: uptime2, + _getActiveRequests: _getActiveRequests2, + _getActiveHandles: _getActiveHandles2, + reallyExit: reallyExit2, + _kill: _kill2, + cpuUsage: cpuUsage2, + resourceUsage: resourceUsage2, + memoryUsage: memoryUsage2, + kill: kill2, + exit: exit2, + openStdin: openStdin2, + allowedNodeEnvironmentFlags: allowedNodeEnvironmentFlags2, + assert: assert2, + features: features2, + _fatalExceptions: _fatalExceptions2, + setUncaughtExceptionCaptureCallback: setUncaughtExceptionCaptureCallback2, + hasUncaughtExceptionCaptureCallback: hasUncaughtExceptionCaptureCallback2, + emitWarning: emitWarning2, + nextTick: nextTick2, + _tickCallback: _tickCallback2, + _debugProcess: _debugProcess2, + _debugEnd: _debugEnd2, + _startProfilerIdleNotifier: _startProfilerIdleNotifier2, + _stopProfilerIdleNotifier: _stopProfilerIdleNotifier2, + stdout: stdout2, + stdin: stdin2, + stderr: stderr2, + abort: abort2, + umask: umask2, + chdir: chdir2, + cwd: cwd2, + env: env2, + title: title2, + argv: argv2, + execArgv: execArgv2, + pid: pid2, + ppid: ppid2, + execPath: execPath2, + debugPort: debugPort2, + hrtime: hrtime2, + argv0: argv02, + _preload_modules: _preload_modules2, + setSourceMapsEnabled: setSourceMapsEnabled2 + }; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-BlJi4mNy.js +function dew2() { + if (_dewExec2) + return exports$12; + _dewExec2 = true; + var process$1 = process3; + function assertPath(path2) { + if (typeof path2 !== "string") { + throw new TypeError("Path must be a string. Received " + JSON.stringify(path2)); + } + } + function normalizeStringPosix(path2, allowAboveRoot) { + var res = ""; + var lastSegmentLength = 0; + var lastSlash = -1; + var dots = 0; + var code; + for (var i7 = 0; i7 <= path2.length; ++i7) { + if (i7 < path2.length) + code = path2.charCodeAt(i7); + else if (code === 47) + break; + else + code = 47; + if (code === 47) { + if (lastSlash === i7 - 1 || dots === 1) + ; + else if (lastSlash !== i7 - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { + if (res.length > 2) { + var lastSlashIndex = res.lastIndexOf("/"); + if (lastSlashIndex !== res.length - 1) { + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); + } + lastSlash = i7; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i7; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += "/.."; + else + res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) + res += "/" + path2.slice(lastSlash + 1, i7); + else + res = path2.slice(lastSlash + 1, i7); + lastSegmentLength = i7 - lastSlash - 1; + } + lastSlash = i7; + dots = 0; + } else if (code === 46 && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; + } + function _format(sep2, pathObject) { + var dir2 = pathObject.dir || pathObject.root; + var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || ""); + if (!dir2) { + return base; + } + if (dir2 === pathObject.root) { + return dir2 + base; + } + return dir2 + sep2 + base; + } + var posix2 = { + // path.resolve([from ...], to) + resolve: function resolve3() { + var resolvedPath = ""; + var resolvedAbsolute = false; + var cwd3; + for (var i7 = arguments.length - 1; i7 >= -1 && !resolvedAbsolute; i7--) { + var path2; + if (i7 >= 0) + path2 = arguments[i7]; + else { + if (cwd3 === void 0) + cwd3 = process$1.cwd(); + path2 = cwd3; + } + assertPath(path2); + if (path2.length === 0) { + continue; + } + resolvedPath = path2 + "/" + resolvedPath; + resolvedAbsolute = path2.charCodeAt(0) === 47; + } + resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) + return "/" + resolvedPath; + else + return "/"; + } else if (resolvedPath.length > 0) { + return resolvedPath; + } else { + return "."; + } + }, + normalize: function normalize2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var isAbsolute2 = path2.charCodeAt(0) === 47; + var trailingSeparator = path2.charCodeAt(path2.length - 1) === 47; + path2 = normalizeStringPosix(path2, !isAbsolute2); + if (path2.length === 0 && !isAbsolute2) + path2 = "."; + if (path2.length > 0 && trailingSeparator) + path2 += "/"; + if (isAbsolute2) + return "/" + path2; + return path2; + }, + isAbsolute: function isAbsolute2(path2) { + assertPath(path2); + return path2.length > 0 && path2.charCodeAt(0) === 47; + }, + join: function join3() { + if (arguments.length === 0) + return "."; + var joined; + for (var i7 = 0; i7 < arguments.length; ++i7) { + var arg = arguments[i7]; + assertPath(arg); + if (arg.length > 0) { + if (joined === void 0) + joined = arg; + else + joined += "/" + arg; + } + } + if (joined === void 0) + return "."; + return posix2.normalize(joined); + }, + relative: function relative2(from, to) { + assertPath(from); + assertPath(to); + if (from === to) + return ""; + from = posix2.resolve(from); + to = posix2.resolve(to); + if (from === to) + return ""; + var fromStart = 1; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 47) + break; + } + var fromEnd = from.length; + var fromLen = fromEnd - fromStart; + var toStart = 1; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 47) + break; + } + var toEnd = to.length; + var toLen = toEnd - toStart; + var length = fromLen < toLen ? fromLen : toLen; + var lastCommonSep = -1; + var i7 = 0; + for (; i7 <= length; ++i7) { + if (i7 === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i7) === 47) { + return to.slice(toStart + i7 + 1); + } else if (i7 === 0) { + return to.slice(toStart + i7); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i7) === 47) { + lastCommonSep = i7; + } else if (i7 === 0) { + lastCommonSep = 0; + } + } + break; + } + var fromCode = from.charCodeAt(fromStart + i7); + var toCode = to.charCodeAt(toStart + i7); + if (fromCode !== toCode) + break; + else if (fromCode === 47) + lastCommonSep = i7; + } + var out = ""; + for (i7 = fromStart + lastCommonSep + 1; i7 <= fromEnd; ++i7) { + if (i7 === fromEnd || from.charCodeAt(i7) === 47) { + if (out.length === 0) + out += ".."; + else + out += "/.."; + } + } + if (out.length > 0) + return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (to.charCodeAt(toStart) === 47) + ++toStart; + return to.slice(toStart); + } + }, + _makeLong: function _makeLong2(path2) { + return path2; + }, + dirname: function dirname2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var code = path2.charCodeAt(0); + var hasRoot = code === 47; + var end = -1; + var matchedSlash = true; + for (var i7 = path2.length - 1; i7 >= 1; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + end = i7; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) + return hasRoot ? "/" : "."; + if (hasRoot && end === 1) + return "//"; + return path2.slice(0, end); + }, + basename: function basename2(path2, ext) { + if (ext !== void 0 && typeof ext !== "string") + throw new TypeError('"ext" argument must be a string'); + assertPath(path2); + var start = 0; + var end = -1; + var matchedSlash = true; + var i7; + if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) { + if (ext.length === path2.length && ext === path2) + return ""; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i7 + 1; + } + if (extIdx >= 0) { + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i7; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start === end) + end = firstNonSlashEnd; + else if (end === -1) + end = path2.length; + return path2.slice(start, end); + } else { + for (i7 = path2.length - 1; i7 >= 0; --i7) { + if (path2.charCodeAt(i7) === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + } + if (end === -1) + return ""; + return path2.slice(start, end); + } + }, + extname: function extname2(path2) { + assertPath(path2); + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var preDotState = 0; + for (var i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path2.slice(startDot, end); + }, + format: function format5(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject); + } + return _format("/", pathObject); + }, + parse: function parse17(path2) { + assertPath(path2); + var ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + if (path2.length === 0) + return ret; + var code = path2.charCodeAt(0); + var isAbsolute2 = code === 47; + var start; + if (isAbsolute2) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i7 = path2.length - 1; + var preDotState = 0; + for (; i7 >= start; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute2) + ret.base = ret.name = path2.slice(1, end); + else + ret.base = ret.name = path2.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute2) { + ret.name = path2.slice(1, startDot); + ret.base = path2.slice(1, end); + } else { + ret.name = path2.slice(startPart, startDot); + ret.base = path2.slice(startPart, end); + } + ret.ext = path2.slice(startDot, end); + } + if (startPart > 0) + ret.dir = path2.slice(0, startPart - 1); + else if (isAbsolute2) + ret.dir = "/"; + return ret; + }, + sep: "/", + delimiter: ":", + win32: null, + posix: null + }; + posix2.posix = posix2; + exports$12 = posix2; + return exports$12; +} +var exports$12, _dewExec2, exports5; +var init_chunk_BlJi4mNy = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-BlJi4mNy.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DEMDiNwt(); + exports$12 = {}; + _dewExec2 = false; + exports5 = dew2(); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/path.js +var path_exports = {}; +__export(path_exports, { + _makeLong: () => _makeLong, + basename: () => basename, + default: () => exports5, + delimiter: () => delimiter, + dirname: () => dirname, + extname: () => extname, + format: () => format2, + isAbsolute: () => isAbsolute, + join: () => join2, + normalize: () => normalize, + parse: () => parse4, + posix: () => posix, + relative: () => relative, + resolve: () => resolve, + sep: () => sep, + win32: () => win32 +}); +var _makeLong, basename, delimiter, dirname, extname, format2, isAbsolute, join2, normalize, parse4, posix, relative, resolve, sep, win32; +var init_path = __esm({ + "node_modules/@jspm/core/nodelibs/browser/path.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_BlJi4mNy(); + init_chunk_DEMDiNwt(); + _makeLong = exports5._makeLong; + basename = exports5.basename; + delimiter = exports5.delimiter; + dirname = exports5.dirname; + extname = exports5.extname; + format2 = exports5.format; + isAbsolute = exports5.isAbsolute; + join2 = exports5.join; + normalize = exports5.normalize; + parse4 = exports5.parse; + posix = exports5.posix; + relative = exports5.relative; + resolve = exports5.resolve; + sep = exports5.sep; + win32 = exports5.win32; + } +}); + +// node_modules/concat-map/index.js +var require_concat_map = __commonJS({ + "node_modules/concat-map/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function(xs, fn) { + var res = []; + for (var i7 = 0; i7 < xs.length; i7++) { + var x7 = fn(xs[i7], i7); + if (isArray3(x7)) + res.push.apply(res, x7); + else + res.push(x7); + } + return res; + }; + var isArray3 = Array.isArray || function(xs) { + return Object.prototype.toString.call(xs) === "[object Array]"; + }; + } +}); + +// node_modules/balanced-match/index.js +var require_balanced_match = __commonJS({ + "node_modules/balanced-match/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = balanced; + function balanced(a7, b8, str2) { + if (a7 instanceof RegExp) + a7 = maybeMatch(a7, str2); + if (b8 instanceof RegExp) + b8 = maybeMatch(b8, str2); + var r8 = range2(a7, b8, str2); + return r8 && { + start: r8[0], + end: r8[1], + pre: str2.slice(0, r8[0]), + body: str2.slice(r8[0] + a7.length, r8[1]), + post: str2.slice(r8[1] + b8.length) + }; + } + function maybeMatch(reg, str2) { + var m7 = str2.match(reg); + return m7 ? m7[0] : null; + } + balanced.range = range2; + function range2(a7, b8, str2) { + var begs, beg, left, right, result2; + var ai = str2.indexOf(a7); + var bi = str2.indexOf(b8, ai + 1); + var i7 = ai; + if (ai >= 0 && bi > 0) { + if (a7 === b8) { + return [ai, bi]; + } + begs = []; + left = str2.length; + while (i7 >= 0 && !result2) { + if (i7 == ai) { + begs.push(i7); + ai = str2.indexOf(a7, i7 + 1); + } else if (begs.length == 1) { + result2 = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + bi = str2.indexOf(b8, i7 + 1); + } + i7 = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length) { + result2 = [left, right]; + } + } + return result2; + } + } +}); + +// node_modules/@stoplight/spectral-core/node_modules/brace-expansion/index.js +var require_brace_expansion = __commonJS({ + "node_modules/@stoplight/spectral-core/node_modules/brace-expansion/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var concatMap = require_concat_map(); + var balanced = require_balanced_match(); + module5.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + } + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m7 = balanced("{", "}", str2); + if (!m7) + return str2.split(","); + var pre = m7.pre; + var body = m7.body; + var post = m7.post; + var p7 = pre.split(","); + p7[p7.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p7[p7.length - 1] += postParts.shift(); + p7.push.apply(p7, postParts); + } + parts.push.apply(parts, p7); + return parts; + } + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); + } + return expand(escapeBraces(str2), true).map(unescapeBraces); + } + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte2(i7, y7) { + return i7 <= y7; + } + function gte2(i7, y7) { + return i7 >= y7; + } + function expand(str2, isTop) { + var expansions = []; + var m7 = balanced("{", "}", str2); + if (!m7 || /\$$/.test(m7.pre)) + return [str2]; + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m7.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m7.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m7.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m7.post.match(/,(?!,).*\}/)) { + str2 = m7.pre + "{" + m7.body + escClose + m7.post; + return expand(str2); + } + return [str2]; + } + var n7; + if (isSequence) { + n7 = m7.body.split(/\.\./); + } else { + n7 = parseCommaParts(m7.body); + if (n7.length === 1) { + n7 = expand(n7[0], false).map(embrace); + if (n7.length === 1) { + var post = m7.post.length ? expand(m7.post, false) : [""]; + return post.map(function(p7) { + return m7.pre + n7[0] + p7; + }); + } + } + } + var pre = m7.pre; + var post = m7.post.length ? expand(m7.post, false) : [""]; + var N6; + if (isSequence) { + var x7 = numeric(n7[0]); + var y7 = numeric(n7[1]); + var width = Math.max(n7[0].length, n7[1].length); + var incr = n7.length == 3 ? Math.abs(numeric(n7[2])) : 1; + var test = lte2; + var reverse2 = y7 < x7; + if (reverse2) { + incr *= -1; + test = gte2; + } + var pad2 = n7.some(isPadded); + N6 = []; + for (var i7 = x7; test(i7, y7); i7 += incr) { + var c7; + if (isAlphaSequence) { + c7 = String.fromCharCode(i7); + if (c7 === "\\") + c7 = ""; + } else { + c7 = String(i7); + if (pad2) { + var need = width - c7.length; + if (need > 0) { + var z6 = new Array(need + 1).join("0"); + if (i7 < 0) + c7 = "-" + z6 + c7.slice(1); + else + c7 = z6 + c7; + } + } + } + N6.push(c7); + } + } else { + N6 = concatMap(n7, function(el) { + return expand(el, false); + }); + } + for (var j6 = 0; j6 < N6.length; j6++) { + for (var k6 = 0; k6 < post.length; k6++) { + var expansion = pre + N6[j6] + post[k6]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + return expansions; + } + } +}); + +// node_modules/@stoplight/spectral-core/node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/@stoplight/spectral-core/node_modules/minimatch/minimatch.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path2 = function() { + try { + return init_path(), __toCommonJS(path_exports); + } catch (e10) { + } + }() || { + sep: "/" + }; + minimatch.sep = path2.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s7) { + return s7.split("").reduce(function(set4, c7) { + set4[c7] = true; + return set4; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter2; + function filter2(pattern5, options) { + options = options || {}; + return function(p7, i7, list) { + return minimatch(p7, pattern5, options); + }; + } + function ext(a7, b8) { + b8 = b8 || {}; + var t8 = {}; + Object.keys(a7).forEach(function(k6) { + t8[k6] = a7[k6]; + }); + Object.keys(b8).forEach(function(k6) { + t8[k6] = b8[k6]; + }); + return t8; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; + } + var orig = minimatch; + var m7 = function minimatch2(p7, pattern5, options) { + return orig(p7, pattern5, ext(def, options)); + }; + m7.Minimatch = function Minimatch2(pattern5, options) { + return new orig.Minimatch(pattern5, ext(def, options)); + }; + m7.Minimatch.defaults = function defaults2(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m7.filter = function filter3(pattern5, options) { + return orig.filter(pattern5, ext(def, options)); + }; + m7.defaults = function defaults2(options) { + return orig.defaults(ext(def, options)); + }; + m7.makeRe = function makeRe2(pattern5, options) { + return orig.makeRe(pattern5, ext(def, options)); + }; + m7.braceExpand = function braceExpand2(pattern5, options) { + return orig.braceExpand(pattern5, ext(def, options)); + }; + m7.match = function(list, pattern5, options) { + return orig.match(list, pattern5, ext(def, options)); + }; + return m7; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p7, pattern5, options) { + assertValidPattern(pattern5); + if (!options) + options = {}; + if (!options.nocomment && pattern5.charAt(0) === "#") { + return false; + } + return new Minimatch(pattern5, options).match(p7); + } + function Minimatch(pattern5, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern5, options); + } + assertValidPattern(pattern5); + if (!options) + options = {}; + pattern5 = pattern5.trim(); + if (!options.allowWindowsEscape && path2.sep !== "/") { + pattern5 = pattern5.split(path2.sep).join("/"); + } + this.options = options; + this.set = []; + this.pattern = pattern5; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern5 = this.pattern; + var options = this.options; + if (!options.nocomment && pattern5.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern5) { + this.empty = true; + return; + } + this.parseNegate(); + var set4 = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = function debug2() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set4); + set4 = this.globParts = set4.map(function(s7) { + return s7.split(slashSplit); + }); + this.debug(this.pattern, set4); + set4 = set4.map(function(s7, si, set5) { + return s7.map(this.parse, this); + }, this); + this.debug(this.pattern, set4); + set4 = set4.filter(function(s7) { + return s7.indexOf(false) === -1; + }); + this.debug(this.pattern, set4); + this.set = set4; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern5 = this.pattern; + var negate2 = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) + return; + for (var i7 = 0, l7 = pattern5.length; i7 < l7 && pattern5.charAt(i7) === "!"; i7++) { + negate2 = !negate2; + negateOffset++; + } + if (negateOffset) + this.pattern = pattern5.substr(negateOffset); + this.negate = negate2; + } + minimatch.braceExpand = function(pattern5, options) { + return braceExpand(pattern5, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern5, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern5 = typeof pattern5 === "undefined" ? this.pattern : pattern5; + assertValidPattern(pattern5); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern5)) { + return [pattern5]; + } + return expand(pattern5); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern5) { + if (typeof pattern5 !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern5.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse17; + var SUBPARSE = {}; + function parse17(pattern5, isSub) { + assertValidPattern(pattern5); + var options = this.options; + if (pattern5 === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern5 = "*"; + } + if (pattern5 === "") + return ""; + var re4 = ""; + var hasMagic = !!options.nocase; + var escaping = false; + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + var patternStart = pattern5.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + var self2 = this; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re4 += star; + hasMagic = true; + break; + case "?": + re4 += qmark; + hasMagic = true; + break; + default: + re4 += "\\" + stateChar; + break; + } + self2.debug("clearStateChar %j %j", stateChar, re4); + stateChar = false; + } + } + for (var i7 = 0, len = pattern5.length, c7; i7 < len && (c7 = pattern5.charAt(i7)); i7++) { + this.debug("%s %s %s %j", pattern5, i7, re4, c7); + if (escaping && reSpecials[c7]) { + re4 += "\\" + c7; + escaping = false; + continue; + } + switch (c7) { + case "/": { + return false; + } + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern5, i7, re4, c7); + if (inClass) { + this.debug(" in class"); + if (c7 === "!" && i7 === classStart + 1) + c7 = "^"; + re4 += c7; + continue; + } + self2.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c7; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re4 += "("; + continue; + } + if (!stateChar) { + re4 += "\\("; + continue; + } + patternListStack.push({ + type: stateChar, + start: i7 - 1, + reStart: re4.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re4 += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re4); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re4 += "\\)"; + continue; + } + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + re4 += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); + } + pl.reEnd = re4.length; + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re4 += "\\|"; + escaping = false; + continue; + } + clearStateChar(); + re4 += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re4 += "\\" + c7; + continue; + } + inClass = true; + classStart = i7; + reClassStart = re4.length; + re4 += c7; + continue; + case "]": + if (i7 === classStart + 1 || !inClass) { + re4 += "\\" + c7; + escaping = false; + continue; + } + var cs = pattern5.substring(classStart + 1, i7); + try { + RegExp("[" + cs + "]"); + } catch (er) { + var sp = this.parse(cs, SUBPARSE); + re4 = re4.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + hasMagic = true; + inClass = false; + re4 += c7; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c7] && !(c7 === "^" && inClass)) { + re4 += "\\"; + } + re4 += c7; + } + } + if (inClass) { + cs = pattern5.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re4 = re4.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail2 = re4.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re4, pl); + tail2 = tail2.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_6, $1, $22) { + if (!$22) { + $22 = "\\"; + } + return $1 + $1 + $22 + "|"; + }); + this.debug("tail=%j\n %s", tail2, tail2, pl, re4); + var t8 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re4 = re4.slice(0, pl.reStart) + t8 + "\\(" + tail2; + } + clearStateChar(); + if (escaping) { + re4 += "\\\\"; + } + var addPatternStart = false; + switch (re4.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; + } + for (var n7 = negativeLists.length - 1; n7 > -1; n7--) { + var nl = negativeLists[n7]; + var nlBefore = re4.slice(0, nl.reStart); + var nlFirst = re4.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re4.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re4.slice(nl.reEnd); + nlLast += nlAfter; + var openParensBefore = nlBefore.split("(").length - 1; + var cleanAfter = nlAfter; + for (i7 = 0; i7 < openParensBefore; i7++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); + } + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re4 = newRe; + } + if (re4 !== "" && hasMagic) { + re4 = "(?=.)" + re4; + } + if (addPatternStart) { + re4 = patternStart + re4; + } + if (isSub === SUBPARSE) { + return [re4, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern5); + } + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re4 + "$", flags); + } catch (er) { + return new RegExp("$."); + } + regExp._glob = pattern5; + regExp._src = re4; + return regExp; + } + minimatch.makeRe = function(pattern5, options) { + return new Minimatch(pattern5, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + var set4 = this.set; + if (!set4.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re4 = set4.map(function(pattern5) { + return pattern5.map(function(p7) { + return p7 === GLOBSTAR ? twoStar : typeof p7 === "string" ? regExpEscape(p7) : p7._src; + }).join("\\/"); + }).join("|"); + re4 = "^(?:" + re4 + ")$"; + if (this.negate) + re4 = "^(?!" + re4 + ").*$"; + try { + this.regexp = new RegExp(re4, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp; + } + minimatch.match = function(list, pattern5, options) { + options = options || {}; + var mm = new Minimatch(pattern5, options); + list = list.filter(function(f8) { + return mm.match(f8); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern5); + } + return list; + }; + Minimatch.prototype.match = function match(f8, partial2) { + if (typeof partial2 === "undefined") + partial2 = this.partial; + this.debug("match", f8, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f8 === ""; + if (f8 === "/" && partial2) + return true; + var options = this.options; + if (path2.sep !== "/") { + f8 = f8.split(path2.sep).join("/"); + } + f8 = f8.split(slashSplit); + this.debug(this.pattern, "split", f8); + var set4 = this.set; + this.debug(this.pattern, "set", set4); + var filename; + var i7; + for (i7 = f8.length - 1; i7 >= 0; i7--) { + filename = f8[i7]; + if (filename) + break; + } + for (i7 = 0; i7 < set4.length; i7++) { + var pattern5 = set4[i7]; + var file = f8; + if (options.matchBase && pattern5.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern5, partial2); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; + } + } + if (options.flipNegate) + return false; + return this.negate; + }; + Minimatch.prototype.matchOne = function(file, pattern5, partial2) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern: pattern5 } + ); + this.debug("matchOne", file.length, pattern5.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern5.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p7 = pattern5[pi]; + var f8 = file[fi]; + this.debug(pattern5, p7, f8); + if (p7 === false) + return false; + if (p7 === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern5, p7, f8]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern5, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern5.slice(pr), partial2)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern5, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial2) { + this.debug("\n>>> no match, partial?", file, fr, pattern5, pr); + if (fr === fl) + return true; + } + return false; + } + var hit; + if (typeof p7 === "string") { + hit = f8 === p7; + this.debug("string match", p7, f8, hit); + } else { + hit = f8.match(p7); + this.debug("pattern match", p7, f8, hit); + } + if (!hit) + return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial2; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; + } + throw new Error("wtf?"); + }; + function globUnescape(s7) { + return s7.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s7) { + return s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/utils/minimatch.js +var require_minimatch2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/utils/minimatch.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.minimatch = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var minimatch_1 = (0, tslib_1.__importDefault)(require_minimatch()); + var DEFAULT_OPTS = { matchBase: true }; + function minimatch(source, pattern5) { + return (0, minimatch_1.default)(source, pattern5, DEFAULT_OPTS); + } + exports28.minimatch = minimatch; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/utils/severity.js +var require_severity = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/utils/severity.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getDiagnosticSeverity = exports28.DEFAULT_SEVERITY_LEVEL = void 0; + var types_1 = require_dist2(); + exports28.DEFAULT_SEVERITY_LEVEL = types_1.DiagnosticSeverity.Warning; + var SEVERITY_MAP = { + error: types_1.DiagnosticSeverity.Error, + warn: types_1.DiagnosticSeverity.Warning, + info: types_1.DiagnosticSeverity.Information, + hint: types_1.DiagnosticSeverity.Hint, + off: -1 + }; + function getDiagnosticSeverity(severity) { + if (Number.isNaN(Number(severity))) { + return SEVERITY_MAP[severity]; + } + return Number(severity); + } + exports28.getDiagnosticSeverity = getDiagnosticSeverity; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/formats.js +var require_formats = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/formats.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Formats = void 0; + function printFormat(format5) { + var _a2; + return (_a2 = format5.displayName) !== null && _a2 !== void 0 ? _a2 : format5.name; + } + var Formats4 = class extends Set { + toJSON() { + return Array.from(this).map(printFormat); + } + }; + exports28.Formats = Formats4; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/utils/guards.js +var require_guards2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/utils/guards.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.isScopedAliasDefinition = exports28.isValidAliasTarget = exports28.isSimpleAliasDefinition = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + function isSimpleAliasDefinition(alias) { + return Array.isArray(alias); + } + exports28.isSimpleAliasDefinition = isSimpleAliasDefinition; + function isValidAliasTarget(target) { + const formats = target.formats; + if (!Array.isArray(formats) && !(formats instanceof Set)) { + return false; + } + return Array.isArray(target.given) && target.given.every(lodash_1.isString); + } + exports28.isValidAliasTarget = isValidAliasTarget; + function isScopedAliasDefinition(alias) { + return (0, json_1.isPlainObject)(alias) && Array.isArray(alias.targets) && alias.targets.every(isValidAliasTarget); + } + exports28.isScopedAliasDefinition = isScopedAliasDefinition; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/alias.js +var require_alias = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/alias.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.resolveAlias = exports28.resolveAliasForFormats = void 0; + var guards_1 = require_guards2(); + var ALIAS2 = /^#([A-Za-z0-9_-]+)/; + function resolveAliasForFormats({ targets }, formats) { + if (formats === null || formats.size === 0) { + return null; + } + for (let i7 = targets.length - 1; i7 >= 0; i7--) { + const target = targets[i7]; + for (const format5 of target.formats) { + if (formats.has(format5)) { + return target.given; + } + } + } + return null; + } + exports28.resolveAliasForFormats = resolveAliasForFormats; + function resolveAlias(aliases, expression, formats) { + return _resolveAlias(aliases, expression, formats, /* @__PURE__ */ new Set()); + } + exports28.resolveAlias = resolveAlias; + function _resolveAlias(aliases, expression, formats, stack) { + var _a2; + const resolvedExpressions = []; + if (expression.startsWith("#")) { + const alias = (_a2 = ALIAS2.exec(expression)) === null || _a2 === void 0 ? void 0 : _a2[1]; + if (alias === void 0 || alias === null) { + throw new TypeError(`Alias must match /^#([A-Za-z0-9_-]+)/`); + } + if (stack.has(alias)) { + const _stack = [...stack, alias]; + throw new Error(`Alias "${_stack[0]}" is circular. Resolution stack: ${_stack.join(" -> ")}`); + } + stack.add(alias); + if (aliases === null || !(alias in aliases)) { + throw new ReferenceError(`Alias "${alias}" does not exist`); + } + const aliasValue = aliases[alias]; + let actualAliasValue; + if ((0, guards_1.isSimpleAliasDefinition)(aliasValue)) { + actualAliasValue = aliasValue; + } else if ((0, guards_1.isScopedAliasDefinition)(aliasValue)) { + actualAliasValue = resolveAliasForFormats(aliasValue, formats); + } else { + actualAliasValue = null; + } + if (actualAliasValue !== null) { + resolvedExpressions.push(...actualAliasValue.flatMap((item) => _resolveAlias(aliases, item + expression.slice(alias.length + 1), formats, /* @__PURE__ */ new Set([...stack])))); + } + } else { + resolvedExpressions.push(expression); + } + return resolvedExpressions; + } + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/rule.js +var require_rule = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/rule.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _Rule_severity; + var _Rule_enabled; + var _Rule_then; + var _Rule_given; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Rule = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var severity_1 = require_severity(); + var minimatch_1 = require_minimatch2(); + var formats_1 = require_formats(); + var alias_1 = require_alias(); + var Rule = class _Rule { + constructor(name2, definition, owner) { + var _a2, _b, _c, _d; + this.name = name2; + this.definition = definition; + this.owner = owner; + _Rule_severity.set(this, void 0); + _Rule_enabled.set(this, void 0); + _Rule_then.set(this, void 0); + _Rule_given.set(this, void 0); + this.recommended = definition.recommended !== false; + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_enabled, this.recommended, "f"); + this.description = (_a2 = definition.description) !== null && _a2 !== void 0 ? _a2 : null; + this.message = (_b = definition.message) !== null && _b !== void 0 ? _b : null; + this.documentationUrl = (_c = definition.documentationUrl) !== null && _c !== void 0 ? _c : null; + this.severity = definition.severity; + this.resolved = definition.resolved !== false; + this.formats = "formats" in definition ? new formats_1.Formats(definition.formats) : null; + this.then = definition.then; + this.given = definition.given; + this.extensions = (_d = definition.extensions) !== null && _d !== void 0 ? _d : null; + } + get enabled() { + return (0, tslib_1.__classPrivateFieldGet)(this, _Rule_enabled, "f") || this.overrides !== void 0; + } + set enabled(enabled) { + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_enabled, enabled, "f"); + } + static isEnabled(rule, severity) { + return severity === "all" || severity === "recommended" && rule.recommended; + } + getSeverityForSource(source, path2) { + if (this.overrides === void 0 || this.overrides.definition.size === 0) { + return this.severity; + } + const relativeSource = (0, path_1.relative)((0, path_1.dirname)(this.overrides.rulesetSource), source); + const relevantOverrides = []; + for (const [source2, override] of this.overrides.definition.entries()) { + if ((0, minimatch_1.minimatch)(relativeSource, source2)) { + relevantOverrides.push(override); + } + } + if (relevantOverrides.length === 0) { + return this.severity; + } + let severity = this.severity; + let closestPointer = ""; + const pointer = (0, json_1.pathToPointer)(path2); + for (const relevantOverride of relevantOverrides) { + for (const [overridePath, overrideSeverity] of relevantOverride.entries()) { + if (overridePath.length >= closestPointer.length && (pointer === overridePath || pointer.startsWith(`${overridePath}/`))) { + closestPointer = overridePath; + severity = overrideSeverity; + } + } + } + return severity; + } + get severity() { + return (0, tslib_1.__classPrivateFieldGet)(this, _Rule_severity, "f"); + } + set severity(severity) { + if (severity === void 0) { + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_severity, severity_1.DEFAULT_SEVERITY_LEVEL, "f"); + } else { + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_severity, (0, severity_1.getDiagnosticSeverity)(severity), "f"); + } + } + get then() { + return (0, tslib_1.__classPrivateFieldGet)(this, _Rule_then, "f"); + } + set then(then) { + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_then, Array.isArray(then) ? then : [then], "f"); + } + get given() { + return (0, tslib_1.__classPrivateFieldGet)(this, _Rule_given, "f"); + } + set given(given) { + const actualGiven = Array.isArray(given) ? given : [given]; + (0, tslib_1.__classPrivateFieldSet)(this, _Rule_given, this.owner.hasComplexAliases ? actualGiven : actualGiven.flatMap((expr) => (0, alias_1.resolveAlias)(this.owner.aliases, expr, null)).filter(lodash_1.isString), "f"); + } + getGivenForFormats(formats) { + return this.owner.hasComplexAliases ? (0, tslib_1.__classPrivateFieldGet)(this, _Rule_given, "f").flatMap((expr) => (0, alias_1.resolveAlias)(this.owner.aliases, expr, formats)) : (0, tslib_1.__classPrivateFieldGet)(this, _Rule_given, "f"); + } + matchesFormat(formats) { + if (this.formats === null) { + return true; + } + if (formats === null) { + return false; + } + for (const format5 of this.formats) { + if (formats.has(format5)) { + return true; + } + } + return false; + } + clone() { + return new _Rule(this.name, this.definition, this.owner); + } + toJSON() { + return { + name: this.name, + recommended: this.recommended, + enabled: this.enabled, + description: this.description, + message: this.message, + documentationUrl: this.documentationUrl, + severity: this.severity, + resolved: this.resolved, + formats: this.formats, + then: this.then.map((then) => ({ + ...then, + function: then.function.name + })), + given: Array.isArray(this.definition.given) ? this.definition.given : [this.definition.given], + owner: this.owner.id, + extensions: this.extensions + }; + } + }; + exports28.Rule = Rule; + _Rule_severity = /* @__PURE__ */ new WeakMap(), _Rule_enabled = /* @__PURE__ */ new WeakMap(), _Rule_then = /* @__PURE__ */ new WeakMap(), _Rule_given = /* @__PURE__ */ new WeakMap(); + } +}); + +// node_modules/@stoplight/spectral-core/dist/guards/isAggregateError.js +var require_isAggregateError = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/guards/isAggregateError.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.isAggregateError = void 0; + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + function isAggregateError(maybeAggregateError) { + return (0, lodash_1.isError)(maybeAggregateError) && maybeAggregateError.constructor.name === "AggregateError"; + } + exports28.isAggregateError = isAggregateError; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/errors.js +var require_errors2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/errors.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.convertAjvErrors = exports28.RulesetValidationError = void 0; + var isAggregateError_1 = require_isAggregateError(); + var RulesetValidationError = class extends Error { + constructor(code, message, path2) { + super(message); + this.code = code; + this.message = message; + this.path = path2; + } + }; + exports28.RulesetValidationError = RulesetValidationError; + var RULE_INSTANCE_PATH = /^\/rules\/[^/]+/; + var GENERIC_INSTANCE_PATH = /^\/(?:aliases|extends|overrides(?:\/\d+\/extends)?)/; + function convertAjvErrors(errors) { + const sortedErrors = [...errors].sort((errorA, errorB) => { + const diff = errorA.instancePath.length - errorB.instancePath.length; + return diff === 0 ? errorA.keyword === "errorMessage" && errorB.keyword !== "errorMessage" ? -1 : 0 : diff; + }).filter((error2, i7, sortedErrors2) => i7 === 0 || sortedErrors2[i7 - 1].instancePath !== error2.instancePath); + const filteredErrors = []; + l: + for (let i7 = 0; i7 < sortedErrors.length; i7++) { + const error2 = sortedErrors[i7]; + const prevError = filteredErrors.length === 0 ? null : filteredErrors[filteredErrors.length - 1]; + if (error2.keyword === "if") + continue; + if (GENERIC_INSTANCE_PATH.test(error2.instancePath)) { + let x7 = 1; + while (i7 + x7 < sortedErrors.length) { + if (sortedErrors[i7 + x7].instancePath.startsWith(error2.instancePath) || !GENERIC_INSTANCE_PATH.test(sortedErrors[i7 + x7].instancePath)) { + continue l; + } + x7++; + } + } else if (prevError === null) { + filteredErrors.push(error2); + continue; + } else { + const match = RULE_INSTANCE_PATH.exec(error2.instancePath); + if (match !== null && match[0] !== match.input && match[0] === prevError.instancePath) { + filteredErrors.pop(); + } + } + filteredErrors.push(error2); + } + return filteredErrors.flatMap((error2) => { + var _a2; + if (error2.keyword === "x-spectral-runtime") { + return flatErrors(error2.params.errors); + } + const path2 = error2.instancePath.slice(1).split("/"); + return new RulesetValidationError(inferErrorCode(path2, error2.keyword), (_a2 = error2.message) !== null && _a2 !== void 0 ? _a2 : "unknown error", path2); + }); + } + exports28.convertAjvErrors = convertAjvErrors; + function flatErrors(error2) { + if ((0, isAggregateError_1.isAggregateError)(error2)) { + return error2.errors.flatMap(flatErrors); + } + return error2; + } + function inferErrorCode(path2, keyword) { + if (path2.length === 0) { + return "generic-validation-error"; + } + if (path2.length === 1 && keyword !== "errorMessage") { + return "invalid-ruleset-definition"; + } + switch (path2[0]) { + case "rules": + return inferErrorCodeFromRulesError(path2); + case "parserOptions": + return "invalid-parser-options-definition"; + case "aliases": + return inferErrorCodeFromAliasesError(path2); + case "extends": + return "invalid-extend-definition"; + case "overrides": + return inferErrorCodeFromOverrideError(path2, keyword); + case "formats": + if (path2.length === 1) { + return "invalid-ruleset-definition"; + } + return "invalid-format"; + default: + return "generic-validation-error"; + } + } + function inferErrorCodeFromRulesError(path2) { + if (path2.length === 3 && path2[2] === "severity") { + return "invalid-severity"; + } + if (path2.length === 4 && path2[2] === "formats") { + return "invalid-format"; + } + if (path2.length === 4 && path2[2] === "given") { + return "invalid-given-definition"; + } + return "invalid-rule-definition"; + } + function inferErrorCodeFromOverrideError(path2, keyword) { + if (path2.length >= 3) { + return inferErrorCode(path2.slice(2), keyword); + } + return "invalid-override-definition"; + } + function inferErrorCodeFromAliasesError(path2) { + if (path2.length === 6) { + if (path2[4] === "given") { + return "invalid-given-definition"; + } + if (path2[4] === "formats") { + return "invalid-format"; + } + } + return "invalid-alias-definition"; + } + } +}); + +// node_modules/ajv/dist/vocabularies/draft7.js +var require_draft7 = __commonJS({ + "node_modules/ajv/dist/vocabularies/draft7.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var core_1 = require_core2(); + var validation_1 = require_validation(); + var applicator_1 = require_applicator(); + var format_1 = require_format2(); + var metadata_1 = require_metadata(); + var draft7Vocabularies = [ + core_1.default, + validation_1.default, + (0, applicator_1.default)(), + format_1.default, + metadata_1.metadataVocabulary, + metadata_1.contentVocabulary + ]; + exports28.default = draft7Vocabularies; + } +}); + +// node_modules/ajv/dist/refs/json-schema-draft-07.json +var require_json_schema_draft_07 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "http://json-schema.org/draft-07/schema#", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + uniqueItems: true, + default: [] + } + }, + type: ["object", "boolean"], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { $ref: "#/definitions/nonNegativeInteger" }, + minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { $ref: "#" }, + items: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], + default: true + }, + maxItems: { $ref: "#/definitions/nonNegativeInteger" }, + minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { $ref: "#" }, + maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, + minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { $ref: "#" }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + propertyNames: { format: "regex" }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] + } + }, + propertyNames: { $ref: "#" }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + contentMediaType: { type: "string" }, + contentEncoding: { type: "string" }, + if: { $ref: "#" }, + then: { $ref: "#" }, + else: { $ref: "#" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + default: true + }; + } +}); + +// node_modules/ajv/dist/ajv.js +var require_ajv = __commonJS({ + "node_modules/ajv/dist/ajv.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.MissingRefError = exports28.ValidationError = exports28.CodeGen = exports28.Name = exports28.nil = exports28.stringify = exports28.str = exports28._ = exports28.KeywordCxt = exports28.Ajv = void 0; + var core_1 = require_core(); + var draft7_1 = require_draft7(); + var discriminator_1 = require_discriminator(); + var draft7MetaSchema = require_json_schema_draft_07(); + var META_SUPPORT_DATA = ["/properties"]; + var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; + var Ajv7 = class extends core_1.default { + _addVocabularies() { + super._addVocabularies(); + draft7_1.default.forEach((v8) => this.addVocabulary(v8)); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + if (!this.opts.meta) + return; + const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; + this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); + } + }; + exports28.Ajv = Ajv7; + module5.exports = exports28 = Ajv7; + module5.exports.Ajv = Ajv7; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.default = Ajv7; + var validate_1 = require_validate(); + Object.defineProperty(exports28, "KeywordCxt", { enumerable: true, get: function() { + return validate_1.KeywordCxt; + } }); + var codegen_1 = require_codegen(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return codegen_1._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return codegen_1.str; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return codegen_1.stringify; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return codegen_1.nil; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return codegen_1.Name; + } }); + Object.defineProperty(exports28, "CodeGen", { enumerable: true, get: function() { + return codegen_1.CodeGen; + } }); + var validation_error_1 = require_validation_error(); + Object.defineProperty(exports28, "ValidationError", { enumerable: true, get: function() { + return validation_error_1.default; + } }); + var ref_error_1 = require_ref_error(); + Object.defineProperty(exports28, "MissingRefError", { enumerable: true, get: function() { + return ref_error_1.default; + } }); + } +}); + +// node_modules/ajv-formats/dist/formats.js +var require_formats2 = __commonJS({ + "node_modules/ajv-formats/dist/formats.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.formatNames = exports28.fastFormats = exports28.fullFormats = void 0; + function fmtDef(validate15, compare) { + return { validate: validate15, compare }; + } + exports28.fullFormats = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: fmtDef(date, compareDate), + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: fmtDef(time2, compareTime), + "date-time": fmtDef(date_time, compareDateTime), + // duration: https://tools.ietf.org/html/rfc3339#appendix-A + duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, + uri, + "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, + // uri-template: https://tools.ietf.org/html/rfc6570 + "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, + // For the source: https://gist.github.com/dperini/729294 + // For test cases: https://mathiasbynens.be/demo/url-regex + url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, + regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, + "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, + // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types + // byte: https://github.com/miguelmota/is-base64 + byte, + // signed 32 bit integer + int32: { type: "number", validate: validateInt32 }, + // signed 64 bit integer + int64: { type: "number", validate: validateInt64 }, + // C-type float + float: { type: "number", validate: validateNumber }, + // C-type double + double: { type: "number", validate: validateNumber }, + // hint to the UI to hide input strings + password: true, + // unchecked string payload + binary: true + }; + exports28.fastFormats = { + ...exports28.fullFormats, + date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate), + time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareTime), + "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime), + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, + "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i + }; + exports28.formatNames = Object.keys(exports28.fullFormats); + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + 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 date(str2) { + const matches2 = DATE.exec(str2); + if (!matches2) + return false; + 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, d22) { + if (!(d1 && d22)) + return void 0; + if (d1 > d22) + return 1; + if (d1 < d22) + return -1; + return 0; + } + var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i; + function time2(str2, withTimeZone) { + const matches2 = TIME.exec(str2); + if (!matches2) + return false; + const hour = +matches2[1]; + const minute = +matches2[2]; + const second = +matches2[3]; + const timeZone = matches2[5]; + return (hour <= 23 && minute <= 59 && second <= 59 || hour === 23 && minute === 59 && second === 60) && (!withTimeZone || timeZone !== ""); + } + function compareTime(t1, t22) { + if (!(t1 && t22)) + return void 0; + const a1 = TIME.exec(t1); + const a22 = TIME.exec(t22); + if (!(a1 && a22)) + return void 0; + t1 = a1[1] + a1[2] + a1[3] + (a1[4] || ""); + t22 = a22[1] + a22[2] + a22[3] + (a22[4] || ""); + if (t1 > t22) + return 1; + if (t1 < t22) + return -1; + return 0; + } + var DATE_TIME_SEPARATOR = /t|\s/i; + function date_time(str2) { + const dateTime = str2.split(DATE_TIME_SEPARATOR); + return dateTime.length === 2 && date(dateTime[0]) && time2(dateTime[1], true); + } + function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) + return void 0; + const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); + const [d22, t22] = dt2.split(DATE_TIME_SEPARATOR); + const res = compareDate(d1, d22); + if (res === void 0) + return void 0; + return res || compareTime(t1, t22); + } + var NOT_URI_FRAGMENT = /\/|:/; + var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; + function uri(str2) { + return NOT_URI_FRAGMENT.test(str2) && URI.test(str2); + } + var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm; + function byte(str2) { + BYTE.lastIndex = 0; + return BYTE.test(str2); + } + var MIN_INT32 = -(2 ** 31); + var MAX_INT32 = 2 ** 31 - 1; + function validateInt32(value2) { + return Number.isInteger(value2) && value2 <= MAX_INT32 && value2 >= MIN_INT32; + } + function validateInt64(value2) { + return Number.isInteger(value2); + } + function validateNumber() { + return true; + } + var Z_ANCHOR = /[^\\]\\Z/; + function regex(str2) { + if (Z_ANCHOR.test(str2)) + return false; + try { + new RegExp(str2); + return true; + } catch (e10) { + return false; + } + } + } +}); + +// node_modules/ajv-formats/dist/limit.js +var require_limit = __commonJS({ + "node_modules/ajv-formats/dist/limit.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.formatLimitDefinition = void 0; + var ajv_1 = require_ajv(); + var codegen_1 = require_codegen(); + var ops = codegen_1.operators; + var KWDs = { + formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, + formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, + formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, + formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } + }; + var error2 = { + message: ({ keyword, schemaCode }) => codegen_1.str`should be ${KWDs[keyword].okStr} ${schemaCode}`, + params: ({ keyword, schemaCode }) => codegen_1._`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` + }; + exports28.formatLimitDefinition = { + keyword: Object.keys(KWDs), + type: "string", + schemaType: "string", + $data: true, + error: error2, + code(cxt) { + const { gen, data, schemaCode, keyword, it: it2 } = cxt; + const { opts, self: self2 } = it2; + if (!opts.validateFormats) + return; + const fCxt = new ajv_1.KeywordCxt(it2, self2.RULES.all.format.definition, "format"); + if (fCxt.$data) + validate$DataFormat(); + else + validateFormat(); + function validate$DataFormat() { + const fmts = gen.scopeValue("formats", { + ref: self2.formats, + code: opts.code.formats + }); + const fmt = gen.const("fmt", codegen_1._`${fmts}[${fCxt.schemaCode}]`); + cxt.fail$data(codegen_1.or(codegen_1._`typeof ${fmt} != "object"`, codegen_1._`${fmt} instanceof RegExp`, codegen_1._`typeof ${fmt}.compare != "function"`, compareCode(fmt))); + } + function validateFormat() { + const format5 = fCxt.schema; + const fmtDef = self2.formats[format5]; + if (!fmtDef || fmtDef === true) + return; + if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") { + throw new Error(`"${keyword}": format "${format5}" does not define "compare" function`); + } + const fmt = gen.scopeValue("formats", { + key: format5, + ref: fmtDef, + code: opts.code.formats ? codegen_1._`${opts.code.formats}${codegen_1.getProperty(format5)}` : void 0 + }); + cxt.fail$data(compareCode(fmt)); + } + function compareCode(fmt) { + return codegen_1._`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`; + } + }, + dependencies: ["format"] + }; + var formatLimitPlugin = (ajv2) => { + ajv2.addKeyword(exports28.formatLimitDefinition); + return ajv2; + }; + exports28.default = formatLimitPlugin; + } +}); + +// node_modules/ajv-formats/dist/index.js +var require_dist9 = __commonJS({ + "node_modules/ajv-formats/dist/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var formats_1 = require_formats2(); + var limit_1 = require_limit(); + var codegen_1 = require_codegen(); + var fullName = new codegen_1.Name("fullFormats"); + var fastName = new codegen_1.Name("fastFormats"); + var formatsPlugin = (ajv2, opts = { keywords: true }) => { + if (Array.isArray(opts)) { + addFormats5(ajv2, opts, formats_1.fullFormats, fullName); + return ajv2; + } + const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName]; + const list = opts.formats || formats_1.formatNames; + addFormats5(ajv2, list, formats, exportName); + if (opts.keywords) + limit_1.default(ajv2); + return ajv2; + }; + formatsPlugin.get = (name2, mode = "full") => { + const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats; + const f8 = formats[name2]; + if (!f8) + throw new Error(`Unknown format "${name2}"`); + return f8; + }; + function addFormats5(ajv2, list, fs, exportName) { + var _a2; + var _b; + (_a2 = (_b = ajv2.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`; + for (const f8 of list) + ajv2.addFormat(f8, fs[f8]); + } + module5.exports = exports28 = formatsPlugin; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.default = formatsPlugin; + } +}); + +// node_modules/ajv-errors/dist/index.js +var require_dist10 = __commonJS({ + "node_modules/ajv-errors/dist/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var ajv_1 = require_ajv(); + var codegen_1 = require_codegen(); + var code_1 = require_code(); + var validate_1 = require_validate(); + var errors_1 = require_errors(); + var names_1 = require_names(); + var keyword = "errorMessage"; + var used = new ajv_1.Name("emUsed"); + var KEYWORD_PROPERTY_PARAMS = { + required: "missingProperty", + dependencies: "property", + dependentRequired: "property" + }; + var INTERPOLATION = /\$\{[^}]+\}/; + var INTERPOLATION_REPLACE = /\$\{([^}]+)\}/g; + var EMPTY_STR = /^""\s*\+\s*|\s*\+\s*""$/g; + function errorMessage(options) { + return { + keyword, + schemaType: ["string", "object"], + post: true, + code(cxt) { + const { gen, data, schema: schema8, schemaValue, it: it2 } = cxt; + if (it2.createErrors === false) + return; + const sch = schema8; + const instancePath = codegen_1.strConcat(names_1.default.instancePath, it2.errorPath); + gen.if(ajv_1._`${names_1.default.errors} > 0`, () => { + if (typeof sch == "object") { + const [kwdPropErrors, kwdErrors] = keywordErrorsConfig(sch); + if (kwdErrors) + processKeywordErrors(kwdErrors); + if (kwdPropErrors) + processKeywordPropErrors(kwdPropErrors); + processChildErrors(childErrorsConfig(sch)); + } + const schMessage = typeof sch == "string" ? sch : sch._; + if (schMessage) + processAllErrors(schMessage); + if (!options.keepErrors) + removeUsedErrors(); + }); + function childErrorsConfig({ properties, items }) { + const errors = {}; + if (properties) { + errors.props = {}; + for (const p7 in properties) + errors.props[p7] = []; + } + if (items) { + errors.items = {}; + for (let i7 = 0; i7 < items.length; i7++) + errors.items[i7] = []; + } + return errors; + } + function keywordErrorsConfig(emSchema) { + let propErrors; + let errors; + for (const k6 in emSchema) { + if (k6 === "properties" || k6 === "items") + continue; + const kwdSch = emSchema[k6]; + if (typeof kwdSch == "object") { + propErrors || (propErrors = {}); + const errMap = propErrors[k6] = {}; + for (const p7 in kwdSch) + errMap[p7] = []; + } else { + errors || (errors = {}); + errors[k6] = []; + } + } + return [propErrors, errors]; + } + function processKeywordErrors(kwdErrors) { + const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdErrors)); + const templates = gen.const("templates", getTemplatesCode(kwdErrors, schema8)); + gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => gen.code(ajv_1._`${kwdErrs}[${err}.keyword].push(${err})`).assign(ajv_1._`${err}.${used}`, true))); + const { singleError } = options; + if (singleError) { + const message = gen.let("message", ajv_1._`""`); + const paramsErrors = gen.let("paramsErrors", ajv_1._`[]`); + loopErrors((key) => { + gen.if(message, () => gen.code(ajv_1._`${message} += ${typeof singleError == "string" ? singleError : ";"}`)); + gen.code(ajv_1._`${message} += ${errMessage(key)}`); + gen.assign(paramsErrors, ajv_1._`${paramsErrors}.concat(${kwdErrs}[${key}])`); + }); + errors_1.reportError(cxt, { message, params: ajv_1._`{errors: ${paramsErrors}}` }); + } else { + loopErrors((key) => errors_1.reportError(cxt, { + message: errMessage(key), + params: ajv_1._`{errors: ${kwdErrs}[${key}]}` + })); + } + function loopErrors(body) { + gen.forIn("key", kwdErrs, (key) => gen.if(ajv_1._`${kwdErrs}[${key}].length`, () => body(key))); + } + function errMessage(key) { + return ajv_1._`${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}[${key}]`; + } + } + function processKeywordPropErrors(kwdPropErrors) { + const kwdErrs = gen.const("emErrors", ajv_1.stringify(kwdPropErrors)); + const templatesCode = []; + for (const k6 in kwdPropErrors) { + templatesCode.push([ + k6, + getTemplatesCode(kwdPropErrors[k6], schema8[k6]) + ]); + } + const templates = gen.const("templates", gen.object(...templatesCode)); + const kwdPropParams = gen.scopeValue("obj", { + ref: KEYWORD_PROPERTY_PARAMS, + code: ajv_1.stringify(KEYWORD_PROPERTY_PARAMS) + }); + const propParam = gen.let("emPropParams"); + const paramsErrors = gen.let("emParamsErrors"); + gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchKeywordError(err, kwdErrs), () => { + gen.assign(propParam, ajv_1._`${kwdPropParams}[${err}.keyword]`); + gen.assign(paramsErrors, ajv_1._`${kwdErrs}[${err}.keyword][${err}.params[${propParam}]]`); + gen.if(paramsErrors, () => gen.code(ajv_1._`${paramsErrors}.push(${err})`).assign(ajv_1._`${err}.${used}`, true)); + })); + gen.forIn("key", kwdErrs, (key) => gen.forIn("keyProp", ajv_1._`${kwdErrs}[${key}]`, (keyProp) => { + gen.assign(paramsErrors, ajv_1._`${kwdErrs}[${key}][${keyProp}]`); + gen.if(ajv_1._`${paramsErrors}.length`, () => { + const tmpl = gen.const("tmpl", ajv_1._`${templates}[${key}] && ${templates}[${key}][${keyProp}]`); + errors_1.reportError(cxt, { + message: ajv_1._`${tmpl} ? ${tmpl}() : ${schemaValue}[${key}][${keyProp}]`, + params: ajv_1._`{errors: ${paramsErrors}}` + }); + }); + })); + } + function processChildErrors(childErrors) { + const { props, items } = childErrors; + if (!props && !items) + return; + const isObj = ajv_1._`typeof ${data} == "object"`; + const isArr = ajv_1._`Array.isArray(${data})`; + const childErrs = gen.let("emErrors"); + let childKwd; + let childProp; + const templates = gen.let("templates"); + if (props && items) { + childKwd = gen.let("emChildKwd"); + gen.if(isObj); + gen.if(isArr, () => { + init2(items, schema8.items); + gen.assign(childKwd, ajv_1.str`items`); + }, () => { + init2(props, schema8.properties); + gen.assign(childKwd, ajv_1.str`properties`); + }); + childProp = ajv_1._`[${childKwd}]`; + } else if (items) { + gen.if(isArr); + init2(items, schema8.items); + childProp = ajv_1._`.items`; + } else if (props) { + gen.if(codegen_1.and(isObj, codegen_1.not(isArr))); + init2(props, schema8.properties); + childProp = ajv_1._`.properties`; + } + gen.forOf("err", names_1.default.vErrors, (err) => ifMatchesChildError(err, childErrs, (child) => gen.code(ajv_1._`${childErrs}[${child}].push(${err})`).assign(ajv_1._`${err}.${used}`, true))); + gen.forIn("key", childErrs, (key) => gen.if(ajv_1._`${childErrs}[${key}].length`, () => { + errors_1.reportError(cxt, { + message: ajv_1._`${key} in ${templates} ? ${templates}[${key}]() : ${schemaValue}${childProp}[${key}]`, + params: ajv_1._`{errors: ${childErrs}[${key}]}` + }); + gen.assign(ajv_1._`${names_1.default.vErrors}[${names_1.default.errors}-1].instancePath`, ajv_1._`${instancePath} + "/" + ${key}.replace(/~/g, "~0").replace(/\\//g, "~1")`); + })); + gen.endIf(); + function init2(children, msgs) { + gen.assign(childErrs, ajv_1.stringify(children)); + gen.assign(templates, getTemplatesCode(children, msgs)); + } + } + function processAllErrors(schMessage) { + const errs = gen.const("emErrs", ajv_1._`[]`); + gen.forOf("err", names_1.default.vErrors, (err) => gen.if(matchAnyError(err), () => gen.code(ajv_1._`${errs}.push(${err})`).assign(ajv_1._`${err}.${used}`, true))); + gen.if(ajv_1._`${errs}.length`, () => errors_1.reportError(cxt, { + message: templateExpr(schMessage), + params: ajv_1._`{errors: ${errs}}` + })); + } + function removeUsedErrors() { + const errs = gen.const("emErrs", ajv_1._`[]`); + gen.forOf("err", names_1.default.vErrors, (err) => gen.if(ajv_1._`!${err}.${used}`, () => gen.code(ajv_1._`${errs}.push(${err})`))); + gen.assign(names_1.default.vErrors, errs).assign(names_1.default.errors, ajv_1._`${errs}.length`); + } + function matchKeywordError(err, kwdErrs) { + return codegen_1.and( + ajv_1._`${err}.keyword !== ${keyword}`, + ajv_1._`!${err}.${used}`, + ajv_1._`${err}.instancePath === ${instancePath}`, + ajv_1._`${err}.keyword in ${kwdErrs}`, + // TODO match the end of the string? + ajv_1._`${err}.schemaPath.indexOf(${it2.errSchemaPath}) === 0`, + ajv_1._`/^\\/[^\\/]*$/.test(${err}.schemaPath.slice(${it2.errSchemaPath.length}))` + ); + } + function ifMatchesChildError(err, childErrs, thenBody) { + gen.if(codegen_1.and(ajv_1._`${err}.keyword !== ${keyword}`, ajv_1._`!${err}.${used}`, ajv_1._`${err}.instancePath.indexOf(${instancePath}) === 0`), () => { + const childRegex = gen.scopeValue("pattern", { + ref: /^\/([^/]*)(?:\/|$)/, + code: ajv_1._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")` + }); + const matches2 = gen.const("emMatches", ajv_1._`${childRegex}.exec(${err}.instancePath.slice(${instancePath}.length))`); + const child = gen.const("emChild", ajv_1._`${matches2} && ${matches2}[1].replace(/~1/g, "/").replace(/~0/g, "~")`); + gen.if(ajv_1._`${child} !== undefined && ${child} in ${childErrs}`, () => thenBody(child)); + }); + } + function matchAnyError(err) { + return codegen_1.and(ajv_1._`${err}.keyword !== ${keyword}`, ajv_1._`!${err}.${used}`, codegen_1.or(ajv_1._`${err}.instancePath === ${instancePath}`, codegen_1.and(ajv_1._`${err}.instancePath.indexOf(${instancePath}) === 0`, ajv_1._`${err}.instancePath[${instancePath}.length] === "/"`)), ajv_1._`${err}.schemaPath.indexOf(${it2.errSchemaPath}) === 0`, ajv_1._`${err}.schemaPath[${it2.errSchemaPath}.length] === "/"`); + } + function getTemplatesCode(keys2, msgs) { + const templatesCode = []; + for (const k6 in keys2) { + const msg = msgs[k6]; + if (INTERPOLATION.test(msg)) + templatesCode.push([k6, templateFunc(msg)]); + } + return gen.object(...templatesCode); + } + function templateExpr(msg) { + if (!INTERPOLATION.test(msg)) + return ajv_1.stringify(msg); + return new code_1._Code(code_1.safeStringify(msg).replace(INTERPOLATION_REPLACE, (_s, ptr) => `" + JSON.stringify(${validate_1.getData(ptr, it2)}) + "`).replace(EMPTY_STR, "")); + } + function templateFunc(msg) { + return ajv_1._`function(){return ${templateExpr(msg)}}`; + } + }, + metaSchema: { + anyOf: [ + { type: "string" }, + { + type: "object", + properties: { + properties: { $ref: "#/$defs/stringMap" }, + items: { $ref: "#/$defs/stringList" }, + required: { $ref: "#/$defs/stringOrMap" }, + dependencies: { $ref: "#/$defs/stringOrMap" } + }, + additionalProperties: { type: "string" } + } + ], + $defs: { + stringMap: { + type: "object", + additionalProperties: { type: "string" } + }, + stringOrMap: { + anyOf: [{ type: "string" }, { $ref: "#/$defs/stringMap" }] + }, + stringList: { type: "array", items: { type: "string" } } + } + } + }; + } + var ajvErrors5 = (ajv2, options = {}) => { + if (!ajv2.opts.allErrors) + throw new Error("ajv-errors: Ajv option allErrors must be true"); + if (ajv2.opts.jsPropertySyntax) { + throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported"); + } + return ajv2.addKeyword(errorMessage(options)); + }; + exports28.default = ajvErrors5; + module5.exports = ajvErrors5; + module5.exports.default = ajvErrors5; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/meta/rule.schema.json +var require_rule_schema = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/meta/rule.schema.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "@stoplight/spectral-core/meta/rule.schema", + $defs: { + Then: { + type: "object", + allOf: [ + { + properties: { + field: { + type: "string" + } + } + }, + { + $ref: "extensions#function" + } + ] + }, + Severity: { + $ref: "shared#severity" + } + }, + if: { + type: "object" + }, + then: { + type: "object", + properties: { + description: { + type: "string" + }, + documentationUrl: { + type: "string", + format: "url", + errorMessage: "must be a valid URL" + }, + recommended: { + type: "boolean" + }, + given: { + $ref: "shared#given" + }, + resolved: { + type: "boolean" + }, + severity: { + $ref: "#/$defs/Severity" + }, + message: { + type: "string" + }, + tags: { + items: { + type: "string" + }, + type: "array" + }, + formats: { + $ref: "shared#formats" + }, + then: { + if: { + type: "array" + }, + then: { + type: "array", + items: { + $ref: "#/$defs/Then" + } + }, + else: { + $ref: "#/$defs/Then" + } + }, + type: { + enum: ["style", "validation"], + type: "string", + errorMessage: 'allowed types are "style" and "validation"' + }, + extensions: { + type: "object" + } + }, + required: ["given", "then"], + additionalProperties: false, + patternProperties: { + "^x-": true + }, + errorMessage: { + required: 'the rule must have at least "given" and "then" properties' + } + }, + else: { + oneOf: [ + { + $ref: "shared#/$defs/HumanReadableSeverity" + }, + { + type: "boolean" + } + ] + } + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/meta/shared.json +var require_shared = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/meta/shared.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "@stoplight/spectral-core/meta/shared", + $defs: { + Formats: { + $anchor: "formats", + type: "array", + items: { + $ref: "extensions#format" + }, + errorMessage: "must be an array of formats" + }, + DiagnosticSeverity: { + enum: [-1, 0, 1, 2, 3] + }, + HumanReadableSeverity: { + enum: ["error", "warn", "info", "hint", "off"] + }, + Severity: { + $anchor: "severity", + oneOf: [ + { + $ref: "#/$defs/DiagnosticSeverity" + }, + { + $ref: "#/$defs/HumanReadableSeverity" + } + ], + errorMessage: 'the value has to be one of: 0, 1, 2, 3 or "error", "warn", "info", "hint", "off"' + }, + Given: { + $anchor: "given", + if: { + type: "array" + }, + then: { + $anchor: "arrayish-given", + type: "array", + items: { + $ref: "path-expression" + }, + minItems: 1, + errorMessage: { + minItems: "must be a non-empty array of expressions" + } + }, + else: { + $ref: "path-expression" + } + }, + PathExpression: { + $id: "path-expression", + if: { + type: "string" + }, + then: { + type: "string", + if: { + pattern: "^#" + }, + then: { + "x-spectral-runtime": "alias" + }, + else: { + pattern: "^\\$", + errorMessage: "must be a valid JSON Path expression or a reference to the existing Alias optionally paired with a JSON Path expression subset" + } + }, + else: { + not: {}, + errorMessage: "must be a valid JSON Path expression or a reference to the existing Alias optionally paired with a JSON Path expression subset" + } + } + } + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/meta/ruleset.schema.json +var require_ruleset_schema = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/meta/ruleset.schema.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "@stoplight/spectral-core/meta/ruleset.schema", + type: "object", + additionalProperties: false, + properties: { + documentationUrl: { + type: "string", + format: "url", + errorMessage: "must be a valid URL" + }, + description: { + type: "string" + }, + rules: { + type: "object", + additionalProperties: { + $ref: "rule.schema#" + } + }, + functions: { + $ref: "extensions#functions" + }, + functionsDir: { + $ref: "extensions#functionsDir" + }, + formats: { + $ref: "shared#formats" + }, + extends: { + $ref: "extensions#extends" + }, + parserOptions: { + type: "object", + properties: { + duplicateKeys: { + $ref: "shared#severity" + }, + incompatibleValues: { + $ref: "shared#severity" + } + }, + additionalProperties: false + }, + overrides: { + type: "array", + minItems: 1, + items: { + if: { + type: "object", + properties: { + files: { + type: "array", + minItems: 1, + items: { + type: "string", + minLength: 1, + pattern: "^[^#]+#" + }, + errorMessage: "must be an non-empty array of glob patterns" + } + }, + required: ["files"] + }, + then: { + type: "object", + properties: { + files: true, + rules: { + type: "object", + additionalProperties: { + $ref: "shared#severity" + }, + errorMessage: { + enum: "must be a valid severity level" + } + } + }, + required: ["rules"], + additionalProperties: false, + errorMessage: { + required: "must contain rules when JSON Pointers are defined", + additionalProperties: "must not override any other property than rules when JSON Pointers are defined" + } + }, + else: { + allOf: [ + { + type: "object", + properties: { + files: { + type: "array", + minItems: 1, + items: { + type: "string", + pattern: "[^#]", + minLength: 1 + }, + errorMessage: "must be an non-empty array of glob patterns" + } + }, + required: ["files"], + errorMessage: { + type: 'must be an override, i.e. { "files": ["v2/**/*.json"], "rules": {} }' + } + }, + { + type: "object", + properties: { + formats: { + $ref: "shared#formats" + }, + extends: { + $ref: "#/properties/extends" + }, + rules: { + $ref: "#/properties/rules" + }, + parserOptions: { + $ref: "#/properties/parserOptions" + }, + aliases: { + $ref: "#/properties/aliases" + } + }, + anyOf: [ + { + required: ["extends"] + }, + { + required: ["rules"] + } + ] + } + ] + } + }, + errorMessage: { + minItems: "must not be empty" + } + }, + aliases: { + type: "object", + propertyNames: { + pattern: "^[A-Za-z][A-Za-z0-9_-]*$", + errorMessage: { + pattern: "to avoid confusion the name must match /^[A-Za-z][A-Za-z0-9_-]*$/ regular expression", + minLength: "the name of an alias must not be empty" + } + }, + additionalProperties: { + if: { + type: "object" + }, + then: { + type: "object", + properties: { + description: { + type: "string" + }, + targets: { + type: "array", + minItems: 1, + items: { + type: "object", + properties: { + formats: { + $ref: "shared#formats" + }, + given: { + $ref: "shared#arrayish-given" + } + }, + required: ["formats", "given"], + errorMessage: "a valid target must contain given and non-empty formats" + }, + errorMessage: { + minItems: "targets must have at least a single alias definition" + } + } + }, + required: ["targets"], + errorMessage: { + required: "targets must be present and have at least a single alias definition" + } + }, + else: { + $ref: "shared#arrayish-given" + } + } + } + }, + patternProperties: { + "^x-": true + }, + anyOf: [ + { + required: ["extends"] + }, + { + required: ["rules"] + }, + { + required: ["overrides"] + } + ] + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/meta/js-extensions.json +var require_js_extensions = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/meta/js-extensions.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "@stoplight/spectral-core/meta/extensions", + $defs: { + Extends: { + $anchor: "extends", + oneOf: [ + { + $id: "ruleset", + $ref: "ruleset.schema#", + errorMessage: "must be a valid ruleset" + }, + { + type: "array", + items: { + anyOf: [ + { + $ref: "ruleset" + }, + { + type: "array", + minItems: 2, + additionalItems: false, + items: [ + { + $ref: "ruleset" + }, + { + type: "string", + enum: ["off", "recommended", "all"], + errorMessage: 'allowed types are "off", "recommended" and "all"' + } + ] + } + ] + } + } + ], + errorMessage: "must be a valid ruleset" + }, + Format: { + $anchor: "format", + "x-spectral-runtime": "format", + errorMessage: "must be a valid format" + }, + Function: { + $anchor: "function", + "x-spectral-runtime": "ruleset-function", + type: "object", + properties: { + function: true + }, + required: ["function"] + }, + Functions: { + $anchor: "functions", + not: {} + }, + FunctionsDir: { + $anchor: "functionsDir", + not: {} + } + } + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/meta/json-extensions.json +var require_json_extensions = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/meta/json-extensions.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema#", + $id: "@stoplight/spectral-core/meta/extensions", + $defs: { + Extends: { + $anchor: "extends", + oneOf: [ + { + type: "string" + }, + { + type: "array", + items: { + oneOf: [ + { + type: "string" + }, + { + type: "array", + minItems: 2, + additionalItems: false, + items: [ + { + type: "string" + }, + { + enum: ["all", "recommended", "off"], + errorMessage: 'allowed types are "off", "recommended" and "all"' + } + ] + } + ] + } + } + ] + }, + Format: { + $anchor: "format", + type: "string", + errorMessage: "must be a valid format" + }, + Functions: { + $anchor: "functions", + type: "array", + items: { + type: "string" + } + }, + FunctionsDir: { + $anchor: "functionsDir", + type: "string" + }, + Function: { + $anchor: "function", + type: "object", + properties: { + function: { + type: "string" + } + }, + required: ["function"] + } + } + }; + } +}); + +// node_modules/function-bind/implementation.js +var require_implementation = __commonJS({ + "node_modules/function-bind/implementation.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max2 = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a7, b8) { + var arr = []; + for (var i7 = 0; i7 < a7.length; i7 += 1) { + arr[i7] = a7[i7]; + } + for (var j6 = 0; j6 < b8.length; j6 += 1) { + arr[j6 + a7.length] = b8[j6]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i7 = offset || 0, j6 = 0; i7 < arrLike.length; i7 += 1, j6 += 1) { + arr[j6] = arrLike[i7]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str2 = ""; + for (var i7 = 0; i7 < arr.length; i7 += 1) { + str2 += arr[i7]; + if (i7 + 1 < arr.length) { + str2 += joiner; + } + } + return str2; + }; + module5.exports = function bind2(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result2 = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result2) === result2) { + return result2; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + }; + var boundLength = max2(0, target.length - args.length); + var boundArgs = []; + for (var i7 = 0; i7 < boundLength; i7++) { + boundArgs[i7] = "$" + i7; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + } +}); + +// node_modules/function-bind/index.js +var require_function_bind = __commonJS({ + "node_modules/function-bind/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var implementation = require_implementation(); + module5.exports = Function.prototype.bind || implementation; + } +}); + +// node_modules/object-keys/isArguments.js +var require_isArguments = __commonJS({ + "node_modules/object-keys/isArguments.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var toStr = Object.prototype.toString; + module5.exports = function isArguments2(value2) { + var str2 = toStr.call(value2); + var isArgs = str2 === "[object Arguments]"; + if (!isArgs) { + isArgs = str2 !== "[object Array]" && value2 !== null && typeof value2 === "object" && typeof value2.length === "number" && value2.length >= 0 && toStr.call(value2.callee) === "[object Function]"; + } + return isArgs; + }; + } +}); + +// node_modules/object-keys/implementation.js +var require_implementation2 = __commonJS({ + "node_modules/object-keys/implementation.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var keysShim; + if (!Object.keys) { + has2 = Object.prototype.hasOwnProperty; + toStr = Object.prototype.toString; + isArgs = require_isArguments(); + isEnumerable = Object.prototype.propertyIsEnumerable; + hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString"); + hasProtoEnumBug = isEnumerable.call(function() { + }, "prototype"); + dontEnums = [ + "toString", + "toLocaleString", + "valueOf", + "hasOwnProperty", + "isPrototypeOf", + "propertyIsEnumerable", + "constructor" + ]; + equalsConstructorPrototype = function(o7) { + var ctor = o7.constructor; + return ctor && ctor.prototype === o7; + }; + excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + hasAutomationEqualityBug = function() { + if (typeof window === "undefined") { + return false; + } + for (var k6 in window) { + try { + if (!excludedKeys["$" + k6] && has2.call(window, k6) && window[k6] !== null && typeof window[k6] === "object") { + try { + equalsConstructorPrototype(window[k6]); + } catch (e10) { + return true; + } + } + } catch (e10) { + return true; + } + } + return false; + }(); + equalsConstructorPrototypeIfNotBuggy = function(o7) { + if (typeof window === "undefined" || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o7); + } + try { + return equalsConstructorPrototype(o7); + } catch (e10) { + return false; + } + }; + keysShim = function keys2(object) { + var isObject8 = object !== null && typeof object === "object"; + var isFunction3 = toStr.call(object) === "[object Function]"; + var isArguments2 = isArgs(object); + var isString4 = isObject8 && toStr.call(object) === "[object String]"; + var theKeys = []; + if (!isObject8 && !isFunction3 && !isArguments2) { + throw new TypeError("Object.keys called on a non-object"); + } + var skipProto = hasProtoEnumBug && isFunction3; + if (isString4 && object.length > 0 && !has2.call(object, 0)) { + for (var i7 = 0; i7 < object.length; ++i7) { + theKeys.push(String(i7)); + } + } + if (isArguments2 && object.length > 0) { + for (var j6 = 0; j6 < object.length; ++j6) { + theKeys.push(String(j6)); + } + } else { + for (var name2 in object) { + if (!(skipProto && name2 === "prototype") && has2.call(object, name2)) { + theKeys.push(String(name2)); + } + } + } + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + for (var k6 = 0; k6 < dontEnums.length; ++k6) { + if (!(skipConstructor && dontEnums[k6] === "constructor") && has2.call(object, dontEnums[k6])) { + theKeys.push(dontEnums[k6]); + } + } + } + return theKeys; + }; + } + var has2; + var toStr; + var isArgs; + var isEnumerable; + var hasDontEnumBug; + var hasProtoEnumBug; + var dontEnums; + var equalsConstructorPrototype; + var excludedKeys; + var hasAutomationEqualityBug; + var equalsConstructorPrototypeIfNotBuggy; + module5.exports = keysShim; + } +}); + +// node_modules/object-keys/index.js +var require_object_keys = __commonJS({ + "node_modules/object-keys/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var slice2 = Array.prototype.slice; + var isArgs = require_isArguments(); + var origKeys = Object.keys; + var keysShim = origKeys ? function keys2(o7) { + return origKeys(o7); + } : require_implementation2(); + var originalKeys = Object.keys; + keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = function() { + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2); + if (!keysWorksWithArguments) { + Object.keys = function keys2(object) { + if (isArgs(object)) { + return originalKeys(slice2.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; + }; + module5.exports = keysShim; + } +}); + +// node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/es-errors/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Error; + } +}); + +// node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/es-errors/eval.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = EvalError; + } +}); + +// node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/es-errors/range.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = RangeError; + } +}); + +// node_modules/es-errors/ref.js +var require_ref2 = __commonJS({ + "node_modules/es-errors/ref.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = ReferenceError; + } +}); + +// node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/es-errors/syntax.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = SyntaxError; + } +}); + +// node_modules/es-errors/type.js +var require_type2 = __commonJS({ + "node_modules/es-errors/type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = TypeError; + } +}); + +// node_modules/es-errors/uri.js +var require_uri3 = __commonJS({ + "node_modules/es-errors/uri.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = URIError; + } +}); + +// node_modules/has-symbols/shams.js +var require_shams = __commonJS({ + "node_modules/has-symbols/shams.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function hasSymbols() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/has-symbols/index.js +var require_has_symbols = __commonJS({ + "node_modules/has-symbols/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = require_shams(); + module5.exports = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; + } + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); + }; + } +}); + +// node_modules/has-proto/index.js +var require_has_proto = __commonJS({ + "node_modules/has-proto/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var test = { + __proto__: null, + foo: {} + }; + var $Object = Object; + module5.exports = function hasProto() { + return { __proto__: test }.foo === test.foo && !(test instanceof $Object); + }; + } +}); + +// node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/hasown/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind2 = require_function_bind(); + module5.exports = bind2.call(call, $hasOwn); + } +}); + +// node_modules/get-intrinsic/index.js +var require_get_intrinsic = __commonJS({ + "node_modules/get-intrinsic/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var undefined2; + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref2(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type2(); + var $URIError = require_uri3(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e10) { + } + }; + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ""); + } catch (e10) { + $gOPD = null; + } + } + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols = require_has_symbols()(); + var hasProto = require_has_proto()(); + var getProto = Object.getPrototypeOf || (hasProto ? function(x7) { + return x7.__proto__; + } : null); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, + "%AsyncFromSyncIteratorPrototype%": undefined2, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + // eslint-disable-line no-eval + "%EvalError%": $EvalError, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, + "%JSON%": typeof JSON === "object" ? JSON : undefined2, + "%Map%": typeof Map === "undefined" ? undefined2 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": Object, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined2 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, + "%Symbol%": hasSymbols ? Symbol : undefined2, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet + }; + if (getProto) { + try { + null.error; + } catch (e10) { + errorProto = getProto(getProto(e10)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var errorProto; + var doEval = function doEval2(name2) { + var value2; + if (name2 === "%AsyncFunction%") { + value2 = getEvalledConstructor("async function () {}"); + } else if (name2 === "%GeneratorFunction%") { + value2 = getEvalledConstructor("function* () {}"); + } else if (name2 === "%AsyncGeneratorFunction%") { + value2 = getEvalledConstructor("async function* () {}"); + } else if (name2 === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value2 = fn.prototype; + } + } else if (name2 === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value2 = getProto(gen.prototype); + } + } + INTRINSICS[name2] = value2; + return value2; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind2 = require_function_bind(); + var hasOwn = require_hasown(); + var $concat = bind2.call(Function.call, Array.prototype.concat); + var $spliceApply = bind2.call(Function.apply, Array.prototype.splice); + var $replace = bind2.call(Function.call, String.prototype.replace); + var $strSlice = bind2.call(Function.call, String.prototype.slice); + var $exec = bind2.call(Function.call, RegExp.prototype.exec); + var rePropName2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar2 = /\\(\\)?/g; + var stringToPath2 = function stringToPath3(string2) { + var first = $strSlice(string2, 0, 1); + var last2 = $strSlice(string2, -1); + if (first === "%" && last2 !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last2 === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result2 = []; + $replace(string2, rePropName2, function(match, number, quote, subString) { + result2[result2.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number || match; + }); + return result2; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name2, allowMissing) { + var intrinsicName = name2; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; + } + if (hasOwn(INTRINSICS, intrinsicName)) { + var value2 = INTRINSICS[intrinsicName]; + if (value2 === needsEval) { + value2 = doEval(intrinsicName); + } + if (typeof value2 === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name2 + " exists, but is not available. Please file an issue!"); + } + return { + alias, + name: intrinsicName, + value: value2 + }; + } + throw new $SyntaxError("intrinsic " + name2 + " does not exist!"); + }; + module5.exports = function GetIntrinsic(name2, allowMissing) { + if (typeof name2 !== "string" || name2.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name2) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath2(name2); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value2 = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i7 = 1, isOwn = true; i7 < parts.length; i7 += 1) { + var part = parts[i7]; + var first = $strSlice(part, 0, 1); + var last2 = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || (last2 === '"' || last2 === "'" || last2 === "`")) && first !== last2) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value2 = INTRINSICS[intrinsicRealName]; + } else if (value2 != null) { + if (!(part in value2)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name2 + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i7 + 1 >= parts.length) { + var desc = $gOPD(value2, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value2 = desc.get; + } else { + value2 = value2[part]; + } + } else { + isOwn = hasOwn(value2, part); + value2 = value2[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value2; + } + } + } + return value2; + }; + } +}); + +// node_modules/es-define-property/index.js +var require_es_define_property = __commonJS({ + "node_modules/es-define-property/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e10) { + $defineProperty = false; + } + } + module5.exports = $defineProperty; + } +}); + +// node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/gopd/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e10) { + $gOPD = null; + } + } + module5.exports = $gOPD; + } +}); + +// node_modules/define-data-property/index.js +var require_define_data_property = __commonJS({ + "node_modules/define-data-property/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $defineProperty = require_es_define_property(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type2(); + var gopd = require_gopd(); + module5.exports = function defineDataProperty(obj, property2, value2) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property2 !== "string" && typeof property2 !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property2); + if ($defineProperty) { + $defineProperty(obj, property2, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value2, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property2] = value2; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + } +}); + +// node_modules/has-property-descriptors/index.js +var require_has_property_descriptors = __commonJS({ + "node_modules/has-property-descriptors/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $defineProperty = require_es_define_property(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { value: 1 }).length !== 1; + } catch (e10) { + return true; + } + }; + module5.exports = hasPropertyDescriptors; + } +}); + +// node_modules/define-properties/index.js +var require_define_properties = __commonJS({ + "node_modules/define-properties/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var keys2 = require_object_keys(); + var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol"; + var toStr = Object.prototype.toString; + var concat2 = Array.prototype.concat; + var defineDataProperty = require_define_data_property(); + var isFunction3 = function(fn) { + return typeof fn === "function" && toStr.call(fn) === "[object Function]"; + }; + var supportsDescriptors = require_has_property_descriptors()(); + var defineProperty2 = function(object, name2, value2, predicate) { + if (name2 in object) { + if (predicate === true) { + if (object[name2] === value2) { + return; + } + } else if (!isFunction3(predicate) || !predicate()) { + return; + } + } + if (supportsDescriptors) { + defineDataProperty(object, name2, value2, true); + } else { + defineDataProperty(object, name2, value2); + } + }; + var defineProperties = function(object, map4) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys2(map4); + if (hasSymbols) { + props = concat2.call(props, Object.getOwnPropertySymbols(map4)); + } + for (var i7 = 0; i7 < props.length; i7 += 1) { + defineProperty2(object, props[i7], map4[props[i7]], predicates[props[i7]]); + } + }; + defineProperties.supportsDescriptors = !!supportsDescriptors; + module5.exports = defineProperties; + } +}); + +// node_modules/functions-have-names/index.js +var require_functions_have_names = __commonJS({ + "node_modules/functions-have-names/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var functionsHaveNames = function functionsHaveNames2() { + return typeof function f8() { + }.name === "string"; + }; + var gOPD = Object.getOwnPropertyDescriptor; + if (gOPD) { + try { + gOPD([], "length"); + } catch (e10) { + gOPD = null; + } + } + functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { + if (!functionsHaveNames() || !gOPD) { + return false; + } + var desc = gOPD(function() { + }, "name"); + return !!desc && !!desc.configurable; + }; + var $bind = Function.prototype.bind; + functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { + return functionsHaveNames() && typeof $bind === "function" && function f8() { + }.bind().name !== ""; + }; + module5.exports = functionsHaveNames; + } +}); + +// node_modules/set-function-name/index.js +var require_set_function_name = __commonJS({ + "node_modules/set-function-name/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var functionsHaveConfigurableNames = require_functions_have_names().functionsHaveConfigurableNames(); + var $TypeError = require_type2(); + module5.exports = function setFunctionName(fn, name2) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + var loose = arguments.length > 2 && !!arguments[2]; + if (!loose || functionsHaveConfigurableNames) { + if (hasDescriptors) { + define2( + /** @type {Parameters[0]} */ + fn, + "name", + name2, + true, + true + ); + } else { + define2( + /** @type {Parameters[0]} */ + fn, + "name", + name2 + ); + } + } + return fn; + }; + } +}); + +// node_modules/es-abstract/2024/IsPropertyKey.js +var require_IsPropertyKey = __commonJS({ + "node_modules/es-abstract/2024/IsPropertyKey.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function IsPropertyKey(argument) { + return typeof argument === "string" || typeof argument === "symbol"; + }; + } +}); + +// node_modules/es-abstract/helpers/records/property-descriptor.js +var require_property_descriptor = __commonJS({ + "node_modules/es-abstract/helpers/records/property-descriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var hasOwn = require_hasown(); + var allowed = { + __proto__: null, + "[[Configurable]]": true, + "[[Enumerable]]": true, + "[[Get]]": true, + "[[Set]]": true, + "[[Value]]": true, + "[[Writable]]": true + }; + module5.exports = function isPropertyDescriptor(Desc) { + if (!Desc || typeof Desc !== "object") { + return false; + } + for (var key in Desc) { + if (hasOwn(Desc, key) && !allowed[key]) { + return false; + } + } + var isData = hasOwn(Desc, "[[Value]]") || hasOwn(Desc, "[[Writable]]"); + var IsAccessor = hasOwn(Desc, "[[Get]]") || hasOwn(Desc, "[[Set]]"); + if (isData && IsAccessor) { + throw new $TypeError("Property Descriptors may not be both accessor and data descriptors"); + } + return true; + }; + } +}); + +// node_modules/es-abstract/2024/IsAccessorDescriptor.js +var require_IsAccessorDescriptor = __commonJS({ + "node_modules/es-abstract/2024/IsAccessorDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var hasOwn = require_hasown(); + var isPropertyDescriptor = require_property_descriptor(); + module5.exports = function IsAccessorDescriptor(Desc) { + if (typeof Desc === "undefined") { + return false; + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + if (!hasOwn(Desc, "[[Get]]") && !hasOwn(Desc, "[[Set]]")) { + return false; + } + return true; + }; + } +}); + +// node_modules/es-abstract/helpers/isPrimitive.js +var require_isPrimitive = __commonJS({ + "node_modules/es-abstract/helpers/isPrimitive.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function isPrimitive2(value2) { + return value2 === null || typeof value2 !== "function" && typeof value2 !== "object"; + }; + } +}); + +// node_modules/es-abstract/2024/IsExtensible.js +var require_IsExtensible = __commonJS({ + "node_modules/es-abstract/2024/IsExtensible.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $preventExtensions = GetIntrinsic("%Object.preventExtensions%", true); + var $isExtensible = GetIntrinsic("%Object.isExtensible%", true); + var isPrimitive2 = require_isPrimitive(); + module5.exports = $preventExtensions ? function IsExtensible(obj) { + return !isPrimitive2(obj) && $isExtensible(obj); + } : function IsExtensible(obj) { + return !isPrimitive2(obj); + }; + } +}); + +// node_modules/es-abstract/5/Type.js +var require_Type = __commonJS({ + "node_modules/es-abstract/5/Type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function Type3(x7) { + if (x7 === null) { + return "Null"; + } + if (typeof x7 === "undefined") { + return "Undefined"; + } + if (typeof x7 === "function" || typeof x7 === "object") { + return "Object"; + } + if (typeof x7 === "number") { + return "Number"; + } + if (typeof x7 === "boolean") { + return "Boolean"; + } + if (typeof x7 === "string") { + return "String"; + } + }; + } +}); + +// node_modules/es-abstract/2024/Type.js +var require_Type2 = __commonJS({ + "node_modules/es-abstract/2024/Type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ES5Type = require_Type(); + module5.exports = function Type3(x7) { + if (typeof x7 === "symbol") { + return "Symbol"; + } + if (typeof x7 === "bigint") { + return "BigInt"; + } + return ES5Type(x7); + }; + } +}); + +// node_modules/es-abstract/2024/ToBoolean.js +var require_ToBoolean = __commonJS({ + "node_modules/es-abstract/2024/ToBoolean.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function ToBoolean(value2) { + return !!value2; + }; + } +}); + +// node_modules/is-callable/index.js +var require_is_callable = __commonJS({ + "node_modules/is-callable/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var fnToStr = Function.prototype.toString; + var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; + var badArrayLike; + var isCallableMarker; + if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { + try { + badArrayLike = Object.defineProperty({}, "length", { + get: function() { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + reflectApply(function() { + throw 42; + }, null, badArrayLike); + } catch (_6) { + if (_6 !== isCallableMarker) { + reflectApply = null; + } + } + } else { + reflectApply = null; + } + var constructorRegex = /^\s*class\b/; + var isES6ClassFn = function isES6ClassFunction(value2) { + try { + var fnStr = fnToStr.call(value2); + return constructorRegex.test(fnStr); + } catch (e10) { + return false; + } + }; + var tryFunctionObject = function tryFunctionToStr(value2) { + try { + if (isES6ClassFn(value2)) { + return false; + } + fnToStr.call(value2); + return true; + } catch (e10) { + return false; + } + }; + var toStr = Object.prototype.toString; + var objectClass = "[object Object]"; + var fnClass = "[object Function]"; + var genClass = "[object GeneratorFunction]"; + var ddaClass = "[object HTMLAllCollection]"; + var ddaClass2 = "[object HTML document.all class]"; + var ddaClass3 = "[object HTMLCollection]"; + var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; + var isIE68 = !(0 in [,]); + var isDDA = function isDocumentDotAll() { + return false; + }; + if (typeof document === "object") { + all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value2) { + if ((isIE68 || !value2) && (typeof value2 === "undefined" || typeof value2 === "object")) { + try { + var str2 = toStr.call(value2); + return (str2 === ddaClass || str2 === ddaClass2 || str2 === ddaClass3 || str2 === objectClass) && value2("") == null; + } catch (e10) { + } + } + return false; + }; + } + } + var all; + module5.exports = reflectApply ? function isCallable(value2) { + if (isDDA(value2)) { + return true; + } + if (!value2) { + return false; + } + if (typeof value2 !== "function" && typeof value2 !== "object") { + return false; + } + try { + reflectApply(value2, null, badArrayLike); + } catch (e10) { + if (e10 !== isCallableMarker) { + return false; + } + } + return !isES6ClassFn(value2) && tryFunctionObject(value2); + } : function isCallable(value2) { + if (isDDA(value2)) { + return true; + } + if (!value2) { + return false; + } + if (typeof value2 !== "function" && typeof value2 !== "object") { + return false; + } + if (hasToStringTag) { + return tryFunctionObject(value2); + } + if (isES6ClassFn(value2)) { + return false; + } + var strClass = toStr.call(value2); + if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { + return false; + } + return tryFunctionObject(value2); + }; + } +}); + +// node_modules/es-abstract/2024/IsCallable.js +var require_IsCallable = __commonJS({ + "node_modules/es-abstract/2024/IsCallable.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_is_callable(); + } +}); + +// node_modules/es-abstract/2024/ToPropertyDescriptor.js +var require_ToPropertyDescriptor = __commonJS({ + "node_modules/es-abstract/2024/ToPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasOwn = require_hasown(); + var $TypeError = require_type2(); + var Type3 = require_Type2(); + var ToBoolean = require_ToBoolean(); + var IsCallable = require_IsCallable(); + module5.exports = function ToPropertyDescriptor(Obj) { + if (Type3(Obj) !== "Object") { + throw new $TypeError("ToPropertyDescriptor requires an object"); + } + var desc = {}; + if (hasOwn(Obj, "enumerable")) { + desc["[[Enumerable]]"] = ToBoolean(Obj.enumerable); + } + if (hasOwn(Obj, "configurable")) { + desc["[[Configurable]]"] = ToBoolean(Obj.configurable); + } + if (hasOwn(Obj, "value")) { + desc["[[Value]]"] = Obj.value; + } + if (hasOwn(Obj, "writable")) { + desc["[[Writable]]"] = ToBoolean(Obj.writable); + } + if (hasOwn(Obj, "get")) { + var getter = Obj.get; + if (typeof getter !== "undefined" && !IsCallable(getter)) { + throw new $TypeError("getter must be a function"); + } + desc["[[Get]]"] = getter; + } + if (hasOwn(Obj, "set")) { + var setter = Obj.set; + if (typeof setter !== "undefined" && !IsCallable(setter)) { + throw new $TypeError("setter must be a function"); + } + desc["[[Set]]"] = setter; + } + if ((hasOwn(desc, "[[Get]]") || hasOwn(desc, "[[Set]]")) && (hasOwn(desc, "[[Value]]") || hasOwn(desc, "[[Writable]]"))) { + throw new $TypeError("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute"); + } + return desc; + }; + } +}); + +// node_modules/es-abstract/helpers/isNaN.js +var require_isNaN = __commonJS({ + "node_modules/es-abstract/helpers/isNaN.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Number.isNaN || function isNaN3(a7) { + return a7 !== a7; + }; + } +}); + +// node_modules/es-abstract/2024/SameValue.js +var require_SameValue = __commonJS({ + "node_modules/es-abstract/2024/SameValue.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $isNaN = require_isNaN(); + module5.exports = function SameValue(x7, y7) { + if (x7 === y7) { + if (x7 === 0) { + return 1 / x7 === 1 / y7; + } + return true; + } + return $isNaN(x7) && $isNaN(y7); + }; + } +}); + +// node_modules/set-function-length/index.js +var require_set_function_length = __commonJS({ + "node_modules/set-function-length/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var gOPD = require_gopd(); + var $TypeError = require_type2(); + var $floor = GetIntrinsic("%Math.floor%"); + module5.exports = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length, + true, + true + ); + } else { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length + ); + } + } + return fn; + }; + } +}); + +// node_modules/call-bind/index.js +var require_call_bind = __commonJS({ + "node_modules/call-bind/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var bind2 = require_function_bind(); + var GetIntrinsic = require_get_intrinsic(); + var setFunctionLength = require_set_function_length(); + var $TypeError = require_type2(); + var $apply = GetIntrinsic("%Function.prototype.apply%"); + var $call = GetIntrinsic("%Function.prototype.call%"); + var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); + var $defineProperty = require_es_define_property(); + var $max = GetIntrinsic("%Math.max%"); + module5.exports = function callBind(originalFunction) { + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); + } + var func = $reflectApply(bind2, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); + }; + var applyBind = function applyBind2() { + return $reflectApply(bind2, $apply, arguments); + }; + if ($defineProperty) { + $defineProperty(module5.exports, "apply", { value: applyBind }); + } else { + module5.exports.apply = applyBind; + } + } +}); + +// node_modules/call-bind/callBound.js +var require_callBound = __commonJS({ + "node_modules/call-bind/callBound.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var callBind = require_call_bind(); + var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); + module5.exports = function callBoundIntrinsic(name2, allowMissing) { + var intrinsic = GetIntrinsic(name2, !!allowMissing); + if (typeof intrinsic === "function" && $indexOf(name2, ".prototype.") > -1) { + return callBind(intrinsic); + } + return intrinsic; + }; + } +}); + +// node_modules/es-abstract/helpers/IsArray.js +var require_IsArray = __commonJS({ + "node_modules/es-abstract/helpers/IsArray.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $Array = GetIntrinsic("%Array%"); + var toStr = !$Array.isArray && require_callBound()("Object.prototype.toString"); + module5.exports = $Array.isArray || function IsArray(argument) { + return toStr(argument) === "[object Array]"; + }; + } +}); + +// node_modules/es-abstract/helpers/DefineOwnProperty.js +var require_DefineOwnProperty = __commonJS({ + "node_modules/es-abstract/helpers/DefineOwnProperty.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasPropertyDescriptors = require_has_property_descriptors(); + var $defineProperty = require_es_define_property(); + var hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug(); + var isArray3 = hasArrayLengthDefineBug && require_IsArray(); + var callBound = require_callBound(); + var $isEnumerable = callBound("Object.prototype.propertyIsEnumerable"); + module5.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O7, P6, desc) { + if (!$defineProperty) { + if (!IsDataDescriptor(desc)) { + return false; + } + if (!desc["[[Configurable]]"] || !desc["[[Writable]]"]) { + return false; + } + if (P6 in O7 && $isEnumerable(O7, P6) !== !!desc["[[Enumerable]]"]) { + return false; + } + var V5 = desc["[[Value]]"]; + O7[P6] = V5; + return SameValue(O7[P6], V5); + } + if (hasArrayLengthDefineBug && P6 === "length" && "[[Value]]" in desc && isArray3(O7) && O7.length !== desc["[[Value]]"]) { + O7.length = desc["[[Value]]"]; + return O7.length === desc["[[Value]]"]; + } + $defineProperty(O7, P6, FromPropertyDescriptor(desc)); + return true; + }; + } +}); + +// node_modules/es-abstract/helpers/isFullyPopulatedPropertyDescriptor.js +var require_isFullyPopulatedPropertyDescriptor = __commonJS({ + "node_modules/es-abstract/helpers/isFullyPopulatedPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var isPropertyDescriptor = require_property_descriptor(); + module5.exports = function isFullyPopulatedPropertyDescriptor(ES, Desc) { + return isPropertyDescriptor(Desc) && typeof Desc === "object" && "[[Enumerable]]" in Desc && "[[Configurable]]" in Desc && (ES.IsAccessorDescriptor(Desc) || ES.IsDataDescriptor(Desc)); + }; + } +}); + +// node_modules/es-abstract/helpers/fromPropertyDescriptor.js +var require_fromPropertyDescriptor = __commonJS({ + "node_modules/es-abstract/helpers/fromPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function fromPropertyDescriptor(Desc) { + if (typeof Desc === "undefined") { + return Desc; + } + var obj = {}; + if ("[[Value]]" in Desc) { + obj.value = Desc["[[Value]]"]; + } + if ("[[Writable]]" in Desc) { + obj.writable = !!Desc["[[Writable]]"]; + } + if ("[[Get]]" in Desc) { + obj.get = Desc["[[Get]]"]; + } + if ("[[Set]]" in Desc) { + obj.set = Desc["[[Set]]"]; + } + if ("[[Enumerable]]" in Desc) { + obj.enumerable = !!Desc["[[Enumerable]]"]; + } + if ("[[Configurable]]" in Desc) { + obj.configurable = !!Desc["[[Configurable]]"]; + } + return obj; + }; + } +}); + +// node_modules/es-abstract/2024/FromPropertyDescriptor.js +var require_FromPropertyDescriptor = __commonJS({ + "node_modules/es-abstract/2024/FromPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var isPropertyDescriptor = require_property_descriptor(); + var fromPropertyDescriptor = require_fromPropertyDescriptor(); + module5.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc !== "undefined" && !isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + return fromPropertyDescriptor(Desc); + }; + } +}); + +// node_modules/es-abstract/2024/IsDataDescriptor.js +var require_IsDataDescriptor = __commonJS({ + "node_modules/es-abstract/2024/IsDataDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var hasOwn = require_hasown(); + var isPropertyDescriptor = require_property_descriptor(); + module5.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === "undefined") { + return false; + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + if (!hasOwn(Desc, "[[Value]]") && !hasOwn(Desc, "[[Writable]]")) { + return false; + } + return true; + }; + } +}); + +// node_modules/es-abstract/2024/IsGenericDescriptor.js +var require_IsGenericDescriptor = __commonJS({ + "node_modules/es-abstract/2024/IsGenericDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var IsAccessorDescriptor = require_IsAccessorDescriptor(); + var IsDataDescriptor = require_IsDataDescriptor(); + var isPropertyDescriptor = require_property_descriptor(); + module5.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === "undefined") { + return false; + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + return false; + }; + } +}); + +// node_modules/es-abstract/2024/ValidateAndApplyPropertyDescriptor.js +var require_ValidateAndApplyPropertyDescriptor = __commonJS({ + "node_modules/es-abstract/2024/ValidateAndApplyPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var DefineOwnProperty = require_DefineOwnProperty(); + var isFullyPopulatedPropertyDescriptor = require_isFullyPopulatedPropertyDescriptor(); + var isPropertyDescriptor = require_property_descriptor(); + var FromPropertyDescriptor = require_FromPropertyDescriptor(); + var IsAccessorDescriptor = require_IsAccessorDescriptor(); + var IsDataDescriptor = require_IsDataDescriptor(); + var IsGenericDescriptor = require_IsGenericDescriptor(); + var IsPropertyKey = require_IsPropertyKey(); + var SameValue = require_SameValue(); + var Type3 = require_Type2(); + module5.exports = function ValidateAndApplyPropertyDescriptor(O7, P6, extensible, Desc, current) { + var oType = Type3(O7); + if (oType !== "Undefined" && oType !== "Object") { + throw new $TypeError("Assertion failed: O must be undefined or an Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: P must be a Property Key"); + } + if (typeof extensible !== "boolean") { + throw new $TypeError("Assertion failed: extensible must be a Boolean"); + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: Desc must be a Property Descriptor"); + } + if (typeof current !== "undefined" && !isPropertyDescriptor(current)) { + throw new $TypeError("Assertion failed: current must be a Property Descriptor, or undefined"); + } + if (typeof current === "undefined") { + if (!extensible) { + return false; + } + if (oType === "Undefined") { + return true; + } + if (IsAccessorDescriptor(Desc)) { + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + Desc + ); + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + { + "[[Configurable]]": !!Desc["[[Configurable]]"], + "[[Enumerable]]": !!Desc["[[Enumerable]]"], + "[[Value]]": Desc["[[Value]]"], + "[[Writable]]": !!Desc["[[Writable]]"] + } + ); + } + if (!isFullyPopulatedPropertyDescriptor( + { + IsAccessorDescriptor, + IsDataDescriptor + }, + current + )) { + throw new $TypeError("`current`, when present, must be a fully populated and valid Property Descriptor"); + } + if (!current["[[Configurable]]"]) { + if ("[[Configurable]]" in Desc && Desc["[[Configurable]]"]) { + return false; + } + if ("[[Enumerable]]" in Desc && !SameValue(Desc["[[Enumerable]]"], current["[[Enumerable]]"])) { + return false; + } + if (!IsGenericDescriptor(Desc) && !SameValue(IsAccessorDescriptor(Desc), IsAccessorDescriptor(current))) { + return false; + } + if (IsAccessorDescriptor(current)) { + if ("[[Get]]" in Desc && !SameValue(Desc["[[Get]]"], current["[[Get]]"])) { + return false; + } + if ("[[Set]]" in Desc && !SameValue(Desc["[[Set]]"], current["[[Set]]"])) { + return false; + } + } else if (!current["[[Writable]]"]) { + if ("[[Writable]]" in Desc && Desc["[[Writable]]"]) { + return false; + } + if ("[[Value]]" in Desc && !SameValue(Desc["[[Value]]"], current["[[Value]]"])) { + return false; + } + } + } + if (oType !== "Undefined") { + var configurable; + var enumerable; + if (IsDataDescriptor(current) && IsAccessorDescriptor(Desc)) { + configurable = ("[[Configurable]]" in Desc ? Desc : current)["[[Configurable]]"]; + enumerable = ("[[Enumerable]]" in Desc ? Desc : current)["[[Enumerable]]"]; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + { + "[[Configurable]]": !!configurable, + "[[Enumerable]]": !!enumerable, + "[[Get]]": ("[[Get]]" in Desc ? Desc : current)["[[Get]]"], + "[[Set]]": ("[[Set]]" in Desc ? Desc : current)["[[Set]]"] + } + ); + } else if (IsAccessorDescriptor(current) && IsDataDescriptor(Desc)) { + configurable = ("[[Configurable]]" in Desc ? Desc : current)["[[Configurable]]"]; + enumerable = ("[[Enumerable]]" in Desc ? Desc : current)["[[Enumerable]]"]; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + { + "[[Configurable]]": !!configurable, + "[[Enumerable]]": !!enumerable, + "[[Value]]": ("[[Value]]" in Desc ? Desc : current)["[[Value]]"], + "[[Writable]]": !!("[[Writable]]" in Desc ? Desc : current)["[[Writable]]"] + } + ); + } + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + Desc + ); + } + return true; + }; + } +}); + +// node_modules/es-abstract/2024/OrdinaryDefineOwnProperty.js +var require_OrdinaryDefineOwnProperty = __commonJS({ + "node_modules/es-abstract/2024/OrdinaryDefineOwnProperty.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $gOPD = require_gopd(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type2(); + var isPropertyDescriptor = require_property_descriptor(); + var IsAccessorDescriptor = require_IsAccessorDescriptor(); + var IsExtensible = require_IsExtensible(); + var IsPropertyKey = require_IsPropertyKey(); + var ToPropertyDescriptor = require_ToPropertyDescriptor(); + var SameValue = require_SameValue(); + var Type3 = require_Type2(); + var ValidateAndApplyPropertyDescriptor = require_ValidateAndApplyPropertyDescriptor(); + module5.exports = function OrdinaryDefineOwnProperty(O7, P6, Desc) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: O must be an Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: P must be a Property Key"); + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: Desc must be a Property Descriptor"); + } + if (!$gOPD) { + if (IsAccessorDescriptor(Desc)) { + throw new $SyntaxError("This environment does not support accessor property descriptors."); + } + var creatingNormalDataProperty = !(P6 in O7) && Desc["[[Writable]]"] && Desc["[[Enumerable]]"] && Desc["[[Configurable]]"] && "[[Value]]" in Desc; + var settingExistingDataProperty = P6 in O7 && (!("[[Configurable]]" in Desc) || Desc["[[Configurable]]"]) && (!("[[Enumerable]]" in Desc) || Desc["[[Enumerable]]"]) && (!("[[Writable]]" in Desc) || Desc["[[Writable]]"]) && "[[Value]]" in Desc; + if (creatingNormalDataProperty || settingExistingDataProperty) { + O7[P6] = Desc["[[Value]]"]; + return SameValue(O7[P6], Desc["[[Value]]"]); + } + throw new $SyntaxError("This environment does not support defining non-writable, non-enumerable, or non-configurable properties"); + } + var desc = $gOPD(O7, P6); + var current = desc && ToPropertyDescriptor(desc); + var extensible = IsExtensible(O7); + return ValidateAndApplyPropertyDescriptor(O7, P6, extensible, Desc, current); + }; + } +}); + +// node_modules/es-abstract/2024/CreateDataProperty.js +var require_CreateDataProperty = __commonJS({ + "node_modules/es-abstract/2024/CreateDataProperty.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var IsPropertyKey = require_IsPropertyKey(); + var OrdinaryDefineOwnProperty = require_OrdinaryDefineOwnProperty(); + var Type3 = require_Type2(); + module5.exports = function CreateDataProperty(O7, P6, V5) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: Type(O) is not Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true"); + } + var newDesc = { + "[[Configurable]]": true, + "[[Enumerable]]": true, + "[[Value]]": V5, + "[[Writable]]": true + }; + return OrdinaryDefineOwnProperty(O7, P6, newDesc); + }; + } +}); + +// node_modules/es-abstract/2024/CreateDataPropertyOrThrow.js +var require_CreateDataPropertyOrThrow = __commonJS({ + "node_modules/es-abstract/2024/CreateDataPropertyOrThrow.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var CreateDataProperty = require_CreateDataProperty(); + var IsPropertyKey = require_IsPropertyKey(); + var Type3 = require_Type2(); + module5.exports = function CreateDataPropertyOrThrow(O7, P6, V5) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: Type(O) is not Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true"); + } + var success = CreateDataProperty(O7, P6, V5); + if (!success) { + throw new $TypeError("unable to create data property"); + } + }; + } +}); + +// node_modules/es-abstract/2023/FromPropertyDescriptor.js +var require_FromPropertyDescriptor2 = __commonJS({ + "node_modules/es-abstract/2023/FromPropertyDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var isPropertyDescriptor = require_property_descriptor(); + var fromPropertyDescriptor = require_fromPropertyDescriptor(); + module5.exports = function FromPropertyDescriptor(Desc) { + if (typeof Desc !== "undefined" && !isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + return fromPropertyDescriptor(Desc); + }; + } +}); + +// node_modules/es-abstract/2023/IsDataDescriptor.js +var require_IsDataDescriptor2 = __commonJS({ + "node_modules/es-abstract/2023/IsDataDescriptor.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var hasOwn = require_hasown(); + var isPropertyDescriptor = require_property_descriptor(); + module5.exports = function IsDataDescriptor(Desc) { + if (typeof Desc === "undefined") { + return false; + } + if (!isPropertyDescriptor(Desc)) { + throw new $TypeError("Assertion failed: `Desc` must be a Property Descriptor"); + } + if (!hasOwn(Desc, "[[Value]]") && !hasOwn(Desc, "[[Writable]]")) { + return false; + } + return true; + }; + } +}); + +// node_modules/es-abstract/2023/IsPropertyKey.js +var require_IsPropertyKey2 = __commonJS({ + "node_modules/es-abstract/2023/IsPropertyKey.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function IsPropertyKey(argument) { + return typeof argument === "string" || typeof argument === "symbol"; + }; + } +}); + +// node_modules/es-abstract/2023/SameValue.js +var require_SameValue2 = __commonJS({ + "node_modules/es-abstract/2023/SameValue.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $isNaN = require_isNaN(); + module5.exports = function SameValue(x7, y7) { + if (x7 === y7) { + if (x7 === 0) { + return 1 / x7 === 1 / y7; + } + return true; + } + return $isNaN(x7) && $isNaN(y7); + }; + } +}); + +// node_modules/es-abstract/2023/Type.js +var require_Type3 = __commonJS({ + "node_modules/es-abstract/2023/Type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ES5Type = require_Type(); + module5.exports = function Type3(x7) { + if (typeof x7 === "symbol") { + return "Symbol"; + } + if (typeof x7 === "bigint") { + return "BigInt"; + } + return ES5Type(x7); + }; + } +}); + +// node_modules/es-abstract/2023/CreateMethodProperty.js +var require_CreateMethodProperty = __commonJS({ + "node_modules/es-abstract/2023/CreateMethodProperty.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var DefineOwnProperty = require_DefineOwnProperty(); + var FromPropertyDescriptor = require_FromPropertyDescriptor2(); + var IsDataDescriptor = require_IsDataDescriptor2(); + var IsPropertyKey = require_IsPropertyKey2(); + var SameValue = require_SameValue2(); + var Type3 = require_Type3(); + module5.exports = function CreateMethodProperty(O7, P6, V5) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: Type(O) is not Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true"); + } + var newDesc = { + "[[Configurable]]": true, + "[[Enumerable]]": false, + "[[Value]]": V5, + "[[Writable]]": true + }; + return DefineOwnProperty( + IsDataDescriptor, + SameValue, + FromPropertyDescriptor, + O7, + P6, + newDesc + ); + }; + } +}); + +// (disabled):node_modules/object-inspect/util.inspect +var require_util2 = __commonJS({ + "(disabled):node_modules/object-inspect/util.inspect"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/object-inspect/index.js +var require_object_inspect = __commonJS({ + "node_modules/object-inspect/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var hasMap = typeof Map === "function" && Map.prototype; + var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; + var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; + var mapForEach = hasMap && Map.prototype.forEach; + var hasSet = typeof Set === "function" && Set.prototype; + var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; + var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; + var setForEach = hasSet && Set.prototype.forEach; + var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; + var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; + var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; + var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; + var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; + var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; + var booleanValueOf = Boolean.prototype.valueOf; + var objectToString2 = Object.prototype.toString; + var functionToString = Function.prototype.toString; + var $match = String.prototype.match; + var $slice = String.prototype.slice; + var $replace = String.prototype.replace; + var $toUpperCase = String.prototype.toUpperCase; + var $toLowerCase = String.prototype.toLowerCase; + var $test = RegExp.prototype.test; + var $concat = Array.prototype.concat; + var $join = Array.prototype.join; + var $arrSlice = Array.prototype.slice; + var $floor = Math.floor; + var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; + var gOPS = Object.getOwnPropertySymbols; + var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; + var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; + var toStringTag2 = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; + var isEnumerable = Object.prototype.propertyIsEnumerable; + var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O7) { + return O7.__proto__; + } : null); + function addNumericSeparator(num, str2) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str2)) { + return str2; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === "number") { + var int4 = num < 0 ? -$floor(-num) : $floor(num); + if (int4 !== num) { + var intStr = String(int4); + var dec = $slice.call(str2, intStr.length + 1); + return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); + } + } + return $replace.call(str2, sepRegex, "$&_"); + } + var utilInspect = require_util2(); + var inspectCustom = utilInspect.custom; + var inspectSymbol = isSymbol3(inspectCustom) ? inspectCustom : null; + module5.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + if (has2(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if (has2(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has2(opts, "customInspect") ? opts.customInspect : true; + if (typeof customInspect !== "boolean" && customInspect !== "symbol") { + throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); + } + if (has2(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has2(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + if (typeof obj === "boolean") { + return obj ? "true" : "false"; + } + if (typeof obj === "string") { + return inspectString(obj, opts); + } + if (typeof obj === "number") { + if (obj === 0) { + return Infinity / obj > 0 ? "0" : "-0"; + } + var str2 = String(obj); + return numericSeparator ? addNumericSeparator(obj, str2) : str2; + } + if (typeof obj === "bigint") { + var bigIntStr = String(obj) + "n"; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; + if (typeof depth === "undefined") { + depth = 0; + } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { + return isArray3(obj) ? "[Array]" : "[Object]"; + } + var indent = getIndent(opts, depth); + if (typeof seen === "undefined") { + seen = []; + } else if (indexOf4(seen, obj) >= 0) { + return "[Circular]"; + } + function inspect2(value2, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has2(opts, "quoteStyle")) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value2, newOpts, depth + 1, seen); + } + return inspect_(value2, opts, depth + 1, seen); + } + if (typeof obj === "function" && !isRegExp3(obj)) { + var name2 = nameOf(obj); + var keys2 = arrObjKeys(obj, inspect2); + return "[Function" + (name2 ? ": " + name2 : " (anonymous)") + "]" + (keys2.length > 0 ? " { " + $join.call(keys2, ", ") + " }" : ""); + } + if (isSymbol3(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); + return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement2(obj)) { + var s7 = "<" + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i7 = 0; i7 < attrs.length; i7++) { + s7 += " " + attrs[i7].name + "=" + wrapQuotes(quote(attrs[i7].value), "double", opts); + } + s7 += ">"; + if (obj.childNodes && obj.childNodes.length) { + s7 += "..."; + } + s7 += ""; + return s7; + } + if (isArray3(obj)) { + if (obj.length === 0) { + return "[]"; + } + var xs = arrObjKeys(obj, inspect2); + if (indent && !singleLineValues(xs)) { + return "[" + indentedJoin(xs, indent) + "]"; + } + return "[ " + $join.call(xs, ", ") + " ]"; + } + if (isError3(obj)) { + var parts = arrObjKeys(obj, inspect2); + if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { + return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }"; + } + if (parts.length === 0) { + return "[" + String(obj) + "]"; + } + return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; + } + if (typeof obj === "object" && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { + return obj.inspect(); + } + } + if (isMap3(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function(value2, key) { + mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value2, obj)); + }); + } + return collectionOf("Map", mapSize.call(obj), mapParts, indent); + } + if (isSet2(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function(value2) { + setParts.push(inspect2(value2, obj)); + }); + } + return collectionOf("Set", setSize.call(obj), setParts, indent); + } + if (isWeakMap2(obj)) { + return weakCollectionOf("WeakMap"); + } + if (isWeakSet2(obj)) { + return weakCollectionOf("WeakSet"); + } + if (isWeakRef(obj)) { + return weakCollectionOf("WeakRef"); + } + if (isNumber3(obj)) { + return markBoxed(inspect2(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect2(bigIntValueOf.call(obj))); + } + if (isBoolean4(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString4(obj)) { + return markBoxed(inspect2(String(obj))); + } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (obj === globalThis) { + return "{ [object globalThis] }"; + } + if (!isDate3(obj) && !isRegExp3(obj)) { + var ys = arrObjKeys(obj, inspect2); + var isPlainObject3 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? "" : "null prototype"; + var stringTag6 = !isPlainObject3 && toStringTag2 && Object(obj) === obj && toStringTag2 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; + var constructorTag = isPlainObject3 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; + var tag = constructorTag + (stringTag6 || protoTag ? "[" + $join.call($concat.call([], stringTag6 || [], protoTag || []), ": ") + "] " : ""); + if (ys.length === 0) { + return tag + "{}"; + } + if (indent) { + return tag + "{" + indentedJoin(ys, indent) + "}"; + } + return tag + "{ " + $join.call(ys, ", ") + " }"; + } + return String(obj); + }; + function wrapQuotes(s7, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; + return quoteChar + s7 + quoteChar; + } + function quote(s7) { + return $replace.call(String(s7), /"/g, """); + } + function isArray3(obj) { + return toStr(obj) === "[object Array]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isDate3(obj) { + return toStr(obj) === "[object Date]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isRegExp3(obj) { + return toStr(obj) === "[object RegExp]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isError3(obj) { + return toStr(obj) === "[object Error]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isString4(obj) { + return toStr(obj) === "[object String]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isNumber3(obj) { + return toStr(obj) === "[object Number]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isBoolean4(obj) { + return toStr(obj) === "[object Boolean]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isSymbol3(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === "object" && obj instanceof Symbol; + } + if (typeof obj === "symbol") { + return true; + } + if (!obj || typeof obj !== "object" || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e10) { + } + return false; + } + function isBigInt(obj) { + if (!obj || typeof obj !== "object" || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e10) { + } + return false; + } + var hasOwn = Object.prototype.hasOwnProperty || function(key) { + return key in this; + }; + function has2(obj, key) { + return hasOwn.call(obj, key); + } + function toStr(obj) { + return objectToString2.call(obj); + } + function nameOf(f8) { + if (f8.name) { + return f8.name; + } + var m7 = $match.call(functionToString.call(f8), /^function\s*([\w$]+)/); + if (m7) { + return m7[1]; + } + return null; + } + function indexOf4(xs, x7) { + if (xs.indexOf) { + return xs.indexOf(x7); + } + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) { + return i7; + } + } + return -1; + } + function isMap3(x7) { + if (!mapSize || !x7 || typeof x7 !== "object") { + return false; + } + try { + mapSize.call(x7); + try { + setSize.call(x7); + } catch (s7) { + return true; + } + return x7 instanceof Map; + } catch (e10) { + } + return false; + } + function isWeakMap2(x7) { + if (!weakMapHas || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakMapHas.call(x7, weakMapHas); + try { + weakSetHas.call(x7, weakSetHas); + } catch (s7) { + return true; + } + return x7 instanceof WeakMap; + } catch (e10) { + } + return false; + } + function isWeakRef(x7) { + if (!weakRefDeref || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakRefDeref.call(x7); + return true; + } catch (e10) { + } + return false; + } + function isSet2(x7) { + if (!setSize || !x7 || typeof x7 !== "object") { + return false; + } + try { + setSize.call(x7); + try { + mapSize.call(x7); + } catch (m7) { + return true; + } + return x7 instanceof Set; + } catch (e10) { + } + return false; + } + function isWeakSet2(x7) { + if (!weakSetHas || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakSetHas.call(x7, weakSetHas); + try { + weakMapHas.call(x7, weakMapHas); + } catch (s7) { + return true; + } + return x7 instanceof WeakSet; + } catch (e10) { + } + return false; + } + function isElement2(x7) { + if (!x7 || typeof x7 !== "object") { + return false; + } + if (typeof HTMLElement !== "undefined" && x7 instanceof HTMLElement) { + return true; + } + return typeof x7.nodeName === "string" && typeof x7.getAttribute === "function"; + } + function inspectString(str2, opts) { + if (str2.length > opts.maxStringLength) { + var remaining = str2.length - opts.maxStringLength; + var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); + return inspectString($slice.call(str2, 0, opts.maxStringLength), opts) + trailer; + } + var s7 = $replace.call($replace.call(str2, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s7, "single", opts); + } + function lowbyte(c7) { + var n7 = c7.charCodeAt(0); + var x7 = { + 8: "b", + 9: "t", + 10: "n", + 12: "f", + 13: "r" + }[n7]; + if (x7) { + return "\\" + x7; + } + return "\\x" + (n7 < 16 ? "0" : "") + $toUpperCase.call(n7.toString(16)); + } + function markBoxed(str2) { + return "Object(" + str2 + ")"; + } + function weakCollectionOf(type3) { + return type3 + " { ? }"; + } + function collectionOf(type3, size2, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", "); + return type3 + " (" + size2 + ") {" + joinedEntries + "}"; + } + function singleLineValues(xs) { + for (var i7 = 0; i7 < xs.length; i7++) { + if (indexOf4(xs[i7], "\n") >= 0) { + return false; + } + } + return true; + } + function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === " ") { + baseIndent = " "; + } else if (typeof opts.indent === "number" && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), " "); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; + } + function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ""; + } + var lineJoiner = "\n" + indent.prev + indent.base; + return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; + } + function arrObjKeys(obj, inspect2) { + var isArr = isArray3(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i7 = 0; i7 < obj.length; i7++) { + xs[i7] = has2(obj, i7) ? inspect2(obj[i7], obj) : ""; + } + } + var syms = typeof gOPS === "function" ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k6 = 0; k6 < syms.length; k6++) { + symMap["$" + syms[k6]] = syms[k6]; + } + } + for (var key in obj) { + if (!has2(obj, key)) { + continue; + } + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj)); + } else { + xs.push(key + ": " + inspect2(obj[key], obj)); + } + } + if (typeof gOPS === "function") { + for (var j6 = 0; j6 < syms.length; j6++) { + if (isEnumerable.call(obj, syms[j6])) { + xs.push("[" + inspect2(syms[j6]) + "]: " + inspect2(obj[syms[j6]], obj)); + } + } + } + return xs; + } + } +}); + +// node_modules/es-abstract/helpers/isLeadingSurrogate.js +var require_isLeadingSurrogate = __commonJS({ + "node_modules/es-abstract/helpers/isLeadingSurrogate.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function isLeadingSurrogate(charCode) { + return typeof charCode === "number" && charCode >= 55296 && charCode <= 56319; + }; + } +}); + +// node_modules/es-abstract/helpers/isTrailingSurrogate.js +var require_isTrailingSurrogate = __commonJS({ + "node_modules/es-abstract/helpers/isTrailingSurrogate.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function isTrailingSurrogate(charCode) { + return typeof charCode === "number" && charCode >= 56320 && charCode <= 57343; + }; + } +}); + +// node_modules/es-abstract/2024/UTF16SurrogatePairToCodePoint.js +var require_UTF16SurrogatePairToCodePoint = __commonJS({ + "node_modules/es-abstract/2024/UTF16SurrogatePairToCodePoint.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $TypeError = require_type2(); + var $fromCharCode = GetIntrinsic("%String.fromCharCode%"); + var isLeadingSurrogate = require_isLeadingSurrogate(); + var isTrailingSurrogate = require_isTrailingSurrogate(); + module5.exports = function UTF16SurrogatePairToCodePoint(lead, trail) { + if (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) { + throw new $TypeError("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code"); + } + return $fromCharCode(lead) + $fromCharCode(trail); + }; + } +}); + +// node_modules/es-abstract/2024/CodePointAt.js +var require_CodePointAt = __commonJS({ + "node_modules/es-abstract/2024/CodePointAt.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var callBound = require_callBound(); + var isLeadingSurrogate = require_isLeadingSurrogate(); + var isTrailingSurrogate = require_isTrailingSurrogate(); + var UTF16SurrogatePairToCodePoint = require_UTF16SurrogatePairToCodePoint(); + var $charAt = callBound("String.prototype.charAt"); + var $charCodeAt = callBound("String.prototype.charCodeAt"); + module5.exports = function CodePointAt(string2, position) { + if (typeof string2 !== "string") { + throw new $TypeError("Assertion failed: `string` must be a String"); + } + var size2 = string2.length; + if (position < 0 || position >= size2) { + throw new $TypeError("Assertion failed: `position` must be >= 0, and < the length of `string`"); + } + var first = $charCodeAt(string2, position); + var cp = $charAt(string2, position); + var firstIsLeading = isLeadingSurrogate(first); + var firstIsTrailing = isTrailingSurrogate(first); + if (!firstIsLeading && !firstIsTrailing) { + return { + "[[CodePoint]]": cp, + "[[CodeUnitCount]]": 1, + "[[IsUnpairedSurrogate]]": false + }; + } + if (firstIsTrailing || position + 1 === size2) { + return { + "[[CodePoint]]": cp, + "[[CodeUnitCount]]": 1, + "[[IsUnpairedSurrogate]]": true + }; + } + var second = $charCodeAt(string2, position + 1); + if (!isTrailingSurrogate(second)) { + return { + "[[CodePoint]]": cp, + "[[CodeUnitCount]]": 1, + "[[IsUnpairedSurrogate]]": true + }; + } + return { + "[[CodePoint]]": UTF16SurrogatePairToCodePoint(first, second), + "[[CodeUnitCount]]": 2, + "[[IsUnpairedSurrogate]]": false + }; + }; + } +}); + +// node_modules/es-abstract/helpers/isFinite.js +var require_isFinite = __commonJS({ + "node_modules/es-abstract/helpers/isFinite.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $isNaN = require_isNaN(); + module5.exports = function(x7) { + return (typeof x7 === "number" || typeof x7 === "bigint") && !$isNaN(x7) && x7 !== Infinity && x7 !== -Infinity; + }; + } +}); + +// node_modules/es-abstract/helpers/isInteger.js +var require_isInteger = __commonJS({ + "node_modules/es-abstract/helpers/isInteger.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $abs = GetIntrinsic("%Math.abs%"); + var $floor = GetIntrinsic("%Math.floor%"); + var $isNaN = require_isNaN(); + var $isFinite = require_isFinite(); + module5.exports = function isInteger3(argument) { + if (typeof argument !== "number" || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var absValue = $abs(argument); + return $floor(absValue) === absValue; + }; + } +}); + +// node_modules/es-abstract/helpers/maxSafeInteger.js +var require_maxSafeInteger = __commonJS({ + "node_modules/es-abstract/helpers/maxSafeInteger.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; + } +}); + +// node_modules/es-abstract/2024/AdvanceStringIndex.js +var require_AdvanceStringIndex = __commonJS({ + "node_modules/es-abstract/2024/AdvanceStringIndex.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var CodePointAt = require_CodePointAt(); + var isInteger3 = require_isInteger(); + var MAX_SAFE_INTEGER7 = require_maxSafeInteger(); + var $TypeError = require_type2(); + module5.exports = function AdvanceStringIndex(S6, index4, unicode) { + if (typeof S6 !== "string") { + throw new $TypeError("Assertion failed: `S` must be a String"); + } + if (!isInteger3(index4) || index4 < 0 || index4 > MAX_SAFE_INTEGER7) { + throw new $TypeError("Assertion failed: `length` must be an integer >= 0 and <= 2**53"); + } + if (typeof unicode !== "boolean") { + throw new $TypeError("Assertion failed: `unicode` must be a Boolean"); + } + if (!unicode) { + return index4 + 1; + } + var length = S6.length; + if (index4 + 1 >= length) { + return index4 + 1; + } + var cp = CodePointAt(S6, index4); + return index4 + cp["[[CodeUnitCount]]"]; + }; + } +}); + +// node_modules/es-abstract/2024/CreateIterResultObject.js +var require_CreateIterResultObject = __commonJS({ + "node_modules/es-abstract/2024/CreateIterResultObject.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + module5.exports = function CreateIterResultObject(value2, done) { + if (typeof done !== "boolean") { + throw new $TypeError("Assertion failed: Type(done) is not Boolean"); + } + return { + value: value2, + done + }; + }; + } +}); + +// node_modules/es-abstract/2024/Get.js +var require_Get = __commonJS({ + "node_modules/es-abstract/2024/Get.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var inspect2 = require_object_inspect(); + var IsPropertyKey = require_IsPropertyKey(); + var Type3 = require_Type2(); + module5.exports = function Get(O7, P6) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: Type(O) is not Object"); + } + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true, got " + inspect2(P6)); + } + return O7[P6]; + }; + } +}); + +// node_modules/es-abstract/2024/IteratorComplete.js +var require_IteratorComplete = __commonJS({ + "node_modules/es-abstract/2024/IteratorComplete.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var Get = require_Get(); + var ToBoolean = require_ToBoolean(); + var Type3 = require_Type2(); + module5.exports = function IteratorComplete(iterResult) { + if (Type3(iterResult) !== "Object") { + throw new $TypeError("Assertion failed: Type(iterResult) is not Object"); + } + return ToBoolean(Get(iterResult, "done")); + }; + } +}); + +// node_modules/es-abstract/2024/IteratorValue.js +var require_IteratorValue = __commonJS({ + "node_modules/es-abstract/2024/IteratorValue.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var Get = require_Get(); + var Type3 = require_Type2(); + module5.exports = function IteratorValue(iterResult) { + if (Type3(iterResult) !== "Object") { + throw new $TypeError("Assertion failed: Type(iterResult) is not Object"); + } + return Get(iterResult, "value"); + }; + } +}); + +// node_modules/es-abstract/2024/PromiseResolve.js +var require_PromiseResolve = __commonJS({ + "node_modules/es-abstract/2024/PromiseResolve.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var callBind = require_call_bind(); + var $SyntaxError = require_syntax(); + var $resolve = GetIntrinsic("%Promise.resolve%", true); + var $PromiseResolve = $resolve && callBind($resolve); + module5.exports = function PromiseResolve(C6, x7) { + if (!$PromiseResolve) { + throw new $SyntaxError("This environment does not support Promises."); + } + return $PromiseResolve(C6, x7); + }; + } +}); + +// node_modules/es-abstract/2024/AsyncFromSyncIteratorContinuation.js +var require_AsyncFromSyncIteratorContinuation = __commonJS({ + "node_modules/es-abstract/2024/AsyncFromSyncIteratorContinuation.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type2(); + var $Promise = GetIntrinsic("%Promise%", true); + var callBound = require_callBound(); + var CreateIterResultObject = require_CreateIterResultObject(); + var IteratorComplete = require_IteratorComplete(); + var IteratorValue = require_IteratorValue(); + var PromiseResolve = require_PromiseResolve(); + var Type3 = require_Type2(); + var $then = callBound("Promise.prototype.then", true); + module5.exports = function AsyncFromSyncIteratorContinuation(result2) { + if (Type3(result2) !== "Object") { + throw new $TypeError("Assertion failed: Type(O) is not Object"); + } + if (arguments.length > 1) { + throw new $SyntaxError("although AsyncFromSyncIteratorContinuation should take a second argument, it is not used in this implementation"); + } + if (!$Promise) { + throw new $SyntaxError("This environment does not support Promises."); + } + return new $Promise(function(resolve3) { + var done = IteratorComplete(result2); + var value2 = IteratorValue(result2); + var valueWrapper = PromiseResolve($Promise, value2); + var onFulfilled = function(value3) { + return CreateIterResultObject(value3, done); + }; + resolve3($then(valueWrapper, onFulfilled)); + }); + }; + } +}); + +// node_modules/es-abstract/2024/IsArray.js +var require_IsArray2 = __commonJS({ + "node_modules/es-abstract/2024/IsArray.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_IsArray(); + } +}); + +// node_modules/es-abstract/2024/Call.js +var require_Call = __commonJS({ + "node_modules/es-abstract/2024/Call.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var callBound = require_callBound(); + var $TypeError = require_type2(); + var IsArray = require_IsArray2(); + var $apply = GetIntrinsic("%Reflect.apply%", true) || callBound("Function.prototype.apply"); + module5.exports = function Call(F6, V5) { + var argumentsList = arguments.length > 2 ? arguments[2] : []; + if (!IsArray(argumentsList)) { + throw new $TypeError("Assertion failed: optional `argumentsList`, if provided, must be a List"); + } + return $apply(F6, V5, argumentsList); + }; + } +}); + +// node_modules/es-abstract/2024/GetV.js +var require_GetV = __commonJS({ + "node_modules/es-abstract/2024/GetV.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var inspect2 = require_object_inspect(); + var IsPropertyKey = require_IsPropertyKey(); + module5.exports = function GetV(V5, P6) { + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true, got " + inspect2(P6)); + } + return V5[P6]; + }; + } +}); + +// node_modules/es-abstract/2024/GetMethod.js +var require_GetMethod = __commonJS({ + "node_modules/es-abstract/2024/GetMethod.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var GetV = require_GetV(); + var IsCallable = require_IsCallable(); + var IsPropertyKey = require_IsPropertyKey(); + var inspect2 = require_object_inspect(); + module5.exports = function GetMethod(O7, P6) { + if (!IsPropertyKey(P6)) { + throw new $TypeError("Assertion failed: IsPropertyKey(P) is not true"); + } + var func = GetV(O7, P6); + if (func == null) { + return void 0; + } + if (!IsCallable(func)) { + throw new $TypeError(inspect2(P6) + " is not a function: " + inspect2(func)); + } + return func; + }; + } +}); + +// node_modules/es-abstract/helpers/records/iterator-record.js +var require_iterator_record = __commonJS({ + "node_modules/es-abstract/helpers/records/iterator-record.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasOwn = require_hasown(); + module5.exports = function isIteratorRecord(value2) { + return !!value2 && typeof value2 === "object" && hasOwn(value2, "[[Iterator]]") && hasOwn(value2, "[[NextMethod]]") && typeof value2["[[NextMethod]]"] === "function" && hasOwn(value2, "[[Done]]") && typeof value2["[[Done]]"] === "boolean"; + }; + } +}); + +// node_modules/es-abstract/2024/IteratorNext.js +var require_IteratorNext = __commonJS({ + "node_modules/es-abstract/2024/IteratorNext.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var Call = require_Call(); + var Type3 = require_Type2(); + var isIteratorRecord = require_iterator_record(); + module5.exports = function IteratorNext(iteratorRecord) { + if (!isIteratorRecord(iteratorRecord)) { + throw new $TypeError("Assertion failed: `iteratorRecord` must be an Iterator Record"); + } + var result2; + if (arguments.length < 2) { + result2 = Call(iteratorRecord["[[NextMethod]]"], iteratorRecord["[[Iterator]]"]); + } else { + result2 = Call(iteratorRecord["[[NextMethod]]"], iteratorRecord["[[Iterator]]"], [arguments[1]]); + } + if (Type3(result2) !== "Object") { + throw new $TypeError("iterator next must return an object"); + } + return result2; + }; + } +}); + +// node_modules/es-abstract/helpers/forEach.js +var require_forEach = __commonJS({ + "node_modules/es-abstract/helpers/forEach.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function forEach4(array, callback) { + for (var i7 = 0; i7 < array.length; i7 += 1) { + callback(array[i7], i7, array); + } + }; + } +}); + +// node_modules/side-channel/index.js +var require_side_channel = __commonJS({ + "node_modules/side-channel/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var callBound = require_callBound(); + var inspect2 = require_object_inspect(); + var $TypeError = require_type2(); + var $WeakMap = GetIntrinsic("%WeakMap%", true); + var $Map = GetIntrinsic("%Map%", true); + var $weakMapGet = callBound("WeakMap.prototype.get", true); + var $weakMapSet = callBound("WeakMap.prototype.set", true); + var $weakMapHas = callBound("WeakMap.prototype.has", true); + var $mapGet = callBound("Map.prototype.get", true); + var $mapSet = callBound("Map.prototype.set", true); + var $mapHas = callBound("Map.prototype.has", true); + var listGetNode = function(list, key) { + var prev = list; + var curr; + for (; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = /** @type {NonNullable} */ + list.next; + list.next = curr; + return curr; + } + } + }; + var listGet = function(objects, key) { + var node = listGetNode(objects, key); + return node && node.value; + }; + var listSet = function(objects, key, value2) { + var node = listGetNode(objects, key); + if (node) { + node.value = value2; + } else { + objects.next = /** @type {import('.').ListNode} */ + { + // eslint-disable-line no-param-reassign, no-extra-parens + key, + next: objects.next, + value: value2 + }; + } + }; + var listHas = function(objects, key) { + return !!listGetNode(objects, key); + }; + module5.exports = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function(key) { + if (!channel.has(key)) { + throw new $TypeError("Side channel does not contain " + inspect2(key)); + } + }, + get: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { + return listGet($o, key); + } + } + }, + has: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { + return listHas($o, key); + } + } + return false; + }, + set: function(key, value2) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value2); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value2); + } else { + if (!$o) { + $o = { key: {}, next: null }; + } + listSet($o, key, value2); + } + } + }; + return channel; + }; + } +}); + +// node_modules/internal-slot/index.js +var require_internal_slot = __commonJS({ + "node_modules/internal-slot/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasOwn = require_hasown(); + var channel = require_side_channel()(); + var $TypeError = require_type2(); + var SLOT = { + assert: function(O7, slot) { + if (!O7 || typeof O7 !== "object" && typeof O7 !== "function") { + throw new $TypeError("`O` is not an object"); + } + if (typeof slot !== "string") { + throw new $TypeError("`slot` must be a string"); + } + channel.assert(O7); + if (!SLOT.has(O7, slot)) { + throw new $TypeError("`" + slot + "` is not present on `O`"); + } + }, + get: function(O7, slot) { + if (!O7 || typeof O7 !== "object" && typeof O7 !== "function") { + throw new $TypeError("`O` is not an object"); + } + if (typeof slot !== "string") { + throw new $TypeError("`slot` must be a string"); + } + var slots = channel.get(O7); + return slots && slots["$" + slot]; + }, + has: function(O7, slot) { + if (!O7 || typeof O7 !== "object" && typeof O7 !== "function") { + throw new $TypeError("`O` is not an object"); + } + if (typeof slot !== "string") { + throw new $TypeError("`slot` must be a string"); + } + var slots = channel.get(O7); + return !!slots && hasOwn(slots, "$" + slot); + }, + set: function(O7, slot, V5) { + if (!O7 || typeof O7 !== "object" && typeof O7 !== "function") { + throw new $TypeError("`O` is not an object"); + } + if (typeof slot !== "string") { + throw new $TypeError("`slot` must be a string"); + } + var slots = channel.get(O7); + if (!slots) { + slots = {}; + channel.set(O7, slots); + } + slots["$" + slot] = V5; + } + }; + if (Object.freeze) { + Object.freeze(SLOT); + } + module5.exports = SLOT; + } +}); + +// node_modules/es-abstract/2024/OrdinaryObjectCreate.js +var require_OrdinaryObjectCreate = __commonJS({ + "node_modules/es-abstract/2024/OrdinaryObjectCreate.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $ObjectCreate = GetIntrinsic("%Object.create%", true); + var $TypeError = require_type2(); + var $SyntaxError = require_syntax(); + var IsArray = require_IsArray2(); + var Type3 = require_Type2(); + var forEach4 = require_forEach(); + var SLOT = require_internal_slot(); + var hasProto = require_has_proto()(); + module5.exports = function OrdinaryObjectCreate(proto) { + if (proto !== null && Type3(proto) !== "Object") { + throw new $TypeError("Assertion failed: `proto` must be null or an object"); + } + var additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1]; + if (!IsArray(additionalInternalSlotsList)) { + throw new $TypeError("Assertion failed: `additionalInternalSlotsList` must be an Array"); + } + var O7; + if ($ObjectCreate) { + O7 = $ObjectCreate(proto); + } else if (hasProto) { + O7 = { __proto__: proto }; + } else { + if (proto === null) { + throw new $SyntaxError("native Object.create support is required to create null objects"); + } + var T6 = function T7() { + }; + T6.prototype = proto; + O7 = new T6(); + } + if (additionalInternalSlotsList.length > 0) { + forEach4(additionalInternalSlotsList, function(slot) { + SLOT.set(O7, slot, void 0); + }); + } + return O7; + }; + } +}); + +// node_modules/es-abstract/2024/CreateAsyncFromSyncIterator.js +var require_CreateAsyncFromSyncIterator = __commonJS({ + "node_modules/es-abstract/2024/CreateAsyncFromSyncIterator.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type2(); + var $Promise = GetIntrinsic("%Promise%", true); + var AsyncFromSyncIteratorContinuation = require_AsyncFromSyncIteratorContinuation(); + var Call = require_Call(); + var CreateIterResultObject = require_CreateIterResultObject(); + var Get = require_Get(); + var GetMethod = require_GetMethod(); + var IteratorNext = require_IteratorNext(); + var OrdinaryObjectCreate = require_OrdinaryObjectCreate(); + var Type3 = require_Type2(); + var SLOT = require_internal_slot(); + var isIteratorRecord = require_iterator_record(); + var $AsyncFromSyncIteratorPrototype = GetIntrinsic("%AsyncFromSyncIteratorPrototype%", true) || { + next: function next(value2) { + if (!$Promise) { + throw new $SyntaxError("This environment does not support Promises."); + } + var O7 = this; + SLOT.assert(O7, "[[SyncIteratorRecord]]"); + var argsLength = arguments.length; + return new $Promise(function(resolve3) { + var syncIteratorRecord = SLOT.get(O7, "[[SyncIteratorRecord]]"); + var result2; + if (argsLength > 0) { + result2 = IteratorNext(syncIteratorRecord, value2); + } else { + result2 = IteratorNext(syncIteratorRecord); + } + resolve3(AsyncFromSyncIteratorContinuation(result2)); + }); + }, + "return": function() { + if (!$Promise) { + throw new $SyntaxError("This environment does not support Promises."); + } + var O7 = this; + SLOT.assert(O7, "[[SyncIteratorRecord]]"); + var valueIsPresent = arguments.length > 0; + var value2 = valueIsPresent ? arguments[0] : void 0; + return new $Promise(function(resolve3, reject2) { + var syncIterator = SLOT.get(O7, "[[SyncIteratorRecord]]")["[[Iterator]]"]; + var iteratorReturn = GetMethod(syncIterator, "return"); + if (typeof iteratorReturn === "undefined") { + var iterResult = CreateIterResultObject(value2, true); + Call(resolve3, void 0, [iterResult]); + return; + } + var result2; + if (valueIsPresent) { + result2 = Call(iteratorReturn, syncIterator, [value2]); + } else { + result2 = Call(iteratorReturn, syncIterator); + } + if (Type3(result2) !== "Object") { + Call(reject2, void 0, [new $TypeError("Iterator `return` method returned a non-object value.")]); + return; + } + resolve3(AsyncFromSyncIteratorContinuation(result2)); + }); + }, + "throw": function() { + if (!$Promise) { + throw new $SyntaxError("This environment does not support Promises."); + } + var O7 = this; + SLOT.assert(O7, "[[SyncIteratorRecord]]"); + var valueIsPresent = arguments.length > 0; + var value2 = valueIsPresent ? arguments[0] : void 0; + return new $Promise(function(resolve3, reject2) { + var syncIterator = SLOT.get(O7, "[[SyncIteratorRecord]]")["[[Iterator]]"]; + var throwMethod = GetMethod(syncIterator, "throw"); + if (typeof throwMethod === "undefined") { + Call(reject2, void 0, [value2]); + return; + } + var result2; + if (valueIsPresent) { + result2 = Call(throwMethod, syncIterator, [value2]); + } else { + result2 = Call(throwMethod, syncIterator); + } + if (Type3(result2) !== "Object") { + Call(reject2, void 0, [new $TypeError("Iterator `throw` method returned a non-object value.")]); + return; + } + resolve3(AsyncFromSyncIteratorContinuation( + result2 + /* , promiseCapability */ + )); + }); + } + }; + module5.exports = function CreateAsyncFromSyncIterator(syncIteratorRecord) { + if (!isIteratorRecord(syncIteratorRecord)) { + throw new $TypeError("Assertion failed: `syncIteratorRecord` must be an Iterator Record"); + } + var asyncIterator = OrdinaryObjectCreate($AsyncFromSyncIteratorPrototype); + SLOT.set(asyncIterator, "[[SyncIteratorRecord]]", syncIteratorRecord); + var nextMethod = Get(asyncIterator, "next"); + return { + // steps 3-4 + "[[Iterator]]": asyncIterator, + "[[NextMethod]]": nextMethod, + "[[Done]]": false + }; + }; + } +}); + +// node_modules/es-abstract/2024/GetIteratorFromMethod.js +var require_GetIteratorFromMethod = __commonJS({ + "node_modules/es-abstract/2024/GetIteratorFromMethod.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var Call = require_Call(); + var Get = require_Get(); + var IsCallable = require_IsCallable(); + var Type3 = require_Type2(); + module5.exports = function GetIteratorFromMethod(obj, method2) { + if (!IsCallable(method2)) { + throw new $TypeError("method must be a function"); + } + var iterator = Call(method2, obj); + if (Type3(iterator) !== "Object") { + throw new $TypeError("iterator must return an object"); + } + var nextMethod = Get(iterator, "next"); + return { + // steps 4-5 + "[[Iterator]]": iterator, + "[[NextMethod]]": nextMethod, + "[[Done]]": false + }; + }; + } +}); + +// node_modules/has-tostringtag/shams.js +var require_shams2 = __commonJS({ + "node_modules/has-tostringtag/shams.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasSymbols = require_shams(); + module5.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; + }; + } +}); + +// node_modules/is-string/index.js +var require_is_string = __commonJS({ + "node_modules/is-string/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var strValue = String.prototype.valueOf; + var tryStringObject = function tryStringObject2(value2) { + try { + strValue.call(value2); + return true; + } catch (e10) { + return false; + } + }; + var toStr = Object.prototype.toString; + var strClass = "[object String]"; + var hasToStringTag = require_shams2()(); + module5.exports = function isString4(value2) { + if (typeof value2 === "string") { + return true; + } + if (typeof value2 !== "object") { + return false; + } + return hasToStringTag ? tryStringObject(value2) : toStr.call(value2) === strClass; + }; + } +}); + +// node_modules/es-abstract/helpers/getIteratorMethod.js +var require_getIteratorMethod = __commonJS({ + "node_modules/es-abstract/helpers/getIteratorMethod.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hasSymbols = require_has_symbols()(); + var GetIntrinsic = require_get_intrinsic(); + var callBound = require_callBound(); + var isString4 = require_is_string(); + var $iterator = GetIntrinsic("%Symbol.iterator%", true); + var $stringSlice = callBound("String.prototype.slice"); + var $String = GetIntrinsic("%String%"); + module5.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function() { + var i7 = -1; + var arr = this; + return { + next: function() { + i7 += 1; + return { + done: i7 >= arr.length, + value: arr[i7] + }; + } + }; + }; + } else if (isString4(iterable)) { + usingIterator = function() { + var i7 = 0; + return { + next: function() { + var nextIndex = ES.AdvanceStringIndex($String(iterable), i7, true); + var value2 = $stringSlice(iterable, i7, nextIndex); + i7 = nextIndex; + return { + done: nextIndex > iterable.length, + value: value2 + }; + } + }; + }; + } + return usingIterator; + }; + } +}); + +// node_modules/es-abstract/2024/GetIterator.js +var require_GetIterator = __commonJS({ + "node_modules/es-abstract/2024/GetIterator.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var $TypeError = require_type2(); + var $asyncIterator = GetIntrinsic("%Symbol.asyncIterator%", true); + var inspect2 = require_object_inspect(); + var hasSymbols = require_has_symbols()(); + var AdvanceStringIndex = require_AdvanceStringIndex(); + var CreateAsyncFromSyncIterator = require_CreateAsyncFromSyncIterator(); + var GetIteratorFromMethod = require_GetIteratorFromMethod(); + var GetMethod = require_GetMethod(); + var IsArray = require_IsArray2(); + var getIteratorMethod = require_getIteratorMethod(); + module5.exports = function GetIterator(obj, kind) { + if (kind !== "SYNC" && kind !== "ASYNC") { + throw new $TypeError("Assertion failed: `kind` must be one of 'sync' or 'async', got " + inspect2(kind)); + } + var method2; + if (kind === "ASYNC") { + if (hasSymbols && $asyncIterator) { + method2 = GetMethod(obj, $asyncIterator); + } + } + if (typeof method2 === "undefined") { + var syncMethod = getIteratorMethod( + { + AdvanceStringIndex, + GetMethod, + IsArray + }, + obj + ); + if (kind === "ASYNC") { + if (typeof syncMethod === "undefined") { + throw new $TypeError("iterator method is `undefined`"); + } + var syncIteratorRecord = GetIteratorFromMethod(obj, syncMethod); + return CreateAsyncFromSyncIterator(syncIteratorRecord); + } + method2 = syncMethod; + } + if (typeof method2 === "undefined") { + throw new $TypeError("iterator method is `undefined`"); + } + return GetIteratorFromMethod(obj, method2); + }; + } +}); + +// node_modules/es-abstract/2024/IteratorStep.js +var require_IteratorStep = __commonJS({ + "node_modules/es-abstract/2024/IteratorStep.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var IteratorComplete = require_IteratorComplete(); + var IteratorNext = require_IteratorNext(); + var isIteratorRecord = require_iterator_record(); + module5.exports = function IteratorStep(iteratorRecord) { + if (!isIteratorRecord(iteratorRecord)) { + throw new $TypeError("Assertion failed: `iteratorRecord` must be an Iterator Record"); + } + var result2 = IteratorNext(iteratorRecord); + var done = IteratorComplete(result2); + return done === true ? false : result2; + }; + } +}); + +// node_modules/es-abstract/2024/IteratorToList.js +var require_IteratorToList = __commonJS({ + "node_modules/es-abstract/2024/IteratorToList.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var callBound = require_callBound(); + var $arrayPush = callBound("Array.prototype.push"); + var IteratorStep = require_IteratorStep(); + var IteratorValue = require_IteratorValue(); + var isIteratorRecord = require_iterator_record(); + module5.exports = function IteratorToList(iteratorRecord) { + if (!isIteratorRecord(iteratorRecord)) { + throw new $TypeError("Assertion failed: `iteratorRecord` must be an Iterator Record"); + } + var values2 = []; + var next = true; + while (next) { + next = IteratorStep(iteratorRecord); + if (next) { + var nextValue = IteratorValue(next); + $arrayPush(values2, nextValue); + } + } + return values2; + }; + } +}); + +// node_modules/es-abstract/helpers/setProto.js +var require_setProto = __commonJS({ + "node_modules/es-abstract/helpers/setProto.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var originalSetProto = GetIntrinsic("%Object.setPrototypeOf%", true); + var hasProto = require_has_proto()(); + module5.exports = originalSetProto || (hasProto ? function(O7, proto) { + O7.__proto__ = proto; + return O7; + } : null); + } +}); + +// node_modules/es-abstract/helpers/getProto.js +var require_getProto = __commonJS({ + "node_modules/es-abstract/helpers/getProto.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var GetIntrinsic = require_get_intrinsic(); + var originalGetProto = GetIntrinsic("%Object.getPrototypeOf%", true); + var hasProto = require_has_proto()(); + module5.exports = originalGetProto || (hasProto ? function(O7) { + return O7.__proto__; + } : null); + } +}); + +// node_modules/es-abstract/2024/OrdinaryGetPrototypeOf.js +var require_OrdinaryGetPrototypeOf = __commonJS({ + "node_modules/es-abstract/2024/OrdinaryGetPrototypeOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var $getProto = require_getProto(); + var Type3 = require_Type2(); + module5.exports = function OrdinaryGetPrototypeOf(O7) { + if (Type3(O7) !== "Object") { + throw new $TypeError("Assertion failed: O must be an Object"); + } + if (!$getProto) { + throw new $TypeError("This environment does not support fetching prototypes."); + } + return $getProto(O7); + }; + } +}); + +// node_modules/es-abstract/2024/OrdinarySetPrototypeOf.js +var require_OrdinarySetPrototypeOf = __commonJS({ + "node_modules/es-abstract/2024/OrdinarySetPrototypeOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var $TypeError = require_type2(); + var $setProto = require_setProto(); + var OrdinaryGetPrototypeOf = require_OrdinaryGetPrototypeOf(); + module5.exports = function OrdinarySetPrototypeOf(O7, V5) { + if (typeof V5 !== "object") { + throw new $TypeError("Assertion failed: V must be Object or Null"); + } + try { + $setProto(O7, V5); + } catch (e10) { + return false; + } + return OrdinaryGetPrototypeOf(O7) === V5; + }; + } +}); + +// node_modules/es-aggregate-error/implementation.js +var require_implementation3 = __commonJS({ + "node_modules/es-aggregate-error/implementation.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var CreateDataPropertyOrThrow = require_CreateDataPropertyOrThrow(); + var CreateMethodProperty = require_CreateMethodProperty(); + var GetIterator = require_GetIterator(); + var hasPropertyDescriptors = require_has_property_descriptors()(); + var IteratorToList = require_IteratorToList(); + var OrdinarySetPrototypeOf = require_OrdinarySetPrototypeOf(); + var $Error = require_es_errors(); + function AggregateError2(errors, message) { + var error2 = new $Error(message); + OrdinarySetPrototypeOf(error2, proto); + delete error2.constructor; + var errorsList = IteratorToList(GetIterator(errors, "SYNC")); + CreateDataPropertyOrThrow(error2, "errors", errorsList); + return error2; + } + if (hasPropertyDescriptors) { + Object.defineProperty(AggregateError2, "prototype", { writable: false }); + } + var proto = AggregateError2.prototype; + if (!CreateMethodProperty(proto, "constructor", AggregateError2) || !CreateMethodProperty(proto, "message", "") || !CreateMethodProperty(proto, "name", "AggregateError")) { + throw new $Error("unable to install AggregateError.prototype properties; please report this!"); + } + OrdinarySetPrototypeOf(AggregateError2.prototype, Error.prototype); + module5.exports = AggregateError2; + } +}); + +// node_modules/es-aggregate-error/polyfill.js +var require_polyfill = __commonJS({ + "node_modules/es-aggregate-error/polyfill.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var implementation = require_implementation3(); + module5.exports = function getPolyfill() { + return typeof AggregateError === "function" ? AggregateError : implementation; + }; + } +}); + +// node_modules/globalthis/implementation.browser.js +var require_implementation_browser = __commonJS({ + "node_modules/globalthis/implementation.browser.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + if (typeof self !== "undefined") { + module5.exports = self; + } else if (typeof window !== "undefined") { + module5.exports = window; + } else { + module5.exports = Function("return this")(); + } + } +}); + +// node_modules/globalthis/polyfill.js +var require_polyfill2 = __commonJS({ + "node_modules/globalthis/polyfill.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var implementation = require_implementation_browser(); + module5.exports = function getPolyfill() { + if (typeof globalThis !== "object" || !globalThis || globalThis.Math !== Math || globalThis.Array !== Array) { + return implementation; + } + return globalThis; + }; + } +}); + +// node_modules/globalthis/shim.js +var require_shim = __commonJS({ + "node_modules/globalthis/shim.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var define2 = require_define_properties(); + var gOPD = require_gopd(); + var getPolyfill = require_polyfill2(); + module5.exports = function shimGlobal() { + var polyfill = getPolyfill(); + if (define2.supportsDescriptors) { + var descriptor = gOPD(polyfill, "globalThis"); + if (!descriptor || descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill)) { + Object.defineProperty(polyfill, "globalThis", { + configurable: true, + enumerable: false, + value: polyfill, + writable: true + }); + } + } else if (typeof globalThis !== "object" || globalThis !== polyfill) { + polyfill.globalThis = polyfill; + } + return polyfill; + }; + } +}); + +// node_modules/globalthis/index.js +var require_globalthis = __commonJS({ + "node_modules/globalthis/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var defineProperties = require_define_properties(); + var implementation = require_implementation_browser(); + var getPolyfill = require_polyfill2(); + var shim = require_shim(); + var polyfill = getPolyfill(); + var getGlobal = function() { + return polyfill; + }; + defineProperties(getGlobal, { + getPolyfill, + implementation, + shim + }); + module5.exports = getGlobal; + } +}); + +// node_modules/es-aggregate-error/shim.js +var require_shim2 = __commonJS({ + "node_modules/es-aggregate-error/shim.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var define2 = require_define_properties(); + var globalThis2 = require_globalthis()(); + var getPolyfill = require_polyfill(); + module5.exports = function shimAggregateError() { + var polyfill = getPolyfill(); + define2( + globalThis2, + { AggregateError: polyfill }, + { + AggregateError: function testAggregateError() { + return globalThis2.AggregateError !== polyfill; + } + } + ); + return polyfill; + }; + } +}); + +// node_modules/es-aggregate-error/index.js +var require_es_aggregate_error = __commonJS({ + "node_modules/es-aggregate-error/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var bind2 = require_function_bind(); + var define2 = require_define_properties(); + var setFunctionName = require_set_function_name(); + var defineDataProperty = require_define_data_property(); + var implementation = require_implementation3(); + var getPolyfill = require_polyfill(); + var shim = require_shim2(); + var polyfill = getPolyfill(); + var bound = setFunctionName(bind2.call(polyfill), polyfill.name, true); + defineDataProperty(bound, "prototype", polyfill.prototype, true, true, true, true); + define2(bound, { + getPolyfill, + implementation, + shim + }); + module5.exports = bound; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/common/error.js +var require_error = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/common/error.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.toParsedPath = exports28.wrapError = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var es_aggregate_error_1 = (0, tslib_1.__importDefault)(require_es_aggregate_error()); + var errors_1 = require_errors2(); + var isAggregateError_1 = require_isAggregateError(); + function toRulesetValidationError(ex) { + if (ex instanceof errors_1.RulesetValidationError) { + ex.path.unshift(...this); + return ex; + } + return new errors_1.RulesetValidationError("generic-validation-error", (0, lodash_1.isError)(ex) ? ex.message : String(ex), [...this]); + } + function wrapError(ex, path2) { + const parsedPath = toParsedPath(path2); + if ((0, isAggregateError_1.isAggregateError)(ex)) { + return new es_aggregate_error_1.default(ex.errors.map(toRulesetValidationError, parsedPath)); + } + return toRulesetValidationError.call(parsedPath, ex); + } + exports28.wrapError = wrapError; + function toParsedPath(path2) { + return path2.slice(1).split("/"); + } + exports28.toParsedPath = toParsedPath; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/alias.js +var require_alias2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/alias.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateAlias = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var alias_1 = require_alias(); + var formats_1 = require_formats(); + var error_1 = require_error(); + var errors_1 = require_errors2(); + function getOverrides(overrides, key) { + if (!Array.isArray(overrides)) + return null; + const index4 = Number(key); + if (Number.isNaN(index4)) + return null; + if (index4 < 0 && index4 >= overrides.length) + return null; + const actualOverrides = overrides[index4]; + return (0, json_1.isPlainObject)(actualOverrides) && (0, json_1.isPlainObject)(actualOverrides.aliases) ? actualOverrides.aliases : null; + } + function validateAlias(ruleset, alias, path2) { + const parsedPath = (0, error_1.toParsedPath)(path2); + try { + const formats = (0, lodash_1.get)(ruleset, [...parsedPath.slice(0, parsedPath.indexOf("rules") + 2), "formats"]); + const aliases = parsedPath[0] === "overrides" ? { + ...ruleset.aliases, + ...getOverrides(ruleset.overrides, parsedPath[1]) + } : ruleset.aliases; + (0, alias_1.resolveAlias)(aliases !== null && aliases !== void 0 ? aliases : null, alias, Array.isArray(formats) ? new formats_1.Formats(formats) : null); + } catch (ex) { + if (ex instanceof ReferenceError) { + return new errors_1.RulesetValidationError("undefined-alias", ex.message, parsedPath); + } + return (0, error_1.wrapError)(ex, path2); + } + } + exports28.validateAlias = validateAlias; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/function.js +var require_function = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/function.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.validateFunction = void 0; + var error_1 = require_error(); + var errors_1 = require_errors2(); + function assertRulesetFunction(maybeRulesetFunction) { + if (typeof maybeRulesetFunction !== "function") { + throw ReferenceError("Function is not defined"); + } + } + function validateFunction(fn, opts, path2) { + try { + assertRulesetFunction(fn); + if (!("validator" in fn)) + return; + const validator = fn.validator.bind(fn); + validator(opts); + } catch (ex) { + if (ex instanceof ReferenceError) { + return new errors_1.RulesetValidationError("undefined-function", ex.message, [...(0, error_1.toParsedPath)(path2), "function"]); + } + return (0, error_1.wrapError)(ex, path2); + } + } + exports28.validateFunction = validateFunction; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js +var require_ajv2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createValidator = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var ajv_1 = (0, tslib_1.__importStar)(require_ajv()); + var names_1 = (0, tslib_1.__importDefault)(require_names()); + var ajv_formats_1 = (0, tslib_1.__importDefault)(require_dist9()); + var ajv_errors_1 = (0, tslib_1.__importDefault)(require_dist10()); + var ruleSchema = (0, tslib_1.__importStar)(require_rule_schema()); + var shared = (0, tslib_1.__importStar)(require_shared()); + var rulesetSchema = (0, tslib_1.__importStar)(require_ruleset_schema()); + var jsExtensions = (0, tslib_1.__importStar)(require_js_extensions()); + var jsonExtensions = (0, tslib_1.__importStar)(require_json_extensions()); + var alias_1 = require_alias2(); + var function_1 = require_function(); + var validators = { + js: null, + json: null + }; + function createValidator(format5) { + const existingValidator = validators[format5]; + if (existingValidator !== null) { + return existingValidator; + } + const ajv2 = new ajv_1.default({ + allErrors: true, + strict: true, + strictRequired: false, + keywords: ["$anchor"], + schemas: [ruleSchema, shared], + passContext: true + }); + (0, ajv_formats_1.default)(ajv2); + (0, ajv_errors_1.default)(ajv2); + ajv2.addKeyword({ + keyword: "x-spectral-runtime", + schemaType: "string", + error: { + message(cxt) { + var _a2; + return (0, ajv_1._)`${((_a2 = cxt.params) === null || _a2 === void 0 ? void 0 : _a2.message) !== void 0 ? cxt.params.message : ""}`; + }, + params(cxt) { + var _a2; + return (0, ajv_1._)`{ errors: ${((_a2 = cxt.params) === null || _a2 === void 0 ? void 0 : _a2.errors) !== void 0 && cxt.params.errors} || [] }`; + } + }, + code(cxt) { + const { data } = cxt; + switch (cxt.schema) { + case "format": + cxt.fail((0, ajv_1._)`typeof ${data} !== "function"`); + break; + case "ruleset-function": { + const fn = cxt.gen.const("spectralFunction", (0, ajv_1._)`this.validateFunction(${data}.function, ${data}.functionOptions === void 0 ? null : ${data}.functionOptions, ${names_1.default.instancePath})`); + cxt.gen.if((0, ajv_1._)`${fn} !== void 0`); + cxt.error(false, { errors: fn }); + cxt.gen.endIf(); + break; + } + case "alias": { + const alias = cxt.gen.const("spectralAlias", (0, ajv_1._)`this.validateAlias(${names_1.default.rootData}, ${data}, ${names_1.default.instancePath})`); + cxt.gen.if((0, ajv_1._)`${alias} !== void 0`); + cxt.error(false, { errors: alias }); + cxt.gen.endIf(); + break; + } + } + } + }); + if (format5 === "js") { + ajv2.addSchema(jsExtensions); + } else { + ajv2.addSchema(jsonExtensions); + } + const validator = new Proxy(ajv2.compile(rulesetSchema), { + apply(target, thisArg, args) { + return Reflect.apply(target, { validateAlias: alias_1.validateAlias, validateFunction: function_1.validateFunction }, args); + } + }); + validators[format5] = validator; + return validator; + } + exports28.createValidator = createValidator; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js +var require_assertions = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.assertValidRule = exports28.assertValidRuleset = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var ajv_1 = require_ajv2(); + var errors_1 = require_errors2(); + var es_aggregate_error_1 = (0, tslib_1.__importDefault)(require_es_aggregate_error()); + function assertValidRuleset(ruleset, format5 = "js") { + var _a2; + if (!(0, json_1.isPlainObject)(ruleset)) { + throw new errors_1.RulesetValidationError("invalid-ruleset-definition", "Provided ruleset is not an object", []); + } + if (!("rules" in ruleset) && !("extends" in ruleset) && !("overrides" in ruleset)) { + throw new errors_1.RulesetValidationError("invalid-ruleset-definition", "Ruleset must have rules or extends or overrides defined", []); + } + const validate15 = (0, ajv_1.createValidator)(format5); + if (!validate15(ruleset)) { + throw new es_aggregate_error_1.default((0, errors_1.convertAjvErrors)((_a2 = validate15.errors) !== null && _a2 !== void 0 ? _a2 : [])); + } + } + exports28.assertValidRuleset = assertValidRuleset; + function isRuleDefinition(rule) { + return typeof rule === "object" && rule !== null && !Array.isArray(rule) && ("given" in rule || "then" in rule); + } + function assertValidRule(rule, name2) { + if (!isRuleDefinition(rule)) { + throw new errors_1.RulesetValidationError("invalid-rule-definition", "Rule definition expected", ["rules", name2]); + } + } + exports28.assertValidRule = assertValidRule; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js +var require_validation4 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.assertValidRuleset = exports28.RulesetValidationError = void 0; + var errors_1 = require_errors2(); + Object.defineProperty(exports28, "RulesetValidationError", { enumerable: true, get: function() { + return errors_1.RulesetValidationError; + } }); + var assertions_1 = require_assertions(); + Object.defineProperty(exports28, "assertValidRuleset", { enumerable: true, get: function() { + return assertions_1.assertValidRuleset; + } }); + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rules.js +var require_rules2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rules.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.mergeRule = void 0; + var assertions_1 = require_assertions(); + var rule_1 = require_rule(); + function assertExistingRule(maybeRule, name2) { + if (maybeRule === void 0) { + throw new ReferenceError(`Cannot extend non-existing rule: "${name2}"`); + } + } + function mergeRule(existingRule, name2, rule, ruleset) { + switch (typeof rule) { + case "boolean": + assertExistingRule(existingRule, name2); + existingRule.enabled = rule; + break; + case "string": + case "number": + assertExistingRule(existingRule, name2); + existingRule.severity = rule; + if (rule === "off") { + existingRule.enabled = false; + } else if (!existingRule.enabled) { + existingRule.enabled = true; + } + break; + case "object": + if (existingRule !== void 0) { + Object.assign(existingRule, rule, { + enabled: true, + owner: existingRule.owner + }); + } else { + (0, assertions_1.assertValidRule)(rule, name2); + return new rule_1.Rule(name2, rule, ruleset); + } + break; + default: + throw new Error("Invalid value"); + } + return existingRule; + } + exports28.mergeRule = mergeRule; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rulesets.js +var require_rulesets = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rulesets.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.mergeRulesets = void 0; + function getExtension(extension) { + return Array.isArray(extension) ? extension[0] : extension; + } + function getExtensions(extensions6) { + return (Array.isArray(extensions6) ? extensions6 : [extensions6]).map(getExtension); + } + function mergeRulesets(left, right, isOverride) { + const ruleset = { + ...left, + ...right + }; + if ("extends" in ruleset && "extends" in ruleset) { + const rightExtensions = getExtensions(ruleset.extends); + ruleset.extends = [ + ...(Array.isArray(ruleset.extends) ? ruleset.extends : [ruleset.extends]).filter((ext) => !rightExtensions.includes(getExtension(ext))), + ...Array.isArray(ruleset.extends) ? ruleset.extends : [ruleset.extends] + ]; + } + if ("aliases" in left && "aliases" in right) { + ruleset.aliases = { + ...left.aliases, + ...right.aliases + }; + } + if (!("rules" in left) || !("rules" in right)) + return ruleset; + if (isOverride) { + ruleset.rules = { + ...left.rules, + ...right.rules + }; + } else { + const r8 = ruleset; + if (!("extends" in r8)) { + r8.extends = left; + } else if (Array.isArray(r8.extends)) { + r8.extends = [...r8.extends, left]; + } else { + r8.extends = [r8.extends, left]; + } + } + return ruleset; + } + exports28.mergeRulesets = mergeRulesets; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js +var require_ruleset = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _Ruleset_instances; + var _Ruleset_context; + var _Ruleset_getRules; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Ruleset = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var path_1 = (init_index_es(), __toCommonJS(index_es_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var minimatch_1 = require_minimatch2(); + var rule_1 = require_rule(); + var index_1 = require_validation4(); + var rules_1 = require_rules2(); + var __1 = require_dist11(); + var rulesets_1 = require_rulesets(); + var formats_1 = require_formats(); + var guards_1 = require_guards2(); + var STACK_SYMBOL = Symbol("@stoplight/spectral/ruleset/#stack"); + var EXPLICIT_SEVERITY = Symbol("@stoplight/spectral/ruleset/#explicit-severity"); + var DEFAULT_RULESET_FILE = /^\.?spectral\.(ya?ml|json|m?js)$/; + var SEED = 1; + var Ruleset = class _Ruleset { + constructor(maybeDefinition, context2) { + var _a2; + this.maybeDefinition = maybeDefinition; + _Ruleset_instances.add(this); + this.id = SEED++; + this.formats = new formats_1.Formats(); + _Ruleset_context.set(this, void 0); + let definition; + if ((0, json_1.isPlainObject)(maybeDefinition) && "extends" in maybeDefinition) { + const { extends: _6, ...def } = maybeDefinition; + (0, index_1.assertValidRuleset)({ extends: [], ...def }, "js"); + definition = maybeDefinition; + } else { + (0, index_1.assertValidRuleset)(maybeDefinition, "js"); + definition = maybeDefinition; + } + this.definition = definition; + (0, tslib_1.__classPrivateFieldSet)(this, _Ruleset_context, { + severity: "recommended", + ...context2 + }, "f"); + let hasComplexAliases = false; + this.aliases = definition.aliases === void 0 ? null : Object.fromEntries(Object.entries(definition.aliases).map((alias) => { + const [name2, value2] = alias; + if ((0, guards_1.isSimpleAliasDefinition)(value2)) { + return alias; + } + hasComplexAliases = true; + const targets = value2.targets.map((target) => ({ + formats: new formats_1.Formats(target.formats), + given: target.given + })); + return [name2, { ...value2, targets }]; + })); + this.hasComplexAliases = hasComplexAliases; + const stack = (_a2 = context2 === null || context2 === void 0 ? void 0 : context2[STACK_SYMBOL]) !== null && _a2 !== void 0 ? _a2 : /* @__PURE__ */ new Map(); + stack.set(this.definition, this); + this.extends = "extends" in definition ? (Array.isArray(definition.extends) ? definition.extends : [definition.extends]).reduce((extensions6, extension) => { + let actualExtension; + let severity = "recommended"; + const explicitSeverity = Array.isArray(extension); + if (explicitSeverity) { + [actualExtension, severity] = extension; + } else { + actualExtension = extension; + } + const existingInstance = stack.get(actualExtension); + if (existingInstance !== void 0) { + return extensions6; + } + extensions6.push(new _Ruleset(actualExtension, { + severity, + [STACK_SYMBOL]: stack, + [EXPLICIT_SEVERITY]: explicitSeverity + })); + return extensions6; + }, []) : null; + if (stack.size === 1 && definition.overrides) { + this.overrides = definition.overrides; + } else { + this.overrides = null; + } + stack.delete(this.definition); + if (Array.isArray(this.definition.formats)) { + for (const format5 of this.definition.formats) { + this.formats.add(format5); + } + } + if (Array.isArray(this.extends)) { + for (const { formats } of this.extends) { + for (const format5 of formats) { + this.formats.add(format5); + } + } + } + this.rules = (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_instances, "m", _Ruleset_getRules).call(this); + } + get source() { + var _a2; + return (_a2 = (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_context, "f").source) !== null && _a2 !== void 0 ? _a2 : null; + } + fromSource(source) { + if (this.overrides === null) { + return this; + } + const { source: rulesetSource } = this; + if (source === null) { + throw new Error("Document must have some source assigned. If you use Spectral programmatically make sure to pass the source to Document"); + } + if (rulesetSource === null) { + throw new Error("Ruleset must have some source assigned. If you use Spectral programmatically make sure to pass the source to Ruleset"); + } + const relativeSource = (0, path_1.relative)((0, path_1.dirname)(rulesetSource), source); + const pointerOverrides = {}; + const overrides = this.overrides.flatMap(({ files, ...ruleset2 }) => { + var _a2, _b; + const filteredFiles = []; + for (const pattern5 of files) { + const actualPattern = (_a2 = (0, json_1.extractSourceFromRef)(pattern5)) !== null && _a2 !== void 0 ? _a2 : pattern5; + if (!(0, minimatch_1.minimatch)(relativeSource, actualPattern)) + continue; + const pointer = (0, json_1.extractPointerFromRef)(pattern5); + if (actualPattern === pattern5) { + filteredFiles.push(pattern5); + } else if (!("rules" in ruleset2) || pointer === null) { + throw new Error("Unknown error. The ruleset is presumably invalid."); + } else { + for (const [ruleName, rule] of Object.entries(ruleset2.rules)) { + if (typeof rule === "object" || typeof rule === "boolean") { + throw new Error("Unknown error. The ruleset is presumably invalid."); + } + const { definition: rulePointerOverrides } = (_b = pointerOverrides[ruleName]) !== null && _b !== void 0 ? _b : pointerOverrides[ruleName] = { + rulesetSource, + definition: /* @__PURE__ */ new Map() + }; + const severity = (0, __1.getDiagnosticSeverity)(rule); + let sourceRulePointerOverrides = rulePointerOverrides.get(actualPattern); + if (sourceRulePointerOverrides === void 0) { + sourceRulePointerOverrides = /* @__PURE__ */ new Map(); + rulePointerOverrides.set(actualPattern, sourceRulePointerOverrides); + } + sourceRulePointerOverrides.set(pointer, severity); + } + } + } + return filteredFiles.length === 0 ? [] : ruleset2; + }); + const { overrides: _6, ...definition } = this.definition; + if (overrides.length === 0 && Object.keys(pointerOverrides).length === 0) { + return this; + } + const mergedOverrides = overrides.length === 0 ? null : overrides.length > 1 ? overrides.slice(1).reduce((left, right) => (0, rulesets_1.mergeRulesets)(left, right, true), overrides[0]) : overrides[0]; + const ruleset = new _Ruleset(mergedOverrides === null ? definition : (0, rulesets_1.mergeRulesets)(definition, mergedOverrides, false), { + severity: "recommended", + source: rulesetSource + }); + for (const [ruleName, rulePointerOverrides] of Object.entries(pointerOverrides)) { + if (ruleName in ruleset.rules) { + ruleset.rules[ruleName].overrides = rulePointerOverrides; + } + } + return ruleset; + } + get parserOptions() { + return { ...__1.DEFAULT_PARSER_OPTIONS, ...this.definition.parserOptions }; + } + static isDefaultRulesetFile(uri) { + return DEFAULT_RULESET_FILE.test(uri); + } + toJSON() { + return { + id: this.id, + extends: this.extends, + source: this.source, + aliases: this.aliases, + formats: this.formats.size === 0 ? null : this.formats, + rules: this.rules, + overrides: this.overrides, + parserOptions: this.parserOptions + }; + } + }; + exports28.Ruleset = Ruleset; + _Ruleset_context = /* @__PURE__ */ new WeakMap(), _Ruleset_instances = /* @__PURE__ */ new WeakSet(), _Ruleset_getRules = function _Ruleset_getRules2() { + const rules = {}; + if (this.extends !== null && this.extends.length > 0) { + for (const extendedRuleset of this.extends) { + if (extendedRuleset === this) + continue; + for (const rule of Object.values(extendedRuleset.rules)) { + rules[rule.name] = rule; + if ((0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_context, "f")[STACK_SYMBOL] !== void 0 && (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_context, "f")[EXPLICIT_SEVERITY] === true) { + rule.enabled = rule_1.Rule.isEnabled(rule, (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_context, "f").severity); + } + } + } + } + if ("rules" in this.definition) { + for (const [name2, definition] of Object.entries(this.definition.rules)) { + const rule = (0, rules_1.mergeRule)(rules[name2], name2, definition, this); + rules[name2] = rule; + if (rule.owner === this) { + rule.enabled = rule_1.Rule.isEnabled(rule, (0, tslib_1.__classPrivateFieldGet)(this, _Ruleset_context, "f").severity); + } + if (rule.formats !== null) { + for (const format5 of rule.formats) { + this.formats.add(format5); + } + } else if (rule.owner !== this) { + rule.formats = rule.owner.definition.formats === void 0 ? null : new formats_1.Formats(rule.owner.definition.formats); + } else if (this.definition.formats !== void 0) { + rule.formats = new formats_1.Formats(this.definition.formats); + } + if (this.definition.documentationUrl !== void 0 && rule.documentationUrl === null) { + rule.documentationUrl = `${this.definition.documentationUrl}#${name2}`; + } + } + } + return rules; + }; + } +}); + +// node_modules/@stoplight/spectral-core/dist/utils/generateDocumentWideResult.js +var require_generateDocumentWideResult = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/utils/generateDocumentWideResult.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.generateDocumentWideResult = void 0; + var document_1 = require_document(); + var generateDocumentWideResult = (document2, message, severity, code) => { + var _a2; + return { + range: (_a2 = document2.getRangeForJsonPath([], true)) !== null && _a2 !== void 0 ? _a2 : document_1.Document.DEFAULT_RANGE, + message, + code, + severity, + ...document2.source !== null ? { source: document2.source } : null, + path: [] + }; + }; + exports28.generateDocumentWideResult = generateDocumentWideResult; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/function.js +var require_function2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/function.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createRulesetFunction = exports28.RulesetFunctionValidationError = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var ajv_1 = (0, tslib_1.__importDefault)(require_ajv()); + var ajv_formats_1 = (0, tslib_1.__importDefault)(require_dist9()); + var ajv_errors_1 = (0, tslib_1.__importDefault)(require_dist10()); + var spectral_runtime_1 = require_dist6(); + var index_1 = require_validation4(); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var AggregateError2 = require_es_aggregate_error(); + var ajv2 = new ajv_1.default({ allErrors: true, allowUnionTypes: true, strict: true, keywords: ["x-internal"] }); + (0, ajv_errors_1.default)(ajv2); + (0, ajv_formats_1.default)(ajv2); + var RulesetFunctionValidationError = class _RulesetFunctionValidationError extends index_1.RulesetValidationError { + constructor(fn, error2) { + super("invalid-function-options", _RulesetFunctionValidationError.printMessage(fn, error2), _RulesetFunctionValidationError.getPath(error2)); + } + static getPath(error2) { + const path2 = [ + "functionOptions", + ...error2.instancePath === "" ? [] : error2.instancePath.slice(1).split("/") + ]; + switch (error2.keyword) { + case "additionalProperties": { + const additionalProperty = error2.params.additionalProperty; + path2.push(additionalProperty); + break; + } + } + return path2; + } + static printMessage(fn, error2) { + var _a2; + switch (error2.keyword) { + case "type": { + const path2 = (0, spectral_runtime_1.printPath)(error2.instancePath.slice(1).split("/"), spectral_runtime_1.PrintStyle.Dot); + const values2 = Array.isArray(error2.params.type) ? error2.params.type.join(", ") : String(error2.params.type); + return `"${fn}" function and its "${path2}" option accepts only the following types: ${values2}`; + } + case "required": { + const missingProperty = error2.params.missingProperty; + const missingPropertyPath = error2.instancePath === "" ? missingProperty : (0, spectral_runtime_1.printPath)([...error2.instancePath.slice(1).split("/"), missingProperty], spectral_runtime_1.PrintStyle.Dot); + return `"${fn}" function is missing "${missingPropertyPath}" option`; + } + case "additionalProperties": { + const additionalProperty = error2.params.additionalProperty; + const additionalPropertyPath = error2.instancePath === "" ? additionalProperty : (0, spectral_runtime_1.printPath)([...error2.instancePath.slice(1).split("/"), additionalProperty], spectral_runtime_1.PrintStyle.Dot); + return `"${fn}" function does not support "${additionalPropertyPath}" option`; + } + case "enum": { + const path2 = (0, spectral_runtime_1.printPath)(error2.instancePath.slice(1).split("/"), spectral_runtime_1.PrintStyle.Dot); + const values2 = error2.params.allowedValues.map(spectral_runtime_1.printValue).join(", "); + return `"${fn}" function and its "${path2}" option accepts only the following values: ${values2}`; + } + default: + return (_a2 = error2.message) !== null && _a2 !== void 0 ? _a2 : "unknown error"; + } + } + }; + exports28.RulesetFunctionValidationError = RulesetFunctionValidationError; + var DEFAULT_OPTIONS_VALIDATOR = (o7) => o7 === null; + function createRulesetFunction53({ input, errorOnInvalidInput = false, options }, fn) { + const validateOptions = options === null ? DEFAULT_OPTIONS_VALIDATOR : ajv2.compile(options); + const validateInput = input !== null ? ajv2.compile(input) : input; + const wrappedFn = function(input2, options2, ...args) { + var _a2, _b, _c; + if ((validateInput === null || validateInput === void 0 ? void 0 : validateInput(input2)) === false) { + if (errorOnInvalidInput) { + return [ + { + message: (_c = (_b = (_a2 = validateInput.errors) === null || _a2 === void 0 ? void 0 : _a2.find((error2) => error2.keyword === "errorMessage")) === null || _b === void 0 ? void 0 : _b.message) !== null && _c !== void 0 ? _c : "invalid input" + } + ]; + } + return; + } + wrappedFn.validator(options2); + return fn(input2, options2, ...args); + }; + Reflect.defineProperty(wrappedFn, "name", { value: fn.name }); + const validOpts = /* @__PURE__ */ new WeakSet(); + wrappedFn.validator = function(o7) { + if ((0, lodash_1.isObject)(o7) && validOpts.has(o7)) + return; + if (validateOptions(o7)) { + if ((0, lodash_1.isObject)(o7)) + validOpts.add(o7); + return; + } + if (options === null) { + throw new index_1.RulesetValidationError("invalid-function-options", `"${fn.name || ""}" function does not accept any options`, ["functionOptions"]); + } else if ("errors" in validateOptions && Array.isArray(validateOptions.errors) && validateOptions.errors.length > 0) { + throw new AggregateError2(validateOptions.errors.map((error2) => new RulesetFunctionValidationError(fn.name || "", error2))); + } else { + throw new index_1.RulesetValidationError("invalid-function-options", `"functionOptions" of "${fn.name || ""}" function must be valid`, ["functionOptions"]); + } + }; + Reflect.defineProperty(wrappedFn, "schemas", { + enumerable: false, + value: { + input, + options + } + }); + return wrappedFn; + } + exports28.createRulesetFunction = createRulesetFunction53; + } +}); + +// node_modules/@stoplight/spectral-core/dist/ruleset/index.js +var require_ruleset2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/ruleset/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Rule = exports28.Formats = exports28.Ruleset = exports28.createRulesetFunction = exports28.getDiagnosticSeverity = exports28.RulesetValidationError = exports28.assertValidRuleset = void 0; + var index_1 = require_validation4(); + Object.defineProperty(exports28, "assertValidRuleset", { enumerable: true, get: function() { + return index_1.assertValidRuleset; + } }); + Object.defineProperty(exports28, "RulesetValidationError", { enumerable: true, get: function() { + return index_1.RulesetValidationError; + } }); + var severity_1 = require_severity(); + Object.defineProperty(exports28, "getDiagnosticSeverity", { enumerable: true, get: function() { + return severity_1.getDiagnosticSeverity; + } }); + var function_1 = require_function2(); + Object.defineProperty(exports28, "createRulesetFunction", { enumerable: true, get: function() { + return function_1.createRulesetFunction; + } }); + var ruleset_1 = require_ruleset(); + Object.defineProperty(exports28, "Ruleset", { enumerable: true, get: function() { + return ruleset_1.Ruleset; + } }); + var formats_1 = require_formats(); + Object.defineProperty(exports28, "Formats", { enumerable: true, get: function() { + return formats_1.Formats; + } }); + var rule_1 = require_rule(); + Object.defineProperty(exports28, "Rule", { enumerable: true, get: function() { + return rule_1.Rule; + } }); + } +}); + +// node_modules/@stoplight/spectral-core/dist/types/spectral.js +var require_spectral = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/types/spectral.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + } +}); + +// node_modules/@stoplight/spectral-core/dist/types/function.js +var require_function3 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/types/function.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + } +}); + +// node_modules/@stoplight/spectral-core/dist/types/index.js +var require_types5 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/types/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + (0, tslib_1.__exportStar)(require_spectral(), exports28); + (0, tslib_1.__exportStar)(require_function3(), exports28); + } +}); + +// node_modules/@stoplight/spectral-core/dist/spectral.js +var require_spectral2 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/spectral.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Spectral = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var types_1 = require_dist2(); + var Parsers = (0, tslib_1.__importStar)(require_dist4()); + var spectral_ref_resolver_1 = require_dist7(); + var document_1 = require_document(); + var documentInventory_1 = require_documentInventory(); + var runner_1 = require_runner3(); + var ruleset_1 = require_ruleset(); + var generateDocumentWideResult_1 = require_generateDocumentWideResult(); + var ruleset_2 = require_ruleset2(); + (0, tslib_1.__exportStar)(require_types5(), exports28); + var Spectral4 = class { + constructor(opts) { + this.opts = opts; + if ((opts === null || opts === void 0 ? void 0 : opts.resolver) !== void 0) { + this._resolver = opts.resolver; + } else { + this._resolver = (0, spectral_ref_resolver_1.createHttpAndFileResolver)(); + } + } + parseDocument(target) { + return target instanceof document_1.Document ? target : (0, document_1.isParsedResult)(target) ? new document_1.ParsedDocument(target) : new document_1.Document(typeof target === "string" ? target : (0, json_1.stringify)(target, void 0, 2), Parsers.Yaml); + } + async runWithResolved(target, opts = {}) { + if (this.ruleset === void 0) { + throw new Error("No ruleset has been defined. Have you called setRuleset()?"); + } + const document2 = this.parseDocument(target); + const ruleset = this.ruleset.fromSource(document2.source); + const inventory = new documentInventory_1.DocumentInventory(document2, this._resolver); + await inventory.resolve(); + const runner = new runner_1.Runner(inventory); + runner.results.push(...this._filterParserErrors(document2.diagnostics, ruleset.parserOptions)); + if (document2.formats === void 0) { + const foundFormats = [...ruleset.formats].filter((format5) => format5(inventory.resolved, document2.source)); + if (foundFormats.length === 0 && opts.ignoreUnknownFormat !== true) { + document2.formats = null; + if (ruleset.formats.size > 0) { + runner.addResult(this._generateUnrecognizedFormatError(document2, Array.from(ruleset.formats))); + } + } else { + document2.formats = new Set(foundFormats); + } + } + await runner.run(ruleset); + const results = runner.getResults(); + return { + resolved: inventory.resolved, + results + }; + } + async run(target, opts = {}) { + return (await this.runWithResolved(target, opts)).results; + } + setRuleset(ruleset) { + this.ruleset = ruleset instanceof ruleset_1.Ruleset ? ruleset : new ruleset_1.Ruleset(ruleset); + } + _generateUnrecognizedFormatError(document2, formats) { + return (0, generateDocumentWideResult_1.generateDocumentWideResult)(document2, `The provided document does not match any of the registered formats [${formats.map((fn) => { + var _a2; + return (_a2 = fn.displayName) !== null && _a2 !== void 0 ? _a2 : fn.name; + }).join(", ")}]`, types_1.DiagnosticSeverity.Warning, "unrecognized-format"); + } + _filterParserErrors(diagnostics, parserOptions) { + return diagnostics.reduce((diagnostics2, diagnostic) => { + if (diagnostic.code !== "parser") + return diagnostics2; + let severity; + if (diagnostic.message.startsWith("Mapping key must be a string scalar rather than")) { + severity = (0, ruleset_2.getDiagnosticSeverity)(parserOptions.incompatibleValues); + } else if (diagnostic.message.startsWith("Duplicate key")) { + severity = (0, ruleset_2.getDiagnosticSeverity)(parserOptions.duplicateKeys); + } else { + diagnostics2.push(diagnostic); + return diagnostics2; + } + if (severity !== -1) { + diagnostics2.push(diagnostic); + diagnostic.severity = severity; + } + return diagnostics2; + }, []); + } + }; + exports28.Spectral = Spectral4; + } +}); + +// node_modules/@stoplight/spectral-core/dist/index.js +var require_dist11 = __commonJS({ + "node_modules/@stoplight/spectral-core/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ParsedDocument = exports28.Document = void 0; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + (0, tslib_1.__exportStar)(require_consts(), exports28); + (0, tslib_1.__exportStar)(require_spectral2(), exports28); + var document_1 = require_document(); + Object.defineProperty(exports28, "Document", { enumerable: true, get: function() { + return document_1.Document; + } }); + Object.defineProperty(exports28, "ParsedDocument", { enumerable: true, get: function() { + return document_1.ParsedDocument; + } }); + (0, tslib_1.__exportStar)(require_ruleset2(), exports28); + } +}); + +// node_modules/@asyncapi/parser/esm/utils.js +function createDetailedAsyncAPI(parsed, input, source) { + return { + source, + input, + parsed, + semver: getSemver(parsed.asyncapi) + }; +} +function getSemver(version5) { + const [major, minor, patchWithRc] = version5.split("."); + const [patch, rc] = patchWithRc.split("-rc"); + return { + version: version5, + major: Number(major), + minor: Number(minor), + patch: Number(patch), + rc: rc && Number(rc) + }; +} +function normalizeInput(asyncapi) { + if (typeof asyncapi === "string") { + return asyncapi; + } + return JSON.stringify(asyncapi, void 0, 2); +} +function hasErrorDiagnostic(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Error); +} +function hasWarningDiagnostic(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Warning); +} +function hasInfoDiagnostic(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Information); +} +function hasHintDiagnostic(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Hint); +} +function setExtension(id, value2, model) { + const modelValue = model.json(); + setExtensionOnJson(id, value2, modelValue); +} +function setExtensionOnJson(id, value2, model) { + if (typeof model === "object" && model) { + id = id.startsWith("x-") ? id : `x-${id}`; + model[String(id)] = value2; + } +} +function mergePatch(origin, patch) { + if (!isObject3(patch)) { + return patch; + } + const result2 = !isObject3(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = mergePatch(result2[key], patchVal); + } + }); + return result2; +} +function isObject3(value2) { + return Boolean(value2) && typeof value2 === "object" && Array.isArray(value2) === false; +} +function toJSONPathArray(jsonPath) { + return splitPath(serializePath(jsonPath)); +} +function createUncaghtDiagnostic(err, message, document2) { + if (!(err instanceof Error)) { + return []; + } + const range2 = document2 ? document2.getRangeForJsonPath([]) : import_spectral_core.Document.DEFAULT_RANGE; + return [ + { + code: "uncaught-error", + message: `${message}. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: [], + severity: DiagnosticSeverity.Error, + range: range2 + } + ]; +} +function tilde(str2) { + return str2.replace(/[~/]{1}/g, (sub) => { + switch (sub) { + case "/": + return "~1"; + case "~": + return "~0"; + } + return sub; + }); +} +function untilde(str2) { + if (!str2.includes("~")) + return str2; + return str2.replace(/~[01]/g, (sub) => { + switch (sub) { + case "~1": + return "/"; + case "~0": + return "~"; + } + return sub; + }); +} +function findSubArrayIndex(arr, subarr, fromIndex = 0) { + let i7, found, j6; + for (i7 = fromIndex; i7 < 1 + (arr.length - subarr.length); ++i7) { + found = true; + for (j6 = 0; j6 < subarr.length; ++j6) { + if (arr[i7 + j6] !== subarr[j6]) { + found = false; + break; + } + } + if (found) { + return i7; + } + } + return -1; +} +function retrieveDeepData(value2, path2) { + let index4 = 0; + const length = path2.length; + while (typeof value2 === "object" && value2 && index4 < length) { + value2 = value2[path2[index4++]]; + } + return index4 === length ? value2 : void 0; +} +function serializePath(path2) { + if (path2.startsWith("#")) + return path2.substring(1); + return path2; +} +function splitPath(path2) { + return path2.split("/").filter(Boolean).map(untilde); +} +var import_spectral_core; +var init_utils2 = __esm({ + "node_modules/@asyncapi/parser/esm/utils.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core = __toESM(require_dist11()); + init_dist2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/message.js +var Message; +var init_message = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/message.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_channels(); + init_operations(); + init_operation(); + init_message_traits(); + init_message_trait(); + init_servers(); + init_schema4(); + init_utils2(); + Message = class extends MessageTrait { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (!this._json.payload) + return void 0; + return this.createModel(Schema2, this._json.payload, { pointer: `${this._meta.pointer}/payload`, schemaFormat: this._json.schemaFormat }); + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers(servers); + } + channels() { + const channels = []; + const channelsData = []; + this.operations().all().forEach((operation) => { + operation.channels().forEach((channel) => { + if (!channelsData.includes(channel.json())) { + channelsData.push(channel.json()); + channels.push(channel); + } + }); + }); + return new Channels(channels); + } + operations() { + var _a2; + const operations = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + ["subscribe", "publish"].forEach((operationAction) => { + const operation = channel[operationAction]; + if (operation && (operation.message === this._json || (operation.message.oneOf || []).includes(this._json))) { + operations.push(this.createModel(Operation, operation, { id: "", pointer: `/channels/${tilde(channelAddress)}/${operationAction}`, action: operationAction })); + } + }); + }); + return new Operations(operations); + } + traits() { + return new MessageTraits((this._json.traits || []).map((trait, index4) => { + return this.createModel(MessageTrait, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}` }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/operation-traits.js +var OperationTraits; +var init_operation_traits = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/operation-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + OperationTraits = class extends Collection2 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/oauth-flow.js +var OAuthFlow; +var init_oauth_flow = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/oauth-flow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + OAuthFlow = class extends BaseModel { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.scopes; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/oauth-flows.js +var OAuthFlows; +var init_oauth_flows = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/oauth-flows.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_oauth_flow(); + init_mixins(); + OAuthFlows = class extends BaseModel { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (!this._json.authorizationCode) + return void 0; + return new OAuthFlow(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (!this._json.clientCredentials) + return void 0; + return new OAuthFlow(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (!this._json.implicit) + return void 0; + return new OAuthFlow(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (!this._json.password) + return void 0; + return new OAuthFlow(this._json.password); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/security-scheme.js +var SecurityScheme; +var init_security_scheme = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/security-scheme.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_oauth_flows(); + init_mixins(); + SecurityScheme = class extends BaseModel { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (!this._json.flows) + return void 0; + return new OAuthFlows(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/security-requirements.js +var SecurityRequirements; +var init_security_requirements = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/security-requirements.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + SecurityRequirements = class extends Collection2 { + get(id) { + return this.collections.find((securityRequirement) => securityRequirement.meta("id") === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/security-requirement.js +var SecurityRequirement; +var init_security_requirement = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/security-requirement.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + SecurityRequirement = class extends BaseModel { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/operation-trait.js +var OperationTrait; +var init_operation_trait = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/operation-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_security_scheme(); + init_security_requirements(); + init_security_requirement(); + init_mixins(); + OperationTrait = class extends BaseModel { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._json.operationId; + } + operationId() { + return this._json.operationId; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + hasExternalDocs() { + return hasExternalDocs(this); + } + externalDocs() { + return externalDocs(this); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements(requirements); + }); + } + tags() { + return tags(this); + } + bindings() { + return bindings(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/operation.js +var Operation; +var init_operation = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/operation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_channels(); + init_channel(); + init_messages(); + init_message(); + init_operation_traits(); + init_operation_trait(); + init_servers(); + init_utils2(); + Operation = class extends OperationTrait { + action() { + return this._meta.action; + } + isSend() { + return this.action() === "subscribe"; + } + isReceive() { + return this.action() === "publish"; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers(servers); + } + channels() { + const channels = []; + Object.entries(this._meta.asyncapi.parsed.channels || {}).forEach(([channelAddress, channel]) => { + if (channel.subscribe === this._json || channel.publish === this._json) { + channels.push(this.createModel(Channel, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde(channelAddress)}` })); + } + }); + return new Channels(channels); + } + messages() { + let isOneOf = false; + let messages = []; + if (this._json.message) { + if (Array.isArray(this._json.message.oneOf)) { + messages = this._json.message.oneOf; + isOneOf = true; + } else { + messages = [this._json.message]; + } + } + return new Messages(messages.map((message, index4) => { + return this.createModel(Message, message, { id: "", pointer: `${this._meta.pointer}/message${isOneOf ? `/oneOf/${index4}` : ""}` }); + })); + } + reply() { + return; + } + traits() { + return new OperationTraits((this._json.traits || []).map((trait, index4) => { + return this.createModel(OperationTrait, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}`, action: "" }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/server-variables.js +var ServerVariables; +var init_server_variables = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/server-variables.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + ServerVariables = class extends Collection2 { + get(id) { + return this.collections.find((variable) => variable.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/server-variable.js +var ServerVariable; +var init_server_variable = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/server-variable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins(); + ServerVariable = class extends BaseModel { + id() { + return this._meta.id; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/server.js +var Server; +var init_server = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/server.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_channels(); + init_channel(); + init_messages(); + init_operations(); + init_security_scheme(); + init_server_variables(); + init_server_variable(); + init_security_requirements(); + init_security_requirement(); + init_mixins(); + init_utils2(); + Server = class extends BaseModel { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + host() { + const url = new URL(this.url()); + return url.host; + } + hasPathname() { + return !!this.pathname(); + } + pathname() { + const url = new URL(this.url()); + return url.pathname; + } + protocol() { + return this._json.protocol; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + channels() { + var _a2; + const channels = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + const allowedServers = channel.servers || []; + if (allowedServers.length === 0 || allowedServers.includes(this._meta.id)) { + channels.push(this.createModel(Channel, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde(channelAddress)}` })); + } + }); + return new Channels(channels); + } + operations() { + const operations = []; + this.channels().forEach((channel) => { + operations.push(...channel.operations().all()); + }); + return new Operations(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages(messages); + } + variables() { + return new ServerVariables(Object.entries(this._json.variables || {}).map(([serverVariableName, serverVariable]) => { + return this.createModel(ServerVariable, serverVariable, { + id: serverVariableName, + pointer: `${this._meta.pointer}/variables/${serverVariableName}` + }); + })); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements(requirements); + }); + } + tags() { + return tags(this); + } + bindings() { + return bindings(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/channel.js +var Channel; +var init_channel = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/channel.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_channel_parameters(); + init_channel_parameter(); + init_messages(); + init_operations(); + init_operation(); + init_servers(); + init_server(); + init_mixins(); + Channel = class extends BaseModel { + id() { + return this._meta.id; + } + address() { + return this._meta.address; + } + hasDescription() { + return hasDescription(this); + } + description() { + return description(this); + } + servers() { + var _a2; + const servers = []; + const allowedServers = this._json.servers || []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.servers) || {}).forEach(([serverName, server]) => { + if (allowedServers.length === 0 || allowedServers.includes(serverName)) { + servers.push(this.createModel(Server, server, { id: serverName, pointer: `/servers/${serverName}` })); + } + }); + return new Servers(servers); + } + operations() { + const operations = []; + ["publish", "subscribe"].forEach((operationAction) => { + const operation = this._json[operationAction]; + const id = operation && operation.operationId || operationAction; + if (operation) { + operations.push(this.createModel(Operation, operation, { id, action: operationAction, pointer: `${this._meta.pointer}/${operationAction}` })); + } + }); + return new Operations(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages(messages); + } + parameters() { + return new ChannelParameters(Object.entries(this._json.parameters || {}).map(([channelParameterName, channelParameter]) => { + return this.createModel(ChannelParameter, channelParameter, { + id: channelParameterName, + pointer: `${this._meta.pointer}/parameters/${channelParameterName}` + }); + })); + } + bindings() { + return bindings(this); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/schemas.js +var Schemas; +var init_schemas = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/schemas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Schemas = class extends Collection2 { + get(id) { + return this.collections.find((schema8) => schema8.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/security-schemes.js +var SecuritySchemes; +var init_security_schemes = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/security-schemes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + SecuritySchemes = class extends Collection2 { + get(id) { + return this.collections.find((securityScheme) => securityScheme.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/correlation-ids.js +var CorrelationIds; +var init_correlation_ids = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/correlation-ids.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + CorrelationIds = class extends Collection2 { + get(id) { + return this.collections.find((correlationId) => correlationId.meta("id") === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/components.js +var Components; +var init_components = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/components.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_bindings(); + init_binding(); + init_channel(); + init_channel_parameter(); + init_correlation_id(); + init_message_trait(); + init_operation_trait(); + init_schema4(); + init_security_scheme(); + init_server(); + init_server_variable(); + init_mixins(); + init_servers(); + init_channels(); + init_messages(); + init_schemas(); + init_channel_parameters(); + init_server_variables(); + init_operation_traits(); + init_message_traits(); + init_security_schemes(); + init_correlation_ids(); + init_operations(); + init_message(); + init_utils2(); + Components = class extends BaseModel { + servers() { + return this.createCollection("servers", Servers, Server); + } + channels() { + return new Channels(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel, channel, { id: channelAddress, address: "", pointer: `/components/channels/${tilde(channelAddress)}` }))); + } + operations() { + return new Operations([]); + } + messages() { + return this.createCollection("messages", Messages, Message); + } + schemas() { + return this.createCollection("schemas", Schemas, Schema2); + } + channelParameters() { + return this.createCollection("parameters", ChannelParameters, ChannelParameter); + } + serverVariables() { + return this.createCollection("serverVariables", ServerVariables, ServerVariable); + } + operationTraits() { + return this.createCollection("operationTraits", OperationTraits, OperationTrait); + } + messageTraits() { + return this.createCollection("messageTraits", MessageTraits, MessageTrait); + } + correlationIds() { + return this.createCollection("correlationIds", CorrelationIds, CorrelationId); + } + securitySchemes() { + return this.createCollection("securitySchemes", SecuritySchemes, SecurityScheme); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return extensions(this); + } + isEmpty() { + return Object.keys(this._json).length === 0; + } + createCollection(itemsName, collectionModel, itemModel) { + const collectionItems = []; + Object.entries(this._json[itemsName] || {}).forEach(([id, item]) => { + collectionItems.push(this.createModel(itemModel, item, { id, pointer: `/components/${itemsName}/${id}` })); + }); + return new collectionModel(collectionItems); + } + createBindings(itemsName) { + return Object.entries(this._json[itemsName] || {}).reduce((bindings6, [name2, item]) => { + const bindingsData = item || {}; + const asyncapi = this.meta("asyncapi"); + const pointer = `components/${itemsName}/${name2}`; + bindings6[name2] = new Bindings(Object.entries(bindingsData).map(([protocol, binding3]) => this.createModel(Binding, binding3, { protocol, pointer: `${pointer}/${protocol}` })), { originalData: bindingsData, asyncapi, pointer }); + return bindings6; + }, {}); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/asyncapi.js +var AsyncAPIDocument; +var init_asyncapi = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/asyncapi.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_info(); + init_channels(); + init_channel(); + init_components(); + init_messages(); + init_operations(); + init_servers(); + init_server(); + init_security_schemes(); + init_security_scheme(); + init_schemas(); + init_mixins(); + init_utils2(); + init_utils(); + AsyncAPIDocument = class extends BaseModel { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(Info, this._json.info, { pointer: "/info" }); + } + servers() { + return new Servers(Object.entries(this._json.servers || {}).map(([serverName, server]) => this.createModel(Server, server, { id: serverName, pointer: `/servers/${serverName}` }))); + } + channels() { + return new Channels(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde(channelAddress)}` }))); + } + operations() { + const operations = []; + this.channels().forEach((channel) => operations.push(...channel.operations())); + return new Operations(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + return new Messages(messages); + } + schemas() { + return schemasFromDocument(this, Schemas, false); + } + securitySchemes() { + var _a2; + return new SecuritySchemes(Object.entries(((_a2 = this._json.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) || {}).map(([securitySchemeName, securityScheme]) => this.createModel(SecurityScheme, securityScheme, { id: securitySchemeName, pointer: `/components/securitySchemes/${securitySchemeName}` }))); + } + components() { + return this.createModel(Components, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const servers = this.servers().all(); + this.components().servers().forEach((server) => !servers.some((s7) => s7.json() === server.json()) && servers.push(server)); + return new Servers(servers); + } + allChannels() { + const channels = this.channels().all(); + this.components().channels().forEach((channel) => !channels.some((c7) => c7.json() === channel.json()) && channels.push(channel)); + return new Channels(channels); + } + allOperations() { + const operations = []; + this.allChannels().forEach((channel) => operations.push(...channel.operations())); + return new Operations(operations); + } + allMessages() { + const messages = []; + this.allOperations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + this.components().messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message)); + return new Messages(messages); + } + allSchemas() { + return schemasFromDocument(this, Schemas, true); + } + extensions() { + return extensions(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v2/index.js +var init_v2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v2/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asyncapi(); + init_binding(); + init_bindings(); + init_channel_parameter(); + init_channel_parameters(); + init_channel(); + init_channels(); + init_components(); + init_contact(); + init_correlation_id(); + init_extension(); + init_extensions(); + init_external_docs(); + init_info(); + init_license(); + init_message_example(); + init_message_examples(); + init_message_trait(); + init_message_traits(); + init_message(); + init_messages(); + init_oauth_flow(); + init_oauth_flows(); + init_operation_trait(); + init_operation_traits(); + init_operation(); + init_operations(); + init_schema4(); + init_schemas(); + init_security_scheme(); + init_security_schemes(); + init_server_variable(); + init_server_variables(); + init_server(); + init_servers(); + init_tag(); + init_tags2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/extensions.js +var Extensions2; +var init_extensions2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/extensions.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Extensions2 = class extends Collection2 { + get(id) { + id = id.startsWith("x-") ? id : `x-${id}`; + return this.collections.find((ext) => ext.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/extension.js +var Extension2; +var init_extension2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/extension.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + Extension2 = class extends BaseModel { + id() { + return this._meta.id; + } + version() { + return "to implement"; + } + value() { + return this._json; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/bindings.js +var Bindings2; +var init_bindings2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/bindings.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + init_extensions2(); + init_extension2(); + init_utils(); + init_constants(); + Bindings2 = class extends Collection2 { + get(name2) { + return this.collections.find((binding3) => binding3.protocol() === name2); + } + extensions() { + const extensions6 = []; + Object.entries(this._meta.originalData || {}).forEach(([id, value2]) => { + if (EXTENSION_REGEX.test(id)) { + extensions6.push(createModel(Extension2, value2, { id, pointer: `${this._meta.pointer}/${id}`, asyncapi: this._meta.asyncapi })); + } + }); + return new Extensions2(extensions6); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/binding.js +var Binding2; +var init_binding2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/binding.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + Binding2 = class extends BaseModel { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const value2 = Object.assign({}, this._json); + delete value2.bindingVersion; + return value2; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/external-docs.js +var ExternalDocumentation2; +var init_external_docs2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/external-docs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + ExternalDocumentation2 = class extends BaseModel { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/tags.js +var Tags2; +var init_tags3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/tags.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Tags2 = class extends Collection2 { + get(name2) { + return this.collections.find((tag) => tag.name() === name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/tag.js +var Tag2; +var init_tag2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/tag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + Tag2 = class extends BaseModel { + id() { + return this._meta.id; + } + name() { + return this._json.name; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + extensions() { + return extensions2(this); + } + hasExternalDocs() { + return hasExternalDocs2(this); + } + externalDocs() { + return externalDocs2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/mixins.js +function bindings2(model) { + const bindings6 = model.json("bindings") || {}; + return new Bindings2(Object.entries(bindings6 || {}).map(([protocol, binding3]) => createModel(Binding2, binding3, { protocol, pointer: model.jsonPath(`bindings/${protocol}`) }, model)), { originalData: bindings6, asyncapi: model.meta("asyncapi"), pointer: model.jsonPath("bindings") }); +} +function hasDescription2(model) { + return Boolean(description2(model)); +} +function description2(model) { + return model.json("description"); +} +function extensions2(model) { + const extensions6 = []; + Object.entries(model.json()).forEach(([id, value2]) => { + if (EXTENSION_REGEX.test(id)) { + extensions6.push(createModel(Extension2, value2, { id, pointer: model.jsonPath(id) }, model)); + } + }); + return new Extensions2(extensions6); +} +function hasExternalDocs2(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs2(model) { + if (hasExternalDocs2(model)) { + return new ExternalDocumentation2(model.json("externalDocs")); + } +} +function tags2(model) { + return new Tags2((model.json("tags") || []).map((tag, idx) => createModel(Tag2, tag, { pointer: model.jsonPath(`tags/${idx}`) }, model))); +} +var CoreModel; +var init_mixins2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/mixins.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_bindings2(); + init_binding2(); + init_extensions2(); + init_extension2(); + init_external_docs2(); + init_tags3(); + init_tag2(); + init_utils(); + init_constants(); + CoreModel = class extends BaseModel { + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + hasExternalDocs() { + return hasExternalDocs2(this); + } + externalDocs() { + return externalDocs2(this); + } + tags() { + return tags2(this); + } + bindings() { + return bindings2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/contact.js +var Contact2; +var init_contact2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/contact.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + Contact2 = class extends BaseModel { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/license.js +var License2; +var init_license2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/license.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + License2 = class extends BaseModel { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/info.js +var Info2; +var init_info2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/info.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_contact2(); + init_license2(); + init_mixins2(); + Info2 = class extends BaseModel { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const contact = this._json.contact; + return contact && this.createModel(Contact2, contact, { pointer: this.jsonPath("contact") }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const license = this._json.license; + return license && this.createModel(License2, license, { pointer: this.jsonPath("license") }); + } + hasExternalDocs() { + return hasExternalDocs2(this); + } + externalDocs() { + return externalDocs2(this); + } + tags() { + return tags2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/servers.js +var Servers2; +var init_servers2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/servers.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Servers2 = class extends Collection2 { + get(id) { + return this.collections.find((server) => server.id() === id); + } + filterBySend() { + return this.filterBy((server) => server.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((server) => server.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/channels.js +var Channels2; +var init_channels2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/channels.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Channels2 = class extends Collection2 { + get(id) { + return this.collections.find((channel) => channel.id() === id); + } + filterBySend() { + return this.filterBy((channel) => channel.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((channel) => channel.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/channel-parameters.js +var ChannelParameters2; +var init_channel_parameters2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/channel-parameters.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + ChannelParameters2 = class extends Collection2 { + get(id) { + return this.collections.find((parameter) => parameter.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/schema.js +var Schema3; +var init_schema5 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_constants(); + init_mixins2(); + init_schema_parser(); + Schema3 = class _Schema extends BaseModel { + // The following constructor is needed because, starting from AsyncAPI v3, schemas can be multi-format as well. + constructor(_json, _meta = {}) { + var _a2, _b; + super(_json, _meta); + this._json = _json; + this._meta = _meta; + if (typeof _json === "object" && typeof _json.schema === "object") { + this._schemaObject = _json.schema; + this._schemaFormat = _json.schemaFormat; + } else { + this._schemaObject = _json; + this._schemaFormat = getDefaultSchemaFormat((_b = (_a2 = _meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.semver) === null || _b === void 0 ? void 0 : _b.version); + } + } + id() { + return this.$id() || this._meta.id || this._schemaObject[xParserSchemaId]; + } + $comment() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.$comment; + } + $id() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.$id; + } + $schema() { + var _a2; + if (typeof this._schemaObject === "boolean") + return "http://json-schema.org/draft-07/schema#"; + return (_a2 = this._schemaObject.$schema) !== null && _a2 !== void 0 ? _a2 : "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + if (typeof this._schemaObject === "boolean") + return this._schemaObject; + if (this._schemaObject.additionalItems === void 0) + return true; + if (typeof this._schemaObject.additionalItems === "boolean") + return this._schemaObject.additionalItems; + return this.createModel(_Schema, this._schemaObject.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + if (typeof this._schemaObject === "boolean") + return this._schemaObject; + if (this._schemaObject.additionalProperties === void 0) + return true; + if (typeof this._schemaObject.additionalProperties === "boolean") + return this._schemaObject.additionalProperties; + return this.createModel(_Schema, this._schemaObject.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.allOf)) + return void 0; + return this._schemaObject.allOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/allOf/${index4}`, parent: this })); + } + anyOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.anyOf)) + return void 0; + return this._schemaObject.anyOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/anyOf/${index4}`, parent: this })); + } + const() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.const; + } + contains() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.contains !== "object") + return; + return this.createModel(_Schema, this._schemaObject.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.contentEncoding; + } + contentMediaType() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.contentMediaType; + } + default() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.default; + } + definitions() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.definitions !== "object") + return; + return Object.entries(this._schemaObject.definitions).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/definitions/${key}`, parent: this }); + return acc; + }, {}); + } + description() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.description; + } + dependencies() { + if (typeof this._schemaObject === "boolean") + return; + if (typeof this._schemaObject.dependencies !== "object") + return void 0; + return Object.entries(this._schemaObject.dependencies).reduce((acc, [key, s7]) => { + acc[key] = Array.isArray(s7) ? s7 : this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/dependencies/${key}`, parent: this }); + return acc; + }, {}); + } + deprecated() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.deprecated || false; + } + discriminator() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.discriminator; + } + else() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.else !== "object") + return; + return this.createModel(_Schema, this._schemaObject.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.enum; + } + examples() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.examples; + } + exclusiveMaximum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.exclusiveMaximum; + } + exclusiveMinimum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.exclusiveMinimum; + } + format() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.format; + } + isBooleanSchema() { + return typeof this._schemaObject === "boolean"; + } + if() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.if !== "object") + return; + return this.createModel(_Schema, this._schemaObject.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._schemaObject) + return true; + parent2 = parent2._meta.parent; + } + return false; + } + items() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.items !== "object") + return; + if (Array.isArray(this._schemaObject.items)) { + return this._schemaObject.items.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/items/${index4}`, parent: this })); + } + return this.createModel(_Schema, this._schemaObject.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maximum; + } + maxItems() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxItems; + } + maxLength() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxLength; + } + maxProperties() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxProperties; + } + minimum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minimum; + } + minItems() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minItems; + } + minLength() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minLength; + } + minProperties() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minProperties; + } + multipleOf() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.multipleOf; + } + not() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.not !== "object") + return; + return this.createModel(_Schema, this._schemaObject.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.oneOf)) + return void 0; + return this._schemaObject.oneOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/oneOf/${index4}`, parent: this })); + } + pattern() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.pattern; + } + patternProperties() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.patternProperties !== "object") + return; + return Object.entries(this._schemaObject.patternProperties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/patternProperties/${key}`, parent: this }); + return acc; + }, {}); + } + properties() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.properties !== "object") + return; + return Object.entries(this._schemaObject.properties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/properties/${key}`, parent: this }); + return acc; + }, {}); + } + property(name2) { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.properties !== "object" || typeof this._schemaObject.properties[name2] !== "object") + return; + return this.createModel(_Schema, this._schemaObject.properties[name2], { pointer: `${this._meta.pointer}/properties/${name2}`, parent: this }); + } + propertyNames() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.propertyNames !== "object") + return; + return this.createModel(_Schema, this._schemaObject.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.readOnly || false; + } + required() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.required; + } + schemaFormat() { + return this._schemaFormat; + } + then() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.then !== "object") + return; + return this.createModel(_Schema, this._schemaObject.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.title; + } + type() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.type; + } + uniqueItems() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.uniqueItems || false; + } + writeOnly() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.writeOnly || false; + } + hasExternalDocs() { + return hasExternalDocs2(this); + } + externalDocs() { + return externalDocs2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/channel-parameter.js +var ChannelParameter2; +var init_channel_parameter2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/channel-parameter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + init_schema5(); + ChannelParameter2 = class extends BaseModel { + id() { + return this._meta.id; + } + hasSchema() { + return true; + } + schema() { + return this.createModel(Schema3, { + type: "string", + description: this._json.description, + enum: this._json.enum, + default: this._json.default, + examples: this._json.examples + }, { pointer: `${this._meta.pointer}` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/messages.js +var Messages2; +var init_messages2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/messages.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Messages2 = class extends Collection2 { + get(name2) { + return this.collections.find((message) => message.id() === name2); + } + filterBySend() { + return this.filterBy((message) => message.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((message) => message.operations().filterByReceive().length > 0); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operations.js +var Operations2; +var init_operations2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operations.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Operations2 = class extends Collection2 { + get(id) { + return this.collections.find((operation) => operation.id() === id); + } + filterBySend() { + return this.filterBy((operation) => operation.isSend()); + } + filterByReceive() { + return this.filterBy((operation) => operation.isReceive()); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-traits.js +var OperationTraits2; +var init_operation_traits2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + OperationTraits2 = class extends Collection2 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/oauth-flow.js +var OAuthFlow2; +var init_oauth_flow2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/oauth-flow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + OAuthFlow2 = class extends BaseModel { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.availableScopes; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/oauth-flows.js +var OAuthFlows2; +var init_oauth_flows2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/oauth-flows.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_oauth_flow2(); + init_mixins2(); + OAuthFlows2 = class extends BaseModel { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (!this._json.authorizationCode) + return void 0; + return new OAuthFlow2(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (!this._json.clientCredentials) + return void 0; + return new OAuthFlow2(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (!this._json.implicit) + return void 0; + return new OAuthFlow2(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (!this._json.password) + return void 0; + return new OAuthFlow2(this._json.password); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/security-scheme.js +var SecurityScheme2; +var init_security_scheme2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/security-scheme.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_oauth_flows2(); + init_mixins2(); + SecurityScheme2 = class extends BaseModel { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (!this._json.flows) + return void 0; + return new OAuthFlows2(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/security-requirements.js +var SecurityRequirements2; +var init_security_requirements2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/security-requirements.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + SecurityRequirements2 = class extends Collection2 { + get(id) { + return this.collections.find((securityRequirement) => securityRequirement.meta("id") === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/security-requirement.js +var SecurityRequirement2; +var init_security_requirement2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/security-requirement.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + SecurityRequirement2 = class extends BaseModel { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-trait.js +var OperationTrait2; +var init_operation_trait2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_security_scheme2(); + init_security_requirements2(); + init_security_requirement2(); + init_mixins2(); + OperationTrait2 = class extends CoreModel { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._meta.id; + } + operationId() { + return this._meta.id; + } + security() { + return (this._json.security || []).map((security4, index4) => { + const scheme = this.createModel(SecurityScheme2, security4, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + const requirement = this.createModel(SecurityRequirement2, { scheme, scopes: security4.scopes }, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + return new SecurityRequirements2([requirement]); + }); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-reply-address.js +var OperationReplyAddress; +var init_operation_reply_address = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-reply-address.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + OperationReplyAddress = class extends BaseModel { + id() { + return this._meta.id; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-reply.js +var OperationReply; +var init_operation_reply = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-reply.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_channel2(); + init_message2(); + init_messages2(); + init_operation_reply_address(); + init_mixins2(); + init_constants(); + OperationReply = class extends BaseModel { + id() { + return this._meta.id; + } + hasAddress() { + return !!this._json.address; + } + address() { + if (this._json.address) { + return this.createModel(OperationReplyAddress, this._json.address, { pointer: this.jsonPath("address") }); + } + } + hasChannel() { + return !!this._json.channel; + } + channel() { + if (this._json.channel) { + const channelId = this._json.channel[xParserObjectUniqueId]; + return this.createModel(Channel2, this._json.channel, { id: channelId, pointer: this.jsonPath("channel") }); + } + return this._json.channel; + } + messages() { + var _a2; + return new Messages2(Object.values((_a2 = this._json.messages) !== null && _a2 !== void 0 ? _a2 : {}).map((message) => { + const messageId = message[xParserObjectUniqueId]; + return this.createModel(Message2, message, { id: messageId, pointer: this.jsonPath(`messages/${messageId}`) }); + })); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation.js +var Operation2; +var init_operation2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_messages2(); + init_message2(); + init_channels2(); + init_channel2(); + init_operation_traits2(); + init_operation_trait2(); + init_operation_reply(); + init_servers2(); + init_constants(); + Operation2 = class extends OperationTrait2 { + action() { + return this._json.action; + } + isSend() { + return this.action() === "send"; + } + isReceive() { + return this.action() === "receive"; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + const serverData = server.json(); + if (!serversData.includes(serverData)) { + serversData.push(serverData); + servers.push(server); + } + }); + }); + return new Servers2(servers); + } + channels() { + if (this._json.channel) { + const operationChannelId = this._json.channel[xParserObjectUniqueId]; + return new Channels2([ + this.createModel(Channel2, this._json.channel, { id: operationChannelId, pointer: `/channels/${operationChannelId}` }) + ]); + } + return new Channels2([]); + } + messages() { + const messages = []; + if (Array.isArray(this._json.messages)) { + this._json.messages.forEach((message, index4) => { + const messageId = message[xParserObjectUniqueId]; + messages.push(this.createModel(Message2, message, { id: messageId, pointer: this.jsonPath(`messages/${index4}`) })); + }); + return new Messages2(messages); + } + this.channels().forEach((channel) => { + messages.push(...channel.messages()); + }); + return new Messages2(messages); + } + hasReply() { + return !!this._json.reply; + } + reply() { + if (this._json.reply) { + return this.createModel(OperationReply, this._json.reply, { pointer: this.jsonPath("reply") }); + } + } + traits() { + return new OperationTraits2((this._json.traits || []).map((trait, index4) => { + return this.createModel(OperationTrait2, trait, { id: "", pointer: this.jsonPath(`traits/${index4}`) }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/message-traits.js +var MessageTraits2; +var init_message_traits2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/message-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + MessageTraits2 = class extends Collection2 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/correlation-id.js +var CorrelationId2; +var init_correlation_id2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/correlation-id.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + CorrelationId2 = class extends BaseModel { + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/message-examples.js +var MessageExamples2; +var init_message_examples2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/message-examples.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + MessageExamples2 = class extends Collection2 { + get(name2) { + return this.collections.find((example) => example.name() === name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/message-example.js +var MessageExample2; +var init_message_example2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/message-example.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + MessageExample2 = class extends BaseModel { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/message-trait.js +var MessageTrait2; +var init_message_trait2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/message-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_correlation_id2(); + init_message_examples2(); + init_message_example2(); + init_schema5(); + init_constants(); + init_mixins2(); + MessageTrait2 = class extends CoreModel { + id() { + var _a2; + return this._meta.id || ((_a2 = this.extensions().get(xParserMessageName)) === null || _a2 === void 0 ? void 0 : _a2.value()); + } + hasMessageId() { + return false; + } + hasSchemaFormat() { + return false; + } + schemaFormat() { + return void 0; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (!this._json.correlationId) + return void 0; + return this.createModel(CorrelationId2, this._json.correlationId, { pointer: this.jsonPath("correlationId") }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var _a2, _b; + return this._json.contentType || ((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (!this._json.headers) + return void 0; + return this.createModel(Schema3, this._json.headers, { pointer: this.jsonPath("headers") }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + examples() { + return new MessageExamples2((this._json.examples || []).map((example, index4) => { + return this.createModel(MessageExample2, example, { pointer: this.jsonPath(`examples/${index4}`) }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/message.js +var Message2; +var init_message2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/message.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_channel2(); + init_channels2(); + init_operations2(); + init_operation2(); + init_message_traits2(); + init_message_trait2(); + init_servers2(); + init_schema5(); + init_constants(); + Message2 = class extends MessageTrait2 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (!this._json.payload) + return void 0; + return this.createModel(Schema3, this._json.payload, { pointer: this.jsonPath("payload") }); + } + hasSchemaFormat() { + return this.hasPayload(); + } + schemaFormat() { + var _a2; + if (this.hasSchemaFormat()) { + return (_a2 = this.payload()) === null || _a2 === void 0 ? void 0 : _a2.schemaFormat(); + } + return void 0; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + const serverData = server.json(); + if (!serversData.includes(serverData)) { + serversData.push(serverData); + servers.push(server); + } + }); + }); + return new Servers2(servers); + } + channels() { + var _a2, _b; + const thisMessageId = this._json[xParserObjectUniqueId]; + const channels = []; + const channelsData = []; + this.operations().forEach((operation) => { + operation.channels().forEach((channel) => { + const channelData = channel.json(); + if (!channelsData.includes(channelData)) { + channelsData.push(channelData); + channels.push(channel); + } + }); + }); + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelId, channelData]) => { + const channelModel = this.createModel(Channel2, channelData, { id: channelId, pointer: `/channels/${channelId}` }); + if (!channelsData.includes(channelData) && channelModel.messages().some((m7) => { + const messageId = m7[xParserObjectUniqueId]; + return messageId === thisMessageId; + })) { + channelsData.push(channelData); + channels.push(channelModel); + } + }); + return new Channels2(channels); + } + operations() { + var _a2, _b; + const thisMessageId = this._json[xParserObjectUniqueId]; + const operations = []; + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.operations) || {}).forEach(([operationId, operation]) => { + const operationModel = this.createModel(Operation2, operation, { id: operationId, pointer: `/operations/${operationId}` }); + const operationHasMessage = operationModel.messages().some((m7) => { + const messageId = m7[xParserObjectUniqueId]; + return messageId === thisMessageId; + }); + if (operationHasMessage) { + operations.push(operationModel); + } + }); + return new Operations2(operations); + } + traits() { + return new MessageTraits2((this._json.traits || []).map((trait, index4) => { + return this.createModel(MessageTrait2, trait, { id: "", pointer: this.jsonPath(`traits/${index4}`) }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/channel.js +var Channel2; +var init_channel2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/channel.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_channel_parameters2(); + init_channel_parameter2(); + init_messages2(); + init_message2(); + init_operations2(); + init_operation2(); + init_servers2(); + init_server2(); + init_constants(); + init_mixins2(); + Channel2 = class extends CoreModel { + id() { + return this._meta.id; + } + address() { + return this._json.address; + } + servers() { + var _a2, _b, _c; + const servers = []; + const allowedServers = (_a2 = this._json.servers) !== null && _a2 !== void 0 ? _a2 : []; + Object.entries((_c = (_b = this._meta.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed.servers) !== null && _c !== void 0 ? _c : {}).forEach(([serverName, server]) => { + if (allowedServers.length === 0 || allowedServers.includes(server)) { + servers.push(this.createModel(Server2, server, { id: serverName, pointer: `/servers/${serverName}` })); + } + }); + return new Servers2(servers); + } + operations() { + var _a2, _b, _c; + const operations = []; + Object.entries((_c = (_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.operations) !== null && _c !== void 0 ? _c : {}).forEach(([operationId, operation]) => { + const operationChannelId = operation.channel[xParserObjectUniqueId]; + const channelId = this._json[xParserObjectUniqueId]; + if (operationChannelId === channelId) { + operations.push(this.createModel(Operation2, operation, { id: operationId, pointer: `/operations/${operationId}` })); + } + }); + return new Operations2(operations); + } + messages() { + var _a2; + return new Messages2(Object.entries((_a2 = this._json.messages) !== null && _a2 !== void 0 ? _a2 : {}).map(([messageName, message]) => { + return this.createModel(Message2, message, { id: messageName, pointer: this.jsonPath(`messages/${messageName}`) }); + })); + } + parameters() { + var _a2; + return new ChannelParameters2(Object.entries((_a2 = this._json.parameters) !== null && _a2 !== void 0 ? _a2 : {}).map(([channelParameterName, channelParameter]) => { + return this.createModel(ChannelParameter2, channelParameter, { + id: channelParameterName, + pointer: this.jsonPath(`parameters/${channelParameterName}`) + }); + })); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/server-variables.js +var ServerVariables2; +var init_server_variables2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/server-variables.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + ServerVariables2 = class extends Collection2 { + get(id) { + return this.collections.find((variable) => variable.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/server-variable.js +var ServerVariable2; +var init_server_variable2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/server-variable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_mixins2(); + ServerVariable2 = class extends BaseModel { + id() { + return this._meta.id; + } + hasDescription() { + return hasDescription2(this); + } + description() { + return description2(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/server.js +var Server2; +var init_server2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/server.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_channels2(); + init_channel2(); + init_messages2(); + init_operations2(); + init_security_scheme2(); + init_server_variables2(); + init_server_variable2(); + init_security_requirements2(); + init_security_requirement2(); + init_mixins2(); + init_utils2(); + Server2 = class extends CoreModel { + id() { + return this._meta.id; + } + url() { + let host = this.host(); + if (!host.endsWith("/")) { + host = `${host}/`; + } + let pathname = this.pathname() || ""; + if (pathname.startsWith("/")) { + pathname = pathname.substring(1); + } + return `${this.protocol()}://${host}${pathname}`; + } + host() { + return this._json.host; + } + protocol() { + return this._json.protocol; + } + hasPathname() { + return !!this._json.pathname; + } + pathname() { + return this._json.pathname; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + channels() { + var _a2, _b; + const channels = []; + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelName, channel]) => { + const allowedServers = channel.servers || []; + if (allowedServers.length === 0 || allowedServers.includes(this._json)) { + channels.push(this.createModel(Channel2, channel, { id: channelName, pointer: `/channels/${tilde(channelName)}` })); + } + }); + return new Channels2(channels); + } + operations() { + const operations = []; + const operationsData = []; + this.channels().forEach((channel) => { + channel.operations().forEach((operation) => { + const operationData = operation.json(); + if (!operationsData.includes(operationData)) { + operations.push(operation); + operationsData.push(operationData); + } + }); + }); + return new Operations2(operations); + } + messages() { + const messages = []; + const messagedData = []; + this.channels().forEach((channel) => { + channel.messages().forEach((message) => { + const messageData = message.json(); + if (!messagedData.includes(messageData)) { + messages.push(message); + messagedData.push(messageData); + } + }); + }); + return new Messages2(messages); + } + variables() { + return new ServerVariables2(Object.entries(this._json.variables || {}).map(([serverVariableName, serverVariable]) => { + return this.createModel(ServerVariable2, serverVariable, { + id: serverVariableName, + pointer: this.jsonPath(`variables/${serverVariableName}`) + }); + })); + } + security() { + return (this._json.security || []).map((security4, index4) => { + const scheme = this.createModel(SecurityScheme2, security4, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + const requirement = this.createModel(SecurityRequirement2, { scheme, scopes: security4.scopes }, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + return new SecurityRequirements2([requirement]); + }); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/security-schemes.js +var SecuritySchemes2; +var init_security_schemes2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/security-schemes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + SecuritySchemes2 = class extends Collection2 { + get(id) { + return this.collections.find((securityScheme) => securityScheme.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/schemas.js +var Schemas2; +var init_schemas2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/schemas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + Schemas2 = class extends Collection2 { + get(id) { + return this.collections.find((schema8) => schema8.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-replies.js +var OperationReplies; +var init_operation_replies = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-replies.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + OperationReplies = class extends Collection2 { + get(id) { + return this.collections.find((reply) => reply.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/operation-reply-addresses.js +var OperationReplyAddresses; +var init_operation_reply_addresses = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/operation-reply-addresses.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + OperationReplyAddresses = class extends Collection2 { + get(id) { + return this.collections.find((reply) => reply.id() === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/correlation-ids.js +var CorrelationIds2; +var init_correlation_ids2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/correlation-ids.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + CorrelationIds2 = class extends Collection2 { + get(id) { + return this.collections.find((correlationId) => correlationId.meta("id") === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/external-documentations.js +var ExternalDocumentations; +var init_external_documentations = __esm({ + "node_modules/@asyncapi/parser/esm/models/external-documentations.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_collection(); + ExternalDocumentations = class extends Collection2 { + get(id) { + return this.collections.find((externalDocs7) => externalDocs7.meta("id") === id); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/components.js +var Components2; +var init_components2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/components.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_bindings2(); + init_binding2(); + init_channel2(); + init_channel_parameter2(); + init_correlation_id2(); + init_message_trait2(); + init_operation_trait2(); + init_operation_reply(); + init_operation_reply_address(); + init_schema5(); + init_security_scheme2(); + init_server2(); + init_server_variable2(); + init_mixins2(); + init_servers2(); + init_channels2(); + init_messages2(); + init_schemas2(); + init_channel_parameters2(); + init_server_variables2(); + init_operation_traits2(); + init_message_traits2(); + init_operation_replies(); + init_operation_reply_addresses(); + init_security_schemes2(); + init_correlation_ids2(); + init_operations2(); + init_operation2(); + init_message2(); + init_external_documentations(); + init_external_docs2(); + init_tags3(); + init_tag2(); + init_utils2(); + Components2 = class extends BaseModel { + servers() { + return this.createCollection("servers", Servers2, Server2); + } + channels() { + return this.createCollection("channels", Channels2, Channel2); + } + operations() { + return this.createCollection("operations", Operations2, Operation2); + } + messages() { + return this.createCollection("messages", Messages2, Message2); + } + schemas() { + return this.createCollection("schemas", Schemas2, Schema3); + } + channelParameters() { + return this.createCollection("parameters", ChannelParameters2, ChannelParameter2); + } + serverVariables() { + return this.createCollection("serverVariables", ServerVariables2, ServerVariable2); + } + operationTraits() { + return this.createCollection("operationTraits", OperationTraits2, OperationTrait2); + } + messageTraits() { + return this.createCollection("messageTraits", MessageTraits2, MessageTrait2); + } + replies() { + return this.createCollection("replies", OperationReplies, OperationReply); + } + replyAddresses() { + return this.createCollection("replyAddresses", OperationReplyAddresses, OperationReplyAddress); + } + correlationIds() { + return this.createCollection("correlationIds", CorrelationIds2, CorrelationId2); + } + securitySchemes() { + return this.createCollection("securitySchemes", SecuritySchemes2, SecurityScheme2); + } + tags() { + return this.createCollection("tags", Tags2, Tag2); + } + externalDocs() { + return this.createCollection("externalDocs", ExternalDocumentations, ExternalDocumentation2); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return extensions2(this); + } + isEmpty() { + return Object.keys(this._json).length === 0; + } + createCollection(itemsName, collectionModel, itemModel) { + const collectionItems = []; + Object.entries(this._json[itemsName] || {}).forEach(([id, item]) => { + collectionItems.push(this.createModel(itemModel, item, { id, pointer: `/components/${itemsName}/${tilde(id)}` })); + }); + return new collectionModel(collectionItems); + } + createBindings(itemsName) { + return Object.entries(this._json[itemsName] || {}).reduce((bindings6, [name2, item]) => { + const bindingsData = item || {}; + const asyncapi = this.meta("asyncapi"); + const pointer = `components/${itemsName}/${name2}`; + bindings6[name2] = new Bindings2(Object.entries(bindingsData).map(([protocol, binding3]) => this.createModel(Binding2, binding3, { protocol, pointer: `${pointer}/${protocol}` })), { originalData: bindingsData, asyncapi, pointer }); + return bindings6; + }, {}); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/asyncapi.js +var AsyncAPIDocument2; +var init_asyncapi2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/asyncapi.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base(); + init_info2(); + init_servers2(); + init_server2(); + init_channels2(); + init_channel2(); + init_operations2(); + init_operation2(); + init_messages2(); + init_security_schemes2(); + init_security_scheme2(); + init_components2(); + init_schemas2(); + init_mixins2(); + init_utils2(); + init_utils(); + AsyncAPIDocument2 = class extends BaseModel { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(Info2, this._json.info, { pointer: "/info" }); + } + servers() { + return new Servers2(Object.entries(this._json.servers || {}).map(([serverName, server]) => this.createModel(Server2, server, { id: serverName, pointer: `/servers/${tilde(serverName)}` }))); + } + channels() { + return new Channels2(Object.entries(this._json.channels || {}).map(([channelId, channel]) => this.createModel(Channel2, channel, { id: channelId, pointer: `/channels/${tilde(channelId)}` }))); + } + operations() { + return new Operations2(Object.entries(this._json.operations || {}).map(([operationId, operation]) => this.createModel(Operation2, operation, { id: operationId, pointer: `/operations/${tilde(operationId)}` }))); + } + messages() { + const messages = []; + const messagesData = []; + this.channels().forEach((channel) => { + channel.messages().forEach((message) => { + const messageData = message.json(); + if (!messagesData.includes(messageData)) { + messagesData.push(messageData); + messages.push(message); + } + }); + }); + return new Messages2(messages); + } + schemas() { + return schemasFromDocument(this, Schemas2, false); + } + securitySchemes() { + var _a2; + return new SecuritySchemes2(Object.entries(((_a2 = this._json.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) || {}).map(([securitySchemeName, securityScheme]) => this.createModel(SecurityScheme2, securityScheme, { id: securitySchemeName, pointer: `/components/securitySchemes/${securitySchemeName}` }))); + } + components() { + return this.createModel(Components2, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const servers = this.servers().all(); + this.components().servers().forEach((server) => !servers.some((s7) => s7.json() === server.json()) && servers.push(server)); + return new Servers2(servers); + } + allChannels() { + const channels = this.channels().all(); + this.components().channels().forEach((channel) => !channels.some((c7) => c7.json() === channel.json()) && channels.push(channel)); + return new Channels2(channels); + } + allOperations() { + const operations = this.operations().all(); + this.components().operations().forEach((operation) => !operations.some((o7) => o7.json() === operation.json()) && operations.push(operation)); + return new Operations2(operations); + } + allMessages() { + const messages = this.messages().all(); + this.components().messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message)); + return new Messages2(messages); + } + allSchemas() { + return schemasFromDocument(this, Schemas2, true); + } + extensions() { + return extensions2(this); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/models/v3/index.js +var init_v3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/v3/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asyncapi2(); + init_binding2(); + init_bindings2(); + init_channel_parameter2(); + init_channel_parameters2(); + init_channel2(); + init_channels2(); + init_components2(); + init_contact2(); + init_correlation_id2(); + init_extension2(); + init_extensions2(); + init_external_docs2(); + init_info2(); + init_license2(); + init_message_example2(); + init_message_examples2(); + init_message_trait2(); + init_message_traits2(); + init_message2(); + init_messages2(); + init_oauth_flow2(); + init_oauth_flows2(); + init_operation_trait2(); + init_operation_traits2(); + init_operation_replies(); + init_operation_reply_address(); + init_operation_reply_addresses(); + init_operation_reply(); + init_operation2(); + init_operations2(); + init_schema5(); + init_schemas2(); + init_security_scheme2(); + init_security_schemes2(); + init_server_variable2(); + init_server_variables2(); + init_server2(); + init_servers2(); + init_tag2(); + init_tags3(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/asyncapi.js +var ParserAPIVersion; +var init_asyncapi3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/asyncapi.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + ParserAPIVersion = 3; + } +}); + +// node_modules/@asyncapi/parser/esm/models/binding.js +var init_binding3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/binding.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/bindings.js +var init_bindings3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/bindings.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/channel-parameter.js +var init_channel_parameter3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/channel-parameter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/channel-parameters.js +var init_channel_parameters3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/channel-parameters.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/channel.js +var init_channel3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/channel.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/channels.js +var init_channels3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/channels.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/components.js +var init_components3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/components.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/contact.js +var init_contact3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/contact.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/correlation-id.js +var init_correlation_id3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/correlation-id.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/correlation-ids.js +var init_correlation_ids3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/correlation-ids.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/extension.js +var init_extension3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/extension.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/extensions.js +var init_extensions3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/extensions.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/external-docs.js +var init_external_docs3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/external-docs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/info.js +var init_info3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/info.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/license.js +var init_license3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/license.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/message-example.js +var init_message_example3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/message-example.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/message-examples.js +var init_message_examples3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/message-examples.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/message-trait.js +var init_message_trait3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/message-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/message-traits.js +var init_message_traits3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/message-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/message.js +var init_message3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/message.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/messages.js +var init_messages3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/messages.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/oauth-flow.js +var init_oauth_flow3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/oauth-flow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/oauth-flows.js +var init_oauth_flows3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/oauth-flows.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-replies.js +var init_operation_replies2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-replies.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-reply-address.js +var init_operation_reply_address2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-reply-address.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-reply-addresses.js +var init_operation_reply_addresses2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-reply-addresses.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-reply.js +var init_operation_reply2 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-reply.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-trait.js +var init_operation_trait3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation-traits.js +var init_operation_traits3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operation.js +var init_operation3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/operations.js +var init_operations3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/operations.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/schema.js +var init_schema6 = __esm({ + "node_modules/@asyncapi/parser/esm/models/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/schemas.js +var init_schemas3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/schemas.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/security-requirement.js +var init_security_requirement3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/security-requirement.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/security-requirements.js +var init_security_requirements3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/security-requirements.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/security-scheme.js +var init_security_scheme3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/security-scheme.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/security-schemes.js +var init_security_schemes3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/security-schemes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/server-variable.js +var init_server_variable3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/server-variable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/server-variables.js +var init_server_variables3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/server-variables.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/server.js +var init_server3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/server.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/servers.js +var init_servers3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/servers.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/tag.js +var init_tag3 = __esm({ + "node_modules/@asyncapi/parser/esm/models/tag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/tags.js +var init_tags4 = __esm({ + "node_modules/@asyncapi/parser/esm/models/tags.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/models/index.js +var init_models = __esm({ + "node_modules/@asyncapi/parser/esm/models/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_v2(); + init_v3(); + init_asyncapi3(); + init_base(); + init_binding3(); + init_bindings3(); + init_channel_parameter3(); + init_channel_parameters3(); + init_channel3(); + init_channels3(); + init_collection(); + init_components3(); + init_contact3(); + init_correlation_id3(); + init_correlation_ids3(); + init_extension3(); + init_extensions3(); + init_external_docs3(); + init_info3(); + init_license3(); + init_message_example3(); + init_message_examples3(); + init_message_trait3(); + init_message_traits3(); + init_message3(); + init_messages3(); + init_oauth_flow3(); + init_oauth_flows3(); + init_operation_replies2(); + init_operation_reply_address2(); + init_operation_reply_addresses2(); + init_operation_reply2(); + init_operation_trait3(); + init_operation_traits3(); + init_operation3(); + init_operations3(); + init_schema6(); + init_schemas3(); + init_security_requirement3(); + init_security_requirements3(); + init_security_scheme3(); + init_security_schemes3(); + init_server_variable3(); + init_server_variables3(); + init_server3(); + init_servers3(); + init_tag3(); + init_tags4(); + } +}); + +// node_modules/@asyncapi/parser/esm/stringify.js +function stringify4(document2, options = {}) { + if (isAsyncAPIDocument(document2)) { + document2 = document2.json(); + } else if (isParsedDocument(document2)) { + if (isStringifiedDocument(document2)) { + return JSON.stringify(document2); + } + } else { + return; + } + return JSON.stringify(Object.assign(Object.assign({}, document2), { [String(xParserSpecStringified)]: true }), refReplacer(), options.space || 2); +} +function unstringify(document2) { + let parsed = document2; + if (typeof document2 === "string") { + try { + parsed = JSON.parse(document2); + } catch (_6) { + return; + } + } + if (!isStringifiedDocument(parsed)) { + return; + } + parsed = Object.assign({}, parsed); + delete parsed[String(xParserSpecStringified)]; + traverseStringifiedData(document2, void 0, document2, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return createAsyncAPIDocument(createDetailedAsyncAPI(parsed, document2)); +} +function copy(data) { + const stringifiedData = JSON.stringify(data, refReplacer()); + const unstringifiedData = JSON.parse(stringifiedData); + traverseStringifiedData(unstringifiedData, void 0, unstringifiedData, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return unstringifiedData; +} +function refReplacer() { + const modelPaths = /* @__PURE__ */ new Map(); + const paths = /* @__PURE__ */ new Map(); + let init2 = null; + return function(field, value2) { + const pathPart = modelPaths.get(this) + (Array.isArray(this) ? `[${field}]` : `.${field}`); + const isComplex = value2 === Object(value2); + if (isComplex) { + modelPaths.set(value2, pathPart); + } + const savedPath = paths.get(value2) || ""; + if (!savedPath && isComplex) { + const valuePath = pathPart.replace(/undefined\.\.?/, ""); + paths.set(value2, valuePath); + } + const prefixPath = savedPath[0] === "[" ? "$" : "$."; + let val = savedPath ? `$ref:${prefixPath}${savedPath}` : value2; + if (init2 === null) { + init2 = value2; + } else if (val === init2) { + val = "$ref:$"; + } + return val; + }; +} +function traverseStringifiedData(parent2, field, root2, objToPath, pathToObj) { + let objOrPath = parent2; + let path2 = refRoot; + if (field !== void 0) { + objOrPath = parent2[String(field)]; + const concatenatedPath = field ? `.${field}` : ""; + path2 = objToPath.get(parent2) + (Array.isArray(parent2) ? `[${field}]` : concatenatedPath); + } + objToPath.set(objOrPath, path2); + pathToObj.set(path2, objOrPath); + const ref = pathToObj.get(objOrPath); + if (ref) { + parent2[String(field)] = ref; + } + if (objOrPath === refRoot || ref === refRoot) { + parent2[String(field)] = root2; + } + if (objOrPath === Object(objOrPath)) { + for (const f8 in objOrPath) { + traverseStringifiedData(objOrPath, f8, root2, objToPath, pathToObj); + } + } +} +var refRoot; +var init_stringify2 = __esm({ + "node_modules/@asyncapi/parser/esm/stringify.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_document(); + init_utils2(); + init_constants(); + refRoot = "$ref:$"; + } +}); + +// node_modules/@asyncapi/parser/esm/document.js +function createAsyncAPIDocument(asyncapi) { + switch (asyncapi.semver.major) { + case 2: + return new AsyncAPIDocument(asyncapi.parsed, { asyncapi, pointer: "/" }); + case 3: + return new AsyncAPIDocument2(asyncapi.parsed, { asyncapi, pointer: "/" }); + default: + throw new Error(`Unsupported AsyncAPI version: ${asyncapi.semver.version}`); + } +} +function toAsyncAPIDocument(maybeDoc) { + if (isAsyncAPIDocument(maybeDoc)) { + return maybeDoc; + } + if (!isParsedDocument(maybeDoc)) { + return unstringify(maybeDoc); + } + return createAsyncAPIDocument(createDetailedAsyncAPI(maybeDoc, maybeDoc)); +} +function isAsyncAPIDocument(maybeDoc) { + if (!maybeDoc) { + return false; + } + if (maybeDoc instanceof AsyncAPIDocument || maybeDoc instanceof AsyncAPIDocument2) { + return true; + } + if (maybeDoc && typeof maybeDoc.json === "function") { + const versionOfParserAPI = maybeDoc.json()[xParserApiVersion]; + return versionOfParserAPI === ParserAPIVersion; + } + return false; +} +function isOldAsyncAPIDocument(maybeDoc) { + if (maybeDoc && typeof maybeDoc.json === "function") { + const versionOfParserAPI = maybeDoc.json()[xParserApiVersion]; + return versionOfParserAPI === void 0 || versionOfParserAPI === 0; + } + return false; +} +function isParsedDocument(maybeDoc) { + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed]); +} +function isStringifiedDocument(maybeDoc) { + try { + maybeDoc = typeof maybeDoc === "string" ? JSON.parse(maybeDoc) : maybeDoc; + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed]) && Boolean(maybeDoc[xParserSpecStringified]); + } catch (_6) { + return false; + } +} +var init_document = __esm({ + "node_modules/@asyncapi/parser/esm/document.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_models(); + init_stringify2(); + init_utils2(); + init_constants(); + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/apply-traits.js +function applyTraitsV2(asyncapi) { + applyAllTraitsV2(asyncapi, v2TraitPaths); +} +function applyAllTraitsV2(asyncapi, paths) { + const visited = /* @__PURE__ */ new Set(); + paths.forEach((path2) => { + JSONPath({ + path: path2, + json: asyncapi, + resultType: "value", + callback(value2) { + if (visited.has(value2)) { + return; + } + visited.add(value2); + applyTraitsToObjectV2(value2); + } + }); + }); +} +function applyTraitsToObjectV2(value2) { + if (Array.isArray(value2.traits)) { + for (const trait of value2.traits) { + for (const key in trait) { + value2[String(key)] = mergePatch(value2[String(key)], trait[String(key)]); + } + } + } +} +function applyTraitsV3(asyncapi) { + applyAllTraitsV3(asyncapi, v3TraitPaths); +} +function applyAllTraitsV3(asyncapi, paths) { + const visited = /* @__PURE__ */ new Set(); + paths.forEach((path2) => { + JSONPath({ + path: path2, + json: asyncapi, + resultType: "value", + callback(value2) { + if (visited.has(value2)) { + return; + } + visited.add(value2); + applyTraitsToObjectV3(value2); + } + }); + }); +} +function applyTraitsToObjectV3(value2) { + if (!Array.isArray(value2.traits)) { + return; + } + const copy4 = Object.assign({}, value2); + for (const key in value2) { + delete value2[key]; + } + for (const trait of [...copy4.traits, copy4]) { + for (const key in trait) { + value2[String(key)] = mergePatch(value2[String(key)], trait[String(key)]); + } + } +} +var v2TraitPaths, v3TraitPaths; +var init_apply_traits = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/apply-traits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_index_browser_esm(); + init_utils2(); + v2TraitPaths = [ + // operations + "$.channels.*.[publish,subscribe]", + "$.components.channels.*.[publish,subscribe]", + // messages + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" + ]; + v3TraitPaths = [ + // operations + "$.operations.*", + "$.operations.*.channel.messages.*", + "$.operations.*.messages.*", + "$.components.operations.*", + "$.components.operations.*.channel.messages.*", + "$.components.operations.*.messages.*", + // Channels + "$.channels.*.messages.*", + "$.components.channels.*.messages.*", + // messages + "$.components.messages.*" + ]; + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/resolve-circular-refs.js +function resolveCircularRefs(document2, inventory) { + const documentJson = document2.json(); + const ctx = { document: documentJson, hasCircular: false, inventory, visited: /* @__PURE__ */ new Set() }; + traverse(documentJson, [], null, "", ctx); + if (ctx.hasCircular) { + setExtension(xParserCircular, true, document2); + } +} +function traverse(data, path2, parent2, property2, ctx) { + if (typeof data !== "object" || !data || ctx.visited.has(data)) { + return; + } + ctx.visited.add(data); + if (Array.isArray(data)) { + data.forEach((item, idx) => traverse(item, [...path2, idx], data, idx, ctx)); + } + if ("$ref" in data) { + ctx.hasCircular = true; + const resolvedRef = retrieveCircularRef(data, path2, ctx); + if (resolvedRef) { + parent2[property2] = resolvedRef; + } + } else { + for (const p7 in data) { + traverse(data[p7], [...path2, p7], data, p7, ctx); + } + } + ctx.visited.delete(data); +} +function retrieveCircularRef(data, path2, ctx) { + const $refPath = toJSONPathArray(data.$ref); + const item = ctx.inventory.findAssociatedItemForPath(path2, true); + if (item === null) { + return retrieveDeepData(ctx.document, $refPath); + } + if (item) { + const subArrayIndex = findSubArrayIndex(path2, $refPath); + let dataPath; + if (subArrayIndex === -1) { + dataPath = [...path2.slice(0, path2.length - item.path.length), ...$refPath]; + } else { + dataPath = path2.slice(0, subArrayIndex + $refPath.length); + } + return retrieveDeepData(ctx.document, dataPath); + } +} +var init_resolve_circular_refs = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/resolve-circular-refs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_utils2(); + init_constants(); + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/parse-schema.js +function parseSchemasV2(parser3, detailed) { + return __awaiter9(this, void 0, void 0, function* () { + const defaultSchemaFormat = getDefaultSchemaFormat(detailed.semver.version); + const parseItems = []; + const visited = /* @__PURE__ */ new Set(); + customSchemasPathsV2.forEach((path2) => { + JSONPath({ + path: path2, + json: detailed.parsed, + resultType: "all", + callback(result2) { + const value2 = result2.value; + if (visited.has(value2)) { + return; + } + visited.add(value2); + const payload = value2.payload; + if (!payload) { + return; + } + const schemaFormat = getSchemaFormat(value2.schemaFormat, detailed.semver.version); + parseItems.push({ + input: { + asyncapi: detailed, + data: payload, + meta: { + message: value2 + }, + path: [...splitPath2(result2.path), "payload"], + schemaFormat, + defaultSchemaFormat + }, + value: value2 + }); + } + }); + }); + return Promise.all(parseItems.map((item) => parseSchemaV2(parser3, item))); + }); +} +function parseSchemasV3(parser3, detailed) { + return __awaiter9(this, void 0, void 0, function* () { + const defaultSchemaFormat = getDefaultSchemaFormat(detailed.semver.version); + const parseItems = []; + const visited = /* @__PURE__ */ new Set(); + customSchemasPathsV3.forEach((path2) => { + JSONPath({ + path: path2, + json: detailed.parsed, + resultType: "all", + callback(result2) { + const value2 = result2.value; + if (visited.has(value2)) { + return; + } + visited.add(value2); + const schema8 = value2.schema; + if (!schema8) { + return; + } + let schemaFormat = value2.schemaFormat; + if (!schemaFormat) { + return; + } + schemaFormat = getSchemaFormat(value2.schemaFormat, detailed.semver.version); + parseItems.push({ + input: { + asyncapi: detailed, + data: schema8, + meta: { + message: value2 + }, + path: [...splitPath2(result2.path), "schema"], + schemaFormat, + defaultSchemaFormat + }, + value: value2 + }); + } + }); + }); + return Promise.all(parseItems.map((item) => parseSchemaV3(parser3, item))); + }); +} +function parseSchemaV3(parser3, item) { + var _a2; + return __awaiter9(this, void 0, void 0, function* () { + const originalData = item.input.data; + const parsedData = yield parseSchema(parser3, item.input); + if (((_a2 = item.value) === null || _a2 === void 0 ? void 0 : _a2.schema) !== void 0) { + item.value.schema = parsedData; + } else { + item.value = parsedData; + } + if (originalData !== parsedData) { + item.value[xParserOriginalPayload] = originalData; + } + }); +} +function parseSchemaV2(parser3, item) { + return __awaiter9(this, void 0, void 0, function* () { + const originalData = item.input.data; + const parsedData = item.value.payload = yield parseSchema(parser3, item.input); + if (originalData !== parsedData) { + item.value[xParserOriginalPayload] = originalData; + } + }); +} +function splitPath2(path2) { + return path2.slice(3).slice(0, -2).split("']['"); +} +var __awaiter9, customSchemasPathsV2, customSchemasPathsV3; +var init_parse_schema = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/parse-schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_index_browser_esm(); + init_constants(); + init_schema_parser(); + __awaiter9 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + customSchemasPathsV2 = [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" + ]; + customSchemasPathsV3 = [ + // channels + "$.channels.*.messages.*.payload", + "$.channels.*.messages.*.headers", + "$.components.channels.*.messages.*.payload", + "$.components.channels.*.messages.*.headers", + // operations + "$.operations.*.messages.*.payload", + "$.operations.*.messages.*.headers", + "$.components.operations.*.messages.*.payload", + "$.components.operations.*.messages.*.headers", + // messages + "$.components.messages.*.payload", + "$.components.messages.*.headers.*", + // schemas + "$.components.schemas.*" + ]; + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/anonymous-naming.js +function anonymousNaming(document2) { + assignNameToComponentMessages(document2); + assignNameToAnonymousMessages(document2); + assignUidToComponentSchemas(document2); + assignUidToComponentParameterSchemas(document2); + assignUidToChannelParameterSchemas(document2); + assignUidToAnonymousSchemas(document2); +} +function assignNameToComponentMessages(document2) { + document2.components().messages().forEach((message) => { + if (message.name() === void 0) { + setExtension(xParserMessageName, message.id(), message); + } + }); +} +function assignNameToAnonymousMessages(document2) { + let anonymousMessageCounter = 0; + document2.messages().forEach((message) => { + var _a2; + if (message.name() === void 0 && ((_a2 = message.extensions().get(xParserMessageName)) === null || _a2 === void 0 ? void 0 : _a2.value()) === void 0) { + setExtension(xParserMessageName, message.id() || ``, message); + } + }); +} +function assignUidToComponentParameterSchemas(document2) { + document2.components().channelParameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension(xParserSchemaId, parameter.id(), schema8); + } + }); +} +function assignUidToChannelParameterSchemas(document2) { + document2.channels().forEach((channel) => { + channel.parameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension(xParserSchemaId, parameter.id(), schema8); + } + }); + }); +} +function assignUidToComponentSchemas(document2) { + document2.components().schemas().forEach((schema8) => { + setExtension(xParserSchemaId, schema8.id(), schema8); + }); +} +function assignUidToAnonymousSchemas(doc) { + let anonymousSchemaCounter = 0; + function callback(schema8) { + const json2 = schema8.json(); + const isMultiFormatSchema = json2.schema !== void 0; + const underlyingSchema = isMultiFormatSchema ? json2.schema : json2; + if (!schema8.id()) { + setExtensionOnJson(xParserSchemaId, ``, underlyingSchema); + } + } + traverseAsyncApiDocument(doc, callback); +} +var init_anonymous_naming = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/anonymous-naming.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_constants(); + init_iterator(); + init_utils2(); + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/check-circular-refs.js +function checkCircularRefs(document2) { + if (hasInlineRef(document2.json())) { + setExtension(xParserCircular, true, document2); + } +} +function hasInlineRef(data) { + if (data && typeof data === "object" && !Array.isArray(data)) { + if (Object.prototype.hasOwnProperty.call(data, "$ref")) { + return true; + } + for (const p7 in data) { + if (hasInlineRef(data[p7])) { + return true; + } + } + } + return false; +} +var init_check_circular_refs = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/check-circular-refs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_utils2(); + init_constants(); + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/apply-unique-ids.js +function applyUniqueIds(structure) { + const asyncapiVersion = structure.asyncapi.charAt(0); + switch (asyncapiVersion) { + case "3": + applyUniqueIdToChannels(structure.channels); + applyUniqueIdToObjects(structure.operations); + if (structure.components) { + applyUniqueIdToObjects(structure.components.messages); + applyUniqueIdToObjects(structure.components.operations); + applyUniqueIdToChannels(structure.components.channels); + } + break; + } +} +function applyUniqueIdToChannels(channels) { + for (const [channelId, channel] of Object.entries(channels !== null && channels !== void 0 ? channels : {})) { + if (!channel[xParserObjectUniqueId]) { + channel[xParserObjectUniqueId] = channelId; + } + applyUniqueIdToObjects(channel.messages); + } +} +function applyUniqueIdToObjects(objects) { + for (const [objectKey, object] of Object.entries(objects !== null && objects !== void 0 ? objects : {})) { + if (!object[xParserObjectUniqueId]) { + object[xParserObjectUniqueId] = objectKey; + } + } +} +var init_apply_unique_ids = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/apply-unique-ids.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_constants(); + } +}); + +// node_modules/@asyncapi/parser/esm/custom-operations/index.js +function customOperations(parser3, document2, detailed, inventory, options) { + return __awaiter10(this, void 0, void 0, function* () { + switch (detailed.semver.major) { + case 2: + return operationsV2(parser3, document2, detailed, inventory, options); + case 3: + return operationsV3(parser3, document2, detailed, inventory, options); + } + }); +} +function operationsV2(parser3, document2, detailed, inventory, options) { + return __awaiter10(this, void 0, void 0, function* () { + checkCircularRefs(document2); + if (options.applyTraits) { + applyTraitsV2(detailed.parsed); + } + if (options.parseSchemas) { + yield parseSchemasV2(parser3, detailed); + } + if (inventory) { + resolveCircularRefs(document2, inventory); + } + anonymousNaming(document2); + }); +} +function operationsV3(parser3, document2, detailed, inventory, options) { + return __awaiter10(this, void 0, void 0, function* () { + checkCircularRefs(document2); + if (options.applyTraits) { + applyTraitsV3(detailed.parsed); + } + if (options.parseSchemas) { + yield parseSchemasV3(parser3, detailed); + } + if (inventory) { + resolveCircularRefs(document2, inventory); + } + anonymousNaming(document2); + }); +} +var __awaiter10; +var init_custom_operations = __esm({ + "node_modules/@asyncapi/parser/esm/custom-operations/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_apply_traits(); + init_resolve_circular_refs(); + init_parse_schema(); + init_anonymous_naming(); + init_check_circular_refs(); + init_apply_unique_ids(); + __awaiter10 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@stoplight/spectral-functions/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports8 = {}; +__export(tslib_es6_exports8, { + __addDisposableResource: () => __addDisposableResource7, + __assign: () => __assign8, + __asyncDelegator: () => __asyncDelegator8, + __asyncGenerator: () => __asyncGenerator8, + __asyncValues: () => __asyncValues8, + __await: () => __await8, + __awaiter: () => __awaiter11, + __classPrivateFieldGet: () => __classPrivateFieldGet8, + __classPrivateFieldIn: () => __classPrivateFieldIn7, + __classPrivateFieldSet: () => __classPrivateFieldSet8, + __createBinding: () => __createBinding8, + __decorate: () => __decorate8, + __disposeResources: () => __disposeResources7, + __esDecorate: () => __esDecorate7, + __exportStar: () => __exportStar8, + __extends: () => __extends8, + __generator: () => __generator8, + __importDefault: () => __importDefault8, + __importStar: () => __importStar8, + __makeTemplateObject: () => __makeTemplateObject8, + __metadata: () => __metadata8, + __param: () => __param8, + __propKey: () => __propKey7, + __read: () => __read8, + __rest: () => __rest8, + __runInitializers: () => __runInitializers7, + __setFunctionName: () => __setFunctionName7, + __spread: () => __spread8, + __spreadArray: () => __spreadArray7, + __spreadArrays: () => __spreadArrays8, + __values: () => __values8, + default: () => tslib_es6_default7 +}); +function __extends8(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics8(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest8(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate8(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param8(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate7(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers7(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey7(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName7(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata8(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter11(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator8(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar8(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding8(o7, m7, p7); +} +function __values8(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read8(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread8() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read8(arguments[i7])); + return ar; +} +function __spreadArrays8() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray7(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await8(v8) { + return this instanceof __await8 ? (this.v = v8, this) : new __await8(v8); +} +function __asyncGenerator8(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await8 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator8(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await8(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues8(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values8 === "function" ? __values8(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject8(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar8(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding8(result2, mod2, k6); + } + __setModuleDefault7(result2, mod2); + return result2; +} +function __importDefault8(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet8(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet8(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn7(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); +} +function __addDisposableResource7(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources7(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError7(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics8, __assign8, __createBinding8, __setModuleDefault7, _SuppressedError7, tslib_es6_default7; +var init_tslib_es68 = __esm({ + "node_modules/@stoplight/spectral-functions/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics8 = function(d7, b8) { + extendStatics8 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics8(d7, b8); + }; + __assign8 = function() { + __assign8 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign8.apply(this, arguments); + }; + __createBinding8 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault7 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError7 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default7 = { + __extends: __extends8, + __assign: __assign8, + __rest: __rest8, + __decorate: __decorate8, + __param: __param8, + __metadata: __metadata8, + __awaiter: __awaiter11, + __generator: __generator8, + __createBinding: __createBinding8, + __exportStar: __exportStar8, + __values: __values8, + __read: __read8, + __spread: __spread8, + __spreadArrays: __spreadArrays8, + __spreadArray: __spreadArray7, + __await: __await8, + __asyncGenerator: __asyncGenerator8, + __asyncDelegator: __asyncDelegator8, + __asyncValues: __asyncValues8, + __makeTemplateObject: __makeTemplateObject8, + __importStar: __importStar8, + __importDefault: __importDefault8, + __classPrivateFieldGet: __classPrivateFieldGet8, + __classPrivateFieldSet: __classPrivateFieldSet8, + __classPrivateFieldIn: __classPrivateFieldIn7, + __addDisposableResource: __addDisposableResource7, + __disposeResources: __disposeResources7 + }; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/types.js +var require_types6 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.CasingType = void 0; + var CasingType; + (function(CasingType2) { + CasingType2["flat"] = "flat"; + CasingType2["camel"] = "camel"; + CasingType2["pascal"] = "pascal"; + CasingType2["kebab"] = "kebab"; + CasingType2["cobol"] = "cobol"; + CasingType2["snake"] = "snake"; + CasingType2["macro"] = "macro"; + })(CasingType = exports28.CasingType || (exports28.CasingType = {})); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/optionSchemas.js +var require_optionSchemas = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/optionSchemas.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.optionSchemas = void 0; + var types_1 = require_types6(); + exports28.optionSchemas = { + alphabetical: { + type: ["object", "null"], + properties: { + keyedBy: { + type: "string", + description: "The key to sort an object by." + } + }, + additionalProperties: false, + errorMessage: { + type: `"alphabetical" function has invalid options specified. Example valid options: null (no options), { "keyedBy": "my-key" }` + } + }, + casing: { + required: ["type"], + type: "object", + properties: { + type: { + type: "string", + enum: Object.values(types_1.CasingType), + errorMessage: `"casing" function and its "type" option accept the following values: ${Object.values(types_1.CasingType).join(", ")}`, + description: "The casing type to match against." + }, + disallowDigits: { + type: "boolean", + default: false, + description: "If not true, digits are allowed." + }, + separator: { + type: "object", + required: ["char"], + additionalProperties: false, + properties: { + char: { + type: "string", + maxLength: 1, + errorMessage: `"casing" function and its "separator.char" option accepts only char, i.e. "I" or "/"`, + description: "The additional char to separate groups of words." + }, + allowLeading: { + type: "boolean", + description: "Can the group separator char be used at the first char?" + } + } + } + }, + additionalProperties: false, + errorMessage: { + type: `"casing" function has invalid options specified. Example valid options: { "type": "camel" }, { "type": "pascal", "disallowDigits": true }` + } + }, + defined: null, + enumeration: { + type: "object", + additionalProperties: false, + properties: { + values: { + type: "array", + items: { + type: ["string", "number", "null", "boolean"] + }, + errorMessage: '"enumeration" and its "values" option support only arrays of primitive values, i.e. ["Berlin", "London", "Paris"]', + description: "An array of possible values." + } + }, + required: ["values"], + errorMessage: { + type: `"enumeration" function has invalid options specified. Example valid options: { "values": ["Berlin", "London", "Paris"] }, { "values": [2, 3, 5, 8, 13, 21] }` + } + }, + falsy: null, + length: { + type: "object", + properties: { + min: { + type: "number", + description: "The minimum length to match." + }, + max: { + type: "number", + description: "The maximum length to match." + } + }, + minProperties: 1, + additionalProperties: false, + errorMessage: { + type: `"length" function has invalid options specified. Example valid options: { "min": 2 }, { "max": 5 }, { "min": 0, "max": 10 }` + } + }, + pattern: { + type: "object", + additionalProperties: false, + properties: { + match: { + anyOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + exec: {}, + test: {}, + flags: { + type: "string" + } + }, + required: ["test", "flags"], + "x-internal": true + } + ], + errorMessage: `"pattern" function and its "match" option must be string or RegExp instance`, + description: "If provided, value must match this regex." + }, + notMatch: { + anyOf: [ + { + type: "string" + }, + { + type: "object", + properties: { + exec: {}, + test: {}, + flags: { + type: "string" + } + }, + required: ["test", "flags"], + "x-internal": true + } + ], + errorMessage: `"pattern" function and its "notMatch" option must be string or RegExp instance`, + description: "If provided, value must _not_ match this regex." + } + }, + minProperties: 1, + errorMessage: { + type: `"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }`, + minProperties: `"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }` + } + }, + truthy: null, + undefined: null, + schema: { + additionalProperties: false, + properties: { + schema: { + type: "object", + description: "Any valid JSON Schema document." + }, + dialect: { + enum: ["auto", "draft4", "draft6", "draft7", "draft2019-09", "draft2020-12"], + default: "auto", + description: "The JSON Schema draft used by function." + }, + allErrors: { + type: "boolean", + default: false, + description: "Returns all errors when true; otherwise only returns the first error." + }, + prepareResults: { + "x-internal": true + } + }, + required: ["schema"], + type: "object", + errorMessage: { + type: '"schema" function has invalid options specified. Example valid options: { "schema": { /* any JSON Schema can be defined here */ } , { "schema": { "type": "object" }, "dialect": "auto" }' + } + }, + unreferencedReusableObject: { + type: "object", + properties: { + reusableObjectsLocation: { + type: "string", + format: "json-pointer-uri-fragment", + errorMessage: '"unreferencedReusableObject" and its "reusableObjectsLocation" option support only valid JSON Pointer fragments, i.e. "#", "#/foo", "#/paths/~1user"', + description: "A local json pointer to the document member holding the reusable objects (eg. #/definitions for an OAS2 document, #/components/schemas for an OAS3 document)." + } + }, + additionalProperties: false, + required: ["reusableObjectsLocation"], + errorMessage: { + type: '"unreferencedReusableObject" function has invalid options specified. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }', + required: '"unreferencedReusableObject" function is missing "reusableObjectsLocation" option. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }' + } + }, + xor: { + type: "object", + properties: { + properties: { + type: "array", + items: { + type: "string" + }, + minItems: 2, + maxItems: 2, + errorMessage: `"xor" and its "properties" option support 2-item tuples, i.e. ["id", "name"]`, + description: "The properties to check." + } + }, + additionalProperties: false, + required: ["properties"], + errorMessage: { + type: `"xor" function has invalid options specified. Example valid options: { "properties": ["id", "name"] }, { "properties": ["country", "street"] }` + } + } + }; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/alphabetical.js +var require_alphabetical = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/alphabetical.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var optionSchemas_1 = require_optionSchemas(); + var compare = (a7, b8) => { + if ((typeof a7 === "number" || Number.isNaN(Number(a7))) && (typeof b8 === "number" || !Number.isNaN(Number(b8)))) { + return Math.min(1, Math.max(-1, Number(a7) - Number(b8))); + } + if (typeof a7 !== "string" || typeof b8 !== "string") { + return 0; + } + return a7.localeCompare(b8); + }; + var getUnsortedItems = (arr, compareFn) => { + for (let i7 = 0; i7 < arr.length - 1; i7 += 1) { + if (compareFn(arr[i7], arr[i7 + 1]) >= 1) { + return [i7, i7 + 1]; + } + } + return null; + }; + function isStringOrNumber(maybeStringOrNumber) { + return typeof maybeStringOrNumber === "string" || typeof maybeStringOrNumber === "number"; + } + function isValidArray(arr) { + return arr.every(isStringOrNumber); + } + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: ["object", "array"] + }, + options: optionSchemas_1.optionSchemas.alphabetical + }, function alphabetical(targetVal, opts, { path: path2, documentInventory }) { + var _a2, _b; + let targetArray; + if (Array.isArray(targetVal)) { + targetArray = targetVal; + } else { + targetArray = Object.keys((_b = (_a2 = documentInventory.findAssociatedItemForPath(path2, true)) === null || _a2 === void 0 ? void 0 : _a2.document.trapAccess(targetVal)) !== null && _b !== void 0 ? _b : targetVal); + } + if (targetArray.length < 2) { + return; + } + const keyedBy = opts === null || opts === void 0 ? void 0 : opts.keyedBy; + if (keyedBy !== void 0) { + const _targetArray = []; + for (const item of targetArray) { + if (!(0, lodash_1.isObject)(item)) { + return [ + { + message: '#{{print("property")}}must be an object' + } + ]; + } + _targetArray.push(item[keyedBy]); + } + targetArray = _targetArray; + } + if (!isValidArray(targetArray)) { + return [ + { + message: '#{{print("property")}}must be one of the allowed types: number, string' + } + ]; + } + const unsortedItems = getUnsortedItems(targetArray, compare); + if (unsortedItems != null) { + return [ + { + ...keyedBy === void 0 ? { + path: [...path2, Array.isArray(targetVal) ? unsortedItems[0] : targetArray[unsortedItems[0]]] + } : null, + message: keyedBy !== void 0 ? "properties must follow the alphabetical order" : `${(0, spectral_runtime_1.printValue)(targetArray[unsortedItems[0]])} must be placed after ${(0, spectral_runtime_1.printValue)(targetArray[unsortedItems[1]])}` + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/casing.js +var require_casing = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/casing.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.CasingType = void 0; + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var spectral_core_1 = require_dist11(); + var optionSchemas_1 = require_optionSchemas(); + var types_1 = require_types6(); + Object.defineProperty(exports28, "CasingType", { enumerable: true, get: function() { + return types_1.CasingType; + } }); + var CASES = { + [types_1.CasingType.flat]: "[a-z][a-z{__DIGITS__}]*", + [types_1.CasingType.camel]: "[a-z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*", + [types_1.CasingType.pascal]: "[A-Z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*", + [types_1.CasingType.kebab]: "[a-z][a-z{__DIGITS__}]*(?:-[a-z{__DIGITS__}]+)*", + [types_1.CasingType.cobol]: "[A-Z][A-Z{__DIGITS__}]*(?:-[A-Z{__DIGITS__}]+)*", + [types_1.CasingType.snake]: "[a-z][a-z{__DIGITS__}]*(?:_[a-z{__DIGITS__}]+)*", + [types_1.CasingType.macro]: "[A-Z][A-Z{__DIGITS__}]*(?:_[A-Z{__DIGITS__}]+)*" + }; + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: "string", + minLength: 1 + }, + options: optionSchemas_1.optionSchemas.casing + }, function casing(targetVal, opts) { + if (targetVal.length === 1 && opts.separator !== void 0 && opts.separator.allowLeading === true && targetVal === opts.separator.char) { + return; + } + const casingValidator = buildFrom(CASES[opts.type], opts); + if (casingValidator.test(targetVal)) { + return; + } + return [ + { + message: `must be ${opts.type} case` + } + ]; + }); + var DIGITS_PATTERN = "0-9"; + var buildFrom = (basePattern, overrides) => { + const injectDigits = overrides.disallowDigits !== true; + const pattern5 = basePattern.replace(/\{__DIGITS__\}/g, injectDigits ? DIGITS_PATTERN : ""); + if (overrides.separator === void 0) { + return new RegExp(`^${pattern5}$`); + } + const separatorPattern = `[${(0, lodash_1.escapeRegExp)(overrides.separator.char)}]`; + const leadingSeparatorPattern = overrides.separator.allowLeading === true ? `${separatorPattern}?` : ""; + return new RegExp(`^${leadingSeparatorPattern}${pattern5}(?:${separatorPattern}${pattern5})*$`); + }; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/defined.js +var require_defined = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/defined.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: null, + options: optionSchemas_1.optionSchemas.defined + }, function defined(input) { + if (typeof input === "undefined") { + return [ + { + message: '#{{print("property")}}must be defined' + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/enumeration.js +var require_enumeration = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/enumeration.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: ["string", "number", "null", "boolean"] + }, + options: optionSchemas_1.optionSchemas.enumeration + }, function enumeration(targetVal, { values: values2 }) { + if (!values2.includes(targetVal)) { + return [ + { + message: `#{{print("value")}} must be equal to one of the allowed values: ${values2.map(spectral_runtime_1.printValue).join(", ")}` + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/falsy.js +var require_falsy = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/falsy.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: null, + options: optionSchemas_1.optionSchemas.falsy + }, function falsy(input) { + if (input) { + return [ + { + message: '#{{print("property")}}must be falsy' + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/length.js +var require_length = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/length.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: ["array", "object", "string", "number"] + }, + options: optionSchemas_1.optionSchemas.length + }, function length(targetVal, opts) { + let value2; + if ((0, json_1.isPlainObject)(targetVal)) { + value2 = Object.keys(targetVal).length; + } else if (Array.isArray(targetVal)) { + value2 = targetVal.length; + } else if (typeof targetVal === "number") { + value2 = targetVal; + } else { + value2 = targetVal.length; + } + let results; + if ("min" in opts && value2 < opts.min) { + results = [ + { + message: `#{{print("property")}}must be longer than ${(0, spectral_runtime_1.printValue)(opts.min)}` + } + ]; + } + if ("max" in opts && value2 > opts.max) { + (results !== null && results !== void 0 ? results : results = []).push({ + message: `#{{print("property")}}must be shorter than ${(0, spectral_runtime_1.printValue)(opts.max)}` + }); + } + return results; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/pattern.js +var require_pattern3 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/pattern.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var optionSchemas_1 = require_optionSchemas(); + var REGEXP_PATTERN = /^\/(.+)\/([a-z]*)$/; + var cache = /* @__PURE__ */ new Map(); + function getFromCache(pattern5) { + const existingPattern = cache.get(pattern5); + if (existingPattern !== void 0) { + existingPattern.lastIndex = 0; + return existingPattern; + } + const newPattern = createRegex(pattern5); + cache.set(pattern5, newPattern); + return newPattern; + } + function createRegex(pattern5) { + const splitRegex = REGEXP_PATTERN.exec(pattern5); + if (splitRegex !== null) { + return new RegExp(splitRegex[1], splitRegex[2]); + } else { + return new RegExp(pattern5); + } + } + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: "string" + }, + options: optionSchemas_1.optionSchemas.pattern + }, function pattern5(targetVal, opts) { + let results; + if ("match" in opts) { + const pattern6 = getFromCache(opts.match); + if (!pattern6.test(targetVal)) { + results = [ + { + message: `#{{print("value")}} must match the pattern ${(0, spectral_runtime_1.printValue)(opts.match)}` + } + ]; + } + } + if ("notMatch" in opts) { + const pattern6 = getFromCache(opts.notMatch); + if (pattern6.test(targetVal)) { + (results !== null && results !== void 0 ? results : results = []).push({ + message: `#{{print("value")}} must not match the pattern ${(0, spectral_runtime_1.printValue)(opts.notMatch)}` + }); + } + } + return results; + }); + } +}); + +// node_modules/@stoplight/better-ajv-errors/dist/index.js +var require_dist12 = __commonJS({ + "node_modules/@stoplight/better-ajv-errors/dist/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var pointer = require_jsonpointer(); + var leven = require_leven(); + function _interopDefaultLegacy(e10) { + return e10 && typeof e10 === "object" && "default" in e10 ? e10 : { "default": e10 }; + } + var pointer__default = /* @__PURE__ */ _interopDefaultLegacy(pointer); + var leven__default = /* @__PURE__ */ _interopDefaultLegacy(leven); + var eq2 = (x7) => (y7) => x7 === y7; + var not = (fn) => (x7) => !fn(x7); + var getValues = ( + /*::*/ + (o7) => Object.values(o7) + ); + var notUndefined = (x7) => x7 !== void 0; + var isXError = (x7) => (error2) => error2.keyword === x7; + var isAnyOfError = isXError("anyOf"); + var isEnumError = isXError("enum"); + var getErrors = (node) => node && node.errors || []; + var getChildren = (node) => node && getValues(node.children) || []; + var getSiblings = (parent2) => (node) => getChildren(parent2).filter(not(eq2(node))); + var concatAll = ( + /*::*/ + (xs) => (ys) => ys.reduce((zs, z6) => zs.concat(z6), xs) + ); + function getLastSegment(instancePath) { + const index5 = instancePath.lastIndexOf("/"); + if (index5 !== -1) { + return instancePath.slice(index5 + 1); + } + return null; + } + var QUOTES = /['"]/g; + var NOT = /NOT/g; + var FIRST_LETTER = /^[a-z]/; + function cleanAjvMessage(word) { + return word.replace(QUOTES, '"').replace(NOT, "not"); + } + function toUpperCase(word) { + return word.toUpperCase(); + } + function capitalize2(word) { + return word.replace(FIRST_LETTER, toUpperCase); + } + var BaseValidationError = class { + constructor(options = { isIdentifierLocation: false }, { data, schema: schema8, propPath }) { + this.options = options; + this.data = data; + this.schema = schema8; + this.propPath = propPath; + } + getError() { + throw new Error( + `Implement the 'getError' method inside ${this.constructor.name}!` + ); + } + getPrettyPropertyName(dataPath) { + const propName2 = this.getPropertyName(dataPath); + if (propName2 === null) { + return capitalize2(typeof this.getPropertyValue(dataPath)); + } + return `"${propName2}" property`; + } + getPropertyName(path2) { + const propName2 = getLastSegment(path2); + if (propName2 !== null) { + return propName2; + } + if (this.propPath.length === 0) { + return null; + } + return this.propPath[this.propPath.length - 1]; + } + getPropertyValue(path2) { + return path2 === "" ? this.data : pointer__default["default"].get(this.data, path2); + } + }; + var RequiredValidationError = class extends BaseValidationError { + getError() { + const { message, instancePath } = this.options; + return { + error: `${this.getPrettyPropertyName(instancePath)} ${cleanAjvMessage( + message + )}`, + path: instancePath + }; + } + }; + var AdditionalPropValidationError = class extends BaseValidationError { + constructor(...args) { + super(...args); + } + getError() { + const { params, instancePath } = this.options; + return { + error: `Property "${params.additionalProperty}" is not expected to be here`, + path: instancePath + }; + } + }; + var EnumValidationError = class extends BaseValidationError { + getError() { + const { message, instancePath, params } = this.options; + const bestMatch = this.findBestMatch(); + const output = { + error: `${this.getPrettyPropertyName( + instancePath + )} ${message}: ${params.allowedValues.map( + (value2) => typeof value2 === "string" ? `"${value2}"` : JSON.stringify(value2) + ).join(", ")}`, + path: instancePath + }; + if (bestMatch !== null) { + output.suggestion = `Did you mean "${bestMatch}"?`; + } + return output; + } + findBestMatch() { + const { + instancePath, + params: { allowedValues } + } = this.options; + const currentValue = this.getPropertyValue(instancePath); + if (typeof currentValue !== "string") { + return null; + } + const matches2 = allowedValues.filter((value2) => typeof value2 === "string").map((value2) => ({ + value: value2, + weight: leven__default["default"](value2, currentValue.toString()) + })).sort((x7, y7) => x7.weight > y7.weight ? 1 : x7.weight < y7.weight ? -1 : 0); + if (matches2.length === 0) { + return null; + } + const bestMatch = matches2[0]; + return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null; + } + }; + var DefaultValidationError = class extends BaseValidationError { + getError() { + const { message, instancePath } = this.options; + return { + error: `${this.getPrettyPropertyName(instancePath)} ${cleanAjvMessage( + message + )}`, + path: instancePath + }; + } + }; + var TypeValidationError = class extends BaseValidationError { + getError() { + const { message, instancePath } = this.options; + const propertyName = this.getPropertyName(instancePath); + return { + error: propertyName === null ? `Value type ${message}` : `"${propertyName}" property type ${message}`, + path: instancePath + }; + } + }; + var ErrorMessageError = class extends BaseValidationError { + getError() { + const { message, instancePath } = this.options; + return { + error: message, + path: instancePath + }; + } + }; + var JSON_POINTERS_REGEX = /\/[\w$_-]+(\/\d+)?/g; + function makeTree(ajvErrors5 = []) { + const root2 = { children: {} }; + ajvErrors5.forEach((ajvError) => { + const { instancePath } = ajvError; + const paths = instancePath === "" ? [""] : instancePath.match(JSON_POINTERS_REGEX); + paths && paths.reduce((obj, path2, i7) => { + obj.children[path2] = obj.children[path2] || { children: {}, errors: [] }; + if (i7 === paths.length - 1) { + obj.children[path2].errors.push(ajvError); + } + return obj.children[path2]; + }, root2); + }); + return root2; + } + function filterRedundantErrors(root2, parent2, key) { + if (getErrors(root2).some(isAnyOfError)) { + if (Object.keys(root2.children).length > 0) { + delete root2.errors; + } + } + if (root2.errors && root2.errors.length && getErrors(root2).every(isEnumError)) { + if (getSiblings(parent2)(root2).filter(notUndefined).some(getErrors)) { + delete parent2.children[key]; + } + } + Object.entries(root2.children).forEach( + ([key2, child]) => filterRedundantErrors(child, root2, key2) + ); + } + function createErrorInstances(root2, options) { + const errors = getErrors(root2); + if (errors.length && errors.every(isEnumError)) { + const uniqueValues = new Set( + concatAll([])(errors.map((e10) => e10.params.allowedValues)) + ); + const allowedValues = [...uniqueValues]; + const error2 = errors[0]; + return [ + new EnumValidationError( + { + ...error2, + params: { allowedValues } + }, + options + ) + ]; + } else { + return concatAll( + errors.reduce((ret, error2) => { + switch (error2.keyword) { + case "additionalProperties": + return ret.concat( + new AdditionalPropValidationError(error2, options) + ); + case "required": + return ret.concat(new RequiredValidationError(error2, options)); + case "type": + return ret.concat(new TypeValidationError(error2, options)); + case "errorMessage": + return ret.concat(new ErrorMessageError(error2, options)); + default: + return ret.concat(new DefaultValidationError(error2, options)); + } + }, []) + )(getChildren(root2).map((child) => createErrorInstances(child, options))); + } + } + var prettify2 = (ajvErrors5, options) => { + const tree = makeTree(ajvErrors5 || []); + filterRedundantErrors(tree); + return createErrorInstances(tree, options); + }; + var customErrorToStructure = (error2) => error2.getError(); + var index4 = (schema8, errors, { propertyPath, targetValue }) => { + const customErrors = prettify2(errors, { + data: targetValue, + schema: schema8, + propPath: propertyPath + }); + return customErrors.map(customErrorToStructure); + }; + module5.exports = index4; + } +}); + +// node_modules/@stoplight/spectral-formats/node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports9 = {}; +__export(tslib_es6_exports9, { + __addDisposableResource: () => __addDisposableResource8, + __assign: () => __assign9, + __asyncDelegator: () => __asyncDelegator9, + __asyncGenerator: () => __asyncGenerator9, + __asyncValues: () => __asyncValues9, + __await: () => __await9, + __awaiter: () => __awaiter12, + __classPrivateFieldGet: () => __classPrivateFieldGet9, + __classPrivateFieldIn: () => __classPrivateFieldIn8, + __classPrivateFieldSet: () => __classPrivateFieldSet9, + __createBinding: () => __createBinding9, + __decorate: () => __decorate9, + __disposeResources: () => __disposeResources8, + __esDecorate: () => __esDecorate8, + __exportStar: () => __exportStar9, + __extends: () => __extends9, + __generator: () => __generator9, + __importDefault: () => __importDefault9, + __importStar: () => __importStar9, + __makeTemplateObject: () => __makeTemplateObject9, + __metadata: () => __metadata9, + __param: () => __param9, + __propKey: () => __propKey8, + __read: () => __read9, + __rest: () => __rest9, + __runInitializers: () => __runInitializers8, + __setFunctionName: () => __setFunctionName8, + __spread: () => __spread9, + __spreadArray: () => __spreadArray8, + __spreadArrays: () => __spreadArrays9, + __values: () => __values9, + default: () => tslib_es6_default8 +}); +function __extends9(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics9(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); +} +function __rest9(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +} +function __decorate9(decorators, target, key, desc) { + var c7 = arguments.length, r8 = c7 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r8 = Reflect.decorate(decorators, target, key, desc); + else + for (var i7 = decorators.length - 1; i7 >= 0; i7--) + if (d7 = decorators[i7]) + r8 = (c7 < 3 ? d7(r8) : c7 > 3 ? d7(target, key, r8) : d7(target, key)) || r8; + return c7 > 3 && r8 && Object.defineProperty(target, key, r8), r8; +} +function __param9(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate8(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f8) { + if (f8 !== void 0 && typeof f8 !== "function") + throw new TypeError("Function expected"); + return f8; + } + 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 _6, done = false; + for (var i7 = decorators.length - 1; i7 >= 0; i7--) { + var context2 = {}; + for (var p7 in contextIn) + context2[p7] = p7 === "access" ? {} : contextIn[p7]; + for (var p7 in contextIn.access) + context2.access[p7] = contextIn.access[p7]; + context2.addInitializer = function(f8) { + if (done) + throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f8 || null)); + }; + var result2 = (0, decorators[i7])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result2 === void 0) + continue; + if (result2 === null || typeof result2 !== "object") + throw new TypeError("Object expected"); + if (_6 = accept(result2.get)) + descriptor.get = _6; + if (_6 = accept(result2.set)) + descriptor.set = _6; + if (_6 = accept(result2.init)) + initializers.unshift(_6); + } else if (_6 = accept(result2)) { + if (kind === "field") + initializers.unshift(_6); + else + descriptor[key] = _6; + } + } + if (target) + Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers8(thisArg, initializers, value2) { + var useValue = arguments.length > 2; + for (var i7 = 0; i7 < initializers.length; i7++) { + value2 = useValue ? initializers[i7].call(thisArg, value2) : initializers[i7].call(thisArg); + } + return useValue ? value2 : void 0; +} +function __propKey8(x7) { + return typeof x7 === "symbol" ? x7 : "".concat(x7); +} +function __setFunctionName8(f8, name2, prefix) { + if (typeof name2 === "symbol") + name2 = name2.description ? "[".concat(name2.description, "]") : ""; + return Object.defineProperty(f8, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name2) : name2 }); +} +function __metadata9(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter12(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator9(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } +} +function __exportStar9(m7, o7) { + for (var p7 in m7) + if (p7 !== "default" && !Object.prototype.hasOwnProperty.call(o7, p7)) + __createBinding9(o7, m7, p7); +} +function __values9(o7) { + var s7 = typeof Symbol === "function" && Symbol.iterator, m7 = s7 && o7[s7], i7 = 0; + if (m7) + return m7.call(o7); + if (o7 && typeof o7.length === "number") + return { + next: function() { + if (o7 && i7 >= o7.length) + o7 = void 0; + return { value: o7 && o7[i7++], done: !o7 }; + } + }; + throw new TypeError(s7 ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read9(o7, n7) { + var m7 = typeof Symbol === "function" && o7[Symbol.iterator]; + if (!m7) + return o7; + var i7 = m7.call(o7), r8, ar = [], e10; + try { + while ((n7 === void 0 || n7-- > 0) && !(r8 = i7.next()).done) + ar.push(r8.value); + } catch (error2) { + e10 = { error: error2 }; + } finally { + try { + if (r8 && !r8.done && (m7 = i7["return"])) + m7.call(i7); + } finally { + if (e10) + throw e10.error; + } + } + return ar; +} +function __spread9() { + for (var ar = [], i7 = 0; i7 < arguments.length; i7++) + ar = ar.concat(__read9(arguments[i7])); + return ar; +} +function __spreadArrays9() { + for (var s7 = 0, i7 = 0, il = arguments.length; i7 < il; i7++) + s7 += arguments[i7].length; + for (var r8 = Array(s7), k6 = 0, i7 = 0; i7 < il; i7++) + for (var a7 = arguments[i7], j6 = 0, jl = a7.length; j6 < jl; j6++, k6++) + r8[k6] = a7[j6]; + return r8; +} +function __spreadArray8(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await9(v8) { + return this instanceof __await9 ? (this.v = v8, this) : new __await9(v8); +} +function __asyncGenerator9(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g7 = generator.apply(thisArg, _arguments || []), i7, q5 = []; + return i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7; + function verb(n7) { + if (g7[n7]) + i7[n7] = function(v8) { + return new Promise(function(a7, b8) { + q5.push([n7, v8, a7, b8]) > 1 || resume(n7, v8); + }); + }; + } + function resume(n7, v8) { + try { + step(g7[n7](v8)); + } catch (e10) { + settle(q5[0][3], e10); + } + } + function step(r8) { + r8.value instanceof __await9 ? Promise.resolve(r8.value.v).then(fulfill, reject2) : settle(q5[0][2], r8); + } + function fulfill(value2) { + resume("next", value2); + } + function reject2(value2) { + resume("throw", value2); + } + function settle(f8, v8) { + if (f8(v8), q5.shift(), q5.length) + resume(q5[0][0], q5[0][1]); + } +} +function __asyncDelegator9(o7) { + var i7, p7; + return i7 = {}, verb("next"), verb("throw", function(e10) { + throw e10; + }), verb("return"), i7[Symbol.iterator] = function() { + return this; + }, i7; + function verb(n7, f8) { + i7[n7] = o7[n7] ? function(v8) { + return (p7 = !p7) ? { value: __await9(o7[n7](v8)), done: false } : f8 ? f8(v8) : v8; + } : f8; + } +} +function __asyncValues9(o7) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m7 = o7[Symbol.asyncIterator], i7; + return m7 ? m7.call(o7) : (o7 = typeof __values9 === "function" ? __values9(o7) : o7[Symbol.iterator](), i7 = {}, verb("next"), verb("throw"), verb("return"), i7[Symbol.asyncIterator] = function() { + return this; + }, i7); + function verb(n7) { + i7[n7] = o7[n7] && function(v8) { + return new Promise(function(resolve3, reject2) { + v8 = o7[n7](v8), settle(resolve3, reject2, v8.done, v8.value); + }); + }; + } + function settle(resolve3, reject2, d7, v8) { + Promise.resolve(v8).then(function(v9) { + resolve3({ value: v9, done: d7 }); + }, reject2); + } +} +function __makeTemplateObject9(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; +} +function __importStar9(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding9(result2, mod2, k6); + } + __setModuleDefault8(result2, mod2); + return result2; +} +function __importDefault9(mod2) { + return mod2 && mod2.__esModule ? mod2 : { default: mod2 }; +} +function __classPrivateFieldGet9(receiver, state, kind, f8) { + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f8 : kind === "a" ? f8.call(receiver) : f8 ? f8.value : state.get(receiver); +} +function __classPrivateFieldSet9(receiver, state, value2, kind, f8) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f8) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f8 : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f8.call(receiver, value2) : f8 ? f8.value = value2 : state.set(receiver, value2), value2; +} +function __classPrivateFieldIn8(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); +} +function __addDisposableResource8(env3, value2, async) { + if (value2 !== null && value2 !== void 0) { + if (typeof value2 !== "object" && typeof value2 !== "function") + throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) + throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value2[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) + throw new TypeError("Symbol.dispose is not defined."); + dispose = value2[Symbol.dispose]; + } + if (typeof dispose !== "function") + throw new TypeError("Object not disposable."); + env3.stack.push({ value: value2, dispose, async }); + } else if (async) { + env3.stack.push({ async: true }); + } + return value2; +} +function __disposeResources8(env3) { + function fail2(e10) { + env3.error = env3.hasError ? new _SuppressedError8(e10, env3.error, "An error was suppressed during disposal.") : e10; + env3.hasError = true; + } + function next() { + while (env3.stack.length) { + var rec = env3.stack.pop(); + try { + var result2 = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) + return Promise.resolve(result2).then(next, function(e10) { + fail2(e10); + return next(); + }); + } catch (e10) { + fail2(e10); + } + } + if (env3.hasError) + throw env3.error; + } + return next(); +} +var extendStatics9, __assign9, __createBinding9, __setModuleDefault8, _SuppressedError8, tslib_es6_default8; +var init_tslib_es69 = __esm({ + "node_modules/@stoplight/spectral-formats/node_modules/tslib/tslib.es6.mjs"() { + init_dirname(); + init_buffer2(); + init_process2(); + extendStatics9 = function(d7, b8) { + extendStatics9 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics9(d7, b8); + }; + __assign9 = function() { + __assign9 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign9.apply(this, arguments); + }; + __createBinding9 = Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }; + __setModuleDefault8 = Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }; + _SuppressedError8 = typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message) { + var e10 = new Error(message); + return e10.name = "SuppressedError", e10.error = error2, e10.suppressed = suppressed, e10; + }; + tslib_es6_default8 = { + __extends: __extends9, + __assign: __assign9, + __rest: __rest9, + __decorate: __decorate9, + __param: __param9, + __metadata: __metadata9, + __awaiter: __awaiter12, + __generator: __generator9, + __createBinding: __createBinding9, + __exportStar: __exportStar9, + __values: __values9, + __read: __read9, + __spread: __spread9, + __spreadArrays: __spreadArrays9, + __spreadArray: __spreadArray8, + __await: __await9, + __asyncGenerator: __asyncGenerator9, + __asyncDelegator: __asyncDelegator9, + __asyncValues: __asyncValues9, + __makeTemplateObject: __makeTemplateObject9, + __importStar: __importStar9, + __importDefault: __importDefault9, + __classPrivateFieldGet: __classPrivateFieldGet9, + __classPrivateFieldSet: __classPrivateFieldSet9, + __classPrivateFieldIn: __classPrivateFieldIn8, + __addDisposableResource: __addDisposableResource8, + __disposeResources: __disposeResources8 + }; + } +}); + +// node_modules/@stoplight/spectral-formats/dist/openapi.js +var require_openapi = __commonJS({ + "node_modules/@stoplight/spectral-formats/dist/openapi.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.oas3_1 = exports28.oas3_0 = exports28.oas3 = exports28.oas2 = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var oas2 = (document2) => (0, json_1.isPlainObject)(document2) && "swagger" in document2 && parseInt(String(document2.swagger)) === 2; + exports28.oas2 = oas2; + exports28.oas2.displayName = "OpenAPI 2.0 (Swagger)"; + var isOas3 = (document2) => (0, json_1.isPlainObject)(document2) && "openapi" in document2 && Number.parseInt(String(document2.openapi)) === 3; + exports28.oas3 = isOas3; + exports28.oas3.displayName = "OpenAPI 3.x"; + var oas3_0 = (document2) => isOas3(document2) && /^3\.0(?:\.[0-9]*)?$/.test(String(document2.openapi)); + exports28.oas3_0 = oas3_0; + exports28.oas3_0.displayName = "OpenAPI 3.0.x"; + var oas3_1 = (document2) => isOas3(document2) && /^3\.1(?:\.[0-9]*)?$/.test(String(document2.openapi)); + exports28.oas3_1 = oas3_1; + exports28.oas3_1.displayName = "OpenAPI 3.1.x"; + } +}); + +// node_modules/@stoplight/spectral-formats/dist/asyncapi.js +var require_asyncapi = __commonJS({ + "node_modules/@stoplight/spectral-formats/dist/asyncapi.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.aas2_6 = exports28.aas2_5 = exports28.aas2_4 = exports28.aas2_3 = exports28.aas2_2 = exports28.aas2_1 = exports28.aas2_0 = exports28.asyncapi2 = exports28.asyncApi2 = exports28.aas2 = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var aas2Regex = /^2\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/; + var aas2_0Regex = /^2\.0(?:\.[0-9]*)?$/; + var aas2_1Regex = /^2\.1(?:\.[0-9]*)?$/; + var aas2_2Regex = /^2\.2(?:\.[0-9]*)?$/; + var aas2_3Regex = /^2\.3(?:\.[0-9]*)?$/; + var aas2_4Regex = /^2\.4(?:\.[0-9]*)?$/; + var aas2_5Regex = /^2\.5(?:\.[0-9]*)?$/; + var aas2_6Regex = /^2\.6(?:\.[0-9]*)?$/; + var isAas2 = (document2) => (0, json_1.isPlainObject)(document2) && "asyncapi" in document2 && aas2Regex.test(String(document2.asyncapi)); + exports28.aas2 = isAas2; + exports28.aas2.displayName = "AsyncAPI 2.x"; + exports28.asyncApi2 = exports28.aas2; + exports28.asyncapi2 = exports28.aas2; + var aas2_0 = (document2) => isAas2(document2) && aas2_0Regex.test(String(document2.asyncapi)); + exports28.aas2_0 = aas2_0; + exports28.aas2_0.displayName = "AsyncAPI 2.0.x"; + var aas2_1 = (document2) => isAas2(document2) && aas2_1Regex.test(String(document2.asyncapi)); + exports28.aas2_1 = aas2_1; + exports28.aas2_1.displayName = "AsyncAPI 2.1.x"; + var aas2_2 = (document2) => isAas2(document2) && aas2_2Regex.test(String(document2.asyncapi)); + exports28.aas2_2 = aas2_2; + exports28.aas2_2.displayName = "AsyncAPI 2.2.x"; + var aas2_3 = (document2) => isAas2(document2) && aas2_3Regex.test(String(document2.asyncapi)); + exports28.aas2_3 = aas2_3; + exports28.aas2_3.displayName = "AsyncAPI 2.3.x"; + var aas2_4 = (document2) => isAas2(document2) && aas2_4Regex.test(String(document2.asyncapi)); + exports28.aas2_4 = aas2_4; + exports28.aas2_4.displayName = "AsyncAPI 2.4.x"; + var aas2_5 = (document2) => isAas2(document2) && aas2_5Regex.test(String(document2.asyncapi)); + exports28.aas2_5 = aas2_5; + exports28.aas2_5.displayName = "AsyncAPI 2.5.x"; + var aas2_6 = (document2) => isAas2(document2) && aas2_6Regex.test(String(document2.asyncapi)); + exports28.aas2_6 = aas2_6; + exports28.aas2_6.displayName = "AsyncAPI 2.6.x"; + } +}); + +// node_modules/@stoplight/spectral-formats/dist/jsonSchema.js +var require_jsonSchema = __commonJS({ + "node_modules/@stoplight/spectral-formats/dist/jsonSchema.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.detectDialect = exports28.extractDraftVersion = exports28.jsonSchemaDraft2020_12 = exports28.jsonSchemaDraft2019_09 = exports28.jsonSchemaDraft7 = exports28.jsonSchemaDraft6 = exports28.jsonSchemaDraft4 = exports28.jsonSchemaLoose = exports28.jsonSchema = void 0; + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var KNOWN_JSON_SCHEMA_TYPES = ["array", "boolean", "integer", "null", "number", "object", "string"]; + var KNOWN_JSON_SCHEMA_COMPOUND_KEYWORDS = ["allOf", "oneOf", "anyOf", "not", "if"]; + var SCHEMA_DRAFT_REGEX = /^https?:\/\/json-schema.org\/(?:draft-0([467])|draft\/(20(?:19-09|20-12)))\/(?:hyper-)?schema#?$/; + var hasValidJSONSchemaType = (document2) => { + if (!("type" in document2)) + return false; + if (typeof document2.type === "string") { + return KNOWN_JSON_SCHEMA_TYPES.includes(document2.type); + } + return Array.isArray(document2.type) && document2.type.every((type3) => KNOWN_JSON_SCHEMA_TYPES.includes(type3)); + }; + var hasValidJSONSchemaEnumKeyword = (document2) => Array.isArray(document2["enum"]); + var hasValidJSONSchemaCompoundKeyword = (document2) => KNOWN_JSON_SCHEMA_COMPOUND_KEYWORDS.some((combiner) => combiner in document2 && typeof document2[combiner] === "object" && document2[combiner] !== null); + function hasSchemaVersion(document2) { + return (0, json_1.isPlainObject)(document2) && "$schema" in document2 && typeof document2.$schema === "string"; + } + var isJsonSchema = (document2) => hasSchemaVersion(document2) && document2.$schema.includes("//json-schema.org/"); + exports28.jsonSchema = isJsonSchema; + exports28.jsonSchema.displayName = "JSON Schema"; + var jsonSchemaLoose = (document2) => (0, json_1.isPlainObject)(document2) && (isJsonSchema(document2) || hasValidJSONSchemaType(document2) || hasValidJSONSchemaEnumKeyword(document2) || hasValidJSONSchemaCompoundKeyword(document2)); + exports28.jsonSchemaLoose = jsonSchemaLoose; + exports28.jsonSchemaLoose.displayName = "JSON Schema (loose)"; + exports28.jsonSchemaDraft4 = createJsonSchemaFormat("draft4", "JSON Schema Draft 4"); + exports28.jsonSchemaDraft6 = createJsonSchemaFormat("draft6", "JSON Schema Draft 6"); + exports28.jsonSchemaDraft7 = createJsonSchemaFormat("draft7", "JSON Schema Draft 7"); + exports28.jsonSchemaDraft2019_09 = createJsonSchemaFormat("draft2019-09", "JSON Schema Draft 2019-09"); + exports28.jsonSchemaDraft2020_12 = createJsonSchemaFormat("draft2020-12", "JSON Schema Draft 2020-12"); + function createJsonSchemaFormat(draft, name2) { + const format5 = (document2) => isJsonSchema(document2) && extractDraftVersion(document2.$schema) === draft; + format5.displayName = name2; + return format5; + } + function extractDraftVersion($schema) { + var _a2; + const match = SCHEMA_DRAFT_REGEX.exec($schema); + return match !== null ? `draft${(_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : match[2]}` : null; + } + exports28.extractDraftVersion = extractDraftVersion; + function detectDialect(document2) { + if (!isJsonSchema(document2)) { + return null; + } + return extractDraftVersion(document2.$schema); + } + exports28.detectDialect = detectDialect; + } +}); + +// node_modules/@stoplight/spectral-formats/dist/index.js +var require_dist13 = __commonJS({ + "node_modules/@stoplight/spectral-formats/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es69(), __toCommonJS(tslib_es6_exports9)); + (0, tslib_1.__exportStar)(require_openapi(), exports28); + (0, tslib_1.__exportStar)(require_asyncapi(), exports28); + (0, tslib_1.__exportStar)(require_jsonSchema(), exports28); + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +var require_schema3 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/schema.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/schema", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/core": true, + "https://json-schema.org/draft/2019-09/vocab/applicator": true, + "https://json-schema.org/draft/2019-09/vocab/validation": true, + "https://json-schema.org/draft/2019-09/vocab/meta-data": true, + "https://json-schema.org/draft/2019-09/vocab/format": false, + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + $recursiveAnchor: true, + title: "Core and Validation specifications meta-schema", + allOf: [ + { $ref: "meta/core" }, + { $ref: "meta/applicator" }, + { $ref: "meta/validation" }, + { $ref: "meta/meta-data" }, + { $ref: "meta/format" }, + { $ref: "meta/content" } + ], + type: ["object", "boolean"], + properties: { + definitions: { + $comment: "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.", + type: "object", + additionalProperties: { $recursiveRef: "#" }, + default: {} + }, + dependencies: { + $comment: '"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"', + type: "object", + additionalProperties: { + anyOf: [{ $recursiveRef: "#" }, { $ref: "meta/validation#/$defs/stringArray" }] + } + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +var require_applicator3 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/applicator", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/applicator": true + }, + $recursiveAnchor: true, + title: "Applicator vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + additionalItems: { $recursiveRef: "#" }, + unevaluatedItems: { $recursiveRef: "#" }, + items: { + anyOf: [{ $recursiveRef: "#" }, { $ref: "#/$defs/schemaArray" }] + }, + contains: { $recursiveRef: "#" }, + additionalProperties: { $recursiveRef: "#" }, + unevaluatedProperties: { $recursiveRef: "#" }, + properties: { + type: "object", + additionalProperties: { $recursiveRef: "#" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $recursiveRef: "#" }, + propertyNames: { format: "regex" }, + default: {} + }, + dependentSchemas: { + type: "object", + additionalProperties: { + $recursiveRef: "#" + } + }, + propertyNames: { $recursiveRef: "#" }, + if: { $recursiveRef: "#" }, + then: { $recursiveRef: "#" }, + else: { $recursiveRef: "#" }, + allOf: { $ref: "#/$defs/schemaArray" }, + anyOf: { $ref: "#/$defs/schemaArray" }, + oneOf: { $ref: "#/$defs/schemaArray" }, + not: { $recursiveRef: "#" } + }, + $defs: { + schemaArray: { + type: "array", + minItems: 1, + items: { $recursiveRef: "#" } + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +var require_content2 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/content", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/content": true + }, + $recursiveAnchor: true, + title: "Content vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + contentMediaType: { type: "string" }, + contentEncoding: { type: "string" }, + contentSchema: { $recursiveRef: "#" } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +var require_core7 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/core", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/core": true + }, + $recursiveAnchor: true, + title: "Core vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + $id: { + type: "string", + format: "uri-reference", + $comment: "Non-empty fragments not allowed.", + pattern: "^[^#]*#?$" + }, + $schema: { + type: "string", + format: "uri" + }, + $anchor: { + type: "string", + pattern: "^[A-Za-z][-A-Za-z0-9.:_]*$" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $recursiveRef: { + type: "string", + format: "uri-reference" + }, + $recursiveAnchor: { + type: "boolean", + default: false + }, + $vocabulary: { + type: "object", + propertyNames: { + type: "string", + format: "uri" + }, + additionalProperties: { + type: "boolean" + } + }, + $comment: { + type: "string" + }, + $defs: { + type: "object", + additionalProperties: { $recursiveRef: "#" }, + default: {} + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +var require_format3 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/format", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/format": true + }, + $recursiveAnchor: true, + title: "Format vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + format: { type: "string" } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +var require_meta_data2 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/meta-data", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/meta-data": true + }, + $recursiveAnchor: true, + title: "Meta-data vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + deprecated: { + type: "boolean", + default: false + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +var require_validation5 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json"(exports28, module5) { + module5.exports = { + $schema: "https://json-schema.org/draft/2019-09/schema", + $id: "https://json-schema.org/draft/2019-09/meta/validation", + $vocabulary: { + "https://json-schema.org/draft/2019-09/vocab/validation": true + }, + $recursiveAnchor: true, + title: "Validation vocabulary meta-schema", + type: ["object", "boolean"], + properties: { + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { $ref: "#/$defs/nonNegativeInteger" }, + minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { $ref: "#/$defs/nonNegativeInteger" }, + minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxContains: { $ref: "#/$defs/nonNegativeInteger" }, + minContains: { + $ref: "#/$defs/nonNegativeInteger", + default: 1 + }, + maxProperties: { $ref: "#/$defs/nonNegativeInteger" }, + minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" }, + required: { $ref: "#/$defs/stringArray" }, + dependentRequired: { + type: "object", + additionalProperties: { + $ref: "#/$defs/stringArray" + } + }, + const: true, + enum: { + type: "array", + items: true + }, + type: { + anyOf: [ + { $ref: "#/$defs/simpleTypes" }, + { + type: "array", + items: { $ref: "#/$defs/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + } + }, + $defs: { + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + $ref: "#/$defs/nonNegativeInteger", + default: 0 + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + uniqueItems: true, + default: [] + } + } + }; + } +}); + +// node_modules/ajv/dist/refs/json-schema-2019-09/index.js +var require_json_schema_2019_09 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-2019-09/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var metaSchema = require_schema3(); + var applicator = require_applicator3(); + var content = require_content2(); + var core2 = require_core7(); + var format5 = require_format3(); + var metadata = require_meta_data2(); + var validation = require_validation5(); + var META_SUPPORT_DATA = ["/properties"]; + function addMetaSchema2019($data) { + ; + [ + metaSchema, + applicator, + content, + core2, + with$data(this, format5), + metadata, + with$data(this, validation) + ].forEach((sch) => this.addMetaSchema(sch, void 0, false)); + return this; + function with$data(ajv2, sch) { + return $data ? ajv2.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch; + } + } + exports28.default = addMetaSchema2019; + } +}); + +// node_modules/ajv/dist/2019.js +var require__11 = __commonJS({ + "node_modules/ajv/dist/2019.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.MissingRefError = exports28.ValidationError = exports28.CodeGen = exports28.Name = exports28.nil = exports28.stringify = exports28.str = exports28._ = exports28.KeywordCxt = exports28.Ajv2019 = void 0; + var core_1 = require_core(); + var draft7_1 = require_draft7(); + var dynamic_1 = require_dynamic(); + var next_1 = require_next(); + var unevaluated_1 = require_unevaluated(); + var discriminator_1 = require_discriminator(); + var json_schema_2019_09_1 = require_json_schema_2019_09(); + var META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"; + var Ajv2019 = class extends core_1.default { + constructor(opts = {}) { + super({ + ...opts, + dynamicRef: true, + next: true, + unevaluated: true + }); + } + _addVocabularies() { + super._addVocabularies(); + this.addVocabulary(dynamic_1.default); + draft7_1.default.forEach((v8) => this.addVocabulary(v8)); + this.addVocabulary(next_1.default); + this.addVocabulary(unevaluated_1.default); + if (this.opts.discriminator) + this.addKeyword(discriminator_1.default); + } + _addDefaultMetaSchema() { + super._addDefaultMetaSchema(); + const { $data, meta } = this.opts; + if (!meta) + return; + json_schema_2019_09_1.default.call(this, $data); + this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; + } + defaultMeta() { + return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); + } + }; + exports28.Ajv2019 = Ajv2019; + module5.exports = exports28 = Ajv2019; + module5.exports.Ajv2019 = Ajv2019; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.default = Ajv2019; + var validate_1 = require_validate(); + Object.defineProperty(exports28, "KeywordCxt", { enumerable: true, get: function() { + return validate_1.KeywordCxt; + } }); + var codegen_1 = require_codegen(); + Object.defineProperty(exports28, "_", { enumerable: true, get: function() { + return codegen_1._; + } }); + Object.defineProperty(exports28, "str", { enumerable: true, get: function() { + return codegen_1.str; + } }); + Object.defineProperty(exports28, "stringify", { enumerable: true, get: function() { + return codegen_1.stringify; + } }); + Object.defineProperty(exports28, "nil", { enumerable: true, get: function() { + return codegen_1.nil; + } }); + Object.defineProperty(exports28, "Name", { enumerable: true, get: function() { + return codegen_1.Name; + } }); + Object.defineProperty(exports28, "CodeGen", { enumerable: true, get: function() { + return codegen_1.CodeGen; + } }); + var validation_error_1 = require_validation_error(); + Object.defineProperty(exports28, "ValidationError", { enumerable: true, get: function() { + return validation_error_1.default; + } }); + var ref_error_1 = require_ref_error(); + Object.defineProperty(exports28, "MissingRefError", { enumerable: true, get: function() { + return ref_error_1.default; + } }); + } +}); + +// node_modules/ajv/dist/refs/json-schema-draft-06.json +var require_json_schema_draft_06 = __commonJS({ + "node_modules/ajv/dist/refs/json-schema-draft-06.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-06/schema#", + $id: "http://json-schema.org/draft-06/schema#", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + uniqueItems: true, + default: [] + } + }, + type: ["object", "boolean"], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: {}, + examples: { + type: "array", + items: {} + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { $ref: "#/definitions/nonNegativeInteger" }, + minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { $ref: "#" }, + items: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], + default: {} + }, + maxItems: { $ref: "#/definitions/nonNegativeInteger" }, + minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { $ref: "#" }, + maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, + minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { $ref: "#" }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] + } + }, + propertyNames: { $ref: "#" }, + const: {}, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { type: "string" }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + default: {} + }; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/schema/draft4.json +var require_draft42 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/schema/draft4.json"(exports28, module5) { + module5.exports = { + $id: "http://json-schema.org/draft-04/schema#", + $schema: "http://json-schema.org/draft-07/schema#", + description: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { $ref: "#" } + }, + positiveInteger: { + type: "integer", + minimum: 0 + }, + positiveIntegerDefault0: { + allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }] + }, + simpleTypes: { + enum: ["array", "boolean", "integer", "null", "number", "object", "string"] + }, + stringArray: { + type: "array", + items: { type: "string" }, + minItems: 1, + uniqueItems: true + } + }, + type: "object", + properties: { + id: { + type: "string", + format: "uri" + }, + $schema: { + type: "string", + format: "uri" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + deprecationMessage: { + type: "string", + description: "Non-standard: deprecation message for a property, if it is deprecated" + }, + default: {}, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { $ref: "#/definitions/positiveInteger" }, + minLength: { $ref: "#/definitions/positiveIntegerDefault0" }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + anyOf: [{ type: "boolean" }, { $ref: "#" }], + default: {} + }, + items: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], + default: {} + }, + maxItems: { $ref: "#/definitions/positiveInteger" }, + minItems: { $ref: "#/definitions/positiveIntegerDefault0" }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { $ref: "#/definitions/positiveInteger" }, + minProperties: { $ref: "#/definitions/positiveIntegerDefault0" }, + required: { $ref: "#/definitions/stringArray" }, + additionalProperties: { + anyOf: [{ type: "boolean" }, { $ref: "#" }], + default: {} + }, + definitions: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { $ref: "#" }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] + } + }, + enum: { + type: "array", + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { $ref: "#/definitions/simpleTypes" }, + { + type: "array", + items: { $ref: "#/definitions/simpleTypes" }, + minItems: 1, + uniqueItems: true + } + ] + }, + allOf: { $ref: "#/definitions/schemaArray" }, + anyOf: { $ref: "#/definitions/schemaArray" }, + oneOf: { $ref: "#/definitions/schemaArray" }, + not: { $ref: "#" } + }, + default: {} + }; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/schema/ajv.js +var require_ajv3 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/schema/ajv.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createAjvInstances = void 0; + var tslib_1 = (init_tslib_es68(), __toCommonJS(tslib_es6_exports8)); + var ajv_1 = (0, tslib_1.__importDefault)(require_ajv()); + var _2019_1 = (0, tslib_1.__importDefault)(require__11()); + var _2020_1 = (0, tslib_1.__importDefault)(require__()); + var ajv_draft_04_1 = (0, tslib_1.__importDefault)(require_dist()); + var ajv_formats_1 = (0, tslib_1.__importDefault)(require_dist9()); + var ajv_errors_1 = (0, tslib_1.__importDefault)(require_dist10()); + var draft6MetaSchema = (0, tslib_1.__importStar)(require_json_schema_draft_06()); + var draft4MetaSchema = (0, tslib_1.__importStar)(require_draft42()); + var logger = { + warn(...args) { + const firstArg = args[0]; + if (typeof firstArg === "string") { + if (firstArg.startsWith("unknown format")) + return; + console.warn(...args); + } + }, + log: console.log, + error: console.error + }; + function createAjvInstance(Ajv7, allErrors) { + const ajv2 = new Ajv7({ + allErrors, + meta: true, + messages: true, + strict: false, + allowUnionTypes: true, + logger, + unicodeRegExp: false + }); + (0, ajv_formats_1.default)(ajv2); + if (allErrors) { + (0, ajv_errors_1.default)(ajv2); + } + if (Ajv7 === ajv_1.default) { + ajv2.addSchema(draft4MetaSchema); + ajv2.addSchema(draft6MetaSchema); + } + return ajv2; + } + function _createAjvInstances(Ajv7) { + let _default2; + let _allErrors; + return { + get default() { + _default2 !== null && _default2 !== void 0 ? _default2 : _default2 = createAjvInstance(Ajv7, false); + return _default2; + }, + get allErrors() { + _allErrors !== null && _allErrors !== void 0 ? _allErrors : _allErrors = createAjvInstance(Ajv7, true); + return _allErrors; + } + }; + } + function createAjvInstances() { + const ajvInstances = { + auto: _createAjvInstances(ajv_1.default), + draft4: _createAjvInstances(ajv_draft_04_1.default), + "draft2019-09": _createAjvInstances(_2019_1.default), + "draft2020-12": _createAjvInstances(_2020_1.default) + }; + const compiledSchemas = /* @__PURE__ */ new WeakMap(); + return function(schema8, dialect, allErrors) { + var _a2, _b, _c, _d; + const instances = (_a2 = ajvInstances[dialect]) !== null && _a2 !== void 0 ? _a2 : ajvInstances.auto; + const ajv2 = instances[allErrors ? "allErrors" : "default"]; + const $id = schema8.$id; + if (typeof $id === "string") { + return (_b = ajv2.getSchema($id)) !== null && _b !== void 0 ? _b : ajv2.compile(schema8); + } else { + const actualCompiledSchemas = (_c = compiledSchemas.get(ajv2)) !== null && _c !== void 0 ? _c : compiledSchemas.set(ajv2, /* @__PURE__ */ new WeakMap()).get(ajv2); + return (_d = actualCompiledSchemas.get(schema8)) !== null && _d !== void 0 ? _d : actualCompiledSchemas.set(schema8, ajv2.compile(schema8)).get(schema8); + } + }; + } + exports28.createAjvInstances = createAjvInstances; + } +}); + +// node_modules/@stoplight/spectral-functions/dist/schema/index.js +var require_schema4 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/schema/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var tslib_1 = (init_tslib_es68(), __toCommonJS(tslib_es6_exports8)); + var better_ajv_errors_1 = (0, tslib_1.__importDefault)(require_dist12()); + var spectral_formats_1 = require_dist13(); + var ajv_1 = require_ajv3(); + var ref_error_1 = (0, tslib_1.__importDefault)(require_ref_error()); + var spectral_core_1 = require_dist11(); + var lodash_1 = (init_lodash(), __toCommonJS(lodash_exports)); + var optionSchemas_1 = require_optionSchemas(); + var instances = /* @__PURE__ */ new WeakMap(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: null, + options: optionSchemas_1.optionSchemas.schema + }, function schema8(targetVal, opts, { path: path2, rule, documentInventory }) { + var _a2, _b, _c; + if (targetVal === void 0) { + return [ + { + path: path2, + message: `#{{print("property")}}must exist` + } + ]; + } + const assignAjvInstance = (_a2 = instances.get(documentInventory)) !== null && _a2 !== void 0 ? _a2 : instances.set(documentInventory, (0, ajv_1.createAjvInstances)()).get(documentInventory); + const results = []; + const { allErrors = false, schema: schemaObj } = opts; + try { + const dialect = (_b = opts.dialect === void 0 || opts.dialect === "auto" ? (0, spectral_formats_1.detectDialect)(schemaObj) : opts === null || opts === void 0 ? void 0 : opts.dialect) !== null && _b !== void 0 ? _b : "draft7"; + const validator = assignAjvInstance(schemaObj, dialect, allErrors); + if ((validator === null || validator === void 0 ? void 0 : validator(targetVal)) === false && Array.isArray(validator.errors)) { + (_c = opts.prepareResults) === null || _c === void 0 ? void 0 : _c.call(opts, validator.errors); + results.push(...(0, better_ajv_errors_1.default)(schemaObj, validator.errors, { + propertyPath: path2, + targetValue: targetVal + }).map(({ suggestion, error: error2, path: errorPath }) => ({ + message: suggestion !== void 0 ? `${error2}. ${suggestion}` : error2, + path: [...path2, ...errorPath !== "" ? errorPath.replace(/^\//, "").split("/") : []] + }))); + } + } catch (ex) { + if (!(0, lodash_1.isError)(ex)) { + throw new Error("Unexpected error"); + } + if (!rule.resolved || !(ex instanceof ref_error_1.default)) { + results.push({ + message: ex.message, + path: path2 + }); + } + } + return results; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/truthy.js +var require_truthy = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/truthy.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: null, + options: optionSchemas_1.optionSchemas.truthy + }, function truthy10(input) { + if (!input) { + return [ + { + message: '#{{print("property")}}must be truthy' + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/undefined.js +var require_undefined2 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/undefined.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: null, + options: optionSchemas_1.optionSchemas.undefined + }, function undefined2(targetVal) { + if (typeof targetVal !== "undefined") { + return [ + { + message: '#{{print("property")}}must be undefined' + } + ]; + } + return; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/unreferencedReusableObject.js +var require_unreferencedReusableObject = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/unreferencedReusableObject.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2)); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: "object" + }, + options: optionSchemas_1.optionSchemas.unreferencedReusableObject + }, function unreferencedReusableObject4(data, opts, { document: document2, documentInventory }) { + var _a2; + const graph = documentInventory.graph; + if (graph === null) { + throw new Error("unreferencedReusableObject requires dependency graph"); + } + const normalizedSource = (_a2 = document2.source) !== null && _a2 !== void 0 ? _a2 : ""; + const defined = Object.keys(data).map((name2) => `${normalizedSource}${opts.reusableObjectsLocation}/${name2}`); + const decodedNodes = new Set(graph.overallOrder().map((n7) => (0, json_1.decodePointer)(n7))); + const orphans = defined.filter((defPath) => !decodedNodes.has(defPath)); + return orphans.map((orphanPath) => { + return { + message: "Potential orphaned reusable object has been detected", + path: (0, spectral_runtime_1.safePointerToPath)(orphanPath) + }; + }); + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/xor.js +var require_xor = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/xor.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + var spectral_core_1 = require_dist11(); + var spectral_runtime_1 = require_dist6(); + var optionSchemas_1 = require_optionSchemas(); + exports28.default = (0, spectral_core_1.createRulesetFunction)({ + input: { + type: "object" + }, + options: optionSchemas_1.optionSchemas.xor + }, function xor2(targetVal, { properties }) { + if (properties.length !== 2) + return; + const results = []; + const intersection2 = Object.keys(targetVal).filter((value2) => -1 !== properties.indexOf(value2)); + if (intersection2.length !== 1) { + results.push({ + message: `${(0, spectral_runtime_1.printValue)(properties[0])} and ${(0, spectral_runtime_1.printValue)(properties[1])} must not be both defined or both undefined` + }); + } + return results; + }); + } +}); + +// node_modules/@stoplight/spectral-functions/dist/index.js +var require_dist14 = __commonJS({ + "node_modules/@stoplight/spectral-functions/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.xor = exports28.unreferencedReusableObject = exports28.undefined = exports28.truthy = exports28.schema = exports28.pattern = exports28.length = exports28.falsy = exports28.enumeration = exports28.defined = exports28.casing = exports28.alphabetical = void 0; + var tslib_1 = (init_tslib_es68(), __toCommonJS(tslib_es6_exports8)); + var alphabetical_1 = (0, tslib_1.__importDefault)(require_alphabetical()); + Object.defineProperty(exports28, "alphabetical", { enumerable: true, get: function() { + return alphabetical_1.default; + } }); + var casing_1 = (0, tslib_1.__importDefault)(require_casing()); + Object.defineProperty(exports28, "casing", { enumerable: true, get: function() { + return casing_1.default; + } }); + var defined_1 = (0, tslib_1.__importDefault)(require_defined()); + Object.defineProperty(exports28, "defined", { enumerable: true, get: function() { + return defined_1.default; + } }); + var enumeration_1 = (0, tslib_1.__importDefault)(require_enumeration()); + Object.defineProperty(exports28, "enumeration", { enumerable: true, get: function() { + return enumeration_1.default; + } }); + var falsy_1 = (0, tslib_1.__importDefault)(require_falsy()); + Object.defineProperty(exports28, "falsy", { enumerable: true, get: function() { + return falsy_1.default; + } }); + var length_1 = (0, tslib_1.__importDefault)(require_length()); + Object.defineProperty(exports28, "length", { enumerable: true, get: function() { + return length_1.default; + } }); + var pattern_1 = (0, tslib_1.__importDefault)(require_pattern3()); + Object.defineProperty(exports28, "pattern", { enumerable: true, get: function() { + return pattern_1.default; + } }); + var schema_1 = (0, tslib_1.__importDefault)(require_schema4()); + Object.defineProperty(exports28, "schema", { enumerable: true, get: function() { + return schema_1.default; + } }); + var truthy_1 = (0, tslib_1.__importDefault)(require_truthy()); + Object.defineProperty(exports28, "truthy", { enumerable: true, get: function() { + return truthy_1.default; + } }); + var undefined_1 = (0, tslib_1.__importDefault)(require_undefined2()); + Object.defineProperty(exports28, "undefined", { enumerable: true, get: function() { + return undefined_1.default; + } }); + var unreferencedReusableObject_1 = (0, tslib_1.__importDefault)(require_unreferencedReusableObject()); + Object.defineProperty(exports28, "unreferencedReusableObject", { enumerable: true, get: function() { + return unreferencedReusableObject_1.default; + } }); + var xor_1 = (0, tslib_1.__importDefault)(require_xor()); + Object.defineProperty(exports28, "xor", { enumerable: true, get: function() { + return xor_1.default; + } }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/formats.js +function isAsyncAPIVersion(versionToMatch, document2) { + const asyncAPIDoc = document2; + if (!asyncAPIDoc) + return false; + const documentVersion = String(asyncAPIDoc.asyncapi); + return isObject3(document2) && "asyncapi" in document2 && assertValidAsyncAPIVersion(documentVersion) && versionToMatch === formatVersion(documentVersion); +} +function assertValidAsyncAPIVersion(documentVersion) { + const semver = getSemver(documentVersion); + const regexp = new RegExp(`^(${semver.major})\\.(${semver.minor})\\.(0|[1-9][0-9]*)$`); + return regexp.test(documentVersion); +} +function createFormat(version5) { + const format5 = (document2) => isAsyncAPIVersion(version5, document2); + const semver = getSemver(version5); + format5.displayName = `AsyncAPI ${semver.major}.${semver.minor}.x`; + return format5; +} +var import_specs2, Formats, AsyncAPIFormats, formatVersion; +var init_formats = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/formats.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_utils2(); + import_specs2 = __toESM(require_specs()); + Formats = class _Formats extends Map { + filterByMajorVersions(majorsToInclude) { + return new _Formats([...this.entries()].filter((element) => { + return majorsToInclude.includes(element[0].split(".")[0]); + })); + } + excludeByVersions(versionsToExclude) { + return new _Formats([...this.entries()].filter((element) => { + return !versionsToExclude.includes(element[0]); + })); + } + find(version5) { + return this.get(formatVersion(version5)); + } + formats() { + return [...this.values()]; + } + }; + AsyncAPIFormats = new Formats(Object.entries(import_specs2.schemas).reverse().map(([version5]) => [version5, createFormat(version5)])); + formatVersion = function(version5) { + const versionSemver = getSemver(version5); + return `${versionSemver.major}.${versionSemver.minor}.0`; + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/documentStructure.js +function shouldIgnoreError(error2) { + return ( + // oneOf is a fairly error as we have 2 options to choose from for most of the time. + error2.keyword === "oneOf" || // the required $ref is entirely useless, since aas-schema rules operate on resolved content, so there won't be any $refs in the document + error2.keyword === "required" && error2.params.missingProperty === "$ref" + ); +} +function prepareResults(errors) { + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (error2.keyword === "additionalProperties") { + error2.instancePath = `${error2.instancePath}/${String(error2.params["additionalProperty"])}`; + } else if (error2.keyword === "required" && error2.params.missingProperty === "$ref") { + errors.splice(i7, 1); + i7--; + } + } + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (i7 + 1 < errors.length && errors[i7 + 1].instancePath === error2.instancePath) { + errors.splice(i7 + 1, 1); + i7--; + } else if (i7 > 0 && shouldIgnoreError(error2) && errors[i7 - 1].instancePath.startsWith(error2.instancePath)) { + errors.splice(i7, 1); + i7--; + } + } +} +function prepareV3ResolvedSchema(copied, version5) { + var _a2, _b, _c, _d, _e2, _f, _g, _h; + const channelObject = copied.definitions[`http://asyncapi.com/definitions/${version5}/channel.json`]; + if ((_b = (_a2 = channelObject === null || channelObject === void 0 ? void 0 : channelObject.properties) === null || _a2 === void 0 ? void 0 : _a2.servers) === null || _b === void 0 ? void 0 : _b.items) { + channelObject.properties.servers.items.$ref = `http://asyncapi.com/definitions/${version5}/server.json`; + } + const operationSchema = copied.definitions[`http://asyncapi.com/definitions/${version5}/operation.json`]; + if ((_c = operationSchema === null || operationSchema === void 0 ? void 0 : operationSchema.properties) === null || _c === void 0 ? void 0 : _c.channel) { + operationSchema.properties.channel.$ref = `http://asyncapi.com/definitions/${version5}/channel.json`; + } + if ((_e2 = (_d = operationSchema === null || operationSchema === void 0 ? void 0 : operationSchema.properties) === null || _d === void 0 ? void 0 : _d.messages) === null || _e2 === void 0 ? void 0 : _e2.items) { + operationSchema.properties.messages.items.$ref = `http://asyncapi.com/definitions/${version5}/messageObject.json`; + } + const operationReplySchema = copied.definitions[`http://asyncapi.com/definitions/${version5}/operationReply.json`]; + if ((_f = operationReplySchema === null || operationReplySchema === void 0 ? void 0 : operationReplySchema.properties) === null || _f === void 0 ? void 0 : _f.channel) { + operationReplySchema.properties.channel.$ref = `http://asyncapi.com/definitions/${version5}/channel.json`; + } + if ((_h = (_g = operationReplySchema === null || operationReplySchema === void 0 ? void 0 : operationReplySchema.properties) === null || _g === void 0 ? void 0 : _g.messages) === null || _h === void 0 ? void 0 : _h.items) { + operationReplySchema.properties.messages.items.$ref = `http://asyncapi.com/definitions/${version5}/messageObject.json`; + } + return copied; +} +function getCopyOfSchema(version5) { + return JSON.parse(JSON.stringify(import_specs3.default.schemas[version5])); +} +function getSerializedSchema(version5, resolved) { + const serializedSchemaKey = resolved ? `${version5}-resolved` : `${version5}-unresolved`; + const schema8 = serializedSchemas.get(serializedSchemaKey); + if (schema8) { + return schema8; + } + let copied = getCopyOfSchema(version5); + delete copied.definitions["http://json-schema.org/draft-07/schema"]; + delete copied.definitions["http://json-schema.org/draft-04/schema"]; + copied["$id"] = copied["$id"].replace("asyncapi.json", `asyncapi-${resolved ? "resolved" : "unresolved"}.json`); + const { major } = getSemver(version5); + if (resolved && major === 3) { + copied = prepareV3ResolvedSchema(copied, version5); + } + serializedSchemas.set(serializedSchemaKey, copied); + return copied; +} +function filterRefErrors(errors, resolved) { + if (resolved) { + return errors.filter((err) => err.message !== refErrorMessage); + } + return errors.filter((err) => err.message === refErrorMessage).map((err) => { + err.message = "Referencing in this place is not allowed"; + return err; + }); +} +function getSchema(docFormats, resolved) { + for (const [version5, format5] of AsyncAPIFormats) { + if (docFormats.has(format5)) { + return getSerializedSchema(version5, resolved); + } + } +} +var import_specs3, import_spectral_core2, import_spectral_functions, serializedSchemas, refErrorMessage, documentStructure; +var init_documentStructure = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/documentStructure.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_specs3 = __toESM(require_specs()); + import_spectral_core2 = __toESM(require_dist11()); + import_spectral_functions = __toESM(require_dist14()); + init_formats(); + init_utils2(); + serializedSchemas = /* @__PURE__ */ new Map(); + refErrorMessage = 'Property "$ref" is not expected to be here'; + documentStructure = (0, import_spectral_core2.createRulesetFunction)({ + input: null, + options: { + type: "object", + properties: { + resolved: { + type: "boolean" + } + }, + required: ["resolved"] + } + }, (targetVal, options, context2) => { + var _a2; + const formats = (_a2 = context2.document) === null || _a2 === void 0 ? void 0 : _a2.formats; + if (!formats) { + return; + } + const resolved = options.resolved; + const schema8 = getSchema(formats, resolved); + if (!schema8) { + return; + } + const errors = (0, import_spectral_functions.schema)(targetVal, { allErrors: true, schema: schema8, prepareResults: resolved ? prepareResults : void 0 }, context2); + if (!Array.isArray(errors)) { + return; + } + return filterRefErrors(errors, resolved); + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/internal.js +var import_spectral_core3, internal; +var init_internal = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/internal.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core3 = __toESM(require_dist11()); + internal = (0, import_spectral_core3.createRulesetFunction)({ + input: null, + options: null + }, (_6, __, { document: document2, documentInventory }) => { + document2.__documentInventory = documentInventory; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/isAsyncAPIDocument.js +var import_spectral_core4, isAsyncAPIDocument2; +var init_isAsyncAPIDocument = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/isAsyncAPIDocument.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core4 = __toESM(require_dist11()); + init_constants(); + init_utils2(); + isAsyncAPIDocument2 = (0, import_spectral_core4.createRulesetFunction)({ + input: null, + options: null + }, (targetVal) => { + if (!isObject3(targetVal) || typeof targetVal.asyncapi !== "string") { + return [ + { + message: 'This is not an AsyncAPI document. The "asyncapi" field as string is missing.', + path: [] + } + ]; + } + if (!specVersions.includes(targetVal.asyncapi)) { + return [ + { + message: `Version "${targetVal.asyncapi}" is not supported. Please use "${lastVersion}" (latest) version of the specification.`, + path: [] + } + ]; + } + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/unusedComponent.js +var import_spectral_functions2, import_spectral_core5, unusedComponent; +var init_unusedComponent = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/unusedComponent.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_functions2 = __toESM(require_dist14()); + import_spectral_core5 = __toESM(require_dist11()); + init_utils2(); + unusedComponent = (0, import_spectral_core5.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null + }, (targetVal, _6, context2) => { + const components = targetVal.components; + const results = []; + Object.keys(components).forEach((componentType) => { + if (componentType === "securitySchemes") { + return; + } + const value2 = components[componentType]; + if (!isObject3(value2)) { + return; + } + const resultsForType = (0, import_spectral_functions2.unreferencedReusableObject)(value2, { reusableObjectsLocation: `#/components/${componentType}` }, context2); + if (resultsForType && Array.isArray(resultsForType)) { + results.push(...resultsForType); + } + }); + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/ruleset.js +var import_spectral_functions3, coreRuleset, recommendedRuleset; +var init_ruleset = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/ruleset.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_functions3 = __toESM(require_dist14()); + init_documentStructure(); + init_internal(); + init_isAsyncAPIDocument(); + init_unusedComponent(); + init_formats(); + init_constants(); + coreRuleset = { + description: "Core AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats.formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-is-asyncapi": { + description: "The input must be a document with a supported version of AsyncAPI.", + formats: [() => true], + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: isAsyncAPIDocument2 + } + }, + "asyncapi-latest-version": { + description: "Checking if the AsyncAPI document is using the latest version.", + message: `The latest version of AsyncAPi is not used. It is recommended update to the "${lastVersion}" version.`, + recommended: true, + severity: "info", + given: "$.asyncapi", + then: { + function: import_spectral_functions3.schema, + functionOptions: { + schema: { + const: lastVersion + } + } + } + }, + "asyncapi-document-resolved": { + description: "Checking if the AsyncAPI document has valid resolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: documentStructure, + functionOptions: { + resolved: true + } + } + }, + "asyncapi-document-unresolved": { + description: "Checking if the AsyncAPI document has valid unresolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + resolved: false, + given: "$", + then: { + function: documentStructure, + functionOptions: { + resolved: false + } + } + }, + "asyncapi-internal": { + description: "That rule is internal to extend Spectral functionality for Parser purposes.", + recommended: true, + given: "$", + then: { + function: internal + } + } + } + }; + recommendedRuleset = { + description: "Recommended AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-id": { + description: 'AsyncAPI document should have "id" field.', + recommended: true, + given: "$", + then: { + field: "id", + function: import_spectral_functions3.truthy + } + }, + "asyncapi-defaultContentType": { + description: 'AsyncAPI document should have "defaultContentType" field.', + recommended: true, + given: "$", + then: { + field: "defaultContentType", + function: import_spectral_functions3.truthy + } + }, + /** + * Info Object rules + */ + "asyncapi-info-description": { + description: 'Info "description" should be present and non-empty string.', + recommended: true, + given: "$", + then: { + field: "info.description", + function: import_spectral_functions3.truthy + } + }, + "asyncapi-info-contact": { + description: 'Info object should have "contact" object.', + recommended: true, + given: "$", + then: { + field: "info.contact", + function: import_spectral_functions3.truthy + } + }, + "asyncapi-info-contact-properties": { + description: 'Contact object should have "name", "url" and "email" fields.', + recommended: true, + given: "$.info.contact", + then: [ + { + field: "name", + function: import_spectral_functions3.truthy + }, + { + field: "url", + function: import_spectral_functions3.truthy + }, + { + field: "email", + function: import_spectral_functions3.truthy + } + ] + }, + "asyncapi-info-license": { + description: 'Info object should have "license" object.', + recommended: true, + given: "$", + then: { + field: "info.license", + function: import_spectral_functions3.truthy + } + }, + "asyncapi-info-license-url": { + description: 'License object should have "url" field.', + recommended: false, + given: "$", + then: { + field: "info.license.url", + function: import_spectral_functions3.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi-servers": { + description: 'AsyncAPI document should have non-empty "servers" object.', + recommended: true, + given: "$", + then: { + field: "servers", + function: import_spectral_functions3.schema, + functionOptions: { + schema: { + type: "object", + minProperties: 1 + }, + allErrors: true + } + } + }, + /** + * Component Object rules + */ + "asyncapi-unused-component": { + description: "Potentially unused component has been detected in AsyncAPI document.", + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).formats(), + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedComponent + } + } + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/utils/getMissingProps.js +function getMissingProps(arr = [], obj = {}) { + if (!Object.keys(obj).length) + return arr; + return arr.filter((val) => { + return !Object.prototype.hasOwnProperty.call(obj, val); + }); +} +var init_getMissingProps = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/utils/getMissingProps.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/utils/getRedundantProps.js +function getRedundantProps(arr = [], obj = {}) { + if (!arr.length) + return Object.keys(obj); + return Object.keys(obj).filter((val) => { + return !arr.includes(val); + }); +} +var init_getRedundantProps = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/utils/getRedundantProps.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/utils/mergeTraits.js +function mergeTraits(data) { + if (Array.isArray(data.traits)) { + data = Object.assign({}, data); + for (const trait of data.traits) { + for (const key in trait) { + data[key] = merge3(data[key], trait[key]); + } + } + } + return data; +} +function merge3(origin, patch) { + if (!w(patch)) { + return patch; + } + const result2 = !w(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = merge3(result2[key], patchVal); + } + }); + return result2; +} +var init_mergeTraits = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/utils/mergeTraits.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_index_es2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/utils/parseUrlVariables.js +function parseUrlVariables(str2) { + if (typeof str2 !== "string") + return []; + const variables = str2.match(/{(.+?)}/g); + if (!variables || variables.length === 0) + return []; + return variables.map((v8) => v8.slice(1, -1)); +} +var init_parseUrlVariables = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/utils/parseUrlVariables.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/utils/index.js +var init_utils3 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/utils/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getMissingProps(); + init_getRedundantProps(); + init_mergeTraits(); + init_parseUrlVariables(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/channelParameters.js +var import_spectral_core6, channelParameters; +var init_channelParameters = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/channelParameters.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core6 = __toESM(require_dist11()); + init_utils3(); + channelParameters = (0, import_spectral_core6.createRulesetFunction)({ + input: { + type: "object", + properties: { + parameters: { + type: "object" + } + }, + required: ["parameters"] + }, + options: null + }, (targetVal, _6, ctx) => { + const path2 = ctx.path[ctx.path.length - 1]; + const results = []; + const parameters = parseUrlVariables(path2); + if (parameters.length === 0) + return; + const missingParameters = getMissingProps(parameters, targetVal.parameters); + if (missingParameters.length) { + results.push({ + message: `Not all channel's parameters are described with "parameters" object. Missed: ${missingParameters.join(", ")}.`, + path: [...ctx.path, "parameters"] + }); + } + const redundantParameters = getRedundantProps(parameters, targetVal.parameters); + if (redundantParameters.length) { + redundantParameters.forEach((param) => { + results.push({ + message: `Channel's "parameters" object has redundant defined "${param}" parameter.`, + path: [...ctx.path, "parameters", param] + }); + }); + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/channelServers.js +var import_spectral_core7, channelServers; +var init_channelServers = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/channelServers.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core7 = __toESM(require_dist11()); + channelServers = (0, import_spectral_core7.createRulesetFunction)({ + input: { + type: "object", + properties: { + servers: { + type: "object" + }, + channels: { + type: "object", + additionalProperties: { + type: "object", + properties: { + servers: { + type: "array", + items: { + type: "string" + } + } + } + } + } + } + }, + options: null + }, (targetVal) => { + var _a2, _b; + const results = []; + if (!targetVal.channels) + return results; + const serverNames = Object.keys((_a2 = targetVal.servers) !== null && _a2 !== void 0 ? _a2 : {}); + Object.entries((_b = targetVal.channels) !== null && _b !== void 0 ? _b : {}).forEach(([channelAddress, channel]) => { + if (!channel.servers) + return; + channel.servers.forEach((serverName, index4) => { + if (!serverNames.includes(serverName)) { + results.push({ + message: 'Channel contains server that are not defined on the "servers" object.', + path: ["channels", channelAddress, "servers", index4] + }); + } + }); + }); + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/checkId.js +var import_spectral_core8, import_spectral_functions4, checkId; +var init_checkId = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/checkId.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core8 = __toESM(require_dist11()); + import_spectral_functions4 = __toESM(require_dist14()); + init_utils3(); + checkId = (0, import_spectral_core8.createRulesetFunction)({ + input: { + type: "object", + properties: { + traits: { + type: "array", + items: { + type: "object" + } + } + } + }, + options: { + type: "object", + properties: { + idField: { + type: "string", + enum: ["operationId", "messageId"] + } + } + } + }, (targetVal, options, ctx) => { + const mergedValue = mergeTraits(targetVal); + return (0, import_spectral_functions4.truthy)(mergedValue[options.idField], null, ctx); + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageExamples.js +function serializeSchema(schema8, type3) { + if (!schema8 && typeof schema8 !== "boolean") { + if (type3 === "headers") { + schema8 = { type: "object" }; + } else { + schema8 = {}; + } + } else if (typeof schema8 === "boolean") { + if (schema8 === true) { + schema8 = {}; + } else { + schema8 = { not: {} }; + } + } + return schema8; +} +function getMessageExamples(message) { + var _a2; + if (!Array.isArray(message.examples)) { + return []; + } + return (_a2 = message.examples.map((example, index4) => { + return { + path: ["examples", index4], + value: example + }; + })) !== null && _a2 !== void 0 ? _a2 : []; +} +function validate(value2, path2, type3, schema8, ctx) { + return (0, import_spectral_functions5.schema)(value2, { + allErrors: true, + schema: schema8 + }, Object.assign(Object.assign({}, ctx), { path: [...ctx.path, ...path2, type3] })); +} +var import_spectral_core9, import_spectral_functions5, messageExamples; +var init_messageExamples = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageExamples.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core9 = __toESM(require_dist11()); + import_spectral_functions5 = __toESM(require_dist14()); + messageExamples = (0, import_spectral_core9.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null + }, (targetVal, _6, ctx) => { + if (!targetVal.examples) + return; + const results = []; + const payloadSchema = serializeSchema(targetVal.payload, "payload"); + const headersSchema = serializeSchema(targetVal.headers, "headers"); + for (const example of getMessageExamples(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0) { + const errors = validate(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + if (value2.headers !== void 0) { + const errors = validate(value2.headers, path2, "headers", headersSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageExamples-spectral-rule-v2.js +function asyncApi2MessageExamplesParserRule(parser3) { + return { + description: "Examples of message object should validate against a payload with an explicit schemaFormat.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message[?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages[?(!@null && @.schemaFormat !== void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat !== void 0)]" + ], + then: { + function: rulesetFunction(parser3) + } + }; +} +function rulesetFunction(parser3) { + return (0, import_spectral_core10.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null + }, (targetVal, _6, ctx) => __awaiter13(this, void 0, void 0, function* () { + if (!targetVal.examples) + return; + if (!targetVal.payload) + return; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + rootPath: ctx.path, + schemaFormat, + defaultSchemaFormat + }; + const results = []; + const payloadSchemaResults = yield parseExampleSchema(parser3, targetVal.payload, input); + const payloadSchema = payloadSchemaResults.schema; + results.push(...payloadSchemaResults.errors); + for (const example of getMessageExamples(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0 && payloadSchema !== void 0) { + const errors = validate(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; + })); +} +function parseExampleSchema(parser3, schema8, input) { + return __awaiter13(this, void 0, void 0, function* () { + const path2 = [...input.rootPath, "payload"]; + if (schema8 === void 0) { + return { path: path2, schema: void 0, errors: [] }; + } + try { + const parseSchemaInput = { + asyncapi: input.asyncapi, + data: schema8, + meta: {}, + path: path2, + schemaFormat: input.schemaFormat, + defaultSchemaFormat: input.defaultSchemaFormat + }; + const parsedSchema = yield parseSchema(parser3, parseSchemaInput); + return { path: path2, schema: parsedSchema, errors: [] }; + } catch (err) { + const error2 = { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + }; + return { path: path2, schema: void 0, errors: [error2] }; + } + }); +} +var import_spectral_core10, __awaiter13; +var init_messageExamples_spectral_rule_v2 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageExamples-spectral-rule-v2.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core10 = __toESM(require_dist11()); + init_schema_parser(); + init_utils2(); + init_messageExamples(); + __awaiter13 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/utils/getAllOperations.js +function* getAllOperations(asyncapi) { + const channels = asyncapi === null || asyncapi === void 0 ? void 0 : asyncapi.channels; + if (!isObject3(channels)) { + return {}; + } + for (const [channelAddress, channel] of Object.entries(channels)) { + if (!isObject3(channel)) { + continue; + } + if (isObject3(channel.subscribe)) { + yield { + path: ["channels", channelAddress, "subscribe"], + kind: "subscribe", + operation: channel.subscribe + }; + } + if (isObject3(channel.publish)) { + yield { + path: ["channels", channelAddress, "publish"], + kind: "publish", + operation: channel.publish + }; + } + } +} +var init_getAllOperations = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/utils/getAllOperations.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_utils2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/utils/getAllMessages.js +function* getAllMessages(asyncapi) { + for (const { path: path2, operation } of getAllOperations(asyncapi)) { + if (!isObject3(operation)) { + continue; + } + const maybeMessage = operation.message; + if (!isObject3(maybeMessage)) { + continue; + } + const oneOf = maybeMessage.oneOf; + if (Array.isArray(oneOf)) { + for (const [index4, message] of oneOf.entries()) { + if (isObject3(message)) { + yield { + path: [...path2, "message", "oneOf", index4], + message + }; + } + } + } else { + yield { + path: [...path2, "message"], + message: maybeMessage + }; + } + } +} +var init_getAllMessages = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/utils/getAllMessages.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_utils2(); + init_getAllOperations(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/utils/index.js +var init_utils4 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/utils/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_getAllMessages(); + init_getAllOperations(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageIdUniqueness.js +function retrieveMessageId(message) { + if (Array.isArray(message.traits)) { + for (let i7 = message.traits.length - 1; i7 >= 0; i7--) { + const trait = message.traits[i7]; + if (isObject3(trait) && typeof trait.messageId === "string") { + return { + messageId: trait.messageId, + path: ["traits", i7, "messageId"] + }; + } + } + } + if (typeof message.messageId === "string") { + return { + messageId: message.messageId, + path: ["messageId"] + }; + } + return void 0; +} +var import_spectral_core11, messageIdUniqueness; +var init_messageIdUniqueness = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/messageIdUniqueness.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core11 = __toESM(require_dist11()); + init_utils4(); + init_utils2(); + messageIdUniqueness = (0, import_spectral_core11.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + }, + publish: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + } + } + } + } + }, + options: null + }, (targetVal) => { + const results = []; + const messages = getAllMessages(targetVal); + const seenIds = []; + for (const { path: path2, message } of messages) { + const maybeMessageId = retrieveMessageId(message); + if (maybeMessageId === void 0) { + continue; + } + if (seenIds.includes(maybeMessageId.messageId)) { + results.push({ + message: '"messageId" must be unique across all the messages.', + path: [...path2, ...maybeMessageId.path] + }); + } else { + seenIds.push(maybeMessageId.messageId); + } + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/operationIdUniqueness.js +function retrieveOperationId(operation) { + if (Array.isArray(operation.traits)) { + for (let i7 = operation.traits.length - 1; i7 >= 0; i7--) { + const trait = operation.traits[i7]; + if (isObject3(trait) && typeof trait.operationId === "string") { + return { + operationId: trait.operationId, + path: ["traits", i7, "operationId"] + }; + } + } + } + if (typeof operation.operationId === "string") { + return { + operationId: operation.operationId, + path: ["operationId"] + }; + } + return void 0; +} +var import_spectral_core12, operationIdUniqueness; +var init_operationIdUniqueness = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/operationIdUniqueness.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core12 = __toESM(require_dist11()); + init_utils4(); + init_utils2(); + operationIdUniqueness = (0, import_spectral_core12.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object" + }, + publish: { + type: "object" + } + } + } + } + }, + options: null + }, (targetVal) => { + const results = []; + const operations = getAllOperations(targetVal); + const seenIds = []; + for (const { path: path2, operation } of operations) { + const maybeOperationId = retrieveOperationId(operation); + if (maybeOperationId === void 0) { + continue; + } + if (seenIds.includes(maybeOperationId.operationId)) { + results.push({ + message: '"operationId" must be unique across all the operations.', + path: [...path2, ...maybeOperationId.path] + }); + } else { + seenIds.push(maybeOperationId.operationId); + } + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/schemaValidation.js +function getRelevantItems(target, type3) { + if (type3 === "default") { + return [{ path: ["default"], value: target.default }]; + } + if (!Array.isArray(target.examples)) { + return []; + } + return Array.from(target.examples.entries()).map(([key, value2]) => ({ + path: ["examples", key], + value: value2 + })); +} +var import_spectral_core13, import_spectral_functions6, schemaValidation; +var init_schemaValidation = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/schemaValidation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core13 = __toESM(require_dist11()); + import_spectral_functions6 = __toESM(require_dist14()); + schemaValidation = (0, import_spectral_core13.createRulesetFunction)({ + input: { + type: "object", + properties: { + default: {}, + examples: { + type: "array" + } + }, + errorMessage: '#{{print("property")}must be an object containing "default" or an "examples" array' + }, + errorOnInvalidInput: true, + options: { + type: "object", + properties: { + type: { + enum: ["default", "examples"] + } + }, + additionalProperties: false, + required: ["type"] + } + }, (targetVal, opts, context2) => { + const schemaObject = targetVal; + const results = []; + for (const relevantItem of getRelevantItems(targetVal, opts.type)) { + const result2 = (0, import_spectral_functions6.schema)(relevantItem.value, { + schema: schemaObject, + allErrors: true + }, Object.assign(Object.assign({}, context2), { path: [...context2.path, ...relevantItem.path] })); + if (Array.isArray(result2) && typeof relevantItem.value !== "string") { + results.push(...result2); + } + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/security.js +function getAllScopes(oauth2) { + const scopes = []; + oAuth2Keys.forEach((key) => { + const flow2 = oauth2[key]; + if (isObject3(flow2)) { + scopes.push(...Object.keys(flow2.scopes)); + } + }); + return Array.from(new Set(scopes)); +} +var import_spectral_core14, oAuth2Keys, security; +var init_security = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/security.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core14 = __toESM(require_dist11()); + init_utils2(); + oAuth2Keys = ["implicit", "password", "clientCredentials", "authorizationCode"]; + security = (0, import_spectral_core14.createRulesetFunction)({ + input: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + } + } + }, + options: { + type: "object", + properties: { + objectType: { + type: "string", + enum: ["Server", "Operation"] + } + } + } + }, (targetVal = {}, { objectType: objectType2 }, ctx) => { + var _a2, _b; + const results = []; + const spec = ctx.document.data; + const securitySchemes = (_b = (_a2 = spec === null || spec === void 0 ? void 0 : spec.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) !== null && _b !== void 0 ? _b : {}; + const securitySchemesKeys = Object.keys(securitySchemes); + Object.keys(targetVal).forEach((securityKey) => { + var _a3; + if (!securitySchemesKeys.includes(securityKey)) { + results.push({ + message: `${objectType2} must not reference an undefined security scheme.`, + path: [...ctx.path, securityKey] + }); + } + const securityScheme = securitySchemes[securityKey]; + if ((securityScheme === null || securityScheme === void 0 ? void 0 : securityScheme.type) === "oauth2") { + const availableScopes = getAllScopes((_a3 = securityScheme.flows) !== null && _a3 !== void 0 ? _a3 : {}); + targetVal[securityKey].forEach((securityScope, index4) => { + if (!availableScopes.includes(securityScope)) { + results.push({ + message: `Non-existing security scope for the specified security scheme. Available: [${availableScopes.join(", ")}]`, + path: [...ctx.path, securityKey, index4] + }); + } + }); + } + }); + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/serverVariables.js +var import_spectral_core15, serverVariables; +var init_serverVariables = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/serverVariables.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core15 = __toESM(require_dist11()); + init_utils3(); + serverVariables = (0, import_spectral_core15.createRulesetFunction)({ + input: { + type: "object", + properties: { + url: { + type: "string" + }, + variables: { + type: "object" + } + }, + required: ["url", "variables"] + }, + options: null + }, (targetVal, _6, ctx) => { + const results = []; + const variables = parseUrlVariables(targetVal.url); + if (variables.length === 0) + return results; + const missingVariables = getMissingProps(variables, targetVal.variables); + if (missingVariables.length) { + results.push({ + message: `Not all server's variables are described with "variables" object. Missed: ${missingVariables.join(", ")}.`, + path: [...ctx.path, "variables"] + }); + } + const redundantVariables = getRedundantProps(variables, targetVal.variables); + if (redundantVariables.length) { + redundantVariables.forEach((variable) => { + results.push({ + message: `Server's "variables" object has redundant defined "${variable}" url variable.`, + path: [...ctx.path, "variables", variable] + }); + }); + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/functions/unusedSecuritySchemes.js +var import_spectral_core16, unusedSecuritySchemes; +var init_unusedSecuritySchemes = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/functions/unusedSecuritySchemes.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core16 = __toESM(require_dist11()); + init_utils4(); + init_utils2(); + unusedSecuritySchemes = (0, import_spectral_core16.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null + }, (targetVal) => { + var _a2; + const securitySchemes = (_a2 = targetVal.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes; + if (!isObject3(securitySchemes)) { + return; + } + const usedSecuritySchemes = []; + if (isObject3(targetVal.servers)) { + Object.values(targetVal.servers).forEach((server) => { + if (Array.isArray(server.security)) { + server.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + }); + } + const operations = getAllOperations(targetVal); + for (const { operation } of operations) { + if (Array.isArray(operation.security)) { + operation.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + } + const usedSecuritySchemesSet = new Set(usedSecuritySchemes); + const securitySchemesKinds = Object.keys(securitySchemes); + const results = []; + securitySchemesKinds.forEach((securitySchemeKind) => { + if (!usedSecuritySchemesSet.has(securitySchemeKind)) { + results.push({ + message: "Potentially unused security scheme has been detected in AsyncAPI document.", + path: ["components", "securitySchemes", securitySchemeKind] + }); + } + }); + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/functions/uniquenessTags.js +function getDuplicateTagsIndexes(tags6) { + return tags6.map((item) => item.name).reduce((acc, item, i7, arr) => { + if (arr.indexOf(item) !== i7) { + acc.push(i7); + } + return acc; + }, []); +} +var import_spectral_core17, uniquenessTags; +var init_uniquenessTags = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/functions/uniquenessTags.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core17 = __toESM(require_dist11()); + uniquenessTags = (0, import_spectral_core17.createRulesetFunction)({ + input: { + type: "array", + items: { + type: "object", + properties: { + name: { + type: "string" + } + }, + required: ["name"] + } + }, + options: null + }, (targetVal, _6, ctx) => { + const duplicatedTags = getDuplicateTagsIndexes(targetVal); + if (duplicatedTags.length === 0) { + return []; + } + const results = []; + for (const duplicatedIndex of duplicatedTags) { + const duplicatedTag = targetVal[duplicatedIndex].name; + results.push({ + message: `"tags" object contains duplicate tag name "${duplicatedTag}".`, + path: [...ctx.path, duplicatedIndex, "name"] + }); + } + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/schema-parser/spectral-rule-v2.js +function asyncApi2SchemaParserRule(parser3) { + return { + description: "Custom schema must be correctly formatted from the point of view of the used format.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" + ], + then: { + function: rulesetFunction2(parser3) + } + }; +} +function rulesetFunction2(parser3) { + return (0, import_spectral_core18.createRulesetFunction)({ + input: { + type: "object", + properties: { + schemaFormat: { + type: "string" + }, + payload: true + // any value + } + }, + options: null + }, (targetVal = {}, _6, ctx) => __awaiter14(this, void 0, void 0, function* () { + if (!targetVal.payload) { + return []; + } + const path2 = [...ctx.path, "payload"]; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + data: targetVal.payload, + meta: {}, + path: path2, + schemaFormat, + defaultSchemaFormat + }; + try { + return yield validateSchema(parser3, input); + } catch (err) { + return [ + { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + } + ]; + } + })); +} +var import_spectral_core18, __awaiter14; +var init_spectral_rule_v2 = __esm({ + "node_modules/@asyncapi/parser/esm/schema-parser/spectral-rule-v2.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core18 = __toESM(require_dist11()); + init_schema_parser(); + init_utils2(); + __awaiter14 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/ruleset.js +var import_spectral_functions7, v2CoreRuleset, v2SchemasRuleset, v2RecommendedRuleset; +var init_ruleset2 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/ruleset.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_formats(); + import_spectral_functions7 = __toESM(require_dist14()); + init_channelParameters(); + init_channelServers(); + init_checkId(); + init_messageExamples(); + init_messageExamples_spectral_rule_v2(); + init_messageIdUniqueness(); + init_operationIdUniqueness(); + init_schemaValidation(); + init_security(); + init_serverVariables(); + init_unusedSecuritySchemes(); + init_uniquenessTags(); + init_spectral_rule_v2(); + v2CoreRuleset = { + description: "Core AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Server Object rules + */ + "asyncapi2-server-security": { + description: "Server have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.servers.*.security.*", + then: { + function: security, + functionOptions: { + objectType: "Server" + } + } + }, + "asyncapi2-server-variables": { + description: "Server variables must be defined and there must be no redundant variables.", + message: "{{error}}", + severity: "error", + recommended: true, + given: ["$.servers.*", "$.components.servers.*"], + then: { + function: serverVariables + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-parameters": { + description: "Channel parameters must be defined and there must be no redundant parameters.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels.*", + then: { + function: channelParameters + } + }, + "asyncapi2-channel-servers": { + description: 'Channel servers must be defined in the "servers" object.', + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: channelServers + } + }, + "asyncapi2-channel-no-query-nor-fragment": { + description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', + severity: "error", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions7.pattern, + functionOptions: { + notMatch: "[\\?#]" + } + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId-uniqueness": { + description: '"operationId" must be unique across all the operations.', + severity: "error", + recommended: true, + given: "$", + then: { + function: operationIdUniqueness + } + }, + "asyncapi2-operation-security": { + description: "Operation have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels[*][publish,subscribe].security.*", + then: { + function: security, + functionOptions: { + objectType: "Operation" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-examples": { + description: 'Examples of message object should validate againt the "payload" and "headers" schemas.', + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages[?(!@null && @.schemaFormat === void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat === void 0)]" + ], + then: { + function: messageExamples + } + }, + "asyncapi2-message-messageId-uniqueness": { + description: '"messageId" must be unique across all the messages.', + severity: "error", + recommended: true, + given: "$", + then: { + function: messageIdUniqueness + } + }, + /** + * Misc rules + */ + "asyncapi2-tags-uniqueness": { + description: "Each tag must have a unique name.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // root + "$.tags", + // operations + "$.channels.*.[publish,subscribe].tags", + "$.components.channels.*.[publish,subscribe].tags", + // operation traits + "$.channels.*.[publish,subscribe].traits.*.tags", + "$.components.channels.*.[publish,subscribe].traits.*.tags", + "$.components.operationTraits.*.tags", + // messages + "$.channels.*.[publish,subscribe].message.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.channels.*.[publish,subscribe].message.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.messages.*.tags", + // message traits + "$.channels.*.[publish,subscribe].message.traits.*.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.messages.*.traits.*.tags", + "$.components.messageTraits.*.tags" + ], + then: { + function: uniquenessTags + } + } + } + }; + v2SchemasRuleset = (parser3) => { + return { + description: "Schemas AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).formats(), + rules: { + "asyncapi2-schemas": asyncApi2SchemaParserRule(parser3), + "asyncapi2-schema-default": { + description: "Default must be valid against its defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.channels.*.parameters.*.schema.default^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.components.channels.*.parameters.*.schema.default^", + "$.components.schemas.*.default^", + "$.components.parameters.*.schema.default^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.default^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.default^" + ], + then: { + function: schemaValidation, + functionOptions: { + type: "default" + } + } + }, + "asyncapi2-schema-examples": { + description: "Examples must be valid against their defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.channels.*.parameters.*.schema.examples^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.components.channels.*.parameters.*.schema.examples^", + "$.components.schemas.*.examples^", + "$.components.parameters.*.schema.examples^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.examples^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.examples^" + ], + then: { + function: schemaValidation, + functionOptions: { + type: "examples" + } + } + }, + "asyncapi2-message-examples-custom-format": asyncApi2MessageExamplesParserRule(parser3) + } + }; + }; + v2RecommendedRuleset = { + description: "Recommended AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi2-tags": { + description: 'AsyncAPI object should have non-empty "tags" array.', + recommended: true, + given: "$", + then: { + field: "tags", + function: import_spectral_functions7.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi2-server-no-empty-variable": { + description: "Server URL should not have empty variable substitution pattern.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions7.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-server-no-trailing-slash": { + description: "Server URL should not end with slash.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions7.pattern, + functionOptions: { + notMatch: "/$" + } + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-no-empty-parameter": { + description: "Channel address should not have empty parameter substitution pattern.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions7.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-channel-no-trailing-slash": { + description: "Channel address should not end with slash.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions7.pattern, + functionOptions: { + notMatch: ".+\\/$" + } + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId": { + description: 'Operation should have an "operationId" field defined.', + recommended: true, + given: ["$.channels[*][publish,subscribe]", "$.components.channels[*][publish,subscribe]"], + then: { + function: checkId, + functionOptions: { + idField: "operationId" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-messageId": { + description: 'Message should have a "messageId" field defined.', + recommended: true, + formats: AsyncAPIFormats.filterByMajorVersions(["2"]).excludeByVersions(["2.0.0", "2.1.0", "2.2.0", "2.3.0"]).formats(), + given: [ + '$.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.channels.*.[publish,subscribe].message.oneOf.*", + '$.components.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" + ], + then: { + function: checkId, + functionOptions: { + idField: "messageId" + } + } + }, + /** + * Component Object rules + */ + "asyncapi2-unused-securityScheme": { + description: "Potentially unused security scheme has been detected in AsyncAPI document.", + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedSecuritySchemes + } + } + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v2/index.js +var init_v22 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v2/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ruleset2(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v3/functions/operationMessagesUnambiguity.js +var import_spectral_core19, referenceSchema, operationMessagesUnambiguity; +var init_operationMessagesUnambiguity = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v3/functions/operationMessagesUnambiguity.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core19 = __toESM(require_dist11()); + referenceSchema = { + type: "object", + properties: { + $ref: { + type: "string", + format: "uri-reference" + } + } + }; + operationMessagesUnambiguity = (0, import_spectral_core19.createRulesetFunction)({ + input: { + type: "object", + properties: { + channel: referenceSchema, + messages: { + type: "array", + items: referenceSchema + } + } + }, + options: null + }, (targetVal, _6, ctx) => { + var _a2, _b; + const results = []; + const channelPointer = (_a2 = targetVal.channel) === null || _a2 === void 0 ? void 0 : _a2.$ref; + (_b = targetVal.messages) === null || _b === void 0 ? void 0 : _b.forEach((message, index4) => { + if (message.$ref && !message.$ref.startsWith(`${channelPointer}/messages`)) { + results.push({ + message: "Operation message does not belong to the specified channel.", + path: [...ctx.path, "messages", index4] + }); + } + }); + return results; + }); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v3/ruleset.js +var import_spectral_functions8, v3CoreRuleset; +var init_ruleset3 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v3/ruleset.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_formats(); + init_operationMessagesUnambiguity(); + import_spectral_functions8 = __toESM(require_dist14()); + init_channelServers(); + v3CoreRuleset = { + description: "Core AsyncAPI 3.x.x ruleset.", + formats: AsyncAPIFormats.filterByMajorVersions(["3"]).formats(), + rules: { + /** + * Operation Object rules + */ + "asyncapi3-operation-messages-from-referred-channel": { + description: 'Operation "messages" must be a subset of the messages defined in the channel referenced in this operation.', + message: "{{error}}", + severity: "error", + recommended: true, + resolved: false, + given: [ + "$.operations.*", + "$.components.operations.*" + ], + then: { + function: operationMessagesUnambiguity + } + }, + "asyncapi3-required-operation-channel-unambiguity": { + description: 'The "channel" field of an operation under the root "operations" object must always reference a channel under the root "channels" object.', + severity: "error", + recommended: true, + resolved: false, + given: "$.operations.*", + then: { + field: "channel.$ref", + function: import_spectral_functions8.pattern, + functionOptions: { + match: "#\\/channels\\/" + // If doesn't match, rule fails. + } + } + }, + /** + * Channel Object rules + */ + "asyncapi3-required-channel-servers-unambiguity": { + description: 'The "servers" field of a channel under the root "channels" object must always reference a subset of the servers under the root "servers" object.', + severity: "error", + recommended: true, + resolved: false, + given: "$.channels.*", + then: { + field: "$.servers.*.$ref", + function: import_spectral_functions8.pattern, + functionOptions: { + match: "#\\/servers\\/" + // If doesn't match, rule fails. + } + } + }, + "asyncapi3-channel-servers": { + description: 'Channel servers must be defined in the "servers" object.', + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: channelServers + } + }, + "asyncapi3-channel-no-query-nor-fragment": { + description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', + severity: "error", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions8.pattern, + functionOptions: { + notMatch: "[\\?#]" + } + } + } + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/v3/index.js +var init_v32 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/v3/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ruleset3(); + } +}); + +// node_modules/@asyncapi/parser/esm/ruleset/index.js +function createRuleset(parser3, options) { + var _a2; + const _b = options || {}, { core: useCore = true, recommended: useRecommended = true } = _b, rest2 = __rest10(_b, ["core", "recommended"]); + const extendedRuleset = [ + useCore && coreRuleset, + useRecommended && recommendedRuleset, + useCore && v2CoreRuleset, + useCore && v2SchemasRuleset(parser3), + useRecommended && v2RecommendedRuleset, + useCore && v3CoreRuleset, + ...((_a2 = options || {}) === null || _a2 === void 0 ? void 0 : _a2.extends) || [] + ].filter(Boolean); + return Object.assign(Object.assign({}, rest2 || {}), { extends: extendedRuleset }); +} +var __rest10; +var init_ruleset4 = __esm({ + "node_modules/@asyncapi/parser/esm/ruleset/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_ruleset(); + init_v22(); + init_v32(); + __rest10 = function(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; + }; + } +}); + +// node_modules/@asyncapi/parser/esm/resolver.js +function createResolver(options = {}) { + const availableResolvers = [ + ...createDefaultResolvers(), + ...options.resolvers || [] + ].map((r8) => Object.assign(Object.assign({}, r8), { order: r8.order || Number.MAX_SAFE_INTEGER, canRead: typeof r8.canRead === "undefined" ? true : r8.canRead })); + const availableSchemas = [...new Set(availableResolvers.map((r8) => r8.schema))]; + const resolvers = availableSchemas.reduce((acc, schema8) => { + acc[schema8] = { resolve: createSchemaResolver(schema8, availableResolvers) }; + return acc; + }, {}); + const cache = options.cache !== false; + return new import_spectral_ref_resolver.Resolver({ + uriCache: cache ? void 0 : new import_cache.Cache({ stdTTL: 1 }), + resolvers + }); +} +function createDefaultResolvers() { + return [ + { + schema: "file", + read: import_json_ref_readers.resolveFile + }, + { + schema: "https", + read: import_json_ref_readers.resolveHttp + }, + { + schema: "http", + read: import_json_ref_readers.resolveHttp + } + ]; +} +function createSchemaResolver(schema8, allResolvers) { + const resolvers = allResolvers.filter((r8) => r8.schema === schema8).sort((a7, b8) => { + return a7.order - b8.order; + }); + return (uri, ctx) => __awaiter15(this, void 0, void 0, function* () { + let result2 = void 0; + let lastError; + for (const resolver of resolvers) { + try { + if (!canRead(resolver, uri, ctx)) + continue; + result2 = yield resolver.read(uri, ctx); + if (typeof result2 === "string") { + break; + } + } catch (e10) { + lastError = e10; + continue; + } + } + if (typeof result2 !== "string") { + throw lastError || new Error(`None of the available resolvers for "${schema8}" can resolve the given reference.`); + } + return result2; + }); +} +function canRead(resolver, uri, ctx) { + return typeof resolver.canRead === "function" ? resolver.canRead(uri, ctx) : resolver.canRead; +} +var import_spectral_ref_resolver, import_cache, import_json_ref_readers, __awaiter15; +var init_resolver = __esm({ + "node_modules/@asyncapi/parser/esm/resolver.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_ref_resolver = __toESM(require_dist7()); + import_cache = __toESM(require_cache()); + import_json_ref_readers = __toESM(require_json_ref_readers()); + __awaiter15 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/spectral.js +function createSpectral(parser3, options = {}) { + var _a2; + const resolverOptions = (_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver; + const spectral = new import_spectral_core20.Spectral({ resolver: createResolver(resolverOptions) }); + const ruleset = createRuleset(parser3, options.ruleset); + spectral.setRuleset(ruleset); + return spectral; +} +var import_spectral_core20; +var init_spectral = __esm({ + "node_modules/@asyncapi/parser/esm/spectral.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core20 = __toESM(require_dist11()); + init_ruleset4(); + init_resolver(); + } +}); + +// node_modules/@asyncapi/parser/esm/validate.js +function validate2(parser3, parserSpectral, asyncapi, options = {}) { + var _a2; + return __awaiter16(this, void 0, void 0, function* () { + let document2; + try { + const { allowedSeverity } = mergePatch(defaultOptions, options); + const stringifiedDocument = normalizeInput(asyncapi); + document2 = new import_spectral_core21.Document(stringifiedDocument, import_spectral_parsers.Yaml, options.source); + document2.__parserInput = asyncapi; + const spectral = ((_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver) ? createSpectral(parser3, options) : parserSpectral; + let { resolved: validated, results } = yield spectral.runWithResolved(document2, {}); + if (!(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.error) && hasErrorDiagnostic(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.warning) && hasWarningDiagnostic(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.info) && hasInfoDiagnostic(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.hint) && hasHintDiagnostic(results)) { + validated = void 0; + } + return { validated, diagnostics: results, extras: { document: document2 } }; + } catch (err) { + return { validated: void 0, diagnostics: createUncaghtDiagnostic(err, "Error thrown during AsyncAPI document validation", document2), extras: { document: document2 } }; + } + }); +} +var import_spectral_core21, import_spectral_parsers, __awaiter16, defaultOptions; +var init_validate = __esm({ + "node_modules/@asyncapi/parser/esm/validate.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_spectral_core21 = __toESM(require_dist11()); + import_spectral_parsers = __toESM(require_dist4()); + init_spectral(); + init_utils2(); + __awaiter16 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + defaultOptions = { + allowedSeverity: { + error: false, + warning: true, + info: true, + hint: true + }, + __unstable: {} + }; + } +}); + +// node_modules/@asyncapi/parser/esm/parse.js +function parse5(parser3, spectral, asyncapi, options = {}) { + return __awaiter17(this, void 0, void 0, function* () { + let spectralDocument; + try { + options = mergePatch(defaultOptions2, options); + const { validated, diagnostics, extras } = yield validate2(parser3, spectral, asyncapi, Object.assign(Object.assign({}, options.validateOptions), { source: options.source, __unstable: options.__unstable })); + if (validated === void 0) { + return { + document: void 0, + diagnostics, + extras + }; + } + spectralDocument = extras.document; + const inventory = spectralDocument.__documentInventory; + const validatedDoc = copy(validated); + applyUniqueIds(validatedDoc); + const detailed = createDetailedAsyncAPI(validatedDoc, asyncapi, options.source); + const document2 = createAsyncAPIDocument(detailed); + setExtension(xParserSpecParsed, true, document2); + setExtension(xParserApiVersion, ParserAPIVersion, document2); + yield customOperations(parser3, document2, detailed, inventory, options); + return { + document: document2, + diagnostics, + extras + }; + } catch (err) { + return { document: void 0, diagnostics: createUncaghtDiagnostic(err, "Error thrown during AsyncAPI document parsing", spectralDocument), extras: void 0 }; + } + }); +} +var __awaiter17, defaultOptions2; +var init_parse = __esm({ + "node_modules/@asyncapi/parser/esm/parse.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_models(); + init_custom_operations(); + init_validate(); + init_stringify2(); + init_document(); + init_utils2(); + init_constants(); + __awaiter17 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + defaultOptions2 = { + applyTraits: true, + parseSchemas: true, + validateOptions: {}, + __unstable: {} + }; + } +}); + +// node_modules/@asyncapi/parser/esm/schema-parser/asyncapi-schema-parser.js +function AsyncAPISchemaParser() { + return { + validate: validate3, + parse: parse6, + getMimeTypes + }; +} +function validate3(input) { + return __awaiter18(this, void 0, void 0, function* () { + const version5 = input.asyncapi.semver.version; + const validator = getSchemaValidator(version5); + let result2 = []; + const valid = validator(input.data); + if (!valid && validator.errors) { + result2 = ajvToSpectralResult(input.path, [...validator.errors]); + } + return result2; + }); +} +function parse6(input) { + return __awaiter18(this, void 0, void 0, function* () { + return input.data; + }); +} +function getMimeTypes() { + const mimeTypes = [ + "application/schema;version=draft-07", + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ]; + specVersions.forEach((version5) => { + mimeTypes.push(`application/vnd.aai.asyncapi;version=${version5}`, `application/vnd.aai.asyncapi+json;version=${version5}`, `application/vnd.aai.asyncapi+yaml;version=${version5}`); + }); + return mimeTypes; +} +function ajvToSpectralResult(path2, errors) { + return errors.map((error2) => { + return { + message: error2.message, + path: [...path2, ...error2.instancePath.replace(/^\//, "").split("/")] + }; + }); +} +function getSchemaValidator(version5) { + const ajv2 = getAjvInstance(); + let validator = ajv2.getSchema(version5); + if (!validator) { + const schema8 = preparePayloadSchema(import_specs4.default.schemas[version5], version5); + ajv2.addSchema(schema8, version5); + validator = ajv2.getSchema(version5); + } + return validator; +} +function preparePayloadSchema(asyncapiSchema, version5) { + const payloadSchema = `http://asyncapi.com/definitions/${version5}/schema.json`; + const definitions = asyncapiSchema.definitions; + if (definitions === void 0) { + throw new Error("AsyncAPI schema must contain definitions"); + } + delete definitions["http://json-schema.org/draft-07/schema"]; + delete definitions["http://json-schema.org/draft-04/schema"]; + return { + $ref: payloadSchema, + definitions + }; +} +function getAjvInstance() { + if (_ajv) { + return _ajv; + } + _ajv = new import_ajv.default({ + allErrors: true, + meta: true, + messages: true, + strict: false, + allowUnionTypes: true, + unicodeRegExp: false + }); + (0, import_ajv_formats.default)(_ajv); + (0, import_ajv_errors.default)(_ajv); + return _ajv; +} +var import_ajv, import_ajv_formats, import_ajv_errors, import_specs4, __awaiter18, _ajv; +var init_asyncapi_schema_parser = __esm({ + "node_modules/@asyncapi/parser/esm/schema-parser/asyncapi-schema-parser.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + import_ajv = __toESM(require_ajv()); + import_ajv_formats = __toESM(require_dist9()); + import_ajv_errors = __toESM(require_dist10()); + import_specs4 = __toESM(require_specs()); + init_constants(); + __awaiter18 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/parser.js +var __awaiter19, Parser3; +var init_parser3 = __esm({ + "node_modules/@asyncapi/parser/esm/parser.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_document(); + init_parse(); + init_validate(); + init_schema_parser(); + init_asyncapi_schema_parser(); + init_spectral(); + __awaiter19 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Parser3 = class { + constructor(options = {}) { + var _a2; + this.options = options; + this.parserRegistry = /* @__PURE__ */ new Map(); + this.spectral = createSpectral(this, options); + this.registerSchemaParser(AsyncAPISchemaParser()); + (_a2 = this.options.schemaParsers) === null || _a2 === void 0 ? void 0 : _a2.forEach((parser3) => this.registerSchemaParser(parser3)); + } + parse(asyncapi, options) { + return __awaiter19(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument(asyncapi); + if (maybeDocument) { + return { + document: maybeDocument, + diagnostics: [] + }; + } + return parse5(this, this.spectral, asyncapi, options); + }); + } + validate(asyncapi, options) { + return __awaiter19(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument(asyncapi); + if (maybeDocument) { + return []; + } + return (yield validate2(this, this.spectral, asyncapi, options)).diagnostics; + }); + } + registerSchemaParser(parser3) { + return registerSchemaParser(this, parser3); + } + }; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-DtcTpLWz.js +function dew$k() { + if (_dewExec$k) + return exports$k; + _dewExec$k = true; + exports$k = function hasSymbols() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; + return exports$k; +} +function dew$j() { + if (_dewExec$j) + return exports$j; + _dewExec$j = true; + exports$j = Error; + return exports$j; +} +function dew$i() { + if (_dewExec$i) + return exports$i; + _dewExec$i = true; + exports$i = EvalError; + return exports$i; +} +function dew$h() { + if (_dewExec$h) + return exports$h; + _dewExec$h = true; + exports$h = RangeError; + return exports$h; +} +function dew$g() { + if (_dewExec$g) + return exports$g; + _dewExec$g = true; + exports$g = ReferenceError; + return exports$g; +} +function dew$f() { + if (_dewExec$f) + return exports$f; + _dewExec$f = true; + exports$f = SyntaxError; + return exports$f; +} +function dew$e() { + if (_dewExec$e) + return exports$e; + _dewExec$e = true; + exports$e = TypeError; + return exports$e; +} +function dew$d() { + if (_dewExec$d) + return exports$d; + _dewExec$d = true; + exports$d = URIError; + return exports$d; +} +function dew$c() { + if (_dewExec$c) + return exports$c; + _dewExec$c = true; + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = dew$k(); + exports$c = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; + } + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); + }; + return exports$c; +} +function dew$b() { + if (_dewExec$b) + return exports$b; + _dewExec$b = true; + var test = { + __proto__: null, + foo: {} + }; + var $Object = Object; + exports$b = function hasProto() { + return { + __proto__: test + }.foo === test.foo && !(test instanceof $Object); + }; + return exports$b; +} +function dew$a() { + if (_dewExec$a) + return exports$a; + _dewExec$a = true; + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max2 = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a7, b8) { + var arr = []; + for (var i7 = 0; i7 < a7.length; i7 += 1) { + arr[i7] = a7[i7]; + } + for (var j6 = 0; j6 < b8.length; j6 += 1) { + arr[j6 + a7.length] = b8[j6]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i7 = offset, j6 = 0; i7 < arrLike.length; i7 += 1, j6 += 1) { + arr[j6] = arrLike[i7]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str2 = ""; + for (var i7 = 0; i7 < arr.length; i7 += 1) { + str2 += arr[i7]; + if (i7 + 1 < arr.length) { + str2 += joiner; + } + } + return str2; + }; + exports$a = function bind2(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result2 = target.apply(this, concatty(args, arguments)); + if (Object(result2) === result2) { + return result2; + } + return this; + } + return target.apply(that, concatty(args, arguments)); + }; + var boundLength = max2(0, target.length - args.length); + var boundArgs = []; + for (var i7 = 0; i7 < boundLength; i7++) { + boundArgs[i7] = "$" + i7; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + return exports$a; +} +function dew$9() { + if (_dewExec$9) + return exports$9; + _dewExec$9 = true; + var implementation = dew$a(); + exports$9 = Function.prototype.bind || implementation; + return exports$9; +} +function dew$8() { + if (_dewExec$8) + return exports$8; + _dewExec$8 = true; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind2 = dew$9(); + exports$8 = bind2.call(call, $hasOwn); + return exports$8; +} +function dew$7() { + if (_dewExec$7) + return exports$7; + _dewExec$7 = true; + var undefined$1; + var $Error = dew$j(); + var $EvalError = dew$i(); + var $RangeError = dew$h(); + var $ReferenceError = dew$g(); + var $SyntaxError = dew$f(); + var $TypeError = dew$e(); + var $URIError = dew$d(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e10) { + } + }; + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ""); + } catch (e10) { + $gOPD = null; + } + } + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols = dew$c()(); + var hasProto = dew$b()(); + var getProto = Object.getPrototypeOf || (hasProto ? function(x7) { + return x7.__proto__; + } : null); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined$1 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined$1 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1, + "%AsyncFromSyncIteratorPrototype%": undefined$1, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined$1 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined$1 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined$1 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined$1 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined$1 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + // eslint-disable-line no-eval + "%EvalError%": $EvalError, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined$1 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1, + "%JSON%": typeof JSON === "object" ? JSON : undefined$1, + "%Map%": typeof Map === "undefined" ? undefined$1 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": Object, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined$1 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined$1 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined$1 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined$1 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined$1 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined$1, + "%Symbol%": hasSymbols ? Symbol : undefined$1, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined$1 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined$1 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined$1 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined$1 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined$1 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined$1 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined$1 : WeakSet + }; + if (getProto) { + try { + null.error; + } catch (e10) { + var errorProto = getProto(getProto(e10)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var doEval = function doEval2(name2) { + var value2; + if (name2 === "%AsyncFunction%") { + value2 = getEvalledConstructor("async function () {}"); + } else if (name2 === "%GeneratorFunction%") { + value2 = getEvalledConstructor("function* () {}"); + } else if (name2 === "%AsyncGeneratorFunction%") { + value2 = getEvalledConstructor("async function* () {}"); + } else if (name2 === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value2 = fn.prototype; + } + } else if (name2 === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value2 = getProto(gen.prototype); + } + } + INTRINSICS[name2] = value2; + return value2; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind2 = dew$9(); + var hasOwn = dew$8(); + var $concat = bind2.call(Function.call, Array.prototype.concat); + var $spliceApply = bind2.call(Function.apply, Array.prototype.splice); + var $replace = bind2.call(Function.call, String.prototype.replace); + var $strSlice = bind2.call(Function.call, String.prototype.slice); + var $exec = bind2.call(Function.call, RegExp.prototype.exec); + var rePropName2 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar2 = /\\(\\)?/g; + var stringToPath2 = function stringToPath3(string2) { + var first = $strSlice(string2, 0, 1); + var last2 = $strSlice(string2, -1); + if (first === "%" && last2 !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last2 === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result2 = []; + $replace(string2, rePropName2, function(match, number, quote, subString) { + result2[result2.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number || match; + }); + return result2; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name2, allowMissing) { + var intrinsicName = name2; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; + } + if (hasOwn(INTRINSICS, intrinsicName)) { + var value2 = INTRINSICS[intrinsicName]; + if (value2 === needsEval) { + value2 = doEval(intrinsicName); + } + if (typeof value2 === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name2 + " exists, but is not available. Please file an issue!"); + } + return { + alias, + name: intrinsicName, + value: value2 + }; + } + throw new $SyntaxError("intrinsic " + name2 + " does not exist!"); + }; + exports$7 = function GetIntrinsic(name2, allowMissing) { + if (typeof name2 !== "string" || name2.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name2) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath2(name2); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value2 = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i7 = 1, isOwn = true; i7 < parts.length; i7 += 1) { + var part = parts[i7]; + var first = $strSlice(part, 0, 1); + var last2 = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || last2 === '"' || last2 === "'" || last2 === "`") && first !== last2) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value2 = INTRINSICS[intrinsicRealName]; + } else if (value2 != null) { + if (!(part in value2)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name2 + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i7 + 1 >= parts.length) { + var desc = $gOPD(value2, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value2 = desc.get; + } else { + value2 = value2[part]; + } + } else { + isOwn = hasOwn(value2, part); + value2 = value2[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value2; + } + } + } + return value2; + }; + return exports$7; +} +function dew$6() { + if (_dewExec$6) + return exports$6; + _dewExec$6 = true; + var GetIntrinsic = dew$7(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { + value: 1 + }); + } catch (e10) { + $defineProperty = false; + } + } + exports$6 = $defineProperty; + return exports$6; +} +function dew$5() { + if (_dewExec$5) + return exports$5; + _dewExec$5 = true; + var GetIntrinsic = dew$7(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e10) { + $gOPD = null; + } + } + exports$5 = $gOPD; + return exports$5; +} +function dew$4() { + if (_dewExec$4) + return exports$4; + _dewExec$4 = true; + var $defineProperty = dew$6(); + var $SyntaxError = dew$f(); + var $TypeError = dew$e(); + var gopd = dew$5(); + exports$4 = function defineDataProperty(obj, property2, value2) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property2 !== "string" && typeof property2 !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property2); + if ($defineProperty) { + $defineProperty(obj, property2, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value2, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property2] = value2; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + return exports$4; +} +function dew$3() { + if (_dewExec$3) + return exports$3; + _dewExec$3 = true; + var $defineProperty = dew$6(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { + value: 1 + }).length !== 1; + } catch (e10) { + return true; + } + }; + exports$3 = hasPropertyDescriptors; + return exports$3; +} +function dew$22() { + if (_dewExec$22) + return exports$22; + _dewExec$22 = true; + var GetIntrinsic = dew$7(); + var define2 = dew$4(); + var hasDescriptors = dew$3()(); + var gOPD = dew$5(); + var $TypeError = dew$e(); + var $floor = GetIntrinsic("%Math.floor%"); + exports$22 = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length, + true, + true + ); + } else { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length + ); + } + } + return fn; + }; + return exports$22; +} +function dew$12() { + if (_dewExec$12) + return exports$13; + _dewExec$12 = true; + var bind2 = dew$9(); + var GetIntrinsic = dew$7(); + var setFunctionLength = dew$22(); + var $TypeError = dew$e(); + var $apply = GetIntrinsic("%Function.prototype.apply%"); + var $call = GetIntrinsic("%Function.prototype.call%"); + var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); + var $defineProperty = dew$6(); + var $max = GetIntrinsic("%Math.max%"); + exports$13 = function callBind(originalFunction) { + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); + } + var func = $reflectApply(bind2, $call, arguments); + return setFunctionLength(func, 1 + $max(0, originalFunction.length - (arguments.length - 1)), true); + }; + var applyBind = function applyBind2() { + return $reflectApply(bind2, $apply, arguments); + }; + if ($defineProperty) { + $defineProperty(exports$13, "apply", { + value: applyBind + }); + } else { + exports$13.apply = applyBind; + } + return exports$13; +} +function dew3() { + if (_dewExec3) + return exports6; + _dewExec3 = true; + var GetIntrinsic = dew$7(); + var callBind = dew$12(); + var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); + exports6 = function callBoundIntrinsic(name2, allowMissing) { + var intrinsic = GetIntrinsic(name2, !!allowMissing); + if (typeof intrinsic === "function" && $indexOf(name2, ".prototype.") > -1) { + return callBind(intrinsic); + } + return intrinsic; + }; + return exports6; +} +var exports$k, _dewExec$k, exports$j, _dewExec$j, exports$i, _dewExec$i, exports$h, _dewExec$h, exports$g, _dewExec$g, exports$f, _dewExec$f, exports$e, _dewExec$e, exports$d, _dewExec$d, exports$c, _dewExec$c, exports$b, _dewExec$b, exports$a, _dewExec$a, exports$9, _dewExec$9, exports$8, _dewExec$8, exports$7, _dewExec$7, exports$6, _dewExec$6, exports$5, _dewExec$5, exports$4, _dewExec$4, exports$3, _dewExec$3, exports$22, _dewExec$22, exports$13, _dewExec$12, exports6, _dewExec3; +var init_chunk_DtcTpLWz = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-DtcTpLWz.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports$k = {}; + _dewExec$k = false; + exports$j = {}; + _dewExec$j = false; + exports$i = {}; + _dewExec$i = false; + exports$h = {}; + _dewExec$h = false; + exports$g = {}; + _dewExec$g = false; + exports$f = {}; + _dewExec$f = false; + exports$e = {}; + _dewExec$e = false; + exports$d = {}; + _dewExec$d = false; + exports$c = {}; + _dewExec$c = false; + exports$b = {}; + _dewExec$b = false; + exports$a = {}; + _dewExec$a = false; + exports$9 = {}; + _dewExec$9 = false; + exports$8 = {}; + _dewExec$8 = false; + exports$7 = {}; + _dewExec$7 = false; + exports$6 = {}; + _dewExec$6 = false; + exports$5 = {}; + _dewExec$5 = false; + exports$4 = {}; + _dewExec$4 = false; + exports$3 = {}; + _dewExec$3 = false; + exports$22 = {}; + _dewExec$22 = false; + exports$13 = {}; + _dewExec$12 = false; + exports6 = {}; + _dewExec3 = false; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-CkFCi-G1.js +function dew4() { + if (_dewExec4) + return exports7; + _dewExec4 = true; + if (typeof Object.create === "function") { + exports7 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + exports7 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return exports7; +} +var exports7, _dewExec4; +var init_chunk_CkFCi_G1 = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-CkFCi-G1.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports7 = {}; + _dewExec4 = false; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/util.js +var util_exports = {}; +__export(util_exports, { + TextDecoder: () => TextDecoder2, + TextEncoder: () => TextEncoder, + _extend: () => _extend, + callbackify: () => callbackify, + debuglog: () => debuglog, + default: () => exports8, + deprecate: () => deprecate, + format: () => format3, + inherits: () => inherits, + inspect: () => inspect, + isArray: () => isArray2, + isBoolean: () => isBoolean2, + isBuffer: () => isBuffer2, + isDate: () => isDate2, + isError: () => isError2, + isFunction: () => isFunction2, + isNull: () => isNull2, + isNullOrUndefined: () => isNullOrUndefined, + isNumber: () => isNumber2, + isObject: () => isObject4, + isPrimitive: () => isPrimitive, + isRegExp: () => isRegExp2, + isString: () => isString2, + isSymbol: () => isSymbol2, + isUndefined: () => isUndefined2, + log: () => log, + promisify: () => promisify, + types: () => types +}); +function dew$b2() { + if (_dewExec$b2) + return exports$c2; + _dewExec$b2 = true; + var hasSymbols = dew$k(); + exports$c2 = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; + }; + return exports$c2; +} +function dew$a2() { + if (_dewExec$a2) + return exports$b2; + _dewExec$a2 = true; + var hasToStringTag = dew$b2()(); + var callBound = dew3(); + var $toString = callBound("Object.prototype.toString"); + var isStandardArguments = function isArguments2(value2) { + if (hasToStringTag && value2 && typeof value2 === "object" && Symbol.toStringTag in value2) { + return false; + } + return $toString(value2) === "[object Arguments]"; + }; + var isLegacyArguments = function isArguments2(value2) { + if (isStandardArguments(value2)) { + return true; + } + return value2 !== null && typeof value2 === "object" && typeof value2.length === "number" && value2.length >= 0 && $toString(value2) !== "[object Array]" && $toString(value2.callee) === "[object Function]"; + }; + var supportsStandardArguments = function() { + return isStandardArguments(arguments); + }(); + isStandardArguments.isLegacyArguments = isLegacyArguments; + exports$b2 = supportsStandardArguments ? isStandardArguments : isLegacyArguments; + return exports$b2; +} +function dew$92() { + if (_dewExec$92) + return exports$a2; + _dewExec$92 = true; + var toStr = Object.prototype.toString; + var fnToStr = Function.prototype.toString; + var isFnRegex = /^\s*(?:function)?\*/; + var hasToStringTag = dew$b2()(); + var getProto = Object.getPrototypeOf; + var getGeneratorFunc = function() { + if (!hasToStringTag) { + return false; + } + try { + return Function("return function*() {}")(); + } catch (e10) { + } + }; + var GeneratorFunction; + exports$a2 = function isGeneratorFunction(fn) { + if (typeof fn !== "function") { + return false; + } + if (isFnRegex.test(fnToStr.call(fn))) { + return true; + } + if (!hasToStringTag) { + var str2 = toStr.call(fn); + return str2 === "[object GeneratorFunction]"; + } + if (!getProto) { + return false; + } + if (typeof GeneratorFunction === "undefined") { + var generatorFunc = getGeneratorFunc(); + GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; + } + return getProto(fn) === GeneratorFunction; + }; + return exports$a2; +} +function dew$82() { + if (_dewExec$82) + return exports$92; + _dewExec$82 = true; + var fnToStr = Function.prototype.toString; + var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; + var badArrayLike; + var isCallableMarker; + if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { + try { + badArrayLike = Object.defineProperty({}, "length", { + get: function() { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + reflectApply(function() { + throw 42; + }, null, badArrayLike); + } catch (_6) { + if (_6 !== isCallableMarker) { + reflectApply = null; + } + } + } else { + reflectApply = null; + } + var constructorRegex = /^\s*class\b/; + var isES6ClassFn = function isES6ClassFunction(value2) { + try { + var fnStr = fnToStr.call(value2); + return constructorRegex.test(fnStr); + } catch (e10) { + return false; + } + }; + var tryFunctionObject = function tryFunctionToStr(value2) { + try { + if (isES6ClassFn(value2)) { + return false; + } + fnToStr.call(value2); + return true; + } catch (e10) { + return false; + } + }; + var toStr = Object.prototype.toString; + var objectClass = "[object Object]"; + var fnClass = "[object Function]"; + var genClass = "[object GeneratorFunction]"; + var ddaClass = "[object HTMLAllCollection]"; + var ddaClass2 = "[object HTML document.all class]"; + var ddaClass3 = "[object HTMLCollection]"; + var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; + var isIE68 = !(0 in [,]); + var isDDA = function isDocumentDotAll() { + return false; + }; + if (typeof document === "object") { + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value2) { + if ((isIE68 || !value2) && (typeof value2 === "undefined" || typeof value2 === "object")) { + try { + var str2 = toStr.call(value2); + return (str2 === ddaClass || str2 === ddaClass2 || str2 === ddaClass3 || str2 === objectClass) && value2("") == null; + } catch (e10) { + } + } + return false; + }; + } + } + exports$92 = reflectApply ? function isCallable(value2) { + if (isDDA(value2)) { + return true; + } + if (!value2) { + return false; + } + if (typeof value2 !== "function" && typeof value2 !== "object") { + return false; + } + try { + reflectApply(value2, null, badArrayLike); + } catch (e10) { + if (e10 !== isCallableMarker) { + return false; + } + } + return !isES6ClassFn(value2) && tryFunctionObject(value2); + } : function isCallable(value2) { + if (isDDA(value2)) { + return true; + } + if (!value2) { + return false; + } + if (typeof value2 !== "function" && typeof value2 !== "object") { + return false; + } + if (hasToStringTag) { + return tryFunctionObject(value2); + } + if (isES6ClassFn(value2)) { + return false; + } + var strClass = toStr.call(value2); + if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { + return false; + } + return tryFunctionObject(value2); + }; + return exports$92; +} +function dew$72() { + if (_dewExec$72) + return exports$82; + _dewExec$72 = true; + var isCallable = dew$82(); + var toStr = Object.prototype.toString; + var hasOwnProperty27 = Object.prototype.hasOwnProperty; + var forEachArray = function forEachArray2(array, iterator, receiver) { + for (var i7 = 0, len = array.length; i7 < len; i7++) { + if (hasOwnProperty27.call(array, i7)) { + if (receiver == null) { + iterator(array[i7], i7, array); + } else { + iterator.call(receiver, array[i7], i7, array); + } + } + } + }; + var forEachString = function forEachString2(string2, iterator, receiver) { + for (var i7 = 0, len = string2.length; i7 < len; i7++) { + if (receiver == null) { + iterator(string2.charAt(i7), i7, string2); + } else { + iterator.call(receiver, string2.charAt(i7), i7, string2); + } + } + }; + var forEachObject = function forEachObject2(object, iterator, receiver) { + for (var k6 in object) { + if (hasOwnProperty27.call(object, k6)) { + if (receiver == null) { + iterator(object[k6], k6, object); + } else { + iterator.call(receiver, object[k6], k6, object); + } + } + } + }; + var forEach4 = function forEach5(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError("iterator must be a function"); + } + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + if (toStr.call(list) === "[object Array]") { + forEachArray(list, iterator, receiver); + } else if (typeof list === "string") { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } + }; + exports$82 = forEach4; + return exports$82; +} +function dew$62() { + if (_dewExec$62) + return exports$72; + _dewExec$62 = true; + exports$72 = ["Float32Array", "Float64Array", "Int8Array", "Int16Array", "Int32Array", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "BigInt64Array", "BigUint64Array"]; + return exports$72; +} +function dew$52() { + if (_dewExec$52) + return exports$62; + _dewExec$52 = true; + var possibleNames = dew$62(); + var g7 = typeof globalThis === "undefined" ? _global$2 : globalThis; + exports$62 = function availableTypedArrays() { + var out = []; + for (var i7 = 0; i7 < possibleNames.length; i7++) { + if (typeof g7[possibleNames[i7]] === "function") { + out[out.length] = possibleNames[i7]; + } + } + return out; + }; + return exports$62; +} +function dew$42() { + if (_dewExec$42) + return exports$52; + _dewExec$42 = true; + var forEach4 = dew$72(); + var availableTypedArrays = dew$52(); + var callBind = dew$12(); + var callBound = dew3(); + var gOPD = dew$5(); + var $toString = callBound("Object.prototype.toString"); + var hasToStringTag = dew$b2()(); + var g7 = typeof globalThis === "undefined" ? _global$1 : globalThis; + var typedArrays = availableTypedArrays(); + var $slice = callBound("String.prototype.slice"); + var getPrototypeOf = Object.getPrototypeOf; + var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf4(array, value2) { + for (var i7 = 0; i7 < array.length; i7 += 1) { + if (array[i7] === value2) { + return i7; + } + } + return -1; + }; + var cache = { + __proto__: null + }; + if (hasToStringTag && gOPD && getPrototypeOf) { + forEach4(typedArrays, function(typedArray) { + var arr = new g7[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + cache["$" + typedArray] = callBind(descriptor.get); + } + }); + } else { + forEach4(typedArrays, function(typedArray) { + var arr = new g7[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + cache["$" + typedArray] = callBind(fn); + } + }); + } + var tryTypedArrays = function tryAllTypedArrays(value2) { + var found = false; + forEach4( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, Getter>} */ + /** @type {any} */ + cache, + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ + function(getter, typedArray) { + if (!found) { + try { + if ("$" + getter(value2) === typedArray) { + found = $slice(typedArray, 1); + } + } catch (e10) { + } + } + } + ); + return found; + }; + var trySlices = function tryAllSlices(value2) { + var found = false; + forEach4( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, Getter>} */ + /** @type {any} */ + cache, + /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ + function(getter, name2) { + if (!found) { + try { + getter(value2); + found = $slice(name2, 1); + } catch (e10) { + } + } + } + ); + return found; + }; + exports$52 = function whichTypedArray(value2) { + if (!value2 || typeof value2 !== "object") { + return false; + } + if (!hasToStringTag) { + var tag = $slice($toString(value2), 8, -1); + if ($indexOf(typedArrays, tag) > -1) { + return tag; + } + if (tag !== "Object") { + return false; + } + return trySlices(value2); + } + if (!gOPD) { + return null; + } + return tryTypedArrays(value2); + }; + return exports$52; +} +function dew$32() { + if (_dewExec$32) + return exports$42; + _dewExec$32 = true; + var whichTypedArray = dew$42(); + exports$42 = function isTypedArray2(value2) { + return !!whichTypedArray(value2); + }; + return exports$42; +} +function dew$23() { + if (_dewExec$23) + return exports$32; + _dewExec$23 = true; + var isArgumentsObject = dew$a2(); + var isGeneratorFunction = dew$92(); + var whichTypedArray = dew$42(); + var isTypedArray2 = dew$32(); + function uncurryThis(f8) { + return f8.call.bind(f8); + } + var BigIntSupported = typeof BigInt !== "undefined"; + var SymbolSupported = typeof Symbol !== "undefined"; + var ObjectToString = uncurryThis(Object.prototype.toString); + var numberValue = uncurryThis(Number.prototype.valueOf); + var stringValue = uncurryThis(String.prototype.valueOf); + var booleanValue = uncurryThis(Boolean.prototype.valueOf); + if (BigIntSupported) { + var bigIntValue = uncurryThis(BigInt.prototype.valueOf); + } + if (SymbolSupported) { + var symbolValue = uncurryThis(Symbol.prototype.valueOf); + } + function checkBoxedPrimitive(value2, prototypeValueOf) { + if (typeof value2 !== "object") { + return false; + } + try { + prototypeValueOf(value2); + return true; + } catch (e10) { + return false; + } + } + exports$32.isArgumentsObject = isArgumentsObject; + exports$32.isGeneratorFunction = isGeneratorFunction; + exports$32.isTypedArray = isTypedArray2; + function isPromise(input) { + return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function"; + } + exports$32.isPromise = isPromise; + function isArrayBufferView(value2) { + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + return ArrayBuffer.isView(value2); + } + return isTypedArray2(value2) || isDataView(value2); + } + exports$32.isArrayBufferView = isArrayBufferView; + function isUint8Array(value2) { + return whichTypedArray(value2) === "Uint8Array"; + } + exports$32.isUint8Array = isUint8Array; + function isUint8ClampedArray(value2) { + return whichTypedArray(value2) === "Uint8ClampedArray"; + } + exports$32.isUint8ClampedArray = isUint8ClampedArray; + function isUint16Array(value2) { + return whichTypedArray(value2) === "Uint16Array"; + } + exports$32.isUint16Array = isUint16Array; + function isUint32Array(value2) { + return whichTypedArray(value2) === "Uint32Array"; + } + exports$32.isUint32Array = isUint32Array; + function isInt8Array(value2) { + return whichTypedArray(value2) === "Int8Array"; + } + exports$32.isInt8Array = isInt8Array; + function isInt16Array(value2) { + return whichTypedArray(value2) === "Int16Array"; + } + exports$32.isInt16Array = isInt16Array; + function isInt32Array(value2) { + return whichTypedArray(value2) === "Int32Array"; + } + exports$32.isInt32Array = isInt32Array; + function isFloat32Array(value2) { + return whichTypedArray(value2) === "Float32Array"; + } + exports$32.isFloat32Array = isFloat32Array; + function isFloat64Array(value2) { + return whichTypedArray(value2) === "Float64Array"; + } + exports$32.isFloat64Array = isFloat64Array; + function isBigInt64Array(value2) { + return whichTypedArray(value2) === "BigInt64Array"; + } + exports$32.isBigInt64Array = isBigInt64Array; + function isBigUint64Array(value2) { + return whichTypedArray(value2) === "BigUint64Array"; + } + exports$32.isBigUint64Array = isBigUint64Array; + function isMapToString(value2) { + return ObjectToString(value2) === "[object Map]"; + } + isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map()); + function isMap3(value2) { + if (typeof Map === "undefined") { + return false; + } + return isMapToString.working ? isMapToString(value2) : value2 instanceof Map; + } + exports$32.isMap = isMap3; + function isSetToString(value2) { + return ObjectToString(value2) === "[object Set]"; + } + isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set()); + function isSet2(value2) { + if (typeof Set === "undefined") { + return false; + } + return isSetToString.working ? isSetToString(value2) : value2 instanceof Set; + } + exports$32.isSet = isSet2; + function isWeakMapToString(value2) { + return ObjectToString(value2) === "[object WeakMap]"; + } + isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap()); + function isWeakMap2(value2) { + if (typeof WeakMap === "undefined") { + return false; + } + return isWeakMapToString.working ? isWeakMapToString(value2) : value2 instanceof WeakMap; + } + exports$32.isWeakMap = isWeakMap2; + function isWeakSetToString(value2) { + return ObjectToString(value2) === "[object WeakSet]"; + } + isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet()); + function isWeakSet2(value2) { + return isWeakSetToString(value2); + } + exports$32.isWeakSet = isWeakSet2; + function isArrayBufferToString(value2) { + return ObjectToString(value2) === "[object ArrayBuffer]"; + } + isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer()); + function isArrayBuffer2(value2) { + if (typeof ArrayBuffer === "undefined") { + return false; + } + return isArrayBufferToString.working ? isArrayBufferToString(value2) : value2 instanceof ArrayBuffer; + } + exports$32.isArrayBuffer = isArrayBuffer2; + function isDataViewToString(value2) { + return ObjectToString(value2) === "[object DataView]"; + } + isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)); + function isDataView(value2) { + if (typeof DataView === "undefined") { + return false; + } + return isDataViewToString.working ? isDataViewToString(value2) : value2 instanceof DataView; + } + exports$32.isDataView = isDataView; + var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0; + function isSharedArrayBufferToString(value2) { + return ObjectToString(value2) === "[object SharedArrayBuffer]"; + } + function isSharedArrayBuffer(value2) { + if (typeof SharedArrayBufferCopy === "undefined") { + return false; + } + if (typeof isSharedArrayBufferToString.working === "undefined") { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value2) : value2 instanceof SharedArrayBufferCopy; + } + exports$32.isSharedArrayBuffer = isSharedArrayBuffer; + function isAsyncFunction(value2) { + return ObjectToString(value2) === "[object AsyncFunction]"; + } + exports$32.isAsyncFunction = isAsyncFunction; + function isMapIterator(value2) { + return ObjectToString(value2) === "[object Map Iterator]"; + } + exports$32.isMapIterator = isMapIterator; + function isSetIterator(value2) { + return ObjectToString(value2) === "[object Set Iterator]"; + } + exports$32.isSetIterator = isSetIterator; + function isGeneratorObject(value2) { + return ObjectToString(value2) === "[object Generator]"; + } + exports$32.isGeneratorObject = isGeneratorObject; + function isWebAssemblyCompiledModule(value2) { + return ObjectToString(value2) === "[object WebAssembly.Module]"; + } + exports$32.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; + function isNumberObject(value2) { + return checkBoxedPrimitive(value2, numberValue); + } + exports$32.isNumberObject = isNumberObject; + function isStringObject(value2) { + return checkBoxedPrimitive(value2, stringValue); + } + exports$32.isStringObject = isStringObject; + function isBooleanObject(value2) { + return checkBoxedPrimitive(value2, booleanValue); + } + exports$32.isBooleanObject = isBooleanObject; + function isBigIntObject(value2) { + return BigIntSupported && checkBoxedPrimitive(value2, bigIntValue); + } + exports$32.isBigIntObject = isBigIntObject; + function isSymbolObject(value2) { + return SymbolSupported && checkBoxedPrimitive(value2, symbolValue); + } + exports$32.isSymbolObject = isSymbolObject; + function isBoxedPrimitive(value2) { + return isNumberObject(value2) || isStringObject(value2) || isBooleanObject(value2) || isBigIntObject(value2) || isSymbolObject(value2); + } + exports$32.isBoxedPrimitive = isBoxedPrimitive; + function isAnyArrayBuffer(value2) { + return typeof Uint8Array !== "undefined" && (isArrayBuffer2(value2) || isSharedArrayBuffer(value2)); + } + exports$32.isAnyArrayBuffer = isAnyArrayBuffer; + ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method2) { + Object.defineProperty(exports$32, method2, { + enumerable: false, + value: function() { + throw new Error(method2 + " is not supported in userland"); + } + }); + }); + return exports$32; +} +function dew$13() { + if (_dewExec$13) + return exports$23; + _dewExec$13 = true; + exports$23 = function isBuffer3(arg) { + return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function"; + }; + return exports$23; +} +function dew5() { + if (_dewExec5) + return exports$14; + _dewExec5 = true; + var process$1 = process3; + var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) { + var keys2 = Object.keys(obj); + var descriptors = {}; + for (var i7 = 0; i7 < keys2.length; i7++) { + descriptors[keys2[i7]] = Object.getOwnPropertyDescriptor(obj, keys2[i7]); + } + return descriptors; + }; + var formatRegExp = /%[sdj%]/g; + exports$14.format = function(f8) { + if (!isString4(f8)) { + var objects = []; + for (var i7 = 0; i7 < arguments.length; i7++) { + objects.push(inspect2(arguments[i7])); + } + return objects.join(" "); + } + var i7 = 1; + var args = arguments; + var len = args.length; + var str2 = String(f8).replace(formatRegExp, function(x8) { + if (x8 === "%%") + return "%"; + if (i7 >= len) + return x8; + switch (x8) { + case "%s": + return String(args[i7++]); + case "%d": + return Number(args[i7++]); + case "%j": + try { + return JSON.stringify(args[i7++]); + } catch (_6) { + return "[Circular]"; + } + default: + return x8; + } + }); + for (var x7 = args[i7]; i7 < len; x7 = args[++i7]) { + if (isNull4(x7) || !isObject8(x7)) { + str2 += " " + x7; + } else { + str2 += " " + inspect2(x7); + } + } + return str2; + }; + exports$14.deprecate = function(fn, msg) { + if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) { + return fn; + } + if (typeof process$1 === "undefined") { + return function() { + return exports$14.deprecate(fn, msg).apply(this || _global, arguments); + }; + } + var warned = false; + function deprecated() { + if (!warned) { + if (process$1.throwDeprecation) { + throw new Error(msg); + } else if (process$1.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this || _global, arguments); + } + return deprecated; + }; + var debugs = {}; + var debugEnvRegex = /^$/; + if (process$1.env.NODE_DEBUG) { + var debugEnv = process$1.env.NODE_DEBUG; + debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(); + debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"); + } + exports$14.debuglog = function(set4) { + set4 = set4.toUpperCase(); + if (!debugs[set4]) { + if (debugEnvRegex.test(set4)) { + var pid3 = process$1.pid; + debugs[set4] = function() { + var msg = exports$14.format.apply(exports$14, arguments); + console.error("%s %d: %s", set4, pid3, msg); + }; + } else { + debugs[set4] = function() { + }; + } + } + return debugs[set4]; + }; + function inspect2(obj, opts) { + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + if (arguments.length >= 3) + ctx.depth = arguments[2]; + if (arguments.length >= 4) + ctx.colors = arguments[3]; + if (isBoolean4(opts)) { + ctx.showHidden = opts; + } else if (opts) { + exports$14._extend(ctx, opts); + } + if (isUndefined3(ctx.showHidden)) + ctx.showHidden = false; + if (isUndefined3(ctx.depth)) + ctx.depth = 2; + if (isUndefined3(ctx.colors)) + ctx.colors = false; + if (isUndefined3(ctx.customInspect)) + ctx.customInspect = true; + if (ctx.colors) + ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports$14.inspect = inspect2; + inspect2.colors = { + "bold": [1, 22], + "italic": [3, 23], + "underline": [4, 24], + "inverse": [7, 27], + "white": [37, 39], + "grey": [90, 39], + "black": [30, 39], + "blue": [34, 39], + "cyan": [36, 39], + "green": [32, 39], + "magenta": [35, 39], + "red": [31, 39], + "yellow": [33, 39] + }; + inspect2.styles = { + "special": "cyan", + "number": "yellow", + "boolean": "yellow", + "undefined": "grey", + "null": "bold", + "string": "green", + "date": "magenta", + // "name": intentionally not styling + "regexp": "red" + }; + function stylizeWithColor(str2, styleType) { + var style = inspect2.styles[styleType]; + if (style) { + return "\x1B[" + inspect2.colors[style][0] + "m" + str2 + "\x1B[" + inspect2.colors[style][1] + "m"; + } else { + return str2; + } + } + function stylizeNoColor(str2, styleType) { + return str2; + } + function arrayToHash(array) { + var hash = {}; + array.forEach(function(val, idx) { + hash[val] = true; + }); + return hash; + } + function formatValue(ctx, value2, recurseTimes) { + if (ctx.customInspect && value2 && isFunction3(value2.inspect) && // Filter out the util module, it's inspect function is special + value2.inspect !== exports$14.inspect && // Also filter out any prototype objects using the circular check. + !(value2.constructor && value2.constructor.prototype === value2)) { + var ret = value2.inspect(recurseTimes, ctx); + if (!isString4(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + var primitive = formatPrimitive(ctx, value2); + if (primitive) { + return primitive; + } + var keys2 = Object.keys(value2); + var visibleKeys = arrayToHash(keys2); + if (ctx.showHidden) { + keys2 = Object.getOwnPropertyNames(value2); + } + if (isError3(value2) && (keys2.indexOf("message") >= 0 || keys2.indexOf("description") >= 0)) { + return formatError2(value2); + } + if (keys2.length === 0) { + if (isFunction3(value2)) { + var name2 = value2.name ? ": " + value2.name : ""; + return ctx.stylize("[Function" + name2 + "]", "special"); + } + if (isRegExp3(value2)) { + return ctx.stylize(RegExp.prototype.toString.call(value2), "regexp"); + } + if (isDate3(value2)) { + return ctx.stylize(Date.prototype.toString.call(value2), "date"); + } + if (isError3(value2)) { + return formatError2(value2); + } + } + var base = "", array = false, braces = ["{", "}"]; + if (isArray3(value2)) { + array = true; + braces = ["[", "]"]; + } + if (isFunction3(value2)) { + var n7 = value2.name ? ": " + value2.name : ""; + base = " [Function" + n7 + "]"; + } + if (isRegExp3(value2)) { + base = " " + RegExp.prototype.toString.call(value2); + } + if (isDate3(value2)) { + base = " " + Date.prototype.toUTCString.call(value2); + } + if (isError3(value2)) { + base = " " + formatError2(value2); + } + if (keys2.length === 0 && (!array || value2.length == 0)) { + return braces[0] + base + braces[1]; + } + if (recurseTimes < 0) { + if (isRegExp3(value2)) { + return ctx.stylize(RegExp.prototype.toString.call(value2), "regexp"); + } else { + return ctx.stylize("[Object]", "special"); + } + } + ctx.seen.push(value2); + var output; + if (array) { + output = formatArray(ctx, value2, recurseTimes, visibleKeys, keys2); + } else { + output = keys2.map(function(key) { + return formatProperty(ctx, value2, recurseTimes, visibleKeys, key, array); + }); + } + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); + } + function formatPrimitive(ctx, value2) { + if (isUndefined3(value2)) + return ctx.stylize("undefined", "undefined"); + if (isString4(value2)) { + var simple = "'" + JSON.stringify(value2).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return ctx.stylize(simple, "string"); + } + if (isNumber3(value2)) + return ctx.stylize("" + value2, "number"); + if (isBoolean4(value2)) + return ctx.stylize("" + value2, "boolean"); + if (isNull4(value2)) + return ctx.stylize("null", "null"); + } + function formatError2(value2) { + return "[" + Error.prototype.toString.call(value2) + "]"; + } + function formatArray(ctx, value2, recurseTimes, visibleKeys, keys2) { + var output = []; + for (var i7 = 0, l7 = value2.length; i7 < l7; ++i7) { + if (hasOwnProperty27(value2, String(i7))) { + output.push(formatProperty(ctx, value2, recurseTimes, visibleKeys, String(i7), true)); + } else { + output.push(""); + } + } + keys2.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value2, recurseTimes, visibleKeys, key, true)); + } + }); + return output; + } + function formatProperty(ctx, value2, recurseTimes, visibleKeys, key, array) { + var name2, str2, desc; + desc = Object.getOwnPropertyDescriptor(value2, key) || { + value: value2[key] + }; + if (desc.get) { + if (desc.set) { + str2 = ctx.stylize("[Getter/Setter]", "special"); + } else { + str2 = ctx.stylize("[Getter]", "special"); + } + } else { + if (desc.set) { + str2 = ctx.stylize("[Setter]", "special"); + } + } + if (!hasOwnProperty27(visibleKeys, key)) { + name2 = "[" + key + "]"; + } + if (!str2) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull4(recurseTimes)) { + str2 = formatValue(ctx, desc.value, null); + } else { + str2 = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str2.indexOf("\n") > -1) { + if (array) { + str2 = str2.split("\n").map(function(line) { + return " " + line; + }).join("\n").slice(2); + } else { + str2 = "\n" + str2.split("\n").map(function(line) { + return " " + line; + }).join("\n"); + } + } + } else { + str2 = ctx.stylize("[Circular]", "special"); + } + } + if (isUndefined3(name2)) { + if (array && key.match(/^\d+$/)) { + return str2; + } + name2 = JSON.stringify("" + key); + if (name2.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name2 = name2.slice(1, -1); + name2 = ctx.stylize(name2, "name"); + } else { + name2 = name2.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name2 = ctx.stylize(name2, "string"); + } + } + return name2 + ": " + str2; + } + function reduceToSingleString(output, base, braces) { + var length = output.reduce(function(prev, cur) { + if (cur.indexOf("\n") >= 0) + ; + return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1; + }, 0); + if (length > 60) { + return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1]; + } + return braces[0] + base + " " + output.join(", ") + " " + braces[1]; + } + exports$14.types = dew$23(); + function isArray3(ar) { + return Array.isArray(ar); + } + exports$14.isArray = isArray3; + function isBoolean4(arg) { + return typeof arg === "boolean"; + } + exports$14.isBoolean = isBoolean4; + function isNull4(arg) { + return arg === null; + } + exports$14.isNull = isNull4; + function isNullOrUndefined2(arg) { + return arg == null; + } + exports$14.isNullOrUndefined = isNullOrUndefined2; + function isNumber3(arg) { + return typeof arg === "number"; + } + exports$14.isNumber = isNumber3; + function isString4(arg) { + return typeof arg === "string"; + } + exports$14.isString = isString4; + function isSymbol3(arg) { + return typeof arg === "symbol"; + } + exports$14.isSymbol = isSymbol3; + function isUndefined3(arg) { + return arg === void 0; + } + exports$14.isUndefined = isUndefined3; + function isRegExp3(re4) { + return isObject8(re4) && objectToString2(re4) === "[object RegExp]"; + } + exports$14.isRegExp = isRegExp3; + exports$14.types.isRegExp = isRegExp3; + function isObject8(arg) { + return typeof arg === "object" && arg !== null; + } + exports$14.isObject = isObject8; + function isDate3(d7) { + return isObject8(d7) && objectToString2(d7) === "[object Date]"; + } + exports$14.isDate = isDate3; + exports$14.types.isDate = isDate3; + function isError3(e10) { + return isObject8(e10) && (objectToString2(e10) === "[object Error]" || e10 instanceof Error); + } + exports$14.isError = isError3; + exports$14.types.isNativeError = isError3; + function isFunction3(arg) { + return typeof arg === "function"; + } + exports$14.isFunction = isFunction3; + function isPrimitive2(arg) { + return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol + typeof arg === "undefined"; + } + exports$14.isPrimitive = isPrimitive2; + exports$14.isBuffer = dew$13(); + function objectToString2(o7) { + return Object.prototype.toString.call(o7); + } + function pad2(n7) { + return n7 < 10 ? "0" + n7.toString(10) : n7.toString(10); + } + var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + function timestamp3() { + var d7 = /* @__PURE__ */ new Date(); + var time2 = [pad2(d7.getHours()), pad2(d7.getMinutes()), pad2(d7.getSeconds())].join(":"); + return [d7.getDate(), months[d7.getMonth()], time2].join(" "); + } + exports$14.log = function() { + console.log("%s - %s", timestamp3(), exports$14.format.apply(exports$14, arguments)); + }; + exports$14.inherits = dew4(); + exports$14._extend = function(origin, add2) { + if (!add2 || !isObject8(add2)) + return origin; + var keys2 = Object.keys(add2); + var i7 = keys2.length; + while (i7--) { + origin[keys2[i7]] = add2[keys2[i7]]; + } + return origin; + }; + function hasOwnProperty27(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0; + exports$14.promisify = function promisify4(original) { + if (typeof original !== "function") + throw new TypeError('The "original" argument must be of type Function'); + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== "function") { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return fn; + } + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function(resolve3, reject2) { + promiseResolve = resolve3; + promiseReject = reject2; + }); + var args = []; + for (var i7 = 0; i7 < arguments.length; i7++) { + args.push(arguments[i7]); + } + args.push(function(err, value2) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value2); + } + }); + try { + original.apply(this || _global, args); + } catch (err) { + promiseReject(err); + } + return promise; + } + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + if (kCustomPromisifiedSymbol) + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return Object.defineProperties(fn, getOwnPropertyDescriptors(original)); + }; + exports$14.promisify.custom = kCustomPromisifiedSymbol; + function callbackifyOnRejected(reason, cb) { + if (!reason) { + var newReason = new Error("Promise was rejected with a falsy value"); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); + } + function callbackify2(original) { + if (typeof original !== "function") { + throw new TypeError('The "original" argument must be of type Function'); + } + function callbackified() { + var args = []; + for (var i7 = 0; i7 < arguments.length; i7++) { + args.push(arguments[i7]); + } + var maybeCb = args.pop(); + if (typeof maybeCb !== "function") { + throw new TypeError("The last argument must be of type Function"); + } + var self2 = this || _global; + var cb = function() { + return maybeCb.apply(self2, arguments); + }; + original.apply(this || _global, args).then(function(ret) { + process$1.nextTick(cb.bind(null, null, ret)); + }, function(rej) { + process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb)); + }); + } + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); + return callbackified; + } + exports$14.callbackify = callbackify2; + return exports$14; +} +var exports$c2, _dewExec$b2, exports$b2, _dewExec$a2, exports$a2, _dewExec$92, exports$92, _dewExec$82, exports$82, _dewExec$72, exports$72, _dewExec$62, exports$62, _dewExec$52, _global$2, exports$52, _dewExec$42, _global$1, exports$42, _dewExec$32, exports$32, _dewExec$23, exports$23, _dewExec$13, exports$14, _dewExec5, _global, exports8, _extend, callbackify, debuglog, deprecate, format3, inherits, inspect, isArray2, isBoolean2, isBuffer2, isDate2, isError2, isFunction2, isNull2, isNullOrUndefined, isNumber2, isObject4, isPrimitive, isRegExp2, isString2, isSymbol2, isUndefined2, log, promisify, types, TextEncoder, TextDecoder2; +var init_util2 = __esm({ + "node_modules/@jspm/core/nodelibs/browser/util.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtcTpLWz(); + init_chunk_CkFCi_G1(); + init_chunk_DEMDiNwt(); + exports$c2 = {}; + _dewExec$b2 = false; + exports$b2 = {}; + _dewExec$a2 = false; + exports$a2 = {}; + _dewExec$92 = false; + exports$92 = {}; + _dewExec$82 = false; + exports$82 = {}; + _dewExec$72 = false; + exports$72 = {}; + _dewExec$62 = false; + exports$62 = {}; + _dewExec$52 = false; + _global$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$52 = {}; + _dewExec$42 = false; + _global$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$42 = {}; + _dewExec$32 = false; + exports$32 = {}; + _dewExec$23 = false; + exports$23 = {}; + _dewExec$13 = false; + exports$14 = {}; + _dewExec5 = false; + _global = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports8 = dew5(); + exports8["format"]; + exports8["deprecate"]; + exports8["debuglog"]; + exports8["inspect"]; + exports8["types"]; + exports8["isArray"]; + exports8["isBoolean"]; + exports8["isNull"]; + exports8["isNullOrUndefined"]; + exports8["isNumber"]; + exports8["isString"]; + exports8["isSymbol"]; + exports8["isUndefined"]; + exports8["isRegExp"]; + exports8["isObject"]; + exports8["isDate"]; + exports8["isError"]; + exports8["isFunction"]; + exports8["isPrimitive"]; + exports8["isBuffer"]; + exports8["log"]; + exports8["inherits"]; + exports8["_extend"]; + exports8["promisify"]; + exports8["callbackify"]; + _extend = exports8._extend; + callbackify = exports8.callbackify; + debuglog = exports8.debuglog; + deprecate = exports8.deprecate; + format3 = exports8.format; + inherits = exports8.inherits; + inspect = exports8.inspect; + isArray2 = exports8.isArray; + isBoolean2 = exports8.isBoolean; + isBuffer2 = exports8.isBuffer; + isDate2 = exports8.isDate; + isError2 = exports8.isError; + isFunction2 = exports8.isFunction; + isNull2 = exports8.isNull; + isNullOrUndefined = exports8.isNullOrUndefined; + isNumber2 = exports8.isNumber; + isObject4 = exports8.isObject; + isPrimitive = exports8.isPrimitive; + isRegExp2 = exports8.isRegExp; + isString2 = exports8.isString; + isSymbol2 = exports8.isSymbol; + isUndefined2 = exports8.isUndefined; + log = exports8.log; + promisify = exports8.promisify; + types = exports8.types; + TextEncoder = exports8.TextEncoder = globalThis.TextEncoder; + TextDecoder2 = exports8.TextDecoder = globalThis.TextDecoder; + } +}); + +// node_modules/@asyncapi/parser/node_modules/node-fetch/browser.js +var require_browser3 = __commonJS({ + "node_modules/@asyncapi/parser/node_modules/node-fetch/browser.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var getGlobal = function() { + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global2 !== "undefined") { + return global2; + } + throw new Error("unable to locate global object"); + }; + var global2 = getGlobal(); + module5.exports = exports28 = global2.fetch; + if (global2.fetch) { + exports28.default = global2.fetch.bind(global2); + } + exports28.Headers = global2.Headers; + exports28.Request = global2.Request; + exports28.Response = global2.Response; + } +}); + +// node_modules/@asyncapi/parser/esm/from.js +function fromURL(parser3, source, options) { + function fetchUrl() { + return __awaiter20(this, void 0, void 0, function* () { + const fetchFn = yield getFetch(); + return (yield fetchFn(source, options)).text(); + }); + } + return { + parse(options2 = {}) { + return __awaiter20(this, void 0, void 0, function* () { + const schema8 = yield fetchUrl(); + return parser3.parse(schema8, Object.assign(Object.assign({}, options2), { source })); + }); + }, + validate(options2 = {}) { + return __awaiter20(this, void 0, void 0, function* () { + const schema8 = yield fetchUrl(); + return parser3.validate(schema8, Object.assign(Object.assign({}, options2), { source })); + }); + } + }; +} +function fromFile(parser3, source, options) { + function readFileFn() { + return __awaiter20(this, void 0, void 0, function* () { + return (yield promisify(readFile)(source, options)).toString(); + }); + } + return { + parse(options2 = {}) { + return __awaiter20(this, void 0, void 0, function* () { + const schema8 = yield readFileFn(); + return parser3.parse(schema8, Object.assign(Object.assign({}, options2), { source })); + }); + }, + validate(options2 = {}) { + return __awaiter20(this, void 0, void 0, function* () { + const schema8 = yield readFileFn(); + return parser3.validate(schema8, Object.assign(Object.assign({}, options2), { source })); + }); + } + }; +} +function getFetch() { + return __awaiter20(this, void 0, void 0, function* () { + if (__fetchFn) { + return __fetchFn; + } + if (typeof fetch === "undefined") { + return __fetchFn = (yield Promise.resolve().then(() => __toESM(require_browser3()))).default; + } + return __fetchFn = fetch; + }); +} +var __awaiter20, __fetchFn; +var init_from = __esm({ + "node_modules/@asyncapi/parser/esm/from.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_fs(); + init_util2(); + __awaiter20 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/base.js +var Base; +var init_base2 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/base.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + Base = class { + constructor(_json, _meta = {}) { + this._json = _json; + this._meta = _meta; + if (_json === void 0 || _json === null) { + throw new Error("Invalid JSON to instantiate the Base object."); + } + } + json(key) { + if (key === void 0 || typeof this._json !== "object") + return this._json; + if (!this._json) + return; + return this._json[key]; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/external-docs.js +var ExternalDocs; +var init_external_docs4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/external-docs.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base2(); + init_mixins3(); + ExternalDocs = class extends Base { + url() { + return this._json.url; + } + hasDescription() { + return hasDescription3(this); + } + description() { + return description3(this); + } + hasExtensions() { + return extensionsMixins.hasExtensions(this); + } + extensions() { + return extensionsMixins.extensions(this); + } + extensionKeys() { + return extensionsMixins.extensionKeys(this); + } + extKeys() { + return extensionsMixins.extKeys(this); + } + hasExtension(extension) { + return extensionsMixins.hasExtension(this, extension); + } + extension(extension) { + return extensionsMixins.extension(this, extension); + } + hasExt(extension) { + return extensionsMixins.hasExt(this, extension); + } + ext(extension) { + return extensionsMixins.ext(this, extension); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/tag.js +var Tag3; +var init_tag4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/tag.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base2(); + init_mixins3(); + Tag3 = class extends Base { + name() { + return this._json.name; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + externalDocs() { + return externalDocs3(this); + } + hasExternalDocs() { + return hasExternalDocs3(this); + } + hasExtensions() { + return extensionsMixins.hasExtensions(this); + } + extensions() { + return extensionsMixins.extensions(this); + } + extensionKeys() { + return extensionsMixins.extensionKeys(this); + } + extKeys() { + return extensionsMixins.extKeys(this); + } + hasExtension(extension) { + return extensionsMixins.hasExtension(this, extension); + } + extension(extension) { + return extensionsMixins.extension(this, extension); + } + hasExt(extension) { + return extensionsMixins.hasExt(this, extension); + } + ext(extension) { + return extensionsMixins.ext(this, extension); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/mixins.js +function hasDescription3(model) { + return Boolean(model.json("description")); +} +function description3(model) { + const description7 = model.json("description"); + return typeof description7 === "string" ? description7 : null; +} +function hasExternalDocs3(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs3(model) { + if (typeof model.json("externalDocs") === "object") { + return new ExternalDocs(model.json("externalDocs")); + } + return null; +} +function getMapValue(obj, key, Type3, meta) { + if (typeof key !== "string" || !obj) + return null; + const v8 = obj[String(key)]; + if (v8 === void 0) + return null; + return Type3 ? new Type3(v8, meta) : v8; +} +function createMapOfType(obj, Type3, meta) { + const result2 = {}; + if (!obj) + return result2; + Object.entries(obj).forEach(([key, value2]) => { + result2[key] = new Type3(value2, meta); + }); + return result2; +} +var SpecificationExtensionsModel, extensionsMixins, bindingsMixins, tagsMixins; +var init_mixins3 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/mixins.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base2(); + init_external_docs4(); + init_tag4(); + init_constants(); + SpecificationExtensionsModel = class extends Base { + hasExtensions() { + return extensionsMixins.hasExtensions(this); + } + extensions() { + return extensionsMixins.extensions(this); + } + extensionKeys() { + return extensionsMixins.extensionKeys(this); + } + extKeys() { + return extensionsMixins.extKeys(this); + } + hasExtension(extension) { + return extensionsMixins.hasExtension(this, extension); + } + extension(extension) { + return extensionsMixins.extension(this, extension); + } + hasExt(extension) { + return extensionsMixins.hasExt(this, extension); + } + ext(extension) { + return extensionsMixins.ext(this, extension); + } + }; + extensionsMixins = { + hasExtensions(model) { + return !!extensionsMixins.extensionKeys(model).length; + }, + extensions(model) { + const result2 = {}; + Object.entries(model.json()).forEach(([key, value2]) => { + if (EXTENSION_REGEX.test(key)) { + result2[key] = value2; + } + }); + return result2; + }, + extensionKeys(model) { + return Object.keys(extensionsMixins.extensions(model)); + }, + extKeys(model) { + return extensionsMixins.extensionKeys(model); + }, + hasExtension(model, extension) { + if (!extension.startsWith("x-")) { + return false; + } + return !!model.json()[extension]; + }, + extension(model, extension) { + if (!extension.startsWith("x-")) { + return null; + } + return model.json()[extension]; + }, + hasExt(model, extension) { + return extensionsMixins.hasExtension(model, extension); + }, + ext(model, extension) { + return extensionsMixins.extension(model, extension); + } + }; + bindingsMixins = { + hasBindings(model) { + return !!Object.keys(bindingsMixins.bindings(model)).length; + }, + bindings(model) { + return model.json("bindings") || {}; + }, + bindingProtocols(model) { + return Object.keys(bindingsMixins.bindings(model)); + }, + hasBinding(model, name2) { + return !!bindingsMixins.binding(model, name2); + }, + binding(model, name2) { + return getMapValue(model.json("bindings"), name2); + } + }; + tagsMixins = { + hasTags(model) { + return !!tagsMixins.tags(model).length; + }, + tags(model) { + const tags6 = model.json("tags"); + return tags6 ? tags6.map((t8) => new Tag3(t8)) : []; + }, + tagNames(model) { + const tags6 = model.json("tags"); + return tags6 ? tags6.map((t8) => t8.name) : []; + }, + hasTag(model, name2) { + return !!tagsMixins.tag(model, name2); + }, + tag(model, name2) { + const tg = (model.json("tags") || []).find((t8) => t8.name === name2); + return tg ? new Tag3(tg) : null; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/contact.js +var Contact3; +var init_contact4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/contact.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + Contact3 = class extends SpecificationExtensionsModel { + name() { + return this._json.name; + } + url() { + return this._json.url; + } + email() { + return this._json.email; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/license.js +var License3; +var init_license4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/license.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + License3 = class extends SpecificationExtensionsModel { + name() { + return this._json.name; + } + url() { + return this._json.url; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/info.js +var Info3; +var init_info4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/info.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_contact4(); + init_license4(); + init_mixins3(); + Info3 = class extends SpecificationExtensionsModel { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + termsOfService() { + return this._json.termsOfService; + } + license() { + if (!this._json.license) + return null; + return new License3(this._json.license); + } + contact() { + if (!this._json.contact) + return null; + return new Contact3(this._json.contact); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/server-variable.js +var ServerVariable3; +var init_server_variable4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/server-variable.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + ServerVariable3 = class extends SpecificationExtensionsModel { + allowedValues() { + return this._json.enum; + } + allows(name2) { + if (this._json.enum === void 0) + return true; + return this._json.enum.includes(name2); + } + hasAllowedValues() { + return this._json.enum !== void 0; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + defaultValue() { + return this._json.default; + } + hasDefaultValue() { + return this._json.default !== void 0; + } + examples() { + return this._json.examples; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/security-requirement.js +var SecurityRequirement3; +var init_security_requirement4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/security-requirement.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_base2(); + SecurityRequirement3 = class extends Base { + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/server.js +var Server3; +var init_server4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/server.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_server_variable4(); + init_security_requirement4(); + Server3 = class extends SpecificationExtensionsModel { + url() { + return this._json.url; + } + protocol() { + return this._json.protocol; + } + protocolVersion() { + return this._json.protocolVersion; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + variables() { + return createMapOfType(this._json.variables, ServerVariable3); + } + variable(name2) { + return getMapValue(this._json.variables, name2, ServerVariable3); + } + hasVariables() { + return !!this._json.variables; + } + security() { + if (!this._json.security) + return null; + return this._json.security.map((sec) => new SecurityRequirement3(sec)); + } + hasBindings() { + return bindingsMixins.hasBindings(this); + } + bindings() { + return bindingsMixins.bindings(this); + } + bindingProtocols() { + return bindingsMixins.bindingProtocols(this); + } + hasBinding(name2) { + return bindingsMixins.hasBinding(this, name2); + } + binding(name2) { + return bindingsMixins.binding(this, name2); + } + hasTags() { + return tagsMixins.hasTags(this); + } + tags() { + return tagsMixins.tags(this); + } + tagNames() { + return tagsMixins.tagNames(this); + } + hasTag(name2) { + return tagsMixins.hasTag(this, name2); + } + tag(name2) { + return tagsMixins.tag(this, name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/schema.js +var Schema4; +var init_schema7 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/schema.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_constants(); + Schema4 = class _Schema extends SpecificationExtensionsModel { + uid() { + return this.$id() || this.ext("x-parser-schema-id"); + } + $id() { + return this.__get("$id"); + } + multipleOf() { + return this.__get("multipleOf"); + } + maximum() { + return this.__get("maximum"); + } + exclusiveMaximum() { + return this.__get("exclusiveMaximum"); + } + minimum() { + return this.__get("minimum"); + } + exclusiveMinimum() { + return this.__get("exclusiveMinimum"); + } + maxLength() { + return this.__get("maxLength"); + } + minLength() { + return this.__get("minLength"); + } + pattern() { + return this.__get("pattern"); + } + maxItems() { + return this.__get("maxItems"); + } + minItems() { + return this.__get("minItems"); + } + uniqueItems() { + return this.__get("uniqueItems"); + } + maxProperties() { + return this.__get("maxProperties"); + } + minProperties() { + return this.__get("minProperties"); + } + required() { + return this.__get("required"); + } + enum() { + return this.__get("enum"); + } + type() { + return this.__get("type"); + } + allOf() { + const allOf = this.__get("allOf"); + return !allOf ? null : allOf.map(this.__createChild); + } + oneOf() { + const oneOf = this.__get("oneOf"); + return !oneOf ? null : oneOf.map(this.__createChild); + } + anyOf() { + const anyOf = this.__get("anyOf"); + return !anyOf ? null : anyOf.map(this.__createChild); + } + not() { + const not = this.__get("not"); + return !not ? null : this.__createChild(not); + } + items() { + const items = this.__get("items"); + if (!items) + return null; + if (Array.isArray(items)) { + return items.map(this.__createChild); + } + return this.__createChild(items); + } + properties() { + return createMapOfType(this.__get("properties"), _Schema, { parent: this }); + } + property(name2) { + return getMapValue(this.__get("properties"), name2, _Schema, { parent: this }); + } + additionalProperties() { + const additionalProperties = this.__get("additionalProperties"); + if (typeof additionalProperties === "boolean") + return additionalProperties; + if (additionalProperties === void 0 || additionalProperties === null) + return; + return this.__createChild(additionalProperties); + } + additionalItems() { + const additionalItems = this.__get("additionalItems"); + if (additionalItems === void 0 || additionalItems === null) + return; + return this.__createChild(additionalItems); + } + patternProperties() { + return createMapOfType(this.__get("patternProperties"), _Schema, { parent: this }); + } + const() { + return this.__get("const"); + } + contains() { + const contains2 = this.__get("contains"); + return typeof contains2 === "undefined" ? null : this.__createChild(contains2); + } + dependencies() { + const dependencies = this.__get("dependencies"); + if (!dependencies) + return null; + const result2 = {}; + Object.entries(dependencies).forEach(([key, value2]) => { + result2[key] = !Array.isArray(value2) ? this.__createChild(value2) : value2; + }); + return result2; + } + propertyNames() { + const propertyNames = this.__get("propertyNames"); + return typeof propertyNames === "undefined" ? null : this.__createChild(propertyNames); + } + if() { + const _if = this.__get("if"); + return typeof _if === "undefined" ? null : this.__createChild(_if); + } + then() { + const _then = this.__get("then"); + return typeof _then === "undefined" ? null : this.__createChild(_then); + } + else() { + const _else = this.__get("else"); + return typeof _else === "undefined" ? null : this.__createChild(_else); + } + format() { + return this.__get("format"); + } + contentEncoding() { + return this.__get("contentEncoding"); + } + contentMediaType() { + return this.__get("contentMediaType"); + } + definitions() { + return createMapOfType(this.__get("definitions"), _Schema, { parent: this }); + } + title() { + return this.__get("title"); + } + default() { + return this.__get("default"); + } + deprecated() { + return this.__get("deprecated"); + } + discriminator() { + return this.__get("discriminator"); + } + readOnly() { + return this.__get("readOnly"); + } + writeOnly() { + return this.__get("writeOnly"); + } + examples() { + return this.__get("examples"); + } + isBooleanSchema() { + return typeof this._json === "boolean"; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + externalDocs() { + return externalDocs3(this); + } + hasExternalDocs() { + return hasExternalDocs3(this); + } + isCircular() { + if (this.ext(xParserCircular)) { + return true; + } + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._json) + return true; + parent2 = parent2._meta && parent2._meta.parent; + } + return false; + } + circularSchema() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._json) + return parent2; + parent2 = parent2._meta && parent2._meta.parent; + } + } + hasCircularProps() { + if (Array.isArray(this.ext(xParserCircularProps))) { + return this.ext(xParserCircularProps).length > 0; + } + return Object.entries(this.properties() || {}).map(([propertyName, property2]) => { + if (property2.isCircular()) + return propertyName; + }).filter(Boolean).length > 0; + } + circularProps() { + if (Array.isArray(this.ext(xParserCircularProps))) { + return this.ext(xParserCircularProps); + } + return Object.entries(this.properties() || {}).map(([propertyName, property2]) => { + if (property2.isCircular()) + return propertyName; + }).filter(Boolean); + } + __get(key) { + if (typeof this._json === "boolean") + return; + return this._json[key]; + } + __createChild(s7) { + return new _Schema(s7, { parent: this }); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/channel-parameter.js +var ChannelParameter3; +var init_channel_parameter4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/channel-parameter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_schema7(); + ChannelParameter3 = class extends SpecificationExtensionsModel { + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + schema() { + if (!this._json.schema) + return null; + return new Schema4(this._json.schema); + } + location() { + return this._json.location; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/operation-trait.js +var OperationTrait3; +var init_operation_trait4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/operation-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_security_requirement4(); + OperationTrait3 = class extends SpecificationExtensionsModel { + isPublish() { + return this._meta.kind === "publish"; + } + isSubscribe() { + return this._meta.kind === "subscribe"; + } + kind() { + return this._meta.kind; + } + id() { + return this._json.operationId; + } + summary() { + return this._json.summary; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + externalDocs() { + return externalDocs3(this); + } + hasExternalDocs() { + return hasExternalDocs3(this); + } + hasTags() { + return tagsMixins.hasTags(this); + } + tags() { + return tagsMixins.tags(this); + } + tagNames() { + return tagsMixins.tagNames(this); + } + hasTag(name2) { + return tagsMixins.hasTag(this, name2); + } + tag(name2) { + return tagsMixins.tag(this, name2); + } + hasBindings() { + return bindingsMixins.hasBindings(this); + } + bindings() { + return bindingsMixins.bindings(this); + } + bindingProtocols() { + return bindingsMixins.bindingProtocols(this); + } + hasBinding(name2) { + return bindingsMixins.hasBinding(this, name2); + } + binding(name2) { + return bindingsMixins.binding(this, name2); + } + security() { + if (!this._json.security) + return null; + return this._json.security.map((sec) => new SecurityRequirement3(sec)); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/correlation-id.js +var CorrelationId3; +var init_correlation_id4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/correlation-id.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + CorrelationId3 = class extends SpecificationExtensionsModel { + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + location() { + return this._json.location; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/message-trait.js +var MessageTrait3; +var init_message_trait4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/message-trait.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_correlation_id4(); + init_schema7(); + MessageTrait3 = class extends SpecificationExtensionsModel { + id() { + return this._json.messageId; + } + headers() { + if (!this._json.headers) + return null; + return new Schema4(this._json.headers); + } + header(name2) { + if (!this._json.headers) + return null; + return getMapValue(this._json.headers.properties || {}, name2, Schema4); + } + correlationId() { + if (!this._json.correlationId) + return null; + return new CorrelationId3(this._json.correlationId); + } + schemaFormat() { + return this._json.schemaFormat; + } + contentType() { + return this._json.contentType; + } + name() { + return this._json.name; + } + title() { + return this._json.title; + } + summary() { + return this._json.summary; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + externalDocs() { + return externalDocs3(this); + } + hasExternalDocs() { + return hasExternalDocs3(this); + } + hasTags() { + return tagsMixins.hasTags(this); + } + tags() { + return tagsMixins.tags(this); + } + tagNames() { + return tagsMixins.tagNames(this); + } + hasTag(name2) { + return tagsMixins.hasTag(this, name2); + } + tag(name2) { + return tagsMixins.tag(this, name2); + } + hasBindings() { + return bindingsMixins.hasBindings(this); + } + bindings() { + return bindingsMixins.bindings(this); + } + bindingProtocols() { + return bindingsMixins.bindingProtocols(this); + } + hasBinding(name2) { + return bindingsMixins.hasBinding(this, name2); + } + binding(name2) { + return bindingsMixins.binding(this, name2); + } + examples() { + return this._json.examples; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/message.js +var Message3; +var init_message4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/message.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_message_trait4(); + init_schema7(); + init_constants(); + Message3 = class extends MessageTrait3 { + uid() { + return this.id() || this.name() || this.ext(xParserMessageName); + } + payload() { + if (!this._json.payload) + return null; + return new Schema4(this._json.payload); + } + traits() { + const traits = this.ext(xParserOriginalTraits) || this._json.traits; + if (!traits) + return []; + return traits.map((t8) => new MessageTrait3(t8)); + } + hasTraits() { + return !!this.ext(xParserOriginalTraits) || !!this._json.traits; + } + originalPayload() { + return this.ext(xParserOriginalPayload) || this.payload(); + } + originalSchemaFormat() { + return this.ext(xParserOriginalSchemaFormat) || this.schemaFormat(); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/operation.js +var Operation3; +var init_operation4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/operation.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_operation_trait4(); + init_message4(); + Operation3 = class extends OperationTrait3 { + traits() { + const traits = this._json["x-parser-original-traits"] || this._json.traits; + if (!traits) + return []; + return traits.map((t8) => new OperationTrait3(t8)); + } + hasTraits() { + return !!this._json["x-parser-original-traits"] || !!this._json.traits; + } + hasMultipleMessages() { + const message = this._json.message; + if (message && message.oneOf && message.oneOf.length > 1) + return true; + return false; + } + messages() { + const message = this._json.message; + if (!message) + return []; + if (message.oneOf) + return message.oneOf.map((m7) => new Message3(m7)); + return [new Message3(message)]; + } + message(index4) { + const message = this._json.message; + if (!message) + return null; + if (message.oneOf && message.oneOf.length === 1) + return new Message3(message.oneOf[0]); + if (!message.oneOf) + return new Message3(message); + if (typeof index4 !== "number") + return null; + if (index4 > message.oneOf.length - 1) + return null; + return new Message3(message.oneOf[+index4]); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/channel.js +var Channel3; +var init_channel4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/channel.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_channel_parameter4(); + init_operation4(); + Channel3 = class extends SpecificationExtensionsModel { + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + hasParameters() { + return !!this._json.parameters; + } + parameters() { + return createMapOfType(this._json.parameters, ChannelParameter3); + } + parameter(name2) { + return getMapValue(this._json.parameters, name2, ChannelParameter3); + } + hasServers() { + return !!this._json.servers; + } + servers() { + if (!this._json.servers) + return []; + return this._json.servers; + } + server(index4) { + if (!this._json.servers) + return null; + if (typeof index4 !== "number") + return null; + if (index4 > this._json.servers.length - 1) + return null; + return this._json.servers[+index4]; + } + publish() { + if (!this._json.publish) + return null; + return new Operation3(this._json.publish, { kind: "publish" }); + } + subscribe() { + if (!this._json.subscribe) + return null; + return new Operation3(this._json.subscribe, { kind: "subscribe" }); + } + hasPublish() { + return !!this._json.publish; + } + hasSubscribe() { + return !!this._json.subscribe; + } + hasBindings() { + return bindingsMixins.hasBindings(this); + } + bindings() { + return bindingsMixins.bindings(this); + } + bindingProtocols() { + return bindingsMixins.bindingProtocols(this); + } + hasBinding(name2) { + return bindingsMixins.hasBinding(this, name2); + } + binding(name2) { + return bindingsMixins.binding(this, name2); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/oauth-flow.js +var OAuthFlow3; +var init_oauth_flow4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/oauth-flow.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + OAuthFlow3 = class extends SpecificationExtensionsModel { + authorizationUrl() { + return this._json.authorizationUrl; + } + tokenUrl() { + return this._json.tokenUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.scopes; + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/security-scheme.js +var SecurityScheme3; +var init_security_scheme4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/security-scheme.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_oauth_flow4(); + SecurityScheme3 = class extends SpecificationExtensionsModel { + type() { + return this._json.type; + } + description() { + return description3(this); + } + hasDescription() { + return hasDescription3(this); + } + name() { + return this._json.name; + } + in() { + return this._json.in; + } + scheme() { + return this._json.scheme; + } + bearerFormat() { + return this._json.bearerFormat; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + flows() { + return createMapOfType(this._json.flows, OAuthFlow3); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/components.js +var Components3; +var init_components4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/components.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_channel4(); + init_message4(); + init_schema7(); + init_security_scheme4(); + init_server4(); + init_channel_parameter4(); + init_correlation_id4(); + init_operation_trait4(); + init_message_trait4(); + init_server_variable4(); + Components3 = class extends SpecificationExtensionsModel { + hasChannels() { + return !!this._json.channels; + } + channels() { + return createMapOfType(this._json.channels, Channel3); + } + channel(name2) { + return getMapValue(this._json.channels, name2, Channel3); + } + hasMessages() { + return !!this._json.messages; + } + messages() { + return createMapOfType(this._json.messages, Message3); + } + message(name2) { + return getMapValue(this._json.messages, name2, Message3); + } + hasSchemas() { + return !!this._json.schemas; + } + schemas() { + return createMapOfType(this._json.schemas, Schema4); + } + schema(name2) { + return getMapValue(this._json.schemas, name2, Schema4); + } + hasSecuritySchemes() { + return !!this._json.securitySchemes; + } + securitySchemes() { + return createMapOfType(this._json.securitySchemes, SecurityScheme3); + } + securityScheme(name2) { + return getMapValue(this._json.securitySchemes, name2, SecurityScheme3); + } + hasServers() { + return !!this._json.servers; + } + servers() { + return createMapOfType(this._json.servers, Server3); + } + server(name2) { + return getMapValue(this._json.servers, name2, Server3); + } + hasParameters() { + return !!this._json.parameters; + } + parameters() { + return createMapOfType(this._json.parameters, ChannelParameter3); + } + parameter(name2) { + return getMapValue(this._json.parameters, name2, ChannelParameter3); + } + hasCorrelationIds() { + return !!this._json.correlationIds; + } + correlationIds() { + return createMapOfType(this._json.correlationIds, CorrelationId3); + } + correlationId(name2) { + return getMapValue(this._json.correlationIds, name2, CorrelationId3); + } + hasOperationTraits() { + return !!this._json.operationTraits; + } + operationTraits() { + return createMapOfType(this._json.operationTraits, OperationTrait3); + } + operationTrait(name2) { + return getMapValue(this._json.operationTraits, name2, OperationTrait3); + } + hasMessageTraits() { + return !!this._json.messageTraits; + } + messageTraits() { + return createMapOfType(this._json.messageTraits, MessageTrait3); + } + messageTrait(name2) { + return getMapValue(this._json.messageTraits, name2, MessageTrait3); + } + hasServerVariables() { + return !!this._json.serverVariables; + } + serverVariables() { + return createMapOfType(this._json.serverVariables, ServerVariable3); + } + serverVariable(name2) { + return getMapValue(this._json.serverVariables, name2, ServerVariable3); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/iterator.js +function traverseAsyncApiDocument2(doc, callback, schemaTypesToIterate = []) { + if (schemaTypesToIterate.length === 0) { + schemaTypesToIterate = Object.values(SchemaTypesToIterate2); + } + const options = { callback, schemaTypesToIterate, seenSchemas: /* @__PURE__ */ new Set() }; + Object.values(doc.channels()).forEach((channel) => { + traverseChannel2(channel, options); + }); + const components = doc.components(); + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.components) && components) { + Object.values(components.messages()).forEach((message) => { + traverseMessage2(message, options); + }); + Object.values(components.schemas()).forEach((schema8) => { + traverseSchema2(schema8, null, options); + }); + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.parameters)) { + Object.values(components.parameters()).forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8) { + traverseSchema2(schema8, null, options); + } + }); + } + Object.values(components.messageTraits()).forEach((messageTrait) => { + traverseMessageTrait2(messageTrait, options); + }); + } +} +function traverseSchema2(schema8, propOrIndex, options) { + if (!schema8) + return; + const { schemaTypesToIterate, callback, seenSchemas } = options; + const jsonSchema = schema8.json(); + if (seenSchemas.has(jsonSchema)) + return; + seenSchemas.add(jsonSchema); + let types3 = schema8.type() || []; + if (!Array.isArray(types3)) { + types3 = [types3]; + } + if (!schemaTypesToIterate.includes(SchemaTypesToIterate2.objects) && types3.includes("object")) + return; + if (!schemaTypesToIterate.includes(SchemaTypesToIterate2.arrays) && types3.includes("array")) + return; + if (callback(schema8, propOrIndex, SchemaIteratorCallbackType2.NEW_SCHEMA) === false) + return; + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.objects) && types3.includes("object")) { + recursiveSchemaObject2(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.arrays) && types3.includes("array")) { + recursiveSchemaArray2(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.oneOfs)) { + (schema8.oneOf() || []).forEach((combineSchema, idx) => { + traverseSchema2(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.anyOfs)) { + (schema8.anyOf() || []).forEach((combineSchema, idx) => { + traverseSchema2(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.allOfs)) { + (schema8.allOf() || []).forEach((combineSchema, idx) => { + traverseSchema2(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.nots) && schema8.not()) { + traverseSchema2(schema8.not(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.ifs) && schema8.if()) { + traverseSchema2(schema8.if(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.thenes) && schema8.then()) { + traverseSchema2(schema8.then(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.elses) && schema8.else()) { + traverseSchema2(schema8.else(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.dependencies)) { + Object.entries(schema8.dependencies() || {}).forEach(([depName, dep]) => { + if (dep && !Array.isArray(dep)) { + traverseSchema2(dep, depName, options); + } + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.definitions)) { + Object.entries(schema8.definitions() || {}).forEach(([defName, def]) => { + traverseSchema2(def, defName, options); + }); + } + callback(schema8, propOrIndex, SchemaIteratorCallbackType2.END_SCHEMA); + seenSchemas.delete(jsonSchema); +} +function recursiveSchemaObject2(schema8, options) { + Object.entries(schema8.properties()).forEach(([propertyName, property2]) => { + traverseSchema2(property2, propertyName, options); + }); + const additionalProperties = schema8.additionalProperties(); + if (typeof additionalProperties === "object") { + traverseSchema2(additionalProperties, null, options); + } + const schemaTypesToIterate = options.schemaTypesToIterate; + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.propertyNames) && schema8.propertyNames()) { + traverseSchema2(schema8.propertyNames(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.patternProperties)) { + Object.entries(schema8.patternProperties() || {}).forEach(([propertyName, property2]) => { + traverseSchema2(property2, propertyName, options); + }); + } +} +function recursiveSchemaArray2(schema8, options) { + const items = schema8.items(); + if (items) { + if (Array.isArray(items)) { + items.forEach((item, idx) => { + traverseSchema2(item, idx, options); + }); + } else { + traverseSchema2(items, null, options); + } + } + const additionalItems = schema8.additionalItems(); + if (typeof additionalItems === "object") { + traverseSchema2(additionalItems, null, options); + } + if (options.schemaTypesToIterate.includes("contains") && schema8.contains()) { + traverseSchema2(schema8.contains(), null, options); + } +} +function traverseChannel2(channel, options) { + if (!channel) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.parameters)) { + Object.values(channel.parameters() || {}).forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8) { + traverseSchema2(schema8, null, options); + } + }); + } + const publish = channel.publish(); + if (publish) { + publish.messages().forEach((message) => { + traverseMessage2(message, options); + }); + } + const subscribe = channel.subscribe(); + if (subscribe) { + subscribe.messages().forEach((message) => { + traverseMessage2(message, options); + }); + } +} +function traverseMessage2(message, options) { + if (!message) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.headers)) { + const headers = message.headers(); + if (headers) { + traverseSchema2(headers, null, options); + } + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.payloads)) { + const payload = message.payload(); + if (payload) { + traverseSchema2(payload, null, options); + } + } +} +function traverseMessageTrait2(messageTrait, options) { + if (!messageTrait) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate2.headers)) { + const headers = messageTrait.headers(); + if (headers) { + traverseSchema2(headers, null, options); + } + } +} +var SchemaIteratorCallbackType2, SchemaTypesToIterate2; +var init_iterator2 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/iterator.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + (function(SchemaIteratorCallbackType5) { + SchemaIteratorCallbackType5["NEW_SCHEMA"] = "NEW_SCHEMA"; + SchemaIteratorCallbackType5["END_SCHEMA"] = "END_SCHEMA"; + })(SchemaIteratorCallbackType2 || (SchemaIteratorCallbackType2 = {})); + (function(SchemaTypesToIterate5) { + SchemaTypesToIterate5["parameters"] = "parameters"; + SchemaTypesToIterate5["payloads"] = "payloads"; + SchemaTypesToIterate5["headers"] = "headers"; + SchemaTypesToIterate5["components"] = "components"; + SchemaTypesToIterate5["objects"] = "objects"; + SchemaTypesToIterate5["arrays"] = "arrays"; + SchemaTypesToIterate5["oneOfs"] = "oneOfs"; + SchemaTypesToIterate5["allOfs"] = "allOfs"; + SchemaTypesToIterate5["anyOfs"] = "anyOfs"; + SchemaTypesToIterate5["nots"] = "nots"; + SchemaTypesToIterate5["propertyNames"] = "propertyNames"; + SchemaTypesToIterate5["patternProperties"] = "patternProperties"; + SchemaTypesToIterate5["contains"] = "contains"; + SchemaTypesToIterate5["ifs"] = "ifs"; + SchemaTypesToIterate5["thenes"] = "thenes"; + SchemaTypesToIterate5["elses"] = "elses"; + SchemaTypesToIterate5["dependencies"] = "dependencies"; + SchemaTypesToIterate5["definitions"] = "definitions"; + })(SchemaTypesToIterate2 || (SchemaTypesToIterate2 = {})); + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/asyncapi.js +var AsyncAPIDocument3; +var init_asyncapi4 = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/asyncapi.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_mixins3(); + init_info4(); + init_server4(); + init_channel4(); + init_components4(); + init_iterator2(); + init_constants(); + init_stringify2(); + AsyncAPIDocument3 = class _AsyncAPIDocument extends SpecificationExtensionsModel { + version() { + return this._json.asyncapi; + } + info() { + return new Info3(this._json.info); + } + id() { + return this._json.id; + } + externalDocs() { + return externalDocs3(this); + } + hasExternalDocs() { + return hasExternalDocs3(this); + } + hasTags() { + return tagsMixins.hasTags(this); + } + tags() { + return tagsMixins.tags(this); + } + tagNames() { + return tagsMixins.tagNames(this); + } + hasTag(name2) { + return tagsMixins.hasTag(this, name2); + } + tag(name2) { + return tagsMixins.tag(this, name2); + } + hasServers() { + return !!this._json.servers; + } + servers() { + return createMapOfType(this._json.servers, Server3); + } + serverNames() { + if (!this._json.servers) + return []; + return Object.keys(this._json.servers); + } + server(name2) { + return getMapValue(this._json.servers, name2, Server3); + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + defaultContentType() { + return this._json.defaultContentType || null; + } + hasChannels() { + return !!this._json.channels; + } + channels() { + return createMapOfType(this._json.channels, Channel3); + } + channelNames() { + if (!this._json.channels) + return []; + return Object.keys(this._json.channels); + } + channel(name2) { + return getMapValue(this._json.channels, name2, Channel3); + } + hasComponents() { + return !!this._json.components; + } + components() { + if (!this._json.components) + return null; + return new Components3(this._json.components); + } + hasMessages() { + return !!this.allMessages().size; + } + allMessages() { + const messages = /* @__PURE__ */ new Map(); + if (this.hasChannels()) { + this.channelNames().forEach((channelName) => { + const channel = this.channel(channelName); + if (channel) { + if (channel.hasPublish()) { + channel.publish().messages().forEach((m7) => { + messages.set(m7.uid(), m7); + }); + } + if (channel.hasSubscribe()) { + channel.subscribe().messages().forEach((m7) => { + messages.set(m7.uid(), m7); + }); + } + } + }); + } + if (this.hasComponents()) { + Object.values(this.components().messages()).forEach((m7) => { + messages.set(m7.uid(), m7); + }); + } + return messages; + } + allSchemas() { + const schemas5 = /* @__PURE__ */ new Map(); + function allSchemasCallback(schema8) { + if (schema8.uid()) { + schemas5.set(schema8.uid(), schema8); + } + } + traverseAsyncApiDocument2(this, allSchemasCallback); + return schemas5; + } + hasCircular() { + return !!this._json[xParserCircular]; + } + traverseSchemas(callback, schemaTypesToIterate = []) { + traverseAsyncApiDocument2(this, callback, schemaTypesToIterate); + } + static stringify(doc, space) { + const rawDoc = doc.json(); + const copiedDoc = Object.assign({}, rawDoc); + copiedDoc[xParserSpecStringified] = true; + return JSON.stringify(copiedDoc, refReplacer(), space); + } + static parse(doc) { + let parsedJSON = doc; + if (typeof doc === "string") { + parsedJSON = JSON.parse(doc); + } else if (typeof doc === "object") { + parsedJSON = Object.assign({}, parsedJSON); + } + if (typeof parsedJSON !== "object" || !parsedJSON[xParserSpecParsed]) { + throw new Error("Cannot parse invalid AsyncAPI document"); + } + if (!parsedJSON[xParserSpecStringified]) { + return new _AsyncAPIDocument(parsedJSON); + } + delete parsedJSON[String(xParserSpecStringified)]; + const objToPath = /* @__PURE__ */ new Map(); + const pathToObj = /* @__PURE__ */ new Map(); + traverseStringifiedData(parsedJSON, void 0, parsedJSON, objToPath, pathToObj); + return new _AsyncAPIDocument(parsedJSON); + } + }; + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/converter.js +function convertToOldAPI(newDocument) { + const data = copy(newDocument.json()); + const document2 = new AsyncAPIDocument3(data); + handleMessages(document2); + handleOperations(document2); + setExtension(xParserApiVersion, 0, document2); + return document2; +} +function convertToNewAPI(oldDocument) { + const data = copy(oldDocument.json()); + const detailed = createDetailedAsyncAPI(data); + return createAsyncAPIDocument(detailed); +} +function handleMessages(document2) { + const defaultSchemaFormat = getDefaultSchemaFormat(document2.version()); + for (const message of document2.allMessages().values()) { + const json2 = message.json(); + if (json2.traits) { + json2[xParserOriginalTraits] = json2.traits; + delete json2.traits; + } + json2[xParserOriginalSchemaFormat] = json2.schemaFormat || defaultSchemaFormat; + json2.schemaFormat = defaultSchemaFormat; + json2[xParserOriginalPayload] = json2[xParserOriginalPayload] || json2.payload; + json2[xParserMessageParsed] = true; + } +} +function handleOperations(document2) { + Object.values(document2.channels()).forEach((channel) => { + const publish = channel.publish(); + const subscribe = channel.subscribe(); + if (publish) { + const json2 = publish.json(); + if (json2.traits) { + json2[xParserOriginalTraits] = json2.traits; + delete json2.traits; + } + } + if (subscribe) { + const json2 = subscribe.json(); + if (json2.traits) { + json2[xParserOriginalTraits] = json2.traits; + delete json2.traits; + } + } + }); +} +var init_converter = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/converter.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_asyncapi4(); + init_constants(); + init_document(); + init_stringify2(); + init_schema_parser(); + init_utils2(); + } +}); + +// node_modules/@asyncapi/parser/esm/old-api/index.js +var init_old_api = __esm({ + "node_modules/@asyncapi/parser/esm/old-api/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_converter(); + init_asyncapi4(); + init_base2(); + init_channel_parameter4(); + init_channel4(); + init_components4(); + init_contact4(); + init_correlation_id4(); + init_external_docs4(); + init_license4(); + init_message_trait4(); + init_message4(); + init_oauth_flow4(); + init_operation_trait4(); + init_operation4(); + init_schema7(); + init_security_requirement4(); + init_security_scheme4(); + init_server_variable4(); + init_server4(); + init_tag4(); + } +}); + +// node_modules/@asyncapi/parser/esm/index.js +var esm_exports = {}; +__export(esm_exports, { + AsyncAPIDocumentV2: () => AsyncAPIDocument, + AsyncAPIDocumentV3: () => AsyncAPIDocument2, + BaseModel: () => BaseModel, + BindingV2: () => Binding, + BindingV3: () => Binding2, + BindingsV2: () => Bindings, + BindingsV3: () => Bindings2, + ChannelParameterV2: () => ChannelParameter, + ChannelParameterV3: () => ChannelParameter2, + ChannelParametersV2: () => ChannelParameters, + ChannelParametersV3: () => ChannelParameters2, + ChannelV2: () => Channel, + ChannelV3: () => Channel2, + ChannelsV2: () => Channels, + ChannelsV3: () => Channels2, + Collection: () => Collection2, + ComponentsV2: () => Components, + ComponentsV3: () => Components2, + ContactV2: () => Contact, + ContactV3: () => Contact2, + CorrelationIdV2: () => CorrelationId, + CorrelationIdV3: () => CorrelationId2, + DiagnosticSeverity: () => DiagnosticSeverity, + ExtensionV2: () => Extension, + ExtensionV3: () => Extension2, + ExtensionsV2: () => Extensions, + ExtensionsV3: () => Extensions2, + ExternalDocumentationV2: () => ExternalDocumentation, + ExternalDocumentationV3: () => ExternalDocumentation2, + InfoV2: () => Info, + InfoV3: () => Info2, + LicenseV2: () => License, + LicenseV3: () => License2, + MessageExampleV2: () => MessageExample, + MessageExampleV3: () => MessageExample2, + MessageExamplesV2: () => MessageExamples, + MessageExamplesV3: () => MessageExamples2, + MessageTraitV2: () => MessageTrait, + MessageTraitV3: () => MessageTrait2, + MessageTraitsV2: () => MessageTraits, + MessageTraitsV3: () => MessageTraits2, + MessageV2: () => Message, + MessageV3: () => Message2, + MessagesV2: () => Messages, + MessagesV3: () => Messages2, + OAuthFlowV2: () => OAuthFlow, + OAuthFlowV3: () => OAuthFlow2, + OAuthFlowsV2: () => OAuthFlows, + OAuthFlowsV3: () => OAuthFlows2, + OldAsyncAPIDocument: () => AsyncAPIDocument3, + OldBase: () => Base, + OldChannel: () => Channel3, + OldChannelParameter: () => ChannelParameter3, + OldComponents: () => Components3, + OldContact: () => Contact3, + OldCorrelationId: () => CorrelationId3, + OldExternalDocs: () => ExternalDocs, + OldLicense: () => License3, + OldMessage: () => Message3, + OldMessageTrait: () => MessageTrait3, + OldOAuthFlow: () => OAuthFlow3, + OldOperation: () => Operation3, + OldOperationTrait: () => OperationTrait3, + OldSchema: () => Schema4, + OldSecurityRequirement: () => SecurityRequirement3, + OldSecurityScheme: () => SecurityScheme3, + OldServer: () => Server3, + OldServerVariable: () => ServerVariable3, + OldTag: () => Tag3, + OperationRepliesV3: () => OperationReplies, + OperationReplyAddressV3: () => OperationReplyAddress, + OperationReplyAddressesV3: () => OperationReplyAddresses, + OperationReplyV3: () => OperationReply, + OperationTraitV2: () => OperationTrait, + OperationTraitV3: () => OperationTrait2, + OperationTraitsV2: () => OperationTraits, + OperationTraitsV3: () => OperationTraits2, + OperationV2: () => Operation, + OperationV3: () => Operation2, + OperationsV2: () => Operations, + OperationsV3: () => Operations2, + Parser: () => Parser3, + ParserAPIVersion: () => ParserAPIVersion, + SchemaV2: () => Schema2, + SchemaV3: () => Schema3, + SchemasV2: () => Schemas, + SchemasV3: () => Schemas2, + SecuritySchemeV2: () => SecurityScheme, + SecuritySchemeV3: () => SecurityScheme2, + SecuritySchemesV2: () => SecuritySchemes, + SecuritySchemesV3: () => SecuritySchemes2, + ServerV2: () => Server, + ServerV3: () => Server2, + ServerVariableV2: () => ServerVariable, + ServerVariableV3: () => ServerVariable2, + ServerVariablesV2: () => ServerVariables, + ServerVariablesV3: () => ServerVariables2, + ServersV2: () => Servers, + ServersV3: () => Servers2, + TagV2: () => Tag, + TagV3: () => Tag2, + TagsV2: () => Tags, + TagsV3: () => Tags2, + convertToNewAPI: () => convertToNewAPI, + convertToOldAPI: () => convertToOldAPI, + createAsyncAPIDocument: () => createAsyncAPIDocument, + default: () => esm_default, + fromFile: () => fromFile, + fromURL: () => fromURL, + isAsyncAPIDocument: () => isAsyncAPIDocument, + isOldAsyncAPIDocument: () => isOldAsyncAPIDocument, + stringify: () => stringify4, + toAsyncAPIDocument: () => toAsyncAPIDocument, + unstringify: () => unstringify +}); +var esm_default; +var init_esm = __esm({ + "node_modules/@asyncapi/parser/esm/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_dist2(); + init_parser3(); + init_models(); + init_stringify2(); + init_from(); + init_document(); + init_old_api(); + esm_default = Parser3; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/punycode.js +function dew6() { + if (_dewExec6) + return exports$15; + _dewExec6 = true; + const maxInt = 2147483647; + const base = 36; + const tMin = 1; + const tMax = 26; + const skew = 38; + const damp = 700; + const initialBias = 72; + const initialN = 128; + const delimiter2 = "-"; + const regexPunycode = /^xn--/; + const regexNonASCII = /[^\0-\x7F]/; + const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; + const errors = { + "overflow": "Overflow: input needs wider integers to process", + "not-basic": "Illegal input >= 0x80 (not a basic code point)", + "invalid-input": "Invalid input" + }; + const baseMinusTMin = base - tMin; + const floor2 = Math.floor; + const stringFromCharCode = String.fromCharCode; + function error2(type3) { + throw new RangeError(errors[type3]); + } + function map4(array, callback) { + const result2 = []; + let length = array.length; + while (length--) { + result2[length] = callback(array[length]); + } + return result2; + } + function mapDomain(domain3, callback) { + const parts = domain3.split("@"); + let result2 = ""; + if (parts.length > 1) { + result2 = parts[0] + "@"; + domain3 = parts[1]; + } + domain3 = domain3.replace(regexSeparators, "."); + const labels = domain3.split("."); + const encoded = map4(labels, callback).join("."); + return result2 + encoded; + } + function ucs2decode(string2) { + const output = []; + let counter = 0; + const length = string2.length; + while (counter < length) { + const value2 = string2.charCodeAt(counter++); + if (value2 >= 55296 && value2 <= 56319 && counter < length) { + const extra = string2.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + output.push(((value2 & 1023) << 10) + (extra & 1023) + 65536); + } else { + output.push(value2); + counter--; + } + } else { + output.push(value2); + } + } + return output; + } + const ucs2encode = (codePoints) => String.fromCodePoint(...codePoints); + const basicToDigit = function(codePoint) { + if (codePoint >= 48 && codePoint < 58) { + return 26 + (codePoint - 48); + } + if (codePoint >= 65 && codePoint < 91) { + return codePoint - 65; + } + if (codePoint >= 97 && codePoint < 123) { + return codePoint - 97; + } + return base; + }; + const digitToBasic = function(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + }; + const adapt = function(delta, numPoints, firstTime) { + let k6 = 0; + delta = firstTime ? floor2(delta / damp) : delta >> 1; + delta += floor2(delta / numPoints); + for (; delta > baseMinusTMin * tMax >> 1; k6 += base) { + delta = floor2(delta / baseMinusTMin); + } + return floor2(k6 + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + const decode2 = function(input) { + const output = []; + const inputLength = input.length; + let i7 = 0; + let n7 = initialN; + let bias = initialBias; + let basic = input.lastIndexOf(delimiter2); + if (basic < 0) { + basic = 0; + } + for (let j6 = 0; j6 < basic; ++j6) { + if (input.charCodeAt(j6) >= 128) { + error2("not-basic"); + } + output.push(input.charCodeAt(j6)); + } + for (let index4 = basic > 0 ? basic + 1 : 0; index4 < inputLength; ) { + const oldi = i7; + for (let w6 = 1, k6 = base; ; k6 += base) { + if (index4 >= inputLength) { + error2("invalid-input"); + } + const digit = basicToDigit(input.charCodeAt(index4++)); + if (digit >= base) { + error2("invalid-input"); + } + if (digit > floor2((maxInt - i7) / w6)) { + error2("overflow"); + } + i7 += digit * w6; + const t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (digit < t8) { + break; + } + const baseMinusT = base - t8; + if (w6 > floor2(maxInt / baseMinusT)) { + error2("overflow"); + } + w6 *= baseMinusT; + } + const out = output.length + 1; + bias = adapt(i7 - oldi, out, oldi == 0); + if (floor2(i7 / out) > maxInt - n7) { + error2("overflow"); + } + n7 += floor2(i7 / out); + i7 %= out; + output.splice(i7++, 0, n7); + } + return String.fromCodePoint(...output); + }; + const encode2 = function(input) { + const output = []; + input = ucs2decode(input); + const inputLength = input.length; + let n7 = initialN; + let delta = 0; + let bias = initialBias; + for (const currentValue of input) { + if (currentValue < 128) { + output.push(stringFromCharCode(currentValue)); + } + } + const basicLength = output.length; + let handledCPCount = basicLength; + if (basicLength) { + output.push(delimiter2); + } + while (handledCPCount < inputLength) { + let m7 = maxInt; + for (const currentValue of input) { + if (currentValue >= n7 && currentValue < m7) { + m7 = currentValue; + } + } + const handledCPCountPlusOne = handledCPCount + 1; + if (m7 - n7 > floor2((maxInt - delta) / handledCPCountPlusOne)) { + error2("overflow"); + } + delta += (m7 - n7) * handledCPCountPlusOne; + n7 = m7; + for (const currentValue of input) { + if (currentValue < n7 && ++delta > maxInt) { + error2("overflow"); + } + if (currentValue === n7) { + let q5 = delta; + for (let k6 = base; ; k6 += base) { + const t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (q5 < t8) { + break; + } + const qMinusT = q5 - t8; + const baseMinusT = base - t8; + output.push(stringFromCharCode(digitToBasic(t8 + qMinusT % baseMinusT, 0))); + q5 = floor2(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q5, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + ++delta; + ++n7; + } + return output.join(""); + }; + const toUnicode2 = function(input) { + return mapDomain(input, function(string2) { + return regexPunycode.test(string2) ? decode2(string2.slice(4).toLowerCase()) : string2; + }); + }; + const toASCII2 = function(input) { + return mapDomain(input, function(string2) { + return regexNonASCII.test(string2) ? "xn--" + encode2(string2) : string2; + }); + }; + const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + "version": "2.3.1", + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + "ucs2": { + "decode": ucs2decode, + "encode": ucs2encode + }, + "decode": decode2, + "encode": encode2, + "toASCII": toASCII2, + "toUnicode": toUnicode2 + }; + exports$15 = punycode; + return exports$15; +} +var exports$15, _dewExec6, exports9, decode, encode, toASCII, toUnicode, ucs2, version3; +var init_punycode = __esm({ + "node_modules/@jspm/core/nodelibs/browser/punycode.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports$15 = {}; + _dewExec6 = false; + exports9 = dew6(); + decode = exports9.decode; + encode = exports9.encode; + toASCII = exports9.toASCII; + toUnicode = exports9.toUnicode; + ucs2 = exports9.ucs2; + version3 = exports9.version; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/url.js +var url_exports = {}; +__export(url_exports, { + URL: () => _URL, + Url: () => Url, + default: () => exports10, + fileURLToPath: () => fileURLToPath, + format: () => format4, + parse: () => parse7, + pathToFileURL: () => pathToFileURL, + resolve: () => resolve2, + resolveObject: () => resolveObject +}); +function dew$73() { + if (_dewExec$73) + return exports$83; + _dewExec$73 = true; + var hasMap = typeof Map === "function" && Map.prototype; + var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; + var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; + var mapForEach = hasMap && Map.prototype.forEach; + var hasSet = typeof Set === "function" && Set.prototype; + var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; + var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; + var setForEach = hasSet && Set.prototype.forEach; + var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; + var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; + var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; + var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; + var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; + var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; + var booleanValueOf = Boolean.prototype.valueOf; + var objectToString2 = Object.prototype.toString; + var functionToString = Function.prototype.toString; + var $match = String.prototype.match; + var $slice = String.prototype.slice; + var $replace = String.prototype.replace; + var $toUpperCase = String.prototype.toUpperCase; + var $toLowerCase = String.prototype.toLowerCase; + var $test = RegExp.prototype.test; + var $concat = Array.prototype.concat; + var $join = Array.prototype.join; + var $arrSlice = Array.prototype.slice; + var $floor = Math.floor; + var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; + var gOPS = Object.getOwnPropertySymbols; + var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; + var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; + var toStringTag2 = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; + var isEnumerable = Object.prototype.propertyIsEnumerable; + var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O7) { + return O7.__proto__; + } : null); + function addNumericSeparator(num, str2) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str2)) { + return str2; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === "number") { + var int4 = num < 0 ? -$floor(-num) : $floor(num); + if (int4 !== num) { + var intStr = String(int4); + var dec = $slice.call(str2, intStr.length + 1); + return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); + } + } + return $replace.call(str2, sepRegex, "$&_"); + } + var utilInspect = empty; + var inspectCustom = utilInspect.custom; + var inspectSymbol = isSymbol3(inspectCustom) ? inspectCustom : null; + exports$83 = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + if (has2(opts, "quoteStyle") && opts.quoteStyle !== "single" && opts.quoteStyle !== "double") { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if (has2(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has2(opts, "customInspect") ? opts.customInspect : true; + if (typeof customInspect !== "boolean" && customInspect !== "symbol") { + throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); + } + if (has2(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has2(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + if (typeof obj === "boolean") { + return obj ? "true" : "false"; + } + if (typeof obj === "string") { + return inspectString(obj, opts); + } + if (typeof obj === "number") { + if (obj === 0) { + return Infinity / obj > 0 ? "0" : "-0"; + } + var str2 = String(obj); + return numericSeparator ? addNumericSeparator(obj, str2) : str2; + } + if (typeof obj === "bigint") { + var bigIntStr = String(obj) + "n"; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; + if (typeof depth === "undefined") { + depth = 0; + } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { + return isArray3(obj) ? "[Array]" : "[Object]"; + } + var indent = getIndent(opts, depth); + if (typeof seen === "undefined") { + seen = []; + } else if (indexOf4(seen, obj) >= 0) { + return "[Circular]"; + } + function inspect2(value2, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has2(opts, "quoteStyle")) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value2, newOpts, depth + 1, seen); + } + return inspect_(value2, opts, depth + 1, seen); + } + if (typeof obj === "function" && !isRegExp3(obj)) { + var name2 = nameOf(obj); + var keys2 = arrObjKeys(obj, inspect2); + return "[Function" + (name2 ? ": " + name2 : " (anonymous)") + "]" + (keys2.length > 0 ? " { " + $join.call(keys2, ", ") + " }" : ""); + } + if (isSymbol3(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); + return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement2(obj)) { + var s7 = "<" + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i7 = 0; i7 < attrs.length; i7++) { + s7 += " " + attrs[i7].name + "=" + wrapQuotes(quote(attrs[i7].value), "double", opts); + } + s7 += ">"; + if (obj.childNodes && obj.childNodes.length) { + s7 += "..."; + } + s7 += ""; + return s7; + } + if (isArray3(obj)) { + if (obj.length === 0) { + return "[]"; + } + var xs = arrObjKeys(obj, inspect2); + if (indent && !singleLineValues(xs)) { + return "[" + indentedJoin(xs, indent) + "]"; + } + return "[ " + $join.call(xs, ", ") + " ]"; + } + if (isError3(obj)) { + var parts = arrObjKeys(obj, inspect2); + if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { + return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }"; + } + if (parts.length === 0) { + return "[" + String(obj) + "]"; + } + return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; + } + if (typeof obj === "object" && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { + return utilInspect(obj, { + depth: maxDepth - depth + }); + } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { + return obj.inspect(); + } + } + if (isMap3(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function(value2, key) { + mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value2, obj)); + }); + } + return collectionOf("Map", mapSize.call(obj), mapParts, indent); + } + if (isSet2(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function(value2) { + setParts.push(inspect2(value2, obj)); + }); + } + return collectionOf("Set", setSize.call(obj), setParts, indent); + } + if (isWeakMap2(obj)) { + return weakCollectionOf("WeakMap"); + } + if (isWeakSet2(obj)) { + return weakCollectionOf("WeakSet"); + } + if (isWeakRef(obj)) { + return weakCollectionOf("WeakRef"); + } + if (isNumber3(obj)) { + return markBoxed(inspect2(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect2(bigIntValueOf.call(obj))); + } + if (isBoolean4(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString4(obj)) { + return markBoxed(inspect2(String(obj))); + } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (typeof globalThis !== "undefined" && obj === globalThis || typeof _global2 !== "undefined" && obj === _global2) { + return "{ [object globalThis] }"; + } + if (!isDate3(obj) && !isRegExp3(obj)) { + var ys = arrObjKeys(obj, inspect2); + var isPlainObject3 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? "" : "null prototype"; + var stringTag6 = !isPlainObject3 && toStringTag2 && Object(obj) === obj && toStringTag2 in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; + var constructorTag = isPlainObject3 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; + var tag = constructorTag + (stringTag6 || protoTag ? "[" + $join.call($concat.call([], stringTag6 || [], protoTag || []), ": ") + "] " : ""); + if (ys.length === 0) { + return tag + "{}"; + } + if (indent) { + return tag + "{" + indentedJoin(ys, indent) + "}"; + } + return tag + "{ " + $join.call(ys, ", ") + " }"; + } + return String(obj); + }; + function wrapQuotes(s7, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; + return quoteChar + s7 + quoteChar; + } + function quote(s7) { + return $replace.call(String(s7), /"/g, """); + } + function isArray3(obj) { + return toStr(obj) === "[object Array]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isDate3(obj) { + return toStr(obj) === "[object Date]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isRegExp3(obj) { + return toStr(obj) === "[object RegExp]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isError3(obj) { + return toStr(obj) === "[object Error]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isString4(obj) { + return toStr(obj) === "[object String]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isNumber3(obj) { + return toStr(obj) === "[object Number]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isBoolean4(obj) { + return toStr(obj) === "[object Boolean]" && (!toStringTag2 || !(typeof obj === "object" && toStringTag2 in obj)); + } + function isSymbol3(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === "object" && obj instanceof Symbol; + } + if (typeof obj === "symbol") { + return true; + } + if (!obj || typeof obj !== "object" || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e10) { + } + return false; + } + function isBigInt(obj) { + if (!obj || typeof obj !== "object" || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e10) { + } + return false; + } + var hasOwn = Object.prototype.hasOwnProperty || function(key) { + return key in (this || _global2); + }; + function has2(obj, key) { + return hasOwn.call(obj, key); + } + function toStr(obj) { + return objectToString2.call(obj); + } + function nameOf(f8) { + if (f8.name) { + return f8.name; + } + var m7 = $match.call(functionToString.call(f8), /^function\s*([\w$]+)/); + if (m7) { + return m7[1]; + } + return null; + } + function indexOf4(xs, x7) { + if (xs.indexOf) { + return xs.indexOf(x7); + } + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) { + return i7; + } + } + return -1; + } + function isMap3(x7) { + if (!mapSize || !x7 || typeof x7 !== "object") { + return false; + } + try { + mapSize.call(x7); + try { + setSize.call(x7); + } catch (s7) { + return true; + } + return x7 instanceof Map; + } catch (e10) { + } + return false; + } + function isWeakMap2(x7) { + if (!weakMapHas || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakMapHas.call(x7, weakMapHas); + try { + weakSetHas.call(x7, weakSetHas); + } catch (s7) { + return true; + } + return x7 instanceof WeakMap; + } catch (e10) { + } + return false; + } + function isWeakRef(x7) { + if (!weakRefDeref || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakRefDeref.call(x7); + return true; + } catch (e10) { + } + return false; + } + function isSet2(x7) { + if (!setSize || !x7 || typeof x7 !== "object") { + return false; + } + try { + setSize.call(x7); + try { + mapSize.call(x7); + } catch (m7) { + return true; + } + return x7 instanceof Set; + } catch (e10) { + } + return false; + } + function isWeakSet2(x7) { + if (!weakSetHas || !x7 || typeof x7 !== "object") { + return false; + } + try { + weakSetHas.call(x7, weakSetHas); + try { + weakMapHas.call(x7, weakMapHas); + } catch (s7) { + return true; + } + return x7 instanceof WeakSet; + } catch (e10) { + } + return false; + } + function isElement2(x7) { + if (!x7 || typeof x7 !== "object") { + return false; + } + if (typeof HTMLElement !== "undefined" && x7 instanceof HTMLElement) { + return true; + } + return typeof x7.nodeName === "string" && typeof x7.getAttribute === "function"; + } + function inspectString(str2, opts) { + if (str2.length > opts.maxStringLength) { + var remaining = str2.length - opts.maxStringLength; + var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); + return inspectString($slice.call(str2, 0, opts.maxStringLength), opts) + trailer; + } + var s7 = $replace.call($replace.call(str2, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s7, "single", opts); + } + function lowbyte(c7) { + var n7 = c7.charCodeAt(0); + var x7 = { + 8: "b", + 9: "t", + 10: "n", + 12: "f", + 13: "r" + }[n7]; + if (x7) { + return "\\" + x7; + } + return "\\x" + (n7 < 16 ? "0" : "") + $toUpperCase.call(n7.toString(16)); + } + function markBoxed(str2) { + return "Object(" + str2 + ")"; + } + function weakCollectionOf(type3) { + return type3 + " { ? }"; + } + function collectionOf(type3, size2, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", "); + return type3 + " (" + size2 + ") {" + joinedEntries + "}"; + } + function singleLineValues(xs) { + for (var i7 = 0; i7 < xs.length; i7++) { + if (indexOf4(xs[i7], "\n") >= 0) { + return false; + } + } + return true; + } + function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === " ") { + baseIndent = " "; + } else if (typeof opts.indent === "number" && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), " "); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; + } + function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ""; + } + var lineJoiner = "\n" + indent.prev + indent.base; + return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; + } + function arrObjKeys(obj, inspect2) { + var isArr = isArray3(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i7 = 0; i7 < obj.length; i7++) { + xs[i7] = has2(obj, i7) ? inspect2(obj[i7], obj) : ""; + } + } + var syms = typeof gOPS === "function" ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k6 = 0; k6 < syms.length; k6++) { + symMap["$" + syms[k6]] = syms[k6]; + } + } + for (var key in obj) { + if (!has2(obj, key)) { + continue; + } + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj)); + } else { + xs.push(key + ": " + inspect2(obj[key], obj)); + } + } + if (typeof gOPS === "function") { + for (var j6 = 0; j6 < syms.length; j6++) { + if (isEnumerable.call(obj, syms[j6])) { + xs.push("[" + inspect2(syms[j6]) + "]: " + inspect2(obj[syms[j6]], obj)); + } + } + } + return xs; + } + return exports$83; +} +function dew$63() { + if (_dewExec$63) + return exports$73; + _dewExec$63 = true; + var GetIntrinsic = dew$7(); + var callBound = dew3(); + var inspect2 = dew$73(); + var $TypeError = dew$e(); + var $WeakMap = GetIntrinsic("%WeakMap%", true); + var $Map = GetIntrinsic("%Map%", true); + var $weakMapGet = callBound("WeakMap.prototype.get", true); + var $weakMapSet = callBound("WeakMap.prototype.set", true); + var $weakMapHas = callBound("WeakMap.prototype.has", true); + var $mapGet = callBound("Map.prototype.get", true); + var $mapSet = callBound("Map.prototype.set", true); + var $mapHas = callBound("Map.prototype.has", true); + var listGetNode = function(list, key) { + var prev = list; + var curr; + for (; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = /** @type {NonNullable} */ + list.next; + list.next = curr; + return curr; + } + } + }; + var listGet = function(objects, key) { + var node = listGetNode(objects, key); + return node && node.value; + }; + var listSet = function(objects, key, value2) { + var node = listGetNode(objects, key); + if (node) { + node.value = value2; + } else { + objects.next = /** @type {import('.').ListNode} */ + { + // eslint-disable-line no-param-reassign, no-extra-parens + key, + next: objects.next, + value: value2 + }; + } + }; + var listHas = function(objects, key) { + return !!listGetNode(objects, key); + }; + exports$73 = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function(key) { + if (!channel.has(key)) { + throw new $TypeError("Side channel does not contain " + inspect2(key)); + } + }, + get: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { + return listGet($o, key); + } + } + }, + has: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { + return listHas($o, key); + } + } + return false; + }, + set: function(key, value2) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value2); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value2); + } else { + if (!$o) { + $o = { + key: {}, + next: null + }; + } + listSet($o, key, value2); + } + } + }; + return channel; + }; + return exports$73; +} +function dew$53() { + if (_dewExec$53) + return exports$63; + _dewExec$53 = true; + var replace3 = String.prototype.replace; + var percentTwenties = /%20/g; + var Format = { + RFC1738: "RFC1738", + RFC3986: "RFC3986" + }; + exports$63 = { + "default": Format.RFC3986, + formatters: { + RFC1738: function(value2) { + return replace3.call(value2, percentTwenties, "+"); + }, + RFC3986: function(value2) { + return String(value2); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 + }; + return exports$63; +} +function dew$43() { + if (_dewExec$43) + return exports$53; + _dewExec$43 = true; + var formats = dew$53(); + var has2 = Object.prototype.hasOwnProperty; + var isArray3 = Array.isArray; + var hexTable = function() { + var array = []; + for (var i7 = 0; i7 < 256; ++i7) { + array.push("%" + ((i7 < 16 ? "0" : "") + i7.toString(16)).toUpperCase()); + } + return array; + }(); + var compactQueue = function compactQueue2(queue3) { + while (queue3.length > 1) { + var item = queue3.pop(); + var obj = item.obj[item.prop]; + if (isArray3(obj)) { + var compacted = []; + for (var j6 = 0; j6 < obj.length; ++j6) { + if (typeof obj[j6] !== "undefined") { + compacted.push(obj[j6]); + } + } + item.obj[item.prop] = compacted; + } + } + }; + var arrayToObject = function arrayToObject2(source, options) { + var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + for (var i7 = 0; i7 < source.length; ++i7) { + if (typeof source[i7] !== "undefined") { + obj[i7] = source[i7]; + } + } + return obj; + }; + var merge7 = function merge8(target, source, options) { + if (!source) { + return target; + } + if (typeof source !== "object") { + if (isArray3(target)) { + target.push(source); + } else if (target && typeof target === "object") { + if (options && (options.plainObjects || options.allowPrototypes) || !has2.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + return target; + } + if (!target || typeof target !== "object") { + return [target].concat(source); + } + var mergeTarget = target; + if (isArray3(target) && !isArray3(source)) { + mergeTarget = arrayToObject(target, options); + } + if (isArray3(target) && isArray3(source)) { + source.forEach(function(item, i7) { + if (has2.call(target, i7)) { + var targetItem = target[i7]; + if (targetItem && typeof targetItem === "object" && item && typeof item === "object") { + target[i7] = merge8(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i7] = item; + } + }); + return target; + } + return Object.keys(source).reduce(function(acc, key) { + var value2 = source[key]; + if (has2.call(acc, key)) { + acc[key] = merge8(acc[key], value2, options); + } else { + acc[key] = value2; + } + return acc; + }, mergeTarget); + }; + var assign3 = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function(acc, key) { + acc[key] = source[key]; + return acc; + }, target); + }; + var decode2 = function(str2, decoder, charset) { + var strWithoutPlus = str2.replace(/\+/g, " "); + if (charset === "iso-8859-1") { + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + try { + return decodeURIComponent(strWithoutPlus); + } catch (e10) { + return strWithoutPlus; + } + }; + var limit = 1024; + var encode2 = function encode3(str2, defaultEncoder, charset, kind, format5) { + if (str2.length === 0) { + return str2; + } + var string2 = str2; + if (typeof str2 === "symbol") { + string2 = Symbol.prototype.toString.call(str2); + } else if (typeof str2 !== "string") { + string2 = String(str2); + } + if (charset === "iso-8859-1") { + return escape(string2).replace(/%u[0-9a-f]{4}/gi, function($0) { + return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; + }); + } + var out = ""; + for (var j6 = 0; j6 < string2.length; j6 += limit) { + var segment = string2.length >= limit ? string2.slice(j6, j6 + limit) : string2; + var arr = []; + for (var i7 = 0; i7 < segment.length; ++i7) { + var c7 = segment.charCodeAt(i7); + if (c7 === 45 || c7 === 46 || c7 === 95 || c7 === 126 || c7 >= 48 && c7 <= 57 || c7 >= 65 && c7 <= 90 || c7 >= 97 && c7 <= 122 || format5 === formats.RFC1738 && (c7 === 40 || c7 === 41)) { + arr[arr.length] = segment.charAt(i7); + continue; + } + if (c7 < 128) { + arr[arr.length] = hexTable[c7]; + continue; + } + if (c7 < 2048) { + arr[arr.length] = hexTable[192 | c7 >> 6] + hexTable[128 | c7 & 63]; + continue; + } + if (c7 < 55296 || c7 >= 57344) { + arr[arr.length] = hexTable[224 | c7 >> 12] + hexTable[128 | c7 >> 6 & 63] + hexTable[128 | c7 & 63]; + continue; + } + i7 += 1; + c7 = 65536 + ((c7 & 1023) << 10 | segment.charCodeAt(i7) & 1023); + arr[arr.length] = hexTable[240 | c7 >> 18] + hexTable[128 | c7 >> 12 & 63] + hexTable[128 | c7 >> 6 & 63] + hexTable[128 | c7 & 63]; + } + out += arr.join(""); + } + return out; + }; + var compact2 = function compact3(value2) { + var queue3 = [{ + obj: { + o: value2 + }, + prop: "o" + }]; + var refs = []; + for (var i7 = 0; i7 < queue3.length; ++i7) { + var item = queue3[i7]; + var obj = item.obj[item.prop]; + var keys2 = Object.keys(obj); + for (var j6 = 0; j6 < keys2.length; ++j6) { + var key = keys2[j6]; + var val = obj[key]; + if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) { + queue3.push({ + obj, + prop: key + }); + refs.push(val); + } + } + } + compactQueue(queue3); + return value2; + }; + var isRegExp3 = function isRegExp4(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; + }; + var isBuffer3 = function isBuffer4(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + }; + var combine = function combine2(a7, b8) { + return [].concat(a7, b8); + }; + var maybeMap = function maybeMap2(val, fn) { + if (isArray3(val)) { + var mapped = []; + for (var i7 = 0; i7 < val.length; i7 += 1) { + mapped.push(fn(val[i7])); + } + return mapped; + } + return fn(val); + }; + exports$53 = { + arrayToObject, + assign: assign3, + combine, + compact: compact2, + decode: decode2, + encode: encode2, + isBuffer: isBuffer3, + isRegExp: isRegExp3, + maybeMap, + merge: merge7 + }; + return exports$53; +} +function dew$33() { + if (_dewExec$33) + return exports$43; + _dewExec$33 = true; + var getSideChannel = dew$63(); + var utils = dew$43(); + var formats = dew$53(); + var has2 = Object.prototype.hasOwnProperty; + var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + "[]"; + }, + comma: "comma", + indices: function indices(prefix, key) { + return prefix + "[" + key + "]"; + }, + repeat: function repeat3(prefix) { + return prefix; + } + }; + var isArray3 = Array.isArray; + var push4 = Array.prototype.push; + var pushToArray = function(arr, valueOrArray) { + push4.apply(arr, isArray3(valueOrArray) ? valueOrArray : [valueOrArray]); + }; + var toISO = Date.prototype.toISOString; + var defaultFormat = formats["default"]; + var defaults2 = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", + charset: "utf-8", + charsetSentinel: false, + delimiter: "&", + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false + }; + var isNonNullishPrimitive = function isNonNullishPrimitive2(v8) { + return typeof v8 === "string" || typeof v8 === "number" || typeof v8 === "boolean" || typeof v8 === "symbol" || typeof v8 === "bigint"; + }; + var sentinel = {}; + var stringify5 = function stringify6(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format5, formatter, encodeValuesOnly, charset, sideChannel) { + var obj = object; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) { + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== "undefined") { + if (pos === step) { + throw new RangeError("Cyclic object value"); + } else { + findFlag = true; + } + } + if (typeof tmpSc.get(sentinel) === "undefined") { + step = 0; + } + } + if (typeof filter2 === "function") { + obj = filter2(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === "comma" && isArray3(obj)) { + obj = utils.maybeMap(obj, function(value3) { + if (value3 instanceof Date) { + return serializeDate(value3); + } + return value3; + }); + } + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults2.encoder, charset, "key", format5) : prefix; + } + obj = ""; + } + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format5); + return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format5))]; + } + return [formatter(prefix) + "=" + formatter(String(obj))]; + } + var values2 = []; + if (typeof obj === "undefined") { + return values2; + } + var objKeys; + if (generateArrayPrefix === "comma" && isArray3(obj)) { + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ + value: obj.length > 0 ? obj.join(",") || null : void 0 + }]; + } else if (isArray3(filter2)) { + objKeys = filter2; + } else { + var keys2 = Object.keys(obj); + objKeys = sort ? keys2.sort(sort) : keys2; + } + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix; + var adjustedPrefix = commaRoundTrip && isArray3(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix; + if (allowEmptyArrays && isArray3(obj) && obj.length === 0) { + return adjustedPrefix + "[]"; + } + for (var j6 = 0; j6 < objKeys.length; ++j6) { + var key = objKeys[j6]; + var value2 = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]; + if (skipNulls && value2 === null) { + continue; + } + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + var keyPrefix = isArray3(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values2, stringify6(value2, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray3(obj) ? null : encoder, filter2, sort, allowDots, serializeDate, format5, formatter, encodeValuesOnly, charset, valueSideChannel)); + } + return values2; + }; + var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + var charset = opts.charset || defaults2.charset; + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var format5 = formats["default"]; + if (typeof opts.format !== "undefined") { + if (!has2.call(formats.formatters, opts.format)) { + throw new TypeError("Unknown format option provided."); + } + format5 = opts.format; + } + var formatter = formats.formatters[format5]; + var filter2 = defaults2.filter; + if (typeof opts.filter === "function" || isArray3(opts.filter)) { + filter2 = opts.filter; + } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults2.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + arrayFormat, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, + delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, + filter: filter2, + format: format5, + formatter, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, + sort: typeof opts.sort === "function" ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; + }; + exports$43 = function(object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + var objKeys; + var filter2; + if (typeof options.filter === "function") { + filter2 = options.filter; + obj = filter2("", obj); + } else if (isArray3(options.filter)) { + filter2 = options.filter; + objKeys = filter2; + } + var keys2 = []; + if (typeof obj !== "object" || obj === null) { + return ""; + } + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; + if (!objKeys) { + objKeys = Object.keys(obj); + } + if (options.sort) { + objKeys.sort(options.sort); + } + var sideChannel = getSideChannel(); + for (var i7 = 0; i7 < objKeys.length; ++i7) { + var key = objKeys[i7]; + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys2, stringify5(obj[key], key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel)); + } + var joined = keys2.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? "?" : ""; + if (options.charsetSentinel) { + if (options.charset === "iso-8859-1") { + prefix += "utf8=%26%2310003%3B&"; + } else { + prefix += "utf8=%E2%9C%93&"; + } + } + return joined.length > 0 ? prefix + joined : ""; + }; + return exports$43; +} +function dew$24() { + if (_dewExec$24) + return exports$33; + _dewExec$24 = true; + var utils = dew$43(); + var has2 = Object.prototype.hasOwnProperty; + var isArray3 = Array.isArray; + var defaults2 = { + allowDots: false, + allowEmptyArrays: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: "utf-8", + charsetSentinel: false, + comma: false, + decodeDotInKeys: false, + decoder: utils.decode, + delimiter: "&", + depth: 5, + duplicates: "combine", + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1e3, + parseArrays: true, + plainObjects: false, + strictDepth: false, + strictNullHandling: false + }; + var interpretNumericEntities = function(str2) { + return str2.replace(/&#(\d+);/g, function($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); + }; + var parseArrayValue = function(val, options) { + if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) { + return val.split(","); + } + return val; + }; + var isoSentinel = "utf8=%26%2310003%3B"; + var charsetSentinel = "utf8=%E2%9C%93"; + var parseValues = function parseQueryStringValues(str2, options) { + var obj = { + __proto__: null + }; + var cleanStr = options.ignoreQueryPrefix ? str2.replace(/^\?/, "") : str2; + cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); + var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; + var i7; + var charset = options.charset; + if (options.charsetSentinel) { + for (i7 = 0; i7 < parts.length; ++i7) { + if (parts[i7].indexOf("utf8=") === 0) { + if (parts[i7] === charsetSentinel) { + charset = "utf-8"; + } else if (parts[i7] === isoSentinel) { + charset = "iso-8859-1"; + } + skipIndex = i7; + i7 = parts.length; + } + } + } + for (i7 = 0; i7 < parts.length; ++i7) { + if (i7 === skipIndex) { + continue; + } + var part = parts[i7]; + var bracketEqualsPos = part.indexOf("]="); + var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1; + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults2.decoder, charset, "key"); + val = options.strictNullHandling ? null : ""; + } else { + key = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key"); + val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options), function(encodedVal) { + return options.decoder(encodedVal, defaults2.decoder, charset, "value"); + }); + } + if (val && options.interpretNumericEntities && charset === "iso-8859-1") { + val = interpretNumericEntities(val); + } + if (part.indexOf("[]=") > -1) { + val = isArray3(val) ? [val] : val; + } + var existing = has2.call(obj, key); + if (existing && options.duplicates === "combine") { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === "last") { + obj[key] = val; + } + } + return obj; + }; + var parseObject = function(chain3, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + for (var i7 = chain3.length - 1; i7 >= 0; --i7) { + var obj; + var root2 = chain3[i7]; + if (root2 === "[]" && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf); + } else { + obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var cleanRoot = root2.charAt(0) === "[" && root2.charAt(root2.length - 1) === "]" ? root2.slice(1, -1) : root2; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot; + var index4 = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === "") { + obj = { + 0: leaf + }; + } else if (!isNaN(index4) && root2 !== decodedRoot && String(index4) === decodedRoot && index4 >= 0 && options.parseArrays && index4 <= options.arrayLimit) { + obj = []; + obj[index4] = leaf; + } else if (decodedRoot !== "__proto__") { + obj[decodedRoot] = leaf; + } + } + leaf = obj; + } + return leaf; + }; + var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = options.depth > 0 && brackets.exec(key); + var parent2 = segment ? key.slice(0, segment.index) : key; + var keys2 = []; + if (parent2) { + if (!options.plainObjects && has2.call(Object.prototype, parent2)) { + if (!options.allowPrototypes) { + return; + } + } + keys2.push(parent2); + } + var i7 = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i7 < options.depth) { + i7 += 1; + if (!options.plainObjects && has2.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys2.push(segment[1]); + } + if (segment) { + if (options.strictDepth === true) { + throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true"); + } + keys2.push("[" + key.slice(segment.index) + "]"); + } + return parseObject(keys2, val, options, valuesParsed); + }; + var normalizeParseOptions = function normalizeParseOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") { + throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") { + throw new TypeError("Decoder has to be a function."); + } + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset; + var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates; + if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") { + throw new TypeError("The duplicates option must be either combine, first, or last"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes, + allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse, + arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys, + decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder, + delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth, + duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects, + strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; + }; + exports$33 = function(str2, opts) { + var options = normalizeParseOptions(opts); + if (str2 === "" || str2 === null || typeof str2 === "undefined") { + return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + } + var tempObj = typeof str2 === "string" ? parseValues(str2, options) : str2; + var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var keys2 = Object.keys(tempObj); + for (var i7 = 0; i7 < keys2.length; ++i7) { + var key = keys2[i7]; + var newObj = parseKeys(key, tempObj[key], options, typeof str2 === "string"); + obj = utils.merge(obj, newObj, options); + } + if (options.allowSparse === true) { + return obj; + } + return utils.compact(obj); + }; + return exports$33; +} +function dew$14() { + if (_dewExec$14) + return exports$24; + _dewExec$14 = true; + var stringify5 = dew$33(); + var parse17 = dew$24(); + var formats = dew$53(); + exports$24 = { + formats, + parse: parse17, + stringify: stringify5 + }; + return exports$24; +} +function dew7() { + if (_dewExec7) + return exports$16; + _dewExec7 = true; + var punycode = exports9; + function Url2() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; + } + var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, delims = ["<", ">", '"', "`", " ", "\r", "\n", " "], unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims), autoEscape = ["'"].concat(unwise), nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape), hostEndingChars = ["/", "?", "#"], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, unsafeProtocol = { + javascript: true, + "javascript:": true + }, hostlessProtocol = { + javascript: true, + "javascript:": true + }, slashedProtocol = { + http: true, + https: true, + ftp: true, + gopher: true, + file: true, + "http:": true, + "https:": true, + "ftp:": true, + "gopher:": true, + "file:": true + }, querystring = dew$14(); + function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && typeof url === "object" && url instanceof Url2) { + return url; + } + var u7 = new Url2(); + u7.parse(url, parseQueryString, slashesDenoteHost); + return u7; + } + Url2.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (typeof url !== "string") { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + var queryIndex = url.indexOf("?"), splitter = queryIndex !== -1 && queryIndex < url.indexOf("#") ? "?" : "#", uSplit = url.split(splitter), slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, "/"); + url = uSplit.join(splitter); + var rest2 = url; + rest2 = rest2.trim(); + if (!slashesDenoteHost && url.split("#").length === 1) { + var simplePath = simplePathPattern.exec(rest2); + if (simplePath) { + this.path = rest2; + this.href = rest2; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ""; + this.query = {}; + } + return this; + } + } + var proto = protocolPattern.exec(rest2); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest2 = rest2.substr(proto.length); + } + if (slashesDenoteHost || proto || rest2.match(/^\/\/[^@/]+@[^@/]+/)) { + var slashes = rest2.substr(0, 2) === "//"; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest2 = rest2.substr(2); + this.slashes = true; + } + } + if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { + var hostEnd = -1; + for (var i7 = 0; i7 < hostEndingChars.length; i7++) { + var hec = rest2.indexOf(hostEndingChars[i7]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + var auth, atSign; + if (hostEnd === -1) { + atSign = rest2.lastIndexOf("@"); + } else { + atSign = rest2.lastIndexOf("@", hostEnd); + } + if (atSign !== -1) { + auth = rest2.slice(0, atSign); + rest2 = rest2.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + hostEnd = -1; + for (var i7 = 0; i7 < nonHostChars.length; i7++) { + var hec = rest2.indexOf(nonHostChars[i7]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + if (hostEnd === -1) { + hostEnd = rest2.length; + } + this.host = rest2.slice(0, hostEnd); + rest2 = rest2.slice(hostEnd); + this.parseHost(); + this.hostname = this.hostname || ""; + var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]"; + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i7 = 0, l7 = hostparts.length; i7 < l7; i7++) { + var part = hostparts[i7]; + if (!part) { + continue; + } + if (!part.match(hostnamePartPattern)) { + var newpart = ""; + for (var j6 = 0, k6 = part.length; j6 < k6; j6++) { + if (part.charCodeAt(j6) > 127) { + newpart += "x"; + } else { + newpart += part[j6]; + } + } + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i7); + var notHost = hostparts.slice(i7 + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest2 = "/" + notHost.join(".") + rest2; + } + this.hostname = validParts.join("."); + break; + } + } + } + } + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ""; + } else { + this.hostname = this.hostname.toLowerCase(); + } + if (!ipv6Hostname) { + this.hostname = punycode.toASCII(this.hostname); + } + var p7 = this.port ? ":" + this.port : ""; + var h8 = this.hostname || ""; + this.host = h8 + p7; + this.href += this.host; + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest2[0] !== "/") { + rest2 = "/" + rest2; + } + } + } + if (!unsafeProtocol[lowerProto]) { + for (var i7 = 0, l7 = autoEscape.length; i7 < l7; i7++) { + var ae4 = autoEscape[i7]; + if (rest2.indexOf(ae4) === -1) { + continue; + } + var esc = encodeURIComponent(ae4); + if (esc === ae4) { + esc = escape(ae4); + } + rest2 = rest2.split(ae4).join(esc); + } + } + var hash = rest2.indexOf("#"); + if (hash !== -1) { + this.hash = rest2.substr(hash); + rest2 = rest2.slice(0, hash); + } + var qm = rest2.indexOf("?"); + if (qm !== -1) { + this.search = rest2.substr(qm); + this.query = rest2.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest2 = rest2.slice(0, qm); + } else if (parseQueryString) { + this.search = ""; + this.query = {}; + } + if (rest2) { + this.pathname = rest2; + } + if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { + this.pathname = "/"; + } + if (this.pathname || this.search) { + var p7 = this.pathname || ""; + var s7 = this.search || ""; + this.path = p7 + s7; + } + this.href = this.format(); + return this; + }; + function urlFormat(obj) { + if (typeof obj === "string") { + obj = urlParse(obj); + } + if (!(obj instanceof Url2)) { + return Url2.prototype.format.call(obj); + } + return obj.format(); + } + Url2.prototype.format = function() { + var auth = this.auth || ""; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ":"); + auth += "@"; + } + var protocol = this.protocol || "", pathname = this.pathname || "", hash = this.hash || "", host = false, query = ""; + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"); + if (this.port) { + host += ":" + this.port; + } + } + if (this.query && typeof this.query === "object" && Object.keys(this.query).length) { + query = querystring.stringify(this.query, { + arrayFormat: "repeat", + addQueryPrefix: false + }); + } + var search = this.search || query && "?" + query || ""; + if (protocol && protocol.substr(-1) !== ":") { + protocol += ":"; + } + if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { + host = "//" + (host || ""); + if (pathname && pathname.charAt(0) !== "/") { + pathname = "/" + pathname; + } + } else if (!host) { + host = ""; + } + if (hash && hash.charAt(0) !== "#") { + hash = "#" + hash; + } + if (search && search.charAt(0) !== "?") { + search = "?" + search; + } + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace("#", "%23"); + return protocol + host + pathname + search + hash; + }; + function urlResolve(source, relative2) { + return urlParse(source, false, true).resolve(relative2); + } + Url2.prototype.resolve = function(relative2) { + return this.resolveObject(urlParse(relative2, false, true)).format(); + }; + function urlResolveObject(source, relative2) { + if (!source) { + return relative2; + } + return urlParse(source, false, true).resolveObject(relative2); + } + Url2.prototype.resolveObject = function(relative2) { + if (typeof relative2 === "string") { + var rel = new Url2(); + rel.parse(relative2, false, true); + relative2 = rel; + } + var result2 = new Url2(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result2[tkey] = this[tkey]; + } + result2.hash = relative2.hash; + if (relative2.href === "") { + result2.href = result2.format(); + return result2; + } + if (relative2.slashes && !relative2.protocol) { + var rkeys = Object.keys(relative2); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== "protocol") { + result2[rkey] = relative2[rkey]; + } + } + if (slashedProtocol[result2.protocol] && result2.hostname && !result2.pathname) { + result2.pathname = "/"; + result2.path = result2.pathname; + } + result2.href = result2.format(); + return result2; + } + if (relative2.protocol && relative2.protocol !== result2.protocol) { + if (!slashedProtocol[relative2.protocol]) { + var keys2 = Object.keys(relative2); + for (var v8 = 0; v8 < keys2.length; v8++) { + var k6 = keys2[v8]; + result2[k6] = relative2[k6]; + } + result2.href = result2.format(); + return result2; + } + result2.protocol = relative2.protocol; + if (!relative2.host && !hostlessProtocol[relative2.protocol]) { + var relPath = (relative2.pathname || "").split("/"); + while (relPath.length && !(relative2.host = relPath.shift())) { + } + if (!relative2.host) { + relative2.host = ""; + } + if (!relative2.hostname) { + relative2.hostname = ""; + } + if (relPath[0] !== "") { + relPath.unshift(""); + } + if (relPath.length < 2) { + relPath.unshift(""); + } + result2.pathname = relPath.join("/"); + } else { + result2.pathname = relative2.pathname; + } + result2.search = relative2.search; + result2.query = relative2.query; + result2.host = relative2.host || ""; + result2.auth = relative2.auth; + result2.hostname = relative2.hostname || relative2.host; + result2.port = relative2.port; + if (result2.pathname || result2.search) { + var p7 = result2.pathname || ""; + var s7 = result2.search || ""; + result2.path = p7 + s7; + } + result2.slashes = result2.slashes || relative2.slashes; + result2.href = result2.format(); + return result2; + } + var isSourceAbs = result2.pathname && result2.pathname.charAt(0) === "/", isRelAbs = relative2.host || relative2.pathname && relative2.pathname.charAt(0) === "/", mustEndAbs = isRelAbs || isSourceAbs || result2.host && relative2.pathname, removeAllDots = mustEndAbs, srcPath = result2.pathname && result2.pathname.split("/") || [], relPath = relative2.pathname && relative2.pathname.split("/") || [], psychotic = result2.protocol && !slashedProtocol[result2.protocol]; + if (psychotic) { + result2.hostname = ""; + result2.port = null; + if (result2.host) { + if (srcPath[0] === "") { + srcPath[0] = result2.host; + } else { + srcPath.unshift(result2.host); + } + } + result2.host = ""; + if (relative2.protocol) { + relative2.hostname = null; + relative2.port = null; + if (relative2.host) { + if (relPath[0] === "") { + relPath[0] = relative2.host; + } else { + relPath.unshift(relative2.host); + } + } + relative2.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === ""); + } + if (isRelAbs) { + result2.host = relative2.host || relative2.host === "" ? relative2.host : result2.host; + result2.hostname = relative2.hostname || relative2.hostname === "" ? relative2.hostname : result2.hostname; + result2.search = relative2.search; + result2.query = relative2.query; + srcPath = relPath; + } else if (relPath.length) { + if (!srcPath) { + srcPath = []; + } + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result2.search = relative2.search; + result2.query = relative2.query; + } else if (relative2.search != null) { + if (psychotic) { + result2.host = srcPath.shift(); + result2.hostname = result2.host; + var authInHost = result2.host && result2.host.indexOf("@") > 0 ? result2.host.split("@") : false; + if (authInHost) { + result2.auth = authInHost.shift(); + result2.hostname = authInHost.shift(); + result2.host = result2.hostname; + } + } + result2.search = relative2.search; + result2.query = relative2.query; + if (result2.pathname !== null || result2.search !== null) { + result2.path = (result2.pathname ? result2.pathname : "") + (result2.search ? result2.search : ""); + } + result2.href = result2.format(); + return result2; + } + if (!srcPath.length) { + result2.pathname = null; + if (result2.search) { + result2.path = "/" + result2.search; + } else { + result2.path = null; + } + result2.href = result2.format(); + return result2; + } + var last2 = srcPath.slice(-1)[0]; + var hasTrailingSlash = (result2.host || relative2.host || srcPath.length > 1) && (last2 === "." || last2 === "..") || last2 === ""; + var up = 0; + for (var i7 = srcPath.length; i7 >= 0; i7--) { + last2 = srcPath[i7]; + if (last2 === ".") { + srcPath.splice(i7, 1); + } else if (last2 === "..") { + srcPath.splice(i7, 1); + up++; + } else if (up) { + srcPath.splice(i7, 1); + up--; + } + } + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift(".."); + } + } + if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) { + srcPath.unshift(""); + } + if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") { + srcPath.push(""); + } + var isAbsolute2 = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/"; + if (psychotic) { + result2.hostname = isAbsolute2 ? "" : srcPath.length ? srcPath.shift() : ""; + result2.host = result2.hostname; + var authInHost = result2.host && result2.host.indexOf("@") > 0 ? result2.host.split("@") : false; + if (authInHost) { + result2.auth = authInHost.shift(); + result2.hostname = authInHost.shift(); + result2.host = result2.hostname; + } + } + mustEndAbs = mustEndAbs || result2.host && srcPath.length; + if (mustEndAbs && !isAbsolute2) { + srcPath.unshift(""); + } + if (srcPath.length > 0) { + result2.pathname = srcPath.join("/"); + } else { + result2.pathname = null; + result2.path = null; + } + if (result2.pathname !== null || result2.search !== null) { + result2.path = (result2.pathname ? result2.pathname : "") + (result2.search ? result2.search : ""); + } + result2.auth = relative2.auth || result2.auth; + result2.slashes = result2.slashes || relative2.slashes; + result2.href = result2.format(); + return result2; + }; + Url2.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ":") { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) { + this.hostname = host; + } + }; + exports$16.parse = urlParse; + exports$16.resolve = urlResolve; + exports$16.resolveObject = urlResolveObject; + exports$16.format = urlFormat; + exports$16.Url = Url2; + return exports$16; +} +function fileURLToPath(path2) { + if (typeof path2 === "string") + path2 = new URL(path2); + else if (!(path2 instanceof URL)) { + throw new Deno.errors.InvalidData( + "invalid argument path , must be a string or URL" + ); + } + if (path2.protocol !== "file:") { + throw new Deno.errors.InvalidData("invalid url scheme"); + } + return isWindows ? getPathFromURLWin(path2) : getPathFromURLPosix(path2); +} +function getPathFromURLWin(url) { + const hostname2 = url.hostname; + let pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102 || // 2f 2F / + pathname[n7 + 1] === "5" && third === 99) { + throw new Deno.errors.InvalidData( + "must not include encoded \\ or / characters" + ); + } + } + } + pathname = pathname.replace(forwardSlashRegEx, "\\"); + pathname = decodeURIComponent(pathname); + if (hostname2 !== "") { + return `\\\\${hostname2}${pathname}`; + } else { + const letter = pathname.codePointAt(1) | 32; + const sep2 = pathname[2]; + if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || // a..z A..Z + sep2 !== ":") { + throw new Deno.errors.InvalidData("file url path must be absolute"); + } + return pathname.slice(1); + } +} +function getPathFromURLPosix(url) { + if (url.hostname !== "") { + throw new Deno.errors.InvalidData("invalid file url hostname"); + } + const pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102) { + throw new Deno.errors.InvalidData( + "must not include encoded / characters" + ); + } + } + } + return decodeURIComponent(pathname); +} +function pathToFileURL(filepath) { + let resolved = exports5.resolve(filepath); + const filePathLast = filepath.charCodeAt(filepath.length - 1); + if ((filePathLast === CHAR_FORWARD_SLASH || isWindows && filePathLast === CHAR_BACKWARD_SLASH) && resolved[resolved.length - 1] !== exports5.sep) { + resolved += "/"; + } + const outURL = new URL("file://"); + if (resolved.includes("%")) + resolved = resolved.replace(percentRegEx, "%25"); + if (!isWindows && resolved.includes("\\")) { + resolved = resolved.replace(backslashRegEx, "%5C"); + } + if (resolved.includes("\n")) + resolved = resolved.replace(newlineRegEx, "%0A"); + if (resolved.includes("\r")) { + resolved = resolved.replace(carriageReturnRegEx, "%0D"); + } + if (resolved.includes(" ")) + resolved = resolved.replace(tabRegEx, "%09"); + outURL.pathname = resolved; + return outURL; +} +var empty, exports$83, _dewExec$73, _global2, exports$73, _dewExec$63, exports$63, _dewExec$53, exports$53, _dewExec$43, exports$43, _dewExec$33, exports$33, _dewExec$24, exports$24, _dewExec$14, exports$16, _dewExec7, exports10, processPlatform, Url, format4, resolve2, resolveObject, parse7, _URL, CHAR_BACKWARD_SLASH, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, isWindows, forwardSlashRegEx, percentRegEx, backslashRegEx, newlineRegEx, carriageReturnRegEx, tabRegEx; +var init_url = __esm({ + "node_modules/@jspm/core/nodelibs/browser/url.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_punycode(); + init_chunk_DtcTpLWz(); + init_chunk_BlJi4mNy(); + init_chunk_DEMDiNwt(); + empty = Object.freeze(/* @__PURE__ */ Object.create(null)); + exports$83 = {}; + _dewExec$73 = false; + _global2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$73 = {}; + _dewExec$63 = false; + exports$63 = {}; + _dewExec$53 = false; + exports$53 = {}; + _dewExec$43 = false; + exports$43 = {}; + _dewExec$33 = false; + exports$33 = {}; + _dewExec$24 = false; + exports$24 = {}; + _dewExec$14 = false; + exports$16 = {}; + _dewExec7 = false; + exports10 = dew7(); + exports10["parse"]; + exports10["resolve"]; + exports10["resolveObject"]; + exports10["format"]; + exports10["Url"]; + processPlatform = typeof Deno !== "undefined" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0; + exports10.URL = typeof URL !== "undefined" ? URL : null; + exports10.pathToFileURL = pathToFileURL; + exports10.fileURLToPath = fileURLToPath; + Url = exports10.Url; + format4 = exports10.format; + resolve2 = exports10.resolve; + resolveObject = exports10.resolveObject; + parse7 = exports10.parse; + _URL = exports10.URL; + CHAR_BACKWARD_SLASH = 92; + CHAR_FORWARD_SLASH = 47; + CHAR_LOWERCASE_A = 97; + CHAR_LOWERCASE_Z = 122; + isWindows = processPlatform === "win32"; + forwardSlashRegEx = /\//g; + percentRegEx = /%/g; + backslashRegEx = /\\/g; + newlineRegEx = /\n/g; + carriageReturnRegEx = /\r/g; + tabRegEx = /\t/g; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.0.0.json +var require__12 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.0.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.0.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.0.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.0.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.0.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.0.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.0.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.0.0/info.json": { + $id: "http://asyncapi.com/definitions/2.0.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.0.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.0.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.0.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/license.json": { + $id: "http://asyncapi.com/definitions/2.0.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/server.json": { + $id: "http://asyncapi.com/definitions/2.0.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.0.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.0.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.0.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.0.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.0.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.0.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {} + } + }, + "http://asyncapi.com/definitions/2.0.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.0.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.0.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.0.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.0.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.0.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.0.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.0.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.0.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.0.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.0.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.0.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.0.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.0.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.0.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.0.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.0.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.0.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.0.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/message.json": { + $id: "http://asyncapi.com/definitions/2.0.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + properties: { + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.0.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.0.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.0.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.0.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.0.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.0.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.0.0/components.json": { + $id: "http://asyncapi.com/definitions/2.0.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.0.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.0.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.0.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.0.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.0.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.0.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.0.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.0.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/openIdConnect.json" + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.0.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.0.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.0.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.0.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.0.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.0.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.0.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.0.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.0.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.0.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.1.0.json +var require__13 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.1.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.1.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.1.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.1.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.1.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.1.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.1.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.1.0/info.json": { + $id: "http://asyncapi.com/definitions/2.1.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.1.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.1.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.1.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/license.json": { + $id: "http://asyncapi.com/definitions/2.1.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/server.json": { + $id: "http://asyncapi.com/definitions/2.1.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.1.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.1.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.1.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.1.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.1.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + "http://asyncapi.com/definitions/2.1.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.1.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.1.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.1.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.1.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.1.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.1.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.1.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.1.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.1.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.1.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.1.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.1.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.1.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.1.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.1.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.1.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.1.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.1.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/message.json": { + $id: "http://asyncapi.com/definitions/2.1.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.1.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.1.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.1.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.1.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.1.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.1.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.1.0/components.json": { + $id: "http://asyncapi.com/definitions/2.1.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.1.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.1.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.1.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.1.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.1.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.1.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.1.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.1.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.1.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.1.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.1.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.1.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.1.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.1.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.1.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.1.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.1.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.1.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.2.0.json +var require__14 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.2.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.2.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.2.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.2.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.2.0/info.json" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/server.json" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.2.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.2.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.2.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.2.0/info.json": { + $id: "http://asyncapi.com/definitions/2.2.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.2.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.2.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.2.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/license.json": { + $id: "http://asyncapi.com/definitions/2.2.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/server.json": { + $id: "http://asyncapi.com/definitions/2.2.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.2.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.2.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.2.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.2.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.2.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + "http://asyncapi.com/definitions/2.2.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.2.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.2.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.2.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.2.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.2.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.2.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.2.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.2.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.2.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.2.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.2.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.2.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.2.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.2.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.2.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.2.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.2.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.2.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/message.json": { + $id: "http://asyncapi.com/definitions/2.2.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.2.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.2.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.2.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.2.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.2.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.2.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.2.0/components.json": { + $id: "http://asyncapi.com/definitions/2.2.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.2.0/schemas.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.2.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.2.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.2.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.2.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.2.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.2.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.2.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.2.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.2.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.2.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.2.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.2.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.2.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.2.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.2.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.2.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.2.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.3.0.json +var require__15 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.3.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.3.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.3.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.3.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.3.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.3.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.3.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.3.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.3.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.3.0/info.json": { + $id: "http://asyncapi.com/definitions/2.3.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.3.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.3.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.3.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/license.json": { + $id: "http://asyncapi.com/definitions/2.3.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.3.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.3.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.3.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.3.0/server.json": { + $id: "http://asyncapi.com/definitions/2.3.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.3.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.3.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.3.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.3.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.3.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.3.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.3.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.3.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.3.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.3.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.3.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.3.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.3.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.3.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.3.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.3.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.3.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.3.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.3.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.3.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.3.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.3.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/message.json": { + $id: "http://asyncapi.com/definitions/2.3.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.3.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.3.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.3.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.3.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.3.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.3.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.3.0/components.json": { + $id: "http://asyncapi.com/definitions/2.3.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.3.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.3.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.3.0/channels.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.3.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.3.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.3.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.3.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.3.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.3.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.3.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.3.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.3.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.3.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.3.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.3.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.3.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.3.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.3.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.3.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.3.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.4.0.json +var require__16 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.4.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.4.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.4.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.4.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.4.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.4.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.4.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.4.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.4.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.4.0/info.json": { + $id: "http://asyncapi.com/definitions/2.4.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.4.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.4.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.4.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/license.json": { + $id: "http://asyncapi.com/definitions/2.4.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.4.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.4.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.4.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.4.0/server.json": { + $id: "http://asyncapi.com/definitions/2.4.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.4.0/serverVariables.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariable.json" + } + }, + "http://asyncapi.com/definitions/2.4.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.4.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.4.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.4.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.4.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.4.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.4.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.4.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.4.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.4.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.4.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.4.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.4.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "http://asyncapi.com/definitions/2.4.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.4.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.4.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.4.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.4.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.4.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.4.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/message.json": { + $id: "http://asyncapi.com/definitions/2.4.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.4.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.4.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.4.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.4.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.4.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.4.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.4.0/components.json": { + $id: "http://asyncapi.com/definitions/2.4.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.4.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.4.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.4.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.4.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.4.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.4.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.4.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.4.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.4.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.4.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.4.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.4.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.4.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.4.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.4.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.4.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.4.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.4.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.4.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.4.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.4.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.5.0.json +var require__17 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.5.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.5.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.5.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.5.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.5.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.5.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.5.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.5.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.5.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.5.0/info.json": { + $id: "http://asyncapi.com/definitions/2.5.0/info.json", + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.5.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.5.0/license.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.5.0/contact.json", + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/license.json": { + $id: "http://asyncapi.com/definitions/2.5.0/license.json", + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.5.0/servers.json", + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/server.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.5.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.5.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json", + type: "string", + format: "uri-reference" + }, + "http://asyncapi.com/definitions/2.5.0/server.json": { + $id: "http://asyncapi.com/definitions/2.5.0/server.json", + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariables.json" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + } + } + }, + "http://asyncapi.com/definitions/2.5.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.5.0/serverVariables.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.5.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.5.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + "http://asyncapi.com/definitions/2.5.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json", + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + "http://asyncapi.com/definitions/2.5.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.5.0/tag.json", + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.5.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.5.0/channels.json", + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/channelItem.json" + } + }, + "http://asyncapi.com/definitions/2.5.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.5.0/channelItem.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.5.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.5.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.5.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.5.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.5.0/parameters.json", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/parameter.json" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/2.5.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.5.0/parameter.json", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.5.0/schema.json", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.5.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.5.0/operation.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.5.0/operationTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/message.json": { + $id: "http://asyncapi.com/definitions/2.5.0/message.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.5.0/correlationId.json", + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.5.0/messageTrait.json", + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.5.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.5.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.5.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.5.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.5.0/components.json": { + $id: "http://asyncapi.com/definitions/2.5.0/components.json", + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.5.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.5.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.5.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.5.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.5.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.5.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/bindingsObject.json" + } + } + } + }, + "http://asyncapi.com/definitions/2.5.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.5.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.5.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.5.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.5.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.5.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.5.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.5.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.5.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.5.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Flows.json", + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Flow.json", + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.5.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.5.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.5.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.5.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.5.0/specificationExtension.json" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.6.0.json +var require__18 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.6.0.json"(exports28, module5) { + module5.exports = { + $id: "http://asyncapi.com/definitions/2.6.0/asyncapi.json", + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.6.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.6.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "http://asyncapi.com/definitions/2.6.0/info.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.6.0/servers.json" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.6.0/channels.json" + }, + components: { + $ref: "http://asyncapi.com/definitions/2.6.0/components.json" + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + } + }, + definitions: { + "http://asyncapi.com/definitions/2.6.0/specificationExtension.json": { + $id: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json", + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + "http://asyncapi.com/definitions/2.6.0/info.json": { + $id: "http://asyncapi.com/definitions/2.6.0/info.json", + type: "object", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "http://asyncapi.com/definitions/2.6.0/contact.json" + }, + license: { + $ref: "http://asyncapi.com/definitions/2.6.0/license.json" + } + }, + examples: [ + { + title: "AsyncAPI Sample App", + description: "This is a sample server.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/contact.json": { + $id: "http://asyncapi.com/definitions/2.6.0/contact.json", + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/license.json": { + $id: "http://asyncapi.com/definitions/2.6.0/license.json", + type: "object", + required: [ + "name" + ], + description: "License information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/servers.json": { + $id: "http://asyncapi.com/definitions/2.6.0/servers.json", + description: "The Servers Object is a map of Server Objects.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/server.json" + } + ] + }, + examples: [ + { + development: { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests" + } + ] + }, + staging: { + url: "staging.gigantic-server.com", + description: "Staging server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment" + } + ] + }, + production: { + url: "api.gigantic-server.com", + description: "Production server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users" + } + ] + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/Reference.json": { + $id: "http://asyncapi.com/definitions/2.6.0/Reference.json", + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json": { + $id: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json", + type: "string", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + format: "uri-reference", + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/server.json": { + $id: "http://asyncapi.com/definitions/2.6.0/server.json", + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + url: { + type: "string", + description: "A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served." + }, + description: { + type: "string", + description: "An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation." + }, + protocol: { + type: "string", + description: "The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub." + }, + protocolVersion: { + type: "string", + description: "The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc." + }, + variables: { + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariables.json" + }, + security: { + type: "array", + description: "A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.", + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of servers.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + } + }, + examples: [ + { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "kafka", + protocolVersion: "1.0.0" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/serverVariables.json": { + $id: "http://asyncapi.com/definitions/2.6.0/serverVariables.json", + type: "object", + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariable.json" + } + ] + } + }, + "http://asyncapi.com/definitions/2.6.0/serverVariable.json": { + $id: "http://asyncapi.com/definitions/2.6.0/serverVariable.json", + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. " + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + } + }, + "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json", + type: "object", + description: "Lists of the required security schemes that can be used to execute an operation", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + examples: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/bindingsObject.json": { + $id: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json", + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {}, + googlepubsub: {}, + pulsar: {} + } + }, + "http://asyncapi.com/definitions/2.6.0/tag.json": { + $id: "http://asyncapi.com/definitions/2.6.0/tag.json", + type: "object", + description: "Allows adding meta data to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag." + }, + externalDocs: { + description: "Additional external documentation for this tag.", + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/externalDocs.json": { + $id: "http://asyncapi.com/definitions/2.6.0/externalDocs.json", + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation." + }, + url: { + type: "string", + format: "uri", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/channels.json": { + $id: "http://asyncapi.com/definitions/2.6.0/channels.json", + type: "object", + description: "Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/channelItem.json" + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/channelItem.json": { + $id: "http://asyncapi.com/definitions/2.6.0/channelItem.json", + type: "object", + description: "Describes the operations available on a single channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + $ref: { + $ref: "http://asyncapi.com/definitions/2.6.0/ReferenceObject.json" + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.6.0/parameters.json" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "http://asyncapi.com/definitions/2.6.0/operation.json" + }, + subscribe: { + $ref: "http://asyncapi.com/definitions/2.6.0/operation.json" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + description: "This channel is used to exchange messages about users signing up", + subscribe: { + summary: "A user signed up.", + message: { + description: "A longer description of the message", + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/user" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + } + }, + { + subscribe: { + message: { + oneOf: [ + { + $ref: "#/components/messages/signup" + }, + { + $ref: "#/components/messages/login" + } + ] + } + } + }, + { + description: "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.", + servers: [ + "rabbitmqBrokerInProd", + "rabbitmqBrokerInStaging" + ], + subscribe: { + message: { + $ref: "#/components/messages/WebUICommand" + } + }, + bindings: { + amqp: { + is: "queue" + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/parameters.json": { + $id: "http://asyncapi.com/definitions/2.6.0/parameters.json", + type: "object", + description: "JSON objects describing reusable channel parameters.", + additionalProperties: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/parameter.json" + } + ] + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/parameter.json": { + $id: "http://asyncapi.com/definitions/2.6.0/parameter.json", + description: "Describes a parameter included in a channel name.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + }, + location: "$message.payload#/user/id" + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/schema.json": { + $id: "http://asyncapi.com/definitions/2.6.0/schema.json", + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.", + allOf: [ + { + $ref: "http://json-schema.org/draft-07/schema#" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + }, + not: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + default: {} + }, + propertyNames: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + contains: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. " + }, + externalDocs: { + description: "Additional external documentation for this schema.", + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false, + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage" + } + } + } + ], + examples: [ + { + type: "string", + format: "email" + }, + { + type: "object", + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + address: { + $ref: "#/components/schemas/Address" + }, + age: { + type: "integer", + format: "int32", + minimum: 0 + } + } + } + ] + }, + "http://json-schema.org/draft-07/schema": { + $id: "http://json-schema.org/draft-07/schema", + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#" + }, + then: { + $ref: "#" + }, + else: { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } + }, + default: true + }, + "http://asyncapi.com/definitions/2.6.0/operation.json": { + $id: "http://asyncapi.com/definitions/2.6.0/operation.json", + type: "object", + description: "Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + traits: { + type: "array", + description: "A list of traits to apply to the operation object.", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/operationTrait.json" + } + ] + } + }, + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + message: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + } + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/operationTrait.json": { + $id: "http://asyncapi.com/definitions/2.6.0/operationTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + operationId: { + type: "string", + description: "Unique string used to identify the operation. The id MUST be unique among all operations described in the API." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation. ", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityRequirement.json" + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/message.json": { + $id: "http://asyncapi.com/definitions/2.6.0/message.json", + description: "Describes a message received on a given channel and operation.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/messageTrait.json" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://json-schema.org/draft-07/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json" + } + } + } + } + ] + } + ] + } + ], + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + }, + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + payload: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/correlationId.json": { + $id: "http://asyncapi.com/definitions/2.6.0/correlationId.json", + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/messageTrait.json": { + $id: "http://asyncapi.com/definitions/2.6.0/messageTrait.json", + type: "object", + description: "Describes a trait that MAY be applied to a Message Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemaFormat: { + type: "string", + description: "A string containing the name of the schema format/language used to define the message payload." + }, + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload." + }, + headers: { + description: "Schema definition of the application headers.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string", + description: "Unique string used to identify the message. The id MUST be unique among all messages described in the API." + }, + correlationId: { + description: "Definition of the correlation ID used for message tracing or matching.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of messages.", + items: { + $ref: "http://asyncapi.com/definitions/2.6.0/tag.json" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "http://asyncapi.com/definitions/2.6.0/externalDocs.json" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + examples: [ + { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + contentType: "application/json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json": { + $id: "http://asyncapi.com/definitions/2.6.0/openapiSchema_3_0.json", + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json": { + $id: "http://asyncapi.com/definitions/2.6.0/avroSchema_v1.json", + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/primitiveType" + }, + { + $ref: "#/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroArray" + }, + { + $ref: "#/definitions/avroMap" + }, + { + $ref: "#/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/name" + }, + type: { + $ref: "#/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + items: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + values: { + $ref: "#/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/name" + }, + namespace: { + $ref: "#/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + "http://asyncapi.com/definitions/2.6.0/components.json": { + $id: "http://asyncapi.com/definitions/2.6.0/components.json", + type: "object", + description: "Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + properties: { + schemas: { + $ref: "http://asyncapi.com/definitions/2.6.0/schemas.json" + }, + servers: { + $ref: "http://asyncapi.com/definitions/2.6.0/servers.json" + }, + channels: { + $ref: "http://asyncapi.com/definitions/2.6.0/channels.json" + }, + serverVariables: { + $ref: "http://asyncapi.com/definitions/2.6.0/serverVariables.json" + }, + messages: { + $ref: "http://asyncapi.com/definitions/2.6.0/messages.json" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json" + } + ] + } + } + }, + parameters: { + $ref: "http://asyncapi.com/definitions/2.6.0/parameters.json" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/Reference.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/correlationId.json" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/operationTrait.json" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/messageTrait.json" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/bindingsObject.json" + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + } + }, + servers: { + development: { + url: "{stage}.gigantic-server.com:{port}", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `gigantic-server.com`" + }, + port: { + enum: [ + "8883", + "8884" + ], + default: "8883" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/schemas.json": { + $id: "http://asyncapi.com/definitions/2.6.0/schemas.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/schema.json" + }, + description: "JSON objects describing schemas the API uses." + }, + "http://asyncapi.com/definitions/2.6.0/messages.json": { + $id: "http://asyncapi.com/definitions/2.6.0/messages.json", + type: "object", + additionalProperties: { + $ref: "http://asyncapi.com/definitions/2.6.0/message.json" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SecurityScheme.json", + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/userPassword.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/apiKey.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/X509.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/openIdConnect.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/userPassword.json": { + $id: "http://asyncapi.com/definitions/2.6.0/userPassword.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "userPassword" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/apiKey.json": { + $id: "http://asyncapi.com/definitions/2.6.0/apiKey.json", + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/X509.json": { + $id: "http://asyncapi.com/definitions/2.6.0/X509.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ], + description: "The type of the security scheme." + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.6.0/symmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json": { + $id: "http://asyncapi.com/definitions/2.6.0/asymmetricEncryption.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/HTTPSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/NonBearerHTTPSecurityScheme.json", + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/BearerHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/APIKeyHTTPSecurityScheme.json", + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Flows.json", + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Flow.json", + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + scopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json": { + $id: "http://asyncapi.com/definitions/2.6.0/oauth2Scopes.json", + type: "object", + additionalProperties: { + type: "string" + } + }, + "http://asyncapi.com/definitions/2.6.0/openIdConnect.json": { + $id: "http://asyncapi.com/definitions/2.6.0/openIdConnect.json", + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false + }, + "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslSecurityScheme.json", + oneOf: [ + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json" + }, + { + $ref: "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslPlainSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslScramSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json": { + $id: "http://asyncapi.com/definitions/2.6.0/SaslGssapiSecurityScheme.json", + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "http://asyncapi.com/definitions/2.6.0/specificationExtension.json" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.0.0-without-$id.json +var require_without_id10 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.0.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.0.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.0.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + properties: { + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.1.0-without-$id.json +var require_without_id11 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.1.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.1.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.1.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.2.0-without-$id.json +var require_without_id12 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.2.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.2.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.2.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + type: "object", + additionalProperties: { + $ref: "#/definitions/server" + } + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.3.0-without-$id.json +var require_without_id13 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.3.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.3.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.3.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.4.0-without-$id.json +var require_without_id14 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.4.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.4.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.4.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/serverVariable" + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.5.0-without-$id.json +var require_without_id15 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.5.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.5.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.5.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "General information about the API.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + } + }, + contact: { + type: "object", + description: "Contact information for the owners of the API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + license: { + type: "object", + required: [ + "name" + ], + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + servers: { + description: "An object representing multiple servers.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + format: "uri-reference" + }, + server: { + type: "object", + description: "An object representing a Server.", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + protocol: { + type: "string", + description: "The transfer protocol." + }, + protocolVersion: { + type: "string" + }, + variables: { + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + } + } + }, + serverVariables: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string" + }, + description: { + type: "string" + }, + examples: { + type: "array", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + } + }, + bindingsObject: { + type: "object", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {} + } + }, + tag: { + type: "object", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + description: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "information about external documentation", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + channels: { + type: "object", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + } + }, + channelItem: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + parameters: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + description: "JSON objects describing re-usable channel parameters." + }, + parameter: { + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + schema: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string" + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + operation: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string" + }, + description: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + } + }, + operationTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + message: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object" + }, + payload: {} + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ] + }, + correlationId: { + type: "object", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + messageTrait: { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: { + type: "object" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + } + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + } + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "userPassword" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string" + }, + type: { + type: "string", + enum: [ + "http" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string" + }, + in: { + type: "string", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Flows: { + type: "object", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + enum: [ + "oauth2" + ] + }, + description: { + type: "string" + }, + flows: { + type: "object", + properties: { + implicit: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + properties: { + authorizationUrl: { + type: "string", + format: "uri" + }, + tokenUrl: { + type: "string", + format: "uri" + }, + refreshUrl: { + type: "string", + format: "uri" + }, + scopes: { + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "plain" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "gssapi" + ] + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.6.0-without-$id.json +var require_without_id16 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/schemas/2.6.0-without-$id.json"(exports28, module5) { + module5.exports = { + $schema: "http://json-schema.org/draft-07/schema", + title: "AsyncAPI 2.6.0 schema.", + type: "object", + required: [ + "asyncapi", + "info", + "channels" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + asyncapi: { + type: "string", + enum: [ + "2.6.0" + ], + description: "The AsyncAPI specification version of this document." + }, + id: { + type: "string", + description: "A unique id representing the application.", + format: "uri" + }, + info: { + $ref: "#/definitions/info" + }, + servers: { + $ref: "#/definitions/servers" + }, + defaultContentType: { + type: "string" + }, + channels: { + $ref: "#/definitions/channels" + }, + components: { + $ref: "#/definitions/components" + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + } + }, + definitions: { + specificationExtension: { + description: "Any property starting with x- is valid.", + additionalProperties: true, + additionalItems: true + }, + info: { + type: "object", + description: "The object provides metadata about the API. The metadata can be used by the clients if needed.", + required: [ + "version", + "title" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + title: { + type: "string", + description: "A unique and precise title of the API." + }, + version: { + type: "string", + description: "A semantic version number of the API." + }, + description: { + type: "string", + description: "A longer description of the API. Should be different from the title. CommonMark is allowed." + }, + termsOfService: { + type: "string", + description: "A URL to the Terms of Service for the API. MUST be in the format of a URL.", + format: "uri" + }, + contact: { + $ref: "#/definitions/contact" + }, + license: { + $ref: "#/definitions/license" + } + }, + examples: [ + { + title: "AsyncAPI Sample App", + description: "This is a sample server.", + termsOfService: "https://asyncapi.org/terms/", + contact: { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + }, + license: { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + } + ] + }, + contact: { + type: "object", + description: "Contact information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The identifying name of the contact person/organization." + }, + url: { + type: "string", + description: "The URL pointing to the contact information.", + format: "uri" + }, + email: { + type: "string", + description: "The email address of the contact person/organization.", + format: "email" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "API Support", + url: "https://www.example.com/support", + email: "support@example.com" + } + ] + }, + license: { + type: "object", + required: [ + "name" + ], + description: "License information for the exposed API.", + additionalProperties: false, + properties: { + name: { + type: "string", + description: "The name of the license type. It's encouraged to use an OSI compatible license." + }, + url: { + type: "string", + description: "The URL pointing to the license.", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "Apache 2.0", + url: "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] + }, + servers: { + description: "The Servers Object is a map of Server Objects.", + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/server" + } + ] + }, + examples: [ + { + development: { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:development", + description: "This environment is meant for developers to run their own tests" + } + ] + }, + staging: { + url: "staging.gigantic-server.com", + description: "Staging server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:staging", + description: "This environment is a replica of the production environment" + } + ] + }, + production: { + url: "api.gigantic-server.com", + description: "Production server", + protocol: "amqp", + protocolVersion: "0.9.1", + tags: [ + { + name: "env:production", + description: "This environment is the live environment available for final users" + } + ] + } + } + ] + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + } + } + }, + ReferenceObject: { + type: "string", + description: "A simple object to allow referencing other components in the specification, internally and externally.", + format: "uri-reference", + examples: [ + { + $ref: "#/components/schemas/Pet" + } + ] + }, + server: { + type: "object", + description: "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data", + required: [ + "url", + "protocol" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + url: { + type: "string", + description: "A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served." + }, + description: { + type: "string", + description: "An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation." + }, + protocol: { + type: "string", + description: "The protocol this URL supports for connection. Supported protocol include, but are not limited to: amqp, amqps, http, https, ibmmq, jms, kafka, kafka-secure, anypointmq, mqtt, secure-mqtt, solace, stomp, stomps, ws, wss, mercure, googlepubsub." + }, + protocolVersion: { + type: "string", + description: "The version of the protocol used for connection. For instance: AMQP 0.9.1, HTTP 2.0, Kafka 1.0.0, etc." + }, + variables: { + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + $ref: "#/definitions/serverVariables" + }, + security: { + type: "array", + description: "A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. ", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + description: "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.", + $ref: "#/definitions/bindingsObject" + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of servers.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + } + }, + examples: [ + { + url: "development.gigantic-server.com", + description: "Development server", + protocol: "kafka", + protocolVersion: "1.0.0" + } + ] + }, + serverVariables: { + type: "object", + description: "A map between a variable name and its value. The value is used for substitution in the server's URL template.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/serverVariable" + } + ] + } + }, + serverVariable: { + type: "object", + description: "An object representing a Server Variable for server URL template substitution.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + enum: { + type: "array", + description: "An enumeration of string values to be used if the substitution options are from a limited set.", + items: { + type: "string" + }, + uniqueItems: true + }, + default: { + type: "string", + description: "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + description: { + type: "string", + description: "An optional description for the server variable. " + }, + examples: { + type: "array", + description: "An array of examples of the server variable.", + items: { + type: "string" + } + } + } + }, + SecurityRequirement: { + type: "object", + description: "Lists of the required security schemes that can be used to execute an operation", + additionalProperties: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true + }, + examples: [ + { + petstore_auth: [ + "write:pets", + "read:pets" + ] + } + ] + }, + bindingsObject: { + type: "object", + description: "Map describing protocol-specific definitions for a server.", + additionalProperties: true, + properties: { + http: {}, + ws: {}, + amqp: {}, + amqp1: {}, + mqtt: {}, + mqtt5: {}, + kafka: {}, + anypointmq: {}, + nats: {}, + jms: {}, + sns: {}, + sqs: {}, + stomp: {}, + redis: {}, + ibmmq: {}, + solace: {}, + googlepubsub: {}, + pulsar: {} + } + }, + tag: { + type: "object", + description: "Allows adding meta data to a single tag.", + additionalProperties: false, + required: [ + "name" + ], + properties: { + name: { + type: "string", + description: "The name of the tag." + }, + description: { + type: "string", + description: "A short description for the tag." + }, + externalDocs: { + description: "Additional external documentation for this tag.", + $ref: "#/definitions/externalDocs" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + name: "user", + description: "User-related messages" + } + ] + }, + externalDocs: { + type: "object", + additionalProperties: false, + description: "Allows referencing an external resource for extended documentation.", + required: [ + "url" + ], + properties: { + description: { + type: "string", + description: "A short description of the target documentation." + }, + url: { + type: "string", + format: "uri", + description: "The URL for the target documentation. This MUST be in the form of an absolute URL." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + examples: [ + { + description: "Find more info here", + url: "https://example.com" + } + ] + }, + channels: { + type: "object", + description: "Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.", + propertyNames: { + type: "string", + format: "uri-template", + minLength: 1 + }, + additionalProperties: { + $ref: "#/definitions/channelItem" + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + channelItem: { + type: "object", + description: "Describes the operations available on a single channel.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + $ref: { + $ref: "#/definitions/ReferenceObject" + }, + parameters: { + $ref: "#/definitions/parameters" + }, + description: { + type: "string", + description: "A description of the channel." + }, + servers: { + type: "array", + description: "The names of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", + items: { + type: "string" + }, + uniqueItems: true + }, + publish: { + $ref: "#/definitions/operation" + }, + subscribe: { + $ref: "#/definitions/operation" + }, + deprecated: { + type: "boolean", + default: false + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + description: "This channel is used to exchange messages about users signing up", + subscribe: { + summary: "A user signed up.", + message: { + description: "A longer description of the message", + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/user" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + bindings: { + amqp: { + is: "queue", + queue: { + exclusive: true + } + } + } + }, + { + subscribe: { + message: { + oneOf: [ + { + $ref: "#/components/messages/signup" + }, + { + $ref: "#/components/messages/login" + } + ] + } + } + }, + { + description: "This application publishes WebUICommand messages to an AMQP queue on RabbitMQ brokers in the Staging and Production environments.", + servers: [ + "rabbitmqBrokerInProd", + "rabbitmqBrokerInStaging" + ], + subscribe: { + message: { + $ref: "#/components/messages/WebUICommand" + } + }, + bindings: { + amqp: { + is: "queue" + } + } + } + ] + }, + parameters: { + type: "object", + description: "JSON objects describing reusable channel parameters.", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/parameter" + } + ] + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + parameter: { + description: "Describes a parameter included in a channel name.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + schema: { + $ref: "#/definitions/schema" + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the parameter value", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + "user/{userId}/signup": { + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + }, + location: "$message.payload#/user/id" + } + }, + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + schema: { + description: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.", + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "boolean" + } + ], + default: {} + }, + items: { + anyOf: [ + { + $ref: "#/definitions/schema" + }, + { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + } + ], + default: {} + }, + allOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + oneOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + anyOf: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/schema" + } + }, + not: { + $ref: "#/definitions/schema" + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + default: {} + }, + propertyNames: { + $ref: "#/definitions/schema" + }, + contains: { + $ref: "#/definitions/schema" + }, + discriminator: { + type: "string", + description: "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. " + }, + externalDocs: { + description: "Additional external documentation for this schema.", + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false, + description: "Specifies that a schema is deprecated and SHOULD be transitioned out of usage" + } + } + } + ], + examples: [ + { + type: "string", + format: "email" + }, + { + type: "object", + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + address: { + $ref: "#/components/schemas/Address" + }, + age: { + type: "integer", + format: "int32", + minimum: 0 + } + } + } + ] + }, + "json-schema-draft-07-schema": { + title: "Core schema meta-schema", + definitions: { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + { + default: 0 + } + ] + }, + simpleTypes: { + enum: [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + default: [] + } + }, + type: [ + "object", + "boolean" + ], + properties: { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + default: true, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + items: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + } + ], + default: true + }, + maxItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + default: false + }, + contains: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + maxProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + }, + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + default: {} + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + propertyNames: { + format: "regex" + }, + default: {} + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + const: true, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + if: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + then: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + else: { + $ref: "#/definitions/json-schema-draft-07-schema" + }, + allOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/json-schema-draft-07-schema/definitions/schemaArray" + }, + not: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + }, + default: true + }, + operation: { + type: "object", + description: "Describes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + traits: { + type: "array", + description: "A list of traits to apply to the operation object.", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/operationTrait" + } + ] + } + }, + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation.", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string" + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + message: { + $ref: "#/definitions/message" + } + }, + examples: [ + { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignedUp" + } + } + } + } + ] + }, + operationTrait: { + type: "object", + description: "Describes a trait that MAY be applied to an Operation Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + summary: { + type: "string", + description: "A short summary of what the operation is about." + }, + description: { + type: "string", + description: "A verbose explanation of the operation." + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of operations.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + operationId: { + type: "string", + description: "Unique string used to identify the operation. The id MUST be unique among all operations described in the API." + }, + security: { + type: "array", + description: "A declaration of which security mechanisms are associated with this operation. ", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + bindings: { + amqp: { + ack: false + } + } + } + ] + }, + message: { + description: "Describes a message received on a given channel and operation.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + oneOf: [ + { + type: "object", + required: [ + "oneOf" + ], + additionalProperties: false, + properties: { + oneOf: { + type: "array", + items: { + $ref: "#/definitions/message" + } + } + } + }, + { + type: "object", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string" + }, + contentType: { + type: "string" + }, + headers: { + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string" + }, + payload: {}, + correlationId: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + }, + traits: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/messageTrait" + } + ] + } + } + }, + allOf: [ + { + if: { + not: { + required: [ + "schemaFormat" + ] + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.aai.asyncapi;version=2.0.0", + "application/vnd.aai.asyncapi+json;version=2.0.0", + "application/vnd.aai.asyncapi+yaml;version=2.0.0", + "application/vnd.aai.asyncapi;version=2.1.0", + "application/vnd.aai.asyncapi+json;version=2.1.0", + "application/vnd.aai.asyncapi+yaml;version=2.1.0", + "application/vnd.aai.asyncapi;version=2.2.0", + "application/vnd.aai.asyncapi+json;version=2.2.0", + "application/vnd.aai.asyncapi+yaml;version=2.2.0", + "application/vnd.aai.asyncapi;version=2.3.0", + "application/vnd.aai.asyncapi+json;version=2.3.0", + "application/vnd.aai.asyncapi+yaml;version=2.3.0", + "application/vnd.aai.asyncapi;version=2.4.0", + "application/vnd.aai.asyncapi+json;version=2.4.0", + "application/vnd.aai.asyncapi+yaml;version=2.4.0", + "application/vnd.aai.asyncapi;version=2.5.0", + "application/vnd.aai.asyncapi+json;version=2.5.0", + "application/vnd.aai.asyncapi+yaml;version=2.5.0", + "application/vnd.aai.asyncapi;version=2.6.0", + "application/vnd.aai.asyncapi+json;version=2.6.0", + "application/vnd.aai.asyncapi+yaml;version=2.6.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/json-schema-draft-07-schema" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/openapiSchema_3_0" + } + } + } + }, + { + if: { + required: [ + "schemaFormat" + ], + properties: { + schemaFormat: { + enum: [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0" + ] + } + } + }, + then: { + properties: { + payload: { + $ref: "#/definitions/avroSchema_v1" + } + } + } + } + ] + } + ] + } + ], + examples: [ + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + contentType: "application/json", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + headers: { + type: "object", + properties: { + correlationId: { + description: "Correlation ID set by application", + type: "string" + }, + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + }, + correlationId: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + }, + traits: [ + { + $ref: "#/components/messageTraits/commonHeaders" + } + ], + examples: [ + { + name: "SimpleSignup", + summary: "A simple UserSignup example message", + headers: { + correlationId: "my-correlation-id", + applicationInstanceId: "myInstanceId" + }, + payload: { + user: { + someUserKey: "someUserValue" + }, + signup: { + someSignupKey: "someSignupValue" + } + } + } + ] + }, + { + messageId: "userSignup", + name: "UserSignup", + title: "User signup", + summary: "Action to sign a user up.", + description: "A longer description", + tags: [ + { + name: "user" + }, + { + name: "signup" + }, + { + name: "register" + } + ], + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + payload: { + $ref: "path/to/user-create.avsc#/UserCreate" + } + } + ] + }, + correlationId: { + type: "object", + description: "An object that specifies an identifier at design time that can used for message tracing and correlation.", + required: [ + "location" + ], + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + description: { + type: "string", + description: "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + location: { + type: "string", + description: "A runtime expression that specifies the location of the correlation ID", + pattern: "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + }, + examples: [ + { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + ] + }, + messageTrait: { + type: "object", + description: "Describes a trait that MAY be applied to a Message Object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemaFormat: { + type: "string", + description: "A string containing the name of the schema format/language used to define the message payload." + }, + contentType: { + type: "string", + description: "The content type to use when encoding/decoding a message's payload." + }, + headers: { + description: "Schema definition of the application headers.", + allOf: [ + { + $ref: "#/definitions/schema" + }, + { + properties: { + type: { + const: "object" + } + } + } + ] + }, + messageId: { + type: "string", + description: "Unique string used to identify the message. The id MUST be unique among all messages described in the API." + }, + correlationId: { + description: "Definition of the correlation ID used for message tracing or matching.", + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + }, + tags: { + type: "array", + description: "A list of tags for logical grouping and categorization of messages.", + items: { + $ref: "#/definitions/tag" + }, + uniqueItems: true + }, + summary: { + type: "string", + description: "A brief summary of the message." + }, + name: { + type: "string", + description: "Name of the message." + }, + title: { + type: "string", + description: "A human-friendly title for the message." + }, + description: { + type: "string", + description: "A longer description of the message. CommonMark is allowed." + }, + externalDocs: { + $ref: "#/definitions/externalDocs" + }, + deprecated: { + type: "boolean", + default: false + }, + examples: { + type: "array", + description: "List of examples.", + items: { + type: "object", + additionalProperties: false, + anyOf: [ + { + required: [ + "payload" + ] + }, + { + required: [ + "headers" + ] + } + ], + properties: { + name: { + type: "string", + description: "Machine readable name of the message example." + }, + summary: { + type: "string", + description: "A brief summary of the message example." + }, + headers: { + type: "object", + description: "Schema definition of the application headers." + }, + payload: { + description: "Definition of the message payload. It can be of any type" + } + } + } + }, + bindings: { + $ref: "#/definitions/bindingsObject" + } + }, + examples: [ + { + schemaFormat: "application/vnd.apache.avro+json;version=1.9.0", + contentType: "application/json" + } + ] + }, + openapiSchema_3_0: { + type: "object", + definitions: { + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + Discriminator: { + type: "object", + required: [ + "propertyName" + ], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + Reference: { + type: "object", + required: [ + "$ref" + ], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: true, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ] + }, + not: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#/definitions/openapiSchema_3_0" + }, + { + $ref: "#/definitions/openapiSchema_3_0/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: true, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/openapiSchema_3_0/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: true, + externalDocs: { + $ref: "#/definitions/openapiSchema_3_0/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/openapiSchema_3_0/definitions/XML" + } + }, + patternProperties: { + "^x-": true + }, + additionalProperties: false + }, + avroSchema_v1: { + definitions: { + avroSchema: { + title: "Avro Schema", + description: "Root Schema", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + ] + }, + types: { + title: "Avro Types", + description: "Allowed Avro types", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveTypeWithMetadata" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/customTypeReference" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroRecord" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroEnum" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroArray" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroMap" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroFixed" + }, + { + $ref: "#/definitions/avroSchema_v1/definitions/avroUnion" + } + ] + }, + primitiveType: { + title: "Primitive Type", + description: "Basic type primitives.", + type: "string", + enum: [ + "null", + "boolean", + "int", + "long", + "float", + "double", + "bytes", + "string" + ] + }, + primitiveTypeWithMetadata: { + title: "Primitive Type With Metadata", + description: "A primitive type with metadata attached.", + type: "object", + properties: { + type: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + } + }, + required: [ + "type" + ] + }, + customTypeReference: { + title: "Custom Type", + description: "Reference to a ComplexType", + not: { + $ref: "#/definitions/avroSchema_v1/definitions/primitiveType" + }, + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$" + }, + avroUnion: { + title: "Union", + description: "A Union of types", + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + }, + minItems: 1 + }, + avroField: { + title: "Field", + description: "A field within a Record", + type: "object", + properties: { + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + type: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + }, + doc: { + type: "string" + }, + default: true, + order: { + enum: [ + "ascending", + "descending", + "ignore" + ] + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "name", + "type" + ] + }, + avroRecord: { + title: "Record", + description: "A Record", + type: "object", + properties: { + type: { + type: "string", + const: "record" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + fields: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/avroField" + } + } + }, + required: [ + "type", + "name", + "fields" + ] + }, + avroEnum: { + title: "Enum", + description: "An enumeration", + type: "object", + properties: { + type: { + type: "string", + const: "enum" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + symbols: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + } + }, + required: [ + "type", + "name", + "symbols" + ] + }, + avroArray: { + title: "Array", + description: "An array", + type: "object", + properties: { + type: { + type: "string", + const: "array" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + items: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "items" + ] + }, + avroMap: { + title: "Map", + description: "A map of values", + type: "object", + properties: { + type: { + type: "string", + const: "map" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + values: { + $ref: "#/definitions/avroSchema_v1/definitions/types" + } + }, + required: [ + "type", + "values" + ] + }, + avroFixed: { + title: "Fixed", + description: "A fixed sized array of bytes", + type: "object", + properties: { + type: { + type: "string", + const: "fixed" + }, + name: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + }, + namespace: { + $ref: "#/definitions/avroSchema_v1/definitions/namespace" + }, + doc: { + type: "string" + }, + aliases: { + type: "array", + items: { + $ref: "#/definitions/avroSchema_v1/definitions/name" + } + }, + size: { + type: "number" + } + }, + required: [ + "type", + "name", + "size" + ] + }, + name: { + type: "string", + pattern: "^[A-Za-z_][A-Za-z0-9_]*$" + }, + namespace: { + type: "string", + pattern: "^([A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*)*$" + } + }, + description: "Json-Schema definition for Avro AVSC files.", + oneOf: [ + { + $ref: "#/definitions/avroSchema_v1/definitions/avroSchema" + } + ], + title: "Avro Schema Definition" + }, + components: { + type: "object", + description: "Holds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", + additionalProperties: false, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + properties: { + schemas: { + $ref: "#/definitions/schemas" + }, + servers: { + $ref: "#/definitions/servers" + }, + channels: { + $ref: "#/definitions/channels" + }, + serverVariables: { + $ref: "#/definitions/serverVariables" + }, + messages: { + $ref: "#/definitions/messages" + }, + securitySchemes: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/SecurityScheme" + } + ] + } + } + }, + parameters: { + $ref: "#/definitions/parameters" + }, + correlationIds: { + type: "object", + patternProperties: { + "^[\\w\\d\\.\\-_]+$": { + oneOf: [ + { + $ref: "#/definitions/Reference" + }, + { + $ref: "#/definitions/correlationId" + } + ] + } + } + }, + operationTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/operationTrait" + } + }, + messageTraits: { + type: "object", + additionalProperties: { + $ref: "#/definitions/messageTrait" + } + }, + serverBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + channelBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + operationBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + }, + messageBindings: { + type: "object", + additionalProperties: { + $ref: "#/definitions/bindingsObject" + } + } + }, + examples: [ + { + components: { + schemas: { + Category: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + }, + Tag: { + type: "object", + properties: { + id: { + type: "integer", + format: "int64" + }, + name: { + type: "string" + } + } + } + }, + servers: { + development: { + url: "{stage}.gigantic-server.com:{port}", + description: "Development server", + protocol: "amqp", + protocolVersion: "0.9.1", + variables: { + stage: { + $ref: "#/components/serverVariables/stage" + }, + port: { + $ref: "#/components/serverVariables/port" + } + } + } + }, + serverVariables: { + stage: { + default: "demo", + description: "This value is assigned by the service provider, in this example `gigantic-server.com`" + }, + port: { + enum: [ + "8883", + "8884" + ], + default: "8883" + } + }, + channels: { + "user/signedup": { + subscribe: { + message: { + $ref: "#/components/messages/userSignUp" + } + } + } + }, + messages: { + userSignUp: { + summary: "Action to sign a user up.", + description: "Multiline description of what this action does.\nHere you have another line.\n", + tags: [ + { + name: "user" + }, + { + name: "signup" + } + ], + headers: { + type: "object", + properties: { + applicationInstanceId: { + description: "Unique identifier for a given instance of the publishing application", + type: "string" + } + } + }, + payload: { + type: "object", + properties: { + user: { + $ref: "#/components/schemas/userCreate" + }, + signup: { + $ref: "#/components/schemas/signup" + } + } + } + } + }, + parameters: { + userId: { + description: "Id of the user.", + schema: { + type: "string" + } + } + }, + correlationIds: { + default: { + description: "Default Correlation ID", + location: "$message.header#/correlationId" + } + }, + messageTraits: { + commonHeaders: { + headers: { + type: "object", + properties: { + "my-app-header": { + type: "integer", + minimum: 0, + maximum: 100 + } + } + } + } + } + } + } + ] + }, + schemas: { + type: "object", + additionalProperties: { + $ref: "#/definitions/schema" + }, + description: "JSON objects describing schemas the API uses." + }, + messages: { + type: "object", + additionalProperties: { + $ref: "#/definitions/message" + }, + description: "JSON objects describing the messages being consumed and produced by the API." + }, + SecurityScheme: { + description: "Defines a security scheme that can be used by the operations.", + oneOf: [ + { + $ref: "#/definitions/userPassword" + }, + { + $ref: "#/definitions/apiKey" + }, + { + $ref: "#/definitions/X509" + }, + { + $ref: "#/definitions/symmetricEncryption" + }, + { + $ref: "#/definitions/asymmetricEncryption" + }, + { + $ref: "#/definitions/HTTPSecurityScheme" + }, + { + $ref: "#/definitions/oauth2Flows" + }, + { + $ref: "#/definitions/openIdConnect" + }, + { + $ref: "#/definitions/SaslSecurityScheme" + } + ], + examples: [ + { + type: "userPassword" + } + ] + }, + userPassword: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "userPassword" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "userPassword" + } + ] + }, + apiKey: { + type: "object", + required: [ + "type", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "apiKey" + ] + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "user", + "password" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "apiKey", + in: "user" + } + ] + }, + X509: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + enum: [ + "X509" + ], + description: "The type of the security scheme." + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "X509" + } + ] + }, + symmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "symmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "symmetricEncryption" + } + ] + }, + asymmetricEncryption: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "asymmetricEncryption" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + HTTPSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/NonBearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/BearerHTTPSecurityScheme" + }, + { + $ref: "#/definitions/APIKeyHTTPSecurityScheme" + } + ] + }, + NonBearerHTTPSecurityScheme: { + not: { + type: "object", + properties: { + scheme: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "bearer" + ] + } + } + }, + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + BearerHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "scheme" + ], + properties: { + scheme: { + type: "string", + description: "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", + enum: [ + "bearer" + ] + }, + bearerFormat: { + type: "string", + description: "A hint to the client to identify how the bearer token is formatted." + }, + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "http" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + APIKeyHTTPSecurityScheme: { + type: "object", + required: [ + "type", + "name", + "in" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. ", + enum: [ + "httpApiKey" + ] + }, + name: { + type: "string", + description: "The name of the header, query or cookie parameter to be used." + }, + in: { + type: "string", + description: "The location of the API key. ", + enum: [ + "header", + "query", + "cookie" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "httpApiKey", + name: "api_key", + in: "header" + } + ] + }, + oauth2Flows: { + type: "object", + description: "Allows configuration of the supported OAuth Flows.", + required: [ + "type", + "flows" + ], + properties: { + type: { + type: "string", + description: "A short description for security scheme.", + enum: [ + "oauth2" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + }, + flows: { + type: "object", + properties: { + implicit: { + description: "Configuration for the OAuth Implicit flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "scopes" + ] + }, + { + not: { + required: [ + "tokenUrl" + ] + } + } + ] + }, + password: { + description: "Configuration for the OAuth Resource Owner Protected Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + clientCredentials: { + description: "Configuration for the OAuth Client Credentials flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "tokenUrl", + "scopes" + ] + }, + { + not: { + required: [ + "authorizationUrl" + ] + } + } + ] + }, + authorizationCode: { + description: "Configuration for the OAuth Authorization Code flow.", + allOf: [ + { + $ref: "#/definitions/oauth2Flow" + }, + { + required: [ + "authorizationUrl", + "tokenUrl", + "scopes" + ] + } + ] + } + }, + additionalProperties: false + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + } + }, + oauth2Flow: { + type: "object", + description: "Configuration details for a supported OAuth Flow", + properties: { + authorizationUrl: { + type: "string", + format: "uri", + description: "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + tokenUrl: { + type: "string", + format: "uri", + description: "The token URL to be used for this flow. This MUST be in the form of an absolute URL." + }, + refreshUrl: { + type: "string", + format: "uri", + description: "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." + }, + scopes: { + description: "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.", + $ref: "#/definitions/oauth2Scopes" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/api/oauth/dialog", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + }, + authorizationCode: { + authorizationUrl: "https://example.com/api/oauth/dialog", + tokenUrl: "https://example.com/api/oauth/token", + scopes: { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + } + } + ] + }, + oauth2Scopes: { + type: "object", + additionalProperties: { + type: "string" + } + }, + openIdConnect: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + enum: [ + "openIdConnect" + ] + }, + description: { + type: "string" + }, + openIdConnectUrl: { + type: "string", + format: "uri" + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false + }, + SaslSecurityScheme: { + oneOf: [ + { + $ref: "#/definitions/SaslPlainSecurityScheme" + }, + { + $ref: "#/definitions/SaslScramSecurityScheme" + }, + { + $ref: "#/definitions/SaslGssapiSecurityScheme" + } + ] + }, + SaslPlainSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme. Valid values", + enum: [ + "plain" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslScramSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "scramSha256", + "scramSha512" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + }, + SaslGssapiSecurityScheme: { + type: "object", + required: [ + "type" + ], + properties: { + type: { + type: "string", + description: "The type of the security scheme.", + enum: [ + "gssapi" + ] + }, + description: { + type: "string", + description: "A short description for security scheme." + } + }, + patternProperties: { + "^x-[\\w\\d\\.\\x2d_]+$": { + $ref: "#/definitions/specificationExtension" + } + }, + additionalProperties: false, + examples: [ + { + type: "scramSha512" + } + ] + } + }, + description: "!!Auto generated!! \n Do not manually edit. " + }; + } +}); + +// node_modules/parserapiv1/node_modules/@asyncapi/specs/index.js +var require_specs2 = __commonJS({ + "node_modules/parserapiv1/node_modules/@asyncapi/specs/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + "schemas": { + "2.0.0": require__12(), + "2.1.0": require__13(), + "2.2.0": require__14(), + "2.3.0": require__15(), + "2.4.0": require__16(), + "2.5.0": require__17(), + "2.6.0": require__18() + }, + "schemasWithoutId": { + "2.0.0": require_without_id10(), + "2.1.0": require_without_id11(), + "2.2.0": require_without_id12(), + "2.3.0": require_without_id13(), + "2.4.0": require_without_id14(), + "2.5.0": require_without_id15(), + "2.6.0": require_without_id16() + } + }; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js +function dew$15() { + if (_dewExec$15) + return exports$25; + _dewExec$15 = true; + var buffer2 = dew(); + var Buffer4 = buffer2.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$25 = buffer2; + } else { + copyProps(buffer2, exports$25); + exports$25.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer2.SlowBuffer(size2); + }; + return exports$25; +} +function dew8() { + if (_dewExec8) + return exports$17; + _dewExec8 = true; + var Buffer4 = dew$15().Buffer; + var isEncoding = Buffer4.isEncoding || function(encoding) { + encoding = "" + encoding; + switch (encoding && encoding.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function _normalizeEncoding(enc) { + if (!enc) + return "utf8"; + var retried; + while (true) { + switch (enc) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return enc; + default: + if (retried) + return; + enc = ("" + enc).toLowerCase(); + retried = true; + } + } + } + function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc))) + throw new Error("Unknown encoding: " + enc); + return nenc || enc; + } + exports$17.StringDecoder = StringDecoder2; + function StringDecoder2(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case "utf16le": + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case "utf8": + this.fillLast = utf8FillLast; + nb = 4; + break; + case "base64": + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer4.allocUnsafe(nb); + } + StringDecoder2.prototype.write = function(buf) { + if (buf.length === 0) + return ""; + var r8; + var i7; + if (this.lastNeed) { + r8 = this.fillLast(buf); + if (r8 === void 0) + return ""; + i7 = this.lastNeed; + this.lastNeed = 0; + } else { + i7 = 0; + } + if (i7 < buf.length) + return r8 ? r8 + this.text(buf, i7) : this.text(buf, i7); + return r8 || ""; + }; + StringDecoder2.prototype.end = utf8End; + StringDecoder2.prototype.text = utf8Text; + StringDecoder2.prototype.fillLast = function(buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; + }; + function utf8CheckByte(byte) { + if (byte <= 127) + return 0; + else if (byte >> 5 === 6) + return 2; + else if (byte >> 4 === 14) + return 3; + else if (byte >> 3 === 30) + return 4; + return byte >> 6 === 2 ? -1 : -2; + } + function utf8CheckIncomplete(self2, buf, i7) { + var j6 = buf.length - 1; + if (j6 < i7) + return 0; + var nb = utf8CheckByte(buf[j6]); + if (nb >= 0) { + if (nb > 0) + self2.lastNeed = nb - 1; + return nb; + } + if (--j6 < i7 || nb === -2) + return 0; + nb = utf8CheckByte(buf[j6]); + if (nb >= 0) { + if (nb > 0) + self2.lastNeed = nb - 2; + return nb; + } + if (--j6 < i7 || nb === -2) + return 0; + nb = utf8CheckByte(buf[j6]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) + nb = 0; + else + self2.lastNeed = nb - 3; + } + return nb; + } + return 0; + } + function utf8CheckExtraBytes(self2, buf, p7) { + if ((buf[0] & 192) !== 128) { + self2.lastNeed = 0; + return "\uFFFD"; + } + if (self2.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 192) !== 128) { + self2.lastNeed = 1; + return "\uFFFD"; + } + if (self2.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 192) !== 128) { + self2.lastNeed = 2; + return "\uFFFD"; + } + } + } + } + function utf8FillLast(buf) { + var p7 = this.lastTotal - this.lastNeed; + var r8 = utf8CheckExtraBytes(this, buf); + if (r8 !== void 0) + return r8; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p7, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p7, 0, buf.length); + this.lastNeed -= buf.length; + } + function utf8Text(buf, i7) { + var total = utf8CheckIncomplete(this, buf, i7); + if (!this.lastNeed) + return buf.toString("utf8", i7); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString("utf8", i7, end); + } + function utf8End(buf) { + var r8 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) + return r8 + "\uFFFD"; + return r8; + } + function utf16Text(buf, i7) { + if ((buf.length - i7) % 2 === 0) { + var r8 = buf.toString("utf16le", i7); + if (r8) { + var c7 = r8.charCodeAt(r8.length - 1); + if (c7 >= 55296 && c7 <= 56319) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r8.slice(0, -1); + } + } + return r8; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString("utf16le", i7, buf.length - 1); + } + function utf16End(buf) { + var r8 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r8 + this.lastChar.toString("utf16le", 0, end); + } + return r8; + } + function base64Text(buf, i7) { + var n7 = (buf.length - i7) % 3; + if (n7 === 0) + return buf.toString("base64", i7); + this.lastNeed = 3 - n7; + this.lastTotal = 3; + if (n7 === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString("base64", i7, buf.length - n7); + } + function base64End(buf) { + var r8 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) + return r8 + this.lastChar.toString("base64", 0, 3 - this.lastNeed); + return r8; + } + function simpleWrite(buf) { + return buf.toString(this.encoding); + } + function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ""; + } + return exports$17; +} +var exports$25, _dewExec$15, exports$17, _dewExec8, exports11, StringDecoder; +var init_chunk_CcCWfKp1 = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtuTasat(); + exports$25 = {}; + _dewExec$15 = false; + exports$17 = {}; + _dewExec8 = false; + exports11 = dew8(); + exports11["StringDecoder"]; + StringDecoder = exports11.StringDecoder; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-tHuMsdT0.js +function o2() { + o2.init.call(this); +} +function u2(e10) { + if ("function" != typeof e10) + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e10); +} +function f2(e10) { + return void 0 === e10._maxListeners ? o2.defaultMaxListeners : e10._maxListeners; +} +function v2(e10, t8, n7, r8) { + var i7, o7, s7, v8; + if (u2(n7), void 0 === (o7 = e10._events) ? (o7 = e10._events = /* @__PURE__ */ Object.create(null), e10._eventsCount = 0) : (void 0 !== o7.newListener && (e10.emit("newListener", t8, n7.listener ? n7.listener : n7), o7 = e10._events), s7 = o7[t8]), void 0 === s7) + s7 = o7[t8] = n7, ++e10._eventsCount; + else if ("function" == typeof s7 ? s7 = o7[t8] = r8 ? [n7, s7] : [s7, n7] : r8 ? s7.unshift(n7) : s7.push(n7), (i7 = f2(e10)) > 0 && s7.length > i7 && !s7.warned) { + s7.warned = true; + var a7 = new Error("Possible EventEmitter memory leak detected. " + s7.length + " " + String(t8) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + a7.name = "MaxListenersExceededWarning", a7.emitter = e10, a7.type = t8, a7.count = s7.length, v8 = a7, console && console.warn && console.warn(v8); + } + return e10; +} +function a2() { + if (!this.fired) + return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments); +} +function l2(e10, t8, n7) { + var r8 = { fired: false, wrapFn: void 0, target: e10, type: t8, listener: n7 }, i7 = a2.bind(r8); + return i7.listener = n7, r8.wrapFn = i7, i7; +} +function h2(e10, t8, n7) { + var r8 = e10._events; + if (void 0 === r8) + return []; + var i7 = r8[t8]; + return void 0 === i7 ? [] : "function" == typeof i7 ? n7 ? [i7.listener || i7] : [i7] : n7 ? function(e11) { + for (var t9 = new Array(e11.length), n8 = 0; n8 < t9.length; ++n8) + t9[n8] = e11[n8].listener || e11[n8]; + return t9; + }(i7) : c2(i7, i7.length); +} +function p2(e10) { + var t8 = this._events; + if (void 0 !== t8) { + var n7 = t8[e10]; + if ("function" == typeof n7) + return 1; + if (void 0 !== n7) + return n7.length; + } + return 0; +} +function c2(e10, t8) { + for (var n7 = new Array(t8), r8 = 0; r8 < t8; ++r8) + n7[r8] = e10[r8]; + return n7; +} +var e2, t2, n2, r2, i2, s2, y; +var init_chunk_tHuMsdT0 = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-tHuMsdT0.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + n2 = "object" == typeof Reflect ? Reflect : null; + r2 = n2 && "function" == typeof n2.apply ? n2.apply : function(e10, t8, n7) { + return Function.prototype.apply.call(e10, t8, n7); + }; + t2 = n2 && "function" == typeof n2.ownKeys ? n2.ownKeys : Object.getOwnPropertySymbols ? function(e10) { + return Object.getOwnPropertyNames(e10).concat(Object.getOwnPropertySymbols(e10)); + } : function(e10) { + return Object.getOwnPropertyNames(e10); + }; + i2 = Number.isNaN || function(e10) { + return e10 != e10; + }; + e2 = o2, o2.EventEmitter = o2, o2.prototype._events = void 0, o2.prototype._eventsCount = 0, o2.prototype._maxListeners = void 0; + s2 = 10; + Object.defineProperty(o2, "defaultMaxListeners", { enumerable: true, get: function() { + return s2; + }, set: function(e10) { + if ("number" != typeof e10 || e10 < 0 || i2(e10)) + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e10 + "."); + s2 = e10; + } }), o2.init = function() { + void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0; + }, o2.prototype.setMaxListeners = function(e10) { + if ("number" != typeof e10 || e10 < 0 || i2(e10)) + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e10 + "."); + return this._maxListeners = e10, this; + }, o2.prototype.getMaxListeners = function() { + return f2(this); + }, o2.prototype.emit = function(e10) { + for (var t8 = [], n7 = 1; n7 < arguments.length; n7++) + t8.push(arguments[n7]); + var i7 = "error" === e10, o7 = this._events; + if (void 0 !== o7) + i7 = i7 && void 0 === o7.error; + else if (!i7) + return false; + if (i7) { + var s7; + if (t8.length > 0 && (s7 = t8[0]), s7 instanceof Error) + throw s7; + var u7 = new Error("Unhandled error." + (s7 ? " (" + s7.message + ")" : "")); + throw u7.context = s7, u7; + } + var f8 = o7[e10]; + if (void 0 === f8) + return false; + if ("function" == typeof f8) + r2(f8, this, t8); + else { + var v8 = f8.length, a7 = c2(f8, v8); + for (n7 = 0; n7 < v8; ++n7) + r2(a7[n7], this, t8); + } + return true; + }, o2.prototype.addListener = function(e10, t8) { + return v2(this, e10, t8, false); + }, o2.prototype.on = o2.prototype.addListener, o2.prototype.prependListener = function(e10, t8) { + return v2(this, e10, t8, true); + }, o2.prototype.once = function(e10, t8) { + return u2(t8), this.on(e10, l2(this, e10, t8)), this; + }, o2.prototype.prependOnceListener = function(e10, t8) { + return u2(t8), this.prependListener(e10, l2(this, e10, t8)), this; + }, o2.prototype.removeListener = function(e10, t8) { + var n7, r8, i7, o7, s7; + if (u2(t8), void 0 === (r8 = this._events)) + return this; + if (void 0 === (n7 = r8[e10])) + return this; + if (n7 === t8 || n7.listener === t8) + 0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete r8[e10], r8.removeListener && this.emit("removeListener", e10, n7.listener || t8)); + else if ("function" != typeof n7) { + for (i7 = -1, o7 = n7.length - 1; o7 >= 0; o7--) + if (n7[o7] === t8 || n7[o7].listener === t8) { + s7 = n7[o7].listener, i7 = o7; + break; + } + if (i7 < 0) + return this; + 0 === i7 ? n7.shift() : !function(e11, t9) { + for (; t9 + 1 < e11.length; t9++) + e11[t9] = e11[t9 + 1]; + e11.pop(); + }(n7, i7), 1 === n7.length && (r8[e10] = n7[0]), void 0 !== r8.removeListener && this.emit("removeListener", e10, s7 || t8); + } + return this; + }, o2.prototype.off = o2.prototype.removeListener, o2.prototype.removeAllListeners = function(e10) { + var t8, n7, r8; + if (void 0 === (n7 = this._events)) + return this; + if (void 0 === n7.removeListener) + return 0 === arguments.length ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : void 0 !== n7[e10] && (0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : delete n7[e10]), this; + if (0 === arguments.length) { + var i7, o7 = Object.keys(n7); + for (r8 = 0; r8 < o7.length; ++r8) + "removeListener" !== (i7 = o7[r8]) && this.removeAllListeners(i7); + return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this; + } + if ("function" == typeof (t8 = n7[e10])) + this.removeListener(e10, t8); + else if (void 0 !== t8) + for (r8 = t8.length - 1; r8 >= 0; r8--) + this.removeListener(e10, t8[r8]); + return this; + }, o2.prototype.listeners = function(e10) { + return h2(this, e10, true); + }, o2.prototype.rawListeners = function(e10) { + return h2(this, e10, false); + }, o2.listenerCount = function(e10, t8) { + return "function" == typeof e10.listenerCount ? e10.listenerCount(t8) : p2.call(e10, t8); + }, o2.prototype.listenerCount = p2, o2.prototype.eventNames = function() { + return this._eventsCount > 0 ? t2(this._events) : []; + }; + y = e2; + y.EventEmitter; + y.defaultMaxListeners; + y.init; + y.listenerCount; + y.EventEmitter; + y.defaultMaxListeners; + y.init; + y.listenerCount; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-DtDiafJB.js +var init_chunk_DtDiafJB = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-DtDiafJB.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_tHuMsdT0(); + y.once = function(emitter, event) { + return new Promise((resolve3, reject2) => { + function eventListener(...args) { + if (errorListener !== void 0) { + emitter.removeListener("error", errorListener); + } + resolve3(args); + } + let errorListener; + if (event !== "error") { + errorListener = (err) => { + emitter.removeListener(name, eventListener); + reject2(err); + }; + emitter.once("error", errorListener); + } + emitter.once(event, eventListener); + }); + }; + y.on = function(emitter, event) { + const unconsumedEventValues = []; + const unconsumedPromises = []; + let error2 = null; + let finished2 = false; + const iterator = { + async next() { + const value2 = unconsumedEventValues.shift(); + if (value2) { + return createIterResult(value2, false); + } + if (error2) { + const p7 = Promise.reject(error2); + error2 = null; + return p7; + } + if (finished2) { + return createIterResult(void 0, true); + } + return new Promise((resolve3, reject2) => unconsumedPromises.push({ resolve: resolve3, reject: reject2 })); + }, + async return() { + emitter.removeListener(event, eventHandler); + emitter.removeListener("error", errorHandler); + finished2 = true; + for (const promise of unconsumedPromises) { + promise.resolve(createIterResult(void 0, true)); + } + return createIterResult(void 0, true); + }, + throw(err) { + error2 = err; + emitter.removeListener(event, eventHandler); + emitter.removeListener("error", errorHandler); + }, + [Symbol.asyncIterator]() { + return this; + } + }; + emitter.on(event, eventHandler); + emitter.on("error", errorHandler); + return iterator; + function eventHandler(...args) { + const promise = unconsumedPromises.shift(); + if (promise) { + promise.resolve(createIterResult(args, false)); + } else { + unconsumedEventValues.push(args); + } + } + function errorHandler(err) { + finished2 = true; + const toError = unconsumedPromises.shift(); + if (toError) { + toError.reject(err); + } else { + error2 = err; + } + iterator.return(); + } + }; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-D3uu3VYh.js +function i$2() { + throw new Error("setTimeout has not been defined"); +} +function u$2() { + throw new Error("clearTimeout has not been defined"); +} +function c$2(e10) { + if (t$3 === setTimeout) + return setTimeout(e10, 0); + if ((t$3 === i$2 || !t$3) && setTimeout) + return t$3 = setTimeout, setTimeout(e10, 0); + try { + return t$3(e10, 0); + } catch (n7) { + try { + return t$3.call(null, e10, 0); + } catch (n8) { + return t$3.call(this || r$2, e10, 0); + } + } +} +function h$1() { + f$1 && l$2 && (f$1 = false, l$2.length ? s$1 = l$2.concat(s$1) : a$1 = -1, s$1.length && d$1()); +} +function d$1() { + if (!f$1) { + var e10 = c$2(h$1); + f$1 = true; + for (var t8 = s$1.length; t8; ) { + for (l$2 = s$1, s$1 = []; ++a$1 < t8; ) + l$2 && l$2[a$1].run(); + a$1 = -1, t8 = s$1.length; + } + l$2 = null, f$1 = false, function(e11) { + if (n$2 === clearTimeout) + return clearTimeout(e11); + if ((n$2 === u$2 || !n$2) && clearTimeout) + return n$2 = clearTimeout, clearTimeout(e11); + try { + n$2(e11); + } catch (t9) { + try { + return n$2.call(null, e11); + } catch (t10) { + return n$2.call(this || r$2, e11); + } + } + }(e10); + } +} +function m$1(e10, t8) { + (this || r$2).fun = e10, (this || r$2).array = t8; +} +function p$1() { +} +function c$1(e10) { + return e10.call.bind(e10); +} +function O2(e10, t8) { + if ("object" != typeof e10) + return false; + try { + return t8(e10), true; + } catch (e11) { + return false; + } +} +function S2(e10) { + return l$1 && y2 ? void 0 !== b3(e10) : B2(e10) || k2(e10) || E2(e10) || D2(e10) || U2(e10) || P2(e10) || x3(e10) || I2(e10) || M2(e10) || z2(e10) || F2(e10); +} +function B2(e10) { + return l$1 && y2 ? "Uint8Array" === b3(e10) : "[object Uint8Array]" === m2(e10) || u$1(e10) && void 0 !== e10.buffer; +} +function k2(e10) { + return l$1 && y2 ? "Uint8ClampedArray" === b3(e10) : "[object Uint8ClampedArray]" === m2(e10); +} +function E2(e10) { + return l$1 && y2 ? "Uint16Array" === b3(e10) : "[object Uint16Array]" === m2(e10); +} +function D2(e10) { + return l$1 && y2 ? "Uint32Array" === b3(e10) : "[object Uint32Array]" === m2(e10); +} +function U2(e10) { + return l$1 && y2 ? "Int8Array" === b3(e10) : "[object Int8Array]" === m2(e10); +} +function P2(e10) { + return l$1 && y2 ? "Int16Array" === b3(e10) : "[object Int16Array]" === m2(e10); +} +function x3(e10) { + return l$1 && y2 ? "Int32Array" === b3(e10) : "[object Int32Array]" === m2(e10); +} +function I2(e10) { + return l$1 && y2 ? "Float32Array" === b3(e10) : "[object Float32Array]" === m2(e10); +} +function M2(e10) { + return l$1 && y2 ? "Float64Array" === b3(e10) : "[object Float64Array]" === m2(e10); +} +function z2(e10) { + return l$1 && y2 ? "BigInt64Array" === b3(e10) : "[object BigInt64Array]" === m2(e10); +} +function F2(e10) { + return l$1 && y2 ? "BigUint64Array" === b3(e10) : "[object BigUint64Array]" === m2(e10); +} +function T2(e10) { + return "[object Map]" === m2(e10); +} +function N2(e10) { + return "[object Set]" === m2(e10); +} +function W2(e10) { + return "[object WeakMap]" === m2(e10); +} +function $2(e10) { + return "[object WeakSet]" === m2(e10); +} +function C2(e10) { + return "[object ArrayBuffer]" === m2(e10); +} +function V2(e10) { + return "undefined" != typeof ArrayBuffer && (C2.working ? C2(e10) : e10 instanceof ArrayBuffer); +} +function G2(e10) { + return "[object DataView]" === m2(e10); +} +function R2(e10) { + return "undefined" != typeof DataView && (G2.working ? G2(e10) : e10 instanceof DataView); +} +function J2(e10) { + return "[object SharedArrayBuffer]" === m2(e10); +} +function _2(e10) { + return "undefined" != typeof SharedArrayBuffer && (J2.working ? J2(e10) : e10 instanceof SharedArrayBuffer); +} +function H2(e10) { + return O2(e10, h3); +} +function Z2(e10) { + return O2(e10, j2); +} +function q2(e10) { + return O2(e10, A2); +} +function K2(e10) { + return s3 && O2(e10, w2); +} +function L2(e10) { + return p3 && O2(e10, v3); +} +function oe2(e10, t8) { + var r8 = { seen: [], stylize: fe2 }; + return arguments.length >= 3 && (r8.depth = arguments[2]), arguments.length >= 4 && (r8.colors = arguments[3]), ye2(t8) ? r8.showHidden = t8 : t8 && X2._extend(r8, t8), be2(r8.showHidden) && (r8.showHidden = false), be2(r8.depth) && (r8.depth = 2), be2(r8.colors) && (r8.colors = false), be2(r8.customInspect) && (r8.customInspect = true), r8.colors && (r8.stylize = ue2), ae2(r8, e10, r8.depth); +} +function ue2(e10, t8) { + var r8 = oe2.styles[t8]; + return r8 ? "\x1B[" + oe2.colors[r8][0] + "m" + e10 + "\x1B[" + oe2.colors[r8][1] + "m" : e10; +} +function fe2(e10, t8) { + return e10; +} +function ae2(e10, t8, r8) { + if (e10.customInspect && t8 && we2(t8.inspect) && t8.inspect !== X2.inspect && (!t8.constructor || t8.constructor.prototype !== t8)) { + var n7 = t8.inspect(r8, e10); + return ge2(n7) || (n7 = ae2(e10, n7, r8)), n7; + } + var i7 = function(e11, t9) { + if (be2(t9)) + return e11.stylize("undefined", "undefined"); + if (ge2(t9)) { + var r9 = "'" + JSON.stringify(t9).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return e11.stylize(r9, "string"); + } + if (de2(t9)) + return e11.stylize("" + t9, "number"); + if (ye2(t9)) + return e11.stylize("" + t9, "boolean"); + if (le2(t9)) + return e11.stylize("null", "null"); + }(e10, t8); + if (i7) + return i7; + var o7 = Object.keys(t8), u7 = function(e11) { + var t9 = {}; + return e11.forEach(function(e12, r9) { + t9[e12] = true; + }), t9; + }(o7); + if (e10.showHidden && (o7 = Object.getOwnPropertyNames(t8)), Ae2(t8) && (o7.indexOf("message") >= 0 || o7.indexOf("description") >= 0)) + return ce2(t8); + if (0 === o7.length) { + if (we2(t8)) { + var f8 = t8.name ? ": " + t8.name : ""; + return e10.stylize("[Function" + f8 + "]", "special"); + } + if (me2(t8)) + return e10.stylize(RegExp.prototype.toString.call(t8), "regexp"); + if (je2(t8)) + return e10.stylize(Date.prototype.toString.call(t8), "date"); + if (Ae2(t8)) + return ce2(t8); + } + var a7, c7 = "", s7 = false, p7 = ["{", "}"]; + (pe2(t8) && (s7 = true, p7 = ["[", "]"]), we2(t8)) && (c7 = " [Function" + (t8.name ? ": " + t8.name : "") + "]"); + return me2(t8) && (c7 = " " + RegExp.prototype.toString.call(t8)), je2(t8) && (c7 = " " + Date.prototype.toUTCString.call(t8)), Ae2(t8) && (c7 = " " + ce2(t8)), 0 !== o7.length || s7 && 0 != t8.length ? r8 < 0 ? me2(t8) ? e10.stylize(RegExp.prototype.toString.call(t8), "regexp") : e10.stylize("[Object]", "special") : (e10.seen.push(t8), a7 = s7 ? function(e11, t9, r9, n8, i8) { + for (var o8 = [], u8 = 0, f9 = t9.length; u8 < f9; ++u8) + ke(t9, String(u8)) ? o8.push(se2(e11, t9, r9, n8, String(u8), true)) : o8.push(""); + return i8.forEach(function(i9) { + i9.match(/^\d+$/) || o8.push(se2(e11, t9, r9, n8, i9, true)); + }), o8; + }(e10, t8, r8, u7, o7) : o7.map(function(n8) { + return se2(e10, t8, r8, u7, n8, s7); + }), e10.seen.pop(), function(e11, t9, r9) { + var n8 = 0; + if (e11.reduce(function(e12, t10) { + return n8++, t10.indexOf("\n") >= 0 && n8++, e12 + t10.replace(/\u001b\[\d\d?m/g, "").length + 1; + }, 0) > 60) + return r9[0] + ("" === t9 ? "" : t9 + "\n ") + " " + e11.join(",\n ") + " " + r9[1]; + return r9[0] + t9 + " " + e11.join(", ") + " " + r9[1]; + }(a7, c7, p7)) : p7[0] + c7 + p7[1]; +} +function ce2(e10) { + return "[" + Error.prototype.toString.call(e10) + "]"; +} +function se2(e10, t8, r8, n7, i7, o7) { + var u7, f8, a7; + if ((a7 = Object.getOwnPropertyDescriptor(t8, i7) || { value: t8[i7] }).get ? f8 = a7.set ? e10.stylize("[Getter/Setter]", "special") : e10.stylize("[Getter]", "special") : a7.set && (f8 = e10.stylize("[Setter]", "special")), ke(n7, i7) || (u7 = "[" + i7 + "]"), f8 || (e10.seen.indexOf(a7.value) < 0 ? (f8 = le2(r8) ? ae2(e10, a7.value, null) : ae2(e10, a7.value, r8 - 1)).indexOf("\n") > -1 && (f8 = o7 ? f8.split("\n").map(function(e11) { + return " " + e11; + }).join("\n").substr(2) : "\n" + f8.split("\n").map(function(e11) { + return " " + e11; + }).join("\n")) : f8 = e10.stylize("[Circular]", "special")), be2(u7)) { + if (o7 && i7.match(/^\d+$/)) + return f8; + (u7 = JSON.stringify("" + i7)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (u7 = u7.substr(1, u7.length - 2), u7 = e10.stylize(u7, "name")) : (u7 = u7.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), u7 = e10.stylize(u7, "string")); + } + return u7 + ": " + f8; +} +function pe2(e10) { + return Array.isArray(e10); +} +function ye2(e10) { + return "boolean" == typeof e10; +} +function le2(e10) { + return null === e10; +} +function de2(e10) { + return "number" == typeof e10; +} +function ge2(e10) { + return "string" == typeof e10; +} +function be2(e10) { + return void 0 === e10; +} +function me2(e10) { + return he2(e10) && "[object RegExp]" === ve2(e10); +} +function he2(e10) { + return "object" == typeof e10 && null !== e10; +} +function je2(e10) { + return he2(e10) && "[object Date]" === ve2(e10); +} +function Ae2(e10) { + return he2(e10) && ("[object Error]" === ve2(e10) || e10 instanceof Error); +} +function we2(e10) { + return "function" == typeof e10; +} +function ve2(e10) { + return Object.prototype.toString.call(e10); +} +function Oe2(e10) { + return e10 < 10 ? "0" + e10.toString(10) : e10.toString(10); +} +function Be() { + var e10 = /* @__PURE__ */ new Date(), t8 = [Oe2(e10.getHours()), Oe2(e10.getMinutes()), Oe2(e10.getSeconds())].join(":"); + return [e10.getDate(), Se2[e10.getMonth()], t8].join(" "); +} +function ke(e10, t8) { + return Object.prototype.hasOwnProperty.call(e10, t8); +} +function De(e10, t8) { + if (!e10) { + var r8 = new Error("Promise was rejected with a falsy value"); + r8.reason = e10, e10 = r8; + } + return t8(e10); +} +var e$2, t$3, n$2, r$2, o$3, l$2, s$1, f$1, a$1, T$1, t3, e3, o3, n3, r3, l3, t$1, o$1, n$1, e$1, r$1, c3, u3, i3, t$2, i$1, o$2, u$1, f3, a3, s3, p3, y2, l$1, d2, m2, h3, j2, A2, Q2, X2, Y2, ee2, te2, re2, ne2, ie3, Se2, Ee2, promisify2; +var init_chunk_D3uu3VYh = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-D3uu3VYh.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + r$2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + o$3 = e$2 = {}; + !function() { + try { + t$3 = "function" == typeof setTimeout ? setTimeout : i$2; + } catch (e10) { + t$3 = i$2; + } + try { + n$2 = "function" == typeof clearTimeout ? clearTimeout : u$2; + } catch (e10) { + n$2 = u$2; + } + }(); + s$1 = []; + f$1 = false; + a$1 = -1; + o$3.nextTick = function(e10) { + var t8 = new Array(arguments.length - 1); + if (arguments.length > 1) + for (var n7 = 1; n7 < arguments.length; n7++) + t8[n7 - 1] = arguments[n7]; + s$1.push(new m$1(e10, t8)), 1 !== s$1.length || f$1 || c$2(d$1); + }, m$1.prototype.run = function() { + (this || r$2).fun.apply(null, (this || r$2).array); + }, o$3.title = "browser", o$3.browser = true, o$3.env = {}, o$3.argv = [], o$3.version = "", o$3.versions = {}, o$3.on = p$1, o$3.addListener = p$1, o$3.once = p$1, o$3.off = p$1, o$3.removeListener = p$1, o$3.removeAllListeners = p$1, o$3.emit = p$1, o$3.prependListener = p$1, o$3.prependOnceListener = p$1, o$3.listeners = function(e10) { + return []; + }, o$3.binding = function(e10) { + throw new Error("process.binding is not supported"); + }, o$3.cwd = function() { + return "/"; + }, o$3.chdir = function(e10) { + throw new Error("process.chdir is not supported"); + }, o$3.umask = function() { + return 0; + }; + T$1 = e$2; + T$1.addListener; + T$1.argv; + T$1.binding; + T$1.browser; + T$1.chdir; + T$1.cwd; + T$1.emit; + T$1.env; + T$1.listeners; + T$1.nextTick; + T$1.off; + T$1.on; + T$1.once; + T$1.prependListener; + T$1.prependOnceListener; + T$1.removeAllListeners; + T$1.removeListener; + T$1.title; + T$1.umask; + T$1.version; + T$1.versions; + t3 = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag; + e3 = Object.prototype.toString; + o3 = function(o7) { + return !(t3 && o7 && "object" == typeof o7 && Symbol.toStringTag in o7) && "[object Arguments]" === e3.call(o7); + }; + n3 = function(t8) { + return !!o3(t8) || null !== t8 && "object" == typeof t8 && "number" == typeof t8.length && t8.length >= 0 && "[object Array]" !== e3.call(t8) && "[object Function]" === e3.call(t8.callee); + }; + r3 = function() { + return o3(arguments); + }(); + o3.isLegacyArguments = n3; + l3 = r3 ? o3 : n3; + t$1 = Object.prototype.toString; + o$1 = Function.prototype.toString; + n$1 = /^\s*(?:function)?\*/; + e$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.toStringTag; + r$1 = Object.getPrototypeOf; + c3 = function() { + if (!e$1) + return false; + try { + return Function("return function*() {}")(); + } catch (t8) { + } + }(); + u3 = c3 ? r$1(c3) : {}; + i3 = function(c7) { + return "function" == typeof c7 && (!!n$1.test(o$1.call(c7)) || (e$1 ? r$1(c7) === u3 : "[object GeneratorFunction]" === t$1.call(c7))); + }; + t$2 = "function" == typeof Object.create ? function(t8, e10) { + e10 && (t8.super_ = e10, t8.prototype = Object.create(e10.prototype, { constructor: { value: t8, enumerable: false, writable: true, configurable: true } })); + } : function(t8, e10) { + if (e10) { + t8.super_ = e10; + var o7 = function() { + }; + o7.prototype = e10.prototype, t8.prototype = new o7(), t8.prototype.constructor = t8; + } + }; + i$1 = function(e10) { + return e10 && "object" == typeof e10 && "function" == typeof e10.copy && "function" == typeof e10.fill && "function" == typeof e10.readUInt8; + }; + o$2 = {}; + u$1 = i$1; + f3 = l3; + a3 = i3; + s3 = "undefined" != typeof BigInt; + p3 = "undefined" != typeof Symbol; + y2 = p3 && void 0 !== Symbol.toStringTag; + l$1 = "undefined" != typeof Uint8Array; + d2 = "undefined" != typeof ArrayBuffer; + if (l$1 && y2) + var g2 = Object.getPrototypeOf(Uint8Array.prototype), b3 = c$1(Object.getOwnPropertyDescriptor(g2, Symbol.toStringTag).get); + m2 = c$1(Object.prototype.toString); + h3 = c$1(Number.prototype.valueOf); + j2 = c$1(String.prototype.valueOf); + A2 = c$1(Boolean.prototype.valueOf); + if (s3) + var w2 = c$1(BigInt.prototype.valueOf); + if (p3) + var v3 = c$1(Symbol.prototype.valueOf); + o$2.isArgumentsObject = f3, o$2.isGeneratorFunction = a3, o$2.isPromise = function(e10) { + return "undefined" != typeof Promise && e10 instanceof Promise || null !== e10 && "object" == typeof e10 && "function" == typeof e10.then && "function" == typeof e10.catch; + }, o$2.isArrayBufferView = function(e10) { + return d2 && ArrayBuffer.isView ? ArrayBuffer.isView(e10) : S2(e10) || R2(e10); + }, o$2.isTypedArray = S2, o$2.isUint8Array = B2, o$2.isUint8ClampedArray = k2, o$2.isUint16Array = E2, o$2.isUint32Array = D2, o$2.isInt8Array = U2, o$2.isInt16Array = P2, o$2.isInt32Array = x3, o$2.isFloat32Array = I2, o$2.isFloat64Array = M2, o$2.isBigInt64Array = z2, o$2.isBigUint64Array = F2, T2.working = "undefined" != typeof Map && T2(/* @__PURE__ */ new Map()), o$2.isMap = function(e10) { + return "undefined" != typeof Map && (T2.working ? T2(e10) : e10 instanceof Map); + }, N2.working = "undefined" != typeof Set && N2(/* @__PURE__ */ new Set()), o$2.isSet = function(e10) { + return "undefined" != typeof Set && (N2.working ? N2(e10) : e10 instanceof Set); + }, W2.working = "undefined" != typeof WeakMap && W2(/* @__PURE__ */ new WeakMap()), o$2.isWeakMap = function(e10) { + return "undefined" != typeof WeakMap && (W2.working ? W2(e10) : e10 instanceof WeakMap); + }, $2.working = "undefined" != typeof WeakSet && $2(/* @__PURE__ */ new WeakSet()), o$2.isWeakSet = function(e10) { + return $2(e10); + }, C2.working = "undefined" != typeof ArrayBuffer && C2(new ArrayBuffer()), o$2.isArrayBuffer = V2, G2.working = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView && G2(new DataView(new ArrayBuffer(1), 0, 1)), o$2.isDataView = R2, J2.working = "undefined" != typeof SharedArrayBuffer && J2(new SharedArrayBuffer()), o$2.isSharedArrayBuffer = _2, o$2.isAsyncFunction = function(e10) { + return "[object AsyncFunction]" === m2(e10); + }, o$2.isMapIterator = function(e10) { + return "[object Map Iterator]" === m2(e10); + }, o$2.isSetIterator = function(e10) { + return "[object Set Iterator]" === m2(e10); + }, o$2.isGeneratorObject = function(e10) { + return "[object Generator]" === m2(e10); + }, o$2.isWebAssemblyCompiledModule = function(e10) { + return "[object WebAssembly.Module]" === m2(e10); + }, o$2.isNumberObject = H2, o$2.isStringObject = Z2, o$2.isBooleanObject = q2, o$2.isBigIntObject = K2, o$2.isSymbolObject = L2, o$2.isBoxedPrimitive = function(e10) { + return H2(e10) || Z2(e10) || q2(e10) || K2(e10) || L2(e10); + }, o$2.isAnyArrayBuffer = function(e10) { + return l$1 && (V2(e10) || _2(e10)); + }, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(e10) { + Object.defineProperty(o$2, e10, { enumerable: false, value: function() { + throw new Error(e10 + " is not supported in userland"); + } }); + }); + Q2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + X2 = {}; + Y2 = T$1; + ee2 = Object.getOwnPropertyDescriptors || function(e10) { + for (var t8 = Object.keys(e10), r8 = {}, n7 = 0; n7 < t8.length; n7++) + r8[t8[n7]] = Object.getOwnPropertyDescriptor(e10, t8[n7]); + return r8; + }; + te2 = /%[sdj%]/g; + X2.format = function(e10) { + if (!ge2(e10)) { + for (var t8 = [], r8 = 0; r8 < arguments.length; r8++) + t8.push(oe2(arguments[r8])); + return t8.join(" "); + } + r8 = 1; + for (var n7 = arguments, i7 = n7.length, o7 = String(e10).replace(te2, function(e11) { + if ("%%" === e11) + return "%"; + if (r8 >= i7) + return e11; + switch (e11) { + case "%s": + return String(n7[r8++]); + case "%d": + return Number(n7[r8++]); + case "%j": + try { + return JSON.stringify(n7[r8++]); + } catch (e12) { + return "[Circular]"; + } + default: + return e11; + } + }), u7 = n7[r8]; r8 < i7; u7 = n7[++r8]) + le2(u7) || !he2(u7) ? o7 += " " + u7 : o7 += " " + oe2(u7); + return o7; + }, X2.deprecate = function(e10, t8) { + if (void 0 !== Y2 && true === Y2.noDeprecation) + return e10; + if (void 0 === Y2) + return function() { + return X2.deprecate(e10, t8).apply(this || Q2, arguments); + }; + var r8 = false; + return function() { + if (!r8) { + if (Y2.throwDeprecation) + throw new Error(t8); + Y2.traceDeprecation ? console.trace(t8) : console.error(t8), r8 = true; + } + return e10.apply(this || Q2, arguments); + }; + }; + re2 = {}; + ne2 = /^$/; + if (Y2.env.NODE_DEBUG) { + ie3 = Y2.env.NODE_DEBUG; + ie3 = ie3.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(), ne2 = new RegExp("^" + ie3 + "$", "i"); + } + X2.debuglog = function(e10) { + if (e10 = e10.toUpperCase(), !re2[e10]) + if (ne2.test(e10)) { + var t8 = Y2.pid; + re2[e10] = function() { + var r8 = X2.format.apply(X2, arguments); + console.error("%s %d: %s", e10, t8, r8); + }; + } else + re2[e10] = function() { + }; + return re2[e10]; + }, X2.inspect = oe2, oe2.colors = { bold: [1, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], white: [37, 39], grey: [90, 39], black: [30, 39], blue: [34, 39], cyan: [36, 39], green: [32, 39], magenta: [35, 39], red: [31, 39], yellow: [33, 39] }, oe2.styles = { special: "cyan", number: "yellow", boolean: "yellow", undefined: "grey", null: "bold", string: "green", date: "magenta", regexp: "red" }, X2.types = o$2, X2.isArray = pe2, X2.isBoolean = ye2, X2.isNull = le2, X2.isNullOrUndefined = function(e10) { + return null == e10; + }, X2.isNumber = de2, X2.isString = ge2, X2.isSymbol = function(e10) { + return "symbol" == typeof e10; + }, X2.isUndefined = be2, X2.isRegExp = me2, X2.types.isRegExp = me2, X2.isObject = he2, X2.isDate = je2, X2.types.isDate = je2, X2.isError = Ae2, X2.types.isNativeError = Ae2, X2.isFunction = we2, X2.isPrimitive = function(e10) { + return null === e10 || "boolean" == typeof e10 || "number" == typeof e10 || "string" == typeof e10 || "symbol" == typeof e10 || void 0 === e10; + }, X2.isBuffer = i$1; + Se2 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + X2.log = function() { + console.log("%s - %s", Be(), X2.format.apply(X2, arguments)); + }, X2.inherits = t$2, X2._extend = function(e10, t8) { + if (!t8 || !he2(t8)) + return e10; + for (var r8 = Object.keys(t8), n7 = r8.length; n7--; ) + e10[r8[n7]] = t8[r8[n7]]; + return e10; + }; + Ee2 = "undefined" != typeof Symbol ? Symbol("util.promisify.custom") : void 0; + X2.promisify = function(e10) { + if ("function" != typeof e10) + throw new TypeError('The "original" argument must be of type Function'); + if (Ee2 && e10[Ee2]) { + var t8; + if ("function" != typeof (t8 = e10[Ee2])) + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + return Object.defineProperty(t8, Ee2, { value: t8, enumerable: false, writable: false, configurable: true }), t8; + } + function t8() { + for (var t9, r8, n7 = new Promise(function(e11, n8) { + t9 = e11, r8 = n8; + }), i7 = [], o7 = 0; o7 < arguments.length; o7++) + i7.push(arguments[o7]); + i7.push(function(e11, n8) { + e11 ? r8(e11) : t9(n8); + }); + try { + e10.apply(this || Q2, i7); + } catch (e11) { + r8(e11); + } + return n7; + } + return Object.setPrototypeOf(t8, Object.getPrototypeOf(e10)), Ee2 && Object.defineProperty(t8, Ee2, { value: t8, enumerable: false, writable: false, configurable: true }), Object.defineProperties(t8, ee2(e10)); + }, X2.promisify.custom = Ee2, X2.callbackify = function(e10) { + if ("function" != typeof e10) + throw new TypeError('The "original" argument must be of type Function'); + function t8() { + for (var t9 = [], r8 = 0; r8 < arguments.length; r8++) + t9.push(arguments[r8]); + var n7 = t9.pop(); + if ("function" != typeof n7) + throw new TypeError("The last argument must be of type Function"); + var i7 = this || Q2, o7 = function() { + return n7.apply(i7, arguments); + }; + e10.apply(this || Q2, t9).then(function(e11) { + Y2.nextTick(o7.bind(null, null, e11)); + }, function(e11) { + Y2.nextTick(De.bind(null, e11, o7)); + }); + } + return Object.setPrototypeOf(t8, Object.getPrototypeOf(e10)), Object.defineProperties(t8, ee2(e10)), t8; + }; + X2._extend; + X2.callbackify; + X2.debuglog; + X2.deprecate; + X2.format; + X2.inherits; + X2.inspect; + X2.isArray; + X2.isBoolean; + X2.isBuffer; + X2.isDate; + X2.isError; + X2.isFunction; + X2.isNull; + X2.isNullOrUndefined; + X2.isNumber; + X2.isObject; + X2.isPrimitive; + X2.isRegExp; + X2.isString; + X2.isSymbol; + X2.isUndefined; + X2.log; + X2.promisify; + X2._extend; + X2.callbackify; + X2.debuglog; + X2.deprecate; + X2.format; + X2.inherits; + X2.inspect; + X2.isArray; + X2.isBoolean; + X2.isBuffer; + X2.isDate; + X2.isError; + X2.isFunction; + X2.isNull; + X2.isNullOrUndefined; + X2.isNumber; + X2.isObject; + X2.isPrimitive; + X2.isRegExp; + X2.isString; + X2.isSymbol; + X2.isUndefined; + X2.log; + promisify2 = X2.promisify; + X2.types; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-b0rmRow7.js +function dew9() { + if (_dewExec9) + return exports12; + _dewExec9 = true; + var process5 = exports12 = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error("setTimeout has not been defined"); + } + function defaultClearTimeout() { + throw new Error("clearTimeout has not been defined"); + } + (function() { + try { + if (typeof setTimeout === "function") { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e10) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === "function") { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e10) { + cachedClearTimeout = defaultClearTimeout; + } + })(); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e10) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e11) { + return cachedSetTimeout.call(this || _global3, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e10) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e11) { + return cachedClearTimeout.call(this || _global3, marker); + } + } + } + var queue3 = []; + var draining3 = false; + var currentQueue3; + var queueIndex3 = -1; + function cleanUpNextTick3() { + if (!draining3 || !currentQueue3) { + return; + } + draining3 = false; + if (currentQueue3.length) { + queue3 = currentQueue3.concat(queue3); + } else { + queueIndex3 = -1; + } + if (queue3.length) { + drainQueue3(); + } + } + function drainQueue3() { + if (draining3) { + return; + } + var timeout = runTimeout(cleanUpNextTick3); + draining3 = true; + var len = queue3.length; + while (len) { + currentQueue3 = queue3; + queue3 = []; + while (++queueIndex3 < len) { + if (currentQueue3) { + currentQueue3[queueIndex3].run(); + } + } + queueIndex3 = -1; + len = queue3.length; + } + currentQueue3 = null; + draining3 = false; + runClearTimeout(timeout); + } + process5.nextTick = function(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i7 = 1; i7 < arguments.length; i7++) { + args[i7 - 1] = arguments[i7]; + } + } + queue3.push(new Item3(fun, args)); + if (queue3.length === 1 && !draining3) { + runTimeout(drainQueue3); + } + }; + function Item3(fun, array) { + (this || _global3).fun = fun; + (this || _global3).array = array; + } + Item3.prototype.run = function() { + (this || _global3).fun.apply(null, (this || _global3).array); + }; + process5.title = "browser"; + process5.browser = true; + process5.env = {}; + process5.argv = []; + process5.version = ""; + process5.versions = {}; + function noop4() { + } + process5.on = noop4; + process5.addListener = noop4; + process5.once = noop4; + process5.off = noop4; + process5.removeListener = noop4; + process5.removeAllListeners = noop4; + process5.emit = noop4; + process5.prependListener = noop4; + process5.prependOnceListener = noop4; + process5.listeners = function(name2) { + return []; + }; + process5.binding = function(name2) { + throw new Error("process.binding is not supported"); + }; + process5.cwd = function() { + return "/"; + }; + process5.chdir = function(dir2) { + throw new Error("process.chdir is not supported"); + }; + process5.umask = function() { + return 0; + }; + return exports12; +} +var exports12, _dewExec9, _global3, process4; +var init_chunk_b0rmRow7 = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-b0rmRow7.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports12 = {}; + _dewExec9 = false; + _global3 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + process4 = dew9(); + process4.platform = "browser"; + process4.addListener; + process4.argv; + process4.binding; + process4.browser; + process4.chdir; + process4.cwd; + process4.emit; + process4.env; + process4.listeners; + process4.nextTick; + process4.off; + process4.on; + process4.once; + process4.prependListener; + process4.prependOnceListener; + process4.removeAllListeners; + process4.removeListener; + process4.title; + process4.umask; + process4.version; + process4.versions; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-B738Er4n.js +function u$22(r8) { + var t8 = r8.length; + if (t8 % 4 > 0) + throw new Error("Invalid string. Length must be a multiple of 4"); + var e10 = r8.indexOf("="); + return -1 === e10 && (e10 = t8), [e10, e10 === t8 ? 0 : 4 - e10 % 4]; +} +function c$12(r8, e10, n7) { + for (var o7, a7, h8 = [], u7 = e10; u7 < n7; u7 += 3) + o7 = (r8[u7] << 16 & 16711680) + (r8[u7 + 1] << 8 & 65280) + (255 & r8[u7 + 2]), h8.push(t$15[(a7 = o7) >> 18 & 63] + t$15[a7 >> 12 & 63] + t$15[a7 >> 6 & 63] + t$15[63 & a7]); + return h8.join(""); +} +function f$2(t8) { + if (t8 > 2147483647) + throw new RangeError('The value "' + t8 + '" is invalid for option "size"'); + var r8 = new Uint8Array(t8); + return Object.setPrototypeOf(r8, u$1$1.prototype), r8; +} +function u$1$1(t8, r8, e10) { + if ("number" == typeof t8) { + if ("string" == typeof r8) + throw new TypeError('The "string" argument must be of type string. Received type number'); + return a$2(t8); + } + return s$12(t8, r8, e10); +} +function s$12(t8, r8, e10) { + if ("string" == typeof t8) + return function(t9, r9) { + "string" == typeof r9 && "" !== r9 || (r9 = "utf8"); + if (!u$1$1.isEncoding(r9)) + throw new TypeError("Unknown encoding: " + r9); + var e11 = 0 | y3(t9, r9), n8 = f$2(e11), i8 = n8.write(t9, r9); + i8 !== e11 && (n8 = n8.slice(0, i8)); + return n8; + }(t8, r8); + if (ArrayBuffer.isView(t8)) + return p4(t8); + if (null == t8) + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t8); + if (F3(t8, ArrayBuffer) || t8 && F3(t8.buffer, ArrayBuffer)) + return c$1$1(t8, r8, e10); + if ("undefined" != typeof SharedArrayBuffer && (F3(t8, SharedArrayBuffer) || t8 && F3(t8.buffer, SharedArrayBuffer))) + return c$1$1(t8, r8, e10); + if ("number" == typeof t8) + throw new TypeError('The "value" argument must not be of type number. Received type number'); + var n7 = t8.valueOf && t8.valueOf(); + if (null != n7 && n7 !== t8) + return u$1$1.from(n7, r8, e10); + var i7 = function(t9) { + if (u$1$1.isBuffer(t9)) { + var r9 = 0 | l$12(t9.length), e11 = f$2(r9); + return 0 === e11.length || t9.copy(e11, 0, 0, r9), e11; + } + if (void 0 !== t9.length) + return "number" != typeof t9.length || N3(t9.length) ? f$2(0) : p4(t9); + if ("Buffer" === t9.type && Array.isArray(t9.data)) + return p4(t9.data); + }(t8); + if (i7) + return i7; + if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t8[Symbol.toPrimitive]) + return u$1$1.from(t8[Symbol.toPrimitive]("string"), r8, e10); + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t8); +} +function h$1$1(t8) { + if ("number" != typeof t8) + throw new TypeError('"size" argument must be of type number'); + if (t8 < 0) + throw new RangeError('The value "' + t8 + '" is invalid for option "size"'); +} +function a$2(t8) { + return h$1$1(t8), f$2(t8 < 0 ? 0 : 0 | l$12(t8)); +} +function p4(t8) { + for (var r8 = t8.length < 0 ? 0 : 0 | l$12(t8.length), e10 = f$2(r8), n7 = 0; n7 < r8; n7 += 1) + e10[n7] = 255 & t8[n7]; + return e10; +} +function c$1$1(t8, r8, e10) { + if (r8 < 0 || t8.byteLength < r8) + throw new RangeError('"offset" is outside of buffer bounds'); + if (t8.byteLength < r8 + (e10 || 0)) + throw new RangeError('"length" is outside of buffer bounds'); + var n7; + return n7 = void 0 === r8 && void 0 === e10 ? new Uint8Array(t8) : void 0 === e10 ? new Uint8Array(t8, r8) : new Uint8Array(t8, r8, e10), Object.setPrototypeOf(n7, u$1$1.prototype), n7; +} +function l$12(t8) { + if (t8 >= 2147483647) + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + 2147483647 .toString(16) + " bytes"); + return 0 | t8; +} +function y3(t8, r8) { + if (u$1$1.isBuffer(t8)) + return t8.length; + if (ArrayBuffer.isView(t8) || F3(t8, ArrayBuffer)) + return t8.byteLength; + if ("string" != typeof t8) + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof t8); + var e10 = t8.length, n7 = arguments.length > 2 && true === arguments[2]; + if (!n7 && 0 === e10) + return 0; + for (var i7 = false; ; ) + switch (r8) { + case "ascii": + case "latin1": + case "binary": + return e10; + case "utf8": + case "utf-8": + return _3(t8).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return 2 * e10; + case "hex": + return e10 >>> 1; + case "base64": + return z3(t8).length; + default: + if (i7) + return n7 ? -1 : _3(t8).length; + r8 = ("" + r8).toLowerCase(), i7 = true; + } +} +function g3(t8, r8, e10) { + var n7 = false; + if ((void 0 === r8 || r8 < 0) && (r8 = 0), r8 > this.length) + return ""; + if ((void 0 === e10 || e10 > this.length) && (e10 = this.length), e10 <= 0) + return ""; + if ((e10 >>>= 0) <= (r8 >>>= 0)) + return ""; + for (t8 || (t8 = "utf8"); ; ) + switch (t8) { + case "hex": + return O3(this, r8, e10); + case "utf8": + case "utf-8": + return I3(this, r8, e10); + case "ascii": + return S3(this, r8, e10); + case "latin1": + case "binary": + return R3(this, r8, e10); + case "base64": + return T3(this, r8, e10); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return L3(this, r8, e10); + default: + if (n7) + throw new TypeError("Unknown encoding: " + t8); + t8 = (t8 + "").toLowerCase(), n7 = true; + } +} +function w3(t8, r8, e10) { + var n7 = t8[r8]; + t8[r8] = t8[e10], t8[e10] = n7; +} +function d3(t8, r8, e10, n7, i7) { + if (0 === t8.length) + return -1; + if ("string" == typeof e10 ? (n7 = e10, e10 = 0) : e10 > 2147483647 ? e10 = 2147483647 : e10 < -2147483648 && (e10 = -2147483648), N3(e10 = +e10) && (e10 = i7 ? 0 : t8.length - 1), e10 < 0 && (e10 = t8.length + e10), e10 >= t8.length) { + if (i7) + return -1; + e10 = t8.length - 1; + } else if (e10 < 0) { + if (!i7) + return -1; + e10 = 0; + } + if ("string" == typeof r8 && (r8 = u$1$1.from(r8, n7)), u$1$1.isBuffer(r8)) + return 0 === r8.length ? -1 : v4(t8, r8, e10, n7, i7); + if ("number" == typeof r8) + return r8 &= 255, "function" == typeof Uint8Array.prototype.indexOf ? i7 ? Uint8Array.prototype.indexOf.call(t8, r8, e10) : Uint8Array.prototype.lastIndexOf.call(t8, r8, e10) : v4(t8, [r8], e10, n7, i7); + throw new TypeError("val must be string, number or Buffer"); +} +function v4(t8, r8, e10, n7, i7) { + var o7, f8 = 1, u7 = t8.length, s7 = r8.length; + if (void 0 !== n7 && ("ucs2" === (n7 = String(n7).toLowerCase()) || "ucs-2" === n7 || "utf16le" === n7 || "utf-16le" === n7)) { + if (t8.length < 2 || r8.length < 2) + return -1; + f8 = 2, u7 /= 2, s7 /= 2, e10 /= 2; + } + function h8(t9, r9) { + return 1 === f8 ? t9[r9] : t9.readUInt16BE(r9 * f8); + } + if (i7) { + var a7 = -1; + for (o7 = e10; o7 < u7; o7++) + if (h8(t8, o7) === h8(r8, -1 === a7 ? 0 : o7 - a7)) { + if (-1 === a7 && (a7 = o7), o7 - a7 + 1 === s7) + return a7 * f8; + } else + -1 !== a7 && (o7 -= o7 - a7), a7 = -1; + } else + for (e10 + s7 > u7 && (e10 = u7 - s7), o7 = e10; o7 >= 0; o7--) { + for (var p7 = true, c7 = 0; c7 < s7; c7++) + if (h8(t8, o7 + c7) !== h8(r8, c7)) { + p7 = false; + break; + } + if (p7) + return o7; + } + return -1; +} +function b4(t8, r8, e10, n7) { + e10 = Number(e10) || 0; + var i7 = t8.length - e10; + n7 ? (n7 = Number(n7)) > i7 && (n7 = i7) : n7 = i7; + var o7 = r8.length; + n7 > o7 / 2 && (n7 = o7 / 2); + for (var f8 = 0; f8 < n7; ++f8) { + var u7 = parseInt(r8.substr(2 * f8, 2), 16); + if (N3(u7)) + return f8; + t8[e10 + f8] = u7; + } + return f8; +} +function m3(t8, r8, e10, n7) { + return D3(_3(r8, t8.length - e10), t8, e10, n7); +} +function E3(t8, r8, e10, n7) { + return D3(function(t9) { + for (var r9 = [], e11 = 0; e11 < t9.length; ++e11) + r9.push(255 & t9.charCodeAt(e11)); + return r9; + }(r8), t8, e10, n7); +} +function B3(t8, r8, e10, n7) { + return E3(t8, r8, e10, n7); +} +function A3(t8, r8, e10, n7) { + return D3(z3(r8), t8, e10, n7); +} +function U3(t8, r8, e10, n7) { + return D3(function(t9, r9) { + for (var e11, n8, i7, o7 = [], f8 = 0; f8 < t9.length && !((r9 -= 2) < 0); ++f8) + e11 = t9.charCodeAt(f8), n8 = e11 >> 8, i7 = e11 % 256, o7.push(i7), o7.push(n8); + return o7; + }(r8, t8.length - e10), t8, e10, n7); +} +function T3(t8, r8, e10) { + return 0 === r8 && e10 === t8.length ? n$1$1.fromByteArray(t8) : n$1$1.fromByteArray(t8.slice(r8, e10)); +} +function I3(t8, r8, e10) { + e10 = Math.min(t8.length, e10); + for (var n7 = [], i7 = r8; i7 < e10; ) { + var o7, f8, u7, s7, h8 = t8[i7], a7 = null, p7 = h8 > 239 ? 4 : h8 > 223 ? 3 : h8 > 191 ? 2 : 1; + if (i7 + p7 <= e10) + switch (p7) { + case 1: + h8 < 128 && (a7 = h8); + break; + case 2: + 128 == (192 & (o7 = t8[i7 + 1])) && (s7 = (31 & h8) << 6 | 63 & o7) > 127 && (a7 = s7); + break; + case 3: + o7 = t8[i7 + 1], f8 = t8[i7 + 2], 128 == (192 & o7) && 128 == (192 & f8) && (s7 = (15 & h8) << 12 | (63 & o7) << 6 | 63 & f8) > 2047 && (s7 < 55296 || s7 > 57343) && (a7 = s7); + break; + case 4: + o7 = t8[i7 + 1], f8 = t8[i7 + 2], u7 = t8[i7 + 3], 128 == (192 & o7) && 128 == (192 & f8) && 128 == (192 & u7) && (s7 = (15 & h8) << 18 | (63 & o7) << 12 | (63 & f8) << 6 | 63 & u7) > 65535 && s7 < 1114112 && (a7 = s7); + } + null === a7 ? (a7 = 65533, p7 = 1) : a7 > 65535 && (a7 -= 65536, n7.push(a7 >>> 10 & 1023 | 55296), a7 = 56320 | 1023 & a7), n7.push(a7), i7 += p7; + } + return function(t9) { + var r9 = t9.length; + if (r9 <= 4096) + return String.fromCharCode.apply(String, t9); + var e11 = "", n8 = 0; + for (; n8 < r9; ) + e11 += String.fromCharCode.apply(String, t9.slice(n8, n8 += 4096)); + return e11; + }(n7); +} +function S3(t8, r8, e10) { + var n7 = ""; + e10 = Math.min(t8.length, e10); + for (var i7 = r8; i7 < e10; ++i7) + n7 += String.fromCharCode(127 & t8[i7]); + return n7; +} +function R3(t8, r8, e10) { + var n7 = ""; + e10 = Math.min(t8.length, e10); + for (var i7 = r8; i7 < e10; ++i7) + n7 += String.fromCharCode(t8[i7]); + return n7; +} +function O3(t8, r8, e10) { + var n7 = t8.length; + (!r8 || r8 < 0) && (r8 = 0), (!e10 || e10 < 0 || e10 > n7) && (e10 = n7); + for (var i7 = "", o7 = r8; o7 < e10; ++o7) + i7 += Y3[t8[o7]]; + return i7; +} +function L3(t8, r8, e10) { + for (var n7 = t8.slice(r8, e10), i7 = "", o7 = 0; o7 < n7.length; o7 += 2) + i7 += String.fromCharCode(n7[o7] + 256 * n7[o7 + 1]); + return i7; +} +function x4(t8, r8, e10) { + if (t8 % 1 != 0 || t8 < 0) + throw new RangeError("offset is not uint"); + if (t8 + r8 > e10) + throw new RangeError("Trying to access beyond buffer length"); +} +function C3(t8, r8, e10, n7, i7, o7) { + if (!u$1$1.isBuffer(t8)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (r8 > i7 || r8 < o7) + throw new RangeError('"value" argument is out of bounds'); + if (e10 + n7 > t8.length) + throw new RangeError("Index out of range"); +} +function P3(t8, r8, e10, n7, i7, o7) { + if (e10 + n7 > t8.length) + throw new RangeError("Index out of range"); + if (e10 < 0) + throw new RangeError("Index out of range"); +} +function k3(t8, r8, e10, n7, o7) { + return r8 = +r8, e10 >>>= 0, o7 || P3(t8, 0, e10, 4), i$12.write(t8, r8, e10, n7, 23, 4), e10 + 4; +} +function M3(t8, r8, e10, n7, o7) { + return r8 = +r8, e10 >>>= 0, o7 || P3(t8, 0, e10, 8), i$12.write(t8, r8, e10, n7, 52, 8), e10 + 8; +} +function _3(t8, r8) { + var e10; + r8 = r8 || 1 / 0; + for (var n7 = t8.length, i7 = null, o7 = [], f8 = 0; f8 < n7; ++f8) { + if ((e10 = t8.charCodeAt(f8)) > 55295 && e10 < 57344) { + if (!i7) { + if (e10 > 56319) { + (r8 -= 3) > -1 && o7.push(239, 191, 189); + continue; + } + if (f8 + 1 === n7) { + (r8 -= 3) > -1 && o7.push(239, 191, 189); + continue; + } + i7 = e10; + continue; + } + if (e10 < 56320) { + (r8 -= 3) > -1 && o7.push(239, 191, 189), i7 = e10; + continue; + } + e10 = 65536 + (i7 - 55296 << 10 | e10 - 56320); + } else + i7 && (r8 -= 3) > -1 && o7.push(239, 191, 189); + if (i7 = null, e10 < 128) { + if ((r8 -= 1) < 0) + break; + o7.push(e10); + } else if (e10 < 2048) { + if ((r8 -= 2) < 0) + break; + o7.push(e10 >> 6 | 192, 63 & e10 | 128); + } else if (e10 < 65536) { + if ((r8 -= 3) < 0) + break; + o7.push(e10 >> 12 | 224, e10 >> 6 & 63 | 128, 63 & e10 | 128); + } else { + if (!(e10 < 1114112)) + throw new Error("Invalid code point"); + if ((r8 -= 4) < 0) + break; + o7.push(e10 >> 18 | 240, e10 >> 12 & 63 | 128, e10 >> 6 & 63 | 128, 63 & e10 | 128); + } + } + return o7; +} +function z3(t8) { + return n$1$1.toByteArray(function(t9) { + if ((t9 = (t9 = t9.split("=")[0]).trim().replace(j3, "")).length < 2) + return ""; + for (; t9.length % 4 != 0; ) + t9 += "="; + return t9; + }(t8)); +} +function D3(t8, r8, e10, n7) { + for (var i7 = 0; i7 < n7 && !(i7 + e10 >= r8.length || i7 >= t8.length); ++i7) + r8[i7 + e10] = t8[i7]; + return i7; +} +function F3(t8, r8) { + return t8 instanceof r8 || null != t8 && null != t8.constructor && null != t8.constructor.name && t8.constructor.name === r8.name; +} +function N3(t8) { + return t8 != t8; +} +function t4(r8, e10) { + for (var n7 in r8) + e10[n7] = r8[n7]; +} +function f4(r8, e10, n7) { + return o4(r8, e10, n7); +} +function a4(t8) { + var e10; + switch (this.encoding = function(t9) { + var e11 = function(t10) { + if (!t10) + return "utf8"; + for (var e12; ; ) + switch (t10) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return t10; + default: + if (e12) + return; + t10 = ("" + t10).toLowerCase(), e12 = true; + } + }(t9); + if ("string" != typeof e11 && (s4.isEncoding === i4 || !i4(t9))) + throw new Error("Unknown encoding: " + t9); + return e11 || t9; + }(t8), this.encoding) { + case "utf16le": + this.text = h4, this.end = l4, e10 = 4; + break; + case "utf8": + this.fillLast = n$12, e10 = 4; + break; + case "base64": + this.text = u$12, this.end = o$12, e10 = 3; + break; + default: + return this.write = f$12, this.end = c4, void 0; + } + this.lastNeed = 0, this.lastTotal = 0, this.lastChar = s4.allocUnsafe(e10); +} +function r4(t8) { + return t8 <= 127 ? 0 : t8 >> 5 == 6 ? 2 : t8 >> 4 == 14 ? 3 : t8 >> 3 == 30 ? 4 : t8 >> 6 == 2 ? -1 : -2; +} +function n$12(t8) { + var e10 = this.lastTotal - this.lastNeed, s7 = function(t9, e11, s8) { + if (128 != (192 & e11[0])) + return t9.lastNeed = 0, "\uFFFD"; + if (t9.lastNeed > 1 && e11.length > 1) { + if (128 != (192 & e11[1])) + return t9.lastNeed = 1, "\uFFFD"; + if (t9.lastNeed > 2 && e11.length > 2 && 128 != (192 & e11[2])) + return t9.lastNeed = 2, "\uFFFD"; + } + }(this, t8); + return void 0 !== s7 ? s7 : this.lastNeed <= t8.length ? (t8.copy(this.lastChar, e10, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (t8.copy(this.lastChar, e10, 0, t8.length), this.lastNeed -= t8.length, void 0); +} +function h4(t8, e10) { + if ((t8.length - e10) % 2 == 0) { + var s7 = t8.toString("utf16le", e10); + if (s7) { + var i7 = s7.charCodeAt(s7.length - 1); + if (i7 >= 55296 && i7 <= 56319) + return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = t8[t8.length - 2], this.lastChar[1] = t8[t8.length - 1], s7.slice(0, -1); + } + return s7; + } + return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = t8[t8.length - 1], t8.toString("utf16le", e10, t8.length - 1); +} +function l4(t8) { + var e10 = t8 && t8.length ? this.write(t8) : ""; + if (this.lastNeed) { + var s7 = this.lastTotal - this.lastNeed; + return e10 + this.lastChar.toString("utf16le", 0, s7); + } + return e10; +} +function u$12(t8, e10) { + var s7 = (t8.length - e10) % 3; + return 0 === s7 ? t8.toString("base64", e10) : (this.lastNeed = 3 - s7, this.lastTotal = 3, 1 === s7 ? this.lastChar[0] = t8[t8.length - 1] : (this.lastChar[0] = t8[t8.length - 2], this.lastChar[1] = t8[t8.length - 1]), t8.toString("base64", e10, t8.length - s7)); +} +function o$12(t8) { + var e10 = t8 && t8.length ? this.write(t8) : ""; + return this.lastNeed ? e10 + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : e10; +} +function f$12(t8) { + return t8.toString(this.encoding); +} +function c4(t8) { + return t8 && t8.length ? this.write(t8) : ""; +} +function dew$2$1() { + if (_dewExec$2$1) + return exports$2$1; + _dewExec$2$1 = true; + exports$2$1.byteLength = byteLength; + exports$2$1.toByteArray = toByteArray; + exports$2$1.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (var i7 = 0, len = code.length; i7 < len; ++i7) { + lookup[i7] = code[i7]; + revLookup[code.charCodeAt(i7)] = i7; + } + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 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 i8; + for (i8 = 0; i8 < len2; i8 += 4) { + tmp = revLookup[b64.charCodeAt(i8)] << 18 | revLookup[b64.charCodeAt(i8 + 1)] << 12 | revLookup[b64.charCodeAt(i8 + 2)] << 6 | revLookup[b64.charCodeAt(i8 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i8)] << 2 | revLookup[b64.charCodeAt(i8 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i8)] << 10 | revLookup[b64.charCodeAt(i8 + 1)] << 4 | revLookup[b64.charCodeAt(i8 + 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 i8 = start; i8 < end; i8 += 3) { + tmp = (uint8[i8] << 16 & 16711680) + (uint8[i8 + 1] << 8 & 65280) + (uint8[i8 + 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 i8 = 0, len22 = len2 - extraBytes; i8 < len22; i8 += maxChunkLength) { + parts.push(encodeChunk(uint8, i8, i8 + maxChunkLength > len22 ? len22 : i8 + 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(""); + } + return exports$2$1; +} +function dew$1$1() { + if (_dewExec$1$1) + return exports$1$1; + _dewExec$1$1 = true; + exports$1$1.read = function(buffer2, offset, isLE, mLen, nBytes) { + var e10, m7; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i7 = isLE ? nBytes - 1 : 0; + var d7 = isLE ? -1 : 1; + var s7 = buffer2[offset + i7]; + i7 += d7; + e10 = s7 & (1 << -nBits) - 1; + s7 >>= -nBits; + nBits += eLen; + for (; nBits > 0; e10 = e10 * 256 + buffer2[offset + i7], i7 += d7, nBits -= 8) { + } + m7 = e10 & (1 << -nBits) - 1; + e10 >>= -nBits; + nBits += mLen; + for (; nBits > 0; m7 = m7 * 256 + buffer2[offset + i7], i7 += d7, nBits -= 8) { + } + if (e10 === 0) { + e10 = 1 - eBias; + } else if (e10 === eMax) { + return m7 ? NaN : (s7 ? -1 : 1) * Infinity; + } else { + m7 = m7 + Math.pow(2, mLen); + e10 = e10 - eBias; + } + return (s7 ? -1 : 1) * m7 * Math.pow(2, e10 - mLen); + }; + exports$1$1.write = function(buffer2, value2, offset, isLE, mLen, nBytes) { + var e10, m7, c7; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i7 = isLE ? 0 : nBytes - 1; + var d7 = isLE ? 1 : -1; + var s7 = value2 < 0 || value2 === 0 && 1 / value2 < 0 ? 1 : 0; + value2 = Math.abs(value2); + if (isNaN(value2) || value2 === Infinity) { + m7 = isNaN(value2) ? 1 : 0; + e10 = eMax; + } else { + e10 = Math.floor(Math.log(value2) / Math.LN2); + if (value2 * (c7 = Math.pow(2, -e10)) < 1) { + e10--; + c7 *= 2; + } + if (e10 + eBias >= 1) { + value2 += rt / c7; + } else { + value2 += rt * Math.pow(2, 1 - eBias); + } + if (value2 * c7 >= 2) { + e10++; + c7 /= 2; + } + if (e10 + eBias >= eMax) { + m7 = 0; + e10 = eMax; + } else if (e10 + eBias >= 1) { + m7 = (value2 * c7 - 1) * Math.pow(2, mLen); + e10 = e10 + eBias; + } else { + m7 = value2 * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e10 = 0; + } + } + for (; mLen >= 8; buffer2[offset + i7] = m7 & 255, i7 += d7, m7 /= 256, mLen -= 8) { + } + e10 = e10 << mLen | m7; + eLen += mLen; + for (; eLen > 0; buffer2[offset + i7] = e10 & 255, i7 += d7, e10 /= 256, eLen -= 8) { + } + buffer2[offset + i7 - d7] |= s7 * 128; + }; + return exports$1$1; +} +function dew$g2() { + if (_dewExec$g2) + return exports$g2; + _dewExec$g2 = true; + const base64 = dew$2$1(); + const ieee754 = dew$1$1(); + const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports$g2.Buffer = Buffer4; + exports$g2.SlowBuffer = SlowBuffer2; + exports$g2.INSPECT_MAX_BYTES = 50; + const K_MAX_LENGTH = 2147483647; + exports$g2.kMaxLength = K_MAX_LENGTH; + Buffer4.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer4.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { + console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); + } + function typedArraySupport() { + try { + const arr = new Uint8Array(1); + const proto = { + foo: function() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e10) { + return false; + } + } + Object.defineProperty(Buffer4.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer4.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer4.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer4.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer4.prototype); + return buf; + } + function Buffer4(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe2(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer4.poolSize = 8192; + function from(value2, encodingOrOffset, length) { + if (typeof value2 === "string") { + return fromString(value2, encodingOrOffset); + } + if (ArrayBuffer.isView(value2)) { + return fromArrayView(value2); + } + if (value2 == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + if (isInstance(value2, ArrayBuffer) || value2 && isInstance(value2.buffer, ArrayBuffer)) { + return fromArrayBuffer(value2, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value2, SharedArrayBuffer) || value2 && isInstance(value2.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value2, encodingOrOffset, length); + } + if (typeof value2 === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value2.valueOf && value2.valueOf(); + if (valueOf != null && valueOf !== value2) { + return Buffer4.from(valueOf, encodingOrOffset, length); + } + const b8 = fromObject(value2); + if (b8) + return b8; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value2[Symbol.toPrimitive] === "function") { + return Buffer4.from(value2[Symbol.toPrimitive]("string"), encodingOrOffset, length); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + Buffer4.from = function(value2, encodingOrOffset, length) { + return from(value2, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer4.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer4, Uint8Array); + function assertSize(size2) { + if (typeof size2 !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size2 < 0) { + throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + } + } + function alloc(size2, fill2, encoding) { + assertSize(size2); + if (size2 <= 0) { + return createBuffer(size2); + } + if (fill2 !== void 0) { + return typeof encoding === "string" ? createBuffer(size2).fill(fill2, encoding) : createBuffer(size2).fill(fill2); + } + return createBuffer(size2); + } + Buffer4.alloc = function(size2, fill2, encoding) { + return alloc(size2, fill2, encoding); + }; + function allocUnsafe2(size2) { + assertSize(size2); + return createBuffer(size2 < 0 ? 0 : checked(size2) | 0); + } + Buffer4.allocUnsafe = function(size2) { + return allocUnsafe2(size2); + }; + Buffer4.allocUnsafeSlow = function(size2) { + return allocUnsafe2(size2); + }; + function fromString(string2, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer4.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length = byteLength(string2, encoding) | 0; + let buf = createBuffer(length); + const actual = buf.write(string2, encoding); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i7 = 0; i7 < length; i7 += 1) { + buf[i7] = array[i7] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy4 = new Uint8Array(arrayView); + return fromArrayBuffer(copy4.buffer, copy4.byteOffset, copy4.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array); + } else if (length === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer4.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer4.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer2(length) { + if (+length != length) { + length = 0; + } + return Buffer4.alloc(+length); + } + Buffer4.isBuffer = function isBuffer3(b8) { + return b8 != null && b8._isBuffer === true && b8 !== Buffer4.prototype; + }; + Buffer4.compare = function compare(a7, b8) { + if (isInstance(a7, Uint8Array)) + a7 = Buffer4.from(a7, a7.offset, a7.byteLength); + if (isInstance(b8, Uint8Array)) + b8 = Buffer4.from(b8, b8.offset, b8.byteLength); + if (!Buffer4.isBuffer(a7) || !Buffer4.isBuffer(b8)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a7 === b8) + return 0; + let x7 = a7.length; + let y7 = b8.length; + for (let i7 = 0, len = Math.min(x7, y7); i7 < len; ++i7) { + if (a7[i7] !== b8[i7]) { + x7 = a7[i7]; + y7 = b8[i7]; + break; + } + } + if (x7 < y7) + return -1; + if (y7 < x7) + return 1; + return 0; + }; + Buffer4.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }; + Buffer4.concat = function concat2(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer4.alloc(0); + } + let i7; + if (length === void 0) { + length = 0; + for (i7 = 0; i7 < list.length; ++i7) { + length += list[i7].length; + } + } + const buffer2 = Buffer4.allocUnsafe(length); + let pos = 0; + for (i7 = 0; i7 < list.length; ++i7) { + let buf = list[i7]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer2.length) { + if (!Buffer4.isBuffer(buf)) + buf = Buffer4.from(buf); + buf.copy(buffer2, pos); + } else { + Uint8Array.prototype.set.call(buffer2, buf, pos); + } + } else if (!Buffer4.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer2, pos); + } + pos += buf.length; + } + return buffer2; + }; + function byteLength(string2, encoding) { + if (Buffer4.isBuffer(string2)) { + return string2.length; + } + if (ArrayBuffer.isView(string2) || isInstance(string2, ArrayBuffer)) { + return string2.byteLength; + } + if (typeof string2 !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string2); + } + const len = string2.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string2).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string2).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string2).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer4.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer4.prototype._isBuffer = true; + function swap(b8, n7, m7) { + const i7 = b8[n7]; + b8[n7] = b8[m7]; + b8[m7] = i7; + } + Buffer4.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i7 = 0; i7 < len; i7 += 2) { + swap(this, i7, i7 + 1); + } + return this; + }; + Buffer4.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i7 = 0; i7 < len; i7 += 4) { + swap(this, i7, i7 + 3); + swap(this, i7 + 1, i7 + 2); + } + return this; + }; + Buffer4.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i7 = 0; i7 < len; i7 += 8) { + swap(this, i7, i7 + 7); + swap(this, i7 + 1, i7 + 6); + swap(this, i7 + 2, i7 + 5); + swap(this, i7 + 3, i7 + 4); + } + return this; + }; + Buffer4.prototype.toString = function toString3() { + const length = this.length; + if (length === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer4.prototype.toLocaleString = Buffer4.prototype.toString; + Buffer4.prototype.equals = function equals(b8) { + if (!Buffer4.isBuffer(b8)) + throw new TypeError("Argument must be a Buffer"); + if (this === b8) + return true; + return Buffer4.compare(this, b8) === 0; + }; + Buffer4.prototype.inspect = function inspect2() { + let str2 = ""; + const max2 = exports$g2.INSPECT_MAX_BYTES; + str2 = this.toString("hex", 0, max2).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max2) + str2 += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer4.prototype[customInspectSymbol] = Buffer4.prototype.inspect; + } + Buffer4.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer4.from(target, target.offset, target.byteLength); + } + if (!Buffer4.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x7 = thisEnd - thisStart; + let y7 = end - start; + const len = Math.min(x7, y7); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i7 = 0; i7 < len; ++i7) { + if (thisCopy[i7] !== targetCopy[i7]) { + x7 = thisCopy[i7]; + y7 = targetCopy[i7]; + break; + } + } + if (x7 < y7) + return -1; + if (y7 < x7) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir2) { + if (buffer2.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir2 ? 0 : buffer2.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer2.length + byteOffset; + if (byteOffset >= buffer2.length) { + if (dir2) + return -1; + else + byteOffset = buffer2.length - 1; + } else if (byteOffset < 0) { + if (dir2) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer4.from(val, encoding); + } + if (Buffer4.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer2, val, byteOffset, encoding, dir2); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir2) { + return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); + } + } + return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir2); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir2) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i8) { + if (indexSize === 1) { + return buf[i8]; + } else { + return buf.readUInt16BE(i8 * indexSize); + } + } + let i7; + if (dir2) { + let foundIndex = -1; + for (i7 = byteOffset; i7 < arrLength; i7++) { + if (read(arr, i7) === read(val, foundIndex === -1 ? 0 : i7 - foundIndex)) { + if (foundIndex === -1) + foundIndex = i7; + if (i7 - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i7 -= i7 - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i7 = byteOffset; i7 >= 0; i7--) { + let found = true; + for (let j6 = 0; j6 < valLength; j6++) { + if (read(arr, i7 + j6) !== read(val, j6)) { + found = false; + break; + } + } + if (found) + return i7; + } + } + return -1; + } + Buffer4.prototype.includes = function includes2(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer4.prototype.indexOf = function indexOf4(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer4.prototype.lastIndexOf = function lastIndexOf2(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string2, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + const strLen = string2.length; + if (length > strLen / 2) { + length = strLen / 2; + } + let i7; + for (i7 = 0; i7 < length; ++i7) { + const parsed = parseInt(string2.substr(i7 * 2, 2), 16); + if (numberIsNaN(parsed)) + return i7; + buf[offset + i7] = parsed; + } + return i7; + } + function utf8Write(buf, string2, offset, length) { + return blitBuffer(utf8ToBytes(string2, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string2, offset, length) { + return blitBuffer(asciiToBytes(string2), buf, offset, length); + } + function base64Write(buf, string2, offset, length) { + return blitBuffer(base64ToBytes(string2), buf, offset, length); + } + function ucs2Write(buf, string2, offset, length) { + return blitBuffer(utf16leToBytes(string2, buf.length - offset), buf, offset, length); + } + Buffer4.prototype.write = function write(string2, offset, length, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length = this.length; + offset = 0; + } else if (length === void 0 && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length; + length = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length === void 0 || length > remaining) + length = remaining; + if (string2.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string2, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string2, offset, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string2, offset, length); + case "base64": + return base64Write(this, string2, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string2, offset, length); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer4.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i7 = start; + while (i7 < end) { + const firstByte = buf[i7]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i7 + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i7 + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i7 + 1]; + thirdByte = buf[i7 + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i7 + 1]; + thirdByte = buf[i7 + 2]; + fourthByte = buf[i7 + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i7 += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + const MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i7 = 0; + while (i7 < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i7, i7 += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i7 = start; i7 < end; ++i7) { + ret += String.fromCharCode(buf[i7] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i7 = start; i7 < end; ++i7) { + ret += String.fromCharCode(buf[i7]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i7 = start; i7 < end; ++i7) { + out += hexSliceLookupTable[buf[i7]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i7 = 0; i7 < bytes.length - 1; i7 += 2) { + res += String.fromCharCode(bytes[i7] + bytes[i7 + 1] * 256); + } + return res; + } + Buffer4.prototype.slice = function slice2(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer4.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer4.prototype.readUintLE = Buffer4.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i7 = 0; + while (++i7 < byteLength2 && (mul *= 256)) { + val += this[offset + i7] * mul; + } + return val; + }; + Buffer4.prototype.readUintBE = Buffer4.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer4.prototype.readUint8 = Buffer4.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer4.prototype.readUint16LE = Buffer4.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer4.prototype.readUint16BE = Buffer4.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer4.prototype.readUint32LE = Buffer4.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer4.prototype.readUint32BE = Buffer4.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer4.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last2 * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer4.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer4.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i7 = 0; + while (++i7 < byteLength2 && (mul *= 256)) { + val += this[offset + i7] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer4.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i7 = byteLength2; + let mul = 1; + let val = this[offset + --i7]; + while (i7 > 0 && (mul *= 256)) { + val += this[offset + --i7] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer4.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer4.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer4.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer4.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer4.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer4.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last2 << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer4.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first = this[offset]; + const last2 = this[offset + 7]; + if (first === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2); + }); + Buffer4.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer4.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer4.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer4.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value2, offset, ext, max2, min2) { + if (!Buffer4.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value2 > max2 || value2 < min2) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer4.prototype.writeUintLE = Buffer4.prototype.writeUIntLE = function writeUIntLE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value2, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i7 = 0; + this[offset] = value2 & 255; + while (++i7 < byteLength2 && (mul *= 256)) { + this[offset + i7] = value2 / mul & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeUintBE = Buffer4.prototype.writeUIntBE = function writeUIntBE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value2, offset, byteLength2, maxBytes, 0); + } + let i7 = byteLength2 - 1; + let mul = 1; + this[offset + i7] = value2 & 255; + while (--i7 >= 0 && (mul *= 256)) { + this[offset + i7] = value2 / mul & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeUint8 = Buffer4.prototype.writeUInt8 = function writeUInt8(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 1, 255, 0); + this[offset] = value2 & 255; + return offset + 1; + }; + Buffer4.prototype.writeUint16LE = Buffer4.prototype.writeUInt16LE = function writeUInt16LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 65535, 0); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + return offset + 2; + }; + Buffer4.prototype.writeUint16BE = Buffer4.prototype.writeUInt16BE = function writeUInt16BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 65535, 0); + this[offset] = value2 >>> 8; + this[offset + 1] = value2 & 255; + return offset + 2; + }; + Buffer4.prototype.writeUint32LE = Buffer4.prototype.writeUInt32LE = function writeUInt32LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 4294967295, 0); + this[offset + 3] = value2 >>> 24; + this[offset + 2] = value2 >>> 16; + this[offset + 1] = value2 >>> 8; + this[offset] = value2 & 255; + return offset + 4; + }; + Buffer4.prototype.writeUint32BE = Buffer4.prototype.writeUInt32BE = function writeUInt32BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 4294967295, 0); + this[offset] = value2 >>> 24; + this[offset + 1] = value2 >>> 16; + this[offset + 2] = value2 >>> 8; + this[offset + 3] = value2 & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value2, offset, min2, max2) { + checkIntBI(value2, min2, max2, buf, offset, 7); + let lo = Number(value2 & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value2 >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value2, offset, min2, max2) { + checkIntBI(value2, min2, max2, buf, offset, 7); + let lo = Number(value2 & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value2 >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer4.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value2, offset = 0) { + return wrtBigUInt64LE(this, value2, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer4.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value2, offset = 0) { + return wrtBigUInt64BE(this, value2, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer4.prototype.writeIntLE = function writeIntLE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value2, offset, byteLength2, limit - 1, -limit); + } + let i7 = 0; + let mul = 1; + let sub = 0; + this[offset] = value2 & 255; + while (++i7 < byteLength2 && (mul *= 256)) { + if (value2 < 0 && sub === 0 && this[offset + i7 - 1] !== 0) { + sub = 1; + } + this[offset + i7] = (value2 / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeIntBE = function writeIntBE(value2, offset, byteLength2, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value2, offset, byteLength2, limit - 1, -limit); + } + let i7 = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i7] = value2 & 255; + while (--i7 >= 0 && (mul *= 256)) { + if (value2 < 0 && sub === 0 && this[offset + i7 + 1] !== 0) { + sub = 1; + } + this[offset + i7] = (value2 / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer4.prototype.writeInt8 = function writeInt8(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 1, 127, -128); + if (value2 < 0) + value2 = 255 + value2 + 1; + this[offset] = value2 & 255; + return offset + 1; + }; + Buffer4.prototype.writeInt16LE = function writeInt16LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 32767, -32768); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + return offset + 2; + }; + Buffer4.prototype.writeInt16BE = function writeInt16BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 2, 32767, -32768); + this[offset] = value2 >>> 8; + this[offset + 1] = value2 & 255; + return offset + 2; + }; + Buffer4.prototype.writeInt32LE = function writeInt32LE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 2147483647, -2147483648); + this[offset] = value2 & 255; + this[offset + 1] = value2 >>> 8; + this[offset + 2] = value2 >>> 16; + this[offset + 3] = value2 >>> 24; + return offset + 4; + }; + Buffer4.prototype.writeInt32BE = function writeInt32BE(value2, offset, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value2, offset, 4, 2147483647, -2147483648); + if (value2 < 0) + value2 = 4294967295 + value2 + 1; + this[offset] = value2 >>> 24; + this[offset + 1] = value2 >>> 16; + this[offset + 2] = value2 >>> 8; + this[offset + 3] = value2 & 255; + return offset + 4; + }; + Buffer4.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value2, offset = 0) { + return wrtBigUInt64LE(this, value2, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer4.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value2, offset = 0) { + return wrtBigUInt64BE(this, value2, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value2, offset, ext, max2, min2) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value2, offset, littleEndian, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value2, offset, 4); + } + ieee754.write(buf, value2, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer4.prototype.writeFloatLE = function writeFloatLE(value2, offset, noAssert) { + return writeFloat(this, value2, offset, true, noAssert); + }; + Buffer4.prototype.writeFloatBE = function writeFloatBE(value2, offset, noAssert) { + return writeFloat(this, value2, offset, false, noAssert); + }; + function writeDouble(buf, value2, offset, littleEndian, noAssert) { + value2 = +value2; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value2, offset, 8); + } + ieee754.write(buf, value2, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer4.prototype.writeDoubleLE = function writeDoubleLE(value2, offset, noAssert) { + return writeDouble(this, value2, offset, true, noAssert); + }; + Buffer4.prototype.writeDoubleBE = function writeDoubleBE(value2, offset, noAssert) { + return writeDouble(this, value2, offset, false, noAssert); + }; + Buffer4.prototype.copy = function copy4(target, targetStart, start, end) { + if (!Buffer4.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer4.prototype.fill = function fill2(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer4.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i7; + if (typeof val === "number") { + for (i7 = start; i7 < end; ++i7) { + this[i7] = val; + } + } else { + const bytes = Buffer4.isBuffer(val) ? val : Buffer4.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i7 = 0; i7 < end - start; ++i7) { + this[i7 + start] = bytes[i7 % len]; + } + } + return this; + }; + const errors = {}; + function E6(sym, getMessage, Base2) { + errors[sym] = class NodeError extends Base2 { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value2) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value: value2, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E6("ERR_BUFFER_OUT_OF_BOUNDS", function(name2) { + if (name2) { + return `${name2} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E6("ERR_INVALID_ARG_TYPE", function(name2, actual) { + return `The "${name2}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E6("ERR_OUT_OF_RANGE", function(str2, range2, input) { + let msg = `The value of "${str2}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range2}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i7 = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i7 >= start + 4; i7 -= 3) { + res = `_${val.slice(i7 - 3, i7)}${res}`; + } + return `${val.slice(0, i7)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value2, min2, max2, buf, offset, byteLength2) { + if (value2 > max2 || value2 < min2) { + const n7 = typeof min2 === "bigint" ? "n" : ""; + let range2; + { + if (min2 === 0 || min2 === BigInt(0)) { + range2 = `>= 0${n7} and < 2${n7} ** ${(byteLength2 + 1) * 8}${n7}`; + } else { + range2 = `>= -(2${n7} ** ${(byteLength2 + 1) * 8 - 1}${n7}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n7}`; + } + } + throw new errors.ERR_OUT_OF_RANGE("value", range2, value2); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value2, name2) { + if (typeof value2 !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name2, "number", value2); + } + } + function boundsError(value2, length, type3) { + if (Math.floor(value2) !== value2) { + validateNumber(value2, type3); + throw new errors.ERR_OUT_OF_RANGE("offset", "an integer", value2); + } + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE("offset", `>= ${0} and <= ${length}`, value2); + } + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str2) { + str2 = str2.split("=")[0]; + str2 = str2.trim().replace(INVALID_BASE64_RE, ""); + if (str2.length < 2) + return ""; + while (str2.length % 4 !== 0) { + str2 = str2 + "="; + } + return str2; + } + function utf8ToBytes(string2, units) { + units = units || Infinity; + let codePoint; + const length = string2.length; + let leadSurrogate = null; + const bytes = []; + for (let i7 = 0; i7 < length; ++i7) { + codePoint = string2.charCodeAt(i7); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i7 + 1 === length) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str2) { + const byteArray = []; + for (let i7 = 0; i7 < str2.length; ++i7) { + byteArray.push(str2.charCodeAt(i7) & 255); + } + return byteArray; + } + function utf16leToBytes(str2, units) { + let c7, hi, lo; + const byteArray = []; + for (let i7 = 0; i7 < str2.length; ++i7) { + if ((units -= 2) < 0) + break; + c7 = str2.charCodeAt(i7); + hi = c7 >> 8; + lo = c7 % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str2) { + return base64.toByteArray(base64clean(str2)); + } + function blitBuffer(src, dst, offset, length) { + let i7; + for (i7 = 0; i7 < length; ++i7) { + if (i7 + offset >= dst.length || i7 >= src.length) + break; + dst[i7 + offset] = src[i7]; + } + return i7; + } + function isInstance(obj, type3) { + return obj instanceof type3 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type3.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + const hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table2 = new Array(256); + for (let i7 = 0; i7 < 16; ++i7) { + const i16 = i7 * 16; + for (let j6 = 0; j6 < 16; ++j6) { + table2[i16 + j6] = alphabet[i7] + alphabet[j6]; + } + } + return table2; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + return exports$g2; +} +function dew$f2() { + if (_dewExec$f2) + return exports$f2; + _dewExec$f2 = true; + if (typeof Object.create === "function") { + exports$f2 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + exports$f2 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return exports$f2; +} +function dew$e2() { + if (_dewExec$e2) + return exports$e2; + _dewExec$e2 = true; + exports$e2 = y.EventEmitter; + return exports$e2; +} +function dew$d2() { + if (_dewExec$d2) + return exports$d2; + _dewExec$d2 = true; + function ownKeys2(object, enumerableOnly) { + var keys2 = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys2.push.apply(keys2, symbols); + } + return keys2; + } + function _objectSpread(target) { + for (var i7 = 1; i7 < arguments.length; i7++) { + var source = arguments[i7] != null ? arguments[i7] : {}; + if (i7 % 2) { + ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function _defineProperty(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties3(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass3(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties3(Constructor.prototype, protoProps); + return Constructor; + } + var _require = buffer, Buffer4 = _require.Buffer; + var _require2 = X2, inspect2 = _require2.inspect; + var custom2 = inspect2 && inspect2.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer4.prototype.copy.call(src, target, offset); + } + exports$d2 = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck3(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass3(BufferList, [{ + key: "push", + value: function push4(v8) { + var entry = { + data: v8, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift4(v8) { + var entry = { + data: v8, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) + return; + var ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear2() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join3(s7) { + if (this.length === 0) + return ""; + var p7 = this.head; + var ret = "" + p7.data; + while (p7 = p7.next) { + ret += s7 + p7.data; + } + return ret; + } + }, { + key: "concat", + value: function concat2(n7) { + if (this.length === 0) + return Buffer4.alloc(0); + var ret = Buffer4.allocUnsafe(n7 >>> 0); + var p7 = this.head; + var i7 = 0; + while (p7) { + copyBuffer(p7.data, ret, i7); + i7 += p7.data.length; + p7 = p7.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n7, hasStrings) { + var ret; + if (n7 < this.head.data.length) { + ret = this.head.data.slice(0, n7); + this.head.data = this.head.data.slice(n7); + } else if (n7 === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n7) : this._getBuffer(n7); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n7) { + var p7 = this.head; + var c7 = 1; + var ret = p7.data; + n7 -= ret.length; + while (p7 = p7.next) { + var str2 = p7.data; + var nb = n7 > str2.length ? str2.length : n7; + if (nb === str2.length) + ret += str2; + else + ret += str2.slice(0, n7); + n7 -= nb; + if (n7 === 0) { + if (nb === str2.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = str2.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n7) { + var ret = Buffer4.allocUnsafe(n7); + var p7 = this.head; + var c7 = 1; + p7.data.copy(ret); + n7 -= p7.data.length; + while (p7 = p7.next) { + var buf = p7.data; + var nb = n7 > buf.length ? buf.length : n7; + buf.copy(ret, ret.length - n7, 0, nb); + n7 -= nb; + if (n7 === 0) { + if (nb === buf.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = buf.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom2, + value: function value2(_6, options) { + return inspect2(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + return exports$d2; +} +function dew$c2() { + if (_dewExec$c2) + return exports$c3; + _dewExec$c2 = true; + var process$1 = process4; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process$1.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process$1.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) + return; + if (self2._readableState && !self2._readableState.emitClose) + return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream2, err) { + var rState = stream2._readableState; + var wState = stream2._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) + stream2.destroy(err); + else + stream2.emit("error", err); + } + exports$c3 = { + destroy, + undestroy, + errorOrDestroy + }; + return exports$c3; +} +function dew$b3() { + if (_dewExec$b3) + return exports$b3; + _dewExec$b3 = true; + const codes2 = {}; + function createErrorType(code, message, Base2) { + if (!Base2) { + Base2 = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + class NodeError extends Base2 { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base2.name; + NodeError.prototype.code = code; + codes2[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i7) => String(i7)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith2(str2, search, pos) { + return str2.substr(0, search.length) === search; + } + function endsWith2(str2, search, this_len) { + if (this_len === void 0 || this_len > str2.length) { + this_len = str2.length; + } + return str2.substring(this_len - search.length, this_len) === search; + } + function includes2(str2, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str2.length) { + return false; + } else { + return str2.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value2) { + return 'The value "' + value2 + '" is invalid for option "' + name2 + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith2(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith2(name2, " argument")) { + msg = `The ${name2} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type3 = includes2(name2, ".") ? "property" : "argument"; + msg = `The "${name2}" ${type3} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) { + return "The " + name2 + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name2) { + return "Cannot call " + name2 + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + exports$b3.codes = codes2; + return exports$b3; +} +function dew$a3() { + if (_dewExec$a3) + return exports$a3; + _dewExec$a3 = true; + var ERR_INVALID_OPT_VALUE = dew$b3().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name2 = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name2, hwm); + } + return Math.floor(hwm); + } + return state.objectMode ? 16 : 16 * 1024; + } + exports$a3 = { + getHighWaterMark + }; + return exports$a3; +} +function dew$93() { + if (_dewExec$93) + return exports$93; + _dewExec$93 = true; + exports$93 = deprecate2; + function deprecate2(fn, msg) { + if (config3("noDeprecation")) { + return fn; + } + var warned = false; + function deprecated() { + if (!warned) { + if (config3("throwDeprecation")) { + throw new Error(msg); + } else if (config3("traceDeprecation")) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this || _global$22, arguments); + } + return deprecated; + } + function config3(name2) { + try { + if (!_global$22.localStorage) + return false; + } catch (_6) { + return false; + } + var val = _global$22.localStorage[name2]; + if (null == val) + return false; + return String(val).toLowerCase() === "true"; + } + return exports$93; +} +function dew$83() { + if (_dewExec$83) + return exports$84; + _dewExec$83 = true; + var process$1 = process4; + exports$84 = Writable2; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var Duplex2; + Writable2.WritableState = WritableState; + var internalUtil = { + deprecate: dew$93() + }; + var Stream2 = dew$e2(); + var Buffer4 = buffer.Buffer; + var OurUint8Array = _global$12.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = dew$c2(); + var _require = dew$a3(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$b3().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + dew$f2()(Writable2, Stream2); + function nop() { + } + function WritableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$74(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream2, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_6) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable2, Symbol.hasInstance, { + value: function value2(object) { + if (realHasInstance.call(this, object)) + return true; + if (this !== Writable2) + return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable2(options) { + Duplex2 = Duplex2 || dew$74(); + var isDuplex = this instanceof Duplex2; + if (!isDuplex && !realHasInstance.call(Writable2, this)) + return new Writable2(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") + this._write = options.write; + if (typeof options.writev === "function") + this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") + this._final = options.final; + } + Stream2.call(this); + } + Writable2.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream2, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream2, er); + process$1.nextTick(cb, er); + } + function validChunk(stream2, state, chunk2, cb) { + var er; + if (chunk2 === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk2 !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer"], chunk2); + } + if (er) { + errorOrDestroy(stream2, er); + process$1.nextTick(cb, er); + return false; + } + return true; + } + Writable2.prototype.write = function(chunk2, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk2); + if (isBuf && !Buffer4.isBuffer(chunk2)) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) + encoding = "buffer"; + else if (!encoding) + encoding = state.defaultEncoding; + if (typeof cb !== "function") + cb = nop; + if (state.ending) + writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk2, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk2, encoding, cb); + } + return ret; + }; + Writable2.prototype.cork = function() { + this._writableState.corked++; + }; + Writable2.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) + clearBuffer(this, state); + } + }; + Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) + throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state, chunk2, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk2 === "string") { + chunk2 = Buffer4.from(chunk2, encoding); + } + return chunk2; + } + Object.defineProperty(Writable2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream2, state, isBuf, chunk2, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk2, encoding); + if (chunk2 !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk2 = newChunk; + } + } + var len = state.objectMode ? 1 : chunk2.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked) { + var last2 = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk2, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last2) { + last2.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream2, state, false, len, chunk2, encoding, cb); + } + return ret; + } + function doWrite(stream2, state, writev, len, chunk2, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) + state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) + stream2._writev(chunk2, state.onwrite); + else + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream2, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + process$1.nextTick(cb, er); + process$1.nextTick(finishMaybe, stream2, state); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + } else { + cb(er); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + finishMaybe(stream2, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream2, er) { + var state = stream2._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") + throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) + onwriteError(stream2, state, sync, er, cb); + else { + var finished2 = needFinish(state) || stream2.destroyed; + if (!finished2 && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream2, state); + } + if (sync) { + process$1.nextTick(afterWrite, stream2, state, finished2, cb); + } else { + afterWrite(stream2, state, finished2, cb); + } + } + } + function afterWrite(stream2, state, finished2, cb) { + if (!finished2) + onwriteDrain(stream2, state); + state.pendingcb--; + cb(); + finishMaybe(stream2, state); + } + function onwriteDrain(stream2, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream2.emit("drain"); + } + } + function clearBuffer(stream2, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream2._writev && entry && entry.next) { + var l7 = state.bufferedRequestCount; + var buffer2 = new Array(l7); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count2 = 0; + var allBuffers = true; + while (entry) { + buffer2[count2] = entry; + if (!entry.isBuf) + allBuffers = false; + entry = entry.next; + count2 += 1; + } + buffer2.allBuffers = allBuffers; + doWrite(stream2, state, true, state.length, buffer2, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk2 = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk2.length; + doWrite(stream2, state, false, len, chunk2, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable2.prototype._write = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable2.prototype._writev = null; + Writable2.prototype.end = function(chunk2, encoding, cb) { + var state = this._writableState; + if (typeof chunk2 === "function") { + cb = chunk2; + chunk2 = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk2 !== null && chunk2 !== void 0) + this.write(chunk2, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) + endWritable(this, state, cb); + return this; + }; + Object.defineProperty(Writable2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream2, state) { + stream2._final(function(err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream2, err); + } + state.prefinished = true; + stream2.emit("prefinish"); + finishMaybe(stream2, state); + }); + } + function prefinish(stream2, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream2._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process$1.nextTick(callFinal, stream2, state); + } else { + state.prefinished = true; + stream2.emit("prefinish"); + } + } + } + function finishMaybe(stream2, state) { + var need = needFinish(state); + if (need) { + prefinish(stream2, state); + if (state.pendingcb === 0) { + state.finished = true; + stream2.emit("finish"); + if (state.autoDestroy) { + var rState = stream2._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream2.destroy(); + } + } + } + } + return need; + } + function endWritable(stream2, state, cb) { + state.ending = true; + finishMaybe(stream2, state); + if (cb) { + if (state.finished) + process$1.nextTick(cb); + else + stream2.once("finish", cb); + } + state.ended = true; + stream2.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set4(value2) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value2; + } + }); + Writable2.prototype.destroy = destroyImpl.destroy; + Writable2.prototype._undestroy = destroyImpl.undestroy; + Writable2.prototype._destroy = function(err, cb) { + cb(err); + }; + return exports$84; +} +function dew$74() { + if (_dewExec$74) + return exports$74; + _dewExec$74 = true; + var process$1 = process4; + var objectKeys = Object.keys || function(obj) { + var keys3 = []; + for (var key in obj) { + keys3.push(key); + } + return keys3; + }; + exports$74 = Duplex2; + var Readable3 = dew$34(); + var Writable2 = dew$83(); + dew$f2()(Duplex2, Readable3); + { + var keys2 = objectKeys(Writable2.prototype); + for (var v8 = 0; v8 < keys2.length; v8++) { + var method2 = keys2[v8]; + if (!Duplex2.prototype[method2]) + Duplex2.prototype[method2] = Writable2.prototype[method2]; + } + } + function Duplex2(options) { + if (!(this instanceof Duplex2)) + return new Duplex2(options); + Readable3.call(this, options); + Writable2.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) + this.readable = false; + if (options.writable === false) + this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) + return; + process$1.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set4(value2) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value2; + this._writableState.destroyed = value2; + } + }); + return exports$74; +} +function dew$64() { + if (_dewExec$64) + return exports$64; + _dewExec$64 = true; + var ERR_STREAM_PREMATURE_CLOSE = dew$b3().codes.ERR_STREAM_PREMATURE_CLOSE; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; + } + function noop4() { + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function eos(stream2, opts, callback) { + if (typeof opts === "function") + return eos(stream2, null, opts); + if (!opts) + opts = {}; + callback = once5(callback || noop4); + var readable = opts.readable || opts.readable !== false && stream2.readable; + var writable = opts.writable || opts.writable !== false && stream2.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream2.writable) + onfinish(); + }; + var writableEnded = stream2._writableState && stream2._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) + callback.call(stream2); + }; + var readableEnded = stream2._readableState && stream2._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) + callback.call(stream2); + }; + var onerror = function onerror2(err) { + callback.call(stream2, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream2._readableState || !stream2._readableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + if (writable && !writableEnded) { + if (!stream2._writableState || !stream2._writableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + }; + var onrequest = function onrequest2() { + stream2.req.on("finish", onfinish); + }; + if (isRequest(stream2)) { + stream2.on("complete", onfinish); + stream2.on("abort", onclose); + if (stream2.req) + onrequest(); + else + stream2.on("request", onrequest); + } else if (writable && !stream2._writableState) { + stream2.on("end", onlegacyfinish); + stream2.on("close", onlegacyfinish); + } + stream2.on("end", onend); + stream2.on("finish", onfinish); + if (opts.error !== false) + stream2.on("error", onerror); + stream2.on("close", onclose); + return function() { + stream2.removeListener("complete", onfinish); + stream2.removeListener("abort", onclose); + stream2.removeListener("request", onrequest); + if (stream2.req) + stream2.req.removeListener("finish", onfinish); + stream2.removeListener("end", onlegacyfinish); + stream2.removeListener("close", onlegacyfinish); + stream2.removeListener("finish", onfinish); + stream2.removeListener("end", onend); + stream2.removeListener("error", onerror); + stream2.removeListener("close", onclose); + }; + } + exports$64 = eos; + return exports$64; +} +function dew$54() { + if (_dewExec$54) + return exports$54; + _dewExec$54 = true; + var process$1 = process4; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + var finished2 = dew$64(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult2(value2, done) { + return { + value: value2, + done + }; + } + function readAndResolve(iter) { + var resolve3 = iter[kLastResolve]; + if (resolve3 !== null) { + var data = iter[kStream].read(); + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } + } + } + function onReadable(iter) { + process$1.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve3, reject2) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve3(createIterResult2(void 0, true)); + return; + } + iter[kHandlePromise](resolve3, reject2); + }, reject2); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error2 = this[kError]; + if (error2 !== null) { + return Promise.reject(error2); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult2(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve3, reject2) { + process$1.nextTick(function() { + if (_this[kError]) { + reject2(_this[kError]); + } else { + resolve3(createIterResult2(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult2(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve3, reject2) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject2(err); + return; + } + resolve3(createIterResult2(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream2) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream2, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream2._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value2(resolve3, reject2) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } else { + iterator[kLastResolve] = resolve3; + iterator[kLastReject] = reject2; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished2(stream2, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject2 = iterator[kLastReject]; + if (reject2 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject2(err); + } + iterator[kError] = err; + return; + } + var resolve3 = iterator[kLastResolve]; + if (resolve3 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(void 0, true)); + } + iterator[kEnded] = true; + }); + stream2.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + exports$54 = createReadableStreamAsyncIterator; + return exports$54; +} +function dew$44() { + if (_dewExec$44) + return exports$44; + _dewExec$44 = true; + exports$44 = function() { + throw new Error("Readable.from is not available in the browser"); + }; + return exports$44; +} +function dew$34() { + if (_dewExec$34) + return exports$34; + _dewExec$34 = true; + var process$1 = process4; + exports$34 = Readable3; + var Duplex2; + Readable3.ReadableState = ReadableState; + y.EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type3) { + return emitter.listeners(type3).length; + }; + var Stream2 = dew$e2(); + var Buffer4 = buffer.Buffer; + var OurUint8Array = _global4.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = X2; + var debug2; + if (debugUtil && debugUtil.debuglog) { + debug2 = debugUtil.debuglog("stream"); + } else { + debug2 = function debug3() { + }; + } + var BufferList = dew$d2(); + var destroyImpl = dew$c2(); + var _require = dew$a3(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$b3().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder2; + var createReadableStreamAsyncIterator; + var from; + dew$f2()(Readable3, Stream2); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener3(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$74(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder2) + StringDecoder2 = e$12.StringDecoder; + this.decoder = new StringDecoder2(options.encoding); + this.encoding = options.encoding; + } + } + function Readable3(options) { + Duplex2 = Duplex2 || dew$74(); + if (!(this instanceof Readable3)) + return new Readable3(options); + var isDuplex = this instanceof Duplex2; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") + this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + } + Stream2.call(this); + } + Object.defineProperty(Readable3.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set4(value2) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value2; + } + }); + Readable3.prototype.destroy = destroyImpl.destroy; + Readable3.prototype._undestroy = destroyImpl.undestroy; + Readable3.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable3.prototype.push = function(chunk2, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk2 === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk2, encoding, false, skipChunkCheck); + }; + Readable3.prototype.unshift = function(chunk2) { + return readableAddChunk(this, chunk2, null, true, false); + }; + function readableAddChunk(stream2, chunk2, encoding, addToFront, skipChunkCheck) { + debug2("readableAddChunk", chunk2); + var state = stream2._readableState; + if (chunk2 === null) { + state.reading = false; + onEofChunk(stream2, state); + } else { + var er; + if (!skipChunkCheck) + er = chunkInvalid(state, chunk2); + if (er) { + errorOrDestroy(stream2, er); + } else if (state.objectMode || chunk2 && chunk2.length > 0) { + if (typeof chunk2 !== "string" && !state.objectMode && Object.getPrototypeOf(chunk2) !== Buffer4.prototype) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (addToFront) { + if (state.endEmitted) + errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else + addChunk(stream2, state, chunk2, true); + } else if (state.ended) { + errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk2 = state.decoder.write(chunk2); + if (state.objectMode || chunk2.length !== 0) + addChunk(stream2, state, chunk2, false); + else + maybeReadMore(stream2, state); + } else { + addChunk(stream2, state, chunk2, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream2, state); + } + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream2, state, chunk2, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream2.emit("data", chunk2); + } else { + state.length += state.objectMode ? 1 : chunk2.length; + if (addToFront) + state.buffer.unshift(chunk2); + else + state.buffer.push(chunk2); + if (state.needReadable) + emitReadable(stream2); + } + maybeReadMore(stream2, state); + } + function chunkInvalid(state, chunk2) { + var er; + if (!_isUint8Array(chunk2) && typeof chunk2 !== "string" && chunk2 !== void 0 && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer", "Uint8Array"], chunk2); + } + return er; + } + Readable3.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable3.prototype.setEncoding = function(enc) { + if (!StringDecoder2) + StringDecoder2 = e$12.StringDecoder; + var decoder = new StringDecoder2(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p7 = this._readableState.buffer.head; + var content = ""; + while (p7 !== null) { + content += decoder.write(p7.data); + p7 = p7.next; + } + this._readableState.buffer.clear(); + if (content !== "") + this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n7) { + if (n7 >= MAX_HWM) { + n7 = MAX_HWM; + } else { + n7--; + n7 |= n7 >>> 1; + n7 |= n7 >>> 2; + n7 |= n7 >>> 4; + n7 |= n7 >>> 8; + n7 |= n7 >>> 16; + n7++; + } + return n7; + } + function howMuchToRead(n7, state) { + if (n7 <= 0 || state.length === 0 && state.ended) + return 0; + if (state.objectMode) + return 1; + if (n7 !== n7) { + if (state.flowing && state.length) + return state.buffer.head.data.length; + else + return state.length; + } + if (n7 > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n7); + if (n7 <= state.length) + return n7; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable3.prototype.read = function(n7) { + debug2("read", n7); + n7 = parseInt(n7, 10); + var state = this._readableState; + var nOrig = n7; + if (n7 !== 0) + state.emittedReadable = false; + if (n7 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug2("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + n7 = howMuchToRead(n7, state); + if (n7 === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + var doRead = state.needReadable; + debug2("need readable", doRead); + if (state.length === 0 || state.length - n7 < state.highWaterMark) { + doRead = true; + debug2("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug2("reading or ended", doRead); + } else if (doRead) { + debug2("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) + state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) + n7 = howMuchToRead(nOrig, state); + } + var ret; + if (n7 > 0) + ret = fromList(n7, state); + else + ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n7 = 0; + } else { + state.length -= n7; + state.awaitDrain = 0; + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n7 && state.ended) + endReadable(this); + } + if (ret !== null) + this.emit("data", ret); + return ret; + }; + function onEofChunk(stream2, state) { + debug2("onEofChunk"); + if (state.ended) + return; + if (state.decoder) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) { + state.buffer.push(chunk2); + state.length += state.objectMode ? 1 : chunk2.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream2); + } else { + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream2); + } + } + } + function emitReadable(stream2) { + var state = stream2._readableState; + debug2("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug2("emitReadable", state.flowing); + state.emittedReadable = true; + process$1.nextTick(emitReadable_, stream2); + } + } + function emitReadable_(stream2) { + var state = stream2._readableState; + debug2("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream2.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow2(stream2); + } + function maybeReadMore(stream2, state) { + if (!state.readingMore) { + state.readingMore = true; + process$1.nextTick(maybeReadMore_, stream2, state); + } + } + function maybeReadMore_(stream2, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug2("maybeReadMore read 0"); + stream2.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable3.prototype._read = function(n7) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable3.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug2("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + process$1.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug2("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug2("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug2("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + src.on("data", ondata); + function ondata(chunk2) { + debug2("ondata"); + var ret = dest.write(chunk2); + debug2("dest.write", ret); + if (ret === false) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf4(state.pipes, dest) !== -1) && !cleanedUp) { + debug2("false write response, pause", state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug2("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) + errorOrDestroy(dest, er); + } + prependListener3(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug2("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug2("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug2("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug2("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow2(src); + } + }; + } + Readable3.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) + return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) + return this; + if (!dest) + dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i7 = 0; i7 < len; i7++) { + dests[i7].emit("unpipe", this, { + hasUnpiped: false + }); + } + return this; + } + var index4 = indexOf4(state.pipes, dest); + if (index4 === -1) + return this; + state.pipes.splice(index4, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable3.prototype.on = function(ev, fn) { + var res = Stream2.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) + this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug2("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process$1.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable3.prototype.addListener = Readable3.prototype.on; + Readable3.prototype.removeListener = function(ev, fn) { + var res = Stream2.prototype.removeListener.call(this, ev, fn); + if (ev === "readable") { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + Readable3.prototype.removeAllListeners = function(ev) { + var res = Stream2.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && !state.paused) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug2("readable nexttick read 0"); + self2.read(0); + } + Readable3.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug2("resume"); + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; + }; + function resume(stream2, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process$1.nextTick(resume_, stream2, state); + } + } + function resume_(stream2, state) { + debug2("resume", state.reading); + if (!state.reading) { + stream2.read(0); + } + state.resumeScheduled = false; + stream2.emit("resume"); + flow2(stream2); + if (state.flowing && !state.reading) + stream2.read(0); + } + Readable3.prototype.pause = function() { + debug2("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug2("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow2(stream2) { + var state = stream2._readableState; + debug2("flow", state.flowing); + while (state.flowing && stream2.read() !== null) { + } + } + Readable3.prototype.wrap = function(stream2) { + var _this = this; + var state = this._readableState; + var paused = false; + stream2.on("end", function() { + debug2("wrapped end"); + if (state.decoder && !state.ended) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) + _this.push(chunk2); + } + _this.push(null); + }); + stream2.on("data", function(chunk2) { + debug2("wrapped data"); + if (state.decoder) + chunk2 = state.decoder.write(chunk2); + if (state.objectMode && (chunk2 === null || chunk2 === void 0)) + return; + else if (!state.objectMode && (!chunk2 || !chunk2.length)) + return; + var ret = _this.push(chunk2); + if (!ret) { + paused = true; + stream2.pause(); + } + }); + for (var i7 in stream2) { + if (this[i7] === void 0 && typeof stream2[i7] === "function") { + this[i7] = /* @__PURE__ */ function methodWrap(method2) { + return function methodWrapReturnFunction() { + return stream2[method2].apply(stream2, arguments); + }; + }(i7); + } + } + for (var n7 = 0; n7 < kProxyEvents.length; n7++) { + stream2.on(kProxyEvents[n7], this.emit.bind(this, kProxyEvents[n7])); + } + this._read = function(n8) { + debug2("wrapped _read", n8); + if (paused) { + paused = false; + stream2.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable3.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = dew$54(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable3.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable3.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable3.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.flowing; + }, + set: function set4(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } + }); + Readable3._fromList = fromList; + Object.defineProperty(Readable3.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.length; + } + }); + function fromList(n7, state) { + if (state.length === 0) + return null; + var ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n7 || n7 >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.first(); + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n7, state.decoder); + } + return ret; + } + function endReadable(stream2) { + var state = stream2._readableState; + debug2("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process$1.nextTick(endReadableNT, state, stream2); + } + } + function endReadableNT(state, stream2) { + debug2("endReadableNT", state.endEmitted, state.length); + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream2.readable = false; + stream2.emit("end"); + if (state.autoDestroy) { + var wState = stream2._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream2.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable3.from = function(iterable, opts) { + if (from === void 0) { + from = dew$44(); + } + return from(Readable3, iterable, opts); + }; + } + function indexOf4(xs, x7) { + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) + return i7; + } + return -1; + } + return exports$34; +} +function dew$25() { + if (_dewExec$25) + return exports$26; + _dewExec$25 = true; + exports$26 = Transform2; + var _require$codes = dew$b3().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex2 = dew$74(); + dew$f2()(Transform2, Duplex2); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform2(options) { + if (!(this instanceof Transform2)) + return new Transform2(options); + Duplex2.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform2.prototype.push = function(chunk2, encoding) { + this._transformState.needTransform = false; + return Duplex2.prototype.push.call(this, chunk2, encoding); + }; + Transform2.prototype._transform = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform2.prototype._write = function(chunk2, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk2; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } + }; + Transform2.prototype._read = function(n7) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform2.prototype._destroy = function(err, cb) { + Duplex2.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream2, er, data) { + if (er) + return stream2.emit("error", er); + if (data != null) + stream2.push(data); + if (stream2._writableState.length) + throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream2._transformState.transforming) + throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream2.push(null); + } + return exports$26; +} +function dew$16() { + if (_dewExec$16) + return exports$18; + _dewExec$16 = true; + exports$18 = PassThrough2; + var Transform2 = dew$25(); + dew$f2()(PassThrough2, Transform2); + function PassThrough2(options) { + if (!(this instanceof PassThrough2)) + return new PassThrough2(options); + Transform2.call(this, options); + } + PassThrough2.prototype._transform = function(chunk2, encoding, cb) { + cb(null, chunk2); + }; + return exports$18; +} +function dew10() { + if (_dewExec10) + return exports13; + _dewExec10 = true; + var eos; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = dew$b3().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop4(err) { + if (err) + throw err; + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function destroyer(stream2, reading, writing, callback) { + callback = once5(callback); + var closed = false; + stream2.on("close", function() { + closed = true; + }); + if (eos === void 0) + eos = dew$64(); + eos(stream2, { + readable: reading, + writable: writing + }, function(err) { + if (err) + return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) + return; + if (destroyed) + return; + destroyed = true; + if (isRequest(stream2)) + return stream2.abort(); + if (typeof stream2.destroy === "function") + return stream2.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn) { + fn(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) + return noop4; + if (typeof streams[streams.length - 1] !== "function") + return noop4; + return streams.pop(); + } + function pipeline2() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) + streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error2; + var destroys = streams.map(function(stream2, i7) { + var reading = i7 < streams.length - 1; + var writing = i7 > 0; + return destroyer(stream2, reading, writing, function(err) { + if (!error2) + error2 = err; + if (err) + destroys.forEach(call); + if (reading) + return; + destroys.forEach(call); + callback(error2); + }); + }); + return streams.reduce(pipe); + } + exports13 = pipeline2; + return exports13; +} +var r$15, t$15, e$25, n$25, o$25, a$15, h$15, a$1$1, e$1$1, n$1$1, i$12, o$1$1, j3, Y3, e4, n4, o4, u4, e$12, s4, i4, exports$2$1, _dewExec$2$1, exports$1$1, _dewExec$1$1, exports$g2, _dewExec$g2, buffer, exports$f2, _dewExec$f2, exports$e2, _dewExec$e2, exports$d2, _dewExec$d2, exports$c3, _dewExec$c2, exports$b3, _dewExec$b3, exports$a3, _dewExec$a3, exports$93, _dewExec$93, _global$22, exports$84, _dewExec$83, _global$12, exports$74, _dewExec$74, exports$64, _dewExec$64, exports$54, _dewExec$54, exports$44, _dewExec$44, exports$34, _dewExec$34, _global4, exports$26, _dewExec$25, exports$18, _dewExec$16, exports13, _dewExec10; +var init_chunk_B738Er4n = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-B738Er4n.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_tHuMsdT0(); + init_chunk_D3uu3VYh(); + init_chunk_b0rmRow7(); + for (r$15 = { byteLength: function(r8) { + var t8 = u$22(r8), e10 = t8[0], n7 = t8[1]; + return 3 * (e10 + n7) / 4 - n7; + }, toByteArray: function(r8) { + var t8, o7, a7 = u$22(r8), h8 = a7[0], c7 = a7[1], d7 = new n$25(function(r9, t9, e10) { + return 3 * (t9 + e10) / 4 - e10; + }(0, h8, c7)), f8 = 0, A6 = c7 > 0 ? h8 - 4 : h8; + for (o7 = 0; o7 < A6; o7 += 4) + t8 = e$25[r8.charCodeAt(o7)] << 18 | e$25[r8.charCodeAt(o7 + 1)] << 12 | e$25[r8.charCodeAt(o7 + 2)] << 6 | e$25[r8.charCodeAt(o7 + 3)], d7[f8++] = t8 >> 16 & 255, d7[f8++] = t8 >> 8 & 255, d7[f8++] = 255 & t8; + 2 === c7 && (t8 = e$25[r8.charCodeAt(o7)] << 2 | e$25[r8.charCodeAt(o7 + 1)] >> 4, d7[f8++] = 255 & t8); + 1 === c7 && (t8 = e$25[r8.charCodeAt(o7)] << 10 | e$25[r8.charCodeAt(o7 + 1)] << 4 | e$25[r8.charCodeAt(o7 + 2)] >> 2, d7[f8++] = t8 >> 8 & 255, d7[f8++] = 255 & t8); + return d7; + }, fromByteArray: function(r8) { + for (var e10, n7 = r8.length, o7 = n7 % 3, a7 = [], h8 = 0, u7 = n7 - o7; h8 < u7; h8 += 16383) + a7.push(c$12(r8, h8, h8 + 16383 > u7 ? u7 : h8 + 16383)); + 1 === o7 ? (e10 = r8[n7 - 1], a7.push(t$15[e10 >> 2] + t$15[e10 << 4 & 63] + "==")) : 2 === o7 && (e10 = (r8[n7 - 2] << 8) + r8[n7 - 1], a7.push(t$15[e10 >> 10] + t$15[e10 >> 4 & 63] + t$15[e10 << 2 & 63] + "=")); + return a7.join(""); + } }, t$15 = [], e$25 = [], n$25 = "undefined" != typeof Uint8Array ? Uint8Array : Array, o$25 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", a$15 = 0, h$15 = o$25.length; a$15 < h$15; ++a$15) + t$15[a$15] = o$25[a$15], e$25[o$25.charCodeAt(a$15)] = a$15; + e$25["-".charCodeAt(0)] = 62, e$25["_".charCodeAt(0)] = 63; + a$1$1 = { read: function(a7, t8, o7, r8, h8) { + var M6, f8, p7 = 8 * h8 - r8 - 1, w6 = (1 << p7) - 1, e10 = w6 >> 1, i7 = -7, N6 = o7 ? h8 - 1 : 0, n7 = o7 ? -1 : 1, u7 = a7[t8 + N6]; + for (N6 += n7, M6 = u7 & (1 << -i7) - 1, u7 >>= -i7, i7 += p7; i7 > 0; M6 = 256 * M6 + a7[t8 + N6], N6 += n7, i7 -= 8) + ; + for (f8 = M6 & (1 << -i7) - 1, M6 >>= -i7, i7 += r8; i7 > 0; f8 = 256 * f8 + a7[t8 + N6], N6 += n7, i7 -= 8) + ; + if (0 === M6) + M6 = 1 - e10; + else { + if (M6 === w6) + return f8 ? NaN : 1 / 0 * (u7 ? -1 : 1); + f8 += Math.pow(2, r8), M6 -= e10; + } + return (u7 ? -1 : 1) * f8 * Math.pow(2, M6 - r8); + }, write: function(a7, t8, o7, r8, h8, M6) { + var f8, p7, w6, e10 = 8 * M6 - h8 - 1, i7 = (1 << e10) - 1, N6 = i7 >> 1, n7 = 23 === h8 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, u7 = r8 ? 0 : M6 - 1, l7 = r8 ? 1 : -1, s7 = t8 < 0 || 0 === t8 && 1 / t8 < 0 ? 1 : 0; + for (t8 = Math.abs(t8), isNaN(t8) || t8 === 1 / 0 ? (p7 = isNaN(t8) ? 1 : 0, f8 = i7) : (f8 = Math.floor(Math.log(t8) / Math.LN2), t8 * (w6 = Math.pow(2, -f8)) < 1 && (f8--, w6 *= 2), (t8 += f8 + N6 >= 1 ? n7 / w6 : n7 * Math.pow(2, 1 - N6)) * w6 >= 2 && (f8++, w6 /= 2), f8 + N6 >= i7 ? (p7 = 0, f8 = i7) : f8 + N6 >= 1 ? (p7 = (t8 * w6 - 1) * Math.pow(2, h8), f8 += N6) : (p7 = t8 * Math.pow(2, N6 - 1) * Math.pow(2, h8), f8 = 0)); h8 >= 8; a7[o7 + u7] = 255 & p7, u7 += l7, p7 /= 256, h8 -= 8) + ; + for (f8 = f8 << h8 | p7, e10 += h8; e10 > 0; a7[o7 + u7] = 255 & f8, u7 += l7, f8 /= 256, e10 -= 8) + ; + a7[o7 + u7 - l7] |= 128 * s7; + } }; + e$1$1 = {}; + n$1$1 = r$15; + i$12 = a$1$1; + o$1$1 = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null; + e$1$1.Buffer = u$1$1, e$1$1.SlowBuffer = function(t8) { + +t8 != t8 && (t8 = 0); + return u$1$1.alloc(+t8); + }, e$1$1.INSPECT_MAX_BYTES = 50; + e$1$1.kMaxLength = 2147483647, u$1$1.TYPED_ARRAY_SUPPORT = function() { + try { + var t8 = new Uint8Array(1), r8 = { foo: function() { + return 42; + } }; + return Object.setPrototypeOf(r8, Uint8Array.prototype), Object.setPrototypeOf(t8, r8), 42 === t8.foo(); + } catch (t9) { + return false; + } + }(), u$1$1.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(u$1$1.prototype, "parent", { enumerable: true, get: function() { + if (u$1$1.isBuffer(this)) + return this.buffer; + } }), Object.defineProperty(u$1$1.prototype, "offset", { enumerable: true, get: function() { + if (u$1$1.isBuffer(this)) + return this.byteOffset; + } }), u$1$1.poolSize = 8192, u$1$1.from = function(t8, r8, e10) { + return s$12(t8, r8, e10); + }, Object.setPrototypeOf(u$1$1.prototype, Uint8Array.prototype), Object.setPrototypeOf(u$1$1, Uint8Array), u$1$1.alloc = function(t8, r8, e10) { + return function(t9, r9, e11) { + return h$1$1(t9), t9 <= 0 ? f$2(t9) : void 0 !== r9 ? "string" == typeof e11 ? f$2(t9).fill(r9, e11) : f$2(t9).fill(r9) : f$2(t9); + }(t8, r8, e10); + }, u$1$1.allocUnsafe = function(t8) { + return a$2(t8); + }, u$1$1.allocUnsafeSlow = function(t8) { + return a$2(t8); + }, u$1$1.isBuffer = function(t8) { + return null != t8 && true === t8._isBuffer && t8 !== u$1$1.prototype; + }, u$1$1.compare = function(t8, r8) { + if (F3(t8, Uint8Array) && (t8 = u$1$1.from(t8, t8.offset, t8.byteLength)), F3(r8, Uint8Array) && (r8 = u$1$1.from(r8, r8.offset, r8.byteLength)), !u$1$1.isBuffer(t8) || !u$1$1.isBuffer(r8)) + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + if (t8 === r8) + return 0; + for (var e10 = t8.length, n7 = r8.length, i7 = 0, o7 = Math.min(e10, n7); i7 < o7; ++i7) + if (t8[i7] !== r8[i7]) { + e10 = t8[i7], n7 = r8[i7]; + break; + } + return e10 < n7 ? -1 : n7 < e10 ? 1 : 0; + }, u$1$1.isEncoding = function(t8) { + switch (String(t8).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }, u$1$1.concat = function(t8, r8) { + if (!Array.isArray(t8)) + throw new TypeError('"list" argument must be an Array of Buffers'); + if (0 === t8.length) + return u$1$1.alloc(0); + var e10; + if (void 0 === r8) + for (r8 = 0, e10 = 0; e10 < t8.length; ++e10) + r8 += t8[e10].length; + var n7 = u$1$1.allocUnsafe(r8), i7 = 0; + for (e10 = 0; e10 < t8.length; ++e10) { + var o7 = t8[e10]; + if (F3(o7, Uint8Array) && (o7 = u$1$1.from(o7)), !u$1$1.isBuffer(o7)) + throw new TypeError('"list" argument must be an Array of Buffers'); + o7.copy(n7, i7), i7 += o7.length; + } + return n7; + }, u$1$1.byteLength = y3, u$1$1.prototype._isBuffer = true, u$1$1.prototype.swap16 = function() { + var t8 = this.length; + if (t8 % 2 != 0) + throw new RangeError("Buffer size must be a multiple of 16-bits"); + for (var r8 = 0; r8 < t8; r8 += 2) + w3(this, r8, r8 + 1); + return this; + }, u$1$1.prototype.swap32 = function() { + var t8 = this.length; + if (t8 % 4 != 0) + throw new RangeError("Buffer size must be a multiple of 32-bits"); + for (var r8 = 0; r8 < t8; r8 += 4) + w3(this, r8, r8 + 3), w3(this, r8 + 1, r8 + 2); + return this; + }, u$1$1.prototype.swap64 = function() { + var t8 = this.length; + if (t8 % 8 != 0) + throw new RangeError("Buffer size must be a multiple of 64-bits"); + for (var r8 = 0; r8 < t8; r8 += 8) + w3(this, r8, r8 + 7), w3(this, r8 + 1, r8 + 6), w3(this, r8 + 2, r8 + 5), w3(this, r8 + 3, r8 + 4); + return this; + }, u$1$1.prototype.toString = function() { + var t8 = this.length; + return 0 === t8 ? "" : 0 === arguments.length ? I3(this, 0, t8) : g3.apply(this, arguments); + }, u$1$1.prototype.toLocaleString = u$1$1.prototype.toString, u$1$1.prototype.equals = function(t8) { + if (!u$1$1.isBuffer(t8)) + throw new TypeError("Argument must be a Buffer"); + return this === t8 || 0 === u$1$1.compare(this, t8); + }, u$1$1.prototype.inspect = function() { + var t8 = "", r8 = e$1$1.INSPECT_MAX_BYTES; + return t8 = this.toString("hex", 0, r8).replace(/(.{2})/g, "$1 ").trim(), this.length > r8 && (t8 += " ... "), ""; + }, o$1$1 && (u$1$1.prototype[o$1$1] = u$1$1.prototype.inspect), u$1$1.prototype.compare = function(t8, r8, e10, n7, i7) { + if (F3(t8, Uint8Array) && (t8 = u$1$1.from(t8, t8.offset, t8.byteLength)), !u$1$1.isBuffer(t8)) + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t8); + if (void 0 === r8 && (r8 = 0), void 0 === e10 && (e10 = t8 ? t8.length : 0), void 0 === n7 && (n7 = 0), void 0 === i7 && (i7 = this.length), r8 < 0 || e10 > t8.length || n7 < 0 || i7 > this.length) + throw new RangeError("out of range index"); + if (n7 >= i7 && r8 >= e10) + return 0; + if (n7 >= i7) + return -1; + if (r8 >= e10) + return 1; + if (this === t8) + return 0; + for (var o7 = (i7 >>>= 0) - (n7 >>>= 0), f8 = (e10 >>>= 0) - (r8 >>>= 0), s7 = Math.min(o7, f8), h8 = this.slice(n7, i7), a7 = t8.slice(r8, e10), p7 = 0; p7 < s7; ++p7) + if (h8[p7] !== a7[p7]) { + o7 = h8[p7], f8 = a7[p7]; + break; + } + return o7 < f8 ? -1 : f8 < o7 ? 1 : 0; + }, u$1$1.prototype.includes = function(t8, r8, e10) { + return -1 !== this.indexOf(t8, r8, e10); + }, u$1$1.prototype.indexOf = function(t8, r8, e10) { + return d3(this, t8, r8, e10, true); + }, u$1$1.prototype.lastIndexOf = function(t8, r8, e10) { + return d3(this, t8, r8, e10, false); + }, u$1$1.prototype.write = function(t8, r8, e10, n7) { + if (void 0 === r8) + n7 = "utf8", e10 = this.length, r8 = 0; + else if (void 0 === e10 && "string" == typeof r8) + n7 = r8, e10 = this.length, r8 = 0; + else { + if (!isFinite(r8)) + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + r8 >>>= 0, isFinite(e10) ? (e10 >>>= 0, void 0 === n7 && (n7 = "utf8")) : (n7 = e10, e10 = void 0); + } + var i7 = this.length - r8; + if ((void 0 === e10 || e10 > i7) && (e10 = i7), t8.length > 0 && (e10 < 0 || r8 < 0) || r8 > this.length) + throw new RangeError("Attempt to write outside buffer bounds"); + n7 || (n7 = "utf8"); + for (var o7 = false; ; ) + switch (n7) { + case "hex": + return b4(this, t8, r8, e10); + case "utf8": + case "utf-8": + return m3(this, t8, r8, e10); + case "ascii": + return E3(this, t8, r8, e10); + case "latin1": + case "binary": + return B3(this, t8, r8, e10); + case "base64": + return A3(this, t8, r8, e10); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return U3(this, t8, r8, e10); + default: + if (o7) + throw new TypeError("Unknown encoding: " + n7); + n7 = ("" + n7).toLowerCase(), o7 = true; + } + }, u$1$1.prototype.toJSON = function() { + return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; + }; + u$1$1.prototype.slice = function(t8, r8) { + var e10 = this.length; + (t8 = ~~t8) < 0 ? (t8 += e10) < 0 && (t8 = 0) : t8 > e10 && (t8 = e10), (r8 = void 0 === r8 ? e10 : ~~r8) < 0 ? (r8 += e10) < 0 && (r8 = 0) : r8 > e10 && (r8 = e10), r8 < t8 && (r8 = t8); + var n7 = this.subarray(t8, r8); + return Object.setPrototypeOf(n7, u$1$1.prototype), n7; + }, u$1$1.prototype.readUIntLE = function(t8, r8, e10) { + t8 >>>= 0, r8 >>>= 0, e10 || x4(t8, r8, this.length); + for (var n7 = this[t8], i7 = 1, o7 = 0; ++o7 < r8 && (i7 *= 256); ) + n7 += this[t8 + o7] * i7; + return n7; + }, u$1$1.prototype.readUIntBE = function(t8, r8, e10) { + t8 >>>= 0, r8 >>>= 0, e10 || x4(t8, r8, this.length); + for (var n7 = this[t8 + --r8], i7 = 1; r8 > 0 && (i7 *= 256); ) + n7 += this[t8 + --r8] * i7; + return n7; + }, u$1$1.prototype.readUInt8 = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 1, this.length), this[t8]; + }, u$1$1.prototype.readUInt16LE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 2, this.length), this[t8] | this[t8 + 1] << 8; + }, u$1$1.prototype.readUInt16BE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 2, this.length), this[t8] << 8 | this[t8 + 1]; + }, u$1$1.prototype.readUInt32LE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), (this[t8] | this[t8 + 1] << 8 | this[t8 + 2] << 16) + 16777216 * this[t8 + 3]; + }, u$1$1.prototype.readUInt32BE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), 16777216 * this[t8] + (this[t8 + 1] << 16 | this[t8 + 2] << 8 | this[t8 + 3]); + }, u$1$1.prototype.readIntLE = function(t8, r8, e10) { + t8 >>>= 0, r8 >>>= 0, e10 || x4(t8, r8, this.length); + for (var n7 = this[t8], i7 = 1, o7 = 0; ++o7 < r8 && (i7 *= 256); ) + n7 += this[t8 + o7] * i7; + return n7 >= (i7 *= 128) && (n7 -= Math.pow(2, 8 * r8)), n7; + }, u$1$1.prototype.readIntBE = function(t8, r8, e10) { + t8 >>>= 0, r8 >>>= 0, e10 || x4(t8, r8, this.length); + for (var n7 = r8, i7 = 1, o7 = this[t8 + --n7]; n7 > 0 && (i7 *= 256); ) + o7 += this[t8 + --n7] * i7; + return o7 >= (i7 *= 128) && (o7 -= Math.pow(2, 8 * r8)), o7; + }, u$1$1.prototype.readInt8 = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 1, this.length), 128 & this[t8] ? -1 * (255 - this[t8] + 1) : this[t8]; + }, u$1$1.prototype.readInt16LE = function(t8, r8) { + t8 >>>= 0, r8 || x4(t8, 2, this.length); + var e10 = this[t8] | this[t8 + 1] << 8; + return 32768 & e10 ? 4294901760 | e10 : e10; + }, u$1$1.prototype.readInt16BE = function(t8, r8) { + t8 >>>= 0, r8 || x4(t8, 2, this.length); + var e10 = this[t8 + 1] | this[t8] << 8; + return 32768 & e10 ? 4294901760 | e10 : e10; + }, u$1$1.prototype.readInt32LE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), this[t8] | this[t8 + 1] << 8 | this[t8 + 2] << 16 | this[t8 + 3] << 24; + }, u$1$1.prototype.readInt32BE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), this[t8] << 24 | this[t8 + 1] << 16 | this[t8 + 2] << 8 | this[t8 + 3]; + }, u$1$1.prototype.readFloatLE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), i$12.read(this, t8, true, 23, 4); + }, u$1$1.prototype.readFloatBE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 4, this.length), i$12.read(this, t8, false, 23, 4); + }, u$1$1.prototype.readDoubleLE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 8, this.length), i$12.read(this, t8, true, 52, 8); + }, u$1$1.prototype.readDoubleBE = function(t8, r8) { + return t8 >>>= 0, r8 || x4(t8, 8, this.length), i$12.read(this, t8, false, 52, 8); + }, u$1$1.prototype.writeUIntLE = function(t8, r8, e10, n7) { + (t8 = +t8, r8 >>>= 0, e10 >>>= 0, n7) || C3(this, t8, r8, e10, Math.pow(2, 8 * e10) - 1, 0); + var i7 = 1, o7 = 0; + for (this[r8] = 255 & t8; ++o7 < e10 && (i7 *= 256); ) + this[r8 + o7] = t8 / i7 & 255; + return r8 + e10; + }, u$1$1.prototype.writeUIntBE = function(t8, r8, e10, n7) { + (t8 = +t8, r8 >>>= 0, e10 >>>= 0, n7) || C3(this, t8, r8, e10, Math.pow(2, 8 * e10) - 1, 0); + var i7 = e10 - 1, o7 = 1; + for (this[r8 + i7] = 255 & t8; --i7 >= 0 && (o7 *= 256); ) + this[r8 + i7] = t8 / o7 & 255; + return r8 + e10; + }, u$1$1.prototype.writeUInt8 = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 1, 255, 0), this[r8] = 255 & t8, r8 + 1; + }, u$1$1.prototype.writeUInt16LE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 2, 65535, 0), this[r8] = 255 & t8, this[r8 + 1] = t8 >>> 8, r8 + 2; + }, u$1$1.prototype.writeUInt16BE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 2, 65535, 0), this[r8] = t8 >>> 8, this[r8 + 1] = 255 & t8, r8 + 2; + }, u$1$1.prototype.writeUInt32LE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 4, 4294967295, 0), this[r8 + 3] = t8 >>> 24, this[r8 + 2] = t8 >>> 16, this[r8 + 1] = t8 >>> 8, this[r8] = 255 & t8, r8 + 4; + }, u$1$1.prototype.writeUInt32BE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 4, 4294967295, 0), this[r8] = t8 >>> 24, this[r8 + 1] = t8 >>> 16, this[r8 + 2] = t8 >>> 8, this[r8 + 3] = 255 & t8, r8 + 4; + }, u$1$1.prototype.writeIntLE = function(t8, r8, e10, n7) { + if (t8 = +t8, r8 >>>= 0, !n7) { + var i7 = Math.pow(2, 8 * e10 - 1); + C3(this, t8, r8, e10, i7 - 1, -i7); + } + var o7 = 0, f8 = 1, u7 = 0; + for (this[r8] = 255 & t8; ++o7 < e10 && (f8 *= 256); ) + t8 < 0 && 0 === u7 && 0 !== this[r8 + o7 - 1] && (u7 = 1), this[r8 + o7] = (t8 / f8 >> 0) - u7 & 255; + return r8 + e10; + }, u$1$1.prototype.writeIntBE = function(t8, r8, e10, n7) { + if (t8 = +t8, r8 >>>= 0, !n7) { + var i7 = Math.pow(2, 8 * e10 - 1); + C3(this, t8, r8, e10, i7 - 1, -i7); + } + var o7 = e10 - 1, f8 = 1, u7 = 0; + for (this[r8 + o7] = 255 & t8; --o7 >= 0 && (f8 *= 256); ) + t8 < 0 && 0 === u7 && 0 !== this[r8 + o7 + 1] && (u7 = 1), this[r8 + o7] = (t8 / f8 >> 0) - u7 & 255; + return r8 + e10; + }, u$1$1.prototype.writeInt8 = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 1, 127, -128), t8 < 0 && (t8 = 255 + t8 + 1), this[r8] = 255 & t8, r8 + 1; + }, u$1$1.prototype.writeInt16LE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 2, 32767, -32768), this[r8] = 255 & t8, this[r8 + 1] = t8 >>> 8, r8 + 2; + }, u$1$1.prototype.writeInt16BE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 2, 32767, -32768), this[r8] = t8 >>> 8, this[r8 + 1] = 255 & t8, r8 + 2; + }, u$1$1.prototype.writeInt32LE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 4, 2147483647, -2147483648), this[r8] = 255 & t8, this[r8 + 1] = t8 >>> 8, this[r8 + 2] = t8 >>> 16, this[r8 + 3] = t8 >>> 24, r8 + 4; + }, u$1$1.prototype.writeInt32BE = function(t8, r8, e10) { + return t8 = +t8, r8 >>>= 0, e10 || C3(this, t8, r8, 4, 2147483647, -2147483648), t8 < 0 && (t8 = 4294967295 + t8 + 1), this[r8] = t8 >>> 24, this[r8 + 1] = t8 >>> 16, this[r8 + 2] = t8 >>> 8, this[r8 + 3] = 255 & t8, r8 + 4; + }, u$1$1.prototype.writeFloatLE = function(t8, r8, e10) { + return k3(this, t8, r8, true, e10); + }, u$1$1.prototype.writeFloatBE = function(t8, r8, e10) { + return k3(this, t8, r8, false, e10); + }, u$1$1.prototype.writeDoubleLE = function(t8, r8, e10) { + return M3(this, t8, r8, true, e10); + }, u$1$1.prototype.writeDoubleBE = function(t8, r8, e10) { + return M3(this, t8, r8, false, e10); + }, u$1$1.prototype.copy = function(t8, r8, e10, n7) { + if (!u$1$1.isBuffer(t8)) + throw new TypeError("argument should be a Buffer"); + if (e10 || (e10 = 0), n7 || 0 === n7 || (n7 = this.length), r8 >= t8.length && (r8 = t8.length), r8 || (r8 = 0), n7 > 0 && n7 < e10 && (n7 = e10), n7 === e10) + return 0; + if (0 === t8.length || 0 === this.length) + return 0; + if (r8 < 0) + throw new RangeError("targetStart out of bounds"); + if (e10 < 0 || e10 >= this.length) + throw new RangeError("Index out of range"); + if (n7 < 0) + throw new RangeError("sourceEnd out of bounds"); + n7 > this.length && (n7 = this.length), t8.length - r8 < n7 - e10 && (n7 = t8.length - r8 + e10); + var i7 = n7 - e10; + if (this === t8 && "function" == typeof Uint8Array.prototype.copyWithin) + this.copyWithin(r8, e10, n7); + else if (this === t8 && e10 < r8 && r8 < n7) + for (var o7 = i7 - 1; o7 >= 0; --o7) + t8[o7 + r8] = this[o7 + e10]; + else + Uint8Array.prototype.set.call(t8, this.subarray(e10, n7), r8); + return i7; + }, u$1$1.prototype.fill = function(t8, r8, e10, n7) { + if ("string" == typeof t8) { + if ("string" == typeof r8 ? (n7 = r8, r8 = 0, e10 = this.length) : "string" == typeof e10 && (n7 = e10, e10 = this.length), void 0 !== n7 && "string" != typeof n7) + throw new TypeError("encoding must be a string"); + if ("string" == typeof n7 && !u$1$1.isEncoding(n7)) + throw new TypeError("Unknown encoding: " + n7); + if (1 === t8.length) { + var i7 = t8.charCodeAt(0); + ("utf8" === n7 && i7 < 128 || "latin1" === n7) && (t8 = i7); + } + } else + "number" == typeof t8 ? t8 &= 255 : "boolean" == typeof t8 && (t8 = Number(t8)); + if (r8 < 0 || this.length < r8 || this.length < e10) + throw new RangeError("Out of range index"); + if (e10 <= r8) + return this; + var o7; + if (r8 >>>= 0, e10 = void 0 === e10 ? this.length : e10 >>> 0, t8 || (t8 = 0), "number" == typeof t8) + for (o7 = r8; o7 < e10; ++o7) + this[o7] = t8; + else { + var f8 = u$1$1.isBuffer(t8) ? t8 : u$1$1.from(t8, n7), s7 = f8.length; + if (0 === s7) + throw new TypeError('The value "' + t8 + '" is invalid for argument "value"'); + for (o7 = 0; o7 < e10 - r8; ++o7) + this[o7 + r8] = f8[o7 % s7]; + } + return this; + }; + j3 = /[^+/0-9A-Za-z-_]/g; + Y3 = function() { + for (var t8 = new Array(256), r8 = 0; r8 < 16; ++r8) + for (var e10 = 16 * r8, n7 = 0; n7 < 16; ++n7) + t8[e10 + n7] = "0123456789abcdef"[r8] + "0123456789abcdef"[n7]; + return t8; + }(); + e$1$1.Buffer; + e$1$1.INSPECT_MAX_BYTES; + e$1$1.kMaxLength; + e4 = {}; + n4 = e$1$1; + o4 = n4.Buffer; + o4.from && o4.alloc && o4.allocUnsafe && o4.allocUnsafeSlow ? e4 = n4 : (t4(n4, e4), e4.Buffer = f4), f4.prototype = Object.create(o4.prototype), t4(o4, f4), f4.from = function(r8, e10, n7) { + if ("number" == typeof r8) + throw new TypeError("Argument must not be a number"); + return o4(r8, e10, n7); + }, f4.alloc = function(r8, e10, n7) { + if ("number" != typeof r8) + throw new TypeError("Argument must be a number"); + var t8 = o4(r8); + return void 0 !== e10 ? "string" == typeof n7 ? t8.fill(e10, n7) : t8.fill(e10) : t8.fill(0), t8; + }, f4.allocUnsafe = function(r8) { + if ("number" != typeof r8) + throw new TypeError("Argument must be a number"); + return o4(r8); + }, f4.allocUnsafeSlow = function(r8) { + if ("number" != typeof r8) + throw new TypeError("Argument must be a number"); + return n4.SlowBuffer(r8); + }; + u4 = e4; + e$12 = {}; + s4 = u4.Buffer; + i4 = s4.isEncoding || function(t8) { + switch ((t8 = "" + t8) && t8.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + e$12.StringDecoder = a4, a4.prototype.write = function(t8) { + if (0 === t8.length) + return ""; + var e10, s7; + if (this.lastNeed) { + if (void 0 === (e10 = this.fillLast(t8))) + return ""; + s7 = this.lastNeed, this.lastNeed = 0; + } else + s7 = 0; + return s7 < t8.length ? e10 ? e10 + this.text(t8, s7) : this.text(t8, s7) : e10 || ""; + }, a4.prototype.end = function(t8) { + var e10 = t8 && t8.length ? this.write(t8) : ""; + return this.lastNeed ? e10 + "\uFFFD" : e10; + }, a4.prototype.text = function(t8, e10) { + var s7 = function(t9, e11, s8) { + var i8 = e11.length - 1; + if (i8 < s8) + return 0; + var a7 = r4(e11[i8]); + if (a7 >= 0) + return a7 > 0 && (t9.lastNeed = a7 - 1), a7; + if (--i8 < s8 || -2 === a7) + return 0; + if ((a7 = r4(e11[i8])) >= 0) + return a7 > 0 && (t9.lastNeed = a7 - 2), a7; + if (--i8 < s8 || -2 === a7) + return 0; + if ((a7 = r4(e11[i8])) >= 0) + return a7 > 0 && (2 === a7 ? a7 = 0 : t9.lastNeed = a7 - 3), a7; + return 0; + }(this, t8, e10); + if (!this.lastNeed) + return t8.toString("utf8", e10); + this.lastTotal = s7; + var i7 = t8.length - (s7 - this.lastNeed); + return t8.copy(this.lastChar, 0, i7), t8.toString("utf8", e10, i7); + }, a4.prototype.fillLast = function(t8) { + if (this.lastNeed <= t8.length) + return t8.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); + t8.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t8.length), this.lastNeed -= t8.length; + }; + exports$2$1 = {}; + _dewExec$2$1 = false; + exports$1$1 = {}; + _dewExec$1$1 = false; + exports$g2 = {}; + _dewExec$g2 = false; + buffer = dew$g2(); + buffer.Buffer; + buffer.INSPECT_MAX_BYTES; + buffer.kMaxLength; + exports$f2 = {}; + _dewExec$f2 = false; + exports$e2 = {}; + _dewExec$e2 = false; + exports$d2 = {}; + _dewExec$d2 = false; + exports$c3 = {}; + _dewExec$c2 = false; + exports$b3 = {}; + _dewExec$b3 = false; + exports$a3 = {}; + _dewExec$a3 = false; + exports$93 = {}; + _dewExec$93 = false; + _global$22 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$84 = {}; + _dewExec$83 = false; + _global$12 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$74 = {}; + _dewExec$74 = false; + exports$64 = {}; + _dewExec$64 = false; + exports$54 = {}; + _dewExec$54 = false; + exports$44 = {}; + _dewExec$44 = false; + exports$34 = {}; + _dewExec$34 = false; + _global4 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$26 = {}; + _dewExec$25 = false; + exports$18 = {}; + _dewExec$16 = false; + exports13 = {}; + _dewExec10 = false; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-CbQqNoLO.js +var promisify3; +var init_chunk_CbQqNoLO = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-CbQqNoLO.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_D3uu3VYh(); + X2._extend; + X2.callbackify; + X2.debuglog; + X2.deprecate; + X2.format; + X2.inherits; + X2.inspect; + X2.isArray; + X2.isBoolean; + X2.isBuffer; + X2.isDate; + X2.isError; + X2.isFunction; + X2.isNull; + X2.isNullOrUndefined; + X2.isNumber; + X2.isObject; + X2.isPrimitive; + X2.isRegExp; + X2.isString; + X2.isSymbol; + X2.isUndefined; + X2.log; + promisify3 = X2.promisify; + X2.types; + X2.TextEncoder = globalThis.TextEncoder; + X2.TextDecoder = globalThis.TextDecoder; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-B6-G-Ftj.js +function dew11() { + if (_dewExec11) + return exports$19; + _dewExec11 = true; + exports$19 = Stream2; + var EE = y.EventEmitter; + var inherits2 = dew$f2(); + inherits2(Stream2, EE); + Stream2.Readable = dew$34(); + Stream2.Writable = dew$83(); + Stream2.Duplex = dew$74(); + Stream2.Transform = dew$25(); + Stream2.PassThrough = dew$16(); + Stream2.finished = dew$64(); + Stream2.pipeline = dew10(); + Stream2.Stream = Stream2; + function Stream2() { + EE.call(this || _global5); + } + Stream2.prototype.pipe = function(dest, options) { + var source = this || _global5; + function ondata(chunk2) { + if (dest.writable) { + if (false === dest.write(chunk2) && source.pause) { + source.pause(); + } + } + } + source.on("data", ondata); + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + dest.on("drain", ondrain); + if (!dest._isStdio && (!options || options.end !== false)) { + source.on("end", onend); + source.on("close", onclose); + } + var didOnEnd = false; + function onend() { + if (didOnEnd) + return; + didOnEnd = true; + dest.end(); + } + function onclose() { + if (didOnEnd) + return; + didOnEnd = true; + if (typeof dest.destroy === "function") + dest.destroy(); + } + function onerror(er) { + cleanup(); + if (EE.listenerCount(this || _global5, "error") === 0) { + throw er; + } + } + source.on("error", onerror); + dest.on("error", onerror); + function cleanup() { + source.removeListener("data", ondata); + dest.removeListener("drain", ondrain); + source.removeListener("end", onend); + source.removeListener("close", onclose); + source.removeListener("error", onerror); + dest.removeListener("error", onerror); + source.removeListener("end", cleanup); + source.removeListener("close", cleanup); + dest.removeListener("close", cleanup); + } + source.on("end", cleanup); + source.on("close", cleanup); + dest.on("close", cleanup); + dest.emit("pipe", source); + return dest; + }; + return exports$19; +} +var exports$19, _dewExec11, _global5, exports14, Readable; +var init_chunk_B6_G_Ftj = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-B6-G-Ftj.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtDiafJB(); + init_chunk_B738Er4n(); + init_chunk_tHuMsdT0(); + init_chunk_CbQqNoLO(); + init_chunk_D3uu3VYh(); + init_chunk_b0rmRow7(); + exports$19 = {}; + _dewExec11 = false; + _global5 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports14 = dew11(); + Readable = exports14.Readable; + Readable.wrap = function(src, options) { + options = Object.assign({ objectMode: src.readableObjectMode != null || src.objectMode != null || true }, options); + options.destroy = function(err, callback) { + src.destroy(err); + callback(err); + }; + return new Readable(options).wrap(src); + }; + exports14.Writable; + exports14.Duplex; + exports14.Transform; + exports14.PassThrough; + exports14.finished; + exports14.pipeline; + exports14.Stream; + ({ + finished: promisify3(exports14.finished), + pipeline: promisify3(exports14.pipeline) + }); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-C4rKjYLo.js +function dew12() { + if (_dewExec12) + return exports15; + _dewExec12 = true; + exports15 = exports15 = dew$34(); + exports15.Stream = exports15; + exports15.Readable = exports15; + exports15.Writable = dew$83(); + exports15.Duplex = dew$74(); + exports15.Transform = dew$25(); + exports15.PassThrough = dew$16(); + exports15.finished = dew$64(); + exports15.pipeline = dew10(); + return exports15; +} +var exports15, _dewExec12; +var init_chunk_C4rKjYLo = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-C4rKjYLo.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_B738Er4n(); + exports15 = {}; + _dewExec12 = false; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-BsRZ0PEC.js +function dew13() { + if (_dewExec13) + return exports16; + _dewExec13 = true; + exports16 = deprecate2; + function deprecate2(fn, msg) { + if (config3("noDeprecation")) { + return fn; + } + var warned = false; + function deprecated() { + if (!warned) { + if (config3("throwDeprecation")) { + throw new Error(msg); + } else if (config3("traceDeprecation")) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this || _global6, arguments); + } + return deprecated; + } + function config3(name2) { + try { + if (!_global6.localStorage) + return false; + } catch (_6) { + return false; + } + var val = _global6.localStorage[name2]; + if (null == val) + return false; + return String(val).toLowerCase() === "true"; + } + return exports16; +} +var exports16, _dewExec13, _global6; +var init_chunk_BsRZ0PEC = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-BsRZ0PEC.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports16 = {}; + _dewExec13 = false; + _global6 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/vm.js +var vm_exports = {}; +__export(vm_exports, { + Script: () => Script5, + createContext: () => createContext, + createScript: () => createScript, + default: () => exports17, + isContext: () => isContext, + runInContext: () => runInContext, + runInNewContext: () => runInNewContext, + runInThisContext: () => runInThisContext +}); +function dew14() { + if (_dewExec14) + return exports$110; + _dewExec14 = true; + var indexOf = function(xs, item) { + if (xs.indexOf) + return xs.indexOf(item); + else + for (var i7 = 0; i7 < xs.length; i7++) { + if (xs[i7] === item) + return i7; + } + return -1; + }; + var Object_keys = function(obj) { + if (Object.keys) + return Object.keys(obj); + else { + var res = []; + for (var key in obj) + res.push(key); + return res; + } + }; + var forEach = function(xs, fn) { + if (xs.forEach) + return xs.forEach(fn); + else + for (var i7 = 0; i7 < xs.length; i7++) { + fn(xs[i7], i7, xs); + } + }; + var defineProp = function() { + try { + Object.defineProperty({}, "_", {}); + return function(obj, name2, value2) { + Object.defineProperty(obj, name2, { + writable: true, + enumerable: false, + configurable: true, + value: value2 + }); + }; + } catch (e10) { + return function(obj, name2, value2) { + obj[name2] = value2; + }; + } + }(); + var globals = ["Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape"]; + function Context() { + } + Context.prototype = {}; + var Script = exports$110.Script = function NodeScript(code) { + if (!((this || _global7) instanceof Script)) + return new Script(code); + (this || _global7).code = code; + }; + Script.prototype.runInContext = function(context2) { + if (!(context2 instanceof Context)) { + throw new TypeError("needs a 'context' argument."); + } + var iframe = document.createElement("iframe"); + if (!iframe.style) + iframe.style = {}; + iframe.style.display = "none"; + document.body.appendChild(iframe); + var win = iframe.contentWindow; + var wEval = win.eval, wExecScript = win.execScript; + if (!wEval && wExecScript) { + wExecScript.call(win, "null"); + wEval = win.eval; + } + forEach(Object_keys(context2), function(key) { + win[key] = context2[key]; + }); + forEach(globals, function(key) { + if (context2[key]) { + win[key] = context2[key]; + } + }); + var winKeys = Object_keys(win); + var res = wEval.call(win, (this || _global7).code); + forEach(Object_keys(win), function(key) { + if (key in context2 || indexOf(winKeys, key) === -1) { + context2[key] = win[key]; + } + }); + forEach(globals, function(key) { + if (!(key in context2)) { + defineProp(context2, key, win[key]); + } + }); + document.body.removeChild(iframe); + return res; + }; + Script.prototype.runInThisContext = function() { + return eval((this || _global7).code); + }; + Script.prototype.runInNewContext = function(context2) { + var ctx = Script.createContext(context2); + var res = this.runInContext(ctx); + if (context2) { + forEach(Object_keys(ctx), function(key) { + context2[key] = ctx[key]; + }); + } + return res; + }; + forEach(Object_keys(Script.prototype), function(name2) { + exports$110[name2] = Script[name2] = function(code) { + var s7 = Script(code); + return s7[name2].apply(s7, [].slice.call(arguments, 1)); + }; + }); + exports$110.isContext = function(context2) { + return context2 instanceof Context; + }; + exports$110.createScript = function(code) { + return exports$110.Script(code); + }; + exports$110.createContext = Script.createContext = function(context2) { + var copy4 = new Context(); + if (typeof context2 === "object") { + forEach(Object_keys(context2), function(key) { + copy4[key] = context2[key]; + }); + } + return copy4; + }; + return exports$110; +} +var exports$110, _dewExec14, _global7, exports17, Script5, createContext, createScript, isContext, runInContext, runInNewContext, runInThisContext; +var init_vm = __esm({ + "node_modules/@jspm/core/nodelibs/browser/vm.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports$110 = {}; + _dewExec14 = false; + _global7 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports17 = dew14(); + exports17["Script"]; + exports17["isContext"]; + exports17["createScript"]; + exports17["createContext"]; + Script5 = exports17.Script; + createContext = exports17.createContext; + createScript = exports17.createScript; + isContext = exports17.isContext; + runInContext = exports17.runInContext; + runInNewContext = exports17.runInNewContext; + runInThisContext = exports17.runInThisContext; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/crypto.js +var crypto_exports = {}; +__export(crypto_exports, { + Cipher: () => Cipher, + Cipheriv: () => Cipheriv, + Decipher: () => Decipher, + Decipheriv: () => Decipheriv, + DiffieHellman: () => DiffieHellman, + DiffieHellmanGroup: () => DiffieHellmanGroup, + Hash: () => Hash2, + Hmac: () => Hmac, + Sign: () => Sign, + Verify: () => Verify, + constants: () => constants2, + createCipher: () => createCipher, + createCipheriv: () => createCipheriv, + createCredentials: () => createCredentials, + createDecipher: () => createDecipher, + createDecipheriv: () => createDecipheriv, + createDiffieHellman: () => createDiffieHellman, + createDiffieHellmanGroup: () => createDiffieHellmanGroup, + createECDH: () => createECDH, + createHash: () => createHash, + createHmac: () => createHmac, + createSign: () => createSign, + createVerify: () => createVerify, + default: () => exports18, + getCiphers: () => getCiphers, + getDiffieHellman: () => getDiffieHellman, + getHashes: () => getHashes, + getRandomValues: () => getRandomValues, + listCiphers: () => listCiphers, + pbkdf2: () => pbkdf2, + pbkdf2Sync: () => pbkdf2Sync, + privateDecrypt: () => privateDecrypt, + privateEncrypt: () => privateEncrypt, + prng: () => prng, + pseudoRandomBytes: () => pseudoRandomBytes, + publicDecrypt: () => publicDecrypt, + publicEncrypt: () => publicEncrypt, + randomBytes: () => randomBytes, + randomFill: () => randomFill, + randomFillSync: () => randomFillSync, + randomUUID: () => randomUUID, + rng: () => rng, + webcrypto: () => webcrypto +}); +function dew$3G() { + if (_dewExec$3G) + return exports$3H; + _dewExec$3G = true; + var process$1 = process3; + var MAX_BYTES = 65536; + var MAX_UINT32 = 4294967295; + function oldBrowser() { + throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); + } + var Buffer4 = dew$15().Buffer; + var crypto2 = _global$1e.crypto || _global$1e.msCrypto; + if (crypto2 && crypto2.getRandomValues) { + exports$3H = randomBytes2; + } else { + exports$3H = oldBrowser; + } + function randomBytes2(size2, cb) { + if (size2 > MAX_UINT32) + throw new RangeError("requested too many random bytes"); + var bytes = Buffer4.allocUnsafe(size2); + if (size2 > 0) { + if (size2 > MAX_BYTES) { + for (var generated = 0; generated < size2; generated += MAX_BYTES) { + crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)); + } + } else { + crypto2.getRandomValues(bytes); + } + } + if (typeof cb === "function") { + return process$1.nextTick(function() { + cb(null, bytes); + }); + } + return bytes; + } + return exports$3H; +} +function dew$3F() { + if (_dewExec$3F) + return exports$3G; + _dewExec$3F = true; + var Buffer4 = dew$15().Buffer; + var Transform2 = exports14.Transform; + var inherits2 = dew4(); + function throwIfNotStringOrBuffer(val, prefix) { + if (!Buffer4.isBuffer(val) && typeof val !== "string") { + throw new TypeError(prefix + " must be a string or a buffer"); + } + } + function HashBase(blockSize) { + Transform2.call(this); + this._block = Buffer4.allocUnsafe(blockSize); + this._blockSize = blockSize; + this._blockOffset = 0; + this._length = [0, 0, 0, 0]; + this._finalized = false; + } + inherits2(HashBase, Transform2); + HashBase.prototype._transform = function(chunk2, encoding, callback) { + var error2 = null; + try { + this.update(chunk2, encoding); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype._flush = function(callback) { + var error2 = null; + try { + this.push(this.digest()); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype.update = function(data, encoding) { + throwIfNotStringOrBuffer(data, "Data"); + if (this._finalized) + throw new Error("Digest already called"); + if (!Buffer4.isBuffer(data)) + data = Buffer4.from(data, encoding); + var block = this._block; + var offset = 0; + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i7 = this._blockOffset; i7 < this._blockSize; ) + block[i7++] = data[offset++]; + this._update(); + this._blockOffset = 0; + } + while (offset < data.length) + block[this._blockOffset++] = data[offset++]; + for (var j6 = 0, carry = data.length * 8; carry > 0; ++j6) { + this._length[j6] += carry; + carry = this._length[j6] / 4294967296 | 0; + if (carry > 0) + this._length[j6] -= 4294967296 * carry; + } + return this; + }; + HashBase.prototype._update = function() { + throw new Error("_update is not implemented"); + }; + HashBase.prototype.digest = function(encoding) { + if (this._finalized) + throw new Error("Digest already called"); + this._finalized = true; + var digest = this._digest(); + if (encoding !== void 0) + digest = digest.toString(encoding); + this._block.fill(0); + this._blockOffset = 0; + for (var i7 = 0; i7 < 4; ++i7) + this._length[i7] = 0; + return digest; + }; + HashBase.prototype._digest = function() { + throw new Error("_digest is not implemented"); + }; + exports$3G = HashBase; + return exports$3G; +} +function dew$3E() { + if (_dewExec$3E) + return exports$3F; + _dewExec$3E = true; + var inherits2 = dew4(); + var HashBase = dew$3F(); + var Buffer4 = dew$15().Buffer; + var ARRAY16 = new Array(16); + function MD5() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + } + inherits2(MD5, HashBase); + MD5.prototype._update = function() { + var M6 = ARRAY16; + for (var i7 = 0; i7 < 16; ++i7) + M6[i7] = this._block.readInt32LE(i7 * 4); + var a7 = this._a; + var b8 = this._b; + var c7 = this._c; + var d7 = this._d; + a7 = fnF(a7, b8, c7, d7, M6[0], 3614090360, 7); + d7 = fnF(d7, a7, b8, c7, M6[1], 3905402710, 12); + c7 = fnF(c7, d7, a7, b8, M6[2], 606105819, 17); + b8 = fnF(b8, c7, d7, a7, M6[3], 3250441966, 22); + a7 = fnF(a7, b8, c7, d7, M6[4], 4118548399, 7); + d7 = fnF(d7, a7, b8, c7, M6[5], 1200080426, 12); + c7 = fnF(c7, d7, a7, b8, M6[6], 2821735955, 17); + b8 = fnF(b8, c7, d7, a7, M6[7], 4249261313, 22); + a7 = fnF(a7, b8, c7, d7, M6[8], 1770035416, 7); + d7 = fnF(d7, a7, b8, c7, M6[9], 2336552879, 12); + c7 = fnF(c7, d7, a7, b8, M6[10], 4294925233, 17); + b8 = fnF(b8, c7, d7, a7, M6[11], 2304563134, 22); + a7 = fnF(a7, b8, c7, d7, M6[12], 1804603682, 7); + d7 = fnF(d7, a7, b8, c7, M6[13], 4254626195, 12); + c7 = fnF(c7, d7, a7, b8, M6[14], 2792965006, 17); + b8 = fnF(b8, c7, d7, a7, M6[15], 1236535329, 22); + a7 = fnG(a7, b8, c7, d7, M6[1], 4129170786, 5); + d7 = fnG(d7, a7, b8, c7, M6[6], 3225465664, 9); + c7 = fnG(c7, d7, a7, b8, M6[11], 643717713, 14); + b8 = fnG(b8, c7, d7, a7, M6[0], 3921069994, 20); + a7 = fnG(a7, b8, c7, d7, M6[5], 3593408605, 5); + d7 = fnG(d7, a7, b8, c7, M6[10], 38016083, 9); + c7 = fnG(c7, d7, a7, b8, M6[15], 3634488961, 14); + b8 = fnG(b8, c7, d7, a7, M6[4], 3889429448, 20); + a7 = fnG(a7, b8, c7, d7, M6[9], 568446438, 5); + d7 = fnG(d7, a7, b8, c7, M6[14], 3275163606, 9); + c7 = fnG(c7, d7, a7, b8, M6[3], 4107603335, 14); + b8 = fnG(b8, c7, d7, a7, M6[8], 1163531501, 20); + a7 = fnG(a7, b8, c7, d7, M6[13], 2850285829, 5); + d7 = fnG(d7, a7, b8, c7, M6[2], 4243563512, 9); + c7 = fnG(c7, d7, a7, b8, M6[7], 1735328473, 14); + b8 = fnG(b8, c7, d7, a7, M6[12], 2368359562, 20); + a7 = fnH(a7, b8, c7, d7, M6[5], 4294588738, 4); + d7 = fnH(d7, a7, b8, c7, M6[8], 2272392833, 11); + c7 = fnH(c7, d7, a7, b8, M6[11], 1839030562, 16); + b8 = fnH(b8, c7, d7, a7, M6[14], 4259657740, 23); + a7 = fnH(a7, b8, c7, d7, M6[1], 2763975236, 4); + d7 = fnH(d7, a7, b8, c7, M6[4], 1272893353, 11); + c7 = fnH(c7, d7, a7, b8, M6[7], 4139469664, 16); + b8 = fnH(b8, c7, d7, a7, M6[10], 3200236656, 23); + a7 = fnH(a7, b8, c7, d7, M6[13], 681279174, 4); + d7 = fnH(d7, a7, b8, c7, M6[0], 3936430074, 11); + c7 = fnH(c7, d7, a7, b8, M6[3], 3572445317, 16); + b8 = fnH(b8, c7, d7, a7, M6[6], 76029189, 23); + a7 = fnH(a7, b8, c7, d7, M6[9], 3654602809, 4); + d7 = fnH(d7, a7, b8, c7, M6[12], 3873151461, 11); + c7 = fnH(c7, d7, a7, b8, M6[15], 530742520, 16); + b8 = fnH(b8, c7, d7, a7, M6[2], 3299628645, 23); + a7 = fnI(a7, b8, c7, d7, M6[0], 4096336452, 6); + d7 = fnI(d7, a7, b8, c7, M6[7], 1126891415, 10); + c7 = fnI(c7, d7, a7, b8, M6[14], 2878612391, 15); + b8 = fnI(b8, c7, d7, a7, M6[5], 4237533241, 21); + a7 = fnI(a7, b8, c7, d7, M6[12], 1700485571, 6); + d7 = fnI(d7, a7, b8, c7, M6[3], 2399980690, 10); + c7 = fnI(c7, d7, a7, b8, M6[10], 4293915773, 15); + b8 = fnI(b8, c7, d7, a7, M6[1], 2240044497, 21); + a7 = fnI(a7, b8, c7, d7, M6[8], 1873313359, 6); + d7 = fnI(d7, a7, b8, c7, M6[15], 4264355552, 10); + c7 = fnI(c7, d7, a7, b8, M6[6], 2734768916, 15); + b8 = fnI(b8, c7, d7, a7, M6[13], 1309151649, 21); + a7 = fnI(a7, b8, c7, d7, M6[4], 4149444226, 6); + d7 = fnI(d7, a7, b8, c7, M6[11], 3174756917, 10); + c7 = fnI(c7, d7, a7, b8, M6[2], 718787259, 15); + b8 = fnI(b8, c7, d7, a7, M6[9], 3951481745, 21); + this._a = this._a + a7 | 0; + this._b = this._b + b8 | 0; + this._c = this._c + c7 | 0; + this._d = this._d + d7 | 0; + }; + MD5.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.allocUnsafe(16); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fnF(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnG(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnH(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnI(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (c7 ^ (b8 | ~d7)) + m7 + k6 | 0, s7) + b8 | 0; + } + exports$3F = MD5; + return exports$3F; +} +function dew$3D() { + if (_dewExec$3D) + return exports$3E; + _dewExec$3D = true; + var Buffer4 = dew().Buffer; + var inherits2 = dew4(); + var HashBase = dew$3F(); + var ARRAY16 = new Array(16); + var zl = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var zr = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var sl = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sr = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + var hl = [0, 1518500249, 1859775393, 2400959708, 2840853838]; + var hr = [1352829926, 1548603684, 1836072691, 2053994217, 0]; + function RIPEMD160() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + this._e = 3285377520; + } + inherits2(RIPEMD160, HashBase); + RIPEMD160.prototype._update = function() { + var words2 = ARRAY16; + for (var j6 = 0; j6 < 16; ++j6) + words2[j6] = this._block.readInt32LE(j6 * 4); + var al = this._a | 0; + var bl = this._b | 0; + var cl = this._c | 0; + var dl = this._d | 0; + var el = this._e | 0; + var ar = this._a | 0; + var br = this._b | 0; + var cr = this._c | 0; + var dr = this._d | 0; + var er = this._e | 0; + for (var i7 = 0; i7 < 80; i7 += 1) { + var tl; + var tr; + if (i7 < 16) { + tl = fn1(al, bl, cl, dl, el, words2[zl[i7]], hl[0], sl[i7]); + tr = fn5(ar, br, cr, dr, er, words2[zr[i7]], hr[0], sr[i7]); + } else if (i7 < 32) { + tl = fn2(al, bl, cl, dl, el, words2[zl[i7]], hl[1], sl[i7]); + tr = fn4(ar, br, cr, dr, er, words2[zr[i7]], hr[1], sr[i7]); + } else if (i7 < 48) { + tl = fn3(al, bl, cl, dl, el, words2[zl[i7]], hl[2], sl[i7]); + tr = fn3(ar, br, cr, dr, er, words2[zr[i7]], hr[2], sr[i7]); + } else if (i7 < 64) { + tl = fn4(al, bl, cl, dl, el, words2[zl[i7]], hl[3], sl[i7]); + tr = fn2(ar, br, cr, dr, er, words2[zr[i7]], hr[3], sr[i7]); + } else { + tl = fn5(al, bl, cl, dl, el, words2[zl[i7]], hl[4], sl[i7]); + tr = fn1(ar, br, cr, dr, er, words2[zr[i7]], hr[4], sr[i7]); + } + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = tl; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = tr; + } + var t8 = this._b + cl + dr | 0; + this._b = this._c + dl + er | 0; + this._c = this._d + el + ar | 0; + this._d = this._e + al + br | 0; + this._e = this._a + bl + cr | 0; + this._a = t8; + }; + RIPEMD160.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.alloc ? Buffer4.alloc(20) : new Buffer4(20); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + buffer2.writeInt32LE(this._e, 16); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fn1(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn2(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn3(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + ((b8 | ~c7) ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn4(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn5(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ (c7 | ~d7)) + m7 + k6 | 0, s7) + e10 | 0; + } + exports$3E = RIPEMD160; + return exports$3E; +} +function dew$3C() { + if (_dewExec$3C) + return exports$3D; + _dewExec$3C = true; + var Buffer4 = dew$15().Buffer; + function Hash3(blockSize, finalSize) { + (this || _global$1d)._block = Buffer4.alloc(blockSize); + (this || _global$1d)._finalSize = finalSize; + (this || _global$1d)._blockSize = blockSize; + (this || _global$1d)._len = 0; + } + Hash3.prototype.update = function(data, enc) { + if (typeof data === "string") { + enc = enc || "utf8"; + data = Buffer4.from(data, enc); + } + var block = (this || _global$1d)._block; + var blockSize = (this || _global$1d)._blockSize; + var length = data.length; + var accum = (this || _global$1d)._len; + for (var offset = 0; offset < length; ) { + var assigned = accum % blockSize; + var remainder = Math.min(length - offset, blockSize - assigned); + for (var i7 = 0; i7 < remainder; i7++) { + block[assigned + i7] = data[offset + i7]; + } + accum += remainder; + offset += remainder; + if (accum % blockSize === 0) { + this._update(block); + } + } + (this || _global$1d)._len += length; + return this || _global$1d; + }; + Hash3.prototype.digest = function(enc) { + var rem = (this || _global$1d)._len % (this || _global$1d)._blockSize; + (this || _global$1d)._block[rem] = 128; + (this || _global$1d)._block.fill(0, rem + 1); + if (rem >= (this || _global$1d)._finalSize) { + this._update((this || _global$1d)._block); + (this || _global$1d)._block.fill(0); + } + var bits = (this || _global$1d)._len * 8; + if (bits <= 4294967295) { + (this || _global$1d)._block.writeUInt32BE(bits, (this || _global$1d)._blockSize - 4); + } else { + var lowBits = (bits & 4294967295) >>> 0; + var highBits = (bits - lowBits) / 4294967296; + (this || _global$1d)._block.writeUInt32BE(highBits, (this || _global$1d)._blockSize - 8); + (this || _global$1d)._block.writeUInt32BE(lowBits, (this || _global$1d)._blockSize - 4); + } + this._update((this || _global$1d)._block); + var hash = this._hash(); + return enc ? hash.toString(enc) : hash; + }; + Hash3.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + exports$3D = Hash3; + return exports$3D; +} +function dew$3B() { + if (_dewExec$3B) + return exports$3C; + _dewExec$3B = true; + var inherits2 = dew4(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha() { + this.init(); + (this || _global$1c)._w = W5; + Hash3.call(this || _global$1c, 64, 56); + } + inherits2(Sha, Hash3); + Sha.prototype.init = function() { + (this || _global$1c)._a = 1732584193; + (this || _global$1c)._b = 4023233417; + (this || _global$1c)._c = 2562383102; + (this || _global$1c)._d = 271733878; + (this || _global$1c)._e = 3285377520; + return this || _global$1c; + }; + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha.prototype._update = function(M6) { + var W6 = (this || _global$1c)._w; + var a7 = (this || _global$1c)._a | 0; + var b8 = (this || _global$1c)._b | 0; + var c7 = (this || _global$1c)._c | 0; + var d7 = (this || _global$1c)._d | 0; + var e10 = (this || _global$1c)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]; + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$1c)._a = a7 + (this || _global$1c)._a | 0; + (this || _global$1c)._b = b8 + (this || _global$1c)._b | 0; + (this || _global$1c)._c = c7 + (this || _global$1c)._c | 0; + (this || _global$1c)._d = d7 + (this || _global$1c)._d | 0; + (this || _global$1c)._e = e10 + (this || _global$1c)._e | 0; + }; + Sha.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$1c)._a | 0, 0); + H5.writeInt32BE((this || _global$1c)._b | 0, 4); + H5.writeInt32BE((this || _global$1c)._c | 0, 8); + H5.writeInt32BE((this || _global$1c)._d | 0, 12); + H5.writeInt32BE((this || _global$1c)._e | 0, 16); + return H5; + }; + exports$3C = Sha; + return exports$3C; +} +function dew$3A() { + if (_dewExec$3A) + return exports$3B; + _dewExec$3A = true; + var inherits2 = dew4(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha1() { + this.init(); + (this || _global$1b)._w = W5; + Hash3.call(this || _global$1b, 64, 56); + } + inherits2(Sha1, Hash3); + Sha1.prototype.init = function() { + (this || _global$1b)._a = 1732584193; + (this || _global$1b)._b = 4023233417; + (this || _global$1b)._c = 2562383102; + (this || _global$1b)._d = 271733878; + (this || _global$1b)._e = 3285377520; + return this || _global$1b; + }; + function rotl1(num) { + return num << 1 | num >>> 31; + } + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha1.prototype._update = function(M6) { + var W6 = (this || _global$1b)._w; + var a7 = (this || _global$1b)._a | 0; + var b8 = (this || _global$1b)._b | 0; + var c7 = (this || _global$1b)._c | 0; + var d7 = (this || _global$1b)._d | 0; + var e10 = (this || _global$1b)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = rotl1(W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]); + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$1b)._a = a7 + (this || _global$1b)._a | 0; + (this || _global$1b)._b = b8 + (this || _global$1b)._b | 0; + (this || _global$1b)._c = c7 + (this || _global$1b)._c | 0; + (this || _global$1b)._d = d7 + (this || _global$1b)._d | 0; + (this || _global$1b)._e = e10 + (this || _global$1b)._e | 0; + }; + Sha1.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$1b)._a | 0, 0); + H5.writeInt32BE((this || _global$1b)._b | 0, 4); + H5.writeInt32BE((this || _global$1b)._c | 0, 8); + H5.writeInt32BE((this || _global$1b)._d | 0, 12); + H5.writeInt32BE((this || _global$1b)._e | 0, 16); + return H5; + }; + exports$3B = Sha1; + return exports$3B; +} +function dew$3z() { + if (_dewExec$3z) + return exports$3A; + _dewExec$3z = true; + var inherits2 = dew4(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var K5 = [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]; + var W5 = new Array(64); + function Sha256() { + this.init(); + (this || _global$1a)._w = W5; + Hash3.call(this || _global$1a, 64, 56); + } + inherits2(Sha256, Hash3); + Sha256.prototype.init = function() { + (this || _global$1a)._a = 1779033703; + (this || _global$1a)._b = 3144134277; + (this || _global$1a)._c = 1013904242; + (this || _global$1a)._d = 2773480762; + (this || _global$1a)._e = 1359893119; + (this || _global$1a)._f = 2600822924; + (this || _global$1a)._g = 528734635; + (this || _global$1a)._h = 1541459225; + return this || _global$1a; + }; + function ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7) { + return (x7 >>> 2 | x7 << 30) ^ (x7 >>> 13 | x7 << 19) ^ (x7 >>> 22 | x7 << 10); + } + function sigma1(x7) { + return (x7 >>> 6 | x7 << 26) ^ (x7 >>> 11 | x7 << 21) ^ (x7 >>> 25 | x7 << 7); + } + function gamma0(x7) { + return (x7 >>> 7 | x7 << 25) ^ (x7 >>> 18 | x7 << 14) ^ x7 >>> 3; + } + function gamma1(x7) { + return (x7 >>> 17 | x7 << 15) ^ (x7 >>> 19 | x7 << 13) ^ x7 >>> 10; + } + Sha256.prototype._update = function(M6) { + var W6 = (this || _global$1a)._w; + var a7 = (this || _global$1a)._a | 0; + var b8 = (this || _global$1a)._b | 0; + var c7 = (this || _global$1a)._c | 0; + var d7 = (this || _global$1a)._d | 0; + var e10 = (this || _global$1a)._e | 0; + var f8 = (this || _global$1a)._f | 0; + var g7 = (this || _global$1a)._g | 0; + var h8 = (this || _global$1a)._h | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 64; ++i7) + W6[i7] = gamma1(W6[i7 - 2]) + W6[i7 - 7] + gamma0(W6[i7 - 15]) + W6[i7 - 16] | 0; + for (var j6 = 0; j6 < 64; ++j6) { + var T1 = h8 + sigma1(e10) + ch(e10, f8, g7) + K5[j6] + W6[j6] | 0; + var T22 = sigma0(a7) + maj(a7, b8, c7) | 0; + h8 = g7; + g7 = f8; + f8 = e10; + e10 = d7 + T1 | 0; + d7 = c7; + c7 = b8; + b8 = a7; + a7 = T1 + T22 | 0; + } + (this || _global$1a)._a = a7 + (this || _global$1a)._a | 0; + (this || _global$1a)._b = b8 + (this || _global$1a)._b | 0; + (this || _global$1a)._c = c7 + (this || _global$1a)._c | 0; + (this || _global$1a)._d = d7 + (this || _global$1a)._d | 0; + (this || _global$1a)._e = e10 + (this || _global$1a)._e | 0; + (this || _global$1a)._f = f8 + (this || _global$1a)._f | 0; + (this || _global$1a)._g = g7 + (this || _global$1a)._g | 0; + (this || _global$1a)._h = h8 + (this || _global$1a)._h | 0; + }; + Sha256.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(32); + H5.writeInt32BE((this || _global$1a)._a, 0); + H5.writeInt32BE((this || _global$1a)._b, 4); + H5.writeInt32BE((this || _global$1a)._c, 8); + H5.writeInt32BE((this || _global$1a)._d, 12); + H5.writeInt32BE((this || _global$1a)._e, 16); + H5.writeInt32BE((this || _global$1a)._f, 20); + H5.writeInt32BE((this || _global$1a)._g, 24); + H5.writeInt32BE((this || _global$1a)._h, 28); + return H5; + }; + exports$3A = Sha256; + return exports$3A; +} +function dew$3y() { + if (_dewExec$3y) + return exports$3z; + _dewExec$3y = true; + var inherits2 = dew4(); + var Sha256 = dew$3z(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var W5 = new Array(64); + function Sha224() { + this.init(); + (this || _global$19)._w = W5; + Hash3.call(this || _global$19, 64, 56); + } + inherits2(Sha224, Sha256); + Sha224.prototype.init = function() { + (this || _global$19)._a = 3238371032; + (this || _global$19)._b = 914150663; + (this || _global$19)._c = 812702999; + (this || _global$19)._d = 4144912697; + (this || _global$19)._e = 4290775857; + (this || _global$19)._f = 1750603025; + (this || _global$19)._g = 1694076839; + (this || _global$19)._h = 3204075428; + return this || _global$19; + }; + Sha224.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(28); + H5.writeInt32BE((this || _global$19)._a, 0); + H5.writeInt32BE((this || _global$19)._b, 4); + H5.writeInt32BE((this || _global$19)._c, 8); + H5.writeInt32BE((this || _global$19)._d, 12); + H5.writeInt32BE((this || _global$19)._e, 16); + H5.writeInt32BE((this || _global$19)._f, 20); + H5.writeInt32BE((this || _global$19)._g, 24); + return H5; + }; + exports$3z = Sha224; + return exports$3z; +} +function dew$3x() { + if (_dewExec$3x) + return exports$3y; + _dewExec$3x = true; + var inherits2 = dew4(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var K5 = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + var W5 = new Array(160); + function Sha512() { + this.init(); + (this || _global$18)._w = W5; + Hash3.call(this || _global$18, 128, 112); + } + inherits2(Sha512, Hash3); + Sha512.prototype.init = function() { + (this || _global$18)._ah = 1779033703; + (this || _global$18)._bh = 3144134277; + (this || _global$18)._ch = 1013904242; + (this || _global$18)._dh = 2773480762; + (this || _global$18)._eh = 1359893119; + (this || _global$18)._fh = 2600822924; + (this || _global$18)._gh = 528734635; + (this || _global$18)._hh = 1541459225; + (this || _global$18)._al = 4089235720; + (this || _global$18)._bl = 2227873595; + (this || _global$18)._cl = 4271175723; + (this || _global$18)._dl = 1595750129; + (this || _global$18)._el = 2917565137; + (this || _global$18)._fl = 725511199; + (this || _global$18)._gl = 4215389547; + (this || _global$18)._hl = 327033209; + return this || _global$18; + }; + function Ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7, xl) { + return (x7 >>> 28 | xl << 4) ^ (xl >>> 2 | x7 << 30) ^ (xl >>> 7 | x7 << 25); + } + function sigma1(x7, xl) { + return (x7 >>> 14 | xl << 18) ^ (x7 >>> 18 | xl << 14) ^ (xl >>> 9 | x7 << 23); + } + function Gamma0(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ x7 >>> 7; + } + function Gamma0l(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ (x7 >>> 7 | xl << 25); + } + function Gamma1(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ x7 >>> 6; + } + function Gamma1l(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ (x7 >>> 6 | xl << 26); + } + function getCarry(a7, b8) { + return a7 >>> 0 < b8 >>> 0 ? 1 : 0; + } + Sha512.prototype._update = function(M6) { + var W6 = (this || _global$18)._w; + var ah = (this || _global$18)._ah | 0; + var bh = (this || _global$18)._bh | 0; + var ch = (this || _global$18)._ch | 0; + var dh = (this || _global$18)._dh | 0; + var eh = (this || _global$18)._eh | 0; + var fh = (this || _global$18)._fh | 0; + var gh = (this || _global$18)._gh | 0; + var hh = (this || _global$18)._hh | 0; + var al = (this || _global$18)._al | 0; + var bl = (this || _global$18)._bl | 0; + var cl = (this || _global$18)._cl | 0; + var dl = (this || _global$18)._dl | 0; + var el = (this || _global$18)._el | 0; + var fl = (this || _global$18)._fl | 0; + var gl = (this || _global$18)._gl | 0; + var hl = (this || _global$18)._hl | 0; + for (var i7 = 0; i7 < 32; i7 += 2) { + W6[i7] = M6.readInt32BE(i7 * 4); + W6[i7 + 1] = M6.readInt32BE(i7 * 4 + 4); + } + for (; i7 < 160; i7 += 2) { + var xh = W6[i7 - 15 * 2]; + var xl = W6[i7 - 15 * 2 + 1]; + var gamma0 = Gamma0(xh, xl); + var gamma0l = Gamma0l(xl, xh); + xh = W6[i7 - 2 * 2]; + xl = W6[i7 - 2 * 2 + 1]; + var gamma1 = Gamma1(xh, xl); + var gamma1l = Gamma1l(xl, xh); + var Wi7h = W6[i7 - 7 * 2]; + var Wi7l = W6[i7 - 7 * 2 + 1]; + var Wi16h = W6[i7 - 16 * 2]; + var Wi16l = W6[i7 - 16 * 2 + 1]; + var Wil = gamma0l + Wi7l | 0; + var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0; + Wil = Wil + gamma1l | 0; + Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0; + Wil = Wil + Wi16l | 0; + Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0; + W6[i7] = Wih; + W6[i7 + 1] = Wil; + } + for (var j6 = 0; j6 < 160; j6 += 2) { + Wih = W6[j6]; + Wil = W6[j6 + 1]; + var majh = maj(ah, bh, ch); + var majl = maj(al, bl, cl); + var sigma0h = sigma0(ah, al); + var sigma0l = sigma0(al, ah); + var sigma1h = sigma1(eh, el); + var sigma1l = sigma1(el, eh); + var Kih = K5[j6]; + var Kil = K5[j6 + 1]; + var chh = Ch(eh, fh, gh); + var chl = Ch(el, fl, gl); + var t1l = hl + sigma1l | 0; + var t1h = hh + sigma1h + getCarry(t1l, hl) | 0; + t1l = t1l + chl | 0; + t1h = t1h + chh + getCarry(t1l, chl) | 0; + t1l = t1l + Kil | 0; + t1h = t1h + Kih + getCarry(t1l, Kil) | 0; + t1l = t1l + Wil | 0; + t1h = t1h + Wih + getCarry(t1l, Wil) | 0; + var t2l = sigma0l + majl | 0; + var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0; + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = dl + t1l | 0; + eh = dh + t1h + getCarry(el, dl) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = t1l + t2l | 0; + ah = t1h + t2h + getCarry(al, t1l) | 0; + } + (this || _global$18)._al = (this || _global$18)._al + al | 0; + (this || _global$18)._bl = (this || _global$18)._bl + bl | 0; + (this || _global$18)._cl = (this || _global$18)._cl + cl | 0; + (this || _global$18)._dl = (this || _global$18)._dl + dl | 0; + (this || _global$18)._el = (this || _global$18)._el + el | 0; + (this || _global$18)._fl = (this || _global$18)._fl + fl | 0; + (this || _global$18)._gl = (this || _global$18)._gl + gl | 0; + (this || _global$18)._hl = (this || _global$18)._hl + hl | 0; + (this || _global$18)._ah = (this || _global$18)._ah + ah + getCarry((this || _global$18)._al, al) | 0; + (this || _global$18)._bh = (this || _global$18)._bh + bh + getCarry((this || _global$18)._bl, bl) | 0; + (this || _global$18)._ch = (this || _global$18)._ch + ch + getCarry((this || _global$18)._cl, cl) | 0; + (this || _global$18)._dh = (this || _global$18)._dh + dh + getCarry((this || _global$18)._dl, dl) | 0; + (this || _global$18)._eh = (this || _global$18)._eh + eh + getCarry((this || _global$18)._el, el) | 0; + (this || _global$18)._fh = (this || _global$18)._fh + fh + getCarry((this || _global$18)._fl, fl) | 0; + (this || _global$18)._gh = (this || _global$18)._gh + gh + getCarry((this || _global$18)._gl, gl) | 0; + (this || _global$18)._hh = (this || _global$18)._hh + hh + getCarry((this || _global$18)._hl, hl) | 0; + }; + Sha512.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(64); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$18)._ah, (this || _global$18)._al, 0); + writeInt64BE((this || _global$18)._bh, (this || _global$18)._bl, 8); + writeInt64BE((this || _global$18)._ch, (this || _global$18)._cl, 16); + writeInt64BE((this || _global$18)._dh, (this || _global$18)._dl, 24); + writeInt64BE((this || _global$18)._eh, (this || _global$18)._el, 32); + writeInt64BE((this || _global$18)._fh, (this || _global$18)._fl, 40); + writeInt64BE((this || _global$18)._gh, (this || _global$18)._gl, 48); + writeInt64BE((this || _global$18)._hh, (this || _global$18)._hl, 56); + return H5; + }; + exports$3y = Sha512; + return exports$3y; +} +function dew$3w() { + if (_dewExec$3w) + return exports$3x; + _dewExec$3w = true; + var inherits2 = dew4(); + var SHA512 = dew$3x(); + var Hash3 = dew$3C(); + var Buffer4 = dew$15().Buffer; + var W5 = new Array(160); + function Sha384() { + this.init(); + (this || _global$17)._w = W5; + Hash3.call(this || _global$17, 128, 112); + } + inherits2(Sha384, SHA512); + Sha384.prototype.init = function() { + (this || _global$17)._ah = 3418070365; + (this || _global$17)._bh = 1654270250; + (this || _global$17)._ch = 2438529370; + (this || _global$17)._dh = 355462360; + (this || _global$17)._eh = 1731405415; + (this || _global$17)._fh = 2394180231; + (this || _global$17)._gh = 3675008525; + (this || _global$17)._hh = 1203062813; + (this || _global$17)._al = 3238371032; + (this || _global$17)._bl = 914150663; + (this || _global$17)._cl = 812702999; + (this || _global$17)._dl = 4144912697; + (this || _global$17)._el = 4290775857; + (this || _global$17)._fl = 1750603025; + (this || _global$17)._gl = 1694076839; + (this || _global$17)._hl = 3204075428; + return this || _global$17; + }; + Sha384.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(48); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$17)._ah, (this || _global$17)._al, 0); + writeInt64BE((this || _global$17)._bh, (this || _global$17)._bl, 8); + writeInt64BE((this || _global$17)._ch, (this || _global$17)._cl, 16); + writeInt64BE((this || _global$17)._dh, (this || _global$17)._dl, 24); + writeInt64BE((this || _global$17)._eh, (this || _global$17)._el, 32); + writeInt64BE((this || _global$17)._fh, (this || _global$17)._fl, 40); + return H5; + }; + exports$3x = Sha384; + return exports$3x; +} +function dew$3v() { + if (_dewExec$3v) + return module$f.exports; + _dewExec$3v = true; + var exports28 = module$f.exports = function SHA(algorithm) { + algorithm = algorithm.toLowerCase(); + var Algorithm = exports28[algorithm]; + if (!Algorithm) + throw new Error(algorithm + " is not supported (we accept pull requests)"); + return new Algorithm(); + }; + exports28.sha = dew$3B(); + exports28.sha1 = dew$3A(); + exports28.sha224 = dew$3y(); + exports28.sha256 = dew$3z(); + exports28.sha384 = dew$3w(); + exports28.sha512 = dew$3x(); + return module$f.exports; +} +function dew$3u() { + if (_dewExec$3u) + return exports$3v; + _dewExec$3u = true; + var Buffer4 = dew$15().Buffer; + var Transform2 = exports14.Transform; + var StringDecoder2 = e$12.StringDecoder; + var inherits2 = dew4(); + function CipherBase(hashMode) { + Transform2.call(this || _global$16); + (this || _global$16).hashMode = typeof hashMode === "string"; + if ((this || _global$16).hashMode) { + (this || _global$16)[hashMode] = (this || _global$16)._finalOrDigest; + } else { + (this || _global$16).final = (this || _global$16)._finalOrDigest; + } + if ((this || _global$16)._final) { + (this || _global$16).__final = (this || _global$16)._final; + (this || _global$16)._final = null; + } + (this || _global$16)._decoder = null; + (this || _global$16)._encoding = null; + } + inherits2(CipherBase, Transform2); + CipherBase.prototype.update = function(data, inputEnc, outputEnc) { + if (typeof data === "string") { + data = Buffer4.from(data, inputEnc); + } + var outData = this._update(data); + if ((this || _global$16).hashMode) + return this || _global$16; + if (outputEnc) { + outData = this._toString(outData, outputEnc); + } + return outData; + }; + CipherBase.prototype.setAutoPadding = function() { + }; + CipherBase.prototype.getAuthTag = function() { + throw new Error("trying to get auth tag in unsupported state"); + }; + CipherBase.prototype.setAuthTag = function() { + throw new Error("trying to set auth tag in unsupported state"); + }; + CipherBase.prototype.setAAD = function() { + throw new Error("trying to set aad in unsupported state"); + }; + CipherBase.prototype._transform = function(data, _6, next) { + var err; + try { + if ((this || _global$16).hashMode) { + this._update(data); + } else { + this.push(this._update(data)); + } + } catch (e10) { + err = e10; + } finally { + next(err); + } + }; + CipherBase.prototype._flush = function(done) { + var err; + try { + this.push(this.__final()); + } catch (e10) { + err = e10; + } + done(err); + }; + CipherBase.prototype._finalOrDigest = function(outputEnc) { + var outData = this.__final() || Buffer4.alloc(0); + if (outputEnc) { + outData = this._toString(outData, outputEnc, true); + } + return outData; + }; + CipherBase.prototype._toString = function(value2, enc, fin) { + if (!(this || _global$16)._decoder) { + (this || _global$16)._decoder = new StringDecoder2(enc); + (this || _global$16)._encoding = enc; + } + if ((this || _global$16)._encoding !== enc) + throw new Error("can't switch encodings"); + var out = (this || _global$16)._decoder.write(value2); + if (fin) { + out += (this || _global$16)._decoder.end(); + } + return out; + }; + exports$3v = CipherBase; + return exports$3v; +} +function dew$3t() { + if (_dewExec$3t) + return exports$3u; + _dewExec$3t = true; + var inherits2 = dew4(); + var MD5 = dew$3E(); + var RIPEMD160 = dew$3D(); + var sha = dew$3v(); + var Base2 = dew$3u(); + function Hash3(hash) { + Base2.call(this, "digest"); + this._hash = hash; + } + inherits2(Hash3, Base2); + Hash3.prototype._update = function(data) { + this._hash.update(data); + }; + Hash3.prototype._final = function() { + return this._hash.digest(); + }; + exports$3u = function createHash2(alg) { + alg = alg.toLowerCase(); + if (alg === "md5") + return new MD5(); + if (alg === "rmd160" || alg === "ripemd160") + return new RIPEMD160(); + return new Hash3(sha(alg)); + }; + return exports$3u; +} +function dew$3s() { + if (_dewExec$3s) + return exports$3t; + _dewExec$3s = true; + var inherits2 = dew4(); + var Buffer4 = dew$15().Buffer; + var Base2 = dew$3u(); + var ZEROS = Buffer4.alloc(128); + var blocksize = 64; + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + key = alg(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = [ipad]; + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.push(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._alg(Buffer4.concat(this._hash)); + return this._alg(Buffer4.concat([this._opad, h8])); + }; + exports$3t = Hmac2; + return exports$3t; +} +function dew$3r() { + if (_dewExec$3r) + return exports$3s; + _dewExec$3r = true; + var MD5 = dew$3E(); + exports$3s = function(buffer2) { + return new MD5().update(buffer2).digest(); + }; + return exports$3s; +} +function dew$3q() { + if (_dewExec$3q) + return exports$3r; + _dewExec$3q = true; + var inherits2 = dew4(); + var Legacy = dew$3s(); + var Base2 = dew$3u(); + var Buffer4 = dew$15().Buffer; + var md5 = dew$3r(); + var RIPEMD160 = dew$3D(); + var sha = dew$3v(); + var ZEROS = Buffer4.alloc(128); + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + var hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + key = hash.update(key).digest(); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + this._hash.update(ipad); + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.update(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._hash.digest(); + var hash = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg); + return hash.update(this._opad).update(h8).digest(); + }; + exports$3r = function createHmac2(alg, key) { + alg = alg.toLowerCase(); + if (alg === "rmd160" || alg === "ripemd160") { + return new Hmac2("rmd160", key); + } + if (alg === "md5") { + return new Legacy(md5, key); + } + return new Hmac2(alg, key); + }; + return exports$3r; +} +function dew$3p() { + if (_dewExec$3p) + return exports$3q; + _dewExec$3p = true; + exports$3q = _algorithms$2; + return exports$3q; +} +function dew$3o() { + if (_dewExec$3o) + return exports$3p; + _dewExec$3o = true; + var MAX_ALLOC = Math.pow(2, 30) - 1; + exports$3p = function(iterations, keylen) { + if (typeof iterations !== "number") { + throw new TypeError("Iterations not a number"); + } + if (iterations < 0) { + throw new TypeError("Bad iterations"); + } + if (typeof keylen !== "number") { + throw new TypeError("Key length not a number"); + } + if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { + throw new TypeError("Bad key length"); + } + }; + return exports$3p; +} +function dew$3n() { + if (_dewExec$3n) + return exports$3o; + _dewExec$3n = true; + var process$1 = process3; + var defaultEncoding; + if (_global$15.process && _global$15.process.browser) { + defaultEncoding = "utf-8"; + } else if (_global$15.process && _global$15.process.version) { + var pVersionMajor = parseInt(process$1.version.split(".")[0].slice(1), 10); + defaultEncoding = pVersionMajor >= 6 ? "utf-8" : "binary"; + } else { + defaultEncoding = "utf-8"; + } + exports$3o = defaultEncoding; + return exports$3o; +} +function dew$3m() { + if (_dewExec$3m) + return exports$3n; + _dewExec$3m = true; + var Buffer4 = dew$15().Buffer; + exports$3n = function(thing, encoding, name2) { + if (Buffer4.isBuffer(thing)) { + return thing; + } else if (typeof thing === "string") { + return Buffer4.from(thing, encoding); + } else if (ArrayBuffer.isView(thing)) { + return Buffer4.from(thing.buffer); + } else { + throw new TypeError(name2 + " must be a string, a Buffer, a typed array or a DataView"); + } + }; + return exports$3n; +} +function dew$3l() { + if (_dewExec$3l) + return exports$3m; + _dewExec$3l = true; + var md5 = dew$3r(); + var RIPEMD160 = dew$3D(); + var sha = dew$3v(); + var Buffer4 = dew$15().Buffer; + var checkParameters = dew$3o(); + var defaultEncoding = dew$3n(); + var toBuffer = dew$3m(); + var ZEROS = Buffer4.alloc(128); + var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 + }; + function Hmac2(alg, key, saltLen) { + var hash = getDigest(alg); + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + if (key.length > blocksize) { + key = hash(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + var opad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + var ipad1 = Buffer4.allocUnsafe(blocksize + saltLen + 4); + ipad.copy(ipad1, 0, 0, blocksize); + (this || _global$14).ipad1 = ipad1; + (this || _global$14).ipad2 = ipad; + (this || _global$14).opad = opad; + (this || _global$14).alg = alg; + (this || _global$14).blocksize = blocksize; + (this || _global$14).hash = hash; + (this || _global$14).size = sizes[alg]; + } + Hmac2.prototype.run = function(data, ipad) { + data.copy(ipad, (this || _global$14).blocksize); + var h8 = this.hash(ipad); + h8.copy((this || _global$14).opad, (this || _global$14).blocksize); + return this.hash((this || _global$14).opad); + }; + function getDigest(alg) { + function shaFunc(data) { + return sha(alg).update(data).digest(); + } + function rmd160Func(data) { + return new RIPEMD160().update(data).digest(); + } + if (alg === "rmd160" || alg === "ripemd160") + return rmd160Func; + if (alg === "md5") + return md5; + return shaFunc; + } + function pbkdf22(password, salt, iterations, keylen, digest) { + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + digest = digest || "sha1"; + var hmac = new Hmac2(digest, password, salt.length); + var DK = Buffer4.allocUnsafe(keylen); + var block1 = Buffer4.allocUnsafe(salt.length + 4); + salt.copy(block1, 0, 0, salt.length); + var destPos = 0; + var hLen = sizes[digest]; + var l7 = Math.ceil(keylen / hLen); + for (var i7 = 1; i7 <= l7; i7++) { + block1.writeUInt32BE(i7, salt.length); + var T6 = hmac.run(block1, hmac.ipad1); + var U6 = T6; + for (var j6 = 1; j6 < iterations; j6++) { + U6 = hmac.run(U6, hmac.ipad2); + for (var k6 = 0; k6 < hLen; k6++) + T6[k6] ^= U6[k6]; + } + T6.copy(DK, destPos); + destPos += hLen; + } + return DK; + } + exports$3m = pbkdf22; + return exports$3m; +} +function dew$3k() { + if (_dewExec$3k) + return exports$3l; + _dewExec$3k = true; + var Buffer4 = dew$15().Buffer; + var checkParameters = dew$3o(); + var defaultEncoding = dew$3n(); + var sync = dew$3l(); + var toBuffer = dew$3m(); + var ZERO_BUF; + var subtle = _global$13.crypto && _global$13.crypto.subtle; + var toBrowser = { + sha: "SHA-1", + "sha-1": "SHA-1", + sha1: "SHA-1", + sha256: "SHA-256", + "sha-256": "SHA-256", + sha384: "SHA-384", + "sha-384": "SHA-384", + "sha-512": "SHA-512", + sha512: "SHA-512" + }; + var checks = []; + function checkNative(algo) { + if (_global$13.process && !_global$13.process.browser) { + return Promise.resolve(false); + } + if (!subtle || !subtle.importKey || !subtle.deriveBits) { + return Promise.resolve(false); + } + if (checks[algo] !== void 0) { + return checks[algo]; + } + ZERO_BUF = ZERO_BUF || Buffer4.alloc(8); + var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() { + return true; + }).catch(function() { + return false; + }); + checks[algo] = prom; + return prom; + } + var nextTick3; + function getNextTick() { + if (nextTick3) { + return nextTick3; + } + if (_global$13.process && _global$13.process.nextTick) { + nextTick3 = _global$13.process.nextTick; + } else if (_global$13.queueMicrotask) { + nextTick3 = _global$13.queueMicrotask; + } else if (_global$13.setImmediate) { + nextTick3 = _global$13.setImmediate; + } else { + nextTick3 = _global$13.setTimeout; + } + return nextTick3; + } + function browserPbkdf2(password, salt, iterations, length, algo) { + return subtle.importKey("raw", password, { + name: "PBKDF2" + }, false, ["deriveBits"]).then(function(key) { + return subtle.deriveBits({ + name: "PBKDF2", + salt, + iterations, + hash: { + name: algo + } + }, key, length << 3); + }).then(function(res) { + return Buffer4.from(res); + }); + } + function resolvePromise(promise, callback) { + promise.then(function(out) { + getNextTick()(function() { + callback(null, out); + }); + }, function(e10) { + getNextTick()(function() { + callback(e10); + }); + }); + } + exports$3l = function(password, salt, iterations, keylen, digest, callback) { + if (typeof digest === "function") { + callback = digest; + digest = void 0; + } + digest = digest || "sha1"; + var algo = toBrowser[digest.toLowerCase()]; + if (!algo || typeof _global$13.Promise !== "function") { + getNextTick()(function() { + var out; + try { + out = sync(password, salt, iterations, keylen, digest); + } catch (e10) { + return callback(e10); + } + callback(null, out); + }); + return; + } + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + if (typeof callback !== "function") + throw new Error("No callback provided to pbkdf2"); + resolvePromise(checkNative(algo).then(function(resp) { + if (resp) + return browserPbkdf2(password, salt, iterations, keylen, algo); + return sync(password, salt, iterations, keylen, digest); + }), callback); + }; + return exports$3l; +} +function dew$3j() { + if (_dewExec$3j) + return exports$3k; + _dewExec$3j = true; + exports$3k.pbkdf2 = dew$3k(); + exports$3k.pbkdf2Sync = dew$3l(); + return exports$3k; +} +function dew$3i() { + if (_dewExec$3i) + return exports$3j; + _dewExec$3i = true; + exports$3j.readUInt32BE = function readUInt32BE(bytes, off3) { + var res = bytes[0 + off3] << 24 | bytes[1 + off3] << 16 | bytes[2 + off3] << 8 | bytes[3 + off3]; + return res >>> 0; + }; + exports$3j.writeUInt32BE = function writeUInt32BE(bytes, value2, off3) { + bytes[0 + off3] = value2 >>> 24; + bytes[1 + off3] = value2 >>> 16 & 255; + bytes[2 + off3] = value2 >>> 8 & 255; + bytes[3 + off3] = value2 & 255; + }; + exports$3j.ip = function ip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + } + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$3j.rip = function rip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 0; i7 < 4; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 4; i7 < 8; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$3j.pc1 = function pc1(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 7; i7 >= 5; i7--) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var i7 = 1; i7 <= 3; i7++) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$3j.r28shl = function r28shl(num, shift) { + return num << shift & 268435455 | num >>> 28 - shift; + }; + var pc2table = [ + // inL => outL + 14, + 11, + 17, + 4, + 27, + 23, + 25, + 0, + 13, + 22, + 7, + 18, + 5, + 9, + 16, + 24, + 2, + 20, + 12, + 21, + 1, + 8, + 15, + 26, + // inR => outR + 15, + 4, + 25, + 19, + 9, + 1, + 26, + 16, + 5, + 11, + 23, + 8, + 12, + 7, + 17, + 0, + 22, + 3, + 10, + 14, + 6, + 20, + 27, + 24 + ]; + exports$3j.pc2 = function pc22(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + var len = pc2table.length >>> 1; + for (var i7 = 0; i7 < len; i7++) { + outL <<= 1; + outL |= inL >>> pc2table[i7] & 1; + } + for (var i7 = len; i7 < pc2table.length; i7++) { + outR <<= 1; + outR |= inR >>> pc2table[i7] & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$3j.expand = function expand(r8, out, off3) { + var outL = 0; + var outR = 0; + outL = (r8 & 1) << 5 | r8 >>> 27; + for (var i7 = 23; i7 >= 15; i7 -= 4) { + outL <<= 6; + outL |= r8 >>> i7 & 63; + } + for (var i7 = 11; i7 >= 3; i7 -= 4) { + outR |= r8 >>> i7 & 63; + outR <<= 6; + } + outR |= (r8 & 31) << 1 | r8 >>> 31; + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + var sTable = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; + exports$3j.substitute = function substitute(inL, inR) { + var out = 0; + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inL >>> 18 - i7 * 6 & 63; + var sb = sTable[i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inR >>> 18 - i7 * 6 & 63; + var sb = sTable[4 * 64 + i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + return out >>> 0; + }; + var permuteTable = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; + exports$3j.permute = function permute(num) { + var out = 0; + for (var i7 = 0; i7 < permuteTable.length; i7++) { + out <<= 1; + out |= num >>> permuteTable[i7] & 1; + } + return out >>> 0; + }; + exports$3j.padSplit = function padSplit(num, size2, group2) { + var str2 = num.toString(2); + while (str2.length < size2) + str2 = "0" + str2; + var out = []; + for (var i7 = 0; i7 < size2; i7 += group2) + out.push(str2.slice(i7, i7 + group2)); + return out.join(" "); + }; + return exports$3j; +} +function dew$3h() { + if (_dewExec$3h) + return exports$3i; + _dewExec$3h = true; + exports$3i = assert4; + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + assert4.equal = function assertEqual(l7, r8, msg) { + if (l7 != r8) + throw new Error(msg || "Assertion failed: " + l7 + " != " + r8); + }; + return exports$3i; +} +function dew$3g() { + if (_dewExec$3g) + return exports$3h; + _dewExec$3g = true; + var assert4 = dew$3h(); + function Cipher2(options) { + this.options = options; + this.type = this.options.type; + this.blockSize = 8; + this._init(); + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; + this.padding = options.padding !== false; + } + exports$3h = Cipher2; + Cipher2.prototype._init = function _init() { + }; + Cipher2.prototype.update = function update2(data) { + if (data.length === 0) + return []; + if (this.type === "decrypt") + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); + }; + Cipher2.prototype._buffer = function _buffer(data, off3) { + var min2 = Math.min(this.buffer.length - this.bufferOff, data.length - off3); + for (var i7 = 0; i7 < min2; i7++) + this.buffer[this.bufferOff + i7] = data[off3 + i7]; + this.bufferOff += min2; + return min2; + }; + Cipher2.prototype._flushBuffer = function _flushBuffer(out, off3) { + this._update(this.buffer, 0, out, off3); + this.bufferOff = 0; + return this.blockSize; + }; + Cipher2.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = (this.bufferOff + data.length) / this.blockSize | 0; + var out = new Array(count2 * this.blockSize); + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + var max2 = data.length - (data.length - inputOff) % this.blockSize; + for (; inputOff < max2; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + return out; + }; + Cipher2.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count2 * this.blockSize); + for (; count2 > 0; count2--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + inputOff += this._buffer(data, inputOff); + return out; + }; + Cipher2.prototype.final = function final(buffer2) { + var first; + if (buffer2) + first = this.update(buffer2); + var last2; + if (this.type === "encrypt") + last2 = this._finalEncrypt(); + else + last2 = this._finalDecrypt(); + if (first) + return first.concat(last2); + else + return last2; + }; + Cipher2.prototype._pad = function _pad(buffer2, off3) { + if (off3 === 0) + return false; + while (off3 < buffer2.length) + buffer2[off3++] = 0; + return true; + }; + Cipher2.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; + }; + Cipher2.prototype._unpad = function _unpad(buffer2) { + return buffer2; + }; + Cipher2.prototype._finalDecrypt = function _finalDecrypt() { + assert4.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + return this._unpad(out); + }; + return exports$3h; +} +function dew$3f() { + if (_dewExec$3f) + return exports$3g; + _dewExec$3f = true; + var assert4 = dew$3h(); + var inherits2 = dew4(); + var utils = dew$3i(); + var Cipher2 = dew$3g(); + function DESState() { + this.tmp = new Array(2); + this.keys = null; + } + function DES(options) { + Cipher2.call(this, options); + var state = new DESState(); + this._desState = state; + this.deriveKeys(state, options.key); + } + inherits2(DES, Cipher2); + exports$3g = DES; + DES.create = function create2(options) { + return new DES(options); + }; + var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; + DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + assert4.equal(key.length, this.blockSize, "Invalid key length"); + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var shift = shiftTable[i7 >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i7); + } + }; + DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + var l7 = utils.readUInt32BE(inp, inOff); + var r8 = utils.readUInt32BE(inp, inOff + 4); + utils.ip(l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + if (this.type === "encrypt") + this._encrypt(state, l7, r8, state.tmp, 0); + else + this._decrypt(state, l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + utils.writeUInt32BE(out, l7, outOff); + utils.writeUInt32BE(out, r8, outOff + 4); + }; + DES.prototype._pad = function _pad(buffer2, off3) { + if (this.padding === false) { + return false; + } + var value2 = buffer2.length - off3; + for (var i7 = off3; i7 < buffer2.length; i7++) + buffer2[i7] = value2; + return true; + }; + DES.prototype._unpad = function _unpad(buffer2) { + if (this.padding === false) { + return buffer2; + } + var pad2 = buffer2[buffer2.length - 1]; + for (var i7 = buffer2.length - pad2; i7 < buffer2.length; i7++) + assert4.equal(buffer2[i7], pad2); + return buffer2.slice(0, buffer2.length - pad2); + }; + DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off3) { + var l7 = lStart; + var r8 = rStart; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(r8, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = r8; + r8 = (l7 ^ f8) >>> 0; + l7 = t8; + } + utils.rip(r8, l7, out, off3); + }; + DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off3) { + var l7 = rStart; + var r8 = lStart; + for (var i7 = state.keys.length - 2; i7 >= 0; i7 -= 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(l7, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = l7; + l7 = (r8 ^ f8) >>> 0; + r8 = t8; + } + utils.rip(l7, r8, out, off3); + }; + return exports$3g; +} +function dew$3e() { + if (_dewExec$3e) + return exports$3f; + _dewExec$3e = true; + var assert4 = dew$3h(); + var inherits2 = dew4(); + var proto = {}; + function CBCState(iv) { + assert4.equal(iv.length, 8, "Invalid IV length"); + this.iv = new Array(8); + for (var i7 = 0; i7 < this.iv.length; i7++) + this.iv[i7] = iv[i7]; + } + function instantiate(Base2) { + function CBC(options) { + Base2.call(this, options); + this._cbcInit(); + } + inherits2(CBC, Base2); + var keys2 = Object.keys(proto); + for (var i7 = 0; i7 < keys2.length; i7++) { + var key = keys2[i7]; + CBC.prototype[key] = proto[key]; + } + CBC.create = function create2(options) { + return new CBC(options); + }; + return CBC; + } + exports$3f.instantiate = instantiate; + proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; + }; + proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + var iv = state.iv; + if (this.type === "encrypt") { + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] ^= inp[inOff + i7]; + superProto._update.call(this, iv, 0, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = out[outOff + i7]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + out[outOff + i7] ^= iv[i7]; + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = inp[inOff + i7]; + } + }; + return exports$3f; +} +function dew$3d() { + if (_dewExec$3d) + return exports$3e; + _dewExec$3d = true; + var assert4 = dew$3h(); + var inherits2 = dew4(); + var Cipher2 = dew$3g(); + var DES = dew$3f(); + function EDEState(type3, key) { + assert4.equal(key.length, 24, "Invalid key length"); + var k1 = key.slice(0, 8); + var k22 = key.slice(8, 16); + var k32 = key.slice(16, 24); + if (type3 === "encrypt") { + this.ciphers = [DES.create({ + type: "encrypt", + key: k1 + }), DES.create({ + type: "decrypt", + key: k22 + }), DES.create({ + type: "encrypt", + key: k32 + })]; + } else { + this.ciphers = [DES.create({ + type: "decrypt", + key: k32 + }), DES.create({ + type: "encrypt", + key: k22 + }), DES.create({ + type: "decrypt", + key: k1 + })]; + } + } + function EDE(options) { + Cipher2.call(this, options); + var state = new EDEState(this.type, this.options.key); + this._edeState = state; + } + inherits2(EDE, Cipher2); + exports$3e = EDE; + EDE.create = function create2(options) { + return new EDE(options); + }; + EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); + }; + EDE.prototype._pad = DES.prototype._pad; + EDE.prototype._unpad = DES.prototype._unpad; + return exports$3e; +} +function dew$3c() { + if (_dewExec$3c) + return exports$3d; + _dewExec$3c = true; + exports$3d.utils = dew$3i(); + exports$3d.Cipher = dew$3g(); + exports$3d.DES = dew$3f(); + exports$3d.CBC = dew$3e(); + exports$3d.EDE = dew$3d(); + return exports$3d; +} +function dew$3b() { + if (_dewExec$3b) + return exports$3c; + _dewExec$3b = true; + var CipherBase = dew$3u(); + var des = dew$3c(); + var inherits2 = dew4(); + var Buffer4 = dew$15().Buffer; + var modes = { + "des-ede3-cbc": des.CBC.instantiate(des.EDE), + "des-ede3": des.EDE, + "des-ede-cbc": des.CBC.instantiate(des.EDE), + "des-ede": des.EDE, + "des-cbc": des.CBC.instantiate(des.DES), + "des-ecb": des.DES + }; + modes.des = modes["des-cbc"]; + modes.des3 = modes["des-ede3-cbc"]; + exports$3c = DES; + inherits2(DES, CipherBase); + function DES(opts) { + CipherBase.call(this || _global$122); + var modeName = opts.mode.toLowerCase(); + var mode = modes[modeName]; + var type3; + if (opts.decrypt) { + type3 = "decrypt"; + } else { + type3 = "encrypt"; + } + var key = opts.key; + if (!Buffer4.isBuffer(key)) { + key = Buffer4.from(key); + } + if (modeName === "des-ede" || modeName === "des-ede-cbc") { + key = Buffer4.concat([key, key.slice(0, 8)]); + } + var iv = opts.iv; + if (!Buffer4.isBuffer(iv)) { + iv = Buffer4.from(iv); + } + (this || _global$122)._des = mode.create({ + key, + iv, + type: type3 + }); + } + DES.prototype._update = function(data) { + return Buffer4.from((this || _global$122)._des.update(data)); + }; + DES.prototype._final = function() { + return Buffer4.from((this || _global$122)._des.final()); + }; + return exports$3c; +} +function dew$3a() { + if (_dewExec$3a) + return exports$3b; + _dewExec$3a = true; + exports$3b.encrypt = function(self2, block) { + return self2._cipher.encryptBlock(block); + }; + exports$3b.decrypt = function(self2, block) { + return self2._cipher.decryptBlock(block); + }; + return exports$3b; +} +function dew$39() { + if (_dewExec$39) + return exports$3a; + _dewExec$39 = true; + var Buffer4 = dew().Buffer; + exports$3a = function xor2(a7, b8) { + var length = Math.min(a7.length, b8.length); + var buffer2 = new Buffer4(length); + for (var i7 = 0; i7 < length; ++i7) { + buffer2[i7] = a7[i7] ^ b8[i7]; + } + return buffer2; + }; + return exports$3a; +} +function dew$38() { + if (_dewExec$38) + return exports$39; + _dewExec$38 = true; + var xor2 = dew$39(); + exports$39.encrypt = function(self2, block) { + var data = xor2(block, self2._prev); + self2._prev = self2._cipher.encryptBlock(data); + return self2._prev; + }; + exports$39.decrypt = function(self2, block) { + var pad2 = self2._prev; + self2._prev = block; + var out = self2._cipher.decryptBlock(block); + return xor2(out, pad2); + }; + return exports$39; +} +function dew$37() { + if (_dewExec$37) + return exports$38; + _dewExec$37 = true; + var Buffer4 = dew$15().Buffer; + var xor2 = dew$39(); + function encryptStart(self2, data, decrypt) { + var len = data.length; + var out = xor2(data, self2._cache); + self2._cache = self2._cache.slice(len); + self2._prev = Buffer4.concat([self2._prev, decrypt ? data : out]); + return out; + } + exports$38.encrypt = function(self2, data, decrypt) { + var out = Buffer4.allocUnsafe(0); + var len; + while (data.length) { + if (self2._cache.length === 0) { + self2._cache = self2._cipher.encryptBlock(self2._prev); + self2._prev = Buffer4.allocUnsafe(0); + } + if (self2._cache.length <= data.length) { + len = self2._cache.length; + out = Buffer4.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]); + data = data.slice(len); + } else { + out = Buffer4.concat([out, encryptStart(self2, data, decrypt)]); + break; + } + } + return out; + }; + return exports$38; +} +function dew$36() { + if (_dewExec$36) + return exports$37; + _dewExec$36 = true; + var Buffer4 = dew$15().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2 = self2._cipher.encryptBlock(self2._prev); + var out = pad2[0] ^ byteParam; + self2._prev = Buffer4.concat([self2._prev.slice(1), Buffer4.from([decrypt ? byteParam : out])]); + return out; + } + exports$37.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$37; +} +function dew$35() { + if (_dewExec$35) + return exports$36; + _dewExec$35 = true; + var Buffer4 = dew$15().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2; + var i7 = -1; + var len = 8; + var out = 0; + var bit, value2; + while (++i7 < len) { + pad2 = self2._cipher.encryptBlock(self2._prev); + bit = byteParam & 1 << 7 - i7 ? 128 : 0; + value2 = pad2[0] ^ bit; + out += (value2 & 128) >> i7 % 8; + self2._prev = shiftIn(self2._prev, decrypt ? bit : value2); + } + return out; + } + function shiftIn(buffer2, value2) { + var len = buffer2.length; + var i7 = -1; + var out = Buffer4.allocUnsafe(buffer2.length); + buffer2 = Buffer4.concat([buffer2, Buffer4.from([value2])]); + while (++i7 < len) { + out[i7] = buffer2[i7] << 1 | buffer2[i7 + 1] >> 7; + } + return out; + } + exports$36.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$36; +} +function dew$342() { + if (_dewExec$342) + return exports$35; + _dewExec$342 = true; + var Buffer4 = dew().Buffer; + var xor2 = dew$39(); + function getBlock(self2) { + self2._prev = self2._cipher.encryptBlock(self2._prev); + return self2._prev; + } + exports$35.encrypt = function(self2, chunk2) { + while (self2._cache.length < chunk2.length) { + self2._cache = Buffer4.concat([self2._cache, getBlock(self2)]); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$35; +} +function dew$332() { + if (_dewExec$332) + return exports$342; + _dewExec$332 = true; + function incr32(iv) { + var len = iv.length; + var item; + while (len--) { + item = iv.readUInt8(len); + if (item === 255) { + iv.writeUInt8(0, len); + } else { + item++; + iv.writeUInt8(item, len); + break; + } + } + } + exports$342 = incr32; + return exports$342; +} +function dew$322() { + if (_dewExec$322) + return exports$332; + _dewExec$322 = true; + var xor2 = dew$39(); + var Buffer4 = dew$15().Buffer; + var incr32 = dew$332(); + function getBlock(self2) { + var out = self2._cipher.encryptBlockRaw(self2._prev); + incr32(self2._prev); + return out; + } + var blockSize = 16; + exports$332.encrypt = function(self2, chunk2) { + var chunkNum = Math.ceil(chunk2.length / blockSize); + var start = self2._cache.length; + self2._cache = Buffer4.concat([self2._cache, Buffer4.allocUnsafe(chunkNum * blockSize)]); + for (var i7 = 0; i7 < chunkNum; i7++) { + var out = getBlock(self2); + var offset = start + i7 * blockSize; + self2._cache.writeUInt32BE(out[0], offset + 0); + self2._cache.writeUInt32BE(out[1], offset + 4); + self2._cache.writeUInt32BE(out[2], offset + 8); + self2._cache.writeUInt32BE(out[3], offset + 12); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$332; +} +function dew$31() { + if (_dewExec$31) + return exports$322; + _dewExec$31 = true; + var modeModules = { + ECB: dew$3a(), + CBC: dew$38(), + CFB: dew$37(), + CFB8: dew$36(), + CFB1: dew$35(), + OFB: dew$342(), + CTR: dew$322(), + GCM: dew$322() + }; + var modes = _list$2; + for (var key in modes) { + modes[key].module = modeModules[modes[key].mode]; + } + exports$322 = modes; + return exports$322; +} +function dew$30() { + if (_dewExec$30) + return exports$31; + _dewExec$30 = true; + var Buffer4 = dew$15().Buffer; + function asUInt32Array(buf) { + if (!Buffer4.isBuffer(buf)) + buf = Buffer4.from(buf); + var len = buf.length / 4 | 0; + var out = new Array(len); + for (var i7 = 0; i7 < len; i7++) { + out[i7] = buf.readUInt32BE(i7 * 4); + } + return out; + } + function scrubVec(v8) { + for (var i7 = 0; i7 < v8.length; v8++) { + v8[i7] = 0; + } + } + function cryptBlock(M6, keySchedule, SUB_MIX, SBOX, nRounds) { + var SUB_MIX0 = SUB_MIX[0]; + var SUB_MIX1 = SUB_MIX[1]; + var SUB_MIX2 = SUB_MIX[2]; + var SUB_MIX3 = SUB_MIX[3]; + var s0 = M6[0] ^ keySchedule[0]; + var s1 = M6[1] ^ keySchedule[1]; + var s22 = M6[2] ^ keySchedule[2]; + var s32 = M6[3] ^ keySchedule[3]; + var t0, t1, t22, t32; + var ksRow = 4; + for (var round2 = 1; round2 < nRounds; round2++) { + t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s22 >>> 8 & 255] ^ SUB_MIX3[s32 & 255] ^ keySchedule[ksRow++]; + t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s22 >>> 16 & 255] ^ SUB_MIX2[s32 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++]; + t22 = SUB_MIX0[s22 >>> 24] ^ SUB_MIX1[s32 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++]; + t32 = SUB_MIX0[s32 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s22 & 255] ^ keySchedule[ksRow++]; + s0 = t0; + s1 = t1; + s22 = t22; + s32 = t32; + } + t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s22 >>> 8 & 255] << 8 | SBOX[s32 & 255]) ^ keySchedule[ksRow++]; + t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s22 >>> 16 & 255] << 16 | SBOX[s32 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++]; + t22 = (SBOX[s22 >>> 24] << 24 | SBOX[s32 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++]; + t32 = (SBOX[s32 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s22 & 255]) ^ keySchedule[ksRow++]; + t0 = t0 >>> 0; + t1 = t1 >>> 0; + t22 = t22 >>> 0; + t32 = t32 >>> 0; + return [t0, t1, t22, t32]; + } + var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; + var G5 = function() { + var d7 = new Array(256); + for (var j6 = 0; j6 < 256; j6++) { + if (j6 < 128) { + d7[j6] = j6 << 1; + } else { + d7[j6] = j6 << 1 ^ 283; + } + } + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX = [[], [], [], []]; + var INV_SUB_MIX = [[], [], [], []]; + var x7 = 0; + var xi = 0; + for (var i7 = 0; i7 < 256; ++i7) { + var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; + sx = sx >>> 8 ^ sx & 255 ^ 99; + SBOX[x7] = sx; + INV_SBOX[sx] = x7; + var x22 = d7[x7]; + var x42 = d7[x22]; + var x8 = d7[x42]; + var t8 = d7[sx] * 257 ^ sx * 16843008; + SUB_MIX[0][x7] = t8 << 24 | t8 >>> 8; + SUB_MIX[1][x7] = t8 << 16 | t8 >>> 16; + SUB_MIX[2][x7] = t8 << 8 | t8 >>> 24; + SUB_MIX[3][x7] = t8; + t8 = x8 * 16843009 ^ x42 * 65537 ^ x22 * 257 ^ x7 * 16843008; + INV_SUB_MIX[0][sx] = t8 << 24 | t8 >>> 8; + INV_SUB_MIX[1][sx] = t8 << 16 | t8 >>> 16; + INV_SUB_MIX[2][sx] = t8 << 8 | t8 >>> 24; + INV_SUB_MIX[3][sx] = t8; + if (x7 === 0) { + x7 = xi = 1; + } else { + x7 = x22 ^ d7[d7[d7[x8 ^ x22]]]; + xi ^= d7[d7[xi]]; + } + } + return { + SBOX, + INV_SBOX, + SUB_MIX, + INV_SUB_MIX + }; + }(); + function AES(key) { + (this || _global$11)._key = asUInt32Array(key); + this._reset(); + } + AES.blockSize = 4 * 4; + AES.keySize = 256 / 8; + AES.prototype.blockSize = AES.blockSize; + AES.prototype.keySize = AES.keySize; + AES.prototype._reset = function() { + var keyWords = (this || _global$11)._key; + var keySize = keyWords.length; + var nRounds = keySize + 6; + var ksRows = (nRounds + 1) * 4; + var keySchedule = []; + for (var k6 = 0; k6 < keySize; k6++) { + keySchedule[k6] = keyWords[k6]; + } + for (k6 = keySize; k6 < ksRows; k6++) { + var t8 = keySchedule[k6 - 1]; + if (k6 % keySize === 0) { + t8 = t8 << 8 | t8 >>> 24; + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + t8 ^= RCON[k6 / keySize | 0] << 24; + } else if (keySize > 6 && k6 % keySize === 4) { + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + } + keySchedule[k6] = keySchedule[k6 - keySize] ^ t8; + } + var invKeySchedule = []; + for (var ik = 0; ik < ksRows; ik++) { + var ksR = ksRows - ik; + var tt3 = keySchedule[ksR - (ik % 4 ? 0 : 4)]; + if (ik < 4 || ksR <= 4) { + invKeySchedule[ik] = tt3; + } else { + invKeySchedule[ik] = G5.INV_SUB_MIX[0][G5.SBOX[tt3 >>> 24]] ^ G5.INV_SUB_MIX[1][G5.SBOX[tt3 >>> 16 & 255]] ^ G5.INV_SUB_MIX[2][G5.SBOX[tt3 >>> 8 & 255]] ^ G5.INV_SUB_MIX[3][G5.SBOX[tt3 & 255]]; + } + } + (this || _global$11)._nRounds = nRounds; + (this || _global$11)._keySchedule = keySchedule; + (this || _global$11)._invKeySchedule = invKeySchedule; + }; + AES.prototype.encryptBlockRaw = function(M6) { + M6 = asUInt32Array(M6); + return cryptBlock(M6, (this || _global$11)._keySchedule, G5.SUB_MIX, G5.SBOX, (this || _global$11)._nRounds); + }; + AES.prototype.encryptBlock = function(M6) { + var out = this.encryptBlockRaw(M6); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[1], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[3], 12); + return buf; + }; + AES.prototype.decryptBlock = function(M6) { + M6 = asUInt32Array(M6); + var m1 = M6[1]; + M6[1] = M6[3]; + M6[3] = m1; + var out = cryptBlock(M6, (this || _global$11)._invKeySchedule, G5.INV_SUB_MIX, G5.INV_SBOX, (this || _global$11)._nRounds); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[3], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[1], 12); + return buf; + }; + AES.prototype.scrub = function() { + scrubVec((this || _global$11)._keySchedule); + scrubVec((this || _global$11)._invKeySchedule); + scrubVec((this || _global$11)._key); + }; + exports$31.AES = AES; + return exports$31; +} +function dew$2$() { + if (_dewExec$2$) + return exports$30; + _dewExec$2$ = true; + var Buffer4 = dew$15().Buffer; + var ZEROES = Buffer4.alloc(16, 0); + function toArray3(buf) { + return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)]; + } + function fromArray(out) { + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0] >>> 0, 0); + buf.writeUInt32BE(out[1] >>> 0, 4); + buf.writeUInt32BE(out[2] >>> 0, 8); + buf.writeUInt32BE(out[3] >>> 0, 12); + return buf; + } + function GHASH(key) { + (this || _global$10).h = key; + (this || _global$10).state = Buffer4.alloc(16, 0); + (this || _global$10).cache = Buffer4.allocUnsafe(0); + } + GHASH.prototype.ghash = function(block) { + var i7 = -1; + while (++i7 < block.length) { + (this || _global$10).state[i7] ^= block[i7]; + } + this._multiply(); + }; + GHASH.prototype._multiply = function() { + var Vi = toArray3((this || _global$10).h); + var Zi = [0, 0, 0, 0]; + var j6, xi, lsbVi; + var i7 = -1; + while (++i7 < 128) { + xi = ((this || _global$10).state[~~(i7 / 8)] & 1 << 7 - i7 % 8) !== 0; + if (xi) { + Zi[0] ^= Vi[0]; + Zi[1] ^= Vi[1]; + Zi[2] ^= Vi[2]; + Zi[3] ^= Vi[3]; + } + lsbVi = (Vi[3] & 1) !== 0; + for (j6 = 3; j6 > 0; j6--) { + Vi[j6] = Vi[j6] >>> 1 | (Vi[j6 - 1] & 1) << 31; + } + Vi[0] = Vi[0] >>> 1; + if (lsbVi) { + Vi[0] = Vi[0] ^ 225 << 24; + } + } + (this || _global$10).state = fromArray(Zi); + }; + GHASH.prototype.update = function(buf) { + (this || _global$10).cache = Buffer4.concat([(this || _global$10).cache, buf]); + var chunk2; + while ((this || _global$10).cache.length >= 16) { + chunk2 = (this || _global$10).cache.slice(0, 16); + (this || _global$10).cache = (this || _global$10).cache.slice(16); + this.ghash(chunk2); + } + }; + GHASH.prototype.final = function(abl, bl) { + if ((this || _global$10).cache.length) { + this.ghash(Buffer4.concat([(this || _global$10).cache, ZEROES], 16)); + } + this.ghash(fromArray([0, abl, 0, bl])); + return (this || _global$10).state; + }; + exports$30 = GHASH; + return exports$30; +} +function dew$2_() { + if (_dewExec$2_) + return exports$2$; + _dewExec$2_ = true; + var aes = dew$30(); + var Buffer4 = dew$15().Buffer; + var Transform2 = dew$3u(); + var inherits2 = dew4(); + var GHASH = dew$2$(); + var xor2 = dew$39(); + var incr32 = dew$332(); + function xorTest(a7, b8) { + var out = 0; + if (a7.length !== b8.length) + out++; + var len = Math.min(a7.length, b8.length); + for (var i7 = 0; i7 < len; ++i7) { + out += a7[i7] ^ b8[i7]; + } + return out; + } + function calcIv(self2, iv, ck) { + if (iv.length === 12) { + self2._finID = Buffer4.concat([iv, Buffer4.from([0, 0, 0, 1])]); + return Buffer4.concat([iv, Buffer4.from([0, 0, 0, 2])]); + } + var ghash = new GHASH(ck); + var len = iv.length; + var toPad = len % 16; + ghash.update(iv); + if (toPad) { + toPad = 16 - toPad; + ghash.update(Buffer4.alloc(toPad, 0)); + } + ghash.update(Buffer4.alloc(8, 0)); + var ivBits = len * 8; + var tail2 = Buffer4.alloc(8); + tail2.writeUIntBE(ivBits, 0, 8); + ghash.update(tail2); + self2._finID = ghash.state; + var out = Buffer4.from(self2._finID); + incr32(out); + return out; + } + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$$); + var h8 = Buffer4.alloc(4, 0); + (this || _global$$)._cipher = new aes.AES(key); + var ck = (this || _global$$)._cipher.encryptBlock(h8); + (this || _global$$)._ghash = new GHASH(ck); + iv = calcIv(this || _global$$, iv, ck); + (this || _global$$)._prev = Buffer4.from(iv); + (this || _global$$)._cache = Buffer4.allocUnsafe(0); + (this || _global$$)._secCache = Buffer4.allocUnsafe(0); + (this || _global$$)._decrypt = decrypt; + (this || _global$$)._alen = 0; + (this || _global$$)._len = 0; + (this || _global$$)._mode = mode; + (this || _global$$)._authTag = null; + (this || _global$$)._called = false; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + if (!(this || _global$$)._called && (this || _global$$)._alen) { + var rump = 16 - (this || _global$$)._alen % 16; + if (rump < 16) { + rump = Buffer4.alloc(rump, 0); + (this || _global$$)._ghash.update(rump); + } + } + (this || _global$$)._called = true; + var out = (this || _global$$)._mode.encrypt(this || _global$$, chunk2); + if ((this || _global$$)._decrypt) { + (this || _global$$)._ghash.update(chunk2); + } else { + (this || _global$$)._ghash.update(out); + } + (this || _global$$)._len += chunk2.length; + return out; + }; + StreamCipher.prototype._final = function() { + if ((this || _global$$)._decrypt && !(this || _global$$)._authTag) + throw new Error("Unsupported state or unable to authenticate data"); + var tag = xor2((this || _global$$)._ghash.final((this || _global$$)._alen * 8, (this || _global$$)._len * 8), (this || _global$$)._cipher.encryptBlock((this || _global$$)._finID)); + if ((this || _global$$)._decrypt && xorTest(tag, (this || _global$$)._authTag)) + throw new Error("Unsupported state or unable to authenticate data"); + (this || _global$$)._authTag = tag; + (this || _global$$)._cipher.scrub(); + }; + StreamCipher.prototype.getAuthTag = function getAuthTag() { + if ((this || _global$$)._decrypt || !Buffer4.isBuffer((this || _global$$)._authTag)) + throw new Error("Attempting to get auth tag in unsupported state"); + return (this || _global$$)._authTag; + }; + StreamCipher.prototype.setAuthTag = function setAuthTag(tag) { + if (!(this || _global$$)._decrypt) + throw new Error("Attempting to set auth tag in unsupported state"); + (this || _global$$)._authTag = tag; + }; + StreamCipher.prototype.setAAD = function setAAD(buf) { + if ((this || _global$$)._called) + throw new Error("Attempting to set AAD in unsupported state"); + (this || _global$$)._ghash.update(buf); + (this || _global$$)._alen += buf.length; + }; + exports$2$ = StreamCipher; + return exports$2$; +} +function dew$2Z() { + if (_dewExec$2Z) + return exports$2_; + _dewExec$2Z = true; + var aes = dew$30(); + var Buffer4 = dew$15().Buffer; + var Transform2 = dew$3u(); + var inherits2 = dew4(); + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$_); + (this || _global$_)._cipher = new aes.AES(key); + (this || _global$_)._prev = Buffer4.from(iv); + (this || _global$_)._cache = Buffer4.allocUnsafe(0); + (this || _global$_)._secCache = Buffer4.allocUnsafe(0); + (this || _global$_)._decrypt = decrypt; + (this || _global$_)._mode = mode; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + return (this || _global$_)._mode.encrypt(this || _global$_, chunk2, (this || _global$_)._decrypt); + }; + StreamCipher.prototype._final = function() { + (this || _global$_)._cipher.scrub(); + }; + exports$2_ = StreamCipher; + return exports$2_; +} +function dew$2Y() { + if (_dewExec$2Y) + return exports$2Z; + _dewExec$2Y = true; + var Buffer4 = dew$15().Buffer; + var MD5 = dew$3E(); + function EVP_BytesToKey(password, salt, keyBits, ivLen) { + if (!Buffer4.isBuffer(password)) + password = Buffer4.from(password, "binary"); + if (salt) { + if (!Buffer4.isBuffer(salt)) + salt = Buffer4.from(salt, "binary"); + if (salt.length !== 8) + throw new RangeError("salt should be Buffer with 8 byte length"); + } + var keyLen = keyBits / 8; + var key = Buffer4.alloc(keyLen); + var iv = Buffer4.alloc(ivLen || 0); + var tmp = Buffer4.alloc(0); + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5(); + hash.update(tmp); + hash.update(password); + if (salt) + hash.update(salt); + tmp = hash.digest(); + var used = 0; + if (keyLen > 0) { + var keyStart = key.length - keyLen; + used = Math.min(keyLen, tmp.length); + tmp.copy(key, keyStart, 0, used); + keyLen -= used; + } + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen; + var length = Math.min(ivLen, tmp.length - used); + tmp.copy(iv, ivStart, used, used + length); + ivLen -= length; + } + } + tmp.fill(0); + return { + key, + iv + }; + } + exports$2Z = EVP_BytesToKey; + return exports$2Z; +} +function dew$2X() { + if (_dewExec$2X) + return exports$2Y; + _dewExec$2X = true; + var MODES = dew$31(); + var AuthCipher = dew$2_(); + var Buffer4 = dew$15().Buffer; + var StreamCipher = dew$2Z(); + var Transform2 = dew$3u(); + var aes = dew$30(); + var ebtk = dew$2Y(); + var inherits2 = dew4(); + function Cipher2(mode, key, iv) { + Transform2.call(this || _global$Z); + (this || _global$Z)._cache = new Splitter(); + (this || _global$Z)._cipher = new aes.AES(key); + (this || _global$Z)._prev = Buffer4.from(iv); + (this || _global$Z)._mode = mode; + (this || _global$Z)._autopadding = true; + } + inherits2(Cipher2, Transform2); + Cipher2.prototype._update = function(data) { + (this || _global$Z)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$Z)._cache.get()) { + thing = (this || _global$Z)._mode.encrypt(this || _global$Z, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + var PADDING = Buffer4.alloc(16, 16); + Cipher2.prototype._final = function() { + var chunk2 = (this || _global$Z)._cache.flush(); + if ((this || _global$Z)._autopadding) { + chunk2 = (this || _global$Z)._mode.encrypt(this || _global$Z, chunk2); + (this || _global$Z)._cipher.scrub(); + return chunk2; + } + if (!chunk2.equals(PADDING)) { + (this || _global$Z)._cipher.scrub(); + throw new Error("data not multiple of block length"); + } + }; + Cipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$Z)._autopadding = !!setTo; + return this || _global$Z; + }; + function Splitter() { + (this || _global$Z).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$Z).cache = Buffer4.concat([(this || _global$Z).cache, data]); + }; + Splitter.prototype.get = function() { + if ((this || _global$Z).cache.length > 15) { + var out = (this || _global$Z).cache.slice(0, 16); + (this || _global$Z).cache = (this || _global$Z).cache.slice(16); + return out; + } + return null; + }; + Splitter.prototype.flush = function() { + var len = 16 - (this || _global$Z).cache.length; + var padBuff = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + padBuff.writeUInt8(len, i7); + } + return Buffer4.concat([(this || _global$Z).cache, padBuff]); + }; + function createCipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv); + } + return new Cipher2(config3.module, password, iv); + } + function createCipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + exports$2Y.createCipheriv = createCipheriv2; + exports$2Y.createCipher = createCipher2; + return exports$2Y; +} +function dew$2W() { + if (_dewExec$2W) + return exports$2X; + _dewExec$2W = true; + var AuthCipher = dew$2_(); + var Buffer4 = dew$15().Buffer; + var MODES = dew$31(); + var StreamCipher = dew$2Z(); + var Transform2 = dew$3u(); + var aes = dew$30(); + var ebtk = dew$2Y(); + var inherits2 = dew4(); + function Decipher2(mode, key, iv) { + Transform2.call(this || _global$Y); + (this || _global$Y)._cache = new Splitter(); + (this || _global$Y)._last = void 0; + (this || _global$Y)._cipher = new aes.AES(key); + (this || _global$Y)._prev = Buffer4.from(iv); + (this || _global$Y)._mode = mode; + (this || _global$Y)._autopadding = true; + } + inherits2(Decipher2, Transform2); + Decipher2.prototype._update = function(data) { + (this || _global$Y)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$Y)._cache.get((this || _global$Y)._autopadding)) { + thing = (this || _global$Y)._mode.decrypt(this || _global$Y, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + Decipher2.prototype._final = function() { + var chunk2 = (this || _global$Y)._cache.flush(); + if ((this || _global$Y)._autopadding) { + return unpad((this || _global$Y)._mode.decrypt(this || _global$Y, chunk2)); + } else if (chunk2) { + throw new Error("data not multiple of block length"); + } + }; + Decipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$Y)._autopadding = !!setTo; + return this || _global$Y; + }; + function Splitter() { + (this || _global$Y).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$Y).cache = Buffer4.concat([(this || _global$Y).cache, data]); + }; + Splitter.prototype.get = function(autoPadding) { + var out; + if (autoPadding) { + if ((this || _global$Y).cache.length > 16) { + out = (this || _global$Y).cache.slice(0, 16); + (this || _global$Y).cache = (this || _global$Y).cache.slice(16); + return out; + } + } else { + if ((this || _global$Y).cache.length >= 16) { + out = (this || _global$Y).cache.slice(0, 16); + (this || _global$Y).cache = (this || _global$Y).cache.slice(16); + return out; + } + } + return null; + }; + Splitter.prototype.flush = function() { + if ((this || _global$Y).cache.length) + return (this || _global$Y).cache; + }; + function unpad(last2) { + var padded = last2[15]; + if (padded < 1 || padded > 16) { + throw new Error("unable to decrypt data"); + } + var i7 = -1; + while (++i7 < padded) { + if (last2[i7 + (16 - padded)] !== padded) { + throw new Error("unable to decrypt data"); + } + } + if (padded === 16) + return; + return last2.slice(0, 16 - padded); + } + function createDecipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv, true); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv, true); + } + return new Decipher2(config3.module, password, iv); + } + function createDecipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + exports$2X.createDecipher = createDecipher2; + exports$2X.createDecipheriv = createDecipheriv2; + return exports$2X; +} +function dew$2V() { + if (_dewExec$2V) + return exports$2W; + _dewExec$2V = true; + var ciphers = dew$2X(); + var deciphers = dew$2W(); + var modes = _list$2; + function getCiphers2() { + return Object.keys(modes); + } + exports$2W.createCipher = exports$2W.Cipher = ciphers.createCipher; + exports$2W.createCipheriv = exports$2W.Cipheriv = ciphers.createCipheriv; + exports$2W.createDecipher = exports$2W.Decipher = deciphers.createDecipher; + exports$2W.createDecipheriv = exports$2W.Decipheriv = deciphers.createDecipheriv; + exports$2W.listCiphers = exports$2W.getCiphers = getCiphers2; + return exports$2W; +} +function dew$2U() { + if (_dewExec$2U) + return exports$2V; + _dewExec$2U = true; + exports$2V["des-ecb"] = { + key: 8, + iv: 0 + }; + exports$2V["des-cbc"] = exports$2V.des = { + key: 8, + iv: 8 + }; + exports$2V["des-ede3-cbc"] = exports$2V.des3 = { + key: 24, + iv: 8 + }; + exports$2V["des-ede3"] = { + key: 24, + iv: 0 + }; + exports$2V["des-ede-cbc"] = { + key: 16, + iv: 8 + }; + exports$2V["des-ede"] = { + key: 16, + iv: 0 + }; + return exports$2V; +} +function dew$2T() { + if (_dewExec$2T) + return exports$2U; + _dewExec$2T = true; + var DES = dew$3b(); + var aes = dew$2V(); + var aesModes = dew$31(); + var desModes = dew$2U(); + var ebtk = dew$2Y(); + function createCipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + function createDecipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + function createCipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createCipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite + }); + throw new TypeError("invalid suite type"); + } + function createDecipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createDecipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite, + decrypt: true + }); + throw new TypeError("invalid suite type"); + } + function getCiphers2() { + return Object.keys(desModes).concat(aes.getCiphers()); + } + exports$2U.createCipher = exports$2U.Cipher = createCipher2; + exports$2U.createCipheriv = exports$2U.Cipheriv = createCipheriv2; + exports$2U.createDecipher = exports$2U.Decipher = createDecipher2; + exports$2U.createDecipheriv = exports$2U.Decipheriv = createDecipheriv2; + exports$2U.listCiphers = exports$2U.getCiphers = getCiphers2; + return exports$2U; +} +function dew$2S() { + if (_dewExec$2S) + return module$e.exports; + _dewExec$2S = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$X).negative = 0; + (this || _global$X).words = null; + (this || _global$X).length = 0; + (this || _global$X).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$X).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$X).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$X).words = [number & 67108863]; + (this || _global$X).length = 1; + } else if (number < 4503599627370496) { + (this || _global$X).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$X).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$X).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$X).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$X).words = [0]; + (this || _global$X).length = 1; + return this || _global$X; + } + (this || _global$X).length = Math.ceil(number.length / 3); + (this || _global$X).words = new Array((this || _global$X).length); + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + (this || _global$X).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$X).words[j6] |= w6 << off3 & 67108863; + (this || _global$X).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$X).words[j6] |= w6 << off3 & 67108863; + (this || _global$X).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$X).length = Math.ceil((number.length - start) / 6); + (this || _global$X).words = new Array((this || _global$X).length); + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + (this || _global$X).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$X).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$X).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$X).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$X).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$X).words = [0]; + (this || _global$X).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$X).words[0] + word < 67108864) { + (this || _global$X).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$X).words[0] + word < 67108864) { + (this || _global$X).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$X).length); + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + dest.words[i7] = (this || _global$X).words[i7]; + } + dest.length = (this || _global$X).length; + dest.negative = (this || _global$X).negative; + dest.red = (this || _global$X).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$X).length < size2) { + (this || _global$X).words[(this || _global$X).length++] = 0; + } + return this || _global$X; + }; + BN.prototype.strip = function strip() { + while ((this || _global$X).length > 1 && (this || _global$X).words[(this || _global$X).length - 1] === 0) { + (this || _global$X).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$X).length === 1 && (this || _global$X).words[0] === 0) { + (this || _global$X).negative = 0; + } + return this || _global$X; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$X).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + var w6 = (this || _global$X).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$X).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$X).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$X).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$X).words[0]; + if ((this || _global$X).length === 2) { + ret += (this || _global$X).words[1] * 67108864; + } else if ((this || _global$X).length === 3 && (this || _global$X).words[2] === 1) { + ret += 4503599627370496 + (this || _global$X).words[1] * 67108864; + } else if ((this || _global$X).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$X).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$X).words[(this || _global$X).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$X).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + var b8 = this._zeroBits((this || _global$X).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$X).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$X).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$X).negative ^= 1; + } + return this || _global$X; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$X).length < num.length) { + (this || _global$X).words[(this || _global$X).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$X).words[i7] = (this || _global$X).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$X).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$X).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$X); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$X).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$X); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$X).length > num.length) { + b8 = num; + } else { + b8 = this || _global$X; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$X).words[i7] = (this || _global$X).words[i7] & num.words[i7]; + } + (this || _global$X).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$X).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$X).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$X); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$X).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$X); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$X).length > num.length) { + a7 = this || _global$X; + b8 = num; + } else { + a7 = num; + b8 = this || _global$X; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$X).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$X) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$X).words[i7] = a7.words[i7]; + } + } + (this || _global$X).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$X).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$X).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$X); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$X).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$X); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$X).words[i7] = ~(this || _global$X).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$X).words[i7] = ~(this || _global$X).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$X).words[off3] = (this || _global$X).words[off3] | 1 << wbit; + } else { + (this || _global$X).words[off3] = (this || _global$X).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$X).negative !== 0 && num.negative === 0) { + (this || _global$X).negative = 0; + r8 = this.isub(num); + (this || _global$X).negative ^= 1; + return this._normSign(); + } else if ((this || _global$X).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$X).length > num.length) { + a7 = this || _global$X; + b8 = num; + } else { + a7 = num; + b8 = this || _global$X; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$X).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$X).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$X).length = a7.length; + if (carry !== 0) { + (this || _global$X).words[(this || _global$X).length] = carry; + (this || _global$X).length++; + } else if (a7 !== (this || _global$X)) { + for (; i7 < a7.length; i7++) { + (this || _global$X).words[i7] = a7.words[i7]; + } + } + return this || _global$X; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$X).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$X).negative !== 0) { + (this || _global$X).negative = 0; + res = num.sub(this || _global$X); + (this || _global$X).negative = 1; + return res; + } + if ((this || _global$X).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$X); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$X).negative !== 0) { + (this || _global$X).negative = 0; + this.iadd(num); + (this || _global$X).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$X).negative = 0; + (this || _global$X).length = 1; + (this || _global$X).words[0] = 0; + return this || _global$X; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$X; + b8 = num; + } else { + a7 = num; + b8 = this || _global$X; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$X).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$X).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$X)) { + for (; i7 < a7.length; i7++) { + (this || _global$X).words[i7] = a7.words[i7]; + } + } + (this || _global$X).length = Math.max((this || _global$X).length, i7); + if (a7 !== (this || _global$X)) { + (this || _global$X).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$X).length + num.length; + if ((this || _global$X).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$X, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$X, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$X, num, out); + } else { + res = jumboMulTo(this || _global$X, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$X).x = x7; + (this || _global$X).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$X).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$X).length + num.length); + return jumboMulTo(this || _global$X, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$X); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$X).length; i7++) { + var w6 = ((this || _global$X).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$X).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$X).words[i7] = carry; + (this || _global$X).length++; + } + return this || _global$X; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$X); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$X; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$X).length; i7++) { + var newCarry = (this || _global$X).words[i7] & carryMask; + var c7 = ((this || _global$X).words[i7] | 0) - newCarry << r8; + (this || _global$X).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$X).words[i7] = carry; + (this || _global$X).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$X).length - 1; i7 >= 0; i7--) { + (this || _global$X).words[i7 + s7] = (this || _global$X).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$X).words[i7] = 0; + } + (this || _global$X).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$X).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$X).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$X).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$X).length > s7) { + (this || _global$X).length -= s7; + for (i7 = 0; i7 < (this || _global$X).length; i7++) { + (this || _global$X).words[i7] = (this || _global$X).words[i7 + s7]; + } + } else { + (this || _global$X).words[0] = 0; + (this || _global$X).length = 1; + } + var carry = 0; + for (i7 = (this || _global$X).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$X).words[i7] | 0; + (this || _global$X).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$X).length === 0) { + (this || _global$X).words[0] = 0; + (this || _global$X).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$X).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$X).length <= s7) + return false; + var w6 = (this || _global$X).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$X).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$X).length <= s7) { + return this || _global$X; + } + if (r8 !== 0) { + s7++; + } + (this || _global$X).length = Math.min(s7, (this || _global$X).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$X).words[(this || _global$X).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$X).negative !== 0) { + if ((this || _global$X).length === 1 && ((this || _global$X).words[0] | 0) < num) { + (this || _global$X).words[0] = num - ((this || _global$X).words[0] | 0); + (this || _global$X).negative = 0; + return this || _global$X; + } + (this || _global$X).negative = 0; + this.isubn(num); + (this || _global$X).negative = 1; + return this || _global$X; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$X).words[0] += num; + for (var i7 = 0; i7 < (this || _global$X).length && (this || _global$X).words[i7] >= 67108864; i7++) { + (this || _global$X).words[i7] -= 67108864; + if (i7 === (this || _global$X).length - 1) { + (this || _global$X).words[i7 + 1] = 1; + } else { + (this || _global$X).words[i7 + 1]++; + } + } + (this || _global$X).length = Math.max((this || _global$X).length, i7 + 1); + return this || _global$X; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$X).negative !== 0) { + (this || _global$X).negative = 0; + this.iaddn(num); + (this || _global$X).negative = 1; + return this || _global$X; + } + (this || _global$X).words[0] -= num; + if ((this || _global$X).length === 1 && (this || _global$X).words[0] < 0) { + (this || _global$X).words[0] = -(this || _global$X).words[0]; + (this || _global$X).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$X).length && (this || _global$X).words[i7] < 0; i7++) { + (this || _global$X).words[i7] += 67108864; + (this || _global$X).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$X).negative = 0; + return this || _global$X; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$X).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$X).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$X).length - shift; i7++) { + w6 = ((this || _global$X).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$X).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$X).length; i7++) { + w6 = -((this || _global$X).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$X).words[i7] = w6 & 67108863; + } + (this || _global$X).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$X).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$X).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$X).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$X).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$X).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$X + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$X).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$X).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$X).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$X).words[i7] | 0) + carry * 67108864; + (this || _global$X).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$X; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$X; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$X).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$X).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$X).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$X).length <= s7) { + this._expand(s7 + 1); + (this || _global$X).words[s7] |= q5; + return this || _global$X; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$X).length; i7++) { + var w6 = (this || _global$X).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$X).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$X).words[i7] = carry; + (this || _global$X).length++; + } + return this || _global$X; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$X).length === 1 && (this || _global$X).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$X).negative !== 0 && !negative) + return -1; + if ((this || _global$X).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$X).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$X).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$X).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$X).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$X).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$X).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$X).length > num.length) + return 1; + if ((this || _global$X).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$X).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$X).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$X).red, "Already a number in reduction context"); + assert4((this || _global$X).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$X)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$X).red, "fromRed works only with numbers in reduction context"); + return (this || _global$X).red.convertFrom(this || _global$X); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$X).red = ctx; + return this || _global$X; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$X).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$X).red, "redAdd works only with red numbers"); + return (this || _global$X).red.add(this || _global$X, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$X).red, "redIAdd works only with red numbers"); + return (this || _global$X).red.iadd(this || _global$X, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$X).red, "redSub works only with red numbers"); + return (this || _global$X).red.sub(this || _global$X, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$X).red, "redISub works only with red numbers"); + return (this || _global$X).red.isub(this || _global$X, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$X).red, "redShl works only with red numbers"); + return (this || _global$X).red.shl(this || _global$X, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$X).red, "redMul works only with red numbers"); + (this || _global$X).red._verify2(this || _global$X, num); + return (this || _global$X).red.mul(this || _global$X, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$X).red, "redMul works only with red numbers"); + (this || _global$X).red._verify2(this || _global$X, num); + return (this || _global$X).red.imul(this || _global$X, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$X).red, "redSqr works only with red numbers"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.sqr(this || _global$X); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$X).red, "redISqr works only with red numbers"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.isqr(this || _global$X); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$X).red, "redSqrt works only with red numbers"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.sqrt(this || _global$X); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$X).red, "redInvm works only with red numbers"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.invm(this || _global$X); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$X).red, "redNeg works only with red numbers"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.neg(this || _global$X); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$X).red && !num.red, "redPow(normalNum)"); + (this || _global$X).red._verify1(this || _global$X); + return (this || _global$X).red.pow(this || _global$X, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$X).name = name2; + (this || _global$X).p = new BN(p7, 16); + (this || _global$X).n = (this || _global$X).p.bitLength(); + (this || _global$X).k = new BN(1).iushln((this || _global$X).n).isub((this || _global$X).p); + (this || _global$X).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$X).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$X).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$X).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$X).n); + var cmp = rlen < (this || _global$X).n ? -1 : r8.ucmp((this || _global$X).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$X).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$X).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$X).k); + }; + function K256() { + MPrime.call(this || _global$X, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$X, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$X, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$X, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$X).m = prime.p; + (this || _global$X).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$X).m = m7; + (this || _global$X).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$X).prime) + return (this || _global$X).prime.ireduce(a7)._forceRed(this || _global$X); + return a7.umod((this || _global$X).m)._forceRed(this || _global$X); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$X).m.sub(a7)._forceRed(this || _global$X); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$X).m) >= 0) { + res.isub((this || _global$X).m); + } + return res._forceRed(this || _global$X); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$X).m) >= 0) { + res.isub((this || _global$X).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$X).m); + } + return res._forceRed(this || _global$X); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$X).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$X).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$X).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$X).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$X); + var nOne = one.redNeg(); + var lpow = (this || _global$X).m.subn(1).iushrn(1); + var z6 = (this || _global$X).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$X); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$X).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$X); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$X); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$X).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$X, m7); + (this || _global$X).shift = (this || _global$X).m.bitLength(); + if ((this || _global$X).shift % 26 !== 0) { + (this || _global$X).shift += 26 - (this || _global$X).shift % 26; + } + (this || _global$X).r = new BN(1).iushln((this || _global$X).shift); + (this || _global$X).r2 = this.imod((this || _global$X).r.sqr()); + (this || _global$X).rinv = (this || _global$X).r._invmp((this || _global$X).m); + (this || _global$X).minv = (this || _global$X).rinv.mul((this || _global$X).r).isubn(1).div((this || _global$X).m); + (this || _global$X).minv = (this || _global$X).minv.umod((this || _global$X).r); + (this || _global$X).minv = (this || _global$X).r.sub((this || _global$X).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$X).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$X).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$X).shift).mul((this || _global$X).minv).imaskn((this || _global$X).shift).mul((this || _global$X).m); + var u7 = t8.isub(c7).iushrn((this || _global$X).shift); + var res = u7; + if (u7.cmp((this || _global$X).m) >= 0) { + res = u7.isub((this || _global$X).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$X).m); + } + return res._forceRed(this || _global$X); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$X); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$X).shift).mul((this || _global$X).minv).imaskn((this || _global$X).shift).mul((this || _global$X).m); + var u7 = t8.isub(c7).iushrn((this || _global$X).shift); + var res = u7; + if (u7.cmp((this || _global$X).m) >= 0) { + res = u7.isub((this || _global$X).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$X).m); + } + return res._forceRed(this || _global$X); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$X).m).mul((this || _global$X).r2)); + return res._forceRed(this || _global$X); + }; + })(module$e, exports$2T); + return module$e.exports; +} +function dew$2R() { + if (_dewExec$2R) + return module$d.exports; + _dewExec$2R = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$W).negative = 0; + (this || _global$W).words = null; + (this || _global$W).length = 0; + (this || _global$W).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$W).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$W).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$W).words = [number & 67108863]; + (this || _global$W).length = 1; + } else if (number < 4503599627370496) { + (this || _global$W).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$W).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$W).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$W).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$W).words = [0]; + (this || _global$W).length = 1; + return this || _global$W; + } + (this || _global$W).length = Math.ceil(number.length / 3); + (this || _global$W).words = new Array((this || _global$W).length); + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + (this || _global$W).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$W).words[j6] |= w6 << off3 & 67108863; + (this || _global$W).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$W).words[j6] |= w6 << off3 & 67108863; + (this || _global$W).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$W).length = Math.ceil((number.length - start) / 6); + (this || _global$W).words = new Array((this || _global$W).length); + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + (this || _global$W).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$W).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$W).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$W).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$W).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$W).words = [0]; + (this || _global$W).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$W).words[0] + word < 67108864) { + (this || _global$W).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$W).words[0] + word < 67108864) { + (this || _global$W).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$W).length); + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + dest.words[i7] = (this || _global$W).words[i7]; + } + dest.length = (this || _global$W).length; + dest.negative = (this || _global$W).negative; + dest.red = (this || _global$W).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$W).length < size2) { + (this || _global$W).words[(this || _global$W).length++] = 0; + } + return this || _global$W; + }; + BN.prototype.strip = function strip() { + while ((this || _global$W).length > 1 && (this || _global$W).words[(this || _global$W).length - 1] === 0) { + (this || _global$W).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$W).length === 1 && (this || _global$W).words[0] === 0) { + (this || _global$W).negative = 0; + } + return this || _global$W; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$W).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + var w6 = (this || _global$W).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$W).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$W).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$W).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$W).words[0]; + if ((this || _global$W).length === 2) { + ret += (this || _global$W).words[1] * 67108864; + } else if ((this || _global$W).length === 3 && (this || _global$W).words[2] === 1) { + ret += 4503599627370496 + (this || _global$W).words[1] * 67108864; + } else if ((this || _global$W).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$W).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$W).words[(this || _global$W).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$W).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + var b8 = this._zeroBits((this || _global$W).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$W).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$W).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$W).negative ^= 1; + } + return this || _global$W; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$W).length < num.length) { + (this || _global$W).words[(this || _global$W).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$W).words[i7] = (this || _global$W).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$W).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$W).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$W); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$W).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$W); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$W).length > num.length) { + b8 = num; + } else { + b8 = this || _global$W; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$W).words[i7] = (this || _global$W).words[i7] & num.words[i7]; + } + (this || _global$W).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$W).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$W).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$W); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$W).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$W); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$W).length > num.length) { + a7 = this || _global$W; + b8 = num; + } else { + a7 = num; + b8 = this || _global$W; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$W).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$W) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$W).words[i7] = a7.words[i7]; + } + } + (this || _global$W).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$W).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$W).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$W); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$W).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$W); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$W).words[i7] = ~(this || _global$W).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$W).words[i7] = ~(this || _global$W).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$W).words[off3] = (this || _global$W).words[off3] | 1 << wbit; + } else { + (this || _global$W).words[off3] = (this || _global$W).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$W).negative !== 0 && num.negative === 0) { + (this || _global$W).negative = 0; + r8 = this.isub(num); + (this || _global$W).negative ^= 1; + return this._normSign(); + } else if ((this || _global$W).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$W).length > num.length) { + a7 = this || _global$W; + b8 = num; + } else { + a7 = num; + b8 = this || _global$W; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$W).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$W).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$W).length = a7.length; + if (carry !== 0) { + (this || _global$W).words[(this || _global$W).length] = carry; + (this || _global$W).length++; + } else if (a7 !== (this || _global$W)) { + for (; i7 < a7.length; i7++) { + (this || _global$W).words[i7] = a7.words[i7]; + } + } + return this || _global$W; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$W).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$W).negative !== 0) { + (this || _global$W).negative = 0; + res = num.sub(this || _global$W); + (this || _global$W).negative = 1; + return res; + } + if ((this || _global$W).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$W); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$W).negative !== 0) { + (this || _global$W).negative = 0; + this.iadd(num); + (this || _global$W).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$W).negative = 0; + (this || _global$W).length = 1; + (this || _global$W).words[0] = 0; + return this || _global$W; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$W; + b8 = num; + } else { + a7 = num; + b8 = this || _global$W; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$W).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$W).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$W)) { + for (; i7 < a7.length; i7++) { + (this || _global$W).words[i7] = a7.words[i7]; + } + } + (this || _global$W).length = Math.max((this || _global$W).length, i7); + if (a7 !== (this || _global$W)) { + (this || _global$W).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$W).length + num.length; + if ((this || _global$W).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$W, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$W, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$W, num, out); + } else { + res = jumboMulTo(this || _global$W, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$W).x = x7; + (this || _global$W).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$W).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$W).length + num.length); + return jumboMulTo(this || _global$W, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$W); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$W).length; i7++) { + var w6 = ((this || _global$W).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$W).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$W).words[i7] = carry; + (this || _global$W).length++; + } + return this || _global$W; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$W); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$W; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$W).length; i7++) { + var newCarry = (this || _global$W).words[i7] & carryMask; + var c7 = ((this || _global$W).words[i7] | 0) - newCarry << r8; + (this || _global$W).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$W).words[i7] = carry; + (this || _global$W).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$W).length - 1; i7 >= 0; i7--) { + (this || _global$W).words[i7 + s7] = (this || _global$W).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$W).words[i7] = 0; + } + (this || _global$W).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$W).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$W).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$W).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$W).length > s7) { + (this || _global$W).length -= s7; + for (i7 = 0; i7 < (this || _global$W).length; i7++) { + (this || _global$W).words[i7] = (this || _global$W).words[i7 + s7]; + } + } else { + (this || _global$W).words[0] = 0; + (this || _global$W).length = 1; + } + var carry = 0; + for (i7 = (this || _global$W).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$W).words[i7] | 0; + (this || _global$W).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$W).length === 0) { + (this || _global$W).words[0] = 0; + (this || _global$W).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$W).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$W).length <= s7) + return false; + var w6 = (this || _global$W).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$W).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$W).length <= s7) { + return this || _global$W; + } + if (r8 !== 0) { + s7++; + } + (this || _global$W).length = Math.min(s7, (this || _global$W).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$W).words[(this || _global$W).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$W).negative !== 0) { + if ((this || _global$W).length === 1 && ((this || _global$W).words[0] | 0) < num) { + (this || _global$W).words[0] = num - ((this || _global$W).words[0] | 0); + (this || _global$W).negative = 0; + return this || _global$W; + } + (this || _global$W).negative = 0; + this.isubn(num); + (this || _global$W).negative = 1; + return this || _global$W; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$W).words[0] += num; + for (var i7 = 0; i7 < (this || _global$W).length && (this || _global$W).words[i7] >= 67108864; i7++) { + (this || _global$W).words[i7] -= 67108864; + if (i7 === (this || _global$W).length - 1) { + (this || _global$W).words[i7 + 1] = 1; + } else { + (this || _global$W).words[i7 + 1]++; + } + } + (this || _global$W).length = Math.max((this || _global$W).length, i7 + 1); + return this || _global$W; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$W).negative !== 0) { + (this || _global$W).negative = 0; + this.iaddn(num); + (this || _global$W).negative = 1; + return this || _global$W; + } + (this || _global$W).words[0] -= num; + if ((this || _global$W).length === 1 && (this || _global$W).words[0] < 0) { + (this || _global$W).words[0] = -(this || _global$W).words[0]; + (this || _global$W).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$W).length && (this || _global$W).words[i7] < 0; i7++) { + (this || _global$W).words[i7] += 67108864; + (this || _global$W).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$W).negative = 0; + return this || _global$W; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$W).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$W).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$W).length - shift; i7++) { + w6 = ((this || _global$W).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$W).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$W).length; i7++) { + w6 = -((this || _global$W).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$W).words[i7] = w6 & 67108863; + } + (this || _global$W).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$W).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$W).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$W).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$W).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$W).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$W + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$W).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$W).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$W).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$W).words[i7] | 0) + carry * 67108864; + (this || _global$W).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$W; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$W; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$W).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$W).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$W).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$W).length <= s7) { + this._expand(s7 + 1); + (this || _global$W).words[s7] |= q5; + return this || _global$W; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$W).length; i7++) { + var w6 = (this || _global$W).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$W).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$W).words[i7] = carry; + (this || _global$W).length++; + } + return this || _global$W; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$W).length === 1 && (this || _global$W).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$W).negative !== 0 && !negative) + return -1; + if ((this || _global$W).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$W).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$W).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$W).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$W).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$W).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$W).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$W).length > num.length) + return 1; + if ((this || _global$W).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$W).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$W).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$W).red, "Already a number in reduction context"); + assert4((this || _global$W).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$W)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$W).red, "fromRed works only with numbers in reduction context"); + return (this || _global$W).red.convertFrom(this || _global$W); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$W).red = ctx; + return this || _global$W; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$W).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$W).red, "redAdd works only with red numbers"); + return (this || _global$W).red.add(this || _global$W, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$W).red, "redIAdd works only with red numbers"); + return (this || _global$W).red.iadd(this || _global$W, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$W).red, "redSub works only with red numbers"); + return (this || _global$W).red.sub(this || _global$W, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$W).red, "redISub works only with red numbers"); + return (this || _global$W).red.isub(this || _global$W, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$W).red, "redShl works only with red numbers"); + return (this || _global$W).red.shl(this || _global$W, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$W).red, "redMul works only with red numbers"); + (this || _global$W).red._verify2(this || _global$W, num); + return (this || _global$W).red.mul(this || _global$W, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$W).red, "redMul works only with red numbers"); + (this || _global$W).red._verify2(this || _global$W, num); + return (this || _global$W).red.imul(this || _global$W, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$W).red, "redSqr works only with red numbers"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.sqr(this || _global$W); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$W).red, "redISqr works only with red numbers"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.isqr(this || _global$W); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$W).red, "redSqrt works only with red numbers"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.sqrt(this || _global$W); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$W).red, "redInvm works only with red numbers"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.invm(this || _global$W); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$W).red, "redNeg works only with red numbers"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.neg(this || _global$W); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$W).red && !num.red, "redPow(normalNum)"); + (this || _global$W).red._verify1(this || _global$W); + return (this || _global$W).red.pow(this || _global$W, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$W).name = name2; + (this || _global$W).p = new BN(p7, 16); + (this || _global$W).n = (this || _global$W).p.bitLength(); + (this || _global$W).k = new BN(1).iushln((this || _global$W).n).isub((this || _global$W).p); + (this || _global$W).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$W).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$W).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$W).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$W).n); + var cmp = rlen < (this || _global$W).n ? -1 : r8.ucmp((this || _global$W).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$W).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$W).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$W).k); + }; + function K256() { + MPrime.call(this || _global$W, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$W, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$W, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$W, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$W).m = prime.p; + (this || _global$W).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$W).m = m7; + (this || _global$W).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$W).prime) + return (this || _global$W).prime.ireduce(a7)._forceRed(this || _global$W); + return a7.umod((this || _global$W).m)._forceRed(this || _global$W); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$W).m.sub(a7)._forceRed(this || _global$W); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$W).m) >= 0) { + res.isub((this || _global$W).m); + } + return res._forceRed(this || _global$W); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$W).m) >= 0) { + res.isub((this || _global$W).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$W).m); + } + return res._forceRed(this || _global$W); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$W).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$W).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$W).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$W).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$W); + var nOne = one.redNeg(); + var lpow = (this || _global$W).m.subn(1).iushrn(1); + var z6 = (this || _global$W).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$W); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$W).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$W); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$W); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$W).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$W, m7); + (this || _global$W).shift = (this || _global$W).m.bitLength(); + if ((this || _global$W).shift % 26 !== 0) { + (this || _global$W).shift += 26 - (this || _global$W).shift % 26; + } + (this || _global$W).r = new BN(1).iushln((this || _global$W).shift); + (this || _global$W).r2 = this.imod((this || _global$W).r.sqr()); + (this || _global$W).rinv = (this || _global$W).r._invmp((this || _global$W).m); + (this || _global$W).minv = (this || _global$W).rinv.mul((this || _global$W).r).isubn(1).div((this || _global$W).m); + (this || _global$W).minv = (this || _global$W).minv.umod((this || _global$W).r); + (this || _global$W).minv = (this || _global$W).r.sub((this || _global$W).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$W).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$W).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$W).shift).mul((this || _global$W).minv).imaskn((this || _global$W).shift).mul((this || _global$W).m); + var u7 = t8.isub(c7).iushrn((this || _global$W).shift); + var res = u7; + if (u7.cmp((this || _global$W).m) >= 0) { + res = u7.isub((this || _global$W).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$W).m); + } + return res._forceRed(this || _global$W); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$W); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$W).shift).mul((this || _global$W).minv).imaskn((this || _global$W).shift).mul((this || _global$W).m); + var u7 = t8.isub(c7).iushrn((this || _global$W).shift); + var res = u7; + if (u7.cmp((this || _global$W).m) >= 0) { + res = u7.isub((this || _global$W).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$W).m); + } + return res._forceRed(this || _global$W); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$W).m).mul((this || _global$W).r2)); + return res._forceRed(this || _global$W); + }; + })(module$d, exports$2S); + return module$d.exports; +} +function dew$2P() { + if (_dewExec$2P) + return exports$2Q; + _dewExec$2P = true; + var buffer$1 = buffer; + var Buffer4 = buffer$1.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$2Q = buffer$1; + } else { + copyProps(buffer$1, exports$2Q); + exports$2Q.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer$1.SlowBuffer(size2); + }; + return exports$2Q; +} +function dew$2O() { + if (_dewExec$2O) + return exports$2P; + _dewExec$2O = true; + var process$1$1 = process4; + var MAX_BYTES = 65536; + var MAX_UINT32 = 4294967295; + function oldBrowser() { + throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); + } + var Buffer4 = dew$2P().Buffer; + var crypto2 = _global$U.crypto || _global$U.msCrypto; + if (crypto2 && crypto2.getRandomValues) { + exports$2P = randomBytes2; + } else { + exports$2P = oldBrowser; + } + function randomBytes2(size2, cb) { + if (size2 > MAX_UINT32) + throw new RangeError("requested too many random bytes"); + var bytes = Buffer4.allocUnsafe(size2); + if (size2 > 0) { + if (size2 > MAX_BYTES) { + for (var generated = 0; generated < size2; generated += MAX_BYTES) { + crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)); + } + } else { + crypto2.getRandomValues(bytes); + } + } + if (typeof cb === "function") { + return process$1$1.nextTick(function() { + cb(null, bytes); + }); + } + return bytes; + } + return exports$2P; +} +function dew$2N() { + if (_dewExec$2N) + return exports$2O; + _dewExec$2N = true; + var buffer$1 = buffer; + var Buffer4 = buffer$1.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$2O = buffer$1; + } else { + copyProps(buffer$1, exports$2O); + exports$2O.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer$1.SlowBuffer(size2); + }; + return exports$2O; +} +function dew$2M() { + if (_dewExec$2M) + return exports$2N; + _dewExec$2M = true; + var Buffer4 = dew$2N().Buffer; + var Transform2 = dew12().Transform; + var inherits2 = dew$f2(); + function throwIfNotStringOrBuffer(val, prefix) { + if (!Buffer4.isBuffer(val) && typeof val !== "string") { + throw new TypeError(prefix + " must be a string or a buffer"); + } + } + function HashBase(blockSize) { + Transform2.call(this); + this._block = Buffer4.allocUnsafe(blockSize); + this._blockSize = blockSize; + this._blockOffset = 0; + this._length = [0, 0, 0, 0]; + this._finalized = false; + } + inherits2(HashBase, Transform2); + HashBase.prototype._transform = function(chunk2, encoding, callback) { + var error2 = null; + try { + this.update(chunk2, encoding); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype._flush = function(callback) { + var error2 = null; + try { + this.push(this.digest()); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype.update = function(data, encoding) { + throwIfNotStringOrBuffer(data, "Data"); + if (this._finalized) + throw new Error("Digest already called"); + if (!Buffer4.isBuffer(data)) + data = Buffer4.from(data, encoding); + var block = this._block; + var offset = 0; + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i7 = this._blockOffset; i7 < this._blockSize; ) + block[i7++] = data[offset++]; + this._update(); + this._blockOffset = 0; + } + while (offset < data.length) + block[this._blockOffset++] = data[offset++]; + for (var j6 = 0, carry = data.length * 8; carry > 0; ++j6) { + this._length[j6] += carry; + carry = this._length[j6] / 4294967296 | 0; + if (carry > 0) + this._length[j6] -= 4294967296 * carry; + } + return this; + }; + HashBase.prototype._update = function() { + throw new Error("_update is not implemented"); + }; + HashBase.prototype.digest = function(encoding) { + if (this._finalized) + throw new Error("Digest already called"); + this._finalized = true; + var digest = this._digest(); + if (encoding !== void 0) + digest = digest.toString(encoding); + this._block.fill(0); + this._blockOffset = 0; + for (var i7 = 0; i7 < 4; ++i7) + this._length[i7] = 0; + return digest; + }; + HashBase.prototype._digest = function() { + throw new Error("_digest is not implemented"); + }; + exports$2N = HashBase; + return exports$2N; +} +function dew$2L() { + if (_dewExec$2L) + return exports$2M; + _dewExec$2L = true; + var inherits2 = dew$f2(); + var HashBase = dew$2M(); + var Buffer4 = dew$2P().Buffer; + var ARRAY16 = new Array(16); + function MD5() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + } + inherits2(MD5, HashBase); + MD5.prototype._update = function() { + var M6 = ARRAY16; + for (var i7 = 0; i7 < 16; ++i7) + M6[i7] = this._block.readInt32LE(i7 * 4); + var a7 = this._a; + var b8 = this._b; + var c7 = this._c; + var d7 = this._d; + a7 = fnF(a7, b8, c7, d7, M6[0], 3614090360, 7); + d7 = fnF(d7, a7, b8, c7, M6[1], 3905402710, 12); + c7 = fnF(c7, d7, a7, b8, M6[2], 606105819, 17); + b8 = fnF(b8, c7, d7, a7, M6[3], 3250441966, 22); + a7 = fnF(a7, b8, c7, d7, M6[4], 4118548399, 7); + d7 = fnF(d7, a7, b8, c7, M6[5], 1200080426, 12); + c7 = fnF(c7, d7, a7, b8, M6[6], 2821735955, 17); + b8 = fnF(b8, c7, d7, a7, M6[7], 4249261313, 22); + a7 = fnF(a7, b8, c7, d7, M6[8], 1770035416, 7); + d7 = fnF(d7, a7, b8, c7, M6[9], 2336552879, 12); + c7 = fnF(c7, d7, a7, b8, M6[10], 4294925233, 17); + b8 = fnF(b8, c7, d7, a7, M6[11], 2304563134, 22); + a7 = fnF(a7, b8, c7, d7, M6[12], 1804603682, 7); + d7 = fnF(d7, a7, b8, c7, M6[13], 4254626195, 12); + c7 = fnF(c7, d7, a7, b8, M6[14], 2792965006, 17); + b8 = fnF(b8, c7, d7, a7, M6[15], 1236535329, 22); + a7 = fnG(a7, b8, c7, d7, M6[1], 4129170786, 5); + d7 = fnG(d7, a7, b8, c7, M6[6], 3225465664, 9); + c7 = fnG(c7, d7, a7, b8, M6[11], 643717713, 14); + b8 = fnG(b8, c7, d7, a7, M6[0], 3921069994, 20); + a7 = fnG(a7, b8, c7, d7, M6[5], 3593408605, 5); + d7 = fnG(d7, a7, b8, c7, M6[10], 38016083, 9); + c7 = fnG(c7, d7, a7, b8, M6[15], 3634488961, 14); + b8 = fnG(b8, c7, d7, a7, M6[4], 3889429448, 20); + a7 = fnG(a7, b8, c7, d7, M6[9], 568446438, 5); + d7 = fnG(d7, a7, b8, c7, M6[14], 3275163606, 9); + c7 = fnG(c7, d7, a7, b8, M6[3], 4107603335, 14); + b8 = fnG(b8, c7, d7, a7, M6[8], 1163531501, 20); + a7 = fnG(a7, b8, c7, d7, M6[13], 2850285829, 5); + d7 = fnG(d7, a7, b8, c7, M6[2], 4243563512, 9); + c7 = fnG(c7, d7, a7, b8, M6[7], 1735328473, 14); + b8 = fnG(b8, c7, d7, a7, M6[12], 2368359562, 20); + a7 = fnH(a7, b8, c7, d7, M6[5], 4294588738, 4); + d7 = fnH(d7, a7, b8, c7, M6[8], 2272392833, 11); + c7 = fnH(c7, d7, a7, b8, M6[11], 1839030562, 16); + b8 = fnH(b8, c7, d7, a7, M6[14], 4259657740, 23); + a7 = fnH(a7, b8, c7, d7, M6[1], 2763975236, 4); + d7 = fnH(d7, a7, b8, c7, M6[4], 1272893353, 11); + c7 = fnH(c7, d7, a7, b8, M6[7], 4139469664, 16); + b8 = fnH(b8, c7, d7, a7, M6[10], 3200236656, 23); + a7 = fnH(a7, b8, c7, d7, M6[13], 681279174, 4); + d7 = fnH(d7, a7, b8, c7, M6[0], 3936430074, 11); + c7 = fnH(c7, d7, a7, b8, M6[3], 3572445317, 16); + b8 = fnH(b8, c7, d7, a7, M6[6], 76029189, 23); + a7 = fnH(a7, b8, c7, d7, M6[9], 3654602809, 4); + d7 = fnH(d7, a7, b8, c7, M6[12], 3873151461, 11); + c7 = fnH(c7, d7, a7, b8, M6[15], 530742520, 16); + b8 = fnH(b8, c7, d7, a7, M6[2], 3299628645, 23); + a7 = fnI(a7, b8, c7, d7, M6[0], 4096336452, 6); + d7 = fnI(d7, a7, b8, c7, M6[7], 1126891415, 10); + c7 = fnI(c7, d7, a7, b8, M6[14], 2878612391, 15); + b8 = fnI(b8, c7, d7, a7, M6[5], 4237533241, 21); + a7 = fnI(a7, b8, c7, d7, M6[12], 1700485571, 6); + d7 = fnI(d7, a7, b8, c7, M6[3], 2399980690, 10); + c7 = fnI(c7, d7, a7, b8, M6[10], 4293915773, 15); + b8 = fnI(b8, c7, d7, a7, M6[1], 2240044497, 21); + a7 = fnI(a7, b8, c7, d7, M6[8], 1873313359, 6); + d7 = fnI(d7, a7, b8, c7, M6[15], 4264355552, 10); + c7 = fnI(c7, d7, a7, b8, M6[6], 2734768916, 15); + b8 = fnI(b8, c7, d7, a7, M6[13], 1309151649, 21); + a7 = fnI(a7, b8, c7, d7, M6[4], 4149444226, 6); + d7 = fnI(d7, a7, b8, c7, M6[11], 3174756917, 10); + c7 = fnI(c7, d7, a7, b8, M6[2], 718787259, 15); + b8 = fnI(b8, c7, d7, a7, M6[9], 3951481745, 21); + this._a = this._a + a7 | 0; + this._b = this._b + b8 | 0; + this._c = this._c + c7 | 0; + this._d = this._d + d7 | 0; + }; + MD5.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.allocUnsafe(16); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fnF(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnG(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnH(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnI(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (c7 ^ (b8 | ~d7)) + m7 + k6 | 0, s7) + b8 | 0; + } + exports$2M = MD5; + return exports$2M; +} +function dew$2K() { + if (_dewExec$2K) + return exports$2L; + _dewExec$2K = true; + var Buffer4 = buffer.Buffer; + var inherits2 = dew$f2(); + var HashBase = dew$2M(); + var ARRAY16 = new Array(16); + var zl = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var zr = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var sl = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sr = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + var hl = [0, 1518500249, 1859775393, 2400959708, 2840853838]; + var hr = [1352829926, 1548603684, 1836072691, 2053994217, 0]; + function RIPEMD160() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + this._e = 3285377520; + } + inherits2(RIPEMD160, HashBase); + RIPEMD160.prototype._update = function() { + var words2 = ARRAY16; + for (var j6 = 0; j6 < 16; ++j6) + words2[j6] = this._block.readInt32LE(j6 * 4); + var al = this._a | 0; + var bl = this._b | 0; + var cl = this._c | 0; + var dl = this._d | 0; + var el = this._e | 0; + var ar = this._a | 0; + var br = this._b | 0; + var cr = this._c | 0; + var dr = this._d | 0; + var er = this._e | 0; + for (var i7 = 0; i7 < 80; i7 += 1) { + var tl; + var tr; + if (i7 < 16) { + tl = fn1(al, bl, cl, dl, el, words2[zl[i7]], hl[0], sl[i7]); + tr = fn5(ar, br, cr, dr, er, words2[zr[i7]], hr[0], sr[i7]); + } else if (i7 < 32) { + tl = fn2(al, bl, cl, dl, el, words2[zl[i7]], hl[1], sl[i7]); + tr = fn4(ar, br, cr, dr, er, words2[zr[i7]], hr[1], sr[i7]); + } else if (i7 < 48) { + tl = fn3(al, bl, cl, dl, el, words2[zl[i7]], hl[2], sl[i7]); + tr = fn3(ar, br, cr, dr, er, words2[zr[i7]], hr[2], sr[i7]); + } else if (i7 < 64) { + tl = fn4(al, bl, cl, dl, el, words2[zl[i7]], hl[3], sl[i7]); + tr = fn2(ar, br, cr, dr, er, words2[zr[i7]], hr[3], sr[i7]); + } else { + tl = fn5(al, bl, cl, dl, el, words2[zl[i7]], hl[4], sl[i7]); + tr = fn1(ar, br, cr, dr, er, words2[zr[i7]], hr[4], sr[i7]); + } + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = tl; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = tr; + } + var t8 = this._b + cl + dr | 0; + this._b = this._c + dl + er | 0; + this._c = this._d + el + ar | 0; + this._d = this._e + al + br | 0; + this._e = this._a + bl + cr | 0; + this._a = t8; + }; + RIPEMD160.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.alloc ? Buffer4.alloc(20) : new Buffer4(20); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + buffer2.writeInt32LE(this._e, 16); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fn1(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn2(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn3(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + ((b8 | ~c7) ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn4(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn5(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ (c7 | ~d7)) + m7 + k6 | 0, s7) + e10 | 0; + } + exports$2L = RIPEMD160; + return exports$2L; +} +function dew$2J() { + if (_dewExec$2J) + return exports$2K; + _dewExec$2J = true; + var Buffer4 = dew$2P().Buffer; + function Hash3(blockSize, finalSize) { + (this || _global$T)._block = Buffer4.alloc(blockSize); + (this || _global$T)._finalSize = finalSize; + (this || _global$T)._blockSize = blockSize; + (this || _global$T)._len = 0; + } + Hash3.prototype.update = function(data, enc) { + if (typeof data === "string") { + enc = enc || "utf8"; + data = Buffer4.from(data, enc); + } + var block = (this || _global$T)._block; + var blockSize = (this || _global$T)._blockSize; + var length = data.length; + var accum = (this || _global$T)._len; + for (var offset = 0; offset < length; ) { + var assigned = accum % blockSize; + var remainder = Math.min(length - offset, blockSize - assigned); + for (var i7 = 0; i7 < remainder; i7++) { + block[assigned + i7] = data[offset + i7]; + } + accum += remainder; + offset += remainder; + if (accum % blockSize === 0) { + this._update(block); + } + } + (this || _global$T)._len += length; + return this || _global$T; + }; + Hash3.prototype.digest = function(enc) { + var rem = (this || _global$T)._len % (this || _global$T)._blockSize; + (this || _global$T)._block[rem] = 128; + (this || _global$T)._block.fill(0, rem + 1); + if (rem >= (this || _global$T)._finalSize) { + this._update((this || _global$T)._block); + (this || _global$T)._block.fill(0); + } + var bits = (this || _global$T)._len * 8; + if (bits <= 4294967295) { + (this || _global$T)._block.writeUInt32BE(bits, (this || _global$T)._blockSize - 4); + } else { + var lowBits = (bits & 4294967295) >>> 0; + var highBits = (bits - lowBits) / 4294967296; + (this || _global$T)._block.writeUInt32BE(highBits, (this || _global$T)._blockSize - 8); + (this || _global$T)._block.writeUInt32BE(lowBits, (this || _global$T)._blockSize - 4); + } + this._update((this || _global$T)._block); + var hash = this._hash(); + return enc ? hash.toString(enc) : hash; + }; + Hash3.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + exports$2K = Hash3; + return exports$2K; +} +function dew$2I() { + if (_dewExec$2I) + return exports$2J; + _dewExec$2I = true; + var inherits2 = dew$f2(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha() { + this.init(); + (this || _global$S)._w = W5; + Hash3.call(this || _global$S, 64, 56); + } + inherits2(Sha, Hash3); + Sha.prototype.init = function() { + (this || _global$S)._a = 1732584193; + (this || _global$S)._b = 4023233417; + (this || _global$S)._c = 2562383102; + (this || _global$S)._d = 271733878; + (this || _global$S)._e = 3285377520; + return this || _global$S; + }; + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha.prototype._update = function(M6) { + var W6 = (this || _global$S)._w; + var a7 = (this || _global$S)._a | 0; + var b8 = (this || _global$S)._b | 0; + var c7 = (this || _global$S)._c | 0; + var d7 = (this || _global$S)._d | 0; + var e10 = (this || _global$S)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]; + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$S)._a = a7 + (this || _global$S)._a | 0; + (this || _global$S)._b = b8 + (this || _global$S)._b | 0; + (this || _global$S)._c = c7 + (this || _global$S)._c | 0; + (this || _global$S)._d = d7 + (this || _global$S)._d | 0; + (this || _global$S)._e = e10 + (this || _global$S)._e | 0; + }; + Sha.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$S)._a | 0, 0); + H5.writeInt32BE((this || _global$S)._b | 0, 4); + H5.writeInt32BE((this || _global$S)._c | 0, 8); + H5.writeInt32BE((this || _global$S)._d | 0, 12); + H5.writeInt32BE((this || _global$S)._e | 0, 16); + return H5; + }; + exports$2J = Sha; + return exports$2J; +} +function dew$2H() { + if (_dewExec$2H) + return exports$2I; + _dewExec$2H = true; + var inherits2 = dew$f2(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha1() { + this.init(); + (this || _global$R)._w = W5; + Hash3.call(this || _global$R, 64, 56); + } + inherits2(Sha1, Hash3); + Sha1.prototype.init = function() { + (this || _global$R)._a = 1732584193; + (this || _global$R)._b = 4023233417; + (this || _global$R)._c = 2562383102; + (this || _global$R)._d = 271733878; + (this || _global$R)._e = 3285377520; + return this || _global$R; + }; + function rotl1(num) { + return num << 1 | num >>> 31; + } + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha1.prototype._update = function(M6) { + var W6 = (this || _global$R)._w; + var a7 = (this || _global$R)._a | 0; + var b8 = (this || _global$R)._b | 0; + var c7 = (this || _global$R)._c | 0; + var d7 = (this || _global$R)._d | 0; + var e10 = (this || _global$R)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = rotl1(W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]); + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$R)._a = a7 + (this || _global$R)._a | 0; + (this || _global$R)._b = b8 + (this || _global$R)._b | 0; + (this || _global$R)._c = c7 + (this || _global$R)._c | 0; + (this || _global$R)._d = d7 + (this || _global$R)._d | 0; + (this || _global$R)._e = e10 + (this || _global$R)._e | 0; + }; + Sha1.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$R)._a | 0, 0); + H5.writeInt32BE((this || _global$R)._b | 0, 4); + H5.writeInt32BE((this || _global$R)._c | 0, 8); + H5.writeInt32BE((this || _global$R)._d | 0, 12); + H5.writeInt32BE((this || _global$R)._e | 0, 16); + return H5; + }; + exports$2I = Sha1; + return exports$2I; +} +function dew$2G() { + if (_dewExec$2G) + return exports$2H; + _dewExec$2G = true; + var inherits2 = dew$f2(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var K5 = [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]; + var W5 = new Array(64); + function Sha256() { + this.init(); + (this || _global$Q)._w = W5; + Hash3.call(this || _global$Q, 64, 56); + } + inherits2(Sha256, Hash3); + Sha256.prototype.init = function() { + (this || _global$Q)._a = 1779033703; + (this || _global$Q)._b = 3144134277; + (this || _global$Q)._c = 1013904242; + (this || _global$Q)._d = 2773480762; + (this || _global$Q)._e = 1359893119; + (this || _global$Q)._f = 2600822924; + (this || _global$Q)._g = 528734635; + (this || _global$Q)._h = 1541459225; + return this || _global$Q; + }; + function ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7) { + return (x7 >>> 2 | x7 << 30) ^ (x7 >>> 13 | x7 << 19) ^ (x7 >>> 22 | x7 << 10); + } + function sigma1(x7) { + return (x7 >>> 6 | x7 << 26) ^ (x7 >>> 11 | x7 << 21) ^ (x7 >>> 25 | x7 << 7); + } + function gamma0(x7) { + return (x7 >>> 7 | x7 << 25) ^ (x7 >>> 18 | x7 << 14) ^ x7 >>> 3; + } + function gamma1(x7) { + return (x7 >>> 17 | x7 << 15) ^ (x7 >>> 19 | x7 << 13) ^ x7 >>> 10; + } + Sha256.prototype._update = function(M6) { + var W6 = (this || _global$Q)._w; + var a7 = (this || _global$Q)._a | 0; + var b8 = (this || _global$Q)._b | 0; + var c7 = (this || _global$Q)._c | 0; + var d7 = (this || _global$Q)._d | 0; + var e10 = (this || _global$Q)._e | 0; + var f8 = (this || _global$Q)._f | 0; + var g7 = (this || _global$Q)._g | 0; + var h8 = (this || _global$Q)._h | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 64; ++i7) + W6[i7] = gamma1(W6[i7 - 2]) + W6[i7 - 7] + gamma0(W6[i7 - 15]) + W6[i7 - 16] | 0; + for (var j6 = 0; j6 < 64; ++j6) { + var T1 = h8 + sigma1(e10) + ch(e10, f8, g7) + K5[j6] + W6[j6] | 0; + var T22 = sigma0(a7) + maj(a7, b8, c7) | 0; + h8 = g7; + g7 = f8; + f8 = e10; + e10 = d7 + T1 | 0; + d7 = c7; + c7 = b8; + b8 = a7; + a7 = T1 + T22 | 0; + } + (this || _global$Q)._a = a7 + (this || _global$Q)._a | 0; + (this || _global$Q)._b = b8 + (this || _global$Q)._b | 0; + (this || _global$Q)._c = c7 + (this || _global$Q)._c | 0; + (this || _global$Q)._d = d7 + (this || _global$Q)._d | 0; + (this || _global$Q)._e = e10 + (this || _global$Q)._e | 0; + (this || _global$Q)._f = f8 + (this || _global$Q)._f | 0; + (this || _global$Q)._g = g7 + (this || _global$Q)._g | 0; + (this || _global$Q)._h = h8 + (this || _global$Q)._h | 0; + }; + Sha256.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(32); + H5.writeInt32BE((this || _global$Q)._a, 0); + H5.writeInt32BE((this || _global$Q)._b, 4); + H5.writeInt32BE((this || _global$Q)._c, 8); + H5.writeInt32BE((this || _global$Q)._d, 12); + H5.writeInt32BE((this || _global$Q)._e, 16); + H5.writeInt32BE((this || _global$Q)._f, 20); + H5.writeInt32BE((this || _global$Q)._g, 24); + H5.writeInt32BE((this || _global$Q)._h, 28); + return H5; + }; + exports$2H = Sha256; + return exports$2H; +} +function dew$2F() { + if (_dewExec$2F) + return exports$2G; + _dewExec$2F = true; + var inherits2 = dew$f2(); + var Sha256 = dew$2G(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var W5 = new Array(64); + function Sha224() { + this.init(); + (this || _global$P)._w = W5; + Hash3.call(this || _global$P, 64, 56); + } + inherits2(Sha224, Sha256); + Sha224.prototype.init = function() { + (this || _global$P)._a = 3238371032; + (this || _global$P)._b = 914150663; + (this || _global$P)._c = 812702999; + (this || _global$P)._d = 4144912697; + (this || _global$P)._e = 4290775857; + (this || _global$P)._f = 1750603025; + (this || _global$P)._g = 1694076839; + (this || _global$P)._h = 3204075428; + return this || _global$P; + }; + Sha224.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(28); + H5.writeInt32BE((this || _global$P)._a, 0); + H5.writeInt32BE((this || _global$P)._b, 4); + H5.writeInt32BE((this || _global$P)._c, 8); + H5.writeInt32BE((this || _global$P)._d, 12); + H5.writeInt32BE((this || _global$P)._e, 16); + H5.writeInt32BE((this || _global$P)._f, 20); + H5.writeInt32BE((this || _global$P)._g, 24); + return H5; + }; + exports$2G = Sha224; + return exports$2G; +} +function dew$2E() { + if (_dewExec$2E) + return exports$2F; + _dewExec$2E = true; + var inherits2 = dew$f2(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var K5 = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + var W5 = new Array(160); + function Sha512() { + this.init(); + (this || _global$O)._w = W5; + Hash3.call(this || _global$O, 128, 112); + } + inherits2(Sha512, Hash3); + Sha512.prototype.init = function() { + (this || _global$O)._ah = 1779033703; + (this || _global$O)._bh = 3144134277; + (this || _global$O)._ch = 1013904242; + (this || _global$O)._dh = 2773480762; + (this || _global$O)._eh = 1359893119; + (this || _global$O)._fh = 2600822924; + (this || _global$O)._gh = 528734635; + (this || _global$O)._hh = 1541459225; + (this || _global$O)._al = 4089235720; + (this || _global$O)._bl = 2227873595; + (this || _global$O)._cl = 4271175723; + (this || _global$O)._dl = 1595750129; + (this || _global$O)._el = 2917565137; + (this || _global$O)._fl = 725511199; + (this || _global$O)._gl = 4215389547; + (this || _global$O)._hl = 327033209; + return this || _global$O; + }; + function Ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7, xl) { + return (x7 >>> 28 | xl << 4) ^ (xl >>> 2 | x7 << 30) ^ (xl >>> 7 | x7 << 25); + } + function sigma1(x7, xl) { + return (x7 >>> 14 | xl << 18) ^ (x7 >>> 18 | xl << 14) ^ (xl >>> 9 | x7 << 23); + } + function Gamma0(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ x7 >>> 7; + } + function Gamma0l(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ (x7 >>> 7 | xl << 25); + } + function Gamma1(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ x7 >>> 6; + } + function Gamma1l(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ (x7 >>> 6 | xl << 26); + } + function getCarry(a7, b8) { + return a7 >>> 0 < b8 >>> 0 ? 1 : 0; + } + Sha512.prototype._update = function(M6) { + var W6 = (this || _global$O)._w; + var ah = (this || _global$O)._ah | 0; + var bh = (this || _global$O)._bh | 0; + var ch = (this || _global$O)._ch | 0; + var dh = (this || _global$O)._dh | 0; + var eh = (this || _global$O)._eh | 0; + var fh = (this || _global$O)._fh | 0; + var gh = (this || _global$O)._gh | 0; + var hh = (this || _global$O)._hh | 0; + var al = (this || _global$O)._al | 0; + var bl = (this || _global$O)._bl | 0; + var cl = (this || _global$O)._cl | 0; + var dl = (this || _global$O)._dl | 0; + var el = (this || _global$O)._el | 0; + var fl = (this || _global$O)._fl | 0; + var gl = (this || _global$O)._gl | 0; + var hl = (this || _global$O)._hl | 0; + for (var i7 = 0; i7 < 32; i7 += 2) { + W6[i7] = M6.readInt32BE(i7 * 4); + W6[i7 + 1] = M6.readInt32BE(i7 * 4 + 4); + } + for (; i7 < 160; i7 += 2) { + var xh = W6[i7 - 15 * 2]; + var xl = W6[i7 - 15 * 2 + 1]; + var gamma0 = Gamma0(xh, xl); + var gamma0l = Gamma0l(xl, xh); + xh = W6[i7 - 2 * 2]; + xl = W6[i7 - 2 * 2 + 1]; + var gamma1 = Gamma1(xh, xl); + var gamma1l = Gamma1l(xl, xh); + var Wi7h = W6[i7 - 7 * 2]; + var Wi7l = W6[i7 - 7 * 2 + 1]; + var Wi16h = W6[i7 - 16 * 2]; + var Wi16l = W6[i7 - 16 * 2 + 1]; + var Wil = gamma0l + Wi7l | 0; + var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0; + Wil = Wil + gamma1l | 0; + Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0; + Wil = Wil + Wi16l | 0; + Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0; + W6[i7] = Wih; + W6[i7 + 1] = Wil; + } + for (var j6 = 0; j6 < 160; j6 += 2) { + Wih = W6[j6]; + Wil = W6[j6 + 1]; + var majh = maj(ah, bh, ch); + var majl = maj(al, bl, cl); + var sigma0h = sigma0(ah, al); + var sigma0l = sigma0(al, ah); + var sigma1h = sigma1(eh, el); + var sigma1l = sigma1(el, eh); + var Kih = K5[j6]; + var Kil = K5[j6 + 1]; + var chh = Ch(eh, fh, gh); + var chl = Ch(el, fl, gl); + var t1l = hl + sigma1l | 0; + var t1h = hh + sigma1h + getCarry(t1l, hl) | 0; + t1l = t1l + chl | 0; + t1h = t1h + chh + getCarry(t1l, chl) | 0; + t1l = t1l + Kil | 0; + t1h = t1h + Kih + getCarry(t1l, Kil) | 0; + t1l = t1l + Wil | 0; + t1h = t1h + Wih + getCarry(t1l, Wil) | 0; + var t2l = sigma0l + majl | 0; + var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0; + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = dl + t1l | 0; + eh = dh + t1h + getCarry(el, dl) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = t1l + t2l | 0; + ah = t1h + t2h + getCarry(al, t1l) | 0; + } + (this || _global$O)._al = (this || _global$O)._al + al | 0; + (this || _global$O)._bl = (this || _global$O)._bl + bl | 0; + (this || _global$O)._cl = (this || _global$O)._cl + cl | 0; + (this || _global$O)._dl = (this || _global$O)._dl + dl | 0; + (this || _global$O)._el = (this || _global$O)._el + el | 0; + (this || _global$O)._fl = (this || _global$O)._fl + fl | 0; + (this || _global$O)._gl = (this || _global$O)._gl + gl | 0; + (this || _global$O)._hl = (this || _global$O)._hl + hl | 0; + (this || _global$O)._ah = (this || _global$O)._ah + ah + getCarry((this || _global$O)._al, al) | 0; + (this || _global$O)._bh = (this || _global$O)._bh + bh + getCarry((this || _global$O)._bl, bl) | 0; + (this || _global$O)._ch = (this || _global$O)._ch + ch + getCarry((this || _global$O)._cl, cl) | 0; + (this || _global$O)._dh = (this || _global$O)._dh + dh + getCarry((this || _global$O)._dl, dl) | 0; + (this || _global$O)._eh = (this || _global$O)._eh + eh + getCarry((this || _global$O)._el, el) | 0; + (this || _global$O)._fh = (this || _global$O)._fh + fh + getCarry((this || _global$O)._fl, fl) | 0; + (this || _global$O)._gh = (this || _global$O)._gh + gh + getCarry((this || _global$O)._gl, gl) | 0; + (this || _global$O)._hh = (this || _global$O)._hh + hh + getCarry((this || _global$O)._hl, hl) | 0; + }; + Sha512.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(64); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$O)._ah, (this || _global$O)._al, 0); + writeInt64BE((this || _global$O)._bh, (this || _global$O)._bl, 8); + writeInt64BE((this || _global$O)._ch, (this || _global$O)._cl, 16); + writeInt64BE((this || _global$O)._dh, (this || _global$O)._dl, 24); + writeInt64BE((this || _global$O)._eh, (this || _global$O)._el, 32); + writeInt64BE((this || _global$O)._fh, (this || _global$O)._fl, 40); + writeInt64BE((this || _global$O)._gh, (this || _global$O)._gl, 48); + writeInt64BE((this || _global$O)._hh, (this || _global$O)._hl, 56); + return H5; + }; + exports$2F = Sha512; + return exports$2F; +} +function dew$2D() { + if (_dewExec$2D) + return exports$2E; + _dewExec$2D = true; + var inherits2 = dew$f2(); + var SHA512 = dew$2E(); + var Hash3 = dew$2J(); + var Buffer4 = dew$2P().Buffer; + var W5 = new Array(160); + function Sha384() { + this.init(); + (this || _global$N)._w = W5; + Hash3.call(this || _global$N, 128, 112); + } + inherits2(Sha384, SHA512); + Sha384.prototype.init = function() { + (this || _global$N)._ah = 3418070365; + (this || _global$N)._bh = 1654270250; + (this || _global$N)._ch = 2438529370; + (this || _global$N)._dh = 355462360; + (this || _global$N)._eh = 1731405415; + (this || _global$N)._fh = 2394180231; + (this || _global$N)._gh = 3675008525; + (this || _global$N)._hh = 1203062813; + (this || _global$N)._al = 3238371032; + (this || _global$N)._bl = 914150663; + (this || _global$N)._cl = 812702999; + (this || _global$N)._dl = 4144912697; + (this || _global$N)._el = 4290775857; + (this || _global$N)._fl = 1750603025; + (this || _global$N)._gl = 1694076839; + (this || _global$N)._hl = 3204075428; + return this || _global$N; + }; + Sha384.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(48); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$N)._ah, (this || _global$N)._al, 0); + writeInt64BE((this || _global$N)._bh, (this || _global$N)._bl, 8); + writeInt64BE((this || _global$N)._ch, (this || _global$N)._cl, 16); + writeInt64BE((this || _global$N)._dh, (this || _global$N)._dl, 24); + writeInt64BE((this || _global$N)._eh, (this || _global$N)._el, 32); + writeInt64BE((this || _global$N)._fh, (this || _global$N)._fl, 40); + return H5; + }; + exports$2E = Sha384; + return exports$2E; +} +function dew$2C() { + if (_dewExec$2C) + return module$b.exports; + _dewExec$2C = true; + var exports28 = module$b.exports = function SHA(algorithm) { + algorithm = algorithm.toLowerCase(); + var Algorithm = exports28[algorithm]; + if (!Algorithm) + throw new Error(algorithm + " is not supported (we accept pull requests)"); + return new Algorithm(); + }; + exports28.sha = dew$2I(); + exports28.sha1 = dew$2H(); + exports28.sha224 = dew$2F(); + exports28.sha256 = dew$2G(); + exports28.sha384 = dew$2D(); + exports28.sha512 = dew$2E(); + return module$b.exports; +} +function dew$f$2() { + if (_dewExec$f$2) + return exports$f$2; + _dewExec$f$2 = true; + if (typeof Object.create === "function") { + exports$f$2 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + exports$f$2 = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return exports$f$2; +} +function dew$e$2() { + if (_dewExec$e$2) + return exports$e$2; + _dewExec$e$2 = true; + exports$e$2 = y.EventEmitter; + return exports$e$2; +} +function dew$d$2() { + if (_dewExec$d$2) + return exports$d$2; + _dewExec$d$2 = true; + function ownKeys2(object, enumerableOnly) { + var keys2 = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) + symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys2.push.apply(keys2, symbols); + } + return keys2; + } + function _objectSpread(target) { + for (var i7 = 1; i7 < arguments.length; i7++) { + var source = arguments[i7] != null ? arguments[i7] : {}; + if (i7 % 2) { + ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function _defineProperty(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties3(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass3(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties3(Constructor.prototype, protoProps); + return Constructor; + } + var _require = e$1$1, Buffer4 = _require.Buffer; + var _require2 = X2, inspect2 = _require2.inspect; + var custom2 = inspect2 && inspect2.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer4.prototype.copy.call(src, target, offset); + } + exports$d$2 = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck3(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass3(BufferList, [{ + key: "push", + value: function push4(v8) { + var entry = { + data: v8, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift4(v8) { + var entry = { + data: v8, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) + return; + var ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear2() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join3(s7) { + if (this.length === 0) + return ""; + var p7 = this.head; + var ret = "" + p7.data; + while (p7 = p7.next) { + ret += s7 + p7.data; + } + return ret; + } + }, { + key: "concat", + value: function concat2(n7) { + if (this.length === 0) + return Buffer4.alloc(0); + var ret = Buffer4.allocUnsafe(n7 >>> 0); + var p7 = this.head; + var i7 = 0; + while (p7) { + copyBuffer(p7.data, ret, i7); + i7 += p7.data.length; + p7 = p7.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n7, hasStrings) { + var ret; + if (n7 < this.head.data.length) { + ret = this.head.data.slice(0, n7); + this.head.data = this.head.data.slice(n7); + } else if (n7 === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n7) : this._getBuffer(n7); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n7) { + var p7 = this.head; + var c7 = 1; + var ret = p7.data; + n7 -= ret.length; + while (p7 = p7.next) { + var str2 = p7.data; + var nb = n7 > str2.length ? str2.length : n7; + if (nb === str2.length) + ret += str2; + else + ret += str2.slice(0, n7); + n7 -= nb; + if (n7 === 0) { + if (nb === str2.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = str2.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n7) { + var ret = Buffer4.allocUnsafe(n7); + var p7 = this.head; + var c7 = 1; + p7.data.copy(ret); + n7 -= p7.data.length; + while (p7 = p7.next) { + var buf = p7.data; + var nb = n7 > buf.length ? buf.length : n7; + buf.copy(ret, ret.length - n7, 0, nb); + n7 -= nb; + if (n7 === 0) { + if (nb === buf.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = buf.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom2, + value: function value2(_6, options) { + return inspect2(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + return exports$d$2; +} +function dew$c$2() { + if (_dewExec$c$2) + return exports$c$2; + _dewExec$c$2 = true; + var process5 = T$1; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process5.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process5.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process5.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process5.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process5.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process5.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process5.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) + return; + if (self2._readableState && !self2._readableState.emitClose) + return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream2, err) { + var rState = stream2._readableState; + var wState = stream2._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) + stream2.destroy(err); + else + stream2.emit("error", err); + } + exports$c$2 = { + destroy, + undestroy, + errorOrDestroy + }; + return exports$c$2; +} +function dew$b$2() { + if (_dewExec$b$2) + return exports$b$2; + _dewExec$b$2 = true; + const codes2 = {}; + function createErrorType(code, message, Base2) { + if (!Base2) { + Base2 = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + class NodeError extends Base2 { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base2.name; + NodeError.prototype.code = code; + codes2[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i7) => String(i7)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith2(str2, search, pos) { + return str2.substr(0, search.length) === search; + } + function endsWith2(str2, search, this_len) { + if (this_len === void 0 || this_len > str2.length) { + this_len = str2.length; + } + return str2.substring(this_len - search.length, this_len) === search; + } + function includes2(str2, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str2.length) { + return false; + } else { + return str2.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value2) { + return 'The value "' + value2 + '" is invalid for option "' + name2 + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith2(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith2(name2, " argument")) { + msg = `The ${name2} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type3 = includes2(name2, ".") ? "property" : "argument"; + msg = `The "${name2}" ${type3} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) { + return "The " + name2 + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name2) { + return "Cannot call " + name2 + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + exports$b$2.codes = codes2; + return exports$b$2; +} +function dew$a$2() { + if (_dewExec$a$2) + return exports$a$2; + _dewExec$a$2 = true; + var ERR_INVALID_OPT_VALUE = dew$b$2().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name2 = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name2, hwm); + } + return Math.floor(hwm); + } + return state.objectMode ? 16 : 16 * 1024; + } + exports$a$2 = { + getHighWaterMark + }; + return exports$a$2; +} +function dew$9$2() { + if (_dewExec$9$2) + return exports$9$2; + _dewExec$9$2 = true; + exports$9$2 = deprecate2; + function deprecate2(fn, msg) { + if (config3("noDeprecation")) { + return fn; + } + var warned = false; + function deprecated() { + if (!warned) { + if (config3("throwDeprecation")) { + throw new Error(msg); + } else if (config3("traceDeprecation")) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this || _global$2$2, arguments); + } + return deprecated; + } + function config3(name2) { + try { + if (!_global$2$2.localStorage) + return false; + } catch (_6) { + return false; + } + var val = _global$2$2.localStorage[name2]; + if (null == val) + return false; + return String(val).toLowerCase() === "true"; + } + return exports$9$2; +} +function dew$8$2() { + if (_dewExec$8$2) + return exports$8$2; + _dewExec$8$2 = true; + var process5 = T$1; + exports$8$2 = Writable2; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var Duplex2; + Writable2.WritableState = WritableState; + var internalUtil = { + deprecate: dew$9$2() + }; + var Stream2 = dew$e$2(); + var Buffer4 = e$1$1.Buffer; + var OurUint8Array = _global$1$2.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = dew$c$2(); + var _require = dew$a$2(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$b$2().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + dew$f$2()(Writable2, Stream2); + function nop() { + } + function WritableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$7$2(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream2, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_6) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable2, Symbol.hasInstance, { + value: function value2(object) { + if (realHasInstance.call(this, object)) + return true; + if (this !== Writable2) + return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable2(options) { + Duplex2 = Duplex2 || dew$7$2(); + var isDuplex = this instanceof Duplex2; + if (!isDuplex && !realHasInstance.call(Writable2, this)) + return new Writable2(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") + this._write = options.write; + if (typeof options.writev === "function") + this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") + this._final = options.final; + } + Stream2.call(this); + } + Writable2.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream2, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream2, er); + process5.nextTick(cb, er); + } + function validChunk(stream2, state, chunk2, cb) { + var er; + if (chunk2 === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk2 !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer"], chunk2); + } + if (er) { + errorOrDestroy(stream2, er); + process5.nextTick(cb, er); + return false; + } + return true; + } + Writable2.prototype.write = function(chunk2, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk2); + if (isBuf && !Buffer4.isBuffer(chunk2)) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) + encoding = "buffer"; + else if (!encoding) + encoding = state.defaultEncoding; + if (typeof cb !== "function") + cb = nop; + if (state.ending) + writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk2, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk2, encoding, cb); + } + return ret; + }; + Writable2.prototype.cork = function() { + this._writableState.corked++; + }; + Writable2.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) + clearBuffer(this, state); + } + }; + Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) + throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state, chunk2, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk2 === "string") { + chunk2 = Buffer4.from(chunk2, encoding); + } + return chunk2; + } + Object.defineProperty(Writable2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream2, state, isBuf, chunk2, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk2, encoding); + if (chunk2 !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk2 = newChunk; + } + } + var len = state.objectMode ? 1 : chunk2.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked) { + var last2 = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk2, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last2) { + last2.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream2, state, false, len, chunk2, encoding, cb); + } + return ret; + } + function doWrite(stream2, state, writev, len, chunk2, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) + state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) + stream2._writev(chunk2, state.onwrite); + else + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream2, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + process5.nextTick(cb, er); + process5.nextTick(finishMaybe, stream2, state); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + } else { + cb(er); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + finishMaybe(stream2, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream2, er) { + var state = stream2._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") + throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) + onwriteError(stream2, state, sync, er, cb); + else { + var finished2 = needFinish(state) || stream2.destroyed; + if (!finished2 && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream2, state); + } + if (sync) { + process5.nextTick(afterWrite, stream2, state, finished2, cb); + } else { + afterWrite(stream2, state, finished2, cb); + } + } + } + function afterWrite(stream2, state, finished2, cb) { + if (!finished2) + onwriteDrain(stream2, state); + state.pendingcb--; + cb(); + finishMaybe(stream2, state); + } + function onwriteDrain(stream2, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream2.emit("drain"); + } + } + function clearBuffer(stream2, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream2._writev && entry && entry.next) { + var l7 = state.bufferedRequestCount; + var buffer2 = new Array(l7); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count2 = 0; + var allBuffers = true; + while (entry) { + buffer2[count2] = entry; + if (!entry.isBuf) + allBuffers = false; + entry = entry.next; + count2 += 1; + } + buffer2.allBuffers = allBuffers; + doWrite(stream2, state, true, state.length, buffer2, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk2 = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk2.length; + doWrite(stream2, state, false, len, chunk2, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable2.prototype._write = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable2.prototype._writev = null; + Writable2.prototype.end = function(chunk2, encoding, cb) { + var state = this._writableState; + if (typeof chunk2 === "function") { + cb = chunk2; + chunk2 = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk2 !== null && chunk2 !== void 0) + this.write(chunk2, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) + endWritable(this, state, cb); + return this; + }; + Object.defineProperty(Writable2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream2, state) { + stream2._final(function(err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream2, err); + } + state.prefinished = true; + stream2.emit("prefinish"); + finishMaybe(stream2, state); + }); + } + function prefinish(stream2, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream2._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process5.nextTick(callFinal, stream2, state); + } else { + state.prefinished = true; + stream2.emit("prefinish"); + } + } + } + function finishMaybe(stream2, state) { + var need = needFinish(state); + if (need) { + prefinish(stream2, state); + if (state.pendingcb === 0) { + state.finished = true; + stream2.emit("finish"); + if (state.autoDestroy) { + var rState = stream2._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream2.destroy(); + } + } + } + } + return need; + } + function endWritable(stream2, state, cb) { + state.ending = true; + finishMaybe(stream2, state); + if (cb) { + if (state.finished) + process5.nextTick(cb); + else + stream2.once("finish", cb); + } + state.ended = true; + stream2.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set4(value2) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value2; + } + }); + Writable2.prototype.destroy = destroyImpl.destroy; + Writable2.prototype._undestroy = destroyImpl.undestroy; + Writable2.prototype._destroy = function(err, cb) { + cb(err); + }; + return exports$8$2; +} +function dew$7$2() { + if (_dewExec$7$2) + return exports$7$2; + _dewExec$7$2 = true; + var process5 = T$1; + var objectKeys = Object.keys || function(obj) { + var keys3 = []; + for (var key in obj) { + keys3.push(key); + } + return keys3; + }; + exports$7$2 = Duplex2; + var Readable3 = dew$3$2(); + var Writable2 = dew$8$2(); + dew$f$2()(Duplex2, Readable3); + { + var keys2 = objectKeys(Writable2.prototype); + for (var v8 = 0; v8 < keys2.length; v8++) { + var method2 = keys2[v8]; + if (!Duplex2.prototype[method2]) + Duplex2.prototype[method2] = Writable2.prototype[method2]; + } + } + function Duplex2(options) { + if (!(this instanceof Duplex2)) + return new Duplex2(options); + Readable3.call(this, options); + Writable2.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) + this.readable = false; + if (options.writable === false) + this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) + return; + process5.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set4(value2) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value2; + this._writableState.destroyed = value2; + } + }); + return exports$7$2; +} +function dew$6$2() { + if (_dewExec$6$2) + return exports$6$2; + _dewExec$6$2 = true; + var ERR_STREAM_PREMATURE_CLOSE = dew$b$2().codes.ERR_STREAM_PREMATURE_CLOSE; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; + } + function noop4() { + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function eos(stream2, opts, callback) { + if (typeof opts === "function") + return eos(stream2, null, opts); + if (!opts) + opts = {}; + callback = once5(callback || noop4); + var readable = opts.readable || opts.readable !== false && stream2.readable; + var writable = opts.writable || opts.writable !== false && stream2.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream2.writable) + onfinish(); + }; + var writableEnded = stream2._writableState && stream2._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) + callback.call(stream2); + }; + var readableEnded = stream2._readableState && stream2._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) + callback.call(stream2); + }; + var onerror = function onerror2(err) { + callback.call(stream2, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream2._readableState || !stream2._readableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + if (writable && !writableEnded) { + if (!stream2._writableState || !stream2._writableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + }; + var onrequest = function onrequest2() { + stream2.req.on("finish", onfinish); + }; + if (isRequest(stream2)) { + stream2.on("complete", onfinish); + stream2.on("abort", onclose); + if (stream2.req) + onrequest(); + else + stream2.on("request", onrequest); + } else if (writable && !stream2._writableState) { + stream2.on("end", onlegacyfinish); + stream2.on("close", onlegacyfinish); + } + stream2.on("end", onend); + stream2.on("finish", onfinish); + if (opts.error !== false) + stream2.on("error", onerror); + stream2.on("close", onclose); + return function() { + stream2.removeListener("complete", onfinish); + stream2.removeListener("abort", onclose); + stream2.removeListener("request", onrequest); + if (stream2.req) + stream2.req.removeListener("finish", onfinish); + stream2.removeListener("end", onlegacyfinish); + stream2.removeListener("close", onlegacyfinish); + stream2.removeListener("finish", onfinish); + stream2.removeListener("end", onend); + stream2.removeListener("error", onerror); + stream2.removeListener("close", onclose); + }; + } + exports$6$2 = eos; + return exports$6$2; +} +function dew$5$2() { + if (_dewExec$5$2) + return exports$5$2; + _dewExec$5$2 = true; + var process5 = T$1; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value2) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + var finished2 = dew$6$2(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult2(value2, done) { + return { + value: value2, + done + }; + } + function readAndResolve(iter) { + var resolve3 = iter[kLastResolve]; + if (resolve3 !== null) { + var data = iter[kStream].read(); + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } + } + } + function onReadable(iter) { + process5.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve3, reject2) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve3(createIterResult2(void 0, true)); + return; + } + iter[kHandlePromise](resolve3, reject2); + }, reject2); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error2 = this[kError]; + if (error2 !== null) { + return Promise.reject(error2); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult2(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve3, reject2) { + process5.nextTick(function() { + if (_this[kError]) { + reject2(_this[kError]); + } else { + resolve3(createIterResult2(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult2(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve3, reject2) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject2(err); + return; + } + resolve3(createIterResult2(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream2) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream2, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream2._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value2(resolve3, reject2) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } else { + iterator[kLastResolve] = resolve3; + iterator[kLastReject] = reject2; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished2(stream2, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject2 = iterator[kLastReject]; + if (reject2 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject2(err); + } + iterator[kError] = err; + return; + } + var resolve3 = iterator[kLastResolve]; + if (resolve3 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(void 0, true)); + } + iterator[kEnded] = true; + }); + stream2.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + exports$5$2 = createReadableStreamAsyncIterator; + return exports$5$2; +} +function dew$4$2() { + if (_dewExec$4$2) + return exports$4$2; + _dewExec$4$2 = true; + exports$4$2 = function() { + throw new Error("Readable.from is not available in the browser"); + }; + return exports$4$2; +} +function dew$3$2() { + if (_dewExec$3$2) + return exports$3$2; + _dewExec$3$2 = true; + var process5 = T$1; + exports$3$2 = Readable3; + var Duplex2; + Readable3.ReadableState = ReadableState; + y.EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type3) { + return emitter.listeners(type3).length; + }; + var Stream2 = dew$e$2(); + var Buffer4 = e$1$1.Buffer; + var OurUint8Array = _global$M.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = X2; + var debug2; + if (debugUtil && debugUtil.debuglog) { + debug2 = debugUtil.debuglog("stream"); + } else { + debug2 = function debug3() { + }; + } + var BufferList = dew$d$2(); + var destroyImpl = dew$c$2(); + var _require = dew$a$2(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$b$2().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder2; + var createReadableStreamAsyncIterator; + var from; + dew$f$2()(Readable3, Stream2); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener3(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$7$2(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder2) + StringDecoder2 = e$12.StringDecoder; + this.decoder = new StringDecoder2(options.encoding); + this.encoding = options.encoding; + } + } + function Readable3(options) { + Duplex2 = Duplex2 || dew$7$2(); + if (!(this instanceof Readable3)) + return new Readable3(options); + var isDuplex = this instanceof Duplex2; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") + this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + } + Stream2.call(this); + } + Object.defineProperty(Readable3.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set4(value2) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value2; + } + }); + Readable3.prototype.destroy = destroyImpl.destroy; + Readable3.prototype._undestroy = destroyImpl.undestroy; + Readable3.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable3.prototype.push = function(chunk2, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk2 === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk2, encoding, false, skipChunkCheck); + }; + Readable3.prototype.unshift = function(chunk2) { + return readableAddChunk(this, chunk2, null, true, false); + }; + function readableAddChunk(stream2, chunk2, encoding, addToFront, skipChunkCheck) { + debug2("readableAddChunk", chunk2); + var state = stream2._readableState; + if (chunk2 === null) { + state.reading = false; + onEofChunk(stream2, state); + } else { + var er; + if (!skipChunkCheck) + er = chunkInvalid(state, chunk2); + if (er) { + errorOrDestroy(stream2, er); + } else if (state.objectMode || chunk2 && chunk2.length > 0) { + if (typeof chunk2 !== "string" && !state.objectMode && Object.getPrototypeOf(chunk2) !== Buffer4.prototype) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (addToFront) { + if (state.endEmitted) + errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else + addChunk(stream2, state, chunk2, true); + } else if (state.ended) { + errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk2 = state.decoder.write(chunk2); + if (state.objectMode || chunk2.length !== 0) + addChunk(stream2, state, chunk2, false); + else + maybeReadMore(stream2, state); + } else { + addChunk(stream2, state, chunk2, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream2, state); + } + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream2, state, chunk2, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream2.emit("data", chunk2); + } else { + state.length += state.objectMode ? 1 : chunk2.length; + if (addToFront) + state.buffer.unshift(chunk2); + else + state.buffer.push(chunk2); + if (state.needReadable) + emitReadable(stream2); + } + maybeReadMore(stream2, state); + } + function chunkInvalid(state, chunk2) { + var er; + if (!_isUint8Array(chunk2) && typeof chunk2 !== "string" && chunk2 !== void 0 && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer", "Uint8Array"], chunk2); + } + return er; + } + Readable3.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable3.prototype.setEncoding = function(enc) { + if (!StringDecoder2) + StringDecoder2 = e$12.StringDecoder; + var decoder = new StringDecoder2(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p7 = this._readableState.buffer.head; + var content = ""; + while (p7 !== null) { + content += decoder.write(p7.data); + p7 = p7.next; + } + this._readableState.buffer.clear(); + if (content !== "") + this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n7) { + if (n7 >= MAX_HWM) { + n7 = MAX_HWM; + } else { + n7--; + n7 |= n7 >>> 1; + n7 |= n7 >>> 2; + n7 |= n7 >>> 4; + n7 |= n7 >>> 8; + n7 |= n7 >>> 16; + n7++; + } + return n7; + } + function howMuchToRead(n7, state) { + if (n7 <= 0 || state.length === 0 && state.ended) + return 0; + if (state.objectMode) + return 1; + if (n7 !== n7) { + if (state.flowing && state.length) + return state.buffer.head.data.length; + else + return state.length; + } + if (n7 > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n7); + if (n7 <= state.length) + return n7; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable3.prototype.read = function(n7) { + debug2("read", n7); + n7 = parseInt(n7, 10); + var state = this._readableState; + var nOrig = n7; + if (n7 !== 0) + state.emittedReadable = false; + if (n7 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug2("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + n7 = howMuchToRead(n7, state); + if (n7 === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + var doRead = state.needReadable; + debug2("need readable", doRead); + if (state.length === 0 || state.length - n7 < state.highWaterMark) { + doRead = true; + debug2("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug2("reading or ended", doRead); + } else if (doRead) { + debug2("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) + state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) + n7 = howMuchToRead(nOrig, state); + } + var ret; + if (n7 > 0) + ret = fromList(n7, state); + else + ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n7 = 0; + } else { + state.length -= n7; + state.awaitDrain = 0; + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n7 && state.ended) + endReadable(this); + } + if (ret !== null) + this.emit("data", ret); + return ret; + }; + function onEofChunk(stream2, state) { + debug2("onEofChunk"); + if (state.ended) + return; + if (state.decoder) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) { + state.buffer.push(chunk2); + state.length += state.objectMode ? 1 : chunk2.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream2); + } else { + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream2); + } + } + } + function emitReadable(stream2) { + var state = stream2._readableState; + debug2("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug2("emitReadable", state.flowing); + state.emittedReadable = true; + process5.nextTick(emitReadable_, stream2); + } + } + function emitReadable_(stream2) { + var state = stream2._readableState; + debug2("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream2.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow2(stream2); + } + function maybeReadMore(stream2, state) { + if (!state.readingMore) { + state.readingMore = true; + process5.nextTick(maybeReadMore_, stream2, state); + } + } + function maybeReadMore_(stream2, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug2("maybeReadMore read 0"); + stream2.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable3.prototype._read = function(n7) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable3.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug2("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process5.stdout && dest !== process5.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + process5.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug2("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug2("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug2("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + src.on("data", ondata); + function ondata(chunk2) { + debug2("ondata"); + var ret = dest.write(chunk2); + debug2("dest.write", ret); + if (ret === false) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf4(state.pipes, dest) !== -1) && !cleanedUp) { + debug2("false write response, pause", state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug2("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) + errorOrDestroy(dest, er); + } + prependListener3(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug2("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug2("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug2("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug2("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow2(src); + } + }; + } + Readable3.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) + return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) + return this; + if (!dest) + dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i7 = 0; i7 < len; i7++) { + dests[i7].emit("unpipe", this, { + hasUnpiped: false + }); + } + return this; + } + var index4 = indexOf4(state.pipes, dest); + if (index4 === -1) + return this; + state.pipes.splice(index4, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable3.prototype.on = function(ev, fn) { + var res = Stream2.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) + this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug2("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process5.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable3.prototype.addListener = Readable3.prototype.on; + Readable3.prototype.removeListener = function(ev, fn) { + var res = Stream2.prototype.removeListener.call(this, ev, fn); + if (ev === "readable") { + process5.nextTick(updateReadableListening, this); + } + return res; + }; + Readable3.prototype.removeAllListeners = function(ev) { + var res = Stream2.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process5.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && !state.paused) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug2("readable nexttick read 0"); + self2.read(0); + } + Readable3.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug2("resume"); + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; + }; + function resume(stream2, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process5.nextTick(resume_, stream2, state); + } + } + function resume_(stream2, state) { + debug2("resume", state.reading); + if (!state.reading) { + stream2.read(0); + } + state.resumeScheduled = false; + stream2.emit("resume"); + flow2(stream2); + if (state.flowing && !state.reading) + stream2.read(0); + } + Readable3.prototype.pause = function() { + debug2("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug2("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow2(stream2) { + var state = stream2._readableState; + debug2("flow", state.flowing); + while (state.flowing && stream2.read() !== null) { + } + } + Readable3.prototype.wrap = function(stream2) { + var _this = this; + var state = this._readableState; + var paused = false; + stream2.on("end", function() { + debug2("wrapped end"); + if (state.decoder && !state.ended) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) + _this.push(chunk2); + } + _this.push(null); + }); + stream2.on("data", function(chunk2) { + debug2("wrapped data"); + if (state.decoder) + chunk2 = state.decoder.write(chunk2); + if (state.objectMode && (chunk2 === null || chunk2 === void 0)) + return; + else if (!state.objectMode && (!chunk2 || !chunk2.length)) + return; + var ret = _this.push(chunk2); + if (!ret) { + paused = true; + stream2.pause(); + } + }); + for (var i7 in stream2) { + if (this[i7] === void 0 && typeof stream2[i7] === "function") { + this[i7] = /* @__PURE__ */ function methodWrap(method2) { + return function methodWrapReturnFunction() { + return stream2[method2].apply(stream2, arguments); + }; + }(i7); + } + } + for (var n7 = 0; n7 < kProxyEvents.length; n7++) { + stream2.on(kProxyEvents[n7], this.emit.bind(this, kProxyEvents[n7])); + } + this._read = function(n8) { + debug2("wrapped _read", n8); + if (paused) { + paused = false; + stream2.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable3.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = dew$5$2(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable3.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable3.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable3.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.flowing; + }, + set: function set4(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } + }); + Readable3._fromList = fromList; + Object.defineProperty(Readable3.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.length; + } + }); + function fromList(n7, state) { + if (state.length === 0) + return null; + var ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n7 || n7 >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.first(); + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n7, state.decoder); + } + return ret; + } + function endReadable(stream2) { + var state = stream2._readableState; + debug2("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process5.nextTick(endReadableNT, state, stream2); + } + } + function endReadableNT(state, stream2) { + debug2("endReadableNT", state.endEmitted, state.length); + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream2.readable = false; + stream2.emit("end"); + if (state.autoDestroy) { + var wState = stream2._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream2.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable3.from = function(iterable, opts) { + if (from === void 0) { + from = dew$4$2(); + } + return from(Readable3, iterable, opts); + }; + } + function indexOf4(xs, x7) { + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) + return i7; + } + return -1; + } + return exports$3$2; +} +function dew$2$2() { + if (_dewExec$2$2) + return exports$2$2; + _dewExec$2$2 = true; + exports$2$2 = Transform2; + var _require$codes = dew$b$2().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex2 = dew$7$2(); + dew$f$2()(Transform2, Duplex2); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform2(options) { + if (!(this instanceof Transform2)) + return new Transform2(options); + Duplex2.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform2.prototype.push = function(chunk2, encoding) { + this._transformState.needTransform = false; + return Duplex2.prototype.push.call(this, chunk2, encoding); + }; + Transform2.prototype._transform = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform2.prototype._write = function(chunk2, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk2; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } + }; + Transform2.prototype._read = function(n7) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform2.prototype._destroy = function(err, cb) { + Duplex2.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream2, er, data) { + if (er) + return stream2.emit("error", er); + if (data != null) + stream2.push(data); + if (stream2._writableState.length) + throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream2._transformState.transforming) + throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream2.push(null); + } + return exports$2$2; +} +function dew$1$2() { + if (_dewExec$1$2) + return exports$1$2; + _dewExec$1$2 = true; + exports$1$2 = PassThrough2; + var Transform2 = dew$2$2(); + dew$f$2()(PassThrough2, Transform2); + function PassThrough2(options) { + if (!(this instanceof PassThrough2)) + return new PassThrough2(options); + Transform2.call(this, options); + } + PassThrough2.prototype._transform = function(chunk2, encoding, cb) { + cb(null, chunk2); + }; + return exports$1$2; +} +function dew$2B() { + if (_dewExec$2B) + return exports$2C; + _dewExec$2B = true; + var eos; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = dew$b$2().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop4(err) { + if (err) + throw err; + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function destroyer(stream2, reading, writing, callback) { + callback = once5(callback); + var closed = false; + stream2.on("close", function() { + closed = true; + }); + if (eos === void 0) + eos = dew$6$2(); + eos(stream2, { + readable: reading, + writable: writing + }, function(err) { + if (err) + return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) + return; + if (destroyed) + return; + destroyed = true; + if (isRequest(stream2)) + return stream2.abort(); + if (typeof stream2.destroy === "function") + return stream2.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn) { + fn(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) + return noop4; + if (typeof streams[streams.length - 1] !== "function") + return noop4; + return streams.pop(); + } + function pipeline2() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) + streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error2; + var destroys = streams.map(function(stream2, i7) { + var reading = i7 < streams.length - 1; + var writing = i7 > 0; + return destroyer(stream2, reading, writing, function(err) { + if (!error2) + error2 = err; + if (err) + destroys.forEach(call); + if (reading) + return; + destroys.forEach(call); + callback(error2); + }); + }); + return streams.reduce(pipe); + } + exports$2C = pipeline2; + return exports$2C; +} +function dew$2A() { + if (_dewExec$2A) + return exports$2B; + _dewExec$2A = true; + exports$2B = Stream2; + var EE = y.EventEmitter; + var inherits2 = dew$f$2(); + inherits2(Stream2, EE); + Stream2.Readable = dew$3$2(); + Stream2.Writable = dew$8$2(); + Stream2.Duplex = dew$7$2(); + Stream2.Transform = dew$2$2(); + Stream2.PassThrough = dew$1$2(); + Stream2.finished = dew$6$2(); + Stream2.pipeline = dew$2B(); + Stream2.Stream = Stream2; + function Stream2() { + EE.call(this || _global$L); + } + Stream2.prototype.pipe = function(dest, options) { + var source = this || _global$L; + function ondata(chunk2) { + if (dest.writable) { + if (false === dest.write(chunk2) && source.pause) { + source.pause(); + } + } + } + source.on("data", ondata); + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + dest.on("drain", ondrain); + if (!dest._isStdio && (!options || options.end !== false)) { + source.on("end", onend); + source.on("close", onclose); + } + var didOnEnd = false; + function onend() { + if (didOnEnd) + return; + didOnEnd = true; + dest.end(); + } + function onclose() { + if (didOnEnd) + return; + didOnEnd = true; + if (typeof dest.destroy === "function") + dest.destroy(); + } + function onerror(er) { + cleanup(); + if (EE.listenerCount(this || _global$L, "error") === 0) { + throw er; + } + } + source.on("error", onerror); + dest.on("error", onerror); + function cleanup() { + source.removeListener("data", ondata); + dest.removeListener("drain", ondrain); + source.removeListener("end", onend); + source.removeListener("close", onclose); + source.removeListener("error", onerror); + dest.removeListener("error", onerror); + source.removeListener("end", cleanup); + source.removeListener("close", cleanup); + dest.removeListener("close", cleanup); + } + source.on("end", cleanup); + source.on("close", cleanup); + dest.on("close", cleanup); + dest.emit("pipe", source); + return dest; + }; + return exports$2B; +} +function dew$2z() { + if (_dewExec$2z) + return exports$2A; + _dewExec$2z = true; + var Buffer4 = dew$2P().Buffer; + var Transform2 = stream.Transform; + var StringDecoder2 = e$12.StringDecoder; + var inherits2 = dew$f2(); + function CipherBase(hashMode) { + Transform2.call(this || _global$K); + (this || _global$K).hashMode = typeof hashMode === "string"; + if ((this || _global$K).hashMode) { + (this || _global$K)[hashMode] = (this || _global$K)._finalOrDigest; + } else { + (this || _global$K).final = (this || _global$K)._finalOrDigest; + } + if ((this || _global$K)._final) { + (this || _global$K).__final = (this || _global$K)._final; + (this || _global$K)._final = null; + } + (this || _global$K)._decoder = null; + (this || _global$K)._encoding = null; + } + inherits2(CipherBase, Transform2); + CipherBase.prototype.update = function(data, inputEnc, outputEnc) { + if (typeof data === "string") { + data = Buffer4.from(data, inputEnc); + } + var outData = this._update(data); + if ((this || _global$K).hashMode) + return this || _global$K; + if (outputEnc) { + outData = this._toString(outData, outputEnc); + } + return outData; + }; + CipherBase.prototype.setAutoPadding = function() { + }; + CipherBase.prototype.getAuthTag = function() { + throw new Error("trying to get auth tag in unsupported state"); + }; + CipherBase.prototype.setAuthTag = function() { + throw new Error("trying to set auth tag in unsupported state"); + }; + CipherBase.prototype.setAAD = function() { + throw new Error("trying to set aad in unsupported state"); + }; + CipherBase.prototype._transform = function(data, _6, next) { + var err; + try { + if ((this || _global$K).hashMode) { + this._update(data); + } else { + this.push(this._update(data)); + } + } catch (e10) { + err = e10; + } finally { + next(err); + } + }; + CipherBase.prototype._flush = function(done) { + var err; + try { + this.push(this.__final()); + } catch (e10) { + err = e10; + } + done(err); + }; + CipherBase.prototype._finalOrDigest = function(outputEnc) { + var outData = this.__final() || Buffer4.alloc(0); + if (outputEnc) { + outData = this._toString(outData, outputEnc, true); + } + return outData; + }; + CipherBase.prototype._toString = function(value2, enc, fin) { + if (!(this || _global$K)._decoder) { + (this || _global$K)._decoder = new StringDecoder2(enc); + (this || _global$K)._encoding = enc; + } + if ((this || _global$K)._encoding !== enc) + throw new Error("can't switch encodings"); + var out = (this || _global$K)._decoder.write(value2); + if (fin) { + out += (this || _global$K)._decoder.end(); + } + return out; + }; + exports$2A = CipherBase; + return exports$2A; +} +function dew$2y() { + if (_dewExec$2y) + return exports$2z; + _dewExec$2y = true; + var inherits2 = dew$f2(); + var MD5 = dew$2L(); + var RIPEMD160 = dew$2K(); + var sha = dew$2C(); + var Base2 = dew$2z(); + function Hash3(hash) { + Base2.call(this, "digest"); + this._hash = hash; + } + inherits2(Hash3, Base2); + Hash3.prototype._update = function(data) { + this._hash.update(data); + }; + Hash3.prototype._final = function() { + return this._hash.digest(); + }; + exports$2z = function createHash2(alg) { + alg = alg.toLowerCase(); + if (alg === "md5") + return new MD5(); + if (alg === "rmd160" || alg === "ripemd160") + return new RIPEMD160(); + return new Hash3(sha(alg)); + }; + return exports$2z; +} +function dew$2x() { + if (_dewExec$2x) + return exports$2y; + _dewExec$2x = true; + var inherits2 = dew$f2(); + var Buffer4 = dew$2P().Buffer; + var Base2 = dew$2z(); + var ZEROS = Buffer4.alloc(128); + var blocksize = 64; + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + key = alg(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = [ipad]; + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.push(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._alg(Buffer4.concat(this._hash)); + return this._alg(Buffer4.concat([this._opad, h8])); + }; + exports$2y = Hmac2; + return exports$2y; +} +function dew$2w() { + if (_dewExec$2w) + return exports$2x; + _dewExec$2w = true; + var MD5 = dew$2L(); + exports$2x = function(buffer2) { + return new MD5().update(buffer2).digest(); + }; + return exports$2x; +} +function dew$2v() { + if (_dewExec$2v) + return exports$2w; + _dewExec$2v = true; + var inherits2 = dew$f2(); + var Legacy = dew$2x(); + var Base2 = dew$2z(); + var Buffer4 = dew$2P().Buffer; + var md5 = dew$2w(); + var RIPEMD160 = dew$2K(); + var sha = dew$2C(); + var ZEROS = Buffer4.alloc(128); + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + var hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + key = hash.update(key).digest(); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + this._hash.update(ipad); + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.update(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._hash.digest(); + var hash = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg); + return hash.update(this._opad).update(h8).digest(); + }; + exports$2w = function createHmac2(alg, key) { + alg = alg.toLowerCase(); + if (alg === "rmd160" || alg === "ripemd160") { + return new Hmac2("rmd160", key); + } + if (alg === "md5") { + return new Legacy(md5, key); + } + return new Hmac2(alg, key); + }; + return exports$2w; +} +function dew$2u() { + if (_dewExec$2u) + return exports$2v; + _dewExec$2u = true; + exports$2v = _algorithms$1; + return exports$2v; +} +function dew$2t() { + if (_dewExec$2t) + return exports$2u; + _dewExec$2t = true; + var MAX_ALLOC = Math.pow(2, 30) - 1; + exports$2u = function(iterations, keylen) { + if (typeof iterations !== "number") { + throw new TypeError("Iterations not a number"); + } + if (iterations < 0) { + throw new TypeError("Bad iterations"); + } + if (typeof keylen !== "number") { + throw new TypeError("Key length not a number"); + } + if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { + throw new TypeError("Bad key length"); + } + }; + return exports$2u; +} +function dew$2s() { + if (_dewExec$2s) + return exports$2t; + _dewExec$2s = true; + var process$1$1 = process4; + var defaultEncoding; + if (_global$J.process && _global$J.process.browser) { + defaultEncoding = "utf-8"; + } else if (_global$J.process && _global$J.process.version) { + var pVersionMajor = parseInt(process$1$1.version.split(".")[0].slice(1), 10); + defaultEncoding = pVersionMajor >= 6 ? "utf-8" : "binary"; + } else { + defaultEncoding = "utf-8"; + } + exports$2t = defaultEncoding; + return exports$2t; +} +function dew$2r() { + if (_dewExec$2r) + return exports$2s; + _dewExec$2r = true; + var Buffer4 = dew$2P().Buffer; + exports$2s = function(thing, encoding, name2) { + if (Buffer4.isBuffer(thing)) { + return thing; + } else if (typeof thing === "string") { + return Buffer4.from(thing, encoding); + } else if (ArrayBuffer.isView(thing)) { + return Buffer4.from(thing.buffer); + } else { + throw new TypeError(name2 + " must be a string, a Buffer, a typed array or a DataView"); + } + }; + return exports$2s; +} +function dew$2q() { + if (_dewExec$2q) + return exports$2r; + _dewExec$2q = true; + var md5 = dew$2w(); + var RIPEMD160 = dew$2K(); + var sha = dew$2C(); + var Buffer4 = dew$2P().Buffer; + var checkParameters = dew$2t(); + var defaultEncoding = dew$2s(); + var toBuffer = dew$2r(); + var ZEROS = Buffer4.alloc(128); + var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 + }; + function Hmac2(alg, key, saltLen) { + var hash = getDigest(alg); + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + if (key.length > blocksize) { + key = hash(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + var opad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + var ipad1 = Buffer4.allocUnsafe(blocksize + saltLen + 4); + ipad.copy(ipad1, 0, 0, blocksize); + (this || _global$I).ipad1 = ipad1; + (this || _global$I).ipad2 = ipad; + (this || _global$I).opad = opad; + (this || _global$I).alg = alg; + (this || _global$I).blocksize = blocksize; + (this || _global$I).hash = hash; + (this || _global$I).size = sizes[alg]; + } + Hmac2.prototype.run = function(data, ipad) { + data.copy(ipad, (this || _global$I).blocksize); + var h8 = this.hash(ipad); + h8.copy((this || _global$I).opad, (this || _global$I).blocksize); + return this.hash((this || _global$I).opad); + }; + function getDigest(alg) { + function shaFunc(data) { + return sha(alg).update(data).digest(); + } + function rmd160Func(data) { + return new RIPEMD160().update(data).digest(); + } + if (alg === "rmd160" || alg === "ripemd160") + return rmd160Func; + if (alg === "md5") + return md5; + return shaFunc; + } + function pbkdf22(password, salt, iterations, keylen, digest) { + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + digest = digest || "sha1"; + var hmac = new Hmac2(digest, password, salt.length); + var DK = Buffer4.allocUnsafe(keylen); + var block1 = Buffer4.allocUnsafe(salt.length + 4); + salt.copy(block1, 0, 0, salt.length); + var destPos = 0; + var hLen = sizes[digest]; + var l7 = Math.ceil(keylen / hLen); + for (var i7 = 1; i7 <= l7; i7++) { + block1.writeUInt32BE(i7, salt.length); + var T6 = hmac.run(block1, hmac.ipad1); + var U6 = T6; + for (var j6 = 1; j6 < iterations; j6++) { + U6 = hmac.run(U6, hmac.ipad2); + for (var k6 = 0; k6 < hLen; k6++) + T6[k6] ^= U6[k6]; + } + T6.copy(DK, destPos); + destPos += hLen; + } + return DK; + } + exports$2r = pbkdf22; + return exports$2r; +} +function dew$2p() { + if (_dewExec$2p) + return exports$2q; + _dewExec$2p = true; + var Buffer4 = dew$2P().Buffer; + var checkParameters = dew$2t(); + var defaultEncoding = dew$2s(); + var sync = dew$2q(); + var toBuffer = dew$2r(); + var ZERO_BUF; + var subtle = _global$H.crypto && _global$H.crypto.subtle; + var toBrowser = { + sha: "SHA-1", + "sha-1": "SHA-1", + sha1: "SHA-1", + sha256: "SHA-256", + "sha-256": "SHA-256", + sha384: "SHA-384", + "sha-384": "SHA-384", + "sha-512": "SHA-512", + sha512: "SHA-512" + }; + var checks = []; + function checkNative(algo) { + if (_global$H.process && !_global$H.process.browser) { + return Promise.resolve(false); + } + if (!subtle || !subtle.importKey || !subtle.deriveBits) { + return Promise.resolve(false); + } + if (checks[algo] !== void 0) { + return checks[algo]; + } + ZERO_BUF = ZERO_BUF || Buffer4.alloc(8); + var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() { + return true; + }).catch(function() { + return false; + }); + checks[algo] = prom; + return prom; + } + var nextTick3; + function getNextTick() { + if (nextTick3) { + return nextTick3; + } + if (_global$H.process && _global$H.process.nextTick) { + nextTick3 = _global$H.process.nextTick; + } else if (_global$H.queueMicrotask) { + nextTick3 = _global$H.queueMicrotask; + } else if (_global$H.setImmediate) { + nextTick3 = _global$H.setImmediate; + } else { + nextTick3 = _global$H.setTimeout; + } + return nextTick3; + } + function browserPbkdf2(password, salt, iterations, length, algo) { + return subtle.importKey("raw", password, { + name: "PBKDF2" + }, false, ["deriveBits"]).then(function(key) { + return subtle.deriveBits({ + name: "PBKDF2", + salt, + iterations, + hash: { + name: algo + } + }, key, length << 3); + }).then(function(res) { + return Buffer4.from(res); + }); + } + function resolvePromise(promise, callback) { + promise.then(function(out) { + getNextTick()(function() { + callback(null, out); + }); + }, function(e10) { + getNextTick()(function() { + callback(e10); + }); + }); + } + exports$2q = function(password, salt, iterations, keylen, digest, callback) { + if (typeof digest === "function") { + callback = digest; + digest = void 0; + } + digest = digest || "sha1"; + var algo = toBrowser[digest.toLowerCase()]; + if (!algo || typeof _global$H.Promise !== "function") { + getNextTick()(function() { + var out; + try { + out = sync(password, salt, iterations, keylen, digest); + } catch (e10) { + return callback(e10); + } + callback(null, out); + }); + return; + } + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + if (typeof callback !== "function") + throw new Error("No callback provided to pbkdf2"); + resolvePromise(checkNative(algo).then(function(resp) { + if (resp) + return browserPbkdf2(password, salt, iterations, keylen, algo); + return sync(password, salt, iterations, keylen, digest); + }), callback); + }; + return exports$2q; +} +function dew$2o() { + if (_dewExec$2o) + return exports$2p; + _dewExec$2o = true; + exports$2p.pbkdf2 = dew$2p(); + exports$2p.pbkdf2Sync = dew$2q(); + return exports$2p; +} +function dew$2n() { + if (_dewExec$2n) + return exports$2o; + _dewExec$2n = true; + exports$2o.readUInt32BE = function readUInt32BE(bytes, off3) { + var res = bytes[0 + off3] << 24 | bytes[1 + off3] << 16 | bytes[2 + off3] << 8 | bytes[3 + off3]; + return res >>> 0; + }; + exports$2o.writeUInt32BE = function writeUInt32BE(bytes, value2, off3) { + bytes[0 + off3] = value2 >>> 24; + bytes[1 + off3] = value2 >>> 16 & 255; + bytes[2 + off3] = value2 >>> 8 & 255; + bytes[3 + off3] = value2 & 255; + }; + exports$2o.ip = function ip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + } + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$2o.rip = function rip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 0; i7 < 4; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 4; i7 < 8; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$2o.pc1 = function pc1(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 7; i7 >= 5; i7--) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var i7 = 1; i7 <= 3; i7++) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$2o.r28shl = function r28shl(num, shift) { + return num << shift & 268435455 | num >>> 28 - shift; + }; + var pc2table = [ + // inL => outL + 14, + 11, + 17, + 4, + 27, + 23, + 25, + 0, + 13, + 22, + 7, + 18, + 5, + 9, + 16, + 24, + 2, + 20, + 12, + 21, + 1, + 8, + 15, + 26, + // inR => outR + 15, + 4, + 25, + 19, + 9, + 1, + 26, + 16, + 5, + 11, + 23, + 8, + 12, + 7, + 17, + 0, + 22, + 3, + 10, + 14, + 6, + 20, + 27, + 24 + ]; + exports$2o.pc2 = function pc22(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + var len = pc2table.length >>> 1; + for (var i7 = 0; i7 < len; i7++) { + outL <<= 1; + outL |= inL >>> pc2table[i7] & 1; + } + for (var i7 = len; i7 < pc2table.length; i7++) { + outR <<= 1; + outR |= inR >>> pc2table[i7] & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$2o.expand = function expand(r8, out, off3) { + var outL = 0; + var outR = 0; + outL = (r8 & 1) << 5 | r8 >>> 27; + for (var i7 = 23; i7 >= 15; i7 -= 4) { + outL <<= 6; + outL |= r8 >>> i7 & 63; + } + for (var i7 = 11; i7 >= 3; i7 -= 4) { + outR |= r8 >>> i7 & 63; + outR <<= 6; + } + outR |= (r8 & 31) << 1 | r8 >>> 31; + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + var sTable = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; + exports$2o.substitute = function substitute(inL, inR) { + var out = 0; + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inL >>> 18 - i7 * 6 & 63; + var sb = sTable[i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inR >>> 18 - i7 * 6 & 63; + var sb = sTable[4 * 64 + i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + return out >>> 0; + }; + var permuteTable = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; + exports$2o.permute = function permute(num) { + var out = 0; + for (var i7 = 0; i7 < permuteTable.length; i7++) { + out <<= 1; + out |= num >>> permuteTable[i7] & 1; + } + return out >>> 0; + }; + exports$2o.padSplit = function padSplit(num, size2, group2) { + var str2 = num.toString(2); + while (str2.length < size2) + str2 = "0" + str2; + var out = []; + for (var i7 = 0; i7 < size2; i7 += group2) + out.push(str2.slice(i7, i7 + group2)); + return out.join(" "); + }; + return exports$2o; +} +function dew$2m() { + if (_dewExec$2m) + return exports$2n; + _dewExec$2m = true; + exports$2n = assert4; + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + assert4.equal = function assertEqual(l7, r8, msg) { + if (l7 != r8) + throw new Error(msg || "Assertion failed: " + l7 + " != " + r8); + }; + return exports$2n; +} +function dew$2l() { + if (_dewExec$2l) + return exports$2m; + _dewExec$2l = true; + var assert4 = dew$2m(); + function Cipher2(options) { + this.options = options; + this.type = this.options.type; + this.blockSize = 8; + this._init(); + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; + } + exports$2m = Cipher2; + Cipher2.prototype._init = function _init() { + }; + Cipher2.prototype.update = function update2(data) { + if (data.length === 0) + return []; + if (this.type === "decrypt") + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); + }; + Cipher2.prototype._buffer = function _buffer(data, off3) { + var min2 = Math.min(this.buffer.length - this.bufferOff, data.length - off3); + for (var i7 = 0; i7 < min2; i7++) + this.buffer[this.bufferOff + i7] = data[off3 + i7]; + this.bufferOff += min2; + return min2; + }; + Cipher2.prototype._flushBuffer = function _flushBuffer(out, off3) { + this._update(this.buffer, 0, out, off3); + this.bufferOff = 0; + return this.blockSize; + }; + Cipher2.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = (this.bufferOff + data.length) / this.blockSize | 0; + var out = new Array(count2 * this.blockSize); + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + var max2 = data.length - (data.length - inputOff) % this.blockSize; + for (; inputOff < max2; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + return out; + }; + Cipher2.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count2 * this.blockSize); + for (; count2 > 0; count2--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + inputOff += this._buffer(data, inputOff); + return out; + }; + Cipher2.prototype.final = function final(buffer2) { + var first; + if (buffer2) + first = this.update(buffer2); + var last2; + if (this.type === "encrypt") + last2 = this._finalEncrypt(); + else + last2 = this._finalDecrypt(); + if (first) + return first.concat(last2); + else + return last2; + }; + Cipher2.prototype._pad = function _pad(buffer2, off3) { + if (off3 === 0) + return false; + while (off3 < buffer2.length) + buffer2[off3++] = 0; + return true; + }; + Cipher2.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; + }; + Cipher2.prototype._unpad = function _unpad(buffer2) { + return buffer2; + }; + Cipher2.prototype._finalDecrypt = function _finalDecrypt() { + assert4.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + return this._unpad(out); + }; + return exports$2m; +} +function dew$2k() { + if (_dewExec$2k) + return exports$2l; + _dewExec$2k = true; + var assert4 = dew$2m(); + var inherits2 = dew$f2(); + var utils = dew$2n(); + var Cipher2 = dew$2l(); + function DESState() { + this.tmp = new Array(2); + this.keys = null; + } + function DES(options) { + Cipher2.call(this, options); + var state = new DESState(); + this._desState = state; + this.deriveKeys(state, options.key); + } + inherits2(DES, Cipher2); + exports$2l = DES; + DES.create = function create2(options) { + return new DES(options); + }; + var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; + DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + assert4.equal(key.length, this.blockSize, "Invalid key length"); + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var shift = shiftTable[i7 >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i7); + } + }; + DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + var l7 = utils.readUInt32BE(inp, inOff); + var r8 = utils.readUInt32BE(inp, inOff + 4); + utils.ip(l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + if (this.type === "encrypt") + this._encrypt(state, l7, r8, state.tmp, 0); + else + this._decrypt(state, l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + utils.writeUInt32BE(out, l7, outOff); + utils.writeUInt32BE(out, r8, outOff + 4); + }; + DES.prototype._pad = function _pad(buffer2, off3) { + var value2 = buffer2.length - off3; + for (var i7 = off3; i7 < buffer2.length; i7++) + buffer2[i7] = value2; + return true; + }; + DES.prototype._unpad = function _unpad(buffer2) { + var pad2 = buffer2[buffer2.length - 1]; + for (var i7 = buffer2.length - pad2; i7 < buffer2.length; i7++) + assert4.equal(buffer2[i7], pad2); + return buffer2.slice(0, buffer2.length - pad2); + }; + DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off3) { + var l7 = lStart; + var r8 = rStart; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(r8, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = r8; + r8 = (l7 ^ f8) >>> 0; + l7 = t8; + } + utils.rip(r8, l7, out, off3); + }; + DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off3) { + var l7 = rStart; + var r8 = lStart; + for (var i7 = state.keys.length - 2; i7 >= 0; i7 -= 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(l7, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = l7; + l7 = (r8 ^ f8) >>> 0; + r8 = t8; + } + utils.rip(l7, r8, out, off3); + }; + return exports$2l; +} +function dew$2j() { + if (_dewExec$2j) + return exports$2k; + _dewExec$2j = true; + var assert4 = dew$2m(); + var inherits2 = dew$f2(); + var proto = {}; + function CBCState(iv) { + assert4.equal(iv.length, 8, "Invalid IV length"); + this.iv = new Array(8); + for (var i7 = 0; i7 < this.iv.length; i7++) + this.iv[i7] = iv[i7]; + } + function instantiate(Base2) { + function CBC(options) { + Base2.call(this, options); + this._cbcInit(); + } + inherits2(CBC, Base2); + var keys2 = Object.keys(proto); + for (var i7 = 0; i7 < keys2.length; i7++) { + var key = keys2[i7]; + CBC.prototype[key] = proto[key]; + } + CBC.create = function create2(options) { + return new CBC(options); + }; + return CBC; + } + exports$2k.instantiate = instantiate; + proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; + }; + proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + var iv = state.iv; + if (this.type === "encrypt") { + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] ^= inp[inOff + i7]; + superProto._update.call(this, iv, 0, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = out[outOff + i7]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + out[outOff + i7] ^= iv[i7]; + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = inp[inOff + i7]; + } + }; + return exports$2k; +} +function dew$2i() { + if (_dewExec$2i) + return exports$2j; + _dewExec$2i = true; + var assert4 = dew$2m(); + var inherits2 = dew$f2(); + var Cipher2 = dew$2l(); + var DES = dew$2k(); + function EDEState(type3, key) { + assert4.equal(key.length, 24, "Invalid key length"); + var k1 = key.slice(0, 8); + var k22 = key.slice(8, 16); + var k32 = key.slice(16, 24); + if (type3 === "encrypt") { + this.ciphers = [DES.create({ + type: "encrypt", + key: k1 + }), DES.create({ + type: "decrypt", + key: k22 + }), DES.create({ + type: "encrypt", + key: k32 + })]; + } else { + this.ciphers = [DES.create({ + type: "decrypt", + key: k32 + }), DES.create({ + type: "encrypt", + key: k22 + }), DES.create({ + type: "decrypt", + key: k1 + })]; + } + } + function EDE(options) { + Cipher2.call(this, options); + var state = new EDEState(this.type, this.options.key); + this._edeState = state; + } + inherits2(EDE, Cipher2); + exports$2j = EDE; + EDE.create = function create2(options) { + return new EDE(options); + }; + EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); + }; + EDE.prototype._pad = DES.prototype._pad; + EDE.prototype._unpad = DES.prototype._unpad; + return exports$2j; +} +function dew$2h() { + if (_dewExec$2h) + return exports$2i; + _dewExec$2h = true; + exports$2i.utils = dew$2n(); + exports$2i.Cipher = dew$2l(); + exports$2i.DES = dew$2k(); + exports$2i.CBC = dew$2j(); + exports$2i.EDE = dew$2i(); + return exports$2i; +} +function dew$2g() { + if (_dewExec$2g) + return exports$2h; + _dewExec$2g = true; + var CipherBase = dew$2z(); + var des = dew$2h(); + var inherits2 = dew$f2(); + var Buffer4 = dew$2P().Buffer; + var modes = { + "des-ede3-cbc": des.CBC.instantiate(des.EDE), + "des-ede3": des.EDE, + "des-ede-cbc": des.CBC.instantiate(des.EDE), + "des-ede": des.EDE, + "des-cbc": des.CBC.instantiate(des.DES), + "des-ecb": des.DES + }; + modes.des = modes["des-cbc"]; + modes.des3 = modes["des-ede3-cbc"]; + exports$2h = DES; + inherits2(DES, CipherBase); + function DES(opts) { + CipherBase.call(this || _global$G); + var modeName = opts.mode.toLowerCase(); + var mode = modes[modeName]; + var type3; + if (opts.decrypt) { + type3 = "decrypt"; + } else { + type3 = "encrypt"; + } + var key = opts.key; + if (!Buffer4.isBuffer(key)) { + key = Buffer4.from(key); + } + if (modeName === "des-ede" || modeName === "des-ede-cbc") { + key = Buffer4.concat([key, key.slice(0, 8)]); + } + var iv = opts.iv; + if (!Buffer4.isBuffer(iv)) { + iv = Buffer4.from(iv); + } + (this || _global$G)._des = mode.create({ + key, + iv, + type: type3 + }); + } + DES.prototype._update = function(data) { + return Buffer4.from((this || _global$G)._des.update(data)); + }; + DES.prototype._final = function() { + return Buffer4.from((this || _global$G)._des.final()); + }; + return exports$2h; +} +function dew$2f() { + if (_dewExec$2f) + return exports$2g; + _dewExec$2f = true; + exports$2g.encrypt = function(self2, block) { + return self2._cipher.encryptBlock(block); + }; + exports$2g.decrypt = function(self2, block) { + return self2._cipher.decryptBlock(block); + }; + return exports$2g; +} +function dew$2e() { + if (_dewExec$2e) + return exports$2f; + _dewExec$2e = true; + var Buffer4 = buffer.Buffer; + exports$2f = function xor2(a7, b8) { + var length = Math.min(a7.length, b8.length); + var buffer2 = new Buffer4(length); + for (var i7 = 0; i7 < length; ++i7) { + buffer2[i7] = a7[i7] ^ b8[i7]; + } + return buffer2; + }; + return exports$2f; +} +function dew$2d() { + if (_dewExec$2d) + return exports$2e; + _dewExec$2d = true; + var xor2 = dew$2e(); + exports$2e.encrypt = function(self2, block) { + var data = xor2(block, self2._prev); + self2._prev = self2._cipher.encryptBlock(data); + return self2._prev; + }; + exports$2e.decrypt = function(self2, block) { + var pad2 = self2._prev; + self2._prev = block; + var out = self2._cipher.decryptBlock(block); + return xor2(out, pad2); + }; + return exports$2e; +} +function dew$2c() { + if (_dewExec$2c) + return exports$2d; + _dewExec$2c = true; + var Buffer4 = dew$2P().Buffer; + var xor2 = dew$2e(); + function encryptStart(self2, data, decrypt) { + var len = data.length; + var out = xor2(data, self2._cache); + self2._cache = self2._cache.slice(len); + self2._prev = Buffer4.concat([self2._prev, decrypt ? data : out]); + return out; + } + exports$2d.encrypt = function(self2, data, decrypt) { + var out = Buffer4.allocUnsafe(0); + var len; + while (data.length) { + if (self2._cache.length === 0) { + self2._cache = self2._cipher.encryptBlock(self2._prev); + self2._prev = Buffer4.allocUnsafe(0); + } + if (self2._cache.length <= data.length) { + len = self2._cache.length; + out = Buffer4.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]); + data = data.slice(len); + } else { + out = Buffer4.concat([out, encryptStart(self2, data, decrypt)]); + break; + } + } + return out; + }; + return exports$2d; +} +function dew$2b() { + if (_dewExec$2b) + return exports$2c; + _dewExec$2b = true; + var Buffer4 = dew$2P().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2 = self2._cipher.encryptBlock(self2._prev); + var out = pad2[0] ^ byteParam; + self2._prev = Buffer4.concat([self2._prev.slice(1), Buffer4.from([decrypt ? byteParam : out])]); + return out; + } + exports$2c.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$2c; +} +function dew$2a() { + if (_dewExec$2a) + return exports$2b; + _dewExec$2a = true; + var Buffer4 = dew$2P().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2; + var i7 = -1; + var len = 8; + var out = 0; + var bit, value2; + while (++i7 < len) { + pad2 = self2._cipher.encryptBlock(self2._prev); + bit = byteParam & 1 << 7 - i7 ? 128 : 0; + value2 = pad2[0] ^ bit; + out += (value2 & 128) >> i7 % 8; + self2._prev = shiftIn(self2._prev, decrypt ? bit : value2); + } + return out; + } + function shiftIn(buffer2, value2) { + var len = buffer2.length; + var i7 = -1; + var out = Buffer4.allocUnsafe(buffer2.length); + buffer2 = Buffer4.concat([buffer2, Buffer4.from([value2])]); + while (++i7 < len) { + out[i7] = buffer2[i7] << 1 | buffer2[i7 + 1] >> 7; + } + return out; + } + exports$2b.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$2b; +} +function dew$29() { + if (_dewExec$29) + return exports$2a; + _dewExec$29 = true; + var Buffer4 = buffer.Buffer; + var xor2 = dew$2e(); + function getBlock(self2) { + self2._prev = self2._cipher.encryptBlock(self2._prev); + return self2._prev; + } + exports$2a.encrypt = function(self2, chunk2) { + while (self2._cache.length < chunk2.length) { + self2._cache = Buffer4.concat([self2._cache, getBlock(self2)]); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$2a; +} +function dew$28() { + if (_dewExec$28) + return exports$29; + _dewExec$28 = true; + function incr32(iv) { + var len = iv.length; + var item; + while (len--) { + item = iv.readUInt8(len); + if (item === 255) { + iv.writeUInt8(0, len); + } else { + item++; + iv.writeUInt8(item, len); + break; + } + } + } + exports$29 = incr32; + return exports$29; +} +function dew$27() { + if (_dewExec$27) + return exports$28; + _dewExec$27 = true; + var xor2 = dew$2e(); + var Buffer4 = dew$2P().Buffer; + var incr32 = dew$28(); + function getBlock(self2) { + var out = self2._cipher.encryptBlockRaw(self2._prev); + incr32(self2._prev); + return out; + } + var blockSize = 16; + exports$28.encrypt = function(self2, chunk2) { + var chunkNum = Math.ceil(chunk2.length / blockSize); + var start = self2._cache.length; + self2._cache = Buffer4.concat([self2._cache, Buffer4.allocUnsafe(chunkNum * blockSize)]); + for (var i7 = 0; i7 < chunkNum; i7++) { + var out = getBlock(self2); + var offset = start + i7 * blockSize; + self2._cache.writeUInt32BE(out[0], offset + 0); + self2._cache.writeUInt32BE(out[1], offset + 4); + self2._cache.writeUInt32BE(out[2], offset + 8); + self2._cache.writeUInt32BE(out[3], offset + 12); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$28; +} +function dew$26() { + if (_dewExec$26) + return exports$27; + _dewExec$26 = true; + var modeModules = { + ECB: dew$2f(), + CBC: dew$2d(), + CFB: dew$2c(), + CFB8: dew$2b(), + CFB1: dew$2a(), + OFB: dew$29(), + CTR: dew$27(), + GCM: dew$27() + }; + var modes = _list$1; + for (var key in modes) { + modes[key].module = modeModules[modes[key].mode]; + } + exports$27 = modes; + return exports$27; +} +function dew$252() { + if (_dewExec$252) + return exports$262; + _dewExec$252 = true; + var Buffer4 = dew$2P().Buffer; + function asUInt32Array(buf) { + if (!Buffer4.isBuffer(buf)) + buf = Buffer4.from(buf); + var len = buf.length / 4 | 0; + var out = new Array(len); + for (var i7 = 0; i7 < len; i7++) { + out[i7] = buf.readUInt32BE(i7 * 4); + } + return out; + } + function scrubVec(v8) { + for (var i7 = 0; i7 < v8.length; v8++) { + v8[i7] = 0; + } + } + function cryptBlock(M6, keySchedule, SUB_MIX, SBOX, nRounds) { + var SUB_MIX0 = SUB_MIX[0]; + var SUB_MIX1 = SUB_MIX[1]; + var SUB_MIX2 = SUB_MIX[2]; + var SUB_MIX3 = SUB_MIX[3]; + var s0 = M6[0] ^ keySchedule[0]; + var s1 = M6[1] ^ keySchedule[1]; + var s22 = M6[2] ^ keySchedule[2]; + var s32 = M6[3] ^ keySchedule[3]; + var t0, t1, t22, t32; + var ksRow = 4; + for (var round2 = 1; round2 < nRounds; round2++) { + t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s22 >>> 8 & 255] ^ SUB_MIX3[s32 & 255] ^ keySchedule[ksRow++]; + t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s22 >>> 16 & 255] ^ SUB_MIX2[s32 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++]; + t22 = SUB_MIX0[s22 >>> 24] ^ SUB_MIX1[s32 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++]; + t32 = SUB_MIX0[s32 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s22 & 255] ^ keySchedule[ksRow++]; + s0 = t0; + s1 = t1; + s22 = t22; + s32 = t32; + } + t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s22 >>> 8 & 255] << 8 | SBOX[s32 & 255]) ^ keySchedule[ksRow++]; + t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s22 >>> 16 & 255] << 16 | SBOX[s32 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++]; + t22 = (SBOX[s22 >>> 24] << 24 | SBOX[s32 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++]; + t32 = (SBOX[s32 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s22 & 255]) ^ keySchedule[ksRow++]; + t0 = t0 >>> 0; + t1 = t1 >>> 0; + t22 = t22 >>> 0; + t32 = t32 >>> 0; + return [t0, t1, t22, t32]; + } + var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; + var G5 = function() { + var d7 = new Array(256); + for (var j6 = 0; j6 < 256; j6++) { + if (j6 < 128) { + d7[j6] = j6 << 1; + } else { + d7[j6] = j6 << 1 ^ 283; + } + } + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX = [[], [], [], []]; + var INV_SUB_MIX = [[], [], [], []]; + var x7 = 0; + var xi = 0; + for (var i7 = 0; i7 < 256; ++i7) { + var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; + sx = sx >>> 8 ^ sx & 255 ^ 99; + SBOX[x7] = sx; + INV_SBOX[sx] = x7; + var x22 = d7[x7]; + var x42 = d7[x22]; + var x8 = d7[x42]; + var t8 = d7[sx] * 257 ^ sx * 16843008; + SUB_MIX[0][x7] = t8 << 24 | t8 >>> 8; + SUB_MIX[1][x7] = t8 << 16 | t8 >>> 16; + SUB_MIX[2][x7] = t8 << 8 | t8 >>> 24; + SUB_MIX[3][x7] = t8; + t8 = x8 * 16843009 ^ x42 * 65537 ^ x22 * 257 ^ x7 * 16843008; + INV_SUB_MIX[0][sx] = t8 << 24 | t8 >>> 8; + INV_SUB_MIX[1][sx] = t8 << 16 | t8 >>> 16; + INV_SUB_MIX[2][sx] = t8 << 8 | t8 >>> 24; + INV_SUB_MIX[3][sx] = t8; + if (x7 === 0) { + x7 = xi = 1; + } else { + x7 = x22 ^ d7[d7[d7[x8 ^ x22]]]; + xi ^= d7[d7[xi]]; + } + } + return { + SBOX, + INV_SBOX, + SUB_MIX, + INV_SUB_MIX + }; + }(); + function AES(key) { + (this || _global$F)._key = asUInt32Array(key); + this._reset(); + } + AES.blockSize = 4 * 4; + AES.keySize = 256 / 8; + AES.prototype.blockSize = AES.blockSize; + AES.prototype.keySize = AES.keySize; + AES.prototype._reset = function() { + var keyWords = (this || _global$F)._key; + var keySize = keyWords.length; + var nRounds = keySize + 6; + var ksRows = (nRounds + 1) * 4; + var keySchedule = []; + for (var k6 = 0; k6 < keySize; k6++) { + keySchedule[k6] = keyWords[k6]; + } + for (k6 = keySize; k6 < ksRows; k6++) { + var t8 = keySchedule[k6 - 1]; + if (k6 % keySize === 0) { + t8 = t8 << 8 | t8 >>> 24; + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + t8 ^= RCON[k6 / keySize | 0] << 24; + } else if (keySize > 6 && k6 % keySize === 4) { + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + } + keySchedule[k6] = keySchedule[k6 - keySize] ^ t8; + } + var invKeySchedule = []; + for (var ik = 0; ik < ksRows; ik++) { + var ksR = ksRows - ik; + var tt3 = keySchedule[ksR - (ik % 4 ? 0 : 4)]; + if (ik < 4 || ksR <= 4) { + invKeySchedule[ik] = tt3; + } else { + invKeySchedule[ik] = G5.INV_SUB_MIX[0][G5.SBOX[tt3 >>> 24]] ^ G5.INV_SUB_MIX[1][G5.SBOX[tt3 >>> 16 & 255]] ^ G5.INV_SUB_MIX[2][G5.SBOX[tt3 >>> 8 & 255]] ^ G5.INV_SUB_MIX[3][G5.SBOX[tt3 & 255]]; + } + } + (this || _global$F)._nRounds = nRounds; + (this || _global$F)._keySchedule = keySchedule; + (this || _global$F)._invKeySchedule = invKeySchedule; + }; + AES.prototype.encryptBlockRaw = function(M6) { + M6 = asUInt32Array(M6); + return cryptBlock(M6, (this || _global$F)._keySchedule, G5.SUB_MIX, G5.SBOX, (this || _global$F)._nRounds); + }; + AES.prototype.encryptBlock = function(M6) { + var out = this.encryptBlockRaw(M6); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[1], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[3], 12); + return buf; + }; + AES.prototype.decryptBlock = function(M6) { + M6 = asUInt32Array(M6); + var m1 = M6[1]; + M6[1] = M6[3]; + M6[3] = m1; + var out = cryptBlock(M6, (this || _global$F)._invKeySchedule, G5.INV_SUB_MIX, G5.INV_SBOX, (this || _global$F)._nRounds); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[3], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[1], 12); + return buf; + }; + AES.prototype.scrub = function() { + scrubVec((this || _global$F)._keySchedule); + scrubVec((this || _global$F)._invKeySchedule); + scrubVec((this || _global$F)._key); + }; + exports$262.AES = AES; + return exports$262; +} +function dew$242() { + if (_dewExec$242) + return exports$252; + _dewExec$242 = true; + var Buffer4 = dew$2P().Buffer; + var ZEROES = Buffer4.alloc(16, 0); + function toArray3(buf) { + return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)]; + } + function fromArray(out) { + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0] >>> 0, 0); + buf.writeUInt32BE(out[1] >>> 0, 4); + buf.writeUInt32BE(out[2] >>> 0, 8); + buf.writeUInt32BE(out[3] >>> 0, 12); + return buf; + } + function GHASH(key) { + (this || _global$E).h = key; + (this || _global$E).state = Buffer4.alloc(16, 0); + (this || _global$E).cache = Buffer4.allocUnsafe(0); + } + GHASH.prototype.ghash = function(block) { + var i7 = -1; + while (++i7 < block.length) { + (this || _global$E).state[i7] ^= block[i7]; + } + this._multiply(); + }; + GHASH.prototype._multiply = function() { + var Vi = toArray3((this || _global$E).h); + var Zi = [0, 0, 0, 0]; + var j6, xi, lsbVi; + var i7 = -1; + while (++i7 < 128) { + xi = ((this || _global$E).state[~~(i7 / 8)] & 1 << 7 - i7 % 8) !== 0; + if (xi) { + Zi[0] ^= Vi[0]; + Zi[1] ^= Vi[1]; + Zi[2] ^= Vi[2]; + Zi[3] ^= Vi[3]; + } + lsbVi = (Vi[3] & 1) !== 0; + for (j6 = 3; j6 > 0; j6--) { + Vi[j6] = Vi[j6] >>> 1 | (Vi[j6 - 1] & 1) << 31; + } + Vi[0] = Vi[0] >>> 1; + if (lsbVi) { + Vi[0] = Vi[0] ^ 225 << 24; + } + } + (this || _global$E).state = fromArray(Zi); + }; + GHASH.prototype.update = function(buf) { + (this || _global$E).cache = Buffer4.concat([(this || _global$E).cache, buf]); + var chunk2; + while ((this || _global$E).cache.length >= 16) { + chunk2 = (this || _global$E).cache.slice(0, 16); + (this || _global$E).cache = (this || _global$E).cache.slice(16); + this.ghash(chunk2); + } + }; + GHASH.prototype.final = function(abl, bl) { + if ((this || _global$E).cache.length) { + this.ghash(Buffer4.concat([(this || _global$E).cache, ZEROES], 16)); + } + this.ghash(fromArray([0, abl, 0, bl])); + return (this || _global$E).state; + }; + exports$252 = GHASH; + return exports$252; +} +function dew$232() { + if (_dewExec$232) + return exports$242; + _dewExec$232 = true; + var aes = dew$252(); + var Buffer4 = dew$2P().Buffer; + var Transform2 = dew$2z(); + var inherits2 = dew$f2(); + var GHASH = dew$242(); + var xor2 = dew$2e(); + var incr32 = dew$28(); + function xorTest(a7, b8) { + var out = 0; + if (a7.length !== b8.length) + out++; + var len = Math.min(a7.length, b8.length); + for (var i7 = 0; i7 < len; ++i7) { + out += a7[i7] ^ b8[i7]; + } + return out; + } + function calcIv(self2, iv, ck) { + if (iv.length === 12) { + self2._finID = Buffer4.concat([iv, Buffer4.from([0, 0, 0, 1])]); + return Buffer4.concat([iv, Buffer4.from([0, 0, 0, 2])]); + } + var ghash = new GHASH(ck); + var len = iv.length; + var toPad = len % 16; + ghash.update(iv); + if (toPad) { + toPad = 16 - toPad; + ghash.update(Buffer4.alloc(toPad, 0)); + } + ghash.update(Buffer4.alloc(8, 0)); + var ivBits = len * 8; + var tail2 = Buffer4.alloc(8); + tail2.writeUIntBE(ivBits, 0, 8); + ghash.update(tail2); + self2._finID = ghash.state; + var out = Buffer4.from(self2._finID); + incr32(out); + return out; + } + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$D); + var h8 = Buffer4.alloc(4, 0); + (this || _global$D)._cipher = new aes.AES(key); + var ck = (this || _global$D)._cipher.encryptBlock(h8); + (this || _global$D)._ghash = new GHASH(ck); + iv = calcIv(this || _global$D, iv, ck); + (this || _global$D)._prev = Buffer4.from(iv); + (this || _global$D)._cache = Buffer4.allocUnsafe(0); + (this || _global$D)._secCache = Buffer4.allocUnsafe(0); + (this || _global$D)._decrypt = decrypt; + (this || _global$D)._alen = 0; + (this || _global$D)._len = 0; + (this || _global$D)._mode = mode; + (this || _global$D)._authTag = null; + (this || _global$D)._called = false; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + if (!(this || _global$D)._called && (this || _global$D)._alen) { + var rump = 16 - (this || _global$D)._alen % 16; + if (rump < 16) { + rump = Buffer4.alloc(rump, 0); + (this || _global$D)._ghash.update(rump); + } + } + (this || _global$D)._called = true; + var out = (this || _global$D)._mode.encrypt(this || _global$D, chunk2); + if ((this || _global$D)._decrypt) { + (this || _global$D)._ghash.update(chunk2); + } else { + (this || _global$D)._ghash.update(out); + } + (this || _global$D)._len += chunk2.length; + return out; + }; + StreamCipher.prototype._final = function() { + if ((this || _global$D)._decrypt && !(this || _global$D)._authTag) + throw new Error("Unsupported state or unable to authenticate data"); + var tag = xor2((this || _global$D)._ghash.final((this || _global$D)._alen * 8, (this || _global$D)._len * 8), (this || _global$D)._cipher.encryptBlock((this || _global$D)._finID)); + if ((this || _global$D)._decrypt && xorTest(tag, (this || _global$D)._authTag)) + throw new Error("Unsupported state or unable to authenticate data"); + (this || _global$D)._authTag = tag; + (this || _global$D)._cipher.scrub(); + }; + StreamCipher.prototype.getAuthTag = function getAuthTag() { + if ((this || _global$D)._decrypt || !Buffer4.isBuffer((this || _global$D)._authTag)) + throw new Error("Attempting to get auth tag in unsupported state"); + return (this || _global$D)._authTag; + }; + StreamCipher.prototype.setAuthTag = function setAuthTag(tag) { + if (!(this || _global$D)._decrypt) + throw new Error("Attempting to set auth tag in unsupported state"); + (this || _global$D)._authTag = tag; + }; + StreamCipher.prototype.setAAD = function setAAD(buf) { + if ((this || _global$D)._called) + throw new Error("Attempting to set AAD in unsupported state"); + (this || _global$D)._ghash.update(buf); + (this || _global$D)._alen += buf.length; + }; + exports$242 = StreamCipher; + return exports$242; +} +function dew$222() { + if (_dewExec$222) + return exports$232; + _dewExec$222 = true; + var aes = dew$252(); + var Buffer4 = dew$2P().Buffer; + var Transform2 = dew$2z(); + var inherits2 = dew$f2(); + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$C); + (this || _global$C)._cipher = new aes.AES(key); + (this || _global$C)._prev = Buffer4.from(iv); + (this || _global$C)._cache = Buffer4.allocUnsafe(0); + (this || _global$C)._secCache = Buffer4.allocUnsafe(0); + (this || _global$C)._decrypt = decrypt; + (this || _global$C)._mode = mode; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + return (this || _global$C)._mode.encrypt(this || _global$C, chunk2, (this || _global$C)._decrypt); + }; + StreamCipher.prototype._final = function() { + (this || _global$C)._cipher.scrub(); + }; + exports$232 = StreamCipher; + return exports$232; +} +function dew$21() { + if (_dewExec$21) + return exports$222; + _dewExec$21 = true; + var Buffer4 = dew$2P().Buffer; + var MD5 = dew$2L(); + function EVP_BytesToKey(password, salt, keyBits, ivLen) { + if (!Buffer4.isBuffer(password)) + password = Buffer4.from(password, "binary"); + if (salt) { + if (!Buffer4.isBuffer(salt)) + salt = Buffer4.from(salt, "binary"); + if (salt.length !== 8) + throw new RangeError("salt should be Buffer with 8 byte length"); + } + var keyLen = keyBits / 8; + var key = Buffer4.alloc(keyLen); + var iv = Buffer4.alloc(ivLen || 0); + var tmp = Buffer4.alloc(0); + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5(); + hash.update(tmp); + hash.update(password); + if (salt) + hash.update(salt); + tmp = hash.digest(); + var used = 0; + if (keyLen > 0) { + var keyStart = key.length - keyLen; + used = Math.min(keyLen, tmp.length); + tmp.copy(key, keyStart, 0, used); + keyLen -= used; + } + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen; + var length = Math.min(ivLen, tmp.length - used); + tmp.copy(iv, ivStart, used, used + length); + ivLen -= length; + } + } + tmp.fill(0); + return { + key, + iv + }; + } + exports$222 = EVP_BytesToKey; + return exports$222; +} +function dew$20() { + if (_dewExec$20) + return exports$21; + _dewExec$20 = true; + var MODES = dew$26(); + var AuthCipher = dew$232(); + var Buffer4 = dew$2P().Buffer; + var StreamCipher = dew$222(); + var Transform2 = dew$2z(); + var aes = dew$252(); + var ebtk = dew$21(); + var inherits2 = dew$f2(); + function Cipher2(mode, key, iv) { + Transform2.call(this || _global$B); + (this || _global$B)._cache = new Splitter(); + (this || _global$B)._cipher = new aes.AES(key); + (this || _global$B)._prev = Buffer4.from(iv); + (this || _global$B)._mode = mode; + (this || _global$B)._autopadding = true; + } + inherits2(Cipher2, Transform2); + Cipher2.prototype._update = function(data) { + (this || _global$B)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$B)._cache.get()) { + thing = (this || _global$B)._mode.encrypt(this || _global$B, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + var PADDING = Buffer4.alloc(16, 16); + Cipher2.prototype._final = function() { + var chunk2 = (this || _global$B)._cache.flush(); + if ((this || _global$B)._autopadding) { + chunk2 = (this || _global$B)._mode.encrypt(this || _global$B, chunk2); + (this || _global$B)._cipher.scrub(); + return chunk2; + } + if (!chunk2.equals(PADDING)) { + (this || _global$B)._cipher.scrub(); + throw new Error("data not multiple of block length"); + } + }; + Cipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$B)._autopadding = !!setTo; + return this || _global$B; + }; + function Splitter() { + (this || _global$B).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$B).cache = Buffer4.concat([(this || _global$B).cache, data]); + }; + Splitter.prototype.get = function() { + if ((this || _global$B).cache.length > 15) { + var out = (this || _global$B).cache.slice(0, 16); + (this || _global$B).cache = (this || _global$B).cache.slice(16); + return out; + } + return null; + }; + Splitter.prototype.flush = function() { + var len = 16 - (this || _global$B).cache.length; + var padBuff = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + padBuff.writeUInt8(len, i7); + } + return Buffer4.concat([(this || _global$B).cache, padBuff]); + }; + function createCipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv); + } + return new Cipher2(config3.module, password, iv); + } + function createCipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + exports$21.createCipheriv = createCipheriv2; + exports$21.createCipher = createCipher2; + return exports$21; +} +function dew$1$() { + if (_dewExec$1$) + return exports$20; + _dewExec$1$ = true; + var AuthCipher = dew$232(); + var Buffer4 = dew$2P().Buffer; + var MODES = dew$26(); + var StreamCipher = dew$222(); + var Transform2 = dew$2z(); + var aes = dew$252(); + var ebtk = dew$21(); + var inherits2 = dew$f2(); + function Decipher2(mode, key, iv) { + Transform2.call(this || _global$A); + (this || _global$A)._cache = new Splitter(); + (this || _global$A)._last = void 0; + (this || _global$A)._cipher = new aes.AES(key); + (this || _global$A)._prev = Buffer4.from(iv); + (this || _global$A)._mode = mode; + (this || _global$A)._autopadding = true; + } + inherits2(Decipher2, Transform2); + Decipher2.prototype._update = function(data) { + (this || _global$A)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$A)._cache.get((this || _global$A)._autopadding)) { + thing = (this || _global$A)._mode.decrypt(this || _global$A, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + Decipher2.prototype._final = function() { + var chunk2 = (this || _global$A)._cache.flush(); + if ((this || _global$A)._autopadding) { + return unpad((this || _global$A)._mode.decrypt(this || _global$A, chunk2)); + } else if (chunk2) { + throw new Error("data not multiple of block length"); + } + }; + Decipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$A)._autopadding = !!setTo; + return this || _global$A; + }; + function Splitter() { + (this || _global$A).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$A).cache = Buffer4.concat([(this || _global$A).cache, data]); + }; + Splitter.prototype.get = function(autoPadding) { + var out; + if (autoPadding) { + if ((this || _global$A).cache.length > 16) { + out = (this || _global$A).cache.slice(0, 16); + (this || _global$A).cache = (this || _global$A).cache.slice(16); + return out; + } + } else { + if ((this || _global$A).cache.length >= 16) { + out = (this || _global$A).cache.slice(0, 16); + (this || _global$A).cache = (this || _global$A).cache.slice(16); + return out; + } + } + return null; + }; + Splitter.prototype.flush = function() { + if ((this || _global$A).cache.length) + return (this || _global$A).cache; + }; + function unpad(last2) { + var padded = last2[15]; + if (padded < 1 || padded > 16) { + throw new Error("unable to decrypt data"); + } + var i7 = -1; + while (++i7 < padded) { + if (last2[i7 + (16 - padded)] !== padded) { + throw new Error("unable to decrypt data"); + } + } + if (padded === 16) + return; + return last2.slice(0, 16 - padded); + } + function createDecipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv, true); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv, true); + } + return new Decipher2(config3.module, password, iv); + } + function createDecipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + exports$20.createDecipher = createDecipher2; + exports$20.createDecipheriv = createDecipheriv2; + return exports$20; +} +function dew$1_() { + if (_dewExec$1_) + return exports$1$; + _dewExec$1_ = true; + var ciphers = dew$20(); + var deciphers = dew$1$(); + var modes = _list$1; + function getCiphers2() { + return Object.keys(modes); + } + exports$1$.createCipher = exports$1$.Cipher = ciphers.createCipher; + exports$1$.createCipheriv = exports$1$.Cipheriv = ciphers.createCipheriv; + exports$1$.createDecipher = exports$1$.Decipher = deciphers.createDecipher; + exports$1$.createDecipheriv = exports$1$.Decipheriv = deciphers.createDecipheriv; + exports$1$.listCiphers = exports$1$.getCiphers = getCiphers2; + return exports$1$; +} +function dew$1Z() { + if (_dewExec$1Z) + return exports$1_; + _dewExec$1Z = true; + exports$1_["des-ecb"] = { + key: 8, + iv: 0 + }; + exports$1_["des-cbc"] = exports$1_.des = { + key: 8, + iv: 8 + }; + exports$1_["des-ede3-cbc"] = exports$1_.des3 = { + key: 24, + iv: 8 + }; + exports$1_["des-ede3"] = { + key: 24, + iv: 0 + }; + exports$1_["des-ede-cbc"] = { + key: 16, + iv: 8 + }; + exports$1_["des-ede"] = { + key: 16, + iv: 0 + }; + return exports$1_; +} +function dew$1Y() { + if (_dewExec$1Y) + return exports$1Z; + _dewExec$1Y = true; + var DES = dew$2g(); + var aes = dew$1_(); + var aesModes = dew$26(); + var desModes = dew$1Z(); + var ebtk = dew$21(); + function createCipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + function createDecipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + function createCipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createCipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite + }); + throw new TypeError("invalid suite type"); + } + function createDecipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createDecipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite, + decrypt: true + }); + throw new TypeError("invalid suite type"); + } + function getCiphers2() { + return Object.keys(desModes).concat(aes.getCiphers()); + } + exports$1Z.createCipher = exports$1Z.Cipher = createCipher2; + exports$1Z.createCipheriv = exports$1Z.Cipheriv = createCipheriv2; + exports$1Z.createDecipher = exports$1Z.Decipher = createDecipher2; + exports$1Z.createDecipheriv = exports$1Z.Decipheriv = createDecipheriv2; + exports$1Z.listCiphers = exports$1Z.getCiphers = getCiphers2; + return exports$1Z; +} +function dew$1X() { + if (_dewExec$1X) + return module$a.exports; + _dewExec$1X = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$z).negative = 0; + (this || _global$z).words = null; + (this || _global$z).length = 0; + (this || _global$z).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$z).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$z).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$z).words = [number & 67108863]; + (this || _global$z).length = 1; + } else if (number < 4503599627370496) { + (this || _global$z).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$z).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$z).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$z).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$z).words = [0]; + (this || _global$z).length = 1; + return this || _global$z; + } + (this || _global$z).length = Math.ceil(number.length / 3); + (this || _global$z).words = new Array((this || _global$z).length); + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + (this || _global$z).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$z).words[j6] |= w6 << off3 & 67108863; + (this || _global$z).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$z).words[j6] |= w6 << off3 & 67108863; + (this || _global$z).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$z).length = Math.ceil((number.length - start) / 6); + (this || _global$z).words = new Array((this || _global$z).length); + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + (this || _global$z).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$z).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$z).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$z).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$z).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$z).words = [0]; + (this || _global$z).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$z).words[0] + word < 67108864) { + (this || _global$z).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$z).words[0] + word < 67108864) { + (this || _global$z).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$z).length); + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + dest.words[i7] = (this || _global$z).words[i7]; + } + dest.length = (this || _global$z).length; + dest.negative = (this || _global$z).negative; + dest.red = (this || _global$z).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$z).length < size2) { + (this || _global$z).words[(this || _global$z).length++] = 0; + } + return this || _global$z; + }; + BN.prototype.strip = function strip() { + while ((this || _global$z).length > 1 && (this || _global$z).words[(this || _global$z).length - 1] === 0) { + (this || _global$z).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$z).length === 1 && (this || _global$z).words[0] === 0) { + (this || _global$z).negative = 0; + } + return this || _global$z; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$z).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + var w6 = (this || _global$z).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$z).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$z).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$z).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$z).words[0]; + if ((this || _global$z).length === 2) { + ret += (this || _global$z).words[1] * 67108864; + } else if ((this || _global$z).length === 3 && (this || _global$z).words[2] === 1) { + ret += 4503599627370496 + (this || _global$z).words[1] * 67108864; + } else if ((this || _global$z).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$z).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$z).words[(this || _global$z).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$z).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + var b8 = this._zeroBits((this || _global$z).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$z).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$z).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$z).negative ^= 1; + } + return this || _global$z; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$z).length < num.length) { + (this || _global$z).words[(this || _global$z).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$z).words[i7] = (this || _global$z).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$z).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$z).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$z); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$z).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$z); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$z).length > num.length) { + b8 = num; + } else { + b8 = this || _global$z; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$z).words[i7] = (this || _global$z).words[i7] & num.words[i7]; + } + (this || _global$z).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$z).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$z).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$z); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$z).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$z); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$z).length > num.length) { + a7 = this || _global$z; + b8 = num; + } else { + a7 = num; + b8 = this || _global$z; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$z).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$z) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$z).words[i7] = a7.words[i7]; + } + } + (this || _global$z).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$z).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$z).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$z); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$z).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$z); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$z).words[i7] = ~(this || _global$z).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$z).words[i7] = ~(this || _global$z).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$z).words[off3] = (this || _global$z).words[off3] | 1 << wbit; + } else { + (this || _global$z).words[off3] = (this || _global$z).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$z).negative !== 0 && num.negative === 0) { + (this || _global$z).negative = 0; + r8 = this.isub(num); + (this || _global$z).negative ^= 1; + return this._normSign(); + } else if ((this || _global$z).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$z).length > num.length) { + a7 = this || _global$z; + b8 = num; + } else { + a7 = num; + b8 = this || _global$z; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$z).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$z).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$z).length = a7.length; + if (carry !== 0) { + (this || _global$z).words[(this || _global$z).length] = carry; + (this || _global$z).length++; + } else if (a7 !== (this || _global$z)) { + for (; i7 < a7.length; i7++) { + (this || _global$z).words[i7] = a7.words[i7]; + } + } + return this || _global$z; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$z).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$z).negative !== 0) { + (this || _global$z).negative = 0; + res = num.sub(this || _global$z); + (this || _global$z).negative = 1; + return res; + } + if ((this || _global$z).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$z); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$z).negative !== 0) { + (this || _global$z).negative = 0; + this.iadd(num); + (this || _global$z).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$z).negative = 0; + (this || _global$z).length = 1; + (this || _global$z).words[0] = 0; + return this || _global$z; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$z; + b8 = num; + } else { + a7 = num; + b8 = this || _global$z; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$z).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$z).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$z)) { + for (; i7 < a7.length; i7++) { + (this || _global$z).words[i7] = a7.words[i7]; + } + } + (this || _global$z).length = Math.max((this || _global$z).length, i7); + if (a7 !== (this || _global$z)) { + (this || _global$z).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$z).length + num.length; + if ((this || _global$z).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$z, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$z, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$z, num, out); + } else { + res = jumboMulTo(this || _global$z, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$z).x = x7; + (this || _global$z).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$z).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$z).length + num.length); + return jumboMulTo(this || _global$z, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$z); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$z).length; i7++) { + var w6 = ((this || _global$z).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$z).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$z).words[i7] = carry; + (this || _global$z).length++; + } + return this || _global$z; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$z); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$z; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$z).length; i7++) { + var newCarry = (this || _global$z).words[i7] & carryMask; + var c7 = ((this || _global$z).words[i7] | 0) - newCarry << r8; + (this || _global$z).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$z).words[i7] = carry; + (this || _global$z).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$z).length - 1; i7 >= 0; i7--) { + (this || _global$z).words[i7 + s7] = (this || _global$z).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$z).words[i7] = 0; + } + (this || _global$z).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$z).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$z).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$z).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$z).length > s7) { + (this || _global$z).length -= s7; + for (i7 = 0; i7 < (this || _global$z).length; i7++) { + (this || _global$z).words[i7] = (this || _global$z).words[i7 + s7]; + } + } else { + (this || _global$z).words[0] = 0; + (this || _global$z).length = 1; + } + var carry = 0; + for (i7 = (this || _global$z).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$z).words[i7] | 0; + (this || _global$z).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$z).length === 0) { + (this || _global$z).words[0] = 0; + (this || _global$z).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$z).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$z).length <= s7) + return false; + var w6 = (this || _global$z).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$z).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$z).length <= s7) { + return this || _global$z; + } + if (r8 !== 0) { + s7++; + } + (this || _global$z).length = Math.min(s7, (this || _global$z).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$z).words[(this || _global$z).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$z).negative !== 0) { + if ((this || _global$z).length === 1 && ((this || _global$z).words[0] | 0) < num) { + (this || _global$z).words[0] = num - ((this || _global$z).words[0] | 0); + (this || _global$z).negative = 0; + return this || _global$z; + } + (this || _global$z).negative = 0; + this.isubn(num); + (this || _global$z).negative = 1; + return this || _global$z; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$z).words[0] += num; + for (var i7 = 0; i7 < (this || _global$z).length && (this || _global$z).words[i7] >= 67108864; i7++) { + (this || _global$z).words[i7] -= 67108864; + if (i7 === (this || _global$z).length - 1) { + (this || _global$z).words[i7 + 1] = 1; + } else { + (this || _global$z).words[i7 + 1]++; + } + } + (this || _global$z).length = Math.max((this || _global$z).length, i7 + 1); + return this || _global$z; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$z).negative !== 0) { + (this || _global$z).negative = 0; + this.iaddn(num); + (this || _global$z).negative = 1; + return this || _global$z; + } + (this || _global$z).words[0] -= num; + if ((this || _global$z).length === 1 && (this || _global$z).words[0] < 0) { + (this || _global$z).words[0] = -(this || _global$z).words[0]; + (this || _global$z).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$z).length && (this || _global$z).words[i7] < 0; i7++) { + (this || _global$z).words[i7] += 67108864; + (this || _global$z).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$z).negative = 0; + return this || _global$z; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$z).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$z).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$z).length - shift; i7++) { + w6 = ((this || _global$z).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$z).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$z).length; i7++) { + w6 = -((this || _global$z).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$z).words[i7] = w6 & 67108863; + } + (this || _global$z).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$z).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$z).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$z).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$z).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$z).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$z + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$z).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$z).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$z).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$z).words[i7] | 0) + carry * 67108864; + (this || _global$z).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$z; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$z; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$z).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$z).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$z).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$z).length <= s7) { + this._expand(s7 + 1); + (this || _global$z).words[s7] |= q5; + return this || _global$z; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$z).length; i7++) { + var w6 = (this || _global$z).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$z).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$z).words[i7] = carry; + (this || _global$z).length++; + } + return this || _global$z; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$z).length === 1 && (this || _global$z).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$z).negative !== 0 && !negative) + return -1; + if ((this || _global$z).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$z).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$z).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$z).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$z).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$z).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$z).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$z).length > num.length) + return 1; + if ((this || _global$z).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$z).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$z).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$z).red, "Already a number in reduction context"); + assert4((this || _global$z).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$z)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$z).red, "fromRed works only with numbers in reduction context"); + return (this || _global$z).red.convertFrom(this || _global$z); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$z).red = ctx; + return this || _global$z; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$z).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$z).red, "redAdd works only with red numbers"); + return (this || _global$z).red.add(this || _global$z, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$z).red, "redIAdd works only with red numbers"); + return (this || _global$z).red.iadd(this || _global$z, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$z).red, "redSub works only with red numbers"); + return (this || _global$z).red.sub(this || _global$z, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$z).red, "redISub works only with red numbers"); + return (this || _global$z).red.isub(this || _global$z, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$z).red, "redShl works only with red numbers"); + return (this || _global$z).red.shl(this || _global$z, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$z).red, "redMul works only with red numbers"); + (this || _global$z).red._verify2(this || _global$z, num); + return (this || _global$z).red.mul(this || _global$z, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$z).red, "redMul works only with red numbers"); + (this || _global$z).red._verify2(this || _global$z, num); + return (this || _global$z).red.imul(this || _global$z, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$z).red, "redSqr works only with red numbers"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.sqr(this || _global$z); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$z).red, "redISqr works only with red numbers"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.isqr(this || _global$z); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$z).red, "redSqrt works only with red numbers"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.sqrt(this || _global$z); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$z).red, "redInvm works only with red numbers"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.invm(this || _global$z); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$z).red, "redNeg works only with red numbers"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.neg(this || _global$z); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$z).red && !num.red, "redPow(normalNum)"); + (this || _global$z).red._verify1(this || _global$z); + return (this || _global$z).red.pow(this || _global$z, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$z).name = name2; + (this || _global$z).p = new BN(p7, 16); + (this || _global$z).n = (this || _global$z).p.bitLength(); + (this || _global$z).k = new BN(1).iushln((this || _global$z).n).isub((this || _global$z).p); + (this || _global$z).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$z).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$z).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$z).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$z).n); + var cmp = rlen < (this || _global$z).n ? -1 : r8.ucmp((this || _global$z).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$z).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$z).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$z).k); + }; + function K256() { + MPrime.call(this || _global$z, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$z, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$z, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$z, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$z).m = prime.p; + (this || _global$z).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$z).m = m7; + (this || _global$z).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$z).prime) + return (this || _global$z).prime.ireduce(a7)._forceRed(this || _global$z); + return a7.umod((this || _global$z).m)._forceRed(this || _global$z); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$z).m.sub(a7)._forceRed(this || _global$z); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$z).m) >= 0) { + res.isub((this || _global$z).m); + } + return res._forceRed(this || _global$z); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$z).m) >= 0) { + res.isub((this || _global$z).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$z).m); + } + return res._forceRed(this || _global$z); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$z).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$z).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$z).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$z).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$z); + var nOne = one.redNeg(); + var lpow = (this || _global$z).m.subn(1).iushrn(1); + var z6 = (this || _global$z).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$z); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$z).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$z); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$z); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$z).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$z, m7); + (this || _global$z).shift = (this || _global$z).m.bitLength(); + if ((this || _global$z).shift % 26 !== 0) { + (this || _global$z).shift += 26 - (this || _global$z).shift % 26; + } + (this || _global$z).r = new BN(1).iushln((this || _global$z).shift); + (this || _global$z).r2 = this.imod((this || _global$z).r.sqr()); + (this || _global$z).rinv = (this || _global$z).r._invmp((this || _global$z).m); + (this || _global$z).minv = (this || _global$z).rinv.mul((this || _global$z).r).isubn(1).div((this || _global$z).m); + (this || _global$z).minv = (this || _global$z).minv.umod((this || _global$z).r); + (this || _global$z).minv = (this || _global$z).r.sub((this || _global$z).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$z).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$z).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$z).shift).mul((this || _global$z).minv).imaskn((this || _global$z).shift).mul((this || _global$z).m); + var u7 = t8.isub(c7).iushrn((this || _global$z).shift); + var res = u7; + if (u7.cmp((this || _global$z).m) >= 0) { + res = u7.isub((this || _global$z).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$z).m); + } + return res._forceRed(this || _global$z); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$z); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$z).shift).mul((this || _global$z).minv).imaskn((this || _global$z).shift).mul((this || _global$z).m); + var u7 = t8.isub(c7).iushrn((this || _global$z).shift); + var res = u7; + if (u7.cmp((this || _global$z).m) >= 0) { + res = u7.isub((this || _global$z).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$z).m); + } + return res._forceRed(this || _global$z); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$z).m).mul((this || _global$z).r2)); + return res._forceRed(this || _global$z); + }; + })(module$a, exports$1Y); + return module$a.exports; +} +function dew$1W() { + if (_dewExec$1W) + return module$9.exports; + _dewExec$1W = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$y).negative = 0; + (this || _global$y).words = null; + (this || _global$y).length = 0; + (this || _global$y).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$y).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$y).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$y).words = [number & 67108863]; + (this || _global$y).length = 1; + } else if (number < 4503599627370496) { + (this || _global$y).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$y).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$y).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$y).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$y).words = [0]; + (this || _global$y).length = 1; + return this || _global$y; + } + (this || _global$y).length = Math.ceil(number.length / 3); + (this || _global$y).words = new Array((this || _global$y).length); + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + (this || _global$y).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$y).words[j6] |= w6 << off3 & 67108863; + (this || _global$y).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$y).words[j6] |= w6 << off3 & 67108863; + (this || _global$y).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$y).length = Math.ceil((number.length - start) / 6); + (this || _global$y).words = new Array((this || _global$y).length); + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + (this || _global$y).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$y).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$y).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$y).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$y).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$y).words = [0]; + (this || _global$y).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$y).words[0] + word < 67108864) { + (this || _global$y).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$y).words[0] + word < 67108864) { + (this || _global$y).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$y).length); + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + dest.words[i7] = (this || _global$y).words[i7]; + } + dest.length = (this || _global$y).length; + dest.negative = (this || _global$y).negative; + dest.red = (this || _global$y).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$y).length < size2) { + (this || _global$y).words[(this || _global$y).length++] = 0; + } + return this || _global$y; + }; + BN.prototype.strip = function strip() { + while ((this || _global$y).length > 1 && (this || _global$y).words[(this || _global$y).length - 1] === 0) { + (this || _global$y).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$y).length === 1 && (this || _global$y).words[0] === 0) { + (this || _global$y).negative = 0; + } + return this || _global$y; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$y).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + var w6 = (this || _global$y).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$y).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$y).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$y).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$y).words[0]; + if ((this || _global$y).length === 2) { + ret += (this || _global$y).words[1] * 67108864; + } else if ((this || _global$y).length === 3 && (this || _global$y).words[2] === 1) { + ret += 4503599627370496 + (this || _global$y).words[1] * 67108864; + } else if ((this || _global$y).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$y).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$y).words[(this || _global$y).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$y).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + var b8 = this._zeroBits((this || _global$y).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$y).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$y).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$y).negative ^= 1; + } + return this || _global$y; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$y).length < num.length) { + (this || _global$y).words[(this || _global$y).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$y).words[i7] = (this || _global$y).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$y).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$y).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$y); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$y).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$y); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$y).length > num.length) { + b8 = num; + } else { + b8 = this || _global$y; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$y).words[i7] = (this || _global$y).words[i7] & num.words[i7]; + } + (this || _global$y).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$y).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$y).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$y); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$y).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$y); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$y).length > num.length) { + a7 = this || _global$y; + b8 = num; + } else { + a7 = num; + b8 = this || _global$y; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$y).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$y) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$y).words[i7] = a7.words[i7]; + } + } + (this || _global$y).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$y).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$y).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$y); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$y).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$y); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$y).words[i7] = ~(this || _global$y).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$y).words[i7] = ~(this || _global$y).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$y).words[off3] = (this || _global$y).words[off3] | 1 << wbit; + } else { + (this || _global$y).words[off3] = (this || _global$y).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$y).negative !== 0 && num.negative === 0) { + (this || _global$y).negative = 0; + r8 = this.isub(num); + (this || _global$y).negative ^= 1; + return this._normSign(); + } else if ((this || _global$y).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$y).length > num.length) { + a7 = this || _global$y; + b8 = num; + } else { + a7 = num; + b8 = this || _global$y; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$y).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$y).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$y).length = a7.length; + if (carry !== 0) { + (this || _global$y).words[(this || _global$y).length] = carry; + (this || _global$y).length++; + } else if (a7 !== (this || _global$y)) { + for (; i7 < a7.length; i7++) { + (this || _global$y).words[i7] = a7.words[i7]; + } + } + return this || _global$y; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$y).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$y).negative !== 0) { + (this || _global$y).negative = 0; + res = num.sub(this || _global$y); + (this || _global$y).negative = 1; + return res; + } + if ((this || _global$y).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$y); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$y).negative !== 0) { + (this || _global$y).negative = 0; + this.iadd(num); + (this || _global$y).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$y).negative = 0; + (this || _global$y).length = 1; + (this || _global$y).words[0] = 0; + return this || _global$y; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$y; + b8 = num; + } else { + a7 = num; + b8 = this || _global$y; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$y).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$y).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$y)) { + for (; i7 < a7.length; i7++) { + (this || _global$y).words[i7] = a7.words[i7]; + } + } + (this || _global$y).length = Math.max((this || _global$y).length, i7); + if (a7 !== (this || _global$y)) { + (this || _global$y).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$y).length + num.length; + if ((this || _global$y).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$y, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$y, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$y, num, out); + } else { + res = jumboMulTo(this || _global$y, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$y).x = x7; + (this || _global$y).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$y).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$y).length + num.length); + return jumboMulTo(this || _global$y, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$y); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$y).length; i7++) { + var w6 = ((this || _global$y).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$y).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$y).words[i7] = carry; + (this || _global$y).length++; + } + return this || _global$y; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$y); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$y; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$y).length; i7++) { + var newCarry = (this || _global$y).words[i7] & carryMask; + var c7 = ((this || _global$y).words[i7] | 0) - newCarry << r8; + (this || _global$y).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$y).words[i7] = carry; + (this || _global$y).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$y).length - 1; i7 >= 0; i7--) { + (this || _global$y).words[i7 + s7] = (this || _global$y).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$y).words[i7] = 0; + } + (this || _global$y).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$y).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$y).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$y).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$y).length > s7) { + (this || _global$y).length -= s7; + for (i7 = 0; i7 < (this || _global$y).length; i7++) { + (this || _global$y).words[i7] = (this || _global$y).words[i7 + s7]; + } + } else { + (this || _global$y).words[0] = 0; + (this || _global$y).length = 1; + } + var carry = 0; + for (i7 = (this || _global$y).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$y).words[i7] | 0; + (this || _global$y).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$y).length === 0) { + (this || _global$y).words[0] = 0; + (this || _global$y).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$y).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$y).length <= s7) + return false; + var w6 = (this || _global$y).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$y).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$y).length <= s7) { + return this || _global$y; + } + if (r8 !== 0) { + s7++; + } + (this || _global$y).length = Math.min(s7, (this || _global$y).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$y).words[(this || _global$y).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$y).negative !== 0) { + if ((this || _global$y).length === 1 && ((this || _global$y).words[0] | 0) < num) { + (this || _global$y).words[0] = num - ((this || _global$y).words[0] | 0); + (this || _global$y).negative = 0; + return this || _global$y; + } + (this || _global$y).negative = 0; + this.isubn(num); + (this || _global$y).negative = 1; + return this || _global$y; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$y).words[0] += num; + for (var i7 = 0; i7 < (this || _global$y).length && (this || _global$y).words[i7] >= 67108864; i7++) { + (this || _global$y).words[i7] -= 67108864; + if (i7 === (this || _global$y).length - 1) { + (this || _global$y).words[i7 + 1] = 1; + } else { + (this || _global$y).words[i7 + 1]++; + } + } + (this || _global$y).length = Math.max((this || _global$y).length, i7 + 1); + return this || _global$y; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$y).negative !== 0) { + (this || _global$y).negative = 0; + this.iaddn(num); + (this || _global$y).negative = 1; + return this || _global$y; + } + (this || _global$y).words[0] -= num; + if ((this || _global$y).length === 1 && (this || _global$y).words[0] < 0) { + (this || _global$y).words[0] = -(this || _global$y).words[0]; + (this || _global$y).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$y).length && (this || _global$y).words[i7] < 0; i7++) { + (this || _global$y).words[i7] += 67108864; + (this || _global$y).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$y).negative = 0; + return this || _global$y; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$y).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$y).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$y).length - shift; i7++) { + w6 = ((this || _global$y).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$y).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$y).length; i7++) { + w6 = -((this || _global$y).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$y).words[i7] = w6 & 67108863; + } + (this || _global$y).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$y).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$y).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$y).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$y).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$y).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$y + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$y).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$y).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$y).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$y).words[i7] | 0) + carry * 67108864; + (this || _global$y).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$y; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$y; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$y).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$y).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$y).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$y).length <= s7) { + this._expand(s7 + 1); + (this || _global$y).words[s7] |= q5; + return this || _global$y; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$y).length; i7++) { + var w6 = (this || _global$y).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$y).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$y).words[i7] = carry; + (this || _global$y).length++; + } + return this || _global$y; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$y).length === 1 && (this || _global$y).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$y).negative !== 0 && !negative) + return -1; + if ((this || _global$y).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$y).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$y).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$y).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$y).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$y).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$y).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$y).length > num.length) + return 1; + if ((this || _global$y).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$y).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$y).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$y).red, "Already a number in reduction context"); + assert4((this || _global$y).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$y)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$y).red, "fromRed works only with numbers in reduction context"); + return (this || _global$y).red.convertFrom(this || _global$y); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$y).red = ctx; + return this || _global$y; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$y).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$y).red, "redAdd works only with red numbers"); + return (this || _global$y).red.add(this || _global$y, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$y).red, "redIAdd works only with red numbers"); + return (this || _global$y).red.iadd(this || _global$y, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$y).red, "redSub works only with red numbers"); + return (this || _global$y).red.sub(this || _global$y, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$y).red, "redISub works only with red numbers"); + return (this || _global$y).red.isub(this || _global$y, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$y).red, "redShl works only with red numbers"); + return (this || _global$y).red.shl(this || _global$y, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$y).red, "redMul works only with red numbers"); + (this || _global$y).red._verify2(this || _global$y, num); + return (this || _global$y).red.mul(this || _global$y, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$y).red, "redMul works only with red numbers"); + (this || _global$y).red._verify2(this || _global$y, num); + return (this || _global$y).red.imul(this || _global$y, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$y).red, "redSqr works only with red numbers"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.sqr(this || _global$y); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$y).red, "redISqr works only with red numbers"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.isqr(this || _global$y); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$y).red, "redSqrt works only with red numbers"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.sqrt(this || _global$y); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$y).red, "redInvm works only with red numbers"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.invm(this || _global$y); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$y).red, "redNeg works only with red numbers"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.neg(this || _global$y); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$y).red && !num.red, "redPow(normalNum)"); + (this || _global$y).red._verify1(this || _global$y); + return (this || _global$y).red.pow(this || _global$y, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$y).name = name2; + (this || _global$y).p = new BN(p7, 16); + (this || _global$y).n = (this || _global$y).p.bitLength(); + (this || _global$y).k = new BN(1).iushln((this || _global$y).n).isub((this || _global$y).p); + (this || _global$y).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$y).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$y).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$y).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$y).n); + var cmp = rlen < (this || _global$y).n ? -1 : r8.ucmp((this || _global$y).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$y).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$y).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$y).k); + }; + function K256() { + MPrime.call(this || _global$y, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$y, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$y, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$y, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$y).m = prime.p; + (this || _global$y).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$y).m = m7; + (this || _global$y).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$y).prime) + return (this || _global$y).prime.ireduce(a7)._forceRed(this || _global$y); + return a7.umod((this || _global$y).m)._forceRed(this || _global$y); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$y).m.sub(a7)._forceRed(this || _global$y); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$y).m) >= 0) { + res.isub((this || _global$y).m); + } + return res._forceRed(this || _global$y); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$y).m) >= 0) { + res.isub((this || _global$y).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$y).m); + } + return res._forceRed(this || _global$y); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$y).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$y).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$y).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$y).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$y); + var nOne = one.redNeg(); + var lpow = (this || _global$y).m.subn(1).iushrn(1); + var z6 = (this || _global$y).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$y); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$y).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$y); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$y); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$y).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$y, m7); + (this || _global$y).shift = (this || _global$y).m.bitLength(); + if ((this || _global$y).shift % 26 !== 0) { + (this || _global$y).shift += 26 - (this || _global$y).shift % 26; + } + (this || _global$y).r = new BN(1).iushln((this || _global$y).shift); + (this || _global$y).r2 = this.imod((this || _global$y).r.sqr()); + (this || _global$y).rinv = (this || _global$y).r._invmp((this || _global$y).m); + (this || _global$y).minv = (this || _global$y).rinv.mul((this || _global$y).r).isubn(1).div((this || _global$y).m); + (this || _global$y).minv = (this || _global$y).minv.umod((this || _global$y).r); + (this || _global$y).minv = (this || _global$y).r.sub((this || _global$y).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$y).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$y).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$y).shift).mul((this || _global$y).minv).imaskn((this || _global$y).shift).mul((this || _global$y).m); + var u7 = t8.isub(c7).iushrn((this || _global$y).shift); + var res = u7; + if (u7.cmp((this || _global$y).m) >= 0) { + res = u7.isub((this || _global$y).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$y).m); + } + return res._forceRed(this || _global$y); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$y); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$y).shift).mul((this || _global$y).minv).imaskn((this || _global$y).shift).mul((this || _global$y).m); + var u7 = t8.isub(c7).iushrn((this || _global$y).shift); + var res = u7; + if (u7.cmp((this || _global$y).m) >= 0) { + res = u7.isub((this || _global$y).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$y).m); + } + return res._forceRed(this || _global$y); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$y).m).mul((this || _global$y).r2)); + return res._forceRed(this || _global$y); + }; + })(module$9, exports$1X); + return module$9.exports; +} +function dew$1V() { + if (_dewExec$1V) + return exports$1W; + _dewExec$1V = true; + exports$1W = exports$1W = dew$3$2(); + exports$1W.Stream = exports$1W; + exports$1W.Readable = exports$1W; + exports$1W.Writable = dew$8$2(); + exports$1W.Duplex = dew$7$2(); + exports$1W.Transform = dew$2$2(); + exports$1W.PassThrough = dew$1$2(); + exports$1W.finished = dew$6$2(); + exports$1W.pipeline = dew$2B(); + return exports$1W; +} +function dew$1T() { + if (_dewExec$1T) + return exports$1U; + _dewExec$1T = true; + var buffer2 = e$1$1; + var Buffer4 = buffer2.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$1U = buffer2; + } else { + copyProps(buffer2, exports$1U); + exports$1U.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer2.SlowBuffer(size2); + }; + return exports$1U; +} +function dew$1S() { + if (_dewExec$1S) + return exports$1T; + _dewExec$1S = true; + var process5 = T$1; + var MAX_BYTES = 65536; + var MAX_UINT32 = 4294967295; + function oldBrowser() { + throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); + } + var Buffer4 = dew$1T().Buffer; + var crypto2 = _global$w.crypto || _global$w.msCrypto; + if (crypto2 && crypto2.getRandomValues) { + exports$1T = randomBytes2; + } else { + exports$1T = oldBrowser; + } + function randomBytes2(size2, cb) { + if (size2 > MAX_UINT32) + throw new RangeError("requested too many random bytes"); + var bytes = Buffer4.allocUnsafe(size2); + if (size2 > 0) { + if (size2 > MAX_BYTES) { + for (var generated = 0; generated < size2; generated += MAX_BYTES) { + crypto2.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)); + } + } else { + crypto2.getRandomValues(bytes); + } + } + if (typeof cb === "function") { + return process5.nextTick(function() { + cb(null, bytes); + }); + } + return bytes; + } + return exports$1T; +} +function dew$1R() { + if (_dewExec$1R) + return exports$1S; + _dewExec$1R = true; + var Buffer4 = dew$1T().Buffer; + var Transform2 = dew$1V().Transform; + var inherits2 = dew$f$2(); + function throwIfNotStringOrBuffer(val, prefix) { + if (!Buffer4.isBuffer(val) && typeof val !== "string") { + throw new TypeError(prefix + " must be a string or a buffer"); + } + } + function HashBase(blockSize) { + Transform2.call(this); + this._block = Buffer4.allocUnsafe(blockSize); + this._blockSize = blockSize; + this._blockOffset = 0; + this._length = [0, 0, 0, 0]; + this._finalized = false; + } + inherits2(HashBase, Transform2); + HashBase.prototype._transform = function(chunk2, encoding, callback) { + var error2 = null; + try { + this.update(chunk2, encoding); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype._flush = function(callback) { + var error2 = null; + try { + this.push(this.digest()); + } catch (err) { + error2 = err; + } + callback(error2); + }; + HashBase.prototype.update = function(data, encoding) { + throwIfNotStringOrBuffer(data, "Data"); + if (this._finalized) + throw new Error("Digest already called"); + if (!Buffer4.isBuffer(data)) + data = Buffer4.from(data, encoding); + var block = this._block; + var offset = 0; + while (this._blockOffset + data.length - offset >= this._blockSize) { + for (var i7 = this._blockOffset; i7 < this._blockSize; ) + block[i7++] = data[offset++]; + this._update(); + this._blockOffset = 0; + } + while (offset < data.length) + block[this._blockOffset++] = data[offset++]; + for (var j6 = 0, carry = data.length * 8; carry > 0; ++j6) { + this._length[j6] += carry; + carry = this._length[j6] / 4294967296 | 0; + if (carry > 0) + this._length[j6] -= 4294967296 * carry; + } + return this; + }; + HashBase.prototype._update = function() { + throw new Error("_update is not implemented"); + }; + HashBase.prototype.digest = function(encoding) { + if (this._finalized) + throw new Error("Digest already called"); + this._finalized = true; + var digest = this._digest(); + if (encoding !== void 0) + digest = digest.toString(encoding); + this._block.fill(0); + this._blockOffset = 0; + for (var i7 = 0; i7 < 4; ++i7) + this._length[i7] = 0; + return digest; + }; + HashBase.prototype._digest = function() { + throw new Error("_digest is not implemented"); + }; + exports$1S = HashBase; + return exports$1S; +} +function dew$1Q() { + if (_dewExec$1Q) + return exports$1R; + _dewExec$1Q = true; + var inherits2 = dew$f$2(); + var HashBase = dew$1R(); + var Buffer4 = dew$1T().Buffer; + var ARRAY16 = new Array(16); + function MD5() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + } + inherits2(MD5, HashBase); + MD5.prototype._update = function() { + var M6 = ARRAY16; + for (var i7 = 0; i7 < 16; ++i7) + M6[i7] = this._block.readInt32LE(i7 * 4); + var a7 = this._a; + var b8 = this._b; + var c7 = this._c; + var d7 = this._d; + a7 = fnF(a7, b8, c7, d7, M6[0], 3614090360, 7); + d7 = fnF(d7, a7, b8, c7, M6[1], 3905402710, 12); + c7 = fnF(c7, d7, a7, b8, M6[2], 606105819, 17); + b8 = fnF(b8, c7, d7, a7, M6[3], 3250441966, 22); + a7 = fnF(a7, b8, c7, d7, M6[4], 4118548399, 7); + d7 = fnF(d7, a7, b8, c7, M6[5], 1200080426, 12); + c7 = fnF(c7, d7, a7, b8, M6[6], 2821735955, 17); + b8 = fnF(b8, c7, d7, a7, M6[7], 4249261313, 22); + a7 = fnF(a7, b8, c7, d7, M6[8], 1770035416, 7); + d7 = fnF(d7, a7, b8, c7, M6[9], 2336552879, 12); + c7 = fnF(c7, d7, a7, b8, M6[10], 4294925233, 17); + b8 = fnF(b8, c7, d7, a7, M6[11], 2304563134, 22); + a7 = fnF(a7, b8, c7, d7, M6[12], 1804603682, 7); + d7 = fnF(d7, a7, b8, c7, M6[13], 4254626195, 12); + c7 = fnF(c7, d7, a7, b8, M6[14], 2792965006, 17); + b8 = fnF(b8, c7, d7, a7, M6[15], 1236535329, 22); + a7 = fnG(a7, b8, c7, d7, M6[1], 4129170786, 5); + d7 = fnG(d7, a7, b8, c7, M6[6], 3225465664, 9); + c7 = fnG(c7, d7, a7, b8, M6[11], 643717713, 14); + b8 = fnG(b8, c7, d7, a7, M6[0], 3921069994, 20); + a7 = fnG(a7, b8, c7, d7, M6[5], 3593408605, 5); + d7 = fnG(d7, a7, b8, c7, M6[10], 38016083, 9); + c7 = fnG(c7, d7, a7, b8, M6[15], 3634488961, 14); + b8 = fnG(b8, c7, d7, a7, M6[4], 3889429448, 20); + a7 = fnG(a7, b8, c7, d7, M6[9], 568446438, 5); + d7 = fnG(d7, a7, b8, c7, M6[14], 3275163606, 9); + c7 = fnG(c7, d7, a7, b8, M6[3], 4107603335, 14); + b8 = fnG(b8, c7, d7, a7, M6[8], 1163531501, 20); + a7 = fnG(a7, b8, c7, d7, M6[13], 2850285829, 5); + d7 = fnG(d7, a7, b8, c7, M6[2], 4243563512, 9); + c7 = fnG(c7, d7, a7, b8, M6[7], 1735328473, 14); + b8 = fnG(b8, c7, d7, a7, M6[12], 2368359562, 20); + a7 = fnH(a7, b8, c7, d7, M6[5], 4294588738, 4); + d7 = fnH(d7, a7, b8, c7, M6[8], 2272392833, 11); + c7 = fnH(c7, d7, a7, b8, M6[11], 1839030562, 16); + b8 = fnH(b8, c7, d7, a7, M6[14], 4259657740, 23); + a7 = fnH(a7, b8, c7, d7, M6[1], 2763975236, 4); + d7 = fnH(d7, a7, b8, c7, M6[4], 1272893353, 11); + c7 = fnH(c7, d7, a7, b8, M6[7], 4139469664, 16); + b8 = fnH(b8, c7, d7, a7, M6[10], 3200236656, 23); + a7 = fnH(a7, b8, c7, d7, M6[13], 681279174, 4); + d7 = fnH(d7, a7, b8, c7, M6[0], 3936430074, 11); + c7 = fnH(c7, d7, a7, b8, M6[3], 3572445317, 16); + b8 = fnH(b8, c7, d7, a7, M6[6], 76029189, 23); + a7 = fnH(a7, b8, c7, d7, M6[9], 3654602809, 4); + d7 = fnH(d7, a7, b8, c7, M6[12], 3873151461, 11); + c7 = fnH(c7, d7, a7, b8, M6[15], 530742520, 16); + b8 = fnH(b8, c7, d7, a7, M6[2], 3299628645, 23); + a7 = fnI(a7, b8, c7, d7, M6[0], 4096336452, 6); + d7 = fnI(d7, a7, b8, c7, M6[7], 1126891415, 10); + c7 = fnI(c7, d7, a7, b8, M6[14], 2878612391, 15); + b8 = fnI(b8, c7, d7, a7, M6[5], 4237533241, 21); + a7 = fnI(a7, b8, c7, d7, M6[12], 1700485571, 6); + d7 = fnI(d7, a7, b8, c7, M6[3], 2399980690, 10); + c7 = fnI(c7, d7, a7, b8, M6[10], 4293915773, 15); + b8 = fnI(b8, c7, d7, a7, M6[1], 2240044497, 21); + a7 = fnI(a7, b8, c7, d7, M6[8], 1873313359, 6); + d7 = fnI(d7, a7, b8, c7, M6[15], 4264355552, 10); + c7 = fnI(c7, d7, a7, b8, M6[6], 2734768916, 15); + b8 = fnI(b8, c7, d7, a7, M6[13], 1309151649, 21); + a7 = fnI(a7, b8, c7, d7, M6[4], 4149444226, 6); + d7 = fnI(d7, a7, b8, c7, M6[11], 3174756917, 10); + c7 = fnI(c7, d7, a7, b8, M6[2], 718787259, 15); + b8 = fnI(b8, c7, d7, a7, M6[9], 3951481745, 21); + this._a = this._a + a7 | 0; + this._b = this._b + b8 | 0; + this._c = this._c + c7 | 0; + this._d = this._d + d7 | 0; + }; + MD5.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.allocUnsafe(16); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fnF(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnG(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnH(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + b8 | 0; + } + function fnI(a7, b8, c7, d7, m7, k6, s7) { + return rotl(a7 + (c7 ^ (b8 | ~d7)) + m7 + k6 | 0, s7) + b8 | 0; + } + exports$1R = MD5; + return exports$1R; +} +function dew$1P() { + if (_dewExec$1P) + return exports$1Q; + _dewExec$1P = true; + var Buffer4 = e$1$1.Buffer; + var inherits2 = dew$f$2(); + var HashBase = dew$1R(); + var ARRAY16 = new Array(16); + var zl = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var zr = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var sl = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sr = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + var hl = [0, 1518500249, 1859775393, 2400959708, 2840853838]; + var hr = [1352829926, 1548603684, 1836072691, 2053994217, 0]; + function RIPEMD160() { + HashBase.call(this, 64); + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + this._e = 3285377520; + } + inherits2(RIPEMD160, HashBase); + RIPEMD160.prototype._update = function() { + var words2 = ARRAY16; + for (var j6 = 0; j6 < 16; ++j6) + words2[j6] = this._block.readInt32LE(j6 * 4); + var al = this._a | 0; + var bl = this._b | 0; + var cl = this._c | 0; + var dl = this._d | 0; + var el = this._e | 0; + var ar = this._a | 0; + var br = this._b | 0; + var cr = this._c | 0; + var dr = this._d | 0; + var er = this._e | 0; + for (var i7 = 0; i7 < 80; i7 += 1) { + var tl; + var tr; + if (i7 < 16) { + tl = fn1(al, bl, cl, dl, el, words2[zl[i7]], hl[0], sl[i7]); + tr = fn5(ar, br, cr, dr, er, words2[zr[i7]], hr[0], sr[i7]); + } else if (i7 < 32) { + tl = fn2(al, bl, cl, dl, el, words2[zl[i7]], hl[1], sl[i7]); + tr = fn4(ar, br, cr, dr, er, words2[zr[i7]], hr[1], sr[i7]); + } else if (i7 < 48) { + tl = fn3(al, bl, cl, dl, el, words2[zl[i7]], hl[2], sl[i7]); + tr = fn3(ar, br, cr, dr, er, words2[zr[i7]], hr[2], sr[i7]); + } else if (i7 < 64) { + tl = fn4(al, bl, cl, dl, el, words2[zl[i7]], hl[3], sl[i7]); + tr = fn2(ar, br, cr, dr, er, words2[zr[i7]], hr[3], sr[i7]); + } else { + tl = fn5(al, bl, cl, dl, el, words2[zl[i7]], hl[4], sl[i7]); + tr = fn1(ar, br, cr, dr, er, words2[zr[i7]], hr[4], sr[i7]); + } + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = tl; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = tr; + } + var t8 = this._b + cl + dr | 0; + this._b = this._c + dl + er | 0; + this._c = this._d + el + ar | 0; + this._d = this._e + al + br | 0; + this._e = this._a + bl + cr | 0; + this._a = t8; + }; + RIPEMD160.prototype._digest = function() { + this._block[this._blockOffset++] = 128; + if (this._blockOffset > 56) { + this._block.fill(0, this._blockOffset, 64); + this._update(); + this._blockOffset = 0; + } + this._block.fill(0, this._blockOffset, 56); + this._block.writeUInt32LE(this._length[0], 56); + this._block.writeUInt32LE(this._length[1], 60); + this._update(); + var buffer2 = Buffer4.alloc ? Buffer4.alloc(20) : new Buffer4(20); + buffer2.writeInt32LE(this._a, 0); + buffer2.writeInt32LE(this._b, 4); + buffer2.writeInt32LE(this._c, 8); + buffer2.writeInt32LE(this._d, 12); + buffer2.writeInt32LE(this._e, 16); + return buffer2; + }; + function rotl(x7, n7) { + return x7 << n7 | x7 >>> 32 - n7; + } + function fn1(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ c7 ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn2(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & c7 | ~b8 & d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn3(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + ((b8 | ~c7) ^ d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn4(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 & d7 | c7 & ~d7) + m7 + k6 | 0, s7) + e10 | 0; + } + function fn5(a7, b8, c7, d7, e10, m7, k6, s7) { + return rotl(a7 + (b8 ^ (c7 | ~d7)) + m7 + k6 | 0, s7) + e10 | 0; + } + exports$1Q = RIPEMD160; + return exports$1Q; +} +function dew$1O() { + if (_dewExec$1O) + return exports$1P; + _dewExec$1O = true; + var Buffer4 = dew$1T().Buffer; + function Hash3(blockSize, finalSize) { + (this || _global$v)._block = Buffer4.alloc(blockSize); + (this || _global$v)._finalSize = finalSize; + (this || _global$v)._blockSize = blockSize; + (this || _global$v)._len = 0; + } + Hash3.prototype.update = function(data, enc) { + if (typeof data === "string") { + enc = enc || "utf8"; + data = Buffer4.from(data, enc); + } + var block = (this || _global$v)._block; + var blockSize = (this || _global$v)._blockSize; + var length = data.length; + var accum = (this || _global$v)._len; + for (var offset = 0; offset < length; ) { + var assigned = accum % blockSize; + var remainder = Math.min(length - offset, blockSize - assigned); + for (var i7 = 0; i7 < remainder; i7++) { + block[assigned + i7] = data[offset + i7]; + } + accum += remainder; + offset += remainder; + if (accum % blockSize === 0) { + this._update(block); + } + } + (this || _global$v)._len += length; + return this || _global$v; + }; + Hash3.prototype.digest = function(enc) { + var rem = (this || _global$v)._len % (this || _global$v)._blockSize; + (this || _global$v)._block[rem] = 128; + (this || _global$v)._block.fill(0, rem + 1); + if (rem >= (this || _global$v)._finalSize) { + this._update((this || _global$v)._block); + (this || _global$v)._block.fill(0); + } + var bits = (this || _global$v)._len * 8; + if (bits <= 4294967295) { + (this || _global$v)._block.writeUInt32BE(bits, (this || _global$v)._blockSize - 4); + } else { + var lowBits = (bits & 4294967295) >>> 0; + var highBits = (bits - lowBits) / 4294967296; + (this || _global$v)._block.writeUInt32BE(highBits, (this || _global$v)._blockSize - 8); + (this || _global$v)._block.writeUInt32BE(lowBits, (this || _global$v)._blockSize - 4); + } + this._update((this || _global$v)._block); + var hash = this._hash(); + return enc ? hash.toString(enc) : hash; + }; + Hash3.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + exports$1P = Hash3; + return exports$1P; +} +function dew$1N() { + if (_dewExec$1N) + return exports$1O; + _dewExec$1N = true; + var inherits2 = dew$f$2(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha() { + this.init(); + (this || _global$u)._w = W5; + Hash3.call(this || _global$u, 64, 56); + } + inherits2(Sha, Hash3); + Sha.prototype.init = function() { + (this || _global$u)._a = 1732584193; + (this || _global$u)._b = 4023233417; + (this || _global$u)._c = 2562383102; + (this || _global$u)._d = 271733878; + (this || _global$u)._e = 3285377520; + return this || _global$u; + }; + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha.prototype._update = function(M6) { + var W6 = (this || _global$u)._w; + var a7 = (this || _global$u)._a | 0; + var b8 = (this || _global$u)._b | 0; + var c7 = (this || _global$u)._c | 0; + var d7 = (this || _global$u)._d | 0; + var e10 = (this || _global$u)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]; + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$u)._a = a7 + (this || _global$u)._a | 0; + (this || _global$u)._b = b8 + (this || _global$u)._b | 0; + (this || _global$u)._c = c7 + (this || _global$u)._c | 0; + (this || _global$u)._d = d7 + (this || _global$u)._d | 0; + (this || _global$u)._e = e10 + (this || _global$u)._e | 0; + }; + Sha.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$u)._a | 0, 0); + H5.writeInt32BE((this || _global$u)._b | 0, 4); + H5.writeInt32BE((this || _global$u)._c | 0, 8); + H5.writeInt32BE((this || _global$u)._d | 0, 12); + H5.writeInt32BE((this || _global$u)._e | 0, 16); + return H5; + }; + exports$1O = Sha; + return exports$1O; +} +function dew$1M() { + if (_dewExec$1M) + return exports$1N; + _dewExec$1M = true; + var inherits2 = dew$f$2(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var K5 = [1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0]; + var W5 = new Array(80); + function Sha1() { + this.init(); + (this || _global$t)._w = W5; + Hash3.call(this || _global$t, 64, 56); + } + inherits2(Sha1, Hash3); + Sha1.prototype.init = function() { + (this || _global$t)._a = 1732584193; + (this || _global$t)._b = 4023233417; + (this || _global$t)._c = 2562383102; + (this || _global$t)._d = 271733878; + (this || _global$t)._e = 3285377520; + return this || _global$t; + }; + function rotl1(num) { + return num << 1 | num >>> 31; + } + function rotl5(num) { + return num << 5 | num >>> 27; + } + function rotl30(num) { + return num << 30 | num >>> 2; + } + function ft(s7, b8, c7, d7) { + if (s7 === 0) + return b8 & c7 | ~b8 & d7; + if (s7 === 2) + return b8 & c7 | b8 & d7 | c7 & d7; + return b8 ^ c7 ^ d7; + } + Sha1.prototype._update = function(M6) { + var W6 = (this || _global$t)._w; + var a7 = (this || _global$t)._a | 0; + var b8 = (this || _global$t)._b | 0; + var c7 = (this || _global$t)._c | 0; + var d7 = (this || _global$t)._d | 0; + var e10 = (this || _global$t)._e | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 80; ++i7) + W6[i7] = rotl1(W6[i7 - 3] ^ W6[i7 - 8] ^ W6[i7 - 14] ^ W6[i7 - 16]); + for (var j6 = 0; j6 < 80; ++j6) { + var s7 = ~~(j6 / 20); + var t8 = rotl5(a7) + ft(s7, b8, c7, d7) + e10 + W6[j6] + K5[s7] | 0; + e10 = d7; + d7 = c7; + c7 = rotl30(b8); + b8 = a7; + a7 = t8; + } + (this || _global$t)._a = a7 + (this || _global$t)._a | 0; + (this || _global$t)._b = b8 + (this || _global$t)._b | 0; + (this || _global$t)._c = c7 + (this || _global$t)._c | 0; + (this || _global$t)._d = d7 + (this || _global$t)._d | 0; + (this || _global$t)._e = e10 + (this || _global$t)._e | 0; + }; + Sha1.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(20); + H5.writeInt32BE((this || _global$t)._a | 0, 0); + H5.writeInt32BE((this || _global$t)._b | 0, 4); + H5.writeInt32BE((this || _global$t)._c | 0, 8); + H5.writeInt32BE((this || _global$t)._d | 0, 12); + H5.writeInt32BE((this || _global$t)._e | 0, 16); + return H5; + }; + exports$1N = Sha1; + return exports$1N; +} +function dew$1L() { + if (_dewExec$1L) + return exports$1M; + _dewExec$1L = true; + var inherits2 = dew$f$2(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var K5 = [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]; + var W5 = new Array(64); + function Sha256() { + this.init(); + (this || _global$s)._w = W5; + Hash3.call(this || _global$s, 64, 56); + } + inherits2(Sha256, Hash3); + Sha256.prototype.init = function() { + (this || _global$s)._a = 1779033703; + (this || _global$s)._b = 3144134277; + (this || _global$s)._c = 1013904242; + (this || _global$s)._d = 2773480762; + (this || _global$s)._e = 1359893119; + (this || _global$s)._f = 2600822924; + (this || _global$s)._g = 528734635; + (this || _global$s)._h = 1541459225; + return this || _global$s; + }; + function ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7) { + return (x7 >>> 2 | x7 << 30) ^ (x7 >>> 13 | x7 << 19) ^ (x7 >>> 22 | x7 << 10); + } + function sigma1(x7) { + return (x7 >>> 6 | x7 << 26) ^ (x7 >>> 11 | x7 << 21) ^ (x7 >>> 25 | x7 << 7); + } + function gamma0(x7) { + return (x7 >>> 7 | x7 << 25) ^ (x7 >>> 18 | x7 << 14) ^ x7 >>> 3; + } + function gamma1(x7) { + return (x7 >>> 17 | x7 << 15) ^ (x7 >>> 19 | x7 << 13) ^ x7 >>> 10; + } + Sha256.prototype._update = function(M6) { + var W6 = (this || _global$s)._w; + var a7 = (this || _global$s)._a | 0; + var b8 = (this || _global$s)._b | 0; + var c7 = (this || _global$s)._c | 0; + var d7 = (this || _global$s)._d | 0; + var e10 = (this || _global$s)._e | 0; + var f8 = (this || _global$s)._f | 0; + var g7 = (this || _global$s)._g | 0; + var h8 = (this || _global$s)._h | 0; + for (var i7 = 0; i7 < 16; ++i7) + W6[i7] = M6.readInt32BE(i7 * 4); + for (; i7 < 64; ++i7) + W6[i7] = gamma1(W6[i7 - 2]) + W6[i7 - 7] + gamma0(W6[i7 - 15]) + W6[i7 - 16] | 0; + for (var j6 = 0; j6 < 64; ++j6) { + var T1 = h8 + sigma1(e10) + ch(e10, f8, g7) + K5[j6] + W6[j6] | 0; + var T22 = sigma0(a7) + maj(a7, b8, c7) | 0; + h8 = g7; + g7 = f8; + f8 = e10; + e10 = d7 + T1 | 0; + d7 = c7; + c7 = b8; + b8 = a7; + a7 = T1 + T22 | 0; + } + (this || _global$s)._a = a7 + (this || _global$s)._a | 0; + (this || _global$s)._b = b8 + (this || _global$s)._b | 0; + (this || _global$s)._c = c7 + (this || _global$s)._c | 0; + (this || _global$s)._d = d7 + (this || _global$s)._d | 0; + (this || _global$s)._e = e10 + (this || _global$s)._e | 0; + (this || _global$s)._f = f8 + (this || _global$s)._f | 0; + (this || _global$s)._g = g7 + (this || _global$s)._g | 0; + (this || _global$s)._h = h8 + (this || _global$s)._h | 0; + }; + Sha256.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(32); + H5.writeInt32BE((this || _global$s)._a, 0); + H5.writeInt32BE((this || _global$s)._b, 4); + H5.writeInt32BE((this || _global$s)._c, 8); + H5.writeInt32BE((this || _global$s)._d, 12); + H5.writeInt32BE((this || _global$s)._e, 16); + H5.writeInt32BE((this || _global$s)._f, 20); + H5.writeInt32BE((this || _global$s)._g, 24); + H5.writeInt32BE((this || _global$s)._h, 28); + return H5; + }; + exports$1M = Sha256; + return exports$1M; +} +function dew$1K() { + if (_dewExec$1K) + return exports$1L; + _dewExec$1K = true; + var inherits2 = dew$f$2(); + var Sha256 = dew$1L(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var W5 = new Array(64); + function Sha224() { + this.init(); + (this || _global$r)._w = W5; + Hash3.call(this || _global$r, 64, 56); + } + inherits2(Sha224, Sha256); + Sha224.prototype.init = function() { + (this || _global$r)._a = 3238371032; + (this || _global$r)._b = 914150663; + (this || _global$r)._c = 812702999; + (this || _global$r)._d = 4144912697; + (this || _global$r)._e = 4290775857; + (this || _global$r)._f = 1750603025; + (this || _global$r)._g = 1694076839; + (this || _global$r)._h = 3204075428; + return this || _global$r; + }; + Sha224.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(28); + H5.writeInt32BE((this || _global$r)._a, 0); + H5.writeInt32BE((this || _global$r)._b, 4); + H5.writeInt32BE((this || _global$r)._c, 8); + H5.writeInt32BE((this || _global$r)._d, 12); + H5.writeInt32BE((this || _global$r)._e, 16); + H5.writeInt32BE((this || _global$r)._f, 20); + H5.writeInt32BE((this || _global$r)._g, 24); + return H5; + }; + exports$1L = Sha224; + return exports$1L; +} +function dew$1J() { + if (_dewExec$1J) + return exports$1K; + _dewExec$1J = true; + var inherits2 = dew$f$2(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var K5 = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + var W5 = new Array(160); + function Sha512() { + this.init(); + (this || _global$q)._w = W5; + Hash3.call(this || _global$q, 128, 112); + } + inherits2(Sha512, Hash3); + Sha512.prototype.init = function() { + (this || _global$q)._ah = 1779033703; + (this || _global$q)._bh = 3144134277; + (this || _global$q)._ch = 1013904242; + (this || _global$q)._dh = 2773480762; + (this || _global$q)._eh = 1359893119; + (this || _global$q)._fh = 2600822924; + (this || _global$q)._gh = 528734635; + (this || _global$q)._hh = 1541459225; + (this || _global$q)._al = 4089235720; + (this || _global$q)._bl = 2227873595; + (this || _global$q)._cl = 4271175723; + (this || _global$q)._dl = 1595750129; + (this || _global$q)._el = 2917565137; + (this || _global$q)._fl = 725511199; + (this || _global$q)._gl = 4215389547; + (this || _global$q)._hl = 327033209; + return this || _global$q; + }; + function Ch(x7, y7, z6) { + return z6 ^ x7 & (y7 ^ z6); + } + function maj(x7, y7, z6) { + return x7 & y7 | z6 & (x7 | y7); + } + function sigma0(x7, xl) { + return (x7 >>> 28 | xl << 4) ^ (xl >>> 2 | x7 << 30) ^ (xl >>> 7 | x7 << 25); + } + function sigma1(x7, xl) { + return (x7 >>> 14 | xl << 18) ^ (x7 >>> 18 | xl << 14) ^ (xl >>> 9 | x7 << 23); + } + function Gamma0(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ x7 >>> 7; + } + function Gamma0l(x7, xl) { + return (x7 >>> 1 | xl << 31) ^ (x7 >>> 8 | xl << 24) ^ (x7 >>> 7 | xl << 25); + } + function Gamma1(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ x7 >>> 6; + } + function Gamma1l(x7, xl) { + return (x7 >>> 19 | xl << 13) ^ (xl >>> 29 | x7 << 3) ^ (x7 >>> 6 | xl << 26); + } + function getCarry(a7, b8) { + return a7 >>> 0 < b8 >>> 0 ? 1 : 0; + } + Sha512.prototype._update = function(M6) { + var W6 = (this || _global$q)._w; + var ah = (this || _global$q)._ah | 0; + var bh = (this || _global$q)._bh | 0; + var ch = (this || _global$q)._ch | 0; + var dh = (this || _global$q)._dh | 0; + var eh = (this || _global$q)._eh | 0; + var fh = (this || _global$q)._fh | 0; + var gh = (this || _global$q)._gh | 0; + var hh = (this || _global$q)._hh | 0; + var al = (this || _global$q)._al | 0; + var bl = (this || _global$q)._bl | 0; + var cl = (this || _global$q)._cl | 0; + var dl = (this || _global$q)._dl | 0; + var el = (this || _global$q)._el | 0; + var fl = (this || _global$q)._fl | 0; + var gl = (this || _global$q)._gl | 0; + var hl = (this || _global$q)._hl | 0; + for (var i7 = 0; i7 < 32; i7 += 2) { + W6[i7] = M6.readInt32BE(i7 * 4); + W6[i7 + 1] = M6.readInt32BE(i7 * 4 + 4); + } + for (; i7 < 160; i7 += 2) { + var xh = W6[i7 - 15 * 2]; + var xl = W6[i7 - 15 * 2 + 1]; + var gamma0 = Gamma0(xh, xl); + var gamma0l = Gamma0l(xl, xh); + xh = W6[i7 - 2 * 2]; + xl = W6[i7 - 2 * 2 + 1]; + var gamma1 = Gamma1(xh, xl); + var gamma1l = Gamma1l(xl, xh); + var Wi7h = W6[i7 - 7 * 2]; + var Wi7l = W6[i7 - 7 * 2 + 1]; + var Wi16h = W6[i7 - 16 * 2]; + var Wi16l = W6[i7 - 16 * 2 + 1]; + var Wil = gamma0l + Wi7l | 0; + var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0; + Wil = Wil + gamma1l | 0; + Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0; + Wil = Wil + Wi16l | 0; + Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0; + W6[i7] = Wih; + W6[i7 + 1] = Wil; + } + for (var j6 = 0; j6 < 160; j6 += 2) { + Wih = W6[j6]; + Wil = W6[j6 + 1]; + var majh = maj(ah, bh, ch); + var majl = maj(al, bl, cl); + var sigma0h = sigma0(ah, al); + var sigma0l = sigma0(al, ah); + var sigma1h = sigma1(eh, el); + var sigma1l = sigma1(el, eh); + var Kih = K5[j6]; + var Kil = K5[j6 + 1]; + var chh = Ch(eh, fh, gh); + var chl = Ch(el, fl, gl); + var t1l = hl + sigma1l | 0; + var t1h = hh + sigma1h + getCarry(t1l, hl) | 0; + t1l = t1l + chl | 0; + t1h = t1h + chh + getCarry(t1l, chl) | 0; + t1l = t1l + Kil | 0; + t1h = t1h + Kih + getCarry(t1l, Kil) | 0; + t1l = t1l + Wil | 0; + t1h = t1h + Wih + getCarry(t1l, Wil) | 0; + var t2l = sigma0l + majl | 0; + var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0; + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = dl + t1l | 0; + eh = dh + t1h + getCarry(el, dl) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = t1l + t2l | 0; + ah = t1h + t2h + getCarry(al, t1l) | 0; + } + (this || _global$q)._al = (this || _global$q)._al + al | 0; + (this || _global$q)._bl = (this || _global$q)._bl + bl | 0; + (this || _global$q)._cl = (this || _global$q)._cl + cl | 0; + (this || _global$q)._dl = (this || _global$q)._dl + dl | 0; + (this || _global$q)._el = (this || _global$q)._el + el | 0; + (this || _global$q)._fl = (this || _global$q)._fl + fl | 0; + (this || _global$q)._gl = (this || _global$q)._gl + gl | 0; + (this || _global$q)._hl = (this || _global$q)._hl + hl | 0; + (this || _global$q)._ah = (this || _global$q)._ah + ah + getCarry((this || _global$q)._al, al) | 0; + (this || _global$q)._bh = (this || _global$q)._bh + bh + getCarry((this || _global$q)._bl, bl) | 0; + (this || _global$q)._ch = (this || _global$q)._ch + ch + getCarry((this || _global$q)._cl, cl) | 0; + (this || _global$q)._dh = (this || _global$q)._dh + dh + getCarry((this || _global$q)._dl, dl) | 0; + (this || _global$q)._eh = (this || _global$q)._eh + eh + getCarry((this || _global$q)._el, el) | 0; + (this || _global$q)._fh = (this || _global$q)._fh + fh + getCarry((this || _global$q)._fl, fl) | 0; + (this || _global$q)._gh = (this || _global$q)._gh + gh + getCarry((this || _global$q)._gl, gl) | 0; + (this || _global$q)._hh = (this || _global$q)._hh + hh + getCarry((this || _global$q)._hl, hl) | 0; + }; + Sha512.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(64); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$q)._ah, (this || _global$q)._al, 0); + writeInt64BE((this || _global$q)._bh, (this || _global$q)._bl, 8); + writeInt64BE((this || _global$q)._ch, (this || _global$q)._cl, 16); + writeInt64BE((this || _global$q)._dh, (this || _global$q)._dl, 24); + writeInt64BE((this || _global$q)._eh, (this || _global$q)._el, 32); + writeInt64BE((this || _global$q)._fh, (this || _global$q)._fl, 40); + writeInt64BE((this || _global$q)._gh, (this || _global$q)._gl, 48); + writeInt64BE((this || _global$q)._hh, (this || _global$q)._hl, 56); + return H5; + }; + exports$1K = Sha512; + return exports$1K; +} +function dew$1I() { + if (_dewExec$1I) + return exports$1J; + _dewExec$1I = true; + var inherits2 = dew$f$2(); + var SHA512 = dew$1J(); + var Hash3 = dew$1O(); + var Buffer4 = dew$1T().Buffer; + var W5 = new Array(160); + function Sha384() { + this.init(); + (this || _global$p)._w = W5; + Hash3.call(this || _global$p, 128, 112); + } + inherits2(Sha384, SHA512); + Sha384.prototype.init = function() { + (this || _global$p)._ah = 3418070365; + (this || _global$p)._bh = 1654270250; + (this || _global$p)._ch = 2438529370; + (this || _global$p)._dh = 355462360; + (this || _global$p)._eh = 1731405415; + (this || _global$p)._fh = 2394180231; + (this || _global$p)._gh = 3675008525; + (this || _global$p)._hh = 1203062813; + (this || _global$p)._al = 3238371032; + (this || _global$p)._bl = 914150663; + (this || _global$p)._cl = 812702999; + (this || _global$p)._dl = 4144912697; + (this || _global$p)._el = 4290775857; + (this || _global$p)._fl = 1750603025; + (this || _global$p)._gl = 1694076839; + (this || _global$p)._hl = 3204075428; + return this || _global$p; + }; + Sha384.prototype._hash = function() { + var H5 = Buffer4.allocUnsafe(48); + function writeInt64BE(h8, l7, offset) { + H5.writeInt32BE(h8, offset); + H5.writeInt32BE(l7, offset + 4); + } + writeInt64BE((this || _global$p)._ah, (this || _global$p)._al, 0); + writeInt64BE((this || _global$p)._bh, (this || _global$p)._bl, 8); + writeInt64BE((this || _global$p)._ch, (this || _global$p)._cl, 16); + writeInt64BE((this || _global$p)._dh, (this || _global$p)._dl, 24); + writeInt64BE((this || _global$p)._eh, (this || _global$p)._el, 32); + writeInt64BE((this || _global$p)._fh, (this || _global$p)._fl, 40); + return H5; + }; + exports$1J = Sha384; + return exports$1J; +} +function dew$1H() { + if (_dewExec$1H) + return module$7.exports; + _dewExec$1H = true; + var exports28 = module$7.exports = function SHA(algorithm) { + algorithm = algorithm.toLowerCase(); + var Algorithm = exports28[algorithm]; + if (!Algorithm) + throw new Error(algorithm + " is not supported (we accept pull requests)"); + return new Algorithm(); + }; + exports28.sha = dew$1N(); + exports28.sha1 = dew$1M(); + exports28.sha224 = dew$1K(); + exports28.sha256 = dew$1L(); + exports28.sha384 = dew$1I(); + exports28.sha512 = dew$1J(); + return module$7.exports; +} +function n$q(e10, n7, r8) { + r8 || (r8 = Error); + class o7 extends r8 { + constructor(e11, t8, r9) { + super(function(e12, t9, r10) { + return "string" == typeof n7 ? n7 : n7(e12, t9, r10); + }(e11, t8, r9)); + } + } + o7.prototype.name = r8.name, o7.prototype.code = e10, t$c[e10] = o7; +} +function r$h(e10, t8) { + if (Array.isArray(e10)) { + const n7 = e10.length; + return e10 = e10.map((e11) => String(e11)), n7 > 2 ? `one of ${t8} ${e10.slice(0, n7 - 1).join(", ")}, or ` + e10[n7 - 1] : 2 === n7 ? `one of ${t8} ${e10[0]} or ${e10[1]}` : `of ${t8} ${e10[0]}`; + } + return `of ${t8} ${String(e10)}`; +} +function e$2$1(e10) { + try { + if (!r$2$1.localStorage) + return false; + } catch (r8) { + return false; + } + var t8 = r$2$1.localStorage[e10]; + return null != t8 && "true" === String(t8).toLowerCase(); +} +function u$p(e10, t8) { + var n7 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var r8 = Object.getOwnPropertySymbols(e10); + t8 && (r8 = r8.filter(function(t9) { + return Object.getOwnPropertyDescriptor(e10, t9).enumerable; + })), n7.push.apply(n7, r8); + } + return n7; +} +function f$v(e10, t8, n7) { + return t8 in e10 ? Object.defineProperty(e10, t8, { value: n7, enumerable: true, configurable: true, writable: true }) : e10[t8] = n7, e10; +} +function h$l(e10, t8) { + for (var n7 = 0; n7 < t8.length; n7++) { + var r8 = t8[n7]; + r8.enumerable = r8.enumerable || false, r8.configurable = true, "value" in r8 && (r8.writable = true), Object.defineProperty(e10, r8.key, r8); + } +} +function w$j(e10, t8) { + _$h(e10, t8), v$k(e10); +} +function v$k(e10) { + e10._writableState && !e10._writableState.emitClose || e10._readableState && !e10._readableState.emitClose || e10.emit("close"); +} +function _$h(e10, t8) { + e10.emit("error", t8); +} +function E$e() { +} +function T$8(e10, t8, n7) { + return t8 in e10 ? Object.defineProperty(e10, t8, { value: n7, enumerable: true, configurable: true, writable: true }) : e10[t8] = n7, e10; +} +function B$c(e10, t8) { + return { value: e10, done: t8 }; +} +function I$b(e10) { + var t8 = e10[x$a]; + if (null !== t8) { + var n7 = e10[W$5].read(); + null !== n7 && (e10[A$c] = null, e10[x$a] = null, e10[L$8] = null, t8(B$c(n7, false))); + } +} +function N$7(e10) { + O$8.nextTick(I$b, e10); +} +function K$8() { + if (G$5) + return V$6; + G$5 = true; + var d7, u7 = T$1; + V$6 = C6, C6.ReadableState = D6; + y.EventEmitter; + var f8 = function(e10, t8) { + return e10.listeners(t8).length; + }, h8 = e$g, c7 = e$1$1.Buffer, b8 = Y$4.Uint8Array || function() { + }; + var p7, y7 = X2; + p7 = y7 && y7.debuglog ? y7.debuglog("stream") : function() { + }; + var w6, v8, _6, S6 = g$h, k6 = m$m, E6 = R$7.getHighWaterMark, M6 = e$1$12.codes, j6 = M6.ERR_INVALID_ARG_TYPE, O7 = M6.ERR_STREAM_PUSH_AFTER_EOF, T6 = M6.ERR_METHOD_NOT_IMPLEMENTED, P6 = M6.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + t$2(C6, h8); + var x7 = k6.errorOrDestroy, L6 = ["error", "close", "destroy", "pause", "resume"]; + function D6(e10, t8, n7) { + d7 = d7 || ee$1(), e10 = e10 || {}, "boolean" != typeof n7 && (n7 = t8 instanceof d7), this.objectMode = !!e10.objectMode, n7 && (this.objectMode = this.objectMode || !!e10.readableObjectMode), this.highWaterMark = E6(this, e10, "readableHighWaterMark", n7), this.buffer = new S6(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = false, this.endEmitted = false, this.reading = false, this.sync = true, this.needReadable = false, this.emittedReadable = false, this.readableListening = false, this.resumeScheduled = false, this.paused = true, this.emitClose = false !== e10.emitClose, this.autoDestroy = !!e10.autoDestroy, this.destroyed = false, this.defaultEncoding = e10.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = false, this.decoder = null, this.encoding = null, e10.encoding && (w6 || (w6 = e$12.StringDecoder), this.decoder = new w6(e10.encoding), this.encoding = e10.encoding); + } + function C6(e10) { + if (d7 = d7 || ee$1(), !(this instanceof C6)) + return new C6(e10); + var t8 = this instanceof d7; + this._readableState = new D6(e10, this, t8), this.readable = true, e10 && ("function" == typeof e10.read && (this._read = e10.read), "function" == typeof e10.destroy && (this._destroy = e10.destroy)), h8.call(this); + } + function A6(e10, t8, n7, r8, i7) { + p7("readableAddChunk", t8); + var a7, o7 = e10._readableState; + if (null === t8) + o7.reading = false, function(e11, t9) { + if (p7("onEofChunk"), t9.ended) + return; + if (t9.decoder) { + var n8 = t9.decoder.end(); + n8 && n8.length && (t9.buffer.push(n8), t9.length += t9.objectMode ? 1 : n8.length); + } + t9.ended = true, t9.sync ? B6(e11) : (t9.needReadable = false, t9.emittedReadable || (t9.emittedReadable = true, I6(e11))); + }(e10, o7); + else if (i7 || (a7 = function(e11, t9) { + var n8; + r9 = t9, c7.isBuffer(r9) || r9 instanceof b8 || "string" == typeof t9 || void 0 === t9 || e11.objectMode || (n8 = new j6("chunk", ["string", "Buffer", "Uint8Array"], t9)); + var r9; + return n8; + }(o7, t8)), a7) + x7(e10, a7); + else if (o7.objectMode || t8 && t8.length > 0) + if ("string" == typeof t8 || o7.objectMode || Object.getPrototypeOf(t8) === c7.prototype || (t8 = function(e11) { + return c7.from(e11); + }(t8)), r8) + o7.endEmitted ? x7(e10, new P6()) : q5(e10, o7, t8, true); + else if (o7.ended) + x7(e10, new O7()); + else { + if (o7.destroyed) + return false; + o7.reading = false, o7.decoder && !n7 ? (t8 = o7.decoder.write(t8), o7.objectMode || 0 !== t8.length ? q5(e10, o7, t8, false) : N6(e10, o7)) : q5(e10, o7, t8, false); + } + else + r8 || (o7.reading = false, N6(e10, o7)); + return !o7.ended && (o7.length < o7.highWaterMark || 0 === o7.length); + } + function q5(e10, t8, n7, r8) { + t8.flowing && 0 === t8.length && !t8.sync ? (t8.awaitDrain = 0, e10.emit("data", n7)) : (t8.length += t8.objectMode ? 1 : n7.length, r8 ? t8.buffer.unshift(n7) : t8.buffer.push(n7), t8.needReadable && B6(e10)), N6(e10, t8); + } + Object.defineProperty(C6.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && this._readableState.destroyed; + }, set: function(e10) { + this._readableState && (this._readableState.destroyed = e10); + } }), C6.prototype.destroy = k6.destroy, C6.prototype._undestroy = k6.undestroy, C6.prototype._destroy = function(e10, t8) { + t8(e10); + }, C6.prototype.push = function(e10, t8) { + var n7, r8 = this._readableState; + return r8.objectMode ? n7 = true : "string" == typeof e10 && ((t8 = t8 || r8.defaultEncoding) !== r8.encoding && (e10 = c7.from(e10, t8), t8 = ""), n7 = true), A6(this, e10, t8, false, n7); + }, C6.prototype.unshift = function(e10) { + return A6(this, e10, null, true, false); + }, C6.prototype.isPaused = function() { + return false === this._readableState.flowing; + }, C6.prototype.setEncoding = function(e10) { + w6 || (w6 = e$12.StringDecoder); + var t8 = new w6(e10); + this._readableState.decoder = t8, this._readableState.encoding = this._readableState.decoder.encoding; + for (var n7 = this._readableState.buffer.head, r8 = ""; null !== n7; ) + r8 += t8.write(n7.data), n7 = n7.next; + return this._readableState.buffer.clear(), "" !== r8 && this._readableState.buffer.push(r8), this._readableState.length = r8.length, this; + }; + function W5(e10, t8) { + return e10 <= 0 || 0 === t8.length && t8.ended ? 0 : t8.objectMode ? 1 : e10 != e10 ? t8.flowing && t8.length ? t8.buffer.head.data.length : t8.length : (e10 > t8.highWaterMark && (t8.highWaterMark = function(e11) { + return e11 >= 1073741824 ? e11 = 1073741824 : (e11--, e11 |= e11 >>> 1, e11 |= e11 >>> 2, e11 |= e11 >>> 4, e11 |= e11 >>> 8, e11 |= e11 >>> 16, e11++), e11; + }(e10)), e10 <= t8.length ? e10 : t8.ended ? t8.length : (t8.needReadable = true, 0)); + } + function B6(e10) { + var t8 = e10._readableState; + p7("emitReadable", t8.needReadable, t8.emittedReadable), t8.needReadable = false, t8.emittedReadable || (p7("emitReadable", t8.flowing), t8.emittedReadable = true, u7.nextTick(I6, e10)); + } + function I6(e10) { + var t8 = e10._readableState; + p7("emitReadable_", t8.destroyed, t8.length, t8.ended), t8.destroyed || !t8.length && !t8.ended || (e10.emit("readable"), t8.emittedReadable = false), t8.needReadable = !t8.flowing && !t8.ended && t8.length <= t8.highWaterMark, J5(e10); + } + function N6(e10, t8) { + t8.readingMore || (t8.readingMore = true, u7.nextTick(U6, e10, t8)); + } + function U6(e10, t8) { + for (; !t8.reading && !t8.ended && (t8.length < t8.highWaterMark || t8.flowing && 0 === t8.length); ) { + var n7 = t8.length; + if (p7("maybeReadMore read 0"), e10.read(0), n7 === t8.length) + break; + } + t8.readingMore = false; + } + function H5(e10) { + var t8 = e10._readableState; + t8.readableListening = e10.listenerCount("readable") > 0, t8.resumeScheduled && !t8.paused ? t8.flowing = true : e10.listenerCount("data") > 0 && e10.resume(); + } + function K5(e10) { + p7("readable nexttick read 0"), e10.read(0); + } + function z6(e10, t8) { + p7("resume", t8.reading), t8.reading || e10.read(0), t8.resumeScheduled = false, e10.emit("resume"), J5(e10), t8.flowing && !t8.reading && e10.read(0); + } + function J5(e10) { + var t8 = e10._readableState; + for (p7("flow", t8.flowing); t8.flowing && null !== e10.read(); ) + ; + } + function Q5(e10, t8) { + return 0 === t8.length ? null : (t8.objectMode ? n7 = t8.buffer.shift() : !e10 || e10 >= t8.length ? (n7 = t8.decoder ? t8.buffer.join("") : 1 === t8.buffer.length ? t8.buffer.first() : t8.buffer.concat(t8.length), t8.buffer.clear()) : n7 = t8.buffer.consume(e10, t8.decoder), n7); + var n7; + } + function X5(e10) { + var t8 = e10._readableState; + p7("endReadable", t8.endEmitted), t8.endEmitted || (t8.ended = true, u7.nextTick(Z5, t8, e10)); + } + function Z5(e10, t8) { + if (p7("endReadableNT", e10.endEmitted, e10.length), !e10.endEmitted && 0 === e10.length && (e10.endEmitted = true, t8.readable = false, t8.emit("end"), e10.autoDestroy)) { + var n7 = t8._writableState; + (!n7 || n7.autoDestroy && n7.finished) && t8.destroy(); + } + } + function $5(e10, t8) { + for (var n7 = 0, r8 = e10.length; n7 < r8; n7++) + if (e10[n7] === t8) + return n7; + return -1; + } + return C6.prototype.read = function(e10) { + p7("read", e10), e10 = parseInt(e10, 10); + var t8 = this._readableState, n7 = e10; + if (0 !== e10 && (t8.emittedReadable = false), 0 === e10 && t8.needReadable && ((0 !== t8.highWaterMark ? t8.length >= t8.highWaterMark : t8.length > 0) || t8.ended)) + return p7("read: emitReadable", t8.length, t8.ended), 0 === t8.length && t8.ended ? X5(this) : B6(this), null; + if (0 === (e10 = W5(e10, t8)) && t8.ended) + return 0 === t8.length && X5(this), null; + var r8, i7 = t8.needReadable; + return p7("need readable", i7), (0 === t8.length || t8.length - e10 < t8.highWaterMark) && p7("length less than watermark", i7 = true), t8.ended || t8.reading ? p7("reading or ended", i7 = false) : i7 && (p7("do read"), t8.reading = true, t8.sync = true, 0 === t8.length && (t8.needReadable = true), this._read(t8.highWaterMark), t8.sync = false, t8.reading || (e10 = W5(n7, t8))), null === (r8 = e10 > 0 ? Q5(e10, t8) : null) ? (t8.needReadable = t8.length <= t8.highWaterMark, e10 = 0) : (t8.length -= e10, t8.awaitDrain = 0), 0 === t8.length && (t8.ended || (t8.needReadable = true), n7 !== e10 && t8.ended && X5(this)), null !== r8 && this.emit("data", r8), r8; + }, C6.prototype._read = function(e10) { + x7(this, new T6("_read()")); + }, C6.prototype.pipe = function(e10, t8) { + var n7 = this, r8 = this._readableState; + switch (r8.pipesCount) { + case 0: + r8.pipes = e10; + break; + case 1: + r8.pipes = [r8.pipes, e10]; + break; + default: + r8.pipes.push(e10); + } + r8.pipesCount += 1, p7("pipe count=%d opts=%j", r8.pipesCount, t8); + var i7 = (!t8 || false !== t8.end) && e10 !== u7.stdout && e10 !== u7.stderr ? o7 : g7; + function a7(t9, i8) { + p7("onunpipe"), t9 === n7 && i8 && false === i8.hasUnpiped && (i8.hasUnpiped = true, p7("cleanup"), e10.removeListener("close", c8), e10.removeListener("finish", b9), e10.removeListener("drain", s7), e10.removeListener("error", h9), e10.removeListener("unpipe", a7), n7.removeListener("end", o7), n7.removeListener("end", g7), n7.removeListener("data", d8), l7 = true, !r8.awaitDrain || e10._writableState && !e10._writableState.needDrain || s7()); + } + function o7() { + p7("onend"), e10.end(); + } + r8.endEmitted ? u7.nextTick(i7) : n7.once("end", i7), e10.on("unpipe", a7); + var s7 = /* @__PURE__ */ function(e11) { + return function() { + var t9 = e11._readableState; + p7("pipeOnDrain", t9.awaitDrain), t9.awaitDrain && t9.awaitDrain--, 0 === t9.awaitDrain && f8(e11, "data") && (t9.flowing = true, J5(e11)); + }; + }(n7); + e10.on("drain", s7); + var l7 = false; + function d8(t9) { + p7("ondata"); + var i8 = e10.write(t9); + p7("dest.write", i8), false === i8 && ((1 === r8.pipesCount && r8.pipes === e10 || r8.pipesCount > 1 && -1 !== $5(r8.pipes, e10)) && !l7 && (p7("false write response, pause", r8.awaitDrain), r8.awaitDrain++), n7.pause()); + } + function h9(t9) { + p7("onerror", t9), g7(), e10.removeListener("error", h9), 0 === f8(e10, "error") && x7(e10, t9); + } + function c8() { + e10.removeListener("finish", b9), g7(); + } + function b9() { + p7("onfinish"), e10.removeListener("close", c8), g7(); + } + function g7() { + p7("unpipe"), n7.unpipe(e10); + } + return n7.on("data", d8), function(e11, t9, n8) { + if ("function" == typeof e11.prependListener) + return e11.prependListener(t9, n8); + e11._events && e11._events[t9] ? Array.isArray(e11._events[t9]) ? e11._events[t9].unshift(n8) : e11._events[t9] = [n8, e11._events[t9]] : e11.on(t9, n8); + }(e10, "error", h9), e10.once("close", c8), e10.once("finish", b9), e10.emit("pipe", n7), r8.flowing || (p7("pipe resume"), n7.resume()), e10; + }, C6.prototype.unpipe = function(e10) { + var t8 = this._readableState, n7 = { hasUnpiped: false }; + if (0 === t8.pipesCount) + return this; + if (1 === t8.pipesCount) + return e10 && e10 !== t8.pipes || (e10 || (e10 = t8.pipes), t8.pipes = null, t8.pipesCount = 0, t8.flowing = false, e10 && e10.emit("unpipe", this, n7)), this; + if (!e10) { + var r8 = t8.pipes, i7 = t8.pipesCount; + t8.pipes = null, t8.pipesCount = 0, t8.flowing = false; + for (var a7 = 0; a7 < i7; a7++) + r8[a7].emit("unpipe", this, { hasUnpiped: false }); + return this; + } + var o7 = $5(t8.pipes, e10); + return -1 === o7 || (t8.pipes.splice(o7, 1), t8.pipesCount -= 1, 1 === t8.pipesCount && (t8.pipes = t8.pipes[0]), e10.emit("unpipe", this, n7)), this; + }, C6.prototype.on = function(e10, t8) { + var n7 = h8.prototype.on.call(this, e10, t8), r8 = this._readableState; + return "data" === e10 ? (r8.readableListening = this.listenerCount("readable") > 0, false !== r8.flowing && this.resume()) : "readable" === e10 && (r8.endEmitted || r8.readableListening || (r8.readableListening = r8.needReadable = true, r8.flowing = false, r8.emittedReadable = false, p7("on readable", r8.length, r8.reading), r8.length ? B6(this) : r8.reading || u7.nextTick(K5, this))), n7; + }, C6.prototype.addListener = C6.prototype.on, C6.prototype.removeListener = function(e10, t8) { + var n7 = h8.prototype.removeListener.call(this, e10, t8); + return "readable" === e10 && u7.nextTick(H5, this), n7; + }, C6.prototype.removeAllListeners = function(e10) { + var t8 = h8.prototype.removeAllListeners.apply(this, arguments); + return "readable" !== e10 && void 0 !== e10 || u7.nextTick(H5, this), t8; + }, C6.prototype.resume = function() { + var e10 = this._readableState; + return e10.flowing || (p7("resume"), e10.flowing = !e10.readableListening, function(e11, t8) { + t8.resumeScheduled || (t8.resumeScheduled = true, u7.nextTick(z6, e11, t8)); + }(this, e10)), e10.paused = false, this; + }, C6.prototype.pause = function() { + return p7("call pause flowing=%j", this._readableState.flowing), false !== this._readableState.flowing && (p7("pause"), this._readableState.flowing = false, this.emit("pause")), this._readableState.paused = true, this; + }, C6.prototype.wrap = function(e10) { + var t8 = this, n7 = this._readableState, r8 = false; + for (var i7 in e10.on("end", function() { + if (p7("wrapped end"), n7.decoder && !n7.ended) { + var e11 = n7.decoder.end(); + e11 && e11.length && t8.push(e11); + } + t8.push(null); + }), e10.on("data", function(i8) { + (p7("wrapped data"), n7.decoder && (i8 = n7.decoder.write(i8)), n7.objectMode && null == i8) || (n7.objectMode || i8 && i8.length) && (t8.push(i8) || (r8 = true, e10.pause())); + }), e10) + void 0 === this[i7] && "function" == typeof e10[i7] && (this[i7] = /* @__PURE__ */ function(t9) { + return function() { + return e10[t9].apply(e10, arguments); + }; + }(i7)); + for (var a7 = 0; a7 < L6.length; a7++) + e10.on(L6[a7], this.emit.bind(this, L6[a7])); + return this._read = function(t9) { + p7("wrapped _read", t9), r8 && (r8 = false, e10.resume()); + }, this; + }, "function" == typeof Symbol && (C6.prototype[Symbol.asyncIterator] = function() { + return void 0 === v8 && (v8 = F$8), v8(this); + }), Object.defineProperty(C6.prototype, "readableHighWaterMark", { enumerable: false, get: function() { + return this._readableState.highWaterMark; + } }), Object.defineProperty(C6.prototype, "readableBuffer", { enumerable: false, get: function() { + return this._readableState && this._readableState.buffer; + } }), Object.defineProperty(C6.prototype, "readableFlowing", { enumerable: false, get: function() { + return this._readableState.flowing; + }, set: function(e10) { + this._readableState && (this._readableState.flowing = e10); + } }), C6._fromList = Q5, Object.defineProperty(C6.prototype, "readableLength", { enumerable: false, get: function() { + return this._readableState.length; + } }), "function" == typeof Symbol && (C6.from = function(e10, t8) { + return void 0 === _6 && (_6 = r$1$1), _6(C6, e10, t8); + }), V$6; +} +function X$4() { + if (J$5) + return z$9; + J$5 = true; + var e$25, r8 = T$1; + function s7(e10) { + var t8 = this; + this.next = null, this.entry = null, this.finish = function() { + !function(e11, t9, n7) { + var r9 = e11.entry; + e11.entry = null; + for (; r9; ) { + var i7 = r9.callback; + t9.pendingcb--, i7(n7), r9 = r9.next; + } + t9.corkedRequestsFree.next = e11; + }(t8, e10); + }; + } + z$9 = P6, P6.WritableState = T6; + var l7 = { deprecate: t$1$1 }, u7 = e$g, f8 = e$1$1.Buffer, h8 = Q$4.Uint8Array || function() { + }; + var c7, b8 = m$m, p7 = R$7.getHighWaterMark, g7 = e$1$12.codes, y7 = g7.ERR_INVALID_ARG_TYPE, w6 = g7.ERR_METHOD_NOT_IMPLEMENTED, v8 = g7.ERR_MULTIPLE_CALLBACK, _6 = g7.ERR_STREAM_CANNOT_PIPE, S6 = g7.ERR_STREAM_DESTROYED, k6 = g7.ERR_STREAM_NULL_VALUES, E6 = g7.ERR_STREAM_WRITE_AFTER_END, M6 = g7.ERR_UNKNOWN_ENCODING, j6 = b8.errorOrDestroy; + function O7() { + } + function T6(t8, n7, i7) { + e$25 = e$25 || ee$1(), t8 = t8 || {}, "boolean" != typeof i7 && (i7 = n7 instanceof e$25), this.objectMode = !!t8.objectMode, i7 && (this.objectMode = this.objectMode || !!t8.writableObjectMode), this.highWaterMark = p7(this, t8, "writableHighWaterMark", i7), this.finalCalled = false, this.needDrain = false, this.ending = false, this.ended = false, this.finished = false, this.destroyed = false; + var a7 = false === t8.decodeStrings; + this.decodeStrings = !a7, this.defaultEncoding = t8.defaultEncoding || "utf8", this.length = 0, this.writing = false, this.corked = 0, this.sync = true, this.bufferProcessing = false, this.onwrite = function(e10) { + !function(e11, t9) { + var n8 = e11._writableState, i8 = n8.sync, a8 = n8.writecb; + if ("function" != typeof a8) + throw new v8(); + if (function(e12) { + e12.writing = false, e12.writecb = null, e12.length -= e12.writelen, e12.writelen = 0; + }(n8), t9) + !function(e12, t10, n9, i9, a9) { + --t10.pendingcb, n9 ? (r8.nextTick(a9, i9), r8.nextTick(q5, e12, t10), e12._writableState.errorEmitted = true, j6(e12, i9)) : (a9(i9), e12._writableState.errorEmitted = true, j6(e12, i9), q5(e12, t10)); + }(e11, n8, i8, t9, a8); + else { + var o7 = C6(n8) || e11.destroyed; + o7 || n8.corked || n8.bufferProcessing || !n8.bufferedRequest || D6(e11, n8), i8 ? r8.nextTick(L6, e11, n8, o7, a8) : L6(e11, n8, o7, a8); + } + }(n7, e10); + }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = false, this.errorEmitted = false, this.emitClose = false !== t8.emitClose, this.autoDestroy = !!t8.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new s7(this); + } + function P6(t8) { + var n7 = this instanceof (e$25 = e$25 || ee$1()); + if (!n7 && !c7.call(P6, this)) + return new P6(t8); + this._writableState = new T6(t8, this, n7), this.writable = true, t8 && ("function" == typeof t8.write && (this._write = t8.write), "function" == typeof t8.writev && (this._writev = t8.writev), "function" == typeof t8.destroy && (this._destroy = t8.destroy), "function" == typeof t8.final && (this._final = t8.final)), u7.call(this); + } + function x7(e10, t8, n7, r9, i7, a7, o7) { + t8.writelen = r9, t8.writecb = o7, t8.writing = true, t8.sync = true, t8.destroyed ? t8.onwrite(new S6("write")) : n7 ? e10._writev(i7, t8.onwrite) : e10._write(i7, a7, t8.onwrite), t8.sync = false; + } + function L6(e10, t8, n7, r9) { + n7 || !function(e11, t9) { + 0 === t9.length && t9.needDrain && (t9.needDrain = false, e11.emit("drain")); + }(e10, t8), t8.pendingcb--, r9(), q5(e10, t8); + } + function D6(e10, t8) { + t8.bufferProcessing = true; + var n7 = t8.bufferedRequest; + if (e10._writev && n7 && n7.next) { + var r9 = t8.bufferedRequestCount, i7 = new Array(r9), a7 = t8.corkedRequestsFree; + a7.entry = n7; + for (var o7 = 0, l8 = true; n7; ) + i7[o7] = n7, n7.isBuf || (l8 = false), n7 = n7.next, o7 += 1; + i7.allBuffers = l8, x7(e10, t8, true, t8.length, i7, "", a7.finish), t8.pendingcb++, t8.lastBufferedRequest = null, a7.next ? (t8.corkedRequestsFree = a7.next, a7.next = null) : t8.corkedRequestsFree = new s7(t8), t8.bufferedRequestCount = 0; + } else { + for (; n7; ) { + var d7 = n7.chunk, u8 = n7.encoding, f9 = n7.callback; + if (x7(e10, t8, false, t8.objectMode ? 1 : d7.length, d7, u8, f9), n7 = n7.next, t8.bufferedRequestCount--, t8.writing) + break; + } + null === n7 && (t8.lastBufferedRequest = null); + } + t8.bufferedRequest = n7, t8.bufferProcessing = false; + } + function C6(e10) { + return e10.ending && 0 === e10.length && null === e10.bufferedRequest && !e10.finished && !e10.writing; + } + function A6(e10, t8) { + e10._final(function(n7) { + t8.pendingcb--, n7 && j6(e10, n7), t8.prefinished = true, e10.emit("prefinish"), q5(e10, t8); + }); + } + function q5(e10, t8) { + var n7 = C6(t8); + if (n7 && (!function(e11, t9) { + t9.prefinished || t9.finalCalled || ("function" != typeof e11._final || t9.destroyed ? (t9.prefinished = true, e11.emit("prefinish")) : (t9.pendingcb++, t9.finalCalled = true, r8.nextTick(A6, e11, t9))); + }(e10, t8), 0 === t8.pendingcb && (t8.finished = true, e10.emit("finish"), t8.autoDestroy))) { + var i7 = e10._readableState; + (!i7 || i7.autoDestroy && i7.endEmitted) && e10.destroy(); + } + return n7; + } + return t$2(P6, u7), T6.prototype.getBuffer = function() { + for (var e10 = this.bufferedRequest, t8 = []; e10; ) + t8.push(e10), e10 = e10.next; + return t8; + }, function() { + try { + Object.defineProperty(T6.prototype, "buffer", { get: l7.deprecate(function() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); + } catch (e10) { + } + }(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (c7 = Function.prototype[Symbol.hasInstance], Object.defineProperty(P6, Symbol.hasInstance, { value: function(e10) { + return !!c7.call(this, e10) || this === P6 && (e10 && e10._writableState instanceof T6); + } })) : c7 = function(e10) { + return e10 instanceof this; + }, P6.prototype.pipe = function() { + j6(this, new _6()); + }, P6.prototype.write = function(e10, t8, n7) { + var i7, a7 = this._writableState, o7 = false, s8 = !a7.objectMode && (i7 = e10, f8.isBuffer(i7) || i7 instanceof h8); + return s8 && !f8.isBuffer(e10) && (e10 = function(e11) { + return f8.from(e11); + }(e10)), "function" == typeof t8 && (n7 = t8, t8 = null), s8 ? t8 = "buffer" : t8 || (t8 = a7.defaultEncoding), "function" != typeof n7 && (n7 = O7), a7.ending ? function(e11, t9) { + var n8 = new E6(); + j6(e11, n8), r8.nextTick(t9, n8); + }(this, n7) : (s8 || function(e11, t9, n8, i8) { + var a8; + return null === n8 ? a8 = new k6() : "string" == typeof n8 || t9.objectMode || (a8 = new y7("chunk", ["string", "Buffer"], n8)), !a8 || (j6(e11, a8), r8.nextTick(i8, a8), false); + }(this, a7, e10, n7)) && (a7.pendingcb++, o7 = function(e11, t9, n8, r9, i8, a8) { + if (!n8) { + var o8 = function(e12, t10, n9) { + e12.objectMode || false === e12.decodeStrings || "string" != typeof t10 || (t10 = f8.from(t10, n9)); + return t10; + }(t9, r9, i8); + r9 !== o8 && (n8 = true, i8 = "buffer", r9 = o8); + } + var s9 = t9.objectMode ? 1 : r9.length; + t9.length += s9; + var l8 = t9.length < t9.highWaterMark; + l8 || (t9.needDrain = true); + if (t9.writing || t9.corked) { + var d7 = t9.lastBufferedRequest; + t9.lastBufferedRequest = { chunk: r9, encoding: i8, isBuf: n8, callback: a8, next: null }, d7 ? d7.next = t9.lastBufferedRequest : t9.bufferedRequest = t9.lastBufferedRequest, t9.bufferedRequestCount += 1; + } else + x7(e11, t9, false, s9, r9, i8, a8); + return l8; + }(this, a7, s8, e10, t8, n7)), o7; + }, P6.prototype.cork = function() { + this._writableState.corked++; + }, P6.prototype.uncork = function() { + var e10 = this._writableState; + e10.corked && (e10.corked--, e10.writing || e10.corked || e10.bufferProcessing || !e10.bufferedRequest || D6(this, e10)); + }, P6.prototype.setDefaultEncoding = function(e10) { + if ("string" == typeof e10 && (e10 = e10.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e10 + "").toLowerCase()) > -1)) + throw new M6(e10); + return this._writableState.defaultEncoding = e10, this; + }, Object.defineProperty(P6.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(P6.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), P6.prototype._write = function(e10, t8, n7) { + n7(new w6("_write()")); + }, P6.prototype._writev = null, P6.prototype.end = function(e10, t8, n7) { + var i7 = this._writableState; + return "function" == typeof e10 ? (n7 = e10, e10 = null, t8 = null) : "function" == typeof t8 && (n7 = t8, t8 = null), null != e10 && this.write(e10, t8), i7.corked && (i7.corked = 1, this.uncork()), i7.ending || function(e11, t9, n8) { + t9.ending = true, q5(e11, t9), n8 && (t9.finished ? r8.nextTick(n8) : e11.once("finish", n8)); + t9.ended = true, e11.writable = false; + }(this, i7, n7), this; + }, Object.defineProperty(P6.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(P6.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._writableState && this._writableState.destroyed; + }, set: function(e10) { + this._writableState && (this._writableState.destroyed = e10); + } }), P6.prototype.destroy = b8.destroy, P6.prototype._undestroy = b8.undestroy, P6.prototype._destroy = function(e10, t8) { + t8(e10); + }, z$9; +} +function ee$1() { + if ($$3) + return Z$3; + $$3 = true; + var e10 = T$1, t8 = Object.keys || function(e11) { + var t9 = []; + for (var n8 in e11) + t9.push(n8); + return t9; + }; + Z$3 = d7; + var n7 = K$8(), r8 = X$4(); + t$2(d7, n7); + for (var a7 = t8(r8.prototype), s7 = 0; s7 < a7.length; s7++) { + var l7 = a7[s7]; + d7.prototype[l7] || (d7.prototype[l7] = r8.prototype[l7]); + } + function d7(e11) { + if (!(this instanceof d7)) + return new d7(e11); + n7.call(this, e11), r8.call(this, e11), this.allowHalfOpen = true, e11 && (false === e11.readable && (this.readable = false), false === e11.writable && (this.writable = false), false === e11.allowHalfOpen && (this.allowHalfOpen = false, this.once("end", u7))); + } + function u7() { + this._writableState.ended || e10.nextTick(f8, this); + } + function f8(e11) { + e11.end(); + } + return Object.defineProperty(d7.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), Object.defineProperty(d7.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(d7.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(d7.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed); + }, set: function(e11) { + void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = e11, this._writableState.destroyed = e11); + } }), Z$3; +} +function t$3$1() { +} +function f$1$1(e10, t8) { + var n7 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var r8 = Object.getOwnPropertySymbols(e10); + t8 && (r8 = r8.filter(function(t9) { + return Object.getOwnPropertyDescriptor(e10, t9).enumerable; + })), n7.push.apply(n7, r8); + } + return n7; +} +function h$1$12(e10, t8, n7) { + return t8 in e10 ? Object.defineProperty(e10, t8, { value: n7, enumerable: true, configurable: true, writable: true }) : e10[t8] = n7, e10; +} +function c$1$12(e10, t8) { + for (var n7 = 0; n7 < t8.length; n7++) { + var r8 = t8[n7]; + r8.enumerable = r8.enumerable || false, r8.configurable = true, "value" in r8 && (r8.writable = true), Object.defineProperty(e10, r8.key, r8); + } +} +function _$1$1(e10, t8) { + m$1$1(e10, t8), v$1$1(e10); +} +function v$1$1(e10) { + e10._writableState && !e10._writableState.emitClose || e10._readableState && !e10._readableState.emitClose || e10.emit("close"); +} +function m$1$1(e10, t8) { + e10.emit("error", t8); +} +function j$1$1(e10, t8, n7) { + return t8 in e10 ? Object.defineProperty(e10, t8, { value: n7, enumerable: true, configurable: true, writable: true }) : e10[t8] = n7, e10; +} +function W$1$1(e10, t8) { + return { value: e10, done: t8 }; +} +function B$1$1(e10) { + var t8 = e10[T$1$1]; + if (null !== t8) { + var n7 = e10[A$1$1].read(); + null !== n7 && (e10[L$1$1] = null, e10[T$1$1] = null, e10[x$1$1] = null, t8(W$1$1(n7, false))); + } +} +function q$1$1(e10) { + M$1$1.nextTick(B$1$1, e10); +} +function G$1$1() { + if (F$1$1) + return H$1$1; + F$1$1 = true; + var l7, u7 = T$1; + H$1$1 = C6, C6.ReadableState = L6; + y.EventEmitter; + var f8 = function(e10, t8) { + return e10.listeners(t8).length; + }, h8 = e$g, c7 = e$1$1.Buffer, b8 = V$1$1.Uint8Array || function() { + }; + var p7, g7 = X2; + p7 = g7 && g7.debuglog ? g7.debuglog("stream") : function() { + }; + var w6, _6, v8, m7 = y$1$1, R6 = S$1$1, k6 = E$1$1.getHighWaterMark, M6 = e$1$12.codes, j6 = M6.ERR_INVALID_ARG_TYPE, O7 = M6.ERR_STREAM_PUSH_AFTER_EOF, T6 = M6.ERR_METHOD_NOT_IMPLEMENTED, x7 = M6.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + t$2(C6, h8); + var P6 = R6.errorOrDestroy, D6 = ["error", "close", "destroy", "pause", "resume"]; + function L6(e10, t8, n7) { + l7 = l7 || Z$1$1(), e10 = e10 || {}, "boolean" != typeof n7 && (n7 = t8 instanceof l7), this.objectMode = !!e10.objectMode, n7 && (this.objectMode = this.objectMode || !!e10.readableObjectMode), this.highWaterMark = k6(this, e10, "readableHighWaterMark", n7), this.buffer = new m7(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = false, this.endEmitted = false, this.reading = false, this.sync = true, this.needReadable = false, this.emittedReadable = false, this.readableListening = false, this.resumeScheduled = false, this.paused = true, this.emitClose = false !== e10.emitClose, this.autoDestroy = !!e10.autoDestroy, this.destroyed = false, this.defaultEncoding = e10.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = false, this.decoder = null, this.encoding = null, e10.encoding && (w6 || (w6 = e$12.StringDecoder), this.decoder = new w6(e10.encoding), this.encoding = e10.encoding); + } + function C6(e10) { + if (l7 = l7 || Z$1$1(), !(this instanceof C6)) + return new C6(e10); + var t8 = this instanceof l7; + this._readableState = new L6(e10, this, t8), this.readable = true, e10 && ("function" == typeof e10.read && (this._read = e10.read), "function" == typeof e10.destroy && (this._destroy = e10.destroy)), h8.call(this); + } + function A6(e10, t8, n7, r8, i7) { + p7("readableAddChunk", t8); + var a7, o7 = e10._readableState; + if (null === t8) + o7.reading = false, function(e11, t9) { + if (p7("onEofChunk"), t9.ended) + return; + if (t9.decoder) { + var n8 = t9.decoder.end(); + n8 && n8.length && (t9.buffer.push(n8), t9.length += t9.objectMode ? 1 : n8.length); + } + t9.ended = true, t9.sync ? q5(e11) : (t9.needReadable = false, t9.emittedReadable || (t9.emittedReadable = true, I6(e11))); + }(e10, o7); + else if (i7 || (a7 = function(e11, t9) { + var n8; + r9 = t9, c7.isBuffer(r9) || r9 instanceof b8 || "string" == typeof t9 || void 0 === t9 || e11.objectMode || (n8 = new j6("chunk", ["string", "Buffer", "Uint8Array"], t9)); + var r9; + return n8; + }(o7, t8)), a7) + P6(e10, a7); + else if (o7.objectMode || t8 && t8.length > 0) + if ("string" == typeof t8 || o7.objectMode || Object.getPrototypeOf(t8) === c7.prototype || (t8 = function(e11) { + return c7.from(e11); + }(t8)), r8) + o7.endEmitted ? P6(e10, new x7()) : W5(e10, o7, t8, true); + else if (o7.ended) + P6(e10, new O7()); + else { + if (o7.destroyed) + return false; + o7.reading = false, o7.decoder && !n7 ? (t8 = o7.decoder.write(t8), o7.objectMode || 0 !== t8.length ? W5(e10, o7, t8, false) : N6(e10, o7)) : W5(e10, o7, t8, false); + } + else + r8 || (o7.reading = false, N6(e10, o7)); + return !o7.ended && (o7.length < o7.highWaterMark || 0 === o7.length); + } + function W5(e10, t8, n7, r8) { + t8.flowing && 0 === t8.length && !t8.sync ? (t8.awaitDrain = 0, e10.emit("data", n7)) : (t8.length += t8.objectMode ? 1 : n7.length, r8 ? t8.buffer.unshift(n7) : t8.buffer.push(n7), t8.needReadable && q5(e10)), N6(e10, t8); + } + Object.defineProperty(C6.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && this._readableState.destroyed; + }, set: function(e10) { + this._readableState && (this._readableState.destroyed = e10); + } }), C6.prototype.destroy = R6.destroy, C6.prototype._undestroy = R6.undestroy, C6.prototype._destroy = function(e10, t8) { + t8(e10); + }, C6.prototype.push = function(e10, t8) { + var n7, r8 = this._readableState; + return r8.objectMode ? n7 = true : "string" == typeof e10 && ((t8 = t8 || r8.defaultEncoding) !== r8.encoding && (e10 = c7.from(e10, t8), t8 = ""), n7 = true), A6(this, e10, t8, false, n7); + }, C6.prototype.unshift = function(e10) { + return A6(this, e10, null, true, false); + }, C6.prototype.isPaused = function() { + return false === this._readableState.flowing; + }, C6.prototype.setEncoding = function(e10) { + w6 || (w6 = e$12.StringDecoder); + var t8 = new w6(e10); + this._readableState.decoder = t8, this._readableState.encoding = this._readableState.decoder.encoding; + for (var n7 = this._readableState.buffer.head, r8 = ""; null !== n7; ) + r8 += t8.write(n7.data), n7 = n7.next; + return this._readableState.buffer.clear(), "" !== r8 && this._readableState.buffer.push(r8), this._readableState.length = r8.length, this; + }; + function B6(e10, t8) { + return e10 <= 0 || 0 === t8.length && t8.ended ? 0 : t8.objectMode ? 1 : e10 != e10 ? t8.flowing && t8.length ? t8.buffer.head.data.length : t8.length : (e10 > t8.highWaterMark && (t8.highWaterMark = function(e11) { + return e11 >= 1073741824 ? e11 = 1073741824 : (e11--, e11 |= e11 >>> 1, e11 |= e11 >>> 2, e11 |= e11 >>> 4, e11 |= e11 >>> 8, e11 |= e11 >>> 16, e11++), e11; + }(e10)), e10 <= t8.length ? e10 : t8.ended ? t8.length : (t8.needReadable = true, 0)); + } + function q5(e10) { + var t8 = e10._readableState; + p7("emitReadable", t8.needReadable, t8.emittedReadable), t8.needReadable = false, t8.emittedReadable || (p7("emitReadable", t8.flowing), t8.emittedReadable = true, u7.nextTick(I6, e10)); + } + function I6(e10) { + var t8 = e10._readableState; + p7("emitReadable_", t8.destroyed, t8.length, t8.ended), t8.destroyed || !t8.length && !t8.ended || (e10.emit("readable"), t8.emittedReadable = false), t8.needReadable = !t8.flowing && !t8.ended && t8.length <= t8.highWaterMark, J5(e10); + } + function N6(e10, t8) { + t8.readingMore || (t8.readingMore = true, u7.nextTick(G5, e10, t8)); + } + function G5(e10, t8) { + for (; !t8.reading && !t8.ended && (t8.length < t8.highWaterMark || t8.flowing && 0 === t8.length); ) { + var n7 = t8.length; + if (p7("maybeReadMore read 0"), e10.read(0), n7 === t8.length) + break; + } + t8.readingMore = false; + } + function Y6(e10) { + var t8 = e10._readableState; + t8.readableListening = e10.listenerCount("readable") > 0, t8.resumeScheduled && !t8.paused ? t8.flowing = true : e10.listenerCount("data") > 0 && e10.resume(); + } + function K5(e10) { + p7("readable nexttick read 0"), e10.read(0); + } + function z6(e10, t8) { + p7("resume", t8.reading), t8.reading || e10.read(0), t8.resumeScheduled = false, e10.emit("resume"), J5(e10), t8.flowing && !t8.reading && e10.read(0); + } + function J5(e10) { + var t8 = e10._readableState; + for (p7("flow", t8.flowing); t8.flowing && null !== e10.read(); ) + ; + } + function Q5(e10, t8) { + return 0 === t8.length ? null : (t8.objectMode ? n7 = t8.buffer.shift() : !e10 || e10 >= t8.length ? (n7 = t8.decoder ? t8.buffer.join("") : 1 === t8.buffer.length ? t8.buffer.first() : t8.buffer.concat(t8.length), t8.buffer.clear()) : n7 = t8.buffer.consume(e10, t8.decoder), n7); + var n7; + } + function X5(e10) { + var t8 = e10._readableState; + p7("endReadable", t8.endEmitted), t8.endEmitted || (t8.ended = true, u7.nextTick($5, t8, e10)); + } + function $5(e10, t8) { + if (p7("endReadableNT", e10.endEmitted, e10.length), !e10.endEmitted && 0 === e10.length && (e10.endEmitted = true, t8.readable = false, t8.emit("end"), e10.autoDestroy)) { + var n7 = t8._writableState; + (!n7 || n7.autoDestroy && n7.finished) && t8.destroy(); + } + } + function ee4(e10, t8) { + for (var n7 = 0, r8 = e10.length; n7 < r8; n7++) + if (e10[n7] === t8) + return n7; + return -1; + } + return C6.prototype.read = function(e10) { + p7("read", e10), e10 = parseInt(e10, 10); + var t8 = this._readableState, n7 = e10; + if (0 !== e10 && (t8.emittedReadable = false), 0 === e10 && t8.needReadable && ((0 !== t8.highWaterMark ? t8.length >= t8.highWaterMark : t8.length > 0) || t8.ended)) + return p7("read: emitReadable", t8.length, t8.ended), 0 === t8.length && t8.ended ? X5(this) : q5(this), null; + if (0 === (e10 = B6(e10, t8)) && t8.ended) + return 0 === t8.length && X5(this), null; + var r8, i7 = t8.needReadable; + return p7("need readable", i7), (0 === t8.length || t8.length - e10 < t8.highWaterMark) && p7("length less than watermark", i7 = true), t8.ended || t8.reading ? p7("reading or ended", i7 = false) : i7 && (p7("do read"), t8.reading = true, t8.sync = true, 0 === t8.length && (t8.needReadable = true), this._read(t8.highWaterMark), t8.sync = false, t8.reading || (e10 = B6(n7, t8))), null === (r8 = e10 > 0 ? Q5(e10, t8) : null) ? (t8.needReadable = t8.length <= t8.highWaterMark, e10 = 0) : (t8.length -= e10, t8.awaitDrain = 0), 0 === t8.length && (t8.ended || (t8.needReadable = true), n7 !== e10 && t8.ended && X5(this)), null !== r8 && this.emit("data", r8), r8; + }, C6.prototype._read = function(e10) { + P6(this, new T6("_read()")); + }, C6.prototype.pipe = function(e10, t8) { + var n7 = this, r8 = this._readableState; + switch (r8.pipesCount) { + case 0: + r8.pipes = e10; + break; + case 1: + r8.pipes = [r8.pipes, e10]; + break; + default: + r8.pipes.push(e10); + } + r8.pipesCount += 1, p7("pipe count=%d opts=%j", r8.pipesCount, t8); + var i7 = (!t8 || false !== t8.end) && e10 !== u7.stdout && e10 !== u7.stderr ? o7 : g8; + function a7(t9, i8) { + p7("onunpipe"), t9 === n7 && i8 && false === i8.hasUnpiped && (i8.hasUnpiped = true, p7("cleanup"), e10.removeListener("close", c8), e10.removeListener("finish", b9), e10.removeListener("drain", s7), e10.removeListener("error", h9), e10.removeListener("unpipe", a7), n7.removeListener("end", o7), n7.removeListener("end", g8), n7.removeListener("data", d7), l8 = true, !r8.awaitDrain || e10._writableState && !e10._writableState.needDrain || s7()); + } + function o7() { + p7("onend"), e10.end(); + } + r8.endEmitted ? u7.nextTick(i7) : n7.once("end", i7), e10.on("unpipe", a7); + var s7 = /* @__PURE__ */ function(e11) { + return function() { + var t9 = e11._readableState; + p7("pipeOnDrain", t9.awaitDrain), t9.awaitDrain && t9.awaitDrain--, 0 === t9.awaitDrain && f8(e11, "data") && (t9.flowing = true, J5(e11)); + }; + }(n7); + e10.on("drain", s7); + var l8 = false; + function d7(t9) { + p7("ondata"); + var i8 = e10.write(t9); + p7("dest.write", i8), false === i8 && ((1 === r8.pipesCount && r8.pipes === e10 || r8.pipesCount > 1 && -1 !== ee4(r8.pipes, e10)) && !l8 && (p7("false write response, pause", r8.awaitDrain), r8.awaitDrain++), n7.pause()); + } + function h9(t9) { + p7("onerror", t9), g8(), e10.removeListener("error", h9), 0 === f8(e10, "error") && P6(e10, t9); + } + function c8() { + e10.removeListener("finish", b9), g8(); + } + function b9() { + p7("onfinish"), e10.removeListener("close", c8), g8(); + } + function g8() { + p7("unpipe"), n7.unpipe(e10); + } + return n7.on("data", d7), function(e11, t9, n8) { + if ("function" == typeof e11.prependListener) + return e11.prependListener(t9, n8); + e11._events && e11._events[t9] ? Array.isArray(e11._events[t9]) ? e11._events[t9].unshift(n8) : e11._events[t9] = [n8, e11._events[t9]] : e11.on(t9, n8); + }(e10, "error", h9), e10.once("close", c8), e10.once("finish", b9), e10.emit("pipe", n7), r8.flowing || (p7("pipe resume"), n7.resume()), e10; + }, C6.prototype.unpipe = function(e10) { + var t8 = this._readableState, n7 = { hasUnpiped: false }; + if (0 === t8.pipesCount) + return this; + if (1 === t8.pipesCount) + return e10 && e10 !== t8.pipes || (e10 || (e10 = t8.pipes), t8.pipes = null, t8.pipesCount = 0, t8.flowing = false, e10 && e10.emit("unpipe", this, n7)), this; + if (!e10) { + var r8 = t8.pipes, i7 = t8.pipesCount; + t8.pipes = null, t8.pipesCount = 0, t8.flowing = false; + for (var a7 = 0; a7 < i7; a7++) + r8[a7].emit("unpipe", this, { hasUnpiped: false }); + return this; + } + var o7 = ee4(t8.pipes, e10); + return -1 === o7 || (t8.pipes.splice(o7, 1), t8.pipesCount -= 1, 1 === t8.pipesCount && (t8.pipes = t8.pipes[0]), e10.emit("unpipe", this, n7)), this; + }, C6.prototype.on = function(e10, t8) { + var n7 = h8.prototype.on.call(this, e10, t8), r8 = this._readableState; + return "data" === e10 ? (r8.readableListening = this.listenerCount("readable") > 0, false !== r8.flowing && this.resume()) : "readable" === e10 && (r8.endEmitted || r8.readableListening || (r8.readableListening = r8.needReadable = true, r8.flowing = false, r8.emittedReadable = false, p7("on readable", r8.length, r8.reading), r8.length ? q5(this) : r8.reading || u7.nextTick(K5, this))), n7; + }, C6.prototype.addListener = C6.prototype.on, C6.prototype.removeListener = function(e10, t8) { + var n7 = h8.prototype.removeListener.call(this, e10, t8); + return "readable" === e10 && u7.nextTick(Y6, this), n7; + }, C6.prototype.removeAllListeners = function(e10) { + var t8 = h8.prototype.removeAllListeners.apply(this, arguments); + return "readable" !== e10 && void 0 !== e10 || u7.nextTick(Y6, this), t8; + }, C6.prototype.resume = function() { + var e10 = this._readableState; + return e10.flowing || (p7("resume"), e10.flowing = !e10.readableListening, function(e11, t8) { + t8.resumeScheduled || (t8.resumeScheduled = true, u7.nextTick(z6, e11, t8)); + }(this, e10)), e10.paused = false, this; + }, C6.prototype.pause = function() { + return p7("call pause flowing=%j", this._readableState.flowing), false !== this._readableState.flowing && (p7("pause"), this._readableState.flowing = false, this.emit("pause")), this._readableState.paused = true, this; + }, C6.prototype.wrap = function(e10) { + var t8 = this, n7 = this._readableState, r8 = false; + for (var i7 in e10.on("end", function() { + if (p7("wrapped end"), n7.decoder && !n7.ended) { + var e11 = n7.decoder.end(); + e11 && e11.length && t8.push(e11); + } + t8.push(null); + }), e10.on("data", function(i8) { + (p7("wrapped data"), n7.decoder && (i8 = n7.decoder.write(i8)), n7.objectMode && null == i8) || (n7.objectMode || i8 && i8.length) && (t8.push(i8) || (r8 = true, e10.pause())); + }), e10) + void 0 === this[i7] && "function" == typeof e10[i7] && (this[i7] = /* @__PURE__ */ function(t9) { + return function() { + return e10[t9].apply(e10, arguments); + }; + }(i7)); + for (var a7 = 0; a7 < D6.length; a7++) + e10.on(D6[a7], this.emit.bind(this, D6[a7])); + return this._read = function(t9) { + p7("wrapped _read", t9), r8 && (r8 = false, e10.resume()); + }, this; + }, "function" == typeof Symbol && (C6.prototype[Symbol.asyncIterator] = function() { + return void 0 === _6 && (_6 = U$1$1), _6(this); + }), Object.defineProperty(C6.prototype, "readableHighWaterMark", { enumerable: false, get: function() { + return this._readableState.highWaterMark; + } }), Object.defineProperty(C6.prototype, "readableBuffer", { enumerable: false, get: function() { + return this._readableState && this._readableState.buffer; + } }), Object.defineProperty(C6.prototype, "readableFlowing", { enumerable: false, get: function() { + return this._readableState.flowing; + }, set: function(e10) { + this._readableState && (this._readableState.flowing = e10); + } }), C6._fromList = Q5, Object.defineProperty(C6.prototype, "readableLength", { enumerable: false, get: function() { + return this._readableState.length; + } }), "function" == typeof Symbol && (C6.from = function(e10, t8) { + return void 0 === v8 && (v8 = r$1$1), v8(C6, e10, t8); + }), H$1$1; +} +function J$1$1() { + if (K$1$1) + return Y$1$1; + K$1$1 = true; + var e$25, r8 = T$1; + function s7(e10) { + var t8 = this; + this.next = null, this.entry = null, this.finish = function() { + !function(e11, t9, n7) { + var r9 = e11.entry; + e11.entry = null; + for (; r9; ) { + var i7 = r9.callback; + t9.pendingcb--, i7(n7), r9 = r9.next; + } + t9.corkedRequestsFree.next = e11; + }(t8, e10); + }; + } + Y$1$1 = x7, x7.WritableState = T6; + var l7 = { deprecate: t$1$1 }, d7 = e$g, f8 = e$1$1.Buffer, h8 = z$1$1.Uint8Array || function() { + }; + var c7, b8 = S$1$1, p7 = E$1$1.getHighWaterMark, g7 = e$1$12.codes, y7 = g7.ERR_INVALID_ARG_TYPE, w6 = g7.ERR_METHOD_NOT_IMPLEMENTED, _6 = g7.ERR_MULTIPLE_CALLBACK, v8 = g7.ERR_STREAM_CANNOT_PIPE, m7 = g7.ERR_STREAM_DESTROYED, R6 = g7.ERR_STREAM_NULL_VALUES, k6 = g7.ERR_STREAM_WRITE_AFTER_END, M6 = g7.ERR_UNKNOWN_ENCODING, j6 = b8.errorOrDestroy; + function O7() { + } + function T6(t8, n7, i7) { + e$25 = e$25 || Z$1$1(), t8 = t8 || {}, "boolean" != typeof i7 && (i7 = n7 instanceof e$25), this.objectMode = !!t8.objectMode, i7 && (this.objectMode = this.objectMode || !!t8.writableObjectMode), this.highWaterMark = p7(this, t8, "writableHighWaterMark", i7), this.finalCalled = false, this.needDrain = false, this.ending = false, this.ended = false, this.finished = false, this.destroyed = false; + var a7 = false === t8.decodeStrings; + this.decodeStrings = !a7, this.defaultEncoding = t8.defaultEncoding || "utf8", this.length = 0, this.writing = false, this.corked = 0, this.sync = true, this.bufferProcessing = false, this.onwrite = function(e10) { + !function(e11, t9) { + var n8 = e11._writableState, i8 = n8.sync, a8 = n8.writecb; + if ("function" != typeof a8) + throw new _6(); + if (function(e12) { + e12.writing = false, e12.writecb = null, e12.length -= e12.writelen, e12.writelen = 0; + }(n8), t9) + !function(e12, t10, n9, i9, a9) { + --t10.pendingcb, n9 ? (r8.nextTick(a9, i9), r8.nextTick(W5, e12, t10), e12._writableState.errorEmitted = true, j6(e12, i9)) : (a9(i9), e12._writableState.errorEmitted = true, j6(e12, i9), W5(e12, t10)); + }(e11, n8, i8, t9, a8); + else { + var o7 = C6(n8) || e11.destroyed; + o7 || n8.corked || n8.bufferProcessing || !n8.bufferedRequest || L6(e11, n8), i8 ? r8.nextTick(D6, e11, n8, o7, a8) : D6(e11, n8, o7, a8); + } + }(n7, e10); + }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = false, this.errorEmitted = false, this.emitClose = false !== t8.emitClose, this.autoDestroy = !!t8.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new s7(this); + } + function x7(t8) { + var n7 = this instanceof (e$25 = e$25 || Z$1$1()); + if (!n7 && !c7.call(x7, this)) + return new x7(t8); + this._writableState = new T6(t8, this, n7), this.writable = true, t8 && ("function" == typeof t8.write && (this._write = t8.write), "function" == typeof t8.writev && (this._writev = t8.writev), "function" == typeof t8.destroy && (this._destroy = t8.destroy), "function" == typeof t8.final && (this._final = t8.final)), d7.call(this); + } + function P6(e10, t8, n7, r9, i7, a7, o7) { + t8.writelen = r9, t8.writecb = o7, t8.writing = true, t8.sync = true, t8.destroyed ? t8.onwrite(new m7("write")) : n7 ? e10._writev(i7, t8.onwrite) : e10._write(i7, a7, t8.onwrite), t8.sync = false; + } + function D6(e10, t8, n7, r9) { + n7 || !function(e11, t9) { + 0 === t9.length && t9.needDrain && (t9.needDrain = false, e11.emit("drain")); + }(e10, t8), t8.pendingcb--, r9(), W5(e10, t8); + } + function L6(e10, t8) { + t8.bufferProcessing = true; + var n7 = t8.bufferedRequest; + if (e10._writev && n7 && n7.next) { + var r9 = t8.bufferedRequestCount, i7 = new Array(r9), a7 = t8.corkedRequestsFree; + a7.entry = n7; + for (var o7 = 0, l8 = true; n7; ) + i7[o7] = n7, n7.isBuf || (l8 = false), n7 = n7.next, o7 += 1; + i7.allBuffers = l8, P6(e10, t8, true, t8.length, i7, "", a7.finish), t8.pendingcb++, t8.lastBufferedRequest = null, a7.next ? (t8.corkedRequestsFree = a7.next, a7.next = null) : t8.corkedRequestsFree = new s7(t8), t8.bufferedRequestCount = 0; + } else { + for (; n7; ) { + var d8 = n7.chunk, u7 = n7.encoding, f9 = n7.callback; + if (P6(e10, t8, false, t8.objectMode ? 1 : d8.length, d8, u7, f9), n7 = n7.next, t8.bufferedRequestCount--, t8.writing) + break; + } + null === n7 && (t8.lastBufferedRequest = null); + } + t8.bufferedRequest = n7, t8.bufferProcessing = false; + } + function C6(e10) { + return e10.ending && 0 === e10.length && null === e10.bufferedRequest && !e10.finished && !e10.writing; + } + function A6(e10, t8) { + e10._final(function(n7) { + t8.pendingcb--, n7 && j6(e10, n7), t8.prefinished = true, e10.emit("prefinish"), W5(e10, t8); + }); + } + function W5(e10, t8) { + var n7 = C6(t8); + if (n7 && (!function(e11, t9) { + t9.prefinished || t9.finalCalled || ("function" != typeof e11._final || t9.destroyed ? (t9.prefinished = true, e11.emit("prefinish")) : (t9.pendingcb++, t9.finalCalled = true, r8.nextTick(A6, e11, t9))); + }(e10, t8), 0 === t8.pendingcb && (t8.finished = true, e10.emit("finish"), t8.autoDestroy))) { + var i7 = e10._readableState; + (!i7 || i7.autoDestroy && i7.endEmitted) && e10.destroy(); + } + return n7; + } + return t$2(x7, d7), T6.prototype.getBuffer = function() { + for (var e10 = this.bufferedRequest, t8 = []; e10; ) + t8.push(e10), e10 = e10.next; + return t8; + }, function() { + try { + Object.defineProperty(T6.prototype, "buffer", { get: l7.deprecate(function() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); + } catch (e10) { + } + }(), "function" == typeof Symbol && Symbol.hasInstance && "function" == typeof Function.prototype[Symbol.hasInstance] ? (c7 = Function.prototype[Symbol.hasInstance], Object.defineProperty(x7, Symbol.hasInstance, { value: function(e10) { + return !!c7.call(this, e10) || this === x7 && (e10 && e10._writableState instanceof T6); + } })) : c7 = function(e10) { + return e10 instanceof this; + }, x7.prototype.pipe = function() { + j6(this, new v8()); + }, x7.prototype.write = function(e10, t8, n7) { + var i7, a7 = this._writableState, o7 = false, s8 = !a7.objectMode && (i7 = e10, f8.isBuffer(i7) || i7 instanceof h8); + return s8 && !f8.isBuffer(e10) && (e10 = function(e11) { + return f8.from(e11); + }(e10)), "function" == typeof t8 && (n7 = t8, t8 = null), s8 ? t8 = "buffer" : t8 || (t8 = a7.defaultEncoding), "function" != typeof n7 && (n7 = O7), a7.ending ? function(e11, t9) { + var n8 = new k6(); + j6(e11, n8), r8.nextTick(t9, n8); + }(this, n7) : (s8 || function(e11, t9, n8, i8) { + var a8; + return null === n8 ? a8 = new R6() : "string" == typeof n8 || t9.objectMode || (a8 = new y7("chunk", ["string", "Buffer"], n8)), !a8 || (j6(e11, a8), r8.nextTick(i8, a8), false); + }(this, a7, e10, n7)) && (a7.pendingcb++, o7 = function(e11, t9, n8, r9, i8, a8) { + if (!n8) { + var o8 = function(e12, t10, n9) { + e12.objectMode || false === e12.decodeStrings || "string" != typeof t10 || (t10 = f8.from(t10, n9)); + return t10; + }(t9, r9, i8); + r9 !== o8 && (n8 = true, i8 = "buffer", r9 = o8); + } + var s9 = t9.objectMode ? 1 : r9.length; + t9.length += s9; + var l8 = t9.length < t9.highWaterMark; + l8 || (t9.needDrain = true); + if (t9.writing || t9.corked) { + var d8 = t9.lastBufferedRequest; + t9.lastBufferedRequest = { chunk: r9, encoding: i8, isBuf: n8, callback: a8, next: null }, d8 ? d8.next = t9.lastBufferedRequest : t9.bufferedRequest = t9.lastBufferedRequest, t9.bufferedRequestCount += 1; + } else + P6(e11, t9, false, s9, r9, i8, a8); + return l8; + }(this, a7, s8, e10, t8, n7)), o7; + }, x7.prototype.cork = function() { + this._writableState.corked++; + }, x7.prototype.uncork = function() { + var e10 = this._writableState; + e10.corked && (e10.corked--, e10.writing || e10.corked || e10.bufferProcessing || !e10.bufferedRequest || L6(this, e10)); + }, x7.prototype.setDefaultEncoding = function(e10) { + if ("string" == typeof e10 && (e10 = e10.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((e10 + "").toLowerCase()) > -1)) + throw new M6(e10); + return this._writableState.defaultEncoding = e10, this; + }, Object.defineProperty(x7.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(x7.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), x7.prototype._write = function(e10, t8, n7) { + n7(new w6("_write()")); + }, x7.prototype._writev = null, x7.prototype.end = function(e10, t8, n7) { + var i7 = this._writableState; + return "function" == typeof e10 ? (n7 = e10, e10 = null, t8 = null) : "function" == typeof t8 && (n7 = t8, t8 = null), null != e10 && this.write(e10, t8), i7.corked && (i7.corked = 1, this.uncork()), i7.ending || function(e11, t9, n8) { + t9.ending = true, W5(e11, t9), n8 && (t9.finished ? r8.nextTick(n8) : e11.once("finish", n8)); + t9.ended = true, e11.writable = false; + }(this, i7, n7), this; + }, Object.defineProperty(x7.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(x7.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._writableState && this._writableState.destroyed; + }, set: function(e10) { + this._writableState && (this._writableState.destroyed = e10); + } }), x7.prototype.destroy = b8.destroy, x7.prototype._undestroy = b8.undestroy, x7.prototype._destroy = function(e10, t8) { + t8(e10); + }, Y$1$1; +} +function Z$1$1() { + if (X$1$1) + return Q$1$1; + X$1$1 = true; + var e10 = T$1, t8 = Object.keys || function(e11) { + var t9 = []; + for (var n8 in e11) + t9.push(n8); + return t9; + }; + Q$1$1 = d7; + var n7 = G$1$1(), r8 = J$1$1(); + t$2(d7, n7); + for (var a7 = t8(r8.prototype), s7 = 0; s7 < a7.length; s7++) { + var l7 = a7[s7]; + d7.prototype[l7] || (d7.prototype[l7] = r8.prototype[l7]); + } + function d7(e11) { + if (!(this instanceof d7)) + return new d7(e11); + n7.call(this, e11), r8.call(this, e11), this.allowHalfOpen = true, e11 && (false === e11.readable && (this.readable = false), false === e11.writable && (this.writable = false), false === e11.allowHalfOpen && (this.allowHalfOpen = false, this.once("end", u7))); + } + function u7() { + this._writableState.ended || e10.nextTick(f8, this); + } + function f8(e11) { + e11.end(); + } + return Object.defineProperty(d7.prototype, "writableHighWaterMark", { enumerable: false, get: function() { + return this._writableState.highWaterMark; + } }), Object.defineProperty(d7.prototype, "writableBuffer", { enumerable: false, get: function() { + return this._writableState && this._writableState.getBuffer(); + } }), Object.defineProperty(d7.prototype, "writableLength", { enumerable: false, get: function() { + return this._writableState.length; + } }), Object.defineProperty(d7.prototype, "destroyed", { enumerable: false, get: function() { + return void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed && this._writableState.destroyed); + }, set: function(e11) { + void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = e11, this._writableState.destroyed = e11); + } }), Q$1$1; +} +function l$s(t8, r8) { + var e10 = this._transformState; + e10.transforming = false; + var n7 = e10.writecb; + if (null === n7) + return this.emit("error", new o$s()); + e10.writechunk = null, e10.writecb = null, null != r8 && this.push(r8), n7(t8); + var i7 = this._readableState; + i7.reading = false, (i7.needReadable || i7.length < i7.highWaterMark) && this._read(i7.highWaterMark); +} +function u$1$12(t8) { + if (!(this instanceof u$1$12)) + return new u$1$12(t8); + h$2$1.call(this, t8), this._transformState = { afterTransform: l$s.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = true, this._readableState.sync = false, t8 && ("function" == typeof t8.transform && (this._transform = t8.transform), "function" == typeof t8.flush && (this._flush = t8.flush)), this.on("prefinish", m$2$1); +} +function m$2$1() { + var t8 = this; + "function" != typeof this._flush || this._readableState.destroyed ? _$2$1(this, null, null) : this._flush(function(r8, e10) { + _$2$1(t8, r8, e10); + }); +} +function _$2$1(t8, r8, e10) { + if (r8) + return t8.emit("error", r8); + if (null != e10 && t8.push(e10), t8._writableState.length) + throw new f$2$1(); + if (t8._transformState.transforming) + throw new s$q(); + return t8.push(null); +} +function i$1$1(r8) { + if (!(this instanceof i$1$1)) + return new i$1$1(r8); + e$3$1.call(this, r8); +} +function i$2$1(r8) { + if (r8) + throw r8; +} +function u$2$1(r8, o7, e10, i7) { + i7 = /* @__PURE__ */ function(r9) { + var n7 = false; + return function() { + n7 || (n7 = true, r9.apply(void 0, arguments)); + }; + }(i7); + var u7 = false; + r8.on("close", function() { + u7 = true; + }), void 0 === t$6$1 && (t$6$1 = n$1$12), t$6$1(r8, { readable: o7, writable: e10 }, function(r9) { + if (r9) + return i7(r9); + u7 = true, i7(); + }); + var a7 = false; + return function(n7) { + if (!u7 && !a7) + return a7 = true, function(r9) { + return r9.setHeader && "function" == typeof r9.abort; + }(r8) ? r8.abort() : "function" == typeof r8.destroy ? r8.destroy() : (i7(n7 || new f$3$1("pipe")), void 0); + }; +} +function a$1$12(r8) { + r8(); +} +function c$2$1(r8, n7) { + return r8.pipe(n7); +} +function p$3$1(r8) { + return r8.length ? "function" != typeof r8[r8.length - 1] ? i$2$1 : r8.pop() : i$2$1; +} +function p$r() { + f$u.call(this || d$n); +} +function dew$1G() { + if (_dewExec$1G) + return exports$1H; + _dewExec$1G = true; + var Buffer4 = dew$1T().Buffer; + var Transform2 = b$i.Transform; + var StringDecoder2 = e$12.StringDecoder; + var inherits2 = dew$f$2(); + function CipherBase(hashMode) { + Transform2.call(this || _global$o); + (this || _global$o).hashMode = typeof hashMode === "string"; + if ((this || _global$o).hashMode) { + (this || _global$o)[hashMode] = (this || _global$o)._finalOrDigest; + } else { + (this || _global$o).final = (this || _global$o)._finalOrDigest; + } + if ((this || _global$o)._final) { + (this || _global$o).__final = (this || _global$o)._final; + (this || _global$o)._final = null; + } + (this || _global$o)._decoder = null; + (this || _global$o)._encoding = null; + } + inherits2(CipherBase, Transform2); + CipherBase.prototype.update = function(data, inputEnc, outputEnc) { + if (typeof data === "string") { + data = Buffer4.from(data, inputEnc); + } + var outData = this._update(data); + if ((this || _global$o).hashMode) + return this || _global$o; + if (outputEnc) { + outData = this._toString(outData, outputEnc); + } + return outData; + }; + CipherBase.prototype.setAutoPadding = function() { + }; + CipherBase.prototype.getAuthTag = function() { + throw new Error("trying to get auth tag in unsupported state"); + }; + CipherBase.prototype.setAuthTag = function() { + throw new Error("trying to set auth tag in unsupported state"); + }; + CipherBase.prototype.setAAD = function() { + throw new Error("trying to set aad in unsupported state"); + }; + CipherBase.prototype._transform = function(data, _6, next) { + var err; + try { + if ((this || _global$o).hashMode) { + this._update(data); + } else { + this.push(this._update(data)); + } + } catch (e10) { + err = e10; + } finally { + next(err); + } + }; + CipherBase.prototype._flush = function(done) { + var err; + try { + this.push(this.__final()); + } catch (e10) { + err = e10; + } + done(err); + }; + CipherBase.prototype._finalOrDigest = function(outputEnc) { + var outData = this.__final() || Buffer4.alloc(0); + if (outputEnc) { + outData = this._toString(outData, outputEnc, true); + } + return outData; + }; + CipherBase.prototype._toString = function(value2, enc, fin) { + if (!(this || _global$o)._decoder) { + (this || _global$o)._decoder = new StringDecoder2(enc); + (this || _global$o)._encoding = enc; + } + if ((this || _global$o)._encoding !== enc) + throw new Error("can't switch encodings"); + var out = (this || _global$o)._decoder.write(value2); + if (fin) { + out += (this || _global$o)._decoder.end(); + } + return out; + }; + exports$1H = CipherBase; + return exports$1H; +} +function dew$1F() { + if (_dewExec$1F) + return exports$1G; + _dewExec$1F = true; + var inherits2 = dew$f$2(); + var MD5 = dew$1Q(); + var RIPEMD160 = dew$1P(); + var sha = dew$1H(); + var Base2 = dew$1G(); + function Hash3(hash) { + Base2.call(this, "digest"); + this._hash = hash; + } + inherits2(Hash3, Base2); + Hash3.prototype._update = function(data) { + this._hash.update(data); + }; + Hash3.prototype._final = function() { + return this._hash.digest(); + }; + exports$1G = function createHash2(alg) { + alg = alg.toLowerCase(); + if (alg === "md5") + return new MD5(); + if (alg === "rmd160" || alg === "ripemd160") + return new RIPEMD160(); + return new Hash3(sha(alg)); + }; + return exports$1G; +} +function dew$1E() { + if (_dewExec$1E) + return exports$1F; + _dewExec$1E = true; + var inherits2 = dew$f$2(); + var Buffer4 = dew$1T().Buffer; + var Base2 = dew$1G(); + var ZEROS = Buffer4.alloc(128); + var blocksize = 64; + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + key = alg(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = [ipad]; + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.push(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._alg(Buffer4.concat(this._hash)); + return this._alg(Buffer4.concat([this._opad, h8])); + }; + exports$1F = Hmac2; + return exports$1F; +} +function dew$1D() { + if (_dewExec$1D) + return exports$1E; + _dewExec$1D = true; + var MD5 = dew$1Q(); + exports$1E = function(buffer2) { + return new MD5().update(buffer2).digest(); + }; + return exports$1E; +} +function dew$1C() { + if (_dewExec$1C) + return exports$1D; + _dewExec$1C = true; + var inherits2 = dew$f$2(); + var Legacy = dew$1E(); + var Base2 = dew$1G(); + var Buffer4 = dew$1T().Buffer; + var md5 = dew$1D(); + var RIPEMD160 = dew$1P(); + var sha = dew$1H(); + var ZEROS = Buffer4.alloc(128); + function Hmac2(alg, key) { + Base2.call(this, "digest"); + if (typeof key === "string") { + key = Buffer4.from(key); + } + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + this._alg = alg; + this._key = key; + if (key.length > blocksize) { + var hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + key = hash.update(key).digest(); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = this._ipad = Buffer4.allocUnsafe(blocksize); + var opad = this._opad = Buffer4.allocUnsafe(blocksize); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg); + this._hash.update(ipad); + } + inherits2(Hmac2, Base2); + Hmac2.prototype._update = function(data) { + this._hash.update(data); + }; + Hmac2.prototype._final = function() { + var h8 = this._hash.digest(); + var hash = this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg); + return hash.update(this._opad).update(h8).digest(); + }; + exports$1D = function createHmac2(alg, key) { + alg = alg.toLowerCase(); + if (alg === "rmd160" || alg === "ripemd160") { + return new Hmac2("rmd160", key); + } + if (alg === "md5") { + return new Legacy(md5, key); + } + return new Hmac2(alg, key); + }; + return exports$1D; +} +function dew$1B() { + if (_dewExec$1B) + return exports$1C; + _dewExec$1B = true; + exports$1C = _algorithms; + return exports$1C; +} +function dew$1A() { + if (_dewExec$1A) + return exports$1B; + _dewExec$1A = true; + var MAX_ALLOC = Math.pow(2, 30) - 1; + exports$1B = function(iterations, keylen) { + if (typeof iterations !== "number") { + throw new TypeError("Iterations not a number"); + } + if (iterations < 0) { + throw new TypeError("Bad iterations"); + } + if (typeof keylen !== "number") { + throw new TypeError("Key length not a number"); + } + if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { + throw new TypeError("Bad key length"); + } + }; + return exports$1B; +} +function dew$1z() { + if (_dewExec$1z) + return exports$1A; + _dewExec$1z = true; + var process5 = T$1; + var defaultEncoding; + if (_global$n.process && _global$n.process.browser) { + defaultEncoding = "utf-8"; + } else if (_global$n.process && _global$n.process.version) { + var pVersionMajor = parseInt(process5.version.split(".")[0].slice(1), 10); + defaultEncoding = pVersionMajor >= 6 ? "utf-8" : "binary"; + } else { + defaultEncoding = "utf-8"; + } + exports$1A = defaultEncoding; + return exports$1A; +} +function dew$1y() { + if (_dewExec$1y) + return exports$1z; + _dewExec$1y = true; + var Buffer4 = dew$1T().Buffer; + exports$1z = function(thing, encoding, name2) { + if (Buffer4.isBuffer(thing)) { + return thing; + } else if (typeof thing === "string") { + return Buffer4.from(thing, encoding); + } else if (ArrayBuffer.isView(thing)) { + return Buffer4.from(thing.buffer); + } else { + throw new TypeError(name2 + " must be a string, a Buffer, a typed array or a DataView"); + } + }; + return exports$1z; +} +function dew$1x() { + if (_dewExec$1x) + return exports$1y; + _dewExec$1x = true; + var md5 = dew$1D(); + var RIPEMD160 = dew$1P(); + var sha = dew$1H(); + var Buffer4 = dew$1T().Buffer; + var checkParameters = dew$1A(); + var defaultEncoding = dew$1z(); + var toBuffer = dew$1y(); + var ZEROS = Buffer4.alloc(128); + var sizes = { + md5: 16, + sha1: 20, + sha224: 28, + sha256: 32, + sha384: 48, + sha512: 64, + rmd160: 20, + ripemd160: 20 + }; + function Hmac2(alg, key, saltLen) { + var hash = getDigest(alg); + var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64; + if (key.length > blocksize) { + key = hash(key); + } else if (key.length < blocksize) { + key = Buffer4.concat([key, ZEROS], blocksize); + } + var ipad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + var opad = Buffer4.allocUnsafe(blocksize + sizes[alg]); + for (var i7 = 0; i7 < blocksize; i7++) { + ipad[i7] = key[i7] ^ 54; + opad[i7] = key[i7] ^ 92; + } + var ipad1 = Buffer4.allocUnsafe(blocksize + saltLen + 4); + ipad.copy(ipad1, 0, 0, blocksize); + (this || _global$m).ipad1 = ipad1; + (this || _global$m).ipad2 = ipad; + (this || _global$m).opad = opad; + (this || _global$m).alg = alg; + (this || _global$m).blocksize = blocksize; + (this || _global$m).hash = hash; + (this || _global$m).size = sizes[alg]; + } + Hmac2.prototype.run = function(data, ipad) { + data.copy(ipad, (this || _global$m).blocksize); + var h8 = this.hash(ipad); + h8.copy((this || _global$m).opad, (this || _global$m).blocksize); + return this.hash((this || _global$m).opad); + }; + function getDigest(alg) { + function shaFunc(data) { + return sha(alg).update(data).digest(); + } + function rmd160Func(data) { + return new RIPEMD160().update(data).digest(); + } + if (alg === "rmd160" || alg === "ripemd160") + return rmd160Func; + if (alg === "md5") + return md5; + return shaFunc; + } + function pbkdf22(password, salt, iterations, keylen, digest) { + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + digest = digest || "sha1"; + var hmac = new Hmac2(digest, password, salt.length); + var DK = Buffer4.allocUnsafe(keylen); + var block1 = Buffer4.allocUnsafe(salt.length + 4); + salt.copy(block1, 0, 0, salt.length); + var destPos = 0; + var hLen = sizes[digest]; + var l7 = Math.ceil(keylen / hLen); + for (var i7 = 1; i7 <= l7; i7++) { + block1.writeUInt32BE(i7, salt.length); + var T6 = hmac.run(block1, hmac.ipad1); + var U6 = T6; + for (var j6 = 1; j6 < iterations; j6++) { + U6 = hmac.run(U6, hmac.ipad2); + for (var k6 = 0; k6 < hLen; k6++) + T6[k6] ^= U6[k6]; + } + T6.copy(DK, destPos); + destPos += hLen; + } + return DK; + } + exports$1y = pbkdf22; + return exports$1y; +} +function dew$1w() { + if (_dewExec$1w) + return exports$1x; + _dewExec$1w = true; + var Buffer4 = dew$1T().Buffer; + var checkParameters = dew$1A(); + var defaultEncoding = dew$1z(); + var sync = dew$1x(); + var toBuffer = dew$1y(); + var ZERO_BUF; + var subtle = _global$l.crypto && _global$l.crypto.subtle; + var toBrowser = { + sha: "SHA-1", + "sha-1": "SHA-1", + sha1: "SHA-1", + sha256: "SHA-256", + "sha-256": "SHA-256", + sha384: "SHA-384", + "sha-384": "SHA-384", + "sha-512": "SHA-512", + sha512: "SHA-512" + }; + var checks = []; + function checkNative(algo) { + if (_global$l.process && !_global$l.process.browser) { + return Promise.resolve(false); + } + if (!subtle || !subtle.importKey || !subtle.deriveBits) { + return Promise.resolve(false); + } + if (checks[algo] !== void 0) { + return checks[algo]; + } + ZERO_BUF = ZERO_BUF || Buffer4.alloc(8); + var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() { + return true; + }).catch(function() { + return false; + }); + checks[algo] = prom; + return prom; + } + var nextTick3; + function getNextTick() { + if (nextTick3) { + return nextTick3; + } + if (_global$l.process && _global$l.process.nextTick) { + nextTick3 = _global$l.process.nextTick; + } else if (_global$l.queueMicrotask) { + nextTick3 = _global$l.queueMicrotask; + } else if (_global$l.setImmediate) { + nextTick3 = _global$l.setImmediate; + } else { + nextTick3 = _global$l.setTimeout; + } + return nextTick3; + } + function browserPbkdf2(password, salt, iterations, length, algo) { + return subtle.importKey("raw", password, { + name: "PBKDF2" + }, false, ["deriveBits"]).then(function(key) { + return subtle.deriveBits({ + name: "PBKDF2", + salt, + iterations, + hash: { + name: algo + } + }, key, length << 3); + }).then(function(res) { + return Buffer4.from(res); + }); + } + function resolvePromise(promise, callback) { + promise.then(function(out) { + getNextTick()(function() { + callback(null, out); + }); + }, function(e10) { + getNextTick()(function() { + callback(e10); + }); + }); + } + exports$1x = function(password, salt, iterations, keylen, digest, callback) { + if (typeof digest === "function") { + callback = digest; + digest = void 0; + } + digest = digest || "sha1"; + var algo = toBrowser[digest.toLowerCase()]; + if (!algo || typeof _global$l.Promise !== "function") { + getNextTick()(function() { + var out; + try { + out = sync(password, salt, iterations, keylen, digest); + } catch (e10) { + return callback(e10); + } + callback(null, out); + }); + return; + } + checkParameters(iterations, keylen); + password = toBuffer(password, defaultEncoding, "Password"); + salt = toBuffer(salt, defaultEncoding, "Salt"); + if (typeof callback !== "function") + throw new Error("No callback provided to pbkdf2"); + resolvePromise(checkNative(algo).then(function(resp) { + if (resp) + return browserPbkdf2(password, salt, iterations, keylen, algo); + return sync(password, salt, iterations, keylen, digest); + }), callback); + }; + return exports$1x; +} +function dew$1v() { + if (_dewExec$1v) + return exports$1w; + _dewExec$1v = true; + exports$1w.pbkdf2 = dew$1w(); + exports$1w.pbkdf2Sync = dew$1x(); + return exports$1w; +} +function dew$1u() { + if (_dewExec$1u) + return exports$1v; + _dewExec$1u = true; + exports$1v.readUInt32BE = function readUInt32BE(bytes, off3) { + var res = bytes[0 + off3] << 24 | bytes[1 + off3] << 16 | bytes[2 + off3] << 8 | bytes[3 + off3]; + return res >>> 0; + }; + exports$1v.writeUInt32BE = function writeUInt32BE(bytes, value2, off3) { + bytes[0 + off3] = value2 >>> 24; + bytes[1 + off3] = value2 >>> 16 & 255; + bytes[2 + off3] = value2 >>> 8 & 255; + bytes[3 + off3] = value2 & 255; + }; + exports$1v.ip = function ip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 6; i7 >= 0; i7 -= 2) { + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + } + for (var j6 = 1; j6 <= 25; j6 += 8) { + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$1v.rip = function rip(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 0; i7 < 4; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outL <<= 1; + outL |= inR >>> j6 + i7 & 1; + outL <<= 1; + outL |= inL >>> j6 + i7 & 1; + } + } + for (var i7 = 4; i7 < 8; i7++) { + for (var j6 = 24; j6 >= 0; j6 -= 8) { + outR <<= 1; + outR |= inR >>> j6 + i7 & 1; + outR <<= 1; + outR |= inL >>> j6 + i7 & 1; + } + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$1v.pc1 = function pc1(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + for (var i7 = 7; i7 >= 5; i7--) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outL <<= 1; + outL |= inR >> j6 + i7 & 1; + } + for (var i7 = 1; i7 <= 3; i7++) { + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inR >> j6 + i7 & 1; + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + } + for (var j6 = 0; j6 <= 24; j6 += 8) { + outR <<= 1; + outR |= inL >> j6 + i7 & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$1v.r28shl = function r28shl(num, shift) { + return num << shift & 268435455 | num >>> 28 - shift; + }; + var pc2table = [ + // inL => outL + 14, + 11, + 17, + 4, + 27, + 23, + 25, + 0, + 13, + 22, + 7, + 18, + 5, + 9, + 16, + 24, + 2, + 20, + 12, + 21, + 1, + 8, + 15, + 26, + // inR => outR + 15, + 4, + 25, + 19, + 9, + 1, + 26, + 16, + 5, + 11, + 23, + 8, + 12, + 7, + 17, + 0, + 22, + 3, + 10, + 14, + 6, + 20, + 27, + 24 + ]; + exports$1v.pc2 = function pc22(inL, inR, out, off3) { + var outL = 0; + var outR = 0; + var len = pc2table.length >>> 1; + for (var i7 = 0; i7 < len; i7++) { + outL <<= 1; + outL |= inL >>> pc2table[i7] & 1; + } + for (var i7 = len; i7 < pc2table.length; i7++) { + outR <<= 1; + outR |= inR >>> pc2table[i7] & 1; + } + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + exports$1v.expand = function expand(r8, out, off3) { + var outL = 0; + var outR = 0; + outL = (r8 & 1) << 5 | r8 >>> 27; + for (var i7 = 23; i7 >= 15; i7 -= 4) { + outL <<= 6; + outL |= r8 >>> i7 & 63; + } + for (var i7 = 11; i7 >= 3; i7 -= 4) { + outR |= r8 >>> i7 & 63; + outR <<= 6; + } + outR |= (r8 & 31) << 1 | r8 >>> 31; + out[off3 + 0] = outL >>> 0; + out[off3 + 1] = outR >>> 0; + }; + var sTable = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; + exports$1v.substitute = function substitute(inL, inR) { + var out = 0; + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inL >>> 18 - i7 * 6 & 63; + var sb = sTable[i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + for (var i7 = 0; i7 < 4; i7++) { + var b8 = inR >>> 18 - i7 * 6 & 63; + var sb = sTable[4 * 64 + i7 * 64 + b8]; + out <<= 4; + out |= sb; + } + return out >>> 0; + }; + var permuteTable = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; + exports$1v.permute = function permute(num) { + var out = 0; + for (var i7 = 0; i7 < permuteTable.length; i7++) { + out <<= 1; + out |= num >>> permuteTable[i7] & 1; + } + return out >>> 0; + }; + exports$1v.padSplit = function padSplit(num, size2, group2) { + var str2 = num.toString(2); + while (str2.length < size2) + str2 = "0" + str2; + var out = []; + for (var i7 = 0; i7 < size2; i7 += group2) + out.push(str2.slice(i7, i7 + group2)); + return out.join(" "); + }; + return exports$1v; +} +function dew$1t() { + if (_dewExec$1t) + return exports$1u; + _dewExec$1t = true; + exports$1u = assert4; + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + assert4.equal = function assertEqual(l7, r8, msg) { + if (l7 != r8) + throw new Error(msg || "Assertion failed: " + l7 + " != " + r8); + }; + return exports$1u; +} +function dew$1s() { + if (_dewExec$1s) + return exports$1t; + _dewExec$1s = true; + var assert4 = dew$1t(); + function Cipher2(options) { + this.options = options; + this.type = this.options.type; + this.blockSize = 8; + this._init(); + this.buffer = new Array(this.blockSize); + this.bufferOff = 0; + } + exports$1t = Cipher2; + Cipher2.prototype._init = function _init() { + }; + Cipher2.prototype.update = function update2(data) { + if (data.length === 0) + return []; + if (this.type === "decrypt") + return this._updateDecrypt(data); + else + return this._updateEncrypt(data); + }; + Cipher2.prototype._buffer = function _buffer(data, off3) { + var min2 = Math.min(this.buffer.length - this.bufferOff, data.length - off3); + for (var i7 = 0; i7 < min2; i7++) + this.buffer[this.bufferOff + i7] = data[off3 + i7]; + this.bufferOff += min2; + return min2; + }; + Cipher2.prototype._flushBuffer = function _flushBuffer(out, off3) { + this._update(this.buffer, 0, out, off3); + this.bufferOff = 0; + return this.blockSize; + }; + Cipher2.prototype._updateEncrypt = function _updateEncrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = (this.bufferOff + data.length) / this.blockSize | 0; + var out = new Array(count2 * this.blockSize); + if (this.bufferOff !== 0) { + inputOff += this._buffer(data, inputOff); + if (this.bufferOff === this.buffer.length) + outputOff += this._flushBuffer(out, outputOff); + } + var max2 = data.length - (data.length - inputOff) % this.blockSize; + for (; inputOff < max2; inputOff += this.blockSize) { + this._update(data, inputOff, out, outputOff); + outputOff += this.blockSize; + } + for (; inputOff < data.length; inputOff++, this.bufferOff++) + this.buffer[this.bufferOff] = data[inputOff]; + return out; + }; + Cipher2.prototype._updateDecrypt = function _updateDecrypt(data) { + var inputOff = 0; + var outputOff = 0; + var count2 = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1; + var out = new Array(count2 * this.blockSize); + for (; count2 > 0; count2--) { + inputOff += this._buffer(data, inputOff); + outputOff += this._flushBuffer(out, outputOff); + } + inputOff += this._buffer(data, inputOff); + return out; + }; + Cipher2.prototype.final = function final(buffer2) { + var first; + if (buffer2) + first = this.update(buffer2); + var last2; + if (this.type === "encrypt") + last2 = this._finalEncrypt(); + else + last2 = this._finalDecrypt(); + if (first) + return first.concat(last2); + else + return last2; + }; + Cipher2.prototype._pad = function _pad(buffer2, off3) { + if (off3 === 0) + return false; + while (off3 < buffer2.length) + buffer2[off3++] = 0; + return true; + }; + Cipher2.prototype._finalEncrypt = function _finalEncrypt() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + var out = new Array(this.blockSize); + this._update(this.buffer, 0, out, 0); + return out; + }; + Cipher2.prototype._unpad = function _unpad(buffer2) { + return buffer2; + }; + Cipher2.prototype._finalDecrypt = function _finalDecrypt() { + assert4.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); + var out = new Array(this.blockSize); + this._flushBuffer(out, 0); + return this._unpad(out); + }; + return exports$1t; +} +function dew$1r() { + if (_dewExec$1r) + return exports$1s; + _dewExec$1r = true; + var assert4 = dew$1t(); + var inherits2 = dew$f$2(); + var utils = dew$1u(); + var Cipher2 = dew$1s(); + function DESState() { + this.tmp = new Array(2); + this.keys = null; + } + function DES(options) { + Cipher2.call(this, options); + var state = new DESState(); + this._desState = state; + this.deriveKeys(state, options.key); + } + inherits2(DES, Cipher2); + exports$1s = DES; + DES.create = function create2(options) { + return new DES(options); + }; + var shiftTable = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; + DES.prototype.deriveKeys = function deriveKeys(state, key) { + state.keys = new Array(16 * 2); + assert4.equal(key.length, this.blockSize, "Invalid key length"); + var kL = utils.readUInt32BE(key, 0); + var kR = utils.readUInt32BE(key, 4); + utils.pc1(kL, kR, state.tmp, 0); + kL = state.tmp[0]; + kR = state.tmp[1]; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var shift = shiftTable[i7 >>> 1]; + kL = utils.r28shl(kL, shift); + kR = utils.r28shl(kR, shift); + utils.pc2(kL, kR, state.keys, i7); + } + }; + DES.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._desState; + var l7 = utils.readUInt32BE(inp, inOff); + var r8 = utils.readUInt32BE(inp, inOff + 4); + utils.ip(l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + if (this.type === "encrypt") + this._encrypt(state, l7, r8, state.tmp, 0); + else + this._decrypt(state, l7, r8, state.tmp, 0); + l7 = state.tmp[0]; + r8 = state.tmp[1]; + utils.writeUInt32BE(out, l7, outOff); + utils.writeUInt32BE(out, r8, outOff + 4); + }; + DES.prototype._pad = function _pad(buffer2, off3) { + var value2 = buffer2.length - off3; + for (var i7 = off3; i7 < buffer2.length; i7++) + buffer2[i7] = value2; + return true; + }; + DES.prototype._unpad = function _unpad(buffer2) { + var pad2 = buffer2[buffer2.length - 1]; + for (var i7 = buffer2.length - pad2; i7 < buffer2.length; i7++) + assert4.equal(buffer2[i7], pad2); + return buffer2.slice(0, buffer2.length - pad2); + }; + DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off3) { + var l7 = lStart; + var r8 = rStart; + for (var i7 = 0; i7 < state.keys.length; i7 += 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(r8, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = r8; + r8 = (l7 ^ f8) >>> 0; + l7 = t8; + } + utils.rip(r8, l7, out, off3); + }; + DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off3) { + var l7 = rStart; + var r8 = lStart; + for (var i7 = state.keys.length - 2; i7 >= 0; i7 -= 2) { + var keyL = state.keys[i7]; + var keyR = state.keys[i7 + 1]; + utils.expand(l7, state.tmp, 0); + keyL ^= state.tmp[0]; + keyR ^= state.tmp[1]; + var s7 = utils.substitute(keyL, keyR); + var f8 = utils.permute(s7); + var t8 = l7; + l7 = (r8 ^ f8) >>> 0; + r8 = t8; + } + utils.rip(l7, r8, out, off3); + }; + return exports$1s; +} +function dew$1q() { + if (_dewExec$1q) + return exports$1r; + _dewExec$1q = true; + var assert4 = dew$1t(); + var inherits2 = dew$f$2(); + var proto = {}; + function CBCState(iv) { + assert4.equal(iv.length, 8, "Invalid IV length"); + this.iv = new Array(8); + for (var i7 = 0; i7 < this.iv.length; i7++) + this.iv[i7] = iv[i7]; + } + function instantiate(Base2) { + function CBC(options) { + Base2.call(this, options); + this._cbcInit(); + } + inherits2(CBC, Base2); + var keys2 = Object.keys(proto); + for (var i7 = 0; i7 < keys2.length; i7++) { + var key = keys2[i7]; + CBC.prototype[key] = proto[key]; + } + CBC.create = function create2(options) { + return new CBC(options); + }; + return CBC; + } + exports$1r.instantiate = instantiate; + proto._cbcInit = function _cbcInit() { + var state = new CBCState(this.options.iv); + this._cbcState = state; + }; + proto._update = function _update(inp, inOff, out, outOff) { + var state = this._cbcState; + var superProto = this.constructor.super_.prototype; + var iv = state.iv; + if (this.type === "encrypt") { + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] ^= inp[inOff + i7]; + superProto._update.call(this, iv, 0, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = out[outOff + i7]; + } else { + superProto._update.call(this, inp, inOff, out, outOff); + for (var i7 = 0; i7 < this.blockSize; i7++) + out[outOff + i7] ^= iv[i7]; + for (var i7 = 0; i7 < this.blockSize; i7++) + iv[i7] = inp[inOff + i7]; + } + }; + return exports$1r; +} +function dew$1p() { + if (_dewExec$1p) + return exports$1q; + _dewExec$1p = true; + var assert4 = dew$1t(); + var inherits2 = dew$f$2(); + var Cipher2 = dew$1s(); + var DES = dew$1r(); + function EDEState(type3, key) { + assert4.equal(key.length, 24, "Invalid key length"); + var k1 = key.slice(0, 8); + var k22 = key.slice(8, 16); + var k32 = key.slice(16, 24); + if (type3 === "encrypt") { + this.ciphers = [DES.create({ + type: "encrypt", + key: k1 + }), DES.create({ + type: "decrypt", + key: k22 + }), DES.create({ + type: "encrypt", + key: k32 + })]; + } else { + this.ciphers = [DES.create({ + type: "decrypt", + key: k32 + }), DES.create({ + type: "encrypt", + key: k22 + }), DES.create({ + type: "decrypt", + key: k1 + })]; + } + } + function EDE(options) { + Cipher2.call(this, options); + var state = new EDEState(this.type, this.options.key); + this._edeState = state; + } + inherits2(EDE, Cipher2); + exports$1q = EDE; + EDE.create = function create2(options) { + return new EDE(options); + }; + EDE.prototype._update = function _update(inp, inOff, out, outOff) { + var state = this._edeState; + state.ciphers[0]._update(inp, inOff, out, outOff); + state.ciphers[1]._update(out, outOff, out, outOff); + state.ciphers[2]._update(out, outOff, out, outOff); + }; + EDE.prototype._pad = DES.prototype._pad; + EDE.prototype._unpad = DES.prototype._unpad; + return exports$1q; +} +function dew$1o() { + if (_dewExec$1o) + return exports$1p; + _dewExec$1o = true; + exports$1p.utils = dew$1u(); + exports$1p.Cipher = dew$1s(); + exports$1p.DES = dew$1r(); + exports$1p.CBC = dew$1q(); + exports$1p.EDE = dew$1p(); + return exports$1p; +} +function dew$1n() { + if (_dewExec$1n) + return exports$1o; + _dewExec$1n = true; + var CipherBase = dew$1G(); + var des = dew$1o(); + var inherits2 = dew$f$2(); + var Buffer4 = dew$1T().Buffer; + var modes = { + "des-ede3-cbc": des.CBC.instantiate(des.EDE), + "des-ede3": des.EDE, + "des-ede-cbc": des.CBC.instantiate(des.EDE), + "des-ede": des.EDE, + "des-cbc": des.CBC.instantiate(des.DES), + "des-ecb": des.DES + }; + modes.des = modes["des-cbc"]; + modes.des3 = modes["des-ede3-cbc"]; + exports$1o = DES; + inherits2(DES, CipherBase); + function DES(opts) { + CipherBase.call(this || _global$k); + var modeName = opts.mode.toLowerCase(); + var mode = modes[modeName]; + var type3; + if (opts.decrypt) { + type3 = "decrypt"; + } else { + type3 = "encrypt"; + } + var key = opts.key; + if (!Buffer4.isBuffer(key)) { + key = Buffer4.from(key); + } + if (modeName === "des-ede" || modeName === "des-ede-cbc") { + key = Buffer4.concat([key, key.slice(0, 8)]); + } + var iv = opts.iv; + if (!Buffer4.isBuffer(iv)) { + iv = Buffer4.from(iv); + } + (this || _global$k)._des = mode.create({ + key, + iv, + type: type3 + }); + } + DES.prototype._update = function(data) { + return Buffer4.from((this || _global$k)._des.update(data)); + }; + DES.prototype._final = function() { + return Buffer4.from((this || _global$k)._des.final()); + }; + return exports$1o; +} +function dew$1m() { + if (_dewExec$1m) + return exports$1n; + _dewExec$1m = true; + exports$1n.encrypt = function(self2, block) { + return self2._cipher.encryptBlock(block); + }; + exports$1n.decrypt = function(self2, block) { + return self2._cipher.decryptBlock(block); + }; + return exports$1n; +} +function dew$1l() { + if (_dewExec$1l) + return exports$1m; + _dewExec$1l = true; + var Buffer4 = e$1$1.Buffer; + exports$1m = function xor2(a7, b8) { + var length = Math.min(a7.length, b8.length); + var buffer2 = new Buffer4(length); + for (var i7 = 0; i7 < length; ++i7) { + buffer2[i7] = a7[i7] ^ b8[i7]; + } + return buffer2; + }; + return exports$1m; +} +function dew$1k() { + if (_dewExec$1k) + return exports$1l; + _dewExec$1k = true; + var xor2 = dew$1l(); + exports$1l.encrypt = function(self2, block) { + var data = xor2(block, self2._prev); + self2._prev = self2._cipher.encryptBlock(data); + return self2._prev; + }; + exports$1l.decrypt = function(self2, block) { + var pad2 = self2._prev; + self2._prev = block; + var out = self2._cipher.decryptBlock(block); + return xor2(out, pad2); + }; + return exports$1l; +} +function dew$1j() { + if (_dewExec$1j) + return exports$1k; + _dewExec$1j = true; + var Buffer4 = dew$1T().Buffer; + var xor2 = dew$1l(); + function encryptStart(self2, data, decrypt) { + var len = data.length; + var out = xor2(data, self2._cache); + self2._cache = self2._cache.slice(len); + self2._prev = Buffer4.concat([self2._prev, decrypt ? data : out]); + return out; + } + exports$1k.encrypt = function(self2, data, decrypt) { + var out = Buffer4.allocUnsafe(0); + var len; + while (data.length) { + if (self2._cache.length === 0) { + self2._cache = self2._cipher.encryptBlock(self2._prev); + self2._prev = Buffer4.allocUnsafe(0); + } + if (self2._cache.length <= data.length) { + len = self2._cache.length; + out = Buffer4.concat([out, encryptStart(self2, data.slice(0, len), decrypt)]); + data = data.slice(len); + } else { + out = Buffer4.concat([out, encryptStart(self2, data, decrypt)]); + break; + } + } + return out; + }; + return exports$1k; +} +function dew$1i$1() { + if (_dewExec$1i$1) + return exports$1j$1; + _dewExec$1i$1 = true; + var Buffer4 = dew$1T().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2 = self2._cipher.encryptBlock(self2._prev); + var out = pad2[0] ^ byteParam; + self2._prev = Buffer4.concat([self2._prev.slice(1), Buffer4.from([decrypt ? byteParam : out])]); + return out; + } + exports$1j$1.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$1j$1; +} +function dew$1h$1() { + if (_dewExec$1h$1) + return exports$1i$1; + _dewExec$1h$1 = true; + var Buffer4 = dew$1T().Buffer; + function encryptByte(self2, byteParam, decrypt) { + var pad2; + var i7 = -1; + var len = 8; + var out = 0; + var bit, value2; + while (++i7 < len) { + pad2 = self2._cipher.encryptBlock(self2._prev); + bit = byteParam & 1 << 7 - i7 ? 128 : 0; + value2 = pad2[0] ^ bit; + out += (value2 & 128) >> i7 % 8; + self2._prev = shiftIn(self2._prev, decrypt ? bit : value2); + } + return out; + } + function shiftIn(buffer2, value2) { + var len = buffer2.length; + var i7 = -1; + var out = Buffer4.allocUnsafe(buffer2.length); + buffer2 = Buffer4.concat([buffer2, Buffer4.from([value2])]); + while (++i7 < len) { + out[i7] = buffer2[i7] << 1 | buffer2[i7 + 1] >> 7; + } + return out; + } + exports$1i$1.encrypt = function(self2, chunk2, decrypt) { + var len = chunk2.length; + var out = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + out[i7] = encryptByte(self2, chunk2[i7], decrypt); + } + return out; + }; + return exports$1i$1; +} +function dew$1g$1() { + if (_dewExec$1g$1) + return exports$1h$1; + _dewExec$1g$1 = true; + var Buffer4 = e$1$1.Buffer; + var xor2 = dew$1l(); + function getBlock(self2) { + self2._prev = self2._cipher.encryptBlock(self2._prev); + return self2._prev; + } + exports$1h$1.encrypt = function(self2, chunk2) { + while (self2._cache.length < chunk2.length) { + self2._cache = Buffer4.concat([self2._cache, getBlock(self2)]); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$1h$1; +} +function dew$1f$1() { + if (_dewExec$1f$1) + return exports$1g$1; + _dewExec$1f$1 = true; + function incr32(iv) { + var len = iv.length; + var item; + while (len--) { + item = iv.readUInt8(len); + if (item === 255) { + iv.writeUInt8(0, len); + } else { + item++; + iv.writeUInt8(item, len); + break; + } + } + } + exports$1g$1 = incr32; + return exports$1g$1; +} +function dew$1e$1() { + if (_dewExec$1e$1) + return exports$1f$1; + _dewExec$1e$1 = true; + var xor2 = dew$1l(); + var Buffer4 = dew$1T().Buffer; + var incr32 = dew$1f$1(); + function getBlock(self2) { + var out = self2._cipher.encryptBlockRaw(self2._prev); + incr32(self2._prev); + return out; + } + var blockSize = 16; + exports$1f$1.encrypt = function(self2, chunk2) { + var chunkNum = Math.ceil(chunk2.length / blockSize); + var start = self2._cache.length; + self2._cache = Buffer4.concat([self2._cache, Buffer4.allocUnsafe(chunkNum * blockSize)]); + for (var i7 = 0; i7 < chunkNum; i7++) { + var out = getBlock(self2); + var offset = start + i7 * blockSize; + self2._cache.writeUInt32BE(out[0], offset + 0); + self2._cache.writeUInt32BE(out[1], offset + 4); + self2._cache.writeUInt32BE(out[2], offset + 8); + self2._cache.writeUInt32BE(out[3], offset + 12); + } + var pad2 = self2._cache.slice(0, chunk2.length); + self2._cache = self2._cache.slice(chunk2.length); + return xor2(chunk2, pad2); + }; + return exports$1f$1; +} +function dew$1d$1() { + if (_dewExec$1d$1) + return exports$1e$1; + _dewExec$1d$1 = true; + var modeModules = { + ECB: dew$1m(), + CBC: dew$1k(), + CFB: dew$1j(), + CFB8: dew$1i$1(), + CFB1: dew$1h$1(), + OFB: dew$1g$1(), + CTR: dew$1e$1(), + GCM: dew$1e$1() + }; + var modes = _list; + for (var key in modes) { + modes[key].module = modeModules[modes[key].mode]; + } + exports$1e$1 = modes; + return exports$1e$1; +} +function dew$1c$1() { + if (_dewExec$1c$1) + return exports$1d$1; + _dewExec$1c$1 = true; + var Buffer4 = dew$1T().Buffer; + function asUInt32Array(buf) { + if (!Buffer4.isBuffer(buf)) + buf = Buffer4.from(buf); + var len = buf.length / 4 | 0; + var out = new Array(len); + for (var i7 = 0; i7 < len; i7++) { + out[i7] = buf.readUInt32BE(i7 * 4); + } + return out; + } + function scrubVec(v8) { + for (var i7 = 0; i7 < v8.length; v8++) { + v8[i7] = 0; + } + } + function cryptBlock(M6, keySchedule, SUB_MIX, SBOX, nRounds) { + var SUB_MIX0 = SUB_MIX[0]; + var SUB_MIX1 = SUB_MIX[1]; + var SUB_MIX2 = SUB_MIX[2]; + var SUB_MIX3 = SUB_MIX[3]; + var s0 = M6[0] ^ keySchedule[0]; + var s1 = M6[1] ^ keySchedule[1]; + var s22 = M6[2] ^ keySchedule[2]; + var s32 = M6[3] ^ keySchedule[3]; + var t0, t1, t22, t32; + var ksRow = 4; + for (var round2 = 1; round2 < nRounds; round2++) { + t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s22 >>> 8 & 255] ^ SUB_MIX3[s32 & 255] ^ keySchedule[ksRow++]; + t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s22 >>> 16 & 255] ^ SUB_MIX2[s32 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++]; + t22 = SUB_MIX0[s22 >>> 24] ^ SUB_MIX1[s32 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++]; + t32 = SUB_MIX0[s32 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s22 & 255] ^ keySchedule[ksRow++]; + s0 = t0; + s1 = t1; + s22 = t22; + s32 = t32; + } + t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s22 >>> 8 & 255] << 8 | SBOX[s32 & 255]) ^ keySchedule[ksRow++]; + t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s22 >>> 16 & 255] << 16 | SBOX[s32 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++]; + t22 = (SBOX[s22 >>> 24] << 24 | SBOX[s32 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++]; + t32 = (SBOX[s32 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s22 & 255]) ^ keySchedule[ksRow++]; + t0 = t0 >>> 0; + t1 = t1 >>> 0; + t22 = t22 >>> 0; + t32 = t32 >>> 0; + return [t0, t1, t22, t32]; + } + var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; + var G5 = function() { + var d7 = new Array(256); + for (var j6 = 0; j6 < 256; j6++) { + if (j6 < 128) { + d7[j6] = j6 << 1; + } else { + d7[j6] = j6 << 1 ^ 283; + } + } + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX = [[], [], [], []]; + var INV_SUB_MIX = [[], [], [], []]; + var x7 = 0; + var xi = 0; + for (var i7 = 0; i7 < 256; ++i7) { + var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; + sx = sx >>> 8 ^ sx & 255 ^ 99; + SBOX[x7] = sx; + INV_SBOX[sx] = x7; + var x22 = d7[x7]; + var x42 = d7[x22]; + var x8 = d7[x42]; + var t8 = d7[sx] * 257 ^ sx * 16843008; + SUB_MIX[0][x7] = t8 << 24 | t8 >>> 8; + SUB_MIX[1][x7] = t8 << 16 | t8 >>> 16; + SUB_MIX[2][x7] = t8 << 8 | t8 >>> 24; + SUB_MIX[3][x7] = t8; + t8 = x8 * 16843009 ^ x42 * 65537 ^ x22 * 257 ^ x7 * 16843008; + INV_SUB_MIX[0][sx] = t8 << 24 | t8 >>> 8; + INV_SUB_MIX[1][sx] = t8 << 16 | t8 >>> 16; + INV_SUB_MIX[2][sx] = t8 << 8 | t8 >>> 24; + INV_SUB_MIX[3][sx] = t8; + if (x7 === 0) { + x7 = xi = 1; + } else { + x7 = x22 ^ d7[d7[d7[x8 ^ x22]]]; + xi ^= d7[d7[xi]]; + } + } + return { + SBOX, + INV_SBOX, + SUB_MIX, + INV_SUB_MIX + }; + }(); + function AES(key) { + (this || _global$j$1)._key = asUInt32Array(key); + this._reset(); + } + AES.blockSize = 4 * 4; + AES.keySize = 256 / 8; + AES.prototype.blockSize = AES.blockSize; + AES.prototype.keySize = AES.keySize; + AES.prototype._reset = function() { + var keyWords = (this || _global$j$1)._key; + var keySize = keyWords.length; + var nRounds = keySize + 6; + var ksRows = (nRounds + 1) * 4; + var keySchedule = []; + for (var k6 = 0; k6 < keySize; k6++) { + keySchedule[k6] = keyWords[k6]; + } + for (k6 = keySize; k6 < ksRows; k6++) { + var t8 = keySchedule[k6 - 1]; + if (k6 % keySize === 0) { + t8 = t8 << 8 | t8 >>> 24; + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + t8 ^= RCON[k6 / keySize | 0] << 24; + } else if (keySize > 6 && k6 % keySize === 4) { + t8 = G5.SBOX[t8 >>> 24] << 24 | G5.SBOX[t8 >>> 16 & 255] << 16 | G5.SBOX[t8 >>> 8 & 255] << 8 | G5.SBOX[t8 & 255]; + } + keySchedule[k6] = keySchedule[k6 - keySize] ^ t8; + } + var invKeySchedule = []; + for (var ik = 0; ik < ksRows; ik++) { + var ksR = ksRows - ik; + var tt3 = keySchedule[ksR - (ik % 4 ? 0 : 4)]; + if (ik < 4 || ksR <= 4) { + invKeySchedule[ik] = tt3; + } else { + invKeySchedule[ik] = G5.INV_SUB_MIX[0][G5.SBOX[tt3 >>> 24]] ^ G5.INV_SUB_MIX[1][G5.SBOX[tt3 >>> 16 & 255]] ^ G5.INV_SUB_MIX[2][G5.SBOX[tt3 >>> 8 & 255]] ^ G5.INV_SUB_MIX[3][G5.SBOX[tt3 & 255]]; + } + } + (this || _global$j$1)._nRounds = nRounds; + (this || _global$j$1)._keySchedule = keySchedule; + (this || _global$j$1)._invKeySchedule = invKeySchedule; + }; + AES.prototype.encryptBlockRaw = function(M6) { + M6 = asUInt32Array(M6); + return cryptBlock(M6, (this || _global$j$1)._keySchedule, G5.SUB_MIX, G5.SBOX, (this || _global$j$1)._nRounds); + }; + AES.prototype.encryptBlock = function(M6) { + var out = this.encryptBlockRaw(M6); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[1], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[3], 12); + return buf; + }; + AES.prototype.decryptBlock = function(M6) { + M6 = asUInt32Array(M6); + var m1 = M6[1]; + M6[1] = M6[3]; + M6[3] = m1; + var out = cryptBlock(M6, (this || _global$j$1)._invKeySchedule, G5.INV_SUB_MIX, G5.INV_SBOX, (this || _global$j$1)._nRounds); + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0], 0); + buf.writeUInt32BE(out[3], 4); + buf.writeUInt32BE(out[2], 8); + buf.writeUInt32BE(out[1], 12); + return buf; + }; + AES.prototype.scrub = function() { + scrubVec((this || _global$j$1)._keySchedule); + scrubVec((this || _global$j$1)._invKeySchedule); + scrubVec((this || _global$j$1)._key); + }; + exports$1d$1.AES = AES; + return exports$1d$1; +} +function dew$1b$1() { + if (_dewExec$1b$1) + return exports$1c$1; + _dewExec$1b$1 = true; + var Buffer4 = dew$1T().Buffer; + var ZEROES = Buffer4.alloc(16, 0); + function toArray3(buf) { + return [buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12)]; + } + function fromArray(out) { + var buf = Buffer4.allocUnsafe(16); + buf.writeUInt32BE(out[0] >>> 0, 0); + buf.writeUInt32BE(out[1] >>> 0, 4); + buf.writeUInt32BE(out[2] >>> 0, 8); + buf.writeUInt32BE(out[3] >>> 0, 12); + return buf; + } + function GHASH(key) { + (this || _global$i$1).h = key; + (this || _global$i$1).state = Buffer4.alloc(16, 0); + (this || _global$i$1).cache = Buffer4.allocUnsafe(0); + } + GHASH.prototype.ghash = function(block) { + var i7 = -1; + while (++i7 < block.length) { + (this || _global$i$1).state[i7] ^= block[i7]; + } + this._multiply(); + }; + GHASH.prototype._multiply = function() { + var Vi = toArray3((this || _global$i$1).h); + var Zi = [0, 0, 0, 0]; + var j6, xi, lsbVi; + var i7 = -1; + while (++i7 < 128) { + xi = ((this || _global$i$1).state[~~(i7 / 8)] & 1 << 7 - i7 % 8) !== 0; + if (xi) { + Zi[0] ^= Vi[0]; + Zi[1] ^= Vi[1]; + Zi[2] ^= Vi[2]; + Zi[3] ^= Vi[3]; + } + lsbVi = (Vi[3] & 1) !== 0; + for (j6 = 3; j6 > 0; j6--) { + Vi[j6] = Vi[j6] >>> 1 | (Vi[j6 - 1] & 1) << 31; + } + Vi[0] = Vi[0] >>> 1; + if (lsbVi) { + Vi[0] = Vi[0] ^ 225 << 24; + } + } + (this || _global$i$1).state = fromArray(Zi); + }; + GHASH.prototype.update = function(buf) { + (this || _global$i$1).cache = Buffer4.concat([(this || _global$i$1).cache, buf]); + var chunk2; + while ((this || _global$i$1).cache.length >= 16) { + chunk2 = (this || _global$i$1).cache.slice(0, 16); + (this || _global$i$1).cache = (this || _global$i$1).cache.slice(16); + this.ghash(chunk2); + } + }; + GHASH.prototype.final = function(abl, bl) { + if ((this || _global$i$1).cache.length) { + this.ghash(Buffer4.concat([(this || _global$i$1).cache, ZEROES], 16)); + } + this.ghash(fromArray([0, abl, 0, bl])); + return (this || _global$i$1).state; + }; + exports$1c$1 = GHASH; + return exports$1c$1; +} +function dew$1a$1() { + if (_dewExec$1a$1) + return exports$1b$1; + _dewExec$1a$1 = true; + var aes = dew$1c$1(); + var Buffer4 = dew$1T().Buffer; + var Transform2 = dew$1G(); + var inherits2 = dew$f$2(); + var GHASH = dew$1b$1(); + var xor2 = dew$1l(); + var incr32 = dew$1f$1(); + function xorTest(a7, b8) { + var out = 0; + if (a7.length !== b8.length) + out++; + var len = Math.min(a7.length, b8.length); + for (var i7 = 0; i7 < len; ++i7) { + out += a7[i7] ^ b8[i7]; + } + return out; + } + function calcIv(self2, iv, ck) { + if (iv.length === 12) { + self2._finID = Buffer4.concat([iv, Buffer4.from([0, 0, 0, 1])]); + return Buffer4.concat([iv, Buffer4.from([0, 0, 0, 2])]); + } + var ghash = new GHASH(ck); + var len = iv.length; + var toPad = len % 16; + ghash.update(iv); + if (toPad) { + toPad = 16 - toPad; + ghash.update(Buffer4.alloc(toPad, 0)); + } + ghash.update(Buffer4.alloc(8, 0)); + var ivBits = len * 8; + var tail2 = Buffer4.alloc(8); + tail2.writeUIntBE(ivBits, 0, 8); + ghash.update(tail2); + self2._finID = ghash.state; + var out = Buffer4.from(self2._finID); + incr32(out); + return out; + } + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$h$1); + var h8 = Buffer4.alloc(4, 0); + (this || _global$h$1)._cipher = new aes.AES(key); + var ck = (this || _global$h$1)._cipher.encryptBlock(h8); + (this || _global$h$1)._ghash = new GHASH(ck); + iv = calcIv(this || _global$h$1, iv, ck); + (this || _global$h$1)._prev = Buffer4.from(iv); + (this || _global$h$1)._cache = Buffer4.allocUnsafe(0); + (this || _global$h$1)._secCache = Buffer4.allocUnsafe(0); + (this || _global$h$1)._decrypt = decrypt; + (this || _global$h$1)._alen = 0; + (this || _global$h$1)._len = 0; + (this || _global$h$1)._mode = mode; + (this || _global$h$1)._authTag = null; + (this || _global$h$1)._called = false; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + if (!(this || _global$h$1)._called && (this || _global$h$1)._alen) { + var rump = 16 - (this || _global$h$1)._alen % 16; + if (rump < 16) { + rump = Buffer4.alloc(rump, 0); + (this || _global$h$1)._ghash.update(rump); + } + } + (this || _global$h$1)._called = true; + var out = (this || _global$h$1)._mode.encrypt(this || _global$h$1, chunk2); + if ((this || _global$h$1)._decrypt) { + (this || _global$h$1)._ghash.update(chunk2); + } else { + (this || _global$h$1)._ghash.update(out); + } + (this || _global$h$1)._len += chunk2.length; + return out; + }; + StreamCipher.prototype._final = function() { + if ((this || _global$h$1)._decrypt && !(this || _global$h$1)._authTag) + throw new Error("Unsupported state or unable to authenticate data"); + var tag = xor2((this || _global$h$1)._ghash.final((this || _global$h$1)._alen * 8, (this || _global$h$1)._len * 8), (this || _global$h$1)._cipher.encryptBlock((this || _global$h$1)._finID)); + if ((this || _global$h$1)._decrypt && xorTest(tag, (this || _global$h$1)._authTag)) + throw new Error("Unsupported state or unable to authenticate data"); + (this || _global$h$1)._authTag = tag; + (this || _global$h$1)._cipher.scrub(); + }; + StreamCipher.prototype.getAuthTag = function getAuthTag() { + if ((this || _global$h$1)._decrypt || !Buffer4.isBuffer((this || _global$h$1)._authTag)) + throw new Error("Attempting to get auth tag in unsupported state"); + return (this || _global$h$1)._authTag; + }; + StreamCipher.prototype.setAuthTag = function setAuthTag(tag) { + if (!(this || _global$h$1)._decrypt) + throw new Error("Attempting to set auth tag in unsupported state"); + (this || _global$h$1)._authTag = tag; + }; + StreamCipher.prototype.setAAD = function setAAD(buf) { + if ((this || _global$h$1)._called) + throw new Error("Attempting to set AAD in unsupported state"); + (this || _global$h$1)._ghash.update(buf); + (this || _global$h$1)._alen += buf.length; + }; + exports$1b$1 = StreamCipher; + return exports$1b$1; +} +function dew$19$1() { + if (_dewExec$19$1) + return exports$1a$1; + _dewExec$19$1 = true; + var aes = dew$1c$1(); + var Buffer4 = dew$1T().Buffer; + var Transform2 = dew$1G(); + var inherits2 = dew$f$2(); + function StreamCipher(mode, key, iv, decrypt) { + Transform2.call(this || _global$g$1); + (this || _global$g$1)._cipher = new aes.AES(key); + (this || _global$g$1)._prev = Buffer4.from(iv); + (this || _global$g$1)._cache = Buffer4.allocUnsafe(0); + (this || _global$g$1)._secCache = Buffer4.allocUnsafe(0); + (this || _global$g$1)._decrypt = decrypt; + (this || _global$g$1)._mode = mode; + } + inherits2(StreamCipher, Transform2); + StreamCipher.prototype._update = function(chunk2) { + return (this || _global$g$1)._mode.encrypt(this || _global$g$1, chunk2, (this || _global$g$1)._decrypt); + }; + StreamCipher.prototype._final = function() { + (this || _global$g$1)._cipher.scrub(); + }; + exports$1a$1 = StreamCipher; + return exports$1a$1; +} +function dew$18$1() { + if (_dewExec$18$1) + return exports$19$1; + _dewExec$18$1 = true; + var Buffer4 = dew$1T().Buffer; + var MD5 = dew$1Q(); + function EVP_BytesToKey(password, salt, keyBits, ivLen) { + if (!Buffer4.isBuffer(password)) + password = Buffer4.from(password, "binary"); + if (salt) { + if (!Buffer4.isBuffer(salt)) + salt = Buffer4.from(salt, "binary"); + if (salt.length !== 8) + throw new RangeError("salt should be Buffer with 8 byte length"); + } + var keyLen = keyBits / 8; + var key = Buffer4.alloc(keyLen); + var iv = Buffer4.alloc(ivLen || 0); + var tmp = Buffer4.alloc(0); + while (keyLen > 0 || ivLen > 0) { + var hash = new MD5(); + hash.update(tmp); + hash.update(password); + if (salt) + hash.update(salt); + tmp = hash.digest(); + var used = 0; + if (keyLen > 0) { + var keyStart = key.length - keyLen; + used = Math.min(keyLen, tmp.length); + tmp.copy(key, keyStart, 0, used); + keyLen -= used; + } + if (used < tmp.length && ivLen > 0) { + var ivStart = iv.length - ivLen; + var length = Math.min(ivLen, tmp.length - used); + tmp.copy(iv, ivStart, used, used + length); + ivLen -= length; + } + } + tmp.fill(0); + return { + key, + iv + }; + } + exports$19$1 = EVP_BytesToKey; + return exports$19$1; +} +function dew$17$1() { + if (_dewExec$17$1) + return exports$18$1; + _dewExec$17$1 = true; + var MODES = dew$1d$1(); + var AuthCipher = dew$1a$1(); + var Buffer4 = dew$1T().Buffer; + var StreamCipher = dew$19$1(); + var Transform2 = dew$1G(); + var aes = dew$1c$1(); + var ebtk = dew$18$1(); + var inherits2 = dew$f$2(); + function Cipher2(mode, key, iv) { + Transform2.call(this || _global$f$1); + (this || _global$f$1)._cache = new Splitter(); + (this || _global$f$1)._cipher = new aes.AES(key); + (this || _global$f$1)._prev = Buffer4.from(iv); + (this || _global$f$1)._mode = mode; + (this || _global$f$1)._autopadding = true; + } + inherits2(Cipher2, Transform2); + Cipher2.prototype._update = function(data) { + (this || _global$f$1)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$f$1)._cache.get()) { + thing = (this || _global$f$1)._mode.encrypt(this || _global$f$1, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + var PADDING = Buffer4.alloc(16, 16); + Cipher2.prototype._final = function() { + var chunk2 = (this || _global$f$1)._cache.flush(); + if ((this || _global$f$1)._autopadding) { + chunk2 = (this || _global$f$1)._mode.encrypt(this || _global$f$1, chunk2); + (this || _global$f$1)._cipher.scrub(); + return chunk2; + } + if (!chunk2.equals(PADDING)) { + (this || _global$f$1)._cipher.scrub(); + throw new Error("data not multiple of block length"); + } + }; + Cipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$f$1)._autopadding = !!setTo; + return this || _global$f$1; + }; + function Splitter() { + (this || _global$f$1).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$f$1).cache = Buffer4.concat([(this || _global$f$1).cache, data]); + }; + Splitter.prototype.get = function() { + if ((this || _global$f$1).cache.length > 15) { + var out = (this || _global$f$1).cache.slice(0, 16); + (this || _global$f$1).cache = (this || _global$f$1).cache.slice(16); + return out; + } + return null; + }; + Splitter.prototype.flush = function() { + var len = 16 - (this || _global$f$1).cache.length; + var padBuff = Buffer4.allocUnsafe(len); + var i7 = -1; + while (++i7 < len) { + padBuff.writeUInt8(len, i7); + } + return Buffer4.concat([(this || _global$f$1).cache, padBuff]); + }; + function createCipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv); + } + return new Cipher2(config3.module, password, iv); + } + function createCipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + exports$18$1.createCipheriv = createCipheriv2; + exports$18$1.createCipher = createCipher2; + return exports$18$1; +} +function dew$16$1() { + if (_dewExec$16$1) + return exports$17$1; + _dewExec$16$1 = true; + var AuthCipher = dew$1a$1(); + var Buffer4 = dew$1T().Buffer; + var MODES = dew$1d$1(); + var StreamCipher = dew$19$1(); + var Transform2 = dew$1G(); + var aes = dew$1c$1(); + var ebtk = dew$18$1(); + var inherits2 = dew$f$2(); + function Decipher2(mode, key, iv) { + Transform2.call(this || _global$e$1); + (this || _global$e$1)._cache = new Splitter(); + (this || _global$e$1)._last = void 0; + (this || _global$e$1)._cipher = new aes.AES(key); + (this || _global$e$1)._prev = Buffer4.from(iv); + (this || _global$e$1)._mode = mode; + (this || _global$e$1)._autopadding = true; + } + inherits2(Decipher2, Transform2); + Decipher2.prototype._update = function(data) { + (this || _global$e$1)._cache.add(data); + var chunk2; + var thing; + var out = []; + while (chunk2 = (this || _global$e$1)._cache.get((this || _global$e$1)._autopadding)) { + thing = (this || _global$e$1)._mode.decrypt(this || _global$e$1, chunk2); + out.push(thing); + } + return Buffer4.concat(out); + }; + Decipher2.prototype._final = function() { + var chunk2 = (this || _global$e$1)._cache.flush(); + if ((this || _global$e$1)._autopadding) { + return unpad((this || _global$e$1)._mode.decrypt(this || _global$e$1, chunk2)); + } else if (chunk2) { + throw new Error("data not multiple of block length"); + } + }; + Decipher2.prototype.setAutoPadding = function(setTo) { + (this || _global$e$1)._autopadding = !!setTo; + return this || _global$e$1; + }; + function Splitter() { + (this || _global$e$1).cache = Buffer4.allocUnsafe(0); + } + Splitter.prototype.add = function(data) { + (this || _global$e$1).cache = Buffer4.concat([(this || _global$e$1).cache, data]); + }; + Splitter.prototype.get = function(autoPadding) { + var out; + if (autoPadding) { + if ((this || _global$e$1).cache.length > 16) { + out = (this || _global$e$1).cache.slice(0, 16); + (this || _global$e$1).cache = (this || _global$e$1).cache.slice(16); + return out; + } + } else { + if ((this || _global$e$1).cache.length >= 16) { + out = (this || _global$e$1).cache.slice(0, 16); + (this || _global$e$1).cache = (this || _global$e$1).cache.slice(16); + return out; + } + } + return null; + }; + Splitter.prototype.flush = function() { + if ((this || _global$e$1).cache.length) + return (this || _global$e$1).cache; + }; + function unpad(last2) { + var padded = last2[15]; + if (padded < 1 || padded > 16) { + throw new Error("unable to decrypt data"); + } + var i7 = -1; + while (++i7 < padded) { + if (last2[i7 + (16 - padded)] !== padded) { + throw new Error("unable to decrypt data"); + } + } + if (padded === 16) + return; + return last2.slice(0, 16 - padded); + } + function createDecipheriv2(suite, password, iv) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + if (typeof iv === "string") + iv = Buffer4.from(iv); + if (config3.mode !== "GCM" && iv.length !== config3.iv) + throw new TypeError("invalid iv length " + iv.length); + if (typeof password === "string") + password = Buffer4.from(password); + if (password.length !== config3.key / 8) + throw new TypeError("invalid key length " + password.length); + if (config3.type === "stream") { + return new StreamCipher(config3.module, password, iv, true); + } else if (config3.type === "auth") { + return new AuthCipher(config3.module, password, iv, true); + } + return new Decipher2(config3.module, password, iv); + } + function createDecipher2(suite, password) { + var config3 = MODES[suite.toLowerCase()]; + if (!config3) + throw new TypeError("invalid suite type"); + var keys2 = ebtk(password, false, config3.key, config3.iv); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + exports$17$1.createDecipher = createDecipher2; + exports$17$1.createDecipheriv = createDecipheriv2; + return exports$17$1; +} +function dew$15$1() { + if (_dewExec$15$1) + return exports$16$1; + _dewExec$15$1 = true; + var ciphers = dew$17$1(); + var deciphers = dew$16$1(); + var modes = _list; + function getCiphers2() { + return Object.keys(modes); + } + exports$16$1.createCipher = exports$16$1.Cipher = ciphers.createCipher; + exports$16$1.createCipheriv = exports$16$1.Cipheriv = ciphers.createCipheriv; + exports$16$1.createDecipher = exports$16$1.Decipher = deciphers.createDecipher; + exports$16$1.createDecipheriv = exports$16$1.Decipheriv = deciphers.createDecipheriv; + exports$16$1.listCiphers = exports$16$1.getCiphers = getCiphers2; + return exports$16$1; +} +function dew$14$1() { + if (_dewExec$14$1) + return exports$15$1; + _dewExec$14$1 = true; + exports$15$1["des-ecb"] = { + key: 8, + iv: 0 + }; + exports$15$1["des-cbc"] = exports$15$1.des = { + key: 8, + iv: 8 + }; + exports$15$1["des-ede3-cbc"] = exports$15$1.des3 = { + key: 24, + iv: 8 + }; + exports$15$1["des-ede3"] = { + key: 24, + iv: 0 + }; + exports$15$1["des-ede-cbc"] = { + key: 16, + iv: 8 + }; + exports$15$1["des-ede"] = { + key: 16, + iv: 0 + }; + return exports$15$1; +} +function dew$13$1() { + if (_dewExec$13$1) + return exports$14$1; + _dewExec$13$1 = true; + var DES = dew$1n(); + var aes = dew$15$1(); + var aesModes = dew$1d$1(); + var desModes = dew$14$1(); + var ebtk = dew$18$1(); + function createCipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createCipheriv2(suite, keys2.key, keys2.iv); + } + function createDecipher2(suite, password) { + suite = suite.toLowerCase(); + var keyLen, ivLen; + if (aesModes[suite]) { + keyLen = aesModes[suite].key; + ivLen = aesModes[suite].iv; + } else if (desModes[suite]) { + keyLen = desModes[suite].key * 8; + ivLen = desModes[suite].iv; + } else { + throw new TypeError("invalid suite type"); + } + var keys2 = ebtk(password, false, keyLen, ivLen); + return createDecipheriv2(suite, keys2.key, keys2.iv); + } + function createCipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createCipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite + }); + throw new TypeError("invalid suite type"); + } + function createDecipheriv2(suite, key, iv) { + suite = suite.toLowerCase(); + if (aesModes[suite]) + return aes.createDecipheriv(suite, key, iv); + if (desModes[suite]) + return new DES({ + key, + iv, + mode: suite, + decrypt: true + }); + throw new TypeError("invalid suite type"); + } + function getCiphers2() { + return Object.keys(desModes).concat(aes.getCiphers()); + } + exports$14$1.createCipher = exports$14$1.Cipher = createCipher2; + exports$14$1.createCipheriv = exports$14$1.Cipheriv = createCipheriv2; + exports$14$1.createDecipher = exports$14$1.Decipher = createDecipher2; + exports$14$1.createDecipheriv = exports$14$1.Decipheriv = createDecipheriv2; + exports$14$1.listCiphers = exports$14$1.getCiphers = getCiphers2; + return exports$14$1; +} +function dew$12$1() { + if (_dewExec$12$1) + return module$6.exports; + _dewExec$12$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$d$1).negative = 0; + (this || _global$d$1).words = null; + (this || _global$d$1).length = 0; + (this || _global$d$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$d$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$d$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$d$1).words = [number & 67108863]; + (this || _global$d$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$d$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$d$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$d$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$d$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$d$1).words = [0]; + (this || _global$d$1).length = 1; + return this || _global$d$1; + } + (this || _global$d$1).length = Math.ceil(number.length / 3); + (this || _global$d$1).words = new Array((this || _global$d$1).length); + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + (this || _global$d$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$d$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$d$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$d$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$d$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$d$1).length = Math.ceil((number.length - start) / 6); + (this || _global$d$1).words = new Array((this || _global$d$1).length); + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + (this || _global$d$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$d$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$d$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$d$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$d$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$d$1).words = [0]; + (this || _global$d$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$d$1).words[0] + word < 67108864) { + (this || _global$d$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$d$1).words[0] + word < 67108864) { + (this || _global$d$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$d$1).length); + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + dest.words[i7] = (this || _global$d$1).words[i7]; + } + dest.length = (this || _global$d$1).length; + dest.negative = (this || _global$d$1).negative; + dest.red = (this || _global$d$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$d$1).length < size2) { + (this || _global$d$1).words[(this || _global$d$1).length++] = 0; + } + return this || _global$d$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$d$1).length > 1 && (this || _global$d$1).words[(this || _global$d$1).length - 1] === 0) { + (this || _global$d$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$d$1).length === 1 && (this || _global$d$1).words[0] === 0) { + (this || _global$d$1).negative = 0; + } + return this || _global$d$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$d$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + var w6 = (this || _global$d$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$d$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$d$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$d$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$d$1).words[0]; + if ((this || _global$d$1).length === 2) { + ret += (this || _global$d$1).words[1] * 67108864; + } else if ((this || _global$d$1).length === 3 && (this || _global$d$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$d$1).words[1] * 67108864; + } else if ((this || _global$d$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$d$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$d$1).words[(this || _global$d$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$d$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + var b8 = this._zeroBits((this || _global$d$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$d$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$d$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$d$1).negative ^= 1; + } + return this || _global$d$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$d$1).length < num.length) { + (this || _global$d$1).words[(this || _global$d$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$d$1).words[i7] = (this || _global$d$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$d$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$d$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$d$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$d$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$d$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$d$1).words[i7] = (this || _global$d$1).words[i7] & num.words[i7]; + } + (this || _global$d$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$d$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$d$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$d$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$d$1).length > num.length) { + a7 = this || _global$d$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$d$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$d$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$d$1).words[i7] = a7.words[i7]; + } + } + (this || _global$d$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$d$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$d$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$d$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$d$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$d$1).words[i7] = ~(this || _global$d$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$d$1).words[i7] = ~(this || _global$d$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$d$1).words[off3] = (this || _global$d$1).words[off3] | 1 << wbit; + } else { + (this || _global$d$1).words[off3] = (this || _global$d$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$d$1).negative !== 0 && num.negative === 0) { + (this || _global$d$1).negative = 0; + r8 = this.isub(num); + (this || _global$d$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$d$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$d$1).length > num.length) { + a7 = this || _global$d$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$d$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$d$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$d$1).length = a7.length; + if (carry !== 0) { + (this || _global$d$1).words[(this || _global$d$1).length] = carry; + (this || _global$d$1).length++; + } else if (a7 !== (this || _global$d$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$d$1).words[i7] = a7.words[i7]; + } + } + return this || _global$d$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$d$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$d$1).negative !== 0) { + (this || _global$d$1).negative = 0; + res = num.sub(this || _global$d$1); + (this || _global$d$1).negative = 1; + return res; + } + if ((this || _global$d$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$d$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$d$1).negative !== 0) { + (this || _global$d$1).negative = 0; + this.iadd(num); + (this || _global$d$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$d$1).negative = 0; + (this || _global$d$1).length = 1; + (this || _global$d$1).words[0] = 0; + return this || _global$d$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$d$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$d$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$d$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$d$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$d$1).words[i7] = a7.words[i7]; + } + } + (this || _global$d$1).length = Math.max((this || _global$d$1).length, i7); + if (a7 !== (this || _global$d$1)) { + (this || _global$d$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$d$1).length + num.length; + if ((this || _global$d$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$d$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$d$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$d$1, num, out); + } else { + res = jumboMulTo(this || _global$d$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$d$1).x = x7; + (this || _global$d$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$d$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$d$1).length + num.length); + return jumboMulTo(this || _global$d$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$d$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$d$1).length; i7++) { + var w6 = ((this || _global$d$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$d$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$d$1).words[i7] = carry; + (this || _global$d$1).length++; + } + return this || _global$d$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$d$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$d$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$d$1).length; i7++) { + var newCarry = (this || _global$d$1).words[i7] & carryMask; + var c7 = ((this || _global$d$1).words[i7] | 0) - newCarry << r8; + (this || _global$d$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$d$1).words[i7] = carry; + (this || _global$d$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$d$1).length - 1; i7 >= 0; i7--) { + (this || _global$d$1).words[i7 + s7] = (this || _global$d$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$d$1).words[i7] = 0; + } + (this || _global$d$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$d$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$d$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$d$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$d$1).length > s7) { + (this || _global$d$1).length -= s7; + for (i7 = 0; i7 < (this || _global$d$1).length; i7++) { + (this || _global$d$1).words[i7] = (this || _global$d$1).words[i7 + s7]; + } + } else { + (this || _global$d$1).words[0] = 0; + (this || _global$d$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$d$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$d$1).words[i7] | 0; + (this || _global$d$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$d$1).length === 0) { + (this || _global$d$1).words[0] = 0; + (this || _global$d$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$d$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$d$1).length <= s7) + return false; + var w6 = (this || _global$d$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$d$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$d$1).length <= s7) { + return this || _global$d$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$d$1).length = Math.min(s7, (this || _global$d$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$d$1).words[(this || _global$d$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$d$1).negative !== 0) { + if ((this || _global$d$1).length === 1 && ((this || _global$d$1).words[0] | 0) < num) { + (this || _global$d$1).words[0] = num - ((this || _global$d$1).words[0] | 0); + (this || _global$d$1).negative = 0; + return this || _global$d$1; + } + (this || _global$d$1).negative = 0; + this.isubn(num); + (this || _global$d$1).negative = 1; + return this || _global$d$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$d$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$d$1).length && (this || _global$d$1).words[i7] >= 67108864; i7++) { + (this || _global$d$1).words[i7] -= 67108864; + if (i7 === (this || _global$d$1).length - 1) { + (this || _global$d$1).words[i7 + 1] = 1; + } else { + (this || _global$d$1).words[i7 + 1]++; + } + } + (this || _global$d$1).length = Math.max((this || _global$d$1).length, i7 + 1); + return this || _global$d$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$d$1).negative !== 0) { + (this || _global$d$1).negative = 0; + this.iaddn(num); + (this || _global$d$1).negative = 1; + return this || _global$d$1; + } + (this || _global$d$1).words[0] -= num; + if ((this || _global$d$1).length === 1 && (this || _global$d$1).words[0] < 0) { + (this || _global$d$1).words[0] = -(this || _global$d$1).words[0]; + (this || _global$d$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$d$1).length && (this || _global$d$1).words[i7] < 0; i7++) { + (this || _global$d$1).words[i7] += 67108864; + (this || _global$d$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$d$1).negative = 0; + return this || _global$d$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$d$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$d$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$d$1).length - shift; i7++) { + w6 = ((this || _global$d$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$d$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$d$1).length; i7++) { + w6 = -((this || _global$d$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$d$1).words[i7] = w6 & 67108863; + } + (this || _global$d$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$d$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$d$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$d$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$d$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$d$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$d$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$d$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$d$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$d$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$d$1).words[i7] | 0) + carry * 67108864; + (this || _global$d$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$d$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$d$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$d$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$d$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$d$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$d$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$d$1).words[s7] |= q5; + return this || _global$d$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$d$1).length; i7++) { + var w6 = (this || _global$d$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$d$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$d$1).words[i7] = carry; + (this || _global$d$1).length++; + } + return this || _global$d$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$d$1).length === 1 && (this || _global$d$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$d$1).negative !== 0 && !negative) + return -1; + if ((this || _global$d$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$d$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$d$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$d$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$d$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$d$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$d$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$d$1).length > num.length) + return 1; + if ((this || _global$d$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$d$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$d$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$d$1).red, "Already a number in reduction context"); + assert4((this || _global$d$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$d$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$d$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$d$1).red.convertFrom(this || _global$d$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$d$1).red = ctx; + return this || _global$d$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$d$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$d$1).red, "redAdd works only with red numbers"); + return (this || _global$d$1).red.add(this || _global$d$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$d$1).red, "redIAdd works only with red numbers"); + return (this || _global$d$1).red.iadd(this || _global$d$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$d$1).red, "redSub works only with red numbers"); + return (this || _global$d$1).red.sub(this || _global$d$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$d$1).red, "redISub works only with red numbers"); + return (this || _global$d$1).red.isub(this || _global$d$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$d$1).red, "redShl works only with red numbers"); + return (this || _global$d$1).red.shl(this || _global$d$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$d$1).red, "redMul works only with red numbers"); + (this || _global$d$1).red._verify2(this || _global$d$1, num); + return (this || _global$d$1).red.mul(this || _global$d$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$d$1).red, "redMul works only with red numbers"); + (this || _global$d$1).red._verify2(this || _global$d$1, num); + return (this || _global$d$1).red.imul(this || _global$d$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$d$1).red, "redSqr works only with red numbers"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.sqr(this || _global$d$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$d$1).red, "redISqr works only with red numbers"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.isqr(this || _global$d$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$d$1).red, "redSqrt works only with red numbers"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.sqrt(this || _global$d$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$d$1).red, "redInvm works only with red numbers"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.invm(this || _global$d$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$d$1).red, "redNeg works only with red numbers"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.neg(this || _global$d$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$d$1).red && !num.red, "redPow(normalNum)"); + (this || _global$d$1).red._verify1(this || _global$d$1); + return (this || _global$d$1).red.pow(this || _global$d$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$d$1).name = name2; + (this || _global$d$1).p = new BN(p7, 16); + (this || _global$d$1).n = (this || _global$d$1).p.bitLength(); + (this || _global$d$1).k = new BN(1).iushln((this || _global$d$1).n).isub((this || _global$d$1).p); + (this || _global$d$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$d$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$d$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$d$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$d$1).n); + var cmp = rlen < (this || _global$d$1).n ? -1 : r8.ucmp((this || _global$d$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$d$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$d$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$d$1).k); + }; + function K256() { + MPrime.call(this || _global$d$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$d$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$d$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$d$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$d$1).m = prime.p; + (this || _global$d$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$d$1).m = m7; + (this || _global$d$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$d$1).prime) + return (this || _global$d$1).prime.ireduce(a7)._forceRed(this || _global$d$1); + return a7.umod((this || _global$d$1).m)._forceRed(this || _global$d$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$d$1).m.sub(a7)._forceRed(this || _global$d$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$d$1).m) >= 0) { + res.isub((this || _global$d$1).m); + } + return res._forceRed(this || _global$d$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$d$1).m) >= 0) { + res.isub((this || _global$d$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$d$1).m); + } + return res._forceRed(this || _global$d$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$d$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$d$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$d$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$d$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$d$1); + var nOne = one.redNeg(); + var lpow = (this || _global$d$1).m.subn(1).iushrn(1); + var z6 = (this || _global$d$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$d$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$d$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$d$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$d$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$d$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$d$1, m7); + (this || _global$d$1).shift = (this || _global$d$1).m.bitLength(); + if ((this || _global$d$1).shift % 26 !== 0) { + (this || _global$d$1).shift += 26 - (this || _global$d$1).shift % 26; + } + (this || _global$d$1).r = new BN(1).iushln((this || _global$d$1).shift); + (this || _global$d$1).r2 = this.imod((this || _global$d$1).r.sqr()); + (this || _global$d$1).rinv = (this || _global$d$1).r._invmp((this || _global$d$1).m); + (this || _global$d$1).minv = (this || _global$d$1).rinv.mul((this || _global$d$1).r).isubn(1).div((this || _global$d$1).m); + (this || _global$d$1).minv = (this || _global$d$1).minv.umod((this || _global$d$1).r); + (this || _global$d$1).minv = (this || _global$d$1).r.sub((this || _global$d$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$d$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$d$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$d$1).shift).mul((this || _global$d$1).minv).imaskn((this || _global$d$1).shift).mul((this || _global$d$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$d$1).shift); + var res = u7; + if (u7.cmp((this || _global$d$1).m) >= 0) { + res = u7.isub((this || _global$d$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$d$1).m); + } + return res._forceRed(this || _global$d$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$d$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$d$1).shift).mul((this || _global$d$1).minv).imaskn((this || _global$d$1).shift).mul((this || _global$d$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$d$1).shift); + var res = u7; + if (u7.cmp((this || _global$d$1).m) >= 0) { + res = u7.isub((this || _global$d$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$d$1).m); + } + return res._forceRed(this || _global$d$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$d$1).m).mul((this || _global$d$1).r2)); + return res._forceRed(this || _global$d$1); + }; + })(module$6, exports$13$1); + return module$6.exports; +} +function dew$11$1() { + if (_dewExec$11$1) + return module$5.exports; + _dewExec$11$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$c$1).negative = 0; + (this || _global$c$1).words = null; + (this || _global$c$1).length = 0; + (this || _global$c$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$c$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$c$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$c$1).words = [number & 67108863]; + (this || _global$c$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$c$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$c$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$c$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$c$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$c$1).words = [0]; + (this || _global$c$1).length = 1; + return this || _global$c$1; + } + (this || _global$c$1).length = Math.ceil(number.length / 3); + (this || _global$c$1).words = new Array((this || _global$c$1).length); + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + (this || _global$c$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$c$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$c$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$c$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$c$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$c$1).length = Math.ceil((number.length - start) / 6); + (this || _global$c$1).words = new Array((this || _global$c$1).length); + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + (this || _global$c$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$c$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$c$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$c$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$c$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$c$1).words = [0]; + (this || _global$c$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$c$1).words[0] + word < 67108864) { + (this || _global$c$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$c$1).words[0] + word < 67108864) { + (this || _global$c$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$c$1).length); + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + dest.words[i7] = (this || _global$c$1).words[i7]; + } + dest.length = (this || _global$c$1).length; + dest.negative = (this || _global$c$1).negative; + dest.red = (this || _global$c$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$c$1).length < size2) { + (this || _global$c$1).words[(this || _global$c$1).length++] = 0; + } + return this || _global$c$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$c$1).length > 1 && (this || _global$c$1).words[(this || _global$c$1).length - 1] === 0) { + (this || _global$c$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$c$1).length === 1 && (this || _global$c$1).words[0] === 0) { + (this || _global$c$1).negative = 0; + } + return this || _global$c$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$c$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + var w6 = (this || _global$c$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$c$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$c$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$c$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$c$1).words[0]; + if ((this || _global$c$1).length === 2) { + ret += (this || _global$c$1).words[1] * 67108864; + } else if ((this || _global$c$1).length === 3 && (this || _global$c$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$c$1).words[1] * 67108864; + } else if ((this || _global$c$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$c$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$c$1).words[(this || _global$c$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$c$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + var b8 = this._zeroBits((this || _global$c$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$c$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$c$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$c$1).negative ^= 1; + } + return this || _global$c$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$c$1).length < num.length) { + (this || _global$c$1).words[(this || _global$c$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$c$1).words[i7] = (this || _global$c$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$c$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$c$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$c$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$c$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$c$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$c$1).words[i7] = (this || _global$c$1).words[i7] & num.words[i7]; + } + (this || _global$c$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$c$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$c$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$c$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$c$1).length > num.length) { + a7 = this || _global$c$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$c$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$c$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$c$1).words[i7] = a7.words[i7]; + } + } + (this || _global$c$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$c$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$c$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$c$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$c$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$c$1).words[i7] = ~(this || _global$c$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$c$1).words[i7] = ~(this || _global$c$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$c$1).words[off3] = (this || _global$c$1).words[off3] | 1 << wbit; + } else { + (this || _global$c$1).words[off3] = (this || _global$c$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$c$1).negative !== 0 && num.negative === 0) { + (this || _global$c$1).negative = 0; + r8 = this.isub(num); + (this || _global$c$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$c$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$c$1).length > num.length) { + a7 = this || _global$c$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$c$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$c$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$c$1).length = a7.length; + if (carry !== 0) { + (this || _global$c$1).words[(this || _global$c$1).length] = carry; + (this || _global$c$1).length++; + } else if (a7 !== (this || _global$c$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$c$1).words[i7] = a7.words[i7]; + } + } + return this || _global$c$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$c$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$c$1).negative !== 0) { + (this || _global$c$1).negative = 0; + res = num.sub(this || _global$c$1); + (this || _global$c$1).negative = 1; + return res; + } + if ((this || _global$c$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$c$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$c$1).negative !== 0) { + (this || _global$c$1).negative = 0; + this.iadd(num); + (this || _global$c$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$c$1).negative = 0; + (this || _global$c$1).length = 1; + (this || _global$c$1).words[0] = 0; + return this || _global$c$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$c$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$c$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$c$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$c$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$c$1).words[i7] = a7.words[i7]; + } + } + (this || _global$c$1).length = Math.max((this || _global$c$1).length, i7); + if (a7 !== (this || _global$c$1)) { + (this || _global$c$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$c$1).length + num.length; + if ((this || _global$c$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$c$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$c$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$c$1, num, out); + } else { + res = jumboMulTo(this || _global$c$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$c$1).x = x7; + (this || _global$c$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$c$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$c$1).length + num.length); + return jumboMulTo(this || _global$c$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$c$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$c$1).length; i7++) { + var w6 = ((this || _global$c$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$c$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$c$1).words[i7] = carry; + (this || _global$c$1).length++; + } + return this || _global$c$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$c$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$c$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$c$1).length; i7++) { + var newCarry = (this || _global$c$1).words[i7] & carryMask; + var c7 = ((this || _global$c$1).words[i7] | 0) - newCarry << r8; + (this || _global$c$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$c$1).words[i7] = carry; + (this || _global$c$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$c$1).length - 1; i7 >= 0; i7--) { + (this || _global$c$1).words[i7 + s7] = (this || _global$c$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$c$1).words[i7] = 0; + } + (this || _global$c$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$c$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$c$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$c$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$c$1).length > s7) { + (this || _global$c$1).length -= s7; + for (i7 = 0; i7 < (this || _global$c$1).length; i7++) { + (this || _global$c$1).words[i7] = (this || _global$c$1).words[i7 + s7]; + } + } else { + (this || _global$c$1).words[0] = 0; + (this || _global$c$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$c$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$c$1).words[i7] | 0; + (this || _global$c$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$c$1).length === 0) { + (this || _global$c$1).words[0] = 0; + (this || _global$c$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$c$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$c$1).length <= s7) + return false; + var w6 = (this || _global$c$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$c$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$c$1).length <= s7) { + return this || _global$c$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$c$1).length = Math.min(s7, (this || _global$c$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$c$1).words[(this || _global$c$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$c$1).negative !== 0) { + if ((this || _global$c$1).length === 1 && ((this || _global$c$1).words[0] | 0) < num) { + (this || _global$c$1).words[0] = num - ((this || _global$c$1).words[0] | 0); + (this || _global$c$1).negative = 0; + return this || _global$c$1; + } + (this || _global$c$1).negative = 0; + this.isubn(num); + (this || _global$c$1).negative = 1; + return this || _global$c$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$c$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$c$1).length && (this || _global$c$1).words[i7] >= 67108864; i7++) { + (this || _global$c$1).words[i7] -= 67108864; + if (i7 === (this || _global$c$1).length - 1) { + (this || _global$c$1).words[i7 + 1] = 1; + } else { + (this || _global$c$1).words[i7 + 1]++; + } + } + (this || _global$c$1).length = Math.max((this || _global$c$1).length, i7 + 1); + return this || _global$c$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$c$1).negative !== 0) { + (this || _global$c$1).negative = 0; + this.iaddn(num); + (this || _global$c$1).negative = 1; + return this || _global$c$1; + } + (this || _global$c$1).words[0] -= num; + if ((this || _global$c$1).length === 1 && (this || _global$c$1).words[0] < 0) { + (this || _global$c$1).words[0] = -(this || _global$c$1).words[0]; + (this || _global$c$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$c$1).length && (this || _global$c$1).words[i7] < 0; i7++) { + (this || _global$c$1).words[i7] += 67108864; + (this || _global$c$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$c$1).negative = 0; + return this || _global$c$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$c$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$c$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$c$1).length - shift; i7++) { + w6 = ((this || _global$c$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$c$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$c$1).length; i7++) { + w6 = -((this || _global$c$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$c$1).words[i7] = w6 & 67108863; + } + (this || _global$c$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$c$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$c$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$c$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$c$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$c$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$c$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$c$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$c$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$c$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$c$1).words[i7] | 0) + carry * 67108864; + (this || _global$c$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$c$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$c$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$c$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$c$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$c$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$c$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$c$1).words[s7] |= q5; + return this || _global$c$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$c$1).length; i7++) { + var w6 = (this || _global$c$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$c$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$c$1).words[i7] = carry; + (this || _global$c$1).length++; + } + return this || _global$c$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$c$1).length === 1 && (this || _global$c$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$c$1).negative !== 0 && !negative) + return -1; + if ((this || _global$c$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$c$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$c$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$c$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$c$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$c$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$c$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$c$1).length > num.length) + return 1; + if ((this || _global$c$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$c$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$c$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$c$1).red, "Already a number in reduction context"); + assert4((this || _global$c$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$c$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$c$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$c$1).red.convertFrom(this || _global$c$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$c$1).red = ctx; + return this || _global$c$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$c$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$c$1).red, "redAdd works only with red numbers"); + return (this || _global$c$1).red.add(this || _global$c$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$c$1).red, "redIAdd works only with red numbers"); + return (this || _global$c$1).red.iadd(this || _global$c$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$c$1).red, "redSub works only with red numbers"); + return (this || _global$c$1).red.sub(this || _global$c$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$c$1).red, "redISub works only with red numbers"); + return (this || _global$c$1).red.isub(this || _global$c$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$c$1).red, "redShl works only with red numbers"); + return (this || _global$c$1).red.shl(this || _global$c$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$c$1).red, "redMul works only with red numbers"); + (this || _global$c$1).red._verify2(this || _global$c$1, num); + return (this || _global$c$1).red.mul(this || _global$c$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$c$1).red, "redMul works only with red numbers"); + (this || _global$c$1).red._verify2(this || _global$c$1, num); + return (this || _global$c$1).red.imul(this || _global$c$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$c$1).red, "redSqr works only with red numbers"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.sqr(this || _global$c$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$c$1).red, "redISqr works only with red numbers"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.isqr(this || _global$c$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$c$1).red, "redSqrt works only with red numbers"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.sqrt(this || _global$c$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$c$1).red, "redInvm works only with red numbers"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.invm(this || _global$c$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$c$1).red, "redNeg works only with red numbers"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.neg(this || _global$c$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$c$1).red && !num.red, "redPow(normalNum)"); + (this || _global$c$1).red._verify1(this || _global$c$1); + return (this || _global$c$1).red.pow(this || _global$c$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$c$1).name = name2; + (this || _global$c$1).p = new BN(p7, 16); + (this || _global$c$1).n = (this || _global$c$1).p.bitLength(); + (this || _global$c$1).k = new BN(1).iushln((this || _global$c$1).n).isub((this || _global$c$1).p); + (this || _global$c$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$c$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$c$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$c$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$c$1).n); + var cmp = rlen < (this || _global$c$1).n ? -1 : r8.ucmp((this || _global$c$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$c$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$c$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$c$1).k); + }; + function K256() { + MPrime.call(this || _global$c$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$c$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$c$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$c$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$c$1).m = prime.p; + (this || _global$c$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$c$1).m = m7; + (this || _global$c$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$c$1).prime) + return (this || _global$c$1).prime.ireduce(a7)._forceRed(this || _global$c$1); + return a7.umod((this || _global$c$1).m)._forceRed(this || _global$c$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$c$1).m.sub(a7)._forceRed(this || _global$c$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$c$1).m) >= 0) { + res.isub((this || _global$c$1).m); + } + return res._forceRed(this || _global$c$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$c$1).m) >= 0) { + res.isub((this || _global$c$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$c$1).m); + } + return res._forceRed(this || _global$c$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$c$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$c$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$c$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$c$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$c$1); + var nOne = one.redNeg(); + var lpow = (this || _global$c$1).m.subn(1).iushrn(1); + var z6 = (this || _global$c$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$c$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$c$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$c$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$c$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$c$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$c$1, m7); + (this || _global$c$1).shift = (this || _global$c$1).m.bitLength(); + if ((this || _global$c$1).shift % 26 !== 0) { + (this || _global$c$1).shift += 26 - (this || _global$c$1).shift % 26; + } + (this || _global$c$1).r = new BN(1).iushln((this || _global$c$1).shift); + (this || _global$c$1).r2 = this.imod((this || _global$c$1).r.sqr()); + (this || _global$c$1).rinv = (this || _global$c$1).r._invmp((this || _global$c$1).m); + (this || _global$c$1).minv = (this || _global$c$1).rinv.mul((this || _global$c$1).r).isubn(1).div((this || _global$c$1).m); + (this || _global$c$1).minv = (this || _global$c$1).minv.umod((this || _global$c$1).r); + (this || _global$c$1).minv = (this || _global$c$1).r.sub((this || _global$c$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$c$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$c$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$c$1).shift).mul((this || _global$c$1).minv).imaskn((this || _global$c$1).shift).mul((this || _global$c$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$c$1).shift); + var res = u7; + if (u7.cmp((this || _global$c$1).m) >= 0) { + res = u7.isub((this || _global$c$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$c$1).m); + } + return res._forceRed(this || _global$c$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$c$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$c$1).shift).mul((this || _global$c$1).minv).imaskn((this || _global$c$1).shift).mul((this || _global$c$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$c$1).shift); + var res = u7; + if (u7.cmp((this || _global$c$1).m) >= 0) { + res = u7.isub((this || _global$c$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$c$1).m); + } + return res._forceRed(this || _global$c$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$c$1).m).mul((this || _global$c$1).r2)); + return res._forceRed(this || _global$c$1); + }; + })(module$5, exports$12$1); + return module$5.exports; +} +function Context2() { +} +function s5(t8) { + o$13.call(this), this._block = e7.allocUnsafe(t8), this._blockSize = t8, this._blockOffset = 0, this._length = [0, 0, 0, 0], this._finalized = false; +} +function n$13() { + r5.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878; +} +function o$22(t8, i7) { + return t8 << i7 | t8 >>> 32 - i7; +} +function f$22(t8, i7, s7, h8, r8, _6, e10) { + return o$22(t8 + (i7 & s7 | ~i7 & h8) + r8 + _6 | 0, e10) + i7 | 0; +} +function c5(t8, i7, s7, h8, r8, _6, e10) { + return o$22(t8 + (i7 & h8 | s7 & ~h8) + r8 + _6 | 0, e10) + i7 | 0; +} +function a$12(t8, i7, s7, h8, r8, _6, e10) { + return o$22(t8 + (i7 ^ s7 ^ h8) + r8 + _6 | 0, e10) + i7 | 0; +} +function l5(t8, i7, s7, h8, r8, _6, e10) { + return o$22(t8 + (s7 ^ (i7 | ~h8)) + r8 + _6 | 0, e10) + i7 | 0; +} +function u$13() { + r$12.call(this, 64), this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520; +} +function b5(t8, i7) { + return t8 << i7 | t8 >>> 32 - i7; +} +function d4(t8, i7, s7, h8, _6, r8, e10, n7) { + return b5(t8 + (i7 ^ s7 ^ h8) + r8 + e10 | 0, n7) + _6 | 0; +} +function k4(t8, i7, s7, h8, _6, r8, e10, n7) { + return b5(t8 + (i7 & s7 | ~i7 & h8) + r8 + e10 | 0, n7) + _6 | 0; +} +function p5(t8, i7, s7, h8, _6, r8, e10, n7) { + return b5(t8 + ((i7 | ~s7) ^ h8) + r8 + e10 | 0, n7) + _6 | 0; +} +function w4(t8, i7, s7, h8, _6, r8, e10, n7) { + return b5(t8 + (i7 & h8 | s7 & ~h8) + r8 + e10 | 0, n7) + _6 | 0; +} +function E4(t8, i7, s7, h8, _6, r8, e10, n7) { + return b5(t8 + (i7 ^ (s7 | ~h8)) + r8 + e10 | 0, n7) + _6 | 0; +} +function e$3(t8, i7) { + (this || s$13)._block = h$2.alloc(t8), (this || s$13)._finalSize = i7, (this || s$13)._blockSize = t8, (this || s$13)._len = 0; +} +function u$23() { + this.init(), (this || n$3)._w = a$3, o$4.call(this || n$3, 64, 56); +} +function c$22(t8, i7, s7) { + return s7 ^ t8 & (i7 ^ s7); +} +function b$1(t8, i7, s7) { + return t8 & i7 | s7 & (t8 | i7); +} +function p$12(t8) { + return (t8 >>> 2 | t8 << 30) ^ (t8 >>> 13 | t8 << 19) ^ (t8 >>> 22 | t8 << 10); +} +function d$12(t8) { + return (t8 >>> 6 | t8 << 26) ^ (t8 >>> 11 | t8 << 21) ^ (t8 >>> 25 | t8 << 7); +} +function k$1(t8) { + return (t8 >>> 7 | t8 << 25) ^ (t8 >>> 18 | t8 << 14) ^ t8 >>> 3; +} +function f$5() { + this.init(), (this || _$3)._w = o$5, n$4.call(this || _$3, 64, 56); +} +function a$4(t8) { + return t8 << 30 | t8 >>> 2; +} +function u$3(t8, i7, h8, s7) { + return 0 === t8 ? i7 & h8 | ~i7 & s7 : 2 === t8 ? i7 & h8 | i7 & s7 | h8 & s7 : i7 ^ h8 ^ s7; +} +function y4() { + this.init(), (this || d$2)._w = B4, b$2.call(this || d$2, 64, 56); +} +function E$1(t8) { + return t8 << 5 | t8 >>> 27; +} +function I$1(t8) { + return t8 << 30 | t8 >>> 2; +} +function v5(t8, i7, h8, s7) { + return 0 === t8 ? i7 & h8 | ~i7 & s7 : 2 === t8 ? i7 & h8 | i7 & s7 | h8 & s7 : i7 ^ h8 ^ s7; +} +function C4() { + this.init(), (this || m4)._w = q3, x5.call(this || m4, 64, 56); +} +function J3() { + this.init(), (this || k$2)._w = H3, D4.call(this || k$2, 128, 112); +} +function K3(t8, i7, h8) { + return h8 ^ t8 & (i7 ^ h8); +} +function M4(t8, i7, h8) { + return t8 & i7 | h8 & (t8 | i7); +} +function N4(t8, i7) { + return (t8 >>> 28 | i7 << 4) ^ (i7 >>> 2 | t8 << 30) ^ (i7 >>> 7 | t8 << 25); +} +function O4(t8, i7) { + return (t8 >>> 14 | i7 << 18) ^ (t8 >>> 18 | i7 << 14) ^ (i7 >>> 9 | t8 << 23); +} +function P4(t8, i7) { + return (t8 >>> 1 | i7 << 31) ^ (t8 >>> 8 | i7 << 24) ^ t8 >>> 7; +} +function Q3(t8, i7) { + return (t8 >>> 1 | i7 << 31) ^ (t8 >>> 8 | i7 << 24) ^ (t8 >>> 7 | i7 << 25); +} +function R4(t8, i7) { + return (t8 >>> 19 | i7 << 13) ^ (i7 >>> 29 | t8 << 3) ^ t8 >>> 6; +} +function S4(t8, i7) { + return (t8 >>> 19 | i7 << 13) ^ (i7 >>> 29 | t8 << 3) ^ (t8 >>> 6 | i7 << 26); +} +function V3(t8, i7) { + return t8 >>> 0 < i7 >>> 0 ? 1 : 0; +} +function ht() { + this.init(), (this || X3)._w = it, $3.call(this || X3, 128, 112); +} +function a$5(t8) { + s$2.call(this || e$5), (this || e$5).hashMode = "string" == typeof t8, (this || e$5).hashMode ? (this || e$5)[t8] = (this || e$5)._finalOrDigest : (this || e$5).final = (this || e$5)._finalOrDigest, (this || e$5)._final && ((this || e$5).__final = (this || e$5)._final, (this || e$5)._final = null), (this || e$5)._decoder = null, (this || e$5)._encoding = null; +} +function a$6(t8) { + s$3.call(this, "digest"), this._hash = t8; +} +function f$7(t8, a7) { + n$7.call(this, "digest"), "string" == typeof a7 && (a7 = h$5.from(a7)), this._alg = t8, this._key = a7, a7.length > 64 ? a7 = t8(a7) : a7.length < 64 && (a7 = h$5.concat([a7, p$4], 64)); + for (var e10 = this._ipad = h$5.allocUnsafe(64), i7 = this._opad = h$5.allocUnsafe(64), r8 = 0; r8 < 64; r8++) + e10[r8] = 54 ^ a7[r8], i7[r8] = 92 ^ a7[r8]; + this._hash = [e10]; +} +function y$1(t8, a7) { + c$4.call(this, "digest"), "string" == typeof a7 && (a7 = _$4.from(a7)); + var e10 = "sha512" === t8 || "sha384" === t8 ? 128 : 64; + (this._alg = t8, this._key = a7, a7.length > e10) ? a7 = ("rmd160" === t8 ? new u$4() : g$1(t8)).update(a7).digest() : a7.length < e10 && (a7 = _$4.concat([a7, v$1], e10)); + for (var i7 = this._ipad = _$4.allocUnsafe(e10), r8 = this._opad = _$4.allocUnsafe(e10), s7 = 0; s7 < e10; s7++) + i7[s7] = 54 ^ a7[s7], r8[s7] = 92 ^ a7[s7]; + this._hash = "rmd160" === t8 ? new u$4() : g$1(t8), this._hash.update(i7); +} +function s$5(r8, e10) { + if ("string" != typeof r8 && !f$8.isBuffer(r8)) + throw new TypeError(e10 + " must be a buffer or string"); +} +function T$12(r8, e10, t8) { + var n7 = /* @__PURE__ */ function(r9) { + function e11(e12) { + return y$2(r9).update(e12).digest(); + } + return "rmd160" === r9 || "ripemd160" === r9 ? function(r10) { + return new m$3().update(r10).digest(); + } : "md5" === r9 ? d$4 : e11; + }(r8), o7 = "sha512" === r8 || "sha384" === r8 ? 128 : 64; + e10.length > o7 ? e10 = n7(e10) : e10.length < o7 && (e10 = w$4.concat([e10, g$2], o7)); + for (var i7 = w$4.allocUnsafe(o7 + B$1[r8]), f8 = w$4.allocUnsafe(o7 + B$1[r8]), a7 = 0; a7 < o7; a7++) + i7[a7] = 54 ^ e10[a7], f8[a7] = 92 ^ e10[a7]; + var s7 = w$4.allocUnsafe(o7 + t8 + 4); + i7.copy(s7, 0, 0, o7), (this || p$5).ipad1 = s7, (this || p$5).ipad2 = i7, (this || p$5).opad = f8, (this || p$5).alg = r8, (this || p$5).blocksize = o7, (this || p$5).hash = n7, (this || p$5).size = B$1[r8]; +} +function D$1(r8, e10, t8, n7, o7) { + return x$1.importKey("raw", r8, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(r9) { + return x$1.deriveBits({ name: "PBKDF2", salt: e10, iterations: t8, hash: { name: o7 } }, r9, n7 << 3); + }).then(function(r9) { + return K$1.from(r9); + }); +} +function e$7(r8, e10) { + if (!r8) + throw new Error(e10 || "Assertion failed"); +} +function u$6(t8) { + this.options = t8, this.type = this.options.type, this.blockSize = 8, this._init(), this.buffer = new Array(this.blockSize), this.bufferOff = 0; +} +function y$3() { + this.tmp = new Array(2), this.keys = null; +} +function v$3(t8) { + l$6.call(this, t8); + var e10 = new y$3(); + this._desState = e10, this.deriveKeys(e10, t8.key); +} +function S$2(t8) { + k$4.equal(t8.length, 8, "Invalid IV length"), this.iv = new Array(8); + for (var e10 = 0; e10 < this.iv.length; e10++) + this.iv[e10] = t8[e10]; +} +function O$1(t8, e10) { + w$5.equal(e10.length, 24, "Invalid key length"); + var r8 = e10.slice(0, 8), i7 = e10.slice(8, 16), n7 = e10.slice(16, 24); + this.ciphers = "encrypt" === t8 ? [I$3.create({ type: "encrypt", key: r8 }), I$3.create({ type: "decrypt", key: i7 }), I$3.create({ type: "encrypt", key: n7 })] : [I$3.create({ type: "decrypt", key: n7 }), I$3.create({ type: "encrypt", key: i7 }), I$3.create({ type: "decrypt", key: r8 })]; +} +function B$2(t8) { + E$3.call(this, t8); + var e10 = new O$1(this.type, this.options.key); + this._edeState = e10; +} +function p$7(e10) { + f$a.call(this || i$13); + var t8, r8 = e10.mode.toLowerCase(), s7 = n$9[r8]; + t8 = e10.decrypt ? "decrypt" : "encrypt"; + var d7 = e10.key; + c$7.isBuffer(d7) || (d7 = c$7.from(d7)), "des-ede" !== r8 && "des-ede-cbc" !== r8 || (d7 = c$7.concat([d7, d7.slice(0, 8)])); + var o7 = e10.iv; + c$7.isBuffer(o7) || (o7 = c$7.from(o7)), (this || i$13)._des = s7.create({ key: d7, iv: o7, type: t8 }); +} +function v$4(e10, c7, r8) { + var t8 = c7.length, a7 = h$8(c7, e10._cache); + return e10._cache = e10._cache.slice(t8), e10._prev = o$a.concat([e10._prev, r8 ? c7 : a7]), a7; +} +function s$7(e10, c7, r8) { + var t8 = e10._cipher.encryptBlock(e10._prev)[0] ^ c7; + return e10._prev = f$c.concat([e10._prev.slice(1), f$c.from([r8 ? c7 : t8])]), t8; +} +function _$6(e10, c7, r8) { + for (var t8, a7, p7 = -1, n7 = 0; ++p7 < 8; ) + t8 = c7 & 1 << 7 - p7 ? 128 : 0, n7 += (128 & (a7 = e10._cipher.encryptBlock(e10._prev)[0] ^ t8)) >> p7 % 8, e10._prev = k$5(e10._prev, r8 ? t8 : a7); + return n7; +} +function k$5(e10, c7) { + var r8 = e10.length, t8 = -1, a7 = m$5.allocUnsafe(e10.length); + for (e10 = m$5.concat([e10, m$5.from([c7])]); ++t8 < r8; ) + a7[t8] = e10[t8] << 1 | e10[t8 + 1] >> 7; + return a7; +} +function E$4(e10) { + return e10._prev = e10._cipher.encryptBlock(e10._prev), e10._prev; +} +function g$4(e10) { + var c7 = e10._cipher.encryptBlockRaw(e10._prev); + return S$3(e10._prev), c7; +} +function s$8(t8) { + o$b.isBuffer(t8) || (t8 = o$b.from(t8)); + for (var e10 = t8.length / 4 | 0, i7 = new Array(e10), r8 = 0; r8 < e10; r8++) + i7[r8] = t8.readUInt32BE(4 * r8); + return i7; +} +function c$8(t8) { + for (; 0 < t8.length; t8++) + t8[0] = 0; +} +function l$9(t8, e10, i7, r8, n7) { + for (var a7, h8, o7, s7, c7 = i7[0], l7 = i7[1], f8 = i7[2], u7 = i7[3], p7 = t8[0] ^ e10[0], _6 = t8[1] ^ e10[1], d7 = t8[2] ^ e10[2], y7 = t8[3] ^ e10[3], B6 = 4, g7 = 1; g7 < n7; g7++) + a7 = c7[p7 >>> 24] ^ l7[_6 >>> 16 & 255] ^ f8[d7 >>> 8 & 255] ^ u7[255 & y7] ^ e10[B6++], h8 = c7[_6 >>> 24] ^ l7[d7 >>> 16 & 255] ^ f8[y7 >>> 8 & 255] ^ u7[255 & p7] ^ e10[B6++], o7 = c7[d7 >>> 24] ^ l7[y7 >>> 16 & 255] ^ f8[p7 >>> 8 & 255] ^ u7[255 & _6] ^ e10[B6++], s7 = c7[y7 >>> 24] ^ l7[p7 >>> 16 & 255] ^ f8[_6 >>> 8 & 255] ^ u7[255 & d7] ^ e10[B6++], p7 = a7, _6 = h8, d7 = o7, y7 = s7; + return a7 = (r8[p7 >>> 24] << 24 | r8[_6 >>> 16 & 255] << 16 | r8[d7 >>> 8 & 255] << 8 | r8[255 & y7]) ^ e10[B6++], h8 = (r8[_6 >>> 24] << 24 | r8[d7 >>> 16 & 255] << 16 | r8[y7 >>> 8 & 255] << 8 | r8[255 & p7]) ^ e10[B6++], o7 = (r8[d7 >>> 24] << 24 | r8[y7 >>> 16 & 255] << 16 | r8[p7 >>> 8 & 255] << 8 | r8[255 & _6]) ^ e10[B6++], s7 = (r8[y7 >>> 24] << 24 | r8[p7 >>> 16 & 255] << 16 | r8[_6 >>> 8 & 255] << 8 | r8[255 & d7]) ^ e10[B6++], [a7 >>>= 0, h8 >>>= 0, o7 >>>= 0, s7 >>>= 0]; +} +function p$9(t8) { + (this || a$b)._key = s$8(t8), this._reset(); +} +function B$4(t8) { + var e10 = d$8.allocUnsafe(16); + return e10.writeUInt32BE(t8[0] >>> 0, 0), e10.writeUInt32BE(t8[1] >>> 0, 4), e10.writeUInt32BE(t8[2] >>> 0, 8), e10.writeUInt32BE(t8[3] >>> 0, 12), e10; +} +function g$5(t8) { + (this || _$7).h = t8, (this || _$7).state = d$8.alloc(16, 0), (this || _$7).cache = d$8.allocUnsafe(0); +} +function X$1(t8, e10, i7, r8) { + w$7.call(this || v$5); + var n7 = U$4.alloc(4, 0); + (this || v$5)._cipher = new I$5.AES(e10); + var a7 = (this || v$5)._cipher.encryptBlock(n7); + (this || v$5)._ghash = new m$6(a7), i7 = function(t9, e11, i8) { + if (12 === e11.length) + return t9._finID = U$4.concat([e11, U$4.from([0, 0, 0, 1])]), U$4.concat([e11, U$4.from([0, 0, 0, 2])]); + var r9 = new m$6(i8), n8 = e11.length, a8 = n8 % 16; + r9.update(e11), a8 && (a8 = 16 - a8, r9.update(U$4.alloc(a8, 0))), r9.update(U$4.alloc(8, 0)); + var h8 = 8 * n8, o7 = U$4.alloc(8); + o7.writeUIntBE(h8, 0, 8), r9.update(o7), t9._finID = r9.state; + var s7 = U$4.from(t9._finID); + return b$6(s7), s7; + }(this || v$5, i7, a7), (this || v$5)._prev = U$4.from(i7), (this || v$5)._cache = U$4.allocUnsafe(0), (this || v$5)._secCache = U$4.allocUnsafe(0), (this || v$5)._decrypt = r8, (this || v$5)._alen = 0, (this || v$5)._len = 0, (this || v$5)._mode = t8, (this || v$5)._authTag = null, (this || v$5)._called = false; +} +function N$1(t8, e10, i7, r8) { + M$3.call(this || T$2), (this || T$2)._cipher = new O$2.AES(e10), (this || T$2)._prev = A$4.from(i7), (this || T$2)._cache = A$4.allocUnsafe(0), (this || T$2)._secCache = A$4.allocUnsafe(0), (this || T$2)._decrypt = r8, (this || T$2)._mode = t8; +} +function g$6(t8, e10, r8) { + d$9.call(this || c$9), (this || c$9)._cache = new v$6(), (this || c$9)._last = void 0, (this || c$9)._cipher = new y$6.AES(e10), (this || c$9)._prev = p$a.from(r8), (this || c$9)._mode = t8, (this || c$9)._autopadding = true; +} +function v$6() { + (this || c$9).cache = p$a.allocUnsafe(0); +} +function w$8(t8, e10, r8) { + var i7 = u$9[t8.toLowerCase()]; + if (!i7) + throw new TypeError("invalid suite type"); + if ("string" == typeof r8 && (r8 = p$a.from(r8)), "GCM" !== i7.mode && r8.length !== i7.iv) + throw new TypeError("invalid iv length " + r8.length); + if ("string" == typeof e10 && (e10 = p$a.from(e10)), e10.length !== i7.key / 8) + throw new TypeError("invalid key length " + e10.length); + return "stream" === i7.type ? new l$a(i7.module, e10, r8, true) : "auth" === i7.type ? new f$f(i7.module, e10, r8, true) : new g$6(i7.module, e10, r8); +} +function v$7(t8, e10, r8) { + d$a.call(this || c$a), (this || c$a)._cache = new g$7(), (this || c$a)._cipher = new m$8.AES(e10), (this || c$a)._prev = l$b.from(r8), (this || c$a)._mode = t8, (this || c$a)._autopadding = true; +} +function g$7() { + (this || c$a).cache = l$b.allocUnsafe(0); +} +function w$9(t8, e10, r8) { + var i7 = f$g[t8.toLowerCase()]; + if (!i7) + throw new TypeError("invalid suite type"); + if ("string" == typeof e10 && (e10 = l$b.from(e10)), e10.length !== i7.key / 8) + throw new TypeError("invalid key length " + e10.length); + if ("string" == typeof r8 && (r8 = l$b.from(r8)), "GCM" !== i7.mode && r8.length !== i7.iv) + throw new TypeError("invalid iv length " + r8.length); + return "stream" === i7.type ? new u$a(i7.module, e10, r8) : "auth" === i7.type ? new p$b(i7.module, e10, r8) : new v$7(i7.module, e10, r8); +} +function f$h(e10, r8, i7) { + if (e10 = e10.toLowerCase(), v$8[e10]) + return s$b.createCipheriv(e10, r8, i7); + if (y$8[e10]) + return new n$b({ key: r8, iv: i7, mode: e10 }); + throw new TypeError("invalid suite type"); +} +function c$c(e10, r8, i7) { + if (e10 = e10.toLowerCase(), v$8[e10]) + return s$b.createDecipheriv(e10, r8, i7); + if (y$8[e10]) + return new n$b({ key: r8, iv: i7, mode: e10, decrypt: true }); + throw new TypeError("invalid suite type"); +} +function o$d(t8) { + (this || n$d).rand = t8; +} +function d$b(r8) { + (this || t$6).rand = r8 || new a$f.Rand(); +} +function l$c() { + if (null !== w$a) + return w$a; + var f8 = []; + f8[0] = 2; + for (var e10 = 1, c7 = 3; c7 < 1048576; c7 += 2) { + for (var a7 = Math.ceil(Math.sqrt(c7)), b8 = 0; b8 < e10 && f8[b8] <= a7 && c7 % f8[b8] != 0; b8++) + ; + e10 !== b8 && f8[b8] <= a7 || (f8[e10++] = c7); + } + return w$a = f8, f8; +} +function _$9(f8) { + for (var e10 = l$c(), c7 = 0; c7 < e10.length; c7++) + if (0 === f8.modn(e10[c7])) + return 0 === f8.cmpn(e10[c7]); + return true; +} +function g$8(f8) { + var e10 = r$9.mont(f8); + return 0 === o$f.toRed(e10).redPow(f8.subn(1)).fromRed().cmpn(1); +} +function v$9(f8, e10) { + if (f8 < 16) + return new r$9(2 === e10 || 5 === e10 ? [140, 123] : [140, 39]); + var c7, a7; + for (e10 = new r$9(e10); ; ) { + for (c7 = new r$9(d$c(Math.ceil(f8 / 8))); c7.bitLength() > f8; ) + c7.ishrn(1); + if (c7.isEven() && c7.iadd(i$5), c7.testn(1) || c7.iadd(o$f), e10.cmp(o$f)) { + if (!e10.cmp(p$e)) + for (; c7.mod(s$c).cmp(m$9); ) + c7.iadd(h$b); + } else + for (; c7.mod(t$7).cmp(u$b); ) + c7.iadd(h$b); + if (_$9(a7 = c7.shrn(1)) && _$9(c7) && g$8(a7) && g$8(c7) && n$f.test(a7) && n$f.test(c7)) + return c7; + } +} +function E$6(f8, e10) { + return e10 = e10 || "utf8", K$2.isBuffer(f8) || (f8 = new K$2(f8, e10)), (this || B$5)._pub = new R$1(f8), this || B$5; +} +function L$1(f8, e10) { + return e10 = e10 || "utf8", K$2.isBuffer(f8) || (f8 = new K$2(f8, e10)), (this || B$5)._priv = new R$1(f8), this || B$5; +} +function k$7(f8, e10, c7) { + this.setGenerator(e10), (this || B$5).__prime = new R$1(f8), (this || B$5)._prime = R$1.mont((this || B$5).__prime), (this || B$5)._primeLen = f8.length, (this || B$5)._pub = void 0, (this || B$5)._priv = void 0, (this || B$5)._primeCode = void 0, c7 ? ((this || B$5).setPublicKey = E$6, (this || B$5).setPrivateKey = L$1) : (this || B$5)._primeCode = 8; +} +function A$5(f8, e10) { + var c7 = new K$2(f8.toArray()); + return e10 ? c7.toString(e10) : c7; +} +function t$8(e10, o7) { + var r8 = function(e11) { + var o8 = i$6(e11); + return { blinder: o8.toRed(n$g.mont(e11.modulus)).redPow(new n$g(e11.publicExponent)).fromRed(), unblinder: o8.invm(e11.modulus) }; + }(o7), m7 = o7.modulus.byteLength(), d7 = (n$g.mont(o7.modulus), new n$g(e10).mul(r8.blinder).umod(o7.modulus)), t8 = d7.toRed(n$g.mont(o7.prime1)), l7 = d7.toRed(n$g.mont(o7.prime2)), f8 = o7.coefficient, p7 = o7.prime1, b8 = o7.prime2, s7 = t8.redPow(o7.exponent1), a7 = l7.redPow(o7.exponent2); + s7 = s7.fromRed(), a7 = a7.fromRed(); + var w6 = s7.isub(a7).imul(f8).umod(p7); + return w6.imul(b8), a7.iadd(w6), new u$c(a7.imul(r8.unblinder).umod(o7.modulus).toArray(false, m7)); +} +function i$6(e10) { + for (var o7 = e10.modulus.byteLength(), r8 = new n$g(d$d(o7)); r8.cmp(e10.modulus) >= 0 || !r8.umod(e10.prime1) || !r8.umod(e10.prime2); ) + r8 = new n$g(d$d(o7)); + return r8; +} +function t$9(r8) { + return 1 === r8.length ? "0" + r8 : r8; +} +function n$h(r8) { + for (var e10 = "", n7 = 0; n7 < r8.length; n7++) + e10 += t$9(r8[n7].toString(16)); + return e10; +} +function p$f(r8, t8) { + if (r8 instanceof p$f) + return r8; + this._importDER(r8, t8) || (h$c(r8.r && r8.s, "Signature without r or s"), this.r = new l$e(r8.r, 16), this.s = new l$e(r8.s, 16), void 0 === r8.recoveryParam ? this.recoveryParam = null : this.recoveryParam = r8.recoveryParam); +} +function f$j() { + this.place = 0; +} +function v$a(r8, t8) { + var e10 = r8[t8.place++]; + if (!(128 & e10)) + return e10; + for (var n7 = 15 & e10, a7 = 0, i7 = 0, o7 = t8.place; i7 < n7; i7++, o7++) + a7 <<= 8, a7 |= r8[o7]; + return t8.place = o7, a7; +} +function m$b(r8) { + for (var t8 = 0, e10 = r8.length - 1; !r8[t8] && !(128 & r8[t8 + 1]) && t8 < e10; ) + t8++; + return 0 === t8 ? r8 : r8.slice(t8); +} +function y$a(r8, t8) { + if (t8 < 128) + return r8.push(t8), void 0; + var e10 = 1 + (Math.log(t8) / Math.LN2 >>> 3); + for (r8.push(128 | e10); --e10; ) + r8.push(t8 >>> (e10 << 3) & 255); + r8.push(t8); +} +function h$d(t8, n7) { + return 55296 == (64512 & t8.charCodeAt(n7)) && (!(n7 < 0 || n7 + 1 >= t8.length) && 56320 == (64512 & t8.charCodeAt(n7 + 1))); +} +function o$h(t8) { + return (t8 >>> 24 | t8 >>> 8 & 65280 | t8 << 8 & 16711680 | (255 & t8) << 24) >>> 0; +} +function u$e(t8) { + return 1 === t8.length ? "0" + t8 : t8; +} +function s$e(t8) { + return 7 === t8.length ? "0" + t8 : 6 === t8.length ? "00" + t8 : 5 === t8.length ? "000" + t8 : 4 === t8.length ? "0000" + t8 : 3 === t8.length ? "00000" + t8 : 2 === t8.length ? "000000" + t8 : 1 === t8.length ? "0000000" + t8 : t8; +} +function c$e() { + this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32; +} +function y$b() { + if (!(this instanceof y$b)) + return new y$b(); + k$8.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = d$f, this.W = new Array(160); +} +function b$8(t8, h8, i7, r8, n7) { + var s7 = t8 & i7 ^ ~t8 & n7; + return s7 < 0 && (s7 += 4294967296), s7; +} +function x$3(t8, h8, i7, r8, n7, s7) { + var o7 = h8 & r8 ^ ~h8 & s7; + return o7 < 0 && (o7 += 4294967296), o7; +} +function B$6(t8, h8, i7, r8, n7) { + var s7 = t8 & i7 ^ t8 & n7 ^ i7 & n7; + return s7 < 0 && (s7 += 4294967296), s7; +} +function S$6(t8, h8, i7, r8, n7, s7) { + var o7 = h8 & r8 ^ h8 & s7 ^ r8 & s7; + return o7 < 0 && (o7 += 4294967296), o7; +} +function W$1(t8, h8) { + var i7 = e$d(t8, h8, 28) ^ e$d(h8, t8, 2) ^ e$d(h8, t8, 7); + return i7 < 0 && (i7 += 4294967296), i7; +} +function w$b(t8, h8) { + var i7 = u$f(t8, h8, 28) ^ u$f(h8, t8, 2) ^ u$f(h8, t8, 7); + return i7 < 0 && (i7 += 4294967296), i7; +} +function z$4(t8, h8) { + var i7 = e$d(t8, h8, 14) ^ e$d(t8, h8, 18) ^ e$d(h8, t8, 9); + return i7 < 0 && (i7 += 4294967296), i7; +} +function H$3(t8, h8) { + var i7 = u$f(t8, h8, 14) ^ u$f(t8, h8, 18) ^ u$f(h8, t8, 9); + return i7 < 0 && (i7 += 4294967296), i7; +} +function j$2(t8, h8) { + var i7 = e$d(t8, h8, 1) ^ e$d(t8, h8, 8) ^ a$i(t8, h8, 7); + return i7 < 0 && (i7 += 4294967296), i7; +} +function A$6(t8, h8) { + var i7 = u$f(t8, h8, 1) ^ u$f(t8, h8, 8) ^ c$f(t8, h8, 7); + return i7 < 0 && (i7 += 4294967296), i7; +} +function L$2(t8, h8) { + var i7 = e$d(t8, h8, 19) ^ e$d(h8, t8, 29) ^ a$i(t8, h8, 6); + return i7 < 0 && (i7 += 4294967296), i7; +} +function q$2(t8, h8) { + var i7 = u$f(t8, h8, 19) ^ u$f(h8, t8, 29) ^ c$f(t8, h8, 6); + return i7 < 0 && (i7 += 4294967296), i7; +} +function r$d(t8, h8, i7) { + return t8 & h8 ^ ~t8 & i7; +} +function e$e(t8, h8, i7) { + return t8 & h8 ^ t8 & i7 ^ h8 & i7; +} +function o$j(t8, h8, i7) { + return t8 ^ h8 ^ i7; +} +function S$7() { + if (!(this instanceof S$7)) + return new S$7(); + x$4.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = y$c, this.W = new Array(64); +} +function m$e() { + if (!(this instanceof m$e)) + return new m$e(); + g$c.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80); +} +function v$d() { + if (!(this instanceof v$d)) + return new v$d(); + z$5.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]; +} +function x$5() { + if (!(this instanceof x$5)) + return new x$5(); + w$d.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]; +} +function G$2() { + if (!(this instanceof G$2)) + return new G$2(); + F$4.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"; +} +function I$7(t8, h8, i7, s7) { + return t8 <= 15 ? h8 ^ i7 ^ s7 : t8 <= 31 ? h8 & i7 | ~h8 & s7 : t8 <= 47 ? (h8 | ~i7) ^ s7 : t8 <= 63 ? h8 & s7 | i7 & ~s7 : h8 ^ (i7 | ~s7); +} +function J$2(t8) { + return t8 <= 15 ? 0 : t8 <= 31 ? 1518500249 : t8 <= 47 ? 1859775393 : t8 <= 63 ? 2400959708 : 2840853838; +} +function K$3(t8) { + return t8 <= 15 ? 1352829926 : t8 <= 31 ? 1548603684 : t8 <= 47 ? 1836072691 : t8 <= 63 ? 2053994217 : 0; +} +function U$5(t8, h8, i7) { + if (!(this instanceof U$5)) + return new U$5(t8, h8, i7); + this.Hash = t8, this.blockSize = t8.blockSize / 8, this.outSize = t8.outSize / 8, this.inner = null, this.outer = null, this._init(R$2.toArray(h8, i7)); +} +function o$l(t8) { + if (!(this instanceof o$l)) + return new o$l(t8); + this.hash = t8.hash, this.predResist = !!t8.predResist, this.outLen = this.hash.outSize, this.minEntropy = t8.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null; + var e10 = r$f.toArray(t8.entropy, t8.entropyEnc || "hex"), i7 = r$f.toArray(t8.nonce, t8.nonceEnc || "hex"), s7 = r$f.toArray(t8.pers, t8.persEnc || "hex"); + n$l(e10.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(e10, i7, s7); +} +function h$f(e10, f8) { + this.type = e10, this.p = new i$9(f8.p, 16), this.red = f8.prime ? i$9.red(f8.prime) : i$9.mont(this.p), this.zero = new i$9(0).toRed(this.red), this.one = new i$9(1).toRed(this.red), this.two = new i$9(2).toRed(this.red), this.n = f8.n && new i$9(f8.n, 16), this.g = f8.g && this.pointFromJSON(f8.g, f8.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n ? this.n.bitLength() : 0; + var d7 = this.n && this.p.div(this.n); + !d7 || d7.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = true, this.redN = this.n.toRed(this.red)); +} +function p$j(e10, f8) { + this.curve = e10, this.type = f8, this.precomputed = null; +} +function A$8(e10) { + S$9.call(this, "short", e10), this.a = new y$e(e10.a, 16).toRed(this.red), this.b = new y$e(e10.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = 0 === this.a.fromRed().cmpn(0), this.threeA = 0 === this.a.fromRed().sub(this.p).cmpn(-3), this.endo = this._getEndomorphism(e10), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4); +} +function I$8(e10, f8, d7, c7) { + S$9.BasePoint.call(this, e10, "affine"), null === f8 && null === d7 ? (this.x = null, this.y = null, this.inf = true) : (this.x = new y$e(f8, 16), this.y = new y$e(d7, 16), c7 && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = false); +} +function w$e(e10, f8, d7, c7) { + S$9.BasePoint.call(this, e10, "jacobian"), null === f8 && null === d7 && null === c7 ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new y$e(0)) : (this.x = new y$e(f8, 16), this.y = new y$e(d7, 16), this.z = new y$e(c7, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one; +} +function P$4(e10) { + q$4.call(this, "mont", e10), this.a = new _$d(e10.a, 16).toRed(this.red), this.b = new _$d(e10.b, 16).toRed(this.red), this.i4 = new _$d(4).toRed(this.red).redInvm(), this.two = new _$d(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two)); +} +function j$5(e10, f8, d7) { + q$4.BasePoint.call(this, e10, "projective"), null === f8 && null === d7 ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new _$d(f8, 16), this.z = new _$d(d7, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red))); +} +function F$5(e10) { + this.twisted = 1 != (0 | e10.a), this.mOneA = this.twisted && -1 == (0 | e10.a), this.extended = this.mOneA, L$4.call(this, "edwards", e10), this.a = new k$b(e10.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new k$b(e10.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new k$b(e10.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), B$8(!this.twisted || 0 === this.c.fromRed().cmpn(1)), this.oneC = 1 == (0 | e10.c); +} +function C$5(e10, f8, d7, c7, t8) { + L$4.BasePoint.call(this, e10, "projective"), null === f8 && null === d7 && null === c7 ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = true) : (this.x = new k$b(f8, 16), this.y = new k$b(d7, 16), this.z = c7 ? new k$b(c7, 16) : this.curve.one, this.t = t8 && new k$b(t8, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm())))); +} +function Q$2(e10) { + "short" === e10.type ? this.curve = new G$3.short(e10) : "edwards" === e10.type ? this.curve = new G$3.edwards(e10) : this.curve = new G$3.mont(e10), this.g = this.curve.g, this.n = this.curve.n, this.hash = e10.hash, H$5(this.g.validate(), "Invalid curve"), H$5(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); +} +function V$3(e10, f8) { + Object.defineProperty(K$4, e10, { configurable: true, enumerable: true, get: function() { + var d7 = new Q$2(f8); + return Object.defineProperty(K$4, e10, { configurable: true, enumerable: true, value: d7 }), d7; + } }); +} +function fe3(e10, f8) { + this.ec = e10, this.priv = null, this.pub = null, f8.priv && this._importPrivate(f8.priv, f8.privEnc), f8.pub && this._importPublic(f8.pub, f8.pubEnc); +} +function oe3(e10) { + if (!(this instanceof oe3)) + return new oe3(e10); + "string" == typeof e10 && (ie2(re3.hasOwnProperty(e10), "Unknown curve " + e10), e10 = re3[e10]), e10 instanceof re3.PresetCurve && (e10 = { curve: e10 }), this.curve = e10.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = e10.curve.g, this.g.precompute(e10.curve.n.bitLength() + 1), this.hash = e10.hash || e10.curve.hash; +} +function ye3(e10, f8) { + this.eddsa = e10, this._secret = le3(f8.secret), e10.isPoint(f8.pub) ? this._pub = f8.pub : this._pubBytes = le3(f8.pub); +} +function Me(e10, f8) { + this.eddsa = e10, "object" != typeof f8 && (f8 = we3(f8)), Array.isArray(f8) && (f8 = { R: f8.slice(0, e10.encodingLength), S: f8.slice(e10.encodingLength) }), Ae3(f8.R && f8.S, "Signature without R or S"), e10.isPoint(f8.R) && (this._R = f8.R), f8.S instanceof Se3 && (this._S = f8.S), this._Rencoded = Array.isArray(f8.R) ? f8.R : f8.Rencoded, this._Sencoded = Array.isArray(f8.S) ? f8.S : f8.Sencoded; +} +function ke2(e10) { + if (Pe("ed25519" === e10, "only tested with ed25519 so far"), !(this instanceof ke2)) + return new ke2(e10); + e10 = qe[e10].curve; + this.curve = e10, this.g = e10.g, this.g.precompute(e10.n.bitLength() + 1), this.pointClass = e10.point().constructor, this.encodingLength = Math.ceil(e10.n.bitLength() / 8), this.hash = ze.sha512; +} +function l$k(e10) { + (this || u$j)._reporterState = { obj: null, path: [], options: e10 || {}, errors: [] }; +} +function h$g(e10, t8) { + (this || u$j).path = e10, this.rethrow(t8); +} +function y$f() { + if (d$i) + return p$k; + d$i = true; + var e10 = t$2, r8 = E$9().Reporter, i7 = e$1$1.Buffer; + function o7(e11, t8) { + if (r8.call(this || g$e, t8), !i7.isBuffer(e11)) + return this.error("Input not Buffer"), void 0; + (this || g$e).base = e11, (this || g$e).offset = 0, (this || g$e).length = e11.length; + } + function s7(e11, t8) { + if (Array.isArray(e11)) + (this || g$e).length = 0, (this || g$e).value = e11.map(function(e12) { + return e12 instanceof s7 || (e12 = new s7(e12, t8)), (this || g$e).length += e12.length, e12; + }, this || g$e); + else if ("number" == typeof e11) { + if (!(0 <= e11 && e11 <= 255)) + return t8.error("non-byte EncoderBuffer value"); + (this || g$e).value = e11, (this || g$e).length = 1; + } else if ("string" == typeof e11) + (this || g$e).value = e11, (this || g$e).length = i7.byteLength(e11); + else { + if (!i7.isBuffer(e11)) + return t8.error("Unsupported type: " + typeof e11); + (this || g$e).value = e11, (this || g$e).length = e11.length; + } + } + return e10(o7, r8), p$k.DecoderBuffer = o7, o7.prototype.save = function() { + return { offset: (this || g$e).offset, reporter: r8.prototype.save.call(this || g$e) }; + }, o7.prototype.restore = function(e11) { + var t8 = new o7((this || g$e).base); + return t8.offset = e11.offset, t8.length = (this || g$e).offset, (this || g$e).offset = e11.offset, r8.prototype.restore.call(this || g$e, e11.reporter), t8; + }, o7.prototype.isEmpty = function() { + return (this || g$e).offset === (this || g$e).length; + }, o7.prototype.readUInt8 = function(e11) { + return (this || g$e).offset + 1 <= (this || g$e).length ? (this || g$e).base.readUInt8((this || g$e).offset++, true) : this.error(e11 || "DecoderBuffer overrun"); + }, o7.prototype.skip = function(e11, t8) { + if (!((this || g$e).offset + e11 <= (this || g$e).length)) + return this.error(t8 || "DecoderBuffer overrun"); + var r9 = new o7((this || g$e).base); + return r9._reporterState = (this || g$e)._reporterState, r9.offset = (this || g$e).offset, r9.length = (this || g$e).offset + e11, (this || g$e).offset += e11, r9; + }, o7.prototype.raw = function(e11) { + return (this || g$e).base.slice(e11 ? e11.offset : (this || g$e).offset, (this || g$e).length); + }, p$k.EncoderBuffer = s7, s7.prototype.join = function(e11, t8) { + return e11 || (e11 = new i7((this || g$e).length)), t8 || (t8 = 0), 0 === (this || g$e).length || (Array.isArray((this || g$e).value) ? (this || g$e).value.forEach(function(r9) { + r9.join(e11, t8), t8 += r9.length; + }) : ("number" == typeof (this || g$e).value ? e11[t8] = (this || g$e).value : "string" == typeof (this || g$e).value ? e11.write((this || g$e).value, t8) : i7.isBuffer((this || g$e).value) && (this || g$e).value.copy(e11, t8), t8 += (this || g$e).length)), e11; + }, p$k; +} +function E$9() { + if (S$a) + return m$g; + S$a = true; + var e10 = m$g; + return e10.Reporter = c$i.Reporter, e10.DecoderBuffer = y$f().DecoderBuffer, e10.EncoderBuffer = y$f().EncoderBuffer, e10.Node = function() { + if (v$f) + return _$e; + v$f = true; + var e11 = E$9().Reporter, t8 = E$9().EncoderBuffer, r8 = E$9().DecoderBuffer, n7 = o$7, o7 = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"], s7 = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(o7); + function a7(e12, t9) { + var r9 = {}; + (this || b$c)._baseState = r9, r9.enc = e12, r9.parent = t9 || null, r9.children = null, r9.tag = null, r9.args = null, r9.reverseArgs = null, r9.choice = null, r9.optional = false, r9.any = false, r9.obj = false, r9.use = null, r9.useDecoder = null, r9.key = null, r9.default = null, r9.explicit = null, r9.implicit = null, r9.contains = null, r9.parent || (r9.children = [], this._wrap()); + } + _$e = a7; + var u7 = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; + return a7.prototype.clone = function() { + var e12 = (this || b$c)._baseState, t9 = {}; + u7.forEach(function(r10) { + t9[r10] = e12[r10]; + }); + var r9 = new (this || b$c).constructor(t9.parent); + return r9._baseState = t9, r9; + }, a7.prototype._wrap = function() { + var e12 = (this || b$c)._baseState; + s7.forEach(function(t9) { + (this || b$c)[t9] = function() { + var r9 = new (this || b$c).constructor(this || b$c); + return e12.children.push(r9), r9[t9].apply(r9, arguments); + }; + }, this || b$c); + }, a7.prototype._init = function(e12) { + var t9 = (this || b$c)._baseState; + n7(null === t9.parent), e12.call(this || b$c), t9.children = t9.children.filter(function(e13) { + return e13._baseState.parent === (this || b$c); + }, this || b$c), n7.equal(t9.children.length, 1, "Root node can have only one child"); + }, a7.prototype._useArgs = function(e12) { + var t9 = (this || b$c)._baseState, r9 = e12.filter(function(e13) { + return e13 instanceof (this || b$c).constructor; + }, this || b$c); + e12 = e12.filter(function(e13) { + return !(e13 instanceof (this || b$c).constructor); + }, this || b$c), 0 !== r9.length && (n7(null === t9.children), t9.children = r9, r9.forEach(function(e13) { + e13._baseState.parent = this || b$c; + }, this || b$c)), 0 !== e12.length && (n7(null === t9.args), t9.args = e12, t9.reverseArgs = e12.map(function(e13) { + if ("object" != typeof e13 || e13.constructor !== Object) + return e13; + var t10 = {}; + return Object.keys(e13).forEach(function(r10) { + r10 == (0 | r10) && (r10 |= 0); + var n8 = e13[r10]; + t10[n8] = r10; + }), t10; + })); + }, ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"].forEach(function(e12) { + a7.prototype[e12] = function() { + var t9 = (this || b$c)._baseState; + throw new Error(e12 + " not implemented for encoding: " + t9.enc); + }; + }), o7.forEach(function(e12) { + a7.prototype[e12] = function() { + var t9 = (this || b$c)._baseState, r9 = Array.prototype.slice.call(arguments); + return n7(null === t9.tag), t9.tag = e12, this._useArgs(r9), this || b$c; + }; + }), a7.prototype.use = function(e12) { + n7(e12); + var t9 = (this || b$c)._baseState; + return n7(null === t9.use), t9.use = e12, this || b$c; + }, a7.prototype.optional = function() { + return (this || b$c)._baseState.optional = true, this || b$c; + }, a7.prototype.def = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.default), t9.default = e12, t9.optional = true, this || b$c; + }, a7.prototype.explicit = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.explicit && null === t9.implicit), t9.explicit = e12, this || b$c; + }, a7.prototype.implicit = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.explicit && null === t9.implicit), t9.implicit = e12, this || b$c; + }, a7.prototype.obj = function() { + var e12 = (this || b$c)._baseState, t9 = Array.prototype.slice.call(arguments); + return e12.obj = true, 0 !== t9.length && this._useArgs(t9), this || b$c; + }, a7.prototype.key = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.key), t9.key = e12, this || b$c; + }, a7.prototype.any = function() { + return (this || b$c)._baseState.any = true, this || b$c; + }, a7.prototype.choice = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.choice), t9.choice = e12, this._useArgs(Object.keys(e12).map(function(t10) { + return e12[t10]; + })), this || b$c; + }, a7.prototype.contains = function(e12) { + var t9 = (this || b$c)._baseState; + return n7(null === t9.use), t9.contains = e12, this || b$c; + }, a7.prototype._decode = function(e12, t9) { + var n8 = (this || b$c)._baseState; + if (null === n8.parent) + return e12.wrapResult(n8.children[0]._decode(e12, t9)); + var i7, o8 = n8.default, s8 = true, a8 = null; + if (null !== n8.key && (a8 = e12.enterKey(n8.key)), n8.optional) { + var u8 = null; + if (null !== n8.explicit ? u8 = n8.explicit : null !== n8.implicit ? u8 = n8.implicit : null !== n8.tag && (u8 = n8.tag), null !== u8 || n8.any) { + if (s8 = this._peekTag(e12, u8, n8.any), e12.isError(s8)) + return s8; + } else { + var c7 = e12.save(); + try { + null === n8.choice ? this._decodeGeneric(n8.tag, e12, t9) : this._decodeChoice(e12, t9), s8 = true; + } catch (e13) { + s8 = false; + } + e12.restore(c7); + } + } + if (n8.obj && s8 && (i7 = e12.enterObject()), s8) { + if (null !== n8.explicit) { + var f8 = this._decodeTag(e12, n8.explicit); + if (e12.isError(f8)) + return f8; + e12 = f8; + } + var l7 = e12.offset; + if (null === n8.use && null === n8.choice) { + if (n8.any) + c7 = e12.save(); + var h8 = this._decodeTag(e12, null !== n8.implicit ? n8.implicit : n8.tag, n8.any); + if (e12.isError(h8)) + return h8; + n8.any ? o8 = e12.raw(c7) : e12 = h8; + } + if (t9 && t9.track && null !== n8.tag && t9.track(e12.path(), l7, e12.length, "tagged"), t9 && t9.track && null !== n8.tag && t9.track(e12.path(), e12.offset, e12.length, "content"), o8 = n8.any ? o8 : null === n8.choice ? this._decodeGeneric(n8.tag, e12, t9) : this._decodeChoice(e12, t9), e12.isError(o8)) + return o8; + if (n8.any || null !== n8.choice || null === n8.children || n8.children.forEach(function(r9) { + r9._decode(e12, t9); + }), n8.contains && ("octstr" === n8.tag || "bitstr" === n8.tag)) { + var p7 = new r8(o8); + o8 = this._getUse(n8.contains, e12._reporterState.obj)._decode(p7, t9); + } + } + return n8.obj && s8 && (o8 = e12.leaveObject(i7)), null === n8.key || null === o8 && true !== s8 ? null !== a8 && e12.exitKey(a8) : e12.leaveKey(a8, n8.key, o8), o8; + }, a7.prototype._decodeGeneric = function(e12, t9, r9) { + var n8 = (this || b$c)._baseState; + return "seq" === e12 || "set" === e12 ? null : "seqof" === e12 || "setof" === e12 ? this._decodeList(t9, e12, n8.args[0], r9) : /str$/.test(e12) ? this._decodeStr(t9, e12, r9) : "objid" === e12 && n8.args ? this._decodeObjid(t9, n8.args[0], n8.args[1], r9) : "objid" === e12 ? this._decodeObjid(t9, null, null, r9) : "gentime" === e12 || "utctime" === e12 ? this._decodeTime(t9, e12, r9) : "null_" === e12 ? this._decodeNull(t9, r9) : "bool" === e12 ? this._decodeBool(t9, r9) : "objDesc" === e12 ? this._decodeStr(t9, e12, r9) : "int" === e12 || "enum" === e12 ? this._decodeInt(t9, n8.args && n8.args[0], r9) : null !== n8.use ? this._getUse(n8.use, t9._reporterState.obj)._decode(t9, r9) : t9.error("unknown tag: " + e12); + }, a7.prototype._getUse = function(e12, t9) { + var r9 = (this || b$c)._baseState; + return r9.useDecoder = this._use(e12, t9), n7(null === r9.useDecoder._baseState.parent), r9.useDecoder = r9.useDecoder._baseState.children[0], r9.implicit !== r9.useDecoder._baseState.implicit && (r9.useDecoder = r9.useDecoder.clone(), r9.useDecoder._baseState.implicit = r9.implicit), r9.useDecoder; + }, a7.prototype._decodeChoice = function(e12, t9) { + var r9 = (this || b$c)._baseState, n8 = null, i7 = false; + return Object.keys(r9.choice).some(function(o8) { + var s8 = e12.save(), a8 = r9.choice[o8]; + try { + var u8 = a8._decode(e12, t9); + if (e12.isError(u8)) + return false; + n8 = { type: o8, value: u8 }, i7 = true; + } catch (t10) { + return e12.restore(s8), false; + } + return true; + }, this || b$c), i7 ? n8 : e12.error("Choice not matched"); + }, a7.prototype._createEncoderBuffer = function(e12) { + return new t8(e12, (this || b$c).reporter); + }, a7.prototype._encode = function(e12, t9, r9) { + var n8 = (this || b$c)._baseState; + if (null === n8.default || n8.default !== e12) { + var i7 = this._encodeValue(e12, t9, r9); + if (void 0 !== i7 && !this._skipDefault(i7, t9, r9)) + return i7; + } + }, a7.prototype._encodeValue = function(t9, r9, n8) { + var i7 = (this || b$c)._baseState; + if (null === i7.parent) + return i7.children[0]._encode(t9, r9 || new e11()); + var o8 = null; + if ((this || b$c).reporter = r9, i7.optional && void 0 === t9) { + if (null === i7.default) + return; + t9 = i7.default; + } + var s8 = null, a8 = false; + if (i7.any) + o8 = this._createEncoderBuffer(t9); + else if (i7.choice) + o8 = this._encodeChoice(t9, r9); + else if (i7.contains) + s8 = this._getUse(i7.contains, n8)._encode(t9, r9), a8 = true; + else if (i7.children) + s8 = i7.children.map(function(e12) { + if ("null_" === e12._baseState.tag) + return e12._encode(null, r9, t9); + if (null === e12._baseState.key) + return r9.error("Child should have a key"); + var n9 = r9.enterKey(e12._baseState.key); + if ("object" != typeof t9) + return r9.error("Child expected, but input is not object"); + var i8 = e12._encode(t9[e12._baseState.key], r9, t9); + return r9.leaveKey(n9), i8; + }, this || b$c).filter(function(e12) { + return e12; + }), s8 = this._createEncoderBuffer(s8); + else if ("seqof" === i7.tag || "setof" === i7.tag) { + if (!i7.args || 1 !== i7.args.length) + return r9.error("Too many args for : " + i7.tag); + if (!Array.isArray(t9)) + return r9.error("seqof/setof, but data is not Array"); + var u8 = this.clone(); + u8._baseState.implicit = null, s8 = this._createEncoderBuffer(t9.map(function(e12) { + var n9 = (this || b$c)._baseState; + return this._getUse(n9.args[0], t9)._encode(e12, r9); + }, u8)); + } else + null !== i7.use ? o8 = this._getUse(i7.use, n8)._encode(t9, r9) : (s8 = this._encodePrimitive(i7.tag, t9), a8 = true); + if (!i7.any && null === i7.choice) { + var c7 = null !== i7.implicit ? i7.implicit : i7.tag, f8 = null === i7.implicit ? "universal" : "context"; + null === c7 ? null === i7.use && r9.error("Tag could be omitted only for .use()") : null === i7.use && (o8 = this._encodeComposite(c7, a8, f8, s8)); + } + return null !== i7.explicit && (o8 = this._encodeComposite(i7.explicit, false, "context", o8)), o8; + }, a7.prototype._encodeChoice = function(e12, t9) { + var r9 = (this || b$c)._baseState, i7 = r9.choice[e12.type]; + return i7 || n7(false, e12.type + " not found in " + JSON.stringify(Object.keys(r9.choice))), i7._encode(e12.value, t9); + }, a7.prototype._encodePrimitive = function(e12, t9) { + var r9 = (this || b$c)._baseState; + if (/str$/.test(e12)) + return this._encodeStr(t9, e12); + if ("objid" === e12 && r9.args) + return this._encodeObjid(t9, r9.reverseArgs[0], r9.args[1]); + if ("objid" === e12) + return this._encodeObjid(t9, null, null); + if ("gentime" === e12 || "utctime" === e12) + return this._encodeTime(t9, e12); + if ("null_" === e12) + return this._encodeNull(); + if ("int" === e12 || "enum" === e12) + return this._encodeInt(t9, r9.args && r9.reverseArgs[0]); + if ("bool" === e12) + return this._encodeBool(t9); + if ("objDesc" === e12) + return this._encodeStr(t9, e12); + throw new Error("Unsupported tag: " + e12); + }, a7.prototype._isNumstr = function(e12) { + return /^[0-9 ]*$/.test(e12); + }, a7.prototype._isPrintstr = function(e12) { + return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e12); + }, _$e; + }(), m$g; +} +function T$6() { + if (k$c) + return B$9; + k$c = true; + var e10 = B$9; + return e10._reverse = function(e11) { + var t8 = {}; + return Object.keys(e11).forEach(function(r8) { + (0 | r8) == r8 && (r8 |= 0); + var n7 = e11[r8]; + t8[n7] = r8; + }), t8; + }, e10.der = function() { + if (w$f) + return j$6; + w$f = true; + var e11 = T$6(); + return j$6.tagClass = { 0: "universal", 1: "application", 2: "context", 3: "private" }, j$6.tagClassByName = e11._reverse(j$6.tagClass), j$6.tag = { 0: "end", 1: "bool", 2: "int", 3: "bitstr", 4: "octstr", 5: "null_", 6: "objid", 7: "objDesc", 8: "external", 9: "real", 10: "enum", 11: "embed", 12: "utf8str", 13: "relativeOid", 16: "seq", 17: "set", 18: "numstr", 19: "printstr", 20: "t61str", 21: "videostr", 22: "ia5str", 23: "utctime", 24: "gentime", 25: "graphstr", 26: "iso646str", 27: "genstr", 28: "unistr", 29: "charstr", 30: "bmpstr" }, j$6.tagByName = e11._reverse(j$6.tag), j$6; + }(), B$9; +} +function C$6() { + if (U$7) + return D$5; + U$7 = true; + var e10 = t$2, r8 = Y$3(), n7 = r8.base, i7 = r8.bignum, o7 = r8.constants.der; + function s7(e11) { + (this || N$5).enc = "der", (this || N$5).name = e11.name, (this || N$5).entity = e11, (this || N$5).tree = new a7(), (this || N$5).tree._init(e11.body); + } + function a7(e11) { + n7.Node.call(this || N$5, "der", e11); + } + function u7(e11, t8) { + var r9 = e11.readUInt8(t8); + if (e11.isError(r9)) + return r9; + var n8 = o7.tagClass[r9 >> 6], i8 = 0 == (32 & r9); + if (31 == (31 & r9)) { + var s8 = r9; + for (r9 = 0; 128 == (128 & s8); ) { + if (s8 = e11.readUInt8(t8), e11.isError(s8)) + return s8; + r9 <<= 7, r9 |= 127 & s8; + } + } else + r9 &= 31; + return { cls: n8, primitive: i8, tag: r9, tagStr: o7.tag[r9] }; + } + function c7(e11, t8, r9) { + var n8 = e11.readUInt8(r9); + if (e11.isError(n8)) + return n8; + if (!t8 && 128 === n8) + return null; + if (0 == (128 & n8)) + return n8; + var i8 = 127 & n8; + if (i8 > 4) + return e11.error("length octect is too long"); + n8 = 0; + for (var o8 = 0; o8 < i8; o8++) { + n8 <<= 8; + var s8 = e11.readUInt8(r9); + if (e11.isError(s8)) + return s8; + n8 |= s8; + } + return n8; + } + return D$5 = s7, s7.prototype.decode = function(e11, t8) { + return e11 instanceof n7.DecoderBuffer || (e11 = new n7.DecoderBuffer(e11, t8)), (this || N$5).tree._decode(e11, t8); + }, e10(a7, n7.Node), a7.prototype._peekTag = function(e11, t8, r9) { + if (e11.isEmpty()) + return false; + var n8 = e11.save(), i8 = u7(e11, 'Failed to peek tag: "' + t8 + '"'); + return e11.isError(i8) ? i8 : (e11.restore(n8), i8.tag === t8 || i8.tagStr === t8 || i8.tagStr + "of" === t8 || r9); + }, a7.prototype._decodeTag = function(e11, t8, r9) { + var n8 = u7(e11, 'Failed to decode tag of "' + t8 + '"'); + if (e11.isError(n8)) + return n8; + var i8 = c7(e11, n8.primitive, 'Failed to get length of "' + t8 + '"'); + if (e11.isError(i8)) + return i8; + if (!r9 && n8.tag !== t8 && n8.tagStr !== t8 && n8.tagStr + "of" !== t8) + return e11.error('Failed to match tag: "' + t8 + '"'); + if (n8.primitive || null !== i8) + return e11.skip(i8, 'Failed to match body of: "' + t8 + '"'); + var o8 = e11.save(), s8 = this._skipUntilEnd(e11, 'Failed to skip indefinite length body: "' + (this || N$5).tag + '"'); + return e11.isError(s8) ? s8 : (i8 = e11.offset - o8.offset, e11.restore(o8), e11.skip(i8, 'Failed to match body of: "' + t8 + '"')); + }, a7.prototype._skipUntilEnd = function(e11, t8) { + for (; ; ) { + var r9 = u7(e11, t8); + if (e11.isError(r9)) + return r9; + var n8, i8 = c7(e11, r9.primitive, t8); + if (e11.isError(i8)) + return i8; + if (n8 = r9.primitive || null !== i8 ? e11.skip(i8) : this._skipUntilEnd(e11, t8), e11.isError(n8)) + return n8; + if ("end" === r9.tagStr) + break; + } + }, a7.prototype._decodeList = function(e11, t8, r9, n8) { + for (var i8 = []; !e11.isEmpty(); ) { + var o8 = this._peekTag(e11, "end"); + if (e11.isError(o8)) + return o8; + var s8 = r9.decode(e11, "der", n8); + if (e11.isError(s8) && o8) + break; + i8.push(s8); + } + return i8; + }, a7.prototype._decodeStr = function(e11, t8) { + if ("bitstr" === t8) { + var r9 = e11.readUInt8(); + return e11.isError(r9) ? r9 : { unused: r9, data: e11.raw() }; + } + if ("bmpstr" === t8) { + var n8 = e11.raw(); + if (n8.length % 2 == 1) + return e11.error("Decoding of string type: bmpstr length mismatch"); + for (var i8 = "", o8 = 0; o8 < n8.length / 2; o8++) + i8 += String.fromCharCode(n8.readUInt16BE(2 * o8)); + return i8; + } + if ("numstr" === t8) { + var s8 = e11.raw().toString("ascii"); + return this._isNumstr(s8) ? s8 : e11.error("Decoding of string type: numstr unsupported characters"); + } + if ("octstr" === t8) + return e11.raw(); + if ("objDesc" === t8) + return e11.raw(); + if ("printstr" === t8) { + var a8 = e11.raw().toString("ascii"); + return this._isPrintstr(a8) ? a8 : e11.error("Decoding of string type: printstr unsupported characters"); + } + return /str$/.test(t8) ? e11.raw().toString() : e11.error("Decoding of string type: " + t8 + " unsupported"); + }, a7.prototype._decodeObjid = function(e11, t8, r9) { + for (var n8, i8 = [], o8 = 0; !e11.isEmpty(); ) { + var s8 = e11.readUInt8(); + o8 <<= 7, o8 |= 127 & s8, 0 == (128 & s8) && (i8.push(o8), o8 = 0); + } + 128 & s8 && i8.push(o8); + var a8 = i8[0] / 40 | 0, u8 = i8[0] % 40; + if (n8 = r9 ? i8 : [a8, u8].concat(i8.slice(1)), t8) { + var c8 = t8[n8.join(" ")]; + void 0 === c8 && (c8 = t8[n8.join(".")]), void 0 !== c8 && (n8 = c8); + } + return n8; + }, a7.prototype._decodeTime = function(e11, t8) { + var r9 = e11.raw().toString(); + if ("gentime" === t8) + var n8 = 0 | r9.slice(0, 4), i8 = 0 | r9.slice(4, 6), o8 = 0 | r9.slice(6, 8), s8 = 0 | r9.slice(8, 10), a8 = 0 | r9.slice(10, 12), u8 = 0 | r9.slice(12, 14); + else { + if ("utctime" !== t8) + return e11.error("Decoding " + t8 + " time is not supported yet"); + n8 = 0 | r9.slice(0, 2), i8 = 0 | r9.slice(2, 4), o8 = 0 | r9.slice(4, 6), s8 = 0 | r9.slice(6, 8), a8 = 0 | r9.slice(8, 10), u8 = 0 | r9.slice(10, 12); + n8 = n8 < 70 ? 2e3 + n8 : 1900 + n8; + } + return Date.UTC(n8, i8 - 1, o8, s8, a8, u8, 0); + }, a7.prototype._decodeNull = function(e11) { + return null; + }, a7.prototype._decodeBool = function(e11) { + var t8 = e11.readUInt8(); + return e11.isError(t8) ? t8 : 0 !== t8; + }, a7.prototype._decodeInt = function(e11, t8) { + var r9 = e11.raw(), n8 = new i7(r9); + return t8 && (n8 = t8[n8.toString(10)] || n8), n8; + }, a7.prototype._use = function(e11, t8) { + return "function" == typeof e11 && (e11 = e11(t8)), e11._getDecoder("der").tree; + }, D$5; +} +function P$5() { + if (q$5) + return I$9; + q$5 = true; + var e10 = I$9; + return e10.der = C$6(), e10.pem = function() { + if (A$9) + return O$6; + A$9 = true; + var e11 = t$2, r8 = e$1$1.Buffer, i7 = C$6(); + function o7(e12) { + i7.call(this || x$7, e12), (this || x$7).enc = "pem"; + } + return e11(o7, i7), O$6 = o7, o7.prototype.decode = function(e12, t8) { + for (var n7 = e12.toString().split(/[\r\n]+/g), o8 = t8.label.toUpperCase(), s7 = /^-----(BEGIN|END) ([^-]+)-----$/, a7 = -1, u7 = -1, c7 = 0; c7 < n7.length; c7++) { + var f8 = n7[c7].match(s7); + if (null !== f8 && f8[2] === o8) { + if (-1 !== a7) { + if ("END" !== f8[1]) + break; + u7 = c7; + break; + } + if ("BEGIN" !== f8[1]) + break; + a7 = c7; + } + } + if (-1 === a7 || -1 === u7) + throw new Error("PEM section not found for: " + o8); + var l7 = n7.slice(a7 + 1, u7).join(""); + l7.replace(/[^a-z0-9\+\/=]+/gi, ""); + var h8 = new r8(l7, "base64"); + return i7.prototype.decode.call(this || x$7, h8, t8); + }, O$6; + }(), I$9; +} +function $$2() { + if (K$5) + return F$6; + K$5 = true; + var e10 = t$2, r8 = e$1$1.Buffer, i7 = Y$3(), o7 = i7.base, s7 = i7.constants.der; + function a7(e11) { + (this || R$4).enc = "der", (this || R$4).name = e11.name, (this || R$4).entity = e11, (this || R$4).tree = new u7(), (this || R$4).tree._init(e11.body); + } + function u7(e11) { + o7.Node.call(this || R$4, "der", e11); + } + function c7(e11) { + return e11 < 10 ? "0" + e11 : e11; + } + return F$6 = a7, a7.prototype.encode = function(e11, t8) { + return (this || R$4).tree._encode(e11, t8).join(); + }, e10(u7, o7.Node), u7.prototype._encodeComposite = function(e11, t8, n7, i8) { + var o8, a8 = function(e12, t9, r9, n8) { + var i9; + "seqof" === e12 ? e12 = "seq" : "setof" === e12 && (e12 = "set"); + if (s7.tagByName.hasOwnProperty(e12)) + i9 = s7.tagByName[e12]; + else { + if ("number" != typeof e12 || (0 | e12) !== e12) + return n8.error("Unknown tag: " + e12); + i9 = e12; + } + if (i9 >= 31) + return n8.error("Multi-octet tag encoding unsupported"); + t9 || (i9 |= 32); + return i9 |= s7.tagClassByName[r9 || "universal"] << 6; + }(e11, t8, n7, (this || R$4).reporter); + if (i8.length < 128) + return (o8 = new r8(2))[0] = a8, o8[1] = i8.length, this._createEncoderBuffer([o8, i8]); + for (var u8 = 1, c8 = i8.length; c8 >= 256; c8 >>= 8) + u8++; + (o8 = new r8(2 + u8))[0] = a8, o8[1] = 128 | u8; + c8 = 1 + u8; + for (var f8 = i8.length; f8 > 0; c8--, f8 >>= 8) + o8[c8] = 255 & f8; + return this._createEncoderBuffer([o8, i8]); + }, u7.prototype._encodeStr = function(e11, t8) { + if ("bitstr" === t8) + return this._createEncoderBuffer([0 | e11.unused, e11.data]); + if ("bmpstr" === t8) { + for (var n7 = new r8(2 * e11.length), i8 = 0; i8 < e11.length; i8++) + n7.writeUInt16BE(e11.charCodeAt(i8), 2 * i8); + return this._createEncoderBuffer(n7); + } + return "numstr" === t8 ? this._isNumstr(e11) ? this._createEncoderBuffer(e11) : (this || R$4).reporter.error("Encoding of string type: numstr supports only digits and space") : "printstr" === t8 ? this._isPrintstr(e11) ? this._createEncoderBuffer(e11) : (this || R$4).reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark") : /str$/.test(t8) || "objDesc" === t8 ? this._createEncoderBuffer(e11) : (this || R$4).reporter.error("Encoding of string type: " + t8 + " unsupported"); + }, u7.prototype._encodeObjid = function(e11, t8, n7) { + if ("string" == typeof e11) { + if (!t8) + return (this || R$4).reporter.error("string objid given, but no values map found"); + if (!t8.hasOwnProperty(e11)) + return (this || R$4).reporter.error("objid not found in values map"); + e11 = t8[e11].split(/[\s\.]+/g); + for (var i8 = 0; i8 < e11.length; i8++) + e11[i8] |= 0; + } else if (Array.isArray(e11)) { + e11 = e11.slice(); + for (i8 = 0; i8 < e11.length; i8++) + e11[i8] |= 0; + } + if (!Array.isArray(e11)) + return (this || R$4).reporter.error("objid() should be either array or string, got: " + JSON.stringify(e11)); + if (!n7) { + if (e11[1] >= 40) + return (this || R$4).reporter.error("Second objid identifier OOB"); + e11.splice(0, 2, 40 * e11[0] + e11[1]); + } + var o8 = 0; + for (i8 = 0; i8 < e11.length; i8++) { + var s8 = e11[i8]; + for (o8++; s8 >= 128; s8 >>= 7) + o8++; + } + var a8 = new r8(o8), u8 = a8.length - 1; + for (i8 = e11.length - 1; i8 >= 0; i8--) { + s8 = e11[i8]; + for (a8[u8--] = 127 & s8; (s8 >>= 7) > 0; ) + a8[u8--] = 128 | 127 & s8; + } + return this._createEncoderBuffer(a8); + }, u7.prototype._encodeTime = function(e11, t8) { + var r9, n7 = new Date(e11); + return "gentime" === t8 ? r9 = [c7(n7.getFullYear()), c7(n7.getUTCMonth() + 1), c7(n7.getUTCDate()), c7(n7.getUTCHours()), c7(n7.getUTCMinutes()), c7(n7.getUTCSeconds()), "Z"].join("") : "utctime" === t8 ? r9 = [c7(n7.getFullYear() % 100), c7(n7.getUTCMonth() + 1), c7(n7.getUTCDate()), c7(n7.getUTCHours()), c7(n7.getUTCMinutes()), c7(n7.getUTCSeconds()), "Z"].join("") : (this || R$4).reporter.error("Encoding " + t8 + " time is not supported yet"), this._encodeStr(r9, "octstr"); + }, u7.prototype._encodeNull = function() { + return this._createEncoderBuffer(""); + }, u7.prototype._encodeInt = function(e11, t8) { + if ("string" == typeof e11) { + if (!t8) + return (this || R$4).reporter.error("String int or enum given, but no values map"); + if (!t8.hasOwnProperty(e11)) + return (this || R$4).reporter.error("Values map doesn't contain: " + JSON.stringify(e11)); + e11 = t8[e11]; + } + if ("number" != typeof e11 && !r8.isBuffer(e11)) { + var n7 = e11.toArray(); + !e11.sign && 128 & n7[0] && n7.unshift(0), e11 = new r8(n7); + } + if (r8.isBuffer(e11)) { + var i8 = e11.length; + 0 === e11.length && i8++; + var o8 = new r8(i8); + return e11.copy(o8), 0 === e11.length && (o8[0] = 0), this._createEncoderBuffer(o8); + } + if (e11 < 128) + return this._createEncoderBuffer(e11); + if (e11 < 256) + return this._createEncoderBuffer([0, e11]); + i8 = 1; + for (var s8 = e11; s8 >= 256; s8 >>= 8) + i8++; + for (s8 = (o8 = new Array(i8)).length - 1; s8 >= 0; s8--) + o8[s8] = 255 & e11, e11 >>= 8; + return 128 & o8[0] && o8.unshift(0), this._createEncoderBuffer(new r8(o8)); + }, u7.prototype._encodeBool = function(e11) { + return this._createEncoderBuffer(e11 ? 255 : 0); + }, u7.prototype._use = function(e11, t8) { + return "function" == typeof e11 && (e11 = e11(t8)), e11._getEncoder("der").tree; + }, u7.prototype._skipDefault = function(e11, t8, r9) { + var n7, i8 = (this || R$4)._baseState; + if (null === i8.default) + return false; + var o8 = e11.join(); + if (void 0 === i8.defaultBuffer && (i8.defaultBuffer = this._encodeValue(i8.default, t8, r9).join()), o8.length !== i8.defaultBuffer.length) + return false; + for (n7 = 0; n7 < o8.length; n7++) + if (o8[n7] !== i8.defaultBuffer[n7]) + return false; + return true; + }, F$6; +} +function Z$2() { + if (V$4) + return J$4; + V$4 = true; + var e10 = J$4; + return e10.der = $$2(), e10.pem = function() { + if (L$5) + return G$4; + L$5 = true; + var e11 = t$2, r8 = $$2(); + function n7(e12) { + r8.call(this || M$7, e12), (this || M$7).enc = "pem"; + } + return e11(n7, r8), G$4 = n7, n7.prototype.encode = function(e12, t8) { + for (var n8 = r8.prototype.encode.call(this || M$7, e12).toString("base64"), i7 = ["-----BEGIN " + t8.label + "-----"], o7 = 0; o7 < n8.length; o7 += 64) + i7.push(n8.slice(o7, o7 + 64)); + return i7.push("-----END " + t8.label + "-----"), i7.join("\n"); + }, G$4; + }(), J$4; +} +function Y$3() { + if (H$6) + return z$7; + H$6 = true; + var n7 = z$7; + return n7.bignum = n$c, n7.define = function() { + if (s$j) + return o$n; + s$j = true; + var e10 = Y$3(), n8 = t$2; + function i7(e11, t8) { + (this || a$m).name = e11, (this || a$m).body = t8, (this || a$m).decoders = {}, (this || a$m).encoders = {}; + } + return o$n.define = function(e11, t8) { + return new i7(e11, t8); + }, i7.prototype._createNamed = function(e11) { + var t8; + try { + t8 = exports$11$1.runInThisContext("(function " + (this || a$m).name + "(entity) {\n this._initNamed(entity);\n})"); + } catch (e12) { + t8 = function(e13) { + this._initNamed(e13); + }; + } + return n8(t8, e11), t8.prototype._initNamed = function(t9) { + e11.call(this || a$m, t9); + }, new t8(this || a$m); + }, i7.prototype._getDecoder = function(t8) { + return t8 = t8 || "der", (this || a$m).decoders.hasOwnProperty(t8) || ((this || a$m).decoders[t8] = this._createNamed(e10.decoders[t8])), (this || a$m).decoders[t8]; + }, i7.prototype.decode = function(e11, t8, r8) { + return this._getDecoder(t8).decode(e11, r8); + }, i7.prototype._getEncoder = function(t8) { + return t8 = t8 || "der", (this || a$m).encoders.hasOwnProperty(t8) || ((this || a$m).encoders[t8] = this._createNamed(e10.encoders[t8])), (this || a$m).encoders[t8]; + }, i7.prototype.encode = function(e11, t8, r8) { + return this._getEncoder(t8).encode(e11, r8); + }, o$n; + }().define, n7.base = E$9(), n7.constants = T$6(), n7.decoders = P$5(), n7.encoders = Z$2(), z$7; +} +function l$m(e10) { + var r8; + "object" != typeof e10 || h$i.isBuffer(e10) || (r8 = e10.passphrase, e10 = e10.key), "string" == typeof e10 && (e10 = h$i.from(e10)); + var a7, t8, c7 = f$p(e10, r8), s7 = c7.tag, i7 = c7.data; + switch (s7) { + case "CERTIFICATE": + t8 = y$h.certificate.decode(i7, "der").tbsCertificate.subjectPublicKeyInfo; + case "PUBLIC KEY": + switch (t8 || (t8 = y$h.PublicKey.decode(i7, "der")), a7 = t8.algorithm.algorithm.join(".")) { + case "1.2.840.113549.1.1.1": + return y$h.RSAPublicKey.decode(t8.subjectPublicKey.data, "der"); + case "1.2.840.10045.2.1": + return t8.subjectPrivateKey = t8.subjectPublicKey, { type: "ec", data: t8 }; + case "1.2.840.10040.4.1": + return t8.algorithm.params.pub_key = y$h.DSAparam.decode(t8.subjectPublicKey.data, "der"), { type: "dsa", data: t8.algorithm.params }; + default: + throw new Error("unknown key id " + a7); + } + case "ENCRYPTED PRIVATE KEY": + i7 = function(e11, r9) { + var a8 = e11.algorithm.decrypt.kde.kdeparams.salt, t9 = parseInt(e11.algorithm.decrypt.kde.kdeparams.iters.toString(), 10), c8 = m$i[e11.algorithm.decrypt.cipher.algo.join(".")], s8 = e11.algorithm.decrypt.cipher.iv, i8 = e11.subjectPrivateKey, o7 = parseInt(c8.split("-")[1], 10) / 8, d7 = E$a.pbkdf2Sync(r9, a8, t9, o7, "sha1"), n7 = b$e.createDecipheriv(c8, d7, s8), p7 = []; + return p7.push(n7.update(i8)), p7.push(n7.final()), h$i.concat(p7); + }(i7 = y$h.EncryptedPrivateKey.decode(i7, "der"), r8); + case "PRIVATE KEY": + switch (a7 = (t8 = y$h.PrivateKey.decode(i7, "der")).algorithm.algorithm.join(".")) { + case "1.2.840.113549.1.1.1": + return y$h.RSAPrivateKey.decode(t8.subjectPrivateKey, "der"); + case "1.2.840.10045.2.1": + return { curve: t8.algorithm.curve, privateKey: y$h.ECPrivateKey.decode(t8.subjectPrivateKey, "der").privateKey }; + case "1.2.840.10040.4.1": + return t8.algorithm.params.priv_key = y$h.DSAparam.decode(t8.subjectPrivateKey, "der"), { type: "dsa", params: t8.algorithm.params }; + default: + throw new Error("unknown key id " + a7); + } + case "RSA PUBLIC KEY": + return y$h.RSAPublicKey.decode(i7, "der"); + case "RSA PRIVATE KEY": + return y$h.RSAPrivateKey.decode(i7, "der"); + case "DSA PRIVATE KEY": + return { type: "dsa", params: y$h.DSAPrivateKey.decode(i7, "der") }; + case "EC PRIVATE KEY": + return { curve: (i7 = y$h.ECPrivateKey.decode(i7, "der")).parameters.value, privateKey: i7.privateKey }; + default: + throw new Error("unknown key type " + s7); + } +} +function y$i(e10, t8, r8, n7) { + if ((e10 = new f$q(e10.toArray())).length < t8.byteLength()) { + var a7 = new f$q(t8.byteLength() - e10.length); + a7.fill(0), e10 = f$q.concat([a7, e10]); + } + var o7 = r8.length, i7 = function(e11, t9) { + e11 = (e11 = b$f(e11, t9)).mod(t9); + var r9 = new f$q(e11.toArray()); + if (r9.length < t9.byteLength()) { + var n8 = new f$q(t9.byteLength() - r9.length); + n8.fill(0), r9 = f$q.concat([n8, r9]); + } + return r9; + }(r8, t8), s7 = new f$q(o7); + s7.fill(1); + var h8 = new f$q(o7); + return h8.fill(0), h8 = c$k(n7, h8).update(s7).update(new f$q([0])).update(e10).update(i7).digest(), s7 = c$k(n7, h8).update(s7).digest(), { k: h8 = c$k(n7, h8).update(s7).update(new f$q([1])).update(e10).update(i7).digest(), v: s7 = c$k(n7, h8).update(s7).digest() }; +} +function b$f(e10, t8) { + var r8 = new l$n(e10), n7 = (e10.length << 3) - t8.bitLength(); + return n7 > 0 && r8.ishrn(n7), r8; +} +function _$f(e10, t8, r8) { + var n7, a7; + do { + for (n7 = new f$q(0); 8 * n7.length < e10.bitLength(); ) + t8.v = c$k(r8, t8.k).update(t8.v).digest(), n7 = f$q.concat([n7, t8.v]); + a7 = b$f(n7, e10), t8.k = c$k(r8, t8.k).update(t8.v).update(new f$q([0])).digest(), t8.v = c$k(r8, t8.k).update(t8.v).digest(); + } while (-1 !== a7.cmp(e10)); + return a7; +} +function k$e(e10, t8, r8, n7) { + return e10.toRed(l$n.mont(r8)).redPow(t8).fromRed().mod(n7); +} +function A$a(e10, t8) { + if (e10.cmpn(0) <= 0) + throw new Error("invalid sig"); + if (e10.cmp(t8) >= t8) + throw new Error("invalid sig"); +} +function D$6(e10) { + S$b.Writable.call(this || W$4); + var t8 = C$7[e10]; + if (!t8) + throw new Error("Unknown message digest"); + (this || W$4)._hashType = t8.hash, (this || W$4)._hash = B$a(t8.hash), (this || W$4)._tag = t8.id, (this || W$4)._signType = t8.sign; +} +function F$7(e10) { + S$b.Writable.call(this || W$4); + var t8 = C$7[e10]; + if (!t8) + throw new Error("Unknown message digest"); + (this || W$4)._hash = B$a(t8.hash), (this || W$4)._tag = t8.id, (this || W$4)._signType = t8.sign; +} +function M$8(e10) { + return new D$6(e10); +} +function O$7(e10) { + return new F$7(e10); +} +function c$l(e10) { + (this || n$p).curveType = o$q[e10], (this || n$p).curveType || ((this || n$p).curveType = { name: e10 }), (this || n$p).curve = new s$m.ec((this || n$p).curveType.name), (this || n$p).keys = void 0; +} +function y$j(e10, t8, r8) { + Array.isArray(e10) || (e10 = e10.toArray()); + var i7 = new p$o(e10); + if (r8 && i7.length < r8) { + var n7 = new p$o(r8 - i7.length); + n7.fill(0), i7 = p$o.concat([n7, i7]); + } + return t8 ? i7.toString(t8) : i7; +} +function f$s(r8) { + var n7 = l$o.allocUnsafe(4); + return n7.writeUInt32BE(r8, 0), n7; +} +function i$d() { + throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); +} +function y$l(r8, e10) { + if ("number" != typeof r8 || r8 != r8) + throw new TypeError("offset must be a number"); + if (r8 > p$q || r8 < 0) + throw new TypeError("offset must be a uint32"); + if (r8 > l$p || r8 > e10) + throw new RangeError("offset out of range"); +} +function b$h(r8, e10, n7) { + if ("number" != typeof r8 || r8 != r8) + throw new TypeError("size must be a number"); + if (r8 > p$q || r8 < 0) + throw new TypeError("size must be a uint32"); + if (r8 + e10 > n7 || r8 > l$p) + throw new RangeError("buffer too small"); +} +function w$i(r8, e10, n7, o7) { + if (f$t.browser) { + var t8 = r8.buffer, i7 = new Uint8Array(t8, e10, n7); + return m$l.getRandomValues(i7), o7 ? (f$t.nextTick(function() { + o7(null, r8); + }), void 0) : r8; + } + return o7 ? (a$o(n7, function(n8, t9) { + if (n8) + return o7(n8); + t9.copy(r8, e10), o7(null, r8); + }), void 0) : (a$o(n7).copy(r8, e10), r8); +} +function dew$10$1() { + if (_dewExec$10$1) + return exports$10$1; + _dewExec$10$1 = true; + var r8; + exports$10$1 = function rand(len) { + if (!r8) + r8 = new Rand(null); + return r8.generate(len); + }; + function Rand(rand) { + (this || _global$a$1).rand = rand; + } + exports$10$1.Rand = Rand; + Rand.prototype.generate = function generate2(len) { + return this._rand(len); + }; + Rand.prototype._rand = function _rand(n7) { + if ((this || _global$a$1).rand.getBytes) + return (this || _global$a$1).rand.getBytes(n7); + var res = new Uint8Array(n7); + for (var i7 = 0; i7 < res.length; i7++) + res[i7] = (this || _global$a$1).rand.getByte(); + return res; + }; + if (typeof self === "object") { + if (self.crypto && self.crypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.crypto.getRandomValues(arr); + return arr; + }; + } else if (self.msCrypto && self.msCrypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.msCrypto.getRandomValues(arr); + return arr; + }; + } else if (typeof window === "object") { + Rand.prototype._rand = function() { + throw new Error("Not implemented yet"); + }; + } + } else { + try { + var crypto2 = l$q; + if (typeof crypto2.randomBytes !== "function") + throw new Error("Not supported"); + Rand.prototype._rand = function _rand(n7) { + return crypto2.randomBytes(n7); + }; + } catch (e10) { + } + } + return exports$10$1; +} +function dew$$$1() { + if (_dewExec$$$1) + return exports$$$1; + _dewExec$$$1 = true; + var bn = dew$11$1(); + var brorand = dew$10$1(); + function MillerRabin(rand) { + (this || _global$9$1).rand = rand || new brorand.Rand(); + } + exports$$$1 = MillerRabin; + MillerRabin.create = function create2(rand) { + return new MillerRabin(rand); + }; + MillerRabin.prototype._randbelow = function _randbelow(n7) { + var len = n7.bitLength(); + var min_bytes = Math.ceil(len / 8); + do + var a7 = new bn((this || _global$9$1).rand.generate(min_bytes)); + while (a7.cmp(n7) >= 0); + return a7; + }; + MillerRabin.prototype._randrange = function _randrange(start, stop) { + var size2 = stop.sub(start); + return start.add(this._randbelow(size2)); + }; + MillerRabin.prototype.test = function test(n7, k6, cb) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + var prime = true; + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + if (cb) + cb(a7); + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return false; + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) + return false; + } + return prime; + }; + MillerRabin.prototype.getDivisor = function getDivisor(n7, k6) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + var g7 = n7.gcd(a7); + if (g7.cmpn(1) !== 0) + return g7; + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return x7.fromRed().subn(1).gcd(n7); + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) { + x7 = x7.redSqr(); + return x7.fromRed().subn(1).gcd(n7); + } + } + return false; + }; + return exports$$$1; +} +function dew$_$1() { + if (_dewExec$_$1) + return exports$_$1; + _dewExec$_$1 = true; + var randomBytes2 = dew$1S(); + exports$_$1 = findPrime; + findPrime.simpleSieve = simpleSieve; + findPrime.fermatTest = fermatTest; + var BN = dew$12$1(); + var TWENTYFOUR = new BN(24); + var MillerRabin = dew$$$1(); + var millerRabin = new MillerRabin(); + var ONE = new BN(1); + var TWO = new BN(2); + var FIVE = new BN(5); + new BN(16); + new BN(8); + var TEN = new BN(10); + var THREE = new BN(3); + new BN(7); + var ELEVEN = new BN(11); + var FOUR = new BN(4); + new BN(12); + var primes = null; + function _getPrimes() { + if (primes !== null) + return primes; + var limit = 1048576; + var res = []; + res[0] = 2; + for (var i7 = 1, k6 = 3; k6 < limit; k6 += 2) { + var sqrt = Math.ceil(Math.sqrt(k6)); + for (var j6 = 0; j6 < i7 && res[j6] <= sqrt; j6++) + if (k6 % res[j6] === 0) + break; + if (i7 !== j6 && res[j6] <= sqrt) + continue; + res[i7++] = k6; + } + primes = res; + return res; + } + function simpleSieve(p7) { + var primes2 = _getPrimes(); + for (var i7 = 0; i7 < primes2.length; i7++) + if (p7.modn(primes2[i7]) === 0) { + if (p7.cmpn(primes2[i7]) === 0) { + return true; + } else { + return false; + } + } + return true; + } + function fermatTest(p7) { + var red = BN.mont(p7); + return TWO.toRed(red).redPow(p7.subn(1)).fromRed().cmpn(1) === 0; + } + function findPrime(bits, gen) { + if (bits < 16) { + if (gen === 2 || gen === 5) { + return new BN([140, 123]); + } else { + return new BN([140, 39]); + } + } + gen = new BN(gen); + var num, n22; + while (true) { + num = new BN(randomBytes2(Math.ceil(bits / 8))); + while (num.bitLength() > bits) { + num.ishrn(1); + } + if (num.isEven()) { + num.iadd(ONE); + } + if (!num.testn(1)) { + num.iadd(TWO); + } + if (!gen.cmp(TWO)) { + while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { + num.iadd(FOUR); + } + } else if (!gen.cmp(FIVE)) { + while (num.mod(TEN).cmp(THREE)) { + num.iadd(FOUR); + } + } + n22 = num.shrn(1); + if (simpleSieve(n22) && simpleSieve(num) && fermatTest(n22) && fermatTest(num) && millerRabin.test(n22) && millerRabin.test(num)) { + return num; + } + } + } + return exports$_$1; +} +function dew$Z$1() { + if (_dewExec$Z$1) + return exports$Z$1; + _dewExec$Z$1 = true; + var Buffer4 = e$1$1.Buffer; + var BN = dew$12$1(); + var MillerRabin = dew$$$1(); + var millerRabin = new MillerRabin(); + var TWENTYFOUR = new BN(24); + var ELEVEN = new BN(11); + var TEN = new BN(10); + var THREE = new BN(3); + var SEVEN = new BN(7); + var primes = dew$_$1(); + var randomBytes2 = dew$1S(); + exports$Z$1 = DH; + function setPublicKey(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$8$1)._pub = new BN(pub); + return this || _global$8$1; + } + function setPrivateKey(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + (this || _global$8$1)._priv = new BN(priv); + return this || _global$8$1; + } + var primeCache = {}; + function checkPrime(prime, generator) { + var gen = generator.toString("hex"); + var hex = [gen, prime.toString(16)].join("_"); + if (hex in primeCache) { + return primeCache[hex]; + } + var error2 = 0; + if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) { + error2 += 1; + if (gen === "02" || gen === "05") { + error2 += 8; + } else { + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + if (!millerRabin.test(prime.shrn(1))) { + error2 += 2; + } + var rem; + switch (gen) { + case "02": + if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { + error2 += 8; + } + break; + case "05": + rem = prime.mod(TEN); + if (rem.cmp(THREE) && rem.cmp(SEVEN)) { + error2 += 8; + } + break; + default: + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + function DH(prime, generator, malleable) { + this.setGenerator(generator); + (this || _global$8$1).__prime = new BN(prime); + (this || _global$8$1)._prime = BN.mont((this || _global$8$1).__prime); + (this || _global$8$1)._primeLen = prime.length; + (this || _global$8$1)._pub = void 0; + (this || _global$8$1)._priv = void 0; + (this || _global$8$1)._primeCode = void 0; + if (malleable) { + (this || _global$8$1).setPublicKey = setPublicKey; + (this || _global$8$1).setPrivateKey = setPrivateKey; + } else { + (this || _global$8$1)._primeCode = 8; + } + } + Object.defineProperty(DH.prototype, "verifyError", { + enumerable: true, + get: function() { + if (typeof (this || _global$8$1)._primeCode !== "number") { + (this || _global$8$1)._primeCode = checkPrime((this || _global$8$1).__prime, (this || _global$8$1).__gen); + } + return (this || _global$8$1)._primeCode; + } + }); + DH.prototype.generateKeys = function() { + if (!(this || _global$8$1)._priv) { + (this || _global$8$1)._priv = new BN(randomBytes2((this || _global$8$1)._primeLen)); + } + (this || _global$8$1)._pub = (this || _global$8$1)._gen.toRed((this || _global$8$1)._prime).redPow((this || _global$8$1)._priv).fromRed(); + return this.getPublicKey(); + }; + DH.prototype.computeSecret = function(other) { + other = new BN(other); + other = other.toRed((this || _global$8$1)._prime); + var secret = other.redPow((this || _global$8$1)._priv).fromRed(); + var out = new Buffer4(secret.toArray()); + var prime = this.getPrime(); + if (out.length < prime.length) { + var front = new Buffer4(prime.length - out.length); + front.fill(0); + out = Buffer4.concat([front, out]); + } + return out; + }; + DH.prototype.getPublicKey = function getPublicKey(enc) { + return formatReturnValue((this || _global$8$1)._pub, enc); + }; + DH.prototype.getPrivateKey = function getPrivateKey(enc) { + return formatReturnValue((this || _global$8$1)._priv, enc); + }; + DH.prototype.getPrime = function(enc) { + return formatReturnValue((this || _global$8$1).__prime, enc); + }; + DH.prototype.getGenerator = function(enc) { + return formatReturnValue((this || _global$8$1)._gen, enc); + }; + DH.prototype.setGenerator = function(gen, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(gen)) { + gen = new Buffer4(gen, enc); + } + (this || _global$8$1).__gen = gen; + (this || _global$8$1)._gen = new BN(gen); + return this || _global$8$1; + }; + function formatReturnValue(bn, enc) { + var buf = new Buffer4(bn.toArray()); + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$Z$1; +} +function dew$Y$1() { + if (_dewExec$Y$1) + return exports$Y$1; + _dewExec$Y$1 = true; + var Buffer4 = e$1$1.Buffer; + var generatePrime = dew$_$1(); + var primes = _primes$1; + var DH = dew$Z$1(); + function getDiffieHellman2(mod2) { + var prime = new Buffer4(primes[mod2].prime, "hex"); + var gen = new Buffer4(primes[mod2].gen, "hex"); + return new DH(prime, gen); + } + var ENCODINGS = { + "binary": true, + "hex": true, + "base64": true + }; + function createDiffieHellman2(prime, enc, generator, genc) { + if (Buffer4.isBuffer(enc) || ENCODINGS[enc] === void 0) { + return createDiffieHellman2(prime, "binary", enc, generator); + } + enc = enc || "binary"; + genc = genc || "binary"; + generator = generator || new Buffer4([2]); + if (!Buffer4.isBuffer(generator)) { + generator = new Buffer4(generator, genc); + } + if (typeof prime === "number") { + return new DH(generatePrime(prime, generator), generator, true); + } + if (!Buffer4.isBuffer(prime)) { + prime = new Buffer4(prime, enc); + } + return new DH(prime, generator, true); + } + exports$Y$1.DiffieHellmanGroup = exports$Y$1.createDiffieHellmanGroup = exports$Y$1.getDiffieHellman = getDiffieHellman2; + exports$Y$1.createDiffieHellman = exports$Y$1.DiffieHellman = createDiffieHellman2; + return exports$Y$1; +} +function dew$X$1() { + if (_dewExec$X$1) + return module$4$1.exports; + _dewExec$X$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$7$1).negative = 0; + (this || _global$7$1).words = null; + (this || _global$7$1).length = 0; + (this || _global$7$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$7$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$7$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$7$1).words = [number & 67108863]; + (this || _global$7$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$7$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$7$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$7$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$7$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$7$1).words = [0]; + (this || _global$7$1).length = 1; + return this || _global$7$1; + } + (this || _global$7$1).length = Math.ceil(number.length / 3); + (this || _global$7$1).words = new Array((this || _global$7$1).length); + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + (this || _global$7$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$7$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$7$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$7$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$7$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 48 && c7 <= 57) { + return c7 - 48; + } else if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + assert4(false, "Invalid character in " + string2); + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$7$1).length = Math.ceil((number.length - start) / 6); + (this || _global$7$1).words = new Array((this || _global$7$1).length); + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + (this || _global$7$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$7$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$7$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$7$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$7$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this._strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var b8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + b8 = c7 - 49 + 10; + } else if (c7 >= 17) { + b8 = c7 - 17 + 10; + } else { + b8 = c7; + } + assert4(c7 >= 0 && b8 < mul, "Invalid character"); + r8 += b8; + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$7$1).words = [0]; + (this || _global$7$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$7$1).words[0] + word < 67108864) { + (this || _global$7$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$7$1).words[0] + word < 67108864) { + (this || _global$7$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$7$1).length); + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + dest.words[i7] = (this || _global$7$1).words[i7]; + } + dest.length = (this || _global$7$1).length; + dest.negative = (this || _global$7$1).negative; + dest.red = (this || _global$7$1).red; + }; + function move(dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN.prototype._move = function _move(dest) { + move(dest, this || _global$7$1); + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$7$1).length < size2) { + (this || _global$7$1).words[(this || _global$7$1).length++] = 0; + } + return this || _global$7$1; + }; + BN.prototype._strip = function strip() { + while ((this || _global$7$1).length > 1 && (this || _global$7$1).words[(this || _global$7$1).length - 1] === 0) { + (this || _global$7$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$7$1).length === 1 && (this || _global$7$1).words[0] === 0) { + (this || _global$7$1).negative = 0; + } + return this || _global$7$1; + }; + if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { + try { + BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect2; + } catch (e10) { + BN.prototype.inspect = inspect2; + } + } else { + BN.prototype.inspect = inspect2; + } + function inspect2() { + return ((this || _global$7$1).red ? ""; + } + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + var w6 = (this || _global$7$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$7$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$7$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modrn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$7$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$7$1).words[0]; + if ((this || _global$7$1).length === 2) { + ret += (this || _global$7$1).words[1] * 67108864; + } else if ((this || _global$7$1).length === 3 && (this || _global$7$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$7$1).words[1] * 67108864; + } else if ((this || _global$7$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$7$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16, 2); + }; + if (Buffer4) { + BN.prototype.toBuffer = function toBuffer(endian, length) { + return this.toArrayLike(Buffer4, endian, length); + }; + } + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size2) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size2); + } + return new ArrayType(size2); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + this._strip(); + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + var res = allocate(ArrayType, reqLength); + var postfix = endian === "le" ? "LE" : "BE"; + this["_toArrayLike" + postfix](res, byteLength); + return res; + }; + BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { + var position = 0; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$7$1).length; i7++) { + var word = (this || _global$7$1).words[i7] << shift | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = word >> 8 & 255; + } + if (position < res.length) { + res[position++] = word >> 16 & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { + var position = res.length - 1; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$7$1).length; i7++) { + var word = (this || _global$7$1).words[i7] << shift | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = word >> 8 & 255; + } + if (position >= 0) { + res[position--] = word >> 16 & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$7$1).words[(this || _global$7$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$7$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = num.words[off3] >>> wbit & 1; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + var b8 = this._zeroBits((this || _global$7$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$7$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$7$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$7$1).negative ^= 1; + } + return this || _global$7$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$7$1).length < num.length) { + (this || _global$7$1).words[(this || _global$7$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$7$1).words[i7] = (this || _global$7$1).words[i7] | num.words[i7]; + } + return this._strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$7$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$7$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$7$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$7$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$7$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$7$1).words[i7] = (this || _global$7$1).words[i7] & num.words[i7]; + } + (this || _global$7$1).length = b8.length; + return this._strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$7$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$7$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$7$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$7$1).length > num.length) { + a7 = this || _global$7$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$7$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$7$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$7$1).words[i7] = a7.words[i7]; + } + } + (this || _global$7$1).length = a7.length; + return this._strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$7$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$7$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$7$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$7$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$7$1).words[i7] = ~(this || _global$7$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$7$1).words[i7] = ~(this || _global$7$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this._strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$7$1).words[off3] = (this || _global$7$1).words[off3] | 1 << wbit; + } else { + (this || _global$7$1).words[off3] = (this || _global$7$1).words[off3] & ~(1 << wbit); + } + return this._strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$7$1).negative !== 0 && num.negative === 0) { + (this || _global$7$1).negative = 0; + r8 = this.isub(num); + (this || _global$7$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$7$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$7$1).length > num.length) { + a7 = this || _global$7$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$7$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$7$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$7$1).length = a7.length; + if (carry !== 0) { + (this || _global$7$1).words[(this || _global$7$1).length] = carry; + (this || _global$7$1).length++; + } else if (a7 !== (this || _global$7$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$7$1).words[i7] = a7.words[i7]; + } + } + return this || _global$7$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$7$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$7$1).negative !== 0) { + (this || _global$7$1).negative = 0; + res = num.sub(this || _global$7$1); + (this || _global$7$1).negative = 1; + return res; + } + if ((this || _global$7$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$7$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$7$1).negative !== 0) { + (this || _global$7$1).negative = 0; + this.iadd(num); + (this || _global$7$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$7$1).negative = 0; + (this || _global$7$1).length = 1; + (this || _global$7$1).words[0] = 0; + return this || _global$7$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$7$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$7$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$7$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$7$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$7$1).words[i7] = a7.words[i7]; + } + } + (this || _global$7$1).length = Math.max((this || _global$7$1).length, i7); + if (a7 !== (this || _global$7$1)) { + (this || _global$7$1).negative = 1; + } + return this._strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$7$1).length + num.length; + if ((this || _global$7$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$7$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$7$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$7$1, num, out); + } else { + res = jumboMulTo(this || _global$7$1, num, out); + } + return res; + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$7$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$7$1).length + num.length); + return jumboMulTo(this || _global$7$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$7$1); + }; + BN.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$7$1).length; i7++) { + var w6 = ((this || _global$7$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$7$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$7$1).words[i7] = carry; + (this || _global$7$1).length++; + } + return isNegNum ? this.ineg() : this || _global$7$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$7$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$7$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$7$1).length; i7++) { + var newCarry = (this || _global$7$1).words[i7] & carryMask; + var c7 = ((this || _global$7$1).words[i7] | 0) - newCarry << r8; + (this || _global$7$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$7$1).words[i7] = carry; + (this || _global$7$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$7$1).length - 1; i7 >= 0; i7--) { + (this || _global$7$1).words[i7 + s7] = (this || _global$7$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$7$1).words[i7] = 0; + } + (this || _global$7$1).length += s7; + } + return this._strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$7$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$7$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$7$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$7$1).length > s7) { + (this || _global$7$1).length -= s7; + for (i7 = 0; i7 < (this || _global$7$1).length; i7++) { + (this || _global$7$1).words[i7] = (this || _global$7$1).words[i7 + s7]; + } + } else { + (this || _global$7$1).words[0] = 0; + (this || _global$7$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$7$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$7$1).words[i7] | 0; + (this || _global$7$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$7$1).length === 0) { + (this || _global$7$1).words[0] = 0; + (this || _global$7$1).length = 1; + } + return this._strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$7$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$7$1).length <= s7) + return false; + var w6 = (this || _global$7$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$7$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$7$1).length <= s7) { + return this || _global$7$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$7$1).length = Math.min(s7, (this || _global$7$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$7$1).words[(this || _global$7$1).length - 1] &= mask; + } + return this._strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$7$1).negative !== 0) { + if ((this || _global$7$1).length === 1 && ((this || _global$7$1).words[0] | 0) <= num) { + (this || _global$7$1).words[0] = num - ((this || _global$7$1).words[0] | 0); + (this || _global$7$1).negative = 0; + return this || _global$7$1; + } + (this || _global$7$1).negative = 0; + this.isubn(num); + (this || _global$7$1).negative = 1; + return this || _global$7$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$7$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$7$1).length && (this || _global$7$1).words[i7] >= 67108864; i7++) { + (this || _global$7$1).words[i7] -= 67108864; + if (i7 === (this || _global$7$1).length - 1) { + (this || _global$7$1).words[i7 + 1] = 1; + } else { + (this || _global$7$1).words[i7 + 1]++; + } + } + (this || _global$7$1).length = Math.max((this || _global$7$1).length, i7 + 1); + return this || _global$7$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$7$1).negative !== 0) { + (this || _global$7$1).negative = 0; + this.iaddn(num); + (this || _global$7$1).negative = 1; + return this || _global$7$1; + } + (this || _global$7$1).words[0] -= num; + if ((this || _global$7$1).length === 1 && (this || _global$7$1).words[0] < 0) { + (this || _global$7$1).words[0] = -(this || _global$7$1).words[0]; + (this || _global$7$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$7$1).length && (this || _global$7$1).words[i7] < 0; i7++) { + (this || _global$7$1).words[i7] += 67108864; + (this || _global$7$1).words[i7 + 1] -= 1; + } + } + return this._strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$7$1).negative = 0; + return this || _global$7$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$7$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$7$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$7$1).length - shift; i7++) { + w6 = ((this || _global$7$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$7$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this._strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$7$1).length; i7++) { + w6 = -((this || _global$7$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$7$1).words[i7] = w6 & 67108863; + } + (this || _global$7$1).negative = 1; + return this._strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$7$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5._strip(); + } + a7._strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$7$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$7$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$7$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$7$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$7$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modrn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modrn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$7$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$7$1).words[i7] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$7$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$7$1).words[i7] | 0) + carry * 67108864; + (this || _global$7$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + this._strip(); + return isNegNum ? this.ineg() : this || _global$7$1; + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$7$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$7$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$7$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$7$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$7$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$7$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$7$1).words[s7] |= q5; + return this || _global$7$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$7$1).length; i7++) { + var w6 = (this || _global$7$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$7$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$7$1).words[i7] = carry; + (this || _global$7$1).length++; + } + return this || _global$7$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$7$1).length === 1 && (this || _global$7$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$7$1).negative !== 0 && !negative) + return -1; + if ((this || _global$7$1).negative === 0 && negative) + return 1; + this._strip(); + var res; + if ((this || _global$7$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$7$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$7$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$7$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$7$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$7$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$7$1).length > num.length) + return 1; + if ((this || _global$7$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$7$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$7$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$7$1).red, "Already a number in reduction context"); + assert4((this || _global$7$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$7$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$7$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$7$1).red.convertFrom(this || _global$7$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$7$1).red = ctx; + return this || _global$7$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$7$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$7$1).red, "redAdd works only with red numbers"); + return (this || _global$7$1).red.add(this || _global$7$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$7$1).red, "redIAdd works only with red numbers"); + return (this || _global$7$1).red.iadd(this || _global$7$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$7$1).red, "redSub works only with red numbers"); + return (this || _global$7$1).red.sub(this || _global$7$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$7$1).red, "redISub works only with red numbers"); + return (this || _global$7$1).red.isub(this || _global$7$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$7$1).red, "redShl works only with red numbers"); + return (this || _global$7$1).red.shl(this || _global$7$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$7$1).red, "redMul works only with red numbers"); + (this || _global$7$1).red._verify2(this || _global$7$1, num); + return (this || _global$7$1).red.mul(this || _global$7$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$7$1).red, "redMul works only with red numbers"); + (this || _global$7$1).red._verify2(this || _global$7$1, num); + return (this || _global$7$1).red.imul(this || _global$7$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$7$1).red, "redSqr works only with red numbers"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.sqr(this || _global$7$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$7$1).red, "redISqr works only with red numbers"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.isqr(this || _global$7$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$7$1).red, "redSqrt works only with red numbers"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.sqrt(this || _global$7$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$7$1).red, "redInvm works only with red numbers"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.invm(this || _global$7$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$7$1).red, "redNeg works only with red numbers"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.neg(this || _global$7$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$7$1).red && !num.red, "redPow(normalNum)"); + (this || _global$7$1).red._verify1(this || _global$7$1); + return (this || _global$7$1).red.pow(this || _global$7$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$7$1).name = name2; + (this || _global$7$1).p = new BN(p7, 16); + (this || _global$7$1).n = (this || _global$7$1).p.bitLength(); + (this || _global$7$1).k = new BN(1).iushln((this || _global$7$1).n).isub((this || _global$7$1).p); + (this || _global$7$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$7$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$7$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$7$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$7$1).n); + var cmp = rlen < (this || _global$7$1).n ? -1 : r8.ucmp((this || _global$7$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$7$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$7$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$7$1).k); + }; + function K256() { + MPrime.call(this || _global$7$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$7$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$7$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$7$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$7$1).m = prime.p; + (this || _global$7$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$7$1).m = m7; + (this || _global$7$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$7$1).prime) + return (this || _global$7$1).prime.ireduce(a7)._forceRed(this || _global$7$1); + move(a7, a7.umod((this || _global$7$1).m)._forceRed(this || _global$7$1)); + return a7; + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$7$1).m.sub(a7)._forceRed(this || _global$7$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$7$1).m) >= 0) { + res.isub((this || _global$7$1).m); + } + return res._forceRed(this || _global$7$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$7$1).m) >= 0) { + res.isub((this || _global$7$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$7$1).m); + } + return res._forceRed(this || _global$7$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$7$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$7$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$7$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$7$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$7$1); + var nOne = one.redNeg(); + var lpow = (this || _global$7$1).m.subn(1).iushrn(1); + var z6 = (this || _global$7$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$7$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$7$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$7$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$7$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$7$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$7$1, m7); + (this || _global$7$1).shift = (this || _global$7$1).m.bitLength(); + if ((this || _global$7$1).shift % 26 !== 0) { + (this || _global$7$1).shift += 26 - (this || _global$7$1).shift % 26; + } + (this || _global$7$1).r = new BN(1).iushln((this || _global$7$1).shift); + (this || _global$7$1).r2 = this.imod((this || _global$7$1).r.sqr()); + (this || _global$7$1).rinv = (this || _global$7$1).r._invmp((this || _global$7$1).m); + (this || _global$7$1).minv = (this || _global$7$1).rinv.mul((this || _global$7$1).r).isubn(1).div((this || _global$7$1).m); + (this || _global$7$1).minv = (this || _global$7$1).minv.umod((this || _global$7$1).r); + (this || _global$7$1).minv = (this || _global$7$1).r.sub((this || _global$7$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$7$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$7$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$7$1).shift).mul((this || _global$7$1).minv).imaskn((this || _global$7$1).shift).mul((this || _global$7$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$7$1).shift); + var res = u7; + if (u7.cmp((this || _global$7$1).m) >= 0) { + res = u7.isub((this || _global$7$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$7$1).m); + } + return res._forceRed(this || _global$7$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$7$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$7$1).shift).mul((this || _global$7$1).minv).imaskn((this || _global$7$1).shift).mul((this || _global$7$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$7$1).shift); + var res = u7; + if (u7.cmp((this || _global$7$1).m) >= 0) { + res = u7.isub((this || _global$7$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$7$1).m); + } + return res._forceRed(this || _global$7$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$7$1).m).mul((this || _global$7$1).r2)); + return res._forceRed(this || _global$7$1); + }; + })(module$4$1, exports$X$1); + return module$4$1.exports; +} +function dew$W$1() { + if (_dewExec$W$1) + return exports$W$1; + _dewExec$W$1 = true; + var Buffer4 = e$1$1.Buffer; + var BN = dew$X$1(); + var randomBytes2 = dew$1S(); + function blind(priv) { + var r8 = getr(priv); + var blinder = r8.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed(); + return { + blinder, + unblinder: r8.invm(priv.modulus) + }; + } + function getr(priv) { + var len = priv.modulus.byteLength(); + var r8; + do { + r8 = new BN(randomBytes2(len)); + } while (r8.cmp(priv.modulus) >= 0 || !r8.umod(priv.prime1) || !r8.umod(priv.prime2)); + return r8; + } + function crt(msg, priv) { + var blinds = blind(priv); + var len = priv.modulus.byteLength(); + var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus); + var c1 = blinded.toRed(BN.mont(priv.prime1)); + var c22 = blinded.toRed(BN.mont(priv.prime2)); + var qinv = priv.coefficient; + var p7 = priv.prime1; + var q5 = priv.prime2; + var m1 = c1.redPow(priv.exponent1).fromRed(); + var m22 = c22.redPow(priv.exponent2).fromRed(); + var h8 = m1.isub(m22).imul(qinv).umod(p7).imul(q5); + return m22.iadd(h8).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer4, "be", len); + } + crt.getr = getr; + exports$W$1 = crt; + return exports$W$1; +} +function dew$V$1() { + if (_dewExec$V$1) + return module$3$1.exports; + _dewExec$V$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$6$1).negative = 0; + (this || _global$6$1).words = null; + (this || _global$6$1).length = 0; + (this || _global$6$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$6$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$6$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$6$1).words = [number & 67108863]; + (this || _global$6$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$6$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$6$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$6$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$6$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$6$1).words = [0]; + (this || _global$6$1).length = 1; + return this || _global$6$1; + } + (this || _global$6$1).length = Math.ceil(number.length / 3); + (this || _global$6$1).words = new Array((this || _global$6$1).length); + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + (this || _global$6$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$6$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$6$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$6$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$6$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$6$1).length = Math.ceil((number.length - start) / 6); + (this || _global$6$1).words = new Array((this || _global$6$1).length); + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + (this || _global$6$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$6$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$6$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$6$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$6$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$6$1).words = [0]; + (this || _global$6$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$6$1).words[0] + word < 67108864) { + (this || _global$6$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$6$1).words[0] + word < 67108864) { + (this || _global$6$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$6$1).length); + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + dest.words[i7] = (this || _global$6$1).words[i7]; + } + dest.length = (this || _global$6$1).length; + dest.negative = (this || _global$6$1).negative; + dest.red = (this || _global$6$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$6$1).length < size2) { + (this || _global$6$1).words[(this || _global$6$1).length++] = 0; + } + return this || _global$6$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$6$1).length > 1 && (this || _global$6$1).words[(this || _global$6$1).length - 1] === 0) { + (this || _global$6$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$6$1).length === 1 && (this || _global$6$1).words[0] === 0) { + (this || _global$6$1).negative = 0; + } + return this || _global$6$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$6$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + var w6 = (this || _global$6$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$6$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$6$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$6$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$6$1).words[0]; + if ((this || _global$6$1).length === 2) { + ret += (this || _global$6$1).words[1] * 67108864; + } else if ((this || _global$6$1).length === 3 && (this || _global$6$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$6$1).words[1] * 67108864; + } else if ((this || _global$6$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$6$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$6$1).words[(this || _global$6$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$6$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + var b8 = this._zeroBits((this || _global$6$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$6$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$6$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$6$1).negative ^= 1; + } + return this || _global$6$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$6$1).length < num.length) { + (this || _global$6$1).words[(this || _global$6$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$6$1).words[i7] = (this || _global$6$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$6$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$6$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$6$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$6$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$6$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$6$1).words[i7] = (this || _global$6$1).words[i7] & num.words[i7]; + } + (this || _global$6$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$6$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$6$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$6$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$6$1).length > num.length) { + a7 = this || _global$6$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$6$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$6$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$6$1).words[i7] = a7.words[i7]; + } + } + (this || _global$6$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$6$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$6$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$6$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$6$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$6$1).words[i7] = ~(this || _global$6$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$6$1).words[i7] = ~(this || _global$6$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$6$1).words[off3] = (this || _global$6$1).words[off3] | 1 << wbit; + } else { + (this || _global$6$1).words[off3] = (this || _global$6$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$6$1).negative !== 0 && num.negative === 0) { + (this || _global$6$1).negative = 0; + r8 = this.isub(num); + (this || _global$6$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$6$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$6$1).length > num.length) { + a7 = this || _global$6$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$6$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$6$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$6$1).length = a7.length; + if (carry !== 0) { + (this || _global$6$1).words[(this || _global$6$1).length] = carry; + (this || _global$6$1).length++; + } else if (a7 !== (this || _global$6$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$6$1).words[i7] = a7.words[i7]; + } + } + return this || _global$6$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$6$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$6$1).negative !== 0) { + (this || _global$6$1).negative = 0; + res = num.sub(this || _global$6$1); + (this || _global$6$1).negative = 1; + return res; + } + if ((this || _global$6$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$6$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$6$1).negative !== 0) { + (this || _global$6$1).negative = 0; + this.iadd(num); + (this || _global$6$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$6$1).negative = 0; + (this || _global$6$1).length = 1; + (this || _global$6$1).words[0] = 0; + return this || _global$6$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$6$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$6$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$6$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$6$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$6$1).words[i7] = a7.words[i7]; + } + } + (this || _global$6$1).length = Math.max((this || _global$6$1).length, i7); + if (a7 !== (this || _global$6$1)) { + (this || _global$6$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$6$1).length + num.length; + if ((this || _global$6$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$6$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$6$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$6$1, num, out); + } else { + res = jumboMulTo(this || _global$6$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$6$1).x = x7; + (this || _global$6$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$6$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$6$1).length + num.length); + return jumboMulTo(this || _global$6$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$6$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$6$1).length; i7++) { + var w6 = ((this || _global$6$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$6$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$6$1).words[i7] = carry; + (this || _global$6$1).length++; + } + return this || _global$6$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$6$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$6$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$6$1).length; i7++) { + var newCarry = (this || _global$6$1).words[i7] & carryMask; + var c7 = ((this || _global$6$1).words[i7] | 0) - newCarry << r8; + (this || _global$6$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$6$1).words[i7] = carry; + (this || _global$6$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$6$1).length - 1; i7 >= 0; i7--) { + (this || _global$6$1).words[i7 + s7] = (this || _global$6$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$6$1).words[i7] = 0; + } + (this || _global$6$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$6$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$6$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$6$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$6$1).length > s7) { + (this || _global$6$1).length -= s7; + for (i7 = 0; i7 < (this || _global$6$1).length; i7++) { + (this || _global$6$1).words[i7] = (this || _global$6$1).words[i7 + s7]; + } + } else { + (this || _global$6$1).words[0] = 0; + (this || _global$6$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$6$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$6$1).words[i7] | 0; + (this || _global$6$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$6$1).length === 0) { + (this || _global$6$1).words[0] = 0; + (this || _global$6$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$6$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$6$1).length <= s7) + return false; + var w6 = (this || _global$6$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$6$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$6$1).length <= s7) { + return this || _global$6$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$6$1).length = Math.min(s7, (this || _global$6$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$6$1).words[(this || _global$6$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$6$1).negative !== 0) { + if ((this || _global$6$1).length === 1 && ((this || _global$6$1).words[0] | 0) < num) { + (this || _global$6$1).words[0] = num - ((this || _global$6$1).words[0] | 0); + (this || _global$6$1).negative = 0; + return this || _global$6$1; + } + (this || _global$6$1).negative = 0; + this.isubn(num); + (this || _global$6$1).negative = 1; + return this || _global$6$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$6$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$6$1).length && (this || _global$6$1).words[i7] >= 67108864; i7++) { + (this || _global$6$1).words[i7] -= 67108864; + if (i7 === (this || _global$6$1).length - 1) { + (this || _global$6$1).words[i7 + 1] = 1; + } else { + (this || _global$6$1).words[i7 + 1]++; + } + } + (this || _global$6$1).length = Math.max((this || _global$6$1).length, i7 + 1); + return this || _global$6$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$6$1).negative !== 0) { + (this || _global$6$1).negative = 0; + this.iaddn(num); + (this || _global$6$1).negative = 1; + return this || _global$6$1; + } + (this || _global$6$1).words[0] -= num; + if ((this || _global$6$1).length === 1 && (this || _global$6$1).words[0] < 0) { + (this || _global$6$1).words[0] = -(this || _global$6$1).words[0]; + (this || _global$6$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$6$1).length && (this || _global$6$1).words[i7] < 0; i7++) { + (this || _global$6$1).words[i7] += 67108864; + (this || _global$6$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$6$1).negative = 0; + return this || _global$6$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$6$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$6$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$6$1).length - shift; i7++) { + w6 = ((this || _global$6$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$6$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$6$1).length; i7++) { + w6 = -((this || _global$6$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$6$1).words[i7] = w6 & 67108863; + } + (this || _global$6$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$6$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$6$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$6$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$6$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$6$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$6$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$6$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$6$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$6$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$6$1).words[i7] | 0) + carry * 67108864; + (this || _global$6$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$6$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$6$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$6$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$6$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$6$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$6$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$6$1).words[s7] |= q5; + return this || _global$6$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$6$1).length; i7++) { + var w6 = (this || _global$6$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$6$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$6$1).words[i7] = carry; + (this || _global$6$1).length++; + } + return this || _global$6$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$6$1).length === 1 && (this || _global$6$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$6$1).negative !== 0 && !negative) + return -1; + if ((this || _global$6$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$6$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$6$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$6$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$6$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$6$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$6$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$6$1).length > num.length) + return 1; + if ((this || _global$6$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$6$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$6$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$6$1).red, "Already a number in reduction context"); + assert4((this || _global$6$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$6$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$6$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$6$1).red.convertFrom(this || _global$6$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$6$1).red = ctx; + return this || _global$6$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$6$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$6$1).red, "redAdd works only with red numbers"); + return (this || _global$6$1).red.add(this || _global$6$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$6$1).red, "redIAdd works only with red numbers"); + return (this || _global$6$1).red.iadd(this || _global$6$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$6$1).red, "redSub works only with red numbers"); + return (this || _global$6$1).red.sub(this || _global$6$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$6$1).red, "redISub works only with red numbers"); + return (this || _global$6$1).red.isub(this || _global$6$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$6$1).red, "redShl works only with red numbers"); + return (this || _global$6$1).red.shl(this || _global$6$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$6$1).red, "redMul works only with red numbers"); + (this || _global$6$1).red._verify2(this || _global$6$1, num); + return (this || _global$6$1).red.mul(this || _global$6$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$6$1).red, "redMul works only with red numbers"); + (this || _global$6$1).red._verify2(this || _global$6$1, num); + return (this || _global$6$1).red.imul(this || _global$6$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$6$1).red, "redSqr works only with red numbers"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.sqr(this || _global$6$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$6$1).red, "redISqr works only with red numbers"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.isqr(this || _global$6$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$6$1).red, "redSqrt works only with red numbers"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.sqrt(this || _global$6$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$6$1).red, "redInvm works only with red numbers"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.invm(this || _global$6$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$6$1).red, "redNeg works only with red numbers"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.neg(this || _global$6$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$6$1).red && !num.red, "redPow(normalNum)"); + (this || _global$6$1).red._verify1(this || _global$6$1); + return (this || _global$6$1).red.pow(this || _global$6$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$6$1).name = name2; + (this || _global$6$1).p = new BN(p7, 16); + (this || _global$6$1).n = (this || _global$6$1).p.bitLength(); + (this || _global$6$1).k = new BN(1).iushln((this || _global$6$1).n).isub((this || _global$6$1).p); + (this || _global$6$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$6$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$6$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$6$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$6$1).n); + var cmp = rlen < (this || _global$6$1).n ? -1 : r8.ucmp((this || _global$6$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$6$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$6$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$6$1).k); + }; + function K256() { + MPrime.call(this || _global$6$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$6$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$6$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$6$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$6$1).m = prime.p; + (this || _global$6$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$6$1).m = m7; + (this || _global$6$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$6$1).prime) + return (this || _global$6$1).prime.ireduce(a7)._forceRed(this || _global$6$1); + return a7.umod((this || _global$6$1).m)._forceRed(this || _global$6$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$6$1).m.sub(a7)._forceRed(this || _global$6$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$6$1).m) >= 0) { + res.isub((this || _global$6$1).m); + } + return res._forceRed(this || _global$6$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$6$1).m) >= 0) { + res.isub((this || _global$6$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$6$1).m); + } + return res._forceRed(this || _global$6$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$6$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$6$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$6$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$6$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$6$1); + var nOne = one.redNeg(); + var lpow = (this || _global$6$1).m.subn(1).iushrn(1); + var z6 = (this || _global$6$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$6$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$6$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$6$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$6$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$6$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$6$1, m7); + (this || _global$6$1).shift = (this || _global$6$1).m.bitLength(); + if ((this || _global$6$1).shift % 26 !== 0) { + (this || _global$6$1).shift += 26 - (this || _global$6$1).shift % 26; + } + (this || _global$6$1).r = new BN(1).iushln((this || _global$6$1).shift); + (this || _global$6$1).r2 = this.imod((this || _global$6$1).r.sqr()); + (this || _global$6$1).rinv = (this || _global$6$1).r._invmp((this || _global$6$1).m); + (this || _global$6$1).minv = (this || _global$6$1).rinv.mul((this || _global$6$1).r).isubn(1).div((this || _global$6$1).m); + (this || _global$6$1).minv = (this || _global$6$1).minv.umod((this || _global$6$1).r); + (this || _global$6$1).minv = (this || _global$6$1).r.sub((this || _global$6$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$6$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$6$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$6$1).shift).mul((this || _global$6$1).minv).imaskn((this || _global$6$1).shift).mul((this || _global$6$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$6$1).shift); + var res = u7; + if (u7.cmp((this || _global$6$1).m) >= 0) { + res = u7.isub((this || _global$6$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$6$1).m); + } + return res._forceRed(this || _global$6$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$6$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$6$1).shift).mul((this || _global$6$1).minv).imaskn((this || _global$6$1).shift).mul((this || _global$6$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$6$1).shift); + var res = u7; + if (u7.cmp((this || _global$6$1).m) >= 0) { + res = u7.isub((this || _global$6$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$6$1).m); + } + return res._forceRed(this || _global$6$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$6$1).m).mul((this || _global$6$1).r2)); + return res._forceRed(this || _global$6$1); + }; + })(module$3$1, exports$V$1); + return module$3$1.exports; +} +function dew$U$1() { + if (_dewExec$U$1) + return exports$U$1; + _dewExec$U$1 = true; + var utils = exports$U$1; + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg !== "string") { + for (var i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + return res; + } + if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (var i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } else { + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + var hi = c7 >> 8; + var lo = c7 & 255; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } + return res; + } + utils.toArray = toArray3; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + utils.zero2 = zero2; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + utils.toHex = toHex; + utils.encode = function encode2(arr, enc) { + if (enc === "hex") + return toHex(arr); + else + return arr; + }; + return exports$U$1; +} +function dew$T$1() { + if (_dewExec$T$1) + return exports$T$1; + _dewExec$T$1 = true; + var utils = exports$T$1; + var BN = dew$V$1(); + var minAssert = dew$1t(); + var minUtils = dew$U$1(); + utils.assert = minAssert; + utils.toArray = minUtils.toArray; + utils.zero2 = minUtils.zero2; + utils.toHex = minUtils.toHex; + utils.encode = minUtils.encode; + function getNAF(num, w6, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + naf.fill(0); + var ws = 1 << w6 + 1; + var k6 = num.clone(); + for (var i7 = 0; i7 < naf.length; i7++) { + var z6; + var mod2 = k6.andln(ws - 1); + if (k6.isOdd()) { + if (mod2 > (ws >> 1) - 1) + z6 = (ws >> 1) - mod2; + else + z6 = mod2; + k6.isubn(z6); + } else { + z6 = 0; + } + naf[i7] = z6; + k6.iushrn(1); + } + return naf; + } + utils.getNAF = getNAF; + function getJSF(k1, k22) { + var jsf = [[], []]; + k1 = k1.clone(); + k22 = k22.clone(); + var d1 = 0; + var d22 = 0; + var m8; + while (k1.cmpn(-d1) > 0 || k22.cmpn(-d22) > 0) { + var m14 = k1.andln(3) + d1 & 3; + var m24 = k22.andln(3) + d22 & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + m8 = k1.andln(7) + d1 & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + var u22; + if ((m24 & 1) === 0) { + u22 = 0; + } else { + m8 = k22.andln(7) + d22 & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u22 = -m24; + else + u22 = m24; + } + jsf[1].push(u22); + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d22 === u22 + 1) + d22 = 1 - d22; + k1.iushrn(1); + k22.iushrn(1); + } + return jsf; + } + utils.getJSF = getJSF; + function cachedProperty(obj, name2, computer) { + var key = "_" + name2; + obj.prototype[name2] = function cachedProperty2() { + return this[key] !== void 0 ? this[key] : this[key] = computer.call(this); + }; + } + utils.cachedProperty = cachedProperty; + function parseBytes(bytes) { + return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes; + } + utils.parseBytes = parseBytes; + function intFromLE(bytes) { + return new BN(bytes, "hex", "le"); + } + utils.intFromLE = intFromLE; + return exports$T$1; +} +function dew$S$1() { + if (_dewExec$S$1) + return exports$S$1; + _dewExec$S$1 = true; + var BN = dew$V$1(); + var utils = dew$T$1(); + var getNAF = utils.getNAF; + var getJSF = utils.getJSF; + var assert4 = utils.assert; + function BaseCurve(type3, conf) { + this.type = type3; + this.p = new BN(conf.p, 16); + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + this._bitLength = this.n ? this.n.bitLength() : 0; + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } + } + exports$S$1 = BaseCurve; + BaseCurve.prototype.point = function point() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype.validate = function validate15() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p7, k6) { + assert4(p7.precomputed); + var doubles = p7._getDoubles(); + var naf = getNAF(k6, 1, this._bitLength); + var I6 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); + I6 /= 3; + var repr = []; + var j6; + var nafW; + for (j6 = 0; j6 < naf.length; j6 += doubles.step) { + nafW = 0; + for (var l7 = j6 + doubles.step - 1; l7 >= j6; l7--) + nafW = (nafW << 1) + naf[l7]; + repr.push(nafW); + } + var a7 = this.jpoint(null, null, null); + var b8 = this.jpoint(null, null, null); + for (var i7 = I6; i7 > 0; i7--) { + for (j6 = 0; j6 < repr.length; j6++) { + nafW = repr[j6]; + if (nafW === i7) + b8 = b8.mixedAdd(doubles.points[j6]); + else if (nafW === -i7) + b8 = b8.mixedAdd(doubles.points[j6].neg()); + } + a7 = a7.add(b8); + } + return a7.toP(); + }; + BaseCurve.prototype._wnafMul = function _wnafMul(p7, k6) { + var w6 = 4; + var nafPoints = p7._getNAFPoints(w6); + w6 = nafPoints.wnd; + var wnd = nafPoints.points; + var naf = getNAF(k6, w6, this._bitLength); + var acc = this.jpoint(null, null, null); + for (var i7 = naf.length - 1; i7 >= 0; i7--) { + for (var l7 = 0; i7 >= 0 && naf[i7] === 0; i7--) + l7++; + if (i7 >= 0) + l7++; + acc = acc.dblp(l7); + if (i7 < 0) + break; + var z6 = naf[i7]; + assert4(z6 !== 0); + if (p7.type === "affine") { + if (z6 > 0) + acc = acc.mixedAdd(wnd[z6 - 1 >> 1]); + else + acc = acc.mixedAdd(wnd[-z6 - 1 >> 1].neg()); + } else { + if (z6 > 0) + acc = acc.add(wnd[z6 - 1 >> 1]); + else + acc = acc.add(wnd[-z6 - 1 >> 1].neg()); + } + } + return p7.type === "affine" ? acc.toP() : acc; + }; + BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + var max2 = 0; + var i7; + var j6; + var p7; + for (i7 = 0; i7 < len; i7++) { + p7 = points[i7]; + var nafPoints = p7._getNAFPoints(defW); + wndWidth[i7] = nafPoints.wnd; + wnd[i7] = nafPoints.points; + } + for (i7 = len - 1; i7 >= 1; i7 -= 2) { + var a7 = i7 - 1; + var b8 = i7; + if (wndWidth[a7] !== 1 || wndWidth[b8] !== 1) { + naf[a7] = getNAF(coeffs[a7], wndWidth[a7], this._bitLength); + naf[b8] = getNAF(coeffs[b8], wndWidth[b8], this._bitLength); + max2 = Math.max(naf[a7].length, max2); + max2 = Math.max(naf[b8].length, max2); + continue; + } + var comb = [ + points[a7], + /* 1 */ + null, + /* 3 */ + null, + /* 5 */ + points[b8] + /* 7 */ + ]; + if (points[a7].y.cmp(points[b8].y) === 0) { + comb[1] = points[a7].add(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } else if (points[a7].y.cmp(points[b8].y.redNeg()) === 0) { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].add(points[b8].neg()); + } else { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } + var index4 = [ + -3, + /* -1 -1 */ + -1, + /* -1 0 */ + -5, + /* -1 1 */ + -7, + /* 0 -1 */ + 0, + /* 0 0 */ + 7, + /* 0 1 */ + 5, + /* 1 -1 */ + 1, + /* 1 0 */ + 3 + /* 1 1 */ + ]; + var jsf = getJSF(coeffs[a7], coeffs[b8]); + max2 = Math.max(jsf[0].length, max2); + naf[a7] = new Array(max2); + naf[b8] = new Array(max2); + for (j6 = 0; j6 < max2; j6++) { + var ja = jsf[0][j6] | 0; + var jb = jsf[1][j6] | 0; + naf[a7][j6] = index4[(ja + 1) * 3 + (jb + 1)]; + naf[b8][j6] = 0; + wnd[a7] = comb; + } + } + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (i7 = max2; i7 >= 0; i7--) { + var k6 = 0; + while (i7 >= 0) { + var zero = true; + for (j6 = 0; j6 < len; j6++) { + tmp[j6] = naf[j6][i7] | 0; + if (tmp[j6] !== 0) + zero = false; + } + if (!zero) + break; + k6++; + i7--; + } + if (i7 >= 0) + k6++; + acc = acc.dblp(k6); + if (i7 < 0) + break; + for (j6 = 0; j6 < len; j6++) { + var z6 = tmp[j6]; + if (z6 === 0) + continue; + else if (z6 > 0) + p7 = wnd[j6][z6 - 1 >> 1]; + else if (z6 < 0) + p7 = wnd[j6][-z6 - 1 >> 1].neg(); + if (p7.type === "affine") + acc = acc.mixedAdd(p7); + else + acc = acc.add(p7); + } + } + for (i7 = 0; i7 < len; i7++) + wnd[i7] = null; + if (jacobianResult) + return acc; + else + return acc.toP(); + }; + function BasePoint(curve, type3) { + this.curve = curve; + this.type = type3; + this.precomputed = null; + } + BaseCurve.BasePoint = BasePoint; + BasePoint.prototype.eq = function eq2() { + throw new Error("Not implemented"); + }; + BasePoint.prototype.validate = function validate15() { + return this.curve.validate(this); + }; + BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + var len = this.p.byteLength(); + if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) { + if (bytes[0] === 6) + assert4(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 7) + assert4(bytes[bytes.length - 1] % 2 === 1); + var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len)); + return res; + } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); + } + throw new Error("Unknown point format"); + }; + BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); + }; + BasePoint.prototype._encode = function _encode(compact2) { + var len = this.curve.p.byteLength(); + var x7 = this.getX().toArray("be", len); + if (compact2) + return [this.getY().isEven() ? 2 : 3].concat(x7); + return [4].concat(x7, this.getY().toArray("be", len)); + }; + BasePoint.prototype.encode = function encode2(enc, compact2) { + return utils.encode(this._encode(compact2), enc); + }; + BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + return this; + }; + BasePoint.prototype._hasDoubles = function _hasDoubles(k6) { + if (!this.precomputed) + return false; + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + return doubles.points.length >= Math.ceil((k6.bitLength() + 1) / doubles.step); + }; + BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + var doubles = [this]; + var acc = this; + for (var i7 = 0; i7 < power; i7 += step) { + for (var j6 = 0; j6 < step; j6++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step, + points: doubles + }; + }; + BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + var res = [this]; + var max2 = (1 << wnd) - 1; + var dbl = max2 === 1 ? null : this.dbl(); + for (var i7 = 1; i7 < max2; i7++) + res[i7] = res[i7 - 1].add(dbl); + return { + wnd, + points: res + }; + }; + BasePoint.prototype._getBeta = function _getBeta() { + return null; + }; + BasePoint.prototype.dblp = function dblp(k6) { + var r8 = this; + for (var i7 = 0; i7 < k6; i7++) + r8 = r8.dbl(); + return r8; + }; + return exports$S$1; +} +function dew$R$1() { + if (_dewExec$R$1) + return exports$R$1; + _dewExec$R$1 = true; + var utils = dew$T$1(); + var BN = dew$V$1(); + var inherits2 = dew$f$2(); + var Base2 = dew$S$1(); + var assert4 = utils.assert; + function ShortCurve(conf) { + Base2.call(this, "short", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); + } + inherits2(ShortCurve, Base2); + exports$R$1 = ShortCurve; + ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert4(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + return { + beta, + lambda, + basis + }; + }; + ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + var s7 = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + var l1 = ntinv.redAdd(s7).fromRed(); + var l22 = ntinv.redSub(s7).fromRed(); + return [l1, l22]; + }; + ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + var u7 = lambda; + var v8 = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x22 = new BN(0); + var y22 = new BN(1); + var a0; + var b0; + var a1; + var b1; + var a22; + var b22; + var prevR; + var i7 = 0; + var r8; + var x7; + while (u7.cmpn(0) !== 0) { + var q5 = v8.div(u7); + r8 = v8.sub(q5.mul(u7)); + x7 = x22.sub(q5.mul(x1)); + var y7 = y22.sub(q5.mul(y1)); + if (!a1 && r8.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r8.neg(); + b1 = x7; + } else if (a1 && ++i7 === 2) { + break; + } + prevR = r8; + v8 = u7; + u7 = r8; + x22 = x1; + x1 = x7; + y22 = y1; + y1 = y7; + } + a22 = r8.neg(); + b22 = x7; + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a22.sqr().add(b22.sqr()); + if (len2.cmp(len1) >= 0) { + a22 = a0; + b22 = b0; + } + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a22.negative) { + a22 = a22.neg(); + b22 = b22.neg(); + } + return [{ + a: a1, + b: b1 + }, { + a: a22, + b: b22 + }]; + }; + ShortCurve.prototype._endoSplit = function _endoSplit(k6) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v22 = basis[1]; + var c1 = v22.b.mul(k6).divRound(this.n); + var c22 = v1.b.neg().mul(k6).divRound(this.n); + var p1 = c1.mul(v1.a); + var p22 = c22.mul(v22.a); + var q1 = c1.mul(v1.b); + var q22 = c22.mul(v22.b); + var k1 = k6.sub(p1).sub(p22); + var k22 = q1.add(q22).neg(); + return { + k1, + k2: k22 + }; + }; + ShortCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var y22 = x7.redSqr().redMul(x7).redIAdd(x7.redMul(this.a)).redIAdd(this.b); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + ShortCurve.prototype.validate = function validate15(point) { + if (point.inf) + return true; + var x7 = point.x; + var y7 = point.y; + var ax = this.a.redMul(x7); + var rhs = x7.redSqr().redMul(x7).redIAdd(ax).redIAdd(this.b); + return y7.redSqr().redISub(rhs).cmpn(0) === 0; + }; + ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i7 = 0; i7 < points.length; i7++) { + var split3 = this._endoSplit(coeffs[i7]); + var p7 = points[i7]; + var beta = p7._getBeta(); + if (split3.k1.negative) { + split3.k1.ineg(); + p7 = p7.neg(true); + } + if (split3.k2.negative) { + split3.k2.ineg(); + beta = beta.neg(true); + } + npoints[i7 * 2] = p7; + npoints[i7 * 2 + 1] = beta; + ncoeffs[i7 * 2] = split3.k1; + ncoeffs[i7 * 2 + 1] = split3.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i7 * 2, jacobianResult); + for (var j6 = 0; j6 < i7 * 2; j6++) { + npoints[j6] = null; + ncoeffs[j6] = null; + } + return res; + }; + function Point(curve, x7, y7, isRed) { + Base2.BasePoint.call(this, curve, "affine"); + if (x7 === null && y7 === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } + } + inherits2(Point, Base2.BasePoint); + ShortCurve.prototype.point = function point(x7, y7, isRed) { + return new Point(this, x7, y7, isRed); + }; + ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); + }; + Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p7) { + return curve.point(p7.x.redMul(curve.endo.beta), p7.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; + }; + Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [this.x, this.y]; + return [this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + }]; + }; + Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === "string") + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + function obj2point(obj2) { + return curve.point(obj2[0], obj2[1], red); + } + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [res].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [res].concat(pre.naf.points.map(obj2point)) + } + }; + return res; + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.inf; + }; + Point.prototype.add = function add2(p7) { + if (this.inf) + return p7; + if (p7.inf) + return this; + if (this.eq(p7)) + return this.dbl(); + if (this.neg().eq(p7)) + return this.curve.point(null, null); + if (this.x.cmp(p7.x) === 0) + return this.curve.point(null, null); + var c7 = this.y.redSub(p7.y); + if (c7.cmpn(0) !== 0) + c7 = c7.redMul(this.x.redSub(p7.x).redInvm()); + var nx = c7.redSqr().redISub(this.x).redISub(p7.x); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + var a7 = this.curve.a; + var x22 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c7 = x22.redAdd(x22).redIAdd(x22).redIAdd(a7).redMul(dyinv); + var nx = c7.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.getX = function getX() { + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + return this.y.fromRed(); + }; + Point.prototype.mul = function mul(k6) { + k6 = new BN(k6, 16); + if (this.isInfinity()) + return this; + else if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([this], [k6]); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); + }; + Point.prototype.eq = function eq2(p7) { + return this === p7 || this.inf === p7.inf && (this.inf || this.x.cmp(p7.x) === 0 && this.y.cmp(p7.y) === 0); + }; + Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate2 = function(p7) { + return p7.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate2) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate2) + } + }; + } + return res; + }; + Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; + }; + function JPoint(curve, x7, y7, z6) { + Base2.BasePoint.call(this, curve, "jacobian"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = new BN(z6, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + } + inherits2(JPoint, Base2.BasePoint); + ShortCurve.prototype.jpoint = function jpoint(x7, y7, z6) { + return new JPoint(this, x7, y7, z6); + }; + JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + return this.curve.point(ax, ay); + }; + JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }; + JPoint.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + var pz2 = p7.z.redSqr(); + var z22 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u22 = p7.x.redMul(z22); + var s1 = this.y.redMul(pz2.redMul(p7.z)); + var s22 = p7.y.redMul(z22.redMul(this.z)); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(p7.z).redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mixedAdd = function mixedAdd(p7) { + if (this.isInfinity()) + return p7.toJ(); + if (p7.isInfinity()) + return this; + var z22 = this.z.redSqr(); + var u1 = this.x; + var u22 = p7.x.redMul(z22); + var s1 = this.y; + var s22 = p7.y.redMul(z22).redMul(this.z); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + var i7; + if (this.curve.zeroA || this.curve.threeA) { + var r8 = this; + for (i7 = 0; i7 < pow; i7++) + r8 = r8.dbl(); + return r8; + } + var a7 = this.curve.a; + var tinv = this.curve.tinv; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jyd = jy.redAdd(jy); + for (i7 = 0; i7 < pow; i7++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var t1 = jx.redMul(jyd2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var dny = c7.redMul(t22); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i7 + 1 < pow) + jz4 = jz4.redMul(jyd4); + jx = nx; + jz = nz; + jyd = dny; + } + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); + }; + JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); + }; + JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + nx = t8; + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = b8.redSqr(); + var d7 = this.x.redAdd(b8).redSqr().redISub(a7).redISub(c7); + d7 = d7.redIAdd(d7); + var e10 = a7.redAdd(a7).redIAdd(a7); + var f8 = e10.redSqr(); + var c8 = c7.redIAdd(c7); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + nx = f8.redISub(d7).redISub(d7); + ny = e10.redMul(d7.redISub(nx)).redISub(c8); + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + nx = t8; + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var delta = this.z.redSqr(); + var gamma = this.y.redSqr(); + var beta = this.x.redMul(gamma); + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._dbl = function _dbl() { + var a7 = this.curve.a; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c7.redMul(t22).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var zz = this.z.redSqr(); + var yyyy = yy.redSqr(); + var m7 = xx.redAdd(xx).redIAdd(xx); + var mm = m7.redSqr(); + var e10 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e10 = e10.redIAdd(e10); + e10 = e10.redAdd(e10).redIAdd(e10); + e10 = e10.redISub(mm); + var ee4 = e10.redSqr(); + var t8 = yyyy.redIAdd(yyyy); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + var u7 = m7.redIAdd(e10).redSqr().redISub(mm).redISub(ee4).redISub(t8); + var yyu4 = yy.redMul(u7); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee4).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + var ny = this.y.redMul(u7.redMul(t8.redISub(u7)).redISub(e10.redMul(ee4))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + var nz = this.z.redAdd(e10).redSqr().redISub(zz).redISub(ee4); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mul = function mul(k6, kbase) { + k6 = new BN(k6, kbase); + return this.curve._wnafMul(this, k6); + }; + JPoint.prototype.eq = function eq2(p7) { + if (p7.type === "affine") + return this.eq(p7.toJ()); + if (this === p7) + return true; + var z22 = this.z.redSqr(); + var pz2 = p7.z.redSqr(); + if (this.x.redMul(pz2).redISub(p7.x.redMul(z22)).cmpn(0) !== 0) + return false; + var z32 = z22.redMul(this.z); + var pz3 = pz2.redMul(p7.z); + return this.y.redMul(pz3).redISub(p7.y.redMul(z32)).cmpn(0) === 0; + }; + JPoint.prototype.eqXToP = function eqXToP(x7) { + var zs = this.z.redSqr(); + var rx = x7.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(zs); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + JPoint.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + JPoint.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + return exports$R$1; +} +function dew$Q$1() { + if (_dewExec$Q$1) + return exports$Q$1; + _dewExec$Q$1 = true; + var BN = dew$V$1(); + var inherits2 = dew$f$2(); + var Base2 = dew$S$1(); + var utils = dew$T$1(); + function MontCurve(conf) { + Base2.call(this, "mont", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); + } + inherits2(MontCurve, Base2); + exports$Q$1 = MontCurve; + MontCurve.prototype.validate = function validate15(point) { + var x7 = point.normalize().x; + var x22 = x7.redSqr(); + var rhs = x22.redMul(x7).redAdd(x22.redMul(this.a)).redAdd(x7); + var y7 = rhs.redSqrt(); + return y7.redSqr().cmp(rhs) === 0; + }; + function Point(curve, x7, z6) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && z6 === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x7, 16); + this.z = new BN(z6, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } + } + inherits2(Point, Base2.BasePoint); + MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); + }; + MontCurve.prototype.point = function point(x7, z6) { + return new Point(this, x7, z6); + }; + MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + Point.prototype.precompute = function precompute() { + }; + Point.prototype._encode = function _encode() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + Point.prototype.dbl = function dbl() { + var a7 = this.x.redAdd(this.z); + var aa = a7.redSqr(); + var b8 = this.x.redSub(this.z); + var bb = b8.redSqr(); + var c7 = aa.redSub(bb); + var nx = aa.redMul(bb); + var nz = c7.redMul(bb.redAdd(this.curve.a24.redMul(c7))); + return this.curve.point(nx, nz); + }; + Point.prototype.add = function add2() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.diffAdd = function diffAdd(p7, diff) { + var a7 = this.x.redAdd(this.z); + var b8 = this.x.redSub(this.z); + var c7 = p7.x.redAdd(p7.z); + var d7 = p7.x.redSub(p7.z); + var da = d7.redMul(a7); + var cb = c7.redMul(b8); + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); + }; + Point.prototype.mul = function mul(k6) { + var t8 = k6.clone(); + var a7 = this; + var b8 = this.curve.point(null, null); + var c7 = this; + for (var bits = []; t8.cmpn(0) !== 0; t8.iushrn(1)) + bits.push(t8.andln(1)); + for (var i7 = bits.length - 1; i7 >= 0; i7--) { + if (bits[i7] === 0) { + a7 = a7.diffAdd(b8, c7); + b8 = b8.dbl(); + } else { + b8 = a7.diffAdd(b8, c7); + a7 = a7.dbl(); + } + } + return b8; + }; + Point.prototype.mulAdd = function mulAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.jumlAdd = function jumlAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.eq = function eq2(other) { + return this.getX().cmp(other.getX()) === 0; + }; + Point.prototype.normalize = function normalize2() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + return exports$Q$1; +} +function dew$P$1() { + if (_dewExec$P$1) + return exports$P$1; + _dewExec$P$1 = true; + var utils = dew$T$1(); + var BN = dew$V$1(); + var inherits2 = dew$f$2(); + var Base2 = dew$S$1(); + var assert4 = utils.assert; + function EdwardsCurve(conf) { + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + Base2.call(this, "edwards", conf); + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + assert4(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; + } + inherits2(EdwardsCurve, Base2); + exports$P$1 = EdwardsCurve; + EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); + }; + EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); + }; + EdwardsCurve.prototype.jpoint = function jpoint(x7, y7, z6, t8) { + return this.point(x7, y7, z6, t8); + }; + EdwardsCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var x22 = x7.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x22)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x22)); + var y22 = rhs.redMul(lhs.redInvm()); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.pointFromY = function pointFromY(y7, odd) { + y7 = new BN(y7, 16); + if (!y7.red) + y7 = y7.toRed(this.red); + var y22 = y7.redSqr(); + var lhs = y22.redSub(this.c2); + var rhs = y22.redMul(this.d).redMul(this.c2).redSub(this.a); + var x22 = lhs.redMul(rhs.redInvm()); + if (x22.cmp(this.zero) === 0) { + if (odd) + throw new Error("invalid point"); + else + return this.point(this.zero, y7); + } + var x7 = x22.redSqrt(); + if (x7.redSqr().redSub(x22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + if (x7.fromRed().isOdd() !== odd) + x7 = x7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.validate = function validate15(point) { + if (point.isInfinity()) + return true; + point.normalize(); + var x22 = point.x.redSqr(); + var y22 = point.y.redSqr(); + var lhs = x22.redMul(this.a).redAdd(y22); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x22).redMul(y22))); + return lhs.cmp(rhs) === 0; + }; + function Point(curve, x7, y7, z6, t8) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = z6 ? new BN(z6, 16) : this.curve.one; + this.t = t8 && new BN(t8, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } + } + inherits2(Point, Base2.BasePoint); + EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + EdwardsCurve.prototype.point = function point(x7, y7, z6, t8) { + return new Point(this, x7, y7, z6, t8); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0); + }; + Point.prototype._extDbl = function _extDbl() { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = this.z.redSqr(); + c7 = c7.redIAdd(c7); + var d7 = this.curve._mulA(a7); + var e10 = this.x.redAdd(this.y).redSqr().redISub(a7).redISub(b8); + var g7 = d7.redAdd(b8); + var f8 = g7.redSub(c7); + var h8 = d7.redSub(b8); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projDbl = function _projDbl() { + var b8 = this.x.redAdd(this.y).redSqr(); + var c7 = this.x.redSqr(); + var d7 = this.y.redSqr(); + var nx; + var ny; + var nz; + var e10; + var h8; + var j6; + if (this.curve.twisted) { + e10 = this.curve._mulA(c7); + var f8 = e10.redAdd(d7); + if (this.zOne) { + nx = b8.redSub(c7).redSub(d7).redMul(f8.redSub(this.curve.two)); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redSqr().redSub(f8).redSub(f8); + } else { + h8 = this.z.redSqr(); + j6 = f8.redSub(h8).redISub(h8); + nx = b8.redSub(c7).redISub(d7).redMul(j6); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redMul(j6); + } + } else { + e10 = c7.redAdd(d7); + h8 = this.curve._mulC(this.z).redSqr(); + j6 = e10.redSub(h8).redSub(h8); + nx = this.curve._mulC(b8.redISub(e10)).redMul(j6); + ny = this.curve._mulC(e10).redMul(c7.redISub(d7)); + nz = e10.redMul(j6); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); + }; + Point.prototype._extAdd = function _extAdd(p7) { + var a7 = this.y.redSub(this.x).redMul(p7.y.redSub(p7.x)); + var b8 = this.y.redAdd(this.x).redMul(p7.y.redAdd(p7.x)); + var c7 = this.t.redMul(this.curve.dd).redMul(p7.t); + var d7 = this.z.redMul(p7.z.redAdd(p7.z)); + var e10 = b8.redSub(a7); + var f8 = d7.redSub(c7); + var g7 = d7.redAdd(c7); + var h8 = b8.redAdd(a7); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projAdd = function _projAdd(p7) { + var a7 = this.z.redMul(p7.z); + var b8 = a7.redSqr(); + var c7 = this.x.redMul(p7.x); + var d7 = this.y.redMul(p7.y); + var e10 = this.curve.d.redMul(c7).redMul(d7); + var f8 = b8.redSub(e10); + var g7 = b8.redAdd(e10); + var tmp = this.x.redAdd(this.y).redMul(p7.x.redAdd(p7.y)).redISub(c7).redISub(d7); + var nx = a7.redMul(f8).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + ny = a7.redMul(g7).redMul(d7.redSub(this.curve._mulA(c7))); + nz = f8.redMul(g7); + } else { + ny = a7.redMul(g7).redMul(d7.redSub(c7)); + nz = this.curve._mulC(f8).redMul(g7); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + if (this.curve.extended) + return this._extAdd(p7); + else + return this._projAdd(p7); + }; + Point.prototype.mul = function mul(k6) { + if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, false); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, true); + }; + Point.prototype.normalize = function normalize2() { + if (this.zOne) + return this; + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; + }; + Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); + }; + Point.prototype.eq = function eq2(other) { + return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0; + }; + Point.prototype.eqXToP = function eqXToP(x7) { + var rx = x7.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(this.z); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + Point.prototype.toP = Point.prototype.normalize; + Point.prototype.mixedAdd = Point.prototype.add; + return exports$P$1; +} +function dew$O$1() { + if (_dewExec$O$1) + return exports$O$1; + _dewExec$O$1 = true; + var curve = exports$O$1; + curve.base = dew$S$1(); + curve.short = dew$R$1(); + curve.mont = dew$Q$1(); + curve.edwards = dew$P$1(); + return exports$O$1; +} +function dew$N$1() { + if (_dewExec$N$1) + return exports$N$1; + _dewExec$N$1 = true; + var assert4 = dew$1t(); + var inherits2 = dew$f$2(); + exports$N$1.inherits = inherits2; + function isSurrogatePair(msg, i7) { + if ((msg.charCodeAt(i7) & 64512) !== 55296) { + return false; + } + if (i7 < 0 || i7 + 1 >= msg.length) { + return false; + } + return (msg.charCodeAt(i7 + 1) & 64512) === 56320; + } + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === "string") { + if (!enc) { + var p7 = 0; + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + if (c7 < 128) { + res[p7++] = c7; + } else if (c7 < 2048) { + res[p7++] = c7 >> 6 | 192; + res[p7++] = c7 & 63 | 128; + } else if (isSurrogatePair(msg, i7)) { + c7 = 65536 + ((c7 & 1023) << 10) + (msg.charCodeAt(++i7) & 1023); + res[p7++] = c7 >> 18 | 240; + res[p7++] = c7 >> 12 & 63 | 128; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } else { + res[p7++] = c7 >> 12 | 224; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } + } + } else if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } + } else { + for (i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + } + return res; + } + exports$N$1.toArray = toArray3; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + exports$N$1.toHex = toHex; + function htonl(w6) { + var res = w6 >>> 24 | w6 >>> 8 & 65280 | w6 << 8 & 16711680 | (w6 & 255) << 24; + return res >>> 0; + } + exports$N$1.htonl = htonl; + function toHex32(msg, endian) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) { + var w6 = msg[i7]; + if (endian === "little") + w6 = htonl(w6); + res += zero8(w6.toString(16)); + } + return res; + } + exports$N$1.toHex32 = toHex32; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + exports$N$1.zero2 = zero2; + function zero8(word) { + if (word.length === 7) + return "0" + word; + else if (word.length === 6) + return "00" + word; + else if (word.length === 5) + return "000" + word; + else if (word.length === 4) + return "0000" + word; + else if (word.length === 3) + return "00000" + word; + else if (word.length === 2) + return "000000" + word; + else if (word.length === 1) + return "0000000" + word; + else + return word; + } + exports$N$1.zero8 = zero8; + function join32(msg, start, end, endian) { + var len = end - start; + assert4(len % 4 === 0); + var res = new Array(len / 4); + for (var i7 = 0, k6 = start; i7 < res.length; i7++, k6 += 4) { + var w6; + if (endian === "big") + w6 = msg[k6] << 24 | msg[k6 + 1] << 16 | msg[k6 + 2] << 8 | msg[k6 + 3]; + else + w6 = msg[k6 + 3] << 24 | msg[k6 + 2] << 16 | msg[k6 + 1] << 8 | msg[k6]; + res[i7] = w6 >>> 0; + } + return res; + } + exports$N$1.join32 = join32; + function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i7 = 0, k6 = 0; i7 < msg.length; i7++, k6 += 4) { + var m7 = msg[i7]; + if (endian === "big") { + res[k6] = m7 >>> 24; + res[k6 + 1] = m7 >>> 16 & 255; + res[k6 + 2] = m7 >>> 8 & 255; + res[k6 + 3] = m7 & 255; + } else { + res[k6 + 3] = m7 >>> 24; + res[k6 + 2] = m7 >>> 16 & 255; + res[k6 + 1] = m7 >>> 8 & 255; + res[k6] = m7 & 255; + } + } + return res; + } + exports$N$1.split32 = split32; + function rotr32(w6, b8) { + return w6 >>> b8 | w6 << 32 - b8; + } + exports$N$1.rotr32 = rotr32; + function rotl32(w6, b8) { + return w6 << b8 | w6 >>> 32 - b8; + } + exports$N$1.rotl32 = rotl32; + function sum32(a7, b8) { + return a7 + b8 >>> 0; + } + exports$N$1.sum32 = sum32; + function sum32_3(a7, b8, c7) { + return a7 + b8 + c7 >>> 0; + } + exports$N$1.sum32_3 = sum32_3; + function sum32_4(a7, b8, c7, d7) { + return a7 + b8 + c7 + d7 >>> 0; + } + exports$N$1.sum32_4 = sum32_4; + function sum32_5(a7, b8, c7, d7, e10) { + return a7 + b8 + c7 + d7 + e10 >>> 0; + } + exports$N$1.sum32_5 = sum32_5; + function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; + } + exports$N$1.sum64 = sum64; + function sum64_hi(ah, al, bh, bl) { + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; + } + exports$N$1.sum64_hi = sum64_hi; + function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; + } + exports$N$1.sum64_lo = sum64_lo; + function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; + } + exports$N$1.sum64_4_hi = sum64_4_hi; + function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; + } + exports$N$1.sum64_4_lo = sum64_4_lo; + function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + lo = lo + el >>> 0; + carry += lo < el ? 1 : 0; + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; + } + exports$N$1.sum64_5_hi = sum64_5_hi; + function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + return lo >>> 0; + } + exports$N$1.sum64_5_lo = sum64_5_lo; + function rotr64_hi(ah, al, num) { + var r8 = al << 32 - num | ah >>> num; + return r8 >>> 0; + } + exports$N$1.rotr64_hi = rotr64_hi; + function rotr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$N$1.rotr64_lo = rotr64_lo; + function shr64_hi(ah, al, num) { + return ah >>> num; + } + exports$N$1.shr64_hi = shr64_hi; + function shr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$N$1.shr64_lo = shr64_lo; + return exports$N$1; +} +function dew$M$1() { + if (_dewExec$M$1) + return exports$M$1; + _dewExec$M$1 = true; + var utils = dew$N$1(); + var assert4 = dew$1t(); + function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = "big"; + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; + } + exports$M$1.BlockHash = BlockHash; + BlockHash.prototype.update = function update2(msg, enc) { + msg = utils.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + if (this.pending.length >= this._delta8) { + msg = this.pending; + var r8 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r8, msg.length); + if (this.pending.length === 0) + this.pending = null; + msg = utils.join32(msg, 0, msg.length - r8, this.endian); + for (var i7 = 0; i7 < msg.length; i7 += this._delta32) + this._update(msg, i7, i7 + this._delta32); + } + return this; + }; + BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert4(this.pending === null); + return this._digest(enc); + }; + BlockHash.prototype._pad = function pad2() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k6 = bytes - (len + this.padLength) % bytes; + var res = new Array(k6 + this.padLength); + res[0] = 128; + for (var i7 = 1; i7 < k6; i7++) + res[i7] = 0; + len <<= 3; + if (this.endian === "big") { + for (var t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = len >>> 24 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len & 255; + } else { + res[i7++] = len & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 24 & 255; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + for (t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + } + return res; + }; + return exports$M$1; +} +function dew$L$1() { + if (_dewExec$L$1) + return exports$L$1; + _dewExec$L$1 = true; + return exports$L$1; +} +function dew$K$1() { + if (_dewExec$K$1) + return exports$K$1; + _dewExec$K$1 = true; + var utils = dew$N$1(); + var common3 = dew$M$1(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_3 = utils.sum32_3; + var sum32_4 = utils.sum32_4; + var BlockHash = common3.BlockHash; + function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.endian = "little"; + } + utils.inherits(RIPEMD160, BlockHash); + exports$K$1.ripemd160 = RIPEMD160; + RIPEMD160.blockSize = 512; + RIPEMD160.outSize = 160; + RIPEMD160.hmacStrength = 192; + RIPEMD160.padLength = 64; + RIPEMD160.prototype._update = function update2(msg, start) { + var A6 = this.h[0]; + var B6 = this.h[1]; + var C6 = this.h[2]; + var D6 = this.h[3]; + var E6 = this.h[4]; + var Ah = A6; + var Bh = B6; + var Ch = C6; + var Dh = D6; + var Eh = E6; + for (var j6 = 0; j6 < 80; j6++) { + var T6 = sum32(rotl32(sum32_4(A6, f8(j6, B6, C6, D6), msg[r8[j6] + start], K5(j6)), s7[j6]), E6); + A6 = E6; + E6 = D6; + D6 = rotl32(C6, 10); + C6 = B6; + B6 = T6; + T6 = sum32(rotl32(sum32_4(Ah, f8(79 - j6, Bh, Ch, Dh), msg[rh[j6] + start], Kh(j6)), sh[j6]), Eh); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch, 10); + Ch = Bh; + Bh = T6; + } + T6 = sum32_3(this.h[1], C6, Dh); + this.h[1] = sum32_3(this.h[2], D6, Eh); + this.h[2] = sum32_3(this.h[3], E6, Ah); + this.h[3] = sum32_3(this.h[4], A6, Bh); + this.h[4] = sum32_3(this.h[0], B6, Ch); + this.h[0] = T6; + }; + RIPEMD160.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "little"); + else + return utils.split32(this.h, "little"); + }; + function f8(j6, x7, y7, z6) { + if (j6 <= 15) + return x7 ^ y7 ^ z6; + else if (j6 <= 31) + return x7 & y7 | ~x7 & z6; + else if (j6 <= 47) + return (x7 | ~y7) ^ z6; + else if (j6 <= 63) + return x7 & z6 | y7 & ~z6; + else + return x7 ^ (y7 | ~z6); + } + function K5(j6) { + if (j6 <= 15) + return 0; + else if (j6 <= 31) + return 1518500249; + else if (j6 <= 47) + return 1859775393; + else if (j6 <= 63) + return 2400959708; + else + return 2840853838; + } + function Kh(j6) { + if (j6 <= 15) + return 1352829926; + else if (j6 <= 31) + return 1548603684; + else if (j6 <= 47) + return 1836072691; + else if (j6 <= 63) + return 2053994217; + else + return 0; + } + var r8 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var rh = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var s7 = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sh = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + return exports$K$1; +} +function dew$J$1() { + if (_dewExec$J$1) + return exports$J$1; + _dewExec$J$1 = true; + var utils = dew$N$1(); + var assert4 = dew$1t(); + function Hmac2(hash, key, enc) { + if (!(this instanceof Hmac2)) + return new Hmac2(hash, key, enc); + this.Hash = hash; + this.blockSize = hash.blockSize / 8; + this.outSize = hash.outSize / 8; + this.inner = null; + this.outer = null; + this._init(utils.toArray(key, enc)); + } + exports$J$1 = Hmac2; + Hmac2.prototype._init = function init2(key) { + if (key.length > this.blockSize) + key = new this.Hash().update(key).digest(); + assert4(key.length <= this.blockSize); + for (var i7 = key.length; i7 < this.blockSize; i7++) + key.push(0); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 54; + this.inner = new this.Hash().update(key); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 106; + this.outer = new this.Hash().update(key); + }; + Hmac2.prototype.update = function update2(msg, enc) { + this.inner.update(msg, enc); + return this; + }; + Hmac2.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); + }; + return exports$J$1; +} +function dew$I$1() { + if (_dewExec$I$1) + return exports$I$1; + _dewExec$I$1 = true; + var hash = exports$I$1; + hash.utils = dew$N$1(); + hash.common = dew$M$1(); + hash.sha = dew$L$1(); + hash.ripemd = dew$K$1(); + hash.hmac = dew$J$1(); + hash.sha1 = hash.sha.sha1; + hash.sha256 = hash.sha.sha256; + hash.sha224 = hash.sha.sha224; + hash.sha384 = hash.sha.sha384; + hash.sha512 = hash.sha.sha512; + hash.ripemd160 = hash.ripemd.ripemd160; + return exports$I$1; +} +function dew$H$1() { + if (_dewExec$H$1) + return exports$H$1; + _dewExec$H$1 = true; + exports$H$1 = { + doubles: { + step: 4, + points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] + }, + naf: { + wnd: 7, + points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] + } + }; + return exports$H$1; +} +function dew$G$1() { + if (_dewExec$G$1) + return exports$G$1; + _dewExec$G$1 = true; + var curves = exports$G$1; + var hash = dew$I$1(); + var curve = dew$O$1(); + var utils = dew$T$1(); + var assert4 = utils.assert; + function PresetCurve(options) { + if (options.type === "short") + this.curve = new curve.short(options); + else if (options.type === "edwards") + this.curve = new curve.edwards(options); + else + this.curve = new curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + assert4(this.g.validate(), "Invalid curve"); + assert4(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + curves.PresetCurve = PresetCurve; + function defineCurve(name2, options) { + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + get: function() { + var curve2 = new PresetCurve(options); + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + value: curve2 + }); + return curve2; + } + }); + } + defineCurve("p192", { + type: "short", + prime: "p192", + p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", + b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", + n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", + hash: hash.sha256, + gRed: false, + g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] + }); + defineCurve("p224", { + type: "short", + prime: "p224", + p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", + b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", + n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", + hash: hash.sha256, + gRed: false, + g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] + }); + defineCurve("p256", { + type: "short", + prime: null, + p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", + a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", + b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", + n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", + hash: hash.sha256, + gRed: false, + g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] + }); + defineCurve("p384", { + type: "short", + prime: null, + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", + a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", + b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", + n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", + hash: hash.sha384, + gRed: false, + g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"] + }); + defineCurve("p521", { + type: "short", + prime: null, + p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", + a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", + b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", + n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", + hash: hash.sha512, + gRed: false, + g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"] + }); + defineCurve("curve25519", { + type: "mont", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "76d06", + b: "1", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: ["9"] + }); + defineCurve("ed25519", { + type: "edwards", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "-1", + c: "1", + // -121665 * (121666^(-1)) (mod P) + d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: [ + "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", + // 4/5 + "6666666666666666666666666666666666666666666666666666666666666658" + ] + }); + var pre; + try { + pre = dew$H$1(); + } catch (e10) { + pre = void 0; + } + defineCurve("secp256k1", { + type: "short", + prime: "k256", + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", + a: "0", + b: "7", + n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", + h: "1", + hash: hash.sha256, + // Precomputed endomorphism + beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", + lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", + basis: [{ + a: "3086d221a7d46bcde86c90e49284eb15", + b: "-e4437ed6010e88286f547fa90abfe4c3" + }, { + a: "114ca50f7a8e2f3f657c1108d9d44cfd8", + b: "3086d221a7d46bcde86c90e49284eb15" + }], + gRed: false, + g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", pre] + }); + return exports$G$1; +} +function dew$F$1() { + if (_dewExec$F$1) + return exports$F$1; + _dewExec$F$1 = true; + var hash = dew$I$1(); + var utils = dew$U$1(); + var assert4 = dew$1t(); + function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex"); + var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex"); + var pers = utils.toArray(options.pers, options.persEnc || "hex"); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._init(entropy, nonce, pers); + } + exports$F$1 = HmacDRBG; + HmacDRBG.prototype._init = function init2(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i7 = 0; i7 < this.V.length; i7++) { + this.K[i7] = 0; + this.V[i7] = 1; + } + this._update(seed); + this._reseed = 1; + this.reseedInterval = 281474976710656; + }; + HmacDRBG.prototype._hmac = function hmac() { + return new hash.hmac(this.hash, this.K); + }; + HmacDRBG.prototype._update = function update2(seed) { + var kmac = this._hmac().update(this.V).update([0]); + if (seed) + kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) + return; + this.K = this._hmac().update(this.V).update([1]).update(seed).digest(); + this.V = this._hmac().update(this.V).digest(); + }; + HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add2, addEnc) { + if (typeof entropyEnc !== "string") { + addEnc = add2; + add2 = entropyEnc; + entropyEnc = null; + } + entropy = utils.toArray(entropy, entropyEnc); + add2 = utils.toArray(add2, addEnc); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._update(entropy.concat(add2 || [])); + this._reseed = 1; + }; + HmacDRBG.prototype.generate = function generate2(len, enc, add2, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + if (typeof enc !== "string") { + addEnc = add2; + add2 = enc; + enc = null; + } + if (add2) { + add2 = utils.toArray(add2, addEnc || "hex"); + this._update(add2); + } + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + var res = temp.slice(0, len); + this._update(add2); + this._reseed++; + return utils.encode(res, enc); + }; + return exports$F$1; +} +function dew$E$1() { + if (_dewExec$E$1) + return exports$E$1; + _dewExec$E$1 = true; + var BN = dew$V$1(); + var utils = dew$T$1(); + var assert4 = utils.assert; + function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); + } + exports$E$1 = KeyPair; + KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(ec, { + pub, + pubEnc: enc + }); + }; + KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + return new KeyPair(ec, { + priv, + privEnc: enc + }); + }; + KeyPair.prototype.validate = function validate15() { + var pub = this.getPublic(); + if (pub.isInfinity()) + return { + result: false, + reason: "Invalid public key" + }; + if (!pub.validate()) + return { + result: false, + reason: "Public key is not a point" + }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { + result: false, + reason: "Public key * N != O" + }; + return { + result: true, + reason: null + }; + }; + KeyPair.prototype.getPublic = function getPublic(compact2, enc) { + if (typeof compact2 === "string") { + enc = compact2; + compact2 = null; + } + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + if (!enc) + return this.pub; + return this.pub.encode(enc, compact2); + }; + KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === "hex") + return this.priv.toString(16, 2); + else + return this.priv; + }; + KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + this.priv = this.priv.umod(this.ec.curve.n); + }; + KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + if (this.ec.curve.type === "mont") { + assert4(key.x, "Need x coordinate"); + } else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") { + assert4(key.x && key.y, "Need both x and y coordinate"); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); + }; + KeyPair.prototype.derive = function derive(pub) { + if (!pub.validate()) { + assert4(pub.validate(), "public point not validated"); + } + return pub.mul(this.priv).getX(); + }; + KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); + }; + KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); + }; + KeyPair.prototype.inspect = function inspect2() { + return ""; + }; + return exports$E$1; +} +function dew$D$1() { + if (_dewExec$D$1) + return exports$D$1; + _dewExec$D$1 = true; + var BN = dew$V$1(); + var utils = dew$T$1(); + var assert4 = utils.assert; + function Signature(options, enc) { + if (options instanceof Signature) + return options; + if (this._importDER(options, enc)) + return; + assert4(options.r && options.s, "Signature without r or s"); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === void 0) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; + } + exports$D$1 = Signature; + function Position() { + this.place = 0; + } + function getLength(buf, p7) { + var initial2 = buf[p7.place++]; + if (!(initial2 & 128)) { + return initial2; + } + var octetLen = initial2 & 15; + if (octetLen === 0 || octetLen > 4) { + return false; + } + var val = 0; + for (var i7 = 0, off3 = p7.place; i7 < octetLen; i7++, off3++) { + val <<= 8; + val |= buf[off3]; + val >>>= 0; + } + if (val <= 127) { + return false; + } + p7.place = off3; + return val; + } + function rmPadding(buf) { + var i7 = 0; + var len = buf.length - 1; + while (!buf[i7] && !(buf[i7 + 1] & 128) && i7 < len) { + i7++; + } + if (i7 === 0) { + return buf; + } + return buf.slice(i7); + } + Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p7 = new Position(); + if (data[p7.place++] !== 48) { + return false; + } + var len = getLength(data, p7); + if (len === false) { + return false; + } + if (len + p7.place !== data.length) { + return false; + } + if (data[p7.place++] !== 2) { + return false; + } + var rlen = getLength(data, p7); + if (rlen === false) { + return false; + } + var r8 = data.slice(p7.place, rlen + p7.place); + p7.place += rlen; + if (data[p7.place++] !== 2) { + return false; + } + var slen = getLength(data, p7); + if (slen === false) { + return false; + } + if (data.length !== slen + p7.place) { + return false; + } + var s7 = data.slice(p7.place, slen + p7.place); + if (r8[0] === 0) { + if (r8[1] & 128) { + r8 = r8.slice(1); + } else { + return false; + } + } + if (s7[0] === 0) { + if (s7[1] & 128) { + s7 = s7.slice(1); + } else { + return false; + } + } + this.r = new BN(r8); + this.s = new BN(s7); + this.recoveryParam = null; + return true; + }; + function constructLength(arr, len) { + if (len < 128) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 128); + while (--octets) { + arr.push(len >>> (octets << 3) & 255); + } + arr.push(len); + } + Signature.prototype.toDER = function toDER(enc) { + var r8 = this.r.toArray(); + var s7 = this.s.toArray(); + if (r8[0] & 128) + r8 = [0].concat(r8); + if (s7[0] & 128) + s7 = [0].concat(s7); + r8 = rmPadding(r8); + s7 = rmPadding(s7); + while (!s7[0] && !(s7[1] & 128)) { + s7 = s7.slice(1); + } + var arr = [2]; + constructLength(arr, r8.length); + arr = arr.concat(r8); + arr.push(2); + constructLength(arr, s7.length); + var backHalf = arr.concat(s7); + var res = [48]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); + }; + return exports$D$1; +} +function dew$C$1() { + if (_dewExec$C$1) + return exports$C$1; + _dewExec$C$1 = true; + var BN = dew$V$1(); + var HmacDRBG = dew$F$1(); + var utils = dew$T$1(); + var curves = dew$G$1(); + var rand = dew$10$1(); + var assert4 = utils.assert; + var KeyPair = dew$E$1(); + var Signature = dew$D$1(); + function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + if (typeof options === "string") { + assert4(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options); + options = curves[options]; + } + if (options instanceof curves.PresetCurve) + options = { + curve: options + }; + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + this.hash = options.hash || options.curve.hash; + } + exports$C$1 = EC; + EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); + }; + EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); + }; + EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); + }; + EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || "utf8", + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || "utf8", + nonce: this.n.toArray() + }); + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + for (; ; ) { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + priv.iaddn(1); + return this.keyFromPrivate(priv); + } + }; + EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; + }; + EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === "object") { + options = enc; + enc = null; + } + if (!options) + options = {}; + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray("be", bytes); + var nonce = msg.toArray("be", bytes); + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce, + pers: options.pers, + persEnc: options.persEnc || "utf8" + }); + var ns1 = this.n.sub(new BN(1)); + for (var iter = 0; ; iter++) { + var k6 = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength())); + k6 = this._truncateToN(k6, true); + if (k6.cmpn(1) <= 0 || k6.cmp(ns1) >= 0) + continue; + var kp = this.g.mul(k6); + if (kp.isInfinity()) + continue; + var kpX = kp.getX(); + var r8 = kpX.umod(this.n); + if (r8.cmpn(0) === 0) + continue; + var s7 = k6.invm(this.n).mul(r8.mul(key.getPrivate()).iadd(msg)); + s7 = s7.umod(this.n); + if (s7.cmpn(0) === 0) + continue; + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r8) !== 0 ? 2 : 0); + if (options.canonical && s7.cmp(this.nh) > 0) { + s7 = this.n.sub(s7); + recoveryParam ^= 1; + } + return new Signature({ + r: r8, + s: s7, + recoveryParam + }); + } + }; + EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, "hex"); + var r8 = signature.r; + var s7 = signature.s; + if (r8.cmpn(1) < 0 || r8.cmp(this.n) >= 0) + return false; + if (s7.cmpn(1) < 0 || s7.cmp(this.n) >= 0) + return false; + var sinv = s7.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u22 = sinv.mul(r8).umod(this.n); + var p7; + if (!this.curve._maxwellTrick) { + p7 = this.g.mulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.getX().umod(this.n).cmp(r8) === 0; + } + p7 = this.g.jmulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.eqXToP(r8); + }; + EC.prototype.recoverPubKey = function(msg, signature, j6, enc) { + assert4((3 & j6) === j6, "The recovery param is more than two bits"); + signature = new Signature(signature, enc); + var n7 = this.n; + var e10 = new BN(msg); + var r8 = signature.r; + var s7 = signature.s; + var isYOdd = j6 & 1; + var isSecondKey = j6 >> 1; + if (r8.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error("Unable to find sencond key candinate"); + if (isSecondKey) + r8 = this.curve.pointFromX(r8.add(this.curve.n), isYOdd); + else + r8 = this.curve.pointFromX(r8, isYOdd); + var rInv = signature.r.invm(n7); + var s1 = n7.sub(e10).mul(rInv).umod(n7); + var s22 = s7.mul(rInv).umod(n7); + return this.g.mulAdd(s1, r8, s22); + }; + EC.prototype.getKeyRecoveryParam = function(e10, signature, Q5, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + for (var i7 = 0; i7 < 4; i7++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e10, signature, i7); + } catch (e11) { + continue; + } + if (Qprime.eq(Q5)) + return i7; + } + throw new Error("Unable to find valid recovery factor"); + }; + return exports$C$1; +} +function dew$B$1() { + if (_dewExec$B$1) + return exports$B$1; + _dewExec$B$1 = true; + var utils = dew$T$1(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var cachedProperty = utils.cachedProperty; + function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); + } + KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { + pub + }); + }; + KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { + secret + }); + }; + KeyPair.prototype.secret = function secret() { + return this._secret; + }; + cachedProperty(KeyPair, "pubBytes", function pubBytes() { + return this.eddsa.encodePoint(this.pub()); + }); + cachedProperty(KeyPair, "pub", function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); + }); + cachedProperty(KeyPair, "privBytes", function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + var a7 = hash.slice(0, eddsa.encodingLength); + a7[0] &= 248; + a7[lastIx] &= 127; + a7[lastIx] |= 64; + return a7; + }); + cachedProperty(KeyPair, "priv", function priv() { + return this.eddsa.decodeInt(this.privBytes()); + }); + cachedProperty(KeyPair, "hash", function hash() { + return this.eddsa.hash().update(this.secret()).digest(); + }); + cachedProperty(KeyPair, "messagePrefix", function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); + }); + KeyPair.prototype.sign = function sign(message) { + assert4(this._secret, "KeyPair can only verify"); + return this.eddsa.sign(message, this); + }; + KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); + }; + KeyPair.prototype.getSecret = function getSecret(enc) { + assert4(this._secret, "KeyPair is public only"); + return utils.encode(this.secret(), enc); + }; + KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); + }; + exports$B$1 = KeyPair; + return exports$B$1; +} +function dew$A$1() { + if (_dewExec$A$1) + return exports$A$1; + _dewExec$A$1 = true; + var BN = dew$V$1(); + var utils = dew$T$1(); + var assert4 = utils.assert; + var cachedProperty = utils.cachedProperty; + var parseBytes = utils.parseBytes; + function Signature(eddsa, sig) { + this.eddsa = eddsa; + if (typeof sig !== "object") + sig = parseBytes(sig); + if (Array.isArray(sig)) { + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + assert4(sig.R && sig.S, "Signature without R or S"); + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; + } + cachedProperty(Signature, "S", function S6() { + return this.eddsa.decodeInt(this.Sencoded()); + }); + cachedProperty(Signature, "R", function R6() { + return this.eddsa.decodePoint(this.Rencoded()); + }); + cachedProperty(Signature, "Rencoded", function Rencoded() { + return this.eddsa.encodePoint(this.R()); + }); + cachedProperty(Signature, "Sencoded", function Sencoded() { + return this.eddsa.encodeInt(this.S()); + }); + Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); + }; + Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), "hex").toUpperCase(); + }; + exports$A$1 = Signature; + return exports$A$1; +} +function dew$z$1() { + if (_dewExec$z$1) + return exports$z$1; + _dewExec$z$1 = true; + var hash = dew$I$1(); + var curves = dew$G$1(); + var utils = dew$T$1(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var KeyPair = dew$B$1(); + var Signature = dew$A$1(); + function EDDSA(curve) { + assert4(curve === "ed25519", "only tested with ed25519 so far"); + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + curve = curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; + } + exports$z$1 = EDDSA; + EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r8 = this.hashInt(key.messagePrefix(), message); + var R6 = this.g.mul(r8); + var Rencoded = this.encodePoint(R6); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()); + var S6 = r8.add(s_).umod(this.curve.n); + return this.makeSignature({ + R: R6, + S: S6, + Rencoded + }); + }; + EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + var key = this.keyFromPublic(pub); + var h8 = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h8)); + return RplusAh.eq(SG); + }; + EDDSA.prototype.hashInt = function hashInt() { + var hash2 = this.hash(); + for (var i7 = 0; i7 < arguments.length; i7++) + hash2.update(arguments[i7]); + return utils.intFromLE(hash2.digest()).umod(this.curve.n); + }; + EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); + }; + EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); + }; + EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); + }; + EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray("le", this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0; + return enc; + }; + EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~128); + var xIsOdd = (bytes[lastIx] & 128) !== 0; + var y7 = utils.intFromLE(normed); + return this.curve.pointFromY(y7, xIsOdd); + }; + EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray("le", this.encodingLength); + }; + EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); + }; + EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; + }; + return exports$z$1; +} +function dew$y$1() { + if (_dewExec$y$1) + return exports$y$1; + _dewExec$y$1 = true; + var elliptic = exports$y$1; + elliptic.version = _package$1.version; + elliptic.utils = dew$T$1(); + elliptic.rand = dew$10$1(); + elliptic.curve = dew$O$1(); + elliptic.curves = dew$G$1(); + elliptic.ec = dew$C$1(); + elliptic.eddsa = dew$z$1(); + return exports$y$1; +} +function dew$x$1() { + if (_dewExec$x$1) + return module$2$1.exports; + _dewExec$x$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$5$1).negative = 0; + (this || _global$5$1).words = null; + (this || _global$5$1).length = 0; + (this || _global$5$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$5$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$5$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$5$1).words = [number & 67108863]; + (this || _global$5$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$5$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$5$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$5$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$5$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$5$1).words = [0]; + (this || _global$5$1).length = 1; + return this || _global$5$1; + } + (this || _global$5$1).length = Math.ceil(number.length / 3); + (this || _global$5$1).words = new Array((this || _global$5$1).length); + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + (this || _global$5$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$5$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$5$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$5$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$5$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$5$1).length = Math.ceil((number.length - start) / 6); + (this || _global$5$1).words = new Array((this || _global$5$1).length); + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + (this || _global$5$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$5$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$5$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$5$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$5$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$5$1).words = [0]; + (this || _global$5$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$5$1).words[0] + word < 67108864) { + (this || _global$5$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$5$1).words[0] + word < 67108864) { + (this || _global$5$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$5$1).length); + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + dest.words[i7] = (this || _global$5$1).words[i7]; + } + dest.length = (this || _global$5$1).length; + dest.negative = (this || _global$5$1).negative; + dest.red = (this || _global$5$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$5$1).length < size2) { + (this || _global$5$1).words[(this || _global$5$1).length++] = 0; + } + return this || _global$5$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$5$1).length > 1 && (this || _global$5$1).words[(this || _global$5$1).length - 1] === 0) { + (this || _global$5$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$5$1).length === 1 && (this || _global$5$1).words[0] === 0) { + (this || _global$5$1).negative = 0; + } + return this || _global$5$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$5$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + var w6 = (this || _global$5$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$5$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$5$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$5$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$5$1).words[0]; + if ((this || _global$5$1).length === 2) { + ret += (this || _global$5$1).words[1] * 67108864; + } else if ((this || _global$5$1).length === 3 && (this || _global$5$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$5$1).words[1] * 67108864; + } else if ((this || _global$5$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$5$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$5$1).words[(this || _global$5$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$5$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + var b8 = this._zeroBits((this || _global$5$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$5$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$5$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$5$1).negative ^= 1; + } + return this || _global$5$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$5$1).length < num.length) { + (this || _global$5$1).words[(this || _global$5$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$5$1).words[i7] = (this || _global$5$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$5$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$5$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$5$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$5$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$5$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$5$1).words[i7] = (this || _global$5$1).words[i7] & num.words[i7]; + } + (this || _global$5$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$5$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$5$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$5$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$5$1).length > num.length) { + a7 = this || _global$5$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$5$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$5$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$5$1).words[i7] = a7.words[i7]; + } + } + (this || _global$5$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$5$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$5$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$5$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$5$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$5$1).words[i7] = ~(this || _global$5$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$5$1).words[i7] = ~(this || _global$5$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$5$1).words[off3] = (this || _global$5$1).words[off3] | 1 << wbit; + } else { + (this || _global$5$1).words[off3] = (this || _global$5$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$5$1).negative !== 0 && num.negative === 0) { + (this || _global$5$1).negative = 0; + r8 = this.isub(num); + (this || _global$5$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$5$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$5$1).length > num.length) { + a7 = this || _global$5$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$5$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$5$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$5$1).length = a7.length; + if (carry !== 0) { + (this || _global$5$1).words[(this || _global$5$1).length] = carry; + (this || _global$5$1).length++; + } else if (a7 !== (this || _global$5$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$5$1).words[i7] = a7.words[i7]; + } + } + return this || _global$5$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$5$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$5$1).negative !== 0) { + (this || _global$5$1).negative = 0; + res = num.sub(this || _global$5$1); + (this || _global$5$1).negative = 1; + return res; + } + if ((this || _global$5$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$5$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$5$1).negative !== 0) { + (this || _global$5$1).negative = 0; + this.iadd(num); + (this || _global$5$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$5$1).negative = 0; + (this || _global$5$1).length = 1; + (this || _global$5$1).words[0] = 0; + return this || _global$5$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$5$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$5$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$5$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$5$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$5$1).words[i7] = a7.words[i7]; + } + } + (this || _global$5$1).length = Math.max((this || _global$5$1).length, i7); + if (a7 !== (this || _global$5$1)) { + (this || _global$5$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$5$1).length + num.length; + if ((this || _global$5$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$5$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$5$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$5$1, num, out); + } else { + res = jumboMulTo(this || _global$5$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$5$1).x = x7; + (this || _global$5$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$5$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$5$1).length + num.length); + return jumboMulTo(this || _global$5$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$5$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$5$1).length; i7++) { + var w6 = ((this || _global$5$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$5$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$5$1).words[i7] = carry; + (this || _global$5$1).length++; + } + return this || _global$5$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$5$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$5$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$5$1).length; i7++) { + var newCarry = (this || _global$5$1).words[i7] & carryMask; + var c7 = ((this || _global$5$1).words[i7] | 0) - newCarry << r8; + (this || _global$5$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$5$1).words[i7] = carry; + (this || _global$5$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$5$1).length - 1; i7 >= 0; i7--) { + (this || _global$5$1).words[i7 + s7] = (this || _global$5$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$5$1).words[i7] = 0; + } + (this || _global$5$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$5$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$5$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$5$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$5$1).length > s7) { + (this || _global$5$1).length -= s7; + for (i7 = 0; i7 < (this || _global$5$1).length; i7++) { + (this || _global$5$1).words[i7] = (this || _global$5$1).words[i7 + s7]; + } + } else { + (this || _global$5$1).words[0] = 0; + (this || _global$5$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$5$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$5$1).words[i7] | 0; + (this || _global$5$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$5$1).length === 0) { + (this || _global$5$1).words[0] = 0; + (this || _global$5$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$5$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$5$1).length <= s7) + return false; + var w6 = (this || _global$5$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$5$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$5$1).length <= s7) { + return this || _global$5$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$5$1).length = Math.min(s7, (this || _global$5$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$5$1).words[(this || _global$5$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$5$1).negative !== 0) { + if ((this || _global$5$1).length === 1 && ((this || _global$5$1).words[0] | 0) < num) { + (this || _global$5$1).words[0] = num - ((this || _global$5$1).words[0] | 0); + (this || _global$5$1).negative = 0; + return this || _global$5$1; + } + (this || _global$5$1).negative = 0; + this.isubn(num); + (this || _global$5$1).negative = 1; + return this || _global$5$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$5$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$5$1).length && (this || _global$5$1).words[i7] >= 67108864; i7++) { + (this || _global$5$1).words[i7] -= 67108864; + if (i7 === (this || _global$5$1).length - 1) { + (this || _global$5$1).words[i7 + 1] = 1; + } else { + (this || _global$5$1).words[i7 + 1]++; + } + } + (this || _global$5$1).length = Math.max((this || _global$5$1).length, i7 + 1); + return this || _global$5$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$5$1).negative !== 0) { + (this || _global$5$1).negative = 0; + this.iaddn(num); + (this || _global$5$1).negative = 1; + return this || _global$5$1; + } + (this || _global$5$1).words[0] -= num; + if ((this || _global$5$1).length === 1 && (this || _global$5$1).words[0] < 0) { + (this || _global$5$1).words[0] = -(this || _global$5$1).words[0]; + (this || _global$5$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$5$1).length && (this || _global$5$1).words[i7] < 0; i7++) { + (this || _global$5$1).words[i7] += 67108864; + (this || _global$5$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$5$1).negative = 0; + return this || _global$5$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$5$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$5$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$5$1).length - shift; i7++) { + w6 = ((this || _global$5$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$5$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$5$1).length; i7++) { + w6 = -((this || _global$5$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$5$1).words[i7] = w6 & 67108863; + } + (this || _global$5$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$5$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$5$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$5$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$5$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$5$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$5$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$5$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$5$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$5$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$5$1).words[i7] | 0) + carry * 67108864; + (this || _global$5$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$5$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$5$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$5$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$5$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$5$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$5$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$5$1).words[s7] |= q5; + return this || _global$5$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$5$1).length; i7++) { + var w6 = (this || _global$5$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$5$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$5$1).words[i7] = carry; + (this || _global$5$1).length++; + } + return this || _global$5$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$5$1).length === 1 && (this || _global$5$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$5$1).negative !== 0 && !negative) + return -1; + if ((this || _global$5$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$5$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$5$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$5$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$5$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$5$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$5$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$5$1).length > num.length) + return 1; + if ((this || _global$5$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$5$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$5$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$5$1).red, "Already a number in reduction context"); + assert4((this || _global$5$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$5$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$5$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$5$1).red.convertFrom(this || _global$5$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$5$1).red = ctx; + return this || _global$5$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$5$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$5$1).red, "redAdd works only with red numbers"); + return (this || _global$5$1).red.add(this || _global$5$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$5$1).red, "redIAdd works only with red numbers"); + return (this || _global$5$1).red.iadd(this || _global$5$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$5$1).red, "redSub works only with red numbers"); + return (this || _global$5$1).red.sub(this || _global$5$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$5$1).red, "redISub works only with red numbers"); + return (this || _global$5$1).red.isub(this || _global$5$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$5$1).red, "redShl works only with red numbers"); + return (this || _global$5$1).red.shl(this || _global$5$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$5$1).red, "redMul works only with red numbers"); + (this || _global$5$1).red._verify2(this || _global$5$1, num); + return (this || _global$5$1).red.mul(this || _global$5$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$5$1).red, "redMul works only with red numbers"); + (this || _global$5$1).red._verify2(this || _global$5$1, num); + return (this || _global$5$1).red.imul(this || _global$5$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$5$1).red, "redSqr works only with red numbers"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.sqr(this || _global$5$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$5$1).red, "redISqr works only with red numbers"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.isqr(this || _global$5$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$5$1).red, "redSqrt works only with red numbers"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.sqrt(this || _global$5$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$5$1).red, "redInvm works only with red numbers"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.invm(this || _global$5$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$5$1).red, "redNeg works only with red numbers"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.neg(this || _global$5$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$5$1).red && !num.red, "redPow(normalNum)"); + (this || _global$5$1).red._verify1(this || _global$5$1); + return (this || _global$5$1).red.pow(this || _global$5$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$5$1).name = name2; + (this || _global$5$1).p = new BN(p7, 16); + (this || _global$5$1).n = (this || _global$5$1).p.bitLength(); + (this || _global$5$1).k = new BN(1).iushln((this || _global$5$1).n).isub((this || _global$5$1).p); + (this || _global$5$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$5$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$5$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$5$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$5$1).n); + var cmp = rlen < (this || _global$5$1).n ? -1 : r8.ucmp((this || _global$5$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$5$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$5$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$5$1).k); + }; + function K256() { + MPrime.call(this || _global$5$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$5$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$5$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$5$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$5$1).m = prime.p; + (this || _global$5$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$5$1).m = m7; + (this || _global$5$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$5$1).prime) + return (this || _global$5$1).prime.ireduce(a7)._forceRed(this || _global$5$1); + return a7.umod((this || _global$5$1).m)._forceRed(this || _global$5$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$5$1).m.sub(a7)._forceRed(this || _global$5$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$5$1).m) >= 0) { + res.isub((this || _global$5$1).m); + } + return res._forceRed(this || _global$5$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$5$1).m) >= 0) { + res.isub((this || _global$5$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$5$1).m); + } + return res._forceRed(this || _global$5$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$5$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$5$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$5$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$5$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$5$1); + var nOne = one.redNeg(); + var lpow = (this || _global$5$1).m.subn(1).iushrn(1); + var z6 = (this || _global$5$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$5$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$5$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$5$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$5$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$5$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$5$1, m7); + (this || _global$5$1).shift = (this || _global$5$1).m.bitLength(); + if ((this || _global$5$1).shift % 26 !== 0) { + (this || _global$5$1).shift += 26 - (this || _global$5$1).shift % 26; + } + (this || _global$5$1).r = new BN(1).iushln((this || _global$5$1).shift); + (this || _global$5$1).r2 = this.imod((this || _global$5$1).r.sqr()); + (this || _global$5$1).rinv = (this || _global$5$1).r._invmp((this || _global$5$1).m); + (this || _global$5$1).minv = (this || _global$5$1).rinv.mul((this || _global$5$1).r).isubn(1).div((this || _global$5$1).m); + (this || _global$5$1).minv = (this || _global$5$1).minv.umod((this || _global$5$1).r); + (this || _global$5$1).minv = (this || _global$5$1).r.sub((this || _global$5$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$5$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$5$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$5$1).shift).mul((this || _global$5$1).minv).imaskn((this || _global$5$1).shift).mul((this || _global$5$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$5$1).shift); + var res = u7; + if (u7.cmp((this || _global$5$1).m) >= 0) { + res = u7.isub((this || _global$5$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$5$1).m); + } + return res._forceRed(this || _global$5$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$5$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$5$1).shift).mul((this || _global$5$1).minv).imaskn((this || _global$5$1).shift).mul((this || _global$5$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$5$1).shift); + var res = u7; + if (u7.cmp((this || _global$5$1).m) >= 0) { + res = u7.isub((this || _global$5$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$5$1).m); + } + return res._forceRed(this || _global$5$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$5$1).m).mul((this || _global$5$1).r2)); + return res._forceRed(this || _global$5$1); + }; + })(module$2$1, exports$x$1); + return module$2$1.exports; +} +function dew$w$1() { + if (_dewExec$w$1) + return exports$w$1; + _dewExec$w$1 = true; + var process5 = T$1; + var buffer2 = e$1$1; + var Buffer4 = buffer2.Buffer; + var safer = {}; + var key; + for (key in buffer2) { + if (!buffer2.hasOwnProperty(key)) + continue; + if (key === "SlowBuffer" || key === "Buffer") + continue; + safer[key] = buffer2[key]; + } + var Safer = safer.Buffer = {}; + for (key in Buffer4) { + if (!Buffer4.hasOwnProperty(key)) + continue; + if (key === "allocUnsafe" || key === "allocUnsafeSlow") + continue; + Safer[key] = Buffer4[key]; + } + safer.Buffer.prototype = Buffer4.prototype; + if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function(value2, encodingOrOffset, length) { + if (typeof value2 === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value2); + } + if (value2 && typeof value2.length === "undefined") { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + return Buffer4(value2, encodingOrOffset, length); + }; + } + if (!Safer.alloc) { + Safer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size2); + } + if (size2 < 0 || size2 >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + } + var buf = Buffer4(size2); + if (!fill2 || fill2.length === 0) { + buf.fill(0); + } else if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + return buf; + }; + } + if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process5.binding("buffer").kStringMaxLength; + } catch (e10) { + } + } + if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + }; + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength; + } + } + exports$w$1 = safer; + return exports$w$1; +} +function dew$v$1() { + if (_dewExec$v$1) + return exports$v$1; + _dewExec$v$1 = true; + const inherits2 = dew$f$2(); + function Reporter(options) { + this._reporterState = { + obj: null, + path: [], + options: options || {}, + errors: [] + }; + } + exports$v$1.Reporter = Reporter; + Reporter.prototype.isError = function isError3(obj) { + return obj instanceof ReporterError; + }; + Reporter.prototype.save = function save() { + const state = this._reporterState; + return { + obj: state.obj, + pathLen: state.path.length + }; + }; + Reporter.prototype.restore = function restore(data) { + const state = this._reporterState; + state.obj = data.obj; + state.path = state.path.slice(0, data.pathLen); + }; + Reporter.prototype.enterKey = function enterKey(key) { + return this._reporterState.path.push(key); + }; + Reporter.prototype.exitKey = function exitKey(index4) { + const state = this._reporterState; + state.path = state.path.slice(0, index4 - 1); + }; + Reporter.prototype.leaveKey = function leaveKey(index4, key, value2) { + const state = this._reporterState; + this.exitKey(index4); + if (state.obj !== null) + state.obj[key] = value2; + }; + Reporter.prototype.path = function path2() { + return this._reporterState.path.join("/"); + }; + Reporter.prototype.enterObject = function enterObject() { + const state = this._reporterState; + const prev = state.obj; + state.obj = {}; + return prev; + }; + Reporter.prototype.leaveObject = function leaveObject(prev) { + const state = this._reporterState; + const now2 = state.obj; + state.obj = prev; + return now2; + }; + Reporter.prototype.error = function error2(msg) { + let err; + const state = this._reporterState; + const inherited = msg instanceof ReporterError; + if (inherited) { + err = msg; + } else { + err = new ReporterError(state.path.map(function(elem) { + return "[" + JSON.stringify(elem) + "]"; + }).join(""), msg.message || msg, msg.stack); + } + if (!state.options.partial) + throw err; + if (!inherited) + state.errors.push(err); + return err; + }; + Reporter.prototype.wrapResult = function wrapResult(result2) { + const state = this._reporterState; + if (!state.options.partial) + return result2; + return { + result: this.isError(result2) ? null : result2, + errors: state.errors + }; + }; + function ReporterError(path2, msg) { + this.path = path2; + this.rethrow(msg); + } + inherits2(ReporterError, Error); + ReporterError.prototype.rethrow = function rethrow(msg) { + this.message = msg + " at: " + (this.path || "(shallow)"); + if (Error.captureStackTrace) + Error.captureStackTrace(this, ReporterError); + if (!this.stack) { + try { + throw new Error(this.message); + } catch (e10) { + this.stack = e10.stack; + } + } + return this; + }; + return exports$v$1; +} +function dew$u$1() { + if (_dewExec$u$1) + return exports$u$1; + _dewExec$u$1 = true; + const inherits2 = dew$f$2(); + const Reporter = dew$v$1().Reporter; + const Buffer4 = dew$w$1().Buffer; + function DecoderBuffer(base, options) { + Reporter.call(this, options); + if (!Buffer4.isBuffer(base)) { + this.error("Input not Buffer"); + return; + } + this.base = base; + this.offset = 0; + this.length = base.length; + } + inherits2(DecoderBuffer, Reporter); + exports$u$1.DecoderBuffer = DecoderBuffer; + DecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) { + if (data instanceof DecoderBuffer) { + return true; + } + const isCompatible = typeof data === "object" && Buffer4.isBuffer(data.base) && data.constructor.name === "DecoderBuffer" && typeof data.offset === "number" && typeof data.length === "number" && typeof data.save === "function" && typeof data.restore === "function" && typeof data.isEmpty === "function" && typeof data.readUInt8 === "function" && typeof data.skip === "function" && typeof data.raw === "function"; + return isCompatible; + }; + DecoderBuffer.prototype.save = function save() { + return { + offset: this.offset, + reporter: Reporter.prototype.save.call(this) + }; + }; + DecoderBuffer.prototype.restore = function restore(save) { + const res = new DecoderBuffer(this.base); + res.offset = save.offset; + res.length = this.offset; + this.offset = save.offset; + Reporter.prototype.restore.call(this, save.reporter); + return res; + }; + DecoderBuffer.prototype.isEmpty = function isEmpty4() { + return this.offset === this.length; + }; + DecoderBuffer.prototype.readUInt8 = function readUInt8(fail2) { + if (this.offset + 1 <= this.length) + return this.base.readUInt8(this.offset++, true); + else + return this.error(fail2 || "DecoderBuffer overrun"); + }; + DecoderBuffer.prototype.skip = function skip(bytes, fail2) { + if (!(this.offset + bytes <= this.length)) + return this.error(fail2 || "DecoderBuffer overrun"); + const res = new DecoderBuffer(this.base); + res._reporterState = this._reporterState; + res.offset = this.offset; + res.length = this.offset + bytes; + this.offset += bytes; + return res; + }; + DecoderBuffer.prototype.raw = function raw(save) { + return this.base.slice(save ? save.offset : this.offset, this.length); + }; + function EncoderBuffer(value2, reporter) { + if (Array.isArray(value2)) { + this.length = 0; + this.value = value2.map(function(item) { + if (!EncoderBuffer.isEncoderBuffer(item)) + item = new EncoderBuffer(item, reporter); + this.length += item.length; + return item; + }, this); + } else if (typeof value2 === "number") { + if (!(0 <= value2 && value2 <= 255)) + return reporter.error("non-byte EncoderBuffer value"); + this.value = value2; + this.length = 1; + } else if (typeof value2 === "string") { + this.value = value2; + this.length = Buffer4.byteLength(value2); + } else if (Buffer4.isBuffer(value2)) { + this.value = value2; + this.length = value2.length; + } else { + return reporter.error("Unsupported type: " + typeof value2); + } + } + exports$u$1.EncoderBuffer = EncoderBuffer; + EncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) { + if (data instanceof EncoderBuffer) { + return true; + } + const isCompatible = typeof data === "object" && data.constructor.name === "EncoderBuffer" && typeof data.length === "number" && typeof data.join === "function"; + return isCompatible; + }; + EncoderBuffer.prototype.join = function join3(out, offset) { + if (!out) + out = Buffer4.alloc(this.length); + if (!offset) + offset = 0; + if (this.length === 0) + return out; + if (Array.isArray(this.value)) { + this.value.forEach(function(item) { + item.join(out, offset); + offset += item.length; + }); + } else { + if (typeof this.value === "number") + out[offset] = this.value; + else if (typeof this.value === "string") + out.write(this.value, offset); + else if (Buffer4.isBuffer(this.value)) + this.value.copy(out, offset); + offset += this.length; + } + return out; + }; + return exports$u$1; +} +function dew$t$1() { + if (_dewExec$t$1) + return exports$t$1; + _dewExec$t$1 = true; + const Reporter = dew$v$1().Reporter; + const EncoderBuffer = dew$u$1().EncoderBuffer; + const DecoderBuffer = dew$u$1().DecoderBuffer; + const assert4 = dew$1t(); + const tags6 = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"]; + const methods = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(tags6); + const overrided = ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"]; + function Node(enc, parent2, name2) { + const state = {}; + this._baseState = state; + state.name = name2; + state.enc = enc; + state.parent = parent2 || null; + state.children = null; + state.tag = null; + state.args = null; + state.reverseArgs = null; + state.choice = null; + state.optional = false; + state.any = false; + state.obj = false; + state.use = null; + state.useDecoder = null; + state.key = null; + state["default"] = null; + state.explicit = null; + state.implicit = null; + state.contains = null; + if (!state.parent) { + state.children = []; + this._wrap(); + } + } + exports$t$1 = Node; + const stateProps = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; + Node.prototype.clone = function clone2() { + const state = this._baseState; + const cstate = {}; + stateProps.forEach(function(prop) { + cstate[prop] = state[prop]; + }); + const res = new this.constructor(cstate.parent); + res._baseState = cstate; + return res; + }; + Node.prototype._wrap = function wrap2() { + const state = this._baseState; + methods.forEach(function(method2) { + this[method2] = function _wrappedMethod() { + const clone2 = new this.constructor(this); + state.children.push(clone2); + return clone2[method2].apply(clone2, arguments); + }; + }, this); + }; + Node.prototype._init = function init2(body) { + const state = this._baseState; + assert4(state.parent === null); + body.call(this); + state.children = state.children.filter(function(child) { + return child._baseState.parent === this; + }, this); + assert4.equal(state.children.length, 1, "Root node can have only one child"); + }; + Node.prototype._useArgs = function useArgs(args) { + const state = this._baseState; + const children = args.filter(function(arg) { + return arg instanceof this.constructor; + }, this); + args = args.filter(function(arg) { + return !(arg instanceof this.constructor); + }, this); + if (children.length !== 0) { + assert4(state.children === null); + state.children = children; + children.forEach(function(child) { + child._baseState.parent = this; + }, this); + } + if (args.length !== 0) { + assert4(state.args === null); + state.args = args; + state.reverseArgs = args.map(function(arg) { + if (typeof arg !== "object" || arg.constructor !== Object) + return arg; + const res = {}; + Object.keys(arg).forEach(function(key) { + if (key == (key | 0)) + key |= 0; + const value2 = arg[key]; + res[value2] = key; + }); + return res; + }); + } + }; + overrided.forEach(function(method2) { + Node.prototype[method2] = function _overrided() { + const state = this._baseState; + throw new Error(method2 + " not implemented for encoding: " + state.enc); + }; + }); + tags6.forEach(function(tag) { + Node.prototype[tag] = function _tagMethod() { + const state = this._baseState; + const args = Array.prototype.slice.call(arguments); + assert4(state.tag === null); + state.tag = tag; + this._useArgs(args); + return this; + }; + }); + Node.prototype.use = function use(item) { + assert4(item); + const state = this._baseState; + assert4(state.use === null); + state.use = item; + return this; + }; + Node.prototype.optional = function optional() { + const state = this._baseState; + state.optional = true; + return this; + }; + Node.prototype.def = function def(val) { + const state = this._baseState; + assert4(state["default"] === null); + state["default"] = val; + state.optional = true; + return this; + }; + Node.prototype.explicit = function explicit(num) { + const state = this._baseState; + assert4(state.explicit === null && state.implicit === null); + state.explicit = num; + return this; + }; + Node.prototype.implicit = function implicit(num) { + const state = this._baseState; + assert4(state.explicit === null && state.implicit === null); + state.implicit = num; + return this; + }; + Node.prototype.obj = function obj() { + const state = this._baseState; + const args = Array.prototype.slice.call(arguments); + state.obj = true; + if (args.length !== 0) + this._useArgs(args); + return this; + }; + Node.prototype.key = function key(newKey) { + const state = this._baseState; + assert4(state.key === null); + state.key = newKey; + return this; + }; + Node.prototype.any = function any() { + const state = this._baseState; + state.any = true; + return this; + }; + Node.prototype.choice = function choice(obj) { + const state = this._baseState; + assert4(state.choice === null); + state.choice = obj; + this._useArgs(Object.keys(obj).map(function(key) { + return obj[key]; + })); + return this; + }; + Node.prototype.contains = function contains2(item) { + const state = this._baseState; + assert4(state.use === null); + state.contains = item; + return this; + }; + Node.prototype._decode = function decode2(input, options) { + const state = this._baseState; + if (state.parent === null) + return input.wrapResult(state.children[0]._decode(input, options)); + let result2 = state["default"]; + let present = true; + let prevKey = null; + if (state.key !== null) + prevKey = input.enterKey(state.key); + if (state.optional) { + let tag = null; + if (state.explicit !== null) + tag = state.explicit; + else if (state.implicit !== null) + tag = state.implicit; + else if (state.tag !== null) + tag = state.tag; + if (tag === null && !state.any) { + const save = input.save(); + try { + if (state.choice === null) + this._decodeGeneric(state.tag, input, options); + else + this._decodeChoice(input, options); + present = true; + } catch (e10) { + present = false; + } + input.restore(save); + } else { + present = this._peekTag(input, tag, state.any); + if (input.isError(present)) + return present; + } + } + let prevObj; + if (state.obj && present) + prevObj = input.enterObject(); + if (present) { + if (state.explicit !== null) { + const explicit = this._decodeTag(input, state.explicit); + if (input.isError(explicit)) + return explicit; + input = explicit; + } + const start = input.offset; + if (state.use === null && state.choice === null) { + let save; + if (state.any) + save = input.save(); + const body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any); + if (input.isError(body)) + return body; + if (state.any) + result2 = input.raw(save); + else + input = body; + } + if (options && options.track && state.tag !== null) + options.track(input.path(), start, input.length, "tagged"); + if (options && options.track && state.tag !== null) + options.track(input.path(), input.offset, input.length, "content"); + if (state.any) + ; + else if (state.choice === null) { + result2 = this._decodeGeneric(state.tag, input, options); + } else { + result2 = this._decodeChoice(input, options); + } + if (input.isError(result2)) + return result2; + if (!state.any && state.choice === null && state.children !== null) { + state.children.forEach(function decodeChildren(child) { + child._decode(input, options); + }); + } + if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) { + const data = new DecoderBuffer(result2); + result2 = this._getUse(state.contains, input._reporterState.obj)._decode(data, options); + } + } + if (state.obj && present) + result2 = input.leaveObject(prevObj); + if (state.key !== null && (result2 !== null || present === true)) + input.leaveKey(prevKey, state.key, result2); + else if (prevKey !== null) + input.exitKey(prevKey); + return result2; + }; + Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { + const state = this._baseState; + if (tag === "seq" || tag === "set") + return null; + if (tag === "seqof" || tag === "setof") + return this._decodeList(input, tag, state.args[0], options); + else if (/str$/.test(tag)) + return this._decodeStr(input, tag, options); + else if (tag === "objid" && state.args) + return this._decodeObjid(input, state.args[0], state.args[1], options); + else if (tag === "objid") + return this._decodeObjid(input, null, null, options); + else if (tag === "gentime" || tag === "utctime") + return this._decodeTime(input, tag, options); + else if (tag === "null_") + return this._decodeNull(input, options); + else if (tag === "bool") + return this._decodeBool(input, options); + else if (tag === "objDesc") + return this._decodeStr(input, tag, options); + else if (tag === "int" || tag === "enum") + return this._decodeInt(input, state.args && state.args[0], options); + if (state.use !== null) { + return this._getUse(state.use, input._reporterState.obj)._decode(input, options); + } else { + return input.error("unknown tag: " + tag); + } + }; + Node.prototype._getUse = function _getUse(entity, obj) { + const state = this._baseState; + state.useDecoder = this._use(entity, obj); + assert4(state.useDecoder._baseState.parent === null); + state.useDecoder = state.useDecoder._baseState.children[0]; + if (state.implicit !== state.useDecoder._baseState.implicit) { + state.useDecoder = state.useDecoder.clone(); + state.useDecoder._baseState.implicit = state.implicit; + } + return state.useDecoder; + }; + Node.prototype._decodeChoice = function decodeChoice(input, options) { + const state = this._baseState; + let result2 = null; + let match = false; + Object.keys(state.choice).some(function(key) { + const save = input.save(); + const node = state.choice[key]; + try { + const value2 = node._decode(input, options); + if (input.isError(value2)) + return false; + result2 = { + type: key, + value: value2 + }; + match = true; + } catch (e10) { + input.restore(save); + return false; + } + return true; + }, this); + if (!match) + return input.error("Choice not matched"); + return result2; + }; + Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { + return new EncoderBuffer(data, this.reporter); + }; + Node.prototype._encode = function encode2(data, reporter, parent2) { + const state = this._baseState; + if (state["default"] !== null && state["default"] === data) + return; + const result2 = this._encodeValue(data, reporter, parent2); + if (result2 === void 0) + return; + if (this._skipDefault(result2, reporter, parent2)) + return; + return result2; + }; + Node.prototype._encodeValue = function encode2(data, reporter, parent2) { + const state = this._baseState; + if (state.parent === null) + return state.children[0]._encode(data, reporter || new Reporter()); + let result2 = null; + this.reporter = reporter; + if (state.optional && data === void 0) { + if (state["default"] !== null) + data = state["default"]; + else + return; + } + let content = null; + let primitive = false; + if (state.any) { + result2 = this._createEncoderBuffer(data); + } else if (state.choice) { + result2 = this._encodeChoice(data, reporter); + } else if (state.contains) { + content = this._getUse(state.contains, parent2)._encode(data, reporter); + primitive = true; + } else if (state.children) { + content = state.children.map(function(child) { + if (child._baseState.tag === "null_") + return child._encode(null, reporter, data); + if (child._baseState.key === null) + return reporter.error("Child should have a key"); + const prevKey = reporter.enterKey(child._baseState.key); + if (typeof data !== "object") + return reporter.error("Child expected, but input is not object"); + const res = child._encode(data[child._baseState.key], reporter, data); + reporter.leaveKey(prevKey); + return res; + }, this).filter(function(child) { + return child; + }); + content = this._createEncoderBuffer(content); + } else { + if (state.tag === "seqof" || state.tag === "setof") { + if (!(state.args && state.args.length === 1)) + return reporter.error("Too many args for : " + state.tag); + if (!Array.isArray(data)) + return reporter.error("seqof/setof, but data is not Array"); + const child = this.clone(); + child._baseState.implicit = null; + content = this._createEncoderBuffer(data.map(function(item) { + const state2 = this._baseState; + return this._getUse(state2.args[0], data)._encode(item, reporter); + }, child)); + } else if (state.use !== null) { + result2 = this._getUse(state.use, parent2)._encode(data, reporter); + } else { + content = this._encodePrimitive(state.tag, data); + primitive = true; + } + } + if (!state.any && state.choice === null) { + const tag = state.implicit !== null ? state.implicit : state.tag; + const cls = state.implicit === null ? "universal" : "context"; + if (tag === null) { + if (state.use === null) + reporter.error("Tag could be omitted only for .use()"); + } else { + if (state.use === null) + result2 = this._encodeComposite(tag, primitive, cls, content); + } + } + if (state.explicit !== null) + result2 = this._encodeComposite(state.explicit, false, "context", result2); + return result2; + }; + Node.prototype._encodeChoice = function encodeChoice(data, reporter) { + const state = this._baseState; + const node = state.choice[data.type]; + if (!node) { + assert4(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice))); + } + return node._encode(data.value, reporter); + }; + Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { + const state = this._baseState; + if (/str$/.test(tag)) + return this._encodeStr(data, tag); + else if (tag === "objid" && state.args) + return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); + else if (tag === "objid") + return this._encodeObjid(data, null, null); + else if (tag === "gentime" || tag === "utctime") + return this._encodeTime(data, tag); + else if (tag === "null_") + return this._encodeNull(); + else if (tag === "int" || tag === "enum") + return this._encodeInt(data, state.args && state.reverseArgs[0]); + else if (tag === "bool") + return this._encodeBool(data); + else if (tag === "objDesc") + return this._encodeStr(data, tag); + else + throw new Error("Unsupported tag: " + tag); + }; + Node.prototype._isNumstr = function isNumstr(str2) { + return /^[0-9 ]*$/.test(str2); + }; + Node.prototype._isPrintstr = function isPrintstr(str2) { + return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str2); + }; + return exports$t$1; +} +function dew$s$1() { + if (_dewExec$s$1) + return exports$s$1; + _dewExec$s$1 = true; + function reverse2(map4) { + const res = {}; + Object.keys(map4).forEach(function(key) { + if ((key | 0) == key) + key = key | 0; + const value2 = map4[key]; + res[value2] = key; + }); + return res; + } + exports$s$1.tagClass = { + 0: "universal", + 1: "application", + 2: "context", + 3: "private" + }; + exports$s$1.tagClassByName = reverse2(exports$s$1.tagClass); + exports$s$1.tag = { + 0: "end", + 1: "bool", + 2: "int", + 3: "bitstr", + 4: "octstr", + 5: "null_", + 6: "objid", + 7: "objDesc", + 8: "external", + 9: "real", + 10: "enum", + 11: "embed", + 12: "utf8str", + 13: "relativeOid", + 16: "seq", + 17: "set", + 18: "numstr", + 19: "printstr", + 20: "t61str", + 21: "videostr", + 22: "ia5str", + 23: "utctime", + 24: "gentime", + 25: "graphstr", + 26: "iso646str", + 27: "genstr", + 28: "unistr", + 29: "charstr", + 30: "bmpstr" + }; + exports$s$1.tagByName = reverse2(exports$s$1.tag); + return exports$s$1; +} +function dew$r$1() { + if (_dewExec$r$1) + return exports$r$1; + _dewExec$r$1 = true; + const inherits2 = dew$f$2(); + const Buffer4 = dew$w$1().Buffer; + const Node = dew$t$1(); + const der = dew$s$1(); + function DEREncoder(entity) { + this.enc = "der"; + this.name = entity.name; + this.entity = entity; + this.tree = new DERNode(); + this.tree._init(entity.body); + } + exports$r$1 = DEREncoder; + DEREncoder.prototype.encode = function encode2(data, reporter) { + return this.tree._encode(data, reporter).join(); + }; + function DERNode(parent2) { + Node.call(this, "der", parent2); + } + inherits2(DERNode, Node); + DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) { + const encodedTag = encodeTag(tag, primitive, cls, this.reporter); + if (content.length < 128) { + const header2 = Buffer4.alloc(2); + header2[0] = encodedTag; + header2[1] = content.length; + return this._createEncoderBuffer([header2, content]); + } + let lenOctets = 1; + for (let i7 = content.length; i7 >= 256; i7 >>= 8) + lenOctets++; + const header = Buffer4.alloc(1 + 1 + lenOctets); + header[0] = encodedTag; + header[1] = 128 | lenOctets; + for (let i7 = 1 + lenOctets, j6 = content.length; j6 > 0; i7--, j6 >>= 8) + header[i7] = j6 & 255; + return this._createEncoderBuffer([header, content]); + }; + DERNode.prototype._encodeStr = function encodeStr(str2, tag) { + if (tag === "bitstr") { + return this._createEncoderBuffer([str2.unused | 0, str2.data]); + } else if (tag === "bmpstr") { + const buf = Buffer4.alloc(str2.length * 2); + for (let i7 = 0; i7 < str2.length; i7++) { + buf.writeUInt16BE(str2.charCodeAt(i7), i7 * 2); + } + return this._createEncoderBuffer(buf); + } else if (tag === "numstr") { + if (!this._isNumstr(str2)) { + return this.reporter.error("Encoding of string type: numstr supports only digits and space"); + } + return this._createEncoderBuffer(str2); + } else if (tag === "printstr") { + if (!this._isPrintstr(str2)) { + return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"); + } + return this._createEncoderBuffer(str2); + } else if (/str$/.test(tag)) { + return this._createEncoderBuffer(str2); + } else if (tag === "objDesc") { + return this._createEncoderBuffer(str2); + } else { + return this.reporter.error("Encoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._encodeObjid = function encodeObjid(id, values2, relative2) { + if (typeof id === "string") { + if (!values2) + return this.reporter.error("string objid given, but no values map found"); + if (!values2.hasOwnProperty(id)) + return this.reporter.error("objid not found in values map"); + id = values2[id].split(/[\s.]+/g); + for (let i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } else if (Array.isArray(id)) { + id = id.slice(); + for (let i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } + if (!Array.isArray(id)) { + return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(id)); + } + if (!relative2) { + if (id[1] >= 40) + return this.reporter.error("Second objid identifier OOB"); + id.splice(0, 2, id[0] * 40 + id[1]); + } + let size2 = 0; + for (let i7 = 0; i7 < id.length; i7++) { + let ident = id[i7]; + for (size2++; ident >= 128; ident >>= 7) + size2++; + } + const objid = Buffer4.alloc(size2); + let offset = objid.length - 1; + for (let i7 = id.length - 1; i7 >= 0; i7--) { + let ident = id[i7]; + objid[offset--] = ident & 127; + while ((ident >>= 7) > 0) + objid[offset--] = 128 | ident & 127; + } + return this._createEncoderBuffer(objid); + }; + function two(num) { + if (num < 10) + return "0" + num; + else + return num; + } + DERNode.prototype._encodeTime = function encodeTime(time2, tag) { + let str2; + const date = new Date(time2); + if (tag === "gentime") { + str2 = [two(date.getUTCFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else if (tag === "utctime") { + str2 = [two(date.getUTCFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else { + this.reporter.error("Encoding " + tag + " time is not supported yet"); + } + return this._encodeStr(str2, "octstr"); + }; + DERNode.prototype._encodeNull = function encodeNull() { + return this._createEncoderBuffer(""); + }; + DERNode.prototype._encodeInt = function encodeInt(num, values2) { + if (typeof num === "string") { + if (!values2) + return this.reporter.error("String int or enum given, but no values map"); + if (!values2.hasOwnProperty(num)) { + return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num)); + } + num = values2[num]; + } + if (typeof num !== "number" && !Buffer4.isBuffer(num)) { + const numArray = num.toArray(); + if (!num.sign && numArray[0] & 128) { + numArray.unshift(0); + } + num = Buffer4.from(numArray); + } + if (Buffer4.isBuffer(num)) { + let size3 = num.length; + if (num.length === 0) + size3++; + const out2 = Buffer4.alloc(size3); + num.copy(out2); + if (num.length === 0) + out2[0] = 0; + return this._createEncoderBuffer(out2); + } + if (num < 128) + return this._createEncoderBuffer(num); + if (num < 256) + return this._createEncoderBuffer([0, num]); + let size2 = 1; + for (let i7 = num; i7 >= 256; i7 >>= 8) + size2++; + const out = new Array(size2); + for (let i7 = out.length - 1; i7 >= 0; i7--) { + out[i7] = num & 255; + num >>= 8; + } + if (out[0] & 128) { + out.unshift(0); + } + return this._createEncoderBuffer(Buffer4.from(out)); + }; + DERNode.prototype._encodeBool = function encodeBool(value2) { + return this._createEncoderBuffer(value2 ? 255 : 0); + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getEncoder("der").tree; + }; + DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent2) { + const state = this._baseState; + let i7; + if (state["default"] === null) + return false; + const data = dataBuffer.join(); + if (state.defaultBuffer === void 0) + state.defaultBuffer = this._encodeValue(state["default"], reporter, parent2).join(); + if (data.length !== state.defaultBuffer.length) + return false; + for (i7 = 0; i7 < data.length; i7++) + if (data[i7] !== state.defaultBuffer[i7]) + return false; + return true; + }; + function encodeTag(tag, primitive, cls, reporter) { + let res; + if (tag === "seqof") + tag = "seq"; + else if (tag === "setof") + tag = "set"; + if (der.tagByName.hasOwnProperty(tag)) + res = der.tagByName[tag]; + else if (typeof tag === "number" && (tag | 0) === tag) + res = tag; + else + return reporter.error("Unknown tag: " + tag); + if (res >= 31) + return reporter.error("Multi-octet tag encoding unsupported"); + if (!primitive) + res |= 32; + res |= der.tagClassByName[cls || "universal"] << 6; + return res; + } + return exports$r$1; +} +function dew$q$1() { + if (_dewExec$q$1) + return exports$q$1; + _dewExec$q$1 = true; + const inherits2 = dew$f$2(); + const DEREncoder = dew$r$1(); + function PEMEncoder(entity) { + DEREncoder.call(this, entity); + this.enc = "pem"; + } + inherits2(PEMEncoder, DEREncoder); + exports$q$1 = PEMEncoder; + PEMEncoder.prototype.encode = function encode2(data, options) { + const buf = DEREncoder.prototype.encode.call(this, data); + const p7 = buf.toString("base64"); + const out = ["-----BEGIN " + options.label + "-----"]; + for (let i7 = 0; i7 < p7.length; i7 += 64) + out.push(p7.slice(i7, i7 + 64)); + out.push("-----END " + options.label + "-----"); + return out.join("\n"); + }; + return exports$q$1; +} +function dew$p$1() { + if (_dewExec$p$1) + return exports$p$1; + _dewExec$p$1 = true; + const encoders = exports$p$1; + encoders.der = dew$r$1(); + encoders.pem = dew$q$1(); + return exports$p$1; +} +function dew$o$1() { + if (_dewExec$o$1) + return exports$o$1; + _dewExec$o$1 = true; + const inherits2 = dew$f$2(); + const bignum = dew$x$1(); + const DecoderBuffer = dew$u$1().DecoderBuffer; + const Node = dew$t$1(); + const der = dew$s$1(); + function DERDecoder(entity) { + this.enc = "der"; + this.name = entity.name; + this.entity = entity; + this.tree = new DERNode(); + this.tree._init(entity.body); + } + exports$o$1 = DERDecoder; + DERDecoder.prototype.decode = function decode2(data, options) { + if (!DecoderBuffer.isDecoderBuffer(data)) { + data = new DecoderBuffer(data, options); + } + return this.tree._decode(data, options); + }; + function DERNode(parent2) { + Node.call(this, "der", parent2); + } + inherits2(DERNode, Node); + DERNode.prototype._peekTag = function peekTag(buffer2, tag, any) { + if (buffer2.isEmpty()) + return false; + const state = buffer2.save(); + const decodedTag = derDecodeTag(buffer2, 'Failed to peek tag: "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + buffer2.restore(state); + return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any; + }; + DERNode.prototype._decodeTag = function decodeTag(buffer2, tag, any) { + const decodedTag = derDecodeTag(buffer2, 'Failed to decode tag of "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + let len = derDecodeLen(buffer2, decodedTag.primitive, 'Failed to get length of "' + tag + '"'); + if (buffer2.isError(len)) + return len; + if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) { + return buffer2.error('Failed to match tag: "' + tag + '"'); + } + if (decodedTag.primitive || len !== null) + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + const state = buffer2.save(); + const res = this._skipUntilEnd(buffer2, 'Failed to skip indefinite length body: "' + this.tag + '"'); + if (buffer2.isError(res)) + return res; + len = buffer2.offset - state.offset; + buffer2.restore(state); + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + }; + DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer2, fail2) { + for (; ; ) { + const tag = derDecodeTag(buffer2, fail2); + if (buffer2.isError(tag)) + return tag; + const len = derDecodeLen(buffer2, tag.primitive, fail2); + if (buffer2.isError(len)) + return len; + let res; + if (tag.primitive || len !== null) + res = buffer2.skip(len); + else + res = this._skipUntilEnd(buffer2, fail2); + if (buffer2.isError(res)) + return res; + if (tag.tagStr === "end") + break; + } + }; + DERNode.prototype._decodeList = function decodeList(buffer2, tag, decoder, options) { + const result2 = []; + while (!buffer2.isEmpty()) { + const possibleEnd = this._peekTag(buffer2, "end"); + if (buffer2.isError(possibleEnd)) + return possibleEnd; + const res = decoder.decode(buffer2, "der", options); + if (buffer2.isError(res) && possibleEnd) + break; + result2.push(res); + } + return result2; + }; + DERNode.prototype._decodeStr = function decodeStr(buffer2, tag) { + if (tag === "bitstr") { + const unused = buffer2.readUInt8(); + if (buffer2.isError(unused)) + return unused; + return { + unused, + data: buffer2.raw() + }; + } else if (tag === "bmpstr") { + const raw = buffer2.raw(); + if (raw.length % 2 === 1) + return buffer2.error("Decoding of string type: bmpstr length mismatch"); + let str2 = ""; + for (let i7 = 0; i7 < raw.length / 2; i7++) { + str2 += String.fromCharCode(raw.readUInt16BE(i7 * 2)); + } + return str2; + } else if (tag === "numstr") { + const numstr = buffer2.raw().toString("ascii"); + if (!this._isNumstr(numstr)) { + return buffer2.error("Decoding of string type: numstr unsupported characters"); + } + return numstr; + } else if (tag === "octstr") { + return buffer2.raw(); + } else if (tag === "objDesc") { + return buffer2.raw(); + } else if (tag === "printstr") { + const printstr = buffer2.raw().toString("ascii"); + if (!this._isPrintstr(printstr)) { + return buffer2.error("Decoding of string type: printstr unsupported characters"); + } + return printstr; + } else if (/str$/.test(tag)) { + return buffer2.raw().toString(); + } else { + return buffer2.error("Decoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._decodeObjid = function decodeObjid(buffer2, values2, relative2) { + let result2; + const identifiers = []; + let ident = 0; + let subident = 0; + while (!buffer2.isEmpty()) { + subident = buffer2.readUInt8(); + ident <<= 7; + ident |= subident & 127; + if ((subident & 128) === 0) { + identifiers.push(ident); + ident = 0; + } + } + if (subident & 128) + identifiers.push(ident); + const first = identifiers[0] / 40 | 0; + const second = identifiers[0] % 40; + if (relative2) + result2 = identifiers; + else + result2 = [first, second].concat(identifiers.slice(1)); + if (values2) { + let tmp = values2[result2.join(" ")]; + if (tmp === void 0) + tmp = values2[result2.join(".")]; + if (tmp !== void 0) + result2 = tmp; + } + return result2; + }; + DERNode.prototype._decodeTime = function decodeTime(buffer2, tag) { + const str2 = buffer2.raw().toString(); + let year; + let mon; + let day; + let hour; + let min2; + let sec; + if (tag === "gentime") { + year = str2.slice(0, 4) | 0; + mon = str2.slice(4, 6) | 0; + day = str2.slice(6, 8) | 0; + hour = str2.slice(8, 10) | 0; + min2 = str2.slice(10, 12) | 0; + sec = str2.slice(12, 14) | 0; + } else if (tag === "utctime") { + year = str2.slice(0, 2) | 0; + mon = str2.slice(2, 4) | 0; + day = str2.slice(4, 6) | 0; + hour = str2.slice(6, 8) | 0; + min2 = str2.slice(8, 10) | 0; + sec = str2.slice(10, 12) | 0; + if (year < 70) + year = 2e3 + year; + else + year = 1900 + year; + } else { + return buffer2.error("Decoding " + tag + " time is not supported yet"); + } + return Date.UTC(year, mon - 1, day, hour, min2, sec, 0); + }; + DERNode.prototype._decodeNull = function decodeNull() { + return null; + }; + DERNode.prototype._decodeBool = function decodeBool(buffer2) { + const res = buffer2.readUInt8(); + if (buffer2.isError(res)) + return res; + else + return res !== 0; + }; + DERNode.prototype._decodeInt = function decodeInt(buffer2, values2) { + const raw = buffer2.raw(); + let res = new bignum(raw); + if (values2) + res = values2[res.toString(10)] || res; + return res; + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getDecoder("der").tree; + }; + function derDecodeTag(buf, fail2) { + let tag = buf.readUInt8(fail2); + if (buf.isError(tag)) + return tag; + const cls = der.tagClass[tag >> 6]; + const primitive = (tag & 32) === 0; + if ((tag & 31) === 31) { + let oct = tag; + tag = 0; + while ((oct & 128) === 128) { + oct = buf.readUInt8(fail2); + if (buf.isError(oct)) + return oct; + tag <<= 7; + tag |= oct & 127; + } + } else { + tag &= 31; + } + const tagStr = der.tag[tag]; + return { + cls, + primitive, + tag, + tagStr + }; + } + function derDecodeLen(buf, primitive, fail2) { + let len = buf.readUInt8(fail2); + if (buf.isError(len)) + return len; + if (!primitive && len === 128) + return null; + if ((len & 128) === 0) { + return len; + } + const num = len & 127; + if (num > 4) + return buf.error("length octect is too long"); + len = 0; + for (let i7 = 0; i7 < num; i7++) { + len <<= 8; + const j6 = buf.readUInt8(fail2); + if (buf.isError(j6)) + return j6; + len |= j6; + } + return len; + } + return exports$o$1; +} +function dew$n$1() { + if (_dewExec$n$1) + return exports$n$1; + _dewExec$n$1 = true; + const inherits2 = dew$f$2(); + const Buffer4 = dew$w$1().Buffer; + const DERDecoder = dew$o$1(); + function PEMDecoder(entity) { + DERDecoder.call(this, entity); + this.enc = "pem"; + } + inherits2(PEMDecoder, DERDecoder); + exports$n$1 = PEMDecoder; + PEMDecoder.prototype.decode = function decode2(data, options) { + const lines = data.toString().split(/[\r\n]+/g); + const label = options.label.toUpperCase(); + const re4 = /^-----(BEGIN|END) ([^-]+)-----$/; + let start = -1; + let end = -1; + for (let i7 = 0; i7 < lines.length; i7++) { + const match = lines[i7].match(re4); + if (match === null) + continue; + if (match[2] !== label) + continue; + if (start === -1) { + if (match[1] !== "BEGIN") + break; + start = i7; + } else { + if (match[1] !== "END") + break; + end = i7; + break; + } + } + if (start === -1 || end === -1) + throw new Error("PEM section not found for: " + label); + const base64 = lines.slice(start + 1, end).join(""); + base64.replace(/[^a-z0-9+/=]+/gi, ""); + const input = Buffer4.from(base64, "base64"); + return DERDecoder.prototype.decode.call(this, input, options); + }; + return exports$n$1; +} +function dew$m$1() { + if (_dewExec$m$1) + return exports$m$1; + _dewExec$m$1 = true; + const decoders = exports$m$1; + decoders.der = dew$o$1(); + decoders.pem = dew$n$1(); + return exports$m$1; +} +function dew$l$1() { + if (_dewExec$l$1) + return exports$l$1; + _dewExec$l$1 = true; + const encoders = dew$p$1(); + const decoders = dew$m$1(); + const inherits2 = dew$f$2(); + const api = exports$l$1; + api.define = function define2(name2, body) { + return new Entity(name2, body); + }; + function Entity(name2, body) { + this.name = name2; + this.body = body; + this.decoders = {}; + this.encoders = {}; + } + Entity.prototype._createNamed = function createNamed(Base2) { + const name2 = this.name; + function Generated(entity) { + this._initNamed(entity, name2); + } + inherits2(Generated, Base2); + Generated.prototype._initNamed = function _initNamed(entity, name3) { + Base2.call(this, entity, name3); + }; + return new Generated(this); + }; + Entity.prototype._getDecoder = function _getDecoder(enc) { + enc = enc || "der"; + if (!this.decoders.hasOwnProperty(enc)) + this.decoders[enc] = this._createNamed(decoders[enc]); + return this.decoders[enc]; + }; + Entity.prototype.decode = function decode2(data, enc, options) { + return this._getDecoder(enc).decode(data, options); + }; + Entity.prototype._getEncoder = function _getEncoder(enc) { + enc = enc || "der"; + if (!this.encoders.hasOwnProperty(enc)) + this.encoders[enc] = this._createNamed(encoders[enc]); + return this.encoders[enc]; + }; + Entity.prototype.encode = function encode2(data, enc, reporter) { + return this._getEncoder(enc).encode(data, reporter); + }; + return exports$l$1; +} +function dew$k$1() { + if (_dewExec$k$1) + return exports$k$1; + _dewExec$k$1 = true; + const base = exports$k$1; + base.Reporter = dew$v$1().Reporter; + base.DecoderBuffer = dew$u$1().DecoderBuffer; + base.EncoderBuffer = dew$u$1().EncoderBuffer; + base.Node = dew$t$1(); + return exports$k$1; +} +function dew$j$1() { + if (_dewExec$j$1) + return exports$j$1; + _dewExec$j$1 = true; + const constants5 = exports$j$1; + constants5._reverse = function reverse2(map4) { + const res = {}; + Object.keys(map4).forEach(function(key) { + if ((key | 0) == key) + key = key | 0; + const value2 = map4[key]; + res[value2] = key; + }); + return res; + }; + constants5.der = dew$s$1(); + return exports$j$1; +} +function dew$i$1() { + if (_dewExec$i$1) + return exports$i$1; + _dewExec$i$1 = true; + const asn1 = exports$i$1; + asn1.bignum = dew$x$1(); + asn1.define = dew$l$1().define; + asn1.base = dew$k$1(); + asn1.constants = dew$j$1(); + asn1.decoders = dew$m$1(); + asn1.encoders = dew$p$1(); + return exports$i$1; +} +function dew$h$1() { + if (_dewExec$h$1) + return exports$h$1; + _dewExec$h$1 = true; + var asn = dew$i$1(); + var Time = asn.define("Time", function() { + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }); + }); + var AttributeTypeValue = asn.define("AttributeTypeValue", function() { + this.seq().obj(this.key("type").objid(), this.key("value").any()); + }); + var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); + }); + var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", function() { + this.setof(AttributeTypeValue); + }); + var RDNSequence = asn.define("RDNSequence", function() { + this.seqof(RelativeDistinguishedName); + }); + var Name = asn.define("Name", function() { + this.choice({ + rdnSequence: this.use(RDNSequence) + }); + }); + var Validity = asn.define("Validity", function() { + this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time)); + }); + var Extension6 = asn.define("Extension", function() { + this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); + }); + var TBSCertificate = asn.define("TBSCertificate", function() { + this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension6).optional()); + }); + var X509Certificate = asn.define("X509Certificate", function() { + this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr()); + }); + exports$h$1 = X509Certificate; + return exports$h$1; +} +function dew$g$1() { + if (_dewExec$g$1) + return exports$g$1; + _dewExec$g$1 = true; + var asn1 = dew$i$1(); + exports$g$1.certificate = dew$h$1(); + var RSAPrivateKey = asn1.define("RSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int()); + }); + exports$g$1.RSAPrivateKey = RSAPrivateKey; + var RSAPublicKey = asn1.define("RSAPublicKey", function() { + this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int()); + }); + exports$g$1.RSAPublicKey = RSAPublicKey; + var PublicKey = asn1.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + exports$g$1.PublicKey = PublicKey; + var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional()); + }); + var PrivateKeyInfo = asn1.define("PrivateKeyInfo", function() { + this.seq().obj(this.key("version").int(), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr()); + }); + exports$g$1.PrivateKey = PrivateKeyInfo; + var EncryptedPrivateKeyInfo = asn1.define("EncryptedPrivateKeyInfo", function() { + this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); + }); + exports$g$1.EncryptedPrivateKey = EncryptedPrivateKeyInfo; + var DSAPrivateKey = asn1.define("DSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int()); + }); + exports$g$1.DSAPrivateKey = DSAPrivateKey; + exports$g$1.DSAparam = asn1.define("DSAparam", function() { + this.int(); + }); + var ECPrivateKey = asn1.define("ECPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr()); + }); + exports$g$1.ECPrivateKey = ECPrivateKey; + var ECParameters = asn1.define("ECParameters", function() { + this.choice({ + namedCurve: this.objid() + }); + }); + exports$g$1.signature = asn1.define("signature", function() { + this.seq().obj(this.key("r").int(), this.key("s").int()); + }); + return exports$g$1; +} +function dew$f$1() { + if (_dewExec$f$1) + return exports$f$1; + _dewExec$f$1 = true; + var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m; + var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; + var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m; + var evp = dew$18$1(); + var ciphers = dew$15$1(); + var Buffer4 = dew$1T().Buffer; + exports$f$1 = function(okey, password) { + var key = okey.toString(); + var match = key.match(findProc); + var decrypted; + if (!match) { + var match2 = key.match(fullRegex); + decrypted = Buffer4.from(match2[2].replace(/[\r\n]/g, ""), "base64"); + } else { + var suite = "aes" + match[1]; + var iv = Buffer4.from(match[2], "hex"); + var cipherText = Buffer4.from(match[3].replace(/[\r\n]/g, ""), "base64"); + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key; + var out = []; + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv); + out.push(cipher.update(cipherText)); + out.push(cipher.final()); + decrypted = Buffer4.concat(out); + } + var tag = key.match(startRegex)[1]; + return { + tag, + data: decrypted + }; + }; + return exports$f$1; +} +function dew$e$1() { + if (_dewExec$e$1) + return exports$e$1; + _dewExec$e$1 = true; + var asn1 = dew$g$1(); + var aesid = _aesid$1; + var fixProc = dew$f$1(); + var ciphers = dew$15$1(); + var compat = dew$1v(); + var Buffer4 = dew$1T().Buffer; + exports$e$1 = parseKeys; + function parseKeys(buffer2) { + var password; + if (typeof buffer2 === "object" && !Buffer4.isBuffer(buffer2)) { + password = buffer2.passphrase; + buffer2 = buffer2.key; + } + if (typeof buffer2 === "string") { + buffer2 = Buffer4.from(buffer2); + } + var stripped = fixProc(buffer2, password); + var type3 = stripped.tag; + var data = stripped.data; + var subtype, ndata; + switch (type3) { + case "CERTIFICATE": + ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo; + case "PUBLIC KEY": + if (!ndata) { + ndata = asn1.PublicKey.decode(data, "der"); + } + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der"); + case "1.2.840.10045.2.1": + ndata.subjectPrivateKey = ndata.subjectPublicKey; + return { + type: "ec", + data: ndata + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der"); + return { + type: "dsa", + data: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "ENCRYPTED PRIVATE KEY": + data = asn1.EncryptedPrivateKey.decode(data, "der"); + data = decrypt(data, password); + case "PRIVATE KEY": + ndata = asn1.PrivateKey.decode(data, "der"); + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der"); + case "1.2.840.10045.2.1": + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der"); + return { + type: "dsa", + params: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "RSA PUBLIC KEY": + return asn1.RSAPublicKey.decode(data, "der"); + case "RSA PRIVATE KEY": + return asn1.RSAPrivateKey.decode(data, "der"); + case "DSA PRIVATE KEY": + return { + type: "dsa", + params: asn1.DSAPrivateKey.decode(data, "der") + }; + case "EC PRIVATE KEY": + data = asn1.ECPrivateKey.decode(data, "der"); + return { + curve: data.parameters.value, + privateKey: data.privateKey + }; + default: + throw new Error("unknown key type " + type3); + } + } + parseKeys.signature = asn1.signature; + function decrypt(data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt; + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10); + var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")]; + var iv = data.algorithm.decrypt.cipher.iv; + var cipherText = data.subjectPrivateKey; + var keylen = parseInt(algo.split("-")[1], 10) / 8; + var key = compat.pbkdf2Sync(password, salt, iters, keylen, "sha1"); + var cipher = ciphers.createDecipheriv(algo, key, iv); + var out = []; + out.push(cipher.update(cipherText)); + out.push(cipher.final()); + return Buffer4.concat(out); + } + return exports$e$1; +} +function dew$d$1() { + if (_dewExec$d$1) + return exports$d$1; + _dewExec$d$1 = true; + var Buffer4 = dew$1T().Buffer; + var createHmac2 = dew$1C(); + var crt = dew$W$1(); + var EC = dew$y$1().ec; + var BN = dew$X$1(); + var parseKeys = dew$e$1(); + var curves = _curves$1; + function sign(hash, key, hashType, signType, tag) { + var priv = parseKeys(key); + if (priv.curve) { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") + throw new Error("wrong private key type"); + return ecSign(hash, priv); + } else if (priv.type === "dsa") { + if (signType !== "dsa") + throw new Error("wrong private key type"); + return dsaSign(hash, priv, hashType); + } else { + if (signType !== "rsa" && signType !== "ecdsa/rsa") + throw new Error("wrong private key type"); + } + hash = Buffer4.concat([tag, hash]); + var len = priv.modulus.byteLength(); + var pad2 = [0, 1]; + while (hash.length + pad2.length + 1 < len) + pad2.push(255); + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) + pad2.push(hash[i7]); + var out = crt(pad2, priv); + return out; + } + function ecSign(hash, priv) { + var curveId = curves[priv.curve.join(".")]; + if (!curveId) + throw new Error("unknown curve " + priv.curve.join(".")); + var curve = new EC(curveId); + var key = curve.keyFromPrivate(priv.privateKey); + var out = key.sign(hash); + return Buffer4.from(out.toDER()); + } + function dsaSign(hash, priv, algo) { + var x7 = priv.params.priv_key; + var p7 = priv.params.p; + var q5 = priv.params.q; + var g7 = priv.params.g; + var r8 = new BN(0); + var k6; + var H5 = bits2int(hash, q5).mod(q5); + var s7 = false; + var kv = getKey(x7, q5, hash, algo); + while (s7 === false) { + k6 = makeKey(q5, kv, algo); + r8 = makeR(g7, k6, p7, q5); + s7 = k6.invm(q5).imul(H5.add(x7.mul(r8))).mod(q5); + if (s7.cmpn(0) === 0) { + s7 = false; + r8 = new BN(0); + } + } + return toDER(r8, s7); + } + function toDER(r8, s7) { + r8 = r8.toArray(); + s7 = s7.toArray(); + if (r8[0] & 128) + r8 = [0].concat(r8); + if (s7[0] & 128) + s7 = [0].concat(s7); + var total = r8.length + s7.length + 4; + var res = [48, total, 2, r8.length]; + res = res.concat(r8, [2, s7.length], s7); + return Buffer4.from(res); + } + function getKey(x7, q5, hash, algo) { + x7 = Buffer4.from(x7.toArray()); + if (x7.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - x7.length); + x7 = Buffer4.concat([zeros, x7]); + } + var hlen = hash.length; + var hbits = bits2octets(hash, q5); + var v8 = Buffer4.alloc(hlen); + v8.fill(1); + var k6 = Buffer4.alloc(hlen); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([0])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([1])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + return { + k: k6, + v: v8 + }; + } + function bits2int(obits, q5) { + var bits = new BN(obits); + var shift = (obits.length << 3) - q5.bitLength(); + if (shift > 0) + bits.ishrn(shift); + return bits; + } + function bits2octets(bits, q5) { + bits = bits2int(bits, q5); + bits = bits.mod(q5); + var out = Buffer4.from(bits.toArray()); + if (out.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - out.length); + out = Buffer4.concat([zeros, out]); + } + return out; + } + function makeKey(q5, kv, algo) { + var t8; + var k6; + do { + t8 = Buffer4.alloc(0); + while (t8.length * 8 < q5.bitLength()) { + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + t8 = Buffer4.concat([t8, kv.v]); + } + k6 = bits2int(t8, q5); + kv.k = createHmac2(algo, kv.k).update(kv.v).update(Buffer4.from([0])).digest(); + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + } while (k6.cmp(q5) !== -1); + return k6; + } + function makeR(g7, k6, p7, q5) { + return g7.toRed(BN.mont(p7)).redPow(k6).fromRed().mod(q5); + } + exports$d$1 = sign; + exports$d$1.getKey = getKey; + exports$d$1.makeKey = makeKey; + return exports$d$1; +} +function dew$c$1() { + if (_dewExec$c$1) + return exports$c$1; + _dewExec$c$1 = true; + var Buffer4 = dew$1T().Buffer; + var BN = dew$X$1(); + var EC = dew$y$1().ec; + var parseKeys = dew$e$1(); + var curves = _curves$1; + function verify(sig, hash, key, signType, tag) { + var pub = parseKeys(key); + if (pub.type === "ec") { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") + throw new Error("wrong public key type"); + return ecVerify(sig, hash, pub); + } else if (pub.type === "dsa") { + if (signType !== "dsa") + throw new Error("wrong public key type"); + return dsaVerify(sig, hash, pub); + } else { + if (signType !== "rsa" && signType !== "ecdsa/rsa") + throw new Error("wrong public key type"); + } + hash = Buffer4.concat([tag, hash]); + var len = pub.modulus.byteLength(); + var pad2 = [1]; + var padNum = 0; + while (hash.length + pad2.length + 2 < len) { + pad2.push(255); + padNum++; + } + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) { + pad2.push(hash[i7]); + } + pad2 = Buffer4.from(pad2); + var red = BN.mont(pub.modulus); + sig = new BN(sig).toRed(red); + sig = sig.redPow(new BN(pub.publicExponent)); + sig = Buffer4.from(sig.fromRed().toArray()); + var out = padNum < 8 ? 1 : 0; + len = Math.min(sig.length, pad2.length); + if (sig.length !== pad2.length) + out = 1; + i7 = -1; + while (++i7 < len) + out |= sig[i7] ^ pad2[i7]; + return out === 0; + } + function ecVerify(sig, hash, pub) { + var curveId = curves[pub.data.algorithm.curve.join(".")]; + if (!curveId) + throw new Error("unknown curve " + pub.data.algorithm.curve.join(".")); + var curve = new EC(curveId); + var pubkey = pub.data.subjectPrivateKey.data; + return curve.verify(hash, sig, pubkey); + } + function dsaVerify(sig, hash, pub) { + var p7 = pub.data.p; + var q5 = pub.data.q; + var g7 = pub.data.g; + var y7 = pub.data.pub_key; + var unpacked = parseKeys.signature.decode(sig, "der"); + var s7 = unpacked.s; + var r8 = unpacked.r; + checkValue(s7, q5); + checkValue(r8, q5); + var montp = BN.mont(p7); + var w6 = s7.invm(q5); + var v8 = g7.toRed(montp).redPow(new BN(hash).mul(w6).mod(q5)).fromRed().mul(y7.toRed(montp).redPow(r8.mul(w6).mod(q5)).fromRed()).mod(p7).mod(q5); + return v8.cmp(r8) === 0; + } + function checkValue(b8, q5) { + if (b8.cmpn(0) <= 0) + throw new Error("invalid sig"); + if (b8.cmp(q5) >= q5) + throw new Error("invalid sig"); + } + exports$c$1 = verify; + return exports$c$1; +} +function dew$b$1() { + if (_dewExec$b$1) + return exports$b$1; + _dewExec$b$1 = true; + var Buffer4 = dew$1T().Buffer; + var createHash2 = dew$1F(); + var stream2 = dew$1V(); + var inherits2 = dew$f$2(); + var sign = dew$d$1(); + var verify = dew$c$1(); + var algorithms = _algorithms; + Object.keys(algorithms).forEach(function(key) { + algorithms[key].id = Buffer4.from(algorithms[key].id, "hex"); + algorithms[key.toLowerCase()] = algorithms[key]; + }); + function Sign2(algorithm) { + stream2.Writable.call(this || _global$4$1); + var data = algorithms[algorithm]; + if (!data) + throw new Error("Unknown message digest"); + (this || _global$4$1)._hashType = data.hash; + (this || _global$4$1)._hash = createHash2(data.hash); + (this || _global$4$1)._tag = data.id; + (this || _global$4$1)._signType = data.sign; + } + inherits2(Sign2, stream2.Writable); + Sign2.prototype._write = function _write(data, _6, done) { + (this || _global$4$1)._hash.update(data); + done(); + }; + Sign2.prototype.update = function update2(data, enc) { + if (typeof data === "string") + data = Buffer4.from(data, enc); + (this || _global$4$1)._hash.update(data); + return this || _global$4$1; + }; + Sign2.prototype.sign = function signMethod(key, enc) { + this.end(); + var hash = (this || _global$4$1)._hash.digest(); + var sig = sign(hash, key, (this || _global$4$1)._hashType, (this || _global$4$1)._signType, (this || _global$4$1)._tag); + return enc ? sig.toString(enc) : sig; + }; + function Verify2(algorithm) { + stream2.Writable.call(this || _global$4$1); + var data = algorithms[algorithm]; + if (!data) + throw new Error("Unknown message digest"); + (this || _global$4$1)._hash = createHash2(data.hash); + (this || _global$4$1)._tag = data.id; + (this || _global$4$1)._signType = data.sign; + } + inherits2(Verify2, stream2.Writable); + Verify2.prototype._write = function _write(data, _6, done) { + (this || _global$4$1)._hash.update(data); + done(); + }; + Verify2.prototype.update = function update2(data, enc) { + if (typeof data === "string") + data = Buffer4.from(data, enc); + (this || _global$4$1)._hash.update(data); + return this || _global$4$1; + }; + Verify2.prototype.verify = function verifyMethod(key, sig, enc) { + if (typeof sig === "string") + sig = Buffer4.from(sig, enc); + this.end(); + var hash = (this || _global$4$1)._hash.digest(); + return verify(sig, hash, key, (this || _global$4$1)._signType, (this || _global$4$1)._tag); + }; + function createSign2(algorithm) { + return new Sign2(algorithm); + } + function createVerify2(algorithm) { + return new Verify2(algorithm); + } + exports$b$1 = { + Sign: createSign2, + Verify: createVerify2, + createSign: createSign2, + createVerify: createVerify2 + }; + return exports$b$1; +} +function dew$a$1() { + if (_dewExec$a$1) + return module$1$1.exports; + _dewExec$a$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$3$1).negative = 0; + (this || _global$3$1).words = null; + (this || _global$3$1).length = 0; + (this || _global$3$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$3$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$3$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$3$1).words = [number & 67108863]; + (this || _global$3$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$3$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$3$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$3$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$3$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$3$1).words = [0]; + (this || _global$3$1).length = 1; + return this || _global$3$1; + } + (this || _global$3$1).length = Math.ceil(number.length / 3); + (this || _global$3$1).words = new Array((this || _global$3$1).length); + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + (this || _global$3$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$3$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$3$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$3$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$3$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$3$1).length = Math.ceil((number.length - start) / 6); + (this || _global$3$1).words = new Array((this || _global$3$1).length); + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + (this || _global$3$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$3$1).words = [0]; + (this || _global$3$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$3$1).words[0] + word < 67108864) { + (this || _global$3$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$3$1).words[0] + word < 67108864) { + (this || _global$3$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$3$1).length); + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + dest.words[i7] = (this || _global$3$1).words[i7]; + } + dest.length = (this || _global$3$1).length; + dest.negative = (this || _global$3$1).negative; + dest.red = (this || _global$3$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$3$1).length < size2) { + (this || _global$3$1).words[(this || _global$3$1).length++] = 0; + } + return this || _global$3$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$3$1).length > 1 && (this || _global$3$1).words[(this || _global$3$1).length - 1] === 0) { + (this || _global$3$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$3$1).length === 1 && (this || _global$3$1).words[0] === 0) { + (this || _global$3$1).negative = 0; + } + return this || _global$3$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$3$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + var w6 = (this || _global$3$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$3$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$3$1).words[0]; + if ((this || _global$3$1).length === 2) { + ret += (this || _global$3$1).words[1] * 67108864; + } else if ((this || _global$3$1).length === 3 && (this || _global$3$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$3$1).words[1] * 67108864; + } else if ((this || _global$3$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$3$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$3$1).words[(this || _global$3$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$3$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + var b8 = this._zeroBits((this || _global$3$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$3$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$3$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$3$1).negative ^= 1; + } + return this || _global$3$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$3$1).length < num.length) { + (this || _global$3$1).words[(this || _global$3$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$3$1).words[i7] = (this || _global$3$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$3$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$3$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$3$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$3$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$3$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3$1).words[i7] = (this || _global$3$1).words[i7] & num.words[i7]; + } + (this || _global$3$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$3$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$3$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$3$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$3$1).length > num.length) { + a7 = this || _global$3$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$3$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$3$1).words[i7] = a7.words[i7]; + } + } + (this || _global$3$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$3$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$3$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$3$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$3$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$3$1).words[i7] = ~(this || _global$3$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$3$1).words[i7] = ~(this || _global$3$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$3$1).words[off3] = (this || _global$3$1).words[off3] | 1 << wbit; + } else { + (this || _global$3$1).words[off3] = (this || _global$3$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$3$1).negative !== 0 && num.negative === 0) { + (this || _global$3$1).negative = 0; + r8 = this.isub(num); + (this || _global$3$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$3$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$3$1).length > num.length) { + a7 = this || _global$3$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$3$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$3$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$3$1).length = a7.length; + if (carry !== 0) { + (this || _global$3$1).words[(this || _global$3$1).length] = carry; + (this || _global$3$1).length++; + } else if (a7 !== (this || _global$3$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$3$1).words[i7] = a7.words[i7]; + } + } + return this || _global$3$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$3$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$3$1).negative !== 0) { + (this || _global$3$1).negative = 0; + res = num.sub(this || _global$3$1); + (this || _global$3$1).negative = 1; + return res; + } + if ((this || _global$3$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$3$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$3$1).negative !== 0) { + (this || _global$3$1).negative = 0; + this.iadd(num); + (this || _global$3$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$3$1).negative = 0; + (this || _global$3$1).length = 1; + (this || _global$3$1).words[0] = 0; + return this || _global$3$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$3$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$3$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$3$1).words[i7] = a7.words[i7]; + } + } + (this || _global$3$1).length = Math.max((this || _global$3$1).length, i7); + if (a7 !== (this || _global$3$1)) { + (this || _global$3$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$3$1).length + num.length; + if ((this || _global$3$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$3$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$3$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$3$1, num, out); + } else { + res = jumboMulTo(this || _global$3$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$3$1).x = x7; + (this || _global$3$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$3$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$3$1).length + num.length); + return jumboMulTo(this || _global$3$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$3$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3$1).length; i7++) { + var w6 = ((this || _global$3$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$3$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$3$1).words[i7] = carry; + (this || _global$3$1).length++; + } + return this || _global$3$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$3$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$3$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$3$1).length; i7++) { + var newCarry = (this || _global$3$1).words[i7] & carryMask; + var c7 = ((this || _global$3$1).words[i7] | 0) - newCarry << r8; + (this || _global$3$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$3$1).words[i7] = carry; + (this || _global$3$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$3$1).length - 1; i7 >= 0; i7--) { + (this || _global$3$1).words[i7 + s7] = (this || _global$3$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$3$1).words[i7] = 0; + } + (this || _global$3$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$3$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$3$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$3$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$3$1).length > s7) { + (this || _global$3$1).length -= s7; + for (i7 = 0; i7 < (this || _global$3$1).length; i7++) { + (this || _global$3$1).words[i7] = (this || _global$3$1).words[i7 + s7]; + } + } else { + (this || _global$3$1).words[0] = 0; + (this || _global$3$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$3$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$3$1).words[i7] | 0; + (this || _global$3$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$3$1).length === 0) { + (this || _global$3$1).words[0] = 0; + (this || _global$3$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$3$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3$1).length <= s7) + return false; + var w6 = (this || _global$3$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$3$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$3$1).length <= s7) { + return this || _global$3$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$3$1).length = Math.min(s7, (this || _global$3$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$3$1).words[(this || _global$3$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$3$1).negative !== 0) { + if ((this || _global$3$1).length === 1 && ((this || _global$3$1).words[0] | 0) < num) { + (this || _global$3$1).words[0] = num - ((this || _global$3$1).words[0] | 0); + (this || _global$3$1).negative = 0; + return this || _global$3$1; + } + (this || _global$3$1).negative = 0; + this.isubn(num); + (this || _global$3$1).negative = 1; + return this || _global$3$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$3$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$3$1).length && (this || _global$3$1).words[i7] >= 67108864; i7++) { + (this || _global$3$1).words[i7] -= 67108864; + if (i7 === (this || _global$3$1).length - 1) { + (this || _global$3$1).words[i7 + 1] = 1; + } else { + (this || _global$3$1).words[i7 + 1]++; + } + } + (this || _global$3$1).length = Math.max((this || _global$3$1).length, i7 + 1); + return this || _global$3$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$3$1).negative !== 0) { + (this || _global$3$1).negative = 0; + this.iaddn(num); + (this || _global$3$1).negative = 1; + return this || _global$3$1; + } + (this || _global$3$1).words[0] -= num; + if ((this || _global$3$1).length === 1 && (this || _global$3$1).words[0] < 0) { + (this || _global$3$1).words[0] = -(this || _global$3$1).words[0]; + (this || _global$3$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$3$1).length && (this || _global$3$1).words[i7] < 0; i7++) { + (this || _global$3$1).words[i7] += 67108864; + (this || _global$3$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$3$1).negative = 0; + return this || _global$3$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$3$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$3$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$3$1).length - shift; i7++) { + w6 = ((this || _global$3$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$3$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$3$1).length; i7++) { + w6 = -((this || _global$3$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$3$1).words[i7] = w6 & 67108863; + } + (this || _global$3$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$3$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$3$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$3$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$3$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$3$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$3$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$3$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$3$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$3$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$3$1).words[i7] | 0) + carry * 67108864; + (this || _global$3$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$3$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$3$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$3$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$3$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$3$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$3$1).words[s7] |= q5; + return this || _global$3$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$3$1).length; i7++) { + var w6 = (this || _global$3$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$3$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$3$1).words[i7] = carry; + (this || _global$3$1).length++; + } + return this || _global$3$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$3$1).length === 1 && (this || _global$3$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$3$1).negative !== 0 && !negative) + return -1; + if ((this || _global$3$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$3$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$3$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$3$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$3$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$3$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$3$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$3$1).length > num.length) + return 1; + if ((this || _global$3$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$3$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$3$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$3$1).red, "Already a number in reduction context"); + assert4((this || _global$3$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$3$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$3$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$3$1).red.convertFrom(this || _global$3$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$3$1).red = ctx; + return this || _global$3$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$3$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$3$1).red, "redAdd works only with red numbers"); + return (this || _global$3$1).red.add(this || _global$3$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$3$1).red, "redIAdd works only with red numbers"); + return (this || _global$3$1).red.iadd(this || _global$3$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$3$1).red, "redSub works only with red numbers"); + return (this || _global$3$1).red.sub(this || _global$3$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$3$1).red, "redISub works only with red numbers"); + return (this || _global$3$1).red.isub(this || _global$3$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$3$1).red, "redShl works only with red numbers"); + return (this || _global$3$1).red.shl(this || _global$3$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$3$1).red, "redMul works only with red numbers"); + (this || _global$3$1).red._verify2(this || _global$3$1, num); + return (this || _global$3$1).red.mul(this || _global$3$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$3$1).red, "redMul works only with red numbers"); + (this || _global$3$1).red._verify2(this || _global$3$1, num); + return (this || _global$3$1).red.imul(this || _global$3$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$3$1).red, "redSqr works only with red numbers"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.sqr(this || _global$3$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$3$1).red, "redISqr works only with red numbers"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.isqr(this || _global$3$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$3$1).red, "redSqrt works only with red numbers"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.sqrt(this || _global$3$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$3$1).red, "redInvm works only with red numbers"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.invm(this || _global$3$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$3$1).red, "redNeg works only with red numbers"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.neg(this || _global$3$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$3$1).red && !num.red, "redPow(normalNum)"); + (this || _global$3$1).red._verify1(this || _global$3$1); + return (this || _global$3$1).red.pow(this || _global$3$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$3$1).name = name2; + (this || _global$3$1).p = new BN(p7, 16); + (this || _global$3$1).n = (this || _global$3$1).p.bitLength(); + (this || _global$3$1).k = new BN(1).iushln((this || _global$3$1).n).isub((this || _global$3$1).p); + (this || _global$3$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$3$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$3$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$3$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$3$1).n); + var cmp = rlen < (this || _global$3$1).n ? -1 : r8.ucmp((this || _global$3$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$3$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$3$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$3$1).k); + }; + function K256() { + MPrime.call(this || _global$3$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$3$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$3$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$3$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$3$1).m = prime.p; + (this || _global$3$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$3$1).m = m7; + (this || _global$3$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$3$1).prime) + return (this || _global$3$1).prime.ireduce(a7)._forceRed(this || _global$3$1); + return a7.umod((this || _global$3$1).m)._forceRed(this || _global$3$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$3$1).m.sub(a7)._forceRed(this || _global$3$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$3$1).m) >= 0) { + res.isub((this || _global$3$1).m); + } + return res._forceRed(this || _global$3$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$3$1).m) >= 0) { + res.isub((this || _global$3$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3$1).m); + } + return res._forceRed(this || _global$3$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$3$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$3$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$3$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$3$1); + var nOne = one.redNeg(); + var lpow = (this || _global$3$1).m.subn(1).iushrn(1); + var z6 = (this || _global$3$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$3$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$3$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$3$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$3$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$3$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$3$1, m7); + (this || _global$3$1).shift = (this || _global$3$1).m.bitLength(); + if ((this || _global$3$1).shift % 26 !== 0) { + (this || _global$3$1).shift += 26 - (this || _global$3$1).shift % 26; + } + (this || _global$3$1).r = new BN(1).iushln((this || _global$3$1).shift); + (this || _global$3$1).r2 = this.imod((this || _global$3$1).r.sqr()); + (this || _global$3$1).rinv = (this || _global$3$1).r._invmp((this || _global$3$1).m); + (this || _global$3$1).minv = (this || _global$3$1).rinv.mul((this || _global$3$1).r).isubn(1).div((this || _global$3$1).m); + (this || _global$3$1).minv = (this || _global$3$1).minv.umod((this || _global$3$1).r); + (this || _global$3$1).minv = (this || _global$3$1).r.sub((this || _global$3$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$3$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$3$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$3$1).shift).mul((this || _global$3$1).minv).imaskn((this || _global$3$1).shift).mul((this || _global$3$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$3$1).shift); + var res = u7; + if (u7.cmp((this || _global$3$1).m) >= 0) { + res = u7.isub((this || _global$3$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3$1).m); + } + return res._forceRed(this || _global$3$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$3$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$3$1).shift).mul((this || _global$3$1).minv).imaskn((this || _global$3$1).shift).mul((this || _global$3$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$3$1).shift); + var res = u7; + if (u7.cmp((this || _global$3$1).m) >= 0) { + res = u7.isub((this || _global$3$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3$1).m); + } + return res._forceRed(this || _global$3$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$3$1).m).mul((this || _global$3$1).r2)); + return res._forceRed(this || _global$3$1); + }; + })(module$1$1, exports$a$1); + return module$1$1.exports; +} +function dew$9$1() { + if (_dewExec$9$1) + return exports$9$1; + _dewExec$9$1 = true; + var Buffer4 = e$1$1.Buffer; + var elliptic = dew$y$1(); + var BN = dew$a$1(); + exports$9$1 = function createECDH2(curve) { + return new ECDH(curve); + }; + var aliases = { + secp256k1: { + name: "secp256k1", + byteLength: 32 + }, + secp224r1: { + name: "p224", + byteLength: 28 + }, + prime256v1: { + name: "p256", + byteLength: 32 + }, + prime192v1: { + name: "p192", + byteLength: 24 + }, + ed25519: { + name: "ed25519", + byteLength: 32 + }, + secp384r1: { + name: "p384", + byteLength: 48 + }, + secp521r1: { + name: "p521", + byteLength: 66 + } + }; + aliases.p224 = aliases.secp224r1; + aliases.p256 = aliases.secp256r1 = aliases.prime256v1; + aliases.p192 = aliases.secp192r1 = aliases.prime192v1; + aliases.p384 = aliases.secp384r1; + aliases.p521 = aliases.secp521r1; + function ECDH(curve) { + (this || _global$2$1).curveType = aliases[curve]; + if (!(this || _global$2$1).curveType) { + (this || _global$2$1).curveType = { + name: curve + }; + } + (this || _global$2$1).curve = new elliptic.ec((this || _global$2$1).curveType.name); + (this || _global$2$1).keys = void 0; + } + ECDH.prototype.generateKeys = function(enc, format5) { + (this || _global$2$1).keys = (this || _global$2$1).curve.genKeyPair(); + return this.getPublicKey(enc, format5); + }; + ECDH.prototype.computeSecret = function(other, inenc, enc) { + inenc = inenc || "utf8"; + if (!Buffer4.isBuffer(other)) { + other = new Buffer4(other, inenc); + } + var otherPub = (this || _global$2$1).curve.keyFromPublic(other).getPublic(); + var out = otherPub.mul((this || _global$2$1).keys.getPrivate()).getX(); + return formatReturnValue(out, enc, (this || _global$2$1).curveType.byteLength); + }; + ECDH.prototype.getPublicKey = function(enc, format5) { + var key = (this || _global$2$1).keys.getPublic(format5 === "compressed", true); + if (format5 === "hybrid") { + if (key[key.length - 1] % 2) { + key[0] = 7; + } else { + key[0] = 6; + } + } + return formatReturnValue(key, enc); + }; + ECDH.prototype.getPrivateKey = function(enc) { + return formatReturnValue((this || _global$2$1).keys.getPrivate(), enc); + }; + ECDH.prototype.setPublicKey = function(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$2$1).keys._importPublic(pub); + return this || _global$2$1; + }; + ECDH.prototype.setPrivateKey = function(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + var _priv = new BN(priv); + _priv = _priv.toString(16); + (this || _global$2$1).keys = (this || _global$2$1).curve.genKeyPair(); + (this || _global$2$1).keys._importPrivate(_priv); + return this || _global$2$1; + }; + function formatReturnValue(bn, enc, len) { + if (!Array.isArray(bn)) { + bn = bn.toArray(); + } + var buf = new Buffer4(bn); + if (len && buf.length < len) { + var zeros = new Buffer4(len - buf.length); + zeros.fill(0); + buf = Buffer4.concat([zeros, buf]); + } + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$9$1; +} +function dew$8$1() { + if (_dewExec$8$1) + return exports$8$1; + _dewExec$8$1 = true; + var createHash2 = dew$1F(); + var Buffer4 = dew$1T().Buffer; + exports$8$1 = function(seed, len) { + var t8 = Buffer4.alloc(0); + var i7 = 0; + var c7; + while (t8.length < len) { + c7 = i2ops(i7++); + t8 = Buffer4.concat([t8, createHash2("sha1").update(seed).update(c7).digest()]); + } + return t8.slice(0, len); + }; + function i2ops(c7) { + var out = Buffer4.allocUnsafe(4); + out.writeUInt32BE(c7, 0); + return out; + } + return exports$8$1; +} +function dew$7$1() { + if (_dewExec$7$1) + return exports$7$1; + _dewExec$7$1 = true; + exports$7$1 = function xor2(a7, b8) { + var len = a7.length; + var i7 = -1; + while (++i7 < len) { + a7[i7] ^= b8[i7]; + } + return a7; + }; + return exports$7$1; +} +function dew$6$1() { + if (_dewExec$6$1) + return module$8.exports; + _dewExec$6$1 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$1$1).negative = 0; + (this || _global$1$1).words = null; + (this || _global$1$1).length = 0; + (this || _global$1$1).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = e$1$1.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$1$1).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$1$1).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$1$1).words = [number & 67108863]; + (this || _global$1$1).length = 1; + } else if (number < 4503599627370496) { + (this || _global$1$1).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$1$1).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$1$1).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$1$1).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$1$1).words = [0]; + (this || _global$1$1).length = 1; + return this || _global$1$1; + } + (this || _global$1$1).length = Math.ceil(number.length / 3); + (this || _global$1$1).words = new Array((this || _global$1$1).length); + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + (this || _global$1$1).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$1$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$1$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$1$1).words[j6] |= w6 << off3 & 67108863; + (this || _global$1$1).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$1$1).length = Math.ceil((number.length - start) / 6); + (this || _global$1$1).words = new Array((this || _global$1$1).length); + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + (this || _global$1$1).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$1$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$1$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$1$1).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$1$1).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$1$1).words = [0]; + (this || _global$1$1).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$1$1).words[0] + word < 67108864) { + (this || _global$1$1).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$1$1).words[0] + word < 67108864) { + (this || _global$1$1).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$1$1).length); + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + dest.words[i7] = (this || _global$1$1).words[i7]; + } + dest.length = (this || _global$1$1).length; + dest.negative = (this || _global$1$1).negative; + dest.red = (this || _global$1$1).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$1$1).length < size2) { + (this || _global$1$1).words[(this || _global$1$1).length++] = 0; + } + return this || _global$1$1; + }; + BN.prototype.strip = function strip() { + while ((this || _global$1$1).length > 1 && (this || _global$1$1).words[(this || _global$1$1).length - 1] === 0) { + (this || _global$1$1).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$1$1).length === 1 && (this || _global$1$1).words[0] === 0) { + (this || _global$1$1).negative = 0; + } + return this || _global$1$1; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$1$1).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + var w6 = (this || _global$1$1).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$1$1).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$1$1).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$1$1).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$1$1).words[0]; + if ((this || _global$1$1).length === 2) { + ret += (this || _global$1$1).words[1] * 67108864; + } else if ((this || _global$1$1).length === 3 && (this || _global$1$1).words[2] === 1) { + ret += 4503599627370496 + (this || _global$1$1).words[1] * 67108864; + } else if ((this || _global$1$1).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$1$1).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$1$1).words[(this || _global$1$1).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$1$1).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + var b8 = this._zeroBits((this || _global$1$1).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$1$1).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$1$1).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$1$1).negative ^= 1; + } + return this || _global$1$1; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$1$1).length < num.length) { + (this || _global$1$1).words[(this || _global$1$1).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$1$1).words[i7] = (this || _global$1$1).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$1$1).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$1$1); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$1$1); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$1$1).length > num.length) { + b8 = num; + } else { + b8 = this || _global$1$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$1$1).words[i7] = (this || _global$1$1).words[i7] & num.words[i7]; + } + (this || _global$1$1).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$1$1).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$1$1); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$1$1); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$1$1).length > num.length) { + a7 = this || _global$1$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$1; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$1$1).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$1$1) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$1$1).words[i7] = a7.words[i7]; + } + } + (this || _global$1$1).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$1$1).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$1$1); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$1$1).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$1$1); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$1$1).words[i7] = ~(this || _global$1$1).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$1$1).words[i7] = ~(this || _global$1$1).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$1$1).words[off3] = (this || _global$1$1).words[off3] | 1 << wbit; + } else { + (this || _global$1$1).words[off3] = (this || _global$1$1).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$1$1).negative !== 0 && num.negative === 0) { + (this || _global$1$1).negative = 0; + r8 = this.isub(num); + (this || _global$1$1).negative ^= 1; + return this._normSign(); + } else if ((this || _global$1$1).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$1$1).length > num.length) { + a7 = this || _global$1$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$1$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$1$1).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$1$1).length = a7.length; + if (carry !== 0) { + (this || _global$1$1).words[(this || _global$1$1).length] = carry; + (this || _global$1$1).length++; + } else if (a7 !== (this || _global$1$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$1$1).words[i7] = a7.words[i7]; + } + } + return this || _global$1$1; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$1$1).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$1$1).negative !== 0) { + (this || _global$1$1).negative = 0; + res = num.sub(this || _global$1$1); + (this || _global$1$1).negative = 1; + return res; + } + if ((this || _global$1$1).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$1$1); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$1$1).negative !== 0) { + (this || _global$1$1).negative = 0; + this.iadd(num); + (this || _global$1$1).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$1$1).negative = 0; + (this || _global$1$1).length = 1; + (this || _global$1$1).words[0] = 0; + return this || _global$1$1; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$1$1; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$1; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$1$1).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$1$1).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$1$1)) { + for (; i7 < a7.length; i7++) { + (this || _global$1$1).words[i7] = a7.words[i7]; + } + } + (this || _global$1$1).length = Math.max((this || _global$1$1).length, i7); + if (a7 !== (this || _global$1$1)) { + (this || _global$1$1).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$1$1).length + num.length; + if ((this || _global$1$1).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$1$1, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$1$1, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$1$1, num, out); + } else { + res = jumboMulTo(this || _global$1$1, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$1$1).x = x7; + (this || _global$1$1).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$1$1).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$1$1).length + num.length); + return jumboMulTo(this || _global$1$1, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$1$1); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$1$1).length; i7++) { + var w6 = ((this || _global$1$1).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$1$1).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$1$1).words[i7] = carry; + (this || _global$1$1).length++; + } + return this || _global$1$1; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$1$1); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$1$1; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$1$1).length; i7++) { + var newCarry = (this || _global$1$1).words[i7] & carryMask; + var c7 = ((this || _global$1$1).words[i7] | 0) - newCarry << r8; + (this || _global$1$1).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$1$1).words[i7] = carry; + (this || _global$1$1).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$1$1).length - 1; i7 >= 0; i7--) { + (this || _global$1$1).words[i7 + s7] = (this || _global$1$1).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$1$1).words[i7] = 0; + } + (this || _global$1$1).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$1$1).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$1$1).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$1$1).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$1$1).length > s7) { + (this || _global$1$1).length -= s7; + for (i7 = 0; i7 < (this || _global$1$1).length; i7++) { + (this || _global$1$1).words[i7] = (this || _global$1$1).words[i7 + s7]; + } + } else { + (this || _global$1$1).words[0] = 0; + (this || _global$1$1).length = 1; + } + var carry = 0; + for (i7 = (this || _global$1$1).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$1$1).words[i7] | 0; + (this || _global$1$1).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$1$1).length === 0) { + (this || _global$1$1).words[0] = 0; + (this || _global$1$1).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$1$1).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$1$1).length <= s7) + return false; + var w6 = (this || _global$1$1).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$1$1).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$1$1).length <= s7) { + return this || _global$1$1; + } + if (r8 !== 0) { + s7++; + } + (this || _global$1$1).length = Math.min(s7, (this || _global$1$1).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$1$1).words[(this || _global$1$1).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$1$1).negative !== 0) { + if ((this || _global$1$1).length === 1 && ((this || _global$1$1).words[0] | 0) < num) { + (this || _global$1$1).words[0] = num - ((this || _global$1$1).words[0] | 0); + (this || _global$1$1).negative = 0; + return this || _global$1$1; + } + (this || _global$1$1).negative = 0; + this.isubn(num); + (this || _global$1$1).negative = 1; + return this || _global$1$1; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$1$1).words[0] += num; + for (var i7 = 0; i7 < (this || _global$1$1).length && (this || _global$1$1).words[i7] >= 67108864; i7++) { + (this || _global$1$1).words[i7] -= 67108864; + if (i7 === (this || _global$1$1).length - 1) { + (this || _global$1$1).words[i7 + 1] = 1; + } else { + (this || _global$1$1).words[i7 + 1]++; + } + } + (this || _global$1$1).length = Math.max((this || _global$1$1).length, i7 + 1); + return this || _global$1$1; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$1$1).negative !== 0) { + (this || _global$1$1).negative = 0; + this.iaddn(num); + (this || _global$1$1).negative = 1; + return this || _global$1$1; + } + (this || _global$1$1).words[0] -= num; + if ((this || _global$1$1).length === 1 && (this || _global$1$1).words[0] < 0) { + (this || _global$1$1).words[0] = -(this || _global$1$1).words[0]; + (this || _global$1$1).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$1$1).length && (this || _global$1$1).words[i7] < 0; i7++) { + (this || _global$1$1).words[i7] += 67108864; + (this || _global$1$1).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$1$1).negative = 0; + return this || _global$1$1; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$1$1).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$1$1).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$1$1).length - shift; i7++) { + w6 = ((this || _global$1$1).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$1$1).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$1$1).length; i7++) { + w6 = -((this || _global$1$1).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$1$1).words[i7] = w6 & 67108863; + } + (this || _global$1$1).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$1$1).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$1$1).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$1$1).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$1$1).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$1$1).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$1$1 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$1$1).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$1$1).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$1$1).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$1$1).words[i7] | 0) + carry * 67108864; + (this || _global$1$1).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$1$1; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$1$1; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$1$1).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$1$1).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$1$1).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$1$1).length <= s7) { + this._expand(s7 + 1); + (this || _global$1$1).words[s7] |= q5; + return this || _global$1$1; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$1$1).length; i7++) { + var w6 = (this || _global$1$1).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$1$1).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$1$1).words[i7] = carry; + (this || _global$1$1).length++; + } + return this || _global$1$1; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$1$1).length === 1 && (this || _global$1$1).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$1$1).negative !== 0 && !negative) + return -1; + if ((this || _global$1$1).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$1$1).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$1$1).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$1$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$1$1).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$1$1).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$1$1).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$1$1).length > num.length) + return 1; + if ((this || _global$1$1).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$1$1).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$1$1).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$1$1).red, "Already a number in reduction context"); + assert4((this || _global$1$1).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$1$1)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$1$1).red, "fromRed works only with numbers in reduction context"); + return (this || _global$1$1).red.convertFrom(this || _global$1$1); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$1$1).red = ctx; + return this || _global$1$1; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$1$1).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$1$1).red, "redAdd works only with red numbers"); + return (this || _global$1$1).red.add(this || _global$1$1, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$1$1).red, "redIAdd works only with red numbers"); + return (this || _global$1$1).red.iadd(this || _global$1$1, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$1$1).red, "redSub works only with red numbers"); + return (this || _global$1$1).red.sub(this || _global$1$1, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$1$1).red, "redISub works only with red numbers"); + return (this || _global$1$1).red.isub(this || _global$1$1, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$1$1).red, "redShl works only with red numbers"); + return (this || _global$1$1).red.shl(this || _global$1$1, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$1$1).red, "redMul works only with red numbers"); + (this || _global$1$1).red._verify2(this || _global$1$1, num); + return (this || _global$1$1).red.mul(this || _global$1$1, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$1$1).red, "redMul works only with red numbers"); + (this || _global$1$1).red._verify2(this || _global$1$1, num); + return (this || _global$1$1).red.imul(this || _global$1$1, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$1$1).red, "redSqr works only with red numbers"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.sqr(this || _global$1$1); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$1$1).red, "redISqr works only with red numbers"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.isqr(this || _global$1$1); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$1$1).red, "redSqrt works only with red numbers"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.sqrt(this || _global$1$1); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$1$1).red, "redInvm works only with red numbers"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.invm(this || _global$1$1); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$1$1).red, "redNeg works only with red numbers"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.neg(this || _global$1$1); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$1$1).red && !num.red, "redPow(normalNum)"); + (this || _global$1$1).red._verify1(this || _global$1$1); + return (this || _global$1$1).red.pow(this || _global$1$1, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$1$1).name = name2; + (this || _global$1$1).p = new BN(p7, 16); + (this || _global$1$1).n = (this || _global$1$1).p.bitLength(); + (this || _global$1$1).k = new BN(1).iushln((this || _global$1$1).n).isub((this || _global$1$1).p); + (this || _global$1$1).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$1$1).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$1$1).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$1$1).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$1$1).n); + var cmp = rlen < (this || _global$1$1).n ? -1 : r8.ucmp((this || _global$1$1).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$1$1).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$1$1).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$1$1).k); + }; + function K256() { + MPrime.call(this || _global$1$1, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$1$1, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$1$1, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$1$1, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$1$1).m = prime.p; + (this || _global$1$1).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$1$1).m = m7; + (this || _global$1$1).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$1$1).prime) + return (this || _global$1$1).prime.ireduce(a7)._forceRed(this || _global$1$1); + return a7.umod((this || _global$1$1).m)._forceRed(this || _global$1$1); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$1$1).m.sub(a7)._forceRed(this || _global$1$1); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$1$1).m) >= 0) { + res.isub((this || _global$1$1).m); + } + return res._forceRed(this || _global$1$1); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$1$1).m) >= 0) { + res.isub((this || _global$1$1).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$1$1).m); + } + return res._forceRed(this || _global$1$1); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$1$1).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$1$1).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$1$1).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$1$1).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$1$1); + var nOne = one.redNeg(); + var lpow = (this || _global$1$1).m.subn(1).iushrn(1); + var z6 = (this || _global$1$1).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$1$1); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$1$1).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$1$1); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$1$1); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$1$1).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$1$1, m7); + (this || _global$1$1).shift = (this || _global$1$1).m.bitLength(); + if ((this || _global$1$1).shift % 26 !== 0) { + (this || _global$1$1).shift += 26 - (this || _global$1$1).shift % 26; + } + (this || _global$1$1).r = new BN(1).iushln((this || _global$1$1).shift); + (this || _global$1$1).r2 = this.imod((this || _global$1$1).r.sqr()); + (this || _global$1$1).rinv = (this || _global$1$1).r._invmp((this || _global$1$1).m); + (this || _global$1$1).minv = (this || _global$1$1).rinv.mul((this || _global$1$1).r).isubn(1).div((this || _global$1$1).m); + (this || _global$1$1).minv = (this || _global$1$1).minv.umod((this || _global$1$1).r); + (this || _global$1$1).minv = (this || _global$1$1).r.sub((this || _global$1$1).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$1$1).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$1$1).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$1$1).shift).mul((this || _global$1$1).minv).imaskn((this || _global$1$1).shift).mul((this || _global$1$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$1$1).shift); + var res = u7; + if (u7.cmp((this || _global$1$1).m) >= 0) { + res = u7.isub((this || _global$1$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$1$1).m); + } + return res._forceRed(this || _global$1$1); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$1$1); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$1$1).shift).mul((this || _global$1$1).minv).imaskn((this || _global$1$1).shift).mul((this || _global$1$1).m); + var u7 = t8.isub(c7).iushrn((this || _global$1$1).shift); + var res = u7; + if (u7.cmp((this || _global$1$1).m) >= 0) { + res = u7.isub((this || _global$1$1).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$1$1).m); + } + return res._forceRed(this || _global$1$1); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$1$1).m).mul((this || _global$1$1).r2)); + return res._forceRed(this || _global$1$1); + }; + })(module$8, exports$6$1); + return module$8.exports; +} +function dew$5$1() { + if (_dewExec$5$1) + return exports$5$1; + _dewExec$5$1 = true; + var BN = dew$6$1(); + var Buffer4 = dew$1T().Buffer; + function withPublic(paddedMsg, key) { + return Buffer4.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray()); + } + exports$5$1 = withPublic; + return exports$5$1; +} +function dew$4$1() { + if (_dewExec$4$1) + return exports$4$1; + _dewExec$4$1 = true; + var parseKeys = dew$e$1(); + var randomBytes2 = dew$1S(); + var createHash2 = dew$1F(); + var mgf = dew$8$1(); + var xor2 = dew$7$1(); + var BN = dew$6$1(); + var withPublic = dew$5$1(); + var crt = dew$W$1(); + var Buffer4 = dew$1T().Buffer; + exports$4$1 = function publicEncrypt2(publicKey, msg, reverse2) { + var padding; + if (publicKey.padding) { + padding = publicKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(publicKey); + var paddedMsg; + if (padding === 4) { + paddedMsg = oaep(key, msg); + } else if (padding === 1) { + paddedMsg = pkcs1(key, msg, reverse2); + } else if (padding === 3) { + paddedMsg = new BN(msg); + if (paddedMsg.cmp(key.modulus) >= 0) { + throw new Error("data too long for modulus"); + } + } else { + throw new Error("unknown padding"); + } + if (reverse2) { + return crt(paddedMsg, key); + } else { + return withPublic(paddedMsg, key); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var mLen = msg.length; + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + var hLen2 = 2 * hLen; + if (mLen > k6 - hLen2 - 2) { + throw new Error("message too long"); + } + var ps = Buffer4.alloc(k6 - mLen - hLen2 - 2); + var dblen = k6 - hLen - 1; + var seed = randomBytes2(hLen); + var maskedDb = xor2(Buffer4.concat([iHash, ps, Buffer4.alloc(1, 1), msg], dblen), mgf(seed, dblen)); + var maskedSeed = xor2(seed, mgf(maskedDb, hLen)); + return new BN(Buffer4.concat([Buffer4.alloc(1), maskedSeed, maskedDb], k6)); + } + function pkcs1(key, msg, reverse2) { + var mLen = msg.length; + var k6 = key.modulus.byteLength(); + if (mLen > k6 - 11) { + throw new Error("message too long"); + } + var ps; + if (reverse2) { + ps = Buffer4.alloc(k6 - mLen - 3, 255); + } else { + ps = nonZero(k6 - mLen - 3); + } + return new BN(Buffer4.concat([Buffer4.from([0, reverse2 ? 1 : 2]), ps, Buffer4.alloc(1), msg], k6)); + } + function nonZero(len) { + var out = Buffer4.allocUnsafe(len); + var i7 = 0; + var cache = randomBytes2(len * 2); + var cur = 0; + var num; + while (i7 < len) { + if (cur === cache.length) { + cache = randomBytes2(len * 2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i7++] = num; + } + } + return out; + } + return exports$4$1; +} +function dew$3$1() { + if (_dewExec$3$1) + return exports$3$1; + _dewExec$3$1 = true; + var parseKeys = dew$e$1(); + var mgf = dew$8$1(); + var xor2 = dew$7$1(); + var BN = dew$6$1(); + var crt = dew$W$1(); + var createHash2 = dew$1F(); + var withPublic = dew$5$1(); + var Buffer4 = dew$1T().Buffer; + exports$3$1 = function privateDecrypt2(privateKey, enc, reverse2) { + var padding; + if (privateKey.padding) { + padding = privateKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(privateKey); + var k6 = key.modulus.byteLength(); + if (enc.length > k6 || new BN(enc).cmp(key.modulus) >= 0) { + throw new Error("decryption error"); + } + var msg; + if (reverse2) { + msg = withPublic(new BN(enc), key); + } else { + msg = crt(enc, key); + } + var zBuffer = Buffer4.alloc(k6 - msg.length); + msg = Buffer4.concat([zBuffer, msg], k6); + if (padding === 4) { + return oaep(key, msg); + } else if (padding === 1) { + return pkcs1(key, msg, reverse2); + } else if (padding === 3) { + return msg; + } else { + throw new Error("unknown padding"); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + if (msg[0] !== 0) { + throw new Error("decryption error"); + } + var maskedSeed = msg.slice(1, hLen + 1); + var maskedDb = msg.slice(hLen + 1); + var seed = xor2(maskedSeed, mgf(maskedDb, hLen)); + var db = xor2(maskedDb, mgf(seed, k6 - hLen - 1)); + if (compare(iHash, db.slice(0, hLen))) { + throw new Error("decryption error"); + } + var i7 = hLen; + while (db[i7] === 0) { + i7++; + } + if (db[i7++] !== 1) { + throw new Error("decryption error"); + } + return db.slice(i7); + } + function pkcs1(key, msg, reverse2) { + var p1 = msg.slice(0, 2); + var i7 = 2; + var status = 0; + while (msg[i7++] !== 0) { + if (i7 >= msg.length) { + status++; + break; + } + } + var ps = msg.slice(2, i7 - 1); + if (p1.toString("hex") !== "0002" && !reverse2 || p1.toString("hex") !== "0001" && reverse2) { + status++; + } + if (ps.length < 8) { + status++; + } + if (status) { + throw new Error("decryption error"); + } + return msg.slice(i7); + } + function compare(a7, b8) { + a7 = Buffer4.from(a7); + b8 = Buffer4.from(b8); + var dif = 0; + var len = a7.length; + if (a7.length !== b8.length) { + dif++; + len = Math.min(a7.length, b8.length); + } + var i7 = -1; + while (++i7 < len) { + dif += a7[i7] ^ b8[i7]; + } + return dif; + } + return exports$3$1; +} +function dew$2$12() { + if (_dewExec$2$12) + return exports$2$12; + _dewExec$2$12 = true; + exports$2$12.publicEncrypt = dew$4$1(); + exports$2$12.privateDecrypt = dew$3$1(); + exports$2$12.privateEncrypt = function privateEncrypt2(key, buf) { + return exports$2$12.publicEncrypt(key, buf, true); + }; + exports$2$12.publicDecrypt = function publicDecrypt2(key, buf) { + return exports$2$12.privateDecrypt(key, buf, true); + }; + return exports$2$12; +} +function dew$1$12() { + if (_dewExec$1$12) + return exports$1$12; + _dewExec$1$12 = true; + var process5 = T$1; + function oldBrowser() { + throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); + } + var safeBuffer = dew$1T(); + var randombytes = dew$1S(); + var Buffer4 = safeBuffer.Buffer; + var kBufferMaxLength = safeBuffer.kMaxLength; + var crypto2 = _global$x.crypto || _global$x.msCrypto; + var kMaxUint32 = Math.pow(2, 32) - 1; + function assertOffset(offset, length) { + if (typeof offset !== "number" || offset !== offset) { + throw new TypeError("offset must be a number"); + } + if (offset > kMaxUint32 || offset < 0) { + throw new TypeError("offset must be a uint32"); + } + if (offset > kBufferMaxLength || offset > length) { + throw new RangeError("offset out of range"); + } + } + function assertSize(size2, offset, length) { + if (typeof size2 !== "number" || size2 !== size2) { + throw new TypeError("size must be a number"); + } + if (size2 > kMaxUint32 || size2 < 0) { + throw new TypeError("size must be a uint32"); + } + if (size2 + offset > length || size2 > kBufferMaxLength) { + throw new RangeError("buffer too small"); + } + } + if (crypto2 && crypto2.getRandomValues || !process5.browser) { + exports$1$12.randomFill = randomFill2; + exports$1$12.randomFillSync = randomFillSync2; + } else { + exports$1$12.randomFill = oldBrowser; + exports$1$12.randomFillSync = oldBrowser; + } + function randomFill2(buf, offset, size2, cb) { + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global$x.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + if (typeof offset === "function") { + cb = offset; + offset = 0; + size2 = buf.length; + } else if (typeof size2 === "function") { + cb = size2; + size2 = buf.length - offset; + } else if (typeof cb !== "function") { + throw new TypeError('"cb" argument must be a function'); + } + assertOffset(offset, buf.length); + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2, cb); + } + function actualFill(buf, offset, size2, cb) { + if (process5.browser) { + var ourBuf = buf.buffer; + var uint = new Uint8Array(ourBuf, offset, size2); + crypto2.getRandomValues(uint); + if (cb) { + process5.nextTick(function() { + cb(null, buf); + }); + return; + } + return buf; + } + if (cb) { + randombytes(size2, function(err, bytes2) { + if (err) { + return cb(err); + } + bytes2.copy(buf, offset); + cb(null, buf); + }); + return; + } + var bytes = randombytes(size2); + bytes.copy(buf, offset); + return buf; + } + function randomFillSync2(buf, offset, size2) { + if (typeof offset === "undefined") { + offset = 0; + } + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global$x.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + assertOffset(offset, buf.length); + if (size2 === void 0) + size2 = buf.length - offset; + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2); + } + return exports$1$12; +} +function dew$1U() { + if (_dewExec$1U) + return exports$1V; + _dewExec$1U = true; + exports$1V.randomBytes = exports$1V.rng = exports$1V.pseudoRandomBytes = exports$1V.prng = dew$1S(); + exports$1V.createHash = exports$1V.Hash = dew$1F(); + exports$1V.createHmac = exports$1V.Hmac = dew$1C(); + var algos = dew$1B(); + var algoKeys = Object.keys(algos); + var hashes = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(algoKeys); + exports$1V.getHashes = function() { + return hashes; + }; + var p7 = dew$1v(); + exports$1V.pbkdf2 = p7.pbkdf2; + exports$1V.pbkdf2Sync = p7.pbkdf2Sync; + var aes = dew$13$1(); + exports$1V.Cipher = aes.Cipher; + exports$1V.createCipher = aes.createCipher; + exports$1V.Cipheriv = aes.Cipheriv; + exports$1V.createCipheriv = aes.createCipheriv; + exports$1V.Decipher = aes.Decipher; + exports$1V.createDecipher = aes.createDecipher; + exports$1V.Decipheriv = aes.Decipheriv; + exports$1V.createDecipheriv = aes.createDecipheriv; + exports$1V.getCiphers = aes.getCiphers; + exports$1V.listCiphers = aes.listCiphers; + var dh = dew$Y$1(); + exports$1V.DiffieHellmanGroup = dh.DiffieHellmanGroup; + exports$1V.createDiffieHellmanGroup = dh.createDiffieHellmanGroup; + exports$1V.getDiffieHellman = dh.getDiffieHellman; + exports$1V.createDiffieHellman = dh.createDiffieHellman; + exports$1V.DiffieHellman = dh.DiffieHellman; + var sign = dew$b$1(); + exports$1V.createSign = sign.createSign; + exports$1V.Sign = sign.Sign; + exports$1V.createVerify = sign.createVerify; + exports$1V.Verify = sign.Verify; + exports$1V.createECDH = dew$9$1(); + var publicEncrypt2 = dew$2$12(); + exports$1V.publicEncrypt = publicEncrypt2.publicEncrypt; + exports$1V.privateEncrypt = publicEncrypt2.privateEncrypt; + exports$1V.publicDecrypt = publicEncrypt2.publicDecrypt; + exports$1V.privateDecrypt = publicEncrypt2.privateDecrypt; + var rf = dew$1$12(); + exports$1V.randomFill = rf.randomFill; + exports$1V.randomFillSync = rf.randomFillSync; + exports$1V.createCredentials = function() { + throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); + }; + exports$1V.constants = { + "DH_CHECK_P_NOT_SAFE_PRIME": 2, + "DH_CHECK_P_NOT_PRIME": 1, + "DH_UNABLE_TO_CHECK_GENERATOR": 4, + "DH_NOT_SUITABLE_GENERATOR": 8, + "NPN_ENABLED": 1, + "ALPN_ENABLED": 1, + "RSA_PKCS1_PADDING": 1, + "RSA_SSLV23_PADDING": 2, + "RSA_NO_PADDING": 3, + "RSA_PKCS1_OAEP_PADDING": 4, + "RSA_X931_PADDING": 5, + "RSA_PKCS1_PSS_PADDING": 6, + "POINT_CONVERSION_COMPRESSED": 2, + "POINT_CONVERSION_UNCOMPRESSED": 4, + "POINT_CONVERSION_HYBRID": 6 + }; + return exports$1V; +} +function dew$11$2() { + if (_dewExec$11$2) + return exports$12$2; + _dewExec$11$2 = true; + var r8; + exports$12$2 = function rand(len) { + if (!r8) + r8 = new Rand(null); + return r8.generate(len); + }; + function Rand(rand) { + (this || _global$a$2).rand = rand; + } + exports$12$2.Rand = Rand; + Rand.prototype.generate = function generate2(len) { + return this._rand(len); + }; + Rand.prototype._rand = function _rand(n7) { + if ((this || _global$a$2).rand.getBytes) + return (this || _global$a$2).rand.getBytes(n7); + var res = new Uint8Array(n7); + for (var i7 = 0; i7 < res.length; i7++) + res[i7] = (this || _global$a$2).rand.getByte(); + return res; + }; + if (typeof self === "object") { + if (self.crypto && self.crypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.crypto.getRandomValues(arr); + return arr; + }; + } else if (self.msCrypto && self.msCrypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.msCrypto.getRandomValues(arr); + return arr; + }; + } else if (typeof window === "object") { + Rand.prototype._rand = function() { + throw new Error("Not implemented yet"); + }; + } + } else { + try { + var crypto$1 = crypto; + if (typeof crypto$1.randomBytes !== "function") + throw new Error("Not supported"); + Rand.prototype._rand = function _rand(n7) { + return crypto$1.randomBytes(n7); + }; + } catch (e10) { + } + } + return exports$12$2; +} +function dew$10$2() { + if (_dewExec$10$2) + return exports$11$2; + _dewExec$10$2 = true; + var bn = dew$1W(); + var brorand = dew$11$2(); + function MillerRabin(rand) { + (this || _global$9$2).rand = rand || new brorand.Rand(); + } + exports$11$2 = MillerRabin; + MillerRabin.create = function create2(rand) { + return new MillerRabin(rand); + }; + MillerRabin.prototype._randbelow = function _randbelow(n7) { + var len = n7.bitLength(); + var min_bytes = Math.ceil(len / 8); + do + var a7 = new bn((this || _global$9$2).rand.generate(min_bytes)); + while (a7.cmp(n7) >= 0); + return a7; + }; + MillerRabin.prototype._randrange = function _randrange(start, stop) { + var size2 = stop.sub(start); + return start.add(this._randbelow(size2)); + }; + MillerRabin.prototype.test = function test(n7, k6, cb) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + var prime = true; + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + if (cb) + cb(a7); + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return false; + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) + return false; + } + return prime; + }; + MillerRabin.prototype.getDivisor = function getDivisor(n7, k6) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + var g7 = n7.gcd(a7); + if (g7.cmpn(1) !== 0) + return g7; + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return x7.fromRed().subn(1).gcd(n7); + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) { + x7 = x7.redSqr(); + return x7.fromRed().subn(1).gcd(n7); + } + } + return false; + }; + return exports$11$2; +} +function dew$$$2() { + if (_dewExec$$$2) + return exports$10$2; + _dewExec$$$2 = true; + var randomBytes2 = dew$2O(); + exports$10$2 = findPrime; + findPrime.simpleSieve = simpleSieve; + findPrime.fermatTest = fermatTest; + var BN = dew$1X(); + var TWENTYFOUR = new BN(24); + var MillerRabin = dew$10$2(); + var millerRabin = new MillerRabin(); + var ONE = new BN(1); + var TWO = new BN(2); + var FIVE = new BN(5); + new BN(16); + new BN(8); + var TEN = new BN(10); + var THREE = new BN(3); + new BN(7); + var ELEVEN = new BN(11); + var FOUR = new BN(4); + new BN(12); + var primes = null; + function _getPrimes() { + if (primes !== null) + return primes; + var limit = 1048576; + var res = []; + res[0] = 2; + for (var i7 = 1, k6 = 3; k6 < limit; k6 += 2) { + var sqrt = Math.ceil(Math.sqrt(k6)); + for (var j6 = 0; j6 < i7 && res[j6] <= sqrt; j6++) + if (k6 % res[j6] === 0) + break; + if (i7 !== j6 && res[j6] <= sqrt) + continue; + res[i7++] = k6; + } + primes = res; + return res; + } + function simpleSieve(p7) { + var primes2 = _getPrimes(); + for (var i7 = 0; i7 < primes2.length; i7++) + if (p7.modn(primes2[i7]) === 0) { + if (p7.cmpn(primes2[i7]) === 0) { + return true; + } else { + return false; + } + } + return true; + } + function fermatTest(p7) { + var red = BN.mont(p7); + return TWO.toRed(red).redPow(p7.subn(1)).fromRed().cmpn(1) === 0; + } + function findPrime(bits, gen) { + if (bits < 16) { + if (gen === 2 || gen === 5) { + return new BN([140, 123]); + } else { + return new BN([140, 39]); + } + } + gen = new BN(gen); + var num, n22; + while (true) { + num = new BN(randomBytes2(Math.ceil(bits / 8))); + while (num.bitLength() > bits) { + num.ishrn(1); + } + if (num.isEven()) { + num.iadd(ONE); + } + if (!num.testn(1)) { + num.iadd(TWO); + } + if (!gen.cmp(TWO)) { + while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { + num.iadd(FOUR); + } + } else if (!gen.cmp(FIVE)) { + while (num.mod(TEN).cmp(THREE)) { + num.iadd(FOUR); + } + } + n22 = num.shrn(1); + if (simpleSieve(n22) && simpleSieve(num) && fermatTest(n22) && fermatTest(num) && millerRabin.test(n22) && millerRabin.test(num)) { + return num; + } + } + } + return exports$10$2; +} +function dew$_$2() { + if (_dewExec$_$2) + return exports$$$2; + _dewExec$_$2 = true; + var Buffer4 = buffer.Buffer; + var BN = dew$1X(); + var MillerRabin = dew$10$2(); + var millerRabin = new MillerRabin(); + var TWENTYFOUR = new BN(24); + var ELEVEN = new BN(11); + var TEN = new BN(10); + var THREE = new BN(3); + var SEVEN = new BN(7); + var primes = dew$$$2(); + var randomBytes2 = dew$2O(); + exports$$$2 = DH; + function setPublicKey(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$8$2)._pub = new BN(pub); + return this || _global$8$2; + } + function setPrivateKey(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + (this || _global$8$2)._priv = new BN(priv); + return this || _global$8$2; + } + var primeCache = {}; + function checkPrime(prime, generator) { + var gen = generator.toString("hex"); + var hex = [gen, prime.toString(16)].join("_"); + if (hex in primeCache) { + return primeCache[hex]; + } + var error2 = 0; + if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) { + error2 += 1; + if (gen === "02" || gen === "05") { + error2 += 8; + } else { + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + if (!millerRabin.test(prime.shrn(1))) { + error2 += 2; + } + var rem; + switch (gen) { + case "02": + if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { + error2 += 8; + } + break; + case "05": + rem = prime.mod(TEN); + if (rem.cmp(THREE) && rem.cmp(SEVEN)) { + error2 += 8; + } + break; + default: + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + function DH(prime, generator, malleable) { + this.setGenerator(generator); + (this || _global$8$2).__prime = new BN(prime); + (this || _global$8$2)._prime = BN.mont((this || _global$8$2).__prime); + (this || _global$8$2)._primeLen = prime.length; + (this || _global$8$2)._pub = void 0; + (this || _global$8$2)._priv = void 0; + (this || _global$8$2)._primeCode = void 0; + if (malleable) { + (this || _global$8$2).setPublicKey = setPublicKey; + (this || _global$8$2).setPrivateKey = setPrivateKey; + } else { + (this || _global$8$2)._primeCode = 8; + } + } + Object.defineProperty(DH.prototype, "verifyError", { + enumerable: true, + get: function() { + if (typeof (this || _global$8$2)._primeCode !== "number") { + (this || _global$8$2)._primeCode = checkPrime((this || _global$8$2).__prime, (this || _global$8$2).__gen); + } + return (this || _global$8$2)._primeCode; + } + }); + DH.prototype.generateKeys = function() { + if (!(this || _global$8$2)._priv) { + (this || _global$8$2)._priv = new BN(randomBytes2((this || _global$8$2)._primeLen)); + } + (this || _global$8$2)._pub = (this || _global$8$2)._gen.toRed((this || _global$8$2)._prime).redPow((this || _global$8$2)._priv).fromRed(); + return this.getPublicKey(); + }; + DH.prototype.computeSecret = function(other) { + other = new BN(other); + other = other.toRed((this || _global$8$2)._prime); + var secret = other.redPow((this || _global$8$2)._priv).fromRed(); + var out = new Buffer4(secret.toArray()); + var prime = this.getPrime(); + if (out.length < prime.length) { + var front = new Buffer4(prime.length - out.length); + front.fill(0); + out = Buffer4.concat([front, out]); + } + return out; + }; + DH.prototype.getPublicKey = function getPublicKey(enc) { + return formatReturnValue((this || _global$8$2)._pub, enc); + }; + DH.prototype.getPrivateKey = function getPrivateKey(enc) { + return formatReturnValue((this || _global$8$2)._priv, enc); + }; + DH.prototype.getPrime = function(enc) { + return formatReturnValue((this || _global$8$2).__prime, enc); + }; + DH.prototype.getGenerator = function(enc) { + return formatReturnValue((this || _global$8$2)._gen, enc); + }; + DH.prototype.setGenerator = function(gen, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(gen)) { + gen = new Buffer4(gen, enc); + } + (this || _global$8$2).__gen = gen; + (this || _global$8$2)._gen = new BN(gen); + return this || _global$8$2; + }; + function formatReturnValue(bn, enc) { + var buf = new Buffer4(bn.toArray()); + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$$$2; +} +function dew$Z$2() { + if (_dewExec$Z$2) + return exports$_$2; + _dewExec$Z$2 = true; + var Buffer4 = buffer.Buffer; + var generatePrime = dew$$$2(); + var primes = _primes$2; + var DH = dew$_$2(); + function getDiffieHellman2(mod2) { + var prime = new Buffer4(primes[mod2].prime, "hex"); + var gen = new Buffer4(primes[mod2].gen, "hex"); + return new DH(prime, gen); + } + var ENCODINGS = { + "binary": true, + "hex": true, + "base64": true + }; + function createDiffieHellman2(prime, enc, generator, genc) { + if (Buffer4.isBuffer(enc) || ENCODINGS[enc] === void 0) { + return createDiffieHellman2(prime, "binary", enc, generator); + } + enc = enc || "binary"; + genc = genc || "binary"; + generator = generator || new Buffer4([2]); + if (!Buffer4.isBuffer(generator)) { + generator = new Buffer4(generator, genc); + } + if (typeof prime === "number") { + return new DH(generatePrime(prime, generator), generator, true); + } + if (!Buffer4.isBuffer(prime)) { + prime = new Buffer4(prime, enc); + } + return new DH(prime, generator, true); + } + exports$_$2.DiffieHellmanGroup = exports$_$2.createDiffieHellmanGroup = exports$_$2.getDiffieHellman = getDiffieHellman2; + exports$_$2.createDiffieHellman = exports$_$2.DiffieHellman = createDiffieHellman2; + return exports$_$2; +} +function dew$Y$2() { + if (_dewExec$Y$2) + return exports$Z$2; + _dewExec$Y$2 = true; + var buffer$1 = buffer; + var Buffer4 = buffer$1.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$Z$2 = buffer$1; + } else { + copyProps(buffer$1, exports$Z$2); + exports$Z$2.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer4.prototype); + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer$1.SlowBuffer(size2); + }; + return exports$Z$2; +} +function dew$X$2() { + if (_dewExec$X$2) + return module$4$2.exports; + _dewExec$X$2 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$7$2).negative = 0; + (this || _global$7$2).words = null; + (this || _global$7$2).length = 0; + (this || _global$7$2).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$7$2).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$7$2).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$7$2).words = [number & 67108863]; + (this || _global$7$2).length = 1; + } else if (number < 4503599627370496) { + (this || _global$7$2).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$7$2).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$7$2).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$7$2).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$7$2).words = [0]; + (this || _global$7$2).length = 1; + return this || _global$7$2; + } + (this || _global$7$2).length = Math.ceil(number.length / 3); + (this || _global$7$2).words = new Array((this || _global$7$2).length); + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + (this || _global$7$2).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$7$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$7$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$7$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$7$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 48 && c7 <= 57) { + return c7 - 48; + } else if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + assert4(false, "Invalid character in " + string2); + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$7$2).length = Math.ceil((number.length - start) / 6); + (this || _global$7$2).words = new Array((this || _global$7$2).length); + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + (this || _global$7$2).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$7$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$7$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$7$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$7$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this._strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var b8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + b8 = c7 - 49 + 10; + } else if (c7 >= 17) { + b8 = c7 - 17 + 10; + } else { + b8 = c7; + } + assert4(c7 >= 0 && b8 < mul, "Invalid character"); + r8 += b8; + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$7$2).words = [0]; + (this || _global$7$2).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$7$2).words[0] + word < 67108864) { + (this || _global$7$2).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$7$2).words[0] + word < 67108864) { + (this || _global$7$2).words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$7$2).length); + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + dest.words[i7] = (this || _global$7$2).words[i7]; + } + dest.length = (this || _global$7$2).length; + dest.negative = (this || _global$7$2).negative; + dest.red = (this || _global$7$2).red; + }; + function move(dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN.prototype._move = function _move(dest) { + move(dest, this || _global$7$2); + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$7$2).length < size2) { + (this || _global$7$2).words[(this || _global$7$2).length++] = 0; + } + return this || _global$7$2; + }; + BN.prototype._strip = function strip() { + while ((this || _global$7$2).length > 1 && (this || _global$7$2).words[(this || _global$7$2).length - 1] === 0) { + (this || _global$7$2).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$7$2).length === 1 && (this || _global$7$2).words[0] === 0) { + (this || _global$7$2).negative = 0; + } + return this || _global$7$2; + }; + if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { + try { + BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect2; + } catch (e10) { + BN.prototype.inspect = inspect2; + } + } else { + BN.prototype.inspect = inspect2; + } + function inspect2() { + return ((this || _global$7$2).red ? ""; + } + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + var w6 = (this || _global$7$2).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$7$2).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$7$2).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modrn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$7$2).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$7$2).words[0]; + if ((this || _global$7$2).length === 2) { + ret += (this || _global$7$2).words[1] * 67108864; + } else if ((this || _global$7$2).length === 3 && (this || _global$7$2).words[2] === 1) { + ret += 4503599627370496 + (this || _global$7$2).words[1] * 67108864; + } else if ((this || _global$7$2).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$7$2).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16, 2); + }; + if (Buffer4) { + BN.prototype.toBuffer = function toBuffer(endian, length) { + return this.toArrayLike(Buffer4, endian, length); + }; + } + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size2) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size2); + } + return new ArrayType(size2); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + this._strip(); + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + var res = allocate(ArrayType, reqLength); + var postfix = endian === "le" ? "LE" : "BE"; + this["_toArrayLike" + postfix](res, byteLength); + return res; + }; + BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { + var position = 0; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$7$2).length; i7++) { + var word = (this || _global$7$2).words[i7] << shift | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = word >> 8 & 255; + } + if (position < res.length) { + res[position++] = word >> 16 & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { + var position = res.length - 1; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$7$2).length; i7++) { + var word = (this || _global$7$2).words[i7] << shift | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = word >> 8 & 255; + } + if (position >= 0) { + res[position--] = word >> 16 & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$7$2).words[(this || _global$7$2).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$7$2).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = num.words[off3] >>> wbit & 1; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + var b8 = this._zeroBits((this || _global$7$2).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$7$2).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$7$2).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$7$2).negative ^= 1; + } + return this || _global$7$2; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$7$2).length < num.length) { + (this || _global$7$2).words[(this || _global$7$2).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$7$2).words[i7] = (this || _global$7$2).words[i7] | num.words[i7]; + } + return this._strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$7$2).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$7$2); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$7$2); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$7$2).length > num.length) { + b8 = num; + } else { + b8 = this || _global$7$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$7$2).words[i7] = (this || _global$7$2).words[i7] & num.words[i7]; + } + (this || _global$7$2).length = b8.length; + return this._strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$7$2).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$7$2); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$7$2); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$7$2).length > num.length) { + a7 = this || _global$7$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$7$2).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$7$2) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$7$2).words[i7] = a7.words[i7]; + } + } + (this || _global$7$2).length = a7.length; + return this._strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$7$2).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$7$2); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$7$2).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$7$2); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$7$2).words[i7] = ~(this || _global$7$2).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$7$2).words[i7] = ~(this || _global$7$2).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this._strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$7$2).words[off3] = (this || _global$7$2).words[off3] | 1 << wbit; + } else { + (this || _global$7$2).words[off3] = (this || _global$7$2).words[off3] & ~(1 << wbit); + } + return this._strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$7$2).negative !== 0 && num.negative === 0) { + (this || _global$7$2).negative = 0; + r8 = this.isub(num); + (this || _global$7$2).negative ^= 1; + return this._normSign(); + } else if ((this || _global$7$2).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$7$2).length > num.length) { + a7 = this || _global$7$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$7$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$7$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$7$2).length = a7.length; + if (carry !== 0) { + (this || _global$7$2).words[(this || _global$7$2).length] = carry; + (this || _global$7$2).length++; + } else if (a7 !== (this || _global$7$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$7$2).words[i7] = a7.words[i7]; + } + } + return this || _global$7$2; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$7$2).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$7$2).negative !== 0) { + (this || _global$7$2).negative = 0; + res = num.sub(this || _global$7$2); + (this || _global$7$2).negative = 1; + return res; + } + if ((this || _global$7$2).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$7$2); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$7$2).negative !== 0) { + (this || _global$7$2).negative = 0; + this.iadd(num); + (this || _global$7$2).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$7$2).negative = 0; + (this || _global$7$2).length = 1; + (this || _global$7$2).words[0] = 0; + return this || _global$7$2; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$7$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$7$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$7$2).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$7$2).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$7$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$7$2).words[i7] = a7.words[i7]; + } + } + (this || _global$7$2).length = Math.max((this || _global$7$2).length, i7); + if (a7 !== (this || _global$7$2)) { + (this || _global$7$2).negative = 1; + } + return this._strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$7$2).length + num.length; + if ((this || _global$7$2).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$7$2, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$7$2, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$7$2, num, out); + } else { + res = jumboMulTo(this || _global$7$2, num, out); + } + return res; + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$7$2).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$7$2).length + num.length); + return jumboMulTo(this || _global$7$2, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$7$2); + }; + BN.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$7$2).length; i7++) { + var w6 = ((this || _global$7$2).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$7$2).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$7$2).words[i7] = carry; + (this || _global$7$2).length++; + } + return isNegNum ? this.ineg() : this || _global$7$2; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$7$2); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$7$2; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$7$2).length; i7++) { + var newCarry = (this || _global$7$2).words[i7] & carryMask; + var c7 = ((this || _global$7$2).words[i7] | 0) - newCarry << r8; + (this || _global$7$2).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$7$2).words[i7] = carry; + (this || _global$7$2).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$7$2).length - 1; i7 >= 0; i7--) { + (this || _global$7$2).words[i7 + s7] = (this || _global$7$2).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$7$2).words[i7] = 0; + } + (this || _global$7$2).length += s7; + } + return this._strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$7$2).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$7$2).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$7$2).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$7$2).length > s7) { + (this || _global$7$2).length -= s7; + for (i7 = 0; i7 < (this || _global$7$2).length; i7++) { + (this || _global$7$2).words[i7] = (this || _global$7$2).words[i7 + s7]; + } + } else { + (this || _global$7$2).words[0] = 0; + (this || _global$7$2).length = 1; + } + var carry = 0; + for (i7 = (this || _global$7$2).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$7$2).words[i7] | 0; + (this || _global$7$2).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$7$2).length === 0) { + (this || _global$7$2).words[0] = 0; + (this || _global$7$2).length = 1; + } + return this._strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$7$2).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$7$2).length <= s7) + return false; + var w6 = (this || _global$7$2).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$7$2).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$7$2).length <= s7) { + return this || _global$7$2; + } + if (r8 !== 0) { + s7++; + } + (this || _global$7$2).length = Math.min(s7, (this || _global$7$2).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$7$2).words[(this || _global$7$2).length - 1] &= mask; + } + return this._strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$7$2).negative !== 0) { + if ((this || _global$7$2).length === 1 && ((this || _global$7$2).words[0] | 0) <= num) { + (this || _global$7$2).words[0] = num - ((this || _global$7$2).words[0] | 0); + (this || _global$7$2).negative = 0; + return this || _global$7$2; + } + (this || _global$7$2).negative = 0; + this.isubn(num); + (this || _global$7$2).negative = 1; + return this || _global$7$2; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$7$2).words[0] += num; + for (var i7 = 0; i7 < (this || _global$7$2).length && (this || _global$7$2).words[i7] >= 67108864; i7++) { + (this || _global$7$2).words[i7] -= 67108864; + if (i7 === (this || _global$7$2).length - 1) { + (this || _global$7$2).words[i7 + 1] = 1; + } else { + (this || _global$7$2).words[i7 + 1]++; + } + } + (this || _global$7$2).length = Math.max((this || _global$7$2).length, i7 + 1); + return this || _global$7$2; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$7$2).negative !== 0) { + (this || _global$7$2).negative = 0; + this.iaddn(num); + (this || _global$7$2).negative = 1; + return this || _global$7$2; + } + (this || _global$7$2).words[0] -= num; + if ((this || _global$7$2).length === 1 && (this || _global$7$2).words[0] < 0) { + (this || _global$7$2).words[0] = -(this || _global$7$2).words[0]; + (this || _global$7$2).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$7$2).length && (this || _global$7$2).words[i7] < 0; i7++) { + (this || _global$7$2).words[i7] += 67108864; + (this || _global$7$2).words[i7 + 1] -= 1; + } + } + return this._strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$7$2).negative = 0; + return this || _global$7$2; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$7$2).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$7$2).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$7$2).length - shift; i7++) { + w6 = ((this || _global$7$2).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$7$2).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this._strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$7$2).length; i7++) { + w6 = -((this || _global$7$2).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$7$2).words[i7] = w6 & 67108863; + } + (this || _global$7$2).negative = 1; + return this._strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$7$2).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5._strip(); + } + a7._strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$7$2).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$7$2).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$7$2).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$7$2).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$7$2 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modrn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modrn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$7$2).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$7$2).words[i7] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$7$2).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$7$2).words[i7] | 0) + carry * 67108864; + (this || _global$7$2).words[i7] = w6 / num | 0; + carry = w6 % num; + } + this._strip(); + return isNegNum ? this.ineg() : this || _global$7$2; + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$7$2; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$7$2; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$7$2).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$7$2).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$7$2).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$7$2).length <= s7) { + this._expand(s7 + 1); + (this || _global$7$2).words[s7] |= q5; + return this || _global$7$2; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$7$2).length; i7++) { + var w6 = (this || _global$7$2).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$7$2).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$7$2).words[i7] = carry; + (this || _global$7$2).length++; + } + return this || _global$7$2; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$7$2).length === 1 && (this || _global$7$2).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$7$2).negative !== 0 && !negative) + return -1; + if ((this || _global$7$2).negative === 0 && negative) + return 1; + this._strip(); + var res; + if ((this || _global$7$2).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$7$2).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$7$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$7$2).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$7$2).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$7$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$7$2).length > num.length) + return 1; + if ((this || _global$7$2).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$7$2).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$7$2).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$7$2).red, "Already a number in reduction context"); + assert4((this || _global$7$2).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$7$2)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$7$2).red, "fromRed works only with numbers in reduction context"); + return (this || _global$7$2).red.convertFrom(this || _global$7$2); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$7$2).red = ctx; + return this || _global$7$2; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$7$2).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$7$2).red, "redAdd works only with red numbers"); + return (this || _global$7$2).red.add(this || _global$7$2, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$7$2).red, "redIAdd works only with red numbers"); + return (this || _global$7$2).red.iadd(this || _global$7$2, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$7$2).red, "redSub works only with red numbers"); + return (this || _global$7$2).red.sub(this || _global$7$2, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$7$2).red, "redISub works only with red numbers"); + return (this || _global$7$2).red.isub(this || _global$7$2, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$7$2).red, "redShl works only with red numbers"); + return (this || _global$7$2).red.shl(this || _global$7$2, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$7$2).red, "redMul works only with red numbers"); + (this || _global$7$2).red._verify2(this || _global$7$2, num); + return (this || _global$7$2).red.mul(this || _global$7$2, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$7$2).red, "redMul works only with red numbers"); + (this || _global$7$2).red._verify2(this || _global$7$2, num); + return (this || _global$7$2).red.imul(this || _global$7$2, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$7$2).red, "redSqr works only with red numbers"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.sqr(this || _global$7$2); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$7$2).red, "redISqr works only with red numbers"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.isqr(this || _global$7$2); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$7$2).red, "redSqrt works only with red numbers"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.sqrt(this || _global$7$2); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$7$2).red, "redInvm works only with red numbers"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.invm(this || _global$7$2); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$7$2).red, "redNeg works only with red numbers"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.neg(this || _global$7$2); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$7$2).red && !num.red, "redPow(normalNum)"); + (this || _global$7$2).red._verify1(this || _global$7$2); + return (this || _global$7$2).red.pow(this || _global$7$2, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$7$2).name = name2; + (this || _global$7$2).p = new BN(p7, 16); + (this || _global$7$2).n = (this || _global$7$2).p.bitLength(); + (this || _global$7$2).k = new BN(1).iushln((this || _global$7$2).n).isub((this || _global$7$2).p); + (this || _global$7$2).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$7$2).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$7$2).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$7$2).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$7$2).n); + var cmp = rlen < (this || _global$7$2).n ? -1 : r8.ucmp((this || _global$7$2).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$7$2).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$7$2).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$7$2).k); + }; + function K256() { + MPrime.call(this || _global$7$2, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$7$2, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$7$2, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$7$2, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$7$2).m = prime.p; + (this || _global$7$2).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$7$2).m = m7; + (this || _global$7$2).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$7$2).prime) + return (this || _global$7$2).prime.ireduce(a7)._forceRed(this || _global$7$2); + move(a7, a7.umod((this || _global$7$2).m)._forceRed(this || _global$7$2)); + return a7; + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$7$2).m.sub(a7)._forceRed(this || _global$7$2); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$7$2).m) >= 0) { + res.isub((this || _global$7$2).m); + } + return res._forceRed(this || _global$7$2); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$7$2).m) >= 0) { + res.isub((this || _global$7$2).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$7$2).m); + } + return res._forceRed(this || _global$7$2); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$7$2).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$7$2).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$7$2).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$7$2).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$7$2); + var nOne = one.redNeg(); + var lpow = (this || _global$7$2).m.subn(1).iushrn(1); + var z6 = (this || _global$7$2).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$7$2); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$7$2).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$7$2); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$7$2); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$7$2).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$7$2, m7); + (this || _global$7$2).shift = (this || _global$7$2).m.bitLength(); + if ((this || _global$7$2).shift % 26 !== 0) { + (this || _global$7$2).shift += 26 - (this || _global$7$2).shift % 26; + } + (this || _global$7$2).r = new BN(1).iushln((this || _global$7$2).shift); + (this || _global$7$2).r2 = this.imod((this || _global$7$2).r.sqr()); + (this || _global$7$2).rinv = (this || _global$7$2).r._invmp((this || _global$7$2).m); + (this || _global$7$2).minv = (this || _global$7$2).rinv.mul((this || _global$7$2).r).isubn(1).div((this || _global$7$2).m); + (this || _global$7$2).minv = (this || _global$7$2).minv.umod((this || _global$7$2).r); + (this || _global$7$2).minv = (this || _global$7$2).r.sub((this || _global$7$2).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$7$2).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$7$2).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$7$2).shift).mul((this || _global$7$2).minv).imaskn((this || _global$7$2).shift).mul((this || _global$7$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$7$2).shift); + var res = u7; + if (u7.cmp((this || _global$7$2).m) >= 0) { + res = u7.isub((this || _global$7$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$7$2).m); + } + return res._forceRed(this || _global$7$2); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$7$2); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$7$2).shift).mul((this || _global$7$2).minv).imaskn((this || _global$7$2).shift).mul((this || _global$7$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$7$2).shift); + var res = u7; + if (u7.cmp((this || _global$7$2).m) >= 0) { + res = u7.isub((this || _global$7$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$7$2).m); + } + return res._forceRed(this || _global$7$2); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$7$2).m).mul((this || _global$7$2).r2)); + return res._forceRed(this || _global$7$2); + }; + })(module$4$2, exports$Y$2); + return module$4$2.exports; +} +function dew$W$2() { + if (_dewExec$W$2) + return exports$X$2; + _dewExec$W$2 = true; + var Buffer4 = buffer.Buffer; + var BN = dew$X$2(); + var randomBytes2 = dew$2O(); + function blind(priv) { + var r8 = getr(priv); + var blinder = r8.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed(); + return { + blinder, + unblinder: r8.invm(priv.modulus) + }; + } + function getr(priv) { + var len = priv.modulus.byteLength(); + var r8; + do { + r8 = new BN(randomBytes2(len)); + } while (r8.cmp(priv.modulus) >= 0 || !r8.umod(priv.prime1) || !r8.umod(priv.prime2)); + return r8; + } + function crt(msg, priv) { + var blinds = blind(priv); + var len = priv.modulus.byteLength(); + var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus); + var c1 = blinded.toRed(BN.mont(priv.prime1)); + var c22 = blinded.toRed(BN.mont(priv.prime2)); + var qinv = priv.coefficient; + var p7 = priv.prime1; + var q5 = priv.prime2; + var m1 = c1.redPow(priv.exponent1).fromRed(); + var m22 = c22.redPow(priv.exponent2).fromRed(); + var h8 = m1.isub(m22).imul(qinv).umod(p7).imul(q5); + return m22.iadd(h8).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer4, "be", len); + } + crt.getr = getr; + exports$X$2 = crt; + return exports$X$2; +} +function dew$V$2() { + if (_dewExec$V$2) + return module$3$2.exports; + _dewExec$V$2 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$6$2).negative = 0; + (this || _global$6$2).words = null; + (this || _global$6$2).length = 0; + (this || _global$6$2).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$6$2).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$6$2).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$6$2).words = [number & 67108863]; + (this || _global$6$2).length = 1; + } else if (number < 4503599627370496) { + (this || _global$6$2).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$6$2).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$6$2).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$6$2).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$6$2).words = [0]; + (this || _global$6$2).length = 1; + return this || _global$6$2; + } + (this || _global$6$2).length = Math.ceil(number.length / 3); + (this || _global$6$2).words = new Array((this || _global$6$2).length); + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + (this || _global$6$2).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$6$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$6$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$6$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$6$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$6$2).length = Math.ceil((number.length - start) / 6); + (this || _global$6$2).words = new Array((this || _global$6$2).length); + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + (this || _global$6$2).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$6$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$6$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$6$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$6$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$6$2).words = [0]; + (this || _global$6$2).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$6$2).words[0] + word < 67108864) { + (this || _global$6$2).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$6$2).words[0] + word < 67108864) { + (this || _global$6$2).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$6$2).length); + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + dest.words[i7] = (this || _global$6$2).words[i7]; + } + dest.length = (this || _global$6$2).length; + dest.negative = (this || _global$6$2).negative; + dest.red = (this || _global$6$2).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$6$2).length < size2) { + (this || _global$6$2).words[(this || _global$6$2).length++] = 0; + } + return this || _global$6$2; + }; + BN.prototype.strip = function strip() { + while ((this || _global$6$2).length > 1 && (this || _global$6$2).words[(this || _global$6$2).length - 1] === 0) { + (this || _global$6$2).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$6$2).length === 1 && (this || _global$6$2).words[0] === 0) { + (this || _global$6$2).negative = 0; + } + return this || _global$6$2; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$6$2).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + var w6 = (this || _global$6$2).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$6$2).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$6$2).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$6$2).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$6$2).words[0]; + if ((this || _global$6$2).length === 2) { + ret += (this || _global$6$2).words[1] * 67108864; + } else if ((this || _global$6$2).length === 3 && (this || _global$6$2).words[2] === 1) { + ret += 4503599627370496 + (this || _global$6$2).words[1] * 67108864; + } else if ((this || _global$6$2).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$6$2).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$6$2).words[(this || _global$6$2).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$6$2).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + var b8 = this._zeroBits((this || _global$6$2).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$6$2).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$6$2).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$6$2).negative ^= 1; + } + return this || _global$6$2; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$6$2).length < num.length) { + (this || _global$6$2).words[(this || _global$6$2).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$6$2).words[i7] = (this || _global$6$2).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$6$2).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$6$2); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$6$2); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$6$2).length > num.length) { + b8 = num; + } else { + b8 = this || _global$6$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$6$2).words[i7] = (this || _global$6$2).words[i7] & num.words[i7]; + } + (this || _global$6$2).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$6$2).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$6$2); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$6$2); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$6$2).length > num.length) { + a7 = this || _global$6$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$6$2).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$6$2) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$6$2).words[i7] = a7.words[i7]; + } + } + (this || _global$6$2).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$6$2).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$6$2); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$6$2).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$6$2); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$6$2).words[i7] = ~(this || _global$6$2).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$6$2).words[i7] = ~(this || _global$6$2).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$6$2).words[off3] = (this || _global$6$2).words[off3] | 1 << wbit; + } else { + (this || _global$6$2).words[off3] = (this || _global$6$2).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$6$2).negative !== 0 && num.negative === 0) { + (this || _global$6$2).negative = 0; + r8 = this.isub(num); + (this || _global$6$2).negative ^= 1; + return this._normSign(); + } else if ((this || _global$6$2).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$6$2).length > num.length) { + a7 = this || _global$6$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$6$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$6$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$6$2).length = a7.length; + if (carry !== 0) { + (this || _global$6$2).words[(this || _global$6$2).length] = carry; + (this || _global$6$2).length++; + } else if (a7 !== (this || _global$6$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$6$2).words[i7] = a7.words[i7]; + } + } + return this || _global$6$2; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$6$2).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$6$2).negative !== 0) { + (this || _global$6$2).negative = 0; + res = num.sub(this || _global$6$2); + (this || _global$6$2).negative = 1; + return res; + } + if ((this || _global$6$2).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$6$2); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$6$2).negative !== 0) { + (this || _global$6$2).negative = 0; + this.iadd(num); + (this || _global$6$2).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$6$2).negative = 0; + (this || _global$6$2).length = 1; + (this || _global$6$2).words[0] = 0; + return this || _global$6$2; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$6$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$6$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$6$2).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$6$2).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$6$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$6$2).words[i7] = a7.words[i7]; + } + } + (this || _global$6$2).length = Math.max((this || _global$6$2).length, i7); + if (a7 !== (this || _global$6$2)) { + (this || _global$6$2).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$6$2).length + num.length; + if ((this || _global$6$2).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$6$2, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$6$2, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$6$2, num, out); + } else { + res = jumboMulTo(this || _global$6$2, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$6$2).x = x7; + (this || _global$6$2).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$6$2).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$6$2).length + num.length); + return jumboMulTo(this || _global$6$2, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$6$2); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$6$2).length; i7++) { + var w6 = ((this || _global$6$2).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$6$2).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$6$2).words[i7] = carry; + (this || _global$6$2).length++; + } + return this || _global$6$2; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$6$2); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$6$2; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$6$2).length; i7++) { + var newCarry = (this || _global$6$2).words[i7] & carryMask; + var c7 = ((this || _global$6$2).words[i7] | 0) - newCarry << r8; + (this || _global$6$2).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$6$2).words[i7] = carry; + (this || _global$6$2).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$6$2).length - 1; i7 >= 0; i7--) { + (this || _global$6$2).words[i7 + s7] = (this || _global$6$2).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$6$2).words[i7] = 0; + } + (this || _global$6$2).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$6$2).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$6$2).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$6$2).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$6$2).length > s7) { + (this || _global$6$2).length -= s7; + for (i7 = 0; i7 < (this || _global$6$2).length; i7++) { + (this || _global$6$2).words[i7] = (this || _global$6$2).words[i7 + s7]; + } + } else { + (this || _global$6$2).words[0] = 0; + (this || _global$6$2).length = 1; + } + var carry = 0; + for (i7 = (this || _global$6$2).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$6$2).words[i7] | 0; + (this || _global$6$2).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$6$2).length === 0) { + (this || _global$6$2).words[0] = 0; + (this || _global$6$2).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$6$2).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$6$2).length <= s7) + return false; + var w6 = (this || _global$6$2).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$6$2).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$6$2).length <= s7) { + return this || _global$6$2; + } + if (r8 !== 0) { + s7++; + } + (this || _global$6$2).length = Math.min(s7, (this || _global$6$2).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$6$2).words[(this || _global$6$2).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$6$2).negative !== 0) { + if ((this || _global$6$2).length === 1 && ((this || _global$6$2).words[0] | 0) < num) { + (this || _global$6$2).words[0] = num - ((this || _global$6$2).words[0] | 0); + (this || _global$6$2).negative = 0; + return this || _global$6$2; + } + (this || _global$6$2).negative = 0; + this.isubn(num); + (this || _global$6$2).negative = 1; + return this || _global$6$2; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$6$2).words[0] += num; + for (var i7 = 0; i7 < (this || _global$6$2).length && (this || _global$6$2).words[i7] >= 67108864; i7++) { + (this || _global$6$2).words[i7] -= 67108864; + if (i7 === (this || _global$6$2).length - 1) { + (this || _global$6$2).words[i7 + 1] = 1; + } else { + (this || _global$6$2).words[i7 + 1]++; + } + } + (this || _global$6$2).length = Math.max((this || _global$6$2).length, i7 + 1); + return this || _global$6$2; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$6$2).negative !== 0) { + (this || _global$6$2).negative = 0; + this.iaddn(num); + (this || _global$6$2).negative = 1; + return this || _global$6$2; + } + (this || _global$6$2).words[0] -= num; + if ((this || _global$6$2).length === 1 && (this || _global$6$2).words[0] < 0) { + (this || _global$6$2).words[0] = -(this || _global$6$2).words[0]; + (this || _global$6$2).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$6$2).length && (this || _global$6$2).words[i7] < 0; i7++) { + (this || _global$6$2).words[i7] += 67108864; + (this || _global$6$2).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$6$2).negative = 0; + return this || _global$6$2; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$6$2).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$6$2).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$6$2).length - shift; i7++) { + w6 = ((this || _global$6$2).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$6$2).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$6$2).length; i7++) { + w6 = -((this || _global$6$2).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$6$2).words[i7] = w6 & 67108863; + } + (this || _global$6$2).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$6$2).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$6$2).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$6$2).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$6$2).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$6$2).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$6$2 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$6$2).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$6$2).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$6$2).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$6$2).words[i7] | 0) + carry * 67108864; + (this || _global$6$2).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$6$2; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$6$2; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$6$2).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$6$2).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$6$2).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$6$2).length <= s7) { + this._expand(s7 + 1); + (this || _global$6$2).words[s7] |= q5; + return this || _global$6$2; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$6$2).length; i7++) { + var w6 = (this || _global$6$2).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$6$2).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$6$2).words[i7] = carry; + (this || _global$6$2).length++; + } + return this || _global$6$2; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$6$2).length === 1 && (this || _global$6$2).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$6$2).negative !== 0 && !negative) + return -1; + if ((this || _global$6$2).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$6$2).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$6$2).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$6$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$6$2).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$6$2).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$6$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$6$2).length > num.length) + return 1; + if ((this || _global$6$2).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$6$2).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$6$2).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$6$2).red, "Already a number in reduction context"); + assert4((this || _global$6$2).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$6$2)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$6$2).red, "fromRed works only with numbers in reduction context"); + return (this || _global$6$2).red.convertFrom(this || _global$6$2); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$6$2).red = ctx; + return this || _global$6$2; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$6$2).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$6$2).red, "redAdd works only with red numbers"); + return (this || _global$6$2).red.add(this || _global$6$2, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$6$2).red, "redIAdd works only with red numbers"); + return (this || _global$6$2).red.iadd(this || _global$6$2, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$6$2).red, "redSub works only with red numbers"); + return (this || _global$6$2).red.sub(this || _global$6$2, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$6$2).red, "redISub works only with red numbers"); + return (this || _global$6$2).red.isub(this || _global$6$2, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$6$2).red, "redShl works only with red numbers"); + return (this || _global$6$2).red.shl(this || _global$6$2, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$6$2).red, "redMul works only with red numbers"); + (this || _global$6$2).red._verify2(this || _global$6$2, num); + return (this || _global$6$2).red.mul(this || _global$6$2, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$6$2).red, "redMul works only with red numbers"); + (this || _global$6$2).red._verify2(this || _global$6$2, num); + return (this || _global$6$2).red.imul(this || _global$6$2, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$6$2).red, "redSqr works only with red numbers"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.sqr(this || _global$6$2); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$6$2).red, "redISqr works only with red numbers"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.isqr(this || _global$6$2); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$6$2).red, "redSqrt works only with red numbers"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.sqrt(this || _global$6$2); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$6$2).red, "redInvm works only with red numbers"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.invm(this || _global$6$2); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$6$2).red, "redNeg works only with red numbers"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.neg(this || _global$6$2); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$6$2).red && !num.red, "redPow(normalNum)"); + (this || _global$6$2).red._verify1(this || _global$6$2); + return (this || _global$6$2).red.pow(this || _global$6$2, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$6$2).name = name2; + (this || _global$6$2).p = new BN(p7, 16); + (this || _global$6$2).n = (this || _global$6$2).p.bitLength(); + (this || _global$6$2).k = new BN(1).iushln((this || _global$6$2).n).isub((this || _global$6$2).p); + (this || _global$6$2).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$6$2).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$6$2).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$6$2).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$6$2).n); + var cmp = rlen < (this || _global$6$2).n ? -1 : r8.ucmp((this || _global$6$2).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$6$2).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$6$2).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$6$2).k); + }; + function K256() { + MPrime.call(this || _global$6$2, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$6$2, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$6$2, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$6$2, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$6$2).m = prime.p; + (this || _global$6$2).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$6$2).m = m7; + (this || _global$6$2).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$6$2).prime) + return (this || _global$6$2).prime.ireduce(a7)._forceRed(this || _global$6$2); + return a7.umod((this || _global$6$2).m)._forceRed(this || _global$6$2); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$6$2).m.sub(a7)._forceRed(this || _global$6$2); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$6$2).m) >= 0) { + res.isub((this || _global$6$2).m); + } + return res._forceRed(this || _global$6$2); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$6$2).m) >= 0) { + res.isub((this || _global$6$2).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$6$2).m); + } + return res._forceRed(this || _global$6$2); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$6$2).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$6$2).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$6$2).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$6$2).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$6$2); + var nOne = one.redNeg(); + var lpow = (this || _global$6$2).m.subn(1).iushrn(1); + var z6 = (this || _global$6$2).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$6$2); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$6$2).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$6$2); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$6$2); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$6$2).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$6$2, m7); + (this || _global$6$2).shift = (this || _global$6$2).m.bitLength(); + if ((this || _global$6$2).shift % 26 !== 0) { + (this || _global$6$2).shift += 26 - (this || _global$6$2).shift % 26; + } + (this || _global$6$2).r = new BN(1).iushln((this || _global$6$2).shift); + (this || _global$6$2).r2 = this.imod((this || _global$6$2).r.sqr()); + (this || _global$6$2).rinv = (this || _global$6$2).r._invmp((this || _global$6$2).m); + (this || _global$6$2).minv = (this || _global$6$2).rinv.mul((this || _global$6$2).r).isubn(1).div((this || _global$6$2).m); + (this || _global$6$2).minv = (this || _global$6$2).minv.umod((this || _global$6$2).r); + (this || _global$6$2).minv = (this || _global$6$2).r.sub((this || _global$6$2).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$6$2).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$6$2).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$6$2).shift).mul((this || _global$6$2).minv).imaskn((this || _global$6$2).shift).mul((this || _global$6$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$6$2).shift); + var res = u7; + if (u7.cmp((this || _global$6$2).m) >= 0) { + res = u7.isub((this || _global$6$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$6$2).m); + } + return res._forceRed(this || _global$6$2); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$6$2); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$6$2).shift).mul((this || _global$6$2).minv).imaskn((this || _global$6$2).shift).mul((this || _global$6$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$6$2).shift); + var res = u7; + if (u7.cmp((this || _global$6$2).m) >= 0) { + res = u7.isub((this || _global$6$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$6$2).m); + } + return res._forceRed(this || _global$6$2); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$6$2).m).mul((this || _global$6$2).r2)); + return res._forceRed(this || _global$6$2); + }; + })(module$3$2, exports$W$2); + return module$3$2.exports; +} +function dew$U$2() { + if (_dewExec$U$2) + return exports$V$2; + _dewExec$U$2 = true; + var utils = exports$V$2; + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg !== "string") { + for (var i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + return res; + } + if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (var i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } else { + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + var hi = c7 >> 8; + var lo = c7 & 255; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } + return res; + } + utils.toArray = toArray3; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + utils.zero2 = zero2; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + utils.toHex = toHex; + utils.encode = function encode2(arr, enc) { + if (enc === "hex") + return toHex(arr); + else + return arr; + }; + return exports$V$2; +} +function dew$T$2() { + if (_dewExec$T$2) + return exports$U$2; + _dewExec$T$2 = true; + var utils = exports$U$2; + var BN = dew$V$2(); + var minAssert = dew$2m(); + var minUtils = dew$U$2(); + utils.assert = minAssert; + utils.toArray = minUtils.toArray; + utils.zero2 = minUtils.zero2; + utils.toHex = minUtils.toHex; + utils.encode = minUtils.encode; + function getNAF(num, w6, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + naf.fill(0); + var ws = 1 << w6 + 1; + var k6 = num.clone(); + for (var i7 = 0; i7 < naf.length; i7++) { + var z6; + var mod2 = k6.andln(ws - 1); + if (k6.isOdd()) { + if (mod2 > (ws >> 1) - 1) + z6 = (ws >> 1) - mod2; + else + z6 = mod2; + k6.isubn(z6); + } else { + z6 = 0; + } + naf[i7] = z6; + k6.iushrn(1); + } + return naf; + } + utils.getNAF = getNAF; + function getJSF(k1, k22) { + var jsf = [[], []]; + k1 = k1.clone(); + k22 = k22.clone(); + var d1 = 0; + var d22 = 0; + var m8; + while (k1.cmpn(-d1) > 0 || k22.cmpn(-d22) > 0) { + var m14 = k1.andln(3) + d1 & 3; + var m24 = k22.andln(3) + d22 & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + m8 = k1.andln(7) + d1 & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + var u22; + if ((m24 & 1) === 0) { + u22 = 0; + } else { + m8 = k22.andln(7) + d22 & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u22 = -m24; + else + u22 = m24; + } + jsf[1].push(u22); + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d22 === u22 + 1) + d22 = 1 - d22; + k1.iushrn(1); + k22.iushrn(1); + } + return jsf; + } + utils.getJSF = getJSF; + function cachedProperty(obj, name2, computer) { + var key = "_" + name2; + obj.prototype[name2] = function cachedProperty2() { + return this[key] !== void 0 ? this[key] : this[key] = computer.call(this); + }; + } + utils.cachedProperty = cachedProperty; + function parseBytes(bytes) { + return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes; + } + utils.parseBytes = parseBytes; + function intFromLE(bytes) { + return new BN(bytes, "hex", "le"); + } + utils.intFromLE = intFromLE; + return exports$U$2; +} +function dew$S$2() { + if (_dewExec$S$2) + return exports$T$2; + _dewExec$S$2 = true; + var BN = dew$V$2(); + var utils = dew$T$2(); + var getNAF = utils.getNAF; + var getJSF = utils.getJSF; + var assert4 = utils.assert; + function BaseCurve(type3, conf) { + this.type = type3; + this.p = new BN(conf.p, 16); + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + this._bitLength = this.n ? this.n.bitLength() : 0; + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } + } + exports$T$2 = BaseCurve; + BaseCurve.prototype.point = function point() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype.validate = function validate15() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p7, k6) { + assert4(p7.precomputed); + var doubles = p7._getDoubles(); + var naf = getNAF(k6, 1, this._bitLength); + var I6 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); + I6 /= 3; + var repr = []; + var j6; + var nafW; + for (j6 = 0; j6 < naf.length; j6 += doubles.step) { + nafW = 0; + for (var l7 = j6 + doubles.step - 1; l7 >= j6; l7--) + nafW = (nafW << 1) + naf[l7]; + repr.push(nafW); + } + var a7 = this.jpoint(null, null, null); + var b8 = this.jpoint(null, null, null); + for (var i7 = I6; i7 > 0; i7--) { + for (j6 = 0; j6 < repr.length; j6++) { + nafW = repr[j6]; + if (nafW === i7) + b8 = b8.mixedAdd(doubles.points[j6]); + else if (nafW === -i7) + b8 = b8.mixedAdd(doubles.points[j6].neg()); + } + a7 = a7.add(b8); + } + return a7.toP(); + }; + BaseCurve.prototype._wnafMul = function _wnafMul(p7, k6) { + var w6 = 4; + var nafPoints = p7._getNAFPoints(w6); + w6 = nafPoints.wnd; + var wnd = nafPoints.points; + var naf = getNAF(k6, w6, this._bitLength); + var acc = this.jpoint(null, null, null); + for (var i7 = naf.length - 1; i7 >= 0; i7--) { + for (var l7 = 0; i7 >= 0 && naf[i7] === 0; i7--) + l7++; + if (i7 >= 0) + l7++; + acc = acc.dblp(l7); + if (i7 < 0) + break; + var z6 = naf[i7]; + assert4(z6 !== 0); + if (p7.type === "affine") { + if (z6 > 0) + acc = acc.mixedAdd(wnd[z6 - 1 >> 1]); + else + acc = acc.mixedAdd(wnd[-z6 - 1 >> 1].neg()); + } else { + if (z6 > 0) + acc = acc.add(wnd[z6 - 1 >> 1]); + else + acc = acc.add(wnd[-z6 - 1 >> 1].neg()); + } + } + return p7.type === "affine" ? acc.toP() : acc; + }; + BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + var max2 = 0; + var i7; + var j6; + var p7; + for (i7 = 0; i7 < len; i7++) { + p7 = points[i7]; + var nafPoints = p7._getNAFPoints(defW); + wndWidth[i7] = nafPoints.wnd; + wnd[i7] = nafPoints.points; + } + for (i7 = len - 1; i7 >= 1; i7 -= 2) { + var a7 = i7 - 1; + var b8 = i7; + if (wndWidth[a7] !== 1 || wndWidth[b8] !== 1) { + naf[a7] = getNAF(coeffs[a7], wndWidth[a7], this._bitLength); + naf[b8] = getNAF(coeffs[b8], wndWidth[b8], this._bitLength); + max2 = Math.max(naf[a7].length, max2); + max2 = Math.max(naf[b8].length, max2); + continue; + } + var comb = [ + points[a7], + /* 1 */ + null, + /* 3 */ + null, + /* 5 */ + points[b8] + /* 7 */ + ]; + if (points[a7].y.cmp(points[b8].y) === 0) { + comb[1] = points[a7].add(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } else if (points[a7].y.cmp(points[b8].y.redNeg()) === 0) { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].add(points[b8].neg()); + } else { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } + var index4 = [ + -3, + /* -1 -1 */ + -1, + /* -1 0 */ + -5, + /* -1 1 */ + -7, + /* 0 -1 */ + 0, + /* 0 0 */ + 7, + /* 0 1 */ + 5, + /* 1 -1 */ + 1, + /* 1 0 */ + 3 + /* 1 1 */ + ]; + var jsf = getJSF(coeffs[a7], coeffs[b8]); + max2 = Math.max(jsf[0].length, max2); + naf[a7] = new Array(max2); + naf[b8] = new Array(max2); + for (j6 = 0; j6 < max2; j6++) { + var ja = jsf[0][j6] | 0; + var jb = jsf[1][j6] | 0; + naf[a7][j6] = index4[(ja + 1) * 3 + (jb + 1)]; + naf[b8][j6] = 0; + wnd[a7] = comb; + } + } + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (i7 = max2; i7 >= 0; i7--) { + var k6 = 0; + while (i7 >= 0) { + var zero = true; + for (j6 = 0; j6 < len; j6++) { + tmp[j6] = naf[j6][i7] | 0; + if (tmp[j6] !== 0) + zero = false; + } + if (!zero) + break; + k6++; + i7--; + } + if (i7 >= 0) + k6++; + acc = acc.dblp(k6); + if (i7 < 0) + break; + for (j6 = 0; j6 < len; j6++) { + var z6 = tmp[j6]; + if (z6 === 0) + continue; + else if (z6 > 0) + p7 = wnd[j6][z6 - 1 >> 1]; + else if (z6 < 0) + p7 = wnd[j6][-z6 - 1 >> 1].neg(); + if (p7.type === "affine") + acc = acc.mixedAdd(p7); + else + acc = acc.add(p7); + } + } + for (i7 = 0; i7 < len; i7++) + wnd[i7] = null; + if (jacobianResult) + return acc; + else + return acc.toP(); + }; + function BasePoint(curve, type3) { + this.curve = curve; + this.type = type3; + this.precomputed = null; + } + BaseCurve.BasePoint = BasePoint; + BasePoint.prototype.eq = function eq2() { + throw new Error("Not implemented"); + }; + BasePoint.prototype.validate = function validate15() { + return this.curve.validate(this); + }; + BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + var len = this.p.byteLength(); + if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) { + if (bytes[0] === 6) + assert4(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 7) + assert4(bytes[bytes.length - 1] % 2 === 1); + var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len)); + return res; + } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); + } + throw new Error("Unknown point format"); + }; + BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); + }; + BasePoint.prototype._encode = function _encode(compact2) { + var len = this.curve.p.byteLength(); + var x7 = this.getX().toArray("be", len); + if (compact2) + return [this.getY().isEven() ? 2 : 3].concat(x7); + return [4].concat(x7, this.getY().toArray("be", len)); + }; + BasePoint.prototype.encode = function encode2(enc, compact2) { + return utils.encode(this._encode(compact2), enc); + }; + BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + return this; + }; + BasePoint.prototype._hasDoubles = function _hasDoubles(k6) { + if (!this.precomputed) + return false; + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + return doubles.points.length >= Math.ceil((k6.bitLength() + 1) / doubles.step); + }; + BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + var doubles = [this]; + var acc = this; + for (var i7 = 0; i7 < power; i7 += step) { + for (var j6 = 0; j6 < step; j6++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step, + points: doubles + }; + }; + BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + var res = [this]; + var max2 = (1 << wnd) - 1; + var dbl = max2 === 1 ? null : this.dbl(); + for (var i7 = 1; i7 < max2; i7++) + res[i7] = res[i7 - 1].add(dbl); + return { + wnd, + points: res + }; + }; + BasePoint.prototype._getBeta = function _getBeta() { + return null; + }; + BasePoint.prototype.dblp = function dblp(k6) { + var r8 = this; + for (var i7 = 0; i7 < k6; i7++) + r8 = r8.dbl(); + return r8; + }; + return exports$T$2; +} +function dew$R$2() { + if (_dewExec$R$2) + return exports$S$2; + _dewExec$R$2 = true; + var utils = dew$T$2(); + var BN = dew$V$2(); + var inherits2 = dew$f2(); + var Base2 = dew$S$2(); + var assert4 = utils.assert; + function ShortCurve(conf) { + Base2.call(this, "short", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); + } + inherits2(ShortCurve, Base2); + exports$S$2 = ShortCurve; + ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert4(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + return { + beta, + lambda, + basis + }; + }; + ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + var s7 = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + var l1 = ntinv.redAdd(s7).fromRed(); + var l22 = ntinv.redSub(s7).fromRed(); + return [l1, l22]; + }; + ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + var u7 = lambda; + var v8 = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x22 = new BN(0); + var y22 = new BN(1); + var a0; + var b0; + var a1; + var b1; + var a22; + var b22; + var prevR; + var i7 = 0; + var r8; + var x7; + while (u7.cmpn(0) !== 0) { + var q5 = v8.div(u7); + r8 = v8.sub(q5.mul(u7)); + x7 = x22.sub(q5.mul(x1)); + var y7 = y22.sub(q5.mul(y1)); + if (!a1 && r8.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r8.neg(); + b1 = x7; + } else if (a1 && ++i7 === 2) { + break; + } + prevR = r8; + v8 = u7; + u7 = r8; + x22 = x1; + x1 = x7; + y22 = y1; + y1 = y7; + } + a22 = r8.neg(); + b22 = x7; + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a22.sqr().add(b22.sqr()); + if (len2.cmp(len1) >= 0) { + a22 = a0; + b22 = b0; + } + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a22.negative) { + a22 = a22.neg(); + b22 = b22.neg(); + } + return [{ + a: a1, + b: b1 + }, { + a: a22, + b: b22 + }]; + }; + ShortCurve.prototype._endoSplit = function _endoSplit(k6) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v22 = basis[1]; + var c1 = v22.b.mul(k6).divRound(this.n); + var c22 = v1.b.neg().mul(k6).divRound(this.n); + var p1 = c1.mul(v1.a); + var p22 = c22.mul(v22.a); + var q1 = c1.mul(v1.b); + var q22 = c22.mul(v22.b); + var k1 = k6.sub(p1).sub(p22); + var k22 = q1.add(q22).neg(); + return { + k1, + k2: k22 + }; + }; + ShortCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var y22 = x7.redSqr().redMul(x7).redIAdd(x7.redMul(this.a)).redIAdd(this.b); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + ShortCurve.prototype.validate = function validate15(point) { + if (point.inf) + return true; + var x7 = point.x; + var y7 = point.y; + var ax = this.a.redMul(x7); + var rhs = x7.redSqr().redMul(x7).redIAdd(ax).redIAdd(this.b); + return y7.redSqr().redISub(rhs).cmpn(0) === 0; + }; + ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i7 = 0; i7 < points.length; i7++) { + var split3 = this._endoSplit(coeffs[i7]); + var p7 = points[i7]; + var beta = p7._getBeta(); + if (split3.k1.negative) { + split3.k1.ineg(); + p7 = p7.neg(true); + } + if (split3.k2.negative) { + split3.k2.ineg(); + beta = beta.neg(true); + } + npoints[i7 * 2] = p7; + npoints[i7 * 2 + 1] = beta; + ncoeffs[i7 * 2] = split3.k1; + ncoeffs[i7 * 2 + 1] = split3.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i7 * 2, jacobianResult); + for (var j6 = 0; j6 < i7 * 2; j6++) { + npoints[j6] = null; + ncoeffs[j6] = null; + } + return res; + }; + function Point(curve, x7, y7, isRed) { + Base2.BasePoint.call(this, curve, "affine"); + if (x7 === null && y7 === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } + } + inherits2(Point, Base2.BasePoint); + ShortCurve.prototype.point = function point(x7, y7, isRed) { + return new Point(this, x7, y7, isRed); + }; + ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); + }; + Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p7) { + return curve.point(p7.x.redMul(curve.endo.beta), p7.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; + }; + Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [this.x, this.y]; + return [this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + }]; + }; + Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === "string") + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + function obj2point(obj2) { + return curve.point(obj2[0], obj2[1], red); + } + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [res].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [res].concat(pre.naf.points.map(obj2point)) + } + }; + return res; + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.inf; + }; + Point.prototype.add = function add2(p7) { + if (this.inf) + return p7; + if (p7.inf) + return this; + if (this.eq(p7)) + return this.dbl(); + if (this.neg().eq(p7)) + return this.curve.point(null, null); + if (this.x.cmp(p7.x) === 0) + return this.curve.point(null, null); + var c7 = this.y.redSub(p7.y); + if (c7.cmpn(0) !== 0) + c7 = c7.redMul(this.x.redSub(p7.x).redInvm()); + var nx = c7.redSqr().redISub(this.x).redISub(p7.x); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + var a7 = this.curve.a; + var x22 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c7 = x22.redAdd(x22).redIAdd(x22).redIAdd(a7).redMul(dyinv); + var nx = c7.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.getX = function getX() { + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + return this.y.fromRed(); + }; + Point.prototype.mul = function mul(k6) { + k6 = new BN(k6, 16); + if (this.isInfinity()) + return this; + else if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([this], [k6]); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); + }; + Point.prototype.eq = function eq2(p7) { + return this === p7 || this.inf === p7.inf && (this.inf || this.x.cmp(p7.x) === 0 && this.y.cmp(p7.y) === 0); + }; + Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate2 = function(p7) { + return p7.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate2) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate2) + } + }; + } + return res; + }; + Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; + }; + function JPoint(curve, x7, y7, z6) { + Base2.BasePoint.call(this, curve, "jacobian"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = new BN(z6, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + } + inherits2(JPoint, Base2.BasePoint); + ShortCurve.prototype.jpoint = function jpoint(x7, y7, z6) { + return new JPoint(this, x7, y7, z6); + }; + JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + return this.curve.point(ax, ay); + }; + JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }; + JPoint.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + var pz2 = p7.z.redSqr(); + var z22 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u22 = p7.x.redMul(z22); + var s1 = this.y.redMul(pz2.redMul(p7.z)); + var s22 = p7.y.redMul(z22.redMul(this.z)); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(p7.z).redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mixedAdd = function mixedAdd(p7) { + if (this.isInfinity()) + return p7.toJ(); + if (p7.isInfinity()) + return this; + var z22 = this.z.redSqr(); + var u1 = this.x; + var u22 = p7.x.redMul(z22); + var s1 = this.y; + var s22 = p7.y.redMul(z22).redMul(this.z); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + var i7; + if (this.curve.zeroA || this.curve.threeA) { + var r8 = this; + for (i7 = 0; i7 < pow; i7++) + r8 = r8.dbl(); + return r8; + } + var a7 = this.curve.a; + var tinv = this.curve.tinv; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jyd = jy.redAdd(jy); + for (i7 = 0; i7 < pow; i7++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var t1 = jx.redMul(jyd2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var dny = c7.redMul(t22); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i7 + 1 < pow) + jz4 = jz4.redMul(jyd4); + jx = nx; + jz = nz; + jyd = dny; + } + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); + }; + JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); + }; + JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + nx = t8; + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = b8.redSqr(); + var d7 = this.x.redAdd(b8).redSqr().redISub(a7).redISub(c7); + d7 = d7.redIAdd(d7); + var e10 = a7.redAdd(a7).redIAdd(a7); + var f8 = e10.redSqr(); + var c8 = c7.redIAdd(c7); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + nx = f8.redISub(d7).redISub(d7); + ny = e10.redMul(d7.redISub(nx)).redISub(c8); + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + nx = t8; + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var delta = this.z.redSqr(); + var gamma = this.y.redSqr(); + var beta = this.x.redMul(gamma); + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._dbl = function _dbl() { + var a7 = this.curve.a; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c7.redMul(t22).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var zz = this.z.redSqr(); + var yyyy = yy.redSqr(); + var m7 = xx.redAdd(xx).redIAdd(xx); + var mm = m7.redSqr(); + var e10 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e10 = e10.redIAdd(e10); + e10 = e10.redAdd(e10).redIAdd(e10); + e10 = e10.redISub(mm); + var ee4 = e10.redSqr(); + var t8 = yyyy.redIAdd(yyyy); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + var u7 = m7.redIAdd(e10).redSqr().redISub(mm).redISub(ee4).redISub(t8); + var yyu4 = yy.redMul(u7); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee4).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + var ny = this.y.redMul(u7.redMul(t8.redISub(u7)).redISub(e10.redMul(ee4))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + var nz = this.z.redAdd(e10).redSqr().redISub(zz).redISub(ee4); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mul = function mul(k6, kbase) { + k6 = new BN(k6, kbase); + return this.curve._wnafMul(this, k6); + }; + JPoint.prototype.eq = function eq2(p7) { + if (p7.type === "affine") + return this.eq(p7.toJ()); + if (this === p7) + return true; + var z22 = this.z.redSqr(); + var pz2 = p7.z.redSqr(); + if (this.x.redMul(pz2).redISub(p7.x.redMul(z22)).cmpn(0) !== 0) + return false; + var z32 = z22.redMul(this.z); + var pz3 = pz2.redMul(p7.z); + return this.y.redMul(pz3).redISub(p7.y.redMul(z32)).cmpn(0) === 0; + }; + JPoint.prototype.eqXToP = function eqXToP(x7) { + var zs = this.z.redSqr(); + var rx = x7.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(zs); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + JPoint.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + JPoint.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + return exports$S$2; +} +function dew$Q$2() { + if (_dewExec$Q$2) + return exports$R$2; + _dewExec$Q$2 = true; + var BN = dew$V$2(); + var inherits2 = dew$f2(); + var Base2 = dew$S$2(); + var utils = dew$T$2(); + function MontCurve(conf) { + Base2.call(this, "mont", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); + } + inherits2(MontCurve, Base2); + exports$R$2 = MontCurve; + MontCurve.prototype.validate = function validate15(point) { + var x7 = point.normalize().x; + var x22 = x7.redSqr(); + var rhs = x22.redMul(x7).redAdd(x22.redMul(this.a)).redAdd(x7); + var y7 = rhs.redSqrt(); + return y7.redSqr().cmp(rhs) === 0; + }; + function Point(curve, x7, z6) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && z6 === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x7, 16); + this.z = new BN(z6, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } + } + inherits2(Point, Base2.BasePoint); + MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); + }; + MontCurve.prototype.point = function point(x7, z6) { + return new Point(this, x7, z6); + }; + MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + Point.prototype.precompute = function precompute() { + }; + Point.prototype._encode = function _encode() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + Point.prototype.dbl = function dbl() { + var a7 = this.x.redAdd(this.z); + var aa = a7.redSqr(); + var b8 = this.x.redSub(this.z); + var bb = b8.redSqr(); + var c7 = aa.redSub(bb); + var nx = aa.redMul(bb); + var nz = c7.redMul(bb.redAdd(this.curve.a24.redMul(c7))); + return this.curve.point(nx, nz); + }; + Point.prototype.add = function add2() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.diffAdd = function diffAdd(p7, diff) { + var a7 = this.x.redAdd(this.z); + var b8 = this.x.redSub(this.z); + var c7 = p7.x.redAdd(p7.z); + var d7 = p7.x.redSub(p7.z); + var da = d7.redMul(a7); + var cb = c7.redMul(b8); + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); + }; + Point.prototype.mul = function mul(k6) { + var t8 = k6.clone(); + var a7 = this; + var b8 = this.curve.point(null, null); + var c7 = this; + for (var bits = []; t8.cmpn(0) !== 0; t8.iushrn(1)) + bits.push(t8.andln(1)); + for (var i7 = bits.length - 1; i7 >= 0; i7--) { + if (bits[i7] === 0) { + a7 = a7.diffAdd(b8, c7); + b8 = b8.dbl(); + } else { + b8 = a7.diffAdd(b8, c7); + a7 = a7.dbl(); + } + } + return b8; + }; + Point.prototype.mulAdd = function mulAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.jumlAdd = function jumlAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.eq = function eq2(other) { + return this.getX().cmp(other.getX()) === 0; + }; + Point.prototype.normalize = function normalize2() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + return exports$R$2; +} +function dew$P$2() { + if (_dewExec$P$2) + return exports$Q$2; + _dewExec$P$2 = true; + var utils = dew$T$2(); + var BN = dew$V$2(); + var inherits2 = dew$f2(); + var Base2 = dew$S$2(); + var assert4 = utils.assert; + function EdwardsCurve(conf) { + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + Base2.call(this, "edwards", conf); + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + assert4(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; + } + inherits2(EdwardsCurve, Base2); + exports$Q$2 = EdwardsCurve; + EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); + }; + EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); + }; + EdwardsCurve.prototype.jpoint = function jpoint(x7, y7, z6, t8) { + return this.point(x7, y7, z6, t8); + }; + EdwardsCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var x22 = x7.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x22)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x22)); + var y22 = rhs.redMul(lhs.redInvm()); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.pointFromY = function pointFromY(y7, odd) { + y7 = new BN(y7, 16); + if (!y7.red) + y7 = y7.toRed(this.red); + var y22 = y7.redSqr(); + var lhs = y22.redSub(this.c2); + var rhs = y22.redMul(this.d).redMul(this.c2).redSub(this.a); + var x22 = lhs.redMul(rhs.redInvm()); + if (x22.cmp(this.zero) === 0) { + if (odd) + throw new Error("invalid point"); + else + return this.point(this.zero, y7); + } + var x7 = x22.redSqrt(); + if (x7.redSqr().redSub(x22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + if (x7.fromRed().isOdd() !== odd) + x7 = x7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.validate = function validate15(point) { + if (point.isInfinity()) + return true; + point.normalize(); + var x22 = point.x.redSqr(); + var y22 = point.y.redSqr(); + var lhs = x22.redMul(this.a).redAdd(y22); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x22).redMul(y22))); + return lhs.cmp(rhs) === 0; + }; + function Point(curve, x7, y7, z6, t8) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = z6 ? new BN(z6, 16) : this.curve.one; + this.t = t8 && new BN(t8, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } + } + inherits2(Point, Base2.BasePoint); + EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + EdwardsCurve.prototype.point = function point(x7, y7, z6, t8) { + return new Point(this, x7, y7, z6, t8); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0); + }; + Point.prototype._extDbl = function _extDbl() { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = this.z.redSqr(); + c7 = c7.redIAdd(c7); + var d7 = this.curve._mulA(a7); + var e10 = this.x.redAdd(this.y).redSqr().redISub(a7).redISub(b8); + var g7 = d7.redAdd(b8); + var f8 = g7.redSub(c7); + var h8 = d7.redSub(b8); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projDbl = function _projDbl() { + var b8 = this.x.redAdd(this.y).redSqr(); + var c7 = this.x.redSqr(); + var d7 = this.y.redSqr(); + var nx; + var ny; + var nz; + var e10; + var h8; + var j6; + if (this.curve.twisted) { + e10 = this.curve._mulA(c7); + var f8 = e10.redAdd(d7); + if (this.zOne) { + nx = b8.redSub(c7).redSub(d7).redMul(f8.redSub(this.curve.two)); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redSqr().redSub(f8).redSub(f8); + } else { + h8 = this.z.redSqr(); + j6 = f8.redSub(h8).redISub(h8); + nx = b8.redSub(c7).redISub(d7).redMul(j6); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redMul(j6); + } + } else { + e10 = c7.redAdd(d7); + h8 = this.curve._mulC(this.z).redSqr(); + j6 = e10.redSub(h8).redSub(h8); + nx = this.curve._mulC(b8.redISub(e10)).redMul(j6); + ny = this.curve._mulC(e10).redMul(c7.redISub(d7)); + nz = e10.redMul(j6); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); + }; + Point.prototype._extAdd = function _extAdd(p7) { + var a7 = this.y.redSub(this.x).redMul(p7.y.redSub(p7.x)); + var b8 = this.y.redAdd(this.x).redMul(p7.y.redAdd(p7.x)); + var c7 = this.t.redMul(this.curve.dd).redMul(p7.t); + var d7 = this.z.redMul(p7.z.redAdd(p7.z)); + var e10 = b8.redSub(a7); + var f8 = d7.redSub(c7); + var g7 = d7.redAdd(c7); + var h8 = b8.redAdd(a7); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projAdd = function _projAdd(p7) { + var a7 = this.z.redMul(p7.z); + var b8 = a7.redSqr(); + var c7 = this.x.redMul(p7.x); + var d7 = this.y.redMul(p7.y); + var e10 = this.curve.d.redMul(c7).redMul(d7); + var f8 = b8.redSub(e10); + var g7 = b8.redAdd(e10); + var tmp = this.x.redAdd(this.y).redMul(p7.x.redAdd(p7.y)).redISub(c7).redISub(d7); + var nx = a7.redMul(f8).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + ny = a7.redMul(g7).redMul(d7.redSub(this.curve._mulA(c7))); + nz = f8.redMul(g7); + } else { + ny = a7.redMul(g7).redMul(d7.redSub(c7)); + nz = this.curve._mulC(f8).redMul(g7); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + if (this.curve.extended) + return this._extAdd(p7); + else + return this._projAdd(p7); + }; + Point.prototype.mul = function mul(k6) { + if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, false); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, true); + }; + Point.prototype.normalize = function normalize2() { + if (this.zOne) + return this; + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; + }; + Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); + }; + Point.prototype.eq = function eq2(other) { + return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0; + }; + Point.prototype.eqXToP = function eqXToP(x7) { + var rx = x7.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(this.z); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + Point.prototype.toP = Point.prototype.normalize; + Point.prototype.mixedAdd = Point.prototype.add; + return exports$Q$2; +} +function dew$O$2() { + if (_dewExec$O$2) + return exports$P$2; + _dewExec$O$2 = true; + var curve = exports$P$2; + curve.base = dew$S$2(); + curve.short = dew$R$2(); + curve.mont = dew$Q$2(); + curve.edwards = dew$P$2(); + return exports$P$2; +} +function dew$N$2() { + if (_dewExec$N$2) + return exports$O$2; + _dewExec$N$2 = true; + var assert4 = dew$2m(); + var inherits2 = dew$f2(); + exports$O$2.inherits = inherits2; + function isSurrogatePair(msg, i7) { + if ((msg.charCodeAt(i7) & 64512) !== 55296) { + return false; + } + if (i7 < 0 || i7 + 1 >= msg.length) { + return false; + } + return (msg.charCodeAt(i7 + 1) & 64512) === 56320; + } + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === "string") { + if (!enc) { + var p7 = 0; + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + if (c7 < 128) { + res[p7++] = c7; + } else if (c7 < 2048) { + res[p7++] = c7 >> 6 | 192; + res[p7++] = c7 & 63 | 128; + } else if (isSurrogatePair(msg, i7)) { + c7 = 65536 + ((c7 & 1023) << 10) + (msg.charCodeAt(++i7) & 1023); + res[p7++] = c7 >> 18 | 240; + res[p7++] = c7 >> 12 & 63 | 128; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } else { + res[p7++] = c7 >> 12 | 224; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } + } + } else if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } + } else { + for (i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + } + return res; + } + exports$O$2.toArray = toArray3; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + exports$O$2.toHex = toHex; + function htonl(w6) { + var res = w6 >>> 24 | w6 >>> 8 & 65280 | w6 << 8 & 16711680 | (w6 & 255) << 24; + return res >>> 0; + } + exports$O$2.htonl = htonl; + function toHex32(msg, endian) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) { + var w6 = msg[i7]; + if (endian === "little") + w6 = htonl(w6); + res += zero8(w6.toString(16)); + } + return res; + } + exports$O$2.toHex32 = toHex32; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + exports$O$2.zero2 = zero2; + function zero8(word) { + if (word.length === 7) + return "0" + word; + else if (word.length === 6) + return "00" + word; + else if (word.length === 5) + return "000" + word; + else if (word.length === 4) + return "0000" + word; + else if (word.length === 3) + return "00000" + word; + else if (word.length === 2) + return "000000" + word; + else if (word.length === 1) + return "0000000" + word; + else + return word; + } + exports$O$2.zero8 = zero8; + function join32(msg, start, end, endian) { + var len = end - start; + assert4(len % 4 === 0); + var res = new Array(len / 4); + for (var i7 = 0, k6 = start; i7 < res.length; i7++, k6 += 4) { + var w6; + if (endian === "big") + w6 = msg[k6] << 24 | msg[k6 + 1] << 16 | msg[k6 + 2] << 8 | msg[k6 + 3]; + else + w6 = msg[k6 + 3] << 24 | msg[k6 + 2] << 16 | msg[k6 + 1] << 8 | msg[k6]; + res[i7] = w6 >>> 0; + } + return res; + } + exports$O$2.join32 = join32; + function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i7 = 0, k6 = 0; i7 < msg.length; i7++, k6 += 4) { + var m7 = msg[i7]; + if (endian === "big") { + res[k6] = m7 >>> 24; + res[k6 + 1] = m7 >>> 16 & 255; + res[k6 + 2] = m7 >>> 8 & 255; + res[k6 + 3] = m7 & 255; + } else { + res[k6 + 3] = m7 >>> 24; + res[k6 + 2] = m7 >>> 16 & 255; + res[k6 + 1] = m7 >>> 8 & 255; + res[k6] = m7 & 255; + } + } + return res; + } + exports$O$2.split32 = split32; + function rotr32(w6, b8) { + return w6 >>> b8 | w6 << 32 - b8; + } + exports$O$2.rotr32 = rotr32; + function rotl32(w6, b8) { + return w6 << b8 | w6 >>> 32 - b8; + } + exports$O$2.rotl32 = rotl32; + function sum32(a7, b8) { + return a7 + b8 >>> 0; + } + exports$O$2.sum32 = sum32; + function sum32_3(a7, b8, c7) { + return a7 + b8 + c7 >>> 0; + } + exports$O$2.sum32_3 = sum32_3; + function sum32_4(a7, b8, c7, d7) { + return a7 + b8 + c7 + d7 >>> 0; + } + exports$O$2.sum32_4 = sum32_4; + function sum32_5(a7, b8, c7, d7, e10) { + return a7 + b8 + c7 + d7 + e10 >>> 0; + } + exports$O$2.sum32_5 = sum32_5; + function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; + } + exports$O$2.sum64 = sum64; + function sum64_hi(ah, al, bh, bl) { + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; + } + exports$O$2.sum64_hi = sum64_hi; + function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; + } + exports$O$2.sum64_lo = sum64_lo; + function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; + } + exports$O$2.sum64_4_hi = sum64_4_hi; + function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; + } + exports$O$2.sum64_4_lo = sum64_4_lo; + function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + lo = lo + el >>> 0; + carry += lo < el ? 1 : 0; + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; + } + exports$O$2.sum64_5_hi = sum64_5_hi; + function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + return lo >>> 0; + } + exports$O$2.sum64_5_lo = sum64_5_lo; + function rotr64_hi(ah, al, num) { + var r8 = al << 32 - num | ah >>> num; + return r8 >>> 0; + } + exports$O$2.rotr64_hi = rotr64_hi; + function rotr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$O$2.rotr64_lo = rotr64_lo; + function shr64_hi(ah, al, num) { + return ah >>> num; + } + exports$O$2.shr64_hi = shr64_hi; + function shr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$O$2.shr64_lo = shr64_lo; + return exports$O$2; +} +function dew$M$2() { + if (_dewExec$M$2) + return exports$N$2; + _dewExec$M$2 = true; + var utils = dew$N$2(); + var assert4 = dew$2m(); + function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = "big"; + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; + } + exports$N$2.BlockHash = BlockHash; + BlockHash.prototype.update = function update2(msg, enc) { + msg = utils.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + if (this.pending.length >= this._delta8) { + msg = this.pending; + var r8 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r8, msg.length); + if (this.pending.length === 0) + this.pending = null; + msg = utils.join32(msg, 0, msg.length - r8, this.endian); + for (var i7 = 0; i7 < msg.length; i7 += this._delta32) + this._update(msg, i7, i7 + this._delta32); + } + return this; + }; + BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert4(this.pending === null); + return this._digest(enc); + }; + BlockHash.prototype._pad = function pad2() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k6 = bytes - (len + this.padLength) % bytes; + var res = new Array(k6 + this.padLength); + res[0] = 128; + for (var i7 = 1; i7 < k6; i7++) + res[i7] = 0; + len <<= 3; + if (this.endian === "big") { + for (var t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = len >>> 24 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len & 255; + } else { + res[i7++] = len & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 24 & 255; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + for (t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + } + return res; + }; + return exports$N$2; +} +function dew$L$2() { + if (_dewExec$L$2) + return exports$M$2; + _dewExec$L$2 = true; + return exports$M$2; +} +function dew$K$2() { + if (_dewExec$K$2) + return exports$L$2; + _dewExec$K$2 = true; + var utils = dew$N$2(); + var common3 = dew$M$2(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_3 = utils.sum32_3; + var sum32_4 = utils.sum32_4; + var BlockHash = common3.BlockHash; + function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.endian = "little"; + } + utils.inherits(RIPEMD160, BlockHash); + exports$L$2.ripemd160 = RIPEMD160; + RIPEMD160.blockSize = 512; + RIPEMD160.outSize = 160; + RIPEMD160.hmacStrength = 192; + RIPEMD160.padLength = 64; + RIPEMD160.prototype._update = function update2(msg, start) { + var A6 = this.h[0]; + var B6 = this.h[1]; + var C6 = this.h[2]; + var D6 = this.h[3]; + var E6 = this.h[4]; + var Ah = A6; + var Bh = B6; + var Ch = C6; + var Dh = D6; + var Eh = E6; + for (var j6 = 0; j6 < 80; j6++) { + var T6 = sum32(rotl32(sum32_4(A6, f8(j6, B6, C6, D6), msg[r8[j6] + start], K5(j6)), s7[j6]), E6); + A6 = E6; + E6 = D6; + D6 = rotl32(C6, 10); + C6 = B6; + B6 = T6; + T6 = sum32(rotl32(sum32_4(Ah, f8(79 - j6, Bh, Ch, Dh), msg[rh[j6] + start], Kh(j6)), sh[j6]), Eh); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch, 10); + Ch = Bh; + Bh = T6; + } + T6 = sum32_3(this.h[1], C6, Dh); + this.h[1] = sum32_3(this.h[2], D6, Eh); + this.h[2] = sum32_3(this.h[3], E6, Ah); + this.h[3] = sum32_3(this.h[4], A6, Bh); + this.h[4] = sum32_3(this.h[0], B6, Ch); + this.h[0] = T6; + }; + RIPEMD160.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "little"); + else + return utils.split32(this.h, "little"); + }; + function f8(j6, x7, y7, z6) { + if (j6 <= 15) + return x7 ^ y7 ^ z6; + else if (j6 <= 31) + return x7 & y7 | ~x7 & z6; + else if (j6 <= 47) + return (x7 | ~y7) ^ z6; + else if (j6 <= 63) + return x7 & z6 | y7 & ~z6; + else + return x7 ^ (y7 | ~z6); + } + function K5(j6) { + if (j6 <= 15) + return 0; + else if (j6 <= 31) + return 1518500249; + else if (j6 <= 47) + return 1859775393; + else if (j6 <= 63) + return 2400959708; + else + return 2840853838; + } + function Kh(j6) { + if (j6 <= 15) + return 1352829926; + else if (j6 <= 31) + return 1548603684; + else if (j6 <= 47) + return 1836072691; + else if (j6 <= 63) + return 2053994217; + else + return 0; + } + var r8 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var rh = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var s7 = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sh = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + return exports$L$2; +} +function dew$J$2() { + if (_dewExec$J$2) + return exports$K$2; + _dewExec$J$2 = true; + var utils = dew$N$2(); + var assert4 = dew$2m(); + function Hmac2(hash, key, enc) { + if (!(this instanceof Hmac2)) + return new Hmac2(hash, key, enc); + this.Hash = hash; + this.blockSize = hash.blockSize / 8; + this.outSize = hash.outSize / 8; + this.inner = null; + this.outer = null; + this._init(utils.toArray(key, enc)); + } + exports$K$2 = Hmac2; + Hmac2.prototype._init = function init2(key) { + if (key.length > this.blockSize) + key = new this.Hash().update(key).digest(); + assert4(key.length <= this.blockSize); + for (var i7 = key.length; i7 < this.blockSize; i7++) + key.push(0); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 54; + this.inner = new this.Hash().update(key); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 106; + this.outer = new this.Hash().update(key); + }; + Hmac2.prototype.update = function update2(msg, enc) { + this.inner.update(msg, enc); + return this; + }; + Hmac2.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); + }; + return exports$K$2; +} +function dew$I$2() { + if (_dewExec$I$2) + return exports$J$2; + _dewExec$I$2 = true; + var hash = exports$J$2; + hash.utils = dew$N$2(); + hash.common = dew$M$2(); + hash.sha = dew$L$2(); + hash.ripemd = dew$K$2(); + hash.hmac = dew$J$2(); + hash.sha1 = hash.sha.sha1; + hash.sha256 = hash.sha.sha256; + hash.sha224 = hash.sha.sha224; + hash.sha384 = hash.sha.sha384; + hash.sha512 = hash.sha.sha512; + hash.ripemd160 = hash.ripemd.ripemd160; + return exports$J$2; +} +function dew$H$2() { + if (_dewExec$H$2) + return exports$I$2; + _dewExec$H$2 = true; + exports$I$2 = { + doubles: { + step: 4, + points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] + }, + naf: { + wnd: 7, + points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] + } + }; + return exports$I$2; +} +function dew$G$2() { + if (_dewExec$G$2) + return exports$H$2; + _dewExec$G$2 = true; + var curves = exports$H$2; + var hash = dew$I$2(); + var curve = dew$O$2(); + var utils = dew$T$2(); + var assert4 = utils.assert; + function PresetCurve(options) { + if (options.type === "short") + this.curve = new curve.short(options); + else if (options.type === "edwards") + this.curve = new curve.edwards(options); + else + this.curve = new curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + assert4(this.g.validate(), "Invalid curve"); + assert4(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + curves.PresetCurve = PresetCurve; + function defineCurve(name2, options) { + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + get: function() { + var curve2 = new PresetCurve(options); + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + value: curve2 + }); + return curve2; + } + }); + } + defineCurve("p192", { + type: "short", + prime: "p192", + p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", + b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", + n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", + hash: hash.sha256, + gRed: false, + g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] + }); + defineCurve("p224", { + type: "short", + prime: "p224", + p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", + b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", + n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", + hash: hash.sha256, + gRed: false, + g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] + }); + defineCurve("p256", { + type: "short", + prime: null, + p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", + a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", + b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", + n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", + hash: hash.sha256, + gRed: false, + g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] + }); + defineCurve("p384", { + type: "short", + prime: null, + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", + a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", + b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", + n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", + hash: hash.sha384, + gRed: false, + g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"] + }); + defineCurve("p521", { + type: "short", + prime: null, + p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", + a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", + b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", + n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", + hash: hash.sha512, + gRed: false, + g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"] + }); + defineCurve("curve25519", { + type: "mont", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "76d06", + b: "1", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: ["9"] + }); + defineCurve("ed25519", { + type: "edwards", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "-1", + c: "1", + // -121665 * (121666^(-1)) (mod P) + d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: [ + "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", + // 4/5 + "6666666666666666666666666666666666666666666666666666666666666658" + ] + }); + var pre; + try { + pre = dew$H$2(); + } catch (e10) { + pre = void 0; + } + defineCurve("secp256k1", { + type: "short", + prime: "k256", + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", + a: "0", + b: "7", + n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", + h: "1", + hash: hash.sha256, + // Precomputed endomorphism + beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", + lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", + basis: [{ + a: "3086d221a7d46bcde86c90e49284eb15", + b: "-e4437ed6010e88286f547fa90abfe4c3" + }, { + a: "114ca50f7a8e2f3f657c1108d9d44cfd8", + b: "3086d221a7d46bcde86c90e49284eb15" + }], + gRed: false, + g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", pre] + }); + return exports$H$2; +} +function dew$F$2() { + if (_dewExec$F$2) + return exports$G$2; + _dewExec$F$2 = true; + var hash = dew$I$2(); + var utils = dew$U$2(); + var assert4 = dew$2m(); + function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex"); + var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex"); + var pers = utils.toArray(options.pers, options.persEnc || "hex"); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._init(entropy, nonce, pers); + } + exports$G$2 = HmacDRBG; + HmacDRBG.prototype._init = function init2(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i7 = 0; i7 < this.V.length; i7++) { + this.K[i7] = 0; + this.V[i7] = 1; + } + this._update(seed); + this._reseed = 1; + this.reseedInterval = 281474976710656; + }; + HmacDRBG.prototype._hmac = function hmac() { + return new hash.hmac(this.hash, this.K); + }; + HmacDRBG.prototype._update = function update2(seed) { + var kmac = this._hmac().update(this.V).update([0]); + if (seed) + kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) + return; + this.K = this._hmac().update(this.V).update([1]).update(seed).digest(); + this.V = this._hmac().update(this.V).digest(); + }; + HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add2, addEnc) { + if (typeof entropyEnc !== "string") { + addEnc = add2; + add2 = entropyEnc; + entropyEnc = null; + } + entropy = utils.toArray(entropy, entropyEnc); + add2 = utils.toArray(add2, addEnc); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._update(entropy.concat(add2 || [])); + this._reseed = 1; + }; + HmacDRBG.prototype.generate = function generate2(len, enc, add2, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + if (typeof enc !== "string") { + addEnc = add2; + add2 = enc; + enc = null; + } + if (add2) { + add2 = utils.toArray(add2, addEnc || "hex"); + this._update(add2); + } + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + var res = temp.slice(0, len); + this._update(add2); + this._reseed++; + return utils.encode(res, enc); + }; + return exports$G$2; +} +function dew$E$2() { + if (_dewExec$E$2) + return exports$F$2; + _dewExec$E$2 = true; + var BN = dew$V$2(); + var utils = dew$T$2(); + var assert4 = utils.assert; + function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); + } + exports$F$2 = KeyPair; + KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(ec, { + pub, + pubEnc: enc + }); + }; + KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + return new KeyPair(ec, { + priv, + privEnc: enc + }); + }; + KeyPair.prototype.validate = function validate15() { + var pub = this.getPublic(); + if (pub.isInfinity()) + return { + result: false, + reason: "Invalid public key" + }; + if (!pub.validate()) + return { + result: false, + reason: "Public key is not a point" + }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { + result: false, + reason: "Public key * N != O" + }; + return { + result: true, + reason: null + }; + }; + KeyPair.prototype.getPublic = function getPublic(compact2, enc) { + if (typeof compact2 === "string") { + enc = compact2; + compact2 = null; + } + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + if (!enc) + return this.pub; + return this.pub.encode(enc, compact2); + }; + KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === "hex") + return this.priv.toString(16, 2); + else + return this.priv; + }; + KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + this.priv = this.priv.umod(this.ec.curve.n); + }; + KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + if (this.ec.curve.type === "mont") { + assert4(key.x, "Need x coordinate"); + } else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") { + assert4(key.x && key.y, "Need both x and y coordinate"); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); + }; + KeyPair.prototype.derive = function derive(pub) { + if (!pub.validate()) { + assert4(pub.validate(), "public point not validated"); + } + return pub.mul(this.priv).getX(); + }; + KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); + }; + KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); + }; + KeyPair.prototype.inspect = function inspect2() { + return ""; + }; + return exports$F$2; +} +function dew$D$2() { + if (_dewExec$D$2) + return exports$E$2; + _dewExec$D$2 = true; + var BN = dew$V$2(); + var utils = dew$T$2(); + var assert4 = utils.assert; + function Signature(options, enc) { + if (options instanceof Signature) + return options; + if (this._importDER(options, enc)) + return; + assert4(options.r && options.s, "Signature without r or s"); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === void 0) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; + } + exports$E$2 = Signature; + function Position() { + this.place = 0; + } + function getLength(buf, p7) { + var initial2 = buf[p7.place++]; + if (!(initial2 & 128)) { + return initial2; + } + var octetLen = initial2 & 15; + if (octetLen === 0 || octetLen > 4) { + return false; + } + var val = 0; + for (var i7 = 0, off3 = p7.place; i7 < octetLen; i7++, off3++) { + val <<= 8; + val |= buf[off3]; + val >>>= 0; + } + if (val <= 127) { + return false; + } + p7.place = off3; + return val; + } + function rmPadding(buf) { + var i7 = 0; + var len = buf.length - 1; + while (!buf[i7] && !(buf[i7 + 1] & 128) && i7 < len) { + i7++; + } + if (i7 === 0) { + return buf; + } + return buf.slice(i7); + } + Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p7 = new Position(); + if (data[p7.place++] !== 48) { + return false; + } + var len = getLength(data, p7); + if (len === false) { + return false; + } + if (len + p7.place !== data.length) { + return false; + } + if (data[p7.place++] !== 2) { + return false; + } + var rlen = getLength(data, p7); + if (rlen === false) { + return false; + } + var r8 = data.slice(p7.place, rlen + p7.place); + p7.place += rlen; + if (data[p7.place++] !== 2) { + return false; + } + var slen = getLength(data, p7); + if (slen === false) { + return false; + } + if (data.length !== slen + p7.place) { + return false; + } + var s7 = data.slice(p7.place, slen + p7.place); + if (r8[0] === 0) { + if (r8[1] & 128) { + r8 = r8.slice(1); + } else { + return false; + } + } + if (s7[0] === 0) { + if (s7[1] & 128) { + s7 = s7.slice(1); + } else { + return false; + } + } + this.r = new BN(r8); + this.s = new BN(s7); + this.recoveryParam = null; + return true; + }; + function constructLength(arr, len) { + if (len < 128) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 128); + while (--octets) { + arr.push(len >>> (octets << 3) & 255); + } + arr.push(len); + } + Signature.prototype.toDER = function toDER(enc) { + var r8 = this.r.toArray(); + var s7 = this.s.toArray(); + if (r8[0] & 128) + r8 = [0].concat(r8); + if (s7[0] & 128) + s7 = [0].concat(s7); + r8 = rmPadding(r8); + s7 = rmPadding(s7); + while (!s7[0] && !(s7[1] & 128)) { + s7 = s7.slice(1); + } + var arr = [2]; + constructLength(arr, r8.length); + arr = arr.concat(r8); + arr.push(2); + constructLength(arr, s7.length); + var backHalf = arr.concat(s7); + var res = [48]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); + }; + return exports$E$2; +} +function dew$C$2() { + if (_dewExec$C$2) + return exports$D$2; + _dewExec$C$2 = true; + var BN = dew$V$2(); + var HmacDRBG = dew$F$2(); + var utils = dew$T$2(); + var curves = dew$G$2(); + var rand = dew$11$2(); + var assert4 = utils.assert; + var KeyPair = dew$E$2(); + var Signature = dew$D$2(); + function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + if (typeof options === "string") { + assert4(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options); + options = curves[options]; + } + if (options instanceof curves.PresetCurve) + options = { + curve: options + }; + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + this.hash = options.hash || options.curve.hash; + } + exports$D$2 = EC; + EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); + }; + EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); + }; + EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); + }; + EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || "utf8", + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || "utf8", + nonce: this.n.toArray() + }); + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + for (; ; ) { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + priv.iaddn(1); + return this.keyFromPrivate(priv); + } + }; + EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; + }; + EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === "object") { + options = enc; + enc = null; + } + if (!options) + options = {}; + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray("be", bytes); + var nonce = msg.toArray("be", bytes); + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce, + pers: options.pers, + persEnc: options.persEnc || "utf8" + }); + var ns1 = this.n.sub(new BN(1)); + for (var iter = 0; ; iter++) { + var k6 = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength())); + k6 = this._truncateToN(k6, true); + if (k6.cmpn(1) <= 0 || k6.cmp(ns1) >= 0) + continue; + var kp = this.g.mul(k6); + if (kp.isInfinity()) + continue; + var kpX = kp.getX(); + var r8 = kpX.umod(this.n); + if (r8.cmpn(0) === 0) + continue; + var s7 = k6.invm(this.n).mul(r8.mul(key.getPrivate()).iadd(msg)); + s7 = s7.umod(this.n); + if (s7.cmpn(0) === 0) + continue; + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r8) !== 0 ? 2 : 0); + if (options.canonical && s7.cmp(this.nh) > 0) { + s7 = this.n.sub(s7); + recoveryParam ^= 1; + } + return new Signature({ + r: r8, + s: s7, + recoveryParam + }); + } + }; + EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, "hex"); + var r8 = signature.r; + var s7 = signature.s; + if (r8.cmpn(1) < 0 || r8.cmp(this.n) >= 0) + return false; + if (s7.cmpn(1) < 0 || s7.cmp(this.n) >= 0) + return false; + var sinv = s7.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u22 = sinv.mul(r8).umod(this.n); + var p7; + if (!this.curve._maxwellTrick) { + p7 = this.g.mulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.getX().umod(this.n).cmp(r8) === 0; + } + p7 = this.g.jmulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.eqXToP(r8); + }; + EC.prototype.recoverPubKey = function(msg, signature, j6, enc) { + assert4((3 & j6) === j6, "The recovery param is more than two bits"); + signature = new Signature(signature, enc); + var n7 = this.n; + var e10 = new BN(msg); + var r8 = signature.r; + var s7 = signature.s; + var isYOdd = j6 & 1; + var isSecondKey = j6 >> 1; + if (r8.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error("Unable to find sencond key candinate"); + if (isSecondKey) + r8 = this.curve.pointFromX(r8.add(this.curve.n), isYOdd); + else + r8 = this.curve.pointFromX(r8, isYOdd); + var rInv = signature.r.invm(n7); + var s1 = n7.sub(e10).mul(rInv).umod(n7); + var s22 = s7.mul(rInv).umod(n7); + return this.g.mulAdd(s1, r8, s22); + }; + EC.prototype.getKeyRecoveryParam = function(e10, signature, Q5, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + for (var i7 = 0; i7 < 4; i7++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e10, signature, i7); + } catch (e11) { + continue; + } + if (Qprime.eq(Q5)) + return i7; + } + throw new Error("Unable to find valid recovery factor"); + }; + return exports$D$2; +} +function dew$B$2() { + if (_dewExec$B$2) + return exports$C$2; + _dewExec$B$2 = true; + var utils = dew$T$2(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var cachedProperty = utils.cachedProperty; + function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); + } + KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { + pub + }); + }; + KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { + secret + }); + }; + KeyPair.prototype.secret = function secret() { + return this._secret; + }; + cachedProperty(KeyPair, "pubBytes", function pubBytes() { + return this.eddsa.encodePoint(this.pub()); + }); + cachedProperty(KeyPair, "pub", function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); + }); + cachedProperty(KeyPair, "privBytes", function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + var a7 = hash.slice(0, eddsa.encodingLength); + a7[0] &= 248; + a7[lastIx] &= 127; + a7[lastIx] |= 64; + return a7; + }); + cachedProperty(KeyPair, "priv", function priv() { + return this.eddsa.decodeInt(this.privBytes()); + }); + cachedProperty(KeyPair, "hash", function hash() { + return this.eddsa.hash().update(this.secret()).digest(); + }); + cachedProperty(KeyPair, "messagePrefix", function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); + }); + KeyPair.prototype.sign = function sign(message) { + assert4(this._secret, "KeyPair can only verify"); + return this.eddsa.sign(message, this); + }; + KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); + }; + KeyPair.prototype.getSecret = function getSecret(enc) { + assert4(this._secret, "KeyPair is public only"); + return utils.encode(this.secret(), enc); + }; + KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); + }; + exports$C$2 = KeyPair; + return exports$C$2; +} +function dew$A$2() { + if (_dewExec$A$2) + return exports$B$2; + _dewExec$A$2 = true; + var BN = dew$V$2(); + var utils = dew$T$2(); + var assert4 = utils.assert; + var cachedProperty = utils.cachedProperty; + var parseBytes = utils.parseBytes; + function Signature(eddsa, sig) { + this.eddsa = eddsa; + if (typeof sig !== "object") + sig = parseBytes(sig); + if (Array.isArray(sig)) { + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + assert4(sig.R && sig.S, "Signature without R or S"); + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; + } + cachedProperty(Signature, "S", function S6() { + return this.eddsa.decodeInt(this.Sencoded()); + }); + cachedProperty(Signature, "R", function R6() { + return this.eddsa.decodePoint(this.Rencoded()); + }); + cachedProperty(Signature, "Rencoded", function Rencoded() { + return this.eddsa.encodePoint(this.R()); + }); + cachedProperty(Signature, "Sencoded", function Sencoded() { + return this.eddsa.encodeInt(this.S()); + }); + Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); + }; + Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), "hex").toUpperCase(); + }; + exports$B$2 = Signature; + return exports$B$2; +} +function dew$z$2() { + if (_dewExec$z$2) + return exports$A$2; + _dewExec$z$2 = true; + var hash = dew$I$2(); + var curves = dew$G$2(); + var utils = dew$T$2(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var KeyPair = dew$B$2(); + var Signature = dew$A$2(); + function EDDSA(curve) { + assert4(curve === "ed25519", "only tested with ed25519 so far"); + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + curve = curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; + } + exports$A$2 = EDDSA; + EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r8 = this.hashInt(key.messagePrefix(), message); + var R6 = this.g.mul(r8); + var Rencoded = this.encodePoint(R6); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()); + var S6 = r8.add(s_).umod(this.curve.n); + return this.makeSignature({ + R: R6, + S: S6, + Rencoded + }); + }; + EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + var key = this.keyFromPublic(pub); + var h8 = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h8)); + return RplusAh.eq(SG); + }; + EDDSA.prototype.hashInt = function hashInt() { + var hash2 = this.hash(); + for (var i7 = 0; i7 < arguments.length; i7++) + hash2.update(arguments[i7]); + return utils.intFromLE(hash2.digest()).umod(this.curve.n); + }; + EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); + }; + EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); + }; + EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); + }; + EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray("le", this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0; + return enc; + }; + EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~128); + var xIsOdd = (bytes[lastIx] & 128) !== 0; + var y7 = utils.intFromLE(normed); + return this.curve.pointFromY(y7, xIsOdd); + }; + EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray("le", this.encodingLength); + }; + EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); + }; + EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; + }; + return exports$A$2; +} +function dew$y$2() { + if (_dewExec$y$2) + return exports$z$2; + _dewExec$y$2 = true; + var elliptic = exports$z$2; + elliptic.version = _package$2.version; + elliptic.utils = dew$T$2(); + elliptic.rand = dew$11$2(); + elliptic.curve = dew$O$2(); + elliptic.curves = dew$G$2(); + elliptic.ec = dew$C$2(); + elliptic.eddsa = dew$z$2(); + return exports$z$2; +} +function dew$x$2() { + if (_dewExec$x$2) + return module$2$2.exports; + _dewExec$x$2 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$5$2).negative = 0; + (this || _global$5$2).words = null; + (this || _global$5$2).length = 0; + (this || _global$5$2).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$5$2).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$5$2).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$5$2).words = [number & 67108863]; + (this || _global$5$2).length = 1; + } else if (number < 4503599627370496) { + (this || _global$5$2).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$5$2).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$5$2).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$5$2).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$5$2).words = [0]; + (this || _global$5$2).length = 1; + return this || _global$5$2; + } + (this || _global$5$2).length = Math.ceil(number.length / 3); + (this || _global$5$2).words = new Array((this || _global$5$2).length); + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + (this || _global$5$2).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$5$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$5$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$5$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$5$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$5$2).length = Math.ceil((number.length - start) / 6); + (this || _global$5$2).words = new Array((this || _global$5$2).length); + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + (this || _global$5$2).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$5$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$5$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$5$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$5$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$5$2).words = [0]; + (this || _global$5$2).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$5$2).words[0] + word < 67108864) { + (this || _global$5$2).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$5$2).words[0] + word < 67108864) { + (this || _global$5$2).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$5$2).length); + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + dest.words[i7] = (this || _global$5$2).words[i7]; + } + dest.length = (this || _global$5$2).length; + dest.negative = (this || _global$5$2).negative; + dest.red = (this || _global$5$2).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$5$2).length < size2) { + (this || _global$5$2).words[(this || _global$5$2).length++] = 0; + } + return this || _global$5$2; + }; + BN.prototype.strip = function strip() { + while ((this || _global$5$2).length > 1 && (this || _global$5$2).words[(this || _global$5$2).length - 1] === 0) { + (this || _global$5$2).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$5$2).length === 1 && (this || _global$5$2).words[0] === 0) { + (this || _global$5$2).negative = 0; + } + return this || _global$5$2; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$5$2).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + var w6 = (this || _global$5$2).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$5$2).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$5$2).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$5$2).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$5$2).words[0]; + if ((this || _global$5$2).length === 2) { + ret += (this || _global$5$2).words[1] * 67108864; + } else if ((this || _global$5$2).length === 3 && (this || _global$5$2).words[2] === 1) { + ret += 4503599627370496 + (this || _global$5$2).words[1] * 67108864; + } else if ((this || _global$5$2).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$5$2).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$5$2).words[(this || _global$5$2).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$5$2).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + var b8 = this._zeroBits((this || _global$5$2).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$5$2).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$5$2).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$5$2).negative ^= 1; + } + return this || _global$5$2; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$5$2).length < num.length) { + (this || _global$5$2).words[(this || _global$5$2).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$5$2).words[i7] = (this || _global$5$2).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$5$2).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$5$2); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$5$2); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$5$2).length > num.length) { + b8 = num; + } else { + b8 = this || _global$5$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$5$2).words[i7] = (this || _global$5$2).words[i7] & num.words[i7]; + } + (this || _global$5$2).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$5$2).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$5$2); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$5$2); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$5$2).length > num.length) { + a7 = this || _global$5$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$5$2).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$5$2) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$5$2).words[i7] = a7.words[i7]; + } + } + (this || _global$5$2).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$5$2).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$5$2); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$5$2).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$5$2); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$5$2).words[i7] = ~(this || _global$5$2).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$5$2).words[i7] = ~(this || _global$5$2).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$5$2).words[off3] = (this || _global$5$2).words[off3] | 1 << wbit; + } else { + (this || _global$5$2).words[off3] = (this || _global$5$2).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$5$2).negative !== 0 && num.negative === 0) { + (this || _global$5$2).negative = 0; + r8 = this.isub(num); + (this || _global$5$2).negative ^= 1; + return this._normSign(); + } else if ((this || _global$5$2).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$5$2).length > num.length) { + a7 = this || _global$5$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$5$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$5$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$5$2).length = a7.length; + if (carry !== 0) { + (this || _global$5$2).words[(this || _global$5$2).length] = carry; + (this || _global$5$2).length++; + } else if (a7 !== (this || _global$5$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$5$2).words[i7] = a7.words[i7]; + } + } + return this || _global$5$2; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$5$2).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$5$2).negative !== 0) { + (this || _global$5$2).negative = 0; + res = num.sub(this || _global$5$2); + (this || _global$5$2).negative = 1; + return res; + } + if ((this || _global$5$2).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$5$2); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$5$2).negative !== 0) { + (this || _global$5$2).negative = 0; + this.iadd(num); + (this || _global$5$2).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$5$2).negative = 0; + (this || _global$5$2).length = 1; + (this || _global$5$2).words[0] = 0; + return this || _global$5$2; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$5$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$5$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$5$2).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$5$2).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$5$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$5$2).words[i7] = a7.words[i7]; + } + } + (this || _global$5$2).length = Math.max((this || _global$5$2).length, i7); + if (a7 !== (this || _global$5$2)) { + (this || _global$5$2).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$5$2).length + num.length; + if ((this || _global$5$2).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$5$2, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$5$2, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$5$2, num, out); + } else { + res = jumboMulTo(this || _global$5$2, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$5$2).x = x7; + (this || _global$5$2).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$5$2).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$5$2).length + num.length); + return jumboMulTo(this || _global$5$2, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$5$2); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$5$2).length; i7++) { + var w6 = ((this || _global$5$2).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$5$2).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$5$2).words[i7] = carry; + (this || _global$5$2).length++; + } + return this || _global$5$2; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$5$2); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$5$2; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$5$2).length; i7++) { + var newCarry = (this || _global$5$2).words[i7] & carryMask; + var c7 = ((this || _global$5$2).words[i7] | 0) - newCarry << r8; + (this || _global$5$2).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$5$2).words[i7] = carry; + (this || _global$5$2).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$5$2).length - 1; i7 >= 0; i7--) { + (this || _global$5$2).words[i7 + s7] = (this || _global$5$2).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$5$2).words[i7] = 0; + } + (this || _global$5$2).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$5$2).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$5$2).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$5$2).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$5$2).length > s7) { + (this || _global$5$2).length -= s7; + for (i7 = 0; i7 < (this || _global$5$2).length; i7++) { + (this || _global$5$2).words[i7] = (this || _global$5$2).words[i7 + s7]; + } + } else { + (this || _global$5$2).words[0] = 0; + (this || _global$5$2).length = 1; + } + var carry = 0; + for (i7 = (this || _global$5$2).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$5$2).words[i7] | 0; + (this || _global$5$2).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$5$2).length === 0) { + (this || _global$5$2).words[0] = 0; + (this || _global$5$2).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$5$2).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$5$2).length <= s7) + return false; + var w6 = (this || _global$5$2).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$5$2).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$5$2).length <= s7) { + return this || _global$5$2; + } + if (r8 !== 0) { + s7++; + } + (this || _global$5$2).length = Math.min(s7, (this || _global$5$2).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$5$2).words[(this || _global$5$2).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$5$2).negative !== 0) { + if ((this || _global$5$2).length === 1 && ((this || _global$5$2).words[0] | 0) < num) { + (this || _global$5$2).words[0] = num - ((this || _global$5$2).words[0] | 0); + (this || _global$5$2).negative = 0; + return this || _global$5$2; + } + (this || _global$5$2).negative = 0; + this.isubn(num); + (this || _global$5$2).negative = 1; + return this || _global$5$2; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$5$2).words[0] += num; + for (var i7 = 0; i7 < (this || _global$5$2).length && (this || _global$5$2).words[i7] >= 67108864; i7++) { + (this || _global$5$2).words[i7] -= 67108864; + if (i7 === (this || _global$5$2).length - 1) { + (this || _global$5$2).words[i7 + 1] = 1; + } else { + (this || _global$5$2).words[i7 + 1]++; + } + } + (this || _global$5$2).length = Math.max((this || _global$5$2).length, i7 + 1); + return this || _global$5$2; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$5$2).negative !== 0) { + (this || _global$5$2).negative = 0; + this.iaddn(num); + (this || _global$5$2).negative = 1; + return this || _global$5$2; + } + (this || _global$5$2).words[0] -= num; + if ((this || _global$5$2).length === 1 && (this || _global$5$2).words[0] < 0) { + (this || _global$5$2).words[0] = -(this || _global$5$2).words[0]; + (this || _global$5$2).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$5$2).length && (this || _global$5$2).words[i7] < 0; i7++) { + (this || _global$5$2).words[i7] += 67108864; + (this || _global$5$2).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$5$2).negative = 0; + return this || _global$5$2; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$5$2).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$5$2).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$5$2).length - shift; i7++) { + w6 = ((this || _global$5$2).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$5$2).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$5$2).length; i7++) { + w6 = -((this || _global$5$2).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$5$2).words[i7] = w6 & 67108863; + } + (this || _global$5$2).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$5$2).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$5$2).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$5$2).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$5$2).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$5$2).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$5$2 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$5$2).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$5$2).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$5$2).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$5$2).words[i7] | 0) + carry * 67108864; + (this || _global$5$2).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$5$2; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$5$2; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$5$2).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$5$2).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$5$2).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$5$2).length <= s7) { + this._expand(s7 + 1); + (this || _global$5$2).words[s7] |= q5; + return this || _global$5$2; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$5$2).length; i7++) { + var w6 = (this || _global$5$2).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$5$2).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$5$2).words[i7] = carry; + (this || _global$5$2).length++; + } + return this || _global$5$2; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$5$2).length === 1 && (this || _global$5$2).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$5$2).negative !== 0 && !negative) + return -1; + if ((this || _global$5$2).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$5$2).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$5$2).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$5$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$5$2).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$5$2).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$5$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$5$2).length > num.length) + return 1; + if ((this || _global$5$2).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$5$2).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$5$2).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$5$2).red, "Already a number in reduction context"); + assert4((this || _global$5$2).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$5$2)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$5$2).red, "fromRed works only with numbers in reduction context"); + return (this || _global$5$2).red.convertFrom(this || _global$5$2); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$5$2).red = ctx; + return this || _global$5$2; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$5$2).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$5$2).red, "redAdd works only with red numbers"); + return (this || _global$5$2).red.add(this || _global$5$2, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$5$2).red, "redIAdd works only with red numbers"); + return (this || _global$5$2).red.iadd(this || _global$5$2, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$5$2).red, "redSub works only with red numbers"); + return (this || _global$5$2).red.sub(this || _global$5$2, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$5$2).red, "redISub works only with red numbers"); + return (this || _global$5$2).red.isub(this || _global$5$2, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$5$2).red, "redShl works only with red numbers"); + return (this || _global$5$2).red.shl(this || _global$5$2, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$5$2).red, "redMul works only with red numbers"); + (this || _global$5$2).red._verify2(this || _global$5$2, num); + return (this || _global$5$2).red.mul(this || _global$5$2, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$5$2).red, "redMul works only with red numbers"); + (this || _global$5$2).red._verify2(this || _global$5$2, num); + return (this || _global$5$2).red.imul(this || _global$5$2, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$5$2).red, "redSqr works only with red numbers"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.sqr(this || _global$5$2); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$5$2).red, "redISqr works only with red numbers"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.isqr(this || _global$5$2); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$5$2).red, "redSqrt works only with red numbers"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.sqrt(this || _global$5$2); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$5$2).red, "redInvm works only with red numbers"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.invm(this || _global$5$2); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$5$2).red, "redNeg works only with red numbers"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.neg(this || _global$5$2); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$5$2).red && !num.red, "redPow(normalNum)"); + (this || _global$5$2).red._verify1(this || _global$5$2); + return (this || _global$5$2).red.pow(this || _global$5$2, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$5$2).name = name2; + (this || _global$5$2).p = new BN(p7, 16); + (this || _global$5$2).n = (this || _global$5$2).p.bitLength(); + (this || _global$5$2).k = new BN(1).iushln((this || _global$5$2).n).isub((this || _global$5$2).p); + (this || _global$5$2).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$5$2).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$5$2).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$5$2).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$5$2).n); + var cmp = rlen < (this || _global$5$2).n ? -1 : r8.ucmp((this || _global$5$2).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$5$2).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$5$2).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$5$2).k); + }; + function K256() { + MPrime.call(this || _global$5$2, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$5$2, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$5$2, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$5$2, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$5$2).m = prime.p; + (this || _global$5$2).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$5$2).m = m7; + (this || _global$5$2).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$5$2).prime) + return (this || _global$5$2).prime.ireduce(a7)._forceRed(this || _global$5$2); + return a7.umod((this || _global$5$2).m)._forceRed(this || _global$5$2); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$5$2).m.sub(a7)._forceRed(this || _global$5$2); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$5$2).m) >= 0) { + res.isub((this || _global$5$2).m); + } + return res._forceRed(this || _global$5$2); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$5$2).m) >= 0) { + res.isub((this || _global$5$2).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$5$2).m); + } + return res._forceRed(this || _global$5$2); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$5$2).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$5$2).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$5$2).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$5$2).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$5$2); + var nOne = one.redNeg(); + var lpow = (this || _global$5$2).m.subn(1).iushrn(1); + var z6 = (this || _global$5$2).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$5$2); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$5$2).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$5$2); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$5$2); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$5$2).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$5$2, m7); + (this || _global$5$2).shift = (this || _global$5$2).m.bitLength(); + if ((this || _global$5$2).shift % 26 !== 0) { + (this || _global$5$2).shift += 26 - (this || _global$5$2).shift % 26; + } + (this || _global$5$2).r = new BN(1).iushln((this || _global$5$2).shift); + (this || _global$5$2).r2 = this.imod((this || _global$5$2).r.sqr()); + (this || _global$5$2).rinv = (this || _global$5$2).r._invmp((this || _global$5$2).m); + (this || _global$5$2).minv = (this || _global$5$2).rinv.mul((this || _global$5$2).r).isubn(1).div((this || _global$5$2).m); + (this || _global$5$2).minv = (this || _global$5$2).minv.umod((this || _global$5$2).r); + (this || _global$5$2).minv = (this || _global$5$2).r.sub((this || _global$5$2).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$5$2).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$5$2).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$5$2).shift).mul((this || _global$5$2).minv).imaskn((this || _global$5$2).shift).mul((this || _global$5$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$5$2).shift); + var res = u7; + if (u7.cmp((this || _global$5$2).m) >= 0) { + res = u7.isub((this || _global$5$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$5$2).m); + } + return res._forceRed(this || _global$5$2); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$5$2); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$5$2).shift).mul((this || _global$5$2).minv).imaskn((this || _global$5$2).shift).mul((this || _global$5$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$5$2).shift); + var res = u7; + if (u7.cmp((this || _global$5$2).m) >= 0) { + res = u7.isub((this || _global$5$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$5$2).m); + } + return res._forceRed(this || _global$5$2); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$5$2).m).mul((this || _global$5$2).r2)); + return res._forceRed(this || _global$5$2); + }; + })(module$2$2, exports$y$2); + return module$2$2.exports; +} +function dew$w$2() { + if (_dewExec$w$2) + return exports$x$2; + _dewExec$w$2 = true; + var process$1$1 = process4; + var buffer$1 = buffer; + var Buffer4 = buffer$1.Buffer; + var safer = {}; + var key; + for (key in buffer$1) { + if (!buffer$1.hasOwnProperty(key)) + continue; + if (key === "SlowBuffer" || key === "Buffer") + continue; + safer[key] = buffer$1[key]; + } + var Safer = safer.Buffer = {}; + for (key in Buffer4) { + if (!Buffer4.hasOwnProperty(key)) + continue; + if (key === "allocUnsafe" || key === "allocUnsafeSlow") + continue; + Safer[key] = Buffer4[key]; + } + safer.Buffer.prototype = Buffer4.prototype; + if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function(value2, encodingOrOffset, length) { + if (typeof value2 === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value2); + } + if (value2 && typeof value2.length === "undefined") { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value2); + } + return Buffer4(value2, encodingOrOffset, length); + }; + } + if (!Safer.alloc) { + Safer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size2); + } + if (size2 < 0 || size2 >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size2 + '" is invalid for option "size"'); + } + var buf = Buffer4(size2); + if (!fill2 || fill2.length === 0) { + buf.fill(0); + } else if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + return buf; + }; + } + if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process$1$1.binding("buffer").kStringMaxLength; + } catch (e10) { + } + } + if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + }; + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength; + } + } + exports$x$2 = safer; + return exports$x$2; +} +function dew$v$2() { + if (_dewExec$v$2) + return exports$w$2; + _dewExec$v$2 = true; + const inherits2 = dew$f2(); + function Reporter(options) { + this._reporterState = { + obj: null, + path: [], + options: options || {}, + errors: [] + }; + } + exports$w$2.Reporter = Reporter; + Reporter.prototype.isError = function isError3(obj) { + return obj instanceof ReporterError; + }; + Reporter.prototype.save = function save() { + const state = this._reporterState; + return { + obj: state.obj, + pathLen: state.path.length + }; + }; + Reporter.prototype.restore = function restore(data) { + const state = this._reporterState; + state.obj = data.obj; + state.path = state.path.slice(0, data.pathLen); + }; + Reporter.prototype.enterKey = function enterKey(key) { + return this._reporterState.path.push(key); + }; + Reporter.prototype.exitKey = function exitKey(index4) { + const state = this._reporterState; + state.path = state.path.slice(0, index4 - 1); + }; + Reporter.prototype.leaveKey = function leaveKey(index4, key, value2) { + const state = this._reporterState; + this.exitKey(index4); + if (state.obj !== null) + state.obj[key] = value2; + }; + Reporter.prototype.path = function path2() { + return this._reporterState.path.join("/"); + }; + Reporter.prototype.enterObject = function enterObject() { + const state = this._reporterState; + const prev = state.obj; + state.obj = {}; + return prev; + }; + Reporter.prototype.leaveObject = function leaveObject(prev) { + const state = this._reporterState; + const now2 = state.obj; + state.obj = prev; + return now2; + }; + Reporter.prototype.error = function error2(msg) { + let err; + const state = this._reporterState; + const inherited = msg instanceof ReporterError; + if (inherited) { + err = msg; + } else { + err = new ReporterError(state.path.map(function(elem) { + return "[" + JSON.stringify(elem) + "]"; + }).join(""), msg.message || msg, msg.stack); + } + if (!state.options.partial) + throw err; + if (!inherited) + state.errors.push(err); + return err; + }; + Reporter.prototype.wrapResult = function wrapResult(result2) { + const state = this._reporterState; + if (!state.options.partial) + return result2; + return { + result: this.isError(result2) ? null : result2, + errors: state.errors + }; + }; + function ReporterError(path2, msg) { + this.path = path2; + this.rethrow(msg); + } + inherits2(ReporterError, Error); + ReporterError.prototype.rethrow = function rethrow(msg) { + this.message = msg + " at: " + (this.path || "(shallow)"); + if (Error.captureStackTrace) + Error.captureStackTrace(this, ReporterError); + if (!this.stack) { + try { + throw new Error(this.message); + } catch (e10) { + this.stack = e10.stack; + } + } + return this; + }; + return exports$w$2; +} +function dew$u$2() { + if (_dewExec$u$2) + return exports$v$2; + _dewExec$u$2 = true; + const inherits2 = dew$f2(); + const Reporter = dew$v$2().Reporter; + const Buffer4 = dew$w$2().Buffer; + function DecoderBuffer(base, options) { + Reporter.call(this, options); + if (!Buffer4.isBuffer(base)) { + this.error("Input not Buffer"); + return; + } + this.base = base; + this.offset = 0; + this.length = base.length; + } + inherits2(DecoderBuffer, Reporter); + exports$v$2.DecoderBuffer = DecoderBuffer; + DecoderBuffer.isDecoderBuffer = function isDecoderBuffer(data) { + if (data instanceof DecoderBuffer) { + return true; + } + const isCompatible = typeof data === "object" && Buffer4.isBuffer(data.base) && data.constructor.name === "DecoderBuffer" && typeof data.offset === "number" && typeof data.length === "number" && typeof data.save === "function" && typeof data.restore === "function" && typeof data.isEmpty === "function" && typeof data.readUInt8 === "function" && typeof data.skip === "function" && typeof data.raw === "function"; + return isCompatible; + }; + DecoderBuffer.prototype.save = function save() { + return { + offset: this.offset, + reporter: Reporter.prototype.save.call(this) + }; + }; + DecoderBuffer.prototype.restore = function restore(save) { + const res = new DecoderBuffer(this.base); + res.offset = save.offset; + res.length = this.offset; + this.offset = save.offset; + Reporter.prototype.restore.call(this, save.reporter); + return res; + }; + DecoderBuffer.prototype.isEmpty = function isEmpty4() { + return this.offset === this.length; + }; + DecoderBuffer.prototype.readUInt8 = function readUInt8(fail2) { + if (this.offset + 1 <= this.length) + return this.base.readUInt8(this.offset++, true); + else + return this.error(fail2 || "DecoderBuffer overrun"); + }; + DecoderBuffer.prototype.skip = function skip(bytes, fail2) { + if (!(this.offset + bytes <= this.length)) + return this.error(fail2 || "DecoderBuffer overrun"); + const res = new DecoderBuffer(this.base); + res._reporterState = this._reporterState; + res.offset = this.offset; + res.length = this.offset + bytes; + this.offset += bytes; + return res; + }; + DecoderBuffer.prototype.raw = function raw(save) { + return this.base.slice(save ? save.offset : this.offset, this.length); + }; + function EncoderBuffer(value2, reporter) { + if (Array.isArray(value2)) { + this.length = 0; + this.value = value2.map(function(item) { + if (!EncoderBuffer.isEncoderBuffer(item)) + item = new EncoderBuffer(item, reporter); + this.length += item.length; + return item; + }, this); + } else if (typeof value2 === "number") { + if (!(0 <= value2 && value2 <= 255)) + return reporter.error("non-byte EncoderBuffer value"); + this.value = value2; + this.length = 1; + } else if (typeof value2 === "string") { + this.value = value2; + this.length = Buffer4.byteLength(value2); + } else if (Buffer4.isBuffer(value2)) { + this.value = value2; + this.length = value2.length; + } else { + return reporter.error("Unsupported type: " + typeof value2); + } + } + exports$v$2.EncoderBuffer = EncoderBuffer; + EncoderBuffer.isEncoderBuffer = function isEncoderBuffer(data) { + if (data instanceof EncoderBuffer) { + return true; + } + const isCompatible = typeof data === "object" && data.constructor.name === "EncoderBuffer" && typeof data.length === "number" && typeof data.join === "function"; + return isCompatible; + }; + EncoderBuffer.prototype.join = function join3(out, offset) { + if (!out) + out = Buffer4.alloc(this.length); + if (!offset) + offset = 0; + if (this.length === 0) + return out; + if (Array.isArray(this.value)) { + this.value.forEach(function(item) { + item.join(out, offset); + offset += item.length; + }); + } else { + if (typeof this.value === "number") + out[offset] = this.value; + else if (typeof this.value === "string") + out.write(this.value, offset); + else if (Buffer4.isBuffer(this.value)) + this.value.copy(out, offset); + offset += this.length; + } + return out; + }; + return exports$v$2; +} +function dew$t$2() { + if (_dewExec$t$2) + return exports$u$2; + _dewExec$t$2 = true; + const Reporter = dew$v$2().Reporter; + const EncoderBuffer = dew$u$2().EncoderBuffer; + const DecoderBuffer = dew$u$2().DecoderBuffer; + const assert4 = dew$2m(); + const tags6 = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"]; + const methods = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(tags6); + const overrided = ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"]; + function Node(enc, parent2, name2) { + const state = {}; + this._baseState = state; + state.name = name2; + state.enc = enc; + state.parent = parent2 || null; + state.children = null; + state.tag = null; + state.args = null; + state.reverseArgs = null; + state.choice = null; + state.optional = false; + state.any = false; + state.obj = false; + state.use = null; + state.useDecoder = null; + state.key = null; + state["default"] = null; + state.explicit = null; + state.implicit = null; + state.contains = null; + if (!state.parent) { + state.children = []; + this._wrap(); + } + } + exports$u$2 = Node; + const stateProps = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; + Node.prototype.clone = function clone2() { + const state = this._baseState; + const cstate = {}; + stateProps.forEach(function(prop) { + cstate[prop] = state[prop]; + }); + const res = new this.constructor(cstate.parent); + res._baseState = cstate; + return res; + }; + Node.prototype._wrap = function wrap2() { + const state = this._baseState; + methods.forEach(function(method2) { + this[method2] = function _wrappedMethod() { + const clone2 = new this.constructor(this); + state.children.push(clone2); + return clone2[method2].apply(clone2, arguments); + }; + }, this); + }; + Node.prototype._init = function init2(body) { + const state = this._baseState; + assert4(state.parent === null); + body.call(this); + state.children = state.children.filter(function(child) { + return child._baseState.parent === this; + }, this); + assert4.equal(state.children.length, 1, "Root node can have only one child"); + }; + Node.prototype._useArgs = function useArgs(args) { + const state = this._baseState; + const children = args.filter(function(arg) { + return arg instanceof this.constructor; + }, this); + args = args.filter(function(arg) { + return !(arg instanceof this.constructor); + }, this); + if (children.length !== 0) { + assert4(state.children === null); + state.children = children; + children.forEach(function(child) { + child._baseState.parent = this; + }, this); + } + if (args.length !== 0) { + assert4(state.args === null); + state.args = args; + state.reverseArgs = args.map(function(arg) { + if (typeof arg !== "object" || arg.constructor !== Object) + return arg; + const res = {}; + Object.keys(arg).forEach(function(key) { + if (key == (key | 0)) + key |= 0; + const value2 = arg[key]; + res[value2] = key; + }); + return res; + }); + } + }; + overrided.forEach(function(method2) { + Node.prototype[method2] = function _overrided() { + const state = this._baseState; + throw new Error(method2 + " not implemented for encoding: " + state.enc); + }; + }); + tags6.forEach(function(tag) { + Node.prototype[tag] = function _tagMethod() { + const state = this._baseState; + const args = Array.prototype.slice.call(arguments); + assert4(state.tag === null); + state.tag = tag; + this._useArgs(args); + return this; + }; + }); + Node.prototype.use = function use(item) { + assert4(item); + const state = this._baseState; + assert4(state.use === null); + state.use = item; + return this; + }; + Node.prototype.optional = function optional() { + const state = this._baseState; + state.optional = true; + return this; + }; + Node.prototype.def = function def(val) { + const state = this._baseState; + assert4(state["default"] === null); + state["default"] = val; + state.optional = true; + return this; + }; + Node.prototype.explicit = function explicit(num) { + const state = this._baseState; + assert4(state.explicit === null && state.implicit === null); + state.explicit = num; + return this; + }; + Node.prototype.implicit = function implicit(num) { + const state = this._baseState; + assert4(state.explicit === null && state.implicit === null); + state.implicit = num; + return this; + }; + Node.prototype.obj = function obj() { + const state = this._baseState; + const args = Array.prototype.slice.call(arguments); + state.obj = true; + if (args.length !== 0) + this._useArgs(args); + return this; + }; + Node.prototype.key = function key(newKey) { + const state = this._baseState; + assert4(state.key === null); + state.key = newKey; + return this; + }; + Node.prototype.any = function any() { + const state = this._baseState; + state.any = true; + return this; + }; + Node.prototype.choice = function choice(obj) { + const state = this._baseState; + assert4(state.choice === null); + state.choice = obj; + this._useArgs(Object.keys(obj).map(function(key) { + return obj[key]; + })); + return this; + }; + Node.prototype.contains = function contains2(item) { + const state = this._baseState; + assert4(state.use === null); + state.contains = item; + return this; + }; + Node.prototype._decode = function decode2(input, options) { + const state = this._baseState; + if (state.parent === null) + return input.wrapResult(state.children[0]._decode(input, options)); + let result2 = state["default"]; + let present = true; + let prevKey = null; + if (state.key !== null) + prevKey = input.enterKey(state.key); + if (state.optional) { + let tag = null; + if (state.explicit !== null) + tag = state.explicit; + else if (state.implicit !== null) + tag = state.implicit; + else if (state.tag !== null) + tag = state.tag; + if (tag === null && !state.any) { + const save = input.save(); + try { + if (state.choice === null) + this._decodeGeneric(state.tag, input, options); + else + this._decodeChoice(input, options); + present = true; + } catch (e10) { + present = false; + } + input.restore(save); + } else { + present = this._peekTag(input, tag, state.any); + if (input.isError(present)) + return present; + } + } + let prevObj; + if (state.obj && present) + prevObj = input.enterObject(); + if (present) { + if (state.explicit !== null) { + const explicit = this._decodeTag(input, state.explicit); + if (input.isError(explicit)) + return explicit; + input = explicit; + } + const start = input.offset; + if (state.use === null && state.choice === null) { + let save; + if (state.any) + save = input.save(); + const body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any); + if (input.isError(body)) + return body; + if (state.any) + result2 = input.raw(save); + else + input = body; + } + if (options && options.track && state.tag !== null) + options.track(input.path(), start, input.length, "tagged"); + if (options && options.track && state.tag !== null) + options.track(input.path(), input.offset, input.length, "content"); + if (state.any) + ; + else if (state.choice === null) { + result2 = this._decodeGeneric(state.tag, input, options); + } else { + result2 = this._decodeChoice(input, options); + } + if (input.isError(result2)) + return result2; + if (!state.any && state.choice === null && state.children !== null) { + state.children.forEach(function decodeChildren(child) { + child._decode(input, options); + }); + } + if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) { + const data = new DecoderBuffer(result2); + result2 = this._getUse(state.contains, input._reporterState.obj)._decode(data, options); + } + } + if (state.obj && present) + result2 = input.leaveObject(prevObj); + if (state.key !== null && (result2 !== null || present === true)) + input.leaveKey(prevKey, state.key, result2); + else if (prevKey !== null) + input.exitKey(prevKey); + return result2; + }; + Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { + const state = this._baseState; + if (tag === "seq" || tag === "set") + return null; + if (tag === "seqof" || tag === "setof") + return this._decodeList(input, tag, state.args[0], options); + else if (/str$/.test(tag)) + return this._decodeStr(input, tag, options); + else if (tag === "objid" && state.args) + return this._decodeObjid(input, state.args[0], state.args[1], options); + else if (tag === "objid") + return this._decodeObjid(input, null, null, options); + else if (tag === "gentime" || tag === "utctime") + return this._decodeTime(input, tag, options); + else if (tag === "null_") + return this._decodeNull(input, options); + else if (tag === "bool") + return this._decodeBool(input, options); + else if (tag === "objDesc") + return this._decodeStr(input, tag, options); + else if (tag === "int" || tag === "enum") + return this._decodeInt(input, state.args && state.args[0], options); + if (state.use !== null) { + return this._getUse(state.use, input._reporterState.obj)._decode(input, options); + } else { + return input.error("unknown tag: " + tag); + } + }; + Node.prototype._getUse = function _getUse(entity, obj) { + const state = this._baseState; + state.useDecoder = this._use(entity, obj); + assert4(state.useDecoder._baseState.parent === null); + state.useDecoder = state.useDecoder._baseState.children[0]; + if (state.implicit !== state.useDecoder._baseState.implicit) { + state.useDecoder = state.useDecoder.clone(); + state.useDecoder._baseState.implicit = state.implicit; + } + return state.useDecoder; + }; + Node.prototype._decodeChoice = function decodeChoice(input, options) { + const state = this._baseState; + let result2 = null; + let match = false; + Object.keys(state.choice).some(function(key) { + const save = input.save(); + const node = state.choice[key]; + try { + const value2 = node._decode(input, options); + if (input.isError(value2)) + return false; + result2 = { + type: key, + value: value2 + }; + match = true; + } catch (e10) { + input.restore(save); + return false; + } + return true; + }, this); + if (!match) + return input.error("Choice not matched"); + return result2; + }; + Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { + return new EncoderBuffer(data, this.reporter); + }; + Node.prototype._encode = function encode2(data, reporter, parent2) { + const state = this._baseState; + if (state["default"] !== null && state["default"] === data) + return; + const result2 = this._encodeValue(data, reporter, parent2); + if (result2 === void 0) + return; + if (this._skipDefault(result2, reporter, parent2)) + return; + return result2; + }; + Node.prototype._encodeValue = function encode2(data, reporter, parent2) { + const state = this._baseState; + if (state.parent === null) + return state.children[0]._encode(data, reporter || new Reporter()); + let result2 = null; + this.reporter = reporter; + if (state.optional && data === void 0) { + if (state["default"] !== null) + data = state["default"]; + else + return; + } + let content = null; + let primitive = false; + if (state.any) { + result2 = this._createEncoderBuffer(data); + } else if (state.choice) { + result2 = this._encodeChoice(data, reporter); + } else if (state.contains) { + content = this._getUse(state.contains, parent2)._encode(data, reporter); + primitive = true; + } else if (state.children) { + content = state.children.map(function(child) { + if (child._baseState.tag === "null_") + return child._encode(null, reporter, data); + if (child._baseState.key === null) + return reporter.error("Child should have a key"); + const prevKey = reporter.enterKey(child._baseState.key); + if (typeof data !== "object") + return reporter.error("Child expected, but input is not object"); + const res = child._encode(data[child._baseState.key], reporter, data); + reporter.leaveKey(prevKey); + return res; + }, this).filter(function(child) { + return child; + }); + content = this._createEncoderBuffer(content); + } else { + if (state.tag === "seqof" || state.tag === "setof") { + if (!(state.args && state.args.length === 1)) + return reporter.error("Too many args for : " + state.tag); + if (!Array.isArray(data)) + return reporter.error("seqof/setof, but data is not Array"); + const child = this.clone(); + child._baseState.implicit = null; + content = this._createEncoderBuffer(data.map(function(item) { + const state2 = this._baseState; + return this._getUse(state2.args[0], data)._encode(item, reporter); + }, child)); + } else if (state.use !== null) { + result2 = this._getUse(state.use, parent2)._encode(data, reporter); + } else { + content = this._encodePrimitive(state.tag, data); + primitive = true; + } + } + if (!state.any && state.choice === null) { + const tag = state.implicit !== null ? state.implicit : state.tag; + const cls = state.implicit === null ? "universal" : "context"; + if (tag === null) { + if (state.use === null) + reporter.error("Tag could be omitted only for .use()"); + } else { + if (state.use === null) + result2 = this._encodeComposite(tag, primitive, cls, content); + } + } + if (state.explicit !== null) + result2 = this._encodeComposite(state.explicit, false, "context", result2); + return result2; + }; + Node.prototype._encodeChoice = function encodeChoice(data, reporter) { + const state = this._baseState; + const node = state.choice[data.type]; + if (!node) { + assert4(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice))); + } + return node._encode(data.value, reporter); + }; + Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { + const state = this._baseState; + if (/str$/.test(tag)) + return this._encodeStr(data, tag); + else if (tag === "objid" && state.args) + return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); + else if (tag === "objid") + return this._encodeObjid(data, null, null); + else if (tag === "gentime" || tag === "utctime") + return this._encodeTime(data, tag); + else if (tag === "null_") + return this._encodeNull(); + else if (tag === "int" || tag === "enum") + return this._encodeInt(data, state.args && state.reverseArgs[0]); + else if (tag === "bool") + return this._encodeBool(data); + else if (tag === "objDesc") + return this._encodeStr(data, tag); + else + throw new Error("Unsupported tag: " + tag); + }; + Node.prototype._isNumstr = function isNumstr(str2) { + return /^[0-9 ]*$/.test(str2); + }; + Node.prototype._isPrintstr = function isPrintstr(str2) { + return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str2); + }; + return exports$u$2; +} +function dew$s$2() { + if (_dewExec$s$2) + return exports$t$2; + _dewExec$s$2 = true; + function reverse2(map4) { + const res = {}; + Object.keys(map4).forEach(function(key) { + if ((key | 0) == key) + key = key | 0; + const value2 = map4[key]; + res[value2] = key; + }); + return res; + } + exports$t$2.tagClass = { + 0: "universal", + 1: "application", + 2: "context", + 3: "private" + }; + exports$t$2.tagClassByName = reverse2(exports$t$2.tagClass); + exports$t$2.tag = { + 0: "end", + 1: "bool", + 2: "int", + 3: "bitstr", + 4: "octstr", + 5: "null_", + 6: "objid", + 7: "objDesc", + 8: "external", + 9: "real", + 10: "enum", + 11: "embed", + 12: "utf8str", + 13: "relativeOid", + 16: "seq", + 17: "set", + 18: "numstr", + 19: "printstr", + 20: "t61str", + 21: "videostr", + 22: "ia5str", + 23: "utctime", + 24: "gentime", + 25: "graphstr", + 26: "iso646str", + 27: "genstr", + 28: "unistr", + 29: "charstr", + 30: "bmpstr" + }; + exports$t$2.tagByName = reverse2(exports$t$2.tag); + return exports$t$2; +} +function dew$r$2() { + if (_dewExec$r$2) + return exports$s$2; + _dewExec$r$2 = true; + const inherits2 = dew$f2(); + const Buffer4 = dew$w$2().Buffer; + const Node = dew$t$2(); + const der = dew$s$2(); + function DEREncoder(entity) { + this.enc = "der"; + this.name = entity.name; + this.entity = entity; + this.tree = new DERNode(); + this.tree._init(entity.body); + } + exports$s$2 = DEREncoder; + DEREncoder.prototype.encode = function encode2(data, reporter) { + return this.tree._encode(data, reporter).join(); + }; + function DERNode(parent2) { + Node.call(this, "der", parent2); + } + inherits2(DERNode, Node); + DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) { + const encodedTag = encodeTag(tag, primitive, cls, this.reporter); + if (content.length < 128) { + const header2 = Buffer4.alloc(2); + header2[0] = encodedTag; + header2[1] = content.length; + return this._createEncoderBuffer([header2, content]); + } + let lenOctets = 1; + for (let i7 = content.length; i7 >= 256; i7 >>= 8) + lenOctets++; + const header = Buffer4.alloc(1 + 1 + lenOctets); + header[0] = encodedTag; + header[1] = 128 | lenOctets; + for (let i7 = 1 + lenOctets, j6 = content.length; j6 > 0; i7--, j6 >>= 8) + header[i7] = j6 & 255; + return this._createEncoderBuffer([header, content]); + }; + DERNode.prototype._encodeStr = function encodeStr(str2, tag) { + if (tag === "bitstr") { + return this._createEncoderBuffer([str2.unused | 0, str2.data]); + } else if (tag === "bmpstr") { + const buf = Buffer4.alloc(str2.length * 2); + for (let i7 = 0; i7 < str2.length; i7++) { + buf.writeUInt16BE(str2.charCodeAt(i7), i7 * 2); + } + return this._createEncoderBuffer(buf); + } else if (tag === "numstr") { + if (!this._isNumstr(str2)) { + return this.reporter.error("Encoding of string type: numstr supports only digits and space"); + } + return this._createEncoderBuffer(str2); + } else if (tag === "printstr") { + if (!this._isPrintstr(str2)) { + return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"); + } + return this._createEncoderBuffer(str2); + } else if (/str$/.test(tag)) { + return this._createEncoderBuffer(str2); + } else if (tag === "objDesc") { + return this._createEncoderBuffer(str2); + } else { + return this.reporter.error("Encoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._encodeObjid = function encodeObjid(id, values2, relative2) { + if (typeof id === "string") { + if (!values2) + return this.reporter.error("string objid given, but no values map found"); + if (!values2.hasOwnProperty(id)) + return this.reporter.error("objid not found in values map"); + id = values2[id].split(/[\s.]+/g); + for (let i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } else if (Array.isArray(id)) { + id = id.slice(); + for (let i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } + if (!Array.isArray(id)) { + return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(id)); + } + if (!relative2) { + if (id[1] >= 40) + return this.reporter.error("Second objid identifier OOB"); + id.splice(0, 2, id[0] * 40 + id[1]); + } + let size2 = 0; + for (let i7 = 0; i7 < id.length; i7++) { + let ident = id[i7]; + for (size2++; ident >= 128; ident >>= 7) + size2++; + } + const objid = Buffer4.alloc(size2); + let offset = objid.length - 1; + for (let i7 = id.length - 1; i7 >= 0; i7--) { + let ident = id[i7]; + objid[offset--] = ident & 127; + while ((ident >>= 7) > 0) + objid[offset--] = 128 | ident & 127; + } + return this._createEncoderBuffer(objid); + }; + function two(num) { + if (num < 10) + return "0" + num; + else + return num; + } + DERNode.prototype._encodeTime = function encodeTime(time2, tag) { + let str2; + const date = new Date(time2); + if (tag === "gentime") { + str2 = [two(date.getUTCFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else if (tag === "utctime") { + str2 = [two(date.getUTCFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else { + this.reporter.error("Encoding " + tag + " time is not supported yet"); + } + return this._encodeStr(str2, "octstr"); + }; + DERNode.prototype._encodeNull = function encodeNull() { + return this._createEncoderBuffer(""); + }; + DERNode.prototype._encodeInt = function encodeInt(num, values2) { + if (typeof num === "string") { + if (!values2) + return this.reporter.error("String int or enum given, but no values map"); + if (!values2.hasOwnProperty(num)) { + return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num)); + } + num = values2[num]; + } + if (typeof num !== "number" && !Buffer4.isBuffer(num)) { + const numArray = num.toArray(); + if (!num.sign && numArray[0] & 128) { + numArray.unshift(0); + } + num = Buffer4.from(numArray); + } + if (Buffer4.isBuffer(num)) { + let size3 = num.length; + if (num.length === 0) + size3++; + const out2 = Buffer4.alloc(size3); + num.copy(out2); + if (num.length === 0) + out2[0] = 0; + return this._createEncoderBuffer(out2); + } + if (num < 128) + return this._createEncoderBuffer(num); + if (num < 256) + return this._createEncoderBuffer([0, num]); + let size2 = 1; + for (let i7 = num; i7 >= 256; i7 >>= 8) + size2++; + const out = new Array(size2); + for (let i7 = out.length - 1; i7 >= 0; i7--) { + out[i7] = num & 255; + num >>= 8; + } + if (out[0] & 128) { + out.unshift(0); + } + return this._createEncoderBuffer(Buffer4.from(out)); + }; + DERNode.prototype._encodeBool = function encodeBool(value2) { + return this._createEncoderBuffer(value2 ? 255 : 0); + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getEncoder("der").tree; + }; + DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent2) { + const state = this._baseState; + let i7; + if (state["default"] === null) + return false; + const data = dataBuffer.join(); + if (state.defaultBuffer === void 0) + state.defaultBuffer = this._encodeValue(state["default"], reporter, parent2).join(); + if (data.length !== state.defaultBuffer.length) + return false; + for (i7 = 0; i7 < data.length; i7++) + if (data[i7] !== state.defaultBuffer[i7]) + return false; + return true; + }; + function encodeTag(tag, primitive, cls, reporter) { + let res; + if (tag === "seqof") + tag = "seq"; + else if (tag === "setof") + tag = "set"; + if (der.tagByName.hasOwnProperty(tag)) + res = der.tagByName[tag]; + else if (typeof tag === "number" && (tag | 0) === tag) + res = tag; + else + return reporter.error("Unknown tag: " + tag); + if (res >= 31) + return reporter.error("Multi-octet tag encoding unsupported"); + if (!primitive) + res |= 32; + res |= der.tagClassByName[cls || "universal"] << 6; + return res; + } + return exports$s$2; +} +function dew$q$2() { + if (_dewExec$q$2) + return exports$r$2; + _dewExec$q$2 = true; + const inherits2 = dew$f2(); + const DEREncoder = dew$r$2(); + function PEMEncoder(entity) { + DEREncoder.call(this, entity); + this.enc = "pem"; + } + inherits2(PEMEncoder, DEREncoder); + exports$r$2 = PEMEncoder; + PEMEncoder.prototype.encode = function encode2(data, options) { + const buf = DEREncoder.prototype.encode.call(this, data); + const p7 = buf.toString("base64"); + const out = ["-----BEGIN " + options.label + "-----"]; + for (let i7 = 0; i7 < p7.length; i7 += 64) + out.push(p7.slice(i7, i7 + 64)); + out.push("-----END " + options.label + "-----"); + return out.join("\n"); + }; + return exports$r$2; +} +function dew$p$2() { + if (_dewExec$p$2) + return exports$q$2; + _dewExec$p$2 = true; + const encoders = exports$q$2; + encoders.der = dew$r$2(); + encoders.pem = dew$q$2(); + return exports$q$2; +} +function dew$o$2() { + if (_dewExec$o$2) + return exports$p$2; + _dewExec$o$2 = true; + const inherits2 = dew$f2(); + const bignum = dew$x$2(); + const DecoderBuffer = dew$u$2().DecoderBuffer; + const Node = dew$t$2(); + const der = dew$s$2(); + function DERDecoder(entity) { + this.enc = "der"; + this.name = entity.name; + this.entity = entity; + this.tree = new DERNode(); + this.tree._init(entity.body); + } + exports$p$2 = DERDecoder; + DERDecoder.prototype.decode = function decode2(data, options) { + if (!DecoderBuffer.isDecoderBuffer(data)) { + data = new DecoderBuffer(data, options); + } + return this.tree._decode(data, options); + }; + function DERNode(parent2) { + Node.call(this, "der", parent2); + } + inherits2(DERNode, Node); + DERNode.prototype._peekTag = function peekTag(buffer2, tag, any) { + if (buffer2.isEmpty()) + return false; + const state = buffer2.save(); + const decodedTag = derDecodeTag(buffer2, 'Failed to peek tag: "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + buffer2.restore(state); + return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any; + }; + DERNode.prototype._decodeTag = function decodeTag(buffer2, tag, any) { + const decodedTag = derDecodeTag(buffer2, 'Failed to decode tag of "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + let len = derDecodeLen(buffer2, decodedTag.primitive, 'Failed to get length of "' + tag + '"'); + if (buffer2.isError(len)) + return len; + if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) { + return buffer2.error('Failed to match tag: "' + tag + '"'); + } + if (decodedTag.primitive || len !== null) + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + const state = buffer2.save(); + const res = this._skipUntilEnd(buffer2, 'Failed to skip indefinite length body: "' + this.tag + '"'); + if (buffer2.isError(res)) + return res; + len = buffer2.offset - state.offset; + buffer2.restore(state); + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + }; + DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer2, fail2) { + for (; ; ) { + const tag = derDecodeTag(buffer2, fail2); + if (buffer2.isError(tag)) + return tag; + const len = derDecodeLen(buffer2, tag.primitive, fail2); + if (buffer2.isError(len)) + return len; + let res; + if (tag.primitive || len !== null) + res = buffer2.skip(len); + else + res = this._skipUntilEnd(buffer2, fail2); + if (buffer2.isError(res)) + return res; + if (tag.tagStr === "end") + break; + } + }; + DERNode.prototype._decodeList = function decodeList(buffer2, tag, decoder, options) { + const result2 = []; + while (!buffer2.isEmpty()) { + const possibleEnd = this._peekTag(buffer2, "end"); + if (buffer2.isError(possibleEnd)) + return possibleEnd; + const res = decoder.decode(buffer2, "der", options); + if (buffer2.isError(res) && possibleEnd) + break; + result2.push(res); + } + return result2; + }; + DERNode.prototype._decodeStr = function decodeStr(buffer2, tag) { + if (tag === "bitstr") { + const unused = buffer2.readUInt8(); + if (buffer2.isError(unused)) + return unused; + return { + unused, + data: buffer2.raw() + }; + } else if (tag === "bmpstr") { + const raw = buffer2.raw(); + if (raw.length % 2 === 1) + return buffer2.error("Decoding of string type: bmpstr length mismatch"); + let str2 = ""; + for (let i7 = 0; i7 < raw.length / 2; i7++) { + str2 += String.fromCharCode(raw.readUInt16BE(i7 * 2)); + } + return str2; + } else if (tag === "numstr") { + const numstr = buffer2.raw().toString("ascii"); + if (!this._isNumstr(numstr)) { + return buffer2.error("Decoding of string type: numstr unsupported characters"); + } + return numstr; + } else if (tag === "octstr") { + return buffer2.raw(); + } else if (tag === "objDesc") { + return buffer2.raw(); + } else if (tag === "printstr") { + const printstr = buffer2.raw().toString("ascii"); + if (!this._isPrintstr(printstr)) { + return buffer2.error("Decoding of string type: printstr unsupported characters"); + } + return printstr; + } else if (/str$/.test(tag)) { + return buffer2.raw().toString(); + } else { + return buffer2.error("Decoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._decodeObjid = function decodeObjid(buffer2, values2, relative2) { + let result2; + const identifiers = []; + let ident = 0; + let subident = 0; + while (!buffer2.isEmpty()) { + subident = buffer2.readUInt8(); + ident <<= 7; + ident |= subident & 127; + if ((subident & 128) === 0) { + identifiers.push(ident); + ident = 0; + } + } + if (subident & 128) + identifiers.push(ident); + const first = identifiers[0] / 40 | 0; + const second = identifiers[0] % 40; + if (relative2) + result2 = identifiers; + else + result2 = [first, second].concat(identifiers.slice(1)); + if (values2) { + let tmp = values2[result2.join(" ")]; + if (tmp === void 0) + tmp = values2[result2.join(".")]; + if (tmp !== void 0) + result2 = tmp; + } + return result2; + }; + DERNode.prototype._decodeTime = function decodeTime(buffer2, tag) { + const str2 = buffer2.raw().toString(); + let year; + let mon; + let day; + let hour; + let min2; + let sec; + if (tag === "gentime") { + year = str2.slice(0, 4) | 0; + mon = str2.slice(4, 6) | 0; + day = str2.slice(6, 8) | 0; + hour = str2.slice(8, 10) | 0; + min2 = str2.slice(10, 12) | 0; + sec = str2.slice(12, 14) | 0; + } else if (tag === "utctime") { + year = str2.slice(0, 2) | 0; + mon = str2.slice(2, 4) | 0; + day = str2.slice(4, 6) | 0; + hour = str2.slice(6, 8) | 0; + min2 = str2.slice(8, 10) | 0; + sec = str2.slice(10, 12) | 0; + if (year < 70) + year = 2e3 + year; + else + year = 1900 + year; + } else { + return buffer2.error("Decoding " + tag + " time is not supported yet"); + } + return Date.UTC(year, mon - 1, day, hour, min2, sec, 0); + }; + DERNode.prototype._decodeNull = function decodeNull() { + return null; + }; + DERNode.prototype._decodeBool = function decodeBool(buffer2) { + const res = buffer2.readUInt8(); + if (buffer2.isError(res)) + return res; + else + return res !== 0; + }; + DERNode.prototype._decodeInt = function decodeInt(buffer2, values2) { + const raw = buffer2.raw(); + let res = new bignum(raw); + if (values2) + res = values2[res.toString(10)] || res; + return res; + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getDecoder("der").tree; + }; + function derDecodeTag(buf, fail2) { + let tag = buf.readUInt8(fail2); + if (buf.isError(tag)) + return tag; + const cls = der.tagClass[tag >> 6]; + const primitive = (tag & 32) === 0; + if ((tag & 31) === 31) { + let oct = tag; + tag = 0; + while ((oct & 128) === 128) { + oct = buf.readUInt8(fail2); + if (buf.isError(oct)) + return oct; + tag <<= 7; + tag |= oct & 127; + } + } else { + tag &= 31; + } + const tagStr = der.tag[tag]; + return { + cls, + primitive, + tag, + tagStr + }; + } + function derDecodeLen(buf, primitive, fail2) { + let len = buf.readUInt8(fail2); + if (buf.isError(len)) + return len; + if (!primitive && len === 128) + return null; + if ((len & 128) === 0) { + return len; + } + const num = len & 127; + if (num > 4) + return buf.error("length octect is too long"); + len = 0; + for (let i7 = 0; i7 < num; i7++) { + len <<= 8; + const j6 = buf.readUInt8(fail2); + if (buf.isError(j6)) + return j6; + len |= j6; + } + return len; + } + return exports$p$2; +} +function dew$n$2() { + if (_dewExec$n$2) + return exports$o$2; + _dewExec$n$2 = true; + const inherits2 = dew$f2(); + const Buffer4 = dew$w$2().Buffer; + const DERDecoder = dew$o$2(); + function PEMDecoder(entity) { + DERDecoder.call(this, entity); + this.enc = "pem"; + } + inherits2(PEMDecoder, DERDecoder); + exports$o$2 = PEMDecoder; + PEMDecoder.prototype.decode = function decode2(data, options) { + const lines = data.toString().split(/[\r\n]+/g); + const label = options.label.toUpperCase(); + const re4 = /^-----(BEGIN|END) ([^-]+)-----$/; + let start = -1; + let end = -1; + for (let i7 = 0; i7 < lines.length; i7++) { + const match = lines[i7].match(re4); + if (match === null) + continue; + if (match[2] !== label) + continue; + if (start === -1) { + if (match[1] !== "BEGIN") + break; + start = i7; + } else { + if (match[1] !== "END") + break; + end = i7; + break; + } + } + if (start === -1 || end === -1) + throw new Error("PEM section not found for: " + label); + const base64 = lines.slice(start + 1, end).join(""); + base64.replace(/[^a-z0-9+/=]+/gi, ""); + const input = Buffer4.from(base64, "base64"); + return DERDecoder.prototype.decode.call(this, input, options); + }; + return exports$o$2; +} +function dew$m$2() { + if (_dewExec$m$2) + return exports$n$2; + _dewExec$m$2 = true; + const decoders = exports$n$2; + decoders.der = dew$o$2(); + decoders.pem = dew$n$2(); + return exports$n$2; +} +function dew$l$2() { + if (_dewExec$l$2) + return exports$m$2; + _dewExec$l$2 = true; + const encoders = dew$p$2(); + const decoders = dew$m$2(); + const inherits2 = dew$f2(); + const api = exports$m$2; + api.define = function define2(name2, body) { + return new Entity(name2, body); + }; + function Entity(name2, body) { + this.name = name2; + this.body = body; + this.decoders = {}; + this.encoders = {}; + } + Entity.prototype._createNamed = function createNamed(Base2) { + const name2 = this.name; + function Generated(entity) { + this._initNamed(entity, name2); + } + inherits2(Generated, Base2); + Generated.prototype._initNamed = function _initNamed(entity, name3) { + Base2.call(this, entity, name3); + }; + return new Generated(this); + }; + Entity.prototype._getDecoder = function _getDecoder(enc) { + enc = enc || "der"; + if (!this.decoders.hasOwnProperty(enc)) + this.decoders[enc] = this._createNamed(decoders[enc]); + return this.decoders[enc]; + }; + Entity.prototype.decode = function decode2(data, enc, options) { + return this._getDecoder(enc).decode(data, options); + }; + Entity.prototype._getEncoder = function _getEncoder(enc) { + enc = enc || "der"; + if (!this.encoders.hasOwnProperty(enc)) + this.encoders[enc] = this._createNamed(encoders[enc]); + return this.encoders[enc]; + }; + Entity.prototype.encode = function encode2(data, enc, reporter) { + return this._getEncoder(enc).encode(data, reporter); + }; + return exports$m$2; +} +function dew$k$2() { + if (_dewExec$k$2) + return exports$l$2; + _dewExec$k$2 = true; + const base = exports$l$2; + base.Reporter = dew$v$2().Reporter; + base.DecoderBuffer = dew$u$2().DecoderBuffer; + base.EncoderBuffer = dew$u$2().EncoderBuffer; + base.Node = dew$t$2(); + return exports$l$2; +} +function dew$j$2() { + if (_dewExec$j$2) + return exports$k$2; + _dewExec$j$2 = true; + const constants5 = exports$k$2; + constants5._reverse = function reverse2(map4) { + const res = {}; + Object.keys(map4).forEach(function(key) { + if ((key | 0) == key) + key = key | 0; + const value2 = map4[key]; + res[value2] = key; + }); + return res; + }; + constants5.der = dew$s$2(); + return exports$k$2; +} +function dew$i$2() { + if (_dewExec$i$2) + return exports$j$2; + _dewExec$i$2 = true; + const asn1 = exports$j$2; + asn1.bignum = dew$x$2(); + asn1.define = dew$l$2().define; + asn1.base = dew$k$2(); + asn1.constants = dew$j$2(); + asn1.decoders = dew$m$2(); + asn1.encoders = dew$p$2(); + return exports$j$2; +} +function dew$h$2() { + if (_dewExec$h$2) + return exports$i$2; + _dewExec$h$2 = true; + var asn = dew$i$2(); + var Time = asn.define("Time", function() { + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }); + }); + var AttributeTypeValue = asn.define("AttributeTypeValue", function() { + this.seq().obj(this.key("type").objid(), this.key("value").any()); + }); + var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); + }); + var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", function() { + this.setof(AttributeTypeValue); + }); + var RDNSequence = asn.define("RDNSequence", function() { + this.seqof(RelativeDistinguishedName); + }); + var Name = asn.define("Name", function() { + this.choice({ + rdnSequence: this.use(RDNSequence) + }); + }); + var Validity = asn.define("Validity", function() { + this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time)); + }); + var Extension6 = asn.define("Extension", function() { + this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); + }); + var TBSCertificate = asn.define("TBSCertificate", function() { + this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension6).optional()); + }); + var X509Certificate = asn.define("X509Certificate", function() { + this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr()); + }); + exports$i$2 = X509Certificate; + return exports$i$2; +} +function dew$g$2() { + if (_dewExec$g$2) + return exports$h$2; + _dewExec$g$2 = true; + var asn1 = dew$i$2(); + exports$h$2.certificate = dew$h$2(); + var RSAPrivateKey = asn1.define("RSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int()); + }); + exports$h$2.RSAPrivateKey = RSAPrivateKey; + var RSAPublicKey = asn1.define("RSAPublicKey", function() { + this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int()); + }); + exports$h$2.RSAPublicKey = RSAPublicKey; + var PublicKey = asn1.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + exports$h$2.PublicKey = PublicKey; + var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional()); + }); + var PrivateKeyInfo = asn1.define("PrivateKeyInfo", function() { + this.seq().obj(this.key("version").int(), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr()); + }); + exports$h$2.PrivateKey = PrivateKeyInfo; + var EncryptedPrivateKeyInfo = asn1.define("EncryptedPrivateKeyInfo", function() { + this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); + }); + exports$h$2.EncryptedPrivateKey = EncryptedPrivateKeyInfo; + var DSAPrivateKey = asn1.define("DSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int()); + }); + exports$h$2.DSAPrivateKey = DSAPrivateKey; + exports$h$2.DSAparam = asn1.define("DSAparam", function() { + this.int(); + }); + var ECPrivateKey = asn1.define("ECPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr()); + }); + exports$h$2.ECPrivateKey = ECPrivateKey; + var ECParameters = asn1.define("ECParameters", function() { + this.choice({ + namedCurve: this.objid() + }); + }); + exports$h$2.signature = asn1.define("signature", function() { + this.seq().obj(this.key("r").int(), this.key("s").int()); + }); + return exports$h$2; +} +function dew$f$3() { + if (_dewExec$f$3) + return exports$g$2; + _dewExec$f$3 = true; + var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m; + var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; + var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m; + var evp = dew$21(); + var ciphers = dew$1_(); + var Buffer4 = dew$2P().Buffer; + exports$g$2 = function(okey, password) { + var key = okey.toString(); + var match = key.match(findProc); + var decrypted; + if (!match) { + var match2 = key.match(fullRegex); + decrypted = Buffer4.from(match2[2].replace(/[\r\n]/g, ""), "base64"); + } else { + var suite = "aes" + match[1]; + var iv = Buffer4.from(match[2], "hex"); + var cipherText = Buffer4.from(match[3].replace(/[\r\n]/g, ""), "base64"); + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key; + var out = []; + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv); + out.push(cipher.update(cipherText)); + out.push(cipher.final()); + decrypted = Buffer4.concat(out); + } + var tag = key.match(startRegex)[1]; + return { + tag, + data: decrypted + }; + }; + return exports$g$2; +} +function dew$e$3() { + if (_dewExec$e$3) + return exports$f$3; + _dewExec$e$3 = true; + var asn1 = dew$g$2(); + var aesid = _aesid$2; + var fixProc = dew$f$3(); + var ciphers = dew$1_(); + var compat = dew$2o(); + var Buffer4 = dew$2P().Buffer; + exports$f$3 = parseKeys; + function parseKeys(buffer2) { + var password; + if (typeof buffer2 === "object" && !Buffer4.isBuffer(buffer2)) { + password = buffer2.passphrase; + buffer2 = buffer2.key; + } + if (typeof buffer2 === "string") { + buffer2 = Buffer4.from(buffer2); + } + var stripped = fixProc(buffer2, password); + var type3 = stripped.tag; + var data = stripped.data; + var subtype, ndata; + switch (type3) { + case "CERTIFICATE": + ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo; + case "PUBLIC KEY": + if (!ndata) { + ndata = asn1.PublicKey.decode(data, "der"); + } + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der"); + case "1.2.840.10045.2.1": + ndata.subjectPrivateKey = ndata.subjectPublicKey; + return { + type: "ec", + data: ndata + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der"); + return { + type: "dsa", + data: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "ENCRYPTED PRIVATE KEY": + data = asn1.EncryptedPrivateKey.decode(data, "der"); + data = decrypt(data, password); + case "PRIVATE KEY": + ndata = asn1.PrivateKey.decode(data, "der"); + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der"); + case "1.2.840.10045.2.1": + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der"); + return { + type: "dsa", + params: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "RSA PUBLIC KEY": + return asn1.RSAPublicKey.decode(data, "der"); + case "RSA PRIVATE KEY": + return asn1.RSAPrivateKey.decode(data, "der"); + case "DSA PRIVATE KEY": + return { + type: "dsa", + params: asn1.DSAPrivateKey.decode(data, "der") + }; + case "EC PRIVATE KEY": + data = asn1.ECPrivateKey.decode(data, "der"); + return { + curve: data.parameters.value, + privateKey: data.privateKey + }; + default: + throw new Error("unknown key type " + type3); + } + } + parseKeys.signature = asn1.signature; + function decrypt(data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt; + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10); + var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")]; + var iv = data.algorithm.decrypt.cipher.iv; + var cipherText = data.subjectPrivateKey; + var keylen = parseInt(algo.split("-")[1], 10) / 8; + var key = compat.pbkdf2Sync(password, salt, iters, keylen, "sha1"); + var cipher = ciphers.createDecipheriv(algo, key, iv); + var out = []; + out.push(cipher.update(cipherText)); + out.push(cipher.final()); + return Buffer4.concat(out); + } + return exports$f$3; +} +function dew$d$3() { + if (_dewExec$d$3) + return exports$e$3; + _dewExec$d$3 = true; + var Buffer4 = dew$Y$2().Buffer; + var createHmac2 = dew$2v(); + var crt = dew$W$2(); + var EC = dew$y$2().ec; + var BN = dew$X$2(); + var parseKeys = dew$e$3(); + var curves = _curves$2; + function sign(hash, key, hashType, signType, tag) { + var priv = parseKeys(key); + if (priv.curve) { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") + throw new Error("wrong private key type"); + return ecSign(hash, priv); + } else if (priv.type === "dsa") { + if (signType !== "dsa") + throw new Error("wrong private key type"); + return dsaSign(hash, priv, hashType); + } else { + if (signType !== "rsa" && signType !== "ecdsa/rsa") + throw new Error("wrong private key type"); + } + hash = Buffer4.concat([tag, hash]); + var len = priv.modulus.byteLength(); + var pad2 = [0, 1]; + while (hash.length + pad2.length + 1 < len) + pad2.push(255); + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) + pad2.push(hash[i7]); + var out = crt(pad2, priv); + return out; + } + function ecSign(hash, priv) { + var curveId = curves[priv.curve.join(".")]; + if (!curveId) + throw new Error("unknown curve " + priv.curve.join(".")); + var curve = new EC(curveId); + var key = curve.keyFromPrivate(priv.privateKey); + var out = key.sign(hash); + return Buffer4.from(out.toDER()); + } + function dsaSign(hash, priv, algo) { + var x7 = priv.params.priv_key; + var p7 = priv.params.p; + var q5 = priv.params.q; + var g7 = priv.params.g; + var r8 = new BN(0); + var k6; + var H5 = bits2int(hash, q5).mod(q5); + var s7 = false; + var kv = getKey(x7, q5, hash, algo); + while (s7 === false) { + k6 = makeKey(q5, kv, algo); + r8 = makeR(g7, k6, p7, q5); + s7 = k6.invm(q5).imul(H5.add(x7.mul(r8))).mod(q5); + if (s7.cmpn(0) === 0) { + s7 = false; + r8 = new BN(0); + } + } + return toDER(r8, s7); + } + function toDER(r8, s7) { + r8 = r8.toArray(); + s7 = s7.toArray(); + if (r8[0] & 128) + r8 = [0].concat(r8); + if (s7[0] & 128) + s7 = [0].concat(s7); + var total = r8.length + s7.length + 4; + var res = [48, total, 2, r8.length]; + res = res.concat(r8, [2, s7.length], s7); + return Buffer4.from(res); + } + function getKey(x7, q5, hash, algo) { + x7 = Buffer4.from(x7.toArray()); + if (x7.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - x7.length); + x7 = Buffer4.concat([zeros, x7]); + } + var hlen = hash.length; + var hbits = bits2octets(hash, q5); + var v8 = Buffer4.alloc(hlen); + v8.fill(1); + var k6 = Buffer4.alloc(hlen); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([0])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([1])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + return { + k: k6, + v: v8 + }; + } + function bits2int(obits, q5) { + var bits = new BN(obits); + var shift = (obits.length << 3) - q5.bitLength(); + if (shift > 0) + bits.ishrn(shift); + return bits; + } + function bits2octets(bits, q5) { + bits = bits2int(bits, q5); + bits = bits.mod(q5); + var out = Buffer4.from(bits.toArray()); + if (out.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - out.length); + out = Buffer4.concat([zeros, out]); + } + return out; + } + function makeKey(q5, kv, algo) { + var t8; + var k6; + do { + t8 = Buffer4.alloc(0); + while (t8.length * 8 < q5.bitLength()) { + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + t8 = Buffer4.concat([t8, kv.v]); + } + k6 = bits2int(t8, q5); + kv.k = createHmac2(algo, kv.k).update(kv.v).update(Buffer4.from([0])).digest(); + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + } while (k6.cmp(q5) !== -1); + return k6; + } + function makeR(g7, k6, p7, q5) { + return g7.toRed(BN.mont(p7)).redPow(k6).fromRed().mod(q5); + } + exports$e$3 = sign; + exports$e$3.getKey = getKey; + exports$e$3.makeKey = makeKey; + return exports$e$3; +} +function dew$c$3() { + if (_dewExec$c$3) + return exports$d$3; + _dewExec$c$3 = true; + var Buffer4 = dew$Y$2().Buffer; + var BN = dew$X$2(); + var EC = dew$y$2().ec; + var parseKeys = dew$e$3(); + var curves = _curves$2; + function verify(sig, hash, key, signType, tag) { + var pub = parseKeys(key); + if (pub.type === "ec") { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") + throw new Error("wrong public key type"); + return ecVerify(sig, hash, pub); + } else if (pub.type === "dsa") { + if (signType !== "dsa") + throw new Error("wrong public key type"); + return dsaVerify(sig, hash, pub); + } else { + if (signType !== "rsa" && signType !== "ecdsa/rsa") + throw new Error("wrong public key type"); + } + hash = Buffer4.concat([tag, hash]); + var len = pub.modulus.byteLength(); + var pad2 = [1]; + var padNum = 0; + while (hash.length + pad2.length + 2 < len) { + pad2.push(255); + padNum++; + } + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) { + pad2.push(hash[i7]); + } + pad2 = Buffer4.from(pad2); + var red = BN.mont(pub.modulus); + sig = new BN(sig).toRed(red); + sig = sig.redPow(new BN(pub.publicExponent)); + sig = Buffer4.from(sig.fromRed().toArray()); + var out = padNum < 8 ? 1 : 0; + len = Math.min(sig.length, pad2.length); + if (sig.length !== pad2.length) + out = 1; + i7 = -1; + while (++i7 < len) + out |= sig[i7] ^ pad2[i7]; + return out === 0; + } + function ecVerify(sig, hash, pub) { + var curveId = curves[pub.data.algorithm.curve.join(".")]; + if (!curveId) + throw new Error("unknown curve " + pub.data.algorithm.curve.join(".")); + var curve = new EC(curveId); + var pubkey = pub.data.subjectPrivateKey.data; + return curve.verify(hash, sig, pubkey); + } + function dsaVerify(sig, hash, pub) { + var p7 = pub.data.p; + var q5 = pub.data.q; + var g7 = pub.data.g; + var y7 = pub.data.pub_key; + var unpacked = parseKeys.signature.decode(sig, "der"); + var s7 = unpacked.s; + var r8 = unpacked.r; + checkValue(s7, q5); + checkValue(r8, q5); + var montp = BN.mont(p7); + var w6 = s7.invm(q5); + var v8 = g7.toRed(montp).redPow(new BN(hash).mul(w6).mod(q5)).fromRed().mul(y7.toRed(montp).redPow(r8.mul(w6).mod(q5)).fromRed()).mod(p7).mod(q5); + return v8.cmp(r8) === 0; + } + function checkValue(b8, q5) { + if (b8.cmpn(0) <= 0) + throw new Error("invalid sig"); + if (b8.cmp(q5) >= q5) + throw new Error("invalid sig"); + } + exports$d$3 = verify; + return exports$d$3; +} +function dew$b$3() { + if (_dewExec$b$3) + return exports$c$3; + _dewExec$b$3 = true; + var Buffer4 = dew$Y$2().Buffer; + var createHash2 = dew$2y(); + var stream2 = dew12(); + var inherits2 = dew$f2(); + var sign = dew$d$3(); + var verify = dew$c$3(); + var algorithms = _algorithms$1; + Object.keys(algorithms).forEach(function(key) { + algorithms[key].id = Buffer4.from(algorithms[key].id, "hex"); + algorithms[key.toLowerCase()] = algorithms[key]; + }); + function Sign2(algorithm) { + stream2.Writable.call(this || _global$4$2); + var data = algorithms[algorithm]; + if (!data) + throw new Error("Unknown message digest"); + (this || _global$4$2)._hashType = data.hash; + (this || _global$4$2)._hash = createHash2(data.hash); + (this || _global$4$2)._tag = data.id; + (this || _global$4$2)._signType = data.sign; + } + inherits2(Sign2, stream2.Writable); + Sign2.prototype._write = function _write(data, _6, done) { + (this || _global$4$2)._hash.update(data); + done(); + }; + Sign2.prototype.update = function update2(data, enc) { + if (typeof data === "string") + data = Buffer4.from(data, enc); + (this || _global$4$2)._hash.update(data); + return this || _global$4$2; + }; + Sign2.prototype.sign = function signMethod(key, enc) { + this.end(); + var hash = (this || _global$4$2)._hash.digest(); + var sig = sign(hash, key, (this || _global$4$2)._hashType, (this || _global$4$2)._signType, (this || _global$4$2)._tag); + return enc ? sig.toString(enc) : sig; + }; + function Verify2(algorithm) { + stream2.Writable.call(this || _global$4$2); + var data = algorithms[algorithm]; + if (!data) + throw new Error("Unknown message digest"); + (this || _global$4$2)._hash = createHash2(data.hash); + (this || _global$4$2)._tag = data.id; + (this || _global$4$2)._signType = data.sign; + } + inherits2(Verify2, stream2.Writable); + Verify2.prototype._write = function _write(data, _6, done) { + (this || _global$4$2)._hash.update(data); + done(); + }; + Verify2.prototype.update = function update2(data, enc) { + if (typeof data === "string") + data = Buffer4.from(data, enc); + (this || _global$4$2)._hash.update(data); + return this || _global$4$2; + }; + Verify2.prototype.verify = function verifyMethod(key, sig, enc) { + if (typeof sig === "string") + sig = Buffer4.from(sig, enc); + this.end(); + var hash = (this || _global$4$2)._hash.digest(); + return verify(sig, hash, key, (this || _global$4$2)._signType, (this || _global$4$2)._tag); + }; + function createSign2(algorithm) { + return new Sign2(algorithm); + } + function createVerify2(algorithm) { + return new Verify2(algorithm); + } + exports$c$3 = { + Sign: createSign2, + Verify: createVerify2, + createSign: createSign2, + createVerify: createVerify2 + }; + return exports$c$3; +} +function dew$a$3() { + if (_dewExec$a$3) + return module$1$2.exports; + _dewExec$a$3 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$3$2).negative = 0; + (this || _global$3$2).words = null; + (this || _global$3$2).length = 0; + (this || _global$3$2).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$3$2).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$3$2).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$3$2).words = [number & 67108863]; + (this || _global$3$2).length = 1; + } else if (number < 4503599627370496) { + (this || _global$3$2).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$3$2).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$3$2).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$3$2).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$3$2).words = [0]; + (this || _global$3$2).length = 1; + return this || _global$3$2; + } + (this || _global$3$2).length = Math.ceil(number.length / 3); + (this || _global$3$2).words = new Array((this || _global$3$2).length); + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + (this || _global$3$2).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$3$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$3$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$3$2).words[j6] |= w6 << off3 & 67108863; + (this || _global$3$2).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$3$2).length = Math.ceil((number.length - start) / 6); + (this || _global$3$2).words = new Array((this || _global$3$2).length); + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + (this || _global$3$2).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3$2).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3$2).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$3$2).words = [0]; + (this || _global$3$2).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$3$2).words[0] + word < 67108864) { + (this || _global$3$2).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$3$2).words[0] + word < 67108864) { + (this || _global$3$2).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$3$2).length); + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + dest.words[i7] = (this || _global$3$2).words[i7]; + } + dest.length = (this || _global$3$2).length; + dest.negative = (this || _global$3$2).negative; + dest.red = (this || _global$3$2).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$3$2).length < size2) { + (this || _global$3$2).words[(this || _global$3$2).length++] = 0; + } + return this || _global$3$2; + }; + BN.prototype.strip = function strip() { + while ((this || _global$3$2).length > 1 && (this || _global$3$2).words[(this || _global$3$2).length - 1] === 0) { + (this || _global$3$2).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$3$2).length === 1 && (this || _global$3$2).words[0] === 0) { + (this || _global$3$2).negative = 0; + } + return this || _global$3$2; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$3$2).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + var w6 = (this || _global$3$2).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$3$2).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3$2).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3$2).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$3$2).words[0]; + if ((this || _global$3$2).length === 2) { + ret += (this || _global$3$2).words[1] * 67108864; + } else if ((this || _global$3$2).length === 3 && (this || _global$3$2).words[2] === 1) { + ret += 4503599627370496 + (this || _global$3$2).words[1] * 67108864; + } else if ((this || _global$3$2).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$3$2).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$3$2).words[(this || _global$3$2).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$3$2).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + var b8 = this._zeroBits((this || _global$3$2).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$3$2).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$3$2).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$3$2).negative ^= 1; + } + return this || _global$3$2; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$3$2).length < num.length) { + (this || _global$3$2).words[(this || _global$3$2).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$3$2).words[i7] = (this || _global$3$2).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$3$2).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$3$2); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$3$2); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$3$2).length > num.length) { + b8 = num; + } else { + b8 = this || _global$3$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3$2).words[i7] = (this || _global$3$2).words[i7] & num.words[i7]; + } + (this || _global$3$2).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$3$2).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$3$2); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$3$2); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$3$2).length > num.length) { + a7 = this || _global$3$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$2; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3$2).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$3$2) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$3$2).words[i7] = a7.words[i7]; + } + } + (this || _global$3$2).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$3$2).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$3$2); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$3$2).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$3$2); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$3$2).words[i7] = ~(this || _global$3$2).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$3$2).words[i7] = ~(this || _global$3$2).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$3$2).words[off3] = (this || _global$3$2).words[off3] | 1 << wbit; + } else { + (this || _global$3$2).words[off3] = (this || _global$3$2).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$3$2).negative !== 0 && num.negative === 0) { + (this || _global$3$2).negative = 0; + r8 = this.isub(num); + (this || _global$3$2).negative ^= 1; + return this._normSign(); + } else if ((this || _global$3$2).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$3$2).length > num.length) { + a7 = this || _global$3$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$3$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$3$2).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$3$2).length = a7.length; + if (carry !== 0) { + (this || _global$3$2).words[(this || _global$3$2).length] = carry; + (this || _global$3$2).length++; + } else if (a7 !== (this || _global$3$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$3$2).words[i7] = a7.words[i7]; + } + } + return this || _global$3$2; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$3$2).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$3$2).negative !== 0) { + (this || _global$3$2).negative = 0; + res = num.sub(this || _global$3$2); + (this || _global$3$2).negative = 1; + return res; + } + if ((this || _global$3$2).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$3$2); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$3$2).negative !== 0) { + (this || _global$3$2).negative = 0; + this.iadd(num); + (this || _global$3$2).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$3$2).negative = 0; + (this || _global$3$2).length = 1; + (this || _global$3$2).words[0] = 0; + return this || _global$3$2; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$3$2; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3$2; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3$2).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3$2).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$3$2)) { + for (; i7 < a7.length; i7++) { + (this || _global$3$2).words[i7] = a7.words[i7]; + } + } + (this || _global$3$2).length = Math.max((this || _global$3$2).length, i7); + if (a7 !== (this || _global$3$2)) { + (this || _global$3$2).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$3$2).length + num.length; + if ((this || _global$3$2).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$3$2, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$3$2, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$3$2, num, out); + } else { + res = jumboMulTo(this || _global$3$2, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$3$2).x = x7; + (this || _global$3$2).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$3$2).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$3$2).length + num.length); + return jumboMulTo(this || _global$3$2, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$3$2); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3$2).length; i7++) { + var w6 = ((this || _global$3$2).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$3$2).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$3$2).words[i7] = carry; + (this || _global$3$2).length++; + } + return this || _global$3$2; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$3$2); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$3$2; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$3$2).length; i7++) { + var newCarry = (this || _global$3$2).words[i7] & carryMask; + var c7 = ((this || _global$3$2).words[i7] | 0) - newCarry << r8; + (this || _global$3$2).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$3$2).words[i7] = carry; + (this || _global$3$2).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$3$2).length - 1; i7 >= 0; i7--) { + (this || _global$3$2).words[i7 + s7] = (this || _global$3$2).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$3$2).words[i7] = 0; + } + (this || _global$3$2).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$3$2).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$3$2).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$3$2).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$3$2).length > s7) { + (this || _global$3$2).length -= s7; + for (i7 = 0; i7 < (this || _global$3$2).length; i7++) { + (this || _global$3$2).words[i7] = (this || _global$3$2).words[i7 + s7]; + } + } else { + (this || _global$3$2).words[0] = 0; + (this || _global$3$2).length = 1; + } + var carry = 0; + for (i7 = (this || _global$3$2).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$3$2).words[i7] | 0; + (this || _global$3$2).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$3$2).length === 0) { + (this || _global$3$2).words[0] = 0; + (this || _global$3$2).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$3$2).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3$2).length <= s7) + return false; + var w6 = (this || _global$3$2).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$3$2).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$3$2).length <= s7) { + return this || _global$3$2; + } + if (r8 !== 0) { + s7++; + } + (this || _global$3$2).length = Math.min(s7, (this || _global$3$2).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$3$2).words[(this || _global$3$2).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$3$2).negative !== 0) { + if ((this || _global$3$2).length === 1 && ((this || _global$3$2).words[0] | 0) < num) { + (this || _global$3$2).words[0] = num - ((this || _global$3$2).words[0] | 0); + (this || _global$3$2).negative = 0; + return this || _global$3$2; + } + (this || _global$3$2).negative = 0; + this.isubn(num); + (this || _global$3$2).negative = 1; + return this || _global$3$2; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$3$2).words[0] += num; + for (var i7 = 0; i7 < (this || _global$3$2).length && (this || _global$3$2).words[i7] >= 67108864; i7++) { + (this || _global$3$2).words[i7] -= 67108864; + if (i7 === (this || _global$3$2).length - 1) { + (this || _global$3$2).words[i7 + 1] = 1; + } else { + (this || _global$3$2).words[i7 + 1]++; + } + } + (this || _global$3$2).length = Math.max((this || _global$3$2).length, i7 + 1); + return this || _global$3$2; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$3$2).negative !== 0) { + (this || _global$3$2).negative = 0; + this.iaddn(num); + (this || _global$3$2).negative = 1; + return this || _global$3$2; + } + (this || _global$3$2).words[0] -= num; + if ((this || _global$3$2).length === 1 && (this || _global$3$2).words[0] < 0) { + (this || _global$3$2).words[0] = -(this || _global$3$2).words[0]; + (this || _global$3$2).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$3$2).length && (this || _global$3$2).words[i7] < 0; i7++) { + (this || _global$3$2).words[i7] += 67108864; + (this || _global$3$2).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$3$2).negative = 0; + return this || _global$3$2; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$3$2).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$3$2).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$3$2).length - shift; i7++) { + w6 = ((this || _global$3$2).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$3$2).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$3$2).length; i7++) { + w6 = -((this || _global$3$2).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$3$2).words[i7] = w6 & 67108863; + } + (this || _global$3$2).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$3$2).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$3$2).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$3$2).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$3$2).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$3$2).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$3$2 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$3$2).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$3$2).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$3$2).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$3$2).words[i7] | 0) + carry * 67108864; + (this || _global$3$2).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$3$2; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$3$2; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$3$2).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$3$2).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$3$2).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3$2).length <= s7) { + this._expand(s7 + 1); + (this || _global$3$2).words[s7] |= q5; + return this || _global$3$2; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$3$2).length; i7++) { + var w6 = (this || _global$3$2).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$3$2).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$3$2).words[i7] = carry; + (this || _global$3$2).length++; + } + return this || _global$3$2; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$3$2).length === 1 && (this || _global$3$2).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$3$2).negative !== 0 && !negative) + return -1; + if ((this || _global$3$2).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$3$2).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$3$2).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$3$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$3$2).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$3$2).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$3$2).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$3$2).length > num.length) + return 1; + if ((this || _global$3$2).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$3$2).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$3$2).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$3$2).red, "Already a number in reduction context"); + assert4((this || _global$3$2).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$3$2)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$3$2).red, "fromRed works only with numbers in reduction context"); + return (this || _global$3$2).red.convertFrom(this || _global$3$2); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$3$2).red = ctx; + return this || _global$3$2; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$3$2).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$3$2).red, "redAdd works only with red numbers"); + return (this || _global$3$2).red.add(this || _global$3$2, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$3$2).red, "redIAdd works only with red numbers"); + return (this || _global$3$2).red.iadd(this || _global$3$2, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$3$2).red, "redSub works only with red numbers"); + return (this || _global$3$2).red.sub(this || _global$3$2, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$3$2).red, "redISub works only with red numbers"); + return (this || _global$3$2).red.isub(this || _global$3$2, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$3$2).red, "redShl works only with red numbers"); + return (this || _global$3$2).red.shl(this || _global$3$2, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$3$2).red, "redMul works only with red numbers"); + (this || _global$3$2).red._verify2(this || _global$3$2, num); + return (this || _global$3$2).red.mul(this || _global$3$2, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$3$2).red, "redMul works only with red numbers"); + (this || _global$3$2).red._verify2(this || _global$3$2, num); + return (this || _global$3$2).red.imul(this || _global$3$2, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$3$2).red, "redSqr works only with red numbers"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.sqr(this || _global$3$2); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$3$2).red, "redISqr works only with red numbers"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.isqr(this || _global$3$2); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$3$2).red, "redSqrt works only with red numbers"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.sqrt(this || _global$3$2); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$3$2).red, "redInvm works only with red numbers"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.invm(this || _global$3$2); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$3$2).red, "redNeg works only with red numbers"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.neg(this || _global$3$2); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$3$2).red && !num.red, "redPow(normalNum)"); + (this || _global$3$2).red._verify1(this || _global$3$2); + return (this || _global$3$2).red.pow(this || _global$3$2, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$3$2).name = name2; + (this || _global$3$2).p = new BN(p7, 16); + (this || _global$3$2).n = (this || _global$3$2).p.bitLength(); + (this || _global$3$2).k = new BN(1).iushln((this || _global$3$2).n).isub((this || _global$3$2).p); + (this || _global$3$2).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$3$2).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$3$2).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$3$2).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$3$2).n); + var cmp = rlen < (this || _global$3$2).n ? -1 : r8.ucmp((this || _global$3$2).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$3$2).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$3$2).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$3$2).k); + }; + function K256() { + MPrime.call(this || _global$3$2, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$3$2, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$3$2, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$3$2, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$3$2).m = prime.p; + (this || _global$3$2).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$3$2).m = m7; + (this || _global$3$2).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$3$2).prime) + return (this || _global$3$2).prime.ireduce(a7)._forceRed(this || _global$3$2); + return a7.umod((this || _global$3$2).m)._forceRed(this || _global$3$2); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$3$2).m.sub(a7)._forceRed(this || _global$3$2); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$3$2).m) >= 0) { + res.isub((this || _global$3$2).m); + } + return res._forceRed(this || _global$3$2); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$3$2).m) >= 0) { + res.isub((this || _global$3$2).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3$2).m); + } + return res._forceRed(this || _global$3$2); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3$2).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$3$2).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$3$2).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$3$2).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$3$2); + var nOne = one.redNeg(); + var lpow = (this || _global$3$2).m.subn(1).iushrn(1); + var z6 = (this || _global$3$2).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$3$2); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$3$2).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$3$2); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$3$2); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$3$2).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$3$2, m7); + (this || _global$3$2).shift = (this || _global$3$2).m.bitLength(); + if ((this || _global$3$2).shift % 26 !== 0) { + (this || _global$3$2).shift += 26 - (this || _global$3$2).shift % 26; + } + (this || _global$3$2).r = new BN(1).iushln((this || _global$3$2).shift); + (this || _global$3$2).r2 = this.imod((this || _global$3$2).r.sqr()); + (this || _global$3$2).rinv = (this || _global$3$2).r._invmp((this || _global$3$2).m); + (this || _global$3$2).minv = (this || _global$3$2).rinv.mul((this || _global$3$2).r).isubn(1).div((this || _global$3$2).m); + (this || _global$3$2).minv = (this || _global$3$2).minv.umod((this || _global$3$2).r); + (this || _global$3$2).minv = (this || _global$3$2).r.sub((this || _global$3$2).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$3$2).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$3$2).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$3$2).shift).mul((this || _global$3$2).minv).imaskn((this || _global$3$2).shift).mul((this || _global$3$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$3$2).shift); + var res = u7; + if (u7.cmp((this || _global$3$2).m) >= 0) { + res = u7.isub((this || _global$3$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3$2).m); + } + return res._forceRed(this || _global$3$2); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$3$2); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$3$2).shift).mul((this || _global$3$2).minv).imaskn((this || _global$3$2).shift).mul((this || _global$3$2).m); + var u7 = t8.isub(c7).iushrn((this || _global$3$2).shift); + var res = u7; + if (u7.cmp((this || _global$3$2).m) >= 0) { + res = u7.isub((this || _global$3$2).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3$2).m); + } + return res._forceRed(this || _global$3$2); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$3$2).m).mul((this || _global$3$2).r2)); + return res._forceRed(this || _global$3$2); + }; + })(module$1$2, exports$b$3); + return module$1$2.exports; +} +function dew$9$3() { + if (_dewExec$9$3) + return exports$a$3; + _dewExec$9$3 = true; + var Buffer4 = buffer.Buffer; + var elliptic = dew$y$2(); + var BN = dew$a$3(); + exports$a$3 = function createECDH2(curve) { + return new ECDH(curve); + }; + var aliases = { + secp256k1: { + name: "secp256k1", + byteLength: 32 + }, + secp224r1: { + name: "p224", + byteLength: 28 + }, + prime256v1: { + name: "p256", + byteLength: 32 + }, + prime192v1: { + name: "p192", + byteLength: 24 + }, + ed25519: { + name: "ed25519", + byteLength: 32 + }, + secp384r1: { + name: "p384", + byteLength: 48 + }, + secp521r1: { + name: "p521", + byteLength: 66 + } + }; + aliases.p224 = aliases.secp224r1; + aliases.p256 = aliases.secp256r1 = aliases.prime256v1; + aliases.p192 = aliases.secp192r1 = aliases.prime192v1; + aliases.p384 = aliases.secp384r1; + aliases.p521 = aliases.secp521r1; + function ECDH(curve) { + (this || _global$2$3).curveType = aliases[curve]; + if (!(this || _global$2$3).curveType) { + (this || _global$2$3).curveType = { + name: curve + }; + } + (this || _global$2$3).curve = new elliptic.ec((this || _global$2$3).curveType.name); + (this || _global$2$3).keys = void 0; + } + ECDH.prototype.generateKeys = function(enc, format5) { + (this || _global$2$3).keys = (this || _global$2$3).curve.genKeyPair(); + return this.getPublicKey(enc, format5); + }; + ECDH.prototype.computeSecret = function(other, inenc, enc) { + inenc = inenc || "utf8"; + if (!Buffer4.isBuffer(other)) { + other = new Buffer4(other, inenc); + } + var otherPub = (this || _global$2$3).curve.keyFromPublic(other).getPublic(); + var out = otherPub.mul((this || _global$2$3).keys.getPrivate()).getX(); + return formatReturnValue(out, enc, (this || _global$2$3).curveType.byteLength); + }; + ECDH.prototype.getPublicKey = function(enc, format5) { + var key = (this || _global$2$3).keys.getPublic(format5 === "compressed", true); + if (format5 === "hybrid") { + if (key[key.length - 1] % 2) { + key[0] = 7; + } else { + key[0] = 6; + } + } + return formatReturnValue(key, enc); + }; + ECDH.prototype.getPrivateKey = function(enc) { + return formatReturnValue((this || _global$2$3).keys.getPrivate(), enc); + }; + ECDH.prototype.setPublicKey = function(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$2$3).keys._importPublic(pub); + return this || _global$2$3; + }; + ECDH.prototype.setPrivateKey = function(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + var _priv = new BN(priv); + _priv = _priv.toString(16); + (this || _global$2$3).keys = (this || _global$2$3).curve.genKeyPair(); + (this || _global$2$3).keys._importPrivate(_priv); + return this || _global$2$3; + }; + function formatReturnValue(bn, enc, len) { + if (!Array.isArray(bn)) { + bn = bn.toArray(); + } + var buf = new Buffer4(bn); + if (len && buf.length < len) { + var zeros = new Buffer4(len - buf.length); + zeros.fill(0); + buf = Buffer4.concat([zeros, buf]); + } + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$a$3; +} +function dew$8$3() { + if (_dewExec$8$3) + return exports$9$3; + _dewExec$8$3 = true; + var createHash2 = dew$2y(); + var Buffer4 = dew$2P().Buffer; + exports$9$3 = function(seed, len) { + var t8 = Buffer4.alloc(0); + var i7 = 0; + var c7; + while (t8.length < len) { + c7 = i2ops(i7++); + t8 = Buffer4.concat([t8, createHash2("sha1").update(seed).update(c7).digest()]); + } + return t8.slice(0, len); + }; + function i2ops(c7) { + var out = Buffer4.allocUnsafe(4); + out.writeUInt32BE(c7, 0); + return out; + } + return exports$9$3; +} +function dew$7$3() { + if (_dewExec$7$3) + return exports$8$3; + _dewExec$7$3 = true; + exports$8$3 = function xor2(a7, b8) { + var len = a7.length; + var i7 = -1; + while (++i7 < len) { + a7[i7] ^= b8[i7]; + } + return a7; + }; + return exports$8$3; +} +function dew$6$3() { + if (_dewExec$6$3) + return module$c.exports; + _dewExec$6$3 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$1$3).negative = 0; + (this || _global$1$3).words = null; + (this || _global$1$3).length = 0; + (this || _global$1$3).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = buffer.Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$1$3).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$1$3).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$1$3).words = [number & 67108863]; + (this || _global$1$3).length = 1; + } else if (number < 4503599627370496) { + (this || _global$1$3).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$1$3).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$1$3).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$1$3).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$1$3).words = [0]; + (this || _global$1$3).length = 1; + return this || _global$1$3; + } + (this || _global$1$3).length = Math.ceil(number.length / 3); + (this || _global$1$3).words = new Array((this || _global$1$3).length); + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + (this || _global$1$3).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$1$3).words[j6] |= w6 << off3 & 67108863; + (this || _global$1$3).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$1$3).words[j6] |= w6 << off3 & 67108863; + (this || _global$1$3).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$1$3).length = Math.ceil((number.length - start) / 6); + (this || _global$1$3).words = new Array((this || _global$1$3).length); + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + (this || _global$1$3).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$1$3).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$1$3).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$1$3).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$1$3).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$1$3).words = [0]; + (this || _global$1$3).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$1$3).words[0] + word < 67108864) { + (this || _global$1$3).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$1$3).words[0] + word < 67108864) { + (this || _global$1$3).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$1$3).length); + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + dest.words[i7] = (this || _global$1$3).words[i7]; + } + dest.length = (this || _global$1$3).length; + dest.negative = (this || _global$1$3).negative; + dest.red = (this || _global$1$3).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$1$3).length < size2) { + (this || _global$1$3).words[(this || _global$1$3).length++] = 0; + } + return this || _global$1$3; + }; + BN.prototype.strip = function strip() { + while ((this || _global$1$3).length > 1 && (this || _global$1$3).words[(this || _global$1$3).length - 1] === 0) { + (this || _global$1$3).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$1$3).length === 1 && (this || _global$1$3).words[0] === 0) { + (this || _global$1$3).negative = 0; + } + return this || _global$1$3; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$1$3).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + var w6 = (this || _global$1$3).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$1$3).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$1$3).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$1$3).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$1$3).words[0]; + if ((this || _global$1$3).length === 2) { + ret += (this || _global$1$3).words[1] * 67108864; + } else if ((this || _global$1$3).length === 3 && (this || _global$1$3).words[2] === 1) { + ret += 4503599627370496 + (this || _global$1$3).words[1] * 67108864; + } else if ((this || _global$1$3).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$1$3).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$1$3).words[(this || _global$1$3).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$1$3).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + var b8 = this._zeroBits((this || _global$1$3).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$1$3).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$1$3).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$1$3).negative ^= 1; + } + return this || _global$1$3; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$1$3).length < num.length) { + (this || _global$1$3).words[(this || _global$1$3).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$1$3).words[i7] = (this || _global$1$3).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$1$3).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$1$3); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$1$3); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$1$3).length > num.length) { + b8 = num; + } else { + b8 = this || _global$1$3; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$1$3).words[i7] = (this || _global$1$3).words[i7] & num.words[i7]; + } + (this || _global$1$3).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$1$3).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$1$3); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$1$3); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$1$3).length > num.length) { + a7 = this || _global$1$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$3; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$1$3).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$1$3) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$1$3).words[i7] = a7.words[i7]; + } + } + (this || _global$1$3).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$1$3).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$1$3); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$1$3).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$1$3); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$1$3).words[i7] = ~(this || _global$1$3).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$1$3).words[i7] = ~(this || _global$1$3).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$1$3).words[off3] = (this || _global$1$3).words[off3] | 1 << wbit; + } else { + (this || _global$1$3).words[off3] = (this || _global$1$3).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$1$3).negative !== 0 && num.negative === 0) { + (this || _global$1$3).negative = 0; + r8 = this.isub(num); + (this || _global$1$3).negative ^= 1; + return this._normSign(); + } else if ((this || _global$1$3).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$1$3).length > num.length) { + a7 = this || _global$1$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$3; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$1$3).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$1$3).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$1$3).length = a7.length; + if (carry !== 0) { + (this || _global$1$3).words[(this || _global$1$3).length] = carry; + (this || _global$1$3).length++; + } else if (a7 !== (this || _global$1$3)) { + for (; i7 < a7.length; i7++) { + (this || _global$1$3).words[i7] = a7.words[i7]; + } + } + return this || _global$1$3; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$1$3).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$1$3).negative !== 0) { + (this || _global$1$3).negative = 0; + res = num.sub(this || _global$1$3); + (this || _global$1$3).negative = 1; + return res; + } + if ((this || _global$1$3).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$1$3); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$1$3).negative !== 0) { + (this || _global$1$3).negative = 0; + this.iadd(num); + (this || _global$1$3).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$1$3).negative = 0; + (this || _global$1$3).length = 1; + (this || _global$1$3).words[0] = 0; + return this || _global$1$3; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$1$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$1$3; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$1$3).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$1$3).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$1$3)) { + for (; i7 < a7.length; i7++) { + (this || _global$1$3).words[i7] = a7.words[i7]; + } + } + (this || _global$1$3).length = Math.max((this || _global$1$3).length, i7); + if (a7 !== (this || _global$1$3)) { + (this || _global$1$3).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$1$3).length + num.length; + if ((this || _global$1$3).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$1$3, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$1$3, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$1$3, num, out); + } else { + res = jumboMulTo(this || _global$1$3, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$1$3).x = x7; + (this || _global$1$3).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$1$3).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$1$3).length + num.length); + return jumboMulTo(this || _global$1$3, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$1$3); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$1$3).length; i7++) { + var w6 = ((this || _global$1$3).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$1$3).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$1$3).words[i7] = carry; + (this || _global$1$3).length++; + } + return this || _global$1$3; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$1$3); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$1$3; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$1$3).length; i7++) { + var newCarry = (this || _global$1$3).words[i7] & carryMask; + var c7 = ((this || _global$1$3).words[i7] | 0) - newCarry << r8; + (this || _global$1$3).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$1$3).words[i7] = carry; + (this || _global$1$3).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$1$3).length - 1; i7 >= 0; i7--) { + (this || _global$1$3).words[i7 + s7] = (this || _global$1$3).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$1$3).words[i7] = 0; + } + (this || _global$1$3).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$1$3).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$1$3).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$1$3).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$1$3).length > s7) { + (this || _global$1$3).length -= s7; + for (i7 = 0; i7 < (this || _global$1$3).length; i7++) { + (this || _global$1$3).words[i7] = (this || _global$1$3).words[i7 + s7]; + } + } else { + (this || _global$1$3).words[0] = 0; + (this || _global$1$3).length = 1; + } + var carry = 0; + for (i7 = (this || _global$1$3).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$1$3).words[i7] | 0; + (this || _global$1$3).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$1$3).length === 0) { + (this || _global$1$3).words[0] = 0; + (this || _global$1$3).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$1$3).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$1$3).length <= s7) + return false; + var w6 = (this || _global$1$3).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$1$3).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$1$3).length <= s7) { + return this || _global$1$3; + } + if (r8 !== 0) { + s7++; + } + (this || _global$1$3).length = Math.min(s7, (this || _global$1$3).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$1$3).words[(this || _global$1$3).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$1$3).negative !== 0) { + if ((this || _global$1$3).length === 1 && ((this || _global$1$3).words[0] | 0) < num) { + (this || _global$1$3).words[0] = num - ((this || _global$1$3).words[0] | 0); + (this || _global$1$3).negative = 0; + return this || _global$1$3; + } + (this || _global$1$3).negative = 0; + this.isubn(num); + (this || _global$1$3).negative = 1; + return this || _global$1$3; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$1$3).words[0] += num; + for (var i7 = 0; i7 < (this || _global$1$3).length && (this || _global$1$3).words[i7] >= 67108864; i7++) { + (this || _global$1$3).words[i7] -= 67108864; + if (i7 === (this || _global$1$3).length - 1) { + (this || _global$1$3).words[i7 + 1] = 1; + } else { + (this || _global$1$3).words[i7 + 1]++; + } + } + (this || _global$1$3).length = Math.max((this || _global$1$3).length, i7 + 1); + return this || _global$1$3; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$1$3).negative !== 0) { + (this || _global$1$3).negative = 0; + this.iaddn(num); + (this || _global$1$3).negative = 1; + return this || _global$1$3; + } + (this || _global$1$3).words[0] -= num; + if ((this || _global$1$3).length === 1 && (this || _global$1$3).words[0] < 0) { + (this || _global$1$3).words[0] = -(this || _global$1$3).words[0]; + (this || _global$1$3).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$1$3).length && (this || _global$1$3).words[i7] < 0; i7++) { + (this || _global$1$3).words[i7] += 67108864; + (this || _global$1$3).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$1$3).negative = 0; + return this || _global$1$3; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$1$3).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$1$3).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$1$3).length - shift; i7++) { + w6 = ((this || _global$1$3).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$1$3).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$1$3).length; i7++) { + w6 = -((this || _global$1$3).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$1$3).words[i7] = w6 & 67108863; + } + (this || _global$1$3).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$1$3).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$1$3).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$1$3).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$1$3).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$1$3).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$1$3 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$1$3).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$1$3).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$1$3).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$1$3).words[i7] | 0) + carry * 67108864; + (this || _global$1$3).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$1$3; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$1$3; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$1$3).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$1$3).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$1$3).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$1$3).length <= s7) { + this._expand(s7 + 1); + (this || _global$1$3).words[s7] |= q5; + return this || _global$1$3; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$1$3).length; i7++) { + var w6 = (this || _global$1$3).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$1$3).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$1$3).words[i7] = carry; + (this || _global$1$3).length++; + } + return this || _global$1$3; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$1$3).length === 1 && (this || _global$1$3).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$1$3).negative !== 0 && !negative) + return -1; + if ((this || _global$1$3).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$1$3).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$1$3).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$1$3).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$1$3).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$1$3).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$1$3).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$1$3).length > num.length) + return 1; + if ((this || _global$1$3).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$1$3).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$1$3).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$1$3).red, "Already a number in reduction context"); + assert4((this || _global$1$3).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$1$3)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$1$3).red, "fromRed works only with numbers in reduction context"); + return (this || _global$1$3).red.convertFrom(this || _global$1$3); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$1$3).red = ctx; + return this || _global$1$3; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$1$3).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$1$3).red, "redAdd works only with red numbers"); + return (this || _global$1$3).red.add(this || _global$1$3, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$1$3).red, "redIAdd works only with red numbers"); + return (this || _global$1$3).red.iadd(this || _global$1$3, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$1$3).red, "redSub works only with red numbers"); + return (this || _global$1$3).red.sub(this || _global$1$3, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$1$3).red, "redISub works only with red numbers"); + return (this || _global$1$3).red.isub(this || _global$1$3, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$1$3).red, "redShl works only with red numbers"); + return (this || _global$1$3).red.shl(this || _global$1$3, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$1$3).red, "redMul works only with red numbers"); + (this || _global$1$3).red._verify2(this || _global$1$3, num); + return (this || _global$1$3).red.mul(this || _global$1$3, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$1$3).red, "redMul works only with red numbers"); + (this || _global$1$3).red._verify2(this || _global$1$3, num); + return (this || _global$1$3).red.imul(this || _global$1$3, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$1$3).red, "redSqr works only with red numbers"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.sqr(this || _global$1$3); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$1$3).red, "redISqr works only with red numbers"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.isqr(this || _global$1$3); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$1$3).red, "redSqrt works only with red numbers"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.sqrt(this || _global$1$3); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$1$3).red, "redInvm works only with red numbers"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.invm(this || _global$1$3); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$1$3).red, "redNeg works only with red numbers"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.neg(this || _global$1$3); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$1$3).red && !num.red, "redPow(normalNum)"); + (this || _global$1$3).red._verify1(this || _global$1$3); + return (this || _global$1$3).red.pow(this || _global$1$3, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$1$3).name = name2; + (this || _global$1$3).p = new BN(p7, 16); + (this || _global$1$3).n = (this || _global$1$3).p.bitLength(); + (this || _global$1$3).k = new BN(1).iushln((this || _global$1$3).n).isub((this || _global$1$3).p); + (this || _global$1$3).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$1$3).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$1$3).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$1$3).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$1$3).n); + var cmp = rlen < (this || _global$1$3).n ? -1 : r8.ucmp((this || _global$1$3).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$1$3).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$1$3).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$1$3).k); + }; + function K256() { + MPrime.call(this || _global$1$3, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$1$3, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$1$3, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$1$3, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$1$3).m = prime.p; + (this || _global$1$3).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$1$3).m = m7; + (this || _global$1$3).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$1$3).prime) + return (this || _global$1$3).prime.ireduce(a7)._forceRed(this || _global$1$3); + return a7.umod((this || _global$1$3).m)._forceRed(this || _global$1$3); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$1$3).m.sub(a7)._forceRed(this || _global$1$3); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$1$3).m) >= 0) { + res.isub((this || _global$1$3).m); + } + return res._forceRed(this || _global$1$3); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$1$3).m) >= 0) { + res.isub((this || _global$1$3).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$1$3).m); + } + return res._forceRed(this || _global$1$3); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$1$3).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$1$3).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$1$3).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$1$3).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$1$3); + var nOne = one.redNeg(); + var lpow = (this || _global$1$3).m.subn(1).iushrn(1); + var z6 = (this || _global$1$3).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$1$3); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$1$3).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$1$3); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$1$3); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$1$3).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$1$3, m7); + (this || _global$1$3).shift = (this || _global$1$3).m.bitLength(); + if ((this || _global$1$3).shift % 26 !== 0) { + (this || _global$1$3).shift += 26 - (this || _global$1$3).shift % 26; + } + (this || _global$1$3).r = new BN(1).iushln((this || _global$1$3).shift); + (this || _global$1$3).r2 = this.imod((this || _global$1$3).r.sqr()); + (this || _global$1$3).rinv = (this || _global$1$3).r._invmp((this || _global$1$3).m); + (this || _global$1$3).minv = (this || _global$1$3).rinv.mul((this || _global$1$3).r).isubn(1).div((this || _global$1$3).m); + (this || _global$1$3).minv = (this || _global$1$3).minv.umod((this || _global$1$3).r); + (this || _global$1$3).minv = (this || _global$1$3).r.sub((this || _global$1$3).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$1$3).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$1$3).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$1$3).shift).mul((this || _global$1$3).minv).imaskn((this || _global$1$3).shift).mul((this || _global$1$3).m); + var u7 = t8.isub(c7).iushrn((this || _global$1$3).shift); + var res = u7; + if (u7.cmp((this || _global$1$3).m) >= 0) { + res = u7.isub((this || _global$1$3).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$1$3).m); + } + return res._forceRed(this || _global$1$3); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$1$3); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$1$3).shift).mul((this || _global$1$3).minv).imaskn((this || _global$1$3).shift).mul((this || _global$1$3).m); + var u7 = t8.isub(c7).iushrn((this || _global$1$3).shift); + var res = u7; + if (u7.cmp((this || _global$1$3).m) >= 0) { + res = u7.isub((this || _global$1$3).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$1$3).m); + } + return res._forceRed(this || _global$1$3); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$1$3).m).mul((this || _global$1$3).r2)); + return res._forceRed(this || _global$1$3); + }; + })(module$c, exports$7$3); + return module$c.exports; +} +function dew$5$3() { + if (_dewExec$5$3) + return exports$6$3; + _dewExec$5$3 = true; + var BN = dew$6$3(); + var Buffer4 = dew$2P().Buffer; + function withPublic(paddedMsg, key) { + return Buffer4.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray()); + } + exports$6$3 = withPublic; + return exports$6$3; +} +function dew$4$3() { + if (_dewExec$4$3) + return exports$5$3; + _dewExec$4$3 = true; + var parseKeys = dew$e$3(); + var randomBytes2 = dew$2O(); + var createHash2 = dew$2y(); + var mgf = dew$8$3(); + var xor2 = dew$7$3(); + var BN = dew$6$3(); + var withPublic = dew$5$3(); + var crt = dew$W$2(); + var Buffer4 = dew$2P().Buffer; + exports$5$3 = function publicEncrypt2(publicKey, msg, reverse2) { + var padding; + if (publicKey.padding) { + padding = publicKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(publicKey); + var paddedMsg; + if (padding === 4) { + paddedMsg = oaep(key, msg); + } else if (padding === 1) { + paddedMsg = pkcs1(key, msg, reverse2); + } else if (padding === 3) { + paddedMsg = new BN(msg); + if (paddedMsg.cmp(key.modulus) >= 0) { + throw new Error("data too long for modulus"); + } + } else { + throw new Error("unknown padding"); + } + if (reverse2) { + return crt(paddedMsg, key); + } else { + return withPublic(paddedMsg, key); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var mLen = msg.length; + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + var hLen2 = 2 * hLen; + if (mLen > k6 - hLen2 - 2) { + throw new Error("message too long"); + } + var ps = Buffer4.alloc(k6 - mLen - hLen2 - 2); + var dblen = k6 - hLen - 1; + var seed = randomBytes2(hLen); + var maskedDb = xor2(Buffer4.concat([iHash, ps, Buffer4.alloc(1, 1), msg], dblen), mgf(seed, dblen)); + var maskedSeed = xor2(seed, mgf(maskedDb, hLen)); + return new BN(Buffer4.concat([Buffer4.alloc(1), maskedSeed, maskedDb], k6)); + } + function pkcs1(key, msg, reverse2) { + var mLen = msg.length; + var k6 = key.modulus.byteLength(); + if (mLen > k6 - 11) { + throw new Error("message too long"); + } + var ps; + if (reverse2) { + ps = Buffer4.alloc(k6 - mLen - 3, 255); + } else { + ps = nonZero(k6 - mLen - 3); + } + return new BN(Buffer4.concat([Buffer4.from([0, reverse2 ? 1 : 2]), ps, Buffer4.alloc(1), msg], k6)); + } + function nonZero(len) { + var out = Buffer4.allocUnsafe(len); + var i7 = 0; + var cache = randomBytes2(len * 2); + var cur = 0; + var num; + while (i7 < len) { + if (cur === cache.length) { + cache = randomBytes2(len * 2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i7++] = num; + } + } + return out; + } + return exports$5$3; +} +function dew$3$3() { + if (_dewExec$3$3) + return exports$4$3; + _dewExec$3$3 = true; + var parseKeys = dew$e$3(); + var mgf = dew$8$3(); + var xor2 = dew$7$3(); + var BN = dew$6$3(); + var crt = dew$W$2(); + var createHash2 = dew$2y(); + var withPublic = dew$5$3(); + var Buffer4 = dew$2P().Buffer; + exports$4$3 = function privateDecrypt2(privateKey, enc, reverse2) { + var padding; + if (privateKey.padding) { + padding = privateKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(privateKey); + var k6 = key.modulus.byteLength(); + if (enc.length > k6 || new BN(enc).cmp(key.modulus) >= 0) { + throw new Error("decryption error"); + } + var msg; + if (reverse2) { + msg = withPublic(new BN(enc), key); + } else { + msg = crt(enc, key); + } + var zBuffer = Buffer4.alloc(k6 - msg.length); + msg = Buffer4.concat([zBuffer, msg], k6); + if (padding === 4) { + return oaep(key, msg); + } else if (padding === 1) { + return pkcs1(key, msg, reverse2); + } else if (padding === 3) { + return msg; + } else { + throw new Error("unknown padding"); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + if (msg[0] !== 0) { + throw new Error("decryption error"); + } + var maskedSeed = msg.slice(1, hLen + 1); + var maskedDb = msg.slice(hLen + 1); + var seed = xor2(maskedSeed, mgf(maskedDb, hLen)); + var db = xor2(maskedDb, mgf(seed, k6 - hLen - 1)); + if (compare(iHash, db.slice(0, hLen))) { + throw new Error("decryption error"); + } + var i7 = hLen; + while (db[i7] === 0) { + i7++; + } + if (db[i7++] !== 1) { + throw new Error("decryption error"); + } + return db.slice(i7); + } + function pkcs1(key, msg, reverse2) { + var p1 = msg.slice(0, 2); + var i7 = 2; + var status = 0; + while (msg[i7++] !== 0) { + if (i7 >= msg.length) { + status++; + break; + } + } + var ps = msg.slice(2, i7 - 1); + if (p1.toString("hex") !== "0002" && !reverse2 || p1.toString("hex") !== "0001" && reverse2) { + status++; + } + if (ps.length < 8) { + status++; + } + if (status) { + throw new Error("decryption error"); + } + return msg.slice(i7); + } + function compare(a7, b8) { + a7 = Buffer4.from(a7); + b8 = Buffer4.from(b8); + var dif = 0; + var len = a7.length; + if (a7.length !== b8.length) { + dif++; + len = Math.min(a7.length, b8.length); + } + var i7 = -1; + while (++i7 < len) { + dif += a7[i7] ^ b8[i7]; + } + return dif; + } + return exports$4$3; +} +function dew$2$3() { + if (_dewExec$2$3) + return exports$3$3; + _dewExec$2$3 = true; + exports$3$3.publicEncrypt = dew$4$3(); + exports$3$3.privateDecrypt = dew$3$3(); + exports$3$3.privateEncrypt = function privateEncrypt2(key, buf) { + return exports$3$3.publicEncrypt(key, buf, true); + }; + exports$3$3.publicDecrypt = function publicDecrypt2(key, buf) { + return exports$3$3.privateDecrypt(key, buf, true); + }; + return exports$3$3; +} +function dew$1$3() { + if (_dewExec$1$3) + return exports$2$3; + _dewExec$1$3 = true; + var process$1$1 = process4; + function oldBrowser() { + throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); + } + var safeBuffer = dew$2P(); + var randombytes = dew$2O(); + var Buffer4 = safeBuffer.Buffer; + var kBufferMaxLength = safeBuffer.kMaxLength; + var crypto2 = _global$V.crypto || _global$V.msCrypto; + var kMaxUint32 = Math.pow(2, 32) - 1; + function assertOffset(offset, length) { + if (typeof offset !== "number" || offset !== offset) { + throw new TypeError("offset must be a number"); + } + if (offset > kMaxUint32 || offset < 0) { + throw new TypeError("offset must be a uint32"); + } + if (offset > kBufferMaxLength || offset > length) { + throw new RangeError("offset out of range"); + } + } + function assertSize(size2, offset, length) { + if (typeof size2 !== "number" || size2 !== size2) { + throw new TypeError("size must be a number"); + } + if (size2 > kMaxUint32 || size2 < 0) { + throw new TypeError("size must be a uint32"); + } + if (size2 + offset > length || size2 > kBufferMaxLength) { + throw new RangeError("buffer too small"); + } + } + if (crypto2 && crypto2.getRandomValues || !process$1$1.browser) { + exports$2$3.randomFill = randomFill2; + exports$2$3.randomFillSync = randomFillSync2; + } else { + exports$2$3.randomFill = oldBrowser; + exports$2$3.randomFillSync = oldBrowser; + } + function randomFill2(buf, offset, size2, cb) { + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global$V.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + if (typeof offset === "function") { + cb = offset; + offset = 0; + size2 = buf.length; + } else if (typeof size2 === "function") { + cb = size2; + size2 = buf.length - offset; + } else if (typeof cb !== "function") { + throw new TypeError('"cb" argument must be a function'); + } + assertOffset(offset, buf.length); + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2, cb); + } + function actualFill(buf, offset, size2, cb) { + if (process$1$1.browser) { + var ourBuf = buf.buffer; + var uint = new Uint8Array(ourBuf, offset, size2); + crypto2.getRandomValues(uint); + if (cb) { + process$1$1.nextTick(function() { + cb(null, buf); + }); + return; + } + return buf; + } + if (cb) { + randombytes(size2, function(err, bytes2) { + if (err) { + return cb(err); + } + bytes2.copy(buf, offset); + cb(null, buf); + }); + return; + } + var bytes = randombytes(size2); + bytes.copy(buf, offset); + return buf; + } + function randomFillSync2(buf, offset, size2) { + if (typeof offset === "undefined") { + offset = 0; + } + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global$V.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + assertOffset(offset, buf.length); + if (size2 === void 0) + size2 = buf.length - offset; + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2); + } + return exports$2$3; +} +function dew$2Q() { + if (_dewExec$2Q) + return exports$1$3; + _dewExec$2Q = true; + exports$1$3.randomBytes = exports$1$3.rng = exports$1$3.pseudoRandomBytes = exports$1$3.prng = dew$2O(); + exports$1$3.createHash = exports$1$3.Hash = dew$2y(); + exports$1$3.createHmac = exports$1$3.Hmac = dew$2v(); + var algos = dew$2u(); + var algoKeys = Object.keys(algos); + var hashes = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(algoKeys); + exports$1$3.getHashes = function() { + return hashes; + }; + var p7 = dew$2o(); + exports$1$3.pbkdf2 = p7.pbkdf2; + exports$1$3.pbkdf2Sync = p7.pbkdf2Sync; + var aes = dew$1Y(); + exports$1$3.Cipher = aes.Cipher; + exports$1$3.createCipher = aes.createCipher; + exports$1$3.Cipheriv = aes.Cipheriv; + exports$1$3.createCipheriv = aes.createCipheriv; + exports$1$3.Decipher = aes.Decipher; + exports$1$3.createDecipher = aes.createDecipher; + exports$1$3.Decipheriv = aes.Decipheriv; + exports$1$3.createDecipheriv = aes.createDecipheriv; + exports$1$3.getCiphers = aes.getCiphers; + exports$1$3.listCiphers = aes.listCiphers; + var dh = dew$Z$2(); + exports$1$3.DiffieHellmanGroup = dh.DiffieHellmanGroup; + exports$1$3.createDiffieHellmanGroup = dh.createDiffieHellmanGroup; + exports$1$3.getDiffieHellman = dh.getDiffieHellman; + exports$1$3.createDiffieHellman = dh.createDiffieHellman; + exports$1$3.DiffieHellman = dh.DiffieHellman; + var sign = dew$b$3(); + exports$1$3.createSign = sign.createSign; + exports$1$3.Sign = sign.Sign; + exports$1$3.createVerify = sign.createVerify; + exports$1$3.Verify = sign.Verify; + exports$1$3.createECDH = dew$9$3(); + var publicEncrypt2 = dew$2$3(); + exports$1$3.publicEncrypt = publicEncrypt2.publicEncrypt; + exports$1$3.privateEncrypt = publicEncrypt2.privateEncrypt; + exports$1$3.publicDecrypt = publicEncrypt2.publicDecrypt; + exports$1$3.privateDecrypt = publicEncrypt2.privateDecrypt; + var rf = dew$1$3(); + exports$1$3.randomFill = rf.randomFill; + exports$1$3.randomFillSync = rf.randomFillSync; + exports$1$3.createCredentials = function() { + throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); + }; + exports$1$3.constants = { + "DH_CHECK_P_NOT_SAFE_PRIME": 2, + "DH_CHECK_P_NOT_PRIME": 1, + "DH_UNABLE_TO_CHECK_GENERATOR": 4, + "DH_NOT_SUITABLE_GENERATOR": 8, + "NPN_ENABLED": 1, + "ALPN_ENABLED": 1, + "RSA_PKCS1_PADDING": 1, + "RSA_SSLV23_PADDING": 2, + "RSA_NO_PADDING": 3, + "RSA_PKCS1_OAEP_PADDING": 4, + "RSA_X931_PADDING": 5, + "RSA_PKCS1_PSS_PADDING": 6, + "POINT_CONVERSION_COMPRESSED": 2, + "POINT_CONVERSION_UNCOMPRESSED": 4, + "POINT_CONVERSION_HYBRID": 6 + }; + return exports$1$3; +} +function dew$1i() { + if (_dewExec$1i) + return exports$1j; + _dewExec$1i = true; + var r8; + exports$1j = function rand(len) { + if (!r8) + r8 = new Rand(null); + return r8.generate(len); + }; + function Rand(rand) { + (this || _global$j).rand = rand; + } + exports$1j.Rand = Rand; + Rand.prototype.generate = function generate2(len) { + return this._rand(len); + }; + Rand.prototype._rand = function _rand(n7) { + if ((this || _global$j).rand.getBytes) + return (this || _global$j).rand.getBytes(n7); + var res = new Uint8Array(n7); + for (var i7 = 0; i7 < res.length; i7++) + res[i7] = (this || _global$j).rand.getByte(); + return res; + }; + if (typeof self === "object") { + if (self.crypto && self.crypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.crypto.getRandomValues(arr); + return arr; + }; + } else if (self.msCrypto && self.msCrypto.getRandomValues) { + Rand.prototype._rand = function _rand(n7) { + var arr = new Uint8Array(n7); + self.msCrypto.getRandomValues(arr); + return arr; + }; + } else if (typeof window === "object") { + Rand.prototype._rand = function() { + throw new Error("Not implemented yet"); + }; + } + } else { + try { + var crypto2 = exports$2R; + if (typeof crypto2.randomBytes !== "function") + throw new Error("Not supported"); + Rand.prototype._rand = function _rand(n7) { + return crypto2.randomBytes(n7); + }; + } catch (e10) { + } + } + return exports$1j; +} +function dew$1h() { + if (_dewExec$1h) + return exports$1i; + _dewExec$1h = true; + var bn = dew$2R(); + var brorand = dew$1i(); + function MillerRabin(rand) { + (this || _global$i).rand = rand || new brorand.Rand(); + } + exports$1i = MillerRabin; + MillerRabin.create = function create2(rand) { + return new MillerRabin(rand); + }; + MillerRabin.prototype._randbelow = function _randbelow(n7) { + var len = n7.bitLength(); + var min_bytes = Math.ceil(len / 8); + do + var a7 = new bn((this || _global$i).rand.generate(min_bytes)); + while (a7.cmp(n7) >= 0); + return a7; + }; + MillerRabin.prototype._randrange = function _randrange(start, stop) { + var size2 = stop.sub(start); + return start.add(this._randbelow(size2)); + }; + MillerRabin.prototype.test = function test(n7, k6, cb) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + var prime = true; + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + if (cb) + cb(a7); + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return false; + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) + return false; + } + return prime; + }; + MillerRabin.prototype.getDivisor = function getDivisor(n7, k6) { + var len = n7.bitLength(); + var red = bn.mont(n7); + var rone = new bn(1).toRed(red); + if (!k6) + k6 = Math.max(1, len / 48 | 0); + var n1 = n7.subn(1); + for (var s7 = 0; !n1.testn(s7); s7++) { + } + var d7 = n7.shrn(s7); + var rn1 = n1.toRed(red); + for (; k6 > 0; k6--) { + var a7 = this._randrange(new bn(2), n1); + var g7 = n7.gcd(a7); + if (g7.cmpn(1) !== 0) + return g7; + var x7 = a7.toRed(red).redPow(d7); + if (x7.cmp(rone) === 0 || x7.cmp(rn1) === 0) + continue; + for (var i7 = 1; i7 < s7; i7++) { + x7 = x7.redSqr(); + if (x7.cmp(rone) === 0) + return x7.fromRed().subn(1).gcd(n7); + if (x7.cmp(rn1) === 0) + break; + } + if (i7 === s7) { + x7 = x7.redSqr(); + return x7.fromRed().subn(1).gcd(n7); + } + } + return false; + }; + return exports$1i; +} +function dew$1g() { + if (_dewExec$1g) + return exports$1h; + _dewExec$1g = true; + var randomBytes2 = dew$3G(); + exports$1h = findPrime; + findPrime.simpleSieve = simpleSieve; + findPrime.fermatTest = fermatTest; + var BN = dew$2S(); + var TWENTYFOUR = new BN(24); + var MillerRabin = dew$1h(); + var millerRabin = new MillerRabin(); + var ONE = new BN(1); + var TWO = new BN(2); + var FIVE = new BN(5); + new BN(16); + new BN(8); + var TEN = new BN(10); + var THREE = new BN(3); + new BN(7); + var ELEVEN = new BN(11); + var FOUR = new BN(4); + new BN(12); + var primes = null; + function _getPrimes() { + if (primes !== null) + return primes; + var limit = 1048576; + var res = []; + res[0] = 2; + for (var i7 = 1, k6 = 3; k6 < limit; k6 += 2) { + var sqrt = Math.ceil(Math.sqrt(k6)); + for (var j6 = 0; j6 < i7 && res[j6] <= sqrt; j6++) + if (k6 % res[j6] === 0) + break; + if (i7 !== j6 && res[j6] <= sqrt) + continue; + res[i7++] = k6; + } + primes = res; + return res; + } + function simpleSieve(p7) { + var primes2 = _getPrimes(); + for (var i7 = 0; i7 < primes2.length; i7++) + if (p7.modn(primes2[i7]) === 0) { + if (p7.cmpn(primes2[i7]) === 0) { + return true; + } else { + return false; + } + } + return true; + } + function fermatTest(p7) { + var red = BN.mont(p7); + return TWO.toRed(red).redPow(p7.subn(1)).fromRed().cmpn(1) === 0; + } + function findPrime(bits, gen) { + if (bits < 16) { + if (gen === 2 || gen === 5) { + return new BN([140, 123]); + } else { + return new BN([140, 39]); + } + } + gen = new BN(gen); + var num, n22; + while (true) { + num = new BN(randomBytes2(Math.ceil(bits / 8))); + while (num.bitLength() > bits) { + num.ishrn(1); + } + if (num.isEven()) { + num.iadd(ONE); + } + if (!num.testn(1)) { + num.iadd(TWO); + } + if (!gen.cmp(TWO)) { + while (num.mod(TWENTYFOUR).cmp(ELEVEN)) { + num.iadd(FOUR); + } + } else if (!gen.cmp(FIVE)) { + while (num.mod(TEN).cmp(THREE)) { + num.iadd(FOUR); + } + } + n22 = num.shrn(1); + if (simpleSieve(n22) && simpleSieve(num) && fermatTest(n22) && fermatTest(num) && millerRabin.test(n22) && millerRabin.test(num)) { + return num; + } + } + } + return exports$1h; +} +function dew$1f() { + if (_dewExec$1f) + return exports$1g; + _dewExec$1f = true; + var Buffer4 = dew().Buffer; + var BN = dew$2S(); + var MillerRabin = dew$1h(); + var millerRabin = new MillerRabin(); + var TWENTYFOUR = new BN(24); + var ELEVEN = new BN(11); + var TEN = new BN(10); + var THREE = new BN(3); + var SEVEN = new BN(7); + var primes = dew$1g(); + var randomBytes2 = dew$3G(); + exports$1g = DH; + function setPublicKey(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$h)._pub = new BN(pub); + return this || _global$h; + } + function setPrivateKey(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + (this || _global$h)._priv = new BN(priv); + return this || _global$h; + } + var primeCache = {}; + function checkPrime(prime, generator) { + var gen = generator.toString("hex"); + var hex = [gen, prime.toString(16)].join("_"); + if (hex in primeCache) { + return primeCache[hex]; + } + var error2 = 0; + if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) { + error2 += 1; + if (gen === "02" || gen === "05") { + error2 += 8; + } else { + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + if (!millerRabin.test(prime.shrn(1))) { + error2 += 2; + } + var rem; + switch (gen) { + case "02": + if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) { + error2 += 8; + } + break; + case "05": + rem = prime.mod(TEN); + if (rem.cmp(THREE) && rem.cmp(SEVEN)) { + error2 += 8; + } + break; + default: + error2 += 4; + } + primeCache[hex] = error2; + return error2; + } + function DH(prime, generator, malleable) { + this.setGenerator(generator); + (this || _global$h).__prime = new BN(prime); + (this || _global$h)._prime = BN.mont((this || _global$h).__prime); + (this || _global$h)._primeLen = prime.length; + (this || _global$h)._pub = void 0; + (this || _global$h)._priv = void 0; + (this || _global$h)._primeCode = void 0; + if (malleable) { + (this || _global$h).setPublicKey = setPublicKey; + (this || _global$h).setPrivateKey = setPrivateKey; + } else { + (this || _global$h)._primeCode = 8; + } + } + Object.defineProperty(DH.prototype, "verifyError", { + enumerable: true, + get: function() { + if (typeof (this || _global$h)._primeCode !== "number") { + (this || _global$h)._primeCode = checkPrime((this || _global$h).__prime, (this || _global$h).__gen); + } + return (this || _global$h)._primeCode; + } + }); + DH.prototype.generateKeys = function() { + if (!(this || _global$h)._priv) { + (this || _global$h)._priv = new BN(randomBytes2((this || _global$h)._primeLen)); + } + (this || _global$h)._pub = (this || _global$h)._gen.toRed((this || _global$h)._prime).redPow((this || _global$h)._priv).fromRed(); + return this.getPublicKey(); + }; + DH.prototype.computeSecret = function(other) { + other = new BN(other); + other = other.toRed((this || _global$h)._prime); + var secret = other.redPow((this || _global$h)._priv).fromRed(); + var out = new Buffer4(secret.toArray()); + var prime = this.getPrime(); + if (out.length < prime.length) { + var front = new Buffer4(prime.length - out.length); + front.fill(0); + out = Buffer4.concat([front, out]); + } + return out; + }; + DH.prototype.getPublicKey = function getPublicKey(enc) { + return formatReturnValue((this || _global$h)._pub, enc); + }; + DH.prototype.getPrivateKey = function getPrivateKey(enc) { + return formatReturnValue((this || _global$h)._priv, enc); + }; + DH.prototype.getPrime = function(enc) { + return formatReturnValue((this || _global$h).__prime, enc); + }; + DH.prototype.getGenerator = function(enc) { + return formatReturnValue((this || _global$h)._gen, enc); + }; + DH.prototype.setGenerator = function(gen, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(gen)) { + gen = new Buffer4(gen, enc); + } + (this || _global$h).__gen = gen; + (this || _global$h)._gen = new BN(gen); + return this || _global$h; + }; + function formatReturnValue(bn, enc) { + var buf = new Buffer4(bn.toArray()); + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$1g; +} +function dew$1e() { + if (_dewExec$1e) + return exports$1f; + _dewExec$1e = true; + var Buffer4 = dew().Buffer; + var generatePrime = dew$1g(); + var primes = _primes; + var DH = dew$1f(); + function getDiffieHellman2(mod2) { + var prime = new Buffer4(primes[mod2].prime, "hex"); + var gen = new Buffer4(primes[mod2].gen, "hex"); + return new DH(prime, gen); + } + var ENCODINGS = { + "binary": true, + "hex": true, + "base64": true + }; + function createDiffieHellman2(prime, enc, generator, genc) { + if (Buffer4.isBuffer(enc) || ENCODINGS[enc] === void 0) { + return createDiffieHellman2(prime, "binary", enc, generator); + } + enc = enc || "binary"; + genc = genc || "binary"; + generator = generator || new Buffer4([2]); + if (!Buffer4.isBuffer(generator)) { + generator = new Buffer4(generator, genc); + } + if (typeof prime === "number") { + return new DH(generatePrime(prime, generator), generator, true); + } + if (!Buffer4.isBuffer(prime)) { + prime = new Buffer4(prime, enc); + } + return new DH(prime, generator, true); + } + exports$1f.DiffieHellmanGroup = exports$1f.createDiffieHellmanGroup = exports$1f.getDiffieHellman = getDiffieHellman2; + exports$1f.createDiffieHellman = exports$1f.DiffieHellman = createDiffieHellman2; + return exports$1f; +} +function dew$1d() { + if (_dewExec$1d) + return exports$1e; + _dewExec$1d = true; + var process$1 = process3; + if (typeof process$1 === "undefined" || !process$1.version || process$1.version.indexOf("v0.") === 0 || process$1.version.indexOf("v1.") === 0 && process$1.version.indexOf("v1.8.") !== 0) { + exports$1e = { + nextTick: nextTick3 + }; + } else { + exports$1e = process$1; + } + function nextTick3(fn, arg1, arg2, arg3) { + if (typeof fn !== "function") { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i7; + switch (len) { + case 0: + case 1: + return process$1.nextTick(fn); + case 2: + return process$1.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process$1.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process$1.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i7 = 0; + while (i7 < args.length) { + args[i7++] = arguments[i7]; + } + return process$1.nextTick(function afterTick() { + fn.apply(null, args); + }); + } + } + return exports$1e; +} +function dew$1c() { + if (_dewExec$1c) + return exports$1d; + _dewExec$1c = true; + var toString3 = {}.toString; + exports$1d = Array.isArray || function(arr) { + return toString3.call(arr) == "[object Array]"; + }; + return exports$1d; +} +function dew$1b() { + if (_dewExec$1b) + return exports$1c; + _dewExec$1b = true; + exports$1c = y.EventEmitter; + return exports$1c; +} +function dew$1a() { + if (_dewExec$1a) + return exports$1b; + _dewExec$1a = true; + var buffer2 = dew(); + var Buffer4 = buffer2.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) { + exports$1b = buffer2; + } else { + copyProps(buffer2, exports$1b); + exports$1b.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer4(arg, encodingOrOffset, length); + } + copyProps(Buffer4, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer4(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size2, fill2, encoding) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer4(size2); + if (fill2 !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill2, encoding); + } else { + buf.fill(fill2); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer4(size2); + }; + SafeBuffer.allocUnsafeSlow = function(size2) { + if (typeof size2 !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer2.SlowBuffer(size2); + }; + return exports$1b; +} +function dew$19() { + if (_dewExec$19) + return exports$1a; + _dewExec$19 = true; + function isArray3(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString2(arg) === "[object Array]"; + } + exports$1a.isArray = isArray3; + function isBoolean4(arg) { + return typeof arg === "boolean"; + } + exports$1a.isBoolean = isBoolean4; + function isNull4(arg) { + return arg === null; + } + exports$1a.isNull = isNull4; + function isNullOrUndefined2(arg) { + return arg == null; + } + exports$1a.isNullOrUndefined = isNullOrUndefined2; + function isNumber3(arg) { + return typeof arg === "number"; + } + exports$1a.isNumber = isNumber3; + function isString4(arg) { + return typeof arg === "string"; + } + exports$1a.isString = isString4; + function isSymbol3(arg) { + return typeof arg === "symbol"; + } + exports$1a.isSymbol = isSymbol3; + function isUndefined3(arg) { + return arg === void 0; + } + exports$1a.isUndefined = isUndefined3; + function isRegExp3(re4) { + return objectToString2(re4) === "[object RegExp]"; + } + exports$1a.isRegExp = isRegExp3; + function isObject8(arg) { + return typeof arg === "object" && arg !== null; + } + exports$1a.isObject = isObject8; + function isDate3(d7) { + return objectToString2(d7) === "[object Date]"; + } + exports$1a.isDate = isDate3; + function isError3(e10) { + return objectToString2(e10) === "[object Error]" || e10 instanceof Error; + } + exports$1a.isError = isError3; + function isFunction3(arg) { + return typeof arg === "function"; + } + exports$1a.isFunction = isFunction3; + function isPrimitive2(arg) { + return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol + typeof arg === "undefined"; + } + exports$1a.isPrimitive = isPrimitive2; + exports$1a.isBuffer = dew().Buffer.isBuffer; + function objectToString2(o7) { + return Object.prototype.toString.call(o7); + } + return exports$1a; +} +function dew$18() { + if (_dewExec$18) + return exports$192; + _dewExec$18 = true; + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var Buffer4 = dew$1a().Buffer; + var util2 = X2; + function copyBuffer(src, target, offset) { + src.copy(target, offset); + } + exports$192 = function() { + function BufferList() { + _classCallCheck3(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + BufferList.prototype.push = function push4(v8) { + var entry = { + data: v8, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + }; + BufferList.prototype.unshift = function unshift4(v8) { + var entry = { + data: v8, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + }; + BufferList.prototype.shift = function shift() { + if (this.length === 0) + return; + var ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + }; + BufferList.prototype.clear = function clear2() { + this.head = this.tail = null; + this.length = 0; + }; + BufferList.prototype.join = function join3(s7) { + if (this.length === 0) + return ""; + var p7 = this.head; + var ret = "" + p7.data; + while (p7 = p7.next) { + ret += s7 + p7.data; + } + return ret; + }; + BufferList.prototype.concat = function concat2(n7) { + if (this.length === 0) + return Buffer4.alloc(0); + var ret = Buffer4.allocUnsafe(n7 >>> 0); + var p7 = this.head; + var i7 = 0; + while (p7) { + copyBuffer(p7.data, ret, i7); + i7 += p7.data.length; + p7 = p7.next; + } + return ret; + }; + return BufferList; + }(); + if (util2 && util2.inspect && util2.inspect.custom) { + exports$192.prototype[util2.inspect.custom] = function() { + var obj = util2.inspect({ + length: this.length + }); + return this.constructor.name + " " + obj; + }; + } + return exports$192; +} +function dew$17() { + if (_dewExec$17) + return exports$182; + _dewExec$17 = true; + var pna = dew$1d(); + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + pna.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + pna.nextTick(emitErrorNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, _this, err2); + } + } else if (cb) { + cb(err2); + } + }); + return this; + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + exports$182 = { + destroy, + undestroy + }; + return exports$182; +} +function dew$162() { + if (_dewExec$162) + return exports$172; + _dewExec$162 = true; + var process$1 = process3; + var pna = dew$1d(); + exports$172 = Writable2; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var asyncWrite = !process$1.browser && ["v0.10", "v0.9."].indexOf(process$1.version.slice(0, 5)) > -1 ? process$1.nextTick : pna.nextTick; + var Duplex2; + Writable2.WritableState = WritableState; + var util2 = Object.create(dew$19()); + util2.inherits = dew4(); + var internalUtil = { + deprecate: dew13() + }; + var Stream2 = dew$1b(); + var Buffer4 = dew$1a().Buffer; + var OurUint8Array = (typeof _global$g !== "undefined" ? _global$g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = dew$17(); + util2.inherits(Writable2, Stream2); + function nop() { + } + function WritableState(options, stream2) { + Duplex2 = Duplex2 || dew$152(); + options = options || {}; + var isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + if (hwm || hwm === 0) + this.highWaterMark = hwm; + else if (isDuplex && (writableHwm || writableHwm === 0)) + this.highWaterMark = writableHwm; + else + this.highWaterMark = defaultHwm; + this.highWaterMark = Math.floor(this.highWaterMark); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream2, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_6) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable2, Symbol.hasInstance, { + value: function(object) { + if (realHasInstance.call(this, object)) + return true; + if (this !== Writable2) + return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function(object) { + return object instanceof this; + }; + } + function Writable2(options) { + Duplex2 = Duplex2 || dew$152(); + if (!realHasInstance.call(Writable2, this) && !(this instanceof Duplex2)) { + return new Writable2(options); + } + this._writableState = new WritableState(options, this); + this.writable = true; + if (options) { + if (typeof options.write === "function") + this._write = options.write; + if (typeof options.writev === "function") + this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") + this._final = options.final; + } + Stream2.call(this); + } + Writable2.prototype.pipe = function() { + this.emit("error", new Error("Cannot pipe, not readable")); + }; + function writeAfterEnd(stream2, cb) { + var er = new Error("write after end"); + stream2.emit("error", er); + pna.nextTick(cb, er); + } + function validChunk(stream2, state, chunk2, cb) { + var valid = true; + var er = false; + if (chunk2 === null) { + er = new TypeError("May not write null values to stream"); + } else if (typeof chunk2 !== "string" && chunk2 !== void 0 && !state.objectMode) { + er = new TypeError("Invalid non-string/buffer chunk"); + } + if (er) { + stream2.emit("error", er); + pna.nextTick(cb, er); + valid = false; + } + return valid; + } + Writable2.prototype.write = function(chunk2, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk2); + if (isBuf && !Buffer4.isBuffer(chunk2)) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) + encoding = "buffer"; + else if (!encoding) + encoding = state.defaultEncoding; + if (typeof cb !== "function") + cb = nop; + if (state.ended) + writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk2, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk2, encoding, cb); + } + return ret; + }; + Writable2.prototype.cork = function() { + var state = this._writableState; + state.corked++; + }; + Writable2.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) + clearBuffer(this, state); + } + }; + Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) + throw new TypeError("Unknown encoding: " + encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + function decodeChunk(state, chunk2, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk2 === "string") { + chunk2 = Buffer4.from(chunk2, encoding); + } + return chunk2; + } + Object.defineProperty(Writable2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream2, state, isBuf, chunk2, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk2, encoding); + if (chunk2 !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk2 = newChunk; + } + } + var len = state.objectMode ? 1 : chunk2.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked) { + var last2 = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk2, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last2) { + last2.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream2, state, false, len, chunk2, encoding, cb); + } + return ret; + } + function doWrite(stream2, state, writev, len, chunk2, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) + stream2._writev(chunk2, state.onwrite); + else + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream2, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + pna.nextTick(cb, er); + pna.nextTick(finishMaybe, stream2, state); + stream2._writableState.errorEmitted = true; + stream2.emit("error", er); + } else { + cb(er); + stream2._writableState.errorEmitted = true; + stream2.emit("error", er); + finishMaybe(stream2, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream2, er) { + var state = stream2._writableState; + var sync = state.sync; + var cb = state.writecb; + onwriteStateUpdate(state); + if (er) + onwriteError(stream2, state, sync, er, cb); + else { + var finished2 = needFinish(state); + if (!finished2 && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream2, state); + } + if (sync) { + asyncWrite(afterWrite, stream2, state, finished2, cb); + } else { + afterWrite(stream2, state, finished2, cb); + } + } + } + function afterWrite(stream2, state, finished2, cb) { + if (!finished2) + onwriteDrain(stream2, state); + state.pendingcb--; + cb(); + finishMaybe(stream2, state); + } + function onwriteDrain(stream2, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream2.emit("drain"); + } + } + function clearBuffer(stream2, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream2._writev && entry && entry.next) { + var l7 = state.bufferedRequestCount; + var buffer2 = new Array(l7); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count2 = 0; + var allBuffers = true; + while (entry) { + buffer2[count2] = entry; + if (!entry.isBuf) + allBuffers = false; + entry = entry.next; + count2 += 1; + } + buffer2.allBuffers = allBuffers; + doWrite(stream2, state, true, state.length, buffer2, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk2 = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk2.length; + doWrite(stream2, state, false, len, chunk2, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable2.prototype._write = function(chunk2, encoding, cb) { + cb(new Error("_write() is not implemented")); + }; + Writable2.prototype._writev = null; + Writable2.prototype.end = function(chunk2, encoding, cb) { + var state = this._writableState; + if (typeof chunk2 === "function") { + cb = chunk2; + chunk2 = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk2 !== null && chunk2 !== void 0) + this.write(chunk2, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) + endWritable(this, state, cb); + }; + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream2, state) { + stream2._final(function(err) { + state.pendingcb--; + if (err) { + stream2.emit("error", err); + } + state.prefinished = true; + stream2.emit("prefinish"); + finishMaybe(stream2, state); + }); + } + function prefinish(stream2, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream2._final === "function") { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream2, state); + } else { + state.prefinished = true; + stream2.emit("prefinish"); + } + } + } + function finishMaybe(stream2, state) { + var need = needFinish(state); + if (need) { + prefinish(stream2, state); + if (state.pendingcb === 0) { + state.finished = true; + stream2.emit("finish"); + } + } + return need; + } + function endWritable(stream2, state, cb) { + state.ending = true; + finishMaybe(stream2, state); + if (cb) { + if (state.finished) + pna.nextTick(cb); + else + stream2.once("finish", cb); + } + state.ended = true; + stream2.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable2.prototype, "destroyed", { + get: function() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function(value2) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value2; + } + }); + Writable2.prototype.destroy = destroyImpl.destroy; + Writable2.prototype._undestroy = destroyImpl.undestroy; + Writable2.prototype._destroy = function(err, cb) { + this.end(); + cb(err); + }; + return exports$172; +} +function dew$152() { + if (_dewExec$152) + return exports$162; + _dewExec$152 = true; + var pna = dew$1d(); + var objectKeys = Object.keys || function(obj) { + var keys3 = []; + for (var key in obj) { + keys3.push(key); + } + return keys3; + }; + exports$162 = Duplex2; + var util2 = Object.create(dew$19()); + util2.inherits = dew4(); + var Readable3 = dew$142(); + var Writable2 = dew$162(); + util2.inherits(Duplex2, Readable3); + { + var keys2 = objectKeys(Writable2.prototype); + for (var v8 = 0; v8 < keys2.length; v8++) { + var method2 = keys2[v8]; + if (!Duplex2.prototype[method2]) + Duplex2.prototype[method2] = Writable2.prototype[method2]; + } + } + function Duplex2(options) { + if (!(this instanceof Duplex2)) + return new Duplex2(options); + Readable3.call(this, options); + Writable2.call(this, options); + if (options && options.readable === false) + this.readable = false; + if (options && options.writable === false) + this.writable = false; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + this.once("end", onend); + } + Object.defineProperty(Duplex2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function() { + return this._writableState.highWaterMark; + } + }); + function onend() { + if (this.allowHalfOpen || this._writableState.ended) + return; + pna.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex2.prototype, "destroyed", { + get: function() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function(value2) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value2; + this._writableState.destroyed = value2; + } + }); + Duplex2.prototype._destroy = function(err, cb) { + this.push(null); + this.end(); + pna.nextTick(cb, err); + }; + return exports$162; +} +function dew$142() { + if (_dewExec$142) + return exports$152; + _dewExec$142 = true; + var process$1 = process3; + var pna = dew$1d(); + exports$152 = Readable3; + var isArray3 = dew$1c(); + var Duplex2; + Readable3.ReadableState = ReadableState; + y.EventEmitter; + var EElistenerCount = function(emitter, type3) { + return emitter.listeners(type3).length; + }; + var Stream2 = dew$1b(); + var Buffer4 = dew$1a().Buffer; + var OurUint8Array = (typeof _global$f !== "undefined" ? _global$f : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var util2 = Object.create(dew$19()); + util2.inherits = dew4(); + var debugUtil = X2; + var debug2 = void 0; + if (debugUtil && debugUtil.debuglog) { + debug2 = debugUtil.debuglog("stream"); + } else { + debug2 = function() { + }; + } + var BufferList = dew$18(); + var destroyImpl = dew$17(); + var StringDecoder2; + util2.inherits(Readable3, Stream2); + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener3(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (isArray3(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream2) { + Duplex2 = Duplex2 || dew$152(); + options = options || {}; + var isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + if (hwm || hwm === 0) + this.highWaterMark = hwm; + else if (isDuplex && (readableHwm || readableHwm === 0)) + this.highWaterMark = readableHwm; + else + this.highWaterMark = defaultHwm; + this.highWaterMark = Math.floor(this.highWaterMark); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder2) + StringDecoder2 = exports11.StringDecoder; + this.decoder = new StringDecoder2(options.encoding); + this.encoding = options.encoding; + } + } + function Readable3(options) { + Duplex2 = Duplex2 || dew$152(); + if (!(this instanceof Readable3)) + return new Readable3(options); + this._readableState = new ReadableState(options, this); + this.readable = true; + if (options) { + if (typeof options.read === "function") + this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + } + Stream2.call(this); + } + Object.defineProperty(Readable3.prototype, "destroyed", { + get: function() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function(value2) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value2; + } + }); + Readable3.prototype.destroy = destroyImpl.destroy; + Readable3.prototype._undestroy = destroyImpl.undestroy; + Readable3.prototype._destroy = function(err, cb) { + this.push(null); + cb(err); + }; + Readable3.prototype.push = function(chunk2, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk2 === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk2, encoding, false, skipChunkCheck); + }; + Readable3.prototype.unshift = function(chunk2) { + return readableAddChunk(this, chunk2, null, true, false); + }; + function readableAddChunk(stream2, chunk2, encoding, addToFront, skipChunkCheck) { + var state = stream2._readableState; + if (chunk2 === null) { + state.reading = false; + onEofChunk(stream2, state); + } else { + var er; + if (!skipChunkCheck) + er = chunkInvalid(state, chunk2); + if (er) { + stream2.emit("error", er); + } else if (state.objectMode || chunk2 && chunk2.length > 0) { + if (typeof chunk2 !== "string" && !state.objectMode && Object.getPrototypeOf(chunk2) !== Buffer4.prototype) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (addToFront) { + if (state.endEmitted) + stream2.emit("error", new Error("stream.unshift() after end event")); + else + addChunk(stream2, state, chunk2, true); + } else if (state.ended) { + stream2.emit("error", new Error("stream.push() after EOF")); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk2 = state.decoder.write(chunk2); + if (state.objectMode || chunk2.length !== 0) + addChunk(stream2, state, chunk2, false); + else + maybeReadMore(stream2, state); + } else { + addChunk(stream2, state, chunk2, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + return needMoreData(state); + } + function addChunk(stream2, state, chunk2, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream2.emit("data", chunk2); + stream2.read(0); + } else { + state.length += state.objectMode ? 1 : chunk2.length; + if (addToFront) + state.buffer.unshift(chunk2); + else + state.buffer.push(chunk2); + if (state.needReadable) + emitReadable(stream2); + } + maybeReadMore(stream2, state); + } + function chunkInvalid(state, chunk2) { + var er; + if (!_isUint8Array(chunk2) && typeof chunk2 !== "string" && chunk2 !== void 0 && !state.objectMode) { + er = new TypeError("Invalid non-string/buffer chunk"); + } + return er; + } + function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); + } + Readable3.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable3.prototype.setEncoding = function(enc) { + if (!StringDecoder2) + StringDecoder2 = exports11.StringDecoder; + this._readableState.decoder = new StringDecoder2(enc); + this._readableState.encoding = enc; + return this; + }; + var MAX_HWM = 8388608; + function computeNewHighWaterMark(n7) { + if (n7 >= MAX_HWM) { + n7 = MAX_HWM; + } else { + n7--; + n7 |= n7 >>> 1; + n7 |= n7 >>> 2; + n7 |= n7 >>> 4; + n7 |= n7 >>> 8; + n7 |= n7 >>> 16; + n7++; + } + return n7; + } + function howMuchToRead(n7, state) { + if (n7 <= 0 || state.length === 0 && state.ended) + return 0; + if (state.objectMode) + return 1; + if (n7 !== n7) { + if (state.flowing && state.length) + return state.buffer.head.data.length; + else + return state.length; + } + if (n7 > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n7); + if (n7 <= state.length) + return n7; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable3.prototype.read = function(n7) { + debug2("read", n7); + n7 = parseInt(n7, 10); + var state = this._readableState; + var nOrig = n7; + if (n7 !== 0) + state.emittedReadable = false; + if (n7 === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug2("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + n7 = howMuchToRead(n7, state); + if (n7 === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + var doRead = state.needReadable; + debug2("need readable", doRead); + if (state.length === 0 || state.length - n7 < state.highWaterMark) { + doRead = true; + debug2("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug2("reading or ended", doRead); + } else if (doRead) { + debug2("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) + state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) + n7 = howMuchToRead(nOrig, state); + } + var ret; + if (n7 > 0) + ret = fromList(n7, state); + else + ret = null; + if (ret === null) { + state.needReadable = true; + n7 = 0; + } else { + state.length -= n7; + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n7 && state.ended) + endReadable(this); + } + if (ret !== null) + this.emit("data", ret); + return ret; + }; + function onEofChunk(stream2, state) { + if (state.ended) + return; + if (state.decoder) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) { + state.buffer.push(chunk2); + state.length += state.objectMode ? 1 : chunk2.length; + } + } + state.ended = true; + emitReadable(stream2); + } + function emitReadable(stream2) { + var state = stream2._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug2("emitReadable", state.flowing); + state.emittedReadable = true; + if (state.sync) + pna.nextTick(emitReadable_, stream2); + else + emitReadable_(stream2); + } + } + function emitReadable_(stream2) { + debug2("emit readable"); + stream2.emit("readable"); + flow2(stream2); + } + function maybeReadMore(stream2, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream2, state); + } + } + function maybeReadMore_(stream2, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug2("maybeReadMore read 0"); + stream2.read(0); + if (len === state.length) + break; + else + len = state.length; + } + state.readingMore = false; + } + Readable3.prototype._read = function(n7) { + this.emit("error", new Error("_read() is not implemented")); + }; + Readable3.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug2("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + pna.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug2("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug2("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug2("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + var increasedAwaitDrain = false; + src.on("data", ondata); + function ondata(chunk2) { + debug2("ondata"); + increasedAwaitDrain = false; + var ret = dest.write(chunk2); + if (false === ret && !increasedAwaitDrain) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf4(state.pipes, dest) !== -1) && !cleanedUp) { + debug2("false write response, pause", state.awaitDrain); + state.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + function onerror(er) { + debug2("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) + dest.emit("error", er); + } + prependListener3(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug2("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug2("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug2("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function() { + var state = src._readableState; + debug2("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow2(src); + } + }; + } + Readable3.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) + return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) + return this; + if (!dest) + dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i7 = 0; i7 < len; i7++) { + dests[i7].emit("unpipe", this, { + hasUnpiped: false + }); + } + return this; + } + var index4 = indexOf4(state.pipes, dest); + if (index4 === -1) + return this; + state.pipes.splice(index4, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable3.prototype.on = function(ev, fn) { + var res = Stream2.prototype.on.call(this, ev, fn); + if (ev === "data") { + if (this._readableState.flowing !== false) + this.resume(); + } else if (ev === "readable") { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + return res; + }; + Readable3.prototype.addListener = Readable3.prototype.on; + function nReadingNextTick(self2) { + debug2("readable nexttick read 0"); + self2.read(0); + } + Readable3.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug2("resume"); + state.flowing = true; + resume(this, state); + } + return this; + }; + function resume(stream2, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream2, state); + } + } + function resume_(stream2, state) { + if (!state.reading) { + debug2("resume read 0"); + stream2.read(0); + } + state.resumeScheduled = false; + state.awaitDrain = 0; + stream2.emit("resume"); + flow2(stream2); + if (state.flowing && !state.reading) + stream2.read(0); + } + Readable3.prototype.pause = function() { + debug2("call pause flowing=%j", this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug2("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + return this; + }; + function flow2(stream2) { + var state = stream2._readableState; + debug2("flow", state.flowing); + while (state.flowing && stream2.read() !== null) { + } + } + Readable3.prototype.wrap = function(stream2) { + var _this = this; + var state = this._readableState; + var paused = false; + stream2.on("end", function() { + debug2("wrapped end"); + if (state.decoder && !state.ended) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) + _this.push(chunk2); + } + _this.push(null); + }); + stream2.on("data", function(chunk2) { + debug2("wrapped data"); + if (state.decoder) + chunk2 = state.decoder.write(chunk2); + if (state.objectMode && (chunk2 === null || chunk2 === void 0)) + return; + else if (!state.objectMode && (!chunk2 || !chunk2.length)) + return; + var ret = _this.push(chunk2); + if (!ret) { + paused = true; + stream2.pause(); + } + }); + for (var i7 in stream2) { + if (this[i7] === void 0 && typeof stream2[i7] === "function") { + this[i7] = /* @__PURE__ */ function(method2) { + return function() { + return stream2[method2].apply(stream2, arguments); + }; + }(i7); + } + } + for (var n7 = 0; n7 < kProxyEvents.length; n7++) { + stream2.on(kProxyEvents[n7], this.emit.bind(this, kProxyEvents[n7])); + } + this._read = function(n8) { + debug2("wrapped _read", n8); + if (paused) { + paused = false; + stream2.resume(); + } + }; + return this; + }; + Object.defineProperty(Readable3.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function() { + return this._readableState.highWaterMark; + } + }); + Readable3._fromList = fromList; + function fromList(n7, state) { + if (state.length === 0) + return null; + var ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n7 || n7 >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.head.data; + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = fromListPartial(n7, state.buffer, state.decoder); + } + return ret; + } + function fromListPartial(n7, list, hasStrings) { + var ret; + if (n7 < list.head.data.length) { + ret = list.head.data.slice(0, n7); + list.head.data = list.head.data.slice(n7); + } else if (n7 === list.head.data.length) { + ret = list.shift(); + } else { + ret = hasStrings ? copyFromBufferString(n7, list) : copyFromBuffer(n7, list); + } + return ret; + } + function copyFromBufferString(n7, list) { + var p7 = list.head; + var c7 = 1; + var ret = p7.data; + n7 -= ret.length; + while (p7 = p7.next) { + var str2 = p7.data; + var nb = n7 > str2.length ? str2.length : n7; + if (nb === str2.length) + ret += str2; + else + ret += str2.slice(0, n7); + n7 -= nb; + if (n7 === 0) { + if (nb === str2.length) { + ++c7; + if (p7.next) + list.head = p7.next; + else + list.head = list.tail = null; + } else { + list.head = p7; + p7.data = str2.slice(nb); + } + break; + } + ++c7; + } + list.length -= c7; + return ret; + } + function copyFromBuffer(n7, list) { + var ret = Buffer4.allocUnsafe(n7); + var p7 = list.head; + var c7 = 1; + p7.data.copy(ret); + n7 -= p7.data.length; + while (p7 = p7.next) { + var buf = p7.data; + var nb = n7 > buf.length ? buf.length : n7; + buf.copy(ret, ret.length - n7, 0, nb); + n7 -= nb; + if (n7 === 0) { + if (nb === buf.length) { + ++c7; + if (p7.next) + list.head = p7.next; + else + list.head = list.tail = null; + } else { + list.head = p7; + p7.data = buf.slice(nb); + } + break; + } + ++c7; + } + list.length -= c7; + return ret; + } + function endReadable(stream2) { + var state = stream2._readableState; + if (state.length > 0) + throw new Error('"endReadable()" called on non-empty stream'); + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream2); + } + } + function endReadableNT(state, stream2) { + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream2.readable = false; + stream2.emit("end"); + } + } + function indexOf4(xs, x7) { + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) + return i7; + } + return -1; + } + return exports$152; +} +function dew$132() { + if (_dewExec$132) + return exports$142; + _dewExec$132 = true; + exports$142 = Transform2; + var Duplex2 = dew$152(); + var util2 = Object.create(dew$19()); + util2.inherits = dew4(); + util2.inherits(Transform2, Duplex2); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (!cb) { + return this.emit("error", new Error("write callback called multiple times")); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform2(options) { + if (!(this instanceof Transform2)) + return new Transform2(options); + Duplex2.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function") { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform2.prototype.push = function(chunk2, encoding) { + this._transformState.needTransform = false; + return Duplex2.prototype.push.call(this, chunk2, encoding); + }; + Transform2.prototype._transform = function(chunk2, encoding, cb) { + throw new Error("_transform() is not implemented"); + }; + Transform2.prototype._write = function(chunk2, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk2; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } + }; + Transform2.prototype._read = function(n7) { + var ts = this._transformState; + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform2.prototype._destroy = function(err, cb) { + var _this2 = this; + Duplex2.prototype._destroy.call(this, err, function(err2) { + cb(err2); + _this2.emit("close"); + }); + }; + function done(stream2, er, data) { + if (er) + return stream2.emit("error", er); + if (data != null) + stream2.push(data); + if (stream2._writableState.length) + throw new Error("Calling transform done when ws.length != 0"); + if (stream2._transformState.transforming) + throw new Error("Calling transform done when still transforming"); + return stream2.push(null); + } + return exports$142; +} +function dew$122() { + if (_dewExec$122) + return exports$132; + _dewExec$122 = true; + exports$132 = PassThrough2; + var Transform2 = dew$132(); + var util2 = Object.create(dew$19()); + util2.inherits = dew4(); + util2.inherits(PassThrough2, Transform2); + function PassThrough2(options) { + if (!(this instanceof PassThrough2)) + return new PassThrough2(options); + Transform2.call(this, options); + } + PassThrough2.prototype._transform = function(chunk2, encoding, cb) { + cb(null, chunk2); + }; + return exports$132; +} +function dew$11() { + if (_dewExec$11) + return exports$122; + _dewExec$11 = true; + exports$122 = exports$122 = dew$142(); + exports$122.Stream = exports$122; + exports$122.Readable = exports$122; + exports$122.Writable = dew$162(); + exports$122.Duplex = dew$152(); + exports$122.Transform = dew$132(); + exports$122.PassThrough = dew$122(); + return exports$122; +} +function dew$10() { + if (_dewExec$10) + return module$4.exports; + _dewExec$10 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$e).negative = 0; + (this || _global$e).words = null; + (this || _global$e).length = 0; + (this || _global$e).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$e).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$e).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$e).words = [number & 67108863]; + (this || _global$e).length = 1; + } else if (number < 4503599627370496) { + (this || _global$e).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$e).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$e).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$e).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$e).words = [0]; + (this || _global$e).length = 1; + return this || _global$e; + } + (this || _global$e).length = Math.ceil(number.length / 3); + (this || _global$e).words = new Array((this || _global$e).length); + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + (this || _global$e).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$e).words[j6] |= w6 << off3 & 67108863; + (this || _global$e).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$e).words[j6] |= w6 << off3 & 67108863; + (this || _global$e).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this._strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 48 && c7 <= 57) { + return c7 - 48; + } else if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + assert4(false, "Invalid character in " + string2); + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$e).length = Math.ceil((number.length - start) / 6); + (this || _global$e).words = new Array((this || _global$e).length); + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + (this || _global$e).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$e).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$e).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$e).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$e).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this._strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var b8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + b8 = c7 - 49 + 10; + } else if (c7 >= 17) { + b8 = c7 - 17 + 10; + } else { + b8 = c7; + } + assert4(c7 >= 0 && b8 < mul, "Invalid character"); + r8 += b8; + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$e).words = [0]; + (this || _global$e).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$e).words[0] + word < 67108864) { + (this || _global$e).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$e).words[0] + word < 67108864) { + (this || _global$e).words[0] += word; + } else { + this._iaddn(word); + } + } + this._strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$e).length); + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + dest.words[i7] = (this || _global$e).words[i7]; + } + dest.length = (this || _global$e).length; + dest.negative = (this || _global$e).negative; + dest.red = (this || _global$e).red; + }; + function move(dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + BN.prototype._move = function _move(dest) { + move(dest, this || _global$e); + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$e).length < size2) { + (this || _global$e).words[(this || _global$e).length++] = 0; + } + return this || _global$e; + }; + BN.prototype._strip = function strip() { + while ((this || _global$e).length > 1 && (this || _global$e).words[(this || _global$e).length - 1] === 0) { + (this || _global$e).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$e).length === 1 && (this || _global$e).words[0] === 0) { + (this || _global$e).negative = 0; + } + return this || _global$e; + }; + if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { + try { + BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect2; + } catch (e10) { + BN.prototype.inspect = inspect2; + } + } else { + BN.prototype.inspect = inspect2; + } + function inspect2() { + return ((this || _global$e).red ? ""; + } + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + var w6 = (this || _global$e).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + if (carry !== 0 || i7 !== (this || _global$e).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$e).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modrn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$e).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$e).words[0]; + if ((this || _global$e).length === 2) { + ret += (this || _global$e).words[1] * 67108864; + } else if ((this || _global$e).length === 3 && (this || _global$e).words[2] === 1) { + ret += 4503599627370496 + (this || _global$e).words[1] * 67108864; + } else if ((this || _global$e).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$e).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16, 2); + }; + if (Buffer4) { + BN.prototype.toBuffer = function toBuffer(endian, length) { + return this.toArrayLike(Buffer4, endian, length); + }; + } + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + var allocate = function allocate2(ArrayType, size2) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size2); + } + return new ArrayType(size2); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + this._strip(); + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + var res = allocate(ArrayType, reqLength); + var postfix = endian === "le" ? "LE" : "BE"; + this["_toArrayLike" + postfix](res, byteLength); + return res; + }; + BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { + var position = 0; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$e).length; i7++) { + var word = (this || _global$e).words[i7] << shift | carry; + res[position++] = word & 255; + if (position < res.length) { + res[position++] = word >> 8 & 255; + } + if (position < res.length) { + res[position++] = word >> 16 & 255; + } + if (shift === 6) { + if (position < res.length) { + res[position++] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position < res.length) { + res[position++] = carry; + while (position < res.length) { + res[position++] = 0; + } + } + }; + BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { + var position = res.length - 1; + var carry = 0; + for (var i7 = 0, shift = 0; i7 < (this || _global$e).length; i7++) { + var word = (this || _global$e).words[i7] << shift | carry; + res[position--] = word & 255; + if (position >= 0) { + res[position--] = word >> 8 & 255; + } + if (position >= 0) { + res[position--] = word >> 16 & 255; + } + if (shift === 6) { + if (position >= 0) { + res[position--] = word >> 24 & 255; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + if (position >= 0) { + res[position--] = carry; + while (position >= 0) { + res[position--] = 0; + } + } + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$e).words[(this || _global$e).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$e).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = num.words[off3] >>> wbit & 1; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + var b8 = this._zeroBits((this || _global$e).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$e).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$e).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$e).negative ^= 1; + } + return this || _global$e; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$e).length < num.length) { + (this || _global$e).words[(this || _global$e).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$e).words[i7] = (this || _global$e).words[i7] | num.words[i7]; + } + return this._strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$e).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$e).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$e); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$e).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$e); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$e).length > num.length) { + b8 = num; + } else { + b8 = this || _global$e; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$e).words[i7] = (this || _global$e).words[i7] & num.words[i7]; + } + (this || _global$e).length = b8.length; + return this._strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$e).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$e).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$e); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$e).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$e); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$e).length > num.length) { + a7 = this || _global$e; + b8 = num; + } else { + a7 = num; + b8 = this || _global$e; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$e).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$e) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$e).words[i7] = a7.words[i7]; + } + } + (this || _global$e).length = a7.length; + return this._strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$e).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$e).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$e); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$e).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$e); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$e).words[i7] = ~(this || _global$e).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$e).words[i7] = ~(this || _global$e).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this._strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$e).words[off3] = (this || _global$e).words[off3] | 1 << wbit; + } else { + (this || _global$e).words[off3] = (this || _global$e).words[off3] & ~(1 << wbit); + } + return this._strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$e).negative !== 0 && num.negative === 0) { + (this || _global$e).negative = 0; + r8 = this.isub(num); + (this || _global$e).negative ^= 1; + return this._normSign(); + } else if ((this || _global$e).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$e).length > num.length) { + a7 = this || _global$e; + b8 = num; + } else { + a7 = num; + b8 = this || _global$e; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$e).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$e).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$e).length = a7.length; + if (carry !== 0) { + (this || _global$e).words[(this || _global$e).length] = carry; + (this || _global$e).length++; + } else if (a7 !== (this || _global$e)) { + for (; i7 < a7.length; i7++) { + (this || _global$e).words[i7] = a7.words[i7]; + } + } + return this || _global$e; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$e).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$e).negative !== 0) { + (this || _global$e).negative = 0; + res = num.sub(this || _global$e); + (this || _global$e).negative = 1; + return res; + } + if ((this || _global$e).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$e); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$e).negative !== 0) { + (this || _global$e).negative = 0; + this.iadd(num); + (this || _global$e).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$e).negative = 0; + (this || _global$e).length = 1; + (this || _global$e).words[0] = 0; + return this || _global$e; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$e; + b8 = num; + } else { + a7 = num; + b8 = this || _global$e; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$e).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$e).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$e)) { + for (; i7 < a7.length; i7++) { + (this || _global$e).words[i7] = a7.words[i7]; + } + } + (this || _global$e).length = Math.max((this || _global$e).length, i7); + if (a7 !== (this || _global$e)) { + (this || _global$e).negative = 1; + } + return this._strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out._strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out._strip(); + } + function jumboMulTo(self2, num, out) { + return bigMulTo(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$e).length + num.length; + if ((this || _global$e).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$e, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$e, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$e, num, out); + } else { + res = jumboMulTo(this || _global$e, num, out); + } + return res; + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$e).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$e).length + num.length); + return jumboMulTo(this || _global$e, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$e); + }; + BN.prototype.imuln = function imuln(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$e).length; i7++) { + var w6 = ((this || _global$e).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$e).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$e).words[i7] = carry; + (this || _global$e).length++; + } + return isNegNum ? this.ineg() : this || _global$e; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$e); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$e; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$e).length; i7++) { + var newCarry = (this || _global$e).words[i7] & carryMask; + var c7 = ((this || _global$e).words[i7] | 0) - newCarry << r8; + (this || _global$e).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$e).words[i7] = carry; + (this || _global$e).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$e).length - 1; i7 >= 0; i7--) { + (this || _global$e).words[i7 + s7] = (this || _global$e).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$e).words[i7] = 0; + } + (this || _global$e).length += s7; + } + return this._strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$e).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$e).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$e).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$e).length > s7) { + (this || _global$e).length -= s7; + for (i7 = 0; i7 < (this || _global$e).length; i7++) { + (this || _global$e).words[i7] = (this || _global$e).words[i7 + s7]; + } + } else { + (this || _global$e).words[0] = 0; + (this || _global$e).length = 1; + } + var carry = 0; + for (i7 = (this || _global$e).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$e).words[i7] | 0; + (this || _global$e).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$e).length === 0) { + (this || _global$e).words[0] = 0; + (this || _global$e).length = 1; + } + return this._strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$e).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$e).length <= s7) + return false; + var w6 = (this || _global$e).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$e).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$e).length <= s7) { + return this || _global$e; + } + if (r8 !== 0) { + s7++; + } + (this || _global$e).length = Math.min(s7, (this || _global$e).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$e).words[(this || _global$e).length - 1] &= mask; + } + return this._strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$e).negative !== 0) { + if ((this || _global$e).length === 1 && ((this || _global$e).words[0] | 0) <= num) { + (this || _global$e).words[0] = num - ((this || _global$e).words[0] | 0); + (this || _global$e).negative = 0; + return this || _global$e; + } + (this || _global$e).negative = 0; + this.isubn(num); + (this || _global$e).negative = 1; + return this || _global$e; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$e).words[0] += num; + for (var i7 = 0; i7 < (this || _global$e).length && (this || _global$e).words[i7] >= 67108864; i7++) { + (this || _global$e).words[i7] -= 67108864; + if (i7 === (this || _global$e).length - 1) { + (this || _global$e).words[i7 + 1] = 1; + } else { + (this || _global$e).words[i7 + 1]++; + } + } + (this || _global$e).length = Math.max((this || _global$e).length, i7 + 1); + return this || _global$e; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$e).negative !== 0) { + (this || _global$e).negative = 0; + this.iaddn(num); + (this || _global$e).negative = 1; + return this || _global$e; + } + (this || _global$e).words[0] -= num; + if ((this || _global$e).length === 1 && (this || _global$e).words[0] < 0) { + (this || _global$e).words[0] = -(this || _global$e).words[0]; + (this || _global$e).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$e).length && (this || _global$e).words[i7] < 0; i7++) { + (this || _global$e).words[i7] += 67108864; + (this || _global$e).words[i7 + 1] -= 1; + } + } + return this._strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$e).negative = 0; + return this || _global$e; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$e).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$e).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$e).length - shift; i7++) { + w6 = ((this || _global$e).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$e).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this._strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$e).length; i7++) { + w6 = -((this || _global$e).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$e).words[i7] = w6 & 67108863; + } + (this || _global$e).negative = 1; + return this._strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$e).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5._strip(); + } + a7._strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$e).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$e).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$e).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$e).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$e + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modrn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modrn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modrn = function modrn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$e).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$e).words[i7] | 0)) % num; + } + return isNegNum ? -acc : acc; + }; + BN.prototype.modn = function modn(num) { + return this.modrn(num); + }; + BN.prototype.idivn = function idivn(num) { + var isNegNum = num < 0; + if (isNegNum) + num = -num; + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$e).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$e).words[i7] | 0) + carry * 67108864; + (this || _global$e).words[i7] = w6 / num | 0; + carry = w6 % num; + } + this._strip(); + return isNegNum ? this.ineg() : this || _global$e; + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$e; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$e; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$e).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$e).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$e).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$e).length <= s7) { + this._expand(s7 + 1); + (this || _global$e).words[s7] |= q5; + return this || _global$e; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$e).length; i7++) { + var w6 = (this || _global$e).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$e).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$e).words[i7] = carry; + (this || _global$e).length++; + } + return this || _global$e; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$e).length === 1 && (this || _global$e).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$e).negative !== 0 && !negative) + return -1; + if ((this || _global$e).negative === 0 && negative) + return 1; + this._strip(); + var res; + if ((this || _global$e).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$e).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$e).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$e).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$e).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$e).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$e).length > num.length) + return 1; + if ((this || _global$e).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$e).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$e).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$e).red, "Already a number in reduction context"); + assert4((this || _global$e).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$e)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$e).red, "fromRed works only with numbers in reduction context"); + return (this || _global$e).red.convertFrom(this || _global$e); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$e).red = ctx; + return this || _global$e; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$e).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$e).red, "redAdd works only with red numbers"); + return (this || _global$e).red.add(this || _global$e, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$e).red, "redIAdd works only with red numbers"); + return (this || _global$e).red.iadd(this || _global$e, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$e).red, "redSub works only with red numbers"); + return (this || _global$e).red.sub(this || _global$e, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$e).red, "redISub works only with red numbers"); + return (this || _global$e).red.isub(this || _global$e, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$e).red, "redShl works only with red numbers"); + return (this || _global$e).red.shl(this || _global$e, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$e).red, "redMul works only with red numbers"); + (this || _global$e).red._verify2(this || _global$e, num); + return (this || _global$e).red.mul(this || _global$e, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$e).red, "redMul works only with red numbers"); + (this || _global$e).red._verify2(this || _global$e, num); + return (this || _global$e).red.imul(this || _global$e, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$e).red, "redSqr works only with red numbers"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.sqr(this || _global$e); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$e).red, "redISqr works only with red numbers"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.isqr(this || _global$e); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$e).red, "redSqrt works only with red numbers"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.sqrt(this || _global$e); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$e).red, "redInvm works only with red numbers"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.invm(this || _global$e); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$e).red, "redNeg works only with red numbers"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.neg(this || _global$e); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$e).red && !num.red, "redPow(normalNum)"); + (this || _global$e).red._verify1(this || _global$e); + return (this || _global$e).red.pow(this || _global$e, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$e).name = name2; + (this || _global$e).p = new BN(p7, 16); + (this || _global$e).n = (this || _global$e).p.bitLength(); + (this || _global$e).k = new BN(1).iushln((this || _global$e).n).isub((this || _global$e).p); + (this || _global$e).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$e).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$e).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$e).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$e).n); + var cmp = rlen < (this || _global$e).n ? -1 : r8.ucmp((this || _global$e).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$e).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$e).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$e).k); + }; + function K256() { + MPrime.call(this || _global$e, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$e, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$e, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$e, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$e).m = prime.p; + (this || _global$e).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$e).m = m7; + (this || _global$e).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$e).prime) + return (this || _global$e).prime.ireduce(a7)._forceRed(this || _global$e); + move(a7, a7.umod((this || _global$e).m)._forceRed(this || _global$e)); + return a7; + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$e).m.sub(a7)._forceRed(this || _global$e); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$e).m) >= 0) { + res.isub((this || _global$e).m); + } + return res._forceRed(this || _global$e); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$e).m) >= 0) { + res.isub((this || _global$e).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$e).m); + } + return res._forceRed(this || _global$e); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$e).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$e).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$e).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$e).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$e); + var nOne = one.redNeg(); + var lpow = (this || _global$e).m.subn(1).iushrn(1); + var z6 = (this || _global$e).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$e); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$e).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$e); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$e); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$e).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$e, m7); + (this || _global$e).shift = (this || _global$e).m.bitLength(); + if ((this || _global$e).shift % 26 !== 0) { + (this || _global$e).shift += 26 - (this || _global$e).shift % 26; + } + (this || _global$e).r = new BN(1).iushln((this || _global$e).shift); + (this || _global$e).r2 = this.imod((this || _global$e).r.sqr()); + (this || _global$e).rinv = (this || _global$e).r._invmp((this || _global$e).m); + (this || _global$e).minv = (this || _global$e).rinv.mul((this || _global$e).r).isubn(1).div((this || _global$e).m); + (this || _global$e).minv = (this || _global$e).minv.umod((this || _global$e).r); + (this || _global$e).minv = (this || _global$e).r.sub((this || _global$e).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$e).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$e).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$e).shift).mul((this || _global$e).minv).imaskn((this || _global$e).shift).mul((this || _global$e).m); + var u7 = t8.isub(c7).iushrn((this || _global$e).shift); + var res = u7; + if (u7.cmp((this || _global$e).m) >= 0) { + res = u7.isub((this || _global$e).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$e).m); + } + return res._forceRed(this || _global$e); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$e); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$e).shift).mul((this || _global$e).minv).imaskn((this || _global$e).shift).mul((this || _global$e).m); + var u7 = t8.isub(c7).iushrn((this || _global$e).shift); + var res = u7; + if (u7.cmp((this || _global$e).m) >= 0) { + res = u7.isub((this || _global$e).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$e).m); + } + return res._forceRed(this || _global$e); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$e).m).mul((this || _global$e).r2)); + return res._forceRed(this || _global$e); + }; + })(module$4, exports$11); + return module$4.exports; +} +function dew$$() { + if (_dewExec$$) + return exports$10; + _dewExec$$ = true; + var BN = dew$10(); + var randomBytes2 = dew$3G(); + var Buffer4 = dew$15().Buffer; + function getr(priv) { + var len = priv.modulus.byteLength(); + var r8; + do { + r8 = new BN(randomBytes2(len)); + } while (r8.cmp(priv.modulus) >= 0 || !r8.umod(priv.prime1) || !r8.umod(priv.prime2)); + return r8; + } + function blind(priv) { + var r8 = getr(priv); + var blinder = r8.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed(); + return { + blinder, + unblinder: r8.invm(priv.modulus) + }; + } + function crt(msg, priv) { + var blinds = blind(priv); + var len = priv.modulus.byteLength(); + var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus); + var c1 = blinded.toRed(BN.mont(priv.prime1)); + var c22 = blinded.toRed(BN.mont(priv.prime2)); + var qinv = priv.coefficient; + var p7 = priv.prime1; + var q5 = priv.prime2; + var m1 = c1.redPow(priv.exponent1).fromRed(); + var m22 = c22.redPow(priv.exponent2).fromRed(); + var h8 = m1.isub(m22).imul(qinv).umod(p7).imul(q5); + return m22.iadd(h8).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer4, "be", len); + } + crt.getr = getr; + exports$10 = crt; + return exports$10; +} +function dew$_() { + if (_dewExec$_) + return module$3.exports; + _dewExec$_ = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$d).negative = 0; + (this || _global$d).words = null; + (this || _global$d).length = 0; + (this || _global$d).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$d).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$d).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$d).words = [number & 67108863]; + (this || _global$d).length = 1; + } else if (number < 4503599627370496) { + (this || _global$d).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$d).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$d).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$d).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$d).words = [0]; + (this || _global$d).length = 1; + return this || _global$d; + } + (this || _global$d).length = Math.ceil(number.length / 3); + (this || _global$d).words = new Array((this || _global$d).length); + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + (this || _global$d).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$d).words[j6] |= w6 << off3 & 67108863; + (this || _global$d).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$d).words[j6] |= w6 << off3 & 67108863; + (this || _global$d).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$d).length = Math.ceil((number.length - start) / 6); + (this || _global$d).words = new Array((this || _global$d).length); + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + (this || _global$d).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$d).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$d).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$d).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$d).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$d).words = [0]; + (this || _global$d).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$d).words[0] + word < 67108864) { + (this || _global$d).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$d).words[0] + word < 67108864) { + (this || _global$d).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$d).length); + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + dest.words[i7] = (this || _global$d).words[i7]; + } + dest.length = (this || _global$d).length; + dest.negative = (this || _global$d).negative; + dest.red = (this || _global$d).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$d).length < size2) { + (this || _global$d).words[(this || _global$d).length++] = 0; + } + return this || _global$d; + }; + BN.prototype.strip = function strip() { + while ((this || _global$d).length > 1 && (this || _global$d).words[(this || _global$d).length - 1] === 0) { + (this || _global$d).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$d).length === 1 && (this || _global$d).words[0] === 0) { + (this || _global$d).negative = 0; + } + return this || _global$d; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$d).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + var w6 = (this || _global$d).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$d).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$d).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$d).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$d).words[0]; + if ((this || _global$d).length === 2) { + ret += (this || _global$d).words[1] * 67108864; + } else if ((this || _global$d).length === 3 && (this || _global$d).words[2] === 1) { + ret += 4503599627370496 + (this || _global$d).words[1] * 67108864; + } else if ((this || _global$d).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$d).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$d).words[(this || _global$d).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$d).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + var b8 = this._zeroBits((this || _global$d).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$d).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$d).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$d).negative ^= 1; + } + return this || _global$d; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$d).length < num.length) { + (this || _global$d).words[(this || _global$d).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$d).words[i7] = (this || _global$d).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$d).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$d).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$d); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$d).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$d); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$d).length > num.length) { + b8 = num; + } else { + b8 = this || _global$d; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$d).words[i7] = (this || _global$d).words[i7] & num.words[i7]; + } + (this || _global$d).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$d).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$d).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$d); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$d).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$d); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$d).length > num.length) { + a7 = this || _global$d; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$d).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$d) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$d).words[i7] = a7.words[i7]; + } + } + (this || _global$d).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$d).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$d).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$d); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$d).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$d); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$d).words[i7] = ~(this || _global$d).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$d).words[i7] = ~(this || _global$d).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$d).words[off3] = (this || _global$d).words[off3] | 1 << wbit; + } else { + (this || _global$d).words[off3] = (this || _global$d).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$d).negative !== 0 && num.negative === 0) { + (this || _global$d).negative = 0; + r8 = this.isub(num); + (this || _global$d).negative ^= 1; + return this._normSign(); + } else if ((this || _global$d).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$d).length > num.length) { + a7 = this || _global$d; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$d).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$d).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$d).length = a7.length; + if (carry !== 0) { + (this || _global$d).words[(this || _global$d).length] = carry; + (this || _global$d).length++; + } else if (a7 !== (this || _global$d)) { + for (; i7 < a7.length; i7++) { + (this || _global$d).words[i7] = a7.words[i7]; + } + } + return this || _global$d; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$d).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$d).negative !== 0) { + (this || _global$d).negative = 0; + res = num.sub(this || _global$d); + (this || _global$d).negative = 1; + return res; + } + if ((this || _global$d).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$d); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$d).negative !== 0) { + (this || _global$d).negative = 0; + this.iadd(num); + (this || _global$d).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$d).negative = 0; + (this || _global$d).length = 1; + (this || _global$d).words[0] = 0; + return this || _global$d; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$d; + b8 = num; + } else { + a7 = num; + b8 = this || _global$d; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$d).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$d).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$d)) { + for (; i7 < a7.length; i7++) { + (this || _global$d).words[i7] = a7.words[i7]; + } + } + (this || _global$d).length = Math.max((this || _global$d).length, i7); + if (a7 !== (this || _global$d)) { + (this || _global$d).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$d).length + num.length; + if ((this || _global$d).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$d, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$d, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$d, num, out); + } else { + res = jumboMulTo(this || _global$d, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$d).x = x7; + (this || _global$d).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$d).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$d).length + num.length); + return jumboMulTo(this || _global$d, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$d); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$d).length; i7++) { + var w6 = ((this || _global$d).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$d).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$d).words[i7] = carry; + (this || _global$d).length++; + } + return this || _global$d; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$d); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$d; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$d).length; i7++) { + var newCarry = (this || _global$d).words[i7] & carryMask; + var c7 = ((this || _global$d).words[i7] | 0) - newCarry << r8; + (this || _global$d).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$d).words[i7] = carry; + (this || _global$d).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$d).length - 1; i7 >= 0; i7--) { + (this || _global$d).words[i7 + s7] = (this || _global$d).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$d).words[i7] = 0; + } + (this || _global$d).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$d).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$d).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$d).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$d).length > s7) { + (this || _global$d).length -= s7; + for (i7 = 0; i7 < (this || _global$d).length; i7++) { + (this || _global$d).words[i7] = (this || _global$d).words[i7 + s7]; + } + } else { + (this || _global$d).words[0] = 0; + (this || _global$d).length = 1; + } + var carry = 0; + for (i7 = (this || _global$d).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$d).words[i7] | 0; + (this || _global$d).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$d).length === 0) { + (this || _global$d).words[0] = 0; + (this || _global$d).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$d).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$d).length <= s7) + return false; + var w6 = (this || _global$d).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$d).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$d).length <= s7) { + return this || _global$d; + } + if (r8 !== 0) { + s7++; + } + (this || _global$d).length = Math.min(s7, (this || _global$d).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$d).words[(this || _global$d).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$d).negative !== 0) { + if ((this || _global$d).length === 1 && ((this || _global$d).words[0] | 0) < num) { + (this || _global$d).words[0] = num - ((this || _global$d).words[0] | 0); + (this || _global$d).negative = 0; + return this || _global$d; + } + (this || _global$d).negative = 0; + this.isubn(num); + (this || _global$d).negative = 1; + return this || _global$d; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$d).words[0] += num; + for (var i7 = 0; i7 < (this || _global$d).length && (this || _global$d).words[i7] >= 67108864; i7++) { + (this || _global$d).words[i7] -= 67108864; + if (i7 === (this || _global$d).length - 1) { + (this || _global$d).words[i7 + 1] = 1; + } else { + (this || _global$d).words[i7 + 1]++; + } + } + (this || _global$d).length = Math.max((this || _global$d).length, i7 + 1); + return this || _global$d; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$d).negative !== 0) { + (this || _global$d).negative = 0; + this.iaddn(num); + (this || _global$d).negative = 1; + return this || _global$d; + } + (this || _global$d).words[0] -= num; + if ((this || _global$d).length === 1 && (this || _global$d).words[0] < 0) { + (this || _global$d).words[0] = -(this || _global$d).words[0]; + (this || _global$d).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$d).length && (this || _global$d).words[i7] < 0; i7++) { + (this || _global$d).words[i7] += 67108864; + (this || _global$d).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$d).negative = 0; + return this || _global$d; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$d).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$d).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$d).length - shift; i7++) { + w6 = ((this || _global$d).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$d).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$d).length; i7++) { + w6 = -((this || _global$d).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$d).words[i7] = w6 & 67108863; + } + (this || _global$d).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$d).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$d).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$d).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$d).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$d).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$d + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$d).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$d).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$d).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$d).words[i7] | 0) + carry * 67108864; + (this || _global$d).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$d; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$d; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$d).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$d).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$d).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$d).length <= s7) { + this._expand(s7 + 1); + (this || _global$d).words[s7] |= q5; + return this || _global$d; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$d).length; i7++) { + var w6 = (this || _global$d).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$d).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$d).words[i7] = carry; + (this || _global$d).length++; + } + return this || _global$d; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$d).length === 1 && (this || _global$d).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$d).negative !== 0 && !negative) + return -1; + if ((this || _global$d).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$d).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$d).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$d).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$d).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$d).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$d).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$d).length > num.length) + return 1; + if ((this || _global$d).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$d).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$d).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$d).red, "Already a number in reduction context"); + assert4((this || _global$d).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$d)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$d).red, "fromRed works only with numbers in reduction context"); + return (this || _global$d).red.convertFrom(this || _global$d); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$d).red = ctx; + return this || _global$d; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$d).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$d).red, "redAdd works only with red numbers"); + return (this || _global$d).red.add(this || _global$d, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$d).red, "redIAdd works only with red numbers"); + return (this || _global$d).red.iadd(this || _global$d, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$d).red, "redSub works only with red numbers"); + return (this || _global$d).red.sub(this || _global$d, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$d).red, "redISub works only with red numbers"); + return (this || _global$d).red.isub(this || _global$d, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$d).red, "redShl works only with red numbers"); + return (this || _global$d).red.shl(this || _global$d, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$d).red, "redMul works only with red numbers"); + (this || _global$d).red._verify2(this || _global$d, num); + return (this || _global$d).red.mul(this || _global$d, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$d).red, "redMul works only with red numbers"); + (this || _global$d).red._verify2(this || _global$d, num); + return (this || _global$d).red.imul(this || _global$d, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$d).red, "redSqr works only with red numbers"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.sqr(this || _global$d); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$d).red, "redISqr works only with red numbers"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.isqr(this || _global$d); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$d).red, "redSqrt works only with red numbers"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.sqrt(this || _global$d); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$d).red, "redInvm works only with red numbers"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.invm(this || _global$d); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$d).red, "redNeg works only with red numbers"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.neg(this || _global$d); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$d).red && !num.red, "redPow(normalNum)"); + (this || _global$d).red._verify1(this || _global$d); + return (this || _global$d).red.pow(this || _global$d, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$d).name = name2; + (this || _global$d).p = new BN(p7, 16); + (this || _global$d).n = (this || _global$d).p.bitLength(); + (this || _global$d).k = new BN(1).iushln((this || _global$d).n).isub((this || _global$d).p); + (this || _global$d).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$d).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$d).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$d).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$d).n); + var cmp = rlen < (this || _global$d).n ? -1 : r8.ucmp((this || _global$d).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$d).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$d).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$d).k); + }; + function K256() { + MPrime.call(this || _global$d, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$d, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$d, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$d, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$d).m = prime.p; + (this || _global$d).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$d).m = m7; + (this || _global$d).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$d).prime) + return (this || _global$d).prime.ireduce(a7)._forceRed(this || _global$d); + return a7.umod((this || _global$d).m)._forceRed(this || _global$d); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$d).m.sub(a7)._forceRed(this || _global$d); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$d).m) >= 0) { + res.isub((this || _global$d).m); + } + return res._forceRed(this || _global$d); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$d).m) >= 0) { + res.isub((this || _global$d).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$d).m); + } + return res._forceRed(this || _global$d); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$d).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$d).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$d).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$d).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$d); + var nOne = one.redNeg(); + var lpow = (this || _global$d).m.subn(1).iushrn(1); + var z6 = (this || _global$d).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$d); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$d).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$d); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$d); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$d).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$d, m7); + (this || _global$d).shift = (this || _global$d).m.bitLength(); + if ((this || _global$d).shift % 26 !== 0) { + (this || _global$d).shift += 26 - (this || _global$d).shift % 26; + } + (this || _global$d).r = new BN(1).iushln((this || _global$d).shift); + (this || _global$d).r2 = this.imod((this || _global$d).r.sqr()); + (this || _global$d).rinv = (this || _global$d).r._invmp((this || _global$d).m); + (this || _global$d).minv = (this || _global$d).rinv.mul((this || _global$d).r).isubn(1).div((this || _global$d).m); + (this || _global$d).minv = (this || _global$d).minv.umod((this || _global$d).r); + (this || _global$d).minv = (this || _global$d).r.sub((this || _global$d).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$d).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$d).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$d).shift).mul((this || _global$d).minv).imaskn((this || _global$d).shift).mul((this || _global$d).m); + var u7 = t8.isub(c7).iushrn((this || _global$d).shift); + var res = u7; + if (u7.cmp((this || _global$d).m) >= 0) { + res = u7.isub((this || _global$d).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$d).m); + } + return res._forceRed(this || _global$d); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$d); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$d).shift).mul((this || _global$d).minv).imaskn((this || _global$d).shift).mul((this || _global$d).m); + var u7 = t8.isub(c7).iushrn((this || _global$d).shift); + var res = u7; + if (u7.cmp((this || _global$d).m) >= 0) { + res = u7.isub((this || _global$d).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$d).m); + } + return res._forceRed(this || _global$d); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$d).m).mul((this || _global$d).r2)); + return res._forceRed(this || _global$d); + }; + })(module$3, exports$$); + return module$3.exports; +} +function dew$Z() { + if (_dewExec$Z) + return exports$_; + _dewExec$Z = true; + var utils = exports$_; + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg !== "string") { + for (var i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + return res; + } + if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (var i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } else { + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + var hi = c7 >> 8; + var lo = c7 & 255; + if (hi) + res.push(hi, lo); + else + res.push(lo); + } + } + return res; + } + utils.toArray = toArray3; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + utils.zero2 = zero2; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + utils.toHex = toHex; + utils.encode = function encode2(arr, enc) { + if (enc === "hex") + return toHex(arr); + else + return arr; + }; + return exports$_; +} +function dew$Y() { + if (_dewExec$Y) + return exports$Z; + _dewExec$Y = true; + var utils = exports$Z; + var BN = dew$_(); + var minAssert = dew$3h(); + var minUtils = dew$Z(); + utils.assert = minAssert; + utils.toArray = minUtils.toArray; + utils.zero2 = minUtils.zero2; + utils.toHex = minUtils.toHex; + utils.encode = minUtils.encode; + function getNAF(num, w6, bits) { + var naf = new Array(Math.max(num.bitLength(), bits) + 1); + var i7; + for (i7 = 0; i7 < naf.length; i7 += 1) { + naf[i7] = 0; + } + var ws = 1 << w6 + 1; + var k6 = num.clone(); + for (i7 = 0; i7 < naf.length; i7++) { + var z6; + var mod2 = k6.andln(ws - 1); + if (k6.isOdd()) { + if (mod2 > (ws >> 1) - 1) + z6 = (ws >> 1) - mod2; + else + z6 = mod2; + k6.isubn(z6); + } else { + z6 = 0; + } + naf[i7] = z6; + k6.iushrn(1); + } + return naf; + } + utils.getNAF = getNAF; + function getJSF(k1, k22) { + var jsf = [[], []]; + k1 = k1.clone(); + k22 = k22.clone(); + var d1 = 0; + var d22 = 0; + var m8; + while (k1.cmpn(-d1) > 0 || k22.cmpn(-d22) > 0) { + var m14 = k1.andln(3) + d1 & 3; + var m24 = k22.andln(3) + d22 & 3; + if (m14 === 3) + m14 = -1; + if (m24 === 3) + m24 = -1; + var u1; + if ((m14 & 1) === 0) { + u1 = 0; + } else { + m8 = k1.andln(7) + d1 & 7; + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + jsf[0].push(u1); + var u22; + if ((m24 & 1) === 0) { + u22 = 0; + } else { + m8 = k22.andln(7) + d22 & 7; + if ((m8 === 3 || m8 === 5) && m14 === 2) + u22 = -m24; + else + u22 = m24; + } + jsf[1].push(u22); + if (2 * d1 === u1 + 1) + d1 = 1 - d1; + if (2 * d22 === u22 + 1) + d22 = 1 - d22; + k1.iushrn(1); + k22.iushrn(1); + } + return jsf; + } + utils.getJSF = getJSF; + function cachedProperty(obj, name2, computer) { + var key = "_" + name2; + obj.prototype[name2] = function cachedProperty2() { + return this[key] !== void 0 ? this[key] : this[key] = computer.call(this); + }; + } + utils.cachedProperty = cachedProperty; + function parseBytes(bytes) { + return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes; + } + utils.parseBytes = parseBytes; + function intFromLE(bytes) { + return new BN(bytes, "hex", "le"); + } + utils.intFromLE = intFromLE; + return exports$Z; +} +function dew$X() { + if (_dewExec$X) + return exports$Y; + _dewExec$X = true; + var BN = dew$_(); + var utils = dew$Y(); + var getNAF = utils.getNAF; + var getJSF = utils.getJSF; + var assert4 = utils.assert; + function BaseCurve(type3, conf) { + this.type = type3; + this.p = new BN(conf.p, 16); + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + this.n = conf.n && new BN(conf.n, 16); + this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed); + this._wnafT1 = new Array(4); + this._wnafT2 = new Array(4); + this._wnafT3 = new Array(4); + this._wnafT4 = new Array(4); + this._bitLength = this.n ? this.n.bitLength() : 0; + var adjustCount = this.n && this.p.div(this.n); + if (!adjustCount || adjustCount.cmpn(100) > 0) { + this.redN = null; + } else { + this._maxwellTrick = true; + this.redN = this.n.toRed(this.red); + } + } + exports$Y = BaseCurve; + BaseCurve.prototype.point = function point() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype.validate = function validate15() { + throw new Error("Not implemented"); + }; + BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p7, k6) { + assert4(p7.precomputed); + var doubles = p7._getDoubles(); + var naf = getNAF(k6, 1, this._bitLength); + var I6 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1); + I6 /= 3; + var repr = []; + var j6; + var nafW; + for (j6 = 0; j6 < naf.length; j6 += doubles.step) { + nafW = 0; + for (var l7 = j6 + doubles.step - 1; l7 >= j6; l7--) + nafW = (nafW << 1) + naf[l7]; + repr.push(nafW); + } + var a7 = this.jpoint(null, null, null); + var b8 = this.jpoint(null, null, null); + for (var i7 = I6; i7 > 0; i7--) { + for (j6 = 0; j6 < repr.length; j6++) { + nafW = repr[j6]; + if (nafW === i7) + b8 = b8.mixedAdd(doubles.points[j6]); + else if (nafW === -i7) + b8 = b8.mixedAdd(doubles.points[j6].neg()); + } + a7 = a7.add(b8); + } + return a7.toP(); + }; + BaseCurve.prototype._wnafMul = function _wnafMul(p7, k6) { + var w6 = 4; + var nafPoints = p7._getNAFPoints(w6); + w6 = nafPoints.wnd; + var wnd = nafPoints.points; + var naf = getNAF(k6, w6, this._bitLength); + var acc = this.jpoint(null, null, null); + for (var i7 = naf.length - 1; i7 >= 0; i7--) { + for (var l7 = 0; i7 >= 0 && naf[i7] === 0; i7--) + l7++; + if (i7 >= 0) + l7++; + acc = acc.dblp(l7); + if (i7 < 0) + break; + var z6 = naf[i7]; + assert4(z6 !== 0); + if (p7.type === "affine") { + if (z6 > 0) + acc = acc.mixedAdd(wnd[z6 - 1 >> 1]); + else + acc = acc.mixedAdd(wnd[-z6 - 1 >> 1].neg()); + } else { + if (z6 > 0) + acc = acc.add(wnd[z6 - 1 >> 1]); + else + acc = acc.add(wnd[-z6 - 1 >> 1].neg()); + } + } + return p7.type === "affine" ? acc.toP() : acc; + }; + BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) { + var wndWidth = this._wnafT1; + var wnd = this._wnafT2; + var naf = this._wnafT3; + var max2 = 0; + var i7; + var j6; + var p7; + for (i7 = 0; i7 < len; i7++) { + p7 = points[i7]; + var nafPoints = p7._getNAFPoints(defW); + wndWidth[i7] = nafPoints.wnd; + wnd[i7] = nafPoints.points; + } + for (i7 = len - 1; i7 >= 1; i7 -= 2) { + var a7 = i7 - 1; + var b8 = i7; + if (wndWidth[a7] !== 1 || wndWidth[b8] !== 1) { + naf[a7] = getNAF(coeffs[a7], wndWidth[a7], this._bitLength); + naf[b8] = getNAF(coeffs[b8], wndWidth[b8], this._bitLength); + max2 = Math.max(naf[a7].length, max2); + max2 = Math.max(naf[b8].length, max2); + continue; + } + var comb = [ + points[a7], + /* 1 */ + null, + /* 3 */ + null, + /* 5 */ + points[b8] + /* 7 */ + ]; + if (points[a7].y.cmp(points[b8].y) === 0) { + comb[1] = points[a7].add(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } else if (points[a7].y.cmp(points[b8].y.redNeg()) === 0) { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].add(points[b8].neg()); + } else { + comb[1] = points[a7].toJ().mixedAdd(points[b8]); + comb[2] = points[a7].toJ().mixedAdd(points[b8].neg()); + } + var index4 = [ + -3, + /* -1 -1 */ + -1, + /* -1 0 */ + -5, + /* -1 1 */ + -7, + /* 0 -1 */ + 0, + /* 0 0 */ + 7, + /* 0 1 */ + 5, + /* 1 -1 */ + 1, + /* 1 0 */ + 3 + /* 1 1 */ + ]; + var jsf = getJSF(coeffs[a7], coeffs[b8]); + max2 = Math.max(jsf[0].length, max2); + naf[a7] = new Array(max2); + naf[b8] = new Array(max2); + for (j6 = 0; j6 < max2; j6++) { + var ja = jsf[0][j6] | 0; + var jb = jsf[1][j6] | 0; + naf[a7][j6] = index4[(ja + 1) * 3 + (jb + 1)]; + naf[b8][j6] = 0; + wnd[a7] = comb; + } + } + var acc = this.jpoint(null, null, null); + var tmp = this._wnafT4; + for (i7 = max2; i7 >= 0; i7--) { + var k6 = 0; + while (i7 >= 0) { + var zero = true; + for (j6 = 0; j6 < len; j6++) { + tmp[j6] = naf[j6][i7] | 0; + if (tmp[j6] !== 0) + zero = false; + } + if (!zero) + break; + k6++; + i7--; + } + if (i7 >= 0) + k6++; + acc = acc.dblp(k6); + if (i7 < 0) + break; + for (j6 = 0; j6 < len; j6++) { + var z6 = tmp[j6]; + if (z6 === 0) + continue; + else if (z6 > 0) + p7 = wnd[j6][z6 - 1 >> 1]; + else if (z6 < 0) + p7 = wnd[j6][-z6 - 1 >> 1].neg(); + if (p7.type === "affine") + acc = acc.mixedAdd(p7); + else + acc = acc.add(p7); + } + } + for (i7 = 0; i7 < len; i7++) + wnd[i7] = null; + if (jacobianResult) + return acc; + else + return acc.toP(); + }; + function BasePoint(curve, type3) { + this.curve = curve; + this.type = type3; + this.precomputed = null; + } + BaseCurve.BasePoint = BasePoint; + BasePoint.prototype.eq = function eq2() { + throw new Error("Not implemented"); + }; + BasePoint.prototype.validate = function validate15() { + return this.curve.validate(this); + }; + BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + bytes = utils.toArray(bytes, enc); + var len = this.p.byteLength(); + if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) { + if (bytes[0] === 6) + assert4(bytes[bytes.length - 1] % 2 === 0); + else if (bytes[0] === 7) + assert4(bytes[bytes.length - 1] % 2 === 1); + var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len)); + return res; + } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) { + return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3); + } + throw new Error("Unknown point format"); + }; + BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) { + return this.encode(enc, true); + }; + BasePoint.prototype._encode = function _encode(compact2) { + var len = this.curve.p.byteLength(); + var x7 = this.getX().toArray("be", len); + if (compact2) + return [this.getY().isEven() ? 2 : 3].concat(x7); + return [4].concat(x7, this.getY().toArray("be", len)); + }; + BasePoint.prototype.encode = function encode2(enc, compact2) { + return utils.encode(this._encode(compact2), enc); + }; + BasePoint.prototype.precompute = function precompute(power) { + if (this.precomputed) + return this; + var precomputed = { + doubles: null, + naf: null, + beta: null + }; + precomputed.naf = this._getNAFPoints(8); + precomputed.doubles = this._getDoubles(4, power); + precomputed.beta = this._getBeta(); + this.precomputed = precomputed; + return this; + }; + BasePoint.prototype._hasDoubles = function _hasDoubles(k6) { + if (!this.precomputed) + return false; + var doubles = this.precomputed.doubles; + if (!doubles) + return false; + return doubles.points.length >= Math.ceil((k6.bitLength() + 1) / doubles.step); + }; + BasePoint.prototype._getDoubles = function _getDoubles(step, power) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + var doubles = [this]; + var acc = this; + for (var i7 = 0; i7 < power; i7 += step) { + for (var j6 = 0; j6 < step; j6++) + acc = acc.dbl(); + doubles.push(acc); + } + return { + step, + points: doubles + }; + }; + BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + var res = [this]; + var max2 = (1 << wnd) - 1; + var dbl = max2 === 1 ? null : this.dbl(); + for (var i7 = 1; i7 < max2; i7++) + res[i7] = res[i7 - 1].add(dbl); + return { + wnd, + points: res + }; + }; + BasePoint.prototype._getBeta = function _getBeta() { + return null; + }; + BasePoint.prototype.dblp = function dblp(k6) { + var r8 = this; + for (var i7 = 0; i7 < k6; i7++) + r8 = r8.dbl(); + return r8; + }; + return exports$Y; +} +function dew$W() { + if (_dewExec$W) + return exports$X; + _dewExec$W = true; + var utils = dew$Y(); + var BN = dew$_(); + var inherits2 = dew4(); + var Base2 = dew$X(); + var assert4 = utils.assert; + function ShortCurve(conf) { + Base2.call(this, "short", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.tinv = this.two.redInvm(); + this.zeroA = this.a.fromRed().cmpn(0) === 0; + this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; + this.endo = this._getEndomorphism(conf); + this._endoWnafT1 = new Array(4); + this._endoWnafT2 = new Array(4); + } + inherits2(ShortCurve, Base2); + exports$X = ShortCurve; + ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) { + if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) + return; + var beta; + var lambda; + if (conf.beta) { + beta = new BN(conf.beta, 16).toRed(this.red); + } else { + var betas = this._getEndoRoots(this.p); + beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1]; + beta = beta.toRed(this.red); + } + if (conf.lambda) { + lambda = new BN(conf.lambda, 16); + } else { + var lambdas = this._getEndoRoots(this.n); + if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) { + lambda = lambdas[0]; + } else { + lambda = lambdas[1]; + assert4(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0); + } + } + var basis; + if (conf.basis) { + basis = conf.basis.map(function(vec) { + return { + a: new BN(vec.a, 16), + b: new BN(vec.b, 16) + }; + }); + } else { + basis = this._getEndoBasis(lambda); + } + return { + beta, + lambda, + basis + }; + }; + ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) { + var red = num === this.p ? this.red : BN.mont(num); + var tinv = new BN(2).toRed(red).redInvm(); + var ntinv = tinv.redNeg(); + var s7 = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv); + var l1 = ntinv.redAdd(s7).fromRed(); + var l22 = ntinv.redSub(s7).fromRed(); + return [l1, l22]; + }; + ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) { + var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); + var u7 = lambda; + var v8 = this.n.clone(); + var x1 = new BN(1); + var y1 = new BN(0); + var x22 = new BN(0); + var y22 = new BN(1); + var a0; + var b0; + var a1; + var b1; + var a22; + var b22; + var prevR; + var i7 = 0; + var r8; + var x7; + while (u7.cmpn(0) !== 0) { + var q5 = v8.div(u7); + r8 = v8.sub(q5.mul(u7)); + x7 = x22.sub(q5.mul(x1)); + var y7 = y22.sub(q5.mul(y1)); + if (!a1 && r8.cmp(aprxSqrt) < 0) { + a0 = prevR.neg(); + b0 = x1; + a1 = r8.neg(); + b1 = x7; + } else if (a1 && ++i7 === 2) { + break; + } + prevR = r8; + v8 = u7; + u7 = r8; + x22 = x1; + x1 = x7; + y22 = y1; + y1 = y7; + } + a22 = r8.neg(); + b22 = x7; + var len1 = a1.sqr().add(b1.sqr()); + var len2 = a22.sqr().add(b22.sqr()); + if (len2.cmp(len1) >= 0) { + a22 = a0; + b22 = b0; + } + if (a1.negative) { + a1 = a1.neg(); + b1 = b1.neg(); + } + if (a22.negative) { + a22 = a22.neg(); + b22 = b22.neg(); + } + return [{ + a: a1, + b: b1 + }, { + a: a22, + b: b22 + }]; + }; + ShortCurve.prototype._endoSplit = function _endoSplit(k6) { + var basis = this.endo.basis; + var v1 = basis[0]; + var v22 = basis[1]; + var c1 = v22.b.mul(k6).divRound(this.n); + var c22 = v1.b.neg().mul(k6).divRound(this.n); + var p1 = c1.mul(v1.a); + var p22 = c22.mul(v22.a); + var q1 = c1.mul(v1.b); + var q22 = c22.mul(v22.b); + var k1 = k6.sub(p1).sub(p22); + var k22 = q1.add(q22).neg(); + return { + k1, + k2: k22 + }; + }; + ShortCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var y22 = x7.redSqr().redMul(x7).redIAdd(x7.redMul(this.a)).redIAdd(this.b); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + ShortCurve.prototype.validate = function validate15(point) { + if (point.inf) + return true; + var x7 = point.x; + var y7 = point.y; + var ax = this.a.redMul(x7); + var rhs = x7.redSqr().redMul(x7).redIAdd(ax).redIAdd(this.b); + return y7.redSqr().redISub(rhs).cmpn(0) === 0; + }; + ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) { + var npoints = this._endoWnafT1; + var ncoeffs = this._endoWnafT2; + for (var i7 = 0; i7 < points.length; i7++) { + var split3 = this._endoSplit(coeffs[i7]); + var p7 = points[i7]; + var beta = p7._getBeta(); + if (split3.k1.negative) { + split3.k1.ineg(); + p7 = p7.neg(true); + } + if (split3.k2.negative) { + split3.k2.ineg(); + beta = beta.neg(true); + } + npoints[i7 * 2] = p7; + npoints[i7 * 2 + 1] = beta; + ncoeffs[i7 * 2] = split3.k1; + ncoeffs[i7 * 2 + 1] = split3.k2; + } + var res = this._wnafMulAdd(1, npoints, ncoeffs, i7 * 2, jacobianResult); + for (var j6 = 0; j6 < i7 * 2; j6++) { + npoints[j6] = null; + ncoeffs[j6] = null; + } + return res; + }; + function Point(curve, x7, y7, isRed) { + Base2.BasePoint.call(this, curve, "affine"); + if (x7 === null && y7 === null) { + this.x = null; + this.y = null; + this.inf = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + if (isRed) { + this.x.forceRed(this.curve.red); + this.y.forceRed(this.curve.red); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + this.inf = false; + } + } + inherits2(Point, Base2.BasePoint); + ShortCurve.prototype.point = function point(x7, y7, isRed) { + return new Point(this, x7, y7, isRed); + }; + ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) { + return Point.fromJSON(this, obj, red); + }; + Point.prototype._getBeta = function _getBeta() { + if (!this.curve.endo) + return; + var pre = this.precomputed; + if (pre && pre.beta) + return pre.beta; + var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (pre) { + var curve = this.curve; + var endoMul = function(p7) { + return curve.point(p7.x.redMul(curve.endo.beta), p7.y); + }; + pre.beta = beta; + beta.precomputed = { + beta: null, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(endoMul) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(endoMul) + } + }; + } + return beta; + }; + Point.prototype.toJSON = function toJSON() { + if (!this.precomputed) + return [this.x, this.y]; + return [this.x, this.y, this.precomputed && { + doubles: this.precomputed.doubles && { + step: this.precomputed.doubles.step, + points: this.precomputed.doubles.points.slice(1) + }, + naf: this.precomputed.naf && { + wnd: this.precomputed.naf.wnd, + points: this.precomputed.naf.points.slice(1) + } + }]; + }; + Point.fromJSON = function fromJSON(curve, obj, red) { + if (typeof obj === "string") + obj = JSON.parse(obj); + var res = curve.point(obj[0], obj[1], red); + if (!obj[2]) + return res; + function obj2point(obj2) { + return curve.point(obj2[0], obj2[1], red); + } + var pre = obj[2]; + res.precomputed = { + beta: null, + doubles: pre.doubles && { + step: pre.doubles.step, + points: [res].concat(pre.doubles.points.map(obj2point)) + }, + naf: pre.naf && { + wnd: pre.naf.wnd, + points: [res].concat(pre.naf.points.map(obj2point)) + } + }; + return res; + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.inf; + }; + Point.prototype.add = function add2(p7) { + if (this.inf) + return p7; + if (p7.inf) + return this; + if (this.eq(p7)) + return this.dbl(); + if (this.neg().eq(p7)) + return this.curve.point(null, null); + if (this.x.cmp(p7.x) === 0) + return this.curve.point(null, null); + var c7 = this.y.redSub(p7.y); + if (c7.cmpn(0) !== 0) + c7 = c7.redMul(this.x.redSub(p7.x).redInvm()); + var nx = c7.redSqr().redISub(this.x).redISub(p7.x); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.dbl = function dbl() { + if (this.inf) + return this; + var ys1 = this.y.redAdd(this.y); + if (ys1.cmpn(0) === 0) + return this.curve.point(null, null); + var a7 = this.curve.a; + var x22 = this.x.redSqr(); + var dyinv = ys1.redInvm(); + var c7 = x22.redAdd(x22).redIAdd(x22).redIAdd(a7).redMul(dyinv); + var nx = c7.redSqr().redISub(this.x.redAdd(this.x)); + var ny = c7.redMul(this.x.redSub(nx)).redISub(this.y); + return this.curve.point(nx, ny); + }; + Point.prototype.getX = function getX() { + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + return this.y.fromRed(); + }; + Point.prototype.mul = function mul(k6) { + k6 = new BN(k6, 16); + if (this.isInfinity()) + return this; + else if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else if (this.curve.endo) + return this.curve._endoWnafMulAdd([this], [k6]); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p22, k22) { + var points = [this, p22]; + var coeffs = [k1, k22]; + if (this.curve.endo) + return this.curve._endoWnafMulAdd(points, coeffs, true); + else + return this.curve._wnafMulAdd(1, points, coeffs, 2, true); + }; + Point.prototype.eq = function eq2(p7) { + return this === p7 || this.inf === p7.inf && (this.inf || this.x.cmp(p7.x) === 0 && this.y.cmp(p7.y) === 0); + }; + Point.prototype.neg = function neg(_precompute) { + if (this.inf) + return this; + var res = this.curve.point(this.x, this.y.redNeg()); + if (_precompute && this.precomputed) { + var pre = this.precomputed; + var negate2 = function(p7) { + return p7.neg(); + }; + res.precomputed = { + naf: pre.naf && { + wnd: pre.naf.wnd, + points: pre.naf.points.map(negate2) + }, + doubles: pre.doubles && { + step: pre.doubles.step, + points: pre.doubles.points.map(negate2) + } + }; + } + return res; + }; + Point.prototype.toJ = function toJ() { + if (this.inf) + return this.curve.jpoint(null, null, null); + var res = this.curve.jpoint(this.x, this.y, this.curve.one); + return res; + }; + function JPoint(curve, x7, y7, z6) { + Base2.BasePoint.call(this, curve, "jacobian"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.one; + this.y = this.curve.one; + this.z = new BN(0); + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = new BN(z6, 16); + } + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + } + inherits2(JPoint, Base2.BasePoint); + ShortCurve.prototype.jpoint = function jpoint(x7, y7, z6) { + return new JPoint(this, x7, y7, z6); + }; + JPoint.prototype.toP = function toP() { + if (this.isInfinity()) + return this.curve.point(null, null); + var zinv = this.z.redInvm(); + var zinv2 = zinv.redSqr(); + var ax = this.x.redMul(zinv2); + var ay = this.y.redMul(zinv2).redMul(zinv); + return this.curve.point(ax, ay); + }; + JPoint.prototype.neg = function neg() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }; + JPoint.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + var pz2 = p7.z.redSqr(); + var z22 = this.z.redSqr(); + var u1 = this.x.redMul(pz2); + var u22 = p7.x.redMul(z22); + var s1 = this.y.redMul(pz2.redMul(p7.z)); + var s22 = p7.y.redMul(z22.redMul(this.z)); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(p7.z).redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mixedAdd = function mixedAdd(p7) { + if (this.isInfinity()) + return p7.toJ(); + if (p7.isInfinity()) + return this; + var z22 = this.z.redSqr(); + var u1 = this.x; + var u22 = p7.x.redMul(z22); + var s1 = this.y; + var s22 = p7.y.redMul(z22).redMul(this.z); + var h8 = u1.redSub(u22); + var r8 = s1.redSub(s22); + if (h8.cmpn(0) === 0) { + if (r8.cmpn(0) !== 0) + return this.curve.jpoint(null, null, null); + else + return this.dbl(); + } + var h22 = h8.redSqr(); + var h32 = h22.redMul(h8); + var v8 = u1.redMul(h22); + var nx = r8.redSqr().redIAdd(h32).redISub(v8).redISub(v8); + var ny = r8.redMul(v8.redISub(nx)).redISub(s1.redMul(h32)); + var nz = this.z.redMul(h8); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.dblp = function dblp(pow) { + if (pow === 0) + return this; + if (this.isInfinity()) + return this; + if (!pow) + return this.dbl(); + var i7; + if (this.curve.zeroA || this.curve.threeA) { + var r8 = this; + for (i7 = 0; i7 < pow; i7++) + r8 = r8.dbl(); + return r8; + } + var a7 = this.curve.a; + var tinv = this.curve.tinv; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jyd = jy.redAdd(jy); + for (i7 = 0; i7 < pow; i7++) { + var jx2 = jx.redSqr(); + var jyd2 = jyd.redSqr(); + var jyd4 = jyd2.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var t1 = jx.redMul(jyd2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var dny = c7.redMul(t22); + dny = dny.redIAdd(dny).redISub(jyd4); + var nz = jyd.redMul(jz); + if (i7 + 1 < pow) + jz4 = jz4.redMul(jyd4); + jx = nx; + jz = nz; + jyd = dny; + } + return this.curve.jpoint(jx, jyd.redMul(tinv), jz); + }; + JPoint.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.zeroA) + return this._zeroDbl(); + else if (this.curve.threeA) + return this._threeDbl(); + else + return this._dbl(); + }; + JPoint.prototype._zeroDbl = function _zeroDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + nx = t8; + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = b8.redSqr(); + var d7 = this.x.redAdd(b8).redSqr().redISub(a7).redISub(c7); + d7 = d7.redIAdd(d7); + var e10 = a7.redAdd(a7).redIAdd(a7); + var f8 = e10.redSqr(); + var c8 = c7.redIAdd(c7); + c8 = c8.redIAdd(c8); + c8 = c8.redIAdd(c8); + nx = f8.redISub(d7).redISub(d7); + ny = e10.redMul(d7.redISub(nx)).redISub(c8); + nz = this.y.redMul(this.z); + nz = nz.redIAdd(nz); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._threeDbl = function _threeDbl() { + var nx; + var ny; + var nz; + if (this.zOne) { + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var yyyy = yy.redSqr(); + var s7 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + s7 = s7.redIAdd(s7); + var m7 = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a); + var t8 = m7.redSqr().redISub(s7).redISub(s7); + nx = t8; + var yyyy8 = yyyy.redIAdd(yyyy); + yyyy8 = yyyy8.redIAdd(yyyy8); + yyyy8 = yyyy8.redIAdd(yyyy8); + ny = m7.redMul(s7.redISub(t8)).redISub(yyyy8); + nz = this.y.redAdd(this.y); + } else { + var delta = this.z.redSqr(); + var gamma = this.y.redSqr(); + var beta = this.x.redMul(gamma); + var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta)); + alpha = alpha.redAdd(alpha).redIAdd(alpha); + var beta4 = beta.redIAdd(beta); + beta4 = beta4.redIAdd(beta4); + var beta8 = beta4.redAdd(beta4); + nx = alpha.redSqr().redISub(beta8); + nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + var ggamma8 = gamma.redSqr(); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ggamma8 = ggamma8.redIAdd(ggamma8); + ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8); + } + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype._dbl = function _dbl() { + var a7 = this.curve.a; + var jx = this.x; + var jy = this.y; + var jz = this.z; + var jz4 = jz.redSqr().redSqr(); + var jx2 = jx.redSqr(); + var jy2 = jy.redSqr(); + var c7 = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a7.redMul(jz4)); + var jxd4 = jx.redAdd(jx); + jxd4 = jxd4.redIAdd(jxd4); + var t1 = jxd4.redMul(jy2); + var nx = c7.redSqr().redISub(t1.redAdd(t1)); + var t22 = t1.redISub(nx); + var jyd8 = jy2.redSqr(); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + jyd8 = jyd8.redIAdd(jyd8); + var ny = c7.redMul(t22).redISub(jyd8); + var nz = jy.redAdd(jy).redMul(jz); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.trpl = function trpl() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var xx = this.x.redSqr(); + var yy = this.y.redSqr(); + var zz = this.z.redSqr(); + var yyyy = yy.redSqr(); + var m7 = xx.redAdd(xx).redIAdd(xx); + var mm = m7.redSqr(); + var e10 = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy); + e10 = e10.redIAdd(e10); + e10 = e10.redAdd(e10).redIAdd(e10); + e10 = e10.redISub(mm); + var ee4 = e10.redSqr(); + var t8 = yyyy.redIAdd(yyyy); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + t8 = t8.redIAdd(t8); + var u7 = m7.redIAdd(e10).redSqr().redISub(mm).redISub(ee4).redISub(t8); + var yyu4 = yy.redMul(u7); + yyu4 = yyu4.redIAdd(yyu4); + yyu4 = yyu4.redIAdd(yyu4); + var nx = this.x.redMul(ee4).redISub(yyu4); + nx = nx.redIAdd(nx); + nx = nx.redIAdd(nx); + var ny = this.y.redMul(u7.redMul(t8.redISub(u7)).redISub(e10.redMul(ee4))); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + ny = ny.redIAdd(ny); + var nz = this.z.redAdd(e10).redSqr().redISub(zz).redISub(ee4); + return this.curve.jpoint(nx, ny, nz); + }; + JPoint.prototype.mul = function mul(k6, kbase) { + k6 = new BN(k6, kbase); + return this.curve._wnafMul(this, k6); + }; + JPoint.prototype.eq = function eq2(p7) { + if (p7.type === "affine") + return this.eq(p7.toJ()); + if (this === p7) + return true; + var z22 = this.z.redSqr(); + var pz2 = p7.z.redSqr(); + if (this.x.redMul(pz2).redISub(p7.x.redMul(z22)).cmpn(0) !== 0) + return false; + var z32 = z22.redMul(this.z); + var pz3 = pz2.redMul(p7.z); + return this.y.redMul(pz3).redISub(p7.y.redMul(z32)).cmpn(0) === 0; + }; + JPoint.prototype.eqXToP = function eqXToP(x7) { + var zs = this.z.redSqr(); + var rx = x7.toRed(this.curve.red).redMul(zs); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(zs); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + JPoint.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + JPoint.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + return exports$X; +} +function dew$V() { + if (_dewExec$V) + return exports$W; + _dewExec$V = true; + var BN = dew$_(); + var inherits2 = dew4(); + var Base2 = dew$X(); + var utils = dew$Y(); + function MontCurve(conf) { + Base2.call(this, "mont", conf); + this.a = new BN(conf.a, 16).toRed(this.red); + this.b = new BN(conf.b, 16).toRed(this.red); + this.i4 = new BN(4).toRed(this.red).redInvm(); + this.two = new BN(2).toRed(this.red); + this.a24 = this.i4.redMul(this.a.redAdd(this.two)); + } + inherits2(MontCurve, Base2); + exports$W = MontCurve; + MontCurve.prototype.validate = function validate15(point) { + var x7 = point.normalize().x; + var x22 = x7.redSqr(); + var rhs = x22.redMul(x7).redAdd(x22.redMul(this.a)).redAdd(x7); + var y7 = rhs.redSqrt(); + return y7.redSqr().cmp(rhs) === 0; + }; + function Point(curve, x7, z6) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && z6 === null) { + this.x = this.curve.one; + this.z = this.curve.zero; + } else { + this.x = new BN(x7, 16); + this.z = new BN(z6, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } + } + inherits2(Point, Base2.BasePoint); + MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) { + return this.point(utils.toArray(bytes, enc), 1); + }; + MontCurve.prototype.point = function point(x7, z6) { + return new Point(this, x7, z6); + }; + MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + Point.prototype.precompute = function precompute() { + }; + Point.prototype._encode = function _encode() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1] || curve.one); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.z.cmpn(0) === 0; + }; + Point.prototype.dbl = function dbl() { + var a7 = this.x.redAdd(this.z); + var aa = a7.redSqr(); + var b8 = this.x.redSub(this.z); + var bb = b8.redSqr(); + var c7 = aa.redSub(bb); + var nx = aa.redMul(bb); + var nz = c7.redMul(bb.redAdd(this.curve.a24.redMul(c7))); + return this.curve.point(nx, nz); + }; + Point.prototype.add = function add2() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.diffAdd = function diffAdd(p7, diff) { + var a7 = this.x.redAdd(this.z); + var b8 = this.x.redSub(this.z); + var c7 = p7.x.redAdd(p7.z); + var d7 = p7.x.redSub(p7.z); + var da = d7.redMul(a7); + var cb = c7.redMul(b8); + var nx = diff.z.redMul(da.redAdd(cb).redSqr()); + var nz = diff.x.redMul(da.redISub(cb).redSqr()); + return this.curve.point(nx, nz); + }; + Point.prototype.mul = function mul(k6) { + var t8 = k6.clone(); + var a7 = this; + var b8 = this.curve.point(null, null); + var c7 = this; + for (var bits = []; t8.cmpn(0) !== 0; t8.iushrn(1)) + bits.push(t8.andln(1)); + for (var i7 = bits.length - 1; i7 >= 0; i7--) { + if (bits[i7] === 0) { + a7 = a7.diffAdd(b8, c7); + b8 = b8.dbl(); + } else { + b8 = a7.diffAdd(b8, c7); + a7 = a7.dbl(); + } + } + return b8; + }; + Point.prototype.mulAdd = function mulAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.jumlAdd = function jumlAdd() { + throw new Error("Not supported on Montgomery curve"); + }; + Point.prototype.eq = function eq2(other) { + return this.getX().cmp(other.getX()) === 0; + }; + Point.prototype.normalize = function normalize2() { + this.x = this.x.redMul(this.z.redInvm()); + this.z = this.curve.one; + return this; + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + return exports$W; +} +function dew$U() { + if (_dewExec$U) + return exports$V; + _dewExec$U = true; + var utils = dew$Y(); + var BN = dew$_(); + var inherits2 = dew4(); + var Base2 = dew$X(); + var assert4 = utils.assert; + function EdwardsCurve(conf) { + this.twisted = (conf.a | 0) !== 1; + this.mOneA = this.twisted && (conf.a | 0) === -1; + this.extended = this.mOneA; + Base2.call(this, "edwards", conf); + this.a = new BN(conf.a, 16).umod(this.red.m); + this.a = this.a.toRed(this.red); + this.c = new BN(conf.c, 16).toRed(this.red); + this.c2 = this.c.redSqr(); + this.d = new BN(conf.d, 16).toRed(this.red); + this.dd = this.d.redAdd(this.d); + assert4(!this.twisted || this.c.fromRed().cmpn(1) === 0); + this.oneC = (conf.c | 0) === 1; + } + inherits2(EdwardsCurve, Base2); + exports$V = EdwardsCurve; + EdwardsCurve.prototype._mulA = function _mulA(num) { + if (this.mOneA) + return num.redNeg(); + else + return this.a.redMul(num); + }; + EdwardsCurve.prototype._mulC = function _mulC(num) { + if (this.oneC) + return num; + else + return this.c.redMul(num); + }; + EdwardsCurve.prototype.jpoint = function jpoint(x7, y7, z6, t8) { + return this.point(x7, y7, z6, t8); + }; + EdwardsCurve.prototype.pointFromX = function pointFromX(x7, odd) { + x7 = new BN(x7, 16); + if (!x7.red) + x7 = x7.toRed(this.red); + var x22 = x7.redSqr(); + var rhs = this.c2.redSub(this.a.redMul(x22)); + var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x22)); + var y22 = rhs.redMul(lhs.redInvm()); + var y7 = y22.redSqrt(); + if (y7.redSqr().redSub(y22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + var isOdd = y7.fromRed().isOdd(); + if (odd && !isOdd || !odd && isOdd) + y7 = y7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.pointFromY = function pointFromY(y7, odd) { + y7 = new BN(y7, 16); + if (!y7.red) + y7 = y7.toRed(this.red); + var y22 = y7.redSqr(); + var lhs = y22.redSub(this.c2); + var rhs = y22.redMul(this.d).redMul(this.c2).redSub(this.a); + var x22 = lhs.redMul(rhs.redInvm()); + if (x22.cmp(this.zero) === 0) { + if (odd) + throw new Error("invalid point"); + else + return this.point(this.zero, y7); + } + var x7 = x22.redSqrt(); + if (x7.redSqr().redSub(x22).cmp(this.zero) !== 0) + throw new Error("invalid point"); + if (x7.fromRed().isOdd() !== odd) + x7 = x7.redNeg(); + return this.point(x7, y7); + }; + EdwardsCurve.prototype.validate = function validate15(point) { + if (point.isInfinity()) + return true; + point.normalize(); + var x22 = point.x.redSqr(); + var y22 = point.y.redSqr(); + var lhs = x22.redMul(this.a).redAdd(y22); + var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x22).redMul(y22))); + return lhs.cmp(rhs) === 0; + }; + function Point(curve, x7, y7, z6, t8) { + Base2.BasePoint.call(this, curve, "projective"); + if (x7 === null && y7 === null && z6 === null) { + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + } else { + this.x = new BN(x7, 16); + this.y = new BN(y7, 16); + this.z = z6 ? new BN(z6, 16) : this.curve.one; + this.t = t8 && new BN(t8, 16); + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + this.zOne = this.z === this.curve.one; + if (this.curve.extended && !this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redMul(this.z.redInvm()); + } + } + } + inherits2(Point, Base2.BasePoint); + EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) { + return Point.fromJSON(this, obj); + }; + EdwardsCurve.prototype.point = function point(x7, y7, z6, t8) { + return new Point(this, x7, y7, z6, t8); + }; + Point.fromJSON = function fromJSON(curve, obj) { + return new Point(curve, obj[0], obj[1], obj[2]); + }; + Point.prototype.inspect = function inspect2() { + if (this.isInfinity()) + return ""; + return ""; + }; + Point.prototype.isInfinity = function isInfinity() { + return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0); + }; + Point.prototype._extDbl = function _extDbl() { + var a7 = this.x.redSqr(); + var b8 = this.y.redSqr(); + var c7 = this.z.redSqr(); + c7 = c7.redIAdd(c7); + var d7 = this.curve._mulA(a7); + var e10 = this.x.redAdd(this.y).redSqr().redISub(a7).redISub(b8); + var g7 = d7.redAdd(b8); + var f8 = g7.redSub(c7); + var h8 = d7.redSub(b8); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projDbl = function _projDbl() { + var b8 = this.x.redAdd(this.y).redSqr(); + var c7 = this.x.redSqr(); + var d7 = this.y.redSqr(); + var nx; + var ny; + var nz; + var e10; + var h8; + var j6; + if (this.curve.twisted) { + e10 = this.curve._mulA(c7); + var f8 = e10.redAdd(d7); + if (this.zOne) { + nx = b8.redSub(c7).redSub(d7).redMul(f8.redSub(this.curve.two)); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redSqr().redSub(f8).redSub(f8); + } else { + h8 = this.z.redSqr(); + j6 = f8.redSub(h8).redISub(h8); + nx = b8.redSub(c7).redISub(d7).redMul(j6); + ny = f8.redMul(e10.redSub(d7)); + nz = f8.redMul(j6); + } + } else { + e10 = c7.redAdd(d7); + h8 = this.curve._mulC(this.z).redSqr(); + j6 = e10.redSub(h8).redSub(h8); + nx = this.curve._mulC(b8.redISub(e10)).redMul(j6); + ny = this.curve._mulC(e10).redMul(c7.redISub(d7)); + nz = e10.redMul(j6); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.dbl = function dbl() { + if (this.isInfinity()) + return this; + if (this.curve.extended) + return this._extDbl(); + else + return this._projDbl(); + }; + Point.prototype._extAdd = function _extAdd(p7) { + var a7 = this.y.redSub(this.x).redMul(p7.y.redSub(p7.x)); + var b8 = this.y.redAdd(this.x).redMul(p7.y.redAdd(p7.x)); + var c7 = this.t.redMul(this.curve.dd).redMul(p7.t); + var d7 = this.z.redMul(p7.z.redAdd(p7.z)); + var e10 = b8.redSub(a7); + var f8 = d7.redSub(c7); + var g7 = d7.redAdd(c7); + var h8 = b8.redAdd(a7); + var nx = e10.redMul(f8); + var ny = g7.redMul(h8); + var nt2 = e10.redMul(h8); + var nz = f8.redMul(g7); + return this.curve.point(nx, ny, nz, nt2); + }; + Point.prototype._projAdd = function _projAdd(p7) { + var a7 = this.z.redMul(p7.z); + var b8 = a7.redSqr(); + var c7 = this.x.redMul(p7.x); + var d7 = this.y.redMul(p7.y); + var e10 = this.curve.d.redMul(c7).redMul(d7); + var f8 = b8.redSub(e10); + var g7 = b8.redAdd(e10); + var tmp = this.x.redAdd(this.y).redMul(p7.x.redAdd(p7.y)).redISub(c7).redISub(d7); + var nx = a7.redMul(f8).redMul(tmp); + var ny; + var nz; + if (this.curve.twisted) { + ny = a7.redMul(g7).redMul(d7.redSub(this.curve._mulA(c7))); + nz = f8.redMul(g7); + } else { + ny = a7.redMul(g7).redMul(d7.redSub(c7)); + nz = this.curve._mulC(f8).redMul(g7); + } + return this.curve.point(nx, ny, nz); + }; + Point.prototype.add = function add2(p7) { + if (this.isInfinity()) + return p7; + if (p7.isInfinity()) + return this; + if (this.curve.extended) + return this._extAdd(p7); + else + return this._projAdd(p7); + }; + Point.prototype.mul = function mul(k6) { + if (this._hasDoubles(k6)) + return this.curve._fixedNafMul(this, k6); + else + return this.curve._wnafMul(this, k6); + }; + Point.prototype.mulAdd = function mulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, false); + }; + Point.prototype.jmulAdd = function jmulAdd(k1, p7, k22) { + return this.curve._wnafMulAdd(1, [this, p7], [k1, k22], 2, true); + }; + Point.prototype.normalize = function normalize2() { + if (this.zOne) + return this; + var zi = this.z.redInvm(); + this.x = this.x.redMul(zi); + this.y = this.y.redMul(zi); + if (this.t) + this.t = this.t.redMul(zi); + this.z = this.curve.one; + this.zOne = true; + return this; + }; + Point.prototype.neg = function neg() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }; + Point.prototype.getX = function getX() { + this.normalize(); + return this.x.fromRed(); + }; + Point.prototype.getY = function getY() { + this.normalize(); + return this.y.fromRed(); + }; + Point.prototype.eq = function eq2(other) { + return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0; + }; + Point.prototype.eqXToP = function eqXToP(x7) { + var rx = x7.toRed(this.curve.red).redMul(this.z); + if (this.x.cmp(rx) === 0) + return true; + var xc = x7.clone(); + var t8 = this.curve.redN.redMul(this.z); + for (; ; ) { + xc.iadd(this.curve.n); + if (xc.cmp(this.curve.p) >= 0) + return false; + rx.redIAdd(t8); + if (this.x.cmp(rx) === 0) + return true; + } + }; + Point.prototype.toP = Point.prototype.normalize; + Point.prototype.mixedAdd = Point.prototype.add; + return exports$V; +} +function dew$T() { + if (_dewExec$T) + return exports$U; + _dewExec$T = true; + var curve = exports$U; + curve.base = dew$X(); + curve.short = dew$W(); + curve.mont = dew$V(); + curve.edwards = dew$U(); + return exports$U; +} +function dew$S() { + if (_dewExec$S) + return exports$T; + _dewExec$S = true; + var assert4 = dew$3h(); + var inherits2 = dew4(); + exports$T.inherits = inherits2; + function isSurrogatePair(msg, i7) { + if ((msg.charCodeAt(i7) & 64512) !== 55296) { + return false; + } + if (i7 < 0 || i7 + 1 >= msg.length) { + return false; + } + return (msg.charCodeAt(i7 + 1) & 64512) === 56320; + } + function toArray3(msg, enc) { + if (Array.isArray(msg)) + return msg.slice(); + if (!msg) + return []; + var res = []; + if (typeof msg === "string") { + if (!enc) { + var p7 = 0; + for (var i7 = 0; i7 < msg.length; i7++) { + var c7 = msg.charCodeAt(i7); + if (c7 < 128) { + res[p7++] = c7; + } else if (c7 < 2048) { + res[p7++] = c7 >> 6 | 192; + res[p7++] = c7 & 63 | 128; + } else if (isSurrogatePair(msg, i7)) { + c7 = 65536 + ((c7 & 1023) << 10) + (msg.charCodeAt(++i7) & 1023); + res[p7++] = c7 >> 18 | 240; + res[p7++] = c7 >> 12 & 63 | 128; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } else { + res[p7++] = c7 >> 12 | 224; + res[p7++] = c7 >> 6 & 63 | 128; + res[p7++] = c7 & 63 | 128; + } + } + } else if (enc === "hex") { + msg = msg.replace(/[^a-z0-9]+/ig, ""); + if (msg.length % 2 !== 0) + msg = "0" + msg; + for (i7 = 0; i7 < msg.length; i7 += 2) + res.push(parseInt(msg[i7] + msg[i7 + 1], 16)); + } + } else { + for (i7 = 0; i7 < msg.length; i7++) + res[i7] = msg[i7] | 0; + } + return res; + } + exports$T.toArray = toArray3; + function toHex(msg) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) + res += zero2(msg[i7].toString(16)); + return res; + } + exports$T.toHex = toHex; + function htonl(w6) { + var res = w6 >>> 24 | w6 >>> 8 & 65280 | w6 << 8 & 16711680 | (w6 & 255) << 24; + return res >>> 0; + } + exports$T.htonl = htonl; + function toHex32(msg, endian) { + var res = ""; + for (var i7 = 0; i7 < msg.length; i7++) { + var w6 = msg[i7]; + if (endian === "little") + w6 = htonl(w6); + res += zero8(w6.toString(16)); + } + return res; + } + exports$T.toHex32 = toHex32; + function zero2(word) { + if (word.length === 1) + return "0" + word; + else + return word; + } + exports$T.zero2 = zero2; + function zero8(word) { + if (word.length === 7) + return "0" + word; + else if (word.length === 6) + return "00" + word; + else if (word.length === 5) + return "000" + word; + else if (word.length === 4) + return "0000" + word; + else if (word.length === 3) + return "00000" + word; + else if (word.length === 2) + return "000000" + word; + else if (word.length === 1) + return "0000000" + word; + else + return word; + } + exports$T.zero8 = zero8; + function join32(msg, start, end, endian) { + var len = end - start; + assert4(len % 4 === 0); + var res = new Array(len / 4); + for (var i7 = 0, k6 = start; i7 < res.length; i7++, k6 += 4) { + var w6; + if (endian === "big") + w6 = msg[k6] << 24 | msg[k6 + 1] << 16 | msg[k6 + 2] << 8 | msg[k6 + 3]; + else + w6 = msg[k6 + 3] << 24 | msg[k6 + 2] << 16 | msg[k6 + 1] << 8 | msg[k6]; + res[i7] = w6 >>> 0; + } + return res; + } + exports$T.join32 = join32; + function split32(msg, endian) { + var res = new Array(msg.length * 4); + for (var i7 = 0, k6 = 0; i7 < msg.length; i7++, k6 += 4) { + var m7 = msg[i7]; + if (endian === "big") { + res[k6] = m7 >>> 24; + res[k6 + 1] = m7 >>> 16 & 255; + res[k6 + 2] = m7 >>> 8 & 255; + res[k6 + 3] = m7 & 255; + } else { + res[k6 + 3] = m7 >>> 24; + res[k6 + 2] = m7 >>> 16 & 255; + res[k6 + 1] = m7 >>> 8 & 255; + res[k6] = m7 & 255; + } + } + return res; + } + exports$T.split32 = split32; + function rotr32(w6, b8) { + return w6 >>> b8 | w6 << 32 - b8; + } + exports$T.rotr32 = rotr32; + function rotl32(w6, b8) { + return w6 << b8 | w6 >>> 32 - b8; + } + exports$T.rotl32 = rotl32; + function sum32(a7, b8) { + return a7 + b8 >>> 0; + } + exports$T.sum32 = sum32; + function sum32_3(a7, b8, c7) { + return a7 + b8 + c7 >>> 0; + } + exports$T.sum32_3 = sum32_3; + function sum32_4(a7, b8, c7, d7) { + return a7 + b8 + c7 + d7 >>> 0; + } + exports$T.sum32_4 = sum32_4; + function sum32_5(a7, b8, c7, d7, e10) { + return a7 + b8 + c7 + d7 + e10 >>> 0; + } + exports$T.sum32_5 = sum32_5; + function sum64(buf, pos, ah, al) { + var bh = buf[pos]; + var bl = buf[pos + 1]; + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + buf[pos] = hi >>> 0; + buf[pos + 1] = lo; + } + exports$T.sum64 = sum64; + function sum64_hi(ah, al, bh, bl) { + var lo = al + bl >>> 0; + var hi = (lo < al ? 1 : 0) + ah + bh; + return hi >>> 0; + } + exports$T.sum64_hi = sum64_hi; + function sum64_lo(ah, al, bh, bl) { + var lo = al + bl; + return lo >>> 0; + } + exports$T.sum64_lo = sum64_lo; + function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + var hi = ah + bh + ch + dh + carry; + return hi >>> 0; + } + exports$T.sum64_4_hi = sum64_4_hi; + function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) { + var lo = al + bl + cl + dl; + return lo >>> 0; + } + exports$T.sum64_4_lo = sum64_4_lo; + function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var carry = 0; + var lo = al; + lo = lo + bl >>> 0; + carry += lo < al ? 1 : 0; + lo = lo + cl >>> 0; + carry += lo < cl ? 1 : 0; + lo = lo + dl >>> 0; + carry += lo < dl ? 1 : 0; + lo = lo + el >>> 0; + carry += lo < el ? 1 : 0; + var hi = ah + bh + ch + dh + eh + carry; + return hi >>> 0; + } + exports$T.sum64_5_hi = sum64_5_hi; + function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) { + var lo = al + bl + cl + dl + el; + return lo >>> 0; + } + exports$T.sum64_5_lo = sum64_5_lo; + function rotr64_hi(ah, al, num) { + var r8 = al << 32 - num | ah >>> num; + return r8 >>> 0; + } + exports$T.rotr64_hi = rotr64_hi; + function rotr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$T.rotr64_lo = rotr64_lo; + function shr64_hi(ah, al, num) { + return ah >>> num; + } + exports$T.shr64_hi = shr64_hi; + function shr64_lo(ah, al, num) { + var r8 = ah << 32 - num | al >>> num; + return r8 >>> 0; + } + exports$T.shr64_lo = shr64_lo; + return exports$T; +} +function dew$R() { + if (_dewExec$R) + return exports$S; + _dewExec$R = true; + var utils = dew$S(); + var assert4 = dew$3h(); + function BlockHash() { + this.pending = null; + this.pendingTotal = 0; + this.blockSize = this.constructor.blockSize; + this.outSize = this.constructor.outSize; + this.hmacStrength = this.constructor.hmacStrength; + this.padLength = this.constructor.padLength / 8; + this.endian = "big"; + this._delta8 = this.blockSize / 8; + this._delta32 = this.blockSize / 32; + } + exports$S.BlockHash = BlockHash; + BlockHash.prototype.update = function update2(msg, enc) { + msg = utils.toArray(msg, enc); + if (!this.pending) + this.pending = msg; + else + this.pending = this.pending.concat(msg); + this.pendingTotal += msg.length; + if (this.pending.length >= this._delta8) { + msg = this.pending; + var r8 = msg.length % this._delta8; + this.pending = msg.slice(msg.length - r8, msg.length); + if (this.pending.length === 0) + this.pending = null; + msg = utils.join32(msg, 0, msg.length - r8, this.endian); + for (var i7 = 0; i7 < msg.length; i7 += this._delta32) + this._update(msg, i7, i7 + this._delta32); + } + return this; + }; + BlockHash.prototype.digest = function digest(enc) { + this.update(this._pad()); + assert4(this.pending === null); + return this._digest(enc); + }; + BlockHash.prototype._pad = function pad2() { + var len = this.pendingTotal; + var bytes = this._delta8; + var k6 = bytes - (len + this.padLength) % bytes; + var res = new Array(k6 + this.padLength); + res[0] = 128; + for (var i7 = 1; i7 < k6; i7++) + res[i7] = 0; + len <<= 3; + if (this.endian === "big") { + for (var t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = len >>> 24 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len & 255; + } else { + res[i7++] = len & 255; + res[i7++] = len >>> 8 & 255; + res[i7++] = len >>> 16 & 255; + res[i7++] = len >>> 24 & 255; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + res[i7++] = 0; + for (t8 = 8; t8 < this.padLength; t8++) + res[i7++] = 0; + } + return res; + }; + return exports$S; +} +function dew$Q() { + if (_dewExec$Q) + return exports$R; + _dewExec$Q = true; + var utils = dew$S(); + var rotr32 = utils.rotr32; + function ft_1(s7, x7, y7, z6) { + if (s7 === 0) + return ch32(x7, y7, z6); + if (s7 === 1 || s7 === 3) + return p32(x7, y7, z6); + if (s7 === 2) + return maj32(x7, y7, z6); + } + exports$R.ft_1 = ft_1; + function ch32(x7, y7, z6) { + return x7 & y7 ^ ~x7 & z6; + } + exports$R.ch32 = ch32; + function maj32(x7, y7, z6) { + return x7 & y7 ^ x7 & z6 ^ y7 & z6; + } + exports$R.maj32 = maj32; + function p32(x7, y7, z6) { + return x7 ^ y7 ^ z6; + } + exports$R.p32 = p32; + function s0_256(x7) { + return rotr32(x7, 2) ^ rotr32(x7, 13) ^ rotr32(x7, 22); + } + exports$R.s0_256 = s0_256; + function s1_256(x7) { + return rotr32(x7, 6) ^ rotr32(x7, 11) ^ rotr32(x7, 25); + } + exports$R.s1_256 = s1_256; + function g0_256(x7) { + return rotr32(x7, 7) ^ rotr32(x7, 18) ^ x7 >>> 3; + } + exports$R.g0_256 = g0_256; + function g1_256(x7) { + return rotr32(x7, 17) ^ rotr32(x7, 19) ^ x7 >>> 10; + } + exports$R.g1_256 = g1_256; + return exports$R; +} +function dew$P() { + if (_dewExec$P) + return exports$Q; + _dewExec$P = true; + var utils = dew$S(); + var common3 = dew$R(); + var shaCommon = dew$Q(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_5 = utils.sum32_5; + var ft_1 = shaCommon.ft_1; + var BlockHash = common3.BlockHash; + var sha1_K = [1518500249, 1859775393, 2400959708, 3395469782]; + function SHA1() { + if (!(this instanceof SHA1)) + return new SHA1(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.W = new Array(80); + } + utils.inherits(SHA1, BlockHash); + exports$Q = SHA1; + SHA1.blockSize = 512; + SHA1.outSize = 160; + SHA1.hmacStrength = 80; + SHA1.padLength = 64; + SHA1.prototype._update = function _update(msg, start) { + var W5 = this.W; + for (var i7 = 0; i7 < 16; i7++) + W5[i7] = msg[start + i7]; + for (; i7 < W5.length; i7++) + W5[i7] = rotl32(W5[i7 - 3] ^ W5[i7 - 8] ^ W5[i7 - 14] ^ W5[i7 - 16], 1); + var a7 = this.h[0]; + var b8 = this.h[1]; + var c7 = this.h[2]; + var d7 = this.h[3]; + var e10 = this.h[4]; + for (i7 = 0; i7 < W5.length; i7++) { + var s7 = ~~(i7 / 20); + var t8 = sum32_5(rotl32(a7, 5), ft_1(s7, b8, c7, d7), e10, W5[i7], sha1_K[s7]); + e10 = d7; + d7 = c7; + c7 = rotl32(b8, 30); + b8 = a7; + a7 = t8; + } + this.h[0] = sum32(this.h[0], a7); + this.h[1] = sum32(this.h[1], b8); + this.h[2] = sum32(this.h[2], c7); + this.h[3] = sum32(this.h[3], d7); + this.h[4] = sum32(this.h[4], e10); + }; + SHA1.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "big"); + else + return utils.split32(this.h, "big"); + }; + return exports$Q; +} +function dew$O() { + if (_dewExec$O) + return exports$P; + _dewExec$O = true; + var utils = dew$S(); + var common3 = dew$R(); + var shaCommon = dew$Q(); + var assert4 = dew$3h(); + var sum32 = utils.sum32; + var sum32_4 = utils.sum32_4; + var sum32_5 = utils.sum32_5; + var ch32 = shaCommon.ch32; + var maj32 = shaCommon.maj32; + var s0_256 = shaCommon.s0_256; + var s1_256 = shaCommon.s1_256; + var g0_256 = shaCommon.g0_256; + var g1_256 = shaCommon.g1_256; + var BlockHash = common3.BlockHash; + var sha256_K = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]; + function SHA256() { + if (!(this instanceof SHA256)) + return new SHA256(); + BlockHash.call(this); + this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]; + this.k = sha256_K; + this.W = new Array(64); + } + utils.inherits(SHA256, BlockHash); + exports$P = SHA256; + SHA256.blockSize = 512; + SHA256.outSize = 256; + SHA256.hmacStrength = 192; + SHA256.padLength = 64; + SHA256.prototype._update = function _update(msg, start) { + var W5 = this.W; + for (var i7 = 0; i7 < 16; i7++) + W5[i7] = msg[start + i7]; + for (; i7 < W5.length; i7++) + W5[i7] = sum32_4(g1_256(W5[i7 - 2]), W5[i7 - 7], g0_256(W5[i7 - 15]), W5[i7 - 16]); + var a7 = this.h[0]; + var b8 = this.h[1]; + var c7 = this.h[2]; + var d7 = this.h[3]; + var e10 = this.h[4]; + var f8 = this.h[5]; + var g7 = this.h[6]; + var h8 = this.h[7]; + assert4(this.k.length === W5.length); + for (i7 = 0; i7 < W5.length; i7++) { + var T1 = sum32_5(h8, s1_256(e10), ch32(e10, f8, g7), this.k[i7], W5[i7]); + var T22 = sum32(s0_256(a7), maj32(a7, b8, c7)); + h8 = g7; + g7 = f8; + f8 = e10; + e10 = sum32(d7, T1); + d7 = c7; + c7 = b8; + b8 = a7; + a7 = sum32(T1, T22); + } + this.h[0] = sum32(this.h[0], a7); + this.h[1] = sum32(this.h[1], b8); + this.h[2] = sum32(this.h[2], c7); + this.h[3] = sum32(this.h[3], d7); + this.h[4] = sum32(this.h[4], e10); + this.h[5] = sum32(this.h[5], f8); + this.h[6] = sum32(this.h[6], g7); + this.h[7] = sum32(this.h[7], h8); + }; + SHA256.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "big"); + else + return utils.split32(this.h, "big"); + }; + return exports$P; +} +function dew$N() { + if (_dewExec$N) + return exports$O; + _dewExec$N = true; + var utils = dew$S(); + var SHA256 = dew$O(); + function SHA224() { + if (!(this instanceof SHA224)) + return new SHA224(); + SHA256.call(this); + this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]; + } + utils.inherits(SHA224, SHA256); + exports$O = SHA224; + SHA224.blockSize = 512; + SHA224.outSize = 224; + SHA224.hmacStrength = 192; + SHA224.padLength = 64; + SHA224.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h.slice(0, 7), "big"); + else + return utils.split32(this.h.slice(0, 7), "big"); + }; + return exports$O; +} +function dew$M() { + if (_dewExec$M) + return exports$N; + _dewExec$M = true; + var utils = dew$S(); + var common3 = dew$R(); + var assert4 = dew$3h(); + var rotr64_hi = utils.rotr64_hi; + var rotr64_lo = utils.rotr64_lo; + var shr64_hi = utils.shr64_hi; + var shr64_lo = utils.shr64_lo; + var sum64 = utils.sum64; + var sum64_hi = utils.sum64_hi; + var sum64_lo = utils.sum64_lo; + var sum64_4_hi = utils.sum64_4_hi; + var sum64_4_lo = utils.sum64_4_lo; + var sum64_5_hi = utils.sum64_5_hi; + var sum64_5_lo = utils.sum64_5_lo; + var BlockHash = common3.BlockHash; + var sha512_K = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + function SHA512() { + if (!(this instanceof SHA512)) + return new SHA512(); + BlockHash.call(this); + this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209]; + this.k = sha512_K; + this.W = new Array(160); + } + utils.inherits(SHA512, BlockHash); + exports$N = SHA512; + SHA512.blockSize = 1024; + SHA512.outSize = 512; + SHA512.hmacStrength = 192; + SHA512.padLength = 128; + SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) { + var W5 = this.W; + for (var i7 = 0; i7 < 32; i7++) + W5[i7] = msg[start + i7]; + for (; i7 < W5.length; i7 += 2) { + var c0_hi = g1_512_hi(W5[i7 - 4], W5[i7 - 3]); + var c0_lo = g1_512_lo(W5[i7 - 4], W5[i7 - 3]); + var c1_hi = W5[i7 - 14]; + var c1_lo = W5[i7 - 13]; + var c2_hi = g0_512_hi(W5[i7 - 30], W5[i7 - 29]); + var c2_lo = g0_512_lo(W5[i7 - 30], W5[i7 - 29]); + var c3_hi = W5[i7 - 32]; + var c3_lo = W5[i7 - 31]; + W5[i7] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); + W5[i7 + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo); + } + }; + SHA512.prototype._update = function _update(msg, start) { + this._prepareBlock(msg, start); + var W5 = this.W; + var ah = this.h[0]; + var al = this.h[1]; + var bh = this.h[2]; + var bl = this.h[3]; + var ch = this.h[4]; + var cl = this.h[5]; + var dh = this.h[6]; + var dl = this.h[7]; + var eh = this.h[8]; + var el = this.h[9]; + var fh = this.h[10]; + var fl = this.h[11]; + var gh = this.h[12]; + var gl = this.h[13]; + var hh = this.h[14]; + var hl = this.h[15]; + assert4(this.k.length === W5.length); + for (var i7 = 0; i7 < W5.length; i7 += 2) { + var c0_hi = hh; + var c0_lo = hl; + var c1_hi = s1_512_hi(eh, el); + var c1_lo = s1_512_lo(eh, el); + var c2_hi = ch64_hi(eh, el, fh, fl, gh); + var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl); + var c3_hi = this.k[i7]; + var c3_lo = this.k[i7 + 1]; + var c4_hi = W5[i7]; + var c4_lo = W5[i7 + 1]; + var T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo); + var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo); + c0_hi = s0_512_hi(ah, al); + c0_lo = s0_512_lo(ah, al); + c1_hi = maj64_hi(ah, al, bh, bl, ch); + c1_lo = maj64_lo(ah, al, bh, bl, ch, cl); + var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo); + var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo); + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + eh = sum64_hi(dh, dl, T1_hi, T1_lo); + el = sum64_lo(dl, dl, T1_hi, T1_lo); + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo); + al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo); + } + sum64(this.h, 0, ah, al); + sum64(this.h, 2, bh, bl); + sum64(this.h, 4, ch, cl); + sum64(this.h, 6, dh, dl); + sum64(this.h, 8, eh, el); + sum64(this.h, 10, fh, fl); + sum64(this.h, 12, gh, gl); + sum64(this.h, 14, hh, hl); + }; + SHA512.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "big"); + else + return utils.split32(this.h, "big"); + }; + function ch64_hi(xh, xl, yh, yl, zh) { + var r8 = xh & yh ^ ~xh & zh; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function ch64_lo(xh, xl, yh, yl, zh, zl) { + var r8 = xl & yl ^ ~xl & zl; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function maj64_hi(xh, xl, yh, yl, zh) { + var r8 = xh & yh ^ xh & zh ^ yh & zh; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function maj64_lo(xh, xl, yh, yl, zh, zl) { + var r8 = xl & yl ^ xl & zl ^ yl & zl; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function s0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 28); + var c1_hi = rotr64_hi(xl, xh, 2); + var c2_hi = rotr64_hi(xl, xh, 7); + var r8 = c0_hi ^ c1_hi ^ c2_hi; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function s0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 28); + var c1_lo = rotr64_lo(xl, xh, 2); + var c2_lo = rotr64_lo(xl, xh, 7); + var r8 = c0_lo ^ c1_lo ^ c2_lo; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function s1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 14); + var c1_hi = rotr64_hi(xh, xl, 18); + var c2_hi = rotr64_hi(xl, xh, 9); + var r8 = c0_hi ^ c1_hi ^ c2_hi; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function s1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 14); + var c1_lo = rotr64_lo(xh, xl, 18); + var c2_lo = rotr64_lo(xl, xh, 9); + var r8 = c0_lo ^ c1_lo ^ c2_lo; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function g0_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 1); + var c1_hi = rotr64_hi(xh, xl, 8); + var c2_hi = shr64_hi(xh, xl, 7); + var r8 = c0_hi ^ c1_hi ^ c2_hi; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function g0_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 1); + var c1_lo = rotr64_lo(xh, xl, 8); + var c2_lo = shr64_lo(xh, xl, 7); + var r8 = c0_lo ^ c1_lo ^ c2_lo; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function g1_512_hi(xh, xl) { + var c0_hi = rotr64_hi(xh, xl, 19); + var c1_hi = rotr64_hi(xl, xh, 29); + var c2_hi = shr64_hi(xh, xl, 6); + var r8 = c0_hi ^ c1_hi ^ c2_hi; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + function g1_512_lo(xh, xl) { + var c0_lo = rotr64_lo(xh, xl, 19); + var c1_lo = rotr64_lo(xl, xh, 29); + var c2_lo = shr64_lo(xh, xl, 6); + var r8 = c0_lo ^ c1_lo ^ c2_lo; + if (r8 < 0) + r8 += 4294967296; + return r8; + } + return exports$N; +} +function dew$L() { + if (_dewExec$L) + return exports$M; + _dewExec$L = true; + var utils = dew$S(); + var SHA512 = dew$M(); + function SHA384() { + if (!(this instanceof SHA384)) + return new SHA384(); + SHA512.call(this); + this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]; + } + utils.inherits(SHA384, SHA512); + exports$M = SHA384; + SHA384.blockSize = 1024; + SHA384.outSize = 384; + SHA384.hmacStrength = 192; + SHA384.padLength = 128; + SHA384.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h.slice(0, 12), "big"); + else + return utils.split32(this.h.slice(0, 12), "big"); + }; + return exports$M; +} +function dew$K() { + if (_dewExec$K) + return exports$L; + _dewExec$K = true; + exports$L.sha1 = dew$P(); + exports$L.sha224 = dew$N(); + exports$L.sha256 = dew$O(); + exports$L.sha384 = dew$L(); + exports$L.sha512 = dew$M(); + return exports$L; +} +function dew$J() { + if (_dewExec$J) + return exports$K; + _dewExec$J = true; + var utils = dew$S(); + var common3 = dew$R(); + var rotl32 = utils.rotl32; + var sum32 = utils.sum32; + var sum32_3 = utils.sum32_3; + var sum32_4 = utils.sum32_4; + var BlockHash = common3.BlockHash; + function RIPEMD160() { + if (!(this instanceof RIPEMD160)) + return new RIPEMD160(); + BlockHash.call(this); + this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]; + this.endian = "little"; + } + utils.inherits(RIPEMD160, BlockHash); + exports$K.ripemd160 = RIPEMD160; + RIPEMD160.blockSize = 512; + RIPEMD160.outSize = 160; + RIPEMD160.hmacStrength = 192; + RIPEMD160.padLength = 64; + RIPEMD160.prototype._update = function update2(msg, start) { + var A6 = this.h[0]; + var B6 = this.h[1]; + var C6 = this.h[2]; + var D6 = this.h[3]; + var E6 = this.h[4]; + var Ah = A6; + var Bh = B6; + var Ch = C6; + var Dh = D6; + var Eh = E6; + for (var j6 = 0; j6 < 80; j6++) { + var T6 = sum32(rotl32(sum32_4(A6, f8(j6, B6, C6, D6), msg[r8[j6] + start], K5(j6)), s7[j6]), E6); + A6 = E6; + E6 = D6; + D6 = rotl32(C6, 10); + C6 = B6; + B6 = T6; + T6 = sum32(rotl32(sum32_4(Ah, f8(79 - j6, Bh, Ch, Dh), msg[rh[j6] + start], Kh(j6)), sh[j6]), Eh); + Ah = Eh; + Eh = Dh; + Dh = rotl32(Ch, 10); + Ch = Bh; + Bh = T6; + } + T6 = sum32_3(this.h[1], C6, Dh); + this.h[1] = sum32_3(this.h[2], D6, Eh); + this.h[2] = sum32_3(this.h[3], E6, Ah); + this.h[3] = sum32_3(this.h[4], A6, Bh); + this.h[4] = sum32_3(this.h[0], B6, Ch); + this.h[0] = T6; + }; + RIPEMD160.prototype._digest = function digest(enc) { + if (enc === "hex") + return utils.toHex32(this.h, "little"); + else + return utils.split32(this.h, "little"); + }; + function f8(j6, x7, y7, z6) { + if (j6 <= 15) + return x7 ^ y7 ^ z6; + else if (j6 <= 31) + return x7 & y7 | ~x7 & z6; + else if (j6 <= 47) + return (x7 | ~y7) ^ z6; + else if (j6 <= 63) + return x7 & z6 | y7 & ~z6; + else + return x7 ^ (y7 | ~z6); + } + function K5(j6) { + if (j6 <= 15) + return 0; + else if (j6 <= 31) + return 1518500249; + else if (j6 <= 47) + return 1859775393; + else if (j6 <= 63) + return 2400959708; + else + return 2840853838; + } + function Kh(j6) { + if (j6 <= 15) + return 1352829926; + else if (j6 <= 31) + return 1548603684; + else if (j6 <= 47) + return 1836072691; + else if (j6 <= 63) + return 2053994217; + else + return 0; + } + var r8 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + var rh = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + var s7 = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + var sh = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + return exports$K; +} +function dew$I() { + if (_dewExec$I) + return exports$J; + _dewExec$I = true; + var utils = dew$S(); + var assert4 = dew$3h(); + function Hmac2(hash, key, enc) { + if (!(this instanceof Hmac2)) + return new Hmac2(hash, key, enc); + this.Hash = hash; + this.blockSize = hash.blockSize / 8; + this.outSize = hash.outSize / 8; + this.inner = null; + this.outer = null; + this._init(utils.toArray(key, enc)); + } + exports$J = Hmac2; + Hmac2.prototype._init = function init2(key) { + if (key.length > this.blockSize) + key = new this.Hash().update(key).digest(); + assert4(key.length <= this.blockSize); + for (var i7 = key.length; i7 < this.blockSize; i7++) + key.push(0); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 54; + this.inner = new this.Hash().update(key); + for (i7 = 0; i7 < key.length; i7++) + key[i7] ^= 106; + this.outer = new this.Hash().update(key); + }; + Hmac2.prototype.update = function update2(msg, enc) { + this.inner.update(msg, enc); + return this; + }; + Hmac2.prototype.digest = function digest(enc) { + this.outer.update(this.inner.digest()); + return this.outer.digest(enc); + }; + return exports$J; +} +function dew$H() { + if (_dewExec$H) + return exports$I; + _dewExec$H = true; + var hash = exports$I; + hash.utils = dew$S(); + hash.common = dew$R(); + hash.sha = dew$K(); + hash.ripemd = dew$J(); + hash.hmac = dew$I(); + hash.sha1 = hash.sha.sha1; + hash.sha256 = hash.sha.sha256; + hash.sha224 = hash.sha.sha224; + hash.sha384 = hash.sha.sha384; + hash.sha512 = hash.sha.sha512; + hash.ripemd160 = hash.ripemd.ripemd160; + return exports$I; +} +function dew$G() { + if (_dewExec$G) + return exports$H; + _dewExec$G = true; + exports$H = { + doubles: { + step: 4, + points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] + }, + naf: { + wnd: 7, + points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] + } + }; + return exports$H; +} +function dew$F() { + if (_dewExec$F) + return exports$G; + _dewExec$F = true; + var curves = exports$G; + var hash = dew$H(); + var curve = dew$T(); + var utils = dew$Y(); + var assert4 = utils.assert; + function PresetCurve(options) { + if (options.type === "short") + this.curve = new curve.short(options); + else if (options.type === "edwards") + this.curve = new curve.edwards(options); + else + this.curve = new curve.mont(options); + this.g = this.curve.g; + this.n = this.curve.n; + this.hash = options.hash; + assert4(this.g.validate(), "Invalid curve"); + assert4(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O"); + } + curves.PresetCurve = PresetCurve; + function defineCurve(name2, options) { + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + get: function() { + var curve2 = new PresetCurve(options); + Object.defineProperty(curves, name2, { + configurable: true, + enumerable: true, + value: curve2 + }); + return curve2; + } + }); + } + defineCurve("p192", { + type: "short", + prime: "p192", + p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", + b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", + n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", + hash: hash.sha256, + gRed: false, + g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] + }); + defineCurve("p224", { + type: "short", + prime: "p224", + p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", + a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", + b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", + n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", + hash: hash.sha256, + gRed: false, + g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] + }); + defineCurve("p256", { + type: "short", + prime: null, + p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", + a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", + b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", + n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", + hash: hash.sha256, + gRed: false, + g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] + }); + defineCurve("p384", { + type: "short", + prime: null, + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", + a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", + b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", + n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", + hash: hash.sha384, + gRed: false, + g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"] + }); + defineCurve("p521", { + type: "short", + prime: null, + p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", + a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", + b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", + n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", + hash: hash.sha512, + gRed: false, + g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"] + }); + defineCurve("curve25519", { + type: "mont", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "76d06", + b: "1", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: ["9"] + }); + defineCurve("ed25519", { + type: "edwards", + prime: "p25519", + p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", + a: "-1", + c: "1", + // -121665 * (121666^(-1)) (mod P) + d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", + n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", + hash: hash.sha256, + gRed: false, + g: [ + "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", + // 4/5 + "6666666666666666666666666666666666666666666666666666666666666658" + ] + }); + var pre; + try { + pre = dew$G(); + } catch (e10) { + pre = void 0; + } + defineCurve("secp256k1", { + type: "short", + prime: "k256", + p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", + a: "0", + b: "7", + n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", + h: "1", + hash: hash.sha256, + // Precomputed endomorphism + beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", + lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", + basis: [{ + a: "3086d221a7d46bcde86c90e49284eb15", + b: "-e4437ed6010e88286f547fa90abfe4c3" + }, { + a: "114ca50f7a8e2f3f657c1108d9d44cfd8", + b: "3086d221a7d46bcde86c90e49284eb15" + }], + gRed: false, + g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", pre] + }); + return exports$G; +} +function dew$E() { + if (_dewExec$E) + return exports$F; + _dewExec$E = true; + var hash = dew$H(); + var utils = dew$Z(); + var assert4 = dew$3h(); + function HmacDRBG(options) { + if (!(this instanceof HmacDRBG)) + return new HmacDRBG(options); + this.hash = options.hash; + this.predResist = !!options.predResist; + this.outLen = this.hash.outSize; + this.minEntropy = options.minEntropy || this.hash.hmacStrength; + this._reseed = null; + this.reseedInterval = null; + this.K = null; + this.V = null; + var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex"); + var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex"); + var pers = utils.toArray(options.pers, options.persEnc || "hex"); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._init(entropy, nonce, pers); + } + exports$F = HmacDRBG; + HmacDRBG.prototype._init = function init2(entropy, nonce, pers) { + var seed = entropy.concat(nonce).concat(pers); + this.K = new Array(this.outLen / 8); + this.V = new Array(this.outLen / 8); + for (var i7 = 0; i7 < this.V.length; i7++) { + this.K[i7] = 0; + this.V[i7] = 1; + } + this._update(seed); + this._reseed = 1; + this.reseedInterval = 281474976710656; + }; + HmacDRBG.prototype._hmac = function hmac() { + return new hash.hmac(this.hash, this.K); + }; + HmacDRBG.prototype._update = function update2(seed) { + var kmac = this._hmac().update(this.V).update([0]); + if (seed) + kmac = kmac.update(seed); + this.K = kmac.digest(); + this.V = this._hmac().update(this.V).digest(); + if (!seed) + return; + this.K = this._hmac().update(this.V).update([1]).update(seed).digest(); + this.V = this._hmac().update(this.V).digest(); + }; + HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add2, addEnc) { + if (typeof entropyEnc !== "string") { + addEnc = add2; + add2 = entropyEnc; + entropyEnc = null; + } + entropy = utils.toArray(entropy, entropyEnc); + add2 = utils.toArray(add2, addEnc); + assert4(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"); + this._update(entropy.concat(add2 || [])); + this._reseed = 1; + }; + HmacDRBG.prototype.generate = function generate2(len, enc, add2, addEnc) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + if (typeof enc !== "string") { + addEnc = add2; + add2 = enc; + enc = null; + } + if (add2) { + add2 = utils.toArray(add2, addEnc || "hex"); + this._update(add2); + } + var temp = []; + while (temp.length < len) { + this.V = this._hmac().update(this.V).digest(); + temp = temp.concat(this.V); + } + var res = temp.slice(0, len); + this._update(add2); + this._reseed++; + return utils.encode(res, enc); + }; + return exports$F; +} +function dew$D() { + if (_dewExec$D) + return exports$E; + _dewExec$D = true; + var BN = dew$_(); + var utils = dew$Y(); + var assert4 = utils.assert; + function KeyPair(ec, options) { + this.ec = ec; + this.priv = null; + this.pub = null; + if (options.priv) + this._importPrivate(options.priv, options.privEnc); + if (options.pub) + this._importPublic(options.pub, options.pubEnc); + } + exports$E = KeyPair; + KeyPair.fromPublic = function fromPublic(ec, pub, enc) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(ec, { + pub, + pubEnc: enc + }); + }; + KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) { + if (priv instanceof KeyPair) + return priv; + return new KeyPair(ec, { + priv, + privEnc: enc + }); + }; + KeyPair.prototype.validate = function validate15() { + var pub = this.getPublic(); + if (pub.isInfinity()) + return { + result: false, + reason: "Invalid public key" + }; + if (!pub.validate()) + return { + result: false, + reason: "Public key is not a point" + }; + if (!pub.mul(this.ec.curve.n).isInfinity()) + return { + result: false, + reason: "Public key * N != O" + }; + return { + result: true, + reason: null + }; + }; + KeyPair.prototype.getPublic = function getPublic(compact2, enc) { + if (typeof compact2 === "string") { + enc = compact2; + compact2 = null; + } + if (!this.pub) + this.pub = this.ec.g.mul(this.priv); + if (!enc) + return this.pub; + return this.pub.encode(enc, compact2); + }; + KeyPair.prototype.getPrivate = function getPrivate(enc) { + if (enc === "hex") + return this.priv.toString(16, 2); + else + return this.priv; + }; + KeyPair.prototype._importPrivate = function _importPrivate(key, enc) { + this.priv = new BN(key, enc || 16); + this.priv = this.priv.umod(this.ec.curve.n); + }; + KeyPair.prototype._importPublic = function _importPublic(key, enc) { + if (key.x || key.y) { + if (this.ec.curve.type === "mont") { + assert4(key.x, "Need x coordinate"); + } else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") { + assert4(key.x && key.y, "Need both x and y coordinate"); + } + this.pub = this.ec.curve.point(key.x, key.y); + return; + } + this.pub = this.ec.curve.decodePoint(key, enc); + }; + KeyPair.prototype.derive = function derive(pub) { + if (!pub.validate()) { + assert4(pub.validate(), "public point not validated"); + } + return pub.mul(this.priv).getX(); + }; + KeyPair.prototype.sign = function sign(msg, enc, options) { + return this.ec.sign(msg, this, enc, options); + }; + KeyPair.prototype.verify = function verify(msg, signature) { + return this.ec.verify(msg, signature, this); + }; + KeyPair.prototype.inspect = function inspect2() { + return ""; + }; + return exports$E; +} +function dew$C() { + if (_dewExec$C) + return exports$D; + _dewExec$C = true; + var BN = dew$_(); + var utils = dew$Y(); + var assert4 = utils.assert; + function Signature(options, enc) { + if (options instanceof Signature) + return options; + if (this._importDER(options, enc)) + return; + assert4(options.r && options.s, "Signature without r or s"); + this.r = new BN(options.r, 16); + this.s = new BN(options.s, 16); + if (options.recoveryParam === void 0) + this.recoveryParam = null; + else + this.recoveryParam = options.recoveryParam; + } + exports$D = Signature; + function Position() { + this.place = 0; + } + function getLength(buf, p7) { + var initial2 = buf[p7.place++]; + if (!(initial2 & 128)) { + return initial2; + } + var octetLen = initial2 & 15; + if (octetLen === 0 || octetLen > 4) { + return false; + } + if (buf[p7.place] === 0) { + return false; + } + var val = 0; + for (var i7 = 0, off3 = p7.place; i7 < octetLen; i7++, off3++) { + val <<= 8; + val |= buf[off3]; + val >>>= 0; + } + if (val <= 127) { + return false; + } + p7.place = off3; + return val; + } + function rmPadding(buf) { + var i7 = 0; + var len = buf.length - 1; + while (!buf[i7] && !(buf[i7 + 1] & 128) && i7 < len) { + i7++; + } + if (i7 === 0) { + return buf; + } + return buf.slice(i7); + } + Signature.prototype._importDER = function _importDER(data, enc) { + data = utils.toArray(data, enc); + var p7 = new Position(); + if (data[p7.place++] !== 48) { + return false; + } + var len = getLength(data, p7); + if (len === false) { + return false; + } + if (len + p7.place !== data.length) { + return false; + } + if (data[p7.place++] !== 2) { + return false; + } + var rlen = getLength(data, p7); + if (rlen === false) { + return false; + } + if ((data[p7.place] & 128) !== 0) { + return false; + } + var r8 = data.slice(p7.place, rlen + p7.place); + p7.place += rlen; + if (data[p7.place++] !== 2) { + return false; + } + var slen = getLength(data, p7); + if (slen === false) { + return false; + } + if (data.length !== slen + p7.place) { + return false; + } + if ((data[p7.place] & 128) !== 0) { + return false; + } + var s7 = data.slice(p7.place, slen + p7.place); + if (r8[0] === 0) { + if (r8[1] & 128) { + r8 = r8.slice(1); + } else { + return false; + } + } + if (s7[0] === 0) { + if (s7[1] & 128) { + s7 = s7.slice(1); + } else { + return false; + } + } + this.r = new BN(r8); + this.s = new BN(s7); + this.recoveryParam = null; + return true; + }; + function constructLength(arr, len) { + if (len < 128) { + arr.push(len); + return; + } + var octets = 1 + (Math.log(len) / Math.LN2 >>> 3); + arr.push(octets | 128); + while (--octets) { + arr.push(len >>> (octets << 3) & 255); + } + arr.push(len); + } + Signature.prototype.toDER = function toDER(enc) { + var r8 = this.r.toArray(); + var s7 = this.s.toArray(); + if (r8[0] & 128) + r8 = [0].concat(r8); + if (s7[0] & 128) + s7 = [0].concat(s7); + r8 = rmPadding(r8); + s7 = rmPadding(s7); + while (!s7[0] && !(s7[1] & 128)) { + s7 = s7.slice(1); + } + var arr = [2]; + constructLength(arr, r8.length); + arr = arr.concat(r8); + arr.push(2); + constructLength(arr, s7.length); + var backHalf = arr.concat(s7); + var res = [48]; + constructLength(res, backHalf.length); + res = res.concat(backHalf); + return utils.encode(res, enc); + }; + return exports$D; +} +function dew$B() { + if (_dewExec$B) + return exports$C; + _dewExec$B = true; + var BN = dew$_(); + var HmacDRBG = dew$E(); + var utils = dew$Y(); + var curves = dew$F(); + var rand = dew$1i(); + var assert4 = utils.assert; + var KeyPair = dew$D(); + var Signature = dew$C(); + function EC(options) { + if (!(this instanceof EC)) + return new EC(options); + if (typeof options === "string") { + assert4(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options); + options = curves[options]; + } + if (options instanceof curves.PresetCurve) + options = { + curve: options + }; + this.curve = options.curve.curve; + this.n = this.curve.n; + this.nh = this.n.ushrn(1); + this.g = this.curve.g; + this.g = options.curve.g; + this.g.precompute(options.curve.n.bitLength() + 1); + this.hash = options.hash || options.curve.hash; + } + exports$C = EC; + EC.prototype.keyPair = function keyPair(options) { + return new KeyPair(this, options); + }; + EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) { + return KeyPair.fromPrivate(this, priv, enc); + }; + EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) { + return KeyPair.fromPublic(this, pub, enc); + }; + EC.prototype.genKeyPair = function genKeyPair(options) { + if (!options) + options = {}; + var drbg = new HmacDRBG({ + hash: this.hash, + pers: options.pers, + persEnc: options.persEnc || "utf8", + entropy: options.entropy || rand(this.hash.hmacStrength), + entropyEnc: options.entropy && options.entropyEnc || "utf8", + nonce: this.n.toArray() + }); + var bytes = this.n.byteLength(); + var ns2 = this.n.sub(new BN(2)); + for (; ; ) { + var priv = new BN(drbg.generate(bytes)); + if (priv.cmp(ns2) > 0) + continue; + priv.iaddn(1); + return this.keyFromPrivate(priv); + } + }; + EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) { + var delta = msg.byteLength() * 8 - this.n.bitLength(); + if (delta > 0) + msg = msg.ushrn(delta); + if (!truncOnly && msg.cmp(this.n) >= 0) + return msg.sub(this.n); + else + return msg; + }; + EC.prototype.sign = function sign(msg, key, enc, options) { + if (typeof enc === "object") { + options = enc; + enc = null; + } + if (!options) + options = {}; + key = this.keyFromPrivate(key, enc); + msg = this._truncateToN(new BN(msg, 16)); + var bytes = this.n.byteLength(); + var bkey = key.getPrivate().toArray("be", bytes); + var nonce = msg.toArray("be", bytes); + var drbg = new HmacDRBG({ + hash: this.hash, + entropy: bkey, + nonce, + pers: options.pers, + persEnc: options.persEnc || "utf8" + }); + var ns1 = this.n.sub(new BN(1)); + for (var iter = 0; ; iter++) { + var k6 = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength())); + k6 = this._truncateToN(k6, true); + if (k6.cmpn(1) <= 0 || k6.cmp(ns1) >= 0) + continue; + var kp = this.g.mul(k6); + if (kp.isInfinity()) + continue; + var kpX = kp.getX(); + var r8 = kpX.umod(this.n); + if (r8.cmpn(0) === 0) + continue; + var s7 = k6.invm(this.n).mul(r8.mul(key.getPrivate()).iadd(msg)); + s7 = s7.umod(this.n); + if (s7.cmpn(0) === 0) + continue; + var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r8) !== 0 ? 2 : 0); + if (options.canonical && s7.cmp(this.nh) > 0) { + s7 = this.n.sub(s7); + recoveryParam ^= 1; + } + return new Signature({ + r: r8, + s: s7, + recoveryParam + }); + } + }; + EC.prototype.verify = function verify(msg, signature, key, enc) { + msg = this._truncateToN(new BN(msg, 16)); + key = this.keyFromPublic(key, enc); + signature = new Signature(signature, "hex"); + var r8 = signature.r; + var s7 = signature.s; + if (r8.cmpn(1) < 0 || r8.cmp(this.n) >= 0) + return false; + if (s7.cmpn(1) < 0 || s7.cmp(this.n) >= 0) + return false; + var sinv = s7.invm(this.n); + var u1 = sinv.mul(msg).umod(this.n); + var u22 = sinv.mul(r8).umod(this.n); + var p7; + if (!this.curve._maxwellTrick) { + p7 = this.g.mulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.getX().umod(this.n).cmp(r8) === 0; + } + p7 = this.g.jmulAdd(u1, key.getPublic(), u22); + if (p7.isInfinity()) + return false; + return p7.eqXToP(r8); + }; + EC.prototype.recoverPubKey = function(msg, signature, j6, enc) { + assert4((3 & j6) === j6, "The recovery param is more than two bits"); + signature = new Signature(signature, enc); + var n7 = this.n; + var e10 = new BN(msg); + var r8 = signature.r; + var s7 = signature.s; + var isYOdd = j6 & 1; + var isSecondKey = j6 >> 1; + if (r8.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) + throw new Error("Unable to find sencond key candinate"); + if (isSecondKey) + r8 = this.curve.pointFromX(r8.add(this.curve.n), isYOdd); + else + r8 = this.curve.pointFromX(r8, isYOdd); + var rInv = signature.r.invm(n7); + var s1 = n7.sub(e10).mul(rInv).umod(n7); + var s22 = s7.mul(rInv).umod(n7); + return this.g.mulAdd(s1, r8, s22); + }; + EC.prototype.getKeyRecoveryParam = function(e10, signature, Q5, enc) { + signature = new Signature(signature, enc); + if (signature.recoveryParam !== null) + return signature.recoveryParam; + for (var i7 = 0; i7 < 4; i7++) { + var Qprime; + try { + Qprime = this.recoverPubKey(e10, signature, i7); + } catch (e11) { + continue; + } + if (Qprime.eq(Q5)) + return i7; + } + throw new Error("Unable to find valid recovery factor"); + }; + return exports$C; +} +function dew$A() { + if (_dewExec$A) + return exports$B; + _dewExec$A = true; + var utils = dew$Y(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var cachedProperty = utils.cachedProperty; + function KeyPair(eddsa, params) { + this.eddsa = eddsa; + this._secret = parseBytes(params.secret); + if (eddsa.isPoint(params.pub)) + this._pub = params.pub; + else + this._pubBytes = parseBytes(params.pub); + } + KeyPair.fromPublic = function fromPublic(eddsa, pub) { + if (pub instanceof KeyPair) + return pub; + return new KeyPair(eddsa, { + pub + }); + }; + KeyPair.fromSecret = function fromSecret(eddsa, secret) { + if (secret instanceof KeyPair) + return secret; + return new KeyPair(eddsa, { + secret + }); + }; + KeyPair.prototype.secret = function secret() { + return this._secret; + }; + cachedProperty(KeyPair, "pubBytes", function pubBytes() { + return this.eddsa.encodePoint(this.pub()); + }); + cachedProperty(KeyPair, "pub", function pub() { + if (this._pubBytes) + return this.eddsa.decodePoint(this._pubBytes); + return this.eddsa.g.mul(this.priv()); + }); + cachedProperty(KeyPair, "privBytes", function privBytes() { + var eddsa = this.eddsa; + var hash = this.hash(); + var lastIx = eddsa.encodingLength - 1; + var a7 = hash.slice(0, eddsa.encodingLength); + a7[0] &= 248; + a7[lastIx] &= 127; + a7[lastIx] |= 64; + return a7; + }); + cachedProperty(KeyPair, "priv", function priv() { + return this.eddsa.decodeInt(this.privBytes()); + }); + cachedProperty(KeyPair, "hash", function hash() { + return this.eddsa.hash().update(this.secret()).digest(); + }); + cachedProperty(KeyPair, "messagePrefix", function messagePrefix() { + return this.hash().slice(this.eddsa.encodingLength); + }); + KeyPair.prototype.sign = function sign(message) { + assert4(this._secret, "KeyPair can only verify"); + return this.eddsa.sign(message, this); + }; + KeyPair.prototype.verify = function verify(message, sig) { + return this.eddsa.verify(message, sig, this); + }; + KeyPair.prototype.getSecret = function getSecret(enc) { + assert4(this._secret, "KeyPair is public only"); + return utils.encode(this.secret(), enc); + }; + KeyPair.prototype.getPublic = function getPublic(enc) { + return utils.encode(this.pubBytes(), enc); + }; + exports$B = KeyPair; + return exports$B; +} +function dew$z() { + if (_dewExec$z) + return exports$A; + _dewExec$z = true; + var BN = dew$_(); + var utils = dew$Y(); + var assert4 = utils.assert; + var cachedProperty = utils.cachedProperty; + var parseBytes = utils.parseBytes; + function Signature(eddsa, sig) { + this.eddsa = eddsa; + if (typeof sig !== "object") + sig = parseBytes(sig); + if (Array.isArray(sig)) { + assert4(sig.length === eddsa.encodingLength * 2, "Signature has invalid size"); + sig = { + R: sig.slice(0, eddsa.encodingLength), + S: sig.slice(eddsa.encodingLength) + }; + } + assert4(sig.R && sig.S, "Signature without R or S"); + if (eddsa.isPoint(sig.R)) + this._R = sig.R; + if (sig.S instanceof BN) + this._S = sig.S; + this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded; + this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded; + } + cachedProperty(Signature, "S", function S6() { + return this.eddsa.decodeInt(this.Sencoded()); + }); + cachedProperty(Signature, "R", function R6() { + return this.eddsa.decodePoint(this.Rencoded()); + }); + cachedProperty(Signature, "Rencoded", function Rencoded() { + return this.eddsa.encodePoint(this.R()); + }); + cachedProperty(Signature, "Sencoded", function Sencoded() { + return this.eddsa.encodeInt(this.S()); + }); + Signature.prototype.toBytes = function toBytes() { + return this.Rencoded().concat(this.Sencoded()); + }; + Signature.prototype.toHex = function toHex() { + return utils.encode(this.toBytes(), "hex").toUpperCase(); + }; + exports$A = Signature; + return exports$A; +} +function dew$y() { + if (_dewExec$y) + return exports$z; + _dewExec$y = true; + var hash = dew$H(); + var curves = dew$F(); + var utils = dew$Y(); + var assert4 = utils.assert; + var parseBytes = utils.parseBytes; + var KeyPair = dew$A(); + var Signature = dew$z(); + function EDDSA(curve) { + assert4(curve === "ed25519", "only tested with ed25519 so far"); + if (!(this instanceof EDDSA)) + return new EDDSA(curve); + curve = curves[curve].curve; + this.curve = curve; + this.g = curve.g; + this.g.precompute(curve.n.bitLength() + 1); + this.pointClass = curve.point().constructor; + this.encodingLength = Math.ceil(curve.n.bitLength() / 8); + this.hash = hash.sha512; + } + exports$z = EDDSA; + EDDSA.prototype.sign = function sign(message, secret) { + message = parseBytes(message); + var key = this.keyFromSecret(secret); + var r8 = this.hashInt(key.messagePrefix(), message); + var R6 = this.g.mul(r8); + var Rencoded = this.encodePoint(R6); + var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv()); + var S6 = r8.add(s_).umod(this.curve.n); + return this.makeSignature({ + R: R6, + S: S6, + Rencoded + }); + }; + EDDSA.prototype.verify = function verify(message, sig, pub) { + message = parseBytes(message); + sig = this.makeSignature(sig); + if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) { + return false; + } + var key = this.keyFromPublic(pub); + var h8 = this.hashInt(sig.Rencoded(), key.pubBytes(), message); + var SG = this.g.mul(sig.S()); + var RplusAh = sig.R().add(key.pub().mul(h8)); + return RplusAh.eq(SG); + }; + EDDSA.prototype.hashInt = function hashInt() { + var hash2 = this.hash(); + for (var i7 = 0; i7 < arguments.length; i7++) + hash2.update(arguments[i7]); + return utils.intFromLE(hash2.digest()).umod(this.curve.n); + }; + EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) { + return KeyPair.fromPublic(this, pub); + }; + EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) { + return KeyPair.fromSecret(this, secret); + }; + EDDSA.prototype.makeSignature = function makeSignature(sig) { + if (sig instanceof Signature) + return sig; + return new Signature(this, sig); + }; + EDDSA.prototype.encodePoint = function encodePoint(point) { + var enc = point.getY().toArray("le", this.encodingLength); + enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0; + return enc; + }; + EDDSA.prototype.decodePoint = function decodePoint(bytes) { + bytes = utils.parseBytes(bytes); + var lastIx = bytes.length - 1; + var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~128); + var xIsOdd = (bytes[lastIx] & 128) !== 0; + var y7 = utils.intFromLE(normed); + return this.curve.pointFromY(y7, xIsOdd); + }; + EDDSA.prototype.encodeInt = function encodeInt(num) { + return num.toArray("le", this.encodingLength); + }; + EDDSA.prototype.decodeInt = function decodeInt(bytes) { + return utils.intFromLE(bytes); + }; + EDDSA.prototype.isPoint = function isPoint(val) { + return val instanceof this.pointClass; + }; + return exports$z; +} +function dew$x() { + if (_dewExec$x) + return exports$y; + _dewExec$x = true; + var elliptic = exports$y; + elliptic.version = _package.version; + elliptic.utils = dew$Y(); + elliptic.rand = dew$1i(); + elliptic.curve = dew$T(); + elliptic.curves = dew$F(); + elliptic.ec = dew$B(); + elliptic.eddsa = dew$y(); + return exports$y; +} +function dew$w() { + if (_dewExec$w) + return module$2.exports; + _dewExec$w = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$c).negative = 0; + (this || _global$c).words = null; + (this || _global$c).length = 0; + (this || _global$c).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$c).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$c).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$c).words = [number & 67108863]; + (this || _global$c).length = 1; + } else if (number < 4503599627370496) { + (this || _global$c).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$c).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$c).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$c).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$c).words = [0]; + (this || _global$c).length = 1; + return this || _global$c; + } + (this || _global$c).length = Math.ceil(number.length / 3); + (this || _global$c).words = new Array((this || _global$c).length); + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + (this || _global$c).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$c).words[j6] |= w6 << off3 & 67108863; + (this || _global$c).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$c).words[j6] |= w6 << off3 & 67108863; + (this || _global$c).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$c).length = Math.ceil((number.length - start) / 6); + (this || _global$c).words = new Array((this || _global$c).length); + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + (this || _global$c).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$c).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$c).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$c).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$c).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$c).words = [0]; + (this || _global$c).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$c).words[0] + word < 67108864) { + (this || _global$c).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$c).words[0] + word < 67108864) { + (this || _global$c).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$c).length); + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + dest.words[i7] = (this || _global$c).words[i7]; + } + dest.length = (this || _global$c).length; + dest.negative = (this || _global$c).negative; + dest.red = (this || _global$c).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$c).length < size2) { + (this || _global$c).words[(this || _global$c).length++] = 0; + } + return this || _global$c; + }; + BN.prototype.strip = function strip() { + while ((this || _global$c).length > 1 && (this || _global$c).words[(this || _global$c).length - 1] === 0) { + (this || _global$c).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$c).length === 1 && (this || _global$c).words[0] === 0) { + (this || _global$c).negative = 0; + } + return this || _global$c; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$c).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + var w6 = (this || _global$c).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$c).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$c).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$c).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$c).words[0]; + if ((this || _global$c).length === 2) { + ret += (this || _global$c).words[1] * 67108864; + } else if ((this || _global$c).length === 3 && (this || _global$c).words[2] === 1) { + ret += 4503599627370496 + (this || _global$c).words[1] * 67108864; + } else if ((this || _global$c).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$c).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$c).words[(this || _global$c).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$c).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + var b8 = this._zeroBits((this || _global$c).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$c).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$c).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$c).negative ^= 1; + } + return this || _global$c; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$c).length < num.length) { + (this || _global$c).words[(this || _global$c).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$c).words[i7] = (this || _global$c).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$c).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$c).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$c); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$c).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$c); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$c).length > num.length) { + b8 = num; + } else { + b8 = this || _global$c; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$c).words[i7] = (this || _global$c).words[i7] & num.words[i7]; + } + (this || _global$c).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$c).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$c).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$c); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$c).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$c); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$c).length > num.length) { + a7 = this || _global$c; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$c).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$c) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$c).words[i7] = a7.words[i7]; + } + } + (this || _global$c).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$c).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$c).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$c); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$c).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$c); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$c).words[i7] = ~(this || _global$c).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$c).words[i7] = ~(this || _global$c).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$c).words[off3] = (this || _global$c).words[off3] | 1 << wbit; + } else { + (this || _global$c).words[off3] = (this || _global$c).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$c).negative !== 0 && num.negative === 0) { + (this || _global$c).negative = 0; + r8 = this.isub(num); + (this || _global$c).negative ^= 1; + return this._normSign(); + } else if ((this || _global$c).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$c).length > num.length) { + a7 = this || _global$c; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$c).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$c).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$c).length = a7.length; + if (carry !== 0) { + (this || _global$c).words[(this || _global$c).length] = carry; + (this || _global$c).length++; + } else if (a7 !== (this || _global$c)) { + for (; i7 < a7.length; i7++) { + (this || _global$c).words[i7] = a7.words[i7]; + } + } + return this || _global$c; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$c).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$c).negative !== 0) { + (this || _global$c).negative = 0; + res = num.sub(this || _global$c); + (this || _global$c).negative = 1; + return res; + } + if ((this || _global$c).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$c); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$c).negative !== 0) { + (this || _global$c).negative = 0; + this.iadd(num); + (this || _global$c).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$c).negative = 0; + (this || _global$c).length = 1; + (this || _global$c).words[0] = 0; + return this || _global$c; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$c; + b8 = num; + } else { + a7 = num; + b8 = this || _global$c; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$c).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$c).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$c)) { + for (; i7 < a7.length; i7++) { + (this || _global$c).words[i7] = a7.words[i7]; + } + } + (this || _global$c).length = Math.max((this || _global$c).length, i7); + if (a7 !== (this || _global$c)) { + (this || _global$c).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$c).length + num.length; + if ((this || _global$c).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$c, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$c, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$c, num, out); + } else { + res = jumboMulTo(this || _global$c, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$c).x = x7; + (this || _global$c).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$c).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$c).length + num.length); + return jumboMulTo(this || _global$c, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$c); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$c).length; i7++) { + var w6 = ((this || _global$c).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$c).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$c).words[i7] = carry; + (this || _global$c).length++; + } + return this || _global$c; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$c); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$c; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$c).length; i7++) { + var newCarry = (this || _global$c).words[i7] & carryMask; + var c7 = ((this || _global$c).words[i7] | 0) - newCarry << r8; + (this || _global$c).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$c).words[i7] = carry; + (this || _global$c).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$c).length - 1; i7 >= 0; i7--) { + (this || _global$c).words[i7 + s7] = (this || _global$c).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$c).words[i7] = 0; + } + (this || _global$c).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$c).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$c).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$c).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$c).length > s7) { + (this || _global$c).length -= s7; + for (i7 = 0; i7 < (this || _global$c).length; i7++) { + (this || _global$c).words[i7] = (this || _global$c).words[i7 + s7]; + } + } else { + (this || _global$c).words[0] = 0; + (this || _global$c).length = 1; + } + var carry = 0; + for (i7 = (this || _global$c).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$c).words[i7] | 0; + (this || _global$c).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$c).length === 0) { + (this || _global$c).words[0] = 0; + (this || _global$c).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$c).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$c).length <= s7) + return false; + var w6 = (this || _global$c).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$c).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$c).length <= s7) { + return this || _global$c; + } + if (r8 !== 0) { + s7++; + } + (this || _global$c).length = Math.min(s7, (this || _global$c).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$c).words[(this || _global$c).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$c).negative !== 0) { + if ((this || _global$c).length === 1 && ((this || _global$c).words[0] | 0) < num) { + (this || _global$c).words[0] = num - ((this || _global$c).words[0] | 0); + (this || _global$c).negative = 0; + return this || _global$c; + } + (this || _global$c).negative = 0; + this.isubn(num); + (this || _global$c).negative = 1; + return this || _global$c; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$c).words[0] += num; + for (var i7 = 0; i7 < (this || _global$c).length && (this || _global$c).words[i7] >= 67108864; i7++) { + (this || _global$c).words[i7] -= 67108864; + if (i7 === (this || _global$c).length - 1) { + (this || _global$c).words[i7 + 1] = 1; + } else { + (this || _global$c).words[i7 + 1]++; + } + } + (this || _global$c).length = Math.max((this || _global$c).length, i7 + 1); + return this || _global$c; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$c).negative !== 0) { + (this || _global$c).negative = 0; + this.iaddn(num); + (this || _global$c).negative = 1; + return this || _global$c; + } + (this || _global$c).words[0] -= num; + if ((this || _global$c).length === 1 && (this || _global$c).words[0] < 0) { + (this || _global$c).words[0] = -(this || _global$c).words[0]; + (this || _global$c).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$c).length && (this || _global$c).words[i7] < 0; i7++) { + (this || _global$c).words[i7] += 67108864; + (this || _global$c).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$c).negative = 0; + return this || _global$c; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$c).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$c).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$c).length - shift; i7++) { + w6 = ((this || _global$c).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$c).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$c).length; i7++) { + w6 = -((this || _global$c).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$c).words[i7] = w6 & 67108863; + } + (this || _global$c).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$c).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$c).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$c).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$c).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$c).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$c + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$c).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$c).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$c).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$c).words[i7] | 0) + carry * 67108864; + (this || _global$c).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$c; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$c; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$c).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$c).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$c).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$c).length <= s7) { + this._expand(s7 + 1); + (this || _global$c).words[s7] |= q5; + return this || _global$c; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$c).length; i7++) { + var w6 = (this || _global$c).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$c).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$c).words[i7] = carry; + (this || _global$c).length++; + } + return this || _global$c; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$c).length === 1 && (this || _global$c).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$c).negative !== 0 && !negative) + return -1; + if ((this || _global$c).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$c).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$c).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$c).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$c).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$c).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$c).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$c).length > num.length) + return 1; + if ((this || _global$c).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$c).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$c).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$c).red, "Already a number in reduction context"); + assert4((this || _global$c).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$c)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$c).red, "fromRed works only with numbers in reduction context"); + return (this || _global$c).red.convertFrom(this || _global$c); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$c).red = ctx; + return this || _global$c; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$c).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$c).red, "redAdd works only with red numbers"); + return (this || _global$c).red.add(this || _global$c, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$c).red, "redIAdd works only with red numbers"); + return (this || _global$c).red.iadd(this || _global$c, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$c).red, "redSub works only with red numbers"); + return (this || _global$c).red.sub(this || _global$c, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$c).red, "redISub works only with red numbers"); + return (this || _global$c).red.isub(this || _global$c, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$c).red, "redShl works only with red numbers"); + return (this || _global$c).red.shl(this || _global$c, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$c).red, "redMul works only with red numbers"); + (this || _global$c).red._verify2(this || _global$c, num); + return (this || _global$c).red.mul(this || _global$c, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$c).red, "redMul works only with red numbers"); + (this || _global$c).red._verify2(this || _global$c, num); + return (this || _global$c).red.imul(this || _global$c, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$c).red, "redSqr works only with red numbers"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.sqr(this || _global$c); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$c).red, "redISqr works only with red numbers"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.isqr(this || _global$c); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$c).red, "redSqrt works only with red numbers"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.sqrt(this || _global$c); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$c).red, "redInvm works only with red numbers"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.invm(this || _global$c); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$c).red, "redNeg works only with red numbers"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.neg(this || _global$c); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$c).red && !num.red, "redPow(normalNum)"); + (this || _global$c).red._verify1(this || _global$c); + return (this || _global$c).red.pow(this || _global$c, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$c).name = name2; + (this || _global$c).p = new BN(p7, 16); + (this || _global$c).n = (this || _global$c).p.bitLength(); + (this || _global$c).k = new BN(1).iushln((this || _global$c).n).isub((this || _global$c).p); + (this || _global$c).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$c).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$c).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$c).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$c).n); + var cmp = rlen < (this || _global$c).n ? -1 : r8.ucmp((this || _global$c).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$c).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$c).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$c).k); + }; + function K256() { + MPrime.call(this || _global$c, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$c, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$c, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$c, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$c).m = prime.p; + (this || _global$c).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$c).m = m7; + (this || _global$c).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$c).prime) + return (this || _global$c).prime.ireduce(a7)._forceRed(this || _global$c); + return a7.umod((this || _global$c).m)._forceRed(this || _global$c); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$c).m.sub(a7)._forceRed(this || _global$c); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$c).m) >= 0) { + res.isub((this || _global$c).m); + } + return res._forceRed(this || _global$c); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$c).m) >= 0) { + res.isub((this || _global$c).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$c).m); + } + return res._forceRed(this || _global$c); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$c).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$c).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$c).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$c).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$c); + var nOne = one.redNeg(); + var lpow = (this || _global$c).m.subn(1).iushrn(1); + var z6 = (this || _global$c).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$c); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$c).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$c); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$c); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$c).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$c, m7); + (this || _global$c).shift = (this || _global$c).m.bitLength(); + if ((this || _global$c).shift % 26 !== 0) { + (this || _global$c).shift += 26 - (this || _global$c).shift % 26; + } + (this || _global$c).r = new BN(1).iushln((this || _global$c).shift); + (this || _global$c).r2 = this.imod((this || _global$c).r.sqr()); + (this || _global$c).rinv = (this || _global$c).r._invmp((this || _global$c).m); + (this || _global$c).minv = (this || _global$c).rinv.mul((this || _global$c).r).isubn(1).div((this || _global$c).m); + (this || _global$c).minv = (this || _global$c).minv.umod((this || _global$c).r); + (this || _global$c).minv = (this || _global$c).r.sub((this || _global$c).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$c).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$c).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$c).shift).mul((this || _global$c).minv).imaskn((this || _global$c).shift).mul((this || _global$c).m); + var u7 = t8.isub(c7).iushrn((this || _global$c).shift); + var res = u7; + if (u7.cmp((this || _global$c).m) >= 0) { + res = u7.isub((this || _global$c).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$c).m); + } + return res._forceRed(this || _global$c); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$c); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$c).shift).mul((this || _global$c).minv).imaskn((this || _global$c).shift).mul((this || _global$c).m); + var u7 = t8.isub(c7).iushrn((this || _global$c).shift); + var res = u7; + if (u7.cmp((this || _global$c).m) >= 0) { + res = u7.isub((this || _global$c).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$c).m); + } + return res._forceRed(this || _global$c); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$c).m).mul((this || _global$c).r2)); + return res._forceRed(this || _global$c); + }; + })(module$2, exports$x); + return module$2.exports; +} +function dew$v() { + if (_dewExec$v) + return exports$w; + _dewExec$v = true; + var asn1 = dew$i2(); + var inherits2 = dew4(); + var api = exports$w; + api.define = function define2(name2, body) { + return new Entity(name2, body); + }; + function Entity(name2, body) { + (this || _global$b).name = name2; + (this || _global$b).body = body; + (this || _global$b).decoders = {}; + (this || _global$b).encoders = {}; + } + Entity.prototype._createNamed = function createNamed(base) { + var named; + try { + named = exports17.runInThisContext("(function " + (this || _global$b).name + "(entity) {\n this._initNamed(entity);\n})"); + } catch (e10) { + named = function(entity) { + this._initNamed(entity); + }; + } + inherits2(named, base); + named.prototype._initNamed = function initnamed(entity) { + base.call(this || _global$b, entity); + }; + return new named(this || _global$b); + }; + Entity.prototype._getDecoder = function _getDecoder(enc) { + enc = enc || "der"; + if (!(this || _global$b).decoders.hasOwnProperty(enc)) + (this || _global$b).decoders[enc] = this._createNamed(asn1.decoders[enc]); + return (this || _global$b).decoders[enc]; + }; + Entity.prototype.decode = function decode2(data, enc, options) { + return this._getDecoder(enc).decode(data, options); + }; + Entity.prototype._getEncoder = function _getEncoder(enc) { + enc = enc || "der"; + if (!(this || _global$b).encoders.hasOwnProperty(enc)) + (this || _global$b).encoders[enc] = this._createNamed(asn1.encoders[enc]); + return (this || _global$b).encoders[enc]; + }; + Entity.prototype.encode = function encode2(data, enc, reporter) { + return this._getEncoder(enc).encode(data, reporter); + }; + return exports$w; +} +function dew$u() { + if (_dewExec$u) + return exports$v; + _dewExec$u = true; + var inherits2 = dew4(); + function Reporter(options) { + (this || _global$a)._reporterState = { + obj: null, + path: [], + options: options || {}, + errors: [] + }; + } + exports$v.Reporter = Reporter; + Reporter.prototype.isError = function isError3(obj) { + return obj instanceof ReporterError; + }; + Reporter.prototype.save = function save() { + var state = (this || _global$a)._reporterState; + return { + obj: state.obj, + pathLen: state.path.length + }; + }; + Reporter.prototype.restore = function restore(data) { + var state = (this || _global$a)._reporterState; + state.obj = data.obj; + state.path = state.path.slice(0, data.pathLen); + }; + Reporter.prototype.enterKey = function enterKey(key) { + return (this || _global$a)._reporterState.path.push(key); + }; + Reporter.prototype.exitKey = function exitKey(index4) { + var state = (this || _global$a)._reporterState; + state.path = state.path.slice(0, index4 - 1); + }; + Reporter.prototype.leaveKey = function leaveKey(index4, key, value2) { + var state = (this || _global$a)._reporterState; + this.exitKey(index4); + if (state.obj !== null) + state.obj[key] = value2; + }; + Reporter.prototype.path = function path2() { + return (this || _global$a)._reporterState.path.join("/"); + }; + Reporter.prototype.enterObject = function enterObject() { + var state = (this || _global$a)._reporterState; + var prev = state.obj; + state.obj = {}; + return prev; + }; + Reporter.prototype.leaveObject = function leaveObject(prev) { + var state = (this || _global$a)._reporterState; + var now2 = state.obj; + state.obj = prev; + return now2; + }; + Reporter.prototype.error = function error2(msg) { + var err; + var state = (this || _global$a)._reporterState; + var inherited = msg instanceof ReporterError; + if (inherited) { + err = msg; + } else { + err = new ReporterError(state.path.map(function(elem) { + return "[" + JSON.stringify(elem) + "]"; + }).join(""), msg.message || msg, msg.stack); + } + if (!state.options.partial) + throw err; + if (!inherited) + state.errors.push(err); + return err; + }; + Reporter.prototype.wrapResult = function wrapResult(result2) { + var state = (this || _global$a)._reporterState; + if (!state.options.partial) + return result2; + return { + result: this.isError(result2) ? null : result2, + errors: state.errors + }; + }; + function ReporterError(path2, msg) { + (this || _global$a).path = path2; + this.rethrow(msg); + } + inherits2(ReporterError, Error); + ReporterError.prototype.rethrow = function rethrow(msg) { + (this || _global$a).message = msg + " at: " + ((this || _global$a).path || "(shallow)"); + if (Error.captureStackTrace) + Error.captureStackTrace(this || _global$a, ReporterError); + if (!(this || _global$a).stack) { + try { + throw new Error((this || _global$a).message); + } catch (e10) { + (this || _global$a).stack = e10.stack; + } + } + return this || _global$a; + }; + return exports$v; +} +function dew$t() { + if (_dewExec$t) + return exports$u; + _dewExec$t = true; + var inherits2 = dew4(); + var Reporter = dew$r().Reporter; + var Buffer4 = dew().Buffer; + function DecoderBuffer(base, options) { + Reporter.call(this || _global$9, options); + if (!Buffer4.isBuffer(base)) { + this.error("Input not Buffer"); + return; + } + (this || _global$9).base = base; + (this || _global$9).offset = 0; + (this || _global$9).length = base.length; + } + inherits2(DecoderBuffer, Reporter); + exports$u.DecoderBuffer = DecoderBuffer; + DecoderBuffer.prototype.save = function save() { + return { + offset: (this || _global$9).offset, + reporter: Reporter.prototype.save.call(this || _global$9) + }; + }; + DecoderBuffer.prototype.restore = function restore(save) { + var res = new DecoderBuffer((this || _global$9).base); + res.offset = save.offset; + res.length = (this || _global$9).offset; + (this || _global$9).offset = save.offset; + Reporter.prototype.restore.call(this || _global$9, save.reporter); + return res; + }; + DecoderBuffer.prototype.isEmpty = function isEmpty4() { + return (this || _global$9).offset === (this || _global$9).length; + }; + DecoderBuffer.prototype.readUInt8 = function readUInt8(fail2) { + if ((this || _global$9).offset + 1 <= (this || _global$9).length) + return (this || _global$9).base.readUInt8((this || _global$9).offset++, true); + else + return this.error(fail2 || "DecoderBuffer overrun"); + }; + DecoderBuffer.prototype.skip = function skip(bytes, fail2) { + if (!((this || _global$9).offset + bytes <= (this || _global$9).length)) + return this.error(fail2 || "DecoderBuffer overrun"); + var res = new DecoderBuffer((this || _global$9).base); + res._reporterState = (this || _global$9)._reporterState; + res.offset = (this || _global$9).offset; + res.length = (this || _global$9).offset + bytes; + (this || _global$9).offset += bytes; + return res; + }; + DecoderBuffer.prototype.raw = function raw(save) { + return (this || _global$9).base.slice(save ? save.offset : (this || _global$9).offset, (this || _global$9).length); + }; + function EncoderBuffer(value2, reporter) { + if (Array.isArray(value2)) { + (this || _global$9).length = 0; + (this || _global$9).value = value2.map(function(item) { + if (!(item instanceof EncoderBuffer)) + item = new EncoderBuffer(item, reporter); + (this || _global$9).length += item.length; + return item; + }, this || _global$9); + } else if (typeof value2 === "number") { + if (!(0 <= value2 && value2 <= 255)) + return reporter.error("non-byte EncoderBuffer value"); + (this || _global$9).value = value2; + (this || _global$9).length = 1; + } else if (typeof value2 === "string") { + (this || _global$9).value = value2; + (this || _global$9).length = Buffer4.byteLength(value2); + } else if (Buffer4.isBuffer(value2)) { + (this || _global$9).value = value2; + (this || _global$9).length = value2.length; + } else { + return reporter.error("Unsupported type: " + typeof value2); + } + } + exports$u.EncoderBuffer = EncoderBuffer; + EncoderBuffer.prototype.join = function join3(out, offset) { + if (!out) + out = new Buffer4((this || _global$9).length); + if (!offset) + offset = 0; + if ((this || _global$9).length === 0) + return out; + if (Array.isArray((this || _global$9).value)) { + (this || _global$9).value.forEach(function(item) { + item.join(out, offset); + offset += item.length; + }); + } else { + if (typeof (this || _global$9).value === "number") + out[offset] = (this || _global$9).value; + else if (typeof (this || _global$9).value === "string") + out.write((this || _global$9).value, offset); + else if (Buffer4.isBuffer((this || _global$9).value)) + (this || _global$9).value.copy(out, offset); + offset += (this || _global$9).length; + } + return out; + }; + return exports$u; +} +function dew$s() { + if (_dewExec$s) + return exports$t; + _dewExec$s = true; + var Reporter = dew$r().Reporter; + var EncoderBuffer = dew$r().EncoderBuffer; + var DecoderBuffer = dew$r().DecoderBuffer; + var assert4 = dew$3h(); + var tags6 = ["seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr"]; + var methods = ["key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains"].concat(tags6); + var overrided = ["_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool"]; + function Node(enc, parent2) { + var state = {}; + (this || _global$8)._baseState = state; + state.enc = enc; + state.parent = parent2 || null; + state.children = null; + state.tag = null; + state.args = null; + state.reverseArgs = null; + state.choice = null; + state.optional = false; + state.any = false; + state.obj = false; + state.use = null; + state.useDecoder = null; + state.key = null; + state["default"] = null; + state.explicit = null; + state.implicit = null; + state.contains = null; + if (!state.parent) { + state.children = []; + this._wrap(); + } + } + exports$t = Node; + var stateProps = ["enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains"]; + Node.prototype.clone = function clone2() { + var state = (this || _global$8)._baseState; + var cstate = {}; + stateProps.forEach(function(prop) { + cstate[prop] = state[prop]; + }); + var res = new (this || _global$8).constructor(cstate.parent); + res._baseState = cstate; + return res; + }; + Node.prototype._wrap = function wrap2() { + var state = (this || _global$8)._baseState; + methods.forEach(function(method2) { + (this || _global$8)[method2] = function _wrappedMethod() { + var clone2 = new (this || _global$8).constructor(this || _global$8); + state.children.push(clone2); + return clone2[method2].apply(clone2, arguments); + }; + }, this || _global$8); + }; + Node.prototype._init = function init2(body) { + var state = (this || _global$8)._baseState; + assert4(state.parent === null); + body.call(this || _global$8); + state.children = state.children.filter(function(child) { + return child._baseState.parent === (this || _global$8); + }, this || _global$8); + assert4.equal(state.children.length, 1, "Root node can have only one child"); + }; + Node.prototype._useArgs = function useArgs(args) { + var state = (this || _global$8)._baseState; + var children = args.filter(function(arg) { + return arg instanceof (this || _global$8).constructor; + }, this || _global$8); + args = args.filter(function(arg) { + return !(arg instanceof (this || _global$8).constructor); + }, this || _global$8); + if (children.length !== 0) { + assert4(state.children === null); + state.children = children; + children.forEach(function(child) { + child._baseState.parent = this || _global$8; + }, this || _global$8); + } + if (args.length !== 0) { + assert4(state.args === null); + state.args = args; + state.reverseArgs = args.map(function(arg) { + if (typeof arg !== "object" || arg.constructor !== Object) + return arg; + var res = {}; + Object.keys(arg).forEach(function(key) { + if (key == (key | 0)) + key |= 0; + var value2 = arg[key]; + res[value2] = key; + }); + return res; + }); + } + }; + overrided.forEach(function(method2) { + Node.prototype[method2] = function _overrided() { + var state = (this || _global$8)._baseState; + throw new Error(method2 + " not implemented for encoding: " + state.enc); + }; + }); + tags6.forEach(function(tag) { + Node.prototype[tag] = function _tagMethod() { + var state = (this || _global$8)._baseState; + var args = Array.prototype.slice.call(arguments); + assert4(state.tag === null); + state.tag = tag; + this._useArgs(args); + return this || _global$8; + }; + }); + Node.prototype.use = function use(item) { + assert4(item); + var state = (this || _global$8)._baseState; + assert4(state.use === null); + state.use = item; + return this || _global$8; + }; + Node.prototype.optional = function optional() { + var state = (this || _global$8)._baseState; + state.optional = true; + return this || _global$8; + }; + Node.prototype.def = function def(val) { + var state = (this || _global$8)._baseState; + assert4(state["default"] === null); + state["default"] = val; + state.optional = true; + return this || _global$8; + }; + Node.prototype.explicit = function explicit(num) { + var state = (this || _global$8)._baseState; + assert4(state.explicit === null && state.implicit === null); + state.explicit = num; + return this || _global$8; + }; + Node.prototype.implicit = function implicit(num) { + var state = (this || _global$8)._baseState; + assert4(state.explicit === null && state.implicit === null); + state.implicit = num; + return this || _global$8; + }; + Node.prototype.obj = function obj() { + var state = (this || _global$8)._baseState; + var args = Array.prototype.slice.call(arguments); + state.obj = true; + if (args.length !== 0) + this._useArgs(args); + return this || _global$8; + }; + Node.prototype.key = function key(newKey) { + var state = (this || _global$8)._baseState; + assert4(state.key === null); + state.key = newKey; + return this || _global$8; + }; + Node.prototype.any = function any() { + var state = (this || _global$8)._baseState; + state.any = true; + return this || _global$8; + }; + Node.prototype.choice = function choice(obj) { + var state = (this || _global$8)._baseState; + assert4(state.choice === null); + state.choice = obj; + this._useArgs(Object.keys(obj).map(function(key) { + return obj[key]; + })); + return this || _global$8; + }; + Node.prototype.contains = function contains2(item) { + var state = (this || _global$8)._baseState; + assert4(state.use === null); + state.contains = item; + return this || _global$8; + }; + Node.prototype._decode = function decode2(input, options) { + var state = (this || _global$8)._baseState; + if (state.parent === null) + return input.wrapResult(state.children[0]._decode(input, options)); + var result2 = state["default"]; + var present = true; + var prevKey = null; + if (state.key !== null) + prevKey = input.enterKey(state.key); + if (state.optional) { + var tag = null; + if (state.explicit !== null) + tag = state.explicit; + else if (state.implicit !== null) + tag = state.implicit; + else if (state.tag !== null) + tag = state.tag; + if (tag === null && !state.any) { + var save = input.save(); + try { + if (state.choice === null) + this._decodeGeneric(state.tag, input, options); + else + this._decodeChoice(input, options); + present = true; + } catch (e10) { + present = false; + } + input.restore(save); + } else { + present = this._peekTag(input, tag, state.any); + if (input.isError(present)) + return present; + } + } + var prevObj; + if (state.obj && present) + prevObj = input.enterObject(); + if (present) { + if (state.explicit !== null) { + var explicit = this._decodeTag(input, state.explicit); + if (input.isError(explicit)) + return explicit; + input = explicit; + } + var start = input.offset; + if (state.use === null && state.choice === null) { + if (state.any) + var save = input.save(); + var body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any); + if (input.isError(body)) + return body; + if (state.any) + result2 = input.raw(save); + else + input = body; + } + if (options && options.track && state.tag !== null) + options.track(input.path(), start, input.length, "tagged"); + if (options && options.track && state.tag !== null) + options.track(input.path(), input.offset, input.length, "content"); + if (state.any) + result2 = result2; + else if (state.choice === null) + result2 = this._decodeGeneric(state.tag, input, options); + else + result2 = this._decodeChoice(input, options); + if (input.isError(result2)) + return result2; + if (!state.any && state.choice === null && state.children !== null) { + state.children.forEach(function decodeChildren(child) { + child._decode(input, options); + }); + } + if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) { + var data = new DecoderBuffer(result2); + result2 = this._getUse(state.contains, input._reporterState.obj)._decode(data, options); + } + } + if (state.obj && present) + result2 = input.leaveObject(prevObj); + if (state.key !== null && (result2 !== null || present === true)) + input.leaveKey(prevKey, state.key, result2); + else if (prevKey !== null) + input.exitKey(prevKey); + return result2; + }; + Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) { + var state = (this || _global$8)._baseState; + if (tag === "seq" || tag === "set") + return null; + if (tag === "seqof" || tag === "setof") + return this._decodeList(input, tag, state.args[0], options); + else if (/str$/.test(tag)) + return this._decodeStr(input, tag, options); + else if (tag === "objid" && state.args) + return this._decodeObjid(input, state.args[0], state.args[1], options); + else if (tag === "objid") + return this._decodeObjid(input, null, null, options); + else if (tag === "gentime" || tag === "utctime") + return this._decodeTime(input, tag, options); + else if (tag === "null_") + return this._decodeNull(input, options); + else if (tag === "bool") + return this._decodeBool(input, options); + else if (tag === "objDesc") + return this._decodeStr(input, tag, options); + else if (tag === "int" || tag === "enum") + return this._decodeInt(input, state.args && state.args[0], options); + if (state.use !== null) { + return this._getUse(state.use, input._reporterState.obj)._decode(input, options); + } else { + return input.error("unknown tag: " + tag); + } + }; + Node.prototype._getUse = function _getUse(entity, obj) { + var state = (this || _global$8)._baseState; + state.useDecoder = this._use(entity, obj); + assert4(state.useDecoder._baseState.parent === null); + state.useDecoder = state.useDecoder._baseState.children[0]; + if (state.implicit !== state.useDecoder._baseState.implicit) { + state.useDecoder = state.useDecoder.clone(); + state.useDecoder._baseState.implicit = state.implicit; + } + return state.useDecoder; + }; + Node.prototype._decodeChoice = function decodeChoice(input, options) { + var state = (this || _global$8)._baseState; + var result2 = null; + var match = false; + Object.keys(state.choice).some(function(key) { + var save = input.save(); + var node = state.choice[key]; + try { + var value2 = node._decode(input, options); + if (input.isError(value2)) + return false; + result2 = { + type: key, + value: value2 + }; + match = true; + } catch (e10) { + input.restore(save); + return false; + } + return true; + }, this || _global$8); + if (!match) + return input.error("Choice not matched"); + return result2; + }; + Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) { + return new EncoderBuffer(data, (this || _global$8).reporter); + }; + Node.prototype._encode = function encode2(data, reporter, parent2) { + var state = (this || _global$8)._baseState; + if (state["default"] !== null && state["default"] === data) + return; + var result2 = this._encodeValue(data, reporter, parent2); + if (result2 === void 0) + return; + if (this._skipDefault(result2, reporter, parent2)) + return; + return result2; + }; + Node.prototype._encodeValue = function encode2(data, reporter, parent2) { + var state = (this || _global$8)._baseState; + if (state.parent === null) + return state.children[0]._encode(data, reporter || new Reporter()); + var result2 = null; + (this || _global$8).reporter = reporter; + if (state.optional && data === void 0) { + if (state["default"] !== null) + data = state["default"]; + else + return; + } + var content = null; + var primitive = false; + if (state.any) { + result2 = this._createEncoderBuffer(data); + } else if (state.choice) { + result2 = this._encodeChoice(data, reporter); + } else if (state.contains) { + content = this._getUse(state.contains, parent2)._encode(data, reporter); + primitive = true; + } else if (state.children) { + content = state.children.map(function(child2) { + if (child2._baseState.tag === "null_") + return child2._encode(null, reporter, data); + if (child2._baseState.key === null) + return reporter.error("Child should have a key"); + var prevKey = reporter.enterKey(child2._baseState.key); + if (typeof data !== "object") + return reporter.error("Child expected, but input is not object"); + var res = child2._encode(data[child2._baseState.key], reporter, data); + reporter.leaveKey(prevKey); + return res; + }, this || _global$8).filter(function(child2) { + return child2; + }); + content = this._createEncoderBuffer(content); + } else { + if (state.tag === "seqof" || state.tag === "setof") { + if (!(state.args && state.args.length === 1)) + return reporter.error("Too many args for : " + state.tag); + if (!Array.isArray(data)) + return reporter.error("seqof/setof, but data is not Array"); + var child = this.clone(); + child._baseState.implicit = null; + content = this._createEncoderBuffer(data.map(function(item) { + var state2 = (this || _global$8)._baseState; + return this._getUse(state2.args[0], data)._encode(item, reporter); + }, child)); + } else if (state.use !== null) { + result2 = this._getUse(state.use, parent2)._encode(data, reporter); + } else { + content = this._encodePrimitive(state.tag, data); + primitive = true; + } + } + var result2; + if (!state.any && state.choice === null) { + var tag = state.implicit !== null ? state.implicit : state.tag; + var cls = state.implicit === null ? "universal" : "context"; + if (tag === null) { + if (state.use === null) + reporter.error("Tag could be omitted only for .use()"); + } else { + if (state.use === null) + result2 = this._encodeComposite(tag, primitive, cls, content); + } + } + if (state.explicit !== null) + result2 = this._encodeComposite(state.explicit, false, "context", result2); + return result2; + }; + Node.prototype._encodeChoice = function encodeChoice(data, reporter) { + var state = (this || _global$8)._baseState; + var node = state.choice[data.type]; + if (!node) { + assert4(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice))); + } + return node._encode(data.value, reporter); + }; + Node.prototype._encodePrimitive = function encodePrimitive(tag, data) { + var state = (this || _global$8)._baseState; + if (/str$/.test(tag)) + return this._encodeStr(data, tag); + else if (tag === "objid" && state.args) + return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); + else if (tag === "objid") + return this._encodeObjid(data, null, null); + else if (tag === "gentime" || tag === "utctime") + return this._encodeTime(data, tag); + else if (tag === "null_") + return this._encodeNull(); + else if (tag === "int" || tag === "enum") + return this._encodeInt(data, state.args && state.reverseArgs[0]); + else if (tag === "bool") + return this._encodeBool(data); + else if (tag === "objDesc") + return this._encodeStr(data, tag); + else + throw new Error("Unsupported tag: " + tag); + }; + Node.prototype._isNumstr = function isNumstr(str2) { + return /^[0-9 ]*$/.test(str2); + }; + Node.prototype._isPrintstr = function isPrintstr(str2) { + return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str2); + }; + return exports$t; +} +function dew$r() { + if (_dewExec$r) + return exports$s; + _dewExec$r = true; + var base = exports$s; + base.Reporter = dew$u().Reporter; + base.DecoderBuffer = dew$t().DecoderBuffer; + base.EncoderBuffer = dew$t().EncoderBuffer; + base.Node = dew$s(); + return exports$s; +} +function dew$q() { + if (_dewExec$q) + return exports$r; + _dewExec$q = true; + var constants5 = dew$p(); + exports$r.tagClass = { + 0: "universal", + 1: "application", + 2: "context", + 3: "private" + }; + exports$r.tagClassByName = constants5._reverse(exports$r.tagClass); + exports$r.tag = { + 0: "end", + 1: "bool", + 2: "int", + 3: "bitstr", + 4: "octstr", + 5: "null_", + 6: "objid", + 7: "objDesc", + 8: "external", + 9: "real", + 10: "enum", + 11: "embed", + 12: "utf8str", + 13: "relativeOid", + 16: "seq", + 17: "set", + 18: "numstr", + 19: "printstr", + 20: "t61str", + 21: "videostr", + 22: "ia5str", + 23: "utctime", + 24: "gentime", + 25: "graphstr", + 26: "iso646str", + 27: "genstr", + 28: "unistr", + 29: "charstr", + 30: "bmpstr" + }; + exports$r.tagByName = constants5._reverse(exports$r.tag); + return exports$r; +} +function dew$p() { + if (_dewExec$p) + return exports$q; + _dewExec$p = true; + var constants5 = exports$q; + constants5._reverse = function reverse2(map4) { + var res = {}; + Object.keys(map4).forEach(function(key) { + if ((key | 0) == key) + key = key | 0; + var value2 = map4[key]; + res[value2] = key; + }); + return res; + }; + constants5.der = dew$q(); + return exports$q; +} +function dew$o() { + if (_dewExec$o) + return exports$p; + _dewExec$o = true; + var inherits2 = dew4(); + var asn1 = dew$i2(); + var base = asn1.base; + var bignum = asn1.bignum; + var der = asn1.constants.der; + function DERDecoder(entity) { + (this || _global$7).enc = "der"; + (this || _global$7).name = entity.name; + (this || _global$7).entity = entity; + (this || _global$7).tree = new DERNode(); + (this || _global$7).tree._init(entity.body); + } + exports$p = DERDecoder; + DERDecoder.prototype.decode = function decode2(data, options) { + if (!(data instanceof base.DecoderBuffer)) + data = new base.DecoderBuffer(data, options); + return (this || _global$7).tree._decode(data, options); + }; + function DERNode(parent2) { + base.Node.call(this || _global$7, "der", parent2); + } + inherits2(DERNode, base.Node); + DERNode.prototype._peekTag = function peekTag(buffer2, tag, any) { + if (buffer2.isEmpty()) + return false; + var state = buffer2.save(); + var decodedTag = derDecodeTag(buffer2, 'Failed to peek tag: "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + buffer2.restore(state); + return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any; + }; + DERNode.prototype._decodeTag = function decodeTag(buffer2, tag, any) { + var decodedTag = derDecodeTag(buffer2, 'Failed to decode tag of "' + tag + '"'); + if (buffer2.isError(decodedTag)) + return decodedTag; + var len = derDecodeLen(buffer2, decodedTag.primitive, 'Failed to get length of "' + tag + '"'); + if (buffer2.isError(len)) + return len; + if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) { + return buffer2.error('Failed to match tag: "' + tag + '"'); + } + if (decodedTag.primitive || len !== null) + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + var state = buffer2.save(); + var res = this._skipUntilEnd(buffer2, 'Failed to skip indefinite length body: "' + (this || _global$7).tag + '"'); + if (buffer2.isError(res)) + return res; + len = buffer2.offset - state.offset; + buffer2.restore(state); + return buffer2.skip(len, 'Failed to match body of: "' + tag + '"'); + }; + DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer2, fail2) { + while (true) { + var tag = derDecodeTag(buffer2, fail2); + if (buffer2.isError(tag)) + return tag; + var len = derDecodeLen(buffer2, tag.primitive, fail2); + if (buffer2.isError(len)) + return len; + var res; + if (tag.primitive || len !== null) + res = buffer2.skip(len); + else + res = this._skipUntilEnd(buffer2, fail2); + if (buffer2.isError(res)) + return res; + if (tag.tagStr === "end") + break; + } + }; + DERNode.prototype._decodeList = function decodeList(buffer2, tag, decoder, options) { + var result2 = []; + while (!buffer2.isEmpty()) { + var possibleEnd = this._peekTag(buffer2, "end"); + if (buffer2.isError(possibleEnd)) + return possibleEnd; + var res = decoder.decode(buffer2, "der", options); + if (buffer2.isError(res) && possibleEnd) + break; + result2.push(res); + } + return result2; + }; + DERNode.prototype._decodeStr = function decodeStr(buffer2, tag) { + if (tag === "bitstr") { + var unused = buffer2.readUInt8(); + if (buffer2.isError(unused)) + return unused; + return { + unused, + data: buffer2.raw() + }; + } else if (tag === "bmpstr") { + var raw = buffer2.raw(); + if (raw.length % 2 === 1) + return buffer2.error("Decoding of string type: bmpstr length mismatch"); + var str2 = ""; + for (var i7 = 0; i7 < raw.length / 2; i7++) { + str2 += String.fromCharCode(raw.readUInt16BE(i7 * 2)); + } + return str2; + } else if (tag === "numstr") { + var numstr = buffer2.raw().toString("ascii"); + if (!this._isNumstr(numstr)) { + return buffer2.error("Decoding of string type: numstr unsupported characters"); + } + return numstr; + } else if (tag === "octstr") { + return buffer2.raw(); + } else if (tag === "objDesc") { + return buffer2.raw(); + } else if (tag === "printstr") { + var printstr = buffer2.raw().toString("ascii"); + if (!this._isPrintstr(printstr)) { + return buffer2.error("Decoding of string type: printstr unsupported characters"); + } + return printstr; + } else if (/str$/.test(tag)) { + return buffer2.raw().toString(); + } else { + return buffer2.error("Decoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._decodeObjid = function decodeObjid(buffer2, values2, relative2) { + var result2; + var identifiers = []; + var ident = 0; + while (!buffer2.isEmpty()) { + var subident = buffer2.readUInt8(); + ident <<= 7; + ident |= subident & 127; + if ((subident & 128) === 0) { + identifiers.push(ident); + ident = 0; + } + } + if (subident & 128) + identifiers.push(ident); + var first = identifiers[0] / 40 | 0; + var second = identifiers[0] % 40; + if (relative2) + result2 = identifiers; + else + result2 = [first, second].concat(identifiers.slice(1)); + if (values2) { + var tmp = values2[result2.join(" ")]; + if (tmp === void 0) + tmp = values2[result2.join(".")]; + if (tmp !== void 0) + result2 = tmp; + } + return result2; + }; + DERNode.prototype._decodeTime = function decodeTime(buffer2, tag) { + var str2 = buffer2.raw().toString(); + if (tag === "gentime") { + var year = str2.slice(0, 4) | 0; + var mon = str2.slice(4, 6) | 0; + var day = str2.slice(6, 8) | 0; + var hour = str2.slice(8, 10) | 0; + var min2 = str2.slice(10, 12) | 0; + var sec = str2.slice(12, 14) | 0; + } else if (tag === "utctime") { + var year = str2.slice(0, 2) | 0; + var mon = str2.slice(2, 4) | 0; + var day = str2.slice(4, 6) | 0; + var hour = str2.slice(6, 8) | 0; + var min2 = str2.slice(8, 10) | 0; + var sec = str2.slice(10, 12) | 0; + if (year < 70) + year = 2e3 + year; + else + year = 1900 + year; + } else { + return buffer2.error("Decoding " + tag + " time is not supported yet"); + } + return Date.UTC(year, mon - 1, day, hour, min2, sec, 0); + }; + DERNode.prototype._decodeNull = function decodeNull(buffer2) { + return null; + }; + DERNode.prototype._decodeBool = function decodeBool(buffer2) { + var res = buffer2.readUInt8(); + if (buffer2.isError(res)) + return res; + else + return res !== 0; + }; + DERNode.prototype._decodeInt = function decodeInt(buffer2, values2) { + var raw = buffer2.raw(); + var res = new bignum(raw); + if (values2) + res = values2[res.toString(10)] || res; + return res; + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getDecoder("der").tree; + }; + function derDecodeTag(buf, fail2) { + var tag = buf.readUInt8(fail2); + if (buf.isError(tag)) + return tag; + var cls = der.tagClass[tag >> 6]; + var primitive = (tag & 32) === 0; + if ((tag & 31) === 31) { + var oct = tag; + tag = 0; + while ((oct & 128) === 128) { + oct = buf.readUInt8(fail2); + if (buf.isError(oct)) + return oct; + tag <<= 7; + tag |= oct & 127; + } + } else { + tag &= 31; + } + var tagStr = der.tag[tag]; + return { + cls, + primitive, + tag, + tagStr + }; + } + function derDecodeLen(buf, primitive, fail2) { + var len = buf.readUInt8(fail2); + if (buf.isError(len)) + return len; + if (!primitive && len === 128) + return null; + if ((len & 128) === 0) { + return len; + } + var num = len & 127; + if (num > 4) + return buf.error("length octect is too long"); + len = 0; + for (var i7 = 0; i7 < num; i7++) { + len <<= 8; + var j6 = buf.readUInt8(fail2); + if (buf.isError(j6)) + return j6; + len |= j6; + } + return len; + } + return exports$p; +} +function dew$n() { + if (_dewExec$n) + return exports$o; + _dewExec$n = true; + var inherits2 = dew4(); + var Buffer4 = dew().Buffer; + var DERDecoder = dew$o(); + function PEMDecoder(entity) { + DERDecoder.call(this || _global$6, entity); + (this || _global$6).enc = "pem"; + } + inherits2(PEMDecoder, DERDecoder); + exports$o = PEMDecoder; + PEMDecoder.prototype.decode = function decode2(data, options) { + var lines = data.toString().split(/[\r\n]+/g); + var label = options.label.toUpperCase(); + var re4 = /^-----(BEGIN|END) ([^-]+)-----$/; + var start = -1; + var end = -1; + for (var i7 = 0; i7 < lines.length; i7++) { + var match = lines[i7].match(re4); + if (match === null) + continue; + if (match[2] !== label) + continue; + if (start === -1) { + if (match[1] !== "BEGIN") + break; + start = i7; + } else { + if (match[1] !== "END") + break; + end = i7; + break; + } + } + if (start === -1 || end === -1) + throw new Error("PEM section not found for: " + label); + var base64 = lines.slice(start + 1, end).join(""); + base64.replace(/[^a-z0-9\+\/=]+/gi, ""); + var input = new Buffer4(base64, "base64"); + return DERDecoder.prototype.decode.call(this || _global$6, input, options); + }; + return exports$o; +} +function dew$m() { + if (_dewExec$m) + return exports$n; + _dewExec$m = true; + var decoders = exports$n; + decoders.der = dew$o(); + decoders.pem = dew$n(); + return exports$n; +} +function dew$l() { + if (_dewExec$l) + return exports$m; + _dewExec$l = true; + var inherits2 = dew4(); + var Buffer4 = dew().Buffer; + var asn1 = dew$i2(); + var base = asn1.base; + var der = asn1.constants.der; + function DEREncoder(entity) { + (this || _global$5).enc = "der"; + (this || _global$5).name = entity.name; + (this || _global$5).entity = entity; + (this || _global$5).tree = new DERNode(); + (this || _global$5).tree._init(entity.body); + } + exports$m = DEREncoder; + DEREncoder.prototype.encode = function encode2(data, reporter) { + return (this || _global$5).tree._encode(data, reporter).join(); + }; + function DERNode(parent2) { + base.Node.call(this || _global$5, "der", parent2); + } + inherits2(DERNode, base.Node); + DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) { + var encodedTag = encodeTag(tag, primitive, cls, (this || _global$5).reporter); + if (content.length < 128) { + var header = new Buffer4(2); + header[0] = encodedTag; + header[1] = content.length; + return this._createEncoderBuffer([header, content]); + } + var lenOctets = 1; + for (var i7 = content.length; i7 >= 256; i7 >>= 8) + lenOctets++; + var header = new Buffer4(1 + 1 + lenOctets); + header[0] = encodedTag; + header[1] = 128 | lenOctets; + for (var i7 = 1 + lenOctets, j6 = content.length; j6 > 0; i7--, j6 >>= 8) + header[i7] = j6 & 255; + return this._createEncoderBuffer([header, content]); + }; + DERNode.prototype._encodeStr = function encodeStr(str2, tag) { + if (tag === "bitstr") { + return this._createEncoderBuffer([str2.unused | 0, str2.data]); + } else if (tag === "bmpstr") { + var buf = new Buffer4(str2.length * 2); + for (var i7 = 0; i7 < str2.length; i7++) { + buf.writeUInt16BE(str2.charCodeAt(i7), i7 * 2); + } + return this._createEncoderBuffer(buf); + } else if (tag === "numstr") { + if (!this._isNumstr(str2)) { + return (this || _global$5).reporter.error("Encoding of string type: numstr supports only digits and space"); + } + return this._createEncoderBuffer(str2); + } else if (tag === "printstr") { + if (!this._isPrintstr(str2)) { + return (this || _global$5).reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"); + } + return this._createEncoderBuffer(str2); + } else if (/str$/.test(tag)) { + return this._createEncoderBuffer(str2); + } else if (tag === "objDesc") { + return this._createEncoderBuffer(str2); + } else { + return (this || _global$5).reporter.error("Encoding of string type: " + tag + " unsupported"); + } + }; + DERNode.prototype._encodeObjid = function encodeObjid(id, values2, relative2) { + if (typeof id === "string") { + if (!values2) + return (this || _global$5).reporter.error("string objid given, but no values map found"); + if (!values2.hasOwnProperty(id)) + return (this || _global$5).reporter.error("objid not found in values map"); + id = values2[id].split(/[\s\.]+/g); + for (var i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } else if (Array.isArray(id)) { + id = id.slice(); + for (var i7 = 0; i7 < id.length; i7++) + id[i7] |= 0; + } + if (!Array.isArray(id)) { + return (this || _global$5).reporter.error("objid() should be either array or string, got: " + JSON.stringify(id)); + } + if (!relative2) { + if (id[1] >= 40) + return (this || _global$5).reporter.error("Second objid identifier OOB"); + id.splice(0, 2, id[0] * 40 + id[1]); + } + var size2 = 0; + for (var i7 = 0; i7 < id.length; i7++) { + var ident = id[i7]; + for (size2++; ident >= 128; ident >>= 7) + size2++; + } + var objid = new Buffer4(size2); + var offset = objid.length - 1; + for (var i7 = id.length - 1; i7 >= 0; i7--) { + var ident = id[i7]; + objid[offset--] = ident & 127; + while ((ident >>= 7) > 0) + objid[offset--] = 128 | ident & 127; + } + return this._createEncoderBuffer(objid); + }; + function two(num) { + if (num < 10) + return "0" + num; + else + return num; + } + DERNode.prototype._encodeTime = function encodeTime(time2, tag) { + var str2; + var date = new Date(time2); + if (tag === "gentime") { + str2 = [two(date.getFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else if (tag === "utctime") { + str2 = [two(date.getFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z"].join(""); + } else { + (this || _global$5).reporter.error("Encoding " + tag + " time is not supported yet"); + } + return this._encodeStr(str2, "octstr"); + }; + DERNode.prototype._encodeNull = function encodeNull() { + return this._createEncoderBuffer(""); + }; + DERNode.prototype._encodeInt = function encodeInt(num, values2) { + if (typeof num === "string") { + if (!values2) + return (this || _global$5).reporter.error("String int or enum given, but no values map"); + if (!values2.hasOwnProperty(num)) { + return (this || _global$5).reporter.error("Values map doesn't contain: " + JSON.stringify(num)); + } + num = values2[num]; + } + if (typeof num !== "number" && !Buffer4.isBuffer(num)) { + var numArray = num.toArray(); + if (!num.sign && numArray[0] & 128) { + numArray.unshift(0); + } + num = new Buffer4(numArray); + } + if (Buffer4.isBuffer(num)) { + var size2 = num.length; + if (num.length === 0) + size2++; + var out = new Buffer4(size2); + num.copy(out); + if (num.length === 0) + out[0] = 0; + return this._createEncoderBuffer(out); + } + if (num < 128) + return this._createEncoderBuffer(num); + if (num < 256) + return this._createEncoderBuffer([0, num]); + var size2 = 1; + for (var i7 = num; i7 >= 256; i7 >>= 8) + size2++; + var out = new Array(size2); + for (var i7 = out.length - 1; i7 >= 0; i7--) { + out[i7] = num & 255; + num >>= 8; + } + if (out[0] & 128) { + out.unshift(0); + } + return this._createEncoderBuffer(new Buffer4(out)); + }; + DERNode.prototype._encodeBool = function encodeBool(value2) { + return this._createEncoderBuffer(value2 ? 255 : 0); + }; + DERNode.prototype._use = function use(entity, obj) { + if (typeof entity === "function") + entity = entity(obj); + return entity._getEncoder("der").tree; + }; + DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent2) { + var state = (this || _global$5)._baseState; + var i7; + if (state["default"] === null) + return false; + var data = dataBuffer.join(); + if (state.defaultBuffer === void 0) + state.defaultBuffer = this._encodeValue(state["default"], reporter, parent2).join(); + if (data.length !== state.defaultBuffer.length) + return false; + for (i7 = 0; i7 < data.length; i7++) + if (data[i7] !== state.defaultBuffer[i7]) + return false; + return true; + }; + function encodeTag(tag, primitive, cls, reporter) { + var res; + if (tag === "seqof") + tag = "seq"; + else if (tag === "setof") + tag = "set"; + if (der.tagByName.hasOwnProperty(tag)) + res = der.tagByName[tag]; + else if (typeof tag === "number" && (tag | 0) === tag) + res = tag; + else + return reporter.error("Unknown tag: " + tag); + if (res >= 31) + return reporter.error("Multi-octet tag encoding unsupported"); + if (!primitive) + res |= 32; + res |= der.tagClassByName[cls || "universal"] << 6; + return res; + } + return exports$m; +} +function dew$k2() { + if (_dewExec$k2) + return exports$l; + _dewExec$k2 = true; + var inherits2 = dew4(); + var DEREncoder = dew$l(); + function PEMEncoder(entity) { + DEREncoder.call(this || _global$4, entity); + (this || _global$4).enc = "pem"; + } + inherits2(PEMEncoder, DEREncoder); + exports$l = PEMEncoder; + PEMEncoder.prototype.encode = function encode2(data, options) { + var buf = DEREncoder.prototype.encode.call(this || _global$4, data); + var p7 = buf.toString("base64"); + var out = ["-----BEGIN " + options.label + "-----"]; + for (var i7 = 0; i7 < p7.length; i7 += 64) + out.push(p7.slice(i7, i7 + 64)); + out.push("-----END " + options.label + "-----"); + return out.join("\n"); + }; + return exports$l; +} +function dew$j2() { + if (_dewExec$j2) + return exports$k2; + _dewExec$j2 = true; + var encoders = exports$k2; + encoders.der = dew$l(); + encoders.pem = dew$k2(); + return exports$k2; +} +function dew$i2() { + if (_dewExec$i2) + return exports$j2; + _dewExec$i2 = true; + var asn1 = exports$j2; + asn1.bignum = dew$w(); + asn1.define = dew$v().define; + asn1.base = dew$r(); + asn1.constants = dew$p(); + asn1.decoders = dew$m(); + asn1.encoders = dew$j2(); + return exports$j2; +} +function dew$h2() { + if (_dewExec$h2) + return exports$i2; + _dewExec$h2 = true; + var asn = dew$i2(); + var Time = asn.define("Time", function() { + this.choice({ + utcTime: this.utctime(), + generalTime: this.gentime() + }); + }); + var AttributeTypeValue = asn.define("AttributeTypeValue", function() { + this.seq().obj(this.key("type").objid(), this.key("value").any()); + }); + var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); + }); + var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", function() { + this.setof(AttributeTypeValue); + }); + var RDNSequence = asn.define("RDNSequence", function() { + this.seqof(RelativeDistinguishedName); + }); + var Name = asn.define("Name", function() { + this.choice({ + rdnSequence: this.use(RDNSequence) + }); + }); + var Validity = asn.define("Validity", function() { + this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time)); + }); + var Extension6 = asn.define("Extension", function() { + this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); + }); + var TBSCertificate = asn.define("TBSCertificate", function() { + this.seq().obj(this.key("version").explicit(0)["int"]().optional(), this.key("serialNumber")["int"](), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension6).optional()); + }); + var X509Certificate = asn.define("X509Certificate", function() { + this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr()); + }); + exports$i2 = X509Certificate; + return exports$i2; +} +function dew$g3() { + if (_dewExec$g3) + return exports$h2; + _dewExec$g3 = true; + var asn1 = dew$i2(); + exports$h2.certificate = dew$h2(); + var RSAPrivateKey = asn1.define("RSAPrivateKey", function() { + this.seq().obj(this.key("version")["int"](), this.key("modulus")["int"](), this.key("publicExponent")["int"](), this.key("privateExponent")["int"](), this.key("prime1")["int"](), this.key("prime2")["int"](), this.key("exponent1")["int"](), this.key("exponent2")["int"](), this.key("coefficient")["int"]()); + }); + exports$h2.RSAPrivateKey = RSAPrivateKey; + var RSAPublicKey = asn1.define("RSAPublicKey", function() { + this.seq().obj(this.key("modulus")["int"](), this.key("publicExponent")["int"]()); + }); + exports$h2.RSAPublicKey = RSAPublicKey; + var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"]()).optional()); + }); + var PublicKey = asn1.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr()); + }); + exports$h2.PublicKey = PublicKey; + var PrivateKeyInfo = asn1.define("PrivateKeyInfo", function() { + this.seq().obj(this.key("version")["int"](), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr()); + }); + exports$h2.PrivateKey = PrivateKeyInfo; + var EncryptedPrivateKeyInfo = asn1.define("EncryptedPrivateKeyInfo", function() { + this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters")["int"]())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); + }); + exports$h2.EncryptedPrivateKey = EncryptedPrivateKeyInfo; + var DSAPrivateKey = asn1.define("DSAPrivateKey", function() { + this.seq().obj(this.key("version")["int"](), this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"](), this.key("pub_key")["int"](), this.key("priv_key")["int"]()); + }); + exports$h2.DSAPrivateKey = DSAPrivateKey; + exports$h2.DSAparam = asn1.define("DSAparam", function() { + this["int"](); + }); + var ECParameters = asn1.define("ECParameters", function() { + this.choice({ + namedCurve: this.objid() + }); + }); + var ECPrivateKey = asn1.define("ECPrivateKey", function() { + this.seq().obj(this.key("version")["int"](), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr()); + }); + exports$h2.ECPrivateKey = ECPrivateKey; + exports$h2.signature = asn1.define("signature", function() { + this.seq().obj(this.key("r")["int"](), this.key("s")["int"]()); + }); + return exports$h2; +} +function dew$f3() { + if (_dewExec$f3) + return exports$g3; + _dewExec$f3 = true; + var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m; + var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; + var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m; + var evp = dew$2Y(); + var ciphers = dew$2V(); + var Buffer4 = dew$15().Buffer; + exports$g3 = function(okey, password) { + var key = okey.toString(); + var match = key.match(findProc); + var decrypted; + if (!match) { + var match2 = key.match(fullRegex); + decrypted = Buffer4.from(match2[2].replace(/[\r\n]/g, ""), "base64"); + } else { + var suite = "aes" + match[1]; + var iv = Buffer4.from(match[2], "hex"); + var cipherText = Buffer4.from(match[3].replace(/[\r\n]/g, ""), "base64"); + var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key; + var out = []; + var cipher = ciphers.createDecipheriv(suite, cipherKey, iv); + out.push(cipher.update(cipherText)); + out.push(cipher["final"]()); + decrypted = Buffer4.concat(out); + } + var tag = key.match(startRegex)[1]; + return { + tag, + data: decrypted + }; + }; + return exports$g3; +} +function dew$e3() { + if (_dewExec$e3) + return exports$f3; + _dewExec$e3 = true; + var asn1 = dew$g3(); + var aesid = _aesid; + var fixProc = dew$f3(); + var ciphers = dew$2V(); + var compat = dew$3j(); + var Buffer4 = dew$15().Buffer; + function decrypt(data, password) { + var salt = data.algorithm.decrypt.kde.kdeparams.salt; + var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10); + var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")]; + var iv = data.algorithm.decrypt.cipher.iv; + var cipherText = data.subjectPrivateKey; + var keylen = parseInt(algo.split("-")[1], 10) / 8; + var key = compat.pbkdf2Sync(password, salt, iters, keylen, "sha1"); + var cipher = ciphers.createDecipheriv(algo, key, iv); + var out = []; + out.push(cipher.update(cipherText)); + out.push(cipher["final"]()); + return Buffer4.concat(out); + } + function parseKeys(buffer2) { + var password; + if (typeof buffer2 === "object" && !Buffer4.isBuffer(buffer2)) { + password = buffer2.passphrase; + buffer2 = buffer2.key; + } + if (typeof buffer2 === "string") { + buffer2 = Buffer4.from(buffer2); + } + var stripped = fixProc(buffer2, password); + var type3 = stripped.tag; + var data = stripped.data; + var subtype, ndata; + switch (type3) { + case "CERTIFICATE": + ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo; + case "PUBLIC KEY": + if (!ndata) { + ndata = asn1.PublicKey.decode(data, "der"); + } + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der"); + case "1.2.840.10045.2.1": + ndata.subjectPrivateKey = ndata.subjectPublicKey; + return { + type: "ec", + data: ndata + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der"); + return { + type: "dsa", + data: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "ENCRYPTED PRIVATE KEY": + data = asn1.EncryptedPrivateKey.decode(data, "der"); + data = decrypt(data, password); + case "PRIVATE KEY": + ndata = asn1.PrivateKey.decode(data, "der"); + subtype = ndata.algorithm.algorithm.join("."); + switch (subtype) { + case "1.2.840.113549.1.1.1": + return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der"); + case "1.2.840.10045.2.1": + return { + curve: ndata.algorithm.curve, + privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey + }; + case "1.2.840.10040.4.1": + ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der"); + return { + type: "dsa", + params: ndata.algorithm.params + }; + default: + throw new Error("unknown key id " + subtype); + } + case "RSA PUBLIC KEY": + return asn1.RSAPublicKey.decode(data, "der"); + case "RSA PRIVATE KEY": + return asn1.RSAPrivateKey.decode(data, "der"); + case "DSA PRIVATE KEY": + return { + type: "dsa", + params: asn1.DSAPrivateKey.decode(data, "der") + }; + case "EC PRIVATE KEY": + data = asn1.ECPrivateKey.decode(data, "der"); + return { + curve: data.parameters.value, + privateKey: data.privateKey + }; + default: + throw new Error("unknown key type " + type3); + } + } + parseKeys.signature = asn1.signature; + exports$f3 = parseKeys; + return exports$f3; +} +function dew$d3() { + if (_dewExec$d3) + return exports$e3; + _dewExec$d3 = true; + var Buffer4 = dew$15().Buffer; + var createHmac2 = dew$3q(); + var crt = dew$$(); + var EC = dew$x().ec; + var BN = dew$10(); + var parseKeys = dew$e3(); + var curves = _curves; + var RSA_PKCS1_PADDING = 1; + function sign(hash, key, hashType, signType, tag) { + var priv = parseKeys(key); + if (priv.curve) { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") { + throw new Error("wrong private key type"); + } + return ecSign(hash, priv); + } else if (priv.type === "dsa") { + if (signType !== "dsa") { + throw new Error("wrong private key type"); + } + return dsaSign(hash, priv, hashType); + } + if (signType !== "rsa" && signType !== "ecdsa/rsa") { + throw new Error("wrong private key type"); + } + if (key.padding !== void 0 && key.padding !== RSA_PKCS1_PADDING) { + throw new Error("illegal or unsupported padding mode"); + } + hash = Buffer4.concat([tag, hash]); + var len = priv.modulus.byteLength(); + var pad2 = [0, 1]; + while (hash.length + pad2.length + 1 < len) { + pad2.push(255); + } + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) { + pad2.push(hash[i7]); + } + var out = crt(pad2, priv); + return out; + } + function ecSign(hash, priv) { + var curveId = curves[priv.curve.join(".")]; + if (!curveId) { + throw new Error("unknown curve " + priv.curve.join(".")); + } + var curve = new EC(curveId); + var key = curve.keyFromPrivate(priv.privateKey); + var out = key.sign(hash); + return Buffer4.from(out.toDER()); + } + function dsaSign(hash, priv, algo) { + var x7 = priv.params.priv_key; + var p7 = priv.params.p; + var q5 = priv.params.q; + var g7 = priv.params.g; + var r8 = new BN(0); + var k6; + var H5 = bits2int(hash, q5).mod(q5); + var s7 = false; + var kv = getKey(x7, q5, hash, algo); + while (s7 === false) { + k6 = makeKey(q5, kv, algo); + r8 = makeR(g7, k6, p7, q5); + s7 = k6.invm(q5).imul(H5.add(x7.mul(r8))).mod(q5); + if (s7.cmpn(0) === 0) { + s7 = false; + r8 = new BN(0); + } + } + return toDER(r8, s7); + } + function toDER(r8, s7) { + r8 = r8.toArray(); + s7 = s7.toArray(); + if (r8[0] & 128) { + r8 = [0].concat(r8); + } + if (s7[0] & 128) { + s7 = [0].concat(s7); + } + var total = r8.length + s7.length + 4; + var res = [48, total, 2, r8.length]; + res = res.concat(r8, [2, s7.length], s7); + return Buffer4.from(res); + } + function getKey(x7, q5, hash, algo) { + x7 = Buffer4.from(x7.toArray()); + if (x7.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - x7.length); + x7 = Buffer4.concat([zeros, x7]); + } + var hlen = hash.length; + var hbits = bits2octets(hash, q5); + var v8 = Buffer4.alloc(hlen); + v8.fill(1); + var k6 = Buffer4.alloc(hlen); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([0])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + k6 = createHmac2(algo, k6).update(v8).update(Buffer4.from([1])).update(x7).update(hbits).digest(); + v8 = createHmac2(algo, k6).update(v8).digest(); + return { + k: k6, + v: v8 + }; + } + function bits2int(obits, q5) { + var bits = new BN(obits); + var shift = (obits.length << 3) - q5.bitLength(); + if (shift > 0) { + bits.ishrn(shift); + } + return bits; + } + function bits2octets(bits, q5) { + bits = bits2int(bits, q5); + bits = bits.mod(q5); + var out = Buffer4.from(bits.toArray()); + if (out.length < q5.byteLength()) { + var zeros = Buffer4.alloc(q5.byteLength() - out.length); + out = Buffer4.concat([zeros, out]); + } + return out; + } + function makeKey(q5, kv, algo) { + var t8; + var k6; + do { + t8 = Buffer4.alloc(0); + while (t8.length * 8 < q5.bitLength()) { + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + t8 = Buffer4.concat([t8, kv.v]); + } + k6 = bits2int(t8, q5); + kv.k = createHmac2(algo, kv.k).update(kv.v).update(Buffer4.from([0])).digest(); + kv.v = createHmac2(algo, kv.k).update(kv.v).digest(); + } while (k6.cmp(q5) !== -1); + return k6; + } + function makeR(g7, k6, p7, q5) { + return g7.toRed(BN.mont(p7)).redPow(k6).fromRed().mod(q5); + } + exports$e3 = sign; + exports$e3.getKey = getKey; + exports$e3.makeKey = makeKey; + return exports$e3; +} +function dew$c3() { + if (_dewExec$c3) + return exports$d3; + _dewExec$c3 = true; + var Buffer4 = dew$15().Buffer; + var BN = dew$10(); + var EC = dew$x().ec; + var parseKeys = dew$e3(); + var curves = _curves; + function verify(sig, hash, key, signType, tag) { + var pub = parseKeys(key); + if (pub.type === "ec") { + if (signType !== "ecdsa" && signType !== "ecdsa/rsa") { + throw new Error("wrong public key type"); + } + return ecVerify(sig, hash, pub); + } else if (pub.type === "dsa") { + if (signType !== "dsa") { + throw new Error("wrong public key type"); + } + return dsaVerify(sig, hash, pub); + } + if (signType !== "rsa" && signType !== "ecdsa/rsa") { + throw new Error("wrong public key type"); + } + hash = Buffer4.concat([tag, hash]); + var len = pub.modulus.byteLength(); + var pad2 = [1]; + var padNum = 0; + while (hash.length + pad2.length + 2 < len) { + pad2.push(255); + padNum += 1; + } + pad2.push(0); + var i7 = -1; + while (++i7 < hash.length) { + pad2.push(hash[i7]); + } + pad2 = Buffer4.from(pad2); + var red = BN.mont(pub.modulus); + sig = new BN(sig).toRed(red); + sig = sig.redPow(new BN(pub.publicExponent)); + sig = Buffer4.from(sig.fromRed().toArray()); + var out = padNum < 8 ? 1 : 0; + len = Math.min(sig.length, pad2.length); + if (sig.length !== pad2.length) { + out = 1; + } + i7 = -1; + while (++i7 < len) { + out |= sig[i7] ^ pad2[i7]; + } + return out === 0; + } + function ecVerify(sig, hash, pub) { + var curveId = curves[pub.data.algorithm.curve.join(".")]; + if (!curveId) { + throw new Error("unknown curve " + pub.data.algorithm.curve.join(".")); + } + var curve = new EC(curveId); + var pubkey = pub.data.subjectPrivateKey.data; + return curve.verify(hash, sig, pubkey); + } + function dsaVerify(sig, hash, pub) { + var p7 = pub.data.p; + var q5 = pub.data.q; + var g7 = pub.data.g; + var y7 = pub.data.pub_key; + var unpacked = parseKeys.signature.decode(sig, "der"); + var s7 = unpacked.s; + var r8 = unpacked.r; + checkValue(s7, q5); + checkValue(r8, q5); + var montp = BN.mont(p7); + var w6 = s7.invm(q5); + var v8 = g7.toRed(montp).redPow(new BN(hash).mul(w6).mod(q5)).fromRed().mul(y7.toRed(montp).redPow(r8.mul(w6).mod(q5)).fromRed()).mod(p7).mod(q5); + return v8.cmp(r8) === 0; + } + function checkValue(b8, q5) { + if (b8.cmpn(0) <= 0) { + throw new Error("invalid sig"); + } + if (b8.cmp(q5) >= 0) { + throw new Error("invalid sig"); + } + } + exports$d3 = verify; + return exports$d3; +} +function dew$b4() { + if (_dewExec$b4) + return exports$c4; + _dewExec$b4 = true; + var Buffer4 = dew$15().Buffer; + var createHash2 = dew$3t(); + var stream2 = dew$11(); + var inherits2 = dew4(); + var sign = dew$d3(); + var verify = dew$c3(); + var algorithms = _algorithms$2; + Object.keys(algorithms).forEach(function(key) { + algorithms[key].id = Buffer4.from(algorithms[key].id, "hex"); + algorithms[key.toLowerCase()] = algorithms[key]; + }); + function Sign2(algorithm) { + stream2.Writable.call(this); + var data = algorithms[algorithm]; + if (!data) { + throw new Error("Unknown message digest"); + } + this._hashType = data.hash; + this._hash = createHash2(data.hash); + this._tag = data.id; + this._signType = data.sign; + } + inherits2(Sign2, stream2.Writable); + Sign2.prototype._write = function _write(data, _6, done) { + this._hash.update(data); + done(); + }; + Sign2.prototype.update = function update2(data, enc) { + this._hash.update(typeof data === "string" ? Buffer4.from(data, enc) : data); + return this; + }; + Sign2.prototype.sign = function signMethod(key, enc) { + this.end(); + var hash = this._hash.digest(); + var sig = sign(hash, key, this._hashType, this._signType, this._tag); + return enc ? sig.toString(enc) : sig; + }; + function Verify2(algorithm) { + stream2.Writable.call(this); + var data = algorithms[algorithm]; + if (!data) { + throw new Error("Unknown message digest"); + } + this._hash = createHash2(data.hash); + this._tag = data.id; + this._signType = data.sign; + } + inherits2(Verify2, stream2.Writable); + Verify2.prototype._write = function _write(data, _6, done) { + this._hash.update(data); + done(); + }; + Verify2.prototype.update = function update2(data, enc) { + this._hash.update(typeof data === "string" ? Buffer4.from(data, enc) : data); + return this; + }; + Verify2.prototype.verify = function verifyMethod(key, sig, enc) { + var sigBuffer = typeof sig === "string" ? Buffer4.from(sig, enc) : sig; + this.end(); + var hash = this._hash.digest(); + return verify(sigBuffer, hash, key, this._signType, this._tag); + }; + function createSign2(algorithm) { + return new Sign2(algorithm); + } + function createVerify2(algorithm) { + return new Verify2(algorithm); + } + exports$c4 = { + Sign: createSign2, + Verify: createVerify2, + createSign: createSign2, + createVerify: createVerify2 + }; + return exports$c4; +} +function dew$a4() { + if (_dewExec$a4) + return module$1.exports; + _dewExec$a4 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$3).negative = 0; + (this || _global$3).words = null; + (this || _global$3).length = 0; + (this || _global$3).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$3).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$3).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$3).words = [number & 67108863]; + (this || _global$3).length = 1; + } else if (number < 4503599627370496) { + (this || _global$3).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$3).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$3).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$3).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$3).words = [0]; + (this || _global$3).length = 1; + return this || _global$3; + } + (this || _global$3).length = Math.ceil(number.length / 3); + (this || _global$3).words = new Array((this || _global$3).length); + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + (this || _global$3).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$3).words[j6] |= w6 << off3 & 67108863; + (this || _global$3).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$3).words[j6] |= w6 << off3 & 67108863; + (this || _global$3).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$3).length = Math.ceil((number.length - start) / 6); + (this || _global$3).words = new Array((this || _global$3).length); + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + (this || _global$3).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$3).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$3).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$3).words = [0]; + (this || _global$3).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$3).words[0] + word < 67108864) { + (this || _global$3).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$3).words[0] + word < 67108864) { + (this || _global$3).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$3).length); + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + dest.words[i7] = (this || _global$3).words[i7]; + } + dest.length = (this || _global$3).length; + dest.negative = (this || _global$3).negative; + dest.red = (this || _global$3).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$3).length < size2) { + (this || _global$3).words[(this || _global$3).length++] = 0; + } + return this || _global$3; + }; + BN.prototype.strip = function strip() { + while ((this || _global$3).length > 1 && (this || _global$3).words[(this || _global$3).length - 1] === 0) { + (this || _global$3).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$3).length === 1 && (this || _global$3).words[0] === 0) { + (this || _global$3).negative = 0; + } + return this || _global$3; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$3).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + var w6 = (this || _global$3).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$3).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$3).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$3).words[0]; + if ((this || _global$3).length === 2) { + ret += (this || _global$3).words[1] * 67108864; + } else if ((this || _global$3).length === 3 && (this || _global$3).words[2] === 1) { + ret += 4503599627370496 + (this || _global$3).words[1] * 67108864; + } else if ((this || _global$3).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$3).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$3).words[(this || _global$3).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$3).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + var b8 = this._zeroBits((this || _global$3).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$3).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$3).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$3).negative ^= 1; + } + return this || _global$3; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$3).length < num.length) { + (this || _global$3).words[(this || _global$3).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$3).words[i7] = (this || _global$3).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$3).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$3).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$3); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$3).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$3); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$3).length > num.length) { + b8 = num; + } else { + b8 = this || _global$3; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3).words[i7] = (this || _global$3).words[i7] & num.words[i7]; + } + (this || _global$3).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$3).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$3).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$3); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$3).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$3); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$3).length > num.length) { + a7 = this || _global$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$3).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$3) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$3).words[i7] = a7.words[i7]; + } + } + (this || _global$3).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$3).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$3).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$3); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$3).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$3); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$3).words[i7] = ~(this || _global$3).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$3).words[i7] = ~(this || _global$3).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$3).words[off3] = (this || _global$3).words[off3] | 1 << wbit; + } else { + (this || _global$3).words[off3] = (this || _global$3).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$3).negative !== 0 && num.negative === 0) { + (this || _global$3).negative = 0; + r8 = this.isub(num); + (this || _global$3).negative ^= 1; + return this._normSign(); + } else if ((this || _global$3).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$3).length > num.length) { + a7 = this || _global$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$3).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$3).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$3).length = a7.length; + if (carry !== 0) { + (this || _global$3).words[(this || _global$3).length] = carry; + (this || _global$3).length++; + } else if (a7 !== (this || _global$3)) { + for (; i7 < a7.length; i7++) { + (this || _global$3).words[i7] = a7.words[i7]; + } + } + return this || _global$3; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$3).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$3).negative !== 0) { + (this || _global$3).negative = 0; + res = num.sub(this || _global$3); + (this || _global$3).negative = 1; + return res; + } + if ((this || _global$3).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$3); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$3).negative !== 0) { + (this || _global$3).negative = 0; + this.iadd(num); + (this || _global$3).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$3).negative = 0; + (this || _global$3).length = 1; + (this || _global$3).words[0] = 0; + return this || _global$3; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$3; + b8 = num; + } else { + a7 = num; + b8 = this || _global$3; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$3).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$3)) { + for (; i7 < a7.length; i7++) { + (this || _global$3).words[i7] = a7.words[i7]; + } + } + (this || _global$3).length = Math.max((this || _global$3).length, i7); + if (a7 !== (this || _global$3)) { + (this || _global$3).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$3).length + num.length; + if ((this || _global$3).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$3, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$3, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$3, num, out); + } else { + res = jumboMulTo(this || _global$3, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$3).x = x7; + (this || _global$3).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$3).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$3).length + num.length); + return jumboMulTo(this || _global$3, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$3); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$3).length; i7++) { + var w6 = ((this || _global$3).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$3).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$3).words[i7] = carry; + (this || _global$3).length++; + } + return this || _global$3; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$3); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$3; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$3).length; i7++) { + var newCarry = (this || _global$3).words[i7] & carryMask; + var c7 = ((this || _global$3).words[i7] | 0) - newCarry << r8; + (this || _global$3).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$3).words[i7] = carry; + (this || _global$3).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$3).length - 1; i7 >= 0; i7--) { + (this || _global$3).words[i7 + s7] = (this || _global$3).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$3).words[i7] = 0; + } + (this || _global$3).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$3).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$3).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$3).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$3).length > s7) { + (this || _global$3).length -= s7; + for (i7 = 0; i7 < (this || _global$3).length; i7++) { + (this || _global$3).words[i7] = (this || _global$3).words[i7 + s7]; + } + } else { + (this || _global$3).words[0] = 0; + (this || _global$3).length = 1; + } + var carry = 0; + for (i7 = (this || _global$3).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$3).words[i7] | 0; + (this || _global$3).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$3).length === 0) { + (this || _global$3).words[0] = 0; + (this || _global$3).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$3).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3).length <= s7) + return false; + var w6 = (this || _global$3).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$3).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$3).length <= s7) { + return this || _global$3; + } + if (r8 !== 0) { + s7++; + } + (this || _global$3).length = Math.min(s7, (this || _global$3).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$3).words[(this || _global$3).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$3).negative !== 0) { + if ((this || _global$3).length === 1 && ((this || _global$3).words[0] | 0) < num) { + (this || _global$3).words[0] = num - ((this || _global$3).words[0] | 0); + (this || _global$3).negative = 0; + return this || _global$3; + } + (this || _global$3).negative = 0; + this.isubn(num); + (this || _global$3).negative = 1; + return this || _global$3; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$3).words[0] += num; + for (var i7 = 0; i7 < (this || _global$3).length && (this || _global$3).words[i7] >= 67108864; i7++) { + (this || _global$3).words[i7] -= 67108864; + if (i7 === (this || _global$3).length - 1) { + (this || _global$3).words[i7 + 1] = 1; + } else { + (this || _global$3).words[i7 + 1]++; + } + } + (this || _global$3).length = Math.max((this || _global$3).length, i7 + 1); + return this || _global$3; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$3).negative !== 0) { + (this || _global$3).negative = 0; + this.iaddn(num); + (this || _global$3).negative = 1; + return this || _global$3; + } + (this || _global$3).words[0] -= num; + if ((this || _global$3).length === 1 && (this || _global$3).words[0] < 0) { + (this || _global$3).words[0] = -(this || _global$3).words[0]; + (this || _global$3).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$3).length && (this || _global$3).words[i7] < 0; i7++) { + (this || _global$3).words[i7] += 67108864; + (this || _global$3).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$3).negative = 0; + return this || _global$3; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$3).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$3).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$3).length - shift; i7++) { + w6 = ((this || _global$3).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$3).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$3).length; i7++) { + w6 = -((this || _global$3).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$3).words[i7] = w6 & 67108863; + } + (this || _global$3).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$3).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$3).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$3).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$3).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$3).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$3 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$3).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$3).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$3).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$3).words[i7] | 0) + carry * 67108864; + (this || _global$3).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$3; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$3; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$3).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$3).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$3).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$3).length <= s7) { + this._expand(s7 + 1); + (this || _global$3).words[s7] |= q5; + return this || _global$3; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$3).length; i7++) { + var w6 = (this || _global$3).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$3).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$3).words[i7] = carry; + (this || _global$3).length++; + } + return this || _global$3; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$3).length === 1 && (this || _global$3).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$3).negative !== 0 && !negative) + return -1; + if ((this || _global$3).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$3).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$3).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$3).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$3).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$3).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$3).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$3).length > num.length) + return 1; + if ((this || _global$3).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$3).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$3).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$3).red, "Already a number in reduction context"); + assert4((this || _global$3).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$3)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$3).red, "fromRed works only with numbers in reduction context"); + return (this || _global$3).red.convertFrom(this || _global$3); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$3).red = ctx; + return this || _global$3; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$3).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$3).red, "redAdd works only with red numbers"); + return (this || _global$3).red.add(this || _global$3, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$3).red, "redIAdd works only with red numbers"); + return (this || _global$3).red.iadd(this || _global$3, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$3).red, "redSub works only with red numbers"); + return (this || _global$3).red.sub(this || _global$3, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$3).red, "redISub works only with red numbers"); + return (this || _global$3).red.isub(this || _global$3, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$3).red, "redShl works only with red numbers"); + return (this || _global$3).red.shl(this || _global$3, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$3).red, "redMul works only with red numbers"); + (this || _global$3).red._verify2(this || _global$3, num); + return (this || _global$3).red.mul(this || _global$3, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$3).red, "redMul works only with red numbers"); + (this || _global$3).red._verify2(this || _global$3, num); + return (this || _global$3).red.imul(this || _global$3, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$3).red, "redSqr works only with red numbers"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.sqr(this || _global$3); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$3).red, "redISqr works only with red numbers"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.isqr(this || _global$3); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$3).red, "redSqrt works only with red numbers"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.sqrt(this || _global$3); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$3).red, "redInvm works only with red numbers"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.invm(this || _global$3); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$3).red, "redNeg works only with red numbers"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.neg(this || _global$3); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$3).red && !num.red, "redPow(normalNum)"); + (this || _global$3).red._verify1(this || _global$3); + return (this || _global$3).red.pow(this || _global$3, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$3).name = name2; + (this || _global$3).p = new BN(p7, 16); + (this || _global$3).n = (this || _global$3).p.bitLength(); + (this || _global$3).k = new BN(1).iushln((this || _global$3).n).isub((this || _global$3).p); + (this || _global$3).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$3).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$3).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$3).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$3).n); + var cmp = rlen < (this || _global$3).n ? -1 : r8.ucmp((this || _global$3).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$3).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$3).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$3).k); + }; + function K256() { + MPrime.call(this || _global$3, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$3, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$3, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$3, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$3).m = prime.p; + (this || _global$3).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$3).m = m7; + (this || _global$3).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$3).prime) + return (this || _global$3).prime.ireduce(a7)._forceRed(this || _global$3); + return a7.umod((this || _global$3).m)._forceRed(this || _global$3); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$3).m.sub(a7)._forceRed(this || _global$3); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$3).m) >= 0) { + res.isub((this || _global$3).m); + } + return res._forceRed(this || _global$3); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$3).m) >= 0) { + res.isub((this || _global$3).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3).m); + } + return res._forceRed(this || _global$3); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$3).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$3).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$3).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$3).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$3); + var nOne = one.redNeg(); + var lpow = (this || _global$3).m.subn(1).iushrn(1); + var z6 = (this || _global$3).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$3); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$3).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$3); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$3); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$3).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$3, m7); + (this || _global$3).shift = (this || _global$3).m.bitLength(); + if ((this || _global$3).shift % 26 !== 0) { + (this || _global$3).shift += 26 - (this || _global$3).shift % 26; + } + (this || _global$3).r = new BN(1).iushln((this || _global$3).shift); + (this || _global$3).r2 = this.imod((this || _global$3).r.sqr()); + (this || _global$3).rinv = (this || _global$3).r._invmp((this || _global$3).m); + (this || _global$3).minv = (this || _global$3).rinv.mul((this || _global$3).r).isubn(1).div((this || _global$3).m); + (this || _global$3).minv = (this || _global$3).minv.umod((this || _global$3).r); + (this || _global$3).minv = (this || _global$3).r.sub((this || _global$3).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$3).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$3).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$3).shift).mul((this || _global$3).minv).imaskn((this || _global$3).shift).mul((this || _global$3).m); + var u7 = t8.isub(c7).iushrn((this || _global$3).shift); + var res = u7; + if (u7.cmp((this || _global$3).m) >= 0) { + res = u7.isub((this || _global$3).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3).m); + } + return res._forceRed(this || _global$3); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$3); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$3).shift).mul((this || _global$3).minv).imaskn((this || _global$3).shift).mul((this || _global$3).m); + var u7 = t8.isub(c7).iushrn((this || _global$3).shift); + var res = u7; + if (u7.cmp((this || _global$3).m) >= 0) { + res = u7.isub((this || _global$3).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$3).m); + } + return res._forceRed(this || _global$3); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$3).m).mul((this || _global$3).r2)); + return res._forceRed(this || _global$3); + }; + })(module$1, exports$b4); + return module$1.exports; +} +function dew$94() { + if (_dewExec$94) + return exports$a4; + _dewExec$94 = true; + var Buffer4 = dew().Buffer; + var elliptic = dew$x(); + var BN = dew$a4(); + exports$a4 = function createECDH2(curve) { + return new ECDH(curve); + }; + var aliases = { + secp256k1: { + name: "secp256k1", + byteLength: 32 + }, + secp224r1: { + name: "p224", + byteLength: 28 + }, + prime256v1: { + name: "p256", + byteLength: 32 + }, + prime192v1: { + name: "p192", + byteLength: 24 + }, + ed25519: { + name: "ed25519", + byteLength: 32 + }, + secp384r1: { + name: "p384", + byteLength: 48 + }, + secp521r1: { + name: "p521", + byteLength: 66 + } + }; + aliases.p224 = aliases.secp224r1; + aliases.p256 = aliases.secp256r1 = aliases.prime256v1; + aliases.p192 = aliases.secp192r1 = aliases.prime192v1; + aliases.p384 = aliases.secp384r1; + aliases.p521 = aliases.secp521r1; + function ECDH(curve) { + (this || _global$23).curveType = aliases[curve]; + if (!(this || _global$23).curveType) { + (this || _global$23).curveType = { + name: curve + }; + } + (this || _global$23).curve = new elliptic.ec((this || _global$23).curveType.name); + (this || _global$23).keys = void 0; + } + ECDH.prototype.generateKeys = function(enc, format5) { + (this || _global$23).keys = (this || _global$23).curve.genKeyPair(); + return this.getPublicKey(enc, format5); + }; + ECDH.prototype.computeSecret = function(other, inenc, enc) { + inenc = inenc || "utf8"; + if (!Buffer4.isBuffer(other)) { + other = new Buffer4(other, inenc); + } + var otherPub = (this || _global$23).curve.keyFromPublic(other).getPublic(); + var out = otherPub.mul((this || _global$23).keys.getPrivate()).getX(); + return formatReturnValue(out, enc, (this || _global$23).curveType.byteLength); + }; + ECDH.prototype.getPublicKey = function(enc, format5) { + var key = (this || _global$23).keys.getPublic(format5 === "compressed", true); + if (format5 === "hybrid") { + if (key[key.length - 1] % 2) { + key[0] = 7; + } else { + key[0] = 6; + } + } + return formatReturnValue(key, enc); + }; + ECDH.prototype.getPrivateKey = function(enc) { + return formatReturnValue((this || _global$23).keys.getPrivate(), enc); + }; + ECDH.prototype.setPublicKey = function(pub, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(pub)) { + pub = new Buffer4(pub, enc); + } + (this || _global$23).keys._importPublic(pub); + return this || _global$23; + }; + ECDH.prototype.setPrivateKey = function(priv, enc) { + enc = enc || "utf8"; + if (!Buffer4.isBuffer(priv)) { + priv = new Buffer4(priv, enc); + } + var _priv = new BN(priv); + _priv = _priv.toString(16); + (this || _global$23).keys = (this || _global$23).curve.genKeyPair(); + (this || _global$23).keys._importPrivate(_priv); + return this || _global$23; + }; + function formatReturnValue(bn, enc, len) { + if (!Array.isArray(bn)) { + bn = bn.toArray(); + } + var buf = new Buffer4(bn); + if (len && buf.length < len) { + var zeros = new Buffer4(len - buf.length); + zeros.fill(0); + buf = Buffer4.concat([zeros, buf]); + } + if (!enc) { + return buf; + } else { + return buf.toString(enc); + } + } + return exports$a4; +} +function dew$84() { + if (_dewExec$84) + return exports$94; + _dewExec$84 = true; + var createHash2 = dew$3t(); + var Buffer4 = dew$15().Buffer; + exports$94 = function(seed, len) { + var t8 = Buffer4.alloc(0); + var i7 = 0; + var c7; + while (t8.length < len) { + c7 = i2ops(i7++); + t8 = Buffer4.concat([t8, createHash2("sha1").update(seed).update(c7).digest()]); + } + return t8.slice(0, len); + }; + function i2ops(c7) { + var out = Buffer4.allocUnsafe(4); + out.writeUInt32BE(c7, 0); + return out; + } + return exports$94; +} +function dew$75() { + if (_dewExec$75) + return exports$85; + _dewExec$75 = true; + exports$85 = function xor2(a7, b8) { + var len = a7.length; + var i7 = -1; + while (++i7 < len) { + a7[i7] ^= b8[i7]; + } + return a7; + }; + return exports$85; +} +function dew$65() { + if (_dewExec$65) + return module3.exports; + _dewExec$65 = true; + (function(module5, exports28) { + function assert4(val, msg) { + if (!val) + throw new Error(msg || "Assertion failed"); + } + function inherits2(ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + function BN(number, base, endian) { + if (BN.isBN(number)) { + return number; + } + (this || _global$110).negative = 0; + (this || _global$110).words = null; + (this || _global$110).length = 0; + (this || _global$110).red = null; + if (number !== null) { + if (base === "le" || base === "be") { + endian = base; + base = 10; + } + this._init(number || 0, base || 10, endian || "be"); + } + } + if (typeof module5 === "object") { + module5.exports = BN; + } else { + exports28.BN = BN; + } + BN.BN = BN; + BN.wordSize = 26; + var Buffer4; + try { + if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { + Buffer4 = window.Buffer; + } else { + Buffer4 = dew().Buffer; + } + } catch (e10) { + } + BN.isBN = function isBN(num) { + if (num instanceof BN) { + return true; + } + return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + BN.max = function max2(left, right) { + if (left.cmp(right) > 0) + return left; + return right; + }; + BN.min = function min2(left, right) { + if (left.cmp(right) < 0) + return left; + return right; + }; + BN.prototype._init = function init2(number, base, endian) { + if (typeof number === "number") { + return this._initNumber(number, base, endian); + } + if (typeof number === "object") { + return this._initArray(number, base, endian); + } + if (base === "hex") { + base = 16; + } + assert4(base === (base | 0) && base >= 2 && base <= 36); + number = number.toString().replace(/\s+/g, ""); + var start = 0; + if (number[0] === "-") { + start++; + (this || _global$110).negative = 1; + } + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === "le") { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + BN.prototype._initNumber = function _initNumber(number, base, endian) { + if (number < 0) { + (this || _global$110).negative = 1; + number = -number; + } + if (number < 67108864) { + (this || _global$110).words = [number & 67108863]; + (this || _global$110).length = 1; + } else if (number < 4503599627370496) { + (this || _global$110).words = [number & 67108863, number / 67108864 & 67108863]; + (this || _global$110).length = 2; + } else { + assert4(number < 9007199254740992); + (this || _global$110).words = [number & 67108863, number / 67108864 & 67108863, 1]; + (this || _global$110).length = 3; + } + if (endian !== "le") + return; + this._initArray(this.toArray(), base, endian); + }; + BN.prototype._initArray = function _initArray(number, base, endian) { + assert4(typeof number.length === "number"); + if (number.length <= 0) { + (this || _global$110).words = [0]; + (this || _global$110).length = 1; + return this || _global$110; + } + (this || _global$110).length = Math.ceil(number.length / 3); + (this || _global$110).words = new Array((this || _global$110).length); + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + (this || _global$110).words[i7] = 0; + } + var j6, w6; + var off3 = 0; + if (endian === "be") { + for (i7 = number.length - 1, j6 = 0; i7 >= 0; i7 -= 3) { + w6 = number[i7] | number[i7 - 1] << 8 | number[i7 - 2] << 16; + (this || _global$110).words[j6] |= w6 << off3 & 67108863; + (this || _global$110).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } else if (endian === "le") { + for (i7 = 0, j6 = 0; i7 < number.length; i7 += 3) { + w6 = number[i7] | number[i7 + 1] << 8 | number[i7 + 2] << 16; + (this || _global$110).words[j6] |= w6 << off3 & 67108863; + (this || _global$110).words[j6 + 1] = w6 >>> 26 - off3 & 67108863; + off3 += 24; + if (off3 >= 26) { + off3 -= 26; + j6++; + } + } + } + return this.strip(); + }; + function parseHex4Bits(string2, index4) { + var c7 = string2.charCodeAt(index4); + if (c7 >= 65 && c7 <= 70) { + return c7 - 55; + } else if (c7 >= 97 && c7 <= 102) { + return c7 - 87; + } else { + return c7 - 48 & 15; + } + } + function parseHexByte(string2, lowerBound, index4) { + var r8 = parseHex4Bits(string2, index4); + if (index4 - 1 >= lowerBound) { + r8 |= parseHex4Bits(string2, index4 - 1) << 4; + } + return r8; + } + BN.prototype._parseHex = function _parseHex(number, start, endian) { + (this || _global$110).length = Math.ceil((number.length - start) / 6); + (this || _global$110).words = new Array((this || _global$110).length); + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + (this || _global$110).words[i7] = 0; + } + var off3 = 0; + var j6 = 0; + var w6; + if (endian === "be") { + for (i7 = number.length - 1; i7 >= start; i7 -= 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$110).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$110).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } else { + var parseLength = number.length - start; + for (i7 = parseLength % 2 === 0 ? start + 1 : start; i7 < number.length; i7 += 2) { + w6 = parseHexByte(number, start, i7) << off3; + (this || _global$110).words[j6] |= w6 & 67108863; + if (off3 >= 18) { + off3 -= 18; + j6 += 1; + (this || _global$110).words[j6] |= w6 >>> 26; + } else { + off3 += 8; + } + } + } + this.strip(); + }; + function parseBase(str2, start, end, mul) { + var r8 = 0; + var len = Math.min(str2.length, end); + for (var i7 = start; i7 < len; i7++) { + var c7 = str2.charCodeAt(i7) - 48; + r8 *= mul; + if (c7 >= 49) { + r8 += c7 - 49 + 10; + } else if (c7 >= 17) { + r8 += c7 - 17 + 10; + } else { + r8 += c7; + } + } + return r8; + } + BN.prototype._parseBase = function _parseBase(number, base, start) { + (this || _global$110).words = [0]; + (this || _global$110).length = 1; + for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = limbPow / base | 0; + var total = number.length - start; + var mod2 = total % limbLen; + var end = Math.min(total, total - mod2) + start; + var word = 0; + for (var i7 = start; i7 < end; i7 += limbLen) { + word = parseBase(number, i7, i7 + limbLen, base); + this.imuln(limbPow); + if ((this || _global$110).words[0] + word < 67108864) { + (this || _global$110).words[0] += word; + } else { + this._iaddn(word); + } + } + if (mod2 !== 0) { + var pow = 1; + word = parseBase(number, i7, number.length, base); + for (i7 = 0; i7 < mod2; i7++) { + pow *= base; + } + this.imuln(pow); + if ((this || _global$110).words[0] + word < 67108864) { + (this || _global$110).words[0] += word; + } else { + this._iaddn(word); + } + } + this.strip(); + }; + BN.prototype.copy = function copy4(dest) { + dest.words = new Array((this || _global$110).length); + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + dest.words[i7] = (this || _global$110).words[i7]; + } + dest.length = (this || _global$110).length; + dest.negative = (this || _global$110).negative; + dest.red = (this || _global$110).red; + }; + BN.prototype.clone = function clone2() { + var r8 = new BN(null); + this.copy(r8); + return r8; + }; + BN.prototype._expand = function _expand(size2) { + while ((this || _global$110).length < size2) { + (this || _global$110).words[(this || _global$110).length++] = 0; + } + return this || _global$110; + }; + BN.prototype.strip = function strip() { + while ((this || _global$110).length > 1 && (this || _global$110).words[(this || _global$110).length - 1] === 0) { + (this || _global$110).length--; + } + return this._normSign(); + }; + BN.prototype._normSign = function _normSign() { + if ((this || _global$110).length === 1 && (this || _global$110).words[0] === 0) { + (this || _global$110).negative = 0; + } + return this || _global$110; + }; + BN.prototype.inspect = function inspect2() { + return ((this || _global$110).red ? ""; + }; + var zeros = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"]; + var groupSizes = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]; + var groupBases = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + BN.prototype.toString = function toString3(base, padding) { + base = base || 10; + padding = padding | 0 || 1; + var out; + if (base === 16 || base === "hex") { + out = ""; + var off3 = 0; + var carry = 0; + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + var w6 = (this || _global$110).words[i7]; + var word = ((w6 << off3 | carry) & 16777215).toString(16); + carry = w6 >>> 24 - off3 & 16777215; + if (carry !== 0 || i7 !== (this || _global$110).length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off3 += 2; + if (off3 >= 26) { + off3 -= 26; + i7--; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$110).negative !== 0) { + out = "-" + out; + } + return out; + } + if (base === (base | 0) && base >= 2 && base <= 36) { + var groupSize = groupSizes[base]; + var groupBase = groupBases[base]; + out = ""; + var c7 = this.clone(); + c7.negative = 0; + while (!c7.isZero()) { + var r8 = c7.modn(groupBase).toString(base); + c7 = c7.idivn(groupBase); + if (!c7.isZero()) { + out = zeros[groupSize - r8.length] + r8 + out; + } else { + out = r8 + out; + } + } + if (this.isZero()) { + out = "0" + out; + } + while (out.length % padding !== 0) { + out = "0" + out; + } + if ((this || _global$110).negative !== 0) { + out = "-" + out; + } + return out; + } + assert4(false, "Base should be between 2 and 36"); + }; + BN.prototype.toNumber = function toNumber3() { + var ret = (this || _global$110).words[0]; + if ((this || _global$110).length === 2) { + ret += (this || _global$110).words[1] * 67108864; + } else if ((this || _global$110).length === 3 && (this || _global$110).words[2] === 1) { + ret += 4503599627370496 + (this || _global$110).words[1] * 67108864; + } else if ((this || _global$110).length > 2) { + assert4(false, "Number can only safely store up to 53 bits"); + } + return (this || _global$110).negative !== 0 ? -ret : ret; + }; + BN.prototype.toJSON = function toJSON() { + return this.toString(16); + }; + BN.prototype.toBuffer = function toBuffer(endian, length) { + assert4(typeof Buffer4 !== "undefined"); + return this.toArrayLike(Buffer4, endian, length); + }; + BN.prototype.toArray = function toArray3(endian, length) { + return this.toArrayLike(Array, endian, length); + }; + BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert4(byteLength <= reqLength, "byte array longer than desired length"); + assert4(reqLength > 0, "Requested array length <= 0"); + this.strip(); + var littleEndian = endian === "le"; + var res = new ArrayType(reqLength); + var b8, i7; + var q5 = this.clone(); + if (!littleEndian) { + for (i7 = 0; i7 < reqLength - byteLength; i7++) { + res[i7] = 0; + } + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[reqLength - i7 - 1] = b8; + } + } else { + for (i7 = 0; !q5.isZero(); i7++) { + b8 = q5.andln(255); + q5.iushrn(8); + res[i7] = b8; + } + for (; i7 < reqLength; i7++) { + res[i7] = 0; + } + } + return res; + }; + if (Math.clz32) { + BN.prototype._countBits = function _countBits(w6) { + return 32 - Math.clz32(w6); + }; + } else { + BN.prototype._countBits = function _countBits(w6) { + var t8 = w6; + var r8 = 0; + if (t8 >= 4096) { + r8 += 13; + t8 >>>= 13; + } + if (t8 >= 64) { + r8 += 7; + t8 >>>= 7; + } + if (t8 >= 8) { + r8 += 4; + t8 >>>= 4; + } + if (t8 >= 2) { + r8 += 2; + t8 >>>= 2; + } + return r8 + t8; + }; + } + BN.prototype._zeroBits = function _zeroBits(w6) { + if (w6 === 0) + return 26; + var t8 = w6; + var r8 = 0; + if ((t8 & 8191) === 0) { + r8 += 13; + t8 >>>= 13; + } + if ((t8 & 127) === 0) { + r8 += 7; + t8 >>>= 7; + } + if ((t8 & 15) === 0) { + r8 += 4; + t8 >>>= 4; + } + if ((t8 & 3) === 0) { + r8 += 2; + t8 >>>= 2; + } + if ((t8 & 1) === 0) { + r8++; + } + return r8; + }; + BN.prototype.bitLength = function bitLength() { + var w6 = (this || _global$110).words[(this || _global$110).length - 1]; + var hi = this._countBits(w6); + return ((this || _global$110).length - 1) * 26 + hi; + }; + function toBitArray(num) { + var w6 = new Array(num.bitLength()); + for (var bit = 0; bit < w6.length; bit++) { + var off3 = bit / 26 | 0; + var wbit = bit % 26; + w6[bit] = (num.words[off3] & 1 << wbit) >>> wbit; + } + return w6; + } + BN.prototype.zeroBits = function zeroBits() { + if (this.isZero()) + return 0; + var r8 = 0; + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + var b8 = this._zeroBits((this || _global$110).words[i7]); + r8 += b8; + if (b8 !== 26) + break; + } + return r8; + }; + BN.prototype.byteLength = function byteLength() { + return Math.ceil(this.bitLength() / 8); + }; + BN.prototype.toTwos = function toTwos(width) { + if ((this || _global$110).negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + BN.prototype.fromTwos = function fromTwos(width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + BN.prototype.isNeg = function isNeg() { + return (this || _global$110).negative !== 0; + }; + BN.prototype.neg = function neg() { + return this.clone().ineg(); + }; + BN.prototype.ineg = function ineg() { + if (!this.isZero()) { + (this || _global$110).negative ^= 1; + } + return this || _global$110; + }; + BN.prototype.iuor = function iuor(num) { + while ((this || _global$110).length < num.length) { + (this || _global$110).words[(this || _global$110).length++] = 0; + } + for (var i7 = 0; i7 < num.length; i7++) { + (this || _global$110).words[i7] = (this || _global$110).words[i7] | num.words[i7]; + } + return this.strip(); + }; + BN.prototype.ior = function ior(num) { + assert4(((this || _global$110).negative | num.negative) === 0); + return this.iuor(num); + }; + BN.prototype.or = function or(num) { + if ((this || _global$110).length > num.length) + return this.clone().ior(num); + return num.clone().ior(this || _global$110); + }; + BN.prototype.uor = function uor(num) { + if ((this || _global$110).length > num.length) + return this.clone().iuor(num); + return num.clone().iuor(this || _global$110); + }; + BN.prototype.iuand = function iuand(num) { + var b8; + if ((this || _global$110).length > num.length) { + b8 = num; + } else { + b8 = this || _global$110; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$110).words[i7] = (this || _global$110).words[i7] & num.words[i7]; + } + (this || _global$110).length = b8.length; + return this.strip(); + }; + BN.prototype.iand = function iand(num) { + assert4(((this || _global$110).negative | num.negative) === 0); + return this.iuand(num); + }; + BN.prototype.and = function and(num) { + if ((this || _global$110).length > num.length) + return this.clone().iand(num); + return num.clone().iand(this || _global$110); + }; + BN.prototype.uand = function uand(num) { + if ((this || _global$110).length > num.length) + return this.clone().iuand(num); + return num.clone().iuand(this || _global$110); + }; + BN.prototype.iuxor = function iuxor(num) { + var a7; + var b8; + if ((this || _global$110).length > num.length) { + a7 = this || _global$110; + b8 = num; + } else { + a7 = num; + b8 = this || _global$110; + } + for (var i7 = 0; i7 < b8.length; i7++) { + (this || _global$110).words[i7] = a7.words[i7] ^ b8.words[i7]; + } + if ((this || _global$110) !== a7) { + for (; i7 < a7.length; i7++) { + (this || _global$110).words[i7] = a7.words[i7]; + } + } + (this || _global$110).length = a7.length; + return this.strip(); + }; + BN.prototype.ixor = function ixor(num) { + assert4(((this || _global$110).negative | num.negative) === 0); + return this.iuxor(num); + }; + BN.prototype.xor = function xor2(num) { + if ((this || _global$110).length > num.length) + return this.clone().ixor(num); + return num.clone().ixor(this || _global$110); + }; + BN.prototype.uxor = function uxor(num) { + if ((this || _global$110).length > num.length) + return this.clone().iuxor(num); + return num.clone().iuxor(this || _global$110); + }; + BN.prototype.inotn = function inotn(width) { + assert4(typeof width === "number" && width >= 0); + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + this._expand(bytesNeeded); + if (bitsLeft > 0) { + bytesNeeded--; + } + for (var i7 = 0; i7 < bytesNeeded; i7++) { + (this || _global$110).words[i7] = ~(this || _global$110).words[i7] & 67108863; + } + if (bitsLeft > 0) { + (this || _global$110).words[i7] = ~(this || _global$110).words[i7] & 67108863 >> 26 - bitsLeft; + } + return this.strip(); + }; + BN.prototype.notn = function notn(width) { + return this.clone().inotn(width); + }; + BN.prototype.setn = function setn(bit, val) { + assert4(typeof bit === "number" && bit >= 0); + var off3 = bit / 26 | 0; + var wbit = bit % 26; + this._expand(off3 + 1); + if (val) { + (this || _global$110).words[off3] = (this || _global$110).words[off3] | 1 << wbit; + } else { + (this || _global$110).words[off3] = (this || _global$110).words[off3] & ~(1 << wbit); + } + return this.strip(); + }; + BN.prototype.iadd = function iadd(num) { + var r8; + if ((this || _global$110).negative !== 0 && num.negative === 0) { + (this || _global$110).negative = 0; + r8 = this.isub(num); + (this || _global$110).negative ^= 1; + return this._normSign(); + } else if ((this || _global$110).negative === 0 && num.negative !== 0) { + num.negative = 0; + r8 = this.isub(num); + num.negative = 1; + return r8._normSign(); + } + var a7, b8; + if ((this || _global$110).length > num.length) { + a7 = this || _global$110; + b8 = num; + } else { + a7 = num; + b8 = this || _global$110; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) + (b8.words[i7] | 0) + carry; + (this || _global$110).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + (this || _global$110).words[i7] = r8 & 67108863; + carry = r8 >>> 26; + } + (this || _global$110).length = a7.length; + if (carry !== 0) { + (this || _global$110).words[(this || _global$110).length] = carry; + (this || _global$110).length++; + } else if (a7 !== (this || _global$110)) { + for (; i7 < a7.length; i7++) { + (this || _global$110).words[i7] = a7.words[i7]; + } + } + return this || _global$110; + }; + BN.prototype.add = function add2(num) { + var res; + if (num.negative !== 0 && (this || _global$110).negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && (this || _global$110).negative !== 0) { + (this || _global$110).negative = 0; + res = num.sub(this || _global$110); + (this || _global$110).negative = 1; + return res; + } + if ((this || _global$110).length > num.length) + return this.clone().iadd(num); + return num.clone().iadd(this || _global$110); + }; + BN.prototype.isub = function isub(num) { + if (num.negative !== 0) { + num.negative = 0; + var r8 = this.iadd(num); + num.negative = 1; + return r8._normSign(); + } else if ((this || _global$110).negative !== 0) { + (this || _global$110).negative = 0; + this.iadd(num); + (this || _global$110).negative = 1; + return this._normSign(); + } + var cmp = this.cmp(num); + if (cmp === 0) { + (this || _global$110).negative = 0; + (this || _global$110).length = 1; + (this || _global$110).words[0] = 0; + return this || _global$110; + } + var a7, b8; + if (cmp > 0) { + a7 = this || _global$110; + b8 = num; + } else { + a7 = num; + b8 = this || _global$110; + } + var carry = 0; + for (var i7 = 0; i7 < b8.length; i7++) { + r8 = (a7.words[i7] | 0) - (b8.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$110).words[i7] = r8 & 67108863; + } + for (; carry !== 0 && i7 < a7.length; i7++) { + r8 = (a7.words[i7] | 0) + carry; + carry = r8 >> 26; + (this || _global$110).words[i7] = r8 & 67108863; + } + if (carry === 0 && i7 < a7.length && a7 !== (this || _global$110)) { + for (; i7 < a7.length; i7++) { + (this || _global$110).words[i7] = a7.words[i7]; + } + } + (this || _global$110).length = Math.max((this || _global$110).length, i7); + if (a7 !== (this || _global$110)) { + (this || _global$110).negative = 1; + } + return this.strip(); + }; + BN.prototype.sub = function sub(num) { + return this.clone().isub(num); + }; + function smallMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + var len = self2.length + num.length | 0; + out.length = len; + len = len - 1 | 0; + var a7 = self2.words[0] | 0; + var b8 = num.words[0] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + var carry = r8 / 67108864 | 0; + out.words[0] = lo; + for (var k6 = 1; k6 < len; k6++) { + var ncarry = carry >>> 26; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6 | 0; + a7 = self2.words[i7] | 0; + b8 = num.words[j6] | 0; + r8 = a7 * b8 + rword; + ncarry += r8 / 67108864 | 0; + rword = r8 & 67108863; + } + out.words[k6] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k6] = carry | 0; + } else { + out.length--; + } + return out.strip(); + } + var comb10MulTo = function comb10MulTo2(self2, num, out) { + var a7 = self2.words; + var b8 = num.words; + var o7 = out.words; + var c7 = 0; + var lo; + var mid; + var hi; + var a0 = a7[0] | 0; + var al0 = a0 & 8191; + var ah0 = a0 >>> 13; + var a1 = a7[1] | 0; + var al1 = a1 & 8191; + var ah1 = a1 >>> 13; + var a22 = a7[2] | 0; + var al2 = a22 & 8191; + var ah2 = a22 >>> 13; + var a32 = a7[3] | 0; + var al3 = a32 & 8191; + var ah3 = a32 >>> 13; + var a42 = a7[4] | 0; + var al4 = a42 & 8191; + var ah4 = a42 >>> 13; + var a52 = a7[5] | 0; + var al5 = a52 & 8191; + var ah5 = a52 >>> 13; + var a62 = a7[6] | 0; + var al6 = a62 & 8191; + var ah6 = a62 >>> 13; + var a72 = a7[7] | 0; + var al7 = a72 & 8191; + var ah7 = a72 >>> 13; + var a8 = a7[8] | 0; + var al8 = a8 & 8191; + var ah8 = a8 >>> 13; + var a9 = a7[9] | 0; + var al9 = a9 & 8191; + var ah9 = a9 >>> 13; + var b0 = b8[0] | 0; + var bl0 = b0 & 8191; + var bh0 = b0 >>> 13; + var b1 = b8[1] | 0; + var bl1 = b1 & 8191; + var bh1 = b1 >>> 13; + var b22 = b8[2] | 0; + var bl2 = b22 & 8191; + var bh2 = b22 >>> 13; + var b32 = b8[3] | 0; + var bl3 = b32 & 8191; + var bh3 = b32 >>> 13; + var b42 = b8[4] | 0; + var bl4 = b42 & 8191; + var bh4 = b42 >>> 13; + var b52 = b8[5] | 0; + var bl5 = b52 & 8191; + var bh5 = b52 >>> 13; + var b62 = b8[6] | 0; + var bl6 = b62 & 8191; + var bh6 = b62 >>> 13; + var b72 = b8[7] | 0; + var bl7 = b72 & 8191; + var bh7 = b72 >>> 13; + var b82 = b8[8] | 0; + var bl8 = b82 & 8191; + var bh8 = b82 >>> 13; + var b9 = b8[9] | 0; + var bl9 = b9 & 8191; + var bh9 = b9 >>> 13; + out.negative = self2.negative ^ num.negative; + out.length = 19; + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = mid + Math.imul(ah0, bl0) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; + w0 &= 67108863; + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = mid + Math.imul(ah1, bl0) | 0; + hi = Math.imul(ah1, bh0); + lo = lo + Math.imul(al0, bl1) | 0; + mid = mid + Math.imul(al0, bh1) | 0; + mid = mid + Math.imul(ah0, bl1) | 0; + hi = hi + Math.imul(ah0, bh1) | 0; + var w1 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; + w1 &= 67108863; + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = mid + Math.imul(ah2, bl0) | 0; + hi = Math.imul(ah2, bh0); + lo = lo + Math.imul(al1, bl1) | 0; + mid = mid + Math.imul(al1, bh1) | 0; + mid = mid + Math.imul(ah1, bl1) | 0; + hi = hi + Math.imul(ah1, bh1) | 0; + lo = lo + Math.imul(al0, bl2) | 0; + mid = mid + Math.imul(al0, bh2) | 0; + mid = mid + Math.imul(ah0, bl2) | 0; + hi = hi + Math.imul(ah0, bh2) | 0; + var w22 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w22 >>> 26) | 0; + w22 &= 67108863; + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = mid + Math.imul(ah3, bl0) | 0; + hi = Math.imul(ah3, bh0); + lo = lo + Math.imul(al2, bl1) | 0; + mid = mid + Math.imul(al2, bh1) | 0; + mid = mid + Math.imul(ah2, bl1) | 0; + hi = hi + Math.imul(ah2, bh1) | 0; + lo = lo + Math.imul(al1, bl2) | 0; + mid = mid + Math.imul(al1, bh2) | 0; + mid = mid + Math.imul(ah1, bl2) | 0; + hi = hi + Math.imul(ah1, bh2) | 0; + lo = lo + Math.imul(al0, bl3) | 0; + mid = mid + Math.imul(al0, bh3) | 0; + mid = mid + Math.imul(ah0, bl3) | 0; + hi = hi + Math.imul(ah0, bh3) | 0; + var w32 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w32 >>> 26) | 0; + w32 &= 67108863; + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = mid + Math.imul(ah4, bl0) | 0; + hi = Math.imul(ah4, bh0); + lo = lo + Math.imul(al3, bl1) | 0; + mid = mid + Math.imul(al3, bh1) | 0; + mid = mid + Math.imul(ah3, bl1) | 0; + hi = hi + Math.imul(ah3, bh1) | 0; + lo = lo + Math.imul(al2, bl2) | 0; + mid = mid + Math.imul(al2, bh2) | 0; + mid = mid + Math.imul(ah2, bl2) | 0; + hi = hi + Math.imul(ah2, bh2) | 0; + lo = lo + Math.imul(al1, bl3) | 0; + mid = mid + Math.imul(al1, bh3) | 0; + mid = mid + Math.imul(ah1, bl3) | 0; + hi = hi + Math.imul(ah1, bh3) | 0; + lo = lo + Math.imul(al0, bl4) | 0; + mid = mid + Math.imul(al0, bh4) | 0; + mid = mid + Math.imul(ah0, bl4) | 0; + hi = hi + Math.imul(ah0, bh4) | 0; + var w42 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w42 >>> 26) | 0; + w42 &= 67108863; + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = mid + Math.imul(ah5, bl0) | 0; + hi = Math.imul(ah5, bh0); + lo = lo + Math.imul(al4, bl1) | 0; + mid = mid + Math.imul(al4, bh1) | 0; + mid = mid + Math.imul(ah4, bl1) | 0; + hi = hi + Math.imul(ah4, bh1) | 0; + lo = lo + Math.imul(al3, bl2) | 0; + mid = mid + Math.imul(al3, bh2) | 0; + mid = mid + Math.imul(ah3, bl2) | 0; + hi = hi + Math.imul(ah3, bh2) | 0; + lo = lo + Math.imul(al2, bl3) | 0; + mid = mid + Math.imul(al2, bh3) | 0; + mid = mid + Math.imul(ah2, bl3) | 0; + hi = hi + Math.imul(ah2, bh3) | 0; + lo = lo + Math.imul(al1, bl4) | 0; + mid = mid + Math.imul(al1, bh4) | 0; + mid = mid + Math.imul(ah1, bl4) | 0; + hi = hi + Math.imul(ah1, bh4) | 0; + lo = lo + Math.imul(al0, bl5) | 0; + mid = mid + Math.imul(al0, bh5) | 0; + mid = mid + Math.imul(ah0, bl5) | 0; + hi = hi + Math.imul(ah0, bh5) | 0; + var w52 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w52 >>> 26) | 0; + w52 &= 67108863; + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = mid + Math.imul(ah6, bl0) | 0; + hi = Math.imul(ah6, bh0); + lo = lo + Math.imul(al5, bl1) | 0; + mid = mid + Math.imul(al5, bh1) | 0; + mid = mid + Math.imul(ah5, bl1) | 0; + hi = hi + Math.imul(ah5, bh1) | 0; + lo = lo + Math.imul(al4, bl2) | 0; + mid = mid + Math.imul(al4, bh2) | 0; + mid = mid + Math.imul(ah4, bl2) | 0; + hi = hi + Math.imul(ah4, bh2) | 0; + lo = lo + Math.imul(al3, bl3) | 0; + mid = mid + Math.imul(al3, bh3) | 0; + mid = mid + Math.imul(ah3, bl3) | 0; + hi = hi + Math.imul(ah3, bh3) | 0; + lo = lo + Math.imul(al2, bl4) | 0; + mid = mid + Math.imul(al2, bh4) | 0; + mid = mid + Math.imul(ah2, bl4) | 0; + hi = hi + Math.imul(ah2, bh4) | 0; + lo = lo + Math.imul(al1, bl5) | 0; + mid = mid + Math.imul(al1, bh5) | 0; + mid = mid + Math.imul(ah1, bl5) | 0; + hi = hi + Math.imul(ah1, bh5) | 0; + lo = lo + Math.imul(al0, bl6) | 0; + mid = mid + Math.imul(al0, bh6) | 0; + mid = mid + Math.imul(ah0, bl6) | 0; + hi = hi + Math.imul(ah0, bh6) | 0; + var w6 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; + w6 &= 67108863; + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = mid + Math.imul(ah7, bl0) | 0; + hi = Math.imul(ah7, bh0); + lo = lo + Math.imul(al6, bl1) | 0; + mid = mid + Math.imul(al6, bh1) | 0; + mid = mid + Math.imul(ah6, bl1) | 0; + hi = hi + Math.imul(ah6, bh1) | 0; + lo = lo + Math.imul(al5, bl2) | 0; + mid = mid + Math.imul(al5, bh2) | 0; + mid = mid + Math.imul(ah5, bl2) | 0; + hi = hi + Math.imul(ah5, bh2) | 0; + lo = lo + Math.imul(al4, bl3) | 0; + mid = mid + Math.imul(al4, bh3) | 0; + mid = mid + Math.imul(ah4, bl3) | 0; + hi = hi + Math.imul(ah4, bh3) | 0; + lo = lo + Math.imul(al3, bl4) | 0; + mid = mid + Math.imul(al3, bh4) | 0; + mid = mid + Math.imul(ah3, bl4) | 0; + hi = hi + Math.imul(ah3, bh4) | 0; + lo = lo + Math.imul(al2, bl5) | 0; + mid = mid + Math.imul(al2, bh5) | 0; + mid = mid + Math.imul(ah2, bl5) | 0; + hi = hi + Math.imul(ah2, bh5) | 0; + lo = lo + Math.imul(al1, bl6) | 0; + mid = mid + Math.imul(al1, bh6) | 0; + mid = mid + Math.imul(ah1, bl6) | 0; + hi = hi + Math.imul(ah1, bh6) | 0; + lo = lo + Math.imul(al0, bl7) | 0; + mid = mid + Math.imul(al0, bh7) | 0; + mid = mid + Math.imul(ah0, bl7) | 0; + hi = hi + Math.imul(ah0, bh7) | 0; + var w7 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; + w7 &= 67108863; + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = mid + Math.imul(ah8, bl0) | 0; + hi = Math.imul(ah8, bh0); + lo = lo + Math.imul(al7, bl1) | 0; + mid = mid + Math.imul(al7, bh1) | 0; + mid = mid + Math.imul(ah7, bl1) | 0; + hi = hi + Math.imul(ah7, bh1) | 0; + lo = lo + Math.imul(al6, bl2) | 0; + mid = mid + Math.imul(al6, bh2) | 0; + mid = mid + Math.imul(ah6, bl2) | 0; + hi = hi + Math.imul(ah6, bh2) | 0; + lo = lo + Math.imul(al5, bl3) | 0; + mid = mid + Math.imul(al5, bh3) | 0; + mid = mid + Math.imul(ah5, bl3) | 0; + hi = hi + Math.imul(ah5, bh3) | 0; + lo = lo + Math.imul(al4, bl4) | 0; + mid = mid + Math.imul(al4, bh4) | 0; + mid = mid + Math.imul(ah4, bl4) | 0; + hi = hi + Math.imul(ah4, bh4) | 0; + lo = lo + Math.imul(al3, bl5) | 0; + mid = mid + Math.imul(al3, bh5) | 0; + mid = mid + Math.imul(ah3, bl5) | 0; + hi = hi + Math.imul(ah3, bh5) | 0; + lo = lo + Math.imul(al2, bl6) | 0; + mid = mid + Math.imul(al2, bh6) | 0; + mid = mid + Math.imul(ah2, bl6) | 0; + hi = hi + Math.imul(ah2, bh6) | 0; + lo = lo + Math.imul(al1, bl7) | 0; + mid = mid + Math.imul(al1, bh7) | 0; + mid = mid + Math.imul(ah1, bl7) | 0; + hi = hi + Math.imul(ah1, bh7) | 0; + lo = lo + Math.imul(al0, bl8) | 0; + mid = mid + Math.imul(al0, bh8) | 0; + mid = mid + Math.imul(ah0, bl8) | 0; + hi = hi + Math.imul(ah0, bh8) | 0; + var w8 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; + w8 &= 67108863; + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = mid + Math.imul(ah9, bl0) | 0; + hi = Math.imul(ah9, bh0); + lo = lo + Math.imul(al8, bl1) | 0; + mid = mid + Math.imul(al8, bh1) | 0; + mid = mid + Math.imul(ah8, bl1) | 0; + hi = hi + Math.imul(ah8, bh1) | 0; + lo = lo + Math.imul(al7, bl2) | 0; + mid = mid + Math.imul(al7, bh2) | 0; + mid = mid + Math.imul(ah7, bl2) | 0; + hi = hi + Math.imul(ah7, bh2) | 0; + lo = lo + Math.imul(al6, bl3) | 0; + mid = mid + Math.imul(al6, bh3) | 0; + mid = mid + Math.imul(ah6, bl3) | 0; + hi = hi + Math.imul(ah6, bh3) | 0; + lo = lo + Math.imul(al5, bl4) | 0; + mid = mid + Math.imul(al5, bh4) | 0; + mid = mid + Math.imul(ah5, bl4) | 0; + hi = hi + Math.imul(ah5, bh4) | 0; + lo = lo + Math.imul(al4, bl5) | 0; + mid = mid + Math.imul(al4, bh5) | 0; + mid = mid + Math.imul(ah4, bl5) | 0; + hi = hi + Math.imul(ah4, bh5) | 0; + lo = lo + Math.imul(al3, bl6) | 0; + mid = mid + Math.imul(al3, bh6) | 0; + mid = mid + Math.imul(ah3, bl6) | 0; + hi = hi + Math.imul(ah3, bh6) | 0; + lo = lo + Math.imul(al2, bl7) | 0; + mid = mid + Math.imul(al2, bh7) | 0; + mid = mid + Math.imul(ah2, bl7) | 0; + hi = hi + Math.imul(ah2, bh7) | 0; + lo = lo + Math.imul(al1, bl8) | 0; + mid = mid + Math.imul(al1, bh8) | 0; + mid = mid + Math.imul(ah1, bl8) | 0; + hi = hi + Math.imul(ah1, bh8) | 0; + lo = lo + Math.imul(al0, bl9) | 0; + mid = mid + Math.imul(al0, bh9) | 0; + mid = mid + Math.imul(ah0, bl9) | 0; + hi = hi + Math.imul(ah0, bh9) | 0; + var w9 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; + w9 &= 67108863; + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = mid + Math.imul(ah9, bl1) | 0; + hi = Math.imul(ah9, bh1); + lo = lo + Math.imul(al8, bl2) | 0; + mid = mid + Math.imul(al8, bh2) | 0; + mid = mid + Math.imul(ah8, bl2) | 0; + hi = hi + Math.imul(ah8, bh2) | 0; + lo = lo + Math.imul(al7, bl3) | 0; + mid = mid + Math.imul(al7, bh3) | 0; + mid = mid + Math.imul(ah7, bl3) | 0; + hi = hi + Math.imul(ah7, bh3) | 0; + lo = lo + Math.imul(al6, bl4) | 0; + mid = mid + Math.imul(al6, bh4) | 0; + mid = mid + Math.imul(ah6, bl4) | 0; + hi = hi + Math.imul(ah6, bh4) | 0; + lo = lo + Math.imul(al5, bl5) | 0; + mid = mid + Math.imul(al5, bh5) | 0; + mid = mid + Math.imul(ah5, bl5) | 0; + hi = hi + Math.imul(ah5, bh5) | 0; + lo = lo + Math.imul(al4, bl6) | 0; + mid = mid + Math.imul(al4, bh6) | 0; + mid = mid + Math.imul(ah4, bl6) | 0; + hi = hi + Math.imul(ah4, bh6) | 0; + lo = lo + Math.imul(al3, bl7) | 0; + mid = mid + Math.imul(al3, bh7) | 0; + mid = mid + Math.imul(ah3, bl7) | 0; + hi = hi + Math.imul(ah3, bh7) | 0; + lo = lo + Math.imul(al2, bl8) | 0; + mid = mid + Math.imul(al2, bh8) | 0; + mid = mid + Math.imul(ah2, bl8) | 0; + hi = hi + Math.imul(ah2, bh8) | 0; + lo = lo + Math.imul(al1, bl9) | 0; + mid = mid + Math.imul(al1, bh9) | 0; + mid = mid + Math.imul(ah1, bl9) | 0; + hi = hi + Math.imul(ah1, bh9) | 0; + var w10 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; + w10 &= 67108863; + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = mid + Math.imul(ah9, bl2) | 0; + hi = Math.imul(ah9, bh2); + lo = lo + Math.imul(al8, bl3) | 0; + mid = mid + Math.imul(al8, bh3) | 0; + mid = mid + Math.imul(ah8, bl3) | 0; + hi = hi + Math.imul(ah8, bh3) | 0; + lo = lo + Math.imul(al7, bl4) | 0; + mid = mid + Math.imul(al7, bh4) | 0; + mid = mid + Math.imul(ah7, bl4) | 0; + hi = hi + Math.imul(ah7, bh4) | 0; + lo = lo + Math.imul(al6, bl5) | 0; + mid = mid + Math.imul(al6, bh5) | 0; + mid = mid + Math.imul(ah6, bl5) | 0; + hi = hi + Math.imul(ah6, bh5) | 0; + lo = lo + Math.imul(al5, bl6) | 0; + mid = mid + Math.imul(al5, bh6) | 0; + mid = mid + Math.imul(ah5, bl6) | 0; + hi = hi + Math.imul(ah5, bh6) | 0; + lo = lo + Math.imul(al4, bl7) | 0; + mid = mid + Math.imul(al4, bh7) | 0; + mid = mid + Math.imul(ah4, bl7) | 0; + hi = hi + Math.imul(ah4, bh7) | 0; + lo = lo + Math.imul(al3, bl8) | 0; + mid = mid + Math.imul(al3, bh8) | 0; + mid = mid + Math.imul(ah3, bl8) | 0; + hi = hi + Math.imul(ah3, bh8) | 0; + lo = lo + Math.imul(al2, bl9) | 0; + mid = mid + Math.imul(al2, bh9) | 0; + mid = mid + Math.imul(ah2, bl9) | 0; + hi = hi + Math.imul(ah2, bh9) | 0; + var w11 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; + w11 &= 67108863; + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = mid + Math.imul(ah9, bl3) | 0; + hi = Math.imul(ah9, bh3); + lo = lo + Math.imul(al8, bl4) | 0; + mid = mid + Math.imul(al8, bh4) | 0; + mid = mid + Math.imul(ah8, bl4) | 0; + hi = hi + Math.imul(ah8, bh4) | 0; + lo = lo + Math.imul(al7, bl5) | 0; + mid = mid + Math.imul(al7, bh5) | 0; + mid = mid + Math.imul(ah7, bl5) | 0; + hi = hi + Math.imul(ah7, bh5) | 0; + lo = lo + Math.imul(al6, bl6) | 0; + mid = mid + Math.imul(al6, bh6) | 0; + mid = mid + Math.imul(ah6, bl6) | 0; + hi = hi + Math.imul(ah6, bh6) | 0; + lo = lo + Math.imul(al5, bl7) | 0; + mid = mid + Math.imul(al5, bh7) | 0; + mid = mid + Math.imul(ah5, bl7) | 0; + hi = hi + Math.imul(ah5, bh7) | 0; + lo = lo + Math.imul(al4, bl8) | 0; + mid = mid + Math.imul(al4, bh8) | 0; + mid = mid + Math.imul(ah4, bl8) | 0; + hi = hi + Math.imul(ah4, bh8) | 0; + lo = lo + Math.imul(al3, bl9) | 0; + mid = mid + Math.imul(al3, bh9) | 0; + mid = mid + Math.imul(ah3, bl9) | 0; + hi = hi + Math.imul(ah3, bh9) | 0; + var w12 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; + w12 &= 67108863; + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = mid + Math.imul(ah9, bl4) | 0; + hi = Math.imul(ah9, bh4); + lo = lo + Math.imul(al8, bl5) | 0; + mid = mid + Math.imul(al8, bh5) | 0; + mid = mid + Math.imul(ah8, bl5) | 0; + hi = hi + Math.imul(ah8, bh5) | 0; + lo = lo + Math.imul(al7, bl6) | 0; + mid = mid + Math.imul(al7, bh6) | 0; + mid = mid + Math.imul(ah7, bl6) | 0; + hi = hi + Math.imul(ah7, bh6) | 0; + lo = lo + Math.imul(al6, bl7) | 0; + mid = mid + Math.imul(al6, bh7) | 0; + mid = mid + Math.imul(ah6, bl7) | 0; + hi = hi + Math.imul(ah6, bh7) | 0; + lo = lo + Math.imul(al5, bl8) | 0; + mid = mid + Math.imul(al5, bh8) | 0; + mid = mid + Math.imul(ah5, bl8) | 0; + hi = hi + Math.imul(ah5, bh8) | 0; + lo = lo + Math.imul(al4, bl9) | 0; + mid = mid + Math.imul(al4, bh9) | 0; + mid = mid + Math.imul(ah4, bl9) | 0; + hi = hi + Math.imul(ah4, bh9) | 0; + var w13 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; + w13 &= 67108863; + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = mid + Math.imul(ah9, bl5) | 0; + hi = Math.imul(ah9, bh5); + lo = lo + Math.imul(al8, bl6) | 0; + mid = mid + Math.imul(al8, bh6) | 0; + mid = mid + Math.imul(ah8, bl6) | 0; + hi = hi + Math.imul(ah8, bh6) | 0; + lo = lo + Math.imul(al7, bl7) | 0; + mid = mid + Math.imul(al7, bh7) | 0; + mid = mid + Math.imul(ah7, bl7) | 0; + hi = hi + Math.imul(ah7, bh7) | 0; + lo = lo + Math.imul(al6, bl8) | 0; + mid = mid + Math.imul(al6, bh8) | 0; + mid = mid + Math.imul(ah6, bl8) | 0; + hi = hi + Math.imul(ah6, bh8) | 0; + lo = lo + Math.imul(al5, bl9) | 0; + mid = mid + Math.imul(al5, bh9) | 0; + mid = mid + Math.imul(ah5, bl9) | 0; + hi = hi + Math.imul(ah5, bh9) | 0; + var w14 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; + w14 &= 67108863; + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = mid + Math.imul(ah9, bl6) | 0; + hi = Math.imul(ah9, bh6); + lo = lo + Math.imul(al8, bl7) | 0; + mid = mid + Math.imul(al8, bh7) | 0; + mid = mid + Math.imul(ah8, bl7) | 0; + hi = hi + Math.imul(ah8, bh7) | 0; + lo = lo + Math.imul(al7, bl8) | 0; + mid = mid + Math.imul(al7, bh8) | 0; + mid = mid + Math.imul(ah7, bl8) | 0; + hi = hi + Math.imul(ah7, bh8) | 0; + lo = lo + Math.imul(al6, bl9) | 0; + mid = mid + Math.imul(al6, bh9) | 0; + mid = mid + Math.imul(ah6, bl9) | 0; + hi = hi + Math.imul(ah6, bh9) | 0; + var w15 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; + w15 &= 67108863; + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = mid + Math.imul(ah9, bl7) | 0; + hi = Math.imul(ah9, bh7); + lo = lo + Math.imul(al8, bl8) | 0; + mid = mid + Math.imul(al8, bh8) | 0; + mid = mid + Math.imul(ah8, bl8) | 0; + hi = hi + Math.imul(ah8, bh8) | 0; + lo = lo + Math.imul(al7, bl9) | 0; + mid = mid + Math.imul(al7, bh9) | 0; + mid = mid + Math.imul(ah7, bl9) | 0; + hi = hi + Math.imul(ah7, bh9) | 0; + var w16 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; + w16 &= 67108863; + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = mid + Math.imul(ah9, bl8) | 0; + hi = Math.imul(ah9, bh8); + lo = lo + Math.imul(al8, bl9) | 0; + mid = mid + Math.imul(al8, bh9) | 0; + mid = mid + Math.imul(ah8, bl9) | 0; + hi = hi + Math.imul(ah8, bh9) | 0; + var w17 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; + w17 &= 67108863; + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = mid + Math.imul(ah9, bl9) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (c7 + lo | 0) + ((mid & 8191) << 13) | 0; + c7 = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; + w18 &= 67108863; + o7[0] = w0; + o7[1] = w1; + o7[2] = w22; + o7[3] = w32; + o7[4] = w42; + o7[5] = w52; + o7[6] = w6; + o7[7] = w7; + o7[8] = w8; + o7[9] = w9; + o7[10] = w10; + o7[11] = w11; + o7[12] = w12; + o7[13] = w13; + o7[14] = w14; + o7[15] = w15; + o7[16] = w16; + o7[17] = w17; + o7[18] = w18; + if (c7 !== 0) { + o7[19] = c7; + out.length++; + } + return out; + }; + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + function bigMulTo(self2, num, out) { + out.negative = num.negative ^ self2.negative; + out.length = self2.length + num.length; + var carry = 0; + var hncarry = 0; + for (var k6 = 0; k6 < out.length - 1; k6++) { + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 67108863; + var maxJ = Math.min(k6, num.length - 1); + for (var j6 = Math.max(0, k6 - self2.length + 1); j6 <= maxJ; j6++) { + var i7 = k6 - j6; + var a7 = self2.words[i7] | 0; + var b8 = num.words[j6] | 0; + var r8 = a7 * b8; + var lo = r8 & 67108863; + ncarry = ncarry + (r8 / 67108864 | 0) | 0; + lo = lo + rword | 0; + rword = lo & 67108863; + ncarry = ncarry + (lo >>> 26) | 0; + hncarry += ncarry >>> 26; + ncarry &= 67108863; + } + out.words[k6] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k6] = carry; + } else { + out.length--; + } + return out.strip(); + } + function jumboMulTo(self2, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self2, num, out); + } + BN.prototype.mulTo = function mulTo(num, out) { + var res; + var len = (this || _global$110).length + num.length; + if ((this || _global$110).length === 10 && num.length === 10) { + res = comb10MulTo(this || _global$110, num, out); + } else if (len < 63) { + res = smallMulTo(this || _global$110, num, out); + } else if (len < 1024) { + res = bigMulTo(this || _global$110, num, out); + } else { + res = jumboMulTo(this || _global$110, num, out); + } + return res; + }; + function FFTM(x7, y7) { + (this || _global$110).x = x7; + (this || _global$110).y = y7; + } + FFTM.prototype.makeRBT = function makeRBT(N6) { + var t8 = new Array(N6); + var l7 = BN.prototype._countBits(N6) - 1; + for (var i7 = 0; i7 < N6; i7++) { + t8[i7] = this.revBin(i7, l7, N6); + } + return t8; + }; + FFTM.prototype.revBin = function revBin(x7, l7, N6) { + if (x7 === 0 || x7 === N6 - 1) + return x7; + var rb = 0; + for (var i7 = 0; i7 < l7; i7++) { + rb |= (x7 & 1) << l7 - i7 - 1; + x7 >>= 1; + } + return rb; + }; + FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N6) { + for (var i7 = 0; i7 < N6; i7++) { + rtws[i7] = rws[rbt[i7]]; + itws[i7] = iws[rbt[i7]]; + } + }; + FFTM.prototype.transform = function transform2(rws, iws, rtws, itws, N6, rbt) { + this.permute(rbt, rws, iws, rtws, itws, N6); + for (var s7 = 1; s7 < N6; s7 <<= 1) { + var l7 = s7 << 1; + var rtwdf = Math.cos(2 * Math.PI / l7); + var itwdf = Math.sin(2 * Math.PI / l7); + for (var p7 = 0; p7 < N6; p7 += l7) { + var rtwdf_ = rtwdf; + var itwdf_ = itwdf; + for (var j6 = 0; j6 < s7; j6++) { + var re4 = rtws[p7 + j6]; + var ie3 = itws[p7 + j6]; + var ro = rtws[p7 + j6 + s7]; + var io = itws[p7 + j6 + s7]; + var rx = rtwdf_ * ro - itwdf_ * io; + io = rtwdf_ * io + itwdf_ * ro; + ro = rx; + rtws[p7 + j6] = re4 + ro; + itws[p7 + j6] = ie3 + io; + rtws[p7 + j6 + s7] = re4 - ro; + itws[p7 + j6 + s7] = ie3 - io; + if (j6 !== l7) { + rx = rtwdf * rtwdf_ - itwdf * itwdf_; + itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; + rtwdf_ = rx; + } + } + } + } + }; + FFTM.prototype.guessLen13b = function guessLen13b(n7, m7) { + var N6 = Math.max(m7, n7) | 1; + var odd = N6 & 1; + var i7 = 0; + for (N6 = N6 / 2 | 0; N6; N6 = N6 >>> 1) { + i7++; + } + return 1 << i7 + 1 + odd; + }; + FFTM.prototype.conjugate = function conjugate(rws, iws, N6) { + if (N6 <= 1) + return; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var t8 = rws[i7]; + rws[i7] = rws[N6 - i7 - 1]; + rws[N6 - i7 - 1] = t8; + t8 = iws[i7]; + iws[i7] = -iws[N6 - i7 - 1]; + iws[N6 - i7 - 1] = -t8; + } + }; + FFTM.prototype.normalize13b = function normalize13b(ws, N6) { + var carry = 0; + for (var i7 = 0; i7 < N6 / 2; i7++) { + var w6 = Math.round(ws[2 * i7 + 1] / N6) * 8192 + Math.round(ws[2 * i7] / N6) + carry; + ws[i7] = w6 & 67108863; + if (w6 < 67108864) { + carry = 0; + } else { + carry = w6 / 67108864 | 0; + } + } + return ws; + }; + FFTM.prototype.convert13b = function convert13b(ws, len, rws, N6) { + var carry = 0; + for (var i7 = 0; i7 < len; i7++) { + carry = carry + (ws[i7] | 0); + rws[2 * i7] = carry & 8191; + carry = carry >>> 13; + rws[2 * i7 + 1] = carry & 8191; + carry = carry >>> 13; + } + for (i7 = 2 * len; i7 < N6; ++i7) { + rws[i7] = 0; + } + assert4(carry === 0); + assert4((carry & ~8191) === 0); + }; + FFTM.prototype.stub = function stub(N6) { + var ph = new Array(N6); + for (var i7 = 0; i7 < N6; i7++) { + ph[i7] = 0; + } + return ph; + }; + FFTM.prototype.mulp = function mulp(x7, y7, out) { + var N6 = 2 * this.guessLen13b(x7.length, y7.length); + var rbt = this.makeRBT(N6); + var _6 = this.stub(N6); + var rws = new Array(N6); + var rwst = new Array(N6); + var iwst = new Array(N6); + var nrws = new Array(N6); + var nrwst = new Array(N6); + var niwst = new Array(N6); + var rmws = out.words; + rmws.length = N6; + this.convert13b(x7.words, x7.length, rws, N6); + this.convert13b(y7.words, y7.length, nrws, N6); + this.transform(rws, _6, rwst, iwst, N6, rbt); + this.transform(nrws, _6, nrwst, niwst, N6, rbt); + for (var i7 = 0; i7 < N6; i7++) { + var rx = rwst[i7] * nrwst[i7] - iwst[i7] * niwst[i7]; + iwst[i7] = rwst[i7] * niwst[i7] + iwst[i7] * nrwst[i7]; + rwst[i7] = rx; + } + this.conjugate(rwst, iwst, N6); + this.transform(rwst, iwst, rmws, _6, N6, rbt); + this.conjugate(rmws, _6, N6); + this.normalize13b(rmws, N6); + out.negative = x7.negative ^ y7.negative; + out.length = x7.length + y7.length; + return out.strip(); + }; + BN.prototype.mul = function mul(num) { + var out = new BN(null); + out.words = new Array((this || _global$110).length + num.length); + return this.mulTo(num, out); + }; + BN.prototype.mulf = function mulf(num) { + var out = new BN(null); + out.words = new Array((this || _global$110).length + num.length); + return jumboMulTo(this || _global$110, num, out); + }; + BN.prototype.imul = function imul(num) { + return this.clone().mulTo(num, this || _global$110); + }; + BN.prototype.imuln = function imuln(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + var carry = 0; + for (var i7 = 0; i7 < (this || _global$110).length; i7++) { + var w6 = ((this || _global$110).words[i7] | 0) * num; + var lo = (w6 & 67108863) + (carry & 67108863); + carry >>= 26; + carry += w6 / 67108864 | 0; + carry += lo >>> 26; + (this || _global$110).words[i7] = lo & 67108863; + } + if (carry !== 0) { + (this || _global$110).words[i7] = carry; + (this || _global$110).length++; + } + return this || _global$110; + }; + BN.prototype.muln = function muln(num) { + return this.clone().imuln(num); + }; + BN.prototype.sqr = function sqr() { + return this.mul(this || _global$110); + }; + BN.prototype.isqr = function isqr() { + return this.imul(this.clone()); + }; + BN.prototype.pow = function pow(num) { + var w6 = toBitArray(num); + if (w6.length === 0) + return new BN(1); + var res = this || _global$110; + for (var i7 = 0; i7 < w6.length; i7++, res = res.sqr()) { + if (w6[i7] !== 0) + break; + } + if (++i7 < w6.length) { + for (var q5 = res.sqr(); i7 < w6.length; i7++, q5 = q5.sqr()) { + if (w6[i7] === 0) + continue; + res = res.mul(q5); + } + } + return res; + }; + BN.prototype.iushln = function iushln(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + var carryMask = 67108863 >>> 26 - r8 << 26 - r8; + var i7; + if (r8 !== 0) { + var carry = 0; + for (i7 = 0; i7 < (this || _global$110).length; i7++) { + var newCarry = (this || _global$110).words[i7] & carryMask; + var c7 = ((this || _global$110).words[i7] | 0) - newCarry << r8; + (this || _global$110).words[i7] = c7 | carry; + carry = newCarry >>> 26 - r8; + } + if (carry) { + (this || _global$110).words[i7] = carry; + (this || _global$110).length++; + } + } + if (s7 !== 0) { + for (i7 = (this || _global$110).length - 1; i7 >= 0; i7--) { + (this || _global$110).words[i7 + s7] = (this || _global$110).words[i7]; + } + for (i7 = 0; i7 < s7; i7++) { + (this || _global$110).words[i7] = 0; + } + (this || _global$110).length += s7; + } + return this.strip(); + }; + BN.prototype.ishln = function ishln(bits) { + assert4((this || _global$110).negative === 0); + return this.iushln(bits); + }; + BN.prototype.iushrn = function iushrn(bits, hint, extended) { + assert4(typeof bits === "number" && bits >= 0); + var h8; + if (hint) { + h8 = (hint - hint % 26) / 26; + } else { + h8 = 0; + } + var r8 = bits % 26; + var s7 = Math.min((bits - r8) / 26, (this || _global$110).length); + var mask = 67108863 ^ 67108863 >>> r8 << r8; + var maskedWords = extended; + h8 -= s7; + h8 = Math.max(0, h8); + if (maskedWords) { + for (var i7 = 0; i7 < s7; i7++) { + maskedWords.words[i7] = (this || _global$110).words[i7]; + } + maskedWords.length = s7; + } + if (s7 === 0) + ; + else if ((this || _global$110).length > s7) { + (this || _global$110).length -= s7; + for (i7 = 0; i7 < (this || _global$110).length; i7++) { + (this || _global$110).words[i7] = (this || _global$110).words[i7 + s7]; + } + } else { + (this || _global$110).words[0] = 0; + (this || _global$110).length = 1; + } + var carry = 0; + for (i7 = (this || _global$110).length - 1; i7 >= 0 && (carry !== 0 || i7 >= h8); i7--) { + var word = (this || _global$110).words[i7] | 0; + (this || _global$110).words[i7] = carry << 26 - r8 | word >>> r8; + carry = word & mask; + } + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + if ((this || _global$110).length === 0) { + (this || _global$110).words[0] = 0; + (this || _global$110).length = 1; + } + return this.strip(); + }; + BN.prototype.ishrn = function ishrn(bits, hint, extended) { + assert4((this || _global$110).negative === 0); + return this.iushrn(bits, hint, extended); + }; + BN.prototype.shln = function shln(bits) { + return this.clone().ishln(bits); + }; + BN.prototype.ushln = function ushln(bits) { + return this.clone().iushln(bits); + }; + BN.prototype.shrn = function shrn(bits) { + return this.clone().ishrn(bits); + }; + BN.prototype.ushrn = function ushrn(bits) { + return this.clone().iushrn(bits); + }; + BN.prototype.testn = function testn(bit) { + assert4(typeof bit === "number" && bit >= 0); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$110).length <= s7) + return false; + var w6 = (this || _global$110).words[s7]; + return !!(w6 & q5); + }; + BN.prototype.imaskn = function imaskn(bits) { + assert4(typeof bits === "number" && bits >= 0); + var r8 = bits % 26; + var s7 = (bits - r8) / 26; + assert4((this || _global$110).negative === 0, "imaskn works only with positive numbers"); + if ((this || _global$110).length <= s7) { + return this || _global$110; + } + if (r8 !== 0) { + s7++; + } + (this || _global$110).length = Math.min(s7, (this || _global$110).length); + if (r8 !== 0) { + var mask = 67108863 ^ 67108863 >>> r8 << r8; + (this || _global$110).words[(this || _global$110).length - 1] &= mask; + } + return this.strip(); + }; + BN.prototype.maskn = function maskn(bits) { + return this.clone().imaskn(bits); + }; + BN.prototype.iaddn = function iaddn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.isubn(-num); + if ((this || _global$110).negative !== 0) { + if ((this || _global$110).length === 1 && ((this || _global$110).words[0] | 0) < num) { + (this || _global$110).words[0] = num - ((this || _global$110).words[0] | 0); + (this || _global$110).negative = 0; + return this || _global$110; + } + (this || _global$110).negative = 0; + this.isubn(num); + (this || _global$110).negative = 1; + return this || _global$110; + } + return this._iaddn(num); + }; + BN.prototype._iaddn = function _iaddn(num) { + (this || _global$110).words[0] += num; + for (var i7 = 0; i7 < (this || _global$110).length && (this || _global$110).words[i7] >= 67108864; i7++) { + (this || _global$110).words[i7] -= 67108864; + if (i7 === (this || _global$110).length - 1) { + (this || _global$110).words[i7 + 1] = 1; + } else { + (this || _global$110).words[i7 + 1]++; + } + } + (this || _global$110).length = Math.max((this || _global$110).length, i7 + 1); + return this || _global$110; + }; + BN.prototype.isubn = function isubn(num) { + assert4(typeof num === "number"); + assert4(num < 67108864); + if (num < 0) + return this.iaddn(-num); + if ((this || _global$110).negative !== 0) { + (this || _global$110).negative = 0; + this.iaddn(num); + (this || _global$110).negative = 1; + return this || _global$110; + } + (this || _global$110).words[0] -= num; + if ((this || _global$110).length === 1 && (this || _global$110).words[0] < 0) { + (this || _global$110).words[0] = -(this || _global$110).words[0]; + (this || _global$110).negative = 1; + } else { + for (var i7 = 0; i7 < (this || _global$110).length && (this || _global$110).words[i7] < 0; i7++) { + (this || _global$110).words[i7] += 67108864; + (this || _global$110).words[i7 + 1] -= 1; + } + } + return this.strip(); + }; + BN.prototype.addn = function addn(num) { + return this.clone().iaddn(num); + }; + BN.prototype.subn = function subn(num) { + return this.clone().isubn(num); + }; + BN.prototype.iabs = function iabs() { + (this || _global$110).negative = 0; + return this || _global$110; + }; + BN.prototype.abs = function abs() { + return this.clone().iabs(); + }; + BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { + var len = num.length + shift; + var i7; + this._expand(len); + var w6; + var carry = 0; + for (i7 = 0; i7 < num.length; i7++) { + w6 = ((this || _global$110).words[i7 + shift] | 0) + carry; + var right = (num.words[i7] | 0) * mul; + w6 -= right & 67108863; + carry = (w6 >> 26) - (right / 67108864 | 0); + (this || _global$110).words[i7 + shift] = w6 & 67108863; + } + for (; i7 < (this || _global$110).length - shift; i7++) { + w6 = ((this || _global$110).words[i7 + shift] | 0) + carry; + carry = w6 >> 26; + (this || _global$110).words[i7 + shift] = w6 & 67108863; + } + if (carry === 0) + return this.strip(); + assert4(carry === -1); + carry = 0; + for (i7 = 0; i7 < (this || _global$110).length; i7++) { + w6 = -((this || _global$110).words[i7] | 0) + carry; + carry = w6 >> 26; + (this || _global$110).words[i7] = w6 & 67108863; + } + (this || _global$110).negative = 1; + return this.strip(); + }; + BN.prototype._wordDiv = function _wordDiv(num, mode) { + var shift = (this || _global$110).length - num.length; + var a7 = this.clone(); + var b8 = num; + var bhi = b8.words[b8.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b8 = b8.ushln(shift); + a7.iushln(shift); + bhi = b8.words[b8.length - 1] | 0; + } + var m7 = a7.length - b8.length; + var q5; + if (mode !== "mod") { + q5 = new BN(null); + q5.length = m7 + 1; + q5.words = new Array(q5.length); + for (var i7 = 0; i7 < q5.length; i7++) { + q5.words[i7] = 0; + } + } + var diff = a7.clone()._ishlnsubmul(b8, 1, m7); + if (diff.negative === 0) { + a7 = diff; + if (q5) { + q5.words[m7] = 1; + } + } + for (var j6 = m7 - 1; j6 >= 0; j6--) { + var qj = (a7.words[b8.length + j6] | 0) * 67108864 + (a7.words[b8.length + j6 - 1] | 0); + qj = Math.min(qj / bhi | 0, 67108863); + a7._ishlnsubmul(b8, qj, j6); + while (a7.negative !== 0) { + qj--; + a7.negative = 0; + a7._ishlnsubmul(b8, 1, j6); + if (!a7.isZero()) { + a7.negative ^= 1; + } + } + if (q5) { + q5.words[j6] = qj; + } + } + if (q5) { + q5.strip(); + } + a7.strip(); + if (mode !== "div" && shift !== 0) { + a7.iushrn(shift); + } + return { + div: q5 || null, + mod: a7 + }; + }; + BN.prototype.divmod = function divmod(num, mode, positive) { + assert4(!num.isZero()); + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + var div, mod2, res; + if ((this || _global$110).negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + if (mode !== "mod") { + div = res.div.neg(); + } + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.iadd(num); + } + } + return { + div, + mod: mod2 + }; + } + if ((this || _global$110).negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + if (mode !== "mod") { + div = res.div.neg(); + } + return { + div, + mod: res.mod + }; + } + if (((this || _global$110).negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + if (mode !== "div") { + mod2 = res.mod.neg(); + if (positive && mod2.negative !== 0) { + mod2.isub(num); + } + } + return { + div: res.div, + mod: mod2 + }; + } + if (num.length > (this || _global$110).length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this || _global$110 + }; + } + if (num.length === 1) { + if (mode === "div") { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + if (mode === "mod") { + return { + div: null, + mod: new BN(this.modn(num.words[0])) + }; + } + return { + div: this.divn(num.words[0]), + mod: new BN(this.modn(num.words[0])) + }; + } + return this._wordDiv(num, mode); + }; + BN.prototype.div = function div(num) { + return this.divmod(num, "div", false).div; + }; + BN.prototype.mod = function mod2(num) { + return this.divmod(num, "mod", false).mod; + }; + BN.prototype.umod = function umod(num) { + return this.divmod(num, "mod", true).mod; + }; + BN.prototype.divRound = function divRound(num) { + var dm = this.divmod(num); + if (dm.mod.isZero()) + return dm.div; + var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; + var half = num.ushrn(1); + var r22 = num.andln(1); + var cmp = mod2.cmp(half); + if (cmp < 0 || r22 === 1 && cmp === 0) + return dm.div; + return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); + }; + BN.prototype.modn = function modn(num) { + assert4(num <= 67108863); + var p7 = (1 << 26) % num; + var acc = 0; + for (var i7 = (this || _global$110).length - 1; i7 >= 0; i7--) { + acc = (p7 * acc + ((this || _global$110).words[i7] | 0)) % num; + } + return acc; + }; + BN.prototype.idivn = function idivn(num) { + assert4(num <= 67108863); + var carry = 0; + for (var i7 = (this || _global$110).length - 1; i7 >= 0; i7--) { + var w6 = ((this || _global$110).words[i7] | 0) + carry * 67108864; + (this || _global$110).words[i7] = w6 / num | 0; + carry = w6 % num; + } + return this.strip(); + }; + BN.prototype.divn = function divn(num) { + return this.clone().idivn(num); + }; + BN.prototype.egcd = function egcd(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var x7 = this || _global$110; + var y7 = p7.clone(); + if (x7.negative !== 0) { + x7 = x7.umod(p7); + } else { + x7 = x7.clone(); + } + var A6 = new BN(1); + var B6 = new BN(0); + var C6 = new BN(0); + var D6 = new BN(1); + var g7 = 0; + while (x7.isEven() && y7.isEven()) { + x7.iushrn(1); + y7.iushrn(1); + ++g7; + } + var yp = y7.clone(); + var xp = x7.clone(); + while (!x7.isZero()) { + for (var i7 = 0, im = 1; (x7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + x7.iushrn(i7); + while (i7-- > 0) { + if (A6.isOdd() || B6.isOdd()) { + A6.iadd(yp); + B6.isub(xp); + } + A6.iushrn(1); + B6.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (y7.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + y7.iushrn(j6); + while (j6-- > 0) { + if (C6.isOdd() || D6.isOdd()) { + C6.iadd(yp); + D6.isub(xp); + } + C6.iushrn(1); + D6.iushrn(1); + } + } + if (x7.cmp(y7) >= 0) { + x7.isub(y7); + A6.isub(C6); + B6.isub(D6); + } else { + y7.isub(x7); + C6.isub(A6); + D6.isub(B6); + } + } + return { + a: C6, + b: D6, + gcd: y7.iushln(g7) + }; + }; + BN.prototype._invmp = function _invmp(p7) { + assert4(p7.negative === 0); + assert4(!p7.isZero()); + var a7 = this || _global$110; + var b8 = p7.clone(); + if (a7.negative !== 0) { + a7 = a7.umod(p7); + } else { + a7 = a7.clone(); + } + var x1 = new BN(1); + var x22 = new BN(0); + var delta = b8.clone(); + while (a7.cmpn(1) > 0 && b8.cmpn(1) > 0) { + for (var i7 = 0, im = 1; (a7.words[0] & im) === 0 && i7 < 26; ++i7, im <<= 1) + ; + if (i7 > 0) { + a7.iushrn(i7); + while (i7-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + x1.iushrn(1); + } + } + for (var j6 = 0, jm = 1; (b8.words[0] & jm) === 0 && j6 < 26; ++j6, jm <<= 1) + ; + if (j6 > 0) { + b8.iushrn(j6); + while (j6-- > 0) { + if (x22.isOdd()) { + x22.iadd(delta); + } + x22.iushrn(1); + } + } + if (a7.cmp(b8) >= 0) { + a7.isub(b8); + x1.isub(x22); + } else { + b8.isub(a7); + x22.isub(x1); + } + } + var res; + if (a7.cmpn(1) === 0) { + res = x1; + } else { + res = x22; + } + if (res.cmpn(0) < 0) { + res.iadd(p7); + } + return res; + }; + BN.prototype.gcd = function gcd(num) { + if (this.isZero()) + return num.abs(); + if (num.isZero()) + return this.abs(); + var a7 = this.clone(); + var b8 = num.clone(); + a7.negative = 0; + b8.negative = 0; + for (var shift = 0; a7.isEven() && b8.isEven(); shift++) { + a7.iushrn(1); + b8.iushrn(1); + } + do { + while (a7.isEven()) { + a7.iushrn(1); + } + while (b8.isEven()) { + b8.iushrn(1); + } + var r8 = a7.cmp(b8); + if (r8 < 0) { + var t8 = a7; + a7 = b8; + b8 = t8; + } else if (r8 === 0 || b8.cmpn(1) === 0) { + break; + } + a7.isub(b8); + } while (true); + return b8.iushln(shift); + }; + BN.prototype.invm = function invm(num) { + return this.egcd(num).a.umod(num); + }; + BN.prototype.isEven = function isEven() { + return ((this || _global$110).words[0] & 1) === 0; + }; + BN.prototype.isOdd = function isOdd() { + return ((this || _global$110).words[0] & 1) === 1; + }; + BN.prototype.andln = function andln(num) { + return (this || _global$110).words[0] & num; + }; + BN.prototype.bincn = function bincn(bit) { + assert4(typeof bit === "number"); + var r8 = bit % 26; + var s7 = (bit - r8) / 26; + var q5 = 1 << r8; + if ((this || _global$110).length <= s7) { + this._expand(s7 + 1); + (this || _global$110).words[s7] |= q5; + return this || _global$110; + } + var carry = q5; + for (var i7 = s7; carry !== 0 && i7 < (this || _global$110).length; i7++) { + var w6 = (this || _global$110).words[i7] | 0; + w6 += carry; + carry = w6 >>> 26; + w6 &= 67108863; + (this || _global$110).words[i7] = w6; + } + if (carry !== 0) { + (this || _global$110).words[i7] = carry; + (this || _global$110).length++; + } + return this || _global$110; + }; + BN.prototype.isZero = function isZero() { + return (this || _global$110).length === 1 && (this || _global$110).words[0] === 0; + }; + BN.prototype.cmpn = function cmpn(num) { + var negative = num < 0; + if ((this || _global$110).negative !== 0 && !negative) + return -1; + if ((this || _global$110).negative === 0 && negative) + return 1; + this.strip(); + var res; + if ((this || _global$110).length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + assert4(num <= 67108863, "Number is too big"); + var w6 = (this || _global$110).words[0] | 0; + res = w6 === num ? 0 : w6 < num ? -1 : 1; + } + if ((this || _global$110).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.cmp = function cmp(num) { + if ((this || _global$110).negative !== 0 && num.negative === 0) + return -1; + if ((this || _global$110).negative === 0 && num.negative !== 0) + return 1; + var res = this.ucmp(num); + if ((this || _global$110).negative !== 0) + return -res | 0; + return res; + }; + BN.prototype.ucmp = function ucmp(num) { + if ((this || _global$110).length > num.length) + return 1; + if ((this || _global$110).length < num.length) + return -1; + var res = 0; + for (var i7 = (this || _global$110).length - 1; i7 >= 0; i7--) { + var a7 = (this || _global$110).words[i7] | 0; + var b8 = num.words[i7] | 0; + if (a7 === b8) + continue; + if (a7 < b8) { + res = -1; + } else if (a7 > b8) { + res = 1; + } + break; + } + return res; + }; + BN.prototype.gtn = function gtn(num) { + return this.cmpn(num) === 1; + }; + BN.prototype.gt = function gt2(num) { + return this.cmp(num) === 1; + }; + BN.prototype.gten = function gten(num) { + return this.cmpn(num) >= 0; + }; + BN.prototype.gte = function gte2(num) { + return this.cmp(num) >= 0; + }; + BN.prototype.ltn = function ltn(num) { + return this.cmpn(num) === -1; + }; + BN.prototype.lt = function lt2(num) { + return this.cmp(num) === -1; + }; + BN.prototype.lten = function lten(num) { + return this.cmpn(num) <= 0; + }; + BN.prototype.lte = function lte2(num) { + return this.cmp(num) <= 0; + }; + BN.prototype.eqn = function eqn(num) { + return this.cmpn(num) === 0; + }; + BN.prototype.eq = function eq2(num) { + return this.cmp(num) === 0; + }; + BN.red = function red(num) { + return new Red(num); + }; + BN.prototype.toRed = function toRed(ctx) { + assert4(!(this || _global$110).red, "Already a number in reduction context"); + assert4((this || _global$110).negative === 0, "red works only with positives"); + return ctx.convertTo(this || _global$110)._forceRed(ctx); + }; + BN.prototype.fromRed = function fromRed() { + assert4((this || _global$110).red, "fromRed works only with numbers in reduction context"); + return (this || _global$110).red.convertFrom(this || _global$110); + }; + BN.prototype._forceRed = function _forceRed(ctx) { + (this || _global$110).red = ctx; + return this || _global$110; + }; + BN.prototype.forceRed = function forceRed(ctx) { + assert4(!(this || _global$110).red, "Already a number in reduction context"); + return this._forceRed(ctx); + }; + BN.prototype.redAdd = function redAdd(num) { + assert4((this || _global$110).red, "redAdd works only with red numbers"); + return (this || _global$110).red.add(this || _global$110, num); + }; + BN.prototype.redIAdd = function redIAdd(num) { + assert4((this || _global$110).red, "redIAdd works only with red numbers"); + return (this || _global$110).red.iadd(this || _global$110, num); + }; + BN.prototype.redSub = function redSub(num) { + assert4((this || _global$110).red, "redSub works only with red numbers"); + return (this || _global$110).red.sub(this || _global$110, num); + }; + BN.prototype.redISub = function redISub(num) { + assert4((this || _global$110).red, "redISub works only with red numbers"); + return (this || _global$110).red.isub(this || _global$110, num); + }; + BN.prototype.redShl = function redShl(num) { + assert4((this || _global$110).red, "redShl works only with red numbers"); + return (this || _global$110).red.shl(this || _global$110, num); + }; + BN.prototype.redMul = function redMul(num) { + assert4((this || _global$110).red, "redMul works only with red numbers"); + (this || _global$110).red._verify2(this || _global$110, num); + return (this || _global$110).red.mul(this || _global$110, num); + }; + BN.prototype.redIMul = function redIMul(num) { + assert4((this || _global$110).red, "redMul works only with red numbers"); + (this || _global$110).red._verify2(this || _global$110, num); + return (this || _global$110).red.imul(this || _global$110, num); + }; + BN.prototype.redSqr = function redSqr() { + assert4((this || _global$110).red, "redSqr works only with red numbers"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.sqr(this || _global$110); + }; + BN.prototype.redISqr = function redISqr() { + assert4((this || _global$110).red, "redISqr works only with red numbers"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.isqr(this || _global$110); + }; + BN.prototype.redSqrt = function redSqrt() { + assert4((this || _global$110).red, "redSqrt works only with red numbers"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.sqrt(this || _global$110); + }; + BN.prototype.redInvm = function redInvm() { + assert4((this || _global$110).red, "redInvm works only with red numbers"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.invm(this || _global$110); + }; + BN.prototype.redNeg = function redNeg() { + assert4((this || _global$110).red, "redNeg works only with red numbers"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.neg(this || _global$110); + }; + BN.prototype.redPow = function redPow(num) { + assert4((this || _global$110).red && !num.red, "redPow(normalNum)"); + (this || _global$110).red._verify1(this || _global$110); + return (this || _global$110).red.pow(this || _global$110, num); + }; + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + function MPrime(name2, p7) { + (this || _global$110).name = name2; + (this || _global$110).p = new BN(p7, 16); + (this || _global$110).n = (this || _global$110).p.bitLength(); + (this || _global$110).k = new BN(1).iushln((this || _global$110).n).isub((this || _global$110).p); + (this || _global$110).tmp = this._tmp(); + } + MPrime.prototype._tmp = function _tmp() { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil((this || _global$110).n / 13)); + return tmp; + }; + MPrime.prototype.ireduce = function ireduce(num) { + var r8 = num; + var rlen; + do { + this.split(r8, (this || _global$110).tmp); + r8 = this.imulK(r8); + r8 = r8.iadd((this || _global$110).tmp); + rlen = r8.bitLength(); + } while (rlen > (this || _global$110).n); + var cmp = rlen < (this || _global$110).n ? -1 : r8.ucmp((this || _global$110).p); + if (cmp === 0) { + r8.words[0] = 0; + r8.length = 1; + } else if (cmp > 0) { + r8.isub((this || _global$110).p); + } else { + if (r8.strip !== void 0) { + r8.strip(); + } else { + r8._strip(); + } + } + return r8; + }; + MPrime.prototype.split = function split3(input, out) { + input.iushrn((this || _global$110).n, 0, out); + }; + MPrime.prototype.imulK = function imulK(num) { + return num.imul((this || _global$110).k); + }; + function K256() { + MPrime.call(this || _global$110, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + inherits2(K256, MPrime); + K256.prototype.split = function split3(input, output) { + var mask = 4194303; + var outLen = Math.min(input.length, 9); + for (var i7 = 0; i7 < outLen; i7++) { + output.words[i7] = input.words[i7]; + } + output.length = outLen; + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + for (i7 = 10; i7 < input.length; i7++) { + var next = input.words[i7] | 0; + input.words[i7 - 10] = (next & mask) << 4 | prev >>> 22; + prev = next; + } + prev >>>= 22; + input.words[i7 - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + K256.prototype.imulK = function imulK(num) { + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + var lo = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var w6 = num.words[i7] | 0; + lo += w6 * 977; + num.words[i7] = lo & 67108863; + lo = w6 * 64 + (lo / 67108864 | 0); + } + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + function P224() { + MPrime.call(this || _global$110, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + inherits2(P224, MPrime); + function P192() { + MPrime.call(this || _global$110, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + inherits2(P192, MPrime); + function P25519() { + MPrime.call(this || _global$110, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + inherits2(P25519, MPrime); + P25519.prototype.imulK = function imulK(num) { + var carry = 0; + for (var i7 = 0; i7 < num.length; i7++) { + var hi = (num.words[i7] | 0) * 19 + carry; + var lo = hi & 67108863; + hi >>>= 26; + num.words[i7] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + BN._prime = function prime(name2) { + if (primes[name2]) + return primes[name2]; + var prime2; + if (name2 === "k256") { + prime2 = new K256(); + } else if (name2 === "p224") { + prime2 = new P224(); + } else if (name2 === "p192") { + prime2 = new P192(); + } else if (name2 === "p25519") { + prime2 = new P25519(); + } else { + throw new Error("Unknown prime " + name2); + } + primes[name2] = prime2; + return prime2; + }; + function Red(m7) { + if (typeof m7 === "string") { + var prime = BN._prime(m7); + (this || _global$110).m = prime.p; + (this || _global$110).prime = prime; + } else { + assert4(m7.gtn(1), "modulus must be greater than 1"); + (this || _global$110).m = m7; + (this || _global$110).prime = null; + } + } + Red.prototype._verify1 = function _verify1(a7) { + assert4(a7.negative === 0, "red works only with positives"); + assert4(a7.red, "red works only with red numbers"); + }; + Red.prototype._verify2 = function _verify2(a7, b8) { + assert4((a7.negative | b8.negative) === 0, "red works only with positives"); + assert4(a7.red && a7.red === b8.red, "red works only with red numbers"); + }; + Red.prototype.imod = function imod(a7) { + if ((this || _global$110).prime) + return (this || _global$110).prime.ireduce(a7)._forceRed(this || _global$110); + return a7.umod((this || _global$110).m)._forceRed(this || _global$110); + }; + Red.prototype.neg = function neg(a7) { + if (a7.isZero()) { + return a7.clone(); + } + return (this || _global$110).m.sub(a7)._forceRed(this || _global$110); + }; + Red.prototype.add = function add2(a7, b8) { + this._verify2(a7, b8); + var res = a7.add(b8); + if (res.cmp((this || _global$110).m) >= 0) { + res.isub((this || _global$110).m); + } + return res._forceRed(this || _global$110); + }; + Red.prototype.iadd = function iadd(a7, b8) { + this._verify2(a7, b8); + var res = a7.iadd(b8); + if (res.cmp((this || _global$110).m) >= 0) { + res.isub((this || _global$110).m); + } + return res; + }; + Red.prototype.sub = function sub(a7, b8) { + this._verify2(a7, b8); + var res = a7.sub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$110).m); + } + return res._forceRed(this || _global$110); + }; + Red.prototype.isub = function isub(a7, b8) { + this._verify2(a7, b8); + var res = a7.isub(b8); + if (res.cmpn(0) < 0) { + res.iadd((this || _global$110).m); + } + return res; + }; + Red.prototype.shl = function shl(a7, num) { + this._verify1(a7); + return this.imod(a7.ushln(num)); + }; + Red.prototype.imul = function imul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.imul(b8)); + }; + Red.prototype.mul = function mul(a7, b8) { + this._verify2(a7, b8); + return this.imod(a7.mul(b8)); + }; + Red.prototype.isqr = function isqr(a7) { + return this.imul(a7, a7.clone()); + }; + Red.prototype.sqr = function sqr(a7) { + return this.mul(a7, a7); + }; + Red.prototype.sqrt = function sqrt(a7) { + if (a7.isZero()) + return a7.clone(); + var mod3 = (this || _global$110).m.andln(3); + assert4(mod3 % 2 === 1); + if (mod3 === 3) { + var pow = (this || _global$110).m.add(new BN(1)).iushrn(2); + return this.pow(a7, pow); + } + var q5 = (this || _global$110).m.subn(1); + var s7 = 0; + while (!q5.isZero() && q5.andln(1) === 0) { + s7++; + q5.iushrn(1); + } + assert4(!q5.isZero()); + var one = new BN(1).toRed(this || _global$110); + var nOne = one.redNeg(); + var lpow = (this || _global$110).m.subn(1).iushrn(1); + var z6 = (this || _global$110).m.bitLength(); + z6 = new BN(2 * z6 * z6).toRed(this || _global$110); + while (this.pow(z6, lpow).cmp(nOne) !== 0) { + z6.redIAdd(nOne); + } + var c7 = this.pow(z6, q5); + var r8 = this.pow(a7, q5.addn(1).iushrn(1)); + var t8 = this.pow(a7, q5); + var m7 = s7; + while (t8.cmp(one) !== 0) { + var tmp = t8; + for (var i7 = 0; tmp.cmp(one) !== 0; i7++) { + tmp = tmp.redSqr(); + } + assert4(i7 < m7); + var b8 = this.pow(c7, new BN(1).iushln(m7 - i7 - 1)); + r8 = r8.redMul(b8); + c7 = b8.redSqr(); + t8 = t8.redMul(c7); + m7 = i7; + } + return r8; + }; + Red.prototype.invm = function invm(a7) { + var inv = a7._invmp((this || _global$110).m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + Red.prototype.pow = function pow(a7, num) { + if (num.isZero()) + return new BN(1).toRed(this || _global$110); + if (num.cmpn(1) === 0) + return a7.clone(); + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this || _global$110); + wnd[1] = a7; + for (var i7 = 2; i7 < wnd.length; i7++) { + wnd[i7] = this.mul(wnd[i7 - 1], a7); + } + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + for (i7 = num.length - 1; i7 >= 0; i7--) { + var word = num.words[i7]; + for (var j6 = start - 1; j6 >= 0; j6--) { + var bit = word >> j6 & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i7 !== 0 || j6 !== 0)) + continue; + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + return res; + }; + Red.prototype.convertTo = function convertTo(num) { + var r8 = num.umod((this || _global$110).m); + return r8 === num ? r8.clone() : r8; + }; + Red.prototype.convertFrom = function convertFrom(num) { + var res = num.clone(); + res.red = null; + return res; + }; + BN.mont = function mont(num) { + return new Mont(num); + }; + function Mont(m7) { + Red.call(this || _global$110, m7); + (this || _global$110).shift = (this || _global$110).m.bitLength(); + if ((this || _global$110).shift % 26 !== 0) { + (this || _global$110).shift += 26 - (this || _global$110).shift % 26; + } + (this || _global$110).r = new BN(1).iushln((this || _global$110).shift); + (this || _global$110).r2 = this.imod((this || _global$110).r.sqr()); + (this || _global$110).rinv = (this || _global$110).r._invmp((this || _global$110).m); + (this || _global$110).minv = (this || _global$110).rinv.mul((this || _global$110).r).isubn(1).div((this || _global$110).m); + (this || _global$110).minv = (this || _global$110).minv.umod((this || _global$110).r); + (this || _global$110).minv = (this || _global$110).r.sub((this || _global$110).minv); + } + inherits2(Mont, Red); + Mont.prototype.convertTo = function convertTo(num) { + return this.imod(num.ushln((this || _global$110).shift)); + }; + Mont.prototype.convertFrom = function convertFrom(num) { + var r8 = this.imod(num.mul((this || _global$110).rinv)); + r8.red = null; + return r8; + }; + Mont.prototype.imul = function imul(a7, b8) { + if (a7.isZero() || b8.isZero()) { + a7.words[0] = 0; + a7.length = 1; + return a7; + } + var t8 = a7.imul(b8); + var c7 = t8.maskn((this || _global$110).shift).mul((this || _global$110).minv).imaskn((this || _global$110).shift).mul((this || _global$110).m); + var u7 = t8.isub(c7).iushrn((this || _global$110).shift); + var res = u7; + if (u7.cmp((this || _global$110).m) >= 0) { + res = u7.isub((this || _global$110).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$110).m); + } + return res._forceRed(this || _global$110); + }; + Mont.prototype.mul = function mul(a7, b8) { + if (a7.isZero() || b8.isZero()) + return new BN(0)._forceRed(this || _global$110); + var t8 = a7.mul(b8); + var c7 = t8.maskn((this || _global$110).shift).mul((this || _global$110).minv).imaskn((this || _global$110).shift).mul((this || _global$110).m); + var u7 = t8.isub(c7).iushrn((this || _global$110).shift); + var res = u7; + if (u7.cmp((this || _global$110).m) >= 0) { + res = u7.isub((this || _global$110).m); + } else if (u7.cmpn(0) < 0) { + res = u7.iadd((this || _global$110).m); + } + return res._forceRed(this || _global$110); + }; + Mont.prototype.invm = function invm(a7) { + var res = this.imod(a7._invmp((this || _global$110).m).mul((this || _global$110).r2)); + return res._forceRed(this || _global$110); + }; + })(module3, exports$75); + return module3.exports; +} +function dew$55() { + if (_dewExec$55) + return exports$65; + _dewExec$55 = true; + var BN = dew$65(); + var Buffer4 = dew$15().Buffer; + function withPublic(paddedMsg, key) { + return Buffer4.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray()); + } + exports$65 = withPublic; + return exports$65; +} +function dew$45() { + if (_dewExec$45) + return exports$55; + _dewExec$45 = true; + var parseKeys = dew$e3(); + var randomBytes2 = dew$3G(); + var createHash2 = dew$3t(); + var mgf = dew$84(); + var xor2 = dew$75(); + var BN = dew$65(); + var withPublic = dew$55(); + var crt = dew$$(); + var Buffer4 = dew$15().Buffer; + exports$55 = function publicEncrypt2(publicKey, msg, reverse2) { + var padding; + if (publicKey.padding) { + padding = publicKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(publicKey); + var paddedMsg; + if (padding === 4) { + paddedMsg = oaep(key, msg); + } else if (padding === 1) { + paddedMsg = pkcs1(key, msg, reverse2); + } else if (padding === 3) { + paddedMsg = new BN(msg); + if (paddedMsg.cmp(key.modulus) >= 0) { + throw new Error("data too long for modulus"); + } + } else { + throw new Error("unknown padding"); + } + if (reverse2) { + return crt(paddedMsg, key); + } else { + return withPublic(paddedMsg, key); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var mLen = msg.length; + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + var hLen2 = 2 * hLen; + if (mLen > k6 - hLen2 - 2) { + throw new Error("message too long"); + } + var ps = Buffer4.alloc(k6 - mLen - hLen2 - 2); + var dblen = k6 - hLen - 1; + var seed = randomBytes2(hLen); + var maskedDb = xor2(Buffer4.concat([iHash, ps, Buffer4.alloc(1, 1), msg], dblen), mgf(seed, dblen)); + var maskedSeed = xor2(seed, mgf(maskedDb, hLen)); + return new BN(Buffer4.concat([Buffer4.alloc(1), maskedSeed, maskedDb], k6)); + } + function pkcs1(key, msg, reverse2) { + var mLen = msg.length; + var k6 = key.modulus.byteLength(); + if (mLen > k6 - 11) { + throw new Error("message too long"); + } + var ps; + if (reverse2) { + ps = Buffer4.alloc(k6 - mLen - 3, 255); + } else { + ps = nonZero(k6 - mLen - 3); + } + return new BN(Buffer4.concat([Buffer4.from([0, reverse2 ? 1 : 2]), ps, Buffer4.alloc(1), msg], k6)); + } + function nonZero(len) { + var out = Buffer4.allocUnsafe(len); + var i7 = 0; + var cache = randomBytes2(len * 2); + var cur = 0; + var num; + while (i7 < len) { + if (cur === cache.length) { + cache = randomBytes2(len * 2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i7++] = num; + } + } + return out; + } + return exports$55; +} +function dew$310() { + if (_dewExec$310) + return exports$45; + _dewExec$310 = true; + var parseKeys = dew$e3(); + var mgf = dew$84(); + var xor2 = dew$75(); + var BN = dew$65(); + var crt = dew$$(); + var createHash2 = dew$3t(); + var withPublic = dew$55(); + var Buffer4 = dew$15().Buffer; + exports$45 = function privateDecrypt2(privateKey, enc, reverse2) { + var padding; + if (privateKey.padding) { + padding = privateKey.padding; + } else if (reverse2) { + padding = 1; + } else { + padding = 4; + } + var key = parseKeys(privateKey); + var k6 = key.modulus.byteLength(); + if (enc.length > k6 || new BN(enc).cmp(key.modulus) >= 0) { + throw new Error("decryption error"); + } + var msg; + if (reverse2) { + msg = withPublic(new BN(enc), key); + } else { + msg = crt(enc, key); + } + var zBuffer = Buffer4.alloc(k6 - msg.length); + msg = Buffer4.concat([zBuffer, msg], k6); + if (padding === 4) { + return oaep(key, msg); + } else if (padding === 1) { + return pkcs1(key, msg, reverse2); + } else if (padding === 3) { + return msg; + } else { + throw new Error("unknown padding"); + } + }; + function oaep(key, msg) { + var k6 = key.modulus.byteLength(); + var iHash = createHash2("sha1").update(Buffer4.alloc(0)).digest(); + var hLen = iHash.length; + if (msg[0] !== 0) { + throw new Error("decryption error"); + } + var maskedSeed = msg.slice(1, hLen + 1); + var maskedDb = msg.slice(hLen + 1); + var seed = xor2(maskedSeed, mgf(maskedDb, hLen)); + var db = xor2(maskedDb, mgf(seed, k6 - hLen - 1)); + if (compare(iHash, db.slice(0, hLen))) { + throw new Error("decryption error"); + } + var i7 = hLen; + while (db[i7] === 0) { + i7++; + } + if (db[i7++] !== 1) { + throw new Error("decryption error"); + } + return db.slice(i7); + } + function pkcs1(key, msg, reverse2) { + var p1 = msg.slice(0, 2); + var i7 = 2; + var status = 0; + while (msg[i7++] !== 0) { + if (i7 >= msg.length) { + status++; + break; + } + } + var ps = msg.slice(2, i7 - 1); + if (p1.toString("hex") !== "0002" && !reverse2 || p1.toString("hex") !== "0001" && reverse2) { + status++; + } + if (ps.length < 8) { + status++; + } + if (status) { + throw new Error("decryption error"); + } + return msg.slice(i7); + } + function compare(a7, b8) { + a7 = Buffer4.from(a7); + b8 = Buffer4.from(b8); + var dif = 0; + var len = a7.length; + if (a7.length !== b8.length) { + dif++; + len = Math.min(a7.length, b8.length); + } + var i7 = -1; + while (++i7 < len) { + dif += a7[i7] ^ b8[i7]; + } + return dif; + } + return exports$45; +} +function dew$210() { + if (_dewExec$210) + return exports$310; + _dewExec$210 = true; + exports$310.publicEncrypt = dew$45(); + exports$310.privateDecrypt = dew$310(); + exports$310.privateEncrypt = function privateEncrypt2(key, buf) { + return exports$310.publicEncrypt(key, buf, true); + }; + exports$310.publicDecrypt = function publicDecrypt2(key, buf) { + return exports$310.privateDecrypt(key, buf, true); + }; + return exports$310; +} +function dew$110() { + if (_dewExec$110) + return exports$210; + _dewExec$110 = true; + var process$1 = process3; + function oldBrowser() { + throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11"); + } + var safeBuffer = dew$15(); + var randombytes = dew$3G(); + var Buffer4 = safeBuffer.Buffer; + var kBufferMaxLength = safeBuffer.kMaxLength; + var crypto2 = _global8.crypto || _global8.msCrypto; + var kMaxUint32 = Math.pow(2, 32) - 1; + function assertOffset(offset, length) { + if (typeof offset !== "number" || offset !== offset) { + throw new TypeError("offset must be a number"); + } + if (offset > kMaxUint32 || offset < 0) { + throw new TypeError("offset must be a uint32"); + } + if (offset > kBufferMaxLength || offset > length) { + throw new RangeError("offset out of range"); + } + } + function assertSize(size2, offset, length) { + if (typeof size2 !== "number" || size2 !== size2) { + throw new TypeError("size must be a number"); + } + if (size2 > kMaxUint32 || size2 < 0) { + throw new TypeError("size must be a uint32"); + } + if (size2 + offset > length || size2 > kBufferMaxLength) { + throw new RangeError("buffer too small"); + } + } + if (crypto2 && crypto2.getRandomValues || !process$1.browser) { + exports$210.randomFill = randomFill2; + exports$210.randomFillSync = randomFillSync2; + } else { + exports$210.randomFill = oldBrowser; + exports$210.randomFillSync = oldBrowser; + } + function randomFill2(buf, offset, size2, cb) { + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global8.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + if (typeof offset === "function") { + cb = offset; + offset = 0; + size2 = buf.length; + } else if (typeof size2 === "function") { + cb = size2; + size2 = buf.length - offset; + } else if (typeof cb !== "function") { + throw new TypeError('"cb" argument must be a function'); + } + assertOffset(offset, buf.length); + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2, cb); + } + function actualFill(buf, offset, size2, cb) { + if (process$1.browser) { + var ourBuf = buf.buffer; + var uint = new Uint8Array(ourBuf, offset, size2); + crypto2.getRandomValues(uint); + if (cb) { + process$1.nextTick(function() { + cb(null, buf); + }); + return; + } + return buf; + } + if (cb) { + randombytes(size2, function(err, bytes2) { + if (err) { + return cb(err); + } + bytes2.copy(buf, offset); + cb(null, buf); + }); + return; + } + var bytes = randombytes(size2); + bytes.copy(buf, offset); + return buf; + } + function randomFillSync2(buf, offset, size2) { + if (typeof offset === "undefined") { + offset = 0; + } + if (!Buffer4.isBuffer(buf) && !(buf instanceof _global8.Uint8Array)) { + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + } + assertOffset(offset, buf.length); + if (size2 === void 0) + size2 = buf.length - offset; + assertSize(size2, offset, buf.length); + return actualFill(buf, offset, size2); + } + return exports$210; +} +function dew15() { + if (_dewExec15) + return exports$111; + _dewExec15 = true; + exports$111.randomBytes = exports$111.rng = exports$111.pseudoRandomBytes = exports$111.prng = dew$3G(); + exports$111.createHash = exports$111.Hash = dew$3t(); + exports$111.createHmac = exports$111.Hmac = dew$3q(); + var algos = dew$3p(); + var algoKeys = Object.keys(algos); + var hashes = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(algoKeys); + exports$111.getHashes = function() { + return hashes; + }; + var p7 = dew$3j(); + exports$111.pbkdf2 = p7.pbkdf2; + exports$111.pbkdf2Sync = p7.pbkdf2Sync; + var aes = dew$2T(); + exports$111.Cipher = aes.Cipher; + exports$111.createCipher = aes.createCipher; + exports$111.Cipheriv = aes.Cipheriv; + exports$111.createCipheriv = aes.createCipheriv; + exports$111.Decipher = aes.Decipher; + exports$111.createDecipher = aes.createDecipher; + exports$111.Decipheriv = aes.Decipheriv; + exports$111.createDecipheriv = aes.createDecipheriv; + exports$111.getCiphers = aes.getCiphers; + exports$111.listCiphers = aes.listCiphers; + var dh = dew$1e(); + exports$111.DiffieHellmanGroup = dh.DiffieHellmanGroup; + exports$111.createDiffieHellmanGroup = dh.createDiffieHellmanGroup; + exports$111.getDiffieHellman = dh.getDiffieHellman; + exports$111.createDiffieHellman = dh.createDiffieHellman; + exports$111.DiffieHellman = dh.DiffieHellman; + var sign = dew$b4(); + exports$111.createSign = sign.createSign; + exports$111.Sign = sign.Sign; + exports$111.createVerify = sign.createVerify; + exports$111.Verify = sign.Verify; + exports$111.createECDH = dew$94(); + var publicEncrypt2 = dew$210(); + exports$111.publicEncrypt = publicEncrypt2.publicEncrypt; + exports$111.privateEncrypt = publicEncrypt2.privateEncrypt; + exports$111.publicDecrypt = publicEncrypt2.publicDecrypt; + exports$111.privateDecrypt = publicEncrypt2.privateDecrypt; + var rf = dew$110(); + exports$111.randomFill = rf.randomFill; + exports$111.randomFillSync = rf.randomFillSync; + exports$111.createCredentials = function() { + throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); + }; + exports$111.constants = { + "DH_CHECK_P_NOT_SAFE_PRIME": 2, + "DH_CHECK_P_NOT_PRIME": 1, + "DH_UNABLE_TO_CHECK_GENERATOR": 4, + "DH_NOT_SUITABLE_GENERATOR": 8, + "NPN_ENABLED": 1, + "ALPN_ENABLED": 1, + "RSA_PKCS1_PADDING": 1, + "RSA_SSLV23_PADDING": 2, + "RSA_NO_PADDING": 3, + "RSA_PKCS1_OAEP_PADDING": 4, + "RSA_X931_PADDING": 5, + "RSA_PKCS1_PSS_PADDING": 6, + "POINT_CONVERSION_COMPRESSED": 2, + "POINT_CONVERSION_UNCOMPRESSED": 4, + "POINT_CONVERSION_HYBRID": 6 + }; + return exports$111; +} +var exports$3H, _dewExec$3G, _global$1e, exports$3G, _dewExec$3F, exports$3F, _dewExec$3E, exports$3E, _dewExec$3D, exports$3D, _dewExec$3C, _global$1d, exports$3C, _dewExec$3B, _global$1c, exports$3B, _dewExec$3A, _global$1b, exports$3A, _dewExec$3z, _global$1a, exports$3z, _dewExec$3y, _global$19, exports$3y, _dewExec$3x, _global$18, exports$3x, _dewExec$3w, _global$17, exports$3w, _dewExec$3v, module$f, exports$3v, _dewExec$3u, _global$16, exports$3u, _dewExec$3t, exports$3t, _dewExec$3s, exports$3s, _dewExec$3r, exports$3r, _dewExec$3q, _algorithms$2, exports$3q, _dewExec$3p, exports$3p, _dewExec$3o, exports$3o, _dewExec$3n, _global$15, exports$3n, _dewExec$3m, exports$3m, _dewExec$3l, _global$14, exports$3l, _dewExec$3k, _global$13, exports$3k, _dewExec$3j, exports$3j, _dewExec$3i, exports$3i, _dewExec$3h, exports$3h, _dewExec$3g, exports$3g, _dewExec$3f, exports$3f, _dewExec$3e, exports$3e, _dewExec$3d, exports$3d, _dewExec$3c, exports$3c, _dewExec$3b, _global$122, exports$3b, _dewExec$3a, exports$3a, _dewExec$39, exports$39, _dewExec$38, exports$38, _dewExec$37, exports$37, _dewExec$36, exports$36, _dewExec$35, exports$35, _dewExec$342, exports$342, _dewExec$332, exports$332, _dewExec$322, _list$2, exports$322, _dewExec$31, exports$31, _dewExec$30, _global$11, exports$30, _dewExec$2$, _global$10, exports$2$, _dewExec$2_, _global$$, exports$2_, _dewExec$2Z, _global$_, exports$2Z, _dewExec$2Y, exports$2Y, _dewExec$2X, _global$Z, exports$2X, _dewExec$2W, _global$Y, exports$2W, _dewExec$2V, exports$2V, _dewExec$2U, exports$2U, _dewExec$2T, exports$2T, _dewExec$2S, module$e, _global$X, exports$2S, _dewExec$2R, module$d, _global$W, exports$2Q, _dewExec$2P, exports$2P, _dewExec$2O, _global$U, exports$2O, _dewExec$2N, exports$2N, _dewExec$2M, exports$2M, _dewExec$2L, exports$2L, _dewExec$2K, exports$2K, _dewExec$2J, _global$T, exports$2J, _dewExec$2I, _global$S, exports$2I, _dewExec$2H, _global$R, exports$2H, _dewExec$2G, _global$Q, exports$2G, _dewExec$2F, _global$P, exports$2F, _dewExec$2E, _global$O, exports$2E, _dewExec$2D, _global$N, exports$2D, _dewExec$2C, module$b, exports$f$2, _dewExec$f$2, exports$e$2, _dewExec$e$2, exports$d$2, _dewExec$d$2, exports$c$2, _dewExec$c$2, exports$b$2, _dewExec$b$2, exports$a$2, _dewExec$a$2, exports$9$2, _dewExec$9$2, _global$2$2, exports$8$2, _dewExec$8$2, _global$1$2, exports$7$2, _dewExec$7$2, exports$6$2, _dewExec$6$2, exports$5$2, _dewExec$5$2, exports$4$2, _dewExec$4$2, exports$3$2, _dewExec$3$2, _global$M, exports$2$2, _dewExec$2$2, exports$1$2, _dewExec$1$2, exports$2C, _dewExec$2B, exports$2B, _dewExec$2A, _global$L, stream, exports$2A, _dewExec$2z, _global$K, exports$2z, _dewExec$2y, exports$2y, _dewExec$2x, exports$2x, _dewExec$2w, exports$2w, _dewExec$2v, _algorithms$1, exports$2v, _dewExec$2u, exports$2u, _dewExec$2t, exports$2t, _dewExec$2s, _global$J, exports$2s, _dewExec$2r, exports$2r, _dewExec$2q, _global$I, exports$2q, _dewExec$2p, _global$H, exports$2p, _dewExec$2o, exports$2o, _dewExec$2n, exports$2n, _dewExec$2m, exports$2m, _dewExec$2l, exports$2l, _dewExec$2k, exports$2k, _dewExec$2j, exports$2j, _dewExec$2i, exports$2i, _dewExec$2h, exports$2h, _dewExec$2g, _global$G, exports$2g, _dewExec$2f, exports$2f, _dewExec$2e, exports$2e, _dewExec$2d, exports$2d, _dewExec$2c, exports$2c, _dewExec$2b, exports$2b, _dewExec$2a, exports$2a, _dewExec$29, exports$29, _dewExec$28, exports$28, _dewExec$27, _list$1, exports$27, _dewExec$26, exports$262, _dewExec$252, _global$F, exports$252, _dewExec$242, _global$E, exports$242, _dewExec$232, _global$D, exports$232, _dewExec$222, _global$C, exports$222, _dewExec$21, exports$21, _dewExec$20, _global$B, exports$20, _dewExec$1$, _global$A, exports$1$, _dewExec$1_, exports$1_, _dewExec$1Z, exports$1Z, _dewExec$1Y, exports$1Y, _dewExec$1X, module$a, _global$z, exports$1X, _dewExec$1W, module$9, _global$y, exports$1W, _dewExec$1V, exports$1U, _dewExec$1T, exports$1T, _dewExec$1S, _global$w, exports$1S, _dewExec$1R, exports$1R, _dewExec$1Q, exports$1Q, _dewExec$1P, exports$1P, _dewExec$1O, _global$v, exports$1O, _dewExec$1N, _global$u, exports$1N, _dewExec$1M, _global$t, exports$1M, _dewExec$1L, _global$s, exports$1L, _dewExec$1K, _global$r, exports$1K, _dewExec$1J, _global$q, exports$1J, _dewExec$1I, _global$p, exports$1I, _dewExec$1H, module$7, e$g, e$1$12, t$c, r$1$1, r$2$1, t$1$1, c$n, b$j, p$s, g$h, y$n, m$m, S$e, R$7, k$g, M$a, j$a, O$8, P$8, x$a, L$8, D$9, C$9, A$c, q$8, W$5, U$a, H$7, F$8, V$6, G$5, Y$4, z$9, J$5, Q$4, Z$3, $$3, t$2$1, r$3$1, n$1$12, b$1$1, p$1$1, g$1$1, y$1$1, w$1$1, S$1$1, R$1$1, k$1$1, E$1$1, M$1$1, O$1$1, T$1$1, x$1$1, P$1$1, D$1$1, L$1$1, C$1$1, A$1$1, I$1$1, N$1$1, U$1$1, H$1$1, F$1$1, V$1$1, Y$1$1, K$1$1, z$1$1, Q$1$1, X$1$1, t$4$1, t$5$1, n$2$1, i$e, a$p, o$s, s$q, f$2$1, h$2$1, p$2$1, o$1$12, e$3$1, s$1$1, t$6$1, o$2$1, e$4$1, f$3$1, v$2$1, l$r, d$n, f$u, b$i, exports$1H, _dewExec$1G, _global$o, exports$1G, _dewExec$1F, exports$1F, _dewExec$1E, exports$1E, _dewExec$1D, exports$1D, _dewExec$1C, _algorithms, exports$1C, _dewExec$1B, exports$1B, _dewExec$1A, exports$1A, _dewExec$1z, _global$n, exports$1z, _dewExec$1y, exports$1y, _dewExec$1x, _global$m, exports$1x, _dewExec$1w, _global$l, exports$1w, _dewExec$1v, exports$1v, _dewExec$1u, exports$1u, _dewExec$1t, exports$1t, _dewExec$1s, exports$1s, _dewExec$1r, exports$1r, _dewExec$1q, exports$1q, _dewExec$1p, exports$1p, _dewExec$1o, exports$1o, _dewExec$1n, _global$k, exports$1n, _dewExec$1m, exports$1m, _dewExec$1l, exports$1l, _dewExec$1k, exports$1k, _dewExec$1j, exports$1j$1, _dewExec$1i$1, exports$1i$1, _dewExec$1h$1, exports$1h$1, _dewExec$1g$1, exports$1g$1, _dewExec$1f$1, exports$1f$1, _dewExec$1e$1, _list, exports$1e$1, _dewExec$1d$1, exports$1d$1, _dewExec$1c$1, _global$j$1, exports$1c$1, _dewExec$1b$1, _global$i$1, exports$1b$1, _dewExec$1a$1, _global$h$1, exports$1a$1, _dewExec$19$1, _global$g$1, exports$19$1, _dewExec$18$1, exports$18$1, _dewExec$17$1, _global$f$1, exports$17$1, _dewExec$16$1, _global$e$1, exports$16$1, _dewExec$15$1, exports$15$1, _dewExec$14$1, exports$14$1, _dewExec$13$1, exports$13$1, _dewExec$12$1, module$6, _global$d$1, exports$12$1, _dewExec$11$1, module$5, _global$c$1, _global$b$1, exports$11$1, indexOf3, Object_keys2, forEach3, defineProp2, globals2, Script6, o5, n5, t5, f5, a5, e7, o$13, f$13, h5, r5, _4, e$13, u5, h$12, _$1, r$12, e$22, n$22, o$32, f$3, c$13, a$22, l$13, I4, s$13, h$2, _$2, n$3, r$22, o$4, f$4, l$22, a$3, w$1, _$3, e$4, n$4, r$3, l$3, o$5, c$3, d$2, p$2, b$2, w$2, g4, B4, T4, m4, A4, U4, x5, j4, q3, L4, k$2, z4, D4, F4, G3, H3, W3, X3, Y4, Z3, $3, tt, it, st, _t, et, nt, e$5, n$5, s$2, h$3, f$6, m$12, n$6, p$3, s$3, h$4, e$6, r$4, o$6, h$5, n$7, p$4, l$4, d$3, c$4, _$4, m$2, u$4, g$1, v$1, w$3, s$4, f$8, a$7, u$5, h$6, c$5, l$5, p$5, d$4, m$3, y$2, b$3, v$2, w$4, g$2, B$1, k$3, S$1, A$1, H$1, E$2, P$1, U$1, K$1, x$1, z$1, I$2, F$1, M$1, r$5, o$7, r$6, i5, n$8, f$9, o$8, p$6, s$6, a$8, h$7, c$6, l$6, d$5, _$5, b$4, k$4, g$3, m$4, z$2, w$5, E$3, I$3, A$2, U$2, d$6, i$13, f$a, o$9, a$9, c$7, n$9, l$7, e$8, f$b, t$12, a$a, p$8, n$a, i$22, o$a, h$8, y$4, f$c, l$8, m$5, B$3, u$7, C$1, d$7, b$5, A$3, S$3, F$2, U$3, w$6, I$4, M$2, a$b, h$9, o$b, f$d, u$8, _$7, d$8, y$5, S$4, v$5, I$5, U$4, w$7, m$6, E$5, b$6, k$6, T$2, O$2, A$4, M$3, V$1, t$22, f$e, a$c, c$9, s$9, f$f, p$a, u$9, l$a, d$9, y$6, m$7, c$a, s$a, f$g, p$b, l$b, u$a, d$a, m$8, y$7, _$8, t$32, p$c, c$b, o$c, e$9, p$d, n$b, s$b, v$8, y$8, a$d, t$4, i$3, r$7, h$a, n$c, t$5, e$a, r$8, n$d, a$e, f$i, n$e, t$6, o$e, a$f, i$4, b$7, d$c, r$9, t$7, n$f, i$5, o$f, p$e, s$c, m$9, u$b, h$b, w$a, y$9, P$2, B$5, K$2, R$1, S$5, x$2, C$2, D$2, G$1, H$2, T$3, j$1, M$4, q$1, O$3, z$3, F$3, I$6, J$1, N$2, m$a, u$c, n$g, d$d, l$d, r$a, e$b, n$i, a$g, i$7, o$g, c$d, s$d, l$e, u$d, h$c, d$e, r$b, i$8, e$c, a$h, l$f, g$9, r$c, n$j, s$f, o$i, e$d, u$f, a$i, c$f, f$k, v$b, _$a, l$g, p$g, m$c, g$a, k$8, d$f, C$3, s$g, n$k, u$g, a$j, c$g, f$l, _$b, g$b, m$d, p$h, l$h, v$c, d$g, k$9, b$9, j$3, x$4, y$c, w$c, r$e, o$k, a$k, u$h, l$i, c$h, p$i, f$m, g$c, d$h, S$8, _$c, b$a, z$5, k$a, y$d, H$4, w$d, L$3, j$4, A$7, B$7, W$2, q$3, C$4, D$3, E$7, F$4, M$5, N$3, O$4, P$3, Q$1, R$2, T$4, V$2, X$2, Y$1, s$h, h$e, r$f, n$l, a$l, b$b, i$9, n$m, s$i, o$m, u$i, l$j, v$e, y$e, m$f, S$9, g$d, M$6, x$6, _$d, z$6, q$4, R$3, N$4, E$8, k$b, O$5, L$4, B$8, T$5, J$3, X$3, D$4, Y$2, W$3, K$4, U$6, G$3, H$5, Z$1, $$1, ee3, de3, ce3, te3, ae3, re3, be3, ie2, ne3, se3, ue3, he3, pe3, le3, ve3, me3, Se3, ge3, Ae3, Ie, we3, xe, _e, ze, qe, Re, Pe, je3, Ne, Ee3, Oe3, Le, Be2, o$n, s$j, a$m, u$j, c$i, f$n, p$k, d$i, g$e, _$e, v$f, b$c, m$g, S$a, j$6, w$f, B$9, k$c, D$5, U$7, N$5, O$6, A$9, x$7, I$9, q$5, F$6, K$5, R$4, G$4, L$5, M$7, J$4, V$4, z$7, H$6, Q$3, e$f, t$a, s$k, n$n, o$o, h$h, y$g, r$g, u$k, a$n, c$j, k$d, f$o, b$d, l$l, d$j, p$l, j$7, v$g, m$h, q$6, K$6, P$6, s$l, i$a, o$p, d$k, n$o, p$m, u$l, y$h, m$i, f$p, b$e, E$a, h$i, v$h, p$n, d$l, f$q, c$k, g$f, w$g, l$n, m$j, v$i, E$b, L$6, R$5, j$8, T$7, P$7, K$7, W$4, x$8, B$a, S$b, q$7, U$8, V$5, C$7, z$8, i$b, n$p, p$o, s$m, u$m, o$q, f$r, i$c, l$o, u$n, c$m, p$p, d$m, h$j, s$n, g$g, m$k, w$h, v$j, y$k, E$c, b$g, B$b, x$9, L$7, k$f, D$7, U$9, R$6, S$c, j$9, A$b, I$a, M$9, o$r, t$b, f$t, u$o, a$o, s$o, l$p, m$l, p$q, l$q, D$8, s$p, _$g, h$k, y$m, E$d, S$d, C$8, N$6, exports$10$1, _dewExec$10$1, _global$a$1, exports$$$1, _dewExec$$$1, _global$9$1, exports$_$1, _dewExec$_$1, _primes$1, exports$Z$1, _dewExec$Z$1, _global$8$1, exports$Y$1, _dewExec$Y$1, exports$X$1, _dewExec$X$1, module$4$1, _global$7$1, exports$W$1, _dewExec$W$1, _package$1, exports$V$1, _dewExec$V$1, module$3$1, _global$6$1, exports$U$1, _dewExec$U$1, exports$T$1, _dewExec$T$1, exports$S$1, _dewExec$S$1, exports$R$1, _dewExec$R$1, exports$Q$1, _dewExec$Q$1, exports$P$1, _dewExec$P$1, exports$O$1, _dewExec$O$1, exports$N$1, _dewExec$N$1, exports$M$1, _dewExec$M$1, exports$L$1, _dewExec$L$1, exports$K$1, _dewExec$K$1, exports$J$1, _dewExec$J$1, exports$I$1, _dewExec$I$1, exports$H$1, _dewExec$H$1, exports$G$1, _dewExec$G$1, exports$F$1, _dewExec$F$1, exports$E$1, _dewExec$E$1, exports$D$1, _dewExec$D$1, exports$C$1, _dewExec$C$1, exports$B$1, _dewExec$B$1, exports$A$1, _dewExec$A$1, exports$z$1, _dewExec$z$1, exports$y$1, _dewExec$y$1, exports$x$1, _dewExec$x$1, module$2$1, _global$5$1, exports$w$1, _dewExec$w$1, exports$v$1, _dewExec$v$1, exports$u$1, _dewExec$u$1, exports$t$1, _dewExec$t$1, exports$s$1, _dewExec$s$1, exports$r$1, _dewExec$r$1, exports$q$1, _dewExec$q$1, exports$p$1, _dewExec$p$1, exports$o$1, _dewExec$o$1, exports$n$1, _dewExec$n$1, exports$m$1, _dewExec$m$1, exports$l$1, _dewExec$l$1, exports$k$1, _dewExec$k$1, exports$j$1, _dewExec$j$1, exports$i$1, _dewExec$i$1, exports$h$1, _dewExec$h$1, exports$g$1, _dewExec$g$1, _aesid$1, exports$f$1, _dewExec$f$1, exports$e$1, _dewExec$e$1, _curves$1, exports$d$1, _dewExec$d$1, exports$c$1, _dewExec$c$1, exports$b$1, _dewExec$b$1, _global$4$1, exports$a$1, _dewExec$a$1, module$1$1, _global$3$1, exports$9$1, _dewExec$9$1, _global$2$1, exports$8$1, _dewExec$8$1, exports$7$1, _dewExec$7$1, exports$6$1, _dewExec$6$1, module$8, _global$1$1, exports$5$1, _dewExec$5$1, exports$4$1, _dewExec$4$1, exports$3$1, _dewExec$3$1, exports$2$12, _dewExec$2$12, exports$1$12, _dewExec$1$12, _global$x, exports$1V, _dewExec$1U, crypto, exports$12$2, _dewExec$11$2, _global$a$2, exports$11$2, _dewExec$10$2, _global$9$2, exports$10$2, _dewExec$$$2, _primes$2, exports$$$2, _dewExec$_$2, _global$8$2, exports$_$2, _dewExec$Z$2, exports$Z$2, _dewExec$Y$2, exports$Y$2, _dewExec$X$2, module$4$2, _global$7$2, exports$X$2, _dewExec$W$2, _package$2, exports$W$2, _dewExec$V$2, module$3$2, _global$6$2, exports$V$2, _dewExec$U$2, exports$U$2, _dewExec$T$2, exports$T$2, _dewExec$S$2, exports$S$2, _dewExec$R$2, exports$R$2, _dewExec$Q$2, exports$Q$2, _dewExec$P$2, exports$P$2, _dewExec$O$2, exports$O$2, _dewExec$N$2, exports$N$2, _dewExec$M$2, exports$M$2, _dewExec$L$2, exports$L$2, _dewExec$K$2, exports$K$2, _dewExec$J$2, exports$J$2, _dewExec$I$2, exports$I$2, _dewExec$H$2, exports$H$2, _dewExec$G$2, exports$G$2, _dewExec$F$2, exports$F$2, _dewExec$E$2, exports$E$2, _dewExec$D$2, exports$D$2, _dewExec$C$2, exports$C$2, _dewExec$B$2, exports$B$2, _dewExec$A$2, exports$A$2, _dewExec$z$2, exports$z$2, _dewExec$y$2, exports$y$2, _dewExec$x$2, module$2$2, _global$5$2, exports$x$2, _dewExec$w$2, exports$w$2, _dewExec$v$2, exports$v$2, _dewExec$u$2, exports$u$2, _dewExec$t$2, exports$t$2, _dewExec$s$2, exports$s$2, _dewExec$r$2, exports$r$2, _dewExec$q$2, exports$q$2, _dewExec$p$2, exports$p$2, _dewExec$o$2, exports$o$2, _dewExec$n$2, exports$n$2, _dewExec$m$2, exports$m$2, _dewExec$l$2, exports$l$2, _dewExec$k$2, exports$k$2, _dewExec$j$2, exports$j$2, _dewExec$i$2, exports$i$2, _dewExec$h$2, exports$h$2, _dewExec$g$2, _aesid$2, exports$g$2, _dewExec$f$3, exports$f$3, _dewExec$e$3, _curves$2, exports$e$3, _dewExec$d$3, exports$d$3, _dewExec$c$3, exports$c$3, _dewExec$b$3, _global$4$2, exports$b$3, _dewExec$a$3, module$1$2, _global$3$2, exports$a$3, _dewExec$9$3, _global$2$3, exports$9$3, _dewExec$8$3, exports$8$3, _dewExec$7$3, exports$7$3, _dewExec$6$3, module$c, _global$1$3, exports$6$3, _dewExec$5$3, exports$5$3, _dewExec$4$3, exports$4$3, _dewExec$3$3, exports$3$3, _dewExec$2$3, exports$2$3, _dewExec$1$3, _global$V, exports$1$3, _dewExec$2Q, exports$2R, exports$1j, _dewExec$1i, _global$j, exports$1i, _dewExec$1h, _global$i, exports$1h, _dewExec$1g, _primes, exports$1g, _dewExec$1f, _global$h, exports$1f, _dewExec$1e, exports$1e, _dewExec$1d, exports$1d, _dewExec$1c, exports$1c, _dewExec$1b, exports$1b, _dewExec$1a, exports$1a, _dewExec$19, exports$192, _dewExec$18, exports$182, _dewExec$17, exports$172, _dewExec$162, _global$g, exports$162, _dewExec$152, exports$152, _dewExec$142, _global$f, exports$142, _dewExec$132, exports$132, _dewExec$122, exports$122, _dewExec$11, exports$11, _dewExec$10, module$4, _global$e, exports$10, _dewExec$$, _package, exports$$, _dewExec$_, module$3, _global$d, exports$_, _dewExec$Z, exports$Z, _dewExec$Y, exports$Y, _dewExec$X, exports$X, _dewExec$W, exports$W, _dewExec$V, exports$V, _dewExec$U, exports$U, _dewExec$T, exports$T, _dewExec$S, exports$S, _dewExec$R, exports$R, _dewExec$Q, exports$Q, _dewExec$P, exports$P, _dewExec$O, exports$O, _dewExec$N, exports$N, _dewExec$M, exports$M, _dewExec$L, exports$L, _dewExec$K, exports$K, _dewExec$J, exports$J, _dewExec$I, exports$I, _dewExec$H, exports$H, _dewExec$G, exports$G, _dewExec$F, exports$F, _dewExec$E, exports$E, _dewExec$D, exports$D, _dewExec$C, exports$C, _dewExec$B, exports$B, _dewExec$A, exports$A, _dewExec$z, exports$z, _dewExec$y, exports$y, _dewExec$x, exports$x, _dewExec$w, module$2, _global$c, exports$w, _dewExec$v, _global$b, exports$v, _dewExec$u, _global$a, exports$u, _dewExec$t, _global$9, exports$t, _dewExec$s, _global$8, exports$s, _dewExec$r, exports$r, _dewExec$q, exports$q, _dewExec$p, exports$p, _dewExec$o, _global$7, exports$o, _dewExec$n, _global$6, exports$n, _dewExec$m, exports$m, _dewExec$l, _global$5, exports$l, _dewExec$k2, _global$4, exports$k2, _dewExec$j2, exports$j2, _dewExec$i2, exports$i2, _dewExec$h2, exports$h2, _dewExec$g3, _aesid, exports$g3, _dewExec$f3, exports$f3, _dewExec$e3, _curves, exports$e3, _dewExec$d3, exports$d3, _dewExec$c3, exports$c4, _dewExec$b4, exports$b4, _dewExec$a4, module$1, _global$3, exports$a4, _dewExec$94, _global$23, exports$94, _dewExec$84, exports$85, _dewExec$75, exports$75, _dewExec$65, module3, _global$110, exports$65, _dewExec$55, exports$55, _dewExec$45, exports$45, _dewExec$310, exports$310, _dewExec$210, exports$210, _dewExec$110, _global8, exports$111, _dewExec15, exports18, Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, Hash2, Hmac, Sign, Verify, constants2, createCipher, createCipheriv, createCredentials, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createSign, createVerify, getCiphers, getDiffieHellman, getHashes, listCiphers, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng, pseudoRandomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, rng, webcrypto, getRandomValues, randomUUID; +var init_crypto = __esm({ + "node_modules/@jspm/core/nodelibs/browser/crypto.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_CcCWfKp1(); + init_chunk_DEMDiNwt(); + init_chunk_CkFCi_G1(); + init_chunk_B6_G_Ftj(); + init_chunk_DtuTasat(); + init_chunk_B738Er4n(); + init_chunk_b0rmRow7(); + init_chunk_C4rKjYLo(); + init_chunk_tHuMsdT0(); + init_chunk_D3uu3VYh(); + init_chunk_DtDiafJB(); + init_chunk_CbQqNoLO(); + init_chunk_BsRZ0PEC(); + init_vm(); + exports$3H = {}; + _dewExec$3G = false; + _global$1e = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3G = {}; + _dewExec$3F = false; + exports$3F = {}; + _dewExec$3E = false; + exports$3E = {}; + _dewExec$3D = false; + exports$3D = {}; + _dewExec$3C = false; + _global$1d = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3C = {}; + _dewExec$3B = false; + _global$1c = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3B = {}; + _dewExec$3A = false; + _global$1b = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3A = {}; + _dewExec$3z = false; + _global$1a = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3z = {}; + _dewExec$3y = false; + _global$19 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3y = {}; + _dewExec$3x = false; + _global$18 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3x = {}; + _dewExec$3w = false; + _global$17 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3w = {}; + _dewExec$3v = false; + module$f = { + exports: exports$3w + }; + exports$3v = {}; + _dewExec$3u = false; + _global$16 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3u = {}; + _dewExec$3t = false; + exports$3t = {}; + _dewExec$3s = false; + exports$3s = {}; + _dewExec$3r = false; + exports$3r = {}; + _dewExec$3q = false; + _algorithms$2 = { + "sha224WithRSAEncryption": { + "sign": "rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "RSA-SHA224": { + "sign": "ecdsa/rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "sha256WithRSAEncryption": { + "sign": "rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "RSA-SHA256": { + "sign": "ecdsa/rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "sha384WithRSAEncryption": { + "sign": "rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "RSA-SHA384": { + "sign": "ecdsa/rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "sha512WithRSAEncryption": { + "sign": "rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA512": { + "sign": "ecdsa/rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA1": { + "sign": "rsa", + "hash": "sha1", + "id": "3021300906052b0e03021a05000414" + }, + "ecdsa-with-SHA1": { + "sign": "ecdsa", + "hash": "sha1", + "id": "" + }, + "sha256": { + "sign": "ecdsa", + "hash": "sha256", + "id": "" + }, + "sha224": { + "sign": "ecdsa", + "hash": "sha224", + "id": "" + }, + "sha384": { + "sign": "ecdsa", + "hash": "sha384", + "id": "" + }, + "sha512": { + "sign": "ecdsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-SHA1": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-WITH-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-WITH-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-WITH-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-WITH-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-RIPEMD160": { + "sign": "dsa", + "hash": "rmd160", + "id": "" + }, + "ripemd160WithRSA": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "RSA-RIPEMD160": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "md5WithRSAEncryption": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + }, + "RSA-MD5": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + } + }; + exports$3q = {}; + _dewExec$3p = false; + exports$3p = {}; + _dewExec$3o = false; + exports$3o = {}; + _dewExec$3n = false; + _global$15 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3n = {}; + _dewExec$3m = false; + exports$3m = {}; + _dewExec$3l = false; + _global$14 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3l = {}; + _dewExec$3k = false; + _global$13 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3k = {}; + _dewExec$3j = false; + exports$3j = {}; + _dewExec$3i = false; + exports$3i = {}; + _dewExec$3h = false; + exports$3h = {}; + _dewExec$3g = false; + exports$3g = {}; + _dewExec$3f = false; + exports$3f = {}; + _dewExec$3e = false; + exports$3e = {}; + _dewExec$3d = false; + exports$3d = {}; + _dewExec$3c = false; + exports$3c = {}; + _dewExec$3b = false; + _global$122 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$3b = {}; + _dewExec$3a = false; + exports$3a = {}; + _dewExec$39 = false; + exports$39 = {}; + _dewExec$38 = false; + exports$38 = {}; + _dewExec$37 = false; + exports$37 = {}; + _dewExec$36 = false; + exports$36 = {}; + _dewExec$35 = false; + exports$35 = {}; + _dewExec$342 = false; + exports$342 = {}; + _dewExec$332 = false; + exports$332 = {}; + _dewExec$322 = false; + _list$2 = { + "aes-128-ecb": { + "cipher": "AES", + "key": 128, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-192-ecb": { + "cipher": "AES", + "key": 192, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-256-ecb": { + "cipher": "AES", + "key": 256, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-128-cbc": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-192-cbc": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-256-cbc": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes128": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes192": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes256": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-128-cfb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-192-cfb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-256-cfb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-128-cfb8": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-192-cfb8": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-256-cfb8": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-128-cfb1": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-192-cfb1": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-256-cfb1": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-128-ofb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-192-ofb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-256-ofb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-128-ctr": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-192-ctr": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-256-ctr": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-128-gcm": { + "cipher": "AES", + "key": 128, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-192-gcm": { + "cipher": "AES", + "key": 192, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-256-gcm": { + "cipher": "AES", + "key": 256, + "iv": 12, + "mode": "GCM", + "type": "auth" + } + }; + exports$322 = {}; + _dewExec$31 = false; + exports$31 = {}; + _dewExec$30 = false; + _global$11 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$30 = {}; + _dewExec$2$ = false; + _global$10 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2$ = {}; + _dewExec$2_ = false; + _global$$ = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2_ = {}; + _dewExec$2Z = false; + _global$_ = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2Z = {}; + _dewExec$2Y = false; + exports$2Y = {}; + _dewExec$2X = false; + _global$Z = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2X = {}; + _dewExec$2W = false; + _global$Y = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2W = {}; + _dewExec$2V = false; + exports$2V = {}; + _dewExec$2U = false; + exports$2U = {}; + _dewExec$2T = false; + exports$2T = {}; + _dewExec$2S = false; + module$e = { + exports: exports$2T + }; + _global$X = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2S = {}; + _dewExec$2R = false; + module$d = { + exports: exports$2S + }; + _global$W = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2Q = {}; + _dewExec$2P = false; + exports$2P = {}; + _dewExec$2O = false; + _global$U = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2O = {}; + _dewExec$2N = false; + exports$2N = {}; + _dewExec$2M = false; + exports$2M = {}; + _dewExec$2L = false; + exports$2L = {}; + _dewExec$2K = false; + exports$2K = {}; + _dewExec$2J = false; + _global$T = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2J = {}; + _dewExec$2I = false; + _global$S = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2I = {}; + _dewExec$2H = false; + _global$R = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2H = {}; + _dewExec$2G = false; + _global$Q = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2G = {}; + _dewExec$2F = false; + _global$P = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2F = {}; + _dewExec$2E = false; + _global$O = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2E = {}; + _dewExec$2D = false; + _global$N = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2D = {}; + _dewExec$2C = false; + module$b = { + exports: exports$2D + }; + exports$f$2 = {}; + _dewExec$f$2 = false; + exports$e$2 = {}; + _dewExec$e$2 = false; + exports$d$2 = {}; + _dewExec$d$2 = false; + exports$c$2 = {}; + _dewExec$c$2 = false; + exports$b$2 = {}; + _dewExec$b$2 = false; + exports$a$2 = {}; + _dewExec$a$2 = false; + exports$9$2 = {}; + _dewExec$9$2 = false; + _global$2$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$8$2 = {}; + _dewExec$8$2 = false; + _global$1$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$7$2 = {}; + _dewExec$7$2 = false; + exports$6$2 = {}; + _dewExec$6$2 = false; + exports$5$2 = {}; + _dewExec$5$2 = false; + exports$4$2 = {}; + _dewExec$4$2 = false; + exports$3$2 = {}; + _dewExec$3$2 = false; + _global$M = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2$2 = {}; + _dewExec$2$2 = false; + exports$1$2 = {}; + _dewExec$1$2 = false; + exports$2C = {}; + _dewExec$2B = false; + exports$2B = {}; + _dewExec$2A = false; + _global$L = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + stream = dew$2A(); + stream.Readable; + stream.Writable; + stream.Duplex; + stream.Transform; + stream.PassThrough; + stream.finished; + stream.pipeline; + stream.Stream; + ({ + finished: promisify2(stream.finished), + pipeline: promisify2(stream.pipeline) + }); + exports$2A = {}; + _dewExec$2z = false; + _global$K = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2z = {}; + _dewExec$2y = false; + exports$2y = {}; + _dewExec$2x = false; + exports$2x = {}; + _dewExec$2w = false; + exports$2w = {}; + _dewExec$2v = false; + _algorithms$1 = { + "sha224WithRSAEncryption": { + "sign": "rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "RSA-SHA224": { + "sign": "ecdsa/rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "sha256WithRSAEncryption": { + "sign": "rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "RSA-SHA256": { + "sign": "ecdsa/rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "sha384WithRSAEncryption": { + "sign": "rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "RSA-SHA384": { + "sign": "ecdsa/rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "sha512WithRSAEncryption": { + "sign": "rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA512": { + "sign": "ecdsa/rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA1": { + "sign": "rsa", + "hash": "sha1", + "id": "3021300906052b0e03021a05000414" + }, + "ecdsa-with-SHA1": { + "sign": "ecdsa", + "hash": "sha1", + "id": "" + }, + "sha256": { + "sign": "ecdsa", + "hash": "sha256", + "id": "" + }, + "sha224": { + "sign": "ecdsa", + "hash": "sha224", + "id": "" + }, + "sha384": { + "sign": "ecdsa", + "hash": "sha384", + "id": "" + }, + "sha512": { + "sign": "ecdsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-SHA1": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-WITH-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-WITH-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-WITH-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-WITH-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-RIPEMD160": { + "sign": "dsa", + "hash": "rmd160", + "id": "" + }, + "ripemd160WithRSA": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "RSA-RIPEMD160": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "md5WithRSAEncryption": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + }, + "RSA-MD5": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + } + }; + exports$2v = {}; + _dewExec$2u = false; + exports$2u = {}; + _dewExec$2t = false; + exports$2t = {}; + _dewExec$2s = false; + _global$J = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2s = {}; + _dewExec$2r = false; + exports$2r = {}; + _dewExec$2q = false; + _global$I = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2q = {}; + _dewExec$2p = false; + _global$H = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2p = {}; + _dewExec$2o = false; + exports$2o = {}; + _dewExec$2n = false; + exports$2n = {}; + _dewExec$2m = false; + exports$2m = {}; + _dewExec$2l = false; + exports$2l = {}; + _dewExec$2k = false; + exports$2k = {}; + _dewExec$2j = false; + exports$2j = {}; + _dewExec$2i = false; + exports$2i = {}; + _dewExec$2h = false; + exports$2h = {}; + _dewExec$2g = false; + _global$G = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$2g = {}; + _dewExec$2f = false; + exports$2f = {}; + _dewExec$2e = false; + exports$2e = {}; + _dewExec$2d = false; + exports$2d = {}; + _dewExec$2c = false; + exports$2c = {}; + _dewExec$2b = false; + exports$2b = {}; + _dewExec$2a = false; + exports$2a = {}; + _dewExec$29 = false; + exports$29 = {}; + _dewExec$28 = false; + exports$28 = {}; + _dewExec$27 = false; + _list$1 = { + "aes-128-ecb": { + "cipher": "AES", + "key": 128, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-192-ecb": { + "cipher": "AES", + "key": 192, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-256-ecb": { + "cipher": "AES", + "key": 256, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-128-cbc": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-192-cbc": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-256-cbc": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes128": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes192": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes256": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-128-cfb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-192-cfb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-256-cfb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-128-cfb8": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-192-cfb8": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-256-cfb8": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-128-cfb1": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-192-cfb1": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-256-cfb1": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-128-ofb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-192-ofb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-256-ofb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-128-ctr": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-192-ctr": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-256-ctr": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-128-gcm": { + "cipher": "AES", + "key": 128, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-192-gcm": { + "cipher": "AES", + "key": 192, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-256-gcm": { + "cipher": "AES", + "key": 256, + "iv": 12, + "mode": "GCM", + "type": "auth" + } + }; + exports$27 = {}; + _dewExec$26 = false; + exports$262 = {}; + _dewExec$252 = false; + _global$F = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$252 = {}; + _dewExec$242 = false; + _global$E = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$242 = {}; + _dewExec$232 = false; + _global$D = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$232 = {}; + _dewExec$222 = false; + _global$C = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$222 = {}; + _dewExec$21 = false; + exports$21 = {}; + _dewExec$20 = false; + _global$B = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$20 = {}; + _dewExec$1$ = false; + _global$A = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1$ = {}; + _dewExec$1_ = false; + exports$1_ = {}; + _dewExec$1Z = false; + exports$1Z = {}; + _dewExec$1Y = false; + exports$1Y = {}; + _dewExec$1X = false; + module$a = { + exports: exports$1Y + }; + _global$z = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1X = {}; + _dewExec$1W = false; + module$9 = { + exports: exports$1X + }; + _global$y = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1W = {}; + _dewExec$1V = false; + exports$1U = {}; + _dewExec$1T = false; + exports$1T = {}; + _dewExec$1S = false; + _global$w = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1S = {}; + _dewExec$1R = false; + exports$1R = {}; + _dewExec$1Q = false; + exports$1Q = {}; + _dewExec$1P = false; + exports$1P = {}; + _dewExec$1O = false; + _global$v = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1O = {}; + _dewExec$1N = false; + _global$u = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1N = {}; + _dewExec$1M = false; + _global$t = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1M = {}; + _dewExec$1L = false; + _global$s = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1L = {}; + _dewExec$1K = false; + _global$r = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1K = {}; + _dewExec$1J = false; + _global$q = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1J = {}; + _dewExec$1I = false; + _global$p = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1I = {}; + _dewExec$1H = false; + module$7 = { + exports: exports$1I + }; + e$g = y.EventEmitter; + e$1$12 = {}; + t$c = {}; + n$q("ERR_INVALID_OPT_VALUE", function(e10, t8) { + return 'The value "' + t8 + '" is invalid for option "' + e10 + '"'; + }, TypeError), n$q("ERR_INVALID_ARG_TYPE", function(e10, t8, n7) { + let o7; + var E6; + let u7; + if ("string" == typeof t8 && (E6 = "not ", t8.substr(0, E6.length) === E6) ? (o7 = "must not be", t8 = t8.replace(/^not /, "")) : o7 = "must be", function(e11, t9, n8) { + return (void 0 === n8 || n8 > e11.length) && (n8 = e11.length), e11.substring(n8 - t9.length, n8) === t9; + }(e10, " argument")) + u7 = `The ${e10} ${o7} ${r$h(t8, "type")}`; + else { + u7 = `The "${e10}" ${function(e11, t9, n8) { + return "number" != typeof n8 && (n8 = 0), !(n8 + t9.length > e11.length) && -1 !== e11.indexOf(t9, n8); + }(e10, ".") ? "property" : "argument"} ${o7} ${r$h(t8, "type")}`; + } + return u7 += `. Received type ${typeof n7}`, u7; + }, TypeError), n$q("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), n$q("ERR_METHOD_NOT_IMPLEMENTED", function(e10) { + return "The " + e10 + " method is not implemented"; + }), n$q("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), n$q("ERR_STREAM_DESTROYED", function(e10) { + return "Cannot call " + e10 + " after a stream was destroyed"; + }), n$q("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), n$q("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), n$q("ERR_STREAM_WRITE_AFTER_END", "write after end"), n$q("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), n$q("ERR_UNKNOWN_ENCODING", function(e10) { + return "Unknown encoding: " + e10; + }, TypeError), n$q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), e$1$12.codes = t$c; + r$1$1 = function() { + throw new Error("Readable.from is not available in the browser"); + }; + r$2$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + t$1$1 = function(t8, n7) { + if (e$2$1("noDeprecation")) + return t8; + var o7 = false; + return function() { + if (!o7) { + if (e$2$1("throwDeprecation")) + throw new Error(n7); + e$2$1("traceDeprecation") ? console.trace(n7) : console.warn(n7), o7 = true; + } + return t8.apply(this || r$2$1, arguments); + }; + }; + c$n = e$1$1.Buffer; + b$j = X2.inspect; + p$s = b$j && b$j.custom || "inspect"; + g$h = function() { + function e10() { + !function(e11, t9) { + if (!(e11 instanceof t9)) + throw new TypeError("Cannot call a class as a function"); + }(this, e10), this.head = null, this.tail = null, this.length = 0; + } + var t8, n7; + return t8 = e10, (n7 = [{ key: "push", value: function(e11) { + var t9 = { data: e11, next: null }; + this.length > 0 ? this.tail.next = t9 : this.head = t9, this.tail = t9, ++this.length; + } }, { key: "unshift", value: function(e11) { + var t9 = { data: e11, next: this.head }; + 0 === this.length && (this.tail = t9), this.head = t9, ++this.length; + } }, { key: "shift", value: function() { + if (0 !== this.length) { + var e11 = this.head.data; + return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e11; + } + } }, { key: "clear", value: function() { + this.head = this.tail = null, this.length = 0; + } }, { key: "join", value: function(e11) { + if (0 === this.length) + return ""; + for (var t9 = this.head, n8 = "" + t9.data; t9 = t9.next; ) + n8 += e11 + t9.data; + return n8; + } }, { key: "concat", value: function(e11) { + if (0 === this.length) + return c$n.alloc(0); + for (var t9, n8, r8, i7 = c$n.allocUnsafe(e11 >>> 0), a7 = this.head, o7 = 0; a7; ) + t9 = a7.data, n8 = i7, r8 = o7, void c$n.prototype.copy.call(t9, n8, r8), o7 += a7.data.length, a7 = a7.next; + return i7; + } }, { key: "consume", value: function(e11, t9) { + var n8; + return e11 < this.head.data.length ? (n8 = this.head.data.slice(0, e11), this.head.data = this.head.data.slice(e11)) : n8 = e11 === this.head.data.length ? this.shift() : t9 ? this._getString(e11) : this._getBuffer(e11), n8; + } }, { key: "first", value: function() { + return this.head.data; + } }, { key: "_getString", value: function(e11) { + var t9 = this.head, n8 = 1, r8 = t9.data; + for (e11 -= r8.length; t9 = t9.next; ) { + var i7 = t9.data, a7 = e11 > i7.length ? i7.length : e11; + if (a7 === i7.length ? r8 += i7 : r8 += i7.slice(0, e11), 0 == (e11 -= a7)) { + a7 === i7.length ? (++n8, t9.next ? this.head = t9.next : this.head = this.tail = null) : (this.head = t9, t9.data = i7.slice(a7)); + break; + } + ++n8; + } + return this.length -= n8, r8; + } }, { key: "_getBuffer", value: function(e11) { + var t9 = c$n.allocUnsafe(e11), n8 = this.head, r8 = 1; + for (n8.data.copy(t9), e11 -= n8.data.length; n8 = n8.next; ) { + var i7 = n8.data, a7 = e11 > i7.length ? i7.length : e11; + if (i7.copy(t9, t9.length - e11, 0, a7), 0 == (e11 -= a7)) { + a7 === i7.length ? (++r8, n8.next ? this.head = n8.next : this.head = this.tail = null) : (this.head = n8, n8.data = i7.slice(a7)); + break; + } + ++r8; + } + return this.length -= r8, t9; + } }, { key: p$s, value: function(e11, t9) { + return b$j(this, function(e12) { + for (var t10 = 1; t10 < arguments.length; t10++) { + var n8 = null != arguments[t10] ? arguments[t10] : {}; + t10 % 2 ? u$p(Object(n8), true).forEach(function(t11) { + f$v(e12, t11, n8[t11]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e12, Object.getOwnPropertyDescriptors(n8)) : u$p(Object(n8)).forEach(function(t11) { + Object.defineProperty(e12, t11, Object.getOwnPropertyDescriptor(n8, t11)); + }); + } + return e12; + }({}, t9, { depth: 0, customInspect: false })); + } }]) && h$l(t8.prototype, n7), e10; + }(); + y$n = T$1; + m$m = { destroy: function(e10, t8) { + var n7 = this, r8 = this._readableState && this._readableState.destroyed, i7 = this._writableState && this._writableState.destroyed; + return r8 || i7 ? (t8 ? t8(e10) : e10 && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = true, y$n.nextTick(_$h, this, e10)) : y$n.nextTick(_$h, this, e10)), this) : (this._readableState && (this._readableState.destroyed = true), this._writableState && (this._writableState.destroyed = true), this._destroy(e10 || null, function(e11) { + !t8 && e11 ? n7._writableState ? n7._writableState.errorEmitted ? y$n.nextTick(v$k, n7) : (n7._writableState.errorEmitted = true, y$n.nextTick(w$j, n7, e11)) : y$n.nextTick(w$j, n7, e11) : t8 ? (y$n.nextTick(v$k, n7), t8(e11)) : y$n.nextTick(v$k, n7); + }), this); + }, undestroy: function() { + this._readableState && (this._readableState.destroyed = false, this._readableState.reading = false, this._readableState.ended = false, this._readableState.endEmitted = false), this._writableState && (this._writableState.destroyed = false, this._writableState.ended = false, this._writableState.ending = false, this._writableState.finalCalled = false, this._writableState.prefinished = false, this._writableState.finished = false, this._writableState.errorEmitted = false); + }, errorOrDestroy: function(e10, t8) { + var n7 = e10._readableState, r8 = e10._writableState; + n7 && n7.autoDestroy || r8 && r8.autoDestroy ? e10.destroy(t8) : e10.emit("error", t8); + } }; + S$e = e$1$12.codes.ERR_INVALID_OPT_VALUE; + R$7 = { getHighWaterMark: function(e10, t8, n7, r8) { + var i7 = function(e11, t9, n8) { + return null != e11.highWaterMark ? e11.highWaterMark : t9 ? e11[n8] : null; + }(t8, r8, n7); + if (null != i7) { + if (!isFinite(i7) || Math.floor(i7) !== i7 || i7 < 0) + throw new S$e(r8 ? n7 : "highWaterMark", i7); + return Math.floor(i7); + } + return e10.objectMode ? 16 : 16384; + } }; + k$g = e$1$12.codes.ERR_STREAM_PREMATURE_CLOSE; + j$a = function e5(t8, n7, r8) { + if ("function" == typeof n7) + return e5(t8, null, n7); + n7 || (n7 = {}), r8 = /* @__PURE__ */ function(e10) { + var t9 = false; + return function() { + if (!t9) { + t9 = true; + for (var n8 = arguments.length, r9 = new Array(n8), i8 = 0; i8 < n8; i8++) + r9[i8] = arguments[i8]; + e10.apply(this, r9); + } + }; + }(r8 || E$e); + var i7 = n7.readable || false !== n7.readable && t8.readable, a7 = n7.writable || false !== n7.writable && t8.writable, o7 = function() { + t8.writable || l7(); + }, s7 = t8._writableState && t8._writableState.finished, l7 = function() { + a7 = false, s7 = true, i7 || r8.call(t8); + }, d7 = t8._readableState && t8._readableState.endEmitted, u7 = function() { + i7 = false, d7 = true, a7 || r8.call(t8); + }, f8 = function(e10) { + r8.call(t8, e10); + }, h8 = function() { + var e10; + return i7 && !d7 ? (t8._readableState && t8._readableState.ended || (e10 = new k$g()), r8.call(t8, e10)) : a7 && !s7 ? (t8._writableState && t8._writableState.ended || (e10 = new k$g()), r8.call(t8, e10)) : void 0; + }, c7 = function() { + t8.req.on("finish", l7); + }; + return !function(e10) { + return e10.setHeader && "function" == typeof e10.abort; + }(t8) ? a7 && !t8._writableState && (t8.on("end", o7), t8.on("close", o7)) : (t8.on("complete", l7), t8.on("abort", h8), t8.req ? c7() : t8.on("request", c7)), t8.on("end", u7), t8.on("finish", l7), false !== n7.error && t8.on("error", f8), t8.on("close", h8), function() { + t8.removeListener("complete", l7), t8.removeListener("abort", h8), t8.removeListener("request", c7), t8.req && t8.req.removeListener("finish", l7), t8.removeListener("end", o7), t8.removeListener("close", o7), t8.removeListener("finish", l7), t8.removeListener("end", u7), t8.removeListener("error", f8), t8.removeListener("close", h8); + }; + }; + O$8 = T$1; + P$8 = j$a; + x$a = Symbol("lastResolve"); + L$8 = Symbol("lastReject"); + D$9 = Symbol("error"); + C$9 = Symbol("ended"); + A$c = Symbol("lastPromise"); + q$8 = Symbol("handlePromise"); + W$5 = Symbol("stream"); + U$a = Object.getPrototypeOf(function() { + }); + H$7 = Object.setPrototypeOf((T$8(M$a = { get stream() { + return this[W$5]; + }, next: function() { + var e10 = this, t8 = this[D$9]; + if (null !== t8) + return Promise.reject(t8); + if (this[C$9]) + return Promise.resolve(B$c(void 0, true)); + if (this[W$5].destroyed) + return new Promise(function(t9, n8) { + O$8.nextTick(function() { + e10[D$9] ? n8(e10[D$9]) : t9(B$c(void 0, true)); + }); + }); + var n7, r8 = this[A$c]; + if (r8) + n7 = new Promise(/* @__PURE__ */ function(e11, t9) { + return function(n8, r9) { + e11.then(function() { + if (t9[C$9]) + return n8(B$c(void 0, true)), void 0; + t9[q$8](n8, r9); + }, r9); + }; + }(r8, this)); + else { + var i7 = this[W$5].read(); + if (null !== i7) + return Promise.resolve(B$c(i7, false)); + n7 = new Promise(this[q$8]); + } + return this[A$c] = n7, n7; + } }, Symbol.asyncIterator, function() { + return this; + }), T$8(M$a, "return", function() { + var e10 = this; + return new Promise(function(t8, n7) { + e10[W$5].destroy(null, function(e11) { + if (e11) + return n7(e11), void 0; + t8(B$c(void 0, true)); + }); + }); + }), M$a), U$a); + F$8 = function(e10) { + var t8, n7 = Object.create(H$7, (T$8(t8 = {}, W$5, { value: e10, writable: true }), T$8(t8, x$a, { value: null, writable: true }), T$8(t8, L$8, { value: null, writable: true }), T$8(t8, D$9, { value: null, writable: true }), T$8(t8, C$9, { value: e10._readableState.endEmitted, writable: true }), T$8(t8, q$8, { value: function(e11, t9) { + var r8 = n7[W$5].read(); + r8 ? (n7[A$c] = null, n7[x$a] = null, n7[L$8] = null, e11(B$c(r8, false))) : (n7[x$a] = e11, n7[L$8] = t9); + }, writable: true }), t8)); + return n7[A$c] = null, P$8(e10, function(e11) { + if (e11 && "ERR_STREAM_PREMATURE_CLOSE" !== e11.code) { + var t9 = n7[L$8]; + return null !== t9 && (n7[A$c] = null, n7[x$a] = null, n7[L$8] = null, t9(e11)), n7[D$9] = e11, void 0; + } + var r8 = n7[x$a]; + null !== r8 && (n7[A$c] = null, n7[x$a] = null, n7[L$8] = null, r8(B$c(void 0, true))), n7[C$9] = true; + }), e10.on("readable", N$7.bind(null, n7)), n7; + }; + V$6 = {}; + G$5 = false; + Y$4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + z$9 = {}; + J$5 = false; + Q$4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + Z$3 = {}; + $$3 = false; + t$2$1 = K$8(); + r$3$1 = e$1$12.codes.ERR_STREAM_PREMATURE_CLOSE; + n$1$12 = function e6(n7, o7, a7) { + if ("function" == typeof o7) + return e6(n7, null, o7); + o7 || (o7 = {}), a7 = /* @__PURE__ */ function(e10) { + var r8 = false; + return function() { + if (!r8) { + r8 = true; + for (var t8 = arguments.length, n8 = new Array(t8), o8 = 0; o8 < t8; o8++) + n8[o8] = arguments[o8]; + e10.apply(this, n8); + } + }; + }(a7 || t$3$1); + var i7 = o7.readable || false !== o7.readable && n7.readable, l7 = o7.writable || false !== o7.writable && n7.writable, c7 = function() { + n7.writable || s7(); + }, f8 = n7._writableState && n7._writableState.finished, s7 = function() { + l7 = false, f8 = true, i7 || a7.call(n7); + }, u7 = n7._readableState && n7._readableState.endEmitted, d7 = function() { + i7 = false, u7 = true, l7 || a7.call(n7); + }, b8 = function(e10) { + a7.call(n7, e10); + }, v8 = function() { + var e10; + return i7 && !u7 ? (n7._readableState && n7._readableState.ended || (e10 = new r$3$1()), a7.call(n7, e10)) : l7 && !f8 ? (n7._writableState && n7._writableState.ended || (e10 = new r$3$1()), a7.call(n7, e10)) : void 0; + }, m7 = function() { + n7.req.on("finish", s7); + }; + return !function(e10) { + return e10.setHeader && "function" == typeof e10.abort; + }(n7) ? l7 && !n7._writableState && (n7.on("end", c7), n7.on("close", c7)) : (n7.on("complete", s7), n7.on("abort", v8), n7.req ? m7() : n7.on("request", m7)), n7.on("end", d7), n7.on("finish", s7), false !== o7.error && n7.on("error", b8), n7.on("close", v8), function() { + n7.removeListener("complete", s7), n7.removeListener("abort", v8), n7.removeListener("request", m7), n7.req && n7.req.removeListener("finish", s7), n7.removeListener("end", c7), n7.removeListener("close", c7), n7.removeListener("finish", s7), n7.removeListener("end", d7), n7.removeListener("error", b8), n7.removeListener("close", v8); + }; + }; + b$1$1 = e$1$1.Buffer; + p$1$1 = X2.inspect; + g$1$1 = p$1$1 && p$1$1.custom || "inspect"; + y$1$1 = function() { + function e10() { + !function(e11, t9) { + if (!(e11 instanceof t9)) + throw new TypeError("Cannot call a class as a function"); + }(this, e10), this.head = null, this.tail = null, this.length = 0; + } + var t8, n7; + return t8 = e10, (n7 = [{ key: "push", value: function(e11) { + var t9 = { data: e11, next: null }; + this.length > 0 ? this.tail.next = t9 : this.head = t9, this.tail = t9, ++this.length; + } }, { key: "unshift", value: function(e11) { + var t9 = { data: e11, next: this.head }; + 0 === this.length && (this.tail = t9), this.head = t9, ++this.length; + } }, { key: "shift", value: function() { + if (0 !== this.length) { + var e11 = this.head.data; + return 1 === this.length ? this.head = this.tail = null : this.head = this.head.next, --this.length, e11; + } + } }, { key: "clear", value: function() { + this.head = this.tail = null, this.length = 0; + } }, { key: "join", value: function(e11) { + if (0 === this.length) + return ""; + for (var t9 = this.head, n8 = "" + t9.data; t9 = t9.next; ) + n8 += e11 + t9.data; + return n8; + } }, { key: "concat", value: function(e11) { + if (0 === this.length) + return b$1$1.alloc(0); + for (var t9, n8, r8, i7 = b$1$1.allocUnsafe(e11 >>> 0), a7 = this.head, o7 = 0; a7; ) + t9 = a7.data, n8 = i7, r8 = o7, void b$1$1.prototype.copy.call(t9, n8, r8), o7 += a7.data.length, a7 = a7.next; + return i7; + } }, { key: "consume", value: function(e11, t9) { + var n8; + return e11 < this.head.data.length ? (n8 = this.head.data.slice(0, e11), this.head.data = this.head.data.slice(e11)) : n8 = e11 === this.head.data.length ? this.shift() : t9 ? this._getString(e11) : this._getBuffer(e11), n8; + } }, { key: "first", value: function() { + return this.head.data; + } }, { key: "_getString", value: function(e11) { + var t9 = this.head, n8 = 1, r8 = t9.data; + for (e11 -= r8.length; t9 = t9.next; ) { + var i7 = t9.data, a7 = e11 > i7.length ? i7.length : e11; + if (a7 === i7.length ? r8 += i7 : r8 += i7.slice(0, e11), 0 == (e11 -= a7)) { + a7 === i7.length ? (++n8, t9.next ? this.head = t9.next : this.head = this.tail = null) : (this.head = t9, t9.data = i7.slice(a7)); + break; + } + ++n8; + } + return this.length -= n8, r8; + } }, { key: "_getBuffer", value: function(e11) { + var t9 = b$1$1.allocUnsafe(e11), n8 = this.head, r8 = 1; + for (n8.data.copy(t9), e11 -= n8.data.length; n8 = n8.next; ) { + var i7 = n8.data, a7 = e11 > i7.length ? i7.length : e11; + if (i7.copy(t9, t9.length - e11, 0, a7), 0 == (e11 -= a7)) { + a7 === i7.length ? (++r8, n8.next ? this.head = n8.next : this.head = this.tail = null) : (this.head = n8, n8.data = i7.slice(a7)); + break; + } + ++r8; + } + return this.length -= r8, t9; + } }, { key: g$1$1, value: function(e11, t9) { + return p$1$1(this, function(e12) { + for (var t10 = 1; t10 < arguments.length; t10++) { + var n8 = null != arguments[t10] ? arguments[t10] : {}; + t10 % 2 ? f$1$1(Object(n8), true).forEach(function(t11) { + h$1$12(e12, t11, n8[t11]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e12, Object.getOwnPropertyDescriptors(n8)) : f$1$1(Object(n8)).forEach(function(t11) { + Object.defineProperty(e12, t11, Object.getOwnPropertyDescriptor(n8, t11)); + }); + } + return e12; + }({}, t9, { depth: 0, customInspect: false })); + } }]) && c$1$12(t8.prototype, n7), e10; + }(); + w$1$1 = T$1; + S$1$1 = { destroy: function(e10, t8) { + var n7 = this, r8 = this._readableState && this._readableState.destroyed, i7 = this._writableState && this._writableState.destroyed; + return r8 || i7 ? (t8 ? t8(e10) : e10 && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = true, w$1$1.nextTick(m$1$1, this, e10)) : w$1$1.nextTick(m$1$1, this, e10)), this) : (this._readableState && (this._readableState.destroyed = true), this._writableState && (this._writableState.destroyed = true), this._destroy(e10 || null, function(e11) { + !t8 && e11 ? n7._writableState ? n7._writableState.errorEmitted ? w$1$1.nextTick(v$1$1, n7) : (n7._writableState.errorEmitted = true, w$1$1.nextTick(_$1$1, n7, e11)) : w$1$1.nextTick(_$1$1, n7, e11) : t8 ? (w$1$1.nextTick(v$1$1, n7), t8(e11)) : w$1$1.nextTick(v$1$1, n7); + }), this); + }, undestroy: function() { + this._readableState && (this._readableState.destroyed = false, this._readableState.reading = false, this._readableState.ended = false, this._readableState.endEmitted = false), this._writableState && (this._writableState.destroyed = false, this._writableState.ended = false, this._writableState.ending = false, this._writableState.finalCalled = false, this._writableState.prefinished = false, this._writableState.finished = false, this._writableState.errorEmitted = false); + }, errorOrDestroy: function(e10, t8) { + var n7 = e10._readableState, r8 = e10._writableState; + n7 && n7.autoDestroy || r8 && r8.autoDestroy ? e10.destroy(t8) : e10.emit("error", t8); + } }; + R$1$1 = e$1$12.codes.ERR_INVALID_OPT_VALUE; + E$1$1 = { getHighWaterMark: function(e10, t8, n7, r8) { + var i7 = function(e11, t9, n8) { + return null != e11.highWaterMark ? e11.highWaterMark : t9 ? e11[n8] : null; + }(t8, r8, n7); + if (null != i7) { + if (!isFinite(i7) || Math.floor(i7) !== i7 || i7 < 0) + throw new R$1$1(r8 ? n7 : "highWaterMark", i7); + return Math.floor(i7); + } + return e10.objectMode ? 16 : 16384; + } }; + M$1$1 = T$1; + O$1$1 = n$1$12; + T$1$1 = Symbol("lastResolve"); + x$1$1 = Symbol("lastReject"); + P$1$1 = Symbol("error"); + D$1$1 = Symbol("ended"); + L$1$1 = Symbol("lastPromise"); + C$1$1 = Symbol("handlePromise"); + A$1$1 = Symbol("stream"); + I$1$1 = Object.getPrototypeOf(function() { + }); + N$1$1 = Object.setPrototypeOf((j$1$1(k$1$1 = { get stream() { + return this[A$1$1]; + }, next: function() { + var e10 = this, t8 = this[P$1$1]; + if (null !== t8) + return Promise.reject(t8); + if (this[D$1$1]) + return Promise.resolve(W$1$1(void 0, true)); + if (this[A$1$1].destroyed) + return new Promise(function(t9, n8) { + M$1$1.nextTick(function() { + e10[P$1$1] ? n8(e10[P$1$1]) : t9(W$1$1(void 0, true)); + }); + }); + var n7, r8 = this[L$1$1]; + if (r8) + n7 = new Promise(/* @__PURE__ */ function(e11, t9) { + return function(n8, r9) { + e11.then(function() { + if (t9[D$1$1]) + return n8(W$1$1(void 0, true)), void 0; + t9[C$1$1](n8, r9); + }, r9); + }; + }(r8, this)); + else { + var i7 = this[A$1$1].read(); + if (null !== i7) + return Promise.resolve(W$1$1(i7, false)); + n7 = new Promise(this[C$1$1]); + } + return this[L$1$1] = n7, n7; + } }, Symbol.asyncIterator, function() { + return this; + }), j$1$1(k$1$1, "return", function() { + var e10 = this; + return new Promise(function(t8, n7) { + e10[A$1$1].destroy(null, function(e11) { + if (e11) + return n7(e11), void 0; + t8(W$1$1(void 0, true)); + }); + }); + }), k$1$1), I$1$1); + U$1$1 = function(e10) { + var t8, n7 = Object.create(N$1$1, (j$1$1(t8 = {}, A$1$1, { value: e10, writable: true }), j$1$1(t8, T$1$1, { value: null, writable: true }), j$1$1(t8, x$1$1, { value: null, writable: true }), j$1$1(t8, P$1$1, { value: null, writable: true }), j$1$1(t8, D$1$1, { value: e10._readableState.endEmitted, writable: true }), j$1$1(t8, C$1$1, { value: function(e11, t9) { + var r8 = n7[A$1$1].read(); + r8 ? (n7[L$1$1] = null, n7[T$1$1] = null, n7[x$1$1] = null, e11(W$1$1(r8, false))) : (n7[T$1$1] = e11, n7[x$1$1] = t9); + }, writable: true }), t8)); + return n7[L$1$1] = null, O$1$1(e10, function(e11) { + if (e11 && "ERR_STREAM_PREMATURE_CLOSE" !== e11.code) { + var t9 = n7[x$1$1]; + return null !== t9 && (n7[L$1$1] = null, n7[T$1$1] = null, n7[x$1$1] = null, t9(e11)), n7[P$1$1] = e11, void 0; + } + var r8 = n7[T$1$1]; + null !== r8 && (n7[L$1$1] = null, n7[T$1$1] = null, n7[x$1$1] = null, r8(W$1$1(void 0, true))), n7[D$1$1] = true; + }), e10.on("readable", q$1$1.bind(null, n7)), n7; + }; + H$1$1 = {}; + F$1$1 = false; + V$1$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + Y$1$1 = {}; + K$1$1 = false; + z$1$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + Q$1$1 = {}; + X$1$1 = false; + t$4$1 = J$1$1(); + t$5$1 = ee$1(); + n$2$1 = u$1$12; + i$e = e$1$12.codes; + a$p = i$e.ERR_METHOD_NOT_IMPLEMENTED; + o$s = i$e.ERR_MULTIPLE_CALLBACK; + s$q = i$e.ERR_TRANSFORM_ALREADY_TRANSFORMING; + f$2$1 = i$e.ERR_TRANSFORM_WITH_LENGTH_0; + h$2$1 = t$5$1; + t$2(u$1$12, h$2$1), u$1$12.prototype.push = function(t8, r8) { + return this._transformState.needTransform = false, h$2$1.prototype.push.call(this, t8, r8); + }, u$1$12.prototype._transform = function(t8, r8, e10) { + e10(new a$p("_transform()")); + }, u$1$12.prototype._write = function(t8, r8, e10) { + var n7 = this._transformState; + if (n7.writecb = e10, n7.writechunk = t8, n7.writeencoding = r8, !n7.transforming) { + var i7 = this._readableState; + (n7.needTransform || i7.needReadable || i7.length < i7.highWaterMark) && this._read(i7.highWaterMark); + } + }, u$1$12.prototype._read = function(t8) { + var r8 = this._transformState; + null === r8.writechunk || r8.transforming ? r8.needTransform = true : (r8.transforming = true, this._transform(r8.writechunk, r8.writeencoding, r8.afterTransform)); + }, u$1$12.prototype._destroy = function(t8, r8) { + h$2$1.prototype._destroy.call(this, t8, function(t9) { + r8(t9); + }); + }; + p$2$1 = n$2$1; + o$1$12 = i$1$1; + e$3$1 = p$2$1; + t$2(i$1$1, e$3$1), i$1$1.prototype._transform = function(r8, t8, o7) { + o7(null, r8); + }; + s$1$1 = o$1$12; + o$2$1 = e$1$12.codes; + e$4$1 = o$2$1.ERR_MISSING_ARGS; + f$3$1 = o$2$1.ERR_STREAM_DESTROYED; + v$2$1 = function() { + for (var r8 = arguments.length, n7 = new Array(r8), t8 = 0; t8 < r8; t8++) + n7[t8] = arguments[t8]; + var o7, f8 = p$3$1(n7); + if (Array.isArray(n7[0]) && (n7 = n7[0]), n7.length < 2) + throw new e$4$1("streams"); + var i7 = n7.map(function(r9, t9) { + var e10 = t9 < n7.length - 1; + return u$2$1(r9, e10, t9 > 0, function(r10) { + o7 || (o7 = r10), r10 && i7.forEach(a$1$12), e10 || (i7.forEach(a$1$12), f8(o7)); + }); + }); + return n7.reduce(c$2$1); + }; + d$n = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + l$r = p$r; + f$u = y.EventEmitter; + t$2(p$r, f$u), p$r.Readable = t$2$1, p$r.Writable = t$4$1, p$r.Duplex = t$5$1, p$r.Transform = p$2$1, p$r.PassThrough = s$1$1, p$r.finished = n$1$12, p$r.pipeline = v$2$1, p$r.Stream = p$r, p$r.prototype.pipe = function(e10, r8) { + var t8 = this || d$n; + function o7(r9) { + e10.writable && false === e10.write(r9) && t8.pause && t8.pause(); + } + function i7() { + t8.readable && t8.resume && t8.resume(); + } + t8.on("data", o7), e10.on("drain", i7), e10._isStdio || r8 && false === r8.end || (t8.on("end", a7), t8.on("close", s7)); + var n7 = false; + function a7() { + n7 || (n7 = true, e10.end()); + } + function s7() { + n7 || (n7 = true, "function" == typeof e10.destroy && e10.destroy()); + } + function m7(e11) { + if (l7(), 0 === f$u.listenerCount(this || d$n, "error")) + throw e11; + } + function l7() { + t8.removeListener("data", o7), e10.removeListener("drain", i7), t8.removeListener("end", a7), t8.removeListener("close", s7), t8.removeListener("error", m7), e10.removeListener("error", m7), t8.removeListener("end", l7), t8.removeListener("close", l7), e10.removeListener("close", l7); + } + return t8.on("error", m7), e10.on("error", m7), t8.on("end", l7), t8.on("close", l7), e10.on("close", l7), e10.emit("pipe", t8), e10; + }; + b$i = l$r; + b$i.Readable; + b$i.Writable; + b$i.Duplex; + b$i.Transform; + b$i.PassThrough; + b$i.finished; + b$i.pipeline; + b$i.Stream; + exports$1H = {}; + _dewExec$1G = false; + _global$o = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1G = {}; + _dewExec$1F = false; + exports$1F = {}; + _dewExec$1E = false; + exports$1E = {}; + _dewExec$1D = false; + exports$1D = {}; + _dewExec$1C = false; + _algorithms = { + "sha224WithRSAEncryption": { + "sign": "rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "RSA-SHA224": { + "sign": "ecdsa/rsa", + "hash": "sha224", + "id": "302d300d06096086480165030402040500041c" + }, + "sha256WithRSAEncryption": { + "sign": "rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "RSA-SHA256": { + "sign": "ecdsa/rsa", + "hash": "sha256", + "id": "3031300d060960864801650304020105000420" + }, + "sha384WithRSAEncryption": { + "sign": "rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "RSA-SHA384": { + "sign": "ecdsa/rsa", + "hash": "sha384", + "id": "3041300d060960864801650304020205000430" + }, + "sha512WithRSAEncryption": { + "sign": "rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA512": { + "sign": "ecdsa/rsa", + "hash": "sha512", + "id": "3051300d060960864801650304020305000440" + }, + "RSA-SHA1": { + "sign": "rsa", + "hash": "sha1", + "id": "3021300906052b0e03021a05000414" + }, + "ecdsa-with-SHA1": { + "sign": "ecdsa", + "hash": "sha1", + "id": "" + }, + "sha256": { + "sign": "ecdsa", + "hash": "sha256", + "id": "" + }, + "sha224": { + "sign": "ecdsa", + "hash": "sha224", + "id": "" + }, + "sha384": { + "sign": "ecdsa", + "hash": "sha384", + "id": "" + }, + "sha512": { + "sign": "ecdsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-SHA1": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA": { + "sign": "dsa", + "hash": "sha1", + "id": "" + }, + "DSA-WITH-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-SHA224": { + "sign": "dsa", + "hash": "sha224", + "id": "" + }, + "DSA-WITH-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-SHA256": { + "sign": "dsa", + "hash": "sha256", + "id": "" + }, + "DSA-WITH-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-SHA384": { + "sign": "dsa", + "hash": "sha384", + "id": "" + }, + "DSA-WITH-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-SHA512": { + "sign": "dsa", + "hash": "sha512", + "id": "" + }, + "DSA-RIPEMD160": { + "sign": "dsa", + "hash": "rmd160", + "id": "" + }, + "ripemd160WithRSA": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "RSA-RIPEMD160": { + "sign": "rsa", + "hash": "rmd160", + "id": "3021300906052b2403020105000414" + }, + "md5WithRSAEncryption": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + }, + "RSA-MD5": { + "sign": "rsa", + "hash": "md5", + "id": "3020300c06082a864886f70d020505000410" + } + }; + exports$1C = {}; + _dewExec$1B = false; + exports$1B = {}; + _dewExec$1A = false; + exports$1A = {}; + _dewExec$1z = false; + _global$n = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1z = {}; + _dewExec$1y = false; + exports$1y = {}; + _dewExec$1x = false; + _global$m = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1x = {}; + _dewExec$1w = false; + _global$l = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1w = {}; + _dewExec$1v = false; + exports$1v = {}; + _dewExec$1u = false; + exports$1u = {}; + _dewExec$1t = false; + exports$1t = {}; + _dewExec$1s = false; + exports$1s = {}; + _dewExec$1r = false; + exports$1r = {}; + _dewExec$1q = false; + exports$1q = {}; + _dewExec$1p = false; + exports$1p = {}; + _dewExec$1o = false; + exports$1o = {}; + _dewExec$1n = false; + _global$k = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1n = {}; + _dewExec$1m = false; + exports$1m = {}; + _dewExec$1l = false; + exports$1l = {}; + _dewExec$1k = false; + exports$1k = {}; + _dewExec$1j = false; + exports$1j$1 = {}; + _dewExec$1i$1 = false; + exports$1i$1 = {}; + _dewExec$1h$1 = false; + exports$1h$1 = {}; + _dewExec$1g$1 = false; + exports$1g$1 = {}; + _dewExec$1f$1 = false; + exports$1f$1 = {}; + _dewExec$1e$1 = false; + _list = { + "aes-128-ecb": { + "cipher": "AES", + "key": 128, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-192-ecb": { + "cipher": "AES", + "key": 192, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-256-ecb": { + "cipher": "AES", + "key": 256, + "iv": 0, + "mode": "ECB", + "type": "block" + }, + "aes-128-cbc": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-192-cbc": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-256-cbc": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes128": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes192": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes256": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CBC", + "type": "block" + }, + "aes-128-cfb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-192-cfb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-256-cfb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB", + "type": "stream" + }, + "aes-128-cfb8": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-192-cfb8": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-256-cfb8": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB8", + "type": "stream" + }, + "aes-128-cfb1": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-192-cfb1": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-256-cfb1": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CFB1", + "type": "stream" + }, + "aes-128-ofb": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-192-ofb": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-256-ofb": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "OFB", + "type": "stream" + }, + "aes-128-ctr": { + "cipher": "AES", + "key": 128, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-192-ctr": { + "cipher": "AES", + "key": 192, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-256-ctr": { + "cipher": "AES", + "key": 256, + "iv": 16, + "mode": "CTR", + "type": "stream" + }, + "aes-128-gcm": { + "cipher": "AES", + "key": 128, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-192-gcm": { + "cipher": "AES", + "key": 192, + "iv": 12, + "mode": "GCM", + "type": "auth" + }, + "aes-256-gcm": { + "cipher": "AES", + "key": 256, + "iv": 12, + "mode": "GCM", + "type": "auth" + } + }; + exports$1e$1 = {}; + _dewExec$1d$1 = false; + exports$1d$1 = {}; + _dewExec$1c$1 = false; + _global$j$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1c$1 = {}; + _dewExec$1b$1 = false; + _global$i$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1b$1 = {}; + _dewExec$1a$1 = false; + _global$h$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1a$1 = {}; + _dewExec$19$1 = false; + _global$g$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$19$1 = {}; + _dewExec$18$1 = false; + exports$18$1 = {}; + _dewExec$17$1 = false; + _global$f$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$17$1 = {}; + _dewExec$16$1 = false; + _global$e$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$16$1 = {}; + _dewExec$15$1 = false; + exports$15$1 = {}; + _dewExec$14$1 = false; + exports$14$1 = {}; + _dewExec$13$1 = false; + exports$13$1 = {}; + _dewExec$12$1 = false; + module$6 = { + exports: exports$13$1 + }; + _global$d$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$12$1 = {}; + _dewExec$11$1 = false; + module$5 = { + exports: exports$12$1 + }; + _global$c$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + _global$b$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + exports$11$1 = {}; + indexOf3 = function(e10, t8) { + if (e10.indexOf) + return e10.indexOf(t8); + for (var n7 = 0; n7 < e10.length; n7++) + if (e10[n7] === t8) + return n7; + return -1; + }; + Object_keys2 = function(e10) { + if (Object.keys) + return Object.keys(e10); + var t8 = []; + for (var n7 in e10) + t8.push(n7); + return t8; + }; + forEach3 = function(e10, t8) { + if (e10.forEach) + return e10.forEach(t8); + for (var n7 = 0; n7 < e10.length; n7++) + t8(e10[n7], n7, e10); + }; + defineProp2 = function() { + try { + return Object.defineProperty({}, "_", {}), function(e10, t8, n7) { + Object.defineProperty(e10, t8, { writable: true, enumerable: false, configurable: true, value: n7 }); + }; + } catch (e10) { + return function(e11, t8, n7) { + e11[t8] = n7; + }; + } + }(); + globals2 = ["Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape"]; + Context2.prototype = {}; + Script6 = exports$11$1.Script = function(e10) { + if (!((this || _global$b$1) instanceof Script6)) + return new Script6(e10); + (this || _global$b$1).code = e10; + }; + Script6.prototype.runInContext = function(e10) { + if (!(e10 instanceof Context2)) + throw new TypeError("needs a 'context' argument."); + var t8 = document.createElement("iframe"); + t8.style || (t8.style = {}), t8.style.display = "none", document.body.appendChild(t8); + var n7 = t8.contentWindow, r8 = n7.eval, o7 = n7.execScript; + !r8 && o7 && (o7.call(n7, "null"), r8 = n7.eval), forEach3(Object_keys2(e10), function(t9) { + n7[t9] = e10[t9]; + }), forEach3(globals2, function(t9) { + e10[t9] && (n7[t9] = e10[t9]); + }); + var c7 = Object_keys2(n7), i7 = r8.call(n7, (this || _global$b$1).code); + return forEach3(Object_keys2(n7), function(t9) { + (t9 in e10 || -1 === indexOf3(c7, t9)) && (e10[t9] = n7[t9]); + }), forEach3(globals2, function(t9) { + t9 in e10 || defineProp2(e10, t9, n7[t9]); + }), document.body.removeChild(t8), i7; + }, Script6.prototype.runInThisContext = function() { + return eval((this || _global$b$1).code); + }, Script6.prototype.runInNewContext = function(e10) { + var t8 = Script6.createContext(e10), n7 = this.runInContext(t8); + return e10 && forEach3(Object_keys2(t8), function(n8) { + e10[n8] = t8[n8]; + }), n7; + }, forEach3(Object_keys2(Script6.prototype), function(e10) { + exports$11$1[e10] = Script6[e10] = function(t8) { + var n7 = Script6(t8); + return n7[e10].apply(n7, [].slice.call(arguments, 1)); + }; + }), exports$11$1.isContext = function(e10) { + return e10 instanceof Context2; + }, exports$11$1.createScript = function(e10) { + return exports$11$1.Script(e10); + }, exports$11$1.createContext = Script6.createContext = function(e10) { + var t8 = new Context2(); + return "object" == typeof e10 && forEach3(Object_keys2(e10), function(n7) { + t8[n7] = e10[n7]; + }), t8; + }; + exports$11$1.Script; + exports$11$1.createContext; + exports$11$1.createScript; + exports$11$1.isContext; + exports$11$1.runInContext; + exports$11$1.runInNewContext; + exports$11$1.runInThisContext; + o5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + n5 = T$1; + t5 = u4.Buffer; + f5 = o5.crypto || o5.msCrypto; + a5 = f5 && f5.getRandomValues ? function(e10, r8) { + if (e10 > 4294967295) + throw new RangeError("requested too many random bytes"); + var o7 = t5.allocUnsafe(e10); + if (e10 > 0) + if (e10 > 65536) + for (var a7 = 0; a7 < e10; a7 += 65536) + f5.getRandomValues(o7.slice(a7, a7 + 65536)); + else + f5.getRandomValues(o7); + if ("function" == typeof r8) + return n5.nextTick(function() { + r8(null, o7); + }); + return o7; + } : function() { + throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11"); + }; + e7 = u4.Buffer; + o$13 = b$i.Transform; + t$2(s5, o$13), s5.prototype._transform = function(t8, i7, r8) { + var e10 = null; + try { + this.update(t8, i7); + } catch (t9) { + e10 = t9; + } + r8(e10); + }, s5.prototype._flush = function(t8) { + var i7 = null; + try { + this.push(this.digest()); + } catch (t9) { + i7 = t9; + } + t8(i7); + }, s5.prototype.update = function(t8, i7) { + if (!function(t9, i8) { + if (!e7.isBuffer(t9) && "string" != typeof t9) + throw new TypeError(i8 + " must be a string or a buffer"); + }(t8, "Data"), this._finalized) + throw new Error("Digest already called"); + e7.isBuffer(t8) || (t8 = e7.from(t8, i7)); + for (var r8 = this._block, o7 = 0; this._blockOffset + t8.length - o7 >= this._blockSize; ) { + for (var s7 = this._blockOffset; s7 < this._blockSize; ) + r8[s7++] = t8[o7++]; + this._update(), this._blockOffset = 0; + } + for (; o7 < t8.length; ) + r8[this._blockOffset++] = t8[o7++]; + for (var f8 = 0, n7 = 8 * t8.length; n7 > 0; ++f8) + this._length[f8] += n7, (n7 = this._length[f8] / 4294967296 | 0) > 0 && (this._length[f8] -= 4294967296 * n7); + return this; + }, s5.prototype._update = function() { + throw new Error("_update is not implemented"); + }, s5.prototype.digest = function(t8) { + if (this._finalized) + throw new Error("Digest already called"); + this._finalized = true; + var i7 = this._digest(); + void 0 !== t8 && (i7 = i7.toString(t8)), this._block.fill(0), this._blockOffset = 0; + for (var r8 = 0; r8 < 4; ++r8) + this._length[r8] = 0; + return i7; + }, s5.prototype._digest = function() { + throw new Error("_digest is not implemented"); + }; + f$13 = s5; + h5 = t$2; + r5 = f$13; + _4 = u4.Buffer; + e$13 = new Array(16); + h5(n$13, r5), n$13.prototype._update = function() { + for (var t8 = e$13, i7 = 0; i7 < 16; ++i7) + t8[i7] = this._block.readInt32LE(4 * i7); + var s7 = this._a, h8 = this._b, r8 = this._c, _6 = this._d; + s7 = f$22(s7, h8, r8, _6, t8[0], 3614090360, 7), _6 = f$22(_6, s7, h8, r8, t8[1], 3905402710, 12), r8 = f$22(r8, _6, s7, h8, t8[2], 606105819, 17), h8 = f$22(h8, r8, _6, s7, t8[3], 3250441966, 22), s7 = f$22(s7, h8, r8, _6, t8[4], 4118548399, 7), _6 = f$22(_6, s7, h8, r8, t8[5], 1200080426, 12), r8 = f$22(r8, _6, s7, h8, t8[6], 2821735955, 17), h8 = f$22(h8, r8, _6, s7, t8[7], 4249261313, 22), s7 = f$22(s7, h8, r8, _6, t8[8], 1770035416, 7), _6 = f$22(_6, s7, h8, r8, t8[9], 2336552879, 12), r8 = f$22(r8, _6, s7, h8, t8[10], 4294925233, 17), h8 = f$22(h8, r8, _6, s7, t8[11], 2304563134, 22), s7 = f$22(s7, h8, r8, _6, t8[12], 1804603682, 7), _6 = f$22(_6, s7, h8, r8, t8[13], 4254626195, 12), r8 = f$22(r8, _6, s7, h8, t8[14], 2792965006, 17), s7 = c5(s7, h8 = f$22(h8, r8, _6, s7, t8[15], 1236535329, 22), r8, _6, t8[1], 4129170786, 5), _6 = c5(_6, s7, h8, r8, t8[6], 3225465664, 9), r8 = c5(r8, _6, s7, h8, t8[11], 643717713, 14), h8 = c5(h8, r8, _6, s7, t8[0], 3921069994, 20), s7 = c5(s7, h8, r8, _6, t8[5], 3593408605, 5), _6 = c5(_6, s7, h8, r8, t8[10], 38016083, 9), r8 = c5(r8, _6, s7, h8, t8[15], 3634488961, 14), h8 = c5(h8, r8, _6, s7, t8[4], 3889429448, 20), s7 = c5(s7, h8, r8, _6, t8[9], 568446438, 5), _6 = c5(_6, s7, h8, r8, t8[14], 3275163606, 9), r8 = c5(r8, _6, s7, h8, t8[3], 4107603335, 14), h8 = c5(h8, r8, _6, s7, t8[8], 1163531501, 20), s7 = c5(s7, h8, r8, _6, t8[13], 2850285829, 5), _6 = c5(_6, s7, h8, r8, t8[2], 4243563512, 9), r8 = c5(r8, _6, s7, h8, t8[7], 1735328473, 14), s7 = a$12(s7, h8 = c5(h8, r8, _6, s7, t8[12], 2368359562, 20), r8, _6, t8[5], 4294588738, 4), _6 = a$12(_6, s7, h8, r8, t8[8], 2272392833, 11), r8 = a$12(r8, _6, s7, h8, t8[11], 1839030562, 16), h8 = a$12(h8, r8, _6, s7, t8[14], 4259657740, 23), s7 = a$12(s7, h8, r8, _6, t8[1], 2763975236, 4), _6 = a$12(_6, s7, h8, r8, t8[4], 1272893353, 11), r8 = a$12(r8, _6, s7, h8, t8[7], 4139469664, 16), h8 = a$12(h8, r8, _6, s7, t8[10], 3200236656, 23), s7 = a$12(s7, h8, r8, _6, t8[13], 681279174, 4), _6 = a$12(_6, s7, h8, r8, t8[0], 3936430074, 11), r8 = a$12(r8, _6, s7, h8, t8[3], 3572445317, 16), h8 = a$12(h8, r8, _6, s7, t8[6], 76029189, 23), s7 = a$12(s7, h8, r8, _6, t8[9], 3654602809, 4), _6 = a$12(_6, s7, h8, r8, t8[12], 3873151461, 11), r8 = a$12(r8, _6, s7, h8, t8[15], 530742520, 16), s7 = l5(s7, h8 = a$12(h8, r8, _6, s7, t8[2], 3299628645, 23), r8, _6, t8[0], 4096336452, 6), _6 = l5(_6, s7, h8, r8, t8[7], 1126891415, 10), r8 = l5(r8, _6, s7, h8, t8[14], 2878612391, 15), h8 = l5(h8, r8, _6, s7, t8[5], 4237533241, 21), s7 = l5(s7, h8, r8, _6, t8[12], 1700485571, 6), _6 = l5(_6, s7, h8, r8, t8[3], 2399980690, 10), r8 = l5(r8, _6, s7, h8, t8[10], 4293915773, 15), h8 = l5(h8, r8, _6, s7, t8[1], 2240044497, 21), s7 = l5(s7, h8, r8, _6, t8[8], 1873313359, 6), _6 = l5(_6, s7, h8, r8, t8[15], 4264355552, 10), r8 = l5(r8, _6, s7, h8, t8[6], 2734768916, 15), h8 = l5(h8, r8, _6, s7, t8[13], 1309151649, 21), s7 = l5(s7, h8, r8, _6, t8[4], 4149444226, 6), _6 = l5(_6, s7, h8, r8, t8[11], 3174756917, 10), r8 = l5(r8, _6, s7, h8, t8[2], 718787259, 15), h8 = l5(h8, r8, _6, s7, t8[9], 3951481745, 21), this._a = this._a + s7 | 0, this._b = this._b + h8 | 0, this._c = this._c + r8 | 0, this._d = this._d + _6 | 0; + }, n$13.prototype._digest = function() { + this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); + var t8 = _4.allocUnsafe(16); + return t8.writeInt32LE(this._a, 0), t8.writeInt32LE(this._b, 4), t8.writeInt32LE(this._c, 8), t8.writeInt32LE(this._d, 12), t8; + }; + u5 = n$13; + h$12 = e$1$1.Buffer; + _$1 = t$2; + r$12 = f$13; + e$22 = new Array(16); + n$22 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + o$32 = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + f$3 = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + c$13 = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + a$22 = [0, 1518500249, 1859775393, 2400959708, 2840853838]; + l$13 = [1352829926, 1548603684, 1836072691, 2053994217, 0]; + _$1(u$13, r$12), u$13.prototype._update = function() { + for (var t8 = e$22, i7 = 0; i7 < 16; ++i7) + t8[i7] = this._block.readInt32LE(4 * i7); + for (var s7 = 0 | this._a, h8 = 0 | this._b, _6 = 0 | this._c, r8 = 0 | this._d, u7 = 0 | this._e, I6 = 0 | this._a, L6 = 0 | this._b, v8 = 0 | this._c, m7 = 0 | this._d, O7 = 0 | this._e, g7 = 0; g7 < 80; g7 += 1) { + var y7, U6; + g7 < 16 ? (y7 = d4(s7, h8, _6, r8, u7, t8[n$22[g7]], a$22[0], f$3[g7]), U6 = E4(I6, L6, v8, m7, O7, t8[o$32[g7]], l$13[0], c$13[g7])) : g7 < 32 ? (y7 = k4(s7, h8, _6, r8, u7, t8[n$22[g7]], a$22[1], f$3[g7]), U6 = w4(I6, L6, v8, m7, O7, t8[o$32[g7]], l$13[1], c$13[g7])) : g7 < 48 ? (y7 = p5(s7, h8, _6, r8, u7, t8[n$22[g7]], a$22[2], f$3[g7]), U6 = p5(I6, L6, v8, m7, O7, t8[o$32[g7]], l$13[2], c$13[g7])) : g7 < 64 ? (y7 = w4(s7, h8, _6, r8, u7, t8[n$22[g7]], a$22[3], f$3[g7]), U6 = k4(I6, L6, v8, m7, O7, t8[o$32[g7]], l$13[3], c$13[g7])) : (y7 = E4(s7, h8, _6, r8, u7, t8[n$22[g7]], a$22[4], f$3[g7]), U6 = d4(I6, L6, v8, m7, O7, t8[o$32[g7]], l$13[4], c$13[g7])), s7 = u7, u7 = r8, r8 = b5(_6, 10), _6 = h8, h8 = y7, I6 = O7, O7 = m7, m7 = b5(v8, 10), v8 = L6, L6 = U6; + } + var x7 = this._b + _6 + m7 | 0; + this._b = this._c + r8 + O7 | 0, this._c = this._d + u7 + I6 | 0, this._d = this._e + s7 + L6 | 0, this._e = this._a + h8 + v8 | 0, this._a = x7; + }, u$13.prototype._digest = function() { + this._block[this._blockOffset++] = 128, this._blockOffset > 56 && (this._block.fill(0, this._blockOffset, 64), this._update(), this._blockOffset = 0), this._block.fill(0, this._blockOffset, 56), this._block.writeUInt32LE(this._length[0], 56), this._block.writeUInt32LE(this._length[1], 60), this._update(); + var t8 = h$12.alloc ? h$12.alloc(20) : new h$12(20); + return t8.writeInt32LE(this._a, 0), t8.writeInt32LE(this._b, 4), t8.writeInt32LE(this._c, 8), t8.writeInt32LE(this._d, 12), t8.writeInt32LE(this._e, 16), t8; + }; + I4 = u$13; + s$13 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + h$2 = u4.Buffer; + e$3.prototype.update = function(t8, i7) { + "string" == typeof t8 && (i7 = i7 || "utf8", t8 = h$2.from(t8, i7)); + for (var e10 = (this || s$13)._block, _6 = (this || s$13)._blockSize, n7 = t8.length, r8 = (this || s$13)._len, o7 = 0; o7 < n7; ) { + for (var f8 = r8 % _6, l7 = Math.min(n7 - o7, _6 - f8), a7 = 0; a7 < l7; a7++) + e10[f8 + a7] = t8[o7 + a7]; + o7 += l7, (r8 += l7) % _6 == 0 && this._update(e10); + } + return (this || s$13)._len += n7, this || s$13; + }, e$3.prototype.digest = function(t8) { + var i7 = (this || s$13)._len % (this || s$13)._blockSize; + (this || s$13)._block[i7] = 128, (this || s$13)._block.fill(0, i7 + 1), i7 >= (this || s$13)._finalSize && (this._update((this || s$13)._block), (this || s$13)._block.fill(0)); + var h8 = 8 * (this || s$13)._len; + if (h8 <= 4294967295) + (this || s$13)._block.writeUInt32BE(h8, (this || s$13)._blockSize - 4); + else { + var e10 = (4294967295 & h8) >>> 0, _6 = (h8 - e10) / 4294967296; + (this || s$13)._block.writeUInt32BE(_6, (this || s$13)._blockSize - 8), (this || s$13)._block.writeUInt32BE(e10, (this || s$13)._blockSize - 4); + } + this._update((this || s$13)._block); + var n7 = this._hash(); + return t8 ? n7.toString(t8) : n7; + }, e$3.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + _$2 = e$3; + n$3 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + r$22 = t$2; + o$4 = _$2; + f$4 = u4.Buffer; + l$22 = [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]; + a$3 = new Array(64); + r$22(u$23, o$4), u$23.prototype.init = function() { + return (this || n$3)._a = 1779033703, (this || n$3)._b = 3144134277, (this || n$3)._c = 1013904242, (this || n$3)._d = 2773480762, (this || n$3)._e = 1359893119, (this || n$3)._f = 2600822924, (this || n$3)._g = 528734635, (this || n$3)._h = 1541459225, this || n$3; + }, u$23.prototype._update = function(t8) { + for (var i7, s7 = (this || n$3)._w, h8 = 0 | (this || n$3)._a, e10 = 0 | (this || n$3)._b, _6 = 0 | (this || n$3)._c, r8 = 0 | (this || n$3)._d, o7 = 0 | (this || n$3)._e, f8 = 0 | (this || n$3)._f, a7 = 0 | (this || n$3)._g, u7 = 0 | (this || n$3)._h, w6 = 0; w6 < 16; ++w6) + s7[w6] = t8.readInt32BE(4 * w6); + for (; w6 < 64; ++w6) + s7[w6] = 0 | (((i7 = s7[w6 - 2]) >>> 17 | i7 << 15) ^ (i7 >>> 19 | i7 << 13) ^ i7 >>> 10) + s7[w6 - 7] + k$1(s7[w6 - 15]) + s7[w6 - 16]; + for (var g7 = 0; g7 < 64; ++g7) { + var B6 = u7 + d$12(o7) + c$22(o7, f8, a7) + l$22[g7] + s7[g7] | 0, v8 = p$12(h8) + b$1(h8, e10, _6) | 0; + u7 = a7, a7 = f8, f8 = o7, o7 = r8 + B6 | 0, r8 = _6, _6 = e10, e10 = h8, h8 = B6 + v8 | 0; + } + (this || n$3)._a = h8 + (this || n$3)._a | 0, (this || n$3)._b = e10 + (this || n$3)._b | 0, (this || n$3)._c = _6 + (this || n$3)._c | 0, (this || n$3)._d = r8 + (this || n$3)._d | 0, (this || n$3)._e = o7 + (this || n$3)._e | 0, (this || n$3)._f = f8 + (this || n$3)._f | 0, (this || n$3)._g = a7 + (this || n$3)._g | 0, (this || n$3)._h = u7 + (this || n$3)._h | 0; + }, u$23.prototype._hash = function() { + var t8 = f$4.allocUnsafe(32); + return t8.writeInt32BE((this || n$3)._a, 0), t8.writeInt32BE((this || n$3)._b, 4), t8.writeInt32BE((this || n$3)._c, 8), t8.writeInt32BE((this || n$3)._d, 12), t8.writeInt32BE((this || n$3)._e, 16), t8.writeInt32BE((this || n$3)._f, 20), t8.writeInt32BE((this || n$3)._g, 24), t8.writeInt32BE((this || n$3)._h, 28), t8; + }; + w$1 = u$23; + _$3 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + e$4 = t$2; + n$4 = _$2; + r$3 = u4.Buffer; + l$3 = [1518500249, 1859775393, -1894007588, -899497514]; + o$5 = new Array(80); + e$4(f$5, n$4), f$5.prototype.init = function() { + return (this || _$3)._a = 1732584193, (this || _$3)._b = 4023233417, (this || _$3)._c = 2562383102, (this || _$3)._d = 271733878, (this || _$3)._e = 3285377520, this || _$3; + }, f$5.prototype._update = function(t8) { + for (var i7, h8 = (this || _$3)._w, s7 = 0 | (this || _$3)._a, e10 = 0 | (this || _$3)._b, n7 = 0 | (this || _$3)._c, r8 = 0 | (this || _$3)._d, o7 = 0 | (this || _$3)._e, f8 = 0; f8 < 16; ++f8) + h8[f8] = t8.readInt32BE(4 * f8); + for (; f8 < 80; ++f8) + h8[f8] = h8[f8 - 3] ^ h8[f8 - 8] ^ h8[f8 - 14] ^ h8[f8 - 16]; + for (var c7 = 0; c7 < 80; ++c7) { + var d7 = ~~(c7 / 20), p7 = 0 | ((i7 = s7) << 5 | i7 >>> 27) + u$3(d7, e10, n7, r8) + o7 + h8[c7] + l$3[d7]; + o7 = r8, r8 = n7, n7 = a$4(e10), e10 = s7, s7 = p7; + } + (this || _$3)._a = s7 + (this || _$3)._a | 0, (this || _$3)._b = e10 + (this || _$3)._b | 0, (this || _$3)._c = n7 + (this || _$3)._c | 0, (this || _$3)._d = r8 + (this || _$3)._d | 0, (this || _$3)._e = o7 + (this || _$3)._e | 0; + }, f$5.prototype._hash = function() { + var t8 = r$3.allocUnsafe(20); + return t8.writeInt32BE(0 | (this || _$3)._a, 0), t8.writeInt32BE(0 | (this || _$3)._b, 4), t8.writeInt32BE(0 | (this || _$3)._c, 8), t8.writeInt32BE(0 | (this || _$3)._d, 12), t8.writeInt32BE(0 | (this || _$3)._e, 16), t8; + }; + c$3 = f$5; + d$2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + p$2 = t$2; + b$2 = _$2; + w$2 = u4.Buffer; + g4 = [1518500249, 1859775393, -1894007588, -899497514]; + B4 = new Array(80); + p$2(y4, b$2), y4.prototype.init = function() { + return (this || d$2)._a = 1732584193, (this || d$2)._b = 4023233417, (this || d$2)._c = 2562383102, (this || d$2)._d = 271733878, (this || d$2)._e = 3285377520, this || d$2; + }, y4.prototype._update = function(t8) { + for (var i7, h8 = (this || d$2)._w, s7 = 0 | (this || d$2)._a, _6 = 0 | (this || d$2)._b, e10 = 0 | (this || d$2)._c, n7 = 0 | (this || d$2)._d, r8 = 0 | (this || d$2)._e, l7 = 0; l7 < 16; ++l7) + h8[l7] = t8.readInt32BE(4 * l7); + for (; l7 < 80; ++l7) + h8[l7] = (i7 = h8[l7 - 3] ^ h8[l7 - 8] ^ h8[l7 - 14] ^ h8[l7 - 16]) << 1 | i7 >>> 31; + for (var o7 = 0; o7 < 80; ++o7) { + var f8 = ~~(o7 / 20), a7 = E$1(s7) + v5(f8, _6, e10, n7) + r8 + h8[o7] + g4[f8] | 0; + r8 = n7, n7 = e10, e10 = I$1(_6), _6 = s7, s7 = a7; + } + (this || d$2)._a = s7 + (this || d$2)._a | 0, (this || d$2)._b = _6 + (this || d$2)._b | 0, (this || d$2)._c = e10 + (this || d$2)._c | 0, (this || d$2)._d = n7 + (this || d$2)._d | 0, (this || d$2)._e = r8 + (this || d$2)._e | 0; + }, y4.prototype._hash = function() { + var t8 = w$2.allocUnsafe(20); + return t8.writeInt32BE(0 | (this || d$2)._a, 0), t8.writeInt32BE(0 | (this || d$2)._b, 4), t8.writeInt32BE(0 | (this || d$2)._c, 8), t8.writeInt32BE(0 | (this || d$2)._d, 12), t8.writeInt32BE(0 | (this || d$2)._e, 16), t8; + }; + T4 = y4; + m4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + A4 = t$2; + U4 = w$1; + x5 = _$2; + j4 = u4.Buffer; + q3 = new Array(64); + A4(C4, U4), C4.prototype.init = function() { + return (this || m4)._a = 3238371032, (this || m4)._b = 914150663, (this || m4)._c = 812702999, (this || m4)._d = 4144912697, (this || m4)._e = 4290775857, (this || m4)._f = 1750603025, (this || m4)._g = 1694076839, (this || m4)._h = 3204075428, this || m4; + }, C4.prototype._hash = function() { + var t8 = j4.allocUnsafe(28); + return t8.writeInt32BE((this || m4)._a, 0), t8.writeInt32BE((this || m4)._b, 4), t8.writeInt32BE((this || m4)._c, 8), t8.writeInt32BE((this || m4)._d, 12), t8.writeInt32BE((this || m4)._e, 16), t8.writeInt32BE((this || m4)._f, 20), t8.writeInt32BE((this || m4)._g, 24), t8; + }; + L4 = C4; + k$2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + z4 = t$2; + D4 = _$2; + F4 = u4.Buffer; + G3 = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + H3 = new Array(160); + z4(J3, D4), J3.prototype.init = function() { + return (this || k$2)._ah = 1779033703, (this || k$2)._bh = 3144134277, (this || k$2)._ch = 1013904242, (this || k$2)._dh = 2773480762, (this || k$2)._eh = 1359893119, (this || k$2)._fh = 2600822924, (this || k$2)._gh = 528734635, (this || k$2)._hh = 1541459225, (this || k$2)._al = 4089235720, (this || k$2)._bl = 2227873595, (this || k$2)._cl = 4271175723, (this || k$2)._dl = 1595750129, (this || k$2)._el = 2917565137, (this || k$2)._fl = 725511199, (this || k$2)._gl = 4215389547, (this || k$2)._hl = 327033209, this || k$2; + }, J3.prototype._update = function(t8) { + for (var i7 = (this || k$2)._w, h8 = 0 | (this || k$2)._ah, s7 = 0 | (this || k$2)._bh, _6 = 0 | (this || k$2)._ch, e10 = 0 | (this || k$2)._dh, n7 = 0 | (this || k$2)._eh, r8 = 0 | (this || k$2)._fh, l7 = 0 | (this || k$2)._gh, o7 = 0 | (this || k$2)._hh, f8 = 0 | (this || k$2)._al, a7 = 0 | (this || k$2)._bl, u7 = 0 | (this || k$2)._cl, c7 = 0 | (this || k$2)._dl, d7 = 0 | (this || k$2)._el, p7 = 0 | (this || k$2)._fl, b8 = 0 | (this || k$2)._gl, w6 = 0 | (this || k$2)._hl, g7 = 0; g7 < 32; g7 += 2) + i7[g7] = t8.readInt32BE(4 * g7), i7[g7 + 1] = t8.readInt32BE(4 * g7 + 4); + for (; g7 < 160; g7 += 2) { + var B6 = i7[g7 - 30], y7 = i7[g7 - 30 + 1], E6 = P4(B6, y7), I6 = Q3(y7, B6), v8 = R4(B6 = i7[g7 - 4], y7 = i7[g7 - 4 + 1]), T6 = S4(y7, B6), m7 = i7[g7 - 14], A6 = i7[g7 - 14 + 1], U6 = i7[g7 - 32], x7 = i7[g7 - 32 + 1], j6 = I6 + A6 | 0, q5 = E6 + m7 + V3(j6, I6) | 0; + q5 = (q5 = q5 + v8 + V3(j6 = j6 + T6 | 0, T6) | 0) + U6 + V3(j6 = j6 + x7 | 0, x7) | 0, i7[g7] = q5, i7[g7 + 1] = j6; + } + for (var C6 = 0; C6 < 160; C6 += 2) { + q5 = i7[C6], j6 = i7[C6 + 1]; + var L6 = M4(h8, s7, _6), z6 = M4(f8, a7, u7), D6 = N4(h8, f8), F6 = N4(f8, h8), H5 = O4(n7, d7), J5 = O4(d7, n7), W5 = G3[C6], X5 = G3[C6 + 1], Y6 = K3(n7, r8, l7), Z5 = K3(d7, p7, b8), $5 = w6 + J5 | 0, tt3 = o7 + H5 + V3($5, w6) | 0; + tt3 = (tt3 = (tt3 = tt3 + Y6 + V3($5 = $5 + Z5 | 0, Z5) | 0) + W5 + V3($5 = $5 + X5 | 0, X5) | 0) + q5 + V3($5 = $5 + j6 | 0, j6) | 0; + var it2 = F6 + z6 | 0, ht2 = D6 + L6 + V3(it2, F6) | 0; + o7 = l7, w6 = b8, l7 = r8, b8 = p7, r8 = n7, p7 = d7, n7 = e10 + tt3 + V3(d7 = c7 + $5 | 0, c7) | 0, e10 = _6, c7 = u7, _6 = s7, u7 = a7, s7 = h8, a7 = f8, h8 = tt3 + ht2 + V3(f8 = $5 + it2 | 0, $5) | 0; + } + (this || k$2)._al = (this || k$2)._al + f8 | 0, (this || k$2)._bl = (this || k$2)._bl + a7 | 0, (this || k$2)._cl = (this || k$2)._cl + u7 | 0, (this || k$2)._dl = (this || k$2)._dl + c7 | 0, (this || k$2)._el = (this || k$2)._el + d7 | 0, (this || k$2)._fl = (this || k$2)._fl + p7 | 0, (this || k$2)._gl = (this || k$2)._gl + b8 | 0, (this || k$2)._hl = (this || k$2)._hl + w6 | 0, (this || k$2)._ah = (this || k$2)._ah + h8 + V3((this || k$2)._al, f8) | 0, (this || k$2)._bh = (this || k$2)._bh + s7 + V3((this || k$2)._bl, a7) | 0, (this || k$2)._ch = (this || k$2)._ch + _6 + V3((this || k$2)._cl, u7) | 0, (this || k$2)._dh = (this || k$2)._dh + e10 + V3((this || k$2)._dl, c7) | 0, (this || k$2)._eh = (this || k$2)._eh + n7 + V3((this || k$2)._el, d7) | 0, (this || k$2)._fh = (this || k$2)._fh + r8 + V3((this || k$2)._fl, p7) | 0, (this || k$2)._gh = (this || k$2)._gh + l7 + V3((this || k$2)._gl, b8) | 0, (this || k$2)._hh = (this || k$2)._hh + o7 + V3((this || k$2)._hl, w6) | 0; + }, J3.prototype._hash = function() { + var t8 = F4.allocUnsafe(64); + function i7(i8, h8, s7) { + t8.writeInt32BE(i8, s7), t8.writeInt32BE(h8, s7 + 4); + } + return i7((this || k$2)._ah, (this || k$2)._al, 0), i7((this || k$2)._bh, (this || k$2)._bl, 8), i7((this || k$2)._ch, (this || k$2)._cl, 16), i7((this || k$2)._dh, (this || k$2)._dl, 24), i7((this || k$2)._eh, (this || k$2)._el, 32), i7((this || k$2)._fh, (this || k$2)._fl, 40), i7((this || k$2)._gh, (this || k$2)._gl, 48), i7((this || k$2)._hh, (this || k$2)._hl, 56), t8; + }; + W3 = J3; + X3 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + Y4 = t$2; + Z3 = W3; + $3 = _$2; + tt = u4.Buffer; + it = new Array(160); + Y4(ht, Z3), ht.prototype.init = function() { + return (this || X3)._ah = 3418070365, (this || X3)._bh = 1654270250, (this || X3)._ch = 2438529370, (this || X3)._dh = 355462360, (this || X3)._eh = 1731405415, (this || X3)._fh = 2394180231, (this || X3)._gh = 3675008525, (this || X3)._hh = 1203062813, (this || X3)._al = 3238371032, (this || X3)._bl = 914150663, (this || X3)._cl = 812702999, (this || X3)._dl = 4144912697, (this || X3)._el = 4290775857, (this || X3)._fl = 1750603025, (this || X3)._gl = 1694076839, (this || X3)._hl = 3204075428, this || X3; + }, ht.prototype._hash = function() { + var t8 = tt.allocUnsafe(48); + function i7(i8, h8, s7) { + t8.writeInt32BE(i8, s7), t8.writeInt32BE(h8, s7 + 4); + } + return i7((this || X3)._ah, (this || X3)._al, 0), i7((this || X3)._bh, (this || X3)._bl, 8), i7((this || X3)._ch, (this || X3)._cl, 16), i7((this || X3)._dh, (this || X3)._dl, 24), i7((this || X3)._eh, (this || X3)._el, 32), i7((this || X3)._fh, (this || X3)._fl, 40), t8; + }; + _t = ht; + et = { exports: st = {} }; + (st = et.exports = function(t8) { + t8 = t8.toLowerCase(); + var i7 = st[t8]; + if (!i7) + throw new Error(t8 + " is not supported (we accept pull requests)"); + return new i7(); + }).sha = c$3, st.sha1 = T4, st.sha224 = L4, st.sha256 = w$1, st.sha384 = _t, st.sha512 = W3; + nt = et.exports; + e$5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + n$5 = u4.Buffer; + s$2 = b$i.Transform; + h$3 = e$12.StringDecoder; + t$2(a$5, s$2), a$5.prototype.update = function(t8, i7, r8) { + "string" == typeof t8 && (t8 = n$5.from(t8, i7)); + var o7 = this._update(t8); + return (this || e$5).hashMode ? this || e$5 : (r8 && (o7 = this._toString(o7, r8)), o7); + }, a$5.prototype.setAutoPadding = function() { + }, a$5.prototype.getAuthTag = function() { + throw new Error("trying to get auth tag in unsupported state"); + }, a$5.prototype.setAuthTag = function() { + throw new Error("trying to set auth tag in unsupported state"); + }, a$5.prototype.setAAD = function() { + throw new Error("trying to set aad in unsupported state"); + }, a$5.prototype._transform = function(t8, i7, r8) { + var o7; + try { + (this || e$5).hashMode ? this._update(t8) : this.push(this._update(t8)); + } catch (t9) { + o7 = t9; + } finally { + r8(o7); + } + }, a$5.prototype._flush = function(t8) { + var i7; + try { + this.push(this.__final()); + } catch (t9) { + i7 = t9; + } + t8(i7); + }, a$5.prototype._finalOrDigest = function(t8) { + var i7 = this.__final() || n$5.alloc(0); + return t8 && (i7 = this._toString(i7, t8, true)), i7; + }, a$5.prototype._toString = function(t8, i7, r8) { + if ((this || e$5)._decoder || ((this || e$5)._decoder = new h$3(i7), (this || e$5)._encoding = i7), (this || e$5)._encoding !== i7) + throw new Error("can't switch encodings"); + var o7 = (this || e$5)._decoder.write(t8); + return r8 && (o7 += (this || e$5)._decoder.end()), o7; + }; + f$6 = a$5; + m$12 = u5; + n$6 = I4; + p$3 = nt; + s$3 = f$6; + t$2(a$6, s$3), a$6.prototype._update = function(t8) { + this._hash.update(t8); + }, a$6.prototype._final = function() { + return this._hash.digest(); + }; + h$4 = function(t8) { + return "md5" === (t8 = t8.toLowerCase()) ? new m$12() : "rmd160" === t8 || "ripemd160" === t8 ? new n$6() : new a$6(p$3(t8)); + }; + e$6 = u5; + r$4 = function(t8) { + return new e$6().update(t8).digest(); + }; + o$6 = t$2; + h$5 = u4.Buffer; + n$7 = f$6; + p$4 = h$5.alloc(128); + o$6(f$7, n$7), f$7.prototype._update = function(t8) { + this._hash.push(t8); + }, f$7.prototype._final = function() { + var t8 = this._alg(h$5.concat(this._hash)); + return this._alg(h$5.concat([this._opad, t8])); + }; + l$4 = t$2; + d$3 = f$7; + c$4 = f$6; + _$4 = u4.Buffer; + m$2 = r$4; + u$4 = I4; + g$1 = nt; + v$1 = _$4.alloc(128); + l$4(y$1, c$4), y$1.prototype._update = function(t8) { + this._hash.update(t8); + }, y$1.prototype._final = function() { + var t8 = this._hash.digest(); + return ("rmd160" === this._alg ? new u$4() : g$1(this._alg)).update(this._opad).update(t8).digest(); + }; + w$3 = function(t8, a7) { + return "rmd160" === (t8 = t8.toLowerCase()) || "ripemd160" === t8 ? new y$1("rmd160", a7) : "md5" === t8 ? new d$3(m$2, a7) : new y$1(t8, a7); + }; + s$4 = { sha224WithRSAEncryption: { sign: "rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, "RSA-SHA224": { sign: "ecdsa/rsa", hash: "sha224", id: "302d300d06096086480165030402040500041c" }, sha256WithRSAEncryption: { sign: "rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, "RSA-SHA256": { sign: "ecdsa/rsa", hash: "sha256", id: "3031300d060960864801650304020105000420" }, sha384WithRSAEncryption: { sign: "rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, "RSA-SHA384": { sign: "ecdsa/rsa", hash: "sha384", id: "3041300d060960864801650304020205000430" }, sha512WithRSAEncryption: { sign: "rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA512": { sign: "ecdsa/rsa", hash: "sha512", id: "3051300d060960864801650304020305000440" }, "RSA-SHA1": { sign: "rsa", hash: "sha1", id: "3021300906052b0e03021a05000414" }, "ecdsa-with-SHA1": { sign: "ecdsa", hash: "sha1", id: "" }, sha256: { sign: "ecdsa", hash: "sha256", id: "" }, sha224: { sign: "ecdsa", hash: "sha224", id: "" }, sha384: { sign: "ecdsa", hash: "sha384", id: "" }, sha512: { sign: "ecdsa", hash: "sha512", id: "" }, "DSA-SHA": { sign: "dsa", hash: "sha1", id: "" }, "DSA-SHA1": { sign: "dsa", hash: "sha1", id: "" }, DSA: { sign: "dsa", hash: "sha1", id: "" }, "DSA-WITH-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-SHA224": { sign: "dsa", hash: "sha224", id: "" }, "DSA-WITH-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-SHA256": { sign: "dsa", hash: "sha256", id: "" }, "DSA-WITH-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-SHA384": { sign: "dsa", hash: "sha384", id: "" }, "DSA-WITH-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-SHA512": { sign: "dsa", hash: "sha512", id: "" }, "DSA-RIPEMD160": { sign: "dsa", hash: "rmd160", id: "" }, ripemd160WithRSA: { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, "RSA-RIPEMD160": { sign: "rsa", hash: "rmd160", id: "3021300906052b2403020105000414" }, md5WithRSAEncryption: { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" }, "RSA-MD5": { sign: "rsa", hash: "md5", id: "3020300c06082a864886f70d020505000410" } }; + f$8 = e$1$1.Buffer; + a$7 = Math.pow(2, 30) - 1; + h$6 = function(r8, e10, t8, n7) { + if (s$5(r8, "Password"), s$5(e10, "Salt"), "number" != typeof t8) + throw new TypeError("Iterations not a number"); + if (t8 < 0) + throw new TypeError("Bad iterations"); + if ("number" != typeof n7) + throw new TypeError("Key length not a number"); + if (n7 < 0 || n7 > a$7 || n7 != n7) + throw new TypeError("Bad key length"); + }; + c$5 = T$1; + c$5.browser ? u$5 = "utf-8" : u$5 = parseInt(c$5.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary"; + l$5 = u$5; + p$5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + d$4 = r$4; + m$3 = I4; + y$2 = nt; + b$3 = h$6; + v$2 = l$5; + w$4 = u4.Buffer; + g$2 = w$4.alloc(128); + B$1 = { md5: 16, sha1: 20, sha224: 28, sha256: 32, sha384: 48, sha512: 64, rmd160: 20, ripemd160: 20 }; + T$12.prototype.run = function(r8, e10) { + return r8.copy(e10, (this || p$5).blocksize), this.hash(e10).copy((this || p$5).opad, (this || p$5).blocksize), this.hash((this || p$5).opad); + }; + S$1 = function(r8, e10, t8, n7, o7) { + b$3(r8, e10, t8, n7), w$4.isBuffer(r8) || (r8 = w$4.from(r8, v$2)), w$4.isBuffer(e10) || (e10 = w$4.from(e10, v$2)); + var i7 = new T$12(o7 = o7 || "sha1", r8, e10.length), f8 = w$4.allocUnsafe(n7), a7 = w$4.allocUnsafe(e10.length + 4); + e10.copy(a7, 0, 0, e10.length); + for (var s7 = 0, u7 = B$1[o7], h8 = Math.ceil(n7 / u7), c7 = 1; c7 <= h8; c7++) { + a7.writeUInt32BE(c7, e10.length); + for (var l7 = i7.run(a7, i7.ipad1), p7 = l7, d7 = 1; d7 < t8; d7++) { + p7 = i7.run(p7, i7.ipad2); + for (var m7 = 0; m7 < u7; m7++) + l7[m7] ^= p7[m7]; + } + l7.copy(f8, s7), s7 += u7; + } + return f8; + }; + A$1 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + H$1 = T$1; + E$2 = h$6; + P$1 = l$5; + U$1 = S$1; + K$1 = u4.Buffer; + x$1 = A$1.crypto && A$1.crypto.subtle; + z$1 = { sha: "SHA-1", "sha-1": "SHA-1", sha1: "SHA-1", sha256: "SHA-256", "sha-256": "SHA-256", sha384: "SHA-384", "sha-384": "SHA-384", "sha-512": "SHA-512", sha512: "SHA-512" }; + I$2 = []; + F$1 = function(r8, e10, t8, n7, o7, i7) { + "function" == typeof o7 && (i7 = o7, o7 = void 0); + var f8 = z$1[(o7 = o7 || "sha1").toLowerCase()]; + if (!f8 || "function" != typeof A$1.Promise) + return H$1.nextTick(function() { + var f9; + try { + f9 = U$1(r8, e10, t8, n7, o7); + } catch (r9) { + return i7(r9); + } + i7(null, f9); + }); + if (E$2(r8, e10, t8, n7), "function" != typeof i7) + throw new Error("No callback provided to pbkdf2"); + K$1.isBuffer(r8) || (r8 = K$1.from(r8, P$1)), K$1.isBuffer(e10) || (e10 = K$1.from(e10, P$1)), function(r9, e11) { + r9.then(function(r10) { + H$1.nextTick(function() { + e11(null, r10); + }); + }, function(r10) { + H$1.nextTick(function() { + e11(r10); + }); + }); + }(function(r9) { + if (A$1.process && !A$1.process.browser) + return Promise.resolve(false); + if (!x$1 || !x$1.importKey || !x$1.deriveBits) + return Promise.resolve(false); + if (void 0 !== I$2[r9]) + return I$2[r9]; + var e11 = D$1(k$3 = k$3 || K$1.alloc(8), k$3, 10, 128, r9).then(function() { + return true; + }).catch(function() { + return false; + }); + return I$2[r9] = e11, e11; + }(f8).then(function(i8) { + return i8 ? D$1(r8, e10, t8, n7, f8) : U$1(r8, e10, t8, n7, o7); + }), i7); + }; + M$1 = {}; + M$1.pbkdf2 = F$1, M$1.pbkdf2Sync = S$1; + r$5 = e$7, e$7.equal = function(r8, e10, o7) { + if (r8 != e10) + throw new Error(o7 || "Assertion failed: " + r8 + " != " + e10); + }; + o$7 = r$5; + r$6 = { readUInt32BE: function(t8, e10) { + return (t8[0 + e10] << 24 | t8[1 + e10] << 16 | t8[2 + e10] << 8 | t8[3 + e10]) >>> 0; + }, writeUInt32BE: function(t8, e10, r8) { + t8[0 + r8] = e10 >>> 24, t8[1 + r8] = e10 >>> 16 & 255, t8[2 + r8] = e10 >>> 8 & 255, t8[3 + r8] = 255 & e10; + }, ip: function(t8, e10, r8, i7) { + for (var n7 = 0, f8 = 0, o7 = 6; o7 >= 0; o7 -= 2) { + for (var p7 = 0; p7 <= 24; p7 += 8) + n7 <<= 1, n7 |= e10 >>> p7 + o7 & 1; + for (p7 = 0; p7 <= 24; p7 += 8) + n7 <<= 1, n7 |= t8 >>> p7 + o7 & 1; + } + for (o7 = 6; o7 >= 0; o7 -= 2) { + for (p7 = 1; p7 <= 25; p7 += 8) + f8 <<= 1, f8 |= e10 >>> p7 + o7 & 1; + for (p7 = 1; p7 <= 25; p7 += 8) + f8 <<= 1, f8 |= t8 >>> p7 + o7 & 1; + } + r8[i7 + 0] = n7 >>> 0, r8[i7 + 1] = f8 >>> 0; + }, rip: function(t8, e10, r8, i7) { + for (var n7 = 0, f8 = 0, o7 = 0; o7 < 4; o7++) + for (var p7 = 24; p7 >= 0; p7 -= 8) + n7 <<= 1, n7 |= e10 >>> p7 + o7 & 1, n7 <<= 1, n7 |= t8 >>> p7 + o7 & 1; + for (o7 = 4; o7 < 8; o7++) + for (p7 = 24; p7 >= 0; p7 -= 8) + f8 <<= 1, f8 |= e10 >>> p7 + o7 & 1, f8 <<= 1, f8 |= t8 >>> p7 + o7 & 1; + r8[i7 + 0] = n7 >>> 0, r8[i7 + 1] = f8 >>> 0; + }, pc1: function(t8, e10, r8, i7) { + for (var n7 = 0, f8 = 0, o7 = 7; o7 >= 5; o7--) { + for (var p7 = 0; p7 <= 24; p7 += 8) + n7 <<= 1, n7 |= e10 >> p7 + o7 & 1; + for (p7 = 0; p7 <= 24; p7 += 8) + n7 <<= 1, n7 |= t8 >> p7 + o7 & 1; + } + for (p7 = 0; p7 <= 24; p7 += 8) + n7 <<= 1, n7 |= e10 >> p7 + o7 & 1; + for (o7 = 1; o7 <= 3; o7++) { + for (p7 = 0; p7 <= 24; p7 += 8) + f8 <<= 1, f8 |= e10 >> p7 + o7 & 1; + for (p7 = 0; p7 <= 24; p7 += 8) + f8 <<= 1, f8 |= t8 >> p7 + o7 & 1; + } + for (p7 = 0; p7 <= 24; p7 += 8) + f8 <<= 1, f8 |= t8 >> p7 + o7 & 1; + r8[i7 + 0] = n7 >>> 0, r8[i7 + 1] = f8 >>> 0; + }, r28shl: function(t8, e10) { + return t8 << e10 & 268435455 | t8 >>> 28 - e10; + } }; + i5 = [14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24]; + r$6.pc2 = function(t8, e10, r8, n7) { + for (var f8 = 0, o7 = 0, p7 = i5.length >>> 1, u7 = 0; u7 < p7; u7++) + f8 <<= 1, f8 |= t8 >>> i5[u7] & 1; + for (u7 = p7; u7 < i5.length; u7++) + o7 <<= 1, o7 |= e10 >>> i5[u7] & 1; + r8[n7 + 0] = f8 >>> 0, r8[n7 + 1] = o7 >>> 0; + }, r$6.expand = function(t8, e10, r8) { + var i7 = 0, n7 = 0; + i7 = (1 & t8) << 5 | t8 >>> 27; + for (var f8 = 23; f8 >= 15; f8 -= 4) + i7 <<= 6, i7 |= t8 >>> f8 & 63; + for (f8 = 11; f8 >= 3; f8 -= 4) + n7 |= t8 >>> f8 & 63, n7 <<= 6; + n7 |= (31 & t8) << 1 | t8 >>> 31, e10[r8 + 0] = i7 >>> 0, e10[r8 + 1] = n7 >>> 0; + }; + n$8 = [14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11]; + r$6.substitute = function(t8, e10) { + for (var r8 = 0, i7 = 0; i7 < 4; i7++) { + r8 <<= 4, r8 |= n$8[64 * i7 + (t8 >>> 18 - 6 * i7 & 63)]; + } + for (i7 = 0; i7 < 4; i7++) { + r8 <<= 4, r8 |= n$8[256 + 64 * i7 + (e10 >>> 18 - 6 * i7 & 63)]; + } + return r8 >>> 0; + }; + f$9 = [16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7]; + r$6.permute = function(t8) { + for (var e10 = 0, r8 = 0; r8 < f$9.length; r8++) + e10 <<= 1, e10 |= t8 >>> f$9[r8] & 1; + return e10 >>> 0; + }, r$6.padSplit = function(t8, e10, r8) { + for (var i7 = t8.toString(2); i7.length < e10; ) + i7 = "0" + i7; + for (var n7 = [], f8 = 0; f8 < e10; f8 += r8) + n7.push(i7.slice(f8, f8 + r8)); + return n7.join(" "); + }; + p$6 = o$7; + o$8 = u$6, u$6.prototype._init = function() { + }, u$6.prototype.update = function(t8) { + return 0 === t8.length ? [] : "decrypt" === this.type ? this._updateDecrypt(t8) : this._updateEncrypt(t8); + }, u$6.prototype._buffer = function(t8, e10) { + for (var r8 = Math.min(this.buffer.length - this.bufferOff, t8.length - e10), i7 = 0; i7 < r8; i7++) + this.buffer[this.bufferOff + i7] = t8[e10 + i7]; + return this.bufferOff += r8, r8; + }, u$6.prototype._flushBuffer = function(t8, e10) { + return this._update(this.buffer, 0, t8, e10), this.bufferOff = 0, this.blockSize; + }, u$6.prototype._updateEncrypt = function(t8) { + var e10 = 0, r8 = 0, i7 = (this.bufferOff + t8.length) / this.blockSize | 0, n7 = new Array(i7 * this.blockSize); + 0 !== this.bufferOff && (e10 += this._buffer(t8, e10), this.bufferOff === this.buffer.length && (r8 += this._flushBuffer(n7, r8))); + for (var f8 = t8.length - (t8.length - e10) % this.blockSize; e10 < f8; e10 += this.blockSize) + this._update(t8, e10, n7, r8), r8 += this.blockSize; + for (; e10 < t8.length; e10++, this.bufferOff++) + this.buffer[this.bufferOff] = t8[e10]; + return n7; + }, u$6.prototype._updateDecrypt = function(t8) { + for (var e10 = 0, r8 = 0, i7 = Math.ceil((this.bufferOff + t8.length) / this.blockSize) - 1, n7 = new Array(i7 * this.blockSize); i7 > 0; i7--) + e10 += this._buffer(t8, e10), r8 += this._flushBuffer(n7, r8); + return e10 += this._buffer(t8, e10), n7; + }, u$6.prototype.final = function(t8) { + var e10, r8; + return t8 && (e10 = this.update(t8)), r8 = "encrypt" === this.type ? this._finalEncrypt() : this._finalDecrypt(), e10 ? e10.concat(r8) : r8; + }, u$6.prototype._pad = function(t8, e10) { + if (0 === e10) + return false; + for (; e10 < t8.length; ) + t8[e10++] = 0; + return true; + }, u$6.prototype._finalEncrypt = function() { + if (!this._pad(this.buffer, this.bufferOff)) + return []; + var t8 = new Array(this.blockSize); + return this._update(this.buffer, 0, t8, 0), t8; + }, u$6.prototype._unpad = function(t8) { + return t8; + }, u$6.prototype._finalDecrypt = function() { + p$6.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt"); + var t8 = new Array(this.blockSize); + return this._flushBuffer(t8, 0), this._unpad(t8); + }; + a$8 = o$8; + h$7 = o$7; + c$6 = r$6; + l$6 = a$8; + t$2(v$3, l$6), s$6 = v$3, v$3.create = function(t8) { + return new v$3(t8); + }; + d$5 = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1]; + v$3.prototype.deriveKeys = function(t8, e10) { + t8.keys = new Array(32), h$7.equal(e10.length, this.blockSize, "Invalid key length"); + var r8 = c$6.readUInt32BE(e10, 0), i7 = c$6.readUInt32BE(e10, 4); + c$6.pc1(r8, i7, t8.tmp, 0), r8 = t8.tmp[0], i7 = t8.tmp[1]; + for (var n7 = 0; n7 < t8.keys.length; n7 += 2) { + var f8 = d$5[n7 >>> 1]; + r8 = c$6.r28shl(r8, f8), i7 = c$6.r28shl(i7, f8), c$6.pc2(r8, i7, t8.keys, n7); + } + }, v$3.prototype._update = function(t8, e10, r8, i7) { + var n7 = this._desState, f8 = c$6.readUInt32BE(t8, e10), o7 = c$6.readUInt32BE(t8, e10 + 4); + c$6.ip(f8, o7, n7.tmp, 0), f8 = n7.tmp[0], o7 = n7.tmp[1], "encrypt" === this.type ? this._encrypt(n7, f8, o7, n7.tmp, 0) : this._decrypt(n7, f8, o7, n7.tmp, 0), f8 = n7.tmp[0], o7 = n7.tmp[1], c$6.writeUInt32BE(r8, f8, i7), c$6.writeUInt32BE(r8, o7, i7 + 4); + }, v$3.prototype._pad = function(t8, e10) { + for (var r8 = t8.length - e10, i7 = e10; i7 < t8.length; i7++) + t8[i7] = r8; + return true; + }, v$3.prototype._unpad = function(t8) { + for (var e10 = t8[t8.length - 1], r8 = t8.length - e10; r8 < t8.length; r8++) + h$7.equal(t8[r8], e10); + return t8.slice(0, t8.length - e10); + }, v$3.prototype._encrypt = function(t8, e10, r8, i7, n7) { + for (var f8 = e10, o7 = r8, p7 = 0; p7 < t8.keys.length; p7 += 2) { + var u7 = t8.keys[p7], s7 = t8.keys[p7 + 1]; + c$6.expand(o7, t8.tmp, 0), u7 ^= t8.tmp[0], s7 ^= t8.tmp[1]; + var a7 = c$6.substitute(u7, s7), h8 = o7; + o7 = (f8 ^ c$6.permute(a7)) >>> 0, f8 = h8; + } + c$6.rip(o7, f8, i7, n7); + }, v$3.prototype._decrypt = function(t8, e10, r8, i7, n7) { + for (var f8 = r8, o7 = e10, p7 = t8.keys.length - 2; p7 >= 0; p7 -= 2) { + var u7 = t8.keys[p7], s7 = t8.keys[p7 + 1]; + c$6.expand(f8, t8.tmp, 0), u7 ^= t8.tmp[0], s7 ^= t8.tmp[1]; + var a7 = c$6.substitute(u7, s7), h8 = f8; + f8 = (o7 ^ c$6.permute(a7)) >>> 0, o7 = h8; + } + c$6.rip(f8, o7, i7, n7); + }; + _$5 = s$6; + b$4 = {}; + k$4 = o$7; + g$3 = t$2; + m$4 = {}; + b$4.instantiate = function(t8) { + function e10(e11) { + t8.call(this, e11), this._cbcInit(); + } + g$3(e10, t8); + for (var r8 = Object.keys(m$4), i7 = 0; i7 < r8.length; i7++) { + var n7 = r8[i7]; + e10.prototype[n7] = m$4[n7]; + } + return e10.create = function(t9) { + return new e10(t9); + }, e10; + }, m$4._cbcInit = function() { + var t8 = new S$2(this.options.iv); + this._cbcState = t8; + }, m$4._update = function(t8, e10, r8, i7) { + var n7 = this._cbcState, f8 = this.constructor.super_.prototype, o7 = n7.iv; + if ("encrypt" === this.type) { + for (var p7 = 0; p7 < this.blockSize; p7++) + o7[p7] ^= t8[e10 + p7]; + f8._update.call(this, o7, 0, r8, i7); + for (p7 = 0; p7 < this.blockSize; p7++) + o7[p7] = r8[i7 + p7]; + } else { + f8._update.call(this, t8, e10, r8, i7); + for (p7 = 0; p7 < this.blockSize; p7++) + r8[i7 + p7] ^= o7[p7]; + for (p7 = 0; p7 < this.blockSize; p7++) + o7[p7] = t8[e10 + p7]; + } + }; + w$5 = o$7; + E$3 = a$8; + I$3 = _$5; + t$2(B$2, E$3), z$2 = B$2, B$2.create = function(t8) { + return new B$2(t8); + }, B$2.prototype._update = function(t8, e10, r8, i7) { + var n7 = this._edeState; + n7.ciphers[0]._update(t8, e10, r8, i7), n7.ciphers[1]._update(r8, i7, r8, i7), n7.ciphers[2]._update(r8, i7, r8, i7); + }, B$2.prototype._pad = I$3.prototype._pad, B$2.prototype._unpad = I$3.prototype._unpad; + A$2 = z$2; + U$2 = {}; + U$2.utils = r$6, U$2.Cipher = a$8, U$2.DES = _$5, U$2.CBC = b$4, U$2.EDE = A$2; + i$13 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + f$a = f$6; + o$9 = U$2; + a$9 = t$2; + c$7 = u4.Buffer; + n$9 = { "des-ede3-cbc": o$9.CBC.instantiate(o$9.EDE), "des-ede3": o$9.EDE, "des-ede-cbc": o$9.CBC.instantiate(o$9.EDE), "des-ede": o$9.EDE, "des-cbc": o$9.CBC.instantiate(o$9.DES), "des-ecb": o$9.DES }; + n$9.des = n$9["des-cbc"], n$9.des3 = n$9["des-ede3-cbc"], d$6 = p$7, a$9(p$7, f$a), p$7.prototype._update = function(e10) { + return c$7.from((this || i$13)._des.update(e10)); + }, p$7.prototype._final = function() { + return c$7.from((this || i$13)._des.final()); + }; + l$7 = d$6; + e$8 = e$1$1.Buffer; + f$b = function(r8, f8) { + for (var t8 = Math.min(r8.length, f8.length), n7 = new e$8(t8), o7 = 0; o7 < t8; ++o7) + n7[o7] = r8[o7] ^ f8[o7]; + return n7; + }; + t$12 = function(e10) { + for (var c7, r8 = e10.length; r8--; ) { + if (255 !== (c7 = e10.readUInt8(r8))) { + c7++, e10.writeUInt8(c7, r8); + break; + } + e10.writeUInt8(0, r8); + } + }; + a$a = { encrypt: function(e10, c7) { + return e10._cipher.encryptBlock(c7); + }, decrypt: function(e10, c7) { + return e10._cipher.decryptBlock(c7); + } }; + p$8 = {}; + n$a = f$b; + p$8.encrypt = function(e10, c7) { + var r8 = n$a(c7, e10._prev); + return e10._prev = e10._cipher.encryptBlock(r8), e10._prev; + }, p$8.decrypt = function(e10, c7) { + var r8 = e10._prev; + e10._prev = c7; + var t8 = e10._cipher.decryptBlock(c7); + return n$a(t8, r8); + }; + i$22 = {}; + o$a = u4.Buffer; + h$8 = f$b; + i$22.encrypt = function(e10, c7, r8) { + for (var t8, a7 = o$a.allocUnsafe(0); c7.length; ) { + if (0 === e10._cache.length && (e10._cache = e10._cipher.encryptBlock(e10._prev), e10._prev = o$a.allocUnsafe(0)), !(e10._cache.length <= c7.length)) { + a7 = o$a.concat([a7, v$4(e10, c7, r8)]); + break; + } + t8 = e10._cache.length, a7 = o$a.concat([a7, v$4(e10, c7.slice(0, t8), r8)]), c7 = c7.slice(t8); + } + return a7; + }; + y$4 = {}; + f$c = u4.Buffer; + y$4.encrypt = function(e10, c7, r8) { + for (var t8 = c7.length, a7 = f$c.allocUnsafe(t8), p7 = -1; ++p7 < t8; ) + a7[p7] = s$7(e10, c7[p7], r8); + return a7; + }; + l$8 = {}; + m$5 = u4.Buffer; + l$8.encrypt = function(e10, c7, r8) { + for (var t8 = c7.length, a7 = m$5.allocUnsafe(t8), p7 = -1; ++p7 < t8; ) + a7[p7] = _$6(e10, c7[p7], r8); + return a7; + }; + B$3 = {}; + u$7 = e$1$1.Buffer; + C$1 = f$b; + B$3.encrypt = function(e10, c7) { + for (; e10._cache.length < c7.length; ) + e10._cache = u$7.concat([e10._cache, E$4(e10)]); + var r8 = e10._cache.slice(0, c7.length); + return e10._cache = e10._cache.slice(c7.length), C$1(c7, r8); + }; + d$7 = {}; + b$5 = f$b; + A$3 = u4.Buffer; + S$3 = t$12; + d$7.encrypt = function(e10, c7) { + var r8 = Math.ceil(c7.length / 16), t8 = e10._cache.length; + e10._cache = A$3.concat([e10._cache, A$3.allocUnsafe(16 * r8)]); + for (var a7 = 0; a7 < r8; a7++) { + var p7 = g$4(e10), n7 = t8 + 16 * a7; + e10._cache.writeUInt32BE(p7[0], n7 + 0), e10._cache.writeUInt32BE(p7[1], n7 + 4), e10._cache.writeUInt32BE(p7[2], n7 + 8), e10._cache.writeUInt32BE(p7[3], n7 + 12); + } + var i7 = e10._cache.slice(0, c7.length); + return e10._cache = e10._cache.slice(c7.length), b$5(c7, i7); + }; + F$2 = { "aes-128-ecb": { cipher: "AES", key: 128, iv: 0, mode: "ECB", type: "block" }, "aes-192-ecb": { cipher: "AES", key: 192, iv: 0, mode: "ECB", type: "block" }, "aes-256-ecb": { cipher: "AES", key: 256, iv: 0, mode: "ECB", type: "block" }, "aes-128-cbc": { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, "aes-192-cbc": { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, "aes-256-cbc": { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, aes128: { cipher: "AES", key: 128, iv: 16, mode: "CBC", type: "block" }, aes192: { cipher: "AES", key: 192, iv: 16, mode: "CBC", type: "block" }, aes256: { cipher: "AES", key: 256, iv: 16, mode: "CBC", type: "block" }, "aes-128-cfb": { cipher: "AES", key: 128, iv: 16, mode: "CFB", type: "stream" }, "aes-192-cfb": { cipher: "AES", key: 192, iv: 16, mode: "CFB", type: "stream" }, "aes-256-cfb": { cipher: "AES", key: 256, iv: 16, mode: "CFB", type: "stream" }, "aes-128-cfb8": { cipher: "AES", key: 128, iv: 16, mode: "CFB8", type: "stream" }, "aes-192-cfb8": { cipher: "AES", key: 192, iv: 16, mode: "CFB8", type: "stream" }, "aes-256-cfb8": { cipher: "AES", key: 256, iv: 16, mode: "CFB8", type: "stream" }, "aes-128-cfb1": { cipher: "AES", key: 128, iv: 16, mode: "CFB1", type: "stream" }, "aes-192-cfb1": { cipher: "AES", key: 192, iv: 16, mode: "CFB1", type: "stream" }, "aes-256-cfb1": { cipher: "AES", key: 256, iv: 16, mode: "CFB1", type: "stream" }, "aes-128-ofb": { cipher: "AES", key: 128, iv: 16, mode: "OFB", type: "stream" }, "aes-192-ofb": { cipher: "AES", key: 192, iv: 16, mode: "OFB", type: "stream" }, "aes-256-ofb": { cipher: "AES", key: 256, iv: 16, mode: "OFB", type: "stream" }, "aes-128-ctr": { cipher: "AES", key: 128, iv: 16, mode: "CTR", type: "stream" }, "aes-192-ctr": { cipher: "AES", key: 192, iv: 16, mode: "CTR", type: "stream" }, "aes-256-ctr": { cipher: "AES", key: 256, iv: 16, mode: "CTR", type: "stream" }, "aes-128-gcm": { cipher: "AES", key: 128, iv: 12, mode: "GCM", type: "auth" }, "aes-192-gcm": { cipher: "AES", key: 192, iv: 12, mode: "GCM", type: "auth" }, "aes-256-gcm": { cipher: "AES", key: 256, iv: 12, mode: "GCM", type: "auth" } }; + U$3 = { ECB: a$a, CBC: p$8, CFB: i$22, CFB8: y$4, CFB1: l$8, OFB: B$3, CTR: d$7, GCM: d$7 }; + w$6 = F$2; + for (I$4 in w$6) + w$6[I$4].module = U$3[w$6[I$4].mode]; + M$2 = w$6; + a$b = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + h$9 = {}; + o$b = u4.Buffer; + f$d = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; + u$8 = function() { + for (var t8 = new Array(256), e10 = 0; e10 < 256; e10++) + t8[e10] = e10 < 128 ? e10 << 1 : e10 << 1 ^ 283; + for (var i7 = [], r8 = [], n7 = [[], [], [], []], a7 = [[], [], [], []], h8 = 0, o7 = 0, s7 = 0; s7 < 256; ++s7) { + var c7 = o7 ^ o7 << 1 ^ o7 << 2 ^ o7 << 3 ^ o7 << 4; + c7 = c7 >>> 8 ^ 255 & c7 ^ 99, i7[h8] = c7, r8[c7] = h8; + var l7 = t8[h8], f8 = t8[l7], u7 = t8[f8], p7 = 257 * t8[c7] ^ 16843008 * c7; + n7[0][h8] = p7 << 24 | p7 >>> 8, n7[1][h8] = p7 << 16 | p7 >>> 16, n7[2][h8] = p7 << 8 | p7 >>> 24, n7[3][h8] = p7, p7 = 16843009 * u7 ^ 65537 * f8 ^ 257 * l7 ^ 16843008 * h8, a7[0][c7] = p7 << 24 | p7 >>> 8, a7[1][c7] = p7 << 16 | p7 >>> 16, a7[2][c7] = p7 << 8 | p7 >>> 24, a7[3][c7] = p7, 0 === h8 ? h8 = o7 = 1 : (h8 = l7 ^ t8[t8[t8[u7 ^ l7]]], o7 ^= t8[t8[o7]]); + } + return { SBOX: i7, INV_SBOX: r8, SUB_MIX: n7, INV_SUB_MIX: a7 }; + }(); + p$9.blockSize = 16, p$9.keySize = 32, p$9.prototype.blockSize = p$9.blockSize, p$9.prototype.keySize = p$9.keySize, p$9.prototype._reset = function() { + for (var t8 = (this || a$b)._key, e10 = t8.length, i7 = e10 + 6, r8 = 4 * (i7 + 1), n7 = [], h8 = 0; h8 < e10; h8++) + n7[h8] = t8[h8]; + for (h8 = e10; h8 < r8; h8++) { + var o7 = n7[h8 - 1]; + h8 % e10 == 0 ? (o7 = o7 << 8 | o7 >>> 24, o7 = u$8.SBOX[o7 >>> 24] << 24 | u$8.SBOX[o7 >>> 16 & 255] << 16 | u$8.SBOX[o7 >>> 8 & 255] << 8 | u$8.SBOX[255 & o7], o7 ^= f$d[h8 / e10 | 0] << 24) : e10 > 6 && h8 % e10 == 4 && (o7 = u$8.SBOX[o7 >>> 24] << 24 | u$8.SBOX[o7 >>> 16 & 255] << 16 | u$8.SBOX[o7 >>> 8 & 255] << 8 | u$8.SBOX[255 & o7]), n7[h8] = n7[h8 - e10] ^ o7; + } + for (var s7 = [], c7 = 0; c7 < r8; c7++) { + var l7 = r8 - c7, p7 = n7[l7 - (c7 % 4 ? 0 : 4)]; + s7[c7] = c7 < 4 || l7 <= 4 ? p7 : u$8.INV_SUB_MIX[0][u$8.SBOX[p7 >>> 24]] ^ u$8.INV_SUB_MIX[1][u$8.SBOX[p7 >>> 16 & 255]] ^ u$8.INV_SUB_MIX[2][u$8.SBOX[p7 >>> 8 & 255]] ^ u$8.INV_SUB_MIX[3][u$8.SBOX[255 & p7]]; + } + (this || a$b)._nRounds = i7, (this || a$b)._keySchedule = n7, (this || a$b)._invKeySchedule = s7; + }, p$9.prototype.encryptBlockRaw = function(t8) { + return l$9(t8 = s$8(t8), (this || a$b)._keySchedule, u$8.SUB_MIX, u$8.SBOX, (this || a$b)._nRounds); + }, p$9.prototype.encryptBlock = function(t8) { + var e10 = this.encryptBlockRaw(t8), i7 = o$b.allocUnsafe(16); + return i7.writeUInt32BE(e10[0], 0), i7.writeUInt32BE(e10[1], 4), i7.writeUInt32BE(e10[2], 8), i7.writeUInt32BE(e10[3], 12), i7; + }, p$9.prototype.decryptBlock = function(t8) { + var e10 = (t8 = s$8(t8))[1]; + t8[1] = t8[3], t8[3] = e10; + var i7 = l$9(t8, (this || a$b)._invKeySchedule, u$8.INV_SUB_MIX, u$8.INV_SBOX, (this || a$b)._nRounds), r8 = o$b.allocUnsafe(16); + return r8.writeUInt32BE(i7[0], 0), r8.writeUInt32BE(i7[3], 4), r8.writeUInt32BE(i7[2], 8), r8.writeUInt32BE(i7[1], 12), r8; + }, p$9.prototype.scrub = function() { + c$8((this || a$b)._keySchedule), c$8((this || a$b)._invKeySchedule), c$8((this || a$b)._key); + }, h$9.AES = p$9; + _$7 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + d$8 = u4.Buffer; + y$5 = d$8.alloc(16, 0); + g$5.prototype.ghash = function(t8) { + for (var e10 = -1; ++e10 < t8.length; ) + (this || _$7).state[e10] ^= t8[e10]; + this._multiply(); + }, g$5.prototype._multiply = function() { + for (var t8, e10, i7, r8 = [(t8 = (this || _$7).h).readUInt32BE(0), t8.readUInt32BE(4), t8.readUInt32BE(8), t8.readUInt32BE(12)], n7 = [0, 0, 0, 0], a7 = -1; ++a7 < 128; ) { + for (0 != ((this || _$7).state[~~(a7 / 8)] & 1 << 7 - a7 % 8) && (n7[0] ^= r8[0], n7[1] ^= r8[1], n7[2] ^= r8[2], n7[3] ^= r8[3]), i7 = 0 != (1 & r8[3]), e10 = 3; e10 > 0; e10--) + r8[e10] = r8[e10] >>> 1 | (1 & r8[e10 - 1]) << 31; + r8[0] = r8[0] >>> 1, i7 && (r8[0] = r8[0] ^ 225 << 24); + } + (this || _$7).state = B$4(n7); + }, g$5.prototype.update = function(t8) { + var e10; + for ((this || _$7).cache = d$8.concat([(this || _$7).cache, t8]); (this || _$7).cache.length >= 16; ) + e10 = (this || _$7).cache.slice(0, 16), (this || _$7).cache = (this || _$7).cache.slice(16), this.ghash(e10); + }, g$5.prototype.final = function(t8, e10) { + return (this || _$7).cache.length && this.ghash(d$8.concat([(this || _$7).cache, y$5], 16)), this.ghash(B$4([0, t8, 0, e10])), (this || _$7).state; + }; + S$4 = g$5; + v$5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + I$5 = h$9; + U$4 = u4.Buffer; + w$7 = f$6; + m$6 = S$4; + E$5 = f$b; + b$6 = t$12; + t$2(X$1, w$7), X$1.prototype._update = function(t8) { + if (!(this || v$5)._called && (this || v$5)._alen) { + var e10 = 16 - (this || v$5)._alen % 16; + e10 < 16 && (e10 = U$4.alloc(e10, 0), (this || v$5)._ghash.update(e10)); + } + (this || v$5)._called = true; + var i7 = (this || v$5)._mode.encrypt(this || v$5, t8); + return (this || v$5)._decrypt ? (this || v$5)._ghash.update(t8) : (this || v$5)._ghash.update(i7), (this || v$5)._len += t8.length, i7; + }, X$1.prototype._final = function() { + if ((this || v$5)._decrypt && !(this || v$5)._authTag) + throw new Error("Unsupported state or unable to authenticate data"); + var t8 = E$5((this || v$5)._ghash.final(8 * (this || v$5)._alen, 8 * (this || v$5)._len), (this || v$5)._cipher.encryptBlock((this || v$5)._finID)); + if ((this || v$5)._decrypt && function(t9, e10) { + var i7 = 0; + t9.length !== e10.length && i7++; + for (var r8 = Math.min(t9.length, e10.length), n7 = 0; n7 < r8; ++n7) + i7 += t9[n7] ^ e10[n7]; + return i7; + }(t8, (this || v$5)._authTag)) + throw new Error("Unsupported state or unable to authenticate data"); + (this || v$5)._authTag = t8, (this || v$5)._cipher.scrub(); + }, X$1.prototype.getAuthTag = function() { + if ((this || v$5)._decrypt || !U$4.isBuffer((this || v$5)._authTag)) + throw new Error("Attempting to get auth tag in unsupported state"); + return (this || v$5)._authTag; + }, X$1.prototype.setAuthTag = function(t8) { + if (!(this || v$5)._decrypt) + throw new Error("Attempting to set auth tag in unsupported state"); + (this || v$5)._authTag = t8; + }, X$1.prototype.setAAD = function(t8) { + if ((this || v$5)._called) + throw new Error("Attempting to set AAD in unsupported state"); + (this || v$5)._ghash.update(t8), (this || v$5)._alen += t8.length; + }; + k$6 = X$1; + T$2 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + O$2 = h$9; + A$4 = u4.Buffer; + M$3 = f$6; + t$2(N$1, M$3), N$1.prototype._update = function(t8) { + return (this || T$2)._mode.encrypt(this || T$2, t8, (this || T$2)._decrypt); + }, N$1.prototype._final = function() { + (this || T$2)._cipher.scrub(); + }; + V$1 = N$1; + t$22 = u4.Buffer; + f$e = u5; + a$c = function(r8, e10, a7, l7) { + if (t$22.isBuffer(r8) || (r8 = t$22.from(r8, "binary")), e10 && (t$22.isBuffer(e10) || (e10 = t$22.from(e10, "binary")), 8 !== e10.length)) + throw new RangeError("salt should be Buffer with 8 byte length"); + for (var n7 = a7 / 8, o7 = t$22.alloc(n7), i7 = t$22.alloc(l7 || 0), h8 = t$22.alloc(0); n7 > 0 || l7 > 0; ) { + var u7 = new f$e(); + u7.update(h8), u7.update(r8), e10 && u7.update(e10), h8 = u7.digest(); + var g7 = 0; + if (n7 > 0) { + var m7 = o7.length - n7; + g7 = Math.min(n7, h8.length), h8.copy(o7, m7, 0, g7), n7 -= g7; + } + if (g7 < h8.length && l7 > 0) { + var p7 = i7.length - l7, v8 = Math.min(l7, h8.length - g7); + h8.copy(i7, p7, g7, g7 + v8), l7 -= v8; + } + } + return h8.fill(0), { key: o7, iv: i7 }; + }; + c$9 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + s$9 = {}; + f$f = k$6; + p$a = u4.Buffer; + u$9 = M$2; + l$a = V$1; + d$9 = f$6; + y$6 = h$9; + m$7 = a$c; + t$2(g$6, d$9), g$6.prototype._update = function(t8) { + var e10, r8; + (this || c$9)._cache.add(t8); + for (var i7 = []; e10 = (this || c$9)._cache.get((this || c$9)._autopadding); ) + r8 = (this || c$9)._mode.decrypt(this || c$9, e10), i7.push(r8); + return p$a.concat(i7); + }, g$6.prototype._final = function() { + var t8 = (this || c$9)._cache.flush(); + if ((this || c$9)._autopadding) + return function(t9) { + var e10 = t9[15]; + if (e10 < 1 || e10 > 16) + throw new Error("unable to decrypt data"); + var r8 = -1; + for (; ++r8 < e10; ) + if (t9[r8 + (16 - e10)] !== e10) + throw new Error("unable to decrypt data"); + if (16 === e10) + return; + return t9.slice(0, 16 - e10); + }((this || c$9)._mode.decrypt(this || c$9, t8)); + if (t8) + throw new Error("data not multiple of block length"); + }, g$6.prototype.setAutoPadding = function(t8) { + return (this || c$9)._autopadding = !!t8, this || c$9; + }, v$6.prototype.add = function(t8) { + (this || c$9).cache = p$a.concat([(this || c$9).cache, t8]); + }, v$6.prototype.get = function(t8) { + var e10; + if (t8) { + if ((this || c$9).cache.length > 16) + return e10 = (this || c$9).cache.slice(0, 16), (this || c$9).cache = (this || c$9).cache.slice(16), e10; + } else if ((this || c$9).cache.length >= 16) + return e10 = (this || c$9).cache.slice(0, 16), (this || c$9).cache = (this || c$9).cache.slice(16), e10; + return null; + }, v$6.prototype.flush = function() { + if ((this || c$9).cache.length) + return (this || c$9).cache; + }, s$9.createDecipher = function(t8, e10) { + var r8 = u$9[t8.toLowerCase()]; + if (!r8) + throw new TypeError("invalid suite type"); + var i7 = m$7(e10, false, r8.key, r8.iv); + return w$8(t8, i7.key, i7.iv); + }, s$9.createDecipheriv = w$8; + c$a = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + s$a = {}; + f$g = M$2; + p$b = k$6; + l$b = u4.Buffer; + u$a = V$1; + d$a = f$6; + m$8 = h$9; + y$7 = a$c; + t$2(v$7, d$a), v$7.prototype._update = function(t8) { + var e10, r8; + (this || c$a)._cache.add(t8); + for (var i7 = []; e10 = (this || c$a)._cache.get(); ) + r8 = (this || c$a)._mode.encrypt(this || c$a, e10), i7.push(r8); + return l$b.concat(i7); + }; + _$8 = l$b.alloc(16, 16); + v$7.prototype._final = function() { + var t8 = (this || c$a)._cache.flush(); + if ((this || c$a)._autopadding) + return t8 = (this || c$a)._mode.encrypt(this || c$a, t8), (this || c$a)._cipher.scrub(), t8; + if (!t8.equals(_$8)) + throw (this || c$a)._cipher.scrub(), new Error("data not multiple of block length"); + }, v$7.prototype.setAutoPadding = function(t8) { + return (this || c$a)._autopadding = !!t8, this || c$a; + }, g$7.prototype.add = function(t8) { + (this || c$a).cache = l$b.concat([(this || c$a).cache, t8]); + }, g$7.prototype.get = function() { + if ((this || c$a).cache.length > 15) { + var t8 = (this || c$a).cache.slice(0, 16); + return (this || c$a).cache = (this || c$a).cache.slice(16), t8; + } + return null; + }, g$7.prototype.flush = function() { + for (var t8 = 16 - (this || c$a).cache.length, e10 = l$b.allocUnsafe(t8), r8 = -1; ++r8 < t8; ) + e10.writeUInt8(t8, r8); + return l$b.concat([(this || c$a).cache, e10]); + }, s$a.createCipheriv = w$9, s$a.createCipher = function(t8, e10) { + var r8 = f$g[t8.toLowerCase()]; + if (!r8) + throw new TypeError("invalid suite type"); + var i7 = y$7(e10, false, r8.key, r8.iv); + return w$9(t8, i7.key, i7.iv); + }; + t$32 = {}; + p$c = s$a; + c$b = s$9; + o$c = F$2; + t$32.createCipher = t$32.Cipher = p$c.createCipher, t$32.createCipheriv = t$32.Cipheriv = p$c.createCipheriv, t$32.createDecipher = t$32.Decipher = c$b.createDecipher, t$32.createDecipheriv = t$32.Decipheriv = c$b.createDecipheriv, t$32.listCiphers = t$32.getCiphers = function() { + return Object.keys(o$c); + }; + e$9 = { "des-ecb": { key: 8, iv: 0 } }; + e$9["des-cbc"] = e$9.des = { key: 8, iv: 8 }, e$9["des-ede3-cbc"] = e$9.des3 = { key: 24, iv: 8 }, e$9["des-ede3"] = { key: 24, iv: 0 }, e$9["des-ede-cbc"] = { key: 16, iv: 8 }, e$9["des-ede"] = { key: 16, iv: 0 }; + p$d = {}; + n$b = l$7; + s$b = t$32; + v$8 = M$2; + y$8 = e$9; + a$d = a$c; + p$d.createCipher = p$d.Cipher = function(e10, r8) { + var i7, t8; + if (e10 = e10.toLowerCase(), v$8[e10]) + i7 = v$8[e10].key, t8 = v$8[e10].iv; + else { + if (!y$8[e10]) + throw new TypeError("invalid suite type"); + i7 = 8 * y$8[e10].key, t8 = y$8[e10].iv; + } + var o7 = a$d(r8, false, i7, t8); + return f$h(e10, o7.key, o7.iv); + }, p$d.createCipheriv = p$d.Cipheriv = f$h, p$d.createDecipher = p$d.Decipher = function(e10, r8) { + var i7, t8; + if (e10 = e10.toLowerCase(), v$8[e10]) + i7 = v$8[e10].key, t8 = v$8[e10].iv; + else { + if (!y$8[e10]) + throw new TypeError("invalid suite type"); + i7 = 8 * y$8[e10].key, t8 = y$8[e10].iv; + } + var o7 = a$d(r8, false, i7, t8); + return c$c(e10, o7.key, o7.iv); + }, p$d.createDecipheriv = p$d.Decipheriv = c$c, p$d.listCiphers = p$d.getCiphers = function() { + return Object.keys(y$8).concat(s$b.getCiphers()); + }; + t$4 = Object.freeze({}); + i$3 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + r$7 = {}; + h$a = { exports: r$7 }; + !function(r8, h8) { + function n7(t8, i7) { + if (!t8) + throw new Error(i7 || "Assertion failed"); + } + function e10(t8, i7) { + t8.super_ = i7; + var r9 = function() { + }; + r9.prototype = i7.prototype, t8.prototype = new r9(), t8.prototype.constructor = t8; + } + function o7(t8, r9, h9) { + if (o7.isBN(t8)) + return t8; + (this || i$3).negative = 0, (this || i$3).words = null, (this || i$3).length = 0, (this || i$3).red = null, null !== t8 && ("le" !== r9 && "be" !== r9 || (h9 = r9, r9 = 10), this._init(t8 || 0, r9 || 10, h9 || "be")); + } + var s7; + "object" == typeof r8 ? r8.exports = o7 : h8.BN = o7, o7.BN = o7, o7.wordSize = 26; + try { + s7 = t$4.Buffer; + } catch (t8) { + } + function u7(t8, i7, r9) { + for (var h9 = 0, n8 = Math.min(t8.length, r9), e11 = i7; e11 < n8; e11++) { + var o8 = t8.charCodeAt(e11) - 48; + h9 <<= 4, h9 |= o8 >= 49 && o8 <= 54 ? o8 - 49 + 10 : o8 >= 17 && o8 <= 22 ? o8 - 17 + 10 : 15 & o8; + } + return h9; + } + function a7(t8, i7, r9, h9) { + for (var n8 = 0, e11 = Math.min(t8.length, r9), o8 = i7; o8 < e11; o8++) { + var s8 = t8.charCodeAt(o8) - 48; + n8 *= h9, n8 += s8 >= 49 ? s8 - 49 + 10 : s8 >= 17 ? s8 - 17 + 10 : s8; + } + return n8; + } + o7.isBN = function(t8) { + return t8 instanceof o7 || null !== t8 && "object" == typeof t8 && t8.constructor.wordSize === o7.wordSize && Array.isArray(t8.words); + }, o7.max = function(t8, i7) { + return t8.cmp(i7) > 0 ? t8 : i7; + }, o7.min = function(t8, i7) { + return t8.cmp(i7) < 0 ? t8 : i7; + }, o7.prototype._init = function(t8, r9, h9) { + if ("number" == typeof t8) + return this._initNumber(t8, r9, h9); + if ("object" == typeof t8) + return this._initArray(t8, r9, h9); + "hex" === r9 && (r9 = 16), n7(r9 === (0 | r9) && r9 >= 2 && r9 <= 36); + var e11 = 0; + "-" === (t8 = t8.toString().replace(/\s+/g, ""))[0] && e11++, 16 === r9 ? this._parseHex(t8, e11) : this._parseBase(t8, r9, e11), "-" === t8[0] && ((this || i$3).negative = 1), this.strip(), "le" === h9 && this._initArray(this.toArray(), r9, h9); + }, o7.prototype._initNumber = function(t8, r9, h9) { + t8 < 0 && ((this || i$3).negative = 1, t8 = -t8), t8 < 67108864 ? ((this || i$3).words = [67108863 & t8], (this || i$3).length = 1) : t8 < 4503599627370496 ? ((this || i$3).words = [67108863 & t8, t8 / 67108864 & 67108863], (this || i$3).length = 2) : (n7(t8 < 9007199254740992), (this || i$3).words = [67108863 & t8, t8 / 67108864 & 67108863, 1], (this || i$3).length = 3), "le" === h9 && this._initArray(this.toArray(), r9, h9); + }, o7.prototype._initArray = function(t8, r9, h9) { + if (n7("number" == typeof t8.length), t8.length <= 0) + return (this || i$3).words = [0], (this || i$3).length = 1, this || i$3; + (this || i$3).length = Math.ceil(t8.length / 3), (this || i$3).words = new Array((this || i$3).length); + for (var e11 = 0; e11 < (this || i$3).length; e11++) + (this || i$3).words[e11] = 0; + var o8, s8, u8 = 0; + if ("be" === h9) + for (e11 = t8.length - 1, o8 = 0; e11 >= 0; e11 -= 3) + s8 = t8[e11] | t8[e11 - 1] << 8 | t8[e11 - 2] << 16, (this || i$3).words[o8] |= s8 << u8 & 67108863, (this || i$3).words[o8 + 1] = s8 >>> 26 - u8 & 67108863, (u8 += 24) >= 26 && (u8 -= 26, o8++); + else if ("le" === h9) + for (e11 = 0, o8 = 0; e11 < t8.length; e11 += 3) + s8 = t8[e11] | t8[e11 + 1] << 8 | t8[e11 + 2] << 16, (this || i$3).words[o8] |= s8 << u8 & 67108863, (this || i$3).words[o8 + 1] = s8 >>> 26 - u8 & 67108863, (u8 += 24) >= 26 && (u8 -= 26, o8++); + return this.strip(); + }, o7.prototype._parseHex = function(t8, r9) { + (this || i$3).length = Math.ceil((t8.length - r9) / 6), (this || i$3).words = new Array((this || i$3).length); + for (var h9 = 0; h9 < (this || i$3).length; h9++) + (this || i$3).words[h9] = 0; + var n8, e11, o8 = 0; + for (h9 = t8.length - 6, n8 = 0; h9 >= r9; h9 -= 6) + e11 = u7(t8, h9, h9 + 6), (this || i$3).words[n8] |= e11 << o8 & 67108863, (this || i$3).words[n8 + 1] |= e11 >>> 26 - o8 & 4194303, (o8 += 24) >= 26 && (o8 -= 26, n8++); + h9 + 6 !== r9 && (e11 = u7(t8, r9, h9 + 6), (this || i$3).words[n8] |= e11 << o8 & 67108863, (this || i$3).words[n8 + 1] |= e11 >>> 26 - o8 & 4194303), this.strip(); + }, o7.prototype._parseBase = function(t8, r9, h9) { + (this || i$3).words = [0], (this || i$3).length = 1; + for (var n8 = 0, e11 = 1; e11 <= 67108863; e11 *= r9) + n8++; + n8--, e11 = e11 / r9 | 0; + for (var o8 = t8.length - h9, s8 = o8 % n8, u8 = Math.min(o8, o8 - s8) + h9, l8 = 0, m8 = h9; m8 < u8; m8 += n8) + l8 = a7(t8, m8, m8 + n8, r9), this.imuln(e11), (this || i$3).words[0] + l8 < 67108864 ? (this || i$3).words[0] += l8 : this._iaddn(l8); + if (0 !== s8) { + var f9 = 1; + for (l8 = a7(t8, m8, t8.length, r9), m8 = 0; m8 < s8; m8++) + f9 *= r9; + this.imuln(f9), (this || i$3).words[0] + l8 < 67108864 ? (this || i$3).words[0] += l8 : this._iaddn(l8); + } + }, o7.prototype.copy = function(t8) { + t8.words = new Array((this || i$3).length); + for (var r9 = 0; r9 < (this || i$3).length; r9++) + t8.words[r9] = (this || i$3).words[r9]; + t8.length = (this || i$3).length, t8.negative = (this || i$3).negative, t8.red = (this || i$3).red; + }, o7.prototype.clone = function() { + var t8 = new o7(null); + return this.copy(t8), t8; + }, o7.prototype._expand = function(t8) { + for (; (this || i$3).length < t8; ) + (this || i$3).words[(this || i$3).length++] = 0; + return this || i$3; + }, o7.prototype.strip = function() { + for (; (this || i$3).length > 1 && 0 === (this || i$3).words[(this || i$3).length - 1]; ) + (this || i$3).length--; + return this._normSign(); + }, o7.prototype._normSign = function() { + return 1 === (this || i$3).length && 0 === (this || i$3).words[0] && ((this || i$3).negative = 0), this || i$3; + }, o7.prototype.inspect = function() { + return ((this || i$3).red ? ""; + }; + var l7 = ["", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000"], m7 = [0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5], f8 = [0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176]; + function d7(t8, i7, r9) { + r9.negative = i7.negative ^ t8.negative; + var h9 = t8.length + i7.length | 0; + r9.length = h9, h9 = h9 - 1 | 0; + var n8 = 0 | t8.words[0], e11 = 0 | i7.words[0], o8 = n8 * e11, s8 = 67108863 & o8, u8 = o8 / 67108864 | 0; + r9.words[0] = s8; + for (var a8 = 1; a8 < h9; a8++) { + for (var l8 = u8 >>> 26, m8 = 67108863 & u8, f9 = Math.min(a8, i7.length - 1), d8 = Math.max(0, a8 - t8.length + 1); d8 <= f9; d8++) { + var p8 = a8 - d8 | 0; + l8 += (o8 = (n8 = 0 | t8.words[p8]) * (e11 = 0 | i7.words[d8]) + m8) / 67108864 | 0, m8 = 67108863 & o8; + } + r9.words[a8] = 0 | m8, u8 = 0 | l8; + } + return 0 !== u8 ? r9.words[a8] = 0 | u8 : r9.length--, r9.strip(); + } + o7.prototype.toString = function(t8, r9) { + var h9; + if (r9 = 0 | r9 || 1, 16 === (t8 = t8 || 10) || "hex" === t8) { + h9 = ""; + for (var e11 = 0, o8 = 0, s8 = 0; s8 < (this || i$3).length; s8++) { + var u8 = (this || i$3).words[s8], a8 = (16777215 & (u8 << e11 | o8)).toString(16); + h9 = 0 !== (o8 = u8 >>> 24 - e11 & 16777215) || s8 !== (this || i$3).length - 1 ? l7[6 - a8.length] + a8 + h9 : a8 + h9, (e11 += 2) >= 26 && (e11 -= 26, s8--); + } + for (0 !== o8 && (h9 = o8.toString(16) + h9); h9.length % r9 != 0; ) + h9 = "0" + h9; + return 0 !== (this || i$3).negative && (h9 = "-" + h9), h9; + } + if (t8 === (0 | t8) && t8 >= 2 && t8 <= 36) { + var d8 = m7[t8], p8 = f8[t8]; + h9 = ""; + var M7 = this.clone(); + for (M7.negative = 0; !M7.isZero(); ) { + var v9 = M7.modn(p8).toString(t8); + h9 = (M7 = M7.idivn(p8)).isZero() ? v9 + h9 : l7[d8 - v9.length] + v9 + h9; + } + for (this.isZero() && (h9 = "0" + h9); h9.length % r9 != 0; ) + h9 = "0" + h9; + return 0 !== (this || i$3).negative && (h9 = "-" + h9), h9; + } + n7(false, "Base should be between 2 and 36"); + }, o7.prototype.toNumber = function() { + var t8 = (this || i$3).words[0]; + return 2 === (this || i$3).length ? t8 += 67108864 * (this || i$3).words[1] : 3 === (this || i$3).length && 1 === (this || i$3).words[2] ? t8 += 4503599627370496 + 67108864 * (this || i$3).words[1] : (this || i$3).length > 2 && n7(false, "Number can only safely store up to 53 bits"), 0 !== (this || i$3).negative ? -t8 : t8; + }, o7.prototype.toJSON = function() { + return this.toString(16); + }, o7.prototype.toBuffer = function(t8, i7) { + return n7(void 0 !== s7), this.toArrayLike(s7, t8, i7); + }, o7.prototype.toArray = function(t8, i7) { + return this.toArrayLike(Array, t8, i7); + }, o7.prototype.toArrayLike = function(t8, i7, r9) { + var h9 = this.byteLength(), e11 = r9 || Math.max(1, h9); + n7(h9 <= e11, "byte array longer than desired length"), n7(e11 > 0, "Requested array length <= 0"), this.strip(); + var o8, s8, u8 = "le" === i7, a8 = new t8(e11), l8 = this.clone(); + if (u8) { + for (s8 = 0; !l8.isZero(); s8++) + o8 = l8.andln(255), l8.iushrn(8), a8[s8] = o8; + for (; s8 < e11; s8++) + a8[s8] = 0; + } else { + for (s8 = 0; s8 < e11 - h9; s8++) + a8[s8] = 0; + for (s8 = 0; !l8.isZero(); s8++) + o8 = l8.andln(255), l8.iushrn(8), a8[e11 - s8 - 1] = o8; + } + return a8; + }, Math.clz32 ? o7.prototype._countBits = function(t8) { + return 32 - Math.clz32(t8); + } : o7.prototype._countBits = function(t8) { + var i7 = t8, r9 = 0; + return i7 >= 4096 && (r9 += 13, i7 >>>= 13), i7 >= 64 && (r9 += 7, i7 >>>= 7), i7 >= 8 && (r9 += 4, i7 >>>= 4), i7 >= 2 && (r9 += 2, i7 >>>= 2), r9 + i7; + }, o7.prototype._zeroBits = function(t8) { + if (0 === t8) + return 26; + var i7 = t8, r9 = 0; + return 0 == (8191 & i7) && (r9 += 13, i7 >>>= 13), 0 == (127 & i7) && (r9 += 7, i7 >>>= 7), 0 == (15 & i7) && (r9 += 4, i7 >>>= 4), 0 == (3 & i7) && (r9 += 2, i7 >>>= 2), 0 == (1 & i7) && r9++, r9; + }, o7.prototype.bitLength = function() { + var t8 = (this || i$3).words[(this || i$3).length - 1], r9 = this._countBits(t8); + return 26 * ((this || i$3).length - 1) + r9; + }, o7.prototype.zeroBits = function() { + if (this.isZero()) + return 0; + for (var t8 = 0, r9 = 0; r9 < (this || i$3).length; r9++) { + var h9 = this._zeroBits((this || i$3).words[r9]); + if (t8 += h9, 26 !== h9) + break; + } + return t8; + }, o7.prototype.byteLength = function() { + return Math.ceil(this.bitLength() / 8); + }, o7.prototype.toTwos = function(t8) { + return 0 !== (this || i$3).negative ? this.abs().inotn(t8).iaddn(1) : this.clone(); + }, o7.prototype.fromTwos = function(t8) { + return this.testn(t8 - 1) ? this.notn(t8).iaddn(1).ineg() : this.clone(); + }, o7.prototype.isNeg = function() { + return 0 !== (this || i$3).negative; + }, o7.prototype.neg = function() { + return this.clone().ineg(); + }, o7.prototype.ineg = function() { + return this.isZero() || ((this || i$3).negative ^= 1), this || i$3; + }, o7.prototype.iuor = function(t8) { + for (; (this || i$3).length < t8.length; ) + (this || i$3).words[(this || i$3).length++] = 0; + for (var r9 = 0; r9 < t8.length; r9++) + (this || i$3).words[r9] = (this || i$3).words[r9] | t8.words[r9]; + return this.strip(); + }, o7.prototype.ior = function(t8) { + return n7(0 == ((this || i$3).negative | t8.negative)), this.iuor(t8); + }, o7.prototype.or = function(t8) { + return (this || i$3).length > t8.length ? this.clone().ior(t8) : t8.clone().ior(this || i$3); + }, o7.prototype.uor = function(t8) { + return (this || i$3).length > t8.length ? this.clone().iuor(t8) : t8.clone().iuor(this || i$3); + }, o7.prototype.iuand = function(t8) { + var r9; + r9 = (this || i$3).length > t8.length ? t8 : this || i$3; + for (var h9 = 0; h9 < r9.length; h9++) + (this || i$3).words[h9] = (this || i$3).words[h9] & t8.words[h9]; + return (this || i$3).length = r9.length, this.strip(); + }, o7.prototype.iand = function(t8) { + return n7(0 == ((this || i$3).negative | t8.negative)), this.iuand(t8); + }, o7.prototype.and = function(t8) { + return (this || i$3).length > t8.length ? this.clone().iand(t8) : t8.clone().iand(this || i$3); + }, o7.prototype.uand = function(t8) { + return (this || i$3).length > t8.length ? this.clone().iuand(t8) : t8.clone().iuand(this || i$3); + }, o7.prototype.iuxor = function(t8) { + var r9, h9; + (this || i$3).length > t8.length ? (r9 = this || i$3, h9 = t8) : (r9 = t8, h9 = this || i$3); + for (var n8 = 0; n8 < h9.length; n8++) + (this || i$3).words[n8] = r9.words[n8] ^ h9.words[n8]; + if ((this || i$3) !== r9) + for (; n8 < r9.length; n8++) + (this || i$3).words[n8] = r9.words[n8]; + return (this || i$3).length = r9.length, this.strip(); + }, o7.prototype.ixor = function(t8) { + return n7(0 == ((this || i$3).negative | t8.negative)), this.iuxor(t8); + }, o7.prototype.xor = function(t8) { + return (this || i$3).length > t8.length ? this.clone().ixor(t8) : t8.clone().ixor(this || i$3); + }, o7.prototype.uxor = function(t8) { + return (this || i$3).length > t8.length ? this.clone().iuxor(t8) : t8.clone().iuxor(this || i$3); + }, o7.prototype.inotn = function(t8) { + n7("number" == typeof t8 && t8 >= 0); + var r9 = 0 | Math.ceil(t8 / 26), h9 = t8 % 26; + this._expand(r9), h9 > 0 && r9--; + for (var e11 = 0; e11 < r9; e11++) + (this || i$3).words[e11] = 67108863 & ~(this || i$3).words[e11]; + return h9 > 0 && ((this || i$3).words[e11] = ~(this || i$3).words[e11] & 67108863 >> 26 - h9), this.strip(); + }, o7.prototype.notn = function(t8) { + return this.clone().inotn(t8); + }, o7.prototype.setn = function(t8, r9) { + n7("number" == typeof t8 && t8 >= 0); + var h9 = t8 / 26 | 0, e11 = t8 % 26; + return this._expand(h9 + 1), (this || i$3).words[h9] = r9 ? (this || i$3).words[h9] | 1 << e11 : (this || i$3).words[h9] & ~(1 << e11), this.strip(); + }, o7.prototype.iadd = function(t8) { + var r9, h9, n8; + if (0 !== (this || i$3).negative && 0 === t8.negative) + return (this || i$3).negative = 0, r9 = this.isub(t8), (this || i$3).negative ^= 1, this._normSign(); + if (0 === (this || i$3).negative && 0 !== t8.negative) + return t8.negative = 0, r9 = this.isub(t8), t8.negative = 1, r9._normSign(); + (this || i$3).length > t8.length ? (h9 = this || i$3, n8 = t8) : (h9 = t8, n8 = this || i$3); + for (var e11 = 0, o8 = 0; o8 < n8.length; o8++) + r9 = (0 | h9.words[o8]) + (0 | n8.words[o8]) + e11, (this || i$3).words[o8] = 67108863 & r9, e11 = r9 >>> 26; + for (; 0 !== e11 && o8 < h9.length; o8++) + r9 = (0 | h9.words[o8]) + e11, (this || i$3).words[o8] = 67108863 & r9, e11 = r9 >>> 26; + if ((this || i$3).length = h9.length, 0 !== e11) + (this || i$3).words[(this || i$3).length] = e11, (this || i$3).length++; + else if (h9 !== (this || i$3)) + for (; o8 < h9.length; o8++) + (this || i$3).words[o8] = h9.words[o8]; + return this || i$3; + }, o7.prototype.add = function(t8) { + var r9; + return 0 !== t8.negative && 0 === (this || i$3).negative ? (t8.negative = 0, r9 = this.sub(t8), t8.negative ^= 1, r9) : 0 === t8.negative && 0 !== (this || i$3).negative ? ((this || i$3).negative = 0, r9 = t8.sub(this || i$3), (this || i$3).negative = 1, r9) : (this || i$3).length > t8.length ? this.clone().iadd(t8) : t8.clone().iadd(this || i$3); + }, o7.prototype.isub = function(t8) { + if (0 !== t8.negative) { + t8.negative = 0; + var r9 = this.iadd(t8); + return t8.negative = 1, r9._normSign(); + } + if (0 !== (this || i$3).negative) + return (this || i$3).negative = 0, this.iadd(t8), (this || i$3).negative = 1, this._normSign(); + var h9, n8, e11 = this.cmp(t8); + if (0 === e11) + return (this || i$3).negative = 0, (this || i$3).length = 1, (this || i$3).words[0] = 0, this || i$3; + e11 > 0 ? (h9 = this || i$3, n8 = t8) : (h9 = t8, n8 = this || i$3); + for (var o8 = 0, s8 = 0; s8 < n8.length; s8++) + o8 = (r9 = (0 | h9.words[s8]) - (0 | n8.words[s8]) + o8) >> 26, (this || i$3).words[s8] = 67108863 & r9; + for (; 0 !== o8 && s8 < h9.length; s8++) + o8 = (r9 = (0 | h9.words[s8]) + o8) >> 26, (this || i$3).words[s8] = 67108863 & r9; + if (0 === o8 && s8 < h9.length && h9 !== (this || i$3)) + for (; s8 < h9.length; s8++) + (this || i$3).words[s8] = h9.words[s8]; + return (this || i$3).length = Math.max((this || i$3).length, s8), h9 !== (this || i$3) && ((this || i$3).negative = 1), this.strip(); + }, o7.prototype.sub = function(t8) { + return this.clone().isub(t8); + }; + var p7 = function(t8, i7, r9) { + var h9, n8, e11, o8 = t8.words, s8 = i7.words, u8 = r9.words, a8 = 0, l8 = 0 | o8[0], m8 = 8191 & l8, f9 = l8 >>> 13, d8 = 0 | o8[1], p8 = 8191 & d8, M7 = d8 >>> 13, v9 = 0 | o8[2], g8 = 8191 & v9, c8 = v9 >>> 13, w7 = 0 | o8[3], y8 = 8191 & w7, b9 = w7 >>> 13, _7 = 0 | o8[4], k7 = 8191 & _7, A7 = _7 >>> 13, x7 = 0 | o8[5], S6 = 8191 & x7, Z5 = x7 >>> 13, R6 = 0 | o8[6], q5 = 8191 & R6, B6 = R6 >>> 13, N6 = 0 | o8[7], L6 = 8191 & N6, I6 = N6 >>> 13, T6 = 0 | o8[8], z6 = 8191 & T6, E6 = T6 >>> 13, O7 = 0 | o8[9], j6 = 8191 & O7, K5 = O7 >>> 13, P6 = 0 | s8[0], F6 = 8191 & P6, C6 = P6 >>> 13, D6 = 0 | s8[1], H5 = 8191 & D6, J5 = D6 >>> 13, U6 = 0 | s8[2], G5 = 8191 & U6, Q5 = U6 >>> 13, V5 = 0 | s8[3], W5 = 8191 & V5, X5 = V5 >>> 13, Y6 = 0 | s8[4], $5 = 8191 & Y6, tt3 = Y6 >>> 13, it2 = 0 | s8[5], rt = 8191 & it2, ht2 = it2 >>> 13, nt2 = 0 | s8[6], et3 = 8191 & nt2, ot = nt2 >>> 13, st2 = 0 | s8[7], ut = 8191 & st2, at2 = st2 >>> 13, lt2 = 0 | s8[8], mt = 8191 & lt2, ft = lt2 >>> 13, dt = 0 | s8[9], pt = 8191 & dt, Mt = dt >>> 13; + r9.negative = t8.negative ^ i7.negative, r9.length = 19; + var vt = (a8 + (h9 = Math.imul(m8, F6)) | 0) + ((8191 & (n8 = (n8 = Math.imul(m8, C6)) + Math.imul(f9, F6) | 0)) << 13) | 0; + a8 = ((e11 = Math.imul(f9, C6)) + (n8 >>> 13) | 0) + (vt >>> 26) | 0, vt &= 67108863, h9 = Math.imul(p8, F6), n8 = (n8 = Math.imul(p8, C6)) + Math.imul(M7, F6) | 0, e11 = Math.imul(M7, C6); + var gt2 = (a8 + (h9 = h9 + Math.imul(m8, H5) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, J5) | 0) + Math.imul(f9, H5) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, J5) | 0) + (n8 >>> 13) | 0) + (gt2 >>> 26) | 0, gt2 &= 67108863, h9 = Math.imul(g8, F6), n8 = (n8 = Math.imul(g8, C6)) + Math.imul(c8, F6) | 0, e11 = Math.imul(c8, C6), h9 = h9 + Math.imul(p8, H5) | 0, n8 = (n8 = n8 + Math.imul(p8, J5) | 0) + Math.imul(M7, H5) | 0, e11 = e11 + Math.imul(M7, J5) | 0; + var ct = (a8 + (h9 = h9 + Math.imul(m8, G5) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, Q5) | 0) + Math.imul(f9, G5) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, Q5) | 0) + (n8 >>> 13) | 0) + (ct >>> 26) | 0, ct &= 67108863, h9 = Math.imul(y8, F6), n8 = (n8 = Math.imul(y8, C6)) + Math.imul(b9, F6) | 0, e11 = Math.imul(b9, C6), h9 = h9 + Math.imul(g8, H5) | 0, n8 = (n8 = n8 + Math.imul(g8, J5) | 0) + Math.imul(c8, H5) | 0, e11 = e11 + Math.imul(c8, J5) | 0, h9 = h9 + Math.imul(p8, G5) | 0, n8 = (n8 = n8 + Math.imul(p8, Q5) | 0) + Math.imul(M7, G5) | 0, e11 = e11 + Math.imul(M7, Q5) | 0; + var wt = (a8 + (h9 = h9 + Math.imul(m8, W5) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, X5) | 0) + Math.imul(f9, W5) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, X5) | 0) + (n8 >>> 13) | 0) + (wt >>> 26) | 0, wt &= 67108863, h9 = Math.imul(k7, F6), n8 = (n8 = Math.imul(k7, C6)) + Math.imul(A7, F6) | 0, e11 = Math.imul(A7, C6), h9 = h9 + Math.imul(y8, H5) | 0, n8 = (n8 = n8 + Math.imul(y8, J5) | 0) + Math.imul(b9, H5) | 0, e11 = e11 + Math.imul(b9, J5) | 0, h9 = h9 + Math.imul(g8, G5) | 0, n8 = (n8 = n8 + Math.imul(g8, Q5) | 0) + Math.imul(c8, G5) | 0, e11 = e11 + Math.imul(c8, Q5) | 0, h9 = h9 + Math.imul(p8, W5) | 0, n8 = (n8 = n8 + Math.imul(p8, X5) | 0) + Math.imul(M7, W5) | 0, e11 = e11 + Math.imul(M7, X5) | 0; + var yt = (a8 + (h9 = h9 + Math.imul(m8, $5) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, tt3) | 0) + Math.imul(f9, $5) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, tt3) | 0) + (n8 >>> 13) | 0) + (yt >>> 26) | 0, yt &= 67108863, h9 = Math.imul(S6, F6), n8 = (n8 = Math.imul(S6, C6)) + Math.imul(Z5, F6) | 0, e11 = Math.imul(Z5, C6), h9 = h9 + Math.imul(k7, H5) | 0, n8 = (n8 = n8 + Math.imul(k7, J5) | 0) + Math.imul(A7, H5) | 0, e11 = e11 + Math.imul(A7, J5) | 0, h9 = h9 + Math.imul(y8, G5) | 0, n8 = (n8 = n8 + Math.imul(y8, Q5) | 0) + Math.imul(b9, G5) | 0, e11 = e11 + Math.imul(b9, Q5) | 0, h9 = h9 + Math.imul(g8, W5) | 0, n8 = (n8 = n8 + Math.imul(g8, X5) | 0) + Math.imul(c8, W5) | 0, e11 = e11 + Math.imul(c8, X5) | 0, h9 = h9 + Math.imul(p8, $5) | 0, n8 = (n8 = n8 + Math.imul(p8, tt3) | 0) + Math.imul(M7, $5) | 0, e11 = e11 + Math.imul(M7, tt3) | 0; + var bt = (a8 + (h9 = h9 + Math.imul(m8, rt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, ht2) | 0) + Math.imul(f9, rt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, ht2) | 0) + (n8 >>> 13) | 0) + (bt >>> 26) | 0, bt &= 67108863, h9 = Math.imul(q5, F6), n8 = (n8 = Math.imul(q5, C6)) + Math.imul(B6, F6) | 0, e11 = Math.imul(B6, C6), h9 = h9 + Math.imul(S6, H5) | 0, n8 = (n8 = n8 + Math.imul(S6, J5) | 0) + Math.imul(Z5, H5) | 0, e11 = e11 + Math.imul(Z5, J5) | 0, h9 = h9 + Math.imul(k7, G5) | 0, n8 = (n8 = n8 + Math.imul(k7, Q5) | 0) + Math.imul(A7, G5) | 0, e11 = e11 + Math.imul(A7, Q5) | 0, h9 = h9 + Math.imul(y8, W5) | 0, n8 = (n8 = n8 + Math.imul(y8, X5) | 0) + Math.imul(b9, W5) | 0, e11 = e11 + Math.imul(b9, X5) | 0, h9 = h9 + Math.imul(g8, $5) | 0, n8 = (n8 = n8 + Math.imul(g8, tt3) | 0) + Math.imul(c8, $5) | 0, e11 = e11 + Math.imul(c8, tt3) | 0, h9 = h9 + Math.imul(p8, rt) | 0, n8 = (n8 = n8 + Math.imul(p8, ht2) | 0) + Math.imul(M7, rt) | 0, e11 = e11 + Math.imul(M7, ht2) | 0; + var _t2 = (a8 + (h9 = h9 + Math.imul(m8, et3) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, ot) | 0) + Math.imul(f9, et3) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, ot) | 0) + (n8 >>> 13) | 0) + (_t2 >>> 26) | 0, _t2 &= 67108863, h9 = Math.imul(L6, F6), n8 = (n8 = Math.imul(L6, C6)) + Math.imul(I6, F6) | 0, e11 = Math.imul(I6, C6), h9 = h9 + Math.imul(q5, H5) | 0, n8 = (n8 = n8 + Math.imul(q5, J5) | 0) + Math.imul(B6, H5) | 0, e11 = e11 + Math.imul(B6, J5) | 0, h9 = h9 + Math.imul(S6, G5) | 0, n8 = (n8 = n8 + Math.imul(S6, Q5) | 0) + Math.imul(Z5, G5) | 0, e11 = e11 + Math.imul(Z5, Q5) | 0, h9 = h9 + Math.imul(k7, W5) | 0, n8 = (n8 = n8 + Math.imul(k7, X5) | 0) + Math.imul(A7, W5) | 0, e11 = e11 + Math.imul(A7, X5) | 0, h9 = h9 + Math.imul(y8, $5) | 0, n8 = (n8 = n8 + Math.imul(y8, tt3) | 0) + Math.imul(b9, $5) | 0, e11 = e11 + Math.imul(b9, tt3) | 0, h9 = h9 + Math.imul(g8, rt) | 0, n8 = (n8 = n8 + Math.imul(g8, ht2) | 0) + Math.imul(c8, rt) | 0, e11 = e11 + Math.imul(c8, ht2) | 0, h9 = h9 + Math.imul(p8, et3) | 0, n8 = (n8 = n8 + Math.imul(p8, ot) | 0) + Math.imul(M7, et3) | 0, e11 = e11 + Math.imul(M7, ot) | 0; + var kt = (a8 + (h9 = h9 + Math.imul(m8, ut) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, at2) | 0) + Math.imul(f9, ut) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, at2) | 0) + (n8 >>> 13) | 0) + (kt >>> 26) | 0, kt &= 67108863, h9 = Math.imul(z6, F6), n8 = (n8 = Math.imul(z6, C6)) + Math.imul(E6, F6) | 0, e11 = Math.imul(E6, C6), h9 = h9 + Math.imul(L6, H5) | 0, n8 = (n8 = n8 + Math.imul(L6, J5) | 0) + Math.imul(I6, H5) | 0, e11 = e11 + Math.imul(I6, J5) | 0, h9 = h9 + Math.imul(q5, G5) | 0, n8 = (n8 = n8 + Math.imul(q5, Q5) | 0) + Math.imul(B6, G5) | 0, e11 = e11 + Math.imul(B6, Q5) | 0, h9 = h9 + Math.imul(S6, W5) | 0, n8 = (n8 = n8 + Math.imul(S6, X5) | 0) + Math.imul(Z5, W5) | 0, e11 = e11 + Math.imul(Z5, X5) | 0, h9 = h9 + Math.imul(k7, $5) | 0, n8 = (n8 = n8 + Math.imul(k7, tt3) | 0) + Math.imul(A7, $5) | 0, e11 = e11 + Math.imul(A7, tt3) | 0, h9 = h9 + Math.imul(y8, rt) | 0, n8 = (n8 = n8 + Math.imul(y8, ht2) | 0) + Math.imul(b9, rt) | 0, e11 = e11 + Math.imul(b9, ht2) | 0, h9 = h9 + Math.imul(g8, et3) | 0, n8 = (n8 = n8 + Math.imul(g8, ot) | 0) + Math.imul(c8, et3) | 0, e11 = e11 + Math.imul(c8, ot) | 0, h9 = h9 + Math.imul(p8, ut) | 0, n8 = (n8 = n8 + Math.imul(p8, at2) | 0) + Math.imul(M7, ut) | 0, e11 = e11 + Math.imul(M7, at2) | 0; + var At = (a8 + (h9 = h9 + Math.imul(m8, mt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, ft) | 0) + Math.imul(f9, mt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, ft) | 0) + (n8 >>> 13) | 0) + (At >>> 26) | 0, At &= 67108863, h9 = Math.imul(j6, F6), n8 = (n8 = Math.imul(j6, C6)) + Math.imul(K5, F6) | 0, e11 = Math.imul(K5, C6), h9 = h9 + Math.imul(z6, H5) | 0, n8 = (n8 = n8 + Math.imul(z6, J5) | 0) + Math.imul(E6, H5) | 0, e11 = e11 + Math.imul(E6, J5) | 0, h9 = h9 + Math.imul(L6, G5) | 0, n8 = (n8 = n8 + Math.imul(L6, Q5) | 0) + Math.imul(I6, G5) | 0, e11 = e11 + Math.imul(I6, Q5) | 0, h9 = h9 + Math.imul(q5, W5) | 0, n8 = (n8 = n8 + Math.imul(q5, X5) | 0) + Math.imul(B6, W5) | 0, e11 = e11 + Math.imul(B6, X5) | 0, h9 = h9 + Math.imul(S6, $5) | 0, n8 = (n8 = n8 + Math.imul(S6, tt3) | 0) + Math.imul(Z5, $5) | 0, e11 = e11 + Math.imul(Z5, tt3) | 0, h9 = h9 + Math.imul(k7, rt) | 0, n8 = (n8 = n8 + Math.imul(k7, ht2) | 0) + Math.imul(A7, rt) | 0, e11 = e11 + Math.imul(A7, ht2) | 0, h9 = h9 + Math.imul(y8, et3) | 0, n8 = (n8 = n8 + Math.imul(y8, ot) | 0) + Math.imul(b9, et3) | 0, e11 = e11 + Math.imul(b9, ot) | 0, h9 = h9 + Math.imul(g8, ut) | 0, n8 = (n8 = n8 + Math.imul(g8, at2) | 0) + Math.imul(c8, ut) | 0, e11 = e11 + Math.imul(c8, at2) | 0, h9 = h9 + Math.imul(p8, mt) | 0, n8 = (n8 = n8 + Math.imul(p8, ft) | 0) + Math.imul(M7, mt) | 0, e11 = e11 + Math.imul(M7, ft) | 0; + var xt = (a8 + (h9 = h9 + Math.imul(m8, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(m8, Mt) | 0) + Math.imul(f9, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(f9, Mt) | 0) + (n8 >>> 13) | 0) + (xt >>> 26) | 0, xt &= 67108863, h9 = Math.imul(j6, H5), n8 = (n8 = Math.imul(j6, J5)) + Math.imul(K5, H5) | 0, e11 = Math.imul(K5, J5), h9 = h9 + Math.imul(z6, G5) | 0, n8 = (n8 = n8 + Math.imul(z6, Q5) | 0) + Math.imul(E6, G5) | 0, e11 = e11 + Math.imul(E6, Q5) | 0, h9 = h9 + Math.imul(L6, W5) | 0, n8 = (n8 = n8 + Math.imul(L6, X5) | 0) + Math.imul(I6, W5) | 0, e11 = e11 + Math.imul(I6, X5) | 0, h9 = h9 + Math.imul(q5, $5) | 0, n8 = (n8 = n8 + Math.imul(q5, tt3) | 0) + Math.imul(B6, $5) | 0, e11 = e11 + Math.imul(B6, tt3) | 0, h9 = h9 + Math.imul(S6, rt) | 0, n8 = (n8 = n8 + Math.imul(S6, ht2) | 0) + Math.imul(Z5, rt) | 0, e11 = e11 + Math.imul(Z5, ht2) | 0, h9 = h9 + Math.imul(k7, et3) | 0, n8 = (n8 = n8 + Math.imul(k7, ot) | 0) + Math.imul(A7, et3) | 0, e11 = e11 + Math.imul(A7, ot) | 0, h9 = h9 + Math.imul(y8, ut) | 0, n8 = (n8 = n8 + Math.imul(y8, at2) | 0) + Math.imul(b9, ut) | 0, e11 = e11 + Math.imul(b9, at2) | 0, h9 = h9 + Math.imul(g8, mt) | 0, n8 = (n8 = n8 + Math.imul(g8, ft) | 0) + Math.imul(c8, mt) | 0, e11 = e11 + Math.imul(c8, ft) | 0; + var St = (a8 + (h9 = h9 + Math.imul(p8, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(p8, Mt) | 0) + Math.imul(M7, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(M7, Mt) | 0) + (n8 >>> 13) | 0) + (St >>> 26) | 0, St &= 67108863, h9 = Math.imul(j6, G5), n8 = (n8 = Math.imul(j6, Q5)) + Math.imul(K5, G5) | 0, e11 = Math.imul(K5, Q5), h9 = h9 + Math.imul(z6, W5) | 0, n8 = (n8 = n8 + Math.imul(z6, X5) | 0) + Math.imul(E6, W5) | 0, e11 = e11 + Math.imul(E6, X5) | 0, h9 = h9 + Math.imul(L6, $5) | 0, n8 = (n8 = n8 + Math.imul(L6, tt3) | 0) + Math.imul(I6, $5) | 0, e11 = e11 + Math.imul(I6, tt3) | 0, h9 = h9 + Math.imul(q5, rt) | 0, n8 = (n8 = n8 + Math.imul(q5, ht2) | 0) + Math.imul(B6, rt) | 0, e11 = e11 + Math.imul(B6, ht2) | 0, h9 = h9 + Math.imul(S6, et3) | 0, n8 = (n8 = n8 + Math.imul(S6, ot) | 0) + Math.imul(Z5, et3) | 0, e11 = e11 + Math.imul(Z5, ot) | 0, h9 = h9 + Math.imul(k7, ut) | 0, n8 = (n8 = n8 + Math.imul(k7, at2) | 0) + Math.imul(A7, ut) | 0, e11 = e11 + Math.imul(A7, at2) | 0, h9 = h9 + Math.imul(y8, mt) | 0, n8 = (n8 = n8 + Math.imul(y8, ft) | 0) + Math.imul(b9, mt) | 0, e11 = e11 + Math.imul(b9, ft) | 0; + var Zt = (a8 + (h9 = h9 + Math.imul(g8, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(g8, Mt) | 0) + Math.imul(c8, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(c8, Mt) | 0) + (n8 >>> 13) | 0) + (Zt >>> 26) | 0, Zt &= 67108863, h9 = Math.imul(j6, W5), n8 = (n8 = Math.imul(j6, X5)) + Math.imul(K5, W5) | 0, e11 = Math.imul(K5, X5), h9 = h9 + Math.imul(z6, $5) | 0, n8 = (n8 = n8 + Math.imul(z6, tt3) | 0) + Math.imul(E6, $5) | 0, e11 = e11 + Math.imul(E6, tt3) | 0, h9 = h9 + Math.imul(L6, rt) | 0, n8 = (n8 = n8 + Math.imul(L6, ht2) | 0) + Math.imul(I6, rt) | 0, e11 = e11 + Math.imul(I6, ht2) | 0, h9 = h9 + Math.imul(q5, et3) | 0, n8 = (n8 = n8 + Math.imul(q5, ot) | 0) + Math.imul(B6, et3) | 0, e11 = e11 + Math.imul(B6, ot) | 0, h9 = h9 + Math.imul(S6, ut) | 0, n8 = (n8 = n8 + Math.imul(S6, at2) | 0) + Math.imul(Z5, ut) | 0, e11 = e11 + Math.imul(Z5, at2) | 0, h9 = h9 + Math.imul(k7, mt) | 0, n8 = (n8 = n8 + Math.imul(k7, ft) | 0) + Math.imul(A7, mt) | 0, e11 = e11 + Math.imul(A7, ft) | 0; + var Rt = (a8 + (h9 = h9 + Math.imul(y8, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(y8, Mt) | 0) + Math.imul(b9, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(b9, Mt) | 0) + (n8 >>> 13) | 0) + (Rt >>> 26) | 0, Rt &= 67108863, h9 = Math.imul(j6, $5), n8 = (n8 = Math.imul(j6, tt3)) + Math.imul(K5, $5) | 0, e11 = Math.imul(K5, tt3), h9 = h9 + Math.imul(z6, rt) | 0, n8 = (n8 = n8 + Math.imul(z6, ht2) | 0) + Math.imul(E6, rt) | 0, e11 = e11 + Math.imul(E6, ht2) | 0, h9 = h9 + Math.imul(L6, et3) | 0, n8 = (n8 = n8 + Math.imul(L6, ot) | 0) + Math.imul(I6, et3) | 0, e11 = e11 + Math.imul(I6, ot) | 0, h9 = h9 + Math.imul(q5, ut) | 0, n8 = (n8 = n8 + Math.imul(q5, at2) | 0) + Math.imul(B6, ut) | 0, e11 = e11 + Math.imul(B6, at2) | 0, h9 = h9 + Math.imul(S6, mt) | 0, n8 = (n8 = n8 + Math.imul(S6, ft) | 0) + Math.imul(Z5, mt) | 0, e11 = e11 + Math.imul(Z5, ft) | 0; + var qt = (a8 + (h9 = h9 + Math.imul(k7, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(k7, Mt) | 0) + Math.imul(A7, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(A7, Mt) | 0) + (n8 >>> 13) | 0) + (qt >>> 26) | 0, qt &= 67108863, h9 = Math.imul(j6, rt), n8 = (n8 = Math.imul(j6, ht2)) + Math.imul(K5, rt) | 0, e11 = Math.imul(K5, ht2), h9 = h9 + Math.imul(z6, et3) | 0, n8 = (n8 = n8 + Math.imul(z6, ot) | 0) + Math.imul(E6, et3) | 0, e11 = e11 + Math.imul(E6, ot) | 0, h9 = h9 + Math.imul(L6, ut) | 0, n8 = (n8 = n8 + Math.imul(L6, at2) | 0) + Math.imul(I6, ut) | 0, e11 = e11 + Math.imul(I6, at2) | 0, h9 = h9 + Math.imul(q5, mt) | 0, n8 = (n8 = n8 + Math.imul(q5, ft) | 0) + Math.imul(B6, mt) | 0, e11 = e11 + Math.imul(B6, ft) | 0; + var Bt = (a8 + (h9 = h9 + Math.imul(S6, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(S6, Mt) | 0) + Math.imul(Z5, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(Z5, Mt) | 0) + (n8 >>> 13) | 0) + (Bt >>> 26) | 0, Bt &= 67108863, h9 = Math.imul(j6, et3), n8 = (n8 = Math.imul(j6, ot)) + Math.imul(K5, et3) | 0, e11 = Math.imul(K5, ot), h9 = h9 + Math.imul(z6, ut) | 0, n8 = (n8 = n8 + Math.imul(z6, at2) | 0) + Math.imul(E6, ut) | 0, e11 = e11 + Math.imul(E6, at2) | 0, h9 = h9 + Math.imul(L6, mt) | 0, n8 = (n8 = n8 + Math.imul(L6, ft) | 0) + Math.imul(I6, mt) | 0, e11 = e11 + Math.imul(I6, ft) | 0; + var Nt = (a8 + (h9 = h9 + Math.imul(q5, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(q5, Mt) | 0) + Math.imul(B6, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(B6, Mt) | 0) + (n8 >>> 13) | 0) + (Nt >>> 26) | 0, Nt &= 67108863, h9 = Math.imul(j6, ut), n8 = (n8 = Math.imul(j6, at2)) + Math.imul(K5, ut) | 0, e11 = Math.imul(K5, at2), h9 = h9 + Math.imul(z6, mt) | 0, n8 = (n8 = n8 + Math.imul(z6, ft) | 0) + Math.imul(E6, mt) | 0, e11 = e11 + Math.imul(E6, ft) | 0; + var Lt = (a8 + (h9 = h9 + Math.imul(L6, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(L6, Mt) | 0) + Math.imul(I6, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(I6, Mt) | 0) + (n8 >>> 13) | 0) + (Lt >>> 26) | 0, Lt &= 67108863, h9 = Math.imul(j6, mt), n8 = (n8 = Math.imul(j6, ft)) + Math.imul(K5, mt) | 0, e11 = Math.imul(K5, ft); + var It = (a8 + (h9 = h9 + Math.imul(z6, pt) | 0) | 0) + ((8191 & (n8 = (n8 = n8 + Math.imul(z6, Mt) | 0) + Math.imul(E6, pt) | 0)) << 13) | 0; + a8 = ((e11 = e11 + Math.imul(E6, Mt) | 0) + (n8 >>> 13) | 0) + (It >>> 26) | 0, It &= 67108863; + var Tt = (a8 + (h9 = Math.imul(j6, pt)) | 0) + ((8191 & (n8 = (n8 = Math.imul(j6, Mt)) + Math.imul(K5, pt) | 0)) << 13) | 0; + return a8 = ((e11 = Math.imul(K5, Mt)) + (n8 >>> 13) | 0) + (Tt >>> 26) | 0, Tt &= 67108863, u8[0] = vt, u8[1] = gt2, u8[2] = ct, u8[3] = wt, u8[4] = yt, u8[5] = bt, u8[6] = _t2, u8[7] = kt, u8[8] = At, u8[9] = xt, u8[10] = St, u8[11] = Zt, u8[12] = Rt, u8[13] = qt, u8[14] = Bt, u8[15] = Nt, u8[16] = Lt, u8[17] = It, u8[18] = Tt, 0 !== a8 && (u8[19] = a8, r9.length++), r9; + }; + function M6(t8, i7, r9) { + return new v8().mulp(t8, i7, r9); + } + function v8(t8, r9) { + (this || i$3).x = t8, (this || i$3).y = r9; + } + Math.imul || (p7 = d7), o7.prototype.mulTo = function(t8, r9) { + var h9 = (this || i$3).length + t8.length; + return 10 === (this || i$3).length && 10 === t8.length ? p7(this || i$3, t8, r9) : h9 < 63 ? d7(this || i$3, t8, r9) : h9 < 1024 ? function(t9, i7, r10) { + r10.negative = i7.negative ^ t9.negative, r10.length = t9.length + i7.length; + for (var h10 = 0, n8 = 0, e11 = 0; e11 < r10.length - 1; e11++) { + var o8 = n8; + n8 = 0; + for (var s8 = 67108863 & h10, u8 = Math.min(e11, i7.length - 1), a8 = Math.max(0, e11 - t9.length + 1); a8 <= u8; a8++) { + var l8 = e11 - a8, m8 = (0 | t9.words[l8]) * (0 | i7.words[a8]), f9 = 67108863 & m8; + s8 = 67108863 & (f9 = f9 + s8 | 0), n8 += (o8 = (o8 = o8 + (m8 / 67108864 | 0) | 0) + (f9 >>> 26) | 0) >>> 26, o8 &= 67108863; + } + r10.words[e11] = s8, h10 = o8, o8 = n8; + } + return 0 !== h10 ? r10.words[e11] = h10 : r10.length--, r10.strip(); + }(this || i$3, t8, r9) : M6(this || i$3, t8, r9); + }, v8.prototype.makeRBT = function(t8) { + for (var i7 = new Array(t8), r9 = o7.prototype._countBits(t8) - 1, h9 = 0; h9 < t8; h9++) + i7[h9] = this.revBin(h9, r9, t8); + return i7; + }, v8.prototype.revBin = function(t8, i7, r9) { + if (0 === t8 || t8 === r9 - 1) + return t8; + for (var h9 = 0, n8 = 0; n8 < i7; n8++) + h9 |= (1 & t8) << i7 - n8 - 1, t8 >>= 1; + return h9; + }, v8.prototype.permute = function(t8, i7, r9, h9, n8, e11) { + for (var o8 = 0; o8 < e11; o8++) + h9[o8] = i7[t8[o8]], n8[o8] = r9[t8[o8]]; + }, v8.prototype.transform = function(t8, i7, r9, h9, n8, e11) { + this.permute(e11, t8, i7, r9, h9, n8); + for (var o8 = 1; o8 < n8; o8 <<= 1) + for (var s8 = o8 << 1, u8 = Math.cos(2 * Math.PI / s8), a8 = Math.sin(2 * Math.PI / s8), l8 = 0; l8 < n8; l8 += s8) + for (var m8 = u8, f9 = a8, d8 = 0; d8 < o8; d8++) { + var p8 = r9[l8 + d8], M7 = h9[l8 + d8], v9 = r9[l8 + d8 + o8], g8 = h9[l8 + d8 + o8], c8 = m8 * v9 - f9 * g8; + g8 = m8 * g8 + f9 * v9, v9 = c8, r9[l8 + d8] = p8 + v9, h9[l8 + d8] = M7 + g8, r9[l8 + d8 + o8] = p8 - v9, h9[l8 + d8 + o8] = M7 - g8, d8 !== s8 && (c8 = u8 * m8 - a8 * f9, f9 = u8 * f9 + a8 * m8, m8 = c8); + } + }, v8.prototype.guessLen13b = function(t8, i7) { + var r9 = 1 | Math.max(i7, t8), h9 = 1 & r9, n8 = 0; + for (r9 = r9 / 2 | 0; r9; r9 >>>= 1) + n8++; + return 1 << n8 + 1 + h9; + }, v8.prototype.conjugate = function(t8, i7, r9) { + if (!(r9 <= 1)) + for (var h9 = 0; h9 < r9 / 2; h9++) { + var n8 = t8[h9]; + t8[h9] = t8[r9 - h9 - 1], t8[r9 - h9 - 1] = n8, n8 = i7[h9], i7[h9] = -i7[r9 - h9 - 1], i7[r9 - h9 - 1] = -n8; + } + }, v8.prototype.normalize13b = function(t8, i7) { + for (var r9 = 0, h9 = 0; h9 < i7 / 2; h9++) { + var n8 = 8192 * Math.round(t8[2 * h9 + 1] / i7) + Math.round(t8[2 * h9] / i7) + r9; + t8[h9] = 67108863 & n8, r9 = n8 < 67108864 ? 0 : n8 / 67108864 | 0; + } + return t8; + }, v8.prototype.convert13b = function(t8, i7, r9, h9) { + for (var e11 = 0, o8 = 0; o8 < i7; o8++) + e11 += 0 | t8[o8], r9[2 * o8] = 8191 & e11, e11 >>>= 13, r9[2 * o8 + 1] = 8191 & e11, e11 >>>= 13; + for (o8 = 2 * i7; o8 < h9; ++o8) + r9[o8] = 0; + n7(0 === e11), n7(0 == (-8192 & e11)); + }, v8.prototype.stub = function(t8) { + for (var i7 = new Array(t8), r9 = 0; r9 < t8; r9++) + i7[r9] = 0; + return i7; + }, v8.prototype.mulp = function(t8, i7, r9) { + var h9 = 2 * this.guessLen13b(t8.length, i7.length), n8 = this.makeRBT(h9), e11 = this.stub(h9), o8 = new Array(h9), s8 = new Array(h9), u8 = new Array(h9), a8 = new Array(h9), l8 = new Array(h9), m8 = new Array(h9), f9 = r9.words; + f9.length = h9, this.convert13b(t8.words, t8.length, o8, h9), this.convert13b(i7.words, i7.length, a8, h9), this.transform(o8, e11, s8, u8, h9, n8), this.transform(a8, e11, l8, m8, h9, n8); + for (var d8 = 0; d8 < h9; d8++) { + var p8 = s8[d8] * l8[d8] - u8[d8] * m8[d8]; + u8[d8] = s8[d8] * m8[d8] + u8[d8] * l8[d8], s8[d8] = p8; + } + return this.conjugate(s8, u8, h9), this.transform(s8, u8, f9, e11, h9, n8), this.conjugate(f9, e11, h9), this.normalize13b(f9, h9), r9.negative = t8.negative ^ i7.negative, r9.length = t8.length + i7.length, r9.strip(); + }, o7.prototype.mul = function(t8) { + var r9 = new o7(null); + return r9.words = new Array((this || i$3).length + t8.length), this.mulTo(t8, r9); + }, o7.prototype.mulf = function(t8) { + var r9 = new o7(null); + return r9.words = new Array((this || i$3).length + t8.length), M6(this || i$3, t8, r9); + }, o7.prototype.imul = function(t8) { + return this.clone().mulTo(t8, this || i$3); + }, o7.prototype.imuln = function(t8) { + n7("number" == typeof t8), n7(t8 < 67108864); + for (var r9 = 0, h9 = 0; h9 < (this || i$3).length; h9++) { + var e11 = (0 | (this || i$3).words[h9]) * t8, o8 = (67108863 & e11) + (67108863 & r9); + r9 >>= 26, r9 += e11 / 67108864 | 0, r9 += o8 >>> 26, (this || i$3).words[h9] = 67108863 & o8; + } + return 0 !== r9 && ((this || i$3).words[h9] = r9, (this || i$3).length++), this || i$3; + }, o7.prototype.muln = function(t8) { + return this.clone().imuln(t8); + }, o7.prototype.sqr = function() { + return this.mul(this || i$3); + }, o7.prototype.isqr = function() { + return this.imul(this.clone()); + }, o7.prototype.pow = function(t8) { + var r9 = function(t9) { + for (var i7 = new Array(t9.bitLength()), r10 = 0; r10 < i7.length; r10++) { + var h10 = r10 / 26 | 0, n9 = r10 % 26; + i7[r10] = (t9.words[h10] & 1 << n9) >>> n9; + } + return i7; + }(t8); + if (0 === r9.length) + return new o7(1); + for (var h9 = this || i$3, n8 = 0; n8 < r9.length && 0 === r9[n8]; n8++, h9 = h9.sqr()) + ; + if (++n8 < r9.length) + for (var e11 = h9.sqr(); n8 < r9.length; n8++, e11 = e11.sqr()) + 0 !== r9[n8] && (h9 = h9.mul(e11)); + return h9; + }, o7.prototype.iushln = function(t8) { + n7("number" == typeof t8 && t8 >= 0); + var r9, h9 = t8 % 26, e11 = (t8 - h9) / 26, o8 = 67108863 >>> 26 - h9 << 26 - h9; + if (0 !== h9) { + var s8 = 0; + for (r9 = 0; r9 < (this || i$3).length; r9++) { + var u8 = (this || i$3).words[r9] & o8, a8 = (0 | (this || i$3).words[r9]) - u8 << h9; + (this || i$3).words[r9] = a8 | s8, s8 = u8 >>> 26 - h9; + } + s8 && ((this || i$3).words[r9] = s8, (this || i$3).length++); + } + if (0 !== e11) { + for (r9 = (this || i$3).length - 1; r9 >= 0; r9--) + (this || i$3).words[r9 + e11] = (this || i$3).words[r9]; + for (r9 = 0; r9 < e11; r9++) + (this || i$3).words[r9] = 0; + (this || i$3).length += e11; + } + return this.strip(); + }, o7.prototype.ishln = function(t8) { + return n7(0 === (this || i$3).negative), this.iushln(t8); + }, o7.prototype.iushrn = function(t8, r9, h9) { + var e11; + n7("number" == typeof t8 && t8 >= 0), e11 = r9 ? (r9 - r9 % 26) / 26 : 0; + var o8 = t8 % 26, s8 = Math.min((t8 - o8) / 26, (this || i$3).length), u8 = 67108863 ^ 67108863 >>> o8 << o8, a8 = h9; + if (e11 -= s8, e11 = Math.max(0, e11), a8) { + for (var l8 = 0; l8 < s8; l8++) + a8.words[l8] = (this || i$3).words[l8]; + a8.length = s8; + } + if (0 === s8) + ; + else if ((this || i$3).length > s8) + for ((this || i$3).length -= s8, l8 = 0; l8 < (this || i$3).length; l8++) + (this || i$3).words[l8] = (this || i$3).words[l8 + s8]; + else + (this || i$3).words[0] = 0, (this || i$3).length = 1; + var m8 = 0; + for (l8 = (this || i$3).length - 1; l8 >= 0 && (0 !== m8 || l8 >= e11); l8--) { + var f9 = 0 | (this || i$3).words[l8]; + (this || i$3).words[l8] = m8 << 26 - o8 | f9 >>> o8, m8 = f9 & u8; + } + return a8 && 0 !== m8 && (a8.words[a8.length++] = m8), 0 === (this || i$3).length && ((this || i$3).words[0] = 0, (this || i$3).length = 1), this.strip(); + }, o7.prototype.ishrn = function(t8, r9, h9) { + return n7(0 === (this || i$3).negative), this.iushrn(t8, r9, h9); + }, o7.prototype.shln = function(t8) { + return this.clone().ishln(t8); + }, o7.prototype.ushln = function(t8) { + return this.clone().iushln(t8); + }, o7.prototype.shrn = function(t8) { + return this.clone().ishrn(t8); + }, o7.prototype.ushrn = function(t8) { + return this.clone().iushrn(t8); + }, o7.prototype.testn = function(t8) { + n7("number" == typeof t8 && t8 >= 0); + var r9 = t8 % 26, h9 = (t8 - r9) / 26, e11 = 1 << r9; + return !((this || i$3).length <= h9) && !!((this || i$3).words[h9] & e11); + }, o7.prototype.imaskn = function(t8) { + n7("number" == typeof t8 && t8 >= 0); + var r9 = t8 % 26, h9 = (t8 - r9) / 26; + if (n7(0 === (this || i$3).negative, "imaskn works only with positive numbers"), (this || i$3).length <= h9) + return this || i$3; + if (0 !== r9 && h9++, (this || i$3).length = Math.min(h9, (this || i$3).length), 0 !== r9) { + var e11 = 67108863 ^ 67108863 >>> r9 << r9; + (this || i$3).words[(this || i$3).length - 1] &= e11; + } + return this.strip(); + }, o7.prototype.maskn = function(t8) { + return this.clone().imaskn(t8); + }, o7.prototype.iaddn = function(t8) { + return n7("number" == typeof t8), n7(t8 < 67108864), t8 < 0 ? this.isubn(-t8) : 0 !== (this || i$3).negative ? 1 === (this || i$3).length && (0 | (this || i$3).words[0]) < t8 ? ((this || i$3).words[0] = t8 - (0 | (this || i$3).words[0]), (this || i$3).negative = 0, this || i$3) : ((this || i$3).negative = 0, this.isubn(t8), (this || i$3).negative = 1, this || i$3) : this._iaddn(t8); + }, o7.prototype._iaddn = function(t8) { + (this || i$3).words[0] += t8; + for (var r9 = 0; r9 < (this || i$3).length && (this || i$3).words[r9] >= 67108864; r9++) + (this || i$3).words[r9] -= 67108864, r9 === (this || i$3).length - 1 ? (this || i$3).words[r9 + 1] = 1 : (this || i$3).words[r9 + 1]++; + return (this || i$3).length = Math.max((this || i$3).length, r9 + 1), this || i$3; + }, o7.prototype.isubn = function(t8) { + if (n7("number" == typeof t8), n7(t8 < 67108864), t8 < 0) + return this.iaddn(-t8); + if (0 !== (this || i$3).negative) + return (this || i$3).negative = 0, this.iaddn(t8), (this || i$3).negative = 1, this || i$3; + if ((this || i$3).words[0] -= t8, 1 === (this || i$3).length && (this || i$3).words[0] < 0) + (this || i$3).words[0] = -(this || i$3).words[0], (this || i$3).negative = 1; + else + for (var r9 = 0; r9 < (this || i$3).length && (this || i$3).words[r9] < 0; r9++) + (this || i$3).words[r9] += 67108864, (this || i$3).words[r9 + 1] -= 1; + return this.strip(); + }, o7.prototype.addn = function(t8) { + return this.clone().iaddn(t8); + }, o7.prototype.subn = function(t8) { + return this.clone().isubn(t8); + }, o7.prototype.iabs = function() { + return (this || i$3).negative = 0, this || i$3; + }, o7.prototype.abs = function() { + return this.clone().iabs(); + }, o7.prototype._ishlnsubmul = function(t8, r9, h9) { + var e11, o8, s8 = t8.length + h9; + this._expand(s8); + var u8 = 0; + for (e11 = 0; e11 < t8.length; e11++) { + o8 = (0 | (this || i$3).words[e11 + h9]) + u8; + var a8 = (0 | t8.words[e11]) * r9; + u8 = ((o8 -= 67108863 & a8) >> 26) - (a8 / 67108864 | 0), (this || i$3).words[e11 + h9] = 67108863 & o8; + } + for (; e11 < (this || i$3).length - h9; e11++) + u8 = (o8 = (0 | (this || i$3).words[e11 + h9]) + u8) >> 26, (this || i$3).words[e11 + h9] = 67108863 & o8; + if (0 === u8) + return this.strip(); + for (n7(-1 === u8), u8 = 0, e11 = 0; e11 < (this || i$3).length; e11++) + u8 = (o8 = -(0 | (this || i$3).words[e11]) + u8) >> 26, (this || i$3).words[e11] = 67108863 & o8; + return (this || i$3).negative = 1, this.strip(); + }, o7.prototype._wordDiv = function(t8, r9) { + var h9 = ((this || i$3).length, t8.length), n8 = this.clone(), e11 = t8, s8 = 0 | e11.words[e11.length - 1]; + 0 !== (h9 = 26 - this._countBits(s8)) && (e11 = e11.ushln(h9), n8.iushln(h9), s8 = 0 | e11.words[e11.length - 1]); + var u8, a8 = n8.length - e11.length; + if ("mod" !== r9) { + (u8 = new o7(null)).length = a8 + 1, u8.words = new Array(u8.length); + for (var l8 = 0; l8 < u8.length; l8++) + u8.words[l8] = 0; + } + var m8 = n8.clone()._ishlnsubmul(e11, 1, a8); + 0 === m8.negative && (n8 = m8, u8 && (u8.words[a8] = 1)); + for (var f9 = a8 - 1; f9 >= 0; f9--) { + var d8 = 67108864 * (0 | n8.words[e11.length + f9]) + (0 | n8.words[e11.length + f9 - 1]); + for (d8 = Math.min(d8 / s8 | 0, 67108863), n8._ishlnsubmul(e11, d8, f9); 0 !== n8.negative; ) + d8--, n8.negative = 0, n8._ishlnsubmul(e11, 1, f9), n8.isZero() || (n8.negative ^= 1); + u8 && (u8.words[f9] = d8); + } + return u8 && u8.strip(), n8.strip(), "div" !== r9 && 0 !== h9 && n8.iushrn(h9), { div: u8 || null, mod: n8 }; + }, o7.prototype.divmod = function(t8, r9, h9) { + return n7(!t8.isZero()), this.isZero() ? { div: new o7(0), mod: new o7(0) } : 0 !== (this || i$3).negative && 0 === t8.negative ? (u8 = this.neg().divmod(t8, r9), "mod" !== r9 && (e11 = u8.div.neg()), "div" !== r9 && (s8 = u8.mod.neg(), h9 && 0 !== s8.negative && s8.iadd(t8)), { div: e11, mod: s8 }) : 0 === (this || i$3).negative && 0 !== t8.negative ? (u8 = this.divmod(t8.neg(), r9), "mod" !== r9 && (e11 = u8.div.neg()), { div: e11, mod: u8.mod }) : 0 != ((this || i$3).negative & t8.negative) ? (u8 = this.neg().divmod(t8.neg(), r9), "div" !== r9 && (s8 = u8.mod.neg(), h9 && 0 !== s8.negative && s8.isub(t8)), { div: u8.div, mod: s8 }) : t8.length > (this || i$3).length || this.cmp(t8) < 0 ? { div: new o7(0), mod: this || i$3 } : 1 === t8.length ? "div" === r9 ? { div: this.divn(t8.words[0]), mod: null } : "mod" === r9 ? { div: null, mod: new o7(this.modn(t8.words[0])) } : { div: this.divn(t8.words[0]), mod: new o7(this.modn(t8.words[0])) } : this._wordDiv(t8, r9); + var e11, s8, u8; + }, o7.prototype.div = function(t8) { + return this.divmod(t8, "div", false).div; + }, o7.prototype.mod = function(t8) { + return this.divmod(t8, "mod", false).mod; + }, o7.prototype.umod = function(t8) { + return this.divmod(t8, "mod", true).mod; + }, o7.prototype.divRound = function(t8) { + var i7 = this.divmod(t8); + if (i7.mod.isZero()) + return i7.div; + var r9 = 0 !== i7.div.negative ? i7.mod.isub(t8) : i7.mod, h9 = t8.ushrn(1), n8 = t8.andln(1), e11 = r9.cmp(h9); + return e11 < 0 || 1 === n8 && 0 === e11 ? i7.div : 0 !== i7.div.negative ? i7.div.isubn(1) : i7.div.iaddn(1); + }, o7.prototype.modn = function(t8) { + n7(t8 <= 67108863); + for (var r9 = (1 << 26) % t8, h9 = 0, e11 = (this || i$3).length - 1; e11 >= 0; e11--) + h9 = (r9 * h9 + (0 | (this || i$3).words[e11])) % t8; + return h9; + }, o7.prototype.idivn = function(t8) { + n7(t8 <= 67108863); + for (var r9 = 0, h9 = (this || i$3).length - 1; h9 >= 0; h9--) { + var e11 = (0 | (this || i$3).words[h9]) + 67108864 * r9; + (this || i$3).words[h9] = e11 / t8 | 0, r9 = e11 % t8; + } + return this.strip(); + }, o7.prototype.divn = function(t8) { + return this.clone().idivn(t8); + }, o7.prototype.egcd = function(t8) { + n7(0 === t8.negative), n7(!t8.isZero()); + var r9 = this || i$3, h9 = t8.clone(); + r9 = 0 !== r9.negative ? r9.umod(t8) : r9.clone(); + for (var e11 = new o7(1), s8 = new o7(0), u8 = new o7(0), a8 = new o7(1), l8 = 0; r9.isEven() && h9.isEven(); ) + r9.iushrn(1), h9.iushrn(1), ++l8; + for (var m8 = h9.clone(), f9 = r9.clone(); !r9.isZero(); ) { + for (var d8 = 0, p8 = 1; 0 == (r9.words[0] & p8) && d8 < 26; ++d8, p8 <<= 1) + ; + if (d8 > 0) + for (r9.iushrn(d8); d8-- > 0; ) + (e11.isOdd() || s8.isOdd()) && (e11.iadd(m8), s8.isub(f9)), e11.iushrn(1), s8.iushrn(1); + for (var M7 = 0, v9 = 1; 0 == (h9.words[0] & v9) && M7 < 26; ++M7, v9 <<= 1) + ; + if (M7 > 0) + for (h9.iushrn(M7); M7-- > 0; ) + (u8.isOdd() || a8.isOdd()) && (u8.iadd(m8), a8.isub(f9)), u8.iushrn(1), a8.iushrn(1); + r9.cmp(h9) >= 0 ? (r9.isub(h9), e11.isub(u8), s8.isub(a8)) : (h9.isub(r9), u8.isub(e11), a8.isub(s8)); + } + return { a: u8, b: a8, gcd: h9.iushln(l8) }; + }, o7.prototype._invmp = function(t8) { + n7(0 === t8.negative), n7(!t8.isZero()); + var r9 = this || i$3, h9 = t8.clone(); + r9 = 0 !== r9.negative ? r9.umod(t8) : r9.clone(); + for (var e11, s8 = new o7(1), u8 = new o7(0), a8 = h9.clone(); r9.cmpn(1) > 0 && h9.cmpn(1) > 0; ) { + for (var l8 = 0, m8 = 1; 0 == (r9.words[0] & m8) && l8 < 26; ++l8, m8 <<= 1) + ; + if (l8 > 0) + for (r9.iushrn(l8); l8-- > 0; ) + s8.isOdd() && s8.iadd(a8), s8.iushrn(1); + for (var f9 = 0, d8 = 1; 0 == (h9.words[0] & d8) && f9 < 26; ++f9, d8 <<= 1) + ; + if (f9 > 0) + for (h9.iushrn(f9); f9-- > 0; ) + u8.isOdd() && u8.iadd(a8), u8.iushrn(1); + r9.cmp(h9) >= 0 ? (r9.isub(h9), s8.isub(u8)) : (h9.isub(r9), u8.isub(s8)); + } + return (e11 = 0 === r9.cmpn(1) ? s8 : u8).cmpn(0) < 0 && e11.iadd(t8), e11; + }, o7.prototype.gcd = function(t8) { + if (this.isZero()) + return t8.abs(); + if (t8.isZero()) + return this.abs(); + var i7 = this.clone(), r9 = t8.clone(); + i7.negative = 0, r9.negative = 0; + for (var h9 = 0; i7.isEven() && r9.isEven(); h9++) + i7.iushrn(1), r9.iushrn(1); + for (; ; ) { + for (; i7.isEven(); ) + i7.iushrn(1); + for (; r9.isEven(); ) + r9.iushrn(1); + var n8 = i7.cmp(r9); + if (n8 < 0) { + var e11 = i7; + i7 = r9, r9 = e11; + } else if (0 === n8 || 0 === r9.cmpn(1)) + break; + i7.isub(r9); + } + return r9.iushln(h9); + }, o7.prototype.invm = function(t8) { + return this.egcd(t8).a.umod(t8); + }, o7.prototype.isEven = function() { + return 0 == (1 & (this || i$3).words[0]); + }, o7.prototype.isOdd = function() { + return 1 == (1 & (this || i$3).words[0]); + }, o7.prototype.andln = function(t8) { + return (this || i$3).words[0] & t8; + }, o7.prototype.bincn = function(t8) { + n7("number" == typeof t8); + var r9 = t8 % 26, h9 = (t8 - r9) / 26, e11 = 1 << r9; + if ((this || i$3).length <= h9) + return this._expand(h9 + 1), (this || i$3).words[h9] |= e11, this || i$3; + for (var o8 = e11, s8 = h9; 0 !== o8 && s8 < (this || i$3).length; s8++) { + var u8 = 0 | (this || i$3).words[s8]; + o8 = (u8 += o8) >>> 26, u8 &= 67108863, (this || i$3).words[s8] = u8; + } + return 0 !== o8 && ((this || i$3).words[s8] = o8, (this || i$3).length++), this || i$3; + }, o7.prototype.isZero = function() { + return 1 === (this || i$3).length && 0 === (this || i$3).words[0]; + }, o7.prototype.cmpn = function(t8) { + var r9, h9 = t8 < 0; + if (0 !== (this || i$3).negative && !h9) + return -1; + if (0 === (this || i$3).negative && h9) + return 1; + if (this.strip(), (this || i$3).length > 1) + r9 = 1; + else { + h9 && (t8 = -t8), n7(t8 <= 67108863, "Number is too big"); + var e11 = 0 | (this || i$3).words[0]; + r9 = e11 === t8 ? 0 : e11 < t8 ? -1 : 1; + } + return 0 !== (this || i$3).negative ? 0 | -r9 : r9; + }, o7.prototype.cmp = function(t8) { + if (0 !== (this || i$3).negative && 0 === t8.negative) + return -1; + if (0 === (this || i$3).negative && 0 !== t8.negative) + return 1; + var r9 = this.ucmp(t8); + return 0 !== (this || i$3).negative ? 0 | -r9 : r9; + }, o7.prototype.ucmp = function(t8) { + if ((this || i$3).length > t8.length) + return 1; + if ((this || i$3).length < t8.length) + return -1; + for (var r9 = 0, h9 = (this || i$3).length - 1; h9 >= 0; h9--) { + var n8 = 0 | (this || i$3).words[h9], e11 = 0 | t8.words[h9]; + if (n8 !== e11) { + n8 < e11 ? r9 = -1 : n8 > e11 && (r9 = 1); + break; + } + } + return r9; + }, o7.prototype.gtn = function(t8) { + return 1 === this.cmpn(t8); + }, o7.prototype.gt = function(t8) { + return 1 === this.cmp(t8); + }, o7.prototype.gten = function(t8) { + return this.cmpn(t8) >= 0; + }, o7.prototype.gte = function(t8) { + return this.cmp(t8) >= 0; + }, o7.prototype.ltn = function(t8) { + return -1 === this.cmpn(t8); + }, o7.prototype.lt = function(t8) { + return -1 === this.cmp(t8); + }, o7.prototype.lten = function(t8) { + return this.cmpn(t8) <= 0; + }, o7.prototype.lte = function(t8) { + return this.cmp(t8) <= 0; + }, o7.prototype.eqn = function(t8) { + return 0 === this.cmpn(t8); + }, o7.prototype.eq = function(t8) { + return 0 === this.cmp(t8); + }, o7.red = function(t8) { + return new k6(t8); + }, o7.prototype.toRed = function(t8) { + return n7(!(this || i$3).red, "Already a number in reduction context"), n7(0 === (this || i$3).negative, "red works only with positives"), t8.convertTo(this || i$3)._forceRed(t8); + }, o7.prototype.fromRed = function() { + return n7((this || i$3).red, "fromRed works only with numbers in reduction context"), (this || i$3).red.convertFrom(this || i$3); + }, o7.prototype._forceRed = function(t8) { + return (this || i$3).red = t8, this || i$3; + }, o7.prototype.forceRed = function(t8) { + return n7(!(this || i$3).red, "Already a number in reduction context"), this._forceRed(t8); + }, o7.prototype.redAdd = function(t8) { + return n7((this || i$3).red, "redAdd works only with red numbers"), (this || i$3).red.add(this || i$3, t8); + }, o7.prototype.redIAdd = function(t8) { + return n7((this || i$3).red, "redIAdd works only with red numbers"), (this || i$3).red.iadd(this || i$3, t8); + }, o7.prototype.redSub = function(t8) { + return n7((this || i$3).red, "redSub works only with red numbers"), (this || i$3).red.sub(this || i$3, t8); + }, o7.prototype.redISub = function(t8) { + return n7((this || i$3).red, "redISub works only with red numbers"), (this || i$3).red.isub(this || i$3, t8); + }, o7.prototype.redShl = function(t8) { + return n7((this || i$3).red, "redShl works only with red numbers"), (this || i$3).red.shl(this || i$3, t8); + }, o7.prototype.redMul = function(t8) { + return n7((this || i$3).red, "redMul works only with red numbers"), (this || i$3).red._verify2(this || i$3, t8), (this || i$3).red.mul(this || i$3, t8); + }, o7.prototype.redIMul = function(t8) { + return n7((this || i$3).red, "redMul works only with red numbers"), (this || i$3).red._verify2(this || i$3, t8), (this || i$3).red.imul(this || i$3, t8); + }, o7.prototype.redSqr = function() { + return n7((this || i$3).red, "redSqr works only with red numbers"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.sqr(this || i$3); + }, o7.prototype.redISqr = function() { + return n7((this || i$3).red, "redISqr works only with red numbers"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.isqr(this || i$3); + }, o7.prototype.redSqrt = function() { + return n7((this || i$3).red, "redSqrt works only with red numbers"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.sqrt(this || i$3); + }, o7.prototype.redInvm = function() { + return n7((this || i$3).red, "redInvm works only with red numbers"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.invm(this || i$3); + }, o7.prototype.redNeg = function() { + return n7((this || i$3).red, "redNeg works only with red numbers"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.neg(this || i$3); + }, o7.prototype.redPow = function(t8) { + return n7((this || i$3).red && !t8.red, "redPow(normalNum)"), (this || i$3).red._verify1(this || i$3), (this || i$3).red.pow(this || i$3, t8); + }; + var g7 = { k256: null, p224: null, p192: null, p25519: null }; + function c7(t8, r9) { + (this || i$3).name = t8, (this || i$3).p = new o7(r9, 16), (this || i$3).n = (this || i$3).p.bitLength(), (this || i$3).k = new o7(1).iushln((this || i$3).n).isub((this || i$3).p), (this || i$3).tmp = this._tmp(); + } + function w6() { + c7.call(this || i$3, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f"); + } + function y7() { + c7.call(this || i$3, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001"); + } + function b8() { + c7.call(this || i$3, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff"); + } + function _6() { + c7.call(this || i$3, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed"); + } + function k6(t8) { + if ("string" == typeof t8) { + var r9 = o7._prime(t8); + (this || i$3).m = r9.p, (this || i$3).prime = r9; + } else + n7(t8.gtn(1), "modulus must be greater than 1"), (this || i$3).m = t8, (this || i$3).prime = null; + } + function A6(t8) { + k6.call(this || i$3, t8), (this || i$3).shift = (this || i$3).m.bitLength(), (this || i$3).shift % 26 != 0 && ((this || i$3).shift += 26 - (this || i$3).shift % 26), (this || i$3).r = new o7(1).iushln((this || i$3).shift), (this || i$3).r2 = this.imod((this || i$3).r.sqr()), (this || i$3).rinv = (this || i$3).r._invmp((this || i$3).m), (this || i$3).minv = (this || i$3).rinv.mul((this || i$3).r).isubn(1).div((this || i$3).m), (this || i$3).minv = (this || i$3).minv.umod((this || i$3).r), (this || i$3).minv = (this || i$3).r.sub((this || i$3).minv); + } + c7.prototype._tmp = function() { + var t8 = new o7(null); + return t8.words = new Array(Math.ceil((this || i$3).n / 13)), t8; + }, c7.prototype.ireduce = function(t8) { + var r9, h9 = t8; + do { + this.split(h9, (this || i$3).tmp), r9 = (h9 = (h9 = this.imulK(h9)).iadd((this || i$3).tmp)).bitLength(); + } while (r9 > (this || i$3).n); + var n8 = r9 < (this || i$3).n ? -1 : h9.ucmp((this || i$3).p); + return 0 === n8 ? (h9.words[0] = 0, h9.length = 1) : n8 > 0 ? h9.isub((this || i$3).p) : h9.strip(), h9; + }, c7.prototype.split = function(t8, r9) { + t8.iushrn((this || i$3).n, 0, r9); + }, c7.prototype.imulK = function(t8) { + return t8.imul((this || i$3).k); + }, e10(w6, c7), w6.prototype.split = function(t8, i7) { + for (var r9 = Math.min(t8.length, 9), h9 = 0; h9 < r9; h9++) + i7.words[h9] = t8.words[h9]; + if (i7.length = r9, t8.length <= 9) + return t8.words[0] = 0, t8.length = 1, void 0; + var n8 = t8.words[9]; + for (i7.words[i7.length++] = 4194303 & n8, h9 = 10; h9 < t8.length; h9++) { + var e11 = 0 | t8.words[h9]; + t8.words[h9 - 10] = (4194303 & e11) << 4 | n8 >>> 22, n8 = e11; + } + n8 >>>= 22, t8.words[h9 - 10] = n8, 0 === n8 && t8.length > 10 ? t8.length -= 10 : t8.length -= 9; + }, w6.prototype.imulK = function(t8) { + t8.words[t8.length] = 0, t8.words[t8.length + 1] = 0, t8.length += 2; + for (var i7 = 0, r9 = 0; r9 < t8.length; r9++) { + var h9 = 0 | t8.words[r9]; + i7 += 977 * h9, t8.words[r9] = 67108863 & i7, i7 = 64 * h9 + (i7 / 67108864 | 0); + } + return 0 === t8.words[t8.length - 1] && (t8.length--, 0 === t8.words[t8.length - 1] && t8.length--), t8; + }, e10(y7, c7), e10(b8, c7), e10(_6, c7), _6.prototype.imulK = function(t8) { + for (var i7 = 0, r9 = 0; r9 < t8.length; r9++) { + var h9 = 19 * (0 | t8.words[r9]) + i7, n8 = 67108863 & h9; + h9 >>>= 26, t8.words[r9] = n8, i7 = h9; + } + return 0 !== i7 && (t8.words[t8.length++] = i7), t8; + }, o7._prime = function(t8) { + if (g7[t8]) + return g7[t8]; + var i7; + if ("k256" === t8) + i7 = new w6(); + else if ("p224" === t8) + i7 = new y7(); + else if ("p192" === t8) + i7 = new b8(); + else { + if ("p25519" !== t8) + throw new Error("Unknown prime " + t8); + i7 = new _6(); + } + return g7[t8] = i7, i7; + }, k6.prototype._verify1 = function(t8) { + n7(0 === t8.negative, "red works only with positives"), n7(t8.red, "red works only with red numbers"); + }, k6.prototype._verify2 = function(t8, i7) { + n7(0 == (t8.negative | i7.negative), "red works only with positives"), n7(t8.red && t8.red === i7.red, "red works only with red numbers"); + }, k6.prototype.imod = function(t8) { + return (this || i$3).prime ? (this || i$3).prime.ireduce(t8)._forceRed(this || i$3) : t8.umod((this || i$3).m)._forceRed(this || i$3); + }, k6.prototype.neg = function(t8) { + return t8.isZero() ? t8.clone() : (this || i$3).m.sub(t8)._forceRed(this || i$3); + }, k6.prototype.add = function(t8, r9) { + this._verify2(t8, r9); + var h9 = t8.add(r9); + return h9.cmp((this || i$3).m) >= 0 && h9.isub((this || i$3).m), h9._forceRed(this || i$3); + }, k6.prototype.iadd = function(t8, r9) { + this._verify2(t8, r9); + var h9 = t8.iadd(r9); + return h9.cmp((this || i$3).m) >= 0 && h9.isub((this || i$3).m), h9; + }, k6.prototype.sub = function(t8, r9) { + this._verify2(t8, r9); + var h9 = t8.sub(r9); + return h9.cmpn(0) < 0 && h9.iadd((this || i$3).m), h9._forceRed(this || i$3); + }, k6.prototype.isub = function(t8, r9) { + this._verify2(t8, r9); + var h9 = t8.isub(r9); + return h9.cmpn(0) < 0 && h9.iadd((this || i$3).m), h9; + }, k6.prototype.shl = function(t8, i7) { + return this._verify1(t8), this.imod(t8.ushln(i7)); + }, k6.prototype.imul = function(t8, i7) { + return this._verify2(t8, i7), this.imod(t8.imul(i7)); + }, k6.prototype.mul = function(t8, i7) { + return this._verify2(t8, i7), this.imod(t8.mul(i7)); + }, k6.prototype.isqr = function(t8) { + return this.imul(t8, t8.clone()); + }, k6.prototype.sqr = function(t8) { + return this.mul(t8, t8); + }, k6.prototype.sqrt = function(t8) { + if (t8.isZero()) + return t8.clone(); + var r9 = (this || i$3).m.andln(3); + if (n7(r9 % 2 == 1), 3 === r9) { + var h9 = (this || i$3).m.add(new o7(1)).iushrn(2); + return this.pow(t8, h9); + } + for (var e11 = (this || i$3).m.subn(1), s8 = 0; !e11.isZero() && 0 === e11.andln(1); ) + s8++, e11.iushrn(1); + n7(!e11.isZero()); + var u8 = new o7(1).toRed(this || i$3), a8 = u8.redNeg(), l8 = (this || i$3).m.subn(1).iushrn(1), m8 = (this || i$3).m.bitLength(); + for (m8 = new o7(2 * m8 * m8).toRed(this || i$3); 0 !== this.pow(m8, l8).cmp(a8); ) + m8.redIAdd(a8); + for (var f9 = this.pow(m8, e11), d8 = this.pow(t8, e11.addn(1).iushrn(1)), p8 = this.pow(t8, e11), M7 = s8; 0 !== p8.cmp(u8); ) { + for (var v9 = p8, g8 = 0; 0 !== v9.cmp(u8); g8++) + v9 = v9.redSqr(); + n7(g8 < M7); + var c8 = this.pow(f9, new o7(1).iushln(M7 - g8 - 1)); + d8 = d8.redMul(c8), f9 = c8.redSqr(), p8 = p8.redMul(f9), M7 = g8; + } + return d8; + }, k6.prototype.invm = function(t8) { + var r9 = t8._invmp((this || i$3).m); + return 0 !== r9.negative ? (r9.negative = 0, this.imod(r9).redNeg()) : this.imod(r9); + }, k6.prototype.pow = function(t8, r9) { + if (r9.isZero()) + return new o7(1).toRed(this || i$3); + if (0 === r9.cmpn(1)) + return t8.clone(); + var h9 = new Array(16); + h9[0] = new o7(1).toRed(this || i$3), h9[1] = t8; + for (var n8 = 2; n8 < h9.length; n8++) + h9[n8] = this.mul(h9[n8 - 1], t8); + var e11 = h9[0], s8 = 0, u8 = 0, a8 = r9.bitLength() % 26; + for (0 === a8 && (a8 = 26), n8 = r9.length - 1; n8 >= 0; n8--) { + for (var l8 = r9.words[n8], m8 = a8 - 1; m8 >= 0; m8--) { + var f9 = l8 >> m8 & 1; + e11 !== h9[0] && (e11 = this.sqr(e11)), 0 !== f9 || 0 !== s8 ? (s8 <<= 1, s8 |= f9, (4 === ++u8 || 0 === n8 && 0 === m8) && (e11 = this.mul(e11, h9[s8]), u8 = 0, s8 = 0)) : u8 = 0; + } + a8 = 26; + } + return e11; + }, k6.prototype.convertTo = function(t8) { + var r9 = t8.umod((this || i$3).m); + return r9 === t8 ? r9.clone() : r9; + }, k6.prototype.convertFrom = function(t8) { + var i7 = t8.clone(); + return i7.red = null, i7; + }, o7.mont = function(t8) { + return new A6(t8); + }, e10(A6, k6), A6.prototype.convertTo = function(t8) { + return this.imod(t8.ushln((this || i$3).shift)); + }, A6.prototype.convertFrom = function(t8) { + var r9 = this.imod(t8.mul((this || i$3).rinv)); + return r9.red = null, r9; + }, A6.prototype.imul = function(t8, r9) { + if (t8.isZero() || r9.isZero()) + return t8.words[0] = 0, t8.length = 1, t8; + var h9 = t8.imul(r9), n8 = h9.maskn((this || i$3).shift).mul((this || i$3).minv).imaskn((this || i$3).shift).mul((this || i$3).m), e11 = h9.isub(n8).iushrn((this || i$3).shift), o8 = e11; + return e11.cmp((this || i$3).m) >= 0 ? o8 = e11.isub((this || i$3).m) : e11.cmpn(0) < 0 && (o8 = e11.iadd((this || i$3).m)), o8._forceRed(this || i$3); + }, A6.prototype.mul = function(t8, r9) { + if (t8.isZero() || r9.isZero()) + return new o7(0)._forceRed(this || i$3); + var h9 = t8.mul(r9), n8 = h9.maskn((this || i$3).shift).mul((this || i$3).minv).imaskn((this || i$3).shift).mul((this || i$3).m), e11 = h9.isub(n8).iushrn((this || i$3).shift), s8 = e11; + return e11.cmp((this || i$3).m) >= 0 ? s8 = e11.isub((this || i$3).m) : e11.cmpn(0) < 0 && (s8 = e11.iadd((this || i$3).m)), s8._forceRed(this || i$3); + }, A6.prototype.invm = function(t8) { + return this.imod(t8._invmp((this || i$3).m).mul((this || i$3).r2))._forceRed(this || i$3); + }; + }(h$a, r$7); + n$c = h$a.exports; + r$8 = Object.freeze({}); + n$d = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + if ((t$5 = function(t8) { + return e$a || (e$a = new o$d(null)), e$a.generate(t8); + }).Rand = o$d, o$d.prototype.generate = function(t8) { + return this._rand(t8); + }, o$d.prototype._rand = function(t8) { + if ((this || n$d).rand.getBytes) + return (this || n$d).rand.getBytes(t8); + for (var e10 = new Uint8Array(t8), r8 = 0; r8 < e10.length; r8++) + e10[r8] = (this || n$d).rand.getByte(); + return e10; + }, "object" == typeof self) + self.crypto && self.crypto.getRandomValues ? o$d.prototype._rand = function(t8) { + var e10 = new Uint8Array(t8); + return self.crypto.getRandomValues(e10), e10; + } : self.msCrypto && self.msCrypto.getRandomValues ? o$d.prototype._rand = function(t8) { + var e10 = new Uint8Array(t8); + return self.msCrypto.getRandomValues(e10), e10; + } : "object" == typeof window && (o$d.prototype._rand = function() { + throw new Error("Not implemented yet"); + }); + else + try { + a$e = r$8; + if ("function" != typeof a$e.randomBytes) + throw new Error("Not supported"); + o$d.prototype._rand = function(t8) { + return a$e.randomBytes(t8); + }; + } catch (t8) { + } + f$i = t$5; + t$6 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + o$e = n$c; + a$f = f$i; + n$e = d$b, d$b.create = function(r8) { + return new d$b(r8); + }, d$b.prototype._randbelow = function(r8) { + var e10 = r8.bitLength(), n7 = Math.ceil(e10 / 8); + do { + var a7 = new o$e((this || t$6).rand.generate(n7)); + } while (a7.cmp(r8) >= 0); + return a7; + }, d$b.prototype._randrange = function(r8, e10) { + var n7 = e10.sub(r8); + return r8.add(this._randbelow(n7)); + }, d$b.prototype.test = function(r8, e10, n7) { + var t8 = r8.bitLength(), a7 = o$e.mont(r8), d7 = new o$e(1).toRed(a7); + e10 || (e10 = Math.max(1, t8 / 48 | 0)); + for (var i7 = r8.subn(1), f8 = 0; !i7.testn(f8); f8++) + ; + for (var u7 = r8.shrn(f8), p7 = i7.toRed(a7); e10 > 0; e10--) { + var c7 = this._randrange(new o$e(2), i7); + n7 && n7(c7); + var s7 = c7.toRed(a7).redPow(u7); + if (0 !== s7.cmp(d7) && 0 !== s7.cmp(p7)) { + for (var m7 = 1; m7 < f8; m7++) { + if (0 === (s7 = s7.redSqr()).cmp(d7)) + return false; + if (0 === s7.cmp(p7)) + break; + } + if (m7 === f8) + return false; + } + } + return true; + }, d$b.prototype.getDivisor = function(r8, e10) { + var n7 = r8.bitLength(), t8 = o$e.mont(r8), a7 = new o$e(1).toRed(t8); + e10 || (e10 = Math.max(1, n7 / 48 | 0)); + for (var d7 = r8.subn(1), i7 = 0; !d7.testn(i7); i7++) + ; + for (var f8 = r8.shrn(i7), u7 = d7.toRed(t8); e10 > 0; e10--) { + var p7 = this._randrange(new o$e(2), d7), c7 = r8.gcd(p7); + if (0 !== c7.cmpn(1)) + return c7; + var s7 = p7.toRed(t8).redPow(f8); + if (0 !== s7.cmp(a7) && 0 !== s7.cmp(u7)) { + for (var m7 = 1; m7 < i7; m7++) { + if (0 === (s7 = s7.redSqr()).cmp(a7)) + return s7.fromRed().subn(1).gcd(r8); + if (0 === s7.cmp(u7)) + break; + } + if (m7 === i7) + return (s7 = s7.redSqr()).fromRed().subn(1).gcd(r8); + } + } + return false; + }; + i$4 = n$e; + d$c = a5; + b$7 = v$9, v$9.simpleSieve = _$9, v$9.fermatTest = g$8; + r$9 = n$c; + t$7 = new r$9(24); + n$f = new i$4(); + i$5 = new r$9(1); + o$f = new r$9(2); + p$e = new r$9(5); + s$c = (new r$9(16), new r$9(8), new r$9(10)); + m$9 = new r$9(3); + u$b = (new r$9(7), new r$9(11)); + h$b = new r$9(4); + w$a = (new r$9(12), null); + P$2 = b$7; + B$5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + K$2 = e$1$1.Buffer; + R$1 = n$c; + S$5 = new i$4(); + x$2 = new R$1(24); + C$2 = new R$1(11); + D$2 = new R$1(10); + G$1 = new R$1(3); + H$2 = new R$1(7); + T$3 = P$2; + j$1 = a5; + y$9 = k$7; + M$4 = {}; + Object.defineProperty(k$7.prototype, "verifyError", { enumerable: true, get: function() { + return "number" != typeof (this || B$5)._primeCode && ((this || B$5)._primeCode = function(f8, e10) { + var c7 = e10.toString("hex"), a7 = [c7, f8.toString(16)].join("_"); + if (a7 in M$4) + return M$4[a7]; + var b8, d7 = 0; + if (f8.isEven() || !T$3.simpleSieve || !T$3.fermatTest(f8) || !S$5.test(f8)) + return d7 += 1, d7 += "02" === c7 || "05" === c7 ? 8 : 4, M$4[a7] = d7, d7; + switch (S$5.test(f8.shrn(1)) || (d7 += 2), c7) { + case "02": + f8.mod(x$2).cmp(C$2) && (d7 += 8); + break; + case "05": + (b8 = f8.mod(D$2)).cmp(G$1) && b8.cmp(H$2) && (d7 += 8); + break; + default: + d7 += 4; + } + return M$4[a7] = d7, d7; + }((this || B$5).__prime, (this || B$5).__gen)), (this || B$5)._primeCode; + } }), k$7.prototype.generateKeys = function() { + return (this || B$5)._priv || ((this || B$5)._priv = new R$1(j$1((this || B$5)._primeLen))), (this || B$5)._pub = (this || B$5)._gen.toRed((this || B$5)._prime).redPow((this || B$5)._priv).fromRed(), this.getPublicKey(); + }, k$7.prototype.computeSecret = function(f8) { + var e10 = (f8 = (f8 = new R$1(f8)).toRed((this || B$5)._prime)).redPow((this || B$5)._priv).fromRed(), c7 = new K$2(e10.toArray()), a7 = this.getPrime(); + if (c7.length < a7.length) { + var b8 = new K$2(a7.length - c7.length); + b8.fill(0), c7 = K$2.concat([b8, c7]); + } + return c7; + }, k$7.prototype.getPublicKey = function(f8) { + return A$5((this || B$5)._pub, f8); + }, k$7.prototype.getPrivateKey = function(f8) { + return A$5((this || B$5)._priv, f8); + }, k$7.prototype.getPrime = function(f8) { + return A$5((this || B$5).__prime, f8); + }, k$7.prototype.getGenerator = function(f8) { + return A$5((this || B$5)._gen, f8); + }, k$7.prototype.setGenerator = function(f8, e10) { + return e10 = e10 || "utf8", K$2.isBuffer(f8) || (f8 = new K$2(f8, e10)), (this || B$5).__gen = f8, (this || B$5)._gen = new R$1(f8), this || B$5; + }; + q$1 = y$9; + O$3 = {}; + z$3 = e$1$1.Buffer; + F$3 = P$2; + I$6 = { modp1: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" }, modp2: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" }, modp5: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" }, modp14: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" }, modp15: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" }, modp16: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" }, modp17: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" }, modp18: { gen: "02", prime: "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } }; + J$1 = q$1; + N$2 = { binary: true, hex: true, base64: true }; + O$3.DiffieHellmanGroup = O$3.createDiffieHellmanGroup = O$3.getDiffieHellman = function(f8) { + var e10 = new z$3(I$6[f8].prime, "hex"), c7 = new z$3(I$6[f8].gen, "hex"); + return new J$1(e10, c7); + }, O$3.createDiffieHellman = O$3.DiffieHellman = function f6(e10, c7, a7, b8) { + return z$3.isBuffer(c7) || void 0 === N$2[c7] ? f6(e10, "binary", c7, a7) : (c7 = c7 || "binary", b8 = b8 || "binary", a7 = a7 || new z$3([2]), z$3.isBuffer(a7) || (a7 = new z$3(a7, b8)), "number" == typeof e10 ? new J$1(F$3(e10, a7), a7, true) : (z$3.isBuffer(e10) || (e10 = new z$3(e10, c7)), new J$1(e10, a7, true))); + }; + u$c = e$1$1.Buffer; + n$g = n$c; + d$d = a5; + m$a = t$8, t$8.getr = i$6; + l$d = m$a; + r$a = {}; + e$b = r$a; + e$b.toArray = function(r8, e10) { + if (Array.isArray(r8)) + return r8.slice(); + if (!r8) + return []; + var t8 = []; + if ("string" != typeof r8) { + for (var n7 = 0; n7 < r8.length; n7++) + t8[n7] = 0 | r8[n7]; + return t8; + } + if ("hex" === e10) { + (r8 = r8.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (r8 = "0" + r8); + for (n7 = 0; n7 < r8.length; n7 += 2) + t8.push(parseInt(r8[n7] + r8[n7 + 1], 16)); + } else + for (n7 = 0; n7 < r8.length; n7++) { + var o7 = r8.charCodeAt(n7), u7 = o7 >> 8, f8 = 255 & o7; + u7 ? t8.push(u7, f8) : t8.push(f8); + } + return t8; + }, e$b.zero2 = t$9, e$b.toHex = n$h, e$b.encode = function(r8, e10) { + return "hex" === e10 ? n$h(r8) : r8; + }; + n$i = {}; + a$g = n$i; + i$7 = n$c; + o$g = o$7; + c$d = r$a; + a$g.assert = o$g, a$g.toArray = c$d.toArray, a$g.zero2 = c$d.zero2, a$g.toHex = c$d.toHex, a$g.encode = c$d.encode, a$g.getNAF = function(r8, t8, e10) { + var n7 = new Array(Math.max(r8.bitLength(), e10) + 1); + n7.fill(0); + for (var a7 = 1 << t8 + 1, i7 = r8.clone(), o7 = 0; o7 < n7.length; o7++) { + var c7, s7 = i7.andln(a7 - 1); + i7.isOdd() ? (c7 = s7 > (a7 >> 1) - 1 ? (a7 >> 1) - s7 : s7, i7.isubn(c7)) : c7 = 0, n7[o7] = c7, i7.iushrn(1); + } + return n7; + }, a$g.getJSF = function(r8, t8) { + var e10 = [[], []]; + r8 = r8.clone(), t8 = t8.clone(); + for (var n7 = 0, a7 = 0; r8.cmpn(-n7) > 0 || t8.cmpn(-a7) > 0; ) { + var i7, o7, c7, s7 = r8.andln(3) + n7 & 3, l7 = t8.andln(3) + a7 & 3; + if (3 === s7 && (s7 = -1), 3 === l7 && (l7 = -1), 0 == (1 & s7)) + i7 = 0; + else + i7 = 3 !== (c7 = r8.andln(7) + n7 & 7) && 5 !== c7 || 2 !== l7 ? s7 : -s7; + if (e10[0].push(i7), 0 == (1 & l7)) + o7 = 0; + else + o7 = 3 !== (c7 = t8.andln(7) + a7 & 7) && 5 !== c7 || 2 !== s7 ? l7 : -l7; + e10[1].push(o7), 2 * n7 === i7 + 1 && (n7 = 1 - n7), 2 * a7 === o7 + 1 && (a7 = 1 - a7), r8.iushrn(1), t8.iushrn(1); + } + return e10; + }, a$g.cachedProperty = function(r8, t8, e10) { + var n7 = "_" + t8; + r8.prototype[t8] = function() { + return void 0 !== this[n7] ? this[n7] : this[n7] = e10.call(this); + }; + }, a$g.parseBytes = function(r8) { + return "string" == typeof r8 ? a$g.toArray(r8, "hex") : r8; + }, a$g.intFromLE = function(r8) { + return new i$7(r8, "hex", "le"); + }; + l$e = n$c; + u$d = n$i; + h$c = u$d.assert; + s$d = p$f, p$f.prototype._importDER = function(r8, t8) { + r8 = u$d.toArray(r8, t8); + var e10 = new f$j(); + if (48 !== r8[e10.place++]) + return false; + if (v$a(r8, e10) + e10.place !== r8.length) + return false; + if (2 !== r8[e10.place++]) + return false; + var n7 = v$a(r8, e10), a7 = r8.slice(e10.place, n7 + e10.place); + if (e10.place += n7, 2 !== r8[e10.place++]) + return false; + var i7 = v$a(r8, e10); + if (r8.length !== i7 + e10.place) + return false; + var o7 = r8.slice(e10.place, i7 + e10.place); + return 0 === a7[0] && 128 & a7[1] && (a7 = a7.slice(1)), 0 === o7[0] && 128 & o7[1] && (o7 = o7.slice(1)), this.r = new l$e(a7), this.s = new l$e(o7), this.recoveryParam = null, true; + }, p$f.prototype.toDER = function(r8) { + var t8 = this.r.toArray(), e10 = this.s.toArray(); + for (128 & t8[0] && (t8 = [0].concat(t8)), 128 & e10[0] && (e10 = [0].concat(e10)), t8 = m$b(t8), e10 = m$b(e10); !(e10[0] || 128 & e10[1]); ) + e10 = e10.slice(1); + var n7 = [2]; + y$a(n7, t8.length), (n7 = n7.concat(t8)).push(2), y$a(n7, e10.length); + var a7 = n7.concat(e10), i7 = [48]; + return y$a(i7, a7.length), i7 = i7.concat(a7), u$d.encode(i7, r8); + }; + d$e = s$d; + r$b = {}; + i$8 = o$7; + e$c = t$2; + r$b.inherits = e$c, r$b.toArray = function(t8, n7) { + if (Array.isArray(t8)) + return t8.slice(); + if (!t8) + return []; + var r8 = []; + if ("string" == typeof t8) + if (n7) { + if ("hex" === n7) + for ((t8 = t8.replace(/[^a-z0-9]+/gi, "")).length % 2 != 0 && (t8 = "0" + t8), e10 = 0; e10 < t8.length; e10 += 2) + r8.push(parseInt(t8[e10] + t8[e10 + 1], 16)); + } else + for (var i7 = 0, e10 = 0; e10 < t8.length; e10++) { + var o7 = t8.charCodeAt(e10); + o7 < 128 ? r8[i7++] = o7 : o7 < 2048 ? (r8[i7++] = o7 >> 6 | 192, r8[i7++] = 63 & o7 | 128) : h$d(t8, e10) ? (o7 = 65536 + ((1023 & o7) << 10) + (1023 & t8.charCodeAt(++e10)), r8[i7++] = o7 >> 18 | 240, r8[i7++] = o7 >> 12 & 63 | 128, r8[i7++] = o7 >> 6 & 63 | 128, r8[i7++] = 63 & o7 | 128) : (r8[i7++] = o7 >> 12 | 224, r8[i7++] = o7 >> 6 & 63 | 128, r8[i7++] = 63 & o7 | 128); + } + else + for (e10 = 0; e10 < t8.length; e10++) + r8[e10] = 0 | t8[e10]; + return r8; + }, r$b.toHex = function(t8) { + for (var n7 = "", r8 = 0; r8 < t8.length; r8++) + n7 += u$e(t8[r8].toString(16)); + return n7; + }, r$b.htonl = o$h, r$b.toHex32 = function(t8, n7) { + for (var r8 = "", i7 = 0; i7 < t8.length; i7++) { + var e10 = t8[i7]; + "little" === n7 && (e10 = o$h(e10)), r8 += s$e(e10.toString(16)); + } + return r8; + }, r$b.zero2 = u$e, r$b.zero8 = s$e, r$b.join32 = function(t8, n7, r8, e10) { + var h8 = r8 - n7; + i$8(h8 % 4 == 0); + for (var o7 = new Array(h8 / 4), u7 = 0, s7 = n7; u7 < o7.length; u7++, s7 += 4) { + var a7; + a7 = "big" === e10 ? t8[s7] << 24 | t8[s7 + 1] << 16 | t8[s7 + 2] << 8 | t8[s7 + 3] : t8[s7 + 3] << 24 | t8[s7 + 2] << 16 | t8[s7 + 1] << 8 | t8[s7], o7[u7] = a7 >>> 0; + } + return o7; + }, r$b.split32 = function(t8, n7) { + for (var r8 = new Array(4 * t8.length), i7 = 0, e10 = 0; i7 < t8.length; i7++, e10 += 4) { + var h8 = t8[i7]; + "big" === n7 ? (r8[e10] = h8 >>> 24, r8[e10 + 1] = h8 >>> 16 & 255, r8[e10 + 2] = h8 >>> 8 & 255, r8[e10 + 3] = 255 & h8) : (r8[e10 + 3] = h8 >>> 24, r8[e10 + 2] = h8 >>> 16 & 255, r8[e10 + 1] = h8 >>> 8 & 255, r8[e10] = 255 & h8); + } + return r8; + }, r$b.rotr32 = function(t8, n7) { + return t8 >>> n7 | t8 << 32 - n7; + }, r$b.rotl32 = function(t8, n7) { + return t8 << n7 | t8 >>> 32 - n7; + }, r$b.sum32 = function(t8, n7) { + return t8 + n7 >>> 0; + }, r$b.sum32_3 = function(t8, n7, r8) { + return t8 + n7 + r8 >>> 0; + }, r$b.sum32_4 = function(t8, n7, r8, i7) { + return t8 + n7 + r8 + i7 >>> 0; + }, r$b.sum32_5 = function(t8, n7, r8, i7, e10) { + return t8 + n7 + r8 + i7 + e10 >>> 0; + }, r$b.sum64 = function(t8, n7, r8, i7) { + var e10 = t8[n7], h8 = i7 + t8[n7 + 1] >>> 0, o7 = (h8 < i7 ? 1 : 0) + r8 + e10; + t8[n7] = o7 >>> 0, t8[n7 + 1] = h8; + }, r$b.sum64_hi = function(t8, n7, r8, i7) { + return (n7 + i7 >>> 0 < n7 ? 1 : 0) + t8 + r8 >>> 0; + }, r$b.sum64_lo = function(t8, n7, r8, i7) { + return n7 + i7 >>> 0; + }, r$b.sum64_4_hi = function(t8, n7, r8, i7, e10, h8, o7, u7) { + var s7 = 0, a7 = n7; + return s7 += (a7 = a7 + i7 >>> 0) < n7 ? 1 : 0, s7 += (a7 = a7 + h8 >>> 0) < h8 ? 1 : 0, t8 + r8 + e10 + o7 + (s7 += (a7 = a7 + u7 >>> 0) < u7 ? 1 : 0) >>> 0; + }, r$b.sum64_4_lo = function(t8, n7, r8, i7, e10, h8, o7, u7) { + return n7 + i7 + h8 + u7 >>> 0; + }, r$b.sum64_5_hi = function(t8, n7, r8, i7, e10, h8, o7, u7, s7, a7) { + var l7 = 0, g7 = n7; + return l7 += (g7 = g7 + i7 >>> 0) < n7 ? 1 : 0, l7 += (g7 = g7 + h8 >>> 0) < h8 ? 1 : 0, l7 += (g7 = g7 + u7 >>> 0) < u7 ? 1 : 0, t8 + r8 + e10 + o7 + s7 + (l7 += (g7 = g7 + a7 >>> 0) < a7 ? 1 : 0) >>> 0; + }, r$b.sum64_5_lo = function(t8, n7, r8, i7, e10, h8, o7, u7, s7, a7) { + return n7 + i7 + h8 + u7 + a7 >>> 0; + }, r$b.rotr64_hi = function(t8, n7, r8) { + return (n7 << 32 - r8 | t8 >>> r8) >>> 0; + }, r$b.rotr64_lo = function(t8, n7, r8) { + return (t8 << 32 - r8 | n7 >>> r8) >>> 0; + }, r$b.shr64_hi = function(t8, n7, r8) { + return t8 >>> r8; + }, r$b.shr64_lo = function(t8, n7, r8) { + return (t8 << 32 - r8 | n7 >>> r8) >>> 0; + }; + a$h = {}; + l$f = r$b; + g$9 = o$7; + a$h.BlockHash = c$e, c$e.prototype.update = function(t8, n7) { + if (t8 = l$f.toArray(t8, n7), this.pending ? this.pending = this.pending.concat(t8) : this.pending = t8, this.pendingTotal += t8.length, this.pending.length >= this._delta8) { + var r8 = (t8 = this.pending).length % this._delta8; + this.pending = t8.slice(t8.length - r8, t8.length), 0 === this.pending.length && (this.pending = null), t8 = l$f.join32(t8, 0, t8.length - r8, this.endian); + for (var i7 = 0; i7 < t8.length; i7 += this._delta32) + this._update(t8, i7, i7 + this._delta32); + } + return this; + }, c$e.prototype.digest = function(t8) { + return this.update(this._pad()), g$9(null === this.pending), this._digest(t8); + }, c$e.prototype._pad = function() { + var t8 = this.pendingTotal, n7 = this._delta8, r8 = n7 - (t8 + this.padLength) % n7, i7 = new Array(r8 + this.padLength); + i7[0] = 128; + for (var e10 = 1; e10 < r8; e10++) + i7[e10] = 0; + if (t8 <<= 3, "big" === this.endian) { + for (var h8 = 8; h8 < this.padLength; h8++) + i7[e10++] = 0; + i7[e10++] = 0, i7[e10++] = 0, i7[e10++] = 0, i7[e10++] = 0, i7[e10++] = t8 >>> 24 & 255, i7[e10++] = t8 >>> 16 & 255, i7[e10++] = t8 >>> 8 & 255, i7[e10++] = 255 & t8; + } else + for (i7[e10++] = 255 & t8, i7[e10++] = t8 >>> 8 & 255, i7[e10++] = t8 >>> 16 & 255, i7[e10++] = t8 >>> 24 & 255, i7[e10++] = 0, i7[e10++] = 0, i7[e10++] = 0, i7[e10++] = 0, h8 = 8; h8 < this.padLength; h8++) + i7[e10++] = 0; + return i7; + }; + n$j = r$b; + s$f = a$h; + o$i = o$7; + e$d = n$j.rotr64_hi; + u$f = n$j.rotr64_lo; + a$i = n$j.shr64_hi; + c$f = n$j.shr64_lo; + f$k = n$j.sum64; + v$b = n$j.sum64_hi; + _$a = n$j.sum64_lo; + l$g = n$j.sum64_4_hi; + p$g = n$j.sum64_4_lo; + m$c = n$j.sum64_5_hi; + g$a = n$j.sum64_5_lo; + k$8 = s$f.BlockHash; + d$f = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]; + n$j.inherits(y$b, k$8), r$c = y$b, y$b.blockSize = 1024, y$b.outSize = 512, y$b.hmacStrength = 192, y$b.padLength = 128, y$b.prototype._prepareBlock = function(t8, h8) { + for (var i7 = this.W, r8 = 0; r8 < 32; r8++) + i7[r8] = t8[h8 + r8]; + for (; r8 < i7.length; r8 += 2) { + var n7 = L$2(i7[r8 - 4], i7[r8 - 3]), s7 = q$2(i7[r8 - 4], i7[r8 - 3]), o7 = i7[r8 - 14], e10 = i7[r8 - 13], u7 = j$2(i7[r8 - 30], i7[r8 - 29]), a7 = A$6(i7[r8 - 30], i7[r8 - 29]), c7 = i7[r8 - 32], f8 = i7[r8 - 31]; + i7[r8] = l$g(n7, s7, o7, e10, u7, a7, c7, f8), i7[r8 + 1] = p$g(n7, s7, o7, e10, u7, a7, c7, f8); + } + }, y$b.prototype._update = function(t8, h8) { + this._prepareBlock(t8, h8); + var i7 = this.W, r8 = this.h[0], n7 = this.h[1], s7 = this.h[2], e10 = this.h[3], u7 = this.h[4], a7 = this.h[5], c7 = this.h[6], l7 = this.h[7], p7 = this.h[8], k6 = this.h[9], d7 = this.h[10], y7 = this.h[11], j6 = this.h[12], A6 = this.h[13], L6 = this.h[14], q5 = this.h[15]; + o$i(this.k.length === i7.length); + for (var C6 = 0; C6 < i7.length; C6 += 2) { + var D6 = L6, E6 = q5, F6 = z$4(p7, k6), G5 = H$3(p7, k6), I6 = b$8(p7, k6, d7, y7, j6), J5 = x$3(p7, k6, d7, y7, j6, A6), K5 = this.k[C6], M6 = this.k[C6 + 1], N6 = i7[C6], O7 = i7[C6 + 1], P6 = m$c(D6, E6, F6, G5, I6, J5, K5, M6, N6, O7), Q5 = g$a(D6, E6, F6, G5, I6, J5, K5, M6, N6, O7); + D6 = W$1(r8, n7), E6 = w$b(r8, n7), F6 = B$6(r8, n7, s7, e10, u7), G5 = S$6(r8, n7, s7, e10, u7, a7); + var R6 = v$b(D6, E6, F6, G5), T6 = _$a(D6, E6, F6, G5); + L6 = j6, q5 = A6, j6 = d7, A6 = y7, d7 = p7, y7 = k6, p7 = v$b(c7, l7, P6, Q5), k6 = _$a(l7, l7, P6, Q5), c7 = u7, l7 = a7, u7 = s7, a7 = e10, s7 = r8, e10 = n7, r8 = v$b(P6, Q5, R6, T6), n7 = _$a(P6, Q5, R6, T6); + } + f$k(this.h, 0, r8, n7), f$k(this.h, 2, s7, e10), f$k(this.h, 4, u7, a7), f$k(this.h, 6, c7, l7), f$k(this.h, 8, p7, k6), f$k(this.h, 10, d7, y7), f$k(this.h, 12, j6, A6), f$k(this.h, 14, L6, q5); + }, y$b.prototype._digest = function(t8) { + return "hex" === t8 ? n$j.toHex32(this.h, "big") : n$j.split32(this.h, "big"); + }; + C$3 = r$c; + s$g = {}; + n$k = r$b.rotr32; + s$g.ft_1 = function(t8, h8, i7, s7) { + return 0 === t8 ? r$d(h8, i7, s7) : 1 === t8 || 3 === t8 ? o$j(h8, i7, s7) : 2 === t8 ? e$e(h8, i7, s7) : void 0; + }, s$g.ch32 = r$d, s$g.maj32 = e$e, s$g.p32 = o$j, s$g.s0_256 = function(t8) { + return n$k(t8, 2) ^ n$k(t8, 13) ^ n$k(t8, 22); + }, s$g.s1_256 = function(t8) { + return n$k(t8, 6) ^ n$k(t8, 11) ^ n$k(t8, 25); + }, s$g.g0_256 = function(t8) { + return n$k(t8, 7) ^ n$k(t8, 18) ^ t8 >>> 3; + }, s$g.g1_256 = function(t8) { + return n$k(t8, 17) ^ n$k(t8, 19) ^ t8 >>> 10; + }; + a$j = r$b; + c$g = a$h; + f$l = s$g; + _$b = o$7; + g$b = a$j.sum32; + m$d = a$j.sum32_4; + p$h = a$j.sum32_5; + l$h = f$l.ch32; + v$c = f$l.maj32; + d$g = f$l.s0_256; + k$9 = f$l.s1_256; + b$9 = f$l.g0_256; + j$3 = f$l.g1_256; + x$4 = c$g.BlockHash; + y$c = [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]; + a$j.inherits(S$7, x$4), u$g = S$7, S$7.blockSize = 512, S$7.outSize = 256, S$7.hmacStrength = 192, S$7.padLength = 64, S$7.prototype._update = function(t8, h8) { + for (var i7 = this.W, s7 = 0; s7 < 16; s7++) + i7[s7] = t8[h8 + s7]; + for (; s7 < i7.length; s7++) + i7[s7] = m$d(j$3(i7[s7 - 2]), i7[s7 - 7], b$9(i7[s7 - 15]), i7[s7 - 16]); + var n7 = this.h[0], r8 = this.h[1], e10 = this.h[2], o7 = this.h[3], u7 = this.h[4], a7 = this.h[5], c7 = this.h[6], f8 = this.h[7]; + for (_$b(this.k.length === i7.length), s7 = 0; s7 < i7.length; s7++) { + var x7 = p$h(f8, k$9(u7), l$h(u7, a7, c7), this.k[s7], i7[s7]), y7 = g$b(d$g(n7), v$c(n7, r8, e10)); + f8 = c7, c7 = a7, a7 = u7, u7 = g$b(o7, x7), o7 = e10, e10 = r8, r8 = n7, n7 = g$b(x7, y7); + } + this.h[0] = g$b(this.h[0], n7), this.h[1] = g$b(this.h[1], r8), this.h[2] = g$b(this.h[2], e10), this.h[3] = g$b(this.h[3], o7), this.h[4] = g$b(this.h[4], u7), this.h[5] = g$b(this.h[5], a7), this.h[6] = g$b(this.h[6], c7), this.h[7] = g$b(this.h[7], f8); + }, S$7.prototype._digest = function(t8) { + return "hex" === t8 ? a$j.toHex32(this.h, "big") : a$j.split32(this.h, "big"); + }; + w$c = u$g; + o$k = r$b; + a$k = a$h; + u$h = s$g; + l$i = o$k.rotl32; + c$h = o$k.sum32; + p$i = o$k.sum32_5; + f$m = u$h.ft_1; + g$c = a$k.BlockHash; + d$h = [1518500249, 1859775393, 2400959708, 3395469782]; + o$k.inherits(m$e, g$c), r$e = m$e, m$e.blockSize = 512, m$e.outSize = 160, m$e.hmacStrength = 80, m$e.padLength = 64, m$e.prototype._update = function(t8, h8) { + for (var i7 = this.W, s7 = 0; s7 < 16; s7++) + i7[s7] = t8[h8 + s7]; + for (; s7 < i7.length; s7++) + i7[s7] = l$i(i7[s7 - 3] ^ i7[s7 - 8] ^ i7[s7 - 14] ^ i7[s7 - 16], 1); + var e10 = this.h[0], n7 = this.h[1], r8 = this.h[2], o7 = this.h[3], a7 = this.h[4]; + for (s7 = 0; s7 < i7.length; s7++) { + var u7 = ~~(s7 / 20), g7 = p$i(l$i(e10, 5), f$m(u7, n7, r8, o7), a7, i7[s7], d$h[u7]); + a7 = o7, o7 = r8, r8 = l$i(n7, 30), n7 = e10, e10 = g7; + } + this.h[0] = c$h(this.h[0], e10), this.h[1] = c$h(this.h[1], n7), this.h[2] = c$h(this.h[2], r8), this.h[3] = c$h(this.h[3], o7), this.h[4] = c$h(this.h[4], a7); + }, m$e.prototype._digest = function(t8) { + return "hex" === t8 ? o$k.toHex32(this.h, "big") : o$k.split32(this.h, "big"); + }; + _$c = r$e; + b$a = r$b; + z$5 = w$c; + b$a.inherits(v$d, z$5), S$8 = v$d, v$d.blockSize = 512, v$d.outSize = 224, v$d.hmacStrength = 192, v$d.padLength = 64, v$d.prototype._digest = function(t8) { + return "hex" === t8 ? b$a.toHex32(this.h.slice(0, 7), "big") : b$a.split32(this.h.slice(0, 7), "big"); + }; + y$d = S$8; + H$4 = r$b; + w$d = C$3; + H$4.inherits(x$5, w$d), k$a = x$5, x$5.blockSize = 1024, x$5.outSize = 384, x$5.hmacStrength = 192, x$5.padLength = 128, x$5.prototype._digest = function(t8) { + return "hex" === t8 ? H$4.toHex32(this.h.slice(0, 12), "big") : H$4.split32(this.h.slice(0, 12), "big"); + }; + L$3 = k$a; + j$4 = {}; + j$4.sha1 = _$c, j$4.sha224 = y$d, j$4.sha256 = w$c, j$4.sha384 = L$3, j$4.sha512 = C$3; + A$7 = {}; + B$7 = r$b; + W$2 = a$h; + q$3 = B$7.rotl32; + C$4 = B$7.sum32; + D$3 = B$7.sum32_3; + E$7 = B$7.sum32_4; + F$4 = W$2.BlockHash; + B$7.inherits(G$2, F$4), A$7.ripemd160 = G$2, G$2.blockSize = 512, G$2.outSize = 160, G$2.hmacStrength = 192, G$2.padLength = 64, G$2.prototype._update = function(t8, h8) { + for (var i7 = this.h[0], s7 = this.h[1], e10 = this.h[2], n7 = this.h[3], r8 = this.h[4], o7 = i7, a7 = s7, u7 = e10, l7 = n7, c7 = r8, p7 = 0; p7 < 80; p7++) { + var f8 = C$4(q$3(E$7(i7, I$7(p7, s7, e10, n7), t8[N$3[p7] + h8], J$2(p7)), P$3[p7]), r8); + i7 = r8, r8 = n7, n7 = q$3(e10, 10), e10 = s7, s7 = f8, f8 = C$4(q$3(E$7(o7, I$7(79 - p7, a7, u7, l7), t8[O$4[p7] + h8], K$3(p7)), Q$1[p7]), c7), o7 = c7, c7 = l7, l7 = q$3(u7, 10), u7 = a7, a7 = f8; + } + f8 = D$3(this.h[1], e10, l7), this.h[1] = D$3(this.h[2], n7, c7), this.h[2] = D$3(this.h[3], r8, o7), this.h[3] = D$3(this.h[4], i7, a7), this.h[4] = D$3(this.h[0], s7, u7), this.h[0] = f8; + }, G$2.prototype._digest = function(t8) { + return "hex" === t8 ? B$7.toHex32(this.h, "little") : B$7.split32(this.h, "little"); + }; + N$3 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]; + O$4 = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]; + P$3 = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]; + Q$1 = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]; + R$2 = r$b; + T$4 = o$7; + M$5 = U$5, U$5.prototype._init = function(t8) { + t8.length > this.blockSize && (t8 = new this.Hash().update(t8).digest()), T$4(t8.length <= this.blockSize); + for (var h8 = t8.length; h8 < this.blockSize; h8++) + t8.push(0); + for (h8 = 0; h8 < t8.length; h8++) + t8[h8] ^= 54; + for (this.inner = new this.Hash().update(t8), h8 = 0; h8 < t8.length; h8++) + t8[h8] ^= 106; + this.outer = new this.Hash().update(t8); + }, U$5.prototype.update = function(t8, h8) { + return this.inner.update(t8, h8), this; + }, U$5.prototype.digest = function(t8) { + return this.outer.update(this.inner.digest()), this.outer.digest(t8); + }; + V$2 = M$5; + X$2 = {}; + Y$1 = X$2; + Y$1.utils = r$b, Y$1.common = a$h, Y$1.sha = j$4, Y$1.ripemd = A$7, Y$1.hmac = V$2, Y$1.sha1 = Y$1.sha.sha1, Y$1.sha256 = Y$1.sha.sha256, Y$1.sha224 = Y$1.sha.sha224, Y$1.sha384 = Y$1.sha.sha384, Y$1.sha512 = Y$1.sha.sha512, Y$1.ripemd160 = Y$1.ripemd.ripemd160; + h$e = X$2; + r$f = r$a; + n$l = o$7; + s$h = o$l, o$l.prototype._init = function(t8, e10, i7) { + var s7 = t8.concat(e10).concat(i7); + this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8); + for (var h8 = 0; h8 < this.V.length; h8++) + this.K[h8] = 0, this.V[h8] = 1; + this._update(s7), this._reseed = 1, this.reseedInterval = 281474976710656; + }, o$l.prototype._hmac = function() { + return new h$e.hmac(this.hash, this.K); + }, o$l.prototype._update = function(t8) { + var e10 = this._hmac().update(this.V).update([0]); + t8 && (e10 = e10.update(t8)), this.K = e10.digest(), this.V = this._hmac().update(this.V).digest(), t8 && (this.K = this._hmac().update(this.V).update([1]).update(t8).digest(), this.V = this._hmac().update(this.V).digest()); + }, o$l.prototype.reseed = function(t8, e10, i7, s7) { + "string" != typeof e10 && (s7 = i7, i7 = e10, e10 = null), t8 = r$f.toArray(t8, e10), i7 = r$f.toArray(i7, s7), n$l(t8.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t8.concat(i7 || [])), this._reseed = 1; + }, o$l.prototype.generate = function(t8, e10, i7, s7) { + if (this._reseed > this.reseedInterval) + throw new Error("Reseed is required"); + "string" != typeof e10 && (s7 = i7, i7 = e10, e10 = null), i7 && (i7 = r$f.toArray(i7, s7 || "hex"), this._update(i7)); + for (var h8 = []; h8.length < t8; ) + this.V = this._hmac().update(this.V).digest(), h8 = h8.concat(this.V); + var n7 = h8.slice(0, t8); + return this._update(i7), this._reseed++, r$f.encode(n7, e10); + }; + a$l = s$h; + i$9 = n$c; + n$m = n$i; + s$i = n$m.getNAF; + o$m = n$m.getJSF; + u$i = n$m.assert; + b$b = h$f, h$f.prototype.point = function() { + throw new Error("Not implemented"); + }, h$f.prototype.validate = function() { + throw new Error("Not implemented"); + }, h$f.prototype._fixedNafMul = function(e10, f8) { + u$i(e10.precomputed); + var d7 = e10._getDoubles(), c7 = s$i(f8, 1, this._bitLength), t8 = (1 << d7.step + 1) - (d7.step % 2 == 0 ? 2 : 1); + t8 /= 3; + for (var a7 = [], r8 = 0; r8 < c7.length; r8 += d7.step) { + var b8 = 0; + for (f8 = r8 + d7.step - 1; f8 >= r8; f8--) + b8 = (b8 << 1) + c7[f8]; + a7.push(b8); + } + for (var i7 = this.jpoint(null, null, null), n7 = this.jpoint(null, null, null), o7 = t8; o7 > 0; o7--) { + for (r8 = 0; r8 < a7.length; r8++) { + (b8 = a7[r8]) === o7 ? n7 = n7.mixedAdd(d7.points[r8]) : b8 === -o7 && (n7 = n7.mixedAdd(d7.points[r8].neg())); + } + i7 = i7.add(n7); + } + return i7.toP(); + }, h$f.prototype._wnafMul = function(e10, f8) { + var d7 = 4, c7 = e10._getNAFPoints(d7); + d7 = c7.wnd; + for (var t8 = c7.points, a7 = s$i(f8, d7, this._bitLength), r8 = this.jpoint(null, null, null), b8 = a7.length - 1; b8 >= 0; b8--) { + for (f8 = 0; b8 >= 0 && 0 === a7[b8]; b8--) + f8++; + if (b8 >= 0 && f8++, r8 = r8.dblp(f8), b8 < 0) + break; + var i7 = a7[b8]; + u$i(0 !== i7), r8 = "affine" === e10.type ? i7 > 0 ? r8.mixedAdd(t8[i7 - 1 >> 1]) : r8.mixedAdd(t8[-i7 - 1 >> 1].neg()) : i7 > 0 ? r8.add(t8[i7 - 1 >> 1]) : r8.add(t8[-i7 - 1 >> 1].neg()); + } + return "affine" === e10.type ? r8.toP() : r8; + }, h$f.prototype._wnafMulAdd = function(e10, f8, d7, c7, t8) { + for (var a7 = this._wnafT1, r8 = this._wnafT2, b8 = this._wnafT3, i7 = 0, n7 = 0; n7 < c7; n7++) { + var u7 = (x7 = f8[n7])._getNAFPoints(e10); + a7[n7] = u7.wnd, r8[n7] = u7.points; + } + for (n7 = c7 - 1; n7 >= 1; n7 -= 2) { + var h8 = n7 - 1, p7 = n7; + if (1 === a7[h8] && 1 === a7[p7]) { + var l7 = [f8[h8], null, null, f8[p7]]; + 0 === f8[h8].y.cmp(f8[p7].y) ? (l7[1] = f8[h8].add(f8[p7]), l7[2] = f8[h8].toJ().mixedAdd(f8[p7].neg())) : 0 === f8[h8].y.cmp(f8[p7].y.redNeg()) ? (l7[1] = f8[h8].toJ().mixedAdd(f8[p7]), l7[2] = f8[h8].add(f8[p7].neg())) : (l7[1] = f8[h8].toJ().mixedAdd(f8[p7]), l7[2] = f8[h8].toJ().mixedAdd(f8[p7].neg())); + var v8 = [-3, -1, -5, -7, 0, 7, 5, 1, 3], y7 = o$m(d7[h8], d7[p7]); + i7 = Math.max(y7[0].length, i7), b8[h8] = new Array(i7), b8[p7] = new Array(i7); + for (var m7 = 0; m7 < i7; m7++) { + var S6 = 0 | y7[0][m7], g7 = 0 | y7[1][m7]; + b8[h8][m7] = v8[3 * (S6 + 1) + (g7 + 1)], b8[p7][m7] = 0, r8[h8] = l7; + } + } else + b8[h8] = s$i(d7[h8], a7[h8], this._bitLength), b8[p7] = s$i(d7[p7], a7[p7], this._bitLength), i7 = Math.max(b8[h8].length, i7), i7 = Math.max(b8[p7].length, i7); + } + var A6 = this.jpoint(null, null, null), I6 = this._wnafT4; + for (n7 = i7; n7 >= 0; n7--) { + for (var w6 = 0; n7 >= 0; ) { + var M6 = true; + for (m7 = 0; m7 < c7; m7++) + I6[m7] = 0 | b8[m7][n7], 0 !== I6[m7] && (M6 = false); + if (!M6) + break; + w6++, n7--; + } + if (n7 >= 0 && w6++, A6 = A6.dblp(w6), n7 < 0) + break; + for (m7 = 0; m7 < c7; m7++) { + var x7, _6 = I6[m7]; + 0 !== _6 && (_6 > 0 ? x7 = r8[m7][_6 - 1 >> 1] : _6 < 0 && (x7 = r8[m7][-_6 - 1 >> 1].neg()), A6 = "affine" === x7.type ? A6.mixedAdd(x7) : A6.add(x7)); + } + } + for (n7 = 0; n7 < c7; n7++) + r8[n7] = null; + return t8 ? A6 : A6.toP(); + }, h$f.BasePoint = p$j, p$j.prototype.eq = function() { + throw new Error("Not implemented"); + }, p$j.prototype.validate = function() { + return this.curve.validate(this); + }, h$f.prototype.decodePoint = function(e10, f8) { + e10 = n$m.toArray(e10, f8); + var d7 = this.p.byteLength(); + if ((4 === e10[0] || 6 === e10[0] || 7 === e10[0]) && e10.length - 1 == 2 * d7) + return 6 === e10[0] ? u$i(e10[e10.length - 1] % 2 == 0) : 7 === e10[0] && u$i(e10[e10.length - 1] % 2 == 1), this.point(e10.slice(1, 1 + d7), e10.slice(1 + d7, 1 + 2 * d7)); + if ((2 === e10[0] || 3 === e10[0]) && e10.length - 1 === d7) + return this.pointFromX(e10.slice(1, 1 + d7), 3 === e10[0]); + throw new Error("Unknown point format"); + }, p$j.prototype.encodeCompressed = function(e10) { + return this.encode(e10, true); + }, p$j.prototype._encode = function(e10) { + var f8 = this.curve.p.byteLength(), d7 = this.getX().toArray("be", f8); + return e10 ? [this.getY().isEven() ? 2 : 3].concat(d7) : [4].concat(d7, this.getY().toArray("be", f8)); + }, p$j.prototype.encode = function(e10, f8) { + return n$m.encode(this._encode(f8), e10); + }, p$j.prototype.precompute = function(e10) { + if (this.precomputed) + return this; + var f8 = { doubles: null, naf: null, beta: null }; + return f8.naf = this._getNAFPoints(8), f8.doubles = this._getDoubles(4, e10), f8.beta = this._getBeta(), this.precomputed = f8, this; + }, p$j.prototype._hasDoubles = function(e10) { + if (!this.precomputed) + return false; + var f8 = this.precomputed.doubles; + return !!f8 && f8.points.length >= Math.ceil((e10.bitLength() + 1) / f8.step); + }, p$j.prototype._getDoubles = function(e10, f8) { + if (this.precomputed && this.precomputed.doubles) + return this.precomputed.doubles; + for (var d7 = [this], c7 = this, t8 = 0; t8 < f8; t8 += e10) { + for (var a7 = 0; a7 < e10; a7++) + c7 = c7.dbl(); + d7.push(c7); + } + return { step: e10, points: d7 }; + }, p$j.prototype._getNAFPoints = function(e10) { + if (this.precomputed && this.precomputed.naf) + return this.precomputed.naf; + for (var f8 = [this], d7 = (1 << e10) - 1, c7 = 1 === d7 ? null : this.dbl(), t8 = 1; t8 < d7; t8++) + f8[t8] = f8[t8 - 1].add(c7); + return { wnd: e10, points: f8 }; + }, p$j.prototype._getBeta = function() { + return null; + }, p$j.prototype.dblp = function(e10) { + for (var f8 = this, d7 = 0; d7 < e10; d7++) + f8 = f8.dbl(); + return f8; + }; + v$e = b$b; + y$e = n$c; + m$f = t$2; + S$9 = v$e; + g$d = n$i.assert; + m$f(A$8, S$9), l$j = A$8, A$8.prototype._getEndomorphism = function(e10) { + if (this.zeroA && this.g && this.n && 1 === this.p.modn(3)) { + var f8, d7; + if (e10.beta) + f8 = new y$e(e10.beta, 16).toRed(this.red); + else { + var c7 = this._getEndoRoots(this.p); + f8 = (f8 = c7[0].cmp(c7[1]) < 0 ? c7[0] : c7[1]).toRed(this.red); + } + if (e10.lambda) + d7 = new y$e(e10.lambda, 16); + else { + var t8 = this._getEndoRoots(this.n); + 0 === this.g.mul(t8[0]).x.cmp(this.g.x.redMul(f8)) ? d7 = t8[0] : (d7 = t8[1], g$d(0 === this.g.mul(d7).x.cmp(this.g.x.redMul(f8)))); + } + return { beta: f8, lambda: d7, basis: e10.basis ? e10.basis.map(function(e11) { + return { a: new y$e(e11.a, 16), b: new y$e(e11.b, 16) }; + }) : this._getEndoBasis(d7) }; + } + }, A$8.prototype._getEndoRoots = function(e10) { + var f8 = e10 === this.p ? this.red : y$e.mont(e10), d7 = new y$e(2).toRed(f8).redInvm(), c7 = d7.redNeg(), t8 = new y$e(3).toRed(f8).redNeg().redSqrt().redMul(d7); + return [c7.redAdd(t8).fromRed(), c7.redSub(t8).fromRed()]; + }, A$8.prototype._getEndoBasis = function(e10) { + for (var f8, d7, c7, t8, a7, r8, b8, i7, n7, s7 = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), o7 = e10, u7 = this.n.clone(), h8 = new y$e(1), p7 = new y$e(0), l7 = new y$e(0), v8 = new y$e(1), m7 = 0; 0 !== o7.cmpn(0); ) { + var S6 = u7.div(o7); + i7 = u7.sub(S6.mul(o7)), n7 = l7.sub(S6.mul(h8)); + var g7 = v8.sub(S6.mul(p7)); + if (!c7 && i7.cmp(s7) < 0) + f8 = b8.neg(), d7 = h8, c7 = i7.neg(), t8 = n7; + else if (c7 && 2 == ++m7) + break; + b8 = i7, u7 = o7, o7 = i7, l7 = h8, h8 = n7, v8 = p7, p7 = g7; + } + a7 = i7.neg(), r8 = n7; + var A6 = c7.sqr().add(t8.sqr()); + return a7.sqr().add(r8.sqr()).cmp(A6) >= 0 && (a7 = f8, r8 = d7), c7.negative && (c7 = c7.neg(), t8 = t8.neg()), a7.negative && (a7 = a7.neg(), r8 = r8.neg()), [{ a: c7, b: t8 }, { a: a7, b: r8 }]; + }, A$8.prototype._endoSplit = function(e10) { + var f8 = this.endo.basis, d7 = f8[0], c7 = f8[1], t8 = c7.b.mul(e10).divRound(this.n), a7 = d7.b.neg().mul(e10).divRound(this.n), r8 = t8.mul(d7.a), b8 = a7.mul(c7.a), i7 = t8.mul(d7.b), n7 = a7.mul(c7.b); + return { k1: e10.sub(r8).sub(b8), k2: i7.add(n7).neg() }; + }, A$8.prototype.pointFromX = function(e10, f8) { + (e10 = new y$e(e10, 16)).red || (e10 = e10.toRed(this.red)); + var d7 = e10.redSqr().redMul(e10).redIAdd(e10.redMul(this.a)).redIAdd(this.b), c7 = d7.redSqrt(); + if (0 !== c7.redSqr().redSub(d7).cmp(this.zero)) + throw new Error("invalid point"); + var t8 = c7.fromRed().isOdd(); + return (f8 && !t8 || !f8 && t8) && (c7 = c7.redNeg()), this.point(e10, c7); + }, A$8.prototype.validate = function(e10) { + if (e10.inf) + return true; + var f8 = e10.x, d7 = e10.y, c7 = this.a.redMul(f8), t8 = f8.redSqr().redMul(f8).redIAdd(c7).redIAdd(this.b); + return 0 === d7.redSqr().redISub(t8).cmpn(0); + }, A$8.prototype._endoWnafMulAdd = function(e10, f8, d7) { + for (var c7 = this._endoWnafT1, t8 = this._endoWnafT2, a7 = 0; a7 < e10.length; a7++) { + var r8 = this._endoSplit(f8[a7]), b8 = e10[a7], i7 = b8._getBeta(); + r8.k1.negative && (r8.k1.ineg(), b8 = b8.neg(true)), r8.k2.negative && (r8.k2.ineg(), i7 = i7.neg(true)), c7[2 * a7] = b8, c7[2 * a7 + 1] = i7, t8[2 * a7] = r8.k1, t8[2 * a7 + 1] = r8.k2; + } + for (var n7 = this._wnafMulAdd(1, c7, t8, 2 * a7, d7), s7 = 0; s7 < 2 * a7; s7++) + c7[s7] = null, t8[s7] = null; + return n7; + }, m$f(I$8, S$9.BasePoint), A$8.prototype.point = function(e10, f8, d7) { + return new I$8(this, e10, f8, d7); + }, A$8.prototype.pointFromJSON = function(e10, f8) { + return I$8.fromJSON(this, e10, f8); + }, I$8.prototype._getBeta = function() { + if (this.curve.endo) { + var e10 = this.precomputed; + if (e10 && e10.beta) + return e10.beta; + var f8 = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); + if (e10) { + var d7 = this.curve, c7 = function(e11) { + return d7.point(e11.x.redMul(d7.endo.beta), e11.y); + }; + e10.beta = f8, f8.precomputed = { beta: null, naf: e10.naf && { wnd: e10.naf.wnd, points: e10.naf.points.map(c7) }, doubles: e10.doubles && { step: e10.doubles.step, points: e10.doubles.points.map(c7) } }; + } + return f8; + } + }, I$8.prototype.toJSON = function() { + return this.precomputed ? [this.x, this.y, this.precomputed && { doubles: this.precomputed.doubles && { step: this.precomputed.doubles.step, points: this.precomputed.doubles.points.slice(1) }, naf: this.precomputed.naf && { wnd: this.precomputed.naf.wnd, points: this.precomputed.naf.points.slice(1) } }] : [this.x, this.y]; + }, I$8.fromJSON = function(e10, f8, d7) { + "string" == typeof f8 && (f8 = JSON.parse(f8)); + var c7 = e10.point(f8[0], f8[1], d7); + if (!f8[2]) + return c7; + function t8(f9) { + return e10.point(f9[0], f9[1], d7); + } + var a7 = f8[2]; + return c7.precomputed = { beta: null, doubles: a7.doubles && { step: a7.doubles.step, points: [c7].concat(a7.doubles.points.map(t8)) }, naf: a7.naf && { wnd: a7.naf.wnd, points: [c7].concat(a7.naf.points.map(t8)) } }, c7; + }, I$8.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, I$8.prototype.isInfinity = function() { + return this.inf; + }, I$8.prototype.add = function(e10) { + if (this.inf) + return e10; + if (e10.inf) + return this; + if (this.eq(e10)) + return this.dbl(); + if (this.neg().eq(e10)) + return this.curve.point(null, null); + if (0 === this.x.cmp(e10.x)) + return this.curve.point(null, null); + var f8 = this.y.redSub(e10.y); + 0 !== f8.cmpn(0) && (f8 = f8.redMul(this.x.redSub(e10.x).redInvm())); + var d7 = f8.redSqr().redISub(this.x).redISub(e10.x), c7 = f8.redMul(this.x.redSub(d7)).redISub(this.y); + return this.curve.point(d7, c7); + }, I$8.prototype.dbl = function() { + if (this.inf) + return this; + var e10 = this.y.redAdd(this.y); + if (0 === e10.cmpn(0)) + return this.curve.point(null, null); + var f8 = this.curve.a, d7 = this.x.redSqr(), c7 = e10.redInvm(), t8 = d7.redAdd(d7).redIAdd(d7).redIAdd(f8).redMul(c7), a7 = t8.redSqr().redISub(this.x.redAdd(this.x)), r8 = t8.redMul(this.x.redSub(a7)).redISub(this.y); + return this.curve.point(a7, r8); + }, I$8.prototype.getX = function() { + return this.x.fromRed(); + }, I$8.prototype.getY = function() { + return this.y.fromRed(); + }, I$8.prototype.mul = function(e10) { + return e10 = new y$e(e10, 16), this.isInfinity() ? this : this._hasDoubles(e10) ? this.curve._fixedNafMul(this, e10) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e10]) : this.curve._wnafMul(this, e10); + }, I$8.prototype.mulAdd = function(e10, f8, d7) { + var c7 = [this, f8], t8 = [e10, d7]; + return this.curve.endo ? this.curve._endoWnafMulAdd(c7, t8) : this.curve._wnafMulAdd(1, c7, t8, 2); + }, I$8.prototype.jmulAdd = function(e10, f8, d7) { + var c7 = [this, f8], t8 = [e10, d7]; + return this.curve.endo ? this.curve._endoWnafMulAdd(c7, t8, true) : this.curve._wnafMulAdd(1, c7, t8, 2, true); + }, I$8.prototype.eq = function(e10) { + return this === e10 || this.inf === e10.inf && (this.inf || 0 === this.x.cmp(e10.x) && 0 === this.y.cmp(e10.y)); + }, I$8.prototype.neg = function(e10) { + if (this.inf) + return this; + var f8 = this.curve.point(this.x, this.y.redNeg()); + if (e10 && this.precomputed) { + var d7 = this.precomputed, c7 = function(e11) { + return e11.neg(); + }; + f8.precomputed = { naf: d7.naf && { wnd: d7.naf.wnd, points: d7.naf.points.map(c7) }, doubles: d7.doubles && { step: d7.doubles.step, points: d7.doubles.points.map(c7) } }; + } + return f8; + }, I$8.prototype.toJ = function() { + return this.inf ? this.curve.jpoint(null, null, null) : this.curve.jpoint(this.x, this.y, this.curve.one); + }, m$f(w$e, S$9.BasePoint), A$8.prototype.jpoint = function(e10, f8, d7) { + return new w$e(this, e10, f8, d7); + }, w$e.prototype.toP = function() { + if (this.isInfinity()) + return this.curve.point(null, null); + var e10 = this.z.redInvm(), f8 = e10.redSqr(), d7 = this.x.redMul(f8), c7 = this.y.redMul(f8).redMul(e10); + return this.curve.point(d7, c7); + }, w$e.prototype.neg = function() { + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + }, w$e.prototype.add = function(e10) { + if (this.isInfinity()) + return e10; + if (e10.isInfinity()) + return this; + var f8 = e10.z.redSqr(), d7 = this.z.redSqr(), c7 = this.x.redMul(f8), t8 = e10.x.redMul(d7), a7 = this.y.redMul(f8.redMul(e10.z)), r8 = e10.y.redMul(d7.redMul(this.z)), b8 = c7.redSub(t8), i7 = a7.redSub(r8); + if (0 === b8.cmpn(0)) + return 0 !== i7.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var n7 = b8.redSqr(), s7 = n7.redMul(b8), o7 = c7.redMul(n7), u7 = i7.redSqr().redIAdd(s7).redISub(o7).redISub(o7), h8 = i7.redMul(o7.redISub(u7)).redISub(a7.redMul(s7)), p7 = this.z.redMul(e10.z).redMul(b8); + return this.curve.jpoint(u7, h8, p7); + }, w$e.prototype.mixedAdd = function(e10) { + if (this.isInfinity()) + return e10.toJ(); + if (e10.isInfinity()) + return this; + var f8 = this.z.redSqr(), d7 = this.x, c7 = e10.x.redMul(f8), t8 = this.y, a7 = e10.y.redMul(f8).redMul(this.z), r8 = d7.redSub(c7), b8 = t8.redSub(a7); + if (0 === r8.cmpn(0)) + return 0 !== b8.cmpn(0) ? this.curve.jpoint(null, null, null) : this.dbl(); + var i7 = r8.redSqr(), n7 = i7.redMul(r8), s7 = d7.redMul(i7), o7 = b8.redSqr().redIAdd(n7).redISub(s7).redISub(s7), u7 = b8.redMul(s7.redISub(o7)).redISub(t8.redMul(n7)), h8 = this.z.redMul(r8); + return this.curve.jpoint(o7, u7, h8); + }, w$e.prototype.dblp = function(e10) { + if (0 === e10) + return this; + if (this.isInfinity()) + return this; + if (!e10) + return this.dbl(); + if (this.curve.zeroA || this.curve.threeA) { + for (var f8 = this, d7 = 0; d7 < e10; d7++) + f8 = f8.dbl(); + return f8; + } + var c7 = this.curve.a, t8 = this.curve.tinv, a7 = this.x, r8 = this.y, b8 = this.z, i7 = b8.redSqr().redSqr(), n7 = r8.redAdd(r8); + for (d7 = 0; d7 < e10; d7++) { + var s7 = a7.redSqr(), o7 = n7.redSqr(), u7 = o7.redSqr(), h8 = s7.redAdd(s7).redIAdd(s7).redIAdd(c7.redMul(i7)), p7 = a7.redMul(o7), l7 = h8.redSqr().redISub(p7.redAdd(p7)), v8 = p7.redISub(l7), y7 = h8.redMul(v8); + y7 = y7.redIAdd(y7).redISub(u7); + var m7 = n7.redMul(b8); + d7 + 1 < e10 && (i7 = i7.redMul(u7)), a7 = l7, b8 = m7, n7 = y7; + } + return this.curve.jpoint(a7, n7.redMul(t8), b8); + }, w$e.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl(); + }, w$e.prototype._zeroDbl = function() { + var e10, f8, d7; + if (this.zOne) { + var c7 = this.x.redSqr(), t8 = this.y.redSqr(), a7 = t8.redSqr(), r8 = this.x.redAdd(t8).redSqr().redISub(c7).redISub(a7); + r8 = r8.redIAdd(r8); + var b8 = c7.redAdd(c7).redIAdd(c7), i7 = b8.redSqr().redISub(r8).redISub(r8), n7 = a7.redIAdd(a7); + n7 = (n7 = n7.redIAdd(n7)).redIAdd(n7), e10 = i7, f8 = b8.redMul(r8.redISub(i7)).redISub(n7), d7 = this.y.redAdd(this.y); + } else { + var s7 = this.x.redSqr(), o7 = this.y.redSqr(), u7 = o7.redSqr(), h8 = this.x.redAdd(o7).redSqr().redISub(s7).redISub(u7); + h8 = h8.redIAdd(h8); + var p7 = s7.redAdd(s7).redIAdd(s7), l7 = p7.redSqr(), v8 = u7.redIAdd(u7); + v8 = (v8 = v8.redIAdd(v8)).redIAdd(v8), e10 = l7.redISub(h8).redISub(h8), f8 = p7.redMul(h8.redISub(e10)).redISub(v8), d7 = (d7 = this.y.redMul(this.z)).redIAdd(d7); + } + return this.curve.jpoint(e10, f8, d7); + }, w$e.prototype._threeDbl = function() { + var e10, f8, d7; + if (this.zOne) { + var c7 = this.x.redSqr(), t8 = this.y.redSqr(), a7 = t8.redSqr(), r8 = this.x.redAdd(t8).redSqr().redISub(c7).redISub(a7); + r8 = r8.redIAdd(r8); + var b8 = c7.redAdd(c7).redIAdd(c7).redIAdd(this.curve.a), i7 = b8.redSqr().redISub(r8).redISub(r8); + e10 = i7; + var n7 = a7.redIAdd(a7); + n7 = (n7 = n7.redIAdd(n7)).redIAdd(n7), f8 = b8.redMul(r8.redISub(i7)).redISub(n7), d7 = this.y.redAdd(this.y); + } else { + var s7 = this.z.redSqr(), o7 = this.y.redSqr(), u7 = this.x.redMul(o7), h8 = this.x.redSub(s7).redMul(this.x.redAdd(s7)); + h8 = h8.redAdd(h8).redIAdd(h8); + var p7 = u7.redIAdd(u7), l7 = (p7 = p7.redIAdd(p7)).redAdd(p7); + e10 = h8.redSqr().redISub(l7), d7 = this.y.redAdd(this.z).redSqr().redISub(o7).redISub(s7); + var v8 = o7.redSqr(); + v8 = (v8 = (v8 = v8.redIAdd(v8)).redIAdd(v8)).redIAdd(v8), f8 = h8.redMul(p7.redISub(e10)).redISub(v8); + } + return this.curve.jpoint(e10, f8, d7); + }, w$e.prototype._dbl = function() { + var e10 = this.curve.a, f8 = this.x, d7 = this.y, c7 = this.z, t8 = c7.redSqr().redSqr(), a7 = f8.redSqr(), r8 = d7.redSqr(), b8 = a7.redAdd(a7).redIAdd(a7).redIAdd(e10.redMul(t8)), i7 = f8.redAdd(f8), n7 = (i7 = i7.redIAdd(i7)).redMul(r8), s7 = b8.redSqr().redISub(n7.redAdd(n7)), o7 = n7.redISub(s7), u7 = r8.redSqr(); + u7 = (u7 = (u7 = u7.redIAdd(u7)).redIAdd(u7)).redIAdd(u7); + var h8 = b8.redMul(o7).redISub(u7), p7 = d7.redAdd(d7).redMul(c7); + return this.curve.jpoint(s7, h8, p7); + }, w$e.prototype.trpl = function() { + if (!this.curve.zeroA) + return this.dbl().add(this); + var e10 = this.x.redSqr(), f8 = this.y.redSqr(), d7 = this.z.redSqr(), c7 = f8.redSqr(), t8 = e10.redAdd(e10).redIAdd(e10), a7 = t8.redSqr(), r8 = this.x.redAdd(f8).redSqr().redISub(e10).redISub(c7), b8 = (r8 = (r8 = (r8 = r8.redIAdd(r8)).redAdd(r8).redIAdd(r8)).redISub(a7)).redSqr(), i7 = c7.redIAdd(c7); + i7 = (i7 = (i7 = i7.redIAdd(i7)).redIAdd(i7)).redIAdd(i7); + var n7 = t8.redIAdd(r8).redSqr().redISub(a7).redISub(b8).redISub(i7), s7 = f8.redMul(n7); + s7 = (s7 = s7.redIAdd(s7)).redIAdd(s7); + var o7 = this.x.redMul(b8).redISub(s7); + o7 = (o7 = o7.redIAdd(o7)).redIAdd(o7); + var u7 = this.y.redMul(n7.redMul(i7.redISub(n7)).redISub(r8.redMul(b8))); + u7 = (u7 = (u7 = u7.redIAdd(u7)).redIAdd(u7)).redIAdd(u7); + var h8 = this.z.redAdd(r8).redSqr().redISub(d7).redISub(b8); + return this.curve.jpoint(o7, u7, h8); + }, w$e.prototype.mul = function(e10, f8) { + return e10 = new y$e(e10, f8), this.curve._wnafMul(this, e10); + }, w$e.prototype.eq = function(e10) { + if ("affine" === e10.type) + return this.eq(e10.toJ()); + if (this === e10) + return true; + var f8 = this.z.redSqr(), d7 = e10.z.redSqr(); + if (0 !== this.x.redMul(d7).redISub(e10.x.redMul(f8)).cmpn(0)) + return false; + var c7 = f8.redMul(this.z), t8 = d7.redMul(e10.z); + return 0 === this.y.redMul(t8).redISub(e10.y.redMul(c7)).cmpn(0); + }, w$e.prototype.eqXToP = function(e10) { + var f8 = this.z.redSqr(), d7 = e10.toRed(this.curve.red).redMul(f8); + if (0 === this.x.cmp(d7)) + return true; + for (var c7 = e10.clone(), t8 = this.curve.redN.redMul(f8); ; ) { + if (c7.iadd(this.curve.n), c7.cmp(this.curve.p) >= 0) + return false; + if (d7.redIAdd(t8), 0 === this.x.cmp(d7)) + return true; + } + }, w$e.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, w$e.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }; + x$6 = l$j; + _$d = n$c; + z$6 = t$2; + q$4 = v$e; + R$3 = n$i; + z$6(P$4, q$4), M$6 = P$4, P$4.prototype.validate = function(e10) { + var f8 = e10.normalize().x, d7 = f8.redSqr(), c7 = d7.redMul(f8).redAdd(d7.redMul(this.a)).redAdd(f8); + return 0 === c7.redSqrt().redSqr().cmp(c7); + }, z$6(j$5, q$4.BasePoint), P$4.prototype.decodePoint = function(e10, f8) { + return this.point(R$3.toArray(e10, f8), 1); + }, P$4.prototype.point = function(e10, f8) { + return new j$5(this, e10, f8); + }, P$4.prototype.pointFromJSON = function(e10) { + return j$5.fromJSON(this, e10); + }, j$5.prototype.precompute = function() { + }, j$5.prototype._encode = function() { + return this.getX().toArray("be", this.curve.p.byteLength()); + }, j$5.fromJSON = function(e10, f8) { + return new j$5(e10, f8[0], f8[1] || e10.one); + }, j$5.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, j$5.prototype.isInfinity = function() { + return 0 === this.z.cmpn(0); + }, j$5.prototype.dbl = function() { + var e10 = this.x.redAdd(this.z).redSqr(), f8 = this.x.redSub(this.z).redSqr(), d7 = e10.redSub(f8), c7 = e10.redMul(f8), t8 = d7.redMul(f8.redAdd(this.curve.a24.redMul(d7))); + return this.curve.point(c7, t8); + }, j$5.prototype.add = function() { + throw new Error("Not supported on Montgomery curve"); + }, j$5.prototype.diffAdd = function(e10, f8) { + var d7 = this.x.redAdd(this.z), c7 = this.x.redSub(this.z), t8 = e10.x.redAdd(e10.z), a7 = e10.x.redSub(e10.z).redMul(d7), r8 = t8.redMul(c7), b8 = f8.z.redMul(a7.redAdd(r8).redSqr()), i7 = f8.x.redMul(a7.redISub(r8).redSqr()); + return this.curve.point(b8, i7); + }, j$5.prototype.mul = function(e10) { + for (var f8 = e10.clone(), d7 = this, c7 = this.curve.point(null, null), t8 = []; 0 !== f8.cmpn(0); f8.iushrn(1)) + t8.push(f8.andln(1)); + for (var a7 = t8.length - 1; a7 >= 0; a7--) + 0 === t8[a7] ? (d7 = d7.diffAdd(c7, this), c7 = c7.dbl()) : (c7 = d7.diffAdd(c7, this), d7 = d7.dbl()); + return c7; + }, j$5.prototype.mulAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, j$5.prototype.jumlAdd = function() { + throw new Error("Not supported on Montgomery curve"); + }, j$5.prototype.eq = function(e10) { + return 0 === this.getX().cmp(e10.getX()); + }, j$5.prototype.normalize = function() { + return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this; + }, j$5.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }; + E$8 = M$6; + k$b = n$c; + O$5 = t$2; + L$4 = v$e; + B$8 = n$i.assert; + O$5(F$5, L$4), N$4 = F$5, F$5.prototype._mulA = function(e10) { + return this.mOneA ? e10.redNeg() : this.a.redMul(e10); + }, F$5.prototype._mulC = function(e10) { + return this.oneC ? e10 : this.c.redMul(e10); + }, F$5.prototype.jpoint = function(e10, f8, d7, c7) { + return this.point(e10, f8, d7, c7); + }, F$5.prototype.pointFromX = function(e10, f8) { + (e10 = new k$b(e10, 16)).red || (e10 = e10.toRed(this.red)); + var d7 = e10.redSqr(), c7 = this.c2.redSub(this.a.redMul(d7)), t8 = this.one.redSub(this.c2.redMul(this.d).redMul(d7)), a7 = c7.redMul(t8.redInvm()), r8 = a7.redSqrt(); + if (0 !== r8.redSqr().redSub(a7).cmp(this.zero)) + throw new Error("invalid point"); + var b8 = r8.fromRed().isOdd(); + return (f8 && !b8 || !f8 && b8) && (r8 = r8.redNeg()), this.point(e10, r8); + }, F$5.prototype.pointFromY = function(e10, f8) { + (e10 = new k$b(e10, 16)).red || (e10 = e10.toRed(this.red)); + var d7 = e10.redSqr(), c7 = d7.redSub(this.c2), t8 = d7.redMul(this.d).redMul(this.c2).redSub(this.a), a7 = c7.redMul(t8.redInvm()); + if (0 === a7.cmp(this.zero)) { + if (f8) + throw new Error("invalid point"); + return this.point(this.zero, e10); + } + var r8 = a7.redSqrt(); + if (0 !== r8.redSqr().redSub(a7).cmp(this.zero)) + throw new Error("invalid point"); + return r8.fromRed().isOdd() !== f8 && (r8 = r8.redNeg()), this.point(r8, e10); + }, F$5.prototype.validate = function(e10) { + if (e10.isInfinity()) + return true; + e10.normalize(); + var f8 = e10.x.redSqr(), d7 = e10.y.redSqr(), c7 = f8.redMul(this.a).redAdd(d7), t8 = this.c2.redMul(this.one.redAdd(this.d.redMul(f8).redMul(d7))); + return 0 === c7.cmp(t8); + }, O$5(C$5, L$4.BasePoint), F$5.prototype.pointFromJSON = function(e10) { + return C$5.fromJSON(this, e10); + }, F$5.prototype.point = function(e10, f8, d7, c7) { + return new C$5(this, e10, f8, d7, c7); + }, C$5.fromJSON = function(e10, f8) { + return new C$5(e10, f8[0], f8[1], f8[2]); + }, C$5.prototype.inspect = function() { + return this.isInfinity() ? "" : ""; + }, C$5.prototype.isInfinity = function() { + return 0 === this.x.cmpn(0) && (0 === this.y.cmp(this.z) || this.zOne && 0 === this.y.cmp(this.curve.c)); + }, C$5.prototype._extDbl = function() { + var e10 = this.x.redSqr(), f8 = this.y.redSqr(), d7 = this.z.redSqr(); + d7 = d7.redIAdd(d7); + var c7 = this.curve._mulA(e10), t8 = this.x.redAdd(this.y).redSqr().redISub(e10).redISub(f8), a7 = c7.redAdd(f8), r8 = a7.redSub(d7), b8 = c7.redSub(f8), i7 = t8.redMul(r8), n7 = a7.redMul(b8), s7 = t8.redMul(b8), o7 = r8.redMul(a7); + return this.curve.point(i7, n7, o7, s7); + }, C$5.prototype._projDbl = function() { + var e10, f8, d7, c7 = this.x.redAdd(this.y).redSqr(), t8 = this.x.redSqr(), a7 = this.y.redSqr(); + if (this.curve.twisted) { + var r8 = (n7 = this.curve._mulA(t8)).redAdd(a7); + if (this.zOne) + e10 = c7.redSub(t8).redSub(a7).redMul(r8.redSub(this.curve.two)), f8 = r8.redMul(n7.redSub(a7)), d7 = r8.redSqr().redSub(r8).redSub(r8); + else { + var b8 = this.z.redSqr(), i7 = r8.redSub(b8).redISub(b8); + e10 = c7.redSub(t8).redISub(a7).redMul(i7), f8 = r8.redMul(n7.redSub(a7)), d7 = r8.redMul(i7); + } + } else { + var n7 = t8.redAdd(a7); + b8 = this.curve._mulC(this.z).redSqr(), i7 = n7.redSub(b8).redSub(b8); + e10 = this.curve._mulC(c7.redISub(n7)).redMul(i7), f8 = this.curve._mulC(n7).redMul(t8.redISub(a7)), d7 = n7.redMul(i7); + } + return this.curve.point(e10, f8, d7); + }, C$5.prototype.dbl = function() { + return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl(); + }, C$5.prototype._extAdd = function(e10) { + var f8 = this.y.redSub(this.x).redMul(e10.y.redSub(e10.x)), d7 = this.y.redAdd(this.x).redMul(e10.y.redAdd(e10.x)), c7 = this.t.redMul(this.curve.dd).redMul(e10.t), t8 = this.z.redMul(e10.z.redAdd(e10.z)), a7 = d7.redSub(f8), r8 = t8.redSub(c7), b8 = t8.redAdd(c7), i7 = d7.redAdd(f8), n7 = a7.redMul(r8), s7 = b8.redMul(i7), o7 = a7.redMul(i7), u7 = r8.redMul(b8); + return this.curve.point(n7, s7, u7, o7); + }, C$5.prototype._projAdd = function(e10) { + var f8, d7, c7 = this.z.redMul(e10.z), t8 = c7.redSqr(), a7 = this.x.redMul(e10.x), r8 = this.y.redMul(e10.y), b8 = this.curve.d.redMul(a7).redMul(r8), i7 = t8.redSub(b8), n7 = t8.redAdd(b8), s7 = this.x.redAdd(this.y).redMul(e10.x.redAdd(e10.y)).redISub(a7).redISub(r8), o7 = c7.redMul(i7).redMul(s7); + return this.curve.twisted ? (f8 = c7.redMul(n7).redMul(r8.redSub(this.curve._mulA(a7))), d7 = i7.redMul(n7)) : (f8 = c7.redMul(n7).redMul(r8.redSub(a7)), d7 = this.curve._mulC(i7).redMul(n7)), this.curve.point(o7, f8, d7); + }, C$5.prototype.add = function(e10) { + return this.isInfinity() ? e10 : e10.isInfinity() ? this : this.curve.extended ? this._extAdd(e10) : this._projAdd(e10); + }, C$5.prototype.mul = function(e10) { + return this._hasDoubles(e10) ? this.curve._fixedNafMul(this, e10) : this.curve._wnafMul(this, e10); + }, C$5.prototype.mulAdd = function(e10, f8, d7) { + return this.curve._wnafMulAdd(1, [this, f8], [e10, d7], 2, false); + }, C$5.prototype.jmulAdd = function(e10, f8, d7) { + return this.curve._wnafMulAdd(1, [this, f8], [e10, d7], 2, true); + }, C$5.prototype.normalize = function() { + if (this.zOne) + return this; + var e10 = this.z.redInvm(); + return this.x = this.x.redMul(e10), this.y = this.y.redMul(e10), this.t && (this.t = this.t.redMul(e10)), this.z = this.curve.one, this.zOne = true, this; + }, C$5.prototype.neg = function() { + return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); + }, C$5.prototype.getX = function() { + return this.normalize(), this.x.fromRed(); + }, C$5.prototype.getY = function() { + return this.normalize(), this.y.fromRed(); + }, C$5.prototype.eq = function(e10) { + return this === e10 || 0 === this.getX().cmp(e10.getX()) && 0 === this.getY().cmp(e10.getY()); + }, C$5.prototype.eqXToP = function(e10) { + var f8 = e10.toRed(this.curve.red).redMul(this.z); + if (0 === this.x.cmp(f8)) + return true; + for (var d7 = e10.clone(), c7 = this.curve.redN.redMul(this.z); ; ) { + if (d7.iadd(this.curve.n), d7.cmp(this.curve.p) >= 0) + return false; + if (f8.redIAdd(c7), 0 === this.x.cmp(f8)) + return true; + } + }, C$5.prototype.toP = C$5.prototype.normalize, C$5.prototype.mixedAdd = C$5.prototype.add; + T$5 = N$4; + J$3 = {}; + X$3 = J$3; + X$3.base = v$e, X$3.short = x$6, X$3.mont = E$8, X$3.edwards = T$5; + Y$2 = { doubles: { step: 4, points: [["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"], ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"], ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"], ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"], ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"], ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"], ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"], ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"], ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"], ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"], ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"], ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"], ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"], ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"], ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"], ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"], ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"], ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"], ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"], ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"], ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"], ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"], ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"], ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"], ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"], ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"], ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"], ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"], ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"], ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"], ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"], ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"], ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"], ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"], ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"], ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"], ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"], ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"], ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"], ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"], ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"], ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"], ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"], ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"], ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"], ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"], ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"], ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"], ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"], ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"], ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"], ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"], ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"], ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"], ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"], ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"], ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"], ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"], ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"], ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"], ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"], ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"], ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"], ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"], ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]] }, naf: { wnd: 7, points: [["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"], ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"], ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"], ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"], ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"], ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"], ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"], ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"], ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"], ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"], ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"], ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"], ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"], ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"], ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"], ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"], ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"], ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"], ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"], ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"], ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"], ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"], ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"], ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"], ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"], ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"], ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"], ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"], ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"], ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"], ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"], ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"], ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"], ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"], ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"], ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"], ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"], ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"], ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"], ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"], ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"], ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"], ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"], ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"], ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"], ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"], ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"], ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"], ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"], ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"], ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"], ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"], ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"], ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"], ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"], ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"], ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"], ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"], ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"], ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"], ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"], ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"], ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"], ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"], ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"], ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"], ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"], ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"], ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"], ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"], ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"], ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"], ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"], ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"], ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"], ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"], ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"], ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"], ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"], ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"], ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"], ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"], ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"], ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"], ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"], ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"], ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"], ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"], ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"], ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"], ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"], ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"], ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"], ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"], ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"], ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"], ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"], ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"], ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"], ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"], ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"], ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"], ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"], ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"], ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"], ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"], ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"], ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"], ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"], ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"], ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"], ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"], ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"], ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"], ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"], ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"], ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"], ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"], ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"], ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"], ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"], ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"], ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"], ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"], ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"], ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"], ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]] } }; + W$3 = {}; + K$4 = W$3; + U$6 = X$2; + G$3 = J$3; + H$5 = n$i.assert; + K$4.PresetCurve = Q$2, V$3("p192", { type: "short", prime: "p192", p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff", a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc", b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1", n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831", hash: U$6.sha256, gRed: false, g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"] }), V$3("p224", { type: "short", prime: "p224", p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001", a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe", b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4", n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d", hash: U$6.sha256, gRed: false, g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"] }), V$3("p256", { type: "short", prime: null, p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff", a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc", b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b", n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551", hash: U$6.sha256, gRed: false, g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"] }), V$3("p384", { type: "short", prime: null, p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff", a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc", b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef", n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973", hash: U$6.sha384, gRed: false, g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"] }), V$3("p521", { type: "short", prime: null, p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff", a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc", b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00", n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409", hash: U$6.sha512, gRed: false, g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"] }), V$3("curve25519", { type: "mont", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "76d06", b: "1", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: U$6.sha256, gRed: false, g: ["9"] }), V$3("ed25519", { type: "edwards", prime: "p25519", p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed", a: "-1", c: "1", d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3", n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed", hash: U$6.sha256, gRed: false, g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"] }); + try { + D$4 = Y$2; + } catch (e10) { + D$4 = void 0; + } + V$3("secp256k1", { type: "short", prime: "k256", p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f", a: "0", b: "7", n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141", h: "1", hash: U$6.sha256, beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", basis: [{ a: "3086d221a7d46bcde86c90e49284eb15", b: "-e4437ed6010e88286f547fa90abfe4c3" }, { a: "114ca50f7a8e2f3f657c1108d9d44cfd8", b: "3086d221a7d46bcde86c90e49284eb15" }], gRed: false, g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", D$4] }); + $$1 = n$c; + ee3 = n$i.assert; + Z$1 = fe3, fe3.fromPublic = function(e10, f8, d7) { + return f8 instanceof fe3 ? f8 : new fe3(e10, { pub: f8, pubEnc: d7 }); + }, fe3.fromPrivate = function(e10, f8, d7) { + return f8 instanceof fe3 ? f8 : new fe3(e10, { priv: f8, privEnc: d7 }); + }, fe3.prototype.validate = function() { + var e10 = this.getPublic(); + return e10.isInfinity() ? { result: false, reason: "Invalid public key" } : e10.validate() ? e10.mul(this.ec.curve.n).isInfinity() ? { result: true, reason: null } : { result: false, reason: "Public key * N != O" } : { result: false, reason: "Public key is not a point" }; + }, fe3.prototype.getPublic = function(e10, f8) { + return "string" == typeof e10 && (f8 = e10, e10 = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), f8 ? this.pub.encode(f8, e10) : this.pub; + }, fe3.prototype.getPrivate = function(e10) { + return "hex" === e10 ? this.priv.toString(16, 2) : this.priv; + }, fe3.prototype._importPrivate = function(e10, f8) { + this.priv = new $$1(e10, f8 || 16), this.priv = this.priv.umod(this.ec.curve.n); + }, fe3.prototype._importPublic = function(e10, f8) { + if (e10.x || e10.y) + return "mont" === this.ec.curve.type ? ee3(e10.x, "Need x coordinate") : "short" !== this.ec.curve.type && "edwards" !== this.ec.curve.type || ee3(e10.x && e10.y, "Need both x and y coordinate"), this.pub = this.ec.curve.point(e10.x, e10.y), void 0; + this.pub = this.ec.curve.decodePoint(e10, f8); + }, fe3.prototype.derive = function(e10) { + return e10.mul(this.priv).getX(); + }, fe3.prototype.sign = function(e10, f8, d7) { + return this.ec.sign(e10, this, f8, d7); + }, fe3.prototype.verify = function(e10, f8) { + return this.ec.verify(e10, f8, this); + }, fe3.prototype.inspect = function() { + return ""; + }; + ce3 = Z$1; + te3 = n$c; + ae3 = a$l; + re3 = W$3; + be3 = f$i; + ie2 = n$i.assert; + ne3 = ce3; + se3 = d$e; + de3 = oe3, oe3.prototype.keyPair = function(e10) { + return new ne3(this, e10); + }, oe3.prototype.keyFromPrivate = function(e10, f8) { + return ne3.fromPrivate(this, e10, f8); + }, oe3.prototype.keyFromPublic = function(e10, f8) { + return ne3.fromPublic(this, e10, f8); + }, oe3.prototype.genKeyPair = function(e10) { + e10 || (e10 = {}); + for (var f8 = new ae3({ hash: this.hash, pers: e10.pers, persEnc: e10.persEnc || "utf8", entropy: e10.entropy || be3(this.hash.hmacStrength), entropyEnc: e10.entropy && e10.entropyEnc || "utf8", nonce: this.n.toArray() }), d7 = this.n.byteLength(), c7 = this.n.sub(new te3(2)); ; ) { + var t8 = new te3(f8.generate(d7)); + if (!(t8.cmp(c7) > 0)) + return t8.iaddn(1), this.keyFromPrivate(t8); + } + }, oe3.prototype._truncateToN = function(e10, f8) { + var d7 = 8 * e10.byteLength() - this.n.bitLength(); + return d7 > 0 && (e10 = e10.ushrn(d7)), !f8 && e10.cmp(this.n) >= 0 ? e10.sub(this.n) : e10; + }, oe3.prototype.sign = function(e10, f8, d7, c7) { + "object" == typeof d7 && (c7 = d7, d7 = null), c7 || (c7 = {}), f8 = this.keyFromPrivate(f8, d7), e10 = this._truncateToN(new te3(e10, 16)); + for (var t8 = this.n.byteLength(), a7 = f8.getPrivate().toArray("be", t8), r8 = e10.toArray("be", t8), b8 = new ae3({ hash: this.hash, entropy: a7, nonce: r8, pers: c7.pers, persEnc: c7.persEnc || "utf8" }), i7 = this.n.sub(new te3(1)), n7 = 0; ; n7++) { + var s7 = c7.k ? c7.k(n7) : new te3(b8.generate(this.n.byteLength())); + if (!((s7 = this._truncateToN(s7, true)).cmpn(1) <= 0 || s7.cmp(i7) >= 0)) { + var o7 = this.g.mul(s7); + if (!o7.isInfinity()) { + var u7 = o7.getX(), h8 = u7.umod(this.n); + if (0 !== h8.cmpn(0)) { + var p7 = s7.invm(this.n).mul(h8.mul(f8.getPrivate()).iadd(e10)); + if (0 !== (p7 = p7.umod(this.n)).cmpn(0)) { + var l7 = (o7.getY().isOdd() ? 1 : 0) | (0 !== u7.cmp(h8) ? 2 : 0); + return c7.canonical && p7.cmp(this.nh) > 0 && (p7 = this.n.sub(p7), l7 ^= 1), new se3({ r: h8, s: p7, recoveryParam: l7 }); + } + } + } + } + } + }, oe3.prototype.verify = function(e10, f8, d7, c7) { + e10 = this._truncateToN(new te3(e10, 16)), d7 = this.keyFromPublic(d7, c7); + var t8 = (f8 = new se3(f8, "hex")).r, a7 = f8.s; + if (t8.cmpn(1) < 0 || t8.cmp(this.n) >= 0) + return false; + if (a7.cmpn(1) < 0 || a7.cmp(this.n) >= 0) + return false; + var r8, b8 = a7.invm(this.n), i7 = b8.mul(e10).umod(this.n), n7 = b8.mul(t8).umod(this.n); + return this.curve._maxwellTrick ? !(r8 = this.g.jmulAdd(i7, d7.getPublic(), n7)).isInfinity() && r8.eqXToP(t8) : !(r8 = this.g.mulAdd(i7, d7.getPublic(), n7)).isInfinity() && 0 === r8.getX().umod(this.n).cmp(t8); + }, oe3.prototype.recoverPubKey = function(e10, f8, d7, c7) { + ie2((3 & d7) === d7, "The recovery param is more than two bits"), f8 = new se3(f8, c7); + var t8 = this.n, a7 = new te3(e10), r8 = f8.r, b8 = f8.s, i7 = 1 & d7, n7 = d7 >> 1; + if (r8.cmp(this.curve.p.umod(this.curve.n)) >= 0 && n7) + throw new Error("Unable to find sencond key candinate"); + r8 = n7 ? this.curve.pointFromX(r8.add(this.curve.n), i7) : this.curve.pointFromX(r8, i7); + var s7 = f8.r.invm(t8), o7 = t8.sub(a7).mul(s7).umod(t8), u7 = b8.mul(s7).umod(t8); + return this.g.mulAdd(o7, r8, u7); + }, oe3.prototype.getKeyRecoveryParam = function(e10, f8, d7, c7) { + if (null !== (f8 = new se3(f8, c7)).recoveryParam) + return f8.recoveryParam; + for (var t8 = 0; t8 < 4; t8++) { + var a7; + try { + a7 = this.recoverPubKey(e10, f8, t8); + } catch (e11) { + continue; + } + if (a7.eq(d7)) + return t8; + } + throw new Error("Unable to find valid recovery factor"); + }; + ue3 = de3; + he3 = n$i; + pe3 = he3.assert; + le3 = he3.parseBytes; + ve3 = he3.cachedProperty; + ye3.fromPublic = function(e10, f8) { + return f8 instanceof ye3 ? f8 : new ye3(e10, { pub: f8 }); + }, ye3.fromSecret = function(e10, f8) { + return f8 instanceof ye3 ? f8 : new ye3(e10, { secret: f8 }); + }, ye3.prototype.secret = function() { + return this._secret; + }, ve3(ye3, "pubBytes", function() { + return this.eddsa.encodePoint(this.pub()); + }), ve3(ye3, "pub", function() { + return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv()); + }), ve3(ye3, "privBytes", function() { + var e10 = this.eddsa, f8 = this.hash(), d7 = e10.encodingLength - 1, c7 = f8.slice(0, e10.encodingLength); + return c7[0] &= 248, c7[d7] &= 127, c7[d7] |= 64, c7; + }), ve3(ye3, "priv", function() { + return this.eddsa.decodeInt(this.privBytes()); + }), ve3(ye3, "hash", function() { + return this.eddsa.hash().update(this.secret()).digest(); + }), ve3(ye3, "messagePrefix", function() { + return this.hash().slice(this.eddsa.encodingLength); + }), ye3.prototype.sign = function(e10) { + return pe3(this._secret, "KeyPair can only verify"), this.eddsa.sign(e10, this); + }, ye3.prototype.verify = function(e10, f8) { + return this.eddsa.verify(e10, f8, this); + }, ye3.prototype.getSecret = function(e10) { + return pe3(this._secret, "KeyPair is public only"), he3.encode(this.secret(), e10); + }, ye3.prototype.getPublic = function(e10) { + return he3.encode(this.pubBytes(), e10); + }; + me3 = ye3; + Se3 = n$c; + ge3 = n$i; + Ae3 = ge3.assert; + Ie = ge3.cachedProperty; + we3 = ge3.parseBytes; + Ie(Me, "S", function() { + return this.eddsa.decodeInt(this.Sencoded()); + }), Ie(Me, "R", function() { + return this.eddsa.decodePoint(this.Rencoded()); + }), Ie(Me, "Rencoded", function() { + return this.eddsa.encodePoint(this.R()); + }), Ie(Me, "Sencoded", function() { + return this.eddsa.encodeInt(this.S()); + }), Me.prototype.toBytes = function() { + return this.Rencoded().concat(this.Sencoded()); + }, Me.prototype.toHex = function() { + return ge3.encode(this.toBytes(), "hex").toUpperCase(); + }; + _e = Me; + ze = X$2; + qe = W$3; + Re = n$i; + Pe = Re.assert; + je3 = Re.parseBytes; + Ne = me3; + Ee3 = _e; + xe = ke2, ke2.prototype.sign = function(e10, f8) { + e10 = je3(e10); + var d7 = this.keyFromSecret(f8), c7 = this.hashInt(d7.messagePrefix(), e10), t8 = this.g.mul(c7), a7 = this.encodePoint(t8), r8 = this.hashInt(a7, d7.pubBytes(), e10).mul(d7.priv()), b8 = c7.add(r8).umod(this.curve.n); + return this.makeSignature({ R: t8, S: b8, Rencoded: a7 }); + }, ke2.prototype.verify = function(e10, f8, d7) { + e10 = je3(e10), f8 = this.makeSignature(f8); + var c7 = this.keyFromPublic(d7), t8 = this.hashInt(f8.Rencoded(), c7.pubBytes(), e10), a7 = this.g.mul(f8.S()); + return f8.R().add(c7.pub().mul(t8)).eq(a7); + }, ke2.prototype.hashInt = function() { + for (var e10 = this.hash(), f8 = 0; f8 < arguments.length; f8++) + e10.update(arguments[f8]); + return Re.intFromLE(e10.digest()).umod(this.curve.n); + }, ke2.prototype.keyFromPublic = function(e10) { + return Ne.fromPublic(this, e10); + }, ke2.prototype.keyFromSecret = function(e10) { + return Ne.fromSecret(this, e10); + }, ke2.prototype.makeSignature = function(e10) { + return e10 instanceof Ee3 ? e10 : new Ee3(this, e10); + }, ke2.prototype.encodePoint = function(e10) { + var f8 = e10.getY().toArray("le", this.encodingLength); + return f8[this.encodingLength - 1] |= e10.getX().isOdd() ? 128 : 0, f8; + }, ke2.prototype.decodePoint = function(e10) { + var f8 = (e10 = Re.parseBytes(e10)).length - 1, d7 = e10.slice(0, f8).concat(-129 & e10[f8]), c7 = 0 != (128 & e10[f8]), t8 = Re.intFromLE(d7); + return this.curve.pointFromY(t8, c7); + }, ke2.prototype.encodeInt = function(e10) { + return e10.toArray("le", this.encodingLength); + }, ke2.prototype.decodeInt = function(e10) { + return Re.intFromLE(e10); + }, ke2.prototype.isPoint = function(e10) { + return e10 instanceof this.pointClass; + }; + Oe3 = xe; + Le = {}; + Be2 = Le; + Be2.version = ["elliptic", "6.5.2", "EC cryptography", "lib/elliptic.js", ["lib"], { jscs: "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", jshint: "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", lint: "npm run jscs && npm run jshint", unit: "istanbul test _mocha --reporter=spec test/index.js", test: "npm run lint && npm run unit", version: "grunt dist && git add dist/" }, { type: "git", url: "git@github.com:indutny/elliptic" }, ["EC", "Elliptic", "curve", "Cryptography"], "Fedor Indutny ", "MIT", { url: "https://github.com/indutny/elliptic/issues" }, "https://github.com/indutny/elliptic", { brfs: "^1.4.3", coveralls: "^3.0.8", grunt: "^1.0.4", "grunt-browserify": "^5.0.0", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-uglify": "^1.0.1", "grunt-mocha-istanbul": "^3.0.1", "grunt-saucelabs": "^9.0.1", istanbul: "^0.4.2", jscs: "^3.0.7", jshint: "^2.10.3", mocha: "^6.2.2" }, { "bn.js": "^4.4.0", brorand: "^1.0.1", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.0", inherits: "^2.0.1", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.0" }][1], Be2.utils = n$i, Be2.rand = f$i, Be2.curve = J$3, Be2.curves = W$3, Be2.ec = ue3, Be2.eddsa = Oe3; + o$n = {}; + s$j = false; + a$m = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + u$j = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + c$i = {}; + f$n = t$2; + c$i.Reporter = l$k, l$k.prototype.isError = function(e10) { + return e10 instanceof h$g; + }, l$k.prototype.save = function() { + var e10 = (this || u$j)._reporterState; + return { obj: e10.obj, pathLen: e10.path.length }; + }, l$k.prototype.restore = function(e10) { + var t8 = (this || u$j)._reporterState; + t8.obj = e10.obj, t8.path = t8.path.slice(0, e10.pathLen); + }, l$k.prototype.enterKey = function(e10) { + return (this || u$j)._reporterState.path.push(e10); + }, l$k.prototype.exitKey = function(e10) { + var t8 = (this || u$j)._reporterState; + t8.path = t8.path.slice(0, e10 - 1); + }, l$k.prototype.leaveKey = function(e10, t8, r8) { + var n7 = (this || u$j)._reporterState; + this.exitKey(e10), null !== n7.obj && (n7.obj[t8] = r8); + }, l$k.prototype.path = function() { + return (this || u$j)._reporterState.path.join("/"); + }, l$k.prototype.enterObject = function() { + var e10 = (this || u$j)._reporterState, t8 = e10.obj; + return e10.obj = {}, t8; + }, l$k.prototype.leaveObject = function(e10) { + var t8 = (this || u$j)._reporterState, r8 = t8.obj; + return t8.obj = e10, r8; + }, l$k.prototype.error = function(e10) { + var t8, r8 = (this || u$j)._reporterState, n7 = e10 instanceof h$g; + if (t8 = n7 ? e10 : new h$g(r8.path.map(function(e11) { + return "[" + JSON.stringify(e11) + "]"; + }).join(""), e10.message || e10, e10.stack), !r8.options.partial) + throw t8; + return n7 || r8.errors.push(t8), t8; + }, l$k.prototype.wrapResult = function(e10) { + var t8 = (this || u$j)._reporterState; + return t8.options.partial ? { result: this.isError(e10) ? null : e10, errors: t8.errors } : e10; + }, f$n(h$g, Error), h$g.prototype.rethrow = function(e10) { + if ((this || u$j).message = e10 + " at: " + ((this || u$j).path || "(shallow)"), Error.captureStackTrace && Error.captureStackTrace(this || u$j, h$g), !(this || u$j).stack) + try { + throw new Error((this || u$j).message); + } catch (e11) { + (this || u$j).stack = e11.stack; + } + return this || u$j; + }; + p$k = {}; + d$i = false; + g$e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + _$e = {}; + v$f = false; + b$c = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + m$g = {}; + S$a = false; + j$6 = {}; + w$f = false; + B$9 = {}; + k$c = false; + D$5 = {}; + U$7 = false; + N$5 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + O$6 = {}; + A$9 = false; + x$7 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + I$9 = {}; + q$5 = false; + F$6 = {}; + K$5 = false; + R$4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + G$4 = {}; + L$5 = false; + M$7 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + J$4 = {}; + V$4 = false; + z$7 = {}; + H$6 = false; + Q$3 = Y$3(); + e$f = Q$3; + t$a = e$f.define("Time", function() { + this.choice({ utcTime: this.utctime(), generalTime: this.gentime() }); + }); + s$k = e$f.define("AttributeTypeValue", function() { + this.seq().obj(this.key("type").objid(), this.key("value").any()); + }); + n$n = e$f.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional()); + }); + o$o = e$f.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(n$n), this.key("subjectPublicKey").bitstr()); + }); + h$h = e$f.define("RelativeDistinguishedName", function() { + this.setof(s$k); + }); + y$g = e$f.define("RDNSequence", function() { + this.seqof(h$h); + }); + r$g = e$f.define("Name", function() { + this.choice({ rdnSequence: this.use(y$g) }); + }); + u$k = e$f.define("Validity", function() { + this.seq().obj(this.key("notBefore").use(t$a), this.key("notAfter").use(t$a)); + }); + a$n = e$f.define("Extension", function() { + this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr()); + }); + c$j = e$f.define("TBSCertificate", function() { + this.seq().obj(this.key("version").explicit(0).int().optional(), this.key("serialNumber").int(), this.key("signature").use(n$n), this.key("issuer").use(r$g), this.key("validity").use(u$k), this.key("subject").use(r$g), this.key("subjectPublicKeyInfo").use(o$o), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(a$n).optional()); + }); + k$d = e$f.define("X509Certificate", function() { + this.seq().obj(this.key("tbsCertificate").use(c$j), this.key("signatureAlgorithm").use(n$n), this.key("signatureValue").bitstr()); + }); + f$o = {}; + b$d = Q$3; + f$o.certificate = k$d; + l$l = b$d.define("RSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("modulus").int(), this.key("publicExponent").int(), this.key("privateExponent").int(), this.key("prime1").int(), this.key("prime2").int(), this.key("exponent1").int(), this.key("exponent2").int(), this.key("coefficient").int()); + }); + f$o.RSAPrivateKey = l$l; + d$j = b$d.define("RSAPublicKey", function() { + this.seq().obj(this.key("modulus").int(), this.key("publicExponent").int()); + }); + f$o.RSAPublicKey = d$j; + p$l = b$d.define("SubjectPublicKeyInfo", function() { + this.seq().obj(this.key("algorithm").use(j$7), this.key("subjectPublicKey").bitstr()); + }); + f$o.PublicKey = p$l; + j$7 = b$d.define("AlgorithmIdentifier", function() { + this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p").int(), this.key("q").int(), this.key("g").int()).optional()); + }); + v$g = b$d.define("PrivateKeyInfo", function() { + this.seq().obj(this.key("version").int(), this.key("algorithm").use(j$7), this.key("subjectPrivateKey").octstr()); + }); + f$o.PrivateKey = v$g; + m$h = b$d.define("EncryptedPrivateKeyInfo", function() { + this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters").int())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr()); + }); + f$o.EncryptedPrivateKey = m$h; + q$6 = b$d.define("DSAPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("p").int(), this.key("q").int(), this.key("g").int(), this.key("pub_key").int(), this.key("priv_key").int()); + }); + f$o.DSAPrivateKey = q$6, f$o.DSAparam = b$d.define("DSAparam", function() { + this.int(); + }); + K$6 = b$d.define("ECPrivateKey", function() { + this.seq().obj(this.key("version").int(), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(P$6), this.key("publicKey").optional().explicit(1).bitstr()); + }); + f$o.ECPrivateKey = K$6; + P$6 = b$d.define("ECParameters", function() { + this.choice({ namedCurve: this.objid() }); + }); + f$o.signature = b$d.define("signature", function() { + this.seq().obj(this.key("r").int(), this.key("s").int()); + }); + i$a = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m; + o$p = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m; + d$k = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m; + n$o = a$c; + p$m = t$32; + u$l = u4.Buffer; + y$h = f$o; + m$i = { "2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", "2.16.840.1.101.3.4.1.4": "aes-128-cfb", "2.16.840.1.101.3.4.1.21": "aes-192-ecb", "2.16.840.1.101.3.4.1.22": "aes-192-cbc", "2.16.840.1.101.3.4.1.23": "aes-192-ofb", "2.16.840.1.101.3.4.1.24": "aes-192-cfb", "2.16.840.1.101.3.4.1.41": "aes-256-ecb", "2.16.840.1.101.3.4.1.42": "aes-256-cbc", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" }; + f$p = function(e10, r8) { + var a7, t8 = e10.toString(), c7 = t8.match(i$a); + if (c7) { + var s7 = "aes" + c7[1], y7 = u$l.from(c7[2], "hex"), m7 = u$l.from(c7[3].replace(/[\r\n]/g, ""), "base64"), f8 = n$o(r8, y7.slice(0, 8), parseInt(c7[1], 10)).key, b8 = [], E6 = p$m.createDecipheriv(s7, f8, y7); + b8.push(E6.update(m7)), b8.push(E6.final()), a7 = u$l.concat(b8); + } else { + var h8 = t8.match(d$k); + a7 = new u$l(h8[2].replace(/[\r\n]/g, ""), "base64"); + } + return { tag: t8.match(o$p)[1], data: a7 }; + }; + b$e = t$32; + E$a = M$1; + h$i = u4.Buffer; + s$l = l$m, l$m.signature = y$h.signature; + v$h = s$l; + p$n = { "1.3.132.0.10": "secp256k1", "1.3.132.0.33": "p224", "1.2.840.10045.3.1.1": "p192", "1.2.840.10045.3.1.7": "p256", "1.3.132.0.34": "p384", "1.3.132.0.35": "p521" }; + d$l = {}; + f$q = e$1$1.Buffer; + c$k = w$3; + g$f = l$d; + w$g = Le.ec; + l$n = n$c; + m$j = v$h; + v$i = p$n; + (d$l = function(e10, t8, r8, n7, a7) { + var o7 = m$j(t8); + if (o7.curve) { + if ("ecdsa" !== n7 && "ecdsa/rsa" !== n7) + throw new Error("wrong private key type"); + return function(e11, t9) { + var r9 = v$i[t9.curve.join(".")]; + if (!r9) + throw new Error("unknown curve " + t9.curve.join(".")); + var n8 = new w$g(r9).keyFromPrivate(t9.privateKey).sign(e11); + return new f$q(n8.toDER()); + }(e10, o7); + } + if ("dsa" === o7.type) { + if ("dsa" !== n7) + throw new Error("wrong private key type"); + return function(e11, t9, r9) { + var n8, a8 = t9.params.priv_key, o8 = t9.params.p, i8 = t9.params.q, s8 = t9.params.g, h9 = new l$n(0), u7 = b$f(e11, i8).mod(i8), p7 = false, d7 = y$i(a8, i8, e11, r9); + for (; false === p7; ) + n8 = _$f(i8, d7, r9), h9 = k$e(s8, n8, o8, i8), 0 === (p7 = n8.invm(i8).imul(u7.add(a8.mul(h9))).mod(i8)).cmpn(0) && (p7 = false, h9 = new l$n(0)); + return function(e12, t10) { + e12 = e12.toArray(), t10 = t10.toArray(), 128 & e12[0] && (e12 = [0].concat(e12)); + 128 & t10[0] && (t10 = [0].concat(t10)); + var r10 = [48, e12.length + t10.length + 4, 2, e12.length]; + return r10 = r10.concat(e12, [2, t10.length], t10), new f$q(r10); + }(h9, p7); + }(e10, o7, r8); + } + if ("rsa" !== n7 && "ecdsa/rsa" !== n7) + throw new Error("wrong private key type"); + e10 = f$q.concat([a7, e10]); + for (var i7 = o7.modulus.byteLength(), s7 = [0, 1]; e10.length + s7.length + 1 < i7; ) + s7.push(255); + s7.push(0); + for (var h8 = -1; ++h8 < e10.length; ) + s7.push(e10[h8]); + return g$f(s7, o7); + }).getKey = y$i, d$l.makeKey = _$f; + E$b = d$l; + L$6 = e$1$1.Buffer; + R$5 = n$c; + j$8 = Le.ec; + T$7 = v$h; + P$7 = p$n; + K$7 = function(e10, t8, r8, n7, a7) { + var o7 = T$7(r8); + if ("ec" === o7.type) { + if ("ecdsa" !== n7 && "ecdsa/rsa" !== n7) + throw new Error("wrong public key type"); + return function(e11, t9, r9) { + var n8 = P$7[r9.data.algorithm.curve.join(".")]; + if (!n8) + throw new Error("unknown curve " + r9.data.algorithm.curve.join(".")); + var a8 = new j$8(n8), o8 = r9.data.subjectPrivateKey.data; + return a8.verify(t9, e11, o8); + }(e10, t8, o7); + } + if ("dsa" === o7.type) { + if ("dsa" !== n7) + throw new Error("wrong public key type"); + return function(e11, t9, r9) { + var n8 = r9.data.p, a8 = r9.data.q, o8 = r9.data.g, i8 = r9.data.pub_key, s8 = T$7.signature.decode(e11, "der"), h9 = s8.s, u8 = s8.r; + A$a(h9, a8), A$a(u8, a8); + var p8 = R$5.mont(n8), d8 = h9.invm(a8); + return 0 === o8.toRed(p8).redPow(new R$5(t9).mul(d8).mod(a8)).fromRed().mul(i8.toRed(p8).redPow(u8.mul(d8).mod(a8)).fromRed()).mod(n8).mod(a8).cmp(u8); + }(e10, t8, o7); + } + if ("rsa" !== n7 && "ecdsa/rsa" !== n7) + throw new Error("wrong public key type"); + t8 = L$6.concat([a7, t8]); + for (var i7 = o7.modulus.byteLength(), s7 = [1], h8 = 0; t8.length + s7.length + 2 < i7; ) + s7.push(255), h8++; + s7.push(0); + for (var u7 = -1; ++u7 < t8.length; ) + s7.push(t8[u7]); + s7 = new L$6(s7); + var p7 = R$5.mont(o7.modulus); + e10 = (e10 = new R$5(e10).toRed(p7)).redPow(new R$5(o7.publicExponent)), e10 = new L$6(e10.fromRed().toArray()); + var d7 = h8 < 8 ? 1 : 0; + for (i7 = Math.min(e10.length, s7.length), e10.length !== s7.length && (d7 = 1), u7 = -1; ++u7 < i7; ) + d7 |= e10[u7] ^ s7[u7]; + return 0 === d7; + }; + W$4 = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + x$8 = e$1$1.Buffer; + B$a = h$4; + S$b = b$i; + q$7 = t$2; + U$8 = E$b; + V$5 = K$7; + C$7 = s$4; + Object.keys(C$7).forEach(function(e10) { + C$7[e10].id = new x$8(C$7[e10].id, "hex"), C$7[e10.toLowerCase()] = C$7[e10]; + }), q$7(D$6, S$b.Writable), D$6.prototype._write = function(e10, t8, r8) { + (this || W$4)._hash.update(e10), r8(); + }, D$6.prototype.update = function(e10, t8) { + return "string" == typeof e10 && (e10 = new x$8(e10, t8)), (this || W$4)._hash.update(e10), this || W$4; + }, D$6.prototype.sign = function(e10, t8) { + this.end(); + var r8 = (this || W$4)._hash.digest(), n7 = U$8(r8, e10, (this || W$4)._hashType, (this || W$4)._signType, (this || W$4)._tag); + return t8 ? n7.toString(t8) : n7; + }, q$7(F$7, S$b.Writable), F$7.prototype._write = function(e10, t8, r8) { + (this || W$4)._hash.update(e10), r8(); + }, F$7.prototype.update = function(e10, t8) { + return "string" == typeof e10 && (e10 = new x$8(e10, t8)), (this || W$4)._hash.update(e10), this || W$4; + }, F$7.prototype.verify = function(e10, t8, r8) { + "string" == typeof t8 && (t8 = new x$8(t8, r8)), this.end(); + var n7 = (this || W$4)._hash.digest(); + return V$5(t8, n7, e10, (this || W$4)._signType, (this || W$4)._tag); + }; + z$8 = { Sign: M$8, Verify: O$7, createSign: M$8, createVerify: O$7 }; + n$p = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + p$o = e$1$1.Buffer; + s$m = Le; + u$m = n$c; + i$b = function(e10) { + return new c$l(e10); + }; + o$q = { secp256k1: { name: "secp256k1", byteLength: 32 }, secp224r1: { name: "p224", byteLength: 28 }, prime256v1: { name: "p256", byteLength: 32 }, prime192v1: { name: "p192", byteLength: 24 }, ed25519: { name: "ed25519", byteLength: 32 }, secp384r1: { name: "p384", byteLength: 48 }, secp521r1: { name: "p521", byteLength: 66 } }; + o$q.p224 = o$q.secp224r1, o$q.p256 = o$q.secp256r1 = o$q.prime256v1, o$q.p192 = o$q.secp192r1 = o$q.prime192v1, o$q.p384 = o$q.secp384r1, o$q.p521 = o$q.secp521r1, c$l.prototype.generateKeys = function(e10, t8) { + return (this || n$p).keys = (this || n$p).curve.genKeyPair(), this.getPublicKey(e10, t8); + }, c$l.prototype.computeSecret = function(e10, t8, r8) { + return t8 = t8 || "utf8", p$o.isBuffer(e10) || (e10 = new p$o(e10, t8)), y$j((this || n$p).curve.keyFromPublic(e10).getPublic().mul((this || n$p).keys.getPrivate()).getX(), r8, (this || n$p).curveType.byteLength); + }, c$l.prototype.getPublicKey = function(e10, t8) { + var r8 = (this || n$p).keys.getPublic("compressed" === t8, true); + return "hybrid" === t8 && (r8[r8.length - 1] % 2 ? r8[0] = 7 : r8[0] = 6), y$j(r8, e10); + }, c$l.prototype.getPrivateKey = function(e10) { + return y$j((this || n$p).keys.getPrivate(), e10); + }, c$l.prototype.setPublicKey = function(e10, t8) { + return t8 = t8 || "utf8", p$o.isBuffer(e10) || (e10 = new p$o(e10, t8)), (this || n$p).keys._importPublic(e10), this || n$p; + }, c$l.prototype.setPrivateKey = function(e10, t8) { + t8 = t8 || "utf8", p$o.isBuffer(e10) || (e10 = new p$o(e10, t8)); + var r8 = new u$m(e10); + return r8 = r8.toString(16), (this || n$p).keys = (this || n$p).curve.genKeyPair(), (this || n$p).keys._importPrivate(r8), this || n$p; + }; + f$r = i$b; + i$c = h$4; + l$o = u4.Buffer; + u$n = function(r8, n7) { + for (var e10, t8 = l$o.alloc(0), o7 = 0; t8.length < n7; ) + e10 = f$s(o7++), t8 = l$o.concat([t8, i$c("sha1").update(r8).update(e10).digest()]); + return t8.slice(0, n7); + }; + c$m = function(r8, n7) { + for (var e10 = r8.length, t8 = -1; ++t8 < e10; ) + r8[t8] ^= n7[t8]; + return r8; + }; + p$p = n$c; + d$m = u4.Buffer; + h$j = function(r8, n7) { + return d$m.from(r8.toRed(p$p.mont(n7.modulus)).redPow(new p$p(n7.publicExponent)).fromRed().toArray()); + }; + s$n = v$h; + g$g = a5; + m$k = h$4; + w$h = u$n; + v$j = c$m; + y$k = n$c; + E$c = h$j; + b$g = l$d; + B$b = u4.Buffer; + x$9 = function(r8, n7, e10) { + var t8; + t8 = r8.padding ? r8.padding : e10 ? 1 : 4; + var o7, a7 = s$n(r8); + if (4 === t8) + o7 = function(r9, n8) { + var e11 = r9.modulus.byteLength(), t9 = n8.length, o8 = m$k("sha1").update(B$b.alloc(0)).digest(), a8 = o8.length, i7 = 2 * a8; + if (t9 > e11 - i7 - 2) + throw new Error("message too long"); + var l7 = B$b.alloc(e11 - t9 - i7 - 2), f8 = e11 - a8 - 1, u7 = g$g(a8), c7 = v$j(B$b.concat([o8, l7, B$b.alloc(1, 1), n8], f8), w$h(u7, f8)), p7 = v$j(u7, w$h(c7, a8)); + return new y$k(B$b.concat([B$b.alloc(1), p7, c7], e11)); + }(a7, n7); + else if (1 === t8) + o7 = function(r9, n8, e11) { + var t9, o8 = n8.length, a8 = r9.modulus.byteLength(); + if (o8 > a8 - 11) + throw new Error("message too long"); + t9 = e11 ? B$b.alloc(a8 - o8 - 3, 255) : function(r10) { + var n9, e12 = B$b.allocUnsafe(r10), t10 = 0, o9 = g$g(2 * r10), a9 = 0; + for (; t10 < r10; ) + a9 === o9.length && (o9 = g$g(2 * r10), a9 = 0), (n9 = o9[a9++]) && (e12[t10++] = n9); + return e12; + }(a8 - o8 - 3); + return new y$k(B$b.concat([B$b.from([0, e11 ? 1 : 2]), t9, B$b.alloc(1), n8], a8)); + }(a7, n7, e10); + else { + if (3 !== t8) + throw new Error("unknown padding"); + if ((o7 = new y$k(n7)).cmp(a7.modulus) >= 0) + throw new Error("data too long for modulus"); + } + return e10 ? b$g(o7, a7) : E$c(o7, a7); + }; + L$7 = v$h; + k$f = u$n; + D$7 = c$m; + U$9 = n$c; + R$6 = l$d; + S$c = h$4; + j$9 = h$j; + A$b = u4.Buffer; + I$a = function(r8, n7, e10) { + var t8; + t8 = r8.padding ? r8.padding : e10 ? 1 : 4; + var o7, a7 = L$7(r8), i7 = a7.modulus.byteLength(); + if (n7.length > i7 || new U$9(n7).cmp(a7.modulus) >= 0) + throw new Error("decryption error"); + o7 = e10 ? j$9(new U$9(n7), a7) : R$6(n7, a7); + var l7 = A$b.alloc(i7 - o7.length); + if (o7 = A$b.concat([l7, o7], i7), 4 === t8) + return function(r9, n8) { + var e11 = r9.modulus.byteLength(), t9 = S$c("sha1").update(A$b.alloc(0)).digest(), o8 = t9.length; + if (0 !== n8[0]) + throw new Error("decryption error"); + var a8 = n8.slice(1, o8 + 1), i8 = n8.slice(o8 + 1), l8 = D$7(a8, k$f(i8, o8)), f8 = D$7(i8, k$f(l8, e11 - o8 - 1)); + if (function(r10, n9) { + r10 = A$b.from(r10), n9 = A$b.from(n9); + var e12 = 0, t10 = r10.length; + r10.length !== n9.length && (e12++, t10 = Math.min(r10.length, n9.length)); + var o9 = -1; + for (; ++o9 < t10; ) + e12 += r10[o9] ^ n9[o9]; + return e12; + }(t9, f8.slice(0, o8))) + throw new Error("decryption error"); + var u7 = o8; + for (; 0 === f8[u7]; ) + u7++; + if (1 !== f8[u7++]) + throw new Error("decryption error"); + return f8.slice(u7); + }(a7, o7); + if (1 === t8) + return function(r9, n8, e11) { + var t9 = n8.slice(0, 2), o8 = 2, a8 = 0; + for (; 0 !== n8[o8++]; ) + if (o8 >= n8.length) { + a8++; + break; + } + var i8 = n8.slice(2, o8 - 1); + ("0002" !== t9.toString("hex") && !e11 || "0001" !== t9.toString("hex") && e11) && a8++; + i8.length < 8 && a8++; + if (a8) + throw new Error("decryption error"); + return n8.slice(o8); + }(0, o7, e10); + if (3 === t8) + return o7; + throw new Error("unknown padding"); + }; + M$9 = {}; + M$9.publicEncrypt = x$9, M$9.privateDecrypt = I$a, M$9.privateEncrypt = function(r8, n7) { + return M$9.publicEncrypt(r8, n7, true); + }, M$9.publicDecrypt = function(r8, n7) { + return M$9.privateDecrypt(r8, n7, true); + }; + o$r = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis; + t$b = {}; + f$t = T$1; + u$o = u4; + a$o = a5; + s$o = u$o.Buffer; + l$p = u$o.kMaxLength; + m$l = o$r.crypto || o$r.msCrypto; + p$q = Math.pow(2, 32) - 1; + m$l && m$l.getRandomValues || !f$t.browser ? (t$b.randomFill = function(r8, e10, n7, t8) { + if (!(s$o.isBuffer(r8) || r8 instanceof o$r.Uint8Array)) + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + if ("function" == typeof e10) + t8 = e10, e10 = 0, n7 = r8.length; + else if ("function" == typeof n7) + t8 = n7, n7 = r8.length - e10; + else if ("function" != typeof t8) + throw new TypeError('"cb" argument must be a function'); + return y$l(e10, r8.length), b$h(n7, e10, r8.length), w$i(r8, e10, n7, t8); + }, t$b.randomFillSync = function(r8, e10, n7) { + void 0 === e10 && (e10 = 0); + if (!(s$o.isBuffer(r8) || r8 instanceof o$r.Uint8Array)) + throw new TypeError('"buf" argument must be a Buffer or Uint8Array'); + y$l(e10, r8.length), void 0 === n7 && (n7 = r8.length - e10); + return b$h(n7, e10, r8.length), w$i(r8, e10, n7); + }) : (t$b.randomFill = i$d, t$b.randomFillSync = i$d); + l$q = {}; + l$q.randomBytes = l$q.rng = l$q.pseudoRandomBytes = l$q.prng = a5, l$q.createHash = l$q.Hash = h$4, l$q.createHmac = l$q.Hmac = w$3; + D$8 = s$4; + s$p = Object.keys(D$8); + _$g = ["sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160"].concat(s$p); + l$q.getHashes = function() { + return _$g; + }; + h$k = M$1; + l$q.pbkdf2 = h$k.pbkdf2, l$q.pbkdf2Sync = h$k.pbkdf2Sync; + y$m = p$d; + l$q.Cipher = y$m.Cipher, l$q.createCipher = y$m.createCipher, l$q.Cipheriv = y$m.Cipheriv, l$q.createCipheriv = y$m.createCipheriv, l$q.Decipher = y$m.Decipher, l$q.createDecipher = y$m.createDecipher, l$q.Decipheriv = y$m.Decipheriv, l$q.createDecipheriv = y$m.createDecipheriv, l$q.getCiphers = y$m.getCiphers, l$q.listCiphers = y$m.listCiphers; + E$d = O$3; + l$q.DiffieHellmanGroup = E$d.DiffieHellmanGroup, l$q.createDiffieHellmanGroup = E$d.createDiffieHellmanGroup, l$q.getDiffieHellman = E$d.getDiffieHellman, l$q.createDiffieHellman = E$d.createDiffieHellman, l$q.DiffieHellman = E$d.DiffieHellman; + S$d = z$8; + l$q.createSign = S$d.createSign, l$q.Sign = S$d.Sign, l$q.createVerify = S$d.createVerify, l$q.Verify = S$d.Verify, l$q.createECDH = f$r; + C$8 = M$9; + l$q.publicEncrypt = C$8.publicEncrypt, l$q.privateEncrypt = C$8.privateEncrypt, l$q.publicDecrypt = C$8.publicDecrypt, l$q.privateDecrypt = C$8.privateDecrypt; + N$6 = t$b; + l$q.randomFill = N$6.randomFill, l$q.randomFillSync = N$6.randomFillSync, l$q.createCredentials = function() { + throw new Error(["sorry, createCredentials is not implemented yet", "we accept pull requests", "https://github.com/crypto-browserify/crypto-browserify"].join("\n")); + }, l$q.constants = { DH_CHECK_P_NOT_SAFE_PRIME: 2, DH_CHECK_P_NOT_PRIME: 1, DH_UNABLE_TO_CHECK_GENERATOR: 4, DH_NOT_SUITABLE_GENERATOR: 8, NPN_ENABLED: 1, ALPN_ENABLED: 1, RSA_PKCS1_PADDING: 1, RSA_SSLV23_PADDING: 2, RSA_NO_PADDING: 3, RSA_PKCS1_OAEP_PADDING: 4, RSA_X931_PADDING: 5, RSA_PKCS1_PSS_PADDING: 6, POINT_CONVERSION_COMPRESSED: 2, POINT_CONVERSION_UNCOMPRESSED: 4, POINT_CONVERSION_HYBRID: 6 }; + exports$10$1 = {}; + _dewExec$10$1 = false; + _global$a$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$$$1 = {}; + _dewExec$$$1 = false; + _global$9$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$_$1 = {}; + _dewExec$_$1 = false; + _primes$1 = { + "modp1": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" + }, + "modp2": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" + }, + "modp5": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" + }, + "modp14": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" + }, + "modp15": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" + }, + "modp16": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" + }, + "modp17": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" + }, + "modp18": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" + } + }; + exports$Z$1 = {}; + _dewExec$Z$1 = false; + _global$8$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$Y$1 = {}; + _dewExec$Y$1 = false; + exports$X$1 = {}; + _dewExec$X$1 = false; + module$4$1 = { + exports: exports$X$1 + }; + _global$7$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$W$1 = {}; + _dewExec$W$1 = false; + _package$1 = { + "_args": [ + [ + "elliptic@6.5.4", + "C:\\Users\\guybe\\Projects\\rollup-plugin-jspm" + ] + ], + "_from": "elliptic@6.5.4", + "_id": "elliptic@6.5.4", + "_inBundle": false, + "_integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "_location": "/@jspm/core/elliptic", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "elliptic@6.5.4", + "name": "elliptic", + "escapedName": "elliptic", + "rawSpec": "6.5.4", + "saveSpec": null, + "fetchSpec": "6.5.4" + }, + "_requiredBy": [ + "/@jspm/core/browserify-sign", + "/@jspm/core/create-ecdh" + ], + "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "_spec": "6.5.4", + "_where": "C:\\Users\\guybe\\Projects\\rollup-plugin-jspm", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "description": "EC cryptography", + "devDependencies": { + "brfs": "^2.0.2", + "coveralls": "^3.1.0", + "eslint": "^7.6.0", + "grunt": "^1.2.1", + "grunt-browserify": "^5.3.0", + "grunt-cli": "^1.3.2", + "grunt-contrib-connect": "^3.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^5.0.0", + "grunt-mocha-istanbul": "^5.0.2", + "grunt-saucelabs": "^9.0.1", + "istanbul": "^0.4.5", + "mocha": "^8.0.1" + }, + "files": [ + "lib" + ], + "homepage": "https://github.com/indutny/elliptic", + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "license": "MIT", + "main": "lib/elliptic.js", + "name": "elliptic", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/indutny/elliptic.git" + }, + "scripts": { + "lint": "eslint lib test", + "lint:fix": "npm run lint -- --fix", + "test": "npm run lint && npm run unit", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "version": "grunt dist && git add dist/" + }, + "version": "6.5.4" + }; + exports$V$1 = {}; + _dewExec$V$1 = false; + module$3$1 = { + exports: exports$V$1 + }; + _global$6$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$U$1 = {}; + _dewExec$U$1 = false; + exports$T$1 = {}; + _dewExec$T$1 = false; + exports$S$1 = {}; + _dewExec$S$1 = false; + exports$R$1 = {}; + _dewExec$R$1 = false; + exports$Q$1 = {}; + _dewExec$Q$1 = false; + exports$P$1 = {}; + _dewExec$P$1 = false; + exports$O$1 = {}; + _dewExec$O$1 = false; + exports$N$1 = {}; + _dewExec$N$1 = false; + exports$M$1 = {}; + _dewExec$M$1 = false; + exports$L$1 = {}; + _dewExec$L$1 = false; + exports$K$1 = {}; + _dewExec$K$1 = false; + exports$J$1 = {}; + _dewExec$J$1 = false; + exports$I$1 = {}; + _dewExec$I$1 = false; + exports$H$1 = {}; + _dewExec$H$1 = false; + exports$G$1 = {}; + _dewExec$G$1 = false; + exports$F$1 = {}; + _dewExec$F$1 = false; + exports$E$1 = {}; + _dewExec$E$1 = false; + exports$D$1 = {}; + _dewExec$D$1 = false; + exports$C$1 = {}; + _dewExec$C$1 = false; + exports$B$1 = {}; + _dewExec$B$1 = false; + exports$A$1 = {}; + _dewExec$A$1 = false; + exports$z$1 = {}; + _dewExec$z$1 = false; + exports$y$1 = {}; + _dewExec$y$1 = false; + exports$x$1 = {}; + _dewExec$x$1 = false; + module$2$1 = { + exports: exports$x$1 + }; + _global$5$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$w$1 = {}; + _dewExec$w$1 = false; + exports$v$1 = {}; + _dewExec$v$1 = false; + exports$u$1 = {}; + _dewExec$u$1 = false; + exports$t$1 = {}; + _dewExec$t$1 = false; + exports$s$1 = {}; + _dewExec$s$1 = false; + exports$r$1 = {}; + _dewExec$r$1 = false; + exports$q$1 = {}; + _dewExec$q$1 = false; + exports$p$1 = {}; + _dewExec$p$1 = false; + exports$o$1 = {}; + _dewExec$o$1 = false; + exports$n$1 = {}; + _dewExec$n$1 = false; + exports$m$1 = {}; + _dewExec$m$1 = false; + exports$l$1 = {}; + _dewExec$l$1 = false; + exports$k$1 = {}; + _dewExec$k$1 = false; + exports$j$1 = {}; + _dewExec$j$1 = false; + exports$i$1 = {}; + _dewExec$i$1 = false; + exports$h$1 = {}; + _dewExec$h$1 = false; + exports$g$1 = {}; + _dewExec$g$1 = false; + _aesid$1 = { + "2.16.840.1.101.3.4.1.1": "aes-128-ecb", + "2.16.840.1.101.3.4.1.2": "aes-128-cbc", + "2.16.840.1.101.3.4.1.3": "aes-128-ofb", + "2.16.840.1.101.3.4.1.4": "aes-128-cfb", + "2.16.840.1.101.3.4.1.21": "aes-192-ecb", + "2.16.840.1.101.3.4.1.22": "aes-192-cbc", + "2.16.840.1.101.3.4.1.23": "aes-192-ofb", + "2.16.840.1.101.3.4.1.24": "aes-192-cfb", + "2.16.840.1.101.3.4.1.41": "aes-256-ecb", + "2.16.840.1.101.3.4.1.42": "aes-256-cbc", + "2.16.840.1.101.3.4.1.43": "aes-256-ofb", + "2.16.840.1.101.3.4.1.44": "aes-256-cfb" + }; + exports$f$1 = {}; + _dewExec$f$1 = false; + exports$e$1 = {}; + _dewExec$e$1 = false; + _curves$1 = { + "1.3.132.0.10": "secp256k1", + "1.3.132.0.33": "p224", + "1.2.840.10045.3.1.1": "p192", + "1.2.840.10045.3.1.7": "p256", + "1.3.132.0.34": "p384", + "1.3.132.0.35": "p521" + }; + exports$d$1 = {}; + _dewExec$d$1 = false; + exports$c$1 = {}; + _dewExec$c$1 = false; + exports$b$1 = {}; + _dewExec$b$1 = false; + _global$4$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$a$1 = {}; + _dewExec$a$1 = false; + module$1$1 = { + exports: exports$a$1 + }; + _global$3$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$9$1 = {}; + _dewExec$9$1 = false; + _global$2$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$8$1 = {}; + _dewExec$8$1 = false; + exports$7$1 = {}; + _dewExec$7$1 = false; + exports$6$1 = {}; + _dewExec$6$1 = false; + module$8 = { + exports: exports$6$1 + }; + _global$1$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$5$1 = {}; + _dewExec$5$1 = false; + exports$4$1 = {}; + _dewExec$4$1 = false; + exports$3$1 = {}; + _dewExec$3$1 = false; + exports$2$12 = {}; + _dewExec$2$12 = false; + exports$1$12 = {}; + _dewExec$1$12 = false; + _global$x = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1V = {}; + _dewExec$1U = false; + crypto = dew$1U(); + crypto.Cipher; + crypto.Cipheriv; + crypto.Decipher; + crypto.Decipheriv; + crypto.DiffieHellman; + crypto.DiffieHellmanGroup; + crypto.Hash; + crypto.Hmac; + crypto.Sign; + crypto.Verify; + crypto.constants; + crypto.createCipher; + crypto.createCipheriv; + crypto.createCredentials; + crypto.createDecipher; + crypto.createDecipheriv; + crypto.createDiffieHellman; + crypto.createDiffieHellmanGroup; + crypto.createECDH; + crypto.createHash; + crypto.createHmac; + crypto.createSign; + crypto.createVerify; + crypto.getCiphers; + crypto.getDiffieHellman; + crypto.getHashes; + crypto.listCiphers; + crypto.pbkdf2; + crypto.pbkdf2Sync; + crypto.privateDecrypt; + crypto.privateEncrypt; + crypto.prng; + crypto.pseudoRandomBytes; + crypto.publicDecrypt; + crypto.publicEncrypt; + crypto.randomBytes; + crypto.randomFill; + crypto.randomFillSync; + crypto.rng; + exports$12$2 = {}; + _dewExec$11$2 = false; + _global$a$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$11$2 = {}; + _dewExec$10$2 = false; + _global$9$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$10$2 = {}; + _dewExec$$$2 = false; + _primes$2 = { + "modp1": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" + }, + "modp2": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" + }, + "modp5": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" + }, + "modp14": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" + }, + "modp15": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" + }, + "modp16": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" + }, + "modp17": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" + }, + "modp18": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" + } + }; + exports$$$2 = {}; + _dewExec$_$2 = false; + _global$8$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$_$2 = {}; + _dewExec$Z$2 = false; + exports$Z$2 = {}; + _dewExec$Y$2 = false; + exports$Y$2 = {}; + _dewExec$X$2 = false; + module$4$2 = { + exports: exports$Y$2 + }; + _global$7$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$X$2 = {}; + _dewExec$W$2 = false; + _package$2 = { + "name": "elliptic", + "version": "6.5.4", + "description": "EC cryptography", + "main": "lib/elliptic.js", + "files": [ + "lib" + ], + "scripts": { + "lint": "eslint lib test", + "lint:fix": "npm run lint -- --fix", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "test": "npm run lint && npm run unit", + "version": "grunt dist && git add dist/" + }, + "repository": { + "type": "git", + "url": "git@github.com:indutny/elliptic" + }, + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "author": "Fedor Indutny ", + "license": "MIT", + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "homepage": "https://github.com/indutny/elliptic", + "devDependencies": { + "brfs": "^2.0.2", + "coveralls": "^3.1.0", + "eslint": "^7.6.0", + "grunt": "^1.2.1", + "grunt-browserify": "^5.3.0", + "grunt-cli": "^1.3.2", + "grunt-contrib-connect": "^3.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^5.0.0", + "grunt-mocha-istanbul": "^5.0.2", + "grunt-saucelabs": "^9.0.1", + "istanbul": "^0.4.5", + "mocha": "^8.0.1" + }, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }; + exports$W$2 = {}; + _dewExec$V$2 = false; + module$3$2 = { + exports: exports$W$2 + }; + _global$6$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$V$2 = {}; + _dewExec$U$2 = false; + exports$U$2 = {}; + _dewExec$T$2 = false; + exports$T$2 = {}; + _dewExec$S$2 = false; + exports$S$2 = {}; + _dewExec$R$2 = false; + exports$R$2 = {}; + _dewExec$Q$2 = false; + exports$Q$2 = {}; + _dewExec$P$2 = false; + exports$P$2 = {}; + _dewExec$O$2 = false; + exports$O$2 = {}; + _dewExec$N$2 = false; + exports$N$2 = {}; + _dewExec$M$2 = false; + exports$M$2 = {}; + _dewExec$L$2 = false; + exports$L$2 = {}; + _dewExec$K$2 = false; + exports$K$2 = {}; + _dewExec$J$2 = false; + exports$J$2 = {}; + _dewExec$I$2 = false; + exports$I$2 = {}; + _dewExec$H$2 = false; + exports$H$2 = {}; + _dewExec$G$2 = false; + exports$G$2 = {}; + _dewExec$F$2 = false; + exports$F$2 = {}; + _dewExec$E$2 = false; + exports$E$2 = {}; + _dewExec$D$2 = false; + exports$D$2 = {}; + _dewExec$C$2 = false; + exports$C$2 = {}; + _dewExec$B$2 = false; + exports$B$2 = {}; + _dewExec$A$2 = false; + exports$A$2 = {}; + _dewExec$z$2 = false; + exports$z$2 = {}; + _dewExec$y$2 = false; + exports$y$2 = {}; + _dewExec$x$2 = false; + module$2$2 = { + exports: exports$y$2 + }; + _global$5$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$x$2 = {}; + _dewExec$w$2 = false; + exports$w$2 = {}; + _dewExec$v$2 = false; + exports$v$2 = {}; + _dewExec$u$2 = false; + exports$u$2 = {}; + _dewExec$t$2 = false; + exports$t$2 = {}; + _dewExec$s$2 = false; + exports$s$2 = {}; + _dewExec$r$2 = false; + exports$r$2 = {}; + _dewExec$q$2 = false; + exports$q$2 = {}; + _dewExec$p$2 = false; + exports$p$2 = {}; + _dewExec$o$2 = false; + exports$o$2 = {}; + _dewExec$n$2 = false; + exports$n$2 = {}; + _dewExec$m$2 = false; + exports$m$2 = {}; + _dewExec$l$2 = false; + exports$l$2 = {}; + _dewExec$k$2 = false; + exports$k$2 = {}; + _dewExec$j$2 = false; + exports$j$2 = {}; + _dewExec$i$2 = false; + exports$i$2 = {}; + _dewExec$h$2 = false; + exports$h$2 = {}; + _dewExec$g$2 = false; + _aesid$2 = { + "2.16.840.1.101.3.4.1.1": "aes-128-ecb", + "2.16.840.1.101.3.4.1.2": "aes-128-cbc", + "2.16.840.1.101.3.4.1.3": "aes-128-ofb", + "2.16.840.1.101.3.4.1.4": "aes-128-cfb", + "2.16.840.1.101.3.4.1.21": "aes-192-ecb", + "2.16.840.1.101.3.4.1.22": "aes-192-cbc", + "2.16.840.1.101.3.4.1.23": "aes-192-ofb", + "2.16.840.1.101.3.4.1.24": "aes-192-cfb", + "2.16.840.1.101.3.4.1.41": "aes-256-ecb", + "2.16.840.1.101.3.4.1.42": "aes-256-cbc", + "2.16.840.1.101.3.4.1.43": "aes-256-ofb", + "2.16.840.1.101.3.4.1.44": "aes-256-cfb" + }; + exports$g$2 = {}; + _dewExec$f$3 = false; + exports$f$3 = {}; + _dewExec$e$3 = false; + _curves$2 = { + "1.3.132.0.10": "secp256k1", + "1.3.132.0.33": "p224", + "1.2.840.10045.3.1.1": "p192", + "1.2.840.10045.3.1.7": "p256", + "1.3.132.0.34": "p384", + "1.3.132.0.35": "p521" + }; + exports$e$3 = {}; + _dewExec$d$3 = false; + exports$d$3 = {}; + _dewExec$c$3 = false; + exports$c$3 = {}; + _dewExec$b$3 = false; + _global$4$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$b$3 = {}; + _dewExec$a$3 = false; + module$1$2 = { + exports: exports$b$3 + }; + _global$3$2 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$a$3 = {}; + _dewExec$9$3 = false; + _global$2$3 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$9$3 = {}; + _dewExec$8$3 = false; + exports$8$3 = {}; + _dewExec$7$3 = false; + exports$7$3 = {}; + _dewExec$6$3 = false; + module$c = { + exports: exports$7$3 + }; + _global$1$3 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$6$3 = {}; + _dewExec$5$3 = false; + exports$5$3 = {}; + _dewExec$4$3 = false; + exports$4$3 = {}; + _dewExec$3$3 = false; + exports$3$3 = {}; + _dewExec$2$3 = false; + exports$2$3 = {}; + _dewExec$1$3 = false; + _global$V = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1$3 = {}; + _dewExec$2Q = false; + exports$2R = dew$2Q(); + exports$2R["randomBytes"]; + exports$2R["rng"]; + exports$2R["pseudoRandomBytes"]; + exports$2R["prng"]; + exports$2R["createHash"]; + exports$2R["Hash"]; + exports$2R["createHmac"]; + exports$2R["Hmac"]; + exports$2R["getHashes"]; + exports$2R["pbkdf2"]; + exports$2R["pbkdf2Sync"]; + exports$2R["Cipher"]; + exports$2R["createCipher"]; + exports$2R["Cipheriv"]; + exports$2R["createCipheriv"]; + exports$2R["Decipher"]; + exports$2R["createDecipher"]; + exports$2R["Decipheriv"]; + exports$2R["createDecipheriv"]; + exports$2R["getCiphers"]; + exports$2R["listCiphers"]; + exports$2R["DiffieHellmanGroup"]; + exports$2R["createDiffieHellmanGroup"]; + exports$2R["getDiffieHellman"]; + exports$2R["createDiffieHellman"]; + exports$2R["DiffieHellman"]; + exports$2R["createSign"]; + exports$2R["Sign"]; + exports$2R["createVerify"]; + exports$2R["Verify"]; + exports$2R["createECDH"]; + exports$2R["publicEncrypt"]; + exports$2R["privateEncrypt"]; + exports$2R["publicDecrypt"]; + exports$2R["privateDecrypt"]; + exports$2R["randomFill"]; + exports$2R["randomFillSync"]; + exports$2R["createCredentials"]; + exports$2R["constants"]; + exports$2R.webcrypto = globalThis.crypto; + exports$2R.Cipher; + exports$2R.Cipheriv; + exports$2R.Decipher; + exports$2R.Decipheriv; + exports$2R.DiffieHellman; + exports$2R.DiffieHellmanGroup; + exports$2R.Hash; + exports$2R.Hmac; + exports$2R.Sign; + exports$2R.Verify; + exports$2R.constants; + exports$2R.createCipher; + exports$2R.createCipheriv; + exports$2R.createCredentials; + exports$2R.createDecipher; + exports$2R.createDecipheriv; + exports$2R.createDiffieHellman; + exports$2R.createDiffieHellmanGroup; + exports$2R.createECDH; + exports$2R.createHash; + exports$2R.createHmac; + exports$2R.createSign; + exports$2R.createVerify; + exports$2R.getCiphers; + exports$2R.getDiffieHellman; + exports$2R.getHashes; + exports$2R.listCiphers; + exports$2R.pbkdf2; + exports$2R.pbkdf2Sync; + exports$2R.privateDecrypt; + exports$2R.privateEncrypt; + exports$2R.prng; + exports$2R.pseudoRandomBytes; + exports$2R.publicDecrypt; + exports$2R.publicEncrypt; + exports$2R.randomBytes; + exports$2R.randomFill; + exports$2R.randomFillSync; + exports$2R.rng; + exports$2R.webcrypto; + exports$1j = {}; + _dewExec$1i = false; + _global$j = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1i = {}; + _dewExec$1h = false; + _global$i = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1h = {}; + _dewExec$1g = false; + _primes = { + "modp1": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" + }, + "modp2": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" + }, + "modp5": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" + }, + "modp14": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" + }, + "modp15": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" + }, + "modp16": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" + }, + "modp17": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" + }, + "modp18": { + "gen": "02", + "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" + } + }; + exports$1g = {}; + _dewExec$1f = false; + _global$h = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$1f = {}; + _dewExec$1e = false; + exports$1e = {}; + _dewExec$1d = false; + exports$1d = {}; + _dewExec$1c = false; + exports$1c = {}; + _dewExec$1b = false; + exports$1b = {}; + _dewExec$1a = false; + exports$1a = {}; + _dewExec$19 = false; + exports$192 = {}; + _dewExec$18 = false; + exports$182 = {}; + _dewExec$17 = false; + exports$172 = {}; + _dewExec$162 = false; + _global$g = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$162 = {}; + _dewExec$152 = false; + exports$152 = {}; + _dewExec$142 = false; + _global$f = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$142 = {}; + _dewExec$132 = false; + exports$132 = {}; + _dewExec$122 = false; + exports$122 = {}; + _dewExec$11 = false; + exports$11 = {}; + _dewExec$10 = false; + module$4 = { + exports: exports$11 + }; + _global$e = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$10 = {}; + _dewExec$$ = false; + _package = { + "name": "elliptic", + "version": "6.5.7", + "description": "EC cryptography", + "main": "lib/elliptic.js", + "files": [ + "lib" + ], + "scripts": { + "lint": "eslint lib test", + "lint:fix": "npm run lint -- --fix", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "test": "npm run lint && npm run unit", + "version": "grunt dist && git add dist/" + }, + "repository": { + "type": "git", + "url": "git@github.com:indutny/elliptic" + }, + "keywords": [ + "EC", + "Elliptic", + "curve", + "Cryptography" + ], + "author": "Fedor Indutny ", + "license": "MIT", + "bugs": { + "url": "https://github.com/indutny/elliptic/issues" + }, + "homepage": "https://github.com/indutny/elliptic", + "devDependencies": { + "brfs": "^2.0.2", + "coveralls": "^3.1.0", + "eslint": "^7.6.0", + "grunt": "^1.2.1", + "grunt-browserify": "^5.3.0", + "grunt-cli": "^1.3.2", + "grunt-contrib-connect": "^3.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-uglify": "^5.0.0", + "grunt-mocha-istanbul": "^5.0.2", + "grunt-saucelabs": "^9.0.1", + "istanbul": "^0.4.5", + "mocha": "^8.0.1" + }, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }; + exports$$ = {}; + _dewExec$_ = false; + module$3 = { + exports: exports$$ + }; + _global$d = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$_ = {}; + _dewExec$Z = false; + exports$Z = {}; + _dewExec$Y = false; + exports$Y = {}; + _dewExec$X = false; + exports$X = {}; + _dewExec$W = false; + exports$W = {}; + _dewExec$V = false; + exports$V = {}; + _dewExec$U = false; + exports$U = {}; + _dewExec$T = false; + exports$T = {}; + _dewExec$S = false; + exports$S = {}; + _dewExec$R = false; + exports$R = {}; + _dewExec$Q = false; + exports$Q = {}; + _dewExec$P = false; + exports$P = {}; + _dewExec$O = false; + exports$O = {}; + _dewExec$N = false; + exports$N = {}; + _dewExec$M = false; + exports$M = {}; + _dewExec$L = false; + exports$L = {}; + _dewExec$K = false; + exports$K = {}; + _dewExec$J = false; + exports$J = {}; + _dewExec$I = false; + exports$I = {}; + _dewExec$H = false; + exports$H = {}; + _dewExec$G = false; + exports$G = {}; + _dewExec$F = false; + exports$F = {}; + _dewExec$E = false; + exports$E = {}; + _dewExec$D = false; + exports$D = {}; + _dewExec$C = false; + exports$C = {}; + _dewExec$B = false; + exports$B = {}; + _dewExec$A = false; + exports$A = {}; + _dewExec$z = false; + exports$z = {}; + _dewExec$y = false; + exports$y = {}; + _dewExec$x = false; + exports$x = {}; + _dewExec$w = false; + module$2 = { + exports: exports$x + }; + _global$c = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$w = {}; + _dewExec$v = false; + _global$b = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$v = {}; + _dewExec$u = false; + _global$a = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$u = {}; + _dewExec$t = false; + _global$9 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$t = {}; + _dewExec$s = false; + _global$8 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$s = {}; + _dewExec$r = false; + exports$r = {}; + _dewExec$q = false; + exports$q = {}; + _dewExec$p = false; + exports$p = {}; + _dewExec$o = false; + _global$7 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$o = {}; + _dewExec$n = false; + _global$6 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$n = {}; + _dewExec$m = false; + exports$m = {}; + _dewExec$l = false; + _global$5 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$l = {}; + _dewExec$k2 = false; + _global$4 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$k2 = {}; + _dewExec$j2 = false; + exports$j2 = {}; + _dewExec$i2 = false; + exports$i2 = {}; + _dewExec$h2 = false; + exports$h2 = {}; + _dewExec$g3 = false; + _aesid = { + "2.16.840.1.101.3.4.1.1": "aes-128-ecb", + "2.16.840.1.101.3.4.1.2": "aes-128-cbc", + "2.16.840.1.101.3.4.1.3": "aes-128-ofb", + "2.16.840.1.101.3.4.1.4": "aes-128-cfb", + "2.16.840.1.101.3.4.1.21": "aes-192-ecb", + "2.16.840.1.101.3.4.1.22": "aes-192-cbc", + "2.16.840.1.101.3.4.1.23": "aes-192-ofb", + "2.16.840.1.101.3.4.1.24": "aes-192-cfb", + "2.16.840.1.101.3.4.1.41": "aes-256-ecb", + "2.16.840.1.101.3.4.1.42": "aes-256-cbc", + "2.16.840.1.101.3.4.1.43": "aes-256-ofb", + "2.16.840.1.101.3.4.1.44": "aes-256-cfb" + }; + exports$g3 = {}; + _dewExec$f3 = false; + exports$f3 = {}; + _dewExec$e3 = false; + _curves = { + "1.3.132.0.10": "secp256k1", + "1.3.132.0.33": "p224", + "1.2.840.10045.3.1.1": "p192", + "1.2.840.10045.3.1.7": "p256", + "1.3.132.0.34": "p384", + "1.3.132.0.35": "p521" + }; + exports$e3 = {}; + _dewExec$d3 = false; + exports$d3 = {}; + _dewExec$c3 = false; + exports$c4 = {}; + _dewExec$b4 = false; + exports$b4 = {}; + _dewExec$a4 = false; + module$1 = { + exports: exports$b4 + }; + _global$3 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$a4 = {}; + _dewExec$94 = false; + _global$23 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$94 = {}; + _dewExec$84 = false; + exports$85 = {}; + _dewExec$75 = false; + exports$75 = {}; + _dewExec$65 = false; + module3 = { + exports: exports$75 + }; + _global$110 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$65 = {}; + _dewExec$55 = false; + exports$55 = {}; + _dewExec$45 = false; + exports$45 = {}; + _dewExec$310 = false; + exports$310 = {}; + _dewExec$210 = false; + exports$210 = {}; + _dewExec$110 = false; + _global8 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$111 = {}; + _dewExec15 = false; + exports18 = dew15(); + exports18["randomBytes"]; + exports18["rng"]; + exports18["pseudoRandomBytes"]; + exports18["prng"]; + exports18["createHash"]; + exports18["Hash"]; + exports18["createHmac"]; + exports18["Hmac"]; + exports18["getHashes"]; + exports18["pbkdf2"]; + exports18["pbkdf2Sync"]; + exports18["Cipher"]; + exports18["createCipher"]; + exports18["Cipheriv"]; + exports18["createCipheriv"]; + exports18["Decipher"]; + exports18["createDecipher"]; + exports18["Decipheriv"]; + exports18["createDecipheriv"]; + exports18["getCiphers"]; + exports18["listCiphers"]; + exports18["DiffieHellmanGroup"]; + exports18["createDiffieHellmanGroup"]; + exports18["getDiffieHellman"]; + exports18["createDiffieHellman"]; + exports18["DiffieHellman"]; + exports18["createSign"]; + exports18["Sign"]; + exports18["createVerify"]; + exports18["Verify"]; + exports18["createECDH"]; + exports18["publicEncrypt"]; + exports18["privateEncrypt"]; + exports18["publicDecrypt"]; + exports18["privateDecrypt"]; + exports18["randomFill"]; + exports18["randomFillSync"]; + exports18["createCredentials"]; + exports18["constants"]; + exports18.webcrypto = globalThis.crypto; + exports18.getRandomValues = function(abv) { + var l7 = abv.length; + while (l7--) { + var bytes = exports18.randomBytes(7); + var randomFloat = bytes[0] % 32 / 32; + for (var i7 = 0; i7 < bytes.length; i7++) { + var byte = bytes[i7]; + randomFloat = (randomFloat + byte) / 256; + } + abv[l7] = Math.floor(randomFloat * 256); + } + return abv; + }; + exports18.randomUUID = function() { + return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, function(c7) { + return (c7 ^ exports18.getRandomValues(new Uint8Array(1))[0] & 15 >> c7 / 4).toString(16); + }); + }; + Cipher = exports18.Cipher; + Cipheriv = exports18.Cipheriv; + Decipher = exports18.Decipher; + Decipheriv = exports18.Decipheriv; + DiffieHellman = exports18.DiffieHellman; + DiffieHellmanGroup = exports18.DiffieHellmanGroup; + Hash2 = exports18.Hash; + Hmac = exports18.Hmac; + Sign = exports18.Sign; + Verify = exports18.Verify; + constants2 = exports18.constants; + createCipher = exports18.createCipher; + createCipheriv = exports18.createCipheriv; + createCredentials = exports18.createCredentials; + createDecipher = exports18.createDecipher; + createDecipheriv = exports18.createDecipheriv; + createDiffieHellman = exports18.createDiffieHellman; + createDiffieHellmanGroup = exports18.createDiffieHellmanGroup; + createECDH = exports18.createECDH; + createHash = exports18.createHash; + createHmac = exports18.createHmac; + createSign = exports18.createSign; + createVerify = exports18.createVerify; + getCiphers = exports18.getCiphers; + getDiffieHellman = exports18.getDiffieHellman; + getHashes = exports18.getHashes; + listCiphers = exports18.listCiphers; + pbkdf2 = exports18.pbkdf2; + pbkdf2Sync = exports18.pbkdf2Sync; + privateDecrypt = exports18.privateDecrypt; + privateEncrypt = exports18.privateEncrypt; + prng = exports18.prng; + pseudoRandomBytes = exports18.pseudoRandomBytes; + publicDecrypt = exports18.publicDecrypt; + publicEncrypt = exports18.publicEncrypt; + randomBytes = exports18.randomBytes; + randomFill = exports18.randomFill; + randomFillSync = exports18.randomFillSync; + rng = exports18.rng; + webcrypto = exports18.webcrypto; + getRandomValues = exports18.getRandomValues; + randomUUID = exports18.randomUUID; + } +}); + +// node_modules/avsc/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/avsc/lib/utils.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var buffer2 = (init_buffer(), __toCommonJS(buffer_exports)); + var crypto2 = (init_crypto(), __toCommonJS(crypto_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var Buffer4 = buffer2.Buffer; + var POOL = new BufferPool(4096); + var NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/; + var f8 = util2.format; + function newBuffer(size2) { + if (typeof Buffer4.alloc == "function") { + return Buffer4.alloc(size2); + } else { + return new Buffer4(size2); + } + } + function bufferFrom(data, enc) { + if (typeof Buffer4.from == "function") { + return Buffer4.from(data, enc); + } else { + return new Buffer4(data, enc); + } + } + function capitalize2(s7) { + return s7.charAt(0).toUpperCase() + s7.slice(1); + } + function compare(n1, n22) { + return n1 === n22 ? 0 : n1 < n22 ? -1 : 1; + } + function getOption(opts, key, def) { + var value2 = opts[key]; + return value2 === void 0 ? def : value2; + } + function getHash(str2, algorithm) { + algorithm = algorithm || "md5"; + var hash = crypto2.createHash(algorithm); + hash.end(str2); + return hash.read(); + } + function singleIndexOf(arr, v8) { + var pos = -1; + var i7, l7; + if (!arr) { + return -1; + } + for (i7 = 0, l7 = arr.length; i7 < l7; i7++) { + if (arr[i7] === v8) { + if (pos >= 0) { + return -2; + } + pos = i7; + } + } + return pos; + } + function toMap(arr, fn) { + var obj = {}; + var i7, elem; + for (i7 = 0; i7 < arr.length; i7++) { + elem = arr[i7]; + obj[fn(elem)] = elem; + } + return obj; + } + function objectValues(obj) { + return Object.keys(obj).map(function(key) { + return obj[key]; + }); + } + function hasDuplicates(arr, fn) { + var obj = /* @__PURE__ */ Object.create(null); + var i7, l7, elem; + for (i7 = 0, l7 = arr.length; i7 < l7; i7++) { + elem = arr[i7]; + if (fn) { + elem = fn(elem); + } + if (obj[elem]) { + return true; + } + obj[elem] = true; + } + return false; + } + function copyOwnProperties(src, dst, overwrite) { + var names = Object.getOwnPropertyNames(src); + var i7, l7, name2; + for (i7 = 0, l7 = names.length; i7 < l7; i7++) { + name2 = names[i7]; + if (!dst.hasOwnProperty(name2) || overwrite) { + var descriptor = Object.getOwnPropertyDescriptor(src, name2); + Object.defineProperty(dst, name2, descriptor); + } + } + return dst; + } + function isValidName(str2) { + return NAME_PATTERN.test(str2); + } + function qualify(name2, namespace) { + if (~name2.indexOf(".")) { + name2 = name2.replace(/^\./, ""); + } else if (namespace) { + name2 = namespace + "." + name2; + } + name2.split(".").forEach(function(part) { + if (!isValidName(part)) { + throw new Error(f8("invalid name: %j", name2)); + } + }); + return name2; + } + function unqualify(name2) { + var parts = name2.split("."); + return parts[parts.length - 1]; + } + function impliedNamespace(name2) { + var match = /^(.*)\.[^.]+$/.exec(name2); + return match ? match[1] : void 0; + } + function jsonEnd(str2, pos) { + pos = pos | 0; + var c7 = str2.charAt(pos++); + if (/[\d-]/.test(c7)) { + while (/[eE\d.+-]/.test(str2.charAt(pos))) { + pos++; + } + return pos; + } else if (/true|null/.test(str2.slice(pos - 1, pos + 3))) { + return pos + 3; + } else if (/false/.test(str2.slice(pos - 1, pos + 4))) { + return pos + 4; + } + var depth = 0; + var literal = false; + do { + switch (c7) { + case "{": + case "[": + if (!literal) { + depth++; + } + break; + case "}": + case "]": + if (!literal && !--depth) { + return pos; + } + break; + case '"': + literal = !literal; + if (!depth && !literal) { + return pos; + } + break; + case "\\": + pos++; + } + } while (c7 = str2.charAt(pos++)); + return -1; + } + function abstractFunction() { + throw new Error("abstract"); + } + function addDeprecatedGetters(obj, props) { + var proto = obj.prototype; + var i7, l7, prop, getter; + for (i7 = 0, l7 = props.length; i7 < l7; i7++) { + prop = props[i7]; + getter = "get" + capitalize2(prop); + proto[getter] = util2.deprecate( + createGetter(prop), + "use `." + prop + "` instead of `." + getter + "()`" + ); + } + function createGetter(prop2) { + return function() { + var delegate = this[prop2]; + return typeof delegate == "function" ? delegate.apply(this, arguments) : delegate; + }; + } + } + function BufferPool(len) { + this._len = len | 0; + this._pos = 0; + this._slab = newBuffer(this._len); + } + BufferPool.prototype.alloc = function(len) { + if (len < 0) { + throw new Error("negative length"); + } + var maxLen = this._len; + if (len > maxLen) { + return newBuffer(len); + } + if (this._pos + len > maxLen) { + this._slab = newBuffer(maxLen); + this._pos = 0; + } + return this._slab.slice(this._pos, this._pos += len); + }; + function Lcg(seed) { + var a7 = 1103515245; + var c7 = 12345; + var m7 = Math.pow(2, 31); + var state = Math.floor(seed || Math.random() * (m7 - 1)); + this._max = m7; + this._nextInt = function() { + return state = (a7 * state + c7) % m7; + }; + } + Lcg.prototype.nextBoolean = function() { + return !!(this._nextInt() % 2); + }; + Lcg.prototype.nextInt = function(start, end) { + if (end === void 0) { + end = start; + start = 0; + } + end = end === void 0 ? this._max : end; + return start + Math.floor(this.nextFloat() * (end - start)); + }; + Lcg.prototype.nextFloat = function(start, end) { + if (end === void 0) { + end = start; + start = 0; + } + end = end === void 0 ? 1 : end; + return start + (end - start) * this._nextInt() / this._max; + }; + Lcg.prototype.nextString = function(len, flags) { + len |= 0; + flags = flags || "aA"; + var mask = ""; + if (flags.indexOf("a") > -1) { + mask += "abcdefghijklmnopqrstuvwxyz"; + } + if (flags.indexOf("A") > -1) { + mask += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + } + if (flags.indexOf("#") > -1) { + mask += "0123456789"; + } + if (flags.indexOf("!") > -1) { + mask += "~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\"; + } + var result2 = []; + for (var i7 = 0; i7 < len; i7++) { + result2.push(this.choice(mask)); + } + return result2.join(""); + }; + Lcg.prototype.nextBuffer = function(len) { + var arr = []; + var i7; + for (i7 = 0; i7 < len; i7++) { + arr.push(this.nextInt(256)); + } + return bufferFrom(arr); + }; + Lcg.prototype.choice = function(arr) { + var len = arr.length; + if (!len) { + throw new Error("choosing from empty array"); + } + return arr[this.nextInt(len)]; + }; + function OrderedQueue() { + this._index = 0; + this._items = []; + } + OrderedQueue.prototype.push = function(item) { + var items = this._items; + var i7 = items.length | 0; + var j6; + items.push(item); + while (i7 > 0 && items[i7].index < items[j6 = i7 - 1 >> 1].index) { + item = items[i7]; + items[i7] = items[j6]; + items[j6] = item; + i7 = j6; + } + }; + OrderedQueue.prototype.pop = function() { + var items = this._items; + var len = items.length - 1 | 0; + var first = items[0]; + if (!first || first.index > this._index) { + return null; + } + this._index++; + if (!len) { + items.pop(); + return first; + } + items[0] = items.pop(); + var mid = len >> 1; + var i7 = 0; + var i1, i22, j6, item, c7, c1, c22; + while (i7 < mid) { + item = items[i7]; + i1 = (i7 << 1) + 1; + i22 = i7 + 1 << 1; + c1 = items[i1]; + c22 = items[i22]; + if (!c22 || c1.index <= c22.index) { + c7 = c1; + j6 = i1; + } else { + c7 = c22; + j6 = i22; + } + if (c7.index >= item.index) { + break; + } + items[j6] = item; + items[i7] = c7; + i7 = j6; + } + return first; + }; + function Tap(buf, pos) { + this.buf = buf; + this.pos = pos | 0; + if (this.pos < 0) { + throw new Error("negative offset"); + } + } + Tap.prototype.isValid = function() { + return this.pos <= this.buf.length; + }; + Tap.prototype._invalidate = function() { + this.pos = this.buf.length + 1; + }; + Tap.prototype.readBoolean = function() { + return !!this.buf[this.pos++]; + }; + Tap.prototype.skipBoolean = function() { + this.pos++; + }; + Tap.prototype.writeBoolean = function(b8) { + this.buf[this.pos++] = !!b8; + }; + Tap.prototype.readInt = Tap.prototype.readLong = function() { + var n7 = 0; + var k6 = 0; + var buf = this.buf; + var b8, h8, f9, fk; + do { + b8 = buf[this.pos++]; + h8 = b8 & 128; + n7 |= (b8 & 127) << k6; + k6 += 7; + } while (h8 && k6 < 28); + if (h8) { + f9 = n7; + fk = 268435456; + do { + b8 = buf[this.pos++]; + f9 += (b8 & 127) * fk; + fk *= 128; + } while (b8 & 128); + return (f9 % 2 ? -(f9 + 1) : f9) / 2; + } + return n7 >> 1 ^ -(n7 & 1); + }; + Tap.prototype.skipInt = Tap.prototype.skipLong = function() { + var buf = this.buf; + while (buf[this.pos++] & 128) { + } + }; + Tap.prototype.writeInt = Tap.prototype.writeLong = function(n7) { + var buf = this.buf; + var f9, m7; + if (n7 >= -1073741824 && n7 < 1073741824) { + m7 = n7 >= 0 ? n7 << 1 : ~n7 << 1 | 1; + do { + buf[this.pos] = m7 & 127; + m7 >>= 7; + } while (m7 && (buf[this.pos++] |= 128)); + } else { + f9 = n7 >= 0 ? n7 * 2 : -n7 * 2 - 1; + do { + buf[this.pos] = f9 & 127; + f9 /= 128; + } while (f9 >= 1 && (buf[this.pos++] |= 128)); + } + this.pos++; + }; + Tap.prototype.readFloat = function() { + var buf = this.buf; + var pos = this.pos; + this.pos += 4; + if (this.pos > buf.length) { + return 0; + } + return this.buf.readFloatLE(pos); + }; + Tap.prototype.skipFloat = function() { + this.pos += 4; + }; + Tap.prototype.writeFloat = function(f9) { + var buf = this.buf; + var pos = this.pos; + this.pos += 4; + if (this.pos > buf.length) { + return; + } + return this.buf.writeFloatLE(f9, pos); + }; + Tap.prototype.readDouble = function() { + var buf = this.buf; + var pos = this.pos; + this.pos += 8; + if (this.pos > buf.length) { + return 0; + } + return this.buf.readDoubleLE(pos); + }; + Tap.prototype.skipDouble = function() { + this.pos += 8; + }; + Tap.prototype.writeDouble = function(d7) { + var buf = this.buf; + var pos = this.pos; + this.pos += 8; + if (this.pos > buf.length) { + return; + } + return this.buf.writeDoubleLE(d7, pos); + }; + Tap.prototype.readFixed = function(len) { + var pos = this.pos; + this.pos += len; + if (this.pos > this.buf.length) { + return; + } + var fixed = POOL.alloc(len); + this.buf.copy(fixed, 0, pos, pos + len); + return fixed; + }; + Tap.prototype.skipFixed = function(len) { + this.pos += len; + }; + Tap.prototype.writeFixed = function(buf, len) { + len = len || buf.length; + var pos = this.pos; + this.pos += len; + if (this.pos > this.buf.length) { + return; + } + buf.copy(this.buf, pos, 0, len); + }; + Tap.prototype.readBytes = function() { + var len = this.readLong(); + if (len < 0) { + this._invalidate(); + return; + } + return this.readFixed(len); + }; + Tap.prototype.skipBytes = function() { + var len = this.readLong(); + if (len < 0) { + this._invalidate(); + return; + } + this.pos += len; + }; + Tap.prototype.writeBytes = function(buf) { + var len = buf.length; + this.writeLong(len); + this.writeFixed(buf, len); + }; + if (typeof Buffer4.prototype.utf8Slice == "function") { + Tap.prototype.readString = function() { + var len = this.readLong(); + if (len < 0) { + this._invalidate(); + return ""; + } + var pos = this.pos; + var buf = this.buf; + this.pos += len; + if (this.pos > buf.length) { + return; + } + return this.buf.utf8Slice(pos, pos + len); + }; + } else { + Tap.prototype.readString = function() { + var len = this.readLong(); + if (len < 0) { + this._invalidate(); + return ""; + } + var pos = this.pos; + var buf = this.buf; + this.pos += len; + if (this.pos > buf.length) { + return; + } + return this.buf.slice(pos, pos + len).toString(); + }; + } + Tap.prototype.skipString = function() { + var len = this.readLong(); + if (len < 0) { + this._invalidate(); + return; + } + this.pos += len; + }; + Tap.prototype.writeString = function(s7) { + var len = Buffer4.byteLength(s7); + var buf = this.buf; + this.writeLong(len); + var pos = this.pos; + this.pos += len; + if (this.pos > buf.length) { + return; + } + if (len > 64 && typeof Buffer4.prototype.utf8Write == "function") { + buf.utf8Write(s7, pos, len); + } else { + var i7, l7, c1, c22; + for (i7 = 0, l7 = len; i7 < l7; i7++) { + c1 = s7.charCodeAt(i7); + if (c1 < 128) { + buf[pos++] = c1; + } else if (c1 < 2048) { + buf[pos++] = c1 >> 6 | 192; + buf[pos++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c22 = s7.charCodeAt(i7 + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c22 & 1023); + i7++; + buf[pos++] = c1 >> 18 | 240; + buf[pos++] = c1 >> 12 & 63 | 128; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } else { + buf[pos++] = c1 >> 12 | 224; + buf[pos++] = c1 >> 6 & 63 | 128; + buf[pos++] = c1 & 63 | 128; + } + } + } + }; + if (typeof Buffer4.prototype.latin1Write == "function") { + Tap.prototype.writeBinary = function(str2, len) { + var pos = this.pos; + this.pos += len; + if (this.pos > this.buf.length) { + return; + } + this.buf.latin1Write(str2, pos, len); + }; + } else if (typeof Buffer4.prototype.binaryWrite == "function") { + Tap.prototype.writeBinary = function(str2, len) { + var pos = this.pos; + this.pos += len; + if (this.pos > this.buf.length) { + return; + } + this.buf.binaryWrite(str2, pos, len); + }; + } else { + Tap.prototype.writeBinary = function(s7, len) { + var pos = this.pos; + this.pos += len; + if (this.pos > this.buf.length) { + return; + } + this.buf.write(s7, pos, len, "binary"); + }; + } + Tap.prototype.matchBoolean = function(tap2) { + return this.buf[this.pos++] - tap2.buf[tap2.pos++]; + }; + Tap.prototype.matchInt = Tap.prototype.matchLong = function(tap2) { + var n1 = this.readLong(); + var n22 = tap2.readLong(); + return n1 === n22 ? 0 : n1 < n22 ? -1 : 1; + }; + Tap.prototype.matchFloat = function(tap2) { + var n1 = this.readFloat(); + var n22 = tap2.readFloat(); + return n1 === n22 ? 0 : n1 < n22 ? -1 : 1; + }; + Tap.prototype.matchDouble = function(tap2) { + var n1 = this.readDouble(); + var n22 = tap2.readDouble(); + return n1 === n22 ? 0 : n1 < n22 ? -1 : 1; + }; + Tap.prototype.matchFixed = function(tap2, len) { + return this.readFixed(len).compare(tap2.readFixed(len)); + }; + Tap.prototype.matchBytes = Tap.prototype.matchString = function(tap2) { + var l1 = this.readLong(); + var p1 = this.pos; + this.pos += l1; + var l22 = tap2.readLong(); + var p22 = tap2.pos; + tap2.pos += l22; + var b1 = this.buf.slice(p1, this.pos); + var b22 = tap2.buf.slice(p22, tap2.pos); + return b1.compare(b22); + }; + Tap.prototype.unpackLongBytes = function() { + var res = newBuffer(8); + var n7 = 0; + var i7 = 0; + var j6 = 6; + var buf = this.buf; + var b8, neg; + b8 = buf[this.pos++]; + neg = b8 & 1; + res.fill(0); + n7 |= (b8 & 127) >> 1; + while (b8 & 128) { + b8 = buf[this.pos++]; + n7 |= (b8 & 127) << j6; + j6 += 7; + if (j6 >= 8) { + j6 -= 8; + res[i7++] = n7; + n7 >>= 8; + } + } + res[i7] = n7; + if (neg) { + invert2(res, 8); + } + return res; + }; + Tap.prototype.packLongBytes = function(buf) { + var neg = (buf[7] & 128) >> 7; + var res = this.buf; + var j6 = 1; + var k6 = 0; + var m7 = 3; + var n7; + if (neg) { + invert2(buf, 8); + n7 = 1; + } else { + n7 = 0; + } + var parts = [ + buf.readUIntLE(0, 3), + buf.readUIntLE(3, 3), + buf.readUIntLE(6, 2) + ]; + while (m7 && !parts[--m7]) { + } + while (k6 < m7) { + n7 |= parts[k6++] << j6; + j6 += 24; + while (j6 > 7) { + res[this.pos++] = n7 & 127 | 128; + n7 >>= 7; + j6 -= 7; + } + } + n7 |= parts[m7] << j6; + do { + res[this.pos] = n7 & 127; + n7 >>= 7; + } while (n7 && (res[this.pos++] |= 128)); + this.pos++; + if (neg) { + invert2(buf, 8); + } + }; + function invert2(buf, len) { + while (len--) { + buf[len] = ~buf[len]; + } + } + module5.exports = { + abstractFunction, + addDeprecatedGetters, + bufferFrom, + capitalize: capitalize2, + copyOwnProperties, + getHash, + compare, + getOption, + impliedNamespace, + isValidName, + jsonEnd, + newBuffer, + objectValues, + qualify, + toMap, + singleIndexOf, + hasDuplicates, + unqualify, + BufferPool, + Lcg, + OrderedQueue, + Tap + }; + } +}); + +// node_modules/avsc/lib/types.js +var require_types7 = __commonJS({ + "node_modules/avsc/lib/types.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var utils = require_utils8(); + var buffer2 = (init_buffer(), __toCommonJS(buffer_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var Buffer4 = buffer2.Buffer; + var SlowBuffer2 = buffer2.SlowBuffer; + var Tap = utils.Tap; + var debug2 = util2.debuglog("avsc:types"); + var f8 = util2.format; + var TYPES2 = { + "array": ArrayType, + "boolean": BooleanType, + "bytes": BytesType, + "double": DoubleType, + "enum": EnumType, + "error": RecordType, + "fixed": FixedType, + "float": FloatType, + "int": IntType, + "long": LongType, + "map": MapType, + "null": NullType, + "record": RecordType, + "string": StringType + }; + var RANDOM = new utils.Lcg(); + var TAP = new Tap(new SlowBuffer2(1024)); + var LOGICAL_TYPE = null; + var UNDERLYING_TYPES = []; + function Type3(schema8, opts) { + var type3; + if (LOGICAL_TYPE) { + type3 = LOGICAL_TYPE; + UNDERLYING_TYPES.push([LOGICAL_TYPE, this]); + LOGICAL_TYPE = null; + } else { + type3 = this; + } + this._hash = new Hash3(); + this.name = void 0; + this.aliases = void 0; + this.doc = schema8 && schema8.doc ? "" + schema8.doc : void 0; + if (schema8) { + var name2 = schema8.name; + var namespace = schema8.namespace === void 0 ? opts && opts.namespace : schema8.namespace; + if (name2 !== void 0) { + name2 = maybeQualify(name2, namespace); + if (isPrimitive2(name2)) { + throw new Error(f8("cannot rename primitive type: %j", name2)); + } + var registry = opts && opts.registry; + if (registry) { + if (registry[name2] !== void 0) { + throw new Error(f8("duplicate type name: %s", name2)); + } + registry[name2] = type3; + } + } else if (opts && opts.noAnonymousTypes) { + throw new Error(f8("missing name property in schema: %j", schema8)); + } + this.name = name2; + this.aliases = schema8.aliases ? schema8.aliases.map(function(s7) { + return maybeQualify(s7, namespace); + }) : []; + } + } + Type3.forSchema = function(schema8, opts) { + opts = opts || {}; + opts.registry = opts.registry || {}; + var UnionType2 = function(wrapUnions) { + if (wrapUnions === true) { + wrapUnions = "always"; + } else if (wrapUnions === false) { + wrapUnions = "never"; + } else if (wrapUnions === void 0) { + wrapUnions = "auto"; + } else if (typeof wrapUnions == "string") { + wrapUnions = wrapUnions.toLowerCase(); + } + switch (wrapUnions) { + case "always": + return WrappedUnionType; + case "never": + return UnwrappedUnionType; + case "auto": + return void 0; + default: + throw new Error(f8("invalid wrap unions option: %j", wrapUnions)); + } + }(opts.wrapUnions); + if (schema8 === null) { + throw new Error('invalid type: null (did you mean "null"?)'); + } + if (Type3.isType(schema8)) { + return schema8; + } + var type3; + if (opts.typeHook && (type3 = opts.typeHook(schema8, opts))) { + if (!Type3.isType(type3)) { + throw new Error(f8("invalid typehook return value: %j", type3)); + } + return type3; + } + if (typeof schema8 == "string") { + schema8 = maybeQualify(schema8, opts.namespace); + type3 = opts.registry[schema8]; + if (type3) { + return type3; + } + if (isPrimitive2(schema8)) { + return opts.registry[schema8] = Type3.forSchema({ type: schema8 }, opts); + } + throw new Error(f8("undefined type name: %s", schema8)); + } + if (schema8.logicalType && opts.logicalTypes && !LOGICAL_TYPE) { + var DerivedType = opts.logicalTypes[schema8.logicalType]; + if (DerivedType) { + var namespace = opts.namespace; + var registry = {}; + Object.keys(opts.registry).forEach(function(key) { + registry[key] = opts.registry[key]; + }); + try { + debug2("instantiating logical type for %s", schema8.logicalType); + return new DerivedType(schema8, opts); + } catch (err) { + debug2("failed to instantiate logical type for %s", schema8.logicalType); + if (opts.assertLogicalTypes) { + throw err; + } + LOGICAL_TYPE = null; + opts.namespace = namespace; + opts.registry = registry; + } + } + } + if (Array.isArray(schema8)) { + var logicalType = LOGICAL_TYPE; + LOGICAL_TYPE = null; + var types3 = schema8.map(function(obj) { + return Type3.forSchema(obj, opts); + }); + if (!UnionType2) { + UnionType2 = isAmbiguous(types3) ? WrappedUnionType : UnwrappedUnionType; + } + LOGICAL_TYPE = logicalType; + type3 = new UnionType2(types3, opts); + } else { + type3 = function(typeName) { + var Type4 = TYPES2[typeName]; + if (Type4 === void 0) { + throw new Error(f8("unknown type: %j", typeName)); + } + return new Type4(schema8, opts); + }(schema8.type); + } + return type3; + }; + Type3.forValue = function(val, opts) { + opts = opts || {}; + opts.emptyArrayType = opts.emptyArrayType || Type3.forSchema({ + type: "array", + items: "null" + }); + if (opts.valueHook) { + var type3 = opts.valueHook(val, opts); + if (type3 !== void 0) { + if (!Type3.isType(type3)) { + throw new Error(f8("invalid value hook return value: %j", type3)); + } + return type3; + } + } + switch (typeof val) { + case "string": + return Type3.forSchema("string", opts); + case "boolean": + return Type3.forSchema("boolean", opts); + case "number": + if ((val | 0) === val) { + return Type3.forSchema("int", opts); + } else if (Math.abs(val) < 9007199254740991) { + return Type3.forSchema("float", opts); + } + return Type3.forSchema("double", opts); + case "object": + if (val === null) { + return Type3.forSchema("null", opts); + } else if (Array.isArray(val)) { + if (!val.length) { + return opts.emptyArrayType; + } + return Type3.forSchema({ + type: "array", + items: Type3.forTypes( + val.map(function(v8) { + return Type3.forValue(v8, opts); + }), + opts + ) + }, opts); + } else if (Buffer4.isBuffer(val)) { + return Type3.forSchema("bytes", opts); + } + var fieldNames = Object.keys(val); + if (fieldNames.some(function(s7) { + return !utils.isValidName(s7); + })) { + return Type3.forSchema({ + type: "map", + values: Type3.forTypes(fieldNames.map(function(s7) { + return Type3.forValue(val[s7], opts); + }), opts) + }, opts); + } + return Type3.forSchema({ + type: "record", + fields: fieldNames.map(function(s7) { + return { name: s7, type: Type3.forValue(val[s7], opts) }; + }) + }, opts); + default: + throw new Error(f8("cannot infer type from: %j", val)); + } + }; + Type3.forTypes = function(types3, opts) { + if (!types3.length) { + throw new Error("no types to combine"); + } + if (types3.length === 1) { + return types3[0]; + } + opts = opts || {}; + var expanded = []; + var numWrappedUnions = 0; + var isValidWrappedUnion = true; + types3.forEach(function(type3) { + switch (type3.typeName) { + case "union:unwrapped": + isValidWrappedUnion = false; + expanded = expanded.concat(type3.types); + break; + case "union:wrapped": + numWrappedUnions++; + expanded = expanded.concat(type3.types); + break; + case "null": + expanded.push(type3); + break; + default: + isValidWrappedUnion = false; + expanded.push(type3); + } + }); + if (numWrappedUnions) { + if (!isValidWrappedUnion) { + throw new Error("cannot combine wrapped union"); + } + var branchTypes = {}; + expanded.forEach(function(type3) { + var name2 = type3.branchName; + var branchType = branchTypes[name2]; + if (!branchType) { + branchTypes[name2] = type3; + } else if (!type3.equals(branchType)) { + throw new Error("inconsistent branch type"); + } + }); + var wrapUnions = opts.wrapUnions; + var unionType2; + opts.wrapUnions = true; + try { + unionType2 = Type3.forSchema(Object.keys(branchTypes).map(function(name2) { + return branchTypes[name2]; + }), opts); + } catch (err) { + opts.wrapUnions = wrapUnions; + throw err; + } + opts.wrapUnions = wrapUnions; + return unionType2; + } + var bucketized = {}; + expanded.forEach(function(type3) { + var bucket = getTypeBucket(type3); + var bucketTypes = bucketized[bucket]; + if (!bucketTypes) { + bucketized[bucket] = bucketTypes = []; + } + bucketTypes.push(type3); + }); + var buckets = Object.keys(bucketized); + var augmented = buckets.map(function(bucket) { + var bucketTypes = bucketized[bucket]; + if (bucketTypes.length === 1) { + return bucketTypes[0]; + } else { + switch (bucket) { + case "null": + case "boolean": + return bucketTypes[0]; + case "number": + return combineNumbers(bucketTypes); + case "string": + return combineStrings(bucketTypes, opts); + case "buffer": + return combineBuffers(bucketTypes, opts); + case "array": + bucketTypes = bucketTypes.filter(function(t8) { + return t8 !== opts.emptyArrayType; + }); + if (!bucketTypes.length) { + return opts.emptyArrayType; + } + return Type3.forSchema({ + type: "array", + items: Type3.forTypes(bucketTypes.map(function(t8) { + return t8.itemsType; + }), opts) + }, opts); + default: + return combineObjects(bucketTypes, opts); + } + } + }); + if (augmented.length === 1) { + return augmented[0]; + } else { + return Type3.forSchema(augmented, opts); + } + }; + Type3.isType = function() { + var l7 = arguments.length; + if (!l7) { + return false; + } + var any = arguments[0]; + if (!any || typeof any._update != "function" || typeof any.fingerprint != "function") { + return false; + } + if (l7 === 1) { + return true; + } + var typeName = any.typeName; + var i7; + for (i7 = 1; i7 < l7; i7++) { + if (typeName.indexOf(arguments[i7]) === 0) { + return true; + } + } + return false; + }; + Type3.__reset = function(size2) { + debug2("resetting type buffer to %d", size2); + TAP.buf = new SlowBuffer2(size2); + }; + Object.defineProperty(Type3.prototype, "branchName", { + enumerable: true, + get: function() { + var type3 = Type3.isType(this, "logical") ? this.underlyingType : this; + if (type3.name) { + return type3.name; + } + if (Type3.isType(type3, "abstract")) { + return type3._concreteTypeName; + } + return Type3.isType(type3, "union") ? void 0 : type3.typeName; + } + }); + Type3.prototype.clone = function(val, opts) { + if (opts) { + opts = { + coerce: !!opts.coerceBuffers | 0, + // Coerce JSON to Buffer. + fieldHook: opts.fieldHook, + qualifyNames: !!opts.qualifyNames, + skip: !!opts.skipMissingFields, + wrap: !!opts.wrapUnions | 0 + // Wrap first match into union. + }; + return this._copy(val, opts); + } else { + return this.fromBuffer(this.toBuffer(val)); + } + }; + Type3.prototype.compare = utils.abstractFunction; + Type3.prototype.compareBuffers = function(buf1, buf2) { + return this._match(new Tap(buf1), new Tap(buf2)); + }; + Type3.prototype.createResolver = function(type3, opts) { + if (!Type3.isType(type3)) { + throw new Error(f8("not a type: %j", type3)); + } + if (!Type3.isType(this, "union", "logical") && Type3.isType(type3, "logical")) { + return this.createResolver(type3.underlyingType, opts); + } + opts = opts || {}; + opts.registry = opts.registry || {}; + var resolver, key; + if (Type3.isType(this, "record", "error") && Type3.isType(type3, "record", "error")) { + key = this.name + ":" + type3.name; + resolver = opts.registry[key]; + if (resolver) { + return resolver; + } + } + resolver = new Resolver(this); + if (key) { + opts.registry[key] = resolver; + } + if (Type3.isType(type3, "union")) { + var resolvers = type3.types.map(function(t8) { + return this.createResolver(t8, opts); + }, this); + resolver._read = function(tap2) { + var index4 = tap2.readLong(); + var resolver2 = resolvers[index4]; + if (resolver2 === void 0) { + throw new Error(f8("invalid union index: %s", index4)); + } + return resolvers[index4]._read(tap2); + }; + } else { + this._update(resolver, type3, opts); + } + if (!resolver._read) { + throw new Error(f8("cannot read %s as %s", type3, this)); + } + return Object.freeze(resolver); + }; + Type3.prototype.decode = function(buf, pos, resolver) { + var tap2 = new Tap(buf, pos); + var val = readValue(this, tap2, resolver); + if (!tap2.isValid()) { + return { value: void 0, offset: -1 }; + } + return { value: val, offset: tap2.pos }; + }; + Type3.prototype.encode = function(val, buf, pos) { + var tap2 = new Tap(buf, pos); + this._write(tap2, val); + if (!tap2.isValid()) { + return buf.length - tap2.pos; + } + return tap2.pos; + }; + Type3.prototype.equals = function(type3, opts) { + var canon = ( + // Canonical equality. + Type3.isType(type3) && this.fingerprint().equals(type3.fingerprint()) + ); + if (!canon || !(opts && opts.strict)) { + return canon; + } + return JSON.stringify(this.schema({ exportAttrs: true })) === JSON.stringify(type3.schema({ exportAttrs: true })); + }; + Type3.prototype.fingerprint = function(algorithm) { + if (!algorithm) { + if (!this._hash.str) { + var schemaStr = JSON.stringify(this.schema()); + this._hash.str = utils.getHash(schemaStr).toString("binary"); + } + return utils.bufferFrom(this._hash.str, "binary"); + } else { + return utils.getHash(JSON.stringify(this.schema()), algorithm); + } + }; + Type3.prototype.fromBuffer = function(buf, resolver, noCheck) { + var tap2 = new Tap(buf); + var val = readValue(this, tap2, resolver, noCheck); + if (!tap2.isValid()) { + throw new Error("truncated buffer"); + } + if (!noCheck && tap2.pos < buf.length) { + throw new Error("trailing data"); + } + return val; + }; + Type3.prototype.fromString = function(str2) { + return this._copy(JSON.parse(str2), { coerce: 2 }); + }; + Type3.prototype.inspect = function() { + var typeName = this.typeName; + var className = getClassName(typeName); + if (isPrimitive2(typeName)) { + return f8("<%s>", className); + } else { + var obj = this.schema({ exportAttrs: true, noDeref: true }); + if (typeof obj == "object" && !Type3.isType(this, "logical")) { + obj.type = void 0; + } + return f8("<%s %j>", className, obj); + } + }; + Type3.prototype.isValid = function(val, opts) { + var flags = (opts && opts.noUndeclaredFields) | 0; + var errorHook = opts && opts.errorHook; + var hook, path2; + if (errorHook) { + path2 = []; + hook = function(any, type3) { + errorHook.call(this, path2.slice(), any, type3, val); + }; + } + return this._check(val, flags, hook, path2); + }; + Type3.prototype.random = utils.abstractFunction; + Type3.prototype.schema = function(opts) { + return this._attrs({ + exportAttrs: !!(opts && opts.exportAttrs), + noDeref: !!(opts && opts.noDeref) + }); + }; + Type3.prototype.toBuffer = function(val) { + TAP.pos = 0; + this._write(TAP, val); + var buf = utils.newBuffer(TAP.pos); + if (TAP.isValid()) { + TAP.buf.copy(buf, 0, 0, TAP.pos); + } else { + this._write(new Tap(buf), val); + } + return buf; + }; + Type3.prototype.toJSON = function() { + return this.schema({ exportAttrs: true }); + }; + Type3.prototype.toString = function(val) { + if (val === void 0) { + return JSON.stringify(this.schema({ noDeref: true })); + } + return JSON.stringify(this._copy(val, { coerce: 3 })); + }; + Type3.prototype.wrap = function(val) { + var Branch = this._branchConstructor; + return Branch === null ? null : new Branch(val); + }; + Type3.prototype._attrs = function(opts) { + opts.derefed = opts.derefed || {}; + var name2 = this.name; + if (name2 !== void 0) { + if (opts.noDeref || opts.derefed[name2]) { + return name2; + } + opts.derefed[name2] = true; + } + var schema8 = {}; + if (this.name !== void 0) { + schema8.name = name2; + } + schema8.type = this.typeName; + var derefedSchema = this._deref(schema8, opts); + if (derefedSchema !== void 0) { + schema8 = derefedSchema; + } + if (opts.exportAttrs) { + if (this.aliases && this.aliases.length) { + schema8.aliases = this.aliases; + } + if (this.doc !== void 0) { + schema8.doc = this.doc; + } + } + return schema8; + }; + Type3.prototype._createBranchConstructor = function() { + var name2 = this.branchName; + if (name2 === "null") { + return null; + } + var attr = ~name2.indexOf(".") ? "this['" + name2 + "']" : "this." + name2; + var body = "return function Branch$(val) { " + attr + " = val; };"; + var Branch = new Function(body)(); + Branch.type = this; + Branch.prototype.unwrap = new Function("return " + attr + ";"); + Branch.prototype.unwrapped = Branch.prototype.unwrap; + return Branch; + }; + Type3.prototype._peek = function(tap2) { + var pos = tap2.pos; + var val = this._read(tap2); + tap2.pos = pos; + return val; + }; + Type3.prototype._check = utils.abstractFunction; + Type3.prototype._copy = utils.abstractFunction; + Type3.prototype._deref = utils.abstractFunction; + Type3.prototype._match = utils.abstractFunction; + Type3.prototype._read = utils.abstractFunction; + Type3.prototype._skip = utils.abstractFunction; + Type3.prototype._update = utils.abstractFunction; + Type3.prototype._write = utils.abstractFunction; + Type3.prototype.getAliases = function() { + return this.aliases; + }; + Type3.prototype.getFingerprint = Type3.prototype.fingerprint; + Type3.prototype.getName = function(asBranch) { + return this.name || !asBranch ? this.name : this.branchName; + }; + Type3.prototype.getSchema = Type3.prototype.schema; + Type3.prototype.getTypeName = function() { + return this.typeName; + }; + function PrimitiveType(noFreeze) { + Type3.call(this); + this._branchConstructor = this._createBranchConstructor(); + if (!noFreeze) { + Object.freeze(this); + } + } + util2.inherits(PrimitiveType, Type3); + PrimitiveType.prototype._update = function(resolver, type3) { + if (type3.typeName === this.typeName) { + resolver._read = this._read; + } + }; + PrimitiveType.prototype._copy = function(val) { + this._check(val, void 0, throwInvalidError); + return val; + }; + PrimitiveType.prototype._deref = function() { + return this.typeName; + }; + PrimitiveType.prototype.compare = utils.compare; + function NullType() { + PrimitiveType.call(this); + } + util2.inherits(NullType, PrimitiveType); + NullType.prototype._check = function(val, flags, hook) { + var b8 = val === null; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + NullType.prototype._read = function() { + return null; + }; + NullType.prototype._skip = function() { + }; + NullType.prototype._write = function(tap2, val) { + if (val !== null) { + throwInvalidError(val, this); + } + }; + NullType.prototype._match = function() { + return 0; + }; + NullType.prototype.compare = NullType.prototype._match; + NullType.prototype.typeName = "null"; + NullType.prototype.random = NullType.prototype._read; + function BooleanType() { + PrimitiveType.call(this); + } + util2.inherits(BooleanType, PrimitiveType); + BooleanType.prototype._check = function(val, flags, hook) { + var b8 = typeof val == "boolean"; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + BooleanType.prototype._read = function(tap2) { + return tap2.readBoolean(); + }; + BooleanType.prototype._skip = function(tap2) { + tap2.skipBoolean(); + }; + BooleanType.prototype._write = function(tap2, val) { + if (typeof val != "boolean") { + throwInvalidError(val, this); + } + tap2.writeBoolean(val); + }; + BooleanType.prototype._match = function(tap1, tap2) { + return tap1.matchBoolean(tap2); + }; + BooleanType.prototype.typeName = "boolean"; + BooleanType.prototype.random = function() { + return RANDOM.nextBoolean(); + }; + function IntType() { + PrimitiveType.call(this); + } + util2.inherits(IntType, PrimitiveType); + IntType.prototype._check = function(val, flags, hook) { + var b8 = val === (val | 0); + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + IntType.prototype._read = function(tap2) { + return tap2.readInt(); + }; + IntType.prototype._skip = function(tap2) { + tap2.skipInt(); + }; + IntType.prototype._write = function(tap2, val) { + if (val !== (val | 0)) { + throwInvalidError(val, this); + } + tap2.writeInt(val); + }; + IntType.prototype._match = function(tap1, tap2) { + return tap1.matchInt(tap2); + }; + IntType.prototype.typeName = "int"; + IntType.prototype.random = function() { + return RANDOM.nextInt(1e3) | 0; + }; + function LongType() { + PrimitiveType.call(this); + } + util2.inherits(LongType, PrimitiveType); + LongType.prototype._check = function(val, flags, hook) { + var b8 = typeof val == "number" && val % 1 === 0 && isSafeLong(val); + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + LongType.prototype._read = function(tap2) { + var n7 = tap2.readLong(); + if (!isSafeLong(n7)) { + throw new Error("potential precision loss"); + } + return n7; + }; + LongType.prototype._skip = function(tap2) { + tap2.skipLong(); + }; + LongType.prototype._write = function(tap2, val) { + if (typeof val != "number" || val % 1 || !isSafeLong(val)) { + throwInvalidError(val, this); + } + tap2.writeLong(val); + }; + LongType.prototype._match = function(tap1, tap2) { + return tap1.matchLong(tap2); + }; + LongType.prototype._update = function(resolver, type3) { + switch (type3.typeName) { + case "int": + resolver._read = type3._read; + break; + case "abstract:long": + case "long": + resolver._read = this._read; + } + }; + LongType.prototype.typeName = "long"; + LongType.prototype.random = function() { + return RANDOM.nextInt(); + }; + LongType.__with = function(methods, noUnpack) { + methods = methods || {}; + var mapping = { + toBuffer: "_toBuffer", + fromBuffer: "_fromBuffer", + fromJSON: "_fromJSON", + toJSON: "_toJSON", + isValid: "_isValid", + compare: "compare" + }; + var type3 = new AbstractLongType(noUnpack); + Object.keys(mapping).forEach(function(name2) { + if (methods[name2] === void 0) { + throw new Error(f8("missing method implementation: %s", name2)); + } + type3[mapping[name2]] = methods[name2]; + }); + return Object.freeze(type3); + }; + function FloatType() { + PrimitiveType.call(this); + } + util2.inherits(FloatType, PrimitiveType); + FloatType.prototype._check = function(val, flags, hook) { + var b8 = typeof val == "number"; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + FloatType.prototype._read = function(tap2) { + return tap2.readFloat(); + }; + FloatType.prototype._skip = function(tap2) { + tap2.skipFloat(); + }; + FloatType.prototype._write = function(tap2, val) { + if (typeof val != "number") { + throwInvalidError(val, this); + } + tap2.writeFloat(val); + }; + FloatType.prototype._match = function(tap1, tap2) { + return tap1.matchFloat(tap2); + }; + FloatType.prototype._update = function(resolver, type3) { + switch (type3.typeName) { + case "float": + case "int": + resolver._read = type3._read; + break; + case "abstract:long": + case "long": + resolver._read = function(tap2) { + return tap2.readLong(); + }; + } + }; + FloatType.prototype.typeName = "float"; + FloatType.prototype.random = function() { + return RANDOM.nextFloat(1e3); + }; + function DoubleType() { + PrimitiveType.call(this); + } + util2.inherits(DoubleType, PrimitiveType); + DoubleType.prototype._check = function(val, flags, hook) { + var b8 = typeof val == "number"; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + DoubleType.prototype._read = function(tap2) { + return tap2.readDouble(); + }; + DoubleType.prototype._skip = function(tap2) { + tap2.skipDouble(); + }; + DoubleType.prototype._write = function(tap2, val) { + if (typeof val != "number") { + throwInvalidError(val, this); + } + tap2.writeDouble(val); + }; + DoubleType.prototype._match = function(tap1, tap2) { + return tap1.matchDouble(tap2); + }; + DoubleType.prototype._update = function(resolver, type3) { + switch (type3.typeName) { + case "double": + case "float": + case "int": + resolver._read = type3._read; + break; + case "abstract:long": + case "long": + resolver._read = function(tap2) { + return tap2.readLong(); + }; + } + }; + DoubleType.prototype.typeName = "double"; + DoubleType.prototype.random = function() { + return RANDOM.nextFloat(); + }; + function StringType() { + PrimitiveType.call(this); + } + util2.inherits(StringType, PrimitiveType); + StringType.prototype._check = function(val, flags, hook) { + var b8 = typeof val == "string"; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + StringType.prototype._read = function(tap2) { + return tap2.readString(); + }; + StringType.prototype._skip = function(tap2) { + tap2.skipString(); + }; + StringType.prototype._write = function(tap2, val) { + if (typeof val != "string") { + throwInvalidError(val, this); + } + tap2.writeString(val); + }; + StringType.prototype._match = function(tap1, tap2) { + return tap1.matchString(tap2); + }; + StringType.prototype._update = function(resolver, type3) { + switch (type3.typeName) { + case "bytes": + case "string": + resolver._read = this._read; + } + }; + StringType.prototype.typeName = "string"; + StringType.prototype.random = function() { + return RANDOM.nextString(RANDOM.nextInt(32)); + }; + function BytesType() { + PrimitiveType.call(this); + } + util2.inherits(BytesType, PrimitiveType); + BytesType.prototype._check = function(val, flags, hook) { + var b8 = Buffer4.isBuffer(val); + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + BytesType.prototype._read = function(tap2) { + return tap2.readBytes(); + }; + BytesType.prototype._skip = function(tap2) { + tap2.skipBytes(); + }; + BytesType.prototype._write = function(tap2, val) { + if (!Buffer4.isBuffer(val)) { + throwInvalidError(val, this); + } + tap2.writeBytes(val); + }; + BytesType.prototype._match = function(tap1, tap2) { + return tap1.matchBytes(tap2); + }; + BytesType.prototype._update = StringType.prototype._update; + BytesType.prototype._copy = function(obj, opts) { + var buf; + switch ((opts && opts.coerce) | 0) { + case 3: + this._check(obj, void 0, throwInvalidError); + return obj.toString("binary"); + case 2: + if (typeof obj != "string") { + throw new Error(f8("cannot coerce to buffer: %j", obj)); + } + buf = utils.bufferFrom(obj, "binary"); + this._check(buf, void 0, throwInvalidError); + return buf; + case 1: + if (!isJsonBuffer(obj)) { + throw new Error(f8("cannot coerce to buffer: %j", obj)); + } + buf = utils.bufferFrom(obj.data); + this._check(buf, void 0, throwInvalidError); + return buf; + default: + this._check(obj, void 0, throwInvalidError); + return utils.bufferFrom(obj); + } + }; + BytesType.prototype.compare = Buffer4.compare; + BytesType.prototype.typeName = "bytes"; + BytesType.prototype.random = function() { + return RANDOM.nextBuffer(RANDOM.nextInt(32)); + }; + function UnionType(schema8, opts) { + Type3.call(this); + if (!Array.isArray(schema8)) { + throw new Error(f8("non-array union schema: %j", schema8)); + } + if (!schema8.length) { + throw new Error("empty union"); + } + this.types = Object.freeze(schema8.map(function(obj) { + return Type3.forSchema(obj, opts); + })); + this._branchIndices = {}; + this.types.forEach(function(type3, i7) { + if (Type3.isType(type3, "union")) { + throw new Error("unions cannot be directly nested"); + } + var branch = type3.branchName; + if (this._branchIndices[branch] !== void 0) { + throw new Error(f8("duplicate union branch name: %j", branch)); + } + this._branchIndices[branch] = i7; + }, this); + } + util2.inherits(UnionType, Type3); + UnionType.prototype._branchConstructor = function() { + throw new Error("unions cannot be directly wrapped"); + }; + UnionType.prototype._skip = function(tap2) { + this.types[tap2.readLong()]._skip(tap2); + }; + UnionType.prototype._match = function(tap1, tap2) { + var n1 = tap1.readLong(); + var n22 = tap2.readLong(); + if (n1 === n22) { + return this.types[n1]._match(tap1, tap2); + } else { + return n1 < n22 ? -1 : 1; + } + }; + UnionType.prototype._deref = function(schema8, opts) { + return this.types.map(function(t8) { + return t8._attrs(opts); + }); + }; + UnionType.prototype.getTypes = function() { + return this.types; + }; + function UnwrappedUnionType(schema8, opts) { + UnionType.call(this, schema8, opts); + this._dynamicBranches = null; + this._bucketIndices = {}; + this.types.forEach(function(type3, index4) { + if (Type3.isType(type3, "abstract", "logical")) { + if (!this._dynamicBranches) { + this._dynamicBranches = []; + } + this._dynamicBranches.push({ index: index4, type: type3 }); + } else { + var bucket = getTypeBucket(type3); + if (this._bucketIndices[bucket] !== void 0) { + throw new Error(f8("ambiguous unwrapped union: %j", this)); + } + this._bucketIndices[bucket] = index4; + } + }, this); + Object.freeze(this); + } + util2.inherits(UnwrappedUnionType, UnionType); + UnwrappedUnionType.prototype._getIndex = function(val) { + var index4 = this._bucketIndices[getValueBucket(val)]; + if (this._dynamicBranches) { + index4 = this._getBranchIndex(val, index4); + } + return index4; + }; + UnwrappedUnionType.prototype._getBranchIndex = function(any, index4) { + var logicalBranches = this._dynamicBranches; + var i7, l7, branch; + for (i7 = 0, l7 = logicalBranches.length; i7 < l7; i7++) { + branch = logicalBranches[i7]; + if (branch.type._check(any)) { + if (index4 === void 0) { + index4 = branch.index; + } else { + throw new Error("ambiguous conversion"); + } + } + } + return index4; + }; + UnwrappedUnionType.prototype._check = function(val, flags, hook, path2) { + var index4 = this._getIndex(val); + var b8 = index4 !== void 0; + if (b8) { + return this.types[index4]._check(val, flags, hook, path2); + } + if (hook) { + hook(val, this); + } + return b8; + }; + UnwrappedUnionType.prototype._read = function(tap2) { + var index4 = tap2.readLong(); + var branchType = this.types[index4]; + if (branchType) { + return branchType._read(tap2); + } else { + throw new Error(f8("invalid union index: %s", index4)); + } + }; + UnwrappedUnionType.prototype._write = function(tap2, val) { + var index4 = this._getIndex(val); + if (index4 === void 0) { + throwInvalidError(val, this); + } + tap2.writeLong(index4); + if (val !== null) { + this.types[index4]._write(tap2, val); + } + }; + UnwrappedUnionType.prototype._update = function(resolver, type3, opts) { + var i7, l7, typeResolver; + for (i7 = 0, l7 = this.types.length; i7 < l7; i7++) { + try { + typeResolver = this.types[i7].createResolver(type3, opts); + } catch (err) { + continue; + } + resolver._read = function(tap2) { + return typeResolver._read(tap2); + }; + return; + } + }; + UnwrappedUnionType.prototype._copy = function(val, opts) { + var coerce2 = opts && opts.coerce | 0; + var wrap2 = opts && opts.wrap | 0; + var index4; + if (wrap2 === 2) { + index4 = 0; + } else { + switch (coerce2) { + case 1: + if (isJsonBuffer(val) && this._bucketIndices.buffer !== void 0) { + index4 = this._bucketIndices.buffer; + } else { + index4 = this._getIndex(val); + } + break; + case 2: + if (val === null) { + index4 = this._bucketIndices["null"]; + } else if (typeof val === "object") { + var keys2 = Object.keys(val); + if (keys2.length === 1) { + index4 = this._branchIndices[keys2[0]]; + val = val[keys2[0]]; + } + } + break; + default: + index4 = this._getIndex(val); + } + if (index4 === void 0) { + throwInvalidError(val, this); + } + } + var type3 = this.types[index4]; + if (val === null || wrap2 === 3) { + return type3._copy(val, opts); + } else { + switch (coerce2) { + case 3: + var obj = {}; + obj[type3.branchName] = type3._copy(val, opts); + return obj; + default: + return type3._copy(val, opts); + } + } + }; + UnwrappedUnionType.prototype.compare = function(val1, val2) { + var index1 = this._getIndex(val1); + var index22 = this._getIndex(val2); + if (index1 === void 0) { + throwInvalidError(val1, this); + } else if (index22 === void 0) { + throwInvalidError(val2, this); + } else if (index1 === index22) { + return this.types[index1].compare(val1, val2); + } else { + return utils.compare(index1, index22); + } + }; + UnwrappedUnionType.prototype.typeName = "union:unwrapped"; + UnwrappedUnionType.prototype.random = function() { + var index4 = RANDOM.nextInt(this.types.length); + return this.types[index4].random(); + }; + function WrappedUnionType(schema8, opts) { + UnionType.call(this, schema8, opts); + Object.freeze(this); + } + util2.inherits(WrappedUnionType, UnionType); + WrappedUnionType.prototype._check = function(val, flags, hook, path2) { + var b8 = false; + if (val === null) { + b8 = this._branchIndices["null"] !== void 0; + } else if (typeof val == "object") { + var keys2 = Object.keys(val); + if (keys2.length === 1) { + var name2 = keys2[0]; + var index4 = this._branchIndices[name2]; + if (index4 !== void 0) { + if (hook) { + path2.push(name2); + b8 = this.types[index4]._check(val[name2], flags, hook, path2); + path2.pop(); + return b8; + } else { + return this.types[index4]._check(val[name2], flags); + } + } + } + } + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + WrappedUnionType.prototype._read = function(tap2) { + var type3 = this.types[tap2.readLong()]; + if (!type3) { + throw new Error(f8("invalid union index")); + } + var Branch = type3._branchConstructor; + if (Branch === null) { + return null; + } else { + return new Branch(type3._read(tap2)); + } + }; + WrappedUnionType.prototype._write = function(tap2, val) { + var index4, keys2, name2; + if (val === null) { + index4 = this._branchIndices["null"]; + if (index4 === void 0) { + throwInvalidError(val, this); + } + tap2.writeLong(index4); + } else { + keys2 = Object.keys(val); + if (keys2.length === 1) { + name2 = keys2[0]; + index4 = this._branchIndices[name2]; + } + if (index4 === void 0) { + throwInvalidError(val, this); + } + tap2.writeLong(index4); + this.types[index4]._write(tap2, val[name2]); + } + }; + WrappedUnionType.prototype._update = function(resolver, type3, opts) { + var i7, l7, typeResolver, Branch; + for (i7 = 0, l7 = this.types.length; i7 < l7; i7++) { + try { + typeResolver = this.types[i7].createResolver(type3, opts); + } catch (err) { + continue; + } + Branch = this.types[i7]._branchConstructor; + if (Branch) { + resolver._read = function(tap2) { + return new Branch(typeResolver._read(tap2)); + }; + } else { + resolver._read = function() { + return null; + }; + } + return; + } + }; + WrappedUnionType.prototype._copy = function(val, opts) { + var wrap2 = opts && opts.wrap | 0; + if (wrap2 === 2) { + var firstType = this.types[0]; + if (val === null && firstType.typeName === "null") { + return null; + } + return new firstType._branchConstructor(firstType._copy(val, opts)); + } + if (val === null && this._branchIndices["null"] !== void 0) { + return null; + } + var i7, l7, obj; + if (typeof val == "object") { + var keys2 = Object.keys(val); + if (keys2.length === 1) { + var name2 = keys2[0]; + i7 = this._branchIndices[name2]; + if (i7 === void 0 && opts.qualifyNames) { + var j6, type3; + for (j6 = 0, l7 = this.types.length; j6 < l7; j6++) { + type3 = this.types[j6]; + if (type3.name && name2 === utils.unqualify(type3.name)) { + i7 = j6; + break; + } + } + } + if (i7 !== void 0) { + obj = this.types[i7]._copy(val[name2], opts); + } + } + } + if (wrap2 === 1 && obj === void 0) { + i7 = 0; + l7 = this.types.length; + while (i7 < l7 && obj === void 0) { + try { + obj = this.types[i7]._copy(val, opts); + } catch (err) { + i7++; + } + } + } + if (obj !== void 0) { + return wrap2 === 3 ? obj : new this.types[i7]._branchConstructor(obj); + } + throwInvalidError(val, this); + }; + WrappedUnionType.prototype.compare = function(val1, val2) { + var name1 = val1 === null ? "null" : Object.keys(val1)[0]; + var name2 = val2 === null ? "null" : Object.keys(val2)[0]; + var index4 = this._branchIndices[name1]; + if (name1 === name2) { + return name1 === "null" ? 0 : this.types[index4].compare(val1[name1], val2[name1]); + } else { + return utils.compare(index4, this._branchIndices[name2]); + } + }; + WrappedUnionType.prototype.typeName = "union:wrapped"; + WrappedUnionType.prototype.random = function() { + var index4 = RANDOM.nextInt(this.types.length); + var type3 = this.types[index4]; + var Branch = type3._branchConstructor; + if (!Branch) { + return null; + } + return new Branch(type3.random()); + }; + function EnumType(schema8, opts) { + Type3.call(this, schema8, opts); + if (!Array.isArray(schema8.symbols) || !schema8.symbols.length) { + throw new Error(f8("invalid enum symbols: %j", schema8.symbols)); + } + this.symbols = Object.freeze(schema8.symbols.slice()); + this._indices = {}; + this.symbols.forEach(function(symbol, i7) { + if (!utils.isValidName(symbol)) { + throw new Error(f8("invalid %s symbol: %j", this, symbol)); + } + if (this._indices[symbol] !== void 0) { + throw new Error(f8("duplicate %s symbol: %j", this, symbol)); + } + this._indices[symbol] = i7; + }, this); + this.default = schema8.default; + if (this.default !== void 0 && this._indices[this.default] === void 0) { + throw new Error(f8("invalid %s default: %j", this, this.default)); + } + this._branchConstructor = this._createBranchConstructor(); + Object.freeze(this); + } + util2.inherits(EnumType, Type3); + EnumType.prototype._check = function(val, flags, hook) { + var b8 = this._indices[val] !== void 0; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + EnumType.prototype._read = function(tap2) { + var index4 = tap2.readLong(); + var symbol = this.symbols[index4]; + if (symbol === void 0) { + throw new Error(f8("invalid %s enum index: %s", this.name, index4)); + } + return symbol; + }; + EnumType.prototype._skip = function(tap2) { + tap2.skipLong(); + }; + EnumType.prototype._write = function(tap2, val) { + var index4 = this._indices[val]; + if (index4 === void 0) { + throwInvalidError(val, this); + } + tap2.writeLong(index4); + }; + EnumType.prototype._match = function(tap1, tap2) { + return tap1.matchLong(tap2); + }; + EnumType.prototype.compare = function(val1, val2) { + return utils.compare(this._indices[val1], this._indices[val2]); + }; + EnumType.prototype._update = function(resolver, type3, opts) { + var symbols = this.symbols; + if (type3.typeName === "enum" && hasCompatibleName(this, type3, !opts.ignoreNamespaces) && (type3.symbols.every(function(s7) { + return ~symbols.indexOf(s7); + }) || this.default !== void 0)) { + resolver.symbols = type3.symbols.map(function(s7) { + return this._indices[s7] === void 0 ? this.default : s7; + }, this); + resolver._read = type3._read; + } + }; + EnumType.prototype._copy = function(val) { + this._check(val, void 0, throwInvalidError); + return val; + }; + EnumType.prototype._deref = function(schema8) { + schema8.symbols = this.symbols; + }; + EnumType.prototype.getSymbols = function() { + return this.symbols; + }; + EnumType.prototype.typeName = "enum"; + EnumType.prototype.random = function() { + return RANDOM.choice(this.symbols); + }; + function FixedType(schema8, opts) { + Type3.call(this, schema8, opts); + if (schema8.size !== (schema8.size | 0) || schema8.size < 0) { + throw new Error(f8("invalid %s size", this.branchName)); + } + this.size = schema8.size | 0; + this._branchConstructor = this._createBranchConstructor(); + Object.freeze(this); + } + util2.inherits(FixedType, Type3); + FixedType.prototype._check = function(val, flags, hook) { + var b8 = Buffer4.isBuffer(val) && val.length === this.size; + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + FixedType.prototype._read = function(tap2) { + return tap2.readFixed(this.size); + }; + FixedType.prototype._skip = function(tap2) { + tap2.skipFixed(this.size); + }; + FixedType.prototype._write = function(tap2, val) { + if (!Buffer4.isBuffer(val) || val.length !== this.size) { + throwInvalidError(val, this); + } + tap2.writeFixed(val, this.size); + }; + FixedType.prototype._match = function(tap1, tap2) { + return tap1.matchFixed(tap2, this.size); + }; + FixedType.prototype.compare = Buffer4.compare; + FixedType.prototype._update = function(resolver, type3, opts) { + if (type3.typeName === "fixed" && this.size === type3.size && hasCompatibleName(this, type3, !opts.ignoreNamespaces)) { + resolver.size = this.size; + resolver._read = this._read; + } + }; + FixedType.prototype._copy = BytesType.prototype._copy; + FixedType.prototype._deref = function(schema8) { + schema8.size = this.size; + }; + FixedType.prototype.getSize = function() { + return this.size; + }; + FixedType.prototype.typeName = "fixed"; + FixedType.prototype.random = function() { + return RANDOM.nextBuffer(this.size); + }; + function MapType(schema8, opts) { + Type3.call(this); + if (!schema8.values) { + throw new Error(f8("missing map values: %j", schema8)); + } + this.valuesType = Type3.forSchema(schema8.values, opts); + this._branchConstructor = this._createBranchConstructor(); + Object.freeze(this); + } + util2.inherits(MapType, Type3); + MapType.prototype._check = function(val, flags, hook, path2) { + if (!val || typeof val != "object" || Array.isArray(val)) { + if (hook) { + hook(val, this); + } + return false; + } + var keys2 = Object.keys(val); + var b8 = true; + var i7, l7, j6, key; + if (hook) { + j6 = path2.length; + path2.push(""); + for (i7 = 0, l7 = keys2.length; i7 < l7; i7++) { + key = path2[j6] = keys2[i7]; + if (!this.valuesType._check(val[key], flags, hook, path2)) { + b8 = false; + } + } + path2.pop(); + } else { + for (i7 = 0, l7 = keys2.length; i7 < l7; i7++) { + if (!this.valuesType._check(val[keys2[i7]], flags)) { + return false; + } + } + } + return b8; + }; + MapType.prototype._read = function(tap2) { + var values2 = this.valuesType; + var val = {}; + var n7; + while (n7 = readArraySize(tap2)) { + while (n7--) { + var key = tap2.readString(); + val[key] = values2._read(tap2); + } + } + return val; + }; + MapType.prototype._skip = function(tap2) { + var values2 = this.valuesType; + var len, n7; + while (n7 = tap2.readLong()) { + if (n7 < 0) { + len = tap2.readLong(); + tap2.pos += len; + } else { + while (n7--) { + tap2.skipString(); + values2._skip(tap2); + } + } + } + }; + MapType.prototype._write = function(tap2, val) { + if (!val || typeof val != "object" || Array.isArray(val)) { + throwInvalidError(val, this); + } + var values2 = this.valuesType; + var keys2 = Object.keys(val); + var n7 = keys2.length; + var i7, key; + if (n7) { + tap2.writeLong(n7); + for (i7 = 0; i7 < n7; i7++) { + key = keys2[i7]; + tap2.writeString(key); + values2._write(tap2, val[key]); + } + } + tap2.writeLong(0); + }; + MapType.prototype._match = function() { + throw new Error("maps cannot be compared"); + }; + MapType.prototype._update = function(rsv, type3, opts) { + if (type3.typeName === "map") { + rsv.valuesType = this.valuesType.createResolver(type3.valuesType, opts); + rsv._read = this._read; + } + }; + MapType.prototype._copy = function(val, opts) { + if (val && typeof val == "object" && !Array.isArray(val)) { + var values2 = this.valuesType; + var keys2 = Object.keys(val); + var i7, l7, key; + var copy4 = {}; + for (i7 = 0, l7 = keys2.length; i7 < l7; i7++) { + key = keys2[i7]; + copy4[key] = values2._copy(val[key], opts); + } + return copy4; + } + throwInvalidError(val, this); + }; + MapType.prototype.compare = MapType.prototype._match; + MapType.prototype.typeName = "map"; + MapType.prototype.getValuesType = function() { + return this.valuesType; + }; + MapType.prototype.random = function() { + var val = {}; + var i7, l7; + for (i7 = 0, l7 = RANDOM.nextInt(10); i7 < l7; i7++) { + val[RANDOM.nextString(RANDOM.nextInt(20))] = this.valuesType.random(); + } + return val; + }; + MapType.prototype._deref = function(schema8, opts) { + schema8.values = this.valuesType._attrs(opts); + }; + function ArrayType(schema8, opts) { + Type3.call(this); + if (!schema8.items) { + throw new Error(f8("missing array items: %j", schema8)); + } + this.itemsType = Type3.forSchema(schema8.items, opts); + this._branchConstructor = this._createBranchConstructor(); + Object.freeze(this); + } + util2.inherits(ArrayType, Type3); + ArrayType.prototype._check = function(val, flags, hook, path2) { + if (!Array.isArray(val)) { + if (hook) { + hook(val, this); + } + return false; + } + var items = this.itemsType; + var b8 = true; + var i7, l7, j6; + if (hook) { + j6 = path2.length; + path2.push(""); + for (i7 = 0, l7 = val.length; i7 < l7; i7++) { + path2[j6] = "" + i7; + if (!items._check(val[i7], flags, hook, path2)) { + b8 = false; + } + } + path2.pop(); + } else { + for (i7 = 0, l7 = val.length; i7 < l7; i7++) { + if (!items._check(val[i7], flags)) { + return false; + } + } + } + return b8; + }; + ArrayType.prototype._read = function(tap2) { + var items = this.itemsType; + var i7 = 0; + var val, n7; + while (n7 = tap2.readLong()) { + if (n7 < 0) { + n7 = -n7; + tap2.skipLong(); + } + val = val || new Array(n7); + while (n7--) { + val[i7++] = items._read(tap2); + } + } + return val || []; + }; + ArrayType.prototype._skip = function(tap2) { + var items = this.itemsType; + var len, n7; + while (n7 = tap2.readLong()) { + if (n7 < 0) { + len = tap2.readLong(); + tap2.pos += len; + } else { + while (n7--) { + items._skip(tap2); + } + } + } + }; + ArrayType.prototype._write = function(tap2, val) { + if (!Array.isArray(val)) { + throwInvalidError(val, this); + } + var items = this.itemsType; + var n7 = val.length; + var i7; + if (n7) { + tap2.writeLong(n7); + for (i7 = 0; i7 < n7; i7++) { + items._write(tap2, val[i7]); + } + } + tap2.writeLong(0); + }; + ArrayType.prototype._match = function(tap1, tap2) { + var n1 = tap1.readLong(); + var n22 = tap2.readLong(); + var f9; + while (n1 && n22) { + f9 = this.itemsType._match(tap1, tap2); + if (f9) { + return f9; + } + if (!--n1) { + n1 = readArraySize(tap1); + } + if (!--n22) { + n22 = readArraySize(tap2); + } + } + return utils.compare(n1, n22); + }; + ArrayType.prototype._update = function(resolver, type3, opts) { + if (type3.typeName === "array") { + resolver.itemsType = this.itemsType.createResolver(type3.itemsType, opts); + resolver._read = this._read; + } + }; + ArrayType.prototype._copy = function(val, opts) { + if (!Array.isArray(val)) { + throwInvalidError(val, this); + } + var items = new Array(val.length); + var i7, l7; + for (i7 = 0, l7 = val.length; i7 < l7; i7++) { + items[i7] = this.itemsType._copy(val[i7], opts); + } + return items; + }; + ArrayType.prototype._deref = function(schema8, opts) { + schema8.items = this.itemsType._attrs(opts); + }; + ArrayType.prototype.compare = function(val1, val2) { + var n1 = val1.length; + var n22 = val2.length; + var i7, l7, f9; + for (i7 = 0, l7 = Math.min(n1, n22); i7 < l7; i7++) { + if (f9 = this.itemsType.compare(val1[i7], val2[i7])) { + return f9; + } + } + return utils.compare(n1, n22); + }; + ArrayType.prototype.getItemsType = function() { + return this.itemsType; + }; + ArrayType.prototype.typeName = "array"; + ArrayType.prototype.random = function() { + var arr = []; + var i7, l7; + for (i7 = 0, l7 = RANDOM.nextInt(10); i7 < l7; i7++) { + arr.push(this.itemsType.random()); + } + return arr; + }; + function RecordType(schema8, opts) { + opts = opts || {}; + var namespace = opts.namespace; + if (schema8.namespace !== void 0) { + opts.namespace = schema8.namespace; + } else if (schema8.name) { + var ns = utils.impliedNamespace(schema8.name); + if (ns !== void 0) { + opts.namespace = ns; + } + } + Type3.call(this, schema8, opts); + if (!Array.isArray(schema8.fields)) { + throw new Error(f8("non-array record fields: %j", schema8.fields)); + } + if (utils.hasDuplicates(schema8.fields, function(f9) { + return f9.name; + })) { + throw new Error(f8("duplicate field name: %j", schema8.fields)); + } + this._fieldsByName = {}; + this.fields = Object.freeze(schema8.fields.map(function(f9) { + var field = new Field(f9, opts); + this._fieldsByName[field.name] = field; + return field; + }, this)); + this._branchConstructor = this._createBranchConstructor(); + this._isError = schema8.type === "error"; + this.recordConstructor = this._createConstructor( + opts.errorStackTraces, + opts.omitRecordMethods + ); + this._read = this._createReader(); + this._skip = this._createSkipper(); + this._write = this._createWriter(); + this._check = this._createChecker(); + opts.namespace = namespace; + Object.freeze(this); + } + util2.inherits(RecordType, Type3); + RecordType.prototype._getConstructorName = function() { + return this.name ? utils.capitalize(utils.unqualify(this.name)) : this._isError ? "Error$" : "Record$"; + }; + RecordType.prototype._createConstructor = function(errorStack, plainRecords) { + var outerArgs = []; + var innerArgs = []; + var ds = []; + var innerBody = ""; + var i7, l7, field, name2, defaultValue, hasDefault, stackField; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + field = this.fields[i7]; + defaultValue = field.defaultValue; + hasDefault = defaultValue() !== void 0; + name2 = field.name; + if (errorStack && this._isError && name2 === "stack" && Type3.isType(field.type, "string") && !hasDefault) { + stackField = field; + } + innerArgs.push("v" + i7); + innerBody += " "; + if (!hasDefault) { + innerBody += "this." + name2 + " = v" + i7 + ";\n"; + } else { + innerBody += "if (v" + i7 + " === undefined) { "; + innerBody += "this." + name2 + " = d" + ds.length + "(); "; + innerBody += "} else { this." + name2 + " = v" + i7 + "; }\n"; + outerArgs.push("d" + ds.length); + ds.push(defaultValue); + } + } + if (stackField) { + innerBody += " if (this.stack === undefined) { "; + if (typeof Error.captureStackTrace == "function") { + innerBody += "Error.captureStackTrace(this, this.constructor);"; + } else { + innerBody += "this.stack = Error().stack;"; + } + innerBody += " }\n"; + } + var outerBody = "return function " + this._getConstructorName() + "("; + outerBody += innerArgs.join() + ") {\n" + innerBody + "};"; + var Record = new Function(outerArgs.join(), outerBody).apply(void 0, ds); + if (plainRecords) { + return Record; + } + var self2 = this; + Record.getType = function() { + return self2; + }; + Record.type = self2; + if (this._isError) { + util2.inherits(Record, Error); + Record.prototype.name = this._getConstructorName(); + } + Record.prototype.clone = function(o7) { + return self2.clone(this, o7); + }; + Record.prototype.compare = function(v8) { + return self2.compare(this, v8); + }; + Record.prototype.isValid = function(o7) { + return self2.isValid(this, o7); + }; + Record.prototype.toBuffer = function() { + return self2.toBuffer(this); + }; + Record.prototype.toString = function() { + return self2.toString(this); + }; + Record.prototype.wrap = function() { + return self2.wrap(this); + }; + Record.prototype.wrapped = Record.prototype.wrap; + return Record; + }; + RecordType.prototype._createChecker = function() { + var names = []; + var values2 = []; + var name2 = this._getConstructorName(); + var body = "return function check" + name2 + "(v, f, h, p) {\n"; + body += " if (\n"; + body += " v === null ||\n"; + body += " typeof v != 'object' ||\n"; + body += " (f && !this._checkFields(v))\n"; + body += " ) {\n"; + body += " if (h) { h(v, this); }\n"; + body += " return false;\n"; + body += " }\n"; + if (!this.fields.length) { + body += " return true;\n"; + } else { + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + field = this.fields[i7]; + names.push("t" + i7); + values2.push(field.type); + if (field.defaultValue() !== void 0) { + body += " var v" + i7 + " = v." + field.name + ";\n"; + } + } + body += " if (h) {\n"; + body += " var b = 1;\n"; + body += " var j = p.length;\n"; + body += " p.push('');\n"; + var i7, l7, field; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + field = this.fields[i7]; + body += " p[j] = '" + field.name + "';\n"; + body += " b &= "; + if (field.defaultValue() === void 0) { + body += "t" + i7 + "._check(v." + field.name + ", f, h, p);\n"; + } else { + body += "v" + i7 + " === undefined || "; + body += "t" + i7 + "._check(v" + i7 + ", f, h, p);\n"; + } + } + body += " p.pop();\n"; + body += " return !!b;\n"; + body += " } else {\n return (\n "; + body += this.fields.map(function(field2, i8) { + return field2.defaultValue() === void 0 ? "t" + i8 + "._check(v." + field2.name + ", f)" : "(v" + i8 + " === undefined || t" + i8 + "._check(v" + i8 + ", f))"; + }).join(" &&\n "); + body += "\n );\n }\n"; + } + body += "};"; + return new Function(names.join(), body).apply(void 0, values2); + }; + RecordType.prototype._createReader = function() { + var names = []; + var values2 = [this.recordConstructor]; + var i7, l7; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + names.push("t" + i7); + values2.push(this.fields[i7].type); + } + var name2 = this._getConstructorName(); + var body = "return function read" + name2 + "(t) {\n"; + body += " return new " + name2 + "(\n "; + body += names.map(function(s7) { + return s7 + "._read(t)"; + }).join(",\n "); + body += "\n );\n};"; + names.unshift(name2); + return new Function(names.join(), body).apply(void 0, values2); + }; + RecordType.prototype._createSkipper = function() { + var args = []; + var body = "return function skip" + this._getConstructorName() + "(t) {\n"; + var values2 = []; + var i7, l7; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + args.push("t" + i7); + values2.push(this.fields[i7].type); + body += " t" + i7 + "._skip(t);\n"; + } + body += "}"; + return new Function(args.join(), body).apply(void 0, values2); + }; + RecordType.prototype._createWriter = function() { + var args = []; + var name2 = this._getConstructorName(); + var body = "return function write" + name2 + "(t, v) {\n"; + var values2 = []; + var i7, l7, field, value2; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + field = this.fields[i7]; + args.push("t" + i7); + values2.push(field.type); + body += " "; + if (field.defaultValue() === void 0) { + body += "t" + i7 + "._write(t, v." + field.name + ");\n"; + } else { + value2 = field.type.toBuffer(field.defaultValue()).toString("binary"); + args.push("d" + i7); + values2.push(value2); + body += "var v" + i7 + " = v." + field.name + ";\n"; + body += "if (v" + i7 + " === undefined) {\n"; + body += " t.writeBinary(d" + i7 + ", " + value2.length + ");\n"; + body += " } else {\n t" + i7 + "._write(t, v" + i7 + ");\n }\n"; + } + } + body += "}"; + return new Function(args.join(), body).apply(void 0, values2); + }; + RecordType.prototype._update = function(resolver, type3, opts) { + if (!hasCompatibleName(this, type3, !opts.ignoreNamespaces)) { + throw new Error(f8("no alias found for %s", type3.name)); + } + var rFields = this.fields; + var wFields = type3.fields; + var wFieldsMap = utils.toMap(wFields, function(f9) { + return f9.name; + }); + var innerArgs = []; + var resolvers = {}; + var i7, j6, field, name2, names, matches2, fieldResolver; + for (i7 = 0; i7 < rFields.length; i7++) { + field = rFields[i7]; + names = getAliases(field); + matches2 = []; + for (j6 = 0; j6 < names.length; j6++) { + name2 = names[j6]; + if (wFieldsMap[name2]) { + matches2.push(name2); + } + } + if (matches2.length > 1) { + throw new Error( + f8("ambiguous aliasing for %s.%s (%s)", type3.name, field.name, matches2) + ); + } + if (!matches2.length) { + if (field.defaultValue() === void 0) { + throw new Error( + f8("no matching field for default-less %s.%s", type3.name, field.name) + ); + } + innerArgs.push("undefined"); + } else { + name2 = matches2[0]; + fieldResolver = { + resolver: field.type.createResolver(wFieldsMap[name2].type, opts), + name: "_" + field.name + // Reader field name. + }; + if (!resolvers[name2]) { + resolvers[name2] = [fieldResolver]; + } else { + resolvers[name2].push(fieldResolver); + } + innerArgs.push(fieldResolver.name); + } + } + var lazyIndex = -1; + i7 = wFields.length; + while (i7 && resolvers[wFields[--i7].name] === void 0) { + lazyIndex = i7; + } + var uname = this._getConstructorName(); + var args = [uname]; + var values2 = [this.recordConstructor]; + var body = " return function read" + uname + "(t, b) {\n"; + for (i7 = 0; i7 < wFields.length; i7++) { + if (i7 === lazyIndex) { + body += " if (!b) {\n"; + } + field = type3.fields[i7]; + name2 = field.name; + if (resolvers[name2] === void 0) { + body += ~lazyIndex && i7 >= lazyIndex ? " " : " "; + args.push("r" + i7); + values2.push(field.type); + body += "r" + i7 + "._skip(t);\n"; + } else { + j6 = resolvers[name2].length; + while (j6--) { + body += ~lazyIndex && i7 >= lazyIndex ? " " : " "; + args.push("r" + i7 + "f" + j6); + fieldResolver = resolvers[name2][j6]; + values2.push(fieldResolver.resolver); + body += "var " + fieldResolver.name + " = "; + body += "r" + i7 + "f" + j6 + "._" + (j6 ? "peek" : "read") + "(t);\n"; + } + } + } + if (~lazyIndex) { + body += " }\n"; + } + body += " return new " + uname + "(" + innerArgs.join() + ");\n};"; + resolver._read = new Function(args.join(), body).apply(void 0, values2); + }; + RecordType.prototype._match = function(tap1, tap2) { + var fields = this.fields; + var i7, l7, field, order, type3; + for (i7 = 0, l7 = fields.length; i7 < l7; i7++) { + field = fields[i7]; + order = field._order; + type3 = field.type; + if (order) { + order *= type3._match(tap1, tap2); + if (order) { + return order; + } + } else { + type3._skip(tap1); + type3._skip(tap2); + } + } + return 0; + }; + RecordType.prototype._checkFields = function(obj) { + var keys2 = Object.keys(obj); + var i7, l7; + for (i7 = 0, l7 = keys2.length; i7 < l7; i7++) { + if (!this._fieldsByName[keys2[i7]]) { + return false; + } + } + return true; + }; + RecordType.prototype._copy = function(val, opts) { + var hook = opts && opts.fieldHook; + var values2 = [void 0]; + var i7, l7, field, value2; + for (i7 = 0, l7 = this.fields.length; i7 < l7; i7++) { + field = this.fields[i7]; + value2 = val[field.name]; + if (value2 === void 0 && field.hasOwnProperty("defaultValue")) { + value2 = field.defaultValue(); + } + if (opts && !opts.skip || value2 !== void 0) { + value2 = field.type._copy(value2, opts); + } + if (hook) { + value2 = hook(field, value2, this); + } + values2.push(value2); + } + var Record = this.recordConstructor; + return new (Record.bind.apply(Record, values2))(); + }; + RecordType.prototype._deref = function(schema8, opts) { + schema8.fields = this.fields.map(function(field) { + var fieldType = field.type; + var fieldSchema = { + name: field.name, + type: fieldType._attrs(opts) + }; + if (opts.exportAttrs) { + var val = field.defaultValue(); + if (val !== void 0) { + fieldSchema["default"] = fieldType._copy(val, { coerce: 3, wrap: 3 }); + } + var fieldOrder = field.order; + if (fieldOrder !== "ascending") { + fieldSchema.order = fieldOrder; + } + var fieldAliases = field.aliases; + if (fieldAliases.length) { + fieldSchema.aliases = fieldAliases; + } + var fieldDoc = field.doc; + if (fieldDoc !== void 0) { + fieldSchema.doc = fieldDoc; + } + } + return fieldSchema; + }); + }; + RecordType.prototype.compare = function(val1, val2) { + var fields = this.fields; + var i7, l7, field, name2, order, type3; + for (i7 = 0, l7 = fields.length; i7 < l7; i7++) { + field = fields[i7]; + name2 = field.name; + order = field._order; + type3 = field.type; + if (order) { + order *= type3.compare(val1[name2], val2[name2]); + if (order) { + return order; + } + } + } + return 0; + }; + RecordType.prototype.random = function() { + var fields = this.fields.map(function(f9) { + return f9.type.random(); + }); + fields.unshift(void 0); + var Record = this.recordConstructor; + return new (Record.bind.apply(Record, fields))(); + }; + RecordType.prototype.field = function(name2) { + return this._fieldsByName[name2]; + }; + RecordType.prototype.getField = RecordType.prototype.field; + RecordType.prototype.getFields = function() { + return this.fields; + }; + RecordType.prototype.getRecordConstructor = function() { + return this.recordConstructor; + }; + Object.defineProperty(RecordType.prototype, "typeName", { + enumerable: true, + get: function() { + return this._isError ? "error" : "record"; + } + }); + function LogicalType(schema8, opts) { + this._logicalTypeName = schema8.logicalType; + Type3.call(this); + LOGICAL_TYPE = this; + try { + this._underlyingType = Type3.forSchema(schema8, opts); + } finally { + LOGICAL_TYPE = null; + var l7 = UNDERLYING_TYPES.length; + if (l7 && UNDERLYING_TYPES[l7 - 1][0] === this) { + UNDERLYING_TYPES.pop(); + } + } + if (Type3.isType(this.underlyingType, "union")) { + this._branchConstructor = this.underlyingType._branchConstructor; + } else { + this._branchConstructor = this.underlyingType._createBranchConstructor(); + } + } + util2.inherits(LogicalType, Type3); + Object.defineProperty(LogicalType.prototype, "typeName", { + enumerable: true, + get: function() { + return "logical:" + this._logicalTypeName; + } + }); + Object.defineProperty(LogicalType.prototype, "underlyingType", { + enumerable: true, + get: function() { + if (this._underlyingType) { + return this._underlyingType; + } + var i7, l7, arr; + for (i7 = 0, l7 = UNDERLYING_TYPES.length; i7 < l7; i7++) { + arr = UNDERLYING_TYPES[i7]; + if (arr[0] === this) { + return arr[1]; + } + } + } + }); + LogicalType.prototype.getUnderlyingType = function() { + return this.underlyingType; + }; + LogicalType.prototype._read = function(tap2) { + return this._fromValue(this.underlyingType._read(tap2)); + }; + LogicalType.prototype._write = function(tap2, any) { + this.underlyingType._write(tap2, this._toValue(any)); + }; + LogicalType.prototype._check = function(any, flags, hook, path2) { + try { + var val = this._toValue(any); + } catch (err) { + } + if (val === void 0) { + if (hook) { + hook(any, this); + } + return false; + } + return this.underlyingType._check(val, flags, hook, path2); + }; + LogicalType.prototype._copy = function(any, opts) { + var type3 = this.underlyingType; + switch (opts && opts.coerce) { + case 3: + return type3._copy(this._toValue(any), opts); + case 2: + return this._fromValue(type3._copy(any, opts)); + default: + return this._fromValue(type3._copy(this._toValue(any), opts)); + } + }; + LogicalType.prototype._update = function(resolver, type3, opts) { + var _fromValue = this._resolve(type3, opts); + if (_fromValue) { + resolver._read = function(tap2) { + return _fromValue(type3._read(tap2)); + }; + } + }; + LogicalType.prototype.compare = function(obj1, obj2) { + var val1 = this._toValue(obj1); + var val2 = this._toValue(obj2); + return this.underlyingType.compare(val1, val2); + }; + LogicalType.prototype.random = function() { + return this._fromValue(this.underlyingType.random()); + }; + LogicalType.prototype._deref = function(schema8, opts) { + var type3 = this.underlyingType; + var isVisited = type3.name !== void 0 && opts.derefed[type3.name]; + schema8 = type3._attrs(opts); + if (!isVisited && opts.exportAttrs) { + if (typeof schema8 == "string") { + schema8 = { type: schema8 }; + } + schema8.logicalType = this._logicalTypeName; + this._export(schema8); + } + return schema8; + }; + LogicalType.prototype._skip = function(tap2) { + this.underlyingType._skip(tap2); + }; + LogicalType.prototype._export = function() { + }; + LogicalType.prototype._fromValue = utils.abstractFunction; + LogicalType.prototype._toValue = utils.abstractFunction; + LogicalType.prototype._resolve = utils.abstractFunction; + function AbstractLongType(noUnpack) { + this._concreteTypeName = "long"; + PrimitiveType.call(this, true); + this._noUnpack = !!noUnpack; + } + util2.inherits(AbstractLongType, LongType); + AbstractLongType.prototype.typeName = "abstract:long"; + AbstractLongType.prototype._check = function(val, flags, hook) { + var b8 = this._isValid(val); + if (!b8 && hook) { + hook(val, this); + } + return b8; + }; + AbstractLongType.prototype._read = function(tap2) { + var buf, pos; + if (this._noUnpack) { + pos = tap2.pos; + tap2.skipLong(); + buf = tap2.buf.slice(pos, tap2.pos); + } else { + buf = tap2.unpackLongBytes(tap2); + } + if (tap2.isValid()) { + return this._fromBuffer(buf); + } + }; + AbstractLongType.prototype._write = function(tap2, val) { + if (!this._isValid(val)) { + throwInvalidError(val, this); + } + var buf = this._toBuffer(val); + if (this._noUnpack) { + tap2.writeFixed(buf); + } else { + tap2.packLongBytes(buf); + } + }; + AbstractLongType.prototype._copy = function(val, opts) { + switch (opts && opts.coerce) { + case 3: + return this._toJSON(val); + case 2: + return this._fromJSON(val); + default: + return this._fromJSON(this._toJSON(val)); + } + }; + AbstractLongType.prototype._deref = function() { + return "long"; + }; + AbstractLongType.prototype._update = function(resolver, type3) { + var self2 = this; + switch (type3.typeName) { + case "int": + resolver._read = function(tap2) { + return self2._fromJSON(type3._read(tap2)); + }; + break; + case "abstract:long": + case "long": + resolver._read = function(tap2) { + return self2._read(tap2); + }; + } + }; + AbstractLongType.prototype.random = function() { + return this._fromJSON(LongType.prototype.random()); + }; + AbstractLongType.prototype._fromBuffer = utils.abstractFunction; + AbstractLongType.prototype._toBuffer = utils.abstractFunction; + AbstractLongType.prototype._fromJSON = utils.abstractFunction; + AbstractLongType.prototype._toJSON = utils.abstractFunction; + AbstractLongType.prototype._isValid = utils.abstractFunction; + AbstractLongType.prototype.compare = utils.abstractFunction; + function Field(schema8, opts) { + var name2 = schema8.name; + if (typeof name2 != "string" || !utils.isValidName(name2)) { + throw new Error(f8("invalid field name: %s", name2)); + } + this.name = name2; + this.type = Type3.forSchema(schema8.type, opts); + this.aliases = schema8.aliases || []; + this.doc = schema8.doc !== void 0 ? "" + schema8.doc : void 0; + this._order = function(order) { + switch (order) { + case "ascending": + return 1; + case "descending": + return -1; + case "ignore": + return 0; + default: + throw new Error(f8("invalid order: %j", order)); + } + }(schema8.order === void 0 ? "ascending" : schema8.order); + var value2 = schema8["default"]; + if (value2 !== void 0) { + var type3 = this.type; + var val; + try { + val = type3._copy(value2, { coerce: 2, wrap: 2 }); + } catch (err) { + var msg = f8("incompatible field default %j (%s)", value2, err.message); + if (Type3.isType(type3, "union")) { + msg += f8( + ", union defaults must match the first branch's type (%j)", + type3.types[0] + ); + } + throw new Error(msg); + } + if (isPrimitive2(type3.typeName) && type3.typeName !== "bytes") { + this.defaultValue = function() { + return val; + }; + } else { + this.defaultValue = function() { + return type3._copy(val); + }; + } + } + Object.freeze(this); + } + Field.prototype.defaultValue = function() { + }; + Object.defineProperty(Field.prototype, "order", { + enumerable: true, + get: function() { + return ["descending", "ignore", "ascending"][this._order + 1]; + } + }); + Field.prototype.getAliases = function() { + return this.aliases; + }; + Field.prototype.getDefault = Field.prototype.defaultValue; + Field.prototype.getName = function() { + return this.name; + }; + Field.prototype.getOrder = function() { + return this.order; + }; + Field.prototype.getType = function() { + return this.type; + }; + function Resolver(readerType) { + this._readerType = readerType; + this._read = null; + this.itemsType = null; + this.size = 0; + this.symbols = null; + this.valuesType = null; + } + Resolver.prototype._peek = Type3.prototype._peek; + Resolver.prototype.inspect = function() { + return ""; + }; + function Hash3() { + this.str = void 0; + } + function readValue(type3, tap2, resolver, lazy) { + if (resolver) { + if (resolver._readerType !== type3) { + throw new Error("invalid resolver"); + } + return resolver._read(tap2, lazy); + } else { + return type3._read(tap2); + } + } + function getAliases(obj) { + var names = {}; + if (obj.name) { + names[obj.name] = true; + } + var aliases = obj.aliases; + var i7, l7; + for (i7 = 0, l7 = aliases.length; i7 < l7; i7++) { + names[aliases[i7]] = true; + } + return Object.keys(names); + } + function hasCompatibleName(reader, writer, strict2) { + if (!writer.name) { + return true; + } + var name2 = strict2 ? writer.name : utils.unqualify(writer.name); + var aliases = getAliases(reader); + var i7, l7, alias; + for (i7 = 0, l7 = aliases.length; i7 < l7; i7++) { + alias = aliases[i7]; + if (!strict2) { + alias = utils.unqualify(alias); + } + if (alias === name2) { + return true; + } + } + return false; + } + function isPrimitive2(typeName) { + var type3 = TYPES2[typeName]; + return type3 && type3.prototype instanceof PrimitiveType; + } + function getClassName(typeName) { + if (typeName === "error") { + typeName = "record"; + } else { + var match = /^([^:]+):(.*)$/.exec(typeName); + if (match) { + if (match[1] === "union") { + typeName = match[2] + "Union"; + } else { + typeName = match[1]; + } + } + } + return utils.capitalize(typeName) + "Type"; + } + function readArraySize(tap2) { + var n7 = tap2.readLong(); + if (n7 < 0) { + n7 = -n7; + tap2.skipLong(); + } + return n7; + } + function isSafeLong(n7) { + return n7 >= -9007199254740990 && n7 <= 9007199254740990; + } + function isJsonBuffer(obj) { + return obj && obj.type === "Buffer" && Array.isArray(obj.data); + } + function throwInvalidError(val, type3) { + throw new Error(f8("invalid %j: %j", type3.schema(), val)); + } + function maybeQualify(name2, ns) { + var unqualified = utils.unqualify(name2); + return isPrimitive2(unqualified) ? unqualified : utils.qualify(name2, ns); + } + function getTypeBucket(type3) { + var typeName = type3.typeName; + switch (typeName) { + case "double": + case "float": + case "int": + case "long": + return "number"; + case "bytes": + case "fixed": + return "buffer"; + case "enum": + return "string"; + case "map": + case "error": + case "record": + return "object"; + default: + return typeName; + } + } + function getValueBucket(val) { + if (val === null) { + return "null"; + } + var bucket = typeof val; + if (bucket === "object") { + if (Array.isArray(val)) { + return "array"; + } else if (Buffer4.isBuffer(val)) { + return "buffer"; + } + } + return bucket; + } + function isAmbiguous(types3) { + var buckets = {}; + var i7, l7, bucket, type3; + for (i7 = 0, l7 = types3.length; i7 < l7; i7++) { + type3 = types3[i7]; + if (!Type3.isType(type3, "logical")) { + bucket = getTypeBucket(type3); + if (buckets[bucket]) { + return true; + } + buckets[bucket] = true; + } + } + return false; + } + function combineNumbers(types3) { + var typeNames = ["int", "long", "float", "double"]; + var superIndex = -1; + var superType = null; + var i7, l7, type3, index4; + for (i7 = 0, l7 = types3.length; i7 < l7; i7++) { + type3 = types3[i7]; + index4 = typeNames.indexOf(type3.typeName); + if (index4 > superIndex) { + superIndex = index4; + superType = type3; + } + } + return superType; + } + function combineStrings(types3, opts) { + var symbols = {}; + var i7, l7, type3, typeSymbols; + for (i7 = 0, l7 = types3.length; i7 < l7; i7++) { + type3 = types3[i7]; + if (type3.typeName === "string") { + return type3; + } + typeSymbols = type3.symbols; + var j6, m7; + for (j6 = 0, m7 = typeSymbols.length; j6 < m7; j6++) { + symbols[typeSymbols[j6]] = true; + } + } + return Type3.forSchema({ type: "enum", symbols: Object.keys(symbols) }, opts); + } + function combineBuffers(types3, opts) { + var size2 = -1; + var i7, l7, type3; + for (i7 = 0, l7 = types3.length; i7 < l7; i7++) { + type3 = types3[i7]; + if (type3.typeName === "bytes") { + return type3; + } + if (size2 === -1) { + size2 = type3.size; + } else if (type3.size !== size2) { + size2 = -2; + } + } + return size2 < 0 ? Type3.forSchema("bytes", opts) : types3[0]; + } + function combineObjects(types3, opts) { + var allTypes = []; + var fieldTypes = {}; + var fieldDefaults = {}; + var isValidRecord = true; + var i7, l7, type3, fields; + for (i7 = 0, l7 = types3.length; i7 < l7; i7++) { + type3 = types3[i7]; + if (type3.typeName === "map") { + isValidRecord = false; + allTypes.push(type3.valuesType); + } else { + fields = type3.fields; + var j6, m7, field, fieldDefault, fieldName, fieldType; + for (j6 = 0, m7 = fields.length; j6 < m7; j6++) { + field = fields[j6]; + fieldName = field.name; + fieldType = field.type; + allTypes.push(fieldType); + if (isValidRecord) { + if (!fieldTypes[fieldName]) { + fieldTypes[fieldName] = []; + } + fieldTypes[fieldName].push(fieldType); + fieldDefault = field.defaultValue(); + if (fieldDefault !== void 0) { + fieldDefaults[fieldName] = fieldDefault; + } + } + } + } + } + if (isValidRecord) { + var fieldNames = Object.keys(fieldTypes); + for (i7 = 0, l7 = fieldNames.length; i7 < l7; i7++) { + fieldName = fieldNames[i7]; + if (fieldTypes[fieldName].length < types3.length && fieldDefaults[fieldName] === void 0) { + if (opts && opts.strictDefaults) { + isValidRecord = false; + } else { + fieldTypes[fieldName].unshift(Type3.forSchema("null", opts)); + fieldDefaults[fieldName] = null; + } + } + } + } + var schema8; + if (isValidRecord) { + schema8 = { + type: "record", + fields: fieldNames.map(function(s7) { + var fieldType2 = Type3.forTypes(fieldTypes[s7], opts); + var fieldDefault2 = fieldDefaults[s7]; + if (fieldDefault2 !== void 0 && ~fieldType2.typeName.indexOf("union")) { + var unionTypes = fieldType2.types.slice(); + var i8, l8; + for (i8 = 0, l8 = unionTypes.length; i8 < l8; i8++) { + if (unionTypes[i8].isValid(fieldDefault2)) { + break; + } + } + if (i8 > 0) { + var unionType2 = unionTypes[0]; + unionTypes[0] = unionTypes[i8]; + unionTypes[i8] = unionType2; + fieldType2 = Type3.forSchema(unionTypes, opts); + } + } + return { + name: s7, + type: fieldType2, + "default": fieldDefaults[s7] + }; + }) + }; + } else { + schema8 = { + type: "map", + values: Type3.forTypes(allTypes, opts) + }; + } + return Type3.forSchema(schema8, opts); + } + module5.exports = { + Type: Type3, + getTypeBucket, + getValueBucket, + isPrimitive: isPrimitive2, + builtins: function() { + var types3 = { + LogicalType, + UnwrappedUnionType, + WrappedUnionType + }; + var typeNames = Object.keys(TYPES2); + var i7, l7, typeName; + for (i7 = 0, l7 = typeNames.length; i7 < l7; i7++) { + typeName = typeNames[i7]; + types3[getClassName(typeName)] = TYPES2[typeName]; + } + return types3; + }() + }; + } +}); + +// node_modules/avsc/etc/browser/avsc-types.js +var require_avsc_types = __commonJS({ + "node_modules/avsc/etc/browser/avsc-types.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var types3 = require_types7(); + function parse17(any, opts) { + var schema8; + if (typeof any == "string") { + try { + schema8 = JSON.parse(any); + } catch (err) { + schema8 = any; + } + } else { + schema8 = any; + } + return types3.Type.forSchema(schema8, opts); + } + module5.exports = { + Type: types3.Type, + parse: parse17, + types: types3.builtins, + // Deprecated exports (not using `util.deprecate` since it causes stack + // overflow errors in the browser). + combine: types3.Type.forTypes, + infer: types3.Type.forValue + }; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/events.js +var events_exports = {}; +__export(events_exports, { + EventEmitter: () => EventEmitter, + default: () => exports19, + defaultMaxListeners: () => defaultMaxListeners, + init: () => init, + listenerCount: () => listenerCount, + on: () => on3, + once: () => once4 +}); +function dew16() { + if (_dewExec16) + return exports$112; + _dewExec16 = true; + var R6 = typeof Reflect === "object" ? Reflect : null; + var ReflectApply = R6 && typeof R6.apply === "function" ? R6.apply : function ReflectApply2(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; + var ReflectOwnKeys; + if (R6 && typeof R6.ownKeys === "function") { + ReflectOwnKeys = R6.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target); + }; + } + function ProcessEmitWarning(warning) { + if (console && console.warn) + console.warn(warning); + } + var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value2) { + return value2 !== value2; + }; + function EventEmitter2() { + EventEmitter2.init.call(this); + } + exports$112 = EventEmitter2; + exports$112.once = once5; + EventEmitter2.EventEmitter = EventEmitter2; + EventEmitter2.prototype._events = void 0; + EventEmitter2.prototype._eventsCount = 0; + EventEmitter2.prototype._maxListeners = void 0; + var defaultMaxListeners2 = 10; + function checkListener(listener) { + if (typeof listener !== "function") { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + } + Object.defineProperty(EventEmitter2, "defaultMaxListeners", { + enumerable: true, + get: function() { + return defaultMaxListeners2; + }, + set: function(arg) { + if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); + } + defaultMaxListeners2 = arg; + } + }); + EventEmitter2.init = function() { + if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + } + this._maxListeners = this._maxListeners || void 0; + }; + EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n7) { + if (typeof n7 !== "number" || n7 < 0 || NumberIsNaN(n7)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n7 + "."); + } + this._maxListeners = n7; + return this; + }; + function _getMaxListeners(that) { + if (that._maxListeners === void 0) + return EventEmitter2.defaultMaxListeners; + return that._maxListeners; + } + EventEmitter2.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; + EventEmitter2.prototype.emit = function emit3(type3) { + var args = []; + for (var i7 = 1; i7 < arguments.length; i7++) + args.push(arguments[i7]); + var doError = type3 === "error"; + var events = this._events; + if (events !== void 0) + doError = doError && events.error === void 0; + else if (!doError) + return false; + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + throw er; + } + var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : "")); + err.context = er; + throw err; + } + var handler = events[type3]; + if (handler === void 0) + return false; + if (typeof handler === "function") { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners3 = arrayClone(handler, len); + for (var i7 = 0; i7 < len; ++i7) + ReflectApply(listeners3[i7], this, args); + } + return true; + }; + function _addListener(target, type3, listener, prepend) { + var m7; + var events; + var existing; + checkListener(listener); + events = target._events; + if (events === void 0) { + events = target._events = /* @__PURE__ */ Object.create(null); + target._eventsCount = 0; + } else { + if (events.newListener !== void 0) { + target.emit("newListener", type3, listener.listener ? listener.listener : listener); + events = target._events; + } + existing = events[type3]; + } + if (existing === void 0) { + existing = events[type3] = listener; + ++target._eventsCount; + } else { + if (typeof existing === "function") { + existing = events[type3] = prepend ? [listener, existing] : [existing, listener]; + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + m7 = _getMaxListeners(target); + if (m7 > 0 && existing.length > m7 && !existing.warned) { + existing.warned = true; + var w6 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type3) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + w6.name = "MaxListenersExceededWarning"; + w6.emitter = target; + w6.type = type3; + w6.count = existing.length; + ProcessEmitWarning(w6); + } + } + return target; + } + EventEmitter2.prototype.addListener = function addListener3(type3, listener) { + return _addListener(this, type3, listener, false); + }; + EventEmitter2.prototype.on = EventEmitter2.prototype.addListener; + EventEmitter2.prototype.prependListener = function prependListener3(type3, listener) { + return _addListener(this, type3, listener, true); + }; + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } + function _onceWrap(target, type3, listener) { + var state = { + fired: false, + wrapFn: void 0, + target, + type: type3, + listener + }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + EventEmitter2.prototype.once = function once6(type3, listener) { + checkListener(listener); + this.on(type3, _onceWrap(this, type3, listener)); + return this; + }; + EventEmitter2.prototype.prependOnceListener = function prependOnceListener3(type3, listener) { + checkListener(listener); + this.prependListener(type3, _onceWrap(this, type3, listener)); + return this; + }; + EventEmitter2.prototype.removeListener = function removeListener3(type3, listener) { + var list, events, position, i7, originalListener; + checkListener(listener); + events = this._events; + if (events === void 0) + return this; + list = events[type3]; + if (list === void 0) + return this; + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else { + delete events[type3]; + if (events.removeListener) + this.emit("removeListener", type3, list.listener || listener); + } + } else if (typeof list !== "function") { + position = -1; + for (i7 = list.length - 1; i7 >= 0; i7--) { + if (list[i7] === listener || list[i7].listener === listener) { + originalListener = list[i7].listener; + position = i7; + break; + } + } + if (position < 0) + return this; + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + if (list.length === 1) + events[type3] = list[0]; + if (events.removeListener !== void 0) + this.emit("removeListener", type3, originalListener || listener); + } + return this; + }; + EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; + EventEmitter2.prototype.removeAllListeners = function removeAllListeners3(type3) { + var listeners3, events, i7; + events = this._events; + if (events === void 0) + return this; + if (events.removeListener === void 0) { + if (arguments.length === 0) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + } else if (events[type3] !== void 0) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else + delete events[type3]; + } + return this; + } + if (arguments.length === 0) { + var keys2 = Object.keys(events); + var key; + for (i7 = 0; i7 < keys2.length; ++i7) { + key = keys2[i7]; + if (key === "removeListener") + continue; + this.removeAllListeners(key); + } + this.removeAllListeners("removeListener"); + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + return this; + } + listeners3 = events[type3]; + if (typeof listeners3 === "function") { + this.removeListener(type3, listeners3); + } else if (listeners3 !== void 0) { + for (i7 = listeners3.length - 1; i7 >= 0; i7--) { + this.removeListener(type3, listeners3[i7]); + } + } + return this; + }; + function _listeners(target, type3, unwrap2) { + var events = target._events; + if (events === void 0) + return []; + var evlistener = events[type3]; + if (evlistener === void 0) + return []; + if (typeof evlistener === "function") + return unwrap2 ? [evlistener.listener || evlistener] : [evlistener]; + return unwrap2 ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + EventEmitter2.prototype.listeners = function listeners3(type3) { + return _listeners(this, type3, true); + }; + EventEmitter2.prototype.rawListeners = function rawListeners(type3) { + return _listeners(this, type3, false); + }; + EventEmitter2.listenerCount = function(emitter, type3) { + if (typeof emitter.listenerCount === "function") { + return emitter.listenerCount(type3); + } else { + return listenerCount2.call(emitter, type3); + } + }; + EventEmitter2.prototype.listenerCount = listenerCount2; + function listenerCount2(type3) { + var events = this._events; + if (events !== void 0) { + var evlistener = events[type3]; + if (typeof evlistener === "function") { + return 1; + } else if (evlistener !== void 0) { + return evlistener.length; + } + } + return 0; + } + EventEmitter2.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; + function arrayClone(arr, n7) { + var copy4 = new Array(n7); + for (var i7 = 0; i7 < n7; ++i7) + copy4[i7] = arr[i7]; + return copy4; + } + function spliceOne(list, index4) { + for (; index4 + 1 < list.length; index4++) + list[index4] = list[index4 + 1]; + list.pop(); + } + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i7 = 0; i7 < ret.length; ++i7) { + ret[i7] = arr[i7].listener || arr[i7]; + } + return ret; + } + function once5(emitter, name2) { + return new Promise(function(resolve3, reject2) { + function errorListener(err) { + emitter.removeListener(name2, resolver); + reject2(err); + } + function resolver() { + if (typeof emitter.removeListener === "function") { + emitter.removeListener("error", errorListener); + } + resolve3([].slice.call(arguments)); + } + eventTargetAgnosticAddListener(emitter, name2, resolver, { + once: true + }); + if (name2 !== "error") { + addErrorHandlerIfEventEmitter(emitter, errorListener, { + once: true + }); + } + }); + } + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === "function") { + eventTargetAgnosticAddListener(emitter, "error", handler, flags); + } + } + function eventTargetAgnosticAddListener(emitter, name2, listener, flags) { + if (typeof emitter.on === "function") { + if (flags.once) { + emitter.once(name2, listener); + } else { + emitter.on(name2, listener); + } + } else if (typeof emitter.addEventListener === "function") { + emitter.addEventListener(name2, function wrapListener(arg) { + if (flags.once) { + emitter.removeEventListener(name2, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } + } + return exports$112; +} +var exports$112, _dewExec16, exports19, EventEmitter, defaultMaxListeners, init, listenerCount, on3, once4; +var init_events = __esm({ + "node_modules/@jspm/core/nodelibs/browser/events.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + exports$112 = {}; + _dewExec16 = false; + exports19 = dew16(); + exports19["once"]; + exports19.once = function(emitter, event) { + return new Promise((resolve3, reject2) => { + function eventListener(...args) { + if (errorListener !== void 0) { + emitter.removeListener("error", errorListener); + } + resolve3(args); + } + let errorListener; + if (event !== "error") { + errorListener = (err) => { + emitter.removeListener(name, eventListener); + reject2(err); + }; + emitter.once("error", errorListener); + } + emitter.once(event, eventListener); + }); + }; + exports19.on = function(emitter, event) { + const unconsumedEventValues = []; + const unconsumedPromises = []; + let error2 = null; + let finished2 = false; + const iterator = { + async next() { + const value2 = unconsumedEventValues.shift(); + if (value2) { + return createIterResult(value2, false); + } + if (error2) { + const p7 = Promise.reject(error2); + error2 = null; + return p7; + } + if (finished2) { + return createIterResult(void 0, true); + } + return new Promise((resolve3, reject2) => unconsumedPromises.push({ resolve: resolve3, reject: reject2 })); + }, + async return() { + emitter.removeListener(event, eventHandler); + emitter.removeListener("error", errorHandler); + finished2 = true; + for (const promise of unconsumedPromises) { + promise.resolve(createIterResult(void 0, true)); + } + return createIterResult(void 0, true); + }, + throw(err) { + error2 = err; + emitter.removeListener(event, eventHandler); + emitter.removeListener("error", errorHandler); + }, + [Symbol.asyncIterator]() { + return this; + } + }; + emitter.on(event, eventHandler); + emitter.on("error", errorHandler); + return iterator; + function eventHandler(...args) { + const promise = unconsumedPromises.shift(); + if (promise) { + promise.resolve(createIterResult(args, false)); + } else { + unconsumedEventValues.push(args); + } + } + function errorHandler(err) { + finished2 = true; + const toError = unconsumedPromises.shift(); + if (toError) { + toError.reject(err); + } else { + error2 = err; + } + iterator.return(); + } + }; + ({ + EventEmitter, + defaultMaxListeners, + init, + listenerCount, + on: on3, + once: once4 + } = exports19); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/stream.js +var stream_exports = {}; +__export(stream_exports, { + Duplex: () => Duplex, + PassThrough: () => PassThrough, + Readable: () => Readable2, + Stream: () => Stream, + Transform: () => Transform, + Writable: () => Writable, + default: () => exports20, + finished: () => finished, + pipeline: () => pipeline, + promises: () => promises2 +}); +function dew$o2() { + if (_dewExec$o2) + return exports$p2; + _dewExec$o2 = true; + exports$p2 = { + ArrayIsArray(self2) { + return Array.isArray(self2); + }, + ArrayPrototypeIncludes(self2, el) { + return self2.includes(el); + }, + ArrayPrototypeIndexOf(self2, el) { + return self2.indexOf(el); + }, + ArrayPrototypeJoin(self2, sep2) { + return self2.join(sep2); + }, + ArrayPrototypeMap(self2, fn) { + return self2.map(fn); + }, + ArrayPrototypePop(self2, el) { + return self2.pop(el); + }, + ArrayPrototypePush(self2, el) { + return self2.push(el); + }, + ArrayPrototypeSlice(self2, start, end) { + return self2.slice(start, end); + }, + Error, + FunctionPrototypeCall(fn, thisArgs, ...args) { + return fn.call(thisArgs, ...args); + }, + FunctionPrototypeSymbolHasInstance(self2, instance) { + return Function.prototype[Symbol.hasInstance].call(self2, instance); + }, + MathFloor: Math.floor, + Number, + NumberIsInteger: Number.isInteger, + NumberIsNaN: Number.isNaN, + NumberMAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER, + NumberMIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER, + NumberParseInt: Number.parseInt, + ObjectDefineProperties(self2, props) { + return Object.defineProperties(self2, props); + }, + ObjectDefineProperty(self2, name2, prop) { + return Object.defineProperty(self2, name2, prop); + }, + ObjectGetOwnPropertyDescriptor(self2, name2) { + return Object.getOwnPropertyDescriptor(self2, name2); + }, + ObjectKeys(obj) { + return Object.keys(obj); + }, + ObjectSetPrototypeOf(target, proto) { + return Object.setPrototypeOf(target, proto); + }, + Promise, + PromisePrototypeCatch(self2, fn) { + return self2.catch(fn); + }, + PromisePrototypeThen(self2, thenFn, catchFn) { + return self2.then(thenFn, catchFn); + }, + PromiseReject(err) { + return Promise.reject(err); + }, + PromiseResolve(val) { + return Promise.resolve(val); + }, + ReflectApply: Reflect.apply, + RegExpPrototypeTest(self2, value2) { + return self2.test(value2); + }, + SafeSet: Set, + String, + StringPrototypeSlice(self2, start, end) { + return self2.slice(start, end); + }, + StringPrototypeToLowerCase(self2) { + return self2.toLowerCase(); + }, + StringPrototypeToUpperCase(self2) { + return self2.toUpperCase(); + }, + StringPrototypeTrim(self2) { + return self2.trim(); + }, + Symbol, + SymbolFor: Symbol.for, + SymbolAsyncIterator: Symbol.asyncIterator, + SymbolHasInstance: Symbol.hasInstance, + SymbolIterator: Symbol.iterator, + SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), + SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), + TypedArrayPrototypeSet(self2, buf, len) { + return self2.set(buf, len); + }, + Boolean, + Uint8Array + }; + return exports$p2; +} +function dew$n2() { + if (_dewExec$n2) + return exports$o2; + _dewExec$n2 = true; + const { + AbortController: AbortController2, + AbortSignal + } = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : ( + /* otherwise */ + void 0 + ); + exports$o2 = AbortController2; + exports$o2.AbortSignal = AbortSignal; + exports$o2.default = AbortController2; + return exports$o2; +} +function dew$m2() { + if (_dewExec$m2) + return exports$n2; + _dewExec$m2 = true; + const bufferModule = dew(); + const { + kResistStopPropagation, + SymbolDispose + } = dew$o2(); + const AbortSignal = globalThis.AbortSignal || dew$n2().AbortSignal; + const AbortController2 = globalThis.AbortController || dew$n2().AbortController; + const AsyncFunction = Object.getPrototypeOf(async function() { + }).constructor; + const Blob2 = globalThis.Blob || bufferModule.Blob; + const isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b8) { + return b8 instanceof Blob2; + } : function isBlob2(b8) { + return false; + }; + const validateAbortSignal = (signal, name2) => { + if (signal !== void 0 && (signal === null || typeof signal !== "object" || !("aborted" in signal))) { + throw new ERR_INVALID_ARG_TYPE(name2, "AbortSignal", signal); + } + }; + const validateFunction = (value2, name2) => { + if (typeof value2 !== "function") + throw new ERR_INVALID_ARG_TYPE(name2, "Function", value2); + }; + class AggregateError2 extends Error { + constructor(errors) { + if (!Array.isArray(errors)) { + throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); + } + let message = ""; + for (let i7 = 0; i7 < errors.length; i7++) { + message += ` ${errors[i7].stack} +`; + } + super(message); + this.name = "AggregateError"; + this.errors = errors; + } + } + exports$n2 = { + AggregateError: AggregateError2, + kEmptyObject: Object.freeze({}), + once(callback) { + let called = false; + return function(...args) { + if (called) { + return; + } + called = true; + callback.apply(this, args); + }; + }, + createDeferredPromise: function() { + let resolve3; + let reject2; + const promise = new Promise((res, rej) => { + resolve3 = res; + reject2 = rej; + }); + return { + promise, + resolve: resolve3, + reject: reject2 + }; + }, + promisify(fn) { + return new Promise((resolve3, reject2) => { + fn((err, ...args) => { + if (err) { + return reject2(err); + } + return resolve3(...args); + }); + }); + }, + debuglog() { + return function() { + }; + }, + format(format5, ...args) { + return format5.replace(/%([sdifj])/g, function(...[_unused, type3]) { + const replacement = args.shift(); + if (type3 === "f") { + return replacement.toFixed(6); + } else if (type3 === "j") { + return JSON.stringify(replacement); + } else if (type3 === "s" && typeof replacement === "object") { + const ctor = replacement.constructor !== Object ? replacement.constructor.name : ""; + return `${ctor} {}`.trim(); + } else { + return replacement.toString(); + } + }); + }, + inspect(value2) { + switch (typeof value2) { + case "string": + if (value2.includes("'")) { + if (!value2.includes('"')) { + return `"${value2}"`; + } else if (!value2.includes("`") && !value2.includes("${")) { + return `\`${value2}\``; + } + } + return `'${value2}'`; + case "number": + if (isNaN(value2)) { + return "NaN"; + } else if (Object.is(value2, -0)) { + return String(value2); + } + return value2; + case "bigint": + return `${String(value2)}n`; + case "boolean": + case "undefined": + return String(value2); + case "object": + return "{}"; + } + }, + types: { + isAsyncFunction(fn) { + return fn instanceof AsyncFunction; + }, + isArrayBufferView(arr) { + return ArrayBuffer.isView(arr); + } + }, + isBlob, + deprecate(fn, message) { + return fn; + }, + addAbortListener: exports19.addAbortListener || function addAbortListener(signal, listener) { + if (signal === void 0) { + throw new ERR_INVALID_ARG_TYPE("signal", "AbortSignal", signal); + } + validateAbortSignal(signal, "signal"); + validateFunction(listener, "listener"); + let removeEventListener; + if (signal.aborted) { + queueMicrotask(() => listener()); + } else { + signal.addEventListener("abort", listener, { + __proto__: null, + once: true, + [kResistStopPropagation]: true + }); + removeEventListener = () => { + signal.removeEventListener("abort", listener); + }; + } + return { + __proto__: null, + [SymbolDispose]() { + var _removeEventListener; + (_removeEventListener = removeEventListener) === null || _removeEventListener === void 0 ? void 0 : _removeEventListener(); + } + }; + }, + AbortSignalAny: AbortSignal.any || function AbortSignalAny(signals) { + if (signals.length === 1) { + return signals[0]; + } + const ac = new AbortController2(); + const abort3 = () => ac.abort(); + signals.forEach((signal) => { + validateAbortSignal(signal, "signals"); + signal.addEventListener("abort", abort3, { + once: true + }); + }); + ac.signal.addEventListener("abort", () => { + signals.forEach((signal) => signal.removeEventListener("abort", abort3)); + }, { + once: true + }); + return ac.signal; + } + }; + exports$n2.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); + return exports$n2; +} +function dew$l2() { + if (_dewExec$l2) + return exports$m2; + _dewExec$l2 = true; + const { + format: format5, + inspect: inspect2, + AggregateError: CustomAggregateError + } = dew$m2(); + const AggregateError2 = globalThis.AggregateError || CustomAggregateError; + const kIsNodeError = Symbol("kIsNodeError"); + const kTypes = [ + "string", + "function", + "number", + "object", + // Accept 'Function' and 'Object' as alternative to the lower cased version. + "Function", + "Object", + "boolean", + "bigint", + "symbol" + ]; + const classRegExp = /^([A-Z][a-z0-9]*)+$/; + const nodeInternalPrefix = "__node_internal_"; + const codes2 = {}; + function assert4(value2, message) { + if (!value2) { + throw new codes2.ERR_INTERNAL_ASSERTION(message); + } + } + function addNumericalSeparator(val) { + let res = ""; + let i7 = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i7 >= start + 4; i7 -= 3) { + res = `_${val.slice(i7 - 3, i7)}${res}`; + } + return `${val.slice(0, i7)}${res}`; + } + function getMessage(key, msg, args) { + if (typeof msg === "function") { + assert4( + msg.length <= args.length, + // Default options do not count. + `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).` + ); + return msg(...args); + } + const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length; + assert4(expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`); + if (args.length === 0) { + return msg; + } + return format5(msg, ...args); + } + function E6(code, message, Base2) { + if (!Base2) { + Base2 = Error; + } + class NodeError extends Base2 { + constructor(...args) { + super(getMessage(code, message, args)); + } + toString() { + return `${this.name} [${code}]: ${this.message}`; + } + } + Object.defineProperties(NodeError.prototype, { + name: { + value: Base2.name, + writable: true, + enumerable: false, + configurable: true + }, + toString: { + value() { + return `${this.name} [${code}]: ${this.message}`; + }, + writable: true, + enumerable: false, + configurable: true + } + }); + NodeError.prototype.code = code; + NodeError.prototype[kIsNodeError] = true; + codes2[code] = NodeError; + } + function hideStackFrames(fn) { + const hidden = nodeInternalPrefix + fn.name; + Object.defineProperty(fn, "name", { + value: hidden + }); + return fn; + } + function aggregateTwoErrors(innerError, outerError) { + if (innerError && outerError && innerError !== outerError) { + if (Array.isArray(outerError.errors)) { + outerError.errors.push(innerError); + return outerError; + } + const err = new AggregateError2([outerError, innerError], outerError.message); + err.code = outerError.code; + return err; + } + return innerError || outerError; + } + class AbortError extends Error { + constructor(message = "The operation was aborted", options = void 0) { + if (options !== void 0 && typeof options !== "object") { + throw new codes2.ERR_INVALID_ARG_TYPE("options", "Object", options); + } + super(message, options); + this.code = "ABORT_ERR"; + this.name = "AbortError"; + } + } + E6("ERR_ASSERTION", "%s", Error); + E6("ERR_INVALID_ARG_TYPE", (name2, expected, actual) => { + assert4(typeof name2 === "string", "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let msg = "The "; + if (name2.endsWith(" argument")) { + msg += `${name2} `; + } else { + msg += `"${name2}" ${name2.includes(".") ? "property" : "argument"} `; + } + msg += "must be "; + const types3 = []; + const instances = []; + const other = []; + for (const value2 of expected) { + assert4(typeof value2 === "string", "All expected entries have to be of type string"); + if (kTypes.includes(value2)) { + types3.push(value2.toLowerCase()); + } else if (classRegExp.test(value2)) { + instances.push(value2); + } else { + assert4(value2 !== "object", 'The value "object" should be written as "Object"'); + other.push(value2); + } + } + if (instances.length > 0) { + const pos = types3.indexOf("object"); + if (pos !== -1) { + types3.splice(types3, pos, 1); + instances.push("Object"); + } + } + if (types3.length > 0) { + switch (types3.length) { + case 1: + msg += `of type ${types3[0]}`; + break; + case 2: + msg += `one of type ${types3[0]} or ${types3[1]}`; + break; + default: { + const last2 = types3.pop(); + msg += `one of type ${types3.join(", ")}, or ${last2}`; + } + } + if (instances.length > 0 || other.length > 0) { + msg += " or "; + } + } + if (instances.length > 0) { + switch (instances.length) { + case 1: + msg += `an instance of ${instances[0]}`; + break; + case 2: + msg += `an instance of ${instances[0]} or ${instances[1]}`; + break; + default: { + const last2 = instances.pop(); + msg += `an instance of ${instances.join(", ")}, or ${last2}`; + } + } + if (other.length > 0) { + msg += " or "; + } + } + switch (other.length) { + case 0: + break; + case 1: + if (other[0].toLowerCase() !== other[0]) { + msg += "an "; + } + msg += `${other[0]}`; + break; + case 2: + msg += `one of ${other[0]} or ${other[1]}`; + break; + default: { + const last2 = other.pop(); + msg += `one of ${other.join(", ")}, or ${last2}`; + } + } + if (actual == null) { + msg += `. Received ${actual}`; + } else if (typeof actual === "function" && actual.name) { + msg += `. Received function ${actual.name}`; + } else if (typeof actual === "object") { + var _actual$constructor; + if ((_actual$constructor = actual.constructor) !== null && _actual$constructor !== void 0 && _actual$constructor.name) { + msg += `. Received an instance of ${actual.constructor.name}`; + } else { + const inspected = inspect2(actual, { + depth: -1 + }); + msg += `. Received ${inspected}`; + } + } else { + let inspected = inspect2(actual, { + colors: false + }); + if (inspected.length > 25) { + inspected = `${inspected.slice(0, 25)}...`; + } + msg += `. Received type ${typeof actual} (${inspected})`; + } + return msg; + }, TypeError); + E6("ERR_INVALID_ARG_VALUE", (name2, value2, reason = "is invalid") => { + let inspected = inspect2(value2); + if (inspected.length > 128) { + inspected = inspected.slice(0, 128) + "..."; + } + const type3 = name2.includes(".") ? "property" : "argument"; + return `The ${type3} '${name2}' ${reason}. Received ${inspected}`; + }, TypeError); + E6("ERR_INVALID_RETURN_VALUE", (input, name2, value2) => { + var _value$constructor; + const type3 = value2 !== null && value2 !== void 0 && (_value$constructor = value2.constructor) !== null && _value$constructor !== void 0 && _value$constructor.name ? `instance of ${value2.constructor.name}` : `type ${typeof value2}`; + return `Expected ${input} to be returned from the "${name2}" function but got ${type3}.`; + }, TypeError); + E6("ERR_MISSING_ARGS", (...args) => { + assert4(args.length > 0, "At least one arg needs to be specified"); + let msg; + const len = args.length; + args = (Array.isArray(args) ? args : [args]).map((a7) => `"${a7}"`).join(" or "); + switch (len) { + case 1: + msg += `The ${args[0]} argument`; + break; + case 2: + msg += `The ${args[0]} and ${args[1]} arguments`; + break; + default: + { + const last2 = args.pop(); + msg += `The ${args.join(", ")}, and ${last2} arguments`; + } + break; + } + return `${msg} must be specified`; + }, TypeError); + E6("ERR_OUT_OF_RANGE", (str2, range2, input) => { + assert4(range2, 'Missing "range" argument'); + let received; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > 2n ** 32n || input < -(2n ** 32n)) { + received = addNumericalSeparator(received); + } + received += "n"; + } else { + received = inspect2(input); + } + return `The value of "${str2}" is out of range. It must be ${range2}. Received ${received}`; + }, RangeError); + E6("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error); + E6("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error); + E6("ERR_STREAM_ALREADY_FINISHED", "Cannot call %s after a stream was finished", Error); + E6("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error); + E6("ERR_STREAM_DESTROYED", "Cannot call %s after a stream was destroyed", Error); + E6("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + E6("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error); + E6("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error); + E6("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event", Error); + E6("ERR_STREAM_WRITE_AFTER_END", "write after end", Error); + E6("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError); + exports$m2 = { + AbortError, + aggregateTwoErrors: hideStackFrames(aggregateTwoErrors), + hideStackFrames, + codes: codes2 + }; + return exports$m2; +} +function dew$k3() { + if (_dewExec$k3) + return exports$l2; + _dewExec$k3 = true; + const { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypeMap, + NumberIsInteger, + NumberIsNaN, + NumberMAX_SAFE_INTEGER, + NumberMIN_SAFE_INTEGER, + NumberParseInt, + ObjectPrototypeHasOwnProperty, + RegExpPrototypeExec, + String: String2, + StringPrototypeToUpperCase, + StringPrototypeTrim + } = dew$o2(); + const { + hideStackFrames, + codes: { + ERR_SOCKET_BAD_PORT, + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, + ERR_OUT_OF_RANGE, + ERR_UNKNOWN_SIGNAL + } + } = dew$l2(); + const { + normalizeEncoding + } = dew$m2(); + const { + isAsyncFunction, + isArrayBufferView + } = dew$m2().types; + const signals = {}; + function isInt32(value2) { + return value2 === (value2 | 0); + } + function isUint32(value2) { + return value2 === value2 >>> 0; + } + const octalReg = /^[0-7]+$/; + const modeDesc = "must be a 32-bit unsigned integer or an octal string"; + function parseFileMode(value2, name2, def) { + if (typeof value2 === "undefined") { + value2 = def; + } + if (typeof value2 === "string") { + if (RegExpPrototypeExec(octalReg, value2) === null) { + throw new ERR_INVALID_ARG_VALUE2(name2, value2, modeDesc); + } + value2 = NumberParseInt(value2, 8); + } + validateUint32(value2, name2); + return value2; + } + const validateInteger = hideStackFrames((value2, name2, min2 = NumberMIN_SAFE_INTEGER, max2 = NumberMAX_SAFE_INTEGER) => { + if (typeof value2 !== "number") + throw new ERR_INVALID_ARG_TYPE2(name2, "number", value2); + if (!NumberIsInteger(value2)) + throw new ERR_OUT_OF_RANGE(name2, "an integer", value2); + if (value2 < min2 || value2 > max2) + throw new ERR_OUT_OF_RANGE(name2, `>= ${min2} && <= ${max2}`, value2); + }); + const validateInt32 = hideStackFrames((value2, name2, min2 = -2147483648, max2 = 2147483647) => { + if (typeof value2 !== "number") { + throw new ERR_INVALID_ARG_TYPE2(name2, "number", value2); + } + if (!NumberIsInteger(value2)) { + throw new ERR_OUT_OF_RANGE(name2, "an integer", value2); + } + if (value2 < min2 || value2 > max2) { + throw new ERR_OUT_OF_RANGE(name2, `>= ${min2} && <= ${max2}`, value2); + } + }); + const validateUint32 = hideStackFrames((value2, name2, positive = false) => { + if (typeof value2 !== "number") { + throw new ERR_INVALID_ARG_TYPE2(name2, "number", value2); + } + if (!NumberIsInteger(value2)) { + throw new ERR_OUT_OF_RANGE(name2, "an integer", value2); + } + const min2 = positive ? 1 : 0; + const max2 = 4294967295; + if (value2 < min2 || value2 > max2) { + throw new ERR_OUT_OF_RANGE(name2, `>= ${min2} && <= ${max2}`, value2); + } + }); + function validateString(value2, name2) { + if (typeof value2 !== "string") + throw new ERR_INVALID_ARG_TYPE2(name2, "string", value2); + } + function validateNumber(value2, name2, min2 = void 0, max2) { + if (typeof value2 !== "number") + throw new ERR_INVALID_ARG_TYPE2(name2, "number", value2); + if (min2 != null && value2 < min2 || max2 != null && value2 > max2 || (min2 != null || max2 != null) && NumberIsNaN(value2)) { + throw new ERR_OUT_OF_RANGE(name2, `${min2 != null ? `>= ${min2}` : ""}${min2 != null && max2 != null ? " && " : ""}${max2 != null ? `<= ${max2}` : ""}`, value2); + } + } + const validateOneOf = hideStackFrames((value2, name2, oneOf) => { + if (!ArrayPrototypeIncludes(oneOf, value2)) { + const allowed = ArrayPrototypeJoin(ArrayPrototypeMap(oneOf, (v8) => typeof v8 === "string" ? `'${v8}'` : String2(v8)), ", "); + const reason = "must be one of: " + allowed; + throw new ERR_INVALID_ARG_VALUE2(name2, value2, reason); + } + }); + function validateBoolean(value2, name2) { + if (typeof value2 !== "boolean") + throw new ERR_INVALID_ARG_TYPE2(name2, "boolean", value2); + } + function getOwnPropertyValueOrDefault(options, key, defaultValue) { + return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue : options[key]; + } + const validateObject = hideStackFrames((value2, name2, options = null) => { + const allowArray = getOwnPropertyValueOrDefault(options, "allowArray", false); + const allowFunction = getOwnPropertyValueOrDefault(options, "allowFunction", false); + const nullable = getOwnPropertyValueOrDefault(options, "nullable", false); + if (!nullable && value2 === null || !allowArray && ArrayIsArray(value2) || typeof value2 !== "object" && (!allowFunction || typeof value2 !== "function")) { + throw new ERR_INVALID_ARG_TYPE2(name2, "Object", value2); + } + }); + const validateDictionary = hideStackFrames((value2, name2) => { + if (value2 != null && typeof value2 !== "object" && typeof value2 !== "function") { + throw new ERR_INVALID_ARG_TYPE2(name2, "a dictionary", value2); + } + }); + const validateArray = hideStackFrames((value2, name2, minLength = 0) => { + if (!ArrayIsArray(value2)) { + throw new ERR_INVALID_ARG_TYPE2(name2, "Array", value2); + } + if (value2.length < minLength) { + const reason = `must be longer than ${minLength}`; + throw new ERR_INVALID_ARG_VALUE2(name2, value2, reason); + } + }); + function validateStringArray(value2, name2) { + validateArray(value2, name2); + for (let i7 = 0; i7 < value2.length; i7++) { + validateString(value2[i7], `${name2}[${i7}]`); + } + } + function validateBooleanArray(value2, name2) { + validateArray(value2, name2); + for (let i7 = 0; i7 < value2.length; i7++) { + validateBoolean(value2[i7], `${name2}[${i7}]`); + } + } + function validateAbortSignalArray(value2, name2) { + validateArray(value2, name2); + for (let i7 = 0; i7 < value2.length; i7++) { + const signal = value2[i7]; + const indexedName = `${name2}[${i7}]`; + if (signal == null) { + throw new ERR_INVALID_ARG_TYPE2(indexedName, "AbortSignal", signal); + } + validateAbortSignal(signal, indexedName); + } + } + function validateSignalName(signal, name2 = "signal") { + validateString(signal, name2); + if (signals[signal] === void 0) { + if (signals[StringPrototypeToUpperCase(signal)] !== void 0) { + throw new ERR_UNKNOWN_SIGNAL(signal + " (signals must use all capital letters)"); + } + throw new ERR_UNKNOWN_SIGNAL(signal); + } + } + const validateBuffer = hideStackFrames((buffer2, name2 = "buffer") => { + if (!isArrayBufferView(buffer2)) { + throw new ERR_INVALID_ARG_TYPE2(name2, ["Buffer", "TypedArray", "DataView"], buffer2); + } + }); + function validateEncoding(data, encoding) { + const normalizedEncoding = normalizeEncoding(encoding); + const length = data.length; + if (normalizedEncoding === "hex" && length % 2 !== 0) { + throw new ERR_INVALID_ARG_VALUE2("encoding", encoding, `is invalid for data of length ${length}`); + } + } + function validatePort(port, name2 = "Port", allowZero = true) { + if (typeof port !== "number" && typeof port !== "string" || typeof port === "string" && StringPrototypeTrim(port).length === 0 || +port !== +port >>> 0 || port > 65535 || port === 0 && !allowZero) { + throw new ERR_SOCKET_BAD_PORT(name2, port, allowZero); + } + return port | 0; + } + const validateAbortSignal = hideStackFrames((signal, name2) => { + if (signal !== void 0 && (signal === null || typeof signal !== "object" || !("aborted" in signal))) { + throw new ERR_INVALID_ARG_TYPE2(name2, "AbortSignal", signal); + } + }); + const validateFunction = hideStackFrames((value2, name2) => { + if (typeof value2 !== "function") + throw new ERR_INVALID_ARG_TYPE2(name2, "Function", value2); + }); + const validatePlainFunction = hideStackFrames((value2, name2) => { + if (typeof value2 !== "function" || isAsyncFunction(value2)) + throw new ERR_INVALID_ARG_TYPE2(name2, "Function", value2); + }); + const validateUndefined = hideStackFrames((value2, name2) => { + if (value2 !== void 0) + throw new ERR_INVALID_ARG_TYPE2(name2, "undefined", value2); + }); + function validateUnion(value2, name2, union2) { + if (!ArrayPrototypeIncludes(union2, value2)) { + throw new ERR_INVALID_ARG_TYPE2(name2, `('${ArrayPrototypeJoin(union2, "|")}')`, value2); + } + } + const linkValueRegExp = /^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/; + function validateLinkHeaderFormat(value2, name2) { + if (typeof value2 === "undefined" || !RegExpPrototypeExec(linkValueRegExp, value2)) { + throw new ERR_INVALID_ARG_VALUE2(name2, value2, 'must be an array or string of format "; rel=preload; as=style"'); + } + } + function validateLinkHeaderValue(hints) { + if (typeof hints === "string") { + validateLinkHeaderFormat(hints, "hints"); + return hints; + } else if (ArrayIsArray(hints)) { + const hintsLength = hints.length; + let result2 = ""; + if (hintsLength === 0) { + return result2; + } + for (let i7 = 0; i7 < hintsLength; i7++) { + const link2 = hints[i7]; + validateLinkHeaderFormat(link2, "hints"); + result2 += link2; + if (i7 !== hintsLength - 1) { + result2 += ", "; + } + } + return result2; + } + throw new ERR_INVALID_ARG_VALUE2("hints", hints, 'must be an array or string of format "; rel=preload; as=style"'); + } + exports$l2 = { + isInt32, + isUint32, + parseFileMode, + validateArray, + validateStringArray, + validateBooleanArray, + validateAbortSignalArray, + validateBoolean, + validateBuffer, + validateDictionary, + validateEncoding, + validateFunction, + validateInt32, + validateInteger, + validateNumber, + validateObject, + validateOneOf, + validatePlainFunction, + validatePort, + validateSignalName, + validateString, + validateUint32, + validateUndefined, + validateUnion, + validateAbortSignal, + validateLinkHeaderValue + }; + return exports$l2; +} +function dew$j3() { + if (_dewExec$j3) + return exports$k3; + _dewExec$j3 = true; + const { + SymbolAsyncIterator, + SymbolIterator, + SymbolFor + } = dew$o2(); + const kIsDestroyed = SymbolFor("nodejs.stream.destroyed"); + const kIsErrored = SymbolFor("nodejs.stream.errored"); + const kIsReadable = SymbolFor("nodejs.stream.readable"); + const kIsWritable = SymbolFor("nodejs.stream.writable"); + const kIsDisturbed = SymbolFor("nodejs.stream.disturbed"); + const kIsClosedPromise = SymbolFor("nodejs.webstream.isClosedPromise"); + const kControllerErrorFunction = SymbolFor("nodejs.webstream.controllerErrorFunction"); + function isReadableNodeStream(obj, strict2 = false) { + var _obj$_readableState; + return !!(obj && typeof obj.pipe === "function" && typeof obj.on === "function" && (!strict2 || typeof obj.pause === "function" && typeof obj.resume === "function") && (!obj._writableState || ((_obj$_readableState = obj._readableState) === null || _obj$_readableState === void 0 ? void 0 : _obj$_readableState.readable) !== false) && // Duplex + (!obj._writableState || obj._readableState)); + } + function isWritableNodeStream(obj) { + var _obj$_writableState; + return !!(obj && typeof obj.write === "function" && typeof obj.on === "function" && (!obj._readableState || ((_obj$_writableState = obj._writableState) === null || _obj$_writableState === void 0 ? void 0 : _obj$_writableState.writable) !== false)); + } + function isDuplexNodeStream(obj) { + return !!(obj && typeof obj.pipe === "function" && obj._readableState && typeof obj.on === "function" && typeof obj.write === "function"); + } + function isNodeStream(obj) { + return obj && (obj._readableState || obj._writableState || typeof obj.write === "function" && typeof obj.on === "function" || typeof obj.pipe === "function" && typeof obj.on === "function"); + } + function isReadableStream(obj) { + return !!(obj && !isNodeStream(obj) && typeof obj.pipeThrough === "function" && typeof obj.getReader === "function" && typeof obj.cancel === "function"); + } + function isWritableStream(obj) { + return !!(obj && !isNodeStream(obj) && typeof obj.getWriter === "function" && typeof obj.abort === "function"); + } + function isTransformStream(obj) { + return !!(obj && !isNodeStream(obj) && typeof obj.readable === "object" && typeof obj.writable === "object"); + } + function isWebStream(obj) { + return isReadableStream(obj) || isWritableStream(obj) || isTransformStream(obj); + } + function isIterable(obj, isAsync2) { + if (obj == null) + return false; + if (isAsync2 === true) + return typeof obj[SymbolAsyncIterator] === "function"; + if (isAsync2 === false) + return typeof obj[SymbolIterator] === "function"; + return typeof obj[SymbolAsyncIterator] === "function" || typeof obj[SymbolIterator] === "function"; + } + function isDestroyed(stream2) { + if (!isNodeStream(stream2)) + return null; + const wState = stream2._writableState; + const rState = stream2._readableState; + const state = wState || rState; + return !!(stream2.destroyed || stream2[kIsDestroyed] || state !== null && state !== void 0 && state.destroyed); + } + function isWritableEnded(stream2) { + if (!isWritableNodeStream(stream2)) + return null; + if (stream2.writableEnded === true) + return true; + const wState = stream2._writableState; + if (wState !== null && wState !== void 0 && wState.errored) + return false; + if (typeof (wState === null || wState === void 0 ? void 0 : wState.ended) !== "boolean") + return null; + return wState.ended; + } + function isWritableFinished(stream2, strict2) { + if (!isWritableNodeStream(stream2)) + return null; + if (stream2.writableFinished === true) + return true; + const wState = stream2._writableState; + if (wState !== null && wState !== void 0 && wState.errored) + return false; + if (typeof (wState === null || wState === void 0 ? void 0 : wState.finished) !== "boolean") + return null; + return !!(wState.finished || strict2 === false && wState.ended === true && wState.length === 0); + } + function isReadableEnded(stream2) { + if (!isReadableNodeStream(stream2)) + return null; + if (stream2.readableEnded === true) + return true; + const rState = stream2._readableState; + if (!rState || rState.errored) + return false; + if (typeof (rState === null || rState === void 0 ? void 0 : rState.ended) !== "boolean") + return null; + return rState.ended; + } + function isReadableFinished(stream2, strict2) { + if (!isReadableNodeStream(stream2)) + return null; + const rState = stream2._readableState; + if (rState !== null && rState !== void 0 && rState.errored) + return false; + if (typeof (rState === null || rState === void 0 ? void 0 : rState.endEmitted) !== "boolean") + return null; + return !!(rState.endEmitted || strict2 === false && rState.ended === true && rState.length === 0); + } + function isReadable(stream2) { + if (stream2 && stream2[kIsReadable] != null) + return stream2[kIsReadable]; + if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.readable) !== "boolean") + return null; + if (isDestroyed(stream2)) + return false; + return isReadableNodeStream(stream2) && stream2.readable && !isReadableFinished(stream2); + } + function isWritable(stream2) { + if (stream2 && stream2[kIsWritable] != null) + return stream2[kIsWritable]; + if (typeof (stream2 === null || stream2 === void 0 ? void 0 : stream2.writable) !== "boolean") + return null; + if (isDestroyed(stream2)) + return false; + return isWritableNodeStream(stream2) && stream2.writable && !isWritableEnded(stream2); + } + function isFinished(stream2, opts) { + if (!isNodeStream(stream2)) { + return null; + } + if (isDestroyed(stream2)) { + return true; + } + if ((opts === null || opts === void 0 ? void 0 : opts.readable) !== false && isReadable(stream2)) { + return false; + } + if ((opts === null || opts === void 0 ? void 0 : opts.writable) !== false && isWritable(stream2)) { + return false; + } + return true; + } + function isWritableErrored(stream2) { + var _stream$_writableStat, _stream$_writableStat2; + if (!isNodeStream(stream2)) { + return null; + } + if (stream2.writableErrored) { + return stream2.writableErrored; + } + return (_stream$_writableStat = (_stream$_writableStat2 = stream2._writableState) === null || _stream$_writableStat2 === void 0 ? void 0 : _stream$_writableStat2.errored) !== null && _stream$_writableStat !== void 0 ? _stream$_writableStat : null; + } + function isReadableErrored(stream2) { + var _stream$_readableStat, _stream$_readableStat2; + if (!isNodeStream(stream2)) { + return null; + } + if (stream2.readableErrored) { + return stream2.readableErrored; + } + return (_stream$_readableStat = (_stream$_readableStat2 = stream2._readableState) === null || _stream$_readableStat2 === void 0 ? void 0 : _stream$_readableStat2.errored) !== null && _stream$_readableStat !== void 0 ? _stream$_readableStat : null; + } + function isClosed(stream2) { + if (!isNodeStream(stream2)) { + return null; + } + if (typeof stream2.closed === "boolean") { + return stream2.closed; + } + const wState = stream2._writableState; + const rState = stream2._readableState; + if (typeof (wState === null || wState === void 0 ? void 0 : wState.closed) === "boolean" || typeof (rState === null || rState === void 0 ? void 0 : rState.closed) === "boolean") { + return (wState === null || wState === void 0 ? void 0 : wState.closed) || (rState === null || rState === void 0 ? void 0 : rState.closed); + } + if (typeof stream2._closed === "boolean" && isOutgoingMessage(stream2)) { + return stream2._closed; + } + return null; + } + function isOutgoingMessage(stream2) { + return typeof stream2._closed === "boolean" && typeof stream2._defaultKeepAlive === "boolean" && typeof stream2._removedConnection === "boolean" && typeof stream2._removedContLen === "boolean"; + } + function isServerResponse(stream2) { + return typeof stream2._sent100 === "boolean" && isOutgoingMessage(stream2); + } + function isServerRequest(stream2) { + var _stream$req; + return typeof stream2._consuming === "boolean" && typeof stream2._dumped === "boolean" && ((_stream$req = stream2.req) === null || _stream$req === void 0 ? void 0 : _stream$req.upgradeOrConnect) === void 0; + } + function willEmitClose(stream2) { + if (!isNodeStream(stream2)) + return null; + const wState = stream2._writableState; + const rState = stream2._readableState; + const state = wState || rState; + return !state && isServerResponse(stream2) || !!(state && state.autoDestroy && state.emitClose && state.closed === false); + } + function isDisturbed(stream2) { + var _stream$kIsDisturbed; + return !!(stream2 && ((_stream$kIsDisturbed = stream2[kIsDisturbed]) !== null && _stream$kIsDisturbed !== void 0 ? _stream$kIsDisturbed : stream2.readableDidRead || stream2.readableAborted)); + } + function isErrored(stream2) { + var _ref, _ref2, _ref3, _ref4, _ref5, _stream$kIsErrored, _stream$_readableStat3, _stream$_writableStat3, _stream$_readableStat4, _stream$_writableStat4; + return !!(stream2 && ((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_stream$kIsErrored = stream2[kIsErrored]) !== null && _stream$kIsErrored !== void 0 ? _stream$kIsErrored : stream2.readableErrored) !== null && _ref5 !== void 0 ? _ref5 : stream2.writableErrored) !== null && _ref4 !== void 0 ? _ref4 : (_stream$_readableStat3 = stream2._readableState) === null || _stream$_readableStat3 === void 0 ? void 0 : _stream$_readableStat3.errorEmitted) !== null && _ref3 !== void 0 ? _ref3 : (_stream$_writableStat3 = stream2._writableState) === null || _stream$_writableStat3 === void 0 ? void 0 : _stream$_writableStat3.errorEmitted) !== null && _ref2 !== void 0 ? _ref2 : (_stream$_readableStat4 = stream2._readableState) === null || _stream$_readableStat4 === void 0 ? void 0 : _stream$_readableStat4.errored) !== null && _ref !== void 0 ? _ref : (_stream$_writableStat4 = stream2._writableState) === null || _stream$_writableStat4 === void 0 ? void 0 : _stream$_writableStat4.errored)); + } + exports$k3 = { + isDestroyed, + kIsDestroyed, + isDisturbed, + kIsDisturbed, + isErrored, + kIsErrored, + isReadable, + kIsReadable, + kIsClosedPromise, + kControllerErrorFunction, + kIsWritable, + isClosed, + isDuplexNodeStream, + isFinished, + isIterable, + isReadableNodeStream, + isReadableStream, + isReadableEnded, + isReadableFinished, + isReadableErrored, + isNodeStream, + isWebStream, + isWritable, + isWritableNodeStream, + isWritableStream, + isWritableEnded, + isWritableFinished, + isWritableErrored, + isServerRequest, + isServerResponse, + willEmitClose, + isTransformStream + }; + return exports$k3; +} +function dew$i3() { + if (_dewExec$i3) + return exports$j3; + _dewExec$i3 = true; + const process$1 = process3; + const { + AbortError, + codes: codes2 + } = dew$l2(); + const { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_STREAM_PREMATURE_CLOSE + } = codes2; + const { + kEmptyObject, + once: once5 + } = dew$m2(); + const { + validateAbortSignal, + validateFunction, + validateObject, + validateBoolean + } = dew$k3(); + const { + Promise: Promise3, + PromisePrototypeThen, + SymbolDispose + } = dew$o2(); + const { + isClosed, + isReadable, + isReadableNodeStream, + isReadableStream, + isReadableFinished, + isReadableErrored, + isWritable, + isWritableNodeStream, + isWritableStream, + isWritableFinished, + isWritableErrored, + isNodeStream, + willEmitClose: _willEmitClose, + kIsClosedPromise + } = dew$j3(); + let addAbortListener; + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + const nop = () => { + }; + function eos(stream2, options, callback) { + var _options$readable, _options$writable; + if (arguments.length === 2) { + callback = options; + options = kEmptyObject; + } else if (options == null) { + options = kEmptyObject; + } else { + validateObject(options, "options"); + } + validateFunction(callback, "callback"); + validateAbortSignal(options.signal, "options.signal"); + callback = once5(callback); + if (isReadableStream(stream2) || isWritableStream(stream2)) { + return eosWeb(stream2, options, callback); + } + if (!isNodeStream(stream2)) { + throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); + } + const readable = (_options$readable = options.readable) !== null && _options$readable !== void 0 ? _options$readable : isReadableNodeStream(stream2); + const writable = (_options$writable = options.writable) !== null && _options$writable !== void 0 ? _options$writable : isWritableNodeStream(stream2); + const wState = stream2._writableState; + const rState = stream2._readableState; + const onlegacyfinish = () => { + if (!stream2.writable) { + onfinish(); + } + }; + let willEmitClose = _willEmitClose(stream2) && isReadableNodeStream(stream2) === readable && isWritableNodeStream(stream2) === writable; + let writableFinished = isWritableFinished(stream2, false); + const onfinish = () => { + writableFinished = true; + if (stream2.destroyed) { + willEmitClose = false; + } + if (willEmitClose && (!stream2.readable || readable)) { + return; + } + if (!readable || readableFinished) { + callback.call(stream2); + } + }; + let readableFinished = isReadableFinished(stream2, false); + const onend = () => { + readableFinished = true; + if (stream2.destroyed) { + willEmitClose = false; + } + if (willEmitClose && (!stream2.writable || writable)) { + return; + } + if (!writable || writableFinished) { + callback.call(stream2); + } + }; + const onerror = (err) => { + callback.call(stream2, err); + }; + let closed = isClosed(stream2); + const onclose = () => { + closed = true; + const errored = isWritableErrored(stream2) || isReadableErrored(stream2); + if (errored && typeof errored !== "boolean") { + return callback.call(stream2, errored); + } + if (readable && !readableFinished && isReadableNodeStream(stream2, true)) { + if (!isReadableFinished(stream2, false)) + return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); + } + if (writable && !writableFinished) { + if (!isWritableFinished(stream2, false)) + return callback.call(stream2, new ERR_STREAM_PREMATURE_CLOSE()); + } + callback.call(stream2); + }; + const onclosed = () => { + closed = true; + const errored = isWritableErrored(stream2) || isReadableErrored(stream2); + if (errored && typeof errored !== "boolean") { + return callback.call(stream2, errored); + } + callback.call(stream2); + }; + const onrequest = () => { + stream2.req.on("finish", onfinish); + }; + if (isRequest(stream2)) { + stream2.on("complete", onfinish); + if (!willEmitClose) { + stream2.on("abort", onclose); + } + if (stream2.req) { + onrequest(); + } else { + stream2.on("request", onrequest); + } + } else if (writable && !wState) { + stream2.on("end", onlegacyfinish); + stream2.on("close", onlegacyfinish); + } + if (!willEmitClose && typeof stream2.aborted === "boolean") { + stream2.on("aborted", onclose); + } + stream2.on("end", onend); + stream2.on("finish", onfinish); + if (options.error !== false) { + stream2.on("error", onerror); + } + stream2.on("close", onclose); + if (closed) { + process$1.nextTick(onclose); + } else if (wState !== null && wState !== void 0 && wState.errorEmitted || rState !== null && rState !== void 0 && rState.errorEmitted) { + if (!willEmitClose) { + process$1.nextTick(onclosed); + } + } else if (!readable && (!willEmitClose || isReadable(stream2)) && (writableFinished || isWritable(stream2) === false)) { + process$1.nextTick(onclosed); + } else if (!writable && (!willEmitClose || isWritable(stream2)) && (readableFinished || isReadable(stream2) === false)) { + process$1.nextTick(onclosed); + } else if (rState && stream2.req && stream2.aborted) { + process$1.nextTick(onclosed); + } + const cleanup = () => { + callback = nop; + stream2.removeListener("aborted", onclose); + stream2.removeListener("complete", onfinish); + stream2.removeListener("abort", onclose); + stream2.removeListener("request", onrequest); + if (stream2.req) + stream2.req.removeListener("finish", onfinish); + stream2.removeListener("end", onlegacyfinish); + stream2.removeListener("close", onlegacyfinish); + stream2.removeListener("finish", onfinish); + stream2.removeListener("end", onend); + stream2.removeListener("error", onerror); + stream2.removeListener("close", onclose); + }; + if (options.signal && !closed) { + const abort3 = () => { + const endCallback = callback; + cleanup(); + endCallback.call(stream2, new AbortError(void 0, { + cause: options.signal.reason + })); + }; + if (options.signal.aborted) { + process$1.nextTick(abort3); + } else { + addAbortListener = addAbortListener || dew$m2().addAbortListener; + const disposable = addAbortListener(options.signal, abort3); + const originalCallback = callback; + callback = once5((...args) => { + disposable[SymbolDispose](); + originalCallback.apply(stream2, args); + }); + } + } + return cleanup; + } + function eosWeb(stream2, options, callback) { + let isAborted2 = false; + let abort3 = nop; + if (options.signal) { + abort3 = () => { + isAborted2 = true; + callback.call(stream2, new AbortError(void 0, { + cause: options.signal.reason + })); + }; + if (options.signal.aborted) { + process$1.nextTick(abort3); + } else { + addAbortListener = addAbortListener || dew$m2().addAbortListener; + const disposable = addAbortListener(options.signal, abort3); + const originalCallback = callback; + callback = once5((...args) => { + disposable[SymbolDispose](); + originalCallback.apply(stream2, args); + }); + } + } + const resolverFn = (...args) => { + if (!isAborted2) { + process$1.nextTick(() => callback.apply(stream2, args)); + } + }; + PromisePrototypeThen(stream2[kIsClosedPromise].promise, resolverFn, resolverFn); + return nop; + } + function finished2(stream2, opts) { + var _opts; + let autoCleanup = false; + if (opts === null) { + opts = kEmptyObject; + } + if ((_opts = opts) !== null && _opts !== void 0 && _opts.cleanup) { + validateBoolean(opts.cleanup, "cleanup"); + autoCleanup = opts.cleanup; + } + return new Promise3((resolve3, reject2) => { + const cleanup = eos(stream2, opts, (err) => { + if (autoCleanup) { + cleanup(); + } + if (err) { + reject2(err); + } else { + resolve3(); + } + }); + }); + } + exports$j3 = eos; + exports$j3.finished = finished2; + return exports$j3; +} +function dew$h3() { + if (_dewExec$h3) + return exports$i3; + _dewExec$h3 = true; + const process$1 = process3; + const { + aggregateTwoErrors, + codes: { + ERR_MULTIPLE_CALLBACK + }, + AbortError + } = dew$l2(); + const { + Symbol: Symbol3 + } = dew$o2(); + const { + kIsDestroyed, + isDestroyed, + isFinished, + isServerRequest + } = dew$j3(); + const kDestroy = Symbol3("kDestroy"); + const kConstruct = Symbol3("kConstruct"); + function checkError(err, w6, r8) { + if (err) { + err.stack; + if (w6 && !w6.errored) { + w6.errored = err; + } + if (r8 && !r8.errored) { + r8.errored = err; + } + } + } + function destroy(err, cb) { + const r8 = this._readableState; + const w6 = this._writableState; + const s7 = w6 || r8; + if (w6 !== null && w6 !== void 0 && w6.destroyed || r8 !== null && r8 !== void 0 && r8.destroyed) { + if (typeof cb === "function") { + cb(); + } + return this; + } + checkError(err, w6, r8); + if (w6) { + w6.destroyed = true; + } + if (r8) { + r8.destroyed = true; + } + if (!s7.constructed) { + this.once(kDestroy, function(er) { + _destroy(this, aggregateTwoErrors(er, err), cb); + }); + } else { + _destroy(this, err, cb); + } + return this; + } + function _destroy(self2, err, cb) { + let called = false; + function onDestroy(err2) { + if (called) { + return; + } + called = true; + const r8 = self2._readableState; + const w6 = self2._writableState; + checkError(err2, w6, r8); + if (w6) { + w6.closed = true; + } + if (r8) { + r8.closed = true; + } + if (typeof cb === "function") { + cb(err2); + } + if (err2) { + process$1.nextTick(emitErrorCloseNT, self2, err2); + } else { + process$1.nextTick(emitCloseNT, self2); + } + } + try { + self2._destroy(err || null, onDestroy); + } catch (err2) { + onDestroy(err2); + } + } + function emitErrorCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + const r8 = self2._readableState; + const w6 = self2._writableState; + if (w6) { + w6.closeEmitted = true; + } + if (r8) { + r8.closeEmitted = true; + } + if (w6 !== null && w6 !== void 0 && w6.emitClose || r8 !== null && r8 !== void 0 && r8.emitClose) { + self2.emit("close"); + } + } + function emitErrorNT(self2, err) { + const r8 = self2._readableState; + const w6 = self2._writableState; + if (w6 !== null && w6 !== void 0 && w6.errorEmitted || r8 !== null && r8 !== void 0 && r8.errorEmitted) { + return; + } + if (w6) { + w6.errorEmitted = true; + } + if (r8) { + r8.errorEmitted = true; + } + self2.emit("error", err); + } + function undestroy() { + const r8 = this._readableState; + const w6 = this._writableState; + if (r8) { + r8.constructed = true; + r8.closed = false; + r8.closeEmitted = false; + r8.destroyed = false; + r8.errored = null; + r8.errorEmitted = false; + r8.reading = false; + r8.ended = r8.readable === false; + r8.endEmitted = r8.readable === false; + } + if (w6) { + w6.constructed = true; + w6.destroyed = false; + w6.closed = false; + w6.closeEmitted = false; + w6.errored = null; + w6.errorEmitted = false; + w6.finalCalled = false; + w6.prefinished = false; + w6.ended = w6.writable === false; + w6.ending = w6.writable === false; + w6.finished = w6.writable === false; + } + } + function errorOrDestroy(stream2, err, sync) { + const r8 = stream2._readableState; + const w6 = stream2._writableState; + if (w6 !== null && w6 !== void 0 && w6.destroyed || r8 !== null && r8 !== void 0 && r8.destroyed) { + return this; + } + if (r8 !== null && r8 !== void 0 && r8.autoDestroy || w6 !== null && w6 !== void 0 && w6.autoDestroy) + stream2.destroy(err); + else if (err) { + err.stack; + if (w6 && !w6.errored) { + w6.errored = err; + } + if (r8 && !r8.errored) { + r8.errored = err; + } + if (sync) { + process$1.nextTick(emitErrorNT, stream2, err); + } else { + emitErrorNT(stream2, err); + } + } + } + function construct(stream2, cb) { + if (typeof stream2._construct !== "function") { + return; + } + const r8 = stream2._readableState; + const w6 = stream2._writableState; + if (r8) { + r8.constructed = false; + } + if (w6) { + w6.constructed = false; + } + stream2.once(kConstruct, cb); + if (stream2.listenerCount(kConstruct) > 1) { + return; + } + process$1.nextTick(constructNT, stream2); + } + function constructNT(stream2) { + let called = false; + function onConstruct(err) { + if (called) { + errorOrDestroy(stream2, err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK()); + return; + } + called = true; + const r8 = stream2._readableState; + const w6 = stream2._writableState; + const s7 = w6 || r8; + if (r8) { + r8.constructed = true; + } + if (w6) { + w6.constructed = true; + } + if (s7.destroyed) { + stream2.emit(kDestroy, err); + } else if (err) { + errorOrDestroy(stream2, err, true); + } else { + process$1.nextTick(emitConstructNT, stream2); + } + } + try { + stream2._construct((err) => { + process$1.nextTick(onConstruct, err); + }); + } catch (err) { + process$1.nextTick(onConstruct, err); + } + } + function emitConstructNT(stream2) { + stream2.emit(kConstruct); + } + function isRequest(stream2) { + return (stream2 === null || stream2 === void 0 ? void 0 : stream2.setHeader) && typeof stream2.abort === "function"; + } + function emitCloseLegacy(stream2) { + stream2.emit("close"); + } + function emitErrorCloseLegacy(stream2, err) { + stream2.emit("error", err); + process$1.nextTick(emitCloseLegacy, stream2); + } + function destroyer(stream2, err) { + if (!stream2 || isDestroyed(stream2)) { + return; + } + if (!err && !isFinished(stream2)) { + err = new AbortError(); + } + if (isServerRequest(stream2)) { + stream2.socket = null; + stream2.destroy(err); + } else if (isRequest(stream2)) { + stream2.abort(); + } else if (isRequest(stream2.req)) { + stream2.req.abort(); + } else if (typeof stream2.destroy === "function") { + stream2.destroy(err); + } else if (typeof stream2.close === "function") { + stream2.close(); + } else if (err) { + process$1.nextTick(emitErrorCloseLegacy, stream2, err); + } else { + process$1.nextTick(emitCloseLegacy, stream2); + } + if (!stream2.destroyed) { + stream2[kIsDestroyed] = true; + } + } + exports$i3 = { + construct, + destroyer, + destroy, + undestroy, + errorOrDestroy + }; + return exports$i3; +} +function dew$g4() { + if (_dewExec$g4) + return exports$h3; + _dewExec$g4 = true; + const { + ArrayIsArray, + ObjectSetPrototypeOf + } = dew$o2(); + const { + EventEmitter: EE + } = exports19; + function Stream2(opts) { + EE.call(this, opts); + } + ObjectSetPrototypeOf(Stream2.prototype, EE.prototype); + ObjectSetPrototypeOf(Stream2, EE); + Stream2.prototype.pipe = function(dest, options) { + const source = this; + function ondata(chunk2) { + if (dest.writable && dest.write(chunk2) === false && source.pause) { + source.pause(); + } + } + source.on("data", ondata); + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + dest.on("drain", ondrain); + if (!dest._isStdio && (!options || options.end !== false)) { + source.on("end", onend); + source.on("close", onclose); + } + let didOnEnd = false; + function onend() { + if (didOnEnd) + return; + didOnEnd = true; + dest.end(); + } + function onclose() { + if (didOnEnd) + return; + didOnEnd = true; + if (typeof dest.destroy === "function") + dest.destroy(); + } + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, "error") === 0) { + this.emit("error", er); + } + } + prependListener3(source, "error", onerror); + prependListener3(dest, "error", onerror); + function cleanup() { + source.removeListener("data", ondata); + dest.removeListener("drain", ondrain); + source.removeListener("end", onend); + source.removeListener("close", onclose); + source.removeListener("error", onerror); + dest.removeListener("error", onerror); + source.removeListener("end", cleanup); + source.removeListener("close", cleanup); + dest.removeListener("close", cleanup); + } + source.on("end", cleanup); + source.on("close", cleanup); + dest.on("close", cleanup); + dest.emit("pipe", source); + return dest; + }; + function prependListener3(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (ArrayIsArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + exports$h3 = { + Stream: Stream2, + prependListener: prependListener3 + }; + return exports$h3; +} +function dew$f4() { + if (_dewExec$f4) + return exports$g4; + _dewExec$f4 = true; + const { + SymbolDispose + } = dew$o2(); + const { + AbortError, + codes: codes2 + } = dew$l2(); + const { + isNodeStream, + isWebStream, + kControllerErrorFunction + } = dew$j3(); + const eos = dew$i3(); + const { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 + } = codes2; + let addAbortListener; + const validateAbortSignal = (signal, name2) => { + if (typeof signal !== "object" || !("aborted" in signal)) { + throw new ERR_INVALID_ARG_TYPE2(name2, "AbortSignal", signal); + } + }; + exports$g4.addAbortSignal = function addAbortSignal(signal, stream2) { + validateAbortSignal(signal, "signal"); + if (!isNodeStream(stream2) && !isWebStream(stream2)) { + throw new ERR_INVALID_ARG_TYPE2("stream", ["ReadableStream", "WritableStream", "Stream"], stream2); + } + return exports$g4.addAbortSignalNoValidate(signal, stream2); + }; + exports$g4.addAbortSignalNoValidate = function(signal, stream2) { + if (typeof signal !== "object" || !("aborted" in signal)) { + return stream2; + } + const onAbort = isNodeStream(stream2) ? () => { + stream2.destroy(new AbortError(void 0, { + cause: signal.reason + })); + } : () => { + stream2[kControllerErrorFunction](new AbortError(void 0, { + cause: signal.reason + })); + }; + if (signal.aborted) { + onAbort(); + } else { + addAbortListener = addAbortListener || dew$m2().addAbortListener; + const disposable = addAbortListener(signal, onAbort); + eos(stream2, disposable[SymbolDispose]); + } + return stream2; + }; + return exports$g4; +} +function dew$e4() { + if (_dewExec$e4) + return exports$f4; + _dewExec$e4 = true; + const { + StringPrototypeSlice, + SymbolIterator, + TypedArrayPrototypeSet, + Uint8Array: Uint8Array3 + } = dew$o2(); + const { + Buffer: Buffer4 + } = dew(); + const { + inspect: inspect2 + } = dew$m2(); + exports$f4 = class BufferList { + constructor() { + this.head = null; + this.tail = null; + this.length = 0; + } + push(v8) { + const entry = { + data: v8, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + } + unshift(v8) { + const entry = { + data: v8, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + } + shift() { + if (this.length === 0) + return; + const ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + } + clear() { + this.head = this.tail = null; + this.length = 0; + } + join(s7) { + if (this.length === 0) + return ""; + let p7 = this.head; + let ret = "" + p7.data; + while ((p7 = p7.next) !== null) + ret += s7 + p7.data; + return ret; + } + concat(n7) { + if (this.length === 0) + return Buffer4.alloc(0); + const ret = Buffer4.allocUnsafe(n7 >>> 0); + let p7 = this.head; + let i7 = 0; + while (p7) { + TypedArrayPrototypeSet(ret, p7.data, i7); + i7 += p7.data.length; + p7 = p7.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + consume(n7, hasStrings) { + const data = this.head.data; + if (n7 < data.length) { + const slice2 = data.slice(0, n7); + this.head.data = data.slice(n7); + return slice2; + } + if (n7 === data.length) { + return this.shift(); + } + return hasStrings ? this._getString(n7) : this._getBuffer(n7); + } + first() { + return this.head.data; + } + *[SymbolIterator]() { + for (let p7 = this.head; p7; p7 = p7.next) { + yield p7.data; + } + } + // Consumes a specified amount of characters from the buffered data. + _getString(n7) { + let ret = ""; + let p7 = this.head; + let c7 = 0; + do { + const str2 = p7.data; + if (n7 > str2.length) { + ret += str2; + n7 -= str2.length; + } else { + if (n7 === str2.length) { + ret += str2; + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + ret += StringPrototypeSlice(str2, 0, n7); + this.head = p7; + p7.data = StringPrototypeSlice(str2, n7); + } + break; + } + ++c7; + } while ((p7 = p7.next) !== null); + this.length -= c7; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + _getBuffer(n7) { + const ret = Buffer4.allocUnsafe(n7); + const retLen = n7; + let p7 = this.head; + let c7 = 0; + do { + const buf = p7.data; + if (n7 > buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n7); + n7 -= buf.length; + } else { + if (n7 === buf.length) { + TypedArrayPrototypeSet(ret, buf, retLen - n7); + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + TypedArrayPrototypeSet(ret, new Uint8Array3(buf.buffer, buf.byteOffset, n7), retLen - n7); + this.head = p7; + p7.data = buf.slice(n7); + } + break; + } + ++c7; + } while ((p7 = p7.next) !== null); + this.length -= c7; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + [Symbol.for("nodejs.util.inspect.custom")](_6, options) { + return inspect2(this, { + ...options, + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + }); + } + }; + return exports$f4; +} +function dew$d4() { + if (_dewExec$d4) + return exports$e4; + _dewExec$d4 = true; + const { + MathFloor, + NumberIsInteger + } = dew$o2(); + const { + validateInteger + } = dew$k3(); + const { + ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2 + } = dew$l2().codes; + let defaultHighWaterMarkBytes = 16 * 1024; + let defaultHighWaterMarkObjectMode = 16; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getDefaultHighWaterMark(objectMode) { + return objectMode ? defaultHighWaterMarkObjectMode : defaultHighWaterMarkBytes; + } + function setDefaultHighWaterMark(objectMode, value2) { + validateInteger(value2, "value", 0); + if (objectMode) { + defaultHighWaterMarkObjectMode = value2; + } else { + defaultHighWaterMarkBytes = value2; + } + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + const hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!NumberIsInteger(hwm) || hwm < 0) { + const name2 = isDuplex ? `options.${duplexKey}` : "options.highWaterMark"; + throw new ERR_INVALID_ARG_VALUE2(name2, hwm); + } + return MathFloor(hwm); + } + return getDefaultHighWaterMark(state.objectMode); + } + exports$e4 = { + getHighWaterMark, + getDefaultHighWaterMark, + setDefaultHighWaterMark + }; + return exports$e4; +} +function dew$c4() { + if (_dewExec$c4) + return exports$d4; + _dewExec$c4 = true; + const process$1 = process3; + const { + PromisePrototypeThen, + SymbolAsyncIterator, + SymbolIterator + } = dew$o2(); + const { + Buffer: Buffer4 + } = dew(); + const { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_STREAM_NULL_VALUES + } = dew$l2().codes; + function from(Readable3, iterable, opts) { + let iterator; + if (typeof iterable === "string" || iterable instanceof Buffer4) { + return new Readable3({ + objectMode: true, + ...opts, + read() { + this.push(iterable); + this.push(null); + } + }); + } + let isAsync2; + if (iterable && iterable[SymbolAsyncIterator]) { + isAsync2 = true; + iterator = iterable[SymbolAsyncIterator](); + } else if (iterable && iterable[SymbolIterator]) { + isAsync2 = false; + iterator = iterable[SymbolIterator](); + } else { + throw new ERR_INVALID_ARG_TYPE2("iterable", ["Iterable"], iterable); + } + const readable = new Readable3({ + objectMode: true, + highWaterMark: 1, + // TODO(ronag): What options should be allowed? + ...opts + }); + let reading = false; + readable._read = function() { + if (!reading) { + reading = true; + next(); + } + }; + readable._destroy = function(error2, cb) { + PromisePrototypeThen( + close(error2), + () => process$1.nextTick(cb, error2), + // nextTick is here in case cb throws + (e10) => process$1.nextTick(cb, e10 || error2) + ); + }; + async function close(error2) { + const hadError = error2 !== void 0 && error2 !== null; + const hasThrow = typeof iterator.throw === "function"; + if (hadError && hasThrow) { + const { + value: value2, + done + } = await iterator.throw(error2); + await value2; + if (done) { + return; + } + } + if (typeof iterator.return === "function") { + const { + value: value2 + } = await iterator.return(); + await value2; + } + } + async function next() { + for (; ; ) { + try { + const { + value: value2, + done + } = isAsync2 ? await iterator.next() : iterator.next(); + if (done) { + readable.push(null); + } else { + const res = value2 && typeof value2.then === "function" ? await value2 : value2; + if (res === null) { + reading = false; + throw new ERR_STREAM_NULL_VALUES(); + } else if (readable.push(res)) { + continue; + } else { + reading = false; + } + } + } catch (err) { + readable.destroy(err); + } + break; + } + } + return readable; + } + exports$d4 = from; + return exports$d4; +} +function dew$b5() { + if (_dewExec$b5) + return exports$c5; + _dewExec$b5 = true; + const process$1 = process3; + const { + ArrayPrototypeIndexOf, + NumberIsInteger, + NumberIsNaN, + NumberParseInt, + ObjectDefineProperties, + ObjectKeys, + ObjectSetPrototypeOf, + Promise: Promise3, + SafeSet, + SymbolAsyncDispose, + SymbolAsyncIterator, + Symbol: Symbol3 + } = dew$o2(); + exports$c5 = Readable3; + Readable3.ReadableState = ReadableState; + const { + EventEmitter: EE + } = exports19; + const { + Stream: Stream2, + prependListener: prependListener3 + } = dew$g4(); + const { + Buffer: Buffer4 + } = dew(); + const { + addAbortSignal + } = dew$f4(); + const eos = dew$i3(); + let debug2 = dew$m2().debuglog("stream", (fn) => { + debug2 = fn; + }); + const BufferList = dew$e4(); + const destroyImpl = dew$h3(); + const { + getHighWaterMark, + getDefaultHighWaterMark + } = dew$d4(); + const { + aggregateTwoErrors, + codes: { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_METHOD_NOT_IMPLEMENTED, + ERR_OUT_OF_RANGE, + ERR_STREAM_PUSH_AFTER_EOF, + ERR_STREAM_UNSHIFT_AFTER_END_EVENT + }, + AbortError + } = dew$l2(); + const { + validateObject + } = dew$k3(); + const kPaused = Symbol3("kPaused"); + const { + StringDecoder: StringDecoder2 + } = exports11; + const from = dew$c4(); + ObjectSetPrototypeOf(Readable3.prototype, Stream2.prototype); + ObjectSetPrototypeOf(Readable3, Stream2); + const nop = () => { + }; + const { + errorOrDestroy + } = destroyImpl; + const kObjectMode = 1 << 0; + const kEnded = 1 << 1; + const kEndEmitted = 1 << 2; + const kReading = 1 << 3; + const kConstructed = 1 << 4; + const kSync = 1 << 5; + const kNeedReadable = 1 << 6; + const kEmittedReadable = 1 << 7; + const kReadableListening = 1 << 8; + const kResumeScheduled = 1 << 9; + const kErrorEmitted = 1 << 10; + const kEmitClose = 1 << 11; + const kAutoDestroy = 1 << 12; + const kDestroyed = 1 << 13; + const kClosed = 1 << 14; + const kCloseEmitted = 1 << 15; + const kMultiAwaitDrain = 1 << 16; + const kReadingMore = 1 << 17; + const kDataEmitted = 1 << 18; + function makeBitMapDescriptor(bit) { + return { + enumerable: false, + get() { + return ((this || _global$24).state & bit) !== 0; + }, + set(value2) { + if (value2) + (this || _global$24).state |= bit; + else + (this || _global$24).state &= ~bit; + } + }; + } + ObjectDefineProperties(ReadableState.prototype, { + objectMode: makeBitMapDescriptor(kObjectMode), + ended: makeBitMapDescriptor(kEnded), + endEmitted: makeBitMapDescriptor(kEndEmitted), + reading: makeBitMapDescriptor(kReading), + // Stream is still being constructed and cannot be + // destroyed until construction finished or failed. + // Async construction is opt in, therefore we start as + // constructed. + constructed: makeBitMapDescriptor(kConstructed), + // A flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + sync: makeBitMapDescriptor(kSync), + // Whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + needReadable: makeBitMapDescriptor(kNeedReadable), + emittedReadable: makeBitMapDescriptor(kEmittedReadable), + readableListening: makeBitMapDescriptor(kReadableListening), + resumeScheduled: makeBitMapDescriptor(kResumeScheduled), + // True if the error was already emitted and should not be thrown again. + errorEmitted: makeBitMapDescriptor(kErrorEmitted), + emitClose: makeBitMapDescriptor(kEmitClose), + autoDestroy: makeBitMapDescriptor(kAutoDestroy), + // Has it been destroyed. + destroyed: makeBitMapDescriptor(kDestroyed), + // Indicates whether the stream has finished destroying. + closed: makeBitMapDescriptor(kClosed), + // True if close has been emitted or would have been emitted + // depending on emitClose. + closeEmitted: makeBitMapDescriptor(kCloseEmitted), + multiAwaitDrain: makeBitMapDescriptor(kMultiAwaitDrain), + // If true, a maybeReadMore has been scheduled. + readingMore: makeBitMapDescriptor(kReadingMore), + dataEmitted: makeBitMapDescriptor(kDataEmitted) + }); + function ReadableState(options, stream2, isDuplex) { + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof dew$85(); + (this || _global$24).state = kEmitClose | kAutoDestroy | kConstructed | kSync; + if (options && options.objectMode) + (this || _global$24).state |= kObjectMode; + if (isDuplex && options && options.readableObjectMode) + (this || _global$24).state |= kObjectMode; + (this || _global$24).highWaterMark = options ? getHighWaterMark(this || _global$24, options, "readableHighWaterMark", isDuplex) : getDefaultHighWaterMark(false); + (this || _global$24).buffer = new BufferList(); + (this || _global$24).length = 0; + (this || _global$24).pipes = []; + (this || _global$24).flowing = null; + (this || _global$24)[kPaused] = null; + if (options && options.emitClose === false) + (this || _global$24).state &= ~kEmitClose; + if (options && options.autoDestroy === false) + (this || _global$24).state &= ~kAutoDestroy; + (this || _global$24).errored = null; + (this || _global$24).defaultEncoding = options && options.defaultEncoding || "utf8"; + (this || _global$24).awaitDrainWriters = null; + (this || _global$24).decoder = null; + (this || _global$24).encoding = null; + if (options && options.encoding) { + (this || _global$24).decoder = new StringDecoder2(options.encoding); + (this || _global$24).encoding = options.encoding; + } + } + function Readable3(options) { + if (!((this || _global$24) instanceof Readable3)) + return new Readable3(options); + const isDuplex = (this || _global$24) instanceof dew$85(); + (this || _global$24)._readableState = new ReadableState(options, this || _global$24, isDuplex); + if (options) { + if (typeof options.read === "function") + (this || _global$24)._read = options.read; + if (typeof options.destroy === "function") + (this || _global$24)._destroy = options.destroy; + if (typeof options.construct === "function") + (this || _global$24)._construct = options.construct; + if (options.signal && !isDuplex) + addAbortSignal(options.signal, this || _global$24); + } + Stream2.call(this || _global$24, options); + destroyImpl.construct(this || _global$24, () => { + if ((this || _global$24)._readableState.needReadable) { + maybeReadMore(this || _global$24, (this || _global$24)._readableState); + } + }); + } + Readable3.prototype.destroy = destroyImpl.destroy; + Readable3.prototype._undestroy = destroyImpl.undestroy; + Readable3.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable3.prototype[EE.captureRejectionSymbol] = function(err) { + this.destroy(err); + }; + Readable3.prototype[SymbolAsyncDispose] = function() { + let error2; + if (!(this || _global$24).destroyed) { + error2 = (this || _global$24).readableEnded ? null : new AbortError(); + this.destroy(error2); + } + return new Promise3((resolve3, reject2) => eos(this || _global$24, (err) => err && err !== error2 ? reject2(err) : resolve3(null))); + }; + Readable3.prototype.push = function(chunk2, encoding) { + return readableAddChunk(this || _global$24, chunk2, encoding, false); + }; + Readable3.prototype.unshift = function(chunk2, encoding) { + return readableAddChunk(this || _global$24, chunk2, encoding, true); + }; + function readableAddChunk(stream2, chunk2, encoding, addToFront) { + debug2("readableAddChunk", chunk2); + const state = stream2._readableState; + let err; + if ((state.state & kObjectMode) === 0) { + if (typeof chunk2 === "string") { + encoding = encoding || state.defaultEncoding; + if (state.encoding !== encoding) { + if (addToFront && state.encoding) { + chunk2 = Buffer4.from(chunk2, encoding).toString(state.encoding); + } else { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = ""; + } + } + } else if (chunk2 instanceof Buffer4) { + encoding = ""; + } else if (Stream2._isUint8Array(chunk2)) { + chunk2 = Stream2._uint8ArrayToBuffer(chunk2); + encoding = ""; + } else if (chunk2 != null) { + err = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer", "Uint8Array"], chunk2); + } + } + if (err) { + errorOrDestroy(stream2, err); + } else if (chunk2 === null) { + state.state &= ~kReading; + onEofChunk(stream2, state); + } else if ((state.state & kObjectMode) !== 0 || chunk2 && chunk2.length > 0) { + if (addToFront) { + if ((state.state & kEndEmitted) !== 0) + errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else if (state.destroyed || state.errored) + return false; + else + addChunk(stream2, state, chunk2, true); + } else if (state.ended) { + errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed || state.errored) { + return false; + } else { + state.state &= ~kReading; + if (state.decoder && !encoding) { + chunk2 = state.decoder.write(chunk2); + if (state.objectMode || chunk2.length !== 0) + addChunk(stream2, state, chunk2, false); + else + maybeReadMore(stream2, state); + } else { + addChunk(stream2, state, chunk2, false); + } + } + } else if (!addToFront) { + state.state &= ~kReading; + maybeReadMore(stream2, state); + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream2, state, chunk2, addToFront) { + if (state.flowing && state.length === 0 && !state.sync && stream2.listenerCount("data") > 0) { + if ((state.state & kMultiAwaitDrain) !== 0) { + state.awaitDrainWriters.clear(); + } else { + state.awaitDrainWriters = null; + } + state.dataEmitted = true; + stream2.emit("data", chunk2); + } else { + state.length += state.objectMode ? 1 : chunk2.length; + if (addToFront) + state.buffer.unshift(chunk2); + else + state.buffer.push(chunk2); + if ((state.state & kNeedReadable) !== 0) + emitReadable(stream2); + } + maybeReadMore(stream2, state); + } + Readable3.prototype.isPaused = function() { + const state = (this || _global$24)._readableState; + return state[kPaused] === true || state.flowing === false; + }; + Readable3.prototype.setEncoding = function(enc) { + const decoder = new StringDecoder2(enc); + (this || _global$24)._readableState.decoder = decoder; + (this || _global$24)._readableState.encoding = (this || _global$24)._readableState.decoder.encoding; + const buffer2 = (this || _global$24)._readableState.buffer; + let content = ""; + for (const data of buffer2) { + content += decoder.write(data); + } + buffer2.clear(); + if (content !== "") + buffer2.push(content); + (this || _global$24)._readableState.length = content.length; + return this || _global$24; + }; + const MAX_HWM = 1073741824; + function computeNewHighWaterMark(n7) { + if (n7 > MAX_HWM) { + throw new ERR_OUT_OF_RANGE("size", "<= 1GiB", n7); + } else { + n7--; + n7 |= n7 >>> 1; + n7 |= n7 >>> 2; + n7 |= n7 >>> 4; + n7 |= n7 >>> 8; + n7 |= n7 >>> 16; + n7++; + } + return n7; + } + function howMuchToRead(n7, state) { + if (n7 <= 0 || state.length === 0 && state.ended) + return 0; + if ((state.state & kObjectMode) !== 0) + return 1; + if (NumberIsNaN(n7)) { + if (state.flowing && state.length) + return state.buffer.first().length; + return state.length; + } + if (n7 <= state.length) + return n7; + return state.ended ? state.length : 0; + } + Readable3.prototype.read = function(n7) { + debug2("read", n7); + if (n7 === void 0) { + n7 = NaN; + } else if (!NumberIsInteger(n7)) { + n7 = NumberParseInt(n7, 10); + } + const state = (this || _global$24)._readableState; + const nOrig = n7; + if (n7 > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n7); + if (n7 !== 0) + state.state &= ~kEmittedReadable; + if (n7 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug2("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this || _global$24); + else + emitReadable(this || _global$24); + return null; + } + n7 = howMuchToRead(n7, state); + if (n7 === 0 && state.ended) { + if (state.length === 0) + endReadable(this || _global$24); + return null; + } + let doRead = (state.state & kNeedReadable) !== 0; + debug2("need readable", doRead); + if (state.length === 0 || state.length - n7 < state.highWaterMark) { + doRead = true; + debug2("length less than watermark", doRead); + } + if (state.ended || state.reading || state.destroyed || state.errored || !state.constructed) { + doRead = false; + debug2("reading, ended or constructing", doRead); + } else if (doRead) { + debug2("do read"); + state.state |= kReading | kSync; + if (state.length === 0) + state.state |= kNeedReadable; + try { + this._read(state.highWaterMark); + } catch (err) { + errorOrDestroy(this || _global$24, err); + } + state.state &= ~kSync; + if (!state.reading) + n7 = howMuchToRead(nOrig, state); + } + let ret; + if (n7 > 0) + ret = fromList(n7, state); + else + ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n7 = 0; + } else { + state.length -= n7; + if (state.multiAwaitDrain) { + state.awaitDrainWriters.clear(); + } else { + state.awaitDrainWriters = null; + } + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n7 && state.ended) + endReadable(this || _global$24); + } + if (ret !== null && !state.errorEmitted && !state.closeEmitted) { + state.dataEmitted = true; + this.emit("data", ret); + } + return ret; + }; + function onEofChunk(stream2, state) { + debug2("onEofChunk"); + if (state.ended) + return; + if (state.decoder) { + const chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) { + state.buffer.push(chunk2); + state.length += state.objectMode ? 1 : chunk2.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream2); + } else { + state.needReadable = false; + state.emittedReadable = true; + emitReadable_(stream2); + } + } + function emitReadable(stream2) { + const state = stream2._readableState; + debug2("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug2("emitReadable", state.flowing); + state.emittedReadable = true; + process$1.nextTick(emitReadable_, stream2); + } + } + function emitReadable_(stream2) { + const state = stream2._readableState; + debug2("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && !state.errored && (state.length || state.ended)) { + stream2.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow2(stream2); + } + function maybeReadMore(stream2, state) { + if (!state.readingMore && state.constructed) { + state.readingMore = true; + process$1.nextTick(maybeReadMore_, stream2, state); + } + } + function maybeReadMore_(stream2, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + const len = state.length; + debug2("maybeReadMore read 0"); + stream2.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable3.prototype._read = function(n7) { + throw new ERR_METHOD_NOT_IMPLEMENTED("_read()"); + }; + Readable3.prototype.pipe = function(dest, pipeOpts) { + const src = this || _global$24; + const state = (this || _global$24)._readableState; + if (state.pipes.length === 1) { + if (!state.multiAwaitDrain) { + state.multiAwaitDrain = true; + state.awaitDrainWriters = new SafeSet(state.awaitDrainWriters ? [state.awaitDrainWriters] : []); + } + } + state.pipes.push(dest); + debug2("pipe count=%d opts=%j", state.pipes.length, pipeOpts); + const doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr; + const endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + process$1.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug2("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug2("onend"); + dest.end(); + } + let ondrain; + let cleanedUp = false; + function cleanup() { + debug2("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + if (ondrain) { + dest.removeListener("drain", ondrain); + } + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (ondrain && state.awaitDrainWriters && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + function pause() { + if (!cleanedUp) { + if (state.pipes.length === 1 && state.pipes[0] === dest) { + debug2("false write response, pause", 0); + state.awaitDrainWriters = dest; + state.multiAwaitDrain = false; + } else if (state.pipes.length > 1 && state.pipes.includes(dest)) { + debug2("false write response, pause", state.awaitDrainWriters.size); + state.awaitDrainWriters.add(dest); + } + src.pause(); + } + if (!ondrain) { + ondrain = pipeOnDrain(src, dest); + dest.on("drain", ondrain); + } + } + src.on("data", ondata); + function ondata(chunk2) { + debug2("ondata"); + const ret = dest.write(chunk2); + debug2("dest.write", ret); + if (ret === false) { + pause(); + } + } + function onerror(er) { + debug2("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (dest.listenerCount("error") === 0) { + const s7 = dest._writableState || dest._readableState; + if (s7 && !s7.errorEmitted) { + errorOrDestroy(dest, er); + } else { + dest.emit("error", er); + } + } + } + prependListener3(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug2("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug2("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (dest.writableNeedDrain === true) { + pause(); + } else if (!state.flowing) { + debug2("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src, dest) { + return function pipeOnDrainFunctionResult() { + const state = src._readableState; + if (state.awaitDrainWriters === dest) { + debug2("pipeOnDrain", 1); + state.awaitDrainWriters = null; + } else if (state.multiAwaitDrain) { + debug2("pipeOnDrain", state.awaitDrainWriters.size); + state.awaitDrainWriters.delete(dest); + } + if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) && src.listenerCount("data")) { + src.resume(); + } + }; + } + Readable3.prototype.unpipe = function(dest) { + const state = (this || _global$24)._readableState; + const unpipeInfo = { + hasUnpiped: false + }; + if (state.pipes.length === 0) + return this || _global$24; + if (!dest) { + const dests = state.pipes; + state.pipes = []; + this.pause(); + for (let i7 = 0; i7 < dests.length; i7++) + dests[i7].emit("unpipe", this || _global$24, { + hasUnpiped: false + }); + return this || _global$24; + } + const index4 = ArrayPrototypeIndexOf(state.pipes, dest); + if (index4 === -1) + return this || _global$24; + state.pipes.splice(index4, 1); + if (state.pipes.length === 0) + this.pause(); + dest.emit("unpipe", this || _global$24, unpipeInfo); + return this || _global$24; + }; + Readable3.prototype.on = function(ev, fn) { + const res = Stream2.prototype.on.call(this || _global$24, ev, fn); + const state = (this || _global$24)._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) + this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug2("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this || _global$24); + } else if (!state.reading) { + process$1.nextTick(nReadingNextTick, this || _global$24); + } + } + } + return res; + }; + Readable3.prototype.addListener = Readable3.prototype.on; + Readable3.prototype.removeListener = function(ev, fn) { + const res = Stream2.prototype.removeListener.call(this || _global$24, ev, fn); + if (ev === "readable") { + process$1.nextTick(updateReadableListening, this || _global$24); + } + return res; + }; + Readable3.prototype.off = Readable3.prototype.removeListener; + Readable3.prototype.removeAllListeners = function(ev) { + const res = Stream2.prototype.removeAllListeners.apply(this || _global$24, arguments); + if (ev === "readable" || ev === void 0) { + process$1.nextTick(updateReadableListening, this || _global$24); + } + return res; + }; + function updateReadableListening(self2) { + const state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && state[kPaused] === false) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } else if (!state.readableListening) { + state.flowing = null; + } + } + function nReadingNextTick(self2) { + debug2("readable nexttick read 0"); + self2.read(0); + } + Readable3.prototype.resume = function() { + const state = (this || _global$24)._readableState; + if (!state.flowing) { + debug2("resume"); + state.flowing = !state.readableListening; + resume(this || _global$24, state); + } + state[kPaused] = false; + return this || _global$24; + }; + function resume(stream2, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process$1.nextTick(resume_, stream2, state); + } + } + function resume_(stream2, state) { + debug2("resume", state.reading); + if (!state.reading) { + stream2.read(0); + } + state.resumeScheduled = false; + stream2.emit("resume"); + flow2(stream2); + if (state.flowing && !state.reading) + stream2.read(0); + } + Readable3.prototype.pause = function() { + debug2("call pause flowing=%j", (this || _global$24)._readableState.flowing); + if ((this || _global$24)._readableState.flowing !== false) { + debug2("pause"); + (this || _global$24)._readableState.flowing = false; + this.emit("pause"); + } + (this || _global$24)._readableState[kPaused] = true; + return this || _global$24; + }; + function flow2(stream2) { + const state = stream2._readableState; + debug2("flow", state.flowing); + while (state.flowing && stream2.read() !== null) + ; + } + Readable3.prototype.wrap = function(stream2) { + let paused = false; + stream2.on("data", (chunk2) => { + if (!this.push(chunk2) && stream2.pause) { + paused = true; + stream2.pause(); + } + }); + stream2.on("end", () => { + this.push(null); + }); + stream2.on("error", (err) => { + errorOrDestroy(this || _global$24, err); + }); + stream2.on("close", () => { + this.destroy(); + }); + stream2.on("destroy", () => { + this.destroy(); + }); + (this || _global$24)._read = () => { + if (paused && stream2.resume) { + paused = false; + stream2.resume(); + } + }; + const streamKeys = ObjectKeys(stream2); + for (let j6 = 1; j6 < streamKeys.length; j6++) { + const i7 = streamKeys[j6]; + if ((this || _global$24)[i7] === void 0 && typeof stream2[i7] === "function") { + (this || _global$24)[i7] = stream2[i7].bind(stream2); + } + } + return this || _global$24; + }; + Readable3.prototype[SymbolAsyncIterator] = function() { + return streamToAsyncIterator(this || _global$24); + }; + Readable3.prototype.iterator = function(options) { + if (options !== void 0) { + validateObject(options, "options"); + } + return streamToAsyncIterator(this || _global$24, options); + }; + function streamToAsyncIterator(stream2, options) { + if (typeof stream2.read !== "function") { + stream2 = Readable3.wrap(stream2, { + objectMode: true + }); + } + const iter = createAsyncIterator(stream2, options); + iter.stream = stream2; + return iter; + } + async function* createAsyncIterator(stream2, options) { + let callback = nop; + function next(resolve3) { + if ((this || _global$24) === stream2) { + callback(); + callback = nop; + } else { + callback = resolve3; + } + } + stream2.on("readable", next); + let error2; + const cleanup = eos(stream2, { + writable: false + }, (err) => { + error2 = err ? aggregateTwoErrors(error2, err) : null; + callback(); + callback = nop; + }); + try { + while (true) { + const chunk2 = stream2.destroyed ? null : stream2.read(); + if (chunk2 !== null) { + yield chunk2; + } else if (error2) { + throw error2; + } else if (error2 === null) { + return; + } else { + await new Promise3(next); + } + } + } catch (err) { + error2 = aggregateTwoErrors(error2, err); + throw error2; + } finally { + if ((error2 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error2 === void 0 || stream2._readableState.autoDestroy)) { + destroyImpl.destroyer(stream2, null); + } else { + stream2.off("readable", next); + cleanup(); + } + } + } + ObjectDefineProperties(Readable3.prototype, { + readable: { + __proto__: null, + get() { + const r8 = (this || _global$24)._readableState; + return !!r8 && r8.readable !== false && !r8.destroyed && !r8.errorEmitted && !r8.endEmitted; + }, + set(val) { + if ((this || _global$24)._readableState) { + (this || _global$24)._readableState.readable = !!val; + } + } + }, + readableDidRead: { + __proto__: null, + enumerable: false, + get: function() { + return (this || _global$24)._readableState.dataEmitted; + } + }, + readableAborted: { + __proto__: null, + enumerable: false, + get: function() { + return !!((this || _global$24)._readableState.readable !== false && ((this || _global$24)._readableState.destroyed || (this || _global$24)._readableState.errored) && !(this || _global$24)._readableState.endEmitted); + } + }, + readableHighWaterMark: { + __proto__: null, + enumerable: false, + get: function() { + return (this || _global$24)._readableState.highWaterMark; + } + }, + readableBuffer: { + __proto__: null, + enumerable: false, + get: function() { + return (this || _global$24)._readableState && (this || _global$24)._readableState.buffer; + } + }, + readableFlowing: { + __proto__: null, + enumerable: false, + get: function() { + return (this || _global$24)._readableState.flowing; + }, + set: function(state) { + if ((this || _global$24)._readableState) { + (this || _global$24)._readableState.flowing = state; + } + } + }, + readableLength: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState.length; + } + }, + readableObjectMode: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.objectMode : false; + } + }, + readableEncoding: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.encoding : null; + } + }, + errored: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.errored : null; + } + }, + closed: { + __proto__: null, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.closed : false; + } + }, + destroyed: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.destroyed : false; + }, + set(value2) { + if (!(this || _global$24)._readableState) { + return; + } + (this || _global$24)._readableState.destroyed = value2; + } + }, + readableEnded: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$24)._readableState ? (this || _global$24)._readableState.endEmitted : false; + } + } + }); + ObjectDefineProperties(ReadableState.prototype, { + // Legacy getter for `pipesCount`. + pipesCount: { + __proto__: null, + get() { + return (this || _global$24).pipes.length; + } + }, + // Legacy property for `paused`. + paused: { + __proto__: null, + get() { + return (this || _global$24)[kPaused] !== false; + }, + set(value2) { + (this || _global$24)[kPaused] = !!value2; + } + } + }); + Readable3._fromList = fromList; + function fromList(n7, state) { + if (state.length === 0) + return null; + let ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n7 || n7 >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.first(); + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n7, state.decoder); + } + return ret; + } + function endReadable(stream2) { + const state = stream2._readableState; + debug2("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process$1.nextTick(endReadableNT, state, stream2); + } + } + function endReadableNT(state, stream2) { + debug2("endReadableNT", state.endEmitted, state.length); + if (!state.errored && !state.closeEmitted && !state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream2.emit("end"); + if (stream2.writable && stream2.allowHalfOpen === false) { + process$1.nextTick(endWritableNT, stream2); + } else if (state.autoDestroy) { + const wState = stream2._writableState; + const autoDestroy = !wState || wState.autoDestroy && // We don't expect the writable to ever 'finish' + // if writable is explicitly set to false. + (wState.finished || wState.writable === false); + if (autoDestroy) { + stream2.destroy(); + } + } + } + } + function endWritableNT(stream2) { + const writable = stream2.writable && !stream2.writableEnded && !stream2.destroyed; + if (writable) { + stream2.end(); + } + } + Readable3.from = function(iterable, opts) { + return from(Readable3, iterable, opts); + }; + let webStreamsAdapters; + function lazyWebStreams() { + if (webStreamsAdapters === void 0) + webStreamsAdapters = {}; + return webStreamsAdapters; + } + Readable3.fromWeb = function(readableStream, options) { + return lazyWebStreams().newStreamReadableFromReadableStream(readableStream, options); + }; + Readable3.toWeb = function(streamReadable, options) { + return lazyWebStreams().newReadableStreamFromStreamReadable(streamReadable, options); + }; + Readable3.wrap = function(src, options) { + var _ref, _src$readableObjectMo; + return new Readable3({ + objectMode: (_ref = (_src$readableObjectMo = src.readableObjectMode) !== null && _src$readableObjectMo !== void 0 ? _src$readableObjectMo : src.objectMode) !== null && _ref !== void 0 ? _ref : true, + ...options, + destroy(err, callback) { + destroyImpl.destroyer(src, err); + callback(err); + } + }).wrap(src); + }; + return exports$c5; +} +function dew$a5() { + if (_dewExec$a5) + return exports$b5; + _dewExec$a5 = true; + const process$1 = process3; + const { + ArrayPrototypeSlice, + Error: Error2, + FunctionPrototypeSymbolHasInstance, + ObjectDefineProperty, + ObjectDefineProperties, + ObjectSetPrototypeOf, + StringPrototypeToLowerCase, + Symbol: Symbol3, + SymbolHasInstance + } = dew$o2(); + exports$b5 = Writable2; + Writable2.WritableState = WritableState; + const { + EventEmitter: EE + } = exports19; + const Stream2 = dew$g4().Stream; + const { + Buffer: Buffer4 + } = dew(); + const destroyImpl = dew$h3(); + const { + addAbortSignal + } = dew$f4(); + const { + getHighWaterMark, + getDefaultHighWaterMark + } = dew$d4(); + const { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_METHOD_NOT_IMPLEMENTED, + ERR_MULTIPLE_CALLBACK, + ERR_STREAM_CANNOT_PIPE, + ERR_STREAM_DESTROYED, + ERR_STREAM_ALREADY_FINISHED, + ERR_STREAM_NULL_VALUES, + ERR_STREAM_WRITE_AFTER_END, + ERR_UNKNOWN_ENCODING + } = dew$l2().codes; + const { + errorOrDestroy + } = destroyImpl; + ObjectSetPrototypeOf(Writable2.prototype, Stream2.prototype); + ObjectSetPrototypeOf(Writable2, Stream2); + function nop() { + } + const kOnFinished = Symbol3("kOnFinished"); + function WritableState(options, stream2, isDuplex) { + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof dew$85(); + (this || _global$111).objectMode = !!(options && options.objectMode); + if (isDuplex) + (this || _global$111).objectMode = (this || _global$111).objectMode || !!(options && options.writableObjectMode); + (this || _global$111).highWaterMark = options ? getHighWaterMark(this || _global$111, options, "writableHighWaterMark", isDuplex) : getDefaultHighWaterMark(false); + (this || _global$111).finalCalled = false; + (this || _global$111).needDrain = false; + (this || _global$111).ending = false; + (this || _global$111).ended = false; + (this || _global$111).finished = false; + (this || _global$111).destroyed = false; + const noDecode = !!(options && options.decodeStrings === false); + (this || _global$111).decodeStrings = !noDecode; + (this || _global$111).defaultEncoding = options && options.defaultEncoding || "utf8"; + (this || _global$111).length = 0; + (this || _global$111).writing = false; + (this || _global$111).corked = 0; + (this || _global$111).sync = true; + (this || _global$111).bufferProcessing = false; + (this || _global$111).onwrite = onwrite.bind(void 0, stream2); + (this || _global$111).writecb = null; + (this || _global$111).writelen = 0; + (this || _global$111).afterWriteTickInfo = null; + resetBuffer(this || _global$111); + (this || _global$111).pendingcb = 0; + (this || _global$111).constructed = true; + (this || _global$111).prefinished = false; + (this || _global$111).errorEmitted = false; + (this || _global$111).emitClose = !options || options.emitClose !== false; + (this || _global$111).autoDestroy = !options || options.autoDestroy !== false; + (this || _global$111).errored = null; + (this || _global$111).closed = false; + (this || _global$111).closeEmitted = false; + (this || _global$111)[kOnFinished] = []; + } + function resetBuffer(state) { + state.buffered = []; + state.bufferedIndex = 0; + state.allBuffers = true; + state.allNoop = true; + } + WritableState.prototype.getBuffer = function getBuffer() { + return ArrayPrototypeSlice((this || _global$111).buffered, (this || _global$111).bufferedIndex); + }; + ObjectDefineProperty(WritableState.prototype, "bufferedRequestCount", { + __proto__: null, + get() { + return (this || _global$111).buffered.length - (this || _global$111).bufferedIndex; + } + }); + function Writable2(options) { + const isDuplex = (this || _global$111) instanceof dew$85(); + if (!isDuplex && !FunctionPrototypeSymbolHasInstance(Writable2, this || _global$111)) + return new Writable2(options); + (this || _global$111)._writableState = new WritableState(options, this || _global$111, isDuplex); + if (options) { + if (typeof options.write === "function") + (this || _global$111)._write = options.write; + if (typeof options.writev === "function") + (this || _global$111)._writev = options.writev; + if (typeof options.destroy === "function") + (this || _global$111)._destroy = options.destroy; + if (typeof options.final === "function") + (this || _global$111)._final = options.final; + if (typeof options.construct === "function") + (this || _global$111)._construct = options.construct; + if (options.signal) + addAbortSignal(options.signal, this || _global$111); + } + Stream2.call(this || _global$111, options); + destroyImpl.construct(this || _global$111, () => { + const state = (this || _global$111)._writableState; + if (!state.writing) { + clearBuffer(this || _global$111, state); + } + finishMaybe(this || _global$111, state); + }); + } + ObjectDefineProperty(Writable2, SymbolHasInstance, { + __proto__: null, + value: function(object) { + if (FunctionPrototypeSymbolHasInstance(this || _global$111, object)) + return true; + if ((this || _global$111) !== Writable2) + return false; + return object && object._writableState instanceof WritableState; + } + }); + Writable2.prototype.pipe = function() { + errorOrDestroy(this || _global$111, new ERR_STREAM_CANNOT_PIPE()); + }; + function _write(stream2, chunk2, encoding, cb) { + const state = stream2._writableState; + if (typeof encoding === "function") { + cb = encoding; + encoding = state.defaultEncoding; + } else { + if (!encoding) + encoding = state.defaultEncoding; + else if (encoding !== "buffer" && !Buffer4.isEncoding(encoding)) + throw new ERR_UNKNOWN_ENCODING(encoding); + if (typeof cb !== "function") + cb = nop; + } + if (chunk2 === null) { + throw new ERR_STREAM_NULL_VALUES(); + } else if (!state.objectMode) { + if (typeof chunk2 === "string") { + if (state.decodeStrings !== false) { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = "buffer"; + } + } else if (chunk2 instanceof Buffer4) { + encoding = "buffer"; + } else if (Stream2._isUint8Array(chunk2)) { + chunk2 = Stream2._uint8ArrayToBuffer(chunk2); + encoding = "buffer"; + } else { + throw new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer", "Uint8Array"], chunk2); + } + } + let err; + if (state.ending) { + err = new ERR_STREAM_WRITE_AFTER_END(); + } else if (state.destroyed) { + err = new ERR_STREAM_DESTROYED("write"); + } + if (err) { + process$1.nextTick(cb, err); + errorOrDestroy(stream2, err, true); + return err; + } + state.pendingcb++; + return writeOrBuffer(stream2, state, chunk2, encoding, cb); + } + Writable2.prototype.write = function(chunk2, encoding, cb) { + return _write(this || _global$111, chunk2, encoding, cb) === true; + }; + Writable2.prototype.cork = function() { + (this || _global$111)._writableState.corked++; + }; + Writable2.prototype.uncork = function() { + const state = (this || _global$111)._writableState; + if (state.corked) { + state.corked--; + if (!state.writing) + clearBuffer(this || _global$111, state); + } + }; + Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = StringPrototypeToLowerCase(encoding); + if (!Buffer4.isEncoding(encoding)) + throw new ERR_UNKNOWN_ENCODING(encoding); + (this || _global$111)._writableState.defaultEncoding = encoding; + return this || _global$111; + }; + function writeOrBuffer(stream2, state, chunk2, encoding, callback) { + const len = state.objectMode ? 1 : chunk2.length; + state.length += len; + const ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked || state.errored || !state.constructed) { + state.buffered.push({ + chunk: chunk2, + encoding, + callback + }); + if (state.allBuffers && encoding !== "buffer") { + state.allBuffers = false; + } + if (state.allNoop && callback !== nop) { + state.allNoop = false; + } + } else { + state.writelen = len; + state.writecb = callback; + state.writing = true; + state.sync = true; + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + return ret && !state.errored && !state.destroyed; + } + function doWrite(stream2, state, writev, len, chunk2, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) + state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) + stream2._writev(chunk2, state.onwrite); + else + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream2, state, er, cb) { + --state.pendingcb; + cb(er); + errorBuffer(state); + errorOrDestroy(stream2, er); + } + function onwrite(stream2, er) { + const state = stream2._writableState; + const sync = state.sync; + const cb = state.writecb; + if (typeof cb !== "function") { + errorOrDestroy(stream2, new ERR_MULTIPLE_CALLBACK()); + return; + } + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + if (er) { + er.stack; + if (!state.errored) { + state.errored = er; + } + if (stream2._readableState && !stream2._readableState.errored) { + stream2._readableState.errored = er; + } + if (sync) { + process$1.nextTick(onwriteError, stream2, state, er, cb); + } else { + onwriteError(stream2, state, er, cb); + } + } else { + if (state.buffered.length > state.bufferedIndex) { + clearBuffer(stream2, state); + } + if (sync) { + if (state.afterWriteTickInfo !== null && state.afterWriteTickInfo.cb === cb) { + state.afterWriteTickInfo.count++; + } else { + state.afterWriteTickInfo = { + count: 1, + cb, + stream: stream2, + state + }; + process$1.nextTick(afterWriteTick, state.afterWriteTickInfo); + } + } else { + afterWrite(stream2, state, 1, cb); + } + } + } + function afterWriteTick({ + stream: stream2, + state, + count: count2, + cb + }) { + state.afterWriteTickInfo = null; + return afterWrite(stream2, state, count2, cb); + } + function afterWrite(stream2, state, count2, cb) { + const needDrain = !state.ending && !stream2.destroyed && state.length === 0 && state.needDrain; + if (needDrain) { + state.needDrain = false; + stream2.emit("drain"); + } + while (count2-- > 0) { + state.pendingcb--; + cb(); + } + if (state.destroyed) { + errorBuffer(state); + } + finishMaybe(stream2, state); + } + function errorBuffer(state) { + if (state.writing) { + return; + } + for (let n7 = state.bufferedIndex; n7 < state.buffered.length; ++n7) { + var _state$errored; + const { + chunk: chunk2, + callback + } = state.buffered[n7]; + const len = state.objectMode ? 1 : chunk2.length; + state.length -= len; + callback((_state$errored = state.errored) !== null && _state$errored !== void 0 ? _state$errored : new ERR_STREAM_DESTROYED("write")); + } + const onfinishCallbacks = state[kOnFinished].splice(0); + for (let i7 = 0; i7 < onfinishCallbacks.length; i7++) { + var _state$errored2; + onfinishCallbacks[i7]((_state$errored2 = state.errored) !== null && _state$errored2 !== void 0 ? _state$errored2 : new ERR_STREAM_DESTROYED("end")); + } + resetBuffer(state); + } + function clearBuffer(stream2, state) { + if (state.corked || state.bufferProcessing || state.destroyed || !state.constructed) { + return; + } + const { + buffered, + bufferedIndex, + objectMode + } = state; + const bufferedLength = buffered.length - bufferedIndex; + if (!bufferedLength) { + return; + } + let i7 = bufferedIndex; + state.bufferProcessing = true; + if (bufferedLength > 1 && stream2._writev) { + state.pendingcb -= bufferedLength - 1; + const callback = state.allNoop ? nop : (err) => { + for (let n7 = i7; n7 < buffered.length; ++n7) { + buffered[n7].callback(err); + } + }; + const chunks = state.allNoop && i7 === 0 ? buffered : ArrayPrototypeSlice(buffered, i7); + chunks.allBuffers = state.allBuffers; + doWrite(stream2, state, true, state.length, chunks, "", callback); + resetBuffer(state); + } else { + do { + const { + chunk: chunk2, + encoding, + callback + } = buffered[i7]; + buffered[i7++] = null; + const len = objectMode ? 1 : chunk2.length; + doWrite(stream2, state, false, len, chunk2, encoding, callback); + } while (i7 < buffered.length && !state.writing); + if (i7 === buffered.length) { + resetBuffer(state); + } else if (i7 > 256) { + buffered.splice(0, i7); + state.bufferedIndex = 0; + } else { + state.bufferedIndex = i7; + } + } + state.bufferProcessing = false; + } + Writable2.prototype._write = function(chunk2, encoding, cb) { + if ((this || _global$111)._writev) { + this._writev([{ + chunk: chunk2, + encoding + }], cb); + } else { + throw new ERR_METHOD_NOT_IMPLEMENTED("_write()"); + } + }; + Writable2.prototype._writev = null; + Writable2.prototype.end = function(chunk2, encoding, cb) { + const state = (this || _global$111)._writableState; + if (typeof chunk2 === "function") { + cb = chunk2; + chunk2 = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + let err; + if (chunk2 !== null && chunk2 !== void 0) { + const ret = _write(this || _global$111, chunk2, encoding); + if (ret instanceof Error2) { + err = ret; + } + } + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (err) + ; + else if (!state.errored && !state.ending) { + state.ending = true; + finishMaybe(this || _global$111, state, true); + state.ended = true; + } else if (state.finished) { + err = new ERR_STREAM_ALREADY_FINISHED("end"); + } else if (state.destroyed) { + err = new ERR_STREAM_DESTROYED("end"); + } + if (typeof cb === "function") { + if (err || state.finished) { + process$1.nextTick(cb, err); + } else { + state[kOnFinished].push(cb); + } + } + return this || _global$111; + }; + function needFinish(state) { + return state.ending && !state.destroyed && state.constructed && state.length === 0 && !state.errored && state.buffered.length === 0 && !state.finished && !state.writing && !state.errorEmitted && !state.closeEmitted; + } + function callFinal(stream2, state) { + let called = false; + function onFinish(err) { + if (called) { + errorOrDestroy(stream2, err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK()); + return; + } + called = true; + state.pendingcb--; + if (err) { + const onfinishCallbacks = state[kOnFinished].splice(0); + for (let i7 = 0; i7 < onfinishCallbacks.length; i7++) { + onfinishCallbacks[i7](err); + } + errorOrDestroy(stream2, err, state.sync); + } else if (needFinish(state)) { + state.prefinished = true; + stream2.emit("prefinish"); + state.pendingcb++; + process$1.nextTick(finish, stream2, state); + } + } + state.sync = true; + state.pendingcb++; + try { + stream2._final(onFinish); + } catch (err) { + onFinish(err); + } + state.sync = false; + } + function prefinish(stream2, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream2._final === "function" && !state.destroyed) { + state.finalCalled = true; + callFinal(stream2, state); + } else { + state.prefinished = true; + stream2.emit("prefinish"); + } + } + } + function finishMaybe(stream2, state, sync) { + if (needFinish(state)) { + prefinish(stream2, state); + if (state.pendingcb === 0) { + if (sync) { + state.pendingcb++; + process$1.nextTick((stream3, state2) => { + if (needFinish(state2)) { + finish(stream3, state2); + } else { + state2.pendingcb--; + } + }, stream2, state); + } else if (needFinish(state)) { + state.pendingcb++; + finish(stream2, state); + } + } + } + } + function finish(stream2, state) { + state.pendingcb--; + state.finished = true; + const onfinishCallbacks = state[kOnFinished].splice(0); + for (let i7 = 0; i7 < onfinishCallbacks.length; i7++) { + onfinishCallbacks[i7](); + } + stream2.emit("finish"); + if (state.autoDestroy) { + const rState = stream2._readableState; + const autoDestroy = !rState || rState.autoDestroy && // We don't expect the readable to ever 'end' + // if readable is explicitly set to false. + (rState.endEmitted || rState.readable === false); + if (autoDestroy) { + stream2.destroy(); + } + } + } + ObjectDefineProperties(Writable2.prototype, { + closed: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.closed : false; + } + }, + destroyed: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.destroyed : false; + }, + set(value2) { + if ((this || _global$111)._writableState) { + (this || _global$111)._writableState.destroyed = value2; + } + } + }, + writable: { + __proto__: null, + get() { + const w6 = (this || _global$111)._writableState; + return !!w6 && w6.writable !== false && !w6.destroyed && !w6.errored && !w6.ending && !w6.ended; + }, + set(val) { + if ((this || _global$111)._writableState) { + (this || _global$111)._writableState.writable = !!val; + } + } + }, + writableFinished: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.finished : false; + } + }, + writableObjectMode: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.objectMode : false; + } + }, + writableBuffer: { + __proto__: null, + get() { + return (this || _global$111)._writableState && (this || _global$111)._writableState.getBuffer(); + } + }, + writableEnded: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.ending : false; + } + }, + writableNeedDrain: { + __proto__: null, + get() { + const wState = (this || _global$111)._writableState; + if (!wState) + return false; + return !wState.destroyed && !wState.ending && wState.needDrain; + } + }, + writableHighWaterMark: { + __proto__: null, + get() { + return (this || _global$111)._writableState && (this || _global$111)._writableState.highWaterMark; + } + }, + writableCorked: { + __proto__: null, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.corked : 0; + } + }, + writableLength: { + __proto__: null, + get() { + return (this || _global$111)._writableState && (this || _global$111)._writableState.length; + } + }, + errored: { + __proto__: null, + enumerable: false, + get() { + return (this || _global$111)._writableState ? (this || _global$111)._writableState.errored : null; + } + }, + writableAborted: { + __proto__: null, + enumerable: false, + get: function() { + return !!((this || _global$111)._writableState.writable !== false && ((this || _global$111)._writableState.destroyed || (this || _global$111)._writableState.errored) && !(this || _global$111)._writableState.finished); + } + } + }); + const destroy = destroyImpl.destroy; + Writable2.prototype.destroy = function(err, cb) { + const state = (this || _global$111)._writableState; + if (!state.destroyed && (state.bufferedIndex < state.buffered.length || state[kOnFinished].length)) { + process$1.nextTick(errorBuffer, state); + } + destroy.call(this || _global$111, err, cb); + return this || _global$111; + }; + Writable2.prototype._undestroy = destroyImpl.undestroy; + Writable2.prototype._destroy = function(err, cb) { + cb(err); + }; + Writable2.prototype[EE.captureRejectionSymbol] = function(err) { + this.destroy(err); + }; + let webStreamsAdapters; + function lazyWebStreams() { + if (webStreamsAdapters === void 0) + webStreamsAdapters = {}; + return webStreamsAdapters; + } + Writable2.fromWeb = function(writableStream, options) { + return lazyWebStreams().newStreamWritableFromWritableStream(writableStream, options); + }; + Writable2.toWeb = function(streamWritable) { + return lazyWebStreams().newWritableStreamFromStreamWritable(streamWritable); + }; + return exports$b5; +} +function dew$95() { + if (_dewExec$95) + return exports$a5; + _dewExec$95 = true; + const process$1 = process3; + const bufferModule = dew(); + const { + isReadable, + isWritable, + isIterable, + isNodeStream, + isReadableNodeStream, + isWritableNodeStream, + isDuplexNodeStream, + isReadableStream, + isWritableStream + } = dew$j3(); + const eos = dew$i3(); + const { + AbortError, + codes: { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_INVALID_RETURN_VALUE + } + } = dew$l2(); + const { + destroyer + } = dew$h3(); + const Duplex2 = dew$85(); + const Readable3 = dew$b5(); + const Writable2 = dew$a5(); + const { + createDeferredPromise + } = dew$m2(); + const from = dew$c4(); + const Blob2 = globalThis.Blob || bufferModule.Blob; + const isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b8) { + return b8 instanceof Blob2; + } : function isBlob2(b8) { + return false; + }; + const AbortController2 = globalThis.AbortController || dew$n2().AbortController; + const { + FunctionPrototypeCall + } = dew$o2(); + class Duplexify extends Duplex2 { + constructor(options) { + super(options); + if ((options === null || options === void 0 ? void 0 : options.readable) === false) { + this._readableState.readable = false; + this._readableState.ended = true; + this._readableState.endEmitted = true; + } + if ((options === null || options === void 0 ? void 0 : options.writable) === false) { + this._writableState.writable = false; + this._writableState.ending = true; + this._writableState.ended = true; + this._writableState.finished = true; + } + } + } + exports$a5 = function duplexify(body, name2) { + if (isDuplexNodeStream(body)) { + return body; + } + if (isReadableNodeStream(body)) { + return _duplexify({ + readable: body + }); + } + if (isWritableNodeStream(body)) { + return _duplexify({ + writable: body + }); + } + if (isNodeStream(body)) { + return _duplexify({ + writable: false, + readable: false + }); + } + if (isReadableStream(body)) { + return _duplexify({ + readable: Readable3.fromWeb(body) + }); + } + if (isWritableStream(body)) { + return _duplexify({ + writable: Writable2.fromWeb(body) + }); + } + if (typeof body === "function") { + const { + value: value2, + write, + final, + destroy + } = fromAsyncGen(body); + if (isIterable(value2)) { + return from(Duplexify, value2, { + // TODO (ronag): highWaterMark? + objectMode: true, + write, + final, + destroy + }); + } + const then2 = value2 === null || value2 === void 0 ? void 0 : value2.then; + if (typeof then2 === "function") { + let d7; + const promise = FunctionPrototypeCall(then2, value2, (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); + } + }, (err) => { + destroyer(d7, err); + }); + return d7 = new Duplexify({ + // TODO (ronag): highWaterMark? + objectMode: true, + readable: false, + write, + final(cb) { + final(async () => { + try { + await promise; + process$1.nextTick(cb, null); + } catch (err) { + process$1.nextTick(cb, err); + } + }); + }, + destroy + }); + } + throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or AsyncFunction", name2, value2); + } + if (isBlob(body)) { + return duplexify(body.arrayBuffer()); + } + if (isIterable(body)) { + return from(Duplexify, body, { + // TODO (ronag): highWaterMark? + objectMode: true, + writable: false + }); + } + if (isReadableStream(body === null || body === void 0 ? void 0 : body.readable) && isWritableStream(body === null || body === void 0 ? void 0 : body.writable)) { + return Duplexify.fromWeb(body); + } + if (typeof (body === null || body === void 0 ? void 0 : body.writable) === "object" || typeof (body === null || body === void 0 ? void 0 : body.readable) === "object") { + const readable = body !== null && body !== void 0 && body.readable ? isReadableNodeStream(body === null || body === void 0 ? void 0 : body.readable) ? body === null || body === void 0 ? void 0 : body.readable : duplexify(body.readable) : void 0; + const writable = body !== null && body !== void 0 && body.writable ? isWritableNodeStream(body === null || body === void 0 ? void 0 : body.writable) ? body === null || body === void 0 ? void 0 : body.writable : duplexify(body.writable) : void 0; + return _duplexify({ + readable, + writable + }); + } + const then = body === null || body === void 0 ? void 0 : body.then; + if (typeof then === "function") { + let d7; + FunctionPrototypeCall(then, body, (val) => { + if (val != null) { + d7.push(val); + } + d7.push(null); + }, (err) => { + destroyer(d7, err); + }); + return d7 = new Duplexify({ + objectMode: true, + writable: false, + read() { + } + }); + } + throw new ERR_INVALID_ARG_TYPE2(name2, ["Blob", "ReadableStream", "WritableStream", "Stream", "Iterable", "AsyncIterable", "Function", "{ readable, writable } pair", "Promise"], body); + }; + function fromAsyncGen(fn) { + let { + promise, + resolve: resolve3 + } = createDeferredPromise(); + const ac = new AbortController2(); + const signal = ac.signal; + const value2 = fn(async function* () { + while (true) { + const _promise = promise; + promise = null; + const { + chunk: chunk2, + done, + cb + } = await _promise; + process$1.nextTick(cb); + if (done) + return; + if (signal.aborted) + throw new AbortError(void 0, { + cause: signal.reason + }); + ({ + promise, + resolve: resolve3 + } = createDeferredPromise()); + yield chunk2; + } + }(), { + signal + }); + return { + value: value2, + write(chunk2, encoding, cb) { + const _resolve = resolve3; + resolve3 = null; + _resolve({ + chunk: chunk2, + done: false, + cb + }); + }, + final(cb) { + const _resolve = resolve3; + resolve3 = null; + _resolve({ + done: true, + cb + }); + }, + destroy(err, cb) { + ac.abort(); + cb(err); + } + }; + } + function _duplexify(pair) { + const r8 = pair.readable && typeof pair.readable.read !== "function" ? Readable3.wrap(pair.readable) : pair.readable; + const w6 = pair.writable; + let readable = !!isReadable(r8); + let writable = !!isWritable(w6); + let ondrain; + let onfinish; + let onreadable; + let onclose; + let d7; + function onfinished(err) { + const cb = onclose; + onclose = null; + if (cb) { + cb(err); + } else if (err) { + d7.destroy(err); + } + } + d7 = new Duplexify({ + // TODO (ronag): highWaterMark? + readableObjectMode: !!(r8 !== null && r8 !== void 0 && r8.readableObjectMode), + writableObjectMode: !!(w6 !== null && w6 !== void 0 && w6.writableObjectMode), + readable, + writable + }); + if (writable) { + eos(w6, (err) => { + writable = false; + if (err) { + destroyer(r8, err); + } + onfinished(err); + }); + d7._write = function(chunk2, encoding, callback) { + if (w6.write(chunk2, encoding)) { + callback(); + } else { + ondrain = callback; + } + }; + d7._final = function(callback) { + w6.end(); + onfinish = callback; + }; + w6.on("drain", function() { + if (ondrain) { + const cb = ondrain; + ondrain = null; + cb(); + } + }); + w6.on("finish", function() { + if (onfinish) { + const cb = onfinish; + onfinish = null; + cb(); + } + }); + } + if (readable) { + eos(r8, (err) => { + readable = false; + if (err) { + destroyer(r8, err); + } + onfinished(err); + }); + r8.on("readable", function() { + if (onreadable) { + const cb = onreadable; + onreadable = null; + cb(); + } + }); + r8.on("end", function() { + d7.push(null); + }); + d7._read = function() { + while (true) { + const buf = r8.read(); + if (buf === null) { + onreadable = d7._read; + return; + } + if (!d7.push(buf)) { + return; + } + } + }; + } + d7._destroy = function(err, callback) { + if (!err && onclose !== null) { + err = new AbortError(); + } + onreadable = null; + ondrain = null; + onfinish = null; + if (onclose === null) { + callback(err); + } else { + onclose = callback; + destroyer(w6, err); + destroyer(r8, err); + } + }; + return d7; + } + return exports$a5; +} +function dew$85() { + if (_dewExec$85) + return exports$95; + _dewExec$85 = true; + const { + ObjectDefineProperties, + ObjectGetOwnPropertyDescriptor, + ObjectKeys, + ObjectSetPrototypeOf + } = dew$o2(); + exports$95 = Duplex2; + const Readable3 = dew$b5(); + const Writable2 = dew$a5(); + ObjectSetPrototypeOf(Duplex2.prototype, Readable3.prototype); + ObjectSetPrototypeOf(Duplex2, Readable3); + { + const keys2 = ObjectKeys(Writable2.prototype); + for (let i7 = 0; i7 < keys2.length; i7++) { + const method2 = keys2[i7]; + if (!Duplex2.prototype[method2]) + Duplex2.prototype[method2] = Writable2.prototype[method2]; + } + } + function Duplex2(options) { + if (!(this instanceof Duplex2)) + return new Duplex2(options); + Readable3.call(this, options); + Writable2.call(this, options); + if (options) { + this.allowHalfOpen = options.allowHalfOpen !== false; + if (options.readable === false) { + this._readableState.readable = false; + this._readableState.ended = true; + this._readableState.endEmitted = true; + } + if (options.writable === false) { + this._writableState.writable = false; + this._writableState.ending = true; + this._writableState.ended = true; + this._writableState.finished = true; + } + } else { + this.allowHalfOpen = true; + } + } + ObjectDefineProperties(Duplex2.prototype, { + writable: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writable") + }, + writableHighWaterMark: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableHighWaterMark") + }, + writableObjectMode: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableObjectMode") + }, + writableBuffer: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableBuffer") + }, + writableLength: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableLength") + }, + writableFinished: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableFinished") + }, + writableCorked: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableCorked") + }, + writableEnded: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableEnded") + }, + writableNeedDrain: { + __proto__: null, + ...ObjectGetOwnPropertyDescriptor(Writable2.prototype, "writableNeedDrain") + }, + destroyed: { + __proto__: null, + get() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set(value2) { + if (this._readableState && this._writableState) { + this._readableState.destroyed = value2; + this._writableState.destroyed = value2; + } + } + } + }); + let webStreamsAdapters; + function lazyWebStreams() { + if (webStreamsAdapters === void 0) + webStreamsAdapters = {}; + return webStreamsAdapters; + } + Duplex2.fromWeb = function(pair, options) { + return lazyWebStreams().newStreamDuplexFromReadableWritablePair(pair, options); + }; + Duplex2.toWeb = function(duplex) { + return lazyWebStreams().newReadableWritablePairFromDuplex(duplex); + }; + let duplexify; + Duplex2.from = function(body) { + if (!duplexify) { + duplexify = dew$95(); + } + return duplexify(body, "body"); + }; + return exports$95; +} +function dew$76() { + if (_dewExec$76) + return exports$86; + _dewExec$76 = true; + const { + ObjectSetPrototypeOf, + Symbol: Symbol3 + } = dew$o2(); + exports$86 = Transform2; + const { + ERR_METHOD_NOT_IMPLEMENTED + } = dew$l2().codes; + const Duplex2 = dew$85(); + const { + getHighWaterMark + } = dew$d4(); + ObjectSetPrototypeOf(Transform2.prototype, Duplex2.prototype); + ObjectSetPrototypeOf(Transform2, Duplex2); + const kCallback = Symbol3("kCallback"); + function Transform2(options) { + if (!(this instanceof Transform2)) + return new Transform2(options); + const readableHighWaterMark = options ? getHighWaterMark(this, options, "readableHighWaterMark", true) : null; + if (readableHighWaterMark === 0) { + options = { + ...options, + highWaterMark: null, + readableHighWaterMark, + // TODO (ronag): 0 is not optimal since we have + // a "bug" where we check needDrain before calling _write and not after. + // Refs: https://github.com/nodejs/node/pull/32887 + // Refs: https://github.com/nodejs/node/pull/35941 + writableHighWaterMark: options.writableHighWaterMark || 0 + }; + } + Duplex2.call(this, options); + this._readableState.sync = false; + this[kCallback] = null; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function final(cb) { + if (typeof this._flush === "function" && !this.destroyed) { + this._flush((er, data) => { + if (er) { + if (cb) { + cb(er); + } else { + this.destroy(er); + } + return; + } + if (data != null) { + this.push(data); + } + this.push(null); + if (cb) { + cb(); + } + }); + } else { + this.push(null); + if (cb) { + cb(); + } + } + } + function prefinish() { + if (this._final !== final) { + final.call(this); + } + } + Transform2.prototype._final = final; + Transform2.prototype._transform = function(chunk2, encoding, callback) { + throw new ERR_METHOD_NOT_IMPLEMENTED("_transform()"); + }; + Transform2.prototype._write = function(chunk2, encoding, callback) { + const rState = this._readableState; + const wState = this._writableState; + const length = rState.length; + this._transform(chunk2, encoding, (err, val) => { + if (err) { + callback(err); + return; + } + if (val != null) { + this.push(val); + } + if (wState.ended || // Backwards compat. + length === rState.length || // Backwards compat. + rState.length < rState.highWaterMark) { + callback(); + } else { + this[kCallback] = callback; + } + }); + }; + Transform2.prototype._read = function() { + if (this[kCallback]) { + const callback = this[kCallback]; + this[kCallback] = null; + callback(); + } + }; + return exports$86; +} +function dew$66() { + if (_dewExec$66) + return exports$76; + _dewExec$66 = true; + const { + ObjectSetPrototypeOf + } = dew$o2(); + exports$76 = PassThrough2; + const Transform2 = dew$76(); + ObjectSetPrototypeOf(PassThrough2.prototype, Transform2.prototype); + ObjectSetPrototypeOf(PassThrough2, Transform2); + function PassThrough2(options) { + if (!(this instanceof PassThrough2)) + return new PassThrough2(options); + Transform2.call(this, options); + } + PassThrough2.prototype._transform = function(chunk2, encoding, cb) { + cb(null, chunk2); + }; + return exports$76; +} +function dew$56() { + if (_dewExec$56) + return exports$66; + _dewExec$56 = true; + const process$1 = process3; + const { + ArrayIsArray, + Promise: Promise3, + SymbolAsyncIterator, + SymbolDispose + } = dew$o2(); + const eos = dew$i3(); + const { + once: once5 + } = dew$m2(); + const destroyImpl = dew$h3(); + const Duplex2 = dew$85(); + const { + aggregateTwoErrors, + codes: { + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_INVALID_RETURN_VALUE, + ERR_MISSING_ARGS, + ERR_STREAM_DESTROYED, + ERR_STREAM_PREMATURE_CLOSE + }, + AbortError + } = dew$l2(); + const { + validateFunction, + validateAbortSignal + } = dew$k3(); + const { + isIterable, + isReadable, + isReadableNodeStream, + isNodeStream, + isTransformStream, + isWebStream, + isReadableStream, + isReadableFinished + } = dew$j3(); + const AbortController2 = globalThis.AbortController || dew$n2().AbortController; + let PassThrough2; + let Readable3; + let addAbortListener; + function destroyer(stream2, reading, writing) { + let finished2 = false; + stream2.on("close", () => { + finished2 = true; + }); + const cleanup = eos(stream2, { + readable: reading, + writable: writing + }, (err) => { + finished2 = !err; + }); + return { + destroy: (err) => { + if (finished2) + return; + finished2 = true; + destroyImpl.destroyer(stream2, err || new ERR_STREAM_DESTROYED("pipe")); + }, + cleanup + }; + } + function popCallback(streams) { + validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); + return streams.pop(); + } + function makeAsyncIterable(val) { + if (isIterable(val)) { + return val; + } else if (isReadableNodeStream(val)) { + return fromReadable(val); + } + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); + } + async function* fromReadable(val) { + if (!Readable3) { + Readable3 = dew$b5(); + } + yield* Readable3.prototype[SymbolAsyncIterator].call(val); + } + async function pumpToNode(iterable, writable, finish, { + end + }) { + let error2; + let onresolve = null; + const resume = (err) => { + if (err) { + error2 = err; + } + if (onresolve) { + const callback = onresolve; + onresolve = null; + callback(); + } + }; + const wait = () => new Promise3((resolve3, reject2) => { + if (error2) { + reject2(error2); + } else { + onresolve = () => { + if (error2) { + reject2(error2); + } else { + resolve3(); + } + }; + } + }); + writable.on("drain", resume); + const cleanup = eos(writable, { + readable: false + }, resume); + try { + if (writable.writableNeedDrain) { + await wait(); + } + for await (const chunk2 of iterable) { + if (!writable.write(chunk2)) { + await wait(); + } + } + if (end) { + writable.end(); + await wait(); + } + finish(); + } catch (err) { + finish(error2 !== err ? aggregateTwoErrors(error2, err) : err); + } finally { + cleanup(); + writable.off("drain", resume); + } + } + async function pumpToWeb(readable, writable, finish, { + end + }) { + if (isTransformStream(writable)) { + writable = writable.writable; + } + const writer = writable.getWriter(); + try { + for await (const chunk2 of readable) { + await writer.ready; + writer.write(chunk2).catch(() => { + }); + } + await writer.ready; + if (end) { + await writer.close(); + } + finish(); + } catch (err) { + try { + await writer.abort(err); + finish(err); + } catch (err2) { + finish(err2); + } + } + } + function pipeline2(...streams) { + return pipelineImpl(streams, once5(popCallback(streams))); + } + function pipelineImpl(streams, callback, opts) { + if (streams.length === 1 && ArrayIsArray(streams[0])) { + streams = streams[0]; + } + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + const ac = new AbortController2(); + const signal = ac.signal; + const outerSignal = opts === null || opts === void 0 ? void 0 : opts.signal; + const lastStreamCleanup = []; + validateAbortSignal(outerSignal, "options.signal"); + function abort3() { + finishImpl(new AbortError()); + } + addAbortListener = addAbortListener || dew$m2().addAbortListener; + let disposable; + if (outerSignal) { + disposable = addAbortListener(outerSignal, abort3); + } + let error2; + let value2; + const destroys = []; + let finishCount = 0; + function finish(err) { + finishImpl(err, --finishCount === 0); + } + function finishImpl(err, final) { + var _disposable; + if (err && (!error2 || error2.code === "ERR_STREAM_PREMATURE_CLOSE")) { + error2 = err; + } + if (!error2 && !final) { + return; + } + while (destroys.length) { + destroys.shift()(error2); + } + (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); + ac.abort(); + if (final) { + if (!error2) { + lastStreamCleanup.forEach((fn) => fn()); + } + process$1.nextTick(callback, error2, value2); + } + } + let ret; + for (let i7 = 0; i7 < streams.length; i7++) { + const stream2 = streams[i7]; + const reading = i7 < streams.length - 1; + const writing = i7 > 0; + const end = reading || (opts === null || opts === void 0 ? void 0 : opts.end) !== false; + const isLastStream = i7 === streams.length - 1; + if (isNodeStream(stream2)) { + let onError = function(err) { + if (err && err.name !== "AbortError" && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + finish(err); + } + }; + if (end) { + const { + destroy, + cleanup + } = destroyer(stream2, reading, writing); + destroys.push(destroy); + if (isReadable(stream2) && isLastStream) { + lastStreamCleanup.push(cleanup); + } + } + stream2.on("error", onError); + if (isReadable(stream2) && isLastStream) { + lastStreamCleanup.push(() => { + stream2.removeListener("error", onError); + }); + } + } + if (i7 === 0) { + if (typeof stream2 === "function") { + ret = stream2({ + signal + }); + if (!isIterable(ret)) { + throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or Stream", "source", ret); + } + } else if (isIterable(stream2) || isReadableNodeStream(stream2) || isTransformStream(stream2)) { + ret = stream2; + } else { + ret = Duplex2.from(stream2); + } + } else if (typeof stream2 === "function") { + if (isTransformStream(ret)) { + var _ret; + ret = makeAsyncIterable((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.readable); + } else { + ret = makeAsyncIterable(ret); + } + ret = stream2(ret, { + signal + }); + if (reading) { + if (!isIterable(ret, true)) { + throw new ERR_INVALID_RETURN_VALUE("AsyncIterable", `transform[${i7 - 1}]`, ret); + } + } else { + var _ret2; + if (!PassThrough2) { + PassThrough2 = dew$66(); + } + const pt = new PassThrough2({ + objectMode: true + }); + const then = (_ret2 = ret) === null || _ret2 === void 0 ? void 0 : _ret2.then; + if (typeof then === "function") { + finishCount++; + then.call(ret, (val) => { + value2 = val; + if (val != null) { + pt.write(val); + } + if (end) { + pt.end(); + } + process$1.nextTick(finish); + }, (err) => { + pt.destroy(err); + process$1.nextTick(finish, err); + }); + } else if (isIterable(ret, true)) { + finishCount++; + pumpToNode(ret, pt, finish, { + end + }); + } else if (isReadableStream(ret) || isTransformStream(ret)) { + const toRead = ret.readable || ret; + finishCount++; + pumpToNode(toRead, pt, finish, { + end + }); + } else { + throw new ERR_INVALID_RETURN_VALUE("AsyncIterable or Promise", "destination", ret); + } + ret = pt; + const { + destroy, + cleanup + } = destroyer(ret, false, true); + destroys.push(destroy); + if (isLastStream) { + lastStreamCleanup.push(cleanup); + } + } + } else if (isNodeStream(stream2)) { + if (isReadableNodeStream(ret)) { + finishCount += 2; + const cleanup = pipe(ret, stream2, finish, { + end + }); + if (isReadable(stream2) && isLastStream) { + lastStreamCleanup.push(cleanup); + } + } else if (isTransformStream(ret) || isReadableStream(ret)) { + const toRead = ret.readable || ret; + finishCount++; + pumpToNode(toRead, stream2, finish, { + end + }); + } else if (isIterable(ret)) { + finishCount++; + pumpToNode(ret, stream2, finish, { + end + }); + } else { + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], ret); + } + ret = stream2; + } else if (isWebStream(stream2)) { + if (isReadableNodeStream(ret)) { + finishCount++; + pumpToWeb(makeAsyncIterable(ret), stream2, finish, { + end + }); + } else if (isReadableStream(ret) || isIterable(ret)) { + finishCount++; + pumpToWeb(ret, stream2, finish, { + end + }); + } else if (isTransformStream(ret)) { + finishCount++; + pumpToWeb(ret.readable, stream2, finish, { + end + }); + } else { + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable", "ReadableStream", "TransformStream"], ret); + } + ret = stream2; + } else { + ret = Duplex2.from(stream2); + } + } + if (signal !== null && signal !== void 0 && signal.aborted || outerSignal !== null && outerSignal !== void 0 && outerSignal.aborted) { + process$1.nextTick(abort3); + } + return ret; + } + function pipe(src, dst, finish, { + end + }) { + let ended = false; + dst.on("close", () => { + if (!ended) { + finish(new ERR_STREAM_PREMATURE_CLOSE()); + } + }); + src.pipe(dst, { + end: false + }); + if (end) { + let endFn = function() { + ended = true; + dst.end(); + }; + if (isReadableFinished(src)) { + process$1.nextTick(endFn); + } else { + src.once("end", endFn); + } + } else { + finish(); + } + eos(src, { + readable: true, + writable: false + }, (err) => { + const rState = src._readableState; + if (err && err.code === "ERR_STREAM_PREMATURE_CLOSE" && rState && rState.ended && !rState.errored && !rState.errorEmitted) { + src.once("end", finish).once("error", finish); + } else { + finish(err); + } + }); + return eos(dst, { + readable: false, + writable: true + }, finish); + } + exports$66 = { + pipelineImpl, + pipeline: pipeline2 + }; + return exports$66; +} +function dew$46() { + if (_dewExec$46) + return exports$56; + _dewExec$46 = true; + const { + pipeline: pipeline2 + } = dew$56(); + const Duplex2 = dew$85(); + const { + destroyer + } = dew$h3(); + const { + isNodeStream, + isReadable, + isWritable, + isWebStream, + isTransformStream, + isWritableStream, + isReadableStream + } = dew$j3(); + const { + AbortError, + codes: { + ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, + ERR_MISSING_ARGS + } + } = dew$l2(); + const eos = dew$i3(); + exports$56 = function compose(...streams) { + if (streams.length === 0) { + throw new ERR_MISSING_ARGS("streams"); + } + if (streams.length === 1) { + return Duplex2.from(streams[0]); + } + const orgStreams = [...streams]; + if (typeof streams[0] === "function") { + streams[0] = Duplex2.from(streams[0]); + } + if (typeof streams[streams.length - 1] === "function") { + const idx = streams.length - 1; + streams[idx] = Duplex2.from(streams[idx]); + } + for (let n7 = 0; n7 < streams.length; ++n7) { + if (!isNodeStream(streams[n7]) && !isWebStream(streams[n7])) { + continue; + } + if (n7 < streams.length - 1 && !(isReadable(streams[n7]) || isReadableStream(streams[n7]) || isTransformStream(streams[n7]))) { + throw new ERR_INVALID_ARG_VALUE2(`streams[${n7}]`, orgStreams[n7], "must be readable"); + } + if (n7 > 0 && !(isWritable(streams[n7]) || isWritableStream(streams[n7]) || isTransformStream(streams[n7]))) { + throw new ERR_INVALID_ARG_VALUE2(`streams[${n7}]`, orgStreams[n7], "must be writable"); + } + } + let ondrain; + let onfinish; + let onreadable; + let onclose; + let d7; + function onfinished(err) { + const cb = onclose; + onclose = null; + if (cb) { + cb(err); + } else if (err) { + d7.destroy(err); + } else if (!readable && !writable) { + d7.destroy(); + } + } + const head2 = streams[0]; + const tail2 = pipeline2(streams, onfinished); + const writable = !!(isWritable(head2) || isWritableStream(head2) || isTransformStream(head2)); + const readable = !!(isReadable(tail2) || isReadableStream(tail2) || isTransformStream(tail2)); + d7 = new Duplex2({ + // TODO (ronag): highWaterMark? + writableObjectMode: !!(head2 !== null && head2 !== void 0 && head2.writableObjectMode), + readableObjectMode: !!(tail2 !== null && tail2 !== void 0 && tail2.readableObjectMode), + writable, + readable + }); + if (writable) { + if (isNodeStream(head2)) { + d7._write = function(chunk2, encoding, callback) { + if (head2.write(chunk2, encoding)) { + callback(); + } else { + ondrain = callback; + } + }; + d7._final = function(callback) { + head2.end(); + onfinish = callback; + }; + head2.on("drain", function() { + if (ondrain) { + const cb = ondrain; + ondrain = null; + cb(); + } + }); + } else if (isWebStream(head2)) { + const writable2 = isTransformStream(head2) ? head2.writable : head2; + const writer = writable2.getWriter(); + d7._write = async function(chunk2, encoding, callback) { + try { + await writer.ready; + writer.write(chunk2).catch(() => { + }); + callback(); + } catch (err) { + callback(err); + } + }; + d7._final = async function(callback) { + try { + await writer.ready; + writer.close().catch(() => { + }); + onfinish = callback; + } catch (err) { + callback(err); + } + }; + } + const toRead = isTransformStream(tail2) ? tail2.readable : tail2; + eos(toRead, () => { + if (onfinish) { + const cb = onfinish; + onfinish = null; + cb(); + } + }); + } + if (readable) { + if (isNodeStream(tail2)) { + tail2.on("readable", function() { + if (onreadable) { + const cb = onreadable; + onreadable = null; + cb(); + } + }); + tail2.on("end", function() { + d7.push(null); + }); + d7._read = function() { + while (true) { + const buf = tail2.read(); + if (buf === null) { + onreadable = d7._read; + return; + } + if (!d7.push(buf)) { + return; + } + } + }; + } else if (isWebStream(tail2)) { + const readable2 = isTransformStream(tail2) ? tail2.readable : tail2; + const reader = readable2.getReader(); + d7._read = async function() { + while (true) { + try { + const { + value: value2, + done + } = await reader.read(); + if (!d7.push(value2)) { + return; + } + if (done) { + d7.push(null); + return; + } + } catch { + return; + } + } + }; + } + } + d7._destroy = function(err, callback) { + if (!err && onclose !== null) { + err = new AbortError(); + } + onreadable = null; + ondrain = null; + onfinish = null; + if (onclose === null) { + callback(err); + } else { + onclose = callback; + if (isNodeStream(tail2)) { + destroyer(tail2, err); + } + } + }; + return d7; + }; + return exports$56; +} +function dew$311() { + if (_dewExec$311) + return exports$46; + _dewExec$311 = true; + const AbortController2 = globalThis.AbortController || dew$n2().AbortController; + const { + codes: { + ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, + ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, + ERR_MISSING_ARGS, + ERR_OUT_OF_RANGE + }, + AbortError + } = dew$l2(); + const { + validateAbortSignal, + validateInteger, + validateObject + } = dew$k3(); + const kWeakHandler = dew$o2().Symbol("kWeak"); + const kResistStopPropagation = dew$o2().Symbol("kResistStopPropagation"); + const { + finished: finished2 + } = dew$i3(); + const staticCompose = dew$46(); + const { + addAbortSignalNoValidate + } = dew$f4(); + const { + isWritable, + isNodeStream + } = dew$j3(); + const { + deprecate: deprecate2 + } = dew$m2(); + const { + ArrayPrototypePush, + Boolean: Boolean2, + MathFloor, + Number: Number2, + NumberIsNaN, + Promise: Promise3, + PromiseReject, + PromiseResolve, + PromisePrototypeThen, + Symbol: Symbol3 + } = dew$o2(); + const kEmpty = Symbol3("kEmpty"); + const kEof = Symbol3("kEof"); + function compose(stream2, options) { + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + if (isNodeStream(stream2) && !isWritable(stream2)) { + throw new ERR_INVALID_ARG_VALUE2("stream", stream2, "must be writable"); + } + const composedStream = staticCompose(this, stream2); + if (options !== null && options !== void 0 && options.signal) { + addAbortSignalNoValidate(options.signal, composedStream); + } + return composedStream; + } + function map4(fn, options) { + if (typeof fn !== "function") { + throw new ERR_INVALID_ARG_TYPE2("fn", ["Function", "AsyncFunction"], fn); + } + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + let concurrency = 1; + if ((options === null || options === void 0 ? void 0 : options.concurrency) != null) { + concurrency = MathFloor(options.concurrency); + } + let highWaterMark = concurrency - 1; + if ((options === null || options === void 0 ? void 0 : options.highWaterMark) != null) { + highWaterMark = MathFloor(options.highWaterMark); + } + validateInteger(concurrency, "options.concurrency", 1); + validateInteger(highWaterMark, "options.highWaterMark", 0); + highWaterMark += concurrency; + return async function* map5() { + const signal = dew$m2().AbortSignalAny([options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2)); + const stream2 = this; + const queue3 = []; + const signalOpt = { + signal + }; + let next; + let resume; + let done = false; + let cnt = 0; + function onCatch() { + done = true; + afterItemProcessed(); + } + function afterItemProcessed() { + cnt -= 1; + maybeResume(); + } + function maybeResume() { + if (resume && !done && cnt < concurrency && queue3.length < highWaterMark) { + resume(); + resume = null; + } + } + async function pump() { + try { + for await (let val of stream2) { + if (done) { + return; + } + if (signal.aborted) { + throw new AbortError(); + } + try { + val = fn(val, signalOpt); + if (val === kEmpty) { + continue; + } + val = PromiseResolve(val); + } catch (err) { + val = PromiseReject(err); + } + cnt += 1; + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue3.push(val); + if (next) { + next(); + next = null; + } + if (!done && (queue3.length >= highWaterMark || cnt >= concurrency)) { + await new Promise3((resolve3) => { + resume = resolve3; + }); + } + } + queue3.push(kEof); + } catch (err) { + const val = PromiseReject(err); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue3.push(val); + } finally { + done = true; + if (next) { + next(); + next = null; + } + } + } + pump(); + try { + while (true) { + while (queue3.length > 0) { + const val = await queue3[0]; + if (val === kEof) { + return; + } + if (signal.aborted) { + throw new AbortError(); + } + if (val !== kEmpty) { + yield val; + } + queue3.shift(); + maybeResume(); + } + await new Promise3((resolve3) => { + next = resolve3; + }); + } + } finally { + done = true; + if (resume) { + resume(); + resume = null; + } + } + }.call(this); + } + function asIndexedPairs(options = void 0) { + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + return async function* asIndexedPairs2() { + let index4 = 0; + for await (const val of this) { + var _options$signal; + if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { + throw new AbortError({ + cause: options.signal.reason + }); + } + yield [index4++, val]; + } + }.call(this); + } + async function some2(fn, options = void 0) { + for await (const unused of filter2.call(this, fn, options)) { + return true; + } + return false; + } + async function every2(fn, options = void 0) { + if (typeof fn !== "function") { + throw new ERR_INVALID_ARG_TYPE2("fn", ["Function", "AsyncFunction"], fn); + } + return !await some2.call(this, async (...args) => { + return !await fn(...args); + }, options); + } + async function find2(fn, options) { + for await (const result2 of filter2.call(this, fn, options)) { + return result2; + } + return void 0; + } + async function forEach4(fn, options) { + if (typeof fn !== "function") { + throw new ERR_INVALID_ARG_TYPE2("fn", ["Function", "AsyncFunction"], fn); + } + async function forEachFn(value2, options2) { + await fn(value2, options2); + return kEmpty; + } + for await (const unused of map4.call(this, forEachFn, options)) + ; + } + function filter2(fn, options) { + if (typeof fn !== "function") { + throw new ERR_INVALID_ARG_TYPE2("fn", ["Function", "AsyncFunction"], fn); + } + async function filterFn(value2, options2) { + if (await fn(value2, options2)) { + return value2; + } + return kEmpty; + } + return map4.call(this, filterFn, options); + } + class ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS { + constructor() { + super("reduce"); + this.message = "Reduce of an empty stream requires an initial value"; + } + } + async function reduce2(reducer, initialValue, options) { + var _options$signal2; + if (typeof reducer !== "function") { + throw new ERR_INVALID_ARG_TYPE2("reducer", ["Function", "AsyncFunction"], reducer); + } + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + let hasInitialValue = arguments.length > 1; + if (options !== null && options !== void 0 && (_options$signal2 = options.signal) !== null && _options$signal2 !== void 0 && _options$signal2.aborted) { + const err = new AbortError(void 0, { + cause: options.signal.reason + }); + this.once("error", () => { + }); + await finished2(this.destroy(err)); + throw err; + } + const ac = new AbortController2(); + const signal = ac.signal; + if (options !== null && options !== void 0 && options.signal) { + const opts = { + once: true, + [kWeakHandler]: this, + [kResistStopPropagation]: true + }; + options.signal.addEventListener("abort", () => ac.abort(), opts); + } + let gotAnyItemFromStream = false; + try { + for await (const value2 of this) { + var _options$signal3; + gotAnyItemFromStream = true; + if (options !== null && options !== void 0 && (_options$signal3 = options.signal) !== null && _options$signal3 !== void 0 && _options$signal3.aborted) { + throw new AbortError(); + } + if (!hasInitialValue) { + initialValue = value2; + hasInitialValue = true; + } else { + initialValue = await reducer(initialValue, value2, { + signal + }); + } + } + if (!gotAnyItemFromStream && !hasInitialValue) { + throw new ReduceAwareErrMissingArgs(); + } + } finally { + ac.abort(); + } + return initialValue; + } + async function toArray3(options) { + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + const result2 = []; + for await (const val of this) { + var _options$signal4; + if (options !== null && options !== void 0 && (_options$signal4 = options.signal) !== null && _options$signal4 !== void 0 && _options$signal4.aborted) { + throw new AbortError(void 0, { + cause: options.signal.reason + }); + } + ArrayPrototypePush(result2, val); + } + return result2; + } + function flatMap2(fn, options) { + const values2 = map4.call(this, fn, options); + return async function* flatMap3() { + for await (const val of values2) { + yield* val; + } + }.call(this); + } + function toIntegerOrInfinity(number) { + number = Number2(number); + if (NumberIsNaN(number)) { + return 0; + } + if (number < 0) { + throw new ERR_OUT_OF_RANGE("number", ">= 0", number); + } + return number; + } + function drop2(number, options = void 0) { + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + number = toIntegerOrInfinity(number); + return async function* drop3() { + var _options$signal5; + if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { + throw new AbortError(); + } + for await (const val of this) { + var _options$signal6; + if (options !== null && options !== void 0 && (_options$signal6 = options.signal) !== null && _options$signal6 !== void 0 && _options$signal6.aborted) { + throw new AbortError(); + } + if (number-- <= 0) { + yield val; + } + } + }.call(this); + } + function take2(number, options = void 0) { + if (options != null) { + validateObject(options, "options"); + } + if ((options === null || options === void 0 ? void 0 : options.signal) != null) { + validateAbortSignal(options.signal, "options.signal"); + } + number = toIntegerOrInfinity(number); + return async function* take3() { + var _options$signal7; + if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { + throw new AbortError(); + } + for await (const val of this) { + var _options$signal8; + if (options !== null && options !== void 0 && (_options$signal8 = options.signal) !== null && _options$signal8 !== void 0 && _options$signal8.aborted) { + throw new AbortError(); + } + if (number-- > 0) { + yield val; + } + if (number <= 0) { + return; + } + } + }.call(this); + } + exports$46.streamReturningOperators = { + asIndexedPairs: deprecate2(asIndexedPairs, "readable.asIndexedPairs will be removed in a future version."), + drop: drop2, + filter: filter2, + flatMap: flatMap2, + map: map4, + take: take2, + compose + }; + exports$46.promiseReturningOperators = { + every: every2, + forEach: forEach4, + reduce: reduce2, + toArray: toArray3, + some: some2, + find: find2 + }; + return exports$46; +} +function dew$211() { + if (_dewExec$211) + return exports$311; + _dewExec$211 = true; + const { + ArrayPrototypePop, + Promise: Promise3 + } = dew$o2(); + const { + isIterable, + isNodeStream, + isWebStream + } = dew$j3(); + const { + pipelineImpl: pl + } = dew$56(); + const { + finished: finished2 + } = dew$i3(); + dew$111(); + function pipeline2(...streams) { + return new Promise3((resolve3, reject2) => { + let signal; + let end; + const lastArg = streams[streams.length - 1]; + if (lastArg && typeof lastArg === "object" && !isNodeStream(lastArg) && !isIterable(lastArg) && !isWebStream(lastArg)) { + const options = ArrayPrototypePop(streams); + signal = options.signal; + end = options.end; + } + pl(streams, (err, value2) => { + if (err) { + reject2(err); + } else { + resolve3(value2); + } + }, { + signal, + end + }); + }); + } + exports$311 = { + finished: finished2, + pipeline: pipeline2 + }; + return exports$311; +} +function dew$111() { + if (_dewExec$111) + return exports$211; + _dewExec$111 = true; + const { + Buffer: Buffer4 + } = dew(); + const { + ObjectDefineProperty, + ObjectKeys, + ReflectApply + } = dew$o2(); + const { + promisify: { + custom: customPromisify + } + } = dew$m2(); + const { + streamReturningOperators, + promiseReturningOperators + } = dew$311(); + const { + codes: { + ERR_ILLEGAL_CONSTRUCTOR + } + } = dew$l2(); + const compose = dew$46(); + const { + setDefaultHighWaterMark, + getDefaultHighWaterMark + } = dew$d4(); + const { + pipeline: pipeline2 + } = dew$56(); + const { + destroyer + } = dew$h3(); + const eos = dew$i3(); + const promises3 = dew$211(); + const utils = dew$j3(); + const Stream2 = exports$211 = dew$g4().Stream; + Stream2.isDestroyed = utils.isDestroyed; + Stream2.isDisturbed = utils.isDisturbed; + Stream2.isErrored = utils.isErrored; + Stream2.isReadable = utils.isReadable; + Stream2.isWritable = utils.isWritable; + Stream2.Readable = dew$b5(); + for (const key of ObjectKeys(streamReturningOperators)) { + let fn = function(...args) { + if (new.target) { + throw ERR_ILLEGAL_CONSTRUCTOR(); + } + return Stream2.Readable.from(ReflectApply(op, this || _global9, args)); + }; + const op = streamReturningOperators[key]; + ObjectDefineProperty(fn, "name", { + __proto__: null, + value: op.name + }); + ObjectDefineProperty(fn, "length", { + __proto__: null, + value: op.length + }); + ObjectDefineProperty(Stream2.Readable.prototype, key, { + __proto__: null, + value: fn, + enumerable: false, + configurable: true, + writable: true + }); + } + for (const key of ObjectKeys(promiseReturningOperators)) { + let fn = function(...args) { + if (new.target) { + throw ERR_ILLEGAL_CONSTRUCTOR(); + } + return ReflectApply(op, this || _global9, args); + }; + const op = promiseReturningOperators[key]; + ObjectDefineProperty(fn, "name", { + __proto__: null, + value: op.name + }); + ObjectDefineProperty(fn, "length", { + __proto__: null, + value: op.length + }); + ObjectDefineProperty(Stream2.Readable.prototype, key, { + __proto__: null, + value: fn, + enumerable: false, + configurable: true, + writable: true + }); + } + Stream2.Writable = dew$a5(); + Stream2.Duplex = dew$85(); + Stream2.Transform = dew$76(); + Stream2.PassThrough = dew$66(); + Stream2.pipeline = pipeline2; + const { + addAbortSignal + } = dew$f4(); + Stream2.addAbortSignal = addAbortSignal; + Stream2.finished = eos; + Stream2.destroy = destroyer; + Stream2.compose = compose; + Stream2.setDefaultHighWaterMark = setDefaultHighWaterMark; + Stream2.getDefaultHighWaterMark = getDefaultHighWaterMark; + ObjectDefineProperty(Stream2, "promises", { + __proto__: null, + configurable: true, + enumerable: true, + get() { + return promises3; + } + }); + ObjectDefineProperty(pipeline2, customPromisify, { + __proto__: null, + enumerable: true, + get() { + return promises3.pipeline; + } + }); + ObjectDefineProperty(eos, customPromisify, { + __proto__: null, + enumerable: true, + get() { + return promises3.finished; + } + }); + Stream2.Stream = Stream2; + Stream2._isUint8Array = function isUint8Array(value2) { + return value2 instanceof Uint8Array; + }; + Stream2._uint8ArrayToBuffer = function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2.buffer, chunk2.byteOffset, chunk2.byteLength); + }; + return exports$211; +} +function dew17() { + if (_dewExec17) + return exports$113; + _dewExec17 = true; + const CustomStream = dew$111(); + const promises3 = dew$211(); + const originalDestroy = CustomStream.Readable.destroy; + exports$113 = CustomStream.Readable; + exports$113._uint8ArrayToBuffer = CustomStream._uint8ArrayToBuffer; + exports$113._isUint8Array = CustomStream._isUint8Array; + exports$113.isDisturbed = CustomStream.isDisturbed; + exports$113.isErrored = CustomStream.isErrored; + exports$113.isReadable = CustomStream.isReadable; + exports$113.Readable = CustomStream.Readable; + exports$113.Writable = CustomStream.Writable; + exports$113.Duplex = CustomStream.Duplex; + exports$113.Transform = CustomStream.Transform; + exports$113.PassThrough = CustomStream.PassThrough; + exports$113.addAbortSignal = CustomStream.addAbortSignal; + exports$113.finished = CustomStream.finished; + exports$113.destroy = CustomStream.destroy; + exports$113.destroy = originalDestroy; + exports$113.pipeline = CustomStream.pipeline; + exports$113.compose = CustomStream.compose; + Object.defineProperty(CustomStream, "promises", { + configurable: true, + enumerable: true, + get() { + return promises3; + } + }); + exports$113.Stream = CustomStream.Stream; + exports$113.default = exports$113; + return exports$113; +} +var exports$p2, _dewExec$o2, exports$o2, _dewExec$n2, exports$n2, _dewExec$m2, exports$m2, _dewExec$l2, exports$l2, _dewExec$k3, exports$k3, _dewExec$j3, exports$j3, _dewExec$i3, exports$i3, _dewExec$h3, exports$h3, _dewExec$g4, exports$g4, _dewExec$f4, exports$f4, _dewExec$e4, exports$e4, _dewExec$d4, exports$d4, _dewExec$c4, exports$c5, _dewExec$b5, _global$24, exports$b5, _dewExec$a5, _global$111, exports$a5, _dewExec$95, exports$95, _dewExec$85, exports$86, _dewExec$76, exports$76, _dewExec$66, exports$66, _dewExec$56, exports$56, _dewExec$46, exports$46, _dewExec$311, exports$311, _dewExec$211, exports$211, _dewExec$111, _global9, exports$113, _dewExec17, exports20, Readable2, Writable, Duplex, Transform, PassThrough, finished, pipeline, Stream, promises2; +var init_stream = __esm({ + "node_modules/@jspm/core/nodelibs/browser/stream.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtuTasat(); + init_events(); + init_chunk_DEMDiNwt(); + init_chunk_CcCWfKp1(); + init_util2(); + init_chunk_DtcTpLWz(); + init_chunk_CkFCi_G1(); + exports$p2 = {}; + _dewExec$o2 = false; + exports$o2 = {}; + _dewExec$n2 = false; + exports$n2 = {}; + _dewExec$m2 = false; + exports$m2 = {}; + _dewExec$l2 = false; + exports$l2 = {}; + _dewExec$k3 = false; + exports$k3 = {}; + _dewExec$j3 = false; + exports$j3 = {}; + _dewExec$i3 = false; + exports$i3 = {}; + _dewExec$h3 = false; + exports$h3 = {}; + _dewExec$g4 = false; + exports$g4 = {}; + _dewExec$f4 = false; + exports$f4 = {}; + _dewExec$e4 = false; + exports$e4 = {}; + _dewExec$d4 = false; + exports$d4 = {}; + _dewExec$c4 = false; + exports$c5 = {}; + _dewExec$b5 = false; + _global$24 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$b5 = {}; + _dewExec$a5 = false; + _global$111 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$a5 = {}; + _dewExec$95 = false; + exports$95 = {}; + _dewExec$85 = false; + exports$86 = {}; + _dewExec$76 = false; + exports$76 = {}; + _dewExec$66 = false; + exports$66 = {}; + _dewExec$56 = false; + exports$56 = {}; + _dewExec$46 = false; + exports$46 = {}; + _dewExec$311 = false; + exports$311 = {}; + _dewExec$211 = false; + exports$211 = {}; + _dewExec$111 = false; + _global9 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$113 = {}; + _dewExec17 = false; + exports20 = dew17(); + exports20["_uint8ArrayToBuffer"]; + exports20["_isUint8Array"]; + exports20["isDisturbed"]; + exports20["isErrored"]; + exports20["isReadable"]; + exports20["Readable"]; + exports20["Writable"]; + exports20["Duplex"]; + exports20["Transform"]; + exports20["PassThrough"]; + exports20["addAbortSignal"]; + exports20["finished"]; + exports20["destroy"]; + exports20["pipeline"]; + exports20["compose"]; + exports20["Stream"]; + Readable2 = exports20.Readable; + Readable2.wrap = function(src, options) { + options = Object.assign({ objectMode: src.readableObjectMode != null || src.objectMode != null || true }, options); + options.destroy = function(err, callback) { + src.destroy(err); + callback(err); + }; + return new Readable2(options).wrap(src); + }; + Writable = exports20.Writable; + Duplex = exports20.Duplex; + Transform = exports20.Transform; + PassThrough = exports20.PassThrough; + finished = exports20.finished; + pipeline = exports20.pipeline; + Stream = exports20.Stream; + promises2 = { + finished: promisify(exports20.finished), + pipeline: promisify(exports20.pipeline) + }; + } +}); + +// node_modules/avsc/lib/services.js +var require_services = __commonJS({ + "node_modules/avsc/lib/services.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var types3 = require_types7(); + var utils = require_utils8(); + var buffer2 = (init_buffer(), __toCommonJS(buffer_exports)); + var events = (init_events(), __toCommonJS(events_exports)); + var stream2 = (init_stream(), __toCommonJS(stream_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var Buffer4 = buffer2.Buffer; + var Tap = utils.Tap; + var Type3 = types3.Type; + var debug2 = util2.debuglog("avsc:services"); + var f8 = util2.format; + var OPTS = { namespace: "org.apache.avro.ipc" }; + var BOOLEAN_TYPE = Type3.forSchema("boolean", OPTS); + var MAP_BYTES_TYPE = Type3.forSchema({ type: "map", values: "bytes" }, OPTS); + var STRING_TYPE = Type3.forSchema("string", OPTS); + var HANDSHAKE_REQUEST_TYPE = Type3.forSchema({ + name: "HandshakeRequest", + type: "record", + fields: [ + { name: "clientHash", type: { name: "MD5", type: "fixed", size: 16 } }, + { name: "clientProtocol", type: ["null", "string"], "default": null }, + { name: "serverHash", type: "MD5" }, + { name: "meta", type: ["null", MAP_BYTES_TYPE], "default": null } + ] + }, OPTS); + var HANDSHAKE_RESPONSE_TYPE = Type3.forSchema({ + name: "HandshakeResponse", + type: "record", + fields: [ + { + name: "match", + type: { + name: "HandshakeMatch", + type: "enum", + symbols: ["BOTH", "CLIENT", "NONE"] + } + }, + { name: "serverProtocol", type: ["null", "string"], "default": null }, + { name: "serverHash", type: ["null", "MD5"], "default": null }, + { name: "meta", type: ["null", MAP_BYTES_TYPE], "default": null } + ] + }, OPTS); + var PREFIX_LENGTH = 16; + var PING_MESSAGE = new Message7( + "", + // Empty name (invalid for other "normal" messages). + Type3.forSchema({ name: "PingRequest", type: "record", fields: [] }, OPTS), + Type3.forSchema(["string"], OPTS), + Type3.forSchema("null", OPTS) + ); + function Message7(name2, reqType, errType, resType, oneWay, doc) { + this.name = name2; + if (!Type3.isType(reqType, "record")) { + throw new Error("invalid request type"); + } + this.requestType = reqType; + if (!Type3.isType(errType, "union") || !Type3.isType(errType.getTypes()[0], "string")) { + throw new Error("invalid error type"); + } + this.errorType = errType; + if (oneWay) { + if (!Type3.isType(resType, "null") || errType.getTypes().length > 1) { + throw new Error("inapplicable one-way parameter"); + } + } + this.responseType = resType; + this.oneWay = !!oneWay; + this.doc = doc !== void 0 ? "" + doc : void 0; + Object.freeze(this); + } + Message7.forSchema = function(name2, schema8, opts) { + opts = opts || {}; + if (!utils.isValidName(name2)) { + throw new Error(f8("invalid message name: %s", name2)); + } + if (!Array.isArray(schema8.request)) { + throw new Error(f8("invalid message request: %s", name2)); + } + var recordName = f8("%s.%sRequest", OPTS.namespace, utils.capitalize(name2)); + var reqType = Type3.forSchema({ + name: recordName, + type: "record", + namespace: opts.namespace || "", + // Don't leak request namespace. + fields: schema8.request + }, opts); + delete opts.registry[recordName]; + if (!schema8.response) { + throw new Error(f8("invalid message response: %s", name2)); + } + var resType = Type3.forSchema(schema8.response, opts); + if (schema8.errors !== void 0 && !Array.isArray(schema8.errors)) { + throw new Error(f8("invalid message errors: %s", name2)); + } + var errType = Type3.forSchema(["string"].concat(schema8.errors || []), opts); + var oneWay = !!schema8["one-way"]; + return new Message7(name2, reqType, errType, resType, oneWay, schema8.doc); + }; + Message7.prototype.schema = Type3.prototype.getSchema; + Message7.prototype._attrs = function(opts) { + var reqSchema = this.requestType._attrs(opts); + var schema8 = { + request: reqSchema.fields, + response: this.responseType._attrs(opts) + }; + var msgDoc = this.doc; + if (msgDoc !== void 0) { + schema8.doc = msgDoc; + } + var errSchema = this.errorType._attrs(opts); + if (errSchema.length > 1) { + schema8.errors = errSchema.slice(1); + } + if (this.oneWay) { + schema8["one-way"] = true; + } + return schema8; + }; + utils.addDeprecatedGetters( + Message7, + ["name", "errorType", "requestType", "responseType"] + ); + Message7.prototype.isOneWay = util2.deprecate( + function() { + return this.oneWay; + }, + "use `.oneWay` directly instead of `.isOneWay()`" + ); + function Service(name2, messages, types4, ptcl, server) { + if (typeof name2 != "string") { + return Service.forProtocol(name2, messages); + } + this.name = name2; + this._messagesByName = messages || {}; + this.messages = Object.freeze(utils.objectValues(this._messagesByName)); + this._typesByName = types4 || {}; + this.types = Object.freeze(utils.objectValues(this._typesByName)); + this.protocol = ptcl; + this._hashStr = utils.getHash(JSON.stringify(ptcl)).toString("binary"); + this.doc = ptcl.doc ? "" + ptcl.doc : void 0; + this._server = server || this.createServer({ silent: true }); + Object.freeze(this); + } + Service.Client = Client; + Service.Server = Server7; + Service.compatible = function(clientSvc, serverSvc) { + try { + createReaders(clientSvc, serverSvc); + } catch (err) { + return false; + } + return true; + }; + Service.forProtocol = function(ptcl, opts) { + opts = opts || {}; + var name2 = ptcl.protocol; + if (!name2) { + throw new Error("missing protocol name"); + } + if (ptcl.namespace !== void 0) { + opts.namespace = ptcl.namespace; + } else { + var match = /^(.*)\.[^.]+$/.exec(name2); + if (match) { + opts.namespace = match[1]; + } + } + name2 = utils.qualify(name2, opts.namespace); + if (ptcl.types) { + ptcl.types.forEach(function(obj) { + Type3.forSchema(obj, opts); + }); + } + var msgs; + if (ptcl.messages) { + msgs = {}; + Object.keys(ptcl.messages).forEach(function(key) { + msgs[key] = Message7.forSchema(key, ptcl.messages[key], opts); + }); + } + return new Service(name2, msgs, opts.registry, ptcl); + }; + Service.isService = function(any) { + return !!any && any.hasOwnProperty("_hashStr"); + }; + Service.prototype.createClient = function(opts) { + var client = new Client(this, opts); + process.nextTick(function() { + if (opts && opts.server) { + var obj = { objectMode: true }; + var pts = [new stream2.PassThrough(obj), new stream2.PassThrough(obj)]; + opts.server.createChannel({ readable: pts[0], writable: pts[1] }, obj); + client.createChannel({ readable: pts[1], writable: pts[0] }, obj); + } else if (opts && opts.transport) { + client.createChannel(opts.transport); + } + }); + return client; + }; + Service.prototype.createServer = function(opts) { + return new Server7(this, opts); + }; + Object.defineProperty(Service.prototype, "hash", { + enumerable: true, + get: function() { + return utils.bufferFrom(this._hashStr, "binary"); + } + }); + Service.prototype.message = function(name2) { + return this._messagesByName[name2]; + }; + Service.prototype.type = function(name2) { + return this._typesByName[name2]; + }; + Service.prototype.inspect = function() { + return f8("", this.name); + }; + utils.addDeprecatedGetters( + Service, + ["message", "messages", "name", "type", "types"] + ); + Service.prototype.createEmitter = util2.deprecate( + function(transport, opts) { + opts = opts || {}; + var client = this.createClient({ + cache: opts.cache, + buffering: false, + strictTypes: opts.strictErrors, + timeout: opts.timeout + }); + var channel = client.createChannel(transport, opts); + forwardErrors(client, channel); + return channel; + }, + "use `.createClient()` instead of `.createEmitter()`" + ); + Service.prototype.createListener = util2.deprecate( + function(transport, opts) { + if (opts && opts.strictErrors) { + throw new Error("use `.createServer()` to support strict errors"); + } + return this._server.createChannel(transport, opts); + }, + "use `.createServer().createChannel()` instead of `.createListener()`" + ); + Service.prototype.emit = util2.deprecate( + function(name2, req, channel, cb) { + if (!channel || !this.equals(channel.client._svc$)) { + throw new Error("invalid emitter"); + } + var client = channel.client; + Client.prototype.emitMessage.call(client, name2, req, cb && cb.bind(this)); + return channel.getPending(); + }, + "create a client via `.createClient()` to emit messages instead of `.emit()`" + ); + Service.prototype.equals = util2.deprecate( + function(any) { + return Service.isService(any) && this.getFingerprint().equals(any.getFingerprint()); + }, + "equality testing is deprecated, compare the `.protocol`s instead" + ); + Service.prototype.getFingerprint = util2.deprecate( + function(algorithm) { + return utils.getHash(JSON.stringify(this.protocol), algorithm); + }, + "use `.hash` instead of `.getFingerprint()`" + ); + Service.prototype.getSchema = util2.deprecate( + Type3.prototype.getSchema, + "use `.protocol` instead of `.getSchema()`" + ); + Service.prototype.on = util2.deprecate( + function(name2, handler) { + var self2 = this; + this._server.onMessage(name2, function(req, cb) { + return handler.call(self2, req, this.channel, cb); + }); + return this; + }, + "use `.createServer().onMessage()` instead of `.on()`" + ); + Service.prototype.subprotocol = util2.deprecate( + function() { + var parent2 = this._server; + var opts = { strictTypes: parent2._strict, cache: parent2._cache }; + var server = new Server7(parent2.service, opts); + server._handlers = Object.create(parent2._handlers); + return new Service( + this.name, + this._messagesByName, + this._typesByName, + this.protocol, + server + ); + }, + "`.subprotocol()` will be removed in 5.1" + ); + Service.prototype._attrs = function(opts) { + var ptcl = { protocol: this.name }; + var types4 = []; + this.types.forEach(function(t8) { + if (t8.getName() === void 0) { + return; + } + var typeSchema = t8._attrs(opts); + if (typeof typeSchema != "string") { + types4.push(typeSchema); + } + }); + if (types4.length) { + ptcl.types = types4; + } + var msgNames = Object.keys(this._messagesByName); + if (msgNames.length) { + ptcl.messages = {}; + msgNames.forEach(function(name2) { + ptcl.messages[name2] = this._messagesByName[name2]._attrs(opts); + }, this); + } + if (opts && opts.exportAttrs && this.doc !== void 0) { + ptcl.doc = this.doc; + } + return ptcl; + }; + function discoverProtocol(transport, opts, cb) { + if (cb === void 0 && typeof opts == "function") { + cb = opts; + opts = void 0; + } + var svc = new Service({ protocol: "Empty" }, OPTS); + var ptclStr; + svc.createClient({ timeout: opts && opts.timeout }).createChannel(transport, { + scope: opts && opts.scope, + endWritable: typeof transport == "function" + // Stateless transports only. + }).once("handshake", function(hreq, hres) { + ptclStr = hres.serverProtocol; + this.destroy(true); + }).once("eot", function(pending, err) { + if (err && !/interrupted/.test(err)) { + cb(err); + } else { + cb(null, JSON.parse(ptclStr)); + } + }); + } + function Client(svc, opts) { + opts = opts || {}; + events.EventEmitter.call(this); + this._svc$ = svc; + this._channels$ = []; + this._fns$ = []; + this._buffering$ = !!opts.buffering; + this._cache$ = opts.cache || {}; + this._policy$ = opts.channelPolicy; + this._strict$ = !!opts.strictTypes; + this._timeout$ = utils.getOption(opts, "timeout", 1e4); + if (opts.remoteProtocols) { + insertRemoteProtocols(this._cache$, opts.remoteProtocols, svc, true); + } + this._svc$.messages.forEach(function(msg) { + this[msg.name] = this._createMessageHandler$(msg); + }, this); + } + util2.inherits(Client, events.EventEmitter); + Client.prototype.activeChannels = function() { + return this._channels$.slice(); + }; + Client.prototype.createChannel = function(transport, opts) { + var objectMode = opts && opts.objectMode; + var channel; + if (typeof transport == "function") { + var writableFactory; + if (objectMode) { + writableFactory = transport; + } else { + writableFactory = function(cb) { + var encoder2 = new FrameEncoder(); + var writable2 = transport(function(err, readable2) { + if (err) { + cb(err); + return; + } + var decoder2 = new FrameDecoder().once("error", function(err2) { + channel.destroy(err2); + }); + cb(null, readable2.pipe(decoder2)); + }); + if (writable2) { + encoder2.pipe(writable2); + return encoder2; + } + }; + } + channel = new StatelessClientChannel(this, writableFactory, opts); + } else { + var readable, writable; + if (isStream(transport)) { + readable = writable = transport; + } else { + readable = transport.readable; + writable = transport.writable; + } + if (!objectMode) { + var decoder = new NettyDecoder(); + readable = readable.pipe(decoder); + var encoder = new NettyEncoder(); + encoder.pipe(writable); + writable = encoder; + } + channel = new StatefulClientChannel(this, readable, writable, opts); + if (!objectMode) { + channel.once("eot", function() { + readable.unpipe(decoder); + encoder.unpipe(writable); + }); + decoder.once("error", function(err) { + channel.destroy(err); + }); + } + } + var channels = this._channels$; + channels.push(channel); + channel.once("_drain", function() { + channels.splice(channels.indexOf(this), 1); + }); + this._buffering$ = false; + this.emit("channel", channel); + return channel; + }; + Client.prototype.destroyChannels = function(opts) { + this._channels$.forEach(function(channel) { + channel.destroy(opts && opts.noWait); + }); + }; + Client.prototype.emitMessage = function(name2, req, opts, cb) { + var msg = getExistingMessage(this._svc$, name2); + var wreq = new WrappedRequest(msg, {}, req); + this._emitMessage$(wreq, opts, cb); + }; + Client.prototype.remoteProtocols = function() { + return getRemoteProtocols(this._cache$, true); + }; + Object.defineProperty(Client.prototype, "service", { + enumerable: true, + get: function() { + return this._svc$; + } + }); + Client.prototype.use = function() { + var i7, l7, fn; + for (i7 = 0, l7 = arguments.length; i7 < l7; i7++) { + fn = arguments[i7]; + this._fns$.push(fn.length < 3 ? fn(this) : fn); + } + return this; + }; + Client.prototype._emitMessage$ = function(wreq, opts, cb) { + if (!cb && typeof opts === "function") { + cb = opts; + opts = void 0; + } + var self2 = this; + var channels = this._channels$; + var numChannels = channels.length; + if (!numChannels) { + if (this._buffering$) { + debug2("no active client channels, buffering call"); + this.once("channel", function() { + this._emitMessage$(wreq, opts, cb); + }); + } else { + var err = new Error("no active channels"); + process.nextTick(function() { + if (cb) { + cb.call(new CallContext(wreq._msg), err); + } else { + self2.emit("error", err); + } + }); + } + return; + } + opts = opts || {}; + if (opts.timeout === void 0) { + opts.timeout = this._timeout$; + } + var channel; + if (numChannels === 1) { + channel = channels[0]; + } else if (this._policy$) { + channel = this._policy$(this._channels$.slice()); + if (!channel) { + debug2("policy returned no channel, skipping call"); + return; + } + } else { + channel = channels[Math.floor(Math.random() * numChannels)]; + } + channel._emit(wreq, opts, function(err2, wres) { + var ctx = this; + var errType = ctx.message.errorType; + if (err2) { + if (self2._strict$) { + err2 = errType.clone(err2.message, { wrapUnions: true }); + } + done(err2); + return; + } + if (!wres) { + done(); + return; + } + err2 = wres.error; + if (!self2._strict$) { + if (err2 === void 0) { + err2 = null; + } else { + if (Type3.isType(errType, "union:unwrapped")) { + if (typeof err2 == "string") { + err2 = new Error(err2); + } + } else if (err2 && err2.string && typeof err2.string == "string") { + err2 = new Error(err2.string); + } + } + } + done(err2, wres.response); + function done(err3, res) { + if (cb) { + cb.call(ctx, err3, res); + } else if (err3) { + self2.emit("error", err3); + } + } + }); + }; + Client.prototype._createMessageHandler$ = function(msg) { + var fields = msg.requestType.getFields(); + var names = fields.map(function(f9) { + return f9.getName(); + }); + var body = "return function " + msg.name + "("; + if (names.length) { + body += names.join(", ") + ", "; + } + body += "opts, cb) {\n"; + body += " var req = {"; + body += names.map(function(n7) { + return n7 + ": " + n7; + }).join(", "); + body += "};\n"; + body += " return this.emitMessage('" + msg.name + "', req, opts, cb);\n"; + body += "};"; + return new Function(body)(); + }; + function Server7(svc, opts) { + opts = opts || {}; + events.EventEmitter.call(this); + this.service = svc; + this._handlers = {}; + this._fns = []; + this._channels = {}; + this._nextChannelId = 1; + this._cache = opts.cache || {}; + this._defaultHandler = opts.defaultHandler; + this._sysErrFormatter = opts.systemErrorFormatter; + this._silent = !!opts.silent; + this._strict = !!opts.strictTypes; + if (opts.remoteProtocols) { + insertRemoteProtocols(this._cache, opts.remoteProtocols, svc, false); + } + svc.messages.forEach(function(msg) { + var name2 = msg.name; + if (!opts.noCapitalize) { + name2 = utils.capitalize(name2); + } + this["on" + name2] = this._createMessageHandler(msg); + }, this); + } + util2.inherits(Server7, events.EventEmitter); + Server7.prototype.activeChannels = function() { + return utils.objectValues(this._channels); + }; + Server7.prototype.createChannel = function(transport, opts) { + var objectMode = opts && opts.objectMode; + var channel; + if (typeof transport == "function") { + var readableFactory; + if (objectMode) { + readableFactory = transport; + } else { + readableFactory = function(cb) { + var decoder2 = new FrameDecoder().once("error", function(err) { + channel.destroy(err); + }); + return transport(function(err, writable2) { + if (err) { + cb(err); + return; + } + var encoder2 = new FrameEncoder(); + encoder2.pipe(writable2); + cb(null, encoder2); + }).pipe(decoder2); + }; + } + channel = new StatelessServerChannel(this, readableFactory, opts); + } else { + var readable, writable; + if (isStream(transport)) { + readable = writable = transport; + } else { + readable = transport.readable; + writable = transport.writable; + } + if (!objectMode) { + var decoder = new NettyDecoder(); + readable = readable.pipe(decoder); + var encoder = new NettyEncoder(); + encoder.pipe(writable); + writable = encoder; + } + channel = new StatefulServerChannel(this, readable, writable, opts); + if (!objectMode) { + channel.once("eot", function() { + readable.unpipe(decoder); + encoder.unpipe(writable); + }); + decoder.once("error", function(err) { + channel.destroy(err); + }); + } + } + if (!this.listeners("error").length) { + this.on("error", this._onError); + } + var channelId = this._nextChannelId++; + var channels = this._channels; + channels[channelId] = channel.once("eot", function() { + delete channels[channelId]; + }); + this.emit("channel", channel); + return channel; + }; + Server7.prototype.onMessage = function(name2, handler) { + getExistingMessage(this.service, name2); + this._handlers[name2] = handler; + return this; + }; + Server7.prototype.remoteProtocols = function() { + return getRemoteProtocols(this._cache, false); + }; + Server7.prototype.use = function() { + var i7, l7, fn; + for (i7 = 0, l7 = arguments.length; i7 < l7; i7++) { + fn = arguments[i7]; + this._fns.push(fn.length < 3 ? fn(this) : fn); + } + return this; + }; + Server7.prototype._createMessageHandler = function(msg) { + var name2 = msg.name; + var fields = msg.requestType.fields; + var numArgs = fields.length; + var args = fields.length ? ", " + fields.map(function(f9) { + return "req." + f9.name; + }).join(", ") : ""; + var body = "return function (handler) {\n"; + body += " if (handler.length > " + numArgs + ") {\n"; + body += " return this.onMessage('" + name2 + "', function (req, cb) {\n"; + body += " return handler.call(this" + args + ", cb);\n"; + body += " });\n"; + body += " } else {\n"; + body += " return this.onMessage('" + name2 + "', function (req) {\n"; + body += " return handler.call(this" + args + ");\n"; + body += " });\n"; + body += " }\n"; + body += "};\n"; + return new Function(body)(); + }; + Server7.prototype._onError = function(err) { + if (!this._silent && err.rpcCode !== "UNKNOWN_PROTOCOL") { + console.error(); + if (err.rpcCode) { + console.error(err.rpcCode); + console.error(err.cause); + } else { + console.error("INTERNAL_SERVER_ERROR"); + console.error(err); + } + } + }; + function ClientChannel(client, opts) { + opts = opts || {}; + events.EventEmitter.call(this); + this.client = client; + this.timeout = utils.getOption(opts, "timeout", client._timeout$); + this._endWritable = !!utils.getOption(opts, "endWritable", true); + this._prefix = normalizedPrefix(opts.scope); + var cache = client._cache$; + var clientSvc = client._svc$; + var hash = opts.serverHash; + if (!hash) { + hash = clientSvc.hash; + } + var adapter = cache[hash]; + if (!adapter) { + hash = clientSvc.hash; + adapter = cache[hash] = new Adapter(clientSvc, clientSvc, hash); + } + this._adapter = adapter; + this._registry = new Registry(this, PREFIX_LENGTH); + this.pending = 0; + this.destroyed = false; + this.draining = false; + this.once("_eot", function(pending, err) { + debug2("client channel EOT"); + this.destroyed = true; + this.emit("eot", pending, err); + }); + } + util2.inherits(ClientChannel, events.EventEmitter); + ClientChannel.prototype.destroy = function(noWait) { + debug2("destroying client channel"); + if (!this.draining) { + this.draining = true; + this.emit("_drain"); + } + var registry = this._registry; + var pending = this.pending; + if (noWait) { + registry.clear(); + } + if (noWait || !pending) { + if (isError3(noWait)) { + debug2("fatal client channel error: %s", noWait); + this.emit("_eot", pending, noWait); + } else { + this.emit("_eot", pending); + } + } else { + debug2("client channel entering drain mode (%s pending)", pending); + } + }; + ClientChannel.prototype.ping = function(timeout, cb) { + if (!cb && typeof timeout == "function") { + cb = timeout; + timeout = void 0; + } + var self2 = this; + var wreq = new WrappedRequest(PING_MESSAGE); + this._emit(wreq, { timeout }, function(err) { + if (cb) { + cb.call(self2, err); + } else if (err) { + self2.destroy(err); + } + }); + }; + ClientChannel.prototype._createHandshakeRequest = function(adapter, noSvc) { + var svc = this.client._svc$; + return { + clientHash: svc.hash, + clientProtocol: noSvc ? null : JSON.stringify(svc.protocol), + serverHash: adapter._hash + }; + }; + ClientChannel.prototype._emit = function(wreq, opts, cb) { + var msg = wreq._msg; + var wres = msg.oneWay ? void 0 : new WrappedResponse(msg, {}); + var ctx = new CallContext(msg, this); + var self2 = this; + this.pending++; + process.nextTick(function() { + if (!msg.name) { + onTransition(wreq, wres, onCompletion); + } else { + self2.emit("outgoingCall", ctx, opts); + var fns = self2.client._fns$; + debug2("starting client middleware chain (%s middleware)", fns.length); + chainMiddleware({ + fns, + ctx, + wreq, + wres, + onTransition, + onCompletion, + onError + }); + } + }); + function onTransition(wreq2, wres2, prev) { + var err, reqBuf; + if (self2.destroyed) { + err = new Error("channel destroyed"); + } else { + try { + reqBuf = wreq2.toBuffer(); + } catch (cause) { + err = serializationError( + f8("invalid %j request", msg.name), + wreq2, + [ + { name: "headers", type: MAP_BYTES_TYPE }, + { name: "request", type: msg.requestType } + ] + ); + } + } + if (err) { + prev(err); + return; + } + var timeout = opts && opts.timeout !== void 0 ? opts.timeout : self2.timeout; + var id = self2._registry.add(timeout, function(err2, resBuf, adapter) { + if (!err2 && !msg.oneWay) { + try { + adapter._decodeResponse(resBuf, wres2, msg); + } catch (cause) { + err2 = cause; + } + } + prev(err2); + }); + id |= self2._prefix; + debug2("sending message %s", id); + self2._send(id, reqBuf, !!msg && msg.oneWay); + } + function onCompletion(err) { + self2.pending--; + cb.call(ctx, err, wres); + if (self2.draining && !self2.destroyed && !self2.pending) { + self2.destroy(); + } + } + function onError(err) { + self2.client.emit("error", err, self2); + } + }; + ClientChannel.prototype._getAdapter = function(hres) { + var hash = hres.serverHash; + var cache = this.client._cache$; + var adapter = cache[hash]; + if (adapter) { + return adapter; + } + var ptcl = JSON.parse(hres.serverProtocol); + var serverSvc = Service.forProtocol(ptcl); + adapter = new Adapter(this.client._svc$, serverSvc, hash, true); + return cache[hash] = adapter; + }; + ClientChannel.prototype._matchesPrefix = function(id) { + return matchesPrefix(id, this._prefix); + }; + ClientChannel.prototype._send = utils.abstractFunction; + utils.addDeprecatedGetters(ClientChannel, ["pending", "timeout"]); + ClientChannel.prototype.getCache = util2.deprecate( + function() { + return this.client._cache$; + }, + "use `.remoteProtocols()` instead of `.getCache()`" + ); + ClientChannel.prototype.getProtocol = util2.deprecate( + function() { + return this.client._svc$; + }, + "use `.service` instead or `.getProtocol()`" + ); + ClientChannel.prototype.isDestroyed = util2.deprecate( + function() { + return this.destroyed; + }, + "use `.destroyed` instead of `.isDestroyed`" + ); + function StatelessClientChannel(client, writableFactory, opts) { + ClientChannel.call(this, client, opts); + this._writableFactory = writableFactory; + if (!opts || !opts.noPing) { + debug2("emitting ping request"); + this.ping(); + } + } + util2.inherits(StatelessClientChannel, ClientChannel); + StatelessClientChannel.prototype._send = function(id, reqBuf) { + var cb = this._registry.get(id); + var adapter = this._adapter; + var self2 = this; + process.nextTick(emit3); + return true; + function emit3(retry) { + if (self2.destroyed) { + return; + } + var hreq = self2._createHandshakeRequest(adapter, !retry); + var writable = self2._writableFactory.call(self2, function(err, readable) { + if (err) { + cb(err); + return; + } + readable.on("data", function(obj) { + debug2("received response %s", obj.id); + var buf = Buffer4.concat(obj.payload); + try { + var parts = readHead(HANDSHAKE_RESPONSE_TYPE, buf); + var hres = parts.head; + if (hres.serverHash) { + adapter = self2._getAdapter(hres); + } + } catch (cause) { + cb(cause); + return; + } + var match = hres.match; + debug2("handshake match: %s", match); + self2.emit("handshake", hreq, hres); + if (match === "NONE") { + process.nextTick(function() { + emit3(true); + }); + } else { + self2._adapter = adapter; + cb(null, parts.tail, adapter); + } + }); + }); + if (!writable) { + cb(new Error("invalid writable stream")); + return; + } + writable.write({ + id, + payload: [HANDSHAKE_REQUEST_TYPE.toBuffer(hreq), reqBuf] + }); + if (self2._endWritable) { + writable.end(); + } + } + }; + function StatefulClientChannel(client, readable, writable, opts) { + ClientChannel.call(this, client, opts); + this._readable = readable; + this._writable = writable; + this._connected = !!(opts && opts.noPing); + this._readable.on("end", onEnd); + this._writable.on("finish", onFinish); + var self2 = this; + var timer = null; + this.once("eot", function() { + if (timer) { + clearTimeout(timer); + timer = null; + } + if (!self2._connected) { + self2.emit("_ready"); + } + this._writable.removeListener("finish", onFinish); + if (this._endWritable) { + debug2("ending transport"); + this._writable.end(); + } + this._readable.removeListener("data", onPing).removeListener("data", onMessage).removeListener("end", onEnd); + }); + var hreq; + if (this._connected) { + this._readable.on("data", onMessage); + } else { + this._readable.on("data", onPing); + process.nextTick(ping); + if (self2.timeout) { + timer = setTimeout(function() { + self2.destroy(new Error("timeout")); + }, self2.timeout); + } + } + function ping(retry) { + if (self2.destroyed) { + return; + } + hreq = self2._createHandshakeRequest(self2._adapter, !retry); + var payload = [ + HANDSHAKE_REQUEST_TYPE.toBuffer(hreq), + utils.bufferFrom([0, 0]) + // No header, no data (empty message name). + ]; + self2._writable.write({ id: self2._prefix, payload }); + } + function onPing(obj) { + if (!self2._matchesPrefix(obj.id)) { + debug2("discarding unscoped response %s (still connecting)", obj.id); + return; + } + var buf = Buffer4.concat(obj.payload); + try { + var hres = readHead(HANDSHAKE_RESPONSE_TYPE, buf).head; + if (hres.serverHash) { + self2._adapter = self2._getAdapter(hres); + } + } catch (cause) { + self2.destroy(cause); + return; + } + var match = hres.match; + debug2("handshake match: %s", match); + self2.emit("handshake", hreq, hres); + if (match === "NONE") { + process.nextTick(function() { + ping(true); + }); + } else { + debug2("successfully connected"); + if (timer) { + clearTimeout(timer); + timer = null; + } + self2._readable.removeListener("data", onPing).on("data", onMessage); + self2._connected = true; + self2.emit("_ready"); + hreq = null; + } + } + function onMessage(obj) { + var id = obj.id; + if (!self2._matchesPrefix(id)) { + debug2("discarding unscoped message %s", id); + return; + } + var cb = self2._registry.get(id); + if (cb) { + process.nextTick(function() { + debug2("received message %s", id); + cb(null, Buffer4.concat(obj.payload), self2._adapter); + }); + } + } + function onEnd() { + self2.destroy(true); + } + function onFinish() { + self2.destroy(); + } + } + util2.inherits(StatefulClientChannel, ClientChannel); + StatefulClientChannel.prototype._emit = function() { + if (this._connected || this.draining) { + ClientChannel.prototype._emit.apply(this, arguments); + } else { + debug2("queuing request"); + var args = []; + var i7, l7; + for (i7 = 0, l7 = arguments.length; i7 < l7; i7++) { + args.push(arguments[i7]); + } + this.once("_ready", function() { + this._emit.apply(this, args); + }); + } + }; + StatefulClientChannel.prototype._send = function(id, reqBuf, oneWay) { + if (oneWay) { + var self2 = this; + process.nextTick(function() { + self2._registry.get(id)(null, utils.bufferFrom([0, 0, 0]), self2._adapter); + }); + } + return this._writable.write({ id, payload: [reqBuf] }); + }; + function ServerChannel(server, opts) { + opts = opts || {}; + events.EventEmitter.call(this); + this.server = server; + this._endWritable = !!utils.getOption(opts, "endWritable", true); + this._prefix = normalizedPrefix(opts.scope); + var cache = server._cache; + var svc = server.service; + var hash = svc.hash; + if (!cache[hash]) { + cache[hash] = new Adapter(svc, svc, hash); + } + this._adapter = null; + this.destroyed = false; + this.draining = false; + this.pending = 0; + this.once("_eot", function(pending, err) { + debug2("server channel EOT"); + this.emit("eot", pending, err); + }); + } + util2.inherits(ServerChannel, events.EventEmitter); + ServerChannel.prototype.destroy = function(noWait) { + if (!this.draining) { + this.draining = true; + this.emit("_drain"); + } + if (noWait || !this.pending) { + this.destroyed = true; + if (isError3(noWait)) { + debug2("fatal server channel error: %s", noWait); + this.emit("_eot", this.pending, noWait); + } else { + this.emit("_eot", this.pending); + } + } + }; + ServerChannel.prototype._createHandshakeResponse = function(err, hreq) { + var svc = this.server.service; + var buf = svc.hash; + var serverMatch = hreq && hreq.serverHash.equals(buf); + return { + match: err ? "NONE" : serverMatch ? "BOTH" : "CLIENT", + serverProtocol: serverMatch ? null : JSON.stringify(svc.protocol), + serverHash: serverMatch ? null : buf + }; + }; + ServerChannel.prototype._getAdapter = function(hreq) { + var hash = hreq.clientHash; + var adapter = this.server._cache[hash]; + if (adapter) { + return adapter; + } + if (!hreq.clientProtocol) { + throw toRpcError("UNKNOWN_PROTOCOL"); + } + var ptcl = JSON.parse(hreq.clientProtocol); + var clientSvc = Service.forProtocol(ptcl); + adapter = new Adapter(clientSvc, this.server.service, hash, true); + return this.server._cache[hash] = adapter; + }; + ServerChannel.prototype._matchesPrefix = function(id) { + return matchesPrefix(id, this._prefix); + }; + ServerChannel.prototype._receive = function(reqBuf, adapter, cb) { + var self2 = this; + var wreq; + try { + wreq = adapter._decodeRequest(reqBuf); + } catch (cause) { + cb(self2._encodeSystemError(toRpcError("INVALID_REQUEST", cause))); + return; + } + var msg = wreq._msg; + var wres = new WrappedResponse(msg, {}); + if (!msg.name) { + wres.response = null; + cb(wres.toBuffer(), false); + return; + } + var ctx = new CallContext(msg, this); + self2.emit("incomingCall", ctx); + var fns = this.server._fns; + debug2("starting server middleware chain (%s middleware)", fns.length); + self2.pending++; + chainMiddleware({ + fns, + ctx, + wreq, + wres, + onTransition, + onCompletion, + onError + }); + function onTransition(wreq2, wres2, prev) { + var handler = self2.server._handlers[msg.name]; + if (!handler) { + var defaultHandler = self2.server._defaultHandler; + if (defaultHandler) { + defaultHandler.call(ctx, wreq2, wres2, prev); + } else { + var cause = new Error(f8("no handler for %s", msg.name)); + prev(toRpcError("NOT_IMPLEMENTED", cause)); + } + } else { + var pending = !msg.oneWay; + try { + if (pending) { + handler.call(ctx, wreq2.request, function(err, res) { + pending = false; + wres2.error = err; + wres2.response = res; + prev(); + }); + } else { + handler.call(ctx, wreq2.request); + prev(); + } + } catch (err) { + if (pending) { + pending = false; + prev(err); + } else { + onError(err); + } + } + } + } + function onCompletion(err) { + self2.pending--; + var server = self2.server; + var resBuf; + if (!err) { + var resErr = wres.error; + var isStrict = server._strict; + if (!isStrict) { + if (isError3(resErr)) { + wres.error = msg.errorType.clone(resErr.message, { wrapUnions: true }); + } else if (resErr === null) { + resErr = wres.error = void 0; + } + if (resErr === void 0 && wres.response === void 0 && msg.responseType.isValid(null)) { + wres.response = null; + } + } + try { + resBuf = wres.toBuffer(); + } catch (cause) { + if (wres.error !== void 0) { + err = serializationError( + f8("invalid %j error", msg.name), + // Sic. + wres, + [ + { name: "headers", type: MAP_BYTES_TYPE }, + { name: "error", type: msg.errorType } + ] + ); + } else { + err = serializationError( + f8("invalid %j response", msg.name), + wres, + [ + { name: "headers", type: MAP_BYTES_TYPE }, + { name: "response", type: msg.responseType } + ] + ); + } + } + } + if (!resBuf) { + resBuf = self2._encodeSystemError(err, wres.headers); + } else if (resErr !== void 0) { + server.emit("error", toRpcError("APPLICATION_ERROR", resErr)); + } + cb(resBuf, msg.oneWay); + if (self2.draining && !self2.pending) { + self2.destroy(); + } + } + function onError(err) { + self2.server.emit("error", err, self2); + } + }; + utils.addDeprecatedGetters(ServerChannel, ["pending"]); + ServerChannel.prototype.getCache = util2.deprecate( + function() { + return this.server._cache; + }, + "use `.remoteProtocols()` instead of `.getCache()`" + ); + ServerChannel.prototype.getProtocol = util2.deprecate( + function() { + return this.server.service; + }, + "use `.service` instead of `.getProtocol()`" + ); + ServerChannel.prototype.isDestroyed = util2.deprecate( + function() { + return this.destroyed; + }, + "use `.destroyed` instead of `.isDestroyed`" + ); + ServerChannel.prototype._encodeSystemError = function(err, header) { + var server = this.server; + server.emit("error", err, this); + var errStr; + if (server._sysErrFormatter) { + errStr = server._sysErrFormatter.call(this, err); + } else if (err.rpcCode) { + errStr = err.message; + } + var hdrBuf; + if (header) { + try { + hdrBuf = MAP_BYTES_TYPE.toBuffer(header); + } catch (cause) { + server.emit("error", cause, this); + } + } + return Buffer4.concat([ + hdrBuf || utils.bufferFrom([0]), + utils.bufferFrom([1, 0]), + // Error flag and first union index. + STRING_TYPE.toBuffer(errStr || "internal server error") + ]); + }; + function StatelessServerChannel(server, readableFactory, opts) { + ServerChannel.call(this, server, opts); + this._writable = void 0; + var self2 = this; + var readable; + process.nextTick(function() { + readable = readableFactory.call(self2, function(err, writable) { + process.nextTick(function() { + if (err) { + onFinish(err); + return; + } + self2._writable = writable.on("finish", onFinish); + self2.emit("_writable"); + }); + }).on("data", onRequest).on("end", onEnd); + }); + function onRequest(obj) { + var id = obj.id; + var buf = Buffer4.concat(obj.payload); + var err; + try { + var parts = readHead(HANDSHAKE_REQUEST_TYPE, buf); + var hreq = parts.head; + var adapter = self2._getAdapter(hreq); + } catch (cause) { + err = toRpcError("INVALID_HANDSHAKE_REQUEST", cause); + } + var hres = self2._createHandshakeResponse(err, hreq); + self2.emit("handshake", hreq, hres); + if (err) { + done(self2._encodeSystemError(err)); + } else { + self2._receive(parts.tail, adapter, done); + } + function done(resBuf) { + if (!self2.destroyed) { + if (!self2._writable) { + self2.once("_writable", function() { + done(resBuf); + }); + return; + } + self2._writable.write({ + id, + payload: [HANDSHAKE_RESPONSE_TYPE.toBuffer(hres), resBuf] + }); + } + if (self2._writable && self2._endWritable) { + self2._writable.end(); + } + } + } + function onEnd() { + self2.destroy(); + } + function onFinish(err) { + readable.removeListener("data", onRequest).removeListener("end", onEnd); + self2.destroy(err || true); + } + } + util2.inherits(StatelessServerChannel, ServerChannel); + function StatefulServerChannel(server, readable, writable, opts) { + ServerChannel.call(this, server, opts); + this._adapter = void 0; + this._writable = writable.on("finish", onFinish); + this._readable = readable.on("data", onHandshake).on("end", onEnd); + this.once("_drain", function() { + this._readable.removeListener("data", onHandshake).removeListener("data", onRequest).removeListener("end", onEnd); + }).once("eot", function() { + this._writable.removeListener("finish", onFinish); + if (this._endWritable) { + this._writable.end(); + } + }); + var self2 = this; + function onHandshake(obj) { + var id = obj.id; + if (!self2._matchesPrefix(id)) { + return; + } + var buf = Buffer4.concat(obj.payload); + var err; + try { + var parts = readHead(HANDSHAKE_REQUEST_TYPE, buf); + var hreq = parts.head; + self2._adapter = self2._getAdapter(hreq); + } catch (cause) { + err = toRpcError("INVALID_HANDSHAKE_REQUEST", cause); + } + var hres = self2._createHandshakeResponse(err, hreq); + self2.emit("handshake", hreq, hres); + if (err) { + done(self2._encodeSystemError(err)); + } else { + self2._readable.removeListener("data", onHandshake).on("data", onRequest); + self2._receive(parts.tail, self2._adapter, done); + } + function done(resBuf) { + if (self2.destroyed) { + return; + } + self2._writable.write({ + id, + payload: [HANDSHAKE_RESPONSE_TYPE.toBuffer(hres), resBuf] + }); + } + } + function onRequest(obj) { + var id = obj.id; + if (!self2._matchesPrefix(id)) { + return; + } + var reqBuf = Buffer4.concat(obj.payload); + self2._receive(reqBuf, self2._adapter, function(resBuf, oneWay) { + if (self2.destroyed || oneWay) { + return; + } + self2._writable.write({ id, payload: [resBuf] }); + }); + } + function onEnd() { + self2.destroy(); + } + function onFinish() { + self2.destroy(true); + } + } + util2.inherits(StatefulServerChannel, ServerChannel); + function WrappedRequest(msg, hdrs, req) { + this._msg = msg; + this.headers = hdrs || {}; + this.request = req || {}; + } + WrappedRequest.prototype.toBuffer = function() { + var msg = this._msg; + return Buffer4.concat([ + MAP_BYTES_TYPE.toBuffer(this.headers), + STRING_TYPE.toBuffer(msg.name), + msg.requestType.toBuffer(this.request) + ]); + }; + function WrappedResponse(msg, hdr, err, res) { + this._msg = msg; + this.headers = hdr; + this.error = err; + this.response = res; + } + WrappedResponse.prototype.toBuffer = function() { + var hdr = MAP_BYTES_TYPE.toBuffer(this.headers); + var hasError = this.error !== void 0; + return Buffer4.concat([ + hdr, + BOOLEAN_TYPE.toBuffer(hasError), + hasError ? this._msg.errorType.toBuffer(this.error) : this._msg.responseType.toBuffer(this.response) + ]); + }; + function CallContext(msg, channel) { + this.channel = channel; + this.locals = {}; + this.message = msg; + Object.freeze(this); + } + function Registry(ctx, prefixLength) { + this._ctx = ctx; + this._mask = ~0 >>> (prefixLength | 0); + this._id = 0; + this._n = 0; + this._cbs = {}; + } + Registry.prototype.get = function(id) { + return this._cbs[id & this._mask]; + }; + Registry.prototype.add = function(timeout, fn) { + this._id = this._id + 1 & this._mask; + var self2 = this; + var id = this._id; + var timer; + if (timeout > 0) { + timer = setTimeout(function() { + cb(new Error("timeout")); + }, timeout); + } + this._cbs[id] = cb; + this._n++; + return id; + function cb() { + if (!self2._cbs[id]) { + return; + } + delete self2._cbs[id]; + self2._n--; + if (timer) { + clearTimeout(timer); + } + fn.apply(self2._ctx, arguments); + } + }; + Registry.prototype.clear = function() { + Object.keys(this._cbs).forEach(function(id) { + this._cbs[id](new Error("interrupted")); + }, this); + }; + function Adapter(clientSvc, serverSvc, hash, isRemote) { + this._clientSvc = clientSvc; + this._serverSvc = serverSvc; + this._hash = hash; + this._isRemote = !!isRemote; + this._readers = createReaders(clientSvc, serverSvc); + } + Adapter.prototype._decodeRequest = function(buf) { + var tap2 = new Tap(buf); + var hdr = MAP_BYTES_TYPE._read(tap2); + var name2 = STRING_TYPE._read(tap2); + var msg, req; + if (name2) { + msg = this._serverSvc.message(name2); + req = this._readers[name2 + "?"]._read(tap2); + } else { + msg = PING_MESSAGE; + } + if (!tap2.isValid()) { + throw new Error(f8("truncated %s request", name2 || "ping$")); + } + return new WrappedRequest(msg, hdr, req); + }; + Adapter.prototype._decodeResponse = function(buf, wres, msg) { + var tap2 = new Tap(buf); + utils.copyOwnProperties(MAP_BYTES_TYPE._read(tap2), wres.headers, true); + var isError4 = BOOLEAN_TYPE._read(tap2); + var name2 = msg.name; + if (name2) { + var reader = this._readers[name2 + (isError4 ? "*" : "!")]; + msg = this._clientSvc.message(name2); + if (isError4) { + wres.error = reader._read(tap2); + } else { + wres.response = reader._read(tap2); + } + if (!tap2.isValid()) { + throw new Error(f8("truncated %s response", name2)); + } + } else { + msg = PING_MESSAGE; + } + }; + function FrameDecoder() { + stream2.Transform.call(this, { readableObjectMode: true }); + this._id = void 0; + this._buf = utils.newBuffer(0); + this._bufs = []; + this.on("finish", function() { + this.push(null); + }); + } + util2.inherits(FrameDecoder, stream2.Transform); + FrameDecoder.prototype._transform = function(buf, encoding, cb) { + buf = Buffer4.concat([this._buf, buf]); + var frameLength; + while (buf.length >= 4 && buf.length >= (frameLength = buf.readInt32BE(0)) + 4) { + if (frameLength) { + this._bufs.push(buf.slice(4, frameLength + 4)); + } else { + var bufs = this._bufs; + this._bufs = []; + this.push({ id: null, payload: bufs }); + } + buf = buf.slice(frameLength + 4); + } + this._buf = buf; + cb(); + }; + FrameDecoder.prototype._flush = function(cb) { + if (this._buf.length || this._bufs.length) { + var bufs = this._bufs.slice(); + bufs.unshift(this._buf); + var err = toRpcError("TRAILING_DATA"); + err.trailingData = Buffer4.concat(bufs).toString(); + this.emit("error", err); + } + cb(); + }; + function FrameEncoder() { + stream2.Transform.call(this, { writableObjectMode: true }); + this.on("finish", function() { + this.push(null); + }); + } + util2.inherits(FrameEncoder, stream2.Transform); + FrameEncoder.prototype._transform = function(obj, encoding, cb) { + var bufs = obj.payload; + var i7, l7, buf; + for (i7 = 0, l7 = bufs.length; i7 < l7; i7++) { + buf = bufs[i7]; + this.push(intBuffer(buf.length)); + this.push(buf); + } + this.push(intBuffer(0)); + cb(); + }; + function NettyDecoder() { + stream2.Transform.call(this, { readableObjectMode: true }); + this._id = void 0; + this._frameCount = 0; + this._buf = utils.newBuffer(0); + this._bufs = []; + this.on("finish", function() { + this.push(null); + }); + } + util2.inherits(NettyDecoder, stream2.Transform); + NettyDecoder.prototype._transform = function(buf, encoding, cb) { + buf = Buffer4.concat([this._buf, buf]); + while (true) { + if (this._id === void 0) { + if (buf.length < 8) { + this._buf = buf; + cb(); + return; + } + this._id = buf.readInt32BE(0); + this._frameCount = buf.readInt32BE(4); + buf = buf.slice(8); + } + var frameLength; + while (this._frameCount && buf.length >= 4 && buf.length >= (frameLength = buf.readInt32BE(0)) + 4) { + this._frameCount--; + this._bufs.push(buf.slice(4, frameLength + 4)); + buf = buf.slice(frameLength + 4); + } + if (this._frameCount) { + this._buf = buf; + cb(); + return; + } else { + var obj = { id: this._id, payload: this._bufs }; + this._bufs = []; + this._id = void 0; + this.push(obj); + } + } + }; + NettyDecoder.prototype._flush = FrameDecoder.prototype._flush; + function NettyEncoder() { + stream2.Transform.call(this, { writableObjectMode: true }); + this.on("finish", function() { + this.push(null); + }); + } + util2.inherits(NettyEncoder, stream2.Transform); + NettyEncoder.prototype._transform = function(obj, encoding, cb) { + var bufs = obj.payload; + var l7 = bufs.length; + var buf; + buf = utils.newBuffer(8); + buf.writeInt32BE(obj.id, 0); + buf.writeInt32BE(l7, 4); + this.push(buf); + var i7; + for (i7 = 0; i7 < l7; i7++) { + buf = bufs[i7]; + this.push(intBuffer(buf.length)); + this.push(buf); + } + cb(); + }; + function intBuffer(n7) { + var buf = utils.newBuffer(4); + buf.writeInt32BE(n7); + return buf; + } + function readHead(type3, buf) { + var tap2 = new Tap(buf); + var head2 = type3._read(tap2); + if (!tap2.isValid()) { + throw new Error(f8("truncated %j", type3.schema())); + } + return { head: head2, tail: tap2.buf.slice(tap2.pos) }; + } + function createReader(rtype, wtype) { + return rtype.equals(wtype) ? rtype : rtype.createResolver(wtype); + } + function createReaders(clientSvc, serverSvc) { + var obj = {}; + clientSvc.messages.forEach(function(c7) { + var n7 = c7.name; + var s7 = serverSvc.message(n7); + try { + if (!s7) { + throw new Error(f8("missing server message: %s", n7)); + } + if (s7.oneWay !== c7.oneWay) { + throw new Error(f8("inconsistent one-way message: %s", n7)); + } + obj[n7 + "?"] = createReader(s7.requestType, c7.requestType); + obj[n7 + "*"] = createReader(c7.errorType, s7.errorType); + obj[n7 + "!"] = createReader(c7.responseType, s7.responseType); + } catch (cause) { + throw toRpcError("INCOMPATIBLE_PROTOCOL", cause); + } + }); + return obj; + } + function insertRemoteProtocols(cache, ptcls, svc, isClient) { + Object.keys(ptcls).forEach(function(hash) { + var ptcl = ptcls[hash]; + var clientSvc, serverSvc; + if (isClient) { + clientSvc = svc; + serverSvc = Service.forProtocol(ptcl); + } else { + clientSvc = Service.forProtocol(ptcl); + serverSvc = svc; + } + cache[hash] = new Adapter(clientSvc, serverSvc, hash, true); + }); + } + function getRemoteProtocols(cache, isClient) { + var ptcls = {}; + Object.keys(cache).forEach(function(hs) { + var adapter = cache[hs]; + if (adapter._isRemote) { + var svc = isClient ? adapter._serverSvc : adapter._clientSvc; + ptcls[hs] = svc.protocol; + } + }); + return ptcls; + } + function isError3(any) { + return !!any && Object.prototype.toString.call(any) === "[object Error]"; + } + function forwardErrors(src, dst) { + return src.on("error", function(err) { + dst.emit("error", err, src); + }); + } + function toError(msg, cause) { + var err = new Error(msg); + err.cause = cause; + return err; + } + function toRpcError(rpcCode, cause) { + var err = toError(rpcCode.toLowerCase().replace(/_/g, " "), cause); + err.rpcCode = cause && cause.rpcCode ? cause.rpcCode : rpcCode; + return err; + } + function serializationError(msg, obj, fields) { + var details = []; + var i7, l7, field; + for (i7 = 0, l7 = fields.length; i7 < l7; i7++) { + field = fields[i7]; + field.type.isValid(obj[field.name], { errorHook }); + } + var detailsStr = details.map(function(obj2) { + return f8("%s = %j but expected %s", obj2.path, obj2.value, obj2.type); + }).join(", "); + var err = new Error(f8("%s (%s)", msg, detailsStr)); + err.details = details; + return err; + function errorHook(parts, any, type3) { + var strs = []; + var i8, l8, part; + for (i8 = 0, l8 = parts.length; i8 < l8; i8++) { + part = parts[i8]; + if (isNaN(part)) { + strs.push("." + part); + } else { + strs.push("[" + part + "]"); + } + } + details.push({ + path: field.name + strs.join(""), + value: any, + type: type3 + }); + } + } + function normalizedPrefix(scope) { + return scope ? utils.getHash(scope).readInt16BE(0) << 32 - PREFIX_LENGTH : 0; + } + function matchesPrefix(id, prefix) { + return (id ^ prefix) >> 32 - PREFIX_LENGTH === 0; + } + function isStream(any) { + return !!(any && any.pipe); + } + function getExistingMessage(svc, name2) { + var msg = svc.message(name2); + if (!msg) { + throw new Error(f8("unknown message: %s", name2)); + } + return msg; + } + function chainMiddleware(params) { + var args = [params.wreq, params.wres]; + var cbs = []; + var cause; + forward(0); + function forward(pos) { + var isDone = false; + if (pos < params.fns.length) { + params.fns[pos].apply(params.ctx, args.concat(function(err, cb) { + if (isDone) { + params.onError(toError("duplicate forward middleware call", err)); + return; + } + isDone = true; + if (err || params.wres && // Non one-way messages. + (params.wres.error !== void 0 || params.wres.response !== void 0)) { + cause = err; + backward(); + return; + } + if (cb) { + cbs.push(cb); + } + forward(++pos); + })); + } else { + params.onTransition.apply(params.ctx, args.concat(function(err) { + if (isDone) { + params.onError(toError("duplicate handler call", err)); + return; + } + isDone = true; + cause = err; + process.nextTick(backward); + })); + } + } + function backward() { + var cb = cbs.pop(); + if (cb) { + var isDone = false; + cb.call(params.ctx, cause, function(err) { + if (isDone) { + params.onError(toError("duplicate backward middleware call", err)); + return; + } + cause = err; + isDone = true; + backward(); + }); + } else { + params.onCompletion.call(params.ctx, cause); + } + } + } + module5.exports = { + Adapter, + HANDSHAKE_REQUEST_TYPE, + HANDSHAKE_RESPONSE_TYPE, + Message: Message7, + Registry, + Service, + discoverProtocol, + streams: { + FrameDecoder, + FrameEncoder, + NettyDecoder, + NettyEncoder + } + }; + } +}); + +// node_modules/avsc/etc/browser/lib/files.js +var require_files = __commonJS({ + "node_modules/avsc/etc/browser/lib/files.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function createError() { + return new Error("unsupported in the browser"); + } + function createImportHook() { + return function(fpath, kind, cb) { + cb(createError()); + }; + } + function createSyncImportHook() { + return function() { + throw createError(); + }; + } + module5.exports = { + createImportHook, + createSyncImportHook, + existsSync: function() { + return false; + }, + readFileSync: function() { + throw createError(); + } + }; + } +}); + +// node_modules/avsc/lib/specs.js +var require_specs3 = __commonJS({ + "node_modules/avsc/lib/specs.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var files = require_files(); + var utils = require_utils8(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var f8 = util2.format; + var TYPE_REFS = { + date: { type: "int", logicalType: "date" }, + decimal: { type: "bytes", logicalType: "decimal" }, + time_ms: { type: "long", logicalType: "time-millis" }, + timestamp_ms: { type: "long", logicalType: "timestamp-millis" } + }; + function assembleProtocol(fpath, opts, cb) { + if (!cb && typeof opts == "function") { + cb = opts; + opts = void 0; + } + opts = opts || {}; + if (!opts.importHook) { + opts.importHook = files.createImportHook(); + } + importFile(fpath, function(err, protocol) { + if (err) { + cb(err); + return; + } + if (!protocol) { + cb(new Error("empty root import")); + return; + } + var schemas5 = protocol.types; + if (schemas5) { + var namespace = protocolNamespace(protocol) || ""; + schemas5.forEach(function(schema8) { + if (schema8.namespace === namespace) { + delete schema8.namespace; + } + }); + } + cb(null, protocol); + }); + function importFile(fpath2, cb2) { + opts.importHook(fpath2, "idl", function(err, str2) { + if (err) { + cb2(err); + return; + } + if (str2 === void 0) { + cb2(); + return; + } + try { + var reader = new Reader(str2, opts); + var obj = reader._readProtocol(str2, opts); + } catch (err2) { + err2.path = fpath2; + cb2(err2); + return; + } + fetchImports(obj.protocol, obj.imports, path2.dirname(fpath2), cb2); + }); + } + function fetchImports(protocol, imports, dpath, cb2) { + var importedProtocols = []; + next(); + function next() { + var info2 = imports.shift(); + if (!info2) { + importedProtocols.reverse(); + try { + importedProtocols.forEach(function(imported) { + mergeImport(protocol, imported); + }); + } catch (err) { + cb2(err); + return; + } + cb2(null, protocol); + return; + } + var importPath = path2.join(dpath, info2.name); + if (info2.kind === "idl") { + importFile(importPath, function(err, imported) { + if (err) { + cb2(err); + return; + } + if (imported) { + importedProtocols.push(imported); + } + next(); + }); + } else { + opts.importHook(importPath, info2.kind, function(err, str2) { + if (err) { + cb2(err); + return; + } + switch (info2.kind) { + case "protocol": + case "schema": + if (str2 === void 0) { + next(); + return; + } + try { + var obj = JSON.parse(str2); + } catch (err2) { + err2.path = importPath; + cb2(err2); + return; + } + var imported = info2.kind === "schema" ? { types: [obj] } : obj; + importedProtocols.push(imported); + next(); + return; + default: + cb2(new Error(f8("invalid import kind: %s", info2.kind))); + } + }); + } + } + } + function mergeImport(protocol, imported) { + var schemas5 = imported.types || []; + schemas5.reverse(); + schemas5.forEach(function(schema8) { + if (!protocol.types) { + protocol.types = []; + } + if (schema8.namespace === void 0) { + schema8.namespace = protocolNamespace(imported) || ""; + } + protocol.types.unshift(schema8); + }); + Object.keys(imported.messages || {}).forEach(function(name2) { + if (!protocol.messages) { + protocol.messages = {}; + } + if (protocol.messages[name2]) { + throw new Error(f8("duplicate message: %s", name2)); + } + protocol.messages[name2] = imported.messages[name2]; + }); + } + } + function read(str2) { + var schema8; + if (typeof str2 == "string" && ~str2.indexOf(path2.sep) && files.existsSync(str2)) { + var contents = files.readFileSync(str2, { encoding: "utf8" }); + try { + return JSON.parse(contents); + } catch (err) { + var opts = { importHook: files.createSyncImportHook() }; + assembleProtocol(str2, opts, function(err2, protocolSchema) { + schema8 = err2 ? contents : protocolSchema; + }); + } + } else { + schema8 = str2; + } + if (typeof schema8 != "string" || schema8 === "null") { + return schema8; + } + try { + return JSON.parse(schema8); + } catch (err) { + try { + return Reader.readProtocol(schema8); + } catch (err2) { + try { + return Reader.readSchema(schema8); + } catch (err3) { + return schema8; + } + } + } + } + function Reader(str2, opts) { + opts = opts || {}; + this._tk = new Tokenizer(str2); + this._ackVoidMessages = !!opts.ackVoidMessages; + this._implicitTags = !opts.delimitedCollections; + this._typeRefs = opts.typeRefs || TYPE_REFS; + } + Reader.readProtocol = function(str2, opts) { + var reader = new Reader(str2, opts); + var protocol = reader._readProtocol(); + if (protocol.imports.length) { + throw new Error("unresolvable import"); + } + return protocol.protocol; + }; + Reader.readSchema = function(str2, opts) { + var reader = new Reader(str2, opts); + var doc = reader._readJavadoc(); + var schema8 = reader._readType(doc === void 0 ? {} : { doc }, true); + reader._tk.next({ id: "(eof)" }); + return schema8; + }; + Reader.prototype._readProtocol = function() { + var tk = this._tk; + var imports = []; + var types3 = []; + var messages = {}; + var pos; + this._readImports(imports); + var protocolSchema = {}; + var protocolJavadoc = this._readJavadoc(); + if (protocolJavadoc !== void 0) { + protocolSchema.doc = protocolJavadoc; + } + this._readAnnotations(protocolSchema); + tk.next({ val: "protocol" }); + if (!tk.next({ val: "{", silent: true })) { + protocolSchema.protocol = tk.next({ id: "name" }).val; + tk.next({ val: "{" }); + } + while (!tk.next({ val: "}", silent: true })) { + if (!this._readImports(imports)) { + var javadoc = this._readJavadoc(); + var typeSchema = this._readType({}, true); + var numImports = this._readImports(imports, true); + var message = void 0; + pos = tk.pos; + if (!numImports && (message = this._readMessage(typeSchema))) { + if (javadoc !== void 0 && message.schema.doc === void 0) { + message.schema.doc = javadoc; + } + var oneWay = false; + if (message.schema.response === "void" || message.schema.response.type === "void") { + oneWay = !this._ackVoidMessages && !message.schema.errors; + if (message.schema.response === "void") { + message.schema.response = "null"; + } else { + message.schema.response.type = "null"; + } + } + if (oneWay) { + message.schema["one-way"] = true; + } + if (messages[message.name]) { + throw new Error(f8("duplicate message: %s", message.name)); + } + messages[message.name] = message.schema; + } else { + if (javadoc) { + if (typeof typeSchema == "string") { + typeSchema = { doc: javadoc, type: typeSchema }; + } else if (typeSchema.doc === void 0) { + typeSchema.doc = javadoc; + } + } + types3.push(typeSchema); + tk.pos = pos; + tk.next({ val: ";", silent: true }); + } + javadoc = void 0; + } + } + tk.next({ id: "(eof)" }); + if (types3.length) { + protocolSchema.types = types3; + } + if (Object.keys(messages).length) { + protocolSchema.messages = messages; + } + return { protocol: protocolSchema, imports }; + }; + Reader.prototype._readAnnotations = function(schema8) { + var tk = this._tk; + while (tk.next({ val: "@", silent: true })) { + var parts = []; + while (!tk.next({ val: "(", silent: true })) { + parts.push(tk.next().val); + } + schema8[parts.join("")] = tk.next({ id: "json" }).val; + tk.next({ val: ")" }); + } + }; + Reader.prototype._readMessage = function(responseSchema) { + var tk = this._tk; + var schema8 = { request: [], response: responseSchema }; + this._readAnnotations(schema8); + var name2 = tk.next().val; + if (tk.next().val !== "(") { + return; + } + if (!tk.next({ val: ")", silent: true })) { + do { + schema8.request.push(this._readField()); + } while (!tk.next({ val: ")", silent: true }) && tk.next({ val: "," })); + } + var token = tk.next(); + switch (token.val) { + case "throws": + schema8.errors = []; + do { + schema8.errors.push(this._readType()); + } while (!tk.next({ val: ";", silent: true }) && tk.next({ val: "," })); + break; + case "oneway": + schema8["one-way"] = true; + tk.next({ val: ";" }); + break; + case ";": + break; + default: + throw tk.error("invalid message suffix", token); + } + return { name: name2, schema: schema8 }; + }; + Reader.prototype._readJavadoc = function() { + var token = this._tk.next({ id: "javadoc", emitJavadoc: true, silent: true }); + if (token) { + return token.val; + } + }; + Reader.prototype._readField = function() { + var tk = this._tk; + var javadoc = this._readJavadoc(); + var schema8 = { type: this._readType() }; + if (javadoc !== void 0 && schema8.doc === void 0) { + schema8.doc = javadoc; + } + this._readAnnotations(schema8); + schema8.name = tk.next({ id: "name" }).val; + if (tk.next({ val: "=", silent: true })) { + schema8["default"] = tk.next({ id: "json" }).val; + } + return schema8; + }; + Reader.prototype._readType = function(schema8, top) { + schema8 = schema8 || {}; + this._readAnnotations(schema8); + schema8.type = this._tk.next({ id: "name" }).val; + switch (schema8.type) { + case "record": + case "error": + return this._readRecord(schema8); + case "fixed": + return this._readFixed(schema8); + case "enum": + return this._readEnum(schema8, top); + case "map": + return this._readMap(schema8); + case "array": + return this._readArray(schema8); + case "union": + if (Object.keys(schema8).length > 1) { + throw new Error("union annotations are not supported"); + } + return this._readUnion(); + default: + var ref = this._typeRefs[schema8.type]; + if (ref) { + delete schema8.type; + utils.copyOwnProperties(ref, schema8); + } + return Object.keys(schema8).length > 1 ? schema8 : schema8.type; + } + }; + Reader.prototype._readFixed = function(schema8) { + var tk = this._tk; + if (!tk.next({ val: "(", silent: true })) { + schema8.name = tk.next({ id: "name" }).val; + tk.next({ val: "(" }); + } + schema8.size = parseInt(tk.next({ id: "number" }).val); + tk.next({ val: ")" }); + return schema8; + }; + Reader.prototype._readMap = function(schema8) { + var tk = this._tk; + var silent = this._implicitTags; + var implicitTags = tk.next({ val: "<", silent }) === void 0; + schema8.values = this._readType(); + tk.next({ val: ">", silent: implicitTags }); + return schema8; + }; + Reader.prototype._readArray = function(schema8) { + var tk = this._tk; + var silent = this._implicitTags; + var implicitTags = tk.next({ val: "<", silent }) === void 0; + schema8.items = this._readType(); + tk.next({ val: ">", silent: implicitTags }); + return schema8; + }; + Reader.prototype._readEnum = function(schema8, top) { + var tk = this._tk; + if (!tk.next({ val: "{", silent: true })) { + schema8.name = tk.next({ id: "name" }).val; + tk.next({ val: "{" }); + } + schema8.symbols = []; + do { + schema8.symbols.push(tk.next().val); + } while (!tk.next({ val: "}", silent: true }) && tk.next({ val: "," })); + if (top && tk.next({ val: "=", silent: true })) { + schema8.default = tk.next().val; + tk.next({ val: ";" }); + } + return schema8; + }; + Reader.prototype._readUnion = function() { + var tk = this._tk; + var arr = []; + tk.next({ val: "{" }); + do { + arr.push(this._readType()); + } while (!tk.next({ val: "}", silent: true }) && tk.next({ val: "," })); + return arr; + }; + Reader.prototype._readRecord = function(schema8) { + var tk = this._tk; + if (!tk.next({ val: "{", silent: true })) { + schema8.name = tk.next({ id: "name" }).val; + tk.next({ val: "{" }); + } + schema8.fields = []; + while (!tk.next({ val: "}", silent: true })) { + schema8.fields.push(this._readField()); + tk.next({ val: ";" }); + } + return schema8; + }; + Reader.prototype._readImports = function(imports, maybeMessage) { + var tk = this._tk; + var numImports = 0; + var pos = tk.pos; + while (tk.next({ val: "import", silent: true })) { + if (!numImports && maybeMessage && tk.next({ val: "(", silent: true })) { + tk.pos = pos; + return; + } + var kind = tk.next({ id: "name" }).val; + var fname = JSON.parse(tk.next({ id: "string" }).val); + tk.next({ val: ";" }); + imports.push({ kind, name: fname }); + numImports++; + } + return numImports; + }; + function Tokenizer(str2) { + this._str = str2; + this.pos = 0; + } + Tokenizer.prototype.next = function(opts) { + var token = { pos: this.pos, id: void 0, val: void 0 }; + var javadoc = this._skip(opts && opts.emitJavadoc); + if (typeof javadoc == "string") { + token.id = "javadoc"; + token.val = javadoc; + } else { + var pos = this.pos; + var str2 = this._str; + var c7 = str2.charAt(pos); + if (!c7) { + token.id = "(eof)"; + } else { + if (opts && opts.id === "json") { + token.id = "json"; + this.pos = this._endOfJson(); + } else if (c7 === '"') { + token.id = "string"; + this.pos = this._endOfString(); + } else if (/[0-9]/.test(c7)) { + token.id = "number"; + this.pos = this._endOf(/[0-9]/); + } else if (/[`A-Za-z_.]/.test(c7)) { + token.id = "name"; + this.pos = this._endOf(/[`A-Za-z0-9_.]/); + } else { + token.id = "operator"; + this.pos = pos + 1; + } + token.val = str2.slice(pos, this.pos); + if (token.id === "json") { + try { + token.val = JSON.parse(token.val); + } catch (err2) { + throw this.error("invalid JSON", token); + } + } else if (token.id === "name") { + token.val = token.val.replace(/`/g, ""); + } + } + } + var err; + if (opts && opts.id && opts.id !== token.id) { + err = this.error(f8("expected ID %s", opts.id), token); + } else if (opts && opts.val && opts.val !== token.val) { + err = this.error(f8("expected value %s", opts.val), token); + } + if (!err) { + return token; + } else if (opts && opts.silent) { + this.pos = token.pos; + return void 0; + } else { + throw err; + } + }; + Tokenizer.prototype.error = function(reason, context2) { + var isToken = typeof context2 != "number"; + var pos = isToken ? context2.pos : context2; + var str2 = this._str; + var lineNum = 1; + var lineStart = 0; + var i7; + for (i7 = 0; i7 < pos; i7++) { + if (str2.charAt(i7) === "\n") { + lineNum++; + lineStart = i7; + } + } + var msg = isToken ? f8("invalid token %j: %s", context2, reason) : reason; + var err = new Error(msg); + err.token = isToken ? context2 : void 0; + err.lineNum = lineNum; + err.colNum = pos - lineStart; + return err; + }; + Tokenizer.prototype._skip = function(emitJavadoc) { + var str2 = this._str; + var isJavadoc = false; + var pos, c7; + while ((c7 = str2.charAt(this.pos)) && /\s/.test(c7)) { + this.pos++; + } + pos = this.pos; + if (c7 === "/") { + switch (str2.charAt(this.pos + 1)) { + case "/": + this.pos += 2; + while ((c7 = str2.charAt(this.pos)) && c7 !== "\n") { + this.pos++; + } + return this._skip(emitJavadoc); + case "*": + this.pos += 2; + if (str2.charAt(this.pos) === "*") { + isJavadoc = true; + } + while (c7 = str2.charAt(this.pos++)) { + if (c7 === "*" && str2.charAt(this.pos) === "/") { + this.pos++; + if (isJavadoc && emitJavadoc) { + return extractJavadoc(str2.slice(pos + 3, this.pos - 2)); + } + return this._skip(emitJavadoc); + } + } + throw this.error("unterminated comment", pos); + } + } + }; + Tokenizer.prototype._endOf = function(pat) { + var pos = this.pos; + var str2 = this._str; + while (pat.test(str2.charAt(pos))) { + pos++; + } + return pos; + }; + Tokenizer.prototype._endOfString = function() { + var pos = this.pos + 1; + var str2 = this._str; + var c7; + while (c7 = str2.charAt(pos)) { + if (c7 === '"') { + return pos + 1; + } + if (c7 === "\\") { + pos += 2; + } else { + pos++; + } + } + throw this.error("unterminated string", pos - 1); + }; + Tokenizer.prototype._endOfJson = function() { + var pos = utils.jsonEnd(this._str, this.pos); + if (pos < 0) { + throw this.error("invalid JSON", pos); + } + return pos; + }; + function extractJavadoc(str2) { + var lines = str2.replace(/^[ \t]+|[ \t]+$/g, "").split("\n").map(function(line, i7) { + return i7 ? line.replace(/^\s*\*\s?/, "") : line; + }); + while (lines.length && !lines[0]) { + lines.shift(); + } + while (lines.length && !lines[lines.length - 1]) { + lines.pop(); + } + return lines.join("\n"); + } + function protocolNamespace(protocol) { + if (protocol.namespace) { + return protocol.namespace; + } + var match = /^(.*)\.[^.]+$/.exec(protocol.protocol); + return match ? match[1] : void 0; + } + module5.exports = { + Tokenizer, + assembleProtocol, + read, + readProtocol: Reader.readProtocol, + readSchema: Reader.readSchema + }; + } +}); + +// node_modules/avsc/etc/browser/avsc-services.js +var require_avsc_services = __commonJS({ + "node_modules/avsc/etc/browser/avsc-services.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var avroTypes = require_avsc_types(); + var services = require_services(); + var specs10 = require_specs3(); + var utils = require_utils8(); + function parse17(any, opts) { + var schemaOrProtocol = specs10.read(any); + return schemaOrProtocol.protocol ? services.Service.forProtocol(schemaOrProtocol, opts) : avroTypes.Type.forSchema(schemaOrProtocol, opts); + } + module5.exports = { + Service: services.Service, + assembleProtocol: specs10.assembleProtocol, + discoverProtocol: services.discoverProtocol, + parse: parse17, + readProtocol: specs10.readProtocol, + readSchema: specs10.readSchema + }; + utils.copyOwnProperties(avroTypes, module5.exports); + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-CjPlbOtt.js +function e8(e10, r8) { + if (null == e10) + throw new TypeError("Cannot convert first argument to object"); + for (var t8 = Object(e10), n7 = 1; n7 < arguments.length; n7++) { + var o7 = arguments[n7]; + if (null != o7) + for (var a7 = Object.keys(Object(o7)), l7 = 0, i7 = a7.length; l7 < i7; l7++) { + var c7 = a7[l7], b8 = Object.getOwnPropertyDescriptor(o7, c7); + void 0 !== b8 && b8.enumerable && (t8[c7] = o7[c7]); + } + } + return t8; +} +function i$52() { + if (a$62) + return c$42; + function e10(t8) { + return (e10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t9) { + return typeof t9; + } : function(t9) { + return t9 && "function" == typeof Symbol && t9.constructor === Symbol && t9 !== Symbol.prototype ? "symbol" : typeof t9; + })(t8); + } + function n7(t8, n8) { + return !n8 || "object" !== e10(n8) && "function" != typeof n8 ? function(t9) { + if (void 0 === t9) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return t9; + }(t8) : n8; + } + function r8(t8) { + return (r8 = Object.setPrototypeOf ? Object.getPrototypeOf : function(t9) { + return t9.__proto__ || Object.getPrototypeOf(t9); + })(t8); + } + function o7(t8, e11) { + return (o7 = Object.setPrototypeOf || function(t9, e12) { + return t9.__proto__ = e12, t9; + })(t8, e11); + } + a$62 = true; + var i7, u7, l7 = {}; + function f8(t8, e11, c7) { + c7 || (c7 = Error); + var a7 = function(c8) { + function a8(o8, c9, i8) { + var u8; + return !function(t9, e12) { + if (!(t9 instanceof e12)) + throw new TypeError("Cannot call a class as a function"); + }(this, a8), (u8 = n7(this, r8(a8).call(this, function(t9, n8, r9) { + return "string" == typeof e11 ? e11 : e11(t9, n8, r9); + }(o8, c9, i8)))).code = t8, u8; + } + return !function(t9, e12) { + if ("function" != typeof e12 && null !== e12) + throw new TypeError("Super expression must either be null or a function"); + t9.prototype = Object.create(e12 && e12.prototype, { constructor: { value: t9, writable: true, configurable: true } }), e12 && o7(t9, e12); + }(a8, c8), a8; + }(c7); + l7[t8] = a7; + } + function s7(t8, e11) { + if (Array.isArray(t8)) { + var n8 = t8.length; + return t8 = t8.map(function(t9) { + return String(t9); + }), n8 > 2 ? "one of ".concat(e11, " ").concat(t8.slice(0, n8 - 1).join(", "), ", or ") + t8[n8 - 1] : 2 === n8 ? "one of ".concat(e11, " ").concat(t8[0], " or ").concat(t8[1]) : "of ".concat(e11, " ").concat(t8[0]); + } + return "of ".concat(e11, " ").concat(String(t8)); + } + return f8("ERR_AMBIGUOUS_ARGUMENT", 'The "%s" argument is ambiguous. %s', TypeError), f8("ERR_INVALID_ARG_TYPE", function(t8, n8, r9) { + var o8, c7, u8; + if (void 0 === i7 && (i7 = tt2()), i7("string" == typeof t8, "'name' must be a string"), "string" == typeof n8 && (c7 = "not ", n8.substr(0, c7.length) === c7) ? (o8 = "must not be", n8 = n8.replace(/^not /, "")) : o8 = "must be", function(t9, e11, n9) { + return (void 0 === n9 || n9 > t9.length) && (n9 = t9.length), t9.substring(n9 - e11.length, n9) === e11; + }(t8, " argument")) + u8 = "The ".concat(t8, " ").concat(o8, " ").concat(s7(n8, "type")); + else { + var l8 = function(t9, e11, n9) { + return "number" != typeof n9 && (n9 = 0), !(n9 + e11.length > t9.length) && -1 !== t9.indexOf(e11, n9); + }(t8, ".") ? "property" : "argument"; + u8 = 'The "'.concat(t8, '" ').concat(l8, " ").concat(o8, " ").concat(s7(n8, "type")); + } + return u8 += ". Received type ".concat(e10(r9)); + }, TypeError), f8("ERR_INVALID_ARG_VALUE", function(e11, n8) { + var r9 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "is invalid"; + void 0 === u7 && (u7 = X2); + var o8 = u7.inspect(n8); + return o8.length > 128 && (o8 = "".concat(o8.slice(0, 128), "...")), "The argument '".concat(e11, "' ").concat(r9, ". Received ").concat(o8); + }, TypeError), f8("ERR_INVALID_RETURN_VALUE", function(t8, n8, r9) { + var o8; + return o8 = r9 && r9.constructor && r9.constructor.name ? "instance of ".concat(r9.constructor.name) : "type ".concat(e10(r9)), "Expected ".concat(t8, ' to be returned from the "').concat(n8, '"') + " function but got ".concat(o8, "."); + }, TypeError), f8("ERR_MISSING_ARGS", function() { + for (var t8 = arguments.length, e11 = new Array(t8), n8 = 0; n8 < t8; n8++) + e11[n8] = arguments[n8]; + void 0 === i7 && (i7 = tt2()), i7(e11.length > 0, "At least one arg needs to be specified"); + var r9 = "The ", o8 = e11.length; + switch (e11 = e11.map(function(t9) { + return '"'.concat(t9, '"'); + }), o8) { + case 1: + r9 += "".concat(e11[0], " argument"); + break; + case 2: + r9 += "".concat(e11[0], " and ").concat(e11[1], " arguments"); + break; + default: + r9 += e11.slice(0, o8 - 1).join(", "), r9 += ", and ".concat(e11[o8 - 1], " arguments"); + } + return "".concat(r9, " must be specified"); + }, TypeError), c$42.codes = l7, c$42; +} +function f$62() { + if (l$62) + return u$52; + l$62 = true; + var n7 = T$1; + function r8(t8, e10, n8) { + return e10 in t8 ? Object.defineProperty(t8, e10, { value: n8, enumerable: true, configurable: true, writable: true }) : t8[e10] = n8, t8; + } + function o7(t8, e10) { + for (var n8 = 0; n8 < e10.length; n8++) { + var r9 = e10[n8]; + r9.enumerable = r9.enumerable || false, r9.configurable = true, "value" in r9 && (r9.writable = true), Object.defineProperty(t8, r9.key, r9); + } + } + function c7(t8, e10) { + return !e10 || "object" !== y7(e10) && "function" != typeof e10 ? a7(t8) : e10; + } + function a7(t8) { + if (void 0 === t8) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return t8; + } + function f8(t8) { + var e10 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; + return (f8 = function(t9) { + if (null === t9 || (n8 = t9, -1 === Function.toString.call(n8).indexOf("[native code]"))) + return t9; + var n8; + if ("function" != typeof t9) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== e10) { + if (e10.has(t9)) + return e10.get(t9); + e10.set(t9, r9); + } + function r9() { + return p7(t9, arguments, h8(this).constructor); + } + return r9.prototype = Object.create(t9.prototype, { constructor: { value: r9, enumerable: false, writable: true, configurable: true } }), g7(r9, t9); + })(t8); + } + function s7() { + if ("undefined" == typeof Reflect || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if ("function" == typeof Proxy) + return true; + try { + return Date.prototype.toString.call(Reflect.construct(Date, [], function() { + })), true; + } catch (t8) { + return false; + } + } + function p7(t8, e10, n8) { + return (p7 = s7() ? Reflect.construct : function(t9, e11, n9) { + var r9 = [null]; + r9.push.apply(r9, e11); + var o8 = new (Function.bind.apply(t9, r9))(); + return n9 && g7(o8, n9.prototype), o8; + }).apply(null, arguments); + } + function g7(t8, e10) { + return (g7 = Object.setPrototypeOf || function(t9, e11) { + return t9.__proto__ = e11, t9; + })(t8, e10); + } + function h8(t8) { + return (h8 = Object.setPrototypeOf ? Object.getPrototypeOf : function(t9) { + return t9.__proto__ || Object.getPrototypeOf(t9); + })(t8); + } + function y7(t8) { + return (y7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t9) { + return typeof t9; + } : function(t9) { + return t9 && "function" == typeof Symbol && t9.constructor === Symbol && t9 !== Symbol.prototype ? "symbol" : typeof t9; + })(t8); + } + var b8 = X2.inspect, v8 = i$52().codes.ERR_INVALID_ARG_TYPE; + function d7(t8, e10, n8) { + return (void 0 === n8 || n8 > t8.length) && (n8 = t8.length), t8.substring(n8 - e10.length, n8) === e10; + } + var m7 = "", E6 = "", w6 = "", S6 = "", j6 = { deepStrictEqual: "Expected values to be strictly deep-equal:", strictEqual: "Expected values to be strictly equal:", strictEqualObject: 'Expected "actual" to be reference-equal to "expected":', deepEqual: "Expected values to be loosely deep-equal:", equal: "Expected values to be loosely equal:", notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:', notStrictEqual: 'Expected "actual" to be strictly unequal to:', notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":', notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:', notEqual: 'Expected "actual" to be loosely unequal to:', notIdentical: "Values identical but not reference-equal:" }; + function O7(t8) { + var e10 = Object.keys(t8), n8 = Object.create(Object.getPrototypeOf(t8)); + return e10.forEach(function(e11) { + n8[e11] = t8[e11]; + }), Object.defineProperty(n8, "message", { value: t8.message }), n8; + } + function x7(t8) { + return b8(t8, { compact: false, customInspect: false, depth: 1e3, maxArrayLength: 1 / 0, showHidden: false, breakLength: 1 / 0, showProxy: false, sorted: true, getters: true }); + } + function q5(t8, e10, r9) { + var o8 = "", c8 = "", a8 = 0, i7 = "", u7 = false, l7 = x7(t8), f9 = l7.split("\n"), s8 = x7(e10).split("\n"), p8 = 0, g8 = ""; + if ("strictEqual" === r9 && "object" === y7(t8) && "object" === y7(e10) && null !== t8 && null !== e10 && (r9 = "strictEqualObject"), 1 === f9.length && 1 === s8.length && f9[0] !== s8[0]) { + var h9 = f9[0].length + s8[0].length; + if (h9 <= 10) { + if (!("object" === y7(t8) && null !== t8 || "object" === y7(e10) && null !== e10 || 0 === t8 && 0 === e10)) + return "".concat(j6[r9], "\n\n") + "".concat(f9[0], " !== ").concat(s8[0], "\n"); + } else if ("strictEqualObject" !== r9) { + if (h9 < (n7.stderr && n7.stderr.isTTY ? n7.stderr.columns : 80)) { + for (; f9[0][p8] === s8[0][p8]; ) + p8++; + p8 > 2 && (g8 = "\n ".concat(function(t9, e11) { + if (e11 = Math.floor(e11), 0 == t9.length || 0 == e11) + return ""; + var n8 = t9.length * e11; + for (e11 = Math.floor(Math.log(e11) / Math.log(2)); e11; ) + t9 += t9, e11--; + return t9 += t9.substring(0, n8 - t9.length); + }(" ", p8), "^"), p8 = 0); + } + } + } + for (var b9 = f9[f9.length - 1], v9 = s8[s8.length - 1]; b9 === v9 && (p8++ < 2 ? i7 = "\n ".concat(b9).concat(i7) : o8 = b9, f9.pop(), s8.pop(), 0 !== f9.length && 0 !== s8.length); ) + b9 = f9[f9.length - 1], v9 = s8[s8.length - 1]; + var O8 = Math.max(f9.length, s8.length); + if (0 === O8) { + var q6 = l7.split("\n"); + if (q6.length > 30) + for (q6[26] = "".concat(m7, "...").concat(S6); q6.length > 27; ) + q6.pop(); + return "".concat(j6.notIdentical, "\n\n").concat(q6.join("\n"), "\n"); + } + p8 > 3 && (i7 = "\n".concat(m7, "...").concat(S6).concat(i7), u7 = true), "" !== o8 && (i7 = "\n ".concat(o8).concat(i7), o8 = ""); + var R7 = 0, A6 = j6[r9] + "\n".concat(E6, "+ actual").concat(S6, " ").concat(w6, "- expected").concat(S6), k6 = " ".concat(m7, "...").concat(S6, " Lines skipped"); + for (p8 = 0; p8 < O8; p8++) { + var _6 = p8 - a8; + if (f9.length < p8 + 1) + _6 > 1 && p8 > 2 && (_6 > 4 ? (c8 += "\n".concat(m7, "...").concat(S6), u7 = true) : _6 > 3 && (c8 += "\n ".concat(s8[p8 - 2]), R7++), c8 += "\n ".concat(s8[p8 - 1]), R7++), a8 = p8, o8 += "\n".concat(w6, "-").concat(S6, " ").concat(s8[p8]), R7++; + else if (s8.length < p8 + 1) + _6 > 1 && p8 > 2 && (_6 > 4 ? (c8 += "\n".concat(m7, "...").concat(S6), u7 = true) : _6 > 3 && (c8 += "\n ".concat(f9[p8 - 2]), R7++), c8 += "\n ".concat(f9[p8 - 1]), R7++), a8 = p8, c8 += "\n".concat(E6, "+").concat(S6, " ").concat(f9[p8]), R7++; + else { + var T6 = s8[p8], P6 = f9[p8], I6 = P6 !== T6 && (!d7(P6, ",") || P6.slice(0, -1) !== T6); + I6 && d7(T6, ",") && T6.slice(0, -1) === P6 && (I6 = false, P6 += ","), I6 ? (_6 > 1 && p8 > 2 && (_6 > 4 ? (c8 += "\n".concat(m7, "...").concat(S6), u7 = true) : _6 > 3 && (c8 += "\n ".concat(f9[p8 - 2]), R7++), c8 += "\n ".concat(f9[p8 - 1]), R7++), a8 = p8, c8 += "\n".concat(E6, "+").concat(S6, " ").concat(P6), o8 += "\n".concat(w6, "-").concat(S6, " ").concat(T6), R7 += 2) : (c8 += o8, o8 = "", 1 !== _6 && 0 !== p8 || (c8 += "\n ".concat(P6), R7++)); + } + if (R7 > 20 && p8 < O8 - 2) + return "".concat(A6).concat(k6, "\n").concat(c8, "\n").concat(m7, "...").concat(S6).concat(o8, "\n") + "".concat(m7, "...").concat(S6); + } + return "".concat(A6).concat(u7 ? k6 : "", "\n").concat(c8).concat(o8).concat(i7).concat(g8); + } + var R6 = function(t8) { + function e10(t9) { + var r9; + if (!function(t10, e11) { + if (!(t10 instanceof e11)) + throw new TypeError("Cannot call a class as a function"); + }(this, e10), "object" !== y7(t9) || null === t9) + throw new v8("options", "Object", t9); + var o8 = t9.message, i8 = t9.operator, u8 = t9.stackStartFn, l7 = t9.actual, f9 = t9.expected, s8 = Error.stackTraceLimit; + if (Error.stackTraceLimit = 0, null != o8) + r9 = c7(this, h8(e10).call(this, String(o8))); + else if (n7.stderr && n7.stderr.isTTY && (n7.stderr && n7.stderr.getColorDepth && 1 !== n7.stderr.getColorDepth() ? (m7 = "\x1B[34m", E6 = "\x1B[32m", S6 = "\x1B[39m", w6 = "\x1B[31m") : (m7 = "", E6 = "", S6 = "", w6 = "")), "object" === y7(l7) && null !== l7 && "object" === y7(f9) && null !== f9 && "stack" in l7 && l7 instanceof Error && "stack" in f9 && f9 instanceof Error && (l7 = O7(l7), f9 = O7(f9)), "deepStrictEqual" === i8 || "strictEqual" === i8) + r9 = c7(this, h8(e10).call(this, q5(l7, f9, i8))); + else if ("notDeepStrictEqual" === i8 || "notStrictEqual" === i8) { + var p8 = j6[i8], g8 = x7(l7).split("\n"); + if ("notStrictEqual" === i8 && "object" === y7(l7) && null !== l7 && (p8 = j6.notStrictEqualObject), g8.length > 30) + for (g8[26] = "".concat(m7, "...").concat(S6); g8.length > 27; ) + g8.pop(); + r9 = 1 === g8.length ? c7(this, h8(e10).call(this, "".concat(p8, " ").concat(g8[0]))) : c7(this, h8(e10).call(this, "".concat(p8, "\n\n").concat(g8.join("\n"), "\n"))); + } else { + var b9 = x7(l7), d8 = "", R7 = j6[i8]; + "notDeepEqual" === i8 || "notEqual" === i8 ? (b9 = "".concat(j6[i8], "\n\n").concat(b9)).length > 1024 && (b9 = "".concat(b9.slice(0, 1021), "...")) : (d8 = "".concat(x7(f9)), b9.length > 512 && (b9 = "".concat(b9.slice(0, 509), "...")), d8.length > 512 && (d8 = "".concat(d8.slice(0, 509), "...")), "deepEqual" === i8 || "equal" === i8 ? b9 = "".concat(R7, "\n\n").concat(b9, "\n\nshould equal\n\n") : d8 = " ".concat(i8, " ").concat(d8)), r9 = c7(this, h8(e10).call(this, "".concat(b9).concat(d8))); + } + return Error.stackTraceLimit = s8, r9.generatedMessage = !o8, Object.defineProperty(a7(r9), "name", { value: "AssertionError [ERR_ASSERTION]", enumerable: false, writable: true, configurable: true }), r9.code = "ERR_ASSERTION", r9.actual = l7, r9.expected = f9, r9.operator = i8, Error.captureStackTrace && Error.captureStackTrace(a7(r9), u8), r9.stack, r9.name = "AssertionError", c7(r9); + } + var i7, u7; + return !function(t9, e11) { + if ("function" != typeof e11 && null !== e11) + throw new TypeError("Super expression must either be null or a function"); + t9.prototype = Object.create(e11 && e11.prototype, { constructor: { value: t9, writable: true, configurable: true } }), e11 && g7(t9, e11); + }(e10, t8), i7 = e10, (u7 = [{ key: "toString", value: function() { + return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message); + } }, { key: b8.custom, value: function(t9, e11) { + return b8(this, function(t10) { + for (var e12 = 1; e12 < arguments.length; e12++) { + var n8 = null != arguments[e12] ? arguments[e12] : {}, o8 = Object.keys(n8); + "function" == typeof Object.getOwnPropertySymbols && (o8 = o8.concat(Object.getOwnPropertySymbols(n8).filter(function(t11) { + return Object.getOwnPropertyDescriptor(n8, t11).enumerable; + }))), o8.forEach(function(e13) { + r8(t10, e13, n8[e13]); + }); + } + return t10; + }({}, e11, { customInspect: false, depth: 0 })); + } }]) && o7(i7.prototype, u7), e10; + }(f8(Error)); + return u$52 = R6; +} +function s$32(t8, e10) { + return function(t9) { + if (Array.isArray(t9)) + return t9; + }(t8) || function(t9, e11) { + var n7 = [], r8 = true, o7 = false, c7 = void 0; + try { + for (var a7, i7 = t9[Symbol.iterator](); !(r8 = (a7 = i7.next()).done) && (n7.push(a7.value), !e11 || n7.length !== e11); r8 = true) + ; + } catch (t10) { + o7 = true, c7 = t10; + } finally { + try { + r8 || null == i7.return || i7.return(); + } finally { + if (o7) + throw c7; + } + } + return n7; + }(t8, e10) || function() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + }(); +} +function p$32(t8) { + return (p$32 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t9) { + return typeof t9; + } : function(t9) { + return t9 && "function" == typeof Symbol && t9.constructor === Symbol && t9 !== Symbol.prototype ? "symbol" : typeof t9; + })(t8); +} +function m$22(t8) { + return t8.call.bind(t8); +} +function U5(t8) { + if (0 === t8.length || t8.length > 10) + return true; + for (var e10 = 0; e10 < t8.length; e10++) { + var n7 = t8.charCodeAt(e10); + if (n7 < 48 || n7 > 57) + return true; + } + return 10 === t8.length && t8 >= Math.pow(2, 32); +} +function G4(t8) { + return Object.keys(t8).filter(U5).concat(v$12(t8).filter(Object.prototype.propertyIsEnumerable.bind(t8))); +} +function V4(t8, e10) { + if (t8 === e10) + return 0; + for (var n7 = t8.length, r8 = e10.length, o7 = 0, c7 = Math.min(n7, r8); o7 < c7; ++o7) + if (t8[o7] !== e10[o7]) { + n7 = t8[o7], r8 = e10[o7]; + break; + } + return n7 < r8 ? -1 : r8 < n7 ? 1 : 0; +} +function B5(t8, e10, n7, r8) { + if (t8 === e10) + return 0 !== t8 || (!n7 || b$12(t8, e10)); + if (n7) { + if ("object" !== p$32(t8)) + return "number" == typeof t8 && d$13(t8) && d$13(e10); + if ("object" !== p$32(e10) || null === t8 || null === e10) + return false; + if (Object.getPrototypeOf(t8) !== Object.getPrototypeOf(e10)) + return false; + } else { + if (null === t8 || "object" !== p$32(t8)) + return (null === e10 || "object" !== p$32(e10)) && t8 == e10; + if (null === e10 || "object" !== p$32(e10)) + return false; + } + var o7, c7, a7, i7, u7 = S5(t8); + if (u7 !== S5(e10)) + return false; + if (Array.isArray(t8)) { + if (t8.length !== e10.length) + return false; + var l7 = G4(t8), f8 = G4(e10); + return l7.length === f8.length && C5(t8, e10, n7, r8, 1, l7); + } + if ("[object Object]" === u7 && (!R5(t8) && R5(e10) || !k5(t8) && k5(e10))) + return false; + if (q4(t8)) { + if (!q4(e10) || Date.prototype.getTime.call(t8) !== Date.prototype.getTime.call(e10)) + return false; + } else if (A$12(t8)) { + if (!A$12(e10) || (a7 = t8, i7 = e10, !(g$12 ? a7.source === i7.source && a7.flags === i7.flags : RegExp.prototype.toString.call(a7) === RegExp.prototype.toString.call(i7)))) + return false; + } else if (_5(t8) || t8 instanceof Error) { + if (t8.message !== e10.message || t8.name !== e10.name) + return false; + } else { + if (x6(t8)) { + if (n7 || !L5(t8) && !M5(t8)) { + if (!function(t9, e11) { + return t9.byteLength === e11.byteLength && 0 === V4(new Uint8Array(t9.buffer, t9.byteOffset, t9.byteLength), new Uint8Array(e11.buffer, e11.byteOffset, e11.byteLength)); + }(t8, e10)) + return false; + } else if (!function(t9, e11) { + if (t9.byteLength !== e11.byteLength) + return false; + for (var n8 = 0; n8 < t9.byteLength; n8++) + if (t9[n8] !== e11[n8]) + return false; + return true; + }(t8, e10)) + return false; + var s7 = G4(t8), h8 = G4(e10); + return s7.length === h8.length && C5(t8, e10, n7, r8, 0, s7); + } + if (k5(t8)) + return !(!k5(e10) || t8.size !== e10.size) && C5(t8, e10, n7, r8, 2); + if (R5(t8)) + return !(!R5(e10) || t8.size !== e10.size) && C5(t8, e10, n7, r8, 3); + if (O5(t8)) { + if (c7 = e10, (o7 = t8).byteLength !== c7.byteLength || 0 !== V4(new Uint8Array(o7), new Uint8Array(c7))) + return false; + } else if (T5(t8) && !function(t9, e11) { + return P$12(t9) ? P$12(e11) && b$12(Number.prototype.valueOf.call(t9), Number.prototype.valueOf.call(e11)) : I5(t9) ? I5(e11) && String.prototype.valueOf.call(t9) === String.prototype.valueOf.call(e11) : D5(t9) ? D5(e11) && Boolean.prototype.valueOf.call(t9) === Boolean.prototype.valueOf.call(e11) : F5(t9) ? F5(e11) && BigInt.prototype.valueOf.call(t9) === BigInt.prototype.valueOf.call(e11) : N$12(e11) && Symbol.prototype.valueOf.call(t9) === Symbol.prototype.valueOf.call(e11); + }(t8, e10)) + return false; + } + return C5(t8, e10, n7, r8, 0); +} +function z5(t8, e10) { + return e10.filter(function(e11) { + return w$12(t8, e11); + }); +} +function C5(t8, e10, n7, r8, o7, c7) { + if (5 === arguments.length) { + c7 = Object.keys(t8); + var a7 = Object.keys(e10); + if (c7.length !== a7.length) + return false; + } + for (var i7 = 0; i7 < c7.length; i7++) + if (!E5(e10, c7[i7])) + return false; + if (n7 && 5 === arguments.length) { + var u7 = v$12(t8); + if (0 !== u7.length) { + var l7 = 0; + for (i7 = 0; i7 < u7.length; i7++) { + var f8 = u7[i7]; + if (w$12(t8, f8)) { + if (!w$12(e10, f8)) + return false; + c7.push(f8), l7++; + } else if (w$12(e10, f8)) + return false; + } + var s7 = v$12(e10); + if (u7.length !== s7.length && z5(e10, s7).length !== l7) + return false; + } else { + var p7 = v$12(e10); + if (0 !== p7.length && 0 !== z5(e10, p7).length) + return false; + } + } + if (0 === c7.length && (0 === o7 || 1 === o7 && 0 === t8.length || 0 === t8.size)) + return true; + if (void 0 === r8) + r8 = { val1: /* @__PURE__ */ new Map(), val2: /* @__PURE__ */ new Map(), position: 0 }; + else { + var g7 = r8.val1.get(t8); + if (void 0 !== g7) { + var h8 = r8.val2.get(e10); + if (void 0 !== h8) + return g7 === h8; + } + r8.position++; + } + r8.val1.set(t8, r8.position), r8.val2.set(e10, r8.position); + var y7 = Q4(t8, e10, n7, c7, r8, o7); + return r8.val1.delete(t8), r8.val2.delete(e10), y7; +} +function Y5(t8, e10, n7, r8) { + for (var o7 = h$13(t8), c7 = 0; c7 < o7.length; c7++) { + var a7 = o7[c7]; + if (B5(e10, a7, n7, r8)) + return t8.delete(a7), true; + } + return false; +} +function W4(t8) { + switch (p$32(t8)) { + case "undefined": + return null; + case "object": + return; + case "symbol": + return false; + case "string": + t8 = +t8; + case "number": + if (d$13(t8)) + return false; + } + return true; +} +function H4(t8, e10, n7) { + var r8 = W4(n7); + return null != r8 ? r8 : e10.has(r8) && !t8.has(r8); +} +function J4(t8, e10, n7, r8, o7) { + var c7 = W4(n7); + if (null != c7) + return c7; + var a7 = e10.get(c7); + return !(void 0 === a7 && !e10.has(c7) || !B5(r8, a7, false, o7)) && (!t8.has(c7) && B5(r8, a7, false, o7)); +} +function K4(t8, e10, n7, r8, o7, c7) { + for (var a7 = h$13(t8), i7 = 0; i7 < a7.length; i7++) { + var u7 = a7[i7]; + if (B5(n7, u7, o7, c7) && B5(r8, e10.get(u7), o7, c7)) + return t8.delete(u7), true; + } + return false; +} +function Q4(t8, e10, n7, r8, o7, c7) { + var a7 = 0; + if (2 === c7) { + if (!function(t9, e11, n8, r9) { + for (var o8 = null, c8 = h$13(t9), a8 = 0; a8 < c8.length; a8++) { + var i8 = c8[a8]; + if ("object" === p$32(i8) && null !== i8) + null === o8 && (o8 = /* @__PURE__ */ new Set()), o8.add(i8); + else if (!e11.has(i8)) { + if (n8) + return false; + if (!H4(t9, e11, i8)) + return false; + null === o8 && (o8 = /* @__PURE__ */ new Set()), o8.add(i8); + } + } + if (null !== o8) { + for (var u8 = h$13(e11), l8 = 0; l8 < u8.length; l8++) { + var f8 = u8[l8]; + if ("object" === p$32(f8) && null !== f8) { + if (!Y5(o8, f8, n8, r9)) + return false; + } else if (!n8 && !t9.has(f8) && !Y5(o8, f8, n8, r9)) + return false; + } + return 0 === o8.size; + } + return true; + }(t8, e10, n7, o7)) + return false; + } else if (3 === c7) { + if (!function(t9, e11, n8, r9) { + for (var o8 = null, c8 = y$22(t9), a8 = 0; a8 < c8.length; a8++) { + var i8 = s$32(c8[a8], 2), u8 = i8[0], l8 = i8[1]; + if ("object" === p$32(u8) && null !== u8) + null === o8 && (o8 = /* @__PURE__ */ new Set()), o8.add(u8); + else { + var f8 = e11.get(u8); + if (void 0 === f8 && !e11.has(u8) || !B5(l8, f8, n8, r9)) { + if (n8) + return false; + if (!J4(t9, e11, u8, l8, r9)) + return false; + null === o8 && (o8 = /* @__PURE__ */ new Set()), o8.add(u8); + } + } + } + if (null !== o8) { + for (var g7 = y$22(e11), h8 = 0; h8 < g7.length; h8++) { + var b8 = s$32(g7[h8], 2), v8 = (u8 = b8[0], b8[1]); + if ("object" === p$32(u8) && null !== u8) { + if (!K4(o8, t9, u8, v8, n8, r9)) + return false; + } else if (!(n8 || t9.has(u8) && B5(t9.get(u8), v8, false, r9) || K4(o8, t9, u8, v8, false, r9))) + return false; + } + return 0 === o8.size; + } + return true; + }(t8, e10, n7, o7)) + return false; + } else if (1 === c7) + for (; a7 < t8.length; a7++) { + if (!E5(t8, a7)) { + if (E5(e10, a7)) + return false; + for (var i7 = Object.keys(t8); a7 < i7.length; a7++) { + var u7 = i7[a7]; + if (!E5(e10, u7) || !B5(t8[u7], e10[u7], n7, o7)) + return false; + } + return i7.length === Object.keys(e10).length; + } + if (!E5(e10, a7) || !B5(t8[a7], e10[a7], n7, o7)) + return false; + } + for (a7 = 0; a7 < r8.length; a7++) { + var l7 = r8[a7]; + if (!B5(t8[l7], e10[l7], n7, o7)) + return false; + } + return true; +} +function tt2() { + if ($$12) + return Z4; + $$12 = true; + var o7 = T$1; + function c7(t8) { + return (c7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t9) { + return typeof t9; + } : function(t9) { + return t9 && "function" == typeof Symbol && t9.constructor === Symbol && t9 !== Symbol.prototype ? "symbol" : typeof t9; + })(t8); + } + var a7, u7, l7 = i$52().codes, s7 = l7.ERR_AMBIGUOUS_ARGUMENT, p7 = l7.ERR_INVALID_ARG_TYPE, g7 = l7.ERR_INVALID_ARG_VALUE, h8 = l7.ERR_INVALID_RETURN_VALUE, y7 = l7.ERR_MISSING_ARGS, b8 = f$62(), v8 = X2.inspect, d7 = X2.types, m$14 = d7.isPromise, E6 = d7.isRegExp, w6 = Object.assign ? Object.assign : r6.assign, S6 = Object.is ? Object.is : m5; + function j6() { + a7 = X4.isDeepEqual, u7 = X4.isDeepStrictEqual; + } + var O7 = false, x7 = Z4 = k6, q5 = {}; + function R6(t8) { + if (t8.message instanceof Error) + throw t8.message; + throw new b8(t8); + } + function A6(t8, e10, n7, r8) { + if (!n7) { + var o8 = false; + if (0 === e10) + o8 = true, r8 = "No value argument passed to `assert.ok()`"; + else if (r8 instanceof Error) + throw r8; + var c8 = new b8({ actual: n7, expected: true, message: r8, operator: "==", stackStartFn: t8 }); + throw c8.generatedMessage = o8, c8; + } + } + function k6() { + for (var t8 = arguments.length, e10 = new Array(t8), n7 = 0; n7 < t8; n7++) + e10[n7] = arguments[n7]; + A6.apply(void 0, [k6, e10.length].concat(e10)); + } + x7.fail = function t8(e10, n7, r8, c8, a8) { + var i7, u8 = arguments.length; + if (0 === u8) + i7 = "Failed"; + else if (1 === u8) + r8 = e10, e10 = void 0; + else { + if (false === O7) { + O7 = true; + var l8 = o7.emitWarning ? o7.emitWarning : console.warn.bind(console); + l8("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094"); + } + 2 === u8 && (c8 = "!="); + } + if (r8 instanceof Error) + throw r8; + var f8 = { actual: e10, expected: n7, operator: void 0 === c8 ? "fail" : c8, stackStartFn: a8 || t8 }; + void 0 !== r8 && (f8.message = r8); + var s8 = new b8(f8); + throw i7 && (s8.message = i7, s8.generatedMessage = true), s8; + }, x7.AssertionError = b8, x7.ok = k6, x7.equal = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + e10 != n7 && R6({ actual: e10, expected: n7, message: r8, operator: "==", stackStartFn: t8 }); + }, x7.notEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + e10 == n7 && R6({ actual: e10, expected: n7, message: r8, operator: "!=", stackStartFn: t8 }); + }, x7.deepEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + void 0 === a7 && j6(), a7(e10, n7) || R6({ actual: e10, expected: n7, message: r8, operator: "deepEqual", stackStartFn: t8 }); + }, x7.notDeepEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + void 0 === a7 && j6(), a7(e10, n7) && R6({ actual: e10, expected: n7, message: r8, operator: "notDeepEqual", stackStartFn: t8 }); + }, x7.deepStrictEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + void 0 === a7 && j6(), u7(e10, n7) || R6({ actual: e10, expected: n7, message: r8, operator: "deepStrictEqual", stackStartFn: t8 }); + }, x7.notDeepStrictEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + void 0 === a7 && j6(); + u7(e10, n7) && R6({ actual: e10, expected: n7, message: r8, operator: "notDeepStrictEqual", stackStartFn: t8 }); + }, x7.strictEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + S6(e10, n7) || R6({ actual: e10, expected: n7, message: r8, operator: "strictEqual", stackStartFn: t8 }); + }, x7.notStrictEqual = function t8(e10, n7, r8) { + if (arguments.length < 2) + throw new y7("actual", "expected"); + S6(e10, n7) && R6({ actual: e10, expected: n7, message: r8, operator: "notStrictEqual", stackStartFn: t8 }); + }; + var _6 = function t8(e10, n7, r8) { + var o8 = this; + !function(t9, e11) { + if (!(t9 instanceof e11)) + throw new TypeError("Cannot call a class as a function"); + }(this, t8), n7.forEach(function(t9) { + t9 in e10 && (void 0 !== r8 && "string" == typeof r8[t9] && E6(e10[t9]) && e10[t9].test(r8[t9]) ? o8[t9] = r8[t9] : o8[t9] = e10[t9]); + }); + }; + function T6(t8, e10, n7, r8, o8, c8) { + if (!(n7 in t8) || !u7(t8[n7], e10[n7])) { + if (!r8) { + var a8 = new _6(t8, o8), i7 = new _6(e10, o8, t8), l8 = new b8({ actual: a8, expected: i7, operator: "deepStrictEqual", stackStartFn: c8 }); + throw l8.actual = t8, l8.expected = e10, l8.operator = c8.name, l8; + } + R6({ actual: t8, expected: e10, message: r8, operator: c8.name, stackStartFn: c8 }); + } + } + function P6(t8, e10, n7, r8) { + if ("function" != typeof e10) { + if (E6(e10)) + return e10.test(t8); + if (2 === arguments.length) + throw new p7("expected", ["Function", "RegExp"], e10); + if ("object" !== c7(t8) || null === t8) { + var o8 = new b8({ actual: t8, expected: e10, message: n7, operator: "deepStrictEqual", stackStartFn: r8 }); + throw o8.operator = r8.name, o8; + } + var i7 = Object.keys(e10); + if (e10 instanceof Error) + i7.push("name", "message"); + else if (0 === i7.length) + throw new g7("error", e10, "may not be an empty object"); + return void 0 === a7 && j6(), i7.forEach(function(o9) { + "string" == typeof t8[o9] && E6(e10[o9]) && e10[o9].test(t8[o9]) || T6(t8, e10, o9, n7, i7, r8); + }), true; + } + return void 0 !== e10.prototype && t8 instanceof e10 || !Error.isPrototypeOf(e10) && true === e10.call({}, t8); + } + function I6(t8) { + if ("function" != typeof t8) + throw new p7("fn", "Function", t8); + try { + t8(); + } catch (t9) { + return t9; + } + return q5; + } + function D6(t8) { + return m$14(t8) || null !== t8 && "object" === c7(t8) && "function" == typeof t8.then && "function" == typeof t8.catch; + } + function F6(t8) { + return Promise.resolve().then(function() { + var e10; + if ("function" == typeof t8) { + if (!D6(e10 = t8())) + throw new h8("instance of Promise", "promiseFn", e10); + } else { + if (!D6(t8)) + throw new p7("promiseFn", ["Function", "Promise"], t8); + e10 = t8; + } + return Promise.resolve().then(function() { + return e10; + }).then(function() { + return q5; + }).catch(function(t9) { + return t9; + }); + }); + } + function N6(t8, e10, n7, r8) { + if ("string" == typeof n7) { + if (4 === arguments.length) + throw new p7("error", ["Object", "Error", "Function", "RegExp"], n7); + if ("object" === c7(e10) && null !== e10) { + if (e10.message === n7) + throw new s7("error/message", 'The error message "'.concat(e10.message, '" is identical to the message.')); + } else if (e10 === n7) + throw new s7("error/message", 'The error "'.concat(e10, '" is identical to the message.')); + r8 = n7, n7 = void 0; + } else if (null != n7 && "object" !== c7(n7) && "function" != typeof n7) + throw new p7("error", ["Object", "Error", "Function", "RegExp"], n7); + if (e10 === q5) { + var o8 = ""; + n7 && n7.name && (o8 += " (".concat(n7.name, ")")), o8 += r8 ? ": ".concat(r8) : "."; + var a8 = "rejects" === t8.name ? "rejection" : "exception"; + R6({ actual: void 0, expected: n7, operator: t8.name, message: "Missing expected ".concat(a8).concat(o8), stackStartFn: t8 }); + } + if (n7 && !P6(e10, n7, r8, t8)) + throw e10; + } + function L6(t8, e10, n7, r8) { + if (e10 !== q5) { + if ("string" == typeof n7 && (r8 = n7, n7 = void 0), !n7 || P6(e10, n7)) { + var o8 = r8 ? ": ".concat(r8) : ".", c8 = "doesNotReject" === t8.name ? "rejection" : "exception"; + R6({ actual: e10, expected: n7, operator: t8.name, message: "Got unwanted ".concat(c8).concat(o8, "\n") + 'Actual message: "'.concat(e10 && e10.message, '"'), stackStartFn: t8 }); + } + throw e10; + } + } + function M6() { + for (var t8 = arguments.length, e10 = new Array(t8), n7 = 0; n7 < t8; n7++) + e10[n7] = arguments[n7]; + A6.apply(void 0, [M6, e10.length].concat(e10)); + } + return x7.throws = function t8(e10) { + for (var n7 = arguments.length, r8 = new Array(n7 > 1 ? n7 - 1 : 0), o8 = 1; o8 < n7; o8++) + r8[o8 - 1] = arguments[o8]; + N6.apply(void 0, [t8, I6(e10)].concat(r8)); + }, x7.rejects = function t8(e10) { + for (var n7 = arguments.length, r8 = new Array(n7 > 1 ? n7 - 1 : 0), o8 = 1; o8 < n7; o8++) + r8[o8 - 1] = arguments[o8]; + return F6(e10).then(function(e11) { + return N6.apply(void 0, [t8, e11].concat(r8)); + }); + }, x7.doesNotThrow = function t8(e10) { + for (var n7 = arguments.length, r8 = new Array(n7 > 1 ? n7 - 1 : 0), o8 = 1; o8 < n7; o8++) + r8[o8 - 1] = arguments[o8]; + L6.apply(void 0, [t8, I6(e10)].concat(r8)); + }, x7.doesNotReject = function t8(e10) { + for (var n7 = arguments.length, r8 = new Array(n7 > 1 ? n7 - 1 : 0), o8 = 1; o8 < n7; o8++) + r8[o8 - 1] = arguments[o8]; + return F6(e10).then(function(e11) { + return L6.apply(void 0, [t8, e11].concat(r8)); + }); + }, x7.ifError = function t8(e10) { + if (null != e10) { + var n7 = "ifError got unwanted exception: "; + "object" === c7(e10) && "string" == typeof e10.message ? 0 === e10.message.length && e10.constructor ? n7 += e10.constructor.name : n7 += e10.message : n7 += v8(e10); + var r8 = new b8({ actual: e10, expected: null, operator: "ifError", message: n7, stackStartFn: t8 }), o8 = e10.stack; + if ("string" == typeof o8) { + var a8 = o8.split("\n"); + a8.shift(); + for (var i7 = r8.stack.split("\n"), u8 = 0; u8 < a8.length; u8++) { + var l8 = i7.indexOf(a8[u8]); + if (-1 !== l8) { + i7 = i7.slice(0, l8); + break; + } + } + r8.stack = "".concat(i7.join("\n"), "\n").concat(a8.join("\n")); + } + throw r8; + } + }, x7.strict = w6(M6, x7, { equal: x7.strictEqual, deepEqual: x7.deepStrictEqual, notEqual: x7.notStrictEqual, notDeepEqual: x7.notDeepStrictEqual }), x7.strict.strict = x7.strict, Z4; +} +var r6, t6, e$14, r$13, n7, o7, c7, l7, i7, a7, u7, f8, p7, s7, y5, b6, g5, h6, $4, j5, w5, r$23, e$23, o$14, n$14, a$13, c$14, l$14, u$14, f$14, t$13, f$23, e$32, l$23, t$23, n$23, o$23, r$32, e$42, o$33, t$33, n$32, y$12, a$23, i$14, d5, f$32, u$24, A5, l$32, v6, P5, c$23, t$42, p$13, o$42, i$23, a$32, l$42, r$42, n$42, i$32, o$52, c$32, f$42, u$32, s$14, a$42, l$52, p$22, m5, N5, e$52, i$42, n$52, t$52, u$42, a$52, m$13, o$62, s$22, f$52, c$42, a$62, u$52, l$62, g$12, h$13, y$22, b$12, v$12, d$13, E5, w$12, S5, j$12, O5, x6, q4, R5, A$12, k5, _5, T5, P$12, I5, D5, F5, N$12, L5, M5, X4, Z4, $$12, et2; +var init_chunk_CjPlbOtt = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-CjPlbOtt.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_D3uu3VYh(); + r6 = { assign: e8, polyfill: function() { + Object.assign || Object.defineProperty(Object, "assign", { enumerable: false, configurable: true, writable: true, value: e8 }); + } }; + e$14 = Object.prototype.toString; + r$13 = function(t8) { + var r8 = e$14.call(t8), n7 = "[object Arguments]" === r8; + return n7 || (n7 = "[object Array]" !== r8 && null !== t8 && "object" == typeof t8 && "number" == typeof t8.length && t8.length >= 0 && "[object Function]" === e$14.call(t8.callee)), n7; + }; + if (!Object.keys) { + n7 = Object.prototype.hasOwnProperty, o7 = Object.prototype.toString, c7 = r$13, l7 = Object.prototype.propertyIsEnumerable, i7 = !l7.call({ toString: null }, "toString"), a7 = l7.call(function() { + }, "prototype"), u7 = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], f8 = function(t8) { + var e10 = t8.constructor; + return e10 && e10.prototype === t8; + }, p7 = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }, s7 = function() { + if ("undefined" == typeof window) + return false; + for (var t8 in window) + try { + if (!p7["$" + t8] && n7.call(window, t8) && null !== window[t8] && "object" == typeof window[t8]) + try { + f8(window[t8]); + } catch (t9) { + return true; + } + } catch (t9) { + return true; + } + return false; + }(); + t6 = function(t8) { + var e10 = null !== t8 && "object" == typeof t8, r8 = "[object Function]" === o7.call(t8), l8 = c7(t8), p8 = e10 && "[object String]" === o7.call(t8), y7 = []; + if (!e10 && !r8 && !l8) + throw new TypeError("Object.keys called on a non-object"); + var b8 = a7 && r8; + if (p8 && t8.length > 0 && !n7.call(t8, 0)) + for (var g7 = 0; g7 < t8.length; ++g7) + y7.push(String(g7)); + if (l8 && t8.length > 0) + for (var h8 = 0; h8 < t8.length; ++h8) + y7.push(String(h8)); + else + for (var $5 in t8) + b8 && "prototype" === $5 || !n7.call(t8, $5) || y7.push(String($5)); + if (i7) + for (var j6 = function(t9) { + if ("undefined" == typeof window || !s7) + return f8(t9); + try { + return f8(t9); + } catch (t10) { + return false; + } + }(t8), w6 = 0; w6 < u7.length; ++w6) + j6 && "constructor" === u7[w6] || !n7.call(t8, u7[w6]) || y7.push(u7[w6]); + return y7; + }; + } + y5 = t6; + b6 = Array.prototype.slice; + g5 = r$13; + h6 = Object.keys; + $4 = h6 ? function(t8) { + return h6(t8); + } : y5; + j5 = Object.keys; + $4.shim = function() { + Object.keys ? function() { + var t8 = Object.keys(arguments); + return t8 && t8.length === arguments.length; + }(1, 2) || (Object.keys = function(t8) { + return g5(t8) ? j5(b6.call(t8)) : j5(t8); + }) : Object.keys = $4; + return Object.keys || $4; + }; + w5 = $4; + r$23 = w5; + e$23 = "function" == typeof Symbol && "symbol" == typeof Symbol("foo"); + o$14 = Object.prototype.toString; + n$14 = Array.prototype.concat; + a$13 = Object.defineProperty; + c$14 = a$13 && function() { + var t8 = {}; + try { + for (var r8 in a$13(t8, "x", { enumerable: false, value: t8 }), t8) + return false; + return t8.x === t8; + } catch (t9) { + return false; + } + }(); + l$14 = function(t8, r8, e10, n7) { + var l7; + (!(r8 in t8) || "function" == typeof (l7 = n7) && "[object Function]" === o$14.call(l7) && n7()) && (c$14 ? a$13(t8, r8, { configurable: true, enumerable: false, value: e10, writable: true }) : t8[r8] = e10); + }; + u$14 = function(t8, o7) { + var a7 = arguments.length > 2 ? arguments[2] : {}, c7 = r$23(o7); + e$23 && (c7 = n$14.call(c7, Object.getOwnPropertySymbols(o7))); + for (var u7 = 0; u7 < c7.length; u7 += 1) + l$14(t8, c7[u7], o7[c7[u7]], a7[c7[u7]]); + }; + u$14.supportsDescriptors = !!c$14; + f$14 = u$14; + t$13 = function() { + if ("function" != typeof Symbol || "function" != typeof Object.getOwnPropertySymbols) + return false; + if ("symbol" == typeof Symbol.iterator) + return true; + var t8 = {}, e10 = Symbol("test"), r8 = Object(e10); + if ("string" == typeof e10) + return false; + if ("[object Symbol]" !== Object.prototype.toString.call(e10)) + return false; + if ("[object Symbol]" !== Object.prototype.toString.call(r8)) + return false; + for (e10 in t8[e10] = 42, t8) + return false; + if ("function" == typeof Object.keys && 0 !== Object.keys(t8).length) + return false; + if ("function" == typeof Object.getOwnPropertyNames && 0 !== Object.getOwnPropertyNames(t8).length) + return false; + var o7 = Object.getOwnPropertySymbols(t8); + if (1 !== o7.length || o7[0] !== e10) + return false; + if (!Object.prototype.propertyIsEnumerable.call(t8, e10)) + return false; + if ("function" == typeof Object.getOwnPropertyDescriptor) { + var n7 = Object.getOwnPropertyDescriptor(t8, e10); + if (42 !== n7.value || true !== n7.enumerable) + return false; + } + return true; + }; + f$23 = ("undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : globalThis).Symbol; + e$32 = t$13; + l$23 = function() { + return "function" == typeof f$23 && ("function" == typeof Symbol && ("symbol" == typeof f$23("foo") && ("symbol" == typeof Symbol("bar") && e$32()))); + }; + t$23 = "Function.prototype.bind called on incompatible "; + n$23 = Array.prototype.slice; + o$23 = Object.prototype.toString; + r$32 = function(r8) { + var e10 = this; + if ("function" != typeof e10 || "[object Function]" !== o$23.call(e10)) + throw new TypeError(t$23 + e10); + for (var p7, i7 = n$23.call(arguments, 1), c7 = function() { + if (this instanceof p7) { + var t8 = e10.apply(this, i7.concat(n$23.call(arguments))); + return Object(t8) === t8 ? t8 : this; + } + return e10.apply(r8, i7.concat(n$23.call(arguments))); + }, a7 = Math.max(0, e10.length - i7.length), l7 = [], u7 = 0; u7 < a7; u7++) + l7.push("$" + u7); + if (p7 = Function("binder", "return function (" + l7.join(",") + "){ return binder.apply(this,arguments); }")(c7), e10.prototype) { + var y7 = function() { + }; + y7.prototype = e10.prototype, p7.prototype = new y7(), y7.prototype = null; + } + return p7; + }; + e$42 = Function.prototype.bind || r$32; + o$33 = TypeError; + t$33 = Object.getOwnPropertyDescriptor; + if (t$33) + try { + t$33({}, ""); + } catch (r8) { + t$33 = null; + } + n$32 = function() { + throw new o$33(); + }; + y$12 = t$33 ? function() { + try { + return arguments.callee, n$32; + } catch (r8) { + try { + return t$33(arguments, "callee").get; + } catch (r9) { + return n$32; + } + } + }() : n$32; + a$23 = l$23(); + i$14 = Object.getPrototypeOf || function(r8) { + return r8.__proto__; + }; + d5 = "undefined" == typeof Uint8Array ? void 0 : i$14(Uint8Array); + f$32 = { "%Array%": Array, "%ArrayBuffer%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer, "%ArrayBufferPrototype%": "undefined" == typeof ArrayBuffer ? void 0 : ArrayBuffer.prototype, "%ArrayIteratorPrototype%": a$23 ? i$14([][Symbol.iterator]()) : void 0, "%ArrayPrototype%": Array.prototype, "%ArrayProto_entries%": Array.prototype.entries, "%ArrayProto_forEach%": Array.prototype.forEach, "%ArrayProto_keys%": Array.prototype.keys, "%ArrayProto_values%": Array.prototype.values, "%AsyncFromSyncIteratorPrototype%": void 0, "%AsyncFunction%": void 0, "%AsyncFunctionPrototype%": void 0, "%AsyncGenerator%": void 0, "%AsyncGeneratorFunction%": void 0, "%AsyncGeneratorPrototype%": void 0, "%AsyncIteratorPrototype%": void 0, "%Atomics%": "undefined" == typeof Atomics ? void 0 : Atomics, "%Boolean%": Boolean, "%BooleanPrototype%": Boolean.prototype, "%DataView%": "undefined" == typeof DataView ? void 0 : DataView, "%DataViewPrototype%": "undefined" == typeof DataView ? void 0 : DataView.prototype, "%Date%": Date, "%DatePrototype%": Date.prototype, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": Error, "%ErrorPrototype%": Error.prototype, "%eval%": eval, "%EvalError%": EvalError, "%EvalErrorPrototype%": EvalError.prototype, "%Float32Array%": "undefined" == typeof Float32Array ? void 0 : Float32Array, "%Float32ArrayPrototype%": "undefined" == typeof Float32Array ? void 0 : Float32Array.prototype, "%Float64Array%": "undefined" == typeof Float64Array ? void 0 : Float64Array, "%Float64ArrayPrototype%": "undefined" == typeof Float64Array ? void 0 : Float64Array.prototype, "%Function%": Function, "%FunctionPrototype%": Function.prototype, "%Generator%": void 0, "%GeneratorFunction%": void 0, "%GeneratorPrototype%": void 0, "%Int8Array%": "undefined" == typeof Int8Array ? void 0 : Int8Array, "%Int8ArrayPrototype%": "undefined" == typeof Int8Array ? void 0 : Int8Array.prototype, "%Int16Array%": "undefined" == typeof Int16Array ? void 0 : Int16Array, "%Int16ArrayPrototype%": "undefined" == typeof Int16Array ? void 0 : Int8Array.prototype, "%Int32Array%": "undefined" == typeof Int32Array ? void 0 : Int32Array, "%Int32ArrayPrototype%": "undefined" == typeof Int32Array ? void 0 : Int32Array.prototype, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": a$23 ? i$14(i$14([][Symbol.iterator]())) : void 0, "%JSON%": "object" == typeof JSON ? JSON : void 0, "%JSONParse%": "object" == typeof JSON ? JSON.parse : void 0, "%Map%": "undefined" == typeof Map ? void 0 : Map, "%MapIteratorPrototype%": "undefined" != typeof Map && a$23 ? i$14((/* @__PURE__ */ new Map())[Symbol.iterator]()) : void 0, "%MapPrototype%": "undefined" == typeof Map ? void 0 : Map.prototype, "%Math%": Math, "%Number%": Number, "%NumberPrototype%": Number.prototype, "%Object%": Object, "%ObjectPrototype%": Object.prototype, "%ObjProto_toString%": Object.prototype.toString, "%ObjProto_valueOf%": Object.prototype.valueOf, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": "undefined" == typeof Promise ? void 0 : Promise, "%PromisePrototype%": "undefined" == typeof Promise ? void 0 : Promise.prototype, "%PromiseProto_then%": "undefined" == typeof Promise ? void 0 : Promise.prototype.then, "%Promise_all%": "undefined" == typeof Promise ? void 0 : Promise.all, "%Promise_reject%": "undefined" == typeof Promise ? void 0 : Promise.reject, "%Promise_resolve%": "undefined" == typeof Promise ? void 0 : Promise.resolve, "%Proxy%": "undefined" == typeof Proxy ? void 0 : Proxy, "%RangeError%": RangeError, "%RangeErrorPrototype%": RangeError.prototype, "%ReferenceError%": ReferenceError, "%ReferenceErrorPrototype%": ReferenceError.prototype, "%Reflect%": "undefined" == typeof Reflect ? void 0 : Reflect, "%RegExp%": RegExp, "%RegExpPrototype%": RegExp.prototype, "%Set%": "undefined" == typeof Set ? void 0 : Set, "%SetIteratorPrototype%": "undefined" != typeof Set && a$23 ? i$14((/* @__PURE__ */ new Set())[Symbol.iterator]()) : void 0, "%SetPrototype%": "undefined" == typeof Set ? void 0 : Set.prototype, "%SharedArrayBuffer%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer, "%SharedArrayBufferPrototype%": "undefined" == typeof SharedArrayBuffer ? void 0 : SharedArrayBuffer.prototype, "%String%": String, "%StringIteratorPrototype%": a$23 ? i$14(""[Symbol.iterator]()) : void 0, "%StringPrototype%": String.prototype, "%Symbol%": a$23 ? Symbol : void 0, "%SymbolPrototype%": a$23 ? Symbol.prototype : void 0, "%SyntaxError%": SyntaxError, "%SyntaxErrorPrototype%": SyntaxError.prototype, "%ThrowTypeError%": y$12, "%TypedArray%": d5, "%TypedArrayPrototype%": d5 ? d5.prototype : void 0, "%TypeError%": o$33, "%TypeErrorPrototype%": o$33.prototype, "%Uint8Array%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array, "%Uint8ArrayPrototype%": "undefined" == typeof Uint8Array ? void 0 : Uint8Array.prototype, "%Uint8ClampedArray%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray, "%Uint8ClampedArrayPrototype%": "undefined" == typeof Uint8ClampedArray ? void 0 : Uint8ClampedArray.prototype, "%Uint16Array%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array, "%Uint16ArrayPrototype%": "undefined" == typeof Uint16Array ? void 0 : Uint16Array.prototype, "%Uint32Array%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array, "%Uint32ArrayPrototype%": "undefined" == typeof Uint32Array ? void 0 : Uint32Array.prototype, "%URIError%": URIError, "%URIErrorPrototype%": URIError.prototype, "%WeakMap%": "undefined" == typeof WeakMap ? void 0 : WeakMap, "%WeakMapPrototype%": "undefined" == typeof WeakMap ? void 0 : WeakMap.prototype, "%WeakSet%": "undefined" == typeof WeakSet ? void 0 : WeakSet, "%WeakSetPrototype%": "undefined" == typeof WeakSet ? void 0 : WeakSet.prototype }; + u$24 = e$42.call(Function.call, String.prototype.replace); + A5 = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + l$32 = /\\(\\)?/g; + v6 = function(r8) { + var e10 = []; + return u$24(r8, A5, function(r9, o7, t8, n7) { + e10[e10.length] = t8 ? u$24(n7, l$32, "$1") : o7 || r9; + }), e10; + }; + P5 = function(r8, e10) { + if (!(r8 in f$32)) + throw new SyntaxError("intrinsic " + r8 + " does not exist!"); + if (void 0 === f$32[r8] && !e10) + throw new o$33("intrinsic " + r8 + " exists, but is not available. Please file an issue!"); + return f$32[r8]; + }; + c$23 = function(r8, e10) { + if (0 === r8.length) + throw new TypeError("intrinsic name must be a non-empty string"); + if (arguments.length > 1 && "boolean" != typeof e10) + throw new TypeError('"allowMissing" argument must be a boolean'); + for (var n7 = v6(r8), y7 = P5("%" + (n7.length > 0 ? n7[0] : "") + "%", e10), a7 = 1; a7 < n7.length; a7 += 1) + if (null != y7) + if (t$33 && a7 + 1 >= n7.length) { + var i7 = t$33(y7, n7[a7]); + if (!(n7[a7] in y7)) + throw new o$33("base intrinsic for " + r8 + " exists, but the property is not available."); + y7 = i7 ? i7.get || i7.value : y7[n7[a7]]; + } else + y7 = y7[n7[a7]]; + return y7; + }; + p$13 = e$42; + o$42 = c$23("%Function%"); + i$23 = o$42.apply; + a$32 = o$42.call; + (t$42 = function() { + return p$13.apply(a$32, arguments); + }).apply = function() { + return p$13.apply(i$23, arguments); + }; + l$42 = t$42; + i$32 = function(t8) { + return t8 != t8; + }; + o$52 = (r$42 = function(t8, e10) { + return 0 === t8 && 0 === e10 ? 1 / t8 == 1 / e10 : t8 === e10 || !(!i$32(t8) || !i$32(e10)); + }, r$42); + c$32 = (n$42 = function() { + return "function" == typeof Object.is ? Object.is : o$52; + }, n$42); + f$42 = f$14; + u$32 = f$14; + s$14 = r$42; + a$42 = n$42; + l$52 = function() { + var t8 = c$32(); + return f$42(Object, { is: t8 }, { is: function() { + return Object.is !== t8; + } }), t8; + }; + p$22 = l$42(a$42(), Object); + u$32(p$22, { getPolyfill: a$42, implementation: s$14, shim: l$52 }); + m5 = p$22; + N5 = function(r8) { + return r8 != r8; + }; + i$42 = N5; + n$52 = (e$52 = function() { + return Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a") ? Number.isNaN : i$42; + }, f$14); + t$52 = e$52; + u$42 = f$14; + a$52 = N5; + m$13 = e$52; + o$62 = function() { + var r8 = t$52(); + return n$52(Number, { isNaN: r8 }, { isNaN: function() { + return Number.isNaN !== r8; + } }), r8; + }; + s$22 = m$13(); + u$42(s$22, { getPolyfill: m$13, implementation: a$52, shim: o$62 }); + f$52 = s$22; + c$42 = {}; + a$62 = false; + u$52 = {}; + l$62 = false; + g$12 = void 0 !== /a/g.flags; + h$13 = function(t8) { + var e10 = []; + return t8.forEach(function(t9) { + return e10.push(t9); + }), e10; + }; + y$22 = function(t8) { + var e10 = []; + return t8.forEach(function(t9, n7) { + return e10.push([n7, t9]); + }), e10; + }; + b$12 = Object.is ? Object.is : m5; + v$12 = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() { + return []; + }; + d$13 = Number.isNaN ? Number.isNaN : f$52; + E5 = m$22(Object.prototype.hasOwnProperty); + w$12 = m$22(Object.prototype.propertyIsEnumerable); + S5 = m$22(Object.prototype.toString); + j$12 = X2.types; + O5 = j$12.isAnyArrayBuffer; + x6 = j$12.isArrayBufferView; + q4 = j$12.isDate; + R5 = j$12.isMap; + A$12 = j$12.isRegExp; + k5 = j$12.isSet; + _5 = j$12.isNativeError; + T5 = j$12.isBoxedPrimitive; + P$12 = j$12.isNumberObject; + I5 = j$12.isStringObject; + D5 = j$12.isBooleanObject; + F5 = j$12.isBigIntObject; + N$12 = j$12.isSymbolObject; + L5 = j$12.isFloat32Array; + M5 = j$12.isFloat64Array; + X4 = { isDeepEqual: function(t8, e10) { + return B5(t8, e10, false); + }, isDeepStrictEqual: function(t8, e10) { + return B5(t8, e10, true); + } }; + Z4 = {}; + $$12 = false; + et2 = tt2(); + et2.AssertionError; + et2.deepEqual; + et2.deepStrictEqual; + et2.doesNotReject; + et2.doesNotThrow; + et2.equal; + et2.fail; + et2.ifError; + et2.notDeepEqual; + et2.notDeepStrictEqual; + et2.notEqual; + et2.notStrictEqual; + et2.ok; + et2.rejects; + et2.strict; + et2.strictEqual; + et2.throws; + et2.AssertionError; + et2.deepEqual; + et2.deepStrictEqual; + et2.doesNotReject; + et2.doesNotThrow; + et2.equal; + et2.fail; + et2.ifError; + et2.notDeepEqual; + et2.notDeepStrictEqual; + et2.notEqual; + et2.notStrictEqual; + et2.ok; + et2.rejects; + et2.strict; + et2.strictEqual; + et2.throws; + et2.AssertionError; + et2.deepEqual; + et2.deepStrictEqual; + et2.doesNotReject; + et2.doesNotThrow; + et2.equal; + et2.fail; + et2.ifError; + et2.notDeepEqual; + et2.notDeepStrictEqual; + et2.notEqual; + et2.notStrictEqual; + et2.ok; + et2.rejects; + et2.strict; + et2.strictEqual; + et2.throws; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/zlib.js +var zlib_exports = {}; +__export(zlib_exports, { + Deflate: () => Deflate, + DeflateRaw: () => DeflateRaw, + Gunzip: () => Gunzip, + Gzip: () => Gzip, + Inflate: () => Inflate, + InflateRaw: () => InflateRaw, + Unzip: () => Unzip, + Z_BEST_COMPRESSION: () => Z_BEST_COMPRESSION, + Z_BEST_SPEED: () => Z_BEST_SPEED, + Z_BINARY: () => Z_BINARY, + Z_BLOCK: () => Z_BLOCK, + Z_BUF_ERROR: () => Z_BUF_ERROR, + Z_DATA_ERROR: () => Z_DATA_ERROR, + Z_DEFAULT_CHUNK: () => Z_DEFAULT_CHUNK, + Z_DEFAULT_COMPRESSION: () => Z_DEFAULT_COMPRESSION, + Z_DEFAULT_LEVEL: () => Z_DEFAULT_LEVEL, + Z_DEFAULT_MEMLEVEL: () => Z_DEFAULT_MEMLEVEL, + Z_DEFAULT_STRATEGY: () => Z_DEFAULT_STRATEGY, + Z_DEFAULT_WINDOWBITS: () => Z_DEFAULT_WINDOWBITS, + Z_DEFLATED: () => Z_DEFLATED, + Z_ERRNO: () => Z_ERRNO, + Z_FILTERED: () => Z_FILTERED, + Z_FINISH: () => Z_FINISH, + Z_FIXED: () => Z_FIXED, + Z_FULL_FLUSH: () => Z_FULL_FLUSH, + Z_HUFFMAN_ONLY: () => Z_HUFFMAN_ONLY, + Z_MAX_CHUNK: () => Z_MAX_CHUNK, + Z_MAX_LEVEL: () => Z_MAX_LEVEL, + Z_MAX_MEMLEVEL: () => Z_MAX_MEMLEVEL, + Z_MAX_WINDOWBITS: () => Z_MAX_WINDOWBITS, + Z_MIN_CHUNK: () => Z_MIN_CHUNK, + Z_MIN_LEVEL: () => Z_MIN_LEVEL, + Z_MIN_MEMLEVEL: () => Z_MIN_MEMLEVEL, + Z_MIN_WINDOWBITS: () => Z_MIN_WINDOWBITS, + Z_NEED_DICT: () => Z_NEED_DICT, + Z_NO_COMPRESSION: () => Z_NO_COMPRESSION, + Z_NO_FLUSH: () => Z_NO_FLUSH, + Z_OK: () => Z_OK, + Z_PARTIAL_FLUSH: () => Z_PARTIAL_FLUSH, + Z_RLE: () => Z_RLE, + Z_STREAM_END: () => Z_STREAM_END, + Z_STREAM_ERROR: () => Z_STREAM_ERROR, + Z_SYNC_FLUSH: () => Z_SYNC_FLUSH, + Z_TEXT: () => Z_TEXT, + Z_TREES: () => Z_TREES, + Z_UNKNOWN: () => Z_UNKNOWN, + Zlib: () => Zlib, + codes: () => codes, + createDeflate: () => createDeflate, + createDeflateRaw: () => createDeflateRaw, + createGunzip: () => createGunzip, + createGzip: () => createGzip, + createInflate: () => createInflate, + createInflateRaw: () => createInflateRaw, + createUnzip: () => createUnzip, + default: () => exports21, + deflate: () => deflate, + deflateRaw: () => deflateRaw, + deflateRawSync: () => deflateRawSync, + deflateSync: () => deflateSync, + gunzip: () => gunzip, + gunzipSync: () => gunzipSync, + gzip: () => gzip, + gzipSync: () => gzipSync, + inflate: () => inflate, + inflateRaw: () => inflateRaw, + inflateRawSync: () => inflateRawSync, + inflateSync: () => inflateSync, + unzip: () => unzip2, + unzipSync: () => unzipSync +}); +function dew$c5() { + if (_dewExec$c5) + return exports$d5; + _dewExec$c5 = true; + function ZStream() { + this.input = null; + this.next_in = 0; + this.avail_in = 0; + this.total_in = 0; + this.output = null; + this.next_out = 0; + this.avail_out = 0; + this.total_out = 0; + this.msg = ""; + this.state = null; + this.data_type = 2; + this.adler = 0; + } + exports$d5 = ZStream; + return exports$d5; +} +function dew$b6() { + if (_dewExec$b6) + return exports$c6; + _dewExec$b6 = true; + var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; + function _has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + } + exports$c6.assign = function(obj) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { + continue; + } + if (typeof source !== "object") { + throw new TypeError(source + "must be non-object"); + } + for (var p7 in source) { + if (_has(source, p7)) { + obj[p7] = source[p7]; + } + } + } + return obj; + }; + exports$c6.shrinkBuf = function(buf, size2) { + if (buf.length === size2) { + return buf; + } + if (buf.subarray) { + return buf.subarray(0, size2); + } + buf.length = size2; + return buf; + }; + var fnTyped = { + arraySet: function(dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + for (var i7 = 0; i7 < len; i7++) { + dest[dest_offs + i7] = src[src_offs + i7]; + } + }, + // Join array of chunks to single array. + flattenChunks: function(chunks) { + var i7, l7, len, pos, chunk2, result2; + len = 0; + for (i7 = 0, l7 = chunks.length; i7 < l7; i7++) { + len += chunks[i7].length; + } + result2 = new Uint8Array(len); + pos = 0; + for (i7 = 0, l7 = chunks.length; i7 < l7; i7++) { + chunk2 = chunks[i7]; + result2.set(chunk2, pos); + pos += chunk2.length; + } + return result2; + } + }; + var fnUntyped = { + arraySet: function(dest, src, src_offs, len, dest_offs) { + for (var i7 = 0; i7 < len; i7++) { + dest[dest_offs + i7] = src[src_offs + i7]; + } + }, + // Join array of chunks to single array. + flattenChunks: function(chunks) { + return [].concat.apply([], chunks); + } + }; + exports$c6.setTyped = function(on4) { + if (on4) { + exports$c6.Buf8 = Uint8Array; + exports$c6.Buf16 = Uint16Array; + exports$c6.Buf32 = Int32Array; + exports$c6.assign(exports$c6, fnTyped); + } else { + exports$c6.Buf8 = Array; + exports$c6.Buf16 = Array; + exports$c6.Buf32 = Array; + exports$c6.assign(exports$c6, fnUntyped); + } + }; + exports$c6.setTyped(TYPED_OK); + return exports$c6; +} +function dew$a6() { + if (_dewExec$a6) + return exports$b6; + _dewExec$a6 = true; + var utils = dew$b6(); + var Z_FIXED2 = 4; + var Z_BINARY2 = 0; + var Z_TEXT2 = 1; + var Z_UNKNOWN2 = 2; + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + var STORED_BLOCK = 0; + var STATIC_TREES = 1; + var DYN_TREES = 2; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var Buf_size = 16; + var MAX_BL_BITS = 7; + var END_BLOCK = 256; + var REP_3_6 = 16; + var REPZ_3_10 = 17; + var REPZ_11_138 = 18; + var extra_lbits = ( + /* extra bits for each length code */ + [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] + ); + var extra_dbits = ( + /* extra bits for each distance code */ + [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] + ); + var extra_blbits = ( + /* extra bits for each bit length code */ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7] + ); + var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + var DIST_CODE_LEN = 512; + var static_ltree = new Array((L_CODES + 2) * 2); + zero(static_ltree); + var static_dtree = new Array(D_CODES * 2); + zero(static_dtree); + var _dist_code = new Array(DIST_CODE_LEN); + zero(_dist_code); + var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); + zero(_length_code); + var base_length = new Array(LENGTH_CODES); + zero(base_length); + var base_dist = new Array(D_CODES); + zero(base_dist); + function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + this.static_tree = static_tree; + this.extra_bits = extra_bits; + this.extra_base = extra_base; + this.elems = elems; + this.max_length = max_length; + this.has_stree = static_tree && static_tree.length; + } + var static_l_desc; + var static_d_desc; + var static_bl_desc; + function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; + this.max_code = 0; + this.stat_desc = stat_desc; + } + function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; + } + function put_short(s7, w6) { + s7.pending_buf[s7.pending++] = w6 & 255; + s7.pending_buf[s7.pending++] = w6 >>> 8 & 255; + } + function send_bits(s7, value2, length) { + if (s7.bi_valid > Buf_size - length) { + s7.bi_buf |= value2 << s7.bi_valid & 65535; + put_short(s7, s7.bi_buf); + s7.bi_buf = value2 >> Buf_size - s7.bi_valid; + s7.bi_valid += length - Buf_size; + } else { + s7.bi_buf |= value2 << s7.bi_valid & 65535; + s7.bi_valid += length; + } + } + function send_code(s7, c7, tree) { + send_bits( + s7, + tree[c7 * 2], + tree[c7 * 2 + 1] + /*.Len*/ + ); + } + function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; + } + function bi_flush(s7) { + if (s7.bi_valid === 16) { + put_short(s7, s7.bi_buf); + s7.bi_buf = 0; + s7.bi_valid = 0; + } else if (s7.bi_valid >= 8) { + s7.pending_buf[s7.pending++] = s7.bi_buf & 255; + s7.bi_buf >>= 8; + s7.bi_valid -= 8; + } + } + function gen_bitlen(s7, desc) { + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h8; + var n7, m7; + var bits; + var xbits; + var f8; + var overflow = 0; + for (bits = 0; bits <= MAX_BITS; bits++) { + s7.bl_count[bits] = 0; + } + tree[s7.heap[s7.heap_max] * 2 + 1] = 0; + for (h8 = s7.heap_max + 1; h8 < HEAP_SIZE; h8++) { + n7 = s7.heap[h8]; + bits = tree[tree[n7 * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n7 * 2 + 1] = bits; + if (n7 > max_code) { + continue; + } + s7.bl_count[bits]++; + xbits = 0; + if (n7 >= base) { + xbits = extra[n7 - base]; + } + f8 = tree[n7 * 2]; + s7.opt_len += f8 * (bits + xbits); + if (has_stree) { + s7.static_len += f8 * (stree[n7 * 2 + 1] + xbits); + } + } + if (overflow === 0) { + return; + } + do { + bits = max_length - 1; + while (s7.bl_count[bits] === 0) { + bits--; + } + s7.bl_count[bits]--; + s7.bl_count[bits + 1] += 2; + s7.bl_count[max_length]--; + overflow -= 2; + } while (overflow > 0); + for (bits = max_length; bits !== 0; bits--) { + n7 = s7.bl_count[bits]; + while (n7 !== 0) { + m7 = s7.heap[--h8]; + if (m7 > max_code) { + continue; + } + if (tree[m7 * 2 + 1] !== bits) { + s7.opt_len += (bits - tree[m7 * 2 + 1]) * tree[m7 * 2]; + tree[m7 * 2 + 1] = bits; + } + n7--; + } + } + } + function gen_codes(tree, max_code, bl_count) { + var next_code = new Array(MAX_BITS + 1); + var code = 0; + var bits; + var n7; + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = code + bl_count[bits - 1] << 1; + } + for (n7 = 0; n7 <= max_code; n7++) { + var len = tree[n7 * 2 + 1]; + if (len === 0) { + continue; + } + tree[n7 * 2] = bi_reverse(next_code[len]++, len); + } + } + function tr_static_init() { + var n7; + var bits; + var length; + var code; + var dist; + var bl_count = new Array(MAX_BITS + 1); + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n7 = 0; n7 < 1 << extra_lbits[code]; n7++) { + _length_code[length++] = code; + } + } + _length_code[length - 1] = code; + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n7 = 0; n7 < 1 << extra_dbits[code]; n7++) { + _dist_code[dist++] = code; + } + } + dist >>= 7; + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n7 = 0; n7 < 1 << extra_dbits[code] - 7; n7++) { + _dist_code[256 + dist++] = code; + } + } + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + n7 = 0; + while (n7 <= 143) { + static_ltree[n7 * 2 + 1] = 8; + n7++; + bl_count[8]++; + } + while (n7 <= 255) { + static_ltree[n7 * 2 + 1] = 9; + n7++; + bl_count[9]++; + } + while (n7 <= 279) { + static_ltree[n7 * 2 + 1] = 7; + n7++; + bl_count[7]++; + } + while (n7 <= 287) { + static_ltree[n7 * 2 + 1] = 8; + n7++; + bl_count[8]++; + } + gen_codes(static_ltree, L_CODES + 1, bl_count); + for (n7 = 0; n7 < D_CODES; n7++) { + static_dtree[n7 * 2 + 1] = 5; + static_dtree[n7 * 2] = bi_reverse(n7, 5); + } + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + } + function init_block(s7) { + var n7; + for (n7 = 0; n7 < L_CODES; n7++) { + s7.dyn_ltree[n7 * 2] = 0; + } + for (n7 = 0; n7 < D_CODES; n7++) { + s7.dyn_dtree[n7 * 2] = 0; + } + for (n7 = 0; n7 < BL_CODES; n7++) { + s7.bl_tree[n7 * 2] = 0; + } + s7.dyn_ltree[END_BLOCK * 2] = 1; + s7.opt_len = s7.static_len = 0; + s7.last_lit = s7.matches = 0; + } + function bi_windup(s7) { + if (s7.bi_valid > 8) { + put_short(s7, s7.bi_buf); + } else if (s7.bi_valid > 0) { + s7.pending_buf[s7.pending++] = s7.bi_buf; + } + s7.bi_buf = 0; + s7.bi_valid = 0; + } + function copy_block(s7, buf, len, header) { + bi_windup(s7); + { + put_short(s7, len); + put_short(s7, ~len); + } + utils.arraySet(s7.pending_buf, s7.window, buf, len, s7.pending); + s7.pending += len; + } + function smaller(tree, n7, m7, depth) { + var _n2 = n7 * 2; + var _m2 = m7 * 2; + return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n7] <= depth[m7]; + } + function pqdownheap(s7, tree, k6) { + var v8 = s7.heap[k6]; + var j6 = k6 << 1; + while (j6 <= s7.heap_len) { + if (j6 < s7.heap_len && smaller(tree, s7.heap[j6 + 1], s7.heap[j6], s7.depth)) { + j6++; + } + if (smaller(tree, v8, s7.heap[j6], s7.depth)) { + break; + } + s7.heap[k6] = s7.heap[j6]; + k6 = j6; + j6 <<= 1; + } + s7.heap[k6] = v8; + } + function compress_block(s7, ltree, dtree) { + var dist; + var lc; + var lx = 0; + var code; + var extra; + if (s7.last_lit !== 0) { + do { + dist = s7.pending_buf[s7.d_buf + lx * 2] << 8 | s7.pending_buf[s7.d_buf + lx * 2 + 1]; + lc = s7.pending_buf[s7.l_buf + lx]; + lx++; + if (dist === 0) { + send_code(s7, lc, ltree); + } else { + code = _length_code[lc]; + send_code(s7, code + LITERALS + 1, ltree); + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s7, lc, extra); + } + dist--; + code = d_code(dist); + send_code(s7, code, dtree); + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s7, dist, extra); + } + } + } while (lx < s7.last_lit); + } + send_code(s7, END_BLOCK, ltree); + } + function build_tree(s7, desc) { + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n7, m7; + var max_code = -1; + var node; + s7.heap_len = 0; + s7.heap_max = HEAP_SIZE; + for (n7 = 0; n7 < elems; n7++) { + if (tree[n7 * 2] !== 0) { + s7.heap[++s7.heap_len] = max_code = n7; + s7.depth[n7] = 0; + } else { + tree[n7 * 2 + 1] = 0; + } + } + while (s7.heap_len < 2) { + node = s7.heap[++s7.heap_len] = max_code < 2 ? ++max_code : 0; + tree[node * 2] = 1; + s7.depth[node] = 0; + s7.opt_len--; + if (has_stree) { + s7.static_len -= stree[node * 2 + 1]; + } + } + desc.max_code = max_code; + for (n7 = s7.heap_len >> 1; n7 >= 1; n7--) { + pqdownheap(s7, tree, n7); + } + node = elems; + do { + n7 = s7.heap[ + 1 + /*SMALLEST*/ + ]; + s7.heap[ + 1 + /*SMALLEST*/ + ] = s7.heap[s7.heap_len--]; + pqdownheap( + s7, + tree, + 1 + /*SMALLEST*/ + ); + m7 = s7.heap[ + 1 + /*SMALLEST*/ + ]; + s7.heap[--s7.heap_max] = n7; + s7.heap[--s7.heap_max] = m7; + tree[node * 2] = tree[n7 * 2] + tree[m7 * 2]; + s7.depth[node] = (s7.depth[n7] >= s7.depth[m7] ? s7.depth[n7] : s7.depth[m7]) + 1; + tree[n7 * 2 + 1] = tree[m7 * 2 + 1] = node; + s7.heap[ + 1 + /*SMALLEST*/ + ] = node++; + pqdownheap( + s7, + tree, + 1 + /*SMALLEST*/ + ); + } while (s7.heap_len >= 2); + s7.heap[--s7.heap_max] = s7.heap[ + 1 + /*SMALLEST*/ + ]; + gen_bitlen(s7, desc); + gen_codes(tree, max_code, s7.bl_count); + } + function scan_tree(s7, tree, max_code) { + var n7; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count2 = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = 65535; + for (n7 = 0; n7 <= max_code; n7++) { + curlen = nextlen; + nextlen = tree[(n7 + 1) * 2 + 1]; + if (++count2 < max_count && curlen === nextlen) { + continue; + } else if (count2 < min_count) { + s7.bl_tree[curlen * 2] += count2; + } else if (curlen !== 0) { + if (curlen !== prevlen) { + s7.bl_tree[curlen * 2]++; + } + s7.bl_tree[REP_3_6 * 2]++; + } else if (count2 <= 10) { + s7.bl_tree[REPZ_3_10 * 2]++; + } else { + s7.bl_tree[REPZ_11_138 * 2]++; + } + count2 = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + function send_tree(s7, tree, max_code) { + var n7; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count2 = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + for (n7 = 0; n7 <= max_code; n7++) { + curlen = nextlen; + nextlen = tree[(n7 + 1) * 2 + 1]; + if (++count2 < max_count && curlen === nextlen) { + continue; + } else if (count2 < min_count) { + do { + send_code(s7, curlen, s7.bl_tree); + } while (--count2 !== 0); + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s7, curlen, s7.bl_tree); + count2--; + } + send_code(s7, REP_3_6, s7.bl_tree); + send_bits(s7, count2 - 3, 2); + } else if (count2 <= 10) { + send_code(s7, REPZ_3_10, s7.bl_tree); + send_bits(s7, count2 - 3, 3); + } else { + send_code(s7, REPZ_11_138, s7.bl_tree); + send_bits(s7, count2 - 11, 7); + } + count2 = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + function build_bl_tree(s7) { + var max_blindex; + scan_tree(s7, s7.dyn_ltree, s7.l_desc.max_code); + scan_tree(s7, s7.dyn_dtree, s7.d_desc.max_code); + build_tree(s7, s7.bl_desc); + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s7.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { + break; + } + } + s7.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + return max_blindex; + } + function send_all_trees(s7, lcodes, dcodes, blcodes) { + var rank; + send_bits(s7, lcodes - 257, 5); + send_bits(s7, dcodes - 1, 5); + send_bits(s7, blcodes - 4, 4); + for (rank = 0; rank < blcodes; rank++) { + send_bits(s7, s7.bl_tree[bl_order[rank] * 2 + 1], 3); + } + send_tree(s7, s7.dyn_ltree, lcodes - 1); + send_tree(s7, s7.dyn_dtree, dcodes - 1); + } + function detect_data_type(s7) { + var black_mask = 4093624447; + var n7; + for (n7 = 0; n7 <= 31; n7++, black_mask >>>= 1) { + if (black_mask & 1 && s7.dyn_ltree[n7 * 2] !== 0) { + return Z_BINARY2; + } + } + if (s7.dyn_ltree[9 * 2] !== 0 || s7.dyn_ltree[10 * 2] !== 0 || s7.dyn_ltree[13 * 2] !== 0) { + return Z_TEXT2; + } + for (n7 = 32; n7 < LITERALS; n7++) { + if (s7.dyn_ltree[n7 * 2] !== 0) { + return Z_TEXT2; + } + } + return Z_BINARY2; + } + var static_init_done = false; + function _tr_init(s7) { + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + s7.l_desc = new TreeDesc(s7.dyn_ltree, static_l_desc); + s7.d_desc = new TreeDesc(s7.dyn_dtree, static_d_desc); + s7.bl_desc = new TreeDesc(s7.bl_tree, static_bl_desc); + s7.bi_buf = 0; + s7.bi_valid = 0; + init_block(s7); + } + function _tr_stored_block(s7, buf, stored_len, last2) { + send_bits(s7, (STORED_BLOCK << 1) + (last2 ? 1 : 0), 3); + copy_block(s7, buf, stored_len); + } + function _tr_align(s7) { + send_bits(s7, STATIC_TREES << 1, 3); + send_code(s7, END_BLOCK, static_ltree); + bi_flush(s7); + } + function _tr_flush_block(s7, buf, stored_len, last2) { + var opt_lenb, static_lenb; + var max_blindex = 0; + if (s7.level > 0) { + if (s7.strm.data_type === Z_UNKNOWN2) { + s7.strm.data_type = detect_data_type(s7); + } + build_tree(s7, s7.l_desc); + build_tree(s7, s7.d_desc); + max_blindex = build_bl_tree(s7); + opt_lenb = s7.opt_len + 3 + 7 >>> 3; + static_lenb = s7.static_len + 3 + 7 >>> 3; + if (static_lenb <= opt_lenb) { + opt_lenb = static_lenb; + } + } else { + opt_lenb = static_lenb = stored_len + 5; + } + if (stored_len + 4 <= opt_lenb && buf !== -1) { + _tr_stored_block(s7, buf, stored_len, last2); + } else if (s7.strategy === Z_FIXED2 || static_lenb === opt_lenb) { + send_bits(s7, (STATIC_TREES << 1) + (last2 ? 1 : 0), 3); + compress_block(s7, static_ltree, static_dtree); + } else { + send_bits(s7, (DYN_TREES << 1) + (last2 ? 1 : 0), 3); + send_all_trees(s7, s7.l_desc.max_code + 1, s7.d_desc.max_code + 1, max_blindex + 1); + compress_block(s7, s7.dyn_ltree, s7.dyn_dtree); + } + init_block(s7); + if (last2) { + bi_windup(s7); + } + } + function _tr_tally(s7, dist, lc) { + s7.pending_buf[s7.d_buf + s7.last_lit * 2] = dist >>> 8 & 255; + s7.pending_buf[s7.d_buf + s7.last_lit * 2 + 1] = dist & 255; + s7.pending_buf[s7.l_buf + s7.last_lit] = lc & 255; + s7.last_lit++; + if (dist === 0) { + s7.dyn_ltree[lc * 2]++; + } else { + s7.matches++; + dist--; + s7.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; + s7.dyn_dtree[d_code(dist) * 2]++; + } + return s7.last_lit === s7.lit_bufsize - 1; + } + exports$b6._tr_init = _tr_init; + exports$b6._tr_stored_block = _tr_stored_block; + exports$b6._tr_flush_block = _tr_flush_block; + exports$b6._tr_tally = _tr_tally; + exports$b6._tr_align = _tr_align; + return exports$b6; +} +function dew$96() { + if (_dewExec$96) + return exports$a6; + _dewExec$96 = true; + function adler32(adler, buf, len, pos) { + var s1 = adler & 65535 | 0, s22 = adler >>> 16 & 65535 | 0, n7 = 0; + while (len !== 0) { + n7 = len > 2e3 ? 2e3 : len; + len -= n7; + do { + s1 = s1 + buf[pos++] | 0; + s22 = s22 + s1 | 0; + } while (--n7); + s1 %= 65521; + s22 %= 65521; + } + return s1 | s22 << 16 | 0; + } + exports$a6 = adler32; + return exports$a6; +} +function dew$86() { + if (_dewExec$86) + return exports$96; + _dewExec$86 = true; + function makeTable() { + var c7, table2 = []; + for (var n7 = 0; n7 < 256; n7++) { + c7 = n7; + for (var k6 = 0; k6 < 8; k6++) { + c7 = c7 & 1 ? 3988292384 ^ c7 >>> 1 : c7 >>> 1; + } + table2[n7] = c7; + } + return table2; + } + var crcTable = makeTable(); + function crc32(crc, buf, len, pos) { + var t8 = crcTable, end = pos + len; + crc ^= -1; + for (var i7 = pos; i7 < end; i7++) { + crc = crc >>> 8 ^ t8[(crc ^ buf[i7]) & 255]; + } + return crc ^ -1; + } + exports$96 = crc32; + return exports$96; +} +function dew$77() { + if (_dewExec$77) + return exports$87; + _dewExec$77 = true; + exports$87 = { + 2: "need dictionary", + /* Z_NEED_DICT 2 */ + 1: "stream end", + /* Z_STREAM_END 1 */ + 0: "", + /* Z_OK 0 */ + "-1": "file error", + /* Z_ERRNO (-1) */ + "-2": "stream error", + /* Z_STREAM_ERROR (-2) */ + "-3": "data error", + /* Z_DATA_ERROR (-3) */ + "-4": "insufficient memory", + /* Z_MEM_ERROR (-4) */ + "-5": "buffer error", + /* Z_BUF_ERROR (-5) */ + "-6": "incompatible version" + /* Z_VERSION_ERROR (-6) */ + }; + return exports$87; +} +function dew$67() { + if (_dewExec$67) + return exports$77; + _dewExec$67 = true; + var utils = dew$b6(); + var trees = dew$a6(); + var adler32 = dew$96(); + var crc32 = dew$86(); + var msg = dew$77(); + var Z_NO_FLUSH2 = 0; + var Z_PARTIAL_FLUSH2 = 1; + var Z_FULL_FLUSH2 = 3; + var Z_FINISH2 = 4; + var Z_BLOCK2 = 5; + var Z_OK2 = 0; + var Z_STREAM_END2 = 1; + var Z_STREAM_ERROR2 = -2; + var Z_DATA_ERROR2 = -3; + var Z_BUF_ERROR2 = -5; + var Z_DEFAULT_COMPRESSION2 = -1; + var Z_FILTERED2 = 1; + var Z_HUFFMAN_ONLY2 = 2; + var Z_RLE2 = 3; + var Z_FIXED2 = 4; + var Z_DEFAULT_STRATEGY2 = 0; + var Z_UNKNOWN2 = 2; + var Z_DEFLATED2 = 8; + var MAX_MEM_LEVEL = 9; + var MAX_WBITS = 15; + var DEF_MEM_LEVEL = 8; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + var PRESET_DICT = 32; + var INIT_STATE = 42; + var EXTRA_STATE = 69; + var NAME_STATE = 73; + var COMMENT_STATE = 91; + var HCRC_STATE = 103; + var BUSY_STATE = 113; + var FINISH_STATE = 666; + var BS_NEED_MORE = 1; + var BS_BLOCK_DONE = 2; + var BS_FINISH_STARTED = 3; + var BS_FINISH_DONE = 4; + var OS_CODE = 3; + function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; + } + function rank(f8) { + return (f8 << 1) - (f8 > 4 ? 9 : 0); + } + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + function flush_pending(strm) { + var s7 = strm.state; + var len = s7.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { + return; + } + utils.arraySet(strm.output, s7.pending_buf, s7.pending_out, len, strm.next_out); + strm.next_out += len; + s7.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s7.pending -= len; + if (s7.pending === 0) { + s7.pending_out = 0; + } + } + function flush_block_only(s7, last2) { + trees._tr_flush_block(s7, s7.block_start >= 0 ? s7.block_start : -1, s7.strstart - s7.block_start, last2); + s7.block_start = s7.strstart; + flush_pending(s7.strm); + } + function put_byte(s7, b8) { + s7.pending_buf[s7.pending++] = b8; + } + function putShortMSB(s7, b8) { + s7.pending_buf[s7.pending++] = b8 >>> 8 & 255; + s7.pending_buf[s7.pending++] = b8 & 255; + } + function read_buf(strm, buf, start, size2) { + var len = strm.avail_in; + if (len > size2) { + len = size2; + } + if (len === 0) { + return 0; + } + strm.avail_in -= len; + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } else if (strm.state.wrap === 2) { + strm.adler = crc32(strm.adler, buf, len, start); + } + strm.next_in += len; + strm.total_in += len; + return len; + } + function longest_match(s7, cur_match) { + var chain_length = s7.max_chain_length; + var scan = s7.strstart; + var match; + var len; + var best_len = s7.prev_length; + var nice_match = s7.nice_match; + var limit = s7.strstart > s7.w_size - MIN_LOOKAHEAD ? s7.strstart - (s7.w_size - MIN_LOOKAHEAD) : 0; + var _win = s7.window; + var wmask = s7.w_mask; + var prev = s7.prev; + var strend = s7.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + if (s7.prev_length >= s7.good_match) { + chain_length >>= 2; + } + if (nice_match > s7.lookahead) { + nice_match = s7.lookahead; + } + do { + match = cur_match; + if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { + continue; + } + scan += 2; + match++; + do { + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + if (len > best_len) { + s7.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + if (best_len <= s7.lookahead) { + return best_len; + } + return s7.lookahead; + } + function fill_window(s7) { + var _w_size = s7.w_size; + var p7, n7, m7, more, str2; + do { + more = s7.window_size - s7.lookahead - s7.strstart; + if (s7.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + utils.arraySet(s7.window, s7.window, _w_size, _w_size, 0); + s7.match_start -= _w_size; + s7.strstart -= _w_size; + s7.block_start -= _w_size; + n7 = s7.hash_size; + p7 = n7; + do { + m7 = s7.head[--p7]; + s7.head[p7] = m7 >= _w_size ? m7 - _w_size : 0; + } while (--n7); + n7 = _w_size; + p7 = n7; + do { + m7 = s7.prev[--p7]; + s7.prev[p7] = m7 >= _w_size ? m7 - _w_size : 0; + } while (--n7); + more += _w_size; + } + if (s7.strm.avail_in === 0) { + break; + } + n7 = read_buf(s7.strm, s7.window, s7.strstart + s7.lookahead, more); + s7.lookahead += n7; + if (s7.lookahead + s7.insert >= MIN_MATCH) { + str2 = s7.strstart - s7.insert; + s7.ins_h = s7.window[str2]; + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[str2 + 1]) & s7.hash_mask; + while (s7.insert) { + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[str2 + MIN_MATCH - 1]) & s7.hash_mask; + s7.prev[str2 & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = str2; + str2++; + s7.insert--; + if (s7.lookahead + s7.insert < MIN_MATCH) { + break; + } + } + } + } while (s7.lookahead < MIN_LOOKAHEAD && s7.strm.avail_in !== 0); + } + function deflate_stored(s7, flush) { + var max_block_size = 65535; + if (max_block_size > s7.pending_buf_size - 5) { + max_block_size = s7.pending_buf_size - 5; + } + for (; ; ) { + if (s7.lookahead <= 1) { + fill_window(s7); + if (s7.lookahead === 0 && flush === Z_NO_FLUSH2) { + return BS_NEED_MORE; + } + if (s7.lookahead === 0) { + break; + } + } + s7.strstart += s7.lookahead; + s7.lookahead = 0; + var max_start = s7.block_start + max_block_size; + if (s7.strstart === 0 || s7.strstart >= max_start) { + s7.lookahead = s7.strstart - max_start; + s7.strstart = max_start; + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + if (s7.strstart - s7.block_start >= s7.w_size - MIN_LOOKAHEAD) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s7.insert = 0; + if (flush === Z_FINISH2) { + flush_block_only(s7, true); + if (s7.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s7.strstart > s7.block_start) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_NEED_MORE; + } + function deflate_fast(s7, flush) { + var hash_head; + var bflush; + for (; ; ) { + if (s7.lookahead < MIN_LOOKAHEAD) { + fill_window(s7); + if (s7.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH2) { + return BS_NEED_MORE; + } + if (s7.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s7.lookahead >= MIN_MATCH) { + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[s7.strstart + MIN_MATCH - 1]) & s7.hash_mask; + hash_head = s7.prev[s7.strstart & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = s7.strstart; + } + if (hash_head !== 0 && s7.strstart - hash_head <= s7.w_size - MIN_LOOKAHEAD) { + s7.match_length = longest_match(s7, hash_head); + } + if (s7.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s7, s7.strstart - s7.match_start, s7.match_length - MIN_MATCH); + s7.lookahead -= s7.match_length; + if (s7.match_length <= s7.max_lazy_match && s7.lookahead >= MIN_MATCH) { + s7.match_length--; + do { + s7.strstart++; + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[s7.strstart + MIN_MATCH - 1]) & s7.hash_mask; + hash_head = s7.prev[s7.strstart & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = s7.strstart; + } while (--s7.match_length !== 0); + s7.strstart++; + } else { + s7.strstart += s7.match_length; + s7.match_length = 0; + s7.ins_h = s7.window[s7.strstart]; + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[s7.strstart + 1]) & s7.hash_mask; + } + } else { + bflush = trees._tr_tally(s7, 0, s7.window[s7.strstart]); + s7.lookahead--; + s7.strstart++; + } + if (bflush) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s7.insert = s7.strstart < MIN_MATCH - 1 ? s7.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH2) { + flush_block_only(s7, true); + if (s7.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s7.last_lit) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_slow(s7, flush) { + var hash_head; + var bflush; + var max_insert; + for (; ; ) { + if (s7.lookahead < MIN_LOOKAHEAD) { + fill_window(s7); + if (s7.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH2) { + return BS_NEED_MORE; + } + if (s7.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s7.lookahead >= MIN_MATCH) { + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[s7.strstart + MIN_MATCH - 1]) & s7.hash_mask; + hash_head = s7.prev[s7.strstart & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = s7.strstart; + } + s7.prev_length = s7.match_length; + s7.prev_match = s7.match_start; + s7.match_length = MIN_MATCH - 1; + if (hash_head !== 0 && s7.prev_length < s7.max_lazy_match && s7.strstart - hash_head <= s7.w_size - MIN_LOOKAHEAD) { + s7.match_length = longest_match(s7, hash_head); + if (s7.match_length <= 5 && (s7.strategy === Z_FILTERED2 || s7.match_length === MIN_MATCH && s7.strstart - s7.match_start > 4096)) { + s7.match_length = MIN_MATCH - 1; + } + } + if (s7.prev_length >= MIN_MATCH && s7.match_length <= s7.prev_length) { + max_insert = s7.strstart + s7.lookahead - MIN_MATCH; + bflush = trees._tr_tally(s7, s7.strstart - 1 - s7.prev_match, s7.prev_length - MIN_MATCH); + s7.lookahead -= s7.prev_length - 1; + s7.prev_length -= 2; + do { + if (++s7.strstart <= max_insert) { + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[s7.strstart + MIN_MATCH - 1]) & s7.hash_mask; + hash_head = s7.prev[s7.strstart & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = s7.strstart; + } + } while (--s7.prev_length !== 0); + s7.match_available = 0; + s7.match_length = MIN_MATCH - 1; + s7.strstart++; + if (bflush) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } else if (s7.match_available) { + bflush = trees._tr_tally(s7, 0, s7.window[s7.strstart - 1]); + if (bflush) { + flush_block_only(s7, false); + } + s7.strstart++; + s7.lookahead--; + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + s7.match_available = 1; + s7.strstart++; + s7.lookahead--; + } + } + if (s7.match_available) { + bflush = trees._tr_tally(s7, 0, s7.window[s7.strstart - 1]); + s7.match_available = 0; + } + s7.insert = s7.strstart < MIN_MATCH - 1 ? s7.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH2) { + flush_block_only(s7, true); + if (s7.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s7.last_lit) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_rle(s7, flush) { + var bflush; + var prev; + var scan, strend; + var _win = s7.window; + for (; ; ) { + if (s7.lookahead <= MAX_MATCH) { + fill_window(s7); + if (s7.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH2) { + return BS_NEED_MORE; + } + if (s7.lookahead === 0) { + break; + } + } + s7.match_length = 0; + if (s7.lookahead >= MIN_MATCH && s7.strstart > 0) { + scan = s7.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s7.strstart + MAX_MATCH; + do { + } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); + s7.match_length = MAX_MATCH - (strend - scan); + if (s7.match_length > s7.lookahead) { + s7.match_length = s7.lookahead; + } + } + } + if (s7.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s7, 1, s7.match_length - MIN_MATCH); + s7.lookahead -= s7.match_length; + s7.strstart += s7.match_length; + s7.match_length = 0; + } else { + bflush = trees._tr_tally(s7, 0, s7.window[s7.strstart]); + s7.lookahead--; + s7.strstart++; + } + if (bflush) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s7.insert = 0; + if (flush === Z_FINISH2) { + flush_block_only(s7, true); + if (s7.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s7.last_lit) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_huff(s7, flush) { + var bflush; + for (; ; ) { + if (s7.lookahead === 0) { + fill_window(s7); + if (s7.lookahead === 0) { + if (flush === Z_NO_FLUSH2) { + return BS_NEED_MORE; + } + break; + } + } + s7.match_length = 0; + bflush = trees._tr_tally(s7, 0, s7.window[s7.strstart]); + s7.lookahead--; + s7.strstart++; + if (bflush) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s7.insert = 0; + if (flush === Z_FINISH2) { + flush_block_only(s7, true); + if (s7.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s7.last_lit) { + flush_block_only(s7, false); + if (s7.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; + } + var configuration_table; + configuration_table = [ + /* good lazy nice chain */ + new Config(0, 0, 0, 0, deflate_stored), + /* 0 store only */ + new Config(4, 4, 8, 4, deflate_fast), + /* 1 max speed, no lazy matches */ + new Config(4, 5, 16, 8, deflate_fast), + /* 2 */ + new Config(4, 6, 32, 32, deflate_fast), + /* 3 */ + new Config(4, 4, 16, 16, deflate_slow), + /* 4 lazy matches */ + new Config(8, 16, 32, 32, deflate_slow), + /* 5 */ + new Config(8, 16, 128, 128, deflate_slow), + /* 6 */ + new Config(8, 32, 128, 256, deflate_slow), + /* 7 */ + new Config(32, 128, 258, 1024, deflate_slow), + /* 8 */ + new Config(32, 258, 258, 4096, deflate_slow) + /* 9 max compression */ + ]; + function lm_init(s7) { + s7.window_size = 2 * s7.w_size; + zero(s7.head); + s7.max_lazy_match = configuration_table[s7.level].max_lazy; + s7.good_match = configuration_table[s7.level].good_length; + s7.nice_match = configuration_table[s7.level].nice_length; + s7.max_chain_length = configuration_table[s7.level].max_chain; + s7.strstart = 0; + s7.block_start = 0; + s7.lookahead = 0; + s7.insert = 0; + s7.match_length = s7.prev_length = MIN_MATCH - 1; + s7.match_available = 0; + s7.ins_h = 0; + } + function DeflateState() { + this.strm = null; + this.status = 0; + this.pending_buf = null; + this.pending_buf_size = 0; + this.pending_out = 0; + this.pending = 0; + this.wrap = 0; + this.gzhead = null; + this.gzindex = 0; + this.method = Z_DEFLATED2; + this.last_flush = -1; + this.w_size = 0; + this.w_bits = 0; + this.w_mask = 0; + this.window = null; + this.window_size = 0; + this.prev = null; + this.head = null; + this.ins_h = 0; + this.hash_size = 0; + this.hash_bits = 0; + this.hash_mask = 0; + this.hash_shift = 0; + this.block_start = 0; + this.match_length = 0; + this.prev_match = 0; + this.match_available = 0; + this.strstart = 0; + this.match_start = 0; + this.lookahead = 0; + this.prev_length = 0; + this.max_chain_length = 0; + this.max_lazy_match = 0; + this.level = 0; + this.strategy = 0; + this.good_match = 0; + this.nice_match = 0; + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + this.l_desc = null; + this.d_desc = null; + this.bl_desc = null; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + this.heap = new utils.Buf16(2 * L_CODES + 1); + zero(this.heap); + this.heap_len = 0; + this.heap_max = 0; + this.depth = new utils.Buf16(2 * L_CODES + 1); + zero(this.depth); + this.l_buf = 0; + this.lit_bufsize = 0; + this.last_lit = 0; + this.d_buf = 0; + this.opt_len = 0; + this.static_len = 0; + this.matches = 0; + this.insert = 0; + this.bi_buf = 0; + this.bi_valid = 0; + } + function deflateResetKeep(strm) { + var s7; + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR2); + } + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN2; + s7 = strm.state; + s7.pending = 0; + s7.pending_out = 0; + if (s7.wrap < 0) { + s7.wrap = -s7.wrap; + } + s7.status = s7.wrap ? INIT_STATE : BUSY_STATE; + strm.adler = s7.wrap === 2 ? 0 : 1; + s7.last_flush = Z_NO_FLUSH2; + trees._tr_init(s7); + return Z_OK2; + } + function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK2) { + lm_init(strm.state); + } + return ret; + } + function deflateSetHeader(strm, head2) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + if (strm.state.wrap !== 2) { + return Z_STREAM_ERROR2; + } + strm.state.gzhead = head2; + return Z_OK2; + } + function deflateInit2(strm, level, method2, windowBits, memLevel, strategy) { + if (!strm) { + return Z_STREAM_ERROR2; + } + var wrap2 = 1; + if (level === Z_DEFAULT_COMPRESSION2) { + level = 6; + } + if (windowBits < 0) { + wrap2 = 0; + windowBits = -windowBits; + } else if (windowBits > 15) { + wrap2 = 2; + windowBits -= 16; + } + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method2 !== Z_DEFLATED2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED2) { + return err(strm, Z_STREAM_ERROR2); + } + if (windowBits === 8) { + windowBits = 9; + } + var s7 = new DeflateState(); + strm.state = s7; + s7.strm = strm; + s7.wrap = wrap2; + s7.gzhead = null; + s7.w_bits = windowBits; + s7.w_size = 1 << s7.w_bits; + s7.w_mask = s7.w_size - 1; + s7.hash_bits = memLevel + 7; + s7.hash_size = 1 << s7.hash_bits; + s7.hash_mask = s7.hash_size - 1; + s7.hash_shift = ~~((s7.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + s7.window = new utils.Buf8(s7.w_size * 2); + s7.head = new utils.Buf16(s7.hash_size); + s7.prev = new utils.Buf16(s7.w_size); + s7.lit_bufsize = 1 << memLevel + 6; + s7.pending_buf_size = s7.lit_bufsize * 4; + s7.pending_buf = new utils.Buf8(s7.pending_buf_size); + s7.d_buf = 1 * s7.lit_bufsize; + s7.l_buf = (1 + 2) * s7.lit_bufsize; + s7.level = level; + s7.strategy = strategy; + s7.method = method2; + return deflateReset(strm); + } + function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED2, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY2); + } + function deflate2(strm, flush) { + var old_flush, s7; + var beg, val; + if (!strm || !strm.state || flush > Z_BLOCK2 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR2) : Z_STREAM_ERROR2; + } + s7 = strm.state; + if (!strm.output || !strm.input && strm.avail_in !== 0 || s7.status === FINISH_STATE && flush !== Z_FINISH2) { + return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR2 : Z_STREAM_ERROR2); + } + s7.strm = strm; + old_flush = s7.last_flush; + s7.last_flush = flush; + if (s7.status === INIT_STATE) { + if (s7.wrap === 2) { + strm.adler = 0; + put_byte(s7, 31); + put_byte(s7, 139); + put_byte(s7, 8); + if (!s7.gzhead) { + put_byte(s7, 0); + put_byte(s7, 0); + put_byte(s7, 0); + put_byte(s7, 0); + put_byte(s7, 0); + put_byte(s7, s7.level === 9 ? 2 : s7.strategy >= Z_HUFFMAN_ONLY2 || s7.level < 2 ? 4 : 0); + put_byte(s7, OS_CODE); + s7.status = BUSY_STATE; + } else { + put_byte(s7, (s7.gzhead.text ? 1 : 0) + (s7.gzhead.hcrc ? 2 : 0) + (!s7.gzhead.extra ? 0 : 4) + (!s7.gzhead.name ? 0 : 8) + (!s7.gzhead.comment ? 0 : 16)); + put_byte(s7, s7.gzhead.time & 255); + put_byte(s7, s7.gzhead.time >> 8 & 255); + put_byte(s7, s7.gzhead.time >> 16 & 255); + put_byte(s7, s7.gzhead.time >> 24 & 255); + put_byte(s7, s7.level === 9 ? 2 : s7.strategy >= Z_HUFFMAN_ONLY2 || s7.level < 2 ? 4 : 0); + put_byte(s7, s7.gzhead.os & 255); + if (s7.gzhead.extra && s7.gzhead.extra.length) { + put_byte(s7, s7.gzhead.extra.length & 255); + put_byte(s7, s7.gzhead.extra.length >> 8 & 255); + } + if (s7.gzhead.hcrc) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending, 0); + } + s7.gzindex = 0; + s7.status = EXTRA_STATE; + } + } else { + var header = Z_DEFLATED2 + (s7.w_bits - 8 << 4) << 8; + var level_flags = -1; + if (s7.strategy >= Z_HUFFMAN_ONLY2 || s7.level < 2) { + level_flags = 0; + } else if (s7.level < 6) { + level_flags = 1; + } else if (s7.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= level_flags << 6; + if (s7.strstart !== 0) { + header |= PRESET_DICT; + } + header += 31 - header % 31; + s7.status = BUSY_STATE; + putShortMSB(s7, header); + if (s7.strstart !== 0) { + putShortMSB(s7, strm.adler >>> 16); + putShortMSB(s7, strm.adler & 65535); + } + strm.adler = 1; + } + } + if (s7.status === EXTRA_STATE) { + if (s7.gzhead.extra) { + beg = s7.pending; + while (s7.gzindex < (s7.gzhead.extra.length & 65535)) { + if (s7.pending === s7.pending_buf_size) { + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + flush_pending(strm); + beg = s7.pending; + if (s7.pending === s7.pending_buf_size) { + break; + } + } + put_byte(s7, s7.gzhead.extra[s7.gzindex] & 255); + s7.gzindex++; + } + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + if (s7.gzindex === s7.gzhead.extra.length) { + s7.gzindex = 0; + s7.status = NAME_STATE; + } + } else { + s7.status = NAME_STATE; + } + } + if (s7.status === NAME_STATE) { + if (s7.gzhead.name) { + beg = s7.pending; + do { + if (s7.pending === s7.pending_buf_size) { + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + flush_pending(strm); + beg = s7.pending; + if (s7.pending === s7.pending_buf_size) { + val = 1; + break; + } + } + if (s7.gzindex < s7.gzhead.name.length) { + val = s7.gzhead.name.charCodeAt(s7.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s7, val); + } while (val !== 0); + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + if (val === 0) { + s7.gzindex = 0; + s7.status = COMMENT_STATE; + } + } else { + s7.status = COMMENT_STATE; + } + } + if (s7.status === COMMENT_STATE) { + if (s7.gzhead.comment) { + beg = s7.pending; + do { + if (s7.pending === s7.pending_buf_size) { + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + flush_pending(strm); + beg = s7.pending; + if (s7.pending === s7.pending_buf_size) { + val = 1; + break; + } + } + if (s7.gzindex < s7.gzhead.comment.length) { + val = s7.gzhead.comment.charCodeAt(s7.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s7, val); + } while (val !== 0); + if (s7.gzhead.hcrc && s7.pending > beg) { + strm.adler = crc32(strm.adler, s7.pending_buf, s7.pending - beg, beg); + } + if (val === 0) { + s7.status = HCRC_STATE; + } + } else { + s7.status = HCRC_STATE; + } + } + if (s7.status === HCRC_STATE) { + if (s7.gzhead.hcrc) { + if (s7.pending + 2 > s7.pending_buf_size) { + flush_pending(strm); + } + if (s7.pending + 2 <= s7.pending_buf_size) { + put_byte(s7, strm.adler & 255); + put_byte(s7, strm.adler >> 8 & 255); + strm.adler = 0; + s7.status = BUSY_STATE; + } + } else { + s7.status = BUSY_STATE; + } + } + if (s7.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + s7.last_flush = -1; + return Z_OK2; + } + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH2) { + return err(strm, Z_BUF_ERROR2); + } + if (s7.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR2); + } + if (strm.avail_in !== 0 || s7.lookahead !== 0 || flush !== Z_NO_FLUSH2 && s7.status !== FINISH_STATE) { + var bstate = s7.strategy === Z_HUFFMAN_ONLY2 ? deflate_huff(s7, flush) : s7.strategy === Z_RLE2 ? deflate_rle(s7, flush) : configuration_table[s7.level].func(s7, flush); + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s7.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s7.last_flush = -1; + } + return Z_OK2; + } + if (bstate === BS_BLOCK_DONE) { + if (flush === Z_PARTIAL_FLUSH2) { + trees._tr_align(s7); + } else if (flush !== Z_BLOCK2) { + trees._tr_stored_block(s7, 0, 0, false); + if (flush === Z_FULL_FLUSH2) { + zero(s7.head); + if (s7.lookahead === 0) { + s7.strstart = 0; + s7.block_start = 0; + s7.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s7.last_flush = -1; + return Z_OK2; + } + } + } + if (flush !== Z_FINISH2) { + return Z_OK2; + } + if (s7.wrap <= 0) { + return Z_STREAM_END2; + } + if (s7.wrap === 2) { + put_byte(s7, strm.adler & 255); + put_byte(s7, strm.adler >> 8 & 255); + put_byte(s7, strm.adler >> 16 & 255); + put_byte(s7, strm.adler >> 24 & 255); + put_byte(s7, strm.total_in & 255); + put_byte(s7, strm.total_in >> 8 & 255); + put_byte(s7, strm.total_in >> 16 & 255); + put_byte(s7, strm.total_in >> 24 & 255); + } else { + putShortMSB(s7, strm.adler >>> 16); + putShortMSB(s7, strm.adler & 65535); + } + flush_pending(strm); + if (s7.wrap > 0) { + s7.wrap = -s7.wrap; + } + return s7.pending !== 0 ? Z_OK2 : Z_STREAM_END2; + } + function deflateEnd(strm) { + var status; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + status = strm.state.status; + if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) { + return err(strm, Z_STREAM_ERROR2); + } + strm.state = null; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR2) : Z_OK2; + } + function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + var s7; + var str2, n7; + var wrap2; + var avail; + var next; + var input; + var tmpDict; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + s7 = strm.state; + wrap2 = s7.wrap; + if (wrap2 === 2 || wrap2 === 1 && s7.status !== INIT_STATE || s7.lookahead) { + return Z_STREAM_ERROR2; + } + if (wrap2 === 1) { + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + s7.wrap = 0; + if (dictLength >= s7.w_size) { + if (wrap2 === 0) { + zero(s7.head); + s7.strstart = 0; + s7.block_start = 0; + s7.insert = 0; + } + tmpDict = new utils.Buf8(s7.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s7.w_size, s7.w_size, 0); + dictionary = tmpDict; + dictLength = s7.w_size; + } + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s7); + while (s7.lookahead >= MIN_MATCH) { + str2 = s7.strstart; + n7 = s7.lookahead - (MIN_MATCH - 1); + do { + s7.ins_h = (s7.ins_h << s7.hash_shift ^ s7.window[str2 + MIN_MATCH - 1]) & s7.hash_mask; + s7.prev[str2 & s7.w_mask] = s7.head[s7.ins_h]; + s7.head[s7.ins_h] = str2; + str2++; + } while (--n7); + s7.strstart = str2; + s7.lookahead = MIN_MATCH - 1; + fill_window(s7); + } + s7.strstart += s7.lookahead; + s7.block_start = s7.strstart; + s7.insert = s7.lookahead; + s7.lookahead = 0; + s7.match_length = s7.prev_length = MIN_MATCH - 1; + s7.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s7.wrap = wrap2; + return Z_OK2; + } + exports$77.deflateInit = deflateInit; + exports$77.deflateInit2 = deflateInit2; + exports$77.deflateReset = deflateReset; + exports$77.deflateResetKeep = deflateResetKeep; + exports$77.deflateSetHeader = deflateSetHeader; + exports$77.deflate = deflate2; + exports$77.deflateEnd = deflateEnd; + exports$77.deflateSetDictionary = deflateSetDictionary; + exports$77.deflateInfo = "pako deflate (from Nodeca project)"; + return exports$77; +} +function dew$57() { + if (_dewExec$57) + return exports$67; + _dewExec$57 = true; + var BAD = 30; + var TYPE = 12; + exports$67 = function inflate_fast(strm, start) { + var state; + var _in; + var last2; + var _out; + var beg; + var end; + var dmax; + var wsize; + var whave; + var wnext; + var s_window; + var hold; + var bits; + var lcode; + var dcode; + var lmask; + var dmask; + var here; + var op; + var len; + var dist; + var from; + var from_source; + var input, output; + state = strm.state; + _in = strm.next_in; + input = strm.input; + last2 = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); + dmax = state.dmax; + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = lcode[hold & lmask]; + dolen: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op === 0) { + output[_out++] = here & 65535; + } else if (op & 16) { + len = here & 65535; + op &= 15; + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & (1 << op) - 1; + hold >>>= op; + bits -= op; + } + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + dodist: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op & 16) { + dist = here & 65535; + op &= 15; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & (1 << op) - 1; + if (dist > dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + hold >>>= op; + bits -= op; + op = _out - beg; + if (dist > op) { + op = dist - op; + if (op > whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + } + from = 0; + from_source = s_window; + if (wnext === 0) { + from += wsize - op; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } else if (wnext < op) { + from += wsize + wnext - op; + op -= wnext; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + } else { + from += wnext - op; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } else { + from = _out - dist; + do { + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } else if ((op & 64) === 0) { + here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dodist; + } else { + strm.msg = "invalid distance code"; + state.mode = BAD; + break top; + } + break; + } + } else if ((op & 64) === 0) { + here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dolen; + } else if (op & 32) { + state.mode = TYPE; + break top; + } else { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break top; + } + break; + } + } while (_in < last2 && _out < end); + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = _in < last2 ? 5 + (last2 - _in) : 5 - (_in - last2); + strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); + state.hold = hold; + state.bits = bits; + return; + }; + return exports$67; +} +function dew$47() { + if (_dewExec$47) + return exports$57; + _dewExec$47 = true; + var utils = dew$b6(); + var MAXBITS = 15; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var lbase = [ + /* Length codes 257..285 base */ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 13, + 15, + 17, + 19, + 23, + 27, + 31, + 35, + 43, + 51, + 59, + 67, + 83, + 99, + 115, + 131, + 163, + 195, + 227, + 258, + 0, + 0 + ]; + var lext = [ + /* Length codes 257..285 extra */ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 17, + 17, + 17, + 17, + 18, + 18, + 18, + 18, + 19, + 19, + 19, + 19, + 20, + 20, + 20, + 20, + 21, + 21, + 21, + 21, + 16, + 72, + 78 + ]; + var dbase = [ + /* Distance codes 0..29 base */ + 1, + 2, + 3, + 4, + 5, + 7, + 9, + 13, + 17, + 25, + 33, + 49, + 65, + 97, + 129, + 193, + 257, + 385, + 513, + 769, + 1025, + 1537, + 2049, + 3073, + 4097, + 6145, + 8193, + 12289, + 16385, + 24577, + 0, + 0 + ]; + var dext = [ + /* Distance codes 0..29 extra */ + 16, + 16, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 23, + 24, + 24, + 25, + 25, + 26, + 26, + 27, + 27, + 28, + 28, + 29, + 29, + 64, + 64 + ]; + exports$57 = function inflate_table(type3, lens, lens_index, codes2, table2, table_index, work, opts) { + var bits = opts.bits; + var len = 0; + var sym = 0; + var min2 = 0, max2 = 0; + var root2 = 0; + var curr = 0; + var drop2 = 0; + var left = 0; + var used = 0; + var huff = 0; + var incr; + var fill2; + var low; + var mask; + var next; + var base = null; + var base_index = 0; + var end; + var count2 = new utils.Buf16(MAXBITS + 1); + var offs = new utils.Buf16(MAXBITS + 1); + var extra = null; + var extra_index = 0; + var here_bits, here_op, here_val; + for (len = 0; len <= MAXBITS; len++) { + count2[len] = 0; + } + for (sym = 0; sym < codes2; sym++) { + count2[lens[lens_index + sym]]++; + } + root2 = bits; + for (max2 = MAXBITS; max2 >= 1; max2--) { + if (count2[max2] !== 0) { + break; + } + } + if (root2 > max2) { + root2 = max2; + } + if (max2 === 0) { + table2[table_index++] = 1 << 24 | 64 << 16 | 0; + table2[table_index++] = 1 << 24 | 64 << 16 | 0; + opts.bits = 1; + return 0; + } + for (min2 = 1; min2 < max2; min2++) { + if (count2[min2] !== 0) { + break; + } + } + if (root2 < min2) { + root2 = min2; + } + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count2[len]; + if (left < 0) { + return -1; + } + } + if (left > 0 && (type3 === CODES || max2 !== 1)) { + return -1; + } + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count2[len]; + } + for (sym = 0; sym < codes2; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + if (type3 === CODES) { + base = extra = work; + end = 19; + } else if (type3 === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + } else { + base = dbase; + extra = dext; + end = -1; + } + huff = 0; + sym = 0; + len = min2; + next = table_index; + curr = root2; + drop2 = 0; + low = -1; + used = 1 << root2; + mask = used - 1; + if (type3 === LENS && used > ENOUGH_LENS || type3 === DISTS && used > ENOUGH_DISTS) { + return 1; + } + for (; ; ) { + here_bits = len - drop2; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } else { + here_op = 32 + 64; + here_val = 0; + } + incr = 1 << len - drop2; + fill2 = 1 << curr; + min2 = fill2; + do { + fill2 -= incr; + table2[next + (huff >> drop2) + fill2] = here_bits << 24 | here_op << 16 | here_val | 0; + } while (fill2 !== 0); + incr = 1 << len - 1; + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + sym++; + if (--count2[len] === 0) { + if (len === max2) { + break; + } + len = lens[lens_index + work[sym]]; + } + if (len > root2 && (huff & mask) !== low) { + if (drop2 === 0) { + drop2 = root2; + } + next += min2; + curr = len - drop2; + left = 1 << curr; + while (curr + drop2 < max2) { + left -= count2[curr + drop2]; + if (left <= 0) { + break; + } + curr++; + left <<= 1; + } + used += 1 << curr; + if (type3 === LENS && used > ENOUGH_LENS || type3 === DISTS && used > ENOUGH_DISTS) { + return 1; + } + low = huff & mask; + table2[low] = root2 << 24 | curr << 16 | next - table_index | 0; + } + } + if (huff !== 0) { + table2[next + huff] = len - drop2 << 24 | 64 << 16 | 0; + } + opts.bits = root2; + return 0; + }; + return exports$57; +} +function dew$312() { + if (_dewExec$312) + return exports$47; + _dewExec$312 = true; + var utils = dew$b6(); + var adler32 = dew$96(); + var crc32 = dew$86(); + var inflate_fast = dew$57(); + var inflate_table = dew$47(); + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var Z_FINISH2 = 4; + var Z_BLOCK2 = 5; + var Z_TREES2 = 6; + var Z_OK2 = 0; + var Z_STREAM_END2 = 1; + var Z_NEED_DICT2 = 2; + var Z_STREAM_ERROR2 = -2; + var Z_DATA_ERROR2 = -3; + var Z_MEM_ERROR = -4; + var Z_BUF_ERROR2 = -5; + var Z_DEFLATED2 = 8; + var HEAD = 1; + var FLAGS = 2; + var TIME = 3; + var OS = 4; + var EXLEN = 5; + var EXTRA = 6; + var NAME = 7; + var COMMENT = 8; + var HCRC = 9; + var DICTID = 10; + var DICT = 11; + var TYPE = 12; + var TYPEDO = 13; + var STORED = 14; + var COPY_ = 15; + var COPY = 16; + var TABLE = 17; + var LENLENS = 18; + var CODELENS = 19; + var LEN_ = 20; + var LEN = 21; + var LENEXT = 22; + var DIST = 23; + var DISTEXT = 24; + var MATCH = 25; + var LIT = 26; + var CHECK = 27; + var LENGTH = 28; + var DONE = 29; + var BAD = 30; + var MEM = 31; + var SYNC = 32; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var MAX_WBITS = 15; + var DEF_WBITS = MAX_WBITS; + function zswap32(q5) { + return (q5 >>> 24 & 255) + (q5 >>> 8 & 65280) + ((q5 & 65280) << 8) + ((q5 & 255) << 24); + } + function InflateState() { + this.mode = 0; + this.last = false; + this.wrap = 0; + this.havedict = false; + this.flags = 0; + this.dmax = 0; + this.check = 0; + this.total = 0; + this.head = null; + this.wbits = 0; + this.wsize = 0; + this.whave = 0; + this.wnext = 0; + this.window = null; + this.hold = 0; + this.bits = 0; + this.length = 0; + this.offset = 0; + this.extra = 0; + this.lencode = null; + this.distcode = null; + this.lenbits = 0; + this.distbits = 0; + this.ncode = 0; + this.nlen = 0; + this.ndist = 0; + this.have = 0; + this.next = null; + this.lens = new utils.Buf16(320); + this.work = new utils.Buf16(288); + this.lendyn = null; + this.distdyn = null; + this.sane = 0; + this.back = 0; + this.was = 0; + } + function inflateResetKeep(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ""; + if (state.wrap) { + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null; + state.hold = 0; + state.bits = 0; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + state.sane = 1; + state.back = -1; + return Z_OK2; + } + function inflateReset(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + } + function inflateReset2(strm, windowBits) { + var wrap2; + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + state = strm.state; + if (windowBits < 0) { + wrap2 = 0; + windowBits = -windowBits; + } else { + wrap2 = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR2; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + state.wrap = wrap2; + state.wbits = windowBits; + return inflateReset(strm); + } + function inflateInit2(strm, windowBits) { + var ret; + var state; + if (!strm) { + return Z_STREAM_ERROR2; + } + state = new InflateState(); + strm.state = state; + state.window = null; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK2) { + strm.state = null; + } + return ret; + } + function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); + } + var virgin = true; + var lenfix, distfix; + function fixedtables(state) { + if (virgin) { + var sym; + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + sym = 0; + while (sym < 144) { + state.lens[sym++] = 8; + } + while (sym < 256) { + state.lens[sym++] = 9; + } + while (sym < 280) { + state.lens[sym++] = 7; + } + while (sym < 288) { + state.lens[sym++] = 8; + } + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { + bits: 9 + }); + sym = 0; + while (sym < 32) { + state.lens[sym++] = 5; + } + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { + bits: 5 + }); + virgin = false; + } + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; + } + function updatewindow(strm, src, end, copy4) { + var dist; + var state = strm.state; + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + state.window = new utils.Buf8(state.wsize); + } + if (copy4 >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } else { + dist = state.wsize - state.wnext; + if (dist > copy4) { + dist = copy4; + } + utils.arraySet(state.window, src, end - copy4, dist, state.wnext); + copy4 -= dist; + if (copy4) { + utils.arraySet(state.window, src, end - copy4, copy4, 0); + state.wnext = copy4; + state.whave = state.wsize; + } else { + state.wnext += dist; + if (state.wnext === state.wsize) { + state.wnext = 0; + } + if (state.whave < state.wsize) { + state.whave += dist; + } + } + } + return 0; + } + function inflate2(strm, flush) { + var state; + var input, output; + var next; + var put; + var have, left; + var hold; + var bits; + var _in, _out; + var copy4; + var from; + var from_source; + var here = 0; + var here_bits, here_op, here_val; + var last_bits, last_op, last_val; + var len; + var ret; + var hbuf = new utils.Buf8(4); + var opts; + var n7; + var order = ( + /* permutation of code lengths */ + [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] + ); + if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { + return Z_STREAM_ERROR2; + } + state = strm.state; + if (state.mode === TYPE) { + state.mode = TYPEDO; + } + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + _in = have; + _out = left; + ret = Z_OK2; + inf_leave: + for (; ; ) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 2 && hold === 35615) { + state.check = 0; + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + hold = 0; + bits = 0; + state.mode = FLAGS; + break; + } + state.flags = 0; + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || /* check if zlib header allowed */ + (((hold & 255) << 8) + (hold >> 8)) % 31) { + strm.msg = "incorrect header check"; + state.mode = BAD; + break; + } + if ((hold & 15) !== Z_DEFLATED2) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + hold >>>= 4; + bits -= 4; + len = (hold & 15) + 8; + if (state.wbits === 0) { + state.wbits = len; + } else if (len > state.wbits) { + strm.msg = "invalid window size"; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + strm.adler = state.check = 1; + state.mode = hold & 512 ? DICTID : TYPE; + hold = 0; + bits = 0; + break; + case FLAGS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.flags = hold; + if ((state.flags & 255) !== Z_DEFLATED2) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + if (state.flags & 57344) { + strm.msg = "unknown header flags set"; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = hold >> 8 & 1; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = TIME; + case TIME: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.time = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + hbuf[2] = hold >>> 16 & 255; + hbuf[3] = hold >>> 24 & 255; + state.check = crc32(state.check, hbuf, 4, 0); + } + hold = 0; + bits = 0; + state.mode = OS; + case OS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.xflags = hold & 255; + state.head.os = hold >> 8; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = EXLEN; + case EXLEN: + if (state.flags & 1024) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc32(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + } else if (state.head) { + state.head.extra = null; + } + state.mode = EXTRA; + case EXTRA: + if (state.flags & 1024) { + copy4 = state.length; + if (copy4 > have) { + copy4 = have; + } + if (copy4) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet( + state.head.extra, + input, + next, + // extra field is limited to 65536 bytes + // - no need for additional size check + copy4, + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ + len + ); + } + if (state.flags & 512) { + state.check = crc32(state.check, input, copy4, next); + } + have -= copy4; + next += copy4; + state.length -= copy4; + } + if (state.length) { + break inf_leave; + } + } + state.length = 0; + state.mode = NAME; + case NAME: + if (state.flags & 2048) { + if (have === 0) { + break inf_leave; + } + copy4 = 0; + do { + len = input[next + copy4++]; + if (state.head && len && state.length < 65536) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy4 < have); + if (state.flags & 512) { + state.check = crc32(state.check, input, copy4, next); + } + have -= copy4; + next += copy4; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + case COMMENT: + if (state.flags & 4096) { + if (have === 0) { + break inf_leave; + } + copy4 = 0; + do { + len = input[next + copy4++]; + if (state.head && len && state.length < 65536) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy4 < have); + if (state.flags & 512) { + state.check = crc32(state.check, input, copy4, next); + } + have -= copy4; + next += copy4; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + case HCRC: + if (state.flags & 512) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.check & 65535)) { + strm.msg = "header crc mismatch"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + if (state.head) { + state.head.hcrc = state.flags >> 9 & 1; + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + strm.adler = state.check = zswap32(hold); + hold = 0; + bits = 0; + state.mode = DICT; + case DICT: + if (state.havedict === 0) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + return Z_NEED_DICT2; + } + strm.adler = state.check = 1; + state.mode = TYPE; + case TYPE: + if (flush === Z_BLOCK2 || flush === Z_TREES2) { + break inf_leave; + } + case TYPEDO: + if (state.last) { + hold >>>= bits & 7; + bits -= bits & 7; + state.mode = CHECK; + break; + } + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.last = hold & 1; + hold >>>= 1; + bits -= 1; + switch (hold & 3) { + case 0: + state.mode = STORED; + break; + case 1: + fixedtables(state); + state.mode = LEN_; + if (flush === Z_TREES2) { + hold >>>= 2; + bits -= 2; + break inf_leave; + } + break; + case 2: + state.mode = TABLE; + break; + case 3: + strm.msg = "invalid block type"; + state.mode = BAD; + } + hold >>>= 2; + bits -= 2; + break; + case STORED: + hold >>>= bits & 7; + bits -= bits & 7; + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { + strm.msg = "invalid stored block lengths"; + state.mode = BAD; + break; + } + state.length = hold & 65535; + hold = 0; + bits = 0; + state.mode = COPY_; + if (flush === Z_TREES2) { + break inf_leave; + } + case COPY_: + state.mode = COPY; + case COPY: + copy4 = state.length; + if (copy4) { + if (copy4 > have) { + copy4 = have; + } + if (copy4 > left) { + copy4 = left; + } + if (copy4 === 0) { + break inf_leave; + } + utils.arraySet(output, input, next, copy4, put); + have -= copy4; + next += copy4; + left -= copy4; + put += copy4; + state.length -= copy4; + break; + } + state.mode = TYPE; + break; + case TABLE: + while (bits < 14) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.nlen = (hold & 31) + 257; + hold >>>= 5; + bits -= 5; + state.ndist = (hold & 31) + 1; + hold >>>= 5; + bits -= 5; + state.ncode = (hold & 15) + 4; + hold >>>= 4; + bits -= 4; + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = "too many length or distance symbols"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = LENLENS; + case LENLENS: + while (state.have < state.ncode) { + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.lens[order[state.have++]] = hold & 7; + hold >>>= 3; + bits -= 3; + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + state.lencode = state.lendyn; + state.lenbits = 7; + opts = { + bits: state.lenbits + }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid code lengths set"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = CODELENS; + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_val < 16) { + hold >>>= here_bits; + bits -= here_bits; + state.lens[state.have++] = here_val; + } else { + if (here_val === 16) { + n7 = here_bits + 2; + while (bits < n7) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + if (state.have === 0) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy4 = 3 + (hold & 3); + hold >>>= 2; + bits -= 2; + } else if (here_val === 17) { + n7 = here_bits + 3; + while (bits < n7) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy4 = 3 + (hold & 7); + hold >>>= 3; + bits -= 3; + } else { + n7 = here_bits + 7; + while (bits < n7) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy4 = 11 + (hold & 127); + hold >>>= 7; + bits -= 7; + } + if (state.have + copy4 > state.nlen + state.ndist) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + while (copy4--) { + state.lens[state.have++] = len; + } + } + } + if (state.mode === BAD) { + break; + } + if (state.lens[256] === 0) { + strm.msg = "invalid code -- missing end-of-block"; + state.mode = BAD; + break; + } + state.lenbits = 9; + opts = { + bits: state.lenbits + }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid literal/lengths set"; + state.mode = BAD; + break; + } + state.distbits = 6; + state.distcode = state.distdyn; + opts = { + bits: state.distbits + }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + state.distbits = opts.bits; + if (ret) { + strm.msg = "invalid distances set"; + state.mode = BAD; + break; + } + state.mode = LEN_; + if (flush === Z_TREES2) { + break inf_leave; + } + case LEN_: + state.mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + inflate_fast(strm, _out); + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_op && (here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + state.mode = LIT; + break; + } + if (here_op & 32) { + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + case LENEXT: + if (state.extra) { + n7 = state.extra; + while (bits < n7) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + state.was = state.length; + state.mode = DIST; + case DIST: + for (; ; ) { + here = state.distcode[hold & (1 << state.distbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + if (here_op & 64) { + strm.msg = "invalid distance code"; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = here_op & 15; + state.mode = DISTEXT; + case DISTEXT: + if (state.extra) { + n7 = state.extra; + while (bits < n7) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.offset += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + if (state.offset > state.dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + state.mode = MATCH; + case MATCH: + if (left === 0) { + break inf_leave; + } + copy4 = _out - left; + if (state.offset > copy4) { + copy4 = state.offset - copy4; + if (copy4 > state.whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + } + if (copy4 > state.wnext) { + copy4 -= state.wnext; + from = state.wsize - copy4; + } else { + from = state.wnext - copy4; + } + if (copy4 > state.length) { + copy4 = state.length; + } + from_source = state.window; + } else { + from_source = output; + from = put - state.offset; + copy4 = state.length; + } + if (copy4 > left) { + copy4 = left; + } + left -= copy4; + state.length -= copy4; + do { + output[put++] = from_source[from++]; + } while (--copy4); + if (state.length === 0) { + state.mode = LEN; + } + break; + case LIT: + if (left === 0) { + break inf_leave; + } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold |= input[next++] << bits; + bits += 8; + } + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ + state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); + } + _out = left; + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = "incorrect data check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = LENGTH; + case LENGTH: + if (state.wrap && state.flags) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.total & 4294967295)) { + strm.msg = "incorrect length check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = DONE; + case DONE: + ret = Z_STREAM_END2; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR2; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR2; + } + } + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH2)) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) + ; + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ + state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if ((_in === 0 && _out === 0 || flush === Z_FINISH2) && ret === Z_OK2) { + ret = Z_BUF_ERROR2; + } + return ret; + } + function inflateEnd(strm) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK2; + } + function inflateGetHeader(strm, head2) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + state = strm.state; + if ((state.wrap & 2) === 0) { + return Z_STREAM_ERROR2; + } + state.head = head2; + head2.done = false; + return Z_OK2; + } + function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + var state; + var dictid; + var ret; + if (!strm || !strm.state) { + return Z_STREAM_ERROR2; + } + state = strm.state; + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR2; + } + if (state.mode === DICT) { + dictid = 1; + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR2; + } + } + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + return Z_OK2; + } + exports$47.inflateReset = inflateReset; + exports$47.inflateReset2 = inflateReset2; + exports$47.inflateResetKeep = inflateResetKeep; + exports$47.inflateInit = inflateInit; + exports$47.inflateInit2 = inflateInit2; + exports$47.inflate = inflate2; + exports$47.inflateEnd = inflateEnd; + exports$47.inflateGetHeader = inflateGetHeader; + exports$47.inflateSetDictionary = inflateSetDictionary; + exports$47.inflateInfo = "pako inflate (from Nodeca project)"; + return exports$47; +} +function dew$212() { + if (_dewExec$212) + return exports$312; + _dewExec$212 = true; + exports$312 = { + /* Allowed flush values; see deflate() and inflate() below for details */ + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + /* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + //Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + //Z_VERSION_ERROR: -6, + /* compression levels */ + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + /* Possible values of the data_type field (though see inflate()) */ + Z_BINARY: 0, + Z_TEXT: 1, + //Z_ASCII: 1, // = Z_TEXT (deprecated) + Z_UNKNOWN: 2, + /* The deflate compression method */ + Z_DEFLATED: 8 + //Z_NULL: null // Use -1 or null inline, depending on var type + }; + return exports$312; +} +function dew$112() { + if (_dewExec$112) + return exports$212; + _dewExec$112 = true; + var Buffer4 = dew().Buffer; + var process$1 = process3; + var assert4 = et2; + var Zstream = dew$c5(); + var zlib_deflate = dew$67(); + var zlib_inflate = dew$312(); + var constants5 = dew$212(); + for (var key in constants5) { + exports$212[key] = constants5[key]; + } + exports$212.NONE = 0; + exports$212.DEFLATE = 1; + exports$212.INFLATE = 2; + exports$212.GZIP = 3; + exports$212.GUNZIP = 4; + exports$212.DEFLATERAW = 5; + exports$212.INFLATERAW = 6; + exports$212.UNZIP = 7; + var GZIP_HEADER_ID1 = 31; + var GZIP_HEADER_ID2 = 139; + function Zlib2(mode) { + if (typeof mode !== "number" || mode < exports$212.DEFLATE || mode > exports$212.UNZIP) { + throw new TypeError("Bad argument"); + } + this.dictionary = null; + this.err = 0; + this.flush = 0; + this.init_done = false; + this.level = 0; + this.memLevel = 0; + this.mode = mode; + this.strategy = 0; + this.windowBits = 0; + this.write_in_progress = false; + this.pending_close = false; + this.gzip_id_bytes_read = 0; + } + Zlib2.prototype.close = function() { + if (this.write_in_progress) { + this.pending_close = true; + return; + } + this.pending_close = false; + assert4(this.init_done, "close before init"); + assert4(this.mode <= exports$212.UNZIP); + if (this.mode === exports$212.DEFLATE || this.mode === exports$212.GZIP || this.mode === exports$212.DEFLATERAW) { + zlib_deflate.deflateEnd(this.strm); + } else if (this.mode === exports$212.INFLATE || this.mode === exports$212.GUNZIP || this.mode === exports$212.INFLATERAW || this.mode === exports$212.UNZIP) { + zlib_inflate.inflateEnd(this.strm); + } + this.mode = exports$212.NONE; + this.dictionary = null; + }; + Zlib2.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) { + return this._write(true, flush, input, in_off, in_len, out, out_off, out_len); + }; + Zlib2.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) { + return this._write(false, flush, input, in_off, in_len, out, out_off, out_len); + }; + Zlib2.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) { + assert4.equal(arguments.length, 8); + assert4(this.init_done, "write before init"); + assert4(this.mode !== exports$212.NONE, "already finalized"); + assert4.equal(false, this.write_in_progress, "write already in progress"); + assert4.equal(false, this.pending_close, "close is pending"); + this.write_in_progress = true; + assert4.equal(false, flush === void 0, "must provide flush value"); + this.write_in_progress = true; + if (flush !== exports$212.Z_NO_FLUSH && flush !== exports$212.Z_PARTIAL_FLUSH && flush !== exports$212.Z_SYNC_FLUSH && flush !== exports$212.Z_FULL_FLUSH && flush !== exports$212.Z_FINISH && flush !== exports$212.Z_BLOCK) { + throw new Error("Invalid flush value"); + } + if (input == null) { + input = Buffer4.alloc(0); + in_len = 0; + in_off = 0; + } + this.strm.avail_in = in_len; + this.strm.input = input; + this.strm.next_in = in_off; + this.strm.avail_out = out_len; + this.strm.output = out; + this.strm.next_out = out_off; + this.flush = flush; + if (!async) { + this._process(); + if (this._checkError()) { + return this._afterSync(); + } + return; + } + var self2 = this; + process$1.nextTick(function() { + self2._process(); + self2._after(); + }); + return this; + }; + Zlib2.prototype._afterSync = function() { + var avail_out = this.strm.avail_out; + var avail_in = this.strm.avail_in; + this.write_in_progress = false; + return [avail_in, avail_out]; + }; + Zlib2.prototype._process = function() { + var next_expected_header_byte = null; + switch (this.mode) { + case exports$212.DEFLATE: + case exports$212.GZIP: + case exports$212.DEFLATERAW: + this.err = zlib_deflate.deflate(this.strm, this.flush); + break; + case exports$212.UNZIP: + if (this.strm.avail_in > 0) { + next_expected_header_byte = this.strm.next_in; + } + switch (this.gzip_id_bytes_read) { + case 0: + if (next_expected_header_byte === null) { + break; + } + if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) { + this.gzip_id_bytes_read = 1; + next_expected_header_byte++; + if (this.strm.avail_in === 1) { + break; + } + } else { + this.mode = exports$212.INFLATE; + break; + } + case 1: + if (next_expected_header_byte === null) { + break; + } + if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) { + this.gzip_id_bytes_read = 2; + this.mode = exports$212.GUNZIP; + } else { + this.mode = exports$212.INFLATE; + } + break; + default: + throw new Error("invalid number of gzip magic number bytes read"); + } + case exports$212.INFLATE: + case exports$212.GUNZIP: + case exports$212.INFLATERAW: + this.err = zlib_inflate.inflate( + this.strm, + this.flush + // If data was encoded with dictionary + ); + if (this.err === exports$212.Z_NEED_DICT && this.dictionary) { + this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary); + if (this.err === exports$212.Z_OK) { + this.err = zlib_inflate.inflate(this.strm, this.flush); + } else if (this.err === exports$212.Z_DATA_ERROR) { + this.err = exports$212.Z_NEED_DICT; + } + } + while (this.strm.avail_in > 0 && this.mode === exports$212.GUNZIP && this.err === exports$212.Z_STREAM_END && this.strm.next_in[0] !== 0) { + this.reset(); + this.err = zlib_inflate.inflate(this.strm, this.flush); + } + break; + default: + throw new Error("Unknown mode " + this.mode); + } + }; + Zlib2.prototype._checkError = function() { + switch (this.err) { + case exports$212.Z_OK: + case exports$212.Z_BUF_ERROR: + if (this.strm.avail_out !== 0 && this.flush === exports$212.Z_FINISH) { + this._error("unexpected end of file"); + return false; + } + break; + case exports$212.Z_STREAM_END: + break; + case exports$212.Z_NEED_DICT: + if (this.dictionary == null) { + this._error("Missing dictionary"); + } else { + this._error("Bad dictionary"); + } + return false; + default: + this._error("Zlib error"); + return false; + } + return true; + }; + Zlib2.prototype._after = function() { + if (!this._checkError()) { + return; + } + var avail_out = this.strm.avail_out; + var avail_in = this.strm.avail_in; + this.write_in_progress = false; + this.callback(avail_in, avail_out); + if (this.pending_close) { + this.close(); + } + }; + Zlib2.prototype._error = function(message) { + if (this.strm.msg) { + message = this.strm.msg; + } + this.onerror( + message, + this.err + // no hope of rescue. + ); + this.write_in_progress = false; + if (this.pending_close) { + this.close(); + } + }; + Zlib2.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) { + assert4(arguments.length === 4 || arguments.length === 5, "init(windowBits, level, memLevel, strategy, [dictionary])"); + assert4(windowBits >= 8 && windowBits <= 15, "invalid windowBits"); + assert4(level >= -1 && level <= 9, "invalid compression level"); + assert4(memLevel >= 1 && memLevel <= 9, "invalid memlevel"); + assert4(strategy === exports$212.Z_FILTERED || strategy === exports$212.Z_HUFFMAN_ONLY || strategy === exports$212.Z_RLE || strategy === exports$212.Z_FIXED || strategy === exports$212.Z_DEFAULT_STRATEGY, "invalid strategy"); + this._init(level, windowBits, memLevel, strategy, dictionary); + this._setDictionary(); + }; + Zlib2.prototype.params = function() { + throw new Error("deflateParams Not supported"); + }; + Zlib2.prototype.reset = function() { + this._reset(); + this._setDictionary(); + }; + Zlib2.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) { + this.level = level; + this.windowBits = windowBits; + this.memLevel = memLevel; + this.strategy = strategy; + this.flush = exports$212.Z_NO_FLUSH; + this.err = exports$212.Z_OK; + if (this.mode === exports$212.GZIP || this.mode === exports$212.GUNZIP) { + this.windowBits += 16; + } + if (this.mode === exports$212.UNZIP) { + this.windowBits += 32; + } + if (this.mode === exports$212.DEFLATERAW || this.mode === exports$212.INFLATERAW) { + this.windowBits = -1 * this.windowBits; + } + this.strm = new Zstream(); + switch (this.mode) { + case exports$212.DEFLATE: + case exports$212.GZIP: + case exports$212.DEFLATERAW: + this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports$212.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy); + break; + case exports$212.INFLATE: + case exports$212.GUNZIP: + case exports$212.INFLATERAW: + case exports$212.UNZIP: + this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits); + break; + default: + throw new Error("Unknown mode " + this.mode); + } + if (this.err !== exports$212.Z_OK) { + this._error("Init error"); + } + this.dictionary = dictionary; + this.write_in_progress = false; + this.init_done = true; + }; + Zlib2.prototype._setDictionary = function() { + if (this.dictionary == null) { + return; + } + this.err = exports$212.Z_OK; + switch (this.mode) { + case exports$212.DEFLATE: + case exports$212.DEFLATERAW: + this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary); + break; + } + if (this.err !== exports$212.Z_OK) { + this._error("Failed to set dictionary"); + } + }; + Zlib2.prototype._reset = function() { + this.err = exports$212.Z_OK; + switch (this.mode) { + case exports$212.DEFLATE: + case exports$212.DEFLATERAW: + case exports$212.GZIP: + this.err = zlib_deflate.deflateReset(this.strm); + break; + case exports$212.INFLATE: + case exports$212.INFLATERAW: + case exports$212.GUNZIP: + this.err = zlib_inflate.inflateReset(this.strm); + break; + } + if (this.err !== exports$212.Z_OK) { + this._error("Failed to reset stream"); + } + }; + exports$212.Zlib = Zlib2; + return exports$212; +} +function dew18() { + if (_dewExec18) + return exports$114; + _dewExec18 = true; + var process$1 = process3; + var Buffer4 = dew().Buffer; + var Transform2 = exports14.Transform; + var binding3 = dew$112(); + var util2 = X2; + var assert4 = et2.ok; + var kMaxLength2 = dew().kMaxLength; + var kRangeErrorMessage = "Cannot create final Buffer. It would be larger than 0x" + kMaxLength2.toString(16) + " bytes"; + binding3.Z_MIN_WINDOWBITS = 8; + binding3.Z_MAX_WINDOWBITS = 15; + binding3.Z_DEFAULT_WINDOWBITS = 15; + binding3.Z_MIN_CHUNK = 64; + binding3.Z_MAX_CHUNK = Infinity; + binding3.Z_DEFAULT_CHUNK = 16 * 1024; + binding3.Z_MIN_MEMLEVEL = 1; + binding3.Z_MAX_MEMLEVEL = 9; + binding3.Z_DEFAULT_MEMLEVEL = 8; + binding3.Z_MIN_LEVEL = -1; + binding3.Z_MAX_LEVEL = 9; + binding3.Z_DEFAULT_LEVEL = binding3.Z_DEFAULT_COMPRESSION; + var bkeys = Object.keys(binding3); + for (var bk = 0; bk < bkeys.length; bk++) { + var bkey = bkeys[bk]; + if (bkey.match(/^Z/)) { + Object.defineProperty(exports$114, bkey, { + enumerable: true, + value: binding3[bkey], + writable: false + }); + } + } + var codes2 = { + Z_OK: binding3.Z_OK, + Z_STREAM_END: binding3.Z_STREAM_END, + Z_NEED_DICT: binding3.Z_NEED_DICT, + Z_ERRNO: binding3.Z_ERRNO, + Z_STREAM_ERROR: binding3.Z_STREAM_ERROR, + Z_DATA_ERROR: binding3.Z_DATA_ERROR, + Z_MEM_ERROR: binding3.Z_MEM_ERROR, + Z_BUF_ERROR: binding3.Z_BUF_ERROR, + Z_VERSION_ERROR: binding3.Z_VERSION_ERROR + }; + var ckeys = Object.keys(codes2); + for (var ck = 0; ck < ckeys.length; ck++) { + var ckey = ckeys[ck]; + codes2[codes2[ckey]] = ckey; + } + Object.defineProperty(exports$114, "codes", { + enumerable: true, + value: Object.freeze(codes2), + writable: false + }); + exports$114.Deflate = Deflate2; + exports$114.Inflate = Inflate2; + exports$114.Gzip = Gzip2; + exports$114.Gunzip = Gunzip2; + exports$114.DeflateRaw = DeflateRaw2; + exports$114.InflateRaw = InflateRaw2; + exports$114.Unzip = Unzip2; + exports$114.createDeflate = function(o7) { + return new Deflate2(o7); + }; + exports$114.createInflate = function(o7) { + return new Inflate2(o7); + }; + exports$114.createDeflateRaw = function(o7) { + return new DeflateRaw2(o7); + }; + exports$114.createInflateRaw = function(o7) { + return new InflateRaw2(o7); + }; + exports$114.createGzip = function(o7) { + return new Gzip2(o7); + }; + exports$114.createGunzip = function(o7) { + return new Gunzip2(o7); + }; + exports$114.createUnzip = function(o7) { + return new Unzip2(o7); + }; + exports$114.deflate = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new Deflate2(opts), buffer2, callback); + }; + exports$114.deflateSync = function(buffer2, opts) { + return zlibBufferSync(new Deflate2(opts), buffer2); + }; + exports$114.gzip = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new Gzip2(opts), buffer2, callback); + }; + exports$114.gzipSync = function(buffer2, opts) { + return zlibBufferSync(new Gzip2(opts), buffer2); + }; + exports$114.deflateRaw = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new DeflateRaw2(opts), buffer2, callback); + }; + exports$114.deflateRawSync = function(buffer2, opts) { + return zlibBufferSync(new DeflateRaw2(opts), buffer2); + }; + exports$114.unzip = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new Unzip2(opts), buffer2, callback); + }; + exports$114.unzipSync = function(buffer2, opts) { + return zlibBufferSync(new Unzip2(opts), buffer2); + }; + exports$114.inflate = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new Inflate2(opts), buffer2, callback); + }; + exports$114.inflateSync = function(buffer2, opts) { + return zlibBufferSync(new Inflate2(opts), buffer2); + }; + exports$114.gunzip = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new Gunzip2(opts), buffer2, callback); + }; + exports$114.gunzipSync = function(buffer2, opts) { + return zlibBufferSync(new Gunzip2(opts), buffer2); + }; + exports$114.inflateRaw = function(buffer2, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = {}; + } + return zlibBuffer(new InflateRaw2(opts), buffer2, callback); + }; + exports$114.inflateRawSync = function(buffer2, opts) { + return zlibBufferSync(new InflateRaw2(opts), buffer2); + }; + function zlibBuffer(engine, buffer2, callback) { + var buffers = []; + var nread = 0; + engine.on("error", onError); + engine.on("end", onEnd); + engine.end(buffer2); + flow2(); + function flow2() { + var chunk2; + while (null !== (chunk2 = engine.read())) { + buffers.push(chunk2); + nread += chunk2.length; + } + engine.once("readable", flow2); + } + function onError(err) { + engine.removeListener("end", onEnd); + engine.removeListener("readable", flow2); + callback(err); + } + function onEnd() { + var buf; + var err = null; + if (nread >= kMaxLength2) { + err = new RangeError(kRangeErrorMessage); + } else { + buf = Buffer4.concat(buffers, nread); + } + buffers = []; + engine.close(); + callback(err, buf); + } + } + function zlibBufferSync(engine, buffer2) { + if (typeof buffer2 === "string") + buffer2 = Buffer4.from(buffer2); + if (!Buffer4.isBuffer(buffer2)) + throw new TypeError("Not a string or buffer"); + var flushFlag = engine._finishFlushFlag; + return engine._processChunk(buffer2, flushFlag); + } + function Deflate2(opts) { + if (!(this instanceof Deflate2)) + return new Deflate2(opts); + Zlib2.call(this, opts, binding3.DEFLATE); + } + function Inflate2(opts) { + if (!(this instanceof Inflate2)) + return new Inflate2(opts); + Zlib2.call(this, opts, binding3.INFLATE); + } + function Gzip2(opts) { + if (!(this instanceof Gzip2)) + return new Gzip2(opts); + Zlib2.call(this, opts, binding3.GZIP); + } + function Gunzip2(opts) { + if (!(this instanceof Gunzip2)) + return new Gunzip2(opts); + Zlib2.call(this, opts, binding3.GUNZIP); + } + function DeflateRaw2(opts) { + if (!(this instanceof DeflateRaw2)) + return new DeflateRaw2(opts); + Zlib2.call(this, opts, binding3.DEFLATERAW); + } + function InflateRaw2(opts) { + if (!(this instanceof InflateRaw2)) + return new InflateRaw2(opts); + Zlib2.call(this, opts, binding3.INFLATERAW); + } + function Unzip2(opts) { + if (!(this instanceof Unzip2)) + return new Unzip2(opts); + Zlib2.call(this, opts, binding3.UNZIP); + } + function isValidFlushFlag(flag) { + return flag === binding3.Z_NO_FLUSH || flag === binding3.Z_PARTIAL_FLUSH || flag === binding3.Z_SYNC_FLUSH || flag === binding3.Z_FULL_FLUSH || flag === binding3.Z_FINISH || flag === binding3.Z_BLOCK; + } + function Zlib2(opts, mode) { + var _this = this; + this._opts = opts = opts || {}; + this._chunkSize = opts.chunkSize || exports$114.Z_DEFAULT_CHUNK; + Transform2.call(this, opts); + if (opts.flush && !isValidFlushFlag(opts.flush)) { + throw new Error("Invalid flush flag: " + opts.flush); + } + if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) { + throw new Error("Invalid flush flag: " + opts.finishFlush); + } + this._flushFlag = opts.flush || binding3.Z_NO_FLUSH; + this._finishFlushFlag = typeof opts.finishFlush !== "undefined" ? opts.finishFlush : binding3.Z_FINISH; + if (opts.chunkSize) { + if (opts.chunkSize < exports$114.Z_MIN_CHUNK || opts.chunkSize > exports$114.Z_MAX_CHUNK) { + throw new Error("Invalid chunk size: " + opts.chunkSize); + } + } + if (opts.windowBits) { + if (opts.windowBits < exports$114.Z_MIN_WINDOWBITS || opts.windowBits > exports$114.Z_MAX_WINDOWBITS) { + throw new Error("Invalid windowBits: " + opts.windowBits); + } + } + if (opts.level) { + if (opts.level < exports$114.Z_MIN_LEVEL || opts.level > exports$114.Z_MAX_LEVEL) { + throw new Error("Invalid compression level: " + opts.level); + } + } + if (opts.memLevel) { + if (opts.memLevel < exports$114.Z_MIN_MEMLEVEL || opts.memLevel > exports$114.Z_MAX_MEMLEVEL) { + throw new Error("Invalid memLevel: " + opts.memLevel); + } + } + if (opts.strategy) { + if (opts.strategy != exports$114.Z_FILTERED && opts.strategy != exports$114.Z_HUFFMAN_ONLY && opts.strategy != exports$114.Z_RLE && opts.strategy != exports$114.Z_FIXED && opts.strategy != exports$114.Z_DEFAULT_STRATEGY) { + throw new Error("Invalid strategy: " + opts.strategy); + } + } + if (opts.dictionary) { + if (!Buffer4.isBuffer(opts.dictionary)) { + throw new Error("Invalid dictionary: it should be a Buffer instance"); + } + } + this._handle = new binding3.Zlib(mode); + var self2 = this; + this._hadError = false; + this._handle.onerror = function(message, errno) { + _close(self2); + self2._hadError = true; + var error2 = new Error(message); + error2.errno = errno; + error2.code = exports$114.codes[errno]; + self2.emit("error", error2); + }; + var level = exports$114.Z_DEFAULT_COMPRESSION; + if (typeof opts.level === "number") + level = opts.level; + var strategy = exports$114.Z_DEFAULT_STRATEGY; + if (typeof opts.strategy === "number") + strategy = opts.strategy; + this._handle.init(opts.windowBits || exports$114.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports$114.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary); + this._buffer = Buffer4.allocUnsafe(this._chunkSize); + this._offset = 0; + this._level = level; + this._strategy = strategy; + this.once("end", this.close); + Object.defineProperty(this, "_closed", { + get: function() { + return !_this._handle; + }, + configurable: true, + enumerable: true + }); + } + util2.inherits(Zlib2, Transform2); + Zlib2.prototype.params = function(level, strategy, callback) { + if (level < exports$114.Z_MIN_LEVEL || level > exports$114.Z_MAX_LEVEL) { + throw new RangeError("Invalid compression level: " + level); + } + if (strategy != exports$114.Z_FILTERED && strategy != exports$114.Z_HUFFMAN_ONLY && strategy != exports$114.Z_RLE && strategy != exports$114.Z_FIXED && strategy != exports$114.Z_DEFAULT_STRATEGY) { + throw new TypeError("Invalid strategy: " + strategy); + } + if (this._level !== level || this._strategy !== strategy) { + var self2 = this; + this.flush(binding3.Z_SYNC_FLUSH, function() { + assert4(self2._handle, "zlib binding closed"); + self2._handle.params(level, strategy); + if (!self2._hadError) { + self2._level = level; + self2._strategy = strategy; + if (callback) + callback(); + } + }); + } else { + process$1.nextTick(callback); + } + }; + Zlib2.prototype.reset = function() { + assert4(this._handle, "zlib binding closed"); + return this._handle.reset(); + }; + Zlib2.prototype._flush = function(callback) { + this._transform(Buffer4.alloc(0), "", callback); + }; + Zlib2.prototype.flush = function(kind, callback) { + var _this2 = this; + var ws = this._writableState; + if (typeof kind === "function" || kind === void 0 && !callback) { + callback = kind; + kind = binding3.Z_FULL_FLUSH; + } + if (ws.ended) { + if (callback) + process$1.nextTick(callback); + } else if (ws.ending) { + if (callback) + this.once("end", callback); + } else if (ws.needDrain) { + if (callback) { + this.once("drain", function() { + return _this2.flush(kind, callback); + }); + } + } else { + this._flushFlag = kind; + this.write(Buffer4.alloc(0), "", callback); + } + }; + Zlib2.prototype.close = function(callback) { + _close(this, callback); + process$1.nextTick(emitCloseNT, this); + }; + function _close(engine, callback) { + if (callback) + process$1.nextTick(callback); + if (!engine._handle) + return; + engine._handle.close(); + engine._handle = null; + } + function emitCloseNT(self2) { + self2.emit("close"); + } + Zlib2.prototype._transform = function(chunk2, encoding, cb) { + var flushFlag; + var ws = this._writableState; + var ending = ws.ending || ws.ended; + var last2 = ending && (!chunk2 || ws.length === chunk2.length); + if (chunk2 !== null && !Buffer4.isBuffer(chunk2)) + return cb(new Error("invalid input")); + if (!this._handle) + return cb(new Error("zlib binding closed")); + if (last2) + flushFlag = this._finishFlushFlag; + else { + flushFlag = this._flushFlag; + if (chunk2.length >= ws.length) { + this._flushFlag = this._opts.flush || binding3.Z_NO_FLUSH; + } + } + this._processChunk(chunk2, flushFlag, cb); + }; + Zlib2.prototype._processChunk = function(chunk2, flushFlag, cb) { + var availInBefore = chunk2 && chunk2.length; + var availOutBefore = this._chunkSize - this._offset; + var inOff = 0; + var self2 = this; + var async = typeof cb === "function"; + if (!async) { + var buffers = []; + var nread = 0; + var error2; + this.on("error", function(er) { + error2 = er; + }); + assert4(this._handle, "zlib binding closed"); + do { + var res = this._handle.writeSync( + flushFlag, + chunk2, + // in + inOff, + // in_off + availInBefore, + // in_len + this._buffer, + // out + this._offset, + //out_off + availOutBefore + ); + } while (!this._hadError && callback(res[0], res[1])); + if (this._hadError) { + throw error2; + } + if (nread >= kMaxLength2) { + _close(this); + throw new RangeError(kRangeErrorMessage); + } + var buf = Buffer4.concat(buffers, nread); + _close(this); + return buf; + } + assert4(this._handle, "zlib binding closed"); + var req = this._handle.write( + flushFlag, + chunk2, + // in + inOff, + // in_off + availInBefore, + // in_len + this._buffer, + // out + this._offset, + //out_off + availOutBefore + ); + req.buffer = chunk2; + req.callback = callback; + function callback(availInAfter, availOutAfter) { + if (this) { + this.buffer = null; + this.callback = null; + } + if (self2._hadError) + return; + var have = availOutBefore - availOutAfter; + assert4(have >= 0, "have should not go down"); + if (have > 0) { + var out = self2._buffer.slice(self2._offset, self2._offset + have); + self2._offset += have; + if (async) { + self2.push(out); + } else { + buffers.push(out); + nread += out.length; + } + } + if (availOutAfter === 0 || self2._offset >= self2._chunkSize) { + availOutBefore = self2._chunkSize; + self2._offset = 0; + self2._buffer = Buffer4.allocUnsafe(self2._chunkSize); + } + if (availOutAfter === 0) { + inOff += availInBefore - availInAfter; + availInBefore = availInAfter; + if (!async) + return true; + var newReq = self2._handle.write(flushFlag, chunk2, inOff, availInBefore, self2._buffer, self2._offset, self2._chunkSize); + newReq.callback = callback; + newReq.buffer = chunk2; + return; + } + if (!async) + return false; + cb(); + } + }; + util2.inherits(Deflate2, Zlib2); + util2.inherits(Inflate2, Zlib2); + util2.inherits(Gzip2, Zlib2); + util2.inherits(Gunzip2, Zlib2); + util2.inherits(DeflateRaw2, Zlib2); + util2.inherits(InflateRaw2, Zlib2); + util2.inherits(Unzip2, Zlib2); + return exports$114; +} +var exports$d5, _dewExec$c5, exports$c6, _dewExec$b6, exports$b6, _dewExec$a6, exports$a6, _dewExec$96, exports$96, _dewExec$86, exports$87, _dewExec$77, exports$77, _dewExec$67, exports$67, _dewExec$57, exports$57, _dewExec$47, exports$47, _dewExec$312, exports$312, _dewExec$212, exports$212, _dewExec$112, exports$114, _dewExec18, exports21, Deflate, DeflateRaw, Gunzip, Gzip, Inflate, InflateRaw, Unzip, Z_BEST_COMPRESSION, Z_BEST_SPEED, Z_BINARY, Z_BLOCK, Z_BUF_ERROR, Z_DATA_ERROR, Z_DEFAULT_CHUNK, Z_DEFAULT_COMPRESSION, Z_DEFAULT_LEVEL, Z_DEFAULT_MEMLEVEL, Z_DEFAULT_STRATEGY, Z_DEFAULT_WINDOWBITS, Z_DEFLATED, Z_ERRNO, Z_FILTERED, Z_FINISH, Z_FIXED, Z_FULL_FLUSH, Z_HUFFMAN_ONLY, Z_MAX_CHUNK, Z_MAX_LEVEL, Z_MAX_MEMLEVEL, Z_MAX_WINDOWBITS, Z_MIN_CHUNK, Z_MIN_LEVEL, Z_MIN_MEMLEVEL, Z_MIN_WINDOWBITS, Z_NEED_DICT, Z_NO_COMPRESSION, Z_NO_FLUSH, Z_OK, Z_PARTIAL_FLUSH, Z_RLE, Z_STREAM_END, Z_STREAM_ERROR, Z_SYNC_FLUSH, Z_TEXT, Z_TREES, Z_UNKNOWN, Zlib, codes, createDeflate, createDeflateRaw, createGunzip, createGzip, createInflate, createInflateRaw, createUnzip, deflate, deflateRaw, deflateRawSync, deflateSync, gunzip, gunzipSync, gzip, gzipSync, inflate, inflateRaw, inflateRawSync, inflateSync, unzip2, unzipSync; +var init_zlib = __esm({ + "node_modules/@jspm/core/nodelibs/browser/zlib.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_DtuTasat(); + init_chunk_B6_G_Ftj(); + init_chunk_CjPlbOtt(); + init_chunk_DEMDiNwt(); + init_chunk_CbQqNoLO(); + init_chunk_D3uu3VYh(); + init_chunk_DtDiafJB(); + init_chunk_tHuMsdT0(); + init_chunk_B738Er4n(); + init_chunk_b0rmRow7(); + exports$d5 = {}; + _dewExec$c5 = false; + exports$c6 = {}; + _dewExec$b6 = false; + exports$b6 = {}; + _dewExec$a6 = false; + exports$a6 = {}; + _dewExec$96 = false; + exports$96 = {}; + _dewExec$86 = false; + exports$87 = {}; + _dewExec$77 = false; + exports$77 = {}; + _dewExec$67 = false; + exports$67 = {}; + _dewExec$57 = false; + exports$57 = {}; + _dewExec$47 = false; + exports$47 = {}; + _dewExec$312 = false; + exports$312 = {}; + _dewExec$212 = false; + exports$212 = {}; + _dewExec$112 = false; + exports$114 = {}; + _dewExec18 = false; + exports21 = dew18(); + exports21["codes"]; + exports21["Deflate"]; + exports21["Inflate"]; + exports21["Gzip"]; + exports21["Gunzip"]; + exports21["DeflateRaw"]; + exports21["InflateRaw"]; + exports21["Unzip"]; + exports21["createDeflate"]; + exports21["createInflate"]; + exports21["createDeflateRaw"]; + exports21["createInflateRaw"]; + exports21["createGzip"]; + exports21["createGunzip"]; + exports21["createUnzip"]; + exports21["deflate"]; + exports21["deflateSync"]; + exports21["gzip"]; + exports21["gzipSync"]; + exports21["deflateRaw"]; + exports21["deflateRawSync"]; + exports21["unzip"]; + exports21["unzipSync"]; + exports21["inflate"]; + exports21["inflateSync"]; + exports21["gunzip"]; + exports21["gunzipSync"]; + exports21["inflateRaw"]; + exports21["inflateRawSync"]; + Deflate = exports21.Deflate; + DeflateRaw = exports21.DeflateRaw; + Gunzip = exports21.Gunzip; + Gzip = exports21.Gzip; + Inflate = exports21.Inflate; + InflateRaw = exports21.InflateRaw; + Unzip = exports21.Unzip; + Z_BEST_COMPRESSION = exports21.Z_BEST_COMPRESSION; + Z_BEST_SPEED = exports21.Z_BEST_SPEED; + Z_BINARY = exports21.Z_BINARY; + Z_BLOCK = exports21.Z_BLOCK; + Z_BUF_ERROR = exports21.Z_BUF_ERROR; + Z_DATA_ERROR = exports21.Z_DATA_ERROR; + Z_DEFAULT_CHUNK = exports21.Z_DEFAULT_CHUNK; + Z_DEFAULT_COMPRESSION = exports21.Z_DEFAULT_COMPRESSION; + Z_DEFAULT_LEVEL = exports21.Z_DEFAULT_LEVEL; + Z_DEFAULT_MEMLEVEL = exports21.Z_DEFAULT_MEMLEVEL; + Z_DEFAULT_STRATEGY = exports21.Z_DEFAULT_STRATEGY; + Z_DEFAULT_WINDOWBITS = exports21.Z_DEFAULT_WINDOWBITS; + Z_DEFLATED = exports21.Z_DEFLATED; + Z_ERRNO = exports21.Z_ERRNO; + Z_FILTERED = exports21.Z_FILTERED; + Z_FINISH = exports21.Z_FINISH; + Z_FIXED = exports21.Z_FIXED; + Z_FULL_FLUSH = exports21.Z_FULL_FLUSH; + Z_HUFFMAN_ONLY = exports21.Z_HUFFMAN_ONLY; + Z_MAX_CHUNK = exports21.Z_MAX_CHUNK; + Z_MAX_LEVEL = exports21.Z_MAX_LEVEL; + Z_MAX_MEMLEVEL = exports21.Z_MAX_MEMLEVEL; + Z_MAX_WINDOWBITS = exports21.Z_MAX_WINDOWBITS; + Z_MIN_CHUNK = exports21.Z_MIN_CHUNK; + Z_MIN_LEVEL = exports21.Z_MIN_LEVEL; + Z_MIN_MEMLEVEL = exports21.Z_MIN_MEMLEVEL; + Z_MIN_WINDOWBITS = exports21.Z_MIN_WINDOWBITS; + Z_NEED_DICT = exports21.Z_NEED_DICT; + Z_NO_COMPRESSION = exports21.Z_NO_COMPRESSION; + Z_NO_FLUSH = exports21.Z_NO_FLUSH; + Z_OK = exports21.Z_OK; + Z_PARTIAL_FLUSH = exports21.Z_PARTIAL_FLUSH; + Z_RLE = exports21.Z_RLE; + Z_STREAM_END = exports21.Z_STREAM_END; + Z_STREAM_ERROR = exports21.Z_STREAM_ERROR; + Z_SYNC_FLUSH = exports21.Z_SYNC_FLUSH; + Z_TEXT = exports21.Z_TEXT; + Z_TREES = exports21.Z_TREES; + Z_UNKNOWN = exports21.Z_UNKNOWN; + Zlib = exports21.Zlib; + codes = exports21.codes; + createDeflate = exports21.createDeflate; + createDeflateRaw = exports21.createDeflateRaw; + createGunzip = exports21.createGunzip; + createGzip = exports21.createGzip; + createInflate = exports21.createInflate; + createInflateRaw = exports21.createInflateRaw; + createUnzip = exports21.createUnzip; + deflate = exports21.deflate; + deflateRaw = exports21.deflateRaw; + deflateRawSync = exports21.deflateRawSync; + deflateSync = exports21.deflateSync; + gunzip = exports21.gunzip; + gunzipSync = exports21.gunzipSync; + gzip = exports21.gzip; + gzipSync = exports21.gzipSync; + inflate = exports21.inflate; + inflateRaw = exports21.inflateRaw; + inflateRawSync = exports21.inflateRawSync; + inflateSync = exports21.inflateSync; + unzip2 = exports21.unzip; + unzipSync = exports21.unzipSync; + } +}); + +// node_modules/avsc/lib/containers.js +var require_containers = __commonJS({ + "node_modules/avsc/lib/containers.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var types3 = require_types7(); + var utils = require_utils8(); + var buffer2 = (init_buffer(), __toCommonJS(buffer_exports)); + var stream2 = (init_stream(), __toCommonJS(stream_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var zlib = (init_zlib(), __toCommonJS(zlib_exports)); + var Buffer4 = buffer2.Buffer; + var OPTS = { namespace: "org.apache.avro.file" }; + var LONG_TYPE = types3.Type.forSchema("long", OPTS); + var MAP_BYTES_TYPE = types3.Type.forSchema({ type: "map", values: "bytes" }, OPTS); + var HEADER_TYPE = types3.Type.forSchema({ + name: "Header", + type: "record", + fields: [ + { name: "magic", type: { type: "fixed", name: "Magic", size: 4 } }, + { name: "meta", type: MAP_BYTES_TYPE }, + { name: "sync", type: { type: "fixed", name: "Sync", size: 16 } } + ] + }, OPTS); + var BLOCK_TYPE = types3.Type.forSchema({ + name: "Block", + type: "record", + fields: [ + { name: "count", type: "long" }, + { name: "data", type: "bytes" }, + { name: "sync", type: "Sync" } + ] + }, OPTS); + var MAGIC_BYTES = utils.bufferFrom("Obj"); + var f8 = util2.format; + var Tap = utils.Tap; + function RawDecoder(schema8, opts) { + opts = opts || {}; + var noDecode = !!opts.noDecode; + stream2.Duplex.call(this, { + readableObjectMode: !noDecode, + allowHalfOpen: false + }); + this._type = types3.Type.forSchema(schema8); + this._tap = new Tap(utils.newBuffer(0)); + this._writeCb = null; + this._needPush = false; + this._readValue = createReader(noDecode, this._type); + this._finished = false; + this.on("finish", function() { + this._finished = true; + this._read(); + }); + } + util2.inherits(RawDecoder, stream2.Duplex); + RawDecoder.prototype._write = function(chunk2, encoding, cb) { + this._writeCb = cb; + var tap2 = this._tap; + tap2.buf = Buffer4.concat([tap2.buf.slice(tap2.pos), chunk2]); + tap2.pos = 0; + if (this._needPush) { + this._needPush = false; + this._read(); + } + }; + RawDecoder.prototype._read = function() { + this._needPush = false; + var tap2 = this._tap; + var pos = tap2.pos; + var val = this._readValue(tap2); + if (tap2.isValid()) { + this.push(val); + } else if (!this._finished) { + tap2.pos = pos; + this._needPush = true; + if (this._writeCb) { + this._writeCb(); + } + } else { + this.push(null); + } + }; + function BlockDecoder(opts) { + opts = opts || {}; + var noDecode = !!opts.noDecode; + stream2.Duplex.call(this, { + allowHalfOpen: true, + // For async decompressors. + readableObjectMode: !noDecode + }); + this._rType = opts.readerSchema !== void 0 ? types3.Type.forSchema(opts.readerSchema) : void 0; + this._wType = null; + this._codecs = opts.codecs; + this._codec = void 0; + this._parseHook = opts.parseHook; + this._tap = new Tap(utils.newBuffer(0)); + this._blockTap = new Tap(utils.newBuffer(0)); + this._syncMarker = null; + this._readValue = null; + this._noDecode = noDecode; + this._queue = new utils.OrderedQueue(); + this._decompress = null; + this._index = 0; + this._remaining = void 0; + this._needPush = false; + this._finished = false; + this.on("finish", function() { + this._finished = true; + if (this._needPush) { + this._read(); + } + }); + } + util2.inherits(BlockDecoder, stream2.Duplex); + BlockDecoder.defaultCodecs = function() { + return { + "null": function(buf, cb) { + cb(null, buf); + }, + "deflate": zlib.inflateRaw + }; + }; + BlockDecoder.getDefaultCodecs = BlockDecoder.defaultCodecs; + BlockDecoder.prototype._decodeHeader = function() { + var tap2 = this._tap; + if (tap2.buf.length < MAGIC_BYTES.length) { + return false; + } + if (!MAGIC_BYTES.equals(tap2.buf.slice(0, MAGIC_BYTES.length))) { + this.emit("error", new Error("invalid magic bytes")); + return false; + } + var header = HEADER_TYPE._read(tap2); + if (!tap2.isValid()) { + return false; + } + this._codec = (header.meta["avro.codec"] || "null").toString(); + var codecs = this._codecs || BlockDecoder.getDefaultCodecs(); + this._decompress = codecs[this._codec]; + if (!this._decompress) { + this.emit("error", new Error(f8("unknown codec: %s", this._codec))); + return; + } + try { + var schema8 = JSON.parse(header.meta["avro.schema"].toString()); + if (this._parseHook) { + schema8 = this._parseHook(schema8); + } + this._wType = types3.Type.forSchema(schema8); + } catch (err) { + this.emit("error", err); + return; + } + try { + this._readValue = createReader(this._noDecode, this._wType, this._rType); + } catch (err) { + this.emit("error", err); + return; + } + this._syncMarker = header.sync; + this.emit("metadata", this._wType, this._codec, header); + return true; + }; + BlockDecoder.prototype._write = function(chunk2, encoding, cb) { + var tap2 = this._tap; + tap2.buf = Buffer4.concat([tap2.buf, chunk2]); + tap2.pos = 0; + if (!this._decodeHeader()) { + process.nextTick(cb); + return; + } + this._write = this._writeChunk; + this._write(utils.newBuffer(0), encoding, cb); + }; + BlockDecoder.prototype._writeChunk = function(chunk2, encoding, cb) { + var tap2 = this._tap; + tap2.buf = Buffer4.concat([tap2.buf.slice(tap2.pos), chunk2]); + tap2.pos = 0; + var nBlocks = 1; + var block; + while (block = tryReadBlock(tap2)) { + if (!this._syncMarker.equals(block.sync)) { + this.emit("error", new Error("invalid sync marker")); + return; + } + nBlocks++; + this._decompress( + block.data, + this._createBlockCallback(block.data.length, block.count, chunkCb) + ); + } + chunkCb(); + function chunkCb() { + if (!--nBlocks) { + cb(); + } + } + }; + BlockDecoder.prototype._createBlockCallback = function(size2, count2, cb) { + var self2 = this; + var index4 = this._index++; + return function(cause, data) { + if (cause) { + var err = new Error(f8("%s codec decompression error", self2._codec)); + err.cause = cause; + self2.emit("error", err); + cb(); + } else { + self2.emit("block", new BlockInfo(count2, data.length, size2)); + self2._queue.push(new BlockData(index4, data, cb, count2)); + if (self2._needPush) { + self2._read(); + } + } + }; + }; + BlockDecoder.prototype._read = function() { + this._needPush = false; + var tap2 = this._blockTap; + if (!this._remaining) { + var data = this._queue.pop(); + if (!data || !data.count) { + if (this._finished) { + this.push(null); + } else { + this._needPush = true; + } + if (data) { + data.cb(); + } + return; + } + data.cb(); + this._remaining = data.count; + tap2.buf = data.buf; + tap2.pos = 0; + } + this._remaining--; + var val; + try { + val = this._readValue(tap2); + if (!tap2.isValid()) { + throw new Error("truncated block"); + } + } catch (err) { + this._remaining = 0; + this.emit("error", err); + return; + } + this.push(val); + }; + function RawEncoder(schema8, opts) { + opts = opts || {}; + stream2.Transform.call(this, { + writableObjectMode: true, + allowHalfOpen: false + }); + this._type = types3.Type.forSchema(schema8); + this._writeValue = function(tap2, val) { + try { + this._type._write(tap2, val); + } catch (err) { + this.emit("typeError", err, val, this._type); + } + }; + this._tap = new Tap(utils.newBuffer(opts.batchSize || 65536)); + this.on("typeError", function(err) { + this.emit("error", err); + }); + } + util2.inherits(RawEncoder, stream2.Transform); + RawEncoder.prototype._transform = function(val, encoding, cb) { + var tap2 = this._tap; + var buf = tap2.buf; + var pos = tap2.pos; + this._writeValue(tap2, val); + if (!tap2.isValid()) { + if (pos) { + this.push(copyBuffer(tap2.buf, 0, pos)); + } + var len = tap2.pos - pos; + if (len > buf.length) { + tap2.buf = utils.newBuffer(2 * len); + } + tap2.pos = 0; + this._writeValue(tap2, val); + } + cb(); + }; + RawEncoder.prototype._flush = function(cb) { + var tap2 = this._tap; + var pos = tap2.pos; + if (pos) { + this.push(tap2.buf.slice(0, pos)); + } + cb(); + }; + function BlockEncoder(schema8, opts) { + opts = opts || {}; + stream2.Duplex.call(this, { + allowHalfOpen: true, + // To support async compressors. + writableObjectMode: true + }); + var type3; + if (types3.Type.isType(schema8)) { + type3 = schema8; + schema8 = void 0; + } else { + type3 = types3.Type.forSchema(schema8); + } + this._schema = schema8; + this._type = type3; + this._writeValue = function(tap2, val) { + try { + this._type._write(tap2, val); + } catch (err) { + this.emit("typeError", err, val, this._type); + return false; + } + return true; + }; + this._blockSize = opts.blockSize || 65536; + this._tap = new Tap(utils.newBuffer(this._blockSize)); + this._codecs = opts.codecs; + this._codec = opts.codec || "null"; + this._blockCount = 0; + this._syncMarker = opts.syncMarker || new utils.Lcg().nextBuffer(16); + this._queue = new utils.OrderedQueue(); + this._pending = 0; + this._finished = false; + this._needHeader = false; + this._needPush = false; + this._metadata = opts.metadata || {}; + if (!MAP_BYTES_TYPE.isValid(this._metadata)) { + throw new Error("invalid metadata"); + } + var codec = this._codec; + this._compress = (this._codecs || BlockEncoder.getDefaultCodecs())[codec]; + if (!this._compress) { + throw new Error(f8("unsupported codec: %s", codec)); + } + if (opts.omitHeader !== void 0) { + opts.writeHeader = opts.omitHeader ? "never" : "auto"; + } + switch (opts.writeHeader) { + case false: + case "never": + break; + case void 0: + case "auto": + this._needHeader = true; + break; + default: + this._writeHeader(); + } + this.on("finish", function() { + this._finished = true; + if (this._blockCount) { + this._flushChunk(); + } else if (this._finished && this._needPush) { + this.push(null); + } + }); + this.on("typeError", function(err) { + this.emit("error", err); + }); + } + util2.inherits(BlockEncoder, stream2.Duplex); + BlockEncoder.defaultCodecs = function() { + return { + "null": function(buf, cb) { + cb(null, buf); + }, + "deflate": zlib.deflateRaw + }; + }; + BlockEncoder.getDefaultCodecs = BlockEncoder.defaultCodecs; + BlockEncoder.prototype._writeHeader = function() { + var schema8 = JSON.stringify( + this._schema ? this._schema : this._type.getSchema({ exportAttrs: true }) + ); + var meta = utils.copyOwnProperties( + this._metadata, + { "avro.schema": utils.bufferFrom(schema8), "avro.codec": utils.bufferFrom(this._codec) }, + true + // Overwrite. + ); + var Header = HEADER_TYPE.getRecordConstructor(); + var header = new Header(MAGIC_BYTES, meta, this._syncMarker); + this.push(header.toBuffer()); + }; + BlockEncoder.prototype._write = function(val, encoding, cb) { + if (this._needHeader) { + this._writeHeader(); + this._needHeader = false; + } + var tap2 = this._tap; + var pos = tap2.pos; + var flushing = false; + if (this._writeValue(tap2, val)) { + if (!tap2.isValid()) { + if (pos) { + this._flushChunk(pos, cb); + flushing = true; + } + var len = tap2.pos - pos; + if (len > this._blockSize) { + this._blockSize = len * 2; + } + tap2.buf = utils.newBuffer(this._blockSize); + tap2.pos = 0; + this._writeValue(tap2, val); + } + this._blockCount++; + } else { + tap2.pos = pos; + } + if (!flushing) { + cb(); + } + }; + BlockEncoder.prototype._flushChunk = function(pos, cb) { + var tap2 = this._tap; + pos = pos || tap2.pos; + this._compress(tap2.buf.slice(0, pos), this._createBlockCallback(pos, cb)); + this._blockCount = 0; + }; + BlockEncoder.prototype._read = function() { + var self2 = this; + var data = this._queue.pop(); + if (!data) { + if (this._finished && !this._pending) { + process.nextTick(function() { + self2.push(null); + }); + } else { + this._needPush = true; + } + return; + } + this.push(LONG_TYPE.toBuffer(data.count, true)); + this.push(LONG_TYPE.toBuffer(data.buf.length, true)); + this.push(data.buf); + this.push(this._syncMarker); + if (!this._finished) { + data.cb(); + } + }; + BlockEncoder.prototype._createBlockCallback = function(size2, cb) { + var self2 = this; + var index4 = this._index++; + var count2 = this._blockCount; + this._pending++; + return function(cause, data) { + if (cause) { + var err = new Error(f8("%s codec compression error", self2._codec)); + err.cause = cause; + self2.emit("error", err); + return; + } + self2._pending--; + self2.emit("block", new BlockInfo(count2, size2, data.length)); + self2._queue.push(new BlockData(index4, data, cb, count2)); + if (self2._needPush) { + self2._needPush = false; + self2._read(); + } + }; + }; + function BlockInfo(count2, raw, compressed) { + this.valueCount = count2; + this.rawDataLength = raw; + this.compressedDataLength = compressed; + } + function BlockData(index4, buf, cb, count2) { + this.index = index4; + this.buf = buf; + this.cb = cb; + this.count = count2 | 0; + } + function tryReadBlock(tap2) { + var pos = tap2.pos; + var block = BLOCK_TYPE._read(tap2); + if (!tap2.isValid()) { + tap2.pos = pos; + return null; + } + return block; + } + function createReader(noDecode, writerType, readerType) { + if (noDecode) { + return /* @__PURE__ */ function(skipper) { + return function(tap2) { + var pos = tap2.pos; + skipper(tap2); + return tap2.buf.slice(pos, tap2.pos); + }; + }(writerType._skip); + } else if (readerType) { + var resolver = readerType.createResolver(writerType); + return function(tap2) { + return resolver._read(tap2); + }; + } else { + return function(tap2) { + return writerType._read(tap2); + }; + } + } + function copyBuffer(buf, pos, len) { + var copy4 = utils.newBuffer(len); + buf.copy(copy4, 0, pos, pos + len); + return copy4; + } + module5.exports = { + BLOCK_TYPE, + // For tests. + HEADER_TYPE, + // Idem. + MAGIC_BYTES, + // Idem. + streams: { + BlockDecoder, + BlockEncoder, + RawDecoder, + RawEncoder + } + }; + } +}); + +// node_modules/avsc/etc/browser/avsc.js +var require_avsc = __commonJS({ + "node_modules/avsc/etc/browser/avsc.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var avroServices = require_avsc_services(); + var containers = require_containers(); + var utils = require_utils8(); + var stream2 = (init_stream(), __toCommonJS(stream_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + function BlobReader(blob, opts) { + stream2.Readable.call(this); + opts = opts || {}; + this._batchSize = opts.batchSize || 65536; + this._blob = blob; + this._pos = 0; + } + util2.inherits(BlobReader, stream2.Readable); + BlobReader.prototype._read = function() { + var pos = this._pos; + if (pos >= this._blob.size) { + this.push(null); + return; + } + this._pos += this._batchSize; + var blob = this._blob.slice(pos, this._pos, this._blob.type); + var reader = new FileReader(); + var self2 = this; + reader.addEventListener("loadend", function cb(evt) { + reader.removeEventListener("loadend", cb, false); + if (evt.error) { + self2.emit("error", evt.error); + } else { + self2.push(utils.bufferFrom(reader.result)); + } + }, false); + reader.readAsArrayBuffer(blob); + }; + function BlobWriter() { + stream2.Transform.call(this, { readableObjectMode: true }); + this._bufs = []; + } + util2.inherits(BlobWriter, stream2.Transform); + BlobWriter.prototype._transform = function(buf, encoding, cb) { + this._bufs.push(buf); + cb(); + }; + BlobWriter.prototype._flush = function(cb) { + this.push(new Blob(this._bufs, { type: "application/octet-binary" })); + cb(); + }; + function createBlobDecoder(blob, opts) { + return new BlobReader(blob).pipe(new containers.streams.BlockDecoder(opts)); + } + function createBlobEncoder(schema8, opts) { + var encoder = new containers.streams.BlockEncoder(schema8, opts); + var builder = new BlobWriter(); + encoder.pipe(builder); + return new stream2.Duplex({ + objectMode: true, + read: function() { + var val = builder.read(); + if (val) { + done(val); + } else { + builder.once("readable", done); + } + var self2 = this; + function done(val2) { + self2.push(val2 || builder.read()); + self2.push(null); + } + }, + write: function(val, encoding, cb) { + return encoder.write(val, encoding, cb); + } + }).on("finish", function() { + encoder.end(); + }); + } + module5.exports = { + createBlobDecoder, + createBlobEncoder, + streams: containers.streams + }; + utils.copyOwnProperties(avroServices, module5.exports); + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/utils/isObject.js +var require_isObject = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/utils/isObject.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + exports28.isObject = function(maybeObj) { + return maybeObj !== null && typeof maybeObj === "object"; + }; + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-type-error.js +var require_invalid_type_error = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-type-error.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = InvalidTypeError; + function InvalidTypeError(message) { + this.name = "InvalidTypeError"; + this.message = message; + } + InvalidTypeError.prototype = Error.prototype; + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/schema.js +var require_schema5 = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/schema.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var isObject8 = require_isObject().isObject; + var InvalidTypeError = require_invalid_type_error(); + module5.exports = convertFromSchema; + function convertFromSchema(schema8, options) { + schema8 = convertSchema(schema8, options); + schema8.$schema = "http://json-schema.org/draft-04/schema#"; + return schema8; + } + function convertSchema(schema8, options) { + if (options.cloneSchema) { + schema8 = Object.assign({}, schema8); + } + var structs = options._structs; + var notSupported = options._notSupported; + var strictMode = options.strictMode; + var i7 = 0; + var j6 = 0; + var struct = null; + for (i7; i7 < structs.length; i7++) { + struct = structs[i7]; + if (Array.isArray(schema8[struct])) { + var cloned = false; + for (j6; j6 < schema8[struct].length; j6++) { + if (!isObject8(schema8[struct][j6])) { + if (options.cloneSchema && !cloned) { + cloned = true; + schema8[struct] = schema8[struct].slice(); + } + schema8[struct].splice(j6, 1); + j6--; + continue; + } + schema8[struct][j6] = convertSchema(schema8[struct][j6], options); + } + } else if (schema8[struct] === null) { + delete schema8[struct]; + } else if (typeof schema8[struct] === "object") { + schema8[struct] = convertSchema(schema8[struct], options); + } + } + if ("properties" in schema8) { + schema8.properties = convertProperties(schema8.properties, options); + if (Array.isArray(schema8.required)) { + schema8.required = cleanRequired(schema8.required, schema8.properties); + if (schema8.required.length === 0) { + delete schema8.required; + } + } + if (Object.keys(schema8.properties).length === 0) { + delete schema8.properties; + } + } + if (strictMode) { + validateType(schema8.type); + } + schema8 = convertTypes(schema8); + schema8 = convertFormat(schema8, options); + if ("x-patternProperties" in schema8 && options.supportPatternProperties) { + schema8 = convertPatternProperties(schema8, options.patternPropertiesHandler); + } + for (i7 = 0; i7 < notSupported.length; i7++) { + delete schema8[notSupported[i7]]; + } + return schema8; + } + function validateType(type3) { + var validTypes = ["integer", "number", "string", "boolean", "object", "array", "null"]; + if (validTypes.indexOf(type3) < 0 && type3 !== void 0) { + throw new InvalidTypeError("Type " + JSON.stringify(type3) + " is not a valid type"); + } + } + function convertProperties(properties, options) { + var key; + var property2; + var props = {}; + var removeProp; + if (!isObject8(properties)) { + return props; + } + for (key in properties) { + property2 = properties[key]; + if (!isObject8(property2)) { + continue; + } + removeProp = options._removeProps.some(function(prop) { + return property2[prop] === true; + }); + if (removeProp) { + continue; + } + props[key] = convertSchema(property2, options); + } + return props; + } + function convertTypes(schema8) { + if (schema8.type !== void 0 && schema8.nullable === true) { + schema8.type = [schema8.type, "null"]; + if (Array.isArray(schema8.enum) && !schema8.enum.includes(null)) { + schema8.enum = schema8.enum.concat([null]); + } + } + return schema8; + } + function convertFormat(schema8, options) { + var format5 = schema8.format; + var settings = { + MIN_INT_32: 0 - Math.pow(2, 31), + MAX_INT_32: Math.pow(2, 31) - 1, + MIN_INT_64: 0 - Math.pow(2, 63), + MAX_INT_64: Math.pow(2, 63) - 1, + MIN_FLOAT: 0 - Math.pow(2, 128), + MAX_FLOAT: Math.pow(2, 128) - 1, + MIN_DOUBLE: 0 - Number.MAX_VALUE, + MAX_DOUBLE: Number.MAX_VALUE, + // Matches base64 (RFC 4648) + // Matches `standard` base64 not `base64url`. The specification does not + // exclude it but current ongoing OpenAPI plans will distinguish btoh. + BYTE_PATTERN: "^[\\w\\d+\\/=]*$" + }; + var FORMATS = ["date-time", "email", "hostname", "ipv4", "ipv6", "uri", "uri-reference"]; + if (format5 === void 0 || FORMATS.indexOf(format5) !== -1) { + return schema8; + } + if (format5 === "date" && options.dateToDateTime === true) { + return convertFormatDate(schema8); + } + var formatConverters = { + int32: convertFormatInt32, + int64: convertFormatInt64, + float: convertFormatFloat, + double: convertFormatDouble, + byte: convertFormatByte + }; + var converter = formatConverters[format5]; + if (converter === void 0) { + return schema8; + } + return converter(schema8, settings); + } + function convertFormatInt32(schema8, settings) { + if (!schema8.minimum && schema8.minimum !== 0 || schema8.minimum < settings.MIN_INT_32) { + schema8.minimum = settings.MIN_INT_32; + } + if (!schema8.maximum && schema8.maximum !== 0 || schema8.maximum > settings.MAX_INT_32) { + schema8.maximum = settings.MAX_INT_32; + } + return schema8; + } + function convertFormatInt64(schema8, settings) { + if (!schema8.minimum && schema8.minimum !== 0 || schema8.minimum < settings.MIN_INT_64) { + schema8.minimum = settings.MIN_INT_64; + } + if (!schema8.maximum && schema8.maximum !== 0 || schema8.maximum > settings.MAX_INT_64) { + schema8.maximum = settings.MAX_INT_64; + } + return schema8; + } + function convertFormatFloat(schema8, settings) { + if (!schema8.minimum && schema8.minimum !== 0 || schema8.minimum < settings.MIN_FLOAT) { + schema8.minimum = settings.MIN_FLOAT; + } + if (!schema8.maximum && schema8.maximum !== 0 || schema8.maximum > settings.MAX_FLOAT) { + schema8.maximum = settings.MAX_FLOAT; + } + return schema8; + } + function convertFormatDouble(schema8, settings) { + if (!schema8.minimum && schema8.minimum !== 0 || schema8.minimum < settings.MIN_DOUBLE) { + schema8.minimum = settings.MIN_DOUBLE; + } + if (!schema8.maximum && schema8.maximum !== 0 || schema8.maximum > settings.MAX_DOUBLE) { + schema8.maximum = settings.MAX_DOUBLE; + } + return schema8; + } + function convertFormatDate(schema8) { + schema8.format = "date-time"; + return schema8; + } + function convertFormatByte(schema8, settings) { + schema8.pattern = settings.BYTE_PATTERN; + return schema8; + } + function convertPatternProperties(schema8, handler) { + if (isObject8(schema8["x-patternProperties"])) { + schema8.patternProperties = schema8["x-patternProperties"]; + } + delete schema8["x-patternProperties"]; + return handler(schema8); + } + function cleanRequired(required, properties) { + required = required || []; + properties = properties || {}; + let remainedRequired = []; + for (let i7 = 0; i7 < required.length; i7++) { + if (properties[required[i7]]) { + remainedRequired.push(required[i7]); + } + } + return remainedRequired; + } + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-input-error.js +var require_invalid_input_error = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/errors/invalid-input-error.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = InvalidInputError; + function InvalidInputError(message) { + this.name = "InvalidInputError"; + this.message = message; + } + InvalidInputError.prototype = new Error(); + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/parameter.js +var require_parameter = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/converters/parameter.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var convertFromSchema = require_schema5(); + var InvalidInputError = require_invalid_input_error(); + module5.exports = convertFromParameter; + function convertFromParameter(parameter, options) { + if (parameter.schema !== void 0) { + return convertParameterSchema(parameter, parameter.schema, options); + } else if (parameter.content !== void 0) { + return convertFromContents(parameter, options); + } else { + if (options.strictMode) { + throw new InvalidInputError("OpenAPI parameter must have either a 'schema' or a 'content' property"); + } + return convertParameterSchema(parameter, {}, options); + } + } + function convertFromContents(parameter, options) { + var schemas5 = {}; + for (var mime in parameter.content) { + schemas5[mime] = convertParameterSchema(parameter, parameter.content[mime].schema, options); + } + return schemas5; + } + function convertParameterSchema(parameter, schema8, options) { + var jsonSchema = convertFromSchema(schema8 || {}, options); + if (parameter.description) { + jsonSchema.description = parameter.description; + } + return jsonSchema; + } + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/convert.js +var require_convert = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/lib/convert.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var convertFromSchema = require_schema5(); + var convertFromParameter = require_parameter(); + module5.exports = { + fromSchema: convertFromSchema, + fromParameter: convertFromParameter + }; + } +}); + +// node_modules/@openapi-contrib/openapi-schema-to-json-schema/index.js +var require_openapi_schema_to_json_schema = __commonJS({ + "node_modules/@openapi-contrib/openapi-schema-to-json-schema/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var deepEqual2 = require_fast_deep_equal(); + var convert = require_convert(); + module5.exports = openapiSchemaToJsonSchema; + module5.exports.fromSchema = openapiSchemaToJsonSchema; + module5.exports.fromParameter = openapiParameterToJsonSchema; + function openapiSchemaToJsonSchema(schema8, options) { + options = resolveOptions(options); + var jsonSchema = convert.fromSchema(schema8, options); + return jsonSchema; + } + function openapiParameterToJsonSchema(parameter, options) { + options = resolveOptions(options); + var jsonSchema = convert.fromParameter(parameter, options); + return jsonSchema; + } + function resolveOptions(options) { + var notSupported = [ + "nullable", + "discriminator", + "readOnly", + "writeOnly", + "xml", + "externalDocs", + "example", + "deprecated" + ]; + options = options || {}; + options.dateToDateTime = options.dateToDateTime || false; + options.cloneSchema = options.cloneSchema == false ? false : true; + options.supportPatternProperties = options.supportPatternProperties || false; + options.keepNotSupported = options.keepNotSupported || []; + options.strictMode = options.strictMode == false ? false : true; + if (typeof options.patternPropertiesHandler !== "function") { + options.patternPropertiesHandler = patternPropertiesHandler; + } + options._removeProps = []; + if (options.removeReadOnly === true) { + options._removeProps.push("readOnly"); + } + if (options.removeWriteOnly === true) { + options._removeProps.push("writeOnly"); + } + options._structs = ["allOf", "anyOf", "oneOf", "not", "items", "additionalProperties"]; + options._notSupported = resolveNotSupported(notSupported, options.keepNotSupported); + return options; + } + function patternPropertiesHandler(schema8) { + var pattern5; + var patternsObj = schema8.patternProperties; + var additProps = schema8.additionalProperties; + if (typeof additProps !== "object") { + return schema8; + } + for (pattern5 in patternsObj) { + if (deepEqual2(patternsObj[pattern5], additProps)) { + schema8.additionalProperties = false; + break; + } + } + return schema8; + } + function resolveNotSupported(notSupported, toRetain) { + var i7 = 0; + var index4; + for (i7; i7 < toRetain.length; i7++) { + index4 = notSupported.indexOf(toRetain[i7]); + if (index4 >= 0) { + notSupported.splice(index4, 1); + } + } + return notSupported; + } + } +}); + +// node_modules/uri-js/dist/es5/uri.all.js +var require_uri_all = __commonJS({ + "node_modules/uri-js/dist/es5/uri.all.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.URI = global2.URI || {}); + })(exports28, function(exports29) { + "use strict"; + function merge7() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x7 = 1; x7 < xl; ++x7) { + sets[x7] = sets[x7].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(""); + } else { + return sets[0]; + } + } + function subexp(str2) { + return "(?:" + str2 + ")"; + } + function typeOf(o7) { + return o7 === void 0 ? "undefined" : o7 === null ? "null" : Object.prototype.toString.call(o7).split(" ").pop().split("]").shift().toLowerCase(); + } + function toUpperCase(str2) { + return str2.toUpperCase(); + } + function toArray3(obj) { + return obj !== void 0 && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; + } + function assign3(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; + } + function buildExps(isIRI2) { + var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$2 = merge7(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$2 = subexp(subexp("%[EFef]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$2 + "%" + HEXDIG$$2 + HEXDIG$$2) + "|" + subexp("%" + HEXDIG$$2 + HEXDIG$$2)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge7(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI2 ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI2 ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$2 = merge7(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge7(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge7(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$2 + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$2 + "|" + PCT_ENCODED$2) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$2 + "+\\." + merge7(UNRESERVED$$2, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge7(UNRESERVED$$2, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$2 + "|" + merge7(UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$2 + "|" + merge7(UNRESERVED$$2, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge7("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge7("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge7("[^\\%\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge7("[^\\%\\[\\]\\:]", UNRESERVED$$2, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge7("[^\\%\\/\\:\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge7("[^\\%\\/\\@]", UNRESERVED$$2, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge7("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge7("[^\\%]", UNRESERVED$$2, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge7("[^]", UNRESERVED$$2, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$2, "g"), + OTHER_CHARS: new RegExp(merge7("[^\\%]", UNRESERVED$$2, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$2, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$2 + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") + //RFC 6874, with relaxed parsing rules + }; + } + var URI_PROTOCOL = buildExps(false); + var IRI_PROTOCOL = buildExps(true); + var slicedToArray = /* @__PURE__ */ function() { + function sliceIterator(arr, i7) { + var _arr = []; + var _n = true; + var _d = false; + var _e2 = void 0; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i7 && _arr.length === i7) + break; + } + } catch (err) { + _d = true; + _e2 = err; + } finally { + try { + if (!_n && _i["return"]) + _i["return"](); + } finally { + if (_d) + throw _e2; + } + } + return _arr; + } + return function(arr, i7) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i7); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + var toConsumableArray = function(arr) { + if (Array.isArray(arr)) { + for (var i7 = 0, arr2 = Array(arr.length); i7 < arr.length; i7++) + arr2[i7] = arr[i7]; + return arr2; + } else { + return Array.from(arr); + } + }; + var maxInt = 2147483647; + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; + var delimiter2 = "-"; + var regexPunycode = /^xn--/; + var regexNonASCII = /[^\0-\x7E]/; + var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; + var errors = { + "overflow": "Overflow: input needs wider integers to process", + "not-basic": "Illegal input >= 0x80 (not a basic code point)", + "invalid-input": "Invalid input" + }; + var baseMinusTMin = base - tMin; + var floor2 = Math.floor; + var stringFromCharCode = String.fromCharCode; + function error$1(type3) { + throw new RangeError(errors[type3]); + } + function map4(array, fn) { + var result2 = []; + var length = array.length; + while (length--) { + result2[length] = fn(array[length]); + } + return result2; + } + function mapDomain(string2, fn) { + var parts = string2.split("@"); + var result2 = ""; + if (parts.length > 1) { + result2 = parts[0] + "@"; + string2 = parts[1]; + } + string2 = string2.replace(regexSeparators, "."); + var labels = string2.split("."); + var encoded = map4(labels, fn).join("."); + return result2 + encoded; + } + function ucs2decode(string2) { + var output = []; + var counter = 0; + var length = string2.length; + while (counter < length) { + var value2 = string2.charCodeAt(counter++); + if (value2 >= 55296 && value2 <= 56319 && counter < length) { + var extra = string2.charCodeAt(counter++); + if ((extra & 64512) == 56320) { + output.push(((value2 & 1023) << 10) + (extra & 1023) + 65536); + } else { + output.push(value2); + counter--; + } + } else { + output.push(value2); + } + } + return output; + } + var ucs2encode = function ucs2encode2(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); + }; + var basicToDigit = function basicToDigit2(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + }; + var digitToBasic = function digitToBasic2(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + }; + var adapt = function adapt2(delta, numPoints, firstTime) { + var k6 = 0; + delta = firstTime ? floor2(delta / damp) : delta >> 1; + delta += floor2(delta / numPoints); + for ( + ; + /* no initialization */ + delta > baseMinusTMin * tMax >> 1; + k6 += base + ) { + delta = floor2(delta / baseMinusTMin); + } + return floor2(k6 + (baseMinusTMin + 1) * delta / (delta + skew)); + }; + var decode2 = function decode3(input) { + var output = []; + var inputLength = input.length; + var i7 = 0; + var n7 = initialN; + var bias = initialBias; + var basic = input.lastIndexOf(delimiter2); + if (basic < 0) { + basic = 0; + } + for (var j6 = 0; j6 < basic; ++j6) { + if (input.charCodeAt(j6) >= 128) { + error$1("not-basic"); + } + output.push(input.charCodeAt(j6)); + } + for (var index4 = basic > 0 ? basic + 1 : 0; index4 < inputLength; ) { + var oldi = i7; + for ( + var w6 = 1, k6 = base; + ; + /* no condition */ + k6 += base + ) { + if (index4 >= inputLength) { + error$1("invalid-input"); + } + var digit = basicToDigit(input.charCodeAt(index4++)); + if (digit >= base || digit > floor2((maxInt - i7) / w6)) { + error$1("overflow"); + } + i7 += digit * w6; + var t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (digit < t8) { + break; + } + var baseMinusT = base - t8; + if (w6 > floor2(maxInt / baseMinusT)) { + error$1("overflow"); + } + w6 *= baseMinusT; + } + var out = output.length + 1; + bias = adapt(i7 - oldi, out, oldi == 0); + if (floor2(i7 / out) > maxInt - n7) { + error$1("overflow"); + } + n7 += floor2(i7 / out); + i7 %= out; + output.splice(i7++, 0, n7); + } + return String.fromCodePoint.apply(String, output); + }; + var encode2 = function encode3(input) { + var output = []; + input = ucs2decode(input); + var inputLength = input.length; + var n7 = initialN; + var delta = 0; + var bias = initialBias; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = void 0; + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + if (_currentValue2 < 128) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + var basicLength = output.length; + var handledCPCount = basicLength; + if (basicLength) { + output.push(delimiter2); + } + while (handledCPCount < inputLength) { + var m7 = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = void 0; + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + if (currentValue >= n7 && currentValue < m7) { + m7 = currentValue; + } + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + var handledCPCountPlusOne = handledCPCount + 1; + if (m7 - n7 > floor2((maxInt - delta) / handledCPCountPlusOne)) { + error$1("overflow"); + } + delta += (m7 - n7) * handledCPCountPlusOne; + n7 = m7; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = void 0; + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + if (_currentValue < n7 && ++delta > maxInt) { + error$1("overflow"); + } + if (_currentValue == n7) { + var q5 = delta; + for ( + var k6 = base; + ; + /* no condition */ + k6 += base + ) { + var t8 = k6 <= bias ? tMin : k6 >= bias + tMax ? tMax : k6 - bias; + if (q5 < t8) { + break; + } + var qMinusT = q5 - t8; + var baseMinusT = base - t8; + output.push(stringFromCharCode(digitToBasic(t8 + qMinusT % baseMinusT, 0))); + q5 = floor2(qMinusT / baseMinusT); + } + output.push(stringFromCharCode(digitToBasic(q5, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + ++delta; + ++n7; + } + return output.join(""); + }; + var toUnicode2 = function toUnicode3(input) { + return mapDomain(input, function(string2) { + return regexPunycode.test(string2) ? decode2(string2.slice(4).toLowerCase()) : string2; + }); + }; + var toASCII2 = function toASCII3(input) { + return mapDomain(input, function(string2) { + return regexNonASCII.test(string2) ? "xn--" + encode2(string2) : string2; + }); + }; + var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + "version": "2.1.0", + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + "ucs2": { + "decode": ucs2decode, + "encode": ucs2encode + }, + "decode": decode2, + "encode": encode2, + "toASCII": toASCII2, + "toUnicode": toUnicode2 + }; + var SCHEMES = {}; + function pctEncChar(chr) { + var c7 = chr.charCodeAt(0); + var e10 = void 0; + if (c7 < 16) + e10 = "%0" + c7.toString(16).toUpperCase(); + else if (c7 < 128) + e10 = "%" + c7.toString(16).toUpperCase(); + else if (c7 < 2048) + e10 = "%" + (c7 >> 6 | 192).toString(16).toUpperCase() + "%" + (c7 & 63 | 128).toString(16).toUpperCase(); + else + e10 = "%" + (c7 >> 12 | 224).toString(16).toUpperCase() + "%" + (c7 >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c7 & 63 | 128).toString(16).toUpperCase(); + return e10; + } + function pctDecChars(str2) { + var newStr = ""; + var i7 = 0; + var il = str2.length; + while (i7 < il) { + var c7 = parseInt(str2.substr(i7 + 1, 2), 16); + if (c7 < 128) { + newStr += String.fromCharCode(c7); + i7 += 3; + } else if (c7 >= 194 && c7 < 224) { + if (il - i7 >= 6) { + var c22 = parseInt(str2.substr(i7 + 4, 2), 16); + newStr += String.fromCharCode((c7 & 31) << 6 | c22 & 63); + } else { + newStr += str2.substr(i7, 6); + } + i7 += 6; + } else if (c7 >= 224) { + if (il - i7 >= 9) { + var _c = parseInt(str2.substr(i7 + 4, 2), 16); + var c32 = parseInt(str2.substr(i7 + 7, 2), 16); + newStr += String.fromCharCode((c7 & 15) << 12 | (_c & 63) << 6 | c32 & 63); + } else { + newStr += str2.substr(i7, 9); + } + i7 += 9; + } else { + newStr += str2.substr(i7, 3); + i7 += 3; + } + } + return newStr; + } + function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved2(str2) { + var decStr = pctDecChars(str2); + return !decStr.match(protocol.UNRESERVED) ? str2 : decStr; + } + if (components.scheme) + components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== void 0) + components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== void 0) + components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved2).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== void 0) + components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== void 0) + components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== void 0) + components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved2).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; + } + function _stripLeadingZeros(str2) { + return str2.replace(/^0*(.*)/, "$1") || "0"; + } + function _normalizeIPv4(host, protocol) { + var matches2 = host.match(protocol.IPV4ADDRESS) || []; + var _matches = slicedToArray(matches2, 2), address = _matches[1]; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } + } + function _normalizeIPv6(host, protocol) { + var matches2 = host.match(protocol.IPV6ADDRESS) || []; + var _matches2 = slicedToArray(matches2, 3), address = _matches2[1], zone = _matches2[2]; + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split("::").reverse(), _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), last2 = _address$toLowerCase$2[0], first = _address$toLowerCase$2[1]; + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last2.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x7 = 0; x7 < fieldCount; ++x7) { + fields[x7] = firstFields[x7] || lastFields[lastFieldsStart + x7] || ""; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function(acc, field, index4) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index4) { + lastLongest.length++; + } else { + acc.push({ index: index4, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function(a7, b8) { + return b8.length - a7.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } + } + var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; + var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0; + function parse17(uriString) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") + uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches2 = uriString.match(URI_PARSE); + if (matches2) { + if (NO_MATCH_IS_UNDEFINED) { + components.scheme = matches2[1]; + components.userinfo = matches2[3]; + components.host = matches2[4]; + components.port = parseInt(matches2[5], 10); + components.path = matches2[6] || ""; + components.query = matches2[7]; + components.fragment = matches2[8]; + if (isNaN(components.port)) { + components.port = matches2[5]; + } + } else { + components.scheme = matches2[1] || void 0; + components.userinfo = uriString.indexOf("@") !== -1 ? matches2[3] : void 0; + components.host = uriString.indexOf("//") !== -1 ? matches2[4] : void 0; + components.port = parseInt(matches2[5], 10); + components.path = matches2[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches2[7] : void 0; + components.fragment = uriString.indexOf("#") !== -1 ? matches2[8] : void 0; + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches2[4] : void 0; + } + } + if (components.host) { + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + if (components.scheme === void 0 && components.userinfo === void 0 && components.host === void 0 && components.port === void 0 && !components.path && components.query === void 0) { + components.reference = "same-document"; + } else if (components.scheme === void 0) { + components.reference = "relative"; + } else if (components.fragment === void 0) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e10) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e10; + } + } + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + _normalizeComponentEncoding(components, protocol); + } + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; + } + function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== void 0) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== void 0) { + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function(_6, $1, $22) { + return "[" + $1 + ($22 ? "%25" + $22 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : void 0; + } + var RDS1 = /^\.\.?\//; + var RDS2 = /^\/\.(\/|$)/; + var RDS3 = /^\/\.\.(\/|$)/; + var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; + function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s7 = im[0]; + input = input.slice(s7.length); + output.push(s7); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); + } + function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.host) { + if (protocol.IPV6ADDRESS.test(components.host)) { + } else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e10) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e10; + } + } + } + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== void 0) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== void 0) { + var s7 = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s7 = removeDotSegments(s7); + } + if (authority === void 0) { + s7 = s7.replace(/^\/\//, "/%2F"); + } + uriTokens.push(s7); + } + if (components.query !== void 0) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== void 0) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); + } + function resolveComponents(base2, relative2) { + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var skipNormalization = arguments[3]; + var target = {}; + if (!skipNormalization) { + base2 = parse17(serialize(base2, options), options); + relative2 = parse17(serialize(relative2, options), options); + } + options = options || {}; + if (!options.tolerant && relative2.scheme) { + target.scheme = relative2.scheme; + target.userinfo = relative2.userinfo; + target.host = relative2.host; + target.port = relative2.port; + target.path = removeDotSegments(relative2.path || ""); + target.query = relative2.query; + } else { + if (relative2.userinfo !== void 0 || relative2.host !== void 0 || relative2.port !== void 0) { + target.userinfo = relative2.userinfo; + target.host = relative2.host; + target.port = relative2.port; + target.path = removeDotSegments(relative2.path || ""); + target.query = relative2.query; + } else { + if (!relative2.path) { + target.path = base2.path; + if (relative2.query !== void 0) { + target.query = relative2.query; + } else { + target.query = base2.query; + } + } else { + if (relative2.path.charAt(0) === "/") { + target.path = removeDotSegments(relative2.path); + } else { + if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) { + target.path = "/" + relative2.path; + } else if (!base2.path) { + target.path = relative2.path; + } else { + target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative2.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative2.query; + } + target.userinfo = base2.userinfo; + target.host = base2.host; + target.port = base2.port; + } + target.scheme = base2.scheme; + } + target.fragment = relative2.fragment; + return target; + } + function resolve3(baseURI, relativeURI, options) { + var schemelessOptions = assign3({ scheme: "null" }, options); + return serialize(resolveComponents(parse17(baseURI, schemelessOptions), parse17(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); + } + function normalize2(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse17(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse17(serialize(uri, options), options); + } + return uri; + } + function equal2(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse17(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse17(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; + } + function escapeComponent(str2, options) { + return str2 && str2.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); + } + function unescapeComponent(str2, options) { + return str2 && str2.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); + } + var handler = { + scheme: "http", + domainHost: true, + parse: function parse18(components, options) { + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize2(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = void 0; + } + if (!components.path) { + components.path = "/"; + } + return components; + } + }; + var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize + }; + function isSecure(wsComponents) { + return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; + } + var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse18(components, options) { + var wsComponents = components; + wsComponents.secure = isSecure(wsComponents); + wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : ""); + wsComponents.path = void 0; + wsComponents.query = void 0; + return wsComponents; + }, + serialize: function serialize2(wsComponents, options) { + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = void 0; + } + if (typeof wsComponents.secure === "boolean") { + wsComponents.scheme = wsComponents.secure ? "wss" : "ws"; + wsComponents.secure = void 0; + } + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split("?"), _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), path2 = _wsComponents$resourc2[0], query = _wsComponents$resourc2[1]; + wsComponents.path = path2 && path2 !== "/" ? path2 : void 0; + wsComponents.query = query; + wsComponents.resourceName = void 0; + } + wsComponents.fragment = void 0; + return wsComponents; + } + }; + var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize + }; + var O7 = {}; + var isIRI = true; + var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; + var HEXDIG$$ = "[0-9A-Fa-f]"; + var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); + var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; + var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; + var VCHAR$$ = merge7(QTEXT$$, '[\\"\\\\]'); + var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; + var UNRESERVED = new RegExp(UNRESERVED$$, "g"); + var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); + var NOT_LOCAL_PART = new RegExp(merge7("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); + var NOT_HFNAME = new RegExp(merge7("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); + var NOT_HFVALUE = NOT_HFNAME; + function decodeUnreserved(str2) { + var decStr = pctDecChars(str2); + return !decStr.match(UNRESERVED) ? str2 : decStr; + } + var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = void 0; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x7 = 0, xl = hfields.length; x7 < xl; ++x7) { + var hfield = hfields[x7].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) + mailtoComponents.headers = headers; + } + mailtoComponents.query = void 0; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e10) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e10; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray3(mailtoComponents.to); + if (to) { + for (var x7 = 0, xl = to.length; x7 < xl; ++x7) { + var toAddr = String(to[x7]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain3 = toAddr.slice(atIdx + 1); + try { + domain3 = !options.iri ? punycode.toASCII(unescapeComponent(domain3, options).toLowerCase()) : punycode.toUnicode(domain3); + } catch (e10) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e10; + } + to[x7] = localPart + "@" + domain3; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) + headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) + headers["body"] = mailtoComponents.body; + var fields = []; + for (var name2 in headers) { + if (headers[name2] !== O7[name2]) { + fields.push(name2.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name2].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } + }; + var URN_PARSE = /^([^\:]+)\:(.*)/; + var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches2 = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches2) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches2[1].toLowerCase(); + var nss = matches2[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = void 0; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } + }; + var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; + var handler$6 = { + scheme: "urn:uuid", + parse: function parse18(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = void 0; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize2(uuidComponents, options) { + var urnComponents = uuidComponents; + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } + }; + SCHEMES[handler.scheme] = handler; + SCHEMES[handler$1.scheme] = handler$1; + SCHEMES[handler$2.scheme] = handler$2; + SCHEMES[handler$3.scheme] = handler$3; + SCHEMES[handler$4.scheme] = handler$4; + SCHEMES[handler$5.scheme] = handler$5; + SCHEMES[handler$6.scheme] = handler$6; + exports29.SCHEMES = SCHEMES; + exports29.pctEncChar = pctEncChar; + exports29.pctDecChars = pctDecChars; + exports29.parse = parse17; + exports29.removeDotSegments = removeDotSegments; + exports29.serialize = serialize; + exports29.resolveComponents = resolveComponents; + exports29.resolve = resolve3; + exports29.normalize = normalize2; + exports29.equal = equal2; + exports29.escapeComponent = escapeComponent; + exports29.unescapeComponent = unescapeComponent; + Object.defineProperty(exports29, "__esModule", { value: true }); + }); + } +}); + +// node_modules/webapi-parser/node_modules/fast-deep-equal/index.js +var require_fast_deep_equal2 = __commonJS({ + "node_modules/webapi-parser/node_modules/fast-deep-equal/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var isArray3 = Array.isArray; + var keyList = Object.keys; + var hasProp = Object.prototype.hasOwnProperty; + module5.exports = function equal2(a7, b8) { + if (a7 === b8) + return true; + if (a7 && b8 && typeof a7 == "object" && typeof b8 == "object") { + var arrA = isArray3(a7), arrB = isArray3(b8), i7, length, key; + if (arrA && arrB) { + length = a7.length; + if (length != b8.length) + return false; + for (i7 = length; i7-- !== 0; ) + if (!equal2(a7[i7], b8[i7])) + return false; + return true; + } + if (arrA != arrB) + return false; + var dateA = a7 instanceof Date, dateB = b8 instanceof Date; + if (dateA != dateB) + return false; + if (dateA && dateB) + return a7.getTime() == b8.getTime(); + var regexpA = a7 instanceof RegExp, regexpB = b8 instanceof RegExp; + if (regexpA != regexpB) + return false; + if (regexpA && regexpB) + return a7.toString() == b8.toString(); + var keys2 = keyList(a7); + length = keys2.length; + if (length !== keyList(b8).length) + return false; + for (i7 = length; i7-- !== 0; ) + if (!hasProp.call(b8, keys2[i7])) + return false; + for (i7 = length; i7-- !== 0; ) { + key = keys2[i7]; + if (!equal2(a7[key], b8[key])) + return false; + } + return true; + } + return a7 !== a7 && b8 !== b8; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/ucs2length.js +var require_ucs2length2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/ucs2length.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function ucs2length(str2) { + var length = 0, len = str2.length, pos = 0, value2; + while (pos < len) { + length++; + value2 = str2.charCodeAt(pos++); + if (value2 >= 55296 && value2 <= 56319 && pos < len) { + value2 = str2.charCodeAt(pos); + if ((value2 & 64512) == 56320) + pos++; + } + } + return length; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/util.js +var require_util3 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/util.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + copy: copy4, + checkDataType, + checkDataTypes, + coerceToTypes, + toHash, + getProperty, + escapeQuotes, + equal: require_fast_deep_equal2(), + ucs2length: require_ucs2length2(), + varOccurences, + varReplace, + cleanUpCode, + finalCleanUpCode, + schemaHasRules, + schemaHasRulesExcept, + toQuotedString, + getPathExpr, + getPath, + getData: getData2, + unescapeFragment, + unescapeJsonPointer, + escapeFragment, + escapeJsonPointer + }; + function copy4(o7, to) { + to = to || {}; + for (var key in o7) + to[key] = o7[key]; + return to; + } + function checkDataType(dataType, data, negate2) { + var EQUAL = negate2 ? " !== " : " === ", AND = negate2 ? " || " : " && ", OK2 = negate2 ? "!" : "", NOT = negate2 ? "" : "!"; + switch (dataType) { + case "null": + return data + EQUAL + "null"; + case "array": + return OK2 + "Array.isArray(" + data + ")"; + case "object": + return "(" + OK2 + data + AND + "typeof " + data + EQUAL + '"object"' + AND + NOT + "Array.isArray(" + data + "))"; + case "integer": + return "(typeof " + data + EQUAL + '"number"' + AND + NOT + "(" + data + " % 1)" + AND + data + EQUAL + data + ")"; + default: + return "typeof " + data + EQUAL + '"' + dataType + '"'; + } + } + function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: + return checkDataType(dataTypes[0], data, true); + default: + var code = ""; + var types3 = toHash(dataTypes); + if (types3.array && types3.object) { + code = types3.null ? "(" : "(!" + data + " || "; + code += "typeof " + data + ' !== "object")'; + delete types3.null; + delete types3.array; + delete types3.object; + } + if (types3.number) + delete types3.integer; + for (var t8 in types3) + code += (code ? " && " : "") + checkDataType(t8, data, true); + return code; + } + } + var COERCE_TO_TYPES = toHash(["string", "number", "integer", "boolean", "null"]); + function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types3 = []; + for (var i7 = 0; i7 < dataTypes.length; i7++) { + var t8 = dataTypes[i7]; + if (COERCE_TO_TYPES[t8]) + types3[types3.length] = t8; + else if (optionCoerceTypes === "array" && t8 === "array") + types3[types3.length] = t8; + } + if (types3.length) + return types3; + } else if (COERCE_TO_TYPES[dataTypes]) { + return [dataTypes]; + } else if (optionCoerceTypes === "array" && dataTypes === "array") { + return ["array"]; + } + } + function toHash(arr) { + var hash = {}; + for (var i7 = 0; i7 < arr.length; i7++) + hash[arr[i7]] = true; + return hash; + } + var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; + var SINGLE_QUOTE = /'|\\/g; + function getProperty(key) { + return typeof key == "number" ? "[" + key + "]" : IDENTIFIER.test(key) ? "." + key : "['" + escapeQuotes(key) + "']"; + } + function escapeQuotes(str2) { + return str2.replace(SINGLE_QUOTE, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t"); + } + function varOccurences(str2, dataVar) { + dataVar += "[^0-9]"; + var matches2 = str2.match(new RegExp(dataVar, "g")); + return matches2 ? matches2.length : 0; + } + function varReplace(str2, dataVar, expr) { + dataVar += "([^0-9])"; + expr = expr.replace(/\$/g, "$$$$"); + return str2.replace(new RegExp(dataVar, "g"), expr + "$1"); + } + var EMPTY_ELSE = /else\s*{\s*}/g; + var EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g; + var EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g; + function cleanUpCode(out) { + return out.replace(EMPTY_ELSE, "").replace(EMPTY_IF_NO_ELSE, "").replace(EMPTY_IF_WITH_ELSE, "if (!($1))"); + } + var ERRORS_REGEXP = /[^v.]errors/g; + var REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g; + var REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g; + var RETURN_VALID = "return errors === 0;"; + var RETURN_TRUE = "validate.errors = null; return true;"; + var RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/; + var RETURN_DATA_ASYNC = "return data;"; + var ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g; + var REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; + function finalCleanUpCode(out, async) { + var matches2 = out.match(ERRORS_REGEXP); + if (matches2 && matches2.length == 2) { + out = async ? out.replace(REMOVE_ERRORS_ASYNC, "").replace(RETURN_ASYNC, RETURN_DATA_ASYNC) : out.replace(REMOVE_ERRORS, "").replace(RETURN_VALID, RETURN_TRUE); + } + matches2 = out.match(ROOTDATA_REGEXP); + if (!matches2 || matches2.length !== 3) + return out; + return out.replace(REMOVE_ROOTDATA, ""); + } + function schemaHasRules(schema8, rules) { + if (typeof schema8 == "boolean") + return !schema8; + for (var key in schema8) + if (rules[key]) + return true; + } + function schemaHasRulesExcept(schema8, rules, exceptKeyword) { + if (typeof schema8 == "boolean") + return !schema8 && exceptKeyword != "not"; + for (var key in schema8) + if (key != exceptKeyword && rules[key]) + return true; + } + function toQuotedString(str2) { + return "'" + escapeQuotes(str2) + "'"; + } + function getPathExpr(currentPath, expr, jsonPointers, isNumber3) { + var path2 = jsonPointers ? "'/' + " + expr + (isNumber3 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber3 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; + return joinPaths(currentPath, path2); + } + function getPath(currentPath, prop, jsonPointers) { + var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); + return joinPaths(currentPath, path2); + } + var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; + var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; + function getData2($data, lvl, paths) { + var up, jsonPointer, data, matches2; + if ($data === "") + return "rootData"; + if ($data[0] == "/") { + if (!JSON_POINTER.test($data)) + throw new Error("Invalid JSON-pointer: " + $data); + jsonPointer = $data; + data = "rootData"; + } else { + matches2 = $data.match(RELATIVE_JSON_POINTER); + if (!matches2) + throw new Error("Invalid JSON-pointer: " + $data); + up = +matches2[1]; + jsonPointer = matches2[2]; + if (jsonPointer == "#") { + if (up >= lvl) + throw new Error("Cannot access property/index " + up + " levels up, current level is " + lvl); + return paths[lvl - up]; + } + if (up > lvl) + throw new Error("Cannot access data " + up + " levels up, current level is " + lvl); + data = "data" + (lvl - up || ""); + if (!jsonPointer) + return data; + } + var expr = data; + var segments = jsonPointer.split("/"); + for (var i7 = 0; i7 < segments.length; i7++) { + var segment = segments[i7]; + if (segment) { + data += getProperty(unescapeJsonPointer(segment)); + expr += " && " + data; + } + } + return expr; + } + function joinPaths(a7, b8) { + if (a7 == '""') + return b8; + return (a7 + " + " + b8).replace(/' \+ '/g, ""); + } + function unescapeFragment(str2) { + return unescapeJsonPointer(decodeURIComponent(str2)); + } + function escapeFragment(str2) { + return encodeURIComponent(escapeJsonPointer(str2)); + } + function escapeJsonPointer(str2) { + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + function unescapeJsonPointer(str2) { + return str2.replace(/~1/g, "/").replace(/~0/g, "~"); + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/schema_obj.js +var require_schema_obj = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/schema_obj.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = require_util3(); + module5.exports = SchemaObject; + function SchemaObject(obj) { + util2.copy(obj, this); + } + } +}); + +// node_modules/webapi-parser/node_modules/json-schema-traverse/index.js +var require_json_schema_traverse2 = __commonJS({ + "node_modules/webapi-parser/node_modules/json-schema-traverse/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var traverse4 = module5.exports = function(schema8, opts, cb) { + if (typeof opts == "function") { + cb = opts; + opts = {}; + } + cb = opts.cb || cb; + var pre = typeof cb == "function" ? cb : cb.pre || function() { + }; + var post = cb.post || function() { + }; + _traverse(opts, pre, post, schema8, "", schema8); + }; + traverse4.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true + }; + traverse4.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true + }; + traverse4.propsKeywords = { + definitions: true, + properties: true, + patternProperties: true, + dependencies: true + }; + traverse4.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true + }; + function _traverse(opts, pre, post, schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema8 && typeof schema8 == "object" && !Array.isArray(schema8)) { + pre(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema8) { + var sch = schema8[key]; + if (Array.isArray(sch)) { + if (key in traverse4.arrayKeywords) { + for (var i7 = 0; i7 < sch.length; i7++) + _traverse(opts, pre, post, sch[i7], jsonPtr + "/" + key + "/" + i7, rootSchema, jsonPtr, key, schema8, i7); + } + } else if (key in traverse4.propsKeywords) { + if (sch && typeof sch == "object") { + for (var prop in sch) + _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema8, prop); + } + } else if (key in traverse4.keywords || opts.allKeys && !(key in traverse4.skipKeywords)) { + _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema8); + } + } + post(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + } + } + function escapeJsonPtr(str2) { + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/resolve.js +var require_resolve2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/resolve.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var URI = require_uri_all(); + var equal2 = require_fast_deep_equal2(); + var util2 = require_util3(); + var SchemaObject = require_schema_obj(); + var traverse4 = require_json_schema_traverse2(); + module5.exports = resolve3; + resolve3.normalizeId = normalizeId; + resolve3.fullPath = getFullPath; + resolve3.url = resolveUrl; + resolve3.ids = resolveIds; + resolve3.inlineRef = inlineRef; + resolve3.schema = resolveSchema; + function resolve3(compile, root2, ref) { + var refVal = this._refs[ref]; + if (typeof refVal == "string") { + if (this._refs[refVal]) + refVal = this._refs[refVal]; + else + return resolve3.call(this, compile, root2, refVal); + } + refVal = refVal || this._schemas[ref]; + if (refVal instanceof SchemaObject) { + return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); + } + var res = resolveSchema.call(this, root2, ref); + var schema8, v8, baseId; + if (res) { + schema8 = res.schema; + root2 = res.root; + baseId = res.baseId; + } + if (schema8 instanceof SchemaObject) { + v8 = schema8.validate || compile.call(this, schema8.schema, root2, void 0, baseId); + } else if (schema8 !== void 0) { + v8 = inlineRef(schema8, this._opts.inlineRefs) ? schema8 : compile.call(this, schema8, root2, void 0, baseId); + } + return v8; + } + function resolveSchema(root2, ref) { + var p7 = URI.parse(ref), refPath = _getFullPath(p7), baseId = getFullPath(this._getId(root2.schema)); + if (Object.keys(root2.schema).length === 0 || refPath !== baseId) { + var id = normalizeId(refPath); + var refVal = this._refs[id]; + if (typeof refVal == "string") { + return resolveRecursive.call(this, root2, refVal, p7); + } else if (refVal instanceof SchemaObject) { + if (!refVal.validate) + this._compile(refVal); + root2 = refVal; + } else { + refVal = this._schemas[id]; + if (refVal instanceof SchemaObject) { + if (!refVal.validate) + this._compile(refVal); + if (id == normalizeId(ref)) + return { schema: refVal, root: root2, baseId }; + root2 = refVal; + } else { + return; + } + } + if (!root2.schema) + return; + baseId = getFullPath(this._getId(root2.schema)); + } + return getJsonPointer.call(this, p7, baseId, root2.schema, root2); + } + function resolveRecursive(root2, ref, parsedRef) { + var res = resolveSchema.call(this, root2, ref); + if (res) { + var schema8 = res.schema; + var baseId = res.baseId; + root2 = res.root; + var id = this._getId(schema8); + if (id) + baseId = resolveUrl(baseId, id); + return getJsonPointer.call(this, parsedRef, baseId, schema8, root2); + } + } + var PREVENT_SCOPE_CHANGE = util2.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]); + function getJsonPointer(parsedRef, baseId, schema8, root2) { + parsedRef.fragment = parsedRef.fragment || ""; + if (parsedRef.fragment.slice(0, 1) != "/") + return; + var parts = parsedRef.fragment.split("/"); + for (var i7 = 1; i7 < parts.length; i7++) { + var part = parts[i7]; + if (part) { + part = util2.unescapeFragment(part); + schema8 = schema8[part]; + if (schema8 === void 0) + break; + var id; + if (!PREVENT_SCOPE_CHANGE[part]) { + id = this._getId(schema8); + if (id) + baseId = resolveUrl(baseId, id); + if (schema8.$ref) { + var $ref = resolveUrl(baseId, schema8.$ref); + var res = resolveSchema.call(this, root2, $ref); + if (res) { + schema8 = res.schema; + root2 = res.root; + baseId = res.baseId; + } + } + } + } + } + if (schema8 !== void 0 && schema8 !== root2.schema) + return { schema: schema8, root: root2, baseId }; + } + var SIMPLE_INLINED = util2.toHash([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum" + ]); + function inlineRef(schema8, limit) { + if (limit === false) + return false; + if (limit === void 0 || limit === true) + return checkNoRef(schema8); + else if (limit) + return countKeys(schema8) <= limit; + } + function checkNoRef(schema8) { + var item; + if (Array.isArray(schema8)) { + for (var i7 = 0; i7 < schema8.length; i7++) { + item = schema8[i7]; + if (typeof item == "object" && !checkNoRef(item)) + return false; + } + } else { + for (var key in schema8) { + if (key == "$ref") + return false; + item = schema8[key]; + if (typeof item == "object" && !checkNoRef(item)) + return false; + } + } + return true; + } + function countKeys(schema8) { + var count2 = 0, item; + if (Array.isArray(schema8)) { + for (var i7 = 0; i7 < schema8.length; i7++) { + item = schema8[i7]; + if (typeof item == "object") + count2 += countKeys(item); + if (count2 == Infinity) + return Infinity; + } + } else { + for (var key in schema8) { + if (key == "$ref") + return Infinity; + if (SIMPLE_INLINED[key]) { + count2++; + } else { + item = schema8[key]; + if (typeof item == "object") + count2 += countKeys(item) + 1; + if (count2 == Infinity) + return Infinity; + } + } + } + return count2; + } + function getFullPath(id, normalize2) { + if (normalize2 !== false) + id = normalizeId(id); + var p7 = URI.parse(id); + return _getFullPath(p7); + } + function _getFullPath(p7) { + return URI.serialize(p7).split("#")[0] + "#"; + } + var TRAILING_SLASH_HASH = /#\/?$/; + function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; + } + function resolveUrl(baseId, id) { + id = normalizeId(id); + return URI.resolve(baseId, id); + } + function resolveIds(schema8) { + var schemaId = normalizeId(this._getId(schema8)); + var baseIds = { "": schemaId }; + var fullPaths = { "": getFullPath(schemaId, false) }; + var localRefs = {}; + var self2 = this; + traverse4(schema8, { allKeys: true }, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (jsonPtr === "") + return; + var id = self2._getId(sch); + var baseId = baseIds[parentJsonPtr]; + var fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword; + if (keyIndex !== void 0) + fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util2.escapeFragment(keyIndex)); + if (typeof id == "string") { + id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id); + var refVal = self2._refs[id]; + if (typeof refVal == "string") + refVal = self2._refs[refVal]; + if (refVal && refVal.schema) { + if (!equal2(sch, refVal.schema)) + throw new Error('id "' + id + '" resolves to more than one schema'); + } else if (id != normalizeId(fullPath)) { + if (id[0] == "#") { + if (localRefs[id] && !equal2(sch, localRefs[id])) + throw new Error('id "' + id + '" resolves to more than one schema'); + localRefs[id] = sch; + } else { + self2._refs[id] = fullPath; + } + } + } + baseIds[jsonPtr] = baseId; + fullPaths[jsonPtr] = fullPath; + }); + return localRefs; + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/error_classes.js +var require_error_classes = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/error_classes.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var resolve3 = require_resolve2(); + module5.exports = { + Validation: errorSubclass(ValidationError), + MissingRef: errorSubclass(MissingRefError) + }; + function ValidationError(errors) { + this.message = "validation failed"; + this.errors = errors; + this.ajv = this.validation = true; + } + MissingRefError.message = function(baseId, ref) { + return "can't resolve reference " + ref + " from id " + baseId; + }; + function MissingRefError(baseId, ref, message) { + this.message = message || MissingRefError.message(baseId, ref); + this.missingRef = resolve3.url(baseId, ref); + this.missingSchema = resolve3.normalizeId(resolve3.fullPath(this.missingRef)); + } + function errorSubclass(Subclass) { + Subclass.prototype = Object.create(Error.prototype); + Subclass.prototype.constructor = Subclass; + return Subclass; + } + } +}); + +// node_modules/fast-json-stable-stringify/index.js +var require_fast_json_stable_stringify = __commonJS({ + "node_modules/fast-json-stable-stringify/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function(data, opts) { + if (!opts) + opts = {}; + if (typeof opts === "function") + opts = { cmp: opts }; + var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false; + var cmp = opts.cmp && /* @__PURE__ */ function(f8) { + return function(node) { + return function(a7, b8) { + var aobj = { key: a7, value: node[a7] }; + var bobj = { key: b8, value: node[b8] }; + return f8(aobj, bobj); + }; + }; + }(opts.cmp); + var seen = []; + return function stringify5(node) { + if (node && node.toJSON && typeof node.toJSON === "function") { + node = node.toJSON(); + } + if (node === void 0) + return; + if (typeof node == "number") + return isFinite(node) ? "" + node : "null"; + if (typeof node !== "object") + return JSON.stringify(node); + var i7, out; + if (Array.isArray(node)) { + out = "["; + for (i7 = 0; i7 < node.length; i7++) { + if (i7) + out += ","; + out += stringify5(node[i7]) || "null"; + } + return out + "]"; + } + if (node === null) + return "null"; + if (seen.indexOf(node) !== -1) { + if (cycles) + return JSON.stringify("__cycle__"); + throw new TypeError("Converting circular structure to JSON"); + } + var seenIndex = seen.push(node) - 1; + var keys2 = Object.keys(node).sort(cmp && cmp(node)); + out = ""; + for (i7 = 0; i7 < keys2.length; i7++) { + var key = keys2[i7]; + var value2 = stringify5(node[key]); + if (!value2) + continue; + if (out) + out += ","; + out += JSON.stringify(key) + ":" + value2; + } + seen.splice(seenIndex, 1); + return "{" + out + "}"; + }(data); + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/validate.js +var require_validate2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/validate.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_validate(it2, $keyword, $ruleType) { + var out = ""; + var $async = it2.schema.$async === true, $refKeywords = it2.util.schemaHasRulesExcept(it2.schema, it2.RULES.all, "$ref"), $id = it2.self._getId(it2.schema); + if (it2.isTop) { + out += " var validate = "; + if ($async) { + it2.async = true; + out += "async "; + } + out += "function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; "; + if ($id && (it2.opts.sourceCode || it2.opts.processCode)) { + out += " " + ("/*# sourceURL=" + $id + " */") + " "; + } + } + if (typeof it2.schema == "boolean" || !($refKeywords || it2.schema.$ref)) { + var $keyword = "false schema"; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + if (it2.schema === false) { + if (it2.isTop) { + $breakOnError = true; + } else { + out += " var " + $valid + " = false; "; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "false schema") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'boolean schema is false' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } else { + if (it2.isTop) { + if ($async) { + out += " return data; "; + } else { + out += " validate.errors = null; return true; "; + } + } else { + out += " var " + $valid + " = true; "; + } + } + if (it2.isTop) { + out += " }; return validate; "; + } + return out; + } + if (it2.isTop) { + var $top = it2.isTop, $lvl = it2.level = 0, $dataLvl = it2.dataLevel = 0, $data = "data"; + it2.rootId = it2.resolve.fullPath(it2.self._getId(it2.root.schema)); + it2.baseId = it2.baseId || it2.rootId; + delete it2.isTop; + it2.dataPathArr = [void 0]; + out += " var vErrors = null; "; + out += " var errors = 0; "; + out += " if (rootData === undefined) rootData = data; "; + } else { + var $lvl = it2.level, $dataLvl = it2.dataLevel, $data = "data" + ($dataLvl || ""); + if ($id) + it2.baseId = it2.resolve.url(it2.baseId, $id); + if ($async && !it2.async) + throw new Error("async schema in sync schema"); + out += " var errs_" + $lvl + " = errors;"; + } + var $valid = "valid" + $lvl, $breakOnError = !it2.opts.allErrors, $closingBraces1 = "", $closingBraces2 = ""; + var $errorKeyword; + var $typeSchema = it2.schema.type, $typeIsArray = Array.isArray($typeSchema); + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it2.schema.$ref && $refKeywords) { + if (it2.opts.extendRefs == "fail") { + throw new Error('$ref: validation keywords used in schema at path "' + it2.errSchemaPath + '" (see option extendRefs)'); + } else if (it2.opts.extendRefs !== true) { + $refKeywords = false; + it2.logger.warn('$ref: keywords ignored in schema at path "' + it2.errSchemaPath + '"'); + } + } + if (it2.schema.$comment && it2.opts.$comment) { + out += " " + it2.RULES.all.$comment.code(it2, "$comment"); + } + if ($typeSchema) { + if (it2.opts.coerceTypes) { + var $coerceToTypes = it2.util.coerceToTypes(it2.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it2.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || $rulesGroup && !$shouldUseGroup($rulesGroup)) { + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type"; + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type", $method = $typeIsArray ? "checkDataTypes" : "checkDataType"; + out += " if (" + it2.util[$method]($typeSchema, $data, true) + ") { "; + if ($coerceToTypes) { + var $dataType = "dataType" + $lvl, $coerced = "coerced" + $lvl; + out += " var " + $dataType + " = typeof " + $data + "; "; + if (it2.opts.coerceTypes == "array") { + out += " if (" + $dataType + " == 'object' && Array.isArray(" + $data + ")) " + $dataType + " = 'array'; "; + } + out += " var " + $coerced + " = undefined; "; + var $bracesCoercion = ""; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += " if (" + $coerced + " === undefined) { "; + $bracesCoercion += "}"; + } + if (it2.opts.coerceTypes == "array" && $type != "array") { + out += " if (" + $dataType + " == 'array' && " + $data + ".length == 1) { " + $coerced + " = " + $data + " = " + $data + "[0]; " + $dataType + " = typeof " + $data + "; } "; + } + if ($type == "string") { + out += " if (" + $dataType + " == 'number' || " + $dataType + " == 'boolean') " + $coerced + " = '' + " + $data + "; else if (" + $data + " === null) " + $coerced + " = ''; "; + } else if ($type == "number" || $type == "integer") { + out += " if (" + $dataType + " == 'boolean' || " + $data + " === null || (" + $dataType + " == 'string' && " + $data + " && " + $data + " == +" + $data + " "; + if ($type == "integer") { + out += " && !(" + $data + " % 1)"; + } + out += ")) " + $coerced + " = +" + $data + "; "; + } else if ($type == "boolean") { + out += " if (" + $data + " === 'false' || " + $data + " === 0 || " + $data + " === null) " + $coerced + " = false; else if (" + $data + " === 'true' || " + $data + " === 1) " + $coerced + " = true; "; + } else if ($type == "null") { + out += " if (" + $data + " === '' || " + $data + " === 0 || " + $data + " === false) " + $coerced + " = null; "; + } else if (it2.opts.coerceTypes == "array" && $type == "array") { + out += " if (" + $dataType + " == 'string' || " + $dataType + " == 'number' || " + $dataType + " == 'boolean' || " + $data + " == null) " + $coerced + " = [" + $data + "]; "; + } + } + } + out += " " + $bracesCoercion + " if (" + $coerced + " === undefined) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " " + $data + " = " + $coerced + "; "; + if (!$dataLvl) { + out += "if (" + $parentData + " !== undefined)"; + } + out += " " + $parentData + "[" + $parentDataProperty + "] = " + $coerced + "; } "; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } + out += " } "; + } + } + if (it2.schema.$ref && !$refKeywords) { + out += " " + it2.RULES.all.$ref.code(it2, "$ref") + " "; + if ($breakOnError) { + out += " } if (errors === "; + if ($top) { + out += "0"; + } else { + out += "errs_" + $lvl; + } + out += ") { "; + $closingBraces2 += "}"; + } + } else { + var arr2 = it2.RULES; + if (arr2) { + var $rulesGroup, i22 = -1, l22 = arr2.length - 1; + while (i22 < l22) { + $rulesGroup = arr2[i22 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += " if (" + it2.util.checkDataType($rulesGroup.type, $data) + ") { "; + } + if (it2.opts.useDefaults && !it2.compositeRule) { + if ($rulesGroup.type == "object" && it2.schema.properties) { + var $schema = it2.schema.properties, $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i32 = -1, l32 = arr3.length - 1; + while (i32 < l32) { + $propertyKey = arr3[i32 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== void 0) { + var $passData = $data + it2.util.getProperty($propertyKey); + out += " if (" + $passData + " === undefined) " + $passData + " = "; + if (it2.opts.useDefaults == "shared") { + out += " " + it2.useDefault($sch.default) + " "; + } else { + out += " " + JSON.stringify($sch.default) + " "; + } + out += "; "; + } + } + } + } else if ($rulesGroup.type == "array" && Array.isArray(it2.schema.items)) { + var arr4 = it2.schema.items; + if (arr4) { + var $sch, $i = -1, l42 = arr4.length - 1; + while ($i < l42) { + $sch = arr4[$i += 1]; + if ($sch.default !== void 0) { + var $passData = $data + "[" + $i + "]"; + out += " if (" + $passData + " === undefined) " + $passData + " = "; + if (it2.opts.useDefaults == "shared") { + out += " " + it2.useDefault($sch.default) + " "; + } else { + out += " " + JSON.stringify($sch.default) + " "; + } + out += "; "; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i52 = -1, l52 = arr5.length - 1; + while (i52 < l52) { + $rule = arr5[i52 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it2, $rule.keyword, $rulesGroup.type); + if ($code) { + out += " " + $code + " "; + if ($breakOnError) { + $closingBraces1 += "}"; + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces1 + " "; + $closingBraces1 = ""; + } + if ($rulesGroup.type) { + out += " } "; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += " else { "; + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + } + } + if ($breakOnError) { + out += " if (errors === "; + if ($top) { + out += "0"; + } else { + out += "errs_" + $lvl; + } + out += ") { "; + $closingBraces2 += "}"; + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces2 + " "; + } + if ($top) { + if ($async) { + out += " if (errors === 0) return data; "; + out += " else throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; "; + out += " return errors === 0; "; + } + out += " }; return validate;"; + } else { + out += " var " + $valid + " = errors === errs_" + $lvl + ";"; + } + out = it2.util.cleanUpCode(out); + if ($top) { + out = it2.util.finalCleanUpCode(out, $async); + } + function $shouldUseGroup($rulesGroup2) { + var rules = $rulesGroup2.rules; + for (var i7 = 0; i7 < rules.length; i7++) + if ($shouldUseRule(rules[i7])) + return true; + } + function $shouldUseRule($rule2) { + return it2.schema[$rule2.keyword] !== void 0 || $rule2.implements && $ruleImplementsSomeKeyword($rule2); + } + function $ruleImplementsSomeKeyword($rule2) { + var impl = $rule2.implements; + for (var i7 = 0; i7 < impl.length; i7++) + if (it2.schema[impl[i7]] !== void 0) + return true; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/index.js +var require_compile2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var resolve3 = require_resolve2(); + var util2 = require_util3(); + var errorClasses = require_error_classes(); + var stableStringify = require_fast_json_stable_stringify(); + var validateGenerator = require_validate2(); + var ucs2length = util2.ucs2length; + var equal2 = require_fast_deep_equal2(); + var ValidationError = errorClasses.Validation; + module5.exports = compile; + function compile(schema8, root2, localRefs, baseId) { + var self2 = this, opts = this._opts, refVal = [void 0], refs = {}, patterns = [], patternsHash = {}, defaults2 = [], defaultsHash = {}, customRules = []; + root2 = root2 || { schema: schema8, refVal, refs }; + var c7 = checkCompiling.call(this, schema8, root2, baseId); + var compilation = this._compilations[c7.index]; + if (c7.compiling) + return compilation.callValidate = callValidate; + var formats = this._formats; + var RULES = this.RULES; + try { + var v8 = localCompile(schema8, root2, localRefs, baseId); + compilation.validate = v8; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v8.schema; + cv.errors = null; + cv.refs = v8.refs; + cv.refVal = v8.refVal; + cv.root = v8.root; + cv.$async = v8.$async; + if (opts.sourceCode) + cv.source = v8.source; + } + return v8; + } finally { + endCompiling.call(this, schema8, root2, baseId); + } + function callValidate() { + var validate15 = compilation.validate; + var result2 = validate15.apply(this, arguments); + callValidate.errors = validate15.errors; + return result2; + } + function localCompile(_schema, _root, localRefs2, baseId2) { + var isRoot = !_root || _root && _root.schema == _schema; + if (_root.schema != root2.schema) + return compile.call(self2, _schema, _root, localRefs2, baseId2); + var $async = _schema.$async === true; + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot, + baseId: baseId2, + root: _root, + schemaPath: "", + errSchemaPath: "#", + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES, + validate: validateGenerator, + util: util2, + resolve: resolve3, + resolveRef, + usePattern, + useDefault, + useCustomRule, + opts, + formats, + logger: self2.logger, + self: self2 + }); + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults2, defaultCode) + vars(customRules, customRuleCode) + sourceCode; + if (opts.processCode) + sourceCode = opts.processCode(sourceCode); + var validate15; + try { + var makeValidate = new Function( + "self", + "RULES", + "formats", + "root", + "refVal", + "defaults", + "customRules", + "equal", + "ucs2length", + "ValidationError", + sourceCode + ); + validate15 = makeValidate( + self2, + RULES, + formats, + root2, + refVal, + defaults2, + customRules, + equal2, + ucs2length, + ValidationError + ); + refVal[0] = validate15; + } catch (e10) { + self2.logger.error("Error compiling schema, function code:", sourceCode); + throw e10; + } + validate15.schema = _schema; + validate15.errors = null; + validate15.refs = refs; + validate15.refVal = refVal; + validate15.root = isRoot ? validate15 : _root; + if ($async) + validate15.$async = true; + if (opts.sourceCode === true) { + validate15.source = { + code: sourceCode, + patterns, + defaults: defaults2 + }; + } + return validate15; + } + function resolveRef(baseId2, ref, isRoot) { + ref = resolve3.url(baseId2, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== void 0) { + _refVal = refVal[refIndex]; + refCode = "refVal[" + refIndex + "]"; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root2.refs) { + var rootRefId = root2.refs[ref]; + if (rootRefId !== void 0) { + _refVal = root2.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + refCode = addLocalRef(ref); + var v9 = resolve3.call(self2, localCompile, root2, ref); + if (v9 === void 0) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v9 = resolve3.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self2, localSchema, root2, localRefs, baseId2); + } + } + if (v9 === void 0) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v9); + return resolvedRef(v9, refCode); + } + } + function addLocalRef(ref, v9) { + var refId = refVal.length; + refVal[refId] = v9; + refs[ref] = refId; + return "refVal" + refId; + } + function removeLocalRef(ref) { + delete refs[ref]; + } + function replaceLocalRef(ref, v9) { + var refId = refs[ref]; + refVal[refId] = v9; + } + function resolvedRef(refVal2, code) { + return typeof refVal2 == "object" || typeof refVal2 == "boolean" ? { code, schema: refVal2, inline: true } : { code, $async: refVal2 && !!refVal2.$async }; + } + function usePattern(regexStr) { + var index4 = patternsHash[regexStr]; + if (index4 === void 0) { + index4 = patternsHash[regexStr] = patterns.length; + patterns[index4] = regexStr; + } + return "pattern" + index4; + } + function useDefault(value2) { + switch (typeof value2) { + case "boolean": + case "number": + return "" + value2; + case "string": + return util2.toQuotedString(value2); + case "object": + if (value2 === null) + return "null"; + var valueStr = stableStringify(value2); + var index4 = defaultsHash[valueStr]; + if (index4 === void 0) { + index4 = defaultsHash[valueStr] = defaults2.length; + defaults2[index4] = value2; + } + return "default" + index4; + } + } + function useCustomRule(rule, schema9, parentSchema, it2) { + var validateSchema4 = rule.definition.validateSchema; + if (validateSchema4 && self2._opts.validateSchema !== false) { + var valid = validateSchema4(schema9); + if (!valid) { + var message = "keyword schema is invalid: " + self2.errorsText(validateSchema4.errors); + if (self2._opts.validateSchema == "log") + self2.logger.error(message); + else + throw new Error(message); + } + } + var compile2 = rule.definition.compile, inline = rule.definition.inline, macro = rule.definition.macro; + var validate15; + if (compile2) { + validate15 = compile2.call(self2, schema9, parentSchema, it2); + } else if (macro) { + validate15 = macro.call(self2, schema9, parentSchema, it2); + if (opts.validateSchema !== false) + self2.validateSchema(validate15, true); + } else if (inline) { + validate15 = inline.call(self2, it2, rule.keyword, schema9, parentSchema); + } else { + validate15 = rule.definition.validate; + if (!validate15) + return; + } + if (validate15 === void 0) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + var index4 = customRules.length; + customRules[index4] = validate15; + return { + code: "customRule" + index4, + validate: validate15 + }; + } + } + function checkCompiling(schema8, root2, baseId) { + var index4 = compIndex.call(this, schema8, root2, baseId); + if (index4 >= 0) + return { index: index4, compiling: true }; + index4 = this._compilations.length; + this._compilations[index4] = { + schema: schema8, + root: root2, + baseId + }; + return { index: index4, compiling: false }; + } + function endCompiling(schema8, root2, baseId) { + var i7 = compIndex.call(this, schema8, root2, baseId); + if (i7 >= 0) + this._compilations.splice(i7, 1); + } + function compIndex(schema8, root2, baseId) { + for (var i7 = 0; i7 < this._compilations.length; i7++) { + var c7 = this._compilations[i7]; + if (c7.schema == schema8 && c7.root == root2 && c7.baseId == baseId) + return i7; + } + return -1; + } + function patternCode(i7, patterns) { + return "var pattern" + i7 + " = new RegExp(" + util2.toQuotedString(patterns[i7]) + ");"; + } + function defaultCode(i7) { + return "var default" + i7 + " = defaults[" + i7 + "];"; + } + function refValCode(i7, refVal) { + return refVal[i7] === void 0 ? "" : "var refVal" + i7 + " = refVal[" + i7 + "];"; + } + function customRuleCode(i7) { + return "var customRule" + i7 + " = customRules[" + i7 + "];"; + } + function vars(arr, statement) { + if (!arr.length) + return ""; + var code = ""; + for (var i7 = 0; i7 < arr.length; i7++) + code += statement(i7, arr); + return code; + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/cache.js +var require_cache2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/cache.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Cache4 = module5.exports = function Cache5() { + this._cache = {}; + }; + Cache4.prototype.put = function Cache_put(key, value2) { + this._cache[key] = value2; + }; + Cache4.prototype.get = function Cache_get(key) { + return this._cache[key]; + }; + Cache4.prototype.del = function Cache_del(key) { + delete this._cache[key]; + }; + Cache4.prototype.clear = function Cache_clear() { + this._cache = {}; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/formats.js +var require_formats3 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/formats.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = require_util3(); + 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]; + var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; + var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; + var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; + var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; + var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; + var URL2 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; + var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; + var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/; + var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; + var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + module5.exports = formats; + function formats(mode) { + mode = mode == "full" ? "full" : "fast"; + return util2.copy(formats[mode]); + } + formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, + "date-time": /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i, + "uri-reference": /^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, + "uri-template": URITEMPLATE, + url: URL2, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + "json-pointer": JSON_POINTER, + "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + "relative-json-pointer": RELATIVE_JSON_POINTER + }; + formats.full = { + date, + time: time2, + "date-time": date_time, + uri, + "uri-reference": URIREF, + "uri-template": URITEMPLATE, + url: URL2, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: hostname2, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex, + uuid: UUID, + "json-pointer": JSON_POINTER, + "json-pointer-uri-fragment": JSON_POINTER_URI_FRAGMENT, + "relative-json-pointer": RELATIVE_JSON_POINTER + }; + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function date(str2) { + var matches2 = str2.match(DATE); + if (!matches2) + return false; + var year = +matches2[1]; + var month = +matches2[2]; + var day = +matches2[3]; + return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]); + } + function time2(str2, full) { + var matches2 = str2.match(TIME); + if (!matches2) + return false; + var hour = matches2[1]; + var minute = matches2[2]; + var second = matches2[3]; + var timeZone = matches2[5]; + return (hour <= 23 && minute <= 59 && second <= 59 || hour == 23 && minute == 59 && second == 60) && (!full || timeZone); + } + var DATE_TIME_SEPARATOR = /t|\s/i; + function date_time(str2) { + var dateTime = str2.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time2(dateTime[1], true); + } + function hostname2(str2) { + return str2.length <= 255 && HOSTNAME.test(str2); + } + var NOT_URI_FRAGMENT = /\/|:/; + function uri(str2) { + return NOT_URI_FRAGMENT.test(str2) && URI.test(str2); + } + var Z_ANCHOR = /[^\\]\\Z/; + function regex(str2) { + if (Z_ANCHOR.test(str2)) + return false; + try { + new RegExp(str2); + return true; + } catch (e10) { + return false; + } + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/ref.js +var require_ref3 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/ref.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_ref(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $async, $refCode; + if ($schema == "#" || $schema == "#/") { + if (it2.isRoot) { + $async = it2.async; + $refCode = "validate"; + } else { + $async = it2.root.schema.$async === true; + $refCode = "root.refVal[0]"; + } + } else { + var $refVal = it2.resolveRef(it2.baseId, $schema, it2.isRoot); + if ($refVal === void 0) { + var $message = it2.MissingRefError.message(it2.baseId, $schema); + if (it2.opts.missingRefs == "fail") { + it2.logger.error($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '$ref' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { ref: '" + it2.util.escapeQuotes($schema) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'can\\'t resolve reference " + it2.util.escapeQuotes($schema) + "' "; + } + if (it2.opts.verbose) { + out += " , schema: " + it2.util.toQuotedString($schema) + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + if ($breakOnError) { + out += " if (false) { "; + } + } else if (it2.opts.missingRefs == "ignore") { + it2.logger.warn($message); + if ($breakOnError) { + out += " if (true) { "; + } + } else { + throw new it2.MissingRefError(it2.baseId, $schema, $message); + } + } else if ($refVal.inline) { + var $it = it2.util.copy(it2); + $it.level++; + var $nextValid = "valid" + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ""; + $it.errSchemaPath = $schema; + var $code = it2.validate($it).replace(/validate\.schema/g, $refVal.code); + out += " " + $code + " "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + } + } else { + $async = $refVal.$async === true || it2.async && $refVal.$async !== false; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.opts.passContext) { + out += " " + $refCode + ".call(this, "; + } else { + out += " " + $refCode + "( "; + } + out += " " + $data + ", (dataPath || '')"; + if (it2.errorPath != '""') { + out += " + " + it2.errorPath; + } + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " , " + $parentData + " , " + $parentDataProperty + ", rootData) "; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it2.async) + throw new Error("async schema referenced by sync schema"); + if ($breakOnError) { + out += " var " + $valid + "; "; + } + out += " try { await " + __callValidate + "; "; + if ($breakOnError) { + out += " " + $valid + " = true; "; + } + out += " } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; "; + if ($breakOnError) { + out += " " + $valid + " = false; "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $valid + ") { "; + } + } else { + out += " if (!" + __callValidate + ") { if (vErrors === null) vErrors = " + $refCode + ".errors; else vErrors = vErrors.concat(" + $refCode + ".errors); errors = vErrors.length; } "; + if ($breakOnError) { + out += " else { "; + } + } + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/allOf.js +var require_allOf2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/allOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_allOf(it2, $keyword, $ruleType) { + var out = " "; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $currentBaseId = $it.baseId, $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += " if (true) { "; + } else { + out += " " + $closingBraces.slice(0, -1) + " "; + } + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/anyOf.js +var require_anyOf2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/anyOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_anyOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $noEmptySchema = $schema.every(function($sch2) { + return it2.util.schemaHasRules($sch2, it2.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += " var " + $errs + " = errors; var " + $valid + " = false; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " " + $valid + " = " + $valid + " || " + $nextValid + "; if (!" + $valid + ") { "; + $closingBraces += "}"; + } + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $closingBraces + " if (!" + $valid + ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'anyOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should match some schema in anyOf' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; return false; "; + } + } + out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + if (it2.opts.allErrors) { + out += " } "; + } + out = it2.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += " if (true) { "; + } + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/comment.js +var require_comment = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/comment.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_comment(it2, $keyword, $ruleType) { + var out = " "; + var $schema = it2.schema[$keyword]; + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $comment = it2.util.toQuotedString($schema); + if (it2.opts.$comment === true) { + out += " console.log(" + $comment + ");"; + } else if (typeof it2.opts.$comment == "function") { + out += " self._opts.$comment(" + $comment + ", " + it2.util.toQuotedString($errSchemaPath) + ", validate.root.schema);"; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/const.js +var require_const2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/const.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_const(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += " var schema" + $lvl + " = validate.schema" + $schemaPath + ";"; + } + out += "var " + $valid + " = equal(" + $data + ", schema" + $lvl + "); if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'const' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { allowedValue: schema" + $lvl + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be equal to constant' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " }"; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/contains.js +var require_contains2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/contains.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_contains(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it2.baseId, $nonEmptySchema = it2.util.schemaHasRules($schema, it2.RULES.all); + out += "var " + $errs + " = errors;var " + $valid + ";"; + if ($nonEmptySchema) { + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " var " + $nextValid + " = false; for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " if (" + $nextValid + ") break; } "; + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $closingBraces + " if (!" + $nextValid + ") {"; + } else { + out += " if (" + $data + ".length == 0) {"; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'contains' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should contain a valid item' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + if ($nonEmptySchema) { + out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + } + if (it2.opts.allErrors) { + out += " } "; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/dependencies.js +var require_dependencies2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/dependencies.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_dependencies(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it2.opts.ownProperties; + for ($property in $schema) { + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } + out += "var " + $errs + " = errors;"; + var $currentErrorPath = it2.errorPath; + out += "var missing" + $lvl + ";"; + for (var $property in $propertyDeps) { + $deps = $propertyDeps[$property]; + if ($deps.length) { + out += " if ( " + $data + it2.util.getProperty($property) + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($property) + "') "; + } + if ($breakOnError) { + out += " && ( "; + var arr1 = $deps; + if (arr1) { + var $propertyKey, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $propertyKey = arr1[$i += 1]; + if ($i) { + out += " || "; + } + var $prop = it2.util.getProperty($propertyKey), $useData = $data + $prop; + out += " ( ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") && (missing" + $lvl + " = " + it2.util.toQuotedString(it2.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; + } + } + out += ")) { "; + var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.opts.jsonPointers ? it2.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it2.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it2.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should have "; + if ($deps.length == 1) { + out += "property " + it2.util.escapeQuotes($deps[0]); + } else { + out += "properties " + it2.util.escapeQuotes($deps.join(", ")); + } + out += " when property " + it2.util.escapeQuotes($property) + " is present' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } else { + out += " ) { "; + var arr2 = $deps; + if (arr2) { + var $propertyKey, i22 = -1, l22 = arr2.length - 1; + while (i22 < l22) { + $propertyKey = arr2[i22 += 1]; + var $prop = it2.util.getProperty($propertyKey), $missingProperty = it2.util.escapeQuotes($propertyKey), $useData = $data + $prop; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it2.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it2.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should have "; + if ($deps.length == 1) { + out += "property " + it2.util.escapeQuotes($deps[0]); + } else { + out += "properties " + it2.util.escapeQuotes($deps.join(", ")); + } + out += " when property " + it2.util.escapeQuotes($property) + " is present' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; + } + } + } + out += " } "; + if ($breakOnError) { + $closingBraces += "}"; + out += " else { "; + } + } + } + it2.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; + for (var $property in $schemaDeps) { + var $sch = $schemaDeps[$property]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + out += " " + $nextValid + " = true; if ( " + $data + it2.util.getProperty($property) + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($property) + "') "; + } + out += ") { "; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it2.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + "/" + it2.util.escapeFragment($property); + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/enum.js +var require_enum3 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/enum.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_enum(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $i = "i" + $lvl, $vSchema = "schema" + $lvl; + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + ";"; + } + out += "var " + $valid + ";"; + if ($isData) { + out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"; + } + out += "" + $valid + " = false;for (var " + $i + "=0; " + $i + "<" + $vSchema + ".length; " + $i + "++) if (equal(" + $data + ", " + $vSchema + "[" + $i + "])) { " + $valid + " = true; break; }"; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'enum' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { allowedValues: schema" + $lvl + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be equal to one of the allowed values' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " }"; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/format.js +var require_format4 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/format.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_format(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + if (it2.opts.format === false) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it2.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = "format" + $lvl, $isObject = "isObject" + $lvl, $formatType = "formatType" + $lvl; + out += " var " + $format + " = formats[" + $schemaValue + "]; var " + $isObject + " = typeof " + $format + " == 'object' && !(" + $format + " instanceof RegExp) && " + $format + ".validate; var " + $formatType + " = " + $isObject + " && " + $format + ".type || 'string'; if (" + $isObject + ") { "; + if (it2.async) { + out += " var async" + $lvl + " = " + $format + ".async; "; + } + out += " " + $format + " = " + $format + ".validate; } if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "; + } + out += " ("; + if ($unknownFormats != "ignore") { + out += " (" + $schemaValue + " && !" + $format + " "; + if ($allowUnknown) { + out += " && self._opts.unknownFormats.indexOf(" + $schemaValue + ") == -1 "; + } + out += ") || "; + } + out += " (" + $format + " && " + $formatType + " == '" + $ruleType + "' && !(typeof " + $format + " == 'function' ? "; + if (it2.async) { + out += " (async" + $lvl + " ? await " + $format + "(" + $data + ") : " + $format + "(" + $data + ")) "; + } else { + out += " " + $format + "(" + $data + ") "; + } + out += " : " + $format + ".test(" + $data + "))))) {"; + } else { + var $format = it2.formats[$schema]; + if (!$format) { + if ($unknownFormats == "ignore") { + it2.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it2.errSchemaPath + '"'); + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it2.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == "object" && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || "string"; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } + if ($async) { + if (!it2.async) + throw new Error("async format in sync schema"); + var $formatRef = "formats" + it2.util.getProperty($schema) + ".validate"; + out += " if (!(await " + $formatRef + "(" + $data + "))) { "; + } else { + out += " if (! "; + var $formatRef = "formats" + it2.util.getProperty($schema); + if ($isObject) + $formatRef += ".validate"; + if (typeof $format == "function") { + out += " " + $formatRef + "(" + $data + ") "; + } else { + out += " " + $formatRef + ".test(" + $data + ") "; + } + out += ") { "; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'format' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { format: "; + if ($isData) { + out += "" + $schemaValue; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should match format "`; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + it2.util.escapeQuotes($schema); + } + out += `"' `; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/if.js +var require_if2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/if.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_if(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + $it.level++; + var $nextValid = "valid" + $it.level; + var $thenSch = it2.schema["then"], $elseSch = it2.schema["else"], $thenPresent = $thenSch !== void 0 && it2.util.schemaHasRules($thenSch, it2.RULES.all), $elsePresent = $elseSch !== void 0 && it2.util.schemaHasRules($elseSch, it2.RULES.all), $currentBaseId = $it.baseId; + if ($thenPresent || $elsePresent) { + var $ifClause; + $it.createErrors = false; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " var " + $errs + " = errors; var " + $valid + " = true; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + $it.createErrors = true; + out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + it2.compositeRule = $it.compositeRule = $wasComposite; + if ($thenPresent) { + out += " if (" + $nextValid + ") { "; + $it.schema = it2.schema["then"]; + $it.schemaPath = it2.schemaPath + ".then"; + $it.errSchemaPath = it2.errSchemaPath + "/then"; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " " + $valid + " = " + $nextValid + "; "; + if ($thenPresent && $elsePresent) { + $ifClause = "ifClause" + $lvl; + out += " var " + $ifClause + " = 'then'; "; + } else { + $ifClause = "'then'"; + } + out += " } "; + if ($elsePresent) { + out += " else { "; + } + } else { + out += " if (!" + $nextValid + ") { "; + } + if ($elsePresent) { + $it.schema = it2.schema["else"]; + $it.schemaPath = it2.schemaPath + ".else"; + $it.errSchemaPath = it2.errSchemaPath + "/else"; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " " + $valid + " = " + $nextValid + "; "; + if ($thenPresent && $elsePresent) { + $ifClause = "ifClause" + $lvl; + out += " var " + $ifClause + " = 'else'; "; + } else { + $ifClause = "'else'"; + } + out += " } "; + } + out += " if (!" + $valid + ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'if' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { failingKeyword: " + $ifClause + " } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should match "' + ` + $ifClause + ` + '" schema' `; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; return false; "; + } + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + out = it2.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += " if (true) { "; + } + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/items.js +var require_items2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/items.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_items(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it2.baseId; + out += "var " + $errs + " = errors;var " + $valid + ";"; + if (Array.isArray($schema)) { + var $additionalItems = it2.schema.additionalItems; + if ($additionalItems === false) { + out += " " + $valid + " = " + $data + ".length <= " + $schema.length + "; "; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it2.errSchemaPath + "/additionalItems"; + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'additionalItems' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schema.length + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have more than " + $schema.length + " items' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += "}"; + out += " else { "; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + out += " " + $nextValid + " = true; if (" + $data + ".length > " + $i + ") { "; + var $passData = $data + "[" + $i + "]"; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $i, it2.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if (typeof $additionalItems == "object" && it2.util.schemaHasRules($additionalItems, it2.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it2.schemaPath + ".additionalItems"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalItems"; + out += " " + $nextValid + " = true; if (" + $data + ".length > " + $schema.length + ") { for (var " + $idx + " = " + $schema.length + "; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " } } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } else if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " }"; + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limit.js +var require_limit2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limit.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limit(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == "maximum", $exclusiveKeyword = $isMax ? "exclusiveMaximum" : "exclusiveMinimum", $schemaExcl = it2.schema[$exclusiveKeyword], $isDataExcl = it2.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? "<" : ">", $notOp = $isMax ? ">" : "<", $errorKeyword = void 0; + if ($isDataExcl) { + var $schemaValueExcl = it2.util.getData($schemaExcl.$data, $dataLvl, it2.dataPathArr), $exclusive = "exclusive" + $lvl, $exclType = "exclType" + $lvl, $exclIsNumber = "exclIsNumber" + $lvl, $opExpr = "op" + $lvl, $opStr = "' + " + $opExpr + " + '"; + out += " var schemaExcl" + $lvl + " = " + $schemaValueExcl + "; "; + $schemaValueExcl = "schemaExcl" + $lvl; + out += " var " + $exclusive + "; var " + $exclType + " = typeof " + $schemaValueExcl + "; if (" + $exclType + " != 'boolean' && " + $exclType + " != 'undefined' && " + $exclType + " != 'number') { "; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: '" + $exclusiveKeyword + " should be boolean' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $exclType + " == 'number' ? ( (" + $exclusive + " = " + $schemaValue + " === undefined || " + $schemaValueExcl + " " + $op + "= " + $schemaValue + ") ? " + $data + " " + $notOp + "= " + $schemaValueExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) : ( (" + $exclusive + " = " + $schemaValueExcl + " === true) ? " + $data + " " + $notOp + "= " + $schemaValue + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { var op" + $lvl + " = " + $exclusive + " ? '" + $op + "' : '" + $op + "='; "; + if ($schema === void 0) { + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it2.errSchemaPath + "/" + $exclusiveKeyword; + $schemaValue = $schemaValueExcl; + $isData = $isDataExcl; + } + } else { + var $exclIsNumber = typeof $schemaExcl == "number", $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = "'" + $opStr + "'"; + out += " if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " ( " + $schemaValue + " === undefined || " + $schemaExcl + " " + $op + "= " + $schemaValue + " ? " + $data + " " + $notOp + "= " + $schemaExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { "; + } else { + if ($exclIsNumber && $schema === void 0) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it2.errSchemaPath + "/" + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += "="; + } else { + if ($exclIsNumber) + $schemaValue = Math[$isMax ? "min" : "max"]($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it2.errSchemaPath + "/" + $exclusiveKeyword; + $notOp += "="; + } else { + $exclusive = false; + $opStr += "="; + } + } + var $opExpr = "'" + $opStr + "'"; + out += " if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $data + " " + $notOp + " " + $schemaValue + " || " + $data + " !== " + $data + ") { "; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limit") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { comparison: " + $opExpr + ", limit: " + $schemaValue + ", exclusive: " + $exclusive + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be " + $opStr + " "; + if ($isData) { + out += "' + " + $schemaValue; + } else { + out += "" + $schemaValue + "'"; + } + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitItems.js +var require_limitItems2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitItems.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitItems(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxItems" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $data + ".length " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitItems") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have "; + if ($keyword == "maxItems") { + out += "more"; + } else { + out += "less"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " items' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitLength.js +var require_limitLength2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitLength.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitLength(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxLength" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + if (it2.opts.unicode === false) { + out += " " + $data + ".length "; + } else { + out += " ucs2length(" + $data + ") "; + } + out += " " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitLength") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be "; + if ($keyword == "maxLength") { + out += "longer"; + } else { + out += "shorter"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " characters' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitProperties.js +var require_limitProperties2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/_limitProperties.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitProperties(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxProperties" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " Object.keys(" + $data + ").length " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitProperties") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have "; + if ($keyword == "maxProperties") { + out += "more"; + } else { + out += "less"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " properties' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/multipleOf.js +var require_multipleOf2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/multipleOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_multipleOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + out += "var division" + $lvl + ";if ("; + if ($isData) { + out += " " + $schemaValue + " !== undefined && ( typeof " + $schemaValue + " != 'number' || "; + } + out += " (division" + $lvl + " = " + $data + " / " + $schemaValue + ", "; + if (it2.opts.multipleOfPrecision) { + out += " Math.abs(Math.round(division" + $lvl + ") - division" + $lvl + ") > 1e-" + it2.opts.multipleOfPrecision + " "; + } else { + out += " division" + $lvl + " !== parseInt(division" + $lvl + ") "; + } + out += " ) "; + if ($isData) { + out += " ) "; + } + out += " ) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'multipleOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { multipleOf: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be multiple of "; + if ($isData) { + out += "' + " + $schemaValue; + } else { + out += "" + $schemaValue + "'"; + } + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/not.js +var require_not2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/not.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_not(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + $it.level++; + var $nextValid = "valid" + $it.level; + if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " var " + $errs + " = errors; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += " " + it2.validate($it) + " "; + $it.createErrors = true; + if ($allErrorsOption) + $it.opts.allErrors = $allErrorsOption; + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " if (" + $nextValid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be valid' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + if (it2.opts.allErrors) { + out += " } "; + } + } else { + out += " var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be valid' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if ($breakOnError) { + out += " if (false) { "; + } + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/oneOf.js +var require_oneOf2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/oneOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_oneOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $currentBaseId = $it.baseId, $prevValid = "prevValid" + $lvl, $passingSchemas = "passingSchemas" + $lvl; + out += "var " + $errs + " = errors , " + $prevValid + " = false , " + $valid + " = false , " + $passingSchemas + " = null; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + } else { + out += " var " + $nextValid + " = true; "; + } + if ($i) { + out += " if (" + $nextValid + " && " + $prevValid + ") { " + $valid + " = false; " + $passingSchemas + " = [" + $passingSchemas + ", " + $i + "]; } else { "; + $closingBraces += "}"; + } + out += " if (" + $nextValid + ") { " + $valid + " = " + $prevValid + " = true; " + $passingSchemas + " = " + $i + "; }"; + } + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += "" + $closingBraces + "if (!" + $valid + ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'oneOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { passingSchemas: " + $passingSchemas + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should match exactly one schema in oneOf' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; return false; "; + } + } + out += "} else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; }"; + if (it2.opts.allErrors) { + out += " } "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/pattern.js +var require_pattern4 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/pattern.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_pattern(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? "(new RegExp(" + $schemaValue + "))" : it2.usePattern($schema); + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "; + } + out += " !" + $regexp + ".test(" + $data + ") ) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'pattern' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { pattern: "; + if ($isData) { + out += "" + $schemaValue; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should match pattern "`; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + it2.util.escapeQuotes($schema); + } + out += `"' `; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/properties.js +var require_properties2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/properties.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_properties(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $key = "key" + $lvl, $idx = "idx" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl; + var $schemaKeys = Object.keys($schema || {}), $pProperties = it2.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties), $aProperties = it2.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == "object" && Object.keys($aProperties).length, $removeAdditional = it2.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it2.opts.ownProperties, $currentBaseId = it2.baseId; + var $required = it2.schema.required; + if ($required && !(it2.opts.$data && $required.$data) && $required.length < it2.opts.loopRequired) + var $requiredHash = it2.util.toHash($required); + out += "var " + $errs + " = errors;var " + $nextValid + " = true;"; + if ($ownProperties) { + out += " var " + $dataProperties + " = undefined;"; + } + if ($checkAdditional) { + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + if ($someProperties) { + out += " var isAdditional" + $lvl + " = !(false "; + if ($schemaKeys.length) { + if ($schemaKeys.length > 8) { + out += " || validate.schema" + $schemaPath + ".hasOwnProperty(" + $key + ") "; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += " || " + $key + " == " + it2.util.toQuotedString($propertyKey) + " "; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, l22 = arr2.length - 1; + while ($i < l22) { + $pProperty = arr2[$i += 1]; + out += " || " + it2.usePattern($pProperty) + ".test(" + $key + ") "; + } + } + } + out += " ); if (isAdditional" + $lvl + ") { "; + } + if ($removeAdditional == "all") { + out += " delete " + $data + "[" + $key + "]; "; + } else { + var $currentErrorPath = it2.errorPath; + var $additionalProperty = "' + " + $key + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += " delete " + $data + "[" + $key + "]; "; + } else { + out += " " + $nextValid + " = false; "; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'additionalProperties' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { additionalProperty: '" + $additionalProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is an invalid additional property"; + } else { + out += "should NOT have additional properties"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += " break; "; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == "failing") { + out += " var " + $errs + " = errors; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it2.schemaPath + ".additionalProperties"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + $it.errorPath = it2.opts._errorDataPathProperty ? it2.errorPath : it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " if (!" + $nextValid + ") { errors = " + $errs + "; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete " + $data + "[" + $key + "]; } "; + it2.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it2.schemaPath + ".additionalProperties"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + $it.errorPath = it2.opts._errorDataPathProperty ? it2.errorPath : it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + } + } + it2.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += " } "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + var $useDefaults = it2.opts.useDefaults && !it2.compositeRule; + if ($schemaKeys.length) { + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i32 = -1, l32 = arr3.length - 1; + while (i32 < l32) { + $propertyKey = arr3[i32 += 1]; + var $sch = $schema[$propertyKey]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + var $prop = it2.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== void 0; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + "/" + it2.util.escapeFragment($propertyKey); + $it.errorPath = it2.util.getPath(it2.errorPath, $propertyKey, it2.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it2.util.toQuotedString($propertyKey); + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + $code = it2.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += " var " + $nextData + " = " + $passData + "; "; + } + if ($hasDefault) { + out += " " + $code + " "; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { " + $nextValid + " = false; "; + var $currentErrorPath = it2.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it2.util.escapeQuotes($propertyKey); + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + $errSchemaPath = it2.errSchemaPath + "/required"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + $errSchemaPath = $currErrSchemaPath; + it2.errorPath = $currentErrorPath; + out += " } else { "; + } else { + if ($breakOnError) { + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { " + $nextValid + " = true; } else { "; + } else { + out += " if (" + $useData + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += " ) { "; + } + } + out += " " + $code + " } "; + } + } + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if ($pPropertyKeys.length) { + var arr4 = $pPropertyKeys; + if (arr4) { + var $pProperty, i42 = -1, l42 = arr4.length - 1; + while (i42 < l42) { + $pProperty = arr4[i42 += 1]; + var $sch = $pProperties[$pProperty]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it2.schemaPath + ".patternProperties" + it2.util.getProperty($pProperty); + $it.errSchemaPath = it2.errSchemaPath + "/patternProperties/" + it2.util.escapeFragment($pProperty); + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + out += " if (" + it2.usePattern($pProperty) + ".test(" + $key + ")) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " } "; + if ($breakOnError) { + out += " else " + $nextValid + " = true; "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/propertyNames.js +var require_propertyNames2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/propertyNames.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_propertyNames(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = "key" + $lvl, $idx = "idx" + $lvl, $i = "i" + $lvl, $invalidName = "' + " + $key + " + '", $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl, $ownProperties = it2.opts.ownProperties, $currentBaseId = it2.baseId; + out += " var " + $errs + " = errors; "; + if ($ownProperties) { + out += " var " + $dataProperties + " = undefined; "; + } + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + out += " var startErrs" + $lvl + " = errors; "; + var $passData = $key; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " if (!" + $nextValid + ") { for (var " + $i + "=startErrs" + $lvl + "; " + $i + "= it2.opts.loopRequired, $ownProperties = it2.opts.ownProperties; + if ($breakOnError) { + out += " var missing" + $lvl + "; "; + if ($loopRequired) { + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "; + } + var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr($currentErrorPath, $propertyPath, it2.opts.jsonPointers); + } + out += " var " + $valid + " = true; "; + if ($isData) { + out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"; + } + out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { " + $valid + " = " + $data + "[" + $vSchema + "[" + $i + "]] !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "; + } + out += "; if (!" + $valid + ") break; } "; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + } else { + out += " if ( "; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, l22 = arr2.length - 1; + while ($i < l22) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += " || "; + } + var $prop = it2.util.getProperty($propertyKey), $useData = $data + $prop; + out += " ( ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") && (missing" + $lvl + " = " + it2.util.toQuotedString(it2.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; + } + } + out += ") { "; + var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.opts.jsonPointers ? it2.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "; + } + var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr($currentErrorPath, $propertyPath, it2.opts.jsonPointers); + } + if ($isData) { + out += " if (" + $vSchema + " && !Array.isArray(" + $vSchema + ")) { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + $vSchema + " !== undefined) { "; + } + out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { if (" + $data + "[" + $vSchema + "[" + $i + "]] === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } "; + if ($isData) { + out += " } "; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i32 = -1, l32 = arr3.length - 1; + while (i32 < l32) { + $propertyKey = arr3[i32 += 1]; + var $prop = it2.util.getProperty($propertyKey), $missingProperty = it2.util.escapeQuotes($propertyKey), $useData = $data + $prop; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; + } + } + } + } + it2.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += " if (true) {"; + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/uniqueItems.js +var require_uniqueItems2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/uniqueItems.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_uniqueItems(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it2.opts.uniqueItems !== false) { + if ($isData) { + out += " var " + $valid + "; if (" + $schemaValue + " === false || " + $schemaValue + " === undefined) " + $valid + " = true; else if (typeof " + $schemaValue + " != 'boolean') " + $valid + " = false; else { "; + } + out += " var i = " + $data + ".length , " + $valid + " = true , j; if (i > 1) { "; + var $itemType = it2.schema.items && it2.schema.items.type, $typeIsArray = Array.isArray($itemType); + if (!$itemType || $itemType == "object" || $itemType == "array" || $typeIsArray && ($itemType.indexOf("object") >= 0 || $itemType.indexOf("array") >= 0)) { + out += " outer: for (;i--;) { for (j = i; j--;) { if (equal(" + $data + "[i], " + $data + "[j])) { " + $valid + " = false; break outer; } } } "; + } else { + out += " var itemIndices = {}, item; for (;i--;) { var item = " + $data + "[i]; "; + var $method = "checkDataType" + ($typeIsArray ? "s" : ""); + out += " if (" + it2.util[$method]($itemType, "item", true) + ") continue; "; + if ($typeIsArray) { + out += ` if (typeof item == 'string') item = '"' + item; `; + } + out += " if (typeof itemIndices[item] == 'number') { " + $valid + " = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "; + } + out += " } "; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'uniqueItems' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { i: i, j: j } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + } else { + if ($breakOnError) { + out += " if (true) { "; + } + } + return out; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/index.js +var require_dotjs = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + "$ref": require_ref3(), + allOf: require_allOf2(), + anyOf: require_anyOf2(), + "$comment": require_comment(), + const: require_const2(), + contains: require_contains2(), + dependencies: require_dependencies2(), + "enum": require_enum3(), + format: require_format4(), + "if": require_if2(), + items: require_items2(), + maximum: require_limit2(), + minimum: require_limit2(), + maxItems: require_limitItems2(), + minItems: require_limitItems2(), + maxLength: require_limitLength2(), + minLength: require_limitLength2(), + maxProperties: require_limitProperties2(), + minProperties: require_limitProperties2(), + multipleOf: require_multipleOf2(), + not: require_not2(), + oneOf: require_oneOf2(), + pattern: require_pattern4(), + properties: require_properties2(), + propertyNames: require_propertyNames2(), + required: require_required3(), + uniqueItems: require_uniqueItems2(), + validate: require_validate2() + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/rules.js +var require_rules3 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/rules.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ruleModules = require_dotjs(); + var toHash = require_util3().toHash; + module5.exports = function rules() { + var RULES = [ + { + type: "number", + rules: [ + { "maximum": ["exclusiveMaximum"] }, + { "minimum": ["exclusiveMinimum"] }, + "multipleOf", + "format" + ] + }, + { + type: "string", + rules: ["maxLength", "minLength", "pattern", "format"] + }, + { + type: "array", + rules: ["maxItems", "minItems", "items", "contains", "uniqueItems"] + }, + { + type: "object", + rules: [ + "maxProperties", + "minProperties", + "required", + "dependencies", + "propertyNames", + { "properties": ["additionalProperties", "patternProperties"] } + ] + }, + { rules: ["$ref", "const", "enum", "not", "anyOf", "oneOf", "allOf", "if"] } + ]; + var ALL = ["type", "$comment"]; + var KEYWORDS = [ + "$schema", + "$id", + "id", + "$data", + "title", + "description", + "default", + "definitions", + "examples", + "readOnly", + "writeOnly", + "contentMediaType", + "contentEncoding", + "additionalItems", + "then", + "else" + ]; + var TYPES2 = ["number", "integer", "string", "array", "object", "boolean", "null"]; + RULES.all = toHash(ALL); + RULES.types = toHash(TYPES2); + RULES.forEach(function(group2) { + group2.rules = group2.rules.map(function(keyword) { + var implKeywords; + if (typeof keyword == "object") { + var key = Object.keys(keyword)[0]; + implKeywords = keyword[key]; + keyword = key; + implKeywords.forEach(function(k6) { + ALL.push(k6); + RULES.all[k6] = true; + }); + } + ALL.push(keyword); + var rule = RULES.all[keyword] = { + keyword, + code: ruleModules[keyword], + implements: implKeywords + }; + return rule; + }); + RULES.all.$comment = { + keyword: "$comment", + code: ruleModules.$comment + }; + if (group2.type) + RULES.types[group2.type] = group2; + }); + RULES.keywords = toHash(ALL.concat(KEYWORDS)); + RULES.custom = {}; + return RULES; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/data.js +var require_data2 = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/data.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var KEYWORDS = [ + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "additionalItems", + "maxItems", + "minItems", + "uniqueItems", + "maxProperties", + "minProperties", + "required", + "additionalProperties", + "enum", + "format", + "const" + ]; + module5.exports = function(metaSchema, keywordsJsonPointers) { + for (var i7 = 0; i7 < keywordsJsonPointers.length; i7++) { + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + var segments = keywordsJsonPointers[i7].split("/"); + var keywords = metaSchema; + var j6; + for (j6 = 1; j6 < segments.length; j6++) + keywords = keywords[segments[j6]]; + for (j6 = 0; j6 < KEYWORDS.length; j6++) { + var key = KEYWORDS[j6]; + var schema8 = keywords[key]; + if (schema8) { + keywords[key] = { + anyOf: [ + schema8, + { $ref: "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/data.json#" } + ] + }; + } + } + } + return metaSchema; + }; + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/compile/async.js +var require_async = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/compile/async.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var MissingRefError = require_error_classes().MissingRef; + module5.exports = compileAsync; + function compileAsync(schema8, meta, callback) { + var self2 = this; + if (typeof this._opts.loadSchema != "function") + throw new Error("options.loadSchema should be a function"); + if (typeof meta == "function") { + callback = meta; + meta = void 0; + } + var p7 = loadMetaSchemaOf(schema8).then(function() { + var schemaObj = self2._addSchema(schema8, void 0, meta); + return schemaObj.validate || _compileAsync(schemaObj); + }); + if (callback) { + p7.then( + function(v8) { + callback(null, v8); + }, + callback + ); + } + return p7; + function loadMetaSchemaOf(sch) { + var $schema = sch.$schema; + return $schema && !self2.getSchema($schema) ? compileAsync.call(self2, { $ref: $schema }, true) : Promise.resolve(); + } + function _compileAsync(schemaObj) { + try { + return self2._compile(schemaObj); + } catch (e10) { + if (e10 instanceof MissingRefError) + return loadMissingSchema(e10); + throw e10; + } + function loadMissingSchema(e10) { + var ref = e10.missingSchema; + if (added(ref)) + throw new Error("Schema " + ref + " is loaded but " + e10.missingRef + " cannot be resolved"); + var schemaPromise = self2._loadingSchemas[ref]; + if (!schemaPromise) { + schemaPromise = self2._loadingSchemas[ref] = self2._opts.loadSchema(ref); + schemaPromise.then(removePromise, removePromise); + } + return schemaPromise.then(function(sch) { + if (!added(ref)) { + return loadMetaSchemaOf(sch).then(function() { + if (!added(ref)) + self2.addSchema(sch, ref, void 0, meta); + }); + } + }).then(function() { + return _compileAsync(schemaObj); + }); + function removePromise() { + delete self2._loadingSchemas[ref]; + } + function added(ref2) { + return self2._refs[ref2] || self2._schemas[ref2]; + } + } + } + } + } +}); + +// node_modules/webapi-parser/node_modules/ajv/lib/dotjs/custom.js +var require_custom = __commonJS({ + "node_modules/webapi-parser/node_modules/ajv/lib/dotjs/custom.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_custom(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, $definition = "definition" + $lvl, $rDef = $rule.definition, $closingBraces = ""; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = "keywordValidate" + $lvl; + var $validateSchema = $rDef.validateSchema; + out += " var " + $definition + " = RULES.custom['" + $keyword + "'].definition; var " + $validateCode + " = " + $definition + ".validate;"; + } else { + $ruleValidate = it2.useCustomRule($rule, $schema, it2.schema, it2); + if (!$ruleValidate) + return; + $schemaValue = "validate.schema" + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + ".errors", $i = "i" + $lvl, $ruleErr = "ruleErr" + $lvl, $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it2.async) + throw new Error("async keyword in sync schema"); + if (!($inline || $macro)) { + out += "" + $ruleErrs + " = null;"; + } + out += "var " + $errs + " = errors;var " + $valid + ";"; + if ($isData && $rDef.$data) { + $closingBraces += "}"; + out += " if (" + $schemaValue + " === undefined) { " + $valid + " = true; } else { "; + if ($validateSchema) { + $closingBraces += "}"; + out += " " + $valid + " = " + $definition + ".validateSchema(" + $schemaValue + "); if (" + $valid + ") { "; + } + } + if ($inline) { + if ($rDef.statements) { + out += " " + $ruleValidate.validate + " "; + } else { + out += " " + $valid + " = " + $ruleValidate.validate + "; "; + } + } else if ($macro) { + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ""; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var $code = it2.validate($it).replace(/validate\.schema/g, $validateCode); + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $code; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + out += " " + $validateCode + ".call( "; + if (it2.opts.passContext) { + out += "this"; + } else { + out += "self"; + } + if ($compile || $rDef.schema === false) { + out += " , " + $data + " "; + } else { + out += " , " + $schemaValue + " , " + $data + " , validate.schema" + it2.schemaPath + " "; + } + out += " , (dataPath || '')"; + if (it2.errorPath != '""') { + out += " + " + it2.errorPath; + } + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " , " + $parentData + " , " + $parentDataProperty + " , rootData ) "; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += " " + $valid + " = "; + if ($asyncKeyword) { + out += "await "; + } + out += "" + def_callRuleValidate + "; "; + } else { + if ($asyncKeyword) { + $ruleErrs = "customErrors" + $lvl; + out += " var " + $ruleErrs + " = null; try { " + $valid + " = await " + def_callRuleValidate + "; } catch (e) { " + $valid + " = false; if (e instanceof ValidationError) " + $ruleErrs + " = e.errors; else throw e; } "; + } else { + out += " " + $ruleErrs + " = null; " + $valid + " = " + def_callRuleValidate + "; "; + } + } + } + if ($rDef.modifying) { + out += " if (" + $parentData + ") " + $data + " = " + $parentData + "[" + $parentDataProperty + "];"; + } + out += "" + $closingBraces; + if ($rDef.valid) { + if ($breakOnError) { + out += " if (true) { "; + } + } else { + out += " if ( "; + if ($rDef.valid === void 0) { + out += " !"; + if ($macro) { + out += "" + $nextValid; + } else { + out += "" + $valid; + } + } else { + out += " " + !$rDef.valid + " "; + } + out += ") { "; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "custom") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { keyword: '" + $rule.keyword + "' } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should pass "` + $rule.keyword + `" keyword validation' `; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != "full") { + out += " for (var " + $i + "=" + $errs + "; " + $i + " EOL, + arch: () => arch3, + constants: () => constants3, + cpus: () => cpus, + default: () => exports22, + endianness: () => endianness, + freemem: () => freemem, + getNetworkInterfaces: () => getNetworkInterfaces, + homedir: () => homedir, + hostname: () => hostname, + loadavg: () => loadavg, + networkInterfaces: () => networkInterfaces, + platform: () => platform3, + release: () => release3, + tmpDir: () => tmpDir, + tmpdir: () => tmpdir, + totalmem: () => totalmem, + type: () => type2, + uptime: () => uptime, + version: () => version4 +}); +function dew19() { + if (_dewExec19) + return exports$115; + _dewExec19 = true; + exports$115.endianness = function() { + return "LE"; + }; + exports$115.hostname = function() { + if (typeof location !== "undefined") { + return location.hostname; + } else + return ""; + }; + exports$115.loadavg = function() { + return []; + }; + exports$115.uptime = function() { + return 0; + }; + exports$115.freemem = function() { + return Number.MAX_VALUE; + }; + exports$115.totalmem = function() { + return Number.MAX_VALUE; + }; + exports$115.cpus = function() { + return []; + }; + exports$115.type = function() { + return "Browser"; + }; + exports$115.release = function() { + if (typeof navigator !== "undefined") { + return navigator.appVersion; + } + return ""; + }; + exports$115.networkInterfaces = exports$115.getNetworkInterfaces = function() { + return {}; + }; + exports$115.arch = function() { + return "javascript"; + }; + exports$115.platform = function() { + return "browser"; + }; + exports$115.tmpdir = exports$115.tmpDir = function() { + return "/tmp"; + }; + exports$115.EOL = "\n"; + exports$115.homedir = function() { + return "/"; + }; + return exports$115; +} +var exports$115, _dewExec19, exports22, _endianness, version4, constants3, EOL, arch3, cpus, endianness, freemem, getNetworkInterfaces, homedir, hostname, loadavg, networkInterfaces, platform3, release3, tmpDir, tmpdir, totalmem, type2; +var init_os = __esm({ + "node_modules/@jspm/core/nodelibs/browser/os.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_process(); + exports$115 = {}; + _dewExec19 = false; + exports22 = dew19(); + exports22["endianness"]; + exports22["hostname"]; + exports22["loadavg"]; + exports22["uptime"]; + exports22["freemem"]; + exports22["totalmem"]; + exports22["cpus"]; + exports22["type"]; + exports22["release"]; + exports22["networkInterfaces"]; + exports22["getNetworkInterfaces"]; + exports22["arch"]; + exports22["platform"]; + exports22["tmpdir"]; + exports22["tmpDir"]; + exports22["EOL"]; + exports22["homedir"]; + _endianness = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1 ? "LE" : "BE"; + exports22.endianness = function() { + return _endianness; + }; + exports22.homedir = function() { + return "/home"; + }; + exports22.version = function() { + return ""; + }; + exports22.arch = function() { + return "x64"; + }; + exports22.totalmem = function() { + return navigator.deviceMemory !== void 0 ? navigator.deviceMemory * (1 << 30) : 2 * (1 << 30); + }; + exports22.cpus = function() { + return Array(navigator.hardwareConcurrency || 0).fill({ model: "", times: {} }); + }; + exports22.uptime = uptime; + exports22.constants = {}; + version4 = exports22.version; + constants3 = exports22.constants; + EOL = exports22.EOL; + arch3 = exports22.arch; + cpus = exports22.cpus; + endianness = exports22.endianness; + freemem = exports22.freemem; + getNetworkInterfaces = exports22.getNetworkInterfaces; + homedir = exports22.homedir; + hostname = exports22.hostname; + loadavg = exports22.loadavg; + networkInterfaces = exports22.networkInterfaces; + platform3 = exports22.platform; + release3 = exports22.release; + tmpDir = exports22.tmpDir; + tmpdir = exports22.tmpdir; + totalmem = exports22.totalmem; + type2 = exports22.type; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/chunk-DHWh-hmB.js +function dew$113() { + if (_dewExec$113) + return exports$116; + _dewExec$113 = true; + var process$1 = process4; + function assertPath(path2) { + if (typeof path2 !== "string") { + throw new TypeError("Path must be a string. Received " + JSON.stringify(path2)); + } + } + function normalizeStringPosix(path2, allowAboveRoot) { + var res = ""; + var lastSegmentLength = 0; + var lastSlash = -1; + var dots = 0; + var code; + for (var i7 = 0; i7 <= path2.length; ++i7) { + if (i7 < path2.length) + code = path2.charCodeAt(i7); + else if (code === 47) + break; + else + code = 47; + if (code === 47) { + if (lastSlash === i7 - 1 || dots === 1) + ; + else if (lastSlash !== i7 - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { + if (res.length > 2) { + var lastSlashIndex = res.lastIndexOf("/"); + if (lastSlashIndex !== res.length - 1) { + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); + } + lastSlash = i7; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i7; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += "/.."; + else + res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) + res += "/" + path2.slice(lastSlash + 1, i7); + else + res = path2.slice(lastSlash + 1, i7); + lastSegmentLength = i7 - lastSlash - 1; + } + lastSlash = i7; + dots = 0; + } else if (code === 46 && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; + } + function _format(sep2, pathObject) { + var dir2 = pathObject.dir || pathObject.root; + var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || ""); + if (!dir2) { + return base; + } + if (dir2 === pathObject.root) { + return dir2 + base; + } + return dir2 + sep2 + base; + } + var posix2 = { + // path.resolve([from ...], to) + resolve: function resolve3() { + var resolvedPath = ""; + var resolvedAbsolute = false; + var cwd3; + for (var i7 = arguments.length - 1; i7 >= -1 && !resolvedAbsolute; i7--) { + var path2; + if (i7 >= 0) + path2 = arguments[i7]; + else { + if (cwd3 === void 0) + cwd3 = process$1.cwd(); + path2 = cwd3; + } + assertPath(path2); + if (path2.length === 0) { + continue; + } + resolvedPath = path2 + "/" + resolvedPath; + resolvedAbsolute = path2.charCodeAt(0) === 47; + } + resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) + return "/" + resolvedPath; + else + return "/"; + } else if (resolvedPath.length > 0) { + return resolvedPath; + } else { + return "."; + } + }, + normalize: function normalize2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var isAbsolute2 = path2.charCodeAt(0) === 47; + var trailingSeparator = path2.charCodeAt(path2.length - 1) === 47; + path2 = normalizeStringPosix(path2, !isAbsolute2); + if (path2.length === 0 && !isAbsolute2) + path2 = "."; + if (path2.length > 0 && trailingSeparator) + path2 += "/"; + if (isAbsolute2) + return "/" + path2; + return path2; + }, + isAbsolute: function isAbsolute2(path2) { + assertPath(path2); + return path2.length > 0 && path2.charCodeAt(0) === 47; + }, + join: function join3() { + if (arguments.length === 0) + return "."; + var joined; + for (var i7 = 0; i7 < arguments.length; ++i7) { + var arg = arguments[i7]; + assertPath(arg); + if (arg.length > 0) { + if (joined === void 0) + joined = arg; + else + joined += "/" + arg; + } + } + if (joined === void 0) + return "."; + return posix2.normalize(joined); + }, + relative: function relative2(from, to) { + assertPath(from); + assertPath(to); + if (from === to) + return ""; + from = posix2.resolve(from); + to = posix2.resolve(to); + if (from === to) + return ""; + var fromStart = 1; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 47) + break; + } + var fromEnd = from.length; + var fromLen = fromEnd - fromStart; + var toStart = 1; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 47) + break; + } + var toEnd = to.length; + var toLen = toEnd - toStart; + var length = fromLen < toLen ? fromLen : toLen; + var lastCommonSep = -1; + var i7 = 0; + for (; i7 <= length; ++i7) { + if (i7 === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i7) === 47) { + return to.slice(toStart + i7 + 1); + } else if (i7 === 0) { + return to.slice(toStart + i7); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i7) === 47) { + lastCommonSep = i7; + } else if (i7 === 0) { + lastCommonSep = 0; + } + } + break; + } + var fromCode = from.charCodeAt(fromStart + i7); + var toCode = to.charCodeAt(toStart + i7); + if (fromCode !== toCode) + break; + else if (fromCode === 47) + lastCommonSep = i7; + } + var out = ""; + for (i7 = fromStart + lastCommonSep + 1; i7 <= fromEnd; ++i7) { + if (i7 === fromEnd || from.charCodeAt(i7) === 47) { + if (out.length === 0) + out += ".."; + else + out += "/.."; + } + } + if (out.length > 0) + return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (to.charCodeAt(toStart) === 47) + ++toStart; + return to.slice(toStart); + } + }, + _makeLong: function _makeLong2(path2) { + return path2; + }, + dirname: function dirname2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var code = path2.charCodeAt(0); + var hasRoot = code === 47; + var end = -1; + var matchedSlash = true; + for (var i7 = path2.length - 1; i7 >= 1; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + end = i7; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) + return hasRoot ? "/" : "."; + if (hasRoot && end === 1) + return "//"; + return path2.slice(0, end); + }, + basename: function basename2(path2, ext) { + if (ext !== void 0 && typeof ext !== "string") + throw new TypeError('"ext" argument must be a string'); + assertPath(path2); + var start = 0; + var end = -1; + var matchedSlash = true; + var i7; + if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) { + if (ext.length === path2.length && ext === path2) + return ""; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i7 + 1; + } + if (extIdx >= 0) { + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i7; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start === end) + end = firstNonSlashEnd; + else if (end === -1) + end = path2.length; + return path2.slice(start, end); + } else { + for (i7 = path2.length - 1; i7 >= 0; --i7) { + if (path2.charCodeAt(i7) === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + } + if (end === -1) + return ""; + return path2.slice(start, end); + } + }, + extname: function extname2(path2) { + assertPath(path2); + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var preDotState = 0; + for (var i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path2.slice(startDot, end); + }, + format: function format5(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject); + } + return _format("/", pathObject); + }, + parse: function parse17(path2) { + assertPath(path2); + var ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + if (path2.length === 0) + return ret; + var code = path2.charCodeAt(0); + var isAbsolute2 = code === 47; + var start; + if (isAbsolute2) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i7 = path2.length - 1; + var preDotState = 0; + for (; i7 >= start; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute2) + ret.base = ret.name = path2.slice(1, end); + else + ret.base = ret.name = path2.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute2) { + ret.name = path2.slice(1, startDot); + ret.base = path2.slice(1, end); + } else { + ret.name = path2.slice(startPart, startDot); + ret.base = path2.slice(startPart, end); + } + ret.ext = path2.slice(startDot, end); + } + if (startPart > 0) + ret.dir = path2.slice(0, startPart - 1); + else if (isAbsolute2) + ret.dir = "/"; + return ret; + }, + sep: "/", + delimiter: ":", + win32: null, + posix: null + }; + posix2.posix = posix2; + exports$116 = posix2; + return exports$116; +} +function i$15(t8) { + throw new RangeError(r$24[t8]); +} +function f$15(t8, o7) { + const n7 = t8.split("@"); + let r8 = ""; + n7.length > 1 && (r8 = n7[0] + "@", t8 = n7[1]); + const c7 = function(t9, o8) { + const n8 = []; + let e10 = t9.length; + for (; e10--; ) + n8[e10] = o8(t9[e10]); + return n8; + }((t8 = t8.replace(e$24, ".")).split("."), o7).join("."); + return r8 + c7; +} +function l$15(t8) { + const o7 = []; + let n7 = 0; + const e10 = t8.length; + for (; n7 < e10; ) { + const r8 = t8.charCodeAt(n7++); + if (r8 >= 55296 && r8 <= 56319 && n7 < e10) { + const e11 = t8.charCodeAt(n7++); + 56320 == (64512 & e11) ? o7.push(((1023 & r8) << 10) + (1023 & e11) + 65536) : (o7.push(r8), n7--); + } else + o7.push(r8); + } + return o7; +} +function e$15(e10, n7) { + return Object.prototype.hasOwnProperty.call(e10, n7); +} +function r7() { + this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null; +} +function O6(t8, s7, h8) { + if (t8 && a6.isObject(t8) && t8 instanceof r7) + return t8; + var e10 = new r7(); + return e10.parse(t8, s7, h8), e10; +} +function dew20() { + if (_dewExec20) + return exports23; + _dewExec20 = true; + var process5 = T$1; + function assertPath(path2) { + if (typeof path2 !== "string") { + throw new TypeError("Path must be a string. Received " + JSON.stringify(path2)); + } + } + function normalizeStringPosix(path2, allowAboveRoot) { + var res = ""; + var lastSegmentLength = 0; + var lastSlash = -1; + var dots = 0; + var code; + for (var i7 = 0; i7 <= path2.length; ++i7) { + if (i7 < path2.length) + code = path2.charCodeAt(i7); + else if (code === 47) + break; + else + code = 47; + if (code === 47) { + if (lastSlash === i7 - 1 || dots === 1) + ; + else if (lastSlash !== i7 - 1 && dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) { + if (res.length > 2) { + var lastSlashIndex = res.lastIndexOf("/"); + if (lastSlashIndex !== res.length - 1) { + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); + } + lastSlash = i7; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ""; + lastSegmentLength = 0; + lastSlash = i7; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += "/.."; + else + res = ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) + res += "/" + path2.slice(lastSlash + 1, i7); + else + res = path2.slice(lastSlash + 1, i7); + lastSegmentLength = i7 - lastSlash - 1; + } + lastSlash = i7; + dots = 0; + } else if (code === 46 && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; + } + function _format(sep2, pathObject) { + var dir2 = pathObject.dir || pathObject.root; + var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || ""); + if (!dir2) { + return base; + } + if (dir2 === pathObject.root) { + return dir2 + base; + } + return dir2 + sep2 + base; + } + var posix2 = { + // path.resolve([from ...], to) + resolve: function resolve3() { + var resolvedPath = ""; + var resolvedAbsolute = false; + var cwd3; + for (var i7 = arguments.length - 1; i7 >= -1 && !resolvedAbsolute; i7--) { + var path2; + if (i7 >= 0) + path2 = arguments[i7]; + else { + if (cwd3 === void 0) + cwd3 = process5.cwd(); + path2 = cwd3; + } + assertPath(path2); + if (path2.length === 0) { + continue; + } + resolvedPath = path2 + "/" + resolvedPath; + resolvedAbsolute = path2.charCodeAt(0) === 47; + } + resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) + return "/" + resolvedPath; + else + return "/"; + } else if (resolvedPath.length > 0) { + return resolvedPath; + } else { + return "."; + } + }, + normalize: function normalize2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var isAbsolute2 = path2.charCodeAt(0) === 47; + var trailingSeparator = path2.charCodeAt(path2.length - 1) === 47; + path2 = normalizeStringPosix(path2, !isAbsolute2); + if (path2.length === 0 && !isAbsolute2) + path2 = "."; + if (path2.length > 0 && trailingSeparator) + path2 += "/"; + if (isAbsolute2) + return "/" + path2; + return path2; + }, + isAbsolute: function isAbsolute2(path2) { + assertPath(path2); + return path2.length > 0 && path2.charCodeAt(0) === 47; + }, + join: function join3() { + if (arguments.length === 0) + return "."; + var joined; + for (var i7 = 0; i7 < arguments.length; ++i7) { + var arg = arguments[i7]; + assertPath(arg); + if (arg.length > 0) { + if (joined === void 0) + joined = arg; + else + joined += "/" + arg; + } + } + if (joined === void 0) + return "."; + return posix2.normalize(joined); + }, + relative: function relative2(from, to) { + assertPath(from); + assertPath(to); + if (from === to) + return ""; + from = posix2.resolve(from); + to = posix2.resolve(to); + if (from === to) + return ""; + var fromStart = 1; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 47) + break; + } + var fromEnd = from.length; + var fromLen = fromEnd - fromStart; + var toStart = 1; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 47) + break; + } + var toEnd = to.length; + var toLen = toEnd - toStart; + var length = fromLen < toLen ? fromLen : toLen; + var lastCommonSep = -1; + var i7 = 0; + for (; i7 <= length; ++i7) { + if (i7 === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i7) === 47) { + return to.slice(toStart + i7 + 1); + } else if (i7 === 0) { + return to.slice(toStart + i7); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i7) === 47) { + lastCommonSep = i7; + } else if (i7 === 0) { + lastCommonSep = 0; + } + } + break; + } + var fromCode = from.charCodeAt(fromStart + i7); + var toCode = to.charCodeAt(toStart + i7); + if (fromCode !== toCode) + break; + else if (fromCode === 47) + lastCommonSep = i7; + } + var out = ""; + for (i7 = fromStart + lastCommonSep + 1; i7 <= fromEnd; ++i7) { + if (i7 === fromEnd || from.charCodeAt(i7) === 47) { + if (out.length === 0) + out += ".."; + else + out += "/.."; + } + } + if (out.length > 0) + return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (to.charCodeAt(toStart) === 47) + ++toStart; + return to.slice(toStart); + } + }, + _makeLong: function _makeLong2(path2) { + return path2; + }, + dirname: function dirname2(path2) { + assertPath(path2); + if (path2.length === 0) + return "."; + var code = path2.charCodeAt(0); + var hasRoot = code === 47; + var end = -1; + var matchedSlash = true; + for (var i7 = path2.length - 1; i7 >= 1; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + end = i7; + break; + } + } else { + matchedSlash = false; + } + } + if (end === -1) + return hasRoot ? "/" : "."; + if (hasRoot && end === 1) + return "//"; + return path2.slice(0, end); + }, + basename: function basename2(path2, ext) { + if (ext !== void 0 && typeof ext !== "string") + throw new TypeError('"ext" argument must be a string'); + assertPath(path2); + var start = 0; + var end = -1; + var matchedSlash = true; + var i7; + if (ext !== void 0 && ext.length > 0 && ext.length <= path2.length) { + if (ext.length === path2.length && ext === path2) + return ""; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + matchedSlash = false; + firstNonSlashEnd = i7 + 1; + } + if (extIdx >= 0) { + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + end = i7; + } + } else { + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } + if (start === end) + end = firstNonSlashEnd; + else if (end === -1) + end = path2.length; + return path2.slice(start, end); + } else { + for (i7 = path2.length - 1; i7 >= 0; --i7) { + if (path2.charCodeAt(i7) === 47) { + if (!matchedSlash) { + start = i7 + 1; + break; + } + } else if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + } + if (end === -1) + return ""; + return path2.slice(start, end); + } + }, + extname: function extname2(path2) { + assertPath(path2); + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var preDotState = 0; + for (var i7 = path2.length - 1; i7 >= 0; --i7) { + var code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + return ""; + } + return path2.slice(startDot, end); + }, + format: function format5(pathObject) { + if (pathObject === null || typeof pathObject !== "object") { + throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject); + } + return _format("/", pathObject); + }, + parse: function parse17(path2) { + assertPath(path2); + var ret = { + root: "", + dir: "", + base: "", + ext: "", + name: "" + }; + if (path2.length === 0) + return ret; + var code = path2.charCodeAt(0); + var isAbsolute2 = code === 47; + var start; + if (isAbsolute2) { + ret.root = "/"; + start = 1; + } else { + start = 0; + } + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i7 = path2.length - 1; + var preDotState = 0; + for (; i7 >= start; --i7) { + code = path2.charCodeAt(i7); + if (code === 47) { + if (!matchedSlash) { + startPart = i7 + 1; + break; + } + continue; + } + if (end === -1) { + matchedSlash = false; + end = i7 + 1; + } + if (code === 46) { + if (startDot === -1) + startDot = i7; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + preDotState = -1; + } + } + if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot + preDotState === 0 || // The (right-most) trimmed path component is exactly '..' + preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) { + if (end !== -1) { + if (startPart === 0 && isAbsolute2) + ret.base = ret.name = path2.slice(1, end); + else + ret.base = ret.name = path2.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute2) { + ret.name = path2.slice(1, startDot); + ret.base = path2.slice(1, end); + } else { + ret.name = path2.slice(startPart, startDot); + ret.base = path2.slice(startPart, end); + } + ret.ext = path2.slice(startDot, end); + } + if (startPart > 0) + ret.dir = path2.slice(0, startPart - 1); + else if (isAbsolute2) + ret.dir = "/"; + return ret; + }, + sep: "/", + delimiter: ":", + win32: null, + posix: null + }; + posix2.posix = posix2; + exports23 = posix2; + return exports23; +} +function fileURLToPath$1(path2) { + if (typeof path2 === "string") + path2 = new URL(path2); + else if (!(path2 instanceof URL)) { + throw new Deno.errors.InvalidData( + "invalid argument path , must be a string or URL" + ); + } + if (path2.protocol !== "file:") { + throw new Deno.errors.InvalidData("invalid url scheme"); + } + return isWindows$1 ? getPathFromURLWin$1(path2) : getPathFromURLPosix$1(path2); +} +function getPathFromURLWin$1(url) { + const hostname2 = url.hostname; + let pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102 || // 2f 2F / + pathname[n7 + 1] === "5" && third === 99) { + throw new Deno.errors.InvalidData( + "must not include encoded \\ or / characters" + ); + } + } + } + pathname = pathname.replace(forwardSlashRegEx$1, "\\"); + pathname = decodeURIComponent(pathname); + if (hostname2 !== "") { + return `\\\\${hostname2}${pathname}`; + } else { + const letter = pathname.codePointAt(1) | 32; + const sep2 = pathname[2]; + if (letter < CHAR_LOWERCASE_A$1 || letter > CHAR_LOWERCASE_Z$1 || // a..z A..Z + sep2 !== ":") { + throw new Deno.errors.InvalidData("file url path must be absolute"); + } + return pathname.slice(1); + } +} +function getPathFromURLPosix$1(url) { + if (url.hostname !== "") { + throw new Deno.errors.InvalidData("invalid file url hostname"); + } + const pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102) { + throw new Deno.errors.InvalidData( + "must not include encoded / characters" + ); + } + } + } + return decodeURIComponent(pathname); +} +function pathToFileURL$1(filepath) { + let resolved = path.resolve(filepath); + const filePathLast = filepath.charCodeAt(filepath.length - 1); + if ((filePathLast === CHAR_FORWARD_SLASH$1 || isWindows$1 && filePathLast === CHAR_BACKWARD_SLASH$1) && resolved[resolved.length - 1] !== path.sep) { + resolved += "/"; + } + const outURL = new URL("file://"); + if (resolved.includes("%")) + resolved = resolved.replace(percentRegEx$1, "%25"); + if (!isWindows$1 && resolved.includes("\\")) { + resolved = resolved.replace(backslashRegEx$1, "%5C"); + } + if (resolved.includes("\n")) + resolved = resolved.replace(newlineRegEx$1, "%0A"); + if (resolved.includes("\r")) { + resolved = resolved.replace(carriageReturnRegEx$1, "%0D"); + } + if (resolved.includes(" ")) + resolved = resolved.replace(tabRegEx$1, "%09"); + outURL.pathname = resolved; + return outURL; +} +function fileURLToPath2(path2) { + if (typeof path2 === "string") + path2 = new URL(path2); + else if (!(path2 instanceof URL)) { + throw new Deno.errors.InvalidData( + "invalid argument path , must be a string or URL" + ); + } + if (path2.protocol !== "file:") { + throw new Deno.errors.InvalidData("invalid url scheme"); + } + return isWindows2 ? getPathFromURLWin2(path2) : getPathFromURLPosix2(path2); +} +function getPathFromURLWin2(url) { + const hostname2 = url.hostname; + let pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102 || // 2f 2F / + pathname[n7 + 1] === "5" && third === 99) { + throw new Deno.errors.InvalidData( + "must not include encoded \\ or / characters" + ); + } + } + } + pathname = pathname.replace(forwardSlashRegEx2, "\\"); + pathname = decodeURIComponent(pathname); + if (hostname2 !== "") { + return `\\\\${hostname2}${pathname}`; + } else { + const letter = pathname.codePointAt(1) | 32; + const sep2 = pathname[2]; + if (letter < CHAR_LOWERCASE_A2 || letter > CHAR_LOWERCASE_Z2 || // a..z A..Z + sep2 !== ":") { + throw new Deno.errors.InvalidData("file url path must be absolute"); + } + return pathname.slice(1); + } +} +function getPathFromURLPosix2(url) { + if (url.hostname !== "") { + throw new Deno.errors.InvalidData("invalid file url hostname"); + } + const pathname = url.pathname; + for (let n7 = 0; n7 < pathname.length; n7++) { + if (pathname[n7] === "%") { + const third = pathname.codePointAt(n7 + 2) || 32; + if (pathname[n7 + 1] === "2" && third === 102) { + throw new Deno.errors.InvalidData( + "must not include encoded / characters" + ); + } + } + } + return decodeURIComponent(pathname); +} +function pathToFileURL2(filepath) { + let resolved = exports$213.resolve(filepath); + const filePathLast = filepath.charCodeAt(filepath.length - 1); + if ((filePathLast === CHAR_FORWARD_SLASH2 || isWindows2 && filePathLast === CHAR_BACKWARD_SLASH2) && resolved[resolved.length - 1] !== exports$213.sep) { + resolved += "/"; + } + const outURL = new URL("file://"); + if (resolved.includes("%")) + resolved = resolved.replace(percentRegEx2, "%25"); + if (!isWindows2 && resolved.includes("\\")) { + resolved = resolved.replace(backslashRegEx2, "%5C"); + } + if (resolved.includes("\n")) + resolved = resolved.replace(newlineRegEx2, "%0A"); + if (resolved.includes("\r")) { + resolved = resolved.replace(carriageReturnRegEx2, "%0D"); + } + if (resolved.includes(" ")) + resolved = resolved.replace(tabRegEx2, "%09"); + outURL.pathname = resolved; + return outURL; +} +var exports$116, _dewExec$113, exports$213, t$14, o$24, n$24, e$24, r$24, c$15, s6, u$15, a$14, d6, h$14, p$14, n$15, r$14, t7, o$15, h7, e9, a6, o6, n6, i6, l6, p6, c6, u6, f7, m6, v7, g6, y6, b7, exports23, _dewExec20, path, processPlatform$1, CHAR_BACKWARD_SLASH$1, CHAR_FORWARD_SLASH$1, CHAR_LOWERCASE_A$1, CHAR_LOWERCASE_Z$1, isWindows$1, forwardSlashRegEx$1, percentRegEx$1, backslashRegEx$1, newlineRegEx$1, carriageReturnRegEx$1, tabRegEx$1, processPlatform2, CHAR_BACKWARD_SLASH2, CHAR_FORWARD_SLASH2, CHAR_LOWERCASE_A2, CHAR_LOWERCASE_Z2, isWindows2, forwardSlashRegEx2, percentRegEx2, backslashRegEx2, newlineRegEx2, carriageReturnRegEx2, tabRegEx2; +var init_chunk_DHWh_hmB = __esm({ + "node_modules/@jspm/core/nodelibs/browser/chunk-DHWh-hmB.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_D3uu3VYh(); + init_chunk_b0rmRow7(); + exports$116 = {}; + _dewExec$113 = false; + exports$213 = dew$113(); + t$14 = 2147483647; + o$24 = /^xn--/; + n$24 = /[^\0-\x7E]/; + e$24 = /[\x2E\u3002\uFF0E\uFF61]/g; + r$24 = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }; + c$15 = Math.floor; + s6 = String.fromCharCode; + u$15 = function(t8, o7) { + return t8 + 22 + 75 * (t8 < 26) - ((0 != o7) << 5); + }; + a$14 = function(t8, o7, n7) { + let e10 = 0; + for (t8 = n7 ? c$15(t8 / 700) : t8 >> 1, t8 += c$15(t8 / o7); t8 > 455; e10 += 36) + t8 = c$15(t8 / 35); + return c$15(e10 + 36 * t8 / (t8 + 38)); + }; + d6 = function(o7) { + const n7 = [], e10 = o7.length; + let r8 = 0, s7 = 128, f8 = 72, l7 = o7.lastIndexOf("-"); + l7 < 0 && (l7 = 0); + for (let t8 = 0; t8 < l7; ++t8) + o7.charCodeAt(t8) >= 128 && i$15("not-basic"), n7.push(o7.charCodeAt(t8)); + for (let d7 = l7 > 0 ? l7 + 1 : 0; d7 < e10; ) { + let l8 = r8; + for (let n8 = 1, s8 = 36; ; s8 += 36) { + d7 >= e10 && i$15("invalid-input"); + const l9 = (u7 = o7.charCodeAt(d7++)) - 48 < 10 ? u7 - 22 : u7 - 65 < 26 ? u7 - 65 : u7 - 97 < 26 ? u7 - 97 : 36; + (l9 >= 36 || l9 > c$15((t$14 - r8) / n8)) && i$15("overflow"), r8 += l9 * n8; + const a7 = s8 <= f8 ? 1 : s8 >= f8 + 26 ? 26 : s8 - f8; + if (l9 < a7) + break; + const h9 = 36 - a7; + n8 > c$15(t$14 / h9) && i$15("overflow"), n8 *= h9; + } + const h8 = n7.length + 1; + f8 = a$14(r8 - l8, h8, 0 == l8), c$15(r8 / h8) > t$14 - s7 && i$15("overflow"), s7 += c$15(r8 / h8), r8 %= h8, n7.splice(r8++, 0, s7); + } + var u7; + return String.fromCodePoint(...n7); + }; + h$14 = function(o7) { + const n7 = []; + let e10 = (o7 = l$15(o7)).length, r8 = 128, f8 = 0, d7 = 72; + for (const t8 of o7) + t8 < 128 && n7.push(s6(t8)); + let h8 = n7.length, p7 = h8; + for (h8 && n7.push("-"); p7 < e10; ) { + let e11 = t$14; + for (const t8 of o7) + t8 >= r8 && t8 < e11 && (e11 = t8); + const l7 = p7 + 1; + e11 - r8 > c$15((t$14 - f8) / l7) && i$15("overflow"), f8 += (e11 - r8) * l7, r8 = e11; + for (const e12 of o7) + if (e12 < r8 && ++f8 > t$14 && i$15("overflow"), e12 == r8) { + let t8 = f8; + for (let o8 = 36; ; o8 += 36) { + const e13 = o8 <= d7 ? 1 : o8 >= d7 + 26 ? 26 : o8 - d7; + if (t8 < e13) + break; + const r9 = t8 - e13, i7 = 36 - e13; + n7.push(s6(u$15(e13 + r9 % i7, 0))), t8 = c$15(r9 / i7); + } + n7.push(s6(u$15(t8, 0))), d7 = a$14(f8, l7, p7 == h8), f8 = 0, ++p7; + } + ++f8, ++r8; + } + return n7.join(""); + }; + p$14 = { version: "2.1.0", ucs2: { decode: l$15, encode: (t8) => String.fromCodePoint(...t8) }, decode: d6, encode: h$14, toASCII: function(t8) { + return f$15(t8, function(t9) { + return n$24.test(t9) ? "xn--" + h$14(t9) : t9; + }); + }, toUnicode: function(t8) { + return f$15(t8, function(t9) { + return o$24.test(t9) ? d6(t9.slice(4).toLowerCase()) : t9; + }); + } }; + n$15 = function(n7, r8, t8, o7) { + r8 = r8 || "&", t8 = t8 || "="; + var a7 = {}; + if ("string" != typeof n7 || 0 === n7.length) + return a7; + var u7 = /\+/g; + n7 = n7.split(r8); + var c7 = 1e3; + o7 && "number" == typeof o7.maxKeys && (c7 = o7.maxKeys); + var i7 = n7.length; + c7 > 0 && i7 > c7 && (i7 = c7); + for (var s7 = 0; s7 < i7; ++s7) { + var p7, f8, d7, y7, m7 = n7[s7].replace(u7, "%20"), l7 = m7.indexOf(t8); + l7 >= 0 ? (p7 = m7.substr(0, l7), f8 = m7.substr(l7 + 1)) : (p7 = m7, f8 = ""), d7 = decodeURIComponent(p7), y7 = decodeURIComponent(f8), e$15(a7, d7) ? Array.isArray(a7[d7]) ? a7[d7].push(y7) : a7[d7] = [a7[d7], y7] : a7[d7] = y7; + } + return a7; + }; + r$14 = function(e10) { + switch (typeof e10) { + case "string": + return e10; + case "boolean": + return e10 ? "true" : "false"; + case "number": + return isFinite(e10) ? e10 : ""; + default: + return ""; + } + }; + t7 = function(e10, n7, t8, o7) { + return n7 = n7 || "&", t8 = t8 || "=", null === e10 && (e10 = void 0), "object" == typeof e10 ? Object.keys(e10).map(function(o8) { + var a7 = encodeURIComponent(r$14(o8)) + t8; + return Array.isArray(e10[o8]) ? e10[o8].map(function(e11) { + return a7 + encodeURIComponent(r$14(e11)); + }).join(n7) : a7 + encodeURIComponent(r$14(e10[o8])); + }).join(n7) : o7 ? encodeURIComponent(r$14(o7)) + t8 + encodeURIComponent(r$14(e10)) : ""; + }; + o$15 = {}; + o$15.decode = o$15.parse = n$15, o$15.encode = o$15.stringify = t7; + o$15.decode; + o$15.encode; + o$15.parse; + o$15.stringify; + h7 = {}; + e9 = p$14; + a6 = { isString: function(t8) { + return "string" == typeof t8; + }, isObject: function(t8) { + return "object" == typeof t8 && null !== t8; + }, isNull: function(t8) { + return null === t8; + }, isNullOrUndefined: function(t8) { + return null == t8; + } }; + h7.parse = O6, h7.resolve = function(t8, s7) { + return O6(t8, false, true).resolve(s7); + }, h7.resolveObject = function(t8, s7) { + return t8 ? O6(t8, false, true).resolveObject(s7) : s7; + }, h7.format = function(t8) { + a6.isString(t8) && (t8 = O6(t8)); + return t8 instanceof r7 ? t8.format() : r7.prototype.format.call(t8); + }, h7.Url = r7; + o6 = /^([a-z0-9.+-]+:)/i; + n6 = /:[0-9]*$/; + i6 = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; + l6 = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", " "]); + p6 = ["'"].concat(l6); + c6 = ["%", "/", "?", ";", "#"].concat(p6); + u6 = ["/", "?", "#"]; + f7 = /^[+a-z0-9A-Z_-]{0,63}$/; + m6 = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; + v7 = { javascript: true, "javascript:": true }; + g6 = { javascript: true, "javascript:": true }; + y6 = { http: true, https: true, ftp: true, gopher: true, file: true, "http:": true, "https:": true, "ftp:": true, "gopher:": true, "file:": true }; + b7 = o$15; + r7.prototype.parse = function(t8, s7, h8) { + if (!a6.isString(t8)) + throw new TypeError("Parameter 'url' must be a string, not " + typeof t8); + var r8 = t8.indexOf("?"), n7 = -1 !== r8 && r8 < t8.indexOf("#") ? "?" : "#", l7 = t8.split(n7); + l7[0] = l7[0].replace(/\\/g, "/"); + var O7 = t8 = l7.join(n7); + if (O7 = O7.trim(), !h8 && 1 === t8.split("#").length) { + var d7 = i6.exec(O7); + if (d7) + return this.path = O7, this.href = O7, this.pathname = d7[1], d7[2] ? (this.search = d7[2], this.query = s7 ? b7.parse(this.search.substr(1)) : this.search.substr(1)) : s7 && (this.search = "", this.query = {}), this; + } + var j6 = o6.exec(O7); + if (j6) { + var q5 = (j6 = j6[0]).toLowerCase(); + this.protocol = q5, O7 = O7.substr(j6.length); + } + if (h8 || j6 || O7.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var x7 = "//" === O7.substr(0, 2); + !x7 || j6 && g6[j6] || (O7 = O7.substr(2), this.slashes = true); + } + if (!g6[j6] && (x7 || j6 && !y6[j6])) { + for (var A6, C6, I6 = -1, w6 = 0; w6 < u6.length; w6++) { + -1 !== (N6 = O7.indexOf(u6[w6])) && (-1 === I6 || N6 < I6) && (I6 = N6); + } + -1 !== (C6 = -1 === I6 ? O7.lastIndexOf("@") : O7.lastIndexOf("@", I6)) && (A6 = O7.slice(0, C6), O7 = O7.slice(C6 + 1), this.auth = decodeURIComponent(A6)), I6 = -1; + for (w6 = 0; w6 < c6.length; w6++) { + var N6; + -1 !== (N6 = O7.indexOf(c6[w6])) && (-1 === I6 || N6 < I6) && (I6 = N6); + } + -1 === I6 && (I6 = O7.length), this.host = O7.slice(0, I6), O7 = O7.slice(I6), this.parseHost(), this.hostname = this.hostname || ""; + var U6 = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1]; + if (!U6) + for (var k6 = this.hostname.split(/\./), S6 = (w6 = 0, k6.length); w6 < S6; w6++) { + var R6 = k6[w6]; + if (R6 && !R6.match(f7)) { + for (var $5 = "", z6 = 0, H5 = R6.length; z6 < H5; z6++) + R6.charCodeAt(z6) > 127 ? $5 += "x" : $5 += R6[z6]; + if (!$5.match(f7)) { + var L6 = k6.slice(0, w6), Z5 = k6.slice(w6 + 1), _6 = R6.match(m6); + _6 && (L6.push(_6[1]), Z5.unshift(_6[2])), Z5.length && (O7 = "/" + Z5.join(".") + O7), this.hostname = L6.join("."); + break; + } + } + } + this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), U6 || (this.hostname = e9.toASCII(this.hostname)); + var E6 = this.port ? ":" + this.port : "", P6 = this.hostname || ""; + this.host = P6 + E6, this.href += this.host, U6 && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== O7[0] && (O7 = "/" + O7)); + } + if (!v7[q5]) + for (w6 = 0, S6 = p6.length; w6 < S6; w6++) { + var T6 = p6[w6]; + if (-1 !== O7.indexOf(T6)) { + var B6 = encodeURIComponent(T6); + B6 === T6 && (B6 = escape(T6)), O7 = O7.split(T6).join(B6); + } + } + var D6 = O7.indexOf("#"); + -1 !== D6 && (this.hash = O7.substr(D6), O7 = O7.slice(0, D6)); + var F6 = O7.indexOf("?"); + if (-1 !== F6 ? (this.search = O7.substr(F6), this.query = O7.substr(F6 + 1), s7 && (this.query = b7.parse(this.query)), O7 = O7.slice(0, F6)) : s7 && (this.search = "", this.query = {}), O7 && (this.pathname = O7), y6[q5] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) { + E6 = this.pathname || ""; + var G5 = this.search || ""; + this.path = E6 + G5; + } + return this.href = this.format(), this; + }, r7.prototype.format = function() { + var t8 = this.auth || ""; + t8 && (t8 = (t8 = encodeURIComponent(t8)).replace(/%3A/i, ":"), t8 += "@"); + var s7 = this.protocol || "", h8 = this.pathname || "", e10 = this.hash || "", r8 = false, o7 = ""; + this.host ? r8 = t8 + this.host : this.hostname && (r8 = t8 + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (r8 += ":" + this.port)), this.query && a6.isObject(this.query) && Object.keys(this.query).length && (o7 = b7.stringify(this.query)); + var n7 = this.search || o7 && "?" + o7 || ""; + return s7 && ":" !== s7.substr(-1) && (s7 += ":"), this.slashes || (!s7 || y6[s7]) && false !== r8 ? (r8 = "//" + (r8 || ""), h8 && "/" !== h8.charAt(0) && (h8 = "/" + h8)) : r8 || (r8 = ""), e10 && "#" !== e10.charAt(0) && (e10 = "#" + e10), n7 && "?" !== n7.charAt(0) && (n7 = "?" + n7), s7 + r8 + (h8 = h8.replace(/[?#]/g, function(t9) { + return encodeURIComponent(t9); + })) + (n7 = n7.replace("#", "%23")) + e10; + }, r7.prototype.resolve = function(t8) { + return this.resolveObject(O6(t8, false, true)).format(); + }, r7.prototype.resolveObject = function(t8) { + if (a6.isString(t8)) { + var s7 = new r7(); + s7.parse(t8, false, true), t8 = s7; + } + for (var h8 = new r7(), e10 = Object.keys(this), o7 = 0; o7 < e10.length; o7++) { + var n7 = e10[o7]; + h8[n7] = this[n7]; + } + if (h8.hash = t8.hash, "" === t8.href) + return h8.href = h8.format(), h8; + if (t8.slashes && !t8.protocol) { + for (var i7 = Object.keys(t8), l7 = 0; l7 < i7.length; l7++) { + var p7 = i7[l7]; + "protocol" !== p7 && (h8[p7] = t8[p7]); + } + return y6[h8.protocol] && h8.hostname && !h8.pathname && (h8.path = h8.pathname = "/"), h8.href = h8.format(), h8; + } + if (t8.protocol && t8.protocol !== h8.protocol) { + if (!y6[t8.protocol]) { + for (var c7 = Object.keys(t8), u7 = 0; u7 < c7.length; u7++) { + var f8 = c7[u7]; + h8[f8] = t8[f8]; + } + return h8.href = h8.format(), h8; + } + if (h8.protocol = t8.protocol, t8.host || g6[t8.protocol]) + h8.pathname = t8.pathname; + else { + for (var m7 = (t8.pathname || "").split("/"); m7.length && !(t8.host = m7.shift()); ) + ; + t8.host || (t8.host = ""), t8.hostname || (t8.hostname = ""), "" !== m7[0] && m7.unshift(""), m7.length < 2 && m7.unshift(""), h8.pathname = m7.join("/"); + } + if (h8.search = t8.search, h8.query = t8.query, h8.host = t8.host || "", h8.auth = t8.auth, h8.hostname = t8.hostname || t8.host, h8.port = t8.port, h8.pathname || h8.search) { + var v8 = h8.pathname || "", b8 = h8.search || ""; + h8.path = v8 + b8; + } + return h8.slashes = h8.slashes || t8.slashes, h8.href = h8.format(), h8; + } + var O7 = h8.pathname && "/" === h8.pathname.charAt(0), d7 = t8.host || t8.pathname && "/" === t8.pathname.charAt(0), j6 = d7 || O7 || h8.host && t8.pathname, q5 = j6, x7 = h8.pathname && h8.pathname.split("/") || [], A6 = (m7 = t8.pathname && t8.pathname.split("/") || [], h8.protocol && !y6[h8.protocol]); + if (A6 && (h8.hostname = "", h8.port = null, h8.host && ("" === x7[0] ? x7[0] = h8.host : x7.unshift(h8.host)), h8.host = "", t8.protocol && (t8.hostname = null, t8.port = null, t8.host && ("" === m7[0] ? m7[0] = t8.host : m7.unshift(t8.host)), t8.host = null), j6 = j6 && ("" === m7[0] || "" === x7[0])), d7) + h8.host = t8.host || "" === t8.host ? t8.host : h8.host, h8.hostname = t8.hostname || "" === t8.hostname ? t8.hostname : h8.hostname, h8.search = t8.search, h8.query = t8.query, x7 = m7; + else if (m7.length) + x7 || (x7 = []), x7.pop(), x7 = x7.concat(m7), h8.search = t8.search, h8.query = t8.query; + else if (!a6.isNullOrUndefined(t8.search)) { + if (A6) + h8.hostname = h8.host = x7.shift(), (U6 = !!(h8.host && h8.host.indexOf("@") > 0) && h8.host.split("@")) && (h8.auth = U6.shift(), h8.host = h8.hostname = U6.shift()); + return h8.search = t8.search, h8.query = t8.query, a6.isNull(h8.pathname) && a6.isNull(h8.search) || (h8.path = (h8.pathname ? h8.pathname : "") + (h8.search ? h8.search : "")), h8.href = h8.format(), h8; + } + if (!x7.length) + return h8.pathname = null, h8.search ? h8.path = "/" + h8.search : h8.path = null, h8.href = h8.format(), h8; + for (var C6 = x7.slice(-1)[0], I6 = (h8.host || t8.host || x7.length > 1) && ("." === C6 || ".." === C6) || "" === C6, w6 = 0, N6 = x7.length; N6 >= 0; N6--) + "." === (C6 = x7[N6]) ? x7.splice(N6, 1) : ".." === C6 ? (x7.splice(N6, 1), w6++) : w6 && (x7.splice(N6, 1), w6--); + if (!j6 && !q5) + for (; w6--; w6) + x7.unshift(".."); + !j6 || "" === x7[0] || x7[0] && "/" === x7[0].charAt(0) || x7.unshift(""), I6 && "/" !== x7.join("/").substr(-1) && x7.push(""); + var U6, k6 = "" === x7[0] || x7[0] && "/" === x7[0].charAt(0); + A6 && (h8.hostname = h8.host = k6 ? "" : x7.length ? x7.shift() : "", (U6 = !!(h8.host && h8.host.indexOf("@") > 0) && h8.host.split("@")) && (h8.auth = U6.shift(), h8.host = h8.hostname = U6.shift())); + return (j6 = j6 || h8.host && x7.length) && !k6 && x7.unshift(""), x7.length ? h8.pathname = x7.join("/") : (h8.pathname = null, h8.path = null), a6.isNull(h8.pathname) && a6.isNull(h8.search) || (h8.path = (h8.pathname ? h8.pathname : "") + (h8.search ? h8.search : "")), h8.auth = t8.auth || h8.auth, h8.slashes = h8.slashes || t8.slashes, h8.href = h8.format(), h8; + }, r7.prototype.parseHost = function() { + var t8 = this.host, s7 = n6.exec(t8); + s7 && (":" !== (s7 = s7[0]) && (this.port = s7.substr(1)), t8 = t8.substr(0, t8.length - s7.length)), t8 && (this.hostname = t8); + }; + h7.Url; + h7.format; + h7.resolve; + h7.resolveObject; + exports23 = {}; + _dewExec20 = false; + path = dew20(); + processPlatform$1 = typeof Deno !== "undefined" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0; + h7.URL = typeof URL !== "undefined" ? URL : null; + h7.pathToFileURL = pathToFileURL$1; + h7.fileURLToPath = fileURLToPath$1; + h7.Url; + h7.format; + h7.resolve; + h7.resolveObject; + h7.URL; + CHAR_BACKWARD_SLASH$1 = 92; + CHAR_FORWARD_SLASH$1 = 47; + CHAR_LOWERCASE_A$1 = 97; + CHAR_LOWERCASE_Z$1 = 122; + isWindows$1 = processPlatform$1 === "win32"; + forwardSlashRegEx$1 = /\//g; + percentRegEx$1 = /%/g; + backslashRegEx$1 = /\\/g; + newlineRegEx$1 = /\n/g; + carriageReturnRegEx$1 = /\r/g; + tabRegEx$1 = /\t/g; + processPlatform2 = typeof Deno !== "undefined" ? Deno.build.os === "windows" ? "win32" : Deno.build.os : void 0; + h7.URL = typeof URL !== "undefined" ? URL : null; + h7.pathToFileURL = pathToFileURL2; + h7.fileURLToPath = fileURLToPath2; + h7.Url; + h7.format; + h7.resolve; + h7.resolveObject; + h7.parse; + h7.URL; + CHAR_BACKWARD_SLASH2 = 92; + CHAR_FORWARD_SLASH2 = 47; + CHAR_LOWERCASE_A2 = 97; + CHAR_LOWERCASE_Z2 = 122; + isWindows2 = processPlatform2 === "win32"; + forwardSlashRegEx2 = /\//g; + percentRegEx2 = /%/g; + backslashRegEx2 = /\\/g; + newlineRegEx2 = /\n/g; + carriageReturnRegEx2 = /\r/g; + tabRegEx2 = /\t/g; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/http.js +var http_exports = {}; +__export(http_exports, { + Agent: () => Agent, + ClientRequest: () => ClientRequest, + IncomingMessage: () => IncomingMessage, + METHODS: () => METHODS, + STATUS_CODES: () => STATUS_CODES, + default: () => exports24, + get: () => get2, + globalAgent: () => globalAgent, + request: () => request +}); +function dew$k4() { + if (_dewExec$k4) + return exports$l3; + _dewExec$k4 = true; + exports$l3.fetch = isFunction3(_global$52.fetch) && isFunction3(_global$52.ReadableStream); + exports$l3.writableStream = isFunction3(_global$52.WritableStream); + exports$l3.abortController = isFunction3(_global$52.AbortController); + var xhr; + function getXHR() { + if (xhr !== void 0) + return xhr; + if (_global$52.XMLHttpRequest) { + xhr = new _global$52.XMLHttpRequest(); + try { + xhr.open("GET", _global$52.XDomainRequest ? "/" : "https://example.com"); + } catch (e10) { + xhr = null; + } + } else { + xhr = null; + } + return xhr; + } + function checkTypeSupport(type3) { + var xhr2 = getXHR(); + if (!xhr2) + return false; + try { + xhr2.responseType = type3; + return xhr2.responseType === type3; + } catch (e10) { + } + return false; + } + exports$l3.arraybuffer = exports$l3.fetch || checkTypeSupport("arraybuffer"); + exports$l3.msstream = !exports$l3.fetch && checkTypeSupport("ms-stream"); + exports$l3.mozchunkedarraybuffer = !exports$l3.fetch && checkTypeSupport("moz-chunked-arraybuffer"); + exports$l3.overrideMimeType = exports$l3.fetch || (getXHR() ? isFunction3(getXHR().overrideMimeType) : false); + function isFunction3(value2) { + return typeof value2 === "function"; + } + xhr = null; + return exports$l3; +} +function dew$j4() { + if (_dewExec$j4) + return exports$k4; + _dewExec$j4 = true; + exports$k4 = y.EventEmitter; + return exports$k4; +} +function dew$i4() { + if (_dewExec$i4) + return exports$j4; + _dewExec$i4 = true; + function ownKeys2(object, enumerableOnly) { + var keys2 = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys2.push.apply(keys2, symbols); + } + return keys2; + } + function _objectSpread(target) { + for (var i7 = 1; i7 < arguments.length; i7++) { + var source = null != arguments[i7] ? arguments[i7] : {}; + i7 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value2) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties3(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass3(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties3(Constructor.prototype, protoProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var _require = dew(), Buffer4 = _require.Buffer; + var _require2 = X2, inspect2 = _require2.inspect; + var custom2 = inspect2 && inspect2.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer4.prototype.copy.call(src, target, offset); + } + exports$j4 = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck3(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass3(BufferList, [{ + key: "push", + value: function push4(v8) { + var entry = { + data: v8, + next: null + }; + if (this.length > 0) + this.tail.next = entry; + else + this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift4(v8) { + var entry = { + data: v8, + next: this.head + }; + if (this.length === 0) + this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) + return; + var ret = this.head.data; + if (this.length === 1) + this.head = this.tail = null; + else + this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear2() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join3(s7) { + if (this.length === 0) + return ""; + var p7 = this.head; + var ret = "" + p7.data; + while (p7 = p7.next) + ret += s7 + p7.data; + return ret; + } + }, { + key: "concat", + value: function concat2(n7) { + if (this.length === 0) + return Buffer4.alloc(0); + var ret = Buffer4.allocUnsafe(n7 >>> 0); + var p7 = this.head; + var i7 = 0; + while (p7) { + copyBuffer(p7.data, ret, i7); + i7 += p7.data.length; + p7 = p7.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n7, hasStrings) { + var ret; + if (n7 < this.head.data.length) { + ret = this.head.data.slice(0, n7); + this.head.data = this.head.data.slice(n7); + } else if (n7 === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n7) : this._getBuffer(n7); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n7) { + var p7 = this.head; + var c7 = 1; + var ret = p7.data; + n7 -= ret.length; + while (p7 = p7.next) { + var str2 = p7.data; + var nb = n7 > str2.length ? str2.length : n7; + if (nb === str2.length) + ret += str2; + else + ret += str2.slice(0, n7); + n7 -= nb; + if (n7 === 0) { + if (nb === str2.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = str2.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n7) { + var ret = Buffer4.allocUnsafe(n7); + var p7 = this.head; + var c7 = 1; + p7.data.copy(ret); + n7 -= p7.data.length; + while (p7 = p7.next) { + var buf = p7.data; + var nb = n7 > buf.length ? buf.length : n7; + buf.copy(ret, ret.length - n7, 0, nb); + n7 -= nb; + if (n7 === 0) { + if (nb === buf.length) { + ++c7; + if (p7.next) + this.head = p7.next; + else + this.head = this.tail = null; + } else { + this.head = p7; + p7.data = buf.slice(nb); + } + break; + } + ++c7; + } + this.length -= c7; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom2, + value: function value2(_6, options) { + return inspect2(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + return exports$j4; +} +function dew$h4() { + if (_dewExec$h4) + return exports$i4; + _dewExec$h4 = true; + var process$1 = process3; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process$1.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process$1.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) + return; + if (self2._readableState && !self2._readableState.emitClose) + return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream2, err) { + var rState = stream2._readableState; + var wState = stream2._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) + stream2.destroy(err); + else + stream2.emit("error", err); + } + exports$i4 = { + destroy, + undestroy, + errorOrDestroy + }; + return exports$i4; +} +function dew$g5() { + if (_dewExec$g5) + return exports$h4; + _dewExec$g5 = true; + const codes2 = {}; + function createErrorType(code, message, Base2) { + if (!Base2) { + Base2 = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + class NodeError extends Base2 { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base2.name; + NodeError.prototype.code = code; + codes2[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i7) => String(i7)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith2(str2, search, pos) { + return str2.substr(0, search.length) === search; + } + function endsWith2(str2, search, this_len) { + if (this_len === void 0 || this_len > str2.length) { + this_len = str2.length; + } + return str2.substring(this_len - search.length, this_len) === search; + } + function includes2(str2, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str2.length) { + return false; + } else { + return str2.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value2) { + return 'The value "' + value2 + '" is invalid for option "' + name2 + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith2(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith2(name2, " argument")) { + msg = `The ${name2} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type3 = includes2(name2, ".") ? "property" : "argument"; + msg = `The "${name2}" ${type3} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) { + return "The " + name2 + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name2) { + return "Cannot call " + name2 + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + exports$h4.codes = codes2; + return exports$h4; +} +function dew$f5() { + if (_dewExec$f5) + return exports$g5; + _dewExec$f5 = true; + var ERR_INVALID_OPT_VALUE = dew$g5().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name2 = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name2, hwm); + } + return Math.floor(hwm); + } + return state.objectMode ? 16 : 16 * 1024; + } + exports$g5 = { + getHighWaterMark + }; + return exports$g5; +} +function dew$e5() { + if (_dewExec$e5) + return exports$f5; + _dewExec$e5 = true; + var process$1 = process3; + exports$f5 = Writable2; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var Duplex2; + Writable2.WritableState = WritableState; + var internalUtil = { + deprecate: dew13() + }; + var Stream2 = dew$j4(); + var Buffer4 = dew().Buffer; + var OurUint8Array = (typeof _global$42 !== "undefined" ? _global$42 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = dew$h4(); + var _require = dew$f5(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$g5().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + dew4()(Writable2, Stream2); + function nop() { + } + function WritableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$d5(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream2, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_6) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable2, Symbol.hasInstance, { + value: function value2(object) { + if (realHasInstance.call(this, object)) + return true; + if (this !== Writable2) + return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable2(options) { + Duplex2 = Duplex2 || dew$d5(); + var isDuplex = this instanceof Duplex2; + if (!isDuplex && !realHasInstance.call(Writable2, this)) + return new Writable2(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") + this._write = options.write; + if (typeof options.writev === "function") + this._writev = options.writev; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + if (typeof options.final === "function") + this._final = options.final; + } + Stream2.call(this); + } + Writable2.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream2, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream2, er); + process$1.nextTick(cb, er); + } + function validChunk(stream2, state, chunk2, cb) { + var er; + if (chunk2 === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk2 !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer"], chunk2); + } + if (er) { + errorOrDestroy(stream2, er); + process$1.nextTick(cb, er); + return false; + } + return true; + } + Writable2.prototype.write = function(chunk2, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk2); + if (isBuf && !Buffer4.isBuffer(chunk2)) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) + encoding = "buffer"; + else if (!encoding) + encoding = state.defaultEncoding; + if (typeof cb !== "function") + cb = nop; + if (state.ending) + writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk2, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk2, encoding, cb); + } + return ret; + }; + Writable2.prototype.cork = function() { + this._writableState.corked++; + }; + Writable2.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) + clearBuffer(this, state); + } + }; + Writable2.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") + encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) + throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state, chunk2, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk2 === "string") { + chunk2 = Buffer4.from(chunk2, encoding); + } + return chunk2; + } + Object.defineProperty(Writable2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream2, state, isBuf, chunk2, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk2, encoding); + if (chunk2 !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk2 = newChunk; + } + } + var len = state.objectMode ? 1 : chunk2.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) + state.needDrain = true; + if (state.writing || state.corked) { + var last2 = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk2, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last2) { + last2.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream2, state, false, len, chunk2, encoding, cb); + } + return ret; + } + function doWrite(stream2, state, writev, len, chunk2, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) + state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) + stream2._writev(chunk2, state.onwrite); + else + stream2._write(chunk2, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream2, state, sync, er, cb) { + --state.pendingcb; + if (sync) { + process$1.nextTick(cb, er); + process$1.nextTick(finishMaybe, stream2, state); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + } else { + cb(er); + stream2._writableState.errorEmitted = true; + errorOrDestroy(stream2, er); + finishMaybe(stream2, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream2, er) { + var state = stream2._writableState; + var sync = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") + throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) + onwriteError(stream2, state, sync, er, cb); + else { + var finished2 = needFinish(state) || stream2.destroyed; + if (!finished2 && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream2, state); + } + if (sync) { + process$1.nextTick(afterWrite, stream2, state, finished2, cb); + } else { + afterWrite(stream2, state, finished2, cb); + } + } + } + function afterWrite(stream2, state, finished2, cb) { + if (!finished2) + onwriteDrain(stream2, state); + state.pendingcb--; + cb(); + finishMaybe(stream2, state); + } + function onwriteDrain(stream2, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream2.emit("drain"); + } + } + function clearBuffer(stream2, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream2._writev && entry && entry.next) { + var l7 = state.bufferedRequestCount; + var buffer2 = new Array(l7); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count2 = 0; + var allBuffers = true; + while (entry) { + buffer2[count2] = entry; + if (!entry.isBuf) + allBuffers = false; + entry = entry.next; + count2 += 1; + } + buffer2.allBuffers = allBuffers; + doWrite(stream2, state, true, state.length, buffer2, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk2 = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk2.length; + doWrite(stream2, state, false, len, chunk2, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable2.prototype._write = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable2.prototype._writev = null; + Writable2.prototype.end = function(chunk2, encoding, cb) { + var state = this._writableState; + if (typeof chunk2 === "function") { + cb = chunk2; + chunk2 = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk2 !== null && chunk2 !== void 0) + this.write(chunk2, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) + endWritable(this, state, cb); + return this; + }; + Object.defineProperty(Writable2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream2, state) { + stream2._final(function(err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream2, err); + } + state.prefinished = true; + stream2.emit("prefinish"); + finishMaybe(stream2, state); + }); + } + function prefinish(stream2, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream2._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process$1.nextTick(callFinal, stream2, state); + } else { + state.prefinished = true; + stream2.emit("prefinish"); + } + } + } + function finishMaybe(stream2, state) { + var need = needFinish(state); + if (need) { + prefinish(stream2, state); + if (state.pendingcb === 0) { + state.finished = true; + stream2.emit("finish"); + if (state.autoDestroy) { + var rState = stream2._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream2.destroy(); + } + } + } + } + return need; + } + function endWritable(stream2, state, cb) { + state.ending = true; + finishMaybe(stream2, state); + if (cb) { + if (state.finished) + process$1.nextTick(cb); + else + stream2.once("finish", cb); + } + state.ended = true; + stream2.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set4(value2) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value2; + } + }); + Writable2.prototype.destroy = destroyImpl.destroy; + Writable2.prototype._undestroy = destroyImpl.undestroy; + Writable2.prototype._destroy = function(err, cb) { + cb(err); + }; + return exports$f5; +} +function dew$d5() { + if (_dewExec$d5) + return exports$e5; + _dewExec$d5 = true; + var process$1 = process3; + var objectKeys = Object.keys || function(obj) { + var keys3 = []; + for (var key in obj) + keys3.push(key); + return keys3; + }; + exports$e5 = Duplex2; + var Readable3 = dew$97(); + var Writable2 = dew$e5(); + dew4()(Duplex2, Readable3); + { + var keys2 = objectKeys(Writable2.prototype); + for (var v8 = 0; v8 < keys2.length; v8++) { + var method2 = keys2[v8]; + if (!Duplex2.prototype[method2]) + Duplex2.prototype[method2] = Writable2.prototype[method2]; + } + } + function Duplex2(options) { + if (!(this instanceof Duplex2)) + return new Duplex2(options); + Readable3.call(this, options); + Writable2.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) + this.readable = false; + if (options.writable === false) + this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex2.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex2.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex2.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) + return; + process$1.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set4(value2) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value2; + this._writableState.destroyed = value2; + } + }); + return exports$e5; +} +function dew$c6() { + if (_dewExec$c6) + return exports$d6; + _dewExec$c6 = true; + var ERR_STREAM_PREMATURE_CLOSE = dew$g5().codes.ERR_STREAM_PREMATURE_CLOSE; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; + } + function noop4() { + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function eos(stream2, opts, callback) { + if (typeof opts === "function") + return eos(stream2, null, opts); + if (!opts) + opts = {}; + callback = once5(callback || noop4); + var readable = opts.readable || opts.readable !== false && stream2.readable; + var writable = opts.writable || opts.writable !== false && stream2.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream2.writable) + onfinish(); + }; + var writableEnded = stream2._writableState && stream2._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) + callback.call(stream2); + }; + var readableEnded = stream2._readableState && stream2._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) + callback.call(stream2); + }; + var onerror = function onerror2(err) { + callback.call(stream2, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream2._readableState || !stream2._readableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + if (writable && !writableEnded) { + if (!stream2._writableState || !stream2._writableState.ended) + err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream2, err); + } + }; + var onrequest = function onrequest2() { + stream2.req.on("finish", onfinish); + }; + if (isRequest(stream2)) { + stream2.on("complete", onfinish); + stream2.on("abort", onclose); + if (stream2.req) + onrequest(); + else + stream2.on("request", onrequest); + } else if (writable && !stream2._writableState) { + stream2.on("end", onlegacyfinish); + stream2.on("close", onlegacyfinish); + } + stream2.on("end", onend); + stream2.on("finish", onfinish); + if (opts.error !== false) + stream2.on("error", onerror); + stream2.on("close", onclose); + return function() { + stream2.removeListener("complete", onfinish); + stream2.removeListener("abort", onclose); + stream2.removeListener("request", onrequest); + if (stream2.req) + stream2.req.removeListener("finish", onfinish); + stream2.removeListener("end", onlegacyfinish); + stream2.removeListener("close", onlegacyfinish); + stream2.removeListener("finish", onfinish); + stream2.removeListener("end", onend); + stream2.removeListener("error", onerror); + stream2.removeListener("close", onclose); + }; + } + exports$d6 = eos; + return exports$d6; +} +function dew$b7() { + if (_dewExec$b7) + return exports$c7; + _dewExec$b7 = true; + var process$1 = process3; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value2) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var finished2 = dew$c6(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult2(value2, done) { + return { + value: value2, + done + }; + } + function readAndResolve(iter) { + var resolve3 = iter[kLastResolve]; + if (resolve3 !== null) { + var data = iter[kStream].read(); + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } + } + } + function onReadable(iter) { + process$1.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve3, reject2) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve3(createIterResult2(void 0, true)); + return; + } + iter[kHandlePromise](resolve3, reject2); + }, reject2); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error2 = this[kError]; + if (error2 !== null) { + return Promise.reject(error2); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult2(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve3, reject2) { + process$1.nextTick(function() { + if (_this[kError]) { + reject2(_this[kError]); + } else { + resolve3(createIterResult2(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult2(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve3, reject2) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject2(err); + return; + } + resolve3(createIterResult2(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream2) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream2, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream2._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value2(resolve3, reject2) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(data, false)); + } else { + iterator[kLastResolve] = resolve3; + iterator[kLastReject] = reject2; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished2(stream2, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject2 = iterator[kLastReject]; + if (reject2 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject2(err); + } + iterator[kError] = err; + return; + } + var resolve3 = iterator[kLastResolve]; + if (resolve3 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve3(createIterResult2(void 0, true)); + } + iterator[kEnded] = true; + }); + stream2.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + exports$c7 = createReadableStreamAsyncIterator; + return exports$c7; +} +function dew$a7() { + if (_dewExec$a7) + return exports$b7; + _dewExec$a7 = true; + exports$b7 = function() { + throw new Error("Readable.from is not available in the browser"); + }; + return exports$b7; +} +function dew$97() { + if (_dewExec$97) + return exports$a7; + _dewExec$97 = true; + var process$1 = process3; + exports$a7 = Readable3; + var Duplex2; + Readable3.ReadableState = ReadableState; + y.EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type3) { + return emitter.listeners(type3).length; + }; + var Stream2 = dew$j4(); + var Buffer4 = dew().Buffer; + var OurUint8Array = (typeof _global$32 !== "undefined" ? _global$32 : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk2) { + return Buffer4.from(chunk2); + } + function _isUint8Array(obj) { + return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = X2; + var debug2; + if (debugUtil && debugUtil.debuglog) { + debug2 = debugUtil.debuglog("stream"); + } else { + debug2 = function debug3() { + }; + } + var BufferList = dew$i4(); + var destroyImpl = dew$h4(); + var _require = dew$f5(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = dew$g5().codes, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder2; + var createReadableStreamAsyncIterator; + var from; + dew4()(Readable3, Stream2); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener3(emitter, event, fn) { + if (typeof emitter.prependListener === "function") + return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) + emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) + emitter._events[event].unshift(fn); + else + emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream2, isDuplex) { + Duplex2 = Duplex2 || dew$d5(); + options = options || {}; + if (typeof isDuplex !== "boolean") + isDuplex = stream2 instanceof Duplex2; + this.objectMode = !!options.objectMode; + if (isDuplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder2) + StringDecoder2 = exports11.StringDecoder; + this.decoder = new StringDecoder2(options.encoding); + this.encoding = options.encoding; + } + } + function Readable3(options) { + Duplex2 = Duplex2 || dew$d5(); + if (!(this instanceof Readable3)) + return new Readable3(options); + var isDuplex = this instanceof Duplex2; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") + this._read = options.read; + if (typeof options.destroy === "function") + this._destroy = options.destroy; + } + Stream2.call(this); + } + Object.defineProperty(Readable3.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set4(value2) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value2; + } + }); + Readable3.prototype.destroy = destroyImpl.destroy; + Readable3.prototype._undestroy = destroyImpl.undestroy; + Readable3.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable3.prototype.push = function(chunk2, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk2 === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk2 = Buffer4.from(chunk2, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk2, encoding, false, skipChunkCheck); + }; + Readable3.prototype.unshift = function(chunk2) { + return readableAddChunk(this, chunk2, null, true, false); + }; + function readableAddChunk(stream2, chunk2, encoding, addToFront, skipChunkCheck) { + debug2("readableAddChunk", chunk2); + var state = stream2._readableState; + if (chunk2 === null) { + state.reading = false; + onEofChunk(stream2, state); + } else { + var er; + if (!skipChunkCheck) + er = chunkInvalid(state, chunk2); + if (er) { + errorOrDestroy(stream2, er); + } else if (state.objectMode || chunk2 && chunk2.length > 0) { + if (typeof chunk2 !== "string" && !state.objectMode && Object.getPrototypeOf(chunk2) !== Buffer4.prototype) { + chunk2 = _uint8ArrayToBuffer(chunk2); + } + if (addToFront) { + if (state.endEmitted) + errorOrDestroy(stream2, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else + addChunk(stream2, state, chunk2, true); + } else if (state.ended) { + errorOrDestroy(stream2, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk2 = state.decoder.write(chunk2); + if (state.objectMode || chunk2.length !== 0) + addChunk(stream2, state, chunk2, false); + else + maybeReadMore(stream2, state); + } else { + addChunk(stream2, state, chunk2, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream2, state); + } + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream2, state, chunk2, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream2.emit("data", chunk2); + } else { + state.length += state.objectMode ? 1 : chunk2.length; + if (addToFront) + state.buffer.unshift(chunk2); + else + state.buffer.push(chunk2); + if (state.needReadable) + emitReadable(stream2); + } + maybeReadMore(stream2, state); + } + function chunkInvalid(state, chunk2) { + var er; + if (!_isUint8Array(chunk2) && typeof chunk2 !== "string" && chunk2 !== void 0 && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE2("chunk", ["string", "Buffer", "Uint8Array"], chunk2); + } + return er; + } + Readable3.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable3.prototype.setEncoding = function(enc) { + if (!StringDecoder2) + StringDecoder2 = exports11.StringDecoder; + var decoder = new StringDecoder2(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p7 = this._readableState.buffer.head; + var content = ""; + while (p7 !== null) { + content += decoder.write(p7.data); + p7 = p7.next; + } + this._readableState.buffer.clear(); + if (content !== "") + this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n7) { + if (n7 >= MAX_HWM) { + n7 = MAX_HWM; + } else { + n7--; + n7 |= n7 >>> 1; + n7 |= n7 >>> 2; + n7 |= n7 >>> 4; + n7 |= n7 >>> 8; + n7 |= n7 >>> 16; + n7++; + } + return n7; + } + function howMuchToRead(n7, state) { + if (n7 <= 0 || state.length === 0 && state.ended) + return 0; + if (state.objectMode) + return 1; + if (n7 !== n7) { + if (state.flowing && state.length) + return state.buffer.head.data.length; + else + return state.length; + } + if (n7 > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n7); + if (n7 <= state.length) + return n7; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable3.prototype.read = function(n7) { + debug2("read", n7); + n7 = parseInt(n7, 10); + var state = this._readableState; + var nOrig = n7; + if (n7 !== 0) + state.emittedReadable = false; + if (n7 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug2("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + n7 = howMuchToRead(n7, state); + if (n7 === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + var doRead = state.needReadable; + debug2("need readable", doRead); + if (state.length === 0 || state.length - n7 < state.highWaterMark) { + doRead = true; + debug2("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug2("reading or ended", doRead); + } else if (doRead) { + debug2("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) + state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) + n7 = howMuchToRead(nOrig, state); + } + var ret; + if (n7 > 0) + ret = fromList(n7, state); + else + ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n7 = 0; + } else { + state.length -= n7; + state.awaitDrain = 0; + } + if (state.length === 0) { + if (!state.ended) + state.needReadable = true; + if (nOrig !== n7 && state.ended) + endReadable(this); + } + if (ret !== null) + this.emit("data", ret); + return ret; + }; + function onEofChunk(stream2, state) { + debug2("onEofChunk"); + if (state.ended) + return; + if (state.decoder) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) { + state.buffer.push(chunk2); + state.length += state.objectMode ? 1 : chunk2.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream2); + } else { + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream2); + } + } + } + function emitReadable(stream2) { + var state = stream2._readableState; + debug2("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug2("emitReadable", state.flowing); + state.emittedReadable = true; + process$1.nextTick(emitReadable_, stream2); + } + } + function emitReadable_(stream2) { + var state = stream2._readableState; + debug2("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream2.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow2(stream2); + } + function maybeReadMore(stream2, state) { + if (!state.readingMore) { + state.readingMore = true; + process$1.nextTick(maybeReadMore_, stream2, state); + } + } + function maybeReadMore_(stream2, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug2("maybeReadMore read 0"); + stream2.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable3.prototype._read = function(n7) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable3.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug2("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) + process$1.nextTick(endFn); + else + src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug2("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug2("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug2("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + src.on("data", ondata); + function ondata(chunk2) { + debug2("ondata"); + var ret = dest.write(chunk2); + debug2("dest.write", ret); + if (ret === false) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf4(state.pipes, dest) !== -1) && !cleanedUp) { + debug2("false write response, pause", state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug2("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) + errorOrDestroy(dest, er); + } + prependListener3(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug2("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug2("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug2("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug2("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow2(src); + } + }; + } + Readable3.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) + return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) + return this; + if (!dest) + dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i7 = 0; i7 < len; i7++) + dests[i7].emit("unpipe", this, { + hasUnpiped: false + }); + return this; + } + var index4 = indexOf4(state.pipes, dest); + if (index4 === -1) + return this; + state.pipes.splice(index4, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable3.prototype.on = function(ev, fn) { + var res = Stream2.prototype.on.call(this, ev, fn); + var state = this._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) + this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug2("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process$1.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable3.prototype.addListener = Readable3.prototype.on; + Readable3.prototype.removeListener = function(ev, fn) { + var res = Stream2.prototype.removeListener.call(this, ev, fn); + if (ev === "readable") { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + Readable3.prototype.removeAllListeners = function(ev) { + var res = Stream2.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && !state.paused) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug2("readable nexttick read 0"); + self2.read(0); + } + Readable3.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug2("resume"); + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; + }; + function resume(stream2, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process$1.nextTick(resume_, stream2, state); + } + } + function resume_(stream2, state) { + debug2("resume", state.reading); + if (!state.reading) { + stream2.read(0); + } + state.resumeScheduled = false; + stream2.emit("resume"); + flow2(stream2); + if (state.flowing && !state.reading) + stream2.read(0); + } + Readable3.prototype.pause = function() { + debug2("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug2("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow2(stream2) { + var state = stream2._readableState; + debug2("flow", state.flowing); + while (state.flowing && stream2.read() !== null) + ; + } + Readable3.prototype.wrap = function(stream2) { + var _this = this; + var state = this._readableState; + var paused = false; + stream2.on("end", function() { + debug2("wrapped end"); + if (state.decoder && !state.ended) { + var chunk2 = state.decoder.end(); + if (chunk2 && chunk2.length) + _this.push(chunk2); + } + _this.push(null); + }); + stream2.on("data", function(chunk2) { + debug2("wrapped data"); + if (state.decoder) + chunk2 = state.decoder.write(chunk2); + if (state.objectMode && (chunk2 === null || chunk2 === void 0)) + return; + else if (!state.objectMode && (!chunk2 || !chunk2.length)) + return; + var ret = _this.push(chunk2); + if (!ret) { + paused = true; + stream2.pause(); + } + }); + for (var i7 in stream2) { + if (this[i7] === void 0 && typeof stream2[i7] === "function") { + this[i7] = /* @__PURE__ */ function methodWrap(method2) { + return function methodWrapReturnFunction() { + return stream2[method2].apply(stream2, arguments); + }; + }(i7); + } + } + for (var n7 = 0; n7 < kProxyEvents.length; n7++) { + stream2.on(kProxyEvents[n7], this.emit.bind(this, kProxyEvents[n7])); + } + this._read = function(n8) { + debug2("wrapped _read", n8); + if (paused) { + paused = false; + stream2.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable3.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = dew$b7(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable3.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable3.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable3.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.flowing; + }, + set: function set4(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } + }); + Readable3._fromList = fromList; + Object.defineProperty(Readable3.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get4() { + return this._readableState.length; + } + }); + function fromList(n7, state) { + if (state.length === 0) + return null; + var ret; + if (state.objectMode) + ret = state.buffer.shift(); + else if (!n7 || n7 >= state.length) { + if (state.decoder) + ret = state.buffer.join(""); + else if (state.buffer.length === 1) + ret = state.buffer.first(); + else + ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n7, state.decoder); + } + return ret; + } + function endReadable(stream2) { + var state = stream2._readableState; + debug2("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process$1.nextTick(endReadableNT, state, stream2); + } + } + function endReadableNT(state, stream2) { + debug2("endReadableNT", state.endEmitted, state.length); + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream2.readable = false; + stream2.emit("end"); + if (state.autoDestroy) { + var wState = stream2._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream2.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable3.from = function(iterable, opts) { + if (from === void 0) { + from = dew$a7(); + } + return from(Readable3, iterable, opts); + }; + } + function indexOf4(xs, x7) { + for (var i7 = 0, l7 = xs.length; i7 < l7; i7++) { + if (xs[i7] === x7) + return i7; + } + return -1; + } + return exports$a7; +} +function dew$87() { + if (_dewExec$87) + return exports$97; + _dewExec$87 = true; + exports$97 = Transform2; + var _require$codes = dew$g5().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex2 = dew$d5(); + dew4()(Transform2, Duplex2); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform2(options) { + if (!(this instanceof Transform2)) + return new Transform2(options); + Duplex2.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") + this._transform = options.transform; + if (typeof options.flush === "function") + this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform2.prototype.push = function(chunk2, encoding) { + this._transformState.needTransform = false; + return Duplex2.prototype.push.call(this, chunk2, encoding); + }; + Transform2.prototype._transform = function(chunk2, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform2.prototype._write = function(chunk2, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk2; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } + }; + Transform2.prototype._read = function(n7) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform2.prototype._destroy = function(err, cb) { + Duplex2.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream2, er, data) { + if (er) + return stream2.emit("error", er); + if (data != null) + stream2.push(data); + if (stream2._writableState.length) + throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream2._transformState.transforming) + throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream2.push(null); + } + return exports$97; +} +function dew$78() { + if (_dewExec$78) + return exports$88; + _dewExec$78 = true; + exports$88 = PassThrough2; + var Transform2 = dew$87(); + dew4()(PassThrough2, Transform2); + function PassThrough2(options) { + if (!(this instanceof PassThrough2)) + return new PassThrough2(options); + Transform2.call(this, options); + } + PassThrough2.prototype._transform = function(chunk2, encoding, cb) { + cb(null, chunk2); + }; + return exports$88; +} +function dew$68() { + if (_dewExec$68) + return exports$78; + _dewExec$68 = true; + var eos; + function once5(callback) { + var called = false; + return function() { + if (called) + return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = dew$g5().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop4(err) { + if (err) + throw err; + } + function isRequest(stream2) { + return stream2.setHeader && typeof stream2.abort === "function"; + } + function destroyer(stream2, reading, writing, callback) { + callback = once5(callback); + var closed = false; + stream2.on("close", function() { + closed = true; + }); + if (eos === void 0) + eos = dew$c6(); + eos(stream2, { + readable: reading, + writable: writing + }, function(err) { + if (err) + return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) + return; + if (destroyed) + return; + destroyed = true; + if (isRequest(stream2)) + return stream2.abort(); + if (typeof stream2.destroy === "function") + return stream2.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn) { + fn(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) + return noop4; + if (typeof streams[streams.length - 1] !== "function") + return noop4; + return streams.pop(); + } + function pipeline2() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) + streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error2; + var destroys = streams.map(function(stream2, i7) { + var reading = i7 < streams.length - 1; + var writing = i7 > 0; + return destroyer(stream2, reading, writing, function(err) { + if (!error2) + error2 = err; + if (err) + destroys.forEach(call); + if (reading) + return; + destroys.forEach(call); + callback(error2); + }); + }); + return streams.reduce(pipe); + } + exports$78 = pipeline2; + return exports$78; +} +function dew$58() { + if (_dewExec$58) + return exports$68; + _dewExec$58 = true; + exports$68 = exports$68 = dew$97(); + exports$68.Stream = exports$68; + exports$68.Readable = exports$68; + exports$68.Writable = dew$e5(); + exports$68.Duplex = dew$d5(); + exports$68.Transform = dew$87(); + exports$68.PassThrough = dew$78(); + exports$68.finished = dew$c6(); + exports$68.pipeline = dew$68(); + return exports$68; +} +function dew$48() { + if (_dewExec$48) + return exports$58; + _dewExec$48 = true; + var Buffer4 = dew().Buffer; + var process$1 = process3; + var capability = dew$k4(); + var inherits2 = dew4(); + var stream2 = dew$58(); + var rStates = exports$58.readyStates = { + UNSENT: 0, + OPENED: 1, + HEADERS_RECEIVED: 2, + LOADING: 3, + DONE: 4 + }; + var IncomingMessage3 = exports$58.IncomingMessage = function(xhr, response, mode, resetTimers) { + var self2 = this || _global$25; + stream2.Readable.call(self2); + self2._mode = mode; + self2.headers = {}; + self2.rawHeaders = []; + self2.trailers = {}; + self2.rawTrailers = []; + self2.on("end", function() { + process$1.nextTick(function() { + self2.emit("close"); + }); + }); + if (mode === "fetch") { + let read = function() { + reader.read().then(function(result2) { + if (self2._destroyed) + return; + resetTimers(result2.done); + if (result2.done) { + self2.push(null); + return; + } + self2.push(Buffer4.from(result2.value)); + read(); + }).catch(function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + }); + }; + self2._fetchResponse = response; + self2.url = response.url; + self2.statusCode = response.status; + self2.statusMessage = response.statusText; + response.headers.forEach(function(header, key) { + self2.headers[key.toLowerCase()] = header; + self2.rawHeaders.push(key, header); + }); + if (capability.writableStream) { + var writable = new WritableStream({ + write: function(chunk2) { + resetTimers(false); + return new Promise(function(resolve3, reject2) { + if (self2._destroyed) { + reject2(); + } else if (self2.push(Buffer4.from(chunk2))) { + resolve3(); + } else { + self2._resumeFetch = resolve3; + } + }); + }, + close: function() { + resetTimers(true); + if (!self2._destroyed) + self2.push(null); + }, + abort: function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + } + }); + try { + response.body.pipeTo(writable).catch(function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + }); + return; + } catch (e10) { + } + } + var reader = response.body.getReader(); + read(); + } else { + self2._xhr = xhr; + self2._pos = 0; + self2.url = xhr.responseURL; + self2.statusCode = xhr.status; + self2.statusMessage = xhr.statusText; + var headers = xhr.getAllResponseHeaders().split(/\r?\n/); + headers.forEach(function(header) { + var matches2 = header.match(/^([^:]+):\s*(.*)/); + if (matches2) { + var key = matches2[1].toLowerCase(); + if (key === "set-cookie") { + if (self2.headers[key] === void 0) { + self2.headers[key] = []; + } + self2.headers[key].push(matches2[2]); + } else if (self2.headers[key] !== void 0) { + self2.headers[key] += ", " + matches2[2]; + } else { + self2.headers[key] = matches2[2]; + } + self2.rawHeaders.push(matches2[1], matches2[2]); + } + }); + self2._charset = "x-user-defined"; + if (!capability.overrideMimeType) { + var mimeType = self2.rawHeaders["mime-type"]; + if (mimeType) { + var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/); + if (charsetMatch) { + self2._charset = charsetMatch[1].toLowerCase(); + } + } + if (!self2._charset) + self2._charset = "utf-8"; + } + } + }; + inherits2(IncomingMessage3, stream2.Readable); + IncomingMessage3.prototype._read = function() { + var self2 = this || _global$25; + var resolve3 = self2._resumeFetch; + if (resolve3) { + self2._resumeFetch = null; + resolve3(); + } + }; + IncomingMessage3.prototype._onXHRProgress = function(resetTimers) { + var self2 = this || _global$25; + var xhr = self2._xhr; + var response = null; + switch (self2._mode) { + case "text": + response = xhr.responseText; + if (response.length > self2._pos) { + var newData = response.substr(self2._pos); + if (self2._charset === "x-user-defined") { + var buffer2 = Buffer4.alloc(newData.length); + for (var i7 = 0; i7 < newData.length; i7++) + buffer2[i7] = newData.charCodeAt(i7) & 255; + self2.push(buffer2); + } else { + self2.push(newData, self2._charset); + } + self2._pos = response.length; + } + break; + case "arraybuffer": + if (xhr.readyState !== rStates.DONE || !xhr.response) + break; + response = xhr.response; + self2.push(Buffer4.from(new Uint8Array(response))); + break; + case "moz-chunked-arraybuffer": + response = xhr.response; + if (xhr.readyState !== rStates.LOADING || !response) + break; + self2.push(Buffer4.from(new Uint8Array(response))); + break; + case "ms-stream": + response = xhr.response; + if (xhr.readyState !== rStates.LOADING) + break; + var reader = new _global$25.MSStreamReader(); + reader.onprogress = function() { + if (reader.result.byteLength > self2._pos) { + self2.push(Buffer4.from(new Uint8Array(reader.result.slice(self2._pos)))); + self2._pos = reader.result.byteLength; + } + }; + reader.onload = function() { + resetTimers(true); + self2.push(null); + }; + reader.readAsArrayBuffer(response); + break; + } + if (self2._xhr.readyState === rStates.DONE && self2._mode !== "ms-stream") { + resetTimers(true); + self2.push(null); + } + }; + return exports$58; +} +function dew$313() { + if (_dewExec$313) + return exports$48; + _dewExec$313 = true; + var Buffer4 = dew().Buffer; + var process$1 = process3; + var capability = dew$k4(); + var inherits2 = dew4(); + var response = dew$48(); + var stream2 = dew$58(); + var IncomingMessage3 = response.IncomingMessage; + var rStates = response.readyStates; + function decideMode(preferBinary, useFetch) { + if (capability.fetch && useFetch) { + return "fetch"; + } else if (capability.mozchunkedarraybuffer) { + return "moz-chunked-arraybuffer"; + } else if (capability.msstream) { + return "ms-stream"; + } else if (capability.arraybuffer && preferBinary) { + return "arraybuffer"; + } else { + return "text"; + } + } + var ClientRequest3 = exports$48 = function(opts) { + var self2 = this || _global$112; + stream2.Writable.call(self2); + self2._opts = opts; + self2._body = []; + self2._headers = {}; + if (opts.auth) + self2.setHeader("Authorization", "Basic " + Buffer4.from(opts.auth).toString("base64")); + Object.keys(opts.headers).forEach(function(name2) { + self2.setHeader(name2, opts.headers[name2]); + }); + var preferBinary; + var useFetch = true; + if (opts.mode === "disable-fetch" || "requestTimeout" in opts && !capability.abortController) { + useFetch = false; + preferBinary = true; + } else if (opts.mode === "prefer-streaming") { + preferBinary = false; + } else if (opts.mode === "allow-wrong-content-type") { + preferBinary = !capability.overrideMimeType; + } else if (!opts.mode || opts.mode === "default" || opts.mode === "prefer-fast") { + preferBinary = true; + } else { + throw new Error("Invalid value for opts.mode"); + } + self2._mode = decideMode(preferBinary, useFetch); + self2._fetchTimer = null; + self2._socketTimeout = null; + self2._socketTimer = null; + self2.on("finish", function() { + self2._onFinish(); + }); + }; + inherits2(ClientRequest3, stream2.Writable); + ClientRequest3.prototype.setHeader = function(name2, value2) { + var self2 = this || _global$112; + var lowerName = name2.toLowerCase(); + if (unsafeHeaders.indexOf(lowerName) !== -1) + return; + self2._headers[lowerName] = { + name: name2, + value: value2 + }; + }; + ClientRequest3.prototype.getHeader = function(name2) { + var header = (this || _global$112)._headers[name2.toLowerCase()]; + if (header) + return header.value; + return null; + }; + ClientRequest3.prototype.removeHeader = function(name2) { + var self2 = this || _global$112; + delete self2._headers[name2.toLowerCase()]; + }; + ClientRequest3.prototype._onFinish = function() { + var self2 = this || _global$112; + if (self2._destroyed) + return; + var opts = self2._opts; + if ("timeout" in opts && opts.timeout !== 0) { + self2.setTimeout(opts.timeout); + } + var headersObj = self2._headers; + var body = null; + if (opts.method !== "GET" && opts.method !== "HEAD") { + body = new Blob(self2._body, { + type: (headersObj["content-type"] || {}).value || "" + }); + } + var headersList = []; + Object.keys(headersObj).forEach(function(keyName) { + var name2 = headersObj[keyName].name; + var value2 = headersObj[keyName].value; + if (Array.isArray(value2)) { + value2.forEach(function(v8) { + headersList.push([name2, v8]); + }); + } else { + headersList.push([name2, value2]); + } + }); + if (self2._mode === "fetch") { + var signal = null; + if (capability.abortController) { + var controller = new AbortController(); + signal = controller.signal; + self2._fetchAbortController = controller; + if ("requestTimeout" in opts && opts.requestTimeout !== 0) { + self2._fetchTimer = _global$112.setTimeout(function() { + self2.emit("requestTimeout"); + if (self2._fetchAbortController) + self2._fetchAbortController.abort(); + }, opts.requestTimeout); + } + } + _global$112.fetch(self2._opts.url, { + method: self2._opts.method, + headers: headersList, + body: body || void 0, + mode: "cors", + credentials: opts.withCredentials ? "include" : "same-origin", + signal + }).then(function(response2) { + self2._fetchResponse = response2; + self2._resetTimers(false); + self2._connect(); + }, function(reason) { + self2._resetTimers(true); + if (!self2._destroyed) + self2.emit("error", reason); + }); + } else { + var xhr = self2._xhr = new _global$112.XMLHttpRequest(); + try { + xhr.open(self2._opts.method, self2._opts.url, true); + } catch (err) { + process$1.nextTick(function() { + self2.emit("error", err); + }); + return; + } + if ("responseType" in xhr) + xhr.responseType = self2._mode; + if ("withCredentials" in xhr) + xhr.withCredentials = !!opts.withCredentials; + if (self2._mode === "text" && "overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + if ("requestTimeout" in opts) { + xhr.timeout = opts.requestTimeout; + xhr.ontimeout = function() { + self2.emit("requestTimeout"); + }; + } + headersList.forEach(function(header) { + xhr.setRequestHeader(header[0], header[1]); + }); + self2._response = null; + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case rStates.LOADING: + case rStates.DONE: + self2._onXHRProgress(); + break; + } + }; + if (self2._mode === "moz-chunked-arraybuffer") { + xhr.onprogress = function() { + self2._onXHRProgress(); + }; + } + xhr.onerror = function() { + if (self2._destroyed) + return; + self2._resetTimers(true); + self2.emit("error", new Error("XHR error")); + }; + try { + xhr.send(body); + } catch (err) { + process$1.nextTick(function() { + self2.emit("error", err); + }); + return; + } + } + }; + function statusValid(xhr) { + try { + var status = xhr.status; + return status !== null && status !== 0; + } catch (e10) { + return false; + } + } + ClientRequest3.prototype._onXHRProgress = function() { + var self2 = this || _global$112; + self2._resetTimers(false); + if (!statusValid(self2._xhr) || self2._destroyed) + return; + if (!self2._response) + self2._connect(); + self2._response._onXHRProgress(self2._resetTimers.bind(self2)); + }; + ClientRequest3.prototype._connect = function() { + var self2 = this || _global$112; + if (self2._destroyed) + return; + self2._response = new IncomingMessage3(self2._xhr, self2._fetchResponse, self2._mode, self2._resetTimers.bind(self2)); + self2._response.on("error", function(err) { + self2.emit("error", err); + }); + self2.emit("response", self2._response); + }; + ClientRequest3.prototype._write = function(chunk2, encoding, cb) { + var self2 = this || _global$112; + self2._body.push(chunk2); + cb(); + }; + ClientRequest3.prototype._resetTimers = function(done) { + var self2 = this || _global$112; + _global$112.clearTimeout(self2._socketTimer); + self2._socketTimer = null; + if (done) { + _global$112.clearTimeout(self2._fetchTimer); + self2._fetchTimer = null; + } else if (self2._socketTimeout) { + self2._socketTimer = _global$112.setTimeout(function() { + self2.emit("timeout"); + }, self2._socketTimeout); + } + }; + ClientRequest3.prototype.abort = ClientRequest3.prototype.destroy = function(err) { + var self2 = this || _global$112; + self2._destroyed = true; + self2._resetTimers(true); + if (self2._response) + self2._response._destroyed = true; + if (self2._xhr) + self2._xhr.abort(); + else if (self2._fetchAbortController) + self2._fetchAbortController.abort(); + if (err) + self2.emit("error", err); + }; + ClientRequest3.prototype.end = function(data, encoding, cb) { + var self2 = this || _global$112; + if (typeof data === "function") { + cb = data; + data = void 0; + } + stream2.Writable.prototype.end.call(self2, data, encoding, cb); + }; + ClientRequest3.prototype.setTimeout = function(timeout, cb) { + var self2 = this || _global$112; + if (cb) + self2.once("timeout", cb); + self2._socketTimeout = timeout; + self2._resetTimers(false); + }; + ClientRequest3.prototype.flushHeaders = function() { + }; + ClientRequest3.prototype.setNoDelay = function() { + }; + ClientRequest3.prototype.setSocketKeepAlive = function() { + }; + var unsafeHeaders = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"]; + return exports$48; +} +function dew$213() { + if (_dewExec$213) + return exports$313; + _dewExec$213 = true; + exports$313 = extend3; + var hasOwnProperty27 = Object.prototype.hasOwnProperty; + function extend3() { + var target = {}; + for (var i7 = 0; i7 < arguments.length; i7++) { + var source = arguments[i7]; + for (var key in source) { + if (hasOwnProperty27.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + } + return exports$313; +} +function dew$114() { + if (_dewExec$114) + return exports$214; + _dewExec$114 = true; + exports$214 = { + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Unordered Collection", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" + }; + return exports$214; +} +function dew21() { + if (_dewExec21) + return exports$117; + _dewExec21 = true; + var ClientRequest3 = dew$313(); + var response = dew$48(); + var extend3 = dew$213(); + var statusCodes = dew$114(); + var url = h7; + var http = exports$117; + http.request = function(opts, cb) { + if (typeof opts === "string") + opts = url.parse(opts); + else + opts = extend3(opts); + var defaultProtocol = _global10.location.protocol.search(/^https?:$/) === -1 ? "http:" : ""; + var protocol = opts.protocol || defaultProtocol; + var host = opts.hostname || opts.host; + var port = opts.port; + var path2 = opts.path || "/"; + if (host && host.indexOf(":") !== -1) + host = "[" + host + "]"; + opts.url = (host ? protocol + "//" + host : "") + (port ? ":" + port : "") + path2; + opts.method = (opts.method || "GET").toUpperCase(); + opts.headers = opts.headers || {}; + var req = new ClientRequest3(opts); + if (cb) + req.on("response", cb); + return req; + }; + http.get = function get4(opts, cb) { + var req = http.request(opts, cb); + req.end(); + return req; + }; + http.ClientRequest = ClientRequest3; + http.IncomingMessage = response.IncomingMessage; + http.Agent = function() { + }; + http.Agent.defaultMaxSockets = 4; + http.globalAgent = new http.Agent(); + http.STATUS_CODES = statusCodes; + http.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"]; + return exports$117; +} +var exports$l3, _dewExec$k4, _global$52, exports$k4, _dewExec$j4, exports$j4, _dewExec$i4, exports$i4, _dewExec$h4, exports$h4, _dewExec$g5, exports$g5, _dewExec$f5, exports$f5, _dewExec$e5, _global$42, exports$e5, _dewExec$d5, exports$d6, _dewExec$c6, exports$c7, _dewExec$b7, exports$b7, _dewExec$a7, exports$a7, _dewExec$97, _global$32, exports$97, _dewExec$87, exports$88, _dewExec$78, exports$78, _dewExec$68, exports$68, _dewExec$58, exports$58, _dewExec$48, _global$25, exports$48, _dewExec$313, _global$112, exports$313, _dewExec$213, exports$214, _dewExec$114, exports$117, _dewExec21, _global10, exports24, Agent, ClientRequest, IncomingMessage, METHODS, STATUS_CODES, get2, globalAgent, request; +var init_http = __esm({ + "node_modules/@jspm/core/nodelibs/browser/http.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_CkFCi_G1(); + init_chunk_DtDiafJB(); + init_chunk_tHuMsdT0(); + init_chunk_DtuTasat(); + init_chunk_CbQqNoLO(); + init_chunk_D3uu3VYh(); + init_chunk_DEMDiNwt(); + init_chunk_BsRZ0PEC(); + init_chunk_CcCWfKp1(); + init_chunk_DHWh_hmB(); + init_chunk_b0rmRow7(); + exports$l3 = {}; + _dewExec$k4 = false; + _global$52 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$k4 = {}; + _dewExec$j4 = false; + exports$j4 = {}; + _dewExec$i4 = false; + exports$i4 = {}; + _dewExec$h4 = false; + exports$h4 = {}; + _dewExec$g5 = false; + exports$g5 = {}; + _dewExec$f5 = false; + exports$f5 = {}; + _dewExec$e5 = false; + _global$42 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$e5 = {}; + _dewExec$d5 = false; + exports$d6 = {}; + _dewExec$c6 = false; + exports$c7 = {}; + _dewExec$b7 = false; + exports$b7 = {}; + _dewExec$a7 = false; + exports$a7 = {}; + _dewExec$97 = false; + _global$32 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$97 = {}; + _dewExec$87 = false; + exports$88 = {}; + _dewExec$78 = false; + exports$78 = {}; + _dewExec$68 = false; + exports$68 = {}; + _dewExec$58 = false; + exports$58 = {}; + _dewExec$48 = false; + _global$25 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$48 = {}; + _dewExec$313 = false; + _global$112 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$313 = {}; + _dewExec$213 = false; + exports$214 = {}; + _dewExec$114 = false; + exports$117 = {}; + _dewExec21 = false; + _global10 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports24 = dew21(); + Agent = exports24.Agent; + ClientRequest = exports24.ClientRequest; + IncomingMessage = exports24.IncomingMessage; + METHODS = exports24.METHODS; + STATUS_CODES = exports24.STATUS_CODES; + get2 = exports24.get; + globalAgent = exports24.globalAgent; + request = exports24.request; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/https.js +var https_exports = {}; +__export(https_exports, { + Agent: () => Agent2, + ClientRequest: () => ClientRequest2, + IncomingMessage: () => IncomingMessage2, + METHODS: () => METHODS2, + STATUS_CODES: () => STATUS_CODES2, + default: () => exports25, + get: () => get3, + globalAgent: () => globalAgent2, + request: () => request2 +}); +function dew$59() { + if (_dewExec$59) + return exports$69; + _dewExec$59 = true; + exports$69.fetch = isFunction3(_global$33.fetch) && isFunction3(_global$33.ReadableStream); + exports$69.writableStream = isFunction3(_global$33.WritableStream); + exports$69.abortController = isFunction3(_global$33.AbortController); + var xhr; + function getXHR() { + if (xhr !== void 0) + return xhr; + if (_global$33.XMLHttpRequest) { + xhr = new _global$33.XMLHttpRequest(); + try { + xhr.open("GET", _global$33.XDomainRequest ? "/" : "https://example.com"); + } catch (e10) { + xhr = null; + } + } else { + xhr = null; + } + return xhr; + } + function checkTypeSupport(type3) { + var xhr2 = getXHR(); + if (!xhr2) + return false; + try { + xhr2.responseType = type3; + return xhr2.responseType === type3; + } catch (e10) { + } + return false; + } + exports$69.arraybuffer = exports$69.fetch || checkTypeSupport("arraybuffer"); + exports$69.msstream = !exports$69.fetch && checkTypeSupport("ms-stream"); + exports$69.mozchunkedarraybuffer = !exports$69.fetch && checkTypeSupport("moz-chunked-arraybuffer"); + exports$69.overrideMimeType = exports$69.fetch || (getXHR() ? isFunction3(getXHR().overrideMimeType) : false); + function isFunction3(value2) { + return typeof value2 === "function"; + } + xhr = null; + return exports$69; +} +function dew$49() { + if (_dewExec$49) + return exports$59; + _dewExec$49 = true; + var Buffer4 = buffer.Buffer; + var process$1 = process4; + var capability = dew$59(); + var inherits2 = dew$f2(); + var stream2 = dew12(); + var rStates = exports$59.readyStates = { + UNSENT: 0, + OPENED: 1, + HEADERS_RECEIVED: 2, + LOADING: 3, + DONE: 4 + }; + var IncomingMessage3 = exports$59.IncomingMessage = function(xhr, response, mode, resetTimers) { + var self2 = this || _global$26; + stream2.Readable.call(self2); + self2._mode = mode; + self2.headers = {}; + self2.rawHeaders = []; + self2.trailers = {}; + self2.rawTrailers = []; + self2.on("end", function() { + process$1.nextTick(function() { + self2.emit("close"); + }); + }); + if (mode === "fetch") { + let read = function() { + reader.read().then(function(result2) { + if (self2._destroyed) + return; + resetTimers(result2.done); + if (result2.done) { + self2.push(null); + return; + } + self2.push(Buffer4.from(result2.value)); + read(); + }).catch(function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + }); + }; + self2._fetchResponse = response; + self2.url = response.url; + self2.statusCode = response.status; + self2.statusMessage = response.statusText; + response.headers.forEach(function(header, key) { + self2.headers[key.toLowerCase()] = header; + self2.rawHeaders.push(key, header); + }); + if (capability.writableStream) { + var writable = new WritableStream({ + write: function(chunk2) { + resetTimers(false); + return new Promise(function(resolve3, reject2) { + if (self2._destroyed) { + reject2(); + } else if (self2.push(Buffer4.from(chunk2))) { + resolve3(); + } else { + self2._resumeFetch = resolve3; + } + }); + }, + close: function() { + resetTimers(true); + if (!self2._destroyed) + self2.push(null); + }, + abort: function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + } + }); + try { + response.body.pipeTo(writable).catch(function(err) { + resetTimers(true); + if (!self2._destroyed) + self2.emit("error", err); + }); + return; + } catch (e10) { + } + } + var reader = response.body.getReader(); + read(); + } else { + self2._xhr = xhr; + self2._pos = 0; + self2.url = xhr.responseURL; + self2.statusCode = xhr.status; + self2.statusMessage = xhr.statusText; + var headers = xhr.getAllResponseHeaders().split(/\r?\n/); + headers.forEach(function(header) { + var matches2 = header.match(/^([^:]+):\s*(.*)/); + if (matches2) { + var key = matches2[1].toLowerCase(); + if (key === "set-cookie") { + if (self2.headers[key] === void 0) { + self2.headers[key] = []; + } + self2.headers[key].push(matches2[2]); + } else if (self2.headers[key] !== void 0) { + self2.headers[key] += ", " + matches2[2]; + } else { + self2.headers[key] = matches2[2]; + } + self2.rawHeaders.push(matches2[1], matches2[2]); + } + }); + self2._charset = "x-user-defined"; + if (!capability.overrideMimeType) { + var mimeType = self2.rawHeaders["mime-type"]; + if (mimeType) { + var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/); + if (charsetMatch) { + self2._charset = charsetMatch[1].toLowerCase(); + } + } + if (!self2._charset) + self2._charset = "utf-8"; + } + } + }; + inherits2(IncomingMessage3, stream2.Readable); + IncomingMessage3.prototype._read = function() { + var self2 = this || _global$26; + var resolve3 = self2._resumeFetch; + if (resolve3) { + self2._resumeFetch = null; + resolve3(); + } + }; + IncomingMessage3.prototype._onXHRProgress = function(resetTimers) { + var self2 = this || _global$26; + var xhr = self2._xhr; + var response = null; + switch (self2._mode) { + case "text": + response = xhr.responseText; + if (response.length > self2._pos) { + var newData = response.substr(self2._pos); + if (self2._charset === "x-user-defined") { + var buffer2 = Buffer4.alloc(newData.length); + for (var i7 = 0; i7 < newData.length; i7++) + buffer2[i7] = newData.charCodeAt(i7) & 255; + self2.push(buffer2); + } else { + self2.push(newData, self2._charset); + } + self2._pos = response.length; + } + break; + case "arraybuffer": + if (xhr.readyState !== rStates.DONE || !xhr.response) + break; + response = xhr.response; + self2.push(Buffer4.from(new Uint8Array(response))); + break; + case "moz-chunked-arraybuffer": + response = xhr.response; + if (xhr.readyState !== rStates.LOADING || !response) + break; + self2.push(Buffer4.from(new Uint8Array(response))); + break; + case "ms-stream": + response = xhr.response; + if (xhr.readyState !== rStates.LOADING) + break; + var reader = new _global$26.MSStreamReader(); + reader.onprogress = function() { + if (reader.result.byteLength > self2._pos) { + self2.push(Buffer4.from(new Uint8Array(reader.result.slice(self2._pos)))); + self2._pos = reader.result.byteLength; + } + }; + reader.onload = function() { + resetTimers(true); + self2.push(null); + }; + reader.readAsArrayBuffer(response); + break; + } + if (self2._xhr.readyState === rStates.DONE && self2._mode !== "ms-stream") { + resetTimers(true); + self2.push(null); + } + }; + return exports$59; +} +function dew$314() { + if (_dewExec$314) + return exports$49; + _dewExec$314 = true; + var Buffer4 = buffer.Buffer; + var process$1 = process4; + var capability = dew$59(); + var inherits2 = dew$f2(); + var response = dew$49(); + var stream2 = dew12(); + var IncomingMessage3 = response.IncomingMessage; + var rStates = response.readyStates; + function decideMode(preferBinary, useFetch) { + if (capability.fetch && useFetch) { + return "fetch"; + } else if (capability.mozchunkedarraybuffer) { + return "moz-chunked-arraybuffer"; + } else if (capability.msstream) { + return "ms-stream"; + } else if (capability.arraybuffer && preferBinary) { + return "arraybuffer"; + } else { + return "text"; + } + } + var ClientRequest3 = exports$49 = function(opts) { + var self2 = this || _global$113; + stream2.Writable.call(self2); + self2._opts = opts; + self2._body = []; + self2._headers = {}; + if (opts.auth) + self2.setHeader("Authorization", "Basic " + Buffer4.from(opts.auth).toString("base64")); + Object.keys(opts.headers).forEach(function(name2) { + self2.setHeader(name2, opts.headers[name2]); + }); + var preferBinary; + var useFetch = true; + if (opts.mode === "disable-fetch" || "requestTimeout" in opts && !capability.abortController) { + useFetch = false; + preferBinary = true; + } else if (opts.mode === "prefer-streaming") { + preferBinary = false; + } else if (opts.mode === "allow-wrong-content-type") { + preferBinary = !capability.overrideMimeType; + } else if (!opts.mode || opts.mode === "default" || opts.mode === "prefer-fast") { + preferBinary = true; + } else { + throw new Error("Invalid value for opts.mode"); + } + self2._mode = decideMode(preferBinary, useFetch); + self2._fetchTimer = null; + self2._socketTimeout = null; + self2._socketTimer = null; + self2.on("finish", function() { + self2._onFinish(); + }); + }; + inherits2(ClientRequest3, stream2.Writable); + ClientRequest3.prototype.setHeader = function(name2, value2) { + var self2 = this || _global$113; + var lowerName = name2.toLowerCase(); + if (unsafeHeaders.indexOf(lowerName) !== -1) + return; + self2._headers[lowerName] = { + name: name2, + value: value2 + }; + }; + ClientRequest3.prototype.getHeader = function(name2) { + var header = (this || _global$113)._headers[name2.toLowerCase()]; + if (header) + return header.value; + return null; + }; + ClientRequest3.prototype.removeHeader = function(name2) { + var self2 = this || _global$113; + delete self2._headers[name2.toLowerCase()]; + }; + ClientRequest3.prototype._onFinish = function() { + var self2 = this || _global$113; + if (self2._destroyed) + return; + var opts = self2._opts; + if ("timeout" in opts && opts.timeout !== 0) { + self2.setTimeout(opts.timeout); + } + var headersObj = self2._headers; + var body = null; + if (opts.method !== "GET" && opts.method !== "HEAD") { + body = new Blob(self2._body, { + type: (headersObj["content-type"] || {}).value || "" + }); + } + var headersList = []; + Object.keys(headersObj).forEach(function(keyName) { + var name2 = headersObj[keyName].name; + var value2 = headersObj[keyName].value; + if (Array.isArray(value2)) { + value2.forEach(function(v8) { + headersList.push([name2, v8]); + }); + } else { + headersList.push([name2, value2]); + } + }); + if (self2._mode === "fetch") { + var signal = null; + if (capability.abortController) { + var controller = new AbortController(); + signal = controller.signal; + self2._fetchAbortController = controller; + if ("requestTimeout" in opts && opts.requestTimeout !== 0) { + self2._fetchTimer = _global$113.setTimeout(function() { + self2.emit("requestTimeout"); + if (self2._fetchAbortController) + self2._fetchAbortController.abort(); + }, opts.requestTimeout); + } + } + _global$113.fetch(self2._opts.url, { + method: self2._opts.method, + headers: headersList, + body: body || void 0, + mode: "cors", + credentials: opts.withCredentials ? "include" : "same-origin", + signal + }).then(function(response2) { + self2._fetchResponse = response2; + self2._resetTimers(false); + self2._connect(); + }, function(reason) { + self2._resetTimers(true); + if (!self2._destroyed) + self2.emit("error", reason); + }); + } else { + var xhr = self2._xhr = new _global$113.XMLHttpRequest(); + try { + xhr.open(self2._opts.method, self2._opts.url, true); + } catch (err) { + process$1.nextTick(function() { + self2.emit("error", err); + }); + return; + } + if ("responseType" in xhr) + xhr.responseType = self2._mode; + if ("withCredentials" in xhr) + xhr.withCredentials = !!opts.withCredentials; + if (self2._mode === "text" && "overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + if ("requestTimeout" in opts) { + xhr.timeout = opts.requestTimeout; + xhr.ontimeout = function() { + self2.emit("requestTimeout"); + }; + } + headersList.forEach(function(header) { + xhr.setRequestHeader(header[0], header[1]); + }); + self2._response = null; + xhr.onreadystatechange = function() { + switch (xhr.readyState) { + case rStates.LOADING: + case rStates.DONE: + self2._onXHRProgress(); + break; + } + }; + if (self2._mode === "moz-chunked-arraybuffer") { + xhr.onprogress = function() { + self2._onXHRProgress(); + }; + } + xhr.onerror = function() { + if (self2._destroyed) + return; + self2._resetTimers(true); + self2.emit("error", new Error("XHR error")); + }; + try { + xhr.send(body); + } catch (err) { + process$1.nextTick(function() { + self2.emit("error", err); + }); + return; + } + } + }; + function statusValid(xhr) { + try { + var status = xhr.status; + return status !== null && status !== 0; + } catch (e10) { + return false; + } + } + ClientRequest3.prototype._onXHRProgress = function() { + var self2 = this || _global$113; + self2._resetTimers(false); + if (!statusValid(self2._xhr) || self2._destroyed) + return; + if (!self2._response) + self2._connect(); + self2._response._onXHRProgress(self2._resetTimers.bind(self2)); + }; + ClientRequest3.prototype._connect = function() { + var self2 = this || _global$113; + if (self2._destroyed) + return; + self2._response = new IncomingMessage3(self2._xhr, self2._fetchResponse, self2._mode, self2._resetTimers.bind(self2)); + self2._response.on("error", function(err) { + self2.emit("error", err); + }); + self2.emit("response", self2._response); + }; + ClientRequest3.prototype._write = function(chunk2, encoding, cb) { + var self2 = this || _global$113; + self2._body.push(chunk2); + cb(); + }; + ClientRequest3.prototype._resetTimers = function(done) { + var self2 = this || _global$113; + _global$113.clearTimeout(self2._socketTimer); + self2._socketTimer = null; + if (done) { + _global$113.clearTimeout(self2._fetchTimer); + self2._fetchTimer = null; + } else if (self2._socketTimeout) { + self2._socketTimer = _global$113.setTimeout(function() { + self2.emit("timeout"); + }, self2._socketTimeout); + } + }; + ClientRequest3.prototype.abort = ClientRequest3.prototype.destroy = function(err) { + var self2 = this || _global$113; + self2._destroyed = true; + self2._resetTimers(true); + if (self2._response) + self2._response._destroyed = true; + if (self2._xhr) + self2._xhr.abort(); + else if (self2._fetchAbortController) + self2._fetchAbortController.abort(); + if (err) + self2.emit("error", err); + }; + ClientRequest3.prototype.end = function(data, encoding, cb) { + var self2 = this || _global$113; + if (typeof data === "function") { + cb = data; + data = void 0; + } + stream2.Writable.prototype.end.call(self2, data, encoding, cb); + }; + ClientRequest3.prototype.setTimeout = function(timeout, cb) { + var self2 = this || _global$113; + if (cb) + self2.once("timeout", cb); + self2._socketTimeout = timeout; + self2._resetTimers(false); + }; + ClientRequest3.prototype.flushHeaders = function() { + }; + ClientRequest3.prototype.setNoDelay = function() { + }; + ClientRequest3.prototype.setSocketKeepAlive = function() { + }; + var unsafeHeaders = ["accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "date", "dnt", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "via"]; + return exports$49; +} +function dew$214() { + if (_dewExec$214) + return exports$314; + _dewExec$214 = true; + exports$314 = extend3; + var hasOwnProperty27 = Object.prototype.hasOwnProperty; + function extend3() { + var target = {}; + for (var i7 = 0; i7 < arguments.length; i7++) { + var source = arguments[i7]; + for (var key in source) { + if (hasOwnProperty27.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + } + return exports$314; +} +function dew$115() { + if (_dewExec$115) + return exports$215; + _dewExec$115 = true; + exports$215 = { + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Unordered Collection", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" + }; + return exports$215; +} +function dew$69() { + if (_dewExec$69) + return exports$1$13; + _dewExec$69 = true; + var ClientRequest3 = dew$314(); + var response = dew$49(); + var extend3 = dew$214(); + var statusCodes = dew$115(); + var url = h7; + var http = exports$1$13; + http.request = function(opts, cb) { + if (typeof opts === "string") + opts = url.parse(opts); + else + opts = extend3(opts); + var defaultProtocol = _global$43.location.protocol.search(/^https?:$/) === -1 ? "http:" : ""; + var protocol = opts.protocol || defaultProtocol; + var host = opts.hostname || opts.host; + var port = opts.port; + var path2 = opts.path || "/"; + if (host && host.indexOf(":") !== -1) + host = "[" + host + "]"; + opts.url = (host ? protocol + "//" + host : "") + (port ? ":" + port : "") + path2; + opts.method = (opts.method || "GET").toUpperCase(); + opts.headers = opts.headers || {}; + var req = new ClientRequest3(opts); + if (cb) + req.on("response", cb); + return req; + }; + http.get = function get4(opts, cb) { + var req = http.request(opts, cb); + req.end(); + return req; + }; + http.ClientRequest = ClientRequest3; + http.IncomingMessage = response.IncomingMessage; + http.Agent = function() { + }; + http.Agent.defaultMaxSockets = 4; + http.globalAgent = new http.Agent(); + http.STATUS_CODES = statusCodes; + http.METHODS = ["CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "REPORT", "SEARCH", "SUBSCRIBE", "TRACE", "UNLOCK", "UNSUBSCRIBE"]; + return exports$1$13; +} +function dew22() { + if (_dewExec22) + return exports$118; + _dewExec22 = true; + var http = exports$79; + var url = h7; + var https = exports$118; + for (var key in http) { + if (http.hasOwnProperty(key)) + https[key] = http[key]; + } + https.request = function(params, cb) { + params = validateParams(params); + return http.request.call(this || _global11, params, cb); + }; + https.get = function(params, cb) { + params = validateParams(params); + return http.get.call(this || _global11, params, cb); + }; + function validateParams(params) { + if (typeof params === "string") { + params = url.parse(params); + } + if (!params.protocol) { + params.protocol = "https:"; + } + if (params.protocol !== "https:") { + throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"'); + } + return params; + } + return exports$118; +} +var exports$69, _dewExec$59, _global$33, exports$59, _dewExec$49, _global$26, exports$49, _dewExec$314, _global$113, exports$314, _dewExec$214, exports$215, _dewExec$115, exports$1$13, _dewExec$69, _global$43, exports$79, exports$118, _dewExec22, _global11, exports25, Agent2, ClientRequest2, IncomingMessage2, METHODS2, STATUS_CODES2, get3, globalAgent2, request2; +var init_https = __esm({ + "node_modules/@jspm/core/nodelibs/browser/https.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_B738Er4n(); + init_chunk_C4rKjYLo(); + init_chunk_b0rmRow7(); + init_chunk_DHWh_hmB(); + init_chunk_tHuMsdT0(); + init_chunk_D3uu3VYh(); + exports$69 = {}; + _dewExec$59 = false; + _global$33 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$59 = {}; + _dewExec$49 = false; + _global$26 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$49 = {}; + _dewExec$314 = false; + _global$113 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$314 = {}; + _dewExec$214 = false; + exports$215 = {}; + _dewExec$115 = false; + exports$1$13 = {}; + _dewExec$69 = false; + _global$43 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports$79 = dew$69(); + exports$79.Agent; + exports$79.ClientRequest; + exports$79.IncomingMessage; + exports$79.METHODS; + exports$79.STATUS_CODES; + exports$79.get; + exports$79.globalAgent; + exports$79.request; + exports$118 = {}; + _dewExec22 = false; + _global11 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports25 = dew22(); + Agent2 = exports25.Agent; + ClientRequest2 = exports25.ClientRequest; + IncomingMessage2 = exports25.IncomingMessage; + METHODS2 = exports25.METHODS; + STATUS_CODES2 = exports25.STATUS_CODES; + get3 = exports25.get; + globalAgent2 = exports25.globalAgent; + request2 = exports25.request; + } +}); + +// node_modules/webapi-parser/webapi-parser.js +var require_webapi_parser = __commonJS({ + "node_modules/webapi-parser/webapi-parser.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + Ajv = require_ajv4(); + var d7; + var aa = "object" === typeof __ScalaJSEnv && __ScalaJSEnv ? __ScalaJSEnv : {}; + var ba = "object" === typeof aa.global && aa.global ? aa.global : "object" === typeof globalThis && globalThis && globalThis.Object === Object ? globalThis : exports28; + aa.global = ba; + var n7 = exports28; + aa.exportsNamespace = n7; + ba.Object.freeze(aa); + var aaa = { envInfo: aa, semantics: { asInstanceOfs: 2, arrayIndexOutOfBounds: 2, moduleInit: 2, strictFloats: false, productionMode: true }, assumingES6: false, linkerVersion: "0.6.29", globalThis: exports28 }; + ba.Object.freeze(aaa); + ba.Object.freeze(aaa.semantics); + var ca = ba.Math.imul || function(a10, b10) { + var c10 = a10 & 65535, e10 = b10 & 65535; + return c10 * e10 + ((a10 >>> 16 & 65535) * e10 + c10 * (b10 >>> 16 & 65535) << 16 >>> 0) | 0; + }; + var da = ba.Math.fround || function(a10) { + return +a10; + }; + var ea = ba.Math.clz32 || function(a10) { + if (0 === a10) + return 32; + var b10 = 1; + 0 === (a10 & 4294901760) && (a10 <<= 16, b10 += 16); + 0 === (a10 & 4278190080) && (a10 <<= 8, b10 += 8); + 0 === (a10 & 4026531840) && (a10 <<= 4, b10 += 4); + 0 === (a10 & 3221225472) && (a10 <<= 2, b10 += 2); + return b10 + (a10 >> 31); + }; + var baa = 0; + var caa = ba.WeakMap ? new ba.WeakMap() : null; + function fa(a10) { + return function(b10, c10) { + return !(!b10 || !b10.$classData || b10.$classData.RN !== c10 || b10.$classData.QN !== a10); + }; + } + function daa(a10) { + for (var b10 in a10) + return b10; + } + function ha(a10, b10) { + return new a10.A9(b10); + } + function ja(a10, b10) { + return eaa(a10, b10, 0); + } + function eaa(a10, b10, c10) { + var e10 = new a10.A9(b10[c10]); + if (c10 < b10.length - 1) { + a10 = a10.$S; + c10 += 1; + for (var f10 = e10.n, g10 = 0; g10 < f10.length; g10++) + f10[g10] = eaa(a10, b10, c10); + } + return e10; + } + function ka(a10) { + return void 0 === a10 ? "undefined" : a10.toString(); + } + function la(a10) { + switch (typeof a10) { + case "string": + return q5(ma); + case "number": + var b10 = a10 | 0; + return b10 === a10 ? faa(b10) ? q5(gaa) : haa(b10) ? q5(iaa) : q5(jaa) : na(a10) ? q5(kaa) : q5(laa); + case "boolean": + return q5(maa); + case "undefined": + return q5(oa); + default: + return null === a10 ? a10.Ahb() : a10 instanceof qa ? q5(naa) : a10 && a10.$classData ? q5(a10.$classData) : null; + } + } + function ra(a10, b10) { + return a10 && a10.$classData || null === a10 ? a10.h(b10) : "number" === typeof a10 ? "number" === typeof b10 && (a10 === b10 ? 0 !== a10 || 1 / a10 === 1 / b10 : a10 !== a10 && b10 !== b10) : a10 === b10; + } + function sa(a10) { + switch (typeof a10) { + case "string": + return ta(ua(), a10); + case "number": + return oaa(paa(), a10); + case "boolean": + return a10 ? 1231 : 1237; + case "undefined": + return 0; + default: + return a10 && a10.$classData || null === a10 ? a10.z() : null === caa ? 42 : qaa(a10); + } + } + function raa(a10, b10) { + switch (typeof a10) { + case "string": + return a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + case "number": + return saa(va(), a10, b10); + case "boolean": + return a10 - b10; + default: + return a10.tr(b10); + } + } + function wa(a10) { + return "string" === typeof a10 ? a10.length | 0 : a10.Oa(); + } + function xa(a10, b10) { + return "string" === typeof a10 ? a10.charCodeAt(b10) & 65535 : a10.Hz(b10); + } + function ya(a10, b10, c10) { + return "string" === typeof a10 ? a10.substring(b10, c10) : a10.bI(b10, c10); + } + function za(a10) { + return "number" === typeof a10 ? a10 | 0 : a10.gH(); + } + function Aa(a10) { + return 2147483647 < a10 ? 2147483647 : -2147483648 > a10 ? -2147483648 : a10 | 0; + } + function Ba(a10, b10, c10, e10, f10) { + a10 = a10.n; + c10 = c10.n; + if (a10 !== c10 || e10 < b10 || (b10 + f10 | 0) < e10) + for (var g10 = 0; g10 < f10; g10 = g10 + 1 | 0) + c10[e10 + g10 | 0] = a10[b10 + g10 | 0]; + else + for (g10 = f10 - 1 | 0; 0 <= g10; g10 = g10 - 1 | 0) + c10[e10 + g10 | 0] = a10[b10 + g10 | 0]; + } + var qaa = null !== caa ? function(a10) { + switch (typeof a10) { + case "string": + case "number": + case "boolean": + case "undefined": + return sa(a10); + default: + if (null === a10) + return 0; + var b10 = caa.get(a10); + void 0 === b10 && (baa = b10 = baa + 1 | 0, caa.set(a10, b10)); + return b10; + } + } : function(a10) { + if (a10 && a10.$classData) { + var b10 = a10.$idHashCode$0; + if (void 0 !== b10) + return b10; + if (ba.Object.isSealed(a10)) + return 42; + baa = b10 = baa + 1 | 0; + return a10.$idHashCode$0 = b10; + } + return null === a10 ? 0 : sa(a10); + }; + function faa(a10) { + return "number" === typeof a10 && a10 << 24 >> 24 === a10 && 1 / a10 !== 1 / -0; + } + function haa(a10) { + return "number" === typeof a10 && a10 << 16 >> 16 === a10 && 1 / a10 !== 1 / -0; + } + function Ca(a10) { + return "number" === typeof a10 && (a10 | 0) === a10 && 1 / a10 !== 1 / -0; + } + function na(a10) { + return "number" === typeof a10; + } + function Da(a10) { + return null === a10 ? Ea().dl : a10; + } + function Fa() { + this.b2 = this.A9 = void 0; + this.QN = this.$S = this.ge = null; + this.RN = 0; + this.M3 = null; + this.Q_ = ""; + this.Xx = this.t_ = this.u_ = void 0; + this.name = ""; + this.isRawJSType = this.isArrayClass = this.isInterface = this.isPrimitive = false; + this.isInstance = void 0; + } + function Ga(a10, b10, c10) { + var e10 = new Fa(); + e10.ge = {}; + e10.$S = null; + e10.M3 = a10; + e10.Q_ = b10; + e10.Xx = function() { + return false; + }; + e10.name = c10; + e10.isPrimitive = true; + e10.isInstance = function() { + return false; + }; + return e10; + } + function r8(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new Fa(), m10 = daa(a10); + h10 = h10 || function(p10) { + return !!(p10 && p10.$classData && p10.$classData.ge[m10]); + }; + k10 = k10 || function(p10, t10) { + return !!(p10 && p10.$classData && p10.$classData.RN === t10 && p10.$classData.QN.ge[m10]); + }; + l10.b2 = g10; + l10.ge = e10; + l10.Q_ = "L" + c10 + ";"; + l10.Xx = k10; + l10.name = c10; + l10.isInterface = b10; + l10.isRawJSType = !!f10; + l10.isInstance = h10; + return l10; + } + function taa(a10) { + function b10(k10) { + if ("number" === typeof k10) { + this.n = Array(k10); + for (var l10 = 0; l10 < k10; l10++) + this.n[l10] = f10; + } else + this.n = k10; + } + var c10 = new Fa(), e10 = a10.M3, f10 = "longZero" == e10 ? Ea().dl : e10; + b10.prototype = new u7(); + b10.prototype.constructor = b10; + b10.prototype.$classData = c10; + e10 = "[" + a10.Q_; + var g10 = a10.QN || a10, h10 = a10.RN + 1; + c10.A9 = b10; + c10.b2 = Ha; + c10.ge = { f: 1, Jl: 1, o: 1 }; + c10.$S = a10; + c10.QN = g10; + c10.RN = h10; + c10.M3 = null; + c10.Q_ = e10; + c10.u_ = void 0; + c10.t_ = void 0; + c10.Xx = void 0; + c10.name = e10; + c10.isPrimitive = false; + c10.isInterface = false; + c10.isArrayClass = true; + c10.isInstance = function(k10) { + return g10.Xx(k10, h10); + }; + return c10; + } + function q5(a10) { + if (!a10.u_) { + var b10 = new Ia(); + b10.jg = a10; + a10.u_ = b10; + } + return a10.u_; + } + function Ja(a10) { + a10.t_ || (a10.t_ = taa(a10)); + return a10.t_; + } + Fa.prototype.getFakeInstance = function() { + if (this === ma) + return "some string"; + if (this === maa) + return false; + if (this === gaa || this === iaa || this === jaa || this === kaa || this === laa) + return 0; + if (this === naa) + return Ea().dl; + if (this !== oa) + return { $classData: this }; + }; + Fa.prototype.getSuperclass = function() { + return this.b2 ? q5(this.b2) : null; + }; + Fa.prototype.getComponentType = function() { + return this.$S ? q5(this.$S) : null; + }; + Fa.prototype.newArrayOfThisClass = function(a10) { + for (var b10 = this, c10 = 0; c10 < a10.length; c10++) + b10 = Ja(b10); + return ja(b10, a10); + }; + var Ka = Ga(void 0, "V", "void"); + var Ma = Ga(false, "Z", "boolean"); + var Na = Ga(0, "C", "char"); + var Oa = Ga(0, "B", "byte"); + var Pa = Ga(0, "S", "short"); + var Qa = Ga(0, "I", "int"); + var Ra = Ga("longZero", "J", "long"); + var Sa = Ga(0, "F", "float"); + var Ta = Ga(0, "D", "double"); + var uaa = fa(Ma); + Ma.Xx = uaa; + var vaa = fa(Na); + Na.Xx = vaa; + var waa = fa(Oa); + Oa.Xx = waa; + var xaa = fa(Pa); + Pa.Xx = xaa; + var yaa = fa(Qa); + Qa.Xx = yaa; + var zaa = fa(Ra); + Ra.Xx = zaa; + var Aaa = fa(Sa); + Sa.Xx = Aaa; + var Baa = fa(Ta); + Ta.Xx = Baa; + var Caa = (init_os(), __toCommonJS(os_exports)); + var Daa = (init_path(), __toCommonJS(path_exports)); + var Eaa = (init_http(), __toCommonJS(http_exports)); + var Faa = (init_https(), __toCommonJS(https_exports)); + var Gaa = (init_fs(), __toCommonJS(fs_exports)); + function Haa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.za); + } + function Ua(a10) { + return w6(/* @__PURE__ */ function(b10) { + return function(c10) { + if (null !== c10) { + var e10 = c10.ma(); + c10 = c10.ya(); + return b10.ug(e10, c10); + } + throw new x7().d(c10); + }; + }(a10)); + } + function Iaa(a10, b10) { + a10 = a10.Li; + if (a10.b()) + return false; + a10 = a10.c(); + return Va(Wa(), a10, b10); + } + function Xa(a10) { + a10 = a10.Li; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(ka(a10))); + return a10.b() ? null : a10.c(); + } + function Jaa(a10, b10) { + a10 = a10.Li; + if (a10.b()) + return false; + a10 = a10.c(); + return !!b10.P(a10); + } + function Ya(a10) { + return Za(a10.Oc()).na(); + } + function $a(a10) { + var b10 = ab(); + a10 = Za(a10.Oc()); + var c10 = ab().jr(); + return bb(b10, a10, c10).Ra(); + } + function cb(a10, b10) { + var c10 = a10.Oc(), e10 = db().ed; + eb(c10, e10, b10); + return a10; + } + function fb(a10) { + ab(); + a10 = B6(a10.Oc().Y(), db().ed); + ab().cb(); + return gb(a10); + } + function hb(a10, b10) { + var c10 = a10.Gj(); + a10 = ib(c10, a10); + b10.b() || (b10 = b10.c(), cb(a10, b10)); + return a10; + } + function ib(a10, b10) { + jb(a10.Oc(), b10.Oc()); + return a10; + } + function kb(a10) { + if (lb(a10)) + return a10.bc(); + throw mb(E6(), new nb().e("Missing metadata mapping for " + a10)); + } + function Kaa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.rc); + } + function pb(a10) { + var b10 = qb(), c10 = F6().Tb; + a10.Nk(rb(new sb(), b10, G5(c10, "description"), tb(new ub(), vb().Tb, "description", "Human readable description of an element", H10()))); + } + function Laa(a10) { + var b10 = qb(), c10 = F6().Tb; + a10.G8(rb(new sb(), b10, G5(c10, "displayName"), tb(new ub(), vb().Tb, "display name", "Human readable name for an entity", H10()))); + } + function wb(a10) { + var b10 = qb(), c10 = F6().Tb; + a10.Vl(rb(new sb(), b10, G5(c10, "name"), tb(new ub(), vb().Tb, "name", "Name of the shape", H10()))); + } + function xb(a10, b10) { + a10 = a10.Bu(); + if (a10.b()) + return false; + a10 = a10.c(); + return Va(Wa(), a10, b10); + } + function Maa(a10) { + a10 = a10.Bu(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(ka(a10))); + return a10.b() ? null : a10.c(); + } + function yb(a10) { + a10 = Ab(a10.fa(), q5(Bb)); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.da); + } + function Cb(a10, b10) { + a10.fa().Lb(b10); + return a10; + } + function Db(a10, b10) { + a10.fa().Sp(b10); + return a10; + } + function Eb(a10, b10, c10) { + var e10 = a10.XB.Ja(b10); + if (e10 instanceof z7) + e10 = e10.i; + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = J5(K7(), H10()); + } + e10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Hm = true; + h10.IN.P(g10); + }; + }(a10, c10))); + a10.XB.jm(b10, J5(K7(), H10())); + } + function Fb(a10) { + a10.XB.Ur().ps(Gb().si).Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + return !b10.Hm; + }; + }(a10))).U(w6(/* @__PURE__ */ function() { + return function(b10) { + b10.Hm = true; + Hb(b10.HN); + }; + }(a10))); + } + function Naa(a10, b10, c10) { + var e10 = a10.XB.Ja(b10); + if (e10 instanceof z7) + e10 = e10.i; + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = J5(K7(), H10()); + } + a10 = a10.XB; + c10 = J5(K7(), new Ib().ha([c10])); + var f10 = K7(); + a10.jm(b10, e10.ia(c10, f10.u)); + } + function Jb(a10, b10) { + a10.Je = new z7().d(b10); + } + function Oaa(a10, b10) { + var c10 = new Kb().lE(Paa()); + b10 = ka(b10); + a10 = "application/json" === a10 ? "application/ld+json" : a10; + Lb(c10).parse(b10, c10.xs, "", a10); + return new z7().d(new Mb().gU(c10)); + } + function Qaa(a10, b10) { + var c10 = new Kb().lE(Paa()); + Raa(new Nb().gU(c10), a10, b10); + return c10; + } + function Saa(a10) { + var b10 = new z7().d(a10.lastIndexOf(".") | 0); + b10 = 0 < (b10.i | 0) ? b10 : y7(); + if (b10.b()) + return y7(); + b10 = 1 + (b10.c() | 0) | 0; + return new z7().d(a10.substring(b10)); + } + function Taa(a10) { + return "json" === a10 ? new z7().d(Uaa().Bfa) : "yaml" === a10 || "yam" === a10 || "yml" === a10 ? new z7().d(Uaa().Ffa) : "raml" === a10 ? new z7().d(Uaa().Efa) : "openapi" === a10 ? new z7().d(Uaa().Dfa) : "jsonld" === a10 || "amf" === a10 ? new z7().d(Uaa().Cfa) : y7(); + } + function Vaa(a10) { + var b10 = Ob(); + a10 === b10 ? b10 = true : (b10 = Pb(), b10 = a10 === b10); + if (b10) + return true; + b10 = Qb(); + return a10 === b10; + } + function Waa(a10, b10, c10, e10) { + var f10 = b10.Ev(), g10 = F6().Pg.he; + 0 <= (f10.length | 0) && f10.substring(0, g10.length | 0) === g10 ? (f10 = b10.Ev(), g10 = F6().Pg.he, g10 = f10.split(g10).join("")) : g10 = b10.Ev(); + f10 = Rb(Sb(), H10()); + var h10 = e10.ev.Ja(g10); + if (h10 instanceof z7) + h10 = h10.i, f10.Ue(b10.Ev(), g10), g10 = new z7().d(h10); + else { + if (y7() !== h10) + throw new x7().d(h10); + h10 = e10.ev.mb(); + a: { + for (; h10.Ya(); ) { + var k10 = h10.$a(), l10 = k10; + if (null === l10) + throw new x7().d(l10); + l10 = l10.ma(); + if (0 <= (g10.length | 0) && g10.substring(0, l10.length | 0) === l10) { + k10 = new z7().d(k10); + break a; + } + } + k10 = y7(); + } + a: { + if (k10 instanceof z7 && (h10 = k10.i, null !== h10)) { + g10 = h10.ma(); + h10 = h10.ya(); + f10.Ue( + b10.Ev(), + g10 + ); + g10 = new z7().d(h10); + break a; + } + if (y7() === k10) { + if (!(0 <= (g10.length | 0) && "_:" === g10.substring(0, 2))) + throw mb(E6(), new nb().e("Cannot find validation spec for validation error:\n " + b10)); + g10 = y7(); + } else + throw new x7().d(k10); + } + } + if (g10 instanceof z7) { + g10 = g10.i; + Tb() === c10 ? (c10 = g10.yv, h10 = c10.b() ? g10.Ld : c10.c()) : Ub() === c10 ? (c10 = g10.vv, h10 = c10.b() ? g10.Ld : c10.c()) : (c10 = Vb().Ia(g10.Ld), c10.b() ? (c10 = b10.xL(), h10 = c10.b() ? "" : c10.c()) : h10 = c10.c()); + if (Vb().Ia(h10).b() || "" === h10) + c10 = b10.xL(), h10 = c10.b() ? "Constraint violation" : c10.c(); + Xaa(g10) && b10.xL().na() && (h10 = b10.xL().c()); + c10 = f10.P(b10.Ev()); + c10 = 0 <= (c10.length | 0) && "http" === c10.substring(0, 4) ? f10.P(b10.Ev()) : "" + F6().Pg.he + f10.P(b10.Ev()); + f10 = f10.P(b10.Ev()); + e10 = Yaa(f10, e10, ""); + Zaa || (Zaa = new Wb().a()); + g10 = Zaa; + f10 = h10; + h10 = b10.rO(); + a10 = $aa(a10, h10); + if (y7() === a10) + throw mb(E6(), new nb().e("Cannot find node with validation error " + b10.rO())); + if (a10 instanceof z7) { + h10 = a10.i; + g10 = aba(g10, h10, b10); + if (null === g10) + throw new x7().d(g10); + a10 = g10.ma(); + g10 = g10.ya(); + h10 = h10.j; + k10 = Vb().Ia(b10.TB()); + l10 = b10.Ev(); + b10 = Xb(f10, e10, h10, k10, l10, a10, g10, b10); + } else + throw new x7().d(a10); + return new z7().d(Xb(b10.Ld, b10.zm, b10.Iv, b10.jx, c10, b10.Fg, b10.da, b10.sy)); + } + return y7(); + } + function Yaa(a10, b10, c10) { + return b10.c1.Ja(a10).na() ? Yb().zx : b10.H3.Ja(a10).na() ? Yb().dh : b10.G3.Ja(a10).na() ? Yb().qb : bba(Yb(), c10); + } + function cba(a10) { + a10.UT(y7()); + a10.MU(false); + a10.PU(false); + } + function $b(a10, b10) { + var c10 = ac(new M6().W(a10), "@id"); + if (c10 instanceof z7) + return a10 = c10.i.i, b10 = bc(), c10 = cc().bi, new z7().d(N6(a10, b10, c10).va); + c10 = dc().C7; + var e10 = "No @id declaration on node " + a10, f10 = y7(); + ec(b10, c10, "", f10, e10, a10.da); + return y7(); + } + function dba(a10, b10) { + b10 = b10.S_; + return "" + (b10.b() ? "" : b10.c()) + a10; + } + function fc(a10, b10) { + b10 = b10.UJ.mb(); + a: { + for (; b10.Ya(); ) { + var c10 = b10.$a(), e10 = c10; + if (null === e10) + throw new x7().d(e10); + e10 = e10.ma(); + if (0 <= (a10.length | 0) && a10.substring(0, e10.length | 0) === e10) { + c10 = new z7().d(c10); + break a; + } + } + c10 = y7(); + } + if (c10 instanceof z7 && (b10 = c10.i, null !== b10)) + return c10 = b10.ma(), b10 = b10.ya(), a10.split("" + c10 + gc(58)).join(b10); + if (y7() === c10) + return a10; + throw new x7().d(c10); + } + function hc(a10, b10) { + b10 = b10.UJ.mb(); + a: { + for (; b10.Ya(); ) { + var c10 = b10.$a(), e10 = c10; + if (null === e10) + throw new x7().d(e10); + e10 = e10.ya(); + if (0 <= (a10.length | 0) && a10.substring(0, e10.length | 0) === e10) { + c10 = new z7().d(c10); + break a; + } + } + c10 = y7(); + } + if (c10 instanceof z7 && (b10 = c10.i, null !== b10)) + return c10 = b10.ma(), b10 = b10.ya(), c10 = "" + c10 + gc(58), a10.split(b10).join(c10); + if (y7() === c10) + return a10; + throw new x7().d(c10); + } + function eba(a10, b10, c10, e10) { + var f10 = J5(K7(), new Ib().ha(["Document", "Fragment", "Module", "Unit"])), g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + var l10 = F6().Zd; + return ic(G5(l10, k10)); + }; + }(a10)), h10 = K7(); + f10 = f10.ka(g10, h10.u); + g10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return hc(m10, l10); + }; + }(a10, e10)); + h10 = K7(); + g10 = f10.ka(g10, h10.u); + h10 = K7(); + f10 = f10.ia(g10, h10.u).xg(); + g10 = ac(new M6().W(b10), "@type"); + if (g10 instanceof z7) + return b10 = jc(kc(g10.i.i), lc()), b10 = b10.b() ? H10() : b10.c(), c10 = w6(/* @__PURE__ */ function() { + return function(k10) { + k10 = jc(kc(k10), bc()); + k10.b() ? k10 = y7() : (k10 = k10.c(), k10 = new z7().d(k10.va)); + return k10.ua(); + }; + }(a10)), e10 = K7(), c10 = b10.bd( + c10, + e10.u + ), b10 = c10.Cb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return !l10.Ha(m10); + }; + }(a10, f10))), a10 = c10.Cb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return l10.Ha(m10); + }; + }(a10, f10))).nk(mc()), c10 = K7(), b10.ia(a10, c10.u); + a10 = dc().G7; + f10 = "No @type declaration on node " + b10; + g10 = y7(); + ec(e10, a10, c10, g10, f10, b10.da); + return H10(); + } + function fba(a10, b10, c10) { + b10 = new M6().W(b10); + var e10 = ic(nc().bb.r); + b10 = ac(b10, hc(e10, c10)); + b10.b() ? a10 = y7() : (b10 = b10.c(), e10 = oc(), b10 = pc3(a10, e10, b10.i), b10 = jc(kc(b10), qc()), b10.b() ? a10 = y7() : (b10 = b10.c(), a10 = new z7().d(gba(a10, b10, c10)))); + return a10.b() ? rc().ce : a10.c(); + } + function sc(a10, b10, c10) { + O7(); + var e10 = new P6().a(); + if (tc(b10.x)) + for (b10 = uc(b10.x.yf); b10.Ya(); ) { + var f10 = b10.$a(); + a: { + if (null !== f10) { + var g10 = f10.ma(), h10 = f10.ya(); + if (null !== h10) { + hba || (hba = new wc().a()); + f10 = hba.qj(g10); + f10.b() || (f10 = f10.c(), h10.Ja(c10).na() && (h10 = f10.ug(iba(h10, c10), a10), h10.b() || (h10 = h10.c(), e10.Lb(h10)))); + break a; + } + } + throw new x7().d(f10); + } + } + return e10; + } + var pc3 = function jba(a10, b10, c10) { + var f10 = c10.hb().gb; + if (Q5().cd === f10) { + if (b10 instanceof xc) + return c10; + f10 = lc(); + var g10 = cc().bi; + c10 = N6(c10, f10, g10).ga(); + return jba(a10, b10, c10); + } + return Q5().sa === f10 ? (a10 = qc(), f10 = cc().bi, a10 = N6(c10, a10, f10), yc().h(b10) ? ac(new M6().W(a10), "@id").c().i : qb().h(b10) || kba().h(b10) || zc().h(b10) || Ac().h(b10) || Bc() === b10 ? ac(new M6().W(a10), "@value").c().i : c10) : c10; + }; + function gba(a10, b10, c10) { + var e10 = lba(); + b10.sb.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = jc(kc(k10.Aa), bc()); + l10.b() ? l10 = y7() : (l10 = l10.c().va, l10 = new z7().d(fc(l10, g10))); + if (!l10.b() && (l10 = l10.c(), l10 = mba(f10).qj(l10), !l10.b())) { + l10 = l10.c(); + l10 = nba(h10, l10); + k10 = k10.i; + var m10 = lc(); + N6(k10, m10, g10).U(w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + var D10 = qc(); + A10 = N6(A10, D10, t10); + D10 = new M6().W(A10); + var C10 = ic(oc().ko.r); + D10 = ac(D10, hc(C10, t10)).c(); + A10 = new M6().W(A10); + C10 = ic(oc().vf.r); + A10 = ac(A10, hc(C10, t10)).c(); + C10 = oc().ko.ba; + D10 = pc3(p10, C10, D10.i); + C10 = bc(); + D10 = N6(D10, C10, t10).va; + C10 = oc().vf.ba; + A10 = pc3(p10, C10, A10.i); + C10 = bc(); + v10.ug(D10, N6(A10, C10, t10).va); + }; + }( + f10, + g10, + l10 + ))); + } + }; + }(a10, c10, e10))); + return e10; + } + function oba(a10) { + a10 = a10.$g; + if (a10 instanceof Dc) + a: { + a10 = a10.Xd; + var b10 = Ec().kq.X; + for (b10 = new Fc().Vd(b10).Sb.Ye(); b10.Ya(); ) { + var c10 = b10.$a(), e10 = c10, f10 = B6(B6(e10.g, Gc().Pj).g, Hc().Py); + if (f10 = Ic(f10)) { + f10 = jc(kc(a10.Fd), qc()); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.sb)); + f10 = f10.b() ? H10() : f10.c(); + var g10 = Jc, h10 = new pba(); + h10.I9 = e10; + f10 = g10(f10, h10); + f10.b() ? f10 = false : (f10 = Kc(f10.c().i), f10.b() ? f10 = false : (f10 = f10.c().va, e10 = B6(e10.g, Gc().Ym).A, f10 = f10 === (e10.b() ? null : e10.c()))); + } + if (f10) { + a10 = new z7().d(c10); + break a; + } + } + a10 = y7(); + } + else + a10 = y7(); + return a10; + } + function qba(a10) { + var b10 = Lc(a10.pb); + b10 = b10.b() ? a10.pb.j : b10.c(); + b10 = Mc(ua(), b10, "/"); + b10 = Oc(new Pc().fd(b10)); + var c10 = Lc(a10.pb); + b10 = (c10.b() ? a10.pb.j : c10.c()).split(b10).join(""); + c10 = Ab(a10.pb.x, q5(Rc)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().Xb; + var e10 = Rb(Gb().ab, H10()); + c10 = new z7().d(Tc(c10, e10, Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + f10 = new R6().M(f10, g10); + g10 = f10.Tp; + var h10 = f10.hr; + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.ya(); + if (null !== h10) + return g10.cc(new R6().M(h10.ma(), k10)); + } + throw new x7().d(f10); + }; + }(a10)))); + } + c10 = c10.b() ? Rb(Gb().ab, H10()) : c10.c(); + e10 = new Yc().a(); + b10 = B6(a10.pb.g, Gc().xc).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10, m10) { + var p10 = new R6().M(l10, m10); + l10 = p10.Tp; + m10 = p10.hr; + if (null !== l10 && Zc(m10)) { + p10 = Lc(m10); + (p10.b() ? 0 : -1 !== (p10.c().indexOf(g10) | 0)) ? (p10 = Lc(m10), p10 = (p10.b() ? m10.j : p10.c()).split(g10).join("")) : (p10 = Lc(m10), p10 = (p10.b() ? m10.j : p10.c()).split("file://").join("")); + m10 instanceof ad ? (m10 = B6(m10.g, bd().Kh).A, m10 = m10.b() ? null : m10.c()) : m10 = m10.j; + if (h10.Ja(m10).na()) { + var t10 = h10.P(m10); + p10 = new R6().M(t10, p10); + return l10.cc(new R6().M(m10, p10)); + } + t10 = k10.jt("uses_"); + p10 = new R6().M(t10, p10); + return l10.cc(new R6().M(m10, p10)); + } + l10 = p10.Tp; + if (null !== l10) + return l10; + throw new x7().d(p10); + }; + }(a10, b10, c10, e10))); + return cd(a10.pb).ne( + b10, + Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + var h10 = new R6().M(f10, g10); + f10 = h10.Tp; + g10 = h10.hr; + if (null !== f10 && null !== g10) + return h10 = B6(g10.g, dd().Kh).A, h10 = h10.b() ? null : h10.c(), g10 = B6(g10.g, dd().Zc).A, g10 = new R6().M(g10.b() ? null : g10.c(), ""), f10.cc(new R6().M(h10, g10)); + throw new x7().d(h10); + }; + }(a10)) + ); + } + function rba(a10, b10) { + var c10 = K7(), e10 = [new ed().ZT(a10.pb, b10, a10.Xb)]; + c10 = J5(c10, new Ib().ha(e10)); + e10 = a10.pb; + var f10 = a10.Xb, g10 = B6(e10.g, Gc().Ic), h10 = new sba(), k10 = K7(); + g10 = g10.ec(h10, k10.u); + e10 = g10.Da() ? J5(K7(), new Ib().ha([tba(g10, e10, b10, f10)])) : H10(); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + if (cd(a10.pb).Da()) { + e10 = K7(); + f10 = new fd(); + if (null === a10) + throw mb(E6(), null); + f10.l = a10; + f10.HL = b10; + a10 = J5(e10, new Ib().ha([f10])); + } else + a10 = H10(); + b10 = K7(); + return c10.ia(a10, b10.u); + } + function gd(a10, b10) { + a10 = hd(a10.Y(), b10); + a10.b() ? a10 = y7() : (a10 = Ab(a10.c().r.x, q5(jd)), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)), a10 = new z7().d(a10.b() ? ld() : a10.c())); + return a10.b() ? ld() : a10.c(); + } + function uba(a10, b10) { + var c10 = B6(a10.pb.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (md(k10)) + return k10.j === h10; + throw new x7().d(k10); + }; + }(a10, b10))); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(new R6().M(a10.pb, c10))); + if (c10.b()) { + c10 = B6(a10.pb.g, Gc().xc); + var e10 = vba(b10), f10 = K7(); + c10 = c10.ec(e10, f10.u); + a10 = wba(a10); + a10 = Jc(c10, a10); + } else + a10 = c10; + return a10.b() ? Ec().kq.vK(b10) : a10; + } + function nd(a10, b10) { + a10 = uba(a10, b10); + if (a10.b()) + throw mb(E6(), new nb().e("Cannot find node mapping " + b10)); + return a10.c(); + } + function xba(a10, b10) { + return cd(a10).Da() ? J5(K7(), new Ib().ha([yba(b10, a10)])) : H10(); + } + function od(a10, b10) { + var c10 = F6().Eb; + if (a10 === ic(G5(c10, "guid"))) + return "guid"; + c10 = F6().Bj.he; + if (-1 !== (a10.indexOf(c10) | 0)) + return b10 = F6().Bj.he, a10 = Mc(ua(), a10, b10), a10 = Oc(new Pc().fd(a10)), "anyURI" === a10 ? "uri" : "anyType" === a10 ? "any" : a10; + c10 = pd(b10).th.Er(); + a: { + for (; c10.Ya(); ) { + var e10 = c10.$a(); + if (-1 !== (a10.indexOf(e10) | 0)) { + c10 = new z7().d(e10); + break a; + } + } + c10 = y7(); + } + if (c10 instanceof z7) + return c10 = c10.i, b10 = b10.P(c10) + ".", a10.split(c10).join(b10); + if (y7() === c10) + return a10 = Mc(ua(), a10, "#"), a10 = Oc(new Pc().fd(a10)), a10 = Mc(ua(), a10, "/"), Oc(new Pc().fd(a10)); + throw new x7().d(c10); + } + function zba(a10, b10) { + var c10 = Rb(Gb().ab, H10()); + c10 = new qd().d(c10); + cd(b10).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = f10.oa, k10 = B6(g10.g, dd().Kh).A; + k10 = k10.b() ? null : k10.c(); + g10 = B6(g10.g, dd().Zc).A; + g10 = g10.b() ? null : g10.c(); + f10.oa = h10.cc(new R6().M(k10, g10)); + }; + }(a10, c10))); + B6(b10.g, bd().$C).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = f10.oa, k10 = B6(g10.g, td().Kh).A; + k10 = k10.b() ? null : k10.c(); + g10 = B6(g10.g, td().Xp).A; + g10 = g10.b() ? null : g10.c(); + f10.oa = h10.cc(new R6().M(k10, g10)); + }; + }(a10, c10))); + return c10.oa; + } + function ud(a10) { + var b10 = qb(), c10 = F6().$c; + a10.KN(rb(new sb(), b10, G5(c10, "mergePolicy"), tb(new ub(), vb().$c, "merge policy", "Indication of how to merge this graph node when applying a patch document", H10()))); + b10 = "insert delete update upsert ignore fail".split(" "); + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + for (var e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + a10.JN(b10); + } + function Aba(a10) { + var b10 = qb(), c10 = F6().Tb; + a10.D_(rb(new sb(), b10, G5(c10, "name"), tb(new ub(), vb().Tb, "name", "Name of the node mappable element", H10()))); + } + function Bba(a10) { + var b10 = qb(), c10 = F6().$c; + a10.Dia(rb(new sb(), b10, G5(c10, "typeDiscriminatorMap"), tb(new ub(), vb().$c, "type discriminator map", "Information about the discriminator values in the source AST for the property mapping", H10()))); + b10 = qb(); + c10 = F6().$c; + a10.Eia(rb(new sb(), b10, G5(c10, "typeDiscriminatorName"), tb(new ub(), vb().$c, "type discriminator name", "Information about the field in the source AST to be used as discrimintaro in the property mapping", H10()))); + } + function Cba() { + Rb(Gb().ab, H10()); + } + function cd(a10) { + return B6(a10.Y(), Bd().vh); + } + var Fba = function Dba(a10, b10) { + var e10 = a10.tk().Fb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.j === k10; + }; + }(a10, b10))); + if (e10 instanceof z7 && (e10 = e10.i, e10 instanceof Cd)) + return new z7().d(e10); + e10 = a10.Ve(); + var f10 = new Eba(), g10 = K7(); + e10 = e10.ec(f10, g10.u); + b10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return Dba(l10, k10); + }; + }(a10, b10)); + f10 = K7(); + b10 = e10.ka(b10, f10.u).Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.na(); + }; + }(a10))); + a10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.c(); + }; + }(a10)); + e10 = K7(); + return b10.ka(a10, e10.u).kc(); + }; + function Gba(a10, b10, c10, e10, f10) { + b10 = b10.Za; + var g10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + var t10 = Dd(); + p10 = N6(p10, t10, l10); + if (0 <= (p10.length | 0) && "(" === p10.substring(0, 1) && Ed(ua(), p10, ")")) { + t10 = p10.split("(").join("").split(")").join(""); + var v10 = Mc(ua(), t10, "\\."); + t10 = Fd(Gd(), v10); + if (!t10.b() && null !== t10.c() && 0 === t10.c().Oe(2)) + return v10 = t10.c().lb(0), t10 = t10.c().lb(1), new z7().d(new Hd().Dr(new R6().M(new z7().d(v10), t10), p10, m10)); + t10 = Fd(Gd(), v10); + if (!t10.b() && null !== t10.c() && 0 === t10.c().Oe(1)) + return t10 = t10.c().lb(0), new z7().d(new Hd().Dr(new R6().M( + y7(), + t10 + ), p10, m10)); + } else if (0 <= (p10.length | 0) && "x-" === p10.substring(0, 2)) { + t10 = p10.split("x-").join(""); + v10 = Mc(ua(), t10, "-"); + t10 = Fd(Gd(), v10); + if (!t10.b() && null !== t10.c() && 0 === t10.c().Oe(2)) + return v10 = t10.c().lb(0), t10 = t10.c().lb(1), new z7().d(new Hd().Dr(new R6().M(new z7().d(v10), t10), p10, m10)); + t10 = Fd(Gd(), v10); + if (!t10.b() && null !== t10.c() && 0 === t10.c().Oe(1)) + return t10 = t10.c().lb(0), new z7().d(new Hd().Dr(new R6().M(y7(), t10), p10, m10)); + } + return y7(); + } + throw new x7().d(m10); + }; + }(a10, f10)), h10 = Id().u; + b10 = Jd(b10, g10, h10); + g10 = new Hba(); + h10 = Id(); + b10 = b10.ec(g10, h10.u); + a10 = w6(/* @__PURE__ */ function(k10, l10, m10, p10) { + return function(t10) { + if (null !== t10) { + var v10 = t10.Uo, A10 = t10.Ag, D10 = t10.Ih; + if (null !== v10) { + t10 = v10.ma(); + v10 = v10.ya(); + if (t10 instanceof z7) { + var C10 = t10.i; + var I10 = Iba(l10, C10 + "." + v10); + C10 = I10 instanceof z7 ? new Kd().d(I10.i) : new Ld().kn(new nb().e("Cannot resolve external prefix " + C10)); + } else + C10 = F6().Pg, C10 = new Kd().d(ic(G5(C10, v10))); + if (C10 instanceof Kd) + return C10 = C10.i, I10 = m10.j, t10.b() ? t10 = y7() : (t10 = t10.c(), t10 = new z7().d(t10 + "/")), t10 = "" + I10 + (t10.b() ? "/" : t10.c()) + v10, v10 = Jba(new Md(), D10, new z7().d(t10), new Nd().a(), p10).Fr(), I10 = Od(O7(), D10), I10 = new Pd().K(new S6().a(), I10), C10 = Rd(I10, C10), O7(), I10 = new P6().a(), C10 = Sd(C10, A10, I10), O7(), I10 = new P6().a(), I10 = new Td().K( + new S6().a(), + I10 + ), t10 = Rd(I10, t10), I10 = Ud().zi, v10 = Vd(t10, I10, v10), t10 = Ud().ig, v10 = Vd(v10, t10, C10), t10 = Ud().R, A10 = eb(v10, t10, A10), D10 = Od(O7(), D10), D10 = Db(A10, D10), new z7().d(D10); + if (C10 instanceof Ld) { + C10 = C10.uB; + I10 = l10.z3.Ja(t10.b() ? "" : t10.c()); + if (I10 instanceof z7) { + I10 = I10.i; + C10 = m10.j; + var L10 = Ed(ua(), m10.j, "/") || Ed(ua(), m10.j, "#") ? "" : "/"; + t10.b() ? t10 = y7() : (t10 = t10.c(), t10 = new z7().d(t10 + "/")); + C10 = C10 + L10 + (t10.b() ? "/" : t10.c()) + v10; + t10 = Jba(new Md(), D10, new z7().d(C10), new Nd().a(), p10).Fr(); + I10 = B6(I10.g, bd().Kh).A; + I10 = I10.b() ? null : I10.c(); + v10 = Ed(ua(), I10, "#") || Ed(ua(), I10, "/") ? "" + I10 + v10 : I10 + "/" + v10; + I10 = Od(O7(), D10); + I10 = new Pd().K(new S6().a(), I10); + v10 = Rd(I10, v10); + O7(); + I10 = new P6().a(); + v10 = Sd(v10, A10, I10); + O7(); + I10 = new P6().a(); + I10 = new Td().K(new S6().a(), I10); + C10 = Rd(I10, C10); + I10 = Ud().zi; + t10 = Vd(C10, I10, t10); + C10 = Ud().ig; + v10 = Vd(t10, C10, v10); + t10 = Ud().R; + A10 = eb(v10, t10, A10); + D10 = Od(O7(), D10); + D10 = Db(A10, D10); + return new z7().d(D10); + } + if (y7() === I10) + return A10 = Wd().H7, v10 = m10.j, t10 = C10.xo(), C10 = y7(), ec(p10, A10, v10, C10, t10, D10.da), y7(); + throw new x7().d(I10); + } + throw new x7().d(C10); + } + } + throw new x7().d(t10); + }; + }(a10, e10, c10, f10)); + e10 = Xd(); + a10 = b10.ka(a10, e10.u); + e10 = new Kba(); + f10 = Xd(); + a10 = a10.ec(e10, f10.u); + a10.Da() && (a10 = a10.ke(), e10 = Yd(nc()), Zd(c10, e10, a10)); + } + function Lba(a10, b10, c10, e10, f10, g10) { + var h10 = Wd().U5, k10 = B6(c10.g, $d().Yh).A; + k10 = new z7().d(k10.b() ? null : k10.c()); + var l10 = B6(c10.g, $d().Yh).A; + l10 = l10.b() ? null : l10.c(); + c10 = B6(c10.g, $d().R).A; + e10 = "Cannot find expected range for property " + l10 + " (" + (c10.b() ? null : c10.c()) + "). Found '" + f10 + "', expected '" + e10 + "'"; + ae4(); + f10 = g10.da; + f10 = new z7().d(new be4().jj(ce4(0, de4(ee4(), f10.rf, f10.If, f10.Yf, f10.bg)))); + g10 = new je4().e(g10.da.Rf).Bu(); + a10.Gc(h10.j, b10, k10, e10, f10, Yb().qb, g10); + } + function Mba(a10, b10, c10, e10) { + var f10 = Wd().B7; + b10 = "Cannot find fragment " + b10; + var g10 = y7(); + ec(a10, f10, c10, g10, b10, e10.da); + } + function ke3(a10, b10, c10, e10) { + var f10 = Wd().F7; + b10 = "Cannot find class vocabulary term " + b10; + var g10 = y7(); + ec(a10, f10, c10, g10, b10, e10.da); + } + function Nba(a10, b10, c10, e10, f10) { + var g10 = Wd().QI; + c10 = "Property: '" + c10 + "' not supported in a " + e10 + " node"; + e10 = y7(); + ec(a10, g10, b10, e10, c10, f10.da); + } + function Oba(a10, b10, c10, e10, f10) { + var g10 = Wd().x5; + c10 = new z7().d(c10); + e10 = "Cannot find property " + e10 + " in mapping range"; + var h10 = Ab(f10, q5(jd)); + f10 = Ab(f10, q5(Bb)); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da)); + a10.Gc(g10.j, b10, c10, e10, h10, Yb().qb, f10); + } + function Pba(a10, b10, c10, e10, f10) { + var g10 = Wd().gZ; + c10 = new z7().d(c10); + e10 = "Cannot find property " + e10 + " in mapping range"; + var h10 = Ab(f10, q5(jd)); + f10 = Ab(f10, q5(Bb)); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da)); + a10.Gc(g10.j, b10, c10, e10, h10, Yb().qb, f10); + } + function Qba(a10, b10, c10, e10) { + var f10 = Wd().gZ, g10 = new z7().d(ic($d().bh.r)); + b10 = "Cannot find property range term " + b10; + var h10 = Ab(e10, q5(jd)); + e10 = Ab(e10, q5(Bb)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.da)); + a10.Gc(f10.j, c10, g10, b10, h10, Yb().qb, e10); + } + function pe4(a10, b10, c10, e10) { + if ("dialect" === b10) + var f10 = a10.Qk; + else if ("library" === b10) + f10 = a10.Uma; + else if ("fragment" === b10) + f10 = a10.EG; + else if ("nodeMapping" === b10) + f10 = a10.Lba; + else if ("propertyMapping" === b10) + f10 = a10.qoa; + else if ("documentsMapping" === b10) + f10 = a10.gka; + else { + if ("documentsMappingOptions" !== b10) + throw new x7().d(b10); + f10 = a10.hka; + } + var g10 = pd(e10.Za), h10 = qe2(); + h10 = re4(h10); + h10 = se4(g10, h10); + for (g10 = g10.th.Er(); g10.Ya(); ) { + var k10 = g10.$a(), l10 = bc(), m10 = cc().bi; + h10.jd(N6(k10, l10, m10).va); + } + h10.Rc().U(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10) { + return function(C10) { + if (!(0 <= (C10.length | 0) && "(" === C10.substring(0, 1) && Ed( + ua(), + C10, + ")" + ) || 0 <= (C10.length | 0) && "x-" === C10.substring(0, 2))) { + var I10 = t10.Ja(C10); + if (!(I10 instanceof z7)) + if (y7() === I10) + Nba(p10, v10, C10, A10, D10); + else + throw new x7().d(I10); + } + }; + }(a10, f10, c10, b10, e10))); + f10.U(w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + if (null !== D10) { + var C10 = D10.ma(); + D10 = !!D10.ya(); + var I10 = pd(t10.Za), L10 = qe2(); + L10 = re4(L10); + L10 = se4(I10, L10); + for (I10 = I10.th.Er(); I10.Ya(); ) { + var Y10 = I10.$a(), ia = bc(), pa = cc().bi; + L10.jd(N6(Y10, ia, pa).va); + } + L10 = L10.Rc(); + D10 && !L10.Ha(C10) && (D10 = Wd().D7, C10 = "Property: '" + C10 + "' mandatory in a " + A10 + " node", L10 = y7(), ec(p10, D10, v10, L10, C10, t10.da)); + } else + throw new x7().d(D10); + }; + }(a10, e10, c10, b10))); + } + function te4(a10) { + var b10 = a10.hb().gb, c10 = Q5().wq; + if (b10 === c10) + return ue4(), b10 = bc(), c10 = cc().bi, a10 = N6(a10, b10, c10).va, new ve4().d(a10); + ue4(); + return new ye4().d(a10); + } + function Rba(a10, b10) { + if (b10 instanceof Cd) { + b10 = [b10.j]; + if (0 === (b10.length | 0)) + return vd(); + a10 = wd(new xd(), vd()); + for (var c10 = 0, e10 = b10.length | 0; c10 < e10; ) + Ad(a10, b10[c10]), c10 = 1 + c10 | 0; + return a10.eb; + } + if (b10 instanceof ze2) + return b10 = B6(b10.g, Ae4().bh), a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = f10.A; + return f10.b() ? null : f10.c(); + }; + }(a10)), c10 = K7(), b10.ka(a10, c10.u).xg(); + throw new x7().d(b10); + } + function Sba(a10, b10, c10, e10) { + if ("vocabulary" === b10) + var f10 = a10.Uqa; + else if ("classTerm" === b10) + f10 = a10.vja; + else { + if ("propertyTerm" !== b10) + throw new x7().d(b10); + f10 = a10.roa; + } + var g10 = pd(e10.Za), h10 = qe2(); + h10 = re4(h10); + h10 = se4(g10, h10); + for (g10 = g10.th.Er(); g10.Ya(); ) { + var k10 = g10.$a(), l10 = bc(), m10 = cc().bi; + h10.jd(N6(k10, l10, m10).va); + } + h10.Rc().U(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = t10.Ja(C10); + if (!(I10 instanceof z7)) + if (y7() === I10) + Nba(p10, v10, C10, A10, D10); + else + throw new x7().d(I10); + }; + }(a10, f10, c10, b10, e10))); + } + function Tba(a10) { + if (Be3() === a10 || Ce() === a10 || De2() === a10 || Ee4() === a10) + return "string"; + if (Fe() === a10 || Ge() === a10) + return "integer"; + if (Je() === a10 || Ke() === a10) + return "number"; + if (Pe2() === a10) + return "boolean"; + if (Ue() === a10 || We() === a10 || Xe() === a10 || Ye() === a10) + return "string"; + if (Ze() === a10) + return "array"; + if ($e2() === a10) + return "object"; + if (cf() === a10) + return "file"; + if (df() === a10) + return "null"; + if (ef() === a10) + return "number"; + if (ff() === a10) + throw mb(E6(), new kf().e("Undefined type def")); + throw new x7().d(a10); + } + function Uba(a10, b10) { + Vba().GG(); + var c10 = a10.j; + O7(); + var e10 = new P6().a(); + e10 = new mf().K(new S6().a(), e10); + var f10 = K7(); + a10.fa().Lb(new nf().a()); + if (B6(a10.Y(), qf().R).A.b()) { + var g10 = rf.prototype.pG.call(a10); + g10 = Rd(g10, a10.j); + O7(); + var h10 = new P6().a(); + g10 = Sd(g10, "root", h10); + } else { + g10 = B6(a10.Y(), qf().R).A; + g10 = g10.b() ? null : g10.c(); + if (null === g10) + throw new sf().a(); + tf(uf(), ".*/.*", g10) ? (g10 = rf.prototype.pG.call(a10), g10 = Rd(g10, a10.j), O7(), h10 = new P6().a(), g10 = Sd(g10, "root", h10)) : g10 = a10; + } + f10 = J5(f10, new Ib().ha([g10])); + g10 = a10.fh; + h10 = K7(); + f10 = f10.ia(g10, h10.u); + g10 = Af().Ic; + e10 = Bf(e10, g10, f10); + f10 = Wba().$; + Cf(); + g10 = new Df().a(); + b10 = Xba(Cf(), e10, "application/schema+json", f10, g10, b10); + Rd(a10, c10); + c10 = a10.fa(); + f10 = c10.hf; + Ef(); + e10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) + h10 = g10 = f10.ga(), false !== !(h10 instanceof Mf || h10 instanceof Nf || h10 instanceof nf) && Of(e10, g10), f10 = f10.ta(); + c10.hf = e10.eb; + a10.fa().Lb(new Nf().e(b10)); + return b10; + } + function Yba(a10) { + Vba().GG(); + return Xba(Cf(), Tf(Uf(), a10, "application/json"), "application/payload+json", Vf().$, (Cf(), new Df().a()), (Cf(), new Yf().a())); + } + function Zba(a10) { + var b10 = false, c10 = null, e10 = B6(a10.g, Zf().Rd).A; + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d($ba($f(), e10, false))); + if (e10 instanceof z7 && (b10 = true, c10 = e10, "application/json" === c10.i)) + return a10 = B6(a10.g, ag().mo), Yba(a10); + if (b10 && "application/xml" === c10.i) + return ""; + if (b10) + return a10 = B6(a10.g, Zf().Rd).A, a10.b() ? null : a10.c(); + a10 = B6(a10.g, ag().mo); + return Yba(a10); + } + function aca(a10) { + Vba().GG(); + var b10 = Cf(); + O7(); + var c10 = new P6().a(); + c10 = new bg().K(new S6().a(), c10); + if (B6(a10.Y(), qf().R).A.b()) { + var e10 = rf.prototype.pG.call(a10); + e10 = Rd(e10, a10.j); + O7(); + var f10 = new P6().a(); + e10 = Sd(e10, "Root", f10); + } else { + e10 = B6(a10.Y(), qf().R).A; + e10 = e10.b() ? null : e10.c(); + if (null === e10) + throw new sf().a(); + tf(uf(), "type", e10) ? (e10 = rf.prototype.pG.call(a10), e10 = Rd(e10, a10.j), O7(), f10 = new P6().a(), e10 = Sd(e10, "Root", f10)) : e10 = a10; + } + f10 = Af().Ic; + b10 = Xba(b10, ig(c10, f10, e10), "application/raml", Pb().$, (Cf(), new Df().a()), (Cf(), new Yf().a())); + c10 = a10.fa(); + f10 = c10.hf; + Ef(); + e10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var g10 = f10.ga(); + false !== !(g10 instanceof jg) && Of(e10, g10); + f10 = f10.ta(); + } + c10.hf = e10.eb; + c10 = a10.fa(); + f10 = c10.hf; + Ef(); + e10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) + g10 = f10.ga(), false !== !(g10 instanceof kg) && Of(e10, g10), f10 = f10.ta(); + c10.hf = e10.eb; + a10.fa().Lb(new kg().e(b10)); + return b10; + } + function bca(a10, b10, c10, e10, f10) { + var g10 = new qg().e("\\{[^\\}]*\\{"), h10 = H10(); + g10 = new rg().vi(g10.ja, h10); + h10 = new qg().e("\\}[^\\{]*\\}"); + var k10 = H10(); + h10 = new rg().vi(h10.ja, k10); + if (cca(g10, a10).na() || cca(h10, a10).na()) + a10 = sg().U7, e10 = new z7().d(e10), ec(f10, a10, c10, e10, "Invalid path template syntax", b10.da); + } + function dca(a10, b10, c10, e10, f10) { + a10 = eca(new tg(), c10, "examples", Vb().Ia(b10.j), w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return h10.qF(k10); + }; + }(a10, b10)), fca(e10, b10), f10).Vg(); + a10.Da() && (c10 = Ag().Ec, Zd(b10, c10, a10)); + } + function gca(a10, b10, c10, e10, f10, g10) { + var h10 = hd(b10.Y(), Ag().Ec); + if (!h10.b()) { + h10 = h10.c(); + a10 = hca(g10, B6(b10.Y(), Ag().Ec)).Dm(w6(/* @__PURE__ */ function() { + return function(m10) { + var p10 = Bg(m10.g), t10 = ag().R; + return Cg(p10, t10) ? false : !Za(m10).na(); + }; + }(a10))); + if (null === a10) + throw new x7().d(a10); + b10 = a10.ma(); + a10 = a10.ya(); + h10 = h10.r.r.wb; + var k10 = new ica(), l10 = K7(); + h10 = hca(g10, h10.ec(k10, l10.u)); + k10 = b10.kc(); + k10.b() || (k10 = k10.c(), Dg(c10, jca("example", k10, e10, g10))); + b10 = 0 < b10.Oe(1) ? h10.ta() : y7().ua(); + h10 = K7(); + new z7().d(Dg(c10, new Eg().jE("examples", a10.ia(b10, h10.u), e10, f10, g10))); + } + } + function kca(a10, b10, c10, e10) { + var f10 = new M6().W(b10), g10 = a10.l, h10 = Fg().zl; + Gg(f10, "pattern", Hg(Ig(g10, h10, a10.l.ra), c10)); + f10 = new M6().W(b10); + g10 = a10.l; + h10 = Fg().Cq; + Gg(f10, "minLength", Hg(Ig(g10, h10, a10.l.ra), c10)); + f10 = new M6().W(b10); + g10 = a10.l; + h10 = Fg().Aq; + Gg(f10, "maxLength", Hg(Ig(g10, h10, a10.l.ra), c10)); + f10 = ac(new M6().W(b10), "minimum"); + f10.b() || (g10 = f10.c(), h10 = new Qg().Vb(g10.i, a10.l.ra), f10 = Fg().wj, h10 = h10.Zf(), g10 = Od(O7(), g10), Rg(c10, f10, h10, g10)); + f10 = ac(new M6().W(b10), "maximum"); + f10.b() || (g10 = f10.c(), h10 = new Qg().Vb(g10.i, a10.l.ra), f10 = Fg().vj, h10 = h10.Zf(), g10 = Od(O7(), g10), Rg(c10, f10, h10, g10)); + f10 = new M6().W(b10); + g10 = a10.l; + h10 = Fg().yx; + Gg( + f10, + "exclusiveMinimum", + Hg(Ig(g10, h10, a10.l.ra), c10) + ); + f10 = new M6().W(b10); + g10 = a10.l; + h10 = Fg().xx; + Gg(f10, "exclusiveMaximum", Hg(Ig(g10, h10, a10.l.ra), c10)); + f10 = new M6().W(b10); + g10 = a10.l; + h10 = Fg().av; + Gg(f10, "multipleOf", Hg(Ig(g10, h10, a10.l.ra), c10)); + return lca(mca(c10, e10, a10.l.ra), b10); + } + function nca(a10, b10, c10) { + var e10 = hd(a10, Fg().Cq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, Yg(Zg(), "minLength", e10, y7(), c10)))); + e10 = hd(a10, Fg().Aq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, Yg(Zg(), "maxLength", e10, y7(), c10)))); + c10 = hd(a10, Fg().yx); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), fh(new je4().e("exclusiveMinimum")), c10, y7())))); + a10 = hd(a10, Fg().xx); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), fh(new je4().e("exclusiveMaximum")), a10, y7())))); + } + function oca(a10) { + var b10 = a10.r.r.r, c10 = b10; + 0 <= (c10.length | 0) && "^" === c10.substring(0, 1) && (b10 = new qg().e(b10), c10 = b10.ja.length | 0, b10 = gh(hh(), b10.ja, 1, c10)); + Ed(ua(), b10, "$") && (b10 = new qg().e(b10), b10 = b10.np(0, b10.Oa() - 1 | 0)); + b10 = ih(new jh(), b10, new P6().a()); + b10 = kh(b10, a10.r.x); + return lh(a10.Lc, b10); + } + function pca(a10) { + return "date-only" === a10 ? "date" : "time-only" === a10 ? "time" : "datetime-only" === a10 ? "date-time" : "datetime" === a10 ? "date-time" : "rfc3339" === a10 ? "date-time" : a10; + } + function qca(a10, b10, c10) { + var e10 = ac(new M6().W(b10), "pattern"); + if (!e10.b()) { + e10 = e10.c(); + var f10 = e10.i, g10 = Dd(); + g10 = f10 = N6(f10, g10, a10.l.Nb()); + 0 <= (g10.length | 0) && "^" === g10.substring(0, 1) || (f10 = "^" + f10); + Ed(ua(), f10, "$") || (f10 += "$"); + T6(); + f10 = mh(T6(), f10); + f10 = new Qg().Vb(f10, a10.l.Nb()).Zf(); + g10 = Od(O7(), e10); + f10 = ih(new jh(), f10.r, g10); + g10 = Fg().zl; + e10 = Od(O7(), e10); + Rg(c10, g10, f10, e10); + } + e10 = new M6().W(b10); + f10 = a10.l; + g10 = Fg().Cq; + Gg(e10, "minLength", nh(Hg(Ig(f10, g10, a10.l.Nb()), c10))); + e10 = new M6().W(b10); + f10 = a10.l; + g10 = Fg().Aq; + Gg(e10, "maxLength", nh(Hg(Ig(f10, g10, a10.l.Nb()), c10))); + e10 = new M6().W(b10); + f10 = fh(new je4().e("exclusiveMinimum")); + g10 = a10.l; + var h10 = Fg().yx; + Gg(e10, f10, Hg(Ig(g10, h10, a10.l.Nb()), c10)); + b10 = new M6().W(b10); + e10 = fh(new je4().e("exclusiveMaximum")); + f10 = a10.l; + g10 = Fg().xx; + Gg(b10, e10, Hg(Ig(f10, g10, a10.l.Nb()), c10)); + } + function rca(a10) { + return a10 instanceof th ? Vb().Ia(B6(a10.aa, uh().Ff)).b() : false; + } + function sca(a10, b10, c10, e10) { + b10.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + if (k10 instanceof vh && (wh(k10.fa(), q5(xh)) || wh(k10.fa(), q5(tca)))) + f10.LN().Nb().Ns(sg().cJ, k10.j, new z7().d(ic(qf().xd.r)), "Invalid reference to JSON Schema", new z7().d(new be4().jj(g10)), h10.b() ? yh(k10) : h10); + else if (k10 instanceof Gh) { + var l10 = f10.LN().Nb(), m10 = sg().q_, p10 = k10.j, t10 = new z7().d(ic(qf().xd.r)), v10 = new z7().d(new be4().jj(g10)); + k10 = h10.b() ? yh(k10) : h10; + l10.Gc(m10.j, p10, t10, "Invalid reference to XML Schema", v10, Yb().qb, k10); + } + }; + }(a10, e10, c10))); + } + function uca(a10, b10, c10, e10) { + var f10 = b10.bc(), g10 = Ag(); + null !== f10 && f10 === g10 || b10 instanceof Hh && B6(b10.aa, Ih().kh).b() || b10 instanceof Mh && B6(b10.aa, Fg().af).A.b() || rca(b10) || c10.U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + if (m10 instanceof vh && (wh(m10.fa(), q5(xh)) || wh(m10.fa(), q5(tca)))) + h10.LN().Nb().Ns(sg().cJ, m10.j, new z7().d(ic(qf().xd.r)), "Inheritance from JSON Schema", new z7().d(new be4().jj(k10)), l10.Ib()); + else if (m10 instanceof Gh) { + var p10 = h10.LN().Nb(), t10 = sg().q_; + m10 = m10.j; + var v10 = new z7().d(ic(qf().xd.r)), A10 = new z7().d(new be4().jj(k10)), D10 = l10.Ib(); + p10.Gc( + t10.j, + m10, + v10, + "Inheritance from XML Schema", + A10, + Yb().qb, + D10 + ); + } + }; + }(a10, e10, b10))); + } + function vca(a10) { + try { + var b10 = ff(); + Nh(); + Nh(); + var c10 = Oh(Nh(), a10, "", b10, false), e10 = wca(); + return null !== c10 && c10 === e10; + } catch (f10) { + if (Ph(E6(), f10) instanceof nb) + return false; + throw f10; + } + } + function xca(a10) { + if ("nil" === a10 || "" === a10 || "null" === a10) { + O7(); + var b10 = new P6().a(); + return new Th().K(new S6().a(), b10); + } + if ("any" === a10) + return O7(), b10 = new P6().a(), a10 = new S6().a(), new vh().K(a10, b10); + if ("string" === a10 || "integer" === a10 || "number" === a10 || "boolean" === a10 || "datetime" === a10 || "datetime-only" === a10 || "time-only" === a10 || "date-only" === a10) { + O7(); + b10 = new P6().a(); + b10 = new Mh().K(new S6().a(), b10); + a10 = yca(Uh(), a10); + var c10 = Fg().af; + return eb(b10, c10, a10); + } + if ("array" === a10) + return O7(), b10 = new P6().a(), new th().K(new S6().a(), b10); + if ("object" === a10) + return O7(), b10 = new P6().a(), new Hh().K(new S6().a(), b10); + if ("union" === a10) + return O7(), b10 = new P6().a(), new Vh().K(new S6().a(), b10); + if ("file" === a10) + return O7(), b10 = new P6().a(), new Wh().K(new S6().a(), b10); + throw new x7().d(a10); + } + function zca(a10, b10) { + if (-1 < (a10.indexOf("|") | 0) || -1 < (a10.indexOf("[") | 0) || -1 < (a10.indexOf("{") | 0) || -1 < (a10.indexOf("]") | 0) || -1 < (a10.indexOf("}") | 0) || 0 <= (a10.length | 0) && "<<" === a10.substring(0, 2) && Ed(ua(), a10, ">>")) + return false; + var c10 = ff(); + Nh(); + a10 = Oh(Nh(), a10, "", c10, b10); + b10 = ff(); + return !(null !== a10 && a10 === b10); + } + function Aca(a10, b10, c10) { + b10 = ac(new M6().W(b10), "securitySchemes"); + if (!b10.b()) { + var e10 = b10.c(), f10 = e10.i.hb().gb; + if (Q5().sa === f10) + b10 = e10.i, e10 = qc(), N6(b10, e10, a10.Nb()).sb.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = h10.Nb().pe(); + l10 = Bca(Cca(), l10, Uc(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10, C10) { + var I10 = Xh().R; + C10 = ih(new jh(), C10, Od(O7(), v10.Aa.re())); + var L10 = Od(O7(), v10.Aa); + Rg(D10, I10, C10, L10); + return Yh(D10, A10, J5(K7(), H10())); + }; + }(h10, l10, k10)), h10.Nb()).FH(); + var p10 = new Zh().a(); + return $h(m10, Cb(l10, p10)); + }; + }(a10, c10))); + else if (Q5().nd !== f10) { + a10 = a10.Nb(); + b10 = sg().qY; + f10 = "Invalid type " + f10 + " for 'securitySchemes' node."; + e10 = e10.i; + var g10 = y7(); + ec(a10, b10, c10, g10, f10, e10.da); + } + } + } + function Dca(a10) { + if (0 <= (a10.length | 0) && "$" === a10.substring(0, 1)) + return Eca(a10); + var b10 = new qg().e("\\{.*?\\}"), c10 = H10(); + a10 = ai(new rg().vi(b10.ja, c10), a10); + for (b10 = true; b10 && a10.Ya(); ) + b10 = a10.Tw(), b10 = new qg().e(b10), b10 = Fca(b10), b10 = new qg().e(b10), b10 = Eca(bi(b10)); + return b10; + } + function Gca(a10, b10) { + if (a10 instanceof z7) { + a10 = a10.i; + if (-1 < (a10.indexOf("#") | 0)) + return Mc(ua(), a10, "#").n[1].trim(); + if (-1 === (a10.indexOf("/") | 0) && -1 !== (a10.indexOf(":") | 0)) + return Mc(ua(), a10, ":").n[1].trim(); + a10 = Mc(ua(), a10, "/"); + return Oc(new Pc().fd(a10)).trim(); + } + if (y7() === a10) + return b10; + throw new x7().d(a10); + } + function Hca(a10) { + var b10 = qb(), c10 = F6().Ua; + a10.Sia(rb(new sb(), b10, G5(c10, "pattern"), tb(new ub(), ci().Ua, "pattern", "Pattern constraint", H10()))); + b10 = Ac(); + c10 = F6().Ua; + a10.Pia(rb(new sb(), b10, G5(c10, "minLength"), tb(new ub(), ci().Ua, "min. length", "Minimum lenght constraint", H10()))); + b10 = Ac(); + c10 = F6().Ua; + a10.Nia(rb(new sb(), b10, G5(c10, "maxLength"), tb(new ub(), ci().Ua, "max. length", "Maximum length constraint", H10()))); + b10 = hi(); + c10 = F6().Ua; + a10.Qia(rb(new sb(), b10, G5(c10, "minInclusive"), tb(new ub(), ci().Ua, "min. inclusive", "Minimum inclusive constraint", H10()))); + b10 = hi(); + c10 = F6().Ua; + a10.Oia(rb(new sb(), b10, G5(c10, "maxInclusive"), tb(new ub(), ci().Ua, "max. inclusive", "Maximum inclusive constraint", H10()))); + b10 = zc(); + c10 = F6().Ua; + a10.Lia(rb(new sb(), b10, G5(c10, "minExclusive"), tb(new ub(), ci().Ua, "min. exclusive", "Minimum exclusive constraint", H10()))); + b10 = zc(); + c10 = F6().Ua; + a10.Kia(rb(new sb(), b10, G5(c10, "maxExclusive"), tb(new ub(), ci().Ua, "max. exclusive", "Maximum exclusive constraint", H10()))); + b10 = qb(); + c10 = F6().Eb; + a10.Mia(rb(new sb(), b10, G5(c10, "format"), tb(new ub(), vb().Eb, "format", "Format constraint", H10()))); + b10 = hi(); + c10 = F6().Eb; + a10.Ria(rb( + new sb(), + b10, + G5(c10, "multipleOf"), + tb(new ub(), vb().Eb, "multiple of", "Multiple of constraint", H10()) + )); + ii(); + b10 = [a10.zl, a10.Cq, a10.Aq, a10.wj, a10.vj, a10.yx, a10.xx, a10.Fn, a10.av]; + c10 = -1 + (b10.length | 0) | 0; + for (var e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + a10.Tia(e10); + } + function ki(a10) { + var b10 = li(), c10 = F6().Tb; + a10.kw(rb(new sb(), b10, G5(c10, "documentation"), tb(new ub(), vb().Tb, "documentation", "Documentation for a particular part of the model", H10()))); + } + function mi(a10) { + var b10 = new xc().yd(ag()), c10 = F6().Ta; + a10.gv(rb(new sb(), b10, G5(c10, "examples"), tb(new ub(), vb().Ta, "examples", "Examples for a particular domain element", H10()))); + } + function ni(a10) { + return B6(a10.Y(), Fg().Fn); + } + function Ica(a10, b10) { + if (!(a10.g3.Fb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10.j === g10.j; + }; + }(a10, b10))) instanceof z7)) { + var c10 = a10.g3; + b10 = J5(K7(), new Ib().ha([b10])); + var e10 = oi(); + a10.g3 = c10.ia(b10, e10.u); + } + } + function Jca(a10, b10) { + if (!(a10.e3.Fb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10.j === g10.j; + }; + }(a10, b10))) instanceof z7)) { + var c10 = a10.e3; + b10 = J5(K7(), new Ib().ha([b10])); + var e10 = oi(); + a10.e3 = c10.ia(b10, e10.u); + } + } + function Kca(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Xy); + } + function Lca(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Zs); + } + function Mca(a10, b10) { + var c10 = Kc(b10.i), e10 = c10 instanceof z7 ? c10.i.va : Nca(Oca(), b10.i); + c10 = qf().$j; + e10 = ih(new jh(), e10, new P6().a()); + b10 = Od(O7(), b10); + Rg(a10, c10, e10, b10); + } + function Pca(a10, b10, c10) { + if (b10 instanceof vh && c10 instanceof vh) { + c10 = B6(c10.Y(), Ag().Ec); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return Qca(f10); + }; + }(a10)); + var e10 = K7(); + c10 = c10.ka(a10, e10.u); + a10 = Ag().Ec; + Zd(b10, a10, c10); + } + } + function Rca(a10, b10, c10, e10, f10) { + if (e10.to.Ha(a10.j)) + return f10 = B6(a10.Y(), a10.Zg()).A, f10.b() || f10.c(), Sca(c10, a10, b10); + if (null !== a10 && Za(a10).na()) { + var g10 = B6(a10.Y(), a10.Zg()).A; + g10.b() || g10.c(); + g10 = Sca(c10, a10, b10); + } else if (a10 instanceof Vh) + g10 = a10.fa(), g10 = new Vh().K(new S6().a(), g10); + else if (a10 instanceof Mh) + g10 = a10.fa(), g10 = new Mh().K(new S6().a(), g10); + else if (a10 instanceof th) + g10 = a10.fa(), g10 = new th().K(new S6().a(), g10); + else if (a10 instanceof pi) + g10 = a10.fa(), g10 = new pi().K(new S6().a(), g10); + else if (a10 instanceof qi) + g10 = a10.fa(), g10 = new qi().K(new S6().a(), g10); + else if (a10 instanceof Wh) + g10 = a10.fa(), g10 = new Wh().K(new S6().a(), g10); + else if (a10 instanceof Th) + g10 = a10.fa(), g10 = new Th().K(new S6().a(), g10); + else if (a10 instanceof Hh) + g10 = a10.fa(), g10 = new Hh().K(new S6().a(), g10); + else if (a10 instanceof Gh) + g10 = a10.fa(), g10 = new Gh().K(new S6().a(), g10); + else if (a10 instanceof vi) { + g10 = a10.Xa; + var h10 = a10.JH, k10 = a10.AG; + g10 = wi(new vi(), new S6().a(), g10, h10, k10, y7(), true); + } else { + if (!(a10 instanceof vh)) + throw new x7().d(a10); + g10 = a10.fa(); + h10 = new S6().a(); + g10 = new vh().K(h10, g10); + } + g10.j = a10.j; + Tca(a10, b10, g10, c10, Uca(e10, a10.j)); + g10 instanceof Hh && (b10 = new xi().a(), Cb(g10, b10)); + yi(g10.fh, a10.fh); + f10 && Pca(a10, g10, a10); + return g10; + } + function Sca(a10, b10, c10) { + if (c10.na() && B6(b10.Y(), db().oe).A.b()) { + c10 = c10.c(); + var e10 = dc().rN, f10 = b10.j, g10 = y7(), h10 = Ab(b10.fa(), q5(jd)), k10 = b10.Ib(); + c10.Gc(e10.j, f10, g10, "Error recursive shape", h10, Yb().qb, k10); + } + a10 = a10.b() ? b10.j : a10.c(); + Vca(); + c10 = new S6().a(); + c10 = new zi().K(c10, b10.fa()); + e10 = b10.j; + J5(K7(), H10()); + c10 = Ai(c10, e10); + e10 = B6(b10.Y(), db().oe); + e10 = Ic(e10); + f10 = db().oe; + c10 = Bi(c10, f10, e10); + e10 = b10.j; + f10 = Ci().Ys; + b10 = Di(eb(c10, f10, e10), b10.gj(Wca())); + c10 = Ci().Ys; + return eb(b10, c10, a10); + } + function Xca(a10) { + return a10 instanceof vh ? B6(a10.Y(), Zf().xj).A : y7(); + } + function Yca(a10) { + return a10 instanceof vh ? B6(a10.Y(), Zf().xj).A.na() : false; + } + function Zca(a10) { + return Fe() === a10 ? true : Je() === a10 ? true : Ge() === a10 ? true : Ke() === a10 ? true : ef() === a10; + } + function $ca(a10, b10, c10, e10) { + var f10 = qf().R; + if (null === f10 ? null === b10 : f10.h(b10)) + return b10 = ada(c10), ada(e10).na() ? b10.b() ? b10 = true : (b10 = b10.c(), b10 = null !== b10 && ra(b10, "schema")) : b10 = false, b10 ? e10 : c10; + f10 = Ih().dw; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Ih().dw.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei("<=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Ih().dw.r)), Ab(c10.fa(), q5(jd)), Fi("max", e10, c10); + throw Gi( + new Hi(), + "Resolution error: sub type has a weaker constraint for min-properties than base type for minProperties", + new z7().d(ic(Ih().dw.r)), + c10.Ib(), + Ab(c10.fa(), q5(jd)), + false + ); + } + f10 = Ih().cw; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Ih().cw.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei(">=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Ih().cw.r)), Ab(c10.fa(), q5(jd)), Fi("min", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for max-properties than base type for maxProperties", new z7().d(ic(Ih().cw.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Fg().Cq; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().Cq.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei("<=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Fg().Cq.r)), Ab(c10.fa(), q5(jd)), Fi("max", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for min-length than base type for maxProperties", new z7().d(ic(Fg().Cq.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Fg().Aq; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().Aq.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei(">=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Fg().Aq.r)), Ab(c10.fa(), q5(jd)), Fi("min", e10, c10); + throw Gi( + new Hi(), + "Resolution error: sub type has a weaker constraint for max-length than base type for maxProperties", + new z7().d(ic(Fg().Aq.r)), + c10.Ib(), + Ab(c10.fa(), q5(jd)), + false + ); + } + f10 = Fg().wj; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().wj.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei("<=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Fg().wj.r)), Ab(c10.fa(), q5(jd)), Fi("max", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for min-minimum than base type for minimum", new z7().d(ic(Fg().wj.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Fg().vj; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().vj.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei( + ">=", + e10, + c10, + b10, + a10, + f10 + )) + return new z7().d(ic(Fg().vj.r)), Ab(c10.fa(), q5(jd)), Fi("min", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for maximum than base type for maximum", new z7().d(ic(Fg().vj.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = uh().Bq; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(uh().Bq.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei("<=", e10, c10, b10, a10, f10)) + return new z7().d(ic(uh().Bq.r)), Ab(c10.fa(), q5(jd)), Fi("max", e10, c10); + throw Gi( + new Hi(), + "Resolution error: sub type has a weaker constraint for minItems than base type for minItems", + new z7().d(ic(uh().Bq.r)), + c10.Ib(), + Ab(c10.fa(), q5(jd)), + true + ); + } + f10 = uh().pr; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(uh().pr.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei(">=", e10, c10, b10, a10, f10)) + return new z7().d(ic(uh().pr.r)), Ab(c10.fa(), q5(jd)), Fi("min", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for maxItems than base type for maxItems", new z7().d(ic(uh().pr.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Fg().Fn; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().Fn.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii( + e10, + c10, + b10, + a10, + f10 + )) + return c10; + throw Gi(new Hi(), "different values for format constraint", new z7().d(ic(Fg().Fn.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Fg().zl; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Fg().zl.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii(e10, c10, b10, a10, f10)) + return c10; + throw Gi(new Hi(), "different values for pattern constraint", new z7().d(ic(Fg().zl.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + f10 = Ih().Us; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Ih().Us.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii(e10, c10, b10, a10, f10)) + throw Gi( + new Hi(), + "shape has same discriminator value as parent", + new z7().d(ic(Ih().Us.r)), + c10.Ib(), + Ab(c10.fa(), q5(jd)), + false + ); + return c10; + } + f10 = Ih().Jy; + if (null === f10 ? null === b10 : f10.h(b10)) { + b10 = new z7().d(ic(Ih().Jy.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii(e10, c10, b10, a10, f10)) + throw Gi(new Hi(), "shape has same discriminator value as parent", new z7().d(ic(Ih().Jy.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + return c10; + } + f10 = qf().ch; + if (null === f10 ? null === b10 : f10.h(b10)) + return bda(a10, c10.wb, e10.wb), c10; + a10 = uh().qr; + if (null === a10 ? null === b10 : a10.h(b10)) { + new z7().d(ic(uh().qr.r)); + Ab(c10.fa(), q5(jd)); + cda(true, true, e10, c10) ? b10 = true : (new z7().d(ic(uh().qr.r)), Ab(c10.fa(), q5(jd)), b10 = cda(false, false, e10, c10)); + b10 ? e10 = true : (new z7().d(ic(uh().qr.r)), Ab(c10.fa(), q5(jd)), e10 = cda(false, true, e10, c10)); + if (e10) + return c10; + throw Gi(new Hi(), "different values for unique items constraint", new z7().d(ic(uh().qr.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + a10 = Qi().ji; + if (null === a10 ? null === b10 : a10.h(b10)) { + b10 = new z7().d(ic(Qi().ji.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei("<=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Qi().ji.r)), Ab(c10.fa(), q5(jd)), Fi("max", e10, c10); + throw Gi( + new Hi(), + "Resolution error: sub type has a weaker constraint for minCount than base type for minCount", + new z7().d(ic(Qi().ji.r)), + c10.Ib(), + Ab(c10.fa(), q5(jd)), + false + ); + } + a10 = Qi().PF; + if (null === a10 ? null === b10 : a10.h(b10)) { + b10 = new z7().d(ic(Qi().PF.r)); + a10 = Ab(c10.fa(), q5(jd)); + f10 = c10.Ib(); + if (Ei(">=", e10, c10, b10, a10, f10)) + return new z7().d(ic(Qi().PF.r)), Ab(c10.fa(), q5(jd)), Fi("min", e10, c10); + throw Gi(new Hi(), "Resolution error: sub type has a weaker constraint for maxCount than base type for maxCount", new z7().d(ic(Qi().PF.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + a10 = Qi().Uf; + if (null === a10 ? null === b10 : a10.h(b10)) { + b10 = new z7().d(ic(Qi().Uf.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii( + e10, + c10, + b10, + a10, + f10 + )) + return c10; + throw Gi(new Hi(), "different values for discriminator value path", new z7().d(ic(Qi().Uf.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + a10 = Qi().Vf; + if (null === a10 ? null === b10 : a10.h(b10)) { + b10 = new z7().d(ic(Qi().Vf.r)); + a10 = c10.Ib(); + f10 = Ab(c10.fa(), q5(jd)); + if (Ii(e10, c10, b10, a10, f10)) + return c10; + throw Gi(new Hi(), "different values for discriminator value range", new z7().d(ic(Qi().Vf.r)), c10.Ib(), Ab(c10.fa(), q5(jd)), false); + } + return c10; + } + function Ei(a10, b10, c10, e10, f10, g10) { + if (b10 instanceof jh && Vb().Ia(b10.r).na() && c10 instanceof jh && Vb().Ia(c10.r).na()) { + b10 = Si(b10); + c10 = Si(c10); + if ("<=" === a10) + return za(b10) <= za(c10); + if (">=" === a10) + return za(b10) >= za(c10); + throw Gi(new Hi(), "Unknown numeric comparison " + a10, e10, g10, f10, false); + } + throw Gi(new Hi(), "Cannot compare non numeric or missing values", e10, g10, f10, false); + } + function dda(a10, b10, c10) { + c10.j = b10.j; + b10.Y().vb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + var k10 = Ih().xd; + if (null === h10 ? null !== k10 : !h10.h(k10)) + if (k10 = Vb().Ia(Ti(f10.Y(), h10)), k10 instanceof z7) + g10 = $ca(e10, h10, g10.r, k10.i.r), Vd(f10, h10, g10); + else { + if (y7() !== k10) + throw new x7().d(k10); + Ui(f10.Y(), h10, g10.r, g10.x); + } + } else + throw new x7().d(g10); + }; + }(a10, c10))); + return c10; + } + function bda(a10, b10, c10) { + if (b10.Da() && c10.Da()) { + var e10 = b10.kc(); + if (e10.b()) + g10 = false; + else { + g10 = e10.c(); + var f10 = c10.kc(); + if (f10.b()) + g10 = false; + else { + f10 = f10.c(); + f10 = la(f10); + g10 = la(g10); + var g10 = f10 !== g10; + } + } + if (g10) + throw a10 = b10.ga(), a10 = la(a10), c10 = c10.ga(), c10 = la(c10), b10 = new z7().d(ic(qf().ch.r)), g10 = e10.b() ? y7() : e10.c().Ib(), e10 = e10.b() ? y7() : Ab(e10.c().fa(), q5(jd)), Gi(new Hi(), "Values in subtype enumeration are from different class '" + a10 + "' of the super type enumeration '" + c10 + "'", b10, g10, e10, false); + K7(); + e10 = new z7().d(b10); + null !== e10.i && 0 === e10.i.Oe(1) && e10.i.lb(0) instanceof Vi && (e10 = new eda(), g10 = K7(), e10 = c10.ec(e10, g10.u), b10.U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = B6(m10.aa, Wi().vf).A; + if (!k10.Ha(p10.b() ? null : p10.c())) { + p10 = w6(/* @__PURE__ */ function() { + return function(v10) { + return B6(v10.aa, Wi().vf); + }; + }(h10)); + var t10 = K7(); + throw Gi(new Hi(), "Values in subtype enumeration (" + l10.ka(p10, t10.u).Kg(",") + ") not found in the supertype enumeration (" + k10.Kg(",") + ")", new z7().d(ic(qf().ch.r)), yb(m10), Ab(m10.Xa, q5(jd)), false); + } + }; + }(a10, e10, b10)))); + } + } + function Xi(a10, b10, c10, e10, f10) { + b10.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + if (!h10.Ha(m10)) { + var p10 = Vb().Ia(Ti(k10.Y(), m10)), t10 = Vb().Ia(Ti(l10.Y(), m10)), v10 = false, A10 = null; + if (p10 instanceof z7) { + v10 = true; + A10 = p10; + var D10 = A10.i; + if (t10.b()) + return Rg(k10, m10, D10.r, D10.x); + } + if (y7() === p10 && t10.na()) + return p10 = Yi(O7(), t10.c().x), g10.pn && fda(p10, l10), Ui(k10.Y(), m10, t10.c().r, p10); + if (v10 && (v10 = A10.i, t10.na())) + return p10 = Yi(O7(), v10.x), A10 = v10.r, t10 = t10.c().r, t10 = $ca(g10, m10, A10, t10), v10 = v10.r, (null === t10 ? null !== v10 : !t10.h(v10)) && g10.pn && fda(p10, l10), t10 = Db(t10, p10), Ui(k10.Y(), m10, t10, p10); + } + }; + }(a10, f10, c10, e10))); + } + function Fi(a10, b10, c10) { + if (b10 instanceof jh && Vb().Ia(b10.r).na() && c10 instanceof jh && Vb().Ia(c10.r).na()) { + var e10 = Si(b10), f10 = Si(c10); + if ("max" === a10) + return za(e10) <= za(f10) ? c10 : b10; + if ("min" === a10) + return za(e10) >= za(f10) ? c10 : b10; + throw Gi(new Hi(), "Unknown numeric comparison " + a10, y7(), y7(), y7(), false); + } + throw Gi(new Hi(), "Cannot compare non numeric or missing values", y7(), y7(), y7(), false); + } + function Ii(a10, b10, c10, e10, f10) { + if (a10 instanceof jh && Vb().Ia(a10.r).na() && b10 instanceof jh && Vb().Ia(b10.r).na()) + return a10 = a10.t(), b10 = b10.t(), a10 === b10; + throw Gi(new Hi(), "Cannot compare non numeric or missing values", c10, e10, f10, false); + } + function ada(a10) { + return a10 instanceof jh && Vb().Ia(a10.r).na() && a10 instanceof jh && Vb().Ia(a10.r).na() ? new z7().d(a10.t()) : y7(); + } + function fda(a10, b10) { + wh(a10, q5(Zi)) || a10.Lb(new $i().e(b10.j)); + } + function cda(a10, b10, c10, e10) { + if (c10 instanceof jh && Vb().Ia(c10.r).na() && e10 instanceof jh && Vb().Ia(e10.r).na()) + return c10 = aj(c10), e10 = aj(e10), c10 === a10 && e10 === b10; + throw Gi(new Hi(), "Cannot compare non boolean or missing values", y7(), y7(), y7(), false); + } + function bj(a10, b10) { + var c10 = a10.xf.Wg.Wg.Ja(b10.j); + return c10 instanceof z7 ? c10.i : a10.Oba(b10); + } + function gda(a10) { + var b10 = zc(), c10 = F6().Ta; + a10.K_(rb(new sb(), b10, G5(c10, "isAbstract"), tb(new ub(), vb().Ta, "isAbstract", "Defines a model as abstract", H10()))); + } + function hda(a10) { + var b10 = new xc().yd(cj()), c10 = F6().Ta; + a10.Z8(rb(new sb(), b10, G5(c10, "header"), tb(new ub(), vb().Ta, "header", "Parameter passed as a header to an operation for communication models", H10()))); + b10 = new xc().yd(cj()); + c10 = F6().Ta; + a10.$8(rb(new sb(), b10, G5(c10, "parameter"), tb(new ub(), vb().Ta, "parameter", "Parameters associated to the communication model", H10()))); + b10 = qf(); + c10 = F6().Ta; + a10.a9(rb(new sb(), b10, G5(c10, "queryString"), tb(new ub(), vb().Ta, "query string", "Query string for the communication model", H10()))); + b10 = new xc().yd(cj()); + c10 = F6().Ta; + a10.b9(rb(new sb(), b10, G5(c10, "uriParameter"), tb(new ub(), vb().Ta, "uri parameter", "", H10()))); + } + function ida(a10) { + var b10 = new xc().yd(dj()), c10 = F6().Ta; + a10.rS(rb(new sb(), b10, G5(c10, "tag"), tb(new ub(), vb().Ta, "tag", "Additionally custom tagged information", H10()))); + } + function ej(a10) { + var b10 = qb(), c10 = F6().Jb; + a10.Cz(rb(new sb(), b10, G5(c10, "bindingVersion"), tb(new ub(), vb().Jb, "bindingVersion", "The version of this binding", H10()))); + } + function jda(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new ij().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + c10 = Sd(c10, b10, e10); + e10 = a10.j; + b10 = new je4().e(b10); + b10 = c10.pc(e10 + "/resourceType/" + jj(b10.td)); + c10 = nc().Ni(); + ig(a10, c10, b10); + return b10; + } + function kda(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new kj().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + c10 = Sd(c10, b10, e10); + e10 = a10.j; + b10 = new je4().e(b10); + b10 = c10.pc(e10 + "/trait/" + jj(b10.td)); + c10 = nc().Ni(); + ig(a10, c10, b10); + return b10; + } + function lj(a10, b10) { + var c10 = lda(mj()); + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return new R6().M(g10, f10); + }; + }(a10, b10)); + b10 = K7(); + return c10.ka(a10, b10.u).Ch(Gb().si); + } + function nj(a10, b10, c10, e10, f10) { + b10 = ic(G5(a10.ey, b10)); + a10 = J5(K7(), new Ib().ha([a10.ty])); + oj(); + K7(); + pj(); + var g10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var h10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var k10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var l10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var m10 = new Lf().a().ua(); + oj(); + var p10 = y7(); + oj(); + K7(); + pj(); + var t10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var v10 = new Lf().a(); + return qj(new rj(), b10, c10, e10, f10, a10, g10, h10, k10, l10, m10, p10, t10, v10.ua(), (oj(), y7()), (oj(), y7()), (oj(), y7())); + } + function sj(a10, b10, c10) { + c10 = B6(tj(b10).g, wj().ej).Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = B6(g10.g, $d().R).A; + return (g10.b() ? null : g10.c()) === f10; + }; + }(a10, c10))); + c10.b() ? a10 = y7() : (c10 = c10.c(), b10 = mda(b10, xj(c10)), a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return ka(e10); + }; + }(a10)), c10 = K7(), a10 = new z7().d(b10.ka(a10, c10.u))); + return a10.b() ? H10() : a10.c(); + } + function nda(a10, b10) { + if (b10 instanceof z7) + return b10.i; + if (y7() === b10) + throw mb(E6(), new nb().e("Missing mandatory property '" + a10 + "'")); + throw new x7().d(b10); + } + function yj(a10, b10, c10) { + a10 = B6(tj(b10).g, wj().ej).Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = B6(g10.g, $d().R).A; + return (g10.b() ? null : g10.c()) === f10; + }; + }(a10, c10))); + a10.b() ? b10 = y7() : (a10 = a10.c(), b10 = oda(b10, xj(a10))); + if (b10.b()) + return y7(); + b10 = b10.c(); + return new z7().d(ka(b10)); + } + function pda(a10, b10) { + var c10 = Mc(ua(), a10, "\\."); + c10 = zj(new Pc().fd(c10)); + b10 = b10.Ja(c10); + return b10 instanceof z7 ? (b10 = b10.i, a10.split(c10 + ".").join(b10)) : a10; + } + function qda(a10, b10) { + var c10 = Rb(Sb(), H10()), e10 = B6(tj(b10).g, wj().ej).Fb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, $d().R).A; + return "prefixes" === (f10.b() ? null : f10.c()); + }; + }(a10))); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(xj(e10))); + e10 instanceof z7 && rda(b10, e10.i).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = yj(f10, h10, "prefix"); + k10 = k10.b() ? "" : k10.c(); + h10 = yj(f10, h10, "uri"); + h10 = h10.b() ? "" : h10.c(); + return g10.Ue(k10, h10); + }; + }(a10, c10))); + return c10; + } + function sda(a10, b10, c10, e10) { + a10 = B6(tj(b10).g, wj().ej).Fb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10 = B6(h10.g, $d().R).A; + return (h10.b() ? null : h10.c()) === g10; + }; + }(a10, c10))); + a10.b() ? e10 = y7() : (a10 = a10.c(), b10 = rda(b10, xj(a10)), a10 = K7(), e10 = new z7().d(b10.ka(e10, a10.u))); + return e10.b() ? H10() : e10.c(); + } + function tda(a10, b10) { + a10.U1(true); + b10.P(a10); + !a10.BV && a10.AV && (b10 = a10.Fa, b10.CK = b10.CK.substring(2), uda(a10.Fa)); + } + function vda(a10) { + if (a10.BV) { + if (a10.AV) { + var b10 = a10.Fa; + b10.CK += " "; + uda(a10.Fa); + } + a10.V1(false); + } else + b10 = new Aj().d(a10.Fa.Ps), a10.Fa.Ww.yD(b10.Rp, 44), uda(a10.Fa); + } + function Bj(a10, b10) { + return a10 === b10 || a10.h(b10); + } + function Cj(a10) { + a10 = a10.ika().kc(); + return a10.b() ? wda(Dj(), T6().nd) : a10.c(); + } + function Ej() { + } + function u7() { + } + u7.prototype = Ej.prototype; + Ej.prototype.a = function() { + return this; + }; + Ej.prototype.h = function(a10) { + return this === a10; + }; + Ej.prototype.t = function() { + var a10 = Fj(la(this)), b10 = (+(this.z() >>> 0)).toString(16); + return a10 + "@" + b10; + }; + Ej.prototype.z = function() { + return qaa(this); + }; + Ej.prototype.toString = function() { + return this.t(); + }; + function xda(a10, b10) { + if (a10 = a10 && a10.$classData) { + var c10 = a10.RN || 0; + return !(c10 < b10) && (c10 > b10 || !a10.QN.isPrimitive); + } + return false; + } + var Ha = r8({ f: 0 }, false, "java.lang.Object", { f: 1 }, void 0, void 0, function(a10) { + return null !== a10; + }, xda); + Ej.prototype.$classData = Ha; + function Gj(a10, b10) { + b10 = new Ld().kn(b10); + return yda(a10, b10); + } + function zda(a10, b10) { + b10 !== a10 && b10.wP(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.IW(e10); + }; + }(a10)), Ada()); + return a10; + } + function yda(a10, b10) { + if (a10.IW(b10)) + return a10; + throw new Hj().e("Promise already completed."); + } + function Ij(a10, b10) { + b10 = new Kd().d(b10); + return yda(a10, b10); + } + function Bda(a10, b10) { + if (b10 instanceof Jj) { + b10 = null === b10 ? 0 : b10.r; + var c10 = Kj(Lj(), 0); + 0 <= a10.gs(c10) ? (c10 = Kj(Lj(), 65535), c10 = 0 >= a10.gs(c10)) : c10 = false; + return c10 && a10.Xl.gH() === b10; + } + if (faa(b10)) + return b10 |= 0, c10 = Kj(Lj(), -128), 0 <= a10.gs(c10) ? (c10 = Kj(Lj(), 127), c10 = 0 >= a10.gs(c10)) : c10 = false, c10 && a10.oja() === b10; + if (haa(b10)) + return b10 |= 0, c10 = Kj(Lj(), -32768), 0 <= a10.gs(c10) ? (c10 = Kj(Lj(), 32767), c10 = 0 >= a10.gs(c10)) : c10 = false, c10 && a10.Upa() === b10; + if (Ca(b10)) + return b10 |= 0, c10 = Kj(Lj(), -2147483648), 0 <= a10.gs(c10) ? (c10 = Kj(Lj(), 2147483647), c10 = 0 >= a10.gs(c10)) : c10 = false, c10 && a10.Xl.gH() === b10; + if (b10 instanceof qa) { + c10 = Da(b10); + b10 = c10.od; + c10 = c10.Ud; + a10 = a10.Xl.rba(); + var e10 = a10.Ud; + return a10.od === b10 && e10 === c10; + } + return na(b10) ? (b10 = +b10, a10 = a10.Xl, a10 = Mj(Nj(), a10), da(Oj(va(), a10)) === b10) : "number" === typeof b10 ? (b10 = +b10, a10 = a10.Xl, Oj(va(), Mj(Nj(), a10)) === b10) : false; + } + function Cda(a10, b10) { + return 0 <= a10.oM(b10) ? ka(ya(a10.hea(), a10.oM(b10), a10.xT(b10))) : null; + } + function Dda(a10) { + var b10 = new Pj().Kaa(a10.oW); + Eda(a10.Fa.Rw, b10); + return b10.t(); + } + function Rj(a10, b10, c10, e10) { + return Sj(a10).rm(new Tj().a(), b10, c10, e10).Ef.qf; + } + function Fda(a10, b10, c10, e10, f10) { + var g10 = new Uj().eq(true); + Vj(b10, c10); + a10.U(w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + k10.oa ? k10.oa = false : Vj(l10, m10); + return Wj(l10, p10); + }; + }(a10, g10, b10, e10))); + Vj(b10, f10); + return b10; + } + function Sj(a10) { + return Gda(new Xj().a(), a10); + } + function Hda(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.tF(e10); + }; + }(a10))); + return a10; + } + function Ida(a10, b10) { + return b10.Hd().Ql(a10, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return c10.al(e10); + }; + }(a10))); + } + function Yj(a10) { + var b10 = ja(Ja(Ha), [a10.n.length]); + Ba(a10, 0, b10, 0, a10.n.length); + return b10; + } + function Jda(a10, b10, c10) { + if (32 > c10) + return a10.Fl().n[31 & b10]; + if (1024 > c10) + return a10.me().n[31 & (b10 >>> 5 | 0)].n[31 & b10]; + if (32768 > c10) + return a10.Te().n[31 & (b10 >>> 10 | 0)].n[31 & (b10 >>> 5 | 0)].n[31 & b10]; + if (1048576 > c10) + return a10.Eg().n[31 & (b10 >>> 15 | 0)].n[31 & (b10 >>> 10 | 0)].n[31 & (b10 >>> 5 | 0)].n[31 & b10]; + if (33554432 > c10) + return a10.Ej().n[31 & (b10 >>> 20 | 0)].n[31 & (b10 >>> 15 | 0)].n[31 & (b10 >>> 10 | 0)].n[31 & (b10 >>> 5 | 0)].n[31 & b10]; + if (1073741824 > c10) + return a10.js().n[31 & (b10 >>> 25 | 0)].n[31 & (b10 >>> 20 | 0)].n[31 & (b10 >>> 15 | 0)].n[31 & (b10 >>> 10 | 0)].n[31 & (b10 >>> 5 | 0)].n[31 & b10]; + throw new Zj().a(); + } + function Kda(a10, b10, c10, e10) { + if (!(32 > e10)) + if (1024 > e10) + 1 === a10.Un() && (a10.Jg(ja(Ja(Ha), [32])), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])); + else if (32768 > e10) + 2 === a10.Un() && (a10.ui(ja(Ja(Ha), [32])), a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(), a10.rw(1 + a10.Un() | 0)), a10.Jg(a10.Te().n[31 & (c10 >>> 10 | 0)]), null === a10.me() && a10.Jg(ja(Ja(Ha), [32])), a10.Zh(ja(Ja(Ha), [32])); + else if (1048576 > e10) + 3 === a10.Un() && (a10.Gl(ja(Ja(Ha), [32])), a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(), a10.rw(1 + a10.Un() | 0)), a10.ui(a10.Eg().n[31 & (c10 >>> 15 | 0)]), null === a10.Te() && a10.ui(ja(Ja(Ha), [32])), a10.Jg(a10.Te().n[31 & (c10 >>> 10 | 0)]), null === a10.me() && a10.Jg(ja(Ja(Ha), [32])), a10.Zh(ja(Ja(Ha), [32])); + else if (33554432 > e10) + 4 === a10.Un() && (a10.xr(ja(Ja(Ha), [32])), a10.Ej().n[31 & (b10 >>> 20 | 0)] = a10.Eg(), a10.rw(1 + a10.Un() | 0)), a10.Gl(a10.Ej().n[31 & (c10 >>> 20 | 0)]), null === a10.Eg() && a10.Gl(ja(Ja(Ha), [32])), a10.ui(a10.Eg().n[31 & (c10 >>> 15 | 0)]), null === a10.Te() && a10.ui(ja(Ja(Ha), [32])), a10.Jg(a10.Te().n[31 & (c10 >>> 10 | 0)]), null === a10.me() && a10.Jg(ja(Ja(Ha), [32])), a10.Zh(ja(Ja(Ha), [32])); + else if (1073741824 > e10) + 5 === a10.Un() && (a10.rG(ja(Ja(Ha), [32])), a10.js().n[31 & (b10 >>> 25 | 0)] = a10.Ej(), a10.rw(1 + a10.Un() | 0)), a10.xr(a10.js().n[31 & (c10 >>> 25 | 0)]), null === a10.Ej() && a10.xr(ja(Ja(Ha), [32])), a10.Gl(a10.Ej().n[31 & (c10 >>> 20 | 0)]), null === a10.Eg() && a10.Gl(ja(Ja(Ha), [32])), a10.ui(a10.Eg().n[31 & (c10 >>> 15 | 0)]), null === a10.Te() && a10.ui(ja(Ja(Ha), [32])), a10.Jg(a10.Te().n[31 & (c10 >>> 10 | 0)]), null === a10.me() && a10.Jg(ja(Ja(Ha), [32])), a10.Zh(ja(Ja(Ha), [32])); + else + throw new Zj().a(); + } + function ak(a10, b10, c10) { + var e10 = ja(Ja(Ha), [32]); + Ba(a10, b10, e10, c10, 32 - (c10 > b10 ? c10 : b10) | 0); + return e10; + } + function Lda(a10, b10, c10) { + if (!(32 > c10)) + if (1024 > c10) + a10.Zh(a10.me().n[31 & (b10 >>> 5 | 0)]); + else if (32768 > c10) + a10.Jg(a10.Te().n[31 & (b10 >>> 10 | 0)]), a10.Zh(a10.me().n[31 & (b10 >>> 5 | 0)]); + else if (1048576 > c10) + a10.ui(a10.Eg().n[31 & (b10 >>> 15 | 0)]), a10.Jg(a10.Te().n[31 & (b10 >>> 10 | 0)]), a10.Zh(a10.me().n[31 & (b10 >>> 5 | 0)]); + else if (33554432 > c10) + a10.Gl(a10.Ej().n[31 & (b10 >>> 20 | 0)]), a10.ui(a10.Eg().n[31 & (b10 >>> 15 | 0)]), a10.Jg(a10.Te().n[31 & (b10 >>> 10 | 0)]), a10.Zh(a10.me().n[31 & (b10 >>> 5 | 0)]); + else if (1073741824 > c10) + a10.xr(a10.js().n[31 & (b10 >>> 25 | 0)]), a10.Gl(a10.Ej().n[31 & (b10 >>> 20 | 0)]), a10.ui(a10.Eg().n[31 & (b10 >>> 15 | 0)]), a10.Jg(a10.Te().n[31 & (b10 >>> 10 | 0)]), a10.Zh(a10.me().n[31 & (b10 >>> 5 | 0)]); + else + throw new Zj().a(); + } + function Mda(a10, b10) { + var c10 = -1 + a10.Un() | 0; + switch (c10) { + case 5: + a10.rG(Yj(a10.js())); + a10.xr(Yj(a10.Ej())); + a10.Gl(Yj(a10.Eg())); + a10.ui(Yj(a10.Te())); + a10.Jg(Yj(a10.me())); + a10.js().n[31 & (b10 >>> 25 | 0)] = a10.Ej(); + a10.Ej().n[31 & (b10 >>> 20 | 0)] = a10.Eg(); + a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(); + a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(); + a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(); + break; + case 4: + a10.xr(Yj(a10.Ej())); + a10.Gl(Yj(a10.Eg())); + a10.ui(Yj(a10.Te())); + a10.Jg(Yj(a10.me())); + a10.Ej().n[31 & (b10 >>> 20 | 0)] = a10.Eg(); + a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(); + a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(); + a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(); + break; + case 3: + a10.Gl(Yj(a10.Eg())); + a10.ui(Yj(a10.Te())); + a10.Jg(Yj(a10.me())); + a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(); + a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(); + a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(); + break; + case 2: + a10.ui(Yj(a10.Te())); + a10.Jg(Yj(a10.me())); + a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(); + a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(); + break; + case 1: + a10.Jg(Yj(a10.me())); + a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(); + break; + case 0: + break; + default: + throw new x7().d(c10); + } + } + function bk(a10, b10) { + var c10 = a10.n[b10]; + a10.n[b10] = null; + return Yj(c10); + } + function ck(a10, b10, c10) { + a10.rw(c10); + c10 = -1 + c10 | 0; + switch (c10) { + case -1: + break; + case 0: + a10.Zh(b10.Fl()); + break; + case 1: + a10.Jg(b10.me()); + a10.Zh(b10.Fl()); + break; + case 2: + a10.ui(b10.Te()); + a10.Jg(b10.me()); + a10.Zh(b10.Fl()); + break; + case 3: + a10.Gl(b10.Eg()); + a10.ui(b10.Te()); + a10.Jg(b10.me()); + a10.Zh(b10.Fl()); + break; + case 4: + a10.xr(b10.Ej()); + a10.Gl(b10.Eg()); + a10.ui(b10.Te()); + a10.Jg(b10.me()); + a10.Zh(b10.Fl()); + break; + case 5: + a10.rG(b10.js()); + a10.xr(b10.Ej()); + a10.Gl(b10.Eg()); + a10.ui(b10.Te()); + a10.Jg(b10.me()); + a10.Zh(b10.Fl()); + break; + default: + throw new x7().d(c10); + } + } + function Nda(a10) { + return null === a10 ? Oda() : a10; + } + function Pda(a10) { + return a10 === Oda() ? null : a10; + } + var Qda = r8({ O2: 0 }, true, "scala.collection.mutable.HashEntry", { O2: 1 }); + function dk() { + this.Vp = this.ew = this.ct = null; + } + dk.prototype = new u7(); + dk.prototype.constructor = dk; + dk.prototype.a = function() { + Rda = this; + this.ct = Tb(); + this.ew = Ub(); + this.Vp = hk(); + return this; + }; + Object.defineProperty(dk.prototype, "AMF", { get: function() { + return this.Vp; + }, configurable: true }); + Object.defineProperty(dk.prototype, "OAS", { get: function() { + return this.ew; + }, configurable: true }); + Object.defineProperty(dk.prototype, "RAML", { get: function() { + return this.ct; + }, configurable: true }); + dk.prototype.$classData = r8({ hra: 0 }, false, "amf.MessageStyles$", { hra: 1, f: 1 }); + var Rda = void 0; + function ik() { + Rda || (Rda = new dk().a()); + return Rda; + } + function jk() { + this.BZ = this.nX = this.TF = this.UF = this.ct = this.Cp = this.QF = this.ew = this.Vp = this.Xpa = null; + this.xa = false; + } + jk.prototype = new u7(); + jk.prototype.constructor = jk; + jk.prototype.a = function() { + Sda = this; + this.Vp = kk(); + this.ew = lk(); + this.QF = mk(); + this.Cp = nk(); + this.ct = ok2(); + this.UF = pk(); + this.TF = qk(); + Tda || (Tda = new rk().a()); + this.nX = Tda; + Uda || (Uda = new sk().a()); + this.BZ = Uda; + return this; + }; + function lda(a10) { + if (!a10.xa && !a10.xa) { + var b10 = K7(), c10 = [kk(), lk(), mk(), nk(), ok2(), qk(), pk()]; + a10.Xpa = J5(b10, new Ib().ha(c10)); + a10.xa = true; + } + return a10.Xpa; + } + Object.defineProperty(jk.prototype, "specProfiles", { get: function() { + return lda(this); + }, configurable: true }); + Object.defineProperty(jk.prototype, "PAYLOAD", { get: function() { + return this.BZ; + }, configurable: true }); + Object.defineProperty(jk.prototype, "AML", { get: function() { + return this.nX; + }, configurable: true }); + Object.defineProperty(jk.prototype, "RAML08", { get: function() { + return this.TF; + }, configurable: true }); + Object.defineProperty(jk.prototype, "RAML10", { get: function() { + return this.UF; + }, configurable: true }); + Object.defineProperty(jk.prototype, "RAML", { get: function() { + return this.ct; + }, configurable: true }); + Object.defineProperty(jk.prototype, "OAS30", { get: function() { + return this.Cp; + }, configurable: true }); + Object.defineProperty(jk.prototype, "OAS20", { get: function() { + return this.QF; + }, configurable: true }); + Object.defineProperty(jk.prototype, "OAS", { get: function() { + return this.ew; + }, configurable: true }); + Object.defineProperty(jk.prototype, "AMF", { get: function() { + return this.Vp; + }, configurable: true }); + jk.prototype.$classData = r8({ ora: 0 }, false, "amf.ProfileNames$", { ora: 1, f: 1 }); + var Sda = void 0; + function mj() { + Sda || (Sda = new jk().a()); + return Sda; + } + function Vda() { + this.l = this.fq = this.gk = null; + } + Vda.prototype = new u7(); + Vda.prototype.constructor = Vda; + function tk(a10, b10, c10) { + var e10 = new Vda(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + function uk(a10) { + var b10 = a10.gk; + a10 = a10.fq; + K7(); + vk(); + for (var c10 = new Ib().a(), e10 = 0, f10 = b10.length | 0; e10 < f10; ) { + var g10 = a10.Kc(b10[e10]); + c10.L.push(g10); + e10 = 1 + e10 | 0; + } + return c10; + } + Vda.prototype.$classData = r8({ Era: 0 }, false, "amf.client.convert.CollectionConverter$ClientListOps", { Era: 1, f: 1 }); + function Wda() { + this.l = this.gk = null; + } + Wda.prototype = new u7(); + Wda.prototype.constructor = Wda; + function Xda(a10, b10) { + var c10 = new Wda(); + c10.gk = b10; + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + return c10; + } + Wda.prototype.$classData = r8({ Fra: 0 }, false, "amf.client.convert.CollectionConverter$ClientOptionOps", { Fra: 1, f: 1 }); + function wk() { + this.l = this.fq = this.gk = null; + } + wk.prototype = new u7(); + wk.prototype.constructor = wk; + wk.prototype.Ra = function() { + return Yda(this.l, this.gk, this.fq); + }; + wk.prototype.$classData = r8({ Gra: 0 }, false, "amf.client.convert.CollectionConverter$InternalImmutableMapOps", { Gra: 1, f: 1 }); + function xk() { + this.l = this.fq = this.gk = null; + } + xk.prototype = new u7(); + xk.prototype.constructor = xk; + function Zda(a10, b10, c10) { + var e10 = new xk(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + xk.prototype.Ra = function() { + return $da(this.l, this.gk, this.fq); + }; + xk.prototype.$classData = r8({ Hra: 0 }, false, "amf.client.convert.CollectionConverter$InternalMapOps", { Hra: 1, f: 1 }); + function yk() { + this.l = this.fq = this.gk = null; + } + yk.prototype = new u7(); + yk.prototype.constructor = yk; + function bb(a10, b10, c10) { + var e10 = new yk(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + yk.prototype.Ra = function() { + var a10 = this.gk; + var b10 = this.fq; + a10.b() ? b10 = y7() : (a10 = a10.c(), b10 = new z7().d(b10.zc(a10))); + b10 = b10.b() ? void 0 : b10.c(); + return b10; + }; + yk.prototype.$classData = r8({ Ira: 0 }, false, "amf.client.convert.CollectionConverter$InternalOptionOps", { Ira: 1, f: 1 }); + function zk() { + this.l = this.fq = this.gk = null; + } + zk.prototype = new u7(); + zk.prototype.constructor = zk; + zk.prototype.Ra = function() { + return aea(this.l, this.gk, this.fq); + }; + function Ak(a10, b10, c10) { + var e10 = new zk(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + zk.prototype.$classData = r8({ Jra: 0 }, false, "amf.client.convert.CollectionConverter$InternalSeqOps", { Jra: 1, f: 1 }); + function Bk() { + } + Bk.prototype = new u7(); + Bk.prototype.constructor = Bk; + Bk.prototype.a = function() { + return this; + }; + Bk.prototype.fda = function(a10) { + var b10 = Af(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof bg) + return new Fk().RG(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Gk(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof mf) + return new Ik().Xz(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Jk(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (Kk(c10)) + return new Lk().CB(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = bea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Mk) + return new Nk().QG(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Ok(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Pk) + return new Qk().V$(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = nc(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (Rk(c10)) + return ab(), cea(ab().jr(), c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Sk(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Pd) + return new Tk().HO(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Ud(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Td) + return new Uk().cE(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Qi(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Vk) + return new Wk().Y$(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = dea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Xk) + return ab().cS(), new Yk().aE(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = Wi(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof Vi) + return ab().eS(), new Zk().GO(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = al(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof bl) + return ab().qR(), new cl().aU(c10); + throw new x7().d(c10); + }; + }(this))); + b10 = dl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof el) + return fl(ab().Um(), c10); + throw new x7().d(c10); + }; + }(this))); + b10 = gl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(c10) { + if (c10 instanceof hl) + return eea(c10); + throw new x7().d(c10); + }; + }(this))); + }; + Bk.prototype.$classData = r8({ Ura: 0 }, false, "amf.client.convert.CoreRegister$", { Ura: 1, f: 1 }); + var fea = void 0; + function gea() { + this.l = this.fq = this.gk = null; + } + gea.prototype = new u7(); + gea.prototype.constructor = gea; + function il(a10) { + return hea(a10.l, a10.gk, a10.fq); + } + function jl(a10, b10, c10) { + var e10 = new gea(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + gea.prototype.$classData = r8({ wsa: 0 }, false, "amf.client.convert.FutureConverter$ClientFutureOps", { wsa: 1, f: 1 }); + function kl() { + this.l = this.fq = this.gk = null; + } + kl.prototype = new u7(); + kl.prototype.constructor = kl; + function ll(a10, b10, c10) { + var e10 = new kl(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + kl.prototype.Ra = function() { + var a10 = this.gk.Yg(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return b10.fq.zc(c10); + }; + }(this)), ml()); + return iea(a10); + }; + kl.prototype.$classData = r8({ xsa: 0 }, false, "amf.client.convert.FutureConverter$InternalFutureOps", { xsa: 1, f: 1 }); + function nl() { + } + nl.prototype = new u7(); + nl.prototype.constructor = nl; + nl.prototype.a = function() { + return this; + }; + nl.prototype.fda = function(a10) { + var b10 = jea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof ol) + return new pl().LK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = kea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof ql) + return new rl().MK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = sl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof tl) + return new ul().Yz(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = lea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof vl) + return new wl().NK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = mea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof xl) + return new yl().OK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = nea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof zl) + return new Al().PK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = oea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Bl) + return new Cl().QK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = pea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Dl) + return new El().RK(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = qea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Fl) + return new Gl().UG(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = rea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Hl) + return new Il().VG(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Jl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Kl) + return new Ll().LO(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Ml(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Nl) + return new Ol().xla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Pl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Ql) + return new Sl().oU(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Tl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Ul) + return new Vl().yla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = cj(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Wl) + return new Xl().zla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Yl(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Zl) + return new $l().Ela(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = am(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof bm) + return new cm().tla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = dm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof em) + return new fm().vla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = sea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof ij) + return new gm().cma(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = tea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof kj) + return new hm().dma(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = im(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof jm) + return new km().Yla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = rm2(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof tm) + return new um().$la(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Xh(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof vm) + return new wm().ama(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = xm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof ym) + return new zm().Bla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Am(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Bm) + return new Cm().Cla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Dm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Em) + return new Fm().Dla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Gm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Hm) + return new Im().Zla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Jm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Km) + return new Mm().Xla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Nm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Om) + return new Pm().XG(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Qm(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Rm) + return new Sm().Gla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = uea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Tm) + return new Um().m1(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = vea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Vm) + return new Wm().l1(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Ag(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof vh) + return new Xm().Gw(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = wea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Th) + return new Ym().saa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = uh(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof th) + return new Zm().WG(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = xea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof pi) + return new $m().WG(e10.dI()); + throw new x7().d(e10); + }; + }(this))); + b10 = an(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof qi) + return new bn().rla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = li(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof cn) + return new dn().ola(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = ag(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof en) + return new fn().pla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = gn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Wh) + return new mn().raa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Ih(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Hh) + return new nn().taa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Fg(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Mh) + return new on4().uaa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = pn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Gh) + return new qn().vaa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = rn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof sn) + return new tn().sla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = un(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof vn) + return new wn().qla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = xn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Vh) + return new yn().xaa(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Ci(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof zi) + return new zn().ela(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = An(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Bn) + return new Cn().Fla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Gn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Hn) + return new In().wla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Jn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Kn) + return new Mn().ula(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Nn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof On) + return new Pn().Jla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Qn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Rn) + return new Sn().Kla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Tn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Un) + return new Vn().Nla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Wn(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Xn) + return new Yn().Lla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = yea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Zn) + return new co().Mla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = eo(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof fo) + return new go().Ola(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = ho(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof io) + return new jo().Pla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = zea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof ko) + return new lo().Qla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = mo(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof no) + return new oo().Rla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Aea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof po) + return new qo().Sla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = ro(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof so) + return new to().Tla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = uo(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof vo) + return new wo().Ula(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = xo(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof yo) + return new zo().Vla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Ao(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Bo) + return new Co().Wla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Do(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Eo) + return new Go().Hla(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = Bea(); + Ek(a10, b10, w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Ho) + return new Io().Ila(e10); + throw new x7().d(e10); + }; + }(this))); + b10 = dc().Bf; + var c10 = dc().Am; + Jo(a10, b10, c10); + b10 = Wd().Bf; + c10 = Wd().Am; + Jo(a10, b10, c10); + b10 = sg().Bf; + c10 = sg().Am; + Jo(a10, b10, c10); + b10 = Ko().Bf; + c10 = Ko().Am; + Jo(a10, b10, c10); + b10 = Lo().Bf; + c10 = Lo().Am; + Jo(a10, b10, c10); + b10 = Mo().Bf; + c10 = Mo().Am; + Jo(a10, b10, c10); + No(); + a10 = Cea(); + Oo(Po(), a10); + }; + nl.prototype.$classData = r8({ Fta: 0 }, false, "amf.client.convert.WebApiRegister$", { Fta: 1, f: 1 }); + var Dea = void 0; + function Qo() { + } + Qo.prototype = new u7(); + Qo.prototype.constructor = Qo; + Qo.prototype.a = function() { + return this; + }; + function Eea(a10, b10) { + return new Ro().d(/* @__PURE__ */ function(c10, e10) { + return function(f10, g10, h10, k10, l10, m10, p10) { + e10.reportConstraint(f10, g10, h10, k10, l10, m10, p10); + }; + }(a10, b10)); + } + Qo.prototype.handler = function(a10) { + return Eea(this, a10); + }; + Qo.prototype.$classData = r8({ Mta: 0 }, false, "amf.client.handler.ErrorHandler$", { Mta: 1, f: 1 }); + var Fea = void 0; + function So(a10) { + ab(); + a10 = a10.oc().fa(); + To(); + return new Uo().dq(a10); + } + function Vo() { + this.aB = this.zp = this.Yr = this.bB = this.MA = this.rx = this.Ly = this.NA = this.tj = this.hw = this.jo = this.Mi = this.TC = this.of = this.Nh = this.mr = this.Xo = this.hi = this.zj = null; + } + Vo.prototype = new u7(); + Vo.prototype.constructor = Vo; + Vo.prototype.a = function() { + Gea = this; + this.zj = Uh().zj; + this.hi = Uh().hi; + this.Xo = Uh().Xo; + this.mr = Uh().mr; + this.Nh = Uh().Nh; + this.of = Uh().of; + this.TC = Uh().TC; + this.Mi = Uh().Mi; + this.jo = Uh().jo; + this.hw = Uh().hw; + this.tj = Uh().tj; + this.NA = Uh().NA; + this.Ly = Uh().Ly; + this.rx = Uh().rx; + this.MA = Uh().MA; + this.bB = Uh().bB; + this.Yr = Uh().Yr; + this.zp = Uh().zp; + this.aB = Uh().aB; + return this; + }; + Object.defineProperty(Vo.prototype, "Nil", { get: function() { + return this.aB; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "AnyUri", { get: function() { + return this.zp; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Any", { get: function() { + return this.Yr; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Password", { get: function() { + return this.bB; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Binary", { get: function() { + return this.MA; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Byte", { get: function() { + return this.rx; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "File", { get: function() { + return this.Ly; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "DateTimeOnly", { get: function() { + return this.NA; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "DateTime", { get: function() { + return this.tj; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Time", { get: function() { + return this.hw; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Date", { get: function() { + return this.jo; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Boolean", { get: function() { + return this.Mi; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Decimal", { get: function() { + return this.TC; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Float", { get: function() { + return this.of; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Double", { get: function() { + return this.Nh; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Long", { get: function() { + return this.mr; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Number", { get: function() { + return this.Xo; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "Integer", { get: function() { + return this.hi; + }, configurable: true }); + Object.defineProperty(Vo.prototype, "String", { get: function() { + return this.zj; + }, configurable: true }); + Vo.prototype.$classData = r8({ Uta: 0 }, false, "amf.client.model.DataTypes$", { Uta: 1, f: 1 }); + var Gea = void 0; + function Wo() { + this.wR = this.h2 = this.ns = this.Hj = this.Se = null; + } + Wo.prototype = new u7(); + Wo.prototype.constructor = Wo; + function Xo() { + } + Xo.prototype = Wo.prototype; + function Yo(a10, b10, c10, e10) { + Hea(); + var f10 = Iea(a10); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(Jea(f10, c10))); + f10 = c10.b() ? f10 : c10.c(); + c10 = Vb().Ia(a10.Hj); + var g10 = new z7().d(a10.Se), h10 = Kea(Zo(), ab().ea), k10 = new $o().a(); + ap(); + var l10 = Lea(); + ap(); + var m10 = y7(); + return Mea(ap(), b10, c10, g10, h10, l10, k10, m10, f10, e10).Yg(w6(/* @__PURE__ */ function(p10) { + return function(t10) { + p10.h2 = new z7().d(t10); + return t10; + }; + }(a10)), ml()); + } + function Nea(a10, b10, c10) { + var e10 = a10.h2; + if (!(e10 instanceof z7)) + throw mb(E6(), new nb().e("Cannot validate without parsed model")); + e10 = e10.i; + var f10 = bp(); + bp(); + var g10 = fp(); + a10 = gp(f10).oba(c10, g10).Pq(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function() { + var m10 = Iea(h10); + bp(); + var p10 = hk(); + bp(); + return gp(bp()).B3(k10, l10, p10, m10, false).Yg(w6(/* @__PURE__ */ function() { + return function(t10) { + return t10; + }; + }(h10)), ml()); + }; + }(a10, e10, b10)), ml()); + b10 = ab(); + c10 = ab().no(); + return ll(b10, a10, c10).Ra(); + } + function Oea(a10, b10, c10) { + var e10 = a10.h2; + if (e10.b()) + b10 = y7(); + else { + e10 = e10.c(); + var f10 = bp(); + a10 = Iea(a10); + bp(); + b10 = new z7().d(gp(f10).B3(e10, b10, c10, a10, false)); + } + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = Pea(hp(), new nb().e("No parsed model or current validation found, cannot validate")); + } + c10 = ab(); + a10 = ab().no(); + return ll(c10, b10, a10).Ra(); + } + function Qea(a10, b10) { + return new ip().Hc(ab().ea.IP(a10), b10); + } + function jp(a10, b10, c10) { + var e10 = ab(); + a10 = Yo(a10, b10, new z7().d(Qea(b10, c10)), new kp().a()); + b10 = ab().$e(); + return ll(e10, a10, b10).Ra(); + } + function Iea(a10) { + a10 = a10.ns; + return (a10.b() ? lp(pp()) : a10.c()).k; + } + function qp(a10, b10) { + var c10 = ab(); + a10 = Yo(a10, a10.wR, new z7().d(Qea(a10.wR, b10)), new kp().a()); + b10 = ab().$e(); + return ll(c10, a10, b10).Ra(); + } + function rp(a10, b10) { + var c10 = ab(); + a10 = Yo(a10, b10, y7(), new kp().a()); + b10 = ab().$e(); + return ll(c10, a10, b10).Ra(); + } + Wo.prototype.qv = function(a10, b10, c10) { + this.Se = a10; + this.Hj = b10; + this.ns = c10; + this.h2 = y7(); + this.wR = "http://a.ml/amf/default_document"; + return this; + }; + Wo.prototype.reportCustomValidation = function(a10, b10) { + return Nea(this, a10, b10); + }; + Wo.prototype.reportValidation = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return Oea(this, a10, e10[0]); + case 0: + return Oea(this, a10, Tb()); + default: + throw "No matching overload"; + } + }; + Wo.prototype.parseStringAsync = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 2: + return b10 = e10[0], c10 = e10[1], e10 = ab(), b10 = Yo(this, a10, new z7().d(Qea(a10, b10)), c10), c10 = ab().$e(), ll(e10, b10, c10).Ra(); + case 1: + if (sp(e10[0])) + return b10 = e10[0], jp(this, a10, b10); + if (e10[0] instanceof kp) + return b10 = e10[0], e10 = ab(), b10 = Yo(this, this.wR, new z7().d(Qea(this.wR, a10)), b10), c10 = ab().$e(), ll(e10, b10, c10).Ra(); + throw "No matching overload"; + case 0: + return qp(this, a10); + default: + throw "No matching overload"; + } + }; + Wo.prototype.parseFileAsync = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return rp(this, a10); + case 1: + return c10 = e10[0], b10 = ab(), e10 = y7(), c10 = Yo(this, a10, e10, c10), e10 = ab().$e(), ll(b10, c10, e10).Ra(); + default: + throw "No matching overload"; + } + }; + Wo.prototype.$classData = r8({ Cx: 0 }, false, "amf.client.parse.Parser", { Cx: 1, f: 1 }); + function tp() { + this.bna = this.uo = 0; + } + tp.prototype = new u7(); + tp.prototype.constructor = tp; + tp.prototype.a = function() { + this.uo = 5; + this.bna = 10; + return this; + }; + tp.prototype.$classData = r8({ Xva: 0 }, false, "amf.client.plugins.AMFDocumentPluginSettings$PluginPriorities$", { Xva: 1, f: 1 }); + var Rea = void 0; + function Sea() { + Rea || (Rea = new tp().a()); + return Rea; + } + function Tea(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.MR); + } + function up() { + this.eia = this.hia = null; + } + up.prototype = new u7(); + up.prototype.constructor = up; + up.prototype.a = function() { + Uea = this; + this.hia = vp(); + this.eia = wp(); + return this; + }; + Object.defineProperty(up.prototype, "ScalarRelaxedValidationMode", { get: function() { + return this.eia; + }, configurable: true }); + Object.defineProperty(up.prototype, "StrictValidationMode", { get: function() { + return this.hia; + }, configurable: true }); + up.prototype.$classData = r8({ cwa: 0 }, false, "amf.client.plugins.ValidationMode$", { cwa: 1, f: 1 }); + var Uea = void 0; + function xp() { + this.OT = this.QV = this.Kx = this.ZS = this.BW = false; + this.Bc = null; + this.iO = false; + } + xp.prototype = new u7(); + xp.prototype.constructor = xp; + xp.prototype.a = function() { + this.ZS = this.BW = false; + this.Kx = true; + this.OT = this.QV = false; + var a10 = Vea(); + this.Bc = new yp().Hb(a10); + this.iO = false; + return this; + }; + xp.prototype.f4 = function(a10) { + this.Bc = a10; + return this; + }; + xp.prototype.U4 = function() { + this.Kx = false; + return this; + }; + xp.prototype.T4 = function() { + this.Kx = true; + return this; + }; + Object.defineProperty(xp.prototype, "isEmitNodeIds", { get: function() { + return this.iO; + }, configurable: true }); + Object.defineProperty(xp.prototype, "isPrettyPrint", { get: function() { + return this.QV; + }, configurable: true }); + Object.defineProperty(xp.prototype, "errorHandler", { get: function() { + return this.Bc; + }, configurable: true }); + Object.defineProperty(xp.prototype, "isAmfJsonLdSerilization", { get: function() { + return this.Kx; + }, configurable: true }); + Object.defineProperty(xp.prototype, "isWithSourceMaps", { get: function() { + return this.BW; + }, configurable: true }); + Object.defineProperty(xp.prototype, "isWithCompactUris", { get: function() { + return this.ZS; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withNodeIds", { get: function() { + this.iO = true; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withAmfJsonLdSerialization", { get: function() { + return this.T4(); + }, configurable: true }); + Object.defineProperty(xp.prototype, "withoutAmfJsonLdSerialization", { get: function() { + return this.U4(); + }, configurable: true }); + Object.defineProperty(xp.prototype, "isFlattenedJsonLd", { get: function() { + return this.OT; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withoutFlattenedJsonLd", { get: function() { + this.OT = false; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withFlattenedJsonLd", { get: function() { + this.OT = true; + return this; + }, configurable: true }); + xp.prototype.withErrorHandler = function(a10) { + return this.f4(a10); + }; + Object.defineProperty(xp.prototype, "withoutCompactUris", { get: function() { + this.ZS = false; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withCompactUris", { get: function() { + this.ZS = true; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withoutSourceMaps", { get: function() { + this.BW = false; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withSourceMaps", { get: function() { + this.BW = true; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withoutPrettyPrint", { get: function() { + this.QV = false; + return this; + }, configurable: true }); + Object.defineProperty(xp.prototype, "withPrettyPrint", { get: function() { + this.QV = true; + return this; + }, configurable: true }); + xp.prototype.$classData = r8({ nwa: 0 }, false, "amf.client.render.RenderOptions", { nwa: 1, f: 1 }); + function zp() { + this.Hj = this.Se = null; + } + zp.prototype = new u7(); + zp.prototype.constructor = zp; + function Ap() { + } + Ap.prototype = zp.prototype; + zp.prototype.Hc = function(a10, b10) { + this.Se = a10; + this.Hj = b10; + return this; + }; + function Wea(a10, b10, c10, e10) { + var f10 = ab(); + b10 = b10.Be(); + c10 = Bp(Cp(), c10); + Xea || (Xea = new Dp().a()); + a10 = Yea(a10, b10, c10, e10, Xea); + e10 = ab().Yo(); + return ll(f10, a10, e10).Ra(); + } + function Yea(a10, b10, c10, e10, f10) { + return Zea($ea(new Ep(), b10, a10.Hj, a10.Se, c10, new Yf().a()), e10, f10); + } + function Fp(a10, b10, c10) { + var e10 = ab(); + c10 = Bp(Cp(), c10); + a10 = afa($ea(new Ep(), b10.Be(), a10.Hj, a10.Se, c10, new Yf().a()), ml()); + b10 = ab().Lf(); + return ll(e10, a10, b10).Ra(); + } + function bfa(a10, b10, c10, e10) { + var f10 = ab(); + a10 = Yea(a10, b10.Be(), Bp(Cp(), c10), e10, cfa()); + b10 = ab().Yo(); + return ll(f10, a10, b10).Ra(); + } + function Gp(a10, b10, c10, e10) { + var f10 = ab(); + e10 = Bp(Cp(), e10); + a10 = dfa($ea(new Ep(), b10.Be(), a10.Hj, a10.Se, e10, new Yf().a()), ab().ea, c10); + b10 = ab().Yo(); + return ll(f10, a10, b10).Ra(); + } + zp.prototype.generateToWriter = function(a10, b10) { + for (var c10 = arguments.length | 0, e10 = 2, f10 = []; e10 < c10; ) + f10.push(arguments[e10]), e10 = e10 + 1 | 0; + switch (f10.length | 0) { + case 0: + if (b10 instanceof Hp) + return bfa(this, a10, new xp().a(), b10); + if (b10 instanceof Ip) + return Wea(this, a10, new xp().a(), b10); + throw "No matching overload"; + case 1: + if (f10[0] instanceof Hp) + return c10 = f10[0], bfa(this, a10, b10, c10); + if (f10[0] instanceof Ip) + return c10 = f10[0], Wea(this, a10, b10, c10); + throw "No matching overload"; + default: + throw "No matching overload"; + } + }; + zp.prototype.generateString = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return Fp(this, a10, e10[0]); + case 0: + return Fp(this, a10, new xp().a()); + default: + throw "No matching overload"; + } + }; + zp.prototype.generateFile = function(a10, b10) { + for (var c10 = arguments.length | 0, e10 = 2, f10 = []; e10 < c10; ) + f10.push(arguments[e10]), e10 = e10 + 1 | 0; + switch (f10.length | 0) { + case 1: + return Gp(this, a10, b10, f10[0]); + case 0: + return Gp(this, a10, b10, new xp().a()); + default: + throw "No matching overload"; + } + }; + zp.prototype.$classData = r8({ RA: 0 }, false, "amf.client.render.Renderer", { RA: 1, f: 1 }); + function Jp() { + this.$l = false; + this.Bc = null; + } + Jp.prototype = new u7(); + Jp.prototype.constructor = Jp; + Jp.prototype.a = function() { + this.$l = true; + var a10 = Vea(); + this.Bc = new yp().Hb(a10); + return this; + }; + Jp.prototype.f4 = function(a10) { + this.Bc = a10; + return this; + }; + Object.defineProperty(Jp.prototype, "isWithDocumentation", { get: function() { + return this.$l; + }, configurable: true }); + Object.defineProperty(Jp.prototype, "errorHandler", { get: function() { + return this.Bc; + }, configurable: true }); + Jp.prototype.withErrorHandler = function(a10) { + return this.f4(a10); + }; + Object.defineProperty(Jp.prototype, "withoutDocumentation", { get: function() { + this.$l = false; + return this; + }, configurable: true }); + Jp.prototype.$classData = r8({ owa: 0 }, false, "amf.client.render.ShapeRenderOptions", { owa: 1, f: 1 }); + function Kp() { + this.Se = null; + } + Kp.prototype = new u7(); + Kp.prototype.constructor = Kp; + function Lp() { + } + Lp.prototype = Kp.prototype; + function Mp(a10, b10, c10) { + ab(); + a10 = efa(ffa(), a10.Se, (ab(), ab().$e(), b10.Be()), c10, Np(Op(), (ab(), ab().$e(), b10.Be()))); + return gfa(ab().$e(), a10); + } + Kp.prototype.e = function(a10) { + this.Se = a10; + return this; + }; + Kp.prototype.resolve = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 2: + return b10 = e10[0], e10 = e10[1], ab(), e10 = efa(ffa(), this.Se, (ab(), ab().$e(), a10.Be()), b10, (ab(), hfa(e10))), gfa(ab().$e(), e10); + case 1: + return b10 = e10[0], Mp(this, a10, b10); + case 0: + return Mp(this, a10, Pp().ux); + default: + throw "No matching overload"; + } + }; + Kp.prototype.$classData = r8({ gN: 0 }, false, "amf.client.resolve.Resolver", { gN: 1, f: 1 }); + function ifa(a10, b10) { + b10 = new qg().e(b10); + var c10 = Qp().$I; + return jfa(a10, Wp(b10, c10)); + } + function kfa(a10) { + return Qp().qj(a10).b() ? false : true; + } + function Xp() { + this.k = null; + } + Xp.prototype = new u7(); + Xp.prototype.constructor = Xp; + Xp.prototype.Z6a = function(a10) { + this.k = a10; + }; + Xp.prototype.W6a = function(a10, b10) { + a10 = a10.Sv(); + var c10 = ab(), e10 = lfa(); + Xp.prototype.Z6a.call(this, mfa(new Yp(), a10, uk(tk(c10, b10, e10)).ua())); + }; + Xp.prototype.pda = function() { + var a10 = ab(), b10 = this.k.ll, c10 = lfa(); + return Ak(a10, b10, c10).Ra(); + }; + Xp.prototype.ZQ = function() { + return this.pda(); + }; + Object.defineProperty(Xp.prototype, "results", { get: function() { + return this.ZQ(); + }, configurable: true }); + Object.defineProperty(Xp.prototype, "fragment", { get: function() { + ab(); + var a10 = this.k.vg; + return nfa(ofa(), a10); + }, configurable: true }); + Xp.prototype.$classData = r8({ Bwa: 0 }, false, "amf.client.validate.PayloadParsingResult", { Bwa: 1, f: 1 }); + function Zp() { + this.k = null; + } + Zp.prototype = new u7(); + Zp.prototype.constructor = Zp; + Zp.prototype.Jea = function(a10) { + var b10 = ab(); + a10 = this.k.C3((ab(), ofa(), a10.Sv())); + var c10 = ab().no(); + return ll(b10, a10, c10).Ra(); + }; + Zp.prototype.U3 = function(a10) { + return this.Jea(a10); + }; + Zp.prototype.validate = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return this.U3(a10); + case 1: + return c10 = e10[0], b10 = ab(), c10 = this.k.D3(a10, c10), e10 = ab().no(), ll(b10, c10, e10).Ra(); + default: + throw "No matching overload"; + } + }; + Zp.prototype.isValid = function(a10, b10) { + var c10 = ab(); + a10 = this.k.xma(a10, b10); + b10 = pfa(); + return ll(c10, a10, b10).Ra(); + }; + Zp.prototype.$classData = r8({ Cwa: 0 }, false, "amf.client.validate.PayloadValidator", { Cwa: 1, f: 1 }); + function $p() { + this.k = null; + } + $p.prototype = new u7(); + $p.prototype.constructor = $p; + d7 = $p.prototype; + d7.u7a = function(a10, b10, c10, e10) { + var f10 = ab(), g10 = lfa(); + $p.prototype.gla.call(this, aq(new bq(), a10, b10, c10, uk(tk(f10, e10, g10)))); + }; + d7.gla = function(a10) { + this.k = a10; + return this; + }; + d7.sp = function() { + var a10 = this.k; + return qfa(a10, a10.IX); + }; + d7.t = function() { + var a10 = this.k; + return qfa(a10, a10.IX); + }; + d7.pda = function() { + var a10 = ab(), b10 = this.k.ll, c10 = lfa(); + return Ak(a10, b10, c10).Ra(); + }; + d7.ZQ = function() { + return this.pda(); + }; + d7.J4 = function() { + return this.k.pB; + }; + $p.prototype.toString = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 1: + return qfa(this.k, c10[0] | 0); + case 0: + return this.sp(); + default: + throw "No matching overload"; + } + }; + Object.defineProperty($p.prototype, "results", { get: function() { + return this.ZQ(); + }, configurable: true }); + Object.defineProperty($p.prototype, "profile", { get: function() { + return this.k.Em; + }, configurable: true }); + Object.defineProperty($p.prototype, "model", { get: function() { + return this.k.oi; + }, configurable: true }); + Object.defineProperty($p.prototype, "conforms", { get: function() { + return this.J4(); + }, configurable: true }); + $p.prototype.$classData = r8({ Ewa: 0 }, false, "amf.client.validate.ValidationReport", { Ewa: 1, f: 1 }); + function eq2() { + this.k = null; + } + eq2.prototype = new u7(); + eq2.prototype.constructor = eq2; + d7 = eq2.prototype; + d7.Sl = function() { + return this.sL(); + }; + d7.Wb = function() { + var a10 = this.k.Fg; + return a10 instanceof z7 ? a10.i.yc : rfa(); + }; + d7.M4 = function() { + return this.k.Ld; + }; + d7.S4 = function() { + return this.k.sy; + }; + d7.t7a = function(a10, b10, c10, e10, f10, g10, h10) { + e10 = new je4().e(e10).Bu(); + g10 = new z7().d(new be4().jj(g10)); + h10 = new je4().e(h10).Bu(); + eq2.prototype.hla.call(this, Xb(a10, b10, c10, e10, f10, g10, h10, null)); + }; + d7.hla = function(a10) { + this.k = a10; + return this; + }; + d7.sL = function() { + var a10 = ab(), b10 = this.k.da, c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }; + Object.defineProperty(eq2.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(eq2.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(eq2.prototype, "source", { get: function() { + return this.S4(); + }, configurable: true }); + Object.defineProperty(eq2.prototype, "validationId", { get: function() { + return this.k.Ct; + }, configurable: true }); + Object.defineProperty(eq2.prototype, "targetProperty", { get: function() { + var a10 = this.k.jx; + return a10.b() ? null : a10.c(); + }, configurable: true }); + Object.defineProperty(eq2.prototype, "targetNode", { get: function() { + return this.k.Iv; + }, configurable: true }); + Object.defineProperty(eq2.prototype, "level", { get: function() { + return this.k.zm; + }, configurable: true }); + Object.defineProperty(eq2.prototype, "message", { get: function() { + return this.M4(); + }, configurable: true }); + eq2.prototype.$classData = r8({ Fwa: 0 }, false, "amf.client.validate.ValidationResult", { Fwa: 1, f: 1 }); + function fq() { + } + fq.prototype = new u7(); + fq.prototype.constructor = fq; + fq.prototype.R3 = function(a10, b10) { + return sfa(0, a10, b10); + }; + fq.prototype.a = function() { + return this; + }; + function gq(a10, b10, c10, e10, f10, g10) { + var h10 = ab(), k10 = bp(); + b10 = b10.Be(); + f10 = f10.k; + a10 = gp(k10).B3(b10, c10, e10, f10, g10).Yg(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10; + }; + }(a10)), ml()); + c10 = ab().no(); + return ll(h10, a10, c10).Ra(); + } + function sfa(a10, b10, c10) { + a10 = ab(); + var e10 = bp(); + c10 = c10.k; + b10 = gp(e10).oba(b10, c10); + c10 = ab(); + null === ab().tJ && null === ab().tJ && (ab().tJ = new hq().ep(c10)); + c10 = ab().tJ; + return ll(a10, b10, c10).Ra(); + } + fq.prototype.O3 = function(a10) { + return gp(bp()).b$(a10); + }; + fq.prototype.emitShapesGraph = function(a10) { + return this.O3(a10); + }; + fq.prototype.loadValidationProfile = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + b10 = void 0 === e10[0] ? lp(pp()) : e10[0]; + return this.R3(a10, b10); + }; + fq.prototype.validate = function(a10, b10) { + for (var c10 = arguments.length | 0, e10 = 2, f10 = []; e10 < c10; ) + f10.push(arguments[e10]), e10 = e10 + 1 | 0; + c10 = void 0 === f10[0] ? hk() : f10[0]; + e10 = void 0 === f10[1] ? lp(pp()) : f10[1]; + return gq(this, a10, b10, c10, e10, void 0 === f10[2] ? false : !!f10[2]); + }; + fq.prototype.$classData = r8({ Hwa: 0 }, false, "amf.client.validate.Validator$", { Hwa: 1, f: 1 }); + var tfa = void 0; + function iq() { + tfa || (tfa = new fq().a()); + return tfa; + } + function jq() { + this.x1 = null; + } + jq.prototype = new u7(); + jq.prototype.constructor = jq; + jq.prototype.a = function() { + ufa = this; + var a10 = [kq().Ig, lq().Ig, kq().Ig]; + if (0 === (a10.length | 0)) + a10 = new mq().a(); + else { + for (var b10 = Jf(new Kf(), new mq().a()), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Of(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.x1 = a10; + return this; + }; + function vfa(a10, b10) { + for (; ; ) { + if (b10.b()) + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + }; + }(a10)), ml()); + var c10 = b10.ga(); + if (a10.x1.Ha(c10.gi())) + b10 = b10.ta(); + else { + var e10 = c10.wr().Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return !Po().x1.Ha(f10.gi()); + }; + }(a10))); + return vfa(a10, e10).Pq(w6(/* @__PURE__ */ function(f10, g10) { + return function() { + return g10.fp().Yg(w6(/* @__PURE__ */ function(h10, k10) { + return function() { + return Po().x1.Tm(k10.gi()); + }; + }(f10, g10)), ml()); + }; + }(a10, c10)), ml()).Pq(w6(/* @__PURE__ */ function(f10, g10) { + return function() { + return vfa(Po(), g10.ta()); + }; + }(a10, b10)), ml()); + } + } + } + function Oo(a10, b10) { + if (b10 instanceof pq) + wfa(qq(), b10); + else if (b10 instanceof rq) + sq(qq(), b10); + else if (b10 instanceof tq) + xfa(qq(), b10); + else if (b10 && b10.$classData && b10.$classData.ge.Aga) + yfa(qq(), b10); + else if (b10 && b10.$classData && b10.$classData.ge.Sga) + zfa(qq(), b10); + else + throw new x7().d(b10); + } + jq.prototype.fp = function() { + Afa || (Afa = new uq().a()); + Afa.GG(); + Vba().GG(); + var a10 = kq().fp(), b10 = lq().fp(), c10 = new vq().a(), e10 = c10.fp(), f10 = hp(); + a10 = J5(K7(), new Ib().ha([a10, b10, e10])); + b10 = K7(); + return Bfa(f10, a10, b10.u).Pq(w6(/* @__PURE__ */ function() { + return function() { + var g10 = vfa, h10 = Po(); + var k10 = qq(); + var l10 = new wq().Yn(k10.i3), m10 = new wq().Yn(k10.cK), p10 = Xd().u; + l10 = xq(l10, m10, p10); + m10 = new wq().Yn(k10.p0); + p10 = Xd(); + l10 = l10.ia(m10, p10.u); + k10 = new wq().Yn(k10.IT); + m10 = Xd(); + k10 = l10.ia(k10, m10.u); + return g10(h10, k10.ke()); + }; + }(this)), ml()).Yg(w6(/* @__PURE__ */ function(g10, h10) { + return function() { + wfa(qq(), kq()); + sq(qq(), lq()); + yfa( + qq(), + h10 + ); + }; + }(this, c10)), ml()); + }; + jq.prototype.$classData = r8({ Iwa: 0 }, false, "amf.core.AMF$", { Iwa: 1, f: 1 }); + var ufa = void 0; + function Po() { + ufa || (ufa = new jq().a()); + return ufa; + } + function Cfa() { + this.m = this.da = this.xf = this.ah = this.BP = this.ns = this.kja = this.Wg = this.YB = this.Se = this.Hj = this.he = this.gda = this.ny = null; + } + Cfa.prototype = new u7(); + Cfa.prototype.constructor = Cfa; + function Dfa(a10, b10, c10) { + if (b10 instanceof z7) { + b10 = b10.i; + if (a10.Se.na()) { + b10 = b10.ve(); + var e10 = a10.Se.c(); + b10 = -1 === (b10.indexOf(ka(e10)) | 0); + } else + b10 = false; + b10 && c10.U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = f10.m, k10 = dc().c6, l10 = y7(); + ec(h10, k10, "", l10, "Cannot reference fragments of another spec", g10.da); + }; + }(a10))); + } + } + function Efa(a10, b10) { + yq(zq(), "AMFCompiler#parseDomain: parsing domain " + a10.ny); + var c10 = a10.m.lj, e10 = a10.Se; + e10.b() ? e10 = Ffa(qq(), b10.OB).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return k10.nB(h10); + }; + }(a10, b10))) : (e10 = e10.c(), e10 = Gfa(qq(), e10).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return k10.nB(h10); + }; + }(a10, b10)))); + var f10 = false; + if (e10 instanceof z7) + e10 = e10.i, yq(zq(), "AMFCompiler#parseSyntax: parsing domain " + a10.ny + " plugin " + e10.gi()), b10 = Hfa(a10, b10, e10).Yg(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = g10.m, p10 = m10.Df, t10 = Ifa(m10), v10 = K7(); + p10 = p10.ia(t10, v10.u); + p10 = new Aq().zo( + m10.qh, + p10, + m10.ni, + m10.lj, + m10.Hp() + ); + p10.Fu = m10.Fu; + p10.Ip = m10.Ip; + m10 = h10.tA(l10, p10, g10.BP); + if (m10 instanceof z7) { + m10 = m10.i; + k10.da === Jfa(g10.xf) && (p10 = Bq().De, Bi(m10, p10, true)); + m10 = Kfa(m10, k10.xe); + p10 = Lfa; + t10 = new Mfa(); + t10.t9 = m10; + if (null === g10) + throw mb(E6(), null); + t10.l = g10; + return p10(t10, l10); + } + if (y7() === m10) + return O7(), l10 = new P6().a(), l10 = new Mk().K(new S6().a(), l10), l10 = Rd(l10, k10.da), m10 = k10.da, p10 = Bq().uc, l10 = eb(l10, p10, m10), O7(), m10 = new P6().a(), m10 = new Pk().K(new S6().a(), m10), p10 = k10.xe, t10 = Ok().Rd, m10 = eb(m10, t10, p10), p10 = k10.OB, t10 = Ok().Nd, m10 = eb(m10, t10, p10), p10 = Jk().nb, Vd(l10, p10, m10); + throw new x7().d(m10); + }; + }(a10, e10, b10)), ml()); + else { + if (y7() === e10 && (f10 = true, a10.Se.na())) + throw new Cq().e(a10.Se.c()); + if (f10) + b10 = nq(hp(), oq(/* @__PURE__ */ function(g10, h10) { + return function() { + yq(zq(), "AMFCompiler#parseSyntax: parsing domain " + g10.ny + " NO PLUGIN"); + O7(); + var k10 = new P6().a(); + k10 = new Mk().K(new S6().a(), k10); + var l10 = h10.da, m10 = Bq().uc; + k10 = eb(k10, m10, l10); + k10 = Rd(k10, h10.da); + O7(); + l10 = new P6().a(); + l10 = new Pk().K(new S6().a(), l10); + m10 = h10.xe; + var p10 = Ok().Rd; + l10 = eb(l10, p10, m10); + m10 = h10.OB; + p10 = Ok().Nd; + l10 = eb(l10, p10, m10); + m10 = Jk().nb; + return Vd(k10, m10, l10); + }; + }(a10, b10)), ml()); + else + throw new x7().d(e10); + } + return b10.Yg(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10.Io(new z7().d(h10)); + yq(zq(), "AMFCompiler#parseDomain: model ready " + g10.ny); + Nfa().ne(k10, Uc(/* @__PURE__ */ function() { + return function(l10) { + return l10; + }; + }(g10))); + return k10; + }; + }(a10, c10)), ml()); + } + function Ofa(a10, b10) { + return nq(hp(), oq(/* @__PURE__ */ function(c10, e10) { + return function() { + O7(); + var f10 = new P6().a(); + f10 = new Pk().K(new S6().a(), f10); + f10 = Rd(f10, e10.Of + "#/"); + var g10 = e10.hx.t(), h10 = Ok().Rd; + f10 = eb(f10, h10, g10); + g10 = e10.yL; + g10.b() || (g10 = g10.c(), h10 = Ok().Nd, eb(f10, h10, g10)); + O7(); + g10 = new P6().a(); + g10 = new Mk().K(new S6().a(), g10); + h10 = e10.Of; + var k10 = Bq().uc; + g10 = eb(g10, k10, h10); + g10 = Rd(g10, e10.Of); + h10 = Jk().nb; + f10 = Vd(g10, h10, f10); + g10 = e10.Of; + h10 = Bq().uc; + return eb(f10, h10, g10); + }; + }(a10, b10)), ml()); + } + function Pfa(a10) { + yq(zq(), "AMFCompiler#build: Building " + a10.ny); + if (Qfa(a10.xf)) + return Pea(hp(), new Dq().bL(a10.xf.Uz)); + var b10 = a10.Wg, c10 = a10.da, e10 = /* @__PURE__ */ function(f10) { + return function() { + yq(zq(), "AMFCompiler#build: compiling " + f10.ny); + return Rfa(f10); + }; + }(a10); + a10 = Sfa(a10.xf.Uz); + a10.b() || (a10 = a10.c(), Tfa(b10, a10, c10)); + if (Ufa(b10, c10, H10()) instanceof z7) + return b10.Wg.P(c10).Taa() ? b10.Wg.P(c10) : (b10.Wg.rt(c10), e10().Yg(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = nq(hp(), oq(/* @__PURE__ */ function(l10, m10) { + return function() { + return m10; + }; + }(f10, h10)), ml()); + f10.Wg.jm(g10, k10); + return h10; + }; + }(b10, c10)), ml())); + a10 = b10.Wg.Ja(c10); + if (a10 instanceof z7) + return a10.i; + if (y7() === a10) + return e10 = e10(), b10.Wg.jm(c10, e10), e10; + throw new x7().d(a10); + } + function Rfa(a10) { + return Vfa(a10.gda, a10.da, a10.ns).Yg(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return Wfa(b10, c10); + }; + }(a10)), ml()).Pq(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + if (c10 instanceof ve4) { + c10 = c10.i; + var e10 = b10.Hj; + if (e10 instanceof z7 && (e10 = e10.i, 1 === Eq(b10.xf.Uz))) + throw new Fq().e(e10); + c10 = Ofa(b10, c10); + } else if (c10 instanceof ye4) + c10 = Efa(b10, c10.i); + else + throw new x7().d(c10); + return c10; + }; + }(a10)), ml()); + } + function Xfa(a10, b10) { + if (2 < wa(b10) && 35 === xa(b10, 0) && 37 === xa(b10, 1)) + return yq(zq(), "AMFCompiler#autodetectSyntax: auto detected application/yaml media type"), new z7().d("application/yaml"); + a10 = a10.he; + if (!a10.b()) { + a10.c(); + b10 = new qg().e(ka(b10)); + a10 = b10.ja.length | 0; + for (var c10 = 0; ; ) { + if (c10 < a10) { + var e10 = b10.lb(c10); + e10 = null === e10 ? 0 : e10.r; + e10 = !(10 !== e10 && 9 !== e10 && 13 !== e10 && 32 !== e10); + } else + e10 = false; + if (e10) + c10 = 1 + c10 | 0; + else + break; + } + a10 = c10; + b10 = a10 < (b10.ja.length | 0) ? new z7().d(b10.lb(a10)) : y7(); + if (b10 instanceof z7 && (b10 = b10.i, b10 = null === b10 ? 0 : b10.r, 123 === b10 || 91 === b10)) + return yq(zq(), "AMFCompiler#autodetectSyntax: auto detected application/json media type"), new z7().d("application/json"); + } + return y7(); + } + function Wfa(a10, b10) { + yq(zq(), "AMFCompiler#parseSyntax: parsing syntax " + a10.ny); + b10 = Nfa().ne(b10, Uc(/* @__PURE__ */ function() { + return function(f10) { + return f10; + }; + }(a10))); + var c10 = a10.Hj; + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + var e10 = Yfa(qq(), c10); + e10 = e10.b() ? y7() : e10.c().JV(c10, b10.hx, a10.m, a10.BP); + e10.b() ? c10 = y7() : (e10 = e10.c(), c10 = new z7().d(new R6().M(c10, e10))); + } + c10.b() && (c10 = a10.Hj, y7() === c10 ? (c10 = b10.yL, c10.b() ? c10 = y7() : (c10 = c10.c(), e10 = Yfa(qq(), c10), e10 = e10.b() ? y7() : e10.c().JV(c10, b10.hx, a10.m, a10.BP), e10.b() ? c10 = y7() : (e10 = e10.c(), c10 = new z7().d(new R6().M(c10, e10)))), c10.b() && (Gq(), c10 = Saa(b10.Of), c10.b() ? c10 = y7() : (c10 = c10.c(), Gq(), c10 = Taa(c10)), c10.b() ? c10 = y7() : (c10 = c10.c(), e10 = Yfa(qq(), c10), e10 = e10.b() ? y7() : e10.c().JV(c10, b10.hx, a10.m, a10.BP), e10.b() ? c10 = y7() : (e10 = e10.c(), c10 = new z7().d(new R6().M(c10, e10))))), c10.b() && (c10 = Xfa(a10, b10.hx), c10.b() ? c10 = y7() : (c10 = c10.c(), e10 = Yfa(qq(), c10), e10 = e10.b() ? y7() : e10.c().JV(c10, b10.hx, a10.m, a10.BP), e10.b() ? c10 = y7() : (e10 = e10.c(), c10 = new z7().d(new R6().M(c10, e10)))))) : c10 = y7()); + if (c10 instanceof z7 && (e10 = c10.i, null !== e10)) + return c10 = e10.ma(), e10 = e10.ya(), e10 = Nfa().ne(e10, Uc(/* @__PURE__ */ function() { + return function(f10) { + return f10; + }; + }(a10))), ue4(), a10 = Zfa($fa(), e10, b10.Of, c10, J5(K7(), H10()), a10.YB, b10.hx.t()), new ye4().d(a10); + if (y7() === c10) + return ue4(), new ve4().d(b10); + throw new x7().d(c10); + } + function aga(a10, b10, c10) { + b10 instanceof z7 && Vaa(b10.i) && c10.U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + if (f10.vg.na()) { + var g10 = e10.m, h10 = dc().j6; + f10 = f10.Ca; + var k10 = y7(); + ec(g10, h10, "", k10, "Cannot use reference with # in a RAML fragment", f10.da); + } + }; + }(a10))); + } + function Hfa(a10, b10, c10) { + var e10 = c10.NE(a10.m), f10 = e10.WN(b10.$g, a10.m); + yq(zq(), "AMFCompiler#parseReferences: " + f10.Df.Ur().ke().jb() + " references found in " + a10.ny); + f10 = f10.Df.Ur().ke().Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + g10 = g10.Of; + return !(0 <= (g10.length | 0) && "#" === g10.substring(0, 1)); + }; + }(a10))); + c10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = l10.Df, p10 = w6(/* @__PURE__ */ function() { + return function(v10) { + return v10.Ca; + }; + }(g10)), t10 = K7(); + m10 = m10.ka(p10, t10.u); + return bga(l10, g10.xf, g10.Wg, g10.m, g10.ns, m10, h10.gB()).Pq(w6(/* @__PURE__ */ function(v10, A10, D10, C10, I10) { + return function(L10) { + if (null !== L10) { + var Y10 = L10.Jd; + if (Y10 instanceof z7) + return L10 = Y10.i, Dfa(v10, cga(L10), A10), aga(v10, cga(L10), D10.Df), L10 = Hq(new Iq(), L10, D10, y7()), C10.PW(L10, v10.m, v10.xf, v10.ns, v10.Wg).Yg(w6(/* @__PURE__ */ function() { + return function(zb) { + return new z7().d(zb); + }; + }(v10)), ml()); + } + if (null !== L10 && (L10 = L10.mO, L10 instanceof z7)) { + var ia = L10.i; + if (ia instanceof Dq && !I10.gB()) { + L10 = v10.m; + Y10 = dc().t5; + var pa = D10.Of; + ia = ia.tt; + var La = D10.Df.ga().Ca, ob = y7(); + ec(L10, Y10, pa, ob, ia, La.da); + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return y7(); + }; + }(v10)), ml()); + } + dga(D10) || A10.U(w6(/* @__PURE__ */ function(zb, Zb, Cc) { + return function(vc) { + var id = zb.m, yd = dc().au, zd = Zb.Of, rd = Cc.xo(), sd = y7(); + ec(id, yd, zd, sd, rd, vc.da); + }; + }(v10, D10, ia))); + } + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return y7(); + }; + }(v10)), ml()); + }; + }(g10, m10, l10, k10, h10)), ml()); + }; + }(a10, c10, e10)); + e10 = K7(); + f10 = f10.ka(c10, e10.u); + c10 = hp(); + e10 = K7(); + return Bfa(c10, f10, e10.u).Yg(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = k10.ps(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.ua(); + }; + }(g10))); + return ega(h10.$g, h10.da, h10.OB, k10, h10.YB, h10.xe); + }; + }(a10, b10)), ml()); + } + Cfa.prototype.$classData = r8({ Jwa: 0 }, false, "amf.core.AMFCompiler", { Jwa: 1, f: 1 }); + function uq() { + } + uq.prototype = new u7(); + uq.prototype.constructor = uq; + uq.prototype.a = function() { + return this; + }; + uq.prototype.GG = function() { + ap().Z_.b() && fga(ap(), new Jq().d(/* @__PURE__ */ function() { + return function(a10, b10, c10, e10, f10, g10, h10, k10, l10) { + var m10 = new Cfa(), p10 = b10.ea; + b10 = new z7().d(b10); + m10.ny = a10; + m10.gda = p10; + m10.he = b10; + m10.Hj = c10; + m10.Se = e10; + m10.YB = f10; + m10.Wg = g10; + m10.kja = h10; + m10.ns = k10; + m10.BP = l10; + try { + var t10 = new je4().e(m10.ny); + var v10 = Kq(t10.td); + } catch (A10) { + if (a10 = Ph(E6(), A10), a10 instanceof Lq) + c10 = m10.kja, c10.b() ? (c10 = m10.ny, K7(), pj(), e10 = new Lf().a(), c10 = new Aq().zo(c10, e10.ua(), new Mq().a(), Nq(), y7())) : c10 = c10.c(), e10 = dc().r8, f10 = m10.ah, a10 = a10.tt, g10 = mh(T6(), m10.ah), k10 = y7(), ec(c10, e10, f10, k10, a10, g10.da), v10 = m10.ny; + else { + if (a10 instanceof nb) + throw new Tq().e(a10.xo()); + throw A10; + } + } + m10.ah = v10; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(gga(b10, m10.ah))); + b10.b() ? (Zo(), b10 = m10.gda, a10 = m10.ah, b10 = hga(Zo(), b10, a10)) : b10 = b10.c(); + m10.xf = b10; + m10.da = iga(m10.xf); + b10 = false; + a10 = null; + a: { + if (h10 instanceof z7 && (b10 = true, a10 = h10, c10 = a10.i, c10.qh === m10.da)) { + h10 = c10; + break a; + } + if (b10) + h10 = a10.i, b10 = new Aq().zo(m10.da, h10.Df, h10.ni, h10.lj, h10.Hp()), b10.Fu = h10.Fu, b10.Ip = h10.Ip, h10 = b10; + else if (y7() === h10) + h10 = m10.da, K7(), pj(), b10 = new Lf().a(), h10 = new Aq().zo(h10, b10.ua(), new Mq().a(), Nq(), y7()); + else + throw new x7().d(h10); + } + m10.m = h10; + return Pfa(m10); + }; + }(this))); + }; + uq.prototype.$classData = r8({ Kwa: 0 }, false, "amf.core.AMFCompiler$", { Kwa: 1, f: 1 }); + var Afa = void 0; + function Mfa() { + this.l = this.t9 = null; + } + Mfa.prototype = new u7(); + Mfa.prototype.constructor = Mfa; + function Lfa(a10, b10) { + b10.Q.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10.$n.Df.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = f10.t9, l10 = Lc(g10.Jd); + l10 = l10.b() ? g10.Jd.j : l10.c(); + ae4(); + h10 = h10.Ca.da; + h10 = new Uq().xU(l10, ce4(0, de4(ee4(), h10.rf, h10.If, h10.Yf, h10.bg))); + return Cb(k10, h10); + }; + }(c10, e10))); + }; + }(a10))); + return a10.t9; + } + Mfa.prototype.$classData = r8({ Mwa: 0 }, false, "amf.core.AMFCompiler$TaggedReferences", { Mwa: 1, f: 1 }); + function Vq() { + this.bT = 0; + } + Vq.prototype = new u7(); + Vq.prototype.constructor = Vq; + Vq.prototype.a = function() { + this.bT = 0; + return this; + }; + function Nq() { + var a10 = jga(); + a10.bT = 1 + a10.bT | 0; + return a10.bT; + } + Vq.prototype.$classData = r8({ Nwa: 0 }, false, "amf.core.AMFCompilerRunCount$", { Nwa: 1, f: 1 }); + var kga = void 0; + function jga() { + kga || (kga = new Vq().a()); + return kga; + } + function Ep() { + this.Tpa = this.wc = this.Se = this.Hj = this.Jd = null; + } + Ep.prototype = new u7(); + Ep.prototype.constructor = Ep; + function lga(a10) { + var b10 = new Wq().a(); + mga(a10, b10, cfa()); + return b10.t(); + } + function afa(a10, b10) { + return nq(hp(), oq(/* @__PURE__ */ function(c10) { + return function() { + return lga(c10); + }; + }(a10)), b10); + } + function $ea(a10, b10, c10, e10, f10, g10) { + a10.Jd = b10; + a10.Hj = c10; + a10.Se = e10; + a10.wc = f10; + a10.Tpa = g10; + return a10; + } + function Zea(a10, b10, c10) { + var e10 = ml(); + return nq(hp(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + mga(f10, g10, h10); + }; + }(a10, b10, c10)), e10); + } + function dfa(a10, b10, c10) { + var e10 = ml(); + return afa(a10, e10).Yg(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = Qp().qj(h10); + l10.b() ? Pea(hp(), new nb().e("Unsupported write operation: " + h10)) : (l10 = l10.c(), nga(g10.vb.R_(l10), k10)); + }; + }(a10, b10, c10)), e10); + } + function mga(a10, b10, c10) { + yq(zq(), "AMFSerializer#render: Rendering to " + a10.Hj + " (" + a10.Se + " file) " + Lc(a10.Jd)); + if (a10.Se === Xq().Vp.ve()) + if (a10.wc.D8) + c10 = new Yq().Gaa(b10, a10.wc.E8, c10), a10.wc.x_ ? oga().jO(a10.Jd, c10, a10.wc) : pga().jO(a10.Jd, c10, a10.wc); + else { + if (lq().qi.uA instanceof z7) { + var e10 = new Mb().gU(Qaa(a10.Jd, a10.wc)); + qga().x3(a10.Hj, e10, b10, c10); + } + } + else { + e10 = rga(a10); + if (e10.b()) + throw mb(E6(), new nb().e("Cannot serialize domain model '" + Lc(a10.Jd) + "' for detected media type " + a10.Hj + " and vendor " + a10.Se)); + e10 = e10.c(); + var f10 = new Zq().a(); + if (e10.t0(a10.Jd, f10, a10.wc, a10.Tpa)) + e10 = $q(new Dc(), f10.GI.c(), y7()); + else + throw mb(E6(), new nb().e("Error unparsing syntax " + a10.Hj + " with domain plugin " + e10.gi())); + f10 = Yfa(qq(), a10.Hj); + if (f10 instanceof z7) + f10.i.x3(a10.Hj, e10, b10, c10); + else if (y7() === f10 && a10.Jd instanceof Mk) + b10 = new Aj().d(b10), a10 = B6(ar(a10.Jd.g, Jk().nb).g, Ok().Rd).A, a10 = a10.b() ? null : a10.c(), c10.hv(b10.Rp, a10); + else + throw mb(E6(), new nb().e("Unsupported media type " + a10.Hj + " and vendor " + a10.Se)); + } + } + function rga(a10) { + var b10 = Gfa(qq(), a10.Se).Fb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return e10.Qz().Ha(c10.Hj) && e10.FD(c10.Jd); + }; + }(a10))); + if (b10 instanceof z7) + return new z7().d(b10.i); + if (y7() === b10) + return Ffa(qq(), a10.Hj).Fb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return e10.FD(c10.Jd); + }; + }(a10))); + throw new x7().d(b10); + } + function sga(a10, b10) { + var c10 = ml(); + return nq(hp(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + e10.Se === Xq().Vp.ve() && (e10.wc.x_ ? oga().jO(e10.Jd, f10, e10.wc) : pga().jO(e10.Jd, f10, e10.wc)); + }; + }(a10, b10)), c10); + } + Ep.prototype.$classData = r8({ Owa: 0 }, false, "amf.core.AMFSerializer", { Owa: 1, f: 1 }); + function br() { + } + br.prototype = new u7(); + br.prototype.constructor = br; + br.prototype.a = function() { + return this; + }; + br.prototype.GG = function() { + if (Cf().X2.b()) { + var a10 = Cf(), b10 = new cr().a(); + a10.X2 = new z7().d(b10); + } + }; + br.prototype.$classData = r8({ Pwa: 0 }, false, "amf.core.AMFSerializer$", { Pwa: 1, f: 1 }); + var tga = void 0; + function Vba() { + tga || (tga = new br().a()); + return tga; + } + function dr() { + this.YP = this.ZP = this.ZH = this.fc = this.xG = null; + } + dr.prototype = new u7(); + dr.prototype.constructor = dr; + dr.prototype.a = function() { + uga = this; + this.xG = H10(); + this.fc = y7(); + this.ZH = J5(K7(), H10()); + this.ZP = Rb(Gb().ab, H10()); + this.YP = Rb(Gb().ab, H10()); + return this; + }; + function vga(a10, b10, c10) { + wga(a10, b10); + if ((c10 = Hb(c10)) && c10.$classData && c10.$classData.ge.vda) + return c10.Yg(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + xga(zq(), f10); + return g10; + }; + }(a10, b10)), ml()); + xga(a10, b10); + return c10; + } + function yga(a10, b10, c10, e10) { + var f10 = b10.kc(); + if (f10 instanceof z7) { + f10 = f10.i; + var g10 = Mc(ua(), f10, "::SEP::"); + f10 = new qd().d(g10.n[0]); + g10 = g10.n[1]; + if ("start" === g10) { + e10 = e10 ? 2 + c10 | 0 : c10; + g10 = b10.ta().xl(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = m10.oa + "::SEP::end"; + return !(0 <= (p10.length | 0) && p10.substring(0, t10.length | 0) === t10); + }; + }(a10, f10))); + e10 = yga(a10, g10, e10, true); + b10 = b10.ta().gl(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = m10.oa + "::SEP::end"; + return !(0 <= (p10.length | 0) && p10.substring(0, t10.length | 0) === t10); + }; + }(a10, f10))).ta(); + b10 = yga(a10, b10, c10, true); + var h10 = Da(a10.YP.P(f10.oa)); + g10 = h10.od; + h10 = h10.Ud; + a10 = Da(a10.ZP.P(f10.oa)); + var k10 = a10.Ud; + a10 = g10 - a10.od | 0; + g10 = (-2147483648 ^ a10) > (-2147483648 ^ g10) ? -1 + (h10 - k10 | 0) | 0 : h10 - k10 | 0; + h10 = new qg().e(" "); + c10 = zga(h10, c10); + c10 = new qg().e(c10); + f10 = "| [" + new qa().Sc(a10, g10) + " ms] " + f10.oa; + f10 = new qg().e(f10); + a10 = Gb().uN; + c10 = xq(c10, f10, a10); + c10 = J5(K7(), new Ib().ha([c10])); + f10 = K7(); + e10 = c10.ia(e10, f10.u); + c10 = K7(); + return e10.ia(b10, c10.u); + } + if ("end" === g10) + return H10(); + throw new x7().d(g10); + } + if (y7() === f10) + return H10(); + throw new x7().d(f10); + } + function Aga(a10) { + yga(a10, a10.ZH, 0, false).U(w6(/* @__PURE__ */ function() { + return function(b10) { + er(fr().mv, b10); + }; + }(a10))); + } + function yq(a10, b10) { + var c10 = a10.fc; + if (!c10.b()) { + c10 = c10.c(); + var e10 = Bga(), f10 = e10.od; + e10 = e10.Ud; + zq().fc = new z7().d(Cga(c10, b10, new qa().Sc(f10, e10))); + } + return a10; + } + function xga(a10, b10) { + a10 = a10.fc; + if (!a10.b()) { + a10.c(); + a10 = zq(); + var c10 = zq().YP, e10 = Bga(); + a10.YP = c10.cc(new R6().M(b10, new qa().Sc(e10.od, e10.Ud))); + a10 = zq(); + c10 = zq().ZH; + b10 = J5(K7(), new Ib().ha([b10 + "::SEP::end"])); + e10 = K7(); + a10.ZH = c10.ia(b10, e10.u); + } + } + function Dga(a10) { + var b10 = a10.xG, c10 = K7(); + b10.og(c10.u).U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(), h10 = f10.Ki(), k10 = g10.cF; + f10 = k10.od; + k10 = k10.Ud; + f10 = new gr().O$(new qa().Sc(f10, k10)); + k10 = fr().mv; + var l10 = g10.mK, m10 = l10.od; + l10 = l10.Ud; + var p10 = g10.cF, t10 = p10.Ud; + p10 = m10 - p10.od | 0; + er(k10, "---- Run " + h10 + " (" + new qa().Sc(p10, (-2147483648 ^ p10) > (-2147483648 ^ m10) ? -1 + (l10 - t10 | 0) | 0 : l10 - t10 | 0) + " ms) ----\n"); + g10.nH.U(w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + var C10 = fr().mv, I10 = D10.nC, L10 = I10.od; + I10 = I10.Ud; + var Y10 = A10.oa, ia = Y10.Ud; + Y10 = L10 - Y10.od | 0; + er(C10, " (" + new qa().Sc(Y10, (-2147483648 ^ Y10) > (-2147483648 ^ L10) ? -1 + (I10 - ia | 0) | 0 : I10 - ia | 0) + " ms) " + D10.XP); + A10.oa = D10.nC; + }; + }(e10, f10))); + h10 = fr().mv; + k10 = g10.mK; + g10 = k10.od; + k10 = k10.Ud; + m10 = f10.oa; + f10 = m10.Ud; + m10 = g10 - m10.od | 0; + er(h10, " (" + new qa().Sc(m10, (-2147483648 ^ m10) > (-2147483648 ^ g10) ? -1 + (k10 - f10 | 0) | 0 : k10 - f10 | 0) + " ms) Finished"); + er(fr().mv, "\n\n\n"); + } else + throw new x7().d(f10); + }; + }(a10))); + } + function wga(a10, b10) { + a10 = a10.fc; + if (!a10.b()) { + a10.c(); + a10 = zq(); + var c10 = zq().ZP, e10 = Bga(); + a10.ZP = c10.cc(new R6().M(b10, new qa().Sc(e10.od, e10.Ud))); + a10 = zq(); + c10 = zq().ZH; + b10 = J5(K7(), new Ib().ha([b10 + "::SEP::start"])); + e10 = K7(); + a10.ZH = c10.ia(b10, e10.u); + } + } + dr.prototype.buildReport = function() { + Dga(this); + }; + dr.prototype.finish = function() { + var a10 = this.fc; + if (!a10.b()) { + var b10 = a10.c(); + a10 = zq(); + var c10 = zq().xG, e10 = K7(); + b10 = [Ega(b10)]; + e10 = J5(e10, new Ib().ha(b10)); + b10 = K7(); + a10.xG = c10.ia(e10, b10.u); + } + this.fc = y7(); + return this; + }; + dr.prototype.start = function() { + var a10 = this.fc; + if (!a10.b()) { + var b10 = a10.c(); + a10 = zq(); + var c10 = zq().xG, e10 = K7(); + b10 = [Ega(b10)]; + e10 = J5(e10, new Ib().ha(b10)); + b10 = K7(); + a10.xG = c10.ia(e10, b10.u); + } + c10 = Bga(); + a10 = c10.od; + c10 = c10.Ud; + this.fc = new z7().d(Fga(new hr(), new qa().Sc(a10, c10), new qa().Sc(a10, c10), H10())); + return this; + }; + dr.prototype.log = function(a10) { + return yq(this, a10); + }; + dr.prototype.printStages = function() { + Aga(this); + }; + dr.prototype.withStage = function(a10, b10) { + return vga(this, a10, b10); + }; + dr.prototype.endStage = function(a10) { + xga(this, a10); + }; + dr.prototype.startStage = function(a10) { + wga(this, a10); + }; + Object.defineProperty(dr.prototype, "stagesEndTime", { get: function() { + return this.YP; + }, set: function(a10) { + this.YP = a10; + }, configurable: true }); + Object.defineProperty(dr.prototype, "stagesStartTime", { get: function() { + return this.ZP; + }, set: function(a10) { + this.ZP = a10; + }, configurable: true }); + Object.defineProperty(dr.prototype, "stagesSeq", { get: function() { + return this.ZH; + }, set: function(a10) { + this.ZH = a10; + }, configurable: true }); + Object.defineProperty(dr.prototype, "current", { get: function() { + return this.fc; + }, set: function(a10) { + this.fc = a10; + }, configurable: true }); + Object.defineProperty(dr.prototype, "executions", { get: function() { + return this.xG; + }, set: function(a10) { + this.xG = a10; + }, configurable: true }); + dr.prototype.$classData = r8({ Sxa: 0 }, false, "amf.core.benchmark.ExecutionLog$", { Sxa: 1, f: 1 }); + var uga = void 0; + function zq() { + uga || (uga = new dr().a()); + return uga; + } + function kp() { + this.Kx = false; + this.FS = null; + } + kp.prototype = new u7(); + kp.prototype.constructor = kp; + kp.prototype.a = function() { + this.Kx = true; + this.FS = y7(); + return this; + }; + kp.prototype.U4 = function() { + this.Kx = false; + return this; + }; + kp.prototype.T4 = function() { + this.Kx = true; + return this; + }; + Object.defineProperty(kp.prototype, "definedBaseUrl", { get: function() { + return this.FS; + }, configurable: true }); + Object.defineProperty(kp.prototype, "isAmfJsonLdSerilization", { get: function() { + return this.Kx; + }, configurable: true }); + kp.prototype.withoutBaseUnitUrl = function() { + this.FS = y7(); + return this; + }; + kp.prototype.withBaseUnitUrl = function(a10) { + this.FS = new z7().d(a10); + return this; + }; + Object.defineProperty(kp.prototype, "withAmfJsonLdSerialization", { get: function() { + return this.T4(); + }, configurable: true }); + Object.defineProperty(kp.prototype, "withoutAmfJsonLdSerialization", { get: function() { + return this.U4(); + }, configurable: true }); + kp.prototype.$classData = r8({ Uxa: 0 }, false, "amf.core.client.ParsingOptions", { Uxa: 1, f: 1 }); + function ir() { + } + ir.prototype = new u7(); + ir.prototype.constructor = ir; + ir.prototype.a = function() { + return this; + }; + function jr(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Qa(f10); + }; + }(a10, c10))); + } + function kr(a10, b10, c10) { + a: { + for (a10 = b10.hf.Dc; !a10.b(); ) { + b10 = a10.ga(); + if (Gga(c10, b10)) { + c10 = new z7().d(a10.ga()); + break a; + } + a10 = a10.ta(); + } + c10 = y7(); + } + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10)); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.yc.$d)); + return c10.b() ? ld() : c10.c(); + } + function lr(a10, b10, c10, e10) { + a10 = mr(T6(), nr(or(), c10), e10); + pr(b10.s, a10); + } + function qr(a10, b10, c10) { + a10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10); + T6(); + var f10 = mh(T6(), "@id"); + T6(); + c10 = c10.trim(); + c10 = mh(T6(), c10); + sr(e10, f10, c10); + pr(a10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + } + function vr(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Ob(f10); + }; + }(a10, c10))); + } + ir.prototype.$classData = r8({ Vxa: 0 }, false, "amf.core.emitter.BaseEmitters.package$", { Vxa: 1, f: 1 }); + var Hga = void 0; + function wr() { + Hga || (Hga = new ir().a()); + return Hga; + } + function xr() { + } + xr.prototype = new u7(); + xr.prototype.constructor = xr; + xr.prototype.a = function() { + return this; + }; + function Iga(a10, b10, c10, e10, f10) { + a10 = ih(new jh(), e10, (O7(), new P6().a())); + return $g(new ah(), b10, lh(c10, kh(a10, f10)), y7()); + } + xr.prototype.$classData = r8({ dya: 0 }, false, "amf.core.emitter.BaseEmitters.package$RawValueEmitter$", { dya: 1, f: 1 }); + var Jga = void 0; + function Kga() { + Jga || (Jga = new xr().a()); + return Jga; + } + function yr(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.db); + } + function zr(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.wh); + } + function Df() { + this.UW = this.VL = this.GN = this.pS = false; + this.L0 = null; + this.x_ = this.D8 = false; + this.Bc = null; + this.iO = this.E8 = false; + } + Df.prototype = new u7(); + Df.prototype.constructor = Df; + Df.prototype.a = function() { + this.UW = this.VL = this.GN = this.pS = false; + this.L0 = w6(/* @__PURE__ */ function() { + return function() { + return false; + }; + }(this)); + this.D8 = true; + this.x_ = false; + this.Bc = Vea(); + this.iO = this.E8 = false; + return this; + }; + function Lga() { + var a10 = new Df().a(); + a10.UW = true; + return a10; + } + Df.prototype.$classData = r8({ hya: 0 }, false, "amf.core.emitter.RenderOptions", { hya: 1, f: 1 }); + function Ar() { + } + Ar.prototype = new u7(); + Ar.prototype.constructor = Ar; + Ar.prototype.a = function() { + return this; + }; + function Bp(a10, b10) { + a10 = new Df().a(); + a10.pS = b10.BW; + a10.D8 = b10.Kx; + a10.GN = b10.ZS; + var c10 = hfa(b10.Bc); + a10.Bc = c10; + a10.E8 = b10.QV; + a10.x_ = b10.OT; + return a10; + } + Ar.prototype.$classData = r8({ iya: 0 }, false, "amf.core.emitter.RenderOptions$", { iya: 1, f: 1 }); + var Mga = void 0; + function Cp() { + Mga || (Mga = new Ar().a()); + return Mga; + } + function Yf() { + this.qS = false; + this.F8 = null; + } + Yf.prototype = new u7(); + Yf.prototype.constructor = Yf; + Yf.prototype.a = function() { + this.qS = true; + this.F8 = Vea(); + return this; + }; + function Nga() { + var a10 = new Yf().a(); + a10.qS = false; + return a10; + } + Yf.prototype.$classData = r8({ jya: 0 }, false, "amf.core.emitter.ShapeRenderOptions", { jya: 1, f: 1 }); + function Br() { + } + Br.prototype = new u7(); + Br.prototype.constructor = Br; + Br.prototype.a = function() { + return this; + }; + Br.prototype.$classData = r8({ kya: 0 }, false, "amf.core.emitter.ShapeRenderOptions$", { kya: 1, f: 1 }); + var Oga = void 0; + function Cr(a10) { + a10.nc(tb(new ub(), vb().qm, "", "", H10())); + } + function Dr(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.hc); + } + function Er() { + this.ev = this.bv = this.Qi = this.Ul = this.Ua = null; + } + Er.prototype = new u7(); + Er.prototype.constructor = Er; + Er.prototype.a = function() { + Pga = this; + this.Ua = Fr(new Gr(), "shacl", F6().Ua.he, "SHACL vocabulary", "shacl.yaml"); + this.Ul = Fr(new Gr(), "rdfs", F6().Ul.he, "RDFS vocabulary", "rdfs.yaml"); + this.Qi = Fr(new Gr(), "rdf", F6().Qi.he, "RDF vocabulary", "rdf.yaml"); + this.bv = Fr(new Gr(), "owl", F6().bv.he, "OWL2 vocabulary", "owl.yaml"); + this.ev = J5(K7(), new Ib().ha([this.Ua, this.Ul, this.Qi, this.bv])); + return this; + }; + Er.prototype.$classData = r8({ Wya: 0 }, false, "amf.core.metamodel.domain.ExternalModelVocabularies$", { Wya: 1, f: 1 }); + var Pga = void 0; + function ci() { + Pga || (Pga = new Er().a()); + return Pga; + } + function Hr() { + this.ev = this.dc = this.$c = this.Pg = this.Eb = this.Tb = this.Jb = this.Ta = this.hg = this.qm = null; + } + Hr.prototype = new u7(); + Hr.prototype.constructor = Hr; + Hr.prototype.a = function() { + Qga = this; + this.qm = Fr(new Gr(), "parser", F6().xF.he, "Internal namespace", ""); + this.hg = Fr(new Gr(), "doc", F6().Zd.he, "Document Model vocabulary for AMF. The Document Model defines the basic modular units where domain descriptions can be encoded.", "aml_doc.yaml"); + this.Ta = Fr(new Gr(), "apiContract", F6().Ta.he, "API contract vocabulary", "api_contract.yaml"); + this.Jb = Fr(new Gr(), "apiBinding", F6().Ta.he, "API binding vocabulary", "api_binding.yaml"); + this.Tb = Fr( + new Gr(), + "core", + F6().Tb.he, + "Core vocabulary with common classes and properties", + "core.yaml" + ); + this.Eb = Fr(new Gr(), "shapes", F6().Eb.he, "Vocabulary defining data shapes, used as an extension to SHACL", "data_shapes.yaml"); + this.Pg = Fr(new Gr(), "data", F6().Pg.he, "Vocabulary defining a default set of classes to map data structures composed of recursive records of fields,\nlike the ones used in JSON or YAML into a RDF graph.\nThey can be validated using data shapes.", "data_model.yaml"); + this.$c = Fr(new Gr(), "meta", F6().$c.he, "Vocabulary containing meta-definitions", "aml_meta.yaml"); + this.dc = Fr( + new Gr(), + "security", + F6().dc.he, + "Vocabulary for HTTP security information", + "security.yaml" + ); + this.ev = J5(K7(), new Ib().ha([this.hg, this.Tb, this.Ta, this.Eb, this.Pg, this.dc, this.$c])); + return this; + }; + Hr.prototype.$classData = r8({ aza: 0 }, false, "amf.core.metamodel.domain.ModelVocabularies$", { aza: 1, f: 1 }); + var Qga = void 0; + function vb() { + Qga || (Qga = new Hr().a()); + return Qga; + } + function Ir() { + this.aB = this.zp = this.Yr = this.bB = this.MA = this.rx = this.Ly = this.NA = this.tj = this.hw = this.jo = this.Mi = this.TC = this.of = this.Nh = this.mr = this.Xo = this.hi = this.zj = null; + } + Ir.prototype = new u7(); + Ir.prototype.constructor = Ir; + Ir.prototype.a = function() { + Rga = this; + this.zj = F6().Bj.he + "string"; + this.hi = F6().Bj.he + "integer"; + this.Xo = F6().Eb.he + "number"; + this.mr = F6().Bj.he + "long"; + this.Nh = F6().Bj.he + "double"; + this.of = F6().Bj.he + "float"; + this.TC = F6().Bj.he + "decimal"; + this.Mi = F6().Bj.he + "boolean"; + this.jo = F6().Bj.he + "date"; + this.hw = F6().Bj.he + "time"; + this.tj = F6().Bj.he + "dateTime"; + this.NA = F6().Eb.he + "dateTimeOnly"; + F6(); + this.Ly = F6().Eb.he + "file"; + this.rx = F6().Bj.he + "byte"; + this.MA = F6().Bj.he + "base64Binary"; + this.bB = F6().Eb.he + "password"; + this.Yr = F6().Bj.he + "anyType"; + this.zp = F6().Bj.he + "anyURI"; + F6(); + this.aB = F6().Bj.he + "nil"; + return this; + }; + function yca(a10, b10) { + return "string" === b10 ? a10.zj : "integer" === b10 ? a10.hi : "number" === b10 ? a10.Xo : "long" === b10 ? a10.mr : "double" === b10 ? a10.Nh : "float" === b10 ? a10.of : "decimal" === b10 ? a10.TC : "boolean" === b10 ? a10.Mi : "date" === b10 || "date-only" === b10 ? a10.jo : "time" === b10 || "time-only" === b10 ? a10.hw : "dateTime" === b10 || "datetime" === b10 ? a10.tj : "dateTimeOnly" === b10 || "datetime-only" === b10 ? a10.NA : "file" === b10 ? a10.Ly : "byte" === b10 ? a10.rx : "base64Binary" === b10 ? a10.MA : "password" === b10 ? a10.bB : "anyType" === b10 || "any" === b10 ? a10.Yr : "anyUri" === b10 || "uri" === b10 ? a10.zp : "nil" === b10 ? a10.aB : "" + F6().Bj.he + b10; + } + Ir.prototype.$classData = r8({ sza: 0 }, false, "amf.core.model.DataType$", { sza: 1, f: 1 }); + var Rga = void 0; + function Uh() { + Rga || (Rga = new Ir().a()); + return Rga; + } + function Lr() { + this.ju = this.x = null; + } + Lr.prototype = new u7(); + Lr.prototype.constructor = Lr; + function Nr(a10, b10, c10) { + Sga(c10.x).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = new R6().M(f10, g10.r), k10 = e10.x.Ja(g10.ve()); + if (k10 instanceof z7) + return Or(k10.i, h10); + if (y7() === k10) { + k10 = e10.x; + g10 = g10.ve(); + h10 = [h10]; + for (var l10 = new Pr().a(), m10 = 0, p10 = h10.length | 0; m10 < p10; ) + Or(l10, h10[m10]), m10 = 1 + m10 | 0; + return Or(k10, new R6().M(g10, l10)); + } + throw new x7().d(k10); + }; + }(a10, b10))); + Tga(c10.x).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = new R6().M(f10, g10.r), k10 = e10.ju.Ja(g10.ve()); + if (k10 instanceof z7) + return Or(k10.i, h10); + if (y7() === k10) { + k10 = e10.ju; + g10 = g10.ve(); + h10 = [h10]; + for (var l10 = new Pr().a(), m10 = 0, p10 = h10.length | 0; m10 < p10; ) + Or(l10, h10[m10]), m10 = 1 + m10 | 0; + return Or(k10, new R6().M(g10, l10)); + } + throw new x7().d(k10); + }; + }(a10, b10))); + } + function Uga(a10, b10) { + var c10 = new Pr().a(); + a10.x = b10; + a10.ju = c10; + return a10; + } + function nba(a10, b10) { + var c10 = a10.x.Ja(b10); + c10 = c10.b() ? a10.ju.Ja(b10) : c10; + if (c10 instanceof z7) + b10 = c10.i; + else { + if (y7() !== c10) + throw new x7().d(c10); + c10 = Rb(Qr(), H10()); + Or(a10.x, new R6().M(b10, c10)); + b10 = c10; + } + return Uc(/* @__PURE__ */ function(e10, f10) { + return function(g10, h10) { + f10.Xh(new R6().M(g10, h10)); + }; + }(a10, b10)); + } + Lr.prototype.$classData = r8({ Fza: 0 }, false, "amf.core.model.document.SourceMap", { Fza: 1, f: 1 }); + function Rr() { + this.ce = null; + } + Rr.prototype = new u7(); + Rr.prototype.constructor = Rr; + Rr.prototype.a = function() { + Vga = this; + this.ce = Uga(new Lr(), new Pr().a()); + return this; + }; + function Sr(a10, b10, c10) { + var e10 = lba(); + Sga(c10.fa()).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = g10.x, m10 = k10.ve(); + k10 = [new R6().M(h10, k10.r)]; + for (var p10 = new Pr().a(), t10 = 0, v10 = k10.length | 0; t10 < v10; ) + Or(p10, k10[t10]), t10 = 1 + t10 | 0; + return Or(l10, new R6().M(m10, p10)); + }; + }(a10, e10, b10))); + Tga(c10.fa()).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = g10.ju, m10 = k10.ve(); + k10 = [new R6().M(h10, k10.r)]; + for (var p10 = new Pr().a(), t10 = 0, v10 = k10.length | 0; t10 < v10; ) + Or(p10, k10[t10]), t10 = 1 + t10 | 0; + return Or(l10, new R6().M(m10, p10)); + }; + }(a10, e10, b10))); + return e10; + } + function lba() { + rc(); + return Uga(new Lr(), Rb(Qr(), H10())); + } + Rr.prototype.$classData = r8({ Gza: 0 }, false, "amf.core.model.document.SourceMap$", { Gza: 1, f: 1 }); + var Vga = void 0; + function rc() { + Vga || (Vga = new Rr().a()); + return Vga; + } + function Wr(a10, b10, c10) { + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ih(new jh(), g10, new P6().a()); + }; + }(a10)), f10 = K7(); + c10 = c10.ka(e10, f10.u); + Zd(a10, b10, c10); + } + function Ai(a10, b10) { + return a10.pc("" + b10 + a10.dd()); + } + function Xr(a10, b10, c10) { + c10 = ih(new jh(), c10, new P6().a()); + Vd(a10, b10, c10); + } + function eb(a10, b10, c10) { + c10 = ih(new jh(), c10, new P6().a()); + return Vd(a10, b10, c10); + } + function Wga(a10) { + return -1 !== (a10.indexOf("//") | 0) ? a10.split("//").join("/") : a10; + } + function Rd(a10, b10) { + var c10 = b10.indexOf("://") | 0; + if (-1 === c10) + b10 = Wga(b10); + else { + var e10 = 3 + c10 | 0; + c10 = b10.substring(0, e10); + b10 = b10.substring(e10); + b10 = "" + c10 + Wga(b10); + } + a10.Sd(b10); + return a10; + } + function Bi(a10, b10, c10) { + c10 = ih(new jh(), c10, new P6().a()); + return Vd(a10, b10, c10); + } + function Zd(a10, b10, c10) { + Yr(a10.Y(), a10.j, b10, Zr(new $r(), c10, new P6().a()), (O7(), new P6().a())); + return a10; + } + function as(a10, b10, c10, e10) { + Ui(a10.Y(), b10, Zr(new $r(), c10, new P6().a()), e10); + } + function bs(a10, b10, c10, e10) { + Yr(a10.Y(), a10.j, b10, Zr(new $r(), c10, new P6().a()), e10); + return a10; + } + function Bf(a10, b10, c10) { + Ui(a10.Y(), b10, Zr(new $r(), c10, new P6().a()), (O7(), new P6().a())); + return a10; + } + function Vd(a10, b10, c10) { + Yr(a10.Y(), a10.j, b10, c10, (O7(), new P6().a())); + return a10; + } + function ig(a10, b10, c10) { + var e10 = a10.Y(), f10 = a10.j; + Xga(e10, f10, c10); + var g10 = cs(e10, b10); + if (g10 instanceof z7) + b10 = g10.i, e10 = b10.wb, f10 = K7(), b10.wb = e10.yg(c10, f10.u); + else if (y7() === g10) + g10 = K7(), Yr(e10, f10, b10, Zr(new $r(), J5(g10, new Ib().ha([c10])), new P6().a()), (O7(), new P6().a())); + else + throw new x7().d(g10); + return a10; + } + function ds(a10, b10) { + var c10 = b10.Ja(a10.j); + if (c10 instanceof z7) + return c10.i; + c10 = a10.bc(); + if (Kaa(c10)) + c10 = c10.lc(); + else + throw new x7().d(c10); + c10 = c10.pc(a10.j); + c10.fa().Sp(a10.fa()); + b10.Ue(a10.j, c10); + a10 = Yga(a10.Y(), b10); + b10 = c10.Y(); + b10.vb = b10.vb.uq(a10.vb); + return c10; + } + function Rg(a10, b10, c10, e10) { + Yr(a10.Y(), a10.j, b10, c10, e10); + return a10; + } + function es(a10, b10, c10) { + c10 = ih(new jh(), c10, new P6().a()); + Vd(a10, b10, c10); + } + function lb(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.vc); + } + function wc() { + } + wc.prototype = new u7(); + wc.prototype.constructor = wc; + wc.prototype.a = function() { + return this; + }; + wc.prototype.qj = function(a10) { + a10 = fs().O_.Ja(a10); + return a10 instanceof z7 ? new z7().d(Uc(/* @__PURE__ */ function(b10, c10) { + return function(e10, f10) { + return c10.Ji(e10, f10); + }; + }(this, a10.i))) : y7(); + }; + wc.prototype.$classData = r8({ Lza: 0 }, false, "amf.core.model.domain.Annotation$", { Lza: 1, f: 1 }); + var hba = void 0; + function gs() { + this.kG = null; + } + gs.prototype = new u7(); + gs.prototype.constructor = gs; + gs.prototype.a = function() { + Zga = this; + var a10 = F6().Pg; + this.kG = G5(a10, "Array"); + return this; + }; + gs.prototype.$classData = r8({ Nza: 0 }, false, "amf.core.model.domain.ArrayNode$", { Nza: 1, f: 1 }); + var Zga = void 0; + function hs() { + Zga || (Zga = new gs().a()); + return Zga; + } + function is() { + } + is.prototype = new u7(); + is.prototype.constructor = is; + is.prototype.a = function() { + return this; + }; + function js(a10, b10, c10) { + $ga(c10, b10); + if (c10 instanceof bl) + B6(c10.aa, al().Tt).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return js(ks(), h10.j, k10); + }; + }(a10, c10))); + else if (c10 instanceof Xk) { + b10 = ls(c10); + var e10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return B6(h10.aa, k10); + }; + }(a10, c10)), f10 = Xd(); + b10.ka(e10, f10.u).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return js(ks(), h10.j, k10); + }; + }(a10, c10))); + } + return c10; + } + is.prototype.$classData = r8({ Oza: 0 }, false, "amf.core.model.domain.DataNodeOps$", { Oza: 1, f: 1 }); + var aha = void 0; + function ks() { + aha || (aha = new is().a()); + return aha; + } + function ms() { + this.kG = null; + } + ms.prototype = new u7(); + ms.prototype.constructor = ms; + ms.prototype.a = function() { + bha = this; + var a10 = F6().Pg; + this.kG = G5(a10, "Link"); + return this; + }; + function cha(a10, b10, c10, e10) { + a10 = new ns().K(new S6().a(), e10); + e10 = os().vf; + eb(a10, e10, c10); + c10 = os().Xp; + eb(a10, c10, b10); + return a10; + } + ms.prototype.$classData = r8({ Sza: 0 }, false, "amf.core.model.domain.LinkNode$", { Sza: 1, f: 1 }); + var bha = void 0; + function dha() { + bha || (bha = new ms().a()); + return bha; + } + function ps() { + this.kG = null; + } + ps.prototype = new u7(); + ps.prototype.constructor = ps; + ps.prototype.a = function() { + eha = this; + var a10 = F6().Pg; + this.kG = G5(a10, "Object"); + return this; + }; + ps.prototype.$classData = r8({ Uza: 0 }, false, "amf.core.model.domain.ObjectNode$", { Uza: 1, f: 1 }); + var eha = void 0; + function qs() { + eha || (eha = new ps().a()); + return eha; + } + function rs() { + } + rs.prototype = new u7(); + rs.prototype.constructor = rs; + rs.prototype.a = function() { + return this; + }; + function fha(a10, b10) { + a10 = new S6().a(); + a10 = new zi().K(a10, b10.fa()); + var c10 = B6(b10.Y(), qf().R).A; + c10 = c10.b() ? "default-recursion" : c10.c(); + O7(); + var e10 = new P6().a(); + a10 = Sd(a10, c10, e10); + c10 = b10.j; + J5(K7(), H10()); + a10 = Ai(a10, c10); + c10 = B6(b10.Y(), db().oe); + c10 = Ic(c10); + e10 = db().oe; + a10 = Bi(a10, e10, c10); + c10 = b10.j; + e10 = Ci().Ys; + return Di(eb(a10, e10, c10), b10); + } + rs.prototype.$classData = r8({ Yza: 0 }, false, "amf.core.model.domain.RecursiveShape$", { Yza: 1, f: 1 }); + var gha = void 0; + function Vca() { + gha || (gha = new rs().a()); + return gha; + } + function hha(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Zza); + } + function ss() { + this.uH = this.bja = this.aja = this.coa = this.jja = this.nja = this.Ika = this.Lja = this.Kja = this.nC = this.vr = this.mja = this.Nja = this.Lka = this.jka = this.ana = this.RB = this.oma = this.fqa = null; + } + ss.prototype = new u7(); + ss.prototype.constructor = ss; + ss.prototype.a = function() { + iha = this; + this.fqa = ih(new jh(), Uh().zj, O7().ce); + this.oma = ih(new jh(), Uh().hi, O7().ce); + this.RB = ih(new jh(), Uh().Xo, O7().ce); + this.ana = ih(new jh(), Uh().mr, O7().ce); + this.jka = ih(new jh(), Uh().Nh, O7().ce); + this.Lka = ih(new jh(), Uh().of, O7().ce); + this.Nja = ih(new jh(), Uh().TC, O7().ce); + this.mja = ih(new jh(), Uh().Mi, O7().ce); + this.vr = ih(new jh(), Uh().jo, O7().ce); + this.nC = ih(new jh(), Uh().hw, O7().ce); + this.Kja = ih(new jh(), Uh().tj, O7().ce); + this.Lja = ih(new jh(), Uh().NA, O7().ce); + this.Ika = ih(new jh(), Uh().Ly, O7().ce); + this.nja = ih( + new jh(), + Uh().rx, + O7().ce + ); + this.jja = ih(new jh(), Uh().MA, O7().ce); + this.coa = ih(new jh(), Uh().bB, O7().ce); + this.aja = ih(new jh(), Uh().Yr, O7().ce); + this.bja = ih(new jh(), Uh().zp, O7().ce); + this.uH = ih(new jh(), Uh().aB, O7().ce); + return this; + }; + function ts(a10, b10, c10, e10) { + a10 = new Vi().K(new S6().a(), e10); + c10.b() || (c10 = c10.c(), e10.Lb(new us().e(c10)), jha(a10, c10)); + c10 = Wi().vf; + return Vd(a10, c10, ih(new jh(), b10, e10)); + } + ss.prototype.$classData = r8({ aAa: 0 }, false, "amf.core.model.domain.ScalarNode$", { aAa: 1, f: 1 }); + var iha = void 0; + function vs() { + iha || (iha = new ss().a()); + return iha; + } + function P6() { + this.hf = null; + } + P6.prototype = new u7(); + P6.prototype.constructor = P6; + function kha() { + } + d7 = kha.prototype = P6.prototype; + d7.a = function() { + this.hf = new Lf().a(); + return this; + }; + d7.Sp = function(a10) { + return this.IM(a10.hf); + }; + function wh(a10, b10) { + for (a10 = a10.hf.Dc; !a10.b(); ) { + var c10 = a10.ga(); + if (Gga(b10, c10)) + return true; + a10 = a10.ta(); + } + return false; + } + function Ab(a10, b10) { + a: { + for (a10 = a10.hf.Dc; !a10.b(); ) { + var c10 = a10.ga(); + if (Gga(b10, c10)) { + b10 = new z7().d(a10.ga()); + break a; + } + a10 = a10.ta(); + } + b10 = y7(); + } + if (b10.b()) + return y7(); + b10 = b10.c(); + return new z7().d(b10); + } + d7.Lb = function(a10) { + Dg(this.hf, a10); + return this; + }; + d7.IM = function(a10) { + ws(this.hf, a10); + return this; + }; + function Sga(a10) { + var b10 = new lha().dq(a10); + a10 = a10.hf; + var c10 = Ef().u; + return xs(a10, b10, c10); + } + function Tga(a10) { + var b10 = new mha().dq(a10); + a10 = a10.hf; + var c10 = Ef().u; + return xs(a10, b10, c10); + } + function ys(a10) { + var b10 = Ab(a10, q5(Bb)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.da)); + b10 = b10.b() ? "" : b10.c(); + a10 = Ab(a10, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(de4(ee4(), a10.yc.$d.cf, a10.yc.$d.Dg, a10.yc.ms.cf, a10.yc.ms.Dg))); + a10 = a10.b() ? ee4().dl : a10.c(); + zs(); + return nha(b10, 0, 0, a10.rf, a10.If, a10.Yf, a10.bg); + } + d7.$classData = r8({ Hga: 0 }, false, "amf.core.parser.Annotations", { Hga: 1, f: 1 }); + function As() { + this.ce = null; + } + As.prototype = new u7(); + As.prototype.constructor = As; + As.prototype.a = function() { + oha = this; + this.ce = new pha().a(); + return this; + }; + function Od(a10, b10) { + a10 = new P6().a(); + ae4(); + var c10 = b10.da; + c10 = [new be4().jj(ce4(0, de4(ee4(), c10.rf, c10.If, c10.Yf, c10.bg))), qha(b10), new Bs().e(b10.da.Rf)]; + if (0 === (c10.length | 0)) + c10 = vd(); + else { + for (var e10 = wd(new xd(), vd()), f10 = 0, g10 = c10.length | 0; f10 < g10; ) + Ad(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + } + a10 = a10.IM(c10); + return b10 instanceof Cs ? a10.Lb(new Ds().wU(b10)) : b10 instanceof Es ? a10.Lb(new Ds().wU(b10.i)) : a10; + } + function Yi(a10, b10) { + a10 = new P6().a(); + ws(a10.hf, b10.hf); + return a10; + } + function Rs(a10, b10) { + return Od(0, b10.re()).Lb(new Ds().wU(b10)); + } + As.prototype.$classData = r8({ mAa: 0 }, false, "amf.core.parser.Annotations$", { mAa: 1, f: 1 }); + var oha = void 0; + function O7() { + oha || (oha = new As().a()); + return oha; + } + function Ws() { + this.DP = this.ni = this.ob = this.x = this.ij = this.xi = null; + } + Ws.prototype = new u7(); + Ws.prototype.constructor = Ws; + function rha() { + } + d7 = rha.prototype = Ws.prototype; + d7.y$ = function(a10) { + return a10 instanceof Pd ? (a10 = B6(a10.g, Sk().R).A, sha(this, a10.b() ? null : a10.c())) : y7(); + }; + d7.hma = function(a10, b10, c10, e10, f10) { + this.xi = a10; + this.ij = b10; + this.x = c10; + this.ob = e10; + this.ni = f10; + this.DP = J5(K7(), H10()); + }; + d7.X4 = function(a10) { + if (a10 instanceof Pd) { + var b10 = this.x, c10 = B6(a10.g, Sk().R).A; + c10 = c10.b() ? null : c10.c(); + this.x = b10.cc(new R6().M(c10, a10)); + } else + throw new x7().d(a10); + return this; + }; + d7.dp = function(a10, b10, c10) { + if (Xs() === c10) { + b10 = tha(this, a10, b10, c10); + if (b10.b()) { + a10 = this.ij.Ja(a10); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.ww); + } + return b10; + } + if (Ys() === c10) { + a10 = this.ij.Ja(a10); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.ww); + } + if (Zs() === c10) + return tha(this, a10, b10, c10); + throw new x7().d(c10); + }; + function uha(a10, b10, c10) { + a10 = a10.ob; + if (a10 instanceof z7) { + a10 = a10.i; + var e10 = dc().UC, f10 = y7(); + ec(a10, e10, "", f10, b10, c10.da); + } else + throw mb(E6(), new nb().e(b10)); + } + d7.et = function() { + return new Fc().Vd(this.x).Sb.Ye().Dd(); + }; + function sha(a10, b10) { + var c10 = Xs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.x; + }; + }(a10)), c10); + b10 = new vha(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function tha(a10, b10, c10, e10) { + var f10 = wha(xha(), b10); + if (f10.Zaa) { + var g10 = a10.xi.Ja(f10.FP); + e10 = g10.b() ? y7() : g10.c().dp(f10.$, c10, e10); + } else + e10 = y7(); + return e10.b() ? c10.P(a10).Ja(b10) : e10; + } + function at2() { + } + at2.prototype = new u7(); + at2.prototype.constructor = at2; + at2.prototype.a = function() { + return this; + }; + function Np(a10, b10) { + a10 = b10.Me; + if (a10 instanceof z7) + a10 = a10.i | 0; + else { + if (y7() !== a10) + throw new x7().d(a10); + b10.Io(new z7().d(Nq())); + a10 = b10.Me.c() | 0; + } + var c10 = Lc(b10); + return new yha().e1(a10, c10.b() ? b10.j : c10.c()); + } + at2.prototype.$classData = r8({ vAa: 0 }, false, "amf.core.parser.DefaultParserSideErrorHandler$", { vAa: 1, f: 1 }); + var zha = void 0; + function Op() { + zha || (zha = new at2().a()); + return zha; + } + function S6() { + this.vb = null; + } + S6.prototype = new u7(); + S6.prototype.constructor = S6; + function Yr(a10, b10, c10, e10, f10) { + "http://a.ml/vocabularies/document#declares" === ic(c10.r) ? Xga(a10, b10 + "#/declarations", e10) : Xga(a10, b10, e10); + b10 = a10.vb; + e10 = kh(e10, f10); + a10.vb = b10.cc(new R6().M(c10, e10)); + } + function cs(a10, b10) { + a10 = a10.vb.Ja(b10); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.r); + } + S6.prototype.a = function() { + this.vb = Rb(Aha(), H10()); + return this; + }; + function Bha(a10, b10, c10, e10) { + if (c10 instanceof jh) { + if (qb().h(b10) || yc().h(b10)) + return new bt().dE(a10, c10, e10); + if (zc().h(b10)) + return new ct().dE(a10, c10, e10); + if (Ac().h(b10)) + return new dt().dE(a10, c10, e10); + if (et3().h(b10) || hi().h(b10)) + return new ft().dE(a10, c10, e10); + if (Bc() === b10) + return new gt2().dE(a10, c10, e10); + throw mb(E6(), new nb().e("Invalid value '" + c10 + "' of type '" + b10 + "'")); + } + if (lb(c10)) { + if (Dr(b10)) + return c10; + throw mb(E6(), new nb().e("Invalid value '" + c10 + "' of type '" + b10 + "'")); + } + if (c10 instanceof $r) { + if (b10 instanceof ht2) + return b10 = new z7().d(b10.Fe).i, c10 = c10.wb, a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + return Bha(f10, g10, k10, h10); + }; + }(a10, b10, e10)), e10 = K7(), c10.ka(a10, e10.u); + throw mb(E6(), new nb().e("Invalid value '" + c10 + "' of type '" + b10 + "'")); + } + throw new x7().d(c10); + } + function it2(a10, b10) { + a10.vb = a10.vb.wp(b10); + return a10; + } + function Cha(a10, b10) { + if (b10 instanceof $r) { + b10 = b10.wb; + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return Cha(e10, f10); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + return b10 instanceof jh ? b10.r : b10; + } + function Ui(a10, b10, c10, e10) { + var f10 = a10.vb; + c10 = kh(c10, e10); + a10.vb = f10.cc(new R6().M(b10, c10)); + return a10; + } + function Xga(a10, b10, c10) { + lb(c10) ? c10.ub(b10, lt2()) : c10 instanceof $r && c10.wb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + Xga(e10, f10, g10); + }; + }(a10, b10))); + } + function ar(a10, b10) { + return Cha(a10, mt(a10, b10)); + } + function Ti(a10, b10) { + a10 = a10.vb.Ja(b10); + return a10.b() ? null : a10.c(); + } + function Dha(a10, b10) { + var c10 = a10.vb.mb(); + a: { + for (; c10.Ya(); ) { + var e10 = c10.$a(); + if (ic(e10.ma().r) === b10) { + b10 = new z7().d(e10); + break a; + } + } + b10 = y7(); + } + b10.b() || (b10 = b10.c(), it2(a10, b10.ma())); + } + function Eha(a10, b10) { + var c10 = b10.ba; + if (qb().h(c10) || yc().h(c10)) + return new bt().ov(a10, y7(), (O7(), new P6().a()), b10); + if (zc().h(c10)) + return new ct().ov(a10, y7(), (O7(), new P6().a()), b10); + if (Ac().h(c10)) + return new dt().ov(a10, y7(), (O7(), new P6().a()), b10); + if (et3().h(c10) || hi().h(c10)) + return new ft().ov(a10, y7(), (O7(), new P6().a()), b10); + if (Bc() === c10) + return new gt2().ov(a10, y7(), (O7(), new P6().a()), b10); + if (c10 instanceof ht2) + return new z7().d(c10.Fe), H10(); + if (Dr(c10)) + return null; + throw new x7().d(c10); + } + function mt(a10, b10) { + a10 = Ti(a10, b10); + a10 = nt2(ot(), a10); + a10.b() ? (b10 = Vb().Ia(b10.ba), b10 = b10.b() || b10.c() instanceof xc ? b10 : y7(), b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(Zr(new $r(), H10(), new P6().a()))), b10 = b10.b() ? null : b10.c()) : b10 = a10.c().ma(); + return b10; + } + function hd(a10, b10) { + a10 = a10.vb.Ja(b10); + return a10 instanceof z7 ? new z7().d(lh(b10, a10.i)) : y7(); + } + function pt(a10) { + var b10 = new S6().a(); + a10.vb.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + e10.vb = e10.vb.cc(f10); + }; + }(a10, b10))); + return b10; + } + function Yga(a10, b10) { + var c10 = new S6().a(); + a10.vb.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(), l10 = h10.ya(); + h10 = f10.vb; + var m10 = l10.r.Md(g10); + l10 = l10.x; + l10 = Yi(O7(), l10); + m10 = kh(m10, l10); + f10.vb = h10.cc(new R6().M(k10, m10)); + } else + throw new x7().d(h10); + }; + }(a10, c10, b10))); + return c10; + } + function B6(a10, b10) { + var c10 = a10.vb.Ja(b10); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(Bha(a10, b10.ba, c10.r, b10))); + return c10.b() ? Eha(a10, b10) : c10.c(); + } + function Bg(a10) { + a10 = pd(a10.vb); + var b10 = ii().u; + return qt(a10, b10); + } + function rt(a10, b10) { + a10.vb = a10.vb.Cb(b10); + return a10; + } + S6.prototype.$classData = r8({ CAa: 0 }, false, "amf.core.parser.Fields", { CAa: 1, f: 1 }); + function Fha() { + } + Fha.prototype = new u7(); + Fha.prototype.constructor = Fha; + function Gha() { + } + Gha.prototype = Fha.prototype; + Fha.prototype.z9 = function() { + return y7(); + }; + function st2() { + } + st2.prototype = new u7(); + st2.prototype.constructor = st2; + st2.prototype.a = function() { + return this; + }; + function Hha(a10, b10) { + a10 = Iha(new je4().e(b10)); + var c10 = Qp().$I; + 0 <= (a10.length | 0) && a10.substring(0, c10.length | 0) === c10 ? a10 = true : (a10 = Jha().Q5, a10 = 0 <= (b10.length | 0) && b10.substring(0, a10.length | 0) === a10); + a10 ? a10 = true : (a10 = Jha().P5, a10 = 0 <= (b10.length | 0) && b10.substring(0, a10.length | 0) === a10); + if (!a10 || 0 <= (b10.length | 0) && "#" === b10.substring(0, 1)) + return new R6().M(b10, y7()); + a10 = Mc(ua(), b10, "#"); + c10 = Fd(Gd(), a10); + if (!c10.b() && null !== c10.c() && 0 === c10.c().Oe(1) && (c10 = c10.c().lb(0), Ed(ua(), c10, "#"))) + return new R6().M(c10.substring(0, -2 + (c10.length | 0) | 0), y7()); + c10 = Fd(Gd(), a10); + if (!c10.b() && null !== c10.c() && 0 === c10.c().Oe(1)) + return b10 = c10.c().lb(0), new R6().M(b10, y7()); + c10 = Fd(Gd(), a10); + if (!c10.b() && null !== c10.c() && 0 === c10.c().Oe(2)) + return b10 = c10.c().lb(0), a10 = c10.c().lb(1), new R6().M(b10, new z7().d(a10)); + c10 = b10.length; + var e10 = Oc(new Pc().fd(a10)); + b10 = b10.substring(0, (-1 + (c10 | 0) | 0) - (e10.length | 0) | 0); + return new R6().M(b10, new z7().d(Oc(new Pc().fd(a10)))); + } + st2.prototype.$classData = r8({ WAa: 0 }, false, "amf.core.parser.ReferenceFragmentPartition$", { WAa: 1, f: 1 }); + var Kha = void 0; + function Lha() { + Kha || (Kha = new st2().a()); + return Kha; + } + function tt3() { + this.x = this.r = null; + } + tt3.prototype = new u7(); + tt3.prototype.constructor = tt3; + tt3.prototype.t = function() { + return this.r.t(); + }; + function Mha(a10) { + var b10 = a10.r; + ut(b10) && b10.Ie ? Nha(b10, w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (Za(e10).na()) + c10.r = f10; + else { + var g10 = e10.Re, h10 = e10.fa(), k10 = B6(e10.Y(), db().oe).A; + c10.r = f10.kk(g10, h10, e10, !(k10.b() || !k10.c())); + } + g10 = c10.r; + g10 = g10 instanceof rf ? new z7().d(g10.zv()) : y7(); + e10.dk(g10, f10.j); + }; + }(a10, b10))) : b10 instanceof $r && b10.wb.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + ut(e10) && e10.Ie && Nha(e10, w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = J5(Ef(), H10()), l10 = f10.r, m10 = f10.r.wb, p10 = w6(/* @__PURE__ */ function(v10, A10, D10, C10) { + return function(I10) { + if (null === I10 ? null === A10 : I10.h(A10)) { + var L10 = D10 instanceof rf ? new z7().d(D10.zv()) : y7(); + Dg(C10, new R6().M(I10, L10)); + L10 = A10.Re; + var Y10 = A10.fa(), ia = B6(A10.Y(), db().oe).A; + return D10.kk(L10, Y10, I10, !(ia.b() || !ia.c())); + } + return I10; + }; + }(f10, g10, h10, k10)), t10 = K7(); + l10.wb = m10.ka(p10, t10.u); + for (k10 = k10.Dc; !k10.b(); ) { + m10 = k10.ga(); + if (null !== m10) + l10 = m10.ma(), m10 = m10.ya(), l10.dk(m10, h10.j); + else + throw new x7().d(m10); + k10 = k10.ta(); + } + }; + }(c10, e10))); + }; + }(a10))); + } + function kh(a10, b10) { + var c10 = new tt3(); + c10.r = a10; + c10.x = b10; + Mha(c10); + return c10; + } + tt3.prototype.$classData = r8({ gBa: 0 }, false, "amf.core.parser.Value", { gBa: 1, f: 1 }); + function vt() { + } + vt.prototype = new u7(); + vt.prototype.constructor = vt; + vt.prototype.a = function() { + return this; + }; + function nt2(a10, b10) { + return Vb().Ia(b10).na() ? new z7().d(new R6().M(b10.r, b10.x)) : y7(); + } + vt.prototype.$classData = r8({ hBa: 0 }, false, "amf.core.parser.Value$", { hBa: 1, f: 1 }); + var Oha = void 0; + function ot() { + Oha || (Oha = new vt().a()); + return Oha; + } + function M6() { + this.X = null; + } + M6.prototype = new u7(); + M6.prototype.constructor = M6; + function wt(a10, b10) { + b10 = new qg().e(b10); + var c10 = H10(); + b10 = new rg().vi(b10.ja, c10); + return a10.X.sb.Cb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = g10.Aa.re(); + return g10 instanceof xt ? yt(f10, g10.va).na() : false; + }; + }(a10, b10))); + } + function ac(a10, b10) { + return a10.X.sb.Fb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = f10.Aa.re(); + return f10 instanceof xt ? f10.va === e10 : false; + }; + }(a10, b10))); + } + M6.prototype.W = function(a10) { + this.X = a10; + return this; + }; + function Gg(a10, b10, c10) { + a10 = ac(a10, b10); + a10.b() || c10.P(a10.c()); + } + M6.prototype.$classData = r8({ kBa: 0 }, false, "amf.core.parser.package$YMapOps", { kBa: 1, f: 1 }); + function Pha() { + this.Ca = null; + } + Pha.prototype = new u7(); + Pha.prototype.constructor = Pha; + function jc(a10, b10) { + return a10.Ca.Qp(b10).pk(); + } + function kc(a10) { + var b10 = new Pha(); + b10.Ca = a10; + return b10; + } + Pha.prototype.$classData = r8({ lBa: 0 }, false, "amf.core.parser.package$YNodeLikeOps", { lBa: 1, f: 1 }); + function zt() { + this.r = null; + } + zt.prototype = new u7(); + zt.prototype.constructor = zt; + function Qha() { + } + Qha.prototype = zt.prototype; + zt.prototype.e = function(a10) { + this.r = a10; + return this; + }; + function At() { + this.vS = 0; + } + At.prototype = new u7(); + At.prototype.constructor = At; + function Rha() { + } + Rha.prototype = At.prototype; + At.prototype.a = function() { + this.vS = 0; + return this; + }; + function Sha(a10) { + a10.vS = 1 + a10.vS | 0; + return "http://amf.org/anon/" + a10.vS; + } + function Bt() { + this.N1 = this.yE = this.O_ = null; + } + Bt.prototype = new u7(); + Bt.prototype.constructor = Bt; + Bt.prototype.a = function() { + Tha = this; + var a10 = Uha(); + a10 = new R6().M("lexical", a10); + Vha || (Vha = new Ct().a()); + var b10 = new R6().M("host-lexical", Vha); + Wha || (Wha = new Dt().a()); + var c10 = new R6().M("base-path-lexical", Wha), e10 = Xha(); + e10 = new R6().M("source-vendor", e10); + Yha || (Yha = new Et().a()); + var f10 = new R6().M("single-value-array", Yha); + Zha || (Zha = new Ft().a()); + var g10 = new R6().M("aliases-array", Zha); + $ha || ($ha = new Gt().a()); + var h10 = new R6().M("synthesized-field", $ha); + aia || (aia = new Ht().a()); + var k10 = new R6().M("default-node", aia); + bia || (bia = new It().a()); + var l10 = new R6().M("data-node-properties", bia); + cia || (cia = new Jt().a()); + var m10 = new R6().M("resolved-link", cia); + dia || (dia = new Kt().a()); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, new R6().M("null-security", dia)]; + b10 = new Lt().a(); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Mt(b10, a10[c10]), c10 = 1 + c10 | 0; + this.O_ = b10; + a10 = Nt(Gk()); + b10 = Gk(); + a10 = new R6().M(a10, b10); + b10 = Nt(Af()); + c10 = Af(); + b10 = new R6().M(b10, c10); + c10 = Nt(gl()); + e10 = gl(); + c10 = new R6().M(c10, e10); + e10 = Nt(oc()); + f10 = oc(); + e10 = new R6().M(e10, f10); + f10 = Nt(Ci()); + g10 = Ci(); + f10 = new R6().M(f10, g10); + g10 = Nt(Qi()); + h10 = Qi(); + g10 = new R6().M(g10, h10); + h10 = Nt(Ot()); + k10 = Ot(); + h10 = new R6().M(h10, k10); + k10 = Nt(Sk()); + l10 = Sk(); + k10 = new R6().M(k10, l10); + l10 = Nt(bea()); + m10 = bea(); + l10 = new R6().M(l10, m10); + m10 = Nt(Ok()); + var p10 = Ok(); + m10 = new R6().M(m10, p10); + p10 = Nt(Ud()); + var t10 = Ud(); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, new R6().M(p10, t10)]; + b10 = new Lt().a(); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Mt(b10, a10[c10]), c10 = 1 + c10 | 0; + this.yE = b10; + Ef(); + this.N1 = Jf(new Kf(), new Lf().a()).eb; + return this; + }; + function eia(a10, b10) { + ws(a10.N1, new Ib().ha([b10])); + } + Bt.prototype.KS = function(a10) { + return this.N1.Dc.Dd().ka(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.KS(c10); + }; + }(this, a10)), (Pt(), new Qt().a())).Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.na(); + }; + }(this))).ka(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.c(); + }; + }(this)), (Pt(), new Qt().a())).kc(); + }; + Bt.prototype.NT = function(a10) { + return this.N1.Dc.Dd().ka(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.NT(c10); + }; + }(this, a10)), (Pt(), new Qt().a())).Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.na(); + }; + }(this))).ka(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.c(); + }; + }(this)), (Pt(), new Qt().a())).kc(); + }; + function Nt(a10) { + return ic(a10.Kb().ga()); + } + Bt.prototype.$classData = r8({ yBa: 0 }, false, "amf.core.registries.AMFDomainRegistry$", { yBa: 1, f: 1 }); + var Tha = void 0; + function fs() { + Tha || (Tha = new Bt().a()); + return Tha; + } + function Rt() { + this.k2 = this.OV = this.IT = this.p0 = this.n0 = this.cK = this.m0 = this.EW = this.i3 = null; + } + Rt.prototype = new u7(); + Rt.prototype.constructor = Rt; + Rt.prototype.a = function() { + fia = this; + this.i3 = Rb(Sb(), H10()); + this.EW = Rb(Sb(), H10()); + this.m0 = Rb(Sb(), H10()); + this.cK = Rb(Sb(), H10()); + this.n0 = Rb(Sb(), H10()); + this.p0 = Rb(Sb(), H10()); + this.IT = Rb(Sb(), H10()); + Rb(Sb(), H10()); + this.OV = Rb(Sb(), H10()); + this.k2 = Rb(Sb(), H10()); + return this; + }; + function gia(a10) { + var b10 = Mc(ua(), a10, "/"), c10 = Fd(Gd(), b10); + if (!c10.b() && null !== c10.c() && 0 === c10.c().Oe(2)) { + var e10 = c10.c().lb(0); + c10 = c10.c().lb(1); + if (-1 < (c10.indexOf("+") | 0)) + return a10 = Mc(ua(), c10, "\\+"), e10 + "/" + Oc(new Pc().fd(a10)); + } + b10 = Fd(Gd(), b10); + return !b10.b() && null !== b10.c() && 0 === b10.c().Oe(2) && (e10 = b10.c().lb(0), b10 = b10.c().lb(1), -1 < (b10.indexOf(".") | 0)) ? (a10 = Mc(ua(), b10, "\\."), e10 + "/" + Oc(new Pc().fd(a10))) : a10; + } + function hia(a10, b10) { + b10.wr().U(w6(/* @__PURE__ */ function() { + return function(c10) { + c10 instanceof tq ? xfa(qq(), c10) : c10 instanceof rq ? sq(qq(), c10) : c10 instanceof pq && wfa(qq(), c10); + }; + }(a10))); + } + function wfa(a10, b10) { + var c10 = a10.i3.Ja(b10.gi()); + if (!(c10 instanceof z7)) + if (y7() === c10) + a10.i3.Ue(b10.gi(), b10), b10.gqa().U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = false, k10 = null, l10 = qq().EW.Ja(g10); + if (l10 instanceof z7 && (h10 = true, k10 = l10, k10.i.gi() === f10.gi())) + return; + if (y7() === l10) + return qq().EW.Ue(g10, f10); + if (h10) + throw h10 = k10.i, mb(E6(), new nb().e("Cannot register " + f10.gi() + " for media type " + g10 + ", " + h10.gi() + " already registered")); + throw new x7().d(l10); + }; + }(a10, b10))), hia(a10, b10); + else + throw new x7().d(c10); + } + function xfa(a10, b10) { + var c10 = a10.p0.Ja(b10.gi()); + if (!(c10 instanceof z7)) + if (y7() === c10) + b10.ry().U(w6(/* @__PURE__ */ function() { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + return fs().O_.Ue(f10, e10); + } + throw new x7().d(e10); + }; + }(a10))), a10.p0.Ue(b10.gi(), b10), b10.dy().U(w6(/* @__PURE__ */ function() { + return function(e10) { + return fs().yE.Ue(Nt(e10), e10); + }; + }(a10))), hia(a10, b10); + else + throw new x7().d(c10); + } + function Gfa(a10, b10) { + b10 = a10.n0.Ja(b10); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = J5(K7(), H10()); + } + return b10.ei(w6(/* @__PURE__ */ function() { + return function(c10) { + return c10.Pca(); + }; + }(a10)), St()); + } + function iia(a10, b10) { + a10 = a10.OV.Ja(b10); + if (a10 instanceof z7) + return a10.i; + if (y7() !== a10) + throw new x7().d(a10); + return H10(); + } + function Yfa(a10, b10) { + if (-1 !== (b10.indexOf(";") | 0)) { + var c10 = Mc(ua(), b10, ";"); + c10 = zj(new Pc().fd(c10)); + } else + c10 = b10; + b10 = a10.EW.Ja(b10); + return b10 instanceof z7 ? new z7().d(b10.i) : a10.EW.Ja(gia(c10)); + } + function yfa(a10, b10) { + var c10 = a10.IT.Ja(b10.gi()); + if (!(c10 instanceof z7)) + if (y7() === c10) + a10.IT.Ue(b10.gi(), b10), hia(a10, b10); + else + throw new x7().d(c10); + } + function Nfa() { + var a10 = qq(); + return new wq().Yn(a10.IT).Sb.Ye().Dd(); + } + function sq(a10, b10) { + var c10 = a10.cK.Ja(b10.gi()); + if (!(c10 instanceof z7)) + if (y7() === c10) + a10.cK.Ue(b10.gi(), b10), b10.ry().U(w6(/* @__PURE__ */ function() { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + return fs().O_.Ue(f10, e10); + } + throw new x7().d(e10); + }; + }(a10))), b10.Qz().U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = qq().m0.Ja(g10); + if (h10 instanceof z7) + h10 = h10.i; + else { + if (y7() !== h10) + throw new x7().d(h10); + h10 = J5(K7(), H10()); + } + var k10 = qq().m0, l10 = J5(K7(), new Ib().ha([f10])), m10 = K7(); + return k10.Ue(g10, h10.ia(l10, m10.u)); + }; + }(a10, b10))), b10.pF().U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = qq().n0.Ja(g10); + if (h10 instanceof z7) + h10 = h10.i; + else { + if (y7() !== h10) + throw new x7().d(h10); + h10 = J5(K7(), H10()); + } + var k10 = qq().n0, l10 = J5(K7(), new Ib().ha([f10])), m10 = K7(); + return k10.Ue(g10, h10.ia(l10, m10.u)); + }; + }(a10, b10))), b10.dy().U(w6(/* @__PURE__ */ function() { + return function(e10) { + return fs().yE.Ue(Nt(e10), e10); + }; + }(a10))), c10 = b10.kna(), c10.b() || (c10 = c10.c(), eia(fs(), c10)), hia(a10, b10); + else + throw new x7().d(c10); + } + function Ffa(a10, b10) { + b10 = a10.m0.Ja(b10); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = J5(K7(), H10()); + } + return b10.ei(w6(/* @__PURE__ */ function() { + return function(c10) { + return c10.Pca(); + }; + }(a10)), St()); + } + function zfa(a10, b10) { + var c10 = a10.k2.Ja(b10.gi()); + if (!(c10 instanceof z7)) + if (y7() === c10) + b10.CP.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = false, k10 = qq().OV.Ja(g10); + a: { + if (k10 instanceof z7) { + h10 = true; + var l10 = k10.i; + if (!l10.Ha(f10)) { + h10 = qq().OV; + k10 = K7(); + l10 = l10.yg(f10, k10.u); + h10.Ue(g10, l10); + qq().k2.Ue(f10.gi(), f10); + break a; + } + } + if (y7() === k10) + l10 = qq().OV, h10 = J5(K7(), new Ib().ha([f10])), l10.Ue(g10, h10), qq().k2.Ue(f10.gi(), f10); + else if (!h10) + throw new x7().d(k10); + } + }; + }(a10, b10))); + else + throw new x7().d(c10); + } + Rt.prototype.$classData = r8({ ABa: 0 }, false, "amf.core.registries.AMFPluginsRegistry$", { ABa: 1, f: 1 }); + var fia = void 0; + function qq() { + fia || (fia = new Rt().a()); + return fia; + } + function Tt() { + } + Tt.prototype = new u7(); + Tt.prototype.constructor = Tt; + Tt.prototype.a = function() { + return this; + }; + Tt.prototype.qj = function(a10) { + return -1 !== (a10.indexOf(":") | 0) ? new z7().d(a10) : y7(); + }; + Tt.prototype.$classData = r8({ BBa: 0 }, false, "amf.core.remote.Absolute$", { BBa: 1, f: 1 }); + var jia = void 0; + function $o() { + this.k0 = this.Wg = null; + } + $o.prototype = new u7(); + $o.prototype.constructor = $o; + function Tfa(a10, b10, c10) { + var e10 = a10.k0.Ja(c10); + if (e10 instanceof z7) + e10 = e10.i; + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = J5(Gb().Qg, H10()); + } + a10.k0.jm(c10, e10.Zj(b10)); + } + $o.prototype.a = function() { + this.Wg = Rb(Ut(), H10()); + this.k0 = Rb(Ut(), H10()); + return this; + }; + function Ufa(a10, b10, c10) { + ii(); + for (var e10 = [b10], f10 = -1 + (e10.length | 0) | 0, g10 = H10(); 0 <= f10; ) + g10 = ji(e10[f10], g10), f10 = -1 + f10 | 0; + e10 = g10; + f10 = ii(); + c10 = c10.ia(e10, f10.u); + e10 = Eq(c10); + f10 = qe2(); + f10 = re4(f10); + if (e10 !== qt(c10, f10).jb()) + return new z7().d(c10); + b10 = a10.k0.Ja(b10); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = J5(Gb().Qg, H10()); + } + c10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return Ufa(h10, l10, k10); + }; + }(a10, c10)); + e10 = qe2(); + e10 = re4(e10); + a10 = Jd(b10, c10, e10).Fb(w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.na(); + }; + }(a10))); + return a10.b() ? y7() : a10.c(); + } + function Sfa(a10) { + a: { + var b10 = kia(a10, 2); + for (; ; ) { + if (H10().h(b10)) { + b10 = a10; + break a; + } + if (b10 instanceof Vt) + b10 = b10.Nf, a10 = a10.ta(); + else + throw new x7().d(b10); + } + } + return 2 === Eq(b10) ? Wt(b10) : y7(); + } + $o.prototype.$classData = r8({ EBa: 0 }, false, "amf.core.remote.Cache", { EBa: 1, f: 1 }); + function iu() { + this.kA = this.Uz = this.ea = null; + } + iu.prototype = new u7(); + iu.prototype.constructor = iu; + function iga(a10) { + return a10.Uz.b() ? "" : lia(a10.Uz); + } + function gga(a10, b10) { + Zo(); + var c10 = a10.ea, e10 = a10.Uz; + b10 = mia(a10, b10); + a10 = a10.kA; + var f10 = ii().u, g10 = new iu(); + e10 = ju(e10, b10, f10); + g10.ea = c10; + g10.Uz = e10; + g10.kA = a10; + return g10; + } + function mia(a10, b10) { + try { + var c10 = a10.ea; + jia || (jia = new Tt().a()); + var e10 = jia.qj(b10); + if (e10.b()) { + nia || (nia = new ku().a()); + var f10 = nia.qj(b10); + if (f10.b()) { + var g10 = new z7().d(b10).i; + var h10 = "" + oia(Zo(), iga(a10), a10.ea.Vba()) + g10; + } else { + var k10 = f10.c(); + h10 = "" + oia(Zo(), Jfa(a10), a10.ea.Vba()) + k10; + } + } else + h10 = e10.c(); + var l10 = c10.IP(h10), m10 = a10.kA.mb(); + b: { + for (; m10.Ya(); ) { + var p10 = m10.$a(), t10 = p10.ma(); + if (0 <= (l10.length | 0) && l10.substring(0, t10.length | 0) === t10) { + var v10 = new z7().d(p10); + break b; + } + } + v10 = y7(); + } + if (v10.b()) + var A10 = l10; + else { + var D10 = v10.c(), C10 = D10.ma(), I10 = D10.ya(); + A10 = l10.split(ka(C10)).join(ka(I10)); + } + return A10; + } catch (L10) { + a10 = Ph(E6(), L10); + if (a10 instanceof nb) + throw new Tq().e("url: " + b10 + " - " + a10.xo()); + throw L10; + } + } + function Qfa(a10) { + var b10 = a10.Uz, c10; + for (c10 = 0; !b10.b(); ) { + var e10 = b10.ga(), f10 = iga(a10); + e10 === f10 && (c10 = 1 + c10 | 0); + b10 = b10.ta(); + } + return 2 === c10; + } + function Jfa(a10) { + return a10.Uz.b() ? "" : a10.Uz.ga(); + } + iu.prototype.$classData = r8({ FBa: 0 }, false, "amf.core.remote.Context", { FBa: 1, f: 1 }); + function lu() { + } + lu.prototype = new u7(); + lu.prototype.constructor = lu; + lu.prototype.a = function() { + return this; + }; + function oia(a10, b10, c10) { + a10 = new qg().e(b10); + c10 = mu(a10, gc(92)) ? "win" === c10 : false; + a10 = new qg().e(b10); + a10 = mu(a10, gc(47)); + if (!c10 && !a10) + return ""; + c10 = c10 ? 92 : 47; + a10 = new qg().e(b10); + a10 = pia(a10, c10); + a10 = Oc(new Pc().fd(a10)); + a10 = new qg().e(a10); + return mu(a10, gc(46)) ? (c10 = 1 + qia(ua(), b10, c10) | 0, b10.substring(0, c10)) : Ed(ua(), b10, ba.String.fromCharCode(c10)) ? b10 : "" + b10 + gc(c10); + } + function Kea(a10, b10) { + return hga(Zo(), b10, ""); + } + function hga(a10, b10, c10) { + a10 = nu(); + c10 = Vb().Ia(c10); + if (c10.b()) + var e10 = true; + else + e10 = c10.c(), e10 = new qg().e(e10), e10 = tc(e10); + c10 = e10 ? c10 : y7(); + if (c10.b()) + e10 = y7(); + else { + c10 = c10.c(); + ii(); + c10 = [c10]; + e10 = -1 + (c10.length | 0) | 0; + for (var f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + e10 = new z7().d(f10); + } + c10 = new iu(); + e10 = e10.b() ? H10() : e10.c(); + c10.ea = b10; + c10.Uz = e10; + c10.kA = a10; + return c10; + } + lu.prototype.$classData = r8({ GBa: 0 }, false, "amf.core.remote.Context$", { GBa: 1, f: 1 }); + var ria = void 0; + function Zo() { + ria || (ria = new lu().a()); + return ria; + } + function ou() { + this.$I = null; + } + ou.prototype = new u7(); + ou.prototype.constructor = ou; + ou.prototype.a = function() { + this.$I = "file://"; + return this; + }; + ou.prototype.qj = function(a10) { + var b10 = this.$I; + return 0 <= (a10.length | 0) && a10.substring(0, b10.length | 0) === b10 ? (a10 = new qg().e(a10), a10 = Wp(a10, this.$I), new z7().d(a10)) : y7(); + }; + ou.prototype.$classData = r8({ HBa: 0 }, false, "amf.core.remote.File$", { HBa: 1, f: 1 }); + var sia = void 0; + function Qp() { + sia || (sia = new ou().a()); + return sia; + } + function pu() { + this.Q5 = this.P5 = null; + } + pu.prototype = new u7(); + pu.prototype.constructor = pu; + pu.prototype.a = function() { + this.P5 = "http://"; + this.Q5 = "https://"; + return this; + }; + pu.prototype.qj = function(a10) { + var b10 = this.P5; + 0 <= (a10.length | 0) && a10.substring(0, b10.length | 0) === b10 ? b10 = true : (b10 = this.Q5, b10 = 0 <= (a10.length | 0) && a10.substring(0, b10.length | 0) === b10); + if (b10) { + b10 = 3 + (a10.indexOf("://") | 0) | 0; + b10 = a10.substring(0, b10); + a10 = new qg().e(a10); + a10 = Wp(a10, b10); + if (-1 !== (a10.indexOf("/") | 0)) { + var c10 = a10.indexOf("/") | 0; + c10 = a10.substring(0, c10); + } else + c10 = a10; + a10 = a10.split(c10).join(""); + return new z7().d(new Hd().Dr(b10, c10, a10)); + } + return y7(); + }; + pu.prototype.$classData = r8({ KBa: 0 }, false, "amf.core.remote.HttpParts$", { KBa: 1, f: 1 }); + var tia = void 0; + function Jha() { + tia || (tia = new pu().a()); + return tia; + } + function qu() { + this.Cfa = this.Dfa = this.Efa = this.Ffa = this.Bfa = null; + } + qu.prototype = new u7(); + qu.prototype.constructor = qu; + qu.prototype.a = function() { + this.Bfa = "application/json"; + this.Ffa = "application/yaml"; + this.Efa = "application/raml+yaml"; + this.Dfa = "application/openapi+json"; + this.Cfa = "application/ld+json"; + return this; + }; + qu.prototype.$classData = r8({ NBa: 0 }, false, "amf.core.remote.Mimes$", { NBa: 1, f: 1 }); + var uia = void 0; + function Uaa() { + uia || (uia = new qu().a()); + return uia; + } + function via(a10) { + a10.N8(("OAS " + a10.wM()).trim()); + } + function wia(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.b7); + } + function Ek(a10, b10, c10) { + a10.rQ.Ue(ic(b10.Kb().ga()), c10); + } + function xia(a10, b10) { + if (Rk(b10)) { + var c10 = new ru().Yn(a10.EM).th.Er(); + a: { + for (; c10.Ya(); ) { + var e10 = c10.$a(); + if (e10.P(b10.bc())) { + c10 = new z7().d(e10); + break a; + } + } + c10 = y7(); + } + if (c10 instanceof z7) + return a10.EM.P(c10.i).P(b10); + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find builder for object meta " + b10.bc())); + throw new x7().d(c10); + } + if (vu(b10)) { + c10 = new ru().Yn(a10.EM).th.Er(); + a: { + for (; c10.Ya(); ) + if (e10 = c10.$a(), e10.P(b10.bc())) { + c10 = new z7().d(e10); + break a; + } + c10 = y7(); + } + if (c10 instanceof z7) + return a10.EM.P(c10.i).P(b10); + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find builder for object meta " + b10.bc())); + throw new x7().d(c10); + } + throw mb(E6(), new nb().e("Cannot build object of type " + b10)); + } + function yia(a10) { + a10.Bia(new wu().a()); + a10.Cia(new wu().a()); + a10.Aia(new mq().a()); + a10.zia(new wu().a()); + a10.bda(y7()); + } + function Jo(a10, b10, c10) { + yi(a10.Bf, b10); + yi(a10.Am, c10); + } + function xu(a10, b10) { + if (Rk(b10)) { + var c10 = a10.rQ.Ja(ic(b10.bc().Kb().ga())); + if (c10 instanceof z7) + return c10.i.P(b10); + if (y7() === c10) + return xia(a10, b10); + throw new x7().d(c10); + } + if (vu(b10)) { + c10 = a10.rQ.Ja(ic(b10.bc().Kb().ga())); + if (c10 instanceof z7) + return c10.i.P(b10); + if (y7() === c10) + return xia(a10, b10); + throw new x7().d(c10); + } + return null === b10 ? null : xia(a10, b10); + } + function Vfa(a10, b10, c10) { + c10 = c10.lH.Cb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10.aG(f10); + }; + }(a10, b10))); + return zia(a10, b10, c10); + } + function zia(a10, b10, c10) { + var e10 = false, f10 = null; + c10 = c10.ua(); + if (H10().h(c10)) + throw new yu().e(b10); + if (c10 instanceof Vt) { + e10 = true; + f10 = c10; + var g10 = f10.Wn, h10 = f10.Nf; + if (H10().h(h10)) + return g10.JT(b10); + } + if (e10) + return e10 = f10.Nf, f10.Wn.JT(b10).YV(Aia(a10, b10, e10), ml()); + throw new x7().d(c10); + } + function Bia(a10) { + a10.O8(("RAML " + a10.wM()).trim()); + } + function Cia(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.c7); + } + function ku() { + } + ku.prototype = new u7(); + ku.prototype.constructor = ku; + ku.prototype.a = function() { + return this; + }; + ku.prototype.qj = function(a10) { + return 0 <= (a10.length | 0) && "/" === a10.substring(0, 1) ? new z7().d(a10) : y7(); + }; + ku.prototype.$classData = r8({ ZBa: 0 }, false, "amf.core.remote.RelativeToRoot$", { ZBa: 1, f: 1 }); + var nia = void 0; + function zu() { + this.nX = this.BZ = this.Vp = this.Cp = this.QF = this.ew = this.UF = this.TF = this.ct = null; + } + zu.prototype = new u7(); + zu.prototype.constructor = zu; + zu.prototype.a = function() { + Dia = this; + this.ct = Ob(); + this.TF = Qb(); + this.UF = Pb(); + this.ew = Au(); + this.QF = Bu(); + this.Cp = Cu(); + this.Vp = Du(); + this.BZ = Vf(); + this.nX = Eia(); + return this; + }; + zu.prototype.$classData = r8({ cCa: 0 }, false, "amf.core.remote.Vendor$", { cCa: 1, f: 1 }); + var Dia = void 0; + function Xq() { + Dia || (Dia = new zu().a()); + return Dia; + } + function Eu() { + this.yN = this.jia = this.i8 = null; + } + Eu.prototype = new u7(); + Eu.prototype.constructor = Eu; + Eu.prototype.a = function() { + Fia = this; + this.i8 = "singularize|pluralize|uppercase|lowercase|lowercamelcase|uppercamelcase|lowerunderscorecase|upperunderscorecase|lowerhyphencase|upperhyphencase"; + var a10 = new qg().e(this.i8), b10 = H10(); + this.jia = new rg().vi(a10.ja, b10); + a10 = new qg().e("<<\\s*([^<<>>|\\s]+)((?:\\s*\\|\\s*!(?:" + this.i8 + ")\\s*)*)>>"); + b10 = H10(); + this.yN = new rg().vi(a10.ja, b10); + return this; + }; + function Gia(a10, b10, c10, e10) { + var f10 = a10.yN; + b10 = Hia(b10, f10, f10.nW); + for (b10 = Iia(b10); b10.Ya(); ) { + f10 = b10.FL(); + Fu(); + var g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return new R6().M(k10.$, k10.r); + }; + }(a10)), h10 = qe2(); + h10 = re4(h10); + f10 = Jia(Jd(c10, g10, h10).Ch(Gb().si), true, true, f10, e10); + Kia(b10.Fa.Rw, b10.oW, f10); + } + return Dda(b10); + } + function Lia(a10, b10, c10, e10) { + if ("singularize" === e10) { + a10 = (Gu(), new Hu().e(c10)); + b10 = Gu().R8; + if (Cg(b10, a10.Os)) + a10 = a10.Os; + else { + b: { + for (b10 = Gu().C_.Dc; !b10.b(); ) { + c10 = b10.ga().MH; + e10 = a10.Os; + if (c10.toLowerCase() === (null === e10 ? null : e10.toLowerCase())) { + b10 = new z7().d(b10.ga()); + break b; + } + b10 = b10.ta(); + } + b10 = y7(); + } + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.OH)); + b10 = b10.b() ? Mia(a10, Gu().Q8, a10.Os) : b10; + a10 = b10.b() ? a10.Os : b10.c(); + } + return a10; + } + if ("pluralize" === e10) { + a10 = (Gu(), new Hu().e(c10)); + b10 = Gu().R8; + if (Cg(b10, a10.Os)) + a10 = a10.Os; + else { + b: { + for (b10 = Gu().C_.Dc; !b10.b(); ) { + c10 = b10.ga().OH; + e10 = a10.Os; + if (c10.toLowerCase() === (null === e10 ? null : e10.toLowerCase())) { + b10 = new z7().d(b10.ga()); + break b; + } + b10 = b10.ta(); + } + b10 = y7(); + } + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.MH)); + b10 = b10.b() ? Mia(a10, Gu().P8, a10.Os) : b10; + a10 = b10.b() ? a10.Os : b10.c(); + } + return a10; + } + if ("uppercase" === e10) + return c10.toUpperCase(); + if ("lowercase" === e10) + return c10.toLowerCase(); + if ("lowercamelcase" === e10) { + Gu(); + Gu(); + a10 = Nia(new Hu().e(c10)); + a10 = new Hu().e(a10); + b10 = new qg().e(a10.Os); + if (tc(b10)) { + b10 = Iu(ua(), a10.Os); + a10 = zj(new Ju().BB(b10)); + a10 = null === a10 ? 0 : a10.r; + Ku(); + a10 = 65535 & (ba.String.fromCharCode(a10).toLowerCase().charCodeAt(0) | 0); + a10 = gc(a10); + if (0 === b10.n.length) { + if (0 === b10.n.length) + throw new Lu().e("empty.tail"); + c10 = b10.n.length; + c10 = 0 < c10 ? c10 : 0; + e10 = b10.n.length; + c10 = -1 + (c10 < e10 ? c10 : e10) | 0; + c10 = 0 < c10 ? c10 : 0; + e10 = Mu(Nu(), Ou(la(b10)), c10); + 0 < c10 && Pu(Gd(), b10, 1, e10, 0, c10); + b10 = e10; + } else + c10 = b10.n.length, c10 = 0 < c10 ? c10 : 0, e10 = b10.n.length, c10 = -1 + (c10 < e10 ? c10 : e10) | 0, c10 = 0 < c10 ? c10 : 0, e10 = Mu(Nu(), Ou(la(b10)), c10), 0 < c10 && Pu(Gd(), b10, 1, e10, 0, c10), b10 = e10; + c10 = new Tj().a(); + e10 = true; + Vj(c10, ""); + for (var f10 = 0, g10 = b10.n.length; f10 < g10; ) { + var h10 = gc(b10.n[f10]); + e10 ? (Wj(c10, h10), e10 = false) : (Vj(c10, ""), Wj(c10, h10)); + f10 = 1 + f10 | 0; + } + Vj(c10, ""); + a10 = "" + a10 + c10.Ef.qf; + } else + a10 = a10.Os; + return a10; + } + if ("uppercamelcase" === e10) + return Gu(), a10 = Nia(new Hu().e(c10)), a10 = new qg().e(a10), Oia(a10); + if ("lowerunderscorecase" === e10) + return Gu(), Pia(new Hu().e(c10), "_").toLowerCase(); + if ("upperunderscorecase" === e10) + return Gu(), Pia(new Hu().e(c10), "_").toUpperCase(); + if ("lowerhyphencase" === e10) + return Pia((Gu(), new Hu().e(c10)), "-").toLowerCase(); + if ("upperhyphencase" === e10) + return Pia((Gu(), new Hu().e(c10)), "-").toUpperCase(); + b10.P("Transformation '" + e10 + "' on '" + c10 + "' is not valid."); + return c10; + } + function Jia(a10, b10, c10, e10, f10) { + var g10 = Cda(e10, 0), h10 = Cda(e10, 1); + var k10 = false; + a10 = a10.Ja(h10); + if (a10.b()) + c10 = y7(); + else if (a10 = a10.c(), a10 instanceof Vi) { + var l10 = Ab(a10.Xa, q5(Qu)); + l10.b() ? l10 = y7() : (l10 = l10.c(), l10 = new z7().d(l10.ad)); + l10 = l10.ua(); + var m10 = Jc, p10 = new Qia(); + p10.uma = c10; + p10.eqa = b10; + p10.xka = f10; + p10.nna = h10; + l10 = m10(l10, p10); + if (l10.b()) { + l10 = B6(a10.aa, Wi().vf).A; + if (l10.b()) + l10 = false; + else { + l10 = l10.c(); + if (null === l10) + throw new sf().a(); + l10 = tf(uf(), " *", l10); + } + l10 && c10 && b10 ? (f10.P("Variable '" + h10 + "' cannot have an empty value"), k10 = true, c10 = y7()) : c10 = B6(a10.aa, Wi().vf).A; + } else + c10 = l10; + } else + a10 instanceof Ru ? c10 = B6(a10.Vpa.aa, os().Xp).A : (f10.P("Variable '" + h10 + "' cannot be replaced with type " + Fj(la(a10))), c10 = y7()); + if (c10.b()) + e10 = y7(); + else { + c10 = c10.c(); + e10 = Vb().Ia(Cda(e10, 2)); + if (e10.b()) + e10 = y7(); + else { + e10 = e10.c(); + e10 = ai(Fu().jia, e10); + for (l10 = c10; e10.Ya(); ) + a10 = e10.Tw(), l10 = Lia(Fu(), f10, l10, a10); + e10 = new z7().d(l10); + } + e10 = e10.b() ? new z7().d(c10) : e10; + } + b10 = (e10.b() ? b10 && !k10 ? (f10.P("Cannot find variable '" + h10 + "'."), g10) : g10 : e10.c()).split("$").join("\\$"); + Ria || (Ria = new Su().a()); + h10 = ""; + for (f10 = 0; f10 < (b10.length | 0); ) { + g10 = 65535 & (b10.charCodeAt(f10) | 0); + switch (g10) { + case 92: + case 36: + g10 = "\\" + gc(g10); + break; + default: + g10 = gc(g10); + } + h10 = "" + h10 + g10; + f10 = 1 + f10 | 0; + } + return h10; + } + function Sia(a10, b10, c10, e10) { + var f10 = B6(b10.aa, Wi().vf).A; + f10 = (f10.b() ? null : f10.c()).trim(); + var g10 = yt(a10.yN, f10); + g10.b() ? f10 = false : null !== g10.c() ? (f10 = g10.c(), f10 = 0 === Tu(f10, 2)) : f10 = false; + if (f10) { + f10 = g10.c(); + f10 = Uu(f10, 0); + g10 = g10.c(); + var h10 = Uu(g10, 1), k10 = false, l10 = null; + g10 = c10.Fb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return v10.$ === t10; + }; + }(a10, f10))); + if (g10 instanceof z7) { + k10 = true; + l10 = g10; + var m10 = l10.i; + if (null !== m10 && (m10 = m10.r, m10 instanceof Vi && (B6(m10.aa, Wi().af).A.b() ? m10 = true : (m10 = B6(m10.aa, Wi().af).A, m10 = -1 !== ((m10.b() ? null : m10.c()).indexOf("#string") | 0)), m10))) { + f10 = a10.yN; + g10 = B6(b10.aa, Wi().vf).A; + g10 = g10.b() ? null : g10.c(); + f10 = Hia( + g10, + f10, + f10.nW + ); + for (f10 = Iia(f10); f10.Ya(); ) + g10 = f10.FL(), Fu(), k10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return new R6().M(p10.$, p10.r); + }; + }(a10)), l10 = qe2(), l10 = re4(l10), g10 = Jia(Jd(c10, k10, l10).Ch(Gb().si), false, false, g10, e10), Kia(f10.Fa.Rw, f10.oW, g10); + e10 = Dda(f10); + Tia(b10, e10, (O7(), new P6().a())); + return b10; + } + } + k10 ? (a10 = new qg().e(h10), a10 = tc(a10)) : a10 = false; + if (a10) + return e10.P("Cannot apply transformations '" + h10 + "' to variable '" + f10 + "'."), b10; + if (k10 && (a10 = l10.i, null !== a10 && (a10 = a10.r, a10 instanceof Vi))) + return a10; + if (k10 && (a10 = l10.i, null !== a10)) + return a10.r; + if (y7() === g10) + return Ab(b10.Xa, q5(Uia)).b() && (e10.P("Cannot find variable '" + f10 + "'."), b10.Xa.Lb(new Vu().a())), b10; + throw new x7().d(g10); + } + f10 = B6(b10.aa, Wi().vf).A; + if (!f10.b()) { + f10 = f10.c(); + g10 = Fu().yN; + f10 = Hia(f10, g10, g10.nW); + for (f10 = Iia(f10); f10.Ya(); ) + g10 = f10.FL(), Fu(), k10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return new R6().M(p10.$, p10.r); + }; + }(a10)), l10 = qe2(), l10 = re4(l10), g10 = Jia(Jd(c10, k10, l10).Ch(Gb().si), false, false, g10, e10), Kia(f10.Fa.Rw, f10.oW, g10); + e10 = Dda(f10); + Tia(b10, e10, (O7(), new P6().a())); + } + return b10; + } + Eu.prototype.$classData = r8({ mCa: 0 }, false, "amf.core.resolution.VariableReplacer$", { mCa: 1, f: 1 }); + var Fia = void 0; + function Fu() { + Fia || (Fia = new Eu().a()); + return Fia; + } + function Wu() { + this.ob = this.Bc = null; + } + Wu.prototype = new u7(); + Wu.prototype.constructor = Wu; + function Xu() { + } + Xu.prototype = Wu.prototype; + Wu.prototype.Hb = function(a10) { + this.ob = this.Bc = a10; + return this; + }; + Wu.prototype.ye = function(a10) { + var b10 = zq(), c10 = Fj(la(this)), e10 = Lc(a10); + yq(b10, c10 + "#resolve: resolving " + (e10.b() ? "" : e10.c())); + a10 = new qd().d(a10); + this.kC().U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = g10.oa; + yq(zq(), "ResolutionPipeline#step: applying resolution stage " + Fj(la(h10))); + k10 = h10.ye(k10); + yq(zq(), "ResolutionPipeline#step: finished applying stage " + Fj(la(h10))); + g10.oa = k10; + }; + }(this, a10))); + b10 = zq(); + c10 = Fj(la(this)); + e10 = Lc(a10.oa); + yq(b10, c10 + "#resolve: resolved model " + (e10.b() ? "" : e10.c())); + return a10.oa; + }; + function Yu() { + this.uR = this.xX = this.VI = this.ux = null; + } + Yu.prototype = new u7(); + Yu.prototype.constructor = Yu; + Yu.prototype.a = function() { + this.ux = "default"; + this.VI = "editing"; + this.xX = "compatibility"; + this.uR = "cache"; + return this; + }; + Object.defineProperty(Yu.prototype, "CACHE_PIPELINE", { get: function() { + return this.uR; + }, configurable: true }); + Object.defineProperty(Yu.prototype, "COMPATIBILITY_PIPELINE", { get: function() { + return this.xX; + }, configurable: true }); + Object.defineProperty(Yu.prototype, "EDITING_PIPELINE", { get: function() { + return this.VI; + }, configurable: true }); + Object.defineProperty(Yu.prototype, "DEFAULT_PIPELINE", { get: function() { + return this.ux; + }, configurable: true }); + Yu.prototype.$classData = r8({ pCa: 0 }, false, "amf.core.resolution.pipelines.ResolutionPipeline$", { pCa: 1, f: 1 }); + var Via = void 0; + function Pp() { + Via || (Via = new Yu().a()); + return Via; + } + function Zu() { + } + Zu.prototype = new u7(); + Zu.prototype.constructor = Zu; + Zu.prototype.a = function() { + return this; + }; + function Wia(a10, b10, c10, e10) { + if (b10 instanceof Ru) + return new z7().d(b10); + a10 = B6(b10.aa, os().vf).A; + a10.b() ? c10 = y7() : (a10 = a10.c(), c10 = c10.b() ? y7() : Xia(c10.c(), a10)); + return c10 instanceof z7 ? (c10 = c10.i, a10 = Yia(b10, c10), a10 = Rd(a10, b10.j), e10 && (a10.Xa.Lb(new $u().e(b10.j)), b10 = b10.MB, b10.b() || (b10 = b10.c(), new z7().d(a10.Xa.Lb(new av().e(b10.j))))), a10.Xa.Lb(new bv().a()), wh(c10.fa(), q5(cv)) && a10.Xa.Lb(new Zh().a()), new z7().d(a10)) : y7() === c10 && b10.MB.na() ? (c10 = Yia(b10, b10.MB.c()), c10 = Rd(c10, b10.j), e10 && (c10.Xa.Lb(new $u().e(b10.j)), e10 = b10.MB, e10.b() || (e10 = e10.c(), new z7().d(c10.Xa.Lb(new av().e(e10.j))))), wh(b10.Xa, q5(cv)) && c10.Xa.Lb(new Zh().a()), c10.Xa.Lb(new bv().a()), new z7().d(c10)) : new z7().d(b10); + } + Zu.prototype.$classData = r8({ uCa: 0 }, false, "amf.core.resolution.stages.LinkNodeResolver$", { uCa: 1, f: 1 }); + var Zia = void 0; + function $ia() { + Zia || (Zia = new Zu().a()); + return Zia; + } + function dv() { + this.oi = null; + } + dv.prototype = new u7(); + dv.prototype.constructor = dv; + dv.prototype.EK = function(a10) { + this.oi = a10; + return this; + }; + function Xia(a10, b10) { + var c10 = a10.oi; + if (ev(c10)) { + var e10 = Lc(a10.oi); + if (e10.b() ? 0 : e10.c() === b10) + return new z7().d(c10.qe()); + } + c10 = Lc(a10.oi); + if (c10.b() ? 0 : c10.c() === b10) + return y7(); + c10 = a10.oi.Ve(); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return new dv().EK(f10); + }; + }(a10)); + e10 = K7(); + a10 = c10.ka(a10, e10.u); + for (c10 = y7(); a10.Da(); ) + e10 = Xia(a10.ga(), b10), e10 instanceof z7 ? (c10 = e10, a10 = H10()) : a10 = a10.ta(); + return c10; + } + dv.prototype.$classData = r8({ vCa: 0 }, false, "amf.core.resolution.stages.ModelReferenceResolver", { vCa: 1, f: 1 }); + function fv() { + this.ob = null; + } + fv.prototype = new u7(); + fv.prototype.constructor = fv; + function gv() { + } + gv.prototype = fv.prototype; + fv.prototype.Hb = function(a10) { + this.ob = a10; + return this; + }; + function aja() { + } + aja.prototype = new u7(); + aja.prototype.constructor = aja; + function bja() { + } + bja.prototype = aja.prototype; + function hv() { + this.Z_ = null; + } + hv.prototype = new u7(); + hv.prototype.constructor = hv; + hv.prototype.a = function() { + cja = this; + this.Z_ = y7(); + return this; + }; + function Mea(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10) { + var p10 = a10.Z_; + if (p10 instanceof z7) + return p10 = p10.i, Nfa().U(w6(/* @__PURE__ */ function() { + return function() { + }; + }(a10, b10, c10))), dja(p10, b10, f10, c10, e10, g10, h10, k10, l10, m10).Yg(w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return Nfa().ne(A10, Uc(/* @__PURE__ */ function() { + return function(D10) { + return D10; + }; + }(t10, v10))); + }; + }(a10, b10)), ml()); + throw mb(E6(), new nb().e("No registered runtime compiler")); + } + function fga(a10, b10) { + a10.Z_ = new z7().d(b10); + } + hv.prototype.$classData = r8({ LCa: 0 }, false, "amf.core.services.RuntimeCompiler$", { LCa: 1, f: 1 }); + var cja = void 0; + function ap() { + cja || (cja = new hv().a()); + return cja; + } + function iv() { + } + iv.prototype = new u7(); + iv.prototype.constructor = iv; + iv.prototype.a = function() { + return this; + }; + function efa(a10, b10, c10, e10, f10) { + a10 = qq().cK.Ja(b10); + if (a10 instanceof z7) + a10 = new z7().d(a10.i); + else { + if (y7() !== a10) + throw new x7().d(a10); + a10 = Gfa(qq(), b10).kc(); + } + if (a10 instanceof z7) { + var g10 = a10.i; + if (null !== g10) + return g10.PE(c10, f10, e10); + } + if (y7() === a10) { + e10 = dc().Fh; + a10 = c10.j; + g10 = y7(); + b10 = "Cannot find domain plugin for vendor " + b10 + " to resolve unit " + Lc(c10); + var h10 = Ab(c10.fa(), q5(jd)), k10 = Lc(c10); + f10.Gc(e10.j, a10, g10, b10, h10, Yb().qb, k10); + return c10; + } + throw new x7().d(a10); + } + iv.prototype.$classData = r8({ MCa: 0 }, false, "amf.core.services.RuntimeResolver$", { MCa: 1, f: 1 }); + var eja = void 0; + function ffa() { + eja || (eja = new iv().a()); + return eja; + } + function jv() { + this.X2 = null; + } + jv.prototype = new u7(); + jv.prototype.constructor = jv; + jv.prototype.a = function() { + fja = this; + this.X2 = y7(); + return this; + }; + function Xba(a10, b10, c10, e10, f10, g10) { + a10 = a10.X2; + if (a10 instanceof z7) + return lga($ea(new Ep(), b10, c10, e10, f10, g10)); + if (y7() === a10) + throw mb(E6(), new nb().e("No registered runtime serializer")); + throw new x7().d(a10); + } + jv.prototype.$classData = r8({ NCa: 0 }, false, "amf.core.services.RuntimeSerializer$", { NCa: 1, f: 1 }); + var fja = void 0; + function Cf() { + fja || (fja = new jv().a()); + return fja; + } + function kv() { + this.E3 = null; + } + kv.prototype = new u7(); + kv.prototype.constructor = kv; + kv.prototype.a = function() { + gja = this; + this.E3 = y7(); + return this; + }; + function hja(a10, b10) { + a10.E3 = new z7().d(b10); + } + function gp(a10) { + a10 = a10.E3; + if (a10 instanceof z7) + return a10.i; + if (y7() === a10) + throw mb(E6(), new nb().e("No registered runtime validator")); + throw new x7().d(a10); + } + kv.prototype.$classData = r8({ PCa: 0 }, false, "amf.core.services.RuntimeValidator$", { PCa: 1, f: 1 }); + var gja = void 0; + function bp() { + gja || (gja = new kv().a()); + return gja; + } + function lv() { + this.zm = this.sv = this.L0 = null; + } + lv.prototype = new u7(); + lv.prototype.constructor = lv; + function ija() { + } + ija.prototype = lv.prototype; + lv.prototype.a = function() { + this.L0 = w6(/* @__PURE__ */ function() { + return function() { + return false; + }; + }(this)); + this.sv = hk(); + this.zm = "partial"; + return this; + }; + function jja(a10) { + a10.zm = "full"; + return a10; + } + function kja(a10) { + a10.zm = "partial"; + return a10; + } + function lja(a10, b10) { + a10.sv = b10; + return a10; + } + lv.prototype.$classData = r8({ Rga: 0 }, false, "amf.core.services.ValidationOptions", { Rga: 1, f: 1 }); + function mv() { + this.ea = null; + } + mv.prototype = new u7(); + mv.prototype.constructor = mv; + mv.prototype.a = function() { + mja = this; + this.ea = void 0 !== ba.document ? new nja().a() : new oja().a(); + return this; + }; + mv.prototype.$classData = r8({ YCa: 0 }, false, "amf.core.unsafe.PlatformBuilder$", { YCa: 1, f: 1 }); + var mja = void 0; + function nv() { + mja || (mja = new mv().a()); + return mja; + } + function Cv() { + this.R8 = this.C_ = this.P8 = this.Q8 = null; + } + Cv.prototype = new u7(); + Cv.prototype.constructor = Cv; + Cv.prototype.a = function() { + pja = this; + this.Q8 = J5(Ef(), H10()); + this.P8 = J5(Ef(), H10()); + this.C_ = J5(Ef(), H10()); + Dv(this, "(ax|test)is$", "$1es"); + Dv(this, "(octop|vir)us$", "$1i"); + Dv(this, "(alias|status)$", "$1es"); + Dv(this, "(bu)s$", "$1ses"); + Dv(this, "(buffal|tomat)o$", "$1oes"); + Dv(this, "([ti])um$", "$1a"); + Dv(this, "sis$", "ses"); + Dv(this, "(?:([^f])fe|([lr])f)$", "$1$2ves"); + Dv(this, "(hive)$", "$1s"); + Dv(this, "([^aeiouy]|qu)y$", "$1ies"); + Dv(this, "(x|ch|ss|sh)$", "$1es"); + Dv(this, "(matr|vert|ind)(?:ix|ex)$", "$1ices"); + Dv( + this, + "([m|l])ouse$", + "$1ice" + ); + Dv(this, "^(ox)$", "$1en"); + Dv(this, "(quiz)$", "$1zes"); + Dv(this, "s$", "s"); + Dv(this, "$", "s"); + Ev(this, "(n)ews$", "$1ews"); + Ev(this, "([ti])a$", "$1um"); + Ev(this, "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", "$1sis"); + Ev(this, "((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)sis$", "$1sis"); + Ev(this, "(^analy)ses$", "$1sis"); + Ev(this, "([^f])ves$", "$1fe"); + Ev(this, "(hive)s$", "$1"); + Ev(this, "(tive)s$", "$1"); + Ev(this, "([lr])ves$", "$1f"); + Ev(this, "([^aeiouy]|qu)ies$", "$1y"); + Ev( + this, + "(s)eries$", + "$1eries" + ); + Ev(this, "(m)ovies$", "$1ovie"); + Ev(this, "(x|ch|ss|sh)es$", "$1"); + Ev(this, "([m|l])ice$", "$1ouse"); + Ev(this, "(bus)es$", "$1"); + Ev(this, "(bus)$", "$1"); + Ev(this, "(o)es$", "$1"); + Ev(this, "(shoe)s$", "$1"); + Ev(this, "(cris|ax|test)es$", "$1is"); + Ev(this, "(cris|ax|test)is$", "$1is"); + Ev(this, "(octop|vir)i$", "$1us"); + Ev(this, "(alias|status)es$", "$1"); + Ev(this, "(alias|status)$", "$1"); + Ev(this, "^(ox)en", "$1"); + Ev(this, "(vert|ind)ices$", "$1ex"); + Ev(this, "(matr)ices$", "$1ix"); + Ev(this, "(quiz)zes$", "$1"); + Ev( + this, + "(database)s$", + "$1" + ); + Ev(this, "s$", ""); + Fv(this, "person", "people"); + Fv(this, "man", "men"); + Fv(this, "child", "children"); + Fv(this, "sex", "sexes"); + Fv(this, "move", "moves"); + Fv(this, "foot", "feet"); + Fv(this, "tooth", "teeth"); + ii(); + for (var a10 = "equipment information rice money species series fish sheep".split(" "), b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.R8 = c10; + return this; + }; + function Dv(a10, b10, c10) { + Dg(a10.P8, new Gv().Hc(b10, c10)); + } + function Ev(a10, b10, c10) { + Dg(a10.Q8, new Gv().Hc(b10, c10)); + } + function Fv(a10, b10, c10) { + Dg(a10.C_, new Gv().Hc(b10, c10)); + } + Cv.prototype.$classData = r8({ ZCa: 0 }, false, "amf.core.utils.InflectorBase$", { ZCa: 1, f: 1 }); + var pja = void 0; + function Gu() { + pja || (pja = new Cv().a()); + return pja; + } + function Hu() { + this.Os = null; + } + Hu.prototype = new u7(); + Hu.prototype.constructor = Hu; + function qja(a10, b10, c10) { + b10 = Hv(uf(), b10, 2); + a10 = Iv(b10, a10, a10.length | 0); + return Jv(a10) ? new z7().d(rja(a10, c10)) : y7(); + } + function Nia(a10) { + a10 = a10.Os; + a10 = Mc(ua(), a10, "(_|-|\\s)+"); + if (0 === a10.n.length) { + if (0 === a10.n.length) + throw new Lu().e("empty.tail"); + var b10 = a10.n.length; + b10 = 0 < b10 ? b10 : 0; + var c10 = a10.n.length; + b10 = -1 + (b10 < c10 ? b10 : c10) | 0; + b10 = 0 < b10 ? b10 : 0; + c10 = Mu(Nu(), Ou(la(a10)), b10); + 0 < b10 && Pu(Gd(), a10, 1, c10, 0, b10); + b10 = c10; + } else + b10 = a10.n.length, b10 = 0 < b10 ? b10 : 0, c10 = a10.n.length, b10 = -1 + (b10 < c10 ? b10 : c10) | 0, b10 = 0 < b10 ? b10 : 0, c10 = Mu(Nu(), Ou(la(a10)), b10), 0 < b10 && Pu(Gd(), a10, 1, c10, 0, b10), b10 = c10; + c10 = []; + for (var e10 = 0, f10 = b10.n.length; e10 < f10; ) { + var g10 = b10.n[e10], h10 = new qg().e(g10); + h10 = zj(h10); + h10 = null === h10 ? 0 : h10.r; + h10 = sja(Ku(), h10); + h10 = gc(h10); + g10 = new qg().e(g10); + g10 = "" + h10 + bi(g10); + c10.push(g10); + e10 = 1 + e10 | 0; + } + b10 = ha(Ja(ma), c10); + a10 = zj(new Pc().fd(a10)); + c10 = new Tj().a(); + e10 = true; + Vj(c10, ""); + f10 = 0; + for (g10 = b10.n.length; f10 < g10; ) + h10 = b10.n[f10], e10 ? (Wj(c10, h10), e10 = false) : (Vj(c10, ""), Wj(c10, h10)), f10 = 1 + f10 | 0; + Vj(c10, ""); + return "" + a10 + c10.Ef.qf; + } + function Pia(a10, b10) { + var c10 = J5(Ef(), H10()), e10 = a10.Os; + ua(); + var f10 = Kv(); + f10 = tja(f10, e10); + e10 = ja(Ja(Oa), [f10.Ze - f10.ud | 0]); + var g10 = e10.n.length; + if (0 > g10 || 0 > (e10.n.length - g10 | 0)) + throw new U6().a(); + var h10 = f10.ud, k10 = h10 + g10 | 0; + if (k10 > f10.Ze) + throw new Lv().a(); + f10.ud = k10; + Ba(f10.bj, f10.Mk + h10 | 0, e10, 0, g10); + f10 = 0; + for (g10 = e10.n.length; f10 < g10; ) { + h10 = e10.n[f10] | 0; + if (97 > h10 || 122 < h10) { + k10 = e10.n.length; + for (var l10 = 0; ; ) { + if (l10 < k10) { + var m10 = e10.n[l10]; + m10 = !Va(Wa(), h10, m10); + } else + m10 = false; + if (m10) + l10 = 1 + l10 | 0; + else + break; + } + h10 = l10; + Dg(c10, h10 >= e10.n.length ? -1 : h10); + } + f10 = 1 + f10 | 0; + } + a10 = new Pj().e(a10.Os); + for (c10 = c10.Dc; !c10.b(); ) { + f10 = c10.ga(); + e10 = a10.s; + f10 |= 0; + g10 = b10; + h10 = e10.qf; + if (0 > f10 || f10 > (h10.length | 0)) + throw new Mv().ue(f10); + e10.qf = "" + h10.substring(0, f10) + g10 + h10.substring(f10); + c10 = c10.ta(); + } + return a10.t().toLowerCase(); + } + function Mia(a10, b10, c10) { + a10 = b10.Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return qja(f10, g10.OH, g10.MH).na(); + }; + }(a10, c10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return qja(c10, a10.OH, a10.MH); + } + Hu.prototype.e = function(a10) { + this.Os = a10; + return this; + }; + Hu.prototype.$classData = r8({ aDa: 0 }, false, "amf.core.utils.InflectorBase$Inflector", { aDa: 1, f: 1 }); + function Nv() { + this.r = this.xb = null; + } + Nv.prototype = new u7(); + Nv.prototype.constructor = Nv; + Nv.prototype.PG = function(a10) { + this.xb = a10; + this.r = y7(); + return this; + }; + function Ov(a10) { + var b10 = a10.r, c10 = a10.xb; + b10 = b10.b() ? Hb(c10) : b10.c(); + a10.r = new z7().d(b10); + return a10.r.c(); + } + Nv.prototype.$classData = r8({ bDa: 0 }, false, "amf.core.utils.Lazy", { bDa: 1, f: 1 }); + function Qv() { + } + Qv.prototype = new u7(); + Qv.prototype.constructor = Qv; + Qv.prototype.a = function() { + return this; + }; + function uja(a10) { + var b10 = vja, c10 = J5(K7(), H10()); + for (; ; ) { + var e10 = wja(a10, w6(/* @__PURE__ */ function() { + return function(g10) { + if (null !== g10) + return g10.ya().b(); + throw new x7().d(g10); + }; + }(b10))); + if (null === e10) + throw new x7().d(e10); + a10 = e10.ma(); + e10 = e10.ya(); + if (a10.b()) { + if (e10.b()) + return ue4(), new ye4().d(c10); + ue4(); + b10 = c10; + c10 = pd(e10); + a10 = Xd(); + b10 = b10.ia(c10, a10.u); + return new ve4().d(b10); + } + a10 = pd(a10); + e10 = new Rv().dH(e10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Ida(k10, h10); + }; + }(b10, a10))); + var f10 = Xd(); + c10 = c10.ia(a10, f10.u); + a10 = e10; + } + } + Qv.prototype.$classData = r8({ cDa: 0 }, false, "amf.core.utils.TSort$", { cDa: 1, f: 1 }); + var vja = void 0; + function Nd() { + this.tm = 0; + } + Nd.prototype = new u7(); + Nd.prototype.constructor = Nd; + Nd.prototype.a = function() { + this.tm = 0; + return this; + }; + Nd.prototype.jt = function(a10) { + this.tm = 1 + this.tm | 0; + return a10 + "_" + this.tm; + }; + Nd.prototype.$classData = r8({ eDa: 0 }, false, "amf.core.utils.package$IdCounter", { eDa: 1, f: 1 }); + function Sv() { + } + Sv.prototype = new u7(); + Sv.prototype.constructor = Sv; + Sv.prototype.a = function() { + return this; + }; + function xja(a10, b10) { + a10 = b10.trim(); + return 0 <= (a10.length | 0) && "<" === a10.substring(0, 1); + } + function $ba(a10, b10, c10) { + return xja($f(), b10) && !c10 ? "application/xml" : yja($f(), b10) && !c10 ? "application/json" : "text/vnd.yaml"; + } + function yja(a10, b10) { + a10 = b10.trim(); + return 0 <= (a10.length | 0) && "{" === a10.substring(0, 1) ? true : 0 <= (b10.length | 0) && "[" === b10.substring(0, 1); + } + Sv.prototype.$classData = r8({ fDa: 0 }, false, "amf.core.utils.package$MediaTypeMatcher$", { fDa: 1, f: 1 }); + var zja = void 0; + function $f() { + zja || (zja = new Sv().a()); + return zja; + } + function Tv() { + this.td = null; + } + Tv.prototype = new u7(); + Tv.prototype.constructor = Tv; + Tv.prototype.e = function(a10) { + this.td = a10; + return this; + }; + Tv.prototype.$classData = r8({ iDa: 0 }, false, "amf.core.utils.package$RegexConverter", { iDa: 1, f: 1 }); + function Uv() { + this.fc = 0; + } + Uv.prototype = new u7(); + Uv.prototype.constructor = Uv; + Uv.prototype.a = function() { + this.fc = -1; + return this; + }; + Uv.prototype.$classData = r8({ jDa: 0 }, false, "amf.core.utils.package$SimpleCounter", { jDa: 1, f: 1 }); + function Vv() { + this.Sqa = null; + } + Vv.prototype = new u7(); + Vv.prototype.constructor = Vv; + Vv.prototype.a = function() { + Aja = this; + var a10 = new qg().e("\\{(.[^{]*)\\}"), b10 = H10(); + this.Sqa = new rg().vi(a10.ja, b10); + return this; + }; + function Bja(a10, b10) { + return "'" + b10 + "' is not a valid template uri."; + } + function Cja(a10, b10) { + a10 = new qg().e(b10); + a: { + var c10 = Wv(a10); + a10 = 0; + b: + for (; ; ) { + b10 = false; + var e10 = null; + if (H10().h(c10)) { + a10 = 0 === a10; + break a; + } + if (c10 instanceof Vt) { + b10 = true; + e10 = c10; + var f10 = e10.Wn; + if (125 === (null === f10 ? 0 : f10.r) && 1 > a10) { + a10 = false; + break a; + } + } + if (b10) { + var g10 = e10.Wn; + f10 = e10.Nf; + if (125 === (null === g10 ? 0 : g10.r)) { + a10 = -1 + a10 | 0; + c10 = f10; + continue b; + } + } + if (b10 && (g10 = e10.Wn, f10 = e10.Nf, 123 === (null === g10 ? 0 : g10.r))) { + a10 = 1 + a10 | 0; + c10 = f10; + continue b; + } + if (b10) { + c10 = e10.Nf; + continue b; + } + throw new x7().d(c10); + } + } + return a10; + } + function Dja(a10, b10) { + b10 = ai(a10.Sqa, b10); + b10 = Xv(b10); + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.split("{").join("").split("}").join(""); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + Vv.prototype.$classData = r8({ kDa: 0 }, false, "amf.core.utils.package$TemplateUri$", { kDa: 1, f: 1 }); + var Aja = void 0; + function Yv() { + Aja || (Aja = new Vv().a()); + return Aja; + } + function Eja() { + this.ev = this.G3 = this.H3 = this.c1 = this.eK = null; + } + Eja.prototype = new u7(); + Eja.prototype.constructor = Eja; + function Fja() { + var a10 = new Eja(), b10 = Rb(Sb(), H10()), c10 = Rb(Sb(), H10()), e10 = Rb(Sb(), H10()), f10 = Rb(Sb(), H10()), g10 = Rb(Sb(), H10()); + a10.eK = b10; + a10.c1 = c10; + a10.H3 = e10; + a10.G3 = f10; + a10.ev = g10; + return a10; + } + function Gja(a10, b10) { + b10.Bf.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + a: { + var f10 = c10.ev.Ja(e10.$); + if (f10 instanceof z7) { + var g10 = c10.ev, h10 = e10.$; + f10 = f10.i; + var k10 = e10.At, l10 = f10.At, m10 = K7(); + k10 = k10.ia(l10, m10.u).fj(); + l10 = e10.Hv; + m10 = f10.Hv; + var p10 = K7(); + l10 = l10.ia(m10, p10.u).fj(); + m10 = e10.Jv; + f10 = f10.Jv; + p10 = K7(); + f10 = m10.ia(f10, p10.u).fj(); + e10 = qj(new rj(), e10.$, e10.Ld, e10.yv, e10.vv, k10, l10, f10, e10.vy, e10.Lx, e10.xy, e10.jy, e10.my, e10.QB, e10.Iz, e10.Bw, e10.Cj); + g10.Ue(h10, e10); + } else { + if (y7() === f10) { + g10 = c10.ev; + h10 = Zv(g10, e10.$, e10); + null !== h10 && (h10.r = e10); + e10 = g10; + break a; + } + throw new x7().d(f10); + } + e10 = void 0; + } + return e10; + }; + }(a10))); + b10.WT.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return Hja( + c10, + e10, + Yb().zx + ); + }; + }(a10))); + b10.ZW.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return Hja(c10, e10, Yb().dh); + }; + }(a10))); + b10.YW.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return Hja(c10, e10, Yb().qb); + }; + }(a10))); + b10.kT.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10 = 0 <= (e10.length | 0) && "http://" === e10.substring(0, 7) || 0 <= (e10.length | 0) && "https://" === e10.substring(0, 8) || 0 <= (e10.length | 0) && "file:/" === e10.substring(0, 6) ? e10 : ic($v(F6(), e10.split(".").join(":"))); + return c10.eK.rt(e10); + }; + }(a10))); + return a10; + } + function Hja(a10, b10, c10) { + b10 = 0 <= (b10.length | 0) && "http://" === b10.substring(0, 7) || 0 <= (b10.length | 0) && "https://" === b10.substring(0, 8) || 0 <= (b10.length | 0) && "file:/" === b10.substring(0, 6) ? b10 : ic($v(F6(), b10.split(".").join(":"))); + var e10 = a10.ev.Ja(b10); + if (y7() === e10) + throw mb(E6(), new nb().e("Cannot enable with " + c10 + " level unknown validation " + b10)); + if (e10 instanceof z7) { + e10 = e10.i; + a10.c1.rt(b10); + a10.H3.rt(b10); + a10.G3.rt(b10); + if (Yb().zx === c10) + c10 = Zv(a10.c1, b10, e10), null !== c10 && (c10.r = e10); + else if (Yb().dh === c10) + c10 = Zv(a10.H3, b10, e10), null !== c10 && (c10.r = e10); + else if (Yb().qb === c10) + c10 = Zv(a10.G3, b10, e10), null !== c10 && (c10.r = e10); + else + throw new x7().d(c10); + a10 = a10.eK; + b10 = Zv(a10, b10, e10); + null !== b10 && (b10.r = e10); + return a10; + } + throw new x7().d(e10); + } + Eja.prototype.$classData = r8({ pDa: 0 }, false, "amf.core.validation.EffectiveValidations", { pDa: 1, f: 1 }); + function aw() { + this.qb = this.zx = this.dh = null; + } + aw.prototype = new u7(); + aw.prototype.constructor = aw; + aw.prototype.a = function() { + this.dh = "Warning"; + this.zx = "Info"; + this.qb = "Violation"; + return this; + }; + function bba(a10, b10) { + return a10.dh === b10 ? a10.dh : a10.zx === b10 ? a10.zx : a10.qb; + } + aw.prototype.unapply = function(a10) { + return bba(this, a10); + }; + Object.defineProperty(aw.prototype, "VIOLATION", { get: function() { + return this.qb; + }, configurable: true }); + Object.defineProperty(aw.prototype, "INFO", { get: function() { + return this.zx; + }, configurable: true }); + Object.defineProperty(aw.prototype, "WARNING", { get: function() { + return this.dh; + }, configurable: true }); + aw.prototype.$classData = r8({ sDa: 0 }, false, "amf.core.validation.SeverityLevels$", { sDa: 1, f: 1 }); + var Ija = void 0; + function Yb() { + Ija || (Ija = new aw().a()); + return Ija; + } + function bw() { + } + bw.prototype = new u7(); + bw.prototype.constructor = bw; + bw.prototype.a = function() { + return this; + }; + function Jja(a10) { + Kja || (Kja = new bw().a()); + var b10 = "Conforms? " + a10.$_() + "\n"; + var c10 = a10.aM(); + b10 = b10 + ("Number of results: " + Eq(c10)) + "\n"; + for (a10 = a10.aM(); !a10.b(); ) + c10 = a10.ga(), b10 = b10 + ("\n- Source: " + c10.Ev()) + "\n", b10 = b10 + (" Path: " + c10.TB()) + "\n", b10 = b10 + (" Focus node: " + c10.rO()) + "\n", b10 = b10 + (" Constraint: " + c10.d3()) + "\n", b10 = b10 + (" Message: " + c10.xL()) + "\n", b10 = b10 + (" Severity: " + c10.Y2()) + "\n", a10 = a10.ta(); + return b10; + } + bw.prototype.$classData = r8({ zDa: 0 }, false, "amf.core.validation.core.ValidationReport$", { zDa: 1, f: 1 }); + var Kja = void 0; + function cw() { + this.fX = this.Mv = this.Nv = this.Dz = this.px = this.Ov = this.IA = null; + } + cw.prototype = new u7(); + cw.prototype.constructor = cw; + cw.prototype.a = function() { + Lja = this; + var a10 = F6().Bj; + this.IA = G5(a10, "string"); + a10 = F6().Bj; + this.Ov = G5(a10, "integer"); + a10 = F6().Bj; + this.px = G5(a10, "float"); + a10 = F6().Eb; + this.Dz = G5(a10, "number"); + F6(); + a10 = F6().Bj; + this.Nv = G5(a10, "double"); + a10 = F6().Bj; + this.Mv = G5(a10, "boolean"); + a10 = F6().Bj; + this.fX = G5(a10, "nil"); + F6(); + F6(); + F6(); + return this; + }; + cw.prototype.$classData = r8({ FDa: 0 }, false, "amf.core.vocabulary.Namespace$XsdTypes$", { FDa: 1, f: 1 }); + var Lja = void 0; + function dw() { + Lja || (Lja = new cw().a()); + return Lja; + } + function ew() { + this.wc = this.he = this.KE = null; + this.uw = this.zr = false; + this.WJ = 0; + this.Q = this.Ph = null; + } + ew.prototype = new u7(); + ew.prototype.constructor = ew; + function Mja() { + } + Mja.prototype = ew.prototype; + ew.prototype.ima = function(a10, b10, c10) { + this.KE = a10; + this.he = b10; + this.wc = c10; + this.uw = this.zr = false; + this.WJ = 1; + this.Ph = new fw().a(); + this.Q = new fw().a(); + new Nd().a(); + return this; + }; + function Nja(a10, b10) { + a10 = a10.Ph; + var c10 = new Oja(); + c10.AK = b10; + b10 = Pja(); + b10 = re4(b10); + return xs(a10, c10, b10).Da(); + } + function Qja(a10, b10) { + a10.wc.GN && b10.kg("@context", w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10.Gi(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + Rja(g10, "@base", f10.he); + f10.KE.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.ya(); + Rja(k10, m10, l10); + } else + throw new x7().d(l10); + }; + }(f10, g10))); + }; + }(c10))); + }; + }(a10))); + } + function gw(a10, b10) { + if (a10.wc.GN) + a: { + var c10 = F6(); + a10 = a10.KE; + c10 = c10.yu.mb(); + b: { + for (; c10.Ya(); ) { + var e10 = c10.$a(), f10 = e10; + if (null === f10) + throw new x7().d(f10); + f10 = f10.ya().he; + if (0 === (b10.indexOf(f10) | 0)) { + e10 = new z7().d(e10); + break b; + } + } + e10 = y7(); + } + if (e10 instanceof z7 && (c10 = e10.i, null !== c10)) { + e10 = c10.ma(); + c10 = c10.ya(); + a10.Ue(e10, c10.he); + a10 = new qg().e(e10); + b10 = b10.split(c10.he).join(":"); + b10 = new qg().e(b10); + c10 = Gb().uN; + b10 = xq(a10, b10, c10); + break a; + } + if (y7() !== e10) + throw new x7().d(e10); + } + return b10; + } + ew.prototype.PD = function(a10) { + return this.wc.GN && -1 !== (a10.indexOf(this.he) | 0) ? a10.split(this.he).join("") : a10; + }; + ew.prototype.$classData = r8({ Uga: 0 }, false, "amf.plugins.document.graph.emitter.EmissionContext", { Uga: 1, f: 1 }); + function hw() { + } + hw.prototype = new u7(); + hw.prototype.constructor = hw; + hw.prototype.a = function() { + return this; + }; + hw.prototype.$classData = r8({ RDa: 0 }, false, "amf.plugins.document.graph.emitter.EmissionContext$", { RDa: 1, f: 1 }); + var Sja = void 0; + function iw() { + } + iw.prototype = new u7(); + iw.prototype.constructor = iw; + iw.prototype.a = function() { + return this; + }; + iw.prototype.$classData = r8({ UDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedEmissionContext$", { UDa: 1, f: 1 }); + var Tja = void 0; + function jw() { + } + jw.prototype = new u7(); + jw.prototype.constructor = jw; + jw.prototype.a = function() { + return this; + }; + jw.prototype.jO = function(a10, b10, c10) { + Tja || (Tja = new iw().a()); + var e10 = new kw(), f10 = Rb(Ut(), H10()), g10 = a10.j; + e10.o9 = g10; + ew.prototype.ima.call(e10, f10, g10, c10); + new Uja().Daa(b10, c10, e10).hW(a10); + return true; + }; + jw.prototype.$classData = r8({ WDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$", { WDa: 1, f: 1 }); + var Vja = void 0; + function oga() { + Vja || (Vja = new jw().a()); + return Vja; + } + function lw() { + } + lw.prototype = new u7(); + lw.prototype.constructor = lw; + lw.prototype.a = function() { + return this; + }; + lw.prototype.jO = function(a10, b10, c10) { + Sja || (Sja = new hw().a()); + var e10 = new ew().ima(Rb(Ut(), H10()), a10.j, c10); + new Wja().Daa(b10, c10, e10).hW(a10); + return true; + }; + lw.prototype.$classData = r8({ iEa: 0 }, false, "amf.plugins.document.graph.emitter.JsonLdEmitter$", { iEa: 1, f: 1 }); + var Xja = void 0; + function pga() { + Xja || (Xja = new lw().a()); + return Xja; + } + function mw() { + this.DG = null; + } + mw.prototype = new u7(); + mw.prototype.constructor = mw; + function nw() { + } + nw.prototype = mw.prototype; + mw.prototype.DK = function(a10) { + this.DG = a10; + return this; + }; + function ow() { + } + ow.prototype = new u7(); + ow.prototype.constructor = ow; + ow.prototype.a = function() { + return this; + }; + function Yja() { + Zja(); + K7(); + pj(); + var a10 = new Lf().a(); + return new pw().aaa($ja(new qw(), a10.ua())); + } + ow.prototype.OS = function(a10) { + a10 = kc(a10.Xd.Fd); + var b10 = qc(), c10 = rw().sc; + a10 = jc(a10, sw(c10, b10)); + a10 = a10.b() ? y7() : a10.c().kc(); + if (a10 instanceof z7 && (a10 = a10.i, null !== a10)) { + b10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = F6().Zd; + return ic(G5(h10, g10)); + }; + }(this)); + c10 = J5(K7(), new Ib().ha(["encodes", "declares", "references"])); + var e10 = K7(); + c10 = c10.ka(b10, e10.u); + e10 = J5(K7(), new Ib().ha(["Document", "Fragment", "Module", "Unit"])); + var f10 = K7(); + b10 = e10.ka(b10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return aka(F6(), g10); + }; + }(this)); + f10 = K7(); + e10 = c10.ka(e10, f10.u); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return aka( + F6(), + g10 + ); + }; + }(this)); + f10 = K7(); + e10 = b10.ka(e10, f10.u); + f10 = K7(); + b10 = b10.ia(e10, f10.u); + if (c10.Od(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return ac(new M6().W(h10), k10).na(); + }; + }(this, a10)))) + return true; + a10 = ac(new M6().W(a10), "@type"); + if (!a10.b()) + return a10 = a10.c().i, c10 = tw(), e10 = cc().bi, a10 = N6(a10, c10, e10).Cm, c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = bc(), k10 = cc().bi; + return N6(g10, h10, k10).oq; + }; + }(this)), e10 = rw(), a10 = a10.ka(c10, e10.sc), b10.gp(a10).Da(); + } + return false; + }; + ow.prototype.$classData = r8({ mEa: 0 }, false, "amf.plugins.document.graph.parser.ExpandedGraphParser$", { mEa: 1, f: 1 }); + var bka = void 0; + function Zja() { + bka || (bka = new ow().a()); + return bka; + } + function uw() { + } + uw.prototype = new u7(); + uw.prototype.constructor = uw; + uw.prototype.a = function() { + return this; + }; + uw.prototype.OS = function(a10) { + a10 = a10.Xd.Fd.re(); + return a10 instanceof vw ? ac(new M6().W(a10), "@graph").na() : false; + }; + function cka() { + dka(); + K7(); + pj(); + var a10 = new Lf().a(); + return new ww().aaa($ja(new qw(), a10.ua())); + } + uw.prototype.$classData = r8({ rEa: 0 }, false, "amf.plugins.document.graph.parser.FlattenedGraphParser$", { rEa: 1, f: 1 }); + var eka = void 0; + function dka() { + eka || (eka = new uw().a()); + return eka; + } + function xw() { + } + xw.prototype = new u7(); + xw.prototype.constructor = xw; + xw.prototype.qj = function(a10) { + var b10 = F6().ez.he; + return 0 <= (a10.length | 0) && a10.substring(0, b10.length | 0) === b10 ? (b10 = 1 + (a10.indexOf("#") | 0) | 0, new z7().d(a10.substring(b10))) : y7(); + }; + xw.prototype.$classData = r8({ yEa: 0 }, false, "amf.plugins.document.graph.parser.GraphParserHelpers$AnnotationName$", { yEa: 1, f: 1 }); + function yw() { + this.u5 = this.w5 = this.v5 = this.u8 = null; + } + yw.prototype = new u7(); + yw.prototype.constructor = yw; + yw.prototype.a = function() { + this.u8 = "%Vocabulary1.0"; + this.v5 = "%Dialect1.0"; + this.w5 = "%Library/Dialect1.0"; + this.u5 = "%NodeMapping/Dialect1.0"; + return this; + }; + yw.prototype.$classData = r8({ GEa: 0 }, false, "amf.plugins.document.vocabularies.ExtensionHeader$", { GEa: 1, f: 1 }); + var fka = void 0; + function zw() { + fka || (fka = new yw().a()); + return fka; + } + function Aw() { + this.ev = this.gga = this.ct = null; + } + Aw.prototype = new u7(); + Aw.prototype.constructor = Aw; + Aw.prototype.a = function() { + gka = this; + this.ct = "RamlStyle"; + this.gga = "JsonSchemaStyle"; + this.ev = J5(K7(), new Ib().ha([this.ct, this.gga])); + return this; + }; + Aw.prototype.$classData = r8({ MEa: 0 }, false, "amf.plugins.document.vocabularies.ReferenceStyles$", { MEa: 1, f: 1 }); + var gka = void 0; + function Yc() { + this.tm = 0; + } + Yc.prototype = new u7(); + Yc.prototype.constructor = Yc; + Yc.prototype.a = function() { + this.tm = 0; + return this; + }; + Yc.prototype.jt = function(a10) { + this.tm = 1 + this.tm | 0; + return a10 + "_" + this.tm; + }; + Yc.prototype.$classData = r8({ WEa: 0 }, false, "amf.plugins.document.vocabularies.emitters.common.IdCounter", { WEa: 1, f: 1 }); + function Bw(a10, b10) { + if (Vb().Ia(b10).b()) + return y7(); + var c10 = uba(a10, b10); + if (c10 instanceof z7 && (c10 = c10.i, null !== c10 && (c10 = c10.ya(), null !== c10))) { + var e10 = a10.pb.j; + if (0 <= (b10.length | 0) && b10.substring(0, e10.length | 0) === e10) + return a10 = B6(c10.Y(), c10.R).A, new z7().d(a10.b() ? null : a10.c()); + var f10 = pd(a10.Xb); + e10 = wd(new xd(), vd()); + for (f10 = f10.th.Er(); f10.Ya(); ) { + var g10 = f10.$a(); + -1 !== (b10.indexOf(g10) | 0) !== false && Ad(e10, g10); + } + b10 = e10.eb; + e10 = ii().u; + b10 = qt(b10, e10); + e10 = mc(); + b10 = Cw(Dw(b10, e10)); + b10 = Wt(b10); + b10.b() ? a10 = y7() : (b10 = b10.c(), a10 = a10.Xb.P(b10).ma(), b10 = B6(c10.Y(), c10.R).A, a10 = new z7().d(a10 + "." + (b10.b() ? null : b10.c()))); + return a10.b() ? (a10 = B6(c10.Y(), c10.R).A, new z7().d(a10.b() ? null : a10.c())) : a10; + } + c10 = a10.pb.j; + if (0 <= (b10.length | 0) && b10.substring(0, c10.length | 0) === c10) + return a10 = a10.pb.j, a10 = Mc(ua(), b10, a10), a10 = Oc(new Pc().fd(a10)), new z7().d(a10.split("/declarations/").join("")); + c10 = pd(a10.Xb).th.Er(); + a: { + for (; c10.Ya(); ) + if (e10 = c10.$a(), -1 !== (b10.indexOf(e10) | 0)) { + c10 = new z7().d(e10); + break a; + } + c10 = y7(); + } + if (c10.b()) + return y7(); + c10 = c10.c(); + a10 = a10.Xb.P(c10).ma(); + c10 = Mc(ua(), b10, c10); + c10 = Oc(new Pc().fd(c10)); + c10 = -1 !== (c10.indexOf("/declarations/") | 0) ? c10.split("/declarations/").join("") : c10; + 0 <= (c10.length | 0) && "#" === c10.substring(0, 1) ? (c10 = new qg().e(c10), b10 = c10.ja.length | 0, a10 = a10 + "." + gh(hh(), c10.ja, 1, b10)) : a10 = a10 + "." + c10; + return new z7().d(a10); + } + function Ew() { + this.oX = this.HX = null; + } + Ew.prototype = new u7(); + Ew.prototype.constructor = Ew; + Ew.prototype.a = function() { + hka = this; + var a10 = qb(), b10 = F6().$c; + this.HX = rb(new sb(), a10, G5(b10, "declarationName"), tb(new ub(), vb().qm, "", "", H10())); + a10 = zc(); + b10 = F6().$c; + this.oX = rb(new sb(), a10, G5(b10, "abstract"), tb(new ub(), vb().qm, "", "", H10())); + return this; + }; + Ew.prototype.$classData = r8({ tGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.DialectDomainElementModel$", { tGa: 1, f: 1 }); + var hka = void 0; + function Fw() { + hka || (hka = new Ew().a()); + return hka; + } + function ika(a10) { + return B6(a10.Y(), a10.at); + } + function jka(a10, b10) { + if (a10.Ts.Ha(b10)) + eb(a10, a10.at, b10); + else + throw mb(E6(), new nb().e("Unknown merging policy: '" + b10 + "'")); + } + function kka() { + } + kka.prototype = new u7(); + kka.prototype.constructor = kka; + function Gw() { + } + Gw.prototype = kka.prototype; + function Hw() { + this.Cw = this.m = this.kf = null; + } + Hw.prototype = new u7(); + Hw.prototype.constructor = Hw; + Hw.prototype.GG = function() { + var a10 = this.kf, b10 = qc(); + a10 = Iw(a10, b10); + a10 instanceof ye4 && lka(this, a10.i); + }; + function mka(a10, b10, c10, e10, f10) { + if (!f10.b()) { + var g10 = f10.c(); + a10.Cw.Ue(g10 + "/" + b10, c10); + } + g10 = new qg().e(e10); + b10 = tc(g10) ? e10 + "/" + b10 : b10; + a10.Cw.Ue(b10, c10); + e10 = c10.hb().gb; + Q5().sa === e10 ? (e10 = qc(), e10 = N6(c10, e10, a10.m), g10 = ac(new M6().W(e10), "id"), g10 = g10.b() ? ac(new M6().W(e10), "$id") : g10, g10.b() ? g10 = y7() : (g10 = Kc(g10.c().i), g10.b() ? g10 = y7() : (g10 = g10.c(), g10 = new z7().d(g10.va))), g10.b() ? f10 = y7() : (g10 = g10.c(), f10 = new z7().d(0 <= (g10.length | 0) && "#" === g10.substring(0, 1) ? "" + (f10.b() ? "" : f10.c()) + g10 : g10)), f10.b() || (g10 = f10.c(), a10.Cw.Ue(g10, c10)), nka(a10, b10, f10, e10)) : Q5().cd === e10 && (e10 = tw(), c10 = N6(c10, e10, a10.m), oka(a10, b10, f10, c10)); + } + function oka(a10, b10, c10, e10) { + e10 = e10.Cm; + var f10 = rw(); + e10.og(f10.sc).U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.Ki(); + mka(g10, "" + l10, m10, h10, k10); + } else + throw new x7().d(l10); + }; + }(a10, b10, c10))); + } + Hw.prototype.pv = function(a10, b10) { + this.kf = a10; + this.m = b10; + this.Cw = new wu().a(); + this.GG(); + return this; + }; + function lka(a10, b10) { + var c10 = ac(new M6().W(b10), "id"); + c10 = c10.b() ? ac(new M6().W(b10), "$id") : c10; + c10.b() ? c10 = y7() : (c10 = Kc(c10.c().i), c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.va))); + if (!c10.b()) { + var e10 = c10.c(); + a10.Cw.Ue(e10, (T6(), T6(), mr(T6(), b10, Q5().sa))); + } + a10.Cw.Ue("/", (T6(), T6(), mr(T6(), b10, Q5().sa))); + b10.sb.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = Kc(f10.i); + f10.b() ? f10 = false : (f10 = f10.c(), f10 = "id" === f10.va || "$id" === f10.va); + return !f10; + }; + }(a10))).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + mka(f10, N6(k10, l10, f10.m).va, h10.i, "", g10); + }; + }(a10, c10))); + } + function nka(a10, b10, c10, e10) { + e10.sb.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = Kc(f10.i); + f10.b() ? f10 = false : (f10 = f10.c(), f10 = "id" === f10.va || "$id" === f10.va); + return !f10; + }; + }(a10))).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = k10.Aa, m10 = bc(); + mka(f10, N6(l10, m10, f10.m).va, k10.i, g10, h10); + }; + }(a10, b10, c10))); + } + Hw.prototype.$classData = r8({ qJa: 0 }, false, "amf.plugins.document.webapi.contexts.JsonSchemaAstIndex", { qJa: 1, f: 1 }); + function pka(a10) { + return Vw(/* @__PURE__ */ function(b10) { + return function(c10, e10, f10) { + return qka(c10, e10, f10, b10.N); + }; + }(a10)); + } + function rka(a10) { + return Vw(/* @__PURE__ */ function(b10) { + return function(c10, e10, f10) { + var g10 = b10.N, h10 = new Ww(); + h10.FA = c10; + h10.Gb = e10; + h10.Ka = f10; + h10.sd = g10; + Xw.prototype.gma.call(h10, c10, g10); + return h10; + }; + }(a10)); + } + function ska(a10) { + return Uc(/* @__PURE__ */ function(b10) { + return function(c10, e10) { + var f10 = b10.N, g10 = new Yw(); + g10.$w = c10; + g10.Ka = e10; + g10.sd = f10; + return g10; + }; + }(a10)); + } + function Zw() { + } + Zw.prototype = new u7(); + Zw.prototype.constructor = Zw; + Zw.prototype.a = function() { + return this; + }; + function Yg(a10, b10, c10, e10, f10) { + var g10 = c10.r.r.fa(), h10 = new tka().a(); + g10 = g10.hf; + var k10 = Ef().u; + h10 = xs(g10, h10, k10); + h10.Da() ? (g10 = f10.Gg(), k10 = Pb(), g10 = null !== g10 && g10 === k10) : g10 = false; + return g10 ? (a10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.cp; + }; + }(a10)), g10 = K7(), uka(new $w(), b10, c10, h10.ka(a10, g10.u), e10, f10)) : $g(new ah(), b10, c10, e10); + } + Zw.prototype.$classData = r8({ QJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlScalarEmitter$", { QJa: 1, f: 1 }); + var vka = void 0; + function Zg() { + vka || (vka = new Zw().a()); + return vka; + } + function ax() { + this.wc = this.oy = this.Bc = null; + this.zr = false; + } + ax.prototype = new u7(); + ax.prototype.constructor = ax; + function wka() { + } + wka.prototype = ax.prototype; + function xka(a10, b10) { + b10 = Ab(b10.fa(), q5(bx)); + if (b10 instanceof z7) + return b10 = b10.i, cx(new dx(), "type", a10, Q5().Na, b10.yc.$d); + if (y7() === b10) + return cx(new dx(), "type", a10, Q5().Na, ld()); + throw new x7().d(b10); + } + ax.prototype.Ti = function(a10, b10, c10) { + this.Bc = a10; + this.oy = b10; + this.wc = c10; + this.zr = false; + return this; + }; + ax.prototype.Xba = function() { + return this.wc; + }; + ax.prototype.hj = function() { + return this.Bc; + }; + function ex(a10, b10, c10) { + a10.oy.yoa(c10, b10); + } + function yka(a10, b10) { + var c10 = cs(b10.Y(), Ih().xd); + if (y7() === c10) { + if ("union" === a10 && B6(b10.aa, xn().Le).Da()) + return y7(); + b10 = Ab(b10.fa(), q5(bx)); + if (b10 instanceof z7) + return b10 = b10.i, new z7().d(cx(new dx(), "type", a10, Q5().Na, b10.yc.$d)); + } + return y7(); + } + function hca(a10, b10) { + return a10.zr ? b10.Cb(w6(/* @__PURE__ */ function() { + return function(c10) { + return !Ab(c10.fa(), q5(zka)).na(); + }; + }(a10))) : b10; + } + function Aka(a10, b10, c10) { + b10 = Za(b10); + return b10 instanceof z7 ? c10.Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return ev(g10) ? g10.qe().j === f10 : Zc(g10) && g10.tk().Od(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.j === k10; + }; + }(e10, f10))); + }; + }(a10, b10.i.j))) : y7(); + } + function gx() { + this.r = this.la = null; + } + gx.prototype = new u7(); + gx.prototype.constructor = gx; + function hx() { + } + hx.prototype = gx.prototype; + gx.prototype.Hc = function(a10, b10) { + this.la = a10; + this.r = b10; + return this; + }; + function ix() { + this.Uba = this.h3 = this.F0 = this.VD = null; + } + ix.prototype = new u7(); + ix.prototype.constructor = ix; + ix.prototype.a = function() { + Bka = this; + this.VD = jx(new je4().e("fragmentType")); + this.F0 = jx(new je4().e("extensionType")); + this.h3 = "swagger"; + this.Uba = "openapi"; + return this; + }; + ix.prototype.hG = function(a10) { + a10 = a10.$g; + if (a10 instanceof Dc) { + a10 = a10.Xd; + var b10 = qc(); + a10 = kx(a10).Qp(b10); + if (a10 instanceof ye4) { + a10 = a10.i; + b10 = ac(new M6().W(a10), this.VD); + b10 = b10.b() ? ac(new M6().W(a10), lx().F0) : b10; + b10 = b10.b() ? ac(new M6().W(a10), lx().h3) : b10; + a10 = b10.b() ? ac(new M6().W(a10), lx().Uba) : b10; + if (a10.b()) + return y7(); + a10 = a10.c(); + lx(); + a10 = jc(kc(a10.i), Dd()); + a10 = a10.b() ? "" : a10.c(); + b10 = mx().r; + b10 = new qg().e(b10); + var c10 = H10(); + b10 = new rg().vi(b10.ja, c10); + Cka().r === a10 ? a10 = new z7().d(Cka()) : (b10 = yt(b10, a10), b10.b() ? b10 = false : null !== b10.c() ? (b10 = b10.c(), b10 = 0 === Tu(b10, 0)) : b10 = false, a10 = b10 ? new z7().d(mx()) : Dka().r === a10 ? new z7().d(Dka()) : Eka().r === a10 ? new z7().d(Eka()) : Fka().r === a10 ? new z7().d(Fka()) : Gka().r === a10 ? new z7().d(Gka()) : Hka().r === a10 ? new z7().d(Hka()) : Ika().r === a10 ? new z7().d(Ika()) : Jka().r === a10 ? new z7().d(Jka()) : Kka().r === a10 ? new z7().d(Kka()) : Lka().r === a10 ? new z7().d(Lka()) : y7()); + return a10; + } + if (a10 instanceof ve4) + return y7(); + throw new x7().d(a10); + } + return y7(); + }; + ix.prototype.$classData = r8({ uKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$", { uKa: 1, f: 1 }); + var Bka = void 0; + function lx() { + Bka || (Bka = new ix().a()); + return Bka; + } + function nx() { + this.UU = null; + } + nx.prototype = new u7(); + nx.prototype.constructor = nx; + nx.prototype.a = function() { + Mka = this; + var a10 = "time-only date-only date-time date-time-only password byte binary int32 int64 long float".split(" "); + if (0 === (a10.length | 0)) + a10 = vd(); + else { + for (var b10 = wd(new xd(), vd()), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.UU = a10; + return this; + }; + nx.prototype.$classData = r8({ GKa: 0 }, false, "amf.plugins.document.webapi.parser.OasTypeDefMatcher$", { GKa: 1, f: 1 }); + var Mka = void 0; + function Nka() { + Mka || (Mka = new nx().a()); + return Mka; + } + function Oka() { + this.m = this.Hj = this.da = this.Hl = null; + } + Oka.prototype = new u7(); + Oka.prototype.constructor = Oka; + function Pka(a10) { + var b10 = a10.Hl.Fd; + var c10 = new z7().d(a10.da), e10 = new ox().a(), f10 = new Nd().a(); + b10 = px(b10, e10, c10, f10, a10.m).Fr(); + b10 = Tf(Uf(), b10, a10.Hj); + a10 = a10.da; + J5(K7(), H10()); + return Ai(b10, a10); + } + function Qka(a10, b10, c10, e10) { + var f10 = new Oka(); + f10.Hl = a10; + f10.da = b10; + f10.Hj = c10; + f10.m = e10; + return f10; + } + Oka.prototype.$classData = r8({ IKa: 0 }, false, "amf.plugins.document.webapi.parser.PayloadParser", { IKa: 1, f: 1 }); + function qx() { + } + qx.prototype = new u7(); + qx.prototype.constructor = qx; + qx.prototype.a = function() { + return this; + }; + function Rka(a10, b10) { + a10 = rx(Ska()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Ska()); + a10 = rx(Tka()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Tka()); + a10 = rx(tx()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(tx()); + a10 = rx(Uka()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Uka()); + a10 = rx(Vka()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Vka()); + a10 = rx(Wka()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Wka()); + a10 = rx(ux()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(ux()); + a10 = rx(vx()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(vx()); + a10 = rx(Xka()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(Xka()); + a10 = rx(tx()).hh; + return sx(Iv(a10, b10, b10.length | 0)) ? new z7().d(tx()) : y7(); + } + qx.prototype.$classData = r8({ JKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$", { JKa: 1, f: 1 }); + var Yka = void 0; + function Zka() { + Yka || (Yka = new qx().a()); + return Yka; + } + function wx() { + } + wx.prototype = new u7(); + wx.prototype.constructor = wx; + wx.prototype.a = function() { + return this; + }; + function $ka(a10, b10) { + return "annotation" === b10 ? "annotation" : "anyShape" === b10 ? "any" : "arrayShape" === b10 ? "array" : "dateScalarShape" === b10 ? "date" : "endPoint" === b10 ? "endpoint" : "example" === b10 ? "example" : "fileShape" === b10 ? "file" : "module" === b10 ? "library" : "nodeShape" === b10 ? "object" : "numberScalarShape" === b10 ? "number" : "operation" === b10 ? "operation" : "resourceType" === b10 ? "resource type" : "response" === b10 ? "response" : "schemaShape" === b10 ? "schema" : "securitySchema" === b10 ? "security schema" : "shape" === b10 ? "shape" : "stringScalarShape" === b10 ? "string" : "trait" === b10 ? "trait" : "unionShape" === b10 ? "union" : "userDocumentation" === b10 ? "documentation" : "webApi" === b10 ? "root" : "xmlSerialization" === b10 ? "xml" : b10; + } + wx.prototype.$classData = r8({ XKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlShapeTypeBeautifier$", { XKa: 1, f: 1 }); + var ala = void 0; + function bla() { + ala || (ala = new wx().a()); + return ala; + } + function xx() { + this.UU = null; + } + xx.prototype = new u7(); + xx.prototype.constructor = xx; + xx.prototype.a = function() { + cla = this; + var a10 = "byte binary password int int8 int16 int32 int64 long double float".split(" "); + if (0 === (a10.length | 0)) + a10 = vd(); + else { + for (var b10 = wd(new xd(), vd()), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.UU = a10; + return this; + }; + function Oh(a10, b10, c10, e10, f10) { + return dla().qj(b10).b() || f10 ? ela().qj(b10).b() || f10 ? fla().qj(b10).b() || f10 ? "nil" === b10 || "" === b10 || "null" === b10 ? df() : "any" === b10 ? yx() : "string" === b10 ? "byte" === c10 ? Be3() : "binary" === c10 ? Ce() : "password" === c10 ? De2() : Ee4() : "number" === b10 ? "int" === c10 ? Fe() : "int8" === c10 ? Fe() : "int16" === c10 ? Fe() : "int32" === c10 ? Fe() : "int64" === c10 ? Ge() : "long" === c10 ? Ge() : "float" === c10 ? Je() : "double" === c10 ? Ke() : ef() : "integer" === b10 ? Fe() : "boolean" === b10 ? Pe2() : "datetime" === b10 ? Ue() : "datetime-only" === b10 ? We() : "time-only" === b10 ? Xe() : "date-only" === b10 ? Ye() : "array" === b10 ? Ze() : "object" === b10 ? $e2() : "union" === b10 ? zx() : "file" === b10 ? cf() : e10 : wca() : gla() : hla(); + } + function ila(a10, b10) { + return "number" === b10 ? new z7().d(ef()) : "integer" === b10 ? new z7().d(Fe()) : "date" === b10 ? new z7().d(Ue()) : "boolean" === b10 ? new z7().d(Pe2()) : "file" === b10 ? new z7().d(cf()) : "string" === b10 ? new z7().d(Ee4()) : y7(); + } + xx.prototype.$classData = r8({ YKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlTypeDefMatcher$", { YKa: 1, f: 1 }); + var cla = void 0; + function Nh() { + cla || (cla = new xx().a()); + return cla; + } + function Ax() { + } + Ax.prototype = new u7(); + Ax.prototype.constructor = Ax; + Ax.prototype.a = function() { + return this; + }; + Ax.prototype.qj = function(a10) { + Nh(); + var b10 = a10.trim(); + b10 = Bx(ua(), b10, "^(\\s+|[\uFEFF-\uFFFF])", ""); + return 0 <= (b10.length | 0) && "[" === b10.substring(0, 1) || 0 <= (b10.length | 0) && "{" === b10.substring(0, 1) ? new z7().d(a10) : y7(); + }; + Ax.prototype.$classData = r8({ ZKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlTypeDefMatcher$JSONSchema$", { ZKa: 1, f: 1 }); + var jla = void 0; + function ela() { + jla || (jla = new Ax().a()); + return jla; + } + function Cx() { + } + Cx.prototype = new u7(); + Cx.prototype.constructor = Cx; + Cx.prototype.a = function() { + return this; + }; + Cx.prototype.qj = function(a10) { + Nh(); + var b10 = a10.trim(); + b10 = Bx(ua(), b10, "^(\\s+|[\uFEFF-\uFFFF])", ""); + return -1 !== (b10.indexOf("[]") | 0) && !(0 <= (b10.length | 0) && "[" === b10.substring(0, 1)) && Ed(ua(), b10, "]") || -1 !== (b10.indexOf("|") | 0) || -1 !== (b10.indexOf("(") | 0) || -1 !== (b10.indexOf(")") | 0) ? new z7().d(a10) : y7(); + }; + Cx.prototype.$classData = r8({ $Ka: 0 }, false, "amf.plugins.document.webapi.parser.RamlTypeDefMatcher$TypeExpression$", { $Ka: 1, f: 1 }); + var kla = void 0; + function fla() { + kla || (kla = new Cx().a()); + return kla; + } + function Dx() { + } + Dx.prototype = new u7(); + Dx.prototype.constructor = Dx; + Dx.prototype.a = function() { + return this; + }; + Dx.prototype.qj = function(a10) { + Nh(); + var b10 = Bx(ua(), a10, "^(\\s+|[\uFEFF-\uFFFF])", ""); + return 0 <= (b10.length | 0) && "<" === b10.substring(0, 1) && !(0 <= (b10.length | 0) && "<<" === b10.substring(0, 2) && Ed(ua(), b10, ">>")) ? new z7().d(a10) : y7(); + }; + Dx.prototype.$classData = r8({ aLa: 0 }, false, "amf.plugins.document.webapi.parser.RamlTypeDefMatcher$XMLSchema$", { aLa: 1, f: 1 }); + var lla = void 0; + function dla() { + lla || (lla = new Dx().a()); + return lla; + } + function Ex() { + } + Ex.prototype = new u7(); + Ex.prototype.constructor = Ex; + Ex.prototype.a = function() { + return this; + }; + function mla(a10, b10, c10) { + if (Be3() === b10) + return new R6().M("string", "byte"); + if (Ce() === b10) + return new R6().M("string", "binary"); + if (De2() === b10) + return new R6().M("string", "password"); + if (Ee4() === b10) + return new R6().M("string", ""); + if (Fe() === b10) + return a10 = false, b10 = null, c10 instanceof z7 && (a10 = true, b10 = c10, "int" === b10.i) ? new R6().M("number", "int") : a10 && "int8" === b10.i ? new R6().M("number", "int8") : a10 && "int16" === b10.i ? new R6().M("number", "int16") : a10 && "int32" === b10.i ? new R6().M("number", "int32") : new R6().M("integer", ""); + if (Ge() === b10) + return a10 = false, b10 = null, c10 instanceof z7 && (a10 = true, b10 = c10, "int64" === b10.i) ? new R6().M("number", "int64") : a10 && "long" === b10.i ? new R6().M("number", "long") : new R6().M("integer", "long"); + if (Je() === b10) + return new R6().M("number", "float"); + if (Ke() === b10) + return new R6().M("number", "double"); + if (Pe2() === b10) + return new R6().M("boolean", ""); + if (Ue() === b10) + return new R6().M("datetime", ""); + if (We() === b10) + return new R6().M("datetime-only", ""); + if (Xe() === b10) + return new R6().M("time-only", ""); + if (Ye() === b10) + return new R6().M("date-only", ""); + if (Ze() === b10) + return new R6().M("array", ""); + if ($e2() === b10) + return new R6().M( + "object", + "" + ); + if (cf() === b10) + return new R6().M("file", ""); + if (df() === b10) + return new R6().M("nil", ""); + if (ef() === b10) + return new R6().M("number", ""); + if (ff() === b10) + throw mb(E6(), new kf().e("Undefined type def")); + throw new x7().d(b10); + } + Ex.prototype.$classData = r8({ bLa: 0 }, false, "amf.plugins.document.webapi.parser.RamlTypeDefStringValueMatcher$", { bLa: 1, f: 1 }); + var nla = void 0; + function ola() { + nla || (nla = new Ex().a()); + return nla; + } + function Fx() { + this.ah = this.T9 = this.Tca = null; + } + Fx.prototype = new u7(); + Fx.prototype.constructor = Fx; + Fx.prototype.t1 = function(a10, b10, c10) { + this.Tca = a10; + this.T9 = b10; + this.ah = c10; + return this; + }; + Fx.prototype.$classData = r8({ cLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.BaseUriSplitter", { cLa: 1, f: 1 }); + function Gx() { + } + Gx.prototype = new u7(); + Gx.prototype.constructor = Gx; + Gx.prototype.a = function() { + return this; + }; + Gx.prototype.$classData = r8({ dLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.BaseUriSplitter$", { dLa: 1, f: 1 }); + var pla = void 0; + function Hx() { + } + Hx.prototype = new u7(); + Hx.prototype.constructor = Hx; + Hx.prototype.a = function() { + return this; + }; + Hx.prototype.$classData = r8({ gLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.OasWebApiDeclarations$", { gLa: 1, f: 1 }); + var qla = void 0; + function Ix() { + } + Ix.prototype = new u7(); + Ix.prototype.constructor = Ix; + Ix.prototype.a = function() { + return this; + }; + function rla(a10, b10) { + a10 = new Jx().GU(Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), b10.bG(), b10.wG(), b10.xB()); + a10.iA = b10.iA; + a10.Sz = b10.Sz; + a10.Oo = b10.Oo; + a10.Fz = b10.Fz; + a10.Ko = b10.Ko; + a10.Cs = b10.Cs; + a10.Es = b10.Es; + a10.Ro = b10.Ro; + a10.Pp = b10.Pp; + a10.Np = b10.Np; + return a10; + } + Ix.prototype.$classData = r8({ hLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.RamlWebApiDeclarations$", { hLa: 1, f: 1 }); + var sla = void 0; + function tla() { + sla || (sla = new Ix().a()); + return sla; + } + function Kx() { + } + Kx.prototype = new u7(); + Kx.prototype.constructor = Kx; + Kx.prototype.a = function() { + return this; + }; + function ula(a10, b10, c10) { + var e10 = new Mq().a(), f10 = y7(), g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()), l10 = Rb(Gb().ab, H10()), m10 = Rb(Gb().ab, H10()), p10 = Rb(Gb().ab, H10()), t10 = Rb(Gb().ab, H10()), v10 = Rb(Gb().ab, H10()), A10 = Rb(Gb().ab, H10()), D10 = Rb(Gb().ab, H10()), C10 = Rb(Gb().ab, H10()), I10 = Rb(Gb().ab, H10()), L10 = Rb(Gb().ab, H10()), Y10 = Rb(Gb().ab, H10()), ia = Rb(Gb().ab, H10()), pa = Rb(Gb().ab, H10()); + c10 = new Lx().BU(f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia, c10, e10, pa); + b10.U(w6(/* @__PURE__ */ function(La, ob) { + return function(zb) { + return $h(ob, zb); + }; + }(a10, c10))); + return c10; + } + Kx.prototype.$classData = r8({ iLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$", { iLa: 1, f: 1 }); + var vla = void 0; + function wla() { + vla || (vla = new Kx().a()); + return vla; + } + function Mx() { + } + Mx.prototype = new u7(); + Mx.prototype.constructor = Mx; + Mx.prototype.a = function() { + return this; + }; + Mx.prototype.P_ = function(a10, b10) { + var c10 = qc(), e10 = new Nx(); + a10 = N6(a10, c10, b10); + e10.Vw = a10; + e10.Th = b10; + return e10; + }; + Mx.prototype.$classData = r8({ HLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.MapArrayNode$", { HLa: 1, f: 1 }); + var xla = void 0; + function Ox() { + } + Ox.prototype = new u7(); + Ox.prototype.constructor = Ox; + Ox.prototype.a = function() { + return this; + }; + function yla(a10, b10, c10) { + a10 = sg().n8; + var e10 = "Unexpected key '" + b10 + "'. Options are 'value' or annotations \\(.+\\)", f10 = y7(); + ec(c10, a10, "", f10, e10, b10.da); + } + function zla(a10, b10, c10) { + var e10 = b10.re(); + return e10 instanceof vw ? Ala(a10, e10, c10) : new Qg().Vb(b10, c10); + } + function Ala(a10, b10, c10) { + var e10 = J5(Ef(), H10()); + e10 = new qd().d(e10); + b10.sb.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + var t10 = p10.Aa.re(); + if (t10 instanceof xt) + return t10 = t10.va, "value" === t10 ? Dg(l10.oa, p10) : Bla(Px(), t10) ? void 0 : (yla(Cla(), p10.Aa, m10), void 0); + yla(Cla(), p10.Aa, m10); + }; + }(a10, e10, c10))); + if (e10.oa.Da()) + for (a10 = Qx(e10.oa).Dc; !a10.b(); ) { + var f10 = a10.ga(), g10 = sg().B5, h10 = y7(); + ec(c10, g10, "", h10, "Duplicated key 'value'.", f10.da); + a10 = a10.ta(); + } + e10 = Wt(e10.oa.Dc); + e10.b() ? e10 = y7() : (e10 = e10.c().i, e10 = new z7().d(new Qg().Vb(e10, c10))); + e10.b() ? (e10 = T6().En, c10 = new Qg().Vb(e10, c10)) : c10 = e10.c(); + return Dla(b10, c10); + } + Ox.prototype.$classData = r8({ LLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.RamlScalarNode$", { LLa: 1, f: 1 }); + var Ela = void 0; + function Cla() { + Ela || (Ela = new Ox().a()); + return Ela; + } + function Rx() { + } + Rx.prototype = new u7(); + Rx.prototype.constructor = Rx; + Rx.prototype.a = function() { + return this; + }; + Rx.prototype.P_ = function(a10, b10) { + return a10.re() instanceof Sx ? new Tx().Vb(a10, b10) : new Ux().pv(a10, b10); + }; + Rx.prototype.$classData = r8({ QLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.SingleArrayNode$", { QLa: 1, f: 1 }); + var Fla = void 0; + function Gla() { + Fla || (Fla = new Rx().a()); + return Fla; + } + function Hla() { + this.l = this.Th = this.Lc = null; + } + Hla.prototype = new u7(); + Hla.prototype.constructor = Hla; + function Ila(a10, b10) { + var c10 = a10.l, e10 = a10.Lc; + a10 = a10.Th; + var f10 = new Jla(); + f10.Yk = b10; + f10.Lc = e10; + f10.Th = a10; + if (null === c10) + throw mb(E6(), null); + f10.l = c10; + f10.Cj = (O7(), new P6().a()); + f10.x = (O7(), new P6().a()); + f10.lP = y7(); + f10.iQ = y7(); + f10.dea = false; + f10.yw = false; + f10.c9 = false; + f10.Wba = false; + return f10; + } + function Ig(a10, b10, c10) { + var e10 = new Hla(); + e10.Lc = b10; + e10.Th = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + function Hg(a10, b10) { + var c10 = a10.l, e10 = new Vx(); + e10.oa = b10; + if (null === c10) + throw mb(E6(), null); + e10.l = c10; + return Ila(a10, e10); + } + Hla.prototype.$classData = r8({ SLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.SpecParserOps$FieldOps", { SLa: 1, f: 1 }); + function Wx() { + this.Rba = this.Yca = this.Via = this.Bna = this.Zca = null; + } + Wx.prototype = new u7(); + Wx.prototype.constructor = Wx; + Wx.prototype.a = function() { + Kla = this; + var a10 = "baseUriParameters termsOfService parameters binding contact externalDocs license baseUriParameters oasDeprecated summary defaultResponse payloads readOnly dependencies tuple format exclusiveMaximum exclusiveMinimum consumes produces flow examples responses additionalProperties collectionFormat tags url serverDescription servers xor and or not minimum maximum recursive pattern multipleOf xone".split(" "); + if (0 === (a10.length | 0)) + a10 = vd(); + else { + for (var b10 = wd( + new xd(), + vd() + ), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.Zca = a10; + a10 = "baseUriParameters annotationTypes requestPayloads responsePayloads uses mediaType traits resourceTypes is type extensionType fragmentType usage title userDocumentation description displayName extends describedBy discriminatorValue settings securitySchemes queryParameters queryString examples fileTypes schema serverDescription servers consumes produces schemes parameters facets merge union security required example examples".split(" "); + if (0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.Bna = a10; + this.Via = "amf-"; + a10 = new qg().e("^\\((.+)\\)$"); + b10 = H10(); + this.Yca = new rg().vi(a10.ja, b10); + a10 = new qg().e("^[xX]-(.+)"); + b10 = H10(); + this.Rba = new rg().vi(a10.ja, b10); + return this; + }; + function Bla(a10, b10) { + a10 = yt(a10.Yca, b10); + a10.b() ? a10 = false : null !== a10.c() ? (a10 = a10.c(), a10 = 0 === Tu(a10, 1)) : a10 = false; + return a10 ? true : false; + } + function Lla(a10, b10) { + var c10 = yt(a10.Yca, b10); + if (c10.b()) + e10 = false; + else if (null !== c10.c()) { + e10 = c10.c(); + var e10 = 0 === Tu(e10, 1); + } else + e10 = false; + if (e10 && (c10 = c10.c(), c10 = Uu(c10, 0), Mla(a10, a10.Zca, c10))) + return new z7().d(c10); + b10 = yt(a10.Rba, b10); + b10.b() ? c10 = false : null !== b10.c() ? (c10 = b10.c(), c10 = 0 === Tu(c10, 1)) : c10 = false; + return c10 && (b10 = b10.c(), b10 = Uu(b10, 0), Mla(a10, a10.Bna, b10)) ? new z7().d(b10) : y7(); + } + function Nla(a10, b10) { + a10 = yt(a10.Rba, b10); + a10.b() ? a10 = false : null !== a10.c() ? (a10 = a10.c(), a10 = 0 === Tu(a10, 1)) : a10 = false; + return a10 ? true : false; + } + function Mla(a10, b10, c10) { + c10 = new qg().e(c10); + return !b10.Ha(Wp(c10, a10.Via)); + } + Wx.prototype.$classData = r8({ VLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.WellKnownAnnotation$", { VLa: 1, f: 1 }); + var Kla = void 0; + function Px() { + Kla || (Kla = new Wx().a()); + return Kla; + } + function Xx() { + this.vb = this.N = this.p = this.Yi = null; + } + Xx.prototype = new u7(); + Xx.prototype.constructor = Xx; + function Ola() { + } + Ola.prototype = Xx.prototype; + Xx.prototype.X$ = function(a10, b10, c10) { + this.Yi = a10; + this.p = b10; + this.N = c10; + this.vb = a10.g; + }; + Xx.prototype.vT = function() { + var a10 = false, b10 = null, c10 = this.YH.ua(); + if (c10 instanceof Vt && (a10 = true, b10 = c10, yr(b10.Wn))) { + c10 = J5(Ef(), H10()); + b10 = hd(this.vb, Sk().Zc); + b10.b() || (b10 = b10.c(), new z7().d(Dg(c10, $g(new ah(), "displayName", b10, y7())))); + b10 = hd(this.vb, Sk().Va); + b10.b() || (b10 = b10.c(), new z7().d(Dg(c10, $g(new ah(), "description", b10, y7())))); + b10 = hd(this.vb, Sk().DF); + if (!b10.b()) { + b10 = b10.c(); + a10 = Yx(b10.r.r); + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = Zx().TW.Ja(g10.t()); + if (h10 instanceof z7) + return ih(new jh(), h10.i, g10.x); + if (y7() === h10) + return g10; + throw new x7().d(h10); + }; + }(this)), f10 = K7(); + a10 = a10.ka(e10, f10.u); + b10 = lh(b10.Lc, kh(Zr(new $r(), a10, b10.r.r.x), b10.r.x)); + new z7().d(Dg(c10, $x("allowedTargets", b10, this.p, false))); + } + b10 = this.YH; + a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10; + }; + }(this)); + e10 = K7(); + ws(c10, b10.ka(a10, e10.u)); + ws(c10, ay(this.Yi, this.p, this.N).Pa()); + ue4(); + return new ve4().d(c10); + } + if (a10 && (a10 = b10.Wn, b10 = b10.Nf, zr(a10) && H10().h(b10))) + return ue4(), new ye4().d(a10); + if (H10().h(c10)) + return ue4(), c10 = H10(), new ve4().d(c10); + throw mb(E6(), new nb().e("IllegalTypeDeclarations found: " + c10)); + }; + function Pla() { + } + Pla.prototype = new u7(); + Pla.prototype.constructor = Pla; + function Qla() { + } + Qla.prototype = Pla.prototype; + function by() { + } + by.prototype = new u7(); + by.prototype.constructor = by; + by.prototype.a = function() { + return this; + }; + function Rla(a10, b10) { + if (Zca(b10)) { + if (Fe() === b10) { + ii(); + for (var c10 = "int int8 int16 int32 int64 long".split(" "), e10 = -1 + (c10.length | 0) | 0, f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + c10 = !Cg(f10, a10); + } else + c10 = false; + if (c10) + return false; + if (Je() !== b10 || "double" !== a10) { + if (Ge() === b10) { + ii(); + b10 = ["double", "float"]; + c10 = -1 + (b10.length | 0) | 0; + for (e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + b10 = Cg(e10, a10); + } else + b10 = false; + if (b10) + return false; + ii(); + b10 = "int int8 int16 int32 int64 float double".split(" "); + c10 = -1 + (b10.length | 0) | 0; + for (e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + return Cg(e10, a10); + } + return false; + } + ii(); + b10 = "int int8 int16 int32 int64 long float double".split(" "); + c10 = -1 + (b10.length | 0) | 0; + for (e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + return !Cg(e10, a10); + } + by.prototype.$classData = r8({ rMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.FormatValidator$", { rMa: 1, f: 1 }); + var Sla = void 0; + function cy() { + this.$ = null; + } + cy.prototype = new u7(); + cy.prototype.constructor = cy; + function Tla() { + } + Tla.prototype = cy.prototype; + cy.prototype.e = function(a10) { + this.$ = a10; + return this; + }; + function dy() { + } + dy.prototype = new u7(); + dy.prototype.constructor = dy; + dy.prototype.a = function() { + return this; + }; + function Ula(a10, b10) { + return Fe() === b10 ? Q5().cj : Q5().of; + } + function ey(a10, b10) { + return Ula(0, b10.b() ? ff() : b10.c()); + } + dy.prototype.$classData = r8({ zMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.NumberTypeToYTypeConverter$", { zMa: 1, f: 1 }); + var Vla = void 0; + function fy() { + Vla || (Vla = new dy().a()); + return Vla; + } + function Wla(a10, b10, c10, e10, f10) { + b10 = ih(new jh(), b10, new P6().a()); + O7(); + var g10 = new P6().a(); + Dg(f10, $g(new ah(), c10, lh(e10, kh(b10, g10)), new z7().d(ey(fy(), a10.fI())))); + } + function Xla(a10, b10, c10) { + var e10 = hd(b10, Fg().wj); + e10.b() || (e10 = e10.c(), Yla(a10, e10, c10)); + b10 = hd(b10, Fg().vj); + b10.b() || (b10 = b10.c(), Zla(a10, b10, c10)); + } + function Yla(a10, b10, c10) { + Dg(c10, $g(new ah(), "minimum", b10, new z7().d(ey(fy(), a10.fI())))); + } + function Zla(a10, b10, c10) { + Dg(c10, $g(new ah(), "maximum", b10, new z7().d(ey(fy(), a10.fI())))); + } + function $la(a10, b10, c10) { + var e10 = hd(b10, Fg().zl); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, $g(new ah(), "pattern", e10, y7())))); + e10 = hd(b10, Fg().Cq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, $g(new ah(), "minLength", e10, y7())))); + e10 = hd(b10, Fg().Aq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, $g(new ah(), "maxLength", e10, y7())))); + e10 = a10.fI(); + e10.b() ? e10 = false : (e10 = e10.c(), e10 = Zca(e10)); + if (e10 && a10.Lj() instanceof gy) + if (e10 = hd(b10, Fg().Fn), e10 instanceof z7) { + e10 = e10.i.r.r.t(); + e10 = "int8" === e10 ? new z7().d(ama(-128, 127)) : "int16" === e10 ? new z7().d(ama(-32768, 32767)) : "int32" === e10 ? new z7().d(ama(-2147483648, 2147483647)) : "int64" === e10 ? new z7().d(ama(-9223372036854776e3, 9223372036854776e3)) : y7(); + var f10 = hd(b10, Fg().wj); + if (f10.b()) { + if (!e10.b()) { + f10 = e10.c().vfa(); + var g10 = Fg().wj; + Wla(a10, f10, "minimum", g10, c10); + } + } else + f10 = f10.c(), Yla(a10, f10, c10); + f10 = hd(b10, Fg().vj); + f10.b() ? e10.b() || (e10 = e10.c().wfa(), f10 = Fg().vj, Wla(a10, e10, "maximum", f10, c10)) : (e10 = f10.c(), Zla(a10, e10, c10)); + } else + Xla(a10, b10, c10); + else + e10 = hd(b10, Fg().Fn), e10.b() || (e10 = e10.c(), Kga(), f10 = Fg().Fn, g10 = e10.r.r.t(), new z7().d(Dg(c10, Iga(0, "format", f10, pca(g10), e10.r.x)))), Xla(a10, b10, c10); + e10 = hd(b10, Fg().yx); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, $g( + new ah(), + "exclusiveMinimum", + e10, + y7() + )))); + e10 = hd(b10, Fg().xx); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, $g(new ah(), "exclusiveMaximum", e10, y7())))); + b10 = hd(b10, Fg().av); + b10.b() || (b10 = b10.c(), new z7().d(Dg(c10, $g(new ah(), "multipleOf", b10, new z7().d(ey(fy(), a10.fI())))))); + } + function hy() { + this.N = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + hy.prototype = new u7(); + hy.prototype.constructor = hy; + function bma() { + } + bma.prototype = hy.prototype; + hy.prototype.Pa = function() { + var a10 = this.N.Xba().qS, b10 = J5(Ef(), H10()), c10 = this.pa.Y(); + if (a10) { + a10 = hd(c10, qf().Zc); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), "title", a10, y7())))); + a10 = hd(c10, qf().Va); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), "description", a10, y7())))); + a10 = hd(c10, qf().Mh); + if (a10 instanceof z7) { + var e10 = a10.i; + a10 = iy(new jy(), B6(this.pa.Y(), qf().Mh), this.p, false, Rb(Ut(), H10()), this.N.hj()); + e10 = kr(wr(), e10.r.x, q5(jd)); + var f10 = Q5().Na; + Dg(b10, ky("default", a10, f10, e10)); + } else if (y7() === a10) + a10 = hd(c10, qf().$j), a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g( + new ah(), + "default", + a10, + y7() + )))); + else + throw new x7().d(a10); + a10 = hd(c10, Ag().Sf); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, ly("externalDocs", a10.r.r, this.p, this.N)))); + } + a10 = hd(c10, qf().ch); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, cma(a10.r, this.p, this.N)))); + a10 = hd(c10, Ag().Ln); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, new my().hE("xml", a10, this.p, this.N)))); + a10 = Ab(this.pa.fa(), q5(dma)); + a10 instanceof z7 && (a10 = a10.i, null !== a10 && (a10 = a10.Fg, e10 = zc(), f10 = F6().Eb, e10 = rb(new sb(), e10, G5(f10, "nullable"), tb(new ub(), vb().Eb, "nullable", "This field can accept a null value", H10())), f10 = ih(new jh(), true, new P6().a()), O7(), a10 = ema( + Uha(), + a10 + ), a10 = new P6().a().Lb(a10), Dg(b10, $g(new ah(), "nullable", lh(e10, kh(f10, a10)), y7())))); + ws(b10, ay(this.pa, this.p, this.N).Pa()); + ws(b10, fma(this.pa, this.p, this.N).Pa()); + a10 = hd(c10, ny()); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, oy(this.N.zf.c0(), a10, this.p, this.Q)))); + Vb().Ia(B6(this.pa.Y(), qf().fi)).na() && B6(this.pa.Y(), qf().fi).Da() && Dg(b10, new zy().bE(this.pa, this.p, this.Q, this.Qe, this.tf, this.N)); + Vb().Ia(B6(this.pa.Y(), qf().ki)).na() && B6(this.pa.Y(), qf().ki).Da() && Dg(b10, new Ay().bE(this.pa, this.p, this.Q, this.Qe, this.tf, this.N)); + Vb().Ia(B6( + this.pa.Y(), + qf().li + )).na() && B6(this.pa.Y(), qf().li).Da() && Dg(b10, new By().bE(this.pa, this.p, this.Q, this.Qe, this.tf, this.N)); + Vb().Ia(B6(this.pa.Y(), qf().Bi)).na() && Dg(b10, new Cy().bE(this.pa, this.p, this.Q, this.Qe, this.tf, this.N)); + a10 = this.N.Gg(); + e10 = Xq().Cp; + a10 === e10 && (c10 = hd(c10, qf().uh), c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "deprecated", c10, y7()))))); + return b10; + }; + hy.prototype.bE = function(a10, b10, c10, e10, f10, g10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.tf = f10; + this.N = g10; + return this; + }; + function Dy() { + this.WJ = this.m = this.XJ = null; + this.xa = false; + this.l = null; + } + Dy.prototype = new u7(); + Dy.prototype.constructor = Dy; + function gma() { + } + gma.prototype = Dy.prototype; + Dy.prototype.J9 = function() { + if (!this.xa) { + var a10 = new z7().d(this.wa.j); + this.XJ = w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return hma(ima(), c10, b10.WJ, e10, b10.m); + }; + }(this, a10)); + this.xa = true; + } + return this.XJ; + }; + Dy.prototype.fT = function() { + return this.xa ? this.XJ : this.J9(); + }; + Dy.prototype.IV = function() { + var a10 = new M6().W(this.Za), b10 = this.l, c10 = qf().Zc; + Gg(a10, "title", Hg(Ig(b10, c10, this.m), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = qf().Va; + Gg(a10, "description", Hg(Ig(b10, c10, this.m), this.wa)); + a10 = ac(new M6().W(this.Za), "default"); + if (!a10.b() && (a10 = a10.c(), Mca(this.wa, a10), b10 = Ey(Fy(a10.i, this.wa.j, false, false, false, this.m)).Cl, !b10.b())) { + b10 = b10.c(); + c10 = this.wa; + var e10 = qf().Mh; + a10 = Od(O7(), a10); + Rg(c10, e10, b10, a10); + } + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = qf().ch; + Gg(a10, "enum", Gy(Hg(Ig(b10, c10, this.m), this.wa), this.fT())); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ag().Sf; + Gg(a10, "externalDocs", Gy(Hg(Ig(b10, c10, this.m), this.wa), w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return jma(kma(), g10, f10.wa.j, f10.m); + }; + }(this)))); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ag().Ln; + b10 = Hg(Ig(b10, c10, this.m), this.wa); + c10 = B6(this.wa.Y(), qf().R).A; + c10 = c10.b() ? null : c10.c(); + Gg(a10, "xml", Gy(b10, w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + lma || (lma = new Hy().a()); + return mma(nma(g10, h10, f10.m)); + }; + }(this, c10)))); + a10 = new M6().W(this.Za); + b10 = jx(new je4().e("facets")); + a10 = ac(a10, b10); + a10.b() || (b10 = a10.c(), a10 = this.l, b10 = b10.i, c10 = qc(), oma(new Iy(), a10, N6(b10, c10, this.m), w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return pma( + f10.wa, + g10 + ); + }; + }(this)), Rb(Gb().ab, H10()), (qma(this.l), false)).Vg()); + a10 = ac(new M6().W(this.Za), "type"); + a10.b() || (b10 = a10.c(), a10 = this.wa.fa(), ae4(), b10 = b10.Aa.da, a10.Lb(new Jy().jj(ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg))))); + ac(new M6().W(this.Za), "anyOf").na() && new Ky().SK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), "allOf").na() && new Ly().SK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), "oneOf").na() && new My().SK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), "not").na() && new Ny().SK(this.l, this.Za, this.wa).hd(); + this.l.Nj instanceof Qy && (a10 = new M6().W(this.Za), b10 = this.l, c10 = qf().uh, Gg(a10, "deprecated", Hg(Ig(b10, c10, this.m), this.wa))); + Ry(new Sy(), this.wa, this.Za, H10(), this.m).hd(); + a10 = ac(new M6().W(this.Za), "id"); + a10.b() || (b10 = a10.c(), a10 = this.wa.fa(), b10 = b10.i, c10 = bc(), a10.Lb(new Ty().e(N6(b10, c10, this.m).va))); + return this.wa; + }; + Dy.prototype.m7a = function(a10, b10) { + this.m = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.WJ = new Nd().a(); + }; + function Uy() { + this.kX = this.fR = this.N = this.Q = this.Fj = this.p = this.pa = null; + } + Uy.prototype = new u7(); + Uy.prototype.constructor = Uy; + function rma() { + } + rma.prototype = Uy.prototype; + Uy.prototype.bU = function(a10, b10, c10, e10, f10) { + this.pa = a10; + this.p = b10; + this.Fj = c10; + this.Q = e10; + this.N = f10; + this.fR = y7(); + this.kX = y7(); + return this; + }; + function sma(a10, b10, c10) { + var e10 = a10.kX; + if (e10 instanceof z7) + return e10.i; + b10 = tma(a10, b10, c10); + a: { + K7(); + c10 = new z7().d(b10); + if (null !== c10.i && 0 === c10.i.Oe(1) && (c10 = c10.i.lb(0), zr(c10))) { + ue4(); + b10 = new ve4().d(c10); + break a; + } + if (b10.oh(w6(/* @__PURE__ */ function() { + return function(f10) { + return yr(f10); + }; + }(a10)))) + ue4(), c10 = new uma(), e10 = K7(), b10 = b10.ec(c10, e10.u), b10 = new ye4().d(b10); + else + throw mb(E6(), new nb().e("IllegalTypeDeclarations found: " + b10)); + } + a10.kX = new z7().d(b10); + return a10.kX.c(); + } + function tma(a10, b10, c10) { + var e10 = a10.fR; + if (e10 instanceof z7) + return e10.i; + a10.fR = new z7().d(a10.p.zb(Vy(a10.pa, a10.p, a10.Fj, a10.Q, b10, c10, false, a10.N).Pa())); + return a10.fR.c(); + } + function Wy() { + this.N = this.p = this.Q = this.Qf = null; + } + Wy.prototype = new u7(); + Wy.prototype.constructor = Wy; + function vma() { + } + vma.prototype = Wy.prototype; + Wy.prototype.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.Qf.g, c10 = hd(b10, Xh().Hf); + if (!c10.b()) + if (c10 = c10.c(), "Api Key" === c10.r.r.t()) { + c10 = kr(wr(), c10.r.x, q5(jd)); + var e10 = Q5().Na; + Dg(a10, cx(new dx(), "type", "x-apiKey", e10, c10)); + } else + Dg(a10, Yg(Zg(), "type", c10, y7(), this.N)); + c10 = hd(b10, Xh().Zc); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "displayName", c10, y7(), this.N)))); + c10 = hd(b10, Xh().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "description", c10, y7(), this.N)))); + Dg(a10, this.Sja().du("describedBy", this.Qf, this.p, this.Q)); + b10 = hd(b10, Xh().Oh); + b10.b() || (b10 = b10.c(), new z7().d(Dg( + a10, + new Xy().SG(b10, this.p, this.N) + ))); + return a10; + }; + Wy.prototype.bma = function(a10, b10, c10, e10) { + this.Qf = a10; + this.Q = b10; + this.p = c10; + this.N = e10; + }; + function Yy() { + this.N = this.Q = this.p = this.pa = null; + this.EA = false; + this.oF = null; + } + Yy.prototype = new u7(); + Yy.prototype.constructor = Yy; + function xma() { + } + xma.prototype = Yy.prototype; + Yy.prototype.DB = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + this.EA = false; + this.oF = Q5().Na; + return this; + }; + Yy.prototype.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.pa.Y(), c10 = hd(b10, qf().Zc); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "displayName", c10, y7(), this.N)))); + c10 = hd(b10, qf().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "description", c10, y7(), this.N)))); + c10 = hd(b10, qf().Mh); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = B6(this.pa.Y(), qf().Mh), f10 = this.p, g10 = Rb(Ut(), H10()); + e10 = iy(new jy(), e10, f10, false, g10, this.N.Bc); + c10 = kr(wr(), c10.r.x, q5(jd)); + f10 = Q5().Na; + Dg(a10, ky("default", e10, f10, c10)); + } else if (y7() === c10) + c10 = hd(b10, qf().$j), c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "default", c10, y7())))); + else + throw new x7().d(c10); + c10 = hd(b10, qf().ch); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, cma(c10.r, this.p, this.N)))); + c10 = hd(b10, Ag().Sf); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, ly(fh(new je4().e("externalDocs")), c10.r.r, this.p, this.N)))); + c10 = hd(b10, Ag().Ln); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, new my().hE("xml", c10, this.p, this.N)))); + c10 = hd(b10, ny()); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, oy(this.N.zf.c0(), c10, this.p, this.Q)))); + ws(a10, ay(this.pa, this.p, this.N).Pa()); + ws(a10, fma(this.pa, this.p, this.N).Pa()); + b10 = hd(b10, qf().xd); + if (b10.b()) { + if (b10 = this.pC(), !b10.b()) + if (b10 = b10.c(), b10 = yka(b10, this.pa), b10 instanceof z7) + b10 = b10.i, this.EA = true, Dg(a10, b10); + else if (y7() === b10) + this.EA = false; + else + throw new x7().d(b10); + } else + a: { + if (b10 = b10.c(), c10 = b10.r.r.wb, e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10; + }; + }(this)), f10 = K7(), c10 = c10.ka(e10, f10.u), c10 = Jc(c10, new yma()), c10 instanceof z7 && (c10 = c10.i, null !== c10)) { + this.EA = true; + ws(a10, new Zy().FO(c10, this.p, this.Q, this.N).Pa()); + break a; + } + this.EA = true; + Dg(a10, new $y().JK(b10, this.p, this.Q, this.N)); + } + Vb().Ia(B6(this.pa.Y(), qf().fi)).na() && B6(this.pa.Y(), qf().fi).Da() && Dg(a10, new az().DB(this.pa, this.p, this.Q, this.N)); + Vb().Ia(B6( + this.pa.Y(), + qf().ki + )).na() && B6(this.pa.Y(), qf().ki).Da() && Dg(a10, new bz().DB(this.pa, this.p, this.Q, this.N)); + Vb().Ia(B6(this.pa.Y(), qf().li)).na() && B6(this.pa.Y(), qf().li).Da() && Dg(a10, new cz().DB(this.pa, this.p, this.Q, this.N)); + Vb().Ia(B6(this.pa.Y(), qf().Bi)).na() && Dg(a10, new dz().DB(this.pa, this.p, this.Q, this.N)); + return a10; + }; + function ez() { + } + ez.prototype = new u7(); + ez.prototype.constructor = ez; + ez.prototype.a = function() { + return this; + }; + ez.prototype.$classData = r8({ QPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetection$", { QPa: 1, f: 1 }); + var zma = void 0; + function fz() { + this.l = null; + } + fz.prototype = new u7(); + fz.prototype.constructor = fz; + function Ama(a10, b10, c10) { + if (H10().h(b10)) + return y7(); + if (b10 instanceof Vt) { + var e10 = b10.Wn, f10 = b10.Nf; + if (H10().h(f10)) + return new z7().d(e10); + } + ii(); + for (e10 = new Lf().a(); !b10.b(); ) { + var g10 = f10 = b10.ga(), h10 = ff(); + false !== !(null !== g10 && g10 === h10) && Dg(e10, f10); + b10 = b10.ta(); + } + e10 = e10.ua(); + if (e10.b()) + return new z7().d(ff()); + b10 = Wt(e10); + f10 = 0; + for (g10 = e10; !g10.b(); ) { + h10 = g10.ga(); + var k10 = b10.c(); + h10 === k10 && (f10 = 1 + f10 | 0); + g10 = g10.ta(); + } + return f10 !== Eq(e10) ? (e10 = a10.l.Iq, b10 = Mo().cN, a10 = a10.l.Wd, f10 = y7(), ec(e10, b10, a10, f10, "Can't inherit from more than one class type", c10.da), new z7().d(ff())) : b10; + } + fz.prototype.maa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + fz.prototype.$classData = r8({ SPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetector$InheritsTypeDetecter$", { SPa: 1, f: 1 }); + function gz() { + this.l = this.hY = null; + } + gz.prototype = new u7(); + gz.prototype.constructor = gz; + gz.prototype.maa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function Bma(a10, b10, c10, e10, f10) { + a: + for (; ; ) { + var g10 = b10; + if (Za(b10).na()) { + g10 = false; + var h10 = null, k10 = Za(b10); + if (k10 instanceof z7 && (g10 = true, h10 = k10, k10 = h10.i, k10 instanceof rf)) { + var l10 = b10; + if (null === k10 ? null === l10 : k10.h(l10)) + return new z7().d(yx()); + } + if (g10 && (g10 = h10.i, g10 instanceof rf)) { + b10 = g10; + continue a; + } + a10 = sg().bJ; + b10 = b10.j; + e10 = y7(); + ec(f10, a10, b10, e10, "Found reference to domain element different of Shape when shape was expected", c10.da); + return y7(); + } + if (g10 instanceof Th) + return new z7().d(df()); + if (g10 instanceof Mh) { + f10 = g10; + ola(); + hz(); + c10 = B6(f10.aa, Fg().af).A; + c10 = mla(0, Cma(0, c10.b() ? null : c10.c()), ni(f10).A); + if (null === c10) + throw new x7().d(c10); + f10 = c10.ma(); + c10 = c10.ya(); + return new z7().d(Oh(Nh(), f10, c10, (Nh(), $e2()), (Nh(), false))); + } + if (g10 instanceof Vh) { + b10 = g10; + if (e10) { + if (null === a10.hY && null === a10.hY) { + g10 = e10 = a10; + h10 = new Dma(); + if (null === g10) + throw mb(E6(), null); + h10.l = g10; + e10.hY = h10; + } + e10 = Ema; + a10 = a10.hY.l; + g10 = new iz(); + g10.MW = b10; + g10.m = f10; + if (null === a10) + throw mb(E6(), null); + g10.l = a10; + g10.ea = nv().ea; + f10 = e10(g10, c10); + } else + f10 = new z7().d(zx()); + return f10; + } + return g10 instanceof Hh ? new z7().d($e2()) : g10 instanceof th ? new z7().d(Ze()) : g10 instanceof pi ? new z7().d(Ze()) : g10 instanceof vh ? new z7().d(yx()) : y7(); + } + } + function Fma(a10, b10) { + var c10 = new jz().dH(a10.l.Iq.Nl.Pe, w6(/* @__PURE__ */ function() { + return function(f10) { + return Ed(ua(), f10, "Shape") && "schemaShape" !== f10; + }; + }(a10))), e10 = J5(K7(), H10()); + e10 = new qd().d(e10); + b10.sb.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10 = g10.Cb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.ya(); + var A10 = t10.Aa.t(); + return v10.Ha(A10); + }; + }(f10, k10))); + if (tc(k10)) + if (h10.oa.b()) + k10 = pd(k10), h10.oa = kz(k10); + else { + var l10 = pd(k10); + k10 = wd(new xd(), vd()); + for (l10 = l10.th.Er(); l10.Ya(); ) { + var m10 = l10.$a(); + false !== h10.oa.Ha(m10) && Ad(k10, m10); + } + h10.oa = k10.eb.ke(); + } + }; + }(a10, c10, e10))); + return e10.oa.fj(); + } + gz.prototype.$classData = r8({ TPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetector$ShapeClassTypeDefMatcher$", { TPa: 1, f: 1 }); + function lz() { + } + lz.prototype = new u7(); + lz.prototype.constructor = lz; + lz.prototype.a = function() { + return this; + }; + function Gma(a10, b10) { + var c10 = b10.aa.vb, e10 = mz(); + e10 = Ua(e10); + var f10 = Id().u; + return 2 >= Jd(c10, e10, f10).jb() ? (b10 = b10.aa.vb, c10 = mz(), c10 = Ua(c10), e10 = Id().u, b10 = Jd(b10, c10, e10), c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.Lc; + }; + }(a10)), e10 = Xd(), b10.ka(c10, e10.u).oh(w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = Fg().R; + if (null === g10 ? null === h10 : g10.h(h10)) + return true; + h10 = Fg().af; + return null === g10 ? null === h10 : g10.h(h10); + }; + }(a10)))) : false; + } + function Hma(a10, b10) { + var c10 = new Ej().a(); + try { + var e10 = B6(b10.aa, xn().Le), f10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (m10 instanceof Mh && Gma(Ima(), m10)) { + ola(); + hz(); + var p10 = B6(m10.aa, Fg().af).A; + return mla(0, Cma(0, p10.b() ? null : p10.c()), ni(m10).A).ma(); + } + if (null !== m10 && Za(m10).na() && B6(m10.Y(), db().ed).A.na()) + return m10 = B6(m10.Y(), db().ed).A, m10.b() ? null : m10.c(); + if (m10 instanceof Th) { + p10 = m10.aa.vb; + var t10 = mz(); + t10 = Ua(t10); + var v10 = Id().u; + if (Jd(p10, t10, v10).b()) + return "nil"; + } + if (m10 instanceof th && (p10 = m10.aa.vb, t10 = mz(), t10 = Ua(t10), v10 = Id().u, Jd(p10, t10, v10).b())) + return "array"; + if (m10 instanceof Hh && (p10 = m10.aa.vb, t10 = mz(), t10 = Ua(t10), v10 = Id().u, Jd(p10, t10, v10).b())) + return "object"; + if (m10 instanceof vh && (m10 = m10.Y().vb, p10 = mz(), p10 = Ua(p10), t10 = Id().u, Jd(m10, p10, t10).b())) + return "any"; + throw new nz().M(l10, y7()); + }; + }(a10, c10)), g10 = K7(), h10 = e10.ka(f10, g10.u); + return new z7().d(h10.Kg(" | ")); + } catch (k10) { + if (k10 instanceof nz) { + a10 = k10; + if (a10.Aa === c10) + return a10.Dt(); + throw a10; + } + throw k10; + } + } + lz.prototype.$classData = r8({ qQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlUnionEmitterHelper$", { qQa: 1, f: 1 }); + var Jma = void 0; + function Ima() { + Jma || (Jma = new lz().a()); + return Jma; + } + function oz() { + } + oz.prototype = new u7(); + oz.prototype.constructor = oz; + oz.prototype.a = function() { + return this; + }; + function Kma(a10, b10, c10) { + O7(); + var e10 = new P6().a(); + e10 = new mf().K(new S6().a(), e10); + a10 = pz(qz(e10, "uses", a10, b10.Q, c10), b10.da); + return new R6().M(a10, Ab(e10.x, q5(Rc))); + } + oz.prototype.$classData = r8({ xQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ReferencesParserAnnotations$", { xQa: 1, f: 1 }); + var Lma = void 0; + function rz() { + } + rz.prototype = new u7(); + rz.prototype.constructor = rz; + rz.prototype.a = function() { + return this; + }; + function Bca(a10, b10, c10, e10) { + var f10 = e10.Gg(); + if (Cia(f10)) + return a10 = b10.Aa, f10 = bc(), Mma(new sz(), b10, N6(a10, f10, e10).va, b10.i, c10, tz(uz(), e10)); + if (wia(f10)) + return new vz().QO(b10.i, w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + var t10 = k10.Aa, v10 = bc(); + t10 = N6(t10, v10, l10).va; + v10 = Od(O7(), k10); + Db(p10, v10); + return m10.ug(p10, t10); + }; + }(a10, b10, e10, c10)), wz(uz(), e10)); + a10 = sg().l_; + f10 = "Unsupported vendor " + f10 + " in security scheme parsers"; + var g10 = y7(); + ec(e10, a10, "", g10, f10, b10.da); + a10 = b10.Aa; + f10 = bc(); + return Mma(new sz(), b10, N6(a10, f10, e10).va, b10.i, c10, tz(uz(), e10)); + } + rz.prototype.$classData = r8({ BQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.SecuritySchemeParser$", { BQa: 1, f: 1 }); + var Nma = void 0; + function Cca() { + Nma || (Nma = new rz().a()); + return Nma; + } + function xz() { + } + xz.prototype = new u7(); + xz.prototype.constructor = xz; + xz.prototype.a = function() { + return this; + }; + xz.prototype.$classData = r8({ SQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.LicenseParser$", { SQa: 1, f: 1 }); + var Oma = void 0; + function Pma() { + Oma || (Oma = new xz().a()); + } + function yz() { + this.ad = this.Fe = null; + this.rma = this.OU = false; + this.yr = this.LL = null; + } + yz.prototype = new u7(); + yz.prototype.constructor = yz; + function Qma(a10, b10, c10) { + a10.Fe = b10; + a10.ad = c10; + c10 = new zz().ln(b10).pk(); + if (c10.b()) + c10 = false; + else { + c10 = c10.c(); + if (Za(c10).na()) { + var e10 = J5(K7(), H10()); + e10 = wh(Az(c10, e10).fa(), q5(Rma)); + } else + e10 = false; + c10 = e10 ? true : wh(c10.x, q5(Rma)); + } + a10.OU = c10; + a10.rma = b10.wma() && !a10.OU; + a10.LL = new Bz().ln(b10).pk(); + if (b10 instanceof ve4) + b10 = b10.i; + else if (b10 instanceof ye4) + b10 = b10.i; + else + throw new x7().d(b10); + a10.yr = b10; + return a10; + } + yz.prototype.$classData = r8({ BRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParameter", { BRa: 1, f: 1 }); + function Cz() { + } + Cz.prototype = new u7(); + Cz.prototype.constructor = Cz; + Cz.prototype.a = function() { + return this; + }; + function Sma(a10, b10, c10) { + return Qma(new yz(), (ue4(), new ye4().d(b10)), c10); + } + function Dz(a10, b10, c10) { + return Qma(new yz(), (ue4(), new ve4().d(b10)), c10); + } + Cz.prototype.$classData = r8({ CRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParameter$", { CRa: 1, f: 1 }); + var Tma = void 0; + function Ez() { + Tma || (Tma = new Cz().a()); + return Tma; + } + function Fz() { + this.N = this.p = null; + } + Fz.prototype = new u7(); + Fz.prototype.constructor = Fz; + function Uma() { + } + Uma.prototype = Fz.prototype; + Fz.prototype.EO = function(a10, b10, c10, e10, f10) { + this.p = c10; + this.N = f10; + }; + Fz.prototype.SN = function(a10, b10, c10) { + b10.Da() && Dg(c10, new Gz().eA(a10, b10, this.p, this.N)); + }; + function Hz() { + } + Hz.prototype = new u7(); + Hz.prototype.constructor = Hz; + Hz.prototype.a = function() { + return this; + }; + Hz.prototype.$classData = r8({ eSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OrganizationParser$", { eSa: 1, f: 1 }); + var Vma = void 0; + function Wma() { + Vma || (Vma = new Hz().a()); + } + function Iz() { + } + Iz.prototype = new u7(); + Iz.prototype.constructor = Iz; + Iz.prototype.a = function() { + return this; + }; + function Jz(a10, b10) { + if (a10 = !(Za(b10).na() && wh(b10.fa(), q5(cv)))) + a10 = B6(b10.Y(), qf().xd), K7(), a10 = new z7().d(a10), null !== a10.i && 0 === a10.i.Oe(1) ? (a10 = a10.i.lb(0), a10 = Za(a10).na() || wh(a10.fa(), q5(cv))) : a10 = false, a10 = !a10; + a10 && (a10 = new Kz().a(), Cb(b10, a10)); + } + Iz.prototype.$classData = r8({ lSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.PayloadParserHelper$", { lSa: 1, f: 1 }); + var Xma = void 0; + function Lz() { + Xma || (Xma = new Iz().a()); + return Xma; + } + function Mz() { + } + Mz.prototype = new u7(); + Mz.prototype.constructor = Mz; + Mz.prototype.a = function() { + return this; + }; + Mz.prototype.NL = function(a10, b10, c10, e10) { + a10 = Yma().NL(a10, b10, c10, e10); + b10 = cj().We; + return eb(a10, b10, "header"); + }; + Mz.prototype.$classData = r8({ XSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlHeaderParser$", { XSa: 1, f: 1 }); + var Zma = void 0; + function $ma() { + Zma || (Zma = new Mz().a()); + return Zma; + } + function Nz() { + } + Nz.prototype = new u7(); + Nz.prototype.constructor = Nz; + Nz.prototype.a = function() { + return this; + }; + Nz.prototype.NL = function(a10, b10, c10, e10) { + var f10 = qc(); + c10 = N6(c10, f10, e10).sb.ga(); + return oy(e10.$h.a2(), c10, a10, b10).SB(); + }; + Nz.prototype.$classData = r8({ dTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlParameterParser$", { dTa: 1, f: 1 }); + var ana = void 0; + function Yma() { + ana || (ana = new Nz().a()); + return ana; + } + function Oz() { + this.m = this.xb = this.tb = null; + } + Oz.prototype = new u7(); + Oz.prototype.constructor = Oz; + function bna() { + } + bna.prototype = Oz.prototype; + Oz.prototype.jn = function(a10, b10, c10, e10) { + this.tb = a10; + this.xb = b10; + this.m = e10; + return this; + }; + Oz.prototype.ly = function() { + var a10 = this.xb; + T6(); + var b10 = this.tb.Aa, c10 = this.m, e10 = Dd(); + a10 = a10.P(new z7().d(N6(b10, e10, c10))); + b10 = Od(O7(), this.tb); + return Db(a10, b10); + }; + function Pz() { + } + Pz.prototype = new u7(); + Pz.prototype.constructor = Pz; + Pz.prototype.a = function() { + return this; + }; + Pz.prototype.NL = function(a10, b10, c10, e10) { + a10 = Yma().NL(a10, b10, c10, e10); + b10 = cj().We; + return eb(a10, b10, "query"); + }; + Pz.prototype.$classData = r8({ kTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlQueryParameterParser$", { kTa: 1, f: 1 }); + var cna = void 0; + function Qz() { + } + Qz.prototype = new u7(); + Qz.prototype.constructor = Qz; + Qz.prototype.a = function() { + return this; + }; + function dna(a10, b10, c10, e10) { + return new Rz().Faa(b10, c10, wz(uz(), e10)); + } + Qz.prototype.$classData = r8({ KTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.TagsParser$", { KTa: 1, f: 1 }); + var ena = void 0; + function fna() { + ena || (ena = new Qz().a()); + return ena; + } + function Sz() { + this.l = this.xb = this.tb = null; + } + Sz.prototype = new u7(); + Sz.prototype.constructor = Sz; + function gna() { + } + gna.prototype = Sz.prototype; + Sz.prototype.g2 = function() { + var a10 = this.xb.P(ka(new Qg().Vb(this.tb.Aa, this.l.Mb()).nf().r)), b10 = Od(O7(), this.tb); + a10 = Db(a10, b10); + b10 = this.tb.i; + var c10 = qc(); + b10 = N6(b10, c10, this.l.Mb()); + c10 = ac(new M6().W(b10), "operationId"); + if (!c10.b()) { + var e10 = c10.c(), f10 = e10.i.t(); + if (!this.l.Mb().Jna.iz(f10)) { + c10 = this.l.Mb(); + var g10 = sg().A5, h10 = a10.j; + f10 = "Duplicated operation id '" + f10 + "'"; + e10 = e10.i; + var k10 = y7(); + ec(c10, g10, h10, k10, f10, e10.da); + } + } + c10 = new M6().W(b10); + g10 = this.l; + h10 = Pl().R; + Gg(c10, "operationId", Hg(Ig(g10, h10, this.l.Mb()), a10)); + c10 = new M6().W(b10); + g10 = this.l; + h10 = Pl().Va; + Gg(c10, "description", Hg(Ig( + g10, + h10, + this.l.Mb() + ), a10)); + c10 = new M6().W(b10); + g10 = this.l; + h10 = Pl().uh; + Gg(c10, "deprecated", Hg(Ig(g10, h10, this.l.Mb()), a10)); + c10 = new M6().W(b10); + g10 = this.l; + h10 = Pl().ck; + Gg(c10, "summary", Hg(Ig(g10, h10, this.l.Mb()), a10)); + c10 = new M6().W(b10); + g10 = this.l; + h10 = Pl().Sf; + Gg(c10, "externalDocs", Gy(Hg(Ig(g10, h10, this.l.Mb()), a10), w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return jma(kma(), p10, m10.j, l10.l.Mb()); + }; + }(this, a10)))); + c10 = ac(new M6().W(b10), "tags"); + c10.b() || (c10 = c10.c(), g10 = c10.i, h10 = tw(), h10 = hna(new Tz(), N6(g10, h10, this.l.Mb()), a10.j, this.l.Mb()).Vg(), g10 = Pl().Xm, h10 = Zr(new $r(), h10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg( + a10, + g10, + h10, + c10 + )); + c10 = new M6().W(b10); + g10 = jx(new je4().e("is")); + c10 = ac(c10, g10); + c10.b() || (c10 = c10.c(), g10 = c10.i, h10 = lc(), g10 = N6(g10, h10, this.l.Mb()), h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return ina(jna(new Uz(), p10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return kda(v10, A10); + }; + }(l10, m10)), Uc(/* @__PURE__ */ function(t10, v10) { + return function(A10, D10) { + return kna(t10.l.Mb().Qh, v10, A10, D10); + }; + }(l10, p10)), l10.l.Mb())); + }; + }(this, a10)), f10 = K7(), g10 = g10.ka(h10, f10.u), g10.Da() && (h10 = nc().Ni(), c10 = Od(O7(), c10), bs(a10, h10, g10, c10))); + c10 = ac(new M6().W(b10), "security"); + c10.b() || (c10 = c10.c(), g10 = new Nd().a(), h10 = c10.i, f10 = lc(), h10 = N6(h10, f10, this.l.Mb()), g10 = w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + return lna(new Vz(), t10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return A10.mI(D10); + }; + }(l10, m10)), p10, l10.l.Mb()).Cc(); + }; + }(this, a10, g10)), f10 = K7(), g10 = h10.ka(g10, f10.u), h10 = new mna(), f10 = K7(), h10 = g10.ec(h10, f10.u), g10 = Pl().dc, h10 = Zr(new $r(), h10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg(a10, g10, h10, c10)); + c10 = this.l.Mb().Nl; + g10 = nna(); + if (null !== c10 && c10 === g10 && (c10 = new Wz().gE(this.l, b10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + ona(m10, p10); + }; + }(this, a10)), this.l.Mb()).Cc(), !c10.b())) { + g10 = c10.c(); + c10 = Pl().dB; + ii(); + g10 = [g10]; + h10 = -1 + (g10.length | 0) | 0; + for (f10 = H10(); 0 <= h10; ) + f10 = ji(g10[h10], f10), h10 = -1 + h10 | 0; + g10 = f10; + h10 = (O7(), new P6().a()).Lb(new Xz().a()); + new z7().d(bs(a10, c10, g10, h10)); + } + c10 = ac(new M6().W(b10), "responses"); + c10.b() || (c10 = c10.c(), g10 = J5(Ef(), H10()), h10 = c10.i, f10 = qc(), N6(h10, f10, this.l.Mb()).sb.Cb(w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = Px(); + m10 = m10.Aa; + var t10 = bc(); + return !Nla(p10, N6(m10, t10, l10.l.Mb()).va); + }; + }(this))).U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = new Qg().Vb(t10.Aa, l10.l.Mb()).Zf(), A10 = t10.i, D10 = qc(); + return Dg(m10, new Yz().Hw(N6(A10, D10, l10.l.Mb()), w6(/* @__PURE__ */ function(C10, I10, L10, Y10) { + return function(ia) { + var pa = Dm().R; + pa = Vd(ia, pa, I10); + var La = L10.j; + J5(K7(), H10()); + pa = Ai(pa, La); + La = B6(ia.g, Dm().R).A; + La = La.b() ? null : La.c(); + var ob = Dm().In; + eb(pa, ob, La); + ia.x.Sp(Od(O7(), Y10)); + }; + }(l10, v10, p10, t10)), l10.l.Mb()).EH()); + }; + }(this, g10, a10))), h10 = Pl().Al, g10 = Zr(new $r(), g10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg(a10, h10, g10, c10)); + pna(Ry(new Sy(), a10, b10, H10(), this.l.Mb()), "responses"); + Ry(new Sy(), a10, b10, H10(), this.l.Mb()).hd(); + Zz(this.l.Mb(), a10.j, b10, "operation"); + this.$na(a10, b10); + return a10; + }; + Sz.prototype.JO = function(a10, b10, c10) { + this.tb = b10; + this.xb = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function $z() { + } + $z.prototype = new u7(); + $z.prototype.constructor = $z; + $z.prototype.a = function() { + return this; + }; + function qna(a10) { + "OAuth 2.0" === a10 ? (rna || (rna = new aA().a()), a10 = rna) : "Basic Authentication" === a10 ? (sna || (sna = new bA().a()), a10 = sna) : "Api Key" === a10 ? (tna || (tna = new cA().a()), a10 = tna) : "http" === a10 ? (una || (una = new dA().a()), a10 = una) : "openIdConnect" === a10 ? (vna || (vna = new eA().a()), a10 = vna) : a10 = new fA().UO(a10, false); + return a10; + } + $z.prototype.$classData = r8({ VUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$", { VUa: 1, f: 1 }); + var wna = void 0; + function gA() { + } + gA.prototype = new u7(); + gA.prototype.constructor = gA; + gA.prototype.a = function() { + return this; + }; + function xna(a10) { + return a10 instanceof Jx ? a10 : rla(tla(), a10); + } + function tz(a10, b10) { + return new hA().il(b10.qh, b10.Df, b10, new z7().d(xna(b10.Dl())), new z7().d(b10.lj), b10.Hp(), iA().ho); + } + function yna(a10, b10) { + return new jA().Wx(b10.qh, b10.Df, b10, new z7().d(zna(0, b10.Dl())), new z7().d(b10.lj), b10.Hp()); + } + function zna(a10, b10) { + b10 instanceof kA || (qla || (qla = new Hx().a()), a10 = Ana(new kA(), Rb(Gb().ab, H10()), b10.bG(), b10.wG(), b10.xB()), a10.iA = b10.iA, a10.Sz = b10.Sz, a10.Oo = b10.Oo, a10.Fz = b10.Fz, a10.Ko = b10.Ko, a10.Cs = b10.Cs, a10.Es = b10.Es, a10.Ro = b10.Ro, a10.Pp = b10.Pp, a10.Np = b10.Np, b10 = a10); + return b10; + } + function wz(a10, b10) { + a10 = b10.Gg(); + return Xq().Cp === a10 ? new lA().Wx(b10.qh, b10.Df, b10, new z7().d(zna(0, b10.Dl())), new z7().d(b10.lj), b10.Hp()) : new mA().Wx(b10.qh, b10.Df, b10, new z7().d(zna(0, b10.Dl())), new z7().d(b10.lj), b10.Hp()); + } + function Bna(a10, b10, c10) { + return new jA().Wx(a10, b10, c10, new z7().d(zna(0, c10.Dl())), new z7().d(c10.lj), c10.Hp()); + } + gA.prototype.$classData = r8({ oVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.package$", { oVa: 1, f: 1 }); + var Cna = void 0; + function uz() { + Cna || (Cna = new gA().a()); + return Cna; + } + function nA() { + this.lda = this.gca = this.Qba = this.T1 = this.S1 = null; + } + nA.prototype = new u7(); + nA.prototype.constructor = nA; + nA.prototype.a = function() { + this.S1 = "#/definitions/"; + this.T1 = "#/components/schemas/"; + this.Qba = "#/components/"; + this.gca = "#/parameters/"; + this.lda = "#/responses/"; + return this; + }; + function Dna(a10, b10, c10) { + c10 = c10.Gg(); + var e10 = Xq().Cp; + if (c10 === e10) + return oA(a10, b10, "responses"); + b10 = new qg().e(b10); + return Wp(b10, a10.lda); + } + function Ena(a10, b10, c10) { + return c10.zf instanceof pA ? qA(a10, b10, "parameters") : "" + a10.gca + b10; + } + function qA(a10, b10, c10) { + return "" + a10.Qba + c10 + "/" + b10; + } + function Fna(a10, b10, c10) { + if (c10 instanceof z7 && (c10 = c10.i, Xq().Cp === c10)) + return c10 = a10.T1, 0 <= (b10.length | 0) && b10.substring(0, c10.length | 0) === c10 ? b10 : "" + a10.T1 + b10; + c10 = a10.S1; + return 0 <= (b10.length | 0) && b10.substring(0, c10.length | 0) === c10 ? b10 : "" + a10.S1 + b10; + } + function oA(a10, b10, c10) { + b10 = new qg().e(b10); + return Wp(b10, "" + a10.Qba + c10 + "/"); + } + nA.prototype.$classData = r8({ pVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.package$OasDefinitions$", { pVa: 1, f: 1 }); + var Gna = void 0; + function rA() { + Gna || (Gna = new nA().a()); + return Gna; + } + function sA() { + this.N = this.vg = null; + } + sA.prototype = new u7(); + sA.prototype.constructor = sA; + function Hna(a10, b10, c10) { + a10.vg = b10; + a10.N = c10; + return a10; + } + sA.prototype.fK = function() { + var a10 = tA(uA(), Ob(), this.vg.qe().fa()), b10 = this.vg; + if (b10 instanceof vl) { + var c10 = new vA(); + c10.jv = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = Ska(); + var e10 = c10; + } else if (b10 instanceof ql) { + c10 = new wA(); + c10.hs = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = Tka(); + e10 = c10; + } else if (b10 instanceof xl) { + c10 = new xA(); + c10.Kd = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = tx(); + e10 = c10; + } else if (b10 instanceof zl) { + c10 = this.N.Bc; + var f10 = new yA(); + f10.vg = b10; + f10.p = a10; + f10.Bc = c10; + if (null === this) + throw mb(E6(), null); + f10.l = this; + f10.Xg = Uka(); + e10 = f10; + } else if (b10 instanceof Dl) { + c10 = this.N.Bc; + f10 = new zA(); + f10.vg = b10; + f10.p = a10; + f10.Bc = c10; + if (null === this) + throw mb(E6(), null); + f10.l = this; + f10.Xg = Vka(); + e10 = f10; + } else if (b10 instanceof ol) { + c10 = new MA(); + c10.Ri = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = Wka(); + e10 = c10; + } else { + if (!(b10 instanceof Bl)) + throw new Lu().e("Unsupported fragment type: " + this.vg); + c10 = new NA(); + c10.Qf = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = Xka(); + e10 = c10; + } + b10 = hd(this.vg.Y(), Bq().ae); + if (b10.b()) + var g10 = y7(); + else + b10 = b10.c(), g10 = new z7().d($g(new ah(), "usage", b10, y7())); + b10 = J5(K7(), new Ib().ha([Ina(this.vg, a10)])); + c10 = OA(); + f10 = new PA().e(c10.pi); + var h10 = new qg().e(c10.mi); + tc(h10) && QA(f10, c10.mi); + QA(f10, e10.Xg.Id); + h10 = f10.s; + var k10 = f10.ca, l10 = new rr().e(k10), m10 = wr(); + e10 = e10.jK(ar(this.vg.Y(), Gk().xc)); + g10 = g10.ua(); + var p10 = K7(); + e10 = e10.ia(g10, p10.u); + g10 = K7(); + jr(m10, a10.zb(e10.ia(b10, g10.u)), l10); + pr(h10, mr(T6(), tr(ur(), l10.s, k10), Q5().sa)); + return new RA().Ac(SA(zs(), c10.pi), f10.s); + }; + sA.prototype.$classData = r8({ IVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter", { IVa: 1, f: 1 }); + function TA() { + this.N = null; + } + TA.prototype = new u7(); + TA.prototype.constructor = TA; + function Jna() { + } + Jna.prototype = TA.prototype; + TA.prototype.DO = function(a10, b10, c10) { + this.N = c10; + return this; + }; + function Kna(a10) { + var b10 = ["title", "content"]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new R6().M("userDocumentation", b10); + c10 = ["displayName", "description", "headers", "body"]; + if (0 === (c10.length | 0)) + c10 = vd(); + else { + e10 = wd(new xd(), vd()); + f10 = 0; + for (var g10 = c10.length | 0; f10 < g10; ) + Ad(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + } + c10 = new R6().M("response", c10); + e10 = ["type", "displayName", "description", "describedBy", "settings"]; + if (0 === (e10.length | 0)) + e10 = vd(); + else { + f10 = wd(new xd(), vd()); + g10 = 0; + for (var h10 = e10.length | 0; g10 < h10; ) + Ad(f10, e10[g10]), g10 = 1 + g10 | 0; + e10 = f10.eb; + } + b10 = [b10, c10, new R6().M("securitySchema", e10)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = b10.length | 0; e10 < f10; ) + WA(c10, b10[e10]), e10 = 1 + e10 | 0; + a10.Jia(c10.eb); + } + function XA() { + this.yb = null; + this.zK = 0; + this.ad = null; + this.X_ = false; + this.$F = this.Cu = this.m = null; + this.KV = false; + this.da = this.mL = this.kfa = this.i2 = null; + } + XA.prototype = new u7(); + XA.prototype.constructor = XA; + function Lna(a10) { + var b10 = false, c10 = null, e10 = a10.Cu; + if (y7() === e10) { + O7(); + b10 = new P6().a(); + b10 = new Vh().K(new S6().a(), b10); + a10.yb.P(b10); + c10 = a10.m; + e10 = sg().HF; + var f10 = b10.j, g10 = y7(), h10 = a10.da; + c10.Gc(e10.j, f10, g10, "Syntax error, cannot create empty Union", a10.mL, Yb().qb, h10); + return b10; + } + if (e10 instanceof z7 && (b10 = true, c10 = e10, f10 = c10.i, f10 instanceof Vh)) + return f10; + if (b10) + return b10 = c10.i, O7(), c10 = new P6().a(), c10 = new Vh().K(new S6().a(), c10), a10.yb.P(c10), a10 = xn().Le, b10 = J5(K7(), new Ib().ha([b10])), Bf(c10, a10, b10); + throw new x7().d(e10); + } + function Mna(a10, b10) { + if (b10 instanceof th) { + var c10 = false, e10 = null, f10 = a10.Cu; + if (y7() === f10) + return b10; + if (f10 instanceof z7 && (c10 = true, e10 = f10, a10 = e10.i, a10 instanceof th) || c10 && (a10 = e10.i, a10 instanceof pi)) + return b10 = YA(b10), c10 = uh().Ff, Vd(b10, c10, a10); + if (c10) + return ZA(b10, e10.i); + throw new x7().d(f10); + } + if (b10 instanceof pi) { + c10 = false; + e10 = null; + a10 = a10.Cu; + if (y7() === a10) + return b10; + if (a10 instanceof z7 && (c10 = true, e10 = a10, f10 = e10.i, f10 instanceof th) || c10 && (f10 = e10.i, f10 instanceof pi)) + return c10 = uh().Ff, Vd(b10, c10, f10); + if (c10) + return c10 = e10.i, ZA(b10.dI(), c10); + throw new x7().d(a10); + } + throw new x7().d(b10); + } + function $A(a10, b10, c10, e10, f10) { + var g10 = new XA(); + g10.yb = a10; + g10.zK = b10; + g10.ad = c10; + g10.X_ = e10; + g10.m = f10; + g10.Cu = y7(); + g10.$F = ""; + g10.KV = false; + if (c10.b()) + a10 = y7(); + else { + a10 = c10.c(); + if (a10 instanceof Es) + a10 = a10.i.re(); + else if (a10 instanceof Cs) + a10 = a10.re(); + else if (!(a10 instanceof xt)) + throw new x7().d(a10); + a10 = new z7().d(a10); + } + g10.i2 = a10; + a10 = g10.i2; + a: { + if (a10 instanceof z7 && (a10 = a10.i, null !== a10)) { + ae4(); + b10 = a10.da; + b10 = new z7().d(new be4().jj(ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg)))); + c10 = new je4().e(a10.da.Rf).Bu(); + a10 = b10; + b10 = c10; + break a; + } + a10 = y7(); + b10 = y7(); + } + g10.kfa = new R6().M(a10, b10); + g10.mL = g10.kfa.ma(); + g10.da = g10.kfa.ya(); + return g10; + } + function aB(a10, b10) { + if (b10.b()) + return Nna(a10), new bB().WO(a10.Cu, J5(K7(), H10())); + var c10 = b10.ga(); + c10 = null === c10 ? 0 : c10.r; + switch (c10) { + case 41: + return Nna(a10), new bB().WO(a10.Cu, b10.ta()); + case 40: + return Nna(a10), b10 = aB($A(a10.yb, 1 + a10.zK | 0, a10.ad, a10.X_, a10.m), b10.ta()), Ona(a10, b10.Hu), aB(a10, b10.GP); + case 124: + if ("" === a10.$F && a10.Cu.b()) { + c10 = a10.m; + var e10 = sg().HF, f10 = y7(), g10 = a10.da; + c10.Gc(e10.j, "", f10, "Syntax error, cannot parse Union with empty values", a10.mL, Yb().qb, g10); + } + Nna(a10); + a10.Cu = new z7().d(Lna(a10)); + b10 = aB($A(a10.yb, 1 + a10.zK | 0, a10.ad, a10.X_, a10.m), b10.ta()); + Ona(a10, b10.Hu); + return aB(a10, b10.GP); + case 91: + return Nna(a10), a10.KV && (c10 = a10.m, e10 = sg().HF, f10 = y7(), g10 = a10.da, c10.Gc(e10.j, "", f10, "Syntax error, duplicated [", a10.mL, Yb().qb, g10)), a10.KV = true, aB(a10, b10.ta()); + case 93: + return a10.KV || (c10 = a10.m, e10 = sg().HF, f10 = y7(), g10 = a10.da, c10.Gc(e10.j, "", f10, "Syntax error, Not matching ]", a10.mL, Yb().qb, g10)), a10.KV = false, a10.Cu = new z7().d(Pna(a10)), aB(a10, b10.ta()); + default: + return a10.$F = "" + a10.$F + gc(c10), aB(a10, b10.ta()); + } + } + function Ona(a10, b10) { + var c10 = false, e10 = null; + if (y7() !== b10) { + if (b10 instanceof z7) { + c10 = true; + e10 = b10; + var f10 = e10.i; + if (f10 instanceof th && cB(a10, f10)) { + c10 = false; + e10 = a10.Cu; + if (y7() === e10) { + a10.Cu = new z7().d(f10); + return; + } + if (e10 instanceof z7 && (c10 = true, b10 = e10.i, b10 instanceof Vh)) { + a10 = B6(b10.aa, xn().Le); + c10 = K7(); + a10 = a10.yg(f10, c10.u); + f10 = xn().Le; + Zd(b10, f10, a10); + return; + } + if (c10) { + a10.Cu = new z7().d(Mna(a10, f10)); + return; + } + throw new x7().d(e10); + } + } + if (c10) + if (f10 = e10.i, b10 = a10.Cu, y7() === b10) + a10.Cu = new z7().d(f10); + else { + if (b10 instanceof z7 && (b10 = b10.i, b10 instanceof Vh)) { + if (f10 instanceof Vh) { + a10 = B6(b10.aa, xn().Le); + f10 = B6(f10.aa, xn().Le); + c10 = K7(); + a10 = a10.ia( + f10, + c10.u + ); + it2(b10.aa, xn().Le); + Ui(b10.aa, xn().Le, Zr(new $r(), a10, new P6().a()), (O7(), new P6().a())); + return; + } + a10 = B6(b10.aa, xn().Le); + f10 = J5(K7(), new Ib().ha([f10])); + c10 = K7(); + a10 = a10.ia(f10, c10.u); + it2(b10.aa, xn().Le); + Ui(b10.aa, xn().Le, Zr(new $r(), a10, new P6().a()), (O7(), new P6().a())); + return; + } + b10 = a10.m; + c10 = sg().HF; + e10 = f10.j; + var g10 = y7(), h10 = a10.da; + b10.Gc(c10.j, e10, g10, "Error parsing type expression, cannot accept type " + f10, a10.mL, Yb().qb, h10); + new z7().d(f10); + } + else + throw new x7().d(b10); + } + } + XA.prototype.AP = function(a10) { + var b10 = Iu(ua(), Bx(ua(), a10, "\\s*", "")); + b10 = aB(this, new dB().BB(b10)).Hu; + if (b10 instanceof z7) { + b10 = b10.i; + if (b10 instanceof th ? cB(this, b10) : b10 instanceof pi && cB(this, b10)) { + var c10 = this.m, e10 = sg().HF, f10 = b10.j, g10 = y7(), h10 = this.da; + c10.Gc(e10.j, f10, g10, "Syntax error, generating empty array", this.mL, Yb().qb, h10); + } + Qna(this, b10); + b10.fa().Lb(new eB().e(a10)); + a10 = this.ad; + a10.b() || (a10 = a10.c(), b10.fa().Sp(Od(O7(), a10))); + return new z7().d(b10); + } + if (y7() === b10) + return y7(); + throw new x7().d(b10); + }; + function Pna(a10) { + O7(); + var b10 = new P6().a(); + b10 = new th().K(new S6().a(), b10); + a10.yb.P(b10); + var c10 = false, e10 = null, f10 = a10.Cu; + if (y7() === f10) + return b10; + if (f10 instanceof z7 && (c10 = true, e10 = f10, a10 = e10.i, a10 instanceof th) || c10 && (a10 = e10.i, a10 instanceof pi)) + return O7(), c10 = new P6().a(), c10 = new pi().K(new S6().a(), c10), b10 = Rd(c10, b10.j), c10 = uh().Ff, Vd(b10, c10, a10); + if (c10) + return ZA(b10, e10.i); + throw new x7().d(f10); + } + function Nna(a10) { + if ("" !== a10.$F) { + var b10 = a10.$F; + if ("nil" === b10) + O7(), b10 = new P6().a(), b10 = new Th().K(new S6().a(), b10); + else if ("any" === b10) { + O7(); + b10 = new P6().a(); + var c10 = new S6().a(); + b10 = new vh().K(c10, b10); + } else if ("file" === b10) + O7(), b10 = new P6().a(), b10 = new Wh().K(new S6().a(), b10); + else if ("object" === b10) + O7(), b10 = new P6().a(), b10 = new Hh().K(new S6().a(), b10); + else if ("array" === b10) + O7(), b10 = new P6().a(), b10 = new th().K(new S6().a(), b10); + else if ("string" === b10 || "integer" === b10 || "number" === b10 || "boolean" === b10 || "datetime" === b10 || "datetime-only" === b10 || "time-only" === b10 || "date-only" === b10) { + O7(); + b10 = new P6().a(); + b10 = new Mh().K(new S6().a(), b10); + c10 = yca(Uh(), a10.$F); + var e10 = Fg().af; + b10 = eb(b10, e10, c10); + } else + c10 = fB(a10.m.Dl(), b10, Zs(), y7()), c10 instanceof z7 ? b10 = c10.i.Ug(b10, (O7(), new P6().a())) : (Rna(), c10 = a10.i2, c10 = Od(O7(), c10.b() ? T6().nd : c10.c()), e10 = y7(), c10 = wi(new vi(), new S6().a(), c10, b10, e10, y7(), true), O7(), e10 = new P6().a(), c10 = Sd(c10, b10, e10), Jb(c10, a10.m), a10.yb.P(c10), a10.X_ || (e10 = a10.i2, e10 = e10.b() ? T6().nd : e10.c(), lB(c10, b10, e10, a10.m)), b10 = c10); + Vb().Ia(b10.j).b() && (c10 = B6(b10.Y(), qf().R).A, c10 instanceof z7 && "schema" === c10.i ? (c10 = "schema-" + a10.zK, O7(), e10 = new P6().a(), Sd(b10, c10, e10), a10.yb.P(b10), O7(), c10 = new P6().a(), Sd(b10, "schema", c10)) : y7() === c10 ? (c10 = "scalar-expression-" + a10.zK, O7(), e10 = new P6().a(), Sd(b10, c10, e10), a10.yb.P(b10), c10 = B6(b10.Y(), qf().R), it2(c10.l, c10.Lc)) : a10.yb.P(b10), a10.zK = 1 + a10.zK | 0); + a10.$F = ""; + Ona(a10, new z7().d(b10)); + } + } + function cB(a10, b10) { + var c10 = false, e10 = null, f10 = false, g10 = null; + if (b10 instanceof th) { + c10 = true; + e10 = b10; + if (Za(e10).na()) { + var h10 = e10, k10 = J5(K7(), H10()); + h10 = Az(h10, k10) instanceof mB; + } else + h10 = false; + if (h10) + return f10 = e10, g10 = J5(K7(), H10()), cB(a10, Az(f10, g10)); + } + return c10 && B6(e10.aa, qf().xd).Da() ? false : c10 ? Vb().Ia(B6(e10.aa, uh().Ff)).b() : b10 instanceof pi && (f10 = true, g10 = b10, Za(g10).na() ? (b10 = g10, c10 = J5(K7(), H10()), b10 = Az(b10, c10) instanceof mB) : b10 = false, b10) ? (f10 = g10, g10 = J5(K7(), H10()), cB(a10, Az(f10, g10))) : f10 ? cB(a10, B6(g10.aa, uh().Ff)) : false; + } + function Qna(a10, b10) { + if (b10 instanceof Vh) { + var c10 = new Uv().a(); + B6(b10.aa, xn().Le).U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (h10 instanceof th) { + var k10 = B6(h10.aa, qf().R).A; + if (y7() === k10) { + f10.fc = 1 + f10.fc | 0; + k10 = "array_" + f10.fc; + O7(); + var l10 = new P6().a(); + Sd(h10, k10, l10); + } + return Sna(h10, g10.j, J5(K7(), H10())); + } + }; + }(a10, c10, b10))); + } + } + XA.prototype.$classData = r8({ hWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlTypeExpressionParser", { hWa: 1, f: 1 }); + function nB() { + } + nB.prototype = new u7(); + nB.prototype.constructor = nB; + nB.prototype.a = function() { + return this; + }; + nB.prototype.$classData = r8({ yWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.ValidationResolutionPipeline$", { yWa: 1, f: 1 }); + var Tna = void 0; + function oB() { + this.l = this.Fe = null; + } + oB.prototype = new u7(); + oB.prototype.constructor = oB; + function Una() { + } + Una.prototype = oB.prototype; + oB.prototype.nla = function(a10, b10) { + this.Fe = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + }; + function Vna(a10) { + var b10 = Ab(a10.Fe.fa(), q5(Qu)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.ad)); + b10 = b10.ua(); + b10 = Jc(b10, new Wna()); + b10 = b10 instanceof z7 ? b10.i.i : a10.fja(); + return new pB().vi(a10.A2, Xna(a10, b10)); + } + function Xna(a10, b10) { + var c10 = b10.hb().gb; + return Q5().sa === c10 ? (c10 = qc(), b10 = N6(b10, c10, a10.l.ob).sb, a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = Xna(e10, f10.i); + return new pB().vi(f10.Aa.t(), g10); + }; + }(a10)), c10 = rw(), b10.ka(a10, c10.sc)) : Q5().cd === c10 ? (c10 = lc(), b10 = N6(b10, c10, a10.l.ob), a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return Xna(e10, f10); + }; + }(a10)), c10 = K7(), b10.bd(a10, c10.u)) : H10(); + } + function qB() { + this.Em = null; + this.pn = false; + this.m = this.ob = null; + } + qB.prototype = new u7(); + qB.prototype.constructor = qB; + function Yna() { + } + Yna.prototype = qB.prototype; + function Zna(a10) { + if (a10 instanceof rf) { + a10 = a10.fa(); + var b10 = a10.hf; + Ef(); + var c10 = Jf(new Kf(), new Lf().a()); + for (b10 = b10.Dc; !b10.b(); ) { + var e10 = b10.ga(); + false !== !(e10 instanceof Xz) && Of(c10, e10); + b10 = b10.ta(); + } + a10.hf = c10.eb; + } + } + function $na(a10, b10, c10, e10, f10, g10, h10) { + e10 = e10.wb; + var k10 = w6(/* @__PURE__ */ function() { + return function(m10) { + return m10.r; + }; + }(a10)), l10 = K7(); + e10 = e10.ka(k10, l10.u).xg(); + f10.wb.U(w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + C10 = C10.r; + if (!p10.Ha(C10)) + return C10 = ih(new jh(), C10, new P6().a()), m10.pn && C10.x.Lb(new rB().Uq(t10, v10)), ig(A10, D10, C10); + }; + }(a10, e10, g10, h10, b10, c10))); + } + function aoa(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = ag(); + null !== e10 && e10 === l10 ? l10 = true : (l10 = Ud(), l10 = null !== e10 && e10 === l10); + l10 ? l10 = true : (l10 = tea(), l10 = null !== e10 && e10 === l10); + l10 ? l10 = true : (l10 = im(), l10 = null !== e10 && e10 === l10); + var m10 = Ut(), p10 = f10.wb, t10 = w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + var I10 = hd(C10.Y(), D10.la); + I10.b() ? C10 = y7() : (I10 = I10.c().r.r.r, C10 = new z7().d(new R6().M(I10, C10))); + return C10.ua(); + }; + }(a10, e10)), v10 = K7(); + m10 = Rb(m10, p10.bd(t10, v10.u)); + f10 = f10.wb.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + if (Rk(C10)) + return hd(C10.Y(), D10.la).b(); + throw new x7().d(C10); + }; + }(a10, e10))); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10)); + f10 = new qd().d(f10); + g10.wb.U(w6(/* @__PURE__ */ function(A10, D10, C10, I10, L10, Y10, ia, pa, La) { + return function(ob) { + if (Rk(ob)) { + var zb = new sB().a(), Zb = hd(ob.Y(), D10.la); + if (Zb instanceof z7) + return Zb = Zb.i.r.r.r, ob = boa(A10, I10, L10, C10.Ja(Zb), ob, Y10, ia, pa, zb), C10.Xh(new R6().M(Zb, ob)); + La.oa = new z7().d(boa(A10, I10, L10, La.oa, ob, Y10, ia, pa, zb)); + } else + throw new x7().d(ob); + }; + }(a10, e10, m10, b10, l10, h10, k10, c10, f10))); + a10 = m10.Ur().ke(); + e10 = f10.oa.ua(); + g10 = K7(); + a10 = a10.ia(e10, g10.u); + Zd(b10, c10, a10); + } + function coa(a10, b10, c10) { + c10 = Ab(c10.fa(), q5(Rc)); + c10 = (c10.b() ? new tB().hk(J5(Gb().Qg, H10())) : c10.c()).Xb; + var e10 = Ab(b10.fa(), q5(Rc)); + e10 = (e10.b() ? new tB().hk(J5(Gb().Qg, H10())) : e10.c()).Xb; + var f10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.ma(); + }; + }(a10)), g10 = qe2(); + g10 = re4(g10); + f10 = Jd(c10, f10, g10); + g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.ma(); + }; + }(a10)); + var h10 = qe2(); + h10 = re4(h10); + f10.z1(Jd(e10, g10, h10)).U(w6(/* @__PURE__ */ function(k10, l10, m10, p10) { + return function(t10) { + var v10 = l10.Fb(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + pa = pa.ma(); + return null === pa ? null === ia : ra(pa, ia); + }; + }(k10, t10))); + v10.b() ? v10 = y7() : (v10 = v10.c(), v10 = new z7().d(v10.ya().ma())); + var A10 = v10.c(); + v10 = m10.Fb(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + pa = pa.ma(); + return null === pa ? null === ia : ra(pa, ia); + }; + }(k10, t10))); + v10.b() ? v10 = y7() : (v10 = v10.c(), v10 = new z7().d(v10.ya().ma())); + var D10 = v10.c(); + if (A10 !== D10) { + v10 = k10.Aw(); + var C10 = dc().Fh; + t10 = "Conflicting urls for alias '" + t10 + "' and libraries: '" + A10 + "' - '" + D10 + "'"; + A10 = Lc(p10); + A10 = A10.b() ? p10.j : A10.c(); + D10 = y7(); + var I10 = y7(), L10 = y7(); + v10.Gc(C10.j, t10, D10, A10, I10, Yb().qb, L10); + } + }; + }(a10, c10, e10, b10))); + a10 = c10.OW(e10); + if (tc(a10)) { + c10 = b10.fa(); + f10 = c10.hf; + Ef(); + e10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) + g10 = f10.ga(), false !== !(g10 instanceof tB) && Of(e10, g10), f10 = f10.ta(); + c10.hf = e10.eb; + b10.fa().Lb(new tB().hk(a10)); + } + } + qB.prototype.rs = function(a10, b10, c10) { + this.Em = a10; + this.pn = b10; + this.ob = c10; + if (qk().h(a10)) { + a10 = H10(); + K7(); + pj(); + b10 = new Lf().a(); + b10 = new Aq().zo("", b10.ua(), new Mq().a(), Nq(), y7()); + c10 = new z7().d(c10); + var e10 = y7(), f10 = y7(), g10 = iA().ho; + c10 = new uB().il("", a10, b10, e10, f10, c10, g10); + } else + a10 = H10(), K7(), pj(), b10 = new Lf().a(), b10 = new Aq().zo("", b10.ua(), new Mq().a(), Nq(), y7()), c10 = new z7().d(c10), e10 = y7(), f10 = y7(), g10 = iA().ho, c10 = new hA().il("", a10, b10, e10, f10, c10, g10); + this.m = c10; + return this; + }; + function doa(a10, b10, c10, e10) { + e10.gA.Ha(c10.j) || (e10.gA.Tm(c10.j), c10.Y().vb.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.ya(); + var p10 = m10.ba; + a: + if (yc().h(p10)) + eoa(g10, h10, m10, l10.r); + else { + if (p10 instanceof ht2 && (m10 = new z7().d(p10.Fe), vB(m10.i))) { + m10 = l10.r.wb; + l10 = new foa(); + p10 = K7(); + m10.ec(l10, p10.u).U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + doa(t10, v10, D10, A10); + }; + }(f10, g10, k10))); + break a; + } + vB(p10) && doa(f10, g10, l10.r, k10); + } + } else + throw new x7().d(l10); + }; + }(a10, b10, c10, e10)))); + } + function goa(a10, b10, c10, e10, f10) { + var g10 = ar(b10.Y(), Gk().xc), h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.j; + }; + }(a10)), k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = J5(K7(), new Ib().ha([b10.j, c10.j])); + k10 = K7(); + g10 = g10.ia(h10, k10.u); + c10 = ar(c10.Y(), Gk().xc); + h10 = new hoa(); + k10 = K7(); + h10 = c10.ec(h10, k10.u); + c10 = ar(b10.Y(), Gk().xc); + g10 = h10.Cb(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return !m10.Ha(p10.j); + }; + }(a10, g10))); + a10 = w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + t10.fa().Lb(new rB().Uq(m10, p10)); + return t10; + }; + }(a10, e10, f10)); + e10 = K7(); + a10 = g10.ka(a10, e10.u); + e10 = K7(); + a10 = c10.ia(a10, e10.u); + e10 = Gk().xc; + Bf(b10, e10, a10); + } + function ioa(a10, b10, c10, e10, f10, g10) { + var h10 = b10.j, k10 = c10.j, l10 = H10(); + h10 = ji(h10, ji(k10, l10)); + joa(g10, h10) && (yi(g10.gA, h10), Zna(b10), h10 = c10.Y().vb, k10 = mz(), k10 = Ua(k10), l10 = Id().u, Jd(h10, k10, l10).Cb(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + t10 = t10.Lc; + var v10 = nc().bb; + (null === v10 ? null === t10 : v10.h(t10)) ? v10 = true : (v10 = Bq().ae, v10 = null === v10 ? null === t10 : v10.h(t10)); + v10 ? t10 = false : (v10 = wB().mc, t10 = !((null === v10 ? null === t10 : v10.h(t10)) && p10 && p10.$classData && p10.$classData.ge.DY)); + return t10; + }; + }(a10, b10))).U(w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.Lc, L10 = C10.r, Y10 = false, ia = false, pa = null, La = hd(p10.Y(), I10); + if (y7() === La && (Y10 = true, m10.LP.C8(I10))) + return L10 = koa(m10, p10.j, L10.r, t10), m10.pn && L10.fa().Lb(new rB().Uq(v10, A10)), Vd(p10, I10, L10); + if (Y10) { + var ob = Fg().af; + ob = (null === I10 ? null === ob : I10.h(ob)) ? wh(L10.x, q5(loa)) : false; + } else + ob = false; + if (!ob) + if (Y10) + C10 = L10.r, lb(C10) ? I10 = C10.j : (I10 = I10.r, I10 = V5(W5(), I10)), C10 = m10.Aw(), Y10 = dc().Fh, ia = "Property '" + I10 + "' of type '" + xB(la(L10.r)) + "' is not allowed to be overriden or added in overlays", yB(C10, Y10, I10, ia, L10.x); + else { + if (La instanceof z7 && (ia = true, pa = La, Y10 = pa.i, m10.LP.via(I10))) { + ia = I10.ba; + if (ia instanceof zB) + return m10.pn && L10.r.fa().Lb(new rB().Uq(v10, A10)), Vd(p10, I10, L10.r); + if (ia instanceof ht2) { + C10 = new z7().d(ia.Fe).i; + Y10 = Y10.r.r; + L10 = L10.r; + C10 instanceof zB ? $na(m10, p10, I10, Y10, L10, v10, A10) : C10 && C10.$classData && C10.$classData.ge.Oi ? aoa(m10, p10, I10, C10, Y10, L10, v10, A10) : vB(C10) ? m10.Spa(p10, I10, L10, v10, A10) : (L10 = m10.Aw(), I10 = dc().Fh, Y10 = y7(), C10 = "Cannot merge '" + C10 + "': not a KeyField nor a Scalar", ia = Ab(p10.fa(), q5(jd)), pa = p10.Ib(), L10.Gc(I10.j, v10, Y10, C10, ia, Yb().qb, pa)); + return; + } + if (dl() === ia) { + C10 = Y10.r.r; + L10 = L10.r; + a: { + if (C10 instanceof el && L10 instanceof el && (Y10 = la(C10), ia = la(L10), Y10 === ia)) { + moa(noa(), C10, L10); + break a; + } + m10.pn && L10.fa().Lb(new rB().Uq(v10, A10)); + Vd(p10, I10, L10); + } + return; + } + if (pa = AB(ia)) + La = Y10.r.r, pa = C10.r.r, La instanceof rf && pa instanceof rf ? (La = la(La), pa = la(pa), pa = La !== pa) : pa = false; + if (pa) + return L10 = C10.r.r, O7(), C10 = new rB().Uq(D10.j, A10), C10 = new P6().a().Lb(C10), Rg(p10, I10, L10, C10); + if (vB(ia)) + return ioa(m10, Y10.r.r, C10.r.r, v10, A10, t10); + C10 = m10.Aw(); + Y10 = dc().Fh; + ia = ic(I10.r); + pa = y7(); + I10 = "Cannot merge '" + I10.ba + "':not a (Scalar|Array|Object)"; + La = Ab(L10.r.fa(), q5(jd)); + L10 = Ab(L10.r.fa(), q5(Bb)); + L10.b() ? L10 = y7() : (L10 = L10.c(), L10 = new z7().d(L10.da)); + C10.Gc(Y10.j, ia, pa, I10, La, Yb().qb, L10); + return; + } + if (ia) + Y10 = pa.i, Y10.r.r.t() !== C10.r.r.t() && (C10 = m10.Aw(), ia = dc().Fh, I10 = ic(I10.r), Y10 = "Property '" + ic(Y10.Lc.r) + "' in '" + xB(la(p10)) + "' is not allowed to be overriden or added in overlays", yB(C10, ia, I10, Y10, L10.x)); + else + throw new x7().d(La); + } + } else + throw new x7().d(C10); + }; + }(a10, b10, g10, e10, f10, c10)))); + return b10; + } + function boa(a10, b10, c10, e10, f10, g10, h10, k10, l10) { + if (e10 instanceof z7) { + var m10 = e10.i; + if (!c10) + return ioa(a10, m10, f10.ub(b10.j, lt2()), g10, h10, l10); + } + return y7() !== e10 || a10.LP.C8(k10) ? koa(a10, b10.j, f10, l10) : (a10 = a10.Aw(), b10 = dc().Fh, c10 = f10.j, e10 = "Property of key '" + f10.j + "' of class '" + xB(la(f10)) + "' is not allowed to be overriden or added in overlays", yB(a10, b10, c10, e10, f10.fa()), f10); + } + function ooa(a10, b10) { + B6(b10.qe().g, Qm().Yp).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + c10.pn || it2(e10.g, nc().Ni()); + B6(e10.g, Jl().bk).U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return f10.pn ? void 0 : it2(g10.g, nc().Ni()); + }; + }(c10))); + }; + }(a10))); + return b10; + } + function poa(a10, b10, c10, e10, f10, g10) { + var h10 = ula(wla(), ar(b10.Y(), Gk().Ic), new z7().d(a10.m)), k10 = new sB().a(); + ar(c10.Y(), Gk().Ic).U(w6(/* @__PURE__ */ function(l10, m10, p10, t10, v10, A10) { + return function(D10) { + var C10 = m10.y$(D10); + if (C10 instanceof z7) + return ioa(l10, C10.i, D10, p10, t10, v10); + if (y7() === C10) + return D10 = koa(l10, A10.j + "#/declarations", D10, v10), l10.pn && D10.fa().Lb(new rB().Uq(p10, t10)), $h(m10, D10); + throw new x7().d(C10); + }; + }(a10, h10, f10, g10, k10, b10))); + c10 = h10.et(); + f10 = new sB().a(); + c10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + doa(l10, m10, t10, p10); + }; + }(a10, e10, f10))); + a10 = Af().Ic; + Bf(b10, a10, c10); + } + function koa(a10, b10, c10, e10) { + if (!e10.gA.Ha(b10)) { + e10.gA.Tm(b10); + if (c10 instanceof $r) { + var f10 = c10.wb; + a10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + return koa(g10, h10, l10, k10); + }; + }(a10, b10, e10)); + b10 = K7(); + return Zr(new $r(), f10.ka(a10, b10.u), c10.x); + } + if (c10 instanceof el) + return js(ks(), b10, c10); + Rk(c10) && (c10.ub(b10, lt2()), c10.Y().vb.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + if (null !== l10) + l10 = l10.ya(), koa(g10, h10.j, l10.r, k10); + else + throw new x7().d(l10); + }; + }(a10, c10, e10)))); + } + return c10; + } + function qoa(a10, b10, c10) { + if (c10 instanceof BB) { + var e10 = ar(c10.Y(), wB().mc); + e10 = roa(c10, e10); + if (e10 instanceof z7) + return c10 = e10.i, Dg(b10, c10), qoa(a10, b10, c10); + if (y7() === e10 && Vb().Ia(ar(c10.Y(), wB().mc)).na()) { + a10 = a10.Aw(); + b10 = Mo().fZ; + e10 = new z7().d(ar(c10.Y(), wB().mc)); + var f10 = "BaseUnit '" + ar(c10.Y(), wB().mc) + "' not found in references.", g10 = c10.j, h10 = Ab(c10.fa(), q5(jd)); + c10 = Lc(c10); + a10.Gc(b10.j, g10, e10, f10, h10, Yb().qb, c10); + } else + a10 = a10.Aw(), b10 = Mo().fZ, e10 = new z7().d(ar(c10.Y(), wB().mc)), f10 = "Missing extend property for model '" + c10.j + "'.", g10 = c10.j, h10 = Ab(c10.fa(), q5(jd)), c10 = Lc(c10), a10.Gc( + b10.j, + g10, + e10, + f10, + h10, + Yb().qb, + c10 + ); + return H10(); + } + return soa(b10).ua(); + } + function toa(a10, b10, c10) { + Ef(); + var e10 = [c10]; + if (0 === (e10.length | 0)) + e10 = Jf(new Kf(), new Lf().a()).eb; + else { + for (var f10 = Jf(new Kf(), new Lf().a()), g10 = 0, h10 = e10.length | 0; g10 < h10; ) + Of(f10, e10[g10]), g10 = 1 + g10 | 0; + e10 = f10.eb; + } + e10 = qoa(a10, e10, c10); + if (e10 instanceof Vt && (c10 = e10.Wn, g10 = e10.Nf, c10 instanceof mf)) { + e10 = uoa(new CB(), a10.Em, a10.pn, true, J5(DB(), H10()), a10.m); + h10 = new EB().mt(a10.pn, a10.m); + h10.ye(c10); + f10 = c10.qe(); + for (var k10 = g10; !k10.b(); ) { + var l10 = k10.ga(); + if (l10 instanceof BB) { + h10.ye(l10); + var m10 = voa(a10, c10.j + "#", l10.j + "#"); + poa(a10, c10, l10, m10, l10.j, FB(GB(), l10.j, b10)); + coa(a10, c10, l10); + goa(a10, c10, l10, l10.j, FB(GB(), l10.j, b10)); + } else + throw new x7().d(l10); + k10 = k10.ta(); + } + for (e10.ye(c10); !g10.b(); ) { + h10 = g10.ga(); + if (h10 instanceof BB) + k10 = voa(a10, c10.j + "#", h10.j + "#"), ioa(a10, f10, ar(h10.Y(), Gk().nb), h10.j, FB(GB(), h10.j, b10), new sB().a()), doa(a10, k10, f10, new sB().a()), e10.ye(c10); + else + throw new x7().d(h10); + g10 = g10.ta(); + } + return ooa(a10, c10); + } + return b10; + } + function woa() { + } + woa.prototype = new u7(); + woa.prototype.constructor = woa; + function xoa() { + } + xoa.prototype = woa.prototype; + function HB() { + this.Gna = this.Fqa = null; + } + HB.prototype = new u7(); + HB.prototype.constructor = HB; + HB.prototype.a = function() { + yoa = this; + this.Fqa = new IB().a(); + this.Gna = new JB().a(); + return this; + }; + HB.prototype.$classData = r8({ qXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.MergingRestrictions$", { qXa: 1, f: 1 }); + var yoa = void 0; + function zoa() { + yoa || (yoa = new HB().a()); + return yoa; + } + function KB() { + this.X = this.Cp = this.QF = this.ew = this.TF = this.UF = this.ct = this.Vp = this.Pda = null; + } + KB.prototype = new u7(); + KB.prototype.constructor = KB; + KB.prototype.a = function() { + Aoa = this; + this.Pda = LB(MB(), Du().$, "apiContract:Parameter", "raml-shapes:schema", "sh:minCount", "1", "RAML Type information is mandatory for parameters", "Schema/type information required for Parameter objects"); + var a10 = K7(), b10 = [ + LB(MB(), Du().$, "doc:DomainElement", "core:name", "sh:datatype", "xsd:string", "Title and names must be string", "Names must be string"), + LB(MB(), Du().$, "doc:DomainElement", "core:description", "sh:datatype", "xsd:string", "Descriptions must be strings", "Description must be strings"), + LB(MB(), Du().$, "apiContract:WebAPI", "core:name", "sh:minCount", "1", "API title is mandatory", "Info object 'title' must be a single value"), + LB(MB(), Du().$, "apiContract:WebAPI", "apiContract:scheme", "sh:datatype", "xsd:string", "API BaseUri scheme information must be a string", "Swagger object 'schemes' must be a string"), + LB(MB(), Du().$, "apiContract:WebAPI", "apiContract:scheme", "sh:datatype", "xsd:string", "API BaseUri scheme information must be a string", "Swagger object 'schemes' must be a string"), + LB( + MB(), + Du().$, + "apiContract:WebAPI", + "apiContract:accepts", + "sh:datatype", + "xsd:string", + "Default media types must contain strings", + "Field 'consumes' must contain strings" + ), + LB(MB(), Du().$, "apiContract:WebAPI", "apiContract:accepts", "sh:pattern", "^(([-\\w]+|[*]{1})\\/([-+.\\w]+|[*]{1}))(\\s*;\\s*\\w+=[-+\\w.]+)*$", "Default media types must be valid", "Field 'produces' must be valid"), + LB(MB(), Du().$, "apiContract:WebAPI", "core:mediaType", "sh:datatype", "xsd:string", "Default media types must be string", "Field 'produces' must contain strings"), + LB(MB(), Du().$, "apiContract:WebAPI", "core:version", "sh:datatype", "xsd:string", "API version must be a string", "Info object 'version' must be string"), + LB(MB(), Du().$, "apiContract:WebAPI", "core:termsOfService", "sh:datatype", "xsd:string", "API terms of service must be a string", "Info object 'termsOfService' must be string"), + LB(MB(), Du().$, "core:Organization", "core:email", "sh:datatype", "xsd:string", "API provider email must be a string", "Contact object 'email' must be a string"), + LB( + MB(), + Du().$, + "apiContract:EndPoint", + "apiContract:path", + "sh:datatype", + "xsd:string", + "Resource path must be a string", + "PathItem object path must be a string" + ), + LB(MB(), Du().$, "apiContract:EndPoint", "apiContract:path", "sh:pattern", "^/", "Resource path must start with a '/'", "PathItem path must start with a '/'"), + LB(MB(), Du().$, "apiContract:Operation", "apiContract:method", "sh:in", "get,put,post,delete,options,head,patch,connect,trace", "Unknown method type", "Unknown Operation method"), + LB( + MB(), + Du().$, + "apiContract:Operation", + "apiContract:guiSummary", + "sh:datatype", + "xsd:string", + "Methods' summary information must be a string", + "Methods' summary information must be a string" + ), + LB(MB(), Du().$, "apiContract:Operation", "doc:deprecated", "sh:datatype", "xsd:boolean", "Methods' deprecated must be a boolean", "Methods' deprecated must be a boolean"), + LB(MB(), Du().$, "apiContract:Operation", "apiContract:scheme", "sh:datatype", "xsd:string", "Protocols must contain strings", "Schemes must contain strings"), + LB( + MB(), + Du().$, + "apiContract:Operation", + "apiContract:accepts", + "sh:datatype", + "xsd:string", + "Method default media types consumed must be strings", + "Operation object 'consumes' must be strings" + ), + LB(MB(), Du().$, "apiContract:Response", "apiContract:statusCode", "sh:datatype", "xsd:string", "Status code for a Response must be a string", "Status code for a Response object must be a string"), + LB(MB(), Du().$, "apiContract:Parameter", "core:name", "sh:minCount", "1", "Parameter information must have a name", "Parameter object must have a name property"), + LB( + MB(), + Du().$, + "apiContract:Parameter", + "apiContract:required", + "sh:datatype", + "xsd:boolean", + "Information about required parameters must be a boolean value", + "Required property of a Parameter object must be boolean" + ), + LB(MB(), Du().$, "apiContract:Parameter", "apiContract:binding", "sh:datatype", "xsd:string", "Information about the binding of the parameter is mandatory", "'in' property of a Parameter object must be a string"), + LB( + MB(), + Du().$, + "apiContract:Parameter", + "apiContract:binding", + "sh:minCount", + "1", + "Binding information for a parameter is mandatory", + "'in' property of a Parameter object is mandatory" + ), + LB(MB(), Du().$, "apiContract:Parameter", "apiContract:binding", "sh:in", "query,path,header,uri,cookie", "Binding information for a parameter with an invalid value", "'in' property of a parameter with an invalid value"), + LB(MB(), Du().$, "apiContract:Payload", "core:mediaType", "sh:datatype", "xsd:string", "Method default media types must be strings", "Operation object 'produces' must be strings"), + NB( + MB(), + "amf-parser:xml-wrapped-scalar", + "XML property 'wrapped' must be false for scalar types", + Ob().$, + "raml-shapes:ScalarShape", + "sh:xmlSerialization", + "PropertyShape", + "sh:path", + "raml-shapes:xmlWrappedScalar", + "0", + "XML property 'wrapped' must be false for scalar types", + "XML property 'wrapped' must be false for scalar types" + ), + NB( + MB(), + "amf-parser:xml-non-scalar-attribute", + "XML property 'attribute' must be false for non-scalar types", + Ob().$, + "raml-shapes:Shape", + "sh:xmlSerialization", + "PropertyShape", + "sh:path", + "raml-shapes:xmlNonScalarAttribute", + "0", + "XML property 'attribute' must be false for non-scalar types", + "XML property 'attribute' must be false for non-scalar types" + ), + LB(MB(), Du().$, "raml-shapes:XMLSerializer", "raml-shapes:xmlAtribute", "sh:datatype", "xsd:boolean", "XML attribute serialisation info must be boolean", "XML attribute serialisation info must be boolean"), + LB(MB(), Du().$, "raml-shapes:XMLSerializer", "raml-shapes:xmlWrapped", "sh:datatype", "xsd:boolean", "XML wraping serialisation info must be boolean", "XML wrapping serialisation info must be boolean"), + LB( + MB(), + Du().$, + "raml-shapes:XMLSerializer", + "raml-shapes:xmlName", + "sh:datatype", + "xsd:string", + "XML name serialisation info must be string", + "XML name serialisation info must be string" + ), + LB(MB(), Du().$, "raml-shapes:XMLSerializer", "raml-shapes:xmlNamespace", "sh:datatype", "xsd:string", "XML namespace serialisation info must be string", "XML namespace serialisation info must be string"), + LB(MB(), Du().$, "raml-shapes:XMLSerializer", "raml-shapes:xmlPrefix", "sh:datatype", "xsd:string", "XML prefix serialisation info must be string", "XML prefix serialisation info must be string"), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "raml-shapes:minProperties", "sh:minInclusive", "0", "minProperties for a RAML Object type cannot be negative", "minProperties for a Schema object cannot be negative"), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "raml-shapes:minProperties", "sh:datatype", "xsd:integer", "minProperties for a RAML Object type must be an integer", "minProperties for a Schema object must be an integer"), + LB( + MB(), + Du().$, + "raml-shapes:ObjectShape", + "raml-shapes:maxProperties", + "sh:minInclusive", + "0", + "maxProperties for a RAML Object type cannot be negative", + "maxProperties for a Schema object cannot be negative" + ), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "raml-shapes:maxProperties", "sh:datatype", "xsd:integer", "maxProperties for a RAML Object type must be an integer", "maxProperties for a Schema object must be an integer"), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "sh:closed", "sh:datatype", "xsd:boolean", "additionalProperties for a RAML Object type must be a boolean", "additionalProperties for a Schema object must be a boolean"), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "raml-shapes:discriminator", "sh:datatype", "xsd:string", "discriminator for RAML Object type must be a string value", "discriminator for a Schema object must be a string value"), + LB(MB(), Du().$, "raml-shapes:ObjectShape", "raml-shapes:discriminatorValue", "sh:datatype", "xsd:string", "x-discriminatorValue for RAML Object type must be a string value", "discriminatorValue for a Schema object must be a string value"), + LB( + MB(), + Du().$, + "raml-shapes:ObjectShape", + "raml-shapes:readOnly ", + "sh:datatype", + "xsd:boolean", + "(readOnly) for a RAML Object type must be a boolean", + "readOnly for a Schema object must be a boolean" + ), + LB(MB(), Du().$, "raml-shapes:ArrayShape", "sh:minCount", "sh:datatype", "xsd:integer", "minItems for a RAML Array type must be an integer", "minItems of a Schema object of type 'array' must be an integer"), + LB(MB(), Du().$, "raml-shapes:ArrayShape", "sh:minCount", "sh:minInclusive ", "0", "maxItems for a RAML Array type must be greater than 0", "maxItems of a Schema object of type 'array' must be greater than 0"), + LB(MB(), Du().$, "raml-shapes:ArrayShape", "sh:maxCount", "sh:datatype", "xsd:integer", "maxItems for a RAML Array type must be an integer", "maxItems of a Schema object of type 'array' must be an integer"), + LB(MB(), Du().$, "raml-shapes:ArrayShape", "sh:minCount", "sh:minInclusive", "0", "minItems for a RAML Array type must be greater than 0", "minItems of a Schema object of type 'array' must be greater than 0"), + LB( + MB(), + Du().$, + "raml-shapes:ArrayShape", + "sh:maxCount", + "sh:minInclusive", + "0", + "maxItems for a RAML Array type must be greater than 0", + "maxItems of a Schema object of type 'array' must be greater than 0" + ), + LB(MB(), Du().$, "raml-shapes:ArrayShape", "raml-shapes:uniqueItems", "sh:datatype", "xsd:boolean", "uniqueItems for a RAML Array type must be a boolean", "uniqueItems of a Schema object of type 'array' must be a boolean"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:pattern", "sh:datatype", "xsd:string", "pattern facet for a RAML scalar type must be a string", "pattern for scalar Schema object of scalar type must be a string"), + LB( + MB(), + Du().$, + "raml-shapes:ScalarShape", + "sh:minLength", + "sh:datatype", + "xsd:integer", + "minLength facet for a RAML scalar type must be a integer", + "minLength for scalar Schema object of scalar type must be a integer" + ), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:maxLength", "sh:datatype", "xsd:integer", "maxLength facet for a RAML scalar type must be a integer", "maxLength for scalar Schema object of scalar type must be a integer"), + LB( + MB(), + Du().$, + "raml-shapes:ScalarShape", + "sh:minInclusive", + "sh:datatype", + "xsd:double", + "minimum facet for a RAML scalar type must be a number", + "minimum for scalar Schema object of scalar type must be a integer" + ), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:maxInclusive", "sh:datatype", "xsd:double", "maximum facet for a RAML scalar type must be a number", "maximum for scalar Schema object of scalar type must be a integer"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:minExclusive", "sh:datatype", "xsd:boolean", "x-exclusiveMinimum facet for a RAML scalar type must be a boolean", "exclusiveMinimum for scalar Schema object of scalar type must be a boolean"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:maxExclusive", "sh:datatype", "xsd:boolean", "x-exclusiveMaximum facet for a RAML scalar type must be a boolean", "exclusiveMaximum for scalar Schema object of scalar type must be a boolean"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:minLength", "sh:minInclusive", "0", "Min length facet should be greater or equal than 0", "Min length facet should be greater or equal than 0"), + LB( + MB(), + Du().$, + "raml-shapes:ScalarShape", + "sh:maxLength", + "sh:minInclusive", + "0", + "Max length facet should be greater or equal than 0", + "Max length facet should be greater or equal than 0" + ), + LB(MB(), Du().$, "raml-shapes:FileShape", "sh:minLength", "sh:minInclusive", "0", "Min length facet should be greater or equal than 0", "Min length facet should be greater or equal than 0"), + LB(MB(), Du().$, "raml-shapes:FileShape", "sh:maxLength", "sh:minInclusive", "0", "Max length facet should be greater or equal than 0", "Max length facet should be greater or equal than 0"), + LB( + MB(), + Du().$, + "raml-shapes:ScalarShape", + "raml-shapes:format", + "sh:datatype", + "xsd:string", + "format facet for a RAML scalar type must be a string", + "format for scalar Schema object of scalar type must be a string" + ), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "raml-shapes:multipleOf", "sh:datatype", "xsd:double", "multipleOf facet for a RAML scalar type must be a number", "multipleOf for scalar Schema object of scalar type must be a number"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "raml-shapes:multipleOf", "sh:minExclusive", "0", "multipleOf facet for a RAML scalar type must be greater than 0", "multipleOf for scalar Schema object of scalar type must be greater than 0"), + LB(MB(), Du().$, "raml-shapes:ScalarShape", "sh:datatype", "sh:minCount", "1", "type information for a RAML scalar is required", "type information fo a Schema object of scalar type is required"), + LB(MB(), Du().$, "apiContract:Tag", "core:name", "sh:minCount", "1", "Tag must have a name", "Tag object must have a name property"), + LB(MB(), Du().$, "apiContract:Server", "core:urlTemplate", "sh:datatype", "xsd:string", "API baseUri host information must be a string", "Swagger object 'host' and 'basePath' must be a string"), + LB(MB(), Du().$, "apiContract:Server", "core:description", "sh:datatype", "xsd:string", "Server 'description' property must be a string", "Server 'description' property must be a string"), + LB(MB(), Du().$, "apiContract:Server", "core:urlTemplate", "sh:minCount", "1", "Server must have an 'url' property", "Server must have an 'url' property"), + LB(MB(), Du().$, "security:SecurityScheme", "security:type", "sh:minCount", "1", "Security scheme type is mandatory", "Security scheme type is mandatory"), + LB( + MB(), + Du().$, + "security:SecurityScheme", + "security:type", + "sh:pattern", + "^OAuth\\s1.0|OAuth\\s2.0|Basic\\sAuthentication|Digest\\sAuthentication|Pass\\sThrough|Api\\sKey|http|openIdConnect|x-.+$", + "Security scheme type should be one of the supported ones", + "Security scheme type should be one of the supported ones" + ), + LB(MB(), Du().$, "security:SecurityScheme", "security:type", "sh:minCount", "1", "Type is mandatory in a Security Scheme Object", "Type is mandatory in a Security Scheme Object"), + NB( + MB(), + "amf-parser:strict-url-strinzgs", + "URLs in values mapped to core:url must be valid", + Du().$, + "doc:DomainElement", + "core:url", + "NodeShape", + "sh:targetObjectsOf", + "sh:nodeKind", + "sh:IRI", + "URLs must be valid", + "URLs must be valid" + ), + NB(MB(), "amf-parser:pattern-validation", "Pattern is not valid", Du().$, "raml-shapes:ScalarShape", "sh:pattern", "PropertyShape", "sh:path", "raml-shapes:patternValidation", "0", "Pattern is not valid", "Pattern is not valid") + ]; + this.Vp = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = [ + LB(MB(), Ob().$, "apiContract:WebAPI", "core:name", "sh:minLength", "1", "Info object 'title' must not be empty", "API name must not be an empty string"), + LB(MB(), Ob().$, "core:CreativeWork", "core:title", "sh:minCount", "1", "API documentation title is mandatory", "Documentation object 'x-title' is mandatory"), + LB(MB(), Ob().$, "core:CreativeWork", "core:description", "sh:minCount", "1", "API documentation content is mandatory", "Documentation object 'description' is mandatory"), + LB(MB(), Ob().$, "doc:DomainProperty", "raml-shapes:schema", "sh:minCount", "1", "type is mandatory for a RAML annotationType", "schema is mandatory for an extension type"), + LB( + MB(), + Ob().$, + "security:Settings", + "security:authorizationGrant", + "sh:pattern", + "^authorization_code|password|client_credentials|implicit|(\\w+:(\\/?\\/?)[^\\s]+)$", + "Invalid authorization grant. The options are: authorization_code, password, client_credentials, implicit or any valid absolut URI", + "Invalid authorization grant. The options are: authorization_code, password, client_credentials, implicit or any valid absolut URI" + ), + NB( + MB(), + "amf-parser:raml-root-schemes-values", + "Protocols property must be http or https", + Ob().$, + "apiContract:WebAPI", + "apiContract:scheme", + "PropertyShape", + "sh:path", + "sh:pattern", + "^(H|h)(T|t)(T|t)(P|p)(S|s)?$", + "Protocols must have a case insensitive value matching http or https", + "Swagger object 'schemes' property must have a case insensitive value matching http or https" + ), + NB( + MB(), + "amf-parser:raml-operation-schemes-values", + "Protocols property must be http or https", + Ob().$, + "apiContract:Operation", + "apiContract:scheme", + "PropertyShape", + "sh:path", + "sh:pattern", + "^(H|h)(T|t)(T|t)(P|p)(S|s)?$", + "Protocols must have a case insensitive value matching http or https", + "Swagger object 'schemes' property must have a case insensitive value matching http or https" + ), + NB(MB(), "amf-parser:raml-root-schemes-non-empty-array", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'", Ob().$, "apiContract:WebAPI", "apiContract:scheme", "PropertyShape", "sh:path", "raml-shapes:nonEmptyListOfProtocols", "0", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'"), + NB(MB(), "amf-parser:raml-operation-schemes-non-empty-array", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'", Ob().$, "apiContract:Operation", "apiContract:scheme", "PropertyShape", "sh:path", "raml-shapes:nonEmptyListOfProtocols", "0", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'", "Protocols must be a non-empty array of case-insensitive strings with values 'http' and/or 'https'"), + NB( + MB(), + "amf-parser:min-max-inclusive", + "Maximum must be greater than or equal to minimum", + Ob().$, + "raml-shapes:ScalarShape", + "sh:minInclusive", + "PropertyShape", + "sh:path", + "raml-shapes:minimumMaximumValidation", + "0", + "Maximum must be greater than or equal to minimum", + "Maximum must be greater than or equal to minimum" + ), + NB( + MB(), + "amf-parser:min-max-items", + "MaxItems must be greater than or equal to minItems", + Ob().$, + "raml-shapes:ArrayShape", + "sh:minCount", + "PropertyShape", + "sh:path", + "raml-shapes:minMaxItemsValidation", + "0", + "MaxItems must be greater than or equal to minItems", + "MaxItems must be greater than or equal to minItems" + ), + NB(MB(), "amf-parser:min-max-length", "MaxLength must be greater than or equal to minLength", Ob().$, "raml-shapes:ScalarShape", "sh:minLength", "PropertyShape", "sh:path", "raml-shapes:minMaxLengthValidation", "0", "MaxLength must be greater than or equal to minLength", "MaxLength must be greater than or equal to minLength"), + NB( + MB(), + "amf-parser:min-max-length", + "MaxLength must be greater than or equal to minLength", + Ob().$, + "raml-shapes:FileShape", + "sh:minLength", + "PropertyShape", + "sh:path", + "raml-shapes:minMaxLengthValidation", + "0", + "MaxLength must be greater than or equal to minLength", + "MaxLength must be greater than or equal to minLength" + ), + NB(MB(), "amf-parser:min-max-properties", "MaxProperties must be greater than or equal to minProperties", Ob().$, "sh:NodeShape", "raml-shapes:minProperties", "PropertyShape", "sh:path", "raml-shapes:minMaxPropertiesValidation", "0", "MaxProperties must be greater than or equal to minProperties", "MaxProperties must be greater than or equal to minProperties"), + LB(MB(), Ob().$, "apiContract:Payload", "core:mediaType", "sh:minCount", "1", "Payload media type is mandatory", ""), + LB(MB(), Qb().$, "security:Settings", "security:signature", "sh:pattern", "^HMAC-SHA1|RSA-SHA1|PLAINTEXT$", "Invalid OAuth 1.0 signature. The options are: HMAC-SHA1, RSA-SHA1, or PLAINTEXT", "Invalid OAuth 1.0 signature. The options are: HMAC-SHA1, RSA-SHA1, or PLAINTEXT"), + LB( + MB(), + Ob().$, + "apiContract:Response", + "apiContract:statusCode", + "sh:pattern", + "^([1-5]{1}[0-9]{2})$|^(default)$", + "Status code for a Response must be a value between 100 and 599", + "Status code for a Response must be a value between 100 and 599 or 'default'" + ), + this.Pda + ]; + this.ct = J5(a10, new Ib().ha(b10)); + this.UF = J5(K7(), H10()); + a10 = K7(); + b10 = [LB(MB(), Qb().$, "security:Settings", "security:authorizationGrant", "sh:pattern", "^code|token|owner|credentials$", "Invalid authorization grant. The options are: code, token, owner or credentials", "Invalid authorization grant. The options are: code, token, owner or credentials"), NB( + MB(), + "amf-parser:raml-schemes", + "Protocols property must be http or https", + Qb().$, + "apiContract:WebAPI", + "apiContract:scheme", + "PropertyShape", + "sh:path", + "sh:in", + "http,https,HTTP,HTTPS", + "Protocols must have a case insensitive value matching http or https", + "Swagger object 'schemes' property must have a case insensitive value matching http or https" + ), NB( + MB(), + "amf-parser:min-max-inclusive", + "Maximum must be greater than or equal to minimum", + Qb().$, + "raml-shapes:ScalarShape", + "sh:minInclusive", + "PropertyShape", + "sh:path", + "raml-shapes:minimumMaximumValidation", + "0", + "Maximum must be greater than or equal to minimum", + "Maximum must be greater than or equal to minimum" + ), NB(MB(), "amf-parser:min-max-items", "MaxItems must be greater than or equal to minItems", Qb().$, "raml-shapes:ArrayShape", "sh:minCount", "PropertyShape", "sh:path", "raml-shapes:minMaxItemsValidation", "0", "MaxItems must be greater than or equal to minItems", "MaxItems must be greater than or equal to minItems"), NB( + MB(), + "amf-parser:min-max-length", + "MaxLength must be greater than or equal to minLength", + Qb().$, + "raml-shapes:ScalarShape", + "sh:minLength", + "PropertyShape", + "sh:path", + "raml-shapes:minMaxLengthValidation", + "0", + "MaxLength must be greater than or equal to minLength", + "MaxLength must be greater than or equal to minLength" + ), NB(MB(), "amf-parser:min-max-properties", "MaxProperties must be greater than or equal to minProperties", Qb().$, "sh:NodeShape", "raml-shapes:minProperties", "PropertyShape", "sh:path", "raml-shapes:minMaxPropertiesValidation", "0", "MaxProperties must be greater than or equal to minProperties", "MaxProperties must be greater than or equal to minProperties")]; + this.TF = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = NB(MB(), "amf-parser:mandatory-api-version", "Missing madatory Swagger / info / version", Au().$, "apiContract:WebAPI", "core:version", "PropertyShape", "sh:path", "sh:minCount", "1", "API Version is Mandatory", "Version is mandatory in Info object"); + var c10 = NB( + MB(), + "amf-parser:openapi-schemes", + "Protocols property must be http,https,ws,wss", + Au().$, + "apiContract:WebAPI", + "apiContract:scheme", + "PropertyShape", + "sh:path", + "sh:in", + "http,https,ws,wss", + "Protocols must match a value http, https, ws or wss", + "Swagger object 'schemes' property must have a value matching http, https, ws or wss" + ), e10 = NB(MB(), "amf-parser:mandatory-external-doc-url", "Swagger external-doc element without URL", Au().$, "core:CreativeWork", "core:url", "PropertyShape", "sh:path", "sh:minCount", "1", "Documentation URL is mandatory in API external documentation", "URL is mandatory in External Documentation object"), f10 = NB( + MB(), + "amf-parser:mandatory-license-name", + "Swagger License node without name", + Au().$, + "apiContract:License", + "core:name", + "PropertyShape", + "sh:path", + "sh:minCount", + "1", + "License name is mandatory if license information is included", + "Name is mandatory in License object" + ), g10 = NB(MB(), "amf-parser:empty-responses", "No responses declared", Au().$, "apiContract:Operation", "apiContract:returns", "PropertyShape", "sh:path", "sh:minCount", "1", "Responses array cannot be empty", "Responses cannot be empty"), h10 = NB( + MB(), + "amf-parser:empty-enum", + "Enum in types cannot be empty", + Au().$, + "raml-shapes:Shape", + "sh:in", + "PropertyShape", + "sh:path", + "sh:node", + "amf-parser:NonEmptyList", + "Property 'enum' must have at least one value", + "Property 'enum' for a Schema object must have at least one value" + ), k10 = NB(MB(), "amf-parser:array-shape-items-mandatory", "Declaration of the type of the items for an array is required", Au().$, "raml-shapes:ArrayShape", "raml-shapes:items", "PropertyShape", "sh:path", "sh:minCount", "1", "items facet of RAML Array type is required", "items property of Schema objects of type 'array' is required"), l10 = NB( + MB(), + "amf-parser:path-parameter-required", + "Path parameters must have the required property set to true", + Au().$, + "apiContract:Parameter", + "apiContract:binding", + "PropertyShape", + "sh:path", + "raml-shapes:pathParameterRequiredProperty", + "0", + "Path parameters must have the required property set to true", + "Path parameters must have the required property set to true" + ), m10 = NB( + MB(), + "amf-parser:file-parameter-in-form-data", + "Parameter of type file must set property 'in' to formData", + Au().$, + "apiContract:Parameter", + "raml-shapes:schema", + "PropertyShape", + "sh:path", + "raml-shapes:fileParameterMustBeInFormData", + "0", + "Parameter of type file must set property 'in' to formData", + "Parameter of type file must set property 'in' to formData" + ), p10 = NB(MB(), "amf-parser:description-is-required-in-response", "Description must be defined in a response", Au().$, "apiContract:Response", "core:description", "PropertyShape", "sh:path", "sh:minCount", "1", "", "Response must have a 'description' field"); + MB(); + var t10 = Au().$, v10 = new qg().e("^[a-zA-Z0-9\\.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"); + b10 = [b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, LB(0, t10, "core:Organization", "core:email", "sh:pattern", OB(v10), "", "Field 'email' must be in the format of an email address"), Boa(Au().$, "core:License", "core:url"), Boa(Au().$, "core:Organization", "core:url"), Boa(Au().$, "core:CreativeWork", "core:url")]; + this.ew = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = [LB(MB(), Bu().$, "apiContract:Response", "apiContract:statusCode", "sh:pattern", "^([1-5]{1}[0-9]{2})$|^(default)$", "", "Status code for a Response must be a value between 100 and 599 or 'default'"), LB( + MB(), + Bu().$, + "security:OAuth2Flow", + "security:flow", + "sh:pattern", + "^(implicit|password|application|accessCode)$", + "Invalid flow. The options are: implicit, password, application or accessCode", + "Invalid flow. The options are: implicit, password, application or accessCode" + ), LB(MB(), Bu().$, "security:Settings", "security:in", "sh:pattern", "^(query|header)$", "Invalid 'in' value. The options are: query or header", "Invalid 'in' value. The options are: query or header"), this.Pda]; + this.QF = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = [ + LB(MB(), Cu().$, "apiContract:Response", "apiContract:statusCode", "sh:pattern", "^([1-5]{1}(([0-9]{2})|XX))$|^(default)$", "", "Status code for a Response must be a value between 100 and 599, a [1-5]XX wildcard, or 'default'"), + LB(MB(), Cu().$, "security:OAuth2Flow", "security:flow", "sh:pattern", "^(implicit|password|clientCredentials|authorizationCode)$", "Invalid flow. The options are: implicit, password, clientCredentials or authorizationCode", "Invalid flow. The options are: implicit, password, clientCredentials or authorizationCode"), + LB(MB(), Cu().$, "security:Settings", "security:in", "sh:pattern", "^(query|header|cookie)$", "Invalid 'in' value. The options are: query, header or cookie", "Invalid 'in' value. The options are: query, header or cookie"), + NB(MB(), "amf-parser:example-mutually-exclusive-fields", "Example 'value' and 'externalValue' fields are mutually exclusive", Cu().$, "apiContract:Example", "doc:externalValue", "PropertyShape", "sh:path", "raml-shapes:exampleMutuallyExclusiveFields", "0", "", "Example 'value' and 'externalValue' fields are mutually exclusive"), + LB(MB(), Cu().$, "apiContract:Parameter", "apiContract:payload", "sh:maxCount", "1", "", "Parameters 'content' field must only have one entry"), + Boa(Cu().$, "apiContract:WebAPI", "core:termsOfService"), + LB(MB(), Cu().$, "security:HttpSettings", "security:scheme", "sh:minCount", "1", "'scheme' field is mandatory in http security scheme", "'scheme' field is mandatory in http security scheme"), + LB( + MB(), + Cu().$, + "security:ApiKeySettings", + "core:name", + "sh:minCount", + "1", + "'name' field is mandatory in apiKey security scheme", + "'name' field is mandatory in apiKey security scheme" + ), + LB(MB(), Cu().$, "security:ApiKeySettings", "security:in", "sh:minCount", "1", "'in' field is mandatory in apiKey security scheme", "'in' field is mandatory in apiKey security scheme"), + LB(MB(), Cu().$, "security:SecurityScheme", "security:settings", "raml-shapes:requiredOpenIdConnectUrl", "0", "'openIdConnectUrl' field is mandatory in openIdConnect security scheme", "'openIdConnectUrl' field is mandatory in openIdConnect security scheme"), + LB( + MB(), + Cu().$, + "security:SecurityScheme", + "security:settings", + "raml-shapes:requiredFlowsInOAuth2", + "0", + "'flows' field is mandatory in OAuth2 security scheme", + "'flows' field is mandatory in OAuth2 security scheme" + ), + LB(MB(), Cu().$, "apiContract:Callback", "apiContract:expression", "raml-shapes:validCallbackExpression", "0", "Does not comply with runtime expression ABNF syntax", "Does not comply with runtime expression ABNF syntax"), + LB( + MB(), + Cu().$, + "apiContract:TemplatedLink", + "apiContract:requestBody", + "raml-shapes:validLinkRequestBody", + "0", + "Does not comply with runtime expression ABNF syntax", + "Does not comply with runtime expression ABNF syntax" + ), + LB(MB(), Cu().$, "apiContract:TemplatedLink", "apiContract:mapping", "raml-shapes:validLinkParameterExpressions", "0", "Does not comply with runtime expression ABNF syntax", "Does not comply with runtime expression ABNF syntax") + ]; + this.Cp = J5(a10, new Ib().ha(b10)); + a10 = kk(); + b10 = PB(this, kk()); + a10 = new R6().M(a10, b10); + b10 = pk(); + c10 = PB(this, pk()); + b10 = new R6().M(b10, c10); + c10 = qk(); + e10 = PB(this, qk()); + c10 = new R6().M(c10, e10); + e10 = ok2(); + f10 = PB(this, ok2()); + e10 = new R6().M(e10, f10); + f10 = mk(); + g10 = PB(this, mk()); + f10 = new R6().M( + f10, + g10 + ); + g10 = nk(); + h10 = PB(this, nk()); + g10 = new R6().M(g10, h10); + h10 = lk(); + k10 = PB(this, lk()); + a10 = [a10, b10, c10, e10, f10, g10, new R6().M(h10, k10)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.X = b10.eb; + return this; + }; + function PB(a10, b10) { + if (pk().h(b10) || ok2().h(b10)) { + b10 = a10.ct; + var c10 = a10.UF, e10 = K7(); + b10 = b10.ia(c10, e10.u); + a10 = a10.Vp; + c10 = K7(); + return b10.ia(a10, c10.u); + } + return qk().h(b10) ? (b10 = a10.ct, c10 = a10.TF, e10 = K7(), b10 = b10.ia(c10, e10.u), a10 = a10.Vp, c10 = K7(), b10.ia(a10, c10.u)) : lk().h(b10) || mk().h(b10) ? (b10 = a10.ew, c10 = a10.QF, e10 = K7(), b10 = b10.ia(c10, e10.u), a10 = a10.Vp, c10 = K7(), b10.ia(a10, c10.u)) : nk().h(b10) ? (b10 = a10.ew, c10 = a10.Cp, e10 = K7(), b10 = b10.ia(c10, e10.u), a10 = a10.Vp, c10 = K7(), b10.ia(a10, c10.u)) : kk().h(b10) ? a10.Vp : H10(); + } + function Boa(a10, b10, c10) { + MB(); + var e10 = new qg().e("^((https?|ftp|file)://)?[-a-zA-Z0-9()+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9()+&@#/%=~_|]$"); + return LB(0, a10, b10, c10, "sh:pattern", OB(e10), "Must be in the format of a URL", "Must be in the format of a URL"); + } + KB.prototype.$classData = r8({ uXa: 0 }, false, "amf.plugins.document.webapi.validation.AMFRawValidations$", { uXa: 1, f: 1 }); + var Aoa = void 0; + function Coa() { + this.gC = this.Hna = this.toa = this.r = this.gu = this.Yk = this.pa = this.FV = this.fca = this.zm = this.N = this.Ld = this.Gea = null; + } + Coa.prototype = new u7(); + Coa.prototype.constructor = Coa; + Coa.prototype.$classData = r8({ vXa: 0 }, false, "amf.plugins.document.webapi.validation.AMFRawValidations$AMFValidation", { vXa: 1, f: 1 }); + function QB() { + } + QB.prototype = new u7(); + QB.prototype.constructor = QB; + QB.prototype.a = function() { + return this; + }; + function NB(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10) { + return Doa(new z7().d(b10), new z7().d(c10), e10, new z7().d(f10), new z7().d(g10), h10, k10, l10, m10, p10, t10); + } + function Doa(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10) { + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(ic(RB(F6(), a10)))); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(ic(RB(F6(), e10)))); + if (f10.b()) + var t10 = y7(); + else + f10 = f10.c(), t10 = new z7().d(ic(RB(F6(), f10))); + f10 = new Coa(); + h10 = ic(RB(F6(), h10)); + var v10 = ic(RB(F6(), k10)); + k10 = Ed(ua(), k10, "pattern") ? l10 : ic(RB(F6(), l10)); + f10.Gea = a10; + f10.Ld = b10; + f10.N = c10; + f10.zm = "Domain"; + f10.fca = e10; + f10.FV = t10; + f10.pa = g10; + f10.Yk = h10; + f10.gu = v10; + f10.r = k10; + f10.toa = m10; + f10.Hna = p10; + f10.gC = "Violation"; + return f10; + } + function LB(a10, b10, c10, e10, f10, g10, h10, k10) { + return Doa(y7(), y7(), b10, new z7().d(c10), new z7().d(e10), "PropertyShape", "sh:path", f10, g10, h10, k10); + } + QB.prototype.$classData = r8({ wXa: 0 }, false, "amf.plugins.document.webapi.validation.AMFRawValidations$AMFValidation$", { wXa: 1, f: 1 }); + var Eoa = void 0; + function MB() { + Eoa || (Eoa = new QB().a()); + return Eoa; + } + function SB() { + this.oi = null; + } + SB.prototype = new u7(); + SB.prototype.constructor = SB; + function Foa(a10) { + a10 = a10.oi; + Goa || (Goa = new TB().a()); + var b10 = Goa; + var c10 = UB(); + a10 = VB(a10, b10, c10); + b10 = Hoa(a10, new Ioa()); + a10 = Gb().si; + b10 = new WB().DU(b10).xqa.im(); + a10 = new XB().DU(new YB().ou(b10, a10)); + b10 = new ZB(); + b10.bba = a10.upa.im(); + b10.D1 = $B().ce; + return Xv(b10); + } + SB.prototype.$T = function(a10) { + this.oi = a10; + return this; + }; + SB.prototype.x9 = function() { + var a10 = Foa(this), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + var f10 = B6(e10.Y(), Ud().zi); + e10 = e10.Ena(); + f10 = Tf(Uf(), f10, "application/yaml"); + return aC(e10, f10); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + SB.prototype.$classData = r8({ CXa: 0 }, false, "amf.plugins.document.webapi.validation.ExtensionsCandidatesCollector", { CXa: 1, f: 1 }); + function bC() { + } + bC.prototype = new u7(); + bC.prototype.constructor = bC; + bC.prototype.a = function() { + return this; + }; + bC.prototype.g9 = function(a10, b10) { + return new SB().$T(a10, b10).x9(); + }; + bC.prototype.$classData = r8({ DXa: 0 }, false, "amf.plugins.document.webapi.validation.ExtensionsCandidatesCollector$", { DXa: 1, f: 1 }); + var Joa = void 0; + function cC() { + this.TT = null; + } + cC.prototype = new u7(); + cC.prototype.constructor = cC; + cC.prototype.a = function() { + Koa = this; + var a10 = new qg().e('|function(shape) {\n | //console.log(JSON.stringify(shape));\n | var minimum = shape["shacl:minInclusive"];\n | var maximum = shape["shacl:maxInclusive"];\n | if (minimum == undefined || maximum == undefined) return true;\n | else return (parseFloat(minimum) <= parseFloat(maximum));\n |}\n '); + a10 = OB(a10); + a10 = new R6().M("minimumMaximumValidation", a10); + var b10 = new qg().e(`|function(parameter) { + | var binding = parameter["apiContract:binding"]; + | var requiredValue = parameter["apiContract:required"]; + | if (binding == 'path' && requiredValue != 'true') { + | return false; + | } + | else { + | return true; + | } + |} + `); + b10 = OB(b10); + b10 = new R6().M("pathParameterRequiredProperty", b10); + var c10 = new qg().e(`|function(parameter) { + | var binding = parameter["apiContract:binding"]; + | var schema = parameter["raml-shapes:schema"]; + | var typeList = schema[0]["@type"]; + | if(Array.isArray(typeList) && typeList.indexOf("raml-shapes:FileShape") != -1){ + | return binding == 'formData'; + | } else { + | return true; + | } + |} + `); + c10 = OB(c10); + c10 = new R6().M("fileParameterMustBeInFormData", c10); + var e10 = new qg().e('|function(shape) {\n | //console.log(JSON.stringify(shape));\n | var minCount = shape["shacl:minCount"];\n | var maxCount = shape["shacl:maxCount"];\n | if (minCount == undefined || maxCount == undefined) return true;\n | else return (parseInt(minCount) <= parseInt(maxCount));\n |}\n '); + e10 = OB(e10); + e10 = new R6().M("minMaxItemsValidation", e10); + var f10 = new qg().e('|function(shape) {\n | //console.log(JSON.stringify(shape));\n | var minLength = shape["shacl:minLength"];\n | var maxLength = shape["shacl:maxLength"];\n | if (minLength == undefined || maxLength == undefined) return true;\n | else return (parseInt(minLength) <= parseInt(maxLength));\n |}\n '); + f10 = OB(f10); + f10 = new R6().M("minMaxLengthValidation", f10); + var g10 = new qg().e('|function(shape) {\n | var minProperties = shape["raml-shapes:minProperties"];\n | var maxProperties = shape["raml-shapes:maxProperties"];\n | if (minProperties == undefined || maxProperties == undefined) return true;\n | else return (parseInt(minProperties) <= parseInt(maxProperties));\n |}\n '); + g10 = OB(g10); + g10 = new R6().M("minMaxPropertiesValidation", g10); + var h10 = new qg().e('|function(shape) {\n | var pattern = shape["shacl:pattern"];\n | try {\n | if(pattern) new RegExp(pattern);\n | return true;\n | } catch(e) {\n | return false;\n | }\n |}\n '); + h10 = OB(h10); + h10 = new R6().M("patternValidation", h10); + var k10 = new qg().e('\n |function(shape) {\n | var xmlSerialization = shape["raml-shapes:xmlSerialization"];\n | if (!xmlSerialization) return true;\n | else {\n | var wrapped_ = xmlSerialization[0]["raml-shapes:xmlWrapped"];\n | var isWrapped = (wrapped_)? wrapped_[0] : false;\n | var isScalar = shape["@type"].indexOf("raml-shapes:ScalarShape") !== -1;\n | return !(isWrapped && isScalar);\n | }\n |}\n '); + k10 = OB(k10); + k10 = new R6().M("xmlWrappedScalar", k10); + var l10 = new qg().e('\n |function(shape) {\n | var xmlSerialization = shape["raml-shapes:xmlSerialization"];\n | if (!xmlSerialization) return true;\n | else {\n | var attribute_ = xmlSerialization[0]["raml-shapes:xmlAttribute"];\n | var isAttribute = (attribute_)? attribute_[0] : false;\n | var isNonScalar = shape["@type"].indexOf("raml-shapes:ScalarShape") === -1;\n | return !(isAttribute && isNonScalar);\n | }\n |}\n '); + l10 = OB(l10); + l10 = new R6().M("xmlNonScalarAttribute", l10); + var m10 = new qg().e('\n |function(shape) {\n | var protocolsArray = shape["apiContract:scheme"];\n | return !Array.isArray(protocolsArray) || protocolsArray.length > 0;\n |}\n '); + m10 = OB(m10); + m10 = new R6().M("nonEmptyListOfProtocols", m10); + var p10 = new qg().e('\n |function(shape) {\n | var externalValue = shape["doc:externalValue"];\n | var value = shape["doc:structuredValue"];\n | return !(externalValue != null && value != null);\n |}\n '); + p10 = OB(p10); + p10 = new R6().M("exampleMutuallyExclusiveFields", p10); + var t10 = new qg().e("\n |function(shape) {\n | return true;\n |}\n "); + t10 = OB(t10); + t10 = new R6().M("requiredFlowsInOAuth2", t10); + var v10 = new qg().e("\n |function(shape) {\n | return true;\n |}\n "); + v10 = OB(v10); + v10 = new R6().M("requiredOpenIdConnectUrl", v10); + var A10 = new qg().e("\n |function(shape) {\n | return true;\n |}\n "); + A10 = OB(A10); + A10 = new R6().M("validCallbackExpression", A10); + var D10 = new qg().e("\n |function(shape) {\n | return true;\n |}\n "); + D10 = OB(D10); + D10 = new R6().M("validLinkRequestBody", D10); + var C10 = new qg().e("\n |function(shape) {\n | return true;\n |}\n "); + C10 = OB(C10); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, new R6().M("validLinkParameterExpressions", C10)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.TT = b10.eb; + return this; + }; + cC.prototype.$classData = r8({ HXa: 0 }, false, "amf.plugins.document.webapi.validation.JsCustomValidations$", { HXa: 1, f: 1 }); + var Koa = void 0; + function dC() { + this.ai = this.oi = null; + } + dC.prototype = new u7(); + dC.prototype.constructor = dC; + dC.prototype.EK = function(a10) { + this.oi = a10; + this.ai = new Nd().a(); + return this; + }; + function Loa(a10, b10) { + var c10 = Vb().Ia(B6(b10.Y(), qf().Mh)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + var e10 = c10.j, f10 = B6(b10.Y(), qf().$j).A; + c10 = new z7().d(Moa(new eC(), a10, c10, e10, f10.b() ? "" : f10.c(), c10.fa())); + } + if (c10.b()) { + c10 = B6(b10.Y(), qf().$j).A; + if (c10.b()) + return y7(); + c10 = c10.c(); + return new z7().d(new fC().KO(a10, b10.j, c10, B6(b10.Y(), qf().$j).x)); + } + return c10; + } + function Noa() { + var a10 = K7(), b10 = [Ag().ch, Ag().xd, Ag().ki, Ag().fi, Ag().li, Ag().Bi]; + return J5(a10, new Ib().ha(b10)); + } + function Ooa(a10) { + var b10 = Rb(Ut(), H10()), c10 = Rb(Ut(), H10()), e10 = a10.oi, f10 = gC(), g10 = UB(); + for (e10 = VB(e10, f10, g10); e10.Ya(); ) { + var h10 = e10.iq(); + g10 = false; + f10 = new qd().d(null); + a: { + if (h10 instanceof vh) { + g10 = true; + f10.oa = h10; + h10 = f10.oa.uv(); + var k10 = Ag(); + if (null !== h10 && h10 === k10 && !Noa().Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return p10.oa.Y().vb.Ha(t10); + }; + }(a10, f10)))) + break a; + } + if (g10 && b10.KB().Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return t10 === p10.oa.j; + }; + }(a10, f10)))) + g10 = b10.P(f10.oa.j), B6(f10.oa.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(m10, p10, t10, v10) { + return function(A10) { + if (!p10.Od(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + return pa.j === ia.j; + }; + }(m10, A10)))) + a: { + if (null !== A10) { + var D10 = A10.g, C10 = ag().mo; + D10.vb.Ha(C10) ? (D10 = B6(A10.g, ag().Fq).A, D10 = !(!D10.b() && !D10.c())) : D10 = false; + if (D10 && !p10.Od(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + return pa.j === ia.j; + }; + }(m10, A10)))) { + D10 = v10.oa.j; + C10 = B6(A10.g, ag().mo); + var I10 = A10.j, L10 = B6(A10.g, Zf().Rd).A; + A10 = Moa(new eC(), m10, C10, I10, L10.b() ? null : L10.c(), A10.x); + C10 = K7(); + t10.jm(D10, p10.yg(A10, C10.u)); + break a; + } + } + null !== A10 && (D10 = A10.g, C10 = ag().Rd, D10.vb.Ha(C10) ? (D10 = B6(A10.g, ag().Fq).A, D10 = !(!D10.b() && !D10.c())) : D10 = false, D10 && !p10.Od(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + return pa.j === ia.j; + }; + }(m10, A10))) && (D10 = v10.oa.j, C10 = A10.j, I10 = B6(A10.g, Zf().Rd).A, A10 = new fC().KO(m10, C10, I10.b() ? null : I10.c(), A10.x), C10 = K7(), t10.jm(D10, p10.yg(A10, C10.u)))); + } + }; + }(a10, g10, b10, f10))), g10 = f10.oa.j, h10 = b10.P(f10.oa.j), f10 = Loa(a10, f10.oa).ua(), k10 = K7(), b10.jm(g10, h10.ia(f10, k10.u)); + else if (g10) + if (g10 = B6(f10.oa.Y(), Ag().Ec), h10 = Poa(a10), k10 = K7(), g10 = g10.ec(h10, k10.u), g10.Da()) { + h10 = f10.oa.j; + k10 = Loa(a10, f10.oa).ua(); + var l10 = K7(); + b10.Ue(h10, g10.ia(k10, l10.u)); + c10.Ue(f10.oa.j, f10.oa); + } else + g10 = Loa(a10, f10.oa), g10 instanceof z7 ? (g10 = g10.i, h10 = f10.oa.j, k10 = K7(), b10.Ue(h10, J5(k10, new Ib().ha([g10]))), c10.Ue(f10.oa.j, f10.oa)) : y7() === g10 && B6(f10.oa.Y(), qf().ch).Da() && (c10.Ue(f10.oa.j, f10.oa), b10.Ue(f10.oa.j, H10())); + } + } + a10 = w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + if (null !== t10) { + var v10 = t10.ma(); + t10 = t10.ya(); + v10 = p10.P(v10); + if (t10.b()) + return t10 = K7(), v10 = [aC(v10, Qoa(new tl().K(new S6().a(), (O7(), new P6().a())), Roa(Soa(), B6(v10.Y(), qf().ch).ga())))], J5(t10, new Ib().ha(v10)); + v10 = w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + if (I10 instanceof eC) + var L10 = Tf(Uf(), I10.eT, "text/vnd.yaml"); + else { + if (!(I10 instanceof fC)) + throw new x7().d(I10); + Uf(); + L10 = ts(vs(), I10.xe, y7(), I10.ZF); + $f(); + L10 = Tf(0, L10, $ba(0, I10.xe, C10 instanceof Mh)); + } + var Y10 = ar(L10.g, sl().nb); + Rd(Y10, I10.j); + return aC(C10, L10); + }; + }(m10, v10)); + var A10 = K7(); + return t10.ka(v10, A10.u); + } + throw new x7().d(t10); + }; + }(a10, c10)); + c10 = Toa().u; + return hC( + b10, + a10, + c10 + ).ke(); + } + dC.prototype.$classData = r8({ MXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadsInApiCollector", { MXa: 1, f: 1 }); + function iC() { + } + iC.prototype = new u7(); + iC.prototype.constructor = iC; + iC.prototype.a = function() { + return this; + }; + iC.prototype.$classData = r8({ NXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadsInApiCollector$", { NXa: 1, f: 1 }); + var Uoa = void 0; + function jC() { + this.l = this.ZF = this.xe = this.j = null; + } + jC.prototype = new u7(); + jC.prototype.constructor = jC; + function Voa() { + } + Voa.prototype = jC.prototype; + jC.prototype.KO = function(a10, b10, c10, e10) { + this.j = b10; + this.xe = c10; + this.ZF = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function kC() { + this.oi = null; + } + kC.prototype = new u7(); + kC.prototype.constructor = kC; + function Woa(a10, b10, c10) { + if (1 === c10.Oa()) { + O7(); + var e10 = new P6().a(); + e10 = new Hh().K(new S6().a(), e10); + b10 = Rd(e10, b10.j + "Shape"); + c10 = c10.ga().Ur().ke(); + e10 = Ih().kh; + return Zd(b10, e10, c10); + } + O7(); + e10 = new P6().a(); + e10 = new Vh().K(new S6().a(), e10); + e10 = Rd(e10, b10.j + "Shape"); + var f10 = new lC().ue(0); + b10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + O7(); + var m10 = new P6().a(); + m10 = new Hh().K(new S6().a(), m10); + m10 = Rd(m10, h10.j + "Shape" + k10.oa); + k10.oa = 1 + k10.oa | 0; + l10 = new Fc().Vd(l10).Sb.Ye().Dd(); + var p10 = Ih().kh; + return Zd(m10, p10, l10); + }; + }(a10, b10, f10)); + a10 = K7(); + c10 = c10.ka(b10, a10.u); + b10 = xn().Le; + return Zd(e10, b10, c10); + } + function Xoa(a10) { + var b10 = K7(), c10 = ic(xm().ba.ga()), e10 = ic(cj().ba.ga()), f10 = ic(Am().ba.ga()), g10 = ic(Xh().ba.ga()), h10 = F6().Zd; + b10 = J5(b10, new Ib().ha([c10, e10, f10, g10, ic(G5(h10, "DomainProperty"))])); + c10 = a10.oi; + e10 = gC(); + f10 = UB(); + c10 = VB(c10, e10, f10); + b10 = Hoa(c10, Yoa(b10)); + b10 = Xv(b10); + c10 = a10.oi; + Zc(c10) ? (c10 = c10.tk().Cb(w6(/* @__PURE__ */ function() { + return function(k10) { + return k10 instanceof rf; + }; + }(a10))), e10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10; + }; + }(a10)), f10 = K7(), c10 = c10.ka(e10, f10.u)) : (K7(), pj(), c10 = new Lf().a().ua()); + e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10 instanceof ym ? (k10 = Vb().Ia(B6( + k10.g, + xm().Jc + )), k10 instanceof z7 ? (k10 = k10.i, new z7().d(new R6().M(k10, mC(k10, true, J5(DB(), H10()))))) : y7()) : k10 instanceof Wl ? (k10 = Vb().Ia(B6(k10.g, cj().Jc)), k10 instanceof z7 ? (k10 = k10.i, new z7().d(new R6().M(k10, mC(k10, true, J5(DB(), H10()))))) : y7()) : k10 instanceof Bm ? (k10 = Vb().Ia(B6(k10.g, Am().Dq)), k10 instanceof z7 ? (k10 = k10.i, new z7().d(new R6().M(k10, mC(k10, true, J5(DB(), H10()))))) : y7()) : k10 instanceof vm ? (k10 = Vb().Ia(B6(k10.g, Xh().Dq)), k10 instanceof z7 ? (k10 = k10.i, new z7().d(new R6().M(k10, mC(k10, true, J5(DB(), H10()))))) : y7()) : k10 instanceof Pd ? (k10 = Vb().Ia(B6(k10.g, Sk().Jc)), k10 instanceof z7 ? (k10 = k10.i, new z7().d(new R6().M( + k10, + mC(k10, true, J5(DB(), H10())) + ))) : y7()) : k10 instanceof rf ? new z7().d(new R6().M(k10, mC(k10, true, J5(DB(), H10())))) : y7(); + }; + }(a10)); + e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function(k10) { + return function(l10) { + if (l10 instanceof z7) { + var m10 = l10.i; + if (null !== m10 && (l10 = m10.ma(), m10 = m10.ya(), null !== l10 && null !== m10)) + return m10.Od(w6(/* @__PURE__ */ function() { + return function(p10) { + return tc(p10); + }; + }(k10))); + } + return false; + }; + }(a10))); + a10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.c(); + }; + }(a10)); + c10 = K7(); + return b10.ka(a10, c10.u); + } + kC.prototype.$T = function(a10) { + this.oi = a10; + return this; + }; + function Zoa(a10, b10) { + qs(); + var c10 = b10.fa(); + c10 = new Xk().K(new S6().a(), c10); + c10 = Rd(c10, b10.j); + B6(b10.Y(), nC()).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = B6(B6(g10.g, Ot().ig).aa, qf().R).A; + return oC(f10, h10.b() ? null : h10.c(), B6(g10.g, Ud().zi), g10.x); + }; + }(a10, c10))); + return c10; + } + kC.prototype.x9 = function() { + var a10 = Xoa(this), b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(), h10 = f10.ya(); + if (null !== g10 && null !== h10) + return g10 = Za(g10).na() && Za(g10).na() ? Za(g10).c() : g10, f10 = Zoa(e10, g10), h10 = Woa(e10, g10, h10), f10 = Tf(Uf(), f10, "application/yaml"), aC(h10, f10); + } + throw new x7().d(f10); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + kC.prototype.$classData = r8({ SXa: 0 }, false, "amf.plugins.document.webapi.validation.ShapeFacetsCandidatesCollector", { SXa: 1, f: 1 }); + function pC() { + } + pC.prototype = new u7(); + pC.prototype.constructor = pC; + pC.prototype.a = function() { + return this; + }; + pC.prototype.g9 = function(a10, b10) { + return new kC().$T(a10, b10).x9(); + }; + pC.prototype.$classData = r8({ TXa: 0 }, false, "amf.plugins.document.webapi.validation.ShapeFacetsCandidatesCollector$", { TXa: 1, f: 1 }); + var $oa = void 0; + function apa(a10, b10) { + return a10.Kea().Yg(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = e10.ll, h10 = K7(); + return new qC().ts(g10.ia(f10, h10.u)); + }; + }(a10, b10)), ml()); + } + function bpa(a10, b10, c10, e10, f10, g10, h10) { + h10 || (Tna || (Tna = new nB().a()), h10 = Np(Op(), a10), a10 = new rC().Sx(b10, h10).ye(a10)); + return cpa(new sC().UK(dpa(a10, b10, f10, e10, c10, g10))); + } + function epa(a10) { + H10(); + for (var b10 = fpa(), c10 = Rb(Gb().ab, H10()); !b10.b(); ) { + var e10 = b10.ga(); + c10 = c10.Wh(e10.$.Ll, oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return g10; + }; + }(a10, e10))); + b10 = b10.ta(); + } + a10.J_(c10); + } + function tC() { + this.s$ = this.wc = null; + this.xa = 0; + } + tC.prototype = new u7(); + tC.prototype.constructor = tC; + tC.prototype.a = function() { + return this; + }; + function gpa(a10) { + 0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24 && (a10.wc = ba.JSON.parse('{"schemaId":"auto", "unknownFormats": "ignore", "allErrors": true, "validateSchema": false, "multipleOfPrecision": 6}'), a10.xa = (1 | a10.xa) << 24 >> 24); + return a10.wc; + } + function hpa() { + if (void 0 === ba.Ajv) + throw mb(E6(), new nb().e("Cannot find global Ajv object")); + return ba.Ajv; + } + tC.prototype.t$ = function() { + var a10 = new (hpa())(0 === (2 & this.xa) << 24 >> 24 ? ipa(this) : this.s$).addMetaSchema(jpa()); + return kpa(a10); + }; + function kpa(a10) { + return a10.addFormat("RFC2616", "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (0[1-9]|[12][0-9]|3[01]) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{4}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60) (GMT)$").addFormat("rfc2616", "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (0[1-9]|[12][0-9]|3[01]) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([0-9]{4}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60) (GMT)$").addFormat("date-time-only", "^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?$").addFormat( + "date", + "^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$" + ); + } + function ipa(a10) { + 0 === (2 & a10.xa) << 24 >> 24 && (a10.s$ = ba.JSON.parse('{"schemaId":"auto", "unknownFormats": "ignore", "allErrors": false, "validateSchema": false, "multipleOfPrecision": 6}'), a10.xa = (2 | a10.xa) << 24 >> 24); + return a10.s$; + } + tC.prototype.$classData = r8({ YXa: 0 }, false, "amf.plugins.document.webapi.validation.remote.AjvValidator$", { YXa: 1, f: 1 }); + var lpa = void 0; + function mpa() { + lpa || (lpa = new tC().a()); + return lpa; + } + function uC() { + this.Id = this.gh = null; + this.xa = false; + } + uC.prototype = new u7(); + uC.prototype.constructor = uC; + uC.prototype.a = function() { + this.Id = '{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string","format":"uri"},"$schema":{"type":"string","format":"uri"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}'; + return this; + }; + function jpa() { + npa || (npa = new uC().a()); + var a10 = npa; + a10.xa || a10.xa || (a10.gh = ba.JSON.parse(a10.Id), a10.xa = true); + return a10.gh; + } + uC.prototype.$classData = r8({ $Xa: 0 }, false, "amf.plugins.document.webapi.validation.remote.Draft4MetaSchema$", { $Xa: 1, f: 1 }); + var npa = void 0; + function vC() { + this.Gka = this.uo = null; + this.xa = 0; + } + vC.prototype = new u7(); + vC.prototype.constructor = vC; + vC.prototype.a = function() { + return this; + }; + vC.prototype.t$ = function() { + 0 === (2 & this.xa) << 24 >> 24 && 0 === (2 & this.xa) << 24 >> 24 && (this.Gka = mpa().t$(), this.xa = (2 | this.xa) << 24 >> 24); + return this.Gka; + }; + vC.prototype.$classData = r8({ dYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.LazyAjv$", { dYa: 1, f: 1 }); + var opa = void 0; + function ppa() { + opa || (opa = new vC().a()); + return opa; + } + function qpa(a10, b10) { + return aq(new bq(), !b10.Od(w6(/* @__PURE__ */ function() { + return function(c10) { + return c10.zm === Yb().qb; + }; + }(a10))), "http://test.com/payload#validations", a10.RV, b10); + } + function wC() { + } + wC.prototype = new u7(); + wC.prototype.constructor = wC; + wC.prototype.a = function() { + return this; + }; + function rpa(a10, b10) { + return b10 instanceof Vh ? B6(b10.aa, xn().Le).Od(w6(/* @__PURE__ */ function() { + return function(c10) { + return spa(tpa(), c10); + }; + }(a10))) : false; + } + function spa(a10, b10) { + if (b10 instanceof Mh) { + a10 = B6(b10.aa, Fg().af).A; + if (a10.b()) + return false; + a10 = a10.c(); + b10 = Uh().zj; + return a10 === b10; + } + return false; + } + wC.prototype.$classData = r8({ fYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.ScalarPayloadForParam$", { fYa: 1, f: 1 }); + var upa = void 0; + function tpa() { + upa || (upa = new wC().a()); + return upa; + } + function xC() { + this.$ca = this.TW = this.cp = this.eca = this.nL = this.H9 = this.Xda = this.Qf = this.Aea = this.kda = this.Kd = this.pa = this.le = this.jk = this.lp = this.Kl = this.hu = this.jv = this.Uea = null; + } + xC.prototype = new u7(); + xC.prototype.constructor = xC; + xC.prototype.a = function() { + vpa = this; + var a10 = F6().Ta; + this.Uea = ic(G5(a10, "WebAPI")); + a10 = F6().Ta; + this.jv = ic(G5(a10, "DocumentationItem")); + a10 = F6().Ta; + this.hu = ic(G5(a10, "EndPoint")); + a10 = F6().Ta; + this.Kl = ic(G5(a10, "Operation")); + a10 = F6().Ta; + this.lp = ic(G5(a10, "Response")); + a10 = F6().Ta; + this.jk = ic(G5(a10, "Request")); + a10 = F6().Ta; + this.le = ic(G5(a10, "Payload")); + a10 = F6().Ua; + this.pa = ic(G5(a10, "Shape")); + a10 = F6().Ta; + this.Kd = ic(G5(a10, "Example")); + a10 = F6().Ta; + this.kda = ic(G5(a10, "ResourceType")); + a10 = F6().Ta; + this.Aea = ic(G5(a10, "Trait")); + a10 = F6().Ta; + this.Qf = ic(G5(a10, "SecurityScheme")); + a10 = F6().Ta; + this.Xda = ic(G5(a10, "SecuritySettings")); + a10 = F6().Zd; + this.H9 = ic(G5(a10, "CustomDomainProperty")); + a10 = F6().Zd; + this.nL = ic(G5(a10, "Module")); + a10 = F6().Zd; + this.eca = ic(G5(a10, "AbstractDocument")); + a10 = F6().Zd; + this.cp = ic(G5(a10, "PartialDocument")); + a10 = new R6().M(this.Uea, "API"); + var b10 = new R6().M(this.jv, "DocumentationItem"), c10 = new R6().M(this.hu, "Resource"), e10 = new R6().M(this.Kl, "Method"), f10 = new R6().M(this.lp, "Response"), g10 = new R6().M(this.jk, "RequestBody"), h10 = new R6().M(this.le, "ResponseBody"), k10 = new R6().M(this.pa, "TypeDeclaration"), l10 = new R6().M( + this.Kd, + "Example" + ), m10 = new R6().M(this.kda, "ResourceType"), p10 = new R6().M(this.Aea, "Trait"), t10 = new R6().M(this.Qf, "SecurityScheme"), v10 = new R6().M(this.Xda, "SecuritySchemeSettings"), A10 = new R6().M(this.H9, "AnnotationType"), D10 = new R6().M(this.nL, "Library"), C10 = new R6().M(this.eca, "Overlay"); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, new R6().M(this.cp, "Extension")]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = this.TW = b10.eb; + b10 = w6(/* @__PURE__ */ function() { + return function(I10) { + if (null !== I10) { + var L10 = I10.ma(); + I10 = I10.ya(); + return new R6().M(I10, L10); + } + throw new x7().d(I10); + }; + }(this)); + c10 = yC(); + c10 = zC(c10); + this.$ca = Jd(a10, b10, c10); + return this; + }; + xC.prototype.$classData = r8({ hYa: 0 }, false, "amf.plugins.document.webapi.vocabulary.VocabularyMappings$", { hYa: 1, f: 1 }); + var vpa = void 0; + function Zx() { + vpa || (vpa = new xC().a()); + return vpa; + } + function AC() { + } + AC.prototype = new u7(); + AC.prototype.constructor = AC; + AC.prototype.a = function() { + return this; + }; + function wpa(a10, b10) { + a10 = Od(O7(), b10); + b10 = new S6().a(); + return new vh().K(b10, a10); + } + AC.prototype.$classData = r8({ CYa: 0 }, false, "amf.plugins.domain.shapes.models.AnyShape$", { CYa: 1, f: 1 }); + var xpa = void 0; + function ypa() { + xpa || (xpa = new AC().a()); + return xpa; + } + function BC() { + } + BC.prototype = new u7(); + BC.prototype.constructor = BC; + BC.prototype.a = function() { + return this; + }; + BC.prototype.$classData = r8({ HYa: 0 }, false, "amf.plugins.domain.shapes.models.CreativeWork$", { HYa: 1, f: 1 }); + var zpa = void 0; + function CC() { + } + CC.prototype = new u7(); + CC.prototype.constructor = CC; + CC.prototype.a = function() { + return this; + }; + function Apa(a10, b10) { + a10 = Od(O7(), b10); + b10 = new S6().a(); + return new en().K(b10, a10); + } + CC.prototype.$classData = r8({ IYa: 0 }, false, "amf.plugins.domain.shapes.models.Example$", { IYa: 1, f: 1 }); + var Bpa = void 0; + function Cpa() { + Bpa || (Bpa = new CC().a()); + return Bpa; + } + function DC() { + } + DC.prototype = new u7(); + DC.prototype.constructor = DC; + DC.prototype.a = function() { + return this; + }; + function Dpa(a10, b10, c10, e10) { + b10 instanceof vh && B6(b10.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + if (Za(k10).na()) + return k10.x.Lb(Epa(EC(), g10, k10, new z7().d(h10))); + var l10 = Ab(k10.x, q5(FC)); + l10 = l10.b() || l10.c().Ds.Ha(h10) ? l10 : y7(); + l10.b() || (l10.c(), k10.x.Lb(Epa(EC(), g10, k10, y7()))); + }; + }(a10, c10, e10))); + return b10; + } + function Fpa(a10, b10, c10) { + b10 instanceof vh && B6(b10.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = Ab(g10.x, q5(FC)); + if (!h10.b()) { + h10 = h10.c(); + var k10 = g10.x, l10 = k10.hf; + Ef(); + var m10 = Jf(new Kf(), new Lf().a()); + for (l10 = l10.Dc; !l10.b(); ) { + var p10 = l10.ga(); + false !== !(p10 instanceof GC) && Of(m10, p10); + l10 = l10.ta(); + } + k10.hf = m10.eb; + g10.x.Lb(new GC().hk(h10.Ds.Qs(f10))); + } + }; + }(a10, c10))); + } + function Epa(a10, b10, c10, e10) { + a10 = Ab(c10.x, q5(FC)); + if (a10.b()) + return Gpa(Hpa(), b10); + a10 = a10.c(); + c10 = c10.x; + var f10 = c10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof GC) && Of(g10, h10); + f10 = f10.ta(); + } + c10.hf = g10.eb; + return new GC().hk(a10.Ds.Zj(b10).W4(e10.ua())); + } + function HC(a10, b10, c10, e10) { + b10 instanceof vh && B6(b10.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + return k10.x.Lb(Epa(EC(), g10, k10, h10)); + }; + }(a10, c10, e10))); + return b10; + } + DC.prototype.$classData = r8({ JYa: 0 }, false, "amf.plugins.domain.shapes.models.ExampleTracking$", { JYa: 1, f: 1 }); + var Ipa = void 0; + function EC() { + Ipa || (Ipa = new DC().a()); + return Ipa; + } + function IC() { + } + IC.prototype = new u7(); + IC.prototype.constructor = IC; + IC.prototype.a = function() { + return this; + }; + function Jpa(a10, b10) { + if (b10 === Uh().zj) + return Ee4(); + if (b10 === Uh().hi) + return Fe(); + if (b10 === Uh().of) + return Je(); + if (b10 === Uh().Xo) + return ef(); + if (b10 === Uh().Mi) + return Pe2(); + if (b10 === Uh().tj) + return Ue(); + if (b10 === Uh().Ly) + return cf(); + throw mb(E6(), new kf().e("Unknown mapping: " + b10)); + } + function Kpa(a10) { + if (a10 === Uh().zj) + return "string"; + if (a10 === Uh().hi) + return "integer"; + if (a10 === Uh().Xo || a10 === Uh().of || a10 === Uh().Nh) + return "number"; + if (a10 === Uh().Mi) + return "boolean"; + if (a10 === Uh().tj) + return "date"; + if (a10 === Uh().Ly) + return "file"; + throw mb(E6(), new kf().e("Unknown mapping: " + a10)); + } + function Cma(a10, b10) { + return b10 === Uh().zj ? Ee4() : b10 === Uh().hi ? Fe() : b10 === Uh().mr ? Ge() : b10 === Uh().of ? Je() : b10 === Uh().Nh ? Ke() : b10 === Uh().Xo ? ef() : b10 === Uh().Mi ? Pe2() : b10 === Uh().tj ? Ue() : b10 === Uh().NA ? We() : b10 === Uh().hw ? Xe() : b10 === Uh().jo ? Ye() : b10 === Uh().rx ? Be3() : b10 === Uh().MA ? Ce() : b10 === Uh().bB ? De2() : ff(); + } + IC.prototype.$classData = r8({ FZa: 0 }, false, "amf.plugins.domain.shapes.parser.TypeDefXsdMapping$", { FZa: 1, f: 1 }); + var Lpa = void 0; + function hz() { + Lpa || (Lpa = new IC().a()); + return Lpa; + } + function JC() { + } + JC.prototype = new u7(); + JC.prototype.constructor = JC; + JC.prototype.a = function() { + return this; + }; + JC.prototype.$classData = r8({ GZa: 0 }, false, "amf.plugins.domain.shapes.parser.TypeDefYTypeMapping$", { GZa: 1, f: 1 }); + var Mpa = void 0; + function KC() { + } + KC.prototype = new u7(); + KC.prototype.constructor = KC; + KC.prototype.a = function() { + return this; + }; + function LC(a10, b10) { + if (Ee4() === b10) + return Uh().zj; + if (Fe() === b10) + return Uh().hi; + if (Ge() === b10) + return Uh().mr; + if (Je() === b10) + return Uh().of; + if (Ke() === b10) + return Uh().Nh; + if (ef() === b10) + return Uh().Xo; + if (Pe2() === b10) + return Uh().Mi; + if (Ue() === b10) + return Uh().tj; + if (We() === b10) + return Uh().NA; + if (Xe() === b10) + return Uh().hw; + if (Ye() === b10) + return Uh().jo; + if (Be3() === b10) + return Uh().rx; + if (Ce() === b10) + return Uh().MA; + if (De2() === b10) + return Uh().bB; + throw mb(E6(), new kf().e("Unknown mapping")); + } + function Npa(a10) { + MC(); + return "string" === a10 ? new R6().M(new z7().d(Uh().zj), new z7().d("")) : "number" === a10 || "float" === a10 || "double" === a10 ? new R6().M(new z7().d(Uh().Xo), new z7().d("")) : "integer" === a10 ? new R6().M(new z7().d(Uh().hi), new z7().d("")) : "date" === a10 ? new R6().M(new z7().d(Uh().tj), new z7().d("RFC2616")) : "boolean" === a10 ? new R6().M(new z7().d(Uh().Mi), new z7().d("")) : "file" === a10 ? new R6().M(new z7().d(Uh().Ly), new z7().d("")) : new R6().M(y7(), y7()); + } + KC.prototype.$classData = r8({ HZa: 0 }, false, "amf.plugins.domain.shapes.parser.XsdTypeDefMapping$", { HZa: 1, f: 1 }); + var Opa = void 0; + function MC() { + Opa || (Opa = new KC().a()); + return Opa; + } + function NC() { + this.l = this.ek = null; + } + NC.prototype = new u7(); + NC.prototype.constructor = NC; + function OC(a10, b10) { + var c10 = new NC(); + c10.ek = b10; + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + return c10; + } + NC.prototype.dI = function() { + var a10 = new th().K(this.ek.Y(), this.ek.fa()); + return Rd(a10, this.ek.j); + }; + NC.prototype.$classData = r8({ NZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.AnyShapeAdjuster$AnyShapeConverter", { NZa: 1, f: 1 }); + function Ppa() { + this.ob = null; + this.pn = false; + this.Wg = this.Em = null; + this.$aa = false; + this.jna = null; + } + Ppa.prototype = new u7(); + Ppa.prototype.constructor = Ppa; + function Qpa(a10, b10, c10, e10) { + var f10 = new Ppa(); + f10.ob = a10; + f10.pn = b10; + f10.Em = c10; + f10.Wg = e10; + f10.$aa = c10.h(qk()); + f10.jna = new PC().nU(f10); + return f10; + } + function QC(a10, b10, c10) { + try { + return Rpa(a10.jna, b10, c10); + } catch (l10) { + c10 = Ph(E6(), l10); + if (c10 instanceof Hi) { + a10 = a10.ob; + var e10 = Mo().JR, f10 = b10.j, g10 = c10.p2; + g10 = g10.b() ? new z7().d(ic(qf().xd.r)) : g10; + var h10 = c10.L1; + a10.Gc(e10.j, f10, g10, c10.tt, c10.l2, Yb().qb, h10); + return b10; + } + if (null !== c10) { + a10 = a10.ob; + e10 = dc().Fh; + f10 = b10.j; + g10 = new z7().d(ic(qf().xd.r)); + c10 = c10.xo(); + h10 = Ab(b10.fa(), q5(jd)); + var k10 = b10.Ib(); + a10.Gc(e10.j, f10, g10, c10, h10, Yb().qb, k10); + return b10; + } + throw l10; + } + } + Ppa.prototype.$classData = r8({ UZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.NormalizationContext", { UZa: 1, f: 1 }); + function RC() { + } + RC.prototype = new u7(); + RC.prototype.constructor = RC; + RC.prototype.a = function() { + return this; + }; + function Spa(a10, b10, c10, e10, f10, g10) { + var h10 = $ba($f(), c10, false); + return Tpa(a10, h10, b10, f10, e10).XW(b10, g10).D3(h10, c10); + } + function Upa(a10, b10, c10, e10, f10) { + var g10 = vp(), h10 = B6(c10.g, sl().Nd).A; + return Tpa(a10, h10.b() ? null : h10.c(), b10, f10, e10).XW(b10, g10).C3(c10); + } + RC.prototype.A3 = function(a10, b10, c10) { + var e10 = Rb(Ut(), H10()); + b10 = w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + var m10 = l10.pa, p10 = B6(l10.le.g, sl().Nd).A; + m10 = g10.Ja(new R6().M(m10, p10.b() ? null : p10.c())); + if (m10 instanceof z7) + m10 = m10.i; + else { + m10 = SC(); + p10 = B6(l10.le.g, sl().Nd).A; + m10 = Tpa(m10, p10.b() ? null : p10.c(), l10.pa, h10, k10); + p10 = l10.pa; + var t10 = vp(); + m10 = m10.XW(p10, t10); + p10 = l10.pa; + t10 = B6(l10.le.g, sl().Nd).A; + g10.Ue(new R6().M(p10, t10.b() ? null : t10.c()), m10); + } + return m10.C3(l10.le); + }; + }(this, e10, c10, b10)); + c10 = K7(); + a10 = a10.ka(b10, c10.u); + b10 = hp(); + c10 = K7(); + return Bfa(b10, a10, c10.u).Yg(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + l10 = l10.ll; + TC(); + var m10 = Gb().si; + return l10.nk(UC(m10)); + }; + }(f10)), k10 = K7(); + g10 = g10.bd(h10, k10.u); + return aq(new bq(), !g10.Od(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.zm === Yb().qb; + }; + }(f10))), "", VC(WC(), ""), g10); + }; + }(this)), ml()); + }; + function Tpa(a10, b10, c10, e10, f10) { + a10 = Vpa(a10, b10, c10, e10); + return a10.b() ? new XC().e(f10) : a10.c(); + } + function Vpa(a10, b10, c10, e10) { + return iia(qq(), b10).Fb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10.rja(g10); + }; + }(a10, c10, e10))); + } + function Wpa(a10, b10, c10, e10, f10) { + a10 = Vpa(a10, c10, b10, e10, Yb().qb); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.XW(b10, f10)); + } + RC.prototype.$classData = r8({ c_a: 0 }, false, "amf.plugins.domain.shapes.validation.PayloadValidationPluginsHandler$", { c_a: 1, f: 1 }); + var Xpa = void 0; + function SC() { + Xpa || (Xpa = new RC().a()); + return Xpa; + } + function YC() { + } + YC.prototype = new u7(); + YC.prototype.constructor = YC; + YC.prototype.a = function() { + return this; + }; + function Roa(a10, b10) { + return b10 instanceof Vi && (a10 = B6(b10.aa, Wi().vf).A, a10.b() ? a10 = false : (a10 = a10.c(), a10 = xja($f(), a10)), a10) ? "application/xml" : "application/json"; + } + function Ypa(a10, b10) { + b10.KB().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = e10.P(f10), h10 = qf().ch; + return Rg(f10, h10, g10.r, g10.x); + }; + }(a10, b10))); + } + function Zpa(a10, b10, c10, e10) { + var f10 = Rb(Ut(), H10()); + b10 = b10.am(w6(/* @__PURE__ */ function() { + return function(p10) { + return p10.pa; + }; + }(a10))); + var g10 = pd(b10); + Xd(); + b10 = wd(new xd(), vd()); + for (g10 = g10.th.Er(); g10.Ya(); ) { + var h10 = g10.$a(); + if (null !== h10 && B6(h10.Y(), qf().ch).Da()) { + var k10 = hd(h10.Y(), qf().ch).c().r; + f10.Ue(h10, k10); + k10 = B6(h10.Y(), qf().ch); + var l10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return aC(t10, Tf(Uf(), v10, Roa(Soa(), v10))); + }; + }(a10, h10)), m10 = K7(); + k10 = k10.ka(l10, m10.u); + it2(h10.Y(), qf().ch); + h10 = k10; + } else + h10 = H10(); + h10 = h10.Hd(); + yi(b10, h10); + } + b10 = b10.eb; + return SC().A3(b10.ke(), c10, e10).Yg(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + Ypa( + Soa(), + t10 + ); + return v10; + }; + }(a10, f10)), ml()); + } + YC.prototype.A3 = function(a10, b10, c10) { + return Zpa(this, a10, b10, c10).Pq(w6(/* @__PURE__ */ function(e10, f10, g10, h10) { + return function(k10) { + return k10.pB ? SC().A3(f10.Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + l10 = l10.le.g; + var m10 = sl().nb; + return l10.vb.Ha(m10); + }; + }(e10))), g10, h10) : ZC(hp(), k10); + }; + }(this, a10, b10, c10)), ml()); + }; + YC.prototype.$classData = r8({ f_a: 0 }, false, "amf.plugins.domain.shapes.validation.ShapesNodesValidator$", { f_a: 1, f: 1 }); + var $pa = void 0; + function Soa() { + $pa || ($pa = new YC().a()); + return $pa; + } + function $C() { + } + $C.prototype = new u7(); + $C.prototype.constructor = $C; + $C.prototype.a = function() { + return this; + }; + function aqa(a10, b10) { + a10 = Od(O7(), b10); + return new Wl().K(new S6().a(), a10); + } + $C.prototype.$classData = r8({ C0a: 0 }, false, "amf.plugins.domain.webapi.models.Parameter$", { C0a: 1, f: 1 }); + var bqa = void 0; + function cqa() { + bqa || (bqa = new $C().a()); + return bqa; + } + function aD() { + } + aD.prototype = new u7(); + aD.prototype.constructor = aD; + aD.prototype.a = function() { + return this; + }; + function dqa(a10, b10) { + a10 = Od(O7(), b10); + return new Em().K(new S6().a(), a10); + } + aD.prototype.$classData = r8({ G0a: 0 }, false, "amf.plugins.domain.webapi.models.Response$", { G0a: 1, f: 1 }); + var eqa = void 0; + function fqa() { + eqa || (eqa = new aD().a()); + return eqa; + } + function bD() { + } + bD.prototype = new u7(); + bD.prototype.constructor = bD; + bD.prototype.a = function() { + return this; + }; + function gqa(a10, b10) { + a10 = Od(O7(), b10); + b10 = new S6().a(); + return new vm().K(b10, a10); + } + bD.prototype.$classData = r8({ o1a: 0 }, false, "amf.plugins.domain.webapi.models.security.SecurityScheme$", { o1a: 1, f: 1 }); + var hqa = void 0; + function iqa() { + hqa || (hqa = new bD().a()); + return hqa; + } + function cD() { + } + cD.prototype = new u7(); + cD.prototype.constructor = cD; + cD.prototype.a = function() { + return this; + }; + function dD(a10, b10) { + a10 = Od(O7(), b10); + b10 = new S6().a(); + return new Vm().K(b10, a10); + } + cD.prototype.$classData = r8({ r1a: 0 }, false, "amf.plugins.domain.webapi.models.templates.ResourceType$", { r1a: 1, f: 1 }); + var jqa = void 0; + function eD() { + jqa || (jqa = new cD().a()); + return jqa; + } + function fD() { + } + fD.prototype = new u7(); + fD.prototype.constructor = fD; + fD.prototype.a = function() { + return this; + }; + function gD(a10, b10) { + a10 = Od(O7(), b10); + b10 = new S6().a(); + return new Tm().K(b10, a10); + } + fD.prototype.$classData = r8({ s1a: 0 }, false, "amf.plugins.domain.webapi.models.templates.Trait$", { s1a: 1, f: 1 }); + var kqa = void 0; + function hD() { + kqa || (kqa = new fD().a()); + return kqa; + } + function iD() { + } + iD.prototype = new u7(); + iD.prototype.constructor = iD; + function lqa(a10, b10, c10, e10) { + e10 = mqa(a10, c10.Ve().ua(), e10); + e10 = e10.b() ? c10 : e10.c(); + var f10 = nqa(e10, w6(/* @__PURE__ */ function() { + return function(l10) { + return l10 instanceof bg; + }; + }(a10))), g10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return new R6().M(p10, m10); + }; + }(a10, e10)), h10 = K7(); + f10 = f10.ka(g10, h10.u); + g10 = nqa(c10, w6(/* @__PURE__ */ function() { + return function(l10) { + return !(l10 instanceof bg); + }; + }(a10))); + h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return new R6().M(p10, m10); + }; + }(a10, c10)); + var k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = K7(); + f10.ia(g10, h10.u).U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + if (null !== p10) { + var t10 = p10.ma(); + p10 = p10.ya(); + $h(m10.pe(), t10); + oqa(GB(), t10, m10, p10); + } else + throw new x7().d(p10); + }; + }(a10, b10))); + pqa(a10, b10, e10); + (null === e10 ? null === c10 : e10.h(c10)) || pqa(a10, b10, c10); + } + iD.prototype.a = function() { + return this; + }; + function nqa(a10, b10) { + return Zc(a10) ? a10.tk().Cb(b10) : H10(); + } + function mqa(a10, b10, c10) { + a: + for (; ; ) { + var e10 = false, f10 = null; + if (b10 instanceof Vt && (e10 = true, f10 = b10, b10 = f10.Wn, Kk(b10))) { + var g10 = c10, h10 = Ab(b10.fa(), q5(Bb)); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(h10.da)); + if (h10.Ha(g10)) + return new z7().d(b10); + } + if (e10) { + e10 = f10.Wn; + f10 = mqa(a10, f10.Nf, c10); + if (f10 instanceof z7) + return f10; + b10 = e10.Ve().ua(); + continue a; + } + return y7(); + } + } + function qqa(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10) { + t10 = t10.b() ? rqa(GB(), b10) : t10.c(); + b10 = J5(Ef(), H10()); + lqa(a10, t10, c10, k10.da.Rf); + p10.U(w6(/* @__PURE__ */ function(L10, Y10) { + return function(ia) { + if (null !== ia) { + var pa = ia.ma(), La = ia.ya(); + ia = Y10.pe(); + var ob = Y10.pe().ij; + La = jD(new kD(), La, y7()); + ia.ij = ob.cc(new R6().M(pa, La)); + } else + throw new x7().d(ia); + }; + }(a10, t10))); + c10 = bp(); + var v10 = new lD().ue(t10.lj); + c10 = gp(c10); + var A10 = c10.$o.lu(v10.Me, oq(/* @__PURE__ */ function() { + return function() { + return J5(Ef(), H10()); + }; + }(c10))); + p10 = c10.vw; + c10.vw = true; + c10.$o = c10.$o.Wh(v10.Me, J5(Ef(), H10())); + var D10 = Mc(ua(), f10, "\\."), C10 = -1 + D10.n.length | 0; + C10 = 0 < C10 ? C10 : 0; + var I10 = D10.n.length; + C10 = C10 < I10 ? C10 : I10; + C10 = 0 < C10 ? C10 : 0; + I10 = Mu(Nu(), Ou(la(D10)), C10); + 0 < C10 && Pu(Gd(), D10, 0, I10, 0, C10); + D10 = sqa(t10, mD(Gb(), I10), t10.pe()); + D10 = t10.TS(tqa(t10.pe(), D10)); + D10.pe().Ko.uq(D10.pe().Ro).U(w6(/* @__PURE__ */ function(L10, Y10) { + return function(ia) { + return $h(Y10.pe(), ia.ya()); + }; + }(a10, t10))); + D10.iv = iA().W7; + nD(D10.$h.x0(), k10, w6(/* @__PURE__ */ function(L10, Y10) { + return function() { + O7(); + var ia = new P6().a(), pa = new S6().a(); + ia = new Kl().K(pa, ia); + return Rd(ia, Y10 + "/applied"); + }; + }(a10, g10)), y7(), b10, true).hd(); + yi(t10.FE, D10.FE); + v10.Me === uqa().Me ? c10.$o = c10.$o.Wh(v10.Me, J5(Ef(), H10())) : (t10 = c10.$o.lu(v10.Me, oq(/* @__PURE__ */ function() { + return function() { + return J5( + Ef(), + H10() + ); + }; + }(c10))).Cb(w6(/* @__PURE__ */ function(L10, Y10) { + return function() { + return Y10.vba(); + }; + }(c10, v10))), D10 = c10.$o, v10 = v10.Me, A10 = ws(new Lf().a(), A10), c10.$o = D10.Wh(v10, ws(A10, t10)), c10.vw = p10); + b10 = b10.ua(); + if (b10 instanceof Vt) + return e10 = b10.Wn, h10 && vqa(a10, e10, g10, m10), wqa(new EB().mt(h10, l10), e10); + if (H10().h(b10)) + return a10 = Mo().T7, h10 = y7(), f10 = "Couldn't parse an endpoint from resourceType '" + f10 + "'.", m10 = Ab(e10.fa(), q5(jd)), b10 = yb(e10), l10.Gc(a10.j, g10, h10, f10, m10, Yb().qb, b10), new oD().Tq(e10.j, k10); + throw new x7().d(b10); + } + function pqa(a10, b10, c10) { + c10.Ve().U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = false, l10 = null; + l10 = null; + if (Kk(h10) && (k10 = true, l10 = h10, !(l10 instanceof zl || l10 instanceof Dl))) { + h10 = f10.pe(); + k10 = Lc(l10); + k10 = k10.b() ? l10.j : k10.c(); + var m10 = l10, p10 = h10.ij; + m10 = jD(new kD(), m10.qe(), Lc(m10)); + h10.ij = p10.cc(new R6().M(k10, m10)); + pqa(GB(), f10, l10); + return; + } + if (Zc(h10)) + l10 = Ab(g10.fa(), q5(Rc)), (l10.b() ? new tB().hk(J5(Gb().Qg, H10())) : l10.c()).Xb.U(w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + a: { + if (null !== C10) { + var I10 = C10.ma(), L10 = C10.ya(); + if (null !== L10) { + if (A10.j === L10.ma()) { + C10 = D10.pe().xi.mb(); + for (L10 = false; !L10 && C10.Ya(); ) + L10 = C10.$a().ma(), L10 = null === L10 ? null === I10 : ra(L10, I10); + C10 = !L10; + } else + C10 = false; + if (C10) { + C10 = H10(); + K7(); + pj(); + L10 = new Lf().a(); + L10 = new Aq().zo("", L10.ua(), new Mq().a(), Nq(), y7()); + var Y10 = D10.Hp(), ia = y7(), pa = y7(), La = iA().ho; + C10 = new hA().il("", C10, L10, ia, pa, Y10, La); + A10.tk().U(w6(/* @__PURE__ */ function(ob, zb, Zb) { + return function(Cc) { + oqa(GB(), Cc, zb, Zb); + }; + }(v10, C10, A10))); + D10.pe().xi = D10.pe().xi.cc(new R6().M(I10, C10.Qh)); + } + break a; + } + } + throw new x7().d(C10); + } + }; + }(e10, h10, f10))), pqa(GB(), f10, h10); + else if (!k10) { + l10 = dc().Fh; + k10 = y7(); + p10 = h10.j; + m10 = Ab(h10.fa(), q5(jd)); + var t10 = Lc(h10); + f10.Gc( + l10.j, + p10, + k10, + "Error resolving nested declaration, found something that is not a library or a fragment", + m10, + Yb().qb, + t10 + ); + return h10; + } + }; + }(a10, b10, c10))); + } + function vqa(a10, b10, c10, e10) { + var f10 = new rB().Uq(c10, e10), g10 = b10.Y().vb, h10 = mz(); + h10 = Ua(h10); + var k10 = Id().u; + g10 = Jd(g10, h10, k10).kc(); + g10.b() ? g10 = false : (h10 = g10.c().r.x, g10 = new xqa().a(), h10 = h10.hf, k10 = Ef().u, g10 = xs(h10, g10, k10).Od(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.nw === m10; + }; + }(a10, c10)))); + g10 || (b10 = b10.Y().vb, g10 = mz(), g10 = Ua(g10), h10 = Id().u, Jd(b10, g10, h10).U(w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + v10.r.x.Lb(m10); + v10 = v10.r.r; + if (Rk(v10)) + vqa(GB(), v10, p10, t10); + else if (v10 instanceof $r) + v10.wb.U(w6(/* @__PURE__ */ function(A10, D10, C10, I10) { + return function(L10) { + if (Rk(L10)) + L10.fa().Lb(D10), vqa(GB(), L10, C10, I10); + else + return L10.fa().Lb(D10); + }; + }( + l10, + m10, + p10, + t10 + ))); + else + return v10.fa().Lb(m10); + }; + }(a10, f10, c10, e10)))); + } + function FB(a10, b10, c10) { + a10 = c10.Ve(); + b10 = new yqa().e(b10); + return Jc(a10, b10); + } + function rqa(a10, b10) { + return qk().h(b10) ? new zqa().a() : new Aqa().a(); + } + function Bqa(a10, b10, c10, e10, f10, g10, h10, k10, l10) { + var m10 = l10.b() ? rqa(GB(), b10) : l10.c(); + lqa(a10, m10, c10, h10.i.da.Rf); + k10.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(), L10 = C10.ya(); + C10 = D10.pe(); + var Y10 = D10.pe().ij; + L10 = jD(new kD(), L10, y7()); + C10.ij = Y10.cc(new R6().M(I10, L10)); + } else + throw new x7().d(C10); + }; + }(a10, m10))); + k10 = bp(); + l10 = new lD().ue(m10.lj); + k10 = gp(k10); + var p10 = k10.$o.lu(l10.Me, oq(/* @__PURE__ */ function() { + return function() { + return J5(Ef(), H10()); + }; + }(k10))); + b10 = k10.vw; + k10.vw = true; + k10.$o = k10.$o.Wh(l10.Me, J5(Ef(), H10())); + e10 = Mc(ua(), e10, "\\."); + var t10 = -1 + e10.n.length | 0; + t10 = 0 < t10 ? t10 : 0; + var v10 = e10.n.length; + t10 = t10 < v10 ? t10 : v10; + t10 = 0 < t10 ? t10 : 0; + v10 = Mu(Nu(), Ou(la(e10)), t10); + 0 < t10 && Pu(Gd(), e10, 0, v10, 0, t10); + e10 = sqa(m10, mD(Gb(), v10), m10.pe()); + e10 = m10.TS(tqa(m10.pe(), e10)); + e10.pe().Ko.uq(e10.pe().Ro).U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + return $h(D10.pe(), C10.ya()); + }; + }(a10, m10))); + e10.iv = iA().f8; + h10 = oy(e10.$h.Kna(), h10, w6(/* @__PURE__ */ function(A10, D10) { + return function() { + O7(); + var C10 = new P6().a(); + C10 = new Ql().K(new S6().a(), C10); + return Rd(C10, D10 + "/applied"); + }; + }(a10, f10)), true).g2(); + l10.Me === uqa().Me ? k10.$o = k10.$o.Wh(l10.Me, J5(Ef(), H10())) : (m10 = k10.$o.lu(l10.Me, oq(/* @__PURE__ */ function() { + return function() { + return J5(Ef(), H10()); + }; + }(k10))).Cb(w6(/* @__PURE__ */ function(A10, D10) { + return function() { + return D10.vba(); + }; + }( + k10, + l10 + ))), e10 = k10.$o, l10 = l10.Me, p10 = ws(new Lf().a(), p10), k10.$o = e10.Wh(l10, ws(p10, m10)), k10.vw = b10); + g10 && vqa(a10, h10, f10, FB(0, f10, c10)); + return h10; + } + function oqa(a10, b10, c10, e10) { + var f10 = Ab(b10.fa(), q5(Cqa)); + if (f10 instanceof z7) { + var g10 = f10.i.nF; + f10 = g10.ze; + g10 = pD(g10); + for (var h10 = f10.n[g10]; null !== h10; ) { + var k10 = h10.$a(), l10 = h10.r.Fb(w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + if (null !== A10) { + A10 = A10.j; + var D10 = Lc(v10); + D10 = D10.b() ? "" : D10.c(); + return -1 !== (A10.indexOf(ka(D10)) | 0); + } + return false; + }; + }(a10, e10))); + $h(c10.pe(), b10); + if (qD(b10) && (h10 = b10, l10.na())) { + l10 = l10.c(); + l10 = B6(l10.Y(), l10.Zg()).A; + l10 = l10.b() ? null : l10.c(); + var m10 = B6(h10.Y(), h10.Zg()).A; + m10 = m10.b() ? null : m10.c(); + O7(); + var p10 = new P6().a(); + Sd(h10, l10, p10); + $h(c10.pe(), b10); + O7(); + l10 = new P6().a(); + Sd(h10, m10, l10); + } + for (h10 = k10; null === h10 && 0 < g10; ) + g10 = -1 + g10 | 0, h10 = f10.n[g10]; + } + } else + $h(c10.pe(), b10); + } + function Dqa(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10) { + var p10 = m10.b() ? rqa(GB(), b10) : m10.c(); + k10 = Rb(Ut(), H10()); + var t10 = yb(c10); + t10 = t10.b() ? "" : t10.c(); + t10 = new rD().Hc("", t10); + var v10 = new PA().e(t10.pi), A10 = new qg().e(t10.mi); + tc(A10) && QA(v10, t10.mi); + A10 = v10.s; + var D10 = v10.ca, C10 = new rr().e(D10); + T6(); + or(); + var I10 = Q5().Na, L10 = Ab(g10, q5(Qu)); + L10.b() ? L10 = y7() : (L10 = L10.c(), L10 = new z7().d(L10.ad)); + L10 = L10.ua(); + var Y10 = new Eqa().a(); + L10 = Jc(L10, Y10); + L10 = mr(0, sD(0, f10, I10, ys(L10.b() ? g10 : L10.c())), Q5().Na); + I10 = new PA().e(C10.ca); + iy(new jy(), c10, wh(g10, q5(jd)) ? tD() : Fqa(), true, k10, p10).Ob(I10); + c10 = I10.s; + g10 = [L10]; + if (0 > c10.w) + throw new U6().e("0"); + L10 = g10.length | 0; + p10 = c10.w + L10 | 0; + uD(c10, p10); + Ba(c10.L, 0, c10.L, L10, c10.w); + L10 = c10.L; + var ia = L10.n.length, pa = Y10 = 0, La = g10.length | 0; + ia = La < ia ? La : ia; + La = L10.n.length; + for (ia = ia < La ? ia : La; Y10 < ia; ) + L10.n[pa] = g10[Y10], Y10 = 1 + Y10 | 0, pa = 1 + pa | 0; + c10.w = p10; + pr(C10.s, vD(wD(), I10.s)); + pr(A10, mr(T6(), tr(ur(), C10.s, D10), Q5().sa)); + t10 = new RA().Ac(SA(zs(), t10.pi), v10.s); + v10 = qc(); + A10 = cc().bi; + t10 = N6(t10, v10, A10).sb.ga(); + return Bqa(a10, b10, e10, f10, h10, l10, t10, k10, m10); + } + function Gqa(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10) { + var t10 = m10.b() ? rqa(GB(), c10) : m10.c(), v10 = Rb(Ut(), H10()), A10 = yb(e10); + A10 = A10.b() ? "" : A10.c(); + A10 = new rD().Hc("", A10); + var D10 = new PA().e(A10.pi), C10 = new qg().e(A10.mi); + tc(C10) && QA(D10, A10.mi); + C10 = D10.s; + var I10 = D10.ca, L10 = new rr().e(I10); + T6(); + or(); + var Y10 = Q5().Na, ia = Ab(f10, q5(Qu)); + ia.b() ? ia = y7() : (ia = ia.c(), ia = new z7().d(ia.ad)); + ia = ia.ua(); + var pa = new Hqa().a(); + ia = Jc(ia, pa); + ia = mr(0, sD(0, g10, Y10, ys(ia.b() ? f10 : ia.c())), Q5().Na); + Y10 = new PA().e(L10.ca); + iy(new jy(), e10, wh(f10, q5(jd)) ? tD() : Fqa(), true, v10, t10).Ob(Y10); + f10 = Y10.s; + t10 = [ia]; + if (0 > f10.w) + throw new U6().e("0"); + pa = t10.length | 0; + ia = f10.w + pa | 0; + uD(f10, ia); + Ba(f10.L, 0, f10.L, pa, f10.w); + pa = f10.L; + var La = pa.n.length, ob = 0, zb = 0, Zb = t10.length | 0; + La = Zb < La ? Zb : La; + Zb = pa.n.length; + for (La = La < Zb ? La : Zb; ob < La; ) + pa.n[zb] = t10[ob], ob = 1 + ob | 0, zb = 1 + zb | 0; + f10.w = ia; + pr(L10.s, vD(wD(), Y10.s)); + pr(C10, mr(T6(), tr(ur(), L10.s, I10), Q5().sa)); + A10 = new RA().Ac(SA(zs(), A10.pi), D10.s); + D10 = qc(); + C10 = cc().bi; + A10 = N6(A10, D10, C10).sb.ga(); + return qqa(a10, c10, b10, e10, g10, h10, l10, A10, p10, k10, v10, m10); + } + iD.prototype.$classData = r8({ v1a: 0 }, false, "amf.plugins.domain.webapi.resolution.ExtendsHelper$", { v1a: 1, f: 1 }); + var Iqa = void 0; + function GB() { + Iqa || (Iqa = new iD().a()); + return Iqa; + } + function xD() { + } + xD.prototype = new u7(); + xD.prototype.constructor = xD; + xD.prototype.a = function() { + return this; + }; + function moa(a10, b10, c10) { + if (b10 instanceof Vi && c10 instanceof Vi) { + a10 = B6(c10.aa, Wi().vf).A; + Tia(b10, a10.b() ? null : a10.c(), B6(c10.aa, Wi().vf).x); + a10 = B6(c10.aa, Wi().af).A; + a10 = a10.b() ? null : a10.c(); + c10 = B6(c10.aa, Wi().af).x; + var e10 = Wi().af; + Vd(b10, e10, ih(new jh(), a10, c10)); + } else + b10 instanceof Xk && c10 instanceof Xk ? Jqa(a10, b10, c10) : b10 instanceof bl && c10 instanceof bl && Kqa(a10, b10, c10); + } + function Kqa(a10, b10, c10) { + var e10 = B6(b10.aa, al().Tt), f10 = new Lqa().a(), g10 = K7(); + e10 = e10.ec(f10, g10.u); + B6(c10.aa, al().Tt).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + return m10 instanceof Vi ? k10.Ha(B6(m10.aa, Wi().vf)) ? void 0 : Mqa(l10, m10) : Mqa(l10, js(ks(), l10.j, m10)); + }; + }(a10, e10, b10))); + } + function Jqa(a10, b10, c10) { + var e10 = ls(c10), f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return new R6().M(l10, ar(k10.aa, l10)); + }; + }(a10, c10)), g10 = Xd(); + e10.ka(f10, g10.u).qq(w6(/* @__PURE__ */ function() { + return function(h10) { + return null !== h10; + }; + }(a10))).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + var t10 = k10.aa.vb.Ja(p10); + if (t10 instanceof z7) { + var v10 = t10.i; + v10 = nt2(ot(), v10); + if (!v10.b() && (v10 = v10.c().ma(), v10 instanceof el)) { + moa(noa(), v10, m10); + return; + } + } + if (y7() === t10) + return Nqa(k10, p10, js(ks(), k10.j, m10), Ti(l10.aa, p10).x); + throw new x7().d(t10); + } + throw new x7().d(m10); + }; + }(a10, b10, c10))); + } + xD.prototype.$classData = r8({ A1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.DataNodeMerging$", { A1a: 1, f: 1 }); + var Oqa = void 0; + function noa() { + Oqa || (Oqa = new xD().a()); + return Oqa; + } + function yD() { + this.v2 = null; + } + yD.prototype = new u7(); + yD.prototype.constructor = yD; + yD.prototype.a = function() { + Pqa = this; + this.v2 = new wu().a(); + return this; + }; + function Qqa(a10, b10, c10, e10) { + b10 instanceof Bm && c10 instanceof Bm ? Rqa(a10, b10, e10, B6(b10.g, zD().Ne), B6(c10.g, zD().Ne)) : b10 instanceof Em && c10 instanceof Em ? Rqa(a10, b10, e10, B6(b10.g, zD().Ne), B6(c10.g, zD().Ne)) : b10 instanceof Kl && c10 instanceof Kl && Sqa(a10, e10, b10, c10); + } + function Rqa(a10, b10, c10, e10, f10) { + var g10 = /* @__PURE__ */ function(k10) { + return function(l10) { + return l10.Da() && l10.oh(w6(/* @__PURE__ */ function() { + return function(m10) { + return null !== m10 && !wh(m10.x, q5(Tqa)); + }; + }(k10))); + }; + }(a10); + if (g10(e10) && g10(f10) && (e10 = e10.oh(w6(/* @__PURE__ */ function() { + return function(k10) { + return B6(k10.g, xm().Nd).A.na(); + }; + }(a10))), a10 = f10.oh(w6(/* @__PURE__ */ function() { + return function(k10) { + return B6(k10.g, xm().Nd).A.na(); + }; + }(a10))), e10 !== a10)) { + a10 = Mo().j_; + f10 = b10.j; + e10 = y7(); + g10 = Mo().j_.Ld; + var h10 = Ab(b10.fa(), q5(jd)); + b10 = b10.Ib(); + c10.Gc(a10.j, f10, e10, g10, h10, Yb().qb, b10); + } + } + function Sqa(a10, b10, c10, e10) { + var f10 = Yv(), g10 = B6(c10.g, Jl().Uf).A; + f10 = Dja(f10, g10.b() ? null : g10.c()); + b10 = Uc(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10, t10) { + t10 = !!t10; + var v10 = Uqa().v2.Ja(k10.j); + v10 = v10 instanceof z7 ? v10.i.Od(w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Y10 = B6(Y10.g, cj().R).A; + Y10 = Y10.b() ? null : Y10.c(); + var ia = B6(L10.g, cj().R).A; + return Y10 === (ia.b() ? null : ia.c()); + }; + }(h10, p10))) : false; + var A10 = B6(p10.g, cj().R).A; + A10.b() ? A10 = false : (A10 = A10.c(), A10 = l10.Ha(A10)); + if (!v10 && !A10) { + v10 = Uqa().v2; + A10 = k10.j; + var D10 = Uqa().v2.Ja(k10.j); + if (D10 instanceof z7) + D10 = D10.i; + else { + if (y7() !== D10) + throw new x7().d(D10); + K7(); + pj(); + D10 = new Lf().a().ua(); + } + var C10 = K7(); + D10 = D10.yg(p10, C10.u); + v10.Xh(new R6().M(A10, D10)); + t10 ? (t10 = B6(p10.g, cj().R).A, t10 = "Unused operation uri parameter " + (t10.b() ? null : t10.c())) : (t10 = B6(p10.g, cj().R).A, t10 = "Unused uri parameter " + (t10.b() ? null : t10.c())); + m10.Ns(sg().HJ, p10.j, y7(), t10, Ab(p10.x, q5(jd)), yb(p10)); + } + }; + }(a10, c10, f10, b10)); + B6(e10.g, Jl().Wm).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + k10.ug(l10, false); + }; + }(a10, b10))); + e10 = B6(e10.g, Jl().bk); + c10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return Vb().Ia(AD(h10)).ua(); + }; + }(a10)); + f10 = K7(); + e10 = e10.bd(c10, f10.u); + c10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return B6(h10.g, Am().Zo); + }; + }(a10)); + f10 = K7(); + e10.bd(c10, f10.u).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + k10.ug(l10, true); + }; + }(a10, b10))); + } + yD.prototype.$classData = r8({ G1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.MergingValidator$", { G1a: 1, f: 1 }); + var Pqa = void 0; + function Uqa() { + Pqa || (Pqa = new yD().a()); + return Pqa; + } + function Vqa() { + this.VW = this.wc = this.Jja = this.Bf = this.oi = null; + } + Vqa.prototype = new u7(); + Vqa.prototype.constructor = Vqa; + function Wqa(a10, b10, c10, e10) { + var f10 = a10.VW; + a10 = a10.wc.sv; + Tb() === a10 ? (a10 = b10.yv, a10 = a10.b() ? new z7().d(b10.Ld) : a10) : Ub() === a10 ? (a10 = b10.vv, a10 = a10.b() ? new z7().d(b10.Ld) : a10) : a10 = new z7().d(b10.Ld); + Xqa(f10, Yqa(new BD(), a10, e10.b() ? "" : e10.c(), b10.j, c10, Yb().qb, b10.j)); + } + function CD(a10, b10) { + a: { + for (var c10 = b10.bc().Ub(); !c10.b(); ) { + if (ic(c10.ga().r) === a10) { + a10 = new z7().d(c10.ga()); + break a; + } + c10 = c10.ta(); + } + a10 = y7(); + } + if (a10 instanceof z7) { + var e10 = a10.i; + a10 = false; + c10 = null; + b10 = Vb().Ia(Ti(b10.Y(), e10)); + if (b10 instanceof z7 && (a10 = true, c10 = b10, b10 = c10.i, b10.r instanceof jh)) + return new z7().d(new Hd().Dr(b10.x, b10.r, new z7().d(Zqa(b10.r)))); + if (a10) + return b10 = c10.i, new z7().d(new Hd().Dr(b10.x, b10.r, y7())); + } + return y7(); + } + function $qa(a10, b10, c10) { + return b10.Hv.Od(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.Ha(g10); + }; + }(a10, c10))); + } + function ara(a10, b10, c10) { + b10.Iz instanceof z7 && bra(b10); + b10.Cj instanceof z7 && cra(b10); + b10.Bw instanceof z7 && dra(a10, b10, c10); + b10.my.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (h10.Ca instanceof z7) + if (Ed(ua(), h10.Ca.c(), "NonEmptyList")) { + var k10 = CD(h10.Jj, g10); + if (k10 instanceof z7) { + var l10 = k10.i; + if (null !== l10) { + var m10 = l10.Ag; + m10 instanceof $r && (m10.wb.b() && DD(e10, f10, h10, g10.j), void 0); + } + } + } else + throw mb(E6(), new nb().e("Unsupported property node value " + h10.Ca.c())); + if (h10.Kp instanceof z7) { + var p10 = false, t10 = null, v10 = CD(h10.Jj, g10); + a: { + if (v10 instanceof z7) { + p10 = true; + t10 = v10; + var A10 = t10.i; + if (null !== A10) { + var D10 = A10.Ag; + if (D10 instanceof $r) { + var C10 = D10.wb.Oa(), I10 = h10.Kp.c(), L10 = new qg().e(I10), Y10 = ED(); + C10 <= FD(Y10, L10.ja, 10) || DD(e10, f10, h10, g10.j); + break a; + } + } + } + if (p10) { + var ia = t10.i; + if (null !== ia && null !== ia.Ag) { + var pa = h10.Kp.c(), La = new qg().e(pa); + 1 <= FD(ED(), La.ja, 10) || DD(e10, f10, h10, g10.j); + } + } + } + } + if (h10.kl instanceof z7) { + var ob = false, zb = null, Zb = CD(h10.Jj, g10); + a: { + if (Zb instanceof z7) { + ob = true; + zb = Zb; + var Cc = zb.i; + if (null !== Cc) { + var vc = Cc.Ag; + if (vc instanceof $r) { + var id = vc.wb.Oa(), yd = h10.kl.c(), zd = new qg().e(yd), rd = ED(); + id >= FD(rd, zd.ja, 10) || DD(e10, f10, h10, g10.j); + break a; + } + } + } + if (ob) { + var sd = zb.i; + if (null !== sd && sd.Ag instanceof jh) { + var le4 = h10.kl.c(), Vc = new qg().e(le4); + 1 >= FD(ED(), Vc.ja, 10) || DD(e10, f10, h10, g10.j); + break a; + } + } + if (ob) { + var Sc = zb.i; + if (null !== Sc && lb(Sc.Ag)) { + var Qc = h10.kl.c(), $c = new qg().e(Qc); + 1 >= FD(ED(), $c.ja, 10) || DD(e10, f10, h10, g10.j); + break a; + } + } + h10.kl.Ha("0") || DD(e10, f10, h10, g10.j); + } + } + if (h10.gq instanceof z7) { + var Wc = CD(h10.Jj, g10); + if (Wc instanceof z7) { + var Qe = Wc.i; + if (null !== Qe) { + var Qd = Qe.Ih; + if (Qe.Ag instanceof jh && Qd instanceof z7) { + var me4 = Qd.i; + if (sp(me4)) { + var of = h10.gq.c(), Le2 = new qg().e(of); + FD(ED(), Le2.ja, 10) > (me4.length | 0) || DD(e10, f10, h10, g10.j); + } + } + } + } + } + if (h10.Lp instanceof z7) { + var Ve = false, he4 = null, Wf = CD(h10.Jj, g10); + a: { + if (Wf instanceof z7) { + Ve = true; + he4 = Wf; + var vf = he4.i; + if (null !== vf) { + var He = vf.Ih; + if (vf.Ag instanceof jh && He instanceof z7) { + var Ff = He.i; + if (sp(Ff)) { + var wf = h10.Lp.c(), Re2 = new qg().e(wf); + FD(ED(), Re2.ja, 10) <= (Ff.length | 0) || DD(e10, f10, h10, g10.j); + break a; + } + } + } + } + if (Ve) { + var we4 = he4.i; + if (null !== we4) { + var ne4 = we4.Ih; + if (we4.Ag instanceof jh && ne4 instanceof z7) { + var Me2 = ne4.i; + if (Vb().Ia(Me2).b()) { + var Se4 = h10.Lp.c(), xf = new qg().e(Se4); + 0 >= FD(ED(), xf.ja, 10) || DD(e10, f10, h10, g10.j); + } + } + } + } + } + } + var ie3 = h10.hn; + if (!H10().h(ie3)) { + K7(); + var gf = new z7().d(ie3); + if (null !== gf.i && 0 === gf.i.Oe(1)) + era(e10, f10, h10, g10); + else if (ie3 instanceof fra) + era(e10, f10, h10, g10); + else + throw new x7().d(ie3); + } + if (h10.yk instanceof z7) { + var pf = false, hf = null, Gf = CD(h10.Jj, g10); + a: { + if (Gf instanceof z7) { + pf = true; + hf = Gf; + var yf = hf.i; + if (null !== yf) { + var oe4 = yf.Ih; + if (yf.Ag instanceof jh && oe4 instanceof z7) { + var lg = oe4.i; + if (lg instanceof qa) { + var bh = Da(lg), Qh = bh.od, af = bh.Ud; + if (-1 !== (h10.yk.c().indexOf(".") | 0)) { + var Pf = h10.yk.c(), oh = new qg().e(Pf); + Oj(va(), oh.ja) > SD(Ea(), Qh, af) || DD(e10, f10, h10, g10.j); + } else { + var ch = h10.yk.c(), Ie2 = new qg().e(ch), ug = TD(UD(), Ie2.ja, 10), Sg = ug.od, Tg = ug.Ud; + (Tg === af ? (-2147483648 ^ Sg) > (-2147483648 ^ Qh) : Tg > af) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (pf) { + var zh = hf.i; + if (null !== zh) { + var Rh = zh.Ih; + if (zh.Ag instanceof jh && Rh instanceof z7) { + var vg = Rh.i; + if (Ca(vg)) { + if (-1 !== (h10.yk.c().indexOf(".") | 0)) { + var dh = h10.yk.c(), Jg = new qg().e(dh); + Oj(va(), Jg.ja) > (vg | 0) || DD(e10, f10, h10, g10.j); + } else { + var Ah = h10.yk.c(), Bh = new qg().e(Ah); + FD(ED(), Bh.ja, 10) > (vg | 0) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (pf) { + var cg = hf.i; + if (null !== cg) { + var Qf = cg.Ih; + if (cg.Ag instanceof jh && Qf instanceof z7) { + var Kg = Qf.i; + if (na(Kg)) { + var Ne2 = +Kg; + if (-1 !== (h10.yk.c().indexOf(".") | 0)) { + var Xf = h10.yk.c(), di = new qg().e(Xf); + Oj(va(), di.ja) > Ne2 || DD(e10, f10, h10, g10.j); + } else { + var dg = h10.yk.c(), Hf = new qg().e(dg).ja; + da(Oj(va(), Hf)) > Ne2 || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (pf) { + var wg = hf.i; + if (null !== wg) { + var Lg = wg.Ih; + if (wg.Ag instanceof jh && Lg instanceof z7) { + var jf = Lg.i; + if ("number" === typeof jf) { + var mg = +jf; + if (-1 !== (h10.yk.c().indexOf(".") | 0)) { + var Mg = h10.yk.c(), Ng = new qg().e(Mg); + Oj(va(), Ng.ja) > mg || DD(e10, f10, h10, g10.j); + } else { + var eg = h10.yk.c(), Oe4 = new qg().e(eg).ja; + da(Oj(va(), Oe4)) > mg || DD(e10, f10, h10, g10.j); + } + } + } + } + } + } + } + if (h10.Ak instanceof z7) { + var ng = false, fg = null, Ug = CD(h10.Jj, g10); + a: { + if (Ug instanceof z7) { + ng = true; + fg = Ug; + var xg = fg.i; + if (null !== xg) { + var gg = xg.Ih; + if (xg.Ag instanceof jh && gg instanceof z7) { + var fe4 = gg.i; + if (fe4 instanceof qa) { + var ge4 = Da(fe4), ph = ge4.od, hg = ge4.Ud; + if (-1 !== (h10.Ak.c().indexOf(".") | 0)) { + var Jh = h10.Ak.c(), fj = new qg().e(Jh); + Oj(va(), fj.ja) < SD(Ea(), ph, hg) || DD(e10, f10, h10, g10.j); + } else { + var yg = h10.Ak.c(), qh = new qg().e(yg), og = TD(UD(), qh.ja, 10), rh = og.od, Ch = og.Ud; + (Ch === hg ? (-2147483648 ^ rh) < (-2147483648 ^ ph) : Ch < hg) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (ng) { + var Vg = fg.i; + if (null !== Vg) { + var Wg = Vg.Ih; + if (Vg.Ag instanceof jh && Wg instanceof z7) { + var Rf = Wg.i; + if (Ca(Rf)) { + if (-1 !== (h10.Ak.c().indexOf(".") | 0)) { + var Sh = h10.Ak.c(), zg = new qg().e(Sh); + Oj(va(), zg.ja) < (Rf | 0) || DD(e10, f10, h10, g10.j); + } else { + var Ji = h10.Ak.c(), Kh = new qg().e(Ji); + FD(ED(), Kh.ja, 10) < (Rf | 0) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (ng) { + var Lh = fg.i; + if (null !== Lh) { + var Ki = Lh.Ih; + if (Lh.Ag instanceof jh && Ki instanceof z7) { + var gj = Ki.i; + if (na(gj)) { + var Rl = +gj; + if (-1 !== (h10.Ak.c().indexOf(".") | 0)) { + var ek = h10.Ak.c(), Dh = new qg().e(ek); + Oj(va(), Dh.ja) < Rl || DD(e10, f10, h10, g10.j); + } else { + var Eh = h10.Ak.c(), Li = new qg().e(Eh).ja; + da(Oj(va(), Li)) < Rl || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (ng) { + var Mi = fg.i; + if (null !== Mi) { + var uj = Mi.Ih; + if (Mi.Ag instanceof jh && uj instanceof z7) { + var Ni = uj.i; + if ("number" === typeof Ni) { + var fk = +Ni; + if (-1 !== (h10.Ak.c().indexOf(".") | 0)) { + var Ck = h10.Ak.c(), Dk = new qg().e(Ck); + Oj(va(), Dk.ja) < fk || DD(e10, f10, h10, g10.j); + } else { + var hj = h10.Ak.c(), ri = new qg().e(hj).ja; + da(Oj(va(), ri)) < fk || DD(e10, f10, h10, g10.j); + } + } + } + } + } + } + } + if (h10.zk instanceof z7) { + var gk = false, $k = null, lm = CD(h10.Jj, g10); + a: { + if (lm instanceof z7) { + gk = true; + $k = lm; + var si = $k.i; + if (null !== si) { + var bf = si.Ih; + if (si.Ag instanceof jh && bf instanceof z7) { + var ei = bf.i; + if (ei instanceof qa) { + var vj = Da(ei), ti = vj.od, Og = vj.Ud; + if (-1 !== (h10.zk.c().indexOf(".") | 0)) { + var Oi = h10.zk.c(), pg = new qg().e(Oi); + Oj(va(), pg.ja) >= SD(Ea(), ti, Og) || DD(e10, f10, h10, g10.j); + } else { + var zf = h10.zk.c(), Sf = new qg().e(zf), eh = TD(UD(), Sf.ja, 10), Fh = eh.od, fi = eh.Ud; + (fi === Og ? (-2147483648 ^ Fh) >= (-2147483648 ^ ti) : fi > Og) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (gk) { + var hn = $k.i; + if (null !== hn) { + var mm = hn.Ih; + if (hn.Ag instanceof jh && mm instanceof z7) { + var nm = mm.i; + if (Ca(nm)) { + if (-1 !== (h10.zk.c().indexOf(".") | 0)) { + var kd = h10.zk.c(), Pi = new qg().e(kd); + Oj(va(), Pi.ja) >= (nm | 0) || DD(e10, f10, h10, g10.j); + } else { + var sh = h10.zk.c(), Pg = new qg().e(sh); + FD(ED(), Pg.ja, 10) >= (nm | 0) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (gk) { + var Xc = $k.i; + if (null !== Xc) { + var xe2 = Xc.Ih; + if (Xc.Ag instanceof jh && xe2 instanceof z7) { + var Nc = xe2.i; + if (na(Nc)) { + var om = +Nc; + if (-1 !== (h10.zk.c().indexOf(".") | 0)) { + var Dn = h10.zk.c(), gi = new qg().e(Dn); + Oj(va(), gi.ja) >= om || DD(e10, f10, h10, g10.j); + } else { + var Te = h10.zk.c(), pm = new qg().e(Te).ja; + da(Oj(va(), pm)) >= om || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (gk) { + var jn = $k.i; + if (null !== jn) { + var Oq = jn.Ih; + if (jn.Ag instanceof jh && Oq instanceof z7) { + var En = Oq.i; + if ("number" === typeof En) { + var $n = +En; + if (-1 !== (h10.zk.c().indexOf(".") | 0)) { + var Rp = h10.zk.c(), ao = new qg().e(Rp); + Oj(va(), ao.ja) >= $n || DD(e10, f10, h10, g10.j); + } else { + var Xt = h10.zk.c(), Fs = new qg().e(Xt).ja; + da(Oj(va(), Fs)) >= $n || DD(e10, f10, h10, g10.j); + } + } + } + } + } + } + } + if (h10.Bk instanceof z7) { + var Sp = false, bo = null, Gs = CD(h10.Jj, g10); + a: { + if (Gs instanceof z7) { + Sp = true; + bo = Gs; + var Fn = bo.i; + if (null !== Fn) { + var Pq = Fn.Ih; + if (Fn.Ag instanceof jh && Pq instanceof z7) { + var Jr = Pq.i; + if (Jr instanceof qa) { + var Hs = Da(Jr), Is = Hs.od, Kr = Hs.Ud; + if (-1 !== (h10.Bk.c().indexOf(".") | 0)) { + var Js = h10.Bk.c(), Ks = new qg().e(Js); + Oj(va(), Ks.ja) <= SD(Ea(), Is, Kr) || DD(e10, f10, h10, g10.j); + } else { + var ov = h10.Bk.c(), pv = new qg().e(ov), Ls = TD(UD(), pv.ja, 10), qv = Ls.od, rv = Ls.Ud; + (rv === Kr ? (-2147483648 ^ qv) <= (-2147483648 ^ Is) : rv < Kr) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (Sp) { + var Yt = bo.i; + if (null !== Yt) { + var sv = Yt.Ih; + if (Yt.Ag instanceof jh && sv instanceof z7) { + var Qq = sv.i; + if (Ca(Qq)) { + if (-1 !== (h10.Bk.c().indexOf(".") | 0)) { + var tv = h10.Bk.c(), Ms = new qg().e(tv); + Oj(va(), Ms.ja) <= (Qq | 0) || DD(e10, f10, h10, g10.j); + } else { + var Zt = h10.Bk.c(), uv = new qg().e(Zt); + FD(ED(), uv.ja, 10) <= (Qq | 0) || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (Sp) { + var cp = bo.i; + if (null !== cp) { + var Ns = cp.Ih; + if (cp.Ag instanceof jh && Ns instanceof z7) { + var $t = Ns.i; + if (na($t)) { + var au = +$t; + if (-1 !== (h10.Bk.c().indexOf(".") | 0)) { + var Qj = h10.Bk.c(), Jw = new qg().e(Qj); + Oj(va(), Jw.ja) <= au || DD(e10, f10, h10, g10.j); + } else { + var dp = h10.Bk.c(), bu = new qg().e(dp).ja; + da(Oj(va(), bu)) <= au || DD(e10, f10, h10, g10.j); + } + break a; + } + } + } + } + if (Sp) { + var ui = bo.i; + if (null !== ui) { + var Os = ui.Ih; + if (ui.Ag instanceof jh && Os instanceof z7) { + var Ps = Os.i; + if ("number" === typeof Ps) { + var cu = +Ps; + if (-1 !== (h10.Bk.c().indexOf(".") | 0)) { + var Qs = h10.Bk.c(), du = new qg().e(Qs); + Oj(va(), du.ja) <= cu || DD(e10, f10, h10, g10.j); + } else { + var vv = h10.Bk.c(), wv = new qg().e(vv).ja; + da(Oj(va(), wv)) <= cu || DD(e10, f10, h10, g10.j); + } + } + } + } + } + } + } + h10.hh instanceof z7 && gra(e10, f10, h10, g10); + h10.Dj instanceof z7 && hra(e10, f10, h10, g10); + var xv = h10.fn; + if (!H10().h(xv)) + throw mb(E6(), new nb().e("class property constraint not supported yet " + f10.j)); + if (h10.Cj.na()) + throw mb(E6(), new nb().e("custom property constraint not supported yet " + f10.j)); + if (h10.Mq.na()) + throw mb(E6(), new nb().e("customRdf property constraint not supported yet " + f10.j)); + if (h10.hq.na()) + throw mb(E6(), new nb().e("multipleOf property constraint not supported yet " + f10.j)); + if (h10.Gr.na()) + throw mb(E6(), new nb().e("patternedProperty property constraint not supported yet " + f10.j)); + }; + }(a10, b10, c10))); + } + function gra(a10, b10, c10, e10) { + var f10 = false, g10 = null, h10 = CD(c10.Jj, e10); + a: { + if (h10 instanceof z7 && (f10 = true, g10 = h10, h10 = g10.i, null !== h10)) { + var k10 = h10.Ih; + if (h10.Ag instanceof jh && k10 instanceof z7) { + f10 = k10.i; + Vb().Ia(f10).na() ? (g10 = c10.hh.c(), g10 = new qg().e(g10), h10 = H10(), f10 = ira(new rg().vi(g10.ja, h10), ka(f10)).b()) : f10 = false; + f10 && DD(a10, b10, c10, e10.j); + break a; + } + } + f10 && (f10 = g10.i, null !== f10 && (f10 = f10.Ag, f10 instanceof $r && f10.wb.U(w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + if (v10 instanceof jh) { + if (Vb().Ia(v10).na()) { + var A10 = m10.hh.c(); + A10 = new qg().e(A10); + var D10 = H10(); + v10 = ira(new rg().vi(A10.ja, D10), v10.t()).b(); + } else + v10 = false; + v10 && DD( + l10, + p10, + m10, + t10.j + ); + } + }; + }(a10, c10, b10, e10))))); + } + } + function dra(a10, b10, c10) { + var e10 = b10.Bw.c(), f10 = e10.LU; + f10.b() || (f10 = f10.c(), jra(a10, f10).ug(c10, w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + a: { + if (m10 instanceof z7 && (m10 = m10.i, null !== m10)) { + m10 = m10.ya(); + Wqa(g10, h10, l10.j, new z7().d(ic(m10.r))); + break a; + } + Wqa(g10, h10, l10.j, y7()); + } + }; + }(a10, b10, e10, c10)))); + } + function bra(a10) { + throw mb(E6(), new nb().e("Closed constraint not supported yet: " + a10.j)); + } + function era(a10, b10, c10, e10) { + var f10 = false, g10 = null, h10 = CD(c10.Jj, e10); + a: { + if (h10 instanceof z7 && (f10 = true, g10 = h10, h10 = g10.i, null !== h10)) { + var k10 = h10.Ih; + if (h10.Ag instanceof jh && k10 instanceof z7 && (h10 = k10.i, sp(h10))) { + c10.hn.Ha(h10) || DD(a10, b10, c10, e10.j); + break a; + } + } + f10 && (f10 = g10.i, null !== f10 && (f10 = f10.Ag, f10 instanceof $r && f10.wb.U(w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + v10 instanceof jh && (m10.hn.Ha(v10.r) || DD(l10, p10, m10, t10.j)); + }; + }(a10, c10, b10, e10))))); + } + } + function kra(a10) { + var b10 = a10.oi, c10 = gC(), e10 = UB(); + for (b10 = VB(b10, c10, e10); b10.Ya(); ) + c10 = b10.iq(), Rk(c10) && lra(a10, c10); + return nq(hp(), oq(/* @__PURE__ */ function(f10) { + return function() { + return f10.VW; + }; + }(a10)), ml()); + } + function Zqa(a10) { + var b10 = Ab(a10.x, q5(Qu)); + if (b10 instanceof z7) { + var c10 = b10.i; + if (null !== c10) + return b10 = c10.ad, b10 instanceof xt ? b10.oq : a10.r; + } + if (y7() === b10) + return a10.r; + throw new x7().d(b10); + } + function lra(a10, b10) { + var c10 = a10.Bf.eK, e10 = c10.ze; + c10 = pD(c10); + for (var f10 = e10.n[c10]; null !== f10; ) { + var g10 = f10.$a(); + f10 = f10.r; + var h10 = b10.bc().Kb(), k10 = /* @__PURE__ */ function() { + return function(t10) { + return ic(t10); + }; + }(a10), l10 = ii().u; + if (l10 === ii().u) + if (h10 === H10()) + k10 = H10(); + else { + l10 = h10.ga(); + var m10 = l10 = ji(k10(l10), H10()); + for (h10 = h10.ta(); h10 !== H10(); ) { + var p10 = h10.ga(); + p10 = ji(k10(p10), H10()); + m10 = m10.Nf = p10; + h10 = h10.ta(); + } + k10 = l10; + } + else { + for (l10 = se4(h10, l10); !h10.b(); ) + m10 = h10.ga(), l10.jd(k10(m10)), h10 = h10.ta(); + k10 = l10.Rc(); + } + ($qa(a10, f10, k10) || f10.At.Ha(b10.j)) && ara(a10, f10, b10); + mra(a10, f10, b10); + for (f10 = g10; null === f10 && 0 < c10; ) + c10 = -1 + c10 | 0, f10 = e10.n[c10]; + } + } + function nra(a10, b10, c10, e10) { + var f10 = F6().Ua; + f10 = ic(G5(f10, "nodeKind")); + var g10 = F6().Ua; + g10 = ic(G5(g10, "IRI")); + var h10 = c10.gu; + if (h10 === f10) { + c10 = c10.r; + if (c10 !== g10) + throw mb(E6(), new nb().e("Not supported node constraint range " + c10)); + b10.Jv.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + p10 = CD(p10, l10); + if (p10 instanceof z7 && (p10 = p10.i, null !== p10)) { + var t10 = p10.Ih; + if (p10.Ag instanceof jh && t10 instanceof z7 && (p10 = t10.i, sp(p10))) { + if (-1 === (p10.indexOf("://") | 0)) { + p10 = l10.j; + t10 = k10.VW; + var v10 = k10.wc.sv; + Tb() === v10 ? (v10 = m10.yv, v10 = v10.b() ? new z7().d(m10.Ld) : v10) : Ub() === v10 ? (v10 = m10.vv, v10 = v10.b() ? new z7().d(m10.Ld) : v10) : v10 = new z7().d(m10.Ld); + Xqa(t10, Yqa(new BD(), v10, "", m10.j, p10, Yb().qb, m10.j)); + } + } + } + }; + }(a10, e10, b10))); + } else + throw mb(E6(), new nb().e("Not supported node constraint " + h10)); + } + function mra(a10, b10, c10) { + b10.Jv.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10 = ora(f10, h10); + if (h10 instanceof z7 && (h10 = h10.i, null !== h10)) { + var k10 = h10.ya(); + null !== h10.ma() && k10 instanceof $r && k10.U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + Rk(p10) && m10.QB.U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + nra(t10, v10, D10, A10); + }; + }(l10, m10, p10))); + }; + }(e10, g10))); + } + }; + }(a10, c10, b10))); + } + function jra(a10, b10) { + a10 = a10.Jja.Ja(b10); + if (a10 instanceof z7) + return a10.i; + if (y7() === a10) + throw mb(E6(), new nb().e("Custom function validations not supported in customm SHACL validator: " + b10)); + throw new x7().d(a10); + } + function cra(a10) { + throw mb(E6(), new nb().e("Arbitray SHACL validations not supported in customm SHACL validator: " + a10.j)); + } + function DD(a10, b10, c10, e10) { + var f10 = a10.VW; + a10 = a10.wc.sv; + Tb() === a10 ? (a10 = b10.yv, a10 = a10.b() ? new z7().d(b10.Ld) : a10) : Ub() === a10 ? (a10 = b10.vv, a10 = a10.b() ? new z7().d(b10.Ld) : a10) : a10 = new z7().d(b10.Ld); + Xqa(f10, Yqa(new BD(), a10, c10.Jj, b10.j, e10, Yb().qb, b10.j)); + } + function ora(a10, b10) { + a: { + for (var c10 = a10.bc().Ub(); !c10.b(); ) { + if (ic(c10.ga().r) === b10) { + b10 = new z7().d(c10.ga()); + break a; + } + c10 = c10.ta(); + } + b10 = y7(); + } + return b10 instanceof z7 && (b10 = b10.i, a10 = Vb().Ia(Ti(a10.Y(), b10)), a10 instanceof z7) ? (b10 = a10.i, a10 = b10.r, a10 instanceof $r ? new z7().d(new R6().M(b10.x, a10.wb)) : a10 instanceof jh || lb(a10) ? (b10 = b10.x, c10 = K7(), new z7().d(new R6().M(b10, J5(c10, new Ib().ha([a10]))))) : new z7().d(new R6().M(b10.x, H10()))) : y7(); + } + function hra(a10, b10, c10, e10) { + var f10 = Uh().zj, g10 = Uh().Mi, h10 = Uh().hi, k10 = Uh().Nh, l10 = CD(c10.Jj, e10); + l10 instanceof z7 && (l10 = l10.i, null !== l10 && (l10 = l10.Ag, (l10 instanceof $r ? l10.wb : J5(K7(), new Ib().ha([l10]))).U(w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10, C10, I10) { + return function(L10) { + L10 = L10 instanceof jh ? new z7().d(Zqa(L10)) : y7(); + var Y10 = false, ia = null, pa = p10.Dj; + a: { + if (pa instanceof z7 && (Y10 = true, ia = pa, ia.i === t10)) + break a; + if (Y10 && ia.i === v10) + L10 instanceof z7 && "boolean" === typeof L10.i || DD(m10, A10, p10, D10.j); + else if (Y10 && ia.i === C10) + b: { + if (Y10 = false, ia = null, L10 instanceof z7 && (Y10 = true, ia = L10, Ca(ia.i))) + break b; + Y10 && ia.i instanceof qa || DD(m10, A10, p10, D10.j); + } + else if (Y10 && ia.i === I10) + b: { + if (Y10 = false, ia = null, L10 instanceof z7 && (Y10 = true, ia = L10, Ca(ia.i))) + break b; + Y10 && ia.i instanceof qa || Y10 && "number" === typeof ia.i || Y10 && na(ia.i) || DD(m10, A10, p10, D10.j); + } + else if (Y10) + throw L10 = ia.i, mb(E6(), new nb().e("Data type '" + L10 + "' for sh:datatype property constraint not supported yet")); + } + }; + }(a10, c10, f10, g10, b10, e10, h10, k10))))); + } + Vqa.prototype.$classData = r8({ Q1a: 0 }, false, "amf.plugins.features.validation.CustomShaclValidator", { Q1a: 1, f: 1 }); + function VD() { + } + VD.prototype = new u7(); + VD.prototype.constructor = VD; + VD.prototype.a = function() { + return this; + }; + function pra(a10, b10, c10) { + return void 0 === b10 ? c10 : Vb().Ia(b10).b() ? c10 : b10; + } + VD.prototype.$classData = r8({ T1a: 0 }, false, "amf.plugins.features.validation.JSUtils$", { T1a: 1, f: 1 }); + var qra = void 0; + function WD() { + qra || (qra = new VD().a()); + return qra; + } + function XD() { + this.gh = null; + } + XD.prototype = new u7(); + XD.prototype.constructor = XD; + XD.prototype.a = function() { + rra = this; + this.gh = new YD().a(); + return this; + }; + XD.prototype.$classData = r8({ X1a: 0 }, false, "amf.plugins.features.validation.PlatformValidator$", { X1a: 1, f: 1 }); + var rra = void 0; + function sra() { + rra || (rra = new XD().a()); + return rra; + } + function ZD() { + this.gh = null; + this.xa = false; + } + ZD.prototype = new u7(); + ZD.prototype.constructor = ZD; + ZD.prototype.a = function() { + return this; + }; + function tra() { + ura || (ura = new ZD().a()); + var a10 = ura; + if (!a10.xa && !a10.xa) { + if (void 0 === ba.SHACLValidator) + throw mb(E6(), new nb().e("Cannot find global SHACLValidator object")); + var b10 = ba.SHACLValidator.$rdf; + a10.gh = b10; + a10.xa = true; + } + return a10.gh; + } + ZD.prototype.$classData = r8({ Y1a: 0 }, false, "amf.plugins.features.validation.RDF$", { Y1a: 1, f: 1 }); + var ura = void 0; + function $D() { + } + $D.prototype = new u7(); + $D.prototype.constructor = $D; + $D.prototype.a = function() { + return this; + }; + function Paa() { + vra || (vra = new $D().a()); + return tra().graph(); + } + $D.prototype.$classData = r8({ $1a: 0 }, false, "amf.plugins.features.validation.RdflibRdfModel$", { $1a: 1, f: 1 }); + var vra = void 0; + function aE() { + this.koa = this.Em = null; + } + aE.prototype = new u7(); + aE.prototype.constructor = aE; + function wra(a10, b10) { + var c10 = new qd().d(a10.koa); + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = g10.Bw.c(); + if (h10.zh.Da()) { + var k10 = h10.zh, l10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.TB(); + p10 = Mc(ua(), p10, "#"); + return "$" + Oc(new Pc().fd(p10)); + }; + }(e10)), m10 = K7(); + l10 = "," + k10.ka(l10, m10.u).Kg(","); + } else + l10 = ""; + k10 = f10.oa; + g10 = "\n |\n |function " + xra(h10, g10.j) + "($this, $value " + l10 + ") {\n | var innerFn = " + h10.nG.c() + ";\n | var input = amfFindNode($this, {});\n | // print(JSON.stringify(input))\n | try {\n | return innerFn(input, $value " + l10 + ");\n | } catch(e) {\n | return false;\n | }\n |}\n |\n "; + g10 = new qg().e(g10); + f10.oa = "" + k10 + OB(g10); + }; + }(a10, c10))); + return c10.oa; + } + aE.prototype.Uj = function(a10) { + this.Em = a10; + a10 = '\n |function amfExtractLiteral(v){\n | if(v.datatype == null || v.datatype.value === "http://www.w3.org/2001/XMLSchema#string") {\n | return v.value;\n | } else if(v.datatype.value === "http://www.w3.org/2001/XMLSchema#integer") {\n | return parseInt(v.value);\n | } else if(v.datatype.value === "http://www.w3.org/2001/XMLSchema#float") {\n | return parseFloat(v.value);\n | } else if(v.datatype.value === "http://www.w3.org/2001/XMLSchema#double") {\n | return v.value;\n | } else if(v.datatype.value === "http://www.w3.org/2001/XMLSchema#boolean") {\n | return v.value === "true";\n | } else {\n | return v.value;\n | }\n |}\n |\n |function amfCompactProperty(prop) {\n | var prefixes = ' + yra(this) + `; + | for (var p in prefixes) { + | if (prop.indexOf(prefixes[p]) === 0) { + | return p + ":" + prop.replace(prefixes[p], "") + | } + | } + | + | return prop; + |} + | + |function amfFindNode(node, cache) { + | var acc = {"@id": amfCompactProperty(node.value)}; + | var pairs = $data.query().match(node, "?p", "?o"); + | cache[node.value] = acc; + | for(var pair = pairs.nextSolution(); pair; pair = pairs.nextSolution()) { + | var prop = amfCompactProperty(pair.p.value); + | if (pair.p.value === "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") { + | prop = "@type" + | } + | + | var value = acc[prop] || []; + | acc[prop] = value; + | if(prop === "@type") { + | value.push(amfCompactProperty(pair.o.value)); + | } else if(pair.o.termType === "BlankNode" || pair.o.termType === "NamedNode") { + | value.push(cache[pair.o.value] || amfFindNode(pair.o, cache)); + | } else if (pair.o.termType === "Literal"){ + | value.push(amfExtractLiteral(pair.o)); + | } + | } + | + | return acc; + |} + | + |function path(node, path) { + | var acc = [node] + | if (node.constructor === Array) { + | acc = node; + | } + | var paths = path.replace(new RegExp(" ","g"), "").split("/") || []; + | for (var i=0; i A10.w) + throw new U6().e("0"); + var C10 = D10.length | 0, I10 = A10.w + C10 | 0; + uD(A10, I10); + Ba(A10.L, 0, A10.L, C10, A10.w); + for (var L10 = A10.L, Y10 = L10.n.length, ia = 0, pa = 0, La = D10.length | 0, ob = La < Y10 ? La : Y10, zb = L10.n.length, Zb = ob < zb ? ob : zb; ia < Zb; ) + L10.n[pa] = D10[ia], ia = 1 + ia | 0, pa = 1 + pa | 0; + A10.w = I10; + pr(h10.s, vD(wD(), v10.s)); + var Cc = e10.Kp; + if (!Cc.b()) { + var vc = Cc.c(); + dE(h10, "maxCount", vc, new z7().d(e10)); + } + var id = e10.kl; + if (!id.b()) { + var yd = id.c(); + dE(h10, "minCount", yd, new z7().d(e10)); + } + var zd = e10.gq; + if (!zd.b()) { + var rd = zd.c(); + dE(h10, "maxLength", rd, new z7().d(e10)); + } + var sd = e10.Lp; + if (!sd.b()) { + var le4 = sd.c(); + dE(h10, "minLength", le4, new z7().d(e10)); + } + var Vc = e10.yk; + if (!Vc.b()) { + var Sc = Vc.c(); + Cra(h10, "maxExclusive", Sc, new z7().d(e10)); + } + var Qc = e10.Ak; + if (!Qc.b()) { + var $c = Qc.c(); + Cra(h10, "minExclusive", $c, new z7().d(e10)); + } + var Wc = e10.zk; + if (!Wc.b()) { + var Qe = Wc.c(); + Cra(h10, "maxInclusive", Qe, new z7().d(e10)); + } + var Qd = e10.Bk; + if (!Qd.b()) { + var me4 = Qd.c(); + Cra(h10, "minInclusive", me4, new z7().d(e10)); + } + var of = e10.hq; + if (!of.b()) { + var Le2 = of.c(), Ve = F6().Eb; + Dra(h10, ic(G5(Ve, "multipleOfValidationParam")), Le2); + } + var he4 = e10.hh; + if (!he4.b()) { + var Wf = he4.c(); + dE(h10, "pattern", Wf, y7()); + } + var vf = e10.Ca; + if (!vf.b()) { + var He = vf.c(); + dE(h10, "node", He, y7()); + } + var Ff = e10.Dj; + if (!Ff.b()) { + var wf = Ff.c(); + if (!Ed(ua(), wf, "#float") && !Ed(ua(), wf, "#number")) { + T6(); + var Re2 = F6().Ua, we4 = ic(G5(Re2, "datatype")), ne4 = mh(T6(), we4), Me2 = new PA().e(h10.ca); + qr(wr(), Me2, wf); + var Se4 = Me2.s, xf = [ne4]; + if (0 > Se4.w) + throw new U6().e("0"); + var ie3 = xf.length | 0, gf = Se4.w + ie3 | 0; + uD(Se4, gf); + Ba(Se4.L, 0, Se4.L, ie3, Se4.w); + for (var pf = Se4.L, hf = pf.n.length, Gf = 0, yf = 0, oe4 = xf.length | 0, lg = oe4 < hf ? oe4 : hf, bh = pf.n.length, Qh = lg < bh ? lg : bh; Gf < Qh; ) + pf.n[yf] = xf[Gf], Gf = 1 + Gf | 0, yf = 1 + yf | 0; + Se4.w = gf; + pr(h10.s, vD(wD(), Me2.s)); + } + } + if (e10.fn.Da()) + if (1 === e10.fn.Oa()) { + T6(); + var af = F6().Ua, Pf = ic(G5(af, "class")), oh = mh(T6(), Pf), ch = new PA().e(h10.ca); + qr(wr(), ch, e10.fn.ga()); + var Ie2 = ch.s, ug = [oh]; + if (0 > Ie2.w) + throw new U6().e("0"); + var Sg = ug.length | 0, Tg = Ie2.w + Sg | 0; + uD(Ie2, Tg); + Ba(Ie2.L, 0, Ie2.L, Sg, Ie2.w); + for (var zh = Ie2.L, Rh = zh.n.length, vg = 0, dh = 0, Jg = ug.length | 0, Ah = Jg < Rh ? Jg : Rh, Bh = zh.n.length, cg = Ah < Bh ? Ah : Bh; vg < cg; ) + zh.n[dh] = ug[vg], vg = 1 + vg | 0, dh = 1 + dh | 0; + Ie2.w = Tg; + pr(h10.s, vD(wD(), ch.s)); + } else { + T6(); + var Qf = F6().Ua, Kg = ic(G5(Qf, "or")), Ne2 = mh(T6(), Kg), Xf = new PA().e(h10.ca), di = Xf.s, dg = Xf.ca, Hf = new rr().e(dg); + T6(); + var wg = mh(T6(), "@list"), Lg = new PA().e(Hf.ca), jf = Lg.s, mg = Lg.ca, Mg = new PA().e(mg); + e10.fn.U(w6(/* @__PURE__ */ function(Xc, xe2) { + return function(Nc) { + var om = xe2.s, Dn = xe2.ca, gi = new rr().e(Dn); + T6(); + var Te = F6().Ua; + Te = ic(G5(Te, "class")); + var pm = mh(T6(), Te); + Te = new PA().e(gi.ca); + qr( + wr(), + Te, + Nc + ); + Nc = Te.s; + pm = [pm]; + if (0 > Nc.w) + throw new U6().e("0"); + var jn = pm.length | 0, Oq = Nc.w + jn | 0; + uD(Nc, Oq); + Ba(Nc.L, 0, Nc.L, jn, Nc.w); + jn = Nc.L; + var En = jn.n.length, $n = 0, Rp = 0, ao = pm.length | 0; + En = ao < En ? ao : En; + ao = jn.n.length; + for (En = En < ao ? En : ao; $n < En; ) + jn.n[Rp] = pm[$n], $n = 1 + $n | 0, Rp = 1 + Rp | 0; + Nc.w = Oq; + pr(gi.s, vD(wD(), Te.s)); + pr(om, mr(T6(), tr(ur(), gi.s, Dn), Q5().sa)); + }; + }(a10, Mg))); + T6(); + eE(); + var Ng = SA(zs(), mg), eg = mr(0, new Sx().Ac(Ng, Mg.s), Q5().cd); + pr(jf, eg); + var Oe4 = Lg.s, ng = [wg]; + if (0 > Oe4.w) + throw new U6().e("0"); + var fg = ng.length | 0, Ug = Oe4.w + fg | 0; + uD( + Oe4, + Ug + ); + Ba(Oe4.L, 0, Oe4.L, fg, Oe4.w); + for (var xg = Oe4.L, gg = xg.n.length, fe4 = 0, ge4 = 0, ph = ng.length | 0, hg = ph < gg ? ph : gg, Jh = xg.n.length, fj = hg < Jh ? hg : Jh; fe4 < fj; ) + xg.n[ge4] = ng[fe4], fe4 = 1 + fe4 | 0, ge4 = 1 + ge4 | 0; + Oe4.w = Ug; + pr(Hf.s, vD(wD(), Lg.s)); + pr(di, mr(T6(), tr(ur(), Hf.s, dg), Q5().sa)); + var yg = Xf.s, qh = [Ne2]; + if (0 > yg.w) + throw new U6().e("0"); + var og = qh.length | 0, rh = yg.w + og | 0; + uD(yg, rh); + Ba(yg.L, 0, yg.L, og, yg.w); + for (var Ch = yg.L, Vg = Ch.n.length, Wg = 0, Rf = 0, Sh = qh.length | 0, zg = Sh < Vg ? Sh : Vg, Ji = Ch.n.length, Kh = zg < Ji ? zg : Ji; Wg < Kh; ) + Ch.n[Rf] = qh[Wg], Wg = 1 + Wg | 0, Rf = 1 + Rf | 0; + yg.w = rh; + pr(h10.s, vD(wD(), Xf.s)); + } + var Lh = e10.Cj; + Lh.b() || Lh.c().ug(h10, c10); + if (e10.hn.Da()) { + T6(); + var Ki = F6().Ua, gj = ic(G5(Ki, "in")), Rl = mh(T6(), gj), ek = new PA().e(h10.ca), Dh = ek.s, Eh = ek.ca, Li = new rr().e(Eh); + T6(); + var Mi = mh(T6(), "@list"), uj = new PA().e(Li.ca), Ni = uj.s, fk = uj.ca, Ck = new PA().e(fk); + e10.hn.U(w6(/* @__PURE__ */ function(Xc, xe2) { + return function(Nc) { + fE(xe2, Nc, y7()); + }; + }(a10, Ck))); + T6(); + eE(); + var Dk = SA(zs(), fk), hj = mr(0, new Sx().Ac(Dk, Ck.s), Q5().cd); + pr(Ni, hj); + var ri = uj.s, gk = [Mi]; + if (0 > ri.w) + throw new U6().e("0"); + var $k = gk.length | 0, lm = ri.w + $k | 0; + uD(ri, lm); + Ba(ri.L, 0, ri.L, $k, ri.w); + for (var si = ri.L, bf = si.n.length, ei = 0, vj = 0, ti = gk.length | 0, Og = ti < bf ? ti : bf, Oi = si.n.length, pg = Og < Oi ? Og : Oi; ei < pg; ) + si.n[vj] = gk[ei], ei = 1 + ei | 0, vj = 1 + vj | 0; + ri.w = lm; + pr(Li.s, vD(wD(), uj.s)); + pr(Dh, mr(T6(), tr(ur(), Li.s, Eh), Q5().sa)); + var zf = ek.s, Sf = [Rl]; + if (0 > zf.w) + throw new U6().e("0"); + var eh = Sf.length | 0, Fh = zf.w + eh | 0; + uD(zf, Fh); + Ba(zf.L, 0, zf.L, eh, zf.w); + for (var fi = zf.L, hn = fi.n.length, mm = 0, nm = 0, kd = Sf.length | 0, Pi = kd < hn ? kd : hn, sh = fi.n.length, Pg = Pi < sh ? Pi : sh; mm < Pg; ) + fi.n[nm] = Sf[mm], mm = 1 + mm | 0, nm = 1 + nm | 0; + zf.w = Fh; + pr(h10.s, vD(wD(), ek.s)); + } + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + } + cE.prototype.Yaa = function(a10) { + return (0 <= (a10.length | 0) && "http://" === a10.substring(0, 7) || 0 <= (a10.length | 0) && "https://" === a10.substring(0, 8) || 0 <= (a10.length | 0) && "file:" === a10.substring(0, 5)) && -1 < (a10.indexOf("/prop") | 0); + }; + function Era(a10, b10, c10) { + var e10 = c10.j, f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + T6(); + var k10 = mh(T6(), "@id"); + T6(); + var l10 = mh(T6(), e10); + sr(h10, k10, l10); + T6(); + var m10 = mh(T6(), "@type"); + T6(); + var p10 = F6().Ua, t10 = ic(G5(p10, "NodeShape")), v10 = mh(T6(), t10); + sr(h10, m10, v10); + var A10 = a10.GW; + if (ok2().h(A10) || qk().h(A10)) + var D10 = c10.yv, C10 = D10.b() ? c10.Ld : D10.c(); + else if (lk().h(A10)) { + var I10 = c10.vv; + C10 = I10.b() ? c10.Ld : I10.c(); + } else + C10 = c10.Ld; + if ("" !== C10) { + T6(); + var L10 = F6().Ua, Y10 = ic(G5(L10, "message")), ia = mh(T6(), Y10), pa = new PA().e(h10.ca); + fE(pa, C10, y7()); + var La = pa.s, ob = [ia]; + if (0 > La.w) + throw new U6().e("0"); + var zb = ob.length | 0, Zb = La.w + zb | 0; + uD(La, Zb); + Ba(La.L, 0, La.L, zb, La.w); + for (var Cc = La.L, vc = Cc.n.length, id = 0, yd = 0, zd = ob.length | 0, rd = zd < vc ? zd : vc, sd = Cc.n.length, le4 = rd < sd ? rd : sd; id < le4; ) + Cc.n[yd] = ob[id], id = 1 + id | 0, yd = 1 + yd | 0; + La.w = Zb; + pr(h10.s, vD(wD(), pa.s)); + } + if (c10.At.Da()) { + T6(); + var Vc = F6().Ua, Sc = ic(G5(Vc, "targetNode")), Qc = mh(T6(), Sc), $c = new PA().e(h10.ca), Wc = $c.s, Qe = $c.ca, Qd = new PA().e(Qe); + c10.At.fj().U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, qm.UD(Xg)); + }; + }(a10, Qd))); + T6(); + eE(); + var me4 = SA(zs(), Qe), of = mr(0, new Sx().Ac(me4, Qd.s), Q5().cd); + pr(Wc, of); + var Le2 = $c.s, Ve = [Qc]; + if (0 > Le2.w) + throw new U6().e("0"); + var he4 = Ve.length | 0, Wf = Le2.w + he4 | 0; + uD(Le2, Wf); + Ba(Le2.L, 0, Le2.L, he4, Le2.w); + for (var vf = Le2.L, He = vf.n.length, Ff = 0, wf = 0, Re2 = Ve.length | 0, we4 = Re2 < He ? Re2 : He, ne4 = vf.n.length, Me2 = we4 < ne4 ? we4 : ne4; Ff < Me2; ) + vf.n[wf] = Ve[Ff], Ff = 1 + Ff | 0, wf = 1 + wf | 0; + Le2.w = Wf; + pr(h10.s, vD(wD(), $c.s)); + } + if (c10.Hv.Da()) { + T6(); + var Se4 = F6().Ua, xf = ic(G5(Se4, "targetClass")), ie3 = mh(T6(), xf), gf = new PA().e(h10.ca), pf = gf.s, hf = gf.ca, Gf = new PA().e(hf); + c10.Hv.U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, qm.UD(Xg)); + }; + }(a10, Gf))); + T6(); + eE(); + var yf = SA(zs(), hf), oe4 = mr(0, new Sx().Ac(yf, Gf.s), Q5().cd); + pr(pf, oe4); + var lg = gf.s, bh = [ie3]; + if (0 > lg.w) + throw new U6().e("0"); + var Qh = bh.length | 0, af = lg.w + Qh | 0; + uD(lg, af); + Ba(lg.L, 0, lg.L, Qh, lg.w); + for (var Pf = lg.L, oh = Pf.n.length, ch = 0, Ie2 = 0, ug = bh.length | 0, Sg = ug < oh ? ug : oh, Tg = Pf.n.length, zh = Sg < Tg ? Sg : Tg; ch < zh; ) + Pf.n[Ie2] = bh[ch], ch = 1 + ch | 0, Ie2 = 1 + Ie2 | 0; + lg.w = af; + pr(h10.s, vD(wD(), gf.s)); + } + var Rh = c10.Iz; + if (!Rh.b()) { + var vg = !!Rh.c(); + if (vg) { + T6(); + var dh = F6().Ua, Jg = ic(G5(dh, "closed")), Ah = mh(T6(), Jg), Bh = new PA().e(h10.ca); + fE(Bh, "" + vg, y7()); + var cg = Bh.s, Qf = [Ah]; + if (0 > cg.w) + throw new U6().e("0"); + var Kg = Qf.length | 0, Ne2 = cg.w + Kg | 0; + uD(cg, Ne2); + Ba(cg.L, 0, cg.L, Kg, cg.w); + for (var Xf = cg.L, di = Xf.n.length, dg = 0, Hf = 0, wg = Qf.length | 0, Lg = wg < di ? wg : di, jf = Xf.n.length, mg = Lg < jf ? Lg : jf; dg < mg; ) + Xf.n[Hf] = Qf[dg], dg = 1 + dg | 0, Hf = 1 + Hf | 0; + cg.w = Ne2; + pr(h10.s, vD(wD(), Bh.s)); + } + new z7().d(void 0); + } + if (c10.Jv.Da()) { + T6(); + var Mg = F6().Ua, Ng = ic(G5(Mg, "targetObjectsOf")), eg = mh(T6(), Ng), Oe4 = new PA().e(h10.ca), ng = Oe4.s, fg = Oe4.ca, Ug = new PA().e(fg); + c10.Jv.U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, qm.UD(Xg)); + }; + }(a10, Ug))); + T6(); + eE(); + var xg = SA(zs(), fg), gg = mr(0, new Sx().Ac(xg, Ug.s), Q5().cd); + pr(ng, gg); + var fe4 = Oe4.s, ge4 = [eg]; + if (0 > fe4.w) + throw new U6().e("0"); + var ph = ge4.length | 0, hg = fe4.w + ph | 0; + uD(fe4, hg); + Ba(fe4.L, 0, fe4.L, ph, fe4.w); + for (var Jh = fe4.L, fj = Jh.n.length, yg = 0, qh = 0, og = ge4.length | 0, rh = og < fj ? og : fj, Ch = Jh.n.length, Vg = rh < Ch ? rh : Ch; yg < Vg; ) + Jh.n[qh] = ge4[yg], yg = 1 + yg | 0, qh = 1 + qh | 0; + fe4.w = hg; + pr(h10.s, vD(wD(), Oe4.s)); + } + if (c10.vy.Da()) { + T6(); + var Wg = F6().Ua, Rf = ic(G5(Wg, "or")), Sh = mh(T6(), Rf), zg = new PA().e(h10.ca), Ji = zg.s, Kh = zg.ca, Lh = new rr().e(Kh); + T6(); + var Ki = mh( + T6(), + "@list" + ), gj = new PA().e(Lh.ca), Rl = gj.s, ek = gj.ca, Dh = new PA().e(ek); + c10.vy.U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, Xg); + }; + }(a10, Dh))); + T6(); + eE(); + var Eh = SA(zs(), ek), Li = mr(0, new Sx().Ac(Eh, Dh.s), Q5().cd); + pr(Rl, Li); + var Mi = gj.s, uj = [Ki]; + if (0 > Mi.w) + throw new U6().e("0"); + var Ni = uj.length | 0, fk = Mi.w + Ni | 0; + uD(Mi, fk); + Ba(Mi.L, 0, Mi.L, Ni, Mi.w); + for (var Ck = Mi.L, Dk = Ck.n.length, hj = 0, ri = 0, gk = uj.length | 0, $k = gk < Dk ? gk : Dk, lm = Ck.n.length, si = $k < lm ? $k : lm; hj < si; ) + Ck.n[ri] = uj[hj], hj = 1 + hj | 0, ri = 1 + ri | 0; + Mi.w = fk; + pr(Lh.s, vD(wD(), gj.s)); + pr(Ji, mr(T6(), tr(ur(), Lh.s, Kh), Q5().sa)); + var bf = zg.s, ei = [Sh]; + if (0 > bf.w) + throw new U6().e("0"); + var vj = ei.length | 0, ti = bf.w + vj | 0; + uD(bf, ti); + Ba(bf.L, 0, bf.L, vj, bf.w); + for (var Og = bf.L, Oi = Og.n.length, pg = 0, zf = 0, Sf = ei.length | 0, eh = Sf < Oi ? Sf : Oi, Fh = Og.n.length, fi = eh < Fh ? eh : Fh; pg < fi; ) + Og.n[zf] = ei[pg], pg = 1 + pg | 0, zf = 1 + zf | 0; + bf.w = ti; + pr(h10.s, vD(wD(), zg.s)); + } + if (c10.Lx.Da()) { + T6(); + var hn = F6().Ua, mm = ic(G5(hn, "and")), nm = mh(T6(), mm), kd = new PA().e(h10.ca), Pi = kd.s, sh = kd.ca, Pg = new rr().e(sh); + T6(); + var Xc = mh(T6(), "@list"), xe2 = new PA().e(Pg.ca), Nc = xe2.s, om = xe2.ca, Dn = new PA().e(om); + c10.Lx.U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, Xg); + }; + }(a10, Dn))); + T6(); + eE(); + var gi = SA(zs(), om), Te = mr(0, new Sx().Ac(gi, Dn.s), Q5().cd); + pr(Nc, Te); + var pm = xe2.s, jn = [Xc]; + if (0 > pm.w) + throw new U6().e("0"); + var Oq = jn.length | 0, En = pm.w + Oq | 0; + uD(pm, En); + Ba(pm.L, 0, pm.L, Oq, pm.w); + for (var $n = pm.L, Rp = $n.n.length, ao = 0, Xt = 0, Fs = jn.length | 0, Sp = Fs < Rp ? Fs : Rp, bo = $n.n.length, Gs = Sp < bo ? Sp : bo; ao < Gs; ) + $n.n[Xt] = jn[ao], ao = 1 + ao | 0, Xt = 1 + Xt | 0; + pm.w = En; + pr(Pg.s, vD(wD(), xe2.s)); + pr(Pi, mr(T6(), tr(ur(), Pg.s, sh), Q5().sa)); + var Fn = kd.s, Pq = [nm]; + if (0 > Fn.w) + throw new U6().e("0"); + var Jr = Pq.length | 0, Hs = Fn.w + Jr | 0; + uD(Fn, Hs); + Ba(Fn.L, 0, Fn.L, Jr, Fn.w); + for (var Is = Fn.L, Kr = Is.n.length, Js = 0, Ks = 0, ov = Pq.length | 0, pv = ov < Kr ? ov : Kr, Ls = Is.n.length, qv = pv < Ls ? pv : Ls; Js < qv; ) + Is.n[Ks] = Pq[Js], Js = 1 + Js | 0, Ks = 1 + Ks | 0; + Fn.w = Hs; + pr(h10.s, vD(wD(), kd.s)); + } + if (c10.xy.Da()) { + T6(); + var rv = F6().Ua, Yt = ic(G5(rv, "xone")), sv = mh(T6(), Yt), Qq = new PA().e(h10.ca), tv = Qq.s, Ms = Qq.ca, Zt = new rr().e(Ms); + T6(); + var uv = mh(T6(), "@list"), cp = new PA().e(Zt.ca), Ns = cp.s, $t = cp.ca, au = new PA().e($t); + c10.xy.U(w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + qr(wr(), Lm, Xg); + }; + }(a10, au))); + T6(); + eE(); + var Qj = SA(zs(), $t), Jw = mr(0, new Sx().Ac(Qj, au.s), Q5().cd); + pr(Ns, Jw); + var dp = cp.s, bu = [uv]; + if (0 > dp.w) + throw new U6().e("0"); + var ui = bu.length | 0, Os = dp.w + ui | 0; + uD(dp, Os); + Ba(dp.L, 0, dp.L, ui, dp.w); + for (var Ps = dp.L, cu = Ps.n.length, Qs = 0, du = 0, vv = bu.length | 0, wv = vv < cu ? vv : cu, xv = Ps.n.length, py = wv < xv ? wv : xv; Qs < py; ) + Ps.n[du] = bu[Qs], Qs = 1 + Qs | 0, du = 1 + du | 0; + dp.w = Os; + pr(Zt.s, vD(wD(), cp.s)); + pr(tv, mr(T6(), tr(ur(), Zt.s, Ms), Q5().sa)); + var Rq = Qq.s, Kw = [sv]; + if (0 > Rq.w) + throw new U6().e("0"); + var Lw = Kw.length | 0, eu = Rq.w + Lw | 0; + uD(Rq, eu); + Ba(Rq.L, 0, Rq.L, Lw, Rq.w); + for (var yv = Rq.L, qy = yv.n.length, zv = 0, Mw = 0, ry = Kw.length | 0, Tp = ry < qy ? ry : qy, Ss = yv.n.length, Nw = Tp < Ss ? Tp : Ss; zv < Nw; ) + yv.n[Mw] = Kw[zv], zv = 1 + zv | 0, Mw = 1 + Mw | 0; + Rq.w = eu; + pr(h10.s, vD(wD(), Qq.s)); + } + if (c10.jy.na()) { + T6(); + var fu = F6().Ua, Ow = ic(G5(fu, "not")), Pw = mh(T6(), Ow), Sq = new PA().e(h10.ca), gu = Sq.s, Qw = Sq.ca, Rw = new PA().e(Qw); + qr(wr(), Rw, c10.jy.c()); + T6(); + eE(); + var Sw = SA(zs(), Qw), AA = mr(0, new Sx().Ac(Sw, Rw.s), Q5().cd); + pr(gu, AA); + var Up = Sq.s, kn = [Pw]; + if (0 > Up.w) + throw new U6().e("0"); + var Vp = kn.length | 0, sy = Up.w + Vp | 0; + uD(Up, sy); + Ba(Up.L, 0, Up.L, Vp, Up.w); + for (var BA = Up.L, GD = BA.n.length, Av = 0, Tw = 0, HD = kn.length | 0, ID = HD < GD ? HD : GD, CA = BA.n.length, DA = ID < CA ? ID : CA; Av < DA; ) + BA.n[Tw] = kn[Av], Av = 1 + Av | 0, Tw = 1 + Tw | 0; + Up.w = sy; + pr(h10.s, vD(wD(), Sq.s)); + } + var JD = c10.Bw; + JD instanceof z7 && Fra(a10, h10, e10, JD.i); + var KD = c10.QB.am(w6(/* @__PURE__ */ function() { + return function(qm) { + return qm.gu; + }; + }(a10))), EA = gE(new hE(), KD, w6(/* @__PURE__ */ function() { + return function(qm) { + return null !== qm; + }; + }(a10))), yG = w6(/* @__PURE__ */ function(qm, Lm) { + return function(Xg) { + if (null !== Xg) { + var ln = Xg.ma(); + Xg = Xg.ya(); + T6(); + ln = ic($v(F6(), ln)); + var ep = mh(T6(), ln); + ln = new PA().e(Lm.ca); + var ty = ln.s, Ts = ln.ca, Mr = new PA().e(Ts); + Xg.U(w6(/* @__PURE__ */ function(vG, wG) { + return function(xG) { + qr(wr(), wG, ic($v(F6(), xG.r))); + }; + }(qm, Mr))); + T6(); + eE(); + Xg = SA(zs(), Ts); + Xg = mr(0, new Sx().Ac(Xg, Mr.s), Q5().cd); + pr(ty, Xg); + Xg = ln.s; + ep = [ep]; + if (0 > Xg.w) + throw new U6().e("0"); + Mr = ep.length | 0; + ty = Xg.w + Mr | 0; + uD(Xg, ty); + Ba(Xg.L, 0, Xg.L, Mr, Xg.w); + Mr = Xg.L; + var hu = Mr.n.length, FA = Ts = 0, Uw = ep.length | 0; + hu = Uw < hu ? Uw : hu; + Uw = Mr.n.length; + for (hu = hu < Uw ? hu : Uw; Ts < hu; ) + Mr.n[FA] = ep[Ts], Ts = 1 + Ts | 0, FA = 1 + FA | 0; + Xg.w = ty; + pr(Lm.s, vD(wD(), ln.s)); + } else + throw new x7().d(Xg); + }; + }(a10, h10)), zG = Id(); + EA.ka(yG, zG.u); + if (c10.my.Da()) { + T6(); + var LD = F6().Ua, GA = ic(G5(LD, "property")), AG = mh(T6(), GA), uy = new PA().e(h10.ca), BG = uy.s, MD = uy.ca, ND = new PA().e(MD), OD = c10.my, Us = w6(/* @__PURE__ */ function(qm, Lm, Xg) { + return function(ln) { + if (qm.Yaa(ln.$)) + Bra(qm, Lm, ln.$, ln); + else { + if (-1 < (ln.$.indexOf("#") | 0)) { + var ep = ln.$; + ep = Mc(ua(), ep, "#"); + ep = Oc(new Pc().fd(ep)).split(".").join("-"); + } else + ep = ln.$.split(".").join("-"); + Bra(qm, Lm, Xg + "/prop/" + ep, ln); + } + }; + }(a10, ND, e10)), vy = K7(); + OD.ka( + Us, + vy.u + ); + T6(); + eE(); + var HA = SA(zs(), MD), IA = mr(0, new Sx().Ac(HA, ND.s), Q5().cd); + pr(BG, IA); + var Vs = uy.s, JA = [AG]; + if (0 > Vs.w) + throw new U6().e("0"); + var KA = JA.length | 0, wy = Vs.w + KA | 0; + uD(Vs, wy); + Ba(Vs.L, 0, Vs.L, KA, Vs.w); + for (var xy = Vs.L, PD = xy.n.length, Bv = 0, LA = 0, QD = JA.length | 0, RD = QD < PD ? QD : PD, yy = xy.n.length, CG = RD < yy ? RD : yy; Bv < CG; ) + xy.n[LA] = JA[Bv], Bv = 1 + Bv | 0, LA = 1 + LA | 0; + Vs.w = wy; + pr(h10.s, vD(wD(), uy.s)); + } + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + function Dra(a10, b10, c10) { + T6(); + b10 = mh(T6(), b10); + T6(); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + } + cE.prototype.UD = function(a10) { + return 0 <= (a10.length | 0) && "http://" === a10.substring(0, 7) || 0 <= (a10.length | 0) && "https://" === a10.substring(0, 8) || 0 <= (a10.length | 0) && "file:" === a10.substring(0, 5) ? a10.trim() : ic($v(F6(), a10.split(".").join(":"))).trim(); + }; + function Cra(a10, b10, c10, e10) { + var f10 = false, g10 = null; + e10 = e10.b() ? y7() : e10.c().Dj; + a: { + if (e10 instanceof z7) { + f10 = true; + g10 = e10; + var h10 = g10.i, k10 = F6().Eb; + if (h10 === ic(G5(k10, "number")) || h10 === Uh().Nh) { + T6(); + f10 = F6().Ua; + b10 = ic(G5(f10, b10)); + f10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = new qg().e(c10); + c10 = Oj(va(), c10.ja); + fE(b10, "" + c10, new z7().d(Uh().Nh)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + e10 = f10.length | 0; + g10 = c10.w + e10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, e10, c10.w); + e10 = c10.L; + var l10 = e10.n.length; + k10 = h10 = 0; + var m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = e10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + e10.n[k10] = f10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + break a; + } + } + if (y7() === e10) { + T6(); + f10 = F6().Ua; + b10 = ic(G5(f10, b10)); + f10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = new qg().e(c10); + c10 = Oj(va(), c10.ja); + fE(b10, "" + c10, new z7().d(Uh().Nh)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + e10 = f10.length | 0; + g10 = c10.w + e10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, e10, c10.w); + e10 = c10.L; + l10 = e10.n.length; + k10 = h10 = 0; + m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = e10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + e10.n[k10] = f10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } else if (f10 && g10.i === Uh().of) { + T6(); + f10 = F6().Ua; + b10 = ic(G5(f10, b10)); + f10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = new qg().e(c10); + c10 = Oj(va(), c10.ja); + fE(b10, "" + c10, new z7().d(Uh().of)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + e10 = f10.length | 0; + g10 = c10.w + e10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, e10, c10.w); + e10 = c10.L; + l10 = e10.n.length; + k10 = h10 = 0; + m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = e10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + e10.n[k10] = f10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } else if (f10 && g10.i === Uh().hi) { + T6(); + f10 = F6().Ua; + b10 = ic(G5(f10, b10)); + f10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = new qg().e(c10); + c10 = Oj(va(), c10.ja); + c10 = Aa(+ba.Math.floor(c10)); + fE(b10, "" + c10, new z7().d(Uh().hi)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + e10 = f10.length | 0; + g10 = c10.w + e10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, e10, c10.w); + e10 = c10.L; + l10 = e10.n.length; + k10 = h10 = 0; + m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = e10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + e10.n[k10] = f10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } else + throw new x7().d(e10); + } + } + function Fra(a10, b10, c10, e10) { + var f10 = a10.gba, g10 = c10 + "Validator", h10 = new iE(); + if (null === a10) + throw mb(E6(), null); + h10.l = a10; + h10.yG = e10; + h10.Mea = g10; + h10.Lqa = c10; + Dg(f10, h10); + a10 = a10.fba; + f10 = new kE(); + f10.Eja = c10 + "Constraint"; + f10.nv = e10; + f10.Nqa = c10 + "Path"; + f10.Mqa = c10 + "Validator"; + Dg(a10, f10); + T6(); + c10 += "Path"; + a10 = mh(T6(), c10); + c10 = new PA().e(b10.ca); + fE(c10, "true", y7()); + e10 = c10.s; + a10 = [a10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = a10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = a10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = a10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(b10.s, vD( + wD(), + c10.s + )); + } + function dE(a10, b10, c10, e10) { + var f10 = false, g10 = null, h10 = e10.b() ? y7() : e10.c().Dj; + a: { + if (h10 instanceof z7) { + f10 = true; + g10 = h10; + var k10 = g10.i, l10 = F6().Eb; + if (k10 === ic(G5(l10, "number"))) { + T6(); + var m10 = F6().Ua, p10 = ic(G5(m10, "or")), t10 = mh(T6(), p10), v10 = new PA().e(a10.ca), A10 = v10.s, D10 = v10.ca, C10 = new rr().e(D10); + T6(); + var I10 = mh(T6(), "@list"), L10 = new PA().e(C10.ca), Y10 = L10.s, ia = L10.ca, pa = new PA().e(ia), La = pa.s, ob = pa.ca, zb = new rr().e(ob); + T6(); + var Zb = F6().Ua, Cc = ic(G5(Zb, b10)), vc = mh(T6(), Cc), id = new PA().e(zb.ca), yd = new qg().e(c10), zd = Oj(va(), yd.ja), rd = Aa(+ba.Math.floor(zd)); + fE(id, "" + rd, new z7().d(Uh().hi)); + var sd = id.s, le4 = [vc]; + if (0 > sd.w) + throw new U6().e("0"); + var Vc = le4.length | 0, Sc = sd.w + Vc | 0; + uD(sd, Sc); + Ba(sd.L, 0, sd.L, Vc, sd.w); + for (var Qc = sd.L, $c = Qc.n.length, Wc = 0, Qe = 0, Qd = le4.length | 0, me4 = Qd < $c ? Qd : $c, of = Qc.n.length, Le2 = me4 < of ? me4 : of; Wc < Le2; ) + Qc.n[Qe] = le4[Wc], Wc = 1 + Wc | 0, Qe = 1 + Qe | 0; + sd.w = Sc; + pr(zb.s, vD(wD(), id.s)); + pr(La, mr(T6(), tr(ur(), zb.s, ob), Q5().sa)); + var Ve = pa.s, he4 = pa.ca, Wf = new rr().e(he4); + T6(); + var vf = F6().Ua, He = ic(G5(vf, b10)), Ff = mh(T6(), He), wf = new PA().e(Wf.ca), Re2 = new qg().e(c10), we4 = Oj(va(), Re2.ja); + fE(wf, "" + we4, new z7().d(Uh().Nh)); + var ne4 = wf.s, Me2 = [Ff]; + if (0 > ne4.w) + throw new U6().e("0"); + var Se4 = Me2.length | 0, xf = ne4.w + Se4 | 0; + uD(ne4, xf); + Ba(ne4.L, 0, ne4.L, Se4, ne4.w); + for (var ie3 = ne4.L, gf = ie3.n.length, pf = 0, hf = 0, Gf = Me2.length | 0, yf = Gf < gf ? Gf : gf, oe4 = ie3.n.length, lg = yf < oe4 ? yf : oe4; pf < lg; ) + ie3.n[hf] = Me2[pf], pf = 1 + pf | 0, hf = 1 + hf | 0; + ne4.w = xf; + pr(Wf.s, vD(wD(), wf.s)); + pr(Ve, mr(T6(), tr(ur(), Wf.s, he4), Q5().sa)); + T6(); + eE(); + var bh = SA(zs(), ia), Qh = mr(0, new Sx().Ac(bh, pa.s), Q5().cd); + pr(Y10, Qh); + var af = L10.s, Pf = [I10]; + if (0 > af.w) + throw new U6().e("0"); + var oh = Pf.length | 0, ch = af.w + oh | 0; + uD(af, ch); + Ba( + af.L, + 0, + af.L, + oh, + af.w + ); + for (var Ie2 = af.L, ug = Ie2.n.length, Sg = 0, Tg = 0, zh = Pf.length | 0, Rh = zh < ug ? zh : ug, vg = Ie2.n.length, dh = Rh < vg ? Rh : vg; Sg < dh; ) + Ie2.n[Tg] = Pf[Sg], Sg = 1 + Sg | 0, Tg = 1 + Tg | 0; + af.w = ch; + pr(C10.s, vD(wD(), L10.s)); + pr(A10, mr(T6(), tr(ur(), C10.s, D10), Q5().sa)); + var Jg = v10.s, Ah = [t10]; + if (0 > Jg.w) + throw new U6().e("0"); + var Bh = Ah.length | 0, cg = Jg.w + Bh | 0; + uD(Jg, cg); + Ba(Jg.L, 0, Jg.L, Bh, Jg.w); + for (var Qf = Jg.L, Kg = Qf.n.length, Ne2 = 0, Xf = 0, di = Ah.length | 0, dg = di < Kg ? di : Kg, Hf = Qf.n.length, wg = dg < Hf ? dg : Hf; Ne2 < wg; ) + Qf.n[Xf] = Ah[Ne2], Ne2 = 1 + Ne2 | 0, Xf = 1 + Xf | 0; + Jg.w = cg; + pr(a10.s, vD(wD(), v10.s)); + break a; + } + } + if (f10) { + T6(); + var Lg = F6().Ua, jf = ic(G5(Lg, b10)), mg = mh(T6(), jf), Mg = new PA().e(a10.ca), Ng = e10.b() ? y7() : e10.c().Dj; + fE(Mg, c10, Ng); + var eg = Mg.s, Oe4 = [mg]; + if (0 > eg.w) + throw new U6().e("0"); + var ng = Oe4.length | 0, fg = eg.w + ng | 0; + uD(eg, fg); + Ba(eg.L, 0, eg.L, ng, eg.w); + for (var Ug = eg.L, xg = Ug.n.length, gg = 0, fe4 = 0, ge4 = Oe4.length | 0, ph = ge4 < xg ? ge4 : xg, hg = Ug.n.length, Jh = ph < hg ? ph : hg; gg < Jh; ) + Ug.n[fe4] = Oe4[gg], gg = 1 + gg | 0, fe4 = 1 + fe4 | 0; + eg.w = fg; + pr(a10.s, vD(wD(), Mg.s)); + } else if (y7() === h10) { + T6(); + var fj = F6().Ua, yg = ic(G5(fj, b10)), qh = mh(T6(), yg), og = new PA().e(a10.ca); + fE(og, c10, y7()); + var rh = og.s, Ch = [qh]; + if (0 > rh.w) + throw new U6().e("0"); + var Vg = Ch.length | 0, Wg = rh.w + Vg | 0; + uD(rh, Wg); + Ba(rh.L, 0, rh.L, Vg, rh.w); + for (var Rf = rh.L, Sh = Rf.n.length, zg = 0, Ji = 0, Kh = Ch.length | 0, Lh = Kh < Sh ? Kh : Sh, Ki = Rf.n.length, gj = Lh < Ki ? Lh : Ki; zg < gj; ) + Rf.n[Ji] = Ch[zg], zg = 1 + zg | 0, Ji = 1 + Ji | 0; + rh.w = Wg; + pr(a10.s, vD(wD(), og.s)); + } else + throw new x7().d(h10); + } + } + cE.prototype.f1 = function(a10) { + this.GW = a10; + this.gba = J5(Ef(), H10()); + this.fba = J5(Ef(), H10()); + return this; + }; + function Gra(a10, b10) { + var c10 = OA(), e10 = new PA().e(c10.pi), f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + f10 = e10.s; + var g10 = e10.ca, h10 = new PA().e(g10); + b10.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + Era(k10, l10, m10); + }; + }(a10, h10))); + for (b10 = a10.gba.Dc; !b10.b(); ) + b10.ga().Ob(h10), b10 = b10.ta(); + for (a10 = a10.fba.Dc; !a10.b(); ) + a10.ga().Ob(h10), a10 = a10.ta(); + T6(); + eE(); + a10 = SA(zs(), g10); + h10 = mr(0, new Sx().Ac(a10, h10.s), Q5().cd); + pr(f10, h10); + return new RA().Ac(SA(zs(), c10.pi), e10.s); + } + function fE(a10, b10, c10) { + if (c10 instanceof z7) { + var e10 = c10.i, f10 = a10.s, g10 = a10.ca, h10 = new rr().e(g10); + T6(); + var k10 = mh(T6(), "@value"); + T6(); + var l10 = mh(T6(), b10); + sr(h10, k10, l10); + T6(); + var m10 = mh(T6(), "@type"); + T6(); + var p10 = mh(T6(), e10); + sr(h10, m10, p10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else if (y7() === c10) { + if (null === b10) + throw new sf().a(); + if (tf(uf(), "[1-9][\\d]*", b10)) { + var t10 = a10.s, v10 = a10.ca, A10 = new rr().e(v10); + T6(); + var D10 = mh(T6(), "@value"), C10 = new PA().e(A10.ca); + lr(wr(), C10, b10, Q5().cj); + var I10 = C10.s, L10 = [D10]; + if (0 > I10.w) + throw new U6().e("0"); + var Y10 = L10.length | 0, ia = I10.w + Y10 | 0; + uD(I10, ia); + Ba(I10.L, 0, I10.L, Y10, I10.w); + for (var pa = I10.L, La = pa.n.length, ob = 0, zb = 0, Zb = L10.length | 0, Cc = Zb < La ? Zb : La, vc = pa.n.length, id = Cc < vc ? Cc : vc; ob < id; ) + pa.n[zb] = L10[ob], ob = 1 + ob | 0, zb = 1 + zb | 0; + I10.w = ia; + pr(A10.s, vD(wD(), C10.s)); + pr(t10, mr(T6(), tr(ur(), A10.s, v10), Q5().sa)); + } else if ("true" === b10 || "false" === b10) { + var yd = a10.s, zd = a10.ca, rd = new rr().e(zd); + T6(); + var sd = mh(T6(), "@value"), le4 = new PA().e(rd.ca); + lr(wr(), le4, b10, Q5().ti); + var Vc = le4.s, Sc = [sd]; + if (0 > Vc.w) + throw new U6().e("0"); + var Qc = Sc.length | 0, $c = Vc.w + Qc | 0; + uD(Vc, $c); + Ba(Vc.L, 0, Vc.L, Qc, Vc.w); + for (var Wc = Vc.L, Qe = Wc.n.length, Qd = 0, me4 = 0, of = Sc.length | 0, Le2 = of < Qe ? of : Qe, Ve = Wc.n.length, he4 = Le2 < Ve ? Le2 : Ve; Qd < he4; ) + Wc.n[me4] = Sc[Qd], Qd = 1 + Qd | 0, me4 = 1 + me4 | 0; + Vc.w = $c; + pr(rd.s, vD(wD(), le4.s)); + pr(yd, mr(T6(), tr(ur(), rd.s, zd), Q5().sa)); + } else if (ic($v(F6(), b10)) === ic($v(F6(), "amf-parser:NonEmptyList"))) { + var Wf = a10.s, vf = a10.ca, He = new rr().e(vf); + T6(); + var Ff = mh(T6(), "@type"), wf = new PA().e(He.ca); + wr(); + var Re2 = F6().Ua; + lr(0, wf, ic(G5(Re2, "NodeShape")), Q5().Na); + var we4 = wf.s, ne4 = [Ff]; + if (0 > we4.w) + throw new U6().e("0"); + var Me2 = ne4.length | 0, Se4 = we4.w + Me2 | 0; + uD(we4, Se4); + Ba(we4.L, 0, we4.L, Me2, we4.w); + for (var xf = we4.L, ie3 = xf.n.length, gf = 0, pf = 0, hf = ne4.length | 0, Gf = hf < ie3 ? hf : ie3, yf = xf.n.length, oe4 = Gf < yf ? Gf : yf; gf < oe4; ) + xf.n[pf] = ne4[gf], gf = 1 + gf | 0, pf = 1 + pf | 0; + we4.w = Se4; + pr(He.s, vD(wD(), wf.s)); + T6(); + var lg = F6().Ua, bh = ic(G5(lg, "message")), Qh = mh(T6(), bh), af = new PA().e(He.ca); + lr(wr(), af, "List cannot be empty", Q5().Na); + var Pf = af.s, oh = [Qh]; + if (0 > Pf.w) + throw new U6().e("0"); + var ch = oh.length | 0, Ie2 = Pf.w + ch | 0; + uD(Pf, Ie2); + Ba(Pf.L, 0, Pf.L, ch, Pf.w); + for (var ug = Pf.L, Sg = ug.n.length, Tg = 0, zh = 0, Rh = oh.length | 0, vg = Rh < Sg ? Rh : Sg, dh = ug.n.length, Jg = vg < dh ? vg : dh; Tg < Jg; ) + ug.n[zh] = oh[Tg], Tg = 1 + Tg | 0, zh = 1 + zh | 0; + Pf.w = Ie2; + pr(He.s, vD(wD(), af.s)); + T6(); + var Ah = F6().Ua, Bh = ic(G5(Ah, "property")), cg = mh(T6(), Bh), Qf = new PA().e(He.ca), Kg = Qf.s, Ne2 = Qf.ca, Xf = new PA().e(Ne2), di = Xf.s, dg = Xf.ca, Hf = new rr().e(dg); + T6(); + var wg = F6().Ua, Lg = ic(G5(wg, "path")), jf = mh(T6(), Lg), mg = new PA().e(Hf.ca); + wr(); + var Mg = F6().Ul; + qr(0, mg, ic(G5(Mg, "_1"))); + var Ng = mg.s, eg = [jf]; + if (0 > Ng.w) + throw new U6().e("0"); + var Oe4 = eg.length | 0, ng = Ng.w + Oe4 | 0; + uD(Ng, ng); + Ba(Ng.L, 0, Ng.L, Oe4, Ng.w); + for (var fg = Ng.L, Ug = fg.n.length, xg = 0, gg = 0, fe4 = eg.length | 0, ge4 = fe4 < Ug ? fe4 : Ug, ph = fg.n.length, hg = ge4 < ph ? ge4 : ph; xg < hg; ) + fg.n[gg] = eg[xg], xg = 1 + xg | 0, gg = 1 + gg | 0; + Ng.w = ng; + pr(Hf.s, vD(wD(), mg.s)); + T6(); + var Jh = F6().Ua, fj = ic(G5(Jh, "minCount")), yg = mh(T6(), fj), qh = new PA().e(Hf.ca), og = qh.s, rh = qh.ca, Ch = new rr().e(rh); + T6(); + var Vg = mh(T6(), "@value"), Wg = new PA().e(Ch.ca); + lr(wr(), Wg, "1", Q5().cj); + var Rf = Wg.s, Sh = [Vg]; + if (0 > Rf.w) + throw new U6().e("0"); + var zg = Sh.length | 0, Ji = Rf.w + zg | 0; + uD(Rf, Ji); + Ba(Rf.L, 0, Rf.L, zg, Rf.w); + for (var Kh = Rf.L, Lh = Kh.n.length, Ki = 0, gj = 0, Rl = Sh.length | 0, ek = Rl < Lh ? Rl : Lh, Dh = Kh.n.length, Eh = ek < Dh ? ek : Dh; Ki < Eh; ) + Kh.n[gj] = Sh[Ki], Ki = 1 + Ki | 0, gj = 1 + gj | 0; + Rf.w = Ji; + pr(Ch.s, vD(wD(), Wg.s)); + pr(og, mr(T6(), tr(ur(), Ch.s, rh), Q5().sa)); + var Li = qh.s, Mi = [yg]; + if (0 > Li.w) + throw new U6().e("0"); + var uj = Mi.length | 0, Ni = Li.w + uj | 0; + uD(Li, Ni); + Ba(Li.L, 0, Li.L, uj, Li.w); + for (var fk = Li.L, Ck = fk.n.length, Dk = 0, hj = 0, ri = Mi.length | 0, gk = ri < Ck ? ri : Ck, $k = fk.n.length, lm = gk < $k ? gk : $k; Dk < lm; ) + fk.n[hj] = Mi[Dk], Dk = 1 + Dk | 0, hj = 1 + hj | 0; + Li.w = Ni; + pr(Hf.s, vD(wD(), qh.s)); + pr(di, mr(T6(), tr(ur(), Hf.s, dg), Q5().sa)); + T6(); + eE(); + var si = SA(zs(), Ne2), bf = mr(0, new Sx().Ac( + si, + Xf.s + ), Q5().cd); + pr(Kg, bf); + var ei = Qf.s, vj = [cg]; + if (0 > ei.w) + throw new U6().e("0"); + var ti = vj.length | 0, Og = ei.w + ti | 0; + uD(ei, Og); + Ba(ei.L, 0, ei.L, ti, ei.w); + for (var Oi = ei.L, pg = Oi.n.length, zf = 0, Sf = 0, eh = vj.length | 0, Fh = eh < pg ? eh : pg, fi = Oi.n.length, hn = Fh < fi ? Fh : fi; zf < hn; ) + Oi.n[Sf] = vj[zf], zf = 1 + zf | 0, Sf = 1 + Sf | 0; + ei.w = Og; + pr(He.s, vD(wD(), Qf.s)); + pr(Wf, mr(T6(), tr(ur(), He.s, vf), Q5().sa)); + } else if (0 <= (b10.length | 0) && "http://" === b10.substring(0, 7) || 0 <= (b10.length | 0) && "https://" === b10.substring(0, 8) || 0 <= (b10.length | 0) && "file:" === b10.substring(0, 5)) + qr( + wr(), + a10, + b10 + ); + else { + var mm = a10.s, nm = a10.ca, kd = new rr().e(nm); + T6(); + var Pi = mh(T6(), "@value"); + T6(); + var sh = mh(T6(), b10); + sr(kd, Pi, sh); + pr(mm, mr(T6(), tr(ur(), kd.s, nm), Q5().sa)); + } + } else + throw new x7().d(c10); + } + cE.prototype.$classData = r8({ d2a: 0 }, false, "amf.plugins.features.validation.emitters.ValidationJSONLDEmitter", { d2a: 1, f: 1 }); + function lE() { + } + lE.prototype = new u7(); + lE.prototype.constructor = lE; + lE.prototype.a = function() { + return this; + }; + function Hra() { + Ira || (Ira = new lE().a()); + var a10 = F6().xF; + return ic(G5(a10, "validationLibrary.js")); + } + lE.prototype.$classData = r8({ e2a: 0 }, false, "amf.plugins.features.validation.emitters.ValidationJSONLDEmitter$", { e2a: 1, f: 1 }); + var Ira = void 0; + function mE() { + this.Qja = this.Fm = this.GW = null; + } + mE.prototype = new u7(); + mE.prototype.constructor = mE; + function nE(a10, b10, c10, e10, f10) { + if (f10 instanceof z7) + oE(a10.Fm, b10, c10, e10, new z7().d(f10.i)); + else if (y7() === f10) { + if (null === e10) + throw new sf().a(); + if (tf(uf(), "^-?[1-9]\\d*$|^0$", e10)) + oE(a10.Fm, b10, c10, e10, new z7().d(Uh().mr)); + else if ("true" === e10 || "false" === e10) + oE(a10.Fm, b10, c10, e10, new z7().d(Uh().Mi)); + else if (ic($v(F6(), e10)) === ic($v(F6(), "amf-parser:NonEmptyList"))) { + c10 = Sha(a10.Fm); + b10 = c10 + "_c"; + e10 = a10.Fm; + f10 = F6().Qi; + f10 = ic(G5(f10, "type")); + var g10 = F6().Ua; + pE(e10, c10, f10, ic(G5(g10, "NodeShape"))); + e10 = a10.Fm; + f10 = F6().Ua; + oE(e10, c10, ic(G5(f10, "message")), "List cannot be empty", y7()); + e10 = a10.Fm; + f10 = F6().Ua; + pE( + e10, + c10, + ic(G5(f10, "property")), + b10 + ); + c10 = a10.Fm; + e10 = F6().Ua; + e10 = ic(G5(e10, "path")); + f10 = F6().Ul; + pE(c10, b10, e10, ic(G5(f10, "_1"))); + a10 = a10.Fm; + c10 = F6().Ua; + oE(a10, b10, ic(G5(c10, "minCount")), "1", new z7().d(Uh().hi)); + } else + 0 <= (e10.length | 0) && "http://" === e10.substring(0, 7) || 0 <= (e10.length | 0) && "https://" === e10.substring(0, 8) || 0 <= (e10.length | 0) && "file:" === e10.substring(0, 5) ? qE(a10, b10, c10, e10) : oE(a10.Fm, b10, c10, e10, y7()); + } else + throw new x7().d(f10); + } + mE.prototype.Yaa = function(a10) { + return (0 <= (a10.length | 0) && "http://" === a10.substring(0, 7) || 0 <= (a10.length | 0) && "https://" === a10.substring(0, 8) || 0 <= (a10.length | 0) && "file:" === a10.substring(0, 5)) && -1 < (a10.indexOf("/prop") | 0); + }; + function Jra(a10, b10) { + var c10 = b10.j, e10 = a10.Fm, f10 = F6().Qi; + f10 = ic(G5(f10, "type")); + var g10 = F6().Ua; + pE(e10, c10, f10, ic(G5(g10, "NodeShape"))); + e10 = a10.GW; + ok2().h(e10) || qk().h(e10) ? (e10 = b10.yv, e10 = e10.b() ? b10.Ld : e10.c()) : lk().h(e10) ? (e10 = b10.vv, e10 = e10.b() ? b10.Ld : e10.c()) : e10 = b10.Ld; + "" !== e10 && (f10 = F6().Ua, nE(a10, c10, ic(G5(f10, "message")), e10, y7())); + b10.At.Da() && b10.At.fj().U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = F6().Ua; + return qE(h10, k10, ic(G5(m10, "targetNode")), h10.UD(l10)); + }; + }(a10, c10))); + b10.Hv.Da() && b10.Hv.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = F6().Ua; + return qE(h10, k10, ic(G5(m10, "targetClass")), h10.UD(l10)); + }; + }(a10, c10))); + e10 = b10.Iz; + if (!e10.b()) { + if (e10 = !!e10.c()) + f10 = F6().Ua, nE(a10, c10, ic(G5(f10, "closed")), "" + e10, y7()); + new z7().d(void 0); + } + b10.Jv.Da() && b10.Jv.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = F6().Ua; + return qE(h10, k10, ic(G5(m10, "targetObjectsOf")), h10.UD(l10)); + }; + }(a10, c10))); + b10.vy.Da() && (e10 = Kra(a10, b10.vy, Vw(/* @__PURE__ */ function(h10) { + return function(k10, l10, m10) { + qE(h10, k10, l10, m10); + }; + }(a10))), f10 = a10.Fm, g10 = F6().Ua, pE(f10, c10, ic(G5(g10, "or")), e10)); + b10.Lx.Da() && (e10 = Kra(a10, b10.Lx, Vw(/* @__PURE__ */ function(h10) { + return function(k10, l10, m10) { + qE(h10, k10, l10, m10); + }; + }(a10))), f10 = a10.Fm, g10 = F6().Ua, pE(f10, c10, ic(G5(g10, "and")), e10)); + b10.xy.Da() && (e10 = Kra(a10, b10.xy, Vw(/* @__PURE__ */ function(h10) { + return function(k10, l10, m10) { + qE(h10, k10, l10, m10); + }; + }(a10))), f10 = a10.Fm, g10 = F6().Ua, pE(f10, c10, ic(G5(g10, "xone")), e10)); + b10.jy.na() && (e10 = F6().Ua, qE(a10, c10, ic(G5(e10, "not")), b10.jy.c())); + e10 = b10.Bw; + e10 instanceof z7 && Lra(a10, c10, e10.i); + e10 = b10.QB.am(w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.gu; + }; + }(a10))); + e10 = gE(new hE(), e10, w6(/* @__PURE__ */ function() { + return function(h10) { + return null !== h10; + }; + }(a10))); + f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10.ya().U(w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + return qE(p10, t10, ic($v(F6(), v10)), ic($v(F6(), A10.r))); + }; + }(h10, k10, m10))); + } else + throw new x7().d(l10); + }; + }(a10, c10)); + g10 = Id(); + e10.ka(f10, g10.u); + b10.my.Da() && (b10 = b10.my, a10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (h10.Yaa(l10.$)) { + var m10 = h10.Fm, p10 = F6().Ua; + pE(m10, k10, ic(G5(p10, "property")), l10.$); + Mra(h10, l10.$, l10); + } else { + -1 < (l10.$.indexOf("#") | 0) ? (m10 = l10.$, m10 = Mc(ua(), m10, "#"), m10 = Oc(new Pc().fd(m10)).split(".").join("-")) : m10 = l10.$.split(".").join("-"); + m10 = k10 + "/prop/" + m10; + p10 = h10.Fm; + var t10 = F6().Ua; + pE(p10, k10, ic(G5(t10, "property")), m10); + Mra(h10, m10, l10); + } + }; + }(a10, c10)), c10 = K7(), b10.ka(a10, c10.u)); + } + function Nra(a10, b10, c10) { + var e10 = Hra(); + a10.GW = b10; + a10.Fm = c10; + a10.Qja = e10; + return a10; + } + mE.prototype.UD = function(a10) { + return 0 <= (a10.length | 0) && "http://" === a10.substring(0, 7) || 0 <= (a10.length | 0) && "https://" === a10.substring(0, 8) || 0 <= (a10.length | 0) && "file:" === a10.substring(0, 5) ? a10.trim() : ic($v(F6(), a10.split(".").join(":"))).trim(); + }; + function Kra(a10, b10, c10) { + var e10 = Sha(a10.Fm), f10 = new lC().ue(1), g10 = new qd().d(e10 + "_" + f10.oa), h10 = g10.oa, k10 = b10.Oa(), l10 = K7(); + b10.og(l10.u).U(w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.Ki(); + var L10 = t10.oa, Y10 = F6().Qi; + oy(p10, L10, ic(G5(Y10, "first")), I10); + v10.oa = 1 + v10.oa | 0; + if (C10 < (-1 + A10 | 0)) + I10 = D10 + "_" + v10.oa, C10 = t10.oa, L10 = F6().Qi, qE(m10, C10, ic(G5(L10, "rest")), I10), t10.oa = I10; + else + return I10 = t10.oa, C10 = F6().Qi, C10 = ic(G5(C10, "rest")), L10 = F6().Qi, qE(m10, I10, C10, ic(G5(L10, "nil"))); + } else + throw new x7().d(C10); + }; + }(a10, c10, g10, f10, k10, e10))); + return h10; + } + function Ora(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + Jra(c10, e10); + }; + }(a10))); + } + function qE(a10, b10, c10, e10) { + return pE(a10.Fm, b10, c10, e10); + } + function Pra(a10, b10, c10, e10, f10) { + var g10 = false, h10 = null; + f10 = f10.b() ? y7() : f10.c().Dj; + a: { + if (f10 instanceof z7) { + g10 = true; + h10 = f10; + var k10 = h10.i; + if (k10 === Uh().Xo || k10 === Uh().Nh) { + g10 = F6().Ua; + c10 = ic(G5(g10, c10)); + e10 = new qg().e(e10); + e10 = Oj(va(), e10.ja); + nE(a10, b10, c10, "" + e10, new z7().d(Uh().Nh)); + break a; + } + } + y7() === f10 ? (g10 = F6().Ua, c10 = ic(G5(g10, c10)), e10 = new qg().e(e10), e10 = Oj(va(), e10.ja), nE(a10, b10, c10, "" + e10, new z7().d(Uh().Nh))) : g10 && h10.i === Uh().of ? (g10 = F6().Ua, c10 = ic(G5(g10, c10)), e10 = new qg().e(e10), e10 = Oj(va(), e10.ja), nE(a10, b10, c10, "" + e10, new z7().d(Uh().of))) : g10 && (g10 = h10.i, g10 === Uh().hi ? g10 = true : (h10 = F6().Bj, g10 = g10 === ic(G5(h10, "long"))), g10 && (g10 = F6().Ua, c10 = ic(G5(g10, c10)), e10 = new qg().e(e10), e10 = Oj(va(), e10.ja), e10 = Aa(+ba.Math.floor(e10)), nE(a10, b10, c10, "" + e10, new z7().d(Uh().mr)))); + } + } + function Mra(a10, b10, c10) { + if (Vb().Ia(c10.Jj).na()) { + var e10 = F6().Ua; + qE(a10, b10, ic(G5(e10, "path")), a10.UD(c10.Jj)); + e10 = c10.Kp; + e10.b() || (e10 = e10.c(), rE(a10, b10, "maxCount", e10, new z7().d(c10))); + e10 = c10.kl; + e10.b() || (e10 = e10.c(), rE(a10, b10, "minCount", e10, new z7().d(c10))); + e10 = c10.gq; + e10.b() || (e10 = e10.c(), rE(a10, b10, "maxLength", e10, new z7().d(c10))); + e10 = c10.Lp; + e10.b() || (e10 = e10.c(), rE(a10, b10, "minLength", e10, new z7().d(c10))); + e10 = c10.yk; + e10.b() || (e10 = e10.c(), Pra(a10, b10, "maxExclusive", e10, new z7().d(c10))); + e10 = c10.Ak; + e10.b() || (e10 = e10.c(), Pra(a10, b10, "minExclusive", e10, new z7().d(c10))); + e10 = c10.zk; + e10.b() || (e10 = e10.c(), Pra(a10, b10, "maxInclusive", e10, new z7().d(c10))); + e10 = c10.Bk; + e10.b() || (e10 = e10.c(), Pra(a10, b10, "minInclusive", e10, new z7().d(c10))); + e10 = c10.hq; + if (!e10.b()) { + e10 = e10.c(); + var f10 = F6().Eb; + nE(a10, b10, ic(G5(f10, "multipleOfValidationParam")), e10, y7()); + } + e10 = c10.hh; + e10.b() || (e10 = e10.c(), rE(a10, b10, "pattern", e10, y7())); + e10 = c10.Ca; + e10.b() || (e10 = e10.c(), rE(a10, b10, "node", e10, y7())); + e10 = c10.Dj; + e10.b() || (e10 = e10.c(), Ed(ua(), e10, "#integer") ? (e10 = F6().Ua, qE(a10, b10, ic(G5(e10, "datatype")), Uh().mr)) : Ed(ua(), e10, "#float") || Ed(ua(), e10, "#number") || (f10 = F6().Ua, qE(a10, b10, ic(G5(f10, "datatype")), e10))); + if (c10.fn.Da()) + if (1 === c10.fn.Oa()) + e10 = F6().Ua, qE(a10, b10, ic(G5(e10, "class")), c10.fn.ga()); + else { + e10 = Kra(a10, c10.fn, Vw(/* @__PURE__ */ function(h10) { + return function(k10, l10, m10) { + qE(h10, k10, l10, m10); + }; + }(a10))); + f10 = a10.Fm; + var g10 = F6().Ua; + pE(f10, b10, ic(G5(g10, "or")), e10); + } + e10 = c10.Mq; + e10.b() || e10.c().ug(a10.Fm, b10); + c10.hn.Da() && (c10 = Kra(a10, c10.hn, Vw(/* @__PURE__ */ function(h10, k10) { + return function(l10, m10, p10) { + nE(h10, l10, m10, p10, k10.Dj); + }; + }(a10, c10))), e10 = F6().Ua, qE(a10, b10, ic(G5(e10, "in")), c10)); + } + } + function Lra(a10, b10, c10) { + Qra(a10, b10, c10); + var e10 = b10 + "Constraint", f10 = b10 + "Validator", g10 = b10 + "Path", h10 = a10.Fm, k10 = F6().Qi; + k10 = ic(G5(k10, "type")); + var l10 = F6().Ua; + pE(h10, e10, k10, ic(G5(l10, "ConstraintComponent"))); + h10 = F6().Ua; + qE(a10, e10, ic(G5(h10, "validator")), f10); + c10.zh.Da() ? (g10 = e10 + "_param", f10 = F6().Ua, qE(a10, e10, ic(G5(f10, "parameter")), g10), e10 = F6().Ua, qE(a10, g10, ic(G5(e10, "path")), c10.zh.ga().TB()), e10 = F6().Ua, qE(a10, g10, ic(G5(e10, "datatype")), c10.zh.ga().S6a())) : (c10 = e10 + "_param", f10 = F6().Ua, qE(a10, e10, ic(G5(f10, "parameter")), c10), e10 = F6().Ua, qE(a10, c10, ic(G5(e10, "path")), g10), e10 = F6().Ua, qE(a10, c10, ic(G5(e10, "datatype")), Uh().Mi)); + nE(a10, b10, b10 + "Path", "true", y7()); + } + function rE(a10, b10, c10, e10, f10) { + var g10 = false, h10 = f10.b() ? y7() : f10.c().Dj; + a: { + if (h10 instanceof z7) { + g10 = true; + var k10 = h10.i, l10 = F6().Eb; + if (k10 === ic(G5(l10, "number"))) { + g10 = b10 + "_ointdoub1"; + f10 = b10 + "_ointdoub2"; + h10 = a10.Fm; + k10 = F6().Ua; + pE(h10, b10, ic(G5(k10, "or")), g10); + b10 = F6().Qi; + qE(a10, g10, ic(G5(b10, "first")), g10 + "_v"); + b10 = F6().Ua; + b10 = ic(G5(b10, c10)); + h10 = new qg().e(e10); + h10 = Oj(va(), h10.ja); + h10 = Aa(+ba.Math.floor(h10)); + nE(a10, g10 + "_v", b10, "" + h10, new z7().d(Uh().mr)); + b10 = F6().Qi; + qE(a10, g10, ic(G5(b10, "rest")), f10); + b10 = F6().Qi; + qE(a10, f10, ic(G5(b10, "first")), f10 + "_v"); + b10 = F6().Ua; + c10 = ic(G5(b10, c10)); + e10 = new qg().e(e10); + e10 = Oj(va(), e10.ja); + nE( + a10, + f10 + "_v", + c10, + "" + e10, + new z7().d(Uh().Nh) + ); + e10 = F6().Qi; + e10 = ic(G5(e10, "rest")); + c10 = F6().Qi; + qE(a10, f10, e10, ic(G5(c10, "nil"))); + break a; + } + } + if (g10) + g10 = F6().Ua, c10 = ic(G5(g10, c10)), f10 = f10.b() ? y7() : f10.c().Dj, nE(a10, b10, c10, e10, f10); + else if (y7() === h10) + f10 = F6().Ua, nE(a10, b10, ic(G5(f10, c10)), e10, y7()); + else + throw new x7().d(h10); + } + } + function Qra(a10, b10, c10) { + var e10 = b10 + "Validator", f10 = a10.Fm, g10 = F6().Qi; + g10 = ic(G5(g10, "type")); + var h10 = F6().Ua; + pE(f10, e10, g10, ic(G5(h10, "JSValidator"))); + f10 = c10.Ld; + f10.b() || (f10 = f10.c(), g10 = F6().Ua, nE(a10, e10, ic(G5(g10, "message")), f10, y7())); + f10 = e10 + "_url"; + g10 = F6().Ua; + qE(a10, e10, ic(G5(g10, "jsLibrary")), f10); + g10 = c10.xK; + if (g10 instanceof z7) + b10 = g10.i, c10.xi.U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.Fm, v10 = F6().Ua; + return oE(t10, m10, ic(G5(v10, "jsLibraryURL")), p10, new z7().d("http://www.w3.org/2001/XMLSchema#anyUri")); + }; + }(a10, f10))), c10 = F6().Ua, nE(a10, e10, ic(G5(c10, "jsFunctionName")), b10, y7()); + else if (y7() === g10) { + if (!(c10.nG instanceof z7)) + throw mb(E6(), new nb().e("Cannot emit validator without JS code or JS function name")); + g10 = J5(K7(), new Ib().ha([a10.Qja])); + h10 = c10.xi; + var k10 = K7(); + g10.ia(h10, k10.u).U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.Fm, v10 = F6().Ua; + return oE(t10, m10, ic(G5(v10, "jsLibraryURL")), p10, new z7().d("http://www.w3.org/2001/XMLSchema#anyUri")); + }; + }(a10, f10))); + f10 = F6().Ua; + nE(a10, e10, ic(G5(f10, "jsFunctionName")), xra(c10, b10), y7()); + } else + throw new x7().d(g10); + } + mE.prototype.$classData = r8({ h2a: 0 }, false, "amf.plugins.features.validation.emitters.ValidationRdfModelEmitter", { h2a: 1, f: 1 }); + function sE() { + } + sE.prototype = new u7(); + sE.prototype.constructor = sE; + sE.prototype.a = function() { + return this; + }; + function Rra() { + Sra || (Sra = new sE().a()); + var a10 = new qg().e(` + |#%Dialect 1.0 + | + |dialect: Validation Profile + |version: 1.0 + |usage: Dialect to describe validations over RAML documents + |external: + | schema-org: "http://schema.org/" + | shacl: "http://www.w3.org/ns/shacl#" + | validation: "http://a.ml/vocabularies/amf-validation#" + |nodeMappings: + | functionConstraintNode: + | classTerm: shacl.JSConstraint + | mapping: + | message: + | propertyTerm: shacl.message + | range: string + | code: + | range: string + | propertyTerm: validation.jsCode + | #pattern: '^function\\(.+\\)\\s*\\{.+\\}$' + | libraries: + | propertyTerm: shacl.jsLibrary + | range: string + | allowMultiple: true + | functionName: + | propertyTerm: shacl.jsFunctionName + | range: string + | propertyConstraintNode: + | classTerm: shacl.PropertyShape + | mapping: + | message: + | propertyTerm: shacl.message + | range: string + | name: + | propertyTerm: validation.ramlPropertyId + | mandatory: true + | range: string + | pattern: + | propertyTerm: shacl.pattern + | range: string + | maxCount: + | propertyTerm: shacl.maxCount + | range: integer + | minCount: + | propertyTerm: shacl.minCount + | range: integer + | minExclusive: + | propertyTerm: shacl.minExclusive + | range: number + | maxExclusive: + | propertyTerm: shacl.maxExclusive + | range: number + | minInclusive: + | propertyTerm: shacl.minInclusive + | range: number + | maxInclusive: + | propertyTerm: shacl.maxInclusive + | range: number + | datatype: + | propertyTerm: shacl.datatype + | range: string + | in: + | propertyTerm: shacl.in + | allowMultiple: true + | range: string + | functionValidationNode: + | classTerm: validation.FunctionValidation + | mapping: + | name: + | propertyTerm: schema-org.name + | range: string + | message: + | propertyTerm: shacl.message + | range: string + | targetClass: + | propertyTerm: validation.ramlClassId + | range: string + | allowMultiple: true + | functionConstraint: + | mandatory: true + | propertyTerm: shacl.js + | range: functionConstraintNode + | shapeValidationNode: + | classTerm: validation.ShapeValidation + | mapping: + | name: + | propertyTerm: schema-org.name + | range: string + | message: + | propertyTerm: shacl.message + | range: string + | targetClass: + | propertyTerm: validation.ramlClassId + | range: string + | allowMultiple: true + | propertyConstraints: + | mandatory: true + | propertyTerm: shacl.property + | mapKey: name + | range: propertyConstraintNode + | queryValidationNode: + | classTerm: validation.QueryValidation + | mapping: + | name: + | propertyTerm: schema-org.name + | range: string + | message: + | propertyTerm: shacl.message + | range: string + | targetClass: + | propertyTerm: validation.ramlClassId + | range: string + | allowMultiple: true + | propertyConstraints: + | propertyTerm: shacl.property + | mapKey: name + | range: propertyConstraintNode + | targetQuery: + | mandatory: true + | propertyTerm: validation.targetQuery + | range: string + | + | ramlPrefixNode: + | classTerm: validation.RamlPrefix + | mapping: + | prefix: + | propertyTerm: validation.ramlPrefixName + | range: string + | uri: + | propertyTerm: validation.ramlPrefixUri + | range: string + | + | profileNode: + | classTerm: validation.Profile + | mapping: + | prefixes: + | propertyTerm: validation.ramlPrefixes + | mapKey: prefix + | mapValue: uri + | range: ramlPrefixNode + | profile: + | propertyTerm: schema-org.name + | mandatory: true + | range: string + | description: + | propertyTerm: schema-org.description + | range: string + | extends: + | propertyTerm: validation.extendsProfile + | range: string + | violation: + | propertyTerm: validation.setSeverityViolation + | range: string + | allowMultiple: true + | info: + | propertyTerm: validation.setSeverityInfo + | range: string + | allowMultiple: true + | warning: + | propertyTerm: validation.setSeverityWarning + | range: string + | allowMultiple: true + | disabled: + | propertyTerm: validation.disableValidation + | range: string + | allowMultiple: true + | validations: + | propertyTerm: validation.validations + | mapKey: name + | range: [ shapeValidationNode, queryValidationNode,functionValidationNode] + |documents: + | fragments: + | encodes: + | ShapeValidation: queryValidationNode + | FunctionValidation: functionValidationNode + | + | library: + | declares: + | shapes: queryValidationNode + | functions: functionValidationNode + | + | root: + | encodes: profileNode + `); + return OB(a10); + } + sE.prototype.$classData = r8({ m2a: 0 }, false, "amf.plugins.features.validation.model.ValidationDialectText$", { m2a: 1, f: 1 }); + var Sra = void 0; + function tE() { + this.TT = null; + } + tE.prototype = new u7(); + tE.prototype.constructor = tE; + tE.prototype.a = function() { + Tra = this; + var a10 = new R6().M("pathParameterRequiredProperty", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = cs(C10.Y(), cj().We); + L10.b() ? L10 = y7() : (L10 = L10.c(), L10 = new z7().d(L10.r)); + C10 = cs(C10.Y(), cj().yj); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + a: { + if (L10 instanceof z7 && "path" === L10.i && C10 instanceof z7) { + var Y10 = C10.i; + if (Va(Wa(), false, Y10)) { + L10 = true; + break a; + } + } + L10 = L10 instanceof z7 && "path" === L10.i && y7() === C10 ? true : false; + } + L10 && I10.P(y7()); + }; + }(this))), b10 = new R6().M("fileParameterMustBeInFormData", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = C10.Y(), Y10 = cj().Jc; + L10 = L10.vb.Ja(Y10); + !L10.b() && L10.c().r instanceof Wh && (C10 = cs(C10.Y(), cj().We), C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)), C10.b() ? C10 = true : (C10 = C10.c(), C10 = !(null !== C10 && ra(C10, "formData"))), C10 && I10.P(y7())); + }; + }(this))), c10 = new R6().M("minimumMaximumValidation", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = cs(C10.Y(), Fg().wj); + L10.b() || (L10 = L10.c(), C10 = cs(C10.Y(), Fg().vj), C10.b() || (C10 = C10.c(), L10 = L10.t(), L10 = new qg().e(L10), L10 = Oj(va(), L10.ja), C10 = C10.t(), C10 = new qg().e(C10), C10 = Oj(va(), C10.ja), L10 > C10 && I10.P(y7()), new z7().d(void 0))); + }; + }(this))), e10 = new R6().M("minMaxItemsValidation", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = cs(C10.Y(), uh().Bq); + L10.b() || (L10 = L10.c(), C10 = cs(C10.Y(), uh().pr), C10.b() || (C10 = C10.c(), L10 = L10.t(), L10 = new qg().e(L10), L10 = Oj(va(), L10.ja), C10 = C10.t(), C10 = new qg().e(C10), C10 = Oj(va(), C10.ja), L10 > C10 && I10.P(y7()), new z7().d(void 0))); + }; + }(this))), f10 = new R6().M("minMaxPropertiesValidation", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = cs(C10.Y(), Ih().dw); + L10.b() || (L10 = L10.c(), C10 = cs(C10.Y(), Ih().cw), C10.b() || (C10 = C10.c(), L10 = L10.t(), L10 = new qg().e(L10), L10 = Oj(va(), L10.ja), C10 = C10.t(), C10 = new qg().e(C10), C10 = Oj(va(), C10.ja), L10 > C10 && I10.P(y7()), new z7().d(void 0))); + }; + }(this))), g10 = new R6().M( + "minMaxLengthValidation", + Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = cs(C10.Y(), Fg().Cq); + L10.b() || (L10 = L10.c(), C10 = cs(C10.Y(), Fg().Aq), C10.b() || (C10 = C10.c(), L10 = new qg().e(ka(L10.r)), L10 = Oj(va(), L10.ja), C10 = new qg().e(ka(C10.r)), C10 = Oj(va(), C10.ja), L10 > C10 && I10.P(y7()), new z7().d(void 0))); + }; + }(this)) + ), h10 = new R6().M("xmlWrappedScalar", Uc(/* @__PURE__ */ function(C10) { + return function(I10, L10) { + if (I10 instanceof Mh && (I10 = cs(I10.aa, Ag().Ln), I10 instanceof z7)) { + I10 = I10.i.Y().vb; + var Y10 = mz(); + Y10 = Ua(Y10); + var ia = Id().u; + I10 = Jd(I10, Y10, ia).Fb(w6(/* @__PURE__ */ function() { + return function(pa) { + return Ed(ua(), ic(pa.Lc.r), "xmlWrapped"); + }; + }(C10))); + I10.b() || aj(I10.c().r.r) && L10.P(y7()); + } + }; + }(this))), k10 = new R6().M("xmlNonScalarAttribute", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = C10.Y(), Y10 = Ag().Ln; + L10 = L10.vb.Ja(Y10); + if (L10 instanceof z7) { + if (L10 = L10.i.r, Rk(L10) && (L10 = cs(L10.Y(), rn().yF), !L10.b())) { + L10 = aj(L10.c()); + a: { + for (C10 = C10.bc().Kb(); !C10.b(); ) { + if ("ScalarShape" === C10.ga().$) { + C10 = true; + break a; + } + C10 = C10.ta(); + } + C10 = false; + } + L10 && !C10 && I10.P(y7()); + } + } else if (y7() !== L10) + throw new x7().d(L10); + }; + }(this))), l10 = new R6().M("patternValidation", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = cs(C10.Y(), Fg().zl); + if (!C10.b()) { + C10 = C10.c(); + try { + var L10 = uf(), Y10 = C10.t(), ia = new Tv().e(Y10), pa = Bx(ua(), ia.td, "\\[\\^\\]", "[\\\\S\\\\s]"); + Hv(L10, pa, 0); + } catch (La) { + if (null !== Ph(E6(), La)) + I10.P(y7()); + else + throw La; + } + } + }; + }(this))), m10 = new R6().M("nonEmptyListOfProtocols", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = C10.Y(); + var L10 = Qm().Gh; + C10 = C10.vb.Ja(L10); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + C10.b() || (C10 = C10.c(), C10 instanceof $r && C10.wb.b() && I10.P(new z7().d(new R6().M((O7(), new P6().a()), Qm().Gh)))); + }; + }(this))), p10 = new R6().M("exampleMutuallyExclusiveFields", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + var L10 = C10.Y(), Y10 = ag().mo; + L10 = L10.vb.Ja(Y10); + L10.b() || (L10.c(), C10 = C10.Y(), L10 = ag().DR, C10 = C10.vb.Ja(L10), C10.b() || (C10.c(), I10.P(y7()), new z7().d(void 0))); + }; + }(this))), t10 = new R6().M("requiredOpenIdConnectUrl", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = C10.Y(); + var L10 = Xh().Oh; + C10 = C10.vb.Ja(L10); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + C10.b() || (C10 = C10.c(), C10 instanceof uE && (C10 = C10.g, L10 = vE().Pf, C10.vb.Ha(L10) || I10.P(y7()))); + }; + }(this))), v10 = new R6().M("requiredFlowsInOAuth2", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = C10.Y(); + var L10 = Xh().Oh; + C10 = C10.vb.Ja(L10); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + C10.b() || (C10 = C10.c(), C10 instanceof wE && (C10 = C10.g, L10 = xE().Ap, C10.vb.Ha(L10) || I10.P(y7()))); + }; + }(this))), A10 = new R6().M("validCallbackExpression", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = C10.Y(); + var L10 = am().Ky; + C10 = C10.vb.Ja(L10); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + Ura(); + C10.b() || (C10 = C10.c(), C10 instanceof jh && (Vra(), C10 = C10.t(), Dca(C10) || I10.P(new z7().d(new R6().M((O7(), new P6().a()), am().Ky))))); + }; + }(this))), D10 = new R6().M("validLinkRequestBody", Uc(/* @__PURE__ */ function() { + return function(C10, I10) { + C10 = C10.Y(); + var L10 = An().VF; + C10 = C10.vb.Ja(L10); + C10.b() ? C10 = y7() : (C10 = C10.c(), C10 = new z7().d(C10.r)); + Ura(); + C10.b() || (C10 = C10.c(), C10 instanceof jh && (Vra(), C10 = C10.t(), Dca(C10) || I10.P(new z7().d(new R6().M((O7(), new P6().a()), An().VF))))); + }; + }(this))); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, new R6().M("validLinkParameterExpressions", Uc(/* @__PURE__ */ function(C10) { + return function(I10, L10) { + I10 = cs(I10.Y(), An().kD); + I10.b() || I10.c().wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + if (pa instanceof Hn) { + pa = pa.g; + var La = Gn().jD; + pa = pa.vb.Ja(La); + pa.b() ? pa = y7() : (pa = pa.c(), pa = new z7().d(pa.r)); + Ura(); + pa.b() || (pa = pa.c(), pa instanceof jh && (Vra(), pa = pa.t(), Dca(pa) || ia.P(new z7().d(new R6().M((O7(), new P6().a()), An().kD))))); + } + }; + }( + C10, + L10 + ))); + }; + }(this)))]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.TT = b10.eb; + return this; + }; + tE.prototype.$classData = r8({ s2a: 0 }, false, "amf.validations.CustomShaclFunctions$", { s2a: 1, f: 1 }); + var Tra = void 0; + function Ura() { + Tra || (Tra = new tE().a()); + return Tra; + } + function yE() { + } + yE.prototype = new u7(); + yE.prototype.constructor = yE; + yE.prototype.a = function() { + return this; + }; + function Wra(a10, b10, c10) { + a10 = c10 >> 5; + var e10 = 31 & c10; + c10 = (b10.ci + a10 | 0) + (0 === e10 ? 0 : 1) | 0; + var f10 = ja(Ja(Qa), [c10]), g10 = b10.cg; + if (0 === e10) + Ba(g10, 0, f10, a10, f10.n.length - a10 | 0); + else { + var h10 = 32 - e10 | 0; + f10.n[-1 + f10.n.length | 0] = 0; + for (var k10 = -1 + f10.n.length | 0; k10 > a10; ) { + var l10 = k10; + f10.n[l10] = f10.n[l10] | g10.n[-1 + (k10 - a10 | 0) | 0] >>> h10 | 0; + f10.n[-1 + k10 | 0] = g10.n[-1 + (k10 - a10 | 0) | 0] << e10; + k10 = -1 + k10 | 0; + } + } + for (e10 = 0; e10 < a10; ) + f10.n[e10] = 0, e10 = 1 + e10 | 0; + b10 = zE(b10.ri, c10, f10); + AE(b10); + return b10; + } + function Xra(a10, b10, c10) { + a10 = c10 >> 5; + var e10 = 31 & c10; + if (a10 >= b10.ci) + return 0 > b10.ri ? BE().A7 : BE().zN; + c10 = b10.ci - a10 | 0; + for (var f10 = ja(Ja(Qa), [1 + c10 | 0]), g10 = c10, h10 = b10.cg, k10 = 0; k10 < a10; ) + k10 = 1 + k10 | 0; + if (0 === e10) + Ba(h10, a10, f10, 0, g10); + else { + var l10 = 32 - e10 | 0; + for (k10 = 0; k10 < (-1 + g10 | 0); ) + f10.n[k10] = h10.n[k10 + a10 | 0] >>> e10 | 0 | h10.n[1 + (k10 + a10 | 0) | 0] << l10, k10 = 1 + k10 | 0; + f10.n[k10] = h10.n[k10 + a10 | 0] >>> e10 | 0; + } + if (0 > b10.ri) { + for (g10 = 0; g10 < a10 && 0 === b10.cg.n[g10]; ) + g10 = 1 + g10 | 0; + h10 = 0 !== b10.cg.n[g10] << (32 - e10 | 0); + if (g10 < a10 || 0 < e10 && h10) { + for (g10 = 0; g10 < c10 && -1 === f10.n[g10]; ) + f10.n[g10] = 0, g10 = 1 + g10 | 0; + g10 === c10 && (c10 = 1 + c10 | 0); + a10 = g10; + f10.n[a10] = 1 + f10.n[a10] | 0; + } + } + b10 = zE(b10.ri, c10, f10); + AE(b10); + return b10; + } + function Yra(a10, b10) { + if (0 === b10.ri) + return 0; + a10 = b10.ci << 5; + var c10 = b10.cg.n[-1 + b10.ci | 0]; + 0 > b10.ri && Zra(b10) === (-1 + b10.ci | 0) && (c10 = -1 + c10 | 0); + return a10 = a10 - ea(c10) | 0; + } + yE.prototype.$classData = r8({ B2a: 0 }, false, "java.math.BitLevel$", { B2a: 1, f: 1 }); + var $ra = void 0; + function CE() { + $ra || ($ra = new yE().a()); + return $ra; + } + function DE() { + this.Mfa = this.Sfa = null; + } + DE.prototype = new u7(); + DE.prototype.constructor = DE; + DE.prototype.a = function() { + asa = this; + this.Sfa = ha(Ja(Qa), [-1, -1, 31, 19, 15, 13, 11, 11, 10, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5]); + this.Mfa = ha(Ja(Qa), [-2147483648, 1162261467, 1073741824, 1220703125, 362797056, 1977326743, 1073741824, 387420489, 1e9, 214358881, 429981696, 815730721, 1475789056, 170859375, 268435456, 410338673, 612220032, 893871739, 128e7, 1801088541, 113379904, 148035889, 191102976, 244140625, 308915776, 387420489, 481890304, 594823321, 729e6, 887503681, 1073741824, 1291467969, 1544804416, 1838265625, 60466176]); + return this; + }; + function Mj(a10, b10) { + a10 = b10.ri; + var c10 = b10.ci, e10 = b10.cg; + if (0 === a10) + return "0"; + if (1 === c10) + return b10 = (+(e10.n[0] >>> 0)).toString(10), 0 > a10 ? "-" + b10 : b10; + b10 = ""; + var f10 = ja(Ja(Qa), [c10]); + Ba(e10, 0, f10, 0, c10); + do { + var g10 = 0; + for (e10 = -1 + c10 | 0; 0 <= e10; ) { + var h10 = g10; + g10 = f10.n[e10]; + var k10 = bsa(Ea(), g10, h10, 1e9, 0); + f10.n[e10] = k10; + h10 = k10 >> 31; + var l10 = 65535 & k10; + k10 = k10 >>> 16 | 0; + var m10 = ca(51712, l10); + l10 = ca(15258, l10); + var p10 = ca(51712, k10); + m10 = m10 + ((l10 + p10 | 0) << 16) | 0; + ca(1e9, h10); + ca(15258, k10); + g10 = g10 - m10 | 0; + e10 = -1 + e10 | 0; + } + e10 = "" + g10; + for (b10 = "000000000".substring(e10.length | 0) + e10 + b10; 0 !== c10 && 0 === f10.n[-1 + c10 | 0]; ) + c10 = -1 + c10 | 0; + } while (0 !== c10); + f10 = 0; + for (c10 = b10.length | 0; ; ) + if (f10 < c10 && 48 === (65535 & (b10.charCodeAt(f10) | 0))) + f10 = 1 + f10 | 0; + else + break; + b10 = b10.substring(f10); + return 0 > a10 ? "-" + b10 : b10; + } + DE.prototype.$classData = r8({ C2a: 0 }, false, "java.math.Conversion$", { C2a: 1, f: 1 }); + var asa = void 0; + function Nj() { + asa || (asa = new DE().a()); + return asa; + } + function EE() { + } + EE.prototype = new u7(); + EE.prototype.constructor = EE; + EE.prototype.a = function() { + return this; + }; + function csa(a10, b10, c10, e10) { + for (var f10 = ja(Ja(Qa), [b10]), g10 = 0, h10 = 0; g10 < e10; ) { + var k10 = a10.n[g10], l10 = k10 - c10.n[g10] | 0; + k10 = (-2147483648 ^ l10) > (-2147483648 ^ k10) ? -1 : 0; + var m10 = h10; + h10 = m10 >> 31; + m10 = l10 + m10 | 0; + l10 = (-2147483648 ^ m10) < (-2147483648 ^ l10) ? 1 + (k10 + h10 | 0) | 0 : k10 + h10 | 0; + f10.n[g10] = m10; + h10 = l10; + g10 = 1 + g10 | 0; + } + for (; g10 < b10; ) + c10 = a10.n[g10], l10 = h10, e10 = l10 >> 31, l10 = c10 + l10 | 0, c10 = (-2147483648 ^ l10) < (-2147483648 ^ c10) ? 1 + e10 | 0 : e10, f10.n[g10] = l10, h10 = c10, g10 = 1 + g10 | 0; + return f10; + } + function dsa(a10, b10, c10, e10) { + for (a10 = -1 + e10 | 0; 0 <= a10 && b10.n[a10] === c10.n[a10]; ) + a10 = -1 + a10 | 0; + return 0 > a10 ? 0 : (-2147483648 ^ b10.n[a10]) < (-2147483648 ^ c10.n[a10]) ? -1 : 1; + } + function esa(a10, b10, c10, e10) { + var f10 = ja(Ja(Qa), [1 + b10 | 0]), g10 = 1, h10 = a10.n[0], k10 = h10 + c10.n[0] | 0; + f10.n[0] = k10; + h10 = (-2147483648 ^ k10) < (-2147483648 ^ h10) ? 1 : 0; + if (b10 >= e10) { + for (; g10 < e10; ) { + var l10 = a10.n[g10]; + k10 = l10 + c10.n[g10] | 0; + l10 = (-2147483648 ^ k10) < (-2147483648 ^ l10) ? 1 : 0; + h10 = k10 + h10 | 0; + k10 = (-2147483648 ^ h10) < (-2147483648 ^ k10) ? 1 + l10 | 0 : l10; + f10.n[g10] = h10; + h10 = k10; + g10 = 1 + g10 | 0; + } + for (; g10 < b10; ) + c10 = a10.n[g10], e10 = c10 + h10 | 0, c10 = (-2147483648 ^ e10) < (-2147483648 ^ c10) ? 1 : 0, f10.n[g10] = e10, h10 = c10, g10 = 1 + g10 | 0; + } else { + for (; g10 < b10; ) + l10 = a10.n[g10], k10 = l10 + c10.n[g10] | 0, l10 = (-2147483648 ^ k10) < (-2147483648 ^ l10) ? 1 : 0, h10 = k10 + h10 | 0, k10 = (-2147483648 ^ h10) < (-2147483648 ^ k10) ? 1 + l10 | 0 : l10, f10.n[g10] = h10, h10 = k10, g10 = 1 + g10 | 0; + for (; g10 < e10; ) + a10 = c10.n[g10], b10 = a10 + h10 | 0, a10 = (-2147483648 ^ b10) < (-2147483648 ^ a10) ? 1 : 0, f10.n[g10] = b10, h10 = a10, g10 = 1 + g10 | 0; + } + 0 !== h10 && (f10.n[g10] = h10); + return f10; + } + function fsa(a10, b10, c10) { + a10 = b10.ri; + var e10 = c10.ri, f10 = b10.ci, g10 = c10.ci; + if (0 === a10) + return c10; + if (0 === e10) + return b10; + if (2 === (f10 + g10 | 0)) { + b10 = b10.cg.n[0]; + c10 = c10.cg.n[0]; + if (a10 === e10) + return e10 = b10 + c10 | 0, c10 = (-2147483648 ^ e10) < (-2147483648 ^ b10) ? 1 : 0, 0 === c10 ? new FE().Sc(a10, e10) : zE(a10, 2, ha(Ja(Qa), [e10, c10])); + e10 = BE(); + 0 > a10 ? (a10 = b10 = c10 - b10 | 0, c10 = (-2147483648 ^ b10) > (-2147483648 ^ c10) ? -1 : 0) : (a10 = c10 = b10 - c10 | 0, c10 = (-2147483648 ^ c10) > (-2147483648 ^ b10) ? -1 : 0); + return GE(e10, new qa().Sc(a10, c10)); + } + if (a10 === e10) + e10 = f10 >= g10 ? esa(b10.cg, f10, c10.cg, g10) : esa(c10.cg, g10, b10.cg, f10); + else { + var h10 = f10 !== g10 ? f10 > g10 ? 1 : -1 : dsa(0, b10.cg, c10.cg, f10); + if (0 === h10) + return BE().zN; + 1 === h10 ? e10 = csa(b10.cg, f10, c10.cg, g10) : (c10 = csa(c10.cg, g10, b10.cg, f10), a10 = e10, e10 = c10); + } + a10 = zE(a10 | 0, e10.n.length, e10); + AE(a10); + return a10; + } + function gsa(a10, b10, c10) { + var e10 = b10.ri; + a10 = c10.ri; + var f10 = b10.ci, g10 = c10.ci; + if (0 === a10) + return b10; + if (0 === e10) + return 0 === c10.ri ? c10 : zE(-c10.ri | 0, c10.ci, c10.cg); + if (2 === (f10 + g10 | 0)) + return b10 = b10.cg.n[0], f10 = 0, c10 = c10.cg.n[0], g10 = 0, 0 > e10 && (e10 = b10, b10 = -e10 | 0, f10 = 0 !== e10 ? ~f10 : -f10 | 0), 0 > a10 && (a10 = c10, e10 = g10, c10 = -a10 | 0, g10 = 0 !== a10 ? ~e10 : -e10 | 0), a10 = BE(), e10 = b10, b10 = f10, f10 = g10, c10 = e10 - c10 | 0, GE(a10, new qa().Sc(c10, (-2147483648 ^ c10) > (-2147483648 ^ e10) ? -1 + (b10 - f10 | 0) | 0 : b10 - f10 | 0)); + var h10 = f10 !== g10 ? f10 > g10 ? 1 : -1 : dsa(HE(), b10.cg, c10.cg, f10); + if (e10 === a10 && 0 === h10) + return BE().zN; + -1 === h10 ? (c10 = e10 === a10 ? csa(c10.cg, g10, b10.cg, f10) : esa(c10.cg, g10, b10.cg, f10), a10 = -a10 | 0) : e10 === a10 ? (c10 = csa( + b10.cg, + f10, + c10.cg, + g10 + ), a10 = e10) : (c10 = esa(b10.cg, f10, c10.cg, g10), a10 = e10); + a10 = zE(a10 | 0, c10.n.length, c10); + AE(a10); + return a10; + } + EE.prototype.$classData = r8({ D2a: 0 }, false, "java.math.Elementary$", { D2a: 1, f: 1 }); + var hsa = void 0; + function HE() { + hsa || (hsa = new EE().a()); + return hsa; + } + function IE() { + this.sR = this.wX = null; + } + IE.prototype = new u7(); + IE.prototype.constructor = IE; + IE.prototype.a = function() { + isa = this; + jsa(10, 10); + jsa(14, 5); + this.wX = ja(Ja(ksa), [32]); + this.sR = ja(Ja(ksa), [32]); + var a10; + var b10 = 1; + for (var c10 = a10 = 0; 32 > c10; ) { + var e10 = c10; + if (18 >= e10) { + JE().sR.n[e10] = GE(BE(), new qa().Sc(b10, a10)); + var f10 = JE().wX, g10 = BE(), h10 = b10, k10 = a10; + f10.n[e10] = GE(g10, new qa().Sc(0 === (32 & e10) ? h10 << e10 : 0, 0 === (32 & e10) ? (h10 >>> 1 | 0) >>> (31 - e10 | 0) | 0 | k10 << e10 : h10 << e10)); + e10 = b10; + b10 = e10 >>> 16 | 0; + e10 = ca(5, 65535 & e10); + f10 = ca(5, b10); + b10 = e10 + (f10 << 16) | 0; + e10 = (e10 >>> 16 | 0) + f10 | 0; + a10 = ca(5, a10) + (e10 >>> 16 | 0) | 0; + } else + JE().sR.n[e10] = lsa(JE().sR.n[-1 + e10 | 0], JE().sR.n[1]), JE().wX.n[e10] = lsa(JE().wX.n[-1 + e10 | 0], BE().e8); + c10 = 1 + c10 | 0; + } + return this; + }; + function jsa(a10, b10) { + var c10 = []; + if (0 < a10) { + var e10 = 1, f10 = 1, g10 = e10; + for (c10.push(null === g10 ? 0 : g10); f10 < a10; ) + e10 = ca(e10 | 0, b10), f10 = 1 + f10 | 0, g10 = e10, c10.push(null === g10 ? 0 : g10); + } + ha(Ja(Qa), c10); + } + function msa(a10, b10, c10) { + if (c10.ci > b10.ci) + var e10 = c10, f10 = b10; + else + e10 = b10, f10 = c10; + var g10 = e10, h10 = f10; + if (63 > h10.ci) { + var k10 = g10.ci, l10 = h10.ci, m10 = k10 + l10 | 0, p10 = g10.ri !== h10.ri ? -1 : 1; + if (2 === m10) { + var t10 = g10.cg.n[0], v10 = h10.cg.n[0], A10 = 65535 & t10, D10 = t10 >>> 16 | 0, C10 = 65535 & v10, I10 = v10 >>> 16 | 0, L10 = ca(A10, C10), Y10 = ca(D10, C10), ia = ca(A10, I10), pa = L10 + ((Y10 + ia | 0) << 16) | 0, La = (L10 >>> 16 | 0) + ia | 0, ob = (ca(D10, I10) + (La >>> 16 | 0) | 0) + (((65535 & La) + Y10 | 0) >>> 16 | 0) | 0; + var zb = 0 === ob ? new FE().Sc(p10, pa) : zE(p10, 2, ha(Ja(Qa), [pa, ob])); + } else { + var Zb = g10.cg, Cc = h10.cg, vc = ja(Ja(Qa), [m10]); + if (0 !== k10 && 0 !== l10) + if (1 === k10) + vc.n[l10] = nsa(0, vc, Cc, l10, Zb.n[0]); + else if (1 === l10) + vc.n[k10] = nsa(0, vc, Zb, k10, Cc.n[0]); + else if (Zb === Cc && k10 === l10) { + for (var id, yd = 0; yd < k10; ) { + var zd = yd; + id = 0; + for (var rd = 1 + zd | 0; rd < k10; ) { + var sd = rd; + JE(); + var le4 = Zb.n[zd], Vc = Zb.n[sd], Sc = vc.n[zd + sd | 0], Qc = id, $c = 65535 & le4, Wc = le4 >>> 16 | 0, Qe = 65535 & Vc, Qd = Vc >>> 16 | 0, me4 = ca($c, Qe), of = ca(Wc, Qe), Le2 = ca($c, Qd), Ve = me4 + ((of + Le2 | 0) << 16) | 0, he4 = (me4 >>> 16 | 0) + Le2 | 0, Wf = (ca(Wc, Qd) + (he4 >>> 16 | 0) | 0) + (((65535 & he4) + of | 0) >>> 16 | 0) | 0, vf = Ve + Sc | 0, He = (-2147483648 ^ vf) < (-2147483648 ^ Ve) ? 1 + Wf | 0 : Wf, Ff = vf + Qc | 0, wf = (-2147483648 ^ Ff) < (-2147483648 ^ vf) ? 1 + He | 0 : He; + vc.n[zd + sd | 0] = Ff; + id = wf; + rd = 1 + rd | 0; + } + vc.n[zd + k10 | 0] = id; + yd = 1 + yd | 0; + } + CE(); + for (var Re2 = k10 << 1, we4, ne4 = we4 = 0; ne4 < Re2; ) { + var Me2 = ne4, Se4 = vc.n[Me2]; + vc.n[Me2] = Se4 << 1 | we4; + we4 = Se4 >>> 31 | 0; + ne4 = 1 + ne4 | 0; + } + 0 !== we4 && (vc.n[Re2] = we4); + for (var xf = id = 0, ie3 = 0; xf < k10; ) { + var gf = Zb.n[xf], pf = Zb.n[xf], hf = vc.n[ie3], Gf = id, yf = 65535 & gf, oe4 = gf >>> 16 | 0, lg = 65535 & pf, bh = pf >>> 16 | 0, Qh = ca(yf, lg), af = ca(oe4, lg), Pf = ca(yf, bh), oh = Qh + ((af + Pf | 0) << 16) | 0, ch = (Qh >>> 16 | 0) + Pf | 0, Ie2 = (ca(oe4, bh) + (ch >>> 16 | 0) | 0) + (((65535 & ch) + af | 0) >>> 16 | 0) | 0, ug = oh + hf | 0, Sg = (-2147483648 ^ ug) < (-2147483648 ^ oh) ? 1 + Ie2 | 0 : Ie2, Tg = ug + Gf | 0, zh = (-2147483648 ^ Tg) < (-2147483648 ^ ug) ? 1 + Sg | 0 : Sg; + vc.n[ie3] = Tg; + ie3 = 1 + ie3 | 0; + var Rh = zh + vc.n[ie3] | 0, vg = (-2147483648 ^ Rh) < (-2147483648 ^ zh) ? 1 : 0; + vc.n[ie3] = Rh; + id = vg; + xf = 1 + xf | 0; + ie3 = 1 + ie3 | 0; + } + } else + for (var dh = 0; dh < k10; ) { + var Jg = dh; + var Ah = 0; + for (var Bh = Zb.n[Jg], cg = 0; cg < l10; ) { + var Qf = cg; + JE(); + var Kg = Cc.n[Qf], Ne2 = vc.n[Jg + Qf | 0], Xf = Ah, di = 65535 & Bh, dg = Bh >>> 16 | 0, Hf = 65535 & Kg, wg = Kg >>> 16 | 0, Lg = ca(di, Hf), jf = ca(dg, Hf), mg = ca(di, wg), Mg = Lg + ((jf + mg | 0) << 16) | 0, Ng = (Lg >>> 16 | 0) + mg | 0, eg = (ca(dg, wg) + (Ng >>> 16 | 0) | 0) + (((65535 & Ng) + jf | 0) >>> 16 | 0) | 0, Oe4 = Mg + Ne2 | 0, ng = (-2147483648 ^ Oe4) < (-2147483648 ^ Mg) ? 1 + eg | 0 : eg, fg = Oe4 + Xf | 0, Ug = (-2147483648 ^ fg) < (-2147483648 ^ Oe4) ? 1 + ng | 0 : ng; + vc.n[Jg + Qf | 0] = fg; + Ah = Ug; + cg = 1 + cg | 0; + } + vc.n[Jg + l10 | 0] = Ah; + dh = 1 + dh | 0; + } + var xg = zE(p10, m10, vc); + AE(xg); + zb = xg; + } + return zb; + } + var gg = (-2 & g10.ci) << 4, fe4 = osa(g10, gg), ge4 = osa(h10, gg), ph = psa(fe4, gg), hg = gsa(HE(), g10, ph), Jh = psa(ge4, gg), fj = gsa(HE(), h10, Jh), yg = msa(a10, fe4, ge4), qh = msa(a10, hg, fj), og = msa(a10, gsa(HE(), fe4, hg), gsa(HE(), fj, ge4)), rh = og, Ch = yg, Vg = fsa(HE(), rh, Ch); + og = fsa(HE(), Vg, qh); + og = psa(og, gg); + var Wg = yg = psa(yg, gg << 1), Rf = og, Sh = fsa( + HE(), + Wg, + Rf + ); + return fsa(HE(), Sh, qh); + } + function nsa(a10, b10, c10, e10, f10) { + var g10; + for (a10 = g10 = 0; a10 < e10; ) { + var h10 = a10; + JE(); + var k10 = c10.n[h10], l10 = 65535 & k10; + k10 = k10 >>> 16 | 0; + var m10 = 65535 & f10, p10 = f10 >>> 16 | 0, t10 = ca(l10, m10); + m10 = ca(k10, m10); + var v10 = ca(l10, p10); + l10 = t10 + ((m10 + v10 | 0) << 16) | 0; + t10 = (t10 >>> 16 | 0) + v10 | 0; + k10 = (ca(k10, p10) + (t10 >>> 16 | 0) | 0) + (((65535 & t10) + m10 | 0) >>> 16 | 0) | 0; + g10 = l10 + g10 | 0; + k10 = (-2147483648 ^ g10) < (-2147483648 ^ l10) ? 1 + k10 | 0 : k10; + b10.n[h10] = g10; + g10 = k10; + a10 = 1 + a10 | 0; + } + return g10; + } + IE.prototype.$classData = r8({ E2a: 0 }, false, "java.math.Multiplication$", { E2a: 1, f: 1 }); + var isa = void 0; + function JE() { + isa || (isa = new IE().a()); + return isa; + } + function KE() { + this.uF = this.ud = this.Ze = this.By = 0; + } + KE.prototype = new u7(); + KE.prototype.constructor = KE; + function qsa() { + } + d7 = qsa.prototype = KE.prototype; + d7.qg = function(a10) { + if (0 > a10 || a10 > this.Ze) + throw new Zj().a(); + this.ud = a10; + this.uF > a10 && (this.uF = -1); + }; + d7.t = function() { + return Fj(la(this)) + "[pos=" + this.ud + " lim=" + this.Ze + " cap=" + this.By + "]"; + }; + d7.qO = function() { + this.uF = -1; + this.Ze = this.ud; + this.ud = 0; + }; + d7.wja = function() { + this.uF = -1; + this.ud = 0; + this.Ze = this.By; + }; + d7.J1 = function(a10) { + if (0 > a10 || a10 > this.By) + throw new Zj().a(); + this.Ze = a10; + this.ud > a10 && (this.ud = a10, this.uF > a10 && (this.uF = -1)); + }; + d7.ue = function(a10) { + this.Ze = this.By = a10; + this.ud = 0; + this.uF = -1; + return this; + }; + function LE() { + } + LE.prototype = new u7(); + LE.prototype.constructor = LE; + LE.prototype.a = function() { + return this; + }; + function rsa(a10) { + ssa || (ssa = new LE().a()); + a10 = ja(Ja(Oa), [a10]); + var b10 = a10.n.length; + tsa || (tsa = new ME().a()); + var c10 = a10.n.length; + if (0 > c10 || (0 + c10 | 0) > a10.n.length) + throw new U6().a(); + var e10 = 0 + b10 | 0; + if (0 > b10 || e10 > c10) + throw new U6().a(); + b10 = new usa(); + b10.Ss = false; + NE.prototype.V6a.call(b10, c10, a10); + KE.prototype.qg.call(b10, 0); + KE.prototype.J1.call(b10, e10); + return b10; + } + LE.prototype.$classData = r8({ K2a: 0 }, false, "java.nio.ByteBuffer$", { K2a: 1, f: 1 }); + var ssa = void 0; + function OE() { + } + OE.prototype = new u7(); + OE.prototype.constructor = OE; + OE.prototype.a = function() { + return this; + }; + function vsa(a10, b10, c10) { + wsa || (wsa = new PE().a()); + a10 = wa(b10); + c10 = c10 - 0 | 0; + if (0 > a10 || (0 + a10 | 0) > wa(b10)) + throw new U6().a(); + var e10 = 0 + c10 | 0; + if (0 > c10 || e10 > a10) + throw new U6().a(); + return xsa(a10, b10, 0, 0, e10); + } + OE.prototype.$classData = r8({ M2a: 0 }, false, "java.nio.CharBuffer$", { M2a: 1, f: 1 }); + var ysa = void 0; + function zsa() { + ysa || (ysa = new OE().a()); + return ysa; + } + function ME() { + } + ME.prototype = new u7(); + ME.prototype.constructor = ME; + ME.prototype.a = function() { + return this; + }; + ME.prototype.$classData = r8({ O2a: 0 }, false, "java.nio.HeapByteBuffer$", { O2a: 1, f: 1 }); + var tsa = void 0; + function PE() { + } + PE.prototype = new u7(); + PE.prototype.constructor = PE; + PE.prototype.a = function() { + return this; + }; + PE.prototype.$classData = r8({ S2a: 0 }, false, "java.nio.StringCharBuffer$", { S2a: 1, f: 1 }); + var wsa = void 0; + function QE() { + this.KI = this.II = this.JI = null; + this.gx = 0; + } + QE.prototype = new u7(); + QE.prototype.constructor = QE; + function Asa() { + } + Asa.prototype = QE.prototype; + function Bsa(a10, b10, c10, e10) { + if (4 === a10.gx || !e10 && 3 === a10.gx) + throw new Hj().a(); + a10.gx = e10 ? 3 : 2; + for (; ; ) { + try { + var f10 = Csa(b10, c10); + } catch (k10) { + if (k10 instanceof RE) + throw Dsa(k10); + if (k10 instanceof Lv) + throw Dsa(k10); + throw k10; + } + if (0 === f10.tu) { + var g10 = b10.Ze - b10.ud | 0; + if (e10 && 0 < g10) { + var h10 = SE(); + switch (g10) { + case 1: + g10 = h10.us; + break; + case 2: + g10 = h10.QU; + break; + case 3: + g10 = h10.jL; + break; + case 4: + g10 = h10.cba; + break; + default: + g10 = Esa(h10, g10); + } + } else + g10 = f10; + } else + g10 = f10; + if (0 === g10.tu || 1 === g10.tu) + break; + h10 = 3 === g10.tu ? a10.KI : a10.II; + if (TE().wJ === h10) { + if ((c10.Ze - c10.ud | 0) < (a10.JI.length | 0)) { + SE(); + break; + } + Fsa(c10, a10.JI); + h10 = b10.ud; + g10 = g10.iL; + if (0 > g10) + throw new Lu().a(); + KE.prototype.qg.call(b10, h10 + g10 | 0); + } else { + if (TE().xJ === h10) + break; + if (TE().T5 === h10) { + h10 = b10.ud; + g10 = g10.iL; + if (0 > g10) + throw new Lu().a(); + KE.prototype.qg.call(b10, h10 + g10 | 0); + } else + throw new x7().d(h10); + } + } + } + QE.prototype.Baa = function() { + this.JI = "\uFFFD"; + this.II = TE().xJ; + this.KI = TE().xJ; + this.gx = 1; + }; + function UE() { + this.xfa = 0; + this.KI = this.II = this.JI = null; + this.gx = 0; + } + UE.prototype = new u7(); + UE.prototype.constructor = UE; + function Gsa() { + } + Gsa.prototype = UE.prototype; + function Hsa(a10) { + if (0 === a10.By) + return rsa(1); + var b10 = rsa(a10.By << 1); + KE.prototype.qO.call(a10); + if (a10 === b10) + throw new Zj().a(); + if (b10.Ss) + throw new VE().a(); + var c10 = a10.Ze, e10 = a10.ud, f10 = c10 - e10 | 0, g10 = b10.ud, h10 = g10 + f10 | 0; + if (h10 > b10.Ze) + throw new RE().a(); + b10.ud = h10; + KE.prototype.qg.call(a10, c10); + h10 = a10.bj; + if (null !== h10) + Ba(h10, a10.Mk + e10 | 0, b10.bj, b10.Mk + g10 | 0, f10); + else + for (; e10 !== c10; ) + b10.bj.n[b10.Mk + g10 | 0] = a10.bj.n[a10.Mk + e10 | 0] | 0, e10 = 1 + e10 | 0, g10 = 1 + g10 | 0; + return b10; + } + UE.prototype.Baa = function(a10, b10) { + UE.prototype.o7a.call(this, b10); + }; + UE.prototype.o7a = function(a10) { + var b10 = ha(Ja(Oa), [63]); + this.xfa = a10; + this.JI = b10; + this.II = TE().xJ; + this.KI = TE().xJ; + this.gx = 0; + }; + function WE() { + this.iL = this.tu = 0; + } + WE.prototype = new u7(); + WE.prototype.constructor = WE; + WE.prototype.Sc = function(a10, b10) { + this.tu = a10; + this.iL = b10; + return this; + }; + function Isa(a10) { + var b10 = a10.tu; + switch (b10) { + case 1: + throw new RE().a(); + case 0: + throw new Lv().a(); + case 2: + throw new XE().ue(a10.iL); + case 3: + throw new YE().ue(a10.iL); + default: + throw new x7().d(b10); + } + } + WE.prototype.$classData = r8({ V2a: 0 }, false, "java.nio.charset.CoderResult", { V2a: 1, f: 1 }); + function ZE() { + this.Fea = this.cba = this.jL = this.QU = this.us = this.$t = this.bt = null; + } + ZE.prototype = new u7(); + ZE.prototype.constructor = ZE; + ZE.prototype.a = function() { + Jsa = this; + this.bt = new WE().Sc(1, -1); + this.$t = new WE().Sc(0, -1); + this.us = new WE().Sc(2, 1); + this.QU = new WE().Sc(2, 2); + this.jL = new WE().Sc(2, 3); + this.cba = new WE().Sc(2, 4); + this.Fea = []; + new WE().Sc(3, 1); + new WE().Sc(3, 2); + new WE().Sc(3, 3); + new WE().Sc(3, 4); + return this; + }; + function Esa(a10, b10) { + a10 = a10.Fea[b10]; + void 0 === a10 && (a10 = new WE().Sc(2, b10), SE().Fea[b10] = a10); + return a10; + } + ZE.prototype.$classData = r8({ W2a: 0 }, false, "java.nio.charset.CoderResult$", { W2a: 1, f: 1 }); + var Jsa = void 0; + function SE() { + Jsa || (Jsa = new ZE().a()); + return Jsa; + } + function $E() { + this.$ = null; + } + $E.prototype = new u7(); + $E.prototype.constructor = $E; + $E.prototype.t = function() { + return this.$; + }; + $E.prototype.e = function(a10) { + this.$ = a10; + return this; + }; + $E.prototype.$classData = r8({ X2a: 0 }, false, "java.nio.charset.CodingErrorAction", { X2a: 1, f: 1 }); + function aF() { + this.xJ = this.wJ = this.T5 = null; + } + aF.prototype = new u7(); + aF.prototype.constructor = aF; + aF.prototype.a = function() { + Ksa = this; + this.T5 = new $E().e("IGNORE"); + this.wJ = new $E().e("REPLACE"); + this.xJ = new $E().e("REPORT"); + return this; + }; + aF.prototype.$classData = r8({ Y2a: 0 }, false, "java.nio.charset.CodingErrorAction$", { Y2a: 1, f: 1 }); + var Ksa = void 0; + function TE() { + Ksa || (Ksa = new aF().a()); + return Ksa; + } + function bF() { + } + bF.prototype = new u7(); + bF.prototype.constructor = bF; + bF.prototype.a = function() { + return this; + }; + function Lsa(a10, b10, c10, e10) { + a10 = new Ej().a(); + try { + var f10 = 0; + f10 = 0; + var g10 = -1 + e10 | 0; + if (!(c10 >= e10)) + for (; ; ) { + var h10 = c10; + if (h10 < (b10.length | 0)) + var k10 = Ku(), l10 = 65535 & (b10.charCodeAt(h10) | 0), m10 = Msa(k10, l10, 16); + else + m10 = -1; + if (-1 === m10) { + var p10 = b10.length | 0; + throw new nz().M(a10, b10.substring(h10, e10 < p10 ? e10 : p10)); + } + f10 = f10 << 4 | m10; + if (c10 === g10) + break; + c10 = 1 + c10 | 0; + } + ua(); + Ku(); + b10 = f10; + if (!(0 <= b10 && 1114111 >= b10)) + throw new Zj().a(); + var t10 = 65536 <= b10 && 1114111 >= b10 ? ha(Ja(Na), [65535 & (-64 + (b10 >> 10) | 55296), 65535 & (56320 | 1023 & b10)]) : ha(Ja(Na), [65535 & b10]); + return Nsa(0, t10, 0, t10.n.length); + } catch (v10) { + if (v10 instanceof nz) { + t10 = v10; + if (t10.Aa === a10) + return t10.Dt(); + throw t10; + } + throw v10; + } + } + bF.prototype.$classData = r8({ d3a: 0 }, false, "org.mulesoft.common.core.package$", { d3a: 1, f: 1 }); + var Osa = void 0; + function Psa() { + Osa || (Osa = new bF().a()); + return Osa; + } + function cF() { + } + cF.prototype = new u7(); + cF.prototype.constructor = cF; + cF.prototype.a = function() { + return this; + }; + function Qsa(a10, b10) { + return (+(b10 >>> 0)).toString(16).toUpperCase(); + } + cF.prototype.$classData = r8({ e3a: 0 }, false, "org.mulesoft.common.core.package$Chars$", { e3a: 1, f: 1 }); + var Rsa = void 0; + function Ssa() { + Rsa || (Rsa = new cF().a()); + return Rsa; + } + function dF() { + } + dF.prototype = new u7(); + dF.prototype.constructor = dF; + dF.prototype.a = function() { + return this; + }; + function Tsa(a10, b10) { + if (null === b10) + return true; + if (null === b10) + throw new sf().a(); + return "" === b10; + } + function eF(a10, b10) { + a: { + fF(); + if (null !== b10) { + a10 = 0; + for (var c10 = b10.length | 0; a10 < c10; ) { + var e10 = 65535 & (b10.charCodeAt(a10) | 0); + if (32 > e10 || 127 <= e10 || 92 === e10 || 34 === e10) + break a; + a10 = 1 + a10 | 0; + } + } + a10 = -1; + } + if (-1 === a10) + return b10; + c10 = new Tj().ue((b10.length | 0) << 1); + for (gF(c10, b10.substring(0, a10)); a10 < (b10.length | 0); ) { + e10 = 65535 & (b10.charCodeAt(a10) | 0); + if (32 > e10) + switch (hF(c10, 92), e10) { + case 8: + hF(c10, 98); + break; + case 10: + hF(c10, 110); + break; + case 9: + hF(c10, 116); + break; + case 12: + hF(c10, 102); + break; + case 13: + hF(c10, 114); + break; + case 0: + hF(c10, 48); + break; + default: + gF(c10, "u00" + (15 < e10 ? "" : "0") + Qsa(Ssa(), e10)); + } + else + 127 > e10 ? (34 !== e10 && 92 !== e10 || hF(c10, 92), hF(c10, e10)) : (gF(c10, "\\u"), 4095 >= e10 && (255 < e10 ? hF(c10, 48) : gF(c10, "00")), gF(c10, Qsa(Ssa(), e10))); + a10 = 1 + a10 | 0; + } + return c10.Ef.qf; + } + function iF(a10, b10) { + if (Tsa(fF(), b10)) + return b10; + a10 = new qg().e(b10); + if (mu(a10, gc(32))) { + a10 = b10.length | 0; + for (var c10 = new Tj().ue(a10), e10 = 0; e10 < a10; ) { + var f10 = 65535 & (b10.charCodeAt(e10) | 0); + 32 !== f10 && jF(c10.Ef, f10); + e10 = 1 + e10 | 0; + } + return c10.Ef.qf; + } + return b10; + } + function Usa(a10, b10) { + if (null === b10) + return b10; + a10 = b10.length | 0; + if (0 === a10) + return b10; + for (var c10 = new Tj().ue(a10), e10 = 0; e10 < a10; ) { + var f10 = 65535 & (b10.charCodeAt(e10) | 0); + e10 = 1 + e10 | 0; + if (92 !== f10 || e10 >= a10) + jF(c10.Ef, f10); + else { + f10 = 65535 & (b10.charCodeAt(e10) | 0); + e10 = 1 + e10 | 0; + switch (f10) { + case 85: + e10 = 8 + e10 | 0; + f10 = Lsa(Psa(), b10, -8 + e10 | 0, e10); + break; + case 117: + e10 = 4 + e10 | 0; + f10 = Lsa(Psa(), b10, -4 + e10 | 0, e10); + break; + case 120: + e10 = 2 + e10 | 0; + f10 = Lsa(Psa(), b10, -2 + e10 | 0, e10); + break; + case 116: + f10 = " "; + break; + case 114: + f10 = "\r"; + break; + case 110: + f10 = "\n"; + break; + case 102: + f10 = "\f"; + break; + case 97: + f10 = gc(7); + break; + case 98: + f10 = "\b"; + break; + case 118: + f10 = "\v"; + break; + case 101: + f10 = gc(27); + break; + case 48: + f10 = gc(0); + break; + case 78: + f10 = "\x85"; + break; + case 95: + f10 = "\xA0"; + break; + case 76: + f10 = "\u2028"; + break; + case 80: + f10 = "\u2029"; + break; + default: + f10 = ba.String.fromCharCode(f10); + } + Wj(c10, f10); + } + } + return c10.Ef.qf; + } + dF.prototype.$classData = r8({ f3a: 0 }, false, "org.mulesoft.common.core.package$Strings$", { f3a: 1, f: 1 }); + var Vsa = void 0; + function fF() { + Vsa || (Vsa = new dF().a()); + return Vsa; + } + function Aj() { + this.Rp = null; + } + Aj.prototype = new u7(); + Aj.prototype.constructor = Aj; + Aj.prototype.d = function(a10) { + this.Rp = a10; + return this; + }; + Aj.prototype.$classData = r8({ m3a: 0 }, false, "org.mulesoft.common.io.Output$OutputOps", { m3a: 1, f: 1 }); + function kF() { + } + kF.prototype = new u7(); + kF.prototype.constructor = kF; + kF.prototype.a = function() { + return this; + }; + kF.prototype.$classData = r8({ r3a: 0 }, false, "org.mulesoft.common.parse.ParseError$", { r3a: 1, f: 1 }); + var Wsa = void 0; + function lF() { + } + lF.prototype = new u7(); + lF.prototype.constructor = lF; + lF.prototype.a = function() { + return this; + }; + function Xsa(a10, b10) { + a10 = Ea(); + Ysa(); + var c10 = b10.Bt; + c10 = c10.b() ? mF().v8 : c10.c(); + var e10 = c10.AL / 1e6 | 0, f10 = b10.Et; + if (y7() === f10) + b10 = new ba.Date(b10.JA, -1 + b10.mA | 0, b10.Oz, c10.FG, c10.qH, c10.WH, e10); + else if (f10 instanceof z7) + f10 = f10.i | 0, b10 = +ba.Date.UTC(b10.JA, -1 + b10.mA | 0, b10.Oz, c10.FG, c10.qH, c10.WH, e10) + ca(1e3, f10), b10 = new ba.Date(b10); + else + throw new x7().d(f10); + b10 = +b10.getTime(); + b10 = Zsa(a10, b10); + new nF().O$(new qa().Sc(b10, a10.Wj)); + } + lF.prototype.$classData = r8({ y3a: 0 }, false, "org.mulesoft.common.time.package$DateTimes$", { y3a: 1, f: 1 }); + var $sa = void 0; + function Ysa() { + $sa || ($sa = new lF().a()); + return $sa; + } + function oF() { + } + oF.prototype = new u7(); + oF.prototype.constructor = oF; + oF.prototype.a = function() { + return this; + }; + function ata(a10, b10, c10) { + a10 = wa(b10); + return new pF().Laa(b10, 0, 2147483647 > a10 ? a10 : 2147483647, c10); + } + oF.prototype.$classData = r8({ C3a: 0 }, false, "org.mulesoft.lexer.CharSequenceLexerInput$", { C3a: 1, f: 1 }); + var bta = void 0; + function cta() { + bta || (bta = new oF().a()); + return bta; + } + function qF() { + this.Xs = 0; + } + qF.prototype = new u7(); + qF.prototype.constructor = qF; + qF.prototype.a = function() { + this.Xs = -1; + return this; + }; + qF.prototype.$classData = r8({ H3a: 0 }, false, "org.mulesoft.lexer.LexerInput$", { H3a: 1, f: 1 }); + var dta = void 0; + function rF() { + dta || (dta = new qF().a()); + return dta; + } + function sF() { + this.dl = null; + } + sF.prototype = new u7(); + sF.prototype.constructor = sF; + sF.prototype.a = function() { + eta = this; + this.dl = new tF().Fi(0, 0, 0); + return this; + }; + function uF(a10, b10, c10, e10) { + return 0 === b10 && 0 === c10 && 0 === e10 ? a10.dl : new tF().Fi(b10, c10, e10); + } + sF.prototype.$classData = r8({ J3a: 0 }, false, "org.mulesoft.lexer.Position$", { J3a: 1, f: 1 }); + var eta = void 0; + function vF() { + eta || (eta = new sF().a()); + return eta; + } + function wF() { + this.ag = null; + this.zn = this.AB = 0; + } + wF.prototype = new u7(); + wF.prototype.constructor = wF; + wF.prototype.a = function() { + this.ag = new Xj().ue(1e4); + this.zn = this.AB = 0; + return this; + }; + function fta(a10) { + a10.AB = 1 + a10.AB | 0; + return xF(a10.ag, -1 + a10.AB | 0); + } + wF.prototype.b = function() { + return this.zn <= this.AB; + }; + function gta(a10, b10) { + if (a10.ag.w <= a10.zn) + pr(a10.ag, b10); + else { + var c10 = a10.ag, e10 = a10.zn; + if (e10 >= c10.w) + throw new U6().e("" + e10); + c10.L.n[e10] = b10; + } + a10.zn = 1 + a10.zn | 0; + } + wF.prototype.jb = function() { + return this.zn - this.AB | 0; + }; + wF.prototype.$classData = r8({ K3a: 0 }, false, "org.mulesoft.lexer.Queue", { K3a: 1, f: 1 }); + function yF() { + this.oia = this.$ = null; + } + yF.prototype = new u7(); + yF.prototype.constructor = yF; + function hta() { + } + hta.prototype = yF.prototype; + yF.prototype.Hc = function(a10, b10) { + this.$ = a10; + this.oia = b10; + return this; + }; + yF.prototype.t = function() { + return this.$; + }; + function zF() { + } + zF.prototype = new u7(); + zF.prototype.constructor = zF; + zF.prototype.a = function() { + return this; + }; + function ita(a10, b10, c10) { + var e10 = new ba.XMLHttpRequest(), f10 = new AF().a(); + e10.onreadystatechange = /* @__PURE__ */ function(g10, h10) { + return function() { + jta(); + if (4 === (g10.readyState | 0)) + if (200 <= (g10.status | 0) && 300 > (g10.status | 0) || 304 === (g10.status | 0)) + var k10 = Ij(h10, g10); + else + k10 = new BF(), k10.L3 = g10, CF.prototype.Ge.call(k10, null, null), k10 = Gj(h10, k10); + else + k10 = void 0; + return k10; + }; + }(e10, f10); + e10.open("GET", b10); + e10.responseType = ""; + e10.timeout = 0; + e10.withCredentials = false; + c10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + h10.setRequestHeader(k10.ma(), k10.ya()); + }; + }(a10, e10))); + e10.send(); + return f10; + } + zF.prototype.$classData = r8({ O3a: 0 }, false, "org.scalajs.dom.ext.Ajax$", { O3a: 1, f: 1 }); + var kta = void 0; + function jta() { + kta || (kta = new zF().a()); + return kta; + } + function lta() { + } + lta.prototype = new u7(); + lta.prototype.constructor = lta; + function mta() { + } + mta.prototype = lta.prototype; + function nta() { + } + nta.prototype = new u7(); + nta.prototype.constructor = nta; + function ota() { + } + ota.prototype = nta.prototype; + function Rja(a10, b10, c10) { + a10.y0(b10, DF(new EF(), FF(), c10)); + } + function pta() { + } + pta.prototype = new u7(); + pta.prototype.constructor = pta; + function qta() { + } + qta.prototype = pta.prototype; + pta.prototype.fo = function(a10) { + this.jX(DF(new EF(), FF(), a10)); + }; + function GF() { + } + GF.prototype = new u7(); + GF.prototype.constructor = GF; + GF.prototype.a = function() { + return this; + }; + function HF(a10, b10, c10) { + ue4(); + return new ve4().d(rta(new IF(), b10, oq(/* @__PURE__ */ function(e10, f10) { + return function() { + return f10; + }; + }(a10, c10)))); + } + GF.prototype.$classData = r8({ f4a: 0 }, false, "org.yaml.convert.YRead$", { f4a: 1, f: 1 }); + var sta = void 0; + function JF() { + sta || (sta = new GF().a()); + return sta; + } + function KF() { + } + KF.prototype = new u7(); + KF.prototype.constructor = KF; + KF.prototype.a = function() { + return this; + }; + function tta(a10, b10) { + return 48 <= b10 && 57 >= b10; + } + KF.prototype.$classData = r8({ y4a: 0 }, false, "org.yaml.lexer.JsonLexer$", { y4a: 1, f: 1 }); + var uta = void 0; + function LF() { + uta || (uta = new KF().a()); + return uta; + } + function MF() { + } + MF.prototype = new u7(); + MF.prototype.constructor = MF; + MF.prototype.a = function() { + return this; + }; + function vta(a10, b10) { + return -1 !== wta(ua(), "-?:,[]{}#&*!|>'\"%@ `", b10); + } + function xta(a10, b10) { + return 91 === b10 || 93 === b10 || 123 === b10 || 125 === b10 || 44 === b10; + } + function yta(a10, b10) { + return 32 === b10 || 9 === b10; + } + function NF(a10, b10) { + return 10 === b10 || 13 === b10 || b10 === rF().Xs; + } + function zta(a10, b10) { + return 10 === b10 || 13 === b10; + } + function Ata(a10, b10) { + return 48 <= b10 && 57 >= b10 || 65 <= b10 && 90 >= b10 || 97 <= b10 && 122 >= b10 || 45 === b10; + } + function OF(a10, b10) { + return 32 < b10 && 126 >= b10 || 133 === b10 || 160 <= b10 && 55295 >= b10 || 57344 <= b10 && 65533 >= b10 || 65536 <= b10 && 1114111 >= b10; + } + function Bta(a10, b10) { + switch (b10) { + case 48: + return 0; + case 97: + return 7; + case 98: + return 11; + case 116: + case 9: + return 9; + case 110: + return 10; + case 118: + return 11; + case 102: + return 12; + case 114: + return 13; + case 101: + return 27; + case 32: + return 32; + case 34: + return 34; + case 47: + return 47; + case 92: + return 92; + case 78: + return 133; + case 95: + return 160; + case 76: + return 8232; + case 80: + return 8233; + case 120: + return 120; + case 117: + return 117; + case 85: + return 85; + default: + return -1; + } + } + function Cta(a10, b10) { + return 9 === b10 || 32 <= b10 && 126 >= b10 || 133 === b10 || 160 <= b10 && 55295 >= b10 || 57344 <= b10 && 65533 >= b10 || 65536 <= b10 && 1114111 >= b10; + } + MF.prototype.$classData = r8({ z4a: 0 }, false, "org.yaml.lexer.YamlCharRules$", { z4a: 1, f: 1 }); + var Dta = void 0; + function PF() { + Dta || (Dta = new MF().a()); + return Dta; + } + function Eta() { + } + Eta.prototype = new u7(); + Eta.prototype.constructor = Eta; + function QF() { + } + QF.prototype = Eta.prototype; + function RF() { + } + RF.prototype = new u7(); + RF.prototype.constructor = RF; + RF.prototype.a = function() { + return this; + }; + function Fta(a10, b10) { + return new SF().YG(ata(cta(), b10, ""), vF().dl); + } + RF.prototype.$classData = r8({ B4a: 0 }, false, "org.yaml.lexer.YamlLexer$", { B4a: 1, f: 1 }); + var Gta = void 0; + function Hta() { + Gta || (Gta = new RF().a()); + return Gta; + } + function TF() { + this.Vv = this.BR = this.AR = this.rR = this.fB = this.Nfa = this.as = this.bs = this.Ws = this.Tv = this.wx = this.PC = this.ZC = this.zF = this.E5 = this.o5 = this.Wfa = this.Lfa = this.YI = this.SM = this.Uu = this.Tu = this.YY = this.nJ = this.Ufa = this.Tfa = this.GF = this.Ai = this.I5 = this.s5 = this.WX = this.vX = this.XM = this.TM = this.H5 = this.r5 = this.G5 = this.q5 = this.$y = this.F5 = this.p5 = this.Lna = null; + } + TF.prototype = new u7(); + TF.prototype.constructor = TF; + TF.prototype.a = function() { + Ita = this; + this.Lna = new wu().a(); + this.p5 = new UF().Hc("BeginAnchor", "A"); + this.F5 = new UF().Hc("EndAnchor", "a"); + this.$y = new UF().Hc("LineBreak", "b"); + this.q5 = new UF().Hc("BeginComment", "C"); + this.G5 = new UF().Hc("EndComment", "c"); + this.r5 = new UF().Hc("BeginDirective", "D"); + this.H5 = new UF().Hc("EndDirective", "d"); + this.TM = new UF().Hc("BeginEscape", "E"); + this.XM = new UF().Hc("EndScape", "e"); + this.vX = new UF().Hc("BeginTag", "G"); + this.WX = new UF().Hc("EndTag", "g"); + this.s5 = new UF().Hc( + "BeginHandle", + "H" + ); + this.I5 = new UF().Hc("EndHandle", "h"); + this.Ai = new UF().Hc("Indicator", "I"); + this.GF = new UF().Hc("Indent", "i"); + this.Tfa = new UF().Hc("DirectivesEnd", "K"); + this.Ufa = new UF().Hc("DocumentEnd", "k"); + this.nJ = new UF().Hc("LineFeed", "L"); + this.YY = new UF().Hc("LineFold", "l"); + this.Tu = new UF().Hc("BeginNode", "N"); + this.Uu = new UF().Hc("EndNode", "n"); + this.SM = new UF().Hc("BeginDocument", "O"); + this.YI = new UF().Hc("EndDocument", "o"); + this.Lfa = new UF().Hc("BeginProperties", "P"); + this.Wfa = new UF().Hc("EndProperties", "p"); + this.o5 = new UF().Hc("BeginAlias", "R"); + this.E5 = new UF().Hc("EndAlias", "r"); + this.zF = new UF().Hc("BeginSequence", "Q"); + this.ZC = new UF().Hc("EndSequence", "q"); + this.PC = new UF().Hc("BeginMapping", "M"); + this.wx = new UF().Hc("EndMapping", "m"); + this.Tv = new UF().Hc("BeginScalar", "S"); + this.Ws = new UF().Hc("EndScalar", "s"); + this.bs = new UF().Hc("Text", "T"); + this.as = new UF().Hc("MetaText", "t"); + this.Nfa = new UF().Hc("Bom", "U"); + this.fB = new UF().Hc("WhiteSpace", "w"); + this.rR = new UF().Hc("BeginPair", "X"); + this.AR = new UF().Hc( + "EndPair", + "x" + ); + this.BR = new UF().Hc("EndStream", ""); + new UF().Hc("BeginStream", ""); + this.Vv = new UF().Hc("Error", "!"); + new UF().Hc("UnParsed", "-"); + return this; + }; + TF.prototype.$classData = r8({ D4a: 0 }, false, "org.yaml.lexer.YamlToken$", { D4a: 1, f: 1 }); + var Ita = void 0; + function VF() { + Ita || (Ita = new TF().a()); + return Ita; + } + function WF() { + this.bi = null; + } + WF.prototype = new u7(); + WF.prototype.constructor = WF; + WF.prototype.a = function() { + Jta = this; + cc(); + this.bi = new XF().DK(w6(/* @__PURE__ */ function() { + return function(a10) { + throw new YF().o1(a10); + }; + }(this))); + cc(); + return this; + }; + WF.prototype.$classData = r8({ H4a: 0 }, false, "org.yaml.model.IllegalTypeHandler$", { H4a: 1, f: 1 }); + var Jta = void 0; + function cc() { + Jta || (Jta = new WF().a()); + return Jta; + } + function ZF() { + this.mca = null; + } + ZF.prototype = new u7(); + ZF.prototype.constructor = ZF; + ZF.prototype.a = function() { + Kta = this; + this.mca = Lta(Mta(), Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + throw mb(E6(), new kf().aH(b10.tt + " at " + a10.Rf + ": " + de4(ee4(), a10.rf, a10.If, a10.Yf, a10.bg), b10)); + }; + }(this))); + new $F().d(/* @__PURE__ */ function() { + return function() { + }; + }(this)); + return this; + }; + function Lta(a10, b10) { + return new aG().d(/* @__PURE__ */ function(c10, e10) { + return function(f10, g10) { + e10.ug(f10, g10); + }; + }(a10, b10)); + } + ZF.prototype.$classData = r8({ M4a: 0 }, false, "org.yaml.model.ParseErrorHandler$", { M4a: 1, f: 1 }); + var Kta = void 0; + function Mta() { + Kta || (Kta = new ZF().a()); + return Kta; + } + function Nta(a10, b10) { + var c10 = gc(a10.wT); + b10 = eF(fF(), b10); + return "" + c10 + b10 + gc(a10.wT); + } + function Ota(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Vha); + } + function bG() { + } + bG.prototype = new u7(); + bG.prototype.constructor = bG; + bG.prototype.a = function() { + return this; + }; + function Pta(a10, b10) { + '"' === b10 ? a10 = cG() : "'" === b10 ? a10 = Qta() : "|" === b10 ? a10 = Rta() : ">" === b10 ? (Sta || (Sta = new dG().a()), a10 = Sta) : a10 = "" === b10 ? eG() : Tta(); + return a10; + } + bG.prototype.$classData = r8({ R4a: 0 }, false, "org.yaml.model.ScalarMark$", { R4a: 1, f: 1 }); + var Uta = void 0; + function Vta() { + Uta || (Uta = new bG().a()); + return Uta; + } + function fG() { + } + fG.prototype = new u7(); + fG.prototype.constructor = fG; + fG.prototype.a = function() { + return this; + }; + function Wta(a10, b10) { + return Xta(Yta(""), b10); + } + function OA() { + Dj(); + return new rD().Hc("", ""); + } + function wda(a10, b10) { + return Xta(Yta(b10.da.Rf), b10); + } + function Yta(a10) { + Dj(); + return new rD().Hc("", a10); + } + fG.prototype.$classData = r8({ Z4a: 0 }, false, "org.yaml.model.YDocument$", { Z4a: 1, f: 1 }); + var Zta = void 0; + function Dj() { + Zta || (Zta = new fG().a()); + return Zta; + } + function gG() { + this.s = null; + } + gG.prototype = new u7(); + gG.prototype.constructor = gG; + function $ta() { + } + $ta.prototype = gG.prototype; + gG.prototype.a = function() { + this.s = new Xj().a(); + return this; + }; + function QA(a10, b10) { + b10 = Mc(ua(), b10, "\n"); + for (var c10 = 0, e10 = b10.n.length; c10 < e10; ) { + var f10 = b10.n[c10], g10 = a10.s, h10 = SA(zs(), a10.ca); + ue4(); + hG(); + iG(); + var k10 = new jG().a(); + pr(g10, new kG().TO(f10, h10, lG(k10))); + c10 = 1 + c10 | 0; + } + } + function rD() { + this.pi = this.mi = null; + } + rD.prototype = new u7(); + rD.prototype.constructor = rD; + rD.prototype.Hc = function(a10, b10) { + this.mi = a10; + this.pi = b10; + return this; + }; + function Xta(a10, b10) { + var c10 = SA(zs(), a10.pi), e10 = a10.mi; + if (null === e10) + throw new sf().a(); + if ("" === e10) + b10 = mD(Gb(), ha(Ja(aua), [b10])); + else { + Gb(); + e10 = a10.mi; + a10 = SA(zs(), a10.pi); + ue4(); + hG(); + iG(); + var f10 = new jG().a(); + b10 = mD(0, ha(Ja(mG), [new kG().TO(e10, a10, lG(f10)), b10])); + } + return new RA().Ac(c10, b10); + } + rD.prototype.$classData = r8({ e5a: 0 }, false, "org.yaml.model.YDocument$WithComment", { e5a: 1, f: 1 }); + function IF() { + this.mv = this.Ca = null; + } + IF.prototype = new u7(); + IF.prototype.constructor = IF; + IF.prototype.t = function() { + return Hb(this.mv) + "@" + this.Ca; + }; + function rta(a10, b10, c10) { + a10.Ca = b10; + a10.mv = c10; + return a10; + } + IF.prototype.$classData = r8({ f5a: 0 }, false, "org.yaml.model.YError", { f5a: 1, f: 1 }); + function nG() { + this.ce = null; + } + nG.prototype = new u7(); + nG.prototype.constructor = nG; + nG.prototype.a = function() { + bua = this; + ur(); + ue4(); + hG(); + iG(); + var a10 = new jG().a(); + this.ce = tr(0, lG(a10), ""); + return this; + }; + function tr(a10, b10, c10) { + return new vw().Ac(SA(zs(), c10), b10); + } + nG.prototype.$classData = r8({ l5a: 0 }, false, "org.yaml.model.YMap$", { l5a: 1, f: 1 }); + var bua = void 0; + function ur() { + bua || (bua = new nG().a()); + return bua; + } + function oG() { + } + oG.prototype = new u7(); + oG.prototype.constructor = oG; + oG.prototype.a = function() { + return this; + }; + function vD(a10, b10) { + a10 = new cua().a(); + var c10 = rw(), e10 = b10.ec(a10, c10.sc); + a10 = e10.lb(0); + c10 = e10.lb(1); + var f10 = zs(); + e10 = e10.lb(0); + return dua(new Es(), a10, c10, SA(f10, e10.da.Rf), b10); + } + function pG(a10, b10, c10) { + return dua(new Es(), b10, c10, SA(zs(), b10.da.Rf), mD(Gb(), ha(Ja(aua), [b10, c10]))); + } + oG.prototype.$classData = r8({ o5a: 0 }, false, "org.yaml.model.YMapEntry$", { o5a: 1, f: 1 }); + var eua = void 0; + function wD() { + eua || (eua = new oG().a()); + return eua; + } + function qG() { + this.En = this.nd = null; + } + qG.prototype = new u7(); + qG.prototype.constructor = qG; + qG.prototype.a = function() { + fua = this; + this.nd = mr(T6(), or().nd, Q5().nd); + T6(); + var a10 = zs().Hq; + or(); + var b10 = eG(); + or(); + ue4(); + hG(); + iG(); + var c10 = lG(new jG().a()); + this.En = mr(0, rG(null, "", b10, a10, c10), Q5().nd); + ue4(); + hG(); + iG(); + lG(new jG().a()); + return this; + }; + function gua(a10, b10, c10, e10, f10) { + a10 = new sG(); + f10 = SA(zs(), f10); + var g10 = mD(Gb(), ha(Ja(hua), [b10])); + a10.oq = b10; + a10.tea = c10; + a10.sS = e10; + Cs.prototype.Ac.call(a10, f10, g10); + return a10; + } + function mr(a10, b10, c10) { + a10 = c10.Vi; + c10 = b10.da.Rf; + T6(); + var e10 = y7(); + T6(); + return gua(T6(), b10, a10, e10, c10); + } + function mh(a10, b10) { + return mr(T6(), tG(or(), b10, ""), Q5().Na); + } + function iua(a10, b10) { + a10 = (T6(), ""); + b10 = tG(or(), b10, a10); + var c10 = Q5().wq.Vi; + return jua(new uG(), b10, c10, SA(zs(), a10), mD(Gb(), ha(Ja(mG), [c10, b10]))); + } + function kua(a10, b10, c10) { + return mr(T6(), tG(or(), b10, c10), Q5().Na); + } + qG.prototype.$classData = r8({ r5a: 0 }, false, "org.yaml.model.YNode$", { r5a: 1, f: 1 }); + var fua = void 0; + function T6() { + fua || (fua = new qG().a()); + return fua; + } + function Iw(a10, b10) { + return b10.Av(a10.cQ()); + } + function N6(a10, b10, c10) { + a10 = a10.Qp(b10); + if (a10 instanceof ye4) + return a10.i; + if (a10 instanceof ve4) + return c10.yB(a10.i, b10.aK()); + throw new x7().d(a10); + } + function lua(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.oJ); + } + function DG() { + } + DG.prototype = new u7(); + DG.prototype.constructor = DG; + DG.prototype.a = function() { + return this; + }; + DG.prototype.$classData = r8({ x5a: 0 }, false, "org.yaml.model.YNonContent$", { x5a: 1, f: 1 }); + var mua = void 0; + function EG() { + this.da = this.Xf = null; + } + EG.prototype = new u7(); + EG.prototype.constructor = EG; + function FG() { + } + FG.prototype = EG.prototype; + EG.prototype.Ac = function(a10, b10) { + this.Xf = b10; + nua || (nua = new GG().a()); + if (b10.b() || !a10.Yx()) + b10 = a10; + else { + var c10 = zs().Hq; + (null === a10 ? null === c10 : a10.h(c10)) ? b10 = oua(b10.ga().da, b10.hA().da) : (zs(), a10 = a10.Rf, c10 = b10.ga().da, c10 = uF(vF(), c10.rf, c10.If, c10.Au), b10 = b10.hA().da, b10 = pua(0, a10, c10, uF(vF(), b10.Yf, b10.bg, b10.pA))); + } + this.da = b10; + return this; + }; + var mG = r8({ $s: 0 }, false, "org.yaml.model.YPart", { $s: 1, f: 1 }); + EG.prototype.$classData = mG; + function GG() { + } + GG.prototype = new u7(); + GG.prototype.constructor = GG; + GG.prototype.a = function() { + return this; + }; + GG.prototype.$classData = r8({ z5a: 0 }, false, "org.yaml.model.YPart$", { z5a: 1, f: 1 }); + var nua = void 0; + function HG() { + this.nd = null; + } + HG.prototype = new u7(); + HG.prototype.constructor = HG; + HG.prototype.a = function() { + qua = this; + var a10 = zs().Hq; + or(); + var b10 = eG(); + or(); + ue4(); + hG(); + iG(); + var c10 = lG(new jG().a()); + this.nd = rG(null, "null", b10, a10, c10); + return this; + }; + function tG(a10, b10, c10) { + a10 = "" + b10; + c10 = SA(zs(), c10); + or(); + var e10 = eG(); + or(); + ue4(); + hG(); + iG(); + var f10 = lG(new jG().a()); + return rG(b10, a10, e10, c10, f10); + } + function sD(a10, b10, c10, e10) { + a10 = rua(IG(), b10, eG(), c10.Vi, e10, Mta().mca).r; + c10 = eG(); + ue4(); + hG(); + iG(); + var f10 = new jG().a(); + return rG(a10, b10, c10, e10, lG(f10)); + } + function nr(a10, b10) { + a10 = "" + b10; + var c10 = zs().Hq; + or(); + var e10 = eG(); + or(); + ue4(); + hG(); + iG(); + var f10 = lG(new jG().a()); + return rG(b10, a10, e10, c10, f10); + } + HG.prototype.$classData = r8({ B5a: 0 }, false, "org.yaml.model.YScalar$", { B5a: 1, f: 1 }); + var qua = void 0; + function or() { + qua || (qua = new HG().a()); + return qua; + } + function JG() { + this.ce = null; + } + JG.prototype = new u7(); + JG.prototype.constructor = JG; + JG.prototype.a = function() { + sua = this; + var a10 = zs().Hq; + ue4(); + hG(); + iG(); + var b10 = new jG().a(); + this.ce = new Sx().Ac(a10, lG(b10)); + return this; + }; + JG.prototype.$classData = r8({ D5a: 0 }, false, "org.yaml.model.YSequence$", { D5a: 1, f: 1 }); + var sua = void 0; + function eE() { + sua || (sua = new JG().a()); + return sua; + } + function KG() { + } + KG.prototype = new u7(); + KG.prototype.constructor = KG; + KG.prototype.a = function() { + return this; + }; + KG.prototype.$classData = r8({ H5a: 0 }, false, "org.yaml.model.YTag$", { H5a: 1, f: 1 }); + var tua = void 0; + function LG() { + this.iqa = false; + this.Vi = null; + } + LG.prototype = new u7(); + LG.prototype.constructor = LG; + LG.prototype.t = function() { + return this.Vi.va; + }; + LG.prototype.eq = function(a10) { + this.iqa = a10; + return this; + }; + LG.prototype.$classData = r8({ I5a: 0 }, false, "org.yaml.model.YType", { I5a: 1, f: 1 }); + function MG() { + this.wq = this.En = this.Hq = this.nd = this.cs = this.ti = this.cj = this.of = this.Na = this.sa = this.cd = this.iba = null; + } + MG.prototype = new u7(); + MG.prototype.constructor = MG; + MG.prototype.a = function() { + uua = this; + this.iba = new wu().a(); + this.cd = NG(this, "!!seq", true); + this.sa = NG(this, "!!map", true); + this.Na = NG(this, "!!str", true); + this.of = NG(this, "!!float", true); + this.cj = NG(this, "!!int", true); + this.ti = NG(this, "!!bool", true); + this.cs = NG(this, "!!timestamp", true); + this.nd = NG(this, "!!null", true); + this.Hq = NG(this, "?", true); + this.En = NG(this, "!", true); + this.wq = NG(this, "!include", false); + return this; + }; + function NG(a10, b10, c10) { + c10 = new LG().eq(c10); + tua || (tua = new KG().a()); + var e10 = zs().Hq; + ue4(); + hG(); + iG(); + var f10 = new jG().a(); + e10 = vua(new OG(), b10, c10, e10, lG(f10)); + c10.Vi = e10; + a10.iba.Ue(b10, c10); + return c10; + } + MG.prototype.$classData = r8({ J5a: 0 }, false, "org.yaml.model.YType$", { J5a: 1, f: 1 }); + var uua = void 0; + function Q5() { + uua || (uua = new MG().a()); + return uua; + } + function PG() { + } + PG.prototype = new u7(); + PG.prototype.constructor = PG; + PG.prototype.a = function() { + return this; + }; + function QG(a10, b10, c10, e10, f10) { + a10 = new RG(); + LF(); + b10 = new SG().YG(ata(cta(), b10, c10), e10); + return wua(a10, b10, f10); + } + PG.prototype.$classData = r8({ L5a: 0 }, false, "org.yaml.parser.JsonParser$", { L5a: 1, f: 1 }); + var xua = void 0; + function TG() { + xua || (xua = new PG().a()); + return xua; + } + function UG() { + this.l = this.r = this.Jo = this.uy = this.M0 = null; + } + UG.prototype = new u7(); + UG.prototype.constructor = UG; + function VG(a10) { + return oua(a10.M0, a10.l.ph.Oj.yc); + } + function yua(a10) { + var b10 = a10.l.ph, c10 = a10.l.ph.Oj; + b10 = ka(WG(b10, b10.Oj)); + a10.l.W1 && pr(a10.uy, zua(c10.kx, b10, c10.yc)); + } + function Aua(a10) { + if (XG(a10.uy)) + return ue4(), hG(), iG(), lG(new jG().a()); + var b10 = a10.uy, c10 = b10.w; + c10 = ja(Ja(YG), [c10]); + ZG(b10, c10, 0); + $G(a10.uy, 0); + return mD(Gb(), c10); + } + UG.prototype.eu = function() { + this.hz(); + if (XG(this.Jo)) + return ja(Ja(mG), [0]); + var a10 = this.Jo, b10 = a10.w; + b10 = ja(Ja(mG), [b10]); + ZG(a10, b10, 0); + $G(this.Jo, 0); + return b10; + }; + UG.prototype.SO = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.M0 = a10.ph.Oj.yc; + this.uy = new Xj().a(); + this.Jo = new Xj().a(); + return this; + }; + UG.prototype.hz = function() { + if (tc(this.uy)) { + var a10 = new aH().Ac(VG(this), Aua(this)); + pr(this.Jo, a10); + } + }; + UG.prototype.$classData = r8({ N5a: 0 }, false, "org.yaml.parser.JsonParser$JsonBuilder", { N5a: 1, f: 1 }); + function bH() { + this.Bn = this.Id = null; + } + bH.prototype = new u7(); + bH.prototype.constructor = bH; + bH.prototype.R8a = function() { + try { + var a10 = this.Id; + if ("" !== a10 && "null" !== a10 && "Null" !== a10 && "NULL" !== a10 && "~" !== a10 || !cH(this, Q5().nd)) + if ("true" !== a10 && "True" !== a10 && "TRUE" !== a10 || !cH(this, Q5().ti)) + if ("false" !== a10 && "False" !== a10 && "FALSE" !== a10 || !cH(this, Q5().ti)) { + var b10 = yt(IG().bca, a10); + if (b10.b()) + f10 = false; + else { + if (null !== b10.c()) + var c10 = b10.c(), e10 = 0 === Tu(c10, 0); + else + e10 = false; + var f10 = e10 ? cH(this, Q5().cj) : false; + } + if (f10) { + this.Bn = Q5().cj; + try { + ue4(); + var g10 = new qg().e(this.Id), h10 = TD(UD(), g10.ja, 10); + new ye4().d(new qa().Sc(h10.od, h10.Ud)); + return; + } catch (Se4) { + var k10 = Ph(E6(), Se4); + if (k10 instanceof dH) { + ue4(); + var l10 = ue4(); + 0 === (2 & l10.xa) << 24 >> 24 && 0 === (2 & l10.xa) << 24 >> 24 && (l10.bra = Lj(), l10.xa = (2 | l10.xa) << 24 >> 24); + var m10 = Bua(new eH(), new FE().e(this.Id)).Xl, p10 = Oj(va(), Mj(Nj(), m10)); + new ye4().d(p10); + return; + } + if (k10 instanceof nb) { + ue4(); + var t10 = Cua(this.Bn, this.Id, k10); + new ve4().d(t10); + return; + } + throw Se4; + } + } + var v10 = yt(IG().Mna, a10); + if (v10.b()) + D10 = false; + else if (null !== v10.c()) + var A10 = v10.c(), D10 = 0 === Tu(A10, 1); + else + D10 = false; + if (D10) { + var C10 = v10.c(), I10 = Uu(C10, 0); + if (cH(this, Q5().cj)) { + this.Bn = Q5().cj; + ue4(); + var L10 = TD(UD(), I10, 16); + new ye4().d(new qa().Sc(L10.od, L10.Ud)); + return; + } + } + var Y10 = yt( + IG().Ona, + a10 + ); + if (Y10.b()) + pa = false; + else if (null !== Y10.c()) + var ia = Y10.c(), pa = 0 === Tu(ia, 1); + else + pa = false; + if (pa) { + var La = Y10.c(), ob = Uu(La, 0); + if (cH(this, Q5().cj)) { + this.Bn = Q5().cj; + ue4(); + var zb = TD(UD(), ob, 8); + new ye4().d(new qa().Sc(zb.od, zb.Ud)); + return; + } + } + var Zb = yt(IG().aca, a10); + if (Zb.b()) + id = false; + else { + if (null !== Zb.c()) + var Cc = Zb.c(), vc = 0 === Tu(Cc, 0); + else + vc = false; + var id = vc ? cH(this, Q5().of) : false; + } + if (id) { + this.Bn = Q5().of; + ue4(); + var yd = new qg().e(this.Id), zd = Oj(va(), yd.ja); + new ye4().d(zd); + } else { + var rd = yt(IG().Nna, a10); + if (rd.b()) + le4 = false; + else if (null !== rd.c()) + var sd = rd.c(), le4 = 0 === Tu(sd, 1); + else + le4 = false; + if (le4) { + var Vc = rd.c(), Sc = Uu(Vc, 0); + if (cH(this, Q5().of)) { + this.Bn = Q5().of; + ue4(); + new ye4().d("-" === Sc ? -Infinity : Infinity); + return; + } + } + if (".nan" !== a10 && ".NaN" !== a10 && ".NAN" !== a10 || !cH(this, Q5().of)) { + var Qc = mF().qj(a10); + if (!Qc.b()) { + var $c = Qc.c(); + if (cH(this, Q5().cs)) { + this.Bn = Q5().cs; + ue4(); + new ye4().d($c); + return; + } + } + var Wc = this.Bn, Qe = Q5().Hq; + if (Wc === Qe) + this.Bn = Q5().Na, ue4(), new ye4().d(this.Id); + else { + var Qd = this.Bn, me4 = Q5().nd; + if (Qd === me4) + var of = true; + else { + var Le2 = this.Bn, Ve = Q5().ti; + of = Le2 === Ve; + } + if (of) + var he4 = true; + else { + var Wf = this.Bn, vf = Q5().cj; + he4 = Wf === vf; + } + if (he4) + var He = true; + else { + var Ff = this.Bn, wf = Q5().of; + He = Ff === wf; + } + if (He) + var Re2 = true; + else { + var we4 = this.Bn, ne4 = Q5().cs; + Re2 = we4 === ne4; + } + if (Re2) { + ue4(); + var Me2 = Cua(this.Bn, this.Id, null); + new ve4().d(Me2); + } else + ue4(), new ye4().d(this.Id); + } + } else + this.Bn = Q5().of, ue4(), new ye4().d(NaN); + } + } else + this.Bn = Q5().ti, ue4(), new ye4().d(false); + else + this.Bn = Q5().ti, ue4(), new ye4().d(true); + else + this.Bn = Q5().nd, ue4(), new ye4().d(null); + } catch (Se4) { + if (a10 = Ph(E6(), Se4), a10 instanceof nb) + ue4(), a10 = Cua(this.Bn, this.Id, a10), new ve4().d(a10); + else + throw Se4; + } + }; + function cH(a10, b10) { + var c10 = a10.Bn, e10 = Q5().Hq; + return c10 === e10 ? true : a10.Bn === b10; + } + bH.prototype.$classData = r8({ S5a: 0 }, false, "org.yaml.parser.ScalarParser", { S5a: 1, f: 1 }); + function fH() { + this.Ofa = this.K7 = this.Nna = this.aca = this.Mna = this.Ona = this.bca = null; + } + fH.prototype = new u7(); + fH.prototype.constructor = fH; + fH.prototype.a = function() { + Dua = this; + var a10 = new qg().e("[-+]?\\d+"), b10 = H10(); + this.bca = new rg().vi(a10.ja, b10); + a10 = new qg().e("0o([0-7]+)"); + b10 = H10(); + this.Ona = new rg().vi(a10.ja, b10); + a10 = new qg().e("0x([0-9a-fA-F]+)"); + b10 = H10(); + this.Mna = new rg().vi(a10.ja, b10); + a10 = new qg().e("-?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][-+]?\\d+)?"); + b10 = H10(); + this.aca = new rg().vi(a10.ja, b10); + a10 = new qg().e("([-+])?(?:\\.inf|\\.Inf|\\.INF)"); + b10 = H10(); + this.Nna = new rg().vi(a10.ja, b10); + a10 = ["", "null", "Null", "NULL", "~"]; + if (0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + for (var c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.K7 = a10; + a10 = "true True TRUE false False FALSE".split(" "); + if (0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + this.Ofa = a10; + return this; + }; + function Eua(a10) { + try { + return TD(UD(), a10, 10); + } catch (b10) { + if (b10 instanceof dH) + return a10 = new qg().e(a10), Oj(va(), a10.ja); + throw b10; + } + } + fH.prototype.U6a = function(a10) { + var b10 = a10.length | 0; + if (0 === b10) + return gH().nd; + switch (65535 & (a10.charCodeAt(0) | 0)) { + case 110: + case 78: + case 126: + if (this.K7.Ha(a10)) + return gH().nd; + gH(); + gH(); + b10 = Q5().Na; + return hH(b10.Vi, a10); + case 116: + case 84: + case 102: + case 70: + if (this.Ofa.Ha(a10)) + return gH(), a10 = new qg().e(a10), a10 = iH(a10.ja), gH(), b10 = Q5().ti, hH(b10.Vi, a10); + gH(); + gH(); + b10 = Q5().Na; + return hH(b10.Vi, a10); + case 46: + if (".nan" === a10.toLowerCase()) + return gH(), gH(), a10 = Q5().of, hH(a10.Vi, NaN); + if (".inf" === a10.toLowerCase()) + return gH(), gH(), a10 = Q5().of, hH(a10.Vi, Infinity); + gH(); + gH(); + b10 = Q5().Na; + return hH(b10.Vi, a10); + case 45: + return "-.inf" === a10.toLowerCase() ? (gH(), gH(), a10 = Q5().of, hH(a10.Vi, -Infinity)) : Fua(this, a10, false); + case 43: + return "+.inf" === a10.toLowerCase() ? (gH(), gH(), a10 = Q5().of, hH(a10.Vi, Infinity)) : Fua(this, a10, false); + case 48: + return 1 === b10 ? (gH(), gH(), a10 = Q5().cj, hH(a10.Vi, Ea().dl)) : 111 === (65535 & (a10.charCodeAt(1) | 0)) ? Gua(a10, 8) : 120 === (65535 & (a10.charCodeAt(1) | 0)) ? Gua(a10, 16) : Fua(this, a10, true); + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return Fua(this, a10, true); + default: + return gH(), gH(), b10 = Q5().Na, hH(b10.Vi, a10); + } + }; + function Fua(a10, b10, c10) { + var e10 = yt(a10.bca, b10); + e10.b() ? e10 = false : null !== e10.c() ? (e10 = e10.c(), e10 = 0 === Tu(e10, 0)) : e10 = false; + if (e10) + return gH(), c10 = Q5().cj, b10 = Eua(b10), hH(c10.Vi, b10); + a10 = yt(a10.aca, b10); + a10.b() ? a10 = false : null !== a10.c() ? (a10 = a10.c(), a10 = 0 === Tu(a10, 0)) : a10 = false; + if (a10) + return gH(), b10 = new qg().e(b10), b10 = Oj(va(), b10.ja), gH(), c10 = Q5().of, hH(c10.Vi, b10); + if (c10) { + c10 = jH(mF(), b10); + if (c10 instanceof ye4) + return b10 = c10.i, gH(), gH(), c10 = Q5().cs, hH(c10.Vi, b10); + gH(); + gH(); + c10 = Q5().Na; + return hH(c10.Vi, b10); + } + gH(); + gH(); + c10 = Q5().Na; + return hH(c10.Vi, b10); + } + function rua(a10, b10, c10, e10, f10, g10) { + try { + if (null === e10) + return Hua(a10, b10, c10); + var h10 = e10.gb, k10 = Q5().Hq; + if (h10 === k10) { + var l10 = Hua(a10, b10, c10); + return hH(Iua(e10, l10.Ae.gb), l10.r); + } + if (e10.b()) + var m10 = hH(Iua(e10, Q5().Na), b10); + else { + var p10 = e10.gb; + if (Q5().ti === p10) + var t10 = new qg().e(b10), v10 = iH(t10.ja); + else if (Q5().nd === p10 && a10.K7.Ha(b10)) + v10 = null; + else if (Q5().of === p10) { + var A10 = new qg().e(b10); + v10 = Oj(va(), A10.ja); + } else { + if (Q5().cs === p10) { + var D10 = jH(mF(), b10); + if (D10 instanceof ye4) + var C10 = D10.i; + else { + if (D10 instanceof ve4) + throw Jua(D10.i); + throw new x7().d(D10); + } + } else + C10 = Q5().Na === p10 ? b10 : Q5().cj === p10 ? 0 <= (b10.length | 0) && "0o" === b10.substring(0, 2) ? TD(UD(), b10, 8) : 0 <= (b10.length | 0) && "0x" === b10.substring(0, 2) ? TD(UD(), b10, 16) : Eua(b10) : b10; + v10 = C10; + } + m10 = hH(e10, v10); + } + return m10; + } catch (I10) { + a10 = Ph(E6(), I10); + if (a10 instanceof kH) + return g10.Ar(f10, a10), gH(), gH(), e10 = Q5().Na, hH(e10.Vi, b10); + if (a10 instanceof nb) + return g10.Ar(f10, Cua(e10.gb, b10, a10)), gH(), gH(), e10 = Q5().Na, hH(e10.Vi, b10); + throw I10; + } + } + function Hua(a10, b10, c10) { + if (eG() === c10) + return a10.U6a(b10); + if (Qta() === c10) + return a10 = Q5().Na, hH(a10.Vi, b10.split("''").join("'")); + a10 = Q5().Na; + return hH(a10.Vi, b10); + } + function Gua(a10, b10) { + try { + gH(); + var c10 = TD(UD(), a10.substring(2), b10), e10 = c10.od, f10 = c10.Ud; + gH(); + var g10 = Q5().cj; + return hH(g10.Vi, new qa().Sc(e10, f10)); + } catch (h10) { + if (h10 instanceof dH) + return gH(), gH(), b10 = Q5().Na, hH(b10.Vi, a10); + throw h10; + } + } + fH.prototype.$classData = r8({ T5a: 0 }, false, "org.yaml.parser.ScalarParser$", { T5a: 1, f: 1 }); + var Dua = void 0; + function IG() { + Dua || (Dua = new fH().a()); + return Dua; + } + function Kua() { + this.ph = this.r_ = null; + this.Pma = false; + this.aj = this.X1 = this.Bc = this.BK = null; + } + Kua.prototype = new u7(); + Kua.prototype.constructor = Kua; + function lH(a10) { + null === a10.r_ && null === a10.r_ && (a10.r_ = new oH().yo(a10)); + return a10.r_; + } + function pH(a10, b10) { + a10.aj.ik.ga().hz(); + a10 = a10.aj; + a10.ik = ji(b10, a10.ik); + } + function qH(a10, b10) { + Lua(a10.aj); + pr(a10.aj.ik.ga().Jo, b10); + } + Kua.prototype.$classData = r8({ V5a: 0 }, false, "org.yaml.parser.YamlLoader", { V5a: 1, f: 1 }); + function rH() { + this.l = this.ik = null; + } + rH.prototype = new u7(); + rH.prototype.constructor = rH; + rH.prototype.yo = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + ii(); + a10 = [new sH().Iw(a10, tH(lH(a10)))]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ik = c10; + return this; + }; + function Lua(a10) { + var b10 = a10.ik.ga(); + a10.ik = a10.ik.ta(); + return b10; + } + rH.prototype.$classData = r8({ g6a: 0 }, false, "org.yaml.parser.YamlLoader$Stack", { g6a: 1, f: 1 }); + function sH() { + this.tv = this.Jo = this.uy = this.M0 = null; + this.b1 = this.BT = false; + this.l = this.Ae = this.rr = this.L_ = this.r = null; + } + sH.prototype = new u7(); + sH.prototype.constructor = sH; + function uH() { + } + d7 = uH.prototype = sH.prototype; + d7.wS = function() { + }; + d7.Iw = function(a10, b10) { + this.M0 = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.uy = new Xj().a(); + this.Jo = new Xj().a(); + this.tv = new Tj().a(); + this.b1 = this.BT = false; + this.L_ = y7(); + this.rr = ""; + return this; + }; + d7.eu = function() { + vH(this); + this.hz(); + var a10 = this.Jo; + if (XG(a10)) + return ja(Ja(mG), [0]); + var b10 = a10.w; + b10 = ja(Ja(mG), [b10]); + ZG(a10, b10, 0); + $G(a10, 0); + return b10; + }; + function Mua(a10, b10, c10) { + a10.r = b10; + if (null === a10.Ae) + a10.Ae = c10.Vi; + else { + b10 = a10.Ae.gb; + var e10 = Q5().En; + b10 === e10 && (a10.Ae = Iua(a10.Ae, c10)); + } + } + function Nua(a10) { + Gb(); + a10 = a10.uy; + if (XG(a10)) + a10 = ja(Ja(YG), [0]); + else { + var b10 = a10.w; + b10 = ja(Ja(YG), [b10]); + ZG(a10, b10, 0); + $G(a10, 0); + a10 = b10; + } + return mD(0, a10); + } + function vH(a10) { + var b10 = a10.l.ph.Oj; + if (a10.l.Pma) { + var c10 = b10.kx, e10 = VF().BR; + c10 = c10 !== e10; + } else + c10 = false; + c10 && (c10 = a10.l.ph, pr(a10.uy, zua(b10.kx, ka(WG(c10, c10.Oj)), b10.yc))); + } + d7.Nx = function() { + }; + d7.hz = function() { + if (tc(this.uy)) { + var a10 = this.Jo; + mua || (mua = new DG().a()); + Gb(); + var b10 = this.uy; + if (XG(b10)) + b10 = ja(Ja(YG), [0]); + else { + var c10 = b10.w; + c10 = ja(Ja(YG), [c10]); + ZG(b10, c10, 0); + $G(b10, 0); + b10 = c10; + } + b10 = mD(0, b10); + b10 = new aH().Ac(oua(b10.ga().yc, b10.hA().yc), b10); + pr(a10, b10); + } + }; + d7.ooa = function() { + }; + d7.n2 = function() { + if (this.BT || this.b1) { + var a10 = this.l.ph; + Wj(this.tv, WG(a10, a10.Oj)); + } + }; + d7.$classData = r8({ Gx: 0 }, false, "org.yaml.parser.YamlLoader$YamlBuilder", { Gx: 1, f: 1 }); + function oH() { + this.l = null; + } + oH.prototype = new u7(); + oH.prototype.constructor = oH; + oH.prototype.yo = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function tH(a10) { + return a10.l.ph.Oj.yc; + } + oH.prototype.$classData = r8({ i6a: 0 }, false, "org.yaml.parser.YamlLoader$YamlBuilder$", { i6a: 1, f: 1 }); + function wH() { + } + wH.prototype = new u7(); + wH.prototype.constructor = wH; + wH.prototype.a = function() { + return this; + }; + function Oua(a10, b10, c10, e10) { + Hta(); + a10 = new SF().YG(ata(cta(), b10, c10), vF().dl); + return Pua(a10, e10); + } + wH.prototype.$classData = r8({ k6a: 0 }, false, "org.yaml.parser.YamlParser$", { k6a: 1, f: 1 }); + var Qua = void 0; + function Rua() { + Qua || (Qua = new wH().a()); + return Qua; + } + function xH() { + this.lO = this.FM = null; + this.Vz = 0; + } + xH.prototype = new u7(); + xH.prototype.constructor = xH; + function Sua(a10, b10) { + var c10 = new xH(); + c10.FM = a10; + c10.lO = b10; + c10.Vz = 0; + return c10; + } + function yH(a10) { + a10.Vz = -2 + a10.Vz | 0; + } + xH.prototype.t = function() { + return ka(this.FM); + }; + function Tua(a10) { + if (0 < a10.Vz) { + var b10 = new Aj().d(a10.FM), c10 = new qg().e(" "); + c10 = zga(c10, a10.Vz); + a10.lO.hv(b10.Rp, c10); + } + return a10; + } + function zH(a10, b10) { + var c10 = new Aj().d(a10.FM); + a10.lO.hv(c10.Rp, b10); + return a10; + } + function AH(a10) { + a10.Vz = 2 + a10.Vz | 0; + } + function Uua(a10, b10) { + var c10 = b10.re(); + if (c10 instanceof vw) + if (c10.sb.b()) + zH(a10, "{}"); + else { + zH(a10, "{\n"); + AH(a10); + b10 = c10.sb.jb(); + for (var e10 = 0; e10 < b10; ) { + var f10 = c10.sb.lb(e10); + var g10 = Tua(a10); + g10 = Uua(zH(Uua(g10, f10.Aa), ": "), f10.i); + zH(g10, e10 < (-1 + b10 | 0) ? ",\n" : "\n"); + e10 = 1 + e10 | 0; + } + yH(a10); + zH(Tua(a10), "}"); + } + else if (c10 instanceof Sx) + if (c10.Cm.b()) + zH(a10, "[]"); + else { + zH(a10, "[\n"); + AH(a10); + b10 = c10.Cm.jb(); + for (e10 = 0; e10 < b10; ) + g10 = c10.Cm.lb(e10), zH(Uua(Tua(a10), g10), e10 < (-1 + b10 | 0) ? ",\n" : "\n"), e10 = 1 + e10 | 0; + yH(a10); + zH(Tua(a10), "]"); + } + else if (c10 instanceof xt) + b10 = b10.hb().gb, Q5().cj === b10 || Q5().ti === b10 ? c10 = ka(c10.oq) : Q5().of === b10 ? (c10 = ka(c10.oq), -1 === wta(ua(), c10, 46) ? (b10 = new qg().e(c10), b10 = !mu(b10, gc(101))) : b10 = false, b10 ? (b10 = new qg().e(c10), b10 = !mu(b10, gc(69))) : b10 = false, c10 = b10 ? c10 + ".0" : c10) : Q5().nd === b10 ? c10 = "null" : (b10 = c10.oq, c10 = sp(b10) ? "" + gc(34) + eF(fF(), b10) + gc(34) : "" + gc(34) + c10.va + gc(34)), zH(a10, c10); + else + throw new x7().d(c10); + return a10; + } + xH.prototype.$classData = r8({ m6a: 0 }, false, "org.yaml.render.JsonRender", { m6a: 1, f: 1 }); + function BH() { + } + BH.prototype = new u7(); + BH.prototype.constructor = BH; + BH.prototype.a = function() { + return this; + }; + BH.prototype.$classData = r8({ n6a: 0 }, false, "org.yaml.render.JsonRender$", { n6a: 1, f: 1 }); + var Vua = void 0; + function CH() { + } + CH.prototype = new u7(); + CH.prototype.constructor = CH; + CH.prototype.a = function() { + return this; + }; + function Wua(a10, b10, c10) { + var e10 = cG(); + null !== b10 && b10 === e10 ? e10 = true : (e10 = Qta(), e10 = null !== b10 && b10 === e10); + if (e10) + return b10; + if (0 === (a10.length | 0)) + return c10 || !b10.QL() ? cG() : eG(); + e10 = new qg().e(a10); + e10 = zj(e10); + if (32 === (null === e10 ? 0 : e10.r) || Ed(ua(), a10, "\n\n")) + return cG(); + var f10 = e10 = true, g10 = true, h10 = false, k10 = new DH().e(a10); + do + switch (k10.fc) { + case 10: + e10 = false; + break; + case 9: + g10 = false; + break; + case 13: + return cG(); + default: + PF(); + var l10 = k10.fc; + if (9 === l10 || 10 === l10 || 13 === l10 || 32 <= l10 && 126 >= l10 || 133 === l10 || 160 <= l10 && 55295 >= l10 || 57344 <= l10 && 65533 >= l10 || 65536 <= l10 && 1114111 >= l10) + Xua(k10) ? h10 = true : f10 = false; + else + return cG(); + } + while (Yua(k10)); + if (e10) { + if (h10) + return cG(); + b10.QL() && g10 ? (b10 = new qg().e(a10), b10 = Oc(b10), b10 = 32 !== (null === b10 ? 0 : b10.r)) : b10 = false; + return b10 ? c10 ? (IG(), c10 = new bH(), b10 = Q5().Hq, c10.Id = a10, c10.Bn = b10, c10.R8a(), a10 = c10.Bn, b10 = Q5().Na, a10 === b10 ? a10 = true : (a10 = c10.Bn, c10 = Q5().cs, a10 = a10 === c10), a10 ? eG() : cG()) : eG() : cG(); + } + return f10 ? cG() : Rta(); + } + CH.prototype.$classData = r8({ o6a: 0 }, false, "org.yaml.render.ScalarRender$", { o6a: 1, f: 1 }); + var Zua = void 0; + function DH() { + this.Id = null; + this.iI = this.fc = this.tm = 0; + } + DH.prototype = new u7(); + DH.prototype.constructor = DH; + function $ua(a10) { + return a10.tm === a10.iI ? 0 : 65535 & (a10.Id.charCodeAt(1 + a10.tm | 0) | 0); + } + function ava(a10) { + return 0 === a10.tm ? 0 : 65535 & (a10.Id.charCodeAt(-1 + a10.tm | 0) | 0); + } + DH.prototype.e = function(a10) { + this.Id = a10; + this.tm = 0; + var b10 = new qg().e(a10); + b10 = zj(b10); + this.fc = null === b10 ? 0 : b10.r; + this.iI = -1 + (a10.length | 0) | 0; + return this; + }; + function Xua(a10) { + if (0 === a10.tm) + switch (a10.fc) { + case 63: + case 58: + case 45: + var b10 = $ua(a10); + return bva(Ku(), b10) ? true : 92 === $ua(a10); + default: + return vta(PF(), a10.fc); + } + else + switch (a10.fc) { + case 35: + return b10 = ava(a10), bva(Ku(), b10) ? true : 92 === ava(a10); + case 58: + return a10.tm === a10.iI ? b10 = true : (b10 = $ua(a10), b10 = bva(Ku(), b10)), b10 ? true : 92 === $ua(a10); + default: + return false; + } + } + function Yua(a10) { + if (a10.tm === a10.iI) + return false; + a10.tm = 1 + a10.tm | 0; + a10.fc = 65535 & (a10.Id.charCodeAt(a10.tm) | 0); + return true; + } + DH.prototype.$classData = r8({ p6a: 0 }, false, "org.yaml.render.ScalarRender$ScalarIterator", { p6a: 1, f: 1 }); + function cva() { + this.FM = null; + this.D0 = false; + this.ag = this.lO = null; + this.Vz = 0; + this.w0 = this.V0 = false; + } + cva.prototype = new u7(); + cva.prototype.constructor = cva; + function EH(a10, b10) { + Vj(a10.ag, b10); + return a10; + } + function dva(a10) { + if (tc(a10.ag)) { + var b10 = new Aj().d(a10.FM); + a10.lO.hv(b10.Rp, a10.ag.Ef.qf); + FH(a10.ag.Ef, 0); + } + } + function GH(a10, b10, c10) { + eva(a10, b10); + if (b10 instanceof kG) + fva(a10, b10.xE, b10.eI); + else if (b10 instanceof aH) + b10.eI.U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + EH(e10, f10.Id); + }; + }(a10))); + else if (b10 instanceof RA) + gva(a10, b10.Xf); + else if (b10 instanceof HH) + hva(a10, b10); + else if (b10 instanceof Sx) + iva(a10, b10); + else if (b10 instanceof vw) + jva(a10, b10); + else if (b10 instanceof Es) + kva(a10, b10.Xf, y7()); + else if (b10 instanceof xt) + lva(a10, b10, c10.Ha(Q5().Na)); + else if (b10 instanceof OG) + mva(a10, b10); + else if (b10 instanceof IH) + nva(a10, b10); + else if (b10 instanceof Cs) + ova(a10, b10); + else + throw new x7().d(b10); + return a10; + } + function pva(a10, b10) { + var c10 = tc(b10); + c10 && b10.U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + EH(e10, f10.Id); + }; + }(a10))); + return c10; + } + function qva(a10, b10) { + var c10 = b10.Aa, e10 = c10.re(); + if (e10 instanceof xt) { + mva(a10, c10.hb()); + var f10 = c10.sS; + f10.b() || (f10 = f10.c(), GH(a10, f10, y7())); + if (-1 !== (e10.va.indexOf("\n") | 0)) + f10 = gc(34), fF(), EH(a10, "" + f10 + eF(0, e10.va) + gc(34)); + else { + f10 = c10.hb().gb; + var g10 = Q5().Na; + f10 = f10 === g10 ? rva(c10.hb()) : false; + lva(a10, e10, f10); + } + EH(a10, ": "); + } else + e10 = EH(a10, "?"), f10 = y7(), EH(sva(JH(GH(e10, c10, f10))), ": "); + e10 = b10.i; + b10 = b10.Xf.gl(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10 !== k10; + }; + }(a10, c10))).ta().gl(w6(/* @__PURE__ */ function() { + return function(h10) { + return h10 instanceof aH ? (h10 = h10.eI.kc(), h10.b() ? false : ":" === h10.c().Id) : false; + }; + }(a10))).Pm(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10 !== k10; + }; + }(a10, e10))); + if (null === b10) + throw new x7().d(b10); + c10 = b10.ma(); + b10 = b10.ya().ta(); + AH(a10); + c10.U(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return sva(GH(h10, k10, y7())); + }; + }(a10))); + yH(a10); + c10 = e10.hb().gb; + f10 = Q5().nd; + c10 !== f10 ? c10 = true : (c10 = e10.t(), c10 = new qg().e(c10), c10 = tc(c10)); + c10 && GH(a10, e10, y7()); + tc(b10) && (GH(a10, b10.ga(), y7()), AH(a10), b10.ta().U(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = sva(h10), m10 = y7(); + return GH(l10, k10, m10); + }; + }(a10))), yH(a10)); + } + function mva(a10, b10) { + pva(a10, b10.eI) || rva(b10) || EH(a10, b10.va + " "); + } + function kva(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return GH(e10, g10, f10); + }; + }(a10, c10))); + } + function iva(a10, b10) { + tva(a10, b10) || (b10.Cm.b() ? EH(a10, "[]") : (AH(a10), b10.Xf.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (e10 instanceof Cs) { + var f10 = EH(sva(JH(c10)), "- "), g10 = y7(); + return GH(f10, e10, g10); + } + if (e10 instanceof kG) + return GH(c10, e10, y7()); + }; + }(a10))), yH(a10))); + } + function gva(a10, b10) { + kva(a10, b10, y7()); + JH(a10); + a10.w0 = true; + } + function hva(a10, b10) { + tva(a10, b10) || JH(EH(a10, b10.t())); + a10.V0 = true; + } + function tva(a10, b10) { + b10 = b10.Xf; + var c10 = tc(b10) && b10.ga() instanceof aH; + c10 && kva(a10, b10, y7()); + return c10; + } + function eva(a10, b10) { + if (a10.w0 && (a10.w0 = false, EH(a10, "...\n"), b10 instanceof RA)) { + b10 = b10.aQ; + var c10 = Q5().nd; + b10 === c10 && EH(a10, "---\n"); + } + } + function uva(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return GH(c10, e10, y7()); + }; + }(a10))); + dva(a10); + } + function ova(a10, b10) { + if (a10.D0 && b10 instanceof KH || !tva(a10, b10)) + if (a10.V0 && (EH(a10, "---\n"), a10.V0 = false), b10 instanceof LH) + a10.D0 ? GH(a10, b10.Gv, y7()) : EH(a10, b10.t()), void 0; + else if (b10 instanceof uG && a10.D0 && b10.Gv.na()) + GH(a10, b10.Gv.c(), y7()); + else { + var c10 = b10.Xf; + b10 = b10.hb(); + var e10 = Q5().Na.Vi; + kva(a10, c10, b10 === e10 ? new z7().d(Q5().Na) : y7()); + } + } + function nva(a10, b10) { + pva(a10, b10.eI) || EH(a10, vva(MH(), b10, " ")); + } + function JH(a10) { + if (!XG(a10.ag)) { + var b10 = -1 + a10.ag.Ef.Oa() | 0; + if (0 <= b10) { + var c10 = a10.ag.Ef.Hz(b10); + c10 = wva(Ku(), c10); + } else + c10 = false; + c10 && FH(a10.ag.Ef, b10); + jF(a10.ag.Ef, 10); + dva(a10); + } + return a10; + } + function sva(a10) { + var b10 = a10.Vz, c10 = -1 + b10 | 0; + if (!(0 >= b10)) + for (b10 = 0; ; ) { + jF(a10.ag.Ef, 32); + if (b10 === c10) + break; + b10 = 1 + b10 | 0; + } + return a10; + } + function lva(a10, b10, c10) { + if (!tva(a10, b10)) { + Zua || (Zua = new CH().a()); + var e10 = b10.va, f10 = b10.oH, g10 = a10.Vz; + b10 = Jc(b10.Xf, new xva()); + b10 = b10.b() ? "" : b10.c(); + c10 = Wua(e10, f10, c10); + if (eG() !== c10) + if (cG() === c10) + e10 = "" + gc(34) + eF(fF(), e10) + gc(34); + else if (Qta() === c10) + e10 = "'" + e10.split("\n").join("\n\n") + "'"; + else if (Rta() === c10) { + c10 = new Tj().a(); + g10 = 0 > g10 ? 2 : 2 + g10 | 0; + hF(c10, 124); + f10 = e10.length | 0; + var h10 = new qg().e(e10); + h10 = zj(h10); + 32 === (null === h10 ? 0 : h10.r) && gF(c10, "" + g10); + 10 !== (65535 & (e10.charCodeAt(-1 + f10 | 0) | 0)) ? hF(c10, 45) : 1 < f10 && 10 === (65535 & (e10.charCodeAt(-2 + f10 | 0) | 0)) && hF(c10, 43); + gF(c10, b10); + f10 = 0; + do { + ua(); + b10 = e10; + h10 = f10; + var k10 = yva(10); + b10 = b10.indexOf(k10, h10) | 0; + f10 = -1 === b10 ? e10.substring(f10) : e10.substring(f10, b10); + hF(c10, 10); + h10 = new qg().e(f10); + if (tc(h10)) { + h10 = -1 + g10 | 0; + if (!(0 >= g10)) + for (k10 = 0; ; ) { + hF(c10, 32); + if (k10 === h10) + break; + k10 = 1 + k10 | 0; + } + gF(c10, f10); + } + f10 = 1 + b10 | 0; + } while (-1 !== b10); + e10 = c10; + } else + throw new x7().d(c10); + EH(a10, ka(e10)); + } + } + function jva(a10, b10) { + tva(a10, b10) || (b10.sb.b() ? EH(a10, "{}") : (AH(a10), b10.sb.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + qva(sva(JH(c10)), e10); + }; + }(a10))), yH(a10))); + } + function fva(a10, b10, c10) { + pva(a10, c10) || (tc(a10.ag) ? (c10 = Oc(a10.ag), c10 = null === c10 ? 0 : c10.r, c10 = !wva(Ku(), c10)) : c10 = false, c10 && EH(a10, " "), JH(EH(a10, "#" + b10))); + } + cva.prototype.$classData = r8({ q6a: 0 }, false, "org.yaml.render.YamlRender", { q6a: 1, f: 1 }); + function NH() { + } + NH.prototype = new u7(); + NH.prototype.constructor = NH; + NH.prototype.a = function() { + return this; + }; + function Nca(a10, b10) { + a10 = new Wq().a(); + var c10 = cfa(), e10 = K7(); + zva(a10, J5(e10, new Ib().ha([b10])), c10); + return a10.t(); + } + function zva(a10, b10, c10) { + var e10 = new cva(); + e10.FM = a10; + e10.D0 = false; + e10.lO = c10; + e10.ag = new Tj().a(); + e10.Vz = -2; + e10.V0 = false; + e10.w0 = false; + uva(e10, b10); + } + NH.prototype.$classData = r8({ r6a: 0 }, false, "org.yaml.render.YamlRender$", { r6a: 1, f: 1 }); + var Ava = void 0; + function Oca() { + Ava || (Ava = new NH().a()); + return Ava; + } + function OH() { + } + OH.prototype = new u7(); + OH.prototype.constructor = OH; + d7 = OH.prototype; + d7.a = function() { + return this; + }; + d7.XD = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new SH().a(), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.yC = function(a10) { + return this.QE(a10); + }; + d7.zC = function(a10) { + return this.mF(a10); + }; + d7.QE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + PH(); + var l10 = Mp(new TH().a(), k10, Pp().ux); + PH().$e(); + return l10.Be(); + }; + }(f10, g10)), ml()); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.vC = function(a10) { + return this.JE(a10); + }; + d7.rC = function(a10, b10) { + return this.WD(a10, b10); + }; + d7.IE = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new VH().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.wC = function(a10, b10) { + return this.IE(a10, b10); + }; + d7.WD = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new SH().a(), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.sC = function(a10) { + return this.XD(a10); + }; + d7.mF = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(); + No(); + var h10 = mj().Vp, k10 = ik().Vp, l10 = lp(pp()); + h10 = gq(iq(), f10, h10, k10, l10, false); + k10 = PH().no(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().no(); + return ll(b10, a10, c10).Ra(); + }; + d7.JE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new VH().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new VH().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + OH.prototype.resolve = function(a10) { + return this.yC(a10); + }; + OH.prototype.validate = function(a10) { + return this.zC(a10); + }; + OH.prototype.generateString = function(a10) { + return this.sC(a10); + }; + OH.prototype.generateFile = function(a10, b10) { + return this.rC(a10, b10); + }; + OH.prototype.parse = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return this.vC(a10); + case 1: + return this.wC(a10, e10[0]); + default: + throw "No matching overload"; + } + }; + OH.prototype.$classData = r8({ t6a: 0 }, false, "webapi.AmfGraph$", { t6a: 1, f: 1 }); + var Bva = void 0; + function XH() { + } + XH.prototype = new u7(); + XH.prototype.constructor = XH; + d7 = XH.prototype; + d7.XD = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new YH().a(), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.a = function() { + return this; + }; + d7.S3 = function(a10) { + return this.zca(a10); + }; + d7.T3 = function(a10, b10) { + return this.yca(a10, b10); + }; + d7.E$ = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new zp().Hc(Bu().$, "application/yaml"), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.yca = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new ZH().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.yC = function(a10) { + return this.QE(a10); + }; + d7.zC = function(a10) { + return this.mF(a10); + }; + d7.vC = function(a10) { + return this.JE(a10); + }; + d7.QE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + PH(); + var l10 = Mp(new $H().a(), k10, Pp().ux); + PH().$e(); + return l10.Be(); + }; + }(f10, g10)), ml()); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.P3 = function(a10, b10) { + return this.E$(a10, b10); + }; + d7.rC = function(a10, b10) { + return this.WD(a10, b10); + }; + d7.Q3 = function(a10) { + return this.F$(a10); + }; + d7.IE = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new aI().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.wC = function(a10, b10) { + return this.IE(a10, b10); + }; + d7.WD = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new YH().a(), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.sC = function(a10) { + return this.XD(a10); + }; + d7.F$ = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new zp().Hc(Bu().$, "application/yaml"), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.zca = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new ZH().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new ZH().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.mF = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(); + No(); + var h10 = mj().QF, k10 = ik().ew, l10 = lp(pp()); + h10 = gq(iq(), f10, h10, k10, l10, false); + k10 = PH().no(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().no(); + return ll(b10, a10, c10).Ra(); + }; + d7.JE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new aI().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new aI().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + XH.prototype.generateYamlFile = function(a10, b10) { + return this.P3(a10, b10); + }; + XH.prototype.generateYamlString = function(a10) { + return this.Q3(a10); + }; + XH.prototype.parseYaml = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return this.S3(a10); + case 1: + return this.T3(a10, e10[0]); + default: + throw "No matching overload"; + } + }; + XH.prototype.resolve = function(a10) { + return this.yC(a10); + }; + XH.prototype.validate = function(a10) { + return this.zC(a10); + }; + XH.prototype.generateString = function(a10) { + return this.sC(a10); + }; + XH.prototype.generateFile = function(a10, b10) { + return this.rC(a10, b10); + }; + XH.prototype.parse = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return this.wC(a10, e10[0]); + case 0: + return this.vC(a10); + default: + throw "No matching overload"; + } + }; + XH.prototype.$classData = r8({ u6a: 0 }, false, "webapi.Oas20$", { u6a: 1, f: 1 }); + var Cva = void 0; + function bI() { + } + bI.prototype = new u7(); + bI.prototype.constructor = bI; + d7 = bI.prototype; + d7.XD = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new cI().a(), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.a = function() { + return this; + }; + d7.S3 = function(a10) { + return this.zca(a10); + }; + d7.T3 = function(a10, b10) { + return this.yca(a10, b10); + }; + d7.E$ = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new zp().Hc(Cu().$, "application/yaml"), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.yca = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new dI().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.yC = function(a10) { + return this.QE(a10); + }; + d7.zC = function(a10) { + return this.mF(a10); + }; + d7.vC = function(a10) { + return this.JE(a10); + }; + d7.QE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + PH(); + var l10 = Mp(new eI().a(), k10, Pp().ux); + PH().$e(); + return l10.Be(); + }; + }(f10, g10)), ml()); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.P3 = function(a10, b10) { + return this.E$(a10, b10); + }; + d7.rC = function(a10, b10) { + return this.WD(a10, b10); + }; + d7.Q3 = function(a10) { + return this.F$(a10); + }; + d7.IE = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new fI().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.wC = function(a10, b10) { + return this.IE(a10, b10); + }; + d7.WD = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new cI().a(), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.sC = function(a10) { + return this.XD(a10); + }; + d7.F$ = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new zp().Hc(Cu().$, "application/yaml"), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.zca = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new dI().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new dI().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.mF = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(); + No(); + var h10 = mj().Cp, k10 = ik().ew, l10 = lp(pp()); + h10 = gq(iq(), f10, h10, k10, l10, false); + k10 = PH().no(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().no(); + return ll(b10, a10, c10).Ra(); + }; + d7.JE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new fI().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new fI().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + bI.prototype.generateYamlFile = function(a10, b10) { + return this.P3(a10, b10); + }; + bI.prototype.generateYamlString = function(a10) { + return this.Q3(a10); + }; + bI.prototype.parseYaml = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return this.T3(a10, e10[0]); + case 0: + return this.S3(a10); + default: + throw "No matching overload"; + } + }; + bI.prototype.resolve = function(a10) { + return this.yC(a10); + }; + bI.prototype.validate = function(a10) { + return this.zC(a10); + }; + bI.prototype.generateString = function(a10) { + return this.sC(a10); + }; + bI.prototype.generateFile = function(a10, b10) { + return this.rC(a10, b10); + }; + bI.prototype.parse = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return this.vC(a10); + case 1: + return this.wC(a10, e10[0]); + default: + throw "No matching overload"; + } + }; + bI.prototype.$classData = r8({ v6a: 0 }, false, "webapi.Oas30$", { v6a: 1, f: 1 }); + var Dva = void 0; + function gI() { + } + gI.prototype = new u7(); + gI.prototype.constructor = gI; + d7 = gI.prototype; + d7.a = function() { + return this; + }; + d7.XD = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new hI().a(), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.yC = function(a10) { + return this.QE(a10); + }; + d7.zC = function(a10) { + return this.mF(a10); + }; + d7.QE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + PH(); + var l10 = Mp(new iI().a(), k10, Pp().ux); + PH().$e(); + return l10.Be(); + }; + }(f10, g10)), ml()); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.vC = function(a10) { + return this.JE(a10); + }; + d7.rC = function(a10, b10) { + return this.WD(a10, b10); + }; + d7.IE = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new jI().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.wC = function(a10, b10) { + return this.IE(a10, b10); + }; + d7.WD = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new hI().a(), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.sC = function(a10) { + return this.XD(a10); + }; + d7.mF = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(); + No(); + var h10 = mj().TF, k10 = ik().ct, l10 = lp(pp()); + h10 = gq(iq(), f10, h10, k10, l10, false); + k10 = PH().no(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().no(); + return ll(b10, a10, c10).Ra(); + }; + d7.JE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new jI().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new jI().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + gI.prototype.resolve = function(a10) { + return this.yC(a10); + }; + gI.prototype.validate = function(a10) { + return this.zC(a10); + }; + gI.prototype.generateString = function(a10) { + return this.sC(a10); + }; + gI.prototype.generateFile = function(a10, b10) { + return this.rC(a10, b10); + }; + gI.prototype.parse = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return this.vC(a10); + case 1: + return this.wC(a10, e10[0]); + default: + throw "No matching overload"; + } + }; + gI.prototype.$classData = r8({ w6a: 0 }, false, "webapi.Raml08$", { w6a: 1, f: 1 }); + var Eva = void 0; + function kI() { + } + kI.prototype = new u7(); + kI.prototype.constructor = kI; + d7 = kI.prototype; + d7.a = function() { + return this; + }; + d7.XD = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(), h10 = Fp(new lI().a(), f10, new xp().a()), k10 = PH().Lf(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().Lf(); + return ll(b10, a10, c10).Ra(); + }; + d7.yC = function(a10) { + return this.QE(a10); + }; + d7.zC = function(a10) { + return this.mF(a10); + }; + d7.QE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + PH(); + var l10 = Mp(new mI().a(), k10, Pp().ux); + PH().$e(); + return l10.Be(); + }; + }(f10, g10)), ml()); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + d7.vC = function(a10) { + return this.JE(a10); + }; + d7.rC = function(a10, b10) { + return this.WD(a10, b10); + }; + d7.IE = function(a10, b10) { + var c10 = PH(), e10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + var k10 = PH(), l10 = jp(new nI().a(), h10, g10), m10 = PH().$e(); + return il(jl(k10, l10, m10)); + }; + }(this, a10, b10))); + b10 = PH().$e(); + return UH(c10, ll(e10, a10, b10).Ra()); + }; + d7.wC = function(a10, b10) { + return this.IE(a10, b10); + }; + d7.WD = function(a10, b10) { + var c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + var h10 = PH(), k10 = Gp(new lI().a(), f10, g10, new xp().a()), l10 = PH().Yo(); + return il(jl(h10, k10, l10)); + }; + }(this, a10, b10))); + b10 = PH().Yo(); + return ll(c10, a10, b10).Ra(); + }; + d7.sC = function(a10) { + return this.XD(a10); + }; + d7.mF = function(a10) { + var b10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + var g10 = PH(); + No(); + var h10 = mj().UF, k10 = ik().ct, l10 = lp(pp()); + h10 = gq(iq(), f10, h10, k10, l10, false); + k10 = PH().no(); + return il(jl(g10, h10, k10)); + }; + }(this, a10))); + var c10 = PH().no(); + return ll(b10, a10, c10).Ra(); + }; + d7.JE = function(a10) { + var b10 = PH(), c10 = PH(); + a10 = QH(RH(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + if (WH(RH(), g10)) { + var h10 = PH(), k10 = rp(new nI().a(), g10), l10 = PH().$e(); + return il(jl(h10, k10, l10)); + } + h10 = PH(); + k10 = qp(new nI().a(), g10); + l10 = PH().$e(); + return il(jl(h10, k10, l10)); + }; + }(this, a10))); + var e10 = PH().$e(); + return UH(b10, ll(c10, a10, e10).Ra()); + }; + kI.prototype.resolve = function(a10) { + return this.yC(a10); + }; + kI.prototype.validate = function(a10) { + return this.zC(a10); + }; + kI.prototype.generateString = function(a10) { + return this.sC(a10); + }; + kI.prototype.generateFile = function(a10, b10) { + return this.rC(a10, b10); + }; + kI.prototype.parse = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return this.wC(a10, e10[0]); + case 0: + return this.vC(a10); + default: + throw "No matching overload"; + } + }; + kI.prototype.$classData = r8({ x6a: 0 }, false, "webapi.Raml10$", { x6a: 1, f: 1 }); + var Fva = void 0; + function oI() { + this.Oaa = false; + } + oI.prototype = new u7(); + oI.prototype.constructor = oI; + oI.prototype.a = function() { + this.Oaa = false; + return this; + }; + function QH(a10, b10) { + var c10 = PH(), e10 = a10.HU(), f10 = PH().Yo(); + return il(jl(c10, e10, f10)).Pq(w6(/* @__PURE__ */ function(g10, h10) { + return function() { + return Hb(h10).Yg(w6(/* @__PURE__ */ function() { + return function(k10) { + return k10; + }; + }(g10)), ml()); + }; + }(a10, b10)), ml()); + } + function WH(a10, b10) { + return 0 <= (b10.length | 0) && "http://" === b10.substring(0, 7) || 0 <= (b10.length | 0) && "https://" === b10.substring(0, 8) || 0 <= (b10.length | 0) && "file:" === b10.substring(0, 5); + } + oI.prototype.HU = function() { + if (this.Oaa) { + var a10 = nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + }; + }(this)), ml()), b10 = PH(), c10 = PH().Yo(); + return ll(b10, a10, c10).Ra(); + } + this.Oaa = true; + Gva || (Gva = new pI().a()); + Hva(Gva); + No(); + a10 = qI(); + Oo(Po(), a10); + No(); + a10 = Iva(); + Oo(Po(), a10); + return No().HU(); + }; + oI.prototype.$classData = r8({ J6a: 0 }, false, "webapi.WebApiParser$", { J6a: 1, f: 1 }); + var Jva = void 0; + function RH() { + Jva || (Jva = new oI().a()); + return Jva; + } + function Ia() { + this.jg = null; + } + Ia.prototype = new u7(); + Ia.prototype.constructor = Ia; + function Fj(a10) { + return a10.jg.name; + } + function Ou(a10) { + return a10.jg.getComponentType(); + } + Ia.prototype.t = function() { + return (this.jg.isInterface ? "interface " : this.jg.isPrimitive ? "" : "class ") + Fj(this); + }; + function Gga(a10, b10) { + return !!a10.jg.isInstance(b10); + } + function xB(a10) { + a10 = a10.jg.name; + for (var b10 = -1 + (a10.length | 0) | 0; ; ) + if (0 <= b10 && 36 === (65535 & (a10.charCodeAt(b10) | 0))) + b10 = -1 + b10 | 0; + else + break; + for (; ; ) { + if (0 <= b10) { + var c10 = 65535 & (a10.charCodeAt(b10) | 0); + c10 = 46 !== c10 && 36 !== c10; + } else + c10 = false; + if (c10) + b10 = -1 + b10 | 0; + else + break; + } + return a10.substring(1 + b10 | 0); + } + Ia.prototype.$classData = r8({ G7a: 0 }, false, "java.lang.Class", { G7a: 1, f: 1 }); + function Kva() { + this.uja = 0; + this.soa = Ea().dl; + this.Rna = Ea().dl; + } + Kva.prototype = new u7(); + Kva.prototype.constructor = Kva; + Kva.prototype.$classData = r8({ Q7a: 0 }, false, "java.lang.Long$StringRadixInfo", { Q7a: 1, f: 1 }); + function rI() { + this.hn = this.mv = null; + } + rI.prototype = new u7(); + rI.prototype.constructor = rI; + rI.prototype.a = function() { + Lva = this; + new sI().eq(false); + this.mv = new sI().eq(true); + this.hn = null; + return this; + }; + rI.prototype.$classData = r8({ $7a: 0 }, false, "java.lang.System$", { $7a: 1, f: 1 }); + var Lva = void 0; + function fr() { + Lva || (Lva = new rI().a()); + return Lva; + } + function tI() { + this.gia = null; + } + tI.prototype = new u7(); + tI.prototype.constructor = tI; + tI.prototype.a = function() { + Mva = this; + var a10 = new uI(); + a10.$ = "main"; + this.gia = a10; + return this; + }; + tI.prototype.$classData = r8({ b8a: 0 }, false, "java.lang.Thread$", { b8a: 1, f: 1 }); + var Mva = void 0; + function vI() { + this.W0 = false; + this.lx = null; + } + vI.prototype = new u7(); + vI.prototype.constructor = vI; + vI.prototype.a = function() { + this.W0 = false; + return this; + }; + vI.prototype.c = function() { + this.W0 || wI(this, null); + return this.lx; + }; + function wI(a10, b10) { + a10.lx = b10; + a10.W0 = true; + } + vI.prototype.$classData = r8({ c8a: 0 }, false, "java.lang.ThreadLocal", { c8a: 1, f: 1 }); + function xI() { + } + xI.prototype = new u7(); + xI.prototype.constructor = xI; + xI.prototype.a = function() { + return this; + }; + function Mu(a10, b10, c10) { + return b10.jg.newArrayOfThisClass([c10]); + } + xI.prototype.$classData = r8({ d8a: 0 }, false, "java.lang.reflect.Array$", { d8a: 1, f: 1 }); + var Nva = void 0; + function Nu() { + Nva || (Nva = new xI().a()); + return Nva; + } + function yI() { + } + yI.prototype = new u7(); + yI.prototype.constructor = yI; + yI.prototype.a = function() { + return this; + }; + function Ova(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Pva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Qva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Rva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Sva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Tva(a10, b10, c10) { + a10 = 0; + var e10 = b10.n.length; + for (; ; ) { + if (a10 === e10) + return -1 - a10 | 0; + var f10 = (a10 + e10 | 0) >>> 1 | 0, g10 = b10.n[f10]; + if (c10 < g10) + e10 = f10; + else { + if (Va(Wa(), c10, g10)) + return f10; + a10 = 1 + f10 | 0; + } + } + } + function Uva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Vva(a10, b10, c10, e10) { + c10 = c10 - b10 | 0; + if (2 <= c10) { + if (0 < e10.ap(a10.n[b10], a10.n[1 + b10 | 0])) { + var f10 = a10.n[b10]; + a10.n[b10] = a10.n[1 + b10 | 0]; + a10.n[1 + b10 | 0] = f10; + } + for (f10 = 2; f10 < c10; ) { + var g10 = a10.n[b10 + f10 | 0]; + if (0 > e10.ap(g10, a10.n[-1 + (b10 + f10 | 0) | 0])) { + for (var h10 = b10, k10 = -1 + (b10 + f10 | 0) | 0; 1 < (k10 - h10 | 0); ) { + var l10 = (h10 + k10 | 0) >>> 1 | 0; + 0 > e10.ap(g10, a10.n[l10]) ? k10 = l10 : h10 = l10; + } + h10 = h10 + (0 > e10.ap(g10, a10.n[h10]) ? 0 : 1) | 0; + for (k10 = b10 + f10 | 0; k10 > h10; ) + a10.n[k10] = a10.n[-1 + k10 | 0], k10 = -1 + k10 | 0; + a10.n[h10] = g10; + } + f10 = 1 + f10 | 0; + } + } + } + function Wva(a10, b10) { + a10 = b10.n.length; + for (var c10 = 0; c10 !== a10; ) + b10.n[c10] = 0, c10 = 1 + c10 | 0; + } + function Xva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), gc(b10.n[e10]), gc(c10.n[e10]))) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Yva(a10, b10, c10) { + if (b10 === c10) + return true; + if (null === b10 || null === c10) + return false; + a10 = b10.n.length; + if (c10.n.length !== a10) + return false; + for (var e10 = 0; e10 !== a10; ) { + if (!Va(Wa(), b10.n[e10], c10.n[e10])) + return false; + e10 = 1 + e10 | 0; + } + return true; + } + function Zva(a10, b10, c10) { + var e10 = new zI(); + e10.Aja = c10; + c10 = b10.n.length; + 16 < c10 ? $va(a10, b10, ja(Ja(Ha), [b10.n.length]), 0, c10, e10) : Vva(b10, 0, c10, e10); + } + function $va(a10, b10, c10, e10, f10, g10) { + var h10 = f10 - e10 | 0; + if (16 < h10) { + var k10 = e10 + (h10 / 2 | 0) | 0; + $va(a10, b10, c10, e10, k10, g10); + $va(a10, b10, c10, k10, f10, g10); + for (var l10 = a10 = e10, m10 = k10; a10 < f10; ) + l10 < k10 && (m10 >= f10 || g10.wE(b10.n[l10], b10.n[m10])) ? (c10.n[a10] = b10.n[l10], l10 = 1 + l10 | 0) : (c10.n[a10] = b10.n[m10], m10 = 1 + m10 | 0), a10 = 1 + a10 | 0; + Ba(c10, e10, b10, e10, h10); + } else + Vva(b10, e10, f10, g10); + } + yI.prototype.$classData = r8({ e8a: 0 }, false, "java.util.Arrays$", { e8a: 1, f: 1 }); + var awa = void 0; + function AI() { + awa || (awa = new yI().a()); + return awa; + } + function BI() { + this.Fma = null; + } + BI.prototype = new u7(); + BI.prototype.constructor = BI; + BI.prototype.a = function() { + bwa = this; + this.Fma = new ba.RegExp("(?:(\\d+)\\$)?([-#+ 0,\\(<]*)(\\d+)?(?:\\.(\\d+))?[%A-Za-z]", "g"); + return this; + }; + BI.prototype.$classData = r8({ l8a: 0 }, false, "java.util.Formatter$", { l8a: 1, f: 1 }); + var bwa = void 0; + function cwa() { + this.Ui = null; + } + cwa.prototype = new u7(); + cwa.prototype.constructor = cwa; + function CI(a10, b10, c10, e10, f10) { + e10 = dwa(a10, c10, e10, f10); + if (null === e10) + throw new x7().d(e10); + a10 = e10.Uo; + c10 = e10.Ag | 0; + e10 = e10.Ih | 0; + f10 = K7(); + return new Hd().Dr(ewa(a10.Vr(b10, f10.u)), c10, e10); + } + function fwa(a10, b10) { + a10 = dwa(a10, 0, 1, b10).Uo; + if (H10().h(a10)) + return gwa(""); + K7(); + b10 = new z7().d(a10); + return null !== b10.i && 0 === b10.i.Oe(1) ? b10.i.lb(0) : hwa(DI(), a10); + } + function ewa(a10) { + a: + for (; ; ) { + var b10 = a10, c10 = iwa(ue4().dR, b10); + if (!c10.b()) { + var e10 = c10.c().ma(); + c10 = c10.c().ya(); + e10 = jwa().kF(e10); + if (!e10.b() && (e10 = e10.c(), c10 = iwa(ue4().dR, c10), !c10.b())) { + var f10 = c10.c().ma(); + c10 = c10.c().ya(); + f10 = jwa().kF(f10); + if (!f10.b() && (f10 = f10.c(), !kwa(lwa(), e10) && "|" !== e10 && !kwa(lwa(), f10) && "|" !== f10)) { + a10 = gwa("" + e10 + f10); + b10 = K7(); + a10 = c10.Vr(a10, b10.u); + continue a; + } + } + } + b10 = iwa(ue4().dR, b10); + if (!b10.b() && (e10 = b10.c().ma(), b10 = b10.c().ya(), b10 = iwa(ue4().dR, b10), !b10.b() && (c10 = b10.c().ma(), b10 = b10.c().ya(), f10 = DI().kF(c10), !f10.b() && (c10 = f10.c().ma(), f10 = f10.c().ya(), c10 instanceof EI && (c10 = mwa(nwa(), c10), !c10.b() && (c10 = c10.c(), f10 instanceof FI && "" === f10.LH)))))) { + a10 = DI().kF(e10); + if (!a10.b() && (f10 = a10.c().ma(), a10 = a10.c().ya(), f10 instanceof EI)) { + e10 = f10; + e10 = new EI().Hc(e10.LB, "" + e10.$B + c10); + a10 = GI(e10, a10); + e10 = K7(); + a10 = b10.Vr(a10, e10.u); + continue a; + } + a10 = DI().kF(e10); + if (!a10.b() && a10.c().ma() instanceof HI) { + a10 = new EI().Hc("", c10); + c10 = K7(); + e10 = new II().ts(J5(c10, new Ib().ha([e10]))); + a10 = GI(a10, e10); + e10 = K7(); + a10 = b10.Vr(a10, e10.u); + continue a; + } + throw new x7().d(e10); + } + return a10; + } + } + function dwa(a10, b10, c10, e10) { + if (b10 >= (e10.length | 0)) + return new Hd().Dr(J5(K7(), H10()), b10, c10); + switch (65535 & (e10.charCodeAt(b10) | 0)) { + case 40: + if ((e10.length | 0) >= (3 + b10 | 0) && 63 === (65535 & (e10.charCodeAt(1 + b10 | 0) | 0)) && (61 === (65535 & (e10.charCodeAt(2 + b10 | 0) | 0)) || 33 === (65535 & (e10.charCodeAt(2 + b10 | 0) | 0)))) { + var f10 = dwa(a10, 3 + b10 | 0, c10, e10); + if (null === f10) + throw new x7().d(f10); + var g10 = f10.Uo; + c10 = f10.Ih | 0; + f10 = 1 + (f10.Ag | 0) | 0; + b10 = 65535 & (e10.charCodeAt(2 + b10 | 0) | 0); + b10 = new EI().Hc("(?" + gc(b10), ")"); + g10 = owa(pwa(), g10); + return CI(a10, GI(b10, g10), f10, c10, e10); + } + if ((e10.length | 0) < (3 + b10 | 0) || 63 !== (65535 & (e10.charCodeAt(1 + b10 | 0) | 0)) || 58 !== (65535 & (e10.charCodeAt(2 + b10 | 0) | 0))) { + f10 = dwa(a10, 1 + b10 | 0, 1 + c10 | 0, e10); + if (null === f10) + throw new x7().d(f10); + g10 = f10.Uo; + b10 = f10.Ih | 0; + f10 = 1 + (f10.Ag | 0) | 0; + c10 = new HI().ue(c10); + g10 = owa(pwa(), g10); + return CI(a10, qwa(GI(c10, g10)), f10, b10, e10); + } + if ((e10.length | 0) >= (3 + b10 | 0) && 63 === (65535 & (e10.charCodeAt(1 + b10 | 0) | 0)) && 58 === (65535 & (e10.charCodeAt(2 + b10 | 0) | 0))) { + g10 = dwa(a10, 3 + b10 | 0, c10, e10); + if (null === g10) + throw new x7().d(g10); + c10 = g10.Uo; + b10 = g10.Ih | 0; + g10 = 1 + (g10.Ag | 0) | 0; + return CI(a10, qwa(hwa(DI(), c10)), g10, b10, e10); + } + return rwa(a10, e10, b10, c10); + case 41: + return new Hd().Dr(J5(K7(), H10()), b10, c10); + case 92: + if ((e10.length | 0) >= (2 + b10 | 0)) { + g10 = 65535 & (e10.charCodeAt(1 + b10 | 0) | 0); + if (48 <= g10 && 57 >= g10) + a: + for (g10 = 1 + b10 | 0; ; ) + if (g10 < (e10.length | 0) ? (f10 = 65535 & (e10.charCodeAt(g10) | 0), f10 = 48 <= f10 && 57 >= f10) : f10 = false, f10) + g10 = 1 + g10 | 0; + else + break a; + else + g10 = 2 + b10 | 0; + b10 = e10.substring(b10, g10); + return CI(a10, gwa(b10), g10, c10, e10); + } + return rwa(a10, e10, b10, c10); + case 43: + case 42: + case 63: + return g10 = (e10.length | 0) >= (2 + b10 | 0) && 63 === (65535 & (e10.charCodeAt(1 + b10 | 0) | 0)) ? 2 + b10 | 0 : 1 + b10 | 0, b10 = e10.substring(b10, g10), b10 = new EI().Hc("", b10), f10 = new FI().e(""), CI(a10, GI(b10, f10), g10, c10, e10); + case 123: + a: + for (g10 = 1 + b10 | 0; ; ) { + if ((e10.length | 0) <= g10) + break a; + if (125 === (65535 & (e10.charCodeAt(g10) | 0))) { + g10 = 1 + g10 | 0; + break a; + } + g10 = 1 + g10 | 0; + } + b10 = e10.substring(b10, g10); + b10 = new EI().Hc("", b10); + f10 = new FI().e(""); + return CI(a10, GI(b10, f10), g10, c10, e10); + case 91: + a: + for (g10 = 1 + b10 | 0; ; ) { + if ((e10.length | 0) <= g10) + break a; + if (92 === (65535 & (e10.charCodeAt(g10) | 0)) && 1 < (e10.length | 0)) + g10 = 2 + g10 | 0; + else { + if (93 === (65535 & (e10.charCodeAt(g10) | 0))) { + g10 = 1 + g10 | 0; + break a; + } + g10 = 1 + g10 | 0; + } + } + b10 = e10.substring(b10, g10); + return CI(a10, gwa(b10), g10, c10, e10); + default: + return rwa(a10, e10, b10, c10); + } + } + function swa(a10, b10, c10) { + var e10 = new cwa(), f10 = fwa(e10, c10.rE.source), g10 = twa(c10); + uwa(f10, 1); + var h10 = vwa(f10), k10 = w6(/* @__PURE__ */ function() { + return function(m10) { + return new JI().Sc(m10.JM(), m10.ya().R1); + }; + }(e10)), l10 = yC(); + l10 = zC(l10); + wwa(f10, Jd(h10, k10, l10)); + k10 = xwa(f10); + g10 = new ba.RegExp(k10, g10); + g10.lastIndex = b10; + k10 = g10.exec(a10); + if (null === k10) + throw mb(E6(), new nb().e("[Internal error] Executed '" + g10 + "' on " + ("'" + a10 + "' at position " + b10) + ", got an error.\n" + ("Original pattern '" + c10) + "' did match however.")); + ywa(f10, w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + t10 = p10[t10 | 0]; + return void 0 === t10 ? null : t10; + }; + }( + e10, + k10 + ))); + zwa(f10, b10); + a10 = w6(/* @__PURE__ */ function() { + return function(m10) { + return new JI().Sc(m10.JM(), m10.ya().$d); + }; + }(e10)); + b10 = yC(); + b10 = zC(b10); + e10.Ui = Jd(h10, a10, b10); + return e10; + } + function rwa(a10, b10, c10, e10) { + var f10 = 65535 & (b10.charCodeAt(c10) | 0); + return CI(a10, gwa("" + gc(f10)), 1 + c10 | 0, e10, b10); + } + cwa.prototype.$classData = r8({ x8a: 0 }, false, "java.util.regex.GroupStartMap", { x8a: 1, f: 1 }); + function KI() { + } + KI.prototype = new u7(); + KI.prototype.constructor = KI; + KI.prototype.a = function() { + return this; + }; + function kwa(a10, b10) { + a10 = b10.length | 0; + if (2 > a10 || 92 !== (65535 & (b10.charCodeAt(0) | 0))) + return false; + for (var c10 = 1; c10 !== a10; ) { + var e10 = 65535 & (b10.charCodeAt(c10) | 0); + if (!(48 <= e10 && 57 >= e10)) + return false; + c10 = 1 + c10 | 0; + } + return true; + } + KI.prototype.$classData = r8({ y8a: 0 }, false, "java.util.regex.GroupStartMap$", { y8a: 1, f: 1 }); + var Awa = void 0; + function lwa() { + Awa || (Awa = new KI().a()); + return Awa; + } + function LI() { + } + LI.prototype = new u7(); + LI.prototype.constructor = LI; + LI.prototype.a = function() { + return this; + }; + function Bwa(a10) { + var b10 = a10.LH; + return kwa(lwa(), b10) ? (a10 = ED(), b10 = b10.substring(1), new z7().d(FD(a10, b10, 10))) : y7(); + } + LI.prototype.$classData = r8({ z8a: 0 }, false, "java.util.regex.GroupStartMap$BackReferenceLeaf$", { z8a: 1, f: 1 }); + var Cwa = void 0; + function MI() { + } + MI.prototype = new u7(); + MI.prototype.constructor = MI; + MI.prototype.a = function() { + return this; + }; + function owa(a10, b10) { + var c10 = b10.ua(), e10 = H10(), f10 = H10(); + a: + for (; ; ) { + if (!H10().h(c10)) { + if (c10 instanceof Vt) { + var g10 = c10.Wn; + c10 = c10.Nf; + var h10 = g10.iy, k10 = new FI().e("|"); + if (null !== h10 && h10.h(k10)) { + f10 = Cw(f10); + e10 = ji(f10, e10); + f10 = H10(); + continue a; + } + f10 = ji(g10, f10); + continue a; + } + throw new x7().d(c10); + } + c10 = Cw(f10); + e10 = Cw(ji(c10, e10)); + break; + } + if (1 === Eq(e10)) + return new II().ts(b10); + a10 = /* @__PURE__ */ function() { + return function(l10) { + return hwa(DI(), l10); + }; + }(a10); + b10 = ii().u; + if (b10 === ii().u) + if (e10 === H10()) + a10 = H10(); + else { + b10 = e10.ga(); + c10 = b10 = ji(a10(b10), H10()); + for (e10 = e10.ta(); e10 !== H10(); ) + f10 = e10.ga(), f10 = ji(a10(f10), H10()), c10 = c10.Nf = f10, e10 = e10.ta(); + a10 = b10; + } + else { + for (b10 = se4( + e10, + b10 + ); !e10.b(); ) + c10 = e10.ga(), b10.jd(a10(c10)), e10 = e10.ta(); + a10 = b10.Rc(); + } + return new NI().ts(a10); + } + MI.prototype.$classData = r8({ A8a: 0 }, false, "java.util.regex.GroupStartMap$CreateParentNode$", { A8a: 1, f: 1 }); + var Dwa = void 0; + function pwa() { + Dwa || (Dwa = new MI().a()); + return Dwa; + } + function OI() { + this.iy = this.GE = null; + this.R1 = 0; + this.vL = null; + this.$d = 0; + } + OI.prototype = new u7(); + OI.prototype.constructor = OI; + function Ewa(a10, b10) { + var c10 = a10.GE; + b10 = c10 instanceof EI && Fwa(Gwa(), c10) ? b10 : null === a10.vL ? -1 : b10 - (a10.vL.length | 0) | 0; + a10.$d = b10; + Hwa(a10); + return a10.$d; + } + function xwa(a10) { + var b10 = a10.GE; + if (b10 instanceof HI) + b10 = "("; + else { + if (!(b10 instanceof EI)) + throw new x7().d(b10); + b10 = "((?:" + b10.LB; + } + var c10 = a10.iy; + if (c10 instanceof FI) + c10 = c10.LH; + else if (c10 instanceof II) { + c10 = c10.Xf; + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return xwa(g10); + }; + }(a10)), f10 = K7(); + c10 = "(?:" + c10.ka(e10, f10.u).cm() + ")"; + } else { + if (!(c10 instanceof NI)) + throw new x7().d(c10); + c10 = c10.Xf; + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return xwa(g10); + }; + }(a10)); + f10 = K7(); + c10 = "(?:" + c10.ka(e10, f10.u).Kg("|") + ")"; + } + a10 = a10.GE; + if (a10 instanceof HI) + a10 = ")"; + else { + if (!(a10 instanceof EI)) + throw new x7().d(a10); + a10 = ")" + a10.$B + ")"; + } + return b10 + c10 + a10; + } + OI.prototype.t = function() { + return "Node(" + this.GE + ", " + this.iy + ")"; + }; + function wwa(a10, b10) { + var c10 = false, e10 = null, f10 = a10.iy; + a: { + if (f10 instanceof FI && (c10 = true, e10 = f10, Cwa || (Cwa = new LI().a()), e10 = Bwa(e10), !e10.b())) { + c10 = e10.c() | 0; + b10 = b10.Ja(c10); + a10.iy = new FI().e("\\" + (b10.b() ? 0 : b10.c())); + break a; + } + if (!c10) + if (f10 instanceof II) + f10.Xf.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return wwa(k10, h10); + }; + }(a10, b10))); + else if (f10 instanceof NI) + f10.Xf.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return wwa(k10, h10); + }; + }(a10, b10))); + else + throw new x7().d(f10); + } + return a10; + } + OI.prototype.xw = function() { + return this.$d + (null === this.vL ? 0 : this.vL.length | 0) | 0; + }; + function ywa(a10, b10) { + a10.vL = b10.P(a10.R1); + var c10 = a10.iy; + if (!(c10 instanceof FI)) + if (c10 instanceof II) + c10.Xf.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + ywa(g10, f10); + }; + }(a10, b10))); + else if (c10 instanceof NI) + c10.Xf.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + ywa(g10, f10); + }; + }(a10, b10))); + else + throw new x7().d(c10); + } + function vwa(a10) { + var b10 = a10.GE; + if (b10 instanceof HI) { + b10 = [new R6().M(b10.RB, a10)]; + for (var c10 = UA(new VA(), nu()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + WA(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } else { + if (!(b10 instanceof EI)) + throw new x7().d(b10); + b10 = Rb(yC(), H10()); + } + c10 = a10.iy; + if (c10 instanceof FI) + a10 = Rb(yC(), H10()); + else if (c10 instanceof II) + a10 = c10.Xf.ne(Rb(yC(), H10()), Uc(/* @__PURE__ */ function() { + return function(g10, h10) { + return g10.uq(vwa(h10)); + }; + }(a10))); + else { + if (!(c10 instanceof NI)) + throw new x7().d(c10); + a10 = c10.Xf.ne(Rb(yC(), H10()), Uc(/* @__PURE__ */ function() { + return function(g10, h10) { + return g10.uq(vwa(h10)); + }; + }(a10))); + } + return b10.uq(a10); + } + function Hwa(a10) { + var b10 = a10.iy; + if (!(b10 instanceof FI)) + if (b10 instanceof II) + b10.Xf.ne(a10.$d, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return zwa(e10, c10 | 0); + }; + }(a10))) | 0; + else if (b10 instanceof NI) + b10.Xf.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return zwa(e10, c10.$d); + }; + }(a10))); + else + throw new x7().d(b10); + } + function GI(a10, b10) { + var c10 = new OI(); + c10.GE = a10; + c10.iy = b10; + c10.R1 = 0; + c10.vL = ""; + c10.$d = 0; + return c10; + } + function uwa(a10, b10) { + a10.R1 = b10; + var c10 = a10.iy; + if (c10 instanceof FI) + return 1 + b10 | 0; + if (c10 instanceof II) + return c10.Xf.ne(1 + b10 | 0, Uc(/* @__PURE__ */ function() { + return function(e10, f10) { + return uwa(f10, e10 | 0); + }; + }(a10))) | 0; + if (!(c10 instanceof NI)) + throw new x7().d(c10); + return c10.Xf.ne(1 + b10 | 0, Uc(/* @__PURE__ */ function() { + return function(e10, f10) { + return uwa(f10, e10 | 0); + }; + }(a10))) | 0; + } + function Iwa(a10) { + var b10 = a10.iy; + if (!(b10 instanceof FI)) + if (b10 instanceof II) + b10.Xf.qs(a10.xw(), Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return Ewa(c10, e10 | 0); + }; + }(a10))) | 0; + else if (b10 instanceof NI) + b10.Xf.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return Ewa(e10, c10.xw()); + }; + }(a10))); + else + throw new x7().d(b10); + } + function qwa(a10) { + var b10 = DI().kF(a10); + if (!b10.b()) { + var c10 = b10.c().ma(); + b10 = b10.c().ya(); + if (c10 instanceof HI && (c10 = c10.RB, b10 instanceof II && (b10 = b10.Xf, K7(), b10 = new z7().d(b10), null !== b10.i && 0 === b10.i.Oe(1) && (b10 = b10.i.lb(0), b10 = jwa().kF(b10), !b10.b())))) + return a10 = b10.c(), c10 = new HI().ue(c10), a10 = new FI().e(a10), GI(c10, a10); + } + return a10; + } + function zwa(a10, b10) { + a10.$d = null === a10.vL ? -1 : b10; + var c10 = a10.GE; + c10 instanceof EI && !mwa(nwa(), c10).b() ? Iwa(a10) : Hwa(a10); + c10 = a10.GE; + return c10 instanceof EI && Fwa(Gwa(), c10) ? b10 : a10.xw(); + } + OI.prototype.$classData = r8({ C8a: 0 }, false, "java.util.regex.GroupStartMap$Node", { C8a: 1, f: 1 }); + function PI() { + } + PI.prototype = new u7(); + PI.prototype.constructor = PI; + PI.prototype.a = function() { + return this; + }; + function gwa(a10) { + DI(); + return GI(new EI().Hc("", ""), new FI().e(a10)); + } + PI.prototype.kF = function(a10) { + return new z7().d(new R6().M(a10.GE, a10.iy)); + }; + function hwa(a10, b10) { + return GI(new EI().Hc("", ""), owa(pwa(), b10)); + } + PI.prototype.$classData = r8({ D8a: 0 }, false, "java.util.regex.GroupStartMap$Node$", { D8a: 1, f: 1 }); + var Jwa = void 0; + function DI() { + Jwa || (Jwa = new PI().a()); + return Jwa; + } + function QI() { + } + QI.prototype = new u7(); + QI.prototype.constructor = QI; + QI.prototype.a = function() { + return this; + }; + function Fwa(a10, b10) { + return ("(?!" === b10.LB || "(?=" === b10.LB) && ")" === b10.$B; + } + QI.prototype.$classData = r8({ I8a: 0 }, false, "java.util.regex.GroupStartMap$OriginallyWrapped$Absolute$", { I8a: 1, f: 1 }); + var Kwa = void 0; + function Gwa() { + Kwa || (Kwa = new QI().a()); + return Kwa; + } + function RI() { + } + RI.prototype = new u7(); + RI.prototype.constructor = RI; + RI.prototype.a = function() { + return this; + }; + function mwa(a10, b10) { + if (a10 = "" === b10.LB) + Lwa || (Lwa = new SI().a()), a10 = b10.$B, a10 = "?" === a10 || "??" === a10 || "*" === a10 || "+" === a10 || "*?" === a10 || "+?" === a10 || 0 <= (a10.length | 0) && "{" === a10.substring(0, 1); + return a10 ? new z7().d(b10.$B) : y7(); + } + RI.prototype.$classData = r8({ J8a: 0 }, false, "java.util.regex.GroupStartMap$OriginallyWrapped$Repeater$", { J8a: 1, f: 1 }); + var Mwa = void 0; + function nwa() { + Mwa || (Mwa = new RI().a()); + return Mwa; + } + function TI() { + } + TI.prototype = new u7(); + TI.prototype.constructor = TI; + TI.prototype.a = function() { + return this; + }; + TI.prototype.kF = function(a10) { + var b10 = DI().kF(a10); + if (!b10.b() && (a10 = b10.c().ma(), b10 = b10.c().ya(), a10 instanceof EI)) { + var c10 = a10.$B; + if ("" === a10.LB && "" === c10 && b10 instanceof FI) + return new z7().d(b10.LH); + } + return y7(); + }; + TI.prototype.$classData = r8({ M8a: 0 }, false, "java.util.regex.GroupStartMap$UnwrappedRegexLeaf$", { M8a: 1, f: 1 }); + var Nwa = void 0; + function jwa() { + Nwa || (Nwa = new TI().a()); + return Nwa; + } + function Su() { + } + Su.prototype = new u7(); + Su.prototype.constructor = Su; + Su.prototype.a = function() { + return this; + }; + Su.prototype.$classData = r8({ O8a: 0 }, false, "java.util.regex.Matcher$", { O8a: 1, f: 1 }); + var Ria = void 0; + function Owa() { + } + Owa.prototype = new u7(); + Owa.prototype.constructor = Owa; + function Pwa() { + } + Pwa.prototype = Owa.prototype; + function Qwa() { + } + Qwa.prototype = new u7(); + Qwa.prototype.constructor = Qwa; + function Rwa() { + } + Rwa.prototype = Qwa.prototype; + function mD(a10, b10) { + null === b10 ? a10 = null : 0 === b10.n.length ? (Swa || (Swa = new UI().a()), a10 = Swa.Vfa) : a10 = new VI().fd(b10); + return a10; + } + function WI(a10, b10) { + return w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = c10.Wa(f10, XI().NP); + return !Twa(XI(), f10) && (e10.P(f10), true); + }; + }(a10, b10)); + } + function YI(a10, b10, c10) { + return a10.Sa(b10) ? a10.P(b10) : c10.P(b10); + } + function ZI() { + this.u0 = this.npa = this.NP = null; + } + ZI.prototype = new u7(); + ZI.prototype.constructor = ZI; + ZI.prototype.a = function() { + Uwa = this; + this.NP = new $I().a(); + this.npa = w6(/* @__PURE__ */ function() { + return function() { + return false; + }; + }(this)); + this.u0 = new Vwa().a(); + return this; + }; + function Twa(a10, b10) { + return a10.NP === b10; + } + ZI.prototype.$classData = r8({ a9a: 0 }, false, "scala.PartialFunction$", { a9a: 1, f: 1 }); + var Uwa = void 0; + function XI() { + Uwa || (Uwa = new ZI().a()); + return Uwa; + } + function aJ() { + } + aJ.prototype = new u7(); + aJ.prototype.constructor = aJ; + aJ.prototype.a = function() { + return this; + }; + function vva(a10, b10, c10) { + return "" + b10 + c10; + } + aJ.prototype.$classData = r8({ i9a: 0 }, false, "scala.Predef$any2stringadd$", { i9a: 1, f: 1 }); + var Wwa = void 0; + function MH() { + Wwa || (Wwa = new aJ().a()); + return Wwa; + } + function bJ() { + this.aT = null; + } + bJ.prototype = new u7(); + bJ.prototype.constructor = bJ; + bJ.prototype.a = function() { + Xwa = this; + this.aT = new vI().a(); + return this; + }; + bJ.prototype.$classData = r8({ o9a: 0 }, false, "scala.concurrent.BlockContext$", { o9a: 1, f: 1 }); + var Xwa = void 0; + function Ywa() { + Xwa || (Xwa = new bJ().a()); + return Xwa; + } + function cJ() { + this.Uka = null; + this.xa = false; + } + cJ.prototype = new u7(); + cJ.prototype.constructor = cJ; + cJ.prototype.a = function() { + return this; + }; + function ml() { + Zwa || (Zwa = new cJ().a()); + var a10 = Zwa; + a10.xa || a10.xa || ($wa || ($wa = new dJ().a()), a10.Uka = $wa.LE, a10.xa = true); + return a10.Uka; + } + cJ.prototype.$classData = r8({ q9a: 0 }, false, "scala.concurrent.ExecutionContext$Implicits$", { q9a: 1, f: 1 }); + var Zwa = void 0; + function axa(a10, b10, c10) { + return bxa(a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (g10 instanceof Kd) + return f10.P(g10.i); + if (g10 instanceof Ld) + return e10; + throw new x7().d(g10); + }; + }(a10, b10)), c10); + } + function cxa(a10, b10, c10) { + return dxa(a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10.dna(f10); + }; + }(a10, b10)), c10); + } + function exa(a10, b10, c10, e10) { + return a10.Pq(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + return g10.Yg(w6(/* @__PURE__ */ function(m10, p10, t10) { + return function(v10) { + return p10.ug(t10, v10); + }; + }(f10, h10, l10)), k10); + }; + }(a10, b10, c10, e10)), Ada()); + } + function fxa(a10, b10, c10) { + return dxa(a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10.woa(f10); + }; + }(a10, b10)), c10); + } + function gxa(a10, b10, c10) { + return bxa(a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (g10 instanceof Ld) + return f10.Wa(g10.uB, w6(/* @__PURE__ */ function(h10) { + return function() { + return h10; + }; + }(e10))); + if (g10 instanceof Kd) + return e10; + throw new x7().d(g10); + }; + }(a10, b10)), c10); + } + function eJ() { + this.Jd = null; + } + eJ.prototype = new u7(); + eJ.prototype.constructor = eJ; + eJ.prototype.a = function() { + hxa = this; + for (var a10 = [new R6().M(q5(Ma), q5(maa)), new R6().M(q5(Oa), q5(gaa)), new R6().M(q5(Na), q5(ixa)), new R6().M(q5(Pa), q5(iaa)), new R6().M(q5(Qa), q5(jaa)), new R6().M(q5(Ra), q5(naa)), new R6().M(q5(Sa), q5(kaa)), new R6().M(q5(Ta), q5(laa)), new R6().M(q5(Ka), q5(oa))], b10 = UA(new VA(), nu()), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.Jd = ZC(0, void 0); + return this; + }; + function Bfa(a10, b10, c10) { + var e10 = ml(); + return b10.ne(ZC(0, c10.en(b10)), Uc(/* @__PURE__ */ function(f10, g10) { + return function(h10, k10) { + return h10.rfa(k10, Uc(/* @__PURE__ */ function() { + return function(l10, m10) { + return l10.jd(m10); + }; + }(f10)), g10); + }; + }(a10, e10))).Yg(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.Rc(); + }; + }(a10)), Ada()); + } + function ZC(a10, b10) { + jxa || (jxa = new fJ().a()); + a10 = new Kd().d(b10); + return kxa(lxa(), a10); + } + function nq(a10, b10, c10) { + return a10.Jd.Yg(w6(/* @__PURE__ */ function(e10, f10) { + return function() { + return Hb(f10); + }; + }(a10, b10)), c10); + } + function Pea(a10, b10) { + jxa || (jxa = new fJ().a()); + a10 = new Ld().kn(b10); + return kxa(lxa(), a10); + } + eJ.prototype.$classData = r8({ r9a: 0 }, false, "scala.concurrent.Future$", { r9a: 1, f: 1 }); + var hxa = void 0; + function hp() { + hxa || (hxa = new eJ().a()); + return hxa; + } + function fJ() { + } + fJ.prototype = new u7(); + fJ.prototype.constructor = fJ; + fJ.prototype.a = function() { + return this; + }; + fJ.prototype.$classData = r8({ u9a: 0 }, false, "scala.concurrent.Promise$", { u9a: 1, f: 1 }); + var jxa = void 0; + function gJ() { + } + gJ.prototype = new u7(); + gJ.prototype.constructor = gJ; + gJ.prototype.a = function() { + return this; + }; + function mxa(a10, b10) { + b10 instanceof Ld ? (a10 = b10.uB, a10 = a10 instanceof nz ? new Kd().d(a10.Dt()) : a10 && a10.$classData && a10.$classData.ge.jW ? new Ld().kn(new hJ().aH("Boxed ControlThrowable", a10)) : a10 instanceof iJ ? new Ld().kn(new hJ().aH("Boxed Error", a10)) : new Ld().kn(a10)) : a10 = b10; + return a10; + } + gJ.prototype.$classData = r8({ w9a: 0 }, false, "scala.concurrent.impl.Promise$", { w9a: 1, f: 1 }); + var nxa = void 0; + function oxa() { + nxa || (nxa = new gJ().a()); + return nxa; + } + function jJ() { + } + jJ.prototype = new u7(); + jJ.prototype.constructor = jJ; + jJ.prototype.a = function() { + return this; + }; + function kxa(a10, b10) { + a10 = mxa(oxa(), b10); + if (a10 instanceof Kd) + return b10 = new pxa(), b10.Hu = a10, b10; + if (a10 instanceof Ld) + return b10 = new qxa(), b10.Hu = a10, b10; + throw new x7().d(a10); + } + jJ.prototype.$classData = r8({ y9a: 0 }, false, "scala.concurrent.impl.Promise$KeptPromise$", { y9a: 1, f: 1 }); + var rxa = void 0; + function lxa() { + rxa || (rxa = new jJ().a()); + return rxa; + } + function kJ() { + } + kJ.prototype = new u7(); + kJ.prototype.constructor = kJ; + kJ.prototype.a = function() { + return this; + }; + kJ.prototype.$classData = r8({ J9a: 0 }, false, "scala.math.Ordered$", { J9a: 1, f: 1 }); + var sxa = void 0; + function lJ() { + this.Vf = this.t8 = this.dR = this.aB = this.bga = this.cd = this.bra = null; + this.xa = 0; + } + lJ.prototype = new u7(); + lJ.prototype.constructor = lJ; + lJ.prototype.a = function() { + txa = this; + new mJ().a(); + uxa || (uxa = new nJ().a()); + Xd(); + this.cd = K7(); + this.bga = rw(); + $B(); + ii(); + this.aB = H10(); + vxa || (vxa = new oJ().a()); + wxa || (wxa = new pJ().a()); + this.dR = wxa; + xxa || (xxa = new qJ().a()); + Pt(); + yxa || (yxa = new rJ().a()); + this.t8 = iG(); + zxa || (zxa = new sJ().a()); + this.Vf = Axa(); + Bxa || (Bxa = new tJ().a()); + Cxa || (Cxa = new uJ().a()); + Dxa || (Dxa = new vJ().a()); + Exa || (Exa = new wJ().a()); + sxa || (sxa = new kJ().a()); + TC(); + Fxa || (Fxa = new xJ().a()); + Gxa || (Gxa = new yJ().a()); + Hxa || (Hxa = new zJ().a()); + return this; + }; + lJ.prototype.$classData = r8({ P9a: 0 }, false, "scala.package$", { P9a: 1, f: 1 }); + var txa = void 0; + function ue4() { + txa || (txa = new lJ().a()); + return txa; + } + function AJ() { + this.nd = this.Yr = this.Mi = this.Nh = this.of = this.mr = this.cj = this.rx = null; + } + AJ.prototype = new u7(); + AJ.prototype.constructor = AJ; + AJ.prototype.a = function() { + Ixa = this; + this.rx = Jxa(); + Kxa(); + Lxa(); + this.cj = Mxa(); + this.mr = Nxa(); + this.of = Oxa(); + this.Nh = Pxa(); + this.Mi = Qxa(); + Rxa(); + Sxa || (Sxa = new BJ().a()); + this.Yr = Sxa; + CJ(); + Txa || (Txa = new DJ().a()); + Uxa(); + this.nd = Vxa(); + return this; + }; + AJ.prototype.$classData = r8({ R9a: 0 }, false, "scala.reflect.ClassManifestFactory$", { R9a: 1, f: 1 }); + var Ixa = void 0; + function EJ() { + } + EJ.prototype = new u7(); + EJ.prototype.constructor = EJ; + EJ.prototype.a = function() { + return this; + }; + EJ.prototype.$classData = r8({ U9a: 0 }, false, "scala.reflect.ManifestFactory$", { U9a: 1, f: 1 }); + var Wxa = void 0; + function FJ() { + } + FJ.prototype = new u7(); + FJ.prototype.constructor = FJ; + FJ.prototype.a = function() { + Xxa = this; + Ixa || (Ixa = new AJ().a()); + Wxa || (Wxa = new EJ().a()); + return this; + }; + FJ.prototype.$classData = r8({ j$a: 0 }, false, "scala.reflect.package$", { j$a: 1, f: 1 }); + var Xxa = void 0; + function GJ() { + this.M2 = null; + } + GJ.prototype = new u7(); + GJ.prototype.constructor = GJ; + function Yxa() { + } + Yxa.prototype = GJ.prototype; + GJ.prototype.a = function() { + this.M2 = new HJ().a(); + return this; + }; + GJ.prototype.$classData = r8({ Woa: 0 }, false, "scala.util.control.Breaks", { Woa: 1, f: 1 }); + function IJ() { + } + IJ.prototype = new u7(); + IJ.prototype.constructor = IJ; + IJ.prototype.a = function() { + return this; + }; + function JJ(a10, b10) { + return b10 && b10.$classData && b10.$classData.ge.jW ? y7() : new z7().d(b10); + } + IJ.prototype.$classData = r8({ y$a: 0 }, false, "scala.util.control.NonFatal$", { y$a: 1, f: 1 }); + var Zxa = void 0; + function KJ() { + Zxa || (Zxa = new IJ().a()); + return Zxa; + } + function LJ() { + } + LJ.prototype = new u7(); + LJ.prototype.constructor = LJ; + function $xa() { + } + $xa.prototype = LJ.prototype; + LJ.prototype.mP = function(a10, b10) { + b10 = ca(-862048943, b10); + b10 = ca(461845907, b10 << 15 | b10 >>> 17 | 0); + return a10 ^ b10; + }; + LJ.prototype.Ga = function(a10, b10) { + a10 = this.mP(a10, b10); + return -430675100 + ca(5, a10 << 13 | a10 >>> 19 | 0) | 0; + }; + function X5(a10) { + var b10 = MJ(), c10 = a10.E(); + if (0 === c10) + return a10 = a10.H(), ta(ua(), a10); + for (var e10 = -889275714, f10 = 0; f10 < c10; ) + e10 = b10.Ga(e10, NJ(OJ(), a10.G(f10))), f10 = 1 + f10 | 0; + return b10.fe(e10, c10); + } + function aya(a10, b10, c10) { + var e10 = new lC().ue(0), f10 = new lC().ue(0), g10 = new lC().ue(0), h10 = new lC().ue(1); + b10.U(w6(/* @__PURE__ */ function(k10, l10, m10, p10, t10) { + return function(v10) { + v10 = NJ(OJ(), v10); + l10.oa = l10.oa + v10 | 0; + m10.oa ^= v10; + 0 !== v10 && (p10.oa = ca(p10.oa, v10)); + t10.oa = 1 + t10.oa | 0; + }; + }(a10, e10, f10, h10, g10))); + b10 = a10.Ga(c10, e10.oa); + b10 = a10.Ga(b10, f10.oa); + b10 = a10.mP(b10, h10.oa); + return a10.fe(b10, g10.oa); + } + LJ.prototype.fe = function(a10, b10) { + a10 ^= b10; + a10 = ca(-2048144789, a10 ^ (a10 >>> 16 | 0)); + a10 = ca(-1028477387, a10 ^ (a10 >>> 13 | 0)); + return a10 ^ (a10 >>> 16 | 0); + }; + function bya(a10, b10, c10) { + var e10 = new lC().ue(0); + c10 = new lC().ue(c10); + b10.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + g10.oa = f10.Ga(g10.oa, NJ(OJ(), k10)); + h10.oa = 1 + h10.oa | 0; + }; + }(a10, c10, e10))); + return a10.fe(c10.oa, e10.oa); + } + function PJ() { + } + PJ.prototype = new u7(); + PJ.prototype.constructor = PJ; + PJ.prototype.a = function() { + return this; + }; + function cya(a10, b10) { + a10 = ca(-1640532531, b10); + ED(); + return ca(-1640532531, a10 << 24 | 16711680 & a10 << 8 | 65280 & (a10 >>> 8 | 0) | a10 >>> 24 | 0); + } + PJ.prototype.$classData = r8({ A$a: 0 }, false, "scala.util.hashing.package$", { A$a: 1, f: 1 }); + var dya = void 0; + function eya() { + dya || (dya = new PJ().a()); + return dya; + } + function qJ() { + } + qJ.prototype = new u7(); + qJ.prototype.constructor = qJ; + qJ.prototype.a = function() { + return this; + }; + qJ.prototype.$classData = r8({ I$a: 0 }, false, "scala.collection.$colon$plus$", { I$a: 1, f: 1 }); + var xxa = void 0; + function pJ() { + } + pJ.prototype = new u7(); + pJ.prototype.constructor = pJ; + pJ.prototype.a = function() { + return this; + }; + function iwa(a10, b10) { + if (b10.b()) + return y7(); + a10 = b10.ga(); + b10 = b10.ta(); + return new z7().d(new R6().M(a10, b10)); + } + pJ.prototype.$classData = r8({ J$a: 0 }, false, "scala.collection.$plus$colon$", { J$a: 1, f: 1 }); + var wxa = void 0; + function QJ() { + this.ce = null; + } + QJ.prototype = new u7(); + QJ.prototype.constructor = QJ; + QJ.prototype.a = function() { + fya = this; + this.ce = new RJ().a(); + return this; + }; + QJ.prototype.$classData = r8({ U$a: 0 }, false, "scala.collection.Iterator$", { U$a: 1, f: 1 }); + var fya = void 0; + function $B() { + fya || (fya = new QJ().a()); + return fya; + } + function gya() { + this.zn = this.AB = null; + } + gya.prototype = new u7(); + gya.prototype.constructor = gya; + gya.prototype.$classData = r8({ eab: 0 }, false, "scala.collection.Iterator$ConcatIteratorCell", { eab: 1, f: 1 }); + function ZG(a10, b10, c10) { + a10.Pk(b10, c10, SJ(W5(), b10) - c10 | 0); + } + function TJ(a10, b10) { + b10 = b10.es(); + b10.jh(a10.Hd()); + return b10.Rc(); + } + function UJ(a10, b10, c10, e10) { + return a10.rm(new Tj().a(), b10, c10, e10).Ef.qf; + } + function Tc(a10, b10, c10) { + b10 = new qd().d(b10); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + f10.oa = g10.ug(f10.oa, h10); + }; + }(a10, b10, c10))); + return b10.oa; + } + function hya(a10, b10, c10) { + a10 = iya(a10); + var e10 = b10; + for (b10 = a10; !b10.b(); ) + a10 = e10, e10 = b10.ga(), e10 = c10.ug(e10, a10), b10 = b10.ta(); + return e10; + } + function VJ(a10) { + var b10 = new lC().ue(0); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function() { + e10.oa = 1 + e10.oa | 0; + }; + }(a10, b10))); + return b10.oa; + } + function Jc(a10, b10) { + var c10 = new Ej().a(); + try { + if (a10 && a10.$classData && a10.$classData.ge.Ii) + var e10 = a10; + else { + if (!(a10 && a10.$classData && a10.$classData.ge.vd)) + return a10.U(b10.vA(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + throw new nz().M(k10, new z7().d(l10)); + }; + }(a10, c10)))), y7(); + e10 = a10.im(); + } + for (var f10 = new WJ().DU(a10); e10.Ya(); ) { + var g10 = b10.Wa(e10.$a(), f10); + if (g10 !== f10) + return new z7().d(g10); + } + return y7(); + } catch (h10) { + if (h10 instanceof nz) { + a10 = h10; + if (a10.Aa === c10) + return a10.Dt(); + throw a10; + } + throw h10; + } + } + function XJ(a10, b10, c10, e10, f10) { + var g10 = new Uj().eq(true); + Vj(b10, c10); + a10.U(w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + if (k10.oa) + Wj(l10, p10), k10.oa = false; + else + return Vj(l10, m10), Wj(l10, p10); + }; + }(a10, g10, b10, e10))); + Vj(b10, f10); + return b10; + } + function YJ(a10, b10) { + return a10.Do() ? (b10 = b10.zs(a10.jb()), a10.so(b10, 0), b10) : a10.Mj().Ol(b10); + } + function tc(a10) { + return !a10.b(); + } + function iya(a10) { + var b10 = H10(); + b10 = new qd().d(b10); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + e10.oa = ji(f10, e10.oa); + }; + }(a10, b10))); + return b10.oa; + } + function XB() { + this.upa = null; + } + XB.prototype = new u7(); + XB.prototype.constructor = XB; + XB.prototype.DU = function(a10) { + this.upa = a10; + return this; + }; + XB.prototype.$classData = r8({ Jab: 0 }, false, "scala.collection.TraversableOnce$FlattenOps", { Jab: 1, f: 1 }); + function WB() { + this.xqa = null; + } + WB.prototype = new u7(); + WB.prototype.constructor = WB; + WB.prototype.DU = function(a10) { + this.xqa = a10; + return this; + }; + WB.prototype.$classData = r8({ Lab: 0 }, false, "scala.collection.TraversableOnce$MonadOps", { Lab: 1, f: 1 }); + function jya() { + } + jya.prototype = new u7(); + jya.prototype.constructor = jya; + function kya() { + } + kya.prototype = jya.prototype; + function Rb(a10, b10) { + return a10.Qd().jh(b10).Rc(); + } + jya.prototype.Qd = function() { + return UA(new VA(), this.tG()); + }; + function lya() { + } + lya.prototype = new u7(); + lya.prototype.constructor = lya; + function mya() { + } + mya.prototype = lya.prototype; + function J5(a10, b10) { + if (b10.b()) + return a10.Rz(); + a10 = a10.Qd(); + a10.jh(b10); + return a10.Rc(); + } + lya.prototype.Rz = function() { + return this.Qd().Rc(); + }; + function nya(a10, b10) { + var c10 = a10.Di().Qd(); + a10.Hd().U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + return f10.jh(g10.P(h10).Hd()); + }; + }(a10, c10, b10))); + return c10.Rc(); + } + function oya(a10, b10) { + a: + for (; ; ) { + if (tc(b10)) { + a10.Kk(b10.ga()); + b10 = b10.ta(); + continue a; + } + break; + } + } + function yi(a10, b10) { + b10 && b10.$classData && b10.$classData.ge.kW ? oya(a10, b10) : b10.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.Kk(e10); + }; + }(a10))); + return a10; + } + function ZJ() { + this.iI = this.gk = 0; + } + ZJ.prototype = new u7(); + ZJ.prototype.constructor = ZJ; + function pya(a10) { + return a10.iI - a10.gk | 0; + } + ZJ.prototype.Sc = function(a10, b10) { + this.gk = a10; + this.iI = b10; + return this; + }; + ZJ.prototype.$classData = r8({ Wab: 0 }, false, "scala.collection.generic.SliceInterval", { Wab: 1, f: 1 }); + function $J() { + } + $J.prototype = new u7(); + $J.prototype.constructor = $J; + $J.prototype.a = function() { + return this; + }; + function aK(a10, b10, c10) { + a10 = 0 < b10 ? b10 : 0; + c10 = 0 < c10 ? c10 : 0; + return c10 <= a10 ? new ZJ().Sc(a10, a10) : new ZJ().Sc(a10, c10); + } + $J.prototype.$classData = r8({ Xab: 0 }, false, "scala.collection.generic.SliceInterval$", { Xab: 1, f: 1 }); + var qya = void 0; + function bK() { + qya || (qya = new $J().a()); + return qya; + } + function rya() { + } + rya.prototype = new u7(); + rya.prototype.constructor = rya; + function sya() { + } + sya.prototype = rya.prototype; + function rJ() { + } + rJ.prototype = new u7(); + rJ.prototype.constructor = rJ; + rJ.prototype.a = function() { + return this; + }; + rJ.prototype.$classData = r8({ Zbb: 0 }, false, "scala.collection.immutable.Stream$$hash$colon$colon$", { Zbb: 1, f: 1 }); + var yxa = void 0; + function cK() { + this.zea = null; + } + cK.prototype = new u7(); + cK.prototype.constructor = cK; + cK.prototype.PG = function(a10) { + this.zea = a10; + return this; + }; + function tya(a10, b10) { + return dK(b10, a10.zea); + } + function uya(a10, b10) { + return vya(b10, a10.zea); + } + cK.prototype.$classData = r8({ acb: 0 }, false, "scala.collection.immutable.Stream$ConsWrapper", { acb: 1, f: 1 }); + function eK() { + this.kea = this.lx = null; + this.xa = false; + this.l = null; + } + eK.prototype = new u7(); + eK.prototype.constructor = eK; + function wya(a10, b10, c10) { + a10.kea = c10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + function xya(a10) { + a10.xa || (a10.xa || (a10.lx = Hb(a10.kea), a10.xa = true), a10.kea = null); + return a10.lx; + } + eK.prototype.$classData = r8({ gcb: 0 }, false, "scala.collection.immutable.StreamIterator$LazyCell", { gcb: 1, f: 1 }); + function fK() { + } + fK.prototype = new u7(); + fK.prototype.constructor = fK; + fK.prototype.a = function() { + return this; + }; + function gh(a10, b10, c10, e10) { + a10 = 0 > c10 ? 0 : c10; + return e10 <= a10 || a10 >= (b10.length | 0) ? "" : b10.substring(a10, e10 > (b10.length | 0) ? b10.length | 0 : e10); + } + fK.prototype.$classData = r8({ ucb: 0 }, false, "scala.collection.immutable.StringOps$", { ucb: 1, f: 1 }); + var yya = void 0; + function hh() { + yya || (yya = new fK().a()); + return yya; + } + function gK() { + } + gK.prototype = new u7(); + gK.prototype.constructor = gK; + gK.prototype.a = function() { + return this; + }; + gK.prototype.Qd = function() { + var a10 = new Tj().a(); + return zya(new Aya(), a10, w6(/* @__PURE__ */ function() { + return function(b10) { + return new hK().e(b10); + }; + }(this))); + }; + gK.prototype.$classData = r8({ Dcb: 0 }, false, "scala.collection.immutable.WrappedString$", { Dcb: 1, f: 1 }); + var Bya = void 0; + function iK() { + } + iK.prototype = new u7(); + iK.prototype.constructor = iK; + iK.prototype.a = function() { + return this; + }; + iK.prototype.$classData = r8({ Ucb: 0 }, false, "scala.collection.mutable.ArrayOps$ofBoolean$", { Ucb: 1, f: 1 }); + var Cya = void 0; + function jK() { + } + jK.prototype = new u7(); + jK.prototype.constructor = jK; + jK.prototype.a = function() { + return this; + }; + jK.prototype.$classData = r8({ Wcb: 0 }, false, "scala.collection.mutable.ArrayOps$ofByte$", { Wcb: 1, f: 1 }); + var Dya = void 0; + function kK() { + } + kK.prototype = new u7(); + kK.prototype.constructor = kK; + kK.prototype.a = function() { + return this; + }; + kK.prototype.$classData = r8({ Ycb: 0 }, false, "scala.collection.mutable.ArrayOps$ofChar$", { Ycb: 1, f: 1 }); + var Eya = void 0; + function lK() { + } + lK.prototype = new u7(); + lK.prototype.constructor = lK; + lK.prototype.a = function() { + return this; + }; + lK.prototype.$classData = r8({ $cb: 0 }, false, "scala.collection.mutable.ArrayOps$ofDouble$", { $cb: 1, f: 1 }); + var Fya = void 0; + function mK() { + } + mK.prototype = new u7(); + mK.prototype.constructor = mK; + mK.prototype.a = function() { + return this; + }; + mK.prototype.$classData = r8({ bdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofFloat$", { bdb: 1, f: 1 }); + var Gya = void 0; + function nK() { + } + nK.prototype = new u7(); + nK.prototype.constructor = nK; + nK.prototype.a = function() { + return this; + }; + nK.prototype.$classData = r8({ ddb: 0 }, false, "scala.collection.mutable.ArrayOps$ofInt$", { ddb: 1, f: 1 }); + var Hya = void 0; + function oK() { + } + oK.prototype = new u7(); + oK.prototype.constructor = oK; + oK.prototype.a = function() { + return this; + }; + oK.prototype.$classData = r8({ fdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofLong$", { fdb: 1, f: 1 }); + var Iya = void 0; + function pK() { + } + pK.prototype = new u7(); + pK.prototype.constructor = pK; + pK.prototype.a = function() { + return this; + }; + pK.prototype.$classData = r8({ hdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofRef$", { hdb: 1, f: 1 }); + var Jya = void 0; + function qK() { + } + qK.prototype = new u7(); + qK.prototype.constructor = qK; + qK.prototype.a = function() { + return this; + }; + qK.prototype.$classData = r8({ jdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofShort$", { jdb: 1, f: 1 }); + var Kya = void 0; + function rK() { + } + rK.prototype = new u7(); + rK.prototype.constructor = rK; + rK.prototype.a = function() { + return this; + }; + rK.prototype.$classData = r8({ ldb: 0 }, false, "scala.collection.mutable.ArrayOps$ofUnit$", { ldb: 1, f: 1 }); + var Lya = void 0; + function Mya(a10) { + return sK(ED(), -1 + a10.ze.n.length | 0); + } + function Nya(a10, b10) { + b10 = Nda(b10); + return Oya(a10, b10); + } + function Oya(a10, b10) { + var c10 = sa(b10); + c10 = Pya(a10, c10); + for (var e10 = a10.ze.n[c10]; null !== e10; ) { + if (Va(Wa(), e10, b10)) + return false; + c10 = (1 + c10 | 0) % a10.ze.n.length | 0; + e10 = a10.ze.n[c10]; + } + a10.ze.n[c10] = b10; + a10.yn = 1 + a10.yn | 0; + null !== a10.mp && (b10 = c10 >> 5, c10 = a10.mp, c10.n[b10] = 1 + c10.n[b10] | 0); + if (a10.yn >= a10.CA) + for (b10 = a10.ze, a10.ze = ja(Ja(Ha), [a10.ze.n.length << 1]), a10.yn = 0, null !== a10.mp && (c10 = 1 + (a10.ze.n.length >> 5) | 0, a10.mp.n.length !== c10 ? a10.mp = ja(Ja(Qa), [c10]) : Wva(AI(), a10.mp)), a10.fC = Mya(a10), a10.CA = Qya().pV(a10.Cy, a10.ze.n.length), c10 = 0; c10 < b10.n.length; ) + e10 = b10.n[c10], null !== e10 && Oya(a10, e10), c10 = 1 + c10 | 0; + return true; + } + function Pya(a10, b10) { + var c10 = a10.fC; + b10 = cya(eya(), b10); + a10 = -1 + a10.ze.n.length | 0; + return ((b10 >>> c10 | 0 | b10 << (-c10 | 0)) >>> (32 - sK(ED(), a10) | 0) | 0) & a10; + } + function Rya(a10, b10) { + b10 = Nda(b10); + var c10 = sa(b10); + c10 = Pya(a10, c10); + for (var e10 = a10.ze.n[c10]; null !== e10; ) { + if (Va(Wa(), e10, b10)) { + b10 = c10; + for (c10 = (1 + b10 | 0) % a10.ze.n.length | 0; null !== a10.ze.n[c10]; ) { + e10 = sa(a10.ze.n[c10]); + e10 = Pya(a10, e10); + var f10; + if (f10 = e10 !== c10) + f10 = a10.ze.n.length >> 1, f10 = e10 <= b10 ? (b10 - e10 | 0) < f10 : (e10 - b10 | 0) > f10; + f10 && (a10.ze.n[b10] = a10.ze.n[c10], b10 = c10); + c10 = (1 + c10 | 0) % a10.ze.n.length | 0; + } + a10.ze.n[b10] = null; + a10.yn = -1 + a10.yn | 0; + null !== a10.mp && (a10 = a10.mp, b10 >>= 5, a10.n[b10] = -1 + a10.n[b10] | 0); + break; + } + c10 = (1 + c10 | 0) % a10.ze.n.length | 0; + e10 = a10.ze.n[c10]; + } + } + function Sya(a10, b10) { + b10 = Nda(b10); + var c10 = sa(b10); + c10 = Pya(a10, c10); + for (var e10 = a10.ze.n[c10]; null !== e10 && !Va(Wa(), e10, b10); ) + c10 = (1 + c10 | 0) % a10.ze.n.length | 0, e10 = a10.ze.n[c10]; + return e10; + } + function tK() { + } + tK.prototype = new u7(); + tK.prototype.constructor = tK; + tK.prototype.a = function() { + return this; + }; + tK.prototype.pV = function(a10, b10) { + if (!(500 > a10)) + throw new uK().d("assertion failed: loadFactor too large; must be < 0.5"); + var c10 = b10 >> 31, e10 = a10 >> 31, f10 = 65535 & b10, g10 = b10 >>> 16 | 0, h10 = 65535 & a10, k10 = a10 >>> 16 | 0, l10 = ca(f10, h10); + h10 = ca(g10, h10); + var m10 = ca(f10, k10); + f10 = l10 + ((h10 + m10 | 0) << 16) | 0; + l10 = (l10 >>> 16 | 0) + m10 | 0; + a10 = (((ca(b10, e10) + ca(c10, a10) | 0) + ca(g10, k10) | 0) + (l10 >>> 16 | 0) | 0) + (((65535 & l10) + h10 | 0) >>> 16 | 0) | 0; + return Tya(Ea(), f10, a10, 1e3, 0); + }; + tK.prototype.$classData = r8({ odb: 0 }, false, "scala.collection.mutable.FlatHashTable$", { odb: 1, f: 1 }); + var Uya = void 0; + function Qya() { + Uya || (Uya = new tK().a()); + return Uya; + } + function vK() { + } + vK.prototype = new u7(); + vK.prototype.constructor = vK; + vK.prototype.a = function() { + return this; + }; + vK.prototype.t = function() { + return "NullSentinel"; + }; + vK.prototype.z = function() { + return 0; + }; + vK.prototype.$classData = r8({ qdb: 0 }, false, "scala.collection.mutable.FlatHashTable$NullSentinel$", { qdb: 1, f: 1 }); + var Vya = void 0; + function Oda() { + Vya || (Vya = new vK().a()); + return Vya; + } + function Wya(a10) { + return sK(ED(), -1 + a10.ze.n.length | 0); + } + function Xya(a10) { + for (var b10 = -1 + a10.ze.n.length | 0; 0 <= b10; ) + a10.ze.n[b10] = null, b10 = -1 + b10 | 0; + a10.qM(0); + Yya(a10, 0); + } + function Zya(a10, b10, c10) { + for (a10 = a10.ze.n[c10]; ; ) + if (null !== a10 ? (c10 = a10.uu(), c10 = !Va(Wa(), c10, b10)) : c10 = false, c10) + a10 = a10.$a(); + else + break; + return a10; + } + function wK(a10, b10) { + var c10 = -1 + a10.ze.n.length | 0, e10 = ea(c10); + a10 = a10.fC; + b10 = cya(eya(), b10); + return ((b10 >>> a10 | 0 | b10 << (-a10 | 0)) >>> e10 | 0) & c10; + } + function $ya(a10) { + a10.d5(750); + xK(); + var b10 = a10.IU(); + a10.j3(ja(Ja(Qda), [aza(0, b10)])); + a10.qM(0); + b10 = a10.Cy; + var c10 = xK(); + xK(); + a10.p3(c10.pV(b10, aza(0, a10.IU()))); + a10.$2(null); + a10.Yda(Wya(a10)); + } + function bza(a10, b10) { + var c10 = NJ(OJ(), b10); + c10 = wK(a10, c10); + var e10 = a10.ze.n[c10]; + if (null !== e10) { + var f10 = e10.uu(); + if (Va(Wa(), f10, b10)) + return a10.ze.n[c10] = e10.$a(), a10.qM(-1 + a10.yn | 0), cza(a10, c10), e10.EL(null), e10; + for (f10 = e10.$a(); ; ) { + if (null !== f10) { + var g10 = f10.uu(); + g10 = !Va(Wa(), g10, b10); + } else + g10 = false; + if (g10) + e10 = f10, f10 = f10.$a(); + else + break; + } + if (null !== f10) + return e10.EL(f10.$a()), a10.qM(-1 + a10.yn | 0), cza(a10, c10), f10.EL(null), f10; + } + return null; + } + function pD(a10) { + for (var b10 = -1 + a10.ze.n.length | 0; null === a10.ze.n[b10] && 0 < b10; ) + b10 = -1 + b10 | 0; + return b10; + } + function Zv(a10, b10, c10) { + var e10 = NJ(OJ(), b10); + e10 = wK(a10, e10); + var f10 = Zya(a10, b10, e10); + if (null !== f10) + return f10; + b10 = a10.F9(b10, c10); + dza(a10, b10, e10); + return null; + } + function eza(a10, b10) { + var c10 = NJ(OJ(), b10); + c10 = wK(a10, c10); + return Zya(a10, b10, c10); + } + function dza(a10, b10, c10) { + b10.EL(a10.ze.n[c10]); + a10.ze.n[c10] = b10; + a10.qM(1 + a10.yn | 0); + fza(a10, c10); + if (a10.yn > a10.CA) { + b10 = a10.ze.n.length << 1; + c10 = a10.ze; + a10.j3(ja(Ja(Qda), [b10])); + Yya(a10, a10.ze.n.length); + for (var e10 = -1 + c10.n.length | 0; 0 <= e10; ) { + for (var f10 = c10.n[e10]; null !== f10; ) { + var g10 = f10.uu(); + g10 = NJ(OJ(), g10); + g10 = wK(a10, g10); + var h10 = f10.$a(); + f10.EL(a10.ze.n[g10]); + a10.ze.n[g10] = f10; + f10 = h10; + fza(a10, g10); + } + e10 = -1 + e10 | 0; + } + a10.p3(xK().pV(a10.Cy, b10)); + } + } + function cza(a10, b10) { + null !== a10.mp && (a10 = a10.mp, b10 >>= 5, a10.n[b10] = -1 + a10.n[b10] | 0); + } + function Yya(a10, b10) { + null !== a10.mp && (b10 = 1 + (b10 >> 5) | 0, a10.mp.n.length !== b10 ? a10.$2(ja(Ja(Qa), [b10])) : Wva(AI(), a10.mp)); + } + function fza(a10, b10) { + null !== a10.mp && (a10 = a10.mp, b10 >>= 5, a10.n[b10] = 1 + a10.n[b10] | 0); + } + function yK() { + } + yK.prototype = new u7(); + yK.prototype.constructor = yK; + yK.prototype.a = function() { + return this; + }; + function aza(a10, b10) { + return 1 << (-ea(-1 + b10 | 0) | 0); + } + yK.prototype.pV = function(a10, b10) { + var c10 = b10 >> 31, e10 = a10 >> 31, f10 = 65535 & b10, g10 = b10 >>> 16 | 0, h10 = 65535 & a10, k10 = a10 >>> 16 | 0, l10 = ca(f10, h10); + h10 = ca(g10, h10); + var m10 = ca(f10, k10); + f10 = l10 + ((h10 + m10 | 0) << 16) | 0; + l10 = (l10 >>> 16 | 0) + m10 | 0; + a10 = (((ca(b10, e10) + ca(c10, a10) | 0) + ca(g10, k10) | 0) + (l10 >>> 16 | 0) | 0) + (((65535 & l10) + h10 | 0) >>> 16 | 0) | 0; + return Tya(Ea(), f10, a10, 1e3, 0); + }; + yK.prototype.$classData = r8({ zdb: 0 }, false, "scala.collection.mutable.HashTable$", { zdb: 1, f: 1 }); + var gza = void 0; + function xK() { + gza || (gza = new yK().a()); + return gza; + } + function UI() { + this.Vfa = null; + } + UI.prototype = new u7(); + UI.prototype.constructor = UI; + UI.prototype.a = function() { + Swa = this; + this.Vfa = new VI().fd(ja(Ja(Ha), [0])); + return this; + }; + UI.prototype.$classData = r8({ heb: 0 }, false, "scala.collection.mutable.WrappedArray$", { heb: 1, f: 1 }); + var Swa = void 0; + function dJ() { + this.LE = null; + } + dJ.prototype = new u7(); + dJ.prototype.constructor = dJ; + dJ.prototype.a = function() { + $wa = this; + hza || (hza = new zK().a()); + iza || (iza = new AK().a()); + this.LE = void 0 === ba.Promise ? new BK().a() : new CK().a(); + return this; + }; + dJ.prototype.$classData = r8({ teb: 0 }, false, "scala.scalajs.concurrent.JSExecutionContext$", { teb: 1, f: 1 }); + var $wa = void 0; + function AK() { + } + AK.prototype = new u7(); + AK.prototype.constructor = AK; + AK.prototype.a = function() { + return this; + }; + AK.prototype.$classData = r8({ ueb: 0 }, false, "scala.scalajs.concurrent.QueueExecutionContext$", { ueb: 1, f: 1 }); + var iza = void 0; + function DK() { + } + DK.prototype = new u7(); + DK.prototype.constructor = DK; + DK.prototype.a = function() { + return this; + }; + function jza(a10, b10, c10, e10, f10) { + e10.wP(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + if (l10 instanceof Kd) + return h10(l10.i); + if (l10 instanceof Ld) + return l10 = l10.uB, k10(l10 instanceof EK ? l10.Px : l10); + throw new x7().d(l10); + }; + }(a10, b10, c10)), f10); + } + function FK(a10, b10) { + a10 = ml(); + return new ba.Promise(/* @__PURE__ */ function(c10, e10) { + return function(f10, g10) { + jza(GK(), f10, g10, c10, e10); + }; + }(b10, a10)); + } + DK.prototype.$classData = r8({ yeb: 0 }, false, "scala.scalajs.js.JSConverters$JSRichFuture$", { yeb: 1, f: 1 }); + var kza = void 0; + function GK() { + kza || (kza = new DK().a()); + return kza; + } + function HK() { + } + HK.prototype = new u7(); + HK.prototype.constructor = HK; + HK.prototype.a = function() { + return this; + }; + HK.prototype.$classData = r8({ zeb: 0 }, false, "scala.scalajs.js.JSConverters$JSRichGenMap$", { zeb: 1, f: 1 }); + var lza = void 0; + function mza() { + lza || (lza = new HK().a()); + return lza; + } + function IK() { + } + IK.prototype = new u7(); + IK.prototype.constructor = IK; + IK.prototype.a = function() { + return this; + }; + function nza(a10, b10) { + if (b10 instanceof Ib) + return b10.L; + var c10 = []; + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.push(g10) | 0; + }; + }(a10, c10))); + return c10; + } + IK.prototype.$classData = r8({ Aeb: 0 }, false, "scala.scalajs.js.JSConverters$JSRichGenTraversableOnce$", { Aeb: 1, f: 1 }); + var oza = void 0; + function JK() { + } + JK.prototype = new u7(); + JK.prototype.constructor = JK; + JK.prototype.a = function() { + return this; + }; + function pza(a10, b10) { + a10 = new AF().a(); + b10.then(/* @__PURE__ */ function(c10) { + return function(e10) { + qza(); + Ij(c10, e10); + }; + }(a10), /* @__PURE__ */ function(c10) { + return function(e10) { + qza(); + e10 = e10 instanceof CF ? e10 : new EK().d(e10); + Gj(c10, e10); + }; + }(a10)); + return a10; + } + JK.prototype.$classData = r8({ Ceb: 0 }, false, "scala.scalajs.js.Thenable$ThenableOps$", { Ceb: 1, f: 1 }); + var rza = void 0; + function qza() { + rza || (rza = new JK().a()); + return rza; + } + function KK() { + this.aC = null; + } + KK.prototype = new u7(); + KK.prototype.constructor = KK; + KK.prototype.a = function() { + sza = this; + this.aC = ba.Object.prototype.hasOwnProperty; + return this; + }; + KK.prototype.$classData = r8({ Feb: 0 }, false, "scala.scalajs.js.WrappedDictionary$Cache$", { Feb: 1, f: 1 }); + var sza = void 0; + function LK() { + sza || (sza = new KK().a()); + return sza; + } + function MK() { + this.fM = false; + this.Mka = this.y1 = this.CS = null; + this.i9 = false; + this.cna = this.Xka = 0; + } + MK.prototype = new u7(); + MK.prototype.constructor = MK; + MK.prototype.a = function() { + tza = this; + this.CS = (this.fM = !!(ba.ArrayBuffer && ba.Int32Array && ba.Float32Array && ba.Float64Array)) ? new ba.ArrayBuffer(8) : null; + this.y1 = this.fM ? new ba.Int32Array(this.CS, 0, 2) : null; + this.fM && new ba.Float32Array(this.CS, 0, 2); + this.Mka = this.fM ? new ba.Float64Array(this.CS, 0, 1) : null; + if (this.fM) + this.y1[0] = 16909060, a10 = 1 === (new ba.Int8Array(this.CS, 0, 8)[0] | 0); + else + var a10 = true; + this.Xka = (this.i9 = a10) ? 0 : 1; + this.cna = this.i9 ? 1 : 0; + return this; + }; + function oaa(a10, b10) { + var c10 = b10 | 0; + if (c10 === b10 && -Infinity !== 1 / b10) + return c10; + if (a10.fM) + a10.Mka[0] = b10, a10 = new qa().Sc(a10.y1[a10.cna] | 0, a10.y1[a10.Xka] | 0); + else { + if (b10 !== b10) + a10 = false, b10 = 2047, c10 = +ba.Math.pow(2, 51); + else if (Infinity === b10 || -Infinity === b10) + a10 = 0 > b10, b10 = 2047, c10 = 0; + else if (0 === b10) + a10 = -Infinity === 1 / b10, c10 = b10 = 0; + else { + var e10 = (a10 = 0 > b10) ? -b10 : b10; + if (e10 >= +ba.Math.pow(2, -1022)) { + b10 = +ba.Math.pow(2, 52); + c10 = +ba.Math.log(e10) / 0.6931471805599453; + c10 = +ba.Math.floor(c10) | 0; + c10 = 1023 > c10 ? c10 : 1023; + var f10 = +ba.Math.pow(2, c10); + f10 > e10 && (c10 = -1 + c10 | 0, f10 /= 2); + f10 = e10 / f10 * b10; + e10 = +ba.Math.floor(f10); + f10 -= e10; + e10 = 0.5 > f10 ? e10 : 0.5 < f10 ? 1 + e10 : 0 !== e10 % 2 ? 1 + e10 : e10; + 2 <= e10 / b10 && (c10 = 1 + c10 | 0, e10 = 1); + 1023 < c10 ? (c10 = 2047, e10 = 0) : (c10 = 1023 + c10 | 0, e10 -= b10); + b10 = c10; + c10 = e10; + } else + b10 = e10 / +ba.Math.pow(2, -1074), c10 = +ba.Math.floor(b10), e10 = b10 - c10, b10 = 0, c10 = 0.5 > e10 ? c10 : 0.5 < e10 ? 1 + c10 : 0 !== c10 % 2 ? 1 + c10 : c10; + } + c10 = +c10; + a10 = new qa().Sc(c10 | 0, (a10 ? -2147483648 : 0) | (b10 | 0) << 20 | c10 / 4294967296 | 0); + } + return a10.od ^ a10.Ud; + } + MK.prototype.$classData = r8({ Meb: 0 }, false, "scala.scalajs.runtime.Bits$", { Meb: 1, f: 1 }); + var tza = void 0; + function paa() { + tza || (tza = new MK().a()); + return tza; + } + function NK() { + this.xa = false; + } + NK.prototype = new u7(); + NK.prototype.constructor = NK; + function Ed(a10, b10, c10) { + return b10.substring((b10.length | 0) - (c10.length | 0) | 0) === c10; + } + NK.prototype.a = function() { + return this; + }; + function Iu(a10, b10) { + a10 = b10.length | 0; + for (var c10 = ja(Ja(Na), [a10]), e10 = 0; e10 < a10; ) + c10.n[e10] = 65535 & (b10.charCodeAt(e10) | 0), e10 = 1 + e10 | 0; + return c10; + } + function Mc(a10, b10, c10) { + if (null === b10) + throw new sf().a(); + a10 = Hv(uf(), c10, 0); + b10 = ka(b10); + if ("" === b10) + b10 = ha(Ja(ma), [""]); + else { + c10 = Iv(a10, b10, b10.length | 0); + a10 = []; + for (var e10 = 0, f10 = 0; 2147483646 > f10 && Jv(c10); ) { + if (0 !== c10.xw()) { + var g10 = c10.Ms(); + e10 = b10.substring(e10, g10); + a10.push(null === e10 ? null : e10); + f10 = 1 + f10 | 0; + } + e10 = c10.xw(); + } + b10 = b10.substring(e10); + a10.push(null === b10 ? null : b10); + b10 = ha(Ja(ma), a10); + for (a10 = b10.n.length; 0 !== a10 && "" === b10.n[-1 + a10 | 0]; ) + a10 = -1 + a10 | 0; + a10 !== b10.n.length && (c10 = ja(Ja(ma), [a10]), Ba(b10, 0, c10, 0, a10), b10 = c10); + } + return b10; + } + function uza(a10, b10, c10, e10) { + if (null === b10) + throw new sf().a(); + a10 = Hv(uf(), c10, 0); + return rja(Iv(a10, b10, b10.length | 0), e10); + } + function qia(a10, b10, c10) { + a10 = yva(c10); + return b10.lastIndexOf(a10) | 0; + } + function wta(a10, b10, c10) { + a10 = yva(c10); + return b10.indexOf(a10) | 0; + } + function Nsa(a10, b10, c10, e10) { + a10 = c10 + e10 | 0; + if (0 > c10 || a10 < c10 || a10 > b10.n.length) + throw new Mv().a(); + for (e10 = ""; c10 !== a10; ) + e10 = "" + e10 + ba.String.fromCharCode(b10.n[c10]), c10 = 1 + c10 | 0; + return e10; + } + function OK2(a10, b10, c10) { + a10 = b10.toLowerCase(); + c10 = c10.toLowerCase(); + return a10 === c10 ? 0 : a10 < c10 ? -1 : 1; + } + function yva(a10) { + if (0 === (-65536 & a10)) + return ba.String.fromCharCode(a10); + if (0 > a10 || 1114111 < a10) + throw new Zj().a(); + a10 = -65536 + a10 | 0; + return ba.String.fromCharCode(55296 | a10 >> 10, 56320 | 1023 & a10); + } + function ta(a10, b10) { + a10 = 0; + for (var c10 = 1, e10 = -1 + (b10.length | 0) | 0; 0 <= e10; ) + a10 = a10 + ca(65535 & (b10.charCodeAt(e10) | 0), c10) | 0, c10 = ca(31, c10), e10 = -1 + e10 | 0; + return a10; + } + function PK(a10, b10) { + var c10 = new QK().a(); + if (c10.RU) + throw new RK().a(); + for (var e10 = 0, f10 = 0, g10 = a10.length | 0, h10 = 0; h10 !== g10; ) { + var k10 = a10.indexOf("%", h10) | 0; + if (0 > k10) { + vza(c10, a10.substring(h10)); + break; + } + vza(c10, a10.substring(h10, k10)); + h10 = 1 + k10 | 0; + bwa || (bwa = new BI().a()); + var l10 = bwa.Fma; + l10.lastIndex = h10; + k10 = l10.exec(a10); + if (null === k10 || (k10.index | 0) !== h10) + throw c10 = h10 === g10 ? "%" : a10.substring(h10, 1 + h10 | 0), new SK().e(c10); + h10 = l10.lastIndex | 0; + l10 = 65535 & (a10.charCodeAt(-1 + h10 | 0) | 0); + for (var m10, p10 = k10[2], t10 = 90 >= l10 ? 256 : 0, v10 = p10.length | 0, A10 = 0; A10 !== v10; ) { + m10 = 65535 & (p10.charCodeAt(A10) | 0); + switch (m10) { + case 45: + var D10 = 1; + break; + case 35: + D10 = 2; + break; + case 43: + D10 = 4; + break; + case 32: + D10 = 8; + break; + case 48: + D10 = 16; + break; + case 44: + D10 = 32; + break; + case 40: + D10 = 64; + break; + case 60: + D10 = 128; + break; + default: + throw new x7().d(gc(m10)); + } + if (0 !== (t10 & D10)) + throw new TK().e(ba.String.fromCharCode(m10)); + t10 |= D10; + A10 = 1 + A10 | 0; + } + m10 = t10; + v10 = wza(k10[3], -1); + t10 = wza(k10[4], -1); + if (37 === l10 || 110 === l10) + k10 = null; + else { + if (0 !== (1 & m10) && 0 > v10) + throw new UK().e("%" + k10[0]); + 0 !== (128 & m10) ? p10 = f10 : (p10 = wza(k10[1], 0), p10 = 0 === p10 ? e10 = 1 + e10 | 0 : 0 > p10 ? f10 : p10); + if (0 >= p10 || p10 > b10.n.length) { + c10 = ba.String.fromCharCode(l10); + if (0 > ("bBhHsHcCdoxXeEgGfn%".indexOf(c10) | 0)) + throw new SK().e(c10); + throw new VK().e("%" + k10[0]); + } + f10 = p10; + k10 = b10.n[-1 + p10 | 0]; + } + p10 = c10; + A10 = k10; + D10 = l10; + k10 = m10; + l10 = v10; + v10 = t10; + switch (D10) { + case 98: + case 66: + 0 !== (126 & k10) && WK(k10, 126, D10); + XK(p10, k10, l10, v10, false === A10 || null === A10 ? "false" : "true"); + break; + case 104: + case 72: + 0 !== (126 & k10) && WK(k10, 126, D10); + t10 = null === A10 ? "null" : (+(sa(A10) >>> 0)).toString(16); + XK(p10, k10, l10, v10, t10); + break; + case 115: + case 83: + A10 && A10.$classData && A10.$classData.ge.Bhb ? (0 !== (124 & k10) && WK(k10, 124, D10), A10.zhb(p10, (0 !== (1 & k10) ? 1 : 0) | (0 !== (2 & k10) ? 4 : 0) | (0 !== (256 & k10) ? 2 : 0), l10, v10)) : (0 !== (126 & k10) && WK(k10, 126, D10), XK(p10, k10, l10, v10, "" + A10)); + break; + case 99: + case 67: + 0 !== (126 & k10) && WK(k10, 126, D10); + if (0 <= v10) + throw new YK().ue(v10); + if (A10 instanceof Jj) + XK(p10, k10, l10, -1, ba.String.fromCharCode(null === A10 ? 0 : A10.r)); + else if (Ca(A10)) { + t10 = A10 | 0; + if (!(0 <= t10 && 1114111 >= t10)) + throw new ZK().ue(t10); + t10 = 65536 > t10 ? ba.String.fromCharCode(t10) : ba.String.fromCharCode(-64 + (t10 >> 10) | 55296, 56320 | 1023 & t10); + XK(p10, k10, l10, -1, t10); + } else + $K(p10, A10, k10, l10, v10, D10); + break; + case 100: + 0 !== (2 & k10) && WK(k10, 2, D10); + 17 !== (17 & k10) && 12 !== (12 & k10) || aL(k10); + if (0 <= v10) + throw new YK().ue(v10); + Ca(A10) ? xza(p10, k10, l10, "" + (A10 | 0)) : A10 instanceof qa ? (v10 = Da(A10), t10 = v10.od, v10 = v10.Ud, xza(p10, k10, l10, yza(Ea(), t10, v10))) : $K( + p10, + A10, + k10, + l10, + v10, + D10 + ); + break; + case 111: + 0 !== (108 & k10) && WK(k10, 108, D10); + 17 === (17 & k10) && aL(k10); + if (0 <= v10) + throw new YK().ue(v10); + t10 = 0 !== (2 & k10) ? "0" : ""; + Ca(A10) ? (v10 = (+((A10 | 0) >>> 0)).toString(8), zza(p10, k10, l10, t10, v10)) : A10 instanceof qa ? (v10 = Da(A10), A10 = v10.od, m10 = v10.Ud, UD(), v10 = 1073741823 & A10, D10 = 1073741823 & ((A10 >>> 30 | 0) + (m10 << 2) | 0), A10 = m10 >>> 28 | 0, 0 !== A10 ? (A10 = (+(A10 >>> 0)).toString(8), m10 = (+(D10 >>> 0)).toString(8), D10 = "0000000000".substring(m10.length | 0), v10 = (+(v10 >>> 0)).toString(8), v10 = A10 + ("" + D10 + m10) + ("" + "0000000000".substring(v10.length | 0) + v10)) : 0 !== D10 ? (A10 = (+(D10 >>> 0)).toString(8), v10 = (+(v10 >>> 0)).toString(8), v10 = A10 + ("" + "0000000000".substring(v10.length | 0) + v10)) : v10 = (+(v10 >>> 0)).toString(8), zza(p10, k10, l10, t10, v10)) : $K(p10, A10, k10, l10, v10, D10); + break; + case 120: + case 88: + 0 !== (108 & k10) && WK(k10, 108, D10); + 17 === (17 & k10) && aL(k10); + if (0 <= v10) + throw new YK().ue(v10); + t10 = 0 === (2 & k10) ? "" : 0 !== (256 & k10) ? "0X" : "0x"; + Ca(A10) ? (v10 = (+((A10 | 0) >>> 0)).toString(16), zza(p10, k10, l10, t10, bL(k10, v10))) : A10 instanceof qa ? (v10 = Da(A10), A10 = v10.od, m10 = v10.Ud, UD(), v10 = k10, 0 !== m10 ? (m10 = (+(m10 >>> 0)).toString(16), A10 = (+(A10 >>> 0)).toString(16), A10 = m10 + ("" + "00000000".substring(A10.length | 0) + A10)) : A10 = (+(A10 >>> 0)).toString(16), zza(p10, v10, l10, t10, bL(k10, A10))) : $K( + p10, + A10, + k10, + l10, + v10, + D10 + ); + break; + case 101: + case 69: + 0 !== (32 & k10) && WK(k10, 32, D10); + 17 !== (17 & k10) && 12 !== (12 & k10) || aL(k10); + "number" === typeof A10 ? (t10 = +A10, t10 !== t10 || Infinity === t10 || -Infinity === t10 ? Aza(p10, k10, l10, t10) : xza(p10, k10, l10, Bza(t10, 0 <= v10 ? v10 : 6, 0 !== (2 & k10)))) : $K(p10, A10, k10, l10, v10, D10); + break; + case 103: + case 71: + 0 !== (2 & k10) && WK(k10, 2, D10); + 17 !== (17 & k10) && 12 !== (12 & k10) || aL(k10); + "number" === typeof A10 ? (A10 = +A10, A10 !== A10 || Infinity === A10 || -Infinity === A10 ? Aza(p10, k10, l10, A10) : (t10 = k10, m10 = 0 <= v10 ? v10 : 6, k10 = 0 !== (2 & k10), v10 = +ba.Math.abs(A10), m10 = 0 === m10 ? 1 : m10, 1e-4 <= v10 && v10 < +ba.Math.pow(10, m10) ? (D10 = void 0 !== ba.Math.log10 ? +ba.Math.log10(v10) : +ba.Math.log(v10) / 2.302585092994046, D10 = Aa(+ba.Math.ceil(D10)), v10 = +ba.Math.pow(10, D10) <= v10 ? 1 + D10 | 0 : D10, v10 = m10 - v10 | 0, k10 = Cza(A10, 0 < v10 ? v10 : 0, k10)) : k10 = Bza(A10, -1 + m10 | 0, k10), xza(p10, t10, l10, k10))) : $K(p10, A10, k10, l10, v10, D10); + break; + case 102: + 17 !== (17 & k10) && 12 !== (12 & k10) || aL(k10); + "number" === typeof A10 ? (t10 = +A10, t10 !== t10 || Infinity === t10 || -Infinity === t10 ? Aza(p10, k10, l10, t10) : xza(p10, k10, l10, Cza(t10, 0 <= v10 ? v10 : 6, 0 !== (2 & k10)))) : $K(p10, A10, k10, l10, v10, D10); + break; + case 37: + if (0 !== (254 & k10)) + throw new cL().e(Dza(k10)); + if (0 <= v10) + throw new YK().ue(v10); + if (0 !== (1 & k10) && 0 > l10) + throw new UK().e("%-%"); + Eza(p10, k10, l10, "%"); + break; + case 110: + if (0 !== (255 & k10)) + throw new cL().e(Dza(k10)); + if (0 <= v10) + throw new YK().ue(v10); + if (0 <= l10) + throw new dL().ue(l10); + vza(p10, "\n"); + break; + default: + throw new SK().e(ba.String.fromCharCode(D10)); + } + } + a10 = c10.t(); + c10.US(); + return a10; + } + function Bx(a10, b10, c10, e10) { + if (null === b10) + throw new sf().a(); + a10 = Hv(uf(), c10, 0); + b10 = Iv(a10, b10, b10.length | 0); + Fza(b10); + for (a10 = new Pj().a(); Jv(b10); ) + Kia(b10, a10, e10); + Eda(b10, a10); + return a10.t(); + } + NK.prototype.$classData = r8({ Peb: 0 }, false, "scala.scalajs.runtime.RuntimeString$", { Peb: 1, f: 1 }); + var Gza = void 0; + function ua() { + Gza || (Gza = new NK().a()); + return Gza; + } + function eL() { + this.vma = false; + this.Cja = this.Pja = this.Oja = null; + this.xa = 0; + } + eL.prototype = new u7(); + eL.prototype.constructor = eL; + eL.prototype.a = function() { + return this; + }; + function Hza(a10) { + return (a10.stack + "\n").replace(fL("^[\\s\\S]+?\\s+at\\s+"), " at ").replace(gL("^\\s+(at eval )?at\\s+", "gm"), "").replace(gL("^([^\\(]+?)([\\n])", "gm"), "{anonymous}() ($1)$2").replace(gL("^Object.\\s*\\(([^\\)]+)\\)", "gm"), "{anonymous}() ($1)").replace(gL("^([^\\(]+|\\{anonymous\\}\\(\\)) \\((.+)\\)$", "gm"), "$1@$2").split("\n").slice(0, -1); + } + function Iza(a10) { + 0 === (8 & a10.xa) << 24 >> 24 && 0 === (8 & a10.xa) << 24 >> 24 && (a10.Cja = ba.Object.keys(Jza(a10)), a10.xa = (8 | a10.xa) << 24 >> 24); + return a10.Cja; + } + function Kza(a10) { + if (0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24) { + for (var b10 = { O: "java_lang_Object", T: "java_lang_String", V: "scala_Unit", Z: "scala_Boolean", C: "scala_Char", B: "scala_Byte", S: "scala_Short", I: "scala_Int", J: "scala_Long", F: "scala_Float", D: "scala_Double" }, c10 = 0; 22 >= c10; ) + 2 <= c10 && (b10["T" + c10] = "scala_Tuple" + c10), b10["F" + c10] = "scala_Function" + c10, c10 = 1 + c10 | 0; + a10.Oja = b10; + a10.xa = (2 | a10.xa) << 24 >> 24; + } + return a10.Oja; + } + function Qza(a10, b10) { + var c10 = fL("^(?:Object\\.|\\[object Object\\]\\.)?(?:ScalaJS\\.c\\.|\\$c_)([^\\.]+)(?:\\.prototype)?\\.([^\\.]+)$"), e10 = fL("^(?:Object\\.|\\[object Object\\]\\.)?(?:ScalaJS\\.(?:s|f)\\.|\\$(?:s|f)_)((?:_[^_]|[^_])+)__([^\\.]+)$"), f10 = fL("^(?:Object\\.|\\[object Object\\]\\.)?(?:ScalaJS\\.m\\.|\\$m_)([^\\.]+)$"), g10 = false; + c10 = c10.exec(b10); + null === c10 && (c10 = e10.exec(b10), null === c10 && (c10 = f10.exec(b10), g10 = true)); + if (null !== c10) { + b10 = c10[1]; + if (void 0 === b10) + throw new iL().e("undefined.get"); + b10 = 36 === (65535 & (b10.charCodeAt(0) | 0)) ? b10.substring(1) : b10; + e10 = Kza(a10); + if (LK().aC.call(e10, b10)) { + a10 = Kza(a10); + if (!LK().aC.call(a10, b10)) + throw new iL().e("key not found: " + b10); + a10 = a10[b10]; + } else + a: + for (f10 = 0; ; ) + if (f10 < (Iza(a10).length | 0)) { + e10 = Iza(a10)[f10]; + if (0 <= (b10.length | 0) && b10.substring(0, e10.length | 0) === e10) { + a10 = Jza(a10); + if (!LK().aC.call(a10, e10)) + throw new iL().e("key not found: " + e10); + a10 = "" + a10[e10] + b10.substring(e10.length | 0); + break a; + } + f10 = 1 + f10 | 0; + } else { + a10 = 0 <= (b10.length | 0) && "L" === b10.substring(0, 1) ? b10.substring(1) : b10; + break a; + } + a10 = a10.split("_").join(".").split("$und").join("_"); + if (g10) + g10 = ""; + else { + g10 = c10[2]; + if (void 0 === g10) + throw new iL().e("undefined.get"); + 0 <= (g10.length | 0) && "init___" === g10.substring(0, 7) ? g10 = "" : (c10 = g10.indexOf("__") | 0, g10 = 0 > c10 ? g10 : g10.substring(0, c10)); + } + return new R6().M(a10, g10); + } + return new R6().M("", b10); + } + function Rza(a10) { + var b10 = gL("Line (\\d+).*script (?:in )?(\\S+)", "i"); + a10 = a10.message.split("\n"); + for (var c10 = [], e10 = 2, f10 = a10.length | 0; e10 < f10; ) { + var g10 = b10.exec(a10[e10]); + if (null !== g10) { + var h10 = g10[2]; + if (void 0 === h10) + throw new iL().e("undefined.get"); + g10 = g10[1]; + if (void 0 === g10) + throw new iL().e("undefined.get"); + c10.push("{anonymous}()@" + h10 + ":" + g10); + } + e10 = 2 + e10 | 0; + } + return c10; + } + function Jza(a10) { + 0 === (4 & a10.xa) << 24 >> 24 && 0 === (4 & a10.xa) << 24 >> 24 && (a10.Pja = { sjsr_: "scala_scalajs_runtime_", sjs_: "scala_scalajs_", sci_: "scala_collection_immutable_", scm_: "scala_collection_mutable_", scg_: "scala_collection_generic_", sc_: "scala_collection_", sr_: "scala_runtime_", s_: "scala_", jl_: "java_lang_", ju_: "java_util_" }, a10.xa = (4 | a10.xa) << 24 >> 24); + return a10.Pja; + } + eL.prototype.$classData = r8({ Qeb: 0 }, false, "scala.scalajs.runtime.StackTrace$", { Qeb: 1, f: 1 }); + var Sza = void 0; + function jL() { + } + jL.prototype = new u7(); + jL.prototype.constructor = jL; + jL.prototype.a = function() { + return this; + }; + function gL(a10, b10) { + Tza || (Tza = new jL().a()); + return new ba.RegExp(a10, b10); + } + function fL(a10) { + Tza || (Tza = new jL().a()); + return new ba.RegExp(a10); + } + jL.prototype.$classData = r8({ Reb: 0 }, false, "scala.scalajs.runtime.StackTrace$StringRE$", { Reb: 1, f: 1 }); + var Tza = void 0; + function kL() { + } + kL.prototype = new u7(); + kL.prototype.constructor = kL; + kL.prototype.a = function() { + return this; + }; + function mb(a10, b10) { + return b10 instanceof EK ? b10.Px : b10; + } + function Ph(a10, b10) { + return b10 instanceof CF ? b10 : new EK().d(b10); + } + kL.prototype.$classData = r8({ Seb: 0 }, false, "scala.scalajs.runtime.package$", { Seb: 1, f: 1 }); + var Uza = void 0; + function E6() { + Uza || (Uza = new kL().a()); + return Uza; + } + function lL() { + } + lL.prototype = new u7(); + lL.prototype.constructor = lL; + lL.prototype.a = function() { + return this; + }; + function Vza(a10, b10) { + if (b10 instanceof Jj) + return a10.r === b10.r; + if (Wza(b10)) { + if ("number" === typeof b10) + return +b10 === a10.r; + if (b10 instanceof qa) { + b10 = Da(b10); + var c10 = b10.Ud; + a10 = a10.r; + return b10.od === a10 && c10 === a10 >> 31; + } + return null === b10 ? null === a10 : ra(b10, a10); + } + return null === a10 && null === b10; + } + function Va(a10, b10, c10) { + if (b10 === c10) + c10 = true; + else if (Wza(b10)) + a: + if (Wza(c10)) + c10 = Xza(b10, c10); + else { + if (c10 instanceof Jj) { + if ("number" === typeof b10) { + c10 = +b10 === c10.r; + break a; + } + if (b10 instanceof qa) { + a10 = Da(b10); + b10 = a10.Ud; + c10 = c10.r; + c10 = a10.od === c10 && b10 === c10 >> 31; + break a; + } + } + c10 = null === b10 ? null === c10 : ra(b10, c10); + } + else + c10 = b10 instanceof Jj ? Vza(b10, c10) : null === b10 ? null === c10 : ra(b10, c10); + return c10; + } + function Xza(a10, b10) { + if ("number" === typeof a10) { + a10 = +a10; + if ("number" === typeof b10) + return a10 === +b10; + if (b10 instanceof qa) { + var c10 = Da(b10); + b10 = c10.od; + c10 = c10.Ud; + return a10 === SD(Ea(), b10, c10); + } + return b10 instanceof mL ? b10.h(a10) : false; + } + if (a10 instanceof qa) { + c10 = Da(a10); + a10 = c10.od; + c10 = c10.Ud; + if (b10 instanceof qa) { + b10 = Da(b10); + var e10 = b10.Ud; + return a10 === b10.od && c10 === e10; + } + return "number" === typeof b10 ? (b10 = +b10, SD(Ea(), a10, c10) === b10) : b10 instanceof mL ? b10.h(new qa().Sc(a10, c10)) : false; + } + return null === a10 ? null === b10 : ra(a10, b10); + } + lL.prototype.$classData = r8({ Veb: 0 }, false, "scala.runtime.BoxesRunTime$", { Veb: 1, f: 1 }); + var Yza = void 0; + function Wa() { + Yza || (Yza = new lL().a()); + return Yza; + } + var Zza = r8({ afb: 0 }, false, "scala.runtime.Null$", { afb: 1, f: 1 }); + function nL() { + } + nL.prototype = new u7(); + nL.prototype.constructor = nL; + nL.prototype.a = function() { + return this; + }; + function SJ(a10, b10) { + if (xda(b10, 1) || yaa(b10, 1) || Baa(b10, 1) || zaa(b10, 1) || Aaa(b10, 1) || vaa(b10, 1) || waa(b10, 1) || xaa(b10, 1) || uaa(b10, 1) || $za(b10)) + return b10.n.length; + if (null === b10) + throw new sf().a(); + throw new x7().d(b10); + } + function aAa(a10, b10, c10, e10) { + if (xda(b10, 1)) + b10.n[c10] = e10; + else if (yaa(b10, 1)) + b10.n[c10] = e10 | 0; + else if (Baa(b10, 1)) + b10.n[c10] = +e10; + else if (zaa(b10, 1)) + b10.n[c10] = Da(e10); + else if (Aaa(b10, 1)) + b10.n[c10] = +e10; + else if (vaa(b10, 1)) + b10.n[c10] = null === e10 ? 0 : e10.r; + else if (waa(b10, 1)) + b10.n[c10] = e10 | 0; + else if (xaa(b10, 1)) + b10.n[c10] = e10 | 0; + else if (uaa(b10, 1)) + b10.n[c10] = !!e10; + else if ($za(b10)) + b10.n[c10] = void 0; + else { + if (null === b10) + throw new sf().a(); + throw new x7().d(b10); + } + } + function V5(a10, b10) { + a10 = new oL(); + a10.$qa = b10; + a10.MS = 0; + a10.zja = b10.E(); + return UJ(a10, b10.H() + "(", ",", ")"); + } + function bAa(a10, b10, c10) { + if (xda(b10, 1) || yaa(b10, 1) || Baa(b10, 1) || zaa(b10, 1) || Aaa(b10, 1)) + return b10.n[c10]; + if (vaa(b10, 1)) + return gc(b10.n[c10]); + if (waa(b10, 1) || xaa(b10, 1) || uaa(b10, 1) || $za(b10)) + return b10.n[c10]; + if (null === b10) + throw new sf().a(); + throw new x7().d(b10); + } + nL.prototype.$classData = r8({ cfb: 0 }, false, "scala.runtime.ScalaRunTime$", { cfb: 1, f: 1 }); + var cAa = void 0; + function W5() { + cAa || (cAa = new nL().a()); + return cAa; + } + function dAa() { + } + dAa.prototype = new u7(); + dAa.prototype.constructor = dAa; + d7 = dAa.prototype; + d7.a = function() { + return this; + }; + d7.mP = function(a10, b10) { + b10 = ca(-862048943, b10); + b10 = ca(461845907, b10 << 15 | b10 >>> 17 | 0); + return a10 ^ b10; + }; + function eAa(a10, b10) { + a10 = Aa(b10); + if (a10 === b10) + return a10; + var c10 = Ea(); + a10 = Zsa(c10, b10); + c10 = c10.Wj; + return SD(Ea(), a10, c10) === b10 ? a10 ^ c10 : oaa(paa(), b10); + } + function NJ(a10, b10) { + return null === b10 ? 0 : "number" === typeof b10 ? eAa(0, +b10) : b10 instanceof qa ? (a10 = Da(b10), pL(0, new qa().Sc(a10.od, a10.Ud))) : sa(b10); + } + d7.Ga = function(a10, b10) { + a10 = this.mP(a10, b10); + return -430675100 + ca(5, a10 << 13 | a10 >>> 19 | 0) | 0; + }; + function pL(a10, b10) { + a10 = b10.od; + b10 = b10.Ud; + return b10 === a10 >> 31 ? a10 : a10 ^ b10; + } + d7.fe = function(a10, b10) { + a10 ^= b10; + a10 = ca(-2048144789, a10 ^ (a10 >>> 16 | 0)); + a10 = ca(-1028477387, a10 ^ (a10 >>> 13 | 0)); + return a10 ^ (a10 >>> 16 | 0); + }; + d7.$classData = r8({ efb: 0 }, false, "scala.runtime.Statics$", { efb: 1, f: 1 }); + var fAa = void 0; + function OJ() { + fAa || (fAa = new dAa().a()); + return fAa; + } + function qL() { + } + qL.prototype = new u7(); + qL.prototype.constructor = qL; + qL.prototype.a = function() { + return this; + }; + qL.prototype.un = function() { + return kk(); + }; + qL.prototype.$classData = r8({ dra: 0 }, false, "amf.AMFStyle$", { dra: 1, f: 1, hga: 1 }); + var gAa = void 0; + function hk() { + gAa || (gAa = new qL().a()); + return gAa; + } + function rL() { + this.ea = null; + } + rL.prototype = new u7(); + rL.prototype.constructor = rL; + rL.prototype.R3 = function(a10, b10) { + return sfa(iq(), a10, b10); + }; + rL.prototype.a = function() { + hAa = this; + this.ea = nv().ea; + return this; + }; + rL.prototype.O3 = function(a10) { + return gp(bp()).b$(a10); + }; + rL.prototype.HU = function() { + fea || (fea = new Bk().a()); + fea.fda(this.ea); + var a10 = ab(), b10 = Po().fp(), c10 = ab().Yo(); + return ll(a10, b10, c10).Ra(); + }; + rL.prototype.registerPlugin = function(a10) { + Oo(Po(), a10); + }; + rL.prototype.registerNamespace = function(a10, b10) { + return F6().yu.Ue(a10, new sL().e(b10)).na(); + }; + rL.prototype.emitShapesGraph = function(a10) { + return this.O3(a10); + }; + rL.prototype.loadValidationProfile = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return this.R3(a10, e10[0]); + case 0: + return b10 = lp(pp()), sfa(iq(), a10, b10); + default: + throw "No matching overload"; + } + }; + rL.prototype.validateResolved = function(a10, b10, c10) { + for (var e10 = arguments.length | 0, f10 = 3, g10 = []; f10 < e10; ) + g10.push(arguments[f10]), f10 = f10 + 1 | 0; + switch (g10.length | 0) { + case 1: + return e10 = g10[0], gq(iq(), a10, b10, c10, e10, true); + case 0: + return e10 = lp(pp()), gq(iq(), a10, b10, c10, e10, true); + default: + throw "No matching overload"; + } + }; + rL.prototype.validate = function(a10, b10, c10) { + for (var e10 = arguments.length | 0, f10 = 3, g10 = []; f10 < e10; ) + g10.push(arguments[f10]), f10 = f10 + 1 | 0; + switch (g10.length | 0) { + case 1: + return e10 = g10[0], gq(iq(), a10, b10, c10, e10, false); + case 0: + return e10 = lp(pp()), gq(iq(), a10, b10, c10, e10, false); + default: + throw "No matching overload"; + } + }; + rL.prototype.resolver = function(a10) { + return new Kp().e(a10); + }; + rL.prototype.generator = function(a10, b10) { + return new zp().Hc(a10, b10); + }; + rL.prototype.parser = function(a10, b10) { + return new Wo().qv(a10, b10, y7()); + }; + rL.prototype.init = function() { + return this.HU(); + }; + rL.prototype.$classData = r8({ gra: 0 }, false, "amf.Core$", { gra: 1, f: 1, ib: 1 }); + var hAa = void 0; + function No() { + hAa || (hAa = new rL().a()); + return hAa; + } + function tL() { + } + tL.prototype = new u7(); + tL.prototype.constructor = tL; + tL.prototype.a = function() { + return this; + }; + tL.prototype.un = function() { + return lk(); + }; + tL.prototype.$classData = r8({ ira: 0 }, false, "amf.OASStyle$", { ira: 1, f: 1, hga: 1 }); + var iAa = void 0; + function Ub() { + iAa || (iAa = new tL().a()); + return iAa; + } + function uL() { + } + uL.prototype = new u7(); + uL.prototype.constructor = uL; + uL.prototype.a = function() { + return this; + }; + uL.prototype.un = function() { + return ok2(); + }; + uL.prototype.$classData = r8({ pra: 0 }, false, "amf.RAMLStyle$", { pra: 1, f: 1, hga: 1 }); + var jAa = void 0; + function Tb() { + jAa || (jAa = new uL().a()); + return jAa; + } + function vL() { + } + vL.prototype = new u7(); + vL.prototype.constructor = vL; + vL.prototype.zc = function(a10) { + var b10 = new wL(); + b10.BN = a10; + b10.Li = a10.A; + a10 = ab(); + var c10 = b10.Li, e10 = ab().QM(); + b10.A = bb(a10, c10, e10).Ra(); + return b10; + }; + vL.prototype.$classData = r8({ qsa: 0 }, false, "amf.client.convert.FieldConverter$AnyFieldMatcher$", { qsa: 1, f: 1, Fc: 1 }); + function xL() { + } + xL.prototype = new u7(); + xL.prototype.constructor = xL; + xL.prototype.zc = function(a10) { + return yL(a10); + }; + xL.prototype.$classData = r8({ rsa: 0 }, false, "amf.client.convert.FieldConverter$BoolFieldMatcher$", { rsa: 1, f: 1, Fc: 1 }); + function zL() { + } + zL.prototype = new u7(); + zL.prototype.constructor = zL; + zL.prototype.zc = function(a10) { + return AL(a10); + }; + zL.prototype.$classData = r8({ ssa: 0 }, false, "amf.client.convert.FieldConverter$DoubleFieldMatcher$", { ssa: 1, f: 1, Fc: 1 }); + function BL() { + } + BL.prototype = new u7(); + BL.prototype.constructor = BL; + BL.prototype.zc = function(a10) { + return CL(a10); + }; + BL.prototype.$classData = r8({ tsa: 0 }, false, "amf.client.convert.FieldConverter$IntFieldMatcher$", { tsa: 1, f: 1, Fc: 1 }); + function DL() { + } + DL.prototype = new u7(); + DL.prototype.constructor = DL; + DL.prototype.zc = function(a10) { + return gb(a10); + }; + DL.prototype.$classData = r8({ usa: 0 }, false, "amf.client.convert.FieldConverter$StrFieldMatcher$", { usa: 1, f: 1, Fc: 1 }); + function EL() { + this.ea = null; + } + EL.prototype = new u7(); + EL.prototype.constructor = EL; + EL.prototype.a = function() { + kAa = this; + this.ea = nv().ea; + return this; + }; + function lp(a10) { + var b10 = ab(); + a10 = a10.ea.qba(); + var c10 = lAa(); + b10 = Ak(b10, a10, c10).Ra(); + return mAa(new FL().a(), b10); + } + EL.prototype.apply = function() { + return lp(this); + }; + EL.prototype.$classData = r8({ Ita: 0 }, false, "amf.client.environment.DefaultEnvironment$", { Ita: 1, f: 1, ib: 1 }); + var kAa = void 0; + function pp() { + kAa || (kAa = new EL().a()); + return kAa; + } + function GL() { + this.pba = null; + } + GL.prototype = new u7(); + GL.prototype.constructor = GL; + GL.prototype.sF = function(a10) { + return this.vB(a10); + }; + GL.prototype.vB = function(a10) { + return this.pba.fetch(a10); + }; + GL.prototype.sQ = function(a10) { + return this.aG(a10); + }; + GL.prototype.aG = function(a10) { + return !!this.pba.accepts(a10); + }; + GL.prototype.accepts = function(a10) { + return this.sQ(a10); + }; + GL.prototype.fetch = function(a10) { + return this.sF(a10); + }; + GL.prototype.$classData = r8({ Kta: 0 }, false, "amf.client.environment.Environment$$anon$1", { Kta: 1, f: 1, X6: 1 }); + function HL() { + this.Hoa = null; + } + HL.prototype = new u7(); + HL.prototype.constructor = HL; + HL.prototype.sF = function(a10) { + return this.vB(a10); + }; + HL.prototype.vB = function(a10) { + return this.Hoa.fetch(a10); + }; + HL.prototype.fetch = function(a10) { + return this.sF(a10); + }; + HL.prototype.$classData = r8({ Lta: 0 }, false, "amf.client.environment.Environment$$anon$2", { Lta: 1, f: 1, Egb: 1 }); + function Ro() { + this.Ba = null; + } + Ro.prototype = new u7(); + Ro.prototype.constructor = Ro; + Ro.prototype.d = function(a10) { + this.Ba = a10; + return this; + }; + Ro.prototype.Eoa = function(a10, b10, c10, e10, f10, g10, h10) { + (0, this.Ba)(a10, b10, c10, e10, f10, g10, h10); + }; + Ro.prototype.$classData = r8({ Nta: 0 }, false, "amf.client.handler.ErrorHandler$$$Lambda$1", { Nta: 1, f: 1, rwa: 1 }); + function IL(a10, b10) { + var c10 = a10.Wr(); + ab(); + ab().jr(); + b10 = b10.Oc(); + var e10 = Af().Ic; + ig(c10, e10, b10); + return a10; + } + function JL(a10) { + var b10 = ab(); + a10 = a10.Wr().tk(); + var c10 = ab().jr(); + return Ak(b10, a10, c10).Ra(); + } + function KL(a10, b10) { + var c10 = a10.Wr(), e10 = ab(), f10 = ab().jr(); + b10 = uk(tk(e10, b10, f10)); + e10 = Af().Ic; + Bf(c10, e10, b10); + return a10; + } + function LL(a10, b10) { + var c10 = a10.qk(); + ab(); + ab().jr(); + b10 = b10.Oc(); + var e10 = Jk().nb; + Vd(c10, e10, b10); + return a10; + } + function nAa(a10) { + ab(); + a10 = a10.qk().qe(); + return cea(ab().jr(), a10); + } + function VH() { + Wo.call(this); + } + VH.prototype = new Xo(); + VH.prototype.constructor = VH; + VH.prototype.a = function() { + VH.prototype.Uj.call(this, y7()); + return this; + }; + VH.prototype.Rq = function(a10) { + VH.prototype.Uj.call(this, new z7().d(a10)); + }; + VH.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, "AMF Graph", "application/ld+json", a10); + sq(qq(), lq()); + return this; + }; + VH.prototype.$classData = r8({ Mva: 0 }, false, "amf.client.parse.AmfGraphParser", { Mva: 1, Cx: 1, f: 1 }); + function ML() { + Wo.call(this); + } + ML.prototype = new Xo(); + ML.prototype.constructor = ML; + d7 = ML.prototype; + d7.a = function() { + ML.prototype.Uq.call(this, "application/yaml", y7()); + return this; + }; + d7.e = function(a10) { + ML.prototype.Uq.call(this, a10, y7()); + return this; + }; + d7.q7a = function(a10, b10) { + ML.prototype.Uq.call(this, a10, new z7().d(b10)); + }; + d7.Uq = function(a10, b10) { + Wo.prototype.qv.call(this, "AML 1.0", a10, b10); + sq(qq(), Ec()); + return this; + }; + d7.$classData = r8({ Nva: 0 }, false, "amf.client.parse.Aml10Parser", { Nva: 1, Cx: 1, f: 1 }); + function NL() { + Wo.call(this); + } + NL.prototype = new Xo(); + NL.prototype.constructor = NL; + NL.prototype.a = function() { + NL.prototype.Uj.call(this, y7()); + return this; + }; + NL.prototype.Rq = function(a10) { + NL.prototype.Uj.call(this, new z7().d(a10)); + }; + NL.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Vf().$, "application/amf+json", a10); + sq(qq(), OL()); + return this; + }; + NL.prototype.$classData = r8({ Ova: 0 }, false, "amf.client.parse.JsonPayloadParser", { Ova: 1, Cx: 1, f: 1 }); + function aI() { + Wo.call(this); + } + aI.prototype = new Xo(); + aI.prototype.constructor = aI; + aI.prototype.a = function() { + aI.prototype.Uj.call(this, y7()); + return this; + }; + aI.prototype.Rq = function(a10) { + aI.prototype.Uj.call(this, new z7().d(a10)); + }; + aI.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Bu().$, "application/json", a10); + sq(qq(), oAa()); + return this; + }; + aI.prototype.$classData = r8({ Pva: 0 }, false, "amf.client.parse.Oas20Parser", { Pva: 1, Cx: 1, f: 1 }); + function ZH() { + Wo.call(this); + } + ZH.prototype = new Xo(); + ZH.prototype.constructor = ZH; + ZH.prototype.a = function() { + ZH.prototype.Uj.call(this, y7()); + return this; + }; + ZH.prototype.Rq = function(a10) { + ZH.prototype.Uj.call(this, new z7().d(a10)); + }; + ZH.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Bu().$, "application/yaml", a10); + sq(qq(), oAa()); + return this; + }; + ZH.prototype.$classData = r8({ Qva: 0 }, false, "amf.client.parse.Oas20YamlParser", { Qva: 1, Cx: 1, f: 1 }); + function fI() { + Wo.call(this); + } + fI.prototype = new Xo(); + fI.prototype.constructor = fI; + fI.prototype.a = function() { + fI.prototype.Uj.call(this, y7()); + return this; + }; + fI.prototype.Rq = function(a10) { + fI.prototype.Uj.call(this, new z7().d(a10)); + }; + fI.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Cu().$, "application/json", a10); + sq(qq(), pAa()); + return this; + }; + fI.prototype.$classData = r8({ Rva: 0 }, false, "amf.client.parse.Oas30Parser", { Rva: 1, Cx: 1, f: 1 }); + function dI() { + Wo.call(this); + } + dI.prototype = new Xo(); + dI.prototype.constructor = dI; + dI.prototype.a = function() { + dI.prototype.Uj.call(this, y7()); + return this; + }; + dI.prototype.Rq = function(a10) { + dI.prototype.Uj.call(this, new z7().d(a10)); + }; + dI.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Cu().$, "application/yaml", a10); + sq(qq(), pAa()); + return this; + }; + dI.prototype.$classData = r8({ Sva: 0 }, false, "amf.client.parse.Oas30YamlParser", { Sva: 1, Cx: 1, f: 1 }); + function jI() { + Wo.call(this); + } + jI.prototype = new Xo(); + jI.prototype.constructor = jI; + jI.prototype.a = function() { + jI.prototype.Uj.call(this, y7()); + return this; + }; + jI.prototype.Rq = function(a10) { + jI.prototype.Uj.call(this, new z7().d(a10)); + }; + jI.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Qb().$, "application/yaml", a10); + sq(qq(), qAa()); + return this; + }; + jI.prototype.$classData = r8({ Tva: 0 }, false, "amf.client.parse.Raml08Parser", { Tva: 1, Cx: 1, f: 1 }); + function nI() { + Wo.call(this); + } + nI.prototype = new Xo(); + nI.prototype.constructor = nI; + nI.prototype.a = function() { + nI.prototype.Uj.call(this, y7()); + return this; + }; + nI.prototype.Rq = function(a10) { + nI.prototype.Uj.call(this, new z7().d(a10)); + }; + nI.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Pb().$, "application/yaml", a10); + sq(qq(), rAa()); + return this; + }; + nI.prototype.$classData = r8({ Uva: 0 }, false, "amf.client.parse.Raml10Parser", { Uva: 1, Cx: 1, f: 1 }); + function PL() { + Wo.call(this); + } + PL.prototype = new Xo(); + PL.prototype.constructor = PL; + PL.prototype.a = function() { + PL.prototype.Uj.call(this, y7()); + return this; + }; + PL.prototype.Rq = function(a10) { + PL.prototype.Uj.call(this, new z7().d(a10)); + }; + PL.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Ob().$, "application/yaml", a10); + sq(qq(), rAa()); + sq(qq(), qAa()); + return this; + }; + PL.prototype.$classData = r8({ Vva: 0 }, false, "amf.client.parse.RamlParser", { Vva: 1, Cx: 1, f: 1 }); + function QL() { + Wo.call(this); + } + QL.prototype = new Xo(); + QL.prototype.constructor = QL; + QL.prototype.a = function() { + QL.prototype.Uj.call(this, y7()); + return this; + }; + QL.prototype.Rq = function(a10) { + QL.prototype.Uj.call(this, new z7().d(a10)); + }; + QL.prototype.Uj = function(a10) { + Wo.prototype.qv.call(this, Vf().$, "application/amf+yaml", a10); + sq(qq(), OL()); + return this; + }; + QL.prototype.$classData = r8({ Wva: 0 }, false, "amf.client.parse.YamlPayloadParser", { Wva: 1, Cx: 1, f: 1 }); + function rq() { + this.WB = 0; + } + rq.prototype = new u7(); + rq.prototype.constructor = rq; + function RL() { + } + RL.prototype = rq.prototype; + rq.prototype.a = function() { + this.WB = Sea().uo; + return this; + }; + rq.prototype.kna = function() { + return y7(); + }; + rq.prototype.t0 = function(a10, b10, c10, e10) { + if (b10 instanceof Zq) { + a10 = this.hI(a10, c10, e10); + if (a10.b()) + return false; + a10 = a10.c(); + b10.GI = new z7().d(a10); + return true; + } + return false; + }; + rq.prototype.Pca = function() { + return this.WB; + }; + function tq() { + } + tq.prototype = new u7(); + tq.prototype.constructor = tq; + function sAa() { + } + sAa.prototype = tq.prototype; + function pq() { + } + pq.prototype = new u7(); + pq.prototype.constructor = pq; + function tAa() { + } + tAa.prototype = pq.prototype; + function uAa(a10, b10) { + a10 = a10.x3("application/json", b10, new Wq().a(), cfa()); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.t()); + } + function SL() { + } + SL.prototype = new u7(); + SL.prototype.constructor = SL; + SL.prototype.a = function() { + return this; + }; + SL.prototype.$classData = r8({ $va: 0 }, false, "amf.client.plugins.ScalarRelaxedValidationMode$", { $va: 1, f: 1, bwa: 1 }); + var vAa = void 0; + function wp() { + vAa || (vAa = new SL().a()); + return vAa; + } + function TL() { + } + TL.prototype = new u7(); + TL.prototype.constructor = TL; + TL.prototype.a = function() { + return this; + }; + TL.prototype.$classData = r8({ awa: 0 }, false, "amf.client.plugins.StrictValidationMode$", { awa: 1, f: 1, bwa: 1 }); + var wAa = void 0; + function vp() { + wAa || (wAa = new TL().a()); + return wAa; + } + function SH() { + zp.call(this); + } + SH.prototype = new Ap(); + SH.prototype.constructor = SH; + SH.prototype.a = function() { + zp.prototype.Hc.call(this, "AMF Graph", "application/ld+json"); + sq(qq(), lq()); + return this; + }; + function xAa(a10, b10, c10, e10) { + var f10 = ab(); + c10 = Bp(Cp(), c10); + a10 = sga($ea(new Ep(), b10.Be(), a10.Hj, a10.Se, c10, new Yf().a()), e10); + b10 = ab().Yo(); + return ll(f10, a10, b10).Ra(); + } + SH.prototype.generateToBuilder = function(a10, b10) { + for (var c10 = arguments.length | 0, e10 = 2, f10 = []; e10 < c10; ) + f10.push(arguments[e10]), e10 = e10 + 1 | 0; + switch (f10.length | 0) { + case 1: + return xAa(this, a10, b10, f10[0]); + case 0: + return xAa(this, a10, new xp().a(), b10); + default: + throw "No matching overload"; + } + }; + SH.prototype.$classData = r8({ fwa: 0 }, false, "amf.client.render.AmfGraphRenderer", { fwa: 1, RA: 1, f: 1 }); + function UL() { + zp.call(this); + } + UL.prototype = new Ap(); + UL.prototype.constructor = UL; + UL.prototype.a = function() { + UL.prototype.e.call(this, "application/yaml"); + return this; + }; + UL.prototype.zy = function() { + return this.Hj; + }; + UL.prototype.e = function(a10) { + zp.prototype.Hc.call(this, "AML 1.0", a10); + sq(qq(), Ec()); + return this; + }; + Object.defineProperty(UL.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + UL.prototype.$classData = r8({ gwa: 0 }, false, "amf.client.render.Aml10Renderer", { gwa: 1, RA: 1, f: 1 }); + function VL() { + zp.call(this); + } + VL.prototype = new Ap(); + VL.prototype.constructor = VL; + VL.prototype.a = function() { + zp.prototype.Hc.call(this, Vf().$, "application/payload+json"); + sq(qq(), OL()); + return this; + }; + VL.prototype.$classData = r8({ hwa: 0 }, false, "amf.client.render.JsonPayloadRenderer", { hwa: 1, RA: 1, f: 1 }); + function WL() { + zp.call(this); + } + WL.prototype = new Ap(); + WL.prototype.constructor = WL; + WL.prototype.a = function() { + zp.prototype.Hc.call(this, Du().$, "application/ld+json"); + sq(qq(), lq()); + return this; + }; + WL.prototype.$classData = r8({ iwa: 0 }, false, "amf.client.render.JsonldRenderer", { iwa: 1, RA: 1, f: 1 }); + function YH() { + zp.call(this); + } + YH.prototype = new Ap(); + YH.prototype.constructor = YH; + YH.prototype.a = function() { + zp.prototype.Hc.call(this, Bu().$, "application/json"); + sq(qq(), oAa()); + return this; + }; + YH.prototype.$classData = r8({ jwa: 0 }, false, "amf.client.render.Oas20Renderer", { jwa: 1, RA: 1, f: 1 }); + function cI() { + zp.call(this); + } + cI.prototype = new Ap(); + cI.prototype.constructor = cI; + cI.prototype.a = function() { + zp.prototype.Hc.call(this, Cu().$, "application/json"); + sq(qq(), pAa()); + return this; + }; + cI.prototype.$classData = r8({ kwa: 0 }, false, "amf.client.render.Oas30Renderer", { kwa: 1, RA: 1, f: 1 }); + function hI() { + zp.call(this); + } + hI.prototype = new Ap(); + hI.prototype.constructor = hI; + hI.prototype.a = function() { + zp.prototype.Hc.call(this, Qb().$, "application/yaml"); + sq(qq(), qAa()); + return this; + }; + hI.prototype.$classData = r8({ lwa: 0 }, false, "amf.client.render.Raml08Renderer", { lwa: 1, RA: 1, f: 1 }); + function lI() { + zp.call(this); + } + lI.prototype = new Ap(); + lI.prototype.constructor = lI; + lI.prototype.a = function() { + zp.prototype.Hc.call(this, Pb().$, "application/yaml"); + sq(qq(), rAa()); + return this; + }; + lI.prototype.$classData = r8({ mwa: 0 }, false, "amf.client.render.Raml10Renderer", { mwa: 1, RA: 1, f: 1 }); + function XL() { + zp.call(this); + } + XL.prototype = new Ap(); + XL.prototype.constructor = XL; + XL.prototype.a = function() { + zp.prototype.Hc.call(this, Vf().$, "application/payload+yaml"); + sq(qq(), OL()); + return this; + }; + XL.prototype.$classData = r8({ pwa: 0 }, false, "amf.client.render.YamlPayloadRenderer", { pwa: 1, RA: 1, f: 1 }); + function TH() { + this.Se = null; + } + TH.prototype = new Lp(); + TH.prototype.constructor = TH; + TH.prototype.a = function() { + Kp.prototype.e.call(this, "AMF Graph"); + return this; + }; + TH.prototype.$classData = r8({ qwa: 0 }, false, "amf.client.resolve.AmfGraphResolver", { qwa: 1, gN: 1, f: 1 }); + function yp() { + this.yka = null; + } + yp.prototype = new u7(); + yp.prototype.constructor = yp; + yp.prototype.Hb = function(a10) { + this.yka = a10; + return this; + }; + yp.prototype.Eoa = function(a10, b10, c10, e10, f10, g10, h10) { + var k10 = this.yka, l10 = ab(); + c10 = yAa(Xda(l10, c10).gk); + l10 = ab(); + f10 = yAa(Xda(l10, f10).gk); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(new be4().jj(f10))); + l10 = ab(); + k10.Gc(a10, b10, c10, e10, f10, g10, yAa(Xda(l10, h10).gk)); + }; + yp.prototype.$classData = r8({ twa: 0 }, false, "amf.client.resolve.ClientErrorHandlerConverter$$anon$2", { twa: 1, f: 1, rwa: 1 }); + function $H() { + this.Se = null; + } + $H.prototype = new Lp(); + $H.prototype.constructor = $H; + $H.prototype.a = function() { + Kp.prototype.e.call(this, Bu().$); + return this; + }; + $H.prototype.$classData = r8({ vwa: 0 }, false, "amf.client.resolve.Oas20Resolver", { vwa: 1, gN: 1, f: 1 }); + function eI() { + this.Se = null; + } + eI.prototype = new Lp(); + eI.prototype.constructor = eI; + eI.prototype.a = function() { + Kp.prototype.e.call(this, Cu().$); + return this; + }; + eI.prototype.$classData = r8({ wwa: 0 }, false, "amf.client.resolve.Oas30Resolver", { wwa: 1, gN: 1, f: 1 }); + function iI() { + this.Se = null; + } + iI.prototype = new Lp(); + iI.prototype.constructor = iI; + iI.prototype.a = function() { + Kp.prototype.e.call(this, Qb().$); + return this; + }; + iI.prototype.$classData = r8({ xwa: 0 }, false, "amf.client.resolve.Raml08Resolver", { xwa: 1, gN: 1, f: 1 }); + function mI() { + this.Se = null; + } + mI.prototype = new Lp(); + mI.prototype.constructor = mI; + mI.prototype.a = function() { + Kp.prototype.e.call(this, Pb().$); + return this; + }; + mI.prototype.$classData = r8({ ywa: 0 }, false, "amf.client.resolve.Raml10Resolver", { ywa: 1, gN: 1, f: 1 }); + function YL() { + } + YL.prototype = new u7(); + YL.prototype.constructor = YL; + function zAa() { + } + zAa.prototype = YL.prototype; + YL.prototype.sQ = function(a10) { + return this.aG(a10); + }; + YL.prototype.aG = function(a10) { + return Jha().qj(a10).b() ? false : true; + }; + YL.prototype.fetch = function(a10) { + return this.sF(a10); + }; + YL.prototype.accepts = function(a10) { + return this.sQ(a10); + }; + function Jq() { + this.Ba = null; + } + Jq.prototype = new u7(); + Jq.prototype.constructor = Jq; + Jq.prototype.d = function(a10) { + this.Ba = a10; + return this; + }; + function dja(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10) { + return (0, a10.Ba)(b10, c10, e10, f10, g10, h10, k10, l10, m10); + } + Jq.prototype.$classData = r8({ Lwa: 0 }, false, "amf.core.AMFCompiler$$$Lambda$1", { Lwa: 1, f: 1, Tgb: 1 }); + function cr() { + } + cr.prototype = new u7(); + cr.prototype.constructor = cr; + cr.prototype.a = function() { + return this; + }; + cr.prototype.$classData = r8({ Qwa: 0 }, false, "amf.core.AMFSerializer$$anon$1", { Qwa: 1, f: 1, Ugb: 1 }); + function AAa(a10) { + var b10 = a10.Ba.Lc.ba; + b10 = ZL().h(b10) ? Q5().cs : Ac().h(b10) ? Q5().cj : zc().h(b10) ? Q5().ti : hi().h(b10) || et3().h(b10) ? Q5().of : Q5().Na; + a10.wia(b10); + } + function BAa() { + } + BAa.prototype = new u7(); + BAa.prototype.constructor = BAa; + function CAa() { + } + CAa.prototype = BAa.prototype; + function $L() { + this.ba = null; + } + $L.prototype = new u7(); + $L.prototype.constructor = $L; + $L.prototype.a = function() { + DAa = this; + ii(); + var a10 = F6().Bj; + a10 = [G5(a10, "anyType")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + return this; + }; + $L.prototype.Kb = function() { + return this.ba; + }; + $L.prototype.$classData = r8({ uya: 0 }, false, "amf.core.metamodel.Type$Any$", { uya: 1, f: 1, Rb: 1 }); + var DAa = void 0; + function Bc() { + DAa || (DAa = new $L().a()); + return DAa; + } + function ht2() { + this.ba = this.Fe = null; + } + ht2.prototype = new u7(); + ht2.prototype.constructor = ht2; + function EAa() { + } + EAa.prototype = ht2.prototype; + ht2.prototype.yd = function(a10) { + this.Fe = a10; + this.ba = a10.Kb(); + return this; + }; + ht2.prototype.Kb = function() { + return this.ba; + }; + function aM(a10) { + var b10 = qb(), c10 = F6().Zd; + a10.iB(rb(new sb(), b10, G5(c10, "raw"), tb(new ub(), vb().hg, "raw", "Raw textual information that cannot be processed for the current model semantics.", H10()))); + b10 = yc(); + c10 = F6().Zd; + a10.jB(rb(new sb(), b10, G5(c10, "reference-id"), tb(new ub(), vb().hg, "reference id", "Internal identifier for an inlined fragment", H10()))); + b10 = qb(); + c10 = F6().Zd; + a10.hB(rb(new sb(), b10, G5(c10, "location"), tb(new ub(), vb().hg, "location", "Location of an inlined fragment", H10()))); + } + function bM(a10) { + var b10 = yc(), c10 = F6().Zd; + a10.cn(rb(new sb(), b10, G5(c10, "link-target"), tb(new ub(), vb().hg, "link target", "URI of the linked element", H10()))); + b10 = nc(); + c10 = F6().Zd; + a10.bn(rb(new sb(), b10, G5(c10, "effective-target"), tb(new ub(), vb().hg, "effective target", "URI of the final element in a chain of linked elements", H10()))); + b10 = qb(); + c10 = F6().Zd; + a10.$m(rb(new sb(), b10, G5(c10, "link-label"), tb(new ub(), vb().hg, "link label", "Label for the type of link", H10()))); + b10 = zc(); + c10 = F6().Zd; + a10.an(rb(new sb(), b10, G5(c10, "recursive"), tb( + new ub(), + vb().hg, + "supports recursion", + "Indication taht this kind of linkable element can support recursive links", + H10() + ))); + } + function cM() { + this.Va = null; + } + cM.prototype = new u7(); + cM.prototype.constructor = cM; + cM.prototype.a = function() { + FAa = this; + pb(this); + return this; + }; + cM.prototype.Nk = function(a10) { + this.Va = a10; + }; + cM.prototype.$classData = r8({ hza: 0 }, false, "amf.core.metamodel.domain.common.DescriptionField$", { hza: 1, f: 1, sk: 1 }); + var FAa = void 0; + function dM() { + this.Zc = null; + } + dM.prototype = new u7(); + dM.prototype.constructor = dM; + dM.prototype.a = function() { + GAa = this; + Laa(this); + return this; + }; + dM.prototype.G8 = function(a10) { + this.Zc = a10; + }; + dM.prototype.$classData = r8({ iza: 0 }, false, "amf.core.metamodel.domain.common.DisplayNameField$", { iza: 1, f: 1, Bga: 1 }); + var GAa = void 0; + function eM() { + this.R = null; + } + eM.prototype = new u7(); + eM.prototype.constructor = eM; + eM.prototype.a = function() { + HAa = this; + wb(this); + return this; + }; + eM.prototype.Vl = function(a10) { + this.R = a10; + }; + eM.prototype.$classData = r8({ jza: 0 }, false, "amf.core.metamodel.domain.common.NameFieldSchema$", { jza: 1, f: 1, nm: 1 }); + var HAa = void 0; + function fM() { + this.R = null; + } + fM.prototype = new u7(); + fM.prototype.constructor = fM; + fM.prototype.a = function() { + IAa = this; + var a10 = qb(), b10 = F6().Ua; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), ci().Ua, "name", "Additional name for the shape", H10())); + return this; + }; + fM.prototype.$classData = r8({ kza: 0 }, false, "amf.core.metamodel.domain.common.NameFieldShacl$", { kza: 1, f: 1, Hgb: 1 }); + var IAa = void 0; + function JAa(a10) { + var b10 = zc(), c10 = F6().Ta; + a10.A_(rb(new sb(), b10, G5(c10, "optional"), tb(new ub(), vb().Ta, "optional", "Marks some information as optional", H10()))); + } + function KAa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.EY); + } + function Zc(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.TA); + } + function ev(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.kr); + } + function gM() { + } + gM.prototype = new u7(); + gM.prototype.constructor = gM; + gM.prototype.a = function() { + return this; + }; + gM.prototype.Jka = function(a10) { + a10 = a10.vb; + var b10 = mz(); + b10 = Ua(b10); + var c10 = Id().u; + a10 = Jd(a10, b10, c10); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.r.r; + }; + }(this)); + c10 = Xd(); + return a10.ka(b10, c10.u).ua(); + }; + gM.prototype.$classData = r8({ yza: 0 }, false, "amf.core.model.document.FieldsFilter$All$", { yza: 1, f: 1, xza: 1 }); + var LAa = void 0; + function hM() { + } + hM.prototype = new u7(); + hM.prototype.constructor = hM; + hM.prototype.a = function() { + return this; + }; + hM.prototype.Jka = function(a10) { + a10 = a10.vb; + var b10 = mz(); + b10 = Ua(b10); + var c10 = Id().u; + a10 = Jd(a10, b10, c10); + b10 = new iM().a(); + c10 = Xd(); + return a10.ec(b10, c10.u).ua(); + }; + hM.prototype.$classData = r8({ zza: 0 }, false, "amf.core.model.document.FieldsFilter$Local$", { zza: 1, f: 1, xza: 1 }); + var MAa = void 0; + function UB() { + MAa || (MAa = new hM().a()); + return MAa; + } + function Rk(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.qd); + } + function jb(a10, b10) { + Ui(a10.Y(), db().te, b10, (O7(), new P6().a())); + var c10 = db().pf; + return eb(a10, c10, b10.j); + } + function jM(a10, b10, c10, e10, f10) { + e10.Ik() && (a10 = a10.Ug(b10, c10), f10 && ut(a10) && (b10 = db().oe, Bi(a10, b10, f10))); + return a10; + } + function kM(a10, b10, c10) { + var e10 = a10.yh(), f10 = "" + e10.j + b10; + f10 = ta(ua(), f10); + e10 = e10.pc(e10.j + "/link-" + f10); + a10 = jb(e10, a10); + e10 = db().ed; + b10 = eb(a10, e10, b10); + return Db(b10, c10); + } + function lM(a10) { + y7(); + a10.Ok(true); + a10.xk(false); + a10.Zk("error"); + a10.Fk(""); + a10.Dk(y7()); + a10.Ek(y7()); + new Nd().a(); + } + function NAa(a10, b10) { + return a10.mh().ug(pt(a10.Y()), b10); + } + function Nha(a10, b10) { + var c10 = a10.sf; + if (c10 instanceof z7) + c10 = c10.i, Naa(c10.ni, a10.Re, OAa(new mM(), b10, oq(/* @__PURE__ */ function(e10, f10) { + return function() { + if ("warning" === e10.uf) { + var g10 = dc().au, h10 = e10.j, k10 = "Unresolved reference '" + e10.Re + "'", l10 = e10.jf.c(), m10 = y7(); + nM(f10, g10, h10, m10, k10, l10.da); + } else + g10 = dc().au, h10 = e10.j, k10 = "Unresolved reference '" + e10.Re + "'", l10 = e10.jf.c(), m10 = y7(), ec(f10, g10, h10, m10, k10, l10.da); + }; + }(a10, c10)))); + else + throw mb(E6(), new nb().e("Cannot create unresolved reference with missing parsing context")); + } + function Za(a10) { + return Vb().Ia(ar(a10.Y(), db().te)); + } + function lB(a10, b10, c10, e10) { + a10.xk(true); + a10.Fk(b10); + a10.Dk(new z7().d(c10)); + a10.Ek(new z7().d(e10)); + return a10; + } + function Az(a10, b10) { + var c10 = Za(a10); + if (c10.b()) + b10 = y7(); + else { + c10 = c10.c(); + if (ut(c10) && Za(a10).na()) + if (b10.Ha(c10.j)) + b10 = Za(c10).c(); + else { + var e10 = c10.j, f10 = K7(); + b10 = c10.gj(b10.Vr(e10, f10.u)); + } + else + b10 = c10; + b10 = new z7().d(b10); + } + return b10.b() ? a10 : b10.c(); + } + function Qca(a10) { + var b10 = a10.mh(), c10 = pt(a10.Y()); + a10 = a10.fa(); + return b10.ug(c10, Yi(O7(), a10)); + } + function ut(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.rg); + } + function pha() { + this.hf = null; + } + pha.prototype = new kha(); + pha.prototype.constructor = pha; + d7 = pha.prototype; + d7.a = function() { + P6.prototype.a.call(this); + return this; + }; + d7.Sp = function() { + return this; + }; + d7.Lb = function() { + return this; + }; + d7.IM = function() { + return this; + }; + d7.$classData = r8({ nAa: 0 }, false, "amf.core.parser.Annotations$$anon$1", { nAa: 1, Hga: 1, f: 1 }); + function PAa(a10) { + return oM(a10, w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return QAa(c10, e10); + }; + }(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + var e10 = bc(); + return N6(c10, e10, b10.Th).va; + }; + }(a10))))); + } + function oM(a10, b10) { + var c10 = a10.rV(); + if (null !== c10) { + var e10 = c10.ma(); + c10 = c10.ya(); + a10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return g10.P(h10); + }; + }(a10, b10)); + b10 = K7(); + e10 = e10.ka(a10, b10.u); + return Zr(new $r(), e10, Rs(O7(), c10)); + } + throw new x7().d(c10); + } + function RAa(a10) { + return oM(a10, w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return QAa(c10, e10); + }; + }(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + var e10 = pM(); + return !!N6(c10, e10, b10.Th); + }; + }(a10))))); + } + function SAa(a10) { + return oM(a10, w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return QAa(c10, e10); + }; + }(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + var e10 = TAa(); + return N6(c10, e10, b10.Th) | 0; + }; + }(a10))))); + } + function UAa(a10) { + return oM(a10, w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return QAa(c10, e10); + }; + }(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + var e10 = pM(); + return !N6(c10, e10, b10.Th); + }; + }(a10))))); + } + function VAa(a10) { + return oM(a10, w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return QAa(c10, e10); + }; + }(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + var e10 = Dd(); + return N6(c10, e10, b10.Th); + }; + }(a10))))); + } + function QAa(a10, b10) { + return ih(new jh(), a10.P(b10), Od(O7(), b10.re())); + } + function Mq() { + this.XB = null; + } + Mq.prototype = new u7(); + Mq.prototype.constructor = Mq; + Mq.prototype.a = function() { + this.XB = Rb(Ut(), H10()); + return this; + }; + Mq.prototype.$classData = r8({ xAa: 0 }, false, "amf.core.parser.EmptyFutureDeclarations$$anon$1", { xAa: 1, f: 1, Ogb: 1 }); + function WAa(a10, b10, c10) { + a: { + if (c10 instanceof qM) { + var e10 = c10.Lu; + if (null === e10) + throw new sf().a(); + if (tf(uf(), "\\s+", e10)) + break a; + } + e10 = dc().gS; + c10 = c10.tt; + var f10 = y7(); + ec(a10, e10, "", f10, c10, b10); + } + } + function XAa(a10) { + a10 = de4(ee4(), a10.rf, a10.If, a10.Yf, a10.bg); + var b10 = ee4().dl; + return (null === b10 ? null === a10 : b10.h(a10)) ? y7() : new z7().d(new be4().jj(ce4(ae4(), a10))); + } + function YAa(a10, b10, c10) { + var e10 = dc().gS, f10 = Hb(b10.mv); + b10 = ZAa(a10, b10); + var g10 = y7(); + ec(a10, e10, "", g10, f10, b10.da); + return c10; + } + var ZAa = function $Aa(a10, b10) { + b10 = b10.Ca; + if (b10 instanceof RA || b10 instanceof Cs) + return b10; + if (b10 instanceof rM) + return b10.Fd; + if (b10 instanceof sM) + return $Aa(a10, b10.z0); + throw new x7().d(b10); + }; + function ec(a10, b10, c10, e10, f10, g10) { + var h10 = XAa(g10); + g10 = new je4().e(g10.Rf).Bu(); + a10.Gc(b10.j, c10, e10, f10, h10, Yb().qb, g10); + } + function nM(a10, b10, c10, e10, f10, g10) { + var h10 = XAa(g10); + a10.Ns(b10, c10, e10, f10, h10, new je4().e(g10.Rf).Bu()); + } + function aBa(a10, b10, c10, e10, f10) { + var g10 = y7(), h10 = y7(); + f10 = new je4().e(f10).Bu(); + a10.Gc(b10.j, c10, g10, e10, h10, Yb().qb, f10); + } + function yB(a10, b10, c10, e10, f10) { + var g10 = y7(), h10 = Ab(f10, q5(jd)); + f10 = Ab(f10, q5(Bb)); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da)); + a10.Gc(b10.j, c10, g10, e10, h10, Yb().qb, f10); + } + function tM() { + } + tM.prototype = new u7(); + tM.prototype.constructor = tM; + tM.prototype.a = function() { + return this; + }; + tM.prototype.$classData = r8({ zAa: 0 }, false, "amf.core.parser.ExtensionReference$", { zAa: 1, f: 1, NR: 1 }); + var bBa = void 0; + function uM() { + } + uM.prototype = new u7(); + uM.prototype.constructor = uM; + uM.prototype.a = function() { + return this; + }; + uM.prototype.$classData = r8({ JAa: 0 }, false, "amf.core.parser.InferredLinkReference$", { JAa: 1, f: 1, NR: 1 }); + var cBa = void 0; + function dBa() { + cBa || (cBa = new uM().a()); + return cBa; + } + function vM() { + } + vM.prototype = new u7(); + vM.prototype.constructor = vM; + vM.prototype.a = function() { + return this; + }; + vM.prototype.$classData = r8({ KAa: 0 }, false, "amf.core.parser.LibraryReference$", { KAa: 1, f: 1, NR: 1 }); + var eBa = void 0; + function wM() { + eBa || (eBa = new vM().a()); + return eBa; + } + function xM() { + } + xM.prototype = new u7(); + xM.prototype.constructor = xM; + xM.prototype.a = function() { + return this; + }; + xM.prototype.$classData = r8({ LAa: 0 }, false, "amf.core.parser.LinkReference$", { LAa: 1, f: 1, NR: 1 }); + var fBa = void 0; + function yM() { + fBa || (fBa = new xM().a()); + return fBa; + } + function zM() { + } + zM.prototype = new u7(); + zM.prototype.constructor = zM; + zM.prototype.a = function() { + return this; + }; + zM.prototype.$classData = r8({ ZAa: 0 }, false, "amf.core.parser.SchemaReference$", { ZAa: 1, f: 1, NR: 1 }); + var gBa = void 0; + function hBa() { + gBa || (gBa = new zM().a()); + return gBa; + } + function AM() { + } + AM.prototype = new u7(); + AM.prototype.constructor = AM; + AM.prototype.a = function() { + return this; + }; + AM.prototype.$classData = r8({ $Aa: 0 }, false, "amf.core.parser.SearchScope$All$", { $Aa: 1, f: 1, Mga: 1 }); + var iBa = void 0; + function Xs() { + iBa || (iBa = new AM().a()); + return iBa; + } + function BM() { + } + BM.prototype = new u7(); + BM.prototype.constructor = BM; + BM.prototype.a = function() { + return this; + }; + BM.prototype.$classData = r8({ aBa: 0 }, false, "amf.core.parser.SearchScope$Fragments$", { aBa: 1, f: 1, Mga: 1 }); + var jBa = void 0; + function Ys() { + jBa || (jBa = new BM().a()); + return jBa; + } + function CM() { + } + CM.prototype = new u7(); + CM.prototype.constructor = CM; + CM.prototype.a = function() { + return this; + }; + CM.prototype.$classData = r8({ bBa: 0 }, false, "amf.core.parser.SearchScope$Named$", { bBa: 1, f: 1, Mga: 1 }); + var kBa = void 0; + function Zs() { + kBa || (kBa = new CM().a()); + return kBa; + } + function DM() { + } + DM.prototype = new u7(); + DM.prototype.constructor = DM; + DM.prototype.a = function() { + return this; + }; + DM.prototype.PW = function(a10) { + return ZC(hp(), a10); + }; + DM.prototype.WN = function() { + return lBa(); + }; + DM.prototype.$classData = r8({ cBa: 0 }, false, "amf.core.parser.SimpleReferenceHandler$", { cBa: 1, f: 1, KY: 1 }); + var mBa = void 0; + function nBa() { + mBa || (mBa = new DM().a()); + return mBa; + } + function EM() { + } + EM.prototype = new u7(); + EM.prototype.constructor = EM; + EM.prototype.a = function() { + return this; + }; + EM.prototype.$classData = r8({ fBa: 0 }, false, "amf.core.parser.UnspecifiedReference$", { fBa: 1, f: 1, NR: 1 }); + var oBa = void 0; + function Lea() { + oBa || (oBa = new EM().a()); + return oBa; + } + function FM() { + } + FM.prototype = new u7(); + FM.prototype.constructor = FM; + FM.prototype.a = function() { + return this; + }; + FM.prototype.Av = function(a10) { + var b10 = a10.re(); + return b10 instanceof xt ? (ue4(), new ye4().d(b10)) : HF(JF(), a10, "Expected scalar but found: " + b10); + }; + FM.prototype.aK = function() { + return or().nd; + }; + FM.prototype.$classData = r8({ mBa: 0 }, false, "amf.core.parser.package$YScalarYRead$", { mBa: 1, f: 1, az: 1 }); + var pBa = void 0; + function bc() { + pBa || (pBa = new FM().a()); + return pBa; + } + function Nb() { + this.sm = null; + } + Nb.prototype = new u7(); + Nb.prototype.constructor = Nb; + function Raa(a10, b10, c10) { + var e10 = new GM(); + e10.wc = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + e10.dr = new HM().a(); + e10.rda = y7(); + e10.hW(b10); + } + Nb.prototype.gU = function(a10) { + this.sm = a10; + return this; + }; + Nb.prototype.$classData = r8({ rBa: 0 }, false, "amf.core.rdf.RdfModelEmitter", { rBa: 1, f: 1, lm: 1 }); + function IM() { + this.OM = this.Y9 = this.nI = this.oI = this.Mv = this.Nv = this.Dz = this.px = this.Ov = this.IA = this.Rja = this.Ke = this.Pe = this.y9 = this.py = this.Nu = this.er = this.m = null; + } + IM.prototype = new u7(); + IM.prototype.constructor = IM; + function qBa(a10) { + var b10 = fs().yE, c10 = Gb().si, e10 = UA(new VA(), nu()); + b10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return g10.jd(h10); + }; + }(b10, e10, c10))); + b10 = e10.eb.Ja(a10); + return b10.b() ? fs().NT(a10) : b10; + } + function rBa(a10, b10, c10) { + a10.Ke = new z7().d(b10); + b10 = b10.vK(c10); + if (b10 instanceof z7) + a: { + if (b10 = sBa(a10, b10.i, true), b10 instanceof z7 && (b10 = b10.i, vu(b10))) { + var e10 = Bq().uc; + c10 = Mc(ua(), c10, "#"); + c10 = zj(new Pc().fd(c10)); + c10 = eb(b10, e10, c10); + break a; + } + b10 = a10.m; + e10 = dc().wN; + var f10 = "Unable to parse RDF model for location root node: " + c10, g10 = y7(), h10 = y7(), k10 = y7(); + b10.Gc(e10.j, c10, g10, f10, h10, Yb().qb, k10); + O7(); + c10 = new P6().a(); + c10 = new mf().K(new S6().a(), c10); + } + else + b10 = a10.m, e10 = dc().wN, f10 = "Unable to parse RDF model for location root node: " + c10, g10 = y7(), h10 = y7(), k10 = y7(), b10.Gc(e10.j, c10, g10, f10, h10, Yb().qb, k10), O7(), c10 = new P6().a(), c10 = new mf().K(new S6().a(), c10); + b10 = a10.y9; + e10 = new tBa(); + f10 = Ef().u; + for (b10 = xs(b10, e10, f10).Dc; !b10.b(); ) + uBa(b10.ga(), a10.Pe), b10 = b10.ta(); + return c10; + } + function vBa(a10, b10, c10) { + b10 = JM(a10, b10); + if (b10 instanceof z7) { + var e10 = b10.i; + b10 = F6().Qi; + b10 = KM(e10, ic(G5(b10, "next"))); + b10 = (b10.b() ? H10() : b10.c()).kc(); + var f10 = F6().Qi; + e10 = KM(e10, ic(G5(f10, "first"))); + e10 = (e10.b() ? H10() : e10.c()).kc(); + e10 instanceof z7 && (e10 = e10.i, e10 instanceof LM && (e10 = MM(a10, e10), e10 instanceof z7 && (e10 = e10.i, e10 = J5(K7(), new Ib().ha([e10])), f10 = K7(), c10 = c10.ia(e10, f10.u)))); + return b10 instanceof z7 && (b10 = b10.i, b10 instanceof LM && (e10 = b10.r, f10 = F6().Qi, e10 !== ic(G5(f10, "nil")))) ? vBa(a10, b10, c10) : c10; + } + if (y7() === b10) + return c10; + throw new x7().d(b10); + } + function wBa(a10) { + var b10 = new IM(); + b10.m = a10; + b10.er = Rb(Ut(), H10()); + b10.Nu = Rb(Ut(), H10()); + b10.py = Rb(Ut(), H10()); + b10.y9 = J5(Ef(), H10()); + b10.Pe = Rb(Gb().ab, H10()); + b10.Ke = y7(); + a10 = F6().Zd; + a10 = ic(G5(a10, "Document")); + var c10 = F6().Zd; + c10 = ic(G5(c10, "Fragment")); + var e10 = F6().Zd; + e10 = ic(G5(e10, "Module")); + var f10 = F6().Zd; + f10 = ic(G5(f10, "Unit")); + var g10 = F6().Ua; + g10 = ic(G5(g10, "Shape")); + var h10 = F6().Eb; + a10 = [a10, c10, e10, f10, g10, ic(G5(h10, "Shape"))]; + if (0 === (a10.length | 0)) + a10 = vd(); + else { + c10 = wd(new xd(), vd()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + Ad(c10, a10[e10]), e10 = 1 + e10 | 0; + a10 = c10.eb; + } + b10.Rja = a10; + b10.IA = Uh().zj; + b10.Ov = Uh().hi; + b10.px = Uh().of; + b10.Dz = Uh().Xo; + b10.Nv = Uh().Nh; + b10.Mv = Uh().Mi; + b10.oI = Uh().tj; + b10.nI = Uh().jo; + a10 = ic(dha().kG); + a10 = new R6().M(a10, w6(/* @__PURE__ */ function() { + return function(k10) { + return cha(dha(), "", "", k10); + }; + }(b10))); + c10 = ic(hs().kG); + c10 = new R6().M(c10, w6(/* @__PURE__ */ function() { + return function(k10) { + hs(); + return new bl().K(new S6().a(), k10); + }; + }(b10))); + e10 = ic(Wi().ba.ga()); + e10 = new R6().M(e10, w6(/* @__PURE__ */ function() { + return function(k10) { + return ts(vs(), "", y7(), k10); + }; + }(b10))); + f10 = ic(qs().kG); + a10 = [a10, c10, e10, new R6().M(f10, w6(/* @__PURE__ */ function() { + return function(k10) { + qs(); + return new Xk().K(new S6().a(), k10); + }; + }(b10)))]; + c10 = new wu().a(); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + Mt( + c10, + a10[e10] + ), e10 = 1 + e10 | 0; + b10.Y9 = c10; + return b10; + } + IM.prototype.zS = function(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + a: { + for (var g10 = Bg(e10.Y()); !g10.b(); ) { + var h10 = g10.ga(), k10 = B6(f10.g, Ud().ko); + if (xb(k10, ic(h10.r))) { + g10 = new z7().d(g10.ga()); + break a; + } + g10 = g10.ta(); + } + g10 = y7(); + } + if (!g10.b() && (g10 = g10.c(), g10 = hd(e10.Y(), g10), !g10.b())) + if (g10 = g10.c(), null !== g10) + g10.r.r.fa().Lb(new NM().cE(f10)); + else + throw new x7().d(g10); + }; + }(this, a10))); + }; + function sBa(a10, b10, c10) { + var e10 = b10.lC; + c10 = xBa(a10, e10, b10, c10); + if (c10.b()) + return y7(); + var f10 = c10.c(), g10 = yBa(a10, b10); + c10 = zBa(a10, f10).P(OM(a10, g10, e10)); + c10.pc(e10); + a10.QS(c10); + if (AB(f10)) { + f10 = f10.Ub(); + var h10 = K7(), k10 = [ny(), nC()]; + h10 = J5(h10, new Ib().ha(k10)); + k10 = ii(); + f10 = f10.ia(h10, k10.u); + } else + f10 = f10.Ub(); + for (; !f10.b(); ) { + h10 = f10.ga(); + k10 = ic(h10.r); + var l10 = KM(b10, k10); + l10 = l10.b() ? H10() : l10.c(); + ABa(a10, c10, h10, l10, g10, k10); + f10 = f10.ta(); + } + if (Rk(c10) && ut(c10)) { + g10 = KM(b10, ic(db().pf.r)); + if (g10.b()) + g10 = y7(); + else + b: { + if (g10 = g10.c().kc(), g10 instanceof z7 && (g10 = g10.i, g10 instanceof LM)) { + g10 = new z7().d(g10.r); + break b; + } + g10 = y7(); + } + g10.b() || (g10 = g10.c(), a10.wW(c10, g10)); + g10 = KM( + b10, + ic(db().ed.r) + ); + if (g10.b()) + g10 = y7(); + else + b: { + if (g10 = g10.c().kc(), g10 instanceof z7 && (g10 = g10.i, g10 instanceof PM)) { + g10 = new z7().d(g10.r); + break b; + } + g10 = y7(); + } + g10.b() || (g10 = g10.c(), f10 = db().ed, eb(c10, f10, g10)); + } else + c10 instanceof Pk && a10.Nu.Ja(c10.j).na() && (g10 = a10.Nu.Ja(c10.j), g10.b() || (g10 = g10.c(), f10 = B6(c10.g, Ok().Rd).A, f10.b() || (f10 = f10.c(), h10 = Zf().Rd, eb(g10, h10, f10))), a10.Nu.rt(c10.j)); + Rk(c10) && BBa(a10, b10, c10); + a10.Pe = a10.Pe.cc(new R6().M(e10, c10)); + return new z7().d(c10); + } + function CBa(a10, b10) { + a10 = b10.RS.Dm(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.Rja.Ha(f10); + }; + }(a10))); + if (null !== a10) { + b10 = a10.ma(); + a10 = a10.ya(); + b10 = b10.nk(mc()); + var c10 = K7(); + return a10.ia(b10, c10.u); + } + throw new x7().d(a10); + } + function DBa(a10) { + if (a10 instanceof PM) + return a10 = new qg().e(a10.r).ja, ih(new jh(), da(Oj(va(), a10)), new P6().a()); + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting Float literal found URI " + a10)); + throw new x7().d(a10); + } + function EBa(a10, b10) { + if (b10 instanceof PM) { + var c10 = b10.r, e10 = b10.kP; + b10 = false; + var f10 = null; + return e10 instanceof z7 && (b10 = true, f10 = e10, e10 = f10.i, null !== e10 && e10 === a10.Mv) ? (a10 = new qg().e(c10), ih(new jh(), iH(a10.ja), new P6().a())) : b10 && (e10 = f10.i, null !== e10 && e10 === a10.Ov) ? (a10 = new qg().e(c10), c10 = ED(), ih(new jh(), FD(c10, a10.ja, 10), new P6().a())) : b10 && (e10 = f10.i, null !== e10 && e10 === a10.px) ? (a10 = new qg().e(c10).ja, ih(new jh(), da(Oj(va(), a10)), new P6().a())) : b10 && (e10 = f10.i, null !== e10 && e10 === a10.Nv) ? (a10 = new qg().e(c10), c10 = va(), ih(new jh(), Oj(c10, a10.ja), new P6().a())) : b10 && (e10 = f10.i, null !== e10 && e10 === a10.oI) || b10 && (b10 = f10.i, null !== b10 && b10 === a10.nI) ? (a10 = jH(mF(), c10), ih(new jh(), new zz().ln(a10).c(), new P6().a())) : ih(new jh(), c10, new P6().a()); + } + if (b10 instanceof LM) + throw a10 = b10.r, mb(E6(), new nb().e("Expecting String literal found URI " + a10)); + throw new x7().d(b10); + } + function zBa(a10, b10) { + var c10 = fs().yE.Ja(ic(b10.Kb().ga())); + if (c10 instanceof z7 && (c10 = c10.i, Kaa(c10))) + return w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = f10.lc(); + h10.fa().Sp(g10); + return h10; + }; + }(a10, c10)); + a10 = fs().KS(b10); + if (a10 instanceof z7) + return a10.i; + throw mb(E6(), new nb().e("Cannot find builder for node type " + b10)); + } + function FBa(a10, b10) { + b10 = CBa(a10, b10).Fb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.Y9.Ja(e10).na(); + }; + }(a10))); + return b10 instanceof z7 ? new z7().d(a10.Y9.P(b10.i)) : y7(); + } + function GBa(a10) { + if (a10 instanceof PM) { + a10 = new qg().e(a10.r); + var b10 = va(); + return ih(new jh(), Oj(b10, a10.ja), new P6().a()); + } + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting Double literal found URI " + a10)); + throw new x7().d(a10); + } + function yBa(a10, b10) { + b10 = KM(b10, ic(nc().bb.r)); + b10.b() ? a10 = y7() : (b10 = b10.c(), b10.Da() ? (b10 = JM(a10, b10.ga()), a10 = b10 instanceof z7 ? new z7().d(HBa(a10, b10.i)) : y7()) : a10 = y7()); + return a10.b() ? rc().ce : a10.c(); + } + function mba(a10) { + null === a10.OM && null === a10.OM && (a10.OM = new xw()); + return a10.OM; + } + IM.prototype.QS = function(a10) { + if (Rk(a10) && ut(a10)) { + this.py.Xh(new R6().M(a10.j, a10)); + var b10 = this.er.Ja(a10.j); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = H10(); + } + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (ut(g10)) + return jb(g10, f10); + if (g10 instanceof ns) + return QM(g10, f10); + throw mb(E6(), new nb().e("Only linkable elements can be linked")); + }; + }(this, a10))); + this.er.jm(a10.j, H10()); + } else if (RM(a10)) { + b10 = this.Nu; + var c10 = B6(a10.Y(), Zf().xj).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + } + }; + IM.prototype.wW = function(a10, b10) { + var c10 = this.py.Ja(b10); + if (c10 instanceof z7) + jb(a10, c10.i); + else if (y7() === c10) { + c10 = this.er.Ja(b10); + if (c10 instanceof z7) + var e10 = c10.i; + else { + if (y7() !== c10) + throw new x7().d(c10); + e10 = H10(); + } + c10 = this.er; + a10 = J5(K7(), new Ib().ha([a10])); + var f10 = K7(); + a10 = e10.ia(a10, f10.u); + c10.Xh(new R6().M(b10, a10)); + } else + throw new x7().d(c10); + }; + function ABa(a10, b10, c10, e10, f10, g10) { + if (e10.Da()) { + var h10 = e10.ga(), k10 = false, l10 = null, m10 = c10.ba; + if (dl() === m10) + m10 = MM(a10, h10), m10 instanceof z7 && (m10 = m10.i, g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10)); + else if (Dr(m10)) + m10 = JM(a10, h10), m10 instanceof z7 ? (m10 = sBa(a10, m10.i, false), m10 instanceof z7 && (m10 = m10.i, g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10))) : (c10 = a10.m, a10 = dc().wN, f10 = b10.j, b10 = "Error parsing RDF graph node, unknown linked node for property " + g10 + " in node " + b10.j, g10 = y7(), m10 = y7(), e10 = y7(), c10.Gc(a10.j, f10, g10, b10, m10, Yb().qb, e10)); + else if (yc().h(m10)) + m10 = IBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (qb().h(m10) || kba().h(m10) || SM().h(m10)) + m10 = JBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (zc().h(m10)) + m10 = KBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (Ac().h(m10)) + m10 = LBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (et3().h(m10)) + m10 = DBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (hi().h(m10)) + m10 = GBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (TM().h(m10)) + m10 = MBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (ZL().h(m10)) + m10 = MBa(h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else if (Bc() === m10) + m10 = EBa(a10, h10), g10 = OM(a10, f10, g10), Rg(b10, c10, m10, g10); + else { + if (m10 instanceof UM && (k10 = true, l10 = m10, 1 === e10.Oa())) { + m10 = NBa(a10, l10.Fe, JM(a10, e10.ga())); + g10 = OM(a10, f10, g10); + bs(b10, c10, m10, g10); + return; + } + if (k10) + c10 = a10.m, a10 = dc().wN, f10 = b10.j, b10 = "Error, more than one sorted array values found in node for property " + g10 + " in node " + b10.j, g10 = y7(), m10 = y7(), e10 = y7(), c10.Gc(a10.j, f10, g10, b10, m10, Yb().qb, e10); + else if (m10 instanceof xc) { + h10 = m10.Fe; + if (Dr(h10)) + h10 = ic(c10.r), k10 = F6().Zd, h10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = JM(p10, v10); + return v10 instanceof z7 ? sBa(p10, v10.i, t10).ua() : y7().ua(); + }; + }(a10, h10 === ic(G5(k10, "references")))), k10 = K7(), e10 = e10.bd(h10, k10.u); + else { + if (!qb().h(h10) && !yc().h(h10)) + throw new x7().d(h10); + h10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return IBa(p10); + }; + }(a10)); + k10 = K7(); + e10 = e10.ka(h10, k10.u); + } + m10 = m10.Fe; + vB(m10) ? (h10 = Gk().Ic, h10 = null === c10 ? null === h10 : c10.h(h10)) : h10 = false; + g10 = OM(a10, f10, g10), as(b10, c10, e10, g10); + } else + throw new x7().d(m10); + } + } + } + function KBa(a10) { + if (a10 instanceof PM) + return a10 = new qg().e(a10.r), ih(new jh(), iH(a10.ja), new P6().a()); + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting Boolean literal found URI " + a10)); + throw new x7().d(a10); + } + function PBa(a10) { + vs(); + var b10 = y7(); + b10 = ts(0, "", b10, (O7(), new P6().a())); + var c10 = a10.kP; + c10.b() || (c10 = c10.c(), jha(b10, c10)); + Tia(b10, a10.r, (O7(), new P6().a())); + return b10; + } + function NBa(a10, b10, c10) { + var e10 = J5(Ef(), H10()); + c10.b() || (c10 = c10.c(), VM(c10).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = F6().Ul; + p10 = ic(G5(p10, "_")); + if (0 <= (m10.length | 0) && m10.substring(0, p10.length | 0) === p10) + return ws(k10, KM(l10, m10).c()); + }; + }(a10, e10, c10)))); + c10 = Ef().u; + c10 = se4(e10, c10); + for (e10 = e10.Dc; !e10.b(); ) { + var f10 = e10.ga(); + if (dl() === b10) + var g10 = MM(a10, f10); + else if (Dr(b10)) + g10 = JM(a10, f10), g10 = g10 instanceof z7 ? sBa(a10, g10.i, false) : y7(); + else if (qb().h(b10) || kba().h(b10) || yc().h(b10)) + try { + g10 = new z7().d(IBa(f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + else if (zc().h(b10)) + try { + g10 = new z7().d(KBa(f10)); + } catch (h10) { + if (Ph( + E6(), + h10 + ) instanceof nb) + g10 = y7(); + else + throw h10; + } + else if (Ac().h(b10)) + try { + g10 = new z7().d(LBa(f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + else if (et3().h(b10)) + try { + g10 = new z7().d(DBa(f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + else if (hi().h(b10)) + try { + g10 = new z7().d(GBa(f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + else if (ZL().h(b10)) + try { + g10 = new z7().d(MBa(f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + else { + if (Bc() !== b10) + throw mb(E6(), new nb().e("Unknown list element type: " + b10)); + try { + g10 = new z7().d(EBa(a10, f10)); + } catch (h10) { + if (Ph(E6(), h10) instanceof nb) + g10 = y7(); + else + throw h10; + } + } + c10.jd(g10); + e10 = e10.ta(); + } + a10 = c10.Rc(); + b10 = new QBa(); + g10 = Ef().u; + return xs(a10, b10, g10); + } + function xBa(a10, b10, c10, e10) { + c10 = CBa(a10, c10); + e10 = c10.Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = qBa(k10); + k10 = false; + var m10 = null; + return l10 instanceof z7 && (k10 = true, m10 = l10, l10 = m10.i, !(h10 || l10 && l10.$classData && l10.$classData.ge.SA || ev(l10) || Zc(l10) || OBa(l10))) || k10 && (k10 = m10.i, h10 && (k10 && k10.$classData && k10.$classData.ge.SA || ev(k10) || Zc(k10) || OBa(k10))) ? true : false; + }; + }(a10, e10))); + e10 = e10.b() ? c10.Fb(w6(/* @__PURE__ */ function() { + return function(g10) { + return qBa(g10).na(); + }; + }(a10))) : e10; + if (e10 instanceof z7) + return qBa(e10.i); + if (y7() === e10) { + e10 = a10.m; + var f10 = dc().iS; + aBa(e10, f10, b10, "Error parsing JSON-LD node, unknown @types " + c10, a10.m.qh); + return y7(); + } + throw new x7().d(e10); + } + function LBa(a10) { + if (a10 instanceof PM) { + a10 = new qg().e(a10.r); + var b10 = ED(); + return ih(new jh(), FD(b10, a10.ja, 10), new P6().a()); + } + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting Int literal found URI " + a10)); + throw new x7().d(a10); + } + function MBa(a10) { + if (a10 instanceof PM) { + a10 = a10.r; + a10 = jH(mF(), a10); + if (a10 instanceof ye4) + return ih(new jh(), a10.i, new P6().a()); + if (a10 instanceof ve4) + throw a10 = a10.i, mb(E6(), new nb().e(a10.wba())); + throw new x7().d(a10); + } + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting Date literal found URI " + a10)); + throw new x7().d(a10); + } + function JM(a10, b10) { + return b10 instanceof LM ? (b10 = b10.r, a10 = a10.Ke, a10.b() ? y7() : a10.c().vK(b10)) : y7(); + } + function HBa(a10, b10) { + var c10 = lba(); + VM(b10).U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = mba(e10).qj(h10); + k10.b() || (k10 = k10.c(), k10 = nba(f10, k10), h10 = KM(g10, h10), h10 instanceof z7 && h10.i.U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10 = JM(l10, p10); + if (p10 instanceof z7) { + var t10 = p10.i; + p10 = KM(t10, ic(oc().ko.r)).c().ga(); + t10 = KM(t10, ic(oc().vf.r)).c().ga(); + m10.ug(p10.r, t10.r); + } + }; + }(e10, k10)))); + }; + }(a10, c10, b10))); + return c10; + } + function IBa(a10) { + return ih(new jh(), "" + a10.r, new P6().a()); + } + function BBa(a10, b10, c10) { + var e10 = KM(b10, ic(Yd(nc()).r)); + e10 = (e10.b() ? H10() : e10.c()).Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + return h10 instanceof LM; + }; + }(a10))); + var f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.r; + }; + }(a10)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + b10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = KM(k10, l10); + if (m10.b()) + m10 = y7(); + else { + var p10 = m10.c(); + O7(); + m10 = new P6().a(); + m10 = new Td().K(new S6().a(), m10); + if (p10.Da()) { + var t10 = JM(h10, p10.ga()); + if (t10 instanceof z7) { + t10 = t10.i; + var v10 = KM(t10, ic(Ud().R.r)); + if (v10 instanceof z7) { + var A10 = v10.i; + if (A10.Da() && A10.ga() instanceof PM) { + T6(); + v10 = Ud().R.ba; + T6(); + A10 = A10.ga().r; + A10 = mh(T6(), A10); + v10 = pc3(h10, v10, A10); + A10 = h10.m; + var D10 = Dd(); + v10 = N6(v10, D10, A10); + A10 = Ud().R; + eb(m10, A10, v10); + } + } + t10 = KM(t10, ic(Ud().ko.r)); + t10 instanceof z7 && (v10 = t10.i, v10.Da() && v10.ga() instanceof PM && (T6(), t10 = Ud().ko.ba, T6(), v10 = v10.ga().r, v10 = mh(T6(), v10), t10 = pc3(h10, t10, v10), v10 = h10.m, A10 = Dd(), t10 = N6(t10, A10, v10), v10 = Ud().R, eb(m10, v10, t10))); + O7(); + t10 = new P6().a(); + t10 = new Pd().K(new S6().a(), t10); + t10.j = l10; + l10 = Ud().ig; + Vd(m10, l10, t10); + l10 = MM(h10, p10.ga()); + l10.b() || (l10 = l10.c(), Rd(m10, l10.j), p10 = Ud().zi, Vd(m10, p10, l10)); + l10 = yBa(h10, k10); + m10.x.Sp(OM(h10, l10, m10.j)); + } + } + m10 = new z7().d(m10); + } + return m10.ua(); + }; + }(a10, b10)); + f10 = K7(); + b10 = e10.bd(b10, f10.u); + if (b10.Da()) + if (e10 = b10.Dm(w6(/* @__PURE__ */ function() { + return function(h10) { + return RBa(h10); + }; + }(a10))), null !== e10) + b10 = e10.ma(), e10 = e10.ya(), f10 = Yd(nc()), Zd(c10, f10, e10), a10.zS(c10, b10); + else + throw new x7().d(e10); + } + function MM(a10, b10) { + var c10 = JM(a10, b10); + if (c10.b()) + return y7(); + c10 = c10.c(); + var e10 = yBa(a10, c10); + b10 = FBa(a10, c10).c().P(OM(a10, e10, b10.r)); + if (b10 instanceof Xk) + Rd(b10, c10.lC), VM(c10).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + if ("@type" !== m10 && "@id" !== m10 && m10 !== ic(nc().bb.r)) { + var p10 = F6().Tb; + p10 = m10 !== ic(G5(p10, "name")); + } else + p10 = false; + if (p10) { + p10 = KM(k10, m10).c().ga(); + if (p10 instanceof PM) + p10 = PBa(p10); + else { + a: { + if (p10 instanceof LM) { + var t10 = JM(h10, p10); + if (t10 instanceof z7) { + t10 = t10.i; + var v10 = F6().Qi; + if (KM(t10, ic(G5(v10, "first"))).na()) { + t10 = true; + break a; + } + v10 = F6().Qi; + t10 = KM(t10, ic(G5(v10, "rest"))).na(); + break a; + } + } + t10 = false; + } + t10 ? p10 = SBa(h10, p10) : p10 instanceof LM ? (p10 = MM(h10, p10), p10.b() ? (qs(), O7(), p10 = new P6().a(), p10 = new Xk().K(new S6().a(), p10)) : p10 = p10.c()) : (qs(), O7(), p10 = new P6().a(), p10 = new Xk().K(new S6().a(), p10)); + } + return oC(l10, m10, p10, (O7(), new P6().a())); + } + }; + }(a10, c10, b10))); + else if (b10 instanceof Vi) + Rd(b10, c10.lC), VM(c10).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = KM(k10, m10).c(); + if (m10 === ic(Wi().vf.r) && p10.ga() instanceof PM && (m10 = PBa(p10.ga()), p10 = B6(m10.aa, Wi().vf).A, !p10.b())) { + var t10 = p10.c(); + p10 = Wi().vf; + m10 = ih(new jh(), t10, B6(m10.aa, Wi().vf).x); + Vd(l10, p10, m10); + } + }; + }(a10, c10, b10))); + else if (b10 instanceof ns) + if (Rd(b10, c10.lC), VM(c10).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = KM(k10, m10).c(); + m10 === ic(os().Xp.r) && p10.ga() instanceof PM ? (m10 = B6(PBa(p10.ga()).aa, Wi().vf).A, m10.b() || (m10 = m10.c(), p10 = os().Xp, eb(l10, p10, m10))) : m10 === ic(os().vf.r) && p10.ga() instanceof PM && (m10 = B6(PBa(p10.ga()).aa, Wi().vf).A, m10.b() || (m10 = m10.c(), p10 = os().vf, eb(l10, p10, m10))); + }; + }(a10, c10, b10))), c10 = a10.py, e10 = B6(b10.aa, os().Xp).A, c10 = c10.Ja(e10.b() ? null : e10.c()), c10 instanceof z7) + QM(b10, c10.i); + else { + c10 = a10.er; + e10 = B6(b10.aa, os().Xp).A; + e10 = e10.b() ? null : e10.c(); + c10 = c10.Ja(e10); + if (c10 instanceof z7) + c10 = c10.i; + else { + if (y7() !== c10) + throw new x7().d(c10); + c10 = H10(); + } + a10 = a10.er; + e10 = B6(b10.aa, os().Xp).A; + e10 = e10.b() ? null : e10.c(); + var f10 = J5(K7(), new Ib().ha([b10])), g10 = K7(); + c10 = c10.ia(f10, g10.u); + a10.Xh(new R6().M(e10, c10)); + } + else if (b10 instanceof bl) + Rd(b10, c10.lC), VM(c10).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + if (m10 === ic(al().Tt.r)) { + m10 = KM(l10, m10); + m10 = m10.b() ? H10() : m10.c(); + var p10 = w6(/* @__PURE__ */ function(v10) { + return function(A10) { + return MM(v10, A10).ua(); + }; + }(h10)), t10 = K7(); + return TBa(k10, m10.bd(p10, t10.u)); + } + }; + }(a10, b10, c10))); + else + throw mb(E6(), new nb().e("Cannot parse object data node from non object JSON structure " + b10)); + return new z7().d(b10); + } + function JBa(a10) { + if (a10 instanceof PM) + return ih(new jh(), a10.r, new P6().a()); + if (a10 instanceof LM) + throw a10 = a10.r, mb(E6(), new nb().e("Expecting String literal found URI " + a10)); + throw new x7().d(a10); + } + function SBa(a10, b10) { + var c10 = JM(a10, b10); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = yBa(a10, c10); + c10 = OM(a10, e10, c10.lC); + } else { + if (y7() !== c10) + throw new x7().d(c10); + O7(); + c10 = new P6().a(); + } + b10 = vBa(a10, b10, H10()); + hs(); + c10 = new bl().K(new S6().a(), c10); + b10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return Mqa(g10, h10); + }; + }(a10, c10))); + return c10; + } + function OM(a10, b10, c10) { + b10 = sc(a10.Pe, b10, c10); + a10 = a10.y9; + var e10 = b10.hf; + Ef(); + c10 = Jf(new Kf(), new Lf().a()); + for (e10 = e10.Dc; !e10.b(); ) { + var f10 = e10.ga(); + false !== hha(f10) && Of(c10, f10); + e10 = e10.ta(); + } + ws(a10, c10.eb); + return b10; + } + IM.prototype.$classData = r8({ uBa: 0 }, false, "amf.core.rdf.RdfModelParser", { uBa: 1, f: 1, Vga: 1 }); + function WM() { + this.$ = null; + } + WM.prototype = new u7(); + WM.prototype.constructor = WM; + WM.prototype.a = function() { + this.$ = "AMF Graph"; + return this; + }; + WM.prototype.ve = function() { + return this.$; + }; + WM.prototype.$classData = r8({ CBa: 0 }, false, "amf.core.remote.Amf$", { CBa: 1, f: 1, cD: 1 }); + var UBa = void 0; + function Du() { + UBa || (UBa = new WM().a()); + return UBa; + } + function XM() { + this.$ = null; + } + XM.prototype = new u7(); + XM.prototype.constructor = XM; + XM.prototype.a = function() { + this.$ = "AML 1.0"; + return this; + }; + XM.prototype.t = function() { + return this.$.trim(); + }; + XM.prototype.ve = function() { + return this.$; + }; + XM.prototype.$classData = r8({ DBa: 0 }, false, "amf.core.remote.Aml$", { DBa: 1, f: 1, cD: 1 }); + var VBa = void 0; + function Eia() { + VBa || (VBa = new XM().a()); + return VBa; + } + function YM() { + } + YM.prototype = new u7(); + YM.prototype.constructor = YM; + YM.prototype.a = function() { + return this; + }; + YM.prototype.$classData = r8({ IBa: 0 }, false, "amf.core.remote.FileMediaType$", { IBa: 1, f: 1, Oga: 1 }); + var WBa = void 0; + function Gq() { + WBa || (WBa = new YM().a()); + } + function jj(a10) { + return ba.encodeURIComponent(a10); + } + function Kq(a10) { + a10 = new ZM().e(ba.encodeURI(a10)); + if (!a10.LA && void 0 !== a10.Rs) { + var b10 = a10.Rs; + if (void 0 === b10) + throw new iL().e("undefined.get"); + var c10 = b10.split("/"), e10 = c10.length | 0; + if (0 !== e10) { + var f10 = c10[0]; + f10 = null !== f10 && ra(f10, ""); + } else + f10 = false; + for (var g10 = f10 = f10 ? 1 : 0, h10 = f10; g10 !== e10; ) { + var k10 = c10[g10]; + g10 = 1 + g10 | 0; + if ("." === k10) + g10 === e10 && (c10[h10] = "", h10 = 1 + h10 | 0); + else if (".." === k10) + h10 !== f10 ? (k10 = c10[-1 + h10 | 0], k10 = ".." !== k10 && "" !== k10) : k10 = false, k10 ? g10 === e10 ? c10[-1 + h10 | 0] = "" : h10 = -1 + h10 | 0 : (c10[h10] = "..", h10 = 1 + h10 | 0); + else if ("" !== k10 || g10 === e10) + c10[h10] = k10, h10 = 1 + h10 | 0; + } + c10.length = h10; + 0 !== h10 && -1 !== (c10[0].indexOf(":") | 0) && c10.unshift(".") | 0; + c10 = c10.join("/"); + c10 !== b10 && (b10 = new ZM(), e10 = a10.fL, e10 = void 0 === e10 ? null : e10, f10 = a10.eL, f10 = void 0 === f10 ? null : f10, g10 = a10.Jt, g10 = void 0 === g10 ? void 0 : XBa($M(), g10), g10 = void 0 === g10 ? null : g10, a10 = a10.It, a10 = void 0 === a10 ? void 0 : XBa($M(), a10), a10 = void 0 === a10 ? null : a10, ZM.prototype.e.call(b10, YBa($M(), e10, f10, c10, g10, a10)), a10 = b10); + } + a10 = a10.Y1; + return 0 <= (a10.length | 0) && "file://" === a10.substring(0, 7) || 0 <= (a10.length | 0) && "file:///" === a10.substring(0, 8) ? a10 : 0 <= (a10.length | 0) && "file:/" === a10.substring(0, 6) ? a10.split("file:/").join("file:///") : a10; + } + function aN() { + this.$ = null; + } + aN.prototype = new u7(); + aN.prototype.constructor = aN; + aN.prototype.a = function() { + this.$ = "JSON Schema"; + return this; + }; + aN.prototype.t = function() { + return this.$.trim(); + }; + aN.prototype.ve = function() { + return this.$; + }; + aN.prototype.$classData = r8({ MBa: 0 }, false, "amf.core.remote.JsonSchema$", { MBa: 1, f: 1, cD: 1 }); + var ZBa = void 0; + function Wba() { + ZBa || (ZBa = new aN().a()); + return ZBa; + } + function bN() { + this.$ = null; + } + bN.prototype = new u7(); + bN.prototype.constructor = bN; + bN.prototype.a = function() { + this.$ = "AMF Payload"; + return this; + }; + bN.prototype.ve = function() { + return this.$; + }; + bN.prototype.$classData = r8({ TBa: 0 }, false, "amf.core.remote.Payload$", { TBa: 1, f: 1, cD: 1 }); + var $Ba = void 0; + function Vf() { + $Ba || ($Ba = new bN().a()); + return $Ba; + } + function cN() { + } + cN.prototype = new u7(); + cN.prototype.constructor = cN; + cN.prototype.a = function() { + return this; + }; + function aCa() { + throw mb(E6(), new nb().e("Unsupported operation")); + } + cN.prototype.R_ = function() { + aCa(); + }; + cN.prototype.W2 = function() { + aCa(); + }; + cN.prototype.$classData = r8({ aCa: 0 }, false, "amf.core.remote.UnsupportedFileSystem$", { aCa: 1, f: 1, g3a: 1 }); + var bCa = void 0; + function dN() { + Wu.call(this); + this.Yj = this.Gb = null; + } + dN.prototype = new Xu(); + dN.prototype.constructor = dN; + dN.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + this.Gb = new EB().mt(false, this.ob); + this.Yj = J5(K7(), new Ib().ha([this.Gb])); + return this; + }; + dN.prototype.kC = function() { + return this.Yj; + }; + dN.prototype.$classData = r8({ oCa: 0 }, false, "amf.core.resolution.pipelines.BasicResolutionPipeline", { oCa: 1, Qt: 1, f: 1 }); + function eN() { + this.ob = null; + } + eN.prototype = new gv(); + eN.prototype.constructor = eN; + eN.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + eN.prototype.ye = function(a10) { + it2(a10.Y(), Bq().xc); + return a10; + }; + eN.prototype.$classData = r8({ qCa: 0 }, false, "amf.core.resolution.stages.CleanReferencesStage", { qCa: 1, ii: 1, f: 1 }); + function fN() { + this.ob = null; + } + fN.prototype = new gv(); + fN.prototype.constructor = fN; + fN.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function cCa(a10, b10) { + a10 = b10.tk().Cb(w6(/* @__PURE__ */ function() { + return function(c10) { + return "http://a.ml/vocabularies/security#SecurityScheme" === ic(c10.bc().Kb().ga()); + }; + }(a10))); + a10.b() ? it2(b10.Y(), Gk().Ic) : (b10 = cs(b10.Y(), Gk().Ic), b10 instanceof z7 && (b10.i.wb = a10)); + } + fN.prototype.ye = function(a10) { + Zc(a10) && ev(a10) && cCa(this, a10); + return a10; + }; + fN.prototype.$classData = r8({ rCa: 0 }, false, "amf.core.resolution.stages.DeclarationsRemovalStage", { rCa: 1, ii: 1, f: 1 }); + function gN() { + this.ox = this.ob = null; + } + gN.prototype = new gv(); + gN.prototype.constructor = gN; + function dCa(a10, b10, c10) { + a10.ox = b10; + fv.prototype.Hb.call(a10, c10); + return a10; + } + gN.prototype.Bea = function(a10) { + RM(a10) && it2(a10.Y(), Zf().xj); + return new z7().d(a10); + }; + gN.prototype.ye = function(a10) { + var b10 = eCa(this.ox); + fCa || (fCa = new hN().a()); + return a10.Qm(gCa(b10, fCa), Uc(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.Bea(e10); + }; + }(this)), this.ob); + }; + gN.prototype.$classData = r8({ sCa: 0 }, false, "amf.core.resolution.stages.ExternalSourceRemovalStage", { sCa: 1, ii: 1, f: 1 }); + function iN() { + this.ob = null; + this.Sk = false; + this.wu = this.ox = null; + } + iN.prototype = new gv(); + iN.prototype.constructor = iN; + iN.prototype.Bea = function(a10) { + return a10 instanceof ns ? Wia($ia(), a10, this.wu, this.Sk) : new z7().d(a10); + }; + iN.prototype.ye = function(a10) { + this.wu = new z7().d(new dv().EK(a10)); + var b10 = eCa(this.ox), c10 = hCa(); + b10 = gCa(b10, c10); + c10 = iCa(); + return a10.Qm(gCa(b10, c10), Uc(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.Bea(f10); + }; + }(this)), this.ob); + }; + iN.prototype.$classData = r8({ tCa: 0 }, false, "amf.core.resolution.stages.LinkNodeResolutionStage", { tCa: 1, ii: 1, f: 1 }); + function jN() { + this.B_ = this.UP = this.c8 = this.ob = null; + } + jN.prototype = new gv(); + jN.prototype.constructor = jN; + jN.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + a10 = new kN(); + if (null === this.c8 && null === this.c8) { + var b10 = new lN(); + if (null === this) + throw mb(E6(), null); + b10.Fa = this; + this.c8 = b10; + } + this.UP = jCa(a10, this, Rb(Ut(), H10())); + this.B_ = "amf://id"; + return this; + }; + function kCa(a10, b10, c10) { + if (lb(b10)) { + if (lCa(a10.UP, b10.j) !== b10.j) { + b10.pc(lCa(a10.UP, b10.j)); + var e10 = b10.Y().vb, f10 = mz(); + f10 = Ua(f10); + var g10 = Id().u; + Jd(e10, f10, g10).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.Lc, p10 = l10.r; + if (null !== p10) { + var t10 = db().te; + if (null === m10 ? null === t10 : m10.h(t10)) { + l10 = p10.r; + if (lb(l10)) + return l10.pc(lCa(h10.UP, l10.j)); + return; + } + } + } + if (null !== l10 && (p10 = l10.Lc, m10 = l10.r, null !== m10 && (p10 = p10.ba, t10 = yc(), null !== p10 && p10.h(t10)))) { + mCa(h10, m10.x); + l10 = m10.r.t(); + k10.Od(w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return 0 <= (A10.length | 0) && A10.substring(0, D10.length | 0) === D10; + }; + }(h10, l10))) && (m10.r = ih(new jh(), lCa(h10.UP, l10), m10.r.fa())); + return; + } + if (null !== l10 && (m10 = l10.r, null !== m10)) { + kCa(h10, m10.r, k10); + mCa(h10, m10.x); + return; + } + throw new x7().d(l10); + }; + }(a10, c10))); + } + } else + b10 instanceof $r && b10.wb.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + kCa(h10, l10, k10); + }; + }(a10, c10))); + mCa(a10, b10.fa()); + } + function mCa(a10, b10) { + var c10 = b10.hf, e10 = Ef().u; + e10 = se4(c10, e10); + for (c10 = c10.Dc; !c10.b(); ) { + var f10 = c10.ga(); + e10.jd(f10 && f10.$classData && f10.$classData.ge.dJ ? f10.kM(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return lCa(g10.UP, h10); + }; + }(a10))) : f10); + c10 = c10.ta(); + } + b10.hf = e10.Rc(); + } + jN.prototype.ye = function(a10) { + var b10 = [a10.j]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + c10 = a10.Ve(); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.j; + }; + }(this)); + f10 = K7(); + b10 = b10.Lk(c10.ka(e10, f10.u)); + kCa(this, a10, b10); + return Rd(a10, this.B_); + }; + jN.prototype.$classData = r8({ yCa: 0 }, false, "amf.core.resolution.stages.UrlShortenerStage", { yCa: 1, ii: 1, f: 1 }); + function mN() { + this.ED = null; + this.Sk = false; + this.Hja = this.vG = this.wu = null; + } + mN.prototype = new bja(); + mN.prototype.constructor = mN; + function nCa(a10, b10, c10) { + if (qD(b10)) { + var e10 = false, f10 = null, g10 = B6(b10.Y(), b10.Zg()).A; + a: { + if (g10 instanceof z7 && (e10 = true, f10 = g10, wh(b10.fa(), q5(nN)))) { + oCa(a10, b10, c10); + break a; + } + b: { + if (g10 instanceof z7) { + var h10 = g10.i; + if ("schema" === h10 || "type" === h10 || "body" === h10) { + g10 = true; + break b; + } + } + g10 = y7() === g10 ? true : false; + } + g10 && Za(b10).na() ? oCa(a10, b10, c10) : e10 && (a10 = f10.i, b10 = B6(c10.Y(), c10.Zg()).x, Sd(c10, a10, b10)); + } + } + } + mN.prototype.wqa = function(a10) { + if (ut(a10) && Za(a10).na()) { + if (this.ED.Ha(Za(a10).c().j)) + return new z7().d(this.ED.P(Za(a10).c().j)); + var b10 = a10.gj(Wca()); + if (null !== b10 && this.ED.Ha(b10.j)) + b10 = this.ED.P(b10.j); + else { + var c10; + if (c10 = ut(b10)) + c10 = wh(a10.fa(), q5(cv)) && !pCa(b10); + if (c10) { + c10 = b10.fa(); + c10 = Yi(O7(), c10); + var e10 = c10.hf; + Ef(); + var f10 = Jf(new Kf(), new Lf().a()); + for (e10 = e10.Dc; !e10.b(); ) { + var g10 = e10.ga(); + false !== !(g10 instanceof Kz) && Of(f10, g10); + e10 = e10.ta(); + } + c10.hf = f10.eb; + b10 = NAa(b10, c10).pc(a10.j); + qD(a10) && B6(a10.Y(), a10.Zg()).A.na() && (c10 = B6(a10.Y(), a10.Zg()).A, c10 = c10.b() ? null : c10.c(), f10 = B6(a10.Y(), a10.Zg()).x, Sd( + b10, + c10, + f10 + )); + } else if (null !== b10) { + c10 = Ab(a10.fa(), q5(FC)); + if (!c10.b()) + if (f10 = c10.c(), null !== f10) { + c10 = f10.Ds; + e10 = Ab(b10.fa(), q5(FC)); + e10.b() ? c10 = f10 : (f10 = e10.c(), c10 = new GC().hk(c10.Lk(f10.Ds))); + f10 = b10.fa(); + g10 = f10.hf; + Ef(); + e10 = Jf(new Kf(), new Lf().a()); + for (g10 = g10.Dc; !g10.b(); ) { + var h10 = g10.ga(); + false !== !(h10 instanceof GC) && Of(e10, h10); + g10 = g10.ta(); + } + f10.hf = e10.eb; + Cb(b10, c10); + } else + throw new x7().d(f10); + wh(a10.fa(), q5(nN)) && !wh(b10.fa(), q5(cv)) && (c10 = new Kz().a(), Cb(b10, c10)); + } else + throw new x7().d(b10); + } + c10 = b10; + O7(); + b10 = new P6().a(); + b10 = new mf().K(new S6().a(), b10); + Ui(b10.g, Gk().nb, c10, (O7(), new P6().a())); + c10 = new iN(); + f10 = J5(DB(), H10()); + e10 = this.vG; + c10.Sk = this.Sk; + c10.ox = f10; + fv.prototype.Hb.call(c10, e10); + c10.wu = y7(); + b10 = c10.ye(b10).qe(); + ut(b10) && (c10 = B6(a10.Y(), db().oe).A, c10.b() ? 0 : c10.c()) && (c10 = db().oe, Bi(b10, c10, true)); + b10 = this.Hja.ug(qCa(this, b10, a10), a10); + b10.fa().Lb(new bv().a()); + this.Sk && (b10.fa().Lb(new $u().e(a10.j)), c10 = Za(a10), c10.b() || (c10 = c10.c(), new z7().d(b10.fa().Lb(new av().e(c10.j))))); + c10 = J5(DB(), H10()); + a: + for (; ; ) { + if (!c10.Ha(a10.j) && (c10.Tm(a10.j), f10 = a10, ut(f10) && Za(f10).na())) { + e10 = b10; + for (g10 = a10.fa().hf.Dc; !g10.b(); ) + h10 = g10.ga(), h10 instanceof Zh && !wh(e10.fa(), la(h10)) && e10.fa().Lb(h10), g10 = g10.ta(); + wh(a10.fa(), q5(cv)) && this.ED.Ue( + a10.j, + b10 + ); + a10 = Za(f10).c(); + continue a; + } + break; + } + return new z7().d(b10); + } + return a10 instanceof ns ? Wia($ia(), a10, this.wu, this.Sk) : y7(); + }; + function qCa(a10, b10, c10) { + if (qD(b10)) { + var e10 = b10.bc().Kb(); + e10 = Wt(e10); + var f10 = F6().Zd; + e10.Ha(G5(f10, "Example")) ? qD(c10) && B6(c10.Y(), c10.Zg()).A.na() && (a10 = B6(c10.Y(), c10.Zg()).A, a10 = a10.b() ? null : a10.c(), e10 = B6(b10.Y(), b10.Zg()).x, Sd(b10, a10, e10)) : (B6(b10.Y(), b10.Zg()).A.b() ? e10 = true : (e10 = B6(b10.Y(), b10.Zg()).A, e10 = "schema" === (e10.b() ? null : e10.c())), e10 ? e10 = true : (e10 = B6(b10.Y(), b10.Zg()).A, e10 = "type" === (e10.b() ? null : e10.c())), e10 ? e10 = true : (e10 = B6(b10.Y(), b10.Zg()).A, e10 = "body" === (e10.b() ? null : e10.c())), (e10 || wh(b10.fa(), q5(nN))) && ut(c10) && nCa(a10, c10, b10)); + } + a: { + if (qD(c10) && (a10 = B6(c10.Y(), c10.Zg()), !oN(a10))) { + a10 = Ab(b10.fa(), q5(Cqa)); + e10 = a10.b() ? new pN().Yn(Rb(Sb(), H10())) : a10.c(); + f10 = e10.nF; + var g10 = B6(c10.Y(), c10.Zg()).A; + g10 = g10.b() ? null : g10.c(); + f10 = f10.Ja(g10); + if (f10 instanceof z7) + f10 = f10.i; + else { + if (y7() !== f10) + throw new x7().d(f10); + f10 = H10(); + } + g10 = e10.nF; + var h10 = B6(c10.Y(), c10.Zg()).A; + h10 = h10.b() ? null : h10.c(); + c10 = J5(K7(), new Ib().ha([c10])); + var k10 = K7(); + g10.Ue(h10, f10.ia(c10, k10.u)); + a10.b() ? b10.fa().Lb(e10) : void 0; + break a; + } + if (ut(c10) && qD(c10) && B6(c10.Y(), db().ed).A.na()) { + a10 = Ab(b10.fa(), q5(Cqa)); + e10 = a10.b() ? new pN().Yn(Rb(Sb(), H10())) : a10.c(); + f10 = e10.nF; + g10 = B6(c10.Y(), db().ed).A; + g10 = g10.b() ? null : g10.c(); + f10 = f10.Ja(g10); + if (f10 instanceof z7) + f10 = f10.i; + else { + if (y7() !== f10) + throw new x7().d(f10); + f10 = H10(); + } + g10 = e10.nF; + h10 = B6(c10.Y(), db().ed).A; + h10 = h10.b() ? null : h10.c(); + c10 = J5(K7(), new Ib().ha([c10])); + k10 = K7(); + g10.Ue(h10, f10.ia(c10, k10.u)); + a10.b() ? b10.fa().Lb(e10) : void 0; + } + } + return b10; + } + function oCa(a10, b10, c10) { + b10 = Za(b10); + b10 instanceof z7 && (b10 = b10.i, ut(b10) && nCa(a10, b10, c10)); + } + mN.prototype.$classData = r8({ CCa: 0 }, false, "amf.core.resolution.stages.elements.resolution.ReferenceResolution", { CCa: 1, BCa: 1, f: 1 }); + function qN() { + this.Me = 0; + } + qN.prototype = new u7(); + qN.prototype.constructor = qN; + qN.prototype.a = function() { + this.Me = -1; + return this; + }; + qN.prototype.vba = function() { + return false; + }; + qN.prototype.$classData = r8({ KCa: 0 }, false, "amf.core.services.IgnoreValidationsMerger$", { KCa: 1, f: 1, QCa: 1 }); + var rCa = void 0; + function uqa() { + rCa || (rCa = new qN().a()); + return rCa; + } + function TB() { + } + TB.prototype = new u7(); + TB.prototype.constructor = TB; + TB.prototype.a = function() { + return this; + }; + TB.prototype.Ama = function(a10) { + return new rN().bL(a10); + }; + TB.prototype.$classData = r8({ TCa: 0 }, false, "amf.core.traversal.iterator.AmfElementStrategy$", { TCa: 1, f: 1, XCa: 1 }); + var Goa = void 0; + function sN() { + } + sN.prototype = new u7(); + sN.prototype.constructor = sN; + sN.prototype.a = function() { + return this; + }; + sN.prototype.Ama = function(a10) { + return new tN().bL(a10); + }; + sN.prototype.$classData = r8({ WCa: 0 }, false, "amf.core.traversal.iterator.DomainElementStrategy$", { WCa: 1, f: 1, XCa: 1 }); + var sCa = void 0; + function gC() { + sCa || (sCa = new sN().a()); + return sCa; + } + function je4() { + this.ea = this.td = null; + } + je4.prototype = new u7(); + je4.prototype.constructor = je4; + function jx(a10) { + return "x-amf-" + a10.td; + } + function tCa(a10) { + a10 = a10.td; + return 3 > Mc(ua(), a10, "\\.").n.length; + } + function uCa(a10) { + a10 = a10.td; + try { + ue4(); + var b10 = ba.decodeURIComponent(a10); + var c10 = new ye4().d(b10); + } catch (e10) { + if (null !== Ph(E6(), e10)) + ue4(), c10 = new ve4().d(a10); + else + throw e10; + } + if (c10 instanceof ye4 || c10 instanceof ve4) + return c10.i; + throw new x7().d(c10); + } + function Iha(a10) { + if (null === a10.td) + var b10 = true; + else { + b10 = a10.td; + if (null === b10) + throw new sf().a(); + b10 = "" === b10; + } + if (b10) + return ""; + b10 = a10.td; + 0 <= (b10.length | 0) && "http:" === b10.substring(0, 5) ? b10 = true : (b10 = a10.td, b10 = 0 <= (b10.length | 0) && "https:" === b10.substring(0, 6)); + b10 ? b10 = true : (b10 = a10.td, b10 = 0 <= (b10.length | 0) && "file:" === b10.substring(0, 5)); + if (b10) + return a10.td; + b10 = a10.td; + return 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) ? "file:/" + a10.td : "file://" + a10.td; + } + function fh(a10) { + return "(amf-" + a10.td + ")"; + } + je4.prototype.Bu = function() { + var a10 = this.td; + if (null === a10) + throw new sf().a(); + return "" === a10 ? y7() : Vb().Ia(this.td); + }; + je4.prototype.e = function(a10) { + this.td = a10; + this.ea = nv().ea; + return this; + }; + je4.prototype.$classData = r8({ dDa: 0 }, false, "amf.core.utils.package$AmfStrings", { dDa: 1, f: 1, ib: 1 }); + function pI() { + this.ea = null; + } + pI.prototype = new u7(); + pI.prototype.constructor = pI; + pI.prototype.a = function() { + Gva = this; + this.ea = nv().ea; + return this; + }; + function Hva(a10) { + Dea || (Dea = new nl().a()); + Dea.fda(a10.ea); + No(); + a10 = vCa(); + Oo(Po(), a10); + No(); + a10 = Cea(); + Oo(Po(), a10); + No(); + a10 = oAa(); + Oo(Po(), a10); + No(); + a10 = pAa(); + Oo(Po(), a10); + No(); + a10 = rAa(); + Oo(Po(), a10); + No(); + a10 = qAa(); + Oo(Po(), a10); + No(); + a10 = OL(); + Oo(Po(), a10); + No(); + a10 = wCa(); + Oo(Po(), a10); + } + pI.prototype.register = function() { + Hva(this); + }; + pI.prototype.$classData = r8({ PDa: 0 }, false, "amf.plugins.document.WebApi$", { PDa: 1, f: 1, ib: 1 }); + var Gva = void 0; + function kw() { + ew.call(this); + this.o9 = null; + } + kw.prototype = new Mja(); + kw.prototype.constructor = kw; + kw.prototype.PD = function(a10) { + return this.wc.GN ? a10 === this.o9 ? "./" : a10.split(this.o9).join("") : a10; + }; + kw.prototype.$classData = r8({ TDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedEmissionContext", { TDa: 1, Uga: 1, f: 1 }); + function Uja() { + this.kf = this.Zw = this.pg = this.wc = this.s = null; + } + Uja.prototype = new u7(); + Uja.prototype.constructor = Uja; + d7 = Uja.prototype; + d7.hW = function(a10) { + this.s.Tba(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + e10.kg("@graph", w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Uk(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + k10.kf = m10; + var p10 = hd(l10.Y(), Af().Ic); + m10 = hd(l10.Y(), Af().xc); + p10.b() ? p10 = y7() : (p10 = p10.c(), p10 = new z7().d(p10.r.r.wb)); + p10 = p10.b() ? H10() : p10.c(); + m10.b() ? m10 = y7() : (m10 = m10.c(), m10 = new z7().d(m10.r.r.wb)); + m10 = m10.b() ? H10() : m10.c(); + yi(k10.pg.Ph, p10); + yi(k10.pg.Q, m10); + it2(l10.Y(), Af().Ic); + it2(l10.Y(), Af().xc); + for (xCa(k10, l10); !k10.Zw.LE.b(); ) + fta(k10.Zw.LE).DG.P(k10.kf); + for (yCa(k10, l10); !k10.Zw.LE.b(); ) + m10 = fta(k10.Zw.LE), k10.pg.zr = m10.qu, k10.pg.uw = m10.ru, m10.DG.P(k10.kf); + }; + }(f10, g10))); + }; + }(b10, c10))); + Qja(b10.pg, e10); + }; + }(this, a10))); + }; + d7.gO = function(a10, b10) { + a10.Gi(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + uN(c10, f10, e10.j); + }; + }(this, b10))); + vN(this.Zw, zCa(this, b10)); + }; + d7.E9 = function(a10, b10, c10, e10) { + tc(e10.ju) && (b10.VL ? c10.kg("smaps", w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Gi(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + wN(l10, m10, t10, p10.ju); + }; + }(f10, g10, h10))); + }; + }(this, a10, e10))) : c10.kg(gw(this.pg, ic(nc().bb.r)), w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Uk(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + t10.Gi(w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + uN(v10, C10, A10); + C10 = new ACa().KK(v10, A10, D10); + C10.kt = new z7().d(A10); + C10.qu = v10.pg.zr; + C10.ru = v10.pg.uw; + vN(v10.Zw, C10); + }; + }(l10, m10, p10))); + }; + }(f10, g10, h10))); + }; + }(this, a10, e10)))); + }; + d7.rT = function(a10, b10) { + var c10 = Za(b10), e10 = Za(b10); + if (!e10.b()) { + e10 = e10.c(); + var f10 = db().pf; + eb(b10, f10, e10.j); + it2(b10.Y(), db().te); + } + a10.Gi(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + uN(g10, k10, h10.j); + vN(g10.Zw, zCa(g10, h10)); + }; + }(this, b10))); + c10.b() || (a10 = c10.c(), Ui(b10.Y(), db().te, a10, (O7(), new P6().a()))); + }; + d7.b0 = function(a10, b10, c10) { + this.wc.pS && tc(b10.x) ? this.wc.VL ? c10.kg("smaps", w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.Gi(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + wN(k10, l10, p10, m10.x); + wN(k10, l10, p10, m10.ju); + }; + }(e10, f10, g10))); + }; + }(this, a10, b10))) : c10.kg(gw(this.pg, ic(nc().bb.r)), w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.Uk(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + p10.Gi(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + uN(t10, D10, v10); + D10 = new BCa().KK(t10, v10, A10); + D10.kt = new z7().d(v10); + D10.qu = t10.pg.zr; + D10.ru = t10.pg.uw; + vN(t10.Zw, D10); + }; + }(k10, l10, m10))); + }; + }(e10, f10, g10))); + }; + }(this, a10, b10))) : this.E9(a10, this.wc, c10, b10); + }; + function CCa(a10, b10, c10) { + b10.kg("@type", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Uk(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = k10.Kb(), p10 = /* @__PURE__ */ function() { + return function(D10) { + return ic(D10); + }; + }(h10), t10 = ii().u; + if (t10 === ii().u) + if (m10 === H10()) + p10 = H10(); + else { + t10 = m10.ga(); + var v10 = t10 = ji(p10(t10), H10()); + for (m10 = m10.ta(); m10 !== H10(); ) { + var A10 = m10.ga(); + A10 = ji(p10(A10), H10()); + v10 = v10.Nf = A10; + m10 = m10.ta(); + } + p10 = t10; + } + else { + for (t10 = se4(m10, t10); !m10.b(); ) + v10 = m10.ga(), t10.jd(p10(v10)), m10 = m10.ta(); + p10 = t10.Rc(); + } + for (p10 = xN(p10); !p10.b(); ) + m10 = p10.ga(), m10 = gw(h10.pg, m10), l10.fo(m10), p10 = p10.ta(); + }; + }(e10, f10))); + }; + }(a10, c10))); + } + d7.Kw = function(a10, b10, c10) { + c10 ? this.sT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.sT(g10, f10); + }; + }(this, b10))); + }; + d7.GT = function(a10, b10, c10) { + if (!this.pg.Ph.Ha(a10)) { + DCa(this.pg.Ph, a10); + var e10 = B6(a10.Y(), qf().R).A; + y7() === e10 ? (O7(), e10 = new P6().a(), Sd(a10, "inline-type", e10), a10.fa().Lb(new yN().a())) : (e10 = e10 instanceof z7 && "schema" === e10.i ? true : e10 instanceof z7 && "type" === e10.i ? true : false, e10 ? a10.fa().Lb(new yN().a()) : wh(a10.fa(), q5(cv)) || a10.fa().Lb(new yN().a())); + } + e10 = B6(a10.Y(), qf().R).A; + e10 = e10.b() ? null : e10.c(); + if (a10 instanceof zi) { + var f10 = "" + a10.j + e10; + f10 = ta(ua(), f10); + var g10 = new S6().a(); + O7(); + var h10 = new P6().a(); + g10 = new zi().K(g10, h10); + f10 = Rd(g10, a10.j + "/link-" + f10); + a10 = jb(f10, a10); + f10 = db().ed; + a10 = eb(a10, f10, e10); + } else + a10 = a10.Ug(e10, (O7(), new P6().a())); + this.vE(b10, a10, c10); + }; + d7.v3 = function(a10, b10, c10, e10, f10) { + CCa(this, f10, e10, new z7().d(b10)); + var g10; + if (RM(b10) && hd(b10.Y(), Zf().xj).na()) { + var h10 = e10.Ub(); + ii(); + for (g10 = new Lf().a(); !h10.b(); ) { + var k10 = h10.ga(), l10 = k10, m10 = Zf().Rd; + false !== !(null === l10 ? null === m10 : l10.h(m10)) && Dg(g10, k10); + h10 = h10.ta(); + } + g10 = g10.ua(); + } else + g10 = e10.Ub(); + AB(e10) ? (e10 = K7(), h10 = [ny(), nC()], e10 = J5(e10, new Ib().ha(h10))) : e10 = H10(); + h10 = ii(); + e10 = g10.ia(e10, h10.u); + b10 instanceof Xk && this.wc.UW && (g10 = F6().NM.he + "/properties", f10.kg(g10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = Ac(), D10 = ih(new jh(), ls(t10).jb(), new P6().a()); + O7(); + var C10 = new P6().a(); + D10 = kh(D10, C10); + C10 = /* @__PURE__ */ function() { + return function() { + }; + }(p10); + if (yc().h(A10)) + p10.Kw(v10, D10.r.t(), false), C10(D10); + else if (zN().h(A10)) + p10.SE(v10, D10.r.t(), false), C10(D10); + else if (SM().h(A10)) + p10.Jf(v10, D10.r.t(), Uh().zp, false), C10(D10); + else if (qb().h(A10)) { + A10 = D10.r; + var I10 = FF(); + p10.ut(v10, A10, I10); + C10(D10); + } else if (zc().h(A10)) + A10 = D10.r, I10 = AN(), p10.ut(v10, A10, I10), C10(D10); + else if (Ac().h(A10)) + A10 = D10.r, I10 = BN(), p10.ut(v10, A10, I10), C10(D10); + else if (hi().h(A10)) + A10 = D10.r, I10 = CN2(), p10.ut(v10, A10, I10), C10(D10); + else if (et3().h(A10)) + A10 = D10.r, I10 = CN2(), p10.ut(v10, A10, I10), C10(D10); + else if (TM().h(A10)) + p10.Jf(v10, D10.r.r.t(), Uh().tj, false), C10(D10); + else if (ZL().h(A10)) { + A10 = D10.r.r; + A10 = A10 instanceof DN ? new z7().d(A10) : jH(mF(), ka(A10)).pk(); + if (A10 instanceof z7) { + var L10 = A10.i; + if (L10.Bt.na() || L10.Et.na()) + p10.Jf(v10, L10.t(), Uh().tj, false); + else { + A10 = L10.JA; + I10 = L10.mA; + L10 = L10.Oz; + var Y10 = new qg().e("%04d-%02d-%02d"); + L10 = [A10, I10, L10]; + ua(); + A10 = Y10.ja; + K7(); + vk(); + I10 = []; + Y10 = 0; + for (var ia = L10.length | 0; Y10 < ia; ) + I10.push(EN(L10[Y10])), Y10 = 1 + Y10 | 0; + CJ(); + L10 = I10.length | 0; + L10 = ja(Ja(Ha), [L10]); + var pa = L10.n.length; + ia = Y10 = 0; + var La = I10.length | 0; + pa = La < pa ? La : pa; + La = L10.n.length; + for (pa = pa < La ? pa : La; Y10 < pa; ) + L10.n[ia] = I10[Y10], Y10 = 1 + Y10 | 0, ia = 1 + ia | 0; + p10.Jf(v10, PK(A10, L10), Uh().jo, false); + } + } else + A10 = D10.r, I10 = FF(), p10.ut(v10, A10, I10); + C10(D10); + } else if (Bc() === A10 && D10.r instanceof jh) + D10 = D10.r.r, "boolean" === typeof D10 ? p10.Jf(v10, "" + !!D10, Uh().Mi, true) : Ca(D10) ? p10.Jf(v10, "" + (D10 | 0), Uh().hi, true) : na(D10) ? p10.Jf(v10, "" + +D10, Uh().of, true) : "number" === typeof D10 ? p10.Jf(v10, "" + +D10, Uh().Nh, true) : D10 instanceof DN ? p10.QD(v10, D10, true) : p10.co(v10, ka(D10), FF()); + else + throw new x7().d(A10); + }; + }(this, b10, a10)))); + for (; !e10.b(); ) + g10 = e10.ga(), this.c$(g10, b10, a10, c10, f10), e10 = e10.ta(); + }; + d7.SE = function(a10, b10, c10) { + c10 ? this.tT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.tT(g10, f10); + }; + }(this, b10))); + }; + function ECa(a10, b10, c10) { + var e10 = b10.j; + uN(a10, c10, e10); + var f10 = Sr(rc(), e10, b10), g10 = kb(b10); + a10.v3(e10, b10, f10, g10, c10); + a10.a0(b10, c10); + b10 = Ed(ua(), e10, "/") ? e10 + "source-map" : -1 !== (e10.indexOf("#") | 0) || 0 <= (e10.length | 0) && "null" === e10.substring(0, 4) ? e10 + "/source-map" : e10 + "#/source-map"; + a10.b0(b10, f10, c10); + } + d7.cT = function(a10, b10, c10, e10) { + a10.kg(b10, w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Gi(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + uN(l10, t10, B6(m10.g, Ud().zi).j); + t10 = new FCa().caa(l10, m10, p10); + t10.kt = new z7().d(B6(m10.g, Ud().zi).j); + t10.qu = l10.pg.zr; + t10.ru = l10.pg.uw; + vN(l10.Zw, t10); + }; + }(f10, g10, h10))); + }; + }(this, c10, e10))); + }; + d7.Jf = function(a10, b10, c10, e10) { + e10 ? this.uT(a10, b10, c10) : a10.Uk(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + f10.uT(k10, g10, h10); + }; + }(this, b10, c10))); + }; + d7.G9 = function(a10, b10, c10, e10, f10, g10) { + a10.Uk(w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + v10.Gi(w6(/* @__PURE__ */ function(A10, D10, C10, I10, L10, Y10) { + return function(ia) { + uN(A10, ia, D10 + "/list"); + var pa = A10.pg, La = F6().Ul; + Rja(ia, "@type", gw(pa, ic(G5(La, "Seq")))); + pa = K7(); + C10.og(pa.u).U(w6(/* @__PURE__ */ function(ob, zb, Zb) { + return function(Cc) { + if (null !== Cc) { + var vc = Cc.ma(); + Cc = Cc.Ki(); + var id = ob.pg, yd = F6().Ul; + zb.kg(gw(id, ic(G5(yd, "_" + (1 + Cc | 0)))), w6(/* @__PURE__ */ function(zd, rd, sd) { + return function(le4) { + le4.Uk(w6(/* @__PURE__ */ function(Vc, Sc, Qc) { + return function($c) { + if (Dr(Sc)) + if (Rk(Qc) && ut(Qc) && Za(Qc).na()) + Vc.vE( + $c, + Qc, + true + ); + else if (lb(Qc)) + Vc.gO($c, Qc); + else + throw new x7().d(Qc); + else if (qb().h(Sc)) + Vc.ut($c, Qc, FF()); + else if (zN().h(Sc)) + Vc.SE($c, Qc.t(), true); + else if (yc().h(Sc)) + Vc.Kw($c, Qc.t(), true); + else if (Bc() === Sc) { + var Wc = Qc.r; + "boolean" === typeof Wc ? Vc.Jf($c, "" + !!Wc, Uh().Mi, true) : sp(Wc) ? Vc.Jf($c, Wc, Uh().zj, true) : Ca(Wc) ? Vc.Jf($c, "" + (Wc | 0), Uh().hi, true) : na(Wc) ? Vc.Jf($c, "" + +Wc, Uh().of, true) : "number" === typeof Wc ? Vc.Jf($c, "" + +Wc, Uh().Nh, true) : Vc.co($c, ka(Wc), FF()); + } else + throw new x7().d(Sc); + }; + }(zd, rd, sd))); + }; + }(ob, Zb, vc))); + } else + throw new x7().d(Cc); + }; + }(A10, ia, I10))); + L10.b() || Y10.P(L10.c()); + }; + }(h10, k10, l10, m10, p10, t10))); + }; + }(this, c10, b10, e10, g10, f10))); + }; + d7.vM = function(a10, b10, c10, e10, f10) { + if (AB(a10) && wh(b10.r.fa(), q5(GCa)) && this.xW(b10.r, c10)) + this.GT(b10.r, f10, false); + else if (Rk(a10) && ut(a10) && Za(a10).na()) + this.vE(f10, a10, false), e10.P(b10); + else if (Dr(a10)) + this.gO(f10, b10.r), e10.P(b10); + else if (yc().h(a10)) + this.Kw(f10, b10.r.t(), false), e10.P(b10); + else if (zN().h(a10)) + this.SE(f10, b10.r.t(), false), e10.P(b10); + else if (SM().h(a10)) + this.Jf(f10, b10.r.t(), Uh().zp, false), e10.P(b10); + else if (qb().h(a10)) + a10 = b10.r, c10 = FF(), this.ut(f10, a10, c10), e10.P(b10); + else if (zc().h(a10)) + a10 = b10.r, c10 = AN(), this.ut(f10, a10, c10), e10.P(b10); + else if (Ac().h(a10)) + a10 = b10.r, c10 = BN(), this.ut(f10, a10, c10), e10.P(b10); + else if (hi().h(a10)) + a10 = b10.r, c10 = CN2(), this.ut(f10, a10, c10), e10.P(b10); + else if (et3().h(a10)) + a10 = b10.r, c10 = CN2(), this.ut(f10, a10, c10), e10.P(b10); + else if (TM().h(a10)) + this.Jf(f10, b10.r.r.t(), Uh().tj, false), e10.P(b10); + else if (ZL().h(a10)) { + a10 = b10.r.r; + a10 = a10 instanceof DN ? new z7().d(a10) : jH(mF(), ka(a10)).pk(); + if (a10 instanceof z7) { + var g10 = a10.i; + if (g10.Bt.na() || g10.Et.na()) + this.Jf(f10, g10.t(), Uh().tj, false); + else { + a10 = g10.JA; + c10 = g10.mA; + g10 = g10.Oz; + var h10 = new qg().e("%04d-%02d-%02d"); + g10 = [a10, c10, g10]; + ua(); + a10 = h10.ja; + K7(); + vk(); + c10 = []; + h10 = 0; + for (var k10 = g10.length | 0; h10 < k10; ) + c10.push(EN(g10[h10])), h10 = 1 + h10 | 0; + CJ(); + g10 = c10.length | 0; + g10 = ja(Ja(Ha), [g10]); + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + this.Jf(f10, PK(a10, g10), Uh().jo, false); + } + } else + a10 = b10.r, c10 = FF(), this.ut(f10, a10, c10); + e10.P(b10); + } else if (a10 instanceof UM) + this.G9(f10, b10.r.wb, c10, a10.Fe, e10, new z7().d(b10)); + else if (a10 instanceof xc) + f10.Uk(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = t10.r; + v10.P(t10); + var L10 = A10.Fe; + Dr(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia, pa) { + return function(La) { + La instanceof rf && wh(La.fa(), q5(GCa)) && Y10.xW(La, ia) ? Y10.GT(La, pa, true) : Rk(La) && ut(La) && Za(La).na() ? Y10.vE(pa, La, true) : Y10.gO(pa, La); + }; + }( + p10, + D10, + C10 + ))) : qb().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + pa = pa.t(); + Y10.co(ia, pa, FF()); + }; + }(p10, C10))) : zN().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.SE(ia, pa.t(), true); + }; + }(p10, C10))) : yc().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.Kw(ia, pa.t(), true); + }; + }(p10, C10))) : SM().h(L10) ? p10.Jf(C10, t10.r.t(), Uh().zp, true) : Ac().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.co(ia, ka(pa.r), BN()); + }; + }(p10, C10))) : et3().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.co(ia, ka(pa.r), CN2()); + }; + }(p10, C10))) : zc().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.co( + ia, + ka(pa.r), + AN() + ); + }; + }(p10, C10))) : TM().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.Jf(ia, pa.r.t(), Uh().tj, false); + }; + }(p10, C10))) : ZL().h(L10) ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.QD(ia, pa.r, false); + }; + }(p10, C10))) : Bc() === L10 ? I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + pa = pa.r; + "boolean" === typeof pa ? Y10.Jf(ia, "" + !!pa, Uh().Mi, true) : Ca(pa) ? Y10.Jf(ia, "" + (pa | 0), Uh().hi, true) : na(pa) ? Y10.Jf(ia, "" + +pa, Uh().of, true) : "number" === typeof pa ? Y10.Jf(ia, "" + +pa, Uh().Nh, true) : pa instanceof DN ? Y10.QD(ia, pa, true) : Y10.co(ia, ka(pa), FF()); + }; + }(p10, C10))) : I10.wb.U(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + Y10.Kw(ia, pa.t(), true); + }; + }(p10, C10))); + }; + }(this, b10, e10, a10, c10))); + else if (Bc() === a10 && b10.r instanceof jh) + b10 = b10.r.r, "boolean" === typeof b10 ? this.Jf(f10, "" + !!b10, Uh().Mi, true) : Ca(b10) ? this.Jf(f10, "" + (b10 | 0), Uh().hi, true) : na(b10) ? this.Jf(f10, "" + +b10, Uh().of, true) : "number" === typeof b10 ? this.Jf(f10, "" + +b10, Uh().Nh, true) : b10 instanceof DN ? this.QD(f10, b10, true) : this.co(f10, ka(b10), FF()); + else + throw new x7().d(a10); + }; + d7.Daa = function(a10, b10, c10) { + this.s = a10; + this.wc = b10; + this.pg = c10; + this.Zw = new FN().a(); + return this; + }; + d7.tT = function(a10, b10) { + a10.Gi(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10.kg("@id", w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.pg.PD(h10); + k10.fo(l10); + }; + }(c10, e10))); + }; + }(this, b10))); + }; + d7.uT = function(a10, b10, c10) { + a10.Gi(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.kg("@value", w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10.fo(l10); + }; + }(e10, f10))); + h10.kg("@type", w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = gw(k10.pg, l10); + m10.fo(p10); + }; + }(e10, g10))); + }; + }(this, b10, c10))); + }; + function uN(a10, b10, c10) { + b10.kg("@id", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = e10.pg.PD(f10); + g10.fo(h10); + }; + }(a10, c10))); + } + d7.c$ = function(a10, b10, c10, e10, f10) { + a10 = a10.fP ? hd(b10.Y(), a10) : y7(); + a: { + if (a10 instanceof z7 && (b10 = a10.i, null !== b10)) { + a10 = b10.Lc; + b10 = b10.r; + var g10 = gw(this.pg, ic(a10.r)); + f10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, a10, b10, c10, e10, g10))); + break a; + } + if (y7() !== a10) + throw new x7().d(a10); + } + }; + function yCa(a10, b10) { + a10.kf.Gi(w6(/* @__PURE__ */ function(c10, e10, f10) { + return function(g10) { + uN(c10, g10, e10); + c10.a$(g10, f10.j, Sr(rc(), f10.j, f10)); + c10.Z9(g10, f10.j, Sr(rc(), f10.j, f10)); + var h10 = Sr(rc(), e10, f10), k10 = kb(f10); + c10.v3(e10, f10, h10, k10, g10); + c10.a0(f10, g10); + k10 = Ed(ua(), e10, "/") ? e10 + "source-map" : -1 !== (e10.indexOf("#") | 0) || 0 <= (e10.length | 0) && "null" === e10.substring(0, 4) ? e10 + "/source-map" : e10 + "#/source-map"; + c10.b0(k10, h10, g10); + }; + }(a10, b10.j, b10))); + } + d7.QD = function(a10, b10, c10) { + if (b10.Bt.na() || b10.Et.na()) + this.Jf(a10, b10.t(), Uh().tj, c10); + else { + c10 = b10.JA; + var e10 = b10.mA; + b10 = b10.Oz; + var f10 = new qg().e("%04d-%02d-%02d"); + b10 = [c10, e10, b10]; + ua(); + c10 = f10.ja; + K7(); + vk(); + e10 = []; + f10 = 0; + for (var g10 = b10.length | 0; f10 < g10; ) + e10.push(EN(b10[f10])), f10 = 1 + f10 | 0; + CJ(); + b10 = e10.length | 0; + b10 = ja(Ja(Ha), [b10]); + var h10 = b10.n.length; + g10 = f10 = 0; + var k10 = e10.length | 0; + h10 = k10 < h10 ? k10 : h10; + k10 = b10.n.length; + for (h10 = h10 < k10 ? h10 : k10; f10 < h10; ) + b10.n[g10] = e10[f10], f10 = 1 + f10 | 0, g10 = 1 + g10 | 0; + this.Jf(a10, PK(c10, b10), Uh().jo, false); + } + }; + d7.ut = function(a10, b10, c10) { + this.co(a10, ka(b10.r), c10); + }; + d7.vE = function(a10, b10, c10) { + c10 ? this.rT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.rT(g10, f10); + }; + }(this, b10))); + }; + function zCa(a10, b10) { + var c10 = b10.j; + b10 = new HCa().baa(a10, b10); + b10.kt = new z7().d(c10); + b10.qu = a10.pg.zr; + b10.ru = a10.pg.uw; + return b10; + } + function xCa(a10, b10) { + b10.Y().vb.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + f10 = f10.ba; + Dr(f10) ? vN(c10.Zw, zCa(c10, e10.r)) : f10 instanceof ht2 && e10.r.wb.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (lb(h10)) + return vN(g10.Zw, zCa(g10, h10)); + }; + }(c10))); + } else + throw new x7().d(e10); + }; + }(a10))); + } + d7.xW = function(a10, b10) { + a10 = this.pg.Ph.Ha(a10); + b10 = Nja(this.pg, b10); + return !this.pg.zr && !this.pg.uw || a10 && b10; + }; + d7.a0 = function(a10, b10) { + var c10 = J5(Ef(), H10()), e10 = hd(a10.Y(), Yd(nc())); + if (!e10.b()) + if (e10 = e10.c(), null !== e10) + e10 = e10.r.r, e10 instanceof $r && e10.wb.ei(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.j; + }; + }(this)), mc()).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + if (k10 instanceof Td) { + var l10 = B6(k10.g, Ud().ig).j; + Dg(g10, l10); + f10.cT(h10, l10, k10, y7()); + } else + throw new x7().d(k10); + }; + }(this, c10, b10))); + else + throw new x7().d(e10); + e10 = new lC().ue(1); + a10.Y().vb.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(), t10 = m10.ya().r.fa(); + m10 = new ICa(); + t10 = t10.hf; + var v10 = Ef().u; + xs(t10, m10, v10).ei( + w6(/* @__PURE__ */ function() { + return function(A10) { + return A10.cp.j; + }; + }(f10)), + mc() + ).U(w6(/* @__PURE__ */ function(A10, D10, C10, I10, L10, Y10) { + return function(ia) { + ia = ia.cp; + var pa = D10.j, La = C10.oa, ob = B6(ia.g, Ud().R).A; + pa = pa + "/scalar-valued/" + La + "/" + (ob.b() ? null : ob.c()); + Dg(I10, pa); + js(ks(), pa, B6(ia.g, Ud().zi)); + A10.cT(L10, pa, ia, new z7().d(Y10)); + C10.oa = 1 + C10.oa | 0; + }; + }(f10, g10, h10, k10, l10, p10))); + } else + throw new x7().d(m10); + }; + }(this, a10, e10, c10, b10))); + c10.Da() && b10.kg(gw(this.pg, ic(Yd(nc()).r)), w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Uk(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + for (var p10 = l10.Dc; !p10.b(); ) { + var t10 = p10.ga(); + k10.Kw(m10, t10, true); + p10 = p10.ta(); + } + }; + }(f10, g10))); + }; + }(this, c10))); + }; + d7.D9 = function(a10, b10, c10) { + if (null !== c10) { + var e10 = c10.ma(); + c10 = c10.ya(); + b10.Gi(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + uN(f10, h10, g10); + }; + }(this, a10))); + b10 = new JCa().daa(this, a10, e10, c10); + b10.kt = new z7().d(a10); + b10.qu = this.pg.zr; + b10.ru = this.pg.uw; + vN(this.Zw, b10); + } else + throw new x7().d(c10); + }; + d7.sT = function(a10, b10) { + a10.Gi(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10.kg("@id", w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.pg.PD(h10); + k10.fo(l10); + }; + }(c10, e10))); + }; + }(this, b10))); + }; + d7.a$ = function(a10, b10, c10) { + if (GN(this.pg.Q).Da()) { + var e10 = Zr(new $r(), GN(this.pg.Q), new P6().a()); + O7(); + var f10 = new P6().a(); + e10 = kh(e10, f10); + f10 = Af().xc; + var g10 = gw(this.pg, ic(f10.r)); + this.pg.uw = true; + a10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, f10, e10, b10, c10, g10))); + } + this.pg.uw = false; + }; + d7.co = function(a10, b10, c10) { + a10.jX(KCa(LCa(), c10, b10)); + }; + d7.Z9 = function(a10, b10, c10) { + if (GN(this.pg.Ph).Da()) { + var e10 = Zr(new $r(), GN(this.pg.Ph), new P6().a()); + O7(); + var f10 = new P6().a(); + e10 = kh(e10, f10); + f10 = Af().Ic; + var g10 = gw(this.pg, ic(f10.r)); + this.pg.zr = true; + a10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, f10, e10, b10, c10, g10))); + } + this.pg.zr = false; + }; + function wN(a10, b10, c10, e10) { + for (e10 = uc(e10.yf); e10.Ya(); ) { + var f10 = e10.$a(); + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + if (a10.pg.wc.VL) + c10.kg(g10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.Gi(w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + for (var D10 = uc(v10.yf); D10.Ya(); ) { + var C10 = D10.$a(); + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.ya(); + A10.kg(t10.pg.PD(gw(t10.pg, I10)), w6(/* @__PURE__ */ function(L10, Y10) { + return function(ia) { + ia.fo(Y10); + }; + }(t10, C10))); + } else + throw new x7().d(C10); + } + }; + }(l10, m10))); + }; + }(a10, f10))); + else { + var h10 = a10.pg, k10 = F6().ez; + c10.kg(gw(h10, ic(G5(k10, g10))), w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + v10.Uk(w6(/* @__PURE__ */ function(A10, D10, C10, I10) { + return function(L10) { + var Y10 = Qr(); + Y10 = zC(Y10); + HN(D10, Y10).U(w6(/* @__PURE__ */ function(ia, pa, La, ob) { + return function(zb) { + if (null !== zb) { + var Zb = zb.ma(); + zb = zb.Ki(); + ia.D9(pa + "/" + La + "/element_" + zb, ob, Zb); + } else + throw new x7().d(zb); + }; + }(A10, C10, I10, L10))); + }; + }(l10, m10, p10, t10))); + }; + }(a10, f10, b10, g10))); + } + } else + throw new x7().d(f10); + } + } + d7.$classData = r8({ VDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter", { VDa: 1, f: 1, lm: 1 }); + function Wja() { + this.Wg = this.m = this.wc = this.s = null; + } + Wja.prototype = new u7(); + Wja.prototype.constructor = Wja; + d7 = Wja.prototype; + d7.hW = function(a10) { + var b10 = hd(a10.Y(), Af().Ic), c10 = hd(a10.Y(), Af().xc); + MCa(this, b10, c10); + it2(a10.Y(), Af().Ic); + it2(a10.Y(), Af().xc); + this.s.nba(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Gi(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + NCa(h10, k10, l10); + h10.a$(l10, k10.j, Sr(rc(), k10.j, k10)); + h10.Z9(l10, k10.j, Sr(rc(), k10.j, k10)); + Qja(h10.m, l10); + }; + }(e10, f10))); + }; + }(this, a10))); + b10.b() || (b10 = b10.c(), Ui(a10.Y(), Af().Ic, b10.r.r, (O7(), new P6().a()))); + c10.b() || (c10 = c10.c(), Ui(a10.Y(), Af().xc, c10.r.r, (O7(), new P6().a()))); + }; + d7.gO = function(a10, b10) { + var c10 = this.Wg.Ja(b10.j); + if (c10 instanceof z7) + a10.Y4(c10.i); + else if (y7() === c10) + a10 = a10.Gi(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + NCa(e10, f10, g10); + }; + }(this, b10))), a10.b() || (a10 = a10.c(), this.Wg.Ue(b10.j, a10)); + else + throw new x7().d(c10); + }; + d7.E9 = function(a10, b10, c10, e10) { + tc(e10.ju) && (b10.VL ? c10.kg("smaps", w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Gi(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + IN(l10, m10, t10, p10.ju); + }; + }(f10, g10, h10))); + }; + }(this, a10, e10))) : c10.kg(gw(this.m, ic(nc().bb.r)), w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Uk(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + t10.Gi(w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + OCa(v10, C10, A10); + PCa(v10, C10, oc(), y7()); + IN(v10, A10, C10, D10.ju); + }; + }(l10, m10, p10))); + }; + }(f10, g10, h10))); + }; + }(this, a10, e10)))); + }; + d7.rT = function(a10, b10) { + var c10 = Za(b10), e10 = Za(b10); + if (!e10.b()) { + e10 = e10.c(); + var f10 = db().pf; + eb(b10, f10, e10.j); + it2(b10.Y(), db().te); + } + a10.Gi(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + NCa(g10, h10, k10); + }; + }(this, b10))); + c10.b() || (a10 = c10.c(), Ui(b10.Y(), db().te, a10, (O7(), new P6().a()))); + }; + d7.b0 = function(a10, b10, c10) { + this.wc.pS && tc(b10.x) ? this.wc.VL ? c10.kg("smaps", w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.Gi(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + IN(k10, l10, p10, m10.x); + IN(k10, l10, p10, m10.ju); + }; + }(e10, f10, g10))); + }; + }(this, a10, b10))) : c10.kg(gw(this.m, ic(nc().bb.r)), w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.Uk(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + p10.Gi(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + OCa(t10, D10, v10); + PCa(t10, D10, oc(), y7()); + IN(t10, v10, D10, A10.x); + IN(t10, v10, D10, A10.ju); + }; + }(k10, l10, m10))); + }; + }(e10, f10, g10))); + }; + }(this, a10, b10))) : this.E9(a10, this.wc, c10, b10); + }; + function PCa(a10, b10, c10) { + b10.kg("@type", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Uk(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = k10.Kb(), p10 = /* @__PURE__ */ function() { + return function(D10) { + return ic(D10); + }; + }(h10), t10 = ii().u; + if (t10 === ii().u) + if (m10 === H10()) + p10 = H10(); + else { + t10 = m10.ga(); + var v10 = t10 = ji(p10(t10), H10()); + for (m10 = m10.ta(); m10 !== H10(); ) { + var A10 = m10.ga(); + A10 = ji(p10(A10), H10()); + v10 = v10.Nf = A10; + m10 = m10.ta(); + } + p10 = t10; + } + else { + for (t10 = se4(m10, t10); !m10.b(); ) + v10 = m10.ga(), t10.jd(p10(v10)), m10 = m10.ta(); + p10 = t10.Rc(); + } + for (p10 = xN(p10); !p10.b(); ) + m10 = p10.ga(), m10 = gw(h10.m, m10), l10.fo(m10), p10 = p10.ta(); + }; + }(e10, f10))); + }; + }(a10, c10))); + } + d7.Kw = function(a10, b10, c10) { + c10 ? this.sT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.sT(g10, f10); + }; + }(this, b10))); + }; + function QCa(a10, b10, c10) { + var e10 = FF(); + b10.Uk(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + f10.co(k10, g10, h10); + }; + }(a10, c10, e10))); + } + d7.GT = function(a10, b10, c10) { + if (!this.m.Ph.Ha(a10)) { + DCa(this.m.Ph, a10); + var e10 = B6(a10.Y(), qf().R).A; + y7() === e10 ? (O7(), e10 = new P6().a(), Sd(a10, "inline-type", e10), a10.fa().Lb(new yN().a())) : (e10 = e10 instanceof z7 && "schema" === e10.i ? true : e10 instanceof z7 && "type" === e10.i ? true : false, e10 ? a10.fa().Lb(new yN().a()) : wh(a10.fa(), q5(cv)) || a10.fa().Lb(new yN().a())); + } + e10 = B6(a10.Y(), qf().R).A; + e10 = e10.b() ? null : e10.c(); + if (a10 instanceof zi) { + var f10 = "" + a10.j + e10; + f10 = ta(ua(), f10); + var g10 = new S6().a(); + O7(); + var h10 = new P6().a(); + g10 = new zi().K(g10, h10); + f10 = Rd(g10, a10.j + "/link-" + f10); + a10 = jb(f10, a10); + f10 = db().ed; + a10 = eb(a10, f10, e10); + } else + a10 = a10.Ug(e10, (O7(), new P6().a())); + this.vE(b10, a10, c10); + }; + d7.v3 = function(a10, b10, c10, e10, f10) { + PCa(this, f10, e10, new z7().d(b10)); + var g10; + if (RM(b10) && hd(b10.Y(), Zf().xj).na()) { + var h10 = e10.Ub(); + ii(); + for (g10 = new Lf().a(); !h10.b(); ) { + var k10 = h10.ga(), l10 = k10, m10 = Zf().Rd; + false !== !(null === l10 ? null === m10 : l10.h(m10)) && Dg(g10, k10); + h10 = h10.ta(); + } + g10 = g10.ua(); + } else + g10 = e10.Ub(); + AB(e10) ? (e10 = K7(), h10 = [ny(), nC()], e10 = J5(e10, new Ib().ha(h10))) : e10 = H10(); + h10 = ii(); + e10 = g10.ia(e10, h10.u); + b10 instanceof Xk && this.wc.UW && (g10 = F6().NM.he + "/properties", f10.kg(g10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = Ac(), D10 = ih(new jh(), ls(t10).jb(), new P6().a()); + O7(); + var C10 = new P6().a(); + D10 = kh(D10, C10); + C10 = /* @__PURE__ */ function() { + return function() { + }; + }(p10); + if (yc().h(A10)) + p10.Kw(v10, D10.r.t(), false), C10(D10); + else if (zN().h(A10)) + p10.SE(v10, D10.r.t(), false), C10(D10); + else if (SM().h(A10)) + p10.Jf(v10, D10.r.t(), Uh().zp, false), C10(D10); + else if (qb().h(A10)) + JN(p10, v10, D10.r, FF()), C10(D10); + else if (zc().h(A10)) + JN(p10, v10, D10.r, AN()), C10(D10); + else if (Ac().h(A10)) + JN(p10, v10, D10.r, BN()), C10(D10); + else if (hi().h(A10)) + JN(p10, v10, D10.r, CN2()), C10(D10); + else if (et3().h(A10)) + JN(p10, v10, D10.r, CN2()), C10(D10); + else if (TM().h(A10)) + p10.Jf(v10, D10.r.r.t(), Uh().tj, false), C10(D10); + else if (ZL().h(A10)) + A10 = D10.r.r, A10 = A10 instanceof DN ? new z7().d(A10) : jH(mF(), ka(A10)).pk(), A10 instanceof z7 ? (A10 = A10.i, p10.Jf(v10, A10.t(), A10.Bt.na() || A10.Et.na() ? Uh().tj : Uh().jo, false)) : JN(p10, v10, D10.r, FF()), C10(D10); + else if (Bc() === A10 && D10.r instanceof jh) + D10 = D10.r.r, "boolean" === typeof D10 ? p10.Jf(v10, "" + !!D10, Uh().Mi, true) : Ca(D10) ? p10.Jf(v10, "" + (D10 | 0), Uh().hi, true) : na(D10) ? p10.Jf(v10, "" + +D10, Uh().of, true) : "number" === typeof D10 ? p10.Jf(v10, "" + +D10, Uh().Nh, true) : D10 instanceof DN ? p10.QD(v10, D10, true) : p10.co(v10, ka(D10), FF()); + else + throw new x7().d(A10); + }; + }(this, b10, a10)))); + for (; !e10.b(); ) + g10 = e10.ga(), this.c$(g10, b10, a10, c10, f10), e10 = e10.ta(); + }; + d7.SE = function(a10, b10, c10) { + c10 ? this.tT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.tT(g10, f10); + }; + }(this, b10))); + }; + d7.cT = function(a10, b10, c10, e10) { + a10.kg(b10, w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + k10.Gi(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + t10.kg(gw(l10.m, ic(Ud().R.r)), w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + var I10 = B6(D10.g, Ud().R).A; + I10 = I10.b() ? null : I10.c(); + QCa(A10, C10, I10); + }; + }(l10, m10))); + if (!p10.b()) { + var v10 = p10.c(); + t10.kg(gw(l10.m, ic(Ud().ko.r)), w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + QCa(A10, C10, ic(D10.r)); + }; + }(l10, v10))); + } + NCa(l10, B6(m10.g, Ud().zi), t10); + }; + }(f10, g10, h10))); + }; + }(this, c10, e10))); + }; + function RCa(a10, b10, c10, e10) { + e10 ? a10.gO(b10, c10) : b10.Uk(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + f10.gO(h10, g10); + }; + }(a10, c10))); + } + d7.Jf = function(a10, b10, c10, e10) { + e10 ? this.uT(a10, b10, c10) : a10.Uk(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + f10.uT(k10, g10, h10); + }; + }(this, b10, c10))); + }; + d7.G9 = function(a10, b10, c10, e10, f10, g10) { + a10.Uk(w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + v10.Gi(w6(/* @__PURE__ */ function(A10, D10, C10, I10, L10, Y10) { + return function(ia) { + OCa(A10, ia, D10 + "/list"); + var pa = A10.m, La = F6().Ul; + Rja(ia, "@type", gw(pa, ic(G5(La, "Seq")))); + pa = K7(); + C10.og(pa.u).U(w6(/* @__PURE__ */ function(ob, zb, Zb) { + return function(Cc) { + if (null !== Cc) { + var vc = Cc.ma(); + Cc = Cc.Ki(); + var id = ob.m, yd = F6().Ul; + zb.kg(gw(id, ic(G5(yd, "_" + (1 + Cc | 0)))), w6(/* @__PURE__ */ function(zd, rd, sd) { + return function(le4) { + le4.Uk(w6(/* @__PURE__ */ function(Vc, Sc, Qc) { + return function($c) { + if (Dr(Sc)) + if (Rk(Qc) && ut(Qc) && Za(Qc).na()) + Vc.vE( + $c, + Qc, + true + ); + else if (lb(Qc)) + RCa(Vc, $c, Qc, true); + else + throw new x7().d(Qc); + else if (qb().h(Sc)) + Vc.ut($c, Qc, FF()); + else if (zN().h(Sc)) + Vc.SE($c, Qc.t(), true); + else if (yc().h(Sc)) + Vc.Kw($c, Qc.t(), true); + else if (Bc() === Sc) { + var Wc = Qc.r; + "boolean" === typeof Wc ? Vc.Jf($c, "" + !!Wc, Uh().Mi, true) : sp(Wc) ? Vc.Jf($c, Wc, Uh().zj, true) : Ca(Wc) ? Vc.Jf($c, "" + (Wc | 0), Uh().hi, true) : na(Wc) ? Vc.Jf($c, "" + +Wc, Uh().of, true) : "number" === typeof Wc ? Vc.Jf($c, "" + +Wc, Uh().Nh, true) : Vc.co($c, ka(Wc), FF()); + } else + throw new x7().d(Sc); + }; + }(zd, rd, sd))); + }; + }(ob, Zb, vc))); + } else + throw new x7().d(Cc); + }; + }(A10, ia, I10))); + L10.b() || Y10.P(L10.c()); + }; + }(h10, k10, l10, m10, p10, t10))); + }; + }(this, c10, b10, e10, g10, f10))); + }; + function OCa(a10, b10, c10) { + b10.kg("@id", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = e10.m.PD(f10); + g10.fo(h10); + }; + }(a10, c10))); + } + d7.vM = function(a10, b10, c10, e10, f10) { + if (AB(a10) && wh(b10.r.fa(), q5(GCa)) && this.xW(b10.r, c10)) + this.GT(b10.r, f10, false); + else if (Rk(a10) && ut(a10) && Za(a10).na()) + this.vE(f10, a10, false), e10.P(b10); + else if (Dr(a10)) + RCa(this, f10, b10.r, false), e10.P(b10); + else if (yc().h(a10)) + this.Kw(f10, b10.r.t(), false), e10.P(b10); + else if (zN().h(a10)) + this.SE(f10, b10.r.t(), false), e10.P(b10); + else if (SM().h(a10)) + this.Jf(f10, b10.r.t(), Uh().zp, false), e10.P(b10); + else if (qb().h(a10)) + JN(this, f10, b10.r, FF()), e10.P(b10); + else if (zc().h(a10)) + JN(this, f10, b10.r, AN()), e10.P(b10); + else if (Ac().h(a10)) + JN(this, f10, b10.r, BN()), e10.P(b10); + else if (hi().h(a10)) + JN( + this, + f10, + b10.r, + CN2() + ), e10.P(b10); + else if (et3().h(a10)) + JN(this, f10, b10.r, CN2()), e10.P(b10); + else if (TM().h(a10)) + this.Jf(f10, b10.r.r.t(), Uh().tj, false), e10.P(b10); + else if (ZL().h(a10)) + a10 = b10.r.r, a10 = a10 instanceof DN ? new z7().d(a10) : jH(mF(), ka(a10)).pk(), a10 instanceof z7 ? (a10 = a10.i, this.Jf(f10, a10.t(), a10.Bt.na() || a10.Et.na() ? Uh().tj : Uh().jo, false)) : JN(this, f10, b10.r, FF()), e10.P(b10); + else if (a10 instanceof UM) + this.G9(f10, b10.r.wb, c10, a10.Fe, e10, new z7().d(b10)); + else if (a10 instanceof xc) + f10.Uk(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10) { + return function(p10) { + var t10 = h10.r; + k10.P(h10); + var v10 = l10.Fe; + Dr(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + I10 instanceof rf && wh(I10.fa(), q5(GCa)) && A10.xW(I10, D10) ? A10.GT(I10, C10, true) : Rk(I10) && ut(I10) && Za(I10).na() ? A10.vE(C10, I10, true) : RCa(A10, C10, I10, true); + }; + }(g10, m10, p10))) : qb().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = C10.t(); + A10.co(D10, C10, FF()); + }; + }(g10, p10))) : zN().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.SE(D10, C10.t(), true); + }; + }(g10, p10))) : yc().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.Kw(D10, C10.t(), true); + }; + }(g10, p10))) : SM().h(v10) ? g10.Jf(p10, h10.r.t(), Uh().zp, true) : Ac().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.co(D10, ka(C10.r), BN()); + }; + }(g10, p10))) : et3().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.co( + D10, + ka(C10.r), + CN2() + ); + }; + }(g10, p10))) : zc().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.co(D10, ka(C10.r), AN()); + }; + }(g10, p10))) : TM().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.Jf(D10, C10.r.t(), Uh().tj, false); + }; + }(g10, p10))) : ZL().h(v10) ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.QD(D10, C10.r, false); + }; + }(g10, p10))) : Bc() === v10 ? t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = C10.r; + "boolean" === typeof C10 ? A10.Jf(D10, "" + !!C10, Uh().Mi, true) : Ca(C10) ? A10.Jf(D10, "" + (C10 | 0), Uh().hi, true) : na(C10) ? A10.Jf(D10, "" + +C10, Uh().of, true) : "number" === typeof C10 ? A10.Jf(D10, "" + +C10, Uh().Nh, true) : C10 instanceof DN ? A10.QD(D10, C10, true) : A10.co(D10, ka(C10), FF()); + }; + }(g10, p10))) : t10.wb.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + A10.Kw(D10, C10.t(), true); + }; + }(g10, p10))); + }; + }(this, b10, e10, a10, c10))); + else if (Bc() === a10 && b10.r instanceof jh) + b10 = b10.r.r, "boolean" === typeof b10 ? this.Jf(f10, "" + !!b10, Uh().Mi, true) : Ca(b10) ? this.Jf(f10, "" + (b10 | 0), Uh().hi, true) : na(b10) ? this.Jf(f10, "" + +b10, Uh().of, true) : "number" === typeof b10 ? this.Jf(f10, "" + +b10, Uh().Nh, true) : b10 instanceof DN ? this.QD(f10, b10, true) : this.co(f10, ka(b10), FF()); + else + throw new x7().d(a10); + }; + d7.Daa = function(a10, b10, c10) { + this.s = a10; + this.wc = b10; + this.m = c10; + this.Wg = Rb(Ut(), H10()); + return this; + }; + d7.tT = function(a10, b10) { + a10.Gi(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10.kg("@id", w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.m.PD(h10); + k10.fo(l10); + }; + }(c10, e10))); + }; + }(this, b10))); + }; + d7.uT = function(a10, b10, c10) { + a10.Gi(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.kg("@value", w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10.fo(l10); + }; + }(e10, f10))); + h10.kg("@type", w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = gw(k10.m, l10); + m10.fo(p10); + }; + }(e10, g10))); + }; + }(this, b10, c10))); + }; + function MCa(a10, b10, c10) { + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.r.r.wb)); + b10 = b10.b() ? H10() : b10.c(); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.r.r.wb)); + c10 = c10.b() ? H10() : c10.c(); + yi(a10.m.Ph, b10); + yi(a10.m.Q, c10); + } + function JN(a10, b10, c10, e10) { + b10.Uk(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + f10.ut(k10, g10, h10); + }; + }(a10, c10, e10))); + } + d7.c$ = function(a10, b10, c10, e10, f10) { + a10 = a10.fP ? hd(b10.Y(), a10) : y7(); + a: { + if (a10 instanceof z7 && (b10 = a10.i, null !== b10)) { + a10 = b10.Lc; + b10 = b10.r; + var g10 = gw(this.m, ic(a10.r)); + f10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, a10, b10, c10, e10, g10))); + break a; + } + if (y7() !== a10) + throw new x7().d(a10); + } + }; + d7.QD = function(a10, b10, c10) { + b10.Bt.na() || b10.Et.na() ? this.Jf(a10, b10.t(), Uh().tj, c10) : this.Jf(a10, b10.t(), Uh().jo, false); + }; + d7.ut = function(a10, b10, c10) { + this.co(a10, ka(b10.r), c10); + }; + d7.vE = function(a10, b10, c10) { + c10 ? this.rT(a10, b10) : a10.Uk(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.rT(g10, f10); + }; + }(this, b10))); + }; + function NCa(a10, b10, c10) { + var e10 = b10.j; + OCa(a10, c10, e10); + var f10 = Sr(rc(), e10, b10), g10 = kb(b10); + a10.v3(e10, b10, f10, g10, c10); + a10.a0(b10, c10); + b10 = Ed(ua(), e10, "/") ? e10 + "source-map" : -1 !== (e10.indexOf("#") | 0) || 0 <= (e10.length | 0) && "null" === e10.substring(0, 4) ? e10 + "/source-map" : e10 + "#/source-map"; + a10.b0(b10, f10, c10); + } + function IN(a10, b10, c10, e10) { + for (e10 = uc(e10.yf); e10.Ya(); ) { + var f10 = e10.$a(); + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + if (a10.m.wc.VL) + c10.kg(g10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.Gi(w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + for (var D10 = uc(v10.yf); D10.Ya(); ) { + var C10 = D10.$a(); + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.ya(); + A10.kg(t10.m.PD(gw(t10.m, I10)), w6(/* @__PURE__ */ function(L10, Y10) { + return function(ia) { + ia.fo(Y10); + }; + }(t10, C10))); + } else + throw new x7().d(C10); + } + }; + }(l10, m10))); + }; + }(a10, f10))); + else { + var h10 = a10.m, k10 = F6().ez; + c10.kg(gw(h10, ic(G5(k10, g10))), w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + v10.Uk(w6(/* @__PURE__ */ function(A10, D10, C10, I10) { + return function(L10) { + var Y10 = Qr(); + Y10 = zC(Y10); + HN(D10, Y10).U(w6(/* @__PURE__ */ function(ia, pa, La, ob) { + return function(zb) { + if (null !== zb) { + var Zb = zb.ma(); + zb = zb.Ki(); + ia.D9(pa + "/" + La + "/element_" + zb, ob, Zb); + } else + throw new x7().d(zb); + }; + }(A10, C10, I10, L10))); + }; + }(l10, m10, p10, t10))); + }; + }(a10, f10, b10, g10))); + } + } else + throw new x7().d(f10); + } + } + d7.xW = function(a10, b10) { + a10 = this.m.Ph.Ha(a10); + b10 = Nja(this.m, b10); + return !this.m.zr && !this.m.uw || a10 && b10; + }; + d7.a0 = function(a10, b10) { + var c10 = J5(Ef(), H10()), e10 = hd(a10.Y(), Yd(nc())); + if (!e10.b()) + if (e10 = e10.c(), null !== e10) + e10 = e10.r.r, e10 instanceof $r && e10.wb.ei(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.j; + }; + }(this)), mc()).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + if (k10 instanceof Td) { + var l10 = B6(k10.g, Ud().ig).j; + Dg(g10, l10); + f10.cT(h10, l10, k10, y7()); + } else + throw new x7().d(k10); + }; + }(this, c10, b10))); + else + throw new x7().d(e10); + e10 = new lC().ue(1); + a10.Y().vb.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(), t10 = m10.ya().r.fa(); + m10 = new SCa(); + t10 = t10.hf; + var v10 = Ef().u; + xs(t10, m10, v10).ei( + w6(/* @__PURE__ */ function() { + return function(A10) { + return A10.cp.j; + }; + }(f10)), + mc() + ).U(w6(/* @__PURE__ */ function(A10, D10, C10, I10, L10, Y10) { + return function(ia) { + ia = ia.cp; + var pa = D10.j, La = C10.oa, ob = B6(ia.g, Ud().R).A; + pa = pa + "/scalar-valued/" + La + "/" + (ob.b() ? null : ob.c()); + Dg(I10, pa); + js(ks(), pa, B6(ia.g, Ud().zi)); + A10.cT(L10, pa, ia, new z7().d(Y10)); + C10.oa = 1 + C10.oa | 0; + }; + }(f10, g10, h10, k10, l10, p10))); + } else + throw new x7().d(m10); + }; + }(this, a10, e10, c10, b10))); + c10.Da() && b10.kg(gw(this.m, ic(Yd(nc()).r)), w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Uk(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + for (var p10 = l10.Dc; !p10.b(); ) { + var t10 = p10.ga(); + k10.Kw(m10, t10, true); + p10 = p10.ta(); + } + }; + }(f10, g10))); + }; + }(this, c10))); + }; + d7.D9 = function(a10, b10, c10) { + if (null !== c10) { + var e10 = c10.ma(); + c10 = c10.ya(); + b10.Gi(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + OCa(f10, l10, g10); + l10.kg(gw(f10.m, ic(oc().ko.r)), w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + QCa(m10, t10, p10); + }; + }(f10, h10))); + l10.kg(gw(f10.m, ic(oc().vf.r)), w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + QCa(m10, t10, p10); + }; + }(f10, k10))); + }; + }(this, a10, e10, c10))); + } else + throw new x7().d(c10); + }; + d7.sT = function(a10, b10) { + a10.Gi(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10.kg("@id", w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.m.PD(h10); + k10.fo(l10); + }; + }(c10, e10))); + }; + }(this, b10))); + }; + d7.a$ = function(a10, b10, c10) { + if (GN(this.m.Q).Da()) { + var e10 = Zr(new $r(), GN(this.m.Q), new P6().a()); + O7(); + var f10 = new P6().a(); + e10 = kh(e10, f10); + f10 = Af().xc; + var g10 = gw(this.m, ic(f10.r)); + this.m.uw = true; + a10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, f10, e10, b10, c10, g10))); + } + this.m.uw = false; + }; + d7.co = function(a10, b10, c10) { + a10.Gi(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10.y0("@value", KCa(LCa(), f10, g10)); + }; + }(this, c10, b10))); + }; + d7.Z9 = function(a10, b10, c10) { + if (GN(this.m.Ph).Da()) { + var e10 = Zr(new $r(), GN(this.m.Ph), new P6().a()); + O7(); + var f10 = new P6().a(); + e10 = kh(e10, f10); + f10 = Af().Ic; + var g10 = gw(this.m, ic(f10.r)); + this.m.zr = true; + a10.kg(g10, w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10, t10) { + return function(v10) { + h10.vM(k10.ba, l10, m10, w6(/* @__PURE__ */ function(A10, D10, C10) { + return function(I10) { + Nr(D10, C10, I10); + }; + }(h10, p10, t10)), v10); + }; + }(this, f10, e10, b10, c10, g10))); + } + this.m.zr = false; + }; + d7.$classData = r8({ hEa: 0 }, false, "amf.plugins.document.graph.emitter.JsonLdEmitter", { hEa: 1, f: 1, lm: 1 }); + function KN() { + this.Wka = null; + } + KN.prototype = new u7(); + KN.prototype.constructor = KN; + KN.prototype.a = function() { + TCa = this; + var a10 = F6().Zd; + this.Wka = ic(G5(a10, "graphDependencies")); + return this; + }; + KN.prototype.PW = function(a10) { + return ZC(hp(), a10); + }; + function UCa(a10, b10) { + var c10 = b10.i.hb().gb; + if (Q5().cd === c10) { + b10 = b10.i; + c10 = tw(); + var e10 = cc().bi; + b10 = N6(b10, c10, e10).Cm; + c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + var g10 = f10.hb().gb; + return Q5().sa === g10 ? VCa(WCa(), f10) : y7(); + }; + }(a10)); + e10 = rw(); + b10 = b10.ka(c10, e10.sc); + c10 = new LN().a(); + b10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + if (h10 instanceof z7) { + var k10 = h10.i; + null !== k10 && (h10 = k10.ma(), k10 = k10.ya(), MN(g10, h10, Lea(), k10)); + } + }; + }(a10, c10))); + return c10; + } + throw new x7().d(c10); + } + KN.prototype.WN = function(a10) { + if (a10 instanceof Dc) { + a10 = kc(a10.Xd.Fd); + var b10 = qc(), c10 = rw().sc; + a10 = jc(a10, sw(c10, b10)); + a10 = a10.b() ? y7() : a10.c().kc(); + if (a10 instanceof z7 && (b10 = a10.i, null !== b10)) { + a10 = b10.sb.Fb(w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = e10.Aa; + var f10 = Dd(), g10 = cc().bi; + e10 = N6(e10, f10, g10); + f10 = WCa().Wka; + return null === e10 ? null === f10 : ra(e10, f10); + }; + }(this))); + if (a10 instanceof z7) + return UCa(this, a10.i); + if (y7() === a10) + return lBa(); + throw new x7().d(a10); + } + if (y7() === a10) + return lBa(); + throw new x7().d(a10); + } + return lBa(); + }; + function VCa(a10, b10) { + var c10 = qc(), e10 = cc().bi; + a10 = N6(b10, c10, e10).sb.Fb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(), h10 = cc().bi; + f10 = N6(f10, g10, h10); + return null !== f10 && ra(f10, "@id"); + }; + }(a10))); + return a10 instanceof z7 ? (a10 = a10.i, b10 = a10.i, c10 = Dd(), e10 = cc().bi, new z7().d(new R6().M(N6(b10, c10, e10), a10.i))) : y7(); + } + KN.prototype.$classData = r8({ vEa: 0 }, false, "amf.plugins.document.graph.parser.GraphDependenciesReferenceHandler$", { vEa: 1, f: 1, KY: 1 }); + var TCa = void 0; + function WCa() { + TCa || (TCa = new KN().a()); + return TCa; + } + function NN(a10) { + var b10 = new xc().yd(dd()), c10 = F6().$c; + a10.wD(rb(new sb(), b10, G5(c10, "externals"), tb(new ub(), vb().qm, "", "", H10()))); + } + function ON() { + } + ON.prototype = new Gw(); + ON.prototype.constructor = ON; + ON.prototype.a = function() { + return this; + }; + ON.prototype.$classData = r8({ aHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ExtensionPointProperty$", { aHa: 1, gJ: 1, f: 1 }); + var XCa = void 0; + function YCa() { + XCa || (XCa = new ON().a()); + return XCa; + } + function PN() { + } + PN.prototype = new Gw(); + PN.prototype.constructor = PN; + PN.prototype.a = function() { + return this; + }; + PN.prototype.$classData = r8({ cHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.LiteralProperty$", { cHa: 1, gJ: 1, f: 1 }); + var ZCa = void 0; + function $Ca() { + ZCa || (ZCa = new PN().a()); + return ZCa; + } + function QN() { + } + QN.prototype = new Gw(); + QN.prototype.constructor = QN; + QN.prototype.a = function() { + return this; + }; + QN.prototype.$classData = r8({ dHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.LiteralPropertyCollection$", { dHa: 1, gJ: 1, f: 1 }); + var aDa = void 0; + function bDa() { + aDa || (aDa = new QN().a()); + return aDa; + } + function RN() { + } + RN.prototype = new Gw(); + RN.prototype.constructor = RN; + RN.prototype.a = function() { + return this; + }; + RN.prototype.$classData = r8({ hHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectMapInheritanceProperty$", { hHa: 1, gJ: 1, f: 1 }); + var cDa = void 0; + function SN() { + } + SN.prototype = new Gw(); + SN.prototype.constructor = SN; + SN.prototype.a = function() { + return this; + }; + SN.prototype.$classData = r8({ iHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectMapProperty$", { iHa: 1, gJ: 1, f: 1 }); + var dDa = void 0; + function TN() { + dDa || (dDa = new SN().a()); + return dDa; + } + function UN() { + } + UN.prototype = new Gw(); + UN.prototype.constructor = UN; + UN.prototype.a = function() { + return this; + }; + UN.prototype.$classData = r8({ jHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectPairProperty$", { jHa: 1, gJ: 1, f: 1 }); + var eDa = void 0; + function fDa() { + eDa || (eDa = new UN().a()); + return eDa; + } + function VN() { + } + VN.prototype = new Gw(); + VN.prototype.constructor = VN; + VN.prototype.a = function() { + return this; + }; + VN.prototype.$classData = r8({ kHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectProperty$", { kHa: 1, gJ: 1, f: 1 }); + var gDa = void 0; + function WN() { + gDa || (gDa = new VN().a()); + return gDa; + } + function XN() { + } + XN.prototype = new Gw(); + XN.prototype.constructor = XN; + XN.prototype.a = function() { + return this; + }; + XN.prototype.$classData = r8({ lHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectPropertyCollection$", { lHa: 1, gJ: 1, f: 1 }); + var hDa = void 0; + function YN() { + hDa || (hDa = new XN().a()); + return hDa; + } + function ZN() { + this.Lq = this.Bc = this.Coa = null; + } + ZN.prototype = new u7(); + ZN.prototype.constructor = ZN; + function iDa(a10, b10) { + var c10 = b10.re(); + if (c10 instanceof xt) + MN(a10.Lq, c10.va, yM(), b10); + else { + a10 = a10.Bc; + c10 = dc().lY; + var e10 = "Unexpected !include or dialect with " + b10.re(), f10 = y7(); + ec(a10, c10, "", f10, e10, b10.da); + } + } + function jDa(a10, b10) { + b10 = Mc(ua(), b10, "#"); + b10 = zj(new Pc().fd(b10)); + var c10 = new qg().e(b10); + tc(c10) && iDa(a10, (T6(), mh(T6(), b10))); + } + ZN.prototype.lba = function(a10, b10) { + var c10 = qc(); + a10 = kx(a10).Qp(c10); + if (a10 instanceof ye4 && (a10 = ac(new M6().W(a10.i), "uses"), !a10.b())) { + a10 = a10.c(); + c10 = a10.i; + var e10 = qc(); + c10 = Iw(c10, e10); + if (c10 instanceof ye4) + c10.i.sb.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = g10.Lq; + T6(); + var l10 = h10.i, m10 = cc().bi, p10 = Dd(); + MN(k10, N6(l10, p10, m10), wM(), h10.i); + }; + }(this))); + else { + c10 = Wd().IR; + e10 = "Expected map but found: " + a10.i; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, "", f10, e10, a10.da); + } + } + }; + ZN.prototype.PW = function(a10) { + return ZC(hp(), a10); + }; + function kDa(a10, b10) { + a: + if (b10 instanceof Es) { + var c10 = b10.Aa, e10 = bc(), f10 = cc().bi; + c10 = N6(c10, e10, f10).va; + "$target" === c10 ? iDa(a10, b10.i) : "$dialect" === c10 ? (b10 = b10.i, c10 = a10.Coa, e10 = Dd(), f10 = cc().bi, lDa(c10, "%" + N6(b10, e10, f10)) || (T6(), c10 = cc().bi, e10 = Dd(), jDa(a10, N6(b10, e10, c10)))) : "$include" === c10 ? iDa(a10, b10.i) : "$ref" === c10 ? (b10 = Kc(b10.i), b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.va)), b10.b() || (b10 = b10.c(), jDa(a10, b10))) : b10.Xf.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + kDa(g10, h10); + }; + }(a10))); + } else { + if (b10 instanceof Cs && (c10 = b10.hb().gb, e10 = Q5().wq, c10 === e10)) { + iDa(a10, b10); + break a; + } + b10.Xf.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + kDa( + g10, + h10 + ); + }; + }(a10))); + } + } + ZN.prototype.WN = function(a10, b10) { + if (a10 instanceof Dc) { + var c10 = a10.Kz; + if (!c10.b()) { + c10 = c10.c(); + var e10 = c10.indexOf("|") | 0; + if (0 < e10) { + var f10 = c10.substring(1 + e10 | 0); + e10 = f10.indexOf("<") | 0; + f10 = f10.lastIndexOf(">") | 0; + e10 = 0 < e10 && f10 > e10; + } else + e10 = false; + if (e10) { + e10 = this.Lq; + f10 = c10.indexOf("|") | 0; + if (0 < f10) { + c10 = c10.substring(1 + f10 | 0); + f10 = c10.indexOf("<") | 0; + var g10 = c10.lastIndexOf(">") | 0; + c10 = c10.substring(1 + f10 | 0, g10); + } else + c10 = ""; + MN(e10, c10, hBa(), a10.Xd.Fd); + } + } + this.lba(a10.Xd, b10); + kDa(this, a10.Xd); + } + return this.Lq; + }; + ZN.prototype.$classData = r8({ zHa: 0 }, false, "amf.plugins.document.vocabularies.parser.common.SyntaxExtensionsReferenceHandler", { zHa: 1, f: 1, KY: 1 }); + function $N() { + this.ff = this.X = this.m = this.kf = null; + } + $N.prototype = new u7(); + $N.prototype.constructor = $N; + $N.prototype.lca = function() { + var a10 = ac(new M6().W(this.X), "base"); + if (!a10.b()) { + var b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m); + a10 = this.ff; + var e10 = bd().Kh; + c10 = c10.nf(); + b10 = Od(O7(), b10); + Rg(a10, e10, c10, b10); + } + a10 = ac(new M6().W(this.X), "vocabulary"); + a10.b() || (b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m), a10 = this.ff, e10 = bd().R, c10 = c10.nf(), b10 = Od(O7(), b10), Rg(a10, e10, c10, b10)); + a10 = ac(new M6().W(this.X), "usage"); + a10.b() || (b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m), a10 = this.ff, e10 = bd().ae, c10 = c10.nf(), b10 = Od(O7(), b10), Rg(a10, e10, c10, b10)); + Sba(this.m, "vocabulary", this.ff.j, this.X); + a10 = mDa(this.X, this.kf.Q, this.m); + e10 = B6(this.ff.g, bd().Kh).A; + a10 = nDa(a10, e10.b() ? null : e10.c()); + tc(this.m.rd.Vn) && (e10 = this.ff, b10 = new Fc().Vd(this.m.rd.Vn).Sb.Ye().Dd(), c10 = Bd().vh, Zd(e10, c10, b10)); + oDa(this, this.X); + pDa(this, this.X); + e10 = qDa(this.m); + b10 = this.m.a1; + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.ya(); + O7(); + var l10 = new P6().a(); + l10 = new bO().K(new S6().a(), l10); + var m10 = td().Xp; + k10 = eb(l10, m10, k10); + l10 = h10.j; + m10 = td().sN; + k10 = eb(k10, m10, l10); + h10 = B6(h10.g, bd().Kh).A; + h10 = h10.b() ? null : h10.c(); + l10 = td().Kh; + h10 = eb(k10, l10, h10); + k10 = g10.ff.j; + J5(K7(), H10()); + return Ai(h10, k10); + } + throw new x7().d(h10); + }; + }(this)); + var f10 = Id().u; + c10 = Jd(b10, c10, f10); + tc(c10) && (b10 = this.ff, c10 = c10.ke(), f10 = bd().$C, Zd(b10, f10, c10)); + e10.Da() && (b10 = this.ff, c10 = Af().Ic, Bf(b10, c10, e10)); + tc(a10.Q) && (e10 = this.ff, a10 = a10.ow(), b10 = Gk().xc, Bf(e10, b10, a10)); + this.m.UB.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.Uo, l10 = h10.Ih; + if (h10.KM) { + h10 = g10.m; + var m10 = g10.ff.j, p10 = Wd().Xha; + k10 = "Cannot find property vocabulary term " + k10; + var t10 = y7(); + nM(h10, p10, m10, t10, k10, l10.da); + } else + ke3(g10.m, k10, g10.ff.j, l10); + } else + throw new x7().d(h10); + }; + }(this))); + return this.ff; + }; + function rDa(a10, b10) { + var c10 = b10.i.hb().gb; + if (Q5().nd === c10) + c10 = Od(O7(), b10), c10 = new cO().K(new S6().a(), c10); + else { + c10 = b10.i; + var e10 = qc(); + c10 = N6(c10, e10, a10.m); + c10 = ac(new M6().W(c10), "range"); + if (y7() === c10) + c10 = Od(O7(), b10), c10 = new cO().K(new S6().a(), c10); + else { + if (!(c10 instanceof z7)) + throw new x7().d(c10); + c10 = c10.i.i; + e10 = bc(); + c10 = N6(c10, e10, a10.m).va; + "string" === c10 || "integer" === c10 || "float" === c10 || "double" === c10 || "long" === c10 || "boolean" === c10 || "uri" === c10 || "any" === c10 || "time" === c10 || "date" === c10 || "dateTime" === c10 ? (c10 = Od(O7(), b10), c10 = new cO().K(new S6().a(), c10)) : (c10 = Od(O7(), b10), c10 = new dO().K( + new S6().a(), + c10 + )); + } + } + e10 = b10.Aa; + var f10 = bc(); + e10 = N6(e10, f10, a10.m).va; + f10 = eO().R; + eb(c10, f10, e10); + f10 = a10.m; + var g10 = B6(a10.ff.g, bd().Kh).A; + f10 = sDa(f10, g10.b() ? null : g10.c(), e10, b10.Aa, false); + if (y7() === f10) + ke3(a10.m, e10, a10.ff.j, b10.Aa); + else if (f10 instanceof z7) + c10.j = f10.i; + else + throw new x7().d(f10); + f10 = b10.i.hb().gb; + if (Q5().nd !== f10) { + b10 = b10.i; + f10 = qc(); + b10 = N6(b10, f10, a10.m); + Sba(a10.m, "propertyTerm", c10.j, b10); + f10 = ac(new M6().W(b10), "displayName"); + f10.b() || (f10 = f10.c(), g10 = new aO().Vb(f10.i, a10.m), f10 = fO().Zc, g10 = g10.nf(), Vd(c10, f10, g10)); + f10 = ac(new M6().W(b10), "description"); + f10.b() || (f10 = f10.c(), g10 = new aO().Vb(f10.i, a10.m), f10 = fO().Va, g10 = g10.nf(), Vd(c10, f10, g10)); + f10 = ac(new M6().W(b10), "range"); + if (!f10.b()) { + f10 = f10.c(); + g10 = f10.i; + var h10 = bc(); + g10 = N6(g10, h10, a10.m).va; + if ("guid" === g10) + f10 = F6().Eb, g10 = new z7().d(ic(G5(f10, "guid"))); + else if ("any" === g10 || "uri" === g10 || "string" === g10 || "integer" === g10 || "float" === g10 || "double" === g10 || "long" === g10 || "boolean" === g10 || "time" === g10 || "date" === g10 || "dateTime" === g10) + g10 = new z7().d(yca(Uh(), g10)); + else { + h10 = a10.m; + var k10 = B6(a10.ff.g, bd().Kh).A; + h10 = tDa(h10, k10.b() ? null : k10.c(), g10, f10.i, true); + if (h10 instanceof z7) + g10 = new z7().d(h10.i); + else { + if (y7() !== h10) + throw new x7().d(h10); + ke3(a10.m, g10, a10.ff.j, f10.i); + g10 = y7(); + } + } + a: { + if (g10 instanceof z7 && (f10 = g10.i, null !== f10)) { + g10 = eO().Vf; + eb(c10, g10, f10); + break a; + } + if (y7() !== g10) + throw new x7().d(g10); + } + } + b10 = ac(new M6().W(b10), "extends"); + if (!b10.b()) { + b10 = b10.c(); + f10 = b10.i.hb().gb; + if (Q5().Na === f10) + f10 = K7(), g10 = [new aO().Vb(b10.i, a10.m).nf().t()], f10 = J5(f10, new Ib().ha(g10)); + else { + if (Q5().cd !== f10) + throw new x7().d(f10); + f10 = new Tx().Vb(b10.i, a10.m).rV().ma(); + g10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = bc(); + return N6(m10, p10, l10.m).va; + }; + }(a10)); + h10 = K7(); + f10 = f10.ka(g10, h10.u); + } + b10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.m, v10 = B6(l10.ff.g, bd().Kh).A; + t10 = sDa(t10, v10.b() ? null : v10.c(), p10, m10.i, true); + if (t10 instanceof z7) + return new z7().d(t10.i); + if (y7() === t10) + return ke3(l10.m, p10, l10.ff.j, m10.i), y7(); + throw new x7().d(t10); + }; + }(a10, b10)); + g10 = K7(); + b10 = f10.ka(b10, g10.u).Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.na(); + }; + }(a10))); + f10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.c(); + }; + }(a10)); + g10 = K7(); + b10 = b10.ka(f10, g10.u); + f10 = eO().eB; + Wr(c10, f10, b10); + } + } + uDa(a10.m, e10, c10); + } + $N.prototype.Gp = function() { + return this.m; + }; + function pDa(a10, b10) { + b10 = ac(new M6().W(b10), "propertyTerms"); + if (!b10.b()) { + b10 = b10.c().i; + var c10 = qc(); + N6(b10, c10, a10.m).sb.U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + rDa(e10, f10); + }; + }(a10))); + } + } + function vDa(a10, b10, c10) { + a10.kf = b10; + a10.m = c10; + var e10 = b10.$g.Xd, f10 = qc(); + a10.X = N6(e10, f10, c10); + c10 = Od(O7(), a10.X); + c10 = new ad().K(new S6().a(), c10); + e10 = b10.da; + f10 = Bq().uc; + c10 = eb(c10, f10, e10); + a10.ff = Rd(c10, b10.da); + return a10; + } + function oDa(a10, b10) { + b10 = ac(new M6().W(b10), "classTerms"); + if (!b10.b()) { + b10 = b10.c().i; + var c10 = qc(); + N6(b10, c10, a10.m).sb.U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + wDa(e10, f10); + }; + }(a10))); + } + } + function wDa(a10, b10) { + var c10 = Od(O7(), b10); + c10 = new gO().K(new S6().a(), c10); + var e10 = b10.Aa, f10 = bc(); + e10 = N6(e10, f10, a10.m).va; + f10 = fO().R; + eb(c10, f10, e10); + f10 = a10.m; + var g10 = B6(a10.ff.g, bd().Kh).A; + f10 = tDa(f10, g10.b() ? null : g10.c(), e10, b10.Aa, false); + if (y7() === f10) + ke3(a10.m, e10, a10.ff.j, b10.Aa); + else if (f10 instanceof z7) + c10.j = f10.i; + else + throw new x7().d(f10); + f10 = b10.i.hb().gb; + if (Q5().nd !== f10) { + b10 = b10.i; + f10 = qc(); + b10 = N6(b10, f10, a10.m); + Sba(a10.m, "classTerm", c10.j, b10); + f10 = ac(new M6().W(b10), "displayName"); + f10.b() || (f10 = f10.c(), g10 = new aO().Vb(f10.i, a10.m), f10 = fO().Zc, g10 = g10.nf(), Vd(c10, f10, g10)); + f10 = ac(new M6().W(b10), "description"); + f10.b() || (f10 = f10.c(), g10 = new aO().Vb(f10.i, a10.m), f10 = fO().Va, g10 = g10.nf(), Vd(c10, f10, g10)); + f10 = ac(new M6().W(b10), "properties"); + if (!f10.b()) { + f10 = f10.c(); + g10 = f10.i.hb().gb; + if (Q5().Na === g10) { + g10 = K7(); + var h10 = [new aO().Vb(f10.i, a10.m).nf().t()]; + g10 = J5(g10, new Ib().ha(h10)); + } else { + if (Q5().cd !== g10) + throw new x7().d(g10); + g10 = new Tx().Vb(f10.i, a10.m).rV().ma(); + h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.re().t(); + }; + }(a10)); + var k10 = K7(); + g10 = g10.ka(h10, k10.u); + } + f10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.m, v10 = B6(l10.ff.g, bd().Kh).A; + t10 = sDa(t10, v10.b() ? null : v10.c(), p10, m10.i, true); + if (t10 instanceof z7) + return new z7().d(t10.i); + if (y7() === t10) + return ke3(l10.m, p10, l10.ff.j, m10.i), y7(); + throw new x7().d(t10); + }; + }(a10, f10)); + h10 = K7(); + f10 = g10.ka(f10, h10.u).Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.na(); + }; + }(a10))); + g10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.c(); + }; + }(a10)); + h10 = K7(); + f10 = f10.ka(g10, h10.u); + f10.Da() && (g10 = fO().kh, Wr(c10, g10, f10)); + } + b10 = ac(new M6().W(b10), "extends"); + if (!b10.b()) { + b10 = b10.c(); + f10 = b10.i.hb().gb; + if (Q5().Na === f10) + f10 = K7(), g10 = [new aO().Vb(b10.i, a10.m).nf().t()], f10 = J5(f10, new Ib().ha(g10)); + else { + if (Q5().cd !== f10) + throw new x7().d(f10); + f10 = new Tx().Vb(b10.i, a10.m).rV().ma(); + g10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.re().t(); + }; + }(a10)); + h10 = K7(); + f10 = f10.ka(g10, h10.u); + } + b10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.m, v10 = B6(l10.ff.g, bd().Kh).A; + t10 = tDa(t10, v10.b() ? null : v10.c(), p10, m10.i, true); + if (t10 instanceof z7) + return new z7().d(t10.i); + if (y7() === t10) + return ke3(l10.m, p10, l10.ff.j, m10.i), y7(); + throw new x7().d(t10); + }; + }(a10, b10)); + g10 = K7(); + b10 = f10.ka(b10, g10.u).Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.na(); + }; + }(a10))); + f10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.c(); + }; + }(a10)); + g10 = K7(); + b10 = b10.ka(f10, g10.u); + f10 = fO().fz; + Wr(c10, f10, b10); + } + } + xDa(a10.m, e10, c10); + } + $N.prototype.$classData = r8({ cIa: 0 }, false, "amf.plugins.document.vocabularies.parser.vocabularies.VocabulariesParser", { cIa: 1, f: 1, $r: 1 }); + function hO() { + Ws.call(this); + this.vG = this.z3 = this.IH = this.mG = this.Vn = null; + } + hO.prototype = new rha(); + hO.prototype.constructor = hO; + function yDa() { + } + yDa.prototype = hO.prototype; + hO.prototype.G$ = function(a10) { + var b10 = this.xi.Ja(a10); + if (b10 instanceof z7 && (b10 = b10.i, b10 instanceof hO)) + return b10; + b10 = this.vG; + var c10 = new Mq().a(), e10 = Rb(Gb().ab, H10()), f10 = Rb(Gb().ab, H10()), g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()); + b10 = new hO().v1(e10, f10, g10, h10, k10, b10, c10); + this.xi = this.xi.cc(new R6().M(a10, b10)); + return b10; + }; + hO.prototype.v1 = function(a10, b10, c10, e10, f10, g10, h10) { + this.Vn = a10; + this.mG = b10; + this.IH = c10; + this.z3 = e10; + this.vG = g10; + Ws.prototype.hma.call(this, f10, Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), g10, h10); + return this; + }; + function zDa(a10, b10) { + var c10 = B6(b10.Y(), eO().R).A; + if (-1 === ((c10.b() ? null : c10.c()).indexOf(".") | 0)) { + c10 = a10.IH; + var e10 = B6(b10.Y(), eO().R).A; + e10 = e10.b() ? null : e10.c(); + a10.IH = c10.cc(new R6().M(e10, b10)); + } + } + function ADa(a10, b10) { + a10 = a10.IH.Ja(b10); + if (a10 instanceof z7) + return new z7().d(a10.i.j); + if (y7() === a10) + return y7(); + throw new x7().d(a10); + } + function BDa(a10, b10) { + var c10 = B6(b10.g, fO().R).A; + if (-1 === ((c10.b() ? null : c10.c()).indexOf(".") | 0)) { + c10 = a10.mG; + var e10 = B6(b10.g, fO().R).A; + e10 = e10.b() ? null : e10.c(); + a10.mG = c10.cc(new R6().M(e10, b10)); + } + } + function CDa(a10, b10) { + a10 = a10.mG.Ja(b10); + if (a10 instanceof z7) + return new z7().d(a10.i.j); + if (y7() === a10) + return y7(); + throw new x7().d(a10); + } + function DDa(a10, b10, c10) { + a10.z3 = a10.z3.cc(new R6().M(b10, c10)); + } + function Iba(a10, b10) { + if (-1 !== (b10.indexOf(".") | 0)) { + var c10 = Mc(ua(), b10, "\\."); + c10 = zj(new Pc().fd(c10)); + b10 = Mc(ua(), b10, "\\."); + b10 = Oc(new Pc().fd(b10)); + a10 = a10.Vn.Ja(c10); + if (a10.b()) + return y7(); + a10 = B6(a10.c().g, dd().Kh).A; + return new z7().d("" + (a10.b() ? null : a10.c()) + b10); + } + return y7(); + } + hO.prototype.$classData = r8({ f7: 0 }, false, "amf.plugins.document.vocabularies.parser.vocabularies.VocabularyDeclarations", { f7: 1, hN: 1, f: 1 }); + function iO() { + Wu.call(this); + this.Yj = null; + } + iO.prototype = new Xu(); + iO.prototype.constructor = iO; + iO.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + a10 = K7(); + var b10 = [new jO().Hb(this.ob), new kO().Hb(this.ob), new eN().Hb(this.ob), new fN().Hb(this.ob)]; + this.Yj = J5(a10, new Ib().ha(b10)); + return this; + }; + iO.prototype.kC = function() { + return this.Yj; + }; + iO.prototype.$classData = r8({ fIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.pipelines.DialectInstancePatchResolutionPipeline", { fIa: 1, Qt: 1, f: 1 }); + function lO() { + Wu.call(this); + this.Yj = null; + } + lO.prototype = new Xu(); + lO.prototype.constructor = lO; + lO.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + a10 = K7(); + var b10 = [new jO().Hb(this.ob), new eN().Hb(this.ob), new fN().Hb(this.ob)]; + this.Yj = J5(a10, new Ib().ha(b10)); + return this; + }; + lO.prototype.kC = function() { + return this.Yj; + }; + lO.prototype.$classData = r8({ gIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.pipelines.DialectInstanceResolutionPipeline", { gIa: 1, Qt: 1, f: 1 }); + function mO() { + Wu.call(this); + this.Yj = null; + } + mO.prototype = new Xu(); + mO.prototype.constructor = mO; + mO.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + a10 = K7(); + var b10 = [new nO().Hb(this.ob), new oO().Hb(this.ob)]; + this.Yj = J5(a10, new Ib().ha(b10)); + return this; + }; + mO.prototype.kC = function() { + return this.Yj; + }; + mO.prototype.$classData = r8({ hIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.pipelines.DialectResolutionPipeline", { hIa: 1, Qt: 1, f: 1 }); + function jO() { + this.O1 = this.wu = this.xs = this.ob = null; + } + jO.prototype = new gv(); + jO.prototype.constructor = jO; + jO.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + this.xs = y7(); + this.wu = y7(); + this.O1 = H10(); + return this; + }; + jO.prototype.u3 = function(a10, b10) { + var c10 = false, e10 = null; + return ut(a10) && (c10 = true, e10 = a10, Za(e10).na() && !b10) ? new z7().d(EDa(this, Za(e10).c())) : c10 && Za(e10).na() ? new z7().d(e10) : new z7().d(a10); + }; + function EDa(a10, b10) { + if (a10.O1.Ha(b10.j)) + return b10; + O7(); + var c10 = new P6().a(); + c10 = new pO().K(new S6().a(), c10); + Ui(c10.g, Gk().nb, b10, (O7(), new P6().a())); + var e10 = new jO().Hb(a10.ob), f10 = a10.wu; + a10 = a10.O1; + b10 = J5(K7(), new Ib().ha([b10.j])); + var g10 = K7(); + return B6(FDa(e10, c10, f10, a10.ia(b10, g10.u)).g, qO().nb); + } + function FDa(a10, b10, c10, e10) { + a10.O1 = e10; + a10.xs = new z7().d(b10); + a10.wu = new z7().d(c10.b() ? new dv().EK(b10) : c10.c()); + return b10.Qm(hCa(), Uc(/* @__PURE__ */ function(f10) { + return function(g10, h10) { + return f10.u3(g10, !!h10); + }; + }(a10)), a10.ob); + } + jO.prototype.ye = function(a10) { + this.xs = new z7().d(a10); + this.wu = new z7().d(new dv().EK(a10)); + return a10.Qm(hCa(), Uc(/* @__PURE__ */ function(b10) { + return function(c10, e10) { + return b10.u3(c10, !!e10); + }; + }(this)), this.ob); + }; + jO.prototype.$classData = r8({ iIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectInstanceReferencesResolutionStage", { iIa: 1, ii: 1, f: 1 }); + function oO() { + this.ob = null; + } + oO.prototype = new gv(); + oO.prototype.constructor = oO; + oO.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function GDa(a10, b10) { + var c10 = B6(b10.g, nc().Ni()); + if (c10 instanceof Vt && (c10 = c10.Wn, c10 instanceof Cd)) { + var e10 = GDa(a10, c10), f10 = B6(e10.g, wj().Ax).A; + if (f10 instanceof z7) { + f10 = f10.i; + var g10 = B6(b10.g, wj().Ax).A; + y7() === g10 && (g10 = wj().Ax, eb(b10, g10, f10)); + } + a10 = HDa(a10, b10, e10); + c10 = J5(K7(), new Ib().ha([c10.j])); + e10 = wj().Y7; + Wr(a10, e10, c10); + it2(a10.g, wj().Ni()); + } + return b10; + } + function HDa(a10, b10, c10) { + var e10 = Rb(Ut(), H10()); + B6(b10.g, wj().ej).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = B6(h10.g, $d().R).A; + k10 = k10.b() ? null : k10.c(); + return g10.Xh(new R6().M(k10, h10)); + }; + }(a10, e10))); + B6(c10.g, wj().ej).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = B6(h10.g, $d().R).A; + k10 = g10.Ja(k10.b() ? null : k10.c()); + if (!(k10 instanceof z7)) { + if (y7() === k10) { + k10 = B6(h10.g, $d().R).A; + k10 = k10.b() ? null : k10.c(); + var l10 = pt(h10.g), m10 = h10.x; + l10 = new rO().K(l10, Yi(O7(), m10)); + h10 = Rd(l10, h10.j); + return g10.Xh(new R6().M(k10, h10)); + } + throw new x7().d(k10); + } + }; + }(a10, e10))); + a10 = e10.Ur().ua(); + c10 = wj().ej; + return Bf(b10, c10, a10); + } + oO.prototype.ye = function(a10) { + Zc(a10) && a10.tk().U(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + if (c10 instanceof Cd) + return GDa(b10, c10); + }; + }(this))); + return a10; + }; + oO.prototype.$classData = r8({ jIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectNodeExtensionStage", { jIa: 1, ii: 1, f: 1 }); + function kO() { + this.ob = null; + } + kO.prototype = new gv(); + kO.prototype.constructor = kO; + kO.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function IDa(a10) { + a10 = ika(a10).A; + return a10.b() ? "update" : a10.c(); + } + function JDa(a10, b10, c10, e10) { + return a10.na() && KDa(a10.c(), b10, c10, e10) ? y7() : a10; + } + function LDa(a10, b10, c10, e10, f10, g10, h10) { + var k10 = MDa(f10); + if ($Ca() === k10) + if (f10 = IDa(f10), "insert" !== f10 || NDa(sO(b10)).Ha(ic(c10.r))) + if ("delete" === f10 && NDa(sO(b10)).Ha(ic(c10.r))) + try { + if (Va(Wa(), Ti(b10.g, c10).r.r, e10.r.r)) { + var l10 = sO(b10); + Dha(l10.Rh.Y(), ic(c10.r)); + } + } catch (m10) { + if (!(Ph(E6(), m10) instanceof nb)) + throw m10; + } + else + "update" === f10 && NDa(sO(b10)).Ha(ic(c10.r)) ? ODa(sO(b10), c10, e10) : "upsert" === f10 ? ODa(sO(b10), c10, e10) : "ignore" !== f10 && "fail" === f10 && (e10 = a10.ob, a10 = Wd().bN, f10 = b10.j, g10 = y7(), h10 = "Property " + ic(c10.r) + " cannot be patched", c10 = Ab(Ti(b10.g, c10).x, q5(jd)), b10 = y7(), e10.Gc(a10.j, f10, g10, h10, c10, Yb().qb, b10)); + else + ODa(sO(b10), c10, e10); + else if (bDa() === k10) { + g10 = false; + h10 = null; + l10 = b10.g.vb.Ja(c10); + a: { + if (l10 instanceof z7 && (g10 = true, h10 = l10, l10 = h10.i, l10.r instanceof $r)) { + g10 = l10.r.wb; + break a; + } + g10 ? (g10 = h10.i, g10 = J5(K7(), new Ib().ha([g10.r]))) : g10 = H10(); + } + g10 = J5(Gb().Qg, g10); + h10 = e10.r; + h10 = h10 instanceof $r ? h10.wb : J5(K7(), new Ib().ha([h10])); + h10 = J5(Gb().Qg, h10); + f10 = IDa(f10); + "insert" === f10 ? tO(sO(b10), c10, g10.OW(h10).ke()) : "delete" === f10 ? tO(sO(b10), c10, g10.dO(h10).ke()) : "update" === f10 ? tO(sO(b10), c10, kz(h10)) : "upsert" === f10 ? tO(sO(b10), c10, g10.OW(h10).ke()) : "ignore" !== f10 && "fail" === f10 && (a10 = a10.ob, f10 = Wd().bN, b10 = b10.j, g10 = y7(), c10 = "Property " + ic(c10.r) + " cannot be patched", e10 = Ab(e10.x, q5(jd)), h10 = y7(), a10.Gc(f10.j, b10, g10, c10, e10, Yb().qb, h10)); + } else if (WN() === k10) { + if (e10 = e10.r, e10 instanceof uO) + a: { + if (f10 = cs(b10.g, c10), e10 = PDa(a10, f10, g10, e10, h10), e10 instanceof z7 && (e10 = e10.i, null !== e10)) { + a10 = sO(b10); + b10 = a10.Rh; + a10 = QDa(a10, c10); + Rg(b10, c10, e10, a10); + break a; + } + b10 = sO(b10); + Dha(b10.Rh.Y(), ic(c10.r)); + } + } else + YN() !== k10 && TN() !== k10 && fDa() !== k10 || RDa(a10, b10, c10, e10, f10, g10, h10); + } + function SDa(a10, b10) { + return a10.b() ? new z7().d(b10) : a10; + } + function TDa(a10, b10) { + var c10 = B6(b10.g, UDa().mc).A; + return c10 instanceof z7 && (c10 = c10.i, Lc(b10).na() && (a10 = B6(b10.g, qO().xc).Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10 instanceof pO && Ed(ua(), Lc(g10).c(), f10); + }; + }(a10, c10))), a10 instanceof z7 && (a10 = a10.i, a10 instanceof pO && Lc(a10).na()))) ? new z7().d(a10) : y7(); + } + function VDa(a10) { + a10 = tj(a10); + a10 = ika(a10).A; + return a10.b() ? "update" : a10.c(); + } + function WDa(a10, b10, c10, e10, f10) { + var g10 = tj(e10); + if (b10.na() && KDa(b10.c(), c10, e10, f10)) + for (var h10 = vO(e10).g; !h10.b(); ) { + var k10 = h10.ga(), l10 = e10.g.vb.Ja(k10); + if (l10 instanceof z7) { + l10 = l10.i; + var m10 = B6(g10.g, wj().ej).Fb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = B6(v10.g, $d().Yh).A; + return (v10.b() ? null : v10.c()) === ic(t10.r); + }; + }(a10, k10))); + m10 instanceof z7 && (m10 = m10.i, LDa(a10, b10.c(), k10, l10, m10, c10, f10)); + } + h10 = h10.ta(); + } + return b10; + } + function XDa(a10, b10, c10, e10, f10) { + return b10.b() ? SDa(b10, e10) : WDa(a10, b10, c10, e10, f10); + } + kO.prototype.ye = function(a10) { + if (a10 instanceof wO) + a: { + var b10 = TDa(this, a10); + if (b10 instanceof z7 && (b10 = b10.i, null !== b10)) { + a10 = PDa(this, new z7().d(B6(b10.g, qO().nb)), Lc(b10).c(), B6(a10.g, qO().nb), Lc(a10).c()); + if (a10 instanceof z7) { + a10 = a10.i; + var c10 = Jk().nb; + b10 = Vd(b10, c10, a10); + } else if (y7() === a10) + Dha(b10.g, ic(qO().nb.r)); + else + throw new x7().d(a10); + break a; + } + b10 = a10; + } + else + b10 = a10; + return b10; + }; + function KDa(a10, b10, c10, e10) { + return a10.j.split(b10).join("") === c10.j.split(e10).join(""); + } + function PDa(a10, b10, c10, e10, f10) { + var g10 = VDa(e10); + if ("insert" === g10) + return SDa(b10, e10); + if ("delete" === g10) + return JDa(b10, c10, e10, f10); + if ("update" === g10) + return WDa(a10, b10, c10, e10, f10); + if ("upsert" === g10) + return XDa(a10, b10, c10, e10, f10); + if ("ignore" === g10) + return b10; + if ("fail" === g10) { + b10 = a10.ob; + c10 = Wd().bN; + f10 = e10.j; + g10 = y7(); + var h10 = vO(e10).ba; + a10 = /* @__PURE__ */ function() { + return function(p10) { + return ic(p10); + }; + }(a10); + var k10 = ii().u; + if (k10 === ii().u) + if (h10 === H10()) + a10 = H10(); + else { + k10 = h10.ga(); + var l10 = k10 = ji(a10(k10), H10()); + for (h10 = h10.ta(); h10 !== H10(); ) { + var m10 = h10.ga(); + m10 = ji(a10(m10), H10()); + l10 = l10.Nf = m10; + h10 = h10.ta(); + } + a10 = k10; + } + else { + for (k10 = se4(h10, k10); !h10.b(); ) + l10 = h10.ga(), k10.jd(a10(l10)), h10 = h10.ta(); + a10 = k10.Rc(); + } + a10 = "Node " + a10.Kg(",") + " cannot be patched"; + e10 = Ab(e10.x, q5(jd)); + h10 = y7(); + b10.Gc(c10.j, f10, g10, a10, e10, Yb().qb, h10); + return y7(); + } + throw new x7().d(g10); + } + function RDa(a10, b10, c10, e10, f10, g10, h10) { + var k10 = false, l10 = null, m10 = b10.g.vb.Ja(c10); + a: { + if (m10 instanceof z7 && (k10 = true, l10 = m10, m10 = l10.i, m10.r instanceof $r)) { + k10 = m10.r.wb; + break a; + } + k10 ? (k10 = l10.i, k10 = J5(K7(), new Ib().ha([k10.r]))) : k10 = H10(); + } + l10 = new YDa(); + m10 = K7(); + l10 = k10.ec(l10, m10.u).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(v10, A10) { + return function(D10, C10) { + var I10 = C10.j.split(A10).join(""); + return D10.cc(new R6().M(I10, C10)); + }; + }(a10, g10))); + m10 = e10.r; + m10 = m10 instanceof $r ? m10.wb : J5(K7(), new Ib().ha([m10])); + var p10 = new ZDa(), t10 = K7(); + m10 = m10.ec(p10, t10.u).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(v10, A10) { + return function(D10, C10) { + var I10 = C10.j.split(A10).join(""); + return D10.cc(new R6().M(I10, C10)); + }; + }(a10, h10))); + f10 = IDa(f10); + "insert" === f10 ? (a10 = new $Da().kU(a10, l10, h10), g10 = Id().u, a10 = xs(m10, a10, g10), g10 = new aEa(), h10 = Id(), a10 = a10.ec(g10, h10.u).ke(), g10 = new bEa(), h10 = K7(), g10 = k10.ec(g10, h10.u), h10 = K7(), a10 = g10.Tr(a10, h10.u), tO(sO(b10), c10, a10)) : "delete" === f10 ? (a10 = new cEa().kU(a10, l10, h10), g10 = Id().u, a10 = xs(m10, a10, g10), g10 = new dEa(), h10 = Id(), a10 = a10.ec(g10, h10.u).ke(), g10 = new eEa(), h10 = K7(), a10 = k10.ec(g10, h10.u).cq(a10), tO(sO(b10), c10, a10)) : "update" === f10 ? (k10 = new fEa().kU(a10, l10, h10), e10 = Id().u, k10 = xs(m10, k10, e10), e10 = new gEa(), f10 = Id(), k10 = k10.ec(e10, f10.u), h10 = w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.ya(); + return new R6().M(I10, PDa(v10, new z7().d(I10), A10, C10, D10)); + } + throw new x7().d(C10); + }; + }(a10, g10, h10)), e10 = Id(), a10 = k10.ka(h10, e10.u).ke().ne(l10, Uc(/* @__PURE__ */ function(v10, A10) { + return function(D10, C10) { + C10 = new R6().M(D10, C10); + D10 = C10.Tp; + var I10 = C10.hr; + if (null !== I10) { + C10 = I10.ma(); + I10 = I10.ya(); + if (I10 instanceof z7) + return I10 = I10.i, D10.Wh(C10.j.split(A10).join(""), I10); + if (y7() === I10) + return D10.wp(C10.j.split(A10).join("")); + throw new x7().d(I10); + } + throw new x7().d(C10); + }; + }(a10, g10))), b10 = sO(b10), a10 = new Fc().Vd(a10), tO(b10, c10, a10.Sb.Ye().Dd())) : "upsert" === f10 ? (k10 = xO(m10), e10 = w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.ya(); + I10 = A10.Ja(I10.split(D10).join("")); + if (I10 instanceof z7) + return new R6().M(new z7().d(I10.i), C10); + if (y7() === I10) + return new R6().M(y7(), C10); + throw new x7().d(I10); + } + throw new x7().d(C10); + }; + }(a10, l10, h10)), f10 = K7(), k10 = k10.ka(e10, f10.u), e10 = w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.ya(); + if (I10 instanceof z7) + return I10 = I10.i, new R6().M(new z7().d(I10), PDa(v10, new z7().d(I10), A10, C10, D10)); + if (y7() === I10) + return new R6().M(y7(), new z7().d(C10)); + throw new x7().d(I10); + } + throw new x7().d(C10); + }; + }(a10, g10, h10)), f10 = K7(), a10 = k10.ka(e10, f10.u).ne(l10, Uc(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10, I10) { + var L10 = new R6().M(C10, I10); + C10 = L10.Tp; + I10 = L10.hr; + if (null !== I10) { + L10 = I10.ma(); + I10 = I10.ya(); + if (L10 instanceof z7) { + L10 = L10.i; + if (I10 instanceof z7) + return I10 = I10.i, C10.Wh(L10.j.split(A10).join(""), I10); + if (y7() === I10) + return C10.wp(L10.j.split(A10).join("")); + throw new x7().d(I10); + } + if (y7() === L10) { + if (I10 instanceof z7) + return I10 = I10.i, C10.Wh(I10.j.split(D10).join(""), I10); + if (y7() === I10) + return C10; + throw new x7().d(I10); + } + } + throw new x7().d(L10); + }; + }(a10, g10, h10))), b10 = sO(b10), a10 = new Fc().Vd(a10), tO(b10, c10, a10.Sb.Ye().Dd())) : "ignore" !== f10 && "fail" === f10 && (a10 = a10.ob, g10 = Wd().bN, b10 = b10.j, h10 = y7(), c10 = "Property " + ic(c10.r) + " cannot be patched", k10 = Ab(e10.x, q5(jd)), l10 = y7(), a10.Gc(g10.j, b10, h10, c10, k10, Yb().qb, l10)); + } + kO.prototype.$classData = r8({ kIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage", { kIa: 1, ii: 1, f: 1 }); + function nO() { + this.ob = null; + } + nO.prototype = new gv(); + nO.prototype.constructor = nO; + nO.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function hEa(a10, b10) { + for (var c10 = 1, e10 = a10; b10.Ha(e10); ) + c10 = 1 + c10 | 0, e10 = "" + a10 + c10; + return e10; + } + function iEa(a10, b10, c10) { + if (Zc(b10)) { + var e10 = b10.tk(), f10 = new jEa(), g10 = K7(); + c10 = e10.ec(f10, g10.u).ne(c10, Uc(/* @__PURE__ */ function() { + return function(h10, k10) { + return h10.Wh(k10.j, k10); + }; + }(a10))); + } + b10 = b10.Ve(); + e10 = new kEa(); + f10 = K7(); + return b10.ec(e10, f10.u).ne(c10, Uc(/* @__PURE__ */ function(h10) { + return function(k10, l10) { + return iEa(h10, l10, k10); + }; + }(a10))); + } + function lEa(a10, b10, c10, e10) { + if (b10.Da()) { + var f10 = b10.ga(), g10 = c10.Ja(f10.j); + if (g10 instanceof z7) + lEa(a10, b10.ta(), c10, e10); + else if (y7() === g10) { + if (Za(f10).na()) { + g10 = J5(K7(), H10()); + g10 = mEa(a10, Az(f10, g10)); + var h10 = B6(f10.Y(), f10.R).A; + g10 = g10.Zea(h10.b() ? null : h10.c()); + f10 = Rd(g10, f10.j); + } + if (f10 instanceof Cd) { + g10 = f10; + b10 = b10.ta(); + g10 = B6(g10.g, wj().ej); + h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return B6(l10.g, Ae4().bh); + }; + }(a10)); + var k10 = K7(); + g10 = g10.bd(h10, k10.u); + h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10 = p10.A; + return m10.Ja(p10.b() ? null : p10.c()); + }; + }(a10, e10)); + k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = new nEa(); + k10 = K7(); + g10 = g10.ec(h10, k10.u); + h10 = K7(); + b10 = b10.ia(g10, h10.u); + } else { + if (!(f10 instanceof ze2)) + throw new x7().d(f10); + g10 = f10; + b10 = b10.ta(); + g10 = B6(g10.g, Ae4().bh); + h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10 = p10.A; + return m10.Ja(p10.b() ? null : p10.c()); + }; + }(a10, e10)); + k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = new oEa(); + k10 = K7(); + g10 = g10.ec(h10, k10.u); + h10 = K7(); + b10 = b10.ia(g10, h10.u); + } + g10 = B6(f10.Y(), nc().Ni()).kc(); + g10 instanceof z7 && (h10 = g10.i, md(h10) && Za(h10).na() && (g10 = K7(), h10 = [Za(h10).c()], g10 = J5(g10, new Ib().ha(h10)), h10 = K7(), b10 = b10.ia(g10, h10.u))); + g10 = B6(f10.Y(), f10.R).A; + -1 !== ((g10.b() ? null : g10.c()).indexOf(".") | 0) && (g10 = B6(f10.Y(), f10.R).A, g10 = g10.b() ? null : g10.c(), g10 = Mc(ua(), g10, "."), f10.Zea(hEa(Oc(new Pc().fd(g10)), e10))); + c10.Xh(new R6().M( + f10.j, + f10 + )); + lEa(a10, b10, c10, e10); + } else + throw new x7().d(g10); + } + } + function pEa(a10, b10, c10) { + c10 = b10.Ve().ne(c10, Uc(/* @__PURE__ */ function() { + return function(g10, h10) { + h10 = h10.Ve(); + var k10 = new qEa(), l10 = K7(); + return g10.Lk(h10.ec(k10, l10.u)); + }; + }(a10))); + b10 = b10.Ve(); + var e10 = new rEa(), f10 = K7(); + return b10.ec(e10, f10.u).ne(c10, Uc(/* @__PURE__ */ function(g10) { + return function(h10, k10) { + return pEa(g10, k10, h10); + }; + }(a10))); + } + function mEa(a10, b10) { + var c10 = new S6().a(), e10 = b10.Y().vb, f10 = mz(); + f10 = Ua(f10); + var g10 = Id().u; + Jd(e10, f10, g10).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return Ui(k10, l10.Lc, l10.r.r, l10.r.x); + }; + }(a10, c10))); + if (b10 instanceof Cd) + return new Cd().K(c10, (O7(), new P6().a())); + if (b10 instanceof ze2) + return new ze2().K(c10, (O7(), new P6().a())); + throw new x7().d(b10); + } + nO.prototype.ye = function(a10) { + var b10 = iEa(this, a10, Rb(Gb().ab, H10())), c10 = sEa(this, a10, J5(Gb().Qg, H10())), e10 = pEa(this, a10, J5(Gb().Qg, H10())), f10 = Rb(Ut(), H10()), g10 = a10.tk().Cb(w6(/* @__PURE__ */ function() { + return function(k10) { + return md(k10); + }; + }(this))); + lEa(this, g10, f10, b10); + tEa(this, f10); + b10 = f10.Ur().ke(); + f10 = qe2(); + f10 = re4(f10); + e10 = HN(e10, f10).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function() { + return function(k10, l10) { + var m10 = new R6().M(k10, l10); + k10 = m10.Tp; + l10 = m10.hr; + if (null !== l10) + return m10 = l10.ma(), l10 = l10.Ki(), k10.Wh("vocab" + l10, new R6().M(m10.j, m10.j)); + throw new x7().d(m10); + }; + }(this))); + c10 = kz(c10); + f10 = K7(); + c10 = c10.og(f10.u); + f10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(), t10 = m10.Ki(); + if (null !== p10) { + O7(); + m10 = new P6().a(); + m10 = new yO().K(new S6().a(), m10); + var v10 = dd().Kh; + p10 = eb(m10, v10, p10); + m10 = "external" + t10; + v10 = dd().Zc; + p10 = eb(p10, v10, m10); + m10 = Lc(l10); + t10 = (m10.b() ? l10.j : m10.c()) + "#/external/external" + t10; + return Rd(p10, t10); + } + } + throw new x7().d(m10); + }; + }(this, a10)); + g10 = K7(); + c10 = c10.ka(f10, g10.u); + if (a10 instanceof zO) { + O7(); + f10 = new P6().a(); + f10 = new zO().K(new S6().a(), f10); + f10 = Rd(f10, a10.j); + g10 = Lc(a10); + g10 = g10.b() ? a10.j : g10.c(); + var h10 = Bq().uc; + f10 = eb(f10, h10, g10); + g10 = B6(a10.g, Gc().Pj); + h10 = Gc().Pj; + f10 = Vd(f10, h10, g10); + g10 = Af().Ic; + b10 = Bf(f10, g10, b10); + f10 = Bd().vh; + c10 = Zd(b10, f10, c10); + b10 = B6(a10.g, Gc().R).A; + b10 = b10.b() ? null : b10.c(); + f10 = Gc().R; + c10 = eb(c10, f10, b10); + a10 = B6(a10.g, Gc().Ym).A; + a10 = a10.b() ? null : a10.c(); + b10 = Gc().Ym; + a10 = eb(c10, b10, a10); + } else if (a10 instanceof AO) + O7(), f10 = new P6().a(), f10 = new AO().K(new S6().a(), f10), f10 = Rd(f10, a10.j), g10 = Lc(a10), a10 = g10.b() ? a10.j : g10.c(), g10 = Bq().uc, a10 = eb(f10, g10, a10), f10 = Af().Ic, a10 = Bf(a10, f10, b10), b10 = Bd().vh, a10 = Zd(a10, b10, c10); + else { + if (!(a10 instanceof BO)) + throw new x7().d(a10); + O7(); + b10 = new P6().a(); + b10 = new BO().K(new S6().a(), b10); + b10 = Rd(b10, a10.j); + f10 = Lc(a10); + f10 = f10.b() ? a10.j : f10.c(); + g10 = Bq().uc; + b10 = eb(b10, g10, f10); + a10 = B6(a10.g, Gc().nb); + f10 = Gc().nb; + a10 = Vd(b10, f10, a10); + b10 = Bd().vh; + a10 = Zd(a10, b10, c10); + } + c10 = a10.fa(); + b10 = qe2(); + b10 = re4(b10); + c10.Lb(new tB().hk(qt(e10, b10))); + return a10; + }; + function sEa(a10, b10, c10) { + if (b10 instanceof AO) { + var e10 = cd(b10), f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, dd().Kh).A; + return h10.b() ? null : h10.c(); + }; + }(a10)), g10 = K7(); + c10 = c10.Lk(e10.ka(f10, g10.u)); + } else + b10 instanceof zO ? (e10 = cd(b10), f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, dd().Kh).A; + return h10.b() ? null : h10.c(); + }; + }(a10)), g10 = K7(), c10 = c10.Lk(e10.ka(f10, g10.u))) : b10 instanceof BO && (e10 = cd(b10), f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, dd().Kh).A; + return h10.b() ? null : h10.c(); + }; + }(a10)), g10 = K7(), c10 = c10.Lk(e10.ka(f10, g10.u))); + return b10.Ve().ne(c10, Uc(/* @__PURE__ */ function(h10) { + return function(k10, l10) { + return sEa( + h10, + l10, + k10 + ); + }; + }(a10))); + } + function tEa(a10, b10) { + b10.Ur().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = B6(f10.Y(), nc().Ni()).kc(); + if (g10 instanceof z7 && (g10 = g10.i, md(g10) && Za(g10).na() && e10.Ha(Za(g10).c().j))) { + var h10 = e10.P(Za(g10).c().j); + g10 = wj().Ni(); + h10 = J5(K7(), new Ib().ha([h10])); + return Bf(f10, g10, h10); + } + }; + }(a10, b10))); + } + nO.prototype.$classData = r8({ vIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage", { vIa: 1, ii: 1, f: 1 }); + function CO() { + this.pb = null; + } + CO.prototype = new u7(); + CO.prototype.constructor = CO; + function uEa(a10, b10, c10, e10) { + Ef(); + var f10 = Jf(new Kf(), new Lf().a()).eb, g10 = B6(c10.g, $d().wj).A; + if (!g10.b()) { + var h10 = +g10.c(), k10 = "Property '" + B6(c10.g, $d().R) + "' minimum inclusive value is " + h10, l10 = B6(c10.g, $d().R).A, m10 = DO(b10, l10.b() ? null : l10.c(), "minimum"), p10 = new z7().d(k10), t10 = new z7().d(k10), v10 = J5(K7(), new Ib().ha([b10.j])), A10 = K7(), D10 = B6(c10.g, $d().Yh).A, C10 = D10.b() ? null : D10.c(), I10 = B6(c10.g, $d().R).A, L10 = DO(b10, I10.b() ? null : I10.c(), "minimum") + "/prop", Y10 = new z7().d(k10), ia = new z7().d("" + h10), pa = y7(), La = y7(), ob = y7(), zb = y7(), Zb = y7(), Cc = y7(), vc = y7(), id = y7(), yd = y7(), zd = y7(), rd = y7(), sd = y7(), le4 = J5(K7(), H10()); + K7(); + pj(); + var Vc = new Lf().a().ua(), Sc = y7(), Qc = y7(), $c = J5(A10, new Ib().ha([EO(C10, L10, Y10, pa, La, ob, zb, Zb, Cc, vc, id, ia, yd, zd, rd, sd, le4, Vc, Sc, Qc)])); + oj(); + K7(); + pj(); + var Wc = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Qe = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Qd = new Lf().a().ua(); + oj(); + K7(); + pj(); + var me4 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var of = new Lf().a().ua(); + oj(); + var Le2 = y7(); + oj(); + K7(); + pj(); + var Ve = new Lf().a().ua(); + oj(); + var he4 = y7(); + oj(); + var Wf = y7(); + oj(); + var vf = y7(); + Dg(f10, qj(new rj(), m10, k10, p10, t10, Wc, v10, Qe, Qd, me4, of, Le2, $c, Ve, he4, Wf, vf)); + } + var He = B6(c10.g, $d().vj).A; + if (!He.b()) { + var Ff = +He.c(), wf = "Property '" + B6(c10.g, $d().R) + "' maximum inclusive value is " + Ff, Re2 = B6(c10.g, $d().R).A, we4 = DO(b10, Re2.b() ? null : Re2.c(), "maximum"), ne4 = new z7().d(wf), Me2 = new z7().d(wf), Se4 = J5(K7(), new Ib().ha([b10.j])), xf = K7(), ie3 = B6(c10.g, $d().Yh).A, gf = ie3.b() ? null : ie3.c(), pf = B6(c10.g, $d().R).A, hf = DO(b10, pf.b() ? null : pf.c(), "maximum") + "/prop", Gf = new z7().d(wf), yf = new z7().d("" + Ff), oe4 = y7(), lg = y7(), bh = y7(), Qh = y7(), af = y7(), Pf = y7(), oh = y7(), ch = y7(), Ie2 = y7(), ug = y7(), Sg = y7(), Tg = y7(), zh = J5(K7(), H10()); + K7(); + pj(); + var Rh = new Lf().a().ua(), vg = y7(), dh = y7(), Jg = J5(xf, new Ib().ha([EO(gf, hf, Gf, oe4, lg, bh, Qh, af, Pf, oh, ch, Ie2, yf, ug, Sg, Tg, zh, Rh, vg, dh)])); + oj(); + K7(); + pj(); + var Ah = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Bh = new Lf().a().ua(); + oj(); + K7(); + pj(); + var cg = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Qf = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Kg = new Lf().a().ua(); + oj(); + var Ne2 = y7(); + oj(); + K7(); + pj(); + var Xf = new Lf().a().ua(); + oj(); + var di = y7(); + oj(); + var dg = y7(); + oj(); + var Hf = y7(); + Dg(f10, qj(new rj(), we4, wf, ne4, Me2, Ah, Se4, Bh, cg, Qf, Kg, Ne2, Jg, Xf, di, dg, Hf)); + } + if (B6(c10.g, $d().ji).A.na()) + var wg = B6( + c10.g, + $d().ji + ), Lg = 0 < vEa(wg); + else + Lg = false; + if (Lg) { + var jf = "Property '" + B6(c10.g, $d().R) + "' is mandatory", mg = B6(c10.g, $d().R).A, Mg = DO(b10, mg.b() ? null : mg.c(), "required"), Ng = new z7().d(jf), eg = new z7().d(jf), Oe4 = J5(K7(), new Ib().ha([b10.j])), ng = K7(), fg = B6(c10.g, $d().Yh).A, Ug = fg.b() ? null : fg.c(), xg = B6(c10.g, $d().R).A, gg = DO(b10, xg.b() ? null : xg.c(), "required") + "/prop", fe4 = new z7().d(jf), ge4 = new z7().d("1"), ph = y7(), hg = y7(), Jh = y7(), fj = y7(), yg = y7(), qh = y7(), og = y7(), rh = y7(), Ch = y7(), Vg = y7(), Wg = y7(), Rf = y7(), Sh = J5(K7(), H10()); + K7(); + pj(); + var zg = new Lf().a().ua(), Ji = y7(), Kh = y7(), Lh = J5(ng, new Ib().ha([EO(Ug, gg, fe4, ph, hg, Jh, ge4, fj, yg, qh, og, rh, Ch, Vg, Wg, Rf, Sh, zg, Ji, Kh)])); + oj(); + K7(); + pj(); + var Ki = new Lf().a().ua(); + oj(); + K7(); + pj(); + var gj = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Rl = new Lf().a().ua(); + oj(); + K7(); + pj(); + var ek = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Dh = new Lf().a().ua(); + oj(); + var Eh = y7(); + oj(); + K7(); + pj(); + var Li = new Lf().a().ua(); + oj(); + var Mi = y7(); + oj(); + var uj = y7(); + oj(); + var Ni = y7(); + Dg(f10, qj(new rj(), Mg, jf, Ng, eg, Ki, Oe4, gj, Rl, ek, Dh, Eh, Lh, Li, Mi, uj, Ni)); + } + var fk = B6(c10.g, $d().Ey); + if (Ic(fk)) + Dk = false; + else + var Ck = B6(c10.g, $d().nr), Dk = oN(Ck); + if (Dk) { + var hj = "Property '" + B6(c10.g, $d().R) + "' cannot have more than 1 value", ri = B6(c10.g, $d().R).A, gk = DO(b10, ri.b() ? null : ri.c(), "notCollection"), $k = new z7().d(hj), lm = new z7().d(hj), si = J5(K7(), new Ib().ha([b10.j])), bf = K7(), ei = B6(c10.g, $d().Yh).A, vj = ei.b() ? null : ei.c(), ti = B6(c10.g, $d().R).A, Og = DO(b10, ti.b() ? null : ti.c(), "notCollection") + "/prop", Oi = new z7().d(hj), pg = new z7().d("1"), zf = y7(), Sf = y7(), eh = y7(), Fh = y7(), fi = y7(), hn = y7(), mm = y7(), nm = y7(), kd = y7(), Pi = y7(), sh = y7(), Pg = y7(), Xc = J5(K7(), H10()); + K7(); + pj(); + var xe2 = new Lf().a().ua(), Nc = y7(), om = y7(), Dn = J5(bf, new Ib().ha([EO(vj, Og, Oi, zf, Sf, pg, eh, Fh, fi, hn, mm, nm, kd, Pi, sh, Pg, Xc, xe2, Nc, om)])); + oj(); + K7(); + pj(); + var gi = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Te = new Lf().a().ua(); + oj(); + K7(); + pj(); + var pm = new Lf().a().ua(); + oj(); + K7(); + pj(); + var jn = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Oq = new Lf().a().ua(); + oj(); + var En = y7(); + oj(); + K7(); + pj(); + var $n = new Lf().a().ua(); + oj(); + var Rp = y7(); + oj(); + var ao = y7(); + oj(); + var Xt = y7(); + Dg(f10, qj(new rj(), gk, hj, $k, lm, gi, si, Te, pm, jn, Oq, En, Dn, $n, Rp, ao, Xt)); + } + var Fs = B6(c10.g, $d().zl).A; + if (Fs instanceof z7) { + var Sp = Fs.i, bo = "Property '" + B6(c10.g, $d().R) + "' must match pattern " + Sp, Gs = B6(c10.g, $d().R).A, Fn = DO(b10, Gs.b() ? null : Gs.c(), "pattern"), Pq = new z7().d(bo), Jr = new z7().d(bo), Hs = J5(K7(), new Ib().ha([b10.j])), Is = K7(), Kr = B6(c10.g, $d().Yh).A, Js = Kr.b() ? null : Kr.c(), Ks = B6(c10.g, $d().R).A, ov = DO(b10, Ks.b() ? null : Ks.c(), "pattern"), pv = new z7().d(bo), Ls = new z7().d(Sp), qv = y7(), rv = y7(), Yt = y7(), sv = y7(), Qq = y7(), tv = y7(), Ms = y7(), Zt = y7(), uv = y7(), cp = y7(), Ns = y7(), $t = y7(), au = J5(K7(), H10()); + K7(); + pj(); + var Qj = new Lf().a(), Jw = [EO( + Js, + ov + "/prop", + pv, + Ls, + qv, + rv, + Yt, + sv, + Qq, + tv, + Ms, + Zt, + uv, + cp, + Ns, + $t, + au, + Qj.ua(), + y7(), + y7() + )], dp = J5(Is, new Ib().ha(Jw)); + oj(); + K7(); + pj(); + var bu = new Lf().a().ua(); + oj(); + K7(); + pj(); + var ui = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Os = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Ps = new Lf().a().ua(); + oj(); + K7(); + pj(); + var cu = new Lf().a().ua(); + oj(); + var Qs = y7(); + oj(); + K7(); + pj(); + var du = new Lf().a().ua(); + oj(); + var vv = y7(); + oj(); + var wv = y7(); + oj(); + var xv = y7(); + Dg(f10, qj(new rj(), Fn, bo, Pq, Jr, bu, Hs, ui, Os, Ps, cu, Qs, dp, du, vv, wv, xv)); + } + if (B6(c10.g, $d().ZI).Da()) { + var py = B6(c10.g, $d().ZI), Rq = w6(/* @__PURE__ */ function() { + return function(Ri) { + Ri = Ri.A; + return Ri.b() ? null : Ri.c(); + }; + }(a10)), Kw = K7(), Lw = py.ka(Rq, Kw.u), eu = "Property '" + B6(c10.g, $d().R) + "' must match some value in " + Lw.Kg(","), yv = B6(c10.g, $d().R).A, qy = DO(b10, yv.b() ? null : yv.c(), "enum"), zv = new z7().d(eu), Mw = new z7().d(eu), ry = J5(K7(), new Ib().ha([b10.j])), Tp = K7(), Ss = B6(c10.g, $d().Yh).A, Nw = Ss.b() ? null : Ss.c(), fu = B6(c10.g, $d().R).A, Ow = DO(b10, fu.b() ? null : fu.c(), "enum") + "/prop", Pw = new z7().d(eu), Sq = w6(/* @__PURE__ */ function() { + return function(Ri) { + return "" + Ri; + }; + }(a10)), gu = K7(), Qw = Lw.ka(Sq, gu.u), Rw = y7(), Sw = y7(), AA = y7(), Up = y7(), kn = y7(), Vp = y7(), sy = y7(), BA = y7(), GD = y7(), Av = y7(), Tw = y7(), HD = y7(), ID = y7(), CA = J5(K7(), H10()), DA = y7(), JD = y7(), KD = J5(Tp, new Ib().ha([EO(Nw, Ow, Pw, Rw, Sw, AA, Up, kn, Vp, sy, BA, GD, Av, Tw, HD, ID, CA, Qw, DA, JD)])); + oj(); + K7(); + pj(); + var EA = new Lf().a().ua(); + oj(); + K7(); + pj(); + var yG = new Lf().a().ua(); + oj(); + K7(); + pj(); + var zG = new Lf().a().ua(); + oj(); + K7(); + pj(); + var LD = new Lf().a().ua(); + oj(); + K7(); + pj(); + var GA = new Lf().a().ua(); + oj(); + var AG = y7(); + oj(); + K7(); + pj(); + var uy = new Lf().a().ua(); + oj(); + var BG = y7(); + oj(); + var MD = y7(); + oj(); + var ND = y7(); + Dg(f10, qj( + new rj(), + qy, + eu, + zv, + Mw, + EA, + ry, + yG, + zG, + LD, + GA, + AG, + KD, + uy, + BG, + MD, + ND + )); + } + if (B6(c10.g, $d().Gf).A.na()) { + var OD = B6(c10.g, $d().Gf).A, Us = OD.b() ? null : OD.c(); + if (Ed(ua(), Us, "number") || Ed(ua(), Us, "float") || Ed(ua(), Us, "double")) { + var vy = "Property '" + B6(c10.g, $d().R) + "' value must be of type " + Uh().hi + " or " + Uh().of, HA = B6(c10.g, $d().R).A, IA = DO(b10, HA.b() ? null : HA.c(), "dialectRange"), Vs = new z7().d(vy), JA = new z7().d(vy), KA = J5(K7(), new Ib().ha([b10.j])), wy = K7(), xy = B6(c10.g, $d().Yh).A, PD = xy.b() ? null : xy.c(), Bv = B6(c10.g, $d().R).A, LA = DO(b10, Bv.b() ? null : Bv.c(), "dialectRange") + "/prop", QD = new z7().d(vy), RD = new z7().d(Uc(/* @__PURE__ */ function() { + return function(Ri) { + T6(); + var lf = F6().Ua; + lf = ic(G5(lf, "or")); + var Hk = mh(T6(), lf); + lf = new PA().e(Ri.ca); + var If = lf.s, mp = lf.ca, np = new rr().e(mp); + T6(); + var jt = mh(T6(), "@list"), cq = new PA().e(np.ca), sm = cq.s, Tr = cq.ca, kt = new PA().e(Tr), hL = kt.s, mH = kt.ca, su = new rr().e(mH); + T6(); + var Ln = F6().Ua; + Ln = ic(G5(Ln, "datatype")); + var gB = mh(T6(), Ln); + Ln = new PA().e(su.ca); + var Fo = Ln.s, hB = Ln.ca, dq = new rr().e(hB); + T6(); + var fx = mh(T6(), "@id"); + T6(); + var tu = Uh().hi.trim(); + tu = mh(T6(), tu); + sr(dq, fx, tu); + pr(Fo, mr(T6(), tr( + ur(), + dq.s, + hB + ), Q5().sa)); + Fo = Ln.s; + gB = [gB]; + if (0 > Fo.w) + throw new U6().e("0"); + dq = gB.length | 0; + hB = Fo.w + dq | 0; + uD(Fo, hB); + Ba(Fo.L, 0, Fo.L, dq, Fo.w); + dq = Fo.L; + var uu = dq.n.length; + tu = fx = 0; + var iB = gB.length | 0; + uu = iB < uu ? iB : uu; + iB = dq.n.length; + for (uu = uu < iB ? uu : iB; fx < uu; ) + dq.n[tu] = gB[fx], fx = 1 + fx | 0, tu = 1 + tu | 0; + Fo.w = hB; + pr(su.s, vD(wD(), Ln.s)); + pr(hL, mr(T6(), tr(ur(), su.s, mH), Q5().sa)); + hL = kt.s; + mH = kt.ca; + su = new rr().e(mH); + T6(); + Ln = F6().Ua; + Ln = ic(G5(Ln, "datatype")); + gB = mh(T6(), Ln); + Ln = new PA().e(su.ca); + Fo = Ln.s; + hB = Ln.ca; + dq = new rr().e(hB); + T6(); + fx = mh(T6(), "@id"); + T6(); + tu = Uh().Nh.trim(); + tu = mh(T6(), tu); + sr(dq, fx, tu); + pr(Fo, mr(T6(), tr(ur(), dq.s, hB), Q5().sa)); + Fo = Ln.s; + gB = [gB]; + if (0 > Fo.w) + throw new U6().e("0"); + dq = gB.length | 0; + hB = Fo.w + dq | 0; + uD(Fo, hB); + Ba(Fo.L, 0, Fo.L, dq, Fo.w); + dq = Fo.L; + uu = dq.n.length; + tu = fx = 0; + iB = gB.length | 0; + uu = iB < uu ? iB : uu; + iB = dq.n.length; + for (uu = uu < iB ? uu : iB; fx < uu; ) + dq.n[tu] = gB[fx], fx = 1 + fx | 0, tu = 1 + tu | 0; + Fo.w = hB; + pr(su.s, vD(wD(), Ln.s)); + pr(hL, mr(T6(), tr(ur(), su.s, mH), Q5().sa)); + T6(); + eE(); + Tr = SA(zs(), Tr); + kt = mr(0, new Sx().Ac(Tr, kt.s), Q5().cd); + pr(sm, kt); + sm = cq.s; + jt = [jt]; + if (0 > sm.w) + throw new U6().e("0"); + Tr = jt.length | 0; + kt = sm.w + Tr | 0; + uD(sm, kt); + Ba(sm.L, 0, sm.L, Tr, sm.w); + Tr = sm.L; + su = Tr.n.length; + mH = hL = 0; + Ln = jt.length | 0; + su = Ln < su ? Ln : su; + Ln = Tr.n.length; + for (su = su < Ln ? su : Ln; hL < su; ) + Tr.n[mH] = jt[hL], hL = 1 + hL | 0, mH = 1 + mH | 0; + sm.w = kt; + pr(np.s, vD(wD(), cq.s)); + pr(If, mr(T6(), tr(ur(), np.s, mp), Q5().sa)); + If = lf.s; + Hk = [Hk]; + if (0 > If.w) + throw new U6().e("0"); + np = Hk.length | 0; + mp = If.w + np | 0; + uD(If, mp); + Ba(If.L, 0, If.L, np, If.w); + np = If.L; + sm = np.n.length; + jt = cq = 0; + kt = Hk.length | 0; + sm = kt < sm ? kt : sm; + kt = np.n.length; + for (sm = sm < kt ? sm : kt; cq < sm; ) + np.n[jt] = Hk[cq], cq = 1 + cq | 0, jt = 1 + jt | 0; + If.w = mp; + pr(Ri.s, vD(wD(), lf.s)); + }; + }(a10))), yy = new z7().d(Uc(/* @__PURE__ */ function() { + return function(Ri, lf) { + var Hk = Sha(Ri), If = Hk + "_ointdoub1"; + Hk += "_ointdoub2"; + var mp = F6().Ua; + pE(Ri, lf, ic(G5(mp, "or")), If); + lf = F6().Qi; + pE(Ri, If, ic(G5(lf, "first")), If + "_v"); + lf = F6().Ua; + lf = ic(G5(lf, "datatype")); + mp = Uh().hi; + pE(Ri, If + "_v", lf, mp.trim()); + lf = F6().Qi; + pE(Ri, If, ic(G5(lf, "rest")), Hk); + If = F6().Qi; + pE(Ri, Hk, ic(G5(If, "first")), Hk + "_v"); + If = F6().Ua; + If = ic(G5(If, "datatype")); + lf = Uh().Nh; + pE(Ri, Hk + "_v", If, lf.trim()); + If = F6().Qi; + If = ic(G5(If, "rest")); + lf = F6().Qi; + return pE(Ri, Hk, If, ic(G5(lf, "nil"))); + }; + }(a10))), CG = y7(), qm = y7(), Lm = y7(), Xg = y7(), ln = y7(), ep = y7(), ty = y7(), Ts = y7(), Mr = y7(), hu = y7(), FA = y7(), Uw = y7(), vG = y7(), wG = J5(K7(), H10()); + K7(); + pj(); + var xG = new Lf().a().ua(), rT = J5(wy, new Ib().ha([EO(PD, LA, QD, CG, qm, Lm, Xg, ln, ep, ty, Ts, Mr, hu, FA, Uw, vG, wG, xG, RD, yy)])); + oj(); + K7(); + pj(); + var nH = new Lf().a().ua(); + oj(); + K7(); + pj(); + var sT = new Lf().a().ua(); + oj(); + K7(); + pj(); + var tT = new Lf().a().ua(); + oj(); + K7(); + pj(); + var uT = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Oy = new Lf().a().ua(); + oj(); + var Py = y7(); + oj(); + K7(); + pj(); + var Ur = new Lf().a().ua(); + oj(); + var jB = y7(); + oj(); + var Vr = y7(); + oj(); + var Pv = y7(); + Dg(f10, qj(new rj(), IA, vy, Vs, JA, nH, KA, sT, tT, uT, Oy, Py, rT, Ur, jB, Vr, Pv)); + } else if (Ed(ua(), Us, "link")) { + var op = "Property '" + B6(c10.g, $d().R) + "' value must be of a link", jE = B6(c10.g, $d().R).A, kB = DO(b10, jE.b() ? null : jE.c(), "dialectRange"), vT = new z7().d(op), wma = new z7().d(op), kPa = J5(K7(), new Ib().ha([b10.j])), lPa = K7(), Lza = B6(c10.g, $d().Yh).A, mPa = Lza.b() ? null : Lza.c(), Mza = B6(c10.g, $d().R).A, nPa = DO(b10, Mza.b() ? null : Mza.c(), "dialectRange") + "/prop", oPa = new z7().d(op), pPa = new z7().d(Uc(/* @__PURE__ */ function() { + return function(Ri) { + T6(); + var lf = F6().Ua; + lf = ic(G5(lf, "nodeKind")); + var Hk = mh(T6(), lf); + lf = new PA().e(Ri.ca); + var If = lf.s, mp = lf.ca, np = new rr().e(mp); + T6(); + var jt = mh(T6(), "@id"); + T6(); + var cq = F6().Ua; + cq = ic(G5(cq, "IRI")); + cq = mh(T6(), cq); + sr(np, jt, cq); + pr(If, mr(T6(), tr(ur(), np.s, mp), Q5().sa)); + If = lf.s; + Hk = [Hk]; + if (0 > If.w) + throw new U6().e("0"); + np = Hk.length | 0; + mp = If.w + np | 0; + uD(If, mp); + Ba(If.L, 0, If.L, np, If.w); + np = If.L; + var sm = np.n.length; + cq = jt = 0; + var Tr = Hk.length | 0; + sm = Tr < sm ? Tr : sm; + Tr = np.n.length; + for (sm = sm < Tr ? sm : Tr; jt < sm; ) + np.n[cq] = Hk[jt], jt = 1 + jt | 0, cq = 1 + cq | 0; + If.w = mp; + pr(Ri.s, vD(wD(), lf.s)); + }; + }(a10))), qPa = new z7().d(Uc(/* @__PURE__ */ function() { + return function(Ri, lf) { + Sha(Ri); + var Hk = F6().Ua; + Hk = ic(G5(Hk, "nodeKind")); + var If = F6().Ua; + return pE(Ri, lf, Hk, ic(G5(If, "IRI"))); + }; + }(a10))), rPa = y7(), sPa = y7(), tPa = y7(), uPa = y7(), vPa = y7(), wPa = y7(), xPa = y7(), yPa = y7(), zPa = y7(), APa = y7(), BPa = y7(), CPa = y7(), DPa = y7(), EPa = J5(K7(), H10()); + K7(); + pj(); + var FPa = new Lf().a().ua(), GPa = J5(lPa, new Ib().ha([EO(mPa, nPa, oPa, rPa, sPa, tPa, uPa, vPa, wPa, xPa, yPa, zPa, APa, BPa, CPa, DPa, EPa, FPa, pPa, qPa)])); + oj(); + K7(); + pj(); + var dob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var eob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var fob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var gob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var hob = new Lf().a().ua(); + oj(); + var iob = y7(); + oj(); + K7(); + pj(); + var job = new Lf().a().ua(); + oj(); + var kob = y7(); + oj(); + var lob = y7(); + oj(); + var mob = y7(); + Dg(f10, qj(new rj(), kB, op, vT, wma, dob, kPa, eob, fob, gob, hob, iob, GPa, job, kob, lob, mob)); + } else if (Ed(ua(), Us, "guid")) { + var Nza = "Property '" + B6(c10.g, $d().R) + "' value must be of type xsd:string > " + Us, O7a = B6( + c10.g, + $d().R + ).A, nob = DO(b10, O7a.b() ? null : O7a.c(), "dataRange"), oob = new z7().d(Nza), pob = new z7().d(Nza), qob = J5(K7(), new Ib().ha([b10.j])), rob = K7(), P7a = B6(c10.g, $d().Yh).A, sob = P7a.b() ? null : P7a.c(), Q7a = B6(c10.g, $d().R).A, tob = DO(b10, Q7a.b() ? null : Q7a.c(), "dataRange") + "/prop", uob = new z7().d(Nza), vob = F6().Bj, wob = new z7().d(ic(G5(vob, "string"))), xob = y7(), yob = y7(), zob = y7(), Aob = y7(), Bob = y7(), Cob = y7(), Dob = y7(), Eob = y7(), Fob = y7(), Gob = y7(), Hob = y7(), Iob = y7(), Job = J5(K7(), H10()); + K7(); + pj(); + var Kob = new Lf().a().ua(), Lob = y7(), Mob = y7(), Nob = J5(rob, new Ib().ha([EO( + sob, + tob, + uob, + xob, + yob, + zob, + Aob, + Bob, + Cob, + Dob, + Eob, + Fob, + Gob, + Hob, + Iob, + wob, + Job, + Kob, + Lob, + Mob + )])); + oj(); + K7(); + pj(); + var Oob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Pob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Qob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Rob = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Sob = new Lf().a().ua(); + oj(); + var Tob = y7(); + oj(); + K7(); + pj(); + var Uob = new Lf().a().ua(); + oj(); + var Vob = y7(); + oj(); + var Wob = y7(); + oj(); + var Xob = y7(); + Dg(f10, qj(new rj(), nob, Nza, oob, pob, Oob, qob, Pob, Qob, Rob, Sob, Tob, Nob, Uob, Vob, Wob, Xob)); + } else { + var Oza = "Property '" + B6( + c10.g, + $d().R + ) + "' value must be of type " + Us, R7a = B6(c10.g, $d().R).A, Yob = DO(b10, R7a.b() ? null : R7a.c(), "dataRange"), Zob = new z7().d(Oza), $ob = new z7().d(Oza), apb = J5(K7(), new Ib().ha([b10.j])), bpb = K7(), S7a = B6(c10.g, $d().Yh).A, cpb = S7a.b() ? null : S7a.c(), T7a = B6(c10.g, $d().R).A, dpb = DO(b10, T7a.b() ? null : T7a.c(), "dataRange") + "/prop", epb = new z7().d(Oza), fpb = new z7().d(Us), gpb = y7(), hpb = y7(), ipb = y7(), jpb = y7(), kpb = y7(), lpb = y7(), mpb = y7(), npb = y7(), opb = y7(), ppb = y7(), qpb = y7(), rpb = y7(), spb = J5(K7(), H10()); + K7(); + pj(); + var tpb = new Lf().a().ua(), upb = y7(), vpb = y7(), wpb = J5( + bpb, + new Ib().ha([EO(cpb, dpb, epb, gpb, hpb, ipb, jpb, kpb, lpb, mpb, npb, opb, ppb, qpb, rpb, fpb, spb, tpb, upb, vpb)]) + ); + oj(); + K7(); + pj(); + var xpb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var ypb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var zpb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Apb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var Bpb = new Lf().a().ua(); + oj(); + var Cpb = y7(); + oj(); + K7(); + pj(); + var Dpb = new Lf().a().ua(); + oj(); + var Epb = y7(); + oj(); + var Fpb = y7(); + oj(); + var Gpb = y7(); + Dg(f10, qj(new rj(), Yob, Oza, Zob, $ob, xpb, apb, ypb, zpb, Apb, Bpb, Cpb, wpb, Dpb, Epb, Fpb, Gpb)); + } + } + if (B6(c10.g, Ae4().bh).Da()) + var Hpb = B6(c10.g, Ae4().bh), Ipb = w6(/* @__PURE__ */ function() { + return function(Ri) { + Ri = Ri.A; + return Ri.b() ? null : Ri.c(); + }; + }(a10)), Jpb = K7(), Kpb = Hpb.ka(Ipb, Jpb.u), Lpb = F6().$c, U7a = !Kpb.Ha(ic(G5(Lpb, "anyNode"))); + else + U7a = false; + if (U7a) { + var Mpb = B6(c10.g, Ae4().bh), Npb = w6(/* @__PURE__ */ function(Ri) { + return function(lf) { + lf = lf.A; + lf = lf.b() ? null : lf.c(); + lf = nd(Ri, lf); + if (null !== lf) { + var Hk = lf.ya(); + if (Hk instanceof Cd) + return J5(K7(), new Ib().ha([Hk.j])); + } + if (null !== lf && (lf = lf.ya(), lf instanceof ze2)) { + lf = B6(lf.g, Ae4().bh); + Hk = w6(/* @__PURE__ */ function() { + return function(mp) { + mp = mp.A; + return mp.b() ? null : mp.c(); + }; + }(Ri)); + var If = K7(); + return lf.ka(Hk, If.u); + } + K7(); + pj(); + return new Lf().a().ua(); + }; + }(a10)), Opb = K7(), V7a = Mpb.bd(Npb, Opb.u).xg(), Pza = "Property '" + B6(c10.g, $d().R) + "' value must be of type " + B6(c10.g, Ae4().bh), W7a = B6(c10.g, $d().R).A, Ppb = DO(b10, W7a.b() ? null : W7a.c(), "objectRange"), Qpb = new z7().d(Pza), Rpb = new z7().d(Pza), Spb = J5(K7(), new Ib().ha([b10.j])), Tpb = K7(), X7a = B6(c10.g, $d().Yh).A, Upb = X7a.b() ? null : X7a.c(), Y7a = B6(c10.g, $d().R).A, Vpb = DO(b10, Y7a.b() ? null : Y7a.c(), "objectRange") + "/prop", Wpb = new z7().d(Pza), Xpb = kz(V7a), Ypb = y7(), Zpb = y7(), $pb = y7(), aqb = y7(), bqb = y7(), cqb = y7(), dqb = y7(), eqb = y7(), fqb = y7(), gqb = y7(), hqb = y7(), iqb = y7(), jqb = y7(); + K7(); + pj(); + var kqb = new Lf().a().ua(), lqb = y7(), mqb = y7(), nqb = J5(Tpb, new Ib().ha([EO(Upb, Vpb, Wpb, Ypb, Zpb, $pb, aqb, bqb, cqb, dqb, eqb, fqb, gqb, hqb, iqb, jqb, Xpb, kqb, lqb, mqb)])); + oj(); + K7(); + pj(); + var oqb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var pqb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var qqb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var rqb = new Lf().a().ua(); + oj(); + K7(); + pj(); + var sqb = new Lf().a().ua(); + oj(); + var tqb = y7(); + oj(); + K7(); + pj(); + var uqb = new Lf().a().ua(); + oj(); + var vqb = y7(); + oj(); + var wqb = y7(); + oj(); + var xqb = y7(); + Dg(f10, qj(new rj(), Ppb, Pza, Qpb, Rpb, oqb, Spb, pqb, qqb, rqb, sqb, tqb, nqb, uqb, vqb, wqb, xqb)); + V7a.U(w6(/* @__PURE__ */ function(Ri, lf, Hk) { + return function(If) { + If = Fba(Ri.pb, If); + If.b() || (If = If.c(), lf.Ha(If.j) || ws(Hk, wEa(Ri, If, lf.Tm(If.j)))); + }; + }(a10, e10, f10))); + } + return f10.ua(); + } + function xEa(a10) { + var b10 = yEa(a10), c10 = VC(WC(), zEa(a10.pb)), e10 = y7(); + a10 = /* @__PURE__ */ function() { + return function(l10) { + return l10.$; + }; + }(a10); + var f10 = ii().u; + if (f10 === ii().u) + if (b10 === H10()) + a10 = H10(); + else { + f10 = b10.ga(); + for (var g10 = f10 = ji(a10(f10), H10()), h10 = b10.ta(); h10 !== H10(); ) { + var k10 = h10.ga(); + k10 = ji(a10(k10), H10()); + g10 = g10.Nf = k10; + h10 = h10.ta(); + } + a10 = f10; + } + else { + f10 = se4(b10, f10); + for (g10 = b10; !g10.b(); ) + h10 = g10.ga(), f10.jd(a10(h10)), g10 = g10.ta(); + a10 = f10.Rc(); + } + f10 = FO().Bf; + g10 = ii(); + b10 = b10.ia(f10, g10.u); + K7(); + pj(); + f10 = new Lf().a().ua(); + K7(); + pj(); + g10 = new Lf().a().ua(); + K7(); + pj(); + h10 = new Lf().a().ua(); + k10 = new wu().a(); + return AEa(c10, e10, a10, f10, g10, h10, b10, k10); + } + function DO(a10, b10, c10) { + a10 = Vb().Ia(a10.j); + if (a10 instanceof z7) + return a10 = a10.i, b10 = new je4().e(b10), a10 + "_" + jj(b10.td) + "_" + c10 + "_validation"; + if (y7() === a10) + throw mb(E6(), new nb().e("Cannot generate validation for dialect node without ID")); + throw new x7().d(a10); + } + function wEa(a10, b10, c10) { + var e10 = B6(b10.g, wj().ej); + a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + return uEa(f10, g10, k10, h10.Tm(g10.j)); + }; + }(a10, b10, c10)); + b10 = K7(); + return e10.bd(a10, b10.u).ua(); + } + function yEa(a10) { + var b10 = Vb().Ia(B6(a10.pb.g, Gc().Pj)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = Vb().Ia(B6(b10.g, Hc().De))); + b10 = b10.b() ? y7() : B6(b10.c().g, GO().Vs).A; + if (b10.b()) + a10 = y7(); + else { + var c10 = b10.c(); + b10 = false; + var e10 = null; + c10 = Vb().Ia(nd(a10, c10)); + a: { + if (c10 instanceof z7 && (b10 = true, e10 = c10, c10 = e10.i, null !== c10 && (c10 = c10.ya(), c10 instanceof Cd))) { + a10 = wEa(a10, c10, J5(DB(), H10())); + break a; + } + if (b10 && (b10 = e10.i, null !== b10 && (b10 = b10.ya(), b10 instanceof ze2))) { + a10 = BEa(a10, b10); + break a; + } + a10 = H10(); + } + a10 = new z7().d(a10); + } + return a10.b() ? H10() : a10.c(); + } + function BEa(a10, b10) { + var c10 = J5(DB(), H10()); + Ef(); + var e10 = Jf(new Kf(), new Lf().a()).eb; + b10 = B6(b10.g, Ae4().bh); + var f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = h10.A; + return h10.b() ? null : h10.c(); + }; + }(a10)), g10 = K7(); + b10.ka(f10, g10.u).U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + m10 = nd(h10, m10); + if (null !== m10 && (m10 = m10.ya(), m10 instanceof Cd)) + return ws(k10, wEa(h10, m10, l10.Tm(m10.j))); + }; + }(a10, e10, c10))); + return e10.ua(); + } + CO.prototype.jU = function(a10) { + this.pb = a10; + return this; + }; + CO.prototype.$classData = r8({ CIa: 0 }, false, "amf.plugins.document.vocabularies.validation.AMFDialectValidations", { CIa: 1, f: 1, Uy: 1 }); + function HO() { + this.r2 = this.Q = null; + } + HO.prototype = new u7(); + HO.prototype.constructor = HO; + HO.prototype.a = function() { + this.Q = new LN().a(); + this.r2 = J5(Gb().Qg, H10()); + return this; + }; + function CEa(a10, b10, c10) { + b10 = b10.Za.P((T6(), mh(T6(), "$ref"))); + var e10 = b10.hb().gb; + if (Q5().Na === e10) + c10 = Dd(), e10 = cc().bi, b10 = N6(b10, c10, e10), 0 <= (b10.length | 0) && "#" === b10.substring(0, 1) || (c10 = a10.r2, b10 = Mc(ua(), b10, "#"), a10.r2 = c10.Zj(zj(new Pc().fd(b10)))); + else { + a10 = dc().au; + e10 = "Unexpected $ref with " + b10; + b10 = b10.re(); + var f10 = y7(); + ec(c10, a10, "", f10, e10, b10.da); + } + } + HO.prototype.PW = function(a10) { + return ZC(hp(), a10); + }; + HO.prototype.WN = function(a10, b10) { + a10 instanceof Dc && (DEa(this, a10.Xd, b10), this.r2.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + 0 <= (e10.length | 0) && "http:" === e10.substring(0, 5) || 0 <= (e10.length | 0) && "https:" === e10.substring(0, 6) ? MN(c10.Q, e10, yM(), (T6(), mh(T6(), e10))) : MN(c10.Q, e10, dBa(), (T6(), mh(T6(), e10))); + }; + }(this)))); + return this.Q; + }; + function DEa(a10, b10, c10) { + b10 instanceof vw && b10.Za.Ja((T6(), mh(T6(), "$ref"))).na() ? (CEa(a10, b10, c10), b10 = b10.Xf.Cb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = f10.sb.Fb(w6(/* @__PURE__ */ function() { + return function(k10) { + k10 = k10.Aa; + var l10 = IO(), m10 = cc().bi; + return "$ref" === N6(k10, l10, m10).va; + }; + }(e10))).c(); + return !(null === g10 ? null === h10 : g10.h(h10)); + }; + }(a10, b10)))) : b10 = b10.Xf; + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + DEa(e10, g10, f10); + }; + }(a10, c10))); + } + HO.prototype.$classData = r8({ EIa: 0 }, false, "amf.plugins.document.webapi.JsonRefsReferenceHandler", { EIa: 1, f: 1, KY: 1 }); + function JO() { + } + JO.prototype = new u7(); + JO.prototype.constructor = JO; + JO.prototype.a = function() { + return this; + }; + JO.prototype.yoa = function(a10, b10) { + var c10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10); + cx(new dx(), "$ref", a10, Q5().Na, ld()).Qa(e10); + pr(c10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + }; + JO.prototype.$classData = r8({ zJa: 0 }, false, "amf.plugins.document.webapi.contexts.OasRefEmitter$", { zJa: 1, f: 1, WJa: 1 }); + var EEa = void 0; + function KO() { + EEa || (EEa = new JO().a()); + return EEa; + } + function LO() { + ax.call(this); + this.Yia = this.yqa = null; + } + LO.prototype = new wka(); + LO.prototype.constructor = LO; + function FEa() { + } + FEa.prototype = LO.prototype; + LO.prototype.rL = function(a10) { + return oy(this.zf.eF(), a10, B6(a10.Y(), db().ed).A, H10()); + }; + LO.prototype.Ti = function(a10, b10, c10) { + ax.prototype.Ti.call(this, a10, b10, c10); + Rb(Ut(), H10()); + GEa || (GEa = new MO().a()); + this.yqa = GEa; + this.Yia = jx(new je4().e("union")); + return this; + }; + LO.prototype.Aqa = function() { + return this.yqa; + }; + LO.prototype.$ia = function() { + return this.Yia; + }; + function NO() { + this.N = null; + } + NO.prototype = new u7(); + NO.prototype.constructor = NO; + function HEa() { + } + d7 = HEa.prototype = NO.prototype; + d7.eF = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return OO(b10, c10, e10, a10.Lj()); + }; + }(this)); + }; + d7.r$ = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new PO().IK(b10, c10, a10.Lj()); + }; + }(this)); + }; + d7.MN = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new QO().W$(b10, c10, a10.Lj()); + }; + }(this)); + }; + d7.tS = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new RO().HK(b10, c10, a10.Lj()); + }; + }(this)); + }; + d7.c0 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new SO().Zz(b10, c10, e10, a10.Lj()); + }; + }(this)); + }; + d7.H$ = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return IEa(b10, c10, e10, a10.Lj()); + }; + }(this)); + }; + d7.aA = function(a10) { + this.N = a10; + return this; + }; + function JEa(a10) { + return Vw(/* @__PURE__ */ function(b10) { + return function(c10, e10, f10) { + return KEa(c10, e10, f10, b10.Lj()); + }; + }(a10)); + } + d7.Wda = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + var c10 = new TO(); + c10.$w = a10; + c10.Ka = b10; + return c10; + }; + }(this)); + }; + function LEa() { + this.Pe = null; + } + LEa.prototype = new u7(); + LEa.prototype.constructor = LEa; + LEa.prototype.$classData = r8({ DJa: 0 }, false, "amf.plugins.document.webapi.contexts.PayloadContext$$anon$1", { DJa: 1, f: 1, PY: 1 }); + function UO() { + Xx.call(this); + this.UV = this.Fa = this.YH = null; + } + UO.prototype = new Ola(); + UO.prototype.constructor = UO; + UO.prototype.vT = function() { + ue4(); + return new ve4().d(this.YH); + }; + UO.prototype.$classData = r8({ IJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory$$anon$4", { IJa: 1, lha: 1, f: 1 }); + function VO() { + } + VO.prototype = new u7(); + VO.prototype.constructor = VO; + VO.prototype.a = function() { + return this; + }; + VO.prototype.yoa = function(a10, b10) { + a10 = iua(T6(), a10); + pr(b10.s, a10); + }; + VO.prototype.$classData = r8({ PJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlRefEmitter$", { PJa: 1, f: 1, WJa: 1 }); + var MEa = void 0; + function WO() { + MEa || (MEa = new VO().a()); + return MEa; + } + function XO() { + ax.call(this); + } + XO.prototype = new wka(); + XO.prototype.constructor = XO; + function NEa() { + } + NEa.prototype = XO.prototype; + XO.prototype.rL = function(a10) { + var b10 = new YO(); + b10.Uh = a10; + return b10; + }; + XO.prototype.hj = function() { + return this.Bc; + }; + function OEa(a10) { + var b10 = a10.Tma(); + a10.Hia(b10.b() ? a10.pqa().j : b10.c()); + } + function MO() { + } + MO.prototype = new u7(); + MO.prototype.constructor = MO; + MO.prototype.a = function() { + return this; + }; + MO.prototype.ena = function(a10) { + return Tba(a10); + }; + MO.prototype.$classData = r8({ sKa: 0 }, false, "amf.plugins.document.webapi.parser.CommonOasTypeDefMatcher$", { sKa: 1, f: 1, HKa: 1 }); + var GEa = void 0; + function ZO() { + } + ZO.prototype = new u7(); + ZO.prototype.constructor = ZO; + ZO.prototype.a = function() { + return this; + }; + ZO.prototype.ena = function(a10) { + var b10 = Ge(); + return null !== a10 && a10 === b10 ? "number" : Tba(a10); + }; + ZO.prototype.$classData = r8({ tKa: 0 }, false, "amf.plugins.document.webapi.parser.JsonSchemaTypeDefMatcher$", { tKa: 1, f: 1, HKa: 1 }); + var PEa = void 0; + function $O() { + gx.call(this); + } + $O.prototype = new hx(); + $O.prototype.constructor = $O; + $O.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 AnnotationTypeDeclaration"); + return this; + }; + $O.prototype.$classData = r8({ vKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20AnnotationTypeDeclaration$", { vKa: 1, VA: 1, f: 1 }); + var QEa = void 0; + function Ika() { + QEa || (QEa = new $O().a()); + return QEa; + } + function aP() { + gx.call(this); + } + aP.prototype = new hx(); + aP.prototype.constructor = aP; + aP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 DataType"); + return this; + }; + aP.prototype.$classData = r8({ wKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20DataType$", { wKa: 1, VA: 1, f: 1 }); + var REa = void 0; + function Eka() { + REa || (REa = new aP().a()); + return REa; + } + function bP() { + gx.call(this); + } + bP.prototype = new hx(); + bP.prototype.constructor = bP; + bP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 DocumentationItem"); + return this; + }; + bP.prototype.$classData = r8({ xKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20DocumentationItem$", { xKa: 1, VA: 1, f: 1 }); + var SEa = void 0; + function Dka() { + SEa || (SEa = new bP().a()); + return SEa; + } + function cP() { + gx.call(this); + } + cP.prototype = new hx(); + cP.prototype.constructor = cP; + cP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().F0, "2.0 Extension"); + return this; + }; + cP.prototype.$classData = r8({ yKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20Extension$", { yKa: 1, VA: 1, f: 1 }); + var TEa = void 0; + function Kka() { + TEa || (TEa = new cP().a()); + return TEa; + } + function dP() { + gx.call(this); + } + dP.prototype = new hx(); + dP.prototype.constructor = dP; + dP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().h3, "2.0"); + return this; + }; + dP.prototype.$classData = r8({ zKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20Header$", { zKa: 1, VA: 1, f: 1 }); + var UEa = void 0; + function Cka() { + UEa || (UEa = new dP().a()); + return UEa; + } + function eP() { + gx.call(this); + } + eP.prototype = new hx(); + eP.prototype.constructor = eP; + eP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 NamedExample"); + return this; + }; + eP.prototype.$classData = r8({ AKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20NamedExample$", { AKa: 1, VA: 1, f: 1 }); + var VEa = void 0; + function Fka() { + VEa || (VEa = new eP().a()); + return VEa; + } + function fP() { + gx.call(this); + } + fP.prototype = new hx(); + fP.prototype.constructor = fP; + fP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().F0, "2.0 Overlay"); + return this; + }; + fP.prototype.$classData = r8({ BKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20Overlay$", { BKa: 1, VA: 1, f: 1 }); + var WEa = void 0; + function Lka() { + WEa || (WEa = new fP().a()); + return WEa; + } + function gP() { + gx.call(this); + } + gP.prototype = new hx(); + gP.prototype.constructor = gP; + gP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 ResourceType"); + return this; + }; + gP.prototype.$classData = r8({ CKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20ResourceType$", { CKa: 1, VA: 1, f: 1 }); + var XEa = void 0; + function Gka() { + XEa || (XEa = new gP().a()); + return XEa; + } + function hP() { + gx.call(this); + } + hP.prototype = new hx(); + hP.prototype.constructor = hP; + hP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 SecurityScheme"); + return this; + }; + hP.prototype.$classData = r8({ DKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20SecurityScheme$", { DKa: 1, VA: 1, f: 1 }); + var YEa = void 0; + function Jka() { + YEa || (YEa = new hP().a()); + return YEa; + } + function iP() { + gx.call(this); + } + iP.prototype = new hx(); + iP.prototype.constructor = iP; + iP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().VD, "2.0 Trait"); + return this; + }; + iP.prototype.$classData = r8({ EKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas20Trait$", { EKa: 1, VA: 1, f: 1 }); + var ZEa = void 0; + function Hka() { + ZEa || (ZEa = new iP().a()); + return ZEa; + } + function jP() { + gx.call(this); + } + jP.prototype = new hx(); + jP.prototype.constructor = jP; + jP.prototype.a = function() { + gx.prototype.Hc.call(this, lx().Uba, "3\\.0\\.[0-9]+"); + return this; + }; + jP.prototype.$classData = r8({ FKa: 0 }, false, "amf.plugins.document.webapi.parser.OasHeader$Oas30Header$", { FKa: 1, VA: 1, f: 1 }); + var $Ea = void 0; + function mx() { + $Ea || ($Ea = new jP().a()); + return $Ea; + } + function Lx() { + Ws.call(this); + this.dca = this.Qka = this.vG = this.mB = this.pL = this.YD = this.ZL = this.qK = this.Np = this.Pp = this.Ro = this.Es = this.Cs = this.Ko = this.Fz = this.Oo = this.Sz = this.iA = this.pia = null; + } + Lx.prototype = new rha(); + Lx.prototype.constructor = Lx; + function aFa() { + } + aFa.prototype = Lx.prototype; + function bFa(a10, b10) { + var c10 = b10.yr, e10 = new Zh().a(); + Cb(c10, e10); + $h(a10, b10.yr); + } + function fB(a10, b10, c10, e10) { + var f10 = false, g10 = null; + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.Oo; + }; + }(a10)), c10); + if (a10 instanceof z7 && (f10 = true, g10 = a10, a10 = g10.i, a10 instanceof vh)) + return new z7().d(a10); + f10 && (f10 = g10.i, g10 = Ys(), null !== c10 && c10 === g10 && (e10.b() || e10.c().P("Fragment of type " + xB(la(f10)) + " does not conform to the expected type DataType"))); + return y7(); + } + function cFa(a10, b10) { + var c10 = Zs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.pL; + }; + }(a10)), c10); + b10 = new dFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + d7 = Lx.prototype; + d7.xB = function() { + return this.Qka; + }; + d7.y$ = function(a10) { + return a10 instanceof Vm ? (a10 = B6(a10.aa, kP().R).A, eFa(this, a10.b() ? null : a10.c(), Xs())) : a10 instanceof Tm ? (a10 = B6(a10.aa, kP().R).A, fFa(this, a10.b() ? null : a10.c(), Xs())) : a10 instanceof rf ? (a10 = B6(a10.Y(), qf().R).A, fB(this, a10.b() ? null : a10.c(), Xs(), y7())) : a10 instanceof Wl ? (a10 = B6(a10.g, cj().R).A, gFa(this, a10.b() ? null : a10.c(), Xs())) : a10 instanceof vm ? (a10 = B6(a10.g, Xh().R).A, lP(this, a10.b() ? null : a10.c(), Xs())) : a10 instanceof Em ? (a10 = B6(a10.g, Dm().R).A, hFa(this, a10.b() ? null : a10.c(), Xs())) : Ws.prototype.y$.call(this, a10); + }; + function eFa(a10, b10, c10) { + var e10 = y7(), f10 = false, g10 = null; + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.Ko; + }; + }(a10)), c10); + if (a10 instanceof z7 && (f10 = true, g10 = a10, a10 = g10.i, a10 instanceof Vm)) + return new z7().d(a10); + f10 && (f10 = g10.i, g10 = Ys(), null !== c10 && c10 === g10 && (e10.b() || e10.c().P("Fragment of type " + xB(la(f10)) + " does not conform to the expected type ResourceType"))); + return y7(); + } + function iFa(a10, b10) { + var c10 = Zs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.YD; + }; + }(a10)), c10); + b10 = new jFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function kFa(a10, b10, c10, e10) { + var f10 = false, g10 = null; + a10 = a10.dp(b10, Rb(Gb().ab, H10()), c10); + if (a10 instanceof z7 && (f10 = true, g10 = a10, a10 = g10.i, a10 instanceof cn)) + return new z7().d(a10); + f10 && (f10 = g10.i, g10 = Ys(), null !== c10 && c10 === g10 && (e10.b() || e10.c().P("Fragment of type " + xB(la(f10)) + " does not conform to the expected type DocumentationItem"))); + return y7(); + } + d7.et = function() { + var a10 = Ws.prototype.et.call(this).ua(), b10 = new Fc().Vd(this.Oo), c10 = new Fc().Vd(this.Ko), e10 = Xd().u; + b10 = xq(b10, c10, e10); + c10 = new Fc().Vd(this.Ro); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.Cs); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.Es); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.Pp); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.Np); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.qK); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.ZL); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.pL); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + e10 = new Fc().Vd(this.mB); + Xd(); + Id(); + c10 = new Lf().a(); + for (e10 = e10.Sb.Ye(); e10.Ya(); ) { + var f10 = e10.$a().Hd(); + ws(c10, f10); + } + c10 = c10.ua(); + e10 = Xd(); + b10 = b10.ia(c10, e10.u); + c10 = new Fc().Vd(this.YD); + e10 = Xd(); + b10 = b10.ia(c10, e10.u).ua(); + c10 = ii(); + return a10.ia(b10, c10.u); + }; + function fFa(a10, b10, c10) { + var e10 = y7(), f10 = false, g10 = null; + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.Ro; + }; + }(a10)), c10); + if (a10 instanceof z7 && (f10 = true, g10 = a10, a10 = g10.i, a10 instanceof Tm)) + return new z7().d(a10); + f10 && (f10 = g10.i, g10 = Ys(), null !== c10 && c10 === g10 && (e10.b() || e10.c().P("Fragment of type " + xB(la(f10)) + " does not conform to the expected type Trait"))); + return y7(); + } + function lFa(a10, b10) { + var c10 = a10.xi.Ja(b10); + if (c10 instanceof z7 && (c10 = c10.i, c10 instanceof Lx)) + return c10; + c10 = new z7().d(b10); + var e10 = a10.wG(), f10 = new Mq().a(), g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()), l10 = Rb(Gb().ab, H10()), m10 = Rb(Gb().ab, H10()), p10 = Rb(Gb().ab, H10()), t10 = Rb(Gb().ab, H10()), v10 = Rb(Gb().ab, H10()), A10 = Rb(Gb().ab, H10()), D10 = Rb(Gb().ab, H10()), C10 = Rb(Gb().ab, H10()), I10 = Rb(Gb().ab, H10()), L10 = Rb(Gb().ab, H10()), Y10 = Rb(Gb().ab, H10()), ia = Rb(Gb().ab, H10()), pa = Rb(Gb().ab, H10()); + c10 = new Lx().BU(c10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia, e10, f10, pa); + a10.xi = a10.xi.cc(new R6().M(b10, c10)); + return c10; + } + function hFa(a10, b10, c10) { + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.Np; + }; + }(a10)), c10); + b10 = new mFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function kna(a10, b10, c10, e10) { + e10 = fFa(a10, c10, e10); + if (e10 instanceof z7) + return e10.i; + uha(a10, "Trait " + c10 + " not found", b10); + return new mP().Tq(c10, b10); + } + function $h(a10, b10) { + var c10 = false, e10 = null; + a: + if (b10 instanceof Vm) + e10 = a10.Ko, c10 = B6(b10.aa, kP().R).A, c10 = c10.b() ? null : c10.c(), a10.Ko = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof Tm) + e10 = a10.Ro, c10 = B6(b10.aa, kP().R).A, c10 = c10.b() ? null : c10.c(), a10.Ro = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof rf) { + e10 = a10.xB(); + c10 = B6(b10.Y(), qf().R).A; + c10 = c10.b() ? null : c10.c(); + var f10 = a10.bG(); + if (f10 instanceof z7) + c10 = f10.i + "." + c10; + else if (y7() !== f10) + throw new x7().d(f10); + Eb(e10, c10, b10); + e10 = a10.Oo; + c10 = B6(b10.Y(), qf().R).A; + c10 = c10.b() ? null : c10.c(); + a10.Oo = e10.cc(new R6().M(c10, b10)); + } else { + if (b10 instanceof Wl && (c10 = true, e10 = b10, wh(e10.x, q5(nFa)))) { + b10 = a10.YD; + c10 = B6(e10.g, cj().R).A; + c10 = c10.b() ? null : c10.c(); + a10.YD = b10.cc(new R6().M(c10, e10)); + break a; + } + if (c10) + b10 = a10.Cs, c10 = B6(e10.g, cj().R).A, c10 = c10.b() ? null : c10.c(), a10.Cs = b10.cc(new R6().M(c10, e10)); + else if (b10 instanceof ym) + e10 = a10.Es, c10 = B6(b10.g, xm().R).A, c10 = c10.b() ? null : c10.c(), a10.Es = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof vm) + e10 = a10.Pp, c10 = B6(b10.g, Xh().R).A, c10 = c10.b() ? null : c10.c(), a10.Pp = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof Em) + e10 = a10.Np, c10 = B6(b10.g, Dm().R).A, c10 = c10.b() ? null : c10.c(), a10.Np = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof en) + e10 = a10.qK, c10 = B6(b10.g, ag().R).A, c10 = c10.b() ? null : c10.c(), a10.qK = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof Bm) + e10 = a10.ZL, c10 = B6(b10.g, zD().R).A, c10 = c10.b() ? null : c10.c(), a10.ZL = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof Bn) + e10 = a10.pL, c10 = B6(b10.g, An().R).A, c10 = c10.b() ? null : c10.c(), a10.pL = e10.cc(new R6().M(c10, b10)); + else if (b10 instanceof bm) + if (e10 = B6(b10.g, am().R).A, e10 = e10.b() ? null : e10.c(), c10 = a10.mB.Ja(e10), c10 instanceof z7) + a10.mB = a10.mB.cc(new R6().M(e10, ji(b10, c10.i))); + else { + if (y7() !== c10) + throw new x7().d(c10); + c10 = a10.mB; + ii(); + b10 = [b10]; + f10 = -1 + (b10.length | 0) | 0; + for (var g10 = H10(); 0 <= f10; ) + g10 = ji(b10[f10], g10), f10 = -1 + f10 | 0; + a10.mB = c10.cc(new R6().M(e10, g10)); + } + else + Ws.prototype.X4.call( + a10, + b10 + ); + } + return a10; + } + function oFa(a10, b10) { + var c10 = Zs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.ZL; + }; + }(a10)), c10); + b10 = new pFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function qFa(a10, b10, c10) { + var e10 = Xs(); + e10 = hFa(a10, c10, e10); + if (e10 instanceof z7) + return e10.i; + uha(a10, "Response '" + c10 + "' not found", b10); + return new nP().Tq(c10, b10); + } + function gFa(a10, b10, c10) { + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.Cs; + }; + }(a10)), c10); + b10 = new rFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function sFa(a10, b10, c10) { + var e10 = false; + a10 = a10.ij.Ja(b10); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.ww)); + if (a10 instanceof z7 && (e10 = true, a10 = a10.i, a10 instanceof en)) + return new z7().d(a10); + e10 && (c10.b() || c10.c().P("Fragment defined in " + b10 + " does not conform to the expected type NamedExample")); + return y7(); + } + function tFa(a10, b10, c10, e10) { + e10 = eFa(a10, c10, e10); + if (e10 instanceof z7) + return e10.i; + uha(a10, "ResourceType " + c10 + " not found", b10); + return new oP().Tq(c10, b10); + } + d7.wG = function() { + return this.vG; + }; + function lP(a10, b10, c10) { + var e10 = y7(), f10 = false, g10 = null; + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.Pp; + }; + }(a10)), c10); + if (a10 instanceof z7 && (f10 = true, g10 = a10, a10 = g10.i, a10 instanceof vm)) + return new z7().d(a10); + f10 && (f10 = g10.i, g10 = Ys(), null !== c10 && c10 === g10 && (e10.b() || e10.c().P("Fragment of type " + xB(la(f10)) + " does not conform to the expected type SecurityScheme"))); + return y7(); + } + d7.BU = function(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10) { + this.pia = a10; + this.iA = b10; + this.Sz = c10; + this.Oo = e10; + this.Fz = f10; + this.Ko = g10; + this.Cs = h10; + this.Es = k10; + this.Ro = l10; + this.Pp = m10; + this.Np = p10; + this.qK = t10; + this.ZL = v10; + this.YD = A10; + this.pL = D10; + this.mB = C10; + this.vG = I10; + this.Qka = L10; + this.dca = Y10; + Ws.prototype.hma.call(this, b10, c10, f10, I10, L10); + return this; + }; + function uFa(a10, b10, c10) { + var e10 = sFa(a10, c10, y7()); + if (e10 instanceof z7) + return e10.i; + uha(a10, "NamedExample '" + c10 + "' not found", b10); + return new pP().Tq(c10, b10); + } + function vFa(a10, b10) { + var c10 = Xs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.qK; + }; + }(a10)), c10); + b10 = new wFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + d7.bG = function() { + return this.pia; + }; + function xFa(a10, b10) { + var c10 = Xs(); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.Es; + }; + }(a10)), c10); + b10 = new yFa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + d7.fna = function(a10, b10) { + this.iA.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.iA = e10.iA.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.iA.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.iA = e10.iA.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Sz.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Sz = e10.Sz.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Sz.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Sz = e10.Sz.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.xi.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.xi = e10.xi.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.xi.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.xi = e10.xi.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.ij.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.ij = e10.ij.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.ij.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.ij = e10.ij.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Oo.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Oo = e10.Oo.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Oo.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Oo = e10.Oo.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Fz.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Fz = e10.Fz.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Fz.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Fz = e10.Fz.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.x.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.x = e10.x.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.x.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.x = e10.x.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Ko.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Ko = e10.Ko.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Ko.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Ko = e10.Ko.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Cs.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Cs = e10.Cs.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Cs.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Cs = e10.Cs.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Es.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Es = e10.Es.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Es.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Es = e10.Es.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Ro.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Ro = e10.Ro.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Ro.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Ro = e10.Ro.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Pp.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Pp = e10.Pp.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Pp.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Pp = e10.Pp.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + this.Np.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Np = e10.Np.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + a10.Np.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + e10.Np = e10.Np.cc(new R6().M(g10, f10)); + } else + throw new x7().d(f10); + }; + }(this, b10))); + }; + d7.$classData = r8({ QY: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations", { QY: 1, hN: 1, f: 1 }); + function Jla() { + this.iQ = this.lP = this.x = this.Cj = this.Th = this.Lc = this.Yk = null; + this.Wba = this.c9 = this.yw = this.dea = false; + this.l = null; + } + Jla.prototype = new u7(); + Jla.prototype.constructor = Jla; + function zFa(a10) { + a10.iQ = new z7().d(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.nV(); + }; + }(a10))); + return a10; + } + d7 = Jla.prototype; + d7.P = function(a10) { + qP(this, a10); + }; + function AFa(a10, b10, c10) { + if (a10.c9) { + b10 = zla(Cla(), b10, a10.Th); + var e10 = a10.Yk; + if (e10 instanceof Vx) { + var f10 = a10.Cj; + e10 = BFa(a10, e10.oa.j + "/" + a10.Lc.r.$, b10); + var g10 = CFa(), h10 = K7(); + f10.IM(e10.ka(g10, h10.u)); + } else if (a10.l.rk() === e10) + f10 = a10.Cj, e10 = BFa(a10, null, b10), g10 = CFa(), h10 = K7(), f10.IM(e10.ka(g10, h10.u)); + else + throw new x7().d(e10); + } else + b10 = new Qg().Vb(b10, a10.Th); + return a10.iQ.na() ? a10.iQ.c().P(b10) : Ac().h(c10) ? b10.mE() : zc().h(c10) ? b10.Up() : hi().h(c10) ? b10.g5() : b10.Zf(); + } + function rP(a10, b10) { + a10.x.Lb(b10); + return a10; + } + d7.ro = function(a10) { + return (qP(this, a10), NaN) | 0; + }; + d7.t = function() { + return ""; + }; + function nh(a10) { + a10.c9 = true; + return a10; + } + d7.Ep = function(a10) { + return !(qP(this, a10), true); + }; + function DFa(a10) { + a10.yw = true; + return a10; + } + function sP(a10) { + a10.dea = true; + return a10; + } + function BFa(a10, b10, c10) { + if (c10 instanceof tP) + return EFa(FFa(), b10, c10.Vw, H10(), a10.Th); + if (c10 instanceof Qg) + return H10(); + throw new x7().d(c10); + } + function Gy(a10, b10) { + a10.lP = new z7().d(b10); + return a10; + } + function GFa(a10, b10, c10) { + a10.dea ? b10 = Gla().P_(b10, a10.Th) : a10.yw ? (xla || (xla = new Mx().a()), b10 = xla.P_(b10, a10.Th)) : b10 = new Tx().Vb(b10, a10.Th); + return Dr(c10) && a10.lP.na() ? b10.Sba(a10.lP.c()) : a10.iQ.na() ? a10.iQ.c().P(b10) : Ac().h(c10) ? b10.Qaa() : zc().h(c10) ? b10.e5() : b10.n3(); + } + function qP(a10, b10) { + var c10 = b10.i, e10 = b10.i.hb().gb; + Q5().nd === e10 && a10.Wba || (e10 = a10.Lc.ba, Dr(e10) && a10.lP.na() ? c10 = a10.lP.c().P(c10) : e10 instanceof ht2 ? (e10 = new z7().d(e10.Fe).i, c10 = GFa(a10, c10, e10)) : c10 = AFa(a10, c10, e10), c10.fa().Sp(a10.Cj), a10.Yk.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = f10.Lc, m10 = Od(O7(), h10).Sp(f10.x); + Rg(k10, l10, g10, m10); + }; + }(a10, c10, b10)))); + } + function HFa(a10) { + a10.Wba = true; + return a10; + } + d7.$classData = r8({ TLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.SpecParserOps$ObjectField", { TLa: 1, f: 1, za: 1 }); + function uP() { + this.gF = null; + } + uP.prototype = new Qla(); + uP.prototype.constructor = uP; + uP.prototype.a = function() { + IFa = this; + this.gF = yx(); + return this; + }; + uP.prototype.$classData = r8({ bMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AnyDefaultType$", { bMa: 1, jMa: 1, f: 1 }); + var IFa = void 0; + function vP() { + IFa || (IFa = new uP().a()); + return IFa; + } + function wP() { + this.$ = null; + } + wP.prototype = new Tla(); + wP.prototype.constructor = wP; + wP.prototype.a = function() { + cy.prototype.e.call(this, "draft-3"); + return this; + }; + wP.prototype.$classData = r8({ tMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.JSONSchemaDraft3SchemaVersion$", { tMa: 1, RY: 1, f: 1 }); + var JFa = void 0; + function KFa() { + JFa || (JFa = new wP().a()); + return JFa; + } + function xP() { + this.$ = null; + } + xP.prototype = new Tla(); + xP.prototype.constructor = xP; + xP.prototype.a = function() { + cy.prototype.e.call(this, "draft-4"); + return this; + }; + xP.prototype.$classData = r8({ uMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.JSONSchemaDraft4SchemaVersion$", { uMa: 1, RY: 1, f: 1 }); + var LFa = void 0; + function MFa() { + LFa || (LFa = new xP().a()); + return LFa; + } + function yP() { + this.$ = null; + } + yP.prototype = new Tla(); + yP.prototype.constructor = yP; + yP.prototype.a = function() { + cy.prototype.e.call(this, ""); + return this; + }; + yP.prototype.$classData = r8({ vMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.JSONSchemaUnspecifiedVersion$", { vMa: 1, RY: 1, f: 1 }); + var NFa = void 0; + function zP() { + this.Nca = this.$ = null; + } + zP.prototype = new Tla(); + zP.prototype.constructor = zP; + function OFa() { + } + OFa.prototype = zP.prototype; + zP.prototype.fma = function(a10, b10, c10) { + this.Nca = b10; + cy.prototype.e.call(this, a10); + if ("schema" !== b10 && "parameter" !== b10) { + a10 = dc().Fh; + b10 = "Invalid schema position '" + b10 + "', only 'schema' and 'parameter' are valid"; + var e10 = y7(), f10 = y7(), g10 = y7(); + c10.Gc(a10.j, "", e10, b10, f10, Yb().qb, g10); + } + }; + function AP() { + hy.call(this); + this.Gb = this.Ka = this.gg = null; + this.A1 = false; + this.sd = null; + } + AP.prototype = new bma(); + AP.prototype.constructor = AP; + function BP() { + } + BP.prototype = AP.prototype; + AP.prototype.Pa = function() { + var a10 = J5(Ef(), H10()); + if (this.sd.Xba().qS) { + var b10 = hd(this.gg.Y(), Ag().Ec); + if (!b10.b()) { + var c10 = b10.c(); + b10 = this.sd; + c10 = c10.r.r.wb; + var e10 = new PFa(), f10 = K7(); + b10 = hca(b10, c10.ec(e10, f10.u)).Dm(w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = Bg(g10.g), k10 = ag().R; + return Cg(h10, k10) ? false : !Za(g10).na(); + }; + }(this))); + a: { + if (null !== b10 && (c10 = b10.ma(), e10 = b10.ya(), H10().h(c10) && H10().h(e10))) { + b10 = H10(); + break a; + } + if (null !== b10 && (c10 = b10.ma(), e10 = b10.ya(), H10().h(e10))) { + b10 = QFa(this, c10.kc(), c10.ta(), this.A1); + break a; + } + if (null !== b10 && (c10 = b10.ma(), e10 = b10.ya(), H10().h(c10))) { + b10 = QFa(this, y7(), e10, this.A1); + break a; + } + if (null !== b10) + e10 = b10.ma(), b10 = b10.ya(), c10 = e10.kc(), e10 = e10.ta(), f10 = K7(), b10 = QFa(this, c10, e10.ia(b10, f10.u), this.A1); + else + throw new x7().d(b10); + } + new z7().d(ws(a10, b10)); + } + } + b10 = hy.prototype.Pa.call(this); + c10 = K7(); + return b10.ia(a10, c10.u); + }; + AP.prototype.VK = function(a10, b10, c10, e10, f10, g10, h10) { + this.gg = a10; + this.Ka = b10; + this.Gb = c10; + this.A1 = g10; + this.sd = h10; + hy.prototype.bE.call(this, a10, b10, c10, e10, f10, h10); + return this; + }; + function QFa(a10, b10, c10, e10) { + var f10 = J5(Ef(), H10()); + e10 = e10 ? "x-amf-example" : "example"; + b10.b() || (b10 = b10.c(), Dg(f10, jca(e10, b10, a10.Ka, a10.sd))); + c10.Da() && Dg(f10, new Eg().jE(jx(new je4().e("examples")), c10, a10.Ka, a10.Gb, a10.sd)); + return f10; + } + AP.prototype.$classData = r8({ hJ: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAnyShapeEmitter", { hJ: 1, iN: 1, f: 1 }); + function CP() { + Dy.call(this); + this.wV = null; + } + CP.prototype = new gma(); + CP.prototype.constructor = CP; + function DP() { + } + DP.prototype = CP.prototype; + function RFa(a10) { + var b10 = eca(new tg(), a10.Za, jx(new je4().e("examples")), y7(), w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.wa.qF(f10); + }; + }(a10)), a10.zV(), a10.l.ra).Vg(); + if (b10.Da()) { + a10 = a10.wa; + var c10 = Ag().Ec; + Zd(a10, c10, b10); + } + } + CP.prototype.Xi = function() { + Dy.prototype.IV.call(this); + RFa(this); + var a10 = ac(new M6().W(this.Za), "type"); + if (!a10.b()) { + a10.c(); + a10 = this.wa; + var b10 = new xi().a(); + Cb(a10, b10); + } + return this.wa; + }; + CP.prototype.zV = function() { + return this.wV; + }; + CP.prototype.Ux = function(a10) { + Dy.prototype.m7a.call(this, a10, a10.ra); + this.wV = new EP().GB(true, false, false); + return this; + }; + function FP(a10) { + var b10 = SFa(a10), c10 = b10.AT; + return c10 instanceof z7 ? c10.i : a10.Zna(b10); + } + function TFa(a10) { + return a10 instanceof uG ? new z7().d(a10.DV.t()) : y7(); + } + function SFa(a10) { + var b10 = a10.i.hb().gb; + if (Q5().sa === b10) { + b10 = a10.i; + var c10 = qc(); + b10 = N6(b10, c10, a10.Gp()); + b10 = GP.prototype.Eba.call(a10, b10); + if (b10 instanceof z7 && (b10 = b10.i, null !== b10 && jc(kc(b10.i), bc()).na())) { + c10 = b10.i; + var e10 = bc(); + c10 = N6(c10, e10, a10.Gp()).va; + return UFa(new HP(), a10, c10, b10.i, TFa(b10.i), (a10.s8(), y7())); + } + return VFa(a10); + } + if (Q5().cd === b10) + return VFa(a10); + b10 = a10.i; + c10 = bc(); + b10 = N6(b10, c10, a10.Gp()).va; + return UFa(new HP(), a10, b10, a10.i, TFa(a10.i), (a10.s8(), y7())); + } + function VFa(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Gh().K(new S6().a(), b10); + a10.Wf.P(b10); + var c10 = a10.Gp(), e10 = sg().i6, f10 = b10.j, g10 = "Cannot parse " + a10.G0 + " Schema expression out of a non string value", h10 = a10.i, k10 = y7(); + ec(c10, e10, f10, k10, g10, h10.da); + return UFa(new HP(), a10, "", a10.i, y7(), new z7().d(b10)); + } + function IP() { + this.WJ = this.XJ = null; + this.xa = false; + this.l = null; + } + IP.prototype = new u7(); + IP.prototype.constructor = IP; + function WFa() { + } + WFa.prototype = IP.prototype; + IP.prototype.J9 = function() { + if (!this.xa) { + var a10 = new z7().d(this.wa.j); + this.XJ = w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return hma(ima(), c10, b10.WJ, e10, b10.l.Nb()); + }; + }(this, a10)); + this.xa = true; + } + return this.XJ; + }; + IP.prototype.fT = function() { + return this.xa ? this.XJ : this.J9(); + }; + function XFa(a10) { + var b10 = a10.l.uM(a10.Za); + b10.b() || (b10 = b10.c(), YFa(new JP(), a10.l, b10, a10.wa, new z7().d(a10.Za), a10.l.Nb()).hd()); + } + IP.prototype.IV = function() { + XFa(this); + var a10 = new M6().W(this.Za), b10 = this.l, c10 = qf().Zc; + Gg(a10, "displayName", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = qf().Va; + Gg(a10, "description", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = ac(new M6().W(this.Za), "default"); + if (!a10.b() && (a10 = a10.c(), b10 = a10.i.hb().gb, Q5().nd !== b10 && (b10 = Ey(Fy(a10.i, this.wa.j + "/default", false, false, false, this.l.Nb())), Mca(this.wa, a10), b10 = b10.Cl, !b10.b()))) { + b10 = b10.c(); + c10 = this.wa; + var e10 = qf().Mh; + a10 = Od(O7(), a10); + Rg(c10, e10, b10, a10); + } + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = qf().ch; + Gg( + a10, + "enum", + Gy(Hg(Ig(b10, c10, this.l.Nb()), this.wa), this.fT()) + ); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().Bq; + Gg(a10, "minItems", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().pr; + Gg(a10, "maxItems", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = fh(new je4().e("externalDocs")); + c10 = this.l; + e10 = Ag().Sf; + Gg(a10, b10, Gy(Hg(Ig(c10, e10, this.l.Nb()), this.wa), w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return jma(kma(), g10, f10.wa.j, f10.l.Nb()); + }; + }(this)))); + a10 = ac(new M6().W(this.Za), "xml"); + a10.b() || (a10 = a10.c(), b10 = B6(this.wa.Y(), qf().R).A, b10 = mma(nma(b10.b() ? null : b10.c(), a10.i, this.l.Nb())), c10 = this.wa, e10 = Ag().Ln, a10 = Od(O7(), a10), Rg(c10, e10, b10, a10)); + ac(new M6().W(this.Za), fh(new je4().e("or"))).na() && new KP().TK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), fh(new je4().e("and"))).na() && new LP().TK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), fh(new je4().e("xone"))).na() && new MP().TK(this.l, this.Za, this.wa).hd(); + ac(new M6().W(this.Za), fh(new je4().e("not"))).na() && new NP().TK(this.l, this.Za, this.wa).hd(); + a10 = ac(new M6().W(this.Za), "facets"); + a10.b() || (a10 = a10.c(), b10 = this.l, c10 = a10.i, e10 = qc(), ZFa(new OP(), b10, N6(c10, e10, this.l.Nb()), w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = pma(f10.wa, h10); + if (0 <= (h10.length | 0) && "(" === h10.substring(0, 1)) { + var l10 = f10.l.Nb(), m10 = sg().Oy, p10 = k10.j; + h10 = "User defined facet name '" + h10 + "' must not begin with open parenthesis"; + var t10 = y7(); + ec(l10, m10, p10, t10, h10, g10.da); + } + return k10; + }; + }(this, a10))).Vg()); + a10 = ac(new M6().W(this.Za), "type"); + a10.b() || (b10 = a10.c(), a10 = this.wa.fa(), ae4(), b10 = b10.Aa.da, a10.Lb(new Jy().jj(ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg))))); + return this.wa; + }; + IP.prototype.EB = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.WJ = new Nd().a(); + }; + function PP() { + this.gF = null; + } + PP.prototype = new Qla(); + PP.prototype.constructor = PP; + PP.prototype.a = function() { + $Fa = this; + this.gF = Ee4(); + return this; + }; + PP.prototype.$classData = r8({ FQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.StringDefaultType$", { FQa: 1, jMa: 1, f: 1 }); + var $Fa = void 0; + function QP() { + $Fa || ($Fa = new PP().a()); + return $Fa; + } + function RP() { + this.kd = this.m = this.Ca = null; + } + RP.prototype = new u7(); + RP.prototype.constructor = RP; + RP.prototype.pv = function(a10, b10) { + this.Ca = a10; + this.m = b10; + return this; + }; + RP.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function aGa(a10) { + bGa || (bGa = new TP().a()); + var b10 = a10.Ca; + b10 = Rs(O7(), b10); + b10 = new Nl().K(new S6().a(), b10); + var c10 = a10.Ca, e10 = qc(); + c10 = N6(c10, e10, a10.m); + e10 = new M6().W(c10); + var f10 = Ml().Pf; + Gg(e10, "url", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = Ml().R; + Gg(e10, "name", Hg(Ig(a10, f10, a10.m), b10)); + Ry(new Sy(), b10, c10, H10(), a10.m).hd(); + Zz(a10.m, b10.j, c10, "license"); + return b10; + } + function SP(a10) { + null === a10.kd && (a10.kd = new UP()); + } + RP.prototype.$classData = r8({ RQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.LicenseParser", { RQa: 1, f: 1, sg: 1 }); + function VP() { + Fz.call(this); + this.sd = null; + } + VP.prototype = new Uma(); + VP.prototype.constructor = VP; + function cGa() { + } + cGa.prototype = VP.prototype; + VP.prototype.EO = function(a10, b10, c10, e10, f10) { + this.sd = f10; + Fz.prototype.EO.call(this, a10, b10, c10, e10, f10); + }; + VP.prototype.SN = function(a10, b10, c10) { + this.sd.zf instanceof pA && Fz.prototype.SN.call(this, a10, b10, c10); + }; + function WP() { + this.kd = this.m = this.Lc = this.oa = this.X = null; + } + WP.prototype = new u7(); + WP.prototype.constructor = WP; + function dGa() { + } + dGa.prototype = WP.prototype; + WP.prototype.rk = function() { + null === this.kd && eGa(this); + return this.kd; + }; + function eGa(a10) { + null === a10.kd && (a10.kd = new UP()); + } + WP.prototype.ZG = function(a10, b10, c10, e10) { + this.X = a10; + this.oa = b10; + this.Lc = c10; + this.m = e10; + return this; + }; + function fGa(a10, b10) { + b10 = ac(new M6().W(a10.X), b10); + if (!b10.b()) { + b10 = b10.c(); + var c10 = b10.i, e10 = qc(), f10 = rw().sc; + c10 = N6(c10, sw(f10, e10), a10.Mb()); + e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return gGa(hGa(g10.oa.j, h10, g10.Mb())); + }; + }(a10)); + f10 = K7(); + e10 = c10.ka(e10, f10.u); + c10 = a10.oa; + a10 = a10.Lc; + e10 = Zr(new $r(), e10, Od(O7(), b10)); + b10 = Od(O7(), b10); + Rg(c10, a10, e10, b10); + } + } + function XP() { + this.kd = this.m = this.Ca = null; + } + XP.prototype = new u7(); + XP.prototype.constructor = XP; + XP.prototype.pv = function(a10, b10) { + this.Ca = a10; + this.m = b10; + return this; + }; + XP.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function iGa(a10) { + jGa || (jGa = new YP().a()); + var b10 = a10.Ca; + b10 = Rs(O7(), b10); + b10 = new Ul().K(new S6().a(), b10); + var c10 = a10.Ca, e10 = qc(); + c10 = N6(c10, e10, a10.m); + e10 = new M6().W(c10); + var f10 = Tl().Pf; + Gg(e10, "url", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = Tl().R; + Gg(e10, "name", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = Tl().WI; + Gg(e10, "email", Hg(Ig(a10, f10, a10.m), b10)); + Ry(new Sy(), b10, c10, H10(), a10.m).hd(); + Zz(a10.m, b10.j, c10, "contact"); + return b10; + } + XP.prototype.$classData = r8({ dSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OrganizationParser", { dSa: 1, f: 1, sg: 1 }); + function ZP() { + this.Lq = this.Wd = this.xb = this.tb = null; + this.uca = false; + this.kd = this.m = null; + } + ZP.prototype = new u7(); + ZP.prototype.constructor = ZP; + function kGa() { + } + kGa.prototype = ZP.prototype; + function lGa(a10) { + var b10 = a10.Wd; + b10.b() ? b10 = y7() : (b10 = B6(b10.c().g, Jl().Uf).A, b10 = new z7().d(b10.b() ? null : b10.c())); + b10 = b10.b() ? "" : b10.c(); + var c10 = a10.tb.Aa, e10 = bc(); + return "" + b10 + N6(c10, e10, a10.m).va; + } + ZP.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + ZP.prototype.OO = function(a10, b10, c10, e10, f10, g10) { + this.tb = a10; + this.xb = b10; + this.Wd = c10; + this.Lq = e10; + this.uca = f10; + this.m = g10; + return this; + }; + function mGa(a10, b10, c10, e10, f10) { + var g10 = a10.Wd; + g10.b() ? g10 = y7() : (g10 = g10.c(), g10 = new z7().d(B6(g10.g, Jl().Wm).Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + l10 = B6(l10.g, cj().We).A; + return "path" === (l10.b() ? null : l10.c()); + }; + }(a10))).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function() { + return function(l10, m10) { + var p10 = B6(m10.g, cj().R).A; + return l10.Wh(p10.b() ? null : p10.c(), m10); + }; + }(a10))))); + var h10 = g10.b() ? Rb(Gb().ab, H10()) : g10.c(); + g10 = Dja(Yv(), lGa(a10)); + e10 = g10.Cb(e10); + h10 = w6(/* @__PURE__ */ function(l10, m10, p10, t10) { + return function(v10) { + var A10 = m10.Ja(v10); + if (A10 instanceof z7) + v10 = nGa(A10.i, p10.j), v10.x.Lb(new Xz().a()); + else { + if (y7() !== A10) + throw new x7().d(A10); + A10 = t10.Fb(w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + var ia = B6(Y10.g, cj().R).A; + return (ia.b() ? null : ia.c()) === L10 ? (Y10 = B6(Y10.g, cj().We).A, "path" === (Y10.b() ? null : Y10.c())) : false; + }; + }(l10, v10))); + if (A10 instanceof z7) + v10 = A10.i; + else { + if (y7() !== A10) + throw new x7().d(A10); + A10 = oGa(p10, v10); + var D10 = cj().We; + A10 = eb(A10, D10, "path"); + D10 = cj().yj; + A10 = Bi(A10, D10, true); + v10 = A10.dX(v10); + D10 = Uh().zj; + var C10 = Fg().af; + eb(v10, C10, D10); + A10.x.Lb(new Xz().a()); + v10 = A10; + } + } + return v10; + }; + }(a10, h10, b10, f10)); + var k10 = K7(); + e10 = e10.ka(h10, k10.u); + c10 || pGa(a10, b10, g10, f10); + a10 = f10.Cb(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return !m10.Ha(p10); + }; + }(a10, e10))); + b10 = K7(); + return e10.ia(a10, b10.u); + } + function qGa(a10, b10, c10) { + var e10 = Vb().Ia(B6(b10.Y(), qf().Mh)); + e10.b() || (e10 = e10.c(), rGa(a10, e10, c10)); + B6(b10.Y(), qf().ch).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + rGa(f10, h10, g10); + }; + }(a10, c10))); + b10 instanceof Mh && B6(b10.aa, Ag().Ec).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10 = Vb().Ia(B6(h10.g, ag().mo)); + h10.b() || (h10 = h10.c(), rGa(f10, h10, g10)); + }; + }(a10, c10))); + } + function sGa(a10, b10, c10) { + var e10 = a10.m.iv, f10 = iA().W7; + e10 = null === e10 ? null === f10 : e10.h(f10); + Zz(a10.m, b10.j, c10, e10 ? "resourceType" : "endPoint"); + f10 = new M6().W(c10); + var g10 = Jl().R; + Gg(f10, "displayName", nh(Hg(Ig(a10, g10, a10.m), b10))); + f10 = new M6().W(c10); + g10 = Jl().Va; + Gg(f10, "description", nh(Hg(Ig(a10, g10, a10.m), b10))); + f10 = new M6().W(c10); + g10 = Jl().Ni(); + g10 = Hg(Ig(a10, g10, a10.m), b10); + Gg(f10, "is", HFa(sP(Gy(g10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return tGa(uGa(), A10, D10, v10.m); + }; + }(a10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return kda(A10, D10); + }; + }(a10, b10)))))))); + f10 = ac(new M6().W(c10), "type"); + f10.b() || (f10 = f10.c(), ina(jna( + new Uz(), + f10.i, + w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return jda(A10, D10); + }; + }(a10, b10)), + Uc(/* @__PURE__ */ function(v10, A10) { + return function(D10, C10) { + return tFa(v10.m.pe(), A10.i, D10, C10); + }; + }(a10, f10)), + a10.m + ))); + g10 = wt(new M6().W(c10), "(get|patch|put|post|delete|options|head|connect|trace)" + (a10.uca ? "\\??" : "")); + g10.Da() && (f10 = J5(Ef(), H10()), g10.U(w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + if (v10.m instanceof uB) { + var I10 = v10.m.qh, L10 = v10.m.Df; + K7(); + pj(); + var Y10 = new Lf().a(); + I10 = new uB().il(I10, L10, new Aq().zo("", Y10.ua(), new Mq().a(), Nq(), y7()), new z7().d(v10.m.pe()), new z7().d(v10.m.lj), new z7().d(v10.m), v10.m.iv); + } else + I10 = v10.m.qh, L10 = v10.m.Df, K7(), pj(), Y10 = new Lf().a(), I10 = new hA().il(I10, L10, new Aq().zo("", Y10.ua(), new Mq().a(), Nq(), y7()), new z7().d(v10.m.pe()), new z7().d(v10.m.lj), new z7().d(v10.m), v10.m.iv); + L10 = new $P().jn(C10, w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + return vGa(pa, La); + }; + }(v10, A10)), v10.uca, I10).g2(); + Dg(D10, L10); + C10 = v10.m.FE; + L10 = new qg().e(L10.j); + return C10.Ue(aQ(L10, "%3F"), I10); + }; + }(a10, b10, f10))), g10 = Jl().bk, f10 = Zr(new $r(), f10, new P6().a()), Vd(b10, g10, f10)); + f10 = new Nd().a(); + f10 = w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + wGa(); + return xGa(yGa(C10, A10, D10, v10.m)); + }; + }(a10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return A10.mI(D10); + }; + }( + a10, + b10 + )), f10)); + g10 = new M6().W(c10); + var h10 = Jl().dc; + Gg(g10, "securedBy", sP(Gy(Hg(Ig(a10, h10, a10.m), b10), f10))); + g10 = null; + g10 = bQ(new cQ(), H10(), H10(), H10(), H10(), H10(), H10()); + O7(); + f10 = null; + f10 = new P6().a(); + h10 = wt(new M6().W(c10), a10.Gqa()); + h10 = Jc(h10, new zGa()); + if (y7() === h10) + h10 = mGa(a10, b10, e10, AGa(a10), H10()); + else { + if (!(h10 instanceof z7)) + throw new x7().d(h10); + h10 = h10.i; + f10 = Od(O7(), h10.i); + h10 = h10.i; + var k10 = qc(); + h10 = N6(h10, k10, a10.m).sb; + k10 = w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + var C10 = oy(v10.m.$h.a2(), D10, w6(/* @__PURE__ */ function(L10, Y10) { + return function(ia) { + var pa = Y10.j; + J5(K7(), H10()); + Ai(ia, pa); + }; + }(v10, A10)), false).SB(), I10 = cj().We; + C10 = eb(C10, I10, "path"); + I10 = cs(C10.g, cj().Jc); + I10.b() || (I10 = I10.c(), qGa(v10, I10, D10)); + return C10; + }; + }(a10, b10)); + var l10 = rw(); + h10 = h10.ka(k10, l10.sc); + h10 = mGa(a10, b10, e10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return !A10.Od(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + L10 = B6(L10.g, cj().R); + return xb(L10, I10); + }; + }(v10, D10))); + }; + }(a10, h10)), h10); + } + k10 = H10(); + l10 = H10(); + var m10 = H10(), p10 = H10(), t10 = H10(); + g10 = dQ(g10, bQ(new cQ(), k10, h10, l10, m10, p10, t10)); + h10 = new M6().W(c10); + k10 = fh(new je4().e("parameters")); + h10 = ac(h10, k10); + h10.b() || (f10 = h10.c(), h10 = f10.i, k10 = lc(), h10 = BGa(new eQ(), N6(h10, k10, a10.m), b10.j, wz(uz(), a10.m)), g10 = dQ(g10, CGa(h10, false)), f10 = Od(O7(), f10.i)); + h10 = g10; + null !== h10 && (k10 = h10.qt, l10 = h10.ah, h10 = h10.Xg, g10.Da() && (g10 = Jl().Wm, m10 = K7(), k10 = k10.ia(l10, m10.u), l10 = K7(), h10 = Zr(new $r(), k10.ia(h10, l10.u), f10), Rg(b10, g10, h10, f10))); + f10 = new M6().W(c10); + g10 = fh(new je4().e("payloads")); + f10 = ac(f10, g10); + f10.b() || (g10 = f10.c(), f10 = Jl().Ne, h10 = K7(), k10 = [new fQ().jn(g10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return DGa(A10, D10); + }; + }(a10, b10)), false, a10.m).ly()], h10 = Zr(new $r(), J5(h10, new Ib().ha(k10)), Od(O7(), g10.i)), g10 = Od(O7(), g10), Rg(b10, f10, h10, g10)); + Dg(a10.Lq, b10); + if (e10) { + ii(); + f10 = [Zx().kda]; + g10 = -1 + (f10.length | 0) | 0; + for (h10 = H10(); 0 <= g10; ) + h10 = ji(f10[g10], h10), g10 = -1 + g10 | 0; + f10 = h10; + } else { + ii(); + f10 = [Zx().hu]; + g10 = -1 + (f10.length | 0) | 0; + for (h10 = H10(); 0 <= g10; ) + h10 = ji(f10[g10], h10), g10 = -1 + g10 | 0; + f10 = h10; + } + Ry(new Sy(), b10, c10, f10, a10.m).hd(); + f10 = wt(new M6().W(c10), "^/.*"); + f10.Da() && (e10 ? f10.U(w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + var I10 = C10.Aa.t(), L10 = v10.m, Y10 = Mo().J7, ia = new qg().e(A10.j); + ia = aQ(ia, "/applied"); + var pa = y7(); + I10 = "Nested endpoint in resourceType: '" + I10 + "'"; + ae4(); + C10 = C10.Aa.da; + C10 = new z7().d(new be4().jj(ce4(0, de4(ee4(), C10.rf, C10.If, C10.Yf, C10.bg)))); + var La = new z7().d(D10.da.Rf); + L10.Gc(Y10.j, ia, pa, I10, C10, Yb().qb, La); + }; + }(a10, b10, c10))) : f10.U(w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + nD(v10.m.$h.x0(), D10, v10.xb, new z7().d(A10), v10.Lq, false).hd(); + }; + }(a10, b10)))); + } + ZP.prototype.hd = function() { + var a10 = lGa(this), b10 = this.xb.P(a10), c10 = Od(O7(), this.tb); + b10 = Db(b10, c10); + c10 = this.Wd; + if (!c10.b()) { + c10 = c10.c(); + EGa(); + var e10 = new gQ().e(c10.j); + e10.Wd = new z7().d(c10); + new z7().d(Cb(b10, e10)); + } + c10 = this.tb.i; + e10 = b10.j; + var f10 = ic(Jl().Uf.r); + bca(a10, c10, e10, f10, this.m); + c10 = Jl().Uf; + e10 = ih(new jh(), a10, Od(O7(), this.tb.Aa)); + Vd(b10, c10, e10); + if (!Cja(Yv(), a10)) { + c10 = this.m; + e10 = sg().HR; + f10 = b10.j; + var g10 = Bja(Yv(), a10), h10 = this.tb.i, k10 = y7(); + ec(c10, e10, f10, k10, g10, h10.da); + } + a: { + for (c10 = this.Lq.Dc; !c10.b(); ) { + e10 = B6(c10.ga().g, Jl().Uf); + if (xb(e10, a10)) { + c10 = true; + break a; + } + c10 = c10.ta(); + } + c10 = false; + } + c10 ? (c10 = this.m, e10 = sg().OX, b10 = b10.j, a10 = "Duplicated resource path " + a10, f10 = this.tb, g10 = y7(), ec(c10, e10, b10, g10, a10, f10.da)) : (a10 = this.tb.i.hb().gb, Q5().nd === a10 ? Dg(this.Lq, b10) : (a10 = this.tb.i, c10 = qc(), a10 = N6(a10, c10, this.m), sGa(this, b10, a10))); + }; + function AGa(a10) { + return w6(/* @__PURE__ */ function() { + return function() { + return true; + }; + }(a10)); + } + function rGa(a10, b10, c10) { + if (b10 instanceof Vi) { + var e10 = B6(b10.aa, Wi().vf).A; + e10.b() ? e10 = false : (e10 = e10.c(), e10 = new qg().e(e10), e10 = mu(e10, gc(47))); + if (e10) { + a10 = a10.m; + e10 = sg().d8; + var f10 = b10.j; + b10 = B6(b10.aa, Wi().vf).A; + b10 = "Value '" + (b10.b() ? null : b10.c()) + "' of uri parameter must not contain '/' character"; + c10 = c10.i; + var g10 = y7(); + ec(a10, e10, f10, g10, b10, c10.da); + } + } + } + function pGa(a10, b10, c10, e10) { + e10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = B6(k10.g, cj().R).A; + l10.b() ? l10 = false : (l10 = l10.c(), l10 = h10.Ha(l10)); + if (!l10) { + l10 = g10.m; + var m10 = sg().HJ, p10 = k10.j, t10 = y7(), v10 = B6(k10.g, cj().R).A; + l10.Ns(m10, p10, t10, "Unused uri parameter " + (v10.b() ? null : v10.c()), Ab(k10.x, q5(jd)), yb(k10)); + } + }; + }(a10, c10))); + b10 = B6(b10.g, Jl().bk); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return Vb().Ia(AD(g10)).ua(); + }; + }(a10)); + var f10 = K7(); + b10 = b10.bd(e10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6(g10.g, Am().Zo); + }; + }(a10)); + f10 = K7(); + b10.bd(e10, f10.u).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = B6(k10.g, cj().R).A; + l10.b() ? l10 = false : (l10 = l10.c(), l10 = h10.Ha(l10)); + if (!l10) { + l10 = g10.m; + var m10 = sg().HJ, p10 = k10.j, t10 = y7(), v10 = B6(k10.g, cj().R).A; + l10.Ns(m10, p10, t10, "Unused operation uri parameter " + (v10.b() ? null : v10.c()), Ab(k10.x, q5(jd)), yb(k10)); + } + }; + }(a10, c10))); + } + function hQ() { + this.X = null; + this.tn = false; + this.kd = this.jk = this.m = null; + } + hQ.prototype = new u7(); + hQ.prototype.constructor = hQ; + function FGa() { + } + FGa.prototype = hQ.prototype; + hQ.prototype.Cc = function() { + var a10 = GGa(this), b10 = new M6().W(this.X), c10 = Am().Tl; + c10 = Ila(Ig(this, c10, this.m), a10); + Gg(b10, "queryParameters", HFa(DFa(Gy(c10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + cna || (cna = new Pz().a()); + return cna.NL(h10, g10.tn, k10, g10.m); + }; + }(this, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = Ov(g10.jk).j; + J5(K7(), H10()); + Ai(h10, k10); + }; + }(this)))))))); + b10 = new M6().W(this.X); + c10 = Am().Tf; + a10 = Ila(Ig(this, c10, this.m), a10); + Gg(b10, "headers", HFa(DFa(Gy(a10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return $ma().NL(h10, g10.tn, k10, g10.m); + }; + }(this, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = Ov(g10.jk).j; + J5(K7(), H10()); + Ai(h10, k10); + }; + }(this)))))))); + a10 = ac(new M6().W(this.X), this.V_); + if (!a10.b()) { + a10 = a10.c(); + b10 = a10.i; + c10 = qc(); + b10 = N6(b10, c10, this.m).sb; + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = new iQ().jn(h10, w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = Ov(l10.jk).j; + J5(K7(), H10()); + Ai(m10, p10); + }; + }(g10)), g10.tn, g10.m).SB(); + var k10 = cj().We; + return eb(h10, k10, "path"); + }; + }(this)); + var e10 = rw(); + e10 = b10.ka(c10, e10.sc); + b10 = Ov(this.jk); + c10 = Am().Zo; + e10 = Zr(new $r(), e10, Od(O7(), a10.i)); + a10 = Od(O7(), a10); + Rg(b10, c10, e10, a10); + } + a10 = ac(new M6().W(this.X), "body"); + if (!a10.b()) { + a10 = a10.c(); + b10 = J5(Ef(), H10()); + c10 = a10.i.hb().gb; + if (Q5().nd === c10) { + if (c10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + O7(); + var k10 = new P6().a(); + h10 = Sd(h10, "default", k10); + k10 = Ov(g10.jk).j; + var l10 = lt2(); + return h10.ub(k10, l10); + }; + }(this)), false, this.qw).Cc(), !c10.b()) { + c10 = c10.c(); + e10 = Ov(this.jk); + var f10 = y7(); + f10 = jQ(e10, f10); + f10.x.Lb(new kQ().a()); + Jz(Lz(), c10); + e10 = Od(O7(), a10); + e10 = Db(f10, e10); + c10 = HC(EC(), c10, f10.j, y7()); + f10 = xm().Jc; + Dg(b10, Vd(e10, f10, c10)); + } + } else + Q5().Na === c10 ? (c10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + O7(); + var k10 = new P6().a(); + h10 = Sd(h10, "default", k10); + k10 = Ov(g10.jk).j; + var l10 = lt2(); + return h10.ub(k10, l10); + }; + }(this)), false, this.qw).Cc(), c10.b() || (c10 = c10.c(), e10 = Ov(this.jk), f10 = y7(), f10 = jQ(e10, f10), Jz(Lz(), c10), e10 = Od(O7(), a10), e10 = Db(f10, e10), c10 = HC(EC(), c10, f10.j, y7()), f10 = xm().Jc, Dg(b10, Vd(e10, f10, c10)))) : (c10 = a10.i, e10 = qc(), c10 = Iw(c10, e10), c10 instanceof ye4 && (c10 = c10.i, e10 = wt(new M6().W(c10), ".*/.*"), e10.Da() && e10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.m.$h.Ica(), m10 = Ov(g10.jk); + return Dg(h10, oy(l10, k10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return jQ(t10, v10); + }; + }(g10, m10)), false).ly()); + }; + }(this, b10))), e10 = c10.sb.Cb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = k10.Aa; + var l10 = bc(); + k10 = N6(k10, l10, g10.m).va; + if (null === k10) + throw new sf().a(); + return !tf( + uf(), + h10, + k10 + ); + }; + }(this, ".*/.*"))), c10 = tr(ur(), e10, c10.da.Rf), tc(c10.sb) && (b10.b() ? (c10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + O7(); + var k10 = new P6().a(); + h10 = Sd(h10, "default", k10); + k10 = Ov(g10.jk).j; + var l10 = lt2(); + return h10.ub(k10, l10); + }; + }(this)), false, this.qw).Cc(), c10.b() || (c10 = c10.c(), e10 = Ov(this.jk), f10 = y7(), f10 = jQ(e10, f10), Jz(Lz(), c10), e10 = Od(O7(), a10), e10 = Db(f10, e10), c10 = HC(EC(), c10, f10.j, y7()), f10 = xm().Jc, Dg(b10, Vd(e10, f10, c10)))) : c10.sb.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = g10.m, l10 = sg().xN, m10 = Ov(g10.jk).j, p10 = h10.Aa, t10 = bc(); + p10 = "Unexpected key '" + N6(p10, t10, g10.m).va + "'. Expecting valid media types."; + t10 = y7(); + ec(k10, l10, m10, t10, p10, h10.da); + }; + }(this)))))); + b10.Da() && (c10 = Ov(this.jk), e10 = Am().Ne, b10 = Zr(new $r(), b10, Od(O7(), a10.i)), a10 = Od(O7(), a10), Rg(c10, e10, b10, a10)); + } + this.aoa(this.jk); + a10 = this.jk.r; + a10.b() || (a10 = a10.c().x, O7(), T6(), b10 = this.X, a10.Sp(Od(0, mr(T6(), b10, Q5().sa)))); + return this.jk.r; + }; + hQ.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + hQ.prototype.PO = function(a10, b10, c10, e10) { + this.X = a10; + this.tn = c10; + this.m = e10; + this.jk = new Nv().PG(b10); + return this; + }; + function lQ() { + this.l = null; + } + lQ.prototype = new u7(); + lQ.prototype.constructor = lQ; + lQ.prototype.U = function(a10) { + a10.P(Ov(this.l.jk)); + }; + function GGa(a10) { + var b10 = new lQ(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + lQ.prototype.$classData = r8({ mTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlRequestParser$$anon$1", { mTa: 1, f: 1, jha: 1 }); + function mQ() { + this.yb = this.tb = null; + this.tn = false; + this.kd = this.m = null; + } + mQ.prototype = new u7(); + mQ.prototype.constructor = mQ; + function HGa() { + } + HGa.prototype = mQ.prototype; + mQ.prototype.jn = function(a10, b10, c10, e10) { + this.tb = a10; + this.yb = b10; + this.tn = c10; + this.m = e10; + return this; + }; + mQ.prototype.EH = function() { + var a10 = new Qg().Vb(this.tb.Aa, this.m).Zf(), b10 = this.tb.i.hb().gb; + if (Q5().nd === b10) { + b10 = dqa(fqa(), this.tb); + var c10 = Dm().R; + b10 = Vd(b10, c10, a10); + c10 = Dm().In; + b10 = Vd(b10, c10, a10); + this.yb.P(b10); + } else if (Q5().Na === b10 || Q5().cj === b10) { + b10 = this.tb.i; + c10 = bc(); + b10 = N6(b10, c10, this.m).va; + c10 = qFa(this.m.pe(), this.tb.i, b10); + O7(); + var e10 = new P6().a(); + b10 = kM(c10, b10, e10); + c10 = Dm().R; + Vd(b10, c10, a10).x.Sp(Od(O7(), this.tb)); + } else { + b10 = this.tb.i; + c10 = qc(); + b10 = N6(b10, c10, this.m); + c10 = dqa(fqa(), this.tb); + e10 = Dm().R; + c10 = Vd(c10, e10, a10); + this.yb.P(c10); + e10 = B6(c10.g, Dm().R).A; + e10 = e10.b() ? null : e10.c(); + var f10 = Dm().In; + eb(c10, f10, e10); + this.tn && Ed(ua(), a10.t(), "?") && (e10 = Dm().fw, Bi(c10, e10, true), a10 = a10.t(), a10 = new qg().e(a10), a10 = aQ(a10, "?"), e10 = Dm().R, eb(c10, e10, a10), e10 = Dm().In, eb(c10, e10, a10)); + a10 = new M6().W(b10); + e10 = Dm().Va; + Gg(a10, "description", nh(Hg(Ig(this, e10, this.m), c10))); + a10 = new M6().W(b10); + e10 = Dm().Tf; + e10 = Hg(Ig(this, e10, this.m), c10); + Gg(a10, "headers", HFa(DFa(Gy(e10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return $ma().NL(l10, k10.tn, m10, k10.m); + }; + }(this, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = l10.j; + J5(K7(), H10()); + Ai(m10, p10); + }; + }(this, c10)))))))); + a10 = ac(new M6().W(b10), "body"); + if (!a10.b()) { + a10 = a10.c(); + e10 = J5(Ef(), H10()); + f10 = Od(O7(), a10); + f10 = new ym().K(new S6().a(), f10); + var g10 = c10.j; + J5(K7(), H10()); + Ai(f10, g10); + g10 = a10.i.hb().gb; + if (Q5().nd === g10) { + g10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = EC(); + O7(); + var t10 = new P6().a(); + m10 = Sd(m10, "default", t10); + t10 = l10.j; + var v10 = lt2(); + return HC(p10, m10.ub(t10, v10), l10.j, y7()); + }; + }(this, f10)), false, this.qw).Cc(); + if (!g10.b()) { + g10 = g10.c(); + g10.fa().Lb(new Xz().a()); + f10.x.Lb(new kQ().a()); + Jz(Lz(), g10); + var h10 = xm().Jc; + Dg(e10, Vd(f10, h10, g10)); + } + f10 = Am().Ne; + e10 = Zr(new $r(), e10, Od(O7(), a10.i)); + a10 = Od(O7(), a10); + Rg(c10, f10, e10, a10); + } else + Q5().Na === g10 ? (g10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = EC(); + O7(); + var t10 = new P6().a(); + m10 = Sd(m10, "default", t10); + t10 = l10.j; + var v10 = lt2(); + return HC(p10, m10.ub(t10, v10), l10.j, y7()); + }; + }(this, f10)), false, this.qw).Cc(), g10.b() || (g10 = g10.c(), Jz(Lz(), g10), h10 = xm().Jc, Dg(e10, Vd(f10, h10, g10))), f10 = Am().Ne, e10 = Zr(new $r(), e10, Od(O7(), a10.i)), a10 = Od(O7(), a10), Rg(c10, f10, e10, a10)) : (g10 = a10.i, h10 = qc(), g10 = Iw(g10, h10), g10 instanceof ye4 && (g10 = g10.i, h10 = wt(new M6().W(g10), ".*/.*"), h10.Da() && h10.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + return Dg(l10, oy(k10.m.$h.Ica(), p10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return jQ(v10, A10); + }; + }(k10, m10)), false).ly()); + }; + }(this, e10, c10))), g10 = g10.sb.Cb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10 = m10.Aa; + var p10 = bc(); + m10 = N6(m10, p10, k10.m).va; + if (null === m10) + throw new sf().a(); + return !tf(uf(), l10, m10); + }; + }(this, ".*/.*"))), ur(), h10 = g10.kc(), h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(h10.da.Rf)), g10 = tr(0, g10, h10.b() ? "" : h10.c()), tc(g10.sb) && (e10.b() ? (f10 = this.m.$h.iF().du(a10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + O7(); + var p10 = new P6().a(); + m10 = Sd(m10, "default", p10); + p10 = l10.j; + var t10 = lt2(); + return m10.ub(p10, t10); + }; + }(this, f10)), false, this.qw).Cc(), f10.b() || (f10 = f10.c(), g10 = y7(), h10 = jQ(c10, g10), Jz(Lz(), f10), g10 = Od(O7(), a10), g10 = Db(h10, g10), f10 = HC(EC(), f10, h10.j, y7()), h10 = xm().Jc, Dg(e10, Vd(g10, h10, f10)))) : g10.sb.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = k10.m, t10 = sg().xN, v10 = l10.j, A10 = m10.Aa, D10 = bc(); + A10 = "Unexpected key '" + N6(A10, D10, k10.m).va + "'. Expecting valid media types."; + D10 = y7(); + ec(p10, t10, v10, D10, A10, m10.da); + }; + }(this, c10))))), e10.Da() && (f10 = Am().Ne, e10 = Zr(new $r(), e10, Od(O7(), a10.i)), a10 = Od(O7(), a10), Rg(c10, f10, e10, a10))); + } + a10 = new M6().W(b10); + e10 = fh(new je4().e("examples")); + a10 = ac(a10, e10); + a10.b() || (e10 = a10.c(), f10 = new nQ().p1(e10, this.m).Vg(), a10 = Dm().Ec, f10 = Zr(new $r(), f10, Od(O7(), e10.i)), e10 = Od(O7(), e10), Rg(c10, a10, f10, e10)); + Zz(this.m, c10.j, b10, "response"); + this.Xna(c10, b10); + b10 = c10; + } + b10.x.Sp(Od( + O7(), + this.tb + )); + return b10; + }; + mQ.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function IGa(a10, b10) { + var c10 = wh(a10.Ba.r.r.fa(), q5(JGa)), e10 = a10.Bja(a10.Ba.r.r.wb); + if (c10) { + T6(); + c10 = a10.kL(); + var f10 = mh(T6(), c10); + c10 = new PA().e(b10.ca); + a10.d$(e10.ga()).Ob(c10); + e10 = c10.s; + a10 = [f10]; + if (0 > e10.w) + throw new U6().e("0"); + var g10 = a10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = a10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = a10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(b10.s, vD(wD(), c10.s)); + } else { + T6(); + c10 = a10.kL(); + f10 = mh(T6(), c10); + c10 = new PA().e(b10.ca); + g10 = c10.s; + l10 = c10.ca; + k10 = new PA().e(l10); + h10 = wr(); + m10 = a10.p; + a10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return t10.d$(v10); + }; + }(a10)); + var p10 = K7(); + vr(h10, m10.zb(e10.ka(a10, p10.u)), k10); + T6(); + eE(); + e10 = SA(zs(), l10); + e10 = mr(0, new Sx().Ac(e10, k10.s), Q5().cd); + pr(g10, e10); + e10 = c10.s; + a10 = [f10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = a10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + h10 = g10.n.length; + l10 = k10 = 0; + m10 = a10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = a10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(b10.s, vD(wD(), c10.s)); + } + } + function Rz() { + this.kd = this.m = this.yb = this.Ca = null; + } + Rz.prototype = new u7(); + Rz.prototype.constructor = Rz; + function KGa(a10) { + var b10 = a10.Ca, c10 = qc(); + b10 = N6(b10, c10, a10.m); + LGa || (LGa = new oQ().a()); + c10 = MGa(a10.Ca); + var e10 = new M6().W(b10), f10 = dj().R; + Gg(e10, "name", Hg(Ig(a10, f10, a10.m), c10)); + a10.yb.P(c10); + e10 = new M6().W(b10); + f10 = dj().Va; + Gg(e10, "description", Hg(Ig(a10, f10, a10.m), c10)); + e10 = new M6().W(b10); + f10 = dj().Sf; + Gg(e10, "externalDocs", Gy(Hg(Ig(a10, f10, a10.m), c10), w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return jma(kma(), k10, h10.j, g10.m); + }; + }(a10, c10)))); + Ry(new Sy(), c10, b10, H10(), a10.m).hd(); + Zz(a10.m, c10.j, b10, "tag"); + return c10; + } + Rz.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + Rz.prototype.Faa = function(a10, b10, c10) { + this.Ca = a10; + this.yb = b10; + this.m = c10; + return this; + }; + Rz.prototype.$classData = r8({ JTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.TagsParser", { JTa: 1, f: 1, sg: 1 }); + function pQ() { + this.Pe = null; + } + pQ.prototype = new u7(); + pQ.prototype.constructor = pQ; + pQ.prototype.a = function() { + NGa = this; + var a10 = J5(Gb().Qg, H10()); + a10 = new R6().M("paths", a10); + var b10 = "swagger info host basePath schemes consumes produces paths definitions parameters responses securityDefinitions security tags externalDocs".split(" "); + if (0 === (b10.length | 0)) + b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new R6().M("webApi", b10); + c10 = "title description termsOfService contact license version".split(" "); + if (0 === (c10.length | 0)) + c10 = vd(); + else { + e10 = wd(new xd(), vd()); + f10 = 0; + for (var g10 = c10.length | 0; f10 < g10; ) + Ad(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + } + c10 = new R6().M("info", c10); + e10 = ["name", "url", "email"]; + if (0 === (e10.length | 0)) + e10 = vd(); + else { + f10 = wd(new xd(), vd()); + g10 = 0; + for (var h10 = e10.length | 0; g10 < h10; ) + Ad(f10, e10[g10]), g10 = 1 + g10 | 0; + e10 = f10.eb; + } + e10 = new R6().M("contact", e10); + f10 = ["name", "url"]; + if (0 === (f10.length | 0)) + f10 = vd(); + else { + g10 = wd(new xd(), vd()); + h10 = 0; + for (var k10 = f10.length | 0; h10 < k10; ) + Ad(g10, f10[h10]), h10 = 1 + h10 | 0; + f10 = g10.eb; + } + f10 = new R6().M("license", f10); + g10 = ["attribute", "wrapped", "name", "namespace", "prefix"]; + if (0 === (g10.length | 0)) + g10 = vd(); + else { + h10 = wd(new xd(), vd()); + k10 = 0; + for (var l10 = g10.length | 0; k10 < l10; ) + Ad( + h10, + g10[k10] + ), k10 = 1 + k10 | 0; + g10 = h10.eb; + } + g10 = new R6().M("xmlSerialization", g10); + h10 = "get put post delete options head patch connect trace parameters $ref".split(" "); + if (0 === (h10.length | 0)) + h10 = vd(); + else { + k10 = wd(new xd(), vd()); + l10 = 0; + for (var m10 = h10.length | 0; l10 < m10; ) + Ad(k10, h10[l10]), l10 = 1 + l10 | 0; + h10 = k10.eb; + } + h10 = new R6().M("pathItem", h10); + k10 = "tags summary description externalDocs operationId consumes produces parameters responses schemes deprecated security".split(" "); + if (0 === (k10.length | 0)) + k10 = vd(); + else { + l10 = wd(new xd(), vd()); + m10 = 0; + for (var p10 = k10.length | 0; m10 < p10; ) + Ad(l10, k10[m10]), m10 = 1 + m10 | 0; + k10 = l10.eb; + } + k10 = new R6().M("operation", k10); + l10 = ["url", "description"]; + if (0 === (l10.length | 0)) + l10 = vd(); + else { + m10 = wd(new xd(), vd()); + p10 = 0; + for (var t10 = l10.length | 0; p10 < t10; ) + Ad(m10, l10[p10]), p10 = 1 + p10 | 0; + l10 = m10.eb; + } + l10 = new R6().M("externalDoc", l10); + m10 = "name in description required type format allowEmptyValue items collectionFormat default maximum exclusiveMaximum minimum exclusiveMinimum maxLength minLength pattern maxItems minItems uniqueItems enum multipleOf deprecated example".split(" "); + if (0 === (m10.length | 0)) + m10 = vd(); + else { + p10 = wd(new xd(), vd()); + t10 = 0; + for (var v10 = m10.length | 0; t10 < v10; ) + Ad(p10, m10[t10]), t10 = 1 + t10 | 0; + m10 = p10.eb; + } + m10 = new R6().M("parameter", m10); + p10 = ["name", "in", "description", "required", "schema"]; + if (0 === (p10.length | 0)) + p10 = vd(); + else { + t10 = wd(new xd(), vd()); + v10 = 0; + for (var A10 = p10.length | 0; v10 < A10; ) + Ad(t10, p10[v10]), v10 = 1 + v10 | 0; + p10 = t10.eb; + } + p10 = new R6().M("bodyParameter", p10); + t10 = ["description", "schema", "headers", "examples"]; + if (0 === (t10.length | 0)) + t10 = vd(); + else { + v10 = wd(new xd(), vd()); + A10 = 0; + for (var D10 = t10.length | 0; A10 < D10; ) + Ad(v10, t10[A10]), A10 = 1 + A10 | 0; + t10 = v10.eb; + } + t10 = new R6().M("response", t10); + v10 = "description type items collectionFormat default maximum exclusiveMaximum minimum exclusiveMinimum maxLength minLength pattern maxItems minItems uniqueItems enum multipleOf".split(" "); + if (0 === (v10.length | 0)) + v10 = vd(); + else { + A10 = wd(new xd(), vd()); + D10 = 0; + for (var C10 = v10.length | 0; D10 < C10; ) + Ad(A10, v10[D10]), D10 = 1 + D10 | 0; + v10 = A10.eb; + } + v10 = new R6().M("headerParameter", v10); + A10 = ["name", "description", "externalDocs"]; + if (0 === (A10.length | 0)) + A10 = vd(); + else { + D10 = wd(new xd(), vd()); + C10 = 0; + for (var I10 = A10.length | 0; C10 < I10; ) + Ad(D10, A10[C10]), C10 = 1 + C10 | 0; + A10 = D10.eb; + } + A10 = new R6().M("tag", A10); + D10 = "$ref $schema format title description maximum exclusiveMaximum minimum exclusiveMinimum maxLength minLength pattern maxItems minItems uniqueItems maxProperties minProperties required enum type items additionalItems collectionFormat allOf properties additionalProperties discriminator readOnly xml externalDocs allOf anyOf not dependencies multipleOf default example id name patternProperties".split(" "); + if (0 === (D10.length | 0)) + D10 = vd(); + else { + C10 = wd(new xd(), vd()); + I10 = 0; + for (var L10 = D10.length | 0; I10 < L10; ) + Ad(C10, D10[I10]), I10 = 1 + I10 | 0; + D10 = C10.eb; + } + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, new R6().M("schema", D10)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.Pe = b10.eb; + return this; + }; + pQ.prototype.$classData = r8({ STa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas2Syntax$", { STa: 1, f: 1, PY: 1 }); + var NGa = void 0; + function nna() { + NGa || (NGa = new pQ().a()); + return NGa; + } + function qQ() { + this.Pe = null; + } + qQ.prototype = new u7(); + qQ.prototype.constructor = qQ; + qQ.prototype.a = function() { + OGa = this; + var a10 = Gb().ab, b10 = J5(Gb().Qg, H10()); + b10 = new R6().M("paths", b10); + var c10 = J5(Gb().Qg, new Ib().ha("openapi info servers paths components security tags externalDocs".split(" "))); + c10 = new R6().M("webApi", c10); + var e10 = J5(Gb().Qg, new Ib().ha("schemas responses parameters examples requestBodies headers securitySchemes links callbacks".split(" "))); + e10 = new R6().M("components", e10); + var f10 = J5(Gb().Qg, new Ib().ha("title description termsOfService contact license version".split(" "))); + f10 = new R6().M( + "info", + f10 + ); + var g10 = J5(Gb().Qg, new Ib().ha(["name", "url", "email"])); + g10 = new R6().M("contact", g10); + var h10 = J5(Gb().Qg, new Ib().ha(["name", "url"])); + h10 = new R6().M("license", h10); + var k10 = J5(Gb().Qg, new Ib().ha(["attribute", "wrapped", "name", "namespace", "prefix"])); + k10 = new R6().M("xmlSerialization", k10); + var l10 = J5(Gb().Qg, new Ib().ha("get put post delete options head patch connect trace parameters servers summary description \\$ref".split(" "))); + l10 = new R6().M("pathItem", l10); + var m10 = J5(Gb().Qg, new Ib().ha("tags summary description externalDocs operationId parameters requestBody responses callbacks deprecated security servers".split(" "))); + m10 = new R6().M("operation", m10); + var p10 = J5(Gb().Qg, new Ib().ha("operationRef operationId description server parameters requestBody".split(" "))); + p10 = new R6().M("link", p10); + var t10 = J5(Gb().Qg, new Ib().ha(["url", "description", "variables"])); + t10 = new R6().M("server", t10); + var v10 = J5(Gb().Qg, new Ib().ha(["url", "description"])); + v10 = new R6().M("externalDoc", v10); + var A10 = J5(Gb().Qg, new Ib().ha(["summary", "description", "value", "externalValue"])); + A10 = new R6().M("example", A10); + var D10 = J5(Gb().Qg, new Ib().ha("name in description required deprecated allowEmptyValue style explode allowReserved schema example examples content".split(" "))); + D10 = new R6().M("parameter", D10); + var C10 = J5(Gb().Qg, new Ib().ha("description required deprecated allowEmptyValue style explode allowReserved schema example examples content".split(" "))); + C10 = new R6().M("header", C10); + var I10 = J5(Gb().Qg, new Ib().ha(["description", "content", "required"])); + I10 = new R6().M("request", I10); + var L10 = J5(Gb().Qg, new Ib().ha(["name", "in", "description", "required", "schema"])); + L10 = new R6().M("bodyParameter", L10); + var Y10 = J5(Gb().Qg, new Ib().ha(["description", "content", "headers", "links"])); + Y10 = new R6().M("response", Y10); + var ia = J5(Gb().Qg, new Ib().ha(["schema", "example", "examples", "encoding"])); + ia = new R6().M("content", ia); + var pa = J5(Gb().Qg, new Ib().ha(["contentType", "headers", "style", "explode", "allowReserved"])); + pa = new R6().M("encoding", pa); + var La = J5(Gb().Qg, new Ib().ha("description type items collectionFormat default maximum exclusiveMaximum minimum exclusiveMinimum maxLength minLength pattern maxItems minItems uniqueItems enum multipleOf".split(" "))); + La = new R6().M("headerParameter", La); + var ob = J5(Gb().Qg, new Ib().ha([ + "name", + "description", + "externalDocs" + ])); + ob = new R6().M("tag", ob); + var zb = J5(Gb().Qg, new Ib().ha(["propertyName", "mapping"])); + zb = new R6().M("discriminator", zb); + var Zb = J5(Gb().Qg, new Ib().ha("$ref $schema format title description maximum exclusiveMaximum minimum exclusiveMinimum maxLength minLength nullable pattern maxItems minItems uniqueItems maxProperties minProperties required enum type items additionalItems collectionFormat allOf properties additionalProperties discriminator readOnly writeOnly xml deprecated externalDocs allOf anyOf oneOf not dependencies multipleOf default example id name patternProperties".split(" "))); + b10 = [b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia, pa, La, ob, zb, new R6().M("schema", Zb)]; + this.Pe = Rb(a10, new Ib().ha(b10)); + return this; + }; + qQ.prototype.$classData = r8({ ZTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3Syntax$", { ZTa: 1, f: 1, PY: 1 }); + var OGa = void 0; + function rQ() { + OGa || (OGa = new qQ().a()); + return OGa; + } + function sQ() { + } + sQ.prototype = new u7(); + sQ.prototype.constructor = sQ; + sQ.prototype.a = function() { + return this; + }; + sQ.prototype.$classData = r8({ eUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$", { eUa: 1, f: 1, SY: 1 }); + var PGa = void 0; + function tQ() { + this.N = null; + } + tQ.prototype = new u7(); + tQ.prototype.constructor = tQ; + function QGa() { + } + QGa.prototype = tQ.prototype; + tQ.prototype.aA = function(a10) { + this.N = a10; + return this; + }; + function uQ() { + this.Wma = this.Q = this.Mca = this.Se = null; + } + uQ.prototype = new u7(); + uQ.prototype.constructor = uQ; + function RGa(a10, b10) { + var c10 = b10.oq; + if (yja($f(), c10)) + for (c10 = ai(a10.Wma, c10); c10.Ya(); ) { + var e10 = c10.Tw(); + try { + var f10 = Mc(ua(), e10, '"'), g10 = Oc(new Pc().fd(f10)), h10 = Mc(ua(), g10, "#"), k10 = zj(new Pc().fd(h10)); + -1 === (k10.indexOf("<<") | 0) && -1 === (k10.indexOf(">>") | 0) && MN(a10.Q, k10, dBa(), mr(T6(), b10, Q5().Na)); + } catch (l10) { + if (!(Ph(E6(), l10) instanceof nb)) + throw l10; + } + } + } + function SGa(a10) { + a10 = a10.Aa.re(); + return a10 instanceof xt ? "$ref" === a10.va : false; + } + function TGa(a10, b10, c10) { + b10 = b10.sb.ga(); + var e10 = b10.i.hb().gb; + if (Q5().Na === e10) { + c10 = a10.Q; + a10 = b10.i; + e10 = Dd(); + var f10 = cc().bi; + MN(c10, N6(a10, e10, f10), yM(), b10.i); + } else + a10 = sg().k_, e10 = "Unexpected $ref with " + b10, b10 = b10.i, f10 = y7(), ec(c10, a10, "", f10, e10, b10.da); + } + uQ.prototype.lba = function(a10, b10) { + var c10 = qc(); + a10 = kx(a10).Qp(c10); + if (a10 instanceof ye4 && (a10 = a10.i, c10 = this.Se, c10 = Pb().$ === c10 ? new z7().d("uses") : Bu().$ === c10 || Cu().$ === c10 ? new z7().d("x-amf-uses") : y7(), !c10.b() && (c10 = c10.c(), a10 = ac(new M6().W(a10), c10), !a10.b()))) { + var e10 = a10.c(); + a10 = e10.i.hb().gb; + if (Q5().sa === a10) + a10 = e10.i, c10 = qc(), e10 = cc().bi, N6(a10, c10, e10).sb.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = UGa(VGa(), k10, h10); + if (l10 instanceof z7) + MN(g10.Q, l10.i, wM(), k10.i); + else { + l10 = sg().I7; + var m10 = y7(); + ec(h10, l10, "", m10, "Missing library location", k10.da); + } + }; + }(this, b10))); + else if (Q5().nd !== a10) { + a10 = Wd().IR; + c10 = "Expected map but found: " + e10.i; + e10 = e10.i; + var f10 = y7(); + ec(b10, a10, "", f10, c10, e10.da); + } + } + }; + uQ.prototype.PW = function(a10, b10, c10, e10, f10) { + var g10 = this.Se; + return (Pb().$ === g10 || Qb().$ === g10 || Ob().$ === g10) && a10.Jd instanceof Mk ? WGa(this, a10, b10, c10, e10, f10) : ZC(hp(), a10); + }; + function XGa(a10, b10, c10) { + var e10 = b10.re(); + if (e10 instanceof xt) + MN(a10.Q, e10.va, yM(), b10); + else { + a10 = sg().k_; + e10 = "Unexpected !include with " + b10.re(); + var f10 = y7(); + ec(c10, a10, "", f10, e10, b10.da); + } + } + function YGa(a10, b10, c10) { + b10 instanceof vw && 1 === b10.sb.jb() && SGa(b10.sb.ga()) ? TGa(a10, b10, c10) : b10.Xf.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + YGa(e10, g10, f10); + }; + }(a10, c10))); + } + function ZGa(a10, b10, c10) { + a: { + if (b10 instanceof Cs) { + var e10 = b10.hb().gb, f10 = Q5().wq; + if (e10 === f10) { + XGa(a10, b10, c10); + break a; + } + } + b10 instanceof xt && sp(b10.oq) ? RGa(a10, b10) : b10.Xf.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + ZGa(g10, k10, h10); + }; + }(a10, c10))); + } + } + uQ.prototype.WN = function(a10, b10) { + var c10 = a10.Xd; + this.lba(c10, b10); + var e10 = this.Se; + Pb().$ === e10 || Qb().$ === e10 || Ob().$ === e10 ? ZGa(this, c10, b10) : (Bu().$ === e10 || Cu().$ === e10) && YGa(this, c10, b10); + a: + if (e10 = this.Se, a10 = a10.Kz, a10 instanceof z7) { + a10 = a10.i; + a10 = $Ga(aHa(), a10); + if (a10 instanceof z7 && (a10 = a10.i, (ux().h(a10) || vx().h(a10)) && e10 === Pb().$)) { + e10 = true; + break a; + } + e10 = false; + } else if (y7() === a10) + e10 = false; + else + throw new x7().d(a10); + if (e10 && (c10 = c10.Fd, e10 = qc(), c10 = Iw(c10, e10), c10 instanceof ye4 && (c10 = c10.i, e10 = this.Se, e10 = Pb().$ === e10 ? new z7().d("extends") : Bu().$ === e10 || Cu().$ === e10 ? new z7().d("x-extends") : y7(), !e10.b() && (e10 = e10.c(), c10 = ac(new M6().W(c10), e10), !c10.b())))) + if (c10 = c10.c(), e10 = c10.i.hb().gb, Q5().sa === e10 || Q5().cd === e10 || Q5().nd === e10) { + e10 = sg().h6; + a10 = "Expected scalar but found: " + c10.i; + c10 = c10.i; + var f10 = y7(); + ec(b10, e10, "", f10, a10, c10.da); + } else + b10 = this.Q, e10 = c10.i, a10 = bc(), f10 = cc().bi, e10 = N6(e10, a10, f10).va, bBa || (bBa = new tM().a()), MN(b10, e10, bBa, c10.i); + return this.Q; + }; + function WGa(a10, b10, c10, e10, f10, g10) { + var h10 = bHa(a10, b10, c10); + if (h10 instanceof ye4) { + h10 = h10.i; + var k10 = $q(new Dc(), h10, y7()); + k10 = cHa(a10.Se, a10.Mca).WN(k10, c10); + var l10 = gga(e10, b10.Jd.j); + e10 = k10.Df.Ur().ke(); + c10 = w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = C10.Df, L10 = w6(/* @__PURE__ */ function() { + return function(ia) { + return ia.Ca; + }; + }(m10)), Y10 = K7(); + return bga(C10, p10, t10, v10, A10, I10.ka(L10, Y10.u), true).Pq(w6(/* @__PURE__ */ function(ia, pa, La, ob, zb, Zb, Cc) { + return function(vc) { + if (null !== vc) { + var id = vc.mO; + vc = vc.Jd; + if (y7() === id && vc instanceof z7) + return WGa(ia, Hq(new Iq(), vc.i, pa, y7()), La, ob, zb, Zb).Yg(w6(/* @__PURE__ */ function(yd, zd, rd, sd) { + return function(le4) { + dHa(zd.Jd, le4.Jd); + rd.Df.U(w6(/* @__PURE__ */ function(Vc, Sc, Qc, $c) { + return function(Wc) { + var Qe = Sc.Jd, Qd = Lc(Qc.Jd); + Qd = Qd.b() ? Qc.Jd.j : Qd.c(); + ae4(); + var me4 = Wc.Ca.da; + Qd = new Uq().xU(Qd, ce4(0, de4(ee4(), me4.rf, me4.If, me4.Yf, me4.bg))); + Cb(Qe, Qd); + Wc = Wc.Ca; + Wc instanceof uG ? (Qc.Jd.Ve().U(w6(/* @__PURE__ */ function(of, Le2) { + return function(Ve) { + return eHa(Le2, Ve); + }; + }(Vc, $c))), Wc.Gv = Qc.ad) : (Qe = sg().Oy, Qd = y7(), ec($c, Qe, "", Qd, "Cannot inline a fragment in a not mutable node", Wc.da)); + }; + }(yd, zd, le4, sd))); + }; + }(ia, Cc, pa, La)), ml()); + } + return nq( + hp(), + oq(/* @__PURE__ */ function() { + return function() { + return H10(); + }; + }(ia)), + ml() + ); + }; + }(m10, C10, v10, p10, A10, t10, D10)), ml()); + }; + }(a10, l10, g10, c10, f10, b10)); + f10 = K7(); + c10 = e10.ka(c10, f10.u); + f10 = hp(); + g10 = K7(); + return Bfa(f10, c10, g10.u).Yg(w6(/* @__PURE__ */ function(m10, p10, t10) { + return function() { + var v10 = new z7().d(p10.Fd); + return Hq(new Iq(), t10.Jd, t10.$n, v10); + }; + }(a10, h10, b10)), ml()); + } + if (h10 instanceof ve4) + return h10 = h10.i, hp(), b10.Jd.Ve().U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return eHa(p10, t10); + }; + }(a10, c10))), T6(), a10 = Lc(b10.Jd), a10 = new z7().d(kua(0, h10, a10.b() ? "" : a10.c())), ZC(0, Hq(new Iq(), b10.Jd, b10.$n, a10)); + throw new x7().d(h10); + } + function bHa(a10, b10, c10) { + var e10 = false, f10 = null; + b10 = b10.Jd; + if (b10 instanceof Mk) { + e10 = true; + f10 = b10; + var g10 = ar(f10.g, Jk().nb); + a10 = a10.Mca.Qz(); + g10 = B6(g10.g, Ok().Nd).A; + if (a10.Ha(g10.b() ? null : g10.c())) + return ue4(), Rua(), e10 = B6(ar(f10.g, Jk().nb).g, Ok().Rd).A, e10 = e10.b() ? null : e10.c(), f10 = Lc(f10), c10 = fHa(Oua(0, e10, f10.b() ? "" : f10.c(), c10)), c10 = Cj(c10), new ye4().d(c10); + } + if (e10) + return ue4(), c10 = B6(ar(f10.g, Jk().nb).g, Ok().Rd).A, c10 = c10.b() ? null : c10.c(), new ve4().d(c10); + c10 = Ab(b10.fa(), q5(Qu)); + if (c10.b() ? 0 : c10.c().ad instanceof RA) + return ue4(), c10 = Ab(b10.fa(), q5(Qu)), c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.ad)), c10 = c10.c(), new ye4().d(c10); + ue4(); + return new ve4().d(""); + } + function cHa(a10, b10) { + var c10 = new uQ(); + c10.Se = a10; + c10.Mca = b10; + c10.Q = new LN().a(); + a10 = new qg().e('("\\$ref":\\s*".*")'); + b10 = H10(); + c10.Wma = new rg().vi(a10.ja, b10); + return c10; + } + uQ.prototype.$classData = r8({ oWa: 0 }, false, "amf.plugins.document.webapi.references.WebApiReferenceHandler", { oWa: 1, f: 1, KY: 1 }); + function vQ() { + Wu.call(this); + this.Yj = null; + this.Iqa = false; + this.Ig = null; + this.Ci = false; + } + vQ.prototype = new Xu(); + vQ.prototype.constructor = vQ; + function gHa() { + } + gHa.prototype = vQ.prototype; + vQ.prototype.kC = function() { + if (!this.Ci && !this.Ci) { + var a10 = K7(), b10 = this.OE(), c10 = new wQ().rs(this.un(), true, this.ob), e10 = new xQ().rs(this.un(), true, this.ob), f10 = new yQ().Hb(this.ob), g10 = new zQ().Sx(this.un(), this.ob), h10 = new AQ().Sx(this.un(), this.ob), k10 = new BQ().rs(this.un(), true, this.ob), l10 = this.un(); + b10 = [b10, c10, e10, f10, g10, h10, k10, hHa(l10, false, true, this.ob), new CQ().Hb(this.ob), new DQ().Sx(this.un(), this.ob)]; + a10 = J5(a10, new Ib().ha(b10)); + b10 = (this.Iqa ? new z7().d(new jN().Hb(this.ob)) : y7()).ua(); + c10 = K7(); + this.Yj = a10.ia(b10, c10.u); + this.Ci = true; + } + return this.Yj; + }; + vQ.prototype.nu = function(a10, b10) { + this.Iqa = b10; + Wu.prototype.Hb.call(this, a10); + this.Ig = Pp().VI; + return this; + }; + function EQ() { + Wu.call(this); + this.Yj = null; + } + EQ.prototype = new Xu(); + EQ.prototype.constructor = EQ; + function iHa() { + } + iHa.prototype = EQ.prototype; + EQ.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + a10 = K7(); + var b10 = [this.OE(), dCa(new gN(), J5(DB(), H10()), this.ob), new wQ().rs(this.un(), false, this.ob), new xQ().rs(this.un(), false, this.ob), new yQ().Hb(this.ob), new zQ().Sx(this.un(), this.ob), new AQ().Sx(this.un(), this.ob), new BQ().rs(this.un(), false, this.ob), hHa(this.un(), false, false, this.ob), new CQ().Hb(this.ob), new DQ().Sx(this.un(), this.ob), new eN().Hb(this.ob), new fN().Hb(this.ob)]; + this.Yj = J5(a10, new Ib().ha(b10)); + return this; + }; + EQ.prototype.kC = function() { + return this.Yj; + }; + function rC() { + Wu.call(this); + this.Yj = this.ao = null; + } + rC.prototype = new Xu(); + rC.prototype.constructor = rC; + rC.prototype.kC = function() { + return this.Yj; + }; + rC.prototype.Sx = function(a10, b10) { + this.ao = a10; + Wu.prototype.Hb.call(this, b10); + b10 = K7(); + a10 = [new EB().mt(false, this.ob), dCa(new gN(), J5(DB(), H10()), this.ob), new wQ().rs(a10, false, this.ob), new xQ().rs(a10, false, this.ob), hHa(a10, true, false, this.ob), new CQ().Hb(this.ob), new DQ().Sx(a10, this.ob)]; + this.Yj = J5(b10, new Ib().ha(a10)); + return this; + }; + rC.prototype.$classData = r8({ xWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.ValidationResolutionPipeline", { xWa: 1, Qt: 1, f: 1 }); + function FQ() { + Wu.call(this); + this.Yj = this.oqa = null; + } + FQ.prototype = new Xu(); + FQ.prototype.constructor = FQ; + function jHa(a10, b10, c10) { + a10.oqa = c10; + Wu.prototype.Hb.call(a10, b10); + c10 = a10.oqa; + if (ok2().h(c10) || pk().h(c10) || qk().h(c10)) + b10 = new GQ().Hb(b10).Yj; + else if (lk().h(c10) || mk().h(c10) || nk().h(c10)) + b10 = new HQ().Hb(b10).Yj; + else { + c10 = dc().Fh; + var e10 = y7(), f10 = y7(), g10 = y7(); + b10.Gc(c10.j, "", e10, "No compatibility pipeline registered to target profile", f10, Yb().qb, g10); + b10 = H10(); + } + a10.Yj = b10; + return a10; + } + FQ.prototype.kC = function() { + return this.Yj; + }; + FQ.prototype.$classData = r8({ AWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.CompatibilityPipeline", { AWa: 1, Qt: 1, f: 1 }); + function HQ() { + Wu.call(this); + this.Yj = this.dW = null; + } + HQ.prototype = new Xu(); + HQ.prototype.constructor = HQ; + HQ.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + this.dW = new IQ().Hb(a10); + a10 = this.dW.Yj; + var b10 = K7(), c10 = [new JQ().Hb(this.ob), new kHa().Hb(this.ob), new KQ().Hb(this.ob), new LQ().Hb(this.ob), new MQ().Hb(this.ob), new NQ().Hb(this.ob), new OQ().Hb(this.ob)]; + b10 = J5(b10, new Ib().ha(c10)); + c10 = K7(); + this.Yj = a10.ia(b10, c10.u); + return this; + }; + HQ.prototype.kC = function() { + return this.Yj; + }; + HQ.prototype.$classData = r8({ BWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.OasCompatibilityPipeline", { BWa: 1, Qt: 1, f: 1 }); + function GQ() { + Wu.call(this); + this.Yj = this.dW = null; + } + GQ.prototype = new Xu(); + GQ.prototype.constructor = GQ; + GQ.prototype.Hb = function(a10) { + Wu.prototype.Hb.call(this, a10); + this.dW = new PQ().Hb(a10); + a10 = this.dW.Yj; + var b10 = K7(), c10 = [new QQ().Hb(this.ob), new RQ().Hb(this.ob), new SQ().Hb(this.ob), new TQ().Hb(this.ob), new UQ().Hb(this.ob), new VQ().Hb(this.ob), new WQ().Hb(this.ob), new lHa().Hb(this.ob), new XQ().Hb(this.ob), new YQ().Hb(this.ob), new ZQ().Hb(this.ob), new $Q().Hb(this.ob)]; + b10 = J5(b10, new Ib().ha(c10)); + c10 = K7(); + this.Yj = a10.ia(b10, c10.u); + return this; + }; + GQ.prototype.kC = function() { + return this.Yj; + }; + GQ.prototype.$classData = r8({ CWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.RamlCompatibilityPipeline", { CWa: 1, Qt: 1, f: 1 }); + function NQ() { + this.ob = null; + } + NQ.prototype = new gv(); + NQ.prototype.constructor = NQ; + NQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + NQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Ql) { + b10 = f10; + var g10 = new Uj().eq(false); + B6(b10.g, Pl().dc).U(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + var Y10 = B6(L10.g, rm2().Gh).Cb(w6(/* @__PURE__ */ function(pa, La) { + return function(ob) { + return wh(ob.x, q5(mHa)) ? (La.oa = true, false) : true; + }; + }(C10, I10))), ia = rm2().Gh; + return Zd(L10, ia, Y10); + }; + }(this, g10))); + if (g10.oa) { + O7(); + var h10 = new P6().a(), k10 = new Td().K(new S6().a(), h10), l10 = Ud().R, m10 = eb(k10, l10, "optionalSecurity"); + vs(); + var p10 = new z7().d(Uh().Mi), t10 = ts(0, "true", p10, (O7(), new P6().a())), v10 = Ud().zi, A10 = Vd(m10, v10, t10), D10 = Yd(nc()); + ig(b10, D10, A10); + } + } + } + return a10; + } catch (C10) { + if (null !== Ph(E6(), C10)) + return a10; + throw C10; + } + }; + NQ.prototype.$classData = r8({ DWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.CleanNullSecurity", { DWa: 1, ii: 1, f: 1 }); + function OQ() { + this.ob = null; + } + OQ.prototype = new gv(); + OQ.prototype.constructor = OQ; + OQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + OQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Wl) { + b10 = f10; + var g10 = B6(b10.g, cj().We).A, h10 = g10.b() || "body" !== g10.c().toLowerCase() ? g10 : y7(); + if (h10.b()) + var k10 = y7(); + else + h10.c(), k10 = Vb().Ia(B6(b10.g, cj().Jc)); + if (!k10.b()) { + var l10 = k10.c(); + new z7().d(it2(l10.Y(), Ag().Ec)); + } + } + } + return a10; + } catch (m10) { + if (null !== Ph(E6(), m10)) + return a10; + throw m10; + } + }; + OQ.prototype.$classData = r8({ EWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.CleanParameterExamples", { EWa: 1, ii: 1, f: 1 }); + function JQ() { + this.ob = null; + } + JQ.prototype = new gv(); + JQ.prototype.constructor = JQ; + JQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + JQ.prototype.ye = function(a10) { + if (a10 instanceof mf && a10.qe() instanceof Rm) + try { + var b10 = a10.qe(); + this.PS(b10, B6(b10.g, Qm().Gh), Qm().Gh); + for (var c10 = gC(), e10 = UB(), f10 = VB(a10, c10, e10); f10.Ya(); ) { + var g10 = f10.iq(); + g10 instanceof Ql && (b10 = g10, this.PS(b10, B6(b10.g, Pl().Gh), Pl().Gh)); + } + } catch (h10) { + if (null === Ph(E6(), h10)) + throw h10; + } + return a10; + }; + JQ.prototype.PS = function(a10, b10, c10) { + var e10 = J5(K7(), new Ib().ha(["HTTP", "HTTPS"])), f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.A.ua(); + }; + }(this)), g10 = K7(); + b10 = b10.bd(f10, g10.u).Cb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return p10.toLowerCase() === (null === t10 ? null : t10.toLowerCase()); + }; + }(h10, l10))); + }; + }(this, e10))); + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.toLowerCase(); + }; + }(this)); + f10 = K7(); + b10 = b10.ka(e10, f10.u); + it2(a10.Y(), c10); + b10.Da() && Wr(a10, c10, b10); + }; + JQ.prototype.$classData = r8({ FWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.LowercaseSchemes", { FWa: 1, ii: 1, f: 1 }); + function KQ() { + this.ob = null; + this.$P = 0; + } + KQ.prototype = new gv(); + KQ.prototype.constructor = KQ; + KQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + this.$P = 0; + return this; + }; + function nHa(a10, b10) { + B6(b10.g, Qm().Uv).U(w6(/* @__PURE__ */ function() { + return function(c10) { + var e10 = B6(c10.g, li().Pf); + if (oN(e10)) + return e10 = li().Pf, eb(c10, e10, "http://"); + }; + }(a10))); + } + KQ.prototype.ye = function(a10) { + if (a10 instanceof mf && a10.qe() instanceof Rm) + try { + nHa(this, a10.qe()); + } catch (b10) { + if (null === Ph(E6(), b10)) + throw b10; + } + return a10; + }; + KQ.prototype.$classData = r8({ GWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.MandatoryDocumentationUrl", { GWa: 1, ii: 1, f: 1 }); + function MQ() { + this.ob = null; + } + MQ.prototype = new gv(); + MQ.prototype.constructor = MQ; + MQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + MQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Wl) { + b10 = f10; + var g10 = B6(b10.g, cj().We); + if (xb(g10, "path")) { + var h10 = cj().yj; + Bi(b10, h10, true); + } + } + } + return a10; + } catch (k10) { + if (Ph(E6(), k10) instanceof nb) + return a10; + throw k10; + } + }; + MQ.prototype.$classData = r8({ HWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.MandatoryPathParameters", { HWa: 1, ii: 1, f: 1 }); + function LQ() { + this.ob = null; + } + LQ.prototype = new gv(); + LQ.prototype.constructor = LQ; + LQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + LQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Ql && (b10 = f10, B6(b10.g, Pl().Al).b())) { + var g10 = K7(); + O7(); + var h10 = new P6().a(), k10 = new Em().K(new S6().a(), h10); + O7(); + var l10 = new P6().a(), m10 = Sd(k10, "200", l10), p10 = Dm().In, t10 = eb(m10, p10, "200"), v10 = zD().Va, A10 = [eb(t10, v10, "")], D10 = J5(g10, new Ib().ha(A10)), C10 = Pl().Al; + Zd(b10, C10, D10); + } + } + return a10; + } catch (I10) { + if (Ph(E6(), I10) instanceof nb) + return a10; + throw I10; + } + }; + LQ.prototype.$classData = r8({ IWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.MandatoryResponses", { IWa: 1, ii: 1, f: 1 }); + function kHa() { + this.ob = null; + } + kHa.prototype = new gv(); + kHa.prototype.constructor = kHa; + d7 = kHa.prototype; + d7.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + d7.N0 = function(a10, b10) { + if (B6(a10.g, Xh().Tl).Da()) { + var c10 = aR().Ny; + eb(b10, c10, "query"); + a10 = B6(a10.g, Xh().Tl).ga(); + a10 = B6(a10.Y(), a10.Zg()).A; + a10 = a10.b() ? null : a10.c(); + c10 = aR().R; + eb(b10, c10, a10); + } else + B6(a10.g, Xh().Tf).Da() ? (c10 = aR().Ny, eb(b10, c10, "header"), a10 = B6(a10.g, Xh().Tf).ga(), a10 = B6(a10.Y(), a10.Zg()).A, a10 = a10.b() ? null : a10.c(), c10 = aR().R, eb(b10, c10, a10)) : (a10 = aR().Ny, eb(b10, a10, "query"), a10 = aR().R, eb(b10, a10, "")); + }; + d7.z$ = function(a10) { + a10.tk().U(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + c10 instanceof vm && b10.A$(c10); + }; + }(this))); + }; + d7.A$ = function(a10) { + var b10 = B6(a10.g, Xh().Oh); + if (b10 instanceof wE) { + if (B6(b10.g, xE().Ap).b()) { + a10 = B6(b10.g, xE().Gy).ga().Bu(); + a10 = a10.b() ? "implicit" : a10.c(); + a10 = "authorization_code" === a10 ? "accessCode" : "password" === a10 ? "password" : "implicit" === a10 ? "implicit" : "client_credentials" === a10 ? "application" : "implicit"; + var c10 = oHa(b10), e10 = Jm().Wv; + eb(c10, e10, a10); + } + b10 = B6(b10.g, xE().Ap).ga(); + a10 = B6(b10.g, Jm().Wv).A; + a10 = a10.b() ? null : a10.c(); + "implicit" === a10 ? (B6(b10.g, Jm().km).A.b() && (a10 = Jm().km, eb(b10, a10, "http://")), it2(b10.g, Jm().vq)) : "accessCode" === a10 ? (B6(b10.g, Jm().km).A.b() && (a10 = Jm().km, eb(b10, a10, "http://")), B6(b10.g, Jm().vq).A.b() && (a10 = Jm().vq, eb(b10, a10, "http://"))) : "password" === a10 ? (B6(b10.g, Jm().vq).A.b() && (a10 = Jm().vq, eb(b10, a10, "http://")), it2(b10.g, Jm().km)) : "application" === a10 && (B6(b10.g, Jm().vq).A.b() && (a10 = Jm().vq, eb(b10, a10, "http://")), it2(b10.g, Jm().km)); + B6(b10.g, Jm().lo).b() && (a10 = K7(), O7(), c10 = new P6().a(), c10 = new Hm().K(new S6().a(), c10), e10 = Gm().R, c10 = eb(c10, e10, "*"), e10 = Gm().Va, c10 = [eb(c10, e10, "")], a10 = J5(a10, new Ib().ha(c10)), c10 = Jm().lo, Zd(b10, c10, a10)); + } else + b10 instanceof bR ? this.N0(a10, b10) : (null === b10 ? (b10 = B6(a10.g, Xh().Hf).A, b10 = b10.b() ? "" : b10.c(), b10 = null !== b10 && ra(b10, "x-amf-apiKey")) : b10 = false, b10 && this.N0(a10, a10.mQ())); + }; + d7.ye = function(a10) { + if (Zc(a10)) + try { + this.z$(a10); + } catch (b10) { + if (null === Ph(E6(), b10)) + throw b10; + } + return a10; + }; + d7.$classData = r8({ JWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.oas.SecuritySettingsMapper", { JWa: 1, ii: 1, f: 1 }); + function WQ() { + this.ob = null; + } + WQ.prototype = new gv(); + WQ.prototype.constructor = WQ; + WQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + WQ.prototype.ye = function(a10) { + if (a10 instanceof mf && a10.qe() instanceof Rm) + try { + var b10 = a10.qe(); + this.PS(b10, B6(b10.g, Qm().Gh), Qm().Gh); + for (var c10 = gC(), e10 = UB(), f10 = VB(a10, c10, e10); f10.Ya(); ) { + var g10 = f10.iq(); + g10 instanceof Ql && (b10 = g10, this.PS(b10, B6(b10.g, Pl().Gh), Pl().Gh)); + } + } catch (h10) { + if (null === Ph(E6(), h10)) + throw h10; + } + return a10; + }; + WQ.prototype.PS = function(a10, b10, c10) { + var e10 = J5(K7(), new Ib().ha(["http", "https"])), f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.A.ua(); + }; + }(this)), g10 = K7(); + b10 = b10.bd(f10, g10.u).Cb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return p10.toLowerCase() === (null === t10 ? null : t10.toLowerCase()); + }; + }(h10, l10))); + }; + }(this, e10))); + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.toUpperCase(); + }; + }(this)); + f10 = K7(); + b10 = b10.ka(e10, f10.u); + it2(a10.Y(), c10); + b10.Da() && Wr(a10, c10, b10); + }; + WQ.prototype.$classData = r8({ KWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.CapitalizeSchemes", { KWa: 1, ii: 1, f: 1 }); + function YQ() { + this.ob = null; + } + YQ.prototype = new gv(); + YQ.prototype.constructor = YQ; + YQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + YQ.prototype.ye = function(a10) { + try { + var b10 = Px().Zca, c10 = w6(/* @__PURE__ */ function() { + return function(h10) { + O7(); + var k10 = new P6().a(); + k10 = new Pd().K(new S6().a(), k10); + h10 = "amf-" + h10; + O7(); + var l10 = new P6().a(); + k10 = Sd(k10, h10, l10); + O7(); + h10 = new P6().a(); + l10 = new S6().a(); + h10 = new vh().K(l10, h10); + l10 = Sk().Jc; + return Vd(k10, l10, h10); + }; + }(this)), e10 = qe2(), f10 = re4(e10), g10 = Jd(b10, c10, f10); + return Zc(a10) ? (g10.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = Af().Ic; + return ig(k10, m10, l10); + }; + }(this, a10))), a10) : a10; + } catch (h10) { + if (null !== Ph(E6(), h10)) + return a10; + throw h10; + } + }; + YQ.prototype.$classData = r8({ LWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.CustomAnnotationDeclaration", { LWa: 1, ii: 1, f: 1 }); + function TQ() { + this.ob = null; + } + TQ.prototype = new gv(); + TQ.prototype.constructor = TQ; + TQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + TQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof ym) { + b10 = f10; + var g10 = B6(b10.g, xm().Nd); + if (oN(g10)) { + var h10 = xm().Nd; + eb(b10, h10, "*/*"); + } + } + } + } catch (k10) { + if (null === Ph(E6(), k10)) + throw k10; + } + return a10; + }; + TQ.prototype.$classData = r8({ MWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.DefaultPayloadMediaType", { MWa: 1, ii: 1, f: 1 }); + function UQ() { + this.ob = null; + } + UQ.prototype = new gv(); + UQ.prototype.constructor = UQ; + UQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function pHa(a10, b10) { + var c10 = B6(b10.g, Pl().Al).Fb(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, Dm().In).A; + return "default" === (h10.b() ? null : h10.c()); + }; + }(a10))); + if (c10 instanceof z7) + if (c10 = c10.i, b10 = B6(b10.g, Pl().Al).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function() { + return function(h10, k10) { + var l10 = B6(k10.g, Dm().In).A; + return h10.Wh(l10.b() ? null : l10.c(), k10); + }; + }(a10))), a10 = J5(K7(), new Ib().ha(["200", "500"])).Fb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.Ja(l10).b(); + }; + }(a10, b10))), a10 instanceof z7) + b10 = a10.i, a10 = Dm().In, eb(c10, a10, b10); + else { + a10 = 501; + for (var e10 = false; !e10 && 600 > a10; ) + if (b10.Ja("" + a10).b()) { + e10 = true; + var f10 = "" + a10, g10 = Dm().In; + eb(c10, g10, f10); + } else + a10 = 1 + a10 | 0; + } + } + UQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + f10 instanceof Ql && pHa(this, f10); + } + } catch (g10) { + if (null === Ph(E6(), g10)) + throw g10; + } + return a10; + }; + UQ.prototype.$classData = r8({ NWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.DefaultToNumericDefaultResponse", { NWa: 1, ii: 1, f: 1 }); + function VQ() { + this.ob = null; + } + VQ.prototype = new gv(); + VQ.prototype.constructor = VQ; + VQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + VQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof en) { + b10 = f10; + var g10 = ag().Fq; + Bi(b10, g10, false); + } + } + } catch (h10) { + if (null === Ph(E6(), h10)) + throw h10; + } + return a10; + }; + VQ.prototype.$classData = r8({ OWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.MakeExamplesOptional", { OWa: 1, ii: 1, f: 1 }); + function SQ() { + this.ob = null; + this.N_ = 0; + } + SQ.prototype = new gv(); + SQ.prototype.constructor = SQ; + SQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + this.N_ = 0; + return this; + }; + function qHa(a10) { + if (Vb().Ia(B6(a10.g, Sk().Jc)).b()) { + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new vh().K(c10, b10); + c10 = Sk().Jc; + Vd(a10, c10, b10); + } + return a10; + } + SQ.prototype.ye = function(a10) { + try { + if (a10 instanceof mf) + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Td) { + b10 = f10; + var g10 = Vb().Ia(B6(b10.g, Ud().ig)); + if (g10 instanceof z7) + var h10 = qHa(g10.i); + else { + if (y7() !== g10) + throw new x7().d(g10); + this.N_ = 1 + this.N_ | 0; + O7(); + var k10 = new P6().a(), l10 = new Pd().K(new S6().a(), k10); + MH(); + var m10 = Lc(a10), p10 = Rd(l10, "" + m10 + ("#genAnnotation" + this.N_)), t10 = B6(b10.g, Ud().R).A, v10 = t10.b() ? null : t10.c(); + O7(); + var A10 = new P6().a(), D10 = Sd(p10, v10, A10); + O7(); + var C10 = new P6().a(), I10 = new S6().a(), L10 = new vh().K(I10, C10), Y10 = Sk().Jc, ia = Vd(D10, Y10, L10), pa = Ud().ig; + Vd(b10, pa, ia); + h10 = ia; + } + if (!ar(a10.Y(), Gk().Ic).Od(w6(/* @__PURE__ */ function(ob, zb) { + return function(Zb) { + return Zb.j === zb.j; + }; + }(this, h10)))) { + var La = Af().Ic; + ig(a10, La, h10); + } + } + } + } catch (ob) { + if (null === Ph(E6(), ob)) + throw ob; + } + return a10; + }; + SQ.prototype.$classData = r8({ PWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.MandatoryAnnotationType", { PWa: 1, ii: 1, f: 1 }); + function QQ() { + this.ob = null; + this.$P = 0; + } + QQ.prototype = new gv(); + QQ.prototype.constructor = QQ; + QQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + this.$P = 0; + return this; + }; + function rHa(a10, b10) { + B6(b10.g, Qm().R).A.b() && sHa(b10); + B6(b10.g, Qm().Uv).U(w6(/* @__PURE__ */ function() { + return function(c10) { + var e10 = B6(c10.g, li().Kn); + if (oN(e10)) + if (e10 = B6(c10.g, li().Pf).A, e10 instanceof z7) { + e10 = e10.i; + var f10 = li().Kn; + eb(c10, f10, e10); + } else + e10 = li().Kn, eb(c10, e10, "generated"); + return it2(c10.g, li().Pf); + }; + }(a10))); + ar(b10.g, Qm().Xm).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (Vb().Ia(ar(e10.g, dj().Sf)).na()) { + var f10 = B6(e10.g, dj().R).A; + f10.b() ? (c10.$P = 1 + c10.$P | 0, f10 = "Tag " + c10.$P + " documentation") : f10 = f10.c(); + e10 = ar(e10.g, dj().Sf); + var g10 = li().Kn; + eb(e10, g10, f10); + } + }; + }(a10))); + } + QQ.prototype.ye = function(a10) { + if (a10 instanceof mf && a10.qe() instanceof Rm) + try { + rHa(this, a10.qe()); + } catch (b10) { + if (null === Ph(E6(), b10)) + throw b10; + } + return a10; + }; + function sHa(a10) { + var b10 = B6(a10.g, Qm().R); + oN(b10) && (O7(), b10 = new P6().a(), Sd(a10, "generated", b10)); + } + QQ.prototype.$classData = r8({ QWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.MandatoryDocumentationTitle", { QWa: 1, ii: 1, f: 1 }); + function ZQ() { + this.ob = null; + } + ZQ.prototype = new gv(); + ZQ.prototype.constructor = ZQ; + ZQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function tHa(a10, b10) { + if (1 === B6(b10.g, Jl().bk).jb() && Vb().Ia(AD(B6(b10.g, Jl().bk).ga())).na()) { + var c10 = B6(b10.g, Jl().bk).ga(), e10 = B6(AD(c10).g, Am().Zo); + e10.Da() && (it2(AD(c10).g, Am().Zo), a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + var g10 = cj().yj; + return Bi(f10, g10, true); + }; + }(a10)), c10 = K7(), e10 = e10.ka(a10, c10.u), a10 = Jl().Wm, Zd(b10, a10, e10)); + } + } + ZQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + f10 instanceof Kl && tHa(this, f10); + } + } catch (g10) { + if (null === Ph(E6(), g10)) + throw g10; + } + return a10; + }; + ZQ.prototype.$classData = r8({ RWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.PushSingleOperationPathParams", { RWa: 1, ii: 1, f: 1 }); + function RQ() { + this.ob = null; + } + RQ.prototype = new gv(); + RQ.prototype.constructor = RQ; + RQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + RQ.prototype.ye = function(a10) { + return a10; + }; + RQ.prototype.$classData = r8({ SWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.SanitizeCustomTypeNames", { SWa: 1, ii: 1, f: 1 }); + function lHa() { + this.ob = null; + } + lHa.prototype = new gv(); + lHa.prototype.constructor = lHa; + d7 = lHa.prototype; + d7.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + d7.N0 = function(a10, b10) { + var c10 = B6(b10.g, aR().Ny).A; + c10 = c10.b() ? null : c10.c(); + if ("query" === c10) { + b10 = B6(b10.g, aR().R).A; + b10 = a10.K3(b10.b() ? "default" : b10.c()); + O7(); + c10 = new P6().a(); + var e10 = new S6().a(); + c10 = new vh().K(e10, c10); + e10 = cj().Jc; + Vd(b10, e10, c10); + } else + "header" === c10 && (b10 = B6(b10.g, aR().R).A, b10 = a10.lI(b10.b() ? "default" : b10.c()), O7(), c10 = new P6().a(), e10 = new S6().a(), c10 = new vh().K(e10, c10), e10 = cj().Jc, Vd(b10, e10, c10)); + it2(a10.g, Xh().Oh); + }; + d7.z$ = function(a10) { + a10.tk().U(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + c10 instanceof vm && b10.A$(c10); + }; + }(this))); + }; + d7.A$ = function(a10) { + var b10 = B6(a10.g, Xh().Oh); + if (b10 instanceof wE) { + if (B6(b10.g, xE().Gy).b()) { + a10 = J5(K7(), new Ib().ha(["implicit"])); + var c10 = xE().Gy; + Wr(b10, c10, a10); + } + a10 = B6(b10.g, xE().Ap).kc(); + b10 = a10.b() ? oHa(b10) : a10.c(); + B6(b10.g, Jm().vq).A.b() && (a10 = Jm().vq, eb(b10, a10, "")); + B6(b10.g, Jm().km).A.b() && (a10 = Jm().km, eb(b10, a10, "")); + } else + b10 instanceof bR && this.N0(a10, b10); + }; + d7.ye = function(a10) { + if (Zc(a10)) + try { + this.z$(a10); + } catch (b10) { + if (null === Ph(E6(), b10)) + throw b10; + } + return a10; + }; + d7.$classData = r8({ TWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.SecuritySettingsMapper", { TWa: 1, ii: 1, f: 1 }); + function XQ() { + this.ob = null; + } + XQ.prototype = new gv(); + XQ.prototype.constructor = XQ; + XQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + XQ.prototype.ye = function(a10) { + try { + for (var b10 = gC(), c10 = UB(), e10 = VB(a10, b10, c10); e10.Ya(); ) { + var f10 = e10.iq(); + if (f10 instanceof Mh) { + b10 = f10; + var g10 = ni(b10); + if (!oN(g10)) { + hz(); + var h10 = B6(b10.aa, Fg().af).A, k10 = Cma(0, h10.b() ? null : h10.c()), l10 = We(); + if (null === k10 || k10 !== l10) + var m10 = Xe(), p10 = !(null !== k10 && k10 === m10); + else + p10 = false; + if (p10) + var t10 = Ye(), v10 = !(null !== k10 && k10 === t10); + else + v10 = false; + if (v10) { + var A10 = Ue(), D10 = null !== k10 && k10 === A10 ? J5(K7(), new Ib().ha(["rfc3339", "rfc2616"])) : J5(K7(), new Ib().ha("int32 int64 int long float double int16 int8".split(" "))), C10 = ni(b10).A; + D10.Ha(C10.b() ? null : C10.c()) || it2( + b10.aa, + Fg().Fn + ); + } else + it2(b10.aa, Fg().Fn); + } + } + } + } catch (I10) { + if (null === Ph(E6(), I10)) + throw I10; + } + return a10; + }; + XQ.prototype.$classData = r8({ UWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.ShapeFormatAdjuster", { UWa: 1, ii: 1, f: 1 }); + function $Q() { + this.ob = null; + } + $Q.prototype = new gv(); + $Q.prototype.constructor = $Q; + $Q.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + $Q.prototype.ye = function(a10) { + try { + var b10 = J5(Ef(), H10()), c10 = new qd().d(b10); + a10.tk().U(w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + return Dg(C10.oa, I10); + }; + }(this, c10))); + for (var e10 = new lC().ue(1), f10 = gC(), g10 = UB(), h10 = VB(a10, f10, g10); h10.Ya(); ) { + var k10 = h10.iq(); + if (k10 instanceof Vh) { + b10 = k10; + var l10 = B6(b10.aa, xn().Le), m10 = w6(/* @__PURE__ */ function(D10, C10, I10) { + return function(L10) { + a: { + for (var Y10 = C10.oa.Dc; !Y10.b(); ) { + if (Y10.ga().j === L10.j) { + Y10 = new z7().d(Y10.ga()); + break a; + } + Y10 = Y10.ta(); + } + Y10 = y7(); + } + if (Y10 instanceof z7 && (Y10 = Y10.i, Y10 instanceof rf && B6(Y10.Y(), qf().R).A.na())) + return L10 = B6(Y10.Y(), qf().R).A, L10.b() ? null : L10.c(); + if (B6(L10.Y(), qf().R).A.b()) { + Y10 = "GenShape" + I10.oa; + I10.oa = 1 + I10.oa | 0; + O7(); + var ia = new P6().a(); + Sd(L10, Y10, ia); + } + Dg(C10.oa, L10); + return B6(L10.Y(), qf().R); + }; + }(this, c10, e10)), p10 = K7(), t10 = l10.ka(m10, p10.u); + b10.Xa.Lb(new eB().e(t10.Kg(" | "))); + } + } + var v10 = c10.oa, A10 = Af().Ic; + Bf(a10, A10, v10); + } catch (D10) { + if (null === Ph(E6(), D10)) + throw D10; + } + return a10; + }; + $Q.prototype.$classData = r8({ VWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.compatibility.raml.UnionsAsTypeExpressions", { VWa: 1, ii: 1, f: 1 }); + function cR() { + qB.call(this); + this.LP = null; + } + cR.prototype = new Yna(); + cR.prototype.constructor = cR; + cR.prototype.rs = function(a10, b10, c10) { + qB.prototype.rs.call(this, a10, b10, c10); + this.LP = zoa().Fqa; + return this; + }; + cR.prototype.Spa = function(a10, b10, c10, e10, f10) { + c10.wb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10) { + return function(p10) { + g10.pn && p10.fa().Lb(new rB().Uq(h10, k10)); + return ig(l10, m10, p10); + }; + }(this, e10, f10, a10, b10))); + }; + cR.prototype.Aw = function() { + return this.ob; + }; + cR.prototype.$classData = r8({ lXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtensionResolutionStage", { lXa: 1, hXa: 1, f: 1 }); + function IB() { + } + IB.prototype = new xoa(); + IB.prototype.constructor = IB; + IB.prototype.a = function() { + return this; + }; + IB.prototype.C8 = function() { + return true; + }; + IB.prototype.via = function() { + return true; + }; + IB.prototype.$classData = r8({ rXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.MergingRestrictions$$anon$1", { rXa: 1, pXa: 1, f: 1 }); + function JB() { + this.lja = this.uia = this.w_ = null; + } + JB.prototype = new xoa(); + JB.prototype.constructor = JB; + JB.prototype.a = function() { + var a10 = K7(); + IAa || (IAa = new fM().a()); + var b10 = IAa.R; + HAa || (HAa = new eM().a()); + var c10 = HAa.R; + GAa || (GAa = new dM().a()); + var e10 = GAa.Zc, f10 = qf().Zc; + FAa || (FAa = new cM().a()); + var g10 = FAa.Va; + uHa || (uHa = new dR().a()); + var h10 = uHa.Sf, k10 = dj().Sf, l10 = Qm().Uv, m10 = Bq().ae; + vHa || (vHa = new eR().a()); + b10 = [b10, c10, e10, f10, g10, h10, k10, l10, m10, vHa.Ec, Yd(nc())]; + this.w_ = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = [Jl().Uf, Pl().pm, Dm().In, xm().Nd]; + this.uia = J5(a10, new Ib().ha(b10)); + a10 = K7(); + b10 = [Qm().lh]; + this.lja = J5(a10, new Ib().ha(b10)); + return this; + }; + JB.prototype.C8 = function(a10) { + return this.w_.Ha(a10); + }; + JB.prototype.via = function(a10) { + return a10.ba instanceof zB ? this.w_.Ha(a10) || this.uia.Ha(a10) : this.w_.Ha(a10) || !this.lja.Ha(a10); + }; + JB.prototype.$classData = r8({ sXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.MergingRestrictions$$anon$2", { sXa: 1, pXa: 1, f: 1 }); + function fR() { + qB.call(this); + this.LP = null; + } + fR.prototype = new Yna(); + fR.prototype.constructor = fR; + fR.prototype.rs = function(a10, b10, c10) { + qB.prototype.rs.call(this, a10, b10, c10); + this.LP = zoa().Gna; + return this; + }; + fR.prototype.Spa = function(a10, b10, c10, e10, f10) { + c10 = c10.wb; + e10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + g10.pn && l10.fa().Lb(new rB().Uq(h10, k10)); + return l10; + }; + }(this, e10, f10)); + f10 = K7(); + c10 = c10.ka(e10, f10.u); + Zd(a10, b10, c10); + }; + fR.prototype.Aw = function() { + return this.ob; + }; + fR.prototype.$classData = r8({ tXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.OverlayResolutionStage", { tXa: 1, hXa: 1, f: 1 }); + function gR() { + } + gR.prototype = new u7(); + gR.prototype.constructor = gR; + gR.prototype.a = function() { + return this; + }; + function wHa(a10, b10, c10, e10) { + a10 = c10.FV.c(); + var f10 = c10.Ld, g10 = y7(), h10 = y7(), k10 = y7(), l10 = y7(), m10 = y7(), p10 = y7(), t10 = y7(), v10 = y7(), A10 = y7(), D10 = y7(), C10 = y7(), I10 = y7(), L10 = y7(), Y10 = J5(K7(), H10()); + K7(); + pj(); + var ia = new Lf().a(); + b10 = EO(a10, b10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia.ua(), y7(), y7()); + e10 = ic(e10); + if ("http://www.w3.org/ns/shacl#minCount" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, c10, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#maxCount" === e10) + return c10 = new z7().d(c10.r), EO( + b10.Jj, + b10.$, + b10.Ld, + b10.hh, + b10.Gr, + c10, + b10.kl, + b10.Lp, + b10.gq, + b10.Ak, + b10.yk, + b10.Bk, + b10.zk, + b10.hq, + b10.Ca, + b10.Dj, + b10.fn, + b10.hn, + b10.Cj, + b10.Mq + ); + if ("http://www.w3.org/ns/shacl#pattern" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, c10, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#minExclusive" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, c10, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#maxExclusive" === e10) + return c10 = new z7().d(c10.r), EO( + b10.Jj, + b10.$, + b10.Ld, + b10.hh, + b10.Gr, + b10.Kp, + b10.kl, + b10.Lp, + b10.gq, + b10.Ak, + c10, + b10.Bk, + b10.zk, + b10.hq, + b10.Ca, + b10.Dj, + b10.fn, + b10.hn, + b10.Cj, + b10.Mq + ); + if ("http://www.w3.org/ns/shacl#minInclusive" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, c10, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#maxInclusive" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, c10, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#minLength" === e10) + return c10 = new z7().d(c10.r), EO( + b10.Jj, + b10.$, + b10.Ld, + b10.hh, + b10.Gr, + b10.Kp, + b10.kl, + c10, + b10.gq, + b10.Ak, + b10.yk, + b10.Bk, + b10.zk, + b10.hq, + b10.Ca, + b10.Dj, + b10.fn, + b10.hn, + b10.Cj, + b10.Mq + ); + if ("http://www.w3.org/ns/shacl#maxLength" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, c10, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#in" === e10) + return Gb(), c10 = c10.r, c10 = mD(0, Mc(ua(), c10, "\\s*,\\s*")), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, b10.fn, c10, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#node" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, c10, b10.Dj, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#datatype" === e10) + return c10 = new z7().d(c10.r), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, c10, b10.fn, b10.hn, b10.Cj, b10.Mq); + if ("http://www.w3.org/ns/shacl#class" === e10) + return c10 = J5(K7(), new Ib().ha([c10.r])), EO(b10.Jj, b10.$, b10.Ld, b10.hh, b10.Gr, b10.Kp, b10.kl, b10.Lp, b10.gq, b10.Ak, b10.yk, b10.Bk, b10.zk, b10.hq, b10.Ca, b10.Dj, c10, b10.hn, b10.Cj, b10.Mq); + throw mb(E6(), new nb().e("Unsupported constraint " + c10.gu)); + } + function xHa(a10, b10) { + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + var f10 = e10.Gea; + if (f10 instanceof z7) + f10 = f10.i.trim(); + else if (hR(), f10 = e10.Gea, f10 instanceof z7) + f10 = f10.i, f10 = ic($v(F6(), f10.trim())); + else if (y7() === f10) { + f10 = Gca(e10.fca, "domain"); + var g10 = Gca(e10.FV, "property"), h10 = new z7().d(e10.gu); + h10 = Gca(h10, "constraint"); + f10 = "" + F6().xF.he + f10 + "-" + g10.trim() + "-" + h10.trim(); + } else + throw new x7().d(f10); + g10 = e10.Ld; + g10 = g10.b() ? "" : g10.c(); + h10 = new z7().d(e10.toa); + var k10 = new z7().d(e10.Hna), l10 = K7(), m10 = e10.fca; + m10.b() ? (m10 = F6().Zd, m10 = ic(G5(m10, "DomainElement"))) : m10 = m10.c(); + l10 = J5(l10, new Ib().ha([m10])); + oj(); + K7(); + pj(); + m10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var p10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var t10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var v10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var A10 = new Lf().a().ua(); + oj(); + var D10 = y7(); + oj(); + K7(); + pj(); + var C10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var I10 = new Lf().a().ua(); + oj(); + var L10 = y7(); + oj(); + var Y10 = y7(); + oj(); + var ia = y7(); + g10 = qj(new rj(), f10, g10, h10, k10, m10, l10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia); + h10 = ic($v(F6(), e10.Yk.trim())); + if ("http://www.w3.org/ns/shacl#path" === h10) + return -1 !== (e10.gu.trim().indexOf("#") | 0) ? (h10 = e10.gu.trim(), h10 = Mc(ua(), h10, "#"), k10 = F6(), l10 = zj(new Pc().fd(h10)), k10 = ("http://a.ml/vocabularies/document" === l10 ? new z7().d(k10.Zd) : "http://a.ml/vocabularies/apiContract" === l10 ? new z7().d(k10.Ta) : "http://a.ml/vocabularies/apiBinding" === l10 ? new z7().d(k10.Jb) : "http://a.ml/vocabularies/security" === l10 ? new z7().d(k10.dc) : "http://a.ml/vocabularies/shapes" === l10 ? new z7().d(k10.Eb) : "http://a.ml/vocabularies/data" === l10 ? new z7().d(k10.Pg) : "http://a.ml/vocabularies/document-source-maps" === l10 ? new z7().d(k10.ez) : "http://www.w3.org/ns/shacl" === l10 ? new z7().d(k10.Ua) : "http://a.ml/vocabularies/core#" === l10 ? new z7().d(k10.Tb) : "http://www.w3.org/2001/XMLSchema" === l10 ? new z7().d(k10.Bj) : "http://a.ml/vocabularies/shapes/anon" === l10 ? new z7().d(k10.Jfa) : "http://www.w3.org/1999/02/22-rdf-syntax-ns" === l10 ? new z7().d(k10.Qi) : "" === l10 ? new z7().d(k10.nia) : "http://a.ml/vocabularies/meta" === l10 ? new z7().d(k10.$c) : "http://www.w3.org/2002/07/owl" === l10 ? new z7().d(k10.bv) : "http://www.w3.org/2000/01/rdf-schema" === l10 ? new z7().d(k10.Ul) : "http://a.ml/vocabularies/amf/parser" === l10 ? new z7().d(k10.xF) : y7()).c(), h10 = Oc(new Pc().fd(h10)), h10 = G5(k10, h10)) : h10 = $v(F6(), e10.gu), null !== h10 && (k10 = h10.yu, l10 = F6().Ua, null === l10 ? null === k10 : l10.h(k10)) ? (k10 = K7(), e10 = [wHa(hR(), f10 + "/prop", e10, h10)], e10 = J5(k10, new Ib().ha(e10)), qj(new rj(), g10.$, g10.Ld, g10.yv, g10.vv, g10.At, g10.Hv, g10.Jv, g10.vy, g10.Lx, g10.xy, g10.jy, e10, g10.QB, g10.Iz, g10.Bw, g10.Cj)) : null !== h10 && (f10 = h10.yu, k10 = F6().Eb, null === k10 ? null === f10 : k10.h(f10)) ? (e10 = Vb().Ia(yHa(hR(), e10, h10)), qj(new rj(), g10.$, g10.Ld, g10.yv, g10.vv, g10.At, g10.Hv, g10.Jv, g10.vy, g10.Lx, g10.xy, g10.jy, g10.my, g10.QB, g10.Iz, e10, g10.Cj)) : g10; + if ("http://www.w3.org/ns/shacl#targetObjectsOf" === h10 && e10.FV.na()) + return f10 = K7(), h10 = [e10.FV.c()], f10 = J5(f10, new Ib().ha(h10)), h10 = K7(), e10 = [new iR().Hc(e10.gu, e10.r)], e10 = J5(h10, new Ib().ha(e10)), qj(new rj(), g10.$, g10.Ld, g10.yv, g10.vv, g10.At, g10.Hv, f10, g10.vy, g10.Lx, g10.xy, g10.jy, g10.my, e10, g10.Iz, g10.Bw, g10.Cj); + throw mb(E6(), new nb().e("Unknown validation target " + e10.Yk)); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + function yHa(a10, b10, c10) { + a10 = b10.Ld; + b10 = y7(); + Koa || (Koa = new cC().a()); + var e10 = Koa.TT.Ja(c10.$); + c10 = new z7().d(c10.$); + var f10 = J5(K7(), H10()), g10 = J5(K7(), H10()); + return zHa(a10, e10, f10, b10, g10, c10); + } + function fpa() { + var a10 = hR(); + Aoa || (Aoa = new KB().a()); + var b10 = Aoa.X; + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(), h10 = f10.ya(); + f10 = xHa(hR(), h10.Cb(w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.gC === Yb().qb; + }; + }(e10)))); + var k10 = xHa(hR(), h10.Cb(w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.gC === Yb().zx; + }; + }(e10)))); + h10 = xHa(hR(), h10.Cb(w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.gC === Yb().dh; + }; + }(e10)))); + var l10 = FO().Bf; + ii(); + for (var m10 = new Lf().a(); !l10.b(); ) { + var p10 = l10.ga(), t10 = p10; + jR(FO(), t10.j, g10) === Yb().qb !== false && Dg(m10, p10); + l10 = l10.ta(); + } + l10 = m10.ua(); + m10 = /* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10); + p10 = ii().u; + if (p10 === ii().u) + if (l10 === H10()) + m10 = H10(); + else { + p10 = l10.ga(); + t10 = p10 = ji(m10(p10), H10()); + for (l10 = l10.ta(); l10 !== H10(); ) { + var v10 = l10.ga(); + v10 = ji(m10(v10), H10()); + t10 = t10.Nf = v10; + l10 = l10.ta(); + } + m10 = p10; + } + else { + for (p10 = se4(l10, p10); !l10.b(); ) + t10 = l10.ga(), p10.jd(m10(t10)), l10 = l10.ta(); + m10 = p10.Rc(); + } + p10 = FO().Bf; + ii(); + for (l10 = new Lf().a(); !p10.b(); ) + v10 = t10 = p10.ga(), jR(FO(), v10.j, g10) === Yb().zx !== false && Dg(l10, t10), p10 = p10.ta(); + p10 = l10.ua(); + l10 = /* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10); + t10 = ii().u; + if (t10 === ii().u) + if (p10 === H10()) + p10 = H10(); + else { + t10 = p10.ga(); + v10 = t10 = ji(l10(t10), H10()); + for (p10 = p10.ta(); p10 !== H10(); ) { + var A10 = p10.ga(); + A10 = ji(l10(A10), H10()); + v10 = v10.Nf = A10; + p10 = p10.ta(); + } + p10 = t10; + } + else { + for (t10 = se4(p10, t10); !p10.b(); ) + v10 = p10.ga(), t10.jd(l10(v10)), p10 = p10.ta(); + p10 = t10.Rc(); + } + t10 = FO().Bf; + ii(); + for (l10 = new Lf().a(); !t10.b(); ) + A10 = v10 = t10.ga(), jR(FO(), A10.j, g10) === Yb().dh !== false && Dg(l10, v10), t10 = t10.ta(); + t10 = l10.ua(); + l10 = /* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10); + v10 = ii().u; + if (v10 === ii().u) + if (t10 === H10()) + t10 = H10(); + else { + v10 = t10.ga(); + A10 = v10 = ji(l10(v10), H10()); + for (t10 = t10.ta(); t10 !== H10(); ) { + var D10 = t10.ga(); + D10 = ji(l10(D10), H10()); + A10 = A10.Nf = D10; + t10 = t10.ta(); + } + t10 = v10; + } + else { + for (v10 = se4(t10, v10); !t10.b(); ) + A10 = t10.ga(), v10.jd(l10(A10)), t10 = t10.ta(); + t10 = v10.Rc(); + } + l10 = kk(); + l10 = null !== g10 && g10.h(l10) ? y7() : new z7().d(kk()); + v10 = w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10)); + A10 = K7(); + v10 = k10.ka(v10, A10.u); + A10 = ii(); + p10 = p10.ia(v10, A10.u); + v10 = w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10)); + A10 = K7(); + v10 = h10.ka(v10, A10.u); + A10 = ii(); + t10 = t10.ia(v10, A10.u); + v10 = w6(/* @__PURE__ */ function() { + return function(C10) { + return C10.$; + }; + }(e10)); + A10 = K7(); + v10 = f10.ka(v10, A10.u); + A10 = ii(); + m10 = m10.ia(v10, A10.u); + v10 = K7(); + k10 = k10.ia(h10, v10.u); + h10 = K7(); + f10 = k10.ia(f10, h10.u); + k10 = FO().Bf; + h10 = K7(); + f10 = f10.ia(k10, h10.u); + K7(); + pj(); + k10 = new Lf().a().ua(); + h10 = new wu().a(); + return AEa(g10, l10, m10, p10, t10, k10, f10, h10); + } + throw new x7().d(f10); + }; + }(a10)); + var c10 = Id().u; + return Jd(b10, a10, c10).ua(); + } + gR.prototype.$classData = r8({ zXa: 0 }, false, "amf.plugins.document.webapi.validation.DefaultAMFValidations$", { zXa: 1, f: 1, dhb: 1 }); + var AHa = void 0; + function hR() { + AHa || (AHa = new gR().a()); + return AHa; + } + function kR() { + } + kR.prototype = new u7(); + kR.prototype.constructor = kR; + kR.prototype.a = function() { + return this; + }; + function Eca(a10) { + return "$url" === a10 || "$method" === a10 || "$statusCode" === a10 || (0 <= (a10.length | 0) && "$request." === a10.substring(0, 9) ? BHa(uza(ua(), a10, "\\$request.", "")) : 0 <= (a10.length | 0) && "$response." === a10.substring(0, 10) && BHa(uza(ua(), a10, "\\$response.", ""))); + } + function BHa(a10) { + var b10; + !(b10 = 0 <= (a10.length | 0) && "header." === a10.substring(0, 7) || 0 <= (a10.length | 0) && "query." === a10.substring(0, 6) || 0 <= (a10.length | 0) && "path." === a10.substring(0, 5)) && (b10 = 0 <= (a10.length | 0) && "body" === a10.substring(0, 4)) && (a10 = uza(ua(), a10, "body", ""), b10 = "" === a10 || 0 <= (a10.length | 0) && "#/" === a10.substring(0, 2)); + return b10; + } + kR.prototype.$classData = r8({ JXa: 0 }, false, "amf.plugins.document.webapi.validation.Oas3ExpressionValidator$", { JXa: 1, f: 1, chb: 1 }); + var CHa = void 0; + function Vra() { + CHa || (CHa = new kR().a()); + return CHa; + } + function lR() { + } + lR.prototype = new u7(); + lR.prototype.constructor = lR; + lR.prototype.a = function() { + return this; + }; + lR.prototype.m2 = function() { + return false; + }; + function DHa(a10, b10) { + return !b10.Od(w6(/* @__PURE__ */ function() { + return function(c10) { + return c10.zm === Yb().qb; + }; + }(a10))); + } + lR.prototype.RL = function(a10) { + return DHa(this, a10); + }; + lR.prototype.$classData = r8({ ZXa: 0 }, false, "amf.plugins.document.webapi.validation.remote.BooleanValidationProcessor$", { ZXa: 1, f: 1, gYa: 1 }); + var EHa = void 0; + function FHa() { + EHa || (EHa = new lR().a()); + return EHa; + } + function mR() { + this.vo = this.pa = null; + this.Xaa = false; + this.Qda = this.ns = null; + } + mR.prototype = new u7(); + mR.prototype.constructor = mR; + function GHa() { + } + GHa.prototype = mR.prototype; + function HHa(a10, b10, c10, e10) { + if (Iva().CP.Ha(b10)) + try { + if (a10.Xaa) + var f10 = new R6().M(y7(), y7()); + else { + if ("application/json" === b10) + var g10 = a10.Lea, h10 = wp(), k10 = !(null !== g10 && g10 === h10); + else + k10 = false; + if (k10) + var l10 = new R6().M(new z7().d(IHa(c10)), y7()); + else { + var m10 = new nR(); + if (null === a10) + throw mb(E6(), null); + m10.l = a10; + m10.Lz = ""; + m10.lj = 1; + m10.TD = J5(Ef(), H10()); + var p10 = new Yp(), t10 = H10(); + K7(); + pj(); + var v10 = new Lf().a(), A10 = new oR().il("", t10, new Aq().zo("", v10.ua(), new Mq().a(), Nq(), y7()), y7(), y7(), y7(), iA().ho); + if ("application/json" === b10) { + TG(); + var D10 = new RG(); + LF(); + var C10 = new SG().YG(ata( + cta(), + c10, + "" + ), vF().dl); + var I10 = wua(D10, C10, m10); + } else { + Rua(); + var L10 = Fta(Hta(), c10); + I10 = Pua(L10, m10); + } + var Y10 = Cj(I10).Fd; + Uf(); + if (JHa(Y10)) { + vs(); + var ia = y7(), pa = ts(0, c10, ia, (O7(), new P6().a())); + } else + pa = px(Y10, new ox().a(), y7(), new Nd().a(), A10).Fr(); + var La = Tf(0, pa, b10); + var ob = mfa(p10, La, m10.TD.ua()); + if (tc(ob.ll)) + Cc = false; + else + var zb = a10.Lea, Zb = wp(), Cc = null !== zb && zb === Zb; + if (Cc) { + a: { + var vc = tpa(), id = ob.vg, yd = a10.pa; + if (spa(0, yd) || rpa(vc, yd)) { + var zd = ar(id.g, sl().nb); + if (zd instanceof Vi) { + var rd = B6(zd.aa, Wi().af).A; + if (rd.b()) + Vc = false; + else + var sd = rd.c(), le4 = Uh().zj, Vc = sd === le4; + if (!Vc) { + Uf(); + vs(); + var Sc = B6(zd.aa, Wi().vf).A, Qc = ts(0, Sc.b() ? null : Sc.c(), new z7().d(Uh().zj), zd.Xa), $c = B6(id.g, sl().Nd).A; + var Wc = Tf(0, Qc, $c.b() ? null : $c.c()); + break a; + } + } + } + Wc = id; + } + var Qe = mfa(new Yp(), Wc, ob.ll); + } else + Qe = ob; + l10 = tc(Qe.ll) ? new R6().M(y7(), new z7().d(Qe)) : new R6().M(KHa(Qe.vg), new z7().d(Qe)); + } + f10 = l10; + } + return LHa(a10, f10, e10); + } catch (Qd) { + if (Qd instanceof pR) + return e10.m2(Qd, y7()); + throw Qd; + } + else + return a10 = K7(), b10 = "Unsupported payload media type '" + b10 + "', only " + Iva().CP.t() + " supported", c10 = Yb().qb, f10 = y7(), g10 = Ko().EF.j, h10 = y7(), k10 = y7(), b10 = [Xb(b10, c10, "", f10, g10, h10, k10, null)], e10.RL(J5(a10, new Ib().ha(b10))); + } + mR.prototype.xma = function(a10, b10) { + return nq(hp(), oq(/* @__PURE__ */ function(c10, e10, f10) { + return function() { + return !!HHa(c10, e10, f10, FHa()); + }; + }(this, a10, b10)), ml()); + }; + mR.prototype.D3 = function(a10, b10) { + return nq(hp(), oq(/* @__PURE__ */ function(c10, e10, f10) { + return function() { + var g10 = mj().Vp; + return HHa(c10, e10, f10, new qR().f1(g10)); + }; + }(this, a10, b10)), ml()); + }; + mR.prototype.Y6a = function(a10) { + this.pa = a10; + this.vo = Yb().qb; + this.Xaa = a10 instanceof Wh; + this.ns = fp(); + this.Qda = Rb(Ut(), H10()); + }; + mR.prototype.C3 = function(a10) { + return nq(hp(), oq(/* @__PURE__ */ function(b10, c10) { + return function() { + var e10 = mj().Vp; + e10 = new qR().f1(e10); + try { + var f10 = b10.Xaa ? new R6().M(y7(), y7()) : new R6().M(KHa(c10), new z7().d(mfa(new Yp(), c10, H10()))); + var g10 = LHa(b10, f10, e10); + } catch (h10) { + if (h10 instanceof pR) + g10 = e10.m2(h10, new z7().d(ar(c10.g, sl().nb))); + else + throw h10; + } + return g10; + }; + }(this, a10)), ml()); + }; + function LHa(a10, b10, c10) { + if (null !== b10) { + var e10 = b10.ya(); + if (e10 instanceof z7 && (e10 = e10.i, tc(e10.ll))) + return c10.RL(e10.ll); + } + if (null !== b10) { + e10 = b10.ma(); + var f10 = b10.ya(); + if (e10 instanceof z7) { + b10 = e10.i; + f10.b() ? e10 = y7() : (e10 = f10.c(), e10 = new z7().d(e10.vg)); + try { + if (a10.pa instanceof vh) { + var g10 = a10.pa, h10 = a10.Qda.Ja(g10.j); + if (h10 instanceof z7) { + var k10 = h10.i; + ue4(); + var l10 = new z7().d(k10); + var m10 = new ye4().d(l10); + } else { + O7(); + var p10 = new P6().a(), t10 = new ql().K(new S6().a(), p10); + Ui(t10.g, kea().nb, g10, (O7(), new P6().a())); + var v10 = kq(), A10 = new Dc(), D10 = new rR(), C10 = new gy().cU(Np(Op(), t10), Nga()); + D10.O0 = t10; + sR.prototype.U$.call( + D10, + t10, + C10 + ); + var I10 = uAa(v10, $q(A10, D10.fK(), y7())); + if (I10 instanceof z7) { + var L10 = IHa(ka(I10.i)); + LK().aC.call(L10, "x-amf-fragmentType") && delete L10["x-amf-fragmentType"]; + LK().aC.call(L10, "example") && delete L10.example; + LK().aC.call(L10, "examples") && delete L10.examples; + LK().aC.call(L10, "x-amf-examples") && delete L10["x-amf-examples"]; + ue4(); + var Y10 = new z7().d(L10); + var ia = new ye4().d(Y10); + } else if (y7() === I10) { + ue4(); + var pa = y7(); + ia = new ye4().d(pa); + } else + throw new x7().d(I10); + if (ia instanceof ye4) { + var La = ia.i; + if (!La.b()) { + var ob = La.c(); + a10.Qda.Ue(g10.j, ob); + } + ue4(); + m10 = new ye4().d(La); + } else if (ia instanceof ve4) { + var zb = ia.i; + ue4(); + m10 = new ve4().d(zb); + } else + throw new x7().d(ia); + } + } else { + ue4(); + var Zb = K7(), Cc = a10.vo, vc = new z7().d(a10.pa.j), id = Ko().EF.j, yd = Ab(a10.pa.fa(), q5(jd)), zd = a10.pa.Ib(), rd = [Xb("Cannot validate shape that is not an any shape", Cc, "", vc, id, yd, zd, null)], sd = c10.RL(J5(Zb, new Ib().ha(rd))); + m10 = new ve4().d(sd); + } + if (m10 instanceof ye4) { + var le4 = m10.i; + if (le4 instanceof z7) { + var Vc = le4.i; + a10 = e10; + var Sc = c10 === FHa(); + if (Sc) + var Qc = ppa().t$(); + else { + var $c = ppa(); + if (0 === (1 & $c.xa) << 24 >> 24 && 0 === (1 & $c.xa) << 24 >> 24) { + var Wc = mpa(), Qe = new (hpa())(gpa(Wc)).addMetaSchema(jpa()); + var Qd = kpa(Qe); + $c.uo = Qd; + $c.xa = (1 | $c.xa) << 24 >> 24; + } + Qc = $c.uo; + } + try { + var me4 = !!Qc.validate(Vc, b10); + if (Sc) + var of = me4; + else { + if (me4) + pf = H10(); + else { + var Le2 = Qc.errors; + Vc = void 0 === Le2 ? [] : Le2; + Sc = []; + me4 = 0; + for (var Ve = Vc.length | 0; me4 < Ve; ) { + var he4 = Vc[me4]; + Le2 = he4; + var Wf = Le2.dataPath; + Qc = Wf; + 0 <= (Qc.length | 0) && "." === Qc.substring(0, 1) && (Wf = uza(ua(), Wf, "\\.", "")); + var vf = (Wf + " " + Le2.message).trim(); + var He = Yb().qb; + if (a10.b()) + var Ff = y7(); + else { + var wf = a10.c(); + Ff = new z7().d(ar(wf.g, sl().nb).j); + } + var Re2 = Ff.b() ? "" : Ff.c(); + if (a10.b()) + var we4 = y7(); + else { + var ne4 = a10.c(); + we4 = new z7().d(ar(ne4.g, sl().nb).j); + } + var Me2 = Ko().EF.j, Se4 = a10.b() ? y7() : Ab(ar(a10.c().g, sl().nb).fa(), q5(jd)); + if (a10.b()) + var xf = y7(); + else { + var ie3 = ar(a10.c().g, sl().nb); + xf = yb(ie3); + } + var gf = Xb(vf, He, Re2, we4, Me2, Se4, xf, he4); + Sc.push(gf); + me4 = 1 + me4 | 0; + } + var pf = new Ib().ha(Sc); + } + of = c10.RL(pf); + } + } catch (oe4) { + var hf = Ph(E6(), oe4); + if (hf instanceof EK) { + if (a10.b()) + var Gf = y7(); + else { + var yf = a10.c(); + Gf = new z7().d(ar(yf.g, sl().nb)); + } + of = c10.m2(hf, Gf); + } else + throw oe4; + } + return of; + } + } + return m10 instanceof ve4 ? m10.i : c10.RL(H10()); + } catch (oe4) { + throw oe4; + } + } + } + return c10.RL(H10()); + } + function dR() { + this.Sf = null; + } + dR.prototype = new u7(); + dR.prototype.constructor = dR; + dR.prototype.a = function() { + uHa = this; + ki(this); + return this; + }; + dR.prototype.kw = function(a10) { + this.Sf = a10; + }; + dR.prototype.$classData = r8({ AYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.common.DocumentationField$", { AYa: 1, f: 1, Zu: 1 }); + var uHa = void 0; + function eR() { + this.Ec = null; + } + eR.prototype = new u7(); + eR.prototype.constructor = eR; + eR.prototype.a = function() { + vHa = this; + mi(this); + return this; + }; + eR.prototype.gv = function(a10) { + this.Ec = a10; + }; + eR.prototype.$classData = r8({ BYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.common.ExamplesField$", { BYa: 1, f: 1, Rt: 1 }); + var vHa = void 0; + function tR() { + } + tR.prototype = new u7(); + tR.prototype.constructor = tR; + tR.prototype.a = function() { + return this; + }; + tR.prototype.$classData = r8({ ZYa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$AnyType$", { ZYa: 1, f: 1, om: 1 }); + var MHa = void 0; + function yx() { + MHa || (MHa = new tR().a()); + return MHa; + } + function uR() { + } + uR.prototype = new u7(); + uR.prototype.constructor = uR; + uR.prototype.a = function() { + return this; + }; + uR.prototype.$classData = r8({ $Ya: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$ArrayType$", { $Ya: 1, f: 1, om: 1 }); + var NHa = void 0; + function Ze() { + NHa || (NHa = new uR().a()); + return NHa; + } + function vR() { + } + vR.prototype = new u7(); + vR.prototype.constructor = vR; + vR.prototype.a = function() { + return this; + }; + vR.prototype.$classData = r8({ kZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$JSONSchemaType$", { kZa: 1, f: 1, om: 1 }); + var OHa = void 0; + function gla() { + OHa || (OHa = new vR().a()); + return OHa; + } + function wR() { + } + wR.prototype = new u7(); + wR.prototype.constructor = wR; + wR.prototype.a = function() { + return this; + }; + wR.prototype.$classData = r8({ lZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$LinkType$", { lZa: 1, f: 1, om: 1 }); + var PHa = void 0; + function QHa() { + PHa || (PHa = new wR().a()); + return PHa; + } + function xR() { + } + xR.prototype = new u7(); + xR.prototype.constructor = xR; + xR.prototype.a = function() { + return this; + }; + xR.prototype.$classData = r8({ nZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$MultipleMatch$", { nZa: 1, f: 1, om: 1 }); + var RHa = void 0; + function SHa() { + RHa || (RHa = new xR().a()); + return RHa; + } + function yR() { + } + yR.prototype = new u7(); + yR.prototype.constructor = yR; + yR.prototype.a = function() { + return this; + }; + yR.prototype.$classData = r8({ pZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$NilUnionType$", { pZa: 1, f: 1, om: 1 }); + var THa = void 0; + function UHa() { + THa || (THa = new yR().a()); + return THa; + } + function zR() { + } + zR.prototype = new u7(); + zR.prototype.constructor = zR; + zR.prototype.a = function() { + return this; + }; + zR.prototype.$classData = r8({ rZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$ObjectType$", { rZa: 1, f: 1, om: 1 }); + var VHa = void 0; + function $e2() { + VHa || (VHa = new zR().a()); + return VHa; + } + function AR() { + } + AR.prototype = new u7(); + AR.prototype.constructor = AR; + AR.prototype.a = function() { + return this; + }; + AR.prototype.$classData = r8({ vZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$TypeExpressionType$", { vZa: 1, f: 1, om: 1 }); + var WHa = void 0; + function wca() { + WHa || (WHa = new AR().a()); + return WHa; + } + function BR() { + } + BR.prototype = new u7(); + BR.prototype.constructor = BR; + BR.prototype.a = function() { + return this; + }; + BR.prototype.$classData = r8({ wZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$UndefinedType$", { wZa: 1, f: 1, om: 1 }); + var XHa = void 0; + function ff() { + XHa || (XHa = new BR().a()); + return XHa; + } + function CR() { + } + CR.prototype = new u7(); + CR.prototype.constructor = CR; + CR.prototype.a = function() { + return this; + }; + CR.prototype.$classData = r8({ xZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$UnionType$", { xZa: 1, f: 1, om: 1 }); + var YHa = void 0; + function zx() { + YHa || (YHa = new CR().a()); + return YHa; + } + function DR() { + } + DR.prototype = new u7(); + DR.prototype.constructor = DR; + DR.prototype.a = function() { + return this; + }; + DR.prototype.$classData = r8({ yZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$XMLSchemaType$", { yZa: 1, f: 1, om: 1 }); + var ZHa = void 0; + function hla() { + ZHa || (ZHa = new DR().a()); + return ZHa; + } + function ER() { + this.xoa = this.YN = null; + } + ER.prototype = new bja(); + ER.prototype.constructor = ER; + ER.prototype.nU = function(a10) { + this.YN = a10; + this.xoa = new FR().a(); + return this; + }; + ER.prototype.wqa = function(a10) { + return $Ha(this, a10); + }; + function $Ha(a10, b10) { + return new z7().d(aIa(bIa(), cIa(dIa(), b10, a10.YN, a10.xoa), a10.YN)); + } + ER.prototype.$classData = r8({ KZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.ShapeTransformer", { KZa: 1, BCa: 1, f: 1 }); + function PC() { + this.y8 = this.xf = this.m_ = null; + this.pn = false; + } + PC.prototype = new u7(); + PC.prototype.constructor = PC; + function eIa(a10, b10, c10) { + var e10 = B6(c10.aa, Ih().kh), f10 = B6(b10.aa, Ih().kh), g10 = Rb(Sb(), H10()); + e10.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.aa, Qi().Uf).A; + return D10.Ue(C10.b() ? null : C10.c(), false); + }; + }(a10, g10))); + f10.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + var I10 = B6(C10.aa, Qi().Uf).A; + if (D10.Ja(I10.b() ? null : I10.c()).na()) + return C10 = B6(C10.aa, Qi().Uf).A, D10.Ue(C10.b() ? null : C10.c(), true); + C10 = B6(C10.aa, Qi().Uf).A; + return D10.Ue(C10.b() ? null : C10.c(), false); + }; + }(a10, g10))); + var h10 = Toa().u; + h10 = se4(g10, h10); + var k10 = g10.ze; + g10 = pD(g10); + for (var l10 = k10.n[g10]; null !== l10; ) { + var m10 = l10.$a(); + l10 = new R6().M(l10.la, l10.r); + var p10 = l10.Tp; + if (true === !!l10.hr) + l10 = e10.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.aa, Qi().Uf); + return xb(C10, D10); + }; + }(a10, p10))).c(), p10 = f10.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.aa, Qi().Uf); + return xb(C10, D10); + }; + }(a10, p10))).c(), l10 = QC(a10.xf, p10, l10); + else if (p10 = l10.Tp, false === !!l10.hr) { + var t10 = e10.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.aa, Qi().Uf); + return xb(C10, D10); + }; + }(a10, p10))); + l10 = f10.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.aa, Qi().Uf); + return xb(C10, D10); + }; + }(a10, p10))); + if (a10.pn) + if (t10.b() ? p10 = y7() : (p10 = t10.c(), p10 = new z7().d(fIa(a10, c10, p10))), p10.b()) { + l10 = l10.c(); + p10 = new z7().d(a10.xf.ob); + t10 = y7(); + var v10 = new HM().a(); + l10 = gIa(l10, p10, t10, v10); + } else + l10 = p10.c(); + else + t10.b() ? p10 = y7() : (p10 = t10.c(), p10 = new z7().d(gIa(p10, new z7().d(a10.xf.ob), y7(), new HM().a()))), p10.b() ? (l10 = l10.c(), p10 = new z7().d(a10.xf.ob), t10 = y7(), v10 = new HM().a(), l10 = gIa(l10, p10, t10, v10)) : l10 = p10.c(); + } else + throw new x7().d(l10); + h10.jd(l10); + for (l10 = m10; null === l10 && 0 < g10; ) + g10 = -1 + g10 | 0, l10 = k10.n[g10]; + } + e10 = h10.Rc(); + f10 = Vb().Ia(Ti(b10.aa, Ih().kh)); + if (f10 instanceof z7) + f10 = f10.i.x; + else { + if (y7() !== f10) + throw new x7().d(f10); + O7(); + f10 = new P6().a(); + } + Ui(b10.aa, Ih().kh, Zr(new $r(), e10.ke(), new P6().a()), f10); + e10 = Ih().g; + f10 = K7(); + h10 = [Ih().kh, Ih().Ec]; + f10 = J5(f10, new Ib().ha(h10)); + Xi(a10, e10, b10, c10, f10); + a10.xf.$aa && (a10 = Ab(c10.Xa, q5(xh)), a10.b() || (a10 = a10.c(), b10.Xa.Lb(a10))); + return b10; + } + PC.prototype.nU = function(a10) { + this.xf = a10; + var b10 = Fg().g, c10 = uh().g, e10 = ii(); + b10 = b10.ia(c10, e10.u); + c10 = Ih().g; + e10 = ii(); + b10 = b10.ia(c10, e10.u); + c10 = Ag().g; + e10 = ii(); + this.y8 = b10.ia(c10, e10.u).fj(); + this.pn = a10.pn; + return this; + }; + function hIa(a10, b10, c10) { + b10.Y().vb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + null === h10 || null === g10 || f10.aa.vb.Ha(h10) || Rg(f10, h10, g10.r, g10.x); + } + }; + }(a10, c10))); + return c10; + } + function iIa(a10) { + null === a10.m_ && null === a10.m_ && (a10.m_ = new jIa().mU()); + return a10.m_; + } + function kIa(a10, b10, c10) { + c10.fh.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + f10.fh.Tm(g10); + var h10 = e10.xf.Wg, k10 = K7(); + lIa(h10, J5(k10, new Ib().ha([g10])), f10); + }; + }(a10, b10))); + } + function mIa(a10, b10, c10) { + var e10 = iIa(a10), f10 = a10.xf; + f10 = Qpa(e10, f10.pn, f10.Em, f10.Wg); + e10 = B6(b10.aa, xn().Le); + f10 = w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + return QC(k10, m10, l10); + }; + }(a10, f10, c10)); + var g10 = K7(); + e10 = e10.ka(f10, g10.u); + Ui(b10.aa, xn().Le, Zr(new $r(), e10, new P6().a()), Ti(b10.aa, xn().Le).x); + e10 = xn().g; + f10 = K7(); + g10 = [xn().Le]; + f10 = J5(f10, new Ib().ha(g10)); + Xi(a10, e10, b10, c10, f10); + return b10; + } + function nIa(a10, b10, c10) { + var e10 = iIa(a10), f10 = a10.xf; + f10 = Qpa(e10, f10.pn, f10.Em, f10.Wg); + if (B6(b10.aa, xn().Le).b() || B6(c10.aa, xn().Le).b()) { + e10 = B6(b10.aa, xn().Le); + f10 = B6(c10.aa, xn().Le); + var g10 = K7(); + e10 = e10.ia(f10, g10.u); + } else if (e10 = B6(b10.aa, xn().Le), f10 = w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = B6(k10.aa, xn().Le); + m10 = w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + try { + return new z7().d(QC(A10, D10, C10)); + } catch (I10) { + if (Ph(E6(), I10) instanceof nb) + return y7(); + throw I10; + } + }; + }(h10, l10, m10)); + var t10 = K7(); + return p10.ka(m10, t10.u); + }; + }(a10, c10, f10)), g10 = K7(), e10 = e10.bd(f10, g10.u), f10 = new oIa().mU(), g10 = K7(), e10 = e10.ec(f10, g10.u), e10.b()) + throw Gi( + new Hi(), + "Cannot compute inheritance for union", + y7(), + yh(b10), + Ab(b10.Xa, q5(jd)), + false + ); + Ui(b10.aa, xn().Le, Zr(new $r(), e10, new P6().a()), Ti(b10.aa, xn().Le).x); + e10 = xn().g; + f10 = K7(); + g10 = [xn().Le]; + f10 = J5(f10, new Ib().ha(g10)); + Xi(a10, e10, b10, c10, f10); + return b10; + } + function pIa(a10, b10, c10) { + var e10 = Fg().g; + K7(); + pj(); + var f10 = new Lf().a().ua(); + Xi(a10, e10, b10, c10, f10); + return b10; + } + function Rpa(a10, b10, c10) { + if (c10 instanceof vh) { + var e10 = rf.prototype.pG.call(c10); + c10 = Rd(e10, c10.j); + } else + c10 instanceof zi && (e10 = rf.prototype.pG.call(c10), e10 = Rd(e10, c10.j), c10 = c10.mn, c10.b() || (c10 = c10.c(), Di(e10, c10)), c10 = e10); + b10 = b10.VN(new z7().d(a10.xf.ob), y7(), new HM().a(), false); + kIa(a10, b10, c10); + try { + e10 = false; + var f10 = null, g10 = false, h10 = null; + if (b10 instanceof Mh && c10 instanceof Mh) { + var k10 = B6(b10.aa, Fg().af).A, l10 = k10.b() ? null : k10.c(), m10 = B6(c10.aa, Fg().af).A, p10 = m10.b() ? null : m10.c(); + if (l10 === p10) + return pIa(a10, b10, c10); + if (l10 !== Uh().hi || p10 !== Uh().of && p10 !== Uh().Nh && p10 !== Uh().Xo) { + var t10 = a10.xf.ob, v10 = Mo().cN, A10 = new z7().d(ic(qf().xd.r)), D10 = "Resolution error: Invalid scalar inheritance base type " + l10 + " < " + p10 + " ", C10 = b10.j, I10 = Ab(b10.fa(), q5(jd)), L10 = b10.Ib(); + t10.Gc(v10.j, C10, A10, D10, I10, Yb().qb, L10); + return b10; + } + var Y10 = Uh().hi, ia = Fg().af; + return pIa(a10, b10, eb(c10, ia, Y10)); + } + if (b10 instanceof th && c10 instanceof th) { + t10 = c10; + D10 = Vb().Ia(B6(t10.aa, uh().Ff)); + var pa = Vb().Ia(B6(b10.aa, uh().Ff)); + if (pa.b()) + var La = y7(); + else { + var ob = pa.c(), zb = D10 instanceof z7 ? QC(a10.xf, ob, D10.i) : ob; + La = new z7().d(zb); + } + var Zb = La.b() ? D10 : La; + if (!Zb.b()) { + var Cc = Zb.c(); + ZA(b10, Cc); + } + var vc = uh().g, id = K7(), yd = [uh().Ff], zd = J5(id, new Ib().ha(yd)); + Xi(a10, vc, b10, t10, zd); + return b10; + } + if (b10 instanceof pi && c10 instanceof pi) { + t10 = c10; + var rd = B6(t10.aa, uh().Ff), sd = B6(b10.aa, uh().Ff); + if (Vb().Ia(rd).na() && Vb().Ia(sd).na()) { + var le4 = QC(a10.xf, sd, rd); + Ui(b10.aa, uh().Ff, le4, (O7(), new P6().a())); + var Vc = uh().g, Sc = K7(), Qc = [uh().Ff], $c = J5(Sc, new Ib().ha(Qc)); + Xi(a10, Vc, b10, t10, $c); + } else + Vb().Ia(rd).na() && Ui(b10.aa, uh().Ff, rd, (O7(), new P6().a())); + return b10; + } + if (b10 instanceof qi && c10 instanceof qi) + return qIa(a10, b10, c10); + if (b10 instanceof Hh && (e10 = true, f10 = b10, c10 instanceof Hh)) + return eIa(a10, f10, c10); + if (b10 instanceof Vh && (g10 = true, h10 = b10, c10 instanceof Vh)) + return nIa(a10, h10, c10); + if (g10 && c10 instanceof Hh) + return mIa(a10, h10, c10); + if (null !== b10 && c10 instanceof Vh) + return rIa(a10, b10, c10); + if (b10 instanceof Vk && c10 instanceof Vk) { + t10 = c10; + var Wc = QC(a10.xf, B6(b10.aa, Qi().Vf), B6(t10.aa, Qi().Vf)); + Ui(b10.aa, Qi().Vf, Wc, Ti(b10.aa, Qi().Vf).x); + var Qe = Qi().Ub(), Qd = K7(), me4 = [Qi().Vf], of = J5(Qd, new Ib().ha(me4)); + Xi(a10, Qe, b10, t10, of); + return b10; + } + if (b10 instanceof Wh && c10 instanceof Wh) { + t10 = c10; + var Le2 = gn().g; + K7(); + pj(); + var Ve = new Lf().a().ua(); + Xi(a10, Le2, b10, t10, Ve); + return b10; + } + if (b10 instanceof Th && c10 instanceof Th) + return b10; + if (c10 instanceof zi) + return dda(a10, b10, c10); + var he4 = b10.bc(), Wf = Ag(); + if (null !== he4 && he4 === Wf) + var vf = true; + else { + var He = c10.bc(), Ff = Ag(); + vf = null !== He && He === Ff; + } + if (vf) { + if (b10 instanceof vh) + var wf = dda(a10, b10, c10); + else { + t10 = c10; + var Re2 = a10.y8; + K7(); + pj(); + var we4 = new Lf().a().ua(); + Xi(a10, Re2, b10, t10, we4); + wf = b10; + } + return wf; + } + if (e10 && f10 instanceof Hh && B6(f10.aa, Ih().kh).b() && c10 instanceof Hh) + return dda(a10, f10, c10); + if (b10 instanceof Gh) { + var ne4 = c10.bc(), Me2 = pn(); + if (null !== ne4 && ne4 === Me2) + return hIa(a10, c10, b10); + } + var Se4 = a10.xf.ob, xf = Mo().cN, ie3 = new z7().d(ic(qf().xd.r)), gf = "Resolution error: Incompatible types [" + $ka(bla(), b10.zv()) + ", " + $ka(bla(), c10.zv()) + "]", pf = b10.j, hf = Ab(b10.fa(), q5(jd)), Gf = b10.Ib(); + Se4.Gc(xf.j, pf, ie3, gf, hf, Yb().qb, Gf); + return b10; + } catch (yf) { + if (yf instanceof Hi) + return t10 = yf, t10.yma ? (a10 = a10.xf.ob, v10 = Mo().cN, A10 = b10.j, C10 = t10.p2, C10 = C10.b() ? new z7().d(ic(qf().xd.r)) : C10, I10 = t10.tt, L10 = t10.l2, L10 = L10.b() ? Ab(b10.fa(), q5(jd)) : L10, t10 = t10.L1, t10 = t10.b() ? b10.Ib() : t10, a10.Gc(v10.j, A10, C10, I10, L10, Yb().qb, t10)) : (a10 = a10.xf.ob, v10 = Mo().JR, A10 = b10.j, C10 = t10.p2, C10 = C10.b() ? new z7().d(ic(qf().xd.r)) : C10, I10 = t10.tt, L10 = t10.l2, L10 = L10.b() ? Ab(b10.fa(), q5(jd)) : L10, t10 = t10.L1, a10.Ns(v10, A10, C10, I10, L10, t10.b() ? b10.Ib() : t10)), b10; + throw yf; + } + } + function qIa(a10, b10, c10) { + var e10 = B6(b10.aa, an().$p), f10 = B6(c10.aa, an().$p); + if (e10.Oa() !== f10.Oa()) { + if (a10.xf.$aa && f10.b()) + return Ui(b10.aa, an().Ff, Zr(new $r(), e10, new P6().a()), mt(b10.aa, an().Ff).fa()), b10; + throw Gi(new Hi(), "Cannot inherit from a tuple shape with different number of elements", y7(), yh(b10), Ab(b10.Xa, q5(jd)), false); + } + f10 = f10.wy().og(new GR().a()); + f10 = sIa(f10, w6(/* @__PURE__ */ function() { + return function(h10) { + return null !== h10; + }; + }(a10))); + e10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.Ki(); + return QC(h10.xf, m10, k10.lb(l10)); + } + throw new x7().d(l10); + }; + }(a10, e10)); + new GR().a(); + e10 = f10.BE(e10); + Ui(b10.aa, an().Ff, Zr(new $r(), e10, new P6().a()), mt(b10.aa, an().Ff).fa()); + e10 = an().aa; + f10 = K7(); + var g10 = [an().Ff]; + f10 = J5(f10, new Ib().ha(g10)); + Xi(a10, e10, b10, c10, f10); + return b10; + } + function rIa(a10, b10, c10) { + var e10 = iIa(a10), f10 = a10.xf; + f10 = Qpa(e10, f10.pn, f10.Em, f10.Wg); + e10 = B6(c10.aa, xn().Le); + f10 = w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + try { + var t10 = QC(l10, m10, p10), v10 = B6(p10.Y(), qf().R).A; + if (!v10.b()) { + var A10 = v10.c(); + O7(); + var D10 = new P6().a(); + Sd(t10, A10, D10); + } + if (t10 instanceof Hh && p10 instanceof Hh) { + var C10 = t10.aa, I10 = Ih().Cn, L10 = C10.vb.Ja(I10); + if (!L10.b()) { + var Y10 = L10.c(), ia = Ih().Cn, pa = B6(p10.aa, Ih().Cn); + new z7().d(Rg(t10, ia, ih(new jh(), Ic(pa), Y10.r.fa()), Y10.x)); + } + } + return new z7().d(t10); + } catch (La) { + if (Ph(E6(), La) instanceof nb) + return y7(); + throw La; + } + }; + }(a10, f10, b10)); + var g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = new tIa().mU(); + g10 = K7(); + f10 = e10.ec(f10, g10.u); + if (f10.b()) + throw Gi(new Hi(), "Cannot compute inheritance from union", y7(), b10.Ib(), Ab(b10.fa(), q5(jd)), false); + e10 = H10(); + e10 = new qd().d(e10); + g10 = K7(); + f10.og(g10.u).U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.Ki(); + p10.j = p10.j + "_" + m10; + if (p10 instanceof vh) { + m10 = l10.oa; + var t10 = B6(p10.Y(), Ag().Ec), v10 = ii(); + l10.oa = m10.ia(t10, v10.u); + it2(p10.Y(), Ag().Ec); + it2(p10.Y(), Ag().$j); + it2(p10.Y(), Ag().Mh); + } + return p10; + } + throw new x7().d(m10); + }; + }(a10, e10))); + Ui(c10.aa, xn().Le, Zr(new $r(), f10, new P6().a()), Ti(c10.aa, xn().Le).x); + f10 = a10.y8; + g10 = K7(); + var h10 = [xn().Le]; + g10 = J5(g10, new Ib().ha(h10)); + Xi(a10, f10, b10, c10, g10); + b10.Y().vb.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + var t10 = xn().Le; + (null === p10 ? null === t10 : p10.h(t10)) || Ui(l10.aa, p10, m10.r, m10.x); + } else + throw new x7().d(m10); + }; + }(a10, c10))); + tc(e10.oa) && (a10 = c10.aa, f10 = Ag().Ec, Ui(a10, f10, Zr(new $r(), xN(e10.oa), new P6().a()), (O7(), new P6().a()))); + return Rd(c10, b10.j); + } + function fIa(a10, b10, c10) { + a10 = gIa(c10, new z7().d(a10.xf.ob), y7(), new HM().a()); + Ab(a10.Xa, q5(Zi)).b() && a10.Xa.Lb(new $i().e(b10.j)); + return a10; + } + PC.prototype.$classData = r8({ PZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.MinShapeAlgorithm", { PZa: 1, f: 1, ihb: 1 }); + function HR() { + this.ao = this.ob = null; + this.Sk = this.C1 = false; + } + HR.prototype = new gv(); + HR.prototype.constructor = HR; + function uIa(a10, b10) { + B6(b10.g, zD().Ne).Cb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10 = B6(e10.g, xm().Jc); + return e10 instanceof Hh ? B6(e10.aa, Ih().kh).Od(w6(/* @__PURE__ */ function() { + return function(f10) { + return B6(f10.aa, Qi().Vf) instanceof Wh; + }; + }(c10))) : false; + }; + }(a10))).Cb(w6(/* @__PURE__ */ function() { + return function(c10) { + c10 = B6(c10.g, xm().Nd).A; + c10 = c10 instanceof z7 && "multipart/form-data" === c10.i ? true : c10 instanceof z7 && "application/x-www-form-urlencoded" === c10.i ? true : false; + return !c10; + }; + }(a10))).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10 = B6(e10.g, xm().Jc); + (e10 instanceof Hh ? B6(e10.aa, Ih().kh).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return B6( + f10.aa, + Qi().Vf + ) instanceof Wh; + }; + }(c10))) : H10()).U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = f10.ob, k10 = Mo().b6, l10 = g10.j; + g10 = B6(g10.aa, Qi().Vf).fa(); + yB(h10, k10, l10, "Consumes must be either 'multipart/form-data', 'application/x-www-form-urlencoded', or both when a file parameter is present", g10); + }; + }(c10))); + }; + }(a10))); + } + function vIa(a10, b10, c10, e10) { + var f10 = b10.Dm(w6(/* @__PURE__ */ function() { + return function(g10) { + return hd(g10.g, xm().Nd).b(); + }; + }(a10))); + if (null === f10) + throw new x7().d(f10); + b10 = f10.ma(); + f10 = f10.ya(); + f10 = new qd().d(f10); + b10.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + h10.U(w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + var C10 = t10.oa, I10 = v10.x; + I10 = new ym().K(new S6().a(), I10); + var L10 = xm().Nd; + D10 = eb(I10, L10, D10); + J5(K7(), H10()); + D10 = Ai(D10, A10); + if (Vb().Ia(B6(v10.g, xm().Jc)).na()) { + I10 = D10.g; + L10 = xm().Jc; + var Y10 = D10.j; + Ui(I10, L10, Dpa(EC(), B6(v10.g, xm().Jc), Y10, v10.j), (O7(), new P6().a())); + } + I10 = K7(); + t10.oa = C10.yg(D10, I10.u); + }; + }(g10, k10, m10, l10))); + k10.oa.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = t10.j; + Fpa(EC(), B6(v10.g, xm().Jc), A10); + }; + }(g10, m10))); + }; + }(a10, c10, f10, e10))); + return f10.oa; + } + function wIa(a10, b10) { + B6(b10.g, Qm().Yp).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + var f10 = B6(e10.g, Jl().Ne); + it2(e10.g, Jl().Ne); + f10.Da() && B6(e10.g, Jl().bk).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = Vb().Ia(AD(k10)); + if (l10 instanceof z7) + h10.U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = Am().Ne; + return ig(p10, v10, t10); + }; + }(g10, l10.i))); + else { + if (y7() === l10) + return k10 = xIa(k10), l10 = zD().Ne, Zd(k10, l10, h10); + throw new x7().d(l10); + } + }; + }(c10, f10))); + }; + }(a10))); + } + HR.prototype.BG = function(a10, b10) { + var c10 = hd(a10.Y(), b10); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().r.r.wb; + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.t(); + }; + }(this)), f10 = K7(); + c10 = new z7().d(c10.ka(e10, f10.u)); + } + this.C1 || this.Sk || it2(a10.Y(), b10); + return c10; + }; + HR.prototype.ye = function(a10) { + a10 instanceof mf && a10.qe() instanceof Rm && (wIa(this, a10.qe()), yIa(this, a10.qe())); + return a10; + }; + function yIa(a10, b10) { + var c10 = a10.BG(b10, Qm().Wp), e10 = a10.BG(b10, Qm().yl); + B6(b10.g, Qm().Yp).U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + B6(k10.g, Jl().bk).U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = l10.BG(t10, Pl().Wp), A10 = l10.BG(t10, Pl().yl), D10 = zIa(m10, v10); + A10 = zIa(p10, A10); + v10 = Vb().Ia(AD(t10)); + if (!v10.b()) { + v10 = v10.c(); + if (D10 instanceof z7) { + D10 = D10.i; + if (l10.C1) + I10 = false; + else { + I10 = l10.ao; + var C10 = lk(), I10 = null !== I10 && I10.h(C10); + } + I10 && (I10 = Pl().Wp, Wr(t10, I10, D10)); + I10 = Am().Ne; + D10 = vIa(l10, B6(v10.g, zD().Ne), D10, v10.j); + Zd(v10, I10, D10); + } else if (y7() !== D10) + throw new x7().d(D10); + D10 = l10.ao; + I10 = mk(); + null !== D10 && D10.h(I10) && uIa(l10, v10); + } + B6(t10.g, Pl().Al).U(w6(/* @__PURE__ */ function(L10, Y10, ia) { + return function(pa) { + if (Y10 instanceof z7) { + var La = Y10.i; + if (L10.C1) + zb = false; + else { + zb = L10.ao; + var ob = lk(), zb = null !== zb && zb.h(ob); + } + zb && (zb = Pl().yl, Wr(ia, zb, La)); + zb = Am().Ne; + La = vIa(L10, B6(pa.g, zD().Ne), La, pa.j); + return Zd(pa, zb, La); + } + if (y7() !== Y10) + throw new x7().d(Y10); + }; + }(l10, A10, t10))); + }; + }(f10, g10, h10))); + }; + }(a10, c10, e10))); + } + function hHa(a10, b10, c10, e10) { + var f10 = new HR(); + f10.ao = a10; + f10.C1 = b10; + f10.Sk = c10; + fv.prototype.Hb.call(f10, e10); + return f10; + } + function zIa(a10, b10) { + a10 = b10.b() ? a10 : b10; + return a10.b() || a10.c().Da() ? a10 : y7(); + } + HR.prototype.$classData = r8({ F1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.MediaTypeResolutionStage", { F1a: 1, ii: 1, f: 1 }); + function zQ() { + this.ao = this.ob = null; + } + zQ.prototype = new gv(); + zQ.prototype.constructor = zQ; + function AIa(a10, b10) { + if (b10 instanceof mf && b10.qe() instanceof Rm) { + var c10 = b10.qe(), e10 = BIa(a10, c10), f10 = H10(), g10 = H10(), h10 = H10(), k10 = H10(), l10 = H10(); + e10 = new qd().d(bQ(new cQ(), f10, e10, g10, h10, k10, l10)); + B6(c10.g, Qm().Yp).U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = p10.oa, A10 = CIa(), D10 = B6(t10.g, Jl().Uf).A; + p10.oa = DIa(v10, EIa(A10, D10.b() ? null : D10.c(), B6(t10.g, Jl().Wm), H10())); + it2(t10.g, Jl().Wm); + p10.oa.Da() && B6(t10.g, Jl().bk).U(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + return FIa(L10, I10.oa); + }; + }(m10, p10))); + }; + }(a10, e10))); + } + return b10; + } + function GIa(a10, b10) { + b10 instanceof mf && b10.qe() instanceof Rm && B6(b10.qe().g, Qm().Yp).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + var f10 = B6(e10.g, Jl().Wm).Dm(w6(/* @__PURE__ */ function() { + return function(l10) { + l10 = B6(l10.g, cj().We); + return xb(l10, "path"); + }; + }(c10))); + if (null === f10) + throw new x7().d(f10); + var g10 = f10.ma(); + f10 = f10.ya(); + var h10 = CIa(), k10 = B6(e10.g, Jl().Uf).A; + f10 = EIa(h10, k10.b() ? null : k10.c(), f10, H10()); + f10.Da() && B6(e10.g, Jl().bk).Da() && (it2(e10.g, Jl().Wm), g10.Da() && Ui(e10.g, Jl().Wm, Zr(new $r(), g10, new P6().a()), (O7(), new P6().a())), B6(e10.g, Jl().bk).U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return FIa( + p10, + m10 + ); + }; + }(c10, f10)))); + }; + }(a10))); + return b10; + } + function HIa(a10, b10) { + b10 instanceof mf && b10.qe() instanceof Rm && B6(b10.qe().g, Qm().Yp).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + var f10 = CIa(), g10 = B6(e10.g, Jl().Uf).A; + f10 = EIa(f10, g10.b() ? null : g10.c(), B6(e10.g, Jl().Wm), H10()); + f10.Da() && B6(e10.g, Jl().bk).Da() && (it2(e10.g, Jl().Wm), B6(e10.g, Jl().bk).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return FIa(l10, k10); + }; + }(c10, f10)))); + }; + }(a10))); + return b10; + } + function FIa(a10, b10) { + var c10 = Vb().Ia(AD(a10)); + a10 = c10.b() ? xIa(a10) : c10.c(); + b10 = DIa(b10, bQ(new cQ(), B6(a10.g, Am().Tl), B6(a10.g, Am().Zo), B6(a10.g, Am().Tf), H10(), H10(), H10())); + b10.qt.Da() && Ui(a10.g, Am().Tl, Zr(new $r(), b10.qt, new P6().a()), (O7(), new P6().a())); + b10.Xg.Da() && Ui(a10.g, Am().Tf, Zr(new $r(), b10.Xg, new P6().a()), (O7(), new P6().a())); + return b10.ah.Da() ? Ui(a10.g, Am().Zo, Zr(new $r(), b10.ah, new P6().a()), (O7(), new P6().a())) : void 0; + } + function BIa(a10, b10) { + a10 = B6(b10.g, Qm().lh).Fb(w6(/* @__PURE__ */ function() { + return function(c10) { + return Ab(c10.x, q5(IR)).na(); + }; + }(a10))); + a10.b() ? a10 = y7() : (a10 = a10.c(), b10 = B6(a10.g, Yl().Aj), it2(a10.g, Yl().Aj), a10 = new z7().d(b10)); + return a10.b() ? H10() : a10.c(); + } + zQ.prototype.Sx = function(a10, b10) { + this.ao = a10; + fv.prototype.Hb.call(this, b10); + return this; + }; + zQ.prototype.ye = function(a10) { + var b10 = this.ao; + if (ok2().h(b10)) + return GIa(this, a10); + if (lk().h(b10) || nk().h(b10) || qk().h(b10)) + return HIa(this, a10); + if (kk().h(b10)) + return AIa(this, a10); + b10 = this.ob; + var c10 = dc().Fh, e10 = a10.j, f10 = y7(), g10 = "Unknown profile " + this.ao.Ll, h10 = y7(), k10 = y7(); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + return a10; + }; + zQ.prototype.$classData = r8({ H1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.ParametersNormalizationStage", { H1a: 1, ii: 1, f: 1 }); + function BQ() { + this.ao = this.ob = null; + this.Sk = false; + } + BQ.prototype = new gv(); + BQ.prototype.constructor = BQ; + function IIa(a10, b10, c10) { + a10.g.vb.Ha(b10) || c10.b() || (c10 = c10.c(), eb(a10, b10, c10)); + } + BQ.prototype.rs = function(a10, b10, c10) { + this.ao = a10; + this.Sk = b10; + fv.prototype.Hb.call(this, c10); + return this; + }; + function JIa(a10, b10) { + b10 instanceof mf && b10.qe() instanceof Rm && B6(b10.qe().g, Qm().Yp).U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + KIa(c10, e10); + }; + }(a10))); + return b10; + } + function KIa(a10, b10) { + var c10 = cs(b10.g, Jl().Va); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.t())); + var e10 = cs(b10.g, Jl().ck); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.t())); + var f10 = B6(b10.g, Jl().bk); + f10.Da() && !a10.Sk && (it2(b10.g, Jl().Va), it2(b10.g, Jl().ck)); + f10.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + IIa(l10, Pl().Va, h10); + IIa(l10, Pl().ck, k10); + }; + }(a10, c10, e10))); + } + BQ.prototype.ye = function(a10) { + var b10 = this.ao; + return nk().h(b10) ? JIa(this, a10) : a10; + }; + BQ.prototype.$classData = r8({ I1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.PathDescriptionNormalizationStage", { I1a: 1, ii: 1, f: 1 }); + function DQ() { + this.ao = this.ob = null; + } + DQ.prototype = new gv(); + DQ.prototype.constructor = DQ; + function LIa(a10) { + a10 = ar(a10.Y(), Gk().Ic); + var b10 = new MIa(); + var c10 = K7(); + return a10.ec(b10, c10.u).ps(Gb().si); + } + function NIa(a10, b10) { + b10 = B6(b10.g, Qm().Yp); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = B6(f10.g, Jl().Wm), h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return B6(l10.g, cj().Ne); + }; + }(e10)), k10 = K7(); + g10 = g10.bd(h10, k10.u); + h10 = OIa(e10, f10); + k10 = K7(); + g10 = g10.ia(h10, k10.u); + f10 = B6(f10.g, Jl().Wm); + h10 = K7(); + return g10.ia(f10, h10.u); + }; + }(a10)); + var c10 = K7(); + return b10.bd(a10, c10.u); + } + DQ.prototype.Sx = function(a10, b10) { + this.ao = a10; + fv.prototype.Hb.call(this, b10); + return this; + }; + function OIa(a10, b10) { + b10 = B6(b10.g, Jl().bk); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = B6(f10.g, Pl().Al), h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return B6(l10.g, zD().Ne); + }; + }(e10)), k10 = K7(); + g10 = g10.bd(h10, k10.u); + f10 = Vb().Ia(AD(f10)); + if (f10 instanceof z7) + f10 = PIa(e10, f10.i); + else { + if (y7() !== f10) + throw new x7().d(f10); + f10 = H10(); + } + h10 = K7(); + return g10.ia(f10, h10.u); + }; + }(a10)); + var c10 = K7(); + return b10.bd(a10, c10.u); + } + DQ.prototype.ye = function(a10) { + var b10 = this.ao; + return nk().h(b10) || kk().h(b10) ? QIa(this, a10) : a10; + }; + function PIa(a10, b10) { + var c10 = B6(b10.g, Am().Zo), e10 = B6(b10.g, Am().Tl), f10 = K7(); + c10 = c10.ia(e10, f10.u); + e10 = B6(b10.g, Am().BF); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + b10 = B6(b10.g, zD().Ne); + a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6(g10.g, cj().Ne); + }; + }(a10)); + e10 = K7(); + a10 = c10.bd(a10, e10.u); + e10 = K7(); + a10 = b10.ia(a10, e10.u); + b10 = K7(); + return a10.ia(c10, b10.u); + } + function RIa(a10, b10) { + var c10 = b10.Epa(); + c10 instanceof vh && b10.Cka().U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (!B6(f10.Y(), Ag().Ec).Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return t10.j === p10.j; + }; + }(e10, h10)))) { + var k10 = Gpa(Hpa(), g10.j); + Cb(h10, k10); + k10 = B6(f10.Y(), Ag().Ec); + h10 = J5(K7(), new Ib().ha([h10])); + var l10 = K7(); + k10 = k10.ia(h10, l10.u); + h10 = Ag().Ec; + Zd(f10, h10, k10); + g10.Doa(); + } + }; + }(a10, c10, b10))); + } + function QIa(a10, b10) { + if (b10 instanceof mf && b10.qe() instanceof Rm) { + var c10 = NIa(a10, b10.qe()), e10 = LIa(b10), f10 = K7(); + c10.ia(e10, f10.u).U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + RIa(g10, h10); + }; + }(a10))); + } + return b10; + } + DQ.prototype.$classData = r8({ J1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.PayloadAndParameterResolutionStage", { J1a: 1, ii: 1, f: 1 }); + function CQ() { + this.ob = null; + } + CQ.prototype = new gv(); + CQ.prototype.constructor = CQ; + CQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function SIa(a10, b10) { + var c10 = B6(b10.g, Qm().Yp), e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6(g10.g, Jl().bk); + }; + }(a10)), f10 = K7(); + c10 = c10.bd(e10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6(g10.g, Pl().Al); + }; + }(a10)); + f10 = K7(); + c10 = c10.bd(e10, f10.u); + e10 = K7(); + c10.og(e10.u).U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + var l10 = B6(k10.g, zD().Ec), m10 = w6(/* @__PURE__ */ function() { + return function(t10) { + var v10 = B6(t10.g, ag().Nd).A; + v10 = v10.b() ? null : v10.c(); + return new R6().M(v10, t10); + }; + }(g10)), p10 = K7(); + l10 = l10.ka(m10, p10.u).Ch(Gb().si); + it2(k10.g, Dm().Ec); + l10.U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + if (null !== D10) { + var C10 = D10.ma(); + D10 = D10.ya(); + var I10 = B6(v10.g, zD().Ne).Fb(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + pa = B6(pa.g, xm().Nd).A; + return (pa.b() ? null : pa.c()) === ia; + }; + }(t10, C10))); + if (I10 instanceof z7) { + I10 = I10.i; + C10 = B6(I10.g, xm().Jc); + if (C10 instanceof vh) { + I10 = Gpa(Hpa(), I10.j); + Cb(D10, I10); + if (B6(C10.Y(), Ag().Ec).Od(w6(/* @__PURE__ */ function(Y10, ia) { + return function(pa) { + return pa.j === ia.j; + }; + }(t10, D10)))) + return; + I10 = B6(D10.g, ag().Nd).A; + I10 = "" + (I10.b() ? null : I10.c()) + A10; + O7(); + var L10 = new P6().a(); + Sd(D10, I10, L10); + I10 = B6(C10.Y(), Ag().Ec); + D10 = J5(K7(), new Ib().ha([D10])); + L10 = K7(); + D10 = I10.ia(D10, L10.u); + I10 = Ag().Ec; + return Zd(C10, I10, D10); + } + C10 = B6(v10.g, zD().Ec); + D10 = J5(K7(), new Ib().ha([D10])); + I10 = K7(); + D10 = C10.ia(D10, I10.u); + C10 = zD().Ec; + return Zd(v10, C10, D10); + } + TIa(t10, D10, C10, B6(v10.g, zD().Ne)); + C10 = B6(v10.g, zD().Ec); + D10 = J5(K7(), new Ib().ha([D10])); + I10 = K7(); + D10 = C10.ia(D10, I10.u); + C10 = zD().Ec; + return Zd(v10, C10, D10); + } + throw new x7().d(D10); + }; + }(g10, k10, h10))); + } else + throw new x7().d(h10); + }; + }(a10))); + return b10; + } + function TIa(a10, b10, c10, e10) { + e10.b() ? (c10 = a10.ob, a10 = Mo().L5, yB(c10, a10, b10.j, "When schema is undefined, 'examples' facet is invalid as no content is returned as part of the response", b10.x)) : (a10 = a10.ob, e10 = Mo().K5, yB(a10, e10, b10.j, "Mime type '" + c10 + "' defined in examples must be present in a 'produces' property", b10.x)); + } + CQ.prototype.ye = function(a10) { + if (a10 instanceof mf && a10.qe() instanceof Rm) { + var b10 = SIa(this, a10.qe()), c10 = Jk().nb; + return Vd(a10, c10, b10); + } + return a10; + }; + CQ.prototype.$classData = r8({ L1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.ResponseExamplesResolutionStage", { L1a: 1, ii: 1, f: 1 }); + function yQ() { + this.ob = null; + } + yQ.prototype = new gv(); + yQ.prototype.constructor = yQ; + yQ.prototype.Hb = function(a10) { + fv.prototype.Hb.call(this, a10); + return this; + }; + function UIa(a10, b10, c10) { + if (b10 instanceof wE && c10 instanceof wE) { + b10 = VIa(a10, b10); + var e10 = VIa(a10, c10).Cb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return !l10.Ha(m10); + }; + }(a10, b10))); + if (e10.Da()) { + a10 = a10.ob; + b10 = dc().Fh; + var f10 = c10.j, g10 = Jm().lo.r; + g10 = new z7().d(V5(W5(), g10)); + e10 = "Follow scopes are not defined in root: " + e10.t(); + var h10 = Ab(c10.fa(), q5(jd)); + c10 = yb(c10); + a10.Gc(b10.j, f10, g10, e10, h10, Yb().qb, c10); + } + } + } + function WIa(a10, b10) { + var c10 = a10.BG(b10, Qm().dc); + B6(b10.g, Qm().Yp).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = XIa(f10, e10.BG(g10, Jl().dc)); + B6(g10.g, Jl().bk).U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = k10.BG(m10, Pl().dc); + p10 = XIa(l10, p10); + if (!p10.b() && (p10 = p10.c(), p10.U(w6(/* @__PURE__ */ function(v10) { + return function(A10) { + null !== A10 && B6(A10.g, rm2().Gh).U(w6(/* @__PURE__ */ function(D10) { + return function(C10) { + if (null !== C10) { + if (Vb().Ia(B6(C10.g, im().Oh)).na()) { + var I10 = Vb().Ia(B6(C10.g, im().Eq)); + I10.b() ? I10 = y7() : (I10 = I10.c(), I10 = new z7().d(B6(I10.g, Xh().Oh))); + I10 = I10.na(); + } else + I10 = false; + I10 && (I10 = B6(C10.g, im().Eq), UIa(D10, B6( + I10.g, + Xh().Oh + ), B6(C10.g, im().Oh))); + } + }; + }(v10))); + }; + }(k10))), p10.Da())) { + var t10 = Pl().dc; + Zd(m10, t10, p10); + } + }; + }(e10, h10))); + }; + }(a10, c10))); + } + function XIa(a10, b10) { + a10 = b10.b() ? a10 : b10; + return a10.b() || a10.c().Da() ? a10 : y7(); + } + yQ.prototype.BG = function(a10, b10) { + var c10 = hd(a10.Y(), b10); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().r.r.wb; + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10; + }; + }(this)), f10 = K7(); + c10 = new z7().d(c10.ka(e10, f10.u)); + } + it2(a10.Y(), b10); + return c10; + }; + function VIa(a10, b10) { + b10 = B6(b10.g, xE().Ap).kc().ua(); + a10 = /* @__PURE__ */ function(k10) { + return function(l10) { + l10 = B6(l10.g, Jm().lo); + var m10 = w6(/* @__PURE__ */ function() { + return function(t10) { + return B6(t10.g, Gm().R).A.ua(); + }; + }(k10)), p10 = K7(); + return l10.bd(m10, p10.u); + }; + }(a10); + if (ii().u === ii().u) { + if (b10 === H10()) + return H10(); + for (var c10 = b10, e10 = new Uj().eq(false), f10 = new qd().d(null), g10 = new qd().d(null); c10 !== H10(); ) { + var h10 = c10.ga(); + a10(h10).Hd().U(w6(/* @__PURE__ */ function(k10, l10, m10, p10) { + return function(t10) { + l10.oa ? (t10 = ji(t10, H10()), p10.oa.Nf = t10, p10.oa = t10) : (m10.oa = ji(t10, H10()), p10.oa = m10.oa, l10.oa = true); + }; + }(b10, e10, f10, g10))); + c10 = c10.ta(); + } + return e10.oa ? f10.oa : H10(); + } + ii(); + for (c10 = new Lf().a(); !b10.b(); ) + e10 = b10.ga(), e10 = a10(e10).Hd(), ws(c10, e10), b10 = b10.ta(); + return c10.ua(); + } + yQ.prototype.ye = function(a10) { + a10 instanceof mf && a10.qe() instanceof Rm && WIa(this, a10.qe()); + return a10; + }; + yQ.prototype.$classData = r8({ M1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.SecurityResolutionStage", { M1a: 1, ii: 1, f: 1 }); + function AQ() { + this.ao = this.ob = null; + } + AQ.prototype = new gv(); + AQ.prototype.constructor = AQ; + function YIa(a10, b10) { + if (b10 instanceof mf && b10.qe() instanceof Rm) { + var c10 = b10.qe(), e10 = B6(c10.g, Qm().Yp); + ZIa(a10, c10, e10); + e10.U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + ZIa(f10, g10, B6(g10.g, Jl().bk)); + }; + }(a10))); + } + return b10; + } + AQ.prototype.Sx = function(a10, b10) { + this.ao = a10; + fv.prototype.Hb.call(this, b10); + return this; + }; + AQ.prototype.ye = function(a10) { + var b10 = this.ao; + return nk().h(b10) ? YIa(this, a10) : a10; + }; + function ZIa(a10, b10, c10) { + if (c10.Da() && b10.uW().Da()) { + var e10 = b10.uW(); + b10.hda(); + c10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10.uW().b() ? h10.ifa(g10) : void 0; + }; + }(a10, e10))); + } + } + AQ.prototype.$classData = r8({ N1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.ServersNormalizationStage", { N1a: 1, ii: 1, f: 1 }); + function JR() { + this.Bf = this.Am = this.Fh = this.rN = this.G7 = this.C7 = this.rD = this.qZ = this.oZ = this.wN = this.iS = this.lY = this.CR = this.hS = this.gS = this.UC = this.j6 = this.r8 = this.au = this.c6 = this.t5 = this.ey = this.ty = null; + this.xa = false; + } + JR.prototype = new u7(); + JR.prototype.constructor = JR; + JR.prototype.a = function() { + $Ia = this; + this.ty = oj().Qfa; + this.ey = F6().h5; + var a10 = y7(), b10 = y7(); + this.t5 = nj(this, "cycle-reference", "Cycle in references", a10, b10); + a10 = y7(); + b10 = y7(); + this.c6 = nj(this, "invalid-cross-spec", "Cross spec file usage is not allowed", a10, b10); + a10 = y7(); + b10 = y7(); + this.au = nj(this, "unresolved-reference", "Unresolved reference", a10, b10); + a10 = y7(); + b10 = y7(); + this.r8 = nj(this, "uri-syntax-error", "invalid uri syntax", a10, b10); + a10 = y7(); + b10 = y7(); + this.j6 = nj(this, "invalid-fragment-ref", "References with # in RAML are not allowed", a10, b10); + a10 = y7(); + b10 = y7(); + this.UC = nj(this, "declaration-not-found", "Declaration not found", a10, b10); + a10 = y7(); + b10 = y7(); + this.gS = nj(this, "syaml-error", "Syaml error", a10, b10); + a10 = y7(); + b10 = y7(); + this.hS = nj(this, "syaml-warning", "Syaml warning", a10, b10); + a10 = y7(); + b10 = y7(); + this.CR = nj(this, "expected-module", "Expected Module", a10, b10); + a10 = y7(); + b10 = y7(); + this.lY = nj(this, "invalid-include", "Invalid !include value", a10, b10); + a10 = y7(); + b10 = y7(); + this.iS = nj(this, "parse-node-fail", "JsonLD @types failed to parse in node", a10, b10); + a10 = y7(); + b10 = y7(); + this.wN = nj( + this, + "parse-rdf-document-fail", + "Unable to parse rdf document", + a10, + b10 + ); + a10 = y7(); + b10 = y7(); + this.oZ = nj(this, "node-not-found", "Builder for model not found", a10, b10); + a10 = y7(); + b10 = y7(); + this.qZ = nj(this, "not-linkable", "Only linkable elements can be linked", a10, b10); + a10 = y7(); + b10 = y7(); + this.rD = nj(this, "parse-document-fail", "Unable to parse document", a10, b10); + a10 = y7(); + b10 = y7(); + this.C7 = nj(this, "missing-id-in-node", "Missing @id in json-ld node", a10, b10); + a10 = y7(); + b10 = y7(); + this.G7 = nj(this, "missing-type-in-node", "Missing @type in json-ld node", a10, b10); + a10 = new z7().d("Recursive type"); + b10 = new z7().d("Recursive schema"); + this.rN = nj( + this, + "recursive-shape", + "Recursive shape", + a10, + b10 + ); + a10 = y7(); + b10 = y7(); + this.Fh = nj(this, "resolution-validation", "Default resolution validation", a10, b10); + a10 = this.hS.j; + b10 = Yb().dh; + b10 = lj(this, b10); + a10 = new R6().M(a10, b10); + b10 = this.rN.j; + var c10 = ok2(), e10 = Yb().qb; + c10 = new R6().M(c10, e10); + e10 = pk(); + var f10 = Yb().qb; + e10 = new R6().M(e10, f10); + f10 = qk(); + var g10 = Yb().qb; + f10 = new R6().M(f10, g10); + g10 = lk(); + var h10 = Yb().qb; + g10 = new R6().M(g10, h10); + h10 = mk(); + var k10 = Yb().qb; + h10 = new R6().M(h10, k10); + k10 = nk(); + var l10 = Yb().qb; + k10 = new R6().M(k10, l10); + l10 = kk(); + var m10 = Yb().zx; + c10 = [c10, e10, f10, g10, h10, k10, new R6().M(l10, m10)]; + e10 = UA(new VA(), nu()); + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + WA(e10, c10[f10]), f10 = 1 + f10 | 0; + a10 = [a10, new R6().M(b10, e10.eb)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.Am = b10.eb; + ii(); + a10 = [this.t5, this.qZ, this.au, this.gS, this.hS, this.oZ, this.rD, this.iS, this.CR, this.C7, this.G7, this.r8, this.wN, this.UC, this.lY, this.c6, this.j6, this.rN, this.Fh]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Bf = c10; + return this; + }; + JR.prototype.$classData = r8({ P1a: 0 }, false, "amf.plugins.features.validation.CoreValidations$", { P1a: 1, f: 1, ZR: 1 }); + var $Ia = void 0; + function dc() { + $Ia || ($Ia = new JR().a()); + return $Ia; + } + function KR() { + this.W9 = this.iW = null; + } + KR.prototype = new u7(); + KR.prototype.constructor = KR; + KR.prototype.bL = function(a10) { + this.iW = a10; + this.W9 = J5(DB(), H10()); + return this; + }; + KR.prototype.aM = function() { + return this.iW; + }; + KR.prototype.$_ = function() { + for (var a10 = this.iW; !a10.b(); ) { + if (a10.ga().Y2() === Yb().qb) + return true; + a10 = a10.ta(); + } + return false; + }; + function Xqa(a10, b10) { + var c10 = "" + b10.Ev() + b10.d3() + b10.rO(); + if (!a10.W9.Ha(c10)) { + a10.W9.Tm(c10); + c10 = a10.iW; + b10 = J5(K7(), new Ib().ha([b10])); + var e10 = ii(); + a10.iW = c10.ia(b10, e10.u); + } + } + KR.prototype.$classData = r8({ R1a: 0 }, false, "amf.plugins.features.validation.CustomValidationReport", { R1a: 1, f: 1, Tga: 1 }); + function LR() { + this.HA = null; + } + LR.prototype = new u7(); + LR.prototype.constructor = LR; + d7 = LR.prototype; + d7.sp = function() { + return Jja(this); + }; + d7.t = function() { + return Jja(this); + }; + d7.ZQ = function() { + return this.aM(); + }; + d7.lE = function(a10) { + this.HA = a10; + return this; + }; + d7.J4 = function() { + return this.$_(); + }; + d7.aM = function() { + for (var a10 = this.HA.results(), b10 = [], c10 = 0, e10 = a10.length | 0; c10 < e10; ) { + var f10 = new MR().lE(a10[c10]); + b10.push(f10); + c10 = 1 + c10 | 0; + } + a10 = -1 + (b10.length | 0) | 0; + for (c10 = H10(); 0 <= a10; ) + c10 = ji(b10[a10], c10), a10 = -1 + a10 | 0; + return c10; + }; + d7.$_ = function() { + return !!this.HA.conforms(); + }; + LR.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(LR.prototype, "results", { get: function() { + return this.ZQ(); + }, configurable: true }); + Object.defineProperty(LR.prototype, "conforms", { get: function() { + return this.J4(); + }, configurable: true }); + LR.prototype.$classData = r8({ U1a: 0 }, false, "amf.plugins.features.validation.JSValidationReport", { U1a: 1, f: 1, Tga: 1 }); + function MR() { + this.HA = null; + } + MR.prototype = new u7(); + MR.prototype.constructor = MR; + d7 = MR.prototype; + d7.Y2 = function() { + return pra(WD(), this.HA.severity(), "Violation"); + }; + d7.TB = function() { + return pra(WD(), this.HA.path(), ""); + }; + d7.xL = function() { + WD(); + var a10 = this.HA.message(); + return void 0 === a10 ? y7() : Vb().Ia(a10).b() ? y7() : new z7().d(a10); + }; + d7.d3 = function() { + return pra(WD(), this.HA.sourceConstraintComponent(), ""); + }; + d7.M4 = function() { + return this.xL(); + }; + d7.rO = function() { + return pra(WD(), this.HA.focusNode(), ""); + }; + d7.lE = function(a10) { + this.HA = a10; + return this; + }; + d7.Ev = function() { + var a10 = pra(WD(), this.HA.sourceShape(), ""), b10 = F6().xF.he; + return 0 <= (a10.length | 0) && a10.substring(0, b10.length | 0) === b10 && Ed(ua(), a10, "#property") ? (a10 = Mc(ua(), a10, "#"), zj(new Pc().fd(a10))) : a10; + }; + d7.XQ = function() { + return this.TB(); + }; + Object.defineProperty(MR.prototype, "sourceShape", { get: function() { + return this.Ev(); + }, configurable: true }); + Object.defineProperty(MR.prototype, "severity", { get: function() { + return this.Y2(); + }, configurable: true }); + Object.defineProperty(MR.prototype, "focusNode", { get: function() { + return this.rO(); + }, configurable: true }); + Object.defineProperty(MR.prototype, "sourceConstraintComponent", { get: function() { + return this.d3(); + }, configurable: true }); + Object.defineProperty(MR.prototype, "path", { get: function() { + return this.XQ(); + }, configurable: true }); + Object.defineProperty(MR.prototype, "message", { get: function() { + return this.M4(); + }, configurable: true }); + MR.prototype.$classData = r8({ V1a: 0 }, false, "amf.plugins.features.validation.JSValidationResult", { V1a: 1, f: 1, ADa: 1 }); + function NR() { + } + NR.prototype = new u7(); + NR.prototype.constructor = NR; + NR.prototype.aM = function() { + return H10(); + }; + NR.prototype.$_ = function() { + return false; + }; + NR.prototype.$classData = r8({ W1a: 0 }, false, "amf.plugins.features.validation.ParserSideValidationPlugin$$anon$1", { W1a: 1, f: 1, Tga: 1 }); + function Kb() { + this.vS = 0; + this.wH = this.xs = this.uoa = null; + this.Ci = 0; + } + Kb.prototype = new Rha(); + Kb.prototype.constructor = Kb; + Kb.prototype.vK = function(a10) { + var b10 = this.wH.Ja(a10); + if (b10 instanceof z7) + return new z7().d(b10.i); + b10 = "<" + a10 + ">"; + var c10 = this.xs.subjectIndex; + c10 = LK().aC.call(c10, b10) ? new z7().d(c10[b10]) : y7(); + if (c10 instanceof z7) { + var e10 = c10.i, f10 = null; + f10 = Rb(Gb().ab, H10()); + var g10 = null; + g10 = J5(K7(), H10()); + var h10 = new OR().d1(Uc(/* @__PURE__ */ function() { + return function(v10, A10) { + v10 = v10.predicate.uri; + A10 = A10.predicate.uri; + return 0 < (v10 === A10 ? 0 : v10 < A10 ? -1 : 1); + }; + }(this))), k10 = e10.length | 0; + c10 = []; + if (1 === k10) + for (h10 = 0, k10 = e10.length | 0; h10 < k10; ) + c10.push(e10[h10]), h10 = 1 + h10 | 0; + else if (1 < k10) { + k10 = ja(Ja(Ha), [k10]); + for (var l10 = 0, m10 = l10 = 0, p10 = e10.length | 0; m10 < p10; ) + k10.n[l10] = e10[m10], l10 = 1 + l10 | 0, m10 = 1 + m10 | 0; + Zva(AI(), k10, h10); + for (l10 = 0; l10 < k10.n.length; ) + c10.push(k10.n[l10]), l10 = 1 + l10 | 0; + } + e10 = 0; + for (h10 = c10.length | 0; e10 < h10; ) { + l10 = c10[e10]; + k10 = l10.predicate.uri; + m10 = l10.object; + l10 = f10.lu(k10, oq(/* @__PURE__ */ function() { + return function() { + return H10(); + }; + }(this))); + p10 = F6().Qi; + if (k10 === ic(G5(p10, "type"))) + k10 = J5(K7(), new Ib().ha([m10.uri])), l10 = K7(), g10 = g10.ia(k10, l10.u); + else if ("Literal" === m10.termType) + p10 = K7(), m10 = [new PM().Uq("" + m10.value, Vb().Ia(m10.datatype).na() ? new z7().d(m10.datatype.uri) : y7())], m10 = J5(p10, new Ib().ha(m10)), p10 = K7(), f10 = f10.Wh(k10, l10.ia(m10, p10.u)); + else { + p10 = K7(); + var t10 = Vb().Ia(m10.uri); + m10 = [new LM().e("" + (t10.b() ? m10.toCanonical() : t10.c()))]; + m10 = J5(p10, new Ib().ha(m10)); + p10 = K7(); + f10 = f10.Wh(k10, l10.ia(m10, p10.u)); + } + e10 = 1 + e10 | 0; + } + a10 = aJa(a10, g10, f10); + this.wH = this.wH.Wh(b10, a10); + return new z7().d(a10); + } + if (y7() === c10) + return y7(); + throw new x7().d(c10); + }; + function Lb(a10) { + 0 === (1 & a10.Ci) << 24 >> 24 && 0 === (1 & a10.Ci) << 24 >> 24 && (a10.uoa = tra(), a10.Ci = (1 | a10.Ci) << 24 >> 24); + return a10.uoa; + } + function pE(a10, b10, c10, e10) { + a10.wH = a10.wH.wp(b10); + b10 = Lb(a10).namedNode(b10); + c10 = Lb(a10).namedNode(c10); + e10 = Lb(a10).namedNode(e10); + a10.xs.add(b10, c10, e10); + return a10; + } + Kb.prototype.lE = function(a10) { + this.xs = a10; + At.prototype.a.call(this); + this.wH = Rb(Gb().ab, H10()); + return this; + }; + function bJa() { + throw mb(E6(), new nb().e("Sync rdf serialization to writer not supported yet")); + } + function oE(a10, b10, c10, e10, f10) { + a10.wH = a10.wH.wp(b10); + b10 = Lb(a10).namedNode(b10); + c10 = Lb(a10).namedNode(c10); + f10 instanceof z7 ? (f10 = f10.i, e10 = Lb(a10).literal(e10, f10)) : e10 = Lb(a10).literal(e10); + a10.xs.add(b10, c10, e10); + return a10; + } + Kb.prototype.$classData = r8({ Z1a: 0 }, false, "amf.plugins.features.validation.RdflibRdfModel", { Z1a: 1, Rgb: 1, f: 1 }); + function PR() { + this.ea = this.Am = this.Bf = this.uo = this.ria = null; + this.xa = 0; + } + PR.prototype = new u7(); + PR.prototype.constructor = PR; + PR.prototype.a = function() { + cJa = this; + this.ea = nv().ea; + var a10 = this.ea.Bf, b10 = ii().u; + this.Bf = qt(a10, b10); + a10 = this.ea.Am; + b10 = Gb().si; + var c10 = UA(new VA(), nu()); + a10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.jd(g10); + }; + }(a10, c10, b10))); + this.Am = c10.eb; + return this; + }; + function jR(a10, b10, c10) { + return dJa(a10).lu(b10, oq(/* @__PURE__ */ function() { + return function() { + return eJa(); + }; + }(a10))).lu(c10, oq(/* @__PURE__ */ function() { + return function() { + return Yb().qb; + }; + }(a10))); + } + function eJa() { + var a10 = FO(); + 0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24 && (a10.uo = fJa(a10), a10.xa = (2 | a10.xa) << 24 >> 24); + return a10.uo; + } + function dJa(a10) { + if (0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24) { + for (var b10 = a10.Am, c10 = a10.Bf; !c10.b(); ) { + var e10 = c10.ga(); + if (!b10.Ha(e10.j)) { + e10 = e10.j; + var f10 = eJa(); + b10 = b10.cc(new R6().M(e10, f10)); + } + c10 = c10.ta(); + } + a10.ria = b10; + a10.xa = (1 | a10.xa) << 24 >> 24; + } + return a10.ria; + } + function fJa(a10) { + var b10 = Yb().qb, c10 = lda(mj()); + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return new R6().M(g10, f10); + }; + }(a10, b10)); + b10 = K7(); + return c10.ka(a10, b10.u).Ch(Gb().si); + } + PR.prototype.$classData = r8({ b2a: 0 }, false, "amf.plugins.features.validation.Validations$", { b2a: 1, f: 1, ib: 1 }); + var cJa = void 0; + function FO() { + cJa || (cJa = new PR().a()); + return cJa; + } + function QR() { + } + QR.prototype = new u7(); + QR.prototype.constructor = QR; + QR.prototype.a = function() { + return this; + }; + function gJa(a10, b10) { + return zHa(yj(a10, b10, "message"), yj(a10, b10, "code"), sj(a10, b10, "libraries"), yj(a10, b10, "functionName"), J5(K7(), H10()), y7()); + } + QR.prototype.$classData = r8({ i2a: 0 }, false, "amf.plugins.features.validation.model.ParsedFunctionConstraint$", { i2a: 1, f: 1, v7: 1 }); + var hJa = void 0; + function iJa() { + hJa || (hJa = new QR().a()); + return hJa; + } + function RR() { + } + RR.prototype = new u7(); + RR.prototype.constructor = RR; + RR.prototype.a = function() { + return this; + }; + RR.prototype.$classData = r8({ j2a: 0 }, false, "amf.plugins.features.validation.model.ParsedPropertyConstraint$", { j2a: 1, f: 1, v7: 1 }); + var jJa = void 0; + function SR() { + } + SR.prototype = new u7(); + SR.prototype.constructor = SR; + SR.prototype.a = function() { + return this; + }; + function kJa(a10) { + var b10 = lJa, c10 = qda(b10, a10); + WC(); + var e10 = yj(b10, a10, "profile"); + e10 = VC(0, nda("profile in validation profile", e10)); + var f10 = yj(b10, a10, "extends"); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(VC(WC(), f10))); + var g10 = sj(b10, a10, "violation"), h10 = sj(b10, a10, "info"), k10 = sj(b10, a10, "warning"), l10 = sj(b10, a10, "disabled"); + return AEa(e10, f10, g10, h10, k10, l10, sda(b10, a10, "validations", w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return mJa(nJa(), t10, p10); + }; + }(b10, c10))), c10); + } + SR.prototype.$classData = r8({ k2a: 0 }, false, "amf.plugins.features.validation.model.ParsedValidationProfile$", { k2a: 1, f: 1, v7: 1 }); + var lJa = void 0; + function TR() { + } + TR.prototype = new u7(); + TR.prototype.constructor = TR; + TR.prototype.a = function() { + return this; + }; + function mJa(a10, b10, c10) { + var e10 = yj(a10, b10, "name"); + e10 = nda("name in validation specification", e10); + var f10 = yj(a10, b10, "message"); + f10 = nda("message in validation specification", f10); + var g10 = sj(a10, b10, "targetClass"), h10 = w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + nJa(); + return pda(Y10, L10); + }; + }(a10, c10)), k10 = K7(); + g10 = g10.ka(h10, k10.u); + c10 = sda(a10, b10, "propertyConstraints", w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + jJa || (jJa = new RR().a()); + var ia = jJa; + var pa = yj(ia, Y10, "name"); + pa = nda("ramlID in property constraint", pa); + pa = pda(pa, L10); + var La = yj(ia, Y10, "name"); + La = nda( + "name in property constraint", + La + ); + var ob = yj(ia, Y10, "message"), zb = yj(ia, Y10, "pattern"), Zb = yj(ia, Y10, "maxCount"), Cc = yj(ia, Y10, "minCount"), vc = yj(ia, Y10, "maxLength"), id = yj(ia, Y10, "minLength"), yd = yj(ia, Y10, "maxExclusive"), zd = yj(ia, Y10, "minExclusive"), rd = yj(ia, Y10, "maxInclusive"), sd = yj(ia, Y10, "minInclusive"); + Y10 = sj(ia, Y10, "in"); + ia = y7(); + var le4 = y7(), Vc = y7(), Sc = y7(), Qc = J5(K7(), H10()), $c = y7(), Wc = y7(); + return EO(pa, La, ob, zb, ia, Zb, Cc, id, vc, zd, yd, sd, rd, le4, Vc, Sc, Qc, Y10, $c, Wc); + }; + }(a10, c10))); + a10 = B6(tj(b10).g, wj().ej).Fb(w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Y10 = B6(Y10.g, $d().R).A; + return (Y10.b() ? null : Y10.c()) === L10; + }; + }(a10, "functionConstraint"))); + a10.b() ? b10 = y7() : (a10 = a10.c(), b10 = oJa(b10, xj(a10)), b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(gJa(iJa(), b10)))); + oj(); + a10 = y7(); + oj(); + h10 = y7(); + oj(); + K7(); + pj(); + k10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var l10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var m10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var p10 = new Lf().a().ua(); + oj(); + K7(); + pj(); + var t10 = new Lf().a().ua(); + oj(); + var v10 = y7(); + oj(); + K7(); + pj(); + var A10 = new Lf().a().ua(); + oj(); + var D10 = y7(); + oj(); + var C10 = y7(); + return qj(new rj(), e10, f10, a10, h10, k10, g10, l10, m10, p10, t10, v10, c10, A10, D10, b10, C10); + } + TR.prototype.$classData = r8({ l2a: 0 }, false, "amf.plugins.features.validation.model.ParsedValidationSpecification$", { l2a: 1, f: 1, v7: 1 }); + var pJa = void 0; + function nJa() { + pJa || (pJa = new TR().a()); + return pJa; + } + function UR() { + this.Bf = this.Am = this.O5 = this.bN = this.Yfa = this.dN = this.KX = this.IR = this.D7 = this.QI = this.U5 = this.x5 = this.gZ = this.B7 = this.Xha = this.F7 = this.H7 = this.Cf = this.ey = this.ty = null; + this.xa = false; + } + UR.prototype = new u7(); + UR.prototype.constructor = UR; + UR.prototype.a = function() { + qJa = this; + this.ty = oj().Afa; + this.ey = F6().Ifa; + var a10 = y7(), b10 = y7(); + this.Cf = nj(this, "dialect-error", "Dialect error", a10, b10); + a10 = y7(); + b10 = y7(); + this.H7 = nj(this, "missing-vocabulary", "Missing vocabulary", a10, b10); + a10 = y7(); + b10 = y7(); + this.F7 = nj(this, "missing-vocabulary-term", "Missing vocabulary term", a10, b10); + a10 = y7(); + b10 = y7(); + this.Xha = nj(this, "missing-property-vocabulary-term", "Missing property vocabulary term", a10, b10); + a10 = y7(); + b10 = y7(); + this.B7 = nj(this, "missing-dialect-fragment", "Missing dialect fragment", a10, b10); + a10 = y7(); + b10 = y7(); + this.gZ = nj(this, "missing-node-mapping-range-term", "Missing property range term", a10, b10); + a10 = y7(); + b10 = y7(); + this.x5 = nj(this, "different-terms-in-mapkey", "Different terms in map key", a10, b10); + a10 = y7(); + b10 = y7(); + this.U5 = nj(this, "inconsistent-property-range-value", "Range value does not match the expected type", a10, b10); + a10 = y7(); + b10 = y7(); + this.QI = nj(this, "closed-shape", "Invalid property for node", a10, b10); + a10 = y7(); + b10 = y7(); + this.D7 = nj(this, "mandatory-property-shape", "Missing mandatory property", a10, b10); + a10 = y7(); + b10 = y7(); + this.IR = nj( + this, + "invalid-module-type", + "Invalid module type", + a10, + b10 + ); + a10 = y7(); + b10 = y7(); + this.KX = nj(this, "dialect-ambiguous-range", "Ambiguous entity range", a10, b10); + a10 = y7(); + b10 = y7(); + this.dN = nj(this, "invalid-union-type", "Union should be a sequence", a10, b10); + a10 = y7(); + b10 = y7(); + this.Yfa = nj(this, "expected-vocabulary-module", "Expected vocabulary module", a10, b10); + a10 = y7(); + b10 = y7(); + this.bN = nj(this, "invalid-dialect-patch", "Invalid dialect patch", a10, b10); + a10 = y7(); + b10 = y7(); + this.O5 = nj(this, "guid-scalar-non-unique", "GUID scalar type declared without unique constraint", a10, b10); + this.Am = Rb(Gb().ab, H10()); + ii(); + a10 = [ + this.QI, + this.KX, + this.U5, + this.gZ, + this.F7, + this.x5, + this.B7, + this.D7, + this.IR, + this.H7, + this.dN, + this.bN, + this.Cf, + this.O5 + ]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Bf = c10; + return this; + }; + UR.prototype.$classData = r8({ r2a: 0 }, false, "amf.validation.DialectValidations$", { r2a: 1, f: 1, ZR: 1 }); + var qJa = void 0; + function Wd() { + qJa || (qJa = new UR().a()); + return qJa; + } + function VR() { + this.Bf = this.Am = this.w6 = this.d8 = this.kia = this.lia = this.a8 = this.Q7 = this.E7 = this.kY = this.fga = this.v6 = this.pY = this.eZ = this.PZ = this.k_ = this.HF = this.I7 = this.h6 = this.Y5 = this.f6 = this.sY = this.Oy = this.Z5 = this.aN = this.vN = this.kS = this.yR = this.EZ = this.x6 = this.i_ = this.oY = this.g6 = this.q_ = this.cJ = this.m8 = this.n8 = this.B5 = this.p8 = this.hZ = this.jS = this.xN = this.uZ = this.wZ = this.C5 = this.QX = this.vZ = this.tZ = this.U7 = this.J5 = this.ZM = this.N5 = this.M5 = this.l8 = this.vR = this.PX = this.VM = this.k6 = this.k8 = this.GR = this.rZ = this.l_ = this.jY = this.nY = this.iY = this.uY = this.l6 = this.q6 = this.u6 = this.W5 = this.X5 = this.p6 = this.o6 = this.bJ = this.e6 = this.j8 = this.n6 = this.cga = this.tY = this.i6 = this.m6 = this.WZ = this.TZ = this.A5 = this.OX = this.HR = this.ega = this.dga = this.t6 = this.r6 = this.$7 = this.qY = this.V5 = this.s6 = this.y5 = this.X7 = this.R7 = this.S7 = this.HJ = this.a6 = this.$5 = this.d6 = this.rY = this.mY = this.$X = this.ey = this.ty = null; + this.xa = false; + } + VR.prototype = new u7(); + VR.prototype.constructor = VR; + VR.prototype.a = function() { + rJa = this; + this.ty = oj().P7; + this.ey = F6().xF; + var a10 = y7(), b10 = y7(); + this.$X = nj(this, "exclusive-link-target-error", "operationRef and operationId are mutually exclusive in a OAS 3.0.0 Link Object", a10, b10); + var c10 = y7(), e10 = y7(); + this.mY = nj(this, "invalid-json-schema-type", "Invalid json schema definition type", c10, e10); + var f10 = y7(), g10 = y7(); + this.rY = nj(this, "invalid-shape-format", "Invalid shape format", f10, g10); + var h10 = y7(), k10 = y7(); + this.d6 = nj(this, "invalid-datetime-format", "Invalid format value for datetime", h10, k10); + var l10 = y7(), m10 = y7(); + this.$5 = nj(this, "invalid-base-path", "Invalid base path", l10, m10); + var p10 = y7(), t10 = y7(); + this.a6 = nj(this, "invalid-base-uri-parameters-type", "Invalid baseUriParameters type", p10, t10); + var v10 = y7(), A10 = y7(); + this.HJ = nj(this, "unused-base-uri-parameter", "Unused base uri parameter", v10, A10); + var D10 = y7(), C10 = y7(); + this.S7 = nj(this, "parameters-without-base-uri", "'baseUri' not defined and 'baseUriParameters' defined.", D10, C10); + var I10 = y7(), L10 = y7(); + this.R7 = nj(this, "parameter-name-required", "Parameter name is required", I10, L10); + var Y10 = y7(), ia = y7(); + this.X7 = nj(this, "content-required", "Request body content is required", Y10, ia); + var pa = y7(), La = y7(); + this.y5 = nj(this, "discriminator-name-required", "Discriminator property name is required", pa, La); + var ob = y7(), zb = y7(); + this.s6 = nj(this, "invalid-server-path", "Invalid server path", ob, zb); + var Zb = y7(), Cc = y7(); + this.V5 = nj(this, "invalid-abstract-declaration-parameter-in-type", "Trait/Resource Type parameter in type", Zb, Cc); + var vc = y7(), id = y7(); + this.qY = nj(this, "invalid-secured-by-type", "Invalid 'securedBy' type", vc, id); + var yd = y7(), zd = y7(); + this.$7 = nj(this, "scope-names-must-be-empty", "Scope names must be an empty array", yd, zd); + var rd = y7(), sd = y7(); + this.r6 = nj(this, "invalid-security-scheme-described-by-type", "Invalid 'describedBy' type, map expected", rd, sd); + var le4 = y7(), Vc = y7(); + this.t6 = nj(this, "invalid-tag-type", "Tag values must be of type string", le4, Vc); + var Sc = y7(), Qc = y7(); + nj(this, "invalid-security-scheme-object", "Invalid security scheme", Sc, Qc); + var $c = y7(), Wc = y7(); + this.dga = nj( + this, + "invalid-security-requirement-object", + "Invalid security requirement object", + $c, + Wc + ); + var Qe = y7(), Qd = y7(); + this.ega = nj(this, "invalid-security-requirements-sequence", "'security' must be an array of security requirements object", Qe, Qd); + var me4 = y7(), of = y7(); + this.HR = nj(this, "invalid-endpoint-path", "Invalid endpoint path (invalid template uri)", me4, of); + var Le2 = y7(), Ve = y7(); + this.OX = nj(this, "duplicated-endpoint-path", "Duplicated endpoint path", Le2, Ve); + var he4 = y7(), Wf = y7(); + this.A5 = nj(this, "duplicated-operation-id", "Duplicated operation id", he4, Wf); + var vf = y7(), He = y7(); + this.TZ = nj( + this, + "schema-deprecated", + "'schema' keyword it's deprecated for 1.0 version, should use 'type' instead", + vf, + He + ); + var Ff = y7(), wf = y7(); + this.WZ = nj(this, "schemas-deprecated", "'schemas' keyword it's deprecated for 1.0 version, should use 'types' instead", Ff, wf); + var Re2 = y7(), we4 = y7(); + this.m6 = nj(this, "invalid-operation-type", "Invalid operation type", Re2, we4); + var ne4 = y7(), Me2 = y7(); + this.i6 = nj(this, "invalid-external-type-type", "Invalid external type type", ne4, Me2); + var Se4 = y7(), xf = y7(); + this.tY = nj( + this, + "invalid-xml-schema-type", + "Invalid xml schema type", + Se4, + xf + ); + var ie3 = y7(), gf = y7(); + this.cga = nj(this, "invalid-json-schema-expression", "Invalid json schema expression", ie3, gf); + var pf = y7(), hf = y7(); + this.n6 = nj(this, "invalid-property-type", "Invalid property key type. Should be string", pf, hf); + var Gf = y7(), yf = y7(); + this.j8 = nj(this, "unable-to-parse-array", "Unable to parse array definition", Gf, yf); + var oe4 = y7(), lg = y7(); + this.e6 = nj(this, "invalid-decimal-point", "Invalid decimal point", oe4, lg); + var bh = y7(), Qh = y7(); + this.bJ = nj( + this, + "invalid-type-definition", + "Invalid type definition", + bh, + Qh + ); + var af = y7(), Pf = y7(); + this.o6 = nj(this, "invalid-required-array-for-schema-version", "Required arrays of properties not supported in JSON Schema below version draft-4", af, Pf); + var oh = y7(), ch = y7(); + this.p6 = nj(this, "invalid-required-boolean-for-schema-version", "Required property boolean value is only supported in JSON Schema draft-3", oh, ch); + var Ie2 = y7(), ug = y7(); + this.X5 = nj(this, "invalid-additional-properties-type", "additionalProperties should be a boolean or a map", Ie2, ug); + var Sg = y7(), Tg = y7(); + this.W5 = nj( + this, + "invalid-additional-items-type", + "additionalItems should be a boolean or a map", + Sg, + Tg + ); + var zh = y7(), Rh = y7(); + this.u6 = nj(this, "invalid-tuple-type", "Tuple should be a sequence", zh, Rh); + var vg = y7(), dh = y7(); + this.q6 = nj(this, "invalid-schema-type", "Schema should be a string", vg, dh); + var Jg = y7(), Ah = y7(); + this.l6 = nj(this, "invalid-media-type-type", "Media type should be a string", Jg, Ah); + var Bh = y7(), cg = y7(); + this.uY = nj(this, "invalid-xone-type", "Xone should be a sequence", Bh, cg); + var Qf = y7(), Kg = y7(); + this.iY = nj( + this, + "invalid-and-type", + "And should be a sequence", + Qf, + Kg + ); + var Ne2 = y7(), Xf = y7(); + this.nY = nj(this, "invalid-or-type", "Or should be a sequence", Ne2, Xf); + var di = y7(), dg = y7(); + this.jY = nj(this, "invalid-disjoint-union-type", "Invalid type for disjoint union", di, dg); + var Hf = y7(), wg = y7(); + this.l_ = nj(this, "unexpected-vendor", "Unexpected vendor", Hf, wg); + var Lg = y7(), jf = y7(); + this.rZ = nj(this, "null-abstract-declaration", "Generating abstract declaration (resource type / trait) with null value", Lg, jf); + var mg = y7(), Mg = y7(); + this.GR = nj( + this, + "invalid-abstract-declaration-type", + "Invalid type for declaration node", + mg, + Mg + ); + var Ng = y7(), eg = y7(); + this.k8 = nj(this, "unable-to-parse-shape-extensions", "Unable to parse shape extensions", Ng, eg); + var Oe4 = y7(), ng = y7(); + this.k6 = nj(this, "invalid-json-schema-version", "Invalid Json Schema version", Oe4, ng); + var fg = y7(), Ug = y7(); + this.VM = nj(this, "cross-security-warning", "Using a security scheme type from raml in oas or from oas in raml", fg, Ug); + var xg = y7(), gg = y7(); + this.PX = nj( + this, + "duplicated-operation-status-code", + "Status code for the provided operation response must not be duplicated", + xg, + gg + ); + var fe4 = y7(), ge4 = y7(); + this.vR = nj(this, "chained-reference-error", "References cannot be chained", fe4, ge4); + var ph = y7(), hg = y7(); + this.l8 = nj(this, "unable-to-set-default-type", "Unable to set default type", ph, hg); + var Jh = y7(), fj = y7(); + this.M5 = nj(this, "exclusive-schema-type", "'schema' and 'type' properties are mutually exclusive", Jh, fj); + var yg = y7(), qh = y7(); + this.N5 = nj(this, "exclusive-schemas-type", "'schemas' and 'types' properties are mutually exclusive", yg, qh); + var og = y7(), rh = y7(); + this.ZM = nj( + this, + "exclusive-properties-error", + "Exclusive properties declared together", + og, + rh + ); + var Ch = y7(), Vg = y7(); + this.J5 = nj(this, "examples-must-be-map", "Examples value should be a map", Ch, Vg); + var Wg = y7(), Rf = y7(); + this.U7 = nj(this, "path-template-unbalanced-parameters", "Nested parameters are not allowed in path templates", Wg, Rf); + var Sh = y7(), zg = y7(); + this.tZ = nj(this, "oas-not-body-and-form-data-parameters", "Operation cannot have a body parameter and a formData parameter", Sh, zg); + var Ji = y7(), Kh = y7(); + this.vZ = nj( + this, + "oas-invalid-body-parameter", + "Only one body parameter is allowed", + Ji, + Kh + ); + var Lh = y7(), Ki = y7(); + this.QX = nj(this, "duplicate-parameters", "Sibling parameters must have unique 'name' and 'in' values", Lh, Ki); + var gj = y7(), Rl = y7(); + this.C5 = nj(this, "duplicate-tags", "Sibling tags must have unique names", gj, Rl); + var ek = y7(), Dh = y7(); + this.wZ = nj(this, "oas-invalid-parameter-binding", "Parameter has invalid binding", ek, Dh); + var Eh = y7(), Li = y7(); + this.uZ = nj(this, "oas-file-not-form-data-parameters", "Parameters with type file must be in formData", Eh, Li); + var Mi = y7(), uj = y7(); + this.xN = nj( + this, + "unsupported-example-media-type", + "Cannot validate example with unsupported media type", + Mi, + uj + ); + var Ni = y7(), fk = y7(); + this.jS = nj(this, "unknown-security-scheme", "Cannot find the security scheme", Ni, fk); + var Ck = y7(), Dk = y7(); + this.hZ = nj(this, "missing-security-scheme-type", "Missing security scheme type", Ck, Dk); + var hj = y7(), ri = y7(); + this.p8 = nj(this, "unknown-scope", "Cannot find the scope in the security settings", hj, ri); + var gk = y7(), $k = y7(); + this.B5 = nj(this, "duplicated-property", "Duplicated property in node", gk, $k); + var lm = y7(), si = y7(); + this.n8 = nj( + this, + "unexpected-raml-scalar-key", + "Unexpected key. Options are 'value' or annotations \\(.+\\)", + lm, + si + ); + var bf = y7(), ei = y7(); + this.m8 = nj(this, "unexpected-file-types-syntax", "Unexpected 'fileTypes' syntax. Options are string or sequence", bf, ei); + var vj = y7(), ti = y7(); + this.cJ = nj(this, "json-schema-inheritance", "Inheriting from JSON Schema", vj, ti); + var Og = y7(), Oi = y7(); + this.q_ = nj(this, "xml-schema-inheritance", "Inheriting from XML Schema", Og, Oi); + var pg = y7(), zf = y7(); + this.g6 = nj(this, "invalid-endpoint-type", "Invalid endpoint type", pg, zf); + var Sf = y7(), eh = y7(); + this.oY = nj(this, "invalid-parameter-type", "Invalid parameter type", Sf, eh); + var Fh = y7(), fi = y7(); + this.i_ = nj(this, "unable-to-parse-shape", "Unable to parse shape", Fh, fi); + var hn = y7(), mm = y7(); + this.x6 = nj(this, "json-schema-fragment-not-found", "Json schema fragment not found", hn, mm); + var nm = y7(), kd = y7(); + this.EZ = nj(this, "pattern-properties-on-closed-node", "Closed node cannot define pattern properties", nm, kd); + var Pi = y7(), sh = y7(); + this.yR = nj( + this, + "discriminator-on-extended-union", + "Property 'discriminator' not supported in a node extending a unionShape", + Pi, + sh + ); + var Pg = y7(), Xc = y7(); + this.kS = nj(this, "unresolved-parameter", "Unresolved parameter", Pg, Xc); + var xe2 = y7(), Nc = y7(); + this.vN = nj(this, "unable-to-parse-json-schema", "Unable to parse json schema", xe2, Nc); + var om = y7(), Dn = y7(); + this.aN = nj(this, "invalid-annotation-type", "Invalid annotation type", om, Dn); + var gi = y7(), Te = y7(); + this.Z5 = nj(this, "invalid-annotation-target", "Annotation not allowed in used target", gi, Te); + var pm = y7(), jn = y7(); + this.Oy = nj(this, "invalid-fragment-type", "Invalid fragment type", pm, jn); + var Oq = y7(), En = y7(); + this.sY = nj(this, "invalid-types-type", "Invalid types type", Oq, En); + var $n = y7(), Rp = y7(); + this.f6 = nj(this, "invalid-documentation-type", "Invalid documentation type", $n, Rp); + var ao = y7(), Xt = y7(); + this.Y5 = nj(this, "invalid-allowed-targets-type", "Invalid allowedTargets type", ao, Xt); + var Fs = y7(), Sp = y7(); + this.h6 = nj(this, "invalid-extension-type", "Invalid extension type", Fs, Sp); + var bo = y7(), Gs = y7(); + this.I7 = nj(this, "module-not-found", "Module not found", bo, Gs); + var Fn = y7(), Pq = y7(); + this.HF = nj( + this, + "invalid-type-expression", + "Invalid type expression", + Fn, + Pq + ); + var Jr = y7(), Hs = y7(); + this.k_ = nj(this, "unexpected-reference", "Unexpected reference", Jr, Hs); + var Is = y7(), Kr = y7(); + this.PZ = nj(this, "read-only-property-marked-required", "Read only property should not be marked as required by a schema", Is, Kr); + var Js = y7(), Ks = y7(); + this.eZ = nj(this, "missing-discriminator-property", "Type is missing property marked as discriminator", Js, Ks); + var ov = y7(), pv = y7(); + this.pY = nj(this, "invalid-payload", "Invalid payload", ov, pv); + var Ls = y7(), qv = y7(); + this.v6 = nj( + this, + "invalid-value-in-properties-facet", + "Properties facet must be a map of key and values", + Ls, + qv + ); + var rv = y7(), Yt = y7(); + this.fga = nj(this, "invalid-user-defined-facet-name", "User defined facets must not begin with open parenthesis", rv, Yt); + var sv = y7(), Qq = y7(); + this.kY = nj(this, "invalid-field-name-in-components", "Field name in components must match the following expression: ^[a-zA-Z0-9\\.\\-_]+$", sv, Qq); + var tv = y7(), Ms = y7(); + this.E7 = nj(this, "missing-user-defined-facet", "Type is missing required user defined facet", tv, Ms); + var Zt = y7(), uv = y7(); + this.Q7 = nj( + this, + "parameter-missing-schema-or-content", + "Parameter must define a 'schema' or 'content' field, but not both", + Zt, + uv + ); + var cp = y7(), Ns = y7(); + this.a8 = nj(this, "server-variable-missing-default", "Server variable must define a 'default' field", cp, Ns); + var $t = y7(), au = y7(); + this.lia = nj(this, "user-defined-facets-matches-built-in", "User defined facet name matches built in facet of type", $t, au); + var Qj = y7(), Jw = y7(); + nj(this, "invalid-endpoint-declaration", "Invalid endpoint declaration", Qj, Jw); + var dp = y7(), bu = y7(); + this.kia = nj( + this, + "user-defined-facets-matches-ancestor", + "User defined facet name matches ancestor type facet", + dp, + bu + ); + var ui = y7(), Os = y7(); + this.d8 = nj(this, "slash-in-uri-parameter-value", "Values of uri parameter must not contain '/' character", ui, Os); + var Ps = y7(), cu = y7(); + this.w6 = nj(this, "items-field-required", "'items' field is required when type is array", Ps, cu); + var Qs = Gb().ab, du = this.$X.j, vv = Yb().qb, wv = lj(this, vv), xv = new R6().M(du, wv), py = this.tZ.j, Rq = Gb().ab, Kw = lk(), Lw = Yb().qb, eu = new R6().M(Kw, Lw), yv = mk(), qy = Yb().qb, zv = [ + eu, + new R6().M(yv, qy) + ], Mw = Rb(Rq, new Ib().ha(zv)), ry = new R6().M(py, Mw), Tp = this.vZ.j, Ss = Yb().qb, Nw = lj(this, Ss), fu = new R6().M(Tp, Nw), Ow = this.wZ.j, Pw = Yb().qb, Sq = lj(this, Pw), gu = new R6().M(Ow, Sq), Qw = this.uZ.j, Rw = Gb().ab, Sw = lk(), AA = Yb().qb, Up = new R6().M(Sw, AA), kn = mk(), Vp = Yb().qb, sy = [Up, new R6().M(kn, Vp)], BA = Rb(Rw, new Ib().ha(sy)), GD = new R6().M(Qw, BA), Av = this.cJ.j, Tw = Yb().dh, HD = lj(this, Tw), ID = new R6().M(Av, HD), CA = this.EZ.j, DA = Gb().ab, JD = ok2(), KD = Yb().qb, EA = new R6().M(JD, KD), yG = pk(), zG = Yb().qb, LD = new R6().M(yG, zG), GA = qk(), AG = Yb().qb, uy = new R6().M(GA, AG), BG = lk(), MD = Yb().dh, ND = new R6().M(BG, MD), OD = mk(), Us = Yb().dh, vy = new R6().M(OD, Us), HA = nk(), IA = Yb().dh, Vs = new R6().M(HA, IA), JA = kk(), KA = Yb().dh, wy = [EA, LD, uy, ND, vy, Vs, new R6().M(JA, KA)], xy = Rb(DA, new Ib().ha(wy)), PD = new R6().M(CA, xy), Bv = this.yR.j, LA = Gb().ab, QD = ok2(), RD = Yb().qb, yy = new R6().M(QD, RD), CG = pk(), qm = Yb().qb, Lm = new R6().M(CG, qm), Xg = qk(), ln = Yb().qb, ep = new R6().M(Xg, ln), ty = lk(), Ts = Yb().dh, Mr = new R6().M(ty, Ts), hu = mk(), FA = Yb().dh, Uw = new R6().M(hu, FA), vG = nk(), wG = Yb().dh, xG = new R6().M( + vG, + wG + ), rT = kk(), nH = Yb().dh, sT = [yy, Lm, ep, Mr, Uw, xG, new R6().M(rT, nH)], tT = Rb(LA, new Ib().ha(sT)), uT = new R6().M(Bv, tT), Oy = this.rZ.j, Py = Yb().dh, Ur = lj(this, Py), jB = new R6().M(Oy, Ur), Vr = this.TZ.j, Pv = Yb().dh, op = lj(this, Pv), jE = new R6().M(Vr, op), kB = this.WZ.j, vT = Yb().dh, wma = lj(this, vT), kPa = new R6().M(kB, wma), lPa = this.HJ.j, Lza = Yb().dh, mPa = lj(this, Lza), Mza = new R6().M(lPa, mPa), nPa = this.rY.j, oPa = Yb().dh, pPa = lj(this, oPa), qPa = new R6().M(nPa, pPa), rPa = this.VM.j, sPa = Yb().dh, tPa = lj(this, sPa), uPa = new R6().M(rPa, tPa), vPa = this.PZ.j, wPa = Yb().dh, xPa = lj(this, wPa), yPa = new R6().M(vPa, xPa), zPa = this.eZ.j, APa = Yb().qb, BPa = lj(this, APa), CPa = new R6().M(zPa, BPa), DPa = this.pY.j, EPa = Yb().qb, FPa = lj(this, EPa), GPa = [xv, ry, fu, gu, GD, ID, PD, uT, jB, jE, kPa, Mza, qPa, uPa, yPa, CPa, new R6().M(DPa, FPa)]; + this.Am = Rb(Qs, new Ib().ha(GPa)); + ii(); + this.Bf = Wv(new Ib().ha([ + this.PX, + this.vR, + this.ZM, + this.U7, + this.jS, + this.hZ, + this.p8, + this.cJ, + this.q_, + this.B5, + this.J5, + this.xN, + this.vZ, + this.QX, + this.C5, + this.EZ, + this.yR, + this.uZ, + this.tZ, + this.wZ, + this.vN, + this.n8, + this.k8, + this.GR, + this.rZ, + this.l_, + this.jY, + this.nY, + this.iY, + this.uY, + this.X5, + this.W5, + this.o6, + this.p6, + this.q6, + this.l8, + this.bJ, + this.u6, + this.j8, + this.e6, + this.n6, + this.x6, + this.cga, + this.tY, + this.i6, + this.V5, + this.M5, + this.TZ, + this.kS, + this.R7, + this.X7, + this.y5, + this.qY, + this.$7, + this.r6, + this.HR, + this.OX, + this.A5, + this.m6, + this.s6, + this.S7, + this.HJ, + this.a6, + this.$5, + this.oY, + this.l6, + this.k6, + this.g6, + this.i_, + this.aN, + this.Z5, + this.Oy, + this.sY, + this.WZ, + this.N5, + this.f6, + this.Y5, + this.HF, + this.h6, + this.I7, + this.k_, + this.rY, + this.m8, + this.mY, + this.VM, + this.PZ, + this.eZ, + this.pY, + this.v6, + this.fga, + this.kY, + this.E7, + this.Q7, + this.a8, + this.d8, + this.d6, + this.w6, + this.t6 + ])); + return this; + }; + VR.prototype.$classData = r8({ t2a: 0 }, false, "amf.validations.ParserSideValidations$", { t2a: 1, f: 1, ZR: 1 }); + var rJa = void 0; + function sg() { + rJa || (rJa = new VR().a()); + return rJa; + } + function WR() { + this.Bf = this.Am = this.UZ = this.EF = this.lS = this.ey = this.ty = null; + this.xa = false; + } + WR.prototype = new u7(); + WR.prototype.constructor = WR; + WR.prototype.a = function() { + sJa = this; + this.ty = oj().Zha; + this.ey = F6().NM; + var a10 = y7(), b10 = y7(); + this.lS = nj(this, "unsupported-example-media-type-warning", "Cannot validate example with unsupported media type", a10, b10); + a10 = y7(); + b10 = y7(); + this.EF = nj(this, "example-validation-error", "Example does not validate type", a10, b10); + a10 = y7(); + b10 = y7(); + this.UZ = nj(this, "schema-exception", "Schema exception", a10, b10); + a10 = this.lS.j; + b10 = Yb().dh; + b10 = lj(this, b10); + a10 = new R6().M(a10, b10); + b10 = this.EF.j; + var c10 = ok2(), e10 = Yb().qb; + c10 = new R6().M(c10, e10); + e10 = pk(); + var f10 = Yb().qb; + e10 = new R6().M(e10, f10); + f10 = qk(); + var g10 = Yb().qb; + f10 = new R6().M(f10, g10); + g10 = lk(); + var h10 = Yb().dh; + g10 = new R6().M(g10, h10); + h10 = mk(); + var k10 = Yb().dh; + h10 = new R6().M(h10, k10); + k10 = nk(); + var l10 = Yb().dh; + k10 = new R6().M(k10, l10); + l10 = kk(); + var m10 = Yb().qb; + c10 = [c10, e10, f10, g10, h10, k10, new R6().M(l10, m10)]; + e10 = UA(new VA(), nu()); + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + WA(e10, c10[f10]), f10 = 1 + f10 | 0; + b10 = new R6().M(b10, e10.eb); + c10 = this.UZ.j; + e10 = Yb().qb; + e10 = lj(this, e10); + a10 = [a10, b10, new R6().M(c10, e10)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.Am = b10.eb; + ii(); + a10 = [this.lS, this.EF, this.UZ]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Bf = c10; + return this; + }; + WR.prototype.$classData = r8({ u2a: 0 }, false, "amf.validations.PayloadValidations$", { u2a: 1, f: 1, ZR: 1 }); + var sJa = void 0; + function Ko() { + sJa || (sJa = new WR().a()); + return sJa; + } + function YR() { + this.Bf = this.Am = this.Ix = this.ey = this.ty = null; + this.xa = false; + } + YR.prototype = new u7(); + YR.prototype.constructor = YR; + YR.prototype.a = function() { + tJa = this; + this.ty = oj().aia; + this.ey = F6().i5; + var a10 = y7(), b10 = y7(); + this.Ix = nj(this, "render-validation", "Default render validation", a10, b10); + this.Am = Rb(Gb().ab, H10()); + ii(); + a10 = [this.Ix]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Bf = c10; + return this; + }; + YR.prototype.$classData = r8({ v2a: 0 }, false, "amf.validations.RenderSideValidations$", { v2a: 1, f: 1, ZR: 1 }); + var tJa = void 0; + function Lo() { + tJa || (tJa = new YR().a()); + return tJa; + } + function ZR() { + this.Bf = this.Am = this.L5 = this.K5 = this.b6 = this.T7 = this.j_ = this.J7 = this.cN = this.JR = this.fZ = this.q8 = this.ey = this.ty = null; + this.xa = false; + } + ZR.prototype = new u7(); + ZR.prototype.constructor = ZR; + ZR.prototype.a = function() { + uJa = this; + this.ty = oj().bia; + this.ey = F6().j5; + var a10 = y7(), b10 = y7(); + this.q8 = nj(this, "unsupported-pipeline", "Unsupported pipeline", a10, b10); + a10 = y7(); + b10 = y7(); + this.fZ = nj(this, "missing-extension", "Missing extension in reference", a10, b10); + a10 = y7(); + b10 = y7(); + this.JR = nj(this, "invalid-type-inheritance-warning", "Invalid inheritance relationship", a10, b10); + a10 = y7(); + b10 = y7(); + this.cN = nj(this, "invalid-type-inheritance", "Invalid inheritance relationship", a10, b10); + a10 = y7(); + b10 = y7(); + this.J7 = nj( + this, + "nested-endpoint", + "Nested endpoints", + a10, + b10 + ); + a10 = y7(); + b10 = y7(); + this.j_ = nj(this, "unequal-media-type-definitions-in-extends-payloads", "Cannot merge payloads with explicit and implicit media types", a10, b10); + a10 = y7(); + b10 = y7(); + this.T7 = nj(this, "parse-resource-type-fail", "Failed while parsing an endpoint from a resource type", a10, b10); + a10 = y7(); + b10 = y7(); + this.b6 = nj(this, "invalid-consumes-with-file-parameter", "File parameters must have specific consumes property defined", a10, b10); + a10 = y7(); + b10 = y7(); + this.K5 = nj( + this, + "examples-with-invalid-mime-type", + "Mime type defined in 'examples' must be present in a 'produces' property", + a10, + b10 + ); + a10 = y7(); + b10 = y7(); + this.L5 = nj(this, "examples-with-no-schema-defined", "When schema is undefined, 'examples' facet is invalid as no content is returned as part of the response", a10, b10); + a10 = this.JR.j; + b10 = Yb().dh; + b10 = lj(this, b10); + a10 = [new R6().M(a10, b10)]; + b10 = UA(new VA(), nu()); + for (var c10 = 0, e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + this.Am = b10.eb; + ii(); + a10 = [this.fZ, this.cN, this.JR, this.J7, this.j_, this.T7, this.q8, this.b6, this.K5, this.L5]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Bf = c10; + return this; + }; + ZR.prototype.$classData = r8({ w2a: 0 }, false, "amf.validations.ResolutionSideValidations$", { w2a: 1, f: 1, ZR: 1 }); + var uJa = void 0; + function Mo() { + uJa || (uJa = new ZR().a()); + return uJa; + } + function $R() { + this.TJ = this.qja = null; + this.xa = 0; + } + $R.prototype = new u7(); + $R.prototype.constructor = $R; + function vJa() { + } + d7 = vJa.prototype = $R.prototype; + d7.p7a = function() { + ha(Ja(ma), ["UTF8", "unicode-1-1-utf-8"]); + this.TJ = "UTF-8"; + }; + d7.h = function(a10) { + return a10 instanceof $R ? this.TJ === a10.TJ : false; + }; + d7.tr = function(a10) { + return OK2(ua(), this.TJ, a10.TJ); + }; + d7.t = function() { + return this.TJ; + }; + function tja(a10, b10) { + b10 = vsa(zsa(), b10, b10.length | 0); + if (0 === (4 & a10.xa) << 24 >> 24 && 0 === (4 & a10.xa) << 24 >> 24) { + var c10 = new aS().a(), e10 = TE().wJ; + if (null === e10) + throw new Zj().e("null CodingErrorAction"); + c10.II = e10; + e10 = TE().wJ; + if (null === e10) + throw new Zj().e("null CodingErrorAction"); + c10.KI = e10; + a10.qja = c10; + a10.xa = (4 | a10.xa) << 24 >> 24; + } + a10 = a10.qja; + if (0 === (b10.Ze - b10.ud | 0)) + var f10 = rsa(0); + else { + a10.gx = 0; + c10 = Aa(da(da(b10.Ze - b10.ud | 0) * a10.xfa)); + c10 = rsa(c10); + b: + for (; ; ) { + c: { + e10 = a10; + var g10 = b10, h10 = c10; + if (3 === e10.gx) + throw new Hj().a(); + e10.gx = 2; + for (; ; ) { + try { + f10 = wJa(g10, h10); + } catch (A10) { + if (A10 instanceof RE) + throw Dsa(A10); + if (A10 instanceof Lv) + throw Dsa(A10); + throw A10; + } + if (0 === f10.tu) { + var k10 = g10.Ze - g10.ud | 0; + if (0 < k10) { + var l10 = SE(); + switch (k10) { + case 1: + k10 = l10.us; + break; + case 2: + k10 = l10.QU; + break; + case 3: + k10 = l10.jL; + break; + case 4: + k10 = l10.cba; + break; + default: + k10 = Esa(l10, k10); + } + } else + k10 = f10; + } else + k10 = f10; + if (0 === k10.tu || 1 === k10.tu) { + e10 = k10; + break c; + } + l10 = 3 === k10.tu ? e10.KI : e10.II; + if (TE().wJ === l10) { + if ((h10.Ze - h10.ud | 0) < e10.JI.n.length) { + e10 = SE().bt; + break c; + } + var m10 = e10.JI; + l10 = h10; + var p10 = m10; + m10 = m10.n.length; + if (l10.Ss) + throw new VE().a(); + if (0 > m10 || 0 > (p10.n.length - m10 | 0)) + throw new U6().a(); + var t10 = l10.ud, v10 = t10 + m10 | 0; + if (v10 > l10.Ze) + throw new RE().a(); + l10.ud = v10; + Ba(p10, 0, l10.bj, l10.Mk + t10 | 0, m10); + l10 = g10.ud; + k10 = k10.iL; + if (0 > k10) + throw new Lu().a(); + KE.prototype.qg.call(g10, l10 + k10 | 0); + } else { + if (TE().xJ === l10) { + e10 = k10; + break c; + } + if (TE().T5 === l10) { + l10 = g10.ud; + k10 = k10.iL; + if (0 > k10) + throw new Lu().a(); + KE.prototype.qg.call(g10, l10 + k10 | 0); + } else + throw new x7().d(l10); + } + } + } + if (0 !== e10.tu) { + if (1 === e10.tu) { + c10 = Hsa(c10); + continue b; + } + Isa(e10); + throw new uK().d("should not get here"); + } + if (b10.ud !== b10.Ze) + throw new uK().a(); + f10 = c10; + break; + } + b: + for (; ; ) { + c: + switch (b10 = a10, b10.gx) { + case 2: + c10 = SE().$t; + 0 === c10.tu && (b10.gx = 3); + b10 = c10; + break c; + case 3: + b10 = SE().$t; + break c; + default: + throw new Hj().a(); + } + if (0 !== b10.tu) { + if (1 === b10.tu) { + f10 = Hsa(f10); + continue b; + } + Isa(b10); + throw new uK().d("should not get here"); + } + break; + } + KE.prototype.qO.call(f10); + } + return f10; + } + d7.z = function() { + return NJ(OJ(), this.TJ); + }; + function bS() { + QE.call(this); + } + bS.prototype = new Asa(); + bS.prototype.constructor = bS; + bS.prototype.a = function() { + QE.prototype.Baa.call(this, Kv(), 1); + return this; + }; + function Csa(a10, b10) { + if (null === a10.bj || a10.Ss || null === b10.bj || b10.hH()) + for (; ; ) { + var c10 = a10.ud; + if (a10.ud === a10.Ze) + return SE().$t; + var e10 = xJa(a10); + if (0 <= e10) { + if (b10.ud === b10.Ze) + return b10 = SE().bt, KE.prototype.qg.call(a10, c10), b10; + b10.EP(65535 & e10); + } else { + var f10 = Kv().dba.n[127 & e10]; + if (-1 === f10) + return b10 = SE().us, KE.prototype.qg.call(a10, c10), b10; + if (a10.ud !== a10.Ze) { + var g10 = xJa(a10); + if (128 !== (192 & g10)) { + e10 = SE().us; + var h10 = g10 = 0; + } else + 2 === f10 ? (e10 = (31 & e10) << 6 | 63 & g10, 128 > e10 ? (e10 = SE().us, g10 = 0) : (g10 = 65535 & e10, e10 = null), h10 = 0) : a10.ud !== a10.Ze ? (h10 = xJa(a10), 128 !== (192 & h10) ? (e10 = SE().QU, h10 = g10 = 0) : 3 === f10 ? (e10 = (15 & e10) << 12 | (63 & g10) << 6 | 63 & h10, 2048 > e10 ? (e10 = SE().us, g10 = 0) : 55296 <= e10 && 57343 >= e10 ? (e10 = SE().jL, g10 = 0) : (g10 = 65535 & e10, e10 = null), h10 = 0) : a10.ud !== a10.Ze ? (f10 = xJa(a10), 128 !== (192 & f10) ? (e10 = SE().jL, h10 = g10 = 0) : (e10 = (7 & e10) << 18 | (63 & g10) << 12 | (63 & h10) << 6 | 63 & f10, 65536 > e10 || 1114111 < e10 ? (e10 = SE().us, h10 = g10 = 0) : (e10 = -65536 + e10 | 0, g10 = 65535 & (55296 | e10 >> 10), h10 = 65535 & (56320 | 1023 & e10), e10 = null))) : (e10 = SE().$t, h10 = g10 = 0)) : (e10 = SE().$t, h10 = g10 = 0); + } else + e10 = SE().$t, h10 = g10 = 0; + if (null !== e10) + return b10 = e10, KE.prototype.qg.call(a10, c10), b10; + if (0 === h10) { + if (b10.ud === b10.Ze) + return b10 = SE().bt, KE.prototype.qg.call(a10, c10), b10; + b10.EP(g10); + } else { + if (2 > (b10.Ze - b10.ud | 0)) + return b10 = SE().bt, KE.prototype.qg.call(a10, c10), b10; + b10.EP(g10); + b10.EP(h10); + } + } + } + else + return yJa(a10, b10); + } + function yJa(a10, b10) { + var c10 = a10.bj; + if (null === c10) + throw new Lu().a(); + if (a10.Ss) + throw new VE().a(); + var e10 = a10.Mk; + if (-1 === e10) + throw new Lu().a(); + if (a10.Ss) + throw new VE().a(); + var f10 = a10.ud + e10 | 0, g10 = a10.Ze + e10 | 0, h10 = b10.bj; + if (null === h10) + throw new Lu().a(); + if (b10.hH()) + throw new VE().a(); + var k10 = b10.Mk; + if (-1 === k10) + throw new Lu().a(); + if (b10.hH()) + throw new VE().a(); + var l10 = b10.Ze + k10 | 0, m10 = b10.ud + k10 | 0; + for (; ; ) { + if (f10 === g10) + return c10 = SE().$t, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + var p10 = c10.n[f10]; + if (0 <= p10) { + if (m10 === l10) + return c10 = SE().bt, KE.prototype.qg.call( + a10, + f10 - e10 | 0 + ), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = 65535 & p10; + m10 = 1 + m10 | 0; + f10 = 1 + f10 | 0; + } else { + var t10 = Kv().dba.n[127 & p10]; + if (-1 === t10) + return c10 = SE().us, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + if ((1 + f10 | 0) >= g10) { + p10 = SE().$t; + var v10 = 0, A10 = 0; + } else if (v10 = c10.n[1 + f10 | 0], 128 !== (192 & v10)) + p10 = SE().us, A10 = v10 = 0; + else if (2 === t10) + p10 = (31 & p10) << 6 | 63 & v10, 128 > p10 ? (p10 = SE().us, v10 = 0) : (v10 = 65535 & p10, p10 = null), A10 = 0; + else if ((2 + f10 | 0) >= g10) + p10 = SE().$t, A10 = v10 = 0; + else if (A10 = c10.n[2 + f10 | 0], 128 !== (192 & A10)) + p10 = SE().QU, A10 = v10 = 0; + else if (3 === t10) + p10 = (15 & p10) << 12 | (63 & v10) << 6 | 63 & A10, 2048 > p10 ? (p10 = SE().us, v10 = 0) : 55296 <= p10 && 57343 >= p10 ? (p10 = SE().jL, v10 = 0) : (v10 = 65535 & p10, p10 = null), A10 = 0; + else if ((3 + f10 | 0) >= g10) + p10 = SE().$t, A10 = v10 = 0; + else { + var D10 = c10.n[3 + f10 | 0]; + 128 !== (192 & D10) ? (p10 = SE().jL, A10 = v10 = 0) : (p10 = (7 & p10) << 18 | (63 & v10) << 12 | (63 & A10) << 6 | 63 & D10, 65536 > p10 || 1114111 < p10 ? (p10 = SE().us, A10 = v10 = 0) : (p10 = -65536 + p10 | 0, v10 = 65535 & (55296 | p10 >> 10), A10 = 65535 & (56320 | 1023 & p10), p10 = null)); + } + if (null !== p10) + return c10 = p10, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + if (0 === A10) { + if (m10 === l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = v10; + m10 = 1 + m10 | 0; + f10 = f10 + t10 | 0; + } else { + if ((2 + m10 | 0) > l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = v10; + h10.n[1 + m10 | 0] = A10; + m10 = 2 + m10 | 0; + f10 = f10 + t10 | 0; + } + } + } + } + bS.prototype.$classData = r8({ a3a: 0 }, false, "java.nio.charset.UTF_8$Decoder", { a3a: 1, ohb: 1, f: 1 }); + function aS() { + UE.call(this); + } + aS.prototype = new Gsa(); + aS.prototype.constructor = aS; + aS.prototype.a = function() { + UE.prototype.Baa.call(this, Kv(), 1.100000023841858); + return this; + }; + function wJa(a10, b10) { + if (null === a10.bj || a10.hH() || null === b10.bj || b10.Ss) + for (; ; ) { + if (a10.ud === a10.Ze) + return SE().$t; + var c10 = a10.AO(); + if (128 > c10) { + if (b10.ud === b10.Ze) + return b10 = SE().bt, KE.prototype.qg.call(a10, -1 + a10.ud | 0), b10; + cS(b10, c10 << 24 >> 24); + } else if (2048 > c10) { + if (2 > (b10.Ze - b10.ud | 0)) + return b10 = SE().bt, KE.prototype.qg.call(a10, -1 + a10.ud | 0), b10; + cS(b10, (192 | c10 >> 6) << 24 >> 24); + cS(b10, (128 | 63 & c10) << 24 >> 24); + } else if (Kv(), 55296 !== (63488 & c10)) { + if (3 > (b10.Ze - b10.ud | 0)) + return b10 = SE().bt, KE.prototype.qg.call(a10, -1 + a10.ud | 0), b10; + cS(b10, (224 | c10 >> 12) << 24 >> 24); + cS(b10, (128 | 63 & c10 >> 6) << 24 >> 24); + cS(b10, (128 | 63 & c10) << 24 >> 24); + } else if (55296 === (64512 & c10)) { + if (a10.ud === a10.Ze) + return b10 = SE().$t, KE.prototype.qg.call(a10, -1 + a10.ud | 0), b10; + var e10 = a10.AO(); + if (56320 !== (64512 & e10)) + return b10 = SE().us, KE.prototype.qg.call(a10, -2 + a10.ud | 0), b10; + if (4 > (b10.Ze - b10.ud | 0)) + return b10 = SE().bt, KE.prototype.qg.call(a10, -2 + a10.ud | 0), b10; + c10 = 65536 + (((1023 & c10) << 10) + (1023 & e10) | 0) | 0; + cS(b10, (240 | c10 >> 18) << 24 >> 24); + cS(b10, (128 | 63 & c10 >> 12) << 24 >> 24); + cS(b10, (128 | 63 & c10 >> 6) << 24 >> 24); + cS(b10, (128 | 63 & c10) << 24 >> 24); + } else + return b10 = SE().us, KE.prototype.qg.call(a10, -1 + a10.ud | 0), b10; + } + else + return zJa( + a10, + b10 + ); + } + function zJa(a10, b10) { + var c10 = a10.bj; + if (null === c10) + throw new Lu().a(); + if (a10.hH()) + throw new VE().a(); + var e10 = a10.Mk; + if (-1 === e10) + throw new Lu().a(); + if (a10.hH()) + throw new VE().a(); + var f10 = a10.ud + e10 | 0, g10 = a10.Ze + e10 | 0, h10 = b10.bj; + if (null === h10) + throw new Lu().a(); + if (b10.Ss) + throw new VE().a(); + var k10 = b10.Mk; + if (-1 === k10) + throw new Lu().a(); + if (b10.Ss) + throw new VE().a(); + var l10 = b10.Ze + k10 | 0, m10 = b10.ud + k10 | 0; + for (; ; ) { + if (f10 === g10) + return c10 = SE().$t, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + var p10 = c10.n[f10]; + if (128 > p10) { + if (m10 === l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = p10 << 24 >> 24; + m10 = 1 + m10 | 0; + f10 = 1 + f10 | 0; + } else if (2048 > p10) { + if ((2 + m10 | 0) > l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = (192 | p10 >> 6) << 24 >> 24; + h10.n[1 + m10 | 0] = (128 | 63 & p10) << 24 >> 24; + m10 = 2 + m10 | 0; + f10 = 1 + f10 | 0; + } else if (Kv(), 55296 !== (63488 & p10)) { + if ((3 + m10 | 0) > l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + h10.n[m10] = (224 | p10 >> 12) << 24 >> 24; + h10.n[1 + m10 | 0] = (128 | 63 & p10 >> 6) << 24 >> 24; + h10.n[2 + m10 | 0] = (128 | 63 & p10) << 24 >> 24; + m10 = 3 + m10 | 0; + f10 = 1 + f10 | 0; + } else if (55296 === (64512 & p10)) { + if ((1 + f10 | 0) === g10) + return c10 = SE().$t, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + var t10 = c10.n[1 + f10 | 0]; + if (56320 !== (64512 & t10)) + return c10 = SE().us, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + if ((4 + m10 | 0) > l10) + return c10 = SE().bt, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + p10 = 65536 + (((1023 & p10) << 10) + (1023 & t10) | 0) | 0; + h10.n[m10] = (240 | p10 >> 18) << 24 >> 24; + h10.n[1 + m10 | 0] = (128 | 63 & p10 >> 12) << 24 >> 24; + h10.n[2 + m10 | 0] = (128 | 63 & p10 >> 6) << 24 >> 24; + h10.n[3 + m10 | 0] = (128 | 63 & p10) << 24 >> 24; + m10 = 4 + m10 | 0; + f10 = 2 + f10 | 0; + } else + return c10 = SE().us, KE.prototype.qg.call(a10, f10 - e10 | 0), KE.prototype.qg.call(b10, m10 - k10 | 0), c10; + } + } + aS.prototype.$classData = r8({ b3a: 0 }, false, "java.nio.charset.UTF_8$Encoder", { b3a: 1, phb: 1, f: 1 }); + function dS() { + this.ah = null; + } + dS.prototype = new u7(); + dS.prototype.constructor = dS; + function AJa() { + } + AJa.prototype = dS.prototype; + dS.prototype.t = function() { + return this.ah; + }; + dS.prototype.Caa = function(a10, b10) { + this.ah = b10; + 0 === (b10.length | 0) || (b10.charCodeAt(0), a10.W2()); + return this; + }; + function eS() { + } + eS.prototype = new u7(); + eS.prototype.constructor = eS; + function BJa() { + } + BJa.prototype = eS.prototype; + eS.prototype.R_ = function(a10) { + return null === a10 ? null : new fS().Caa(this, a10); + }; + eS.prototype.W2 = function() { + return 65535 & (Daa.sep.charCodeAt(0) | 0); + }; + function gS() { + } + gS.prototype = new u7(); + gS.prototype.constructor = gS; + gS.prototype.a = function() { + return this; + }; + gS.prototype.yD = function(a10, b10) { + jF(a10.IS.s, b10); + }; + gS.prototype.hv = function(a10, b10) { + CJa(a10.IS, b10); + }; + gS.prototype.$classData = r8({ n3a: 0 }, false, "org.mulesoft.common.io.Output$OutputWriter$", { n3a: 1, f: 1, l3a: 1 }); + var DJa = void 0; + function cfa() { + DJa || (DJa = new gS().a()); + return DJa; + } + function Dp() { + } + Dp.prototype = new u7(); + Dp.prototype.constructor = Dp; + Dp.prototype.a = function() { + return this; + }; + Dp.prototype.yD = function(a10, b10) { + this.hv(a10, ba.String.fromCharCode(b10)); + }; + Dp.prototype.hv = function(a10, b10) { + EJa(a10, b10); + }; + Dp.prototype.$classData = r8({ o3a: 0 }, false, "org.mulesoft.common.io.Output$StringBufferWriter$", { o3a: 1, f: 1, l3a: 1 }); + var Xea = void 0; + function hS() { + this.Oj = this.Rf = this.tL = this.dQ = this.ioa = this.kb = null; + } + hS.prototype = new u7(); + hS.prototype.constructor = hS; + function FJa() { + } + FJa.prototype = hS.prototype; + function GJa(a10) { + var b10 = a10.kb.Db; + b10 = uF(vF(), b10.cf, b10.Dg, b10.Ij); + a10 = a10.ioa; + return b10.Yx() ? a10 : a10.Yx() ? b10 : uF(vF(), b10.cf + a10.cf | 0, b10.Dg + a10.Dg | 0, b10.Ij + a10.Ij | 0); + } + function iS(a10, b10) { + var c10 = GJa(a10), e10 = a10.dQ, f10 = new jS(), g10 = nha(a10.Rf, a10.tL.Ij, c10.Ij, a10.tL.cf, a10.tL.Dg, c10.cf, c10.Dg); + f10.kx = b10; + f10.yc = g10; + gta(e10, f10); + a10.tL = c10; + return true; + } + function kS(a10) { + for (; a10.dQ.b(); ) + if (a10.kb.Db.fc !== rF().Xs) { + var b10 = a10.kb.Db.Ij; + a10.Kka(a10.kb.Db.fc); + b10 === a10.kb.Db.Ij && kS(a10); + } else + a10.noa(); + a10.Oj = fta(a10.dQ); + } + hS.prototype.YG = function(a10, b10) { + this.kb = a10; + this.ioa = b10; + this.dQ = new wF().a(); + this.tL = GJa(this); + this.Rf = this.kb.Rf; + this.mma(); + return this; + }; + function WG(a10, b10) { + return a10.kb.bI(b10.yc.Au, b10.yc.pA); + } + function lS(a10, b10, c10) { + return 0 >= b10 || (mS(a10.kb, b10), iS(a10, c10)); + } + function nS(a10, b10) { + return a10.kb.Db.fc === b10 ? (a10 = a10.kb, oS(a10.Db, a10.jg, a10.Sj), true) : false; + } + function HJa(a10, b10) { + var c10 = b10.length | 0; + if (0 < c10) { + var e10 = new pS().Fi(0, c10, 1); + e10 = qS(new rS(), e10, 0, e10.Oa()); + for (var f10 = true; f10 && e10.Ya(); ) + f10 = e10.$a() | 0, f10 = (65535 & (b10.charCodeAt(f10) | 0)) === sS(a10.kb, f10); + a10 = f10; + } else + a10 = false; + return a10 ? c10 : 0; + } + function IJa(a10, b10) { + b10 = HJa(a10, b10); + return 0 !== b10 && (mS(a10.kb, b10), true); + } + hS.prototype.Kka = function() { + }; + function tS(a10, b10) { + var c10 = a10.kb; + oS(c10.Db, c10.jg, c10.Sj); + return iS(a10, b10); + } + function pF() { + this.jg = null; + this.Sj = this.aqa = 0; + this.Db = this.Rf = null; + } + pF.prototype = new u7(); + pF.prototype.constructor = pF; + pF.prototype.Laa = function(a10, b10, c10, e10) { + this.jg = a10; + this.aqa = b10; + this.Sj = c10; + this.Rf = e10; + e10 = rF().Xs; + b10 = JJa(0, 1, b10, b10, e10); + 0 !== c10 && (b10.Dg = -1, b10.Ij = -1, oS(b10, a10, c10)); + this.Db = b10; + return this; + }; + pF.prototype.bI = function(a10, b10) { + if (a10 < this.aqa || b10 > this.Sj || b10 < a10) + throw new Zj().e("Invalid sub-sequence"); + return ya(this.jg, a10, b10); + }; + function uS(a10, b10) { + var c10 = 0; + b10 = -1 + (a10.Db.As + b10 | 0) | 0; + if (0 > b10) + return 0; + for (; b10 < a10.Sj; ) { + var e10 = xa(a10.jg, b10); + if (32 !== e10 && 9 !== e10) + break; + c10 = 1 + c10 | 0; + b10 = 1 + b10 | 0; + } + return c10; + } + function vS(a10, b10) { + var c10 = 0, e10 = -1 + (a10.Db.As + 0 | 0) | 0; + if (0 > e10) + return 0; + for (; c10 < b10 && e10 < a10.Sj && 32 === xa(a10.jg, e10); ) + c10 = 1 + c10 | 0, e10 = 1 + e10 | 0; + return c10; + } + function KJa(a10) { + a10 = a10.Db; + return JJa(a10.Dg, a10.cf, a10.Ij, a10.As, a10.fc); + } + function mS(a10, b10) { + var c10 = -1 + b10 | 0; + if (!(0 >= b10)) + for (b10 = 0; ; ) { + oS(a10.Db, a10.jg, a10.Sj); + if (b10 === c10) + break; + b10 = 1 + b10 | 0; + } + } + function sS(a10, b10) { + if (0 === b10) + return a10.Db.fc; + var c10 = -1 + (a10.Db.As + b10 | 0) | 0; + if (0 > c10 || c10 >= a10.Sj) + return rF().Xs; + var e10 = xa(a10.jg, c10); + return 0 < b10 ? 55296 === (64512 & e10) && (1 + c10 | 0) < a10.Sj && 56320 === (64512 & xa(a10.jg, 1 + c10 | 0)) ? (a10 = xa(a10.jg, 1 + c10 | 0), 65536 + (((1023 & e10) << 10) + (1023 & a10) | 0) | 0) : e10 : 56320 === (64512 & e10) && 0 < (-1 + c10 | 0) && 55296 === (64512 & xa(a10.jg, -1 + c10 | 0)) ? 65536 + (((1023 & xa(a10.jg, -1 + c10 | 0)) << 10) + (1023 & e10) | 0) | 0 : e10; + } + pF.prototype.$classData = r8({ B3a: 0 }, false, "org.mulesoft.lexer.CharSequenceLexerInput", { B3a: 1, f: 1, vhb: 1 }); + function wS() { + this.Ps = null; + this.loa = false; + this.CK = this.CT = null; + } + wS.prototype = new mta(); + wS.prototype.constructor = wS; + function LJa() { + } + LJa.prototype = wS.prototype; + wS.prototype.Gaa = function(a10, b10, c10) { + this.Ps = a10; + this.loa = b10; + this.CT = c10; + this.CK = ""; + return this; + }; + wS.prototype.nba = function(a10) { + MJa(this, a10); + a10 = new Aj().d(this.Ps); + this.CT.yD(a10.Rp, 10); + }; + wS.prototype.Tba = function(a10) { + NJa(this, a10); + a10 = new Aj().d(this.Ps); + this.CT.yD(a10.Rp, 10); + }; + function uda(a10) { + var b10 = new Aj().d(a10.Ps); + a10.CT.hv(b10.Rp, "\n"); + a10.loa ? (b10 = new qg().e(a10.CK), b10 = tc(b10)) : b10 = false; + b10 && (b10 = new Aj().d(a10.Ps), a10.CT.hv(b10.Rp, a10.CK)); + } + function xS() { + this.xH = null; + } + xS.prototype = new mta(); + xS.prototype.constructor = xS; + xS.prototype.a = function() { + return this; + }; + xS.prototype.na = function() { + return null === this.xH; + }; + function OJa(a10, b10) { + var c10 = (0, ba.Object)(), e10 = new yS(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.Pba = c10; + b10.P(e10); + return c10; + } + function PJa(a10, b10) { + a10.xH = QJa(a10, b10); + return a10.xH; + } + xS.prototype.nba = function(a10) { + PJa(this, a10); + }; + function RJa(a10, b10) { + a10.xH = OJa(a10, b10); + return a10.xH; + } + xS.prototype.Tba = function(a10) { + RJa(this, a10); + }; + function SJa(a10) { + var b10 = a10.pM; + if (FF() === b10) + return ka(a10.r); + if (AN() === b10) + return !!a10.r; + if (CN2() === b10) + return +a10.r; + if (BN() === b10) + return b10 = Da(a10.r), a10 = b10.od, b10 = b10.Ud, SD(Ea(), a10, b10); + throw new x7().d(b10); + } + function QJa(a10, b10) { + var c10 = [], e10 = new TJa(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.gW = c10; + b10.P(e10); + return c10; + } + xS.prototype.doc = function(a10) { + return this.xH = QJa(this, a10)[0]; + }; + xS.prototype.obj = function(a10) { + return RJa(this, a10); + }; + xS.prototype.list = function(a10) { + return PJa(this, a10); + }; + Object.defineProperty(xS.prototype, "result", { get: function() { + return this.xH; + }, configurable: true }); + Object.defineProperty(xS.prototype, "isDefined", { get: function() { + return this.na(); + }, configurable: true }); + xS.prototype.$classData = r8({ W3a: 0 }, false, "org.yaml.builder.JsOutputBuilder", { W3a: 1, Sha: 1, f: 1 }); + function TJa() { + this.gW = this.Fa = null; + } + TJa.prototype = new qta(); + TJa.prototype.constructor = TJa; + d7 = TJa.prototype; + d7.Uk = function(a10) { + a10 = QJa(this.Fa, a10); + this.gW.push(a10); + new z7().d(a10); + }; + d7.jX = function(a10) { + this.gW.push(SJa(a10)); + }; + d7.Y4 = function(a10) { + this.gW.push(a10); + }; + d7.Gi = function(a10) { + a10 = OJa(this.Fa, a10); + this.gW.push(a10); + return new z7().d(a10); + }; + d7.$classData = r8({ X3a: 0 }, false, "org.yaml.builder.JsOutputBuilder$$anon$1", { X3a: 1, Uha: 1, f: 1 }); + function yS() { + this.Pba = this.Fa = null; + } + yS.prototype = new ota(); + yS.prototype.constructor = yS; + yS.prototype.y0 = function(a10, b10) { + this.Pba[a10] = SJa(b10); + }; + yS.prototype.kg = function(a10, b10) { + this.Pba[a10] = QJa(this.Fa, b10)[0]; + }; + yS.prototype.$classData = r8({ Y3a: 0 }, false, "org.yaml.builder.JsOutputBuilder$$anon$2", { Y3a: 1, Tha: 1, f: 1 }); + function Zq() { + this.GI = null; + } + Zq.prototype = new mta(); + Zq.prototype.constructor = Zq; + Zq.prototype.a = function() { + this.GI = y7(); + return this; + }; + function UJa(a10) { + var b10 = a10.pM; + if (FF() === b10) + return T6(), a10 = ka(a10.r), mh(T6(), a10); + if (AN() === b10) + return T6(), a10 = !!a10.r, T6(), mr(T6(), tG(or(), a10, ""), Q5().ti); + if (CN2() === b10) + return T6(), a10 = +a10.r, T6(), mr(T6(), tG(or(), a10, ""), Q5().of); + if (BN() === b10) + return T6(), b10 = Da(a10.r), a10 = b10.od, b10 = b10.Ud, T6(), a10 = new qa().Sc(a10, b10), mr(T6(), tG(or(), a10, ""), Q5().cj); + throw new x7().d(b10); + } + function VJa(a10, b10) { + var c10 = new Xj().a(); + a10 = new WJa().Eaa(a10, c10); + b10.P(a10); + return c10; + } + Zq.prototype.nba = function(a10) { + a10 = wda(Dj(), XJa(this, a10)); + this.GI = new z7().d(a10); + }; + Zq.prototype.Tba = function(a10) { + a10 = wda(Dj(), YJa(this, a10)); + this.GI = new z7().d(a10); + }; + function YJa(a10, b10) { + var c10 = new Xj().a(); + a10 = new zS().Eaa(a10, c10); + b10.P(a10); + return mr(T6(), tr(ur(), c10, ""), Q5().sa); + } + function XJa(a10, b10) { + T6(); + eE(); + a10 = VJa(a10, b10); + return mr(0, new Sx().Ac(zs().Hq, a10), Q5().cd); + } + Zq.prototype.$classData = r8({ c4a: 0 }, false, "org.yaml.builder.YDocumentBuilder", { c4a: 1, Sha: 1, f: 1 }); + function WJa() { + this.LS = this.Fa = null; + } + WJa.prototype = new qta(); + WJa.prototype.constructor = WJa; + d7 = WJa.prototype; + d7.Uk = function(a10) { + a10 = XJa(this.Fa, a10); + pr(this.LS, a10); + new z7().d(a10); + }; + d7.jX = function(a10) { + pr(this.LS, UJa(a10)); + }; + d7.Eaa = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.LS = b10; + return this; + }; + d7.Y4 = function(a10) { + a10 instanceof Cs && pr(this.LS, a10); + }; + d7.Gi = function(a10) { + a10 = YJa(this.Fa, a10); + pr(this.LS, a10); + return new z7().d(a10); + }; + d7.$classData = r8({ d4a: 0 }, false, "org.yaml.builder.YDocumentBuilder$$anon$1", { d4a: 1, Uha: 1, f: 1 }); + function zS() { + this.u9 = this.Fa = null; + } + zS.prototype = new ota(); + zS.prototype.constructor = zS; + zS.prototype.y0 = function(a10, b10) { + b10 = UJa(b10); + pr(this.u9, pG(wD(), mh(T6(), a10), b10)); + }; + zS.prototype.Eaa = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.u9 = b10; + return this; + }; + zS.prototype.kg = function(a10, b10) { + b10 = VJa(this.Fa, b10); + b10 = xF(b10, 0); + pr(this.u9, pG(wD(), mh(T6(), a10), b10)); + }; + zS.prototype.$classData = r8({ e4a: 0 }, false, "org.yaml.builder.YDocumentBuilder$$anon$2", { e4a: 1, Tha: 1, f: 1 }); + function AS() { + this.oka = this.m$ = null; + } + AS.prototype = new u7(); + AS.prototype.constructor = AS; + function BS() { + } + BS.prototype = AS.prototype; + AS.prototype.RO = function(a10, b10) { + this.m$ = a10; + this.oka = b10; + }; + AS.prototype.Av = function(a10) { + var b10 = a10.hb().gb; + if (b10 !== this.m$) + return HF(JF(), a10, "Expecting " + this.m$ + " and " + b10 + " provided"); + b10 = Kc(a10); + if (b10 instanceof z7) { + a10 = b10.i; + try { + return ue4(), new ye4().d(a10.oq); + } catch (c10) { + throw c10; + } + } else + return HF(JF(), a10, "Scalar expected"); + }; + AS.prototype.aK = function() { + return this.oka; + }; + function CS() { + this.voa = this.q9 = null; + } + CS.prototype = new u7(); + CS.prototype.constructor = CS; + function ZJa(a10, b10) { + var c10 = a10.q9.es(); + $Ja(c10, b10); + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = e10.voa.Av(g10); + if (!(g10 instanceof ye4)) { + if (g10 instanceof ve4) + throw new YF().o1(g10.i); + throw new x7().d(g10); + } + return f10.jd(g10.i); + }; + }(a10, c10))); + return c10.Rc(); + } + CS.prototype.Av = function(a10) { + try { + var b10 = lc().Av(a10); + return b10 instanceof ye4 ? new ye4().d(ZJa(this, b10.i)) : b10; + } catch (c10) { + if (c10 instanceof YF) + return a10 = c10, ue4(), new ve4().d(a10.ara); + throw c10; + } + }; + function sw(a10, b10) { + var c10 = new CS(); + c10.q9 = a10; + c10.voa = b10; + return c10; + } + CS.prototype.aK = function() { + return this.q9.es().Rc(); + }; + CS.prototype.$classData = r8({ g4a: 0 }, false, "org.yaml.convert.YRead$$anon$1", { g4a: 1, f: 1, az: 1 }); + function DS() { + } + DS.prototype = new u7(); + DS.prototype.constructor = DS; + DS.prototype.a = function() { + return this; + }; + DS.prototype.Av = function(a10) { + var b10 = a10.re(); + return b10 instanceof Sx ? (ue4(), new ye4().d(b10.Cm)) : HF(JF(), a10, "YAML sequence expected"); + }; + DS.prototype.aK = function() { + ue4(); + hG(); + iG(); + return lG(new jG().a()); + }; + DS.prototype.$classData = r8({ m4a: 0 }, false, "org.yaml.convert.YRead$SeqNodeYRead$", { m4a: 1, f: 1, az: 1 }); + var aKa = void 0; + function lc() { + aKa || (aKa = new DS().a()); + return aKa; + } + function ES() { + } + ES.prototype = new u7(); + ES.prototype.constructor = ES; + ES.prototype.a = function() { + return this; + }; + ES.prototype.Av = function(a10) { + var b10 = a10.re(); + return b10 instanceof vw ? (ue4(), new ye4().d(b10)) : HF(JF(), a10, "YAML map expected"); + }; + ES.prototype.aK = function() { + return ur().ce; + }; + ES.prototype.$classData = r8({ o4a: 0 }, false, "org.yaml.convert.YRead$YMapYRead$", { o4a: 1, f: 1, az: 1 }); + var bKa = void 0; + function qc() { + bKa || (bKa = new ES().a()); + return bKa; + } + function FS() { + } + FS.prototype = new u7(); + FS.prototype.constructor = FS; + FS.prototype.a = function() { + return this; + }; + FS.prototype.Av = function(a10) { + var b10 = a10.re(); + return b10 instanceof xt ? (ue4(), new ye4().d(b10)) : HF(JF(), a10, "YAML scalar expected"); + }; + FS.prototype.aK = function() { + return or().nd; + }; + FS.prototype.$classData = r8({ p4a: 0 }, false, "org.yaml.convert.YRead$YScalarYRead$", { p4a: 1, f: 1, az: 1 }); + var cKa = void 0; + function IO() { + cKa || (cKa = new FS().a()); + return cKa; + } + function GS() { + } + GS.prototype = new u7(); + GS.prototype.constructor = GS; + GS.prototype.a = function() { + return this; + }; + GS.prototype.Av = function(a10) { + var b10 = a10.re(); + return b10 instanceof Sx ? (ue4(), new ye4().d(b10)) : HF(JF(), a10, "YAML sequence expected"); + }; + GS.prototype.aK = function() { + return eE().ce; + }; + GS.prototype.$classData = r8({ q4a: 0 }, false, "org.yaml.convert.YRead$YSeqYRead$", { q4a: 1, f: 1, az: 1 }); + var dKa = void 0; + function tw() { + dKa || (dKa = new GS().a()); + return dKa; + } + function UF() { + yF.call(this); + } + UF.prototype = new hta(); + UF.prototype.constructor = UF; + UF.prototype.Hc = function(a10, b10) { + yF.prototype.Hc.call(this, a10, b10); + VF().Lna.Ue(this.oia, this); + return this; + }; + UF.prototype.$classData = r8({ C4a: 0 }, false, "org.yaml.lexer.YamlToken", { C4a: 1, xhb: 1, f: 1 }); + function dG() { + } + dG.prototype = new u7(); + dG.prototype.constructor = dG; + dG.prototype.a = function() { + return this; + }; + dG.prototype.pH = function(a10) { + return a10; + }; + dG.prototype.QL = function() { + return false; + }; + dG.prototype.$classData = r8({ G4a: 0 }, false, "org.yaml.model.FoldedMark$", { G4a: 1, f: 1, bS: 1 }); + var Sta = void 0; + function XF() { + this.nv = null; + } + XF.prototype = new u7(); + XF.prototype.constructor = XF; + XF.prototype.yB = function(a10, b10) { + this.nv.P(a10); + return b10; + }; + XF.prototype.DK = function(a10) { + this.nv = a10; + return this; + }; + XF.prototype.$classData = r8({ I4a: 0 }, false, "org.yaml.model.IllegalTypeHandler$$anon$1", { I4a: 1, f: 1, Zp: 1 }); + function HS() { + } + HS.prototype = new u7(); + HS.prototype.constructor = HS; + HS.prototype.a = function() { + return this; + }; + HS.prototype.pH = function(a10) { + return a10; + }; + HS.prototype.QL = function() { + return false; + }; + HS.prototype.$classData = r8({ K4a: 0 }, false, "org.yaml.model.MultilineMark$", { K4a: 1, f: 1, bS: 1 }); + var eKa = void 0; + function Rta() { + eKa || (eKa = new HS().a()); + return eKa; + } + function IS() { + } + IS.prototype = new u7(); + IS.prototype.constructor = IS; + IS.prototype.a = function() { + return this; + }; + IS.prototype.pH = function(a10) { + return a10; + }; + IS.prototype.QL = function() { + return true; + }; + IS.prototype.$classData = r8({ L4a: 0 }, false, "org.yaml.model.NoMark$", { L4a: 1, f: 1, bS: 1 }); + var fKa = void 0; + function eG() { + fKa || (fKa = new IS().a()); + return fKa; + } + function aG() { + this.Ba = null; + } + aG.prototype = new u7(); + aG.prototype.constructor = aG; + aG.prototype.Ar = function(a10, b10) { + (0, this.Ba)(a10, b10); + }; + aG.prototype.d = function(a10) { + this.Ba = a10; + return this; + }; + aG.prototype.$classData = r8({ N4a: 0 }, false, "org.yaml.model.ParseErrorHandler$$$Lambda$1", { N4a: 1, f: 1, Bp: 1 }); + function $F() { + this.Ba = null; + } + $F.prototype = new u7(); + $F.prototype.constructor = $F; + $F.prototype.Ar = function(a10, b10) { + (0, this.Ba)(a10, b10); + }; + $F.prototype.d = function(a10) { + this.Ba = a10; + return this; + }; + $F.prototype.$classData = r8({ O4a: 0 }, false, "org.yaml.model.ParseErrorHandler$$$Lambda$2", { O4a: 1, f: 1, Bp: 1 }); + function JS() { + } + JS.prototype = new u7(); + JS.prototype.constructor = JS; + JS.prototype.a = function() { + return this; + }; + JS.prototype.pH = function(a10) { + return a10; + }; + JS.prototype.QL = function() { + return false; + }; + JS.prototype.$classData = r8({ U4a: 0 }, false, "org.yaml.model.UnknownMark$", { U4a: 1, f: 1, bS: 1 }); + var gKa = void 0; + function Tta() { + gKa || (gKa = new JS().a()); + return gKa; + } + function HH() { + EG.call(this); + this.BS = this.de = null; + } + HH.prototype = new FG(); + HH.prototype.constructor = HH; + HH.prototype.h = function(a10) { + if (a10 instanceof HH && this.de === a10.de) { + var b10 = this.BS; + a10 = a10.BS; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + HH.prototype.t = function() { + return "%" + this.de + " " + this.BS.Kg(" "); + }; + HH.prototype.z = function() { + var a10 = this.de; + return ta(ua(), a10) + ca(31, this.BS.z()) | 0; + }; + HH.prototype.$classData = r8({ X4a: 0 }, false, "org.yaml.model.YDirective", { X4a: 1, $s: 1, f: 1 }); + function PA() { + this.ca = this.s = null; + } + PA.prototype = new $ta(); + PA.prototype.constructor = PA; + PA.prototype.e = function(a10) { + this.ca = a10; + gG.prototype.a.call(this); + return this; + }; + PA.prototype.fo = function(a10) { + pr(this.s, kua(T6(), a10, this.ca)); + }; + PA.prototype.$classData = r8({ d5a: 0 }, false, "org.yaml.model.YDocument$PartBuilder", { d5a: 1, b5a: 1, f: 1 }); + function Es() { + EG.call(this); + this.i = this.Aa = null; + } + Es.prototype = new FG(); + Es.prototype.constructor = Es; + Es.prototype.t = function() { + return "" + vva(MH(), this.Aa, ": ") + this.i; + }; + function dua(a10, b10, c10, e10, f10) { + a10.Aa = b10; + a10.i = c10; + EG.prototype.Ac.call(a10, e10, f10); + return a10; + } + var hKa = r8({ n5a: 0 }, false, "org.yaml.model.YMapEntry", { n5a: 1, $s: 1, f: 1 }); + Es.prototype.$classData = hKa; + function KS() { + EG.call(this); + this.eI = null; + } + KS.prototype = new FG(); + KS.prototype.constructor = KS; + function iKa() { + } + iKa.prototype = KS.prototype; + KS.prototype.Ac = function(a10, b10) { + this.eI = b10; + ue4(); + hG(); + iG(); + b10 = new jG().a(); + EG.prototype.Ac.call(this, a10, lG(b10)); + return this; + }; + function RG() { + this.Bc = this.ph = null; + this.W1 = false; + this.aj = this.sn = null; + } + RG.prototype = new u7(); + RG.prototype.constructor = RG; + function jKa(a10) { + kKa(a10); + lKa(a10, VF().SM) && (mKa(a10), lKa(a10, VF().YI)); + var b10 = a10.sn.eu(), c10 = VG(a10.sn); + nKa(a10); + return new RA().Ac(c10, mD(Gb(), b10)); + } + function oKa(a10, b10) { + return LS(a10) !== b10 ? !pKa(a10) : false; + } + function qKa(a10, b10, c10) { + return rKa(a10, b10, c10) || (sKa(a10, c10), false); + } + RG.prototype.Gca = function(a10) { + this.W1 = a10; + ue4(); + a10 = [jKa(this)]; + if (0 === (a10.length | 0)) + return hG(), iG(), lG(new jG().a()); + hG(); + iG(); + for (var b10 = new jG().a(), c10 = 0, e10 = a10.length | 0; c10 < e10; ) + MS(b10, a10[c10]), c10 = 1 + c10 | 0; + return lG(b10); + }; + function wua(a10, b10, c10) { + a10.ph = b10; + a10.Bc = c10; + a10.W1 = false; + a10.sn = new UG().SO(a10); + ii(); + b10 = [a10.sn]; + c10 = -1 + (b10.length | 0) | 0; + for (var e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + a10.aj = e10; + return a10; + } + function lKa(a10, b10) { + return tKa(a10, b10) && NS(a10); + } + function uKa(a10, b10) { + nKa(a10); + pr(a10.sn.Jo, b10); + } + function vKa(a10) { + var b10 = VF().Vv; + wKa(a10, b10) && kS(a10.ph); + } + function xKa(a10) { + var b10 = a10.ph; + b10 = "Unexpected '" + ka(WG(b10, b10.Oj)) + "'"; + a10.Bc.Ar(a10.ph.Oj.yc, new OS().iE(b10, null)); + } + function NS(a10) { + yua(a10.sn); + var b10 = a10.ph.Oj.kx, c10 = VF().Vv; + b10 === c10 && (b10 = a10.ph, a10.Bc.Ar(a10.ph.Oj.yc, new qM().iE(ka(WG(b10, b10.Oj)), null))); + kS(a10.ph); + return true; + } + function mKa(a10) { + var b10 = LS(a10); + if (VF().zF === b10) { + kKa(a10); + b10 = yKa(a10, VF().zF, VF().ZC, new PS().SO(a10)); + var c10 = VG(a10.sn); + b10 && NS(a10); + eE(); + var e10 = mD(Gb(), a10.sn.eu()); + c10 = new Sx().Ac(c10, e10); + e10 = Q5().cd; + uKa(a10, zKa(a10, c10, e10.Vi)); + return b10; + } + if (VF().PC === b10) + return kKa(a10), b10 = yKa(a10, VF().PC, VF().wx, new QS().SO(a10)), c10 = VG(a10.sn), b10 && NS(a10), e10 = a10.sn.eu(), ur(), e10 = mD(Gb(), e10), c10 = new vw().Ac(c10, e10), e10 = Q5().sa, uKa(a10, zKa(a10, c10, e10.Vi)), b10; + if (VF().Tv === b10) + return AKa(a10); + xKa(a10); + return false; + } + function yKa(a10, b10, c10, e10) { + BKa(Gb(), wKa(a10, b10)); + NS(a10); + for (a10.sn.hz(); oKa(a10, c10); ) + e10.hd(), oKa(a10, c10) && qKa(a10, VF().Ai, ",") && (NS(a10), CKa(a10), a10.sn.hz(), LS(a10) === c10 && sKa(a10, "value")); + return tKa(a10, c10); + } + function sKa(a10, b10) { + var c10 = a10.ph; + c10 = ka(WG(c10, c10.Oj)); + if (null === c10) + throw new sf().a(); + "" === c10 ? b10 = "Missing '" + b10 + "'" : (c10 = a10.ph, b10 = "Expecting '" + b10 + "' but '" + ka(WG(c10, c10.Oj)) + "' found"); + a10.Bc.Ar(a10.ph.Oj.yc, new OS().iE(b10, null)); + } + function AKa(a10) { + if (tKa(a10, VF().Tv)) { + kKa(a10); + a10.sn.hz(); + for (var b10 = new Tj().a(), c10 = ""; oKa(a10, VF().Ws); ) { + var e10 = LS(a10); + if (VF().TM === e10) { + e10 = a10; + for (var f10 = new Tj().a(); oKa(e10, VF().XM); ) { + var g10 = LS(e10); + VF().Ai === g10 ? (g10 = e10.ph, Vj(f10, ka(WG(g10, g10.Oj)))) : VF().$y === g10 ? FH(f10.Ef, 0) : VF().as === g10 && (g10 = e10.ph, Vj(f10, ka(WG(g10, g10.Oj)))); + NS(e10); + } + e10 = Usa(fF(), f10.Ef.qf); + Vj(b10, e10); + } else + VF().Ai === e10 ? (c10 = a10.ph, c10 = ka(WG(c10, c10.Oj))) : VF().bs === e10 && (e10 = a10.ph, Wj(b10, WG(e10, e10.Oj))); + NS(a10); + } + e10 = VG(a10.sn); + lKa(a10, VF().Ws); + a10.sn.hz(); + b10 = b10.Ef.qf; + c10 = Pta(Vta(), c10); + f10 = IG(); + g10 = cG(); + g10 = null !== c10 && c10 === g10 ? Q5().Na.Vi : null; + f10 = rua(f10, b10, c10, g10, e10, a10.Bc); + uKa(a10, zKa(a10, rG(f10.r, b10, c10, e10, mD(Gb(), a10.sn.eu())), f10.Ae)); + return true; + } + return false; + } + function rKa(a10, b10, c10) { + return wKa(a10, b10) ? (a10 = a10.ph, ka(WG(a10, a10.Oj)) === c10) : false; + } + RG.prototype.ika = function() { + this.W1 = false; + return mD(Gb(), ha(Ja(DKa), [jKa(this)])); + }; + function zKa(a10, b10, c10) { + a10 = a10.ph.Rf; + T6(); + var e10 = y7(); + T6(); + return gua(T6(), b10, c10, e10, a10); + } + function LS(a10) { + CKa(a10); + return a10.ph.Oj.kx; + } + function wKa(a10, b10) { + return LS(a10) === b10; + } + function pKa(a10) { + a10 = LS(a10); + var b10 = VF().YI; + return a10 === b10; + } + function nKa(a10) { + a10.aj = a10.aj.ta(); + a10.sn = a10.aj.ga(); + } + function EKa(a10, b10) { + var c10 = b10.ya(); + return c10 instanceof z7 ? qKa(a10, b10.ma(), c10.i) : wKa(a10, b10.ma()); + } + function tKa(a10, b10) { + var c10; + (c10 = wKa(a10, b10)) || (VF().Tv === b10 ? sKa(a10, '"') : VF().wx === b10 ? sKa(a10, "}") : VF().ZC === b10 ? sKa(a10, "]") : xKa(a10), c10 = false); + return c10; + } + function CKa(a10) { + for (; ; ) { + var b10 = a10.ph.Oj.kx, c10 = VF().fB; + b10 === c10 ? b10 = true : (b10 = a10.ph.Oj.kx, c10 = VF().$y, b10 = b10 === c10); + if (b10) + yua(a10.sn), kS(a10.ph); + else + break; + } + } + function kKa(a10) { + a10.sn = new UG().SO(a10); + a10.aj = ji(a10.sn, a10.aj); + } + RG.prototype.$classData = r8({ K5a: 0 }, false, "org.yaml.parser.JsonParser", { K5a: 1, f: 1, U5a: 1 }); + function RS() { + sH.call(this); + } + RS.prototype = new uH(); + RS.prototype.constructor = RS; + RS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + RS.prototype.Nx = function() { + var a10 = this.tv.Ef.qf; + vH(this); + var b10 = this.l, c10 = VG(this), e10 = Nua(this); + qH(b10, new IH().TO(a10, c10, e10)); + this.l.aj.ik.ga().rr = a10; + }; + RS.prototype.$classData = r8({ W5a: 0 }, false, "org.yaml.parser.YamlLoader$AliasBuilder", { W5a: 1, Gx: 1, f: 1 }); + function SS() { + sH.call(this); + } + SS.prototype = new uH(); + SS.prototype.constructor = SS; + SS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + SS.prototype.Nx = function() { + vH(this); + var a10 = this.tv.Ef.qf, b10 = VG(this), c10 = Nua(this); + a10 = new IH().TO(a10, b10, c10); + qH(this.l, a10); + this.l.aj.ik.ga().L_ = new z7().d(a10); + }; + SS.prototype.$classData = r8({ X5a: 0 }, false, "org.yaml.parser.YamlLoader$AnchorBuilder", { X5a: 1, Gx: 1, f: 1 }); + function TS() { + sH.call(this); + } + TS.prototype = new uH(); + TS.prototype.constructor = TS; + TS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + TS.prototype.Nx = function() { + vH(this); + var a10 = this.l, b10 = this.tv.Ef.qf, c10 = VG(this), e10 = Nua(this); + qH(a10, new kG().TO(b10, c10, e10)); + }; + TS.prototype.$classData = r8({ Y5a: 0 }, false, "org.yaml.parser.YamlLoader$CommentBuilder", { Y5a: 1, Gx: 1, f: 1 }); + function US() { + sH.call(this); + this.CV = null; + } + US.prototype = new uH(); + US.prototype.constructor = US; + US.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + Ef(); + this.CV = Jf(new Kf(), new Lf().a()).eb; + return this; + }; + US.prototype.Nx = function() { + FKa(this); + var a10 = this.eu(), b10 = new GKa(); + if (null === this) + throw mb(E6(), null); + b10.Fa = this; + var c10 = new Ej().a(); + try { + for (var e10 = 0, f10 = a10.n.length; e10 < f10; ) { + var g10 = a10.n[e10], h10 = XI().NP, k10 = b10.fk(g10, h10); + if (!Twa(XI(), k10)) + throw new nz().M(c10, new z7().d(k10)); + e10 = 1 + e10 | 0; + } + y7(); + } catch (l10) { + if (l10 instanceof nz) + if (b10 = l10, b10.Aa === c10) + b10.Dt(); + else + throw b10; + else + throw l10; + } + c10 = this.l; + b10 = this.CV.Dc.ga(); + Gb(); + e10 = Qx(this.CV).Dc; + f10 = Eq(e10); + f10 = ja(Ja(ma), [f10]); + ZG(e10, f10, 0); + e10 = mD(0, f10); + f10 = VG(this); + a10 = mD(Gb(), a10); + g10 = new HH(); + g10.de = b10; + g10.BS = e10; + EG.prototype.Ac.call(g10, f10, a10); + qH(c10, g10); + }; + function FKa(a10) { + tc(a10.tv) && (Dg(a10.CV, a10.tv.Ef.qf), FH(a10.tv.Ef, 0)); + } + US.prototype.ooa = function() { + FKa(this); + }; + US.prototype.$classData = r8({ Z5a: 0 }, false, "org.yaml.parser.YamlLoader$DirectiveBuilder", { Z5a: 1, Gx: 1, f: 1 }); + function VS() { + sH.call(this); + } + VS.prototype = new uH(); + VS.prototype.constructor = VS; + VS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + a10.X1.SS(); + return this; + }; + VS.prototype.Nx = function() { + qH(this.l, new RA().Ac(VG(this), mD(Gb(), this.eu()))); + }; + VS.prototype.$classData = r8({ a6a: 0 }, false, "org.yaml.parser.YamlLoader$DocBuilder", { a6a: 1, Gx: 1, f: 1 }); + function WS() { + sH.call(this); + } + WS.prototype = new uH(); + WS.prototype.constructor = WS; + WS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + WS.prototype.Nx = function() { + for (var a10 = this.eu(), b10 = this.l, c10 = J5(DB(), H10()), e10 = 0, f10 = a10.n.length; e10 < f10; ) { + var g10 = a10.n[e10]; + if (g10 instanceof Es) { + var h10 = g10.Aa.t(); + c10.iz(h10) || b10.Bc.Ar(g10.Aa.da, new XS().iE(h10, null)); + } + e10 = 1 + e10 | 0; + } + ur(); + b10 = VG(this); + a10 = mD(Gb(), a10); + a10 = new vw().Ac(b10, a10); + qH(this.l, a10); + Mua(this.l.aj.ik.ga(), a10, Q5().sa); + }; + WS.prototype.$classData = r8({ b6a: 0 }, false, "org.yaml.parser.YamlLoader$MapBuilder", { b6a: 1, Gx: 1, f: 1 }); + function YS() { + sH.call(this); + } + YS.prototype = new uH(); + YS.prototype.constructor = YS; + YS.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + YS.prototype.Nx = function() { + var a10 = this.eu(), b10 = VG(this), c10 = new qg().e(this.rr); + if (tc(c10)) { + c10 = this.rr; + var e10 = this.l.X1.Ja(this.rr); + if (e10 instanceof z7) + var f10 = e10.i; + else { + if (y7() !== e10) + throw new x7().d(e10); + this.l.Bc.Ar(b10, new ZS().iE(this.rr, null)); + f10 = T6().nd; + } + e10 = new LH(); + a10 = mD(Gb(), a10); + e10.ona = c10; + e10.Gv = f10; + KH.prototype.Ac.call(e10, b10, a10); + b10 = e10; + } else + c10 = new qg().e(this.l.BK), tc(c10) && this.Ae.va === this.l.BK ? b10 = jua(new uG(), this.r, this.Ae, b10, mD(Gb(), a10)) : (c10 = new sG(), e10 = this.Ae, f10 = this.L_, a10 = mD(Gb(), a10), c10.oq = this.r, c10.tea = e10, c10.sS = f10, Cs.prototype.Ac.call( + c10, + b10, + a10 + ), b10 = c10); + a10 = this.L_; + a10.b() || (a10 = a10.c().rH, this.l.X1.Xh(new R6().M(a10, b10))); + qH(this.l, b10); + }; + YS.prototype.$classData = r8({ c6a: 0 }, false, "org.yaml.parser.YamlLoader$NodeBuilder", { c6a: 1, Gx: 1, f: 1 }); + function $S() { + sH.call(this); + } + $S.prototype = new uH(); + $S.prototype.constructor = $S; + $S.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + $S.prototype.Nx = function() { + var a10 = this.l; + wD(); + var b10 = VG(this); + var c10 = mD(Gb(), this.eu()), e10 = new HKa().a(), f10 = rw(); + e10 = c10.ec(e10, f10.sc); + b10 = dua(new Es(), e10.lb(0), e10.lb(1), b10, c10); + qH(a10, b10); + }; + $S.prototype.$classData = r8({ d6a: 0 }, false, "org.yaml.parser.YamlLoader$PairBuilder", { d6a: 1, Gx: 1, f: 1 }); + function aT() { + sH.call(this); + this.uL = this.wea = null; + } + aT.prototype = new uH(); + aT.prototype.constructor = aT; + aT.prototype.wS = function(a10) { + var b10 = this.uL, c10 = Tta(); + null !== b10 && b10 === c10 && (this.uL = eG()); + Wj(this.wea, a10); + }; + aT.prototype.Nx = function() { + var a10 = this.wea.Ef.qf, b10 = this.uL, c10 = Tta(); + c10 = null !== b10 && b10 === c10 ? eG() : this.uL; + var e10 = VG(this); + b10 = rua(IG(), a10, c10, this.Ae, e10, this.l.Bc); + a10 = rG(b10.r, a10, c10, e10, mD(Gb(), this.eu())); + qH(this.l, a10); + c10 = this.l.aj.ik.ga(); + b10 = b10.Ae; + c10.r = a10; + c10.Ae = b10; + }; + aT.prototype.n2 = function() { + var a10 = this.uL, b10 = Tta(); + null !== a10 && a10 === b10 && (Vta(), a10 = this.l.ph, this.uL = Pta(0, ka(WG(a10, a10.Oj)))); + sH.prototype.n2.call(this); + }; + aT.prototype.$classData = r8({ e6a: 0 }, false, "org.yaml.parser.YamlLoader$ScalarBuilder", { e6a: 1, Gx: 1, f: 1 }); + function bT() { + sH.call(this); + } + bT.prototype = new uH(); + bT.prototype.constructor = bT; + bT.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + bT.prototype.Nx = function() { + eE(); + var a10 = VG(this), b10 = mD(Gb(), this.eu()); + a10 = new Sx().Ac(a10, b10); + qH(this.l, a10); + Mua(this.l.aj.ik.ga(), a10, Q5().cd); + }; + bT.prototype.$classData = r8({ f6a: 0 }, false, "org.yaml.parser.YamlLoader$SeqBuilder", { f6a: 1, Gx: 1, f: 1 }); + function cT() { + sH.call(this); + } + cT.prototype = new uH(); + cT.prototype.constructor = cT; + cT.prototype.yo = function(a10) { + sH.prototype.Iw.call(this, a10, tH(lH(a10))); + return this; + }; + cT.prototype.Nx = function() { + vH(this); + tua || (tua = new KG().a()); + var a10 = this.tv.Ef.qf, b10 = VG(this), c10 = Nua(this.l.aj.ik.ga()), e10 = new OG(); + var f10 = Q5().iba.Ja(a10); + if (f10 instanceof z7) + f10 = f10.i; + else { + if (y7() !== f10) + throw new x7().d(f10); + f10 = Q5().Hq; + } + a10 = vua(e10, a10, f10, b10, c10); + qH(this.l, a10); + b10 = this.l.aj.ik.ga(); + b10 instanceof YS && (b10.Ae = a10); + }; + cT.prototype.n2 = function() { + var a10 = this.l.ph; + Wj(this.tv, WG(a10, a10.Oj)); + }; + cT.prototype.$classData = r8({ h6a: 0 }, false, "org.yaml.parser.YamlLoader$TagBuilder", { h6a: 1, Gx: 1, f: 1 }); + function dT() { + this.BK = this.Bc = this.ph = null; + } + dT.prototype = new u7(); + dT.prototype.constructor = dT; + dT.prototype.Gca = function(a10) { + var b10 = this.BK, c10 = this.Bc, e10 = new Kua(); + e10.ph = this.ph; + e10.Pma = a10; + e10.BK = b10; + e10.Bc = c10; + e10.X1 = new wu().a(); + e10.aj = new rH().yo(e10); + a10 = e10.aj; + b10 = new sH().Iw(e10, tH(lH(e10))); + for (a10.ik = ji(b10, a10.ik); ; ) + if (a10 = e10.ph.Oj.kx, b10 = VF().BR, a10 !== b10) { + a: { + a10 = e10; + b10 = a10.ph.Oj.kx; + if (VF().SM === b10) + pH(a10, new VS().yo(a10)); + else if (VF().Tu === b10) + pH(a10, new YS().yo(a10)); + else if (VF().Tv === b10) + b10 = new aT(), c10 = a10.aj.ik.ga().Ae, sH.prototype.Iw.call(b10, a10, tH(lH(a10))), b10.Ae = c10, b10.wea = new Tj().a(), b10.uL = Tta(), pH(a10, b10); + else if (VF().zF === b10) + pH(a10, new bT().yo(a10)); + else if (VF().rR === b10) + pH(a10, new $S().yo(a10)); + else if (VF().PC === b10) + pH(a10, new WS().yo(a10)); + else if (VF().r5 === b10) + pH(a10, new US().yo(a10)); + else if (VF().q5 === b10) + pH(a10, new TS().yo(a10)); + else if (VF().o5 === b10) + pH(a10, new RS().yo(a10)); + else if (VF().p5 === b10) + pH(a10, new SS().yo(a10)); + else if (VF().vX === b10) + pH(a10, new cT().yo(a10)); + else { + if (VF().Ws === b10 || VF().H5 === b10 || VF().wx === b10 || VF().ZC === b10 || VF().YI === b10 || VF().Uu === b10 || VF().AR === b10 || VF().G5 === b10 || VF().E5 === b10 || VF().F5 === b10 || VF().WX === b10) { + a10.aj.ik.ga().Nx(); + break a; + } + VF().bs === b10 ? (b10 = a10.aj.ik.ga(), c10 = a10.ph, b10.wS(WG(c10, c10.Oj))) : VF().YY === b10 ? a10.aj.ik.ga().wS(" ") : VF().nJ === b10 ? a10.aj.ik.ga().wS("\n") : VF().TM === b10 ? a10.aj.ik.ga().BT = true : VF().s5 === b10 ? a10.aj.ik.ga().b1 = true : VF().I5 === b10 ? a10.aj.ik.ga().b1 = false : VF().as === b10 ? (b10 = a10.aj.ik.ga(), c10 = b10.l.ph, Wj(b10.tv, WG(c10, c10.Oj))) : VF().Ai === b10 ? a10.aj.ik.ga().n2() : VF().XM === b10 ? (b10 = a10.aj.ik.ga(), fF(), b10.wS(Usa(0, b10.tv.Ef.qf)), FH(b10.tv.Ef, 0), b10.BT = false) : VF().$y === b10 ? (b10 = a10.aj.ik.ga(), b10.BT && FH(b10.l.aj.ik.ga().tv.Ef, 0)) : VF().fB === b10 ? a10.aj.ik.ga().ooa() : VF().Vv === b10 && (b10 = a10.ph, a10.Bc.Ar(a10.ph.Oj.yc, new qM().iE(ka(WG(b10, b10.Oj)), null))); + } + vH(a10.aj.ik.ga()); + } + kS(e10.ph); + } else + break; + return mD(Gb(), Lua(e10.aj).eu()); + }; + function Pua(a10, b10) { + var c10 = new dT(); + c10.ph = a10; + c10.Bc = b10; + c10.BK = ""; + return c10; + } + dT.prototype.ika = function() { + var a10 = this.Gca(false), b10 = a10.xl(w6(/* @__PURE__ */ function() { + return function(g10) { + return !(g10 instanceof RA); + }; + }(this))), c10 = new IKa(), e10 = new eT().$K(q5(DKa)); + a10 = a10.ec(c10, JKa(new fT().XO(e10))); + if (0 !== a10.n.length) { + c10 = SA(zs(), this.ph.Rf); + e10 = a10.n[0].Xf; + var f10 = rw(); + a10.n[0] = new RA().Ac(c10, b10.ia(e10, f10.sc)); + } + return mD(Gb(), a10); + }; + function fHa(a10) { + a10.BK = "!include"; + return a10; + } + dT.prototype.$classData = r8({ j6a: 0 }, false, "org.yaml.parser.YamlParser", { j6a: 1, f: 1, U5a: 1 }); + function KKa() { + } + KKa.prototype = new u7(); + KKa.prototype.constructor = KKa; + function LKa() { + } + LKa.prototype = KKa.prototype; + function Wza(a10) { + return a10 instanceof KKa || "number" === typeof a10; + } + function gT() { + this.LT = this.hV = this.aO = null; + this.WS = this.YU = 0; + } + gT.prototype = new u7(); + gT.prototype.constructor = gT; + gT.prototype.h = function(a10) { + return a10 instanceof gT ? this.LT === a10.LT && this.YU === a10.YU && this.aO === a10.aO && this.hV === a10.hV : false; + }; + gT.prototype.t = function() { + var a10 = ""; + "" !== this.aO && (a10 = "" + a10 + this.aO + "."); + a10 = "" + a10 + this.hV; + null === this.LT ? a10 += "(Unknown Source)" : (a10 = a10 + "(" + this.LT, 0 <= this.YU && (a10 = a10 + ":" + this.YU, 0 <= this.WS && (a10 = a10 + ":" + this.WS)), a10 += ")"); + return a10; + }; + gT.prototype.z = function() { + var a10 = this.aO; + a10 = ta(ua(), a10); + var b10 = this.hV; + return a10 ^ ta(ua(), b10); + }; + gT.prototype.setColumnNumber = function(a10) { + this.WS = a10 | 0; + }; + gT.prototype.getColumnNumber = function() { + return this.WS; + }; + var MKa = r8({ W7a: 0 }, false, "java.lang.StackTraceElement", { W7a: 1, f: 1, o: 1 }); + gT.prototype.$classData = MKa; + function uI() { + this.$ = null; + } + uI.prototype = new u7(); + uI.prototype.constructor = uI; + uI.prototype.RE = function() { + }; + uI.prototype.$classData = r8({ a8a: 0 }, false, "java.lang.Thread", { a8a: 1, f: 1, Lma: 1 }); + function CF() { + this.Rh = this.tt = null; + this.Zqa = false; + this.WP = null; + } + CF.prototype = new u7(); + CF.prototype.constructor = CF; + function hT() { + } + d7 = hT.prototype = CF.prototype; + d7.MT = function() { + if (void 0 === ba.Error.captureStackTrace) { + try { + var a10 = {}.undef(); + } catch (b10) { + if (a10 = Ph(E6(), b10), null !== a10) + if (a10 instanceof EK) + a10 = a10.Px; + else + throw mb(E6(), a10); + else + throw b10; + } + this.stackdata = a10; + } else + ba.Error.captureStackTrace(this), this.stackdata = this; + return this; + }; + d7.xo = function() { + return this.tt; + }; + d7.t = function() { + var a10 = Fj(la(this)), b10 = this.xo(); + return null === b10 ? a10 : a10 + ": " + b10; + }; + function NKa(a10) { + if (null === a10.WP) { + if (a10.Zqa) { + Sza || (Sza = new eL().a()); + var b10 = Sza; + var c10 = a10.stackdata; + if (c10) { + if (0 === (1 & b10.xa) << 24 >> 24 && 0 === (1 & b10.xa) << 24 >> 24) { + a: + try { + ba.Packages.org.mozilla.javascript.JavaScriptException; + var e10 = true; + } catch (v10) { + e10 = Ph(E6(), v10); + if (null !== e10) { + if (e10 instanceof EK) { + e10 = false; + break a; + } + throw mb(E6(), e10); + } + throw v10; + } + b10.vma = e10; + b10.xa = (1 | b10.xa) << 24 >> 24; + } + if (b10.vma) + e10 = c10.stack, e10 = (void 0 === e10 ? "" : e10).replace(gL("^\\s+at\\s+", "gm"), "").replace(gL("^(.+?)(?: \\((.+)\\))?$", "gm"), "$2@$1").replace(gL("\\r\\n?", "gm"), "\n").split("\n"); + else if (c10.arguments && c10.stack) + e10 = Hza(c10); + else if (c10.stack && c10.sourceURL) + e10 = c10.stack.replace(gL("\\[native code\\]\\n", "m"), "").replace(gL("^(?=\\w+Error\\:).*$\\n", "m"), "").replace(gL("^@", "gm"), "{anonymous}()@").split("\n"); + else if (c10.stack && c10.number) + e10 = c10.stack.replace(gL("^\\s*at\\s+(.*)$", "gm"), "$1").replace(gL("^Anonymous function\\s+", "gm"), "{anonymous}() ").replace(gL("^([^\\(]+|\\{anonymous\\}\\(\\))\\s+\\((.+)\\)$", "gm"), "$1@$2").split("\n").slice(1); + else if (c10.stack && c10.fileName) + e10 = c10.stack.replace(gL( + "(?:\\n@:0)?\\s+$", + "m" + ), "").replace(gL("^(?:\\((\\S*)\\))?@", "gm"), "{anonymous}($1)@").split("\n"); + else if (c10.message && c10["opera#sourceloc"]) + if (c10.stacktrace) + if (-1 < c10.message.indexOf("\n") && c10.message.split("\n").length > c10.stacktrace.split("\n").length) + e10 = Rza(c10); + else { + e10 = gL("Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$", "i"); + c10 = c10.stacktrace.split("\n"); + var f10 = []; + for (var g10 = 0, h10 = c10.length | 0; g10 < h10; ) { + var k10 = e10.exec(c10[g10]); + if (null !== k10) { + var l10 = k10[3]; + l10 = void 0 === l10 ? "{anonymous}" : l10; + var m10 = k10[2]; + if (void 0 === m10) + throw new iL().e("undefined.get"); + k10 = k10[1]; + if (void 0 === k10) + throw new iL().e("undefined.get"); + f10.push(l10 + "()@" + m10 + ":" + k10); + } + g10 = 2 + g10 | 0; + } + e10 = f10; + } + else + e10 = Rza(c10); + else if (c10.message && c10.stack && c10.stacktrace) + if (0 > c10.stacktrace.indexOf("called from line")) { + e10 = fL("^(.*)@(.+):(\\d+)$"); + c10 = c10.stacktrace.split("\n"); + f10 = []; + g10 = 0; + for (h10 = c10.length | 0; g10 < h10; ) { + k10 = e10.exec(c10[g10]); + if (null !== k10) { + l10 = k10[1]; + l10 = void 0 === l10 ? "global code" : l10 + "()"; + m10 = k10[2]; + if (void 0 === m10) + throw new iL().e("undefined.get"); + k10 = k10[3]; + if (void 0 === k10) + throw new iL().e("undefined.get"); + f10.push(l10 + "@" + m10 + ":" + k10); + } + g10 = 1 + g10 | 0; + } + e10 = f10; + } else { + e10 = fL("^.*line (\\d+), column (\\d+)(?: in (.+))? in (\\S+):$"); + c10 = c10.stacktrace.split("\n"); + f10 = []; + g10 = 0; + for (h10 = c10.length | 0; g10 < h10; ) { + k10 = e10.exec(c10[g10]); + if (null !== k10) { + l10 = k10[4]; + if (void 0 === l10) + throw new iL().e("undefined.get"); + m10 = k10[1]; + if (void 0 === m10) + throw new iL().e("undefined.get"); + var p10 = k10[2]; + if (void 0 === p10) + throw new iL().e("undefined.get"); + l10 = l10 + ":" + m10 + ":" + p10; + k10 = k10[2]; + k10 = (void 0 === k10 ? "global code" : k10).replace(fL(""), "$1").replace(fL(""), "{anonymous}"); + f10.push(k10 + "@" + l10) | 0; + } + g10 = 2 + g10 | 0; + } + e10 = f10; + } + else + e10 = c10.stack && !c10.fileName ? Hza(c10) : []; + } else + e10 = []; + f10 = e10; + g10 = fL("^([^\\@]*)\\@(.*):([0-9]+)$"); + h10 = fL("^([^\\@]*)\\@(.*):([0-9]+):([0-9]+)$"); + c10 = []; + for (e10 = 0; e10 < (f10.length | 0); ) { + k10 = f10[e10]; + if (null === k10) + throw new sf().a(); + if ("" !== k10) + if (l10 = h10.exec(k10), null !== l10) { + k10 = l10[1]; + if (void 0 === k10) + throw new iL().e("undefined.get"); + m10 = Qza(b10, k10); + if (null === m10) + throw new x7().d(m10); + k10 = m10.ma(); + m10 = m10.ya(); + p10 = l10[2]; + if (void 0 === p10) + throw new iL().e("undefined.get"); + var t10 = l10[3]; + if (void 0 === t10) + throw new iL().e("undefined.get"); + t10 = new qg().e(t10); + t10 = FD(ED(), t10.ja, 10); + l10 = l10[4]; + if (void 0 === l10) + throw new iL().e("undefined.get"); + l10 = new qg().e(l10); + l10 = FD(ED(), l10.ja, 10); + c10.push({ declaringClass: k10, methodName: m10, fileName: p10, lineNumber: t10, columnNumber: void 0 === l10 ? void 0 : l10 }); + } else if (l10 = g10.exec(k10), null !== l10) { + k10 = l10[1]; + if (void 0 === k10) + throw new iL().e("undefined.get"); + m10 = Qza(b10, k10); + if (null === m10) + throw new x7().d(m10); + k10 = m10.ma(); + m10 = m10.ya(); + p10 = l10[2]; + if (void 0 === p10) + throw new iL().e("undefined.get"); + l10 = l10[3]; + if (void 0 === l10) + throw new iL().e("undefined.get"); + l10 = new qg().e(l10); + l10 = FD(ED(), l10.ja, 10); + c10.push({ declaringClass: k10, methodName: m10, fileName: p10, lineNumber: l10, columnNumber: void 0 }); + } else + c10.push({ + declaringClass: "", + methodName: k10, + fileName: null, + lineNumber: -1, + columnNumber: void 0 + }) | 0; + e10 = 1 + e10 | 0; + } + b10 = aa.sourceMapper; + b10 = void 0 === b10 ? c10 : b10(c10); + c10 = ja(Ja(MKa), [b10.length | 0]); + for (e10 = 0; e10 < (b10.length | 0); ) + f10 = b10[e10], g10 = f10.methodName, h10 = f10.fileName, k10 = f10.lineNumber | 0, l10 = new gT(), l10.aO = f10.declaringClass, l10.hV = g10, l10.LT = h10, l10.YU = k10, l10.WS = -1, g10 = l10, f10 = f10.columnNumber, void 0 !== f10 && g10.setColumnNumber(f10 | 0), c10.n[e10] = g10, e10 = 1 + e10 | 0; + b10 = c10; + } else + b10 = ja(Ja(MKa), [0]); + a10.WP = b10; + } + return a10.WP; + } + d7.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + function iT(a10) { + var b10 = fr().mv; + b10 = /* @__PURE__ */ function(m10, p10) { + return function(t10) { + er(p10, t10); + }; + }(a10, b10); + NKa(a10); + var c10 = a10.t(); + b10(c10); + if (0 !== a10.WP.n.length) + for (c10 = 0; c10 < a10.WP.n.length; ) + b10(" at " + a10.WP.n[c10]), c10 = 1 + c10 | 0; + else + b10(" "); + for (; ; ) + if (a10 !== a10.Rh && null !== a10.Rh) { + var e10 = NKa(a10); + a10 = a10.Rh; + c10 = NKa(a10); + var f10 = c10.n.length, g10 = e10.n.length, h10 = "Caused by: " + a10.t(); + b10(h10); + if (0 !== f10) { + for (h10 = 0; ; ) { + if (h10 < f10 && h10 < g10) { + var k10 = c10.n[-1 + (f10 - h10 | 0) | 0], l10 = e10.n[-1 + (g10 - h10 | 0) | 0]; + k10 = null === k10 ? null === l10 : k10.h(l10); + } else + k10 = false; + if (k10) + h10 = 1 + h10 | 0; + else + break; + } + 0 < h10 && (h10 = -1 + h10 | 0); + e10 = f10 - h10 | 0; + for (f10 = 0; f10 < e10; ) + b10(" at " + c10.n[f10]), f10 = 1 + f10 | 0; + 0 < h10 && b10(" ... " + h10 + " more"); + } else + b10(" "); + } else + break; + } + d7.Ge = function(a10, b10) { + this.tt = a10; + this.Rh = b10; + this.Zqa = true; + this.MT(); + }; + d7.$classData = r8({ bf: 0 }, false, "java.lang.Throwable", { bf: 1, f: 1, o: 1 }); + function OKa() { + this.nma = this.j2 = null; + this.Aoa = this.Boa = 0; + this.ay = this.fH = this.u2 = null; + this.W_ = false; + this.jba = null; + this.NN = 0; + this.CW = null; + } + OKa.prototype = new u7(); + OKa.prototype.constructor = OKa; + function Jv(a10) { + if (a10.W_) { + a10.ay = a10.u2.exec(a10.fH); + if (null !== a10.ay) { + var b10 = a10.ay[0]; + if (void 0 === b10) + throw new iL().e("undefined.get"); + if (null === b10) + throw new sf().a(); + "" === b10 && (b10 = a10.u2, b10.lastIndex = 1 + (b10.lastIndex | 0) | 0); + } else + a10.W_ = false; + a10.CW = y7(); + return null !== a10.ay; + } + return false; + } + function PKa(a10) { + if (null === a10.ay) + throw new Hj().e("No match available"); + return a10.ay; + } + function QKa(a10, b10) { + a10 = PKa(a10)[b10]; + return void 0 === a10 ? null : a10; + } + d7 = OKa.prototype; + d7.oM = function(a10) { + if (0 === a10) + a10 = this.Ms(); + else { + var b10 = this.CW; + b10.b() ? (lwa(), b10 = this.Ms(), b10 = swa(this.fH, b10, this.j2).Ui, this.CW = new z7().d(b10)) : b10 = b10.c(); + a10 = b10.ro(a10); + } + return a10; + }; + function sx(a10) { + Fza(a10); + Jv(a10); + null === a10.ay || 0 === a10.Ms() && a10.xw() === (a10.fH.length | 0) || Fza(a10); + return null !== a10.ay; + } + function RKa(a10) { + if (null !== a10.ay) + return -1 + (a10.ay.length | 0) | 0; + var b10 = a10.jba; + if (b10 instanceof z7) + return b10.i | 0; + if (y7() === b10) + return b10 = -1 + (new ba.RegExp("|" + a10.j2.rE.source).exec("").length | 0) | 0, a10.jba = new z7().d(b10), b10; + throw new x7().d(b10); + } + function Eda(a10, b10) { + SKa(b10, a10.fH.substring(a10.NN)); + a10.NN = a10.fH.length | 0; + } + d7.xw = function() { + var a10 = this.Ms(), b10 = TKa(this); + return a10 + (b10.length | 0) | 0; + }; + function Iv(a10, b10, c10) { + var e10 = new OKa(); + e10.j2 = a10; + e10.nma = b10; + e10.Boa = 0; + e10.Aoa = c10; + a10 = e10.j2; + b10 = new ba.RegExp(a10.rE); + a10 = b10 !== a10.rE ? b10 : new ba.RegExp(a10.rE.source, twa(a10)); + e10.u2 = a10; + e10.fH = ka(ya(e10.nma, e10.Boa, e10.Aoa)); + e10.ay = null; + e10.W_ = true; + e10.jba = y7(); + e10.NN = 0; + e10.CW = y7(); + return e10; + } + function Kia(a10, b10, c10) { + var e10 = a10.fH, f10 = a10.NN, g10 = a10.Ms(); + SKa(b10, e10.substring(f10, g10)); + e10 = c10.length | 0; + for (f10 = 0; f10 < e10; ) + switch (g10 = 65535 & (c10.charCodeAt(f10) | 0), g10) { + case 36: + for (g10 = f10 = 1 + f10 | 0; ; ) { + if (f10 < e10) { + var h10 = 65535 & (c10.charCodeAt(f10) | 0); + h10 = 48 <= h10 && 57 >= h10; + } else + h10 = false; + if (h10) + f10 = 1 + f10 | 0; + else + break; + } + h10 = ED(); + g10 = c10.substring(g10, f10); + g10 = FD(h10, g10, 10); + SKa(b10, QKa(a10, g10)); + break; + case 92: + f10 = 1 + f10 | 0; + f10 < e10 && (g10 = 65535 & (c10.charCodeAt(f10) | 0), jF(b10.s, g10)); + f10 = 1 + f10 | 0; + break; + default: + jF(b10.s, g10), f10 = 1 + f10 | 0; + } + a10.NN = a10.xw(); + } + function rja(a10, b10) { + Fza(a10); + if (Jv(a10)) { + var c10 = new Pj().a(); + Kia(a10, c10, b10); + Eda(a10, c10); + return c10.t(); + } + return a10.fH; + } + function TKa(a10) { + a10 = PKa(a10)[0]; + if (void 0 === a10) + throw new iL().e("undefined.get"); + return a10; + } + d7.Ms = function() { + return PKa(this).index | 0; + }; + d7.xT = function(a10) { + var b10 = this.oM(a10); + if (-1 === b10) + return -1; + a10 = QKa(this, a10); + return b10 + (a10.length | 0) | 0; + }; + function Fza(a10) { + a10.u2.lastIndex = 0; + a10.ay = null; + a10.W_ = true; + a10.NN = 0; + a10.CW = y7(); + } + d7.$classData = r8({ N8a: 0 }, false, "java.util.regex.Matcher", { N8a: 1, f: 1, Dhb: 1 }); + function fT() { + this.sea = null; + } + fT.prototype = new u7(); + fT.prototype.constructor = fT; + fT.prototype.es = function() { + return new jT().$K(this.sea.Lo()); + }; + fT.prototype.XO = function(a10) { + this.sea = a10; + return this; + }; + fT.prototype.en = function() { + return new jT().$K(this.sea.Lo()); + }; + fT.prototype.$classData = r8({ T8a: 0 }, false, "scala.Array$ArrayCanBuildFrom$1", { T8a: 1, f: 1, VE: 1 }); + function kT() { + } + kT.prototype = new u7(); + kT.prototype.constructor = kT; + kT.prototype.es = function() { + hG(); + iG(); + return new jG().a(); + }; + kT.prototype.en = function() { + hG(); + iG(); + return new jG().a(); + }; + kT.prototype.$classData = r8({ V8a: 0 }, false, "scala.LowPriorityImplicits$$anon$4", { V8a: 1, f: 1, VE: 1 }); + function lT() { + } + lT.prototype = new u7(); + lT.prototype.constructor = lT; + lT.prototype.a = function() { + return this; + }; + lT.prototype.es = function() { + return new Tj().a(); + }; + lT.prototype.en = function() { + return new Tj().a(); + }; + lT.prototype.$classData = r8({ f9a: 0 }, false, "scala.Predef$$anon$1", { f9a: 1, f: 1, VE: 1 }); + function UKa(a10, b10) { + switch (b10) { + case 0: + return a10.Uo; + case 1: + return a10.Ag; + case 2: + return a10.Ih; + case 3: + return a10.KM; + default: + throw new U6().e("" + b10); + } + } + function mT() { + } + mT.prototype = new u7(); + mT.prototype.constructor = mT; + mT.prototype.a = function() { + return this; + }; + mT.prototype.$classData = r8({ p9a: 0 }, false, "scala.concurrent.BlockContext$DefaultBlockContext$", { p9a: 1, f: 1, Soa: 1 }); + var VKa = void 0; + function mJ() { + } + mJ.prototype = new u7(); + mJ.prototype.constructor = mJ; + mJ.prototype.a = function() { + return this; + }; + mJ.prototype.t = function() { + return "object AnyRef"; + }; + mJ.prototype.$classData = r8({ Q9a: 0 }, false, "scala.package$$anon$1", { Q9a: 1, f: 1, Qhb: 1 }); + function nT() { + this.M2 = null; + } + nT.prototype = new Yxa(); + nT.prototype.constructor = nT; + nT.prototype.a = function() { + GJ.prototype.a.call(this); + return this; + }; + nT.prototype.$classData = r8({ w$a: 0 }, false, "scala.util.control.Breaks$", { w$a: 1, Woa: 1, f: 1 }); + var WKa = void 0; + function XKa() { + WKa || (WKa = new nT().a()); + return WKa; + } + function oT() { + this.Zda = this.sba = this.fx = 0; + } + oT.prototype = new $xa(); + oT.prototype.constructor = oT; + oT.prototype.a = function() { + YKa = this; + this.fx = ta(ua(), "Seq"); + this.sba = ta(ua(), "Map"); + this.Zda = ta(ua(), "Set"); + return this; + }; + function pT(a10) { + var b10 = MJ(); + if (a10 instanceof qT) { + for (var c10 = 0, e10 = b10.fx, f10 = a10; !f10.b(); ) + a10 = f10.ga(), f10 = f10.ta(), e10 = b10.Ga(e10, NJ(OJ(), a10)), c10 = 1 + c10 | 0; + b10 = b10.fe(e10, c10); + } else + b10 = bya(b10, a10, b10.fx); + return b10; + } + oT.prototype.$classData = r8({ z$a: 0 }, false, "scala.util.hashing.MurmurHash3$", { z$a: 1, Zhb: 1, f: 1 }); + var YKa = void 0; + function MJ() { + YKa || (YKa = new oT().a()); + return YKa; + } + function ZKa() { + this.fV = this.sy = this.vka = this.bqa = null; + this.xa = this.ms = this.$d = 0; + } + ZKa.prototype = new u7(); + ZKa.prototype.constructor = ZKa; + function $Ka(a10) { + aLa(a10); + bLa(a10); + return a10; + } + function cLa(a10, b10) { + var c10 = new ZKa(); + c10.sy = a10; + c10.fV = b10; + c10.$d = b10.Ms(); + c10.ms = b10.xw(); + return c10; + } + d7 = ZKa.prototype; + d7.oM = function(a10) { + return aLa(this).n[a10]; + }; + d7.t = function() { + return 0 <= this.Ms() ? ka(ya(this.hea(), this.Ms(), this.xw())) : null; + }; + d7.xw = function() { + return this.ms; + }; + function bLa(a10) { + if (0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24) { + var b10 = RKa(a10.fV), c10 = 0 > b10; + if (c10) + var e10 = 0; + else { + e10 = b10 >> 31; + var f10 = 1 + b10 | 0; + e10 = 0 === f10 ? 1 + e10 | 0 : e10; + e10 = (0 === e10 ? -1 < (-2147483648 ^ f10) : 0 < e10) ? -1 : f10; + } + hG(); + rw(); + hG(); + iG(); + f10 = new jG().a(); + 0 > e10 && dLa(Axa(), 0, b10, 1, true); + if (!c10) + for (c10 = 0; ; ) { + e10 = a10.fV.xT(c10); + MS(f10, e10); + if (c10 === b10) + break; + c10 = 1 + c10 | 0; + } + b10 = lG(f10); + c10 = b10.Oa(); + c10 = ja(Ja(Qa), [c10]); + ZG(b10, c10, 0); + a10.vka = c10; + a10.xa = (2 | a10.xa) << 24 >> 24; + } + return a10.vka; + } + d7.hea = function() { + return this.sy; + }; + d7.Ms = function() { + return this.$d; + }; + d7.xT = function(a10) { + return bLa(this).n[a10]; + }; + function aLa(a10) { + if (0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24) { + var b10 = RKa(a10.fV), c10 = 0 > b10; + if (c10) + var e10 = 0; + else { + e10 = b10 >> 31; + var f10 = 1 + b10 | 0; + e10 = 0 === f10 ? 1 + e10 | 0 : e10; + e10 = (0 === e10 ? -1 < (-2147483648 ^ f10) : 0 < e10) ? -1 : f10; + } + hG(); + rw(); + hG(); + iG(); + f10 = new jG().a(); + 0 > e10 && dLa(Axa(), 0, b10, 1, true); + if (!c10) + for (c10 = 0; ; ) { + e10 = a10.fV.oM(c10); + MS(f10, e10); + if (c10 === b10) + break; + c10 = 1 + c10 | 0; + } + b10 = lG(f10); + c10 = b10.Oa(); + c10 = ja(Ja(Qa), [c10]); + ZG(b10, c10, 0); + a10.bqa = c10; + a10.xa = (1 | a10.xa) << 24 >> 24; + } + return a10.bqa; + } + d7.$classData = r8({ E$a: 0 }, false, "scala.util.matching.Regex$Match", { E$a: 1, f: 1, F$a: 1 }); + function eLa(a10, b10) { + for (var c10 = false; !c10 && a10.Ya(); ) + c10 = !!b10.P(a10.$a()); + return c10; + } + function wT(a10, b10) { + for (var c10 = true; c10 && a10.Ya(); ) + c10 = !!b10.P(a10.$a()); + return c10; + } + function fLa(a10, b10, c10) { + b10 = 0 < b10 ? b10 : 0; + c10 = 0 > c10 ? -1 : c10 <= b10 ? 0 : c10 - b10 | 0; + if (0 === c10) + a10 = $B().ce; + else { + var e10 = new xT(); + e10.jQ = a10; + e10.bC = c10; + e10.dK = b10; + a10 = e10; + } + return a10; + } + function yT(a10, b10) { + for (; a10.Ya(); ) + b10.P(a10.$a()); + } + function gLa(a10, b10) { + var c10 = new zT(); + c10.fc = a10; + c10.zn = null; + c10.XU = null; + c10.qG = false; + return c10.DI(b10); + } + function hLa(a10, b10) { + for (; a10.Ya(); ) { + var c10 = a10.$a(); + if (b10.P(c10)) + return new z7().d(c10); + } + return y7(); + } + function Xv(a10) { + if (a10.Ya()) { + var b10 = a10.$a(); + return dK(b10, oq(/* @__PURE__ */ function(c10) { + return function() { + return c10.Dd(); + }; + }(a10))); + } + Pt(); + return AT(); + } + function iLa(a10, b10, c10, e10) { + var f10 = c10, g10 = SJ(W5(), b10) - c10 | 0; + for (c10 = c10 + (e10 < g10 ? e10 : g10) | 0; f10 < c10 && a10.Ya(); ) + aAa(W5(), b10, f10, a10.$a()), f10 = 1 + f10 | 0; + } + function jLa(a10, b10) { + for (var c10 = 0; c10 < b10 && a10.Ya(); ) + a10.$a(), c10 = 1 + c10 | 0; + return a10; + } + function GR() { + } + GR.prototype = new u7(); + GR.prototype.constructor = GR; + GR.prototype.a = function() { + return this; + }; + GR.prototype.es = function() { + return new BT().a(); + }; + GR.prototype.en = function() { + return new BT().a(); + }; + GR.prototype.$classData = r8({ nab: 0 }, false, "scala.collection.SeqView$$anon$1", { nab: 1, f: 1, VE: 1 }); + function hE() { + this.l = this.Ll = null; + } + hE.prototype = new u7(); + hE.prototype.constructor = hE; + hE.prototype.U = function(a10) { + this.l.U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return b10.Ll.P(e10) ? c10.P(e10) : void 0; + }; + }(this, a10))); + }; + hE.prototype.ka = function(a10, b10) { + b10 = b10.en(this.l.Zi()); + this.l.U(w6(/* @__PURE__ */ function(c10, e10, f10) { + return function(g10) { + return c10.Ll.P(g10) ? e10.jd(f10.P(g10)) : void 0; + }; + }(this, b10, a10))); + return b10.Rc(); + }; + function gE(a10, b10, c10) { + a10.Ll = c10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + hE.prototype.$classData = r8({ Hab: 0 }, false, "scala.collection.TraversableLike$WithFilter", { Hab: 1, f: 1, Nc: 1 }); + function CT() { + this.n9 = null; + } + CT.prototype = new u7(); + CT.prototype.constructor = CT; + CT.prototype.es = function() { + return this.n9.es(); + }; + CT.prototype.en = function() { + return this.n9.es(); + }; + function JKa(a10) { + var b10 = new CT(); + b10.n9 = a10; + return b10; + } + CT.prototype.$classData = r8({ Sab: 0 }, false, "scala.collection.package$$anon$1", { Sab: 1, f: 1, VE: 1 }); + function DT() { + this.l = null; + } + DT.prototype = new u7(); + DT.prototype.constructor = DT; + DT.prototype.es = function() { + return this.l.Qd(); + }; + DT.prototype.en = function() { + return this.l.Qd(); + }; + function zC(a10) { + var b10 = new DT(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + DT.prototype.$classData = r8({ Tab: 0 }, false, "scala.collection.generic.GenMapFactory$MapCanBuildFrom", { Tab: 1, f: 1, VE: 1 }); + function kLa() { + } + kLa.prototype = new mya(); + kLa.prototype.constructor = kLa; + function lLa() { + } + lLa.prototype = kLa.prototype; + function ET() { + this.l = null; + } + ET.prototype = new u7(); + ET.prototype.constructor = ET; + ET.prototype.es = function() { + return this.l.Qd(); + }; + ET.prototype.en = function(a10) { + return a10 && a10.$classData && a10.$classData.ge.Lr ? a10.Di().Qd() : this.l.Qd(); + }; + function re4(a10) { + var b10 = new ET(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + ET.prototype.$classData = r8({ Uab: 0 }, false, "scala.collection.generic.GenSetFactory$$anon$1", { Uab: 1, f: 1, VE: 1 }); + function FT() { + this.u = null; + } + FT.prototype = new mya(); + FT.prototype.constructor = FT; + function GT() { + } + GT.prototype = FT.prototype; + FT.prototype.a = function() { + this.u = new HT().EU(this); + return this; + }; + function IT() { + this.l = null; + } + IT.prototype = new u7(); + IT.prototype.constructor = IT; + function mLa() { + } + mLa.prototype = IT.prototype; + IT.prototype.es = function() { + return this.l.Qd(); + }; + IT.prototype.en = function(a10) { + return a10.Di().Qd(); + }; + IT.prototype.EU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function nLa() { + } + nLa.prototype = new kya(); + nLa.prototype.constructor = nLa; + function oLa() { + } + oLa.prototype = nLa.prototype; + function JT() { + this.gna = null; + } + JT.prototype = new sya(); + JT.prototype.constructor = JT; + JT.prototype.d1 = function(a10) { + this.gna = a10; + if (null === this) + throw mb(E6(), null); + return this; + }; + JT.prototype.dja = function(a10, b10) { + return this.gna.ug(a10, b10); + }; + JT.prototype.$classData = r8({ bbb: 0 }, false, "scala.collection.immutable.HashMap$$anon$1", { bbb: 1, ibb: 1, f: 1 }); + r8({ cbb: 0 }, false, "scala.collection.immutable.HashMap$$anon$1$$anon$2", { cbb: 1, ibb: 1, f: 1 }); + function pLa() { + } + pLa.prototype = new u7(); + pLa.prototype.constructor = pLa; + d7 = pLa.prototype; + d7.a = function() { + return this; + }; + d7.P = function() { + return this; + }; + d7.ro = function() { + return this | 0; + }; + d7.t = function() { + return ""; + }; + d7.Ep = function() { + return !!this; + }; + d7.$classData = r8({ ubb: 0 }, false, "scala.collection.immutable.List$$anon$1", { ubb: 1, f: 1, za: 1 }); + function KT() { + this.tt = this.Ll = this.x$ = null; + this.xa = false; + } + KT.prototype = new u7(); + KT.prototype.constructor = KT; + KT.prototype.U = function(a10) { + (this.xa ? this.x$ : qLa(this)).U(a10); + }; + function rLa(a10, b10, c10) { + a10.Ll = c10; + a10.tt = Hb(b10); + return a10; + } + function qLa(a10) { + if (!a10.xa) { + var b10 = LT(a10.tt, a10.Ll, false); + a10.tt = null; + a10.x$ = b10; + a10.xa = true; + } + return a10.x$; + } + KT.prototype.$classData = r8({ ecb: 0 }, false, "scala.collection.immutable.Stream$StreamWithFilter", { ecb: 1, f: 1, Nc: 1 }); + function $Ja(a10, b10) { + b10 = b10.hm(); + switch (b10) { + case -1: + break; + default: + a10.pj(b10); + } + } + function sLa(a10, b10, c10) { + b10 = b10.hm(); + switch (b10) { + case -1: + break; + default: + a10.pj(b10 + c10 | 0); + } + } + function MT(a10, b10, c10) { + c10 = c10.hm(); + switch (c10) { + case -1: + break; + default: + a10.pj(b10 < c10 ? b10 : c10); + } + } + function tLa() { + } + tLa.prototype = new u7(); + tLa.prototype.constructor = tLa; + function uLa() { + } + uLa.prototype = tLa.prototype; + tLa.prototype.t = function() { + return ""; + }; + function NT() { + } + NT.prototype = new u7(); + NT.prototype.constructor = NT; + function OT() { + } + OT.prototype = NT.prototype; + NT.prototype.ro = function(a10) { + return this.P(a10) | 0; + }; + NT.prototype.t = function() { + return ""; + }; + NT.prototype.Ep = function(a10) { + return !!this.P(a10); + }; + function vLa() { + } + vLa.prototype = new u7(); + vLa.prototype.constructor = vLa; + function wLa() { + } + wLa.prototype = vLa.prototype; + vLa.prototype.t = function() { + return ""; + }; + function xLa() { + } + xLa.prototype = new u7(); + xLa.prototype.constructor = xLa; + function yLa() { + } + yLa.prototype = xLa.prototype; + xLa.prototype.t = function() { + return ""; + }; + function zLa() { + } + zLa.prototype = new u7(); + zLa.prototype.constructor = zLa; + function ALa() { + } + ALa.prototype = zLa.prototype; + zLa.prototype.t = function() { + return ""; + }; + function BLa() { + } + BLa.prototype = new u7(); + BLa.prototype.constructor = BLa; + function CLa() { + } + CLa.prototype = BLa.prototype; + BLa.prototype.t = function() { + return ""; + }; + function Uj() { + this.oa = false; + } + Uj.prototype = new u7(); + Uj.prototype.constructor = Uj; + Uj.prototype.t = function() { + return "" + this.oa; + }; + Uj.prototype.eq = function(a10) { + this.oa = a10; + return this; + }; + Uj.prototype.$classData = r8({ Ueb: 0 }, false, "scala.runtime.BooleanRef", { Ueb: 1, f: 1, o: 1 }); + function $za(a10) { + return !!(a10 && a10.$classData && 1 === a10.$classData.RN && a10.$classData.QN.ge.Zpa); + } + var oa = r8({ Zpa: 0 }, false, "scala.runtime.BoxedUnit", { Zpa: 1, f: 1, o: 1 }, void 0, void 0, function(a10) { + return void 0 === a10; + }); + function lC() { + this.oa = 0; + } + lC.prototype = new u7(); + lC.prototype.constructor = lC; + lC.prototype.t = function() { + return "" + this.oa; + }; + lC.prototype.ue = function(a10) { + this.oa = a10; + return this; + }; + lC.prototype.$classData = r8({ Web: 0 }, false, "scala.runtime.IntRef", { Web: 1, f: 1, o: 1 }); + function gr() { + this.oa = Ea().dl; + } + gr.prototype = new u7(); + gr.prototype.constructor = gr; + gr.prototype.O$ = function(a10) { + this.oa = a10; + return this; + }; + gr.prototype.t = function() { + var a10 = this.oa, b10 = a10.od; + a10 = a10.Ud; + return yza(Ea(), b10, a10); + }; + gr.prototype.$classData = r8({ Xeb: 0 }, false, "scala.runtime.LongRef", { Xeb: 1, f: 1, o: 1 }); + function qd() { + this.oa = null; + } + qd.prototype = new u7(); + qd.prototype.constructor = qd; + qd.prototype.t = function() { + return "" + this.oa; + }; + qd.prototype.d = function(a10) { + this.oa = a10; + return this; + }; + qd.prototype.$classData = r8({ bfb: 0 }, false, "scala.runtime.ObjectRef", { bfb: 1, f: 1, o: 1 }); + function PT() { + } + PT.prototype = new u7(); + PT.prototype.constructor = PT; + PT.prototype.a = function() { + return this; + }; + function VC(a10, b10) { + return Du().$ === b10 ? kk() : Au().$ === b10 ? lk() : Bu().$ === b10 ? mk() : Cu().$ === b10 ? nk() : Ob().$ === b10 ? ok2() : Qb().$ === b10 ? qk() : Pb().$ === b10 ? pk() : new QT().e(b10); + } + PT.prototype.$classData = r8({ nra: 0 }, false, "amf.ProfileName$", { nra: 1, f: 1, q: 1, o: 1 }); + var DLa = void 0; + function WC() { + DLa || (DLa = new PT().a()); + return DLa; + } + function RT(a10, b10) { + var c10 = ab(); + a10 = a10.Be(); + b10 = ic(RB(F6(), b10)); + b10 = $aa(a10, b10); + a10 = ab().jr(); + return bb(c10, b10, a10).Ra(); + } + function ST(a10, b10) { + var c10 = a10.Be(), e10 = Bq().uc; + eb(c10, e10, b10); + return a10; + } + function TT(a10) { + var b10 = ab(); + a10 = a10.Be().Ve(); + var c10 = ab().$e(); + return Ak(b10, a10, c10).Ra(); + } + function UT(a10, b10) { + var c10 = a10.Be(), e10 = Bq().ae; + eb(c10, e10, b10); + return a10; + } + function VT(a10, b10) { + var c10 = a10.Be(), e10 = ab(), f10 = ab().$e(); + b10 = uk(tk(e10, b10, f10)); + e10 = Gk().xc; + Bf(c10, e10, b10); + return a10; + } + function WT(a10, b10) { + b10 = Bp(Cp(), b10); + a10 = a10.Be(); + var c10 = a10.ea.uA; + if (c10 instanceof z7) + b10 = Qaa(a10, b10); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("RDF Framework not registered cannot export to native RDF model")); + throw new x7().d(c10); + } + return b10; + } + function XT(a10) { + ab(); + a10 = a10.Be(); + var b10 = new wu().a(); + b10 = ds(a10, b10); + b10.Io(a10.Me); + b10.jp(a10.xe); + return gfa(ab().$e(), b10); + } + function YT(a10) { + ab(); + a10 = B6(a10.Be().Y(), Bq().ae); + ab().cb(); + return gb(a10); + } + function ZT(a10) { + var b10 = ab(); + a10 = cga(a10.Be()); + var c10 = ab(); + null === ab().MJ && null === ab().MJ && (ab().MJ = new $T().ep(c10)); + c10 = ab().MJ; + return bb(b10, a10, c10).Ra(); + } + function aU(a10, b10) { + Kfa(a10.Be(), b10); + return a10; + } + function bU(a10) { + var b10 = ab(); + a10 = a10.Be().xe; + var c10 = ab().Lf(); + return bb(b10, a10, c10).Ra(); + } + function cU(a10) { + a10 = Lc(a10.Be()); + return a10.b() ? "" : a10.c(); + } + function dU(a10) { + ab(); + a10 = B6(a10.Be().Y(), Bq().tg); + ab().cb(); + return gb(a10); + } + function eU(a10, b10) { + var c10 = ab(); + a10 = a10.Be(); + b10 = ic($v(F6(), b10)); + b10 = ELa(a10, b10); + a10 = ab().jr(); + return Ak(c10, b10, a10).Ra(); + } + function fU(a10) { + var b10 = ab(); + a10 = B6(a10.Oc().Y(), nc().Ni()); + var c10 = ab().jr(); + return Ak(b10, a10, c10).Ra(); + } + function gU(a10) { + var b10 = ab(); + a10 = B6(a10.Oc().Y(), Yd(nc())); + var c10 = FLa(); + return Ak(b10, a10, c10).Ra(); + } + function hU(a10) { + a10 = Ab(a10.Oc().fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc)); + return a10.b() ? null : a10.c(); + } + function iU(a10, b10) { + a10.Oc().pc(b10); + return a10; + } + function jU(a10) { + ab(); + a10 = sO(a10.Oc()); + ab(); + null === ab().$M && null === ab().$M && (ab().$M = new kU()); + ab(); + return GLa(a10); + } + function lU(a10, b10) { + var c10 = a10.Oc(), e10 = ab(); + var f10 = ab(); + null === ab().rJ && null === ab().rJ && (ab().rJ = new mU().P$(f10)); + f10 = ab().rJ; + b10 = uk(tk(e10, b10, f10)); + e10 = nc().Ni(); + Zd(c10, e10, b10); + return a10; + } + function nU(a10, b10) { + var c10 = a10.Oc(), e10 = ab(), f10 = FLa(); + b10 = uk(tk(e10, b10, f10)); + e10 = Yd(nc()); + Zd(c10, e10, b10); + return a10; + } + function HLa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Pd); + } + function oU() { + } + oU.prototype = new u7(); + oU.prototype.constructor = oU; + oU.prototype.a = function() { + return this; + }; + function Zfa(a10, b10, c10, e10, f10, g10, h10) { + return ega(b10, Iha(new je4().e(c10)), e10, f10, g10, h10); + } + oU.prototype.$classData = r8({ Swa: 0 }, false, "amf.core.Root$", { Swa: 1, f: 1, q: 1, o: 1 }); + var ILa = void 0; + function $fa() { + ILa || (ILa = new oU().a()); + return ILa; + } + function pU(a10, b10) { + return a10.cG("" + a10.sH() + b10); + } + function pCa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.JF); + } + function qU() { + } + qU.prototype = new u7(); + qU.prototype.constructor = qU; + qU.prototype.a = function() { + return this; + }; + function tA(a10, b10, c10) { + a10 = Ab(c10, q5(rU)); + return a10 instanceof z7 && (a10 = a10.i, null !== a10 && (a10 = a10.Se, c10 = Du(), null !== a10 && a10 === c10 || (wia(a10) ? wia(b10) : Cia(a10) && Cia(b10)))) ? tD() : Fqa(); + } + qU.prototype.$classData = r8({ mya: 0 }, false, "amf.core.emitter.SpecOrdering$", { mya: 1, f: 1, q: 1, o: 1 }); + var JLa = void 0; + function uA() { + JLa || (JLa = new qU().a()); + return JLa; + } + function sU() { + this.f0 = null; + this.i$ = this.mea = 0; + this.ca = null; + this.Hr = 0; + } + sU.prototype = new CAa(); + sU.prototype.constructor = sU; + d7 = sU.prototype; + d7.Laa = function(a10, b10, c10, e10) { + this.f0 = a10; + this.mea = b10; + this.i$ = c10; + this.ca = e10; + this.Hr = b10; + return this; + }; + d7.bI = function(a10, b10) { + if (!(a10 >= this.mea && b10 <= this.i$ && a10 <= b10)) + throw new Zj().e("Invalid sub-sequence start: " + a10 + ", end: " + b10); + return ya(this.f0, a10, b10); + }; + d7.t = function() { + return ka(this.f0); + }; + d7.Oa = function() { + return this.i$ - this.mea | 0; + }; + d7.Hz = function(a10) { + return xa(this.f0, a10); + }; + function KLa(a10, b10) { + var c10 = new sU(); + sU.prototype.Laa.call(c10, b10, 0, wa(b10), a10); + return c10; + } + d7.$classData = r8({ sya: 0 }, false, "amf.core.lexer.CharSequenceStream", { sya: 1, Ggb: 1, f: 1, eP: 1 }); + function tU(a10) { + var b10 = zc(), c10 = F6().Zd; + a10.Qn(rb(new sb(), b10, G5(c10, "root"), tb(new ub(), vb().hg, "root", "Indicates if the base unit represents the root of the document model obtained from parsing", H10()))); + b10 = qb(); + c10 = F6().Zd; + a10.Nn(rb(new sb(), b10, G5(c10, "location"), tb(new ub(), vb().hg, "location", "Location of the metadata document that generated this base unit", H10()))); + b10 = new xc().yd(Bq()); + c10 = F6().Zd; + a10.Pn(rb(new sb(), b10, G5(c10, "references"), tb(new ub(), vb().hg, "references", "references across base units", H10()))); + b10 = qb(); + c10 = F6().Zd; + c10 = G5(c10, "usage"); + var e10 = vb().hg, f10 = K7(), g10 = F6().Tb; + a10.Rn(rb(new sb(), b10, c10, tb(new ub(), e10, "usage", "Human readable description of the unit", J5(f10, new Ib().ha([ic(G5(g10, "description"))]))))); + b10 = yc(); + c10 = F6().$c; + a10.Mn(rb(new sb(), b10, G5(c10, "describedBy"), tb(new ub(), vb().hg, "described by", "Link to the AML dialect describing a particular subgraph of information", H10()))); + b10 = qb(); + c10 = F6().Zd; + a10.On(rb(new sb(), b10, G5(c10, "version"), tb(new ub(), vb().hg, "version", "Version of the current model", H10()))); + } + function OBa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Hn); + } + function LLa() { + this.qa = this.ba = this.g = this.vf = this.ko = null; + } + LLa.prototype = new u7(); + LLa.prototype.constructor = LLa; + d7 = LLa.prototype; + d7.a = function() { + MLa = this; + Cr(this); + var a10 = qb(), b10 = F6().ez; + this.ko = rb(new sb(), a10, G5(b10, "element"), tb(new ub(), vb().hg, "element", "Label indicating the type of source map information", H10())); + a10 = qb(); + b10 = F6().ez; + this.vf = rb(new sb(), a10, G5(b10, "value"), tb(new ub(), vb().hg, "value", "Value for the source map.", H10())); + this.g = H10(); + ii(); + a10 = F6().ez; + a10 = [G5(a10, "SourceMap")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + this.qa = tb( + new ub(), + vb().hg, + "Source Map", + "SourceMaps include tags with syntax specific information obtained when parsing a particular specification syntax like RAML or OpenAPI.\nIt can be used to re-generate the document from the RDF model with a similar syntax", + H10() + ); + return this; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Rya: 0 }, false, "amf.core.metamodel.document.SourceMapModel$", { Rya: 1, f: 1, hc: 1, Rb: 1 }); + var MLa = void 0; + function oc() { + MLa || (MLa = new LLa().a()); + return MLa; + } + function uU(a10) { + var b10 = oc(), c10 = F6().ez; + a10.Ed(rb(new sb(), b10, G5(c10, "sources"), tb(new ub(), vb().hg, "source", "Indicates that this parsing Unit has SourceMaps", H10()))); + } + function vB(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.pd); + } + function oN(a10) { + a10 = a10.A; + if (a10.b()) + return true; + a10 = a10.c(); + if (null === a10) + throw new sf().a(); + return "" === a10; + } + function vU() { + } + vU.prototype = new u7(); + vU.prototype.constructor = vU; + vU.prototype.a = function() { + return this; + }; + function Tf(a10, b10, c10) { + a10 = new tl().K(new S6().a(), (O7(), new P6().a())); + a10 = Rd(a10, "http://test.com/payload"); + var e10 = Jk().nb; + a10 = Vd(a10, e10, b10); + b10 = Ab(b10.fa(), q5(Bb)); + b10.b() || (b10 = b10.c().da, e10 = Bq().uc, eb(a10, e10, b10)); + return Qoa(a10, c10); + } + vU.prototype.$classData = r8({ Dza: 0 }, false, "amf.core.model.document.PayloadFragment$", { Dza: 1, f: 1, q: 1, o: 1 }); + var NLa = void 0; + function Uf() { + NLa || (NLa = new vU().a()); + return NLa; + } + function OLa(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Fga); + } + function yh(a10) { + var b10 = B6(a10.Y(), Zf().uc); + return b10.A.na() ? b10.A : yb(a10); + } + function RM(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Zv); + } + function Sd(a10, b10, c10) { + var e10 = a10.Zg(); + return Vd(a10, e10, ih(new jh(), b10, c10)); + } + function qD(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.xh); + } + function wU() { + } + wU.prototype = new u7(); + wU.prototype.constructor = wU; + wU.prototype.a = function() { + return this; + }; + function PLa(a10, b10) { + a10 = Od(O7(), b10); + return new Pd().K(new S6().a(), a10); + } + wU.prototype.$classData = r8({ cAa: 0 }, false, "amf.core.model.domain.extensions.CustomDomainProperty$", { cAa: 1, f: 1, q: 1, o: 1 }); + var QLa = void 0; + function RLa() { + QLa || (QLa = new wU().a()); + return QLa; + } + function xU() { + } + xU.prototype = new u7(); + xU.prototype.constructor = xU; + xU.prototype.a = function() { + return this; + }; + xU.prototype.$classData = r8({ hAa: 0 }, false, "amf.core.model.domain.extensions.ShapeExtension$", { hAa: 1, f: 1, q: 1, o: 1 }); + var SLa = void 0; + function yU() { + } + yU.prototype = new u7(); + yU.prototype.constructor = yU; + yU.prototype.a = function() { + return this; + }; + yU.prototype.$classData = r8({ lAa: 0 }, false, "amf.core.model.domain.templates.VariableValue$", { lAa: 1, f: 1, q: 1, o: 1 }); + var TLa = void 0; + function zU() { + } + zU.prototype = new u7(); + zU.prototype.constructor = zU; + zU.prototype.a = function() { + return this; + }; + function AU(a10, b10) { + a10 = new qg().e("\\[\\(([0-9]*),([0-9]*)\\)-\\(([0-9]*),([0-9]*)\\)\\]"); + var c10 = H10(); + a10 = yt(new rg().vi(a10.ja, c10), b10); + a10.b() ? c10 = false : null !== a10.c() ? (c10 = a10.c(), c10 = 0 === Tu(c10, 4)) : c10 = false; + if (c10) { + b10 = a10.c(); + c10 = Uu(b10, 0); + b10 = a10.c(); + var e10 = Uu(b10, 1); + b10 = a10.c(); + b10 = Uu(b10, 2); + a10 = a10.c(); + a10 = Uu(a10, 3); + c10 = new qg().e(c10); + c10 = FD(ED(), c10.ja, 10); + e10 = new qg().e(e10); + e10 = FD(ED(), e10.ja, 10); + b10 = new qg().e(b10); + b10 = FD(ED(), b10.ja, 10); + a10 = new qg().e(a10); + a10 = FD(ED(), a10.ja, 10); + return new BU().fU(new CU().Sc(c10, e10), new CU().Sc(b10, a10)); + } + throw new x7().d(b10); + } + function ce4(a10, b10) { + return new BU().fU(new CU().Sc(b10.rf, b10.If), new CU().Sc(b10.Yf, b10.bg)); + } + zU.prototype.$classData = r8({ PAa: 0 }, false, "amf.core.parser.Range$", { PAa: 1, f: 1, q: 1, o: 1 }); + var ULa = void 0; + function ae4() { + ULa || (ULa = new zU().a()); + return ULa; + } + function DU() { + } + DU.prototype = new u7(); + DU.prototype.constructor = DU; + DU.prototype.a = function() { + return this; + }; + DU.prototype.$classData = r8({ TAa: 0 }, false, "amf.core.parser.Reference$", { TAa: 1, f: 1, q: 1, o: 1 }); + var VLa = void 0; + function EU(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = bp(), m10 = a10.lj; + a10 = k10.b() ? new z7().d(a10.Lz) : k10; + WLa(gp(l10), h10, b10, c10, e10, f10, g10, m10, a10); + } + function XLa() { + CF.call(this); + } + XLa.prototype = new hT(); + XLa.prototype.constructor = XLa; + function YLa() { + } + YLa.prototype = XLa.prototype; + function ZLa() { + this.$ = null; + } + ZLa.prototype = new u7(); + ZLa.prototype.constructor = ZLa; + d7 = ZLa.prototype; + d7.a = function() { + $La = this; + via(this); + return this; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.N8 = function(a10) { + this.$ = a10; + }; + d7.wM = function() { + return ""; + }; + d7.$classData = r8({ PBa: 0 }, false, "amf.core.remote.Oas$", { PBa: 1, f: 1, b7: 1, cD: 1 }); + var $La = void 0; + function Au() { + $La || ($La = new ZLa().a()); + return $La; + } + function aMa() { + this.$ = null; + } + aMa.prototype = new u7(); + aMa.prototype.constructor = aMa; + d7 = aMa.prototype; + d7.a = function() { + bMa = this; + via(this); + return this; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.N8 = function(a10) { + this.$ = a10; + }; + d7.wM = function() { + return "2.0"; + }; + d7.$classData = r8({ QBa: 0 }, false, "amf.core.remote.Oas20$", { QBa: 1, f: 1, b7: 1, cD: 1 }); + var bMa = void 0; + function Bu() { + bMa || (bMa = new aMa().a()); + return bMa; + } + function cMa() { + this.$ = null; + } + cMa.prototype = new u7(); + cMa.prototype.constructor = cMa; + d7 = cMa.prototype; + d7.a = function() { + dMa = this; + via(this); + return this; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.N8 = function(a10) { + this.$ = a10; + }; + d7.wM = function() { + return "3.0"; + }; + d7.$classData = r8({ RBa: 0 }, false, "amf.core.remote.Oas30$", { RBa: 1, f: 1, b7: 1, cD: 1 }); + var dMa = void 0; + function Cu() { + dMa || (dMa = new cMa().a()); + return dMa; + } + function eMa() { + this.$ = null; + } + eMa.prototype = new u7(); + eMa.prototype.constructor = eMa; + d7 = eMa.prototype; + d7.a = function() { + fMa = this; + Bia(this); + return this; + }; + d7.O8 = function(a10) { + this.$ = a10; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.wM = function() { + return ""; + }; + d7.$classData = r8({ WBa: 0 }, false, "amf.core.remote.Raml$", { WBa: 1, f: 1, c7: 1, cD: 1 }); + var fMa = void 0; + function Ob() { + fMa || (fMa = new eMa().a()); + return fMa; + } + function gMa() { + this.$ = null; + } + gMa.prototype = new u7(); + gMa.prototype.constructor = gMa; + d7 = gMa.prototype; + d7.a = function() { + hMa = this; + Bia(this); + return this; + }; + d7.O8 = function(a10) { + this.$ = a10; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.wM = function() { + return "0.8"; + }; + d7.$classData = r8({ XBa: 0 }, false, "amf.core.remote.Raml08$", { XBa: 1, f: 1, c7: 1, cD: 1 }); + var hMa = void 0; + function Qb() { + hMa || (hMa = new gMa().a()); + return hMa; + } + function iMa() { + this.$ = null; + } + iMa.prototype = new u7(); + iMa.prototype.constructor = iMa; + d7 = iMa.prototype; + d7.a = function() { + jMa = this; + Bia(this); + return this; + }; + d7.O8 = function(a10) { + this.$ = a10; + }; + d7.t = function() { + return this.$.trim(); + }; + d7.ve = function() { + return this.$; + }; + d7.wM = function() { + return "1.0"; + }; + d7.$classData = r8({ YBa: 0 }, false, "amf.core.remote.Raml10$", { YBa: 1, f: 1, c7: 1, cD: 1 }); + var jMa = void 0; + function Pb() { + jMa || (jMa = new iMa().a()); + return jMa; + } + function EB() { + this.ob = null; + this.Sk = false; + this.ED = this.wu = null; + } + EB.prototype = new gv(); + EB.prototype.constructor = EB; + function kMa() { + } + kMa.prototype = EB.prototype; + function lMa(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new mf().K(new S6().a(), c10); + c10 = Rd(c10, "http://resolutionstage.com/test#"); + var e10 = Af().Ic; + Bf(c10, e10, b10); + return ar(a10.ye(c10).Y(), Gk().Ic); + } + d7 = EB.prototype; + d7.mt = function(a10, b10) { + this.Sk = a10; + fv.prototype.Hb.call(this, b10); + this.wu = y7(); + this.ED = Rb(Ut(), H10()); + return this; + }; + d7.Aw = function() { + return this.ob; + }; + d7.Ija = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10) { + return a10; + }; + }(this)); + }; + d7.ye = function(a10) { + this.wu = new z7().d(new dv().EK(a10)); + var b10 = hCa(), c10 = iCa(); + return a10.Qm(gCa(b10, c10), Uc(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = new mN(), h10 = e10.Sk, k10 = e10.wu, l10 = e10.Aw(), m10 = e10.Ija(); + g10.ED = e10.ED; + g10.Sk = h10; + g10.wu = k10; + g10.vG = l10; + g10.Hja = m10; + return g10.wqa(f10); + }; + }(this)), this.Aw()); + }; + function wqa(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new mf().K(new S6().a(), c10); + c10 = Rd(c10, "http://resolutionstage.com/test#"); + if (null !== b10.j) + Ui(c10.Y(), Gk().nb, b10, (O7(), new P6().a())); + else { + var e10 = Jk().nb; + Vd(c10, e10, b10); + } + return a10.ye(c10).qe(); + } + d7.$classData = r8({ Pga: 0 }, false, "amf.core.resolution.stages.ReferenceResolutionStage", { Pga: 1, ii: 1, f: 1, Qga: 1 }); + function FU() { + this.En = null; + } + FU.prototype = new u7(); + FU.prototype.constructor = FU; + FU.prototype.a = function() { + mMa = this; + this.En = new GU().Hc("", ""); + return this; + }; + function wha(a10, b10) { + fF(); + var c10 = (null === b10 ? "" : b10).trim(); + c10 = new qg().e(c10); + if (tc(c10)) + switch (a10 = qia(ua(), b10, 46), a10) { + case -1: + return new GU().Hc("", b10); + default: + return c10 = b10.substring(0, a10), new GU().Hc(c10, b10.substring(1 + a10 | 0)); + } + else + return a10.En; + } + FU.prototype.$classData = r8({ hDa: 0 }, false, "amf.core.utils.package$QName$", { hDa: 1, f: 1, q: 1, o: 1 }); + var mMa = void 0; + function xha() { + mMa || (mMa = new FU().a()); + return mMa; + } + function HU() { + } + HU.prototype = new u7(); + HU.prototype.constructor = HU; + HU.prototype.a = function() { + return this; + }; + function nMa(a10, b10, c10) { + return aq(new bq(), !c10.Od(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.zm === Yb().qb; + }; + }(a10))), "", b10, c10); + } + HU.prototype.$classData = r8({ mDa: 0 }, false, "amf.core.validation.AMFValidationReport$", { mDa: 1, f: 1, q: 1, o: 1 }); + var oMa = void 0; + function pMa() { + oMa || (oMa = new HU().a()); + return oMa; + } + function Wb() { + } + Wb.prototype = new u7(); + Wb.prototype.constructor = Wb; + Wb.prototype.a = function() { + return this; + }; + function aba(a10, b10, c10) { + if (Vb().Ia(c10.TB()).na() && "" !== c10.TB()) { + var e10 = false, f10 = null, g10 = b10.Y().vb, h10 = mz(); + h10 = Ua(h10); + var k10 = Id().u; + a10 = Jd(g10, h10, k10).Fb(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return ic(p10.Lc.r) === m10.TB(); + }; + }(a10, c10))); + a: { + if (a10 instanceof z7 && (e10 = true, f10 = a10, a10 = f10.i, wh(a10.r.r.fa(), q5(jd)))) { + e10 = a10.r.r.fa(); + break a; + } + if (e10 && (a10 = f10.i, wh(a10.r.x, q5(jd)))) { + e10 = a10.r.x; + break a; + } + e10 ? (e10 = f10.i.r.r, e10 = e10 instanceof $r && e10.wb.Da() ? e10.wb.ga().fa() : b10.fa()) : e10 = b10.fa(); + } + } else + e10 = b10.fa(); + b10 = Ab(e10, q5(jd)); + e10 = Ab(e10, q5(Bb)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.da)); + return new R6().M( + b10, + e10 + ); + } + Wb.prototype.$classData = r8({ oDa: 0 }, false, "amf.core.validation.AMFValidationResult$", { oDa: 1, f: 1, q: 1, o: 1 }); + var Zaa = void 0; + function IU() { + this.bia = this.aia = this.Zha = this.P7 = this.Afa = this.Qfa = null; + } + IU.prototype = new u7(); + IU.prototype.constructor = IU; + IU.prototype.a = function() { + qMa = this; + var a10 = F6().Eb; + this.Qfa = ic(G5(a10, "CoreShape")); + a10 = F6().Eb; + this.Afa = ic(G5(a10, "AmlShape")); + a10 = F6().Eb; + this.P7 = ic(G5(a10, "ParserShape")); + a10 = F6().Eb; + this.Zha = ic(G5(a10, "PayloadShape")); + a10 = F6().Eb; + this.aia = ic(G5(a10, "RenderShape")); + a10 = F6().Eb; + this.bia = ic(G5(a10, "ResolutionShape")); + return this; + }; + IU.prototype.$classData = r8({ CDa: 0 }, false, "amf.core.validation.core.ValidationSpecification$", { CDa: 1, f: 1, q: 1, o: 1 }); + var qMa = void 0; + function oj() { + qMa || (qMa = new IU().a()); + return qMa; + } + function JU() { + this.yu = this.i5 = this.NM = this.j5 = this.xF = this.Ifa = this.h5 = this.Ul = this.bv = this.$c = this.nia = this.Qi = this.Jfa = this.Bj = this.Tb = this.Ua = this.ez = this.Pg = this.Eb = this.dc = this.Jb = this.Ta = this.Zd = null; + } + JU.prototype = new u7(); + JU.prototype.constructor = JU; + JU.prototype.a = function() { + rMa = this; + this.Zd = new sL().e("http://a.ml/vocabularies/document#"); + this.Ta = new sL().e("http://a.ml/vocabularies/apiContract#"); + this.Jb = new sL().e("http://a.ml/vocabularies/apiBinding#"); + this.dc = new sL().e("http://a.ml/vocabularies/security#"); + this.Eb = new sL().e("http://a.ml/vocabularies/shapes#"); + this.Pg = new sL().e("http://a.ml/vocabularies/data#"); + this.ez = new sL().e("http://a.ml/vocabularies/document-source-maps#"); + this.Ua = new sL().e("http://www.w3.org/ns/shacl#"); + this.Tb = new sL().e("http://a.ml/vocabularies/core#"); + this.Bj = new sL().e("http://www.w3.org/2001/XMLSchema#"); + this.Jfa = new sL().e("http://a.ml/vocabularies/shapes/anon#"); + this.Qi = new sL().e("http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + this.nia = new sL().e(""); + this.$c = new sL().e("http://a.ml/vocabularies/meta#"); + this.bv = new sL().e("http://www.w3.org/2002/07/owl#"); + this.Ul = new sL().e("http://www.w3.org/2000/01/rdf-schema#"); + this.h5 = new sL().e("http://a.ml/vocabularies/amf/core#"); + this.Ifa = new sL().e("http://a.ml/vocabularies/amf/aml#"); + this.xF = new sL().e("http://a.ml/vocabularies/amf/parser#"); + this.j5 = new sL().e("http://a.ml/vocabularies/amf/resolution#"); + this.NM = new sL().e("http://a.ml/vocabularies/amf/validation#"); + this.i5 = new sL().e("http://a.ml/vocabularies/amf/render#"); + var a10 = new R6().M("rdf", this.Qi), b10 = new R6().M("sh", this.Ua), c10 = new R6().M("shacl", this.Ua), e10 = new R6().M("security", this.dc), f10 = new R6().M("core", this.Tb), g10 = new R6().M("raml-doc", this.Zd), h10 = new R6().M("doc", this.Zd), k10 = new R6().M("xsd", this.Bj), l10 = new R6().M( + "amf-parser", + this.xF + ), m10 = new R6().M("amf-core", this.h5), p10 = new R6().M("apiContract", this.Ta), t10 = new R6().M("apiBinding", this.Jb), v10 = new R6().M("amf-resolution", this.j5), A10 = new R6().M("amf-validation", this.NM), D10 = new R6().M("amf-render", this.i5), C10 = new R6().M("raml-shapes", this.Eb), I10 = new R6().M("data", this.Pg), L10 = new R6().M("sourcemaps", this.ez), Y10 = new R6().M("meta", this.$c), ia = new R6().M("owl", this.bv); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia, new R6().M("rdfs", this.Ul)]; + b10 = new wu().a(); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Mt(b10, a10[c10]), c10 = 1 + c10 | 0; + this.yu = b10; + return this; + }; + function aka(a10, b10) { + a10 = a10.yu.mb(); + a: { + for (; a10.Ya(); ) { + var c10 = a10.$a(), e10 = c10; + if (null === e10) + throw new x7().d(e10); + e10 = e10.ya().he; + if (0 === (b10.indexOf(e10) | 0)) { + c10 = new z7().d(c10); + break a; + } + } + c10 = y7(); + } + if (c10 instanceof z7 && (a10 = c10.i, null !== a10)) + return c10 = a10.ma(), e10 = a10.ya(), a10 = new qg().e(c10), b10 = b10.split(e10.he).join(":"), b10 = new qg().e(b10), c10 = Gb().uN, xq(a10, b10, c10); + if (y7() === c10) + return b10; + throw new x7().d(c10); + } + function RB(a10, b10) { + if (-1 < (b10.indexOf(":") | 0)) + return $v(a10, b10); + a10 = new wq().Yn(a10.yu).Sb.Ye(); + a: { + for (; a10.Ya(); ) { + var c10 = a10.$a(); + if (0 === (b10.indexOf(c10.he) | 0)) { + a10 = new z7().d(c10); + break a; + } + } + a10 = y7(); + } + return a10 instanceof z7 ? (a10 = a10.i, c10 = a10.he, b10 = Mc(ua(), b10, c10), b10 = Oc(new Pc().fd(b10)), G5(a10, b10)) : KU(LU(), b10); + } + function $v(a10, b10) { + if (!(0 <= (b10.length | 0) && "http://" === b10.substring(0, 7))) { + var c10 = Mc(ua(), b10, ":"), e10 = Fd(Gd(), c10); + if (!e10.b() && null !== e10.c() && 0 === e10.c().Oe(2) && (c10 = e10.c().lb(0), e10 = e10.c().lb(1), a10 = a10.yu.Ja(c10), a10 instanceof z7)) + return G5(a10.i, e10); + } + return KU(LU(), b10); + } + JU.prototype.$classData = r8({ EDa: 0 }, false, "amf.core.vocabulary.Namespace$", { EDa: 1, f: 1, q: 1, o: 1 }); + var rMa = void 0; + function F6() { + rMa || (rMa = new JU().a()); + return rMa; + } + function MU() { + } + MU.prototype = new u7(); + MU.prototype.constructor = MU; + MU.prototype.a = function() { + return this; + }; + function KU(a10, b10) { + return -1 !== (b10.indexOf("#") | 0) ? (a10 = Mc(ua(), b10, "#"), b10 = Oc(new Pc().fd(a10)), a10 = zj(new Pc().fd(a10)) + "#", G5(new sL().e(a10), b10)) : -1 !== (b10.split("://").join("_").indexOf("/") | 0) ? (a10 = Mc(ua(), b10, "/"), a10 = Oc(new Pc().fd(a10)), b10 = b10.split(a10).join(""), G5(new sL().e(b10), a10)) : G5(new sL().e(b10), ""); + } + MU.prototype.$classData = r8({ HDa: 0 }, false, "amf.core.vocabulary.ValueType$", { HDa: 1, f: 1, q: 1, o: 1 }); + var sMa = void 0; + function LU() { + sMa || (sMa = new MU().a()); + return sMa; + } + function HCa() { + this.kt = this.DG = null; + this.ru = this.qu = false; + } + HCa.prototype = new nw(); + HCa.prototype.constructor = HCa; + d7 = HCa.prototype; + d7.baa = function(a10, b10) { + mw.prototype.DK.call(this, new NU().baa(a10, b10)); + cba(this); + return this; + }; + d7.MU = function(a10) { + this.qu = a10; + }; + d7.UT = function(a10) { + this.kt = a10; + }; + d7.PU = function(a10) { + this.ru = a10; + }; + d7.$classData = r8({ XDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$1", { XDa: 1, MY: 1, f: 1, NY: 1 }); + function FCa() { + this.kt = this.DG = null; + this.ru = this.qu = false; + } + FCa.prototype = new nw(); + FCa.prototype.constructor = FCa; + d7 = FCa.prototype; + d7.caa = function(a10, b10, c10) { + mw.prototype.DK.call(this, new OU().caa(a10, b10, c10)); + cba(this); + return this; + }; + d7.MU = function(a10) { + this.qu = a10; + }; + d7.UT = function(a10) { + this.kt = a10; + }; + d7.PU = function(a10) { + this.ru = a10; + }; + d7.$classData = r8({ ZDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$2", { ZDa: 1, MY: 1, f: 1, NY: 1 }); + function BCa() { + this.kt = this.DG = null; + this.ru = this.qu = false; + } + BCa.prototype = new nw(); + BCa.prototype.constructor = BCa; + d7 = BCa.prototype; + d7.MU = function(a10) { + this.qu = a10; + }; + d7.UT = function(a10) { + this.kt = a10; + }; + d7.PU = function(a10) { + this.ru = a10; + }; + d7.KK = function(a10, b10, c10) { + mw.prototype.DK.call(this, new PU().KK(a10, b10, c10)); + cba(this); + return this; + }; + d7.$classData = r8({ aEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$3", { aEa: 1, MY: 1, f: 1, NY: 1 }); + function ACa() { + this.kt = this.DG = null; + this.ru = this.qu = false; + } + ACa.prototype = new nw(); + ACa.prototype.constructor = ACa; + d7 = ACa.prototype; + d7.MU = function(a10) { + this.qu = a10; + }; + d7.UT = function(a10) { + this.kt = a10; + }; + d7.PU = function(a10) { + this.ru = a10; + }; + d7.KK = function(a10, b10, c10) { + mw.prototype.DK.call(this, new QU().KK(a10, b10, c10)); + cba(this); + return this; + }; + d7.$classData = r8({ cEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$4", { cEa: 1, MY: 1, f: 1, NY: 1 }); + function JCa() { + this.kt = this.DG = null; + this.ru = this.qu = false; + } + JCa.prototype = new nw(); + JCa.prototype.constructor = JCa; + d7 = JCa.prototype; + d7.MU = function(a10) { + this.qu = a10; + }; + d7.daa = function(a10, b10, c10, e10) { + mw.prototype.DK.call(this, new RU().daa(a10, b10, c10, e10)); + cba(this); + return this; + }; + d7.UT = function(a10) { + this.kt = a10; + }; + d7.PU = function(a10) { + this.ru = a10; + }; + d7.$classData = r8({ eEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$5", { eEa: 1, MY: 1, f: 1, NY: 1 }); + function pw() { + this.OM = this.Lv = this.nI = this.oI = this.Mv = this.Nv = this.Dz = this.px = this.Ov = this.IA = this.m = null; + } + pw.prototype = new u7(); + pw.prototype.constructor = pw; + pw.prototype.PL = function(a10, b10) { + var c10 = new SU(), e10 = Rb(Gb().ab, H10()); + c10.Pe = e10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.er = Rb(Ut(), H10()); + c10.Nu = Rb(Ut(), H10()); + c10.py = Rb(Ut(), H10()); + return c10.PL(a10, b10); + }; + function tMa(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().sa === c10) { + c10 = qc(); + c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@value"); + }; + }(a10))); + if (c10 instanceof z7) { + c10 = c10.i.i; + var e10 = bc(); + c10 = N6(c10, e10, a10.m).va; + } else + c10 = bc(), c10 = N6(b10, c10, a10.m).va; + e10 = qc(); + b10 = N6(b10, e10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@type"); + }; + }(a10))); + if (b10 instanceof z7) { + b10 = b10.i.i; + e10 = bc(); + b10 = N6(b10, e10, a10.m).va; + b10 = fc(b10, a10.m); + if (null !== b10 && b10 === a10.Mv) + return a10 = new qg().e(c10), ih( + new jh(), + iH(a10.ja), + new P6().a() + ); + if (null !== b10 && b10 === a10.Ov) + return a10 = new qg().e(c10), b10 = ED(), ih(new jh(), FD(b10, a10.ja, 10), new P6().a()); + if (null !== b10 && b10 === a10.px) + return a10 = new qg().e(c10).ja, ih(new jh(), da(Oj(va(), a10)), new P6().a()); + if (null !== b10 && b10 === a10.Nv) + return a10 = new qg().e(c10), b10 = va(), ih(new jh(), Oj(b10, a10.ja), new P6().a()); + if (null !== b10 && b10 === a10.oI || null !== b10 && b10 === a10.nI) + return a10 = jH(mF(), c10), ih(new jh(), new zz().ln(a10).c(), new P6().a()); + } + return ih(new jh(), c10, new P6().a()); + } + c10 = bc(); + return ih(new jh(), N6(b10, c10, a10.m).va, new P6().a()); + } + function uMa(a10, b10) { + a10 = a10.Lv.Ja(fc(b10, a10.m)); + return a10.b() ? fs().NT(b10) : a10; + } + function vMa(a10, b10, c10) { + b10 = ac(new M6().W(b10), hc(ic(c10.r), a10.m)); + if (b10.b()) + return y7(); + b10 = b10.c(); + c10 = pc3(a10, c10.ba, b10.i); + b10 = bc(); + return new z7().d(N6(c10, b10, a10.m).va); + } + function wMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + function xMa(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().sa === c10) + if (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@value"); + }; + }(a10))), c10 instanceof z7) { + c10 = c10.i; + b10 = mF(); + c10 = c10.i; + var e10 = bc(); + a10 = jH(b10, N6(c10, e10, a10.m).va); + a10 = new zz().ln(a10).c(); + } else + c10 = mF(), e10 = bc(), a10 = jH(c10, N6(b10, e10, a10.m).va), a10 = new zz().ln(a10).c(); + else + c10 = mF(), e10 = bc(), a10 = jH(c10, N6(b10, e10, a10.m).va), a10 = new zz().ln(a10).c(); + return ih(new jh(), a10, new P6().a()); + } + function yMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + function zMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10)); + return ih(new jh(), a10, new P6().a()); + } + pw.prototype.aaa = function(a10) { + this.m = a10; + this.IA = Uh().zj; + this.Ov = Uh().hi; + this.px = Uh().of; + this.Dz = Uh().Xo; + this.Nv = Uh().Nh; + this.Mv = Uh().Mi; + this.oI = Uh().tj; + this.nI = Uh().jo; + a10 = nu(); + var b10 = fs().yE; + this.Lv = AMa(a10, b10); + return this; + }; + function BMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + function CMa(a10, b10, c10, e10) { + var f10 = fs().yE.Ja(ic(e10.Kb().ga())); + if (f10 instanceof z7 && (f10 = f10.i, Kaa(f10))) + return w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = l10.lc(); + p10.fa().Sp(m10); + return new z7().d(p10); + }; + }(a10, f10)); + f10 = fs().KS(e10); + if (f10 instanceof z7) + return w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return new z7().d(l10.P(m10)); + }; + }(a10, f10.i)); + f10 = a10.m; + var g10 = dc().oZ; + e10 = "Cannot find builder for node type " + e10; + var h10 = y7(); + ec(f10, g10, b10, h10, e10, c10.da); + return w6(/* @__PURE__ */ function() { + return function() { + return y7(); + }; + }(a10)); + } + function DMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va); + return ih(new jh(), a10, new P6().a()); + } + pw.prototype.$classData = r8({ lEa: 0 }, false, "amf.plugins.document.graph.parser.ExpandedGraphParser", { lEa: 1, f: 1, wEa: 1, Vga: 1 }); + function ww() { + this.OM = this.Lv = this.nI = this.oI = this.Mv = this.Nv = this.Dz = this.px = this.Ov = this.IA = this.m = null; + } + ww.prototype = new u7(); + ww.prototype.constructor = ww; + ww.prototype.PL = function(a10, b10) { + var c10 = new TU(), e10 = Rb(Gb().ab, H10()); + c10.Pe = e10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.er = Rb(Ut(), H10()); + c10.Nu = Rb(Ut(), H10()); + c10.py = Rb(Ut(), H10()); + c10.Wg = Rb(Ut(), H10()); + c10.U0 = new wu().a(); + return c10.PL(a10, b10); + }; + function EMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = iH(a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + function FMa(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().sa === c10) + if (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@value"); + }; + }(a10))), c10 instanceof z7) { + c10 = c10.i; + b10 = mF(); + c10 = c10.i; + var e10 = bc(); + a10 = jH(b10, N6(c10, e10, a10.m).va); + a10 = new zz().ln(a10).c(); + } else + c10 = mF(), e10 = bc(), a10 = jH(c10, N6(b10, e10, a10.m).va), a10 = new zz().ln(a10).c(); + else + c10 = mF(), e10 = bc(), a10 = jH(c10, N6(b10, e10, a10.m).va), a10 = new zz().ln(a10).c(); + return ih(new jh(), a10, new P6().a()); + } + function GMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + function HMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = FD(ED(), a10.ja, 10)); + return ih(new jh(), a10, new P6().a()); + } + function IMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va); + return ih(new jh(), a10, new P6().a()); + } + function JMa(a10, b10, c10, e10) { + var f10 = fs().yE.Ja(ic(e10.Kb().ga())); + if (f10 instanceof z7 && (f10 = f10.i, Kaa(f10))) + return w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = l10.lc(); + p10.fa().Sp(m10); + return new z7().d(p10); + }; + }(a10, f10)); + f10 = fs().KS(e10); + if (f10 instanceof z7) + return w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return new z7().d(l10.P(m10)); + }; + }(a10, f10.i)); + f10 = a10.m; + var g10 = dc().oZ; + e10 = "Cannot find builder for node type " + e10; + var h10 = y7(); + ec(f10, g10, b10, h10, e10, c10.da); + return w6(/* @__PURE__ */ function() { + return function() { + return y7(); + }; + }(a10)); + } + function KMa(a10, b10, c10) { + b10 = ac(new M6().W(b10), hc(ic(c10.r), a10.m)); + if (b10.b()) + return y7(); + b10 = b10.c(); + c10 = pc3(a10, c10.ba, b10.i); + b10 = bc(); + return new z7().d(N6(c10, b10, a10.m).va); + } + function LMa(a10, b10) { + a10 = a10.Lv.Ja(fc(b10, a10.m)); + return a10.b() ? fs().NT(b10) : a10; + } + ww.prototype.aaa = function(a10) { + this.m = a10; + this.IA = Uh().zj; + this.Ov = Uh().hi; + this.px = Uh().of; + this.Dz = Uh().Xo; + this.Nv = Uh().Nh; + this.Mv = Uh().Mi; + this.oI = Uh().tj; + this.nI = Uh().jo; + a10 = nu(); + var b10 = fs().yE; + this.Lv = AMa(a10, b10); + return this; + }; + function MMa(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().sa === c10) { + c10 = qc(); + c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@value"); + }; + }(a10))); + if (c10 instanceof z7) { + c10 = c10.i.i; + var e10 = bc(); + c10 = N6(c10, e10, a10.m).va; + } else + c10 = bc(), c10 = N6(b10, c10, a10.m).va; + e10 = qc(); + b10 = N6(b10, e10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = Dd(); + g10 = N6(g10, h10, f10.m); + return null !== g10 && ra(g10, "@type"); + }; + }(a10))); + if (b10 instanceof z7) { + b10 = b10.i.i; + e10 = bc(); + b10 = N6(b10, e10, a10.m).va; + b10 = fc(b10, a10.m); + if (null !== b10 && b10 === a10.Mv) + return a10 = new qg().e(c10), ih( + new jh(), + iH(a10.ja), + new P6().a() + ); + if (null !== b10 && b10 === a10.Ov) + return a10 = new qg().e(c10), b10 = ED(), ih(new jh(), FD(b10, a10.ja, 10), new P6().a()); + if (null !== b10 && b10 === a10.px) + return a10 = new qg().e(c10).ja, ih(new jh(), da(Oj(va(), a10)), new P6().a()); + if (null !== b10 && b10 === a10.Nv) + return a10 = new qg().e(c10), b10 = va(), ih(new jh(), Oj(b10, a10.ja), new P6().a()); + if (null !== b10 && b10 === a10.oI || null !== b10 && b10 === a10.nI) + return a10 = jH(mF(), c10), ih(new jh(), new zz().ln(a10).c(), new P6().a()); + } + return ih(new jh(), c10, new P6().a()); + } + c10 = bc(); + return ih(new jh(), N6(b10, c10, a10.m).va, new P6().a()); + } + function NMa(a10, b10) { + var c10 = b10.hb().gb; + Q5().sa === c10 ? (c10 = qc(), c10 = N6(b10, c10, a10.m).sb.Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.Aa; + var g10 = Dd(); + f10 = N6(f10, g10, e10.m); + return null !== f10 && ra(f10, "@value"); + }; + }(a10))), c10 instanceof z7 ? (b10 = c10.i.i, c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja))) : (c10 = bc(), a10 = N6(b10, c10, a10.m).va, a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)); + return ih(new jh(), a10, new P6().a()); + } + ww.prototype.$classData = r8({ qEa: 0 }, false, "amf.plugins.document.graph.parser.FlattenedGraphParser", { qEa: 1, f: 1, wEa: 1, Vga: 1 }); + function OMa() { + this.ea = this.Bf = this.Hm = this.X = null; + } + OMa.prototype = new u7(); + OMa.prototype.constructor = OMa; + d7 = OMa.prototype; + d7.vK = function(a10) { + var b10 = new Fc().Vd(this.X).Sb.Ye(); + a: { + for (; b10.Ya(); ) { + var c10 = b10.$a(); + if (-1 !== (a10.indexOf(c10.j) | 0)) { + b10 = new z7().d(c10); + break a; + } + } + b10 = y7(); + } + b10.b() ? a10 = y7() : (b10 = b10.c(), a10 = new z7().d(new R6().M(b10, B6(b10.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10.j === f10; + }; + }(this, a10)))))); + a10 = a10.ua(); + return Jc(a10, new PMa()); + }; + function QMa(a10, b10, c10) { + var e10 = fp(); + return RMa(a10, b10, Jea(e10, new ip().Hc(b10, c10))); + } + d7.a = function() { + this.ea = nv().ea; + this.X = Rb(Gb().ab, H10()); + this.Hm = J5(Gb().Qg, H10()); + this.Bf = Rb(Gb().ab, H10()); + return this; + }; + function SMa(a10, b10, c10) { + var e10 = B6(b10.g, wj().Ut), f10 = B6(b10.g, wj().ej), g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return xj(k10); + }; + }(a10)), h10 = K7(); + f10 = f10.ka(g10, h10.u); + c10 = B6(c10.g, Gc().Ic); + g10 = new TMa(); + h10 = K7(); + c10 = c10.ec(g10, h10.u).ps(Gb().si).Cb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return B6(m10.g, Ae4().bh).Od(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.A; + return (v10.b() ? null : v10.c()) === t10.j; + }; + }(k10, l10))); + }; + }(a10, b10))); + g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return B6(k10.g, $d().nr); + }; + }(a10)); + h10 = K7(); + c10 = c10.ka(g10, h10.u).fj(); + a10 = w6(/* @__PURE__ */ function() { + return function(k10) { + var l10 = qb(); + LU(); + var m10 = k10.A; + m10 = KU(0, m10.b() ? null : m10.c()); + var p10 = vb().qm; + k10 = k10.A; + return rb(new sb(), l10, m10, tb(new ub(), p10, "custom", k10.b() ? null : k10.c(), H10())); + }; + }(a10)); + g10 = K7(); + a10 = c10.ka(a10, g10.u); + e10 = e10.A; + e10.b() ? e10 = y7() : (e10 = e10.c(), c10 = K7(), e10 = new z7().d(J5(c10, new Ib().ha([e10])))); + e10 = e10.b() ? H10() : e10.c(); + c10 = K7(); + return UMa(new UU(), e10, f10.ia(a10, c10.u), new z7().d(b10)); + } + d7.KS = function(a10) { + return a10 instanceof UU ? new z7().d(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + var f10 = c10.tna; + if (f10 instanceof z7) { + f10 = f10.i; + e10 = new uO().K(new S6().a(), e10); + var g10 = c10.Bqa, h10 = f10.j, k10 = K7(); + return VU(WU(e10, g10.yg(h10, k10.u)), f10); + } + throw mb(E6(), new nb().e("Cannot find node mapping for dialectModel " + c10)); + }; + }(this, a10))) : y7(); + }; + d7.NT = function(a10) { + var b10 = new Fc().Vd(this.X).Sb.Ye().Dd(); + b10 = VMa(b10, J5(qe2(), H10()), b10); + var c10 = new XU(); + c10.Cqa = a10; + a10 = K7(); + a10 = b10.ec(c10, a10.u); + a10 = Jc(a10, new WMa()); + return a10 instanceof z7 && (b10 = a10.i, null !== b10 && (a10 = b10.ma(), b10 = b10.ya(), null !== a10 && b10 instanceof Cd)) ? new z7().d(SMa(this, b10, a10)) : y7(); + }; + function XMa(a10, b10) { + var c10 = new mO().Hb(Np(Op(), b10)).ye(b10); + YMa(b10).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + e10.X = e10.X.cc(new R6().M(g10, f10)); + }; + }(a10, c10))); + a10.Hm = a10.Hm.Zj(YU(b10)); + return c10; + } + function ZMa(a10, b10) { + b10 = B6(b10.g, qO().ig).A; + if (!b10.b()) + for (b10 = b10.c(), a10 = new Fc().Vd(a10.X).Sb.Ye(); a10.Ya(); ) { + var c10 = a10.$a(); + if (c10.j === b10) + return new z7().d(c10); + } + return y7(); + } + function $Ma(a10, b10) { + YMa(b10).U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + c10.X = c10.X.cc(new R6().M(f10, e10)); + }; + }(a10, b10))); + a10.Hm = a10.Hm.Qs(YU(b10)); + a10.Bf = a10.Bf.wp(YU(b10)); + } + function RMa(a10, b10, c10) { + var e10 = a10.X.Ja(b10); + if (e10 instanceof z7) + return b10 = e10.i, nq(hp(), oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return g10; + }; + }(a10, b10)), ml()); + e10 = bp(); + a10 = /* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = new z7().d("application/yaml"), m10 = new z7().d(Eia().$), p10 = Kea(Zo(), f10.ea), t10 = new $o().a(); + ap(); + var v10 = Lea(); + ap(); + var A10 = y7(); + ap(); + var D10 = new kp().a(); + return Mea(ap(), g10, l10, m10, p10, v10, t10, A10, h10, D10).Yg(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + if (L10 instanceof zO) + return Hb(I10), $Ma(C10, L10), L10; + throw new x7().d(L10); + }; + }(f10, k10)), ml()); + }; + }(a10, b10, c10); + b10 = gp(e10); + if (b10.vw) { + b10.vw = false; + try { + return a10(oq(/* @__PURE__ */ function(f10) { + return function() { + f10.vw = true; + }; + }(b10))); + } catch (f10) { + a10 = Ph(E6(), f10); + if (a10 instanceof nb) + throw b10.vw = true, mb(E6(), a10); + throw f10; + } + } else + return a10(oq(/* @__PURE__ */ function() { + return function() { + }; + }(b10))); + } + function aNa(a10) { + return iF(fF(), a10); + } + function lDa(a10, b10) { + return "%Vocabulary 1.0" === b10 || "%Dialect 1.0" === b10 || "%Library / Dialect 1.0" === b10 || a10.X.Ha(aNa(b10)); + } + d7.$classData = r8({ BEa: 0 }, false, "amf.plugins.document.vocabularies.DialectsRegistry", { BEa: 1, f: 1, Sgb: 1, ib: 1 }); + function fd() { + this.HL = this.l = null; + } + fd.prototype = new u7(); + fd.prototype.constructor = fd; + fd.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "external"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.HL, l10 = cd(this.l.pb), m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return bNa(v10, t10.HL); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + fd.prototype.La = function() { + var a10 = cd(this.l.pb), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.c(); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + fd.prototype.$classData = r8({ YEa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectDocumentsEmitters$$anon$6", { YEa: 1, f: 1, db: 1, Ma: 1 }); + function ZU() { + this.qia = this.IL = this.Tja = this.Mba = null; + } + ZU.prototype = new u7(); + ZU.prototype.constructor = ZU; + function tba(a10, b10, c10, e10) { + var f10 = new ZU(); + f10.Mba = a10; + f10.Tja = b10; + f10.IL = c10; + f10.qia = e10; + return f10; + } + ZU.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "nodeMappings"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = this.Mba, k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.IL, A10 = p10.qia, D10 = new $U(); + D10.pb = p10.Tja; + D10.dm = t10; + D10.p = v10; + D10.Xb = A10; + return D10; + }; + }(this)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + jr(wr(), this.IL.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + ZU.prototype.La = function() { + var a10 = this.Mba, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.fa(), q5(jd)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.yc.$d)); + return e10.b() ? ld() : e10.c(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + var f10 = ld(); + return !(null !== e10 && e10.h(f10)); + }; + }(this))); + TC(); + b10 = Gb().si; + a10 = a10.nk(UC(b10)).kc(); + return a10.b() ? ld() : a10.c(); + }; + ZU.prototype.$classData = r8({ ZEa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectDocumentsEmitters$$anon$7", { ZEa: 1, f: 1, db: 1, Ma: 1 }); + function aV() { + this.l = null; + } + aV.prototype = new u7(); + aV.prototype.constructor = aV; + aV.prototype.Qa = function(a10) { + var b10 = B6(this.l.pb.g, Bq().ae).A; + cx(new dx(), "usage", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + aV.prototype.hU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + aV.prototype.La = function() { + var a10 = Ab(hd(this.l.pb.g, Gc().ae).c().r.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + aV.prototype.$classData = r8({ bFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectEmitter$$anon$10", { bFa: 1, f: 1, db: 1, Ma: 1 }); + function bV() { + this.l = null; + } + bV.prototype = new u7(); + bV.prototype.constructor = bV; + bV.prototype.Qa = function(a10) { + var b10 = B6(this.l.pb.g, Gc().R).A; + cx(new dx(), "dialect", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + bV.prototype.hU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + bV.prototype.La = function() { + var a10 = Ab(hd(this.l.pb.g, Gc().R).c().r.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + bV.prototype.$classData = r8({ cFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectEmitter$$anon$8", { cFa: 1, f: 1, db: 1, Ma: 1 }); + function cV() { + this.l = null; + } + cV.prototype = new u7(); + cV.prototype.constructor = cV; + cV.prototype.Qa = function(a10) { + var b10 = B6(this.l.pb.g, Gc().Ym).A; + cx(new dx(), "version", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + cV.prototype.hU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + cV.prototype.La = function() { + var a10 = Ab(hd(this.l.pb.g, Gc().Ym).c().r.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + cV.prototype.$classData = r8({ dFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectEmitter$$anon$9", { dFa: 1, f: 1, db: 1, Ma: 1 }); + function cNa(a10, b10) { + var c10 = J5(K7(), H10()); + var e10 = hd(b10.Y(), Ae4().qD); + if (!e10.b()) { + e10 = e10.c().Lc; + e10 = gd(b10, e10); + var f10 = dV(b10), g10 = K7(), h10 = new eV(); + if (null === a10) + throw mb(E6(), null); + h10.l = a10; + h10.Eqa = f10; + h10.foa = e10; + a10 = J5(g10, new Ib().ha([h10])); + e10 = K7(); + c10 = c10.ia(a10, e10.u); + } + a10 = hd(b10.Y(), Ae4().Zt); + a10.b() || (e10 = a10.c(), a10 = ka(e10.r.r.r), e10 = gd(b10, e10.Lc), b10 = c10, c10 = K7(), a10 = [cx(new dx(), "typeDiscriminatorName", a10, Q5().Na, e10)], c10 = J5(c10, new Ib().ha(a10)), a10 = K7(), c10 = b10.ia(c10, a10.u)); + return c10; + } + function eV() { + this.foa = this.Eqa = this.l = null; + } + eV.prototype = new u7(); + eV.prototype.constructor = eV; + eV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "typeDiscriminator"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + this.Eqa.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + if (null !== v10) { + var A10 = v10.ma(); + v10 = v10.ya(); + var D10 = Bw(p10.l, v10); + D10 instanceof z7 ? (v10 = D10.i, T6(), A10 = mh(T6(), A10), T6(), v10 = mh(T6(), v10), sr(t10, A10, v10)) : (T6(), A10 = mh(T6(), A10), T6(), v10 = mh(T6(), v10), sr(t10, A10, v10)); + } else + throw new x7().d(v10); + }; + }(this, g10))); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + eV.prototype.La = function() { + return this.foa; + }; + eV.prototype.$classData = r8({ fFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DiscriminatorEmitter$$anon$1", { fFa: 1, f: 1, db: 1, Ma: 1 }); + function fV() { + this.fea = null; + } + fV.prototype = new u7(); + fV.prototype.constructor = fV; + fV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "declares"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + jr(wr(), this.fea, g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + function dNa(a10) { + var b10 = new fV(); + b10.fea = a10; + return b10; + } + fV.prototype.La = function() { + return this.fea.ga().Fg; + }; + fV.prototype.$classData = r8({ nFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.LibraryDocumentModelEmitter$$anon$2", { nFa: 1, f: 1, db: 1, Ma: 1 }); + function gV() { + this.hoa = this.rqa = null; + } + gV.prototype = new u7(); + gV.prototype.constructor = gV; + gV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "union"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.rqa.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + hV(new iV(), ih(new jh(), v10, new P6().a()), Q5().Na).Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + function eNa(a10, b10) { + var c10 = new gV(); + c10.rqa = a10; + c10.hoa = b10; + return c10; + } + gV.prototype.La = function() { + return this.hoa; + }; + gV.prototype.$classData = r8({ qFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.NodeMappingEmitter$$anon$5", { qFa: 1, f: 1, db: 1, Ma: 1 }); + function jV() { + this.goa = this.qqa = null; + } + jV.prototype = new u7(); + jV.prototype.constructor = jV; + jV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "range"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.qqa.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + hV(new iV(), ih(new jh(), v10, new P6().a()), Q5().Na).Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + function fNa(a10, b10) { + var c10 = new jV(); + c10.qqa = a10; + c10.goa = b10; + return c10; + } + jV.prototype.La = function() { + return this.goa; + }; + jV.prototype.$classData = r8({ uFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.PropertyMappingEmitter$$anon$4", { uFa: 1, f: 1, db: 1, Ma: 1 }); + function kV() { + this.l = null; + } + kV.prototype = new u7(); + kV.prototype.constructor = kV; + kV.prototype.Qa = function(a10) { + var b10 = B6(this.l.pb.g, Bq().ae).A; + cx(new dx(), "usage", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + kV.prototype.La = function() { + var a10 = Ab(hd(this.l.pb.g, Gc().ae).c().r.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + kV.prototype.$classData = r8({ xFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.RamlDialectLibraryEmitter$$anon$11", { xFa: 1, f: 1, db: 1, Ma: 1 }); + function lV() { + this.gea = null; + } + lV.prototype = new u7(); + lV.prototype.constructor = lV; + function gNa(a10) { + var b10 = new lV(); + b10.gea = a10; + return b10; + } + lV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "declares"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + jr(wr(), this.gea, g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + lV.prototype.La = function() { + return this.gea.ga().Fg; + }; + lV.prototype.$classData = r8({ CFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.RootDocumentModelEmitter$$anon$3", { CFa: 1, f: 1, db: 1, Ma: 1 }); + function mV() { + this.zba = this.HL = null; + } + mV.prototype = new u7(); + mV.prototype.constructor = mV; + function yba(a10, b10) { + var c10 = new mV(); + c10.HL = a10; + c10.zba = b10; + return c10; + } + mV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "$external"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.HL, l10 = cd(this.zba), m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return bNa(v10, t10.HL); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + mV.prototype.La = function() { + var a10 = cd(this.zba), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.c(); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + mV.prototype.$classData = r8({ EFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectEmitterHelper$$anon$1", { EFa: 1, f: 1, db: 1, Ma: 1 }); + function nV() { + this.vH = null; + } + nV.prototype = new u7(); + nV.prototype.constructor = nV; + nV.prototype.Ob = function(a10) { + if (wh(this.vH.x, q5(hNa))) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + T6(); + var e10 = mh(T6(), "$include"); + T6(); + var f10 = iNa(this.vH); + f10 = mh(T6(), f10); + sr(c10, e10, f10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + } else + wh(this.vH.x, q5(jNa)) ? (b10 = a10.s, a10 = a10.ca, c10 = new rr().e(a10), T6(), e10 = mh(T6(), "$ref"), T6(), f10 = B6(this.vH.g, db().ed).A, f10 = f10.b() ? Za(this.vH).c().j : f10.c(), f10 = mh(T6(), f10), sr(c10, e10, f10), pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa))) : (b10 = iua(T6(), iNa(this.vH)), pr(a10.s, b10)); + }; + function kNa(a10) { + var b10 = new nV(); + b10.vH = a10; + return b10; + } + nV.prototype.La = function() { + var a10 = Ab(this.vH.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + nV.prototype.$classData = r8({ JFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anon$2", { JFa: 1, f: 1, wh: 1, Ma: 1 }); + function oV() { + this.Uja = this.ska = this.poa = this.l = this.ws = this.vna = null; + this.qma = false; + this.nqa = this.Wia = this.G1 = null; + } + oV.prototype = new u7(); + oV.prototype.constructor = oV; + function lNa(a10, b10, c10) { + T6(); + var e10 = a10.G1, f10 = mh(T6(), e10); + e10 = new PA().e(b10.ca); + var g10 = e10.s, h10 = e10.ca, k10 = new PA().e(h10), l10 = a10.l.p; + c10 = pd(c10); + l10.zb(kz(c10)).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(a10, k10))); + T6(); + eE(); + a10 = SA(zs(), h10); + a10 = mr(0, new Sx().Ac(a10, k10.s), Q5().cd); + pr(g10, a10); + g10 = e10.s; + f10 = [f10]; + if (0 > g10.w) + throw new U6().e("0"); + k10 = f10.length | 0; + a10 = g10.w + k10 | 0; + uD(g10, a10); + Ba(g10.L, 0, g10.L, k10, g10.w); + k10 = g10.L; + l10 = k10.n.length; + h10 = c10 = 0; + var m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = k10.n.length; + for (l10 = l10 < m10 ? l10 : m10; c10 < l10; ) + k10.n[h10] = f10[c10], c10 = 1 + c10 | 0, h10 = 1 + h10 | 0; + g10.w = a10; + pr(b10.s, vD(wD(), e10.s)); + } + oV.prototype.Qa = function(a10) { + var b10 = this.ska.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(c10) { + return function(e10, f10) { + if (null !== f10) { + var g10 = c10.vna.Fb(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + var Y10 = vO(I10).ba, ia = /* @__PURE__ */ function() { + return function(zb) { + return ic(zb); + }; + }(C10), pa = ii().u; + if (pa === ii().u) + if (Y10 === H10()) + ia = H10(); + else { + pa = Y10.ga(); + var La = pa = ji(ia(pa), H10()); + for (Y10 = Y10.ta(); Y10 !== H10(); ) { + var ob = Y10.ga(); + ob = ji(ia(ob), H10()); + La = La.Nf = ob; + Y10 = Y10.ta(); + } + ia = pa; + } + else { + for (pa = se4(Y10, pa); !Y10.b(); ) + La = Y10.ga(), pa.jd(ia(La)), Y10 = Y10.ta(); + ia = pa.Rc(); + } + L10 = B6(L10.g, wj().Ut).A; + L10 = L10.b() ? null : L10.c(); + return Cg(ia, L10); + }; + }(c10, f10))); + if (g10 instanceof z7) { + g10 = g10.i; + var h10 = c10.l.gh, k10 = c10.l.pb, l10 = c10.l.p, m10 = c10.l.Xb, p10 = mNa(c10.Uja, f10), t10 = c10.ws, v10 = c10.l.kp, A10 = y7(), D10 = H10(); + return e10.cc(new R6().M(nNa(f10, g10, h10, k10, l10, m10, t10, false, A10, p10, false, D10, v10), f10)); + } + } + return e10; + }; + }(this))); + this.ws.na() ? oNa(this, a10, b10) : this.qma ? lNa(this, a10, b10) : pNa(this, a10, b10); + }; + function oNa(a10, b10, c10) { + T6(); + var e10 = a10.G1, f10 = mh(T6(), e10); + e10 = new PA().e(b10.ca); + var g10 = e10.s, h10 = e10.ca, k10 = new rr().e(h10), l10 = a10.l.p, m10 = pd(c10); + l10.zb(kz(m10)).U(w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + var D10 = t10.P(A10); + a: { + for (var C10 = vO(D10).g; !C10.b(); ) { + var I10 = ic(C10.ga().r), L10 = B6(p10.poa.g, $d().nr).A; + if (I10 === (L10.b() ? null : L10.c())) { + C10 = new z7().d(C10.ga()); + break a; + } + C10 = C10.ta(); + } + C10 = y7(); + } + C10 = C10.c(); + D10 = Ti(D10.g, C10).r.t(); + ky(D10, A10, Q5().Na, ld()).Qa(v10); + }; + }(a10, c10, k10))); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + a10 = e10.s; + c10 = [f10]; + if (0 > a10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = a10.w + g10 | 0; + uD(a10, f10); + Ba( + a10.L, + 0, + a10.L, + g10, + a10.w + ); + g10 = a10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + a10.w = f10; + pr(b10.s, vD(wD(), e10.s)); + } + function pNa(a10, b10, c10) { + c10 = pd(c10); + c10 = Wt(c10); + c10.b() || (c10 = c10.c(), ky(a10.G1, c10, Q5().Na, ld()).Qa(b10)); + } + oV.prototype.La = function() { + var a10 = this.Wia; + a10 = a10.b() ? y7() : Ab(a10.c(), q5(jd)); + a10 = a10.b() ? Ab(this.nqa.fa(), q5(jd)) : a10; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + function qNa(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new oV(); + if (null === a10) + throw mb(E6(), null); + l10.l = a10; + l10.poa = b10; + l10.ska = c10; + l10.Uja = e10; + l10.qma = f10; + l10.G1 = g10; + l10.Wia = h10; + l10.nqa = k10; + a10 = B6(b10.g, Ae4().bh); + c10 = w6(/* @__PURE__ */ function(m10) { + return function(p10) { + p10 = p10.A; + return rNa(m10.l, p10.b() ? null : p10.c()); + }; + }(l10)); + e10 = K7(); + l10.vna = a10.bd(c10, e10.u); + l10.ws = B6(b10.g, $d().nr).A; + return l10; + } + oV.prototype.$classData = r8({ KFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anon$3", { KFa: 1, f: 1, db: 1, Ma: 1 }); + function pV() { + this.Xia = this.Rqa = this.Sma = this.j9 = this.Qma = null; + } + pV.prototype = new u7(); + pV.prototype.constructor = pV; + pV.prototype.Qa = function(a10) { + T6(); + var b10 = this.Qma, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.j9.wb, k10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = Ab(p10.fa(), q5(jd)); + p10.b() ? p10 = y7() : (p10 = p10.c(), p10 = new z7().d(p10.yc.$d)); + return p10.b() ? ld() : p10.c(); + }; + }(this)); + TC(); + var l10 = Gb().si; + h10.ei(k10, UC(l10)).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + if (v10 instanceof uO) { + a: { + for (var A10 = vO(v10).g; !A10.b(); ) { + if (ic(A10.ga().r) === p10.Sma) { + var D10 = new z7().d(A10.ga()); + break a; + } + A10 = A10.ta(); + } + D10 = y7(); + } + a: { + for (A10 = vO(v10).g; !A10.b(); ) { + if (ic(A10.ga().r) === p10.Rqa) { + A10 = new z7().d(A10.ga()); + break a; + } + A10 = A10.ta(); + } + A10 = y7(); + } + if (D10.na() && A10.na()) { + var C10 = v10.g; + D10 = D10.c(); + D10 = C10.vb.Ja(D10); + D10.b() ? D10 = y7() : (D10 = D10.c(), D10 = new z7().d(D10.r)); + v10 = v10.g; + A10 = A10.c(); + v10 = v10.vb.Ja(A10); + v10.b() ? v10 = y7() : (v10 = v10.c(), v10 = new z7().d(v10.r)); + a: { + if (D10 instanceof z7 && (A10 = D10.i, A10 instanceof jh && v10 instanceof z7 && (v10 = v10.i, v10 instanceof jh))) { + cx(new dx(), ka(A10.r), ka(v10.r), Q5().Na, ld()).Qa(t10); + break a; + } + throw mb(E6(), new nb().e("Cannot generate object pair without scalar values for key and value")); + } + } else + throw mb(E6(), new nb().e("Cannot generate object pair with undefined key or value")); + } + }; + }(this, g10))); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + function sNa(a10, b10, c10, e10, f10) { + var g10 = new pV(); + g10.Qma = a10; + g10.j9 = b10; + g10.Sma = c10; + g10.Rqa = e10; + g10.Xia = f10; + return g10; + } + pV.prototype.La = function() { + var a10 = this.Xia; + a10 = a10.b() ? y7() : Ab(a10.c(), q5(jd)); + a10 = a10.b() ? Ab(this.j9.x, q5(jd)) : a10; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + pV.prototype.$classData = r8({ LFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anon$4", { LFa: 1, f: 1, db: 1, Ma: 1 }); + function qV() { + this.l = null; + } + qV.prototype = new u7(); + qV.prototype.constructor = qV; + qV.prototype.Qa = function(a10) { + if (1 === B6(this.l.dt.g, fO().fz).Oa()) { + T6(); + var b10 = mh(T6(), "extends"); + T6(); + var c10 = B6(this.l.dt.g, fO().fz).ga().A; + c10 = c10.b() ? null : c10.c(); + c10 = od(c10, this.l.Dp); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + } else { + T6(); + var e10 = mh(T6(), "extends"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var f10 = b10.ca, g10 = new PA().e(f10); + B6(this.l.dt.g, fO().fz).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.A; + v10 = v10.b() ? null : v10.c(); + t10.fo(od(v10, p10.l.Dp)); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(c10, g10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + f10 = e10.length | 0; + g10 = c10.w + f10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + qV.prototype.eaa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + qV.prototype.La = function() { + var a10 = Ab(mt(this.l.dt.g, fO().fz).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + qV.prototype.$classData = r8({ UFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.ClassTermEmitter$$anon$1", { UFa: 1, f: 1, db: 1, Ma: 1 }); + function rV() { + this.l = null; + } + rV.prototype = new u7(); + rV.prototype.constructor = rV; + rV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "properties"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + B6(this.l.dt.g, fO().kh).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.A; + v10 = v10.b() ? null : v10.c(); + t10.fo(od(v10, p10.l.Dp)); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr( + a10.s, + vD(wD(), c10.s) + ); + }; + rV.prototype.eaa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + rV.prototype.La = function() { + var a10 = Ab(mt(this.l.dt.g, fO().fz).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + rV.prototype.$classData = r8({ VFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.ClassTermEmitter$$anon$2", { VFa: 1, f: 1, db: 1, Ma: 1 }); + function sV() { + this.l = null; + } + sV.prototype = new u7(); + sV.prototype.constructor = sV; + sV.prototype.faa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + sV.prototype.Qa = function(a10) { + if (1 === B6(this.l.pt.Y(), eO().eB).jb()) { + T6(); + var b10 = mh(T6(), "extends"); + T6(); + var c10 = B6(this.l.pt.Y(), eO().eB).ga().A; + c10 = c10.b() ? null : c10.c(); + c10 = od(c10, this.l.Dp); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + } else { + T6(); + var e10 = mh(T6(), "extends"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var f10 = b10.ca, g10 = new PA().e(f10); + B6(this.l.pt.Y(), eO().eB).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.A; + v10 = v10.b() ? null : v10.c(); + t10.fo(od(v10, p10.l.Dp)); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(c10, g10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + f10 = e10.length | 0; + g10 = c10.w + f10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + sV.prototype.La = function() { + var a10 = Ab(mt(this.l.pt.Y(), eO().eB).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + sV.prototype.$classData = r8({ YFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.PropertyTermEmitter$$anon$3", { YFa: 1, f: 1, db: 1, Ma: 1 }); + function tV() { + this.l = null; + } + tV.prototype = new u7(); + tV.prototype.constructor = tV; + tV.prototype.faa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + tV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "range"); + T6(); + var c10 = B6(this.l.pt.Y(), eO().Vf).A; + c10 = c10.b() ? null : c10.c(); + c10 = od(c10, this.l.Dp); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + }; + tV.prototype.La = function() { + var a10 = Ab(mt(this.l.pt.Y(), eO().Vf).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + tV.prototype.$classData = r8({ ZFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.PropertyTermEmitter$$anon$4", { ZFa: 1, f: 1, db: 1, Ma: 1 }); + function uV() { + this.v9 = this.Zba = this.l = null; + } + uV.prototype = new u7(); + uV.prototype.constructor = uV; + uV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "classTerms"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.Zba, l10 = this.v9, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.Zba, D10 = t10.l.Dp, C10 = new vV(); + C10.dt = v10; + C10.p = A10; + C10.Dp = D10; + return C10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + uV.prototype.haa = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.Zba = b10; + this.v9 = c10; + return this; + }; + uV.prototype.La = function() { + var a10 = this.v9, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Fb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + a10 = a10.b() ? y7() : a10.c(); + return a10.b() ? ld() : a10.c(); + }; + uV.prototype.$classData = r8({ aGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$10", { aGa: 1, f: 1, db: 1, Ma: 1 }); + function wV() { + this.Sca = this.$ba = this.l = null; + } + wV.prototype = new u7(); + wV.prototype.constructor = wV; + wV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "propertyTerms"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.$ba, l10 = this.Sca, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.$ba, D10 = t10.l.Dp, C10 = new xV(); + C10.pt = v10; + C10.p = A10; + C10.Dp = D10; + return C10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + wV.prototype.haa = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.$ba = b10; + this.Sca = c10; + return this; + }; + wV.prototype.La = function() { + var a10 = this.Sca, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.fa(), q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Fb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + a10 = a10.b() ? y7() : a10.c(); + return a10.b() ? ld() : a10.c(); + }; + wV.prototype.$classData = r8({ bGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$11", { bGa: 1, f: 1, db: 1, Ma: 1 }); + function yV() { + this.IL = this.l = null; + } + yV.prototype = new u7(); + yV.prototype.constructor = yV; + yV.prototype.gaa = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.IL = b10; + return this; + }; + yV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "external"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.IL, l10 = cd(this.l.ff), m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return bNa(v10, t10.IL); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + yV.prototype.La = function() { + var a10 = cd(this.l.ff), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.c(); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + yV.prototype.$classData = r8({ cGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$5", { cGa: 1, f: 1, db: 1, Ma: 1 }); + function zV() { + this.Yba = this.l = null; + } + zV.prototype = new u7(); + zV.prototype.constructor = zV; + zV.prototype.gaa = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.Yba = b10; + return this; + }; + zV.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "uses"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.Yba, l10 = B6(this.l.ff.g, bd().$C), m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.l.ff, D10 = t10.Yba, C10 = new AV(); + C10.zM = v10; + C10.ff = A10; + C10.p = D10; + return C10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + zV.prototype.La = function() { + var a10 = B6(this.l.ff.g, bd().$C), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.na(); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.c(); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + zV.prototype.$classData = r8({ dGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$6", { dGa: 1, f: 1, db: 1, Ma: 1 }); + function BV() { + this.l = null; + } + BV.prototype = new u7(); + BV.prototype.constructor = BV; + BV.prototype.Qa = function(a10) { + var b10 = B6(this.l.ff.g, bd().Kh).A; + cx(new dx(), "base", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + BV.prototype.iU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + BV.prototype.La = function() { + return ld(); + }; + BV.prototype.$classData = r8({ eGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$7", { eGa: 1, f: 1, db: 1, Ma: 1 }); + function CV() { + this.l = null; + } + CV.prototype = new u7(); + CV.prototype.constructor = CV; + CV.prototype.Qa = function(a10) { + var b10 = B6(this.l.ff.g, bd().R).A; + cx(new dx(), "vocabulary", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + CV.prototype.iU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + CV.prototype.La = function() { + var a10 = Ab(mt(this.l.ff.g, bd().R).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + CV.prototype.$classData = r8({ fGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$8", { fGa: 1, f: 1, db: 1, Ma: 1 }); + function DV() { + this.l = null; + } + DV.prototype = new u7(); + DV.prototype.constructor = DV; + DV.prototype.Qa = function(a10) { + var b10 = B6(this.l.ff.g, Bq().ae).A; + cx(new dx(), "usage", b10.b() ? null : b10.c(), Q5().Na, ld()).Qa(a10); + }; + DV.prototype.iU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + DV.prototype.La = function() { + var a10 = Ab(mt(this.l.ff.g, bd().ae).fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + DV.prototype.$classData = r8({ gGa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter$$anon$9", { gGa: 1, f: 1, db: 1, Ma: 1 }); + function EV() { + } + EV.prototype = new u7(); + EV.prototype.constructor = EV; + EV.prototype.a = function() { + return this; + }; + function FV(a10, b10) { + a10 = Od(O7(), b10); + return new uO().K(new S6().a(), a10); + } + EV.prototype.$classData = r8({ RGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$", { RGa: 1, f: 1, q: 1, o: 1 }); + var tNa = void 0; + function GV() { + tNa || (tNa = new EV().a()); + return tNa; + } + function HV() { + } + HV.prototype = new u7(); + HV.prototype.constructor = HV; + HV.prototype.a = function() { + return this; + }; + function uNa(a10, b10) { + a10 = Od(O7(), b10); + return new IV().K(new S6().a(), a10); + } + HV.prototype.$classData = r8({ ZGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DocumentMapping$", { ZGa: 1, f: 1, q: 1, o: 1 }); + var vNa = void 0; + function wNa() { + vNa || (vNa = new HV().a()); + return vNa; + } + function JV() { + } + JV.prototype = new u7(); + JV.prototype.constructor = JV; + JV.prototype.a = function() { + return this; + }; + function KV(a10, b10) { + a10 = Od(O7(), b10); + return new Cd().K(new S6().a(), a10); + } + JV.prototype.$classData = r8({ fHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.NodeMapping$", { fHa: 1, f: 1, q: 1, o: 1 }); + var xNa = void 0; + function LV() { + xNa || (xNa = new JV().a()); + return xNa; + } + function yNa(a10, b10) { + var c10 = Ae4().qD, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + return h10 + "->" + g10; + } + throw new x7().d(g10); + }; + }(a10)), f10 = Id().u; + b10 = Jd(b10, e10, f10).Kg(","); + eb(a10, c10, b10); + } + function dV(a10) { + a10 = Vb().Ia(ar(a10.Y(), Ae4().qD)); + if (a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + a10 = Mc(ua(), a10, ","); + var b10 = Rb(Gb().ab, H10()), c10 = a10.n.length, e10 = 0, f10 = b10; + a: + for (; ; ) { + if (e10 !== c10) { + b10 = 1 + e10 | 0; + e10 = a10.n[e10]; + e10 = Mc(ua(), e10, "->"); + f10 = f10.cc(new R6().M(e10.n[1], e10.n[0])); + e10 = b10; + continue a; + } + break; + } + a10 = new z7().d(f10); + } + return a10.b() ? null : a10.c(); + } + function MV() { + } + MV.prototype = new u7(); + MV.prototype.constructor = MV; + MV.prototype.a = function() { + return this; + }; + function zNa(a10, b10) { + a10 = Od(O7(), b10); + return new rO().K(new S6().a(), a10); + } + MV.prototype.$classData = r8({ oHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.PropertyMapping$", { oHa: 1, f: 1, q: 1, o: 1 }); + var ANa = void 0; + function BNa() { + ANa || (ANa = new MV().a()); + return ANa; + } + function NV() { + } + NV.prototype = new u7(); + NV.prototype.constructor = NV; + NV.prototype.a = function() { + return this; + }; + function CNa(a10, b10) { + a10 = Od(O7(), b10); + return new OV().K(new S6().a(), a10); + } + NV.prototype.$classData = r8({ rHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.PublicNodeMapping$", { rHa: 1, f: 1, q: 1, o: 1 }); + var DNa = void 0; + function ENa() { + DNa || (DNa = new NV().a()); + return DNa; + } + function PV() { + } + PV.prototype = new u7(); + PV.prototype.constructor = PV; + PV.prototype.a = function() { + return this; + }; + function FNa(a10, b10) { + a10 = Od(O7(), b10); + return new ze2().K(new S6().a(), a10); + } + PV.prototype.$classData = r8({ tHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.UnionNodeMapping$", { tHa: 1, f: 1, q: 1, o: 1 }); + var GNa = void 0; + function HNa() { + GNa || (GNa = new PV().a()); + return GNa; + } + function QV() { + hO.call(this); + this.ku = this.iu = this.GL = null; + } + QV.prototype = new yDa(); + QV.prototype.constructor = QV; + QV.prototype.G$ = function(a10) { + return INa(this, a10); + }; + function JNa(a10, b10) { + var c10 = a10.GL, e10 = B6(b10.Y(), b10.R).A; + e10 = e10.b() ? null : e10.c(); + a10.GL = c10.cc(new R6().M(e10, b10)); + b10.Ie || (c10 = a10.ku, e10 = B6(b10.Y(), b10.R).A, e10 = e10.b() ? null : e10.c(), Eb(c10, e10, b10)); + return a10; + } + function RV(a10, b10, c10) { + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.GL; + }; + }(a10)), c10); + b10 = new KNa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + function LNa(a10, b10) { + var c10 = Xs(); + c10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.mG; + }; + }(a10)), c10); + if (c10 instanceof z7 && (c10 = c10.i, c10 instanceof gO)) + return new z7().d(c10); + a10 = Iba(a10, b10); + if (a10.b()) + return y7(); + a10 = a10.c(); + O7(); + b10 = new P6().a(); + b10 = new gO().K(new S6().a(), b10); + return new z7().d(Rd(b10, a10)); + } + QV.prototype.et = function() { + return new Fc().Vd(this.GL).Sb.Ye().Dd(); + }; + function INa(a10, b10) { + var c10 = a10.xi.Ja(b10); + if (c10 instanceof z7 && (c10 = c10.i, c10 instanceof QV)) + return c10; + c10 = a10.iu; + var e10 = new Mq().a(), f10 = Rb(Gb().ab, H10()); + c10 = new QV().FU(f10, c10, e10); + a10.xi = a10.xi.cc(new R6().M(b10, c10)); + return c10; + } + QV.prototype.FU = function(a10, b10, c10) { + this.GL = a10; + this.iu = b10; + this.ku = c10; + hO.prototype.v1.call(this, Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), b10, c10); + return this; + }; + function MNa(a10, b10) { + var c10 = Xs(); + c10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.IH; + }; + }(a10)), c10); + if (c10 instanceof z7 && (c10 = c10.i, c10 instanceof SV)) + return new z7().d(c10); + a10 = Iba(a10, b10); + if (a10.b()) + return y7(); + a10 = a10.c(); + O7(); + b10 = new P6().a(); + b10 = new cO().K(new S6().a(), b10); + return new z7().d(Rd(b10, a10)); + } + QV.prototype.$classData = r8({ BHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectDeclarations", { BHa: 1, f7: 1, hN: 1, f: 1 }); + function TV() { + this.pb = this.X = this.m = this.kf = null; + } + TV.prototype = new u7(); + TV.prototype.constructor = TV; + function NNa(a10, b10, c10, e10) { + var f10 = new qg().e("(\\{[^}]+\\})"), g10 = H10(); + for (b10 = ai(new rg().vi(f10.ja, g10), b10); b10.Ya(); ) + if (f10 = b10.Tw().split("{").join("").split("}").join(""), g10 = e10.Fb(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + t10 = B6(t10.g, $d().R).A; + return (t10.b() ? null : t10.c()) === p10; + }; + }(a10, f10))), g10 instanceof z7) { + var h10 = g10.i; + g10 = B6(h10.g, $d().ji).A; + if (1 !== ((g10.b() ? 0 : g10.c()) | 0)) { + g10 = a10.m; + var k10 = Wd().Cf; + h10 = h10.j; + f10 = "PropertyMapping for idTemplate variable '" + f10 + "' must be mandatory"; + var l10 = y7(); + ec(g10, k10, h10, l10, f10, c10.da); + } + } else if (y7() === g10) + g10 = a10.m, k10 = Wd().Cf, f10 = "Missing propertyMapping for idTemplate variable '" + f10 + "'", h10 = y7(), ec(g10, k10, "", h10, f10, c10.da); + else + throw new x7().d(g10); + } + function ONa(a10, b10) { + var c10 = B6(b10.Y(), Ae4().bh), e10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.A; + l10 = l10.b() ? null : l10.c(); + var m10 = F6().$c; + if (l10 === ic(G5(m10, "anyNode"))) + return k10 = k10.A, new z7().d(k10.b() ? null : k10.c()); + l10 = false; + m10 = null; + var p10 = k10.A; + p10 = RV(g10.m.rd, p10.b() ? null : p10.c(), Xs()); + if (p10 instanceof z7 && (l10 = true, m10 = p10, p10 = m10.i, p10 instanceof Cd && h10 instanceof rO)) + return PNa(g10, h10, p10), QNa(g10, h10, p10), new z7().d(p10.j); + if (l10) + return new z7().d(m10.i.j); + m10 = k10.A; + l10 = g10.m; + m10 = m10.b() ? null : m10.c(); + m10 = wha(xha(), m10); + m10.Zaa ? (l10 = l10.$V.Ja(m10.FP), l10 = l10 instanceof z7 ? new z7().d(l10.i.j + "#/declarations/" + m10.$) : y7()) : l10 = y7(); + if (l10 instanceof z7) + return new z7().d(l10.i); + l10 = g10.m; + k10 = k10.A; + k10 = k10.b() ? null : k10.c(); + m10 = h10.j; + p10 = hd(h10.Y(), $d().bh); + p10.b() ? p10 = y7() : (p10 = p10.c(), p10 = new z7().d(p10.r.x)); + p10 = p10.b() ? h10.fa() : p10.c(); + Qba(l10, k10, m10, p10); + return y7(); + }; + }(a10, b10)), f10 = K7(); + c10 = c10.ka(e10, f10.u); + e10 = new RNa(); + f10 = K7(); + c10 = c10.ec(e10, f10.u); + c10.Da() && (e10 = Ae4().bh, Wr(b10, e10, c10)); + c10 = Vb().Ia(dV(b10)); + c10 instanceof z7 && (c10 = c10.i, e10 = Rb(Gb().ab, H10()), a10 = Tc(c10, e10, Uc(/* @__PURE__ */ function(g10, h10) { + return function(k10, l10) { + l10 = new R6().M(k10, l10); + k10 = l10.Tp; + var m10 = l10.hr; + if (null !== m10) { + l10 = m10.ma(); + m10 = m10.ya(); + var p10 = RV(g10.m.rd, l10, Xs()); + if (p10 instanceof z7) + return k10.Wh( + p10.i.j, + m10 + ); + m10 = g10.m; + p10 = h10.j; + var t10 = hd(h10.Y(), $d().qD); + t10.b() ? t10 = y7() : (t10 = t10.c(), t10 = new z7().d(t10.r.x)); + t10 = t10.b() ? h10.fa() : t10.c(); + Qba(m10, l10, p10, t10); + return k10; + } + throw new x7().d(l10); + }; + }(a10, b10))), yNa(b10, a10)); + } + function SNa(a10, b10, c10) { + a10.kf = b10; + a10.m = c10; + var e10 = b10.$g.Xd, f10 = qc(); + a10.X = N6(e10, f10, c10); + c10 = Od(O7(), a10.X); + c10 = new zO().K(new S6().a(), c10); + e10 = b10.da; + f10 = Bq().uc; + c10 = eb(c10, f10, e10); + a10.pb = Rd(c10, b10.da); + return a10; + } + function TNa(a10) { + var b10 = ac(new M6().W(a10.X), "usage"); + if (!b10.b()) { + var c10 = b10.c(), e10 = new aO().Vb(c10.i, a10.m); + b10 = a10.pb; + var f10 = Gc().ae; + e10 = e10.nf(); + c10 = Od(O7(), c10); + Rg(b10, f10, e10, c10); + } + pe4(a10.m, "library", a10.pb.j, a10.X); + b10 = UNa(a10.pb, a10.X, a10.kf.Q, a10.m); + f10 = Lc(a10.pb); + b10 = VNa(b10, f10.b() ? a10.pb.j : f10.c()); + tc(a10.m.rd.Vn) && (f10 = a10.pb, c10 = new Fc().Vd(a10.m.rd.Vn).Sb.Ye().Dd(), e10 = Bd().vh, Zd(f10, e10, c10)); + a10.rA(a10.kf, a10.X); + f10 = a10.m.rd.et(); + f10.U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (h10 instanceof ze2) + ONa(g10, h10); + else if (h10 instanceof Cd) + B6(h10.g, wj().ej).U(w6(/* @__PURE__ */ function(k10) { + return function(l10) { + ONa(k10, l10); + }; + }(g10))); + else + throw new x7().d(h10); + }; + }(a10))); + f10.Da() && (c10 = a10.pb, e10 = Af().Ic, Bf(c10, e10, f10)); + b10.ow().Da() && (f10 = a10.pb, b10 = b10.ow(), c10 = Gk().xc, Bf(f10, c10, b10)); + B6(a10.pb.g, Gc().Ic).U(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (h10 instanceof Cd && !h10.Ie) { + var k10 = g10.m.ni, l10 = B6(h10.g, h10.R).A; + l10 = l10.b() ? null : l10.c(); + Eb(k10, l10, h10); + } + }; + }(a10))); + Fb(a10.m.ni); + return WNa(a10.pb); + } + d7 = TV.prototype; + d7.lca = function() { + var a10 = ac(new M6().W(this.X), "dialect"); + if (!a10.b()) { + var b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m); + a10 = this.pb; + var e10 = Gc().R; + c10 = c10.nf(); + b10 = Od(O7(), b10); + Rg(a10, e10, c10, b10); + } + a10 = ac(new M6().W(this.X), "usage"); + a10.b() || (b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m), a10 = this.pb, e10 = Gc().ae, c10 = c10.nf(), b10 = Od(O7(), b10), Rg(a10, e10, c10, b10)); + a10 = ac(new M6().W(this.X), "version"); + a10.b() || (b10 = a10.c(), c10 = ka(new aO().Vb(b10.i, this.m).Zf().r), a10 = this.pb, e10 = Gc().Ym, c10 = ih(new jh(), c10, Od(O7(), b10.i)), b10 = Od(O7(), b10), Rg(a10, e10, c10, b10)); + pe4(this.m, "dialect", this.pb.j, this.X); + a10 = UNa( + this.pb, + this.X, + this.kf.Q, + this.m + ); + e10 = Lc(this.pb); + a10 = VNa(a10, e10.b() ? this.pb.j : e10.c()); + tc(this.m.rd.Vn) && (e10 = this.pb, b10 = new Fc().Vd(this.m.rd.Vn).Sb.Ye().Dd(), c10 = Bd().vh, Zd(e10, c10, b10)); + this.rA(this.kf, this.X); + e10 = this.m.rd.et(); + e10.U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (g10 instanceof ze2) + ONa(f10, g10); + else if (g10 instanceof Cd) + B6(g10.g, wj().ej).U(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + ONa(h10, k10); + }; + }(f10))); + else + throw new x7().d(g10); + }; + }(this))); + e10.Da() && (b10 = this.pb, c10 = Af().Ic, Bf(b10, c10, e10)); + a10.ow().Da() && (e10 = this.pb, a10 = a10.ow(), b10 = Gk().xc, Bf(e10, b10, a10)); + XNa(this, this.X, this.pb.j); + B6(this.pb.g, Gc().Ic).U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (g10 instanceof Cd && !g10.Ie) { + var h10 = f10.m.ni, k10 = B6(g10.g, g10.R).A; + k10 = k10.b() ? null : k10.c(); + Eb(h10, k10, g10); + } + }; + }(this))); + Fb(this.m.ni); + return this.pb; + }; + function YNa(a10, b10, c10) { + var e10 = qc(); + b10 = N6(b10, e10, a10.m); + b10 = ac(new M6().W(b10), "library"); + if (b10 instanceof z7 && (e10 = b10.i, null !== e10)) { + b10 = B6(a10.pb.g, Gc().R).A; + b10 = b10.b() ? null : b10.c(); + var f10 = B6(a10.pb.g, Gc().Ym).A; + b10 = b10 + " " + (f10.b() ? null : f10.c()) + " / Library"; + wNa(); + T6(); + f10 = a10.X; + T6(); + f10 = uNa(0, mr(T6(), f10, Q5().sa)); + var g10 = GO().vx; + b10 = eb(f10, g10, b10); + b10 = Rd(b10, c10 + "/modules"); + e10 = e10.i; + f10 = qc(); + e10 = N6(e10, f10, a10.m); + e10 = ac(new M6().W(e10), "declares"); + if (e10 instanceof z7) + return e10 = e10.i, f10 = e10.i, g10 = qc(), f10 = N6(f10, g10, a10.m).sb, a10 = w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = m10.i, t10 = bc(); + p10 = N6(p10, t10, h10.m).va; + t10 = m10.Aa; + var v10 = bc(); + t10 = N6(t10, v10, h10.m).va; + m10 = CNa(ENa(), m10); + v10 = UV().R; + m10 = eb(m10, v10, t10); + t10 = new je4().e(t10); + t10 = k10 + "/modules/" + jj(t10.td); + m10 = Rd(m10, t10); + t10 = RV(h10.m.rd, p10, Xs()); + if (t10 instanceof z7) + return p10 = t10.i.j, t10 = UV().$u, new z7().d(eb(m10, t10, p10)); + ke3(h10.m, p10, k10, l10); + return y7(); + }; + }(a10, c10, e10)), c10 = rw(), a10 = f10.ka(a10, c10.sc), c10 = new ZNa(), e10 = K7(), a10 = a10.ec(c10, e10.u), c10 = GO().Mt, new z7().d(Bf(b10, c10, a10)); + } + return y7(); + } + function $Na(a10, b10, c10) { + var e10 = b10.i.hb().gb; + if (Q5().Na === e10) + return e10 = Hc().Iy, a10 = new aO().Vb(b10.i, a10.m).nf(), b10 = Od(O7(), b10), Rg(c10, e10, a10, b10); + e10 = a10.m; + a10 = Wd().Cf; + c10 = c10.j; + var f10 = y7(); + ec(e10, a10, c10, f10, "'declarationsPath' Option for a documents mapping must be a String", b10.da); + } + function aOa(a10, b10, c10) { + var e10 = qc(); + b10 = N6(b10, e10, a10.m); + b10 = ac(new M6().W(b10), "fragments"); + return b10 instanceof z7 && (b10 = b10.i, null !== b10 && (b10 = b10.i, e10 = qc(), b10 = N6(b10, e10, a10.m), b10 = ac(new M6().W(b10), "encodes"), b10 instanceof z7 && (b10 = b10.i, null !== b10))) ? (b10 = b10.i, e10 = qc(), b10 = N6(b10, e10, a10.m).sb, c10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + l10 = N6(k10, l10, f10.m).va; + k10 = h10.i; + var m10 = bc(); + k10 = N6(k10, m10, f10.m).va; + m10 = uNa(wNa(), h10.i); + var p10 = GO().vx; + m10 = eb(m10, p10, l10); + l10 = new je4().e(l10); + l10 = g10 + "/fragments/" + jj(l10.td); + l10 = Rd(m10, l10); + m10 = RV(f10.m.rd, k10, Xs()); + if (m10 instanceof z7) + return h10 = m10.i.j, k10 = GO().Vs, new z7().d(eb( + l10, + k10, + h10 + )); + ke3(f10.m, k10, g10, h10); + return y7(); + }; + }(a10, c10)), e10 = rw(), c10 = b10.ka(c10, e10.sc).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.na(); + }; + }(a10))), a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.c(); + }; + }(a10)), b10 = rw(), new z7().d(c10.ka(a10, b10.sc))) : y7(); + } + function XNa(a10, b10, c10) { + O7(); + var e10 = new P6().a(); + e10 = new VV().K(new S6().a(), e10); + c10 = Rd(e10, c10 + "#/documents"); + b10 = ac(new M6().W(b10), "documents"); + if (!b10.b()) { + b10 = b10.c(); + e10 = a10.m; + var f10 = c10.j, g10 = b10.i, h10 = qc(); + g10 = N6(g10, h10, a10.m); + pe4(e10, "documentsMapping", f10, g10); + e10 = bOa(a10, b10.i, c10.j); + e10.b() || (e10 = e10.c(), f10 = Hc().De, Vd(c10, f10, e10)); + e10 = aOa(a10, b10.i, c10.j); + e10.b() || (e10 = e10.c(), f10 = Hc().My, new z7().d(Bf(c10, f10, e10))); + e10 = YNa(a10, b10.i, c10.j); + e10.b() || (e10 = e10.c(), f10 = Hc().Fx, Vd(c10, f10, e10)); + b10 = b10.i; + e10 = qc(); + b10 = N6(b10, e10, a10.m); + b10 = ac(new M6().W(b10), "options"); + b10 instanceof z7 && (g10 = b10.i, null !== g10 && (b10 = jc(kc(g10.i), qc()), b10 instanceof z7 ? (b10 = b10.i, pe4(a10.m, "documentsMappingOptions", c10.j, b10), e10 = ac(new M6().W(b10), "selfEncoded"), e10.b() || (e10 = e10.c(), new z7().d(cOa(a10, e10, c10))), e10 = ac(new M6().W(b10), "declarationsPath"), e10.b() || (e10 = e10.c(), new z7().d($Na(a10, e10, c10))), e10 = ac(new M6().W(b10), "keyProperty"), e10.b() || (e10 = e10.c(), new z7().d(dOa(a10, e10, c10))), b10 = ac(new M6().W(b10), "referenceStyle"), b10.b() ? y7() : (b10 = b10.c(), new z7().d(eOa(a10, b10, c10)))) : (b10 = a10.m, e10 = Wd().Cf, f10 = c10.j, g10 = g10.i, h10 = y7(), ec(b10, e10, f10, h10, "Options for a documents mapping must be a map", g10.da)))); + } + a10 = a10.pb; + b10 = Gc().Pj; + Vd(a10, b10, c10); + } + function fOa(a10, b10, c10) { + var e10 = ac(new M6().W(b10), "mapKey"), f10 = ac(new M6().W(b10), "mapTermKey"); + if (!e10.b() && (e10.c(), !f10.b())) { + f10.c(); + var g10 = a10.m, h10 = Wd().Cf, k10 = c10.j, l10 = y7(); + ec(g10, h10, k10, l10, "mapKey and mapTermKey are mutually exclusive", b10.da); + new z7().d(void 0); + } + f10.b() ? e10.b() || (b10 = e10.c(), a10 = new aO().Vb(b10.i, a10.m).nf().t(), b10 = $d().St, eb(c10, b10, a10)) : (b10 = f10.c(), e10 = new aO().Vb(b10.i, a10.m).nf().t(), a10 = gOa(a10, e10, c10.j, b10.i), a10.b() || (a10 = a10.c(), b10 = $d().nr, eb(c10, b10, a10))); + } + function WNa(a10) { + var b10 = a10.x; + b10 = new AO().K(new S6().a(), b10); + b10 = Rd(b10, a10.j); + var c10 = Lc(a10); + c10 = c10.b() ? a10.j : c10.c(); + var e10 = Bq().uc; + b10 = eb(b10, e10, c10); + c10 = B6(a10.g, Gc().xc); + e10 = Gk().xc; + b10 = Bf(b10, e10, c10); + c10 = B6(a10.g, Bq().ae).A; + c10.b() || (c10 = c10.c(), e10 = Bq().ae, eb(b10, e10, c10)); + c10 = B6(a10.g, Gc().Ic); + c10.Da() && (e10 = Af().Ic, Bf(b10, e10, c10)); + a10 = cd(a10); + a10.Da() && (c10 = Bd().vh, Zd(b10, c10, a10)); + return b10; + } + function hOa(a10) { + var b10 = a10.x; + b10 = new BO().K(new S6().a(), b10); + b10 = Rd(b10, a10.j); + var c10 = Lc(a10); + c10 = c10.b() ? a10.j : c10.c(); + var e10 = Bq().uc; + b10 = eb(b10, e10, c10); + c10 = B6(a10.g, Gc().xc); + e10 = Gk().xc; + b10 = Bf(b10, e10, c10); + c10 = B6(a10.g, Bq().ae).A; + c10.b() || (c10 = c10.c(), e10 = Bq().ae, eb(b10, e10, c10)); + cd(a10).Da() && (a10 = cd(a10), c10 = Bd().vh, Zd(b10, c10, a10)); + return b10; + } + function cOa(a10, b10, c10) { + var e10 = b10.i.hb().gb; + if (Q5().ti === e10) + return a10 = new aO().Vb(b10.i, a10.m).Up(), e10 = Hc().cz, b10 = Od(O7(), b10), Rg(c10, e10, a10, b10); + a10 = a10.m; + e10 = Wd().Cf; + c10 = c10.j; + var f10 = y7(); + ec(a10, e10, c10, f10, "'selfEncoded' Option for a documents mapping must be a boolean", b10.da); + } + function dOa(a10, b10, c10) { + var e10 = b10.i.hb().gb; + if (Q5().ti === e10) + return a10 = new aO().Vb(b10.i, a10.m).Up(), e10 = Hc().Py, b10 = Od(O7(), b10), Rg(c10, e10, a10, b10); + a10 = a10.m; + e10 = Wd().Cf; + c10 = c10.j; + var f10 = y7(); + ec(a10, e10, c10, f10, "'keyProperty' Option for a documents mapping must be a boolean", b10.da); + } + function iOa(a10, b10, c10) { + var e10 = ac(new M6().W(b10), "mapValue"), f10 = ac(new M6().W(b10), "mapTermValue"); + if (!e10.b() && (e10.c(), !f10.b())) { + f10.c(); + var g10 = a10.m, h10 = Wd().Cf, k10 = c10.j, l10 = y7(); + ec(g10, h10, k10, l10, "mapValue and mapTermValue are mutually exclusive", b10.da); + new z7().d(void 0); + } + f10.b() ? e10.b() || (b10 = e10.c(), a10 = new aO().Vb(b10.i, a10.m).nf().t(), b10 = $d().bw, eb(c10, b10, a10)) : (b10 = f10.c(), e10 = new aO().Vb(b10.i, a10.m).nf().t(), a10 = gOa(a10, e10, c10.j, b10.i), a10.b() || (a10 = a10.c(), b10 = $d().Hx, eb(c10, b10, a10))); + } + function PNa(a10, b10, c10) { + var e10 = B6(b10.g, $d().St).A; + if (!e10.b()) + if (e10 = e10.c(), c10 = B6(c10.g, wj().ej).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = B6(k10.g, $d().R).A; + return (k10.b() ? null : k10.c()) === h10; + }; + }(a10, e10))), c10 instanceof z7) { + c10 = c10.i; + var f10 = B6(c10.g, $d().Yh).A; + f10.b() ? (f10 = F6().Pg, f10 = ic(G5(f10, e10))) : f10 = f10.c(); + c10 = B6(c10.g, $d().nr).A; + c10 instanceof z7 && f10 !== c10.i ? (it2(b10.g, $d().nr), it2(b10.g, $d().St), a10 = a10.m, c10 = b10.j, f10 = ic($d().St.r), b10 = B6(b10.g, $d().St).x, Oba(a10, c10, f10, e10, b10)) : (e10 = $d().nr, eb(b10, e10, f10)); + } else + it2(b10.g, $d().St), a10 = a10.m, c10 = b10.j, f10 = ic($d().St.r), b10 = B6(b10.g, $d().St).x, Pba(a10, c10, f10, e10, b10); + } + function eOa(a10, b10, c10) { + var e10 = b10.i.hb().gb; + if (Q5().Na === e10) { + gka || (gka = new Aw().a()); + e10 = gka.ev; + var f10 = Kc(b10.i); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.va)); + e10 = e10.Ha(f10.b() ? "" : f10.c()); + } else + e10 = false; + if (e10) + return e10 = Hc().dS, a10 = new aO().Vb(b10.i, a10.m).nf(), b10 = Od(O7(), b10), Rg(c10, e10, a10, b10); + a10 = a10.m; + e10 = Wd().Cf; + c10 = c10.j; + f10 = y7(); + ec(a10, e10, c10, f10, "'referenceStyle' Option for a documents mapping must be a String [RamlStyle, JsonSchemaStyle]", b10.da); + } + d7.rA = function(a10, b10) { + jOa(this, b10, a10.da + "#/declarations"); + }; + function QNa(a10, b10, c10) { + var e10 = B6(b10.g, $d().bw).A; + if (!e10.b()) + if (e10 = e10.c(), c10 = B6(c10.g, wj().ej).Fb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = B6(l10.g, $d().R).A; + return (l10.b() ? null : l10.c()) === k10; + }; + }(a10, e10))), c10 instanceof z7) { + c10 = c10.i; + var f10 = B6(c10.g, $d().Yh).A; + f10.b() ? (f10 = F6().Pg, f10 = ic(G5(f10, e10))) : f10 = f10.c(); + var g10 = B6(c10.g, $d().Hx).A; + g10 instanceof z7 && f10 !== g10.i ? (it2(c10.g, $d().Hx), it2(b10.g, $d().bw), a10 = a10.m, c10 = b10.j, f10 = ic($d().bw.r), b10 = B6(b10.g, $d().bw).x, Oba(a10, c10, f10, e10, b10)) : (e10 = $d().Hx, eb(b10, e10, f10)); + } else + it2(b10.g, $d().bw), a10 = a10.m, c10 = b10.j, f10 = ic($d().bw.r), b10 = B6(b10.g, $d().bw).x, Pba( + a10, + c10, + f10, + e10, + b10 + ); + } + d7.Gp = function() { + return this.m; + }; + function jOa(a10, b10, c10) { + b10 = ac(new M6().W(b10), "nodeMappings"); + if (!b10.b()) { + var e10 = b10.c(), f10 = e10.i.hb().gb; + if (Q5().sa === f10) + b10 = e10.i, e10 = qc(), N6(b10, e10, a10.m).sb.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = false, p10 = null, t10 = /* @__PURE__ */ function(kd, Pi, sh) { + return function(Pg) { + if (Pg instanceof Cd) { + T6(); + var Xc = Pi.Aa, xe2 = kd.m, Nc = Dd(); + Xc = N6(Xc, Nc, xe2); + Pg = eb(Pg, Pg.R, Xc); + J5(K7(), H10()); + return Ai(Pg, sh); + } + if (Pg instanceof ze2) + return T6(), Xc = Pi.Aa, xe2 = kd.m, Nc = Dd(), Xc = N6(Xc, Nc, xe2), Pg = eb(Pg, Pg.R, Xc), J5(K7(), H10()), Ai(Pg, sh); + Pg = kd.m; + Xc = Wd().Cf; + xe2 = y7(); + ec( + Pg, + Xc, + sh, + xe2, + "Error only valid node mapping or union mapping can be declared", + Pi.da + ); + return y7(); + }; + }(h10, l10, k10), v10 = l10.i.hb().gb; + if (Q5().sa === v10) { + var A10 = l10.i, D10 = qc(), C10 = N6(A10, D10, h10.m); + if (ac(new M6().W(C10), "union").na()) { + var I10 = FNa(HNa(), C10); + t10(I10); + var L10 = ac(new M6().W(C10), "union"); + if (!L10.b()) { + var Y10 = L10.c(), ia = Y10.i.hb().gb; + if (Q5().cd === ia) + try { + var pa = Y10.i, La = Dd(), ob = rw().sc, zb = N6(pa, sw(ob, La), h10.m), Zb = Ae4().bh; + Wr(I10, Zb, zb); + } catch (kd) { + if (Ph(E6(), kd) instanceof nb) { + var Cc = h10.m, vc = Wd().Cf, id = I10.j, yd = Y10.i, zd = y7(); + ec(Cc, vc, id, zd, "Union node mappings must be declared as lists of node mapping references", yd.da); + } else + throw kd; + } + else { + var rd = h10.m, sd = Wd().Cf, le4 = I10.j, Vc = Y10.i, Sc = y7(); + ec(rd, sd, le4, Sc, "Union node mappings must be declared as lists of node mapping references", Vc.da); + } + } + var Qc = ac(new M6().W(C10), "typeDiscriminator"); + if (!Qc.b()) { + var $c = Qc.c().i, Wc = qc(), Qe = N6($c, Wc, h10.m).sb.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(kd) { + return function(Pi, sh) { + var Pg = sh.i, Xc = bc(); + Pg = N6(Pg, Xc, kd.m).va; + sh = sh.Aa; + Xc = bc(); + sh = N6(sh, Xc, kd.m).va; + return Pi.cc(new R6().M(sh, Pg)); + }; + }(h10))); + yNa(I10, Qe); + } + var Qd = ac(new M6().W(C10), "typeDiscriminatorName"); + if (!Qd.b()) { + var me4 = Qd.c(), of = new aO().Vb( + me4.i, + h10.m + ).nf().t(), Le2 = Ae4().Zt; + eb(I10, Le2, of); + } + var Ve = new z7().d(I10); + } else { + var he4 = KV(LV(), C10); + t10(he4); + pe4(h10.m, "nodeMapping", he4.j, C10); + var Wf = ac(new M6().W(C10), "classTerm"); + if (!Wf.b()) { + var vf = Wf.c(), He = new aO().Vb(vf.i, h10.m).nf().t(), Ff = LNa(h10.m.rd, He); + if (Ff instanceof z7) { + var wf = Ff.i.j, Re2 = wj().Ut; + eb(he4, Re2, wf); + } else { + var we4 = h10.m, ne4 = Wd().Cf, Me2 = he4.j, Se4 = "Cannot find class term with alias " + He, xf = vf.i, ie3 = y7(); + ec(we4, ne4, Me2, ie3, Se4, xf.da); + } + } + var gf = ac(new M6().W(C10), "patch"); + if (!gf.b()) { + var pf = gf.c(), hf = new aO().Vb(pf.i, h10.m).nf().t(); + if (wj().Ts.Ha(hf)) + jka( + he4, + hf + ); + else { + var Gf = h10.m, yf = Wd().Cf, oe4 = he4.j, lg = "Unsupported node mapping patch operation '" + hf + "'", bh = pf.i, Qh = y7(); + ec(Gf, yf, oe4, Qh, lg, bh.da); + } + } + var af = ac(new M6().W(C10), "mapping"); + if (!af.b()) { + var Pf = af.c().i, oh = qc(), ch = N6(Pf, oh, h10.m).sb, Ie2 = w6(/* @__PURE__ */ function(kd, Pi) { + return function(sh) { + var Pg = sh.i, Xc = qc(), xe2 = N6(Pg, Xc, kd.m), Nc = zNa(BNa(), xe2); + T6(); + var om = sh.Aa, Dn = kd.m, gi = Dd(), Te = N6(om, gi, Dn), pm = $d().R, jn = eb(Nc, pm, Te), Oq = Pi.j, En = sh.Aa, $n = bc(), Rp = N6(En, $n, kd.m).va, ao = new je4().e(Rp), Xt = Oq + "/property/" + jj(ao.td); + J5(K7(), H10()); + Ai( + jn, + Xt + ); + pe4(kd.m, "propertyMapping", Nc.j, xe2); + var Fs = ac(new M6().W(xe2), "propertyTerm"); + if (Fs instanceof z7) { + var Sp = Fs.i, bo = new aO().Vb(Sp.i, kd.m).nf().t(), Gs = MNa(kd.m.rd, bo); + if (Gs instanceof z7) { + var Fn = Gs.i.j, Pq = $d().Yh; + eb(Nc, Pq, Fn); + } else { + var Jr = kd.m, Hs = Wd().Cf, Is = Nc.j, Kr = "Cannot find property term with alias " + bo, Js = Sp.i, Ks = y7(); + ec(Jr, Hs, Is, Ks, Kr, Js.da); + } + } else { + var ov = F6().Pg, pv = sh.Aa, Ls = bc(), qv = N6(pv, Ls, kd.m).va, rv = new je4().e(qv), Yt = jj(rv.td), sv = ic(G5(ov, Yt)), Qq = $d().Yh; + eb(Nc, Qq, sv); + } + var tv = ac(new M6().W(xe2), "range"); + if (!tv.b()) { + var Ms = tv.c(), Zt = Ms.i.hb().gb; + if (Q5().cd === Zt) { + var uv = Ms.i, cp = Dd(), Ns = rw().sc, $t = N6(uv, sw(Ns, cp), kd.m), au = Ae4().bh; + Wr(Nc, au, $t); + } else { + var Qj = new aO().Vb(Ms.i, kd.m).nf().t(); + if ("guid" === Qj) { + var Jw = F6().Eb, dp = ic(G5(Jw, "guid")), bu = $d().Gf; + eb(Nc, bu, dp); + } else if ("string" === Qj || "integer" === Qj || "boolean" === Qj || "float" === Qj || "decimal" === Qj || "double" === Qj || "duration" === Qj || "dateTime" === Qj || "time" === Qj || "date" === Qj || "anyType" === Qj) { + var ui = F6().Bj, Os = ic(G5(ui, Qj)), Ps = $d().Gf; + eb(Nc, Ps, Os); + } else if ("anyUri" === Qj) { + var cu = Uh().zp, Qs = $d().Gf; + eb(Nc, Qs, cu); + } else if ("link" === Qj) { + var du = F6().Eb, vv = ic(G5(du, "link")), wv = $d().Gf; + eb(Nc, wv, vv); + } else if ("number" === Qj) { + var xv = Uh().Xo, py = $d().Gf; + eb(Nc, py, xv); + } else if ("uri" === Qj) { + var Rq = Uh().zp, Kw = $d().Gf; + eb(Nc, Kw, Rq); + } else if ("any" === Qj) { + var Lw = Uh().Yr, eu = $d().Gf; + eb(Nc, eu, Lw); + } else if ("anyNode" === Qj) { + var yv = K7(), qy = F6().$c, zv = J5(yv, new Ib().ha([ic(G5(qy, "anyNode"))])), Mw = Ae4().bh; + Wr(Nc, Mw, zv); + } else { + var ry = J5(K7(), new Ib().ha([Qj])), Tp = Ae4().bh; + Wr(Nc, Tp, ry); + } + } + } + fOa(kd, xe2, Nc); + iOa( + kd, + xe2, + Nc + ); + var Ss = ac(new M6().W(xe2), "patch"); + if (!Ss.b()) { + var Nw = Ss.c(), fu = new aO().Vb(Nw.i, kd.m).nf().t(); + if ($d().Ts.Ha(fu)) + jka(Nc, fu); + else { + var Ow = kd.m, Pw = Wd().Cf, Sq = Nc.j, gu = "Unsupported property mapping patch operation '" + fu + "'", Qw = Nw.i, Rw = y7(); + ec(Ow, Pw, Sq, Rw, gu, Qw.da); + } + } + var Sw = ac(new M6().W(xe2), "mandatory"); + if (!Sw.b()) { + var AA = Sw.c(), Up = aj(new aO().Vb(AA.i, kd.m).Up()) ? 1 : 0, kn = $d().ji; + es(Nc, kn, Up); + } + var Vp = ac(new M6().W(xe2), "pattern"); + if (!Vp.b()) { + var sy = Vp.c(), BA = new aO().Vb(sy.i, kd.m).nf().t(), GD = $d().zl; + eb( + Nc, + GD, + BA + ); + } + var Av = ac(new M6().W(xe2), "minimum"); + if (!Av.b()) { + var Tw = Av.c(), HD = Tw.i.hb().gb; + if (Q5().cj === HD) { + var ID = new aO().Vb(Tw.i, kd.m).mE().r | 0, CA = $d().wj; + Xr(Nc, CA, ID); + } else { + var DA = +kOa(new aO().Vb(Tw.i, kd.m)).r, JD = $d().wj; + Xr(Nc, JD, DA); + } + } + var KD = ac(new M6().W(xe2), "unique"); + if (!KD.b()) { + var EA = KD.c(), yG = EA.i.hb().gb; + if (Q5().ti === yG) { + var zG = aj(new aO().Vb(EA.i, kd.m).Up()), LD = $d().YF; + Bi(Nc, LD, zG); + } else { + var GA = kd.m, AG = Wd().Cf; + T6(); + var uy = EA.i, BG = kd.m, MD = Dd(), ND = N6(uy, MD, BG), OD = y7(), Us = y7(), vy = y7(); + GA.Gc( + AG.j, + "Unique property in a property mapping must be a boolean value", + OD, + ND, + Us, + Yb().qb, + vy + ); + } + } + var HA = ac(new M6().W(xe2), "maximum"); + if (!HA.b()) { + var IA = HA.c(), Vs = IA.i.hb().gb; + if (Q5().cj === Vs) { + var JA = new aO().Vb(IA.i, kd.m).mE().r, KA = da(JA | 0), wy = $d().vj; + Xr(Nc, wy, KA); + } else { + var xy = +kOa(new aO().Vb(IA.i, kd.m)).r, PD = $d().vj; + Xr(Nc, PD, xy); + } + } + var Bv = ac(new M6().W(xe2), "allowMultiple"); + if (!Bv.b()) { + var LA = Bv.c(), QD = aj(new aO().Vb(LA.i, kd.m).Up()), RD = $d().Ey; + Bi(Nc, RD, QD); + } + var yy = ac(new M6().W(xe2), "sorted"); + if (!yy.b()) { + var CG = yy.c(), qm = aj(new aO().Vb(CG.i, kd.m).Up()), Lm = $d().EJ; + Bi(Nc, Lm, qm); + } + var Xg = ac(new M6().W(xe2), "enum"); + if (!Xg.b()) { + var ln = Xg.c().i, ep = tw(), ty = N6(ln, ep, kd.m).Cm, Ts = w6(/* @__PURE__ */ function(Oy) { + return function(Py) { + var Ur = Py.re(); + if (Ur instanceof xt) + return new z7().d(Ur.oq); + Ur = Oy.m; + var jB = Wd().Cf; + T6(); + var Vr = Oy.m, Pv = Dd(); + Py = N6(Py, Pv, Vr); + Vr = y7(); + Pv = y7(); + var op = y7(); + Ur.Gc(jB.j, "Cannot create enumeration constraint from not scalar value", Vr, Py, Pv, Yb().qb, op); + return y7(); + }; + }(kd)), Mr = rw(), hu = ty.ka(Ts, Mr.sc), FA = new WV(), Uw = rw(); + lOa(Nc, hu.ec(FA, Uw.sc)); + } + var vG = ac(new M6().W(xe2), "typeDiscriminator"); + if (!vG.b()) { + var wG = vG.c().i, xG = qc(), rT = N6(wG, xG, kd.m).sb.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(Oy) { + return function(Py, Ur) { + var jB = Ur.i, Vr = bc(); + jB = N6(jB, Vr, Oy.m).va; + Ur = Ur.Aa; + Vr = bc(); + Ur = N6(Ur, Vr, Oy.m).va; + return Py.cc(new R6().M(Ur, jB)); + }; + }(kd))); + yNa(Nc, rT); + } + var nH = ac(new M6().W(xe2), "typeDiscriminatorName"); + if (!nH.b()) { + var sT = nH.c(), tT = new aO().Vb(sT.i, kd.m).nf().t(), uT = Ae4().Zt; + eb(Nc, uT, tT); + } + Gba(kd, xe2, Nc, kd.m.rd, kd.m); + mOa(kd, Nc, xe2); + return Nc; + }; + }(h10, he4)), ug = rw(), Sg = ch.ka(Ie2, ug.sc).Dm(w6(/* @__PURE__ */ function() { + return function(kd) { + return B6(kd.g, $d().Yh).A.na(); + }; + }(h10))); + if (null === Sg) + throw new x7().d(Sg); + var Tg = Sg.ma(), zh = Sg.ya(), Rh = Tg.Cb(w6(/* @__PURE__ */ function() { + return function(kd) { + return B6(kd.g, $d().Yh).A.na(); + }; + }(h10))).am(w6(/* @__PURE__ */ function() { + return function(kd) { + kd = B6(kd.g, $d().Yh).A; + return kd.b() ? null : kd.c(); + }; + }(h10))), vg = w6(/* @__PURE__ */ function(kd) { + return function(Pi) { + if (null !== Pi) { + var sh = Pi.ma(), Pg = Pi.ya(); + if (1 < Pg.Oa()) { + Pi = kd.m; + var Xc = Wd().Cf, xe2 = Pg.ga().j; + sh = "Property term value must be unique in a node mapping. Term " + sh + " repeated"; + var Nc = Pg.ga().x; + yB(Pi, Xc, xe2, sh, Nc); + return Pg.kc().ua(); + } + } + return Pi.ya().kc().ua(); + }; + }(h10)), dh = Id().u, Jg = hC(Rh, vg, dh).ke(), Ah = rw(), Bh = zh.ia(Jg, Ah.sc), cg = wj().ej; + Bf(he4, cg, Bh); + } + var Qf = ac(new M6().W(C10), "extends"); + if (!Qf.b()) { + var Kg = Qf.c(), Ne2 = jc(kc(Kg.i), bc()); + if (Ne2 instanceof z7) { + var Xf = te4(Kg.i); + if (Xf instanceof ve4) + var di = Xf.i, dg = new R6().M(di, RV(h10.m.rd, di, Ys())); + else { + var Hf = Kg.i, wg = bc(), Lg = N6(Hf, wg, h10.m).va; + dg = new R6().M(Lg, RV(h10.m.rd, Lg, Zs())); + } + a: { + if (null !== dg) { + var jf = dg.ma(), mg = dg.ya(); + if (null !== jf && mg instanceof z7) { + var Mg = mg.i, Ng = Od(O7(), Kg.i), eg = kM(Mg, jf, Ng); + t10(eg); + var Oe4 = new z7().d(eg); + break a; + } + } + if (null !== dg) { + var ng = dg.ma(); + if (null !== ng) { + var fg = KV(LV(), h10.X); + t10(fg); + lB(fg, ng, h10.X, h10.m); + Oe4 = new z7().d(fg); + break a; + } + } + throw new x7().d(dg); + } + } else + Oe4 = y7(); + a: { + if (Oe4 instanceof z7) { + var Ug = Oe4.i; + if (null !== Ug) { + var xg = J5(K7(), new Ib().ha([Ug])), gg = nc().Ni(); + Zd(he4, gg, xg); + break a; + } + } + var fe4 = h10.m, ge4 = Wd().Cf, ph = he4.j; + if (Ne2.b()) + var hg = y7(); + else { + var Jh = Ne2.c(); + hg = new z7().d(Jh.oH.pH(Jh.va)); + } + var fj = "Cannot find extended node mapping with reference '" + (hg.b() ? "" : hg.c()) + "'", yg = Kg.i, qh = y7(); + ec(fe4, ge4, ph, qh, fj, yg.da); + } + } + var og = ac(new M6().W(C10), "idTemplate"); + if (!og.b()) { + var rh = og.c().i, Ch = Dd(), Vg = N6(rh, Ch, h10.m); + NNa(h10, Vg, C10, B6(he4.g, wj().ej)); + var Wg = wj().Ax; + eb(he4, Wg, Vg); + } + Gba(h10, C10, he4, h10.m.rd, h10.m); + JNa(h10.m.rd, he4); + Ve = new z7().d(he4); + } + } else if (Q5().Na === v10 && jc(kc(l10.i), bc()).na()) { + var Rf = te4(l10.i); + if (Rf instanceof ve4) + var Sh = Rf.i, zg = new R6().M(Sh, RV(h10.m.rd, Sh, Ys())); + else { + var Ji = l10.i, Kh = bc(), Lh = N6(Ji, Kh, h10.m).va; + zg = new R6().M(Lh, RV(h10.m.rd, Lh, Zs())); + } + a: { + if (null !== zg) { + var Ki = zg.ma(), gj = zg.ya(); + if (null !== Ki && gj instanceof z7) { + var Rl = gj.i, ek = Od(O7(), l10.i), Dh = kM(Rl, Ki, ek); + t10(Dh); + Ve = new z7().d(Dh); + break a; + } + } + if (null !== zg) { + var Eh = zg.ma(); + if (null !== Eh) { + var Li = KV(LV(), h10.X); + t10(Li); + lB(Li, Eh, h10.X, h10.m); + Ve = new z7().d(Li); + break a; + } + } + throw new x7().d(zg); + } + } else if (Q5().wq === v10 && jc(kc(l10.i), bc()).na()) { + var Mi = te4(l10.i); + if (Mi instanceof ve4) + var uj = Mi.i, Ni = new R6().M(uj, RV(h10.m.rd, uj, Ys())); + else { + var fk = l10.i, Ck = bc(), Dk = N6(fk, Ck, h10.m).va; + Ni = new R6().M(Dk, RV(h10.m.rd, Dk, Zs())); + } + a: { + if (null !== Ni) { + var hj = Ni.ma(), ri = Ni.ya(); + if (null !== hj && ri instanceof z7) { + var gk = ri.i, $k = Od(O7(), l10.i), lm = kM(gk, hj, $k), si = eb(lm, lm.R, hj); + t10(si); + Ve = new z7().d(si); + break a; + } + } + if (null !== Ni) { + var bf = Ni.ma(); + if (null !== bf) { + O7(); + var ei = new P6().a(), vj = new Cd().K(new S6().a(), ei), ti = t10(vj), Og = ti.j, Oi = Mc(ua(), Og, "#"), pg = zj(new Pc().fd(Oi)), zf = h10.m, Sf = ti.j.split(pg).join(""); + Mba(zf, bf, Sf, l10.i); + Ve = y7(); + break a; + } + } + throw new x7().d(Ni); + } + } else + Ve = y7(); + if (Ve instanceof z7) { + m10 = true; + p10 = Ve; + var eh = p10.i; + if (eh instanceof Cd) + return JNa(h10.m.rd, eh); + } + if (m10) { + var Fh = p10.i; + if (Fh instanceof ze2) + return JNa(h10.m.rd, Fh); + } + var fi = h10.m, hn = Wd().Cf, mm = "Error parsing shape '" + l10 + "'", nm = y7(); + ec(fi, hn, k10, nm, mm, l10.da); + }; + }(a10, c10))); + else if (Q5().nd !== f10) { + a10 = a10.m; + b10 = Wd().Cf; + f10 = "Invalid type " + f10 + " for 'nodeMappings' node."; + e10 = e10.i; + var g10 = y7(); + ec(a10, b10, c10, g10, f10, e10.da); + } + } + } + function gOa(a10, b10, c10, e10) { + var f10 = new sL().e(b10).he; + if (F6().Pg.he === f10) + return new z7().d(b10); + f10 = MNa(a10.m.rd, b10); + if (f10 instanceof z7) + return new z7().d(f10.i.j); + a10 = a10.m; + f10 = Wd().Cf; + b10 = "Cannot find property term with alias " + b10; + var g10 = y7(); + ec(a10, f10, c10, g10, b10, e10.da); + return y7(); + } + function bOa(a10, b10, c10) { + var e10 = qc(); + b10 = N6(b10, e10, a10.m); + b10 = ac(new M6().W(b10), "root"); + if (b10 instanceof z7 && (e10 = b10.i, null !== e10)) { + b10 = e10.i.hb().gb; + var f10 = Q5().sa; + if (b10 === f10) { + b10 = B6(a10.pb.g, Gc().R).A; + b10 = b10.b() ? null : b10.c(); + f10 = B6(a10.pb.g, Gc().Ym).A; + b10 = b10 + " " + (f10.b() ? null : f10.c()); + e10 = e10.i; + f10 = qc(); + e10 = N6(e10, f10, a10.m); + wNa(); + T6(); + f10 = a10.X; + T6(); + f10 = uNa(0, mr(T6(), f10, Q5().sa)); + var g10 = GO().vx; + b10 = eb(f10, g10, b10); + b10 = Rd(b10, c10 + "/root"); + f10 = ac(new M6().W(e10), "encodes"); + f10.b() || (f10 = f10.c().i, g10 = bc(), f10 = N6(f10, g10, a10.m).va, f10 = RV(a10.m.rd, f10, Xs()), f10 instanceof z7 && (f10 = f10.i.j, g10 = GO().Vs, new z7().d(eb(b10, g10, f10)))); + e10 = ac( + new M6().W(e10), + "declares" + ); + e10.b() || (e10 = e10.c().i, f10 = qc(), e10 = N6(e10, f10, a10.m).sb, a10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = l10.i, p10 = bc(); + m10 = N6(m10, p10, h10.m).va; + p10 = l10.Aa; + var t10 = bc(); + p10 = N6(p10, t10, h10.m).va; + l10 = CNa(ENa(), l10); + t10 = UV().R; + l10 = eb(l10, t10, p10); + p10 = new je4().e(p10); + p10 = k10 + "/declaration/" + jj(p10.td); + l10 = Rd(l10, p10); + m10 = RV(h10.m.rd, m10, Xs()); + return m10 instanceof z7 ? (m10 = m10.i.j, p10 = UV().$u, new z7().d(eb(l10, p10, m10))) : y7(); + }; + }(a10, c10)), c10 = rw(), a10 = e10.ka(a10, c10.sc), c10 = new nOa(), e10 = K7(), a10 = a10.ec(c10, e10.u), c10 = GO().Mt, Bf(b10, c10, a10)); + return new z7().d(b10); + } + } + return y7(); + } + d7.e2 = function() { + var a10 = ac(new M6().W(this.X), "usage"); + if (!a10.b()) { + var b10 = a10.c(), c10 = new aO().Vb(b10.i, this.m), e10 = this.pb, f10 = Gc().ae, g10 = c10.nf(), h10 = Od(O7(), b10); + Rg(e10, f10, g10, h10); + } + pe4(this.m, "fragment", this.pb.j, this.X); + var k10 = UNa(this.pb, this.X, this.kf.Q, this.m), l10 = Lc(this.pb), m10 = VNa(k10, l10.b() ? this.pb.j : l10.c()); + if (tc(this.m.rd.Vn)) { + var p10 = this.pb, t10 = new Fc().Vd(this.m.rd.Vn).Sb.Ye().Dd(), v10 = Bd().vh; + Zd(p10, v10, t10); + } + this.rA(this.kf, this.X); + if (m10.ow().Da()) { + var A10 = this.pb, D10 = m10.ow(), C10 = Gk().xc; + Bf(A10, C10, D10); + } + var I10 = hOa(this.pb); + wD(); + var L10 = mh(T6(), "fragment"); + T6(); + var Y10 = this.X; + T6(); + var ia = pG(0, L10, mr(T6(), Y10, Q5().sa)), pa = /* @__PURE__ */ function(Xc, xe2) { + return function(Nc) { + if (Nc instanceof Cd || Nc instanceof ze2) + return Nc = Rd(Nc, xe2.j + "/fragment"), eb(Nc, Nc.R, "fragment"); + throw new x7().d(Nc); + }; + }(this, I10), La = ia.i.hb().gb; + if (Q5().sa === La) { + var ob = ia.i, zb = qc(), Zb = N6(ob, zb, this.m); + if (ac(new M6().W(Zb), "union").na()) { + var Cc = FNa(HNa(), Zb); + pa(Cc); + var vc = ac(new M6().W(Zb), "union"); + if (!vc.b()) { + var id = vc.c(), yd = id.i.hb().gb; + if (Q5().cd === yd) + try { + var zd = id.i, rd = Dd(), sd = rw().sc, le4 = N6(zd, sw(sd, rd), this.m), Vc = Ae4().bh; + Wr(Cc, Vc, le4); + } catch (Xc) { + if (Ph(E6(), Xc) instanceof nb) { + var Sc = this.m, Qc = Wd().Cf, $c = Cc.j, Wc = id.i, Qe = y7(); + ec(Sc, Qc, $c, Qe, "Union node mappings must be declared as lists of node mapping references", Wc.da); + } else + throw Xc; + } + else { + var Qd = this.m, me4 = Wd().Cf, of = Cc.j, Le2 = id.i, Ve = y7(); + ec(Qd, me4, of, Ve, "Union node mappings must be declared as lists of node mapping references", Le2.da); + } + } + var he4 = ac(new M6().W(Zb), "typeDiscriminator"); + if (!he4.b()) { + var Wf = he4.c().i, vf = qc(), He = N6(Wf, vf, this.m).sb.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(Xc) { + return function(xe2, Nc) { + var om = Nc.i, Dn = bc(); + om = N6(om, Dn, Xc.m).va; + Nc = Nc.Aa; + Dn = bc(); + Nc = N6(Nc, Dn, Xc.m).va; + return xe2.cc(new R6().M(Nc, om)); + }; + }(this))); + yNa(Cc, He); + } + var Ff = ac(new M6().W(Zb), "typeDiscriminatorName"); + if (!Ff.b()) { + var wf = Ff.c(), Re2 = new aO().Vb(wf.i, this.m).nf().t(), we4 = Ae4().Zt; + eb(Cc, we4, Re2); + } + var ne4 = new z7().d(Cc); + } else { + var Me2 = KV(LV(), Zb); + pa(Me2); + var Se4 = ac(new M6().W(Zb), "classTerm"); + if (!Se4.b()) { + var xf = Se4.c(), ie3 = new aO().Vb(xf.i, this.m).nf().t(), gf = LNa(this.m.rd, ie3); + if (gf instanceof z7) { + var pf = gf.i.j, hf = wj().Ut; + eb(Me2, hf, pf); + } else { + var Gf = this.m, yf = Wd().Cf, oe4 = Me2.j, lg = "Cannot find class term with alias " + ie3, bh = xf.i, Qh = y7(); + ec(Gf, yf, oe4, Qh, lg, bh.da); + } + } + var af = ac(new M6().W(Zb), "patch"); + if (!af.b()) { + var Pf = af.c(), oh = new aO().Vb(Pf.i, this.m).nf().t(); + if (wj().Ts.Ha(oh)) + jka(Me2, oh); + else { + var ch = this.m, Ie2 = Wd().Cf, ug = Me2.j, Sg = "Unsupported node mapping patch operation '" + oh + "'", Tg = Pf.i, zh = y7(); + ec(ch, Ie2, ug, zh, Sg, Tg.da); + } + } + var Rh = ac(new M6().W(Zb), "mapping"); + if (!Rh.b()) { + var vg = Rh.c().i, dh = qc(), Jg = N6(vg, dh, this.m).sb, Ah = w6(/* @__PURE__ */ function(Xc, xe2) { + return function(Nc) { + var om = Nc.i, Dn = qc(), gi = N6(om, Dn, Xc.m), Te = zNa(BNa(), gi); + T6(); + var pm = Nc.Aa, jn = Xc.m, Oq = Dd(), En = N6(pm, Oq, jn), $n = $d().R, Rp = eb(Te, $n, En), ao = xe2.j, Xt = Nc.Aa, Fs = bc(), Sp = N6(Xt, Fs, Xc.m).va, bo = new je4().e(Sp), Gs = ao + "/property/" + jj(bo.td); + J5(K7(), H10()); + Ai(Rp, Gs); + pe4(Xc.m, "propertyMapping", Te.j, gi); + var Fn = ac(new M6().W(gi), "propertyTerm"); + if (Fn instanceof z7) { + var Pq = Fn.i, Jr = new aO().Vb(Pq.i, Xc.m).nf().t(), Hs = MNa(Xc.m.rd, Jr); + if (Hs instanceof z7) { + var Is = Hs.i.j, Kr = $d().Yh; + eb(Te, Kr, Is); + } else { + var Js = Xc.m, Ks = Wd().Cf, ov = Te.j, pv = "Cannot find property term with alias " + Jr, Ls = Pq.i, qv = y7(); + ec(Js, Ks, ov, qv, pv, Ls.da); + } + } else { + var rv = F6().Pg, Yt = Nc.Aa, sv = bc(), Qq = N6(Yt, sv, Xc.m).va, tv = new je4().e(Qq), Ms = jj(tv.td), Zt = ic(G5(rv, Ms)), uv = $d().Yh; + eb(Te, uv, Zt); + } + var cp = ac(new M6().W(gi), "range"); + if (!cp.b()) { + var Ns = cp.c(), $t = Ns.i.hb().gb; + if (Q5().cd === $t) { + var au = Ns.i, Qj = Dd(), Jw = rw().sc, dp = N6(au, sw(Jw, Qj), Xc.m), bu = Ae4().bh; + Wr(Te, bu, dp); + } else { + var ui = new aO().Vb(Ns.i, Xc.m).nf().t(); + if ("guid" === ui) { + var Os = F6().Eb, Ps = ic(G5(Os, "guid")), cu = $d().Gf; + eb(Te, cu, Ps); + } else if ("string" === ui || "integer" === ui || "boolean" === ui || "float" === ui || "decimal" === ui || "double" === ui || "duration" === ui || "dateTime" === ui || "time" === ui || "date" === ui || "anyType" === ui) { + var Qs = F6().Bj, du = ic(G5(Qs, ui)), vv = $d().Gf; + eb(Te, vv, du); + } else if ("anyUri" === ui) { + var wv = Uh().zp, xv = $d().Gf; + eb(Te, xv, wv); + } else if ("link" === ui) { + var py = F6().Eb, Rq = ic(G5(py, "link")), Kw = $d().Gf; + eb(Te, Kw, Rq); + } else if ("number" === ui) { + var Lw = Uh().Xo, eu = $d().Gf; + eb(Te, eu, Lw); + } else if ("uri" === ui) { + var yv = Uh().zp, qy = $d().Gf; + eb(Te, qy, yv); + } else if ("any" === ui) { + var zv = Uh().Yr, Mw = $d().Gf; + eb(Te, Mw, zv); + } else if ("anyNode" === ui) { + var ry = K7(), Tp = F6().$c, Ss = J5(ry, new Ib().ha([ic(G5(Tp, "anyNode"))])), Nw = Ae4().bh; + Wr(Te, Nw, Ss); + } else { + var fu = J5(K7(), new Ib().ha([ui])), Ow = Ae4().bh; + Wr(Te, Ow, fu); + } + } + } + fOa(Xc, gi, Te); + iOa(Xc, gi, Te); + var Pw = ac(new M6().W(gi), "patch"); + if (!Pw.b()) { + var Sq = Pw.c(), gu = new aO().Vb(Sq.i, Xc.m).nf().t(); + if ($d().Ts.Ha(gu)) + jka(Te, gu); + else { + var Qw = Xc.m, Rw = Wd().Cf, Sw = Te.j, AA = "Unsupported property mapping patch operation '" + gu + "'", Up = Sq.i, kn = y7(); + ec(Qw, Rw, Sw, kn, AA, Up.da); + } + } + var Vp = ac(new M6().W(gi), "mandatory"); + if (!Vp.b()) { + var sy = Vp.c(), BA = aj(new aO().Vb(sy.i, Xc.m).Up()) ? 1 : 0, GD = $d().ji; + es(Te, GD, BA); + } + var Av = ac(new M6().W(gi), "pattern"); + if (!Av.b()) { + var Tw = Av.c(), HD = new aO().Vb(Tw.i, Xc.m).nf().t(), ID = $d().zl; + eb(Te, ID, HD); + } + var CA = ac(new M6().W(gi), "minimum"); + if (!CA.b()) { + var DA = CA.c(), JD = DA.i.hb().gb; + if (Q5().cj === JD) { + var KD = new aO().Vb(DA.i, Xc.m).mE().r | 0, EA = $d().wj; + Xr(Te, EA, KD); + } else { + var yG = +kOa(new aO().Vb(DA.i, Xc.m)).r, zG = $d().wj; + Xr(Te, zG, yG); + } + } + var LD = ac(new M6().W(gi), "unique"); + if (!LD.b()) { + var GA = LD.c(), AG = GA.i.hb().gb; + if (Q5().ti === AG) { + var uy = aj(new aO().Vb(GA.i, Xc.m).Up()), BG = $d().YF; + Bi(Te, BG, uy); + } else { + var MD = Xc.m, ND = Wd().Cf; + T6(); + var OD = GA.i, Us = Xc.m, vy = Dd(), HA = N6(OD, vy, Us), IA = y7(), Vs = y7(), JA = y7(); + MD.Gc(ND.j, "Unique property in a property mapping must be a boolean value", IA, HA, Vs, Yb().qb, JA); + } + } + var KA = ac(new M6().W(gi), "maximum"); + if (!KA.b()) { + var wy = KA.c(), xy = wy.i.hb().gb; + if (Q5().cj === xy) { + var PD = new aO().Vb(wy.i, Xc.m).mE().r, Bv = da(PD | 0), LA = $d().vj; + Xr(Te, LA, Bv); + } else { + var QD = +kOa(new aO().Vb(wy.i, Xc.m)).r, RD = $d().vj; + Xr(Te, RD, QD); + } + } + var yy = ac( + new M6().W(gi), + "allowMultiple" + ); + if (!yy.b()) { + var CG = yy.c(), qm = aj(new aO().Vb(CG.i, Xc.m).Up()), Lm = $d().Ey; + Bi(Te, Lm, qm); + } + var Xg = ac(new M6().W(gi), "sorted"); + if (!Xg.b()) { + var ln = Xg.c(), ep = aj(new aO().Vb(ln.i, Xc.m).Up()), ty = $d().EJ; + Bi(Te, ty, ep); + } + var Ts = ac(new M6().W(gi), "enum"); + if (!Ts.b()) { + var Mr = Ts.c().i, hu = tw(), FA = N6(Mr, hu, Xc.m).Cm, Uw = w6(/* @__PURE__ */ function(Vr) { + return function(Pv) { + var op = Pv.re(); + if (op instanceof xt) + return new z7().d(op.oq); + op = Vr.m; + var jE = Wd().Cf; + T6(); + var kB = Vr.m, vT = Dd(); + Pv = N6(Pv, vT, kB); + kB = y7(); + vT = y7(); + var wma = y7(); + op.Gc( + jE.j, + "Cannot create enumeration constraint from not scalar value", + kB, + Pv, + vT, + Yb().qb, + wma + ); + return y7(); + }; + }(Xc)), vG = rw(), wG = FA.ka(Uw, vG.sc), xG = new WV(), rT = rw(); + lOa(Te, wG.ec(xG, rT.sc)); + } + var nH = ac(new M6().W(gi), "typeDiscriminator"); + if (!nH.b()) { + var sT = nH.c().i, tT = qc(), uT = N6(sT, tT, Xc.m).sb.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(Vr) { + return function(Pv, op) { + var jE = op.i, kB = bc(); + jE = N6(jE, kB, Vr.m).va; + op = op.Aa; + kB = bc(); + op = N6(op, kB, Vr.m).va; + return Pv.cc(new R6().M(op, jE)); + }; + }(Xc))); + yNa(Te, uT); + } + var Oy = ac(new M6().W(gi), "typeDiscriminatorName"); + if (!Oy.b()) { + var Py = Oy.c(), Ur = new aO().Vb(Py.i, Xc.m).nf().t(), jB = Ae4().Zt; + eb(Te, jB, Ur); + } + Gba(Xc, gi, Te, Xc.m.rd, Xc.m); + mOa(Xc, Te, gi); + return Te; + }; + }(this, Me2)), Bh = rw(), cg = Jg.ka(Ah, Bh.sc).Dm(w6(/* @__PURE__ */ function() { + return function(Xc) { + return B6(Xc.g, $d().Yh).A.na(); + }; + }(this))); + if (null === cg) + throw new x7().d(cg); + var Qf = cg.ma(), Kg = cg.ya(), Ne2 = Qf.Cb(w6(/* @__PURE__ */ function() { + return function(Xc) { + return B6(Xc.g, $d().Yh).A.na(); + }; + }(this))).am(w6(/* @__PURE__ */ function() { + return function(Xc) { + Xc = B6(Xc.g, $d().Yh).A; + return Xc.b() ? null : Xc.c(); + }; + }(this))), Xf = w6(/* @__PURE__ */ function(Xc) { + return function(xe2) { + if (null !== xe2) { + var Nc = xe2.ma(), om = xe2.ya(); + if (1 < om.Oa()) { + xe2 = Xc.m; + var Dn = Wd().Cf, gi = om.ga().j; + Nc = "Property term value must be unique in a node mapping. Term " + Nc + " repeated"; + var Te = om.ga().x; + yB(xe2, Dn, gi, Nc, Te); + return om.kc().ua(); + } + } + return xe2.ya().kc().ua(); + }; + }(this)), di = Id().u, dg = hC(Ne2, Xf, di).ke(), Hf = rw(), wg = Kg.ia(dg, Hf.sc), Lg = wj().ej; + Bf(Me2, Lg, wg); + } + var jf = ac(new M6().W(Zb), "extends"); + if (!jf.b()) { + var mg = jf.c(), Mg = jc(kc(mg.i), bc()); + if (Mg instanceof z7) { + var Ng = te4(mg.i); + if (Ng instanceof ve4) + var eg = Ng.i, Oe4 = new R6().M(eg, RV( + this.m.rd, + eg, + Ys() + )); + else { + var ng = mg.i, fg = bc(), Ug = N6(ng, fg, this.m).va; + Oe4 = new R6().M(Ug, RV(this.m.rd, Ug, Zs())); + } + a: { + if (null !== Oe4) { + var xg = Oe4.ma(), gg = Oe4.ya(); + if (null !== xg && gg instanceof z7) { + var fe4 = gg.i, ge4 = Od(O7(), mg.i), ph = kM(fe4, xg, ge4); + pa(ph); + var hg = new z7().d(ph); + break a; + } + } + if (null !== Oe4) { + var Jh = Oe4.ma(); + if (null !== Jh) { + var fj = KV(LV(), this.X); + pa(fj); + lB(fj, Jh, this.X, this.m); + hg = new z7().d(fj); + break a; + } + } + throw new x7().d(Oe4); + } + } else + hg = y7(); + a: { + if (hg instanceof z7) { + var yg = hg.i; + if (null !== yg) { + var qh = J5(K7(), new Ib().ha([yg])), og = nc().Ni(); + Zd(Me2, og, qh); + break a; + } + } + var rh = this.m, Ch = Wd().Cf, Vg = Me2.j; + if (Mg.b()) + var Wg = y7(); + else { + var Rf = Mg.c(); + Wg = new z7().d(Rf.oH.pH(Rf.va)); + } + var Sh = "Cannot find extended node mapping with reference '" + (Wg.b() ? "" : Wg.c()) + "'", zg = mg.i, Ji = y7(); + ec(rh, Ch, Vg, Ji, Sh, zg.da); + } + } + var Kh = ac(new M6().W(Zb), "idTemplate"); + if (!Kh.b()) { + var Lh = Kh.c().i, Ki = Dd(), gj = N6(Lh, Ki, this.m); + NNa(this, gj, Zb, B6(Me2.g, wj().ej)); + var Rl = wj().Ax; + eb(Me2, Rl, gj); + } + Gba(this, Zb, Me2, this.m.rd, this.m); + JNa(this.m.rd, Me2); + ne4 = new z7().d(Me2); + } + } else if (Q5().Na === La && jc( + kc(ia.i), + bc() + ).na()) { + var ek = te4(ia.i); + if (ek instanceof ve4) + var Dh = ek.i, Eh = new R6().M(Dh, RV(this.m.rd, Dh, Ys())); + else { + var Li = ia.i, Mi = bc(), uj = N6(Li, Mi, this.m).va; + Eh = new R6().M(uj, RV(this.m.rd, uj, Zs())); + } + a: { + if (null !== Eh) { + var Ni = Eh.ma(), fk = Eh.ya(); + if (null !== Ni && fk instanceof z7) { + var Ck = fk.i, Dk = Od(O7(), ia.i), hj = kM(Ck, Ni, Dk); + pa(hj); + ne4 = new z7().d(hj); + break a; + } + } + if (null !== Eh) { + var ri = Eh.ma(); + if (null !== ri) { + var gk = KV(LV(), this.X); + pa(gk); + lB(gk, ri, this.X, this.m); + ne4 = new z7().d(gk); + break a; + } + } + throw new x7().d(Eh); + } + } else if (Q5().wq === La && jc(kc(ia.i), bc()).na()) { + var $k = te4(ia.i); + if ($k instanceof ve4) + var lm = $k.i, si = new R6().M(lm, RV(this.m.rd, lm, Ys())); + else { + var bf = ia.i, ei = bc(), vj = N6(bf, ei, this.m).va; + si = new R6().M(vj, RV(this.m.rd, vj, Zs())); + } + a: { + if (null !== si) { + var ti = si.ma(), Og = si.ya(); + if (null !== ti && Og instanceof z7) { + var Oi = Og.i, pg = Od(O7(), ia.i), zf = kM(Oi, ti, pg), Sf = eb(zf, zf.R, ti); + pa(Sf); + ne4 = new z7().d(Sf); + break a; + } + } + if (null !== si) { + var eh = si.ma(); + if (null !== eh) { + O7(); + var Fh = new P6().a(), fi = new Cd().K(new S6().a(), Fh), hn = pa(fi), mm = hn.j, nm = Mc(ua(), mm, "#"), kd = zj(new Pc().fd(nm)), Pi = this.m, sh = hn.j.split(kd).join(""); + Mba(Pi, eh, sh, ia.i); + ne4 = y7(); + break a; + } + } + throw new x7().d(si); + } + } else + ne4 = y7(); + if (ne4 instanceof z7) { + var Pg = ne4.i; + null !== Pg && Ui(I10.g, Jk().nb, Pg, (O7(), new P6().a())); + } + return I10; + }; + function mOa(a10, b10, c10) { + var e10 = B6(b10.g, $d().Gf).A; + if (!e10.b()) { + e10 = e10.c(); + var f10 = F6().Eb; + e10 === ic(G5(f10, "guid")) ? (e10 = B6(b10.g, $d().YF).A, e10 = !(e10.b() ? 0 : e10.c())) : e10 = false; + if (e10) { + a10 = a10.m; + e10 = Wd().O5; + f10 = b10.j; + b10 = B6(b10.g, $d().R).A; + b10 = "Declaration of property '" + (b10.b() ? null : b10.c()) + "' with range GUID and without unique constraint"; + var g10 = y7(); + nM(a10, e10, f10, g10, b10, c10.da); + } + } + } + d7.$classData = r8({ DHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsParser", { DHa: 1, f: 1, $r: 1, wHa: 1 }); + function oOa() { + this.WB = 0; + this.To = this.Ig = null; + this.oo = false; + } + oOa.prototype = new RL(); + oOa.prototype.constructor = oOa; + d7 = oOa.prototype; + d7.a = function() { + rq.prototype.a.call(this); + pOa = this; + this.Ig = Vf().$; + var a10 = K7(), b10 = [Vf().$]; + this.To = J5(a10, new Ib().ha(b10)); + this.oo = false; + return this; + }; + d7.hI = function(a10, b10) { + return a10 instanceof tl ? new z7().d(qOa(new XV(), ar(a10.g, sl().nb), tD(), b10.Bc).sB()) : y7(); + }; + d7.NE = function() { + return nBa(); + }; + d7.FD = function(a10) { + return a10 instanceof tl; + }; + function rOa(a10, b10) { + b10 = b10.$g; + return b10 instanceof Dc ? (b10 = b10.Xd.Fd.re(), b10 instanceof vw ? !b10.sb.Od(w6(/* @__PURE__ */ function() { + return function(c10) { + c10 = c10.Aa.re().va; + return 0 <= (c10.length | 0) && "swagger" === c10.substring(0, 7); + }; + }(a10))) : true) : false; + } + d7.dy = function() { + return H10(); + }; + d7.tA = function(a10, b10) { + var c10 = a10.$g; + return c10 instanceof Dc ? (b10 = new oR().il(a10.da, b10.Df, b10, y7(), y7(), y7(), iA().ho), new z7().d(Pka(Qka(c10.Xd, a10.da, a10.OB, b10)))) : y7(); + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha(["application/amf+json", "application/amf+yaml", "application/payload+json", "application/payload+yaml"])); + }; + d7.t0 = function(a10, b10, c10) { + return b10 instanceof Zq && a10 instanceof tl ? (a10 = qOa(new XV(), ar(a10.g, sl().nb), tD(), c10.Bc).sB(), b10.GI = new z7().d(a10), true) : false; + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10) { + return new rC().Sx(kk(), b10).ye(a10); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + var a10 = K7(), b10 = [Cea(), vCa()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.nB = function(a10) { + var b10 = a10.$g; + b10 instanceof Dc ? b10.Kz.b() ? b10 = true : (b10 = b10.Kz, b10.b() ? b10 = false : (b10 = b10.c(), b10 = 0 <= (b10.length | 0) && "%" === b10.substring(0, 1)), b10 = !b10) : b10 = false; + return b10 && rOa(this, a10); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return OL(); + }; + }(this)), ml()); + }; + d7.gB = function() { + return this.oo; + }; + d7.ry = function() { + return nu(); + }; + d7.$classData = r8({ LIa: 0 }, false, "amf.plugins.document.webapi.PayloadPlugin$", { LIa: 1, bD: 1, f: 1, Zr: 1 }); + var pOa = void 0; + function OL() { + pOa || (pOa = new oOa().a()); + return pOa; + } + function YV() { + LO.call(this); + this.GA = this.zf = null; + } + YV.prototype = new FEa(); + YV.prototype.constructor = YV; + function sOa() { + } + sOa.prototype = YV.prototype; + YV.prototype.Ti = function(a10, b10, c10) { + LO.prototype.Ti.call(this, a10, b10, c10); + this.zf = new ZV().aA(this); + this.GA = Bu(); + return this; + }; + YV.prototype.Gg = function() { + return this.GA; + }; + YV.prototype.Rda = function() { + return "/definitions/"; + }; + YV.prototype.$classData = r8({ cha: 0 }, false, "amf.plugins.document.webapi.contexts.Oas2SpecEmitterContext", { cha: 1, dha: 1, TR: 1, f: 1 }); + function $V() { + LO.call(this); + this.GA = this.zf = null; + } + $V.prototype = new FEa(); + $V.prototype.constructor = $V; + $V.prototype.Ti = function(a10, b10, c10) { + LO.prototype.Ti.call(this, a10, b10, c10); + this.zf = new pA().aA(this); + this.GA = Cu(); + return this; + }; + $V.prototype.Gg = function() { + return this.GA; + }; + $V.prototype.Rda = function() { + return "/components/schemas/"; + }; + $V.prototype.$classData = r8({ vJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas3SpecEmitterContext", { vJa: 1, dha: 1, TR: 1, f: 1 }); + function tOa() { + this.w3 = this.N = null; + } + tOa.prototype = new u7(); + tOa.prototype.constructor = tOa; + d7 = tOa.prototype; + d7.Dqa = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + return new bW().Cr(b10, c10, e10, f10, g10, a10.N); + }; + }(this)); + }; + d7.hca = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new cW().j1(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.eF = function() { + return pka(this); + }; + d7.Jca = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new eW().s1(b10, c10, e10, f10, a10.N); + }; + }(this)); + }; + d7.Dba = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new fW().cA(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.j$ = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new gW().i1(b10, c10, e10, f10, a10.N); + }; + }(this)); + }; + d7.r$ = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + var e10 = new hW(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.Z2 = b10; + iW.prototype.IK.call(e10, b10, c10, a10.N); + e10.de = ""; + return e10; + }; + }(this)); + }; + d7.MN = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + var e10 = new UO(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.UV = b10; + Xx.prototype.X$.call(e10, b10, c10, a10.N); + b10 = K7(); + c10 = new jW(); + if (null === e10) + throw mb(E6(), null); + c10.l = e10; + e10.YH = J5(b10, new Ib().ha([c10])); + return e10; + }; + }(this)); + }; + d7.tS = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + var e10 = new kW(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.o0 = b10; + lW.prototype.HK.call(e10, b10, c10, a10.N); + e10.de = ""; + return e10; + }; + }(this)); + }; + d7.sda = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new mW().DO(b10, c10, a10.N); + }; + }(this)); + }; + d7.c0 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + var e10 = new nW(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.q$ = b10; + oW.prototype.dU.call(e10, b10, c10, H10(), a10.N); + e10.Aa = ""; + return e10; + }; + }(this)); + }; + d7.H$ = function() { + return this.hca(); + }; + d7.kaa = function(a10) { + this.N = a10; + this.w3 = "schemas"; + return this; + }; + d7.Loa = function(a10) { + if (a10 instanceof mf) + return new z7().d(uOa().Id); + var b10 = this.N.Bc, c10 = Lo().Ix, e10 = a10.j, f10 = y7(), g10 = Ab(a10.fa(), q5(jd)); + a10 = Lc(a10); + b10.Gc(c10.j, e10, f10, "Document has no header.", g10, Yb().qb, a10); + return y7(); + }; + d7.Ioa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new pW().MO(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.Wda = function() { + return ska(this); + }; + d7.Ina = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new qW().XK(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.$classData = r8({ EJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory", { EJa: 1, f: 1, OJa: 1, i7: 1 }); + function jW() { + this.l = null; + } + jW.prototype = new u7(); + jW.prototype.constructor = jW; + jW.prototype.Qa = function() { + var a10 = this.l.Fa.N.Bc, b10 = Lo().Ix, c10 = this.l.UV.j, e10 = y7(), f10 = "Custom facets not supported for vendor " + this.l.Fa.N.Gg(), g10 = Ab(this.l.UV.x, q5(jd)), h10 = yb(this.l.UV); + a10.Gc(b10.j, c10, e10, f10, g10, Yb().qb, h10); + }; + jW.prototype.La = function() { + return kr(wr(), this.l.UV.x, q5(jd)); + }; + jW.prototype.$classData = r8({ JJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory$$anon$4$$anon$5", { JJa: 1, f: 1, db: 1, Ma: 1 }); + function rW() { + ax.call(this); + this.GA = this.zf = null; + } + rW.prototype = new NEa(); + rW.prototype.constructor = rW; + rW.prototype.Gg = function() { + return this.GA; + }; + rW.prototype.cU = function(a10, b10) { + var c10 = WO(); + ax.prototype.Ti.call(this, a10, c10, b10); + this.zf = new tOa().kaa(this); + this.GA = Qb(); + return this; + }; + rW.prototype.$classData = r8({ KJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08SpecEmitterContext", { KJa: 1, hha: 1, TR: 1, f: 1 }); + function vOa() { + this.m = null; + } + vOa.prototype = new u7(); + vOa.prototype.constructor = vOa; + d7 = vOa.prototype; + d7.Foa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new sW().PO(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.a2 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new iQ().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.x0 = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + return new tW().OO(b10, c10, e10, f10, !!g10, a10.m); + }; + }(this)); + }; + d7.Ica = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new uW().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.x2 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new vW().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.Kna = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new $P().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.ss = function(a10) { + this.m = a10; + return this; + }; + d7.iF = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + e10 = !!e10; + return wW(xW(), b10, c10, e10, f10, a10.m); + }; + }(this)); + }; + d7.$classData = r8({ LJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08VersionFactory", { LJa: 1, f: 1, UJa: 1, j7: 1 }); + function wOa() { + this.w3 = this.N = null; + } + wOa.prototype = new u7(); + wOa.prototype.constructor = wOa; + d7 = wOa.prototype; + d7.Dqa = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + return new yW().Cr(b10, c10, e10, f10, g10, a10.N); + }; + }(this)); + }; + d7.hca = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new zW().j1(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.eF = function() { + return pka(this); + }; + d7.Jca = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new AW().s1(b10, c10, e10, f10, a10.N); + }; + }(this)); + }; + d7.Dba = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new BW().cA(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.j$ = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new CW().i1(b10, c10, e10, f10, a10.N); + }; + }(this)); + }; + d7.r$ = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new DW().IK(b10, c10, a10.N); + }; + }(this)); + }; + d7.MN = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return xOa(b10, c10, a10.N); + }; + }(this)); + }; + d7.tS = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new EW().HK(b10, c10, a10.N); + }; + }(this)); + }; + d7.sda = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return new FW().DO(b10, c10, a10.N); + }; + }(this)); + }; + d7.c0 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new GW().JK(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.H$ = function() { + return this.hca(); + }; + d7.kaa = function(a10) { + this.N = a10; + this.w3 = "types"; + return this; + }; + d7.Loa = function(a10) { + if (a10 instanceof Fl) + return new z7().d(vx().Id); + if (a10 instanceof Hl) + return new z7().d(ux().Id); + if (a10 instanceof mf) + return new z7().d(yOa().Id); + var b10 = this.N.Bc, c10 = Lo().Ix, e10 = a10.j, f10 = y7(), g10 = Ab(a10.fa(), q5(jd)); + a10 = Lc(a10); + b10.Gc(c10.j, e10, f10, "Document has no header.", g10, Yb().qb, a10); + return y7(); + }; + d7.Ioa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new HW().MO(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.Wda = function() { + return ska(this); + }; + d7.Ina = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new IW().XK(b10, c10, e10, a10.N); + }; + }(this)); + }; + d7.$classData = r8({ MJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml10EmitterVersionFactory", { MJa: 1, f: 1, OJa: 1, i7: 1 }); + function JW() { + ax.call(this); + this.GA = this.zf = null; + } + JW.prototype = new NEa(); + JW.prototype.constructor = JW; + function zOa() { + } + zOa.prototype = JW.prototype; + JW.prototype.Ti = function(a10, b10, c10) { + ax.prototype.Ti.call(this, a10, b10, c10); + this.zf = new wOa().kaa(this); + this.GA = Pb(); + return this; + }; + JW.prototype.Gg = function() { + return this.GA; + }; + JW.prototype.$classData = r8({ gha: 0 }, false, "amf.plugins.document.webapi.contexts.Raml10SpecEmitterContext", { gha: 1, hha: 1, TR: 1, f: 1 }); + function KW() { + this.m = null; + } + KW.prototype = new u7(); + KW.prototype.constructor = KW; + d7 = KW.prototype; + d7.Foa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new LW().PO(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.a2 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new MW().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.x0 = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + return new NW().OO(b10, c10, e10, f10, !!g10, a10.m); + }; + }(this)); + }; + d7.Ica = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new fQ().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.x2 = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new OW().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.Kna = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new $P().jn(b10, c10, !!e10, a10.m); + }; + }(this)); + }; + d7.ss = function(a10) { + this.m = a10; + return this; + }; + d7.iF = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + e10 = !!e10; + return PW(QW(), b10, c10, RW(e10, false), f10, a10.m); + }; + }(this)); + }; + d7.$classData = r8({ NJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml10VersionFactory", { NJa: 1, f: 1, UJa: 1, j7: 1 }); + function SW() { + this.s2 = null; + } + SW.prototype = new u7(); + SW.prototype.constructor = SW; + SW.prototype.Ob = function(a10) { + T6(); + var b10 = B6(this.s2.Y(), db().ed).A; + b10 = iua(0, b10.b() ? this.s2.Ib().c() : b10.c()); + pr(a10.s, b10); + }; + function AOa(a10) { + var b10 = new SW(); + b10.s2 = a10; + return b10; + } + SW.prototype.La = function() { + return kr(wr(), this.s2.fa(), q5(jd)); + }; + SW.prototype.$classData = r8({ TJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlSpecEmitterContext$$anon$6", { TJa: 1, f: 1, wh: 1, Ma: 1 }); + function TW() { + } + TW.prototype = new u7(); + TW.prototype.constructor = TW; + TW.prototype.a = function() { + return this; + }; + function $Ga(a10, b10) { + a10 = rx(uOa()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(uOa()); + a10 = rx(yOa()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(yOa()); + a10 = rx(BOa()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(BOa()); + a10 = rx(ux()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(ux()); + a10 = rx(vx()).hh; + if (sx(Iv(a10, b10, b10.length | 0))) + return new z7().d(vx()); + a10 = Rka(Zka(), b10); + return a10.b() ? 0 <= (b10.length | 0) && "%" === b10.substring(0, 1) ? new z7().d(new UW().e(b10)) : y7() : (b10 = a10.c(), new z7().d(b10)); + } + TW.prototype.hG = function(a10) { + var b10 = a10.$g; + return b10 instanceof Dc ? (b10 = b10.Kz, b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = $Ga(aHa(), b10)), b10.b() ? (Zka(), a10 = a10.$g, a10 instanceof Dc ? (a10 = a10.Kz, a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = Rka(Zka(), a10))) : a10 = y7()) : a10 = b10, a10) : y7(); + }; + TW.prototype.$classData = r8({ RKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$", { RKa: 1, f: 1, q: 1, o: 1 }); + var COa = void 0; + function aHa() { + COa || (COa = new TW().a()); + return COa; + } + function kA() { + Lx.call(this); + this.ku = this.iu = this.AN = this.gja = null; + } + kA.prototype = new aFa(); + kA.prototype.constructor = kA; + kA.prototype.xB = function() { + return this.ku; + }; + function Ana(a10, b10, c10, e10, f10) { + a10.gja = b10; + a10.AN = c10; + a10.iu = e10; + a10.ku = f10; + b10 = Rb(Gb().ab, H10()); + var g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()), l10 = Rb(Gb().ab, H10()), m10 = Rb(Gb().ab, H10()), p10 = Rb(Gb().ab, H10()), t10 = Rb(Gb().ab, H10()), v10 = Rb(Gb().ab, H10()), A10 = Rb(Gb().ab, H10()), D10 = Rb(Gb().ab, H10()), C10 = Rb(Gb().ab, H10()), I10 = Rb(Gb().ab, H10()), L10 = Rb(Gb().ab, H10()), Y10 = Rb(Gb().ab, H10()), ia = Rb(Gb().ab, H10()); + Lx.prototype.BU.call(a10, c10, b10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, e10, f10, ia); + return a10; + } + kA.prototype.wG = function() { + return this.iu; + }; + kA.prototype.bG = function() { + return this.AN; + }; + kA.prototype.$classData = r8({ fLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.OasWebApiDeclarations", { fLa: 1, QY: 1, hN: 1, f: 1 }); + function Jx() { + Lx.call(this); + this.ku = this.iu = this.AN = this.FT = this.os = null; + } + Jx.prototype = new aFa(); + Jx.prototype.constructor = Jx; + function DOa() { + } + DOa.prototype = Jx.prototype; + function EOa(a10, b10) { + Lx.prototype.fna.call(a10, b10, a10); + a10.os.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + c10.os = c10.os.cc(new R6().M(f10, e10)); + } else + throw new x7().d(e10); + }; + }(a10))); + b10.os.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + c10.os = c10.os.cc(new R6().M(f10, e10)); + } else + throw new x7().d(e10); + }; + }(a10))); + } + d7 = Jx.prototype; + d7.xB = function() { + return this.ku; + }; + d7.GU = function(a10, b10, c10, e10, f10) { + this.os = a10; + this.FT = b10; + this.AN = c10; + this.iu = e10; + this.ku = f10; + a10 = Rb(Gb().ab, H10()); + b10 = Rb(Gb().ab, H10()); + var g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()), l10 = Rb(Gb().ab, H10()), m10 = Rb(Gb().ab, H10()), p10 = Rb(Gb().ab, H10()), t10 = Rb(Gb().ab, H10()), v10 = Rb(Gb().ab, H10()), A10 = Rb(Gb().ab, H10()), D10 = Rb(Gb().ab, H10()), C10 = Rb(Gb().ab, H10()), I10 = Rb(Gb().ab, H10()), L10 = Rb(Gb().ab, H10()), Y10 = Rb(Gb().ab, H10()); + Lx.prototype.BU.call(this, c10, a10, b10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, e10, f10, Y10); + return this; + }; + function tqa(a10, b10) { + var c10 = a10.bG(), e10 = a10.wG(), f10 = a10.xB(), g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()); + c10 = new Jx().GU(g10, h10, c10, e10, f10); + Lx.prototype.fna.call(a10, b10, c10); + a10.os.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + l10.os = l10.os.cc(new R6().M(p10, m10)); + } else + throw new x7().d(m10); + }; + }(a10, c10))); + b10.os.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + l10.os = l10.os.cc(new R6().M(p10, m10)); + } else + throw new x7().d(m10); + }; + }(a10, c10))); + return c10; + } + function FOa(a10, b10, c10) { + a10 = a10.FT.Ja(b10); + return a10.b() ? y7() : a10.c().Ja(c10); + } + d7.wG = function() { + return this.iu; + }; + d7.bG = function() { + return this.AN; + }; + d7.$classData = r8({ iha: 0 }, false, "amf.plugins.document.webapi.parser.spec.RamlWebApiDeclarations", { iha: 1, QY: 1, hN: 1, f: 1 }); + function VW() { + } + VW.prototype = new u7(); + VW.prototype.constructor = VW; + VW.prototype.a = function() { + return this; + }; + function EFa(a10, b10, c10, e10, f10) { + c10 = c10.sb; + a10 = w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + var p10 = m10.Aa, t10 = bc(); + p10 = p10.Qp(t10).pk(); + p10.b() ? p10 = y7() : (p10 = p10.c(), p10 = new z7().d(p10.va)); + p10 = p10.b() ? m10.Aa.t() : p10.c(); + p10 = Lla(Px(), p10); + if (p10.b()) + m10 = y7(); + else { + t10 = p10.c(); + p10 = new WW(); + p10.Ri = t10; + p10.Wd = h10; + p10.tb = m10; + p10.Yk = k10; + p10.m = l10; + t10 = p10.Wd + "/extension/" + p10.Ri; + var v10 = p10.Wd + "/" + p10.Ri; + O7(); + var A10 = new P6().a(); + A10 = new Td().K(new S6().a(), A10); + t10 = Rd(A10, t10); + A10 = p10.tb.i; + var D10 = new z7().d(v10), C10 = new ox().a(), I10 = new Nd().a(); + A10 = px(A10, C10, D10, I10, p10.m).Fr(); + D10 = sha(p10.m.Dl(), p10.Ri); + D10.b() ? (D10 = Od(O7(), p10.tb), D10 = new Pd().K( + new S6().a(), + D10 + ), v10 = Rd(D10, v10), D10 = p10.Ri, O7(), C10 = new P6().a(), v10 = Sd(v10, D10, C10)) : v10 = D10.c(); + GOa(p10, v10); + HOa(t10, p10.Wd, J5(K7(), H10())); + D10 = Ud().zi; + A10 = Vd(t10, D10, A10); + p10 = p10.Ri; + D10 = Ud().R; + eb(A10, D10, p10); + Ui(t10.g, Ud().ig, v10, (O7(), new P6().a())); + m10 = Od(O7(), m10); + m10 = new z7().d(Db(t10, m10)); + } + return m10.ua(); + }; + }(a10, b10, e10, f10)); + b10 = rw(); + return c10.bd(a10, b10.sc); + } + VW.prototype.$classData = r8({ ALa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.AnnotationParser$", { ALa: 1, f: 1, q: 1, o: 1 }); + var IOa = void 0; + function FFa() { + IOa || (IOa = new VW().a()); + return IOa; + } + function XW() { + } + XW.prototype = new u7(); + XW.prototype.constructor = XW; + XW.prototype.a = function() { + return this; + }; + function hma(a10, b10, c10, e10, f10) { + a10 = new ox().a(); + return px(e10, a10, b10, c10, f10).Fr(); + } + XW.prototype.$classData = r8({ CLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.DataNodeParser$", { CLa: 1, f: 1, q: 1, o: 1 }); + var JOa = void 0; + function ima() { + JOa || (JOa = new XW().a()); + return JOa; + } + function YW() { + this.l = null; + } + YW.prototype = new u7(); + YW.prototype.constructor = YW; + YW.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "$ref"); + T6(); + var c10 = rA(), e10 = B6(this.l.kf.Y(), qf().R).A; + c10 = Fna(c10, e10.b() ? null : e10.c(), y7()); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + }; + YW.prototype.La = function() { + return ld(); + }; + YW.prototype.$classData = r8({ FLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.JsonSchemaEmitter$$anon$1", { FLa: 1, f: 1, db: 1, Ma: 1 }); + function ZW() { + } + ZW.prototype = new u7(); + ZW.prototype.constructor = ZW; + ZW.prototype.a = function() { + return this; + }; + ZW.prototype.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "$schema"); + T6(); + var c10 = mh(T6(), "http://json-schema.org/draft-04/schema#"); + sr(a10, b10, c10); + }; + ZW.prototype.La = function() { + return ld(); + }; + ZW.prototype.$classData = r8({ GLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.JsonSchemaEntry$", { GLa: 1, f: 1, db: 1, Ma: 1 }); + var KOa = void 0; + function $W() { + } + $W.prototype = new u7(); + $W.prototype.constructor = $W; + $W.prototype.a = function() { + return this; + }; + function LOa(a10, b10, c10, e10, f10) { + a10 = e10.Aa; + var g10 = bc(); + return MOa(new aX(), b10, c10, N6(a10, g10, f10).va, e10.i, f10); + } + $W.prototype.$classData = r8({ YLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AbstractDeclarationParser$", { YLa: 1, f: 1, q: 1, o: 1 }); + var NOa = void 0; + function OOa() { + NOa || (NOa = new $W().a()); + return NOa; + } + function lW() { + this.N = this.p = this.U9 = null; + } + lW.prototype = new u7(); + lW.prototype.constructor = lW; + function POa() { + } + POa.prototype = lW.prototype; + lW.prototype.Qa = function(a10) { + var b10 = new PA().e(a10.ca); + b10.fo(this.ve()); + var c10 = new PA().e(a10.ca), e10 = Vb().Ia(B6(this.U9.g, Ud().zi)); + e10.b() || (e10 = e10.c(), iy(new jy(), e10, this.p, false, Rb(Ut(), H10()), this.N.hj()).Ob(c10)); + b10 = xF(b10.s, 0); + sr(a10, b10, xF(c10.s, 0)); + }; + lW.prototype.HK = function(a10, b10, c10) { + this.U9 = a10; + this.p = b10; + this.N = c10; + return this; + }; + lW.prototype.La = function() { + return kr(wr(), this.U9.x, q5(jd)); + }; + function oW() { + this.Q = this.p = this.Ba = null; + } + oW.prototype = new u7(); + oW.prototype.constructor = oW; + function QOa() { + } + QOa.prototype = oW.prototype; + oW.prototype.dU = function(a10, b10, c10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + return this; + }; + oW.prototype.Qa = function(a10) { + T6(); + var b10 = this.kL(), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.wb, k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return oy(p10.bea(), t10, p10.p, p10.Q); + }; + }(this)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD( + wD(), + b10.s + )); + }; + oW.prototype.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + function bX() { + this.ofa = null; + } + bX.prototype = new u7(); + bX.prototype.constructor = bX; + function ROa(a10) { + var b10 = new bX(); + b10.ofa = a10; + return b10; + } + bX.prototype.Qa = function(a10) { + var b10 = mh(T6(), "@value"); + T6(); + var c10 = this.ofa.r; + c10 = mh(T6(), c10); + sr(a10, b10, c10); + }; + bX.prototype.La = function() { + var a10 = this.ofa; + return kr(wr(), a10.x, q5(jd)); + }; + bX.prototype.$classData = r8({ eMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataNodeEmitter$$anonfun$1$$anon$1", { eMa: 1, f: 1, db: 1, Ma: 1 }); + function cX() { + this.GM = null; + } + cX.prototype = new u7(); + cX.prototype.constructor = cX; + cX.prototype.Qa = function(a10) { + var b10 = mh(T6(), "@value"), c10 = new PA().e(a10.ca); + this.GM.Ob(c10); + var e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = b10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + function SOa(a10) { + var b10 = new cX(); + b10.GM = a10; + return b10; + } + cX.prototype.La = function() { + var a10 = this.GM; + return kr(wr(), a10.x, q5(jd)); + }; + cX.prototype.$classData = r8({ fMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataNodeEmitter$$anonfun$1$$anon$2", { fMa: 1, f: 1, db: 1, Ma: 1 }); + function Xw() { + this.N = this.Lv = null; + } + Xw.prototype = new u7(); + Xw.prototype.constructor = Xw; + function TOa() { + } + TOa.prototype = Xw.prototype; + Xw.prototype.Qa = function(a10) { + var b10 = this.N; + b10.zr = true; + this.tka(a10); + b10.zr = false; + }; + Xw.prototype.gma = function(a10, b10) { + this.Lv = a10; + this.N = b10; + }; + Xw.prototype.La = function() { + var a10 = this.Lv.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.fa(), q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + function dX() { + this.N = this.Q = this.p = this.Qf = this.la = null; + } + dX.prototype = new u7(); + dX.prototype.constructor = dX; + function UOa() { + } + UOa.prototype = dX.prototype; + dX.prototype.oK = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Xh().Tf); + c10.b() || (c10 = c10.c(), Dg(b10, new eX().Sq("headers", c10, this.p, this.Q, this.N))); + c10 = hd(a10, Xh().Tl); + c10.b() || (c10 = c10.c(), c10.r.r.wb.Da() && Dg(b10, new eX().Sq("queryParameters", c10, this.p, this.Q, this.N))); + a10 = hd(a10, Xh().Al); + a10.b() || (a10 = a10.c(), Dg(b10, VOa("responses", a10, this.p, this.Q, false, this.N))); + return b10; + }; + dX.prototype.Qa = function(a10) { + var b10 = this.oK(this.Qf.g); + if (b10.Da()) { + T6(); + var c10 = this.la, e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(b10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + dX.prototype.yU = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Qf = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + dX.prototype.La = function() { + var a10 = B6(this.Qf.g, Xh().Tf), b10 = B6(this.Qf.g, Xh().Tl), c10 = K7(); + a10 = a10.ia(b10, c10.u); + b10 = B6(this.Qf.g, Xh().Al); + c10 = K7(); + a10 = a10.ia(b10, c10.u).kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.fa(), q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + function iW() { + this.N = this.p = this.cea = null; + } + iW.prototype = new u7(); + iW.prototype.constructor = iW; + function WOa() { + } + WOa.prototype = iW.prototype; + iW.prototype.Qa = function(a10) { + var b10 = new PA().e(a10.ca); + b10.fo(this.ve()); + var c10 = new PA().e(a10.ca), e10 = Vb().Ia(B6(this.cea.g, Ud().zi)); + e10.b() || (e10 = e10.c(), iy(new jy(), e10, this.p, false, Rb(Ut(), H10()), this.N.hj()).Ob(c10)); + b10 = xF(b10.s, 0); + sr(a10, b10, xF(c10.s, 0)); + }; + iW.prototype.IK = function(a10, b10, c10) { + this.cea = a10; + this.p = b10; + this.N = c10; + return this; + }; + iW.prototype.La = function() { + return kr(wr(), this.cea.x, q5(jd)); + }; + function fX() { + } + fX.prototype = new u7(); + fX.prototype.constructor = fX; + fX.prototype.a = function() { + return this; + }; + function UGa(a10, b10, c10) { + a10 = new gX(); + a10.Rh = b10; + b10 = a10.Rh.i.hb().gb; + Q5().nd === b10 || Q5().sa === b10 || Q5().cd === b10 ? c10 = y7() : (b10 = a10.Rh.i, a10 = IO(), c10 = new z7().d(N6(b10, a10, c10).va)); + return c10; + } + fX.prototype.$classData = r8({ xMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.LibraryLocationParser$", { xMa: 1, f: 1, q: 1, o: 1 }); + var XOa = void 0; + function VGa() { + XOa || (XOa = new fX().a()); + return XOa; + } + function hX() { + zP.call(this); + } + hX.prototype = new OFa(); + hX.prototype.constructor = hX; + hX.prototype.$G = function(a10, b10) { + zP.prototype.fma.call(this, "oas2.0", a10, b10); + return this; + }; + hX.prototype.$classData = r8({ AMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OAS20SchemaVersion", { AMa: 1, CMa: 1, RY: 1, f: 1 }); + function Qy() { + zP.call(this); + } + Qy.prototype = new OFa(); + Qy.prototype.constructor = Qy; + Qy.prototype.$G = function(a10, b10) { + zP.prototype.fma.call(this, "oas3.0.0", a10, b10); + return this; + }; + Qy.prototype.$classData = r8({ BMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OAS30SchemaVersion", { BMa: 1, CMa: 1, RY: 1, f: 1 }); + function iX() { + } + iX.prototype = new u7(); + iX.prototype.constructor = iX; + iX.prototype.a = function() { + return this; + }; + function jma(a10, b10, c10, e10) { + T6(); + a10 = qc(); + b10 = N6(b10, a10, e10); + T6(); + return YOa(new jX(), mr(T6(), b10, Q5().sa), c10, e10).BH(); + } + iX.prototype.$classData = r8({ UMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasCreativeWorkParser$", { UMa: 1, f: 1, q: 1, o: 1 }); + var ZOa = void 0; + function kma() { + ZOa || (ZOa = new iX().a()); + return ZOa; + } + function kX() { + } + kX.prototype = new u7(); + kX.prototype.constructor = kX; + kX.prototype.a = function() { + return this; + }; + function $Oa(a10, b10, c10, e10, f10) { + ue4(); + a10 = new ye4().d(b10); + var g10 = qc(); + return lX(new mX(), a10, c10, N6(b10, g10, f10), e10, new hX().$G("schema", f10), f10); + } + function aPa(a10, b10, c10, e10, f10, g10) { + ue4(); + a10 = new ye4().d(b10); + var h10 = qc(); + return lX(new mX(), a10, c10, N6(b10, h10, g10), e10, f10, g10); + } + function nX(a10, b10, c10, e10, f10) { + ue4(); + a10 = new ve4().d(b10); + var g10 = b10.Aa, h10 = Dd(); + g10 = N6(g10, h10, f10); + b10 = b10.i; + h10 = qc(); + return lX(new mX(), a10, g10, N6(b10, h10, f10), c10, e10, f10); + } + function oX(a10, b10, c10, e10) { + ue4(); + a10 = new ve4().d(b10); + var f10 = b10.Aa, g10 = bc(); + f10 = N6(f10, g10, e10).va; + b10 = b10.i; + g10 = qc(); + b10 = N6(b10, g10, e10); + g10 = e10.Gg(); + var h10 = Xq().Cp; + return lX(new mX(), a10, f10, b10, c10, g10 === h10 ? new Qy().$G("schema", e10) : new hX().$G("schema", e10), e10); + } + kX.prototype.$classData = r8({ LNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$", { LNa: 1, f: 1, q: 1, o: 1 }); + var bPa = void 0; + function pX() { + bPa || (bPa = new kX().a()); + return bPa; + } + function qX() { + this.u$ = this.l = null; + } + qX.prototype = new u7(); + qX.prototype.constructor = qX; + qX.prototype.Qa = function(a10) { + var b10 = cPa(dPa(), this.u$, this.l.p, H10(), this.l.jw); + T6(); + var c10 = mh(T6(), "schema"), e10 = new PA().e(a10.ca); + b10.Ob(e10); + b10 = e10.s; + c10 = [c10]; + if (0 > b10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = b10.w + f10 | 0; + uD(b10, g10); + Ba(b10.L, 0, b10.L, f10, b10.w); + f10 = b10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = g10; + pr(a10.s, vD(wD(), e10.s)); + }; + qX.prototype.La = function() { + return kr(wr(), this.u$.fa(), q5(jd)); + }; + qX.prototype.$classData = r8({ pOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeEmitter$$anon$2", { pOa: 1, f: 1, db: 1, Ma: 1 }); + function rX() { + this.qfa = this.l = null; + } + rX.prototype = new u7(); + rX.prototype.constructor = rX; + rX.prototype.Ob = function(a10) { + var b10 = a10.s, c10 = a10.ca; + a10 = new PA().e(c10); + var e10 = B6(this.qfa.aa, xn().Le), f10 = new ePa(), g10 = K7(); + e10.ec(f10, g10.u).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + cPa(dPa(), l10, h10.l.p, J5(K7(), H10()), h10.l.jw).Ob(k10); + }; + }(this, a10))); + T6(); + eE(); + c10 = SA(zs(), c10); + a10 = mr(0, new Sx().Ac(c10, a10.s), Q5().cd); + pr(b10, a10); + }; + function fPa(a10, b10) { + var c10 = new rX(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + c10.qfa = b10; + return c10; + } + rX.prototype.La = function() { + return kr(wr(), this.qfa.Xa, q5(jd)); + }; + rX.prototype.$classData = r8({ qOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeEmitter$$anon$3", { qOa: 1, f: 1, wh: 1, Ma: 1 }); + function sX() { + } + sX.prototype = new u7(); + sX.prototype.constructor = sX; + sX.prototype.a = function() { + return this; + }; + function wW(a10, b10, c10, e10, f10, g10) { + return new tX().HB((ue4(), new ve4().d(b10)), b10.Aa, c10, RW(e10, false), f10, new uB().il(g10.qh, g10.Df, g10, new z7().d(g10.pe()), y7(), y7(), iA().ho)); + } + function gPa(a10, b10, c10, e10, f10, g10) { + ue4(); + a10 = new ye4().d(b10); + T6(); + c10 = mh(T6(), c10); + b10 = RW(false, false); + var h10 = g10.qh, k10 = g10.Df, l10 = new z7().d(g10.pe()), m10 = g10.iv, p10 = y7(), t10 = y7(); + return new tX().HB(a10, c10, e10, b10, f10, new uB().il(h10, k10, g10, l10, p10, t10, m10)); + } + sX.prototype.$classData = r8({ uOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeParser$", { uOa: 1, f: 1, q: 1, o: 1 }); + var hPa = void 0; + function xW() { + hPa || (hPa = new sX().a()); + return hPa; + } + function uX() { + } + uX.prototype = new u7(); + uX.prototype.constructor = uX; + uX.prototype.a = function() { + return this; + }; + function cPa(a10, b10, c10, e10, f10) { + return new bW().Cr(b10, c10, y7(), J5(K7(), H10()), J5(K7(), H10()), f10); + } + uX.prototype.$classData = r8({ zOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypePartEmitter$", { zOa: 1, f: 1, q: 1, o: 1 }); + var iPa = void 0; + function dPa() { + iPa || (iPa = new uX().a()); + return iPa; + } + function vX() { + this.pfa = null; + } + vX.prototype = new u7(); + vX.prototype.constructor = vX; + vX.prototype.Qa = function(a10) { + var b10 = mh(T6(), "type"), c10 = new PA().e(a10.ca); + this.pfa.Ob(c10); + var e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = b10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + vX.prototype.La = function() { + return this.pfa.La(); + }; + vX.prototype.$classData = r8({ HOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeEmitter$$anonfun$entries$1$$anon$1", { HOa: 1, f: 1, db: 1, Ma: 1 }); + function wX() { + } + wX.prototype = new u7(); + wX.prototype.constructor = wX; + wX.prototype.a = function() { + return this; + }; + function jPa(a10, b10, c10, e10, f10) { + return new xX().HB((ue4(), new ye4().d(a10)), (T6(), mh(T6(), b10)), c10, RW(false, false), e10, f10); + } + function PW(a10, b10, c10, e10, f10, g10) { + return new xX().HB((ue4(), new ve4().d(b10)), b10.Aa, c10, e10, f10, new hA().il(g10.qh, g10.Df, g10, new z7().d(g10.pe()), new z7().d(g10.lj), g10.Hp(), g10.iv)); + } + wX.prototype.$classData = r8({ JOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeParser$", { JOa: 1, f: 1, q: 1, o: 1 }); + var HPa = void 0; + function QW() { + HPa || (HPa = new wX().a()); + return HPa; + } + function yX() { + Yy.call(this); + this.KW = this.sd = this.Gb = this.Ka = this.gg = null; + } + yX.prototype = new xma(); + yX.prototype.constructor = yX; + function zX() { + } + zX.prototype = yX.prototype; + yX.prototype.pC = function() { + return this.KW; + }; + yX.prototype.Pa = function() { + var a10 = J5(Ef(), Yy.prototype.Pa.call(this)); + gca(this, this.gg, a10, this.Ka, this.Gb, this.sd); + return a10; + }; + yX.prototype.Vx = function(a10, b10, c10, e10) { + this.gg = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + Yy.prototype.DB.call(this, a10, b10, c10, e10); + this.KW = new z7().d("any"); + return this; + }; + yX.prototype.$classData = r8({ fD: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnyShapeEmitter", { fD: 1, gD: 1, f: 1, Vy: 1 }); + function AX() { + Yy.call(this); + this.KW = this.sd = this.Gb = this.Ka = this.gg = null; + } + AX.prototype = new xma(); + AX.prototype.constructor = AX; + AX.prototype.pC = function() { + return this.KW; + }; + AX.prototype.Pa = function() { + var a10 = J5(Ef(), Yy.prototype.Pa.call(this)); + gca(this, this.gg, a10, this.Ka, this.Gb, this.sd); + if (!this.EA) { + var b10 = cx(new dx(), "type", "any", Q5().Na, ld()), c10 = K7(); + ws(a10, J5(c10, new Ib().ha([b10]))); + } + return a10; + }; + AX.prototype.Vx = function(a10, b10, c10, e10) { + this.gg = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + Yy.prototype.DB.call(this, a10, b10, c10, e10); + this.KW = new z7().d("any"); + return this; + }; + AX.prototype.$classData = r8({ QOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnyShapeInstanceEmitter", { QOa: 1, gD: 1, f: 1, Vy: 1 }); + function BX() { + this.N = this.p = this.Q = this.Qf = null; + } + BX.prototype = new u7(); + BX.prototype.constructor = BX; + function IPa() { + } + d7 = IPa.prototype = BX.prototype; + d7.Qa = function(a10) { + var b10 = B6(this.Qf.g, Xh().R).A; + if (b10.b()) + throw mb(E6(), new nb().e("Cannot declare security scheme without name " + this.Qf)); + b10 = b10.c(); + T6(); + var c10 = mh(T6(), b10), e10 = Za(this.Qf).na() ? /* @__PURE__ */ function(p10) { + return function(t10) { + p10.hK(t10); + }; + }(this) : /* @__PURE__ */ function(p10) { + return function(t10) { + p10.gK(t10); + }; + }(this); + b10 = new PA().e(a10.ca); + e10(b10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.hK = function(a10) { + var b10 = Za(this.Qf); + b10.b() || (b10 = b10.c(), qka(b10, B6(this.Qf.g, db().ed).A, this.Q, this.N).Ob(a10)); + }; + d7.gK = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + jr(wr(), this.p.zb(oy(this.Lpa(), this.Qf, this.Q, this.p).Pa()), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.cA = function(a10, b10, c10, e10) { + this.Qf = a10; + this.Q = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Qf.x, q5(jd)); + }; + function Dma() { + this.l = null; + } + Dma.prototype = new u7(); + Dma.prototype.constructor = Dma; + Dma.prototype.$classData = r8({ VPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetector$ShapeClassTypeDefMatcher$InheritsUnionMatcher$", { VPa: 1, f: 1, q: 1, o: 1 }); + function CX() { + this.tw = this.p = this.pa = null; + } + CX.prototype = new u7(); + CX.prototype.constructor = CX; + function JPa() { + } + JPa.prototype = CX.prototype; + CX.prototype.Ob = function(a10) { + if (Vb().Ia(this.pa).na() && wh(this.pa.fa(), q5(IR))) + lr(wr(), a10, "", Q5().nd); + else { + var b10 = this.tw; + if (b10 instanceof ve4) + b10.i.Ob(a10); + else if (b10 instanceof ye4) { + b10 = b10.i; + var c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } else + throw new x7().d(b10); + } + }; + CX.prototype.fla = function(a10, b10, c10) { + this.pa = a10; + this.p = b10; + b10 = this.Pa(); + a: { + K7(); + var e10 = new z7().d(b10); + if (null !== e10.i && 0 === e10.i.Oe(1) && (e10 = e10.i.lb(0), zr(e10))) { + ue4(); + a10 = new ve4().d(e10); + break a; + } + if (b10.oh(w6(/* @__PURE__ */ function() { + return function(k10) { + return yr(k10); + }; + }(this)))) + ue4(), a10 = new KPa(), c10 = K7(), a10 = b10.ec(a10, c10.u), a10 = new ye4().d(a10); + else { + c10 = c10.hj(); + e10 = dc().Fh; + var f10 = a10.j, g10 = y7(); + b10 = "IllegalTypeDeclarations found: " + b10; + var h10 = Ab(a10.fa(), q5(jd)); + a10 = a10.Ib(); + c10.Gc(e10.j, f10, g10, b10, h10, Yb().qb, a10); + ue4(); + a10 = H10(); + a10 = new ye4().d(a10); + } + } + this.tw = a10; + }; + CX.prototype.La = function() { + var a10 = this.Pa().kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.La())); + return a10.b() ? ld() : a10.c(); + }; + function DX() { + } + DX.prototype = new u7(); + DX.prototype.constructor = DX; + DX.prototype.a = function() { + return this; + }; + function LPa(a10) { + var b10 = Rb(Ut(), H10()), c10 = new EX(); + c10.Q = b10; + c10.m = a10; + return c10; + } + DX.prototype.$classData = r8({ vQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ReferenceDeclarations$", { vQa: 1, f: 1, q: 1, o: 1 }); + var MPa = void 0; + function Hy() { + } + Hy.prototype = new u7(); + Hy.prototype.constructor = Hy; + Hy.prototype.a = function() { + return this; + }; + Hy.prototype.$classData = r8({ MQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.XMLSerializerParser$", { MQa: 1, f: 1, q: 1, o: 1 }); + var lma = void 0; + function FX() { + } + FX.prototype = new u7(); + FX.prototype.constructor = FX; + FX.prototype.a = function() { + return this; + }; + function NPa(a10, b10, c10) { + a10 = ac(new M6().W(b10), "explode"); + if (a10 instanceof z7) { + a10 = a10.i; + c10 = c10.g; + b10 = cj().Vu; + var e10 = a10.i, f10 = pM(), g10 = cc().bi; + Ui(c10, b10, ih(new jh(), N6(e10, f10, g10), new P6().a()), Od(O7(), a10).Lb(new xi().a())); + } else if (y7() === a10) + a10 = B6(c10.g, cj().Yt).A, a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d("form" === a10)), a10.b() || (a10 = !!a10.c(), b10 = cj().Vu, Bi(c10, b10, a10)); + else + throw new x7().d(a10); + } + function OPa(a10, b10, c10) { + a10 = ac(new M6().W(b10), "style"); + if (a10 instanceof z7) { + a10 = a10.i; + c10 = c10.g; + b10 = cj().Yt; + var e10 = a10.i, f10 = Dd(), g10 = cc().bi; + Ui(c10, b10, ih(new jh(), N6(e10, f10, g10), new P6().a()), Od(O7(), a10).Lb(new xi().a())); + } else if (y7() === a10) + a10 = B6(c10.g, cj().We).A, b10 = a10 instanceof z7 && "query" === a10.i ? true : a10 instanceof z7 && "cookie" === a10.i ? true : false, b10 ? a10 = new z7().d("form") : (a10 = a10 instanceof z7 && "path" === a10.i ? true : a10 instanceof z7 && "header" === a10.i ? true : false, a10 = a10 ? new z7().d("simple") : y7()), a10.b() || (a10 = a10.c(), b10 = cj().Yt, eb(c10, b10, a10)); + else + throw new x7().d(a10); + } + function PPa(a10, b10, c10, e10) { + a10 = ac(new M6().W(b10), "schema"); + b10 = ac(new M6().W(b10), "content"); + if (a10 instanceof z7 && b10 instanceof z7 || y7() === a10 && y7() === b10) + b10 = sg().Q7, yB(e10, b10, c10.j, "Parameter must define a 'schema' or 'content' field, but not both", c10.x); + } + FX.prototype.$classData = r8({ hRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ParameterParser$", { hRa: 1, f: 1, q: 1, o: 1 }); + var QPa = void 0; + function GX() { + QPa || (QPa = new FX().a()); + return QPa; + } + function HX() { + } + HX.prototype = new u7(); + HX.prototype.constructor = HX; + HX.prototype.a = function() { + return this; + }; + function RPa(a10, b10, c10, e10, f10) { + var g10 = b10.g; + a10 = J5(Ef(), H10()); + var h10 = hd(g10, An().RF); + h10.b() || (h10 = h10.c(), new z7().d(Dg(a10, $g(new ah(), "operationId", h10, y7())))); + h10 = hd(g10, An().pN); + h10.b() || (h10 = h10.c(), new z7().d(Dg(a10, $g(new ah(), "operationRef", h10, y7())))); + h10 = hd(g10, An().Va); + h10.b() || (h10 = h10.c(), new z7().d(Dg(a10, $g(new ah(), "description", h10, y7())))); + h10 = hd(g10, An().kD); + h10.b() || (h10.c(), Dg(a10, new IX().Jw(B6(b10.g, An().kD), c10, e10, f10))); + e10 = hd(g10, An().WF); + e10.b() || (e10.c(), e10 = new JX(), h10 = B6(b10.g, An().WF), e10.XH = h10, e10.p = c10, e10.N = f10, wr(), b10 = B6(b10.g, An().WF).x, b10 = kr(0, b10, q5(jd)), c10 = Q5().Na, new z7().d(Dg( + a10, + ky("server", e10, c10, b10) + ))); + g10 = hd(g10, An().VF); + g10.b() || (g10 = g10.c(), new z7().d(Dg(a10, $g(new ah(), "requestBody", g10, y7())))); + return a10; + } + HX.prototype.$classData = r8({ yRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasLinkEmitter$", { yRa: 1, f: 1, q: 1, o: 1 }); + var SPa = void 0; + function TPa() { + SPa || (SPa = new HX().a()); + return SPa; + } + function KX() { + } + KX.prototype = new u7(); + KX.prototype.constructor = KX; + KX.prototype.a = function() { + return this; + }; + function UPa(a10, b10) { + var c10 = b10.Fb(w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = B6(e10.g, xm().Nd); + return oN(e10); + }; + }(a10))); + a10 = c10.b() ? b10.Fb(w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = B6(e10.g, xm().Nd); + return xb(e10, "application/json"); + }; + }(a10))) : c10; + return a10.b() ? b10.kc() : a10; + } + function VPa(a10, b10) { + b10 = b10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return !wh(f10.x, q5(WPa)); + }; + }(a10))); + var c10 = b10.Fb(w6(/* @__PURE__ */ function() { + return function(f10) { + return wh(f10.x, q5(XPa)); + }; + }(a10))); + c10 = new qd().d(c10); + var e10 = c10.oa; + e10 = e10.b() ? UPa(YPa(), b10) : e10; + c10.oa = e10; + return new LX().WO(c10.oa, b10.Cb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = g10.oa; + k10 = k10.b() ? null : k10.c(); + return !(null === h10 ? null === k10 : h10.h(k10)); + }; + }(a10, c10)))); + } + KX.prototype.$classData = r8({ MRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasPayloads$", { MRa: 1, f: 1, q: 1, o: 1 }); + var ZPa = void 0; + function YPa() { + ZPa || (ZPa = new KX().a()); + return ZPa; + } + function MX() { + } + MX.prototype = new u7(); + MX.prototype.constructor = MX; + MX.prototype.a = function() { + return this; + }; + function $Pa(a10, b10, c10, e10, f10) { + a10 = c10.r.r.wb; + c10 = new aQa().a(); + var g10 = K7(); + return new NX().eA(b10, a10.ec(c10, g10.u), e10, f10); + } + MX.prototype.$classData = r8({ SRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExamplesEmitter$", { SRa: 1, f: 1, q: 1, o: 1 }); + var bQa = void 0; + function cQa() { + bQa || (bQa = new MX().a()); + return bQa; + } + function OX() { + } + OX.prototype = new u7(); + OX.prototype.constructor = OX; + OX.prototype.a = function() { + return this; + }; + function EIa(a10, b10, c10, e10) { + var f10 = H10(); + f10 = new qd().d(f10); + var g10 = H10(); + g10 = new qd().d(g10); + c10.Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, cj().We); + return xb(h10, "path"); + }; + }(a10))).U(w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + var t10 = B6(p10.g, cj().R).A; + t10 = "{" + (t10.b() ? null : t10.c()) + "}"; + if (-1 !== (k10.indexOf(t10) | 0)) { + t10 = l10.oa; + p10 = J5(K7(), new Ib().ha([p10])); + var v10 = K7(); + l10.oa = t10.ia(p10, v10.u); + } else + t10 = m10.oa, p10 = J5(K7(), new Ib().ha([p10])), v10 = K7(), m10.oa = t10.ia(p10, v10.u); + }; + }(a10, b10, g10, f10))); + return bQ( + new cQ(), + c10.Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, cj().We); + return xb(h10, "query"); + }; + }(a10))), + g10.oa, + c10.Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, cj().We); + return xb(h10, "header"); + }; + }(a10))), + c10.Cb(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, cj().We); + return xb(h10, "cookie"); + }; + }(a10))), + f10.oa, + e10 + ); + } + OX.prototype.$classData = r8({ hSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Parameters$", { hSa: 1, f: 1, q: 1, o: 1 }); + var dQa = void 0; + function CIa() { + dQa || (dQa = new OX().a()); + return dQa; + } + function PX() { + } + PX.prototype = new u7(); + PX.prototype.constructor = PX; + PX.prototype.a = function() { + return this; + }; + function tGa(a10, b10, c10, e10) { + return ina(jna(new Uz(), c10, b10, Uc(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10, l10) { + return kna(g10.Dl(), h10, k10, l10); + }; + }(a10, e10, c10)), e10)); + } + PX.prototype.$classData = r8({ jSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ParametrizedDeclarationParser$", { jSa: 1, f: 1, q: 1, o: 1 }); + var eQa = void 0; + function uGa() { + eQa || (eQa = new PX().a()); + return eQa; + } + function fQa() { + } + fQa.prototype = new u7(); + fQa.prototype.constructor = fQa; + function gQa() { + } + gQa.prototype = fQa.prototype; + function QX() { + this.GM = null; + } + QX.prototype = new u7(); + QX.prototype.constructor = QX; + QX.prototype.Qa = function(a10) { + var b10 = mh(T6(), "schema"), c10 = new PA().e(a10.ca); + this.GM.Ob(c10); + var e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = b10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + QX.prototype.La = function() { + return this.GM.La(); + }; + QX.prototype.$classData = r8({ rSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08ParameterEmitter$$anon$1", { rSa: 1, f: 1, db: 1, Ma: 1 }); + function RX() { + this.l = null; + } + RX.prototype = new u7(); + RX.prototype.constructor = RX; + RX.prototype.Qa = function(a10) { + var b10 = this.l.Dea; + if (b10.Da()) { + T6(); + var c10 = B6(this.l.le.g, xm().Nd).A; + c10 = c10.b() ? null : c10.c(); + var e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + a: { + K7(); + var f10 = new z7().d(b10); + if (null !== f10.i && 0 === f10.i.Oe(1) && (f10 = f10.i.lb(0), zr(f10))) { + f10.Ob(c10); + break a; + } + if (b10.oh(w6(/* @__PURE__ */ function() { + return function(t10) { + return yr(t10); + }; + }(this)))) { + f10 = c10.s; + var g10 = c10.ca, h10 = new rr().e(g10), k10 = wr(), l10 = this.l.p, m10 = new hQa(), p10 = K7(); + jr(k10, l10.zb(b10.ec(m10, p10.u)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else + f10 = this.l.Iia.Bc, g10 = dc().Fh, h10 = this.l.le.j, k10 = y7(), b10 = "IllegalTypeDeclarations found: " + b10, l10 = Ab(this.l.le.x, q5(jd)), m10 = yb(this.l.le), f10.Gc(g10.j, h10, k10, b10, l10, Yb().qb, m10); + } + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } else { + T6(); + c10 = B6(this.l.le.g, xm().Nd).A; + c10 = c10.b() ? null : c10.c(); + b10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + lr(wr(), c10, "", Q5().nd); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + RX.prototype.naa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + RX.prototype.La = function() { + return kr(wr(), this.l.le.x, q5(jd)); + }; + RX.prototype.$classData = r8({ uSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadEmitter$$anon$1", { uSa: 1, f: 1, db: 1, Ma: 1 }); + function SX() { + } + SX.prototype = new u7(); + SX.prototype.constructor = SX; + SX.prototype.Ob = function(a10) { + T6(); + var b10 = ur().ce; + b10 = mr(T6(), b10, Q5().sa); + pr(a10.s, b10); + }; + SX.prototype.naa = function() { + return this; + }; + SX.prototype.La = function() { + return ld(); + }; + SX.prototype.$classData = r8({ wSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadEmitter$$anon$2", { wSa: 1, f: 1, wh: 1, Ma: 1 }); + function TX() { + this.N = this.Q = this.Xf = this.p = null; + } + TX.prototype = new u7(); + TX.prototype.constructor = TX; + function iQa() { + } + iQa.prototype = TX.prototype; + TX.prototype.Qa = function(a10) { + var b10 = this.uk.g, c10 = new PA().e(a10.ca), e10 = UX(this.uk); + if (e10 instanceof z7) + hV(new iV(), ih(new jh(), jQa(this.uk), new P6().a()), Q5().Na).Ob(c10); + else if (y7() === e10) + e10 = hd(b10, Jl().Uf).c(), hV(new iV(), e10.r.r, Q5().Na).Ob(c10); + else + throw new x7().d(e10); + e10 = new PA().e(a10.ca); + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(this.RD(b10)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = xF(c10.s, 0); + sr(a10, b10, xF(e10.s, 0)); + }; + TX.prototype.dla = function(a10, b10, c10, e10) { + this.p = a10; + this.Xf = b10; + this.Q = c10; + this.N = e10; + }; + TX.prototype.RD = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Jl().R); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "displayName", c10, y7(), this.N)))); + c10 = hd(a10, Jl().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "description", c10, y7(), this.N)))); + c10 = hd(a10, Jl().Ni()); + c10.b() || (c10 = c10.c(), new z7().d(ws(b10, kQa(c10, this.p, false, this.N.Bc).Pa()))); + c10 = hd(a10, Jl().bk); + c10.b() || (c10 = c10.c(), new z7().d(ws(b10, lQa(this, c10, this.p)))); + a10 = hd(a10, Jl().dc); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, new VX().hE("securedBy", a10, this.p, this.N)))); + ws(b10, ay(this.uk, this.p, this.N).Pa()); + ws( + b10, + this.Xf + ); + return b10; + }; + function lQa(a10, b10, c10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return oy(e10.N.zf.Ina(), g10, f10, e10.Q); + }; + }(a10, c10)); + c10 = K7(); + return b10.ka(a10, c10.u); + } + TX.prototype.La = function() { + return kr(wr(), this.uk.x, q5(jd)); + }; + function WX() { + this.N = this.Q = this.p = this.Kl = null; + } + WX.prototype = new u7(); + WX.prototype.constructor = WX; + function mQa() { + } + mQa.prototype = WX.prototype; + WX.prototype.oK = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Pl().R); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "displayName", c10, y7())))); + c10 = hd(a10, Pl().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "description", c10, y7(), this.N)))); + c10 = hd(a10, Pl().uh); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), fh(new je4().e("oasDeprecated")), c10, y7())))); + c10 = hd(a10, Pl().ck); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), fh(new je4().e("summary")), c10, y7())))); + c10 = hd(a10, Pl().Xm); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new XX().eA( + fh(new je4().e("tags")), + c10.r.r.wb, + this.p, + this.N + )))); + c10 = hd(a10, Pl().Sf); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, ly(fh(new je4().e("externalDocs")), c10.r.r, this.p, this.N)))); + c10 = hd(a10, Pl().Gh); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $x("protocols", c10, this.p, false)))); + c10 = hd(a10, Pl().Wp); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $x(fh(new je4().e("consumes")), c10, this.p, false)))); + c10 = hd(a10, Pl().yl); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $x(fh(new je4().e("produces")), c10, this.p, false)))); + c10 = hd(a10, nc().Ni()); + c10.b() || (c10 = c10.c(), new z7().d(ws(b10, kQa(c10, this.p, false, this.N.Bc).Pa()))); + c10 = Vb().Ia(AD(this.Kl)); + if (!c10.b()) { + c10 = c10.c().g; + var e10 = hd(c10, Am().Tl); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, new eX().Sq("queryParameters", e10, this.p, this.Q, this.N)))); + e10 = hd(c10, Am().Tf); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, new eX().Sq("headers", e10, this.p, this.Q, this.N)))); + e10 = hd(c10, Am().Ne); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, this.N.zf.Jca().du("body", e10, this.p, this.Q)))); + c10 = hd(c10, Am().Zo); + c10.b() || (c10 = c10.c(), new z7().d(c10.r.r.wb.Od(w6(/* @__PURE__ */ function() { + return function(g10) { + return !wh(g10.fa(), q5(IR)); + }; + }(this))) ? Dg(b10, new eX().Sq(this.U_, c10, this.p, this.Q, this.N)) : void 0)); + } + c10 = hd(a10, Pl().Al); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, VOa("responses", c10, this.p, this.Q, false, this.N)))); + c10 = hd(a10, Pl().Al); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, VOa(fh(new je4().e("defaultResponse")), c10, this.p, this.Q, true, this.N)))); + a10 = hd(a10, Pl().dc); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, new VX().hE("securedBy", a10, this.p, this.N)))); + a10 = this.Kl.g.vb; + c10 = mz(); + c10 = Ua(c10); + e10 = Id().u; + a10 = Jd(a10, c10, e10).Fb(w6(/* @__PURE__ */ function() { + return function(g10) { + g10 = g10.Lc; + var h10 = Pl().AF; + return null === g10 ? null === h10 : g10.h(h10); + }; + }(this))); + if (!a10.b()) { + c10 = a10.c(); + a10 = YX(c10); + c10 = c10.r.x; + e10 = fh(new je4().e("callbacks")); + var f10 = this.N; + Dg( + b10, + ky(e10, new ZX().kE(a10, this.p, this.Q, c10, new YV().Ti(f10.Bc, f10.oy, new Yf().a())), Q5().Na, ld()) + ); + } + return b10; + }; + WX.prototype.Qa = function(a10) { + var b10 = this.Kl.g, c10 = new PA().e(a10.ca), e10 = hd(b10, Pl().pm).c(); + hV(new iV(), e10.r.r, Q5().Na).Ob(c10); + e10 = new PA().e(a10.ca); + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(this.oK(b10)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = xF(c10.s, 0); + sr(a10, b10, xF(e10.s, 0)); + }; + WX.prototype.XK = function(a10, b10, c10, e10) { + this.Kl = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + WX.prototype.La = function() { + return kr(wr(), this.Kl.x, q5(jd)); + }; + function $X() { + this.N = this.Q = this.Wi = null; + } + $X.prototype = new u7(); + $X.prototype.constructor = $X; + function nQa() { + } + nQa.prototype = $X.prototype; + $X.prototype.Qa = function(a10) { + Za(this.Wi).na() ? this.$9(a10) : this.s0(a10); + }; + $X.prototype.Ala = function(a10, b10, c10) { + this.Wi = a10; + this.Q = b10; + this.N = c10; + }; + $X.prototype.La = function() { + return kr(wr(), this.Wi.x, q5(jd)); + }; + $X.prototype.$9 = function(a10) { + var b10 = Za(this.Wi).c().Y(), c10 = new PA().e(a10.ca); + this.iK(b10, c10); + b10 = new PA().e(a10.ca); + var e10 = Za(this.Wi); + e10.b() || (e10 = e10.c(), oy(this.N.zf.eF(), e10, B6(this.Wi.g, db().ed).A, this.Q).Ob(b10)); + c10 = xF(c10.s, 0); + sr(a10, c10, xF(b10.s, 0)); + }; + function aY() { + this.kd = this.m = null; + } + aY.prototype = new u7(); + aY.prototype.constructor = aY; + function oQa() { + } + oQa.prototype = aY.prototype; + aY.prototype.ema = function(a10) { + this.m = a10; + }; + aY.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function bY() { + this.N = this.Q = this.p = this.lp = null; + } + bY.prototype = new u7(); + bY.prototype.constructor = bY; + function pQa() { + } + pQa.prototype = bY.prototype; + bY.prototype.Qa = function(a10) { + var b10 = this.lp.g, c10 = new PA().e(a10.ca), e10 = hd(b10, Dm().In).c(); + hV(new iV(), e10.r.r, Q5().Na).Ob(c10); + e10 = new PA().e(a10.ca); + if (Za(this.lp).na()) + this.N.rL(this.lp).Ob(e10); + else { + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(this.RD(b10)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + b10 = xF(c10.s, 0); + sr(a10, b10, xF(e10.s, 0)); + }; + bY.prototype.MO = function(a10, b10, c10, e10) { + this.lp = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + bY.prototype.RD = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Dm().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "description", c10, y7(), this.N)))); + c10 = hd(a10, Am().Tf); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new eX().Sq("headers", c10, this.p, this.Q, this.N)))); + a10 = hd(a10, Am().Ne); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, this.N.zf.Jca().du("body", a10, this.p, this.Q)))); + return b10; + }; + bY.prototype.La = function() { + return kr(wr(), this.lp.x, q5(jd)); + }; + function cY() { + } + cY.prototype = new u7(); + cY.prototype.constructor = cY; + cY.prototype.a = function() { + return this; + }; + cY.prototype.$classData = r8({ sTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSecurityRequirementParser$", { sTa: 1, f: 1, q: 1, o: 1 }); + var qQa = void 0; + function wGa() { + qQa || (qQa = new cY().a()); + } + function dY() { + } + dY.prototype = new u7(); + dY.prototype.constructor = dY; + dY.prototype.a = function() { + return this; + }; + dY.prototype.$classData = r8({ uTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSecuritySettingsParser$", { uTa: 1, f: 1, q: 1, o: 1 }); + var rQa = void 0; + function sQa() { + } + sQa.prototype = new u7(); + sQa.prototype.constructor = sQa; + function tQa() { + } + tQa.prototype = sQa.prototype; + function eY() { + } + eY.prototype = new u7(); + eY.prototype.constructor = eY; + eY.prototype.a = function() { + return this; + }; + function uQa(a10, b10) { + b10 = YX(b10).Dm(w6(/* @__PURE__ */ function() { + return function(c10) { + return Ab(c10.x, q5(IR)).na(); + }; + }(a10))); + if (null === b10) + throw new x7().d(b10); + a10 = b10.ma(); + b10 = b10.ya(); + return new fY().WO(a10.kc(), b10); + } + function vQa(a10, b10) { + var c10 = new Ej().a(); + try { + var e10 = B6(b10.g, cj().Jc); + if (e10 instanceof Mh) { + var f10 = K7(), g10 = [qf().R, qf().Mh, qf().$j, qf().ch, Fg().af, qf().Va], h10 = J5(f10, new Ib().ha(g10)); + e10.aa.vb.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + if (null !== p10) { + if (!l10.Ha(p10.ma())) + throw wQa(m10); + } else + throw new x7().d(p10); + }; + }(a10, h10, c10))); + return true; + } + return false; + } catch (k10) { + if (k10 instanceof nz) { + a10 = k10; + if (a10.Aa === c10) + return a10.Oea(); + throw a10; + } + throw k10; + } + } + eY.prototype.$classData = r8({ DTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Servers$", { DTa: 1, f: 1, q: 1, o: 1 }); + var xQa = void 0; + function yQa() { + xQa || (xQa = new eY().a()); + return xQa; + } + function zQa() { + this.l = null; + } + zQa.prototype = new u7(); + zQa.prototype.constructor = zQa; + zQa.prototype.$classData = r8({ MTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.AccessibleOasDocumentEmitters$EndPointEmitter$", { MTa: 1, f: 1, q: 1, o: 1 }); + function gY() { + } + gY.prototype = new u7(); + gY.prototype.constructor = gY; + gY.prototype.a = function() { + return this; + }; + function AQa(a10, b10, c10, e10, f10) { + var g10 = b10.g, h10 = J5(Ef(), H10()), k10 = hd(g10, Am().Va); + k10.b() || (k10 = k10.c(), new z7().d(Dg(h10, $g(new ah(), "description", k10, y7())))); + g10 = hd(g10, Am().yj); + g10.b() || (g10 = g10.c(), new z7().d(Dg(h10, $g(new ah(), "required", g10, y7())))); + b10 = b10.g.vb; + g10 = mz(); + g10 = Ua(g10); + k10 = Id().u; + a10 = Jd(b10, g10, k10).Fb(w6(/* @__PURE__ */ function() { + return function(l10) { + l10 = l10.Lc; + var m10 = Am().Ne; + return null === l10 ? null === m10 : l10.h(m10); + }; + }(a10))); + a10.b() || (a10 = a10.c(), b10 = YX(a10), Dg(h10, ky("content", new hY().kE(b10, c10, e10, a10.r.x, f10), Q5().Na, ld()))); + return h10; + } + gY.prototype.$classData = r8({ YTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3RequestBodyEmitter$", { YTa: 1, f: 1, q: 1, o: 1 }); + var BQa = void 0; + function CQa() { + BQa || (BQa = new gY().a()); + return BQa; + } + function iY() { + this.l = null; + } + iY.prototype = new u7(); + iY.prototype.constructor = iY; + iY.prototype.h9 = function(a10, b10) { + var c10 = a10.i.hb().gb; + if (Q5().sa === c10) { + c10 = a10.i; + var e10 = qc(); + c10 = N6(c10, e10, this.l.Sn); + c10 = ac(new M6().W(c10), "$ref"); + if (c10 instanceof z7) { + e10 = c10.i; + c10 = this.l; + var f10 = e10.i, g10 = bc(); + f10 = N6(f10, g10, this.l.Sn).va; + e10 = e10.i; + g10 = bc(); + return DQa(new jY(), c10, a10, f10, N6(e10, g10, this.l.Sn), b10).AH(); + } + c10 = this.l; + e10 = a10.Aa; + f10 = bc(); + e10 = N6(e10, f10, this.l.Sn).va; + f10 = a10.i; + g10 = qc(); + return EQa(new kY(), c10, a10, e10, N6(f10, g10, this.l.Sn), b10).AH(); + } + if (Q5().cd === c10) + return O7(), c10 = new P6().a(), c10 = new Pd().K(new S6().a(), c10), e10 = a10.Aa, f10 = bc(), e10 = N6(e10, f10, this.l.Sn).va, O7(), f10 = new P6().a(), c10 = Sd(c10, e10, f10), b10.P(c10), b10 = this.l.Sn, e10 = sg().aN, f10 = c10.j, a10 = a10.i, g10 = y7(), ec(b10, e10, f10, g10, "Invalid value node type for annotation types parser, expected map or scalar reference", a10.da), c10; + c10 = this.l; + e10 = a10.Aa; + f10 = bc(); + e10 = N6(e10, f10, this.l.Sn).va; + f10 = a10.i; + g10 = bc(); + return DQa(new jY(), c10, a10, e10, N6(f10, g10, this.l.Sn), b10).AH(); + }; + iY.prototype.$classData = r8({ fVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecParser$AnnotationTypesParser$", { fVa: 1, f: 1, q: 1, o: 1 }); + function lY() { + } + lY.prototype = new u7(); + lY.prototype.constructor = lY; + lY.prototype.a = function() { + return this; + }; + function FQa(a10, b10, c10) { + a10 = y7(); + var e10 = new z7().d(c10), f10 = c10.ni, g10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()); + a10 = new Jx().GU(g10, h10, a10, e10, f10); + c10 = GQa(new mY(), c10.qh, c10.Df, c10, new z7().d(c10.pe()), a10); + a10 = new nY(); + a10.Fs = b10; + oY.prototype.$D.call(a10, b10, c10); + return a10; + } + lY.prototype.$classData = r8({ sVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ExtensionLikeParser$", { sVa: 1, f: 1, q: 1, o: 1 }); + var HQa = void 0; + function IQa() { + HQa || (HQa = new lY().a()); + return HQa; + } + function pY() { + this.XS = this.Pe = null; + } + pY.prototype = new u7(); + pY.prototype.constructor = pY; + pY.prototype.a = function() { + JQa = this; + Kna(this); + var a10 = this.XS, b10 = "title description version baseUri baseUriParameters protocols mediaType documentation schemas traits resourceTypes securitySchemes securedBy".split(" "); + if (0 === (b10.length | 0)) + b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new R6().M("webApi", b10); + c10 = "type default schema example examples displayName description facets enum required repeat".split(" "); + if (0 === (c10.length | 0)) + c10 = vd(); + else { + e10 = wd(new xd(), vd()); + f10 = 0; + for (var g10 = c10.length | 0; f10 < g10; ) + Ad(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + } + c10 = new R6().M("shape", c10); + e10 = "type default schema example examples displayName description facets enum repeat pattern minLength maxLength required".split(" "); + if (0 === (e10.length | 0)) + e10 = vd(); + else { + f10 = wd(new xd(), vd()); + g10 = 0; + for (var h10 = e10.length | 0; g10 < h10; ) + Ad(f10, e10[g10]), g10 = 1 + g10 | 0; + e10 = f10.eb; + } + e10 = new R6().M("stringScalarShape", e10); + f10 = "type default schema example examples displayName description facets enum required repeat format".split(" "); + if (0 === (f10.length | 0)) + f10 = vd(); + else { + g10 = wd( + new xd(), + vd() + ); + h10 = 0; + for (var k10 = f10.length | 0; h10 < k10; ) + Ad(g10, f10[h10]), h10 = 1 + h10 | 0; + f10 = g10.eb; + } + f10 = new R6().M("dateScalarShape", f10); + g10 = "type default schema example examples displayName description facets enum required repeat minimum maximum format multipleOf".split(" "); + if (0 === (g10.length | 0)) + g10 = vd(); + else { + h10 = wd(new xd(), vd()); + k10 = 0; + for (var l10 = g10.length | 0; k10 < l10; ) + Ad(h10, g10[k10]), k10 = 1 + k10 | 0; + g10 = h10.eb; + } + g10 = new R6().M("numberScalarShape", g10); + h10 = "displayName description get patch put post delete options head connect trace get? patch? put? post? delete? options? head? connect? trace? is type securedBy baseUriParameters uriParameters usage".split(" "); + if (0 === (h10.length | 0)) + h10 = vd(); + else { + k10 = wd(new xd(), vd()); + l10 = 0; + for (var m10 = h10.length | 0; l10 < m10; ) + Ad(k10, h10[l10]), l10 = 1 + l10 | 0; + h10 = k10.eb; + } + h10 = new R6().M("endPoint", h10); + k10 = "displayName description get patch put post delete options head connect trace get? patch? put? post? delete? options? head? connect? trace? is type securedBy baseUriParameters uriParameters usage is? securedBy? baseUriParameters? uriParameters?".split(" "); + if (0 === (k10.length | 0)) + k10 = vd(); + else { + l10 = wd(new xd(), vd()); + m10 = 0; + for (var p10 = k10.length | 0; m10 < p10; ) + Ad(l10, k10[m10]), m10 = 1 + m10 | 0; + k10 = l10.eb; + } + k10 = new R6().M( + "resourceType", + k10 + ); + l10 = "displayName description queryParameters headers responses body protocols is securedBy baseUriParameters usage".split(" "); + if (0 === (l10.length | 0)) + l10 = vd(); + else { + m10 = wd(new xd(), vd()); + p10 = 0; + for (var t10 = l10.length | 0; p10 < t10; ) + Ad(m10, l10[p10]), p10 = 1 + p10 | 0; + l10 = m10.eb; + } + l10 = new R6().M("operation", l10); + m10 = "displayName description queryParameters headers responses body protocols is securedBy baseUriParameters usage queryParameters? headers? responses? body? protocols? is? securedBy? baseUriParameters?".split(" "); + if (0 === (m10.length | 0)) + m10 = vd(); + else { + p10 = wd(new xd(), vd()); + t10 = 0; + for (var v10 = m10.length | 0; t10 < v10; ) + Ad(p10, m10[t10]), t10 = 1 + t10 | 0; + m10 = p10.eb; + } + b10 = [b10, c10, e10, f10, g10, h10, k10, l10, new R6().M("trait", m10)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = b10.length | 0; e10 < f10; ) + WA(c10, b10[e10]), e10 = 1 + e10 | 0; + this.Pe = a10.uq(c10.eb); + return this; + }; + pY.prototype.Jia = function(a10) { + this.XS = a10; + }; + pY.prototype.$classData = r8({ xVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml08Syntax$", { xVa: 1, f: 1, gWa: 1, PY: 1 }); + var JQa = void 0; + function qY() { + this.XS = this.Pe = this.hC = null; + } + qY.prototype = new u7(); + qY.prototype.constructor = qY; + qY.prototype.a = function() { + KQa = this; + Kna(this); + var a10 = "type default schema example examples displayName description facets xml enum".split(" "); + if (0 === (a10.length | 0)) + var b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = a10.length | 0; e10 < f10; ) + Ad(c10, a10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + this.hC = b10; + var g10 = this.XS, h10 = "title description version baseUri baseUriParameters protocols mediaType documentation schemas types traits resourceTypes annotationTypes securitySchemes securedBy usage extends uses".split(" "); + if (0 === (h10.length | 0)) + var k10 = vd(); + else { + for (var l10 = wd(new xd(), vd()), m10 = 0, p10 = h10.length | 0; m10 < p10; ) + Ad(l10, h10[m10]), m10 = 1 + m10 | 0; + k10 = l10.eb; + } + var t10 = new R6().M("webApi", k10), v10 = new R6().M("shape", this.hC), A10 = new R6().M("anyShape", this.hC), D10 = "type default schema example examples displayName description required".split(" "); + if (0 === (D10.length | 0)) + var C10 = vd(); + else { + for (var I10 = wd(new xd(), vd()), L10 = 0, Y10 = D10.length | 0; L10 < Y10; ) + Ad(I10, D10[L10]), L10 = 1 + L10 | 0; + C10 = I10.eb; + } + var ia = new R6().M("schemaShape", C10), pa = this.hC.Zj("anyOf"), La = new R6().M("unionShape", pa), ob = this.hC, zb = "properties minProperties maxProperties discriminator discriminatorValue additionalProperties".split(" "); + if (0 === (zb.length | 0)) + var Zb = vd(); + else { + for (var Cc = wd(new xd(), vd()), vc = 0, id = zb.length | 0; vc < id; ) + Ad(Cc, zb[vc]), vc = 1 + vc | 0; + Zb = Cc.eb; + } + var yd = ob.Lk(Zb), zd = new R6().M("nodeShape", yd), rd = this.hC, sd = ["uniqueItems", "items", "minItems", "maxItems"]; + if (0 === (sd.length | 0)) + var le4 = vd(); + else { + for (var Vc = wd(new xd(), vd()), Sc = 0, Qc = sd.length | 0; Sc < Qc; ) + Ad(Vc, sd[Sc]), Sc = 1 + Sc | 0; + le4 = Vc.eb; + } + var $c = rd.Lk(le4), Wc = new R6().M("arrayShape", $c), Qe = this.hC, Qd = ["pattern", "minLength", "maxLength"]; + if (0 === (Qd.length | 0)) + var me4 = vd(); + else { + for (var of = wd(new xd(), vd()), Le2 = 0, Ve = Qd.length | 0; Le2 < Ve; ) + Ad(of, Qd[Le2]), Le2 = 1 + Le2 | 0; + me4 = of.eb; + } + var he4 = Qe.Lk(me4), Wf = new R6().M("stringScalarShape", he4), vf = this.hC, He = ["minimum", "maximum", "format", "multipleOf"]; + if (0 === (He.length | 0)) + var Ff = vd(); + else { + for (var wf = wd(new xd(), vd()), Re2 = 0, we4 = He.length | 0; Re2 < we4; ) + Ad(wf, He[Re2]), Re2 = 1 + Re2 | 0; + Ff = wf.eb; + } + var ne4 = vf.Lk(Ff), Me2 = new R6().M("numberScalarShape", ne4), Se4 = this.hC.Zj("format"), xf = new R6().M("dateScalarShape", Se4), ie3 = this.hC, gf = ["fileTypes", "minLength", "maxLength"]; + if (0 === (gf.length | 0)) + var pf = vd(); + else { + for (var hf = wd(new xd(), vd()), Gf = 0, yf = gf.length | 0; Gf < yf; ) + Ad(hf, gf[Gf]), Gf = 1 + Gf | 0; + pf = hf.eb; + } + var oe4 = ie3.Lk(pf), lg = new R6().M("fileShape", oe4), bh = ["displayName", "description", "value", "strict"]; + if (0 === (bh.length | 0)) + var Qh = vd(); + else { + for (var af = wd(new xd(), vd()), Pf = 0, oh = bh.length | 0; Pf < oh; ) + Ad(af, bh[Pf]), Pf = 1 + Pf | 0; + Qh = af.eb; + } + var ch = new R6().M("example", Qh), Ie2 = ["attribute", "wrapped", "name", "namespace", "prefix"]; + if (0 === (Ie2.length | 0)) + var ug = vd(); + else { + for (var Sg = wd(new xd(), vd()), Tg = 0, zh = Ie2.length | 0; Tg < zh; ) + Ad( + Sg, + Ie2[Tg] + ), Tg = 1 + Tg | 0; + ug = Sg.eb; + } + var Rh = new R6().M("xmlSerialization", ug), vg = "displayName description get patch put post delete options head connect trace get? patch? put? post? delete? options? head? connect? trace? is type securedBy uriParameters usage".split(" "); + if (0 === (vg.length | 0)) + var dh = vd(); + else { + for (var Jg = wd(new xd(), vd()), Ah = 0, Bh = vg.length | 0; Ah < Bh; ) + Ad(Jg, vg[Ah]), Ah = 1 + Ah | 0; + dh = Jg.eb; + } + var cg = new R6().M("endPoint", dh), Qf = "displayName description get patch put post delete options head connect trace get? patch? put? post? delete? options? head? connect? trace? is type securedBy uriParameters usage".split(" "); + if (0 === (Qf.length | 0)) + var Kg = vd(); + else { + for (var Ne2 = wd(new xd(), vd()), Xf = 0, di = Qf.length | 0; Xf < di; ) + Ad(Ne2, Qf[Xf]), Xf = 1 + Xf | 0; + Kg = Ne2.eb; + } + var dg = new R6().M("resourceType", Kg), Hf = "displayName description queryParameters headers queryString responses body protocols is securedBy usage".split(" "); + if (0 === (Hf.length | 0)) + var wg = vd(); + else { + for (var Lg = wd(new xd(), vd()), jf = 0, mg = Hf.length | 0; jf < mg; ) + Ad(Lg, Hf[jf]), jf = 1 + jf | 0; + wg = Lg.eb; + } + var Mg = new R6().M("operation", wg), Ng = "displayName description queryParameters headers queryString responses body protocols is securedBy usage".split(" "); + if (0 === (Ng.length | 0)) + var eg = vd(); + else { + for (var Oe4 = wd(new xd(), vd()), ng = 0, fg = Ng.length | 0; ng < fg; ) + Ad(Oe4, Ng[ng]), ng = 1 + ng | 0; + eg = Oe4.eb; + } + var Ug = new R6().M("trait", eg), xg = ["displayName", "description", "allowedTargets"]; + if (0 === (xg.length | 0)) + var gg = vd(); + else { + for (var fe4 = wd(new xd(), vd()), ge4 = 0, ph = xg.length | 0; ge4 < ph; ) + Ad(fe4, xg[ge4]), ge4 = 1 + ge4 | 0; + gg = fe4.eb; + } + var hg = new R6().M("annotation", gg), Jh = ["required"]; + if (0 === (Jh.length | 0)) + var fj = vd(); + else { + for (var yg = wd(new xd(), vd()), qh = 0, og = Jh.length | 0; qh < og; ) + Ad(yg, Jh[qh]), qh = 1 + qh | 0; + fj = yg.eb; + } + var rh = new R6().M("property", fj), Ch = "uses usage types schemas resourceTypes traits securitySchemes annotationTypes".split(" "); + if (0 === (Ch.length | 0)) + var Vg = vd(); + else { + for (var Wg = wd(new xd(), vd()), Rf = 0, Sh = Ch.length | 0; Rf < Sh; ) + Ad(Wg, Ch[Rf]), Rf = 1 + Rf | 0; + Vg = Wg.eb; + } + var zg = new R6().M("module", Vg), Ji = ["headers", "queryParameters", "queryString", "responses"]; + if (0 === (Ji.length | 0)) + var Kh = vd(); + else { + for (var Lh = wd(new xd(), vd()), Ki = 0, gj = Ji.length | 0; Ki < gj; ) + Ad(Lh, Ji[Ki]), Ki = 1 + Ki | 0; + Kh = Lh.eb; + } + for (var Rl = [ + t10, + v10, + A10, + ia, + La, + zd, + Wc, + Wf, + Me2, + xf, + lg, + ch, + Rh, + cg, + dg, + Mg, + Ug, + hg, + rh, + zg, + new R6().M("describedBy", Kh) + ], ek = UA(new VA(), nu()), Dh = 0, Eh = Rl.length | 0; Dh < Eh; ) + WA(ek, Rl[Dh]), Dh = 1 + Dh | 0; + this.Pe = g10.uq(ek.eb); + return this; + }; + qY.prototype.Jia = function(a10) { + this.XS = a10; + }; + qY.prototype.$classData = r8({ CVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml10Syntax$", { CVa: 1, f: 1, gWa: 1, PY: 1 }); + var KQa = void 0; + function rY() { + vQ.call(this); + } + rY.prototype = new gHa(); + rY.prototype.constructor = rY; + rY.prototype.un = function() { + return nk(); + }; + rY.prototype.OE = function() { + return new sY().mt(true, this.ob); + }; + rY.prototype.nu = function(a10, b10) { + vQ.prototype.nu.call(this, a10, b10); + return this; + }; + rY.prototype.$classData = r8({ pWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Oas30EditingPipeline", { pWa: 1, o7: 1, Qt: 1, f: 1 }); + function tY() { + EQ.call(this); + } + tY.prototype = new iHa(); + tY.prototype.constructor = tY; + tY.prototype.Hb = function(a10) { + EQ.prototype.Hb.call(this, a10); + return this; + }; + tY.prototype.un = function() { + return nk(); + }; + tY.prototype.OE = function() { + return new sY().mt(false, this.ob); + }; + tY.prototype.$classData = r8({ qWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Oas30ResolutionPipeline", { qWa: 1, p7: 1, Qt: 1, f: 1 }); + function uY() { + vQ.call(this); + } + uY.prototype = new gHa(); + uY.prototype.constructor = uY; + uY.prototype.un = function() { + return lk(); + }; + uY.prototype.OE = function() { + return new sY().mt(true, this.ob); + }; + uY.prototype.nu = function(a10, b10) { + vQ.prototype.nu.call(this, a10, b10); + return this; + }; + uY.prototype.$classData = r8({ rWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.OasEditingPipeline", { rWa: 1, o7: 1, Qt: 1, f: 1 }); + function IQ() { + EQ.call(this); + } + IQ.prototype = new iHa(); + IQ.prototype.constructor = IQ; + IQ.prototype.Hb = function(a10) { + EQ.prototype.Hb.call(this, a10); + return this; + }; + IQ.prototype.un = function() { + return lk(); + }; + IQ.prototype.OE = function() { + return new sY().mt(false, this.ob); + }; + IQ.prototype.$classData = r8({ sWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.OasResolutionPipeline", { sWa: 1, p7: 1, Qt: 1, f: 1 }); + function vY() { + vQ.call(this); + } + vY.prototype = new gHa(); + vY.prototype.constructor = vY; + vY.prototype.un = function() { + return qk(); + }; + vY.prototype.OE = function() { + return new sY().mt(true, this.ob); + }; + vY.prototype.nu = function(a10, b10) { + vQ.prototype.nu.call(this, a10, b10); + return this; + }; + vY.prototype.$classData = r8({ tWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Raml08EditingPipeline", { tWa: 1, o7: 1, Qt: 1, f: 1 }); + function wY() { + EQ.call(this); + } + wY.prototype = new iHa(); + wY.prototype.constructor = wY; + wY.prototype.Hb = function(a10) { + EQ.prototype.Hb.call(this, a10); + return this; + }; + wY.prototype.un = function() { + return qk(); + }; + wY.prototype.OE = function() { + return new sY().mt(false, this.ob); + }; + wY.prototype.$classData = r8({ uWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Raml08ResolutionPipeline", { uWa: 1, p7: 1, Qt: 1, f: 1 }); + function xY() { + vQ.call(this); + } + xY.prototype = new gHa(); + xY.prototype.constructor = xY; + xY.prototype.un = function() { + return ok2(); + }; + xY.prototype.OE = function() { + return new sY().mt(true, this.ob); + }; + xY.prototype.nu = function(a10, b10) { + vQ.prototype.nu.call(this, a10, b10); + return this; + }; + xY.prototype.$classData = r8({ vWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Raml10EditingPipeline", { vWa: 1, o7: 1, Qt: 1, f: 1 }); + function PQ() { + EQ.call(this); + } + PQ.prototype = new iHa(); + PQ.prototype.constructor = PQ; + PQ.prototype.Hb = function(a10) { + EQ.prototype.Hb.call(this, a10); + return this; + }; + PQ.prototype.un = function() { + return ok2(); + }; + PQ.prototype.OE = function() { + return new sY().mt(false, this.ob); + }; + PQ.prototype.$classData = r8({ wWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.Raml10ResolutionPipeline", { wWa: 1, p7: 1, Qt: 1, f: 1 }); + function yY() { + } + yY.prototype = new u7(); + yY.prototype.constructor = yY; + yY.prototype.a = function() { + return this; + }; + function LQa(a10, b10, c10) { + a10 = c10.Si(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.Ha(g10); + }; + }(a10, b10))); + c10 = K7(); + return b10.ia(a10, c10.u); + } + yY.prototype.$classData = r8({ XWa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.BranchContainer$", { XWa: 1, f: 1, q: 1, o: 1 }); + var MQa = void 0; + function NQa() { + MQa || (MQa = new yY().a()); + return MQa; + } + function CB() { + this.H_ = this.ob = null; + this.P0 = this.Sk = false; + this.qi = this.ox = null; + } + CB.prototype = new gv(); + CB.prototype.constructor = CB; + function OQa(a10, b10, c10) { + var e10 = PQa(PQa(QQa(new zY(), b10, J5(Gb().Qg, H10())), "resourcePath", RQa(c10)), "resourcePathName", SQa(c10)), f10 = Vna(TQa(a10, c10)); + b10 = UQa(a10, e10.oi.Me.c() | 0); + var g10 = VQa(a10, c10, e10, b10, f10); + WQa(a10, c10, g10, b10); + var h10 = new AY().qaa(a10), k10 = B6(c10.g, Jl().bk); + e10 = w6(/* @__PURE__ */ function(l10, m10, p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = B6(C10.g, Pl().pm).A, L10 = PQa(m10, "methodName", I10.b() ? null : I10.c()); + I10 = J5(Ef(), H10()); + var Y10 = Vna(XQa(l10, C10)), ia = YQa(l10, p10); + Dg(I10, ZQa(ia, t10, C10, L10, Y10)); + Dg(I10, $Qa(ia, t10, v10, L10, A10)); + for (Y10 = D10.Dc; !Y10.b(); ) { + var pa = Y10.ga(), La = B6(C10.g, Pl().pm).A; + Dg(I10, aRa(ia, t10, pa, L10, La.b() ? null : La.c(), A10)); + Y10 = Y10.ta(); + } + L10 = J5(K7(), H10()); + for (I10 = I10.Dc; !I10.b(); ) + ia = L10, L10 = I10.ga(), L10 = LQa(NQa(), ia, bRa(L10)), ia = new BY().qaa(l10), Y10 = K7(), L10 = L10.ec(ia, Y10.u), I10 = I10.ta(); + I10 = L10; + I10.ne(C10, Uc(/* @__PURE__ */ function(ob, zb) { + return function(Zb, Cc) { + return CY(new DY().ss(zb), Zb, Cc.Kl, ob.ob); + }; + }(l10, p10))); + l10.Sk || l10.P0 || it2(C10.g, nc().Ni()); + return I10; + }; + }(a10, e10, b10, h10, c10, f10, g10)); + f10 = K7(); + k10 = k10.bd(e10, f10.u); + a10.Sk || a10.P0 || it2(c10.g, nc().Ni()); + Fb(b10.ni); + return g10.Da() || k10.Da() ? wqa(new EB().mt(a10.Sk, a10.ob), c10) : c10; + } + function SQa(a10) { + a10 = RQa(a10); + a10 = new qg().e(a10); + a10 = pia(a10, 47); + var b10 = new EY().XO(cRa(dRa(), Ou(la(a10)))); + b10.pj(a10.n.length); + for (var c10 = a10.n.length; 0 < c10; ) + c10 = -1 + c10 | 0, eRa(b10, a10.n[c10]); + a10 = fRa(b10); + b10 = a10.n.length; + for (c10 = 0; ; ) { + if (c10 < b10) { + var e10 = a10.n[c10], f10 = new qg().e(e10); + if (tc(f10)) { + f10 = new qg().e("\\{.*\\}"); + var g10 = H10(); + e10 = ira(new rg().vi(f10.ja, g10), e10).b(); + } else + e10 = false; + e10 = !e10; + } else + e10 = false; + if (e10) + c10 = 1 + c10 | 0; + else + break; + } + b10 = c10; + a10 = b10 < a10.n.length ? new z7().d(a10.n[b10]) : y7(); + return a10.b() ? "" : a10.c(); + } + function VQa(a10, b10, c10, e10, f10) { + var g10 = J5(Ef(), H10()); + gRa(a10, g10, b10, c10, e10, f10); + return g10; + } + function WQa(a10, b10, c10, e10) { + for (c10 = c10.Dc; !c10.b(); ) { + var f10 = b10; + b10 = c10.ga(); + b10 = CY(new DY().ss(e10), f10, b10, a10.ob); + c10 = c10.ta(); + } + } + function UQa(a10, b10) { + var c10 = a10.H_; + if (qk().h(c10)) { + c10 = H10(); + K7(); + pj(); + var e10 = new Lf().a().ua(), f10 = new Mq().a(), g10 = y7(); + b10 = new Aq().zo("", e10, f10, b10, g10); + a10 = new z7().d(a10.ob); + e10 = y7(); + f10 = y7(); + g10 = iA().ho; + return new uB().il("", c10, b10, e10, f10, a10, g10); + } + c10 = H10(); + K7(); + pj(); + e10 = new Lf().a().ua(); + f10 = new Mq().a(); + g10 = y7(); + b10 = new Aq().zo("", e10, f10, b10, g10); + a10 = new z7().d(a10.ob); + e10 = y7(); + f10 = y7(); + g10 = iA().ho; + return new hA().il("", c10, b10, e10, f10, a10, g10); + } + CB.prototype.ye = function(a10) { + return a10.Qm(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return b10.ox.Ha(c10.j) && !b10.P0 || (b10.ox.Tm(c10.j), c10 instanceof Kl); + }; + }(this)), Uc(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10 instanceof Kl ? new z7().d(OQa(b10, c10, e10)) : new z7().d(e10); + }; + }(this, a10)), this.ob); + }; + function RQa(a10) { + ua(); + a10 = B6(a10.g, Jl().Uf).A; + return Bx(0, a10.b() ? null : a10.c(), "\\{ext\\}", ""); + } + function hRa(a10, b10, c10, e10, f10) { + var g10 = Vb().Ia(iRa(b10)); + if (g10 instanceof z7) { + var h10 = g10.i; + if (h10 instanceof Vm) { + g10 = h10.Nz().VJ(); + g10.YL(c10.fr, f10.dF, w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + var C10 = dc().Fh, I10 = A10.j, L10 = y7(), Y10 = Ab(A10.Xa, q5(jd)), ia = yb(A10); + v10.Gc(C10.j, I10, L10, D10, Y10, Yb().qb, ia); + }; + }(a10, e10, b10))); + f10 = GB(); + var k10 = c10.oi, l10 = a10.H_; + h10 = h10.Xa; + var m10 = B6(b10.aa, FY().R).A; + m10 = m10.b() ? null : m10.c(); + var p10 = b10.j; + b10 = Vb().Ia(iRa(b10)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = FB(GB(), b10.j, c10.oi)); + return Gqa(f10, k10, l10, g10, h10, m10, p10, b10, a10.Sk, new z7().d(e10), a10.ob); + } + } + a10 = dc().Fh; + c10 = b10.j; + g10 = y7(); + f10 = "Cannot find target for parametrized resource type " + b10.j; + k10 = Ab(b10.Xa, q5(jd)); + l10 = yb(b10); + e10.Gc(a10.j, c10, g10, f10, k10, Yb().qb, l10); + e10 = b10.j; + b10 = Ab(b10.Xa, q5(Qu)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.ad)); + return new oD().Tq(e10, b10.b() ? T6().nd : b10.c()); + } + function gRa(a10, b10, c10, e10, f10, g10) { + var h10 = B6(c10.g, nc().Ni()); + c10 = new jRa().LO(c10); + h10 = Jc(h10, c10); + h10.b() || (h10 = h10.c(), e10 = kRa(e10, h10.kI()), h10 = hRa(a10, h10, e10, f10, g10), Dg(b10, h10), gRa(a10, b10, h10, e10, f10, g10)); + } + function uoa(a10, b10, c10, e10, f10, g10) { + a10.H_ = b10; + a10.Sk = c10; + a10.P0 = e10; + a10.ox = f10; + fv.prototype.Hb.call(a10, g10); + a10.qi = nv().ea; + return a10; + } + CB.prototype.$classData = r8({ ZWa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage", { ZWa: 1, ii: 1, f: 1, ib: 1 }); + function wQ() { + this.ao = this.ob = null; + this.Sk = false; + this.qi = null; + } + wQ.prototype = new gv(); + wQ.prototype.constructor = wQ; + wQ.prototype.rs = function(a10, b10, c10) { + this.ao = a10; + this.Sk = b10; + fv.prototype.Hb.call(this, c10); + this.qi = nv().ea; + return this; + }; + wQ.prototype.ye = function(a10) { + var b10 = uoa(new CB(), this.ao, this.Sk, false, J5(DB(), H10()), this.ob); + return a10 instanceof Hl ? toa(new fR().rs(this.ao, this.Sk, this.ob), a10, a10) : a10 instanceof Fl ? toa(new cR().rs(this.ao, this.Sk, this.ob), a10, a10) : b10.ye(a10); + }; + wQ.prototype.$classData = r8({ mXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtensionsResolutionStage", { mXa: 1, ii: 1, f: 1, ib: 1 }); + function lRa() { + mR.call(this); + this.Lea = this.gg = null; + } + lRa.prototype = new GHa(); + lRa.prototype.constructor = lRa; + function KHa(a10) { + try { + var b10 = a10.xe; + if (b10 instanceof z7 && "" === b10.i) + var c10 = y7(); + else { + var e10 = new Zq().a(); + if (OL().t0(a10, e10, (OL(), new Df().a()), (OL(), new Yf().a()))) { + var f10 = uAa(kq(), $q(new Dc(), e10.GI.c(), y7())); + c10 = f10 instanceof z7 ? new z7().d(ka(f10.i)) : y7(); + } else + c10 = y7(); + } + if (c10.b()) + var g10 = y7(); + else { + var h10 = c10.c(), k10 = ar(a10.g, sl().nb); + b: { + if (k10 instanceof Vi) { + if (B6(k10.aa, Wi().af).A.Ha(Uh().zj)) + var l10 = new qg().e(h10), m10 = tc(l10); + else + m10 = false; + if (m10) + var p10 = new qg().e(h10), t10 = zj(p10), v10 = 34 !== (null === t10 ? 0 : t10.r); + else + v10 = false; + if (v10) { + var A10 = new qg().e(h10); + var D10 = '"' + mRa(A10) + '"'; + break b; + } + } + var C10 = new qg().e(h10); + D10 = mRa(C10); + } + g10 = new z7().d(D10); + } + if (g10.b()) + return y7(); + var I10 = g10.c(); + return new z7().d(IHa(I10)); + } catch (L10) { + a10 = Ph(E6(), L10); + if (null !== a10) { + if (a10 instanceof EK && a10.Px instanceof ba.SyntaxError) + throw new pR().kn(a10); + throw mb(E6(), a10); + } + throw L10; + } + } + function IHa(a10) { + try { + return ba.JSON.parse(a10); + } catch (b10) { + a10 = Ph(E6(), b10); + if (null !== a10) { + if (a10 instanceof EK && a10.Px instanceof ba.SyntaxError) + throw new pR().kn(a10); + throw mb(E6(), a10); + } + throw b10; + } + } + lRa.prototype.$classData = r8({ bYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.JsPayloadValidator", { bYa: 1, ehb: 1, f: 1, rDa: 1 }); + function nRa() { + this.Ig = null; + } + nRa.prototype = new sAa(); + nRa.prototype.constructor = nRa; + d7 = nRa.prototype; + d7.a = function() { + this.Ig = "Data Shapes Domain"; + return this; + }; + d7.dy = function() { + var a10 = K7(), b10 = [Ag(), uh(), an(), xea(), gn(), wea(), Ih(), Qi(), un(), Fg(), pn(), xn(), rn(), Ot(), ag()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + return J5(K7(), H10()); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return vCa(); + }; + }(this)), ml()); + }; + d7.ry = function() { + oRa || (oRa = new GY().a()); + var a10 = new R6().M("type-expression", oRa); + pRa || (pRa = new HY().a()); + var b10 = new R6().M("inheritance-provenance", pRa); + qRa || (qRa = new IY().a()); + var c10 = new R6().M("inherited-shapes", qRa); + rRa || (rRa = new JY().a()); + a10 = [a10, b10, c10, new R6().M("nil-union", rRa)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (var e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + return b10.eb; + }; + d7.$classData = r8({ iYa: 0 }, false, "amf.plugins.domain.shapes.DataShapesDomainPlugin$", { iYa: 1, Yva: 1, f: 1, Zr: 1 }); + var sRa = void 0; + function vCa() { + sRa || (sRa = new nRa().a()); + return sRa; + } + function KY() { + } + KY.prototype = new u7(); + KY.prototype.constructor = KY; + KY.prototype.a = function() { + return this; + }; + function tRa(a10, b10) { + a10 = Od(O7(), b10); + return new th().K(new S6().a(), a10); + } + KY.prototype.$classData = r8({ EYa: 0 }, false, "amf.plugins.domain.shapes.models.ArrayShape$", { EYa: 1, f: 1, q: 1, o: 1 }); + var uRa = void 0; + function vRa() { + uRa || (uRa = new KY().a()); + return uRa; + } + function LY() { + } + LY.prototype = new u7(); + LY.prototype.constructor = LY; + LY.prototype.a = function() { + return this; + }; + function MY(a10, b10) { + a10 = Od(O7(), b10); + return new Wh().K(new S6().a(), a10); + } + LY.prototype.$classData = r8({ LYa: 0 }, false, "amf.plugins.domain.shapes.models.FileShape$", { LYa: 1, f: 1, q: 1, o: 1 }); + var wRa = void 0; + function NY() { + wRa || (wRa = new LY().a()); + return wRa; + } + function OY() { + } + OY.prototype = new u7(); + OY.prototype.constructor = OY; + OY.prototype.a = function() { + return this; + }; + function PY(a10, b10) { + a10 = Od(O7(), b10); + return new Th().K(new S6().a(), a10); + } + OY.prototype.$classData = r8({ OYa: 0 }, false, "amf.plugins.domain.shapes.models.NilShape$", { OYa: 1, f: 1, q: 1, o: 1 }); + var xRa = void 0; + function QY() { + xRa || (xRa = new OY().a()); + return xRa; + } + function RY() { + } + RY.prototype = new u7(); + RY.prototype.constructor = RY; + RY.prototype.a = function() { + return this; + }; + function yRa(a10, b10) { + a10 = Od(O7(), b10); + return new Hh().K(new S6().a(), a10); + } + RY.prototype.$classData = r8({ QYa: 0 }, false, "amf.plugins.domain.shapes.models.NodeShape$", { QYa: 1, f: 1, q: 1, o: 1 }); + var zRa = void 0; + function ARa() { + zRa || (zRa = new RY().a()); + return zRa; + } + function SY() { + } + SY.prototype = new u7(); + SY.prototype.constructor = SY; + SY.prototype.a = function() { + return this; + }; + SY.prototype.$classData = r8({ SYa: 0 }, false, "amf.plugins.domain.shapes.models.PropertyDependencies$", { SYa: 1, f: 1, q: 1, o: 1 }); + var BRa = void 0; + function TY() { + } + TY.prototype = new u7(); + TY.prototype.constructor = TY; + TY.prototype.a = function() { + return this; + }; + function UY(a10, b10) { + a10 = Od(O7(), b10); + return new Mh().K(new S6().a(), a10); + } + TY.prototype.$classData = r8({ UYa: 0 }, false, "amf.plugins.domain.shapes.models.ScalarShape$", { UYa: 1, f: 1, q: 1, o: 1 }); + var CRa = void 0; + function VY() { + CRa || (CRa = new TY().a()); + return CRa; + } + function WY() { + } + WY.prototype = new u7(); + WY.prototype.constructor = WY; + WY.prototype.a = function() { + return this; + }; + function DRa(a10, b10) { + a10 = Od(O7(), b10); + return new Gh().K(new S6().a(), a10); + } + WY.prototype.$classData = r8({ WYa: 0 }, false, "amf.plugins.domain.shapes.models.SchemaShape$", { WYa: 1, f: 1, q: 1, o: 1 }); + var ERa = void 0; + function FRa() { + ERa || (ERa = new WY().a()); + return ERa; + } + function XY() { + } + XY.prototype = new u7(); + XY.prototype.constructor = XY; + XY.prototype.a = function() { + return this; + }; + function GRa(a10, b10) { + a10 = Od(O7(), b10); + return new qi().K(new S6().a(), a10); + } + XY.prototype.$classData = r8({ YYa: 0 }, false, "amf.plugins.domain.shapes.models.TupleShape$", { YYa: 1, f: 1, q: 1, o: 1 }); + var HRa = void 0; + function IRa() { + HRa || (HRa = new XY().a()); + return HRa; + } + function YY() { + } + YY.prototype = new u7(); + YY.prototype.constructor = YY; + YY.prototype.a = function() { + return this; + }; + YY.prototype.$classData = r8({ aZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$BinaryType$", { aZa: 1, f: 1, om: 1, Zs: 1 }); + var JRa = void 0; + function Ce() { + JRa || (JRa = new YY().a()); + return JRa; + } + function ZY() { + } + ZY.prototype = new u7(); + ZY.prototype.constructor = ZY; + ZY.prototype.a = function() { + return this; + }; + ZY.prototype.$classData = r8({ bZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$BoolType$", { bZa: 1, f: 1, om: 1, Zs: 1 }); + var KRa = void 0; + function Pe2() { + KRa || (KRa = new ZY().a()); + return KRa; + } + function $Y() { + } + $Y.prototype = new u7(); + $Y.prototype.constructor = $Y; + $Y.prototype.a = function() { + return this; + }; + $Y.prototype.$classData = r8({ cZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$ByteType$", { cZa: 1, f: 1, om: 1, Zs: 1 }); + var LRa = void 0; + function Be3() { + LRa || (LRa = new $Y().a()); + return LRa; + } + function aZ() { + } + aZ.prototype = new u7(); + aZ.prototype.constructor = aZ; + aZ.prototype.a = function() { + return this; + }; + aZ.prototype.$classData = r8({ dZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$DateOnlyType$", { dZa: 1, f: 1, om: 1, Zs: 1 }); + var MRa = void 0; + function Ye() { + MRa || (MRa = new aZ().a()); + return MRa; + } + function bZ() { + } + bZ.prototype = new u7(); + bZ.prototype.constructor = bZ; + bZ.prototype.a = function() { + return this; + }; + bZ.prototype.$classData = r8({ eZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$DateTimeOnlyType$", { eZa: 1, f: 1, om: 1, Zs: 1 }); + var NRa = void 0; + function We() { + NRa || (NRa = new bZ().a()); + return NRa; + } + function cZ() { + } + cZ.prototype = new u7(); + cZ.prototype.constructor = cZ; + cZ.prototype.a = function() { + return this; + }; + cZ.prototype.$classData = r8({ fZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$DateTimeType$", { fZa: 1, f: 1, om: 1, Zs: 1 }); + var ORa = void 0; + function Ue() { + ORa || (ORa = new cZ().a()); + return ORa; + } + function dZ() { + } + dZ.prototype = new u7(); + dZ.prototype.constructor = dZ; + dZ.prototype.a = function() { + return this; + }; + dZ.prototype.$classData = r8({ gZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$DoubleType$", { gZa: 1, f: 1, om: 1, Zs: 1 }); + var PRa = void 0; + function Ke() { + PRa || (PRa = new dZ().a()); + return PRa; + } + function eZ() { + } + eZ.prototype = new u7(); + eZ.prototype.constructor = eZ; + eZ.prototype.a = function() { + return this; + }; + eZ.prototype.$classData = r8({ hZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$FileType$", { hZa: 1, f: 1, om: 1, Zs: 1 }); + var QRa = void 0; + function cf() { + QRa || (QRa = new eZ().a()); + return QRa; + } + function fZ() { + } + fZ.prototype = new u7(); + fZ.prototype.constructor = fZ; + fZ.prototype.a = function() { + return this; + }; + fZ.prototype.$classData = r8({ iZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$FloatType$", { iZa: 1, f: 1, om: 1, Zs: 1 }); + var RRa = void 0; + function Je() { + RRa || (RRa = new fZ().a()); + return RRa; + } + function gZ() { + } + gZ.prototype = new u7(); + gZ.prototype.constructor = gZ; + gZ.prototype.a = function() { + return this; + }; + gZ.prototype.$classData = r8({ jZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$IntType$", { jZa: 1, f: 1, om: 1, Zs: 1 }); + var SRa = void 0; + function Fe() { + SRa || (SRa = new gZ().a()); + return SRa; + } + function hZ() { + } + hZ.prototype = new u7(); + hZ.prototype.constructor = hZ; + hZ.prototype.a = function() { + return this; + }; + hZ.prototype.$classData = r8({ mZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$LongType$", { mZa: 1, f: 1, om: 1, Zs: 1 }); + var TRa = void 0; + function Ge() { + TRa || (TRa = new hZ().a()); + return TRa; + } + function iZ() { + } + iZ.prototype = new u7(); + iZ.prototype.constructor = iZ; + iZ.prototype.a = function() { + return this; + }; + iZ.prototype.$classData = r8({ oZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$NilType$", { oZa: 1, f: 1, om: 1, Zs: 1 }); + var URa = void 0; + function df() { + URa || (URa = new iZ().a()); + return URa; + } + function jZ() { + } + jZ.prototype = new u7(); + jZ.prototype.constructor = jZ; + jZ.prototype.a = function() { + return this; + }; + jZ.prototype.$classData = r8({ qZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$NumberType$", { qZa: 1, f: 1, om: 1, Zs: 1 }); + var VRa = void 0; + function ef() { + VRa || (VRa = new jZ().a()); + return VRa; + } + function kZ() { + } + kZ.prototype = new u7(); + kZ.prototype.constructor = kZ; + kZ.prototype.a = function() { + return this; + }; + kZ.prototype.$classData = r8({ sZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$PasswordType$", { sZa: 1, f: 1, om: 1, Zs: 1 }); + var WRa = void 0; + function De2() { + WRa || (WRa = new kZ().a()); + return WRa; + } + function lZ() { + } + lZ.prototype = new u7(); + lZ.prototype.constructor = lZ; + lZ.prototype.a = function() { + return this; + }; + lZ.prototype.$classData = r8({ tZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$StrType$", { tZa: 1, f: 1, om: 1, Zs: 1 }); + var XRa = void 0; + function Ee4() { + XRa || (XRa = new lZ().a()); + return XRa; + } + function mZ() { + } + mZ.prototype = new u7(); + mZ.prototype.constructor = mZ; + mZ.prototype.a = function() { + return this; + }; + mZ.prototype.$classData = r8({ uZa: 0 }, false, "amf.plugins.domain.shapes.models.TypeDef$TimeOnlyType$", { uZa: 1, f: 1, om: 1, Zs: 1 }); + var YRa = void 0; + function Xe() { + YRa || (YRa = new mZ().a()); + return YRa; + } + function nZ() { + } + nZ.prototype = new u7(); + nZ.prototype.constructor = nZ; + nZ.prototype.a = function() { + return this; + }; + function ZRa(a10) { + a10 = Od(O7(), a10); + return new Vh().K(new S6().a(), a10); + } + nZ.prototype.$classData = r8({ AZa: 0 }, false, "amf.plugins.domain.shapes.models.UnionShape$", { AZa: 1, f: 1, q: 1, o: 1 }); + var $Ra = void 0; + function oZ() { + } + oZ.prototype = new u7(); + oZ.prototype.constructor = oZ; + oZ.prototype.a = function() { + return this; + }; + function aSa(a10, b10, c10) { + a10 = Od(O7(), c10); + c10 = y7(); + return wi(new vi(), new S6().a(), a10, b10, c10, y7(), true); + } + oZ.prototype.$classData = r8({ CZa: 0 }, false, "amf.plugins.domain.shapes.models.UnresolvedShape$", { CZa: 1, f: 1, q: 1, o: 1 }); + var bSa = void 0; + function Rna() { + bSa || (bSa = new oZ().a()); + return bSa; + } + function pZ() { + } + pZ.prototype = new u7(); + pZ.prototype.constructor = pZ; + pZ.prototype.a = function() { + return this; + }; + pZ.prototype.$classData = r8({ EZa: 0 }, false, "amf.plugins.domain.shapes.models.XMLSerializer$", { EZa: 1, f: 1, q: 1, o: 1 }); + var cSa = void 0; + function qZ() { + } + qZ.prototype = new u7(); + qZ.prototype.constructor = qZ; + qZ.prototype.a = function() { + return this; + }; + qZ.prototype.$classData = r8({ MZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.AnyShapeAdjuster$", { MZa: 1, f: 1, q: 1, o: 1 }); + var dSa = void 0; + function rZ() { + } + rZ.prototype = new u7(); + rZ.prototype.constructor = rZ; + rZ.prototype.a = function() { + return this; + }; + function aIa(a10, b10, c10) { + a10 = new sZ().nU(c10); + return bj(a10, b10); + } + rZ.prototype.$classData = r8({ XZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeCanonizer$", { XZa: 1, f: 1, q: 1, o: 1 }); + var eSa = void 0; + function bIa() { + eSa || (eSa = new rZ().a()); + return eSa; + } + function tZ() { + } + tZ.prototype = new u7(); + tZ.prototype.constructor = tZ; + tZ.prototype.a = function() { + return this; + }; + function cIa(a10, b10, c10, e10) { + a10 = new uZ(); + a10.kf = b10; + a10.ME = e10; + a10.xf = c10; + b10 = new HM().a(); + c10 = K7(); + e10 = [q5(fSa)]; + c10 = J5(c10, new Ib().ha(e10)); + b10.B8 = c10; + a10.dr = b10; + return bj(a10, a10.kf); + } + tZ.prototype.$classData = r8({ $Za: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeExpander$", { $Za: 1, f: 1, q: 1, o: 1 }); + var gSa = void 0; + function dIa() { + gSa || (gSa = new tZ().a()); + return gSa; + } + function hSa() { + this.Ig = null; + } + hSa.prototype = new sAa(); + hSa.prototype.constructor = hSa; + d7 = hSa.prototype; + d7.a = function() { + this.Ig = "WebAPI Domain"; + return this; + }; + d7.dy = function() { + var a10 = K7(), b10 = [Qm(), li(), Tl(), Ml(), Jl(), Pl(), cj(), Yl(), xm(), Am(), Dm(), Sk(), Ud(), im(), rm2(), Gm(), Xh(), Nm(), vZ(), xE(), Jm(), aR(), uea(), vea(), sea(), tea(), dj(), An(), Gn(), dm(), Jn(), am(), Nn(), Wn(), Tn(), wZ(), Qn(), xZ(), Do(), Bea(), ho(), eo(), mo(), zea(), yZ(), uo(), xo(), ro(), Aea(), iSa(), Ao()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + var a10 = K7(), b10 = [vCa()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return Cea(); + }; + }(this)), ml()); + }; + d7.ry = function() { + var a10 = EGa(); + a10 = new R6().M("parent-end-point", a10); + jSa || (jSa = new zZ().a()); + var b10 = new R6().M("orphan-oas-extension", jSa); + kSa || (kSa = new AZ().a()); + var c10 = new R6().M("type-property-lexical-info", kSa); + lSa || (lSa = new BZ().a()); + var e10 = new R6().M("parameter-binding-in-body-lexical-info", lSa); + mSa || (mSa = new CZ().a()); + a10 = [a10, b10, c10, e10, new R6().M("invalid-binding", mSa)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + return b10.eb; + }; + d7.$classData = r8({ g_a: 0 }, false, "amf.plugins.domain.webapi.WebAPIDomainPlugin$", { g_a: 1, Yva: 1, f: 1, Zr: 1 }); + var nSa = void 0; + function Cea() { + nSa || (nSa = new hSa().a()); + return nSa; + } + function DZ() { + } + DZ.prototype = new u7(); + DZ.prototype.constructor = DZ; + DZ.prototype.a = function() { + return this; + }; + DZ.prototype.$classData = r8({ v0a: 0 }, false, "amf.plugins.domain.webapi.models.IriTemplateMapping$", { v0a: 1, f: 1, q: 1, o: 1 }); + var oSa = void 0; + function TP() { + } + TP.prototype = new u7(); + TP.prototype.constructor = TP; + TP.prototype.a = function() { + return this; + }; + TP.prototype.$classData = r8({ x0a: 0 }, false, "amf.plugins.domain.webapi.models.License$", { x0a: 1, f: 1, q: 1, o: 1 }); + var bGa = void 0; + function YP() { + } + YP.prototype = new u7(); + YP.prototype.constructor = YP; + YP.prototype.a = function() { + return this; + }; + YP.prototype.$classData = r8({ B0a: 0 }, false, "amf.plugins.domain.webapi.models.Organization$", { B0a: 1, f: 1, q: 1, o: 1 }); + var jGa = void 0; + function EZ() { + } + EZ.prototype = new u7(); + EZ.prototype.constructor = EZ; + EZ.prototype.a = function() { + return this; + }; + EZ.prototype.$classData = r8({ E0a: 0 }, false, "amf.plugins.domain.webapi.models.Payload$", { E0a: 1, f: 1, q: 1, o: 1 }); + var pSa = void 0; + function FZ() { + } + FZ.prototype = new u7(); + FZ.prototype.constructor = FZ; + FZ.prototype.a = function() { + return this; + }; + function qSa(a10) { + a10 = Od(O7(), a10); + return new Zl().K(new S6().a(), a10); + } + FZ.prototype.$classData = r8({ I0a: 0 }, false, "amf.plugins.domain.webapi.models.Server$", { I0a: 1, f: 1, q: 1, o: 1 }); + var rSa = void 0; + function oQ() { + } + oQ.prototype = new u7(); + oQ.prototype.constructor = oQ; + oQ.prototype.a = function() { + return this; + }; + function MGa(a10) { + a10 = Rs(O7(), a10); + return new GZ().K(new S6().a(), a10); + } + oQ.prototype.$classData = r8({ K0a: 0 }, false, "amf.plugins.domain.webapi.models.Tag$", { K0a: 1, f: 1, q: 1, o: 1 }); + var LGa = void 0; + function HZ() { + } + HZ.prototype = new u7(); + HZ.prototype.constructor = HZ; + HZ.prototype.a = function() { + return this; + }; + function sSa(a10, b10) { + a10 = Rs(O7(), b10); + return new Rm().K(new S6().a(), a10); + } + HZ.prototype.$classData = r8({ N0a: 0 }, false, "amf.plugins.domain.webapi.models.WebApi$", { N0a: 1, f: 1, q: 1, o: 1 }); + var tSa = void 0; + function uSa() { + tSa || (tSa = new HZ().a()); + return tSa; + } + function IZ() { + } + IZ.prototype = new u7(); + IZ.prototype.constructor = IZ; + IZ.prototype.a = function() { + return this; + }; + function vSa(a10, b10) { + a10 = Od(O7(), b10); + return new Km().K(new S6().a(), a10); + } + IZ.prototype.$classData = r8({ h1a: 0 }, false, "amf.plugins.domain.webapi.models.security.OAuth2Flow$", { h1a: 1, f: 1, q: 1, o: 1 }); + var wSa = void 0; + function xSa() { + wSa || (wSa = new IZ().a()); + return wSa; + } + function JZ() { + } + JZ.prototype = new u7(); + JZ.prototype.constructor = JZ; + JZ.prototype.a = function() { + return this; + }; + function ySa(a10, b10) { + a10 = Od(O7(), b10); + return new Hm().K(new S6().a(), a10); + } + JZ.prototype.$classData = r8({ m1a: 0 }, false, "amf.plugins.domain.webapi.models.security.Scope$", { m1a: 1, f: 1, q: 1, o: 1 }); + var zSa = void 0; + function ASa() { + zSa || (zSa = new JZ().a()); + return zSa; + } + function YD() { + this.R0 = this.S0 = null; + } + YD.prototype = new u7(); + YD.prototype.constructor = YD; + function BSa(a10, b10, c10, e10, f10) { + var g10 = new AF().a(), h10 = new (CSa())(); + DSa(a10, h10); + h10.validate(b10, c10, e10, f10, /* @__PURE__ */ function(k10, l10) { + return function(m10, p10) { + if (void 0 === m10 || null === m10) + return m10 = ka(ba.JSON.stringify(p10)), Ij(l10, m10); + m10 = new EK().d(m10); + return Gj(l10, m10); + }; + }(a10, g10)); + return g10; + } + YD.prototype.a = function() { + this.S0 = y7(); + this.R0 = y7(); + return this; + }; + function DSa(a10, b10) { + if (a10.R0.na() && a10.S0.na()) { + var c10 = a10.S0.c(); + a10 = a10.R0.c(); + b10.registerJSCode(c10, a10); + } + } + function ESa(a10, b10, c10, e10) { + var f10 = new AF().a(); + try { + yq(zq(), "SHACLValidator#validate: Creating SHACL-JS instance and loading JS libraries"); + var g10 = new (CSa())(); + DSa(a10, g10); + yq(zq(), "SHACLValidator#validate: loading Jena data model"); + var h10 = new Kb().lE(Paa()); + Raa(new Nb().gU(h10), b10, Lga()); + yq(zq(), "SHACLValidator#validate: loading Jena shapes model"); + var k10 = new Kb().lE(Paa()); + Ora(Nra(new mE(), e10.sv.un(), k10), c10); + g10.validateFromModels(h10.xs, k10.xs, /* @__PURE__ */ function(l10, m10) { + return function(p10, t10) { + if (void 0 === p10 || null === p10) + return p10 = new LR().lE(t10), Ij(m10, p10); + p10 = new EK().d(p10); + return Gj(m10, p10); + }; + }(a10, f10)); + return f10; + } catch (l10) { + a10 = Ph(E6(), l10); + if (a10 instanceof nb) + return Gj(f10, a10); + throw l10; + } + } + function FSa(a10, b10, c10, e10, f10) { + var g10 = new AF().a(), h10 = new (CSa())(); + DSa(a10, h10); + h10.validate(b10, c10, e10, f10, /* @__PURE__ */ function(k10, l10) { + return function(m10, p10) { + if (void 0 === m10 || null === m10) + return m10 = new LR().lE(p10), Ij(l10, m10); + m10 = new EK().d(m10); + return Gj(l10, m10); + }; + }(a10, g10)); + return g10; + } + function GSa(a10, b10, c10) { + a10.S0 = new z7().d(b10); + a10.R0 = new z7().d(c10); + } + function CSa() { + if (void 0 === ba.SHACLValidator) + throw mb(E6(), new nb().e("Cannot find global SHACLValidator object")); + return ba.SHACLValidator; + } + YD.prototype.report = function(a10, b10, c10, e10) { + GK(); + a10 = FSa(this, a10, b10, c10, e10); + return FK(0, a10); + }; + YD.prototype.validate = function(a10, b10, c10, e10) { + GK(); + a10 = BSa(this, a10, b10, c10, e10); + return FK(0, a10); + }; + YD.prototype.$classData = r8({ a2a: 0 }, false, "amf.plugins.features.validation.SHACLValidator", { a2a: 1, f: 1, Vgb: 1, Qgb: 1 }); + function kE() { + this.Mqa = this.Nqa = this.nv = this.Eja = null; + } + kE.prototype = new u7(); + kE.prototype.constructor = kE; + kE.prototype.Ob = function(a10) { + var b10 = a10.s, c10 = a10.ca, e10 = new rr().e(c10); + T6(); + var f10 = mh(T6(), "@id"); + T6(); + var g10 = this.Eja, h10 = mh(T6(), g10); + sr(e10, f10, h10); + T6(); + var k10 = mh(T6(), "@type"); + T6(); + var l10 = F6().Ua, m10 = ic(G5(l10, "ConstraintComponent")), p10 = mh(T6(), m10); + sr(e10, k10, p10); + if (this.nv.zh.Da()) { + T6(); + var t10 = F6().Ua, v10 = ic(G5(t10, "parameter")), A10 = mh(T6(), v10), D10 = new PA().e(e10.ca), C10 = D10.s, I10 = D10.ca, L10 = new rr().e(I10); + T6(); + var Y10 = F6().Ua, ia = ic(G5(Y10, "path")), pa = mh(T6(), ia), La = new PA().e(L10.ca), ob = La.s, zb = La.ca, Zb = new rr().e(zb); + T6(); + var Cc = mh(T6(), "@id"); + T6(); + var vc = this.nv.zh.ga().TB(), id = mh(T6(), vc); + sr(Zb, Cc, id); + pr(ob, mr(T6(), tr(ur(), Zb.s, zb), Q5().sa)); + var yd = La.s, zd = [pa]; + if (0 > yd.w) + throw new U6().e("0"); + var rd = zd.length | 0, sd = yd.w + rd | 0; + uD(yd, sd); + Ba(yd.L, 0, yd.L, rd, yd.w); + for (var le4 = yd.L, Vc = le4.n.length, Sc = 0, Qc = 0, $c = zd.length | 0, Wc = $c < Vc ? $c : Vc, Qe = le4.n.length, Qd = Wc < Qe ? Wc : Qe; Sc < Qd; ) + le4.n[Qc] = zd[Sc], Sc = 1 + Sc | 0, Qc = 1 + Qc | 0; + yd.w = sd; + pr(L10.s, vD(wD(), La.s)); + T6(); + var me4 = F6().Ua, of = ic(G5(me4, "datatype")), Le2 = mh(T6(), of), Ve = new PA().e(L10.ca), he4 = Ve.s, Wf = Ve.ca, vf = new rr().e(Wf); + T6(); + var He = mh(T6(), "@id"); + T6(); + var Ff = this.nv.zh.ga().S6a(), wf = mh(T6(), Ff); + sr(vf, He, wf); + pr(he4, mr(T6(), tr(ur(), vf.s, Wf), Q5().sa)); + var Re2 = Ve.s, we4 = [Le2]; + if (0 > Re2.w) + throw new U6().e("0"); + var ne4 = we4.length | 0, Me2 = Re2.w + ne4 | 0; + uD(Re2, Me2); + Ba(Re2.L, 0, Re2.L, ne4, Re2.w); + for (var Se4 = Re2.L, xf = Se4.n.length, ie3 = 0, gf = 0, pf = we4.length | 0, hf = pf < xf ? pf : xf, Gf = Se4.n.length, yf = hf < Gf ? hf : Gf; ie3 < yf; ) + Se4.n[gf] = we4[ie3], ie3 = 1 + ie3 | 0, gf = 1 + gf | 0; + Re2.w = Me2; + pr(L10.s, vD(wD(), Ve.s)); + pr(C10, mr(T6(), tr(ur(), L10.s, I10), Q5().sa)); + var oe4 = D10.s, lg = [A10]; + if (0 > oe4.w) + throw new U6().e("0"); + var bh = lg.length | 0, Qh = oe4.w + bh | 0; + uD(oe4, Qh); + Ba(oe4.L, 0, oe4.L, bh, oe4.w); + for (var af = oe4.L, Pf = af.n.length, oh = 0, ch = 0, Ie2 = lg.length | 0, ug = Ie2 < Pf ? Ie2 : Pf, Sg = af.n.length, Tg = ug < Sg ? ug : Sg; oh < Tg; ) + af.n[ch] = lg[oh], oh = 1 + oh | 0, ch = 1 + ch | 0; + oe4.w = Qh; + pr(e10.s, vD(wD(), D10.s)); + } else { + T6(); + var zh = F6().Ua, Rh = ic(G5(zh, "parameter")), vg = mh(T6(), Rh), dh = new PA().e(e10.ca), Jg = dh.s, Ah = dh.ca, Bh = new rr().e(Ah); + T6(); + var cg = F6().Ua, Qf = ic(G5(cg, "path")), Kg = mh(T6(), Qf), Ne2 = new PA().e(Bh.ca), Xf = Ne2.s, di = Ne2.ca, dg = new rr().e(di); + T6(); + var Hf = mh(T6(), "@id"); + T6(); + var wg = this.Nqa, Lg = mh(T6(), wg); + sr(dg, Hf, Lg); + pr(Xf, mr( + T6(), + tr(ur(), dg.s, di), + Q5().sa + )); + var jf = Ne2.s, mg = [Kg]; + if (0 > jf.w) + throw new U6().e("0"); + var Mg = mg.length | 0, Ng = jf.w + Mg | 0; + uD(jf, Ng); + Ba(jf.L, 0, jf.L, Mg, jf.w); + for (var eg = jf.L, Oe4 = eg.n.length, ng = 0, fg = 0, Ug = mg.length | 0, xg = Ug < Oe4 ? Ug : Oe4, gg = eg.n.length, fe4 = xg < gg ? xg : gg; ng < fe4; ) + eg.n[fg] = mg[ng], ng = 1 + ng | 0, fg = 1 + fg | 0; + jf.w = Ng; + pr(Bh.s, vD(wD(), Ne2.s)); + T6(); + var ge4 = F6().Ua, ph = ic(G5(ge4, "datatype")), hg = mh(T6(), ph), Jh = new PA().e(Bh.ca), fj = Jh.s, yg = Jh.ca, qh = new rr().e(yg); + T6(); + var og = mh(T6(), "@id"); + T6(); + var rh = Uh().Mi, Ch = mh(T6(), rh); + sr(qh, og, Ch); + pr( + fj, + mr(T6(), tr(ur(), qh.s, yg), Q5().sa) + ); + var Vg = Jh.s, Wg = [hg]; + if (0 > Vg.w) + throw new U6().e("0"); + var Rf = Wg.length | 0, Sh = Vg.w + Rf | 0; + uD(Vg, Sh); + Ba(Vg.L, 0, Vg.L, Rf, Vg.w); + for (var zg = Vg.L, Ji = zg.n.length, Kh = 0, Lh = 0, Ki = Wg.length | 0, gj = Ki < Ji ? Ki : Ji, Rl = zg.n.length, ek = gj < Rl ? gj : Rl; Kh < ek; ) + zg.n[Lh] = Wg[Kh], Kh = 1 + Kh | 0, Lh = 1 + Lh | 0; + Vg.w = Sh; + pr(Bh.s, vD(wD(), Jh.s)); + pr(Jg, mr(T6(), tr(ur(), Bh.s, Ah), Q5().sa)); + var Dh = dh.s, Eh = [vg]; + if (0 > Dh.w) + throw new U6().e("0"); + var Li = Eh.length | 0, Mi = Dh.w + Li | 0; + uD(Dh, Mi); + Ba(Dh.L, 0, Dh.L, Li, Dh.w); + for (var uj = Dh.L, Ni = uj.n.length, fk = 0, Ck = 0, Dk = Eh.length | 0, hj = Dk < Ni ? Dk : Ni, ri = uj.n.length, gk = hj < ri ? hj : ri; fk < gk; ) + uj.n[Ck] = Eh[fk], fk = 1 + fk | 0, Ck = 1 + Ck | 0; + Dh.w = Mi; + pr(e10.s, vD(wD(), dh.s)); + } + T6(); + var $k = F6().Ua, lm = ic(G5($k, "validator")), si = mh(T6(), lm), bf = new PA().e(e10.ca), ei = bf.s, vj = bf.ca, ti = new rr().e(vj); + T6(); + var Og = mh(T6(), "@id"); + T6(); + var Oi = this.Mqa, pg = mh(T6(), Oi); + sr(ti, Og, pg); + pr(ei, mr(T6(), tr(ur(), ti.s, vj), Q5().sa)); + var zf = bf.s, Sf = [si]; + if (0 > zf.w) + throw new U6().e("0"); + var eh = Sf.length | 0, Fh = zf.w + eh | 0; + uD(zf, Fh); + Ba(zf.L, 0, zf.L, eh, zf.w); + for (var fi = zf.L, hn = fi.n.length, mm = 0, nm = 0, kd = Sf.length | 0, Pi = kd < hn ? kd : hn, sh = fi.n.length, Pg = Pi < sh ? Pi : sh; mm < Pg; ) + fi.n[nm] = Sf[mm], mm = 1 + mm | 0, nm = 1 + nm | 0; + zf.w = Fh; + pr(e10.s, vD(wD(), bf.s)); + pr(b10, mr(T6(), tr(ur(), e10.s, c10), Q5().sa)); + }; + kE.prototype.La = function() { + return ld(); + }; + kE.prototype.$classData = r8({ f2a: 0 }, false, "amf.plugins.features.validation.emitters.ValidationJSONLDEmitter$$anon$1", { f2a: 1, f: 1, wh: 1, Ma: 1 }); + function iE() { + this.Lqa = this.Mea = this.yG = this.l = null; + } + iE.prototype = new u7(); + iE.prototype.constructor = iE; + iE.prototype.Ob = function(a10) { + var b10 = this.yG.xK; + if (b10 instanceof z7) { + var c10 = b10.i, e10 = a10.s, f10 = a10.ca, g10 = new rr().e(f10); + T6(); + var h10 = mh(T6(), "@id"); + T6(); + var k10 = this.Mea, l10 = mh(T6(), k10); + sr(g10, h10, l10); + T6(); + var m10 = mh(T6(), "@type"); + T6(); + var p10 = F6().Ua, t10 = ic(G5(p10, "JSValidator")), v10 = mh(T6(), t10); + sr(g10, m10, v10); + var A10 = this.yG.Ld; + if (!A10.b()) { + var D10 = A10.c(); + T6(); + var C10 = F6().Ua, I10 = ic(G5(C10, "message")), L10 = mh(T6(), I10), Y10 = new PA().e(g10.ca); + fE(Y10, D10, y7()); + var ia = Y10.s, pa = [L10]; + if (0 > ia.w) + throw new U6().e("0"); + var La = pa.length | 0, ob = ia.w + La | 0; + uD(ia, ob); + Ba(ia.L, 0, ia.L, La, ia.w); + for (var zb = ia.L, Zb = zb.n.length, Cc = 0, vc = 0, id = pa.length | 0, yd = id < Zb ? id : Zb, zd = zb.n.length, rd = yd < zd ? yd : zd; Cc < rd; ) + zb.n[vc] = pa[Cc], Cc = 1 + Cc | 0, vc = 1 + vc | 0; + ia.w = ob; + pr(g10.s, vD(wD(), Y10.s)); + } + T6(); + var sd = F6().Ua, le4 = ic(G5(sd, "jsLibrary")), Vc = mh(T6(), le4), Sc = new PA().e(g10.ca), Qc = Sc.s, $c = Sc.ca, Wc = new PA().e($c); + this.yG.xi.U(w6(/* @__PURE__ */ function(lm, si) { + return function(bf) { + var ei = si.s, vj = si.ca, ti = new rr().e(vj); + T6(); + var Og = F6().Ua; + Og = ic(G5(Og, "jsLibraryURL")); + var Oi = mh(T6(), Og); + Og = new PA().e(ti.ca); + var pg = Og.s, zf = Og.ca, Sf = new rr().e(zf); + T6(); + var eh = mh( + T6(), + "@value" + ); + T6(); + bf = mh(T6(), bf); + sr(Sf, eh, bf); + T6(); + bf = mh(T6(), "@type"); + T6(); + eh = mh(T6(), "http://www.w3.org/2001/XMLSchema#anyUri"); + sr(Sf, bf, eh); + pr(pg, mr(T6(), tr(ur(), Sf.s, zf), Q5().sa)); + pg = Og.s; + Oi = [Oi]; + if (0 > pg.w) + throw new U6().e("0"); + Sf = Oi.length | 0; + zf = pg.w + Sf | 0; + uD(pg, zf); + Ba(pg.L, 0, pg.L, Sf, pg.w); + Sf = pg.L; + var Fh = Sf.n.length; + eh = bf = 0; + var fi = Oi.length | 0; + Fh = fi < Fh ? fi : Fh; + fi = Sf.n.length; + for (Fh = Fh < fi ? Fh : fi; bf < Fh; ) + Sf.n[eh] = Oi[bf], bf = 1 + bf | 0, eh = 1 + eh | 0; + pg.w = zf; + pr(ti.s, vD(wD(), Og.s)); + pr(ei, mr(T6(), tr(ur(), ti.s, vj), Q5().sa)); + }; + }( + this, + Wc + ))); + T6(); + eE(); + var Qe = SA(zs(), $c), Qd = mr(0, new Sx().Ac(Qe, Wc.s), Q5().cd); + pr(Qc, Qd); + var me4 = Sc.s, of = [Vc]; + if (0 > me4.w) + throw new U6().e("0"); + var Le2 = of.length | 0, Ve = me4.w + Le2 | 0; + uD(me4, Ve); + Ba(me4.L, 0, me4.L, Le2, me4.w); + for (var he4 = me4.L, Wf = he4.n.length, vf = 0, He = 0, Ff = of.length | 0, wf = Ff < Wf ? Ff : Wf, Re2 = he4.n.length, we4 = wf < Re2 ? wf : Re2; vf < we4; ) + he4.n[He] = of[vf], vf = 1 + vf | 0, He = 1 + He | 0; + me4.w = Ve; + pr(g10.s, vD(wD(), Sc.s)); + T6(); + var ne4 = F6().Ua, Me2 = ic(G5(ne4, "jsFunctionName")), Se4 = mh(T6(), Me2), xf = new PA().e(g10.ca); + fE(xf, c10, y7()); + var ie3 = xf.s, gf = [Se4]; + if (0 > ie3.w) + throw new U6().e("0"); + var pf = gf.length | 0, hf = ie3.w + pf | 0; + uD(ie3, hf); + Ba(ie3.L, 0, ie3.L, pf, ie3.w); + for (var Gf = ie3.L, yf = Gf.n.length, oe4 = 0, lg = 0, bh = gf.length | 0, Qh = bh < yf ? bh : yf, af = Gf.n.length, Pf = Qh < af ? Qh : af; oe4 < Pf; ) + Gf.n[lg] = gf[oe4], oe4 = 1 + oe4 | 0, lg = 1 + lg | 0; + ie3.w = hf; + pr(g10.s, vD(wD(), xf.s)); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + } else if (y7() === b10) { + if (!(this.yG.nG instanceof z7)) + throw mb(E6(), new nb().e("Cannot emit validator without JS code or JS function name")); + var oh = a10.s, ch = a10.ca, Ie2 = new rr().e(ch); + T6(); + var ug = mh(T6(), "@id"); + T6(); + var Sg = this.Mea, Tg = mh( + T6(), + Sg + ); + sr(Ie2, ug, Tg); + T6(); + var zh = mh(T6(), "@type"); + T6(); + var Rh = F6().Ua, vg = ic(G5(Rh, "JSValidator")), dh = mh(T6(), vg); + sr(Ie2, zh, dh); + var Jg = this.yG.Ld; + if (!Jg.b()) { + var Ah = Jg.c(); + T6(); + var Bh = F6().Ua, cg = ic(G5(Bh, "message")), Qf = mh(T6(), cg), Kg = new PA().e(Ie2.ca); + fE(Kg, Ah, y7()); + var Ne2 = Kg.s, Xf = [Qf]; + if (0 > Ne2.w) + throw new U6().e("0"); + var di = Xf.length | 0, dg = Ne2.w + di | 0; + uD(Ne2, dg); + Ba(Ne2.L, 0, Ne2.L, di, Ne2.w); + for (var Hf = Ne2.L, wg = Hf.n.length, Lg = 0, jf = 0, mg = Xf.length | 0, Mg = mg < wg ? mg : wg, Ng = Hf.n.length, eg = Mg < Ng ? Mg : Ng; Lg < eg; ) + Hf.n[jf] = Xf[Lg], Lg = 1 + Lg | 0, jf = 1 + jf | 0; + Ne2.w = dg; + pr(Ie2.s, vD(wD(), Kg.s)); + } + T6(); + var Oe4 = F6().Ua, ng = ic(G5(Oe4, "jsLibrary")), fg = mh(T6(), ng), Ug = new PA().e(Ie2.ca), xg = Ug.s, gg = Ug.ca, fe4 = new PA().e(gg), ge4 = K7(), ph = [Hra()], hg = J5(ge4, new Ib().ha(ph)), Jh = this.yG.xi, fj = K7(); + hg.ia(Jh, fj.u).U(w6(/* @__PURE__ */ function(lm, si) { + return function(bf) { + var ei = si.s, vj = si.ca, ti = new rr().e(vj); + T6(); + var Og = F6().Ua; + Og = ic(G5(Og, "jsLibraryURL")); + var Oi = mh(T6(), Og); + Og = new PA().e(ti.ca); + var pg = Og.s, zf = Og.ca, Sf = new rr().e(zf); + T6(); + var eh = mh(T6(), "@value"); + T6(); + bf = mh(T6(), bf); + sr(Sf, eh, bf); + T6(); + bf = mh( + T6(), + "@type" + ); + T6(); + eh = mh(T6(), "http://www.w3.org/2001/XMLSchema#anyUri"); + sr(Sf, bf, eh); + pr(pg, mr(T6(), tr(ur(), Sf.s, zf), Q5().sa)); + pg = Og.s; + Oi = [Oi]; + if (0 > pg.w) + throw new U6().e("0"); + Sf = Oi.length | 0; + zf = pg.w + Sf | 0; + uD(pg, zf); + Ba(pg.L, 0, pg.L, Sf, pg.w); + Sf = pg.L; + var Fh = Sf.n.length; + eh = bf = 0; + var fi = Oi.length | 0; + Fh = fi < Fh ? fi : Fh; + fi = Sf.n.length; + for (Fh = Fh < fi ? Fh : fi; bf < Fh; ) + Sf.n[eh] = Oi[bf], bf = 1 + bf | 0, eh = 1 + eh | 0; + pg.w = zf; + pr(ti.s, vD(wD(), Og.s)); + pr(ei, mr(T6(), tr(ur(), ti.s, vj), Q5().sa)); + }; + }(this, fe4))); + T6(); + eE(); + var yg = SA(zs(), gg), qh = mr(0, new Sx().Ac( + yg, + fe4.s + ), Q5().cd); + pr(xg, qh); + var og = Ug.s, rh = [fg]; + if (0 > og.w) + throw new U6().e("0"); + var Ch = rh.length | 0, Vg = og.w + Ch | 0; + uD(og, Vg); + Ba(og.L, 0, og.L, Ch, og.w); + for (var Wg = og.L, Rf = Wg.n.length, Sh = 0, zg = 0, Ji = rh.length | 0, Kh = Ji < Rf ? Ji : Rf, Lh = Wg.n.length, Ki = Kh < Lh ? Kh : Lh; Sh < Ki; ) + Wg.n[zg] = rh[Sh], Sh = 1 + Sh | 0, zg = 1 + zg | 0; + og.w = Vg; + pr(Ie2.s, vD(wD(), Ug.s)); + T6(); + var gj = F6().Ua, Rl = ic(G5(gj, "jsFunctionName")), ek = mh(T6(), Rl), Dh = new PA().e(Ie2.ca); + fE(Dh, xra(this.yG, this.Lqa), y7()); + var Eh = Dh.s, Li = [ek]; + if (0 > Eh.w) + throw new U6().e("0"); + var Mi = Li.length | 0, uj = Eh.w + Mi | 0; + uD(Eh, uj); + Ba(Eh.L, 0, Eh.L, Mi, Eh.w); + for (var Ni = Eh.L, fk = Ni.n.length, Ck = 0, Dk = 0, hj = Li.length | 0, ri = hj < fk ? hj : fk, gk = Ni.n.length, $k = ri < gk ? ri : gk; Ck < $k; ) + Ni.n[Dk] = Li[Ck], Ck = 1 + Ck | 0, Dk = 1 + Dk | 0; + Eh.w = uj; + pr(Ie2.s, vD(wD(), Dh.s)); + pr(oh, mr(T6(), tr(ur(), Ie2.s, ch), Q5().sa)); + } else + throw new x7().d(b10); + }; + iE.prototype.La = function() { + return ld(); + }; + iE.prototype.$classData = r8({ g2a: 0 }, false, "amf.plugins.features.validation.emitters.ValidationJSONLDEmitter$$anon$2", { g2a: 1, f: 1, wh: 1, Ma: 1 }); + function KZ() { + this.dia = this.A7 = this.zN = this.e8 = this.Yha = null; + } + KZ.prototype = new u7(); + KZ.prototype.constructor = KZ; + KZ.prototype.a = function() { + HSa = this; + this.Yha = new FE().Sc(1, 1); + this.e8 = new FE().Sc(1, 10); + this.zN = new FE().Sc(0, 0); + this.A7 = new FE().Sc(-1, 1); + this.dia = ha(Ja(ksa), [this.zN, this.Yha, new FE().Sc(1, 2), new FE().Sc(1, 3), new FE().Sc(1, 4), new FE().Sc(1, 5), new FE().Sc(1, 6), new FE().Sc(1, 7), new FE().Sc(1, 8), new FE().Sc(1, 9), this.e8]); + var a10 = []; + for (var b10 = 0; 32 > b10; ) { + var c10 = b10; + c10 = GE(BE(), new qa().Sc(0 === (32 & c10) ? 1 << c10 : 0, 0 === (32 & c10) ? 0 : 1 << c10)); + a10.push(null === c10 ? null : c10); + b10 = 1 + b10 | 0; + } + ha(Ja(ksa), a10); + return this; + }; + function GE(a10, b10) { + if (0 > b10.Ud) + return -1 !== b10.od || -1 !== b10.Ud ? (a10 = b10.od, b10 = b10.Ud, ISa(new FE(), -1, new qa().Sc(-a10 | 0, 0 !== a10 ? ~b10 : -b10 | 0))) : a10.A7; + var c10 = b10.Ud; + return (0 === c10 ? -2147483638 >= (-2147483648 ^ b10.od) : 0 > c10) ? a10.dia.n[b10.od] : ISa(new FE(), 1, b10); + } + KZ.prototype.$classData = r8({ A2a: 0 }, false, "java.math.BigInteger$", { A2a: 1, f: 1, q: 1, o: 1 }); + var HSa = void 0; + function BE() { + HSa || (HSa = new KZ().a()); + return HSa; + } + function LZ() { + this.L$ = this.hja = this.doa = this.WV = this.Cma = this.Saa = this.Raa = null; + } + LZ.prototype = new u7(); + LZ.prototype.constructor = LZ; + LZ.prototype.a = function() { + JSa = this; + var a10 = this.Raa = "(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; + this.Saa = "(?:(?:[0-9a-f]{1,4}:){7}[0-9a-f]{1,4}|(?:[0-9a-f]{1,4}:){1,7}:|(?:[0-9a-f]{1,4}:){1,6}(?::[0-9a-f]{1,4})|(?:[0-9a-f]{1,4}:){1,5}(?::[0-9a-f]{1,4}){1,2}|(?:[0-9a-f]{1,4}:){1,4}(?::[0-9a-f]{1,4}){1,3}|(?:[0-9a-f]{1,4}:){1,3}(?::[0-9a-f]{1,4}){1,4}|(?:[0-9a-f]{1,4}:){1,2}(?::[0-9a-f]{1,4}){1,5}|(?:[0-9a-f]{1,4}:)(?::[0-9a-f]{1,4}){1,6}|:(?:(?::[0-9a-f]{1,4}){1,7}|:)|(?:[0-9a-f]{1,4}:){6}" + a10 + "|(?:[0-9a-f]{1,4}:){1,5}:" + a10 + "|(?:[0-9a-f]{1,4}:){1,4}(?::[0-9a-f]{1,4}):" + a10 + "|(?:[0-9a-f]{1,4}:){1,3}(?::[0-9a-f]{1,4}){1,2}:" + a10 + "|(?:[0-9a-f]{1,4}:){1,2}(?::[0-9a-f]{1,4}){1,3}:" + a10 + "|(?:[0-9a-f]{1,4}:)(?::[0-9a-f]{1,4}){1,4}:" + a10 + "|::(?:[0-9a-f]{1,4}:){1,5}" + a10 + ")(?:%[0-9a-z]+)?"; + new ba.RegExp("^" + this.Saa + "$", "i"); + a10 = "//(" + ("(?:(?:((?:[a-z0-9-_.!~*'();:&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)@)?" + ("((?:(?:[a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\\.)*(?:[a-z]|[a-z][a-z0-9-]*[a-z0-9])\\.?|" + this.Raa + "|" + ("\\[(?:" + this.Saa + ")\\]") + ")(?::([0-9]*))?") + ")?|(?:[a-z0-9-_.!~*'()$,;:@&=+]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])+") + ")(/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*(?:/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*)*)?"; + this.Cma = new ba.RegExp("^(?:" + ("([a-z][a-z0-9+-.]*):(?:(" + ("(?:" + a10 + "|(/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*(?:/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*)*))(?:\\?((?:[;/?:@&=+$,\\[\\]a-z0-9-_.!~*'()]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*))?") + ")|((?:[a-z0-9-_.!~*'();?:@&=+$,]|%[a-f0-9]{2})(?:[;/?:@&=+$,\\[\\]a-z0-9-_.!~*'()]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*))") + "|" + ("((?:" + a10 + "|(/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*(?:/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*)*)|((?:[a-z0-9-_.!~*'();@&=+$,]|%[a-f0-9]{2})*(?:/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*(?:/(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*(?:;(?:[a-z0-9-_.!~*'():@&=+$,]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*)*)*)?))(?:\\?((?:[;/?:@&=+$,\\[\\]a-z0-9-_.!~*'()]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*))?)") + ")(?:#((?:[;/?:@&=+$,\\[\\]a-z0-9-_.!~*'()]|%[a-f0-9]{2}|[^\0-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029])*))?$", "i"); + this.WV = function(b10) { + $M(); + b10 = tja(Kv(), b10); + for (var c10 = ""; b10.ud !== b10.Ze; ) { + var e10 = 255 & xJa(b10), f10 = (+(e10 >>> 0)).toString(16); + c10 = c10 + (15 >= e10 ? "%0" : "%") + f10.toUpperCase(); + } + return c10; + }; + new ba.RegExp('[\0- "#/<>?@\\[-\\^`{-}\x7F-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029]|%(?![0-9a-f]{2})', "ig"); + this.doa = new ba.RegExp( + '[\0- "#<>?\\[-\\^`{-}\x7F-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029]|%(?![0-9a-f]{2})', + "ig" + ); + this.hja = new ba.RegExp('[\0- "#/<>?\\^`{-}\x7F-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029]|%(?![0-9a-f]{2})', "ig"); + this.L$ = new ba.RegExp('[\0- "#<>@\\^`{-}\x7F-\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\u2028\u2029]|%(?![0-9a-f]{2})', "ig"); + new ba.RegExp("[^\0-\x7F]+", "g"); + return this; + }; + function YBa(a10, b10, c10, e10, f10, g10) { + var h10 = ""; + null !== b10 && (h10 = "" + h10 + b10 + ":"); + null !== c10 && (h10 = h10 + "//" + c10.replace(a10.hja, a10.WV)); + null !== e10 && (h10 = "" + h10 + e10.replace(a10.doa, a10.WV)); + null !== f10 && (h10 = h10 + "?" + f10.replace(a10.L$, a10.WV)); + null !== g10 && (h10 = h10 + "#" + g10.replace(a10.L$, a10.WV)); + return h10; + } + function MZ(a10, b10) { + if (void 0 !== b10) { + a10 = 0; + for (var c10 = ""; a10 < (b10.length | 0); ) + if (37 === (65535 & (b10.charCodeAt(a10) | 0))) { + if ((2 + a10 | 0) >= (b10.length | 0)) + throw new uK().d("Invalid escape in URI"); + var e10 = b10.substring(a10, 3 + a10 | 0); + c10 = "" + c10 + e10.toUpperCase(); + a10 = 3 + a10 | 0; + } else + c10 = "" + c10 + b10.substring(a10, 1 + a10 | 0), a10 = 1 + a10 | 0; + return c10; + } + } + function XBa(a10, b10) { + a: { + for (a10 = 0; a10 !== (b10.length | 0); ) { + if (37 === (65535 & (b10.charCodeAt(a10) | 0))) { + a10 = false; + break a; + } + a10 = 1 + a10 | 0; + } + a10 = true; + } + if (a10) + return b10; + b10 = vsa(zsa(), b10, b10.length | 0); + zsa(); + a10 = b10.By; + a10 = ja(Ja(Na), [a10]); + var c10 = a10.n.length, e10 = a10.n.length; + if (0 > e10 || e10 > a10.n.length) + throw new U6().a(); + if (0 > c10 || c10 > e10) + throw new U6().a(); + a10 = KSa(e10, a10, 0, 0, c10, false); + c10 = rsa(64); + var f10 = false; + e10 = (Kv(), new bS().a()); + var g10 = TE().wJ; + if (null === g10) + throw new Zj().e("null CodingErrorAction"); + e10.II = g10; + g10 = TE().wJ; + if (null === g10) + throw new Zj().e("null CodingErrorAction"); + for (e10.KI = g10; b10.ud !== b10.Ze; ) + switch (g10 = b10.AO(), g10) { + case 37: + if (c10.ud === c10.Ze) { + KE.prototype.qO.call(c10); + Bsa(e10, c10, a10, false); + f10 = c10; + if (f10.Ss) + throw new VE().a(); + g10 = f10.Ze - f10.ud | 0; + Ba(f10.bj, f10.Mk + f10.ud | 0, f10.bj, f10.Mk, g10); + f10.uF = -1; + KE.prototype.J1.call(f10, f10.By); + KE.prototype.qg.call(f10, g10); + } + f10 = b10.AO(); + f10 = ba.String.fromCharCode(f10); + g10 = b10.AO(); + f10 = "" + f10 + ba.String.fromCharCode(g10); + f10 = FD(ED(), f10, 16); + cS(c10, f10 << 24 >> 24); + f10 = true; + break; + default: + f10 && (KE.prototype.qO.call(c10), Bsa(e10, c10, a10, true), e10.gx = 1, KE.prototype.wja.call(c10), f10 = false), a10.EP(g10); + } + f10 && (KE.prototype.qO.call(c10), Bsa(e10, c10, a10, true), e10.gx = 1, KE.prototype.wja.call(c10)); + KE.prototype.qO.call(a10); + return a10.t(); + } + LZ.prototype.$classData = r8({ G2a: 0 }, false, "java.net.URI$", { G2a: 1, f: 1, q: 1, o: 1 }); + var JSa = void 0; + function $M() { + JSa || (JSa = new LZ().a()); + return JSa; + } + function NE() { + KE.call(this); + this.bj = null; + this.Mk = 0; + } + NE.prototype = new qsa(); + NE.prototype.constructor = NE; + function LSa() { + } + LSa.prototype = NE.prototype; + NE.prototype.h = function(a10) { + return a10 instanceof NE ? 0 === MSa(this, a10) : false; + }; + NE.prototype.V6a = function(a10, b10) { + this.bj = b10; + this.Mk = 0; + KE.prototype.ue.call(this, a10); + }; + NE.prototype.tr = function(a10) { + return MSa(this, a10); + }; + function MSa(a10, b10) { + if (a10 === b10) + return 0; + for (var c10 = a10.ud, e10 = a10.Ze - c10 | 0, f10 = b10.ud, g10 = b10.Ze - f10 | 0, h10 = e10 < g10 ? e10 : g10, k10 = 0; k10 !== h10; ) { + var l10 = (a10.bj.n[a10.Mk + (c10 + k10 | 0) | 0] | 0) - (b10.bj.n[b10.Mk + (f10 + k10 | 0) | 0] | 0) | 0; + if (0 !== l10) + return l10; + k10 = 1 + k10 | 0; + } + return e10 === g10 ? 0 : e10 < g10 ? -1 : 1; + } + NE.prototype.z = function() { + for (var a10 = this.ud, b10 = this.Ze, c10 = -547316498, e10 = a10; e10 !== b10; ) { + var f10 = MJ(); + OJ(); + c10 = f10.Ga(c10, NJ(0, this.bj.n[this.Mk + e10 | 0] | 0)); + e10 = 1 + e10 | 0; + } + return MJ().fe(c10, b10 - a10 | 0); + }; + function NZ() { + $R.call(this); + this.dba = null; + } + NZ.prototype = new vJa(); + NZ.prototype.constructor = NZ; + NZ.prototype.a = function() { + $R.prototype.p7a.call(this); + NSa = this; + this.dba = ha(Ja(Qa), [-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, -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, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, -1, -1, -1, -1, -1, -1, -1, -1]); + return this; + }; + NZ.prototype.$classData = r8({ $2a: 0 }, false, "java.nio.charset.UTF_8$", { $2a: 1, nhb: 1, f: 1, ym: 1 }); + var NSa = void 0; + function Kv() { + NSa || (NSa = new NZ().a()); + return NSa; + } + function OSa() { + } + OSa.prototype = new BJa(); + OSa.prototype.constructor = OSa; + OSa.prototype.a = function() { + return this; + }; + OSa.prototype.$classData = r8({ h3a: 0 }, false, "org.mulesoft.common.io.Fs$", { h3a: 1, uhb: 1, f: 1, g3a: 1 }); + var PSa = void 0; + function QSa() { + PSa || (PSa = new OSa().a()); + return PSa; + } + function OZ() { + this.Mja = this.uqa = this.yea = this.q3 = this.M9 = this.Xfa = this.v8 = null; + } + OZ.prototype = new u7(); + OZ.prototype.constructor = OZ; + OZ.prototype.a = function() { + RSa = this; + this.v8 = new PZ().CO(0, 0, 0, 0); + this.Xfa = SSa(new DN(), 1970, 1, 1, new z7().d(this.v8), new z7().d(0)); + this.M9 = "(\\d{4})-(\\d\\d?)-(\\d\\d?)"; + this.q3 = "(\\d\\d?):(\\d\\d?)(?::(\\d\\d?))?(?:\\.(\\d{0,9}))?"; + this.yea = "(?:(?:[\\ \\t]*)?(Z|([-+]\\d\\d?)(?::(\\d\\d?))?))?"; + this.uqa = "(?:[Tt]|[\\ \\t]+)"; + var a10 = new qg().e(this.M9), b10 = H10(); + new rg().vi(a10.ja, b10); + a10 = new qg().e(this.M9 + "(?:" + this.uqa + this.q3 + this.yea + ")?"); + b10 = H10(); + this.Mja = new rg().vi(a10.ja, b10); + a10 = new qg().e(this.q3); + b10 = H10(); + new rg().vi( + a10.ja, + b10 + ); + a10 = new qg().e("" + this.q3 + this.yea); + b10 = H10(); + new rg().vi(a10.ja, b10); + return this; + }; + function TSa(a10, b10, c10, e10, f10) { + a10 = FD(ED(), b10, 10); + c10 = FD(ED(), c10, 10); + e10 = USa(0, e10); + if (null === f10) + f10 = 0; + else { + b10 = ED(); + var g10 = new qg().e("0"); + f10 = "" + f10 + zga(g10, 9 - (f10.length | 0) | 0); + f10 = FD(b10, f10, 10); + } + return new PZ().CO(a10, c10, e10, f10); + } + function USa(a10, b10) { + return Tsa(fF(), b10) ? 0 : FD(ED(), b10, 10); + } + OZ.prototype.qj = function(a10) { + return jH(this, a10).pk(); + }; + function jH(a10, b10) { + a10 = yt(a10.Mja, b10); + if (a10.b()) + c10 = false; + else if (null !== a10.c()) { + c10 = a10.c(); + var c10 = 0 === Tu(c10, 10); + } else + c10 = false; + if (c10) { + b10 = a10.c(); + b10 = Uu(b10, 0); + c10 = a10.c(); + c10 = Uu(c10, 1); + var e10 = a10.c(); + e10 = Uu(e10, 2); + var f10 = a10.c(); + f10 = Uu(f10, 3); + var g10 = a10.c(); + g10 = Uu(g10, 4); + var h10 = a10.c(); + h10 = Uu(h10, 5); + var k10 = a10.c(); + k10 = Uu(k10, 6); + var l10 = a10.c(); + l10 = Uu(l10, 7); + var m10 = a10.c(); + m10 = Uu(m10, 8); + a10 = a10.c(); + a10 = Uu(a10, 9); + try { + ue4(); + var p10 = new DN(), t10 = USa(mF(), b10), v10 = USa(mF(), c10), A10 = USa(mF(), e10), D10 = null === f10 ? y7() : new z7().d(TSa(mF(), f10, g10, h10, k10)); + mF(); + if (null === l10) + var C10 = y7(); + else if (null === m10) + C10 = new z7().d(0); + else { + var I10 = USa( + 0, + m10 + ), L10 = USa(0, a10); + if (-24 > I10 || 24 < I10) + throw Jua(new QZ().ue(I10)); + if (0 > L10 || 60 < L10) + throw Jua(new QZ().ue(L10)); + C10 = new z7().d(ca(3600, I10) + ca(60, 0 > I10 ? -L10 | 0 : L10) | 0); + } + var Y10 = SSa(p10, t10, v10, A10, D10, C10); + return new ye4().d(Y10); + } catch (ia) { + p10 = Ph(E6(), ia); + if (null !== p10) { + if (p10 instanceof RZ) + return p10 = p10.yP, ue4(), new ve4().d(p10); + throw mb(E6(), p10); + } + throw ia; + } + } + Wsa || (Wsa = new kF().a()); + ue4(); + p10 = new VSa().Hc(b10, ""); + return new ve4().d(p10); + } + function WSa(a10, b10) { + if (0 === b10) + return "Z"; + a10 = b10 / 3600 | 0; + var c10 = (b10 / 60 | 0) % 60 | 0; + b10 = 0 < b10 ? "+" : "-"; + if (0 === c10) + c10 = ""; + else { + var e10 = 0 > c10 ? -c10 | 0 : c10; + c10 = new qg().e(":%02d"); + var f10 = [e10]; + ua(); + c10 = c10.ja; + K7(); + vk(); + e10 = []; + for (var g10 = 0, h10 = f10.length | 0; g10 < h10; ) + e10.push(EN(f10[g10])), g10 = 1 + g10 | 0; + CJ(); + f10 = e10.length | 0; + f10 = ja(Ja(Ha), [f10]); + var k10 = f10.n.length; + h10 = g10 = 0; + var l10 = e10.length | 0; + k10 = l10 < k10 ? l10 : k10; + l10 = f10.n.length; + for (k10 = k10 < l10 ? k10 : l10; g10 < k10; ) + f10.n[h10] = e10[g10], g10 = 1 + g10 | 0, h10 = 1 + h10 | 0; + c10 = PK(c10, f10); + } + e10 = 0 > a10 ? -a10 | 0 : a10; + a10 = new qg().e("%s%02d%s"); + c10 = [b10, e10, c10]; + ua(); + b10 = a10.ja; + K7(); + vk(); + a10 = []; + e10 = 0; + for (f10 = c10.length | 0; e10 < f10; ) + a10.push(EN(c10[e10])), e10 = 1 + e10 | 0; + CJ(); + c10 = a10.length | 0; + c10 = ja(Ja(Ha), [c10]); + g10 = c10.n.length; + f10 = e10 = 0; + h10 = a10.length | 0; + g10 = h10 < g10 ? h10 : g10; + h10 = c10.n.length; + for (g10 = g10 < h10 ? g10 : h10; e10 < g10; ) + c10.n[f10] = a10[e10], e10 = 1 + e10 | 0, f10 = 1 + f10 | 0; + return PK(b10, c10); + } + OZ.prototype.$classData = r8({ v3a: 0 }, false, "org.mulesoft.common.time.SimpleDateTime$", { v3a: 1, f: 1, q: 1, o: 1 }); + var RSa = void 0; + function mF() { + RSa || (RSa = new OZ().a()); + return RSa; + } + function XSa() { + } + XSa.prototype = new u7(); + XSa.prototype.constructor = XSa; + XSa.prototype.a = function() { + return this; + }; + XSa.prototype.$classData = r8({ x3a: 0 }, false, "org.mulesoft.common.time.TimeOfDay$", { x3a: 1, f: 1, q: 1, o: 1 }); + var YSa = void 0; + function ZSa() { + this.Hfa = this.dl = null; + } + ZSa.prototype = new u7(); + ZSa.prototype.constructor = ZSa; + ZSa.prototype.a = function() { + $Sa = this; + this.dl = new SZ().CO(1, 0, 1, 0); + this.Hfa = new SZ().CO(1, 0, 2147483647, 2147483647); + return this; + }; + function de4(a10, b10, c10, e10, f10) { + return 1 >= b10 && 0 >= c10 && 1 >= e10 && 0 >= f10 ? a10.dl : 1 >= b10 && 0 >= c10 && 2147483647 === e10 && 2147483647 === b10 ? a10.Hfa : new SZ().CO(b10, c10, e10, f10); + } + ZSa.prototype.$classData = r8({ F3a: 0 }, false, "org.mulesoft.lexer.InputRange$", { F3a: 1, f: 1, q: 1, o: 1 }); + var $Sa = void 0; + function ee4() { + $Sa || ($Sa = new ZSa().a()); + return $Sa; + } + function tF() { + this.Ij = this.Dg = this.cf = 0; + } + tF.prototype = new u7(); + tF.prototype.constructor = tF; + d7 = tF.prototype; + d7.h = function(a10) { + return a10 instanceof tF ? this.cf === a10.cf && this.Dg === a10.Dg && this.Ij === a10.Ij : false; + }; + d7.Fi = function(a10, b10, c10) { + this.cf = a10; + this.Dg = b10; + this.Ij = c10; + return this; + }; + d7.Yx = function() { + return 0 === this.cf && 0 === this.Dg && 0 === this.Ij; + }; + d7.t = function() { + return (0 >= this.cf && 0 >= this.Dg ? "" : "(" + this.cf + ", " + this.Dg + ")") + "@" + this.Ij; + }; + d7.tr = function(a10) { + return aTa(this, a10); + }; + d7.gs = function(a10) { + return aTa(this, a10); + }; + d7.z = function() { + return this.cf + ca(31, this.Dg + ca(31, this.Ij) | 0) | 0; + }; + function aTa(a10, b10) { + if (a10.Ij !== b10.Ij) + return a10 = a10.Ij, b10 = b10.Ij, a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + if (a10.cf !== b10.cf) + return a10 = a10.cf, b10 = b10.cf, a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + b10 = b10.Dg; + a10 = a10.Dg; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + } + d7.$classData = r8({ I3a: 0 }, false, "org.mulesoft.lexer.Position", { I3a: 1, f: 1, cM: 1, ym: 1 }); + function bTa() { + this.Wg = this.Hq = null; + } + bTa.prototype = new u7(); + bTa.prototype.constructor = bTa; + bTa.prototype.a = function() { + cTa = this; + this.Hq = (zs(), nha("", 0, 0, 0, 0, 0, 0)); + this.Wg = new wu().a(); + return this; + }; + function SA(a10, b10) { + if (null === b10) + var c10 = true; + else { + if (null === b10) + throw new sf().a(); + c10 = "" === b10; + } + if (c10) + return a10.Hq; + c10 = a10.Wg.Ja(b10); + if (c10 instanceof z7) + return c10.i; + zs(); + c10 = nha(b10, 0, 0, 0, 0, 0, 0); + a10.Wg.jm(b10, c10); + return c10; + } + function pua(a10, b10, c10, e10) { + return c10.Yx() && e10.Yx() ? SA(zs(), b10) : nha(b10, c10.Ij, e10.Ij, c10.cf, c10.Dg, e10.cf, e10.Dg); + } + bTa.prototype.$classData = r8({ M3a: 0 }, false, "org.mulesoft.lexer.SourceLocation$", { M3a: 1, f: 1, q: 1, o: 1 }); + var cTa = void 0; + function zs() { + cTa || (cTa = new bTa().a()); + return cTa; + } + function dTa() { + } + dTa.prototype = new u7(); + dTa.prototype.constructor = dTa; + dTa.prototype.a = function() { + return this; + }; + function KCa(a10, b10, c10) { + if (FF() === b10) + return DF(new EF(), FF(), c10); + if (BN() === b10) + try { + var e10 = new qg().e(c10), f10 = TD(UD(), e10.ja, 10), g10 = f10.od, h10 = f10.Ud; + return DF(new EF(), BN(), new qa().Sc(g10, h10)); + } catch (t10) { + a10 = Ph(E6(), t10); + if (null !== a10) { + if (!JJ(KJ(), a10).b()) + return DF(new EF(), FF(), c10); + throw mb(E6(), a10); + } + throw t10; + } + else if (CN2() === b10) + try { + var k10 = new qg().e(c10), l10 = Oj(va(), k10.ja); + return DF(new EF(), CN2(), l10); + } catch (t10) { + a10 = Ph(E6(), t10); + if (null !== a10) { + if (!JJ(KJ(), a10).b()) + return DF(new EF(), FF(), c10); + throw mb(E6(), a10); + } + throw t10; + } + else if (AN() === b10) + try { + var m10 = new qg().e(c10), p10 = iH(m10.ja); + return DF(new EF(), AN(), p10); + } catch (t10) { + a10 = Ph(E6(), t10); + if (null !== a10) { + if (!JJ(KJ(), a10).b()) + return DF(new EF(), FF(), c10); + throw mb(E6(), a10); + } + throw t10; + } + else + throw new x7().d(b10); + } + dTa.prototype.$classData = r8({ V3a: 0 }, false, "org.yaml.builder.DocBuilder$Scalar$", { V3a: 1, f: 1, q: 1, o: 1 }); + var eTa = void 0; + function LCa() { + eTa || (eTa = new dTa().a()); + return eTa; + } + function Yq() { + wS.call(this); + this.Ww = null; + } + Yq.prototype = new LJa(); + Yq.prototype.constructor = Yq; + Yq.prototype.Gaa = function(a10, b10, c10) { + this.Ww = c10; + wS.prototype.Gaa.call(this, a10, b10, c10); + return this; + }; + function fTa(a10, b10) { + var c10 = b10.pM; + b10 = b10.r; + if (FF() === c10 && sp(b10)) + c10 = new Aj().d(a10.Ps), b10 = "" + gc(34) + eF(fF(), b10) + gc(34), a10.Ww.hv(c10.Rp, b10); + else if (AN() === c10 && "boolean" === typeof b10) + c10 = !!b10, b10 = new Aj().d(a10.Ps), a10.Ww.hv(b10.Rp, "" + c10); + else if (BN() === c10 && b10 instanceof qa) { + b10 = Da(b10); + c10 = b10.od; + var e10 = b10.Ud; + b10 = new Aj().d(a10.Ps); + c10 = yza(Ea(), c10, e10); + a10.Ww.hv(b10.Rp, c10); + } else + CN2() === c10 && "number" === typeof b10 && (c10 = "" + +b10, -1 === wta(ua(), c10, 46) ? (b10 = new qg().e(c10), b10 = !mu(b10, gc(101))) : b10 = false, b10 ? (b10 = new qg().e(c10), b10 = !mu(b10, gc(69))) : b10 = false, b10 && (c10 += ".0"), b10 = new Aj().d(a10.Ps), a10.Ww.hv( + b10.Rp, + c10 + )); + } + function MJa(a10, b10) { + var c10 = new Aj().d(a10.Ps); + a10.Ww.yD(c10.Rp, 91); + c10 = new gTa().n1(a10); + tda(c10, b10); + b10 = new Aj().d(a10.Ps); + a10.Ww.yD(b10.Rp, 93); + } + function NJa(a10, b10) { + var c10 = new Aj().d(a10.Ps); + a10.Ww.yD(c10.Rp, 123); + c10 = new hTa().n1(a10); + tda(c10, b10); + b10 = new Aj().d(a10.Ps); + a10.Ww.yD(b10.Rp, 125); + } + Yq.prototype.$classData = r8({ Z3a: 0 }, false, "org.yaml.builder.JsonOutputBuilder", { Z3a: 1, yhb: 1, Sha: 1, f: 1 }); + function hTa() { + this.AV = this.BV = false; + this.Fa = null; + } + hTa.prototype = new ota(); + hTa.prototype.constructor = hTa; + d7 = hTa.prototype; + d7.y0 = function(a10, b10) { + iTa(this, a10); + fTa(this.Fa, b10); + }; + d7.n1 = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.V1(true); + this.U1(false); + return this; + }; + d7.V1 = function(a10) { + this.BV = a10; + }; + function iTa(a10, b10) { + vda(a10); + var c10 = new Aj().d(a10.Fa.Ps); + a10.Fa.Ww.yD(c10.Rp, 34); + c10 = new Aj().d(a10.Fa.Ps); + a10.Fa.Ww.hv(c10.Rp, b10); + b10 = new Aj().d(a10.Fa.Ps); + a10.Fa.Ww.hv(b10.Rp, '": '); + } + d7.U1 = function(a10) { + this.AV = a10; + }; + d7.kg = function(a10, b10) { + iTa(this, a10); + b10.P(new gTa().n1(this.Fa)); + }; + d7.$classData = r8({ a4a: 0 }, false, "org.yaml.builder.JsonOutputBuilder$MyEntry", { a4a: 1, Tha: 1, f: 1, $3a: 1 }); + function gTa() { + this.AV = this.BV = false; + this.Fa = null; + } + gTa.prototype = new qta(); + gTa.prototype.constructor = gTa; + d7 = gTa.prototype; + d7.Uk = function(a10) { + vda(this); + MJa(this.Fa, a10); + y7(); + }; + d7.n1 = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.V1(true); + this.U1(false); + return this; + }; + d7.V1 = function(a10) { + this.BV = a10; + }; + d7.jX = function(a10) { + vda(this); + fTa(this.Fa, a10); + }; + d7.U1 = function(a10) { + this.AV = a10; + }; + d7.Y4 = function() { + }; + d7.Gi = function(a10) { + vda(this); + NJa(this.Fa, a10); + return y7(); + }; + d7.$classData = r8({ b4a: 0 }, false, "org.yaml.builder.JsonOutputBuilder$MyPart", { b4a: 1, Uha: 1, f: 1, $3a: 1 }); + function jTa() { + AS.call(this); + } + jTa.prototype = new BS(); + jTa.prototype.constructor = jTa; + jTa.prototype.a = function() { + AS.prototype.RO.call(this, Q5().ti, false); + return this; + }; + jTa.prototype.$classData = r8({ h4a: 0 }, false, "org.yaml.convert.YRead$BooleanYRead$", { h4a: 1, $R: 1, f: 1, az: 1 }); + var kTa = void 0; + function pM() { + kTa || (kTa = new jTa().a()); + return kTa; + } + function lTa() { + AS.call(this); + } + lTa.prototype = new BS(); + lTa.prototype.constructor = lTa; + lTa.prototype.a = function() { + AS.prototype.RO.call(this, Q5().cs, mF().Xfa); + return this; + }; + lTa.prototype.$classData = r8({ i4a: 0 }, false, "org.yaml.convert.YRead$DTYRead$", { i4a: 1, $R: 1, f: 1, az: 1 }); + var mTa = void 0; + function nTa() { + mTa || (mTa = new lTa().a()); + return mTa; + } + function TZ() { + AS.call(this); + } + TZ.prototype = new BS(); + TZ.prototype.constructor = TZ; + TZ.prototype.a = function() { + AS.prototype.RO.call(this, Q5().of, 0); + return this; + }; + TZ.prototype.Av = function(a10) { + var b10 = AS.prototype.Av.call(this, a10); + if (b10 instanceof ye4) + return b10; + a10 = oTa().Av(a10); + return a10 instanceof ye4 ? (b10 = Da(a10.i), a10 = b10.od, b10 = b10.Ud, new ye4().d(SD(Ea(), a10, b10))) : a10; + }; + TZ.prototype.$classData = r8({ j4a: 0 }, false, "org.yaml.convert.YRead$DoubleYRead$", { j4a: 1, $R: 1, f: 1, az: 1 }); + var pTa = void 0; + function qTa() { + pTa || (pTa = new TZ().a()); + return pTa; + } + function UZ() { + AS.call(this); + } + UZ.prototype = new BS(); + UZ.prototype.constructor = UZ; + UZ.prototype.a = function() { + AS.prototype.RO.call(this, Q5().cj, 0); + return this; + }; + UZ.prototype.Av = function(a10) { + var b10 = oTa().Av(a10); + if (b10 instanceof ve4) + return b10; + if (b10 instanceof ye4) { + var c10 = Da(b10.i); + b10 = c10.od; + c10 = c10.Ud; + if ((-1 === c10 ? 0 <= (-2147483648 ^ b10) : -1 < c10) && (0 === c10 ? -1 >= (-2147483648 ^ b10) : 0 > c10)) + return ue4(), new ye4().d(b10); + } + return HF(JF(), a10, "Out of range"); + }; + UZ.prototype.$classData = r8({ k4a: 0 }, false, "org.yaml.convert.YRead$IntYRead$", { k4a: 1, $R: 1, f: 1, az: 1 }); + var rTa = void 0; + function TAa() { + rTa || (rTa = new UZ().a()); + return rTa; + } + function sTa() { + AS.call(this); + } + sTa.prototype = new BS(); + sTa.prototype.constructor = sTa; + sTa.prototype.a = function() { + AS.prototype.RO.call(this, Q5().cj, Ea().dl); + return this; + }; + sTa.prototype.$classData = r8({ l4a: 0 }, false, "org.yaml.convert.YRead$LongYRead$", { l4a: 1, $R: 1, f: 1, az: 1 }); + var tTa = void 0; + function oTa() { + tTa || (tTa = new sTa().a()); + return tTa; + } + function uTa() { + AS.call(this); + } + uTa.prototype = new BS(); + uTa.prototype.constructor = uTa; + uTa.prototype.a = function() { + AS.prototype.RO.call(this, Q5().Na, ""); + return this; + }; + uTa.prototype.$classData = r8({ n4a: 0 }, false, "org.yaml.convert.YRead$StringYRead$", { n4a: 1, $R: 1, f: 1, az: 1 }); + var vTa = void 0; + function Dd() { + vTa || (vTa = new uTa().a()); + return vTa; + } + function SG() { + hS.call(this); + } + SG.prototype = new FJa(); + SG.prototype.constructor = SG; + d7 = SG.prototype; + d7.mma = function() { + iS(this, VF().SM); + kS(this); + }; + d7.noa = function() { + iS(this, VF().YI); + }; + d7.YG = function(a10, b10) { + hS.prototype.YG.call(this, a10, b10); + return this; + }; + function wTa(a10, b10) { + for (; ; ) + if (b10.Ha(65535 & a10.kb.Db.fc) ? 0 : VZ(a10.kb.Db)) { + var c10 = a10.kb; + oS(c10.Db, c10.jg, c10.Sj); + } else + break; + iS(a10, VF().Vv); + } + d7.Kka = function(a10) { + switch (a10) { + case 91: + tS(this, VF().zF); + break; + case 123: + tS(this, VF().PC); + break; + case 93: + tS(this, VF().ZC); + break; + case 125: + tS(this, VF().wx); + break; + case 58: + tS(this, VF().Ai); + break; + case 44: + tS(this, VF().Ai); + break; + case 34: + a10 = false; + iS(this, VF().Tv); + for (tS(this, VF().Ai); ; ) + if (34 !== this.kb.Db.fc && this.kb.Db.fc !== rF().Xs) + if (92 === this.kb.Db.fc) { + a10 && (iS(this, VF().bs), a10 = false); + iS(this, VF().TM); + tS(this, VF().Ai); + var b10 = 65535 & this.kb.Db.fc; + 85 === sja(Ku(), b10) && mS(this.kb, 4); + tS(this, VF().as); + iS(this, VF().XM); + } else + a10 = true, b10 = this.kb, oS(b10.Db, b10.jg, b10.Sj); + else + break; + a10 && iS(this, VF().bs); + tS(this, VF().Ai); + iS(this, VF().Ws); + break; + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + iS(this, VF().Tv); + nS(this, 45); + a10 = true; + if (!nS(this, 48)) + for (b10 = this.kb, oS(b10.Db, b10.jg, b10.Sj), b10 = this.kb; ; ) { + var c10 = b10.Db.fc; + if (tta(LF(), c10)) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + } + else if (tta(LF(), this.kb.Db.fc)) { + a10 = false; + b10 = [44, 93, 125, 34, 91, 123, 58]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + for (var e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + wTa(this, b10); + } + if (a10) { + if (nS(this, 46)) + for (a10 = this.kb; ; ) + if (b10 = a10.Db.fc, tta(LF(), b10)) + oS(a10.Db, a10.jg, a10.Sj); + else + break; + if (nS(this, 101) || nS(this, 69)) + for (nS(this, 43) || nS(this, 45), a10 = this.kb; ; ) + if (b10 = a10.Db.fc, tta(LF(), b10)) + oS(a10.Db, a10.jg, a10.Sj); + else + break; + iS(this, VF().bs); + } + iS(this, VF().Ws); + break; + case 10: + tS(this, VF().$y); + break; + case 32: + case 9: + case 13: + for (a10 = this.kb; ; ) + if (b10 = a10.Db.fc, LF(), 32 === b10 || 9 === b10 || 13 === b10) + oS(a10.Db, a10.jg, a10.Sj); + else + break; + iS(this, VF().fB); + break; + case 110: + xTa(this, "null"); + break; + case 116: + xTa(this, "true"); + break; + case 102: + xTa(this, "false"); + break; + default: + a10 = [91, 93, 123, 125, 58, 44]; + if (0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + wTa(this, a10); + } + }; + function xTa(a10, b10) { + b10 = HJa(a10, b10); + if (0 < b10) + iS(a10, VF().Tv), mS(a10.kb, b10), iS(a10, VF().bs), iS(a10, VF().Ws); + else { + b10 = [44, 58]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + for (var c10 = wd(new xd(), vd()), e10 = 0, f10 = b10.length | 0; e10 < f10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + wTa(a10, b10); + } + } + d7.$classData = r8({ x4a: 0 }, false, "org.yaml.lexer.JsonLexer", { x4a: 1, A3a: 1, f: 1, G3a: 1 }); + function SF() { + hS.call(this); + this.Co = null; + } + SF.prototype = new FJa(); + SF.prototype.constructor = SF; + function WZ(a10) { + return new Hd().Dr(a10.dQ.jb(), a10.tL, KJa(a10.Co)); + } + function yTa(a10, b10) { + return zTa(a10, 0, b10) && (XZ(a10), true); + } + function ATa(a10, b10, c10) { + if (43 !== c10) { + 45 !== c10 && iS(a10, VF().Ws); + for (c10 = WZ(a10); ; ) { + var e10; + if (e10 = VZ(a10.kb.Db)) { + e10 = a10; + var f10 = b10, g10 = vS(e10.Co, 2147483647); + e10 = g10 <= f10 && lS(e10, g10, VF().GF) && YZ(a10, VF().$y); + } + if (e10) + c10 = WZ(a10); + else + break; + } + ZZ(a10, c10); + } else { + for (c10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && $Z(a10, b10, a_())) + c10 = WZ(a10); + else + break; + ZZ(a10, c10); + iS(a10, VF().Ws); + } + c10 = WZ(a10); + e10 = vS(a10.Co, 2147483647); + if (e10 < b10 && lS(a10, e10, VF().GF) && BTa(a10)) { + for (b10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && CTa(a10)) + b10 = WZ(a10); + else + break; + ZZ(a10, b10); + b10 = true; + } else + b10 = false; + b10 || ZZ(a10, c10); + return true; + } + function DTa(a10, b10, c10) { + var e10 = WZ(a10); + if (iS(a10, VF().Lfa)) { + if (ETa(a10)) { + var f10 = WZ(a10); + b_(a10, b10, c10) && FTa(a10) || ZZ(a10, f10); + f10 = true; + } else + f10 = false; + f10 ? b10 = true : FTa(a10) ? (f10 = WZ(a10), b_(a10, b10, c10) && ETa(a10) || ZZ(a10, f10), b10 = true) : b10 = false; + } else + b10 = false; + (b10 = b10 ? iS(a10, VF().Wfa) : false) || ZZ(a10, e10); + return b10; + } + function $Z(a10, b10, c10) { + var e10 = GTa(); + null !== c10 && c10 === e10 ? c10 = true : (e10 = HTa(), c10 = null !== c10 && c10 === e10); + return ITa(a10, b10, c10, true) ? YZ(a10, VF().nJ) : false; + } + function JTa(a10) { + iS(a10, VF().Tv); + return iS(a10, VF().Ws); + } + function KTa(a10) { + return 0 !== a10.kb.Db.Dg ? true : !LTa(a10) && !MTa(a10); + } + function NTa(a10, b10) { + if (KTa(a10)) { + for (var c10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && $Z(a10, b10, a_())) + c10 = WZ(a10); + else + break; + ZZ(a10, c10); + if (c_(a10, b10) && !NF(PF(), a10.kb.Db.fc)) { + for (b10 = a10.kb; c10 = b10.Db.fc, !NF(PF(), c10); ) + oS(b10.Db, b10.jg, b10.Sj); + return iS(a10, VF().bs); + } + } + return false; + } + function OTa(a10, b10) { + return HTa() === b10 || d_() === b10 ? OF(PF(), a10) && !xta(PF(), a10) : OF(PF(), a10); + } + function e_(a10, b10) { + return a10.kb.Db.fc === b10 ? tS(a10, VF().Ai) : false; + } + function PTa(a10) { + switch (a10) { + case 34: + case 39: + return new z7().d(a10); + case 123: + return new z7().d(125); + case 91: + return new z7().d(93); + default: + return y7(); + } + } + function QTa(a10, b10, c10) { + if (zta(PF(), a10.kb.Db.fc)) { + var e10 = WZ(a10); + (b10 = RTa(a10, b10, c10)) || ZZ(a10, e10); + return b10 ? true : YZ(a10, VF().YY); + } + return false; + } + function STa(a10, b10) { + var c10 = 63 === a10.kb.Db.fc; + if (c10 || TTa(a10)) { + var e10 = WZ(a10); + iS(a10, VF().rR); + if (c10) + if (e_(a10, 63) && UTa(a10, b10, VTa())) { + c10 = WZ(a10); + var f10 = WZ(a10); + (b10 = c_(a10, b10) && e_(a10, 58) && UTa(a10, b10, VTa())) || ZZ(a10, f10); + (b10 = b10 || f_(a10)) || ZZ(a10, c10); + } else + b10 = false; + else { + c10 = WZ(a10); + f10 = WZ(a10); + var g10 = yTa(a10, g_()); + g10 || ZZ(a10, f10); + g10 ? f10 = true : (f10 = WZ(a10), (g10 = WTa(a10, g_())) || ZZ(a10, f10), f10 = g10); + (b10 = f10 || f_(a10) ? XTa(a10, b10) : false) || ZZ(a10, c10); + } + (b10 = b10 && iS(a10, VF().AR)) || ZZ(a10, e10); + return b10; + } + return false; + } + SF.prototype.mma = function() { + YTa(this); + kS(this); + }; + function ZTa(a10, b10, c10) { + switch (a10.kb.Db.fc) { + case 91: + if (91 === a10.kb.Db.fc) { + var e10 = WZ(a10), f10; + if (f10 = iS(a10, VF().zF) && tS(a10, VF().Ai) && ($Ta(a10, b10, c10), true)) { + c10 = aUa(c10); + for (; ; ) + if (93 !== a10.kb.Db.fc) { + f10 = a10; + var g10 = b10, h10 = c10, k10 = WZ(f10), l10; + if (l10 = iS(f10, VF().Tu)) { + l10 = f10; + var m10 = VF().PC, p10 = VF().rR; + iS(l10, m10); + l10 = iS(l10, p10); + } + if (l10) { + var t10; + l10 = f10; + m10 = g10; + p10 = h10; + if (!(t10 = e_(l10, 63) && b_(l10, m10, p10) && bUa(l10, m10, p10))) { + t10 = WZ(l10); + var v10 = WTa(l10, d_()) && cUa(l10, m10, p10); + v10 || ZZ(l10, t10); + v10 || dUa(l10, m10, p10) ? t10 = true : (t10 = WZ(l10), (m10 = yTa(l10, d_()) && eUa(l10, m10, p10)) || ZZ(l10, t10), t10 = m10); + } + l10 = t10; + } + l10 && (l10 = f10, m10 = VF().AR, p10 = VF().wx, iS(l10, m10), l10 = iS(l10, p10)); + (l10 = l10 && iS(f10, VF().Uu)) || ZZ(f10, k10); + l10 ? f10 = true : (k10 = WZ(f10), (g10 = iS(f10, VF().Tu) && fUa(f10, g10, h10) && iS(f10, VF().Uu)) || ZZ(f10, k10), f10 = g10); + if (f10) { + $Ta(a10, b10, c10); + if (gUa(a10.kb.Db.fc)) { + for (f10 = a10.kb; ; ) + if (gUa(f10.Db.fc)) + oS(f10.Db, f10.jg, f10.Sj); + else + break; + iS(a10, VF().Vv); + } + f10 = a10.kb.Db.fc; + if (93 === f10 || f10 === rF().Xs) + break; + tS(a10, VF().Ai); + $Ta(a10, b10, c10); + } else + break; + } else + break; + f10 = true; + } + (b10 = f10 && 93 === a10.kb.Db.fc && tS(a10, VF().Ai) ? iS(a10, VF().ZC) : false) || ZZ(a10, e10); + a10 = b10; + } else + a10 = false; + return a10; + case 123: + if (123 === a10.kb.Db.fc) { + e10 = WZ(a10); + if (f10 = iS(a10, VF().PC) && tS(a10, VF().Ai) && ($Ta(a10, b10, c10), true)) { + c10 = aUa(c10); + for (; ; ) + if (125 !== a10.kb.Db.fc) + if (f10 = a10, g10 = b10, h10 = c10, iS(f10, VF().rR) && (e_(f10, 63) && b_(f10, g10, h10) && bUa(f10, g10, h10) || hUa(f10, g10, h10)) && iS(f10, VF().AR)) + if ($Ta(a10, b10, c10), e_(a10, 44)) + $Ta(a10, b10, c10); + else + break; + else + break; + else + break; + f10 = true; + } + f10 && 125 === a10.kb.Db.fc && tS(a10, VF().Ai) && iS(a10, VF().wx) ? (XZ(a10), b10 = true) : b10 = false; + b10 || ZZ(a10, e10); + a10 = b10; + } else + a10 = false; + return a10; + case 39: + return iUa(a10, b10, c10, 39); + case 34: + return iUa(a10, b10, c10, 34); + default: + return false; + } + } + function jUa(a10, b10, c10) { + var e10 = sS(a10.kb, b10); + return 35 === e10 ? 32 !== sS(a10.kb, -1 + b10 | 0) : 58 === e10 ? OTa(sS(a10.kb, 1 + b10 | 0), c10) : !(32 === e10 || 9 === e10 || 13 === e10 || 10 === e10 || rF().Xs === e10) && OTa(sS(a10.kb, b10), c10); + } + function kUa(a10) { + if (iS(a10, VF().s5)) { + if (33 === sS(a10.kb, 1) && e_(a10, 33) && e_(a10, 33)) + var b10 = true; + else if (Ata(PF(), sS(a10.kb, 1))) { + b10 = WZ(a10); + e_(a10, 33); + for (var c10 = a10.kb; ; ) { + var e10 = c10.Db.fc; + if (Ata(PF(), e10)) + oS(c10.Db, c10.jg, c10.Sj); + else + break; + } + (c10 = iS(a10, VF().as) && e_(a10, 33)) || ZZ(a10, b10); + b10 = c10; + } else + b10 = false; + b10 = b10 ? true : e_(a10, 33); + } else + b10 = false; + return b10 ? iS(a10, VF().I5) : false; + } + function lUa(a10) { + if (37 === a10.kb.Db.fc) { + var b10 = /* @__PURE__ */ function(f10) { + return function() { + if (37 === f10.kb.Db.fc && iS(f10, VF().r5) && tS(f10, VF().Ai)) { + var g10 = WZ(f10), h10 = mUa(f10); + h10 || ZZ(f10, g10); + if (h10) + g10 = true; + else { + g10 = WZ(f10); + if (h10 = IJa(f10, "TAG")) { + if (iS(f10, VF().as), h10 = XZ(f10) && kUa(f10) && XZ(f10)) { + h10 = WZ(f10); + if (iS(f10, VF().vX)) { + if (e_(f10, 33)) { + for (var k10 = WZ(f10); ; ) + if (VZ(f10.kb.Db) && nUa(f10)) + k10 = WZ(f10); + else + break; + ZZ(f10, k10); + k10 = true; + } else + k10 = false; + if (k10) + k10 = true; + else if (oUa(f10)) { + for (k10 = WZ(f10); ; ) + if (VZ(f10.kb.Db) && nUa(f10)) + k10 = WZ(f10); + else + break; + ZZ(f10, k10); + k10 = true; + } else + k10 = false; + } else + k10 = false; + (k10 = k10 && iS(f10, VF().as) ? iS(f10, VF().WX) : false) || ZZ(f10, h10); + h10 = k10; + } + } + h10 || ZZ(f10, g10); + g10 = h10; + } + if (g10) + g10 = true; + else { + g10 = WZ(f10); + if (pUa(f10)) { + for (h10 = WZ(f10); ; ) + if (VZ(f10.kb.Db) && XZ(f10) && pUa(f10)) + h10 = WZ(f10); + else + break; + ZZ(f10, h10); + h10 = true; + } else + h10 = false; + h10 || ZZ(f10, g10); + g10 = h10; + } + } else + g10 = false; + return g10 && iS(f10, VF().H5) ? h_(f10) : false; + }; + }(a10), c10 = WZ(a10), e10 = !!b10(); + if (e10) + for (; c10 = WZ(a10), VZ(a10.kb.Db) && b10(); ) + ; + ZZ(a10, c10); + b10 = e10; + } else + b10 = false; + return b10 ? qUa(a10) : false; + } + function XZ(a10) { + var b10 = uS(a10.Co, 0); + return 0 < b10 && lS(a10, b10, VF().fB) ? true : 0 === a10.kb.Db.Dg; + } + function $Ta(a10, b10, c10) { + if (d_() === c10 || g_() === c10) + XZ(a10); + else { + c10 = WZ(a10); + var e10; + if (e10 = h_(a10)) + (b10 = ITa(a10, b10, true, false)) || (MTa(a10) || LTa(a10) ? b10 = false : (b10 = vS(a10.Co, 2147483647), e10 = uS(a10.Co, b10), lS(a10, b10, VF().GF), b10 = lS(a10, e10, VF().fB))), e10 = b10; + (b10 = e10) || ZZ(a10, c10); + b10 || XZ(a10); + } + } + function BTa(a10) { + if (35 !== a10.kb.Db.fc) + return false; + iS(a10, VF().q5); + for (tS(a10, VF().Ai); !NF(PF(), a10.kb.Db.fc); ) { + var b10 = a10.kb; + oS(b10.Db, b10.jg, b10.Sj); + } + iS(a10, VF().as); + iS(a10, VF().G5); + return rUa(a10); + } + function bUa(a10, b10, c10) { + return (44 === a10.kb.Db.fc || 125 === a10.kb.Db.fc) && f_(a10) && f_(a10) ? true : hUa(a10, b10, c10); + } + function dUa(a10, b10, c10) { + var e10 = WZ(a10); + (b10 = f_(a10) && cUa(a10, b10, c10)) || ZZ(a10, e10); + return b10; + } + function sUa(a10, b10, c10) { + var e10 = WZ(a10), f10; + if (f10 = iS(a10, VF().Tu)) { + f10 = WZ(a10); + if (b_(a10, 1 + b10 | 0, c10)) { + DTa(a10, 1 + b10 | 0, c10) && b_(a10, 1 + b10 | 0, c10); + if (124 === a10.kb.Db.fc) { + iS(a10, VF().Tv); + tS(a10, VF().Ai); + var g10 = tUa(a10, b10); + if (null === g10) + throw new x7().d(g10); + var h10 = g10.JM(); + g10 = g10.a5(); + h10 = b10 + h10 | 0; + var k10 = WZ(a10); + if (NTa(a10, h10)) { + for (var l10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && YZ(a10, VF().nJ) && NTa(a10, h10)) + l10 = WZ(a10); + else + break; + ZZ(a10, l10); + l10 = true; + } else + l10 = false; + (l10 = l10 ? uUa(a10, g10) : false) || ZZ(a10, k10); + l10 || 45 === g10 && iS(a10, VF().Ws); + g10 = ATa(a10, h10, g10); + } else + g10 = false; + if (!g10) + if (62 === a10.kb.Db.fc && iS(a10, VF().Tv) && tS(a10, VF().Ai)) { + g10 = tUa(a10, b10); + if (null === g10) + throw new x7().d(g10); + h10 = g10.JM(); + g10 = g10.a5(); + h10 = b10 + h10 | 0; + k10 = WZ(a10); + if (vUa(a10, h10)) { + for (l10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && YZ(a10, VF().nJ) && vUa(a10, h10)) + l10 = WZ(a10); + else + break; + ZZ(a10, l10); + l10 = true; + } else + l10 = false; + (l10 = l10 ? uUa(a10, g10) : false) || ZZ(a10, k10); + l10 || 45 === g10 && iS(a10, VF().Ws); + g10 = ATa(a10, h10, g10); + } else + g10 = false; + } else + g10 = false; + g10 || ZZ(a10, f10); + (f10 = g10) || (f10 = WZ(a10), (g10 = b_(a10, 1 + b10 | 0, c10) && DTa(a10, 1 + b10 | 0, c10) && wUa(a10, c10, b10)) || ZZ(a10, f10), g10 ? f10 = true : (f10 = WZ(a10), (c10 = wUa(a10, c10, b10)) || ZZ(a10, f10), f10 = c10)); + } + (c10 = f10 && iS(a10, VF().Uu)) || ZZ(a10, e10); + if (c10) + return true; + e10 = WZ(a10); + (b10 = b_(a10, 1 + b10 | 0, GTa()) && iS(a10, VF().Tu) && fUa(a10, 1 + b10 | 0, GTa()) && iS(a10, VF().Uu) && h_(a10)) || ZZ(a10, e10); + return b10; + } + function MTa(a10) { + return 45 === a10.kb.Db.fc && 45 === sS(a10.kb, 1) ? 45 === sS(a10.kb, 2) : false; + } + function zTa(a10, b10, c10) { + if (iS(a10, VF().Tu)) { + DTa(a10, b10, c10) && b_(a10, b10, c10); + var e10 = true; + } else + e10 = false; + return e10 && ZTa(a10, b10, c10) ? iS(a10, VF().Uu) : false; + } + function xUa(a10, b10, c10) { + var e10 = a10.kb.Db.fc, f10 = sS(a10.kb, 1); + if (OF(PF(), e10) && !vta(PF(), e10) || (45 === e10 || 58 === e10 || 63 === e10) && OTa(f10, c10)) { + iS(a10, VF().Tv); + if (d_() === c10 || g_() === c10) + yUa(a10, c10); + else { + yUa(a10, c10); + for (e10 = WZ(a10); ; ) { + if (VZ(a10.kb.Db)) { + f10 = a10; + var g10 = b10; + XZ(f10); + if (QTa(f10, g10, HTa()) && ITa(f10, g10, true, false)) { + g10 = a10; + if (f10 = jUa(g10, 0, c10)) + g10 = g10.kb, oS(g10.Db, g10.jg, g10.Sj); + f10 ? (f10 = zUa(a10, c10)) && iS(a10, VF().bs) : f10 = false; + } else + f10 = false; + } else + f10 = false; + if (f10) + e10 = WZ(a10); + else + break; + } + ZZ(a10, e10); + } + a10 = iS(a10, VF().Ws); + } else + a10 = false; + return a10; + } + function AUa(a10, b10) { + if (0 === a10.kb.Db.Dg) { + var c10 = BUa(a10, b10); + if (0 < c10 && iS(a10, VF().PC)) { + b10 = /* @__PURE__ */ function(f10, g10, h10) { + return function() { + return c_(f10, g10 + h10 | 0) && STa(f10, g10 + h10 | 0); + }; + }(a10, b10, c10); + c10 = WZ(a10); + var e10 = !!b10(); + if (e10) + for (; c10 = WZ(a10), VZ(a10.kb.Db) && b10(); ) + ; + ZZ(a10, c10); + b10 = e10; + } else + b10 = false; + return b10 ? iS(a10, VF().wx) : false; + } + return false; + } + function CUa(a10, b10) { + if (vS(a10.Co, 2147483647) === b10 && OF(PF(), sS(a10.kb, b10))) { + lS(a10, b10, VF().GF); + for (b10 = a10.kb; ; ) { + var c10 = b10.Db.fc; + if (Cta(PF(), c10)) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + } + return iS(a10, VF().bs); + } + return false; + } + SF.prototype.noa = function() { + iS(this, VF().BR); + }; + SF.prototype.YG = function(a10, b10) { + this.Co = a10; + hS.prototype.YG.call(this, a10, b10); + return this; + }; + function DUa(a10) { + if (VZ(a10.kb.Db)) { + var b10 = WZ(a10); + iS(a10, VF().SM) && (lUa(a10) || qUa(a10) || sUa(a10, -1, a_())) && iS(a10, VF().YI) || ZZ(a10, b10); + } + } + function YTa(a10) { + for (; EUa(a10); ) + ; + DUa(a10); + for (var b10 = a10.Co.Db.Ij; ; ) + if (VZ(a10.kb.Db)) { + var c10 = WZ(a10), e10 = /* @__PURE__ */ function(h10) { + return function() { + if (LTa(h10)) { + var k10 = WZ(h10); + var l10 = lS(h10, 3, VF().Ufa) && h_(h10); + l10 || ZZ(h10, k10); + k10 = l10; + } else + k10 = false; + return k10; + }; + }(a10), f10 = WZ(a10), g10 = !!e10(); + if (g10) + for (; f10 = WZ(a10), VZ(a10.kb.Db) && e10(); ) + ; + ZZ(a10, f10); + if (g10) { + for (e10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && EUa(a10)) + e10 = WZ(a10); + else + break; + ZZ(a10, e10); + e10 = true; + } else + e10 = false; + e10 ? (DUa(a10), e10 = true) : e10 = false; + e10 || ZZ(a10, c10); + if (!e10) { + c10 = WZ(a10); + for (e10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && EUa(a10)) + e10 = WZ(a10); + else + break; + ZZ(a10, e10); + iS(a10, VF().SM) && qUa(a10) && iS(a10, VF().YI) || ZZ(a10, c10); + } + if (a10.Co.Db.Ij === b10) { + for (b10 = a10.kb; ; ) + if (b10.Db.fc !== rF().Xs) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + iS(a10, VF().Vv); + } + b10 = a10.Co.Db.Ij; + } else + break; + iS(a10, VF().BR); + } + function yUa(a10, b10) { + var c10 = a10.kb.Db.fc; + if (OF(PF(), c10) && !vta(PF(), c10) || (45 === c10 || 58 === c10 || 63 === c10) && OTa(sS(a10.kb, 1), b10)) + c10 = a10.kb, oS(c10.Db, c10.jg, c10.Sj); + zUa(a10, b10); + iS(a10, VF().bs); + } + function YZ(a10, b10) { + var c10 = sS(a10.kb, 0); + c10 = 10 === c10 ? 1 : 13 === c10 && 10 === sS(a10.kb, 1) ? 2 : 0; + return 0 !== c10 && (mS(a10.kb, c10), iS(a10, b10)); + } + function gUa(a10) { + return 93 !== a10 && 44 !== a10 && a10 !== rF().Xs; + } + function ITa(a10, b10, c10, e10) { + if (0 === a10.kb.Db.Dg) { + if (MTa(a10) || LTa(a10)) + return false; + var f10 = vS(a10.Co, b10); + if (!e10 && f10 < b10) + return false; + b10 = c10 ? uS(a10.Co, f10) : 0; + if (e10 && !zta(PF(), sS(a10.kb, f10 + b10 | 0))) + return false; + lS(a10, f10, VF().GF); + return lS(a10, b10, VF().fB); + } + return false; + } + function pUa(a10) { + if (OF(PF(), a10.kb.Db.fc)) { + for (; ; ) { + var b10 = a10.kb; + oS(b10.Db, b10.jg, b10.Sj); + if (!OF(PF(), a10.kb.Db.fc)) + break; + } + return iS(a10, VF().as); + } + return false; + } + function FUa(a10) { + if (NF(PF(), a10.kb.Db.fc)) + return true; + for (; ; ) { + var b10 = a10.kb; + oS(b10.Db, b10.jg, b10.Sj); + if (NF(PF(), a10.kb.Db.fc)) + break; + } + return iS(a10, VF().Vv); + } + function cUa(a10, b10, c10) { + if (58 === a10.kb.Db.fc && !OTa(sS(a10.kb, 1), c10) && tS(a10, VF().Ai)) { + var e10 = WZ(a10); + b_(a10, b10, c10); + iS(a10, VF().Tu); + (b10 = fUa(a10, b10, c10) && iS(a10, VF().Uu)) || ZZ(a10, e10); + return b10 ? true : f_(a10); + } + return false; + } + function zUa(a10, b10) { + for (; ; ) { + var c10 = uS(a10.Co, 0); + jUa(a10, c10, b10) ? (mS(a10.kb, 1 + c10 | 0), c10 = true) : c10 = false; + if (!c10) + break; + } + return true; + } + function GUa(a10, b10) { + var c10 = vS(a10.Co, 2147483647); + if (c10 < b10 || c10 === b10 && !yta(PF(), sS(a10.kb, b10))) + return false; + lS(a10, b10, VF().GF); + for (b10 = a10.kb; ; ) + if (c10 = b10.Db.fc, Cta(PF(), c10)) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + return iS(a10, VF().bs); + } + function aUa(a10) { + var b10 = g_(); + null !== a10 && a10 === b10 ? a10 = true : (b10 = d_(), a10 = null !== a10 && a10 === b10); + return a10 ? d_() : HTa(); + } + function BUa(a10, b10) { + var c10 = vS(a10.Co, 2147483647); + return c10 > b10 && 63 === sS(a10.kb, c10) || TTa(a10) ? c10 - b10 | 0 : 0; + } + function HUa(a10, b10) { + var c10 = vS(a10.Co, 2147483647); + return 45 !== sS(a10.kb, c10) || OF(PF(), sS(a10.kb, 1 + c10 | 0)) ? 0 : c10 - b10 | 0; + } + function hUa(a10, b10, c10) { + var e10 = WZ(a10); + if (iS(a10, VF().Tu) && IUa(a10, b10, c10) && iS(a10, VF().Uu)) { + var f10 = WZ(a10), g10 = (b_(a10, b10, c10), cUa(a10, b10, c10)); + g10 || ZZ(a10, f10); + f10 = g10 ? true : f_(a10); + } else + f10 = false; + f10 || ZZ(a10, e10); + f10 || dUa(a10, b10, c10) ? a10 = true : (e10 = WZ(a10), zTa(a10, b10, c10) ? (f10 = WZ(a10), b_(a10, b10, c10), (b10 = eUa(a10, b10, c10)) || ZZ(a10, f10), b10 = b10 ? true : f_(a10)) : b10 = false, b10 || ZZ(a10, e10), a10 = b10); + return a10; + } + function UTa(a10, b10, c10) { + var e10 = HUa(a10, b10) + b10 | 0; + if (0 < e10) { + var f10 = WZ(a10), g10; + if (g10 = c_(a10, e10) && iS(a10, VF().Tu)) { + e10 = (1 + b10 | 0) + e10 | 0; + if (iS(a10, VF().zF) && JUa(a10, e10)) { + for (g10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && c_(a10, e10) && JUa(a10, e10)) + g10 = WZ(a10); + else + break; + ZZ(a10, g10); + e10 = true; + } else + e10 = false; + g10 = e10 ? iS(a10, VF().ZC) : false; + } + (e10 = g10 && iS(a10, VF().Uu)) || ZZ(a10, f10); + f10 = e10; + } else + f10 = false; + if (f10) + f10 = true; + else if (e10 = BUa(a10, b10) + b10 | 0, 0 < e10) { + f10 = WZ(a10); + if (g10 = c_(a10, e10) && iS(a10, VF().Tu)) { + e10 = (1 + b10 | 0) + e10 | 0; + if (iS(a10, VF().PC) && STa(a10, e10)) { + for (g10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && c_(a10, e10) && STa(a10, e10)) + g10 = WZ(a10); + else + break; + ZZ(a10, g10); + e10 = true; + } else + e10 = false; + g10 = e10 ? iS( + a10, + VF().wx + ) : false; + } + (e10 = g10 && iS(a10, VF().Uu)) || ZZ(a10, f10); + f10 = e10; + } else + f10 = false; + if (f10 || sUa(a10, b10, c10)) + return true; + b10 = WZ(a10); + (c10 = f_(a10) && h_(a10)) || ZZ(a10, b10); + return c10; + } + function IUa(a10, b10, c10) { + if (KUa(a10) || xUa(a10, b10, c10)) + return true; + if (DTa(a10, b10, c10)) { + var e10 = WZ(a10); + (b10 = b_(a10, b10, c10) && xUa(a10, b10, c10)) || ZZ(a10, e10); + return b10 ? true : JTa(a10); + } + return false; + } + function c_(a10, b10) { + return 0 >= b10 || b10 === vS(a10.Co, b10) && lS(a10, b10, VF().GF); + } + function iUa(a10, b10, c10, e10) { + if (a10.kb.Db.fc === e10) { + var f10 = false; + iS(a10, VF().Tv); + tS(a10, VF().Ai); + for (var g10 = false; !g10; ) { + var h10 = a10.kb.Db.fc; + if (34 === h10 && 34 === e10) + g10 = true; + else if (39 === h10 && 39 === e10) + 39 !== sS(a10.kb, 1) ? g10 = true : (f10 && (iS(a10, VF().bs), f10 = false), iS(a10, VF().TM), tS(a10, VF().Ai), tS(a10, VF().as), iS(a10, VF().XM)); + else if (13 === h10 || 10 === h10) + if (h10 = g_(), null === c10 || c10 !== h10 ? (h10 = d_(), h10 = !(null !== c10 && c10 === h10)) : h10 = false, h10) { + f10 && (iS(a10, VF().bs), f10 = false); + h10 = WZ(a10); + var k10 = YZ(a10, VF().$y) && $Z(a10, b10, c10); + k10 || ZZ(a10, h10); + k10 || tS(a10, VF().YY); + c_(a10, b10); + lS(a10, uS(a10.Co, 0), VF().fB); + } else + f10 = false, iS(a10, VF().Vv), g10 = true; + else if (92 === h10 && 34 === e10) { + f10 && (iS(a10, VF().bs), f10 = false); + iS(a10, VF().TM); + tS(a10, VF().Ai); + if (h10 = 10 === a10.kb.Db.fc) + YZ(a10, VF().$y); + else + switch (Bta(PF(), a10.kb.Db.fc)) { + case -1: + tS(a10, VF().Vv); + break; + case 120: + LUa(a10, 2); + break; + case 117: + LUa(a10, 4); + break; + case 85: + LUa(a10, 8); + break; + default: + tS(a10, VF().as); + } + iS(a10, VF().XM); + h10 && lS(a10, uS(a10.Co, 0), VF().fB); + } else + 32 === h10 || 9 === h10 ? (h10 = uS(a10.Co, 0), zta(PF(), sS(a10.kb, h10)) ? (f10 && (iS(a10, VF().bs), f10 = false), lS(a10, h10, VF().fB)) : (f10 = true, mS(a10.kb, h10))) : rF().Xs === h10 ? (iS(a10, VF().Vv), g10 = true) : (f10 = true, h10 = a10.kb, oS(h10.Db, h10.jg, h10.Sj)); + } + f10 && iS(a10, VF().bs); + tS(a10, VF().Ai); + return iS(a10, VF().Ws); + } + return false; + } + function MUa(a10) { + return OF(PF(), a10) && !xta(PF(), a10); + } + function b_(a10, b10, c10) { + if (d_() === c10 || g_() === c10) + return XZ(a10); + c10 = WZ(a10); + (b10 = h_(a10) && ITa(a10, b10, true, false)) || ZZ(a10, c10); + return b10 ? true : XZ(a10); + } + function KUa(a10) { + return 42 === a10.kb.Db.fc && MUa(sS(a10.kb, 1)) && iS(a10, VF().o5) && tS(a10, VF().Ai) && NUa(a10) ? iS(a10, VF().E5) : false; + } + function ETa(a10) { + if (33 === a10.kb.Db.fc && iS(a10, VF().vX)) { + if (32 === sS(a10.kb, 1) && e_(a10, 33)) + var b10 = true; + else { + b10 = WZ(a10); + if (e_(a10, 33) && e_(a10, 60)) { + var c10 = /* @__PURE__ */ function(g10) { + return function() { + return nUa(g10); + }; + }(a10), e10 = WZ(a10), f10 = !!c10(); + if (f10) + for (; e10 = WZ(a10), VZ(a10.kb.Db) && c10(); ) + ; + ZZ(a10, e10); + c10 = f10; + } else + c10 = false; + (c10 = c10 && iS(a10, VF().as) ? e_(a10, 62) : false) || ZZ(a10, b10); + b10 = c10; + } + if (b10) + b10 = true; + else { + b10 = WZ(a10); + if (kUa(a10)) { + c10 = WZ(a10); + if (oUa(a10)) { + for (; oUa(a10); ) + ; + e10 = iS(a10, VF().as); + } else + e10 = false; + e10 || ZZ(a10, c10); + c10 = e10 ? true : iS(a10, VF().Vv); + } else + c10 = false; + c10 || ZZ(a10, b10); + b10 = c10; + } + } else + b10 = false; + return b10 ? iS(a10, VF().WX) : false; + } + function eUa(a10, b10, c10) { + if (e_(a10, 58)) { + var e10 = WZ(a10); + b_(a10, b10, c10); + iS(a10, VF().Tu); + (b10 = fUa(a10, b10, c10) && iS(a10, VF().Uu)) || ZZ(a10, e10); + return b10 ? true : f_(a10); + } + return false; + } + function h_(a10) { + if (0 === a10.kb.Db.Dg || OUa(a10)) { + for (var b10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && CTa(a10)) + b10 = WZ(a10); + else + break; + ZZ(a10, b10); + return true; + } + return false; + } + function XTa(a10, b10) { + if (e_(a10, 58)) { + if (sUa(a10, b10, VTa())) + return true; + if (f_(a10)) { + b10 = WZ(a10); + var c10 = h_(a10); + c10 || ZZ(a10, b10); + if (c10) + return true; + b10 = WZ(a10); + (c10 = FUa(a10) && h_(a10)) || ZZ(a10, b10); + return c10; + } + } + return false; + } + function vUa(a10, b10) { + if (KTa(a10)) { + for (var c10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && $Z(a10, b10, a_())) + c10 = WZ(a10); + else + break; + ZZ(a10, c10); + c10 = WZ(a10); + var e10; + if (CUa(a10, b10)) { + for (e10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && QTa(a10, b10, a_()) && CUa(a10, b10)) + e10 = WZ(a10); + else + break; + ZZ(a10, e10); + e10 = true; + } else + e10 = false; + e10 || ZZ(a10, c10); + if (e10) + return true; + c10 = WZ(a10); + if (GUa(a10, b10)) { + for (e10 = WZ(a10); ; ) { + if (VZ(a10.kb.Db)) { + if (YZ(a10, VF().nJ)) { + for (var f10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && $Z(a10, b10, a_())) + f10 = WZ(a10); + else + break; + ZZ(a10, f10); + f10 = true; + } else + f10 = false; + f10 = f10 ? GUa(a10, b10) : false; + } else + f10 = false; + if (f10) + e10 = WZ(a10); + else + break; + } + ZZ(a10, e10); + b10 = true; + } else + b10 = false; + b10 || ZZ(a10, c10); + return b10; + } + return false; + } + function f_(a10) { + iS(a10, VF().Tu); + JTa(a10); + return iS(a10, VF().Uu); + } + function nUa(a10) { + if (0 <= a10.kb.Db.fc && (-1 !== wta(ua(), "#;/?:@&=+$,_.!~*'()[]", a10.kb.Db.fc) || Ata(PF(), a10.kb.Db.fc))) + return a10 = a10.kb, oS(a10.Db, a10.jg, a10.Sj), true; + if (37 === a10.kb.Db.fc) { + var b10 = sS(a10.kb, 1); + b10 = 48 <= b10 && 57 >= b10 || 65 <= b10 && 70 >= b10 || 97 <= b10 && 102 >= b10; + } else + b10 = false; + b10 ? (b10 = sS(a10.kb, 2), b10 = 48 <= b10 && 57 >= b10 || 65 <= b10 && 70 >= b10 || 97 <= b10 && 102 >= b10) : b10 = false; + return b10 ? (mS(a10.kb, 3), true) : false; + } + function PUa(a10, b10) { + if (0 === a10.kb.Db.Dg) { + var c10 = HUa(a10, b10); + if (0 < c10 && iS(a10, VF().zF)) { + b10 = /* @__PURE__ */ function(f10, g10, h10) { + return function() { + return c_(f10, g10 + h10 | 0) && JUa(f10, g10 + h10 | 0); + }; + }(a10, b10, c10); + c10 = WZ(a10); + var e10 = !!b10(); + if (e10) + for (; c10 = WZ(a10), VZ(a10.kb.Db) && b10(); ) + ; + ZZ(a10, c10); + b10 = e10; + } else + b10 = false; + return b10 ? iS(a10, VF().ZC) : false; + } + return false; + } + function uUa(a10, b10) { + var c10 = WZ(a10), e10 = a10.kb.Db.fc === rF().Xs && 45 === b10 ? iS(a10, VF().Ws) : false; + e10 || ZZ(a10, c10); + return e10 ? true : a10.kb.Db.fc === rF().Xs || 45 !== b10 && YZ(a10, VF().nJ) ? true : iS(a10, VF().Ws) && YZ(a10, VF().$y); + } + function wUa(a10, b10, c10) { + if (h_(a10)) { + var e10 = VTa(); + return PUa(a10, null !== b10 && b10 === e10 ? -1 + c10 | 0 : c10) ? true : AUa(a10, c10); + } + return false; + } + function QUa(a10) { + switch (a10.kb.Db.fc) { + case 43: + return tS(a10, VF().Ai), 43; + case 45: + return tS(a10, VF().Ai), 45; + default: + return 32; + } + } + function rUa(a10) { + return a10.kb.Db.fc === rF().Xs ? true : YZ(a10, VF().$y); + } + function OUa(a10) { + return rUa(a10) || CTa(a10); + } + function EUa(a10) { + if (VZ(a10.kb.Db)) { + if (65279 === a10.kb.Db.fc && tS(a10, VF().Nfa)) { + rUa(a10) || BTa(a10); + var b10 = true; + } else + b10 = false; + if (b10) { + for (b10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && CTa(a10)) + b10 = WZ(a10); + else + break; + ZZ(a10, b10); + b10 = true; + } else + b10 = false; + if (b10) + return true; + b10 = /* @__PURE__ */ function(f10) { + return function() { + return CTa(f10); + }; + }(a10); + var c10 = WZ(a10), e10 = !!b10(); + if (e10) + for (; c10 = WZ(a10), VZ(a10.kb.Db) && b10(); ) + ; + ZZ(a10, c10); + return e10; + } + return false; + } + function WTa(a10, b10) { + return iS(a10, VF().Tu) && IUa(a10, 0, b10) && iS(a10, VF().Uu) && (XZ(a10), true); + } + function tUa(a10, b10) { + var c10 = QUa(a10), e10 = a10.kb.Db.fc, f10 = 48 <= e10 && 57 >= e10 && 48 !== e10 ? (tS(a10, VF().Ai), -48 + e10 | 0) : -1; + 32 === c10 && (c10 = QUa(a10)); + OUa(a10) || (FUa(a10), rUa(a10)); + if (-1 === f10) { + e10 = WZ(a10); + for (f10 = WZ(a10); ; ) + if (VZ(a10.kb.Db) && $Z(a10, b10, a_())) + f10 = WZ(a10); + else + break; + ZZ(a10, f10); + b10 = vS(a10.Co, 2147483647) - b10 | 0; + f10 = 1 > b10 ? 1 : b10; + ZZ(a10, e10); + } + a10 = new RUa(); + a10.FI = f10; + a10.$4 = c10; + R6.prototype.M.call(a10, null, null); + return a10; + } + function qUa(a10) { + if (MTa(a10)) { + var b10 = WZ(a10); + lS(a10, 3, VF().Tfa); + var c10 = WZ(a10), e10 = sUa(a10, -1, a_()); + e10 || ZZ(a10, c10); + e10 ? c10 = true : (c10 = WZ(a10), (e10 = f_(a10) && h_(a10)) || ZZ(a10, c10), c10 = e10); + c10 || ZZ(a10, b10); + return c10; + } + return false; + } + function fUa(a10, b10, c10) { + if (KUa(a10)) + var e10 = true; + else { + e10 = WZ(a10); + var f10; + (f10 = ZTa(a10, b10, c10) || xUa(a10, b10, c10)) || ZZ(a10, e10); + e10 = f10; + } + if (e10) + return true; + if (DTa(a10, b10, c10)) { + e10 = WZ(a10); + if (f10 = b_(a10, b10, c10)) + f10 = ZTa(a10, b10, c10) || xUa(a10, b10, c10); + (b10 = f10) || ZZ(a10, e10); + return b10 ? true : JTa(a10); + } + return false; + } + function CTa(a10) { + return XZ(a10) && (rUa(a10) || BTa(a10)); + } + function JUa(a10, b10) { + return e_(a10, 45) && UTa(a10, b10, a_()); + } + function LTa(a10) { + return 46 === a10.kb.Db.fc && 46 === sS(a10.kb, 1) ? 46 === sS(a10.kb, 2) : false; + } + function ZZ(a10, b10) { + var c10 = a10.dQ; + c10.zn = c10.AB + (b10.Uo | 0) | 0; + a10.tL = b10.Ag; + a10.Co.Db = b10.Ih; + } + function TTa(a10) { + var b10 = new lC().ue(0), c10 = 0; + c10 = sS(a10.kb, b10.oa); + var e10 = PTa(c10); + e10.na() && (b10.oa = 1 + b10.oa | 0); + for (; ; ) { + c10 = sS(a10.kb, b10.oa); + var f10 = e10; + if (f10 instanceof z7 && c10 === (f10.i | 0)) + 39 === c10 && 39 === sS(a10.kb, 1 + b10.oa | 0) ? b10.oa = 1 + b10.oa | 0 : 34 === c10 && 92 === sS(a10.kb, -1 + b10.oa | 0) || (e10 = y7()); + else if (y7() === f10 ? (PF(), f10 = /* @__PURE__ */ function(g10, h10) { + return function() { + return sS(g10.kb, 1 + h10.oa | 0); + }; + }(a10, b10), 58 === c10 ? yta(0, f10() | 0) ? f10 = true : (f10 = f10() | 0, f10 = NF(0, f10)) : f10 = false) : f10 = false, f10) + return true; + b10.oa = 1 + b10.oa | 0; + if (NF(PF(), c10)) + break; + } + return false; + } + function NUa(a10) { + for (var b10 = a10.kb; ; ) + if (MUa(b10.Db.fc)) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + return iS(a10, VF().as); + } + function LUa(a10, b10) { + if (tS(a10, VF().Ai)) { + for (var c10 = 0; ; ) { + var e10 = sS(a10.kb, c10); + if (48 <= e10 && 57 >= e10 || 65 <= e10 && 70 >= e10 || 97 <= e10 && 102 >= e10) + c10 = 1 + c10 | 0; + else + break; + } + lS(a10, b10, c10 >= b10 ? VF().as : VF().Vv); + } + } + function RTa(a10, b10, c10) { + var e10 = WZ(a10); + if (YZ(a10, VF().$y)) { + b10 = /* @__PURE__ */ function(g10, h10, k10) { + return function() { + return $Z(g10, h10, k10); + }; + }(a10, b10, c10); + c10 = WZ(a10); + var f10 = !!b10(); + if (f10) + for (; c10 = WZ(a10), VZ(a10.kb.Db) && b10(); ) + ; + ZZ(a10, c10); + b10 = f10; + } else + b10 = false; + b10 || ZZ(a10, e10); + return b10; + } + function oUa(a10) { + return 124 === a10.kb.Db.fc || xta(PF(), a10.kb.Db.fc) ? false : nUa(a10); + } + function mUa(a10) { + if (IJa(a10, "YAML")) { + iS(a10, VF().as); + if (XZ(a10)) { + var b10 = a10.kb.Db.fc; + b10 = !(48 <= b10 && 57 >= b10); + } else + b10 = true; + if (b10) + return false; + for (b10 = a10.kb; ; ) { + var c10 = b10.Db.fc; + if (48 <= c10 && 57 >= c10) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + } + 46 !== a10.kb.Db.fc ? b10 = true : (b10 = sS(a10.kb, 1), b10 = !(48 <= b10 && 57 >= b10)); + if (b10) + return false; + b10 = a10.kb; + oS(b10.Db, b10.jg, b10.Sj); + for (b10 = a10.kb; ; ) + if (c10 = b10.Db.fc, 48 <= c10 && 57 >= c10) + oS(b10.Db, b10.jg, b10.Sj); + else + break; + return iS(a10, VF().as); + } + return false; + } + function FTa(a10) { + return 38 === a10.kb.Db.fc && MUa(sS(a10.kb, 1)) && iS(a10, VF().p5) && tS(a10, VF().Ai) && NUa(a10) ? iS(a10, VF().F5) : false; + } + SF.prototype.$classData = r8({ A4a: 0 }, false, "org.yaml.lexer.YamlLexer", { A4a: 1, A3a: 1, f: 1, G3a: 1 }); + function i_() { + this.wT = 0; + } + i_.prototype = new u7(); + i_.prototype.constructor = i_; + i_.prototype.a = function() { + this.wT = 34; + return this; + }; + i_.prototype.pH = function(a10) { + return Nta(this, a10); + }; + i_.prototype.QL = function() { + return false; + }; + i_.prototype.$classData = r8({ E4a: 0 }, false, "org.yaml.model.DoubleQuoteMark$", { E4a: 1, f: 1, Vha: 1, bS: 1 }); + var SUa = void 0; + function cG() { + SUa || (SUa = new i_().a()); + return SUa; + } + function j_() { + this.wT = 0; + } + j_.prototype = new u7(); + j_.prototype.constructor = j_; + j_.prototype.a = function() { + this.wT = 39; + return this; + }; + j_.prototype.pH = function(a10) { + return Nta(this, a10); + }; + j_.prototype.QL = function() { + return false; + }; + j_.prototype.$classData = r8({ S4a: 0 }, false, "org.yaml.model.SingleQuoteMark$", { S4a: 1, f: 1, Vha: 1, bS: 1 }); + var TUa = void 0; + function Qta() { + TUa || (TUa = new j_().a()); + return TUa; + } + function IH() { + KS.call(this); + this.rH = null; + } + IH.prototype = new iKa(); + IH.prototype.constructor = IH; + IH.prototype.t = function() { + return "&" + this.rH; + }; + IH.prototype.TO = function(a10, b10, c10) { + this.rH = a10; + KS.prototype.Ac.call(this, b10, c10); + return this; + }; + IH.prototype.$classData = r8({ V4a: 0 }, false, "org.yaml.model.YAnchor", { V4a: 1, z7: 1, $s: 1, f: 1 }); + function rr() { + this.ca = this.s = null; + } + rr.prototype = new $ta(); + rr.prototype.constructor = rr; + function UUa(a10, b10, c10) { + sr(a10, kua(T6(), b10, a10.ca), c10); + } + function sr(a10, b10, c10) { + pr(a10.s, pG(wD(), b10, c10)); + } + rr.prototype.e = function(a10) { + this.ca = a10; + gG.prototype.a.call(this); + return this; + }; + rr.prototype.$classData = r8({ c5a: 0 }, false, "org.yaml.model.YDocument$EntryBuilder", { c5a: 1, b5a: 1, f: 1, Qoa: 1 }); + function VUa() { + } + VUa.prototype = new u7(); + VUa.prototype.constructor = VUa; + VUa.prototype.a = function() { + return this; + }; + function WUa(a10, b10) { + return new sM().o1(rta(new IF(), a10, b10)); + } + VUa.prototype.$classData = r8({ i5a: 0 }, false, "org.yaml.model.YFail$", { i5a: 1, f: 1, q: 1, o: 1 }); + var XUa = void 0; + function YUa() { + KS.call(this); + } + YUa.prototype = new iKa(); + YUa.prototype.constructor = YUa; + function ZUa() { + } + ZUa.prototype = YUa.prototype; + function OG() { + KS.call(this); + this.Zma = this.gb = this.va = null; + } + OG.prototype = new iKa(); + OG.prototype.constructor = OG; + OG.prototype.b = function() { + var a10 = this.gb, b10 = Q5().En; + return a10 === b10; + }; + function rva(a10) { + if (a10.gb.iqa) { + var b10 = a10.gb.Vi; + return null !== b10 && b10 === a10; + } + return false; + } + function Iua(a10, b10) { + return vua(new OG(), a10.va, b10, a10.Zma, a10.eI); + } + OG.prototype.t = function() { + return this.va; + }; + function vua(a10, b10, c10, e10, f10) { + a10.va = b10; + a10.gb = c10; + a10.Zma = e10; + KS.prototype.Ac.call(a10, e10, f10); + return a10; + } + OG.prototype.$classData = r8({ G5a: 0 }, false, "org.yaml.model.YTag", { G5a: 1, z7: 1, $s: 1, f: 1 }); + function k_() { + EG.call(this); + } + k_.prototype = new FG(); + k_.prototype.constructor = k_; + function $Ua() { + } + $Ua.prototype = k_.prototype; + k_.prototype.Ac = function(a10, b10) { + EG.prototype.Ac.call(this, a10, b10); + return this; + }; + var hua = r8({ bZ: 0 }, false, "org.yaml.model.YValue", { bZ: 1, $s: 1, f: 1, $A: 1 }); + k_.prototype.$classData = hua; + function aVa() { + this.nd = null; + } + aVa.prototype = new u7(); + aVa.prototype.constructor = aVa; + aVa.prototype.a = function() { + bVa = this; + var a10 = Q5().nd; + this.nd = hH(a10.Vi, null); + return this; + }; + aVa.prototype.$classData = r8({ R5a: 0 }, false, "org.yaml.parser.ParserResult$", { R5a: 1, f: 1, q: 1, o: 1 }); + var bVa = void 0; + function gH() { + bVa || (bVa = new aVa().a()); + return bVa; + } + var maa = r8({ C7a: 0 }, false, "java.lang.Boolean", { C7a: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return "boolean" === typeof a10; + }); + function Jj() { + this.r = 0; + } + Jj.prototype = new u7(); + Jj.prototype.constructor = Jj; + Jj.prototype.h = function(a10) { + return a10 instanceof Jj ? this.r === a10.r : false; + }; + Jj.prototype.tr = function(a10) { + return this.r - a10.r | 0; + }; + Jj.prototype.t = function() { + return ba.String.fromCharCode(this.r); + }; + function gc(a10) { + var b10 = new Jj(); + b10.r = a10; + return b10; + } + Jj.prototype.z = function() { + return this.r; + }; + var ixa = r8({ E7a: 0 }, false, "java.lang.Character", { E7a: 1, f: 1, o: 1, ym: 1 }); + Jj.prototype.$classData = ixa; + function cVa() { + this.xna = this.tja = this.sja = this.Bma = null; + this.xa = 0; + } + cVa.prototype = new u7(); + cVa.prototype.constructor = cVa; + cVa.prototype.a = function() { + return this; + }; + function dVa(a10, b10) { + AI(); + if (0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24) { + for (var c10 = ha(Ja(Qa), [ + 257, + 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, + 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, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 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, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 3, + 2, + 1, + 1, + 1, + 2, + 1, + 3, + 2, + 4, + 1, + 2, + 1, + 3, + 3, + 2, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 2, + 1, + 1, + 2, + 1, + 3, + 1, + 1, + 1, + 2, + 2, + 1, + 1, + 3, + 4, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 3, + 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, + 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, + 7, + 2, + 1, + 2, + 2, + 1, + 1, + 4, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 69, + 1, + 27, + 18, + 4, + 12, + 14, + 5, + 7, + 1, + 1, + 1, + 17, + 112, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 3, + 1, + 5, + 2, + 1, + 1, + 3, + 1, + 1, + 1, + 2, + 1, + 17, + 1, + 9, + 35, + 1, + 2, + 3, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 5, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 51, + 48, + 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, + 1, + 1, + 1, + 1, + 1, + 1, + 5, + 2, + 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, + 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, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 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, + 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, + 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, + 1, + 9, + 38, + 2, + 1, + 6, + 1, + 39, + 1, + 1, + 1, + 4, + 1, + 1, + 45, + 1, + 1, + 1, + 2, + 1, + 2, + 1, + 1, + 8, + 27, + 5, + 3, + 2, + 11, + 5, + 1, + 3, + 2, + 1, + 2, + 2, + 11, + 1, + 2, + 2, + 32, + 1, + 10, + 21, + 10, + 4, + 2, + 1, + 99, + 1, + 1, + 7, + 1, + 1, + 6, + 2, + 2, + 1, + 4, + 2, + 10, + 3, + 2, + 1, + 14, + 1, + 1, + 1, + 1, + 30, + 27, + 2, + 89, + 11, + 1, + 14, + 10, + 33, + 9, + 2, + 1, + 3, + 1, + 5, + 22, + 4, + 1, + 9, + 1, + 3, + 1, + 5, + 2, + 15, + 1, + 25, + 3, + 2, + 1, + 65, + 1, + 1, + 11, + 55, + 27, + 1, + 3, + 1, + 54, + 1, + 1, + 1, + 1, + 3, + 8, + 4, + 1, + 2, + 1, + 7, + 10, + 2, + 2, + 10, + 1, + 1, + 6, + 1, + 7, + 1, + 1, + 2, + 1, + 8, + 2, + 2, + 2, + 22, + 1, + 7, + 1, + 1, + 3, + 4, + 2, + 1, + 1, + 3, + 4, + 2, + 2, + 2, + 2, + 1, + 1, + 8, + 1, + 4, + 2, + 1, + 3, + 2, + 2, + 10, + 2, + 2, + 6, + 1, + 1, + 5, + 2, + 1, + 1, + 6, + 4, + 2, + 2, + 22, + 1, + 7, + 1, + 2, + 1, + 2, + 1, + 2, + 2, + 1, + 1, + 3, + 2, + 4, + 2, + 2, + 3, + 3, + 1, + 7, + 4, + 1, + 1, + 7, + 10, + 2, + 3, + 1, + 11, + 2, + 1, + 1, + 9, + 1, + 3, + 1, + 22, + 1, + 7, + 1, + 2, + 1, + 5, + 2, + 1, + 1, + 3, + 5, + 1, + 2, + 1, + 1, + 2, + 1, + 2, + 1, + 15, + 2, + 2, + 2, + 10, + 1, + 1, + 15, + 1, + 2, + 1, + 8, + 2, + 2, + 2, + 22, + 1, + 7, + 1, + 2, + 1, + 5, + 2, + 1, + 1, + 1, + 1, + 1, + 4, + 2, + 2, + 2, + 2, + 1, + 8, + 1, + 1, + 4, + 2, + 1, + 3, + 2, + 2, + 10, + 1, + 1, + 6, + 10, + 1, + 1, + 1, + 6, + 3, + 3, + 1, + 4, + 3, + 2, + 1, + 1, + 1, + 2, + 3, + 2, + 3, + 3, + 3, + 12, + 4, + 2, + 1, + 2, + 3, + 3, + 1, + 3, + 1, + 2, + 1, + 6, + 1, + 14, + 10, + 3, + 6, + 1, + 1, + 6, + 3, + 1, + 8, + 1, + 3, + 1, + 23, + 1, + 10, + 1, + 5, + 3, + 1, + 3, + 4, + 1, + 3, + 1, + 4, + 7, + 2, + 1, + 2, + 6, + 2, + 2, + 2, + 10, + 8, + 7, + 1, + 2, + 2, + 1, + 8, + 1, + 3, + 1, + 23, + 1, + 10, + 1, + 5, + 2, + 1, + 1, + 1, + 1, + 5, + 1, + 1, + 2, + 1, + 2, + 2, + 7, + 2, + 7, + 1, + 1, + 2, + 2, + 2, + 10, + 1, + 2, + 15, + 2, + 1, + 8, + 1, + 3, + 1, + 41, + 2, + 1, + 3, + 4, + 1, + 3, + 1, + 3, + 1, + 1, + 8, + 1, + 8, + 2, + 2, + 2, + 10, + 6, + 3, + 1, + 6, + 2, + 2, + 1, + 18, + 3, + 24, + 1, + 9, + 1, + 1, + 2, + 7, + 3, + 1, + 4, + 3, + 3, + 1, + 1, + 1, + 8, + 18, + 2, + 1, + 12, + 48, + 1, + 2, + 7, + 4, + 1, + 6, + 1, + 8, + 1, + 10, + 2, + 37, + 2, + 1, + 1, + 2, + 2, + 1, + 1, + 2, + 1, + 6, + 4, + 1, + 7, + 1, + 3, + 1, + 1, + 1, + 1, + 2, + 2, + 1, + 4, + 1, + 2, + 6, + 1, + 2, + 1, + 2, + 5, + 1, + 1, + 1, + 6, + 2, + 10, + 2, + 4, + 32, + 1, + 3, + 15, + 1, + 1, + 3, + 2, + 6, + 10, + 10, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 8, + 1, + 36, + 4, + 14, + 1, + 5, + 1, + 2, + 5, + 11, + 1, + 36, + 1, + 8, + 1, + 6, + 1, + 2, + 5, + 4, + 2, + 37, + 43, + 2, + 4, + 1, + 6, + 1, + 2, + 2, + 2, + 1, + 10, + 6, + 6, + 2, + 2, + 4, + 3, + 1, + 3, + 2, + 7, + 3, + 4, + 13, + 1, + 2, + 2, + 6, + 1, + 1, + 1, + 10, + 3, + 1, + 2, + 38, + 1, + 1, + 5, + 1, + 2, + 43, + 1, + 1, + 332, + 1, + 4, + 2, + 7, + 1, + 1, + 1, + 4, + 2, + 41, + 1, + 4, + 2, + 33, + 1, + 4, + 2, + 7, + 1, + 1, + 1, + 4, + 2, + 15, + 1, + 57, + 1, + 4, + 2, + 67, + 2, + 3, + 9, + 20, + 3, + 16, + 10, + 6, + 85, + 11, + 1, + 620, + 2, + 17, + 1, + 26, + 1, + 1, + 3, + 75, + 3, + 3, + 15, + 13, + 1, + 4, + 3, + 11, + 18, + 3, + 2, + 9, + 18, + 2, + 12, + 13, + 1, + 3, + 1, + 2, + 12, + 52, + 2, + 1, + 7, + 8, + 1, + 2, + 11, + 3, + 1, + 3, + 1, + 1, + 1, + 2, + 10, + 6, + 10, + 6, + 6, + 1, + 4, + 3, + 1, + 1, + 10, + 6, + 35, + 1, + 52, + 8, + 41, + 1, + 1, + 5, + 70, + 10, + 29, + 3, + 3, + 4, + 2, + 3, + 4, + 2, + 1, + 6, + 3, + 4, + 1, + 3, + 2, + 10, + 30, + 2, + 5, + 11, + 44, + 4, + 17, + 7, + 2, + 6, + 10, + 1, + 3, + 34, + 23, + 2, + 3, + 2, + 2, + 53, + 1, + 1, + 1, + 7, + 1, + 1, + 1, + 1, + 2, + 8, + 6, + 10, + 2, + 1, + 10, + 6, + 10, + 6, + 7, + 1, + 6, + 82, + 4, + 1, + 47, + 1, + 1, + 5, + 1, + 1, + 5, + 1, + 2, + 7, + 4, + 10, + 7, + 10, + 9, + 9, + 3, + 2, + 1, + 30, + 1, + 4, + 2, + 2, + 1, + 1, + 2, + 2, + 10, + 44, + 1, + 1, + 2, + 3, + 1, + 1, + 3, + 2, + 8, + 4, + 36, + 8, + 8, + 2, + 2, + 3, + 5, + 10, + 3, + 3, + 10, + 30, + 6, + 2, + 64, + 8, + 8, + 3, + 1, + 13, + 1, + 7, + 4, + 1, + 4, + 2, + 1, + 2, + 9, + 44, + 63, + 13, + 1, + 34, + 37, + 39, + 21, + 4, + 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, + 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, + 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, + 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, + 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, + 1, + 1, + 1, + 1, + 9, + 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, + 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, + 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, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 9, + 8, + 6, + 2, + 6, + 2, + 8, + 8, + 8, + 8, + 6, + 2, + 6, + 2, + 8, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 8, + 8, + 14, + 2, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 1, + 2, + 4, + 1, + 1, + 1, + 3, + 3, + 1, + 2, + 4, + 1, + 3, + 4, + 2, + 2, + 4, + 1, + 3, + 8, + 5, + 3, + 2, + 3, + 1, + 2, + 4, + 1, + 2, + 1, + 11, + 5, + 6, + 2, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 8, + 1, + 1, + 5, + 1, + 9, + 1, + 1, + 4, + 2, + 3, + 1, + 1, + 1, + 11, + 1, + 1, + 1, + 10, + 1, + 5, + 5, + 6, + 1, + 1, + 2, + 6, + 3, + 1, + 1, + 1, + 10, + 3, + 1, + 1, + 1, + 13, + 3, + 32, + 16, + 13, + 4, + 1, + 3, + 12, + 15, + 2, + 1, + 4, + 1, + 2, + 1, + 3, + 2, + 3, + 1, + 1, + 1, + 2, + 1, + 5, + 6, + 1, + 1, + 1, + 1, + 1, + 1, + 4, + 1, + 1, + 4, + 1, + 4, + 1, + 2, + 2, + 2, + 5, + 1, + 4, + 1, + 1, + 2, + 1, + 1, + 16, + 35, + 1, + 1, + 4, + 1, + 6, + 5, + 5, + 2, + 4, + 1, + 2, + 1, + 2, + 1, + 7, + 1, + 31, + 2, + 2, + 1, + 1, + 1, + 31, + 268, + 8, + 4, + 20, + 2, + 7, + 1, + 1, + 81, + 1, + 30, + 25, + 40, + 6, + 18, + 12, + 39, + 25, + 11, + 21, + 60, + 78, + 22, + 183, + 1, + 9, + 1, + 54, + 8, + 111, + 1, + 144, + 1, + 103, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 30, + 44, + 5, + 1, + 1, + 31, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 16, + 256, + 131, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 63, + 1, + 1, + 1, + 1, + 32, + 1, + 1, + 258, + 48, + 21, + 2, + 6, + 3, + 10, + 166, + 47, + 1, + 47, + 1, + 1, + 1, + 3, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 4, + 1, + 1, + 2, + 1, + 6, + 2, + 3, + 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, + 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, + 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, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 6, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 5, + 4, + 1, + 2, + 38, + 1, + 1, + 5, + 1, + 2, + 56, + 7, + 1, + 1, + 14, + 1, + 23, + 9, + 7, + 1, + 7, + 1, + 7, + 1, + 7, + 1, + 7, + 1, + 7, + 1, + 7, + 1, + 7, + 1, + 32, + 2, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 1, + 1, + 1, + 9, + 1, + 2, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 5, + 1, + 10, + 2, + 68, + 26, + 1, + 89, + 12, + 214, + 26, + 12, + 4, + 1, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 9, + 4, + 2, + 1, + 5, + 2, + 3, + 1, + 1, + 1, + 2, + 1, + 86, + 2, + 2, + 2, + 2, + 1, + 1, + 90, + 1, + 3, + 1, + 5, + 41, + 3, + 94, + 1, + 2, + 4, + 10, + 27, + 5, + 36, + 12, + 16, + 31, + 1, + 10, + 30, + 8, + 1, + 15, + 32, + 10, + 39, + 15, + 320, + 6582, + 10, + 64, + 20941, + 51, + 21, + 1, + 1143, + 3, + 55, + 9, + 40, + 6, + 2, + 268, + 1, + 3, + 16, + 10, + 2, + 20, + 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, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 3, + 1, + 10, + 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, + 7, + 1, + 70, + 10, + 2, + 6, + 8, + 23, + 9, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 3, + 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, + 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, + 1, + 1, + 1, + 1, + 1, + 8, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 12, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 77, + 2, + 1, + 7, + 1, + 3, + 1, + 4, + 1, + 23, + 2, + 2, + 1, + 4, + 4, + 6, + 2, + 1, + 1, + 6, + 52, + 4, + 8, + 2, + 50, + 16, + 1, + 9, + 2, + 10, + 6, + 18, + 6, + 3, + 1, + 4, + 10, + 28, + 8, + 2, + 23, + 11, + 2, + 11, + 1, + 29, + 3, + 3, + 1, + 47, + 1, + 2, + 4, + 2, + 1, + 4, + 13, + 1, + 1, + 10, + 4, + 2, + 32, + 41, + 6, + 2, + 2, + 2, + 2, + 9, + 3, + 1, + 8, + 1, + 1, + 2, + 10, + 2, + 4, + 16, + 1, + 6, + 3, + 1, + 1, + 4, + 48, + 1, + 1, + 3, + 2, + 2, + 5, + 2, + 1, + 1, + 1, + 24, + 2, + 1, + 2, + 11, + 1, + 2, + 2, + 2, + 1, + 2, + 1, + 1, + 10, + 6, + 2, + 6, + 2, + 6, + 9, + 7, + 1, + 7, + 145, + 35, + 2, + 1, + 2, + 1, + 2, + 1, + 1, + 1, + 2, + 10, + 6, + 11172, + 12, + 23, + 4, + 49, + 4, + 2048, + 6400, + 366, + 2, + 106, + 38, + 7, + 12, + 5, + 5, + 1, + 1, + 10, + 1, + 13, + 1, + 5, + 1, + 1, + 1, + 2, + 1, + 2, + 1, + 108, + 16, + 17, + 363, + 1, + 1, + 16, + 64, + 2, + 54, + 40, + 12, + 1, + 1, + 2, + 16, + 7, + 1, + 1, + 1, + 6, + 7, + 9, + 1, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 4, + 3, + 3, + 1, + 4, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 3, + 1, + 1, + 3, + 1, + 1, + 1, + 2, + 4, + 5, + 1, + 135, + 2, + 1, + 1, + 3, + 1, + 3, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 10, + 2, + 3, + 2, + 26, + 1, + 1, + 1, + 1, + 1, + 1, + 26, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 10, + 1, + 45, + 2, + 31, + 3, + 6, + 2, + 6, + 2, + 6, + 2, + 3, + 3, + 2, + 1, + 1, + 1, + 2, + 1, + 1, + 4, + 2, + 10, + 3, + 2, + 2, + 12, + 1, + 26, + 1, + 19, + 1, + 2, + 1, + 15, + 2, + 14, + 34, + 123, + 5, + 3, + 4, + 45, + 3, + 9, + 53, + 4, + 17, + 1, + 5, + 12, + 52, + 45, + 1, + 130, + 29, + 3, + 49, + 47, + 31, + 1, + 4, + 12, + 17, + 1, + 8, + 1, + 53, + 30, + 1, + 1, + 36, + 4, + 8, + 1, + 5, + 42, + 40, + 40, + 78, + 2, + 10, + 854, + 6, + 2, + 1, + 1, + 44, + 1, + 2, + 3, + 1, + 2, + 23, + 1, + 1, + 8, + 160, + 22, + 6, + 3, + 1, + 26, + 5, + 1, + 64, + 56, + 6, + 2, + 64, + 1, + 3, + 1, + 2, + 5, + 4, + 4, + 1, + 3, + 1, + 27, + 4, + 3, + 4, + 1, + 8, + 8, + 9, + 7, + 29, + 2, + 1, + 128, + 54, + 3, + 7, + 22, + 2, + 8, + 19, + 5, + 8, + 128, + 73, + 535, + 31, + 385, + 1, + 1, + 1, + 53, + 15, + 7, + 4, + 20, + 10, + 16, + 2, + 1, + 45, + 3, + 4, + 2, + 2, + 2, + 1, + 4, + 14, + 25, + 7, + 10, + 6, + 3, + 36, + 5, + 1, + 8, + 1, + 10, + 4, + 60, + 2, + 1, + 48, + 3, + 9, + 2, + 4, + 4, + 7, + 10, + 1190, + 43, + 1, + 1, + 1, + 2, + 6, + 1, + 1, + 8, + 10, + 2358, + 879, + 145, + 99, + 13, + 4, + 2956, + 1071, + 13265, + 569, + 1223, + 69, + 11, + 1, + 46, + 16, + 4, + 13, + 16480, + 2, + 8190, + 246, + 10, + 39, + 2, + 60, + 2, + 3, + 3, + 6, + 8, + 8, + 2, + 7, + 30, + 4, + 48, + 34, + 66, + 3, + 1, + 186, + 87, + 9, + 18, + 142, + 26, + 26, + 26, + 7, + 1, + 18, + 26, + 26, + 1, + 1, + 2, + 2, + 1, + 2, + 2, + 2, + 4, + 1, + 8, + 4, + 1, + 1, + 1, + 7, + 1, + 11, + 26, + 26, + 2, + 1, + 4, + 2, + 8, + 1, + 7, + 1, + 26, + 2, + 1, + 4, + 1, + 5, + 1, + 1, + 3, + 7, + 1, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 26, + 28, + 2, + 25, + 1, + 25, + 1, + 6, + 25, + 1, + 25, + 1, + 6, + 25, + 1, + 25, + 1, + 6, + 25, + 1, + 25, + 1, + 6, + 25, + 1, + 25, + 1, + 6, + 1, + 1, + 2, + 50, + 5632, + 4, + 1, + 27, + 1, + 2, + 1, + 1, + 2, + 1, + 1, + 10, + 1, + 4, + 1, + 1, + 1, + 1, + 6, + 1, + 4, + 1, + 1, + 1, + 1, + 1, + 1, + 3, + 1, + 2, + 1, + 1, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 1, + 1, + 2, + 4, + 1, + 7, + 1, + 4, + 1, + 4, + 1, + 1, + 1, + 10, + 1, + 17, + 5, + 3, + 1, + 5, + 1, + 17, + 52, + 2, + 270, + 44, + 4, + 100, + 12, + 15, + 2, + 14, + 2, + 15, + 1, + 15, + 32, + 11, + 5, + 31, + 1, + 60, + 4, + 43, + 75, + 29, + 13, + 43, + 5, + 9, + 7, + 2, + 174, + 33, + 15, + 6, + 1, + 70, + 3, + 20, + 12, + 37, + 1, + 5, + 21, + 17, + 15, + 63, + 1, + 1, + 1, + 182, + 1, + 4, + 3, + 62, + 2, + 4, + 12, + 24, + 147, + 70, + 4, + 11, + 48, + 70, + 58, + 116, + 2188, + 42711, + 41, + 4149, + 11, + 222, + 16354, + 542, + 722403, + 1, + 30, + 96, + 128, + 240, + 65040, + 65534, + 2, + 65534 + ]), e10 = c10.n[0], f10 = 1, g10 = c10.n.length; f10 !== g10; ) + e10 = e10 + c10.n[f10] | 0, c10.n[f10] = e10, f10 = 1 + f10 | 0; + a10.sja = c10; + a10.xa = (2 | a10.xa) << 24 >> 24; + } + b10 = 1 + Tva(0, a10.sja, b10) | 0; + 0 === (4 & a10.xa) << 24 >> 24 && 0 === (4 & a10.xa) << 24 >> 24 && (a10.tja = ha(Ja(Qa), [ + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 5, + 1, + 2, + 5, + 1, + 3, + 2, + 1, + 3, + 2, + 1, + 3, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 3, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 5, + 2, + 4, + 27, + 4, + 27, + 4, + 27, + 4, + 27, + 4, + 27, + 6, + 1, + 2, + 1, + 2, + 4, + 27, + 1, + 2, + 0, + 4, + 2, + 24, + 0, + 27, + 1, + 24, + 1, + 0, + 1, + 0, + 1, + 2, + 1, + 0, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 25, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 28, + 6, + 7, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 0, + 1, + 0, + 4, + 24, + 0, + 2, + 0, + 24, + 20, + 0, + 26, + 0, + 6, + 20, + 6, + 24, + 6, + 24, + 6, + 24, + 6, + 0, + 5, + 0, + 5, + 24, + 0, + 16, + 0, + 25, + 24, + 26, + 24, + 28, + 6, + 24, + 0, + 24, + 5, + 4, + 5, + 6, + 9, + 24, + 5, + 6, + 5, + 24, + 5, + 6, + 16, + 28, + 6, + 4, + 6, + 28, + 6, + 5, + 9, + 5, + 28, + 5, + 24, + 0, + 16, + 5, + 6, + 5, + 6, + 0, + 5, + 6, + 5, + 0, + 9, + 5, + 6, + 4, + 28, + 24, + 4, + 0, + 5, + 6, + 4, + 6, + 4, + 6, + 4, + 6, + 0, + 24, + 0, + 5, + 6, + 0, + 24, + 0, + 5, + 0, + 5, + 0, + 6, + 0, + 6, + 8, + 5, + 6, + 8, + 6, + 5, + 8, + 6, + 8, + 6, + 8, + 5, + 6, + 5, + 6, + 24, + 9, + 24, + 4, + 5, + 0, + 5, + 0, + 6, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 5, + 8, + 6, + 0, + 8, + 0, + 8, + 6, + 5, + 0, + 8, + 0, + 5, + 0, + 5, + 6, + 0, + 9, + 5, + 26, + 11, + 28, + 26, + 0, + 6, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 0, + 8, + 6, + 0, + 6, + 0, + 6, + 0, + 6, + 0, + 5, + 0, + 5, + 0, + 9, + 6, + 5, + 6, + 0, + 6, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 5, + 8, + 6, + 0, + 6, + 8, + 0, + 8, + 6, + 0, + 5, + 0, + 5, + 6, + 0, + 9, + 24, + 26, + 0, + 6, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 5, + 8, + 6, + 8, + 6, + 0, + 8, + 0, + 8, + 6, + 0, + 6, + 8, + 0, + 5, + 0, + 5, + 6, + 0, + 9, + 28, + 5, + 11, + 0, + 6, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 8, + 6, + 8, + 0, + 8, + 0, + 8, + 6, + 0, + 5, + 0, + 8, + 0, + 9, + 11, + 28, + 26, + 28, + 0, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 6, + 8, + 0, + 6, + 0, + 6, + 0, + 6, + 0, + 5, + 0, + 5, + 6, + 0, + 9, + 0, + 11, + 28, + 0, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 5, + 8, + 6, + 8, + 0, + 6, + 8, + 0, + 8, + 6, + 0, + 8, + 0, + 5, + 0, + 5, + 6, + 0, + 9, + 0, + 5, + 0, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 8, + 6, + 0, + 8, + 0, + 8, + 6, + 5, + 0, + 8, + 0, + 5, + 6, + 0, + 9, + 11, + 0, + 28, + 5, + 0, + 8, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 0, + 8, + 6, + 0, + 6, + 0, + 8, + 0, + 8, + 24, + 0, + 5, + 6, + 5, + 6, + 0, + 26, + 5, + 4, + 6, + 24, + 9, + 24, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 6, + 5, + 6, + 0, + 6, + 5, + 0, + 5, + 0, + 4, + 0, + 6, + 0, + 9, + 0, + 5, + 0, + 5, + 28, + 24, + 28, + 24, + 28, + 6, + 28, + 9, + 11, + 28, + 6, + 28, + 6, + 28, + 6, + 21, + 22, + 21, + 22, + 8, + 5, + 0, + 5, + 0, + 6, + 8, + 6, + 24, + 6, + 5, + 6, + 0, + 6, + 0, + 28, + 6, + 28, + 0, + 28, + 24, + 28, + 24, + 0, + 5, + 8, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 5, + 9, + 24, + 5, + 8, + 6, + 5, + 6, + 5, + 8, + 5, + 8, + 5, + 6, + 5, + 6, + 8, + 6, + 8, + 6, + 5, + 8, + 9, + 8, + 6, + 28, + 1, + 0, + 1, + 0, + 1, + 0, + 5, + 24, + 4, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 24, + 11, + 0, + 5, + 28, + 0, + 5, + 0, + 20, + 5, + 24, + 5, + 12, + 5, + 21, + 22, + 0, + 5, + 24, + 10, + 0, + 5, + 0, + 5, + 6, + 0, + 5, + 6, + 24, + 0, + 5, + 6, + 0, + 5, + 0, + 5, + 0, + 6, + 0, + 5, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 24, + 4, + 24, + 26, + 5, + 6, + 0, + 9, + 0, + 11, + 0, + 24, + 20, + 24, + 6, + 12, + 0, + 9, + 0, + 5, + 4, + 5, + 0, + 5, + 6, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 8, + 6, + 8, + 0, + 8, + 6, + 8, + 6, + 0, + 28, + 0, + 24, + 9, + 5, + 0, + 5, + 0, + 5, + 0, + 8, + 5, + 8, + 0, + 9, + 11, + 0, + 28, + 5, + 6, + 8, + 0, + 24, + 5, + 8, + 6, + 8, + 6, + 0, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 0, + 6, + 9, + 0, + 9, + 0, + 24, + 4, + 24, + 0, + 6, + 8, + 5, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 8, + 5, + 0, + 9, + 24, + 28, + 6, + 28, + 0, + 6, + 8, + 5, + 8, + 6, + 8, + 6, + 8, + 6, + 8, + 5, + 9, + 5, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 8, + 0, + 24, + 5, + 8, + 6, + 8, + 6, + 0, + 24, + 9, + 0, + 5, + 9, + 5, + 4, + 24, + 0, + 24, + 0, + 6, + 24, + 6, + 8, + 6, + 5, + 6, + 5, + 8, + 6, + 5, + 0, + 2, + 4, + 2, + 4, + 2, + 4, + 6, + 0, + 6, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 0, + 1, + 0, + 2, + 1, + 2, + 1, + 2, + 0, + 1, + 0, + 2, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 2, + 1, + 2, + 0, + 2, + 3, + 2, + 3, + 2, + 3, + 2, + 0, + 2, + 1, + 3, + 27, + 2, + 27, + 2, + 0, + 2, + 1, + 3, + 27, + 2, + 0, + 2, + 1, + 0, + 27, + 2, + 1, + 27, + 0, + 2, + 0, + 2, + 1, + 3, + 27, + 0, + 12, + 16, + 20, + 24, + 29, + 30, + 21, + 29, + 30, + 21, + 29, + 24, + 13, + 14, + 16, + 12, + 24, + 29, + 30, + 24, + 23, + 24, + 25, + 21, + 22, + 24, + 25, + 24, + 23, + 24, + 12, + 16, + 0, + 16, + 11, + 4, + 0, + 11, + 25, + 21, + 22, + 4, + 11, + 25, + 21, + 22, + 0, + 4, + 0, + 26, + 0, + 6, + 7, + 6, + 7, + 6, + 0, + 28, + 1, + 28, + 1, + 28, + 2, + 1, + 2, + 1, + 2, + 28, + 1, + 28, + 25, + 1, + 28, + 1, + 28, + 1, + 28, + 1, + 28, + 1, + 28, + 2, + 1, + 2, + 5, + 2, + 28, + 2, + 1, + 25, + 1, + 2, + 28, + 25, + 28, + 2, + 28, + 11, + 10, + 1, + 2, + 10, + 11, + 0, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 21, + 22, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 0, + 28, + 0, + 28, + 0, + 11, + 28, + 11, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 25, + 28, + 0, + 28, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 11, + 28, + 25, + 21, + 22, + 25, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 25, + 28, + 25, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 25, + 21, + 22, + 21, + 22, + 25, + 21, + 22, + 25, + 28, + 25, + 28, + 25, + 0, + 28, + 0, + 1, + 0, + 2, + 0, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 4, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 28, + 1, + 2, + 1, + 2, + 6, + 1, + 2, + 0, + 24, + 11, + 24, + 2, + 0, + 2, + 0, + 2, + 0, + 5, + 0, + 4, + 24, + 0, + 6, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 24, + 29, + 30, + 29, + 30, + 24, + 29, + 30, + 24, + 29, + 30, + 24, + 20, + 24, + 20, + 24, + 29, + 30, + 24, + 29, + 30, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 24, + 4, + 24, + 20, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 12, + 24, + 28, + 4, + 5, + 10, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 28, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 20, + 21, + 22, + 28, + 10, + 6, + 8, + 20, + 4, + 28, + 10, + 4, + 5, + 24, + 28, + 0, + 5, + 0, + 6, + 27, + 4, + 5, + 20, + 5, + 24, + 4, + 5, + 0, + 5, + 0, + 5, + 0, + 28, + 11, + 28, + 5, + 0, + 28, + 0, + 5, + 28, + 0, + 11, + 28, + 11, + 28, + 11, + 28, + 11, + 28, + 11, + 28, + 5, + 0, + 28, + 5, + 0, + 5, + 4, + 5, + 0, + 28, + 0, + 5, + 4, + 24, + 5, + 4, + 24, + 5, + 9, + 5, + 0, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 5, + 6, + 7, + 24, + 6, + 24, + 4, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 0, + 6, + 5, + 10, + 6, + 24, + 0, + 27, + 4, + 27, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 4, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 4, + 27, + 1, + 2, + 1, + 2, + 0, + 1, + 2, + 1, + 2, + 0, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 0, + 4, + 2, + 5, + 6, + 5, + 6, + 5, + 6, + 5, + 8, + 6, + 8, + 28, + 0, + 11, + 28, + 26, + 28, + 0, + 5, + 24, + 0, + 8, + 5, + 8, + 6, + 0, + 24, + 9, + 0, + 6, + 5, + 24, + 5, + 0, + 9, + 5, + 6, + 24, + 5, + 6, + 8, + 0, + 24, + 5, + 0, + 6, + 8, + 5, + 6, + 8, + 6, + 8, + 6, + 8, + 24, + 0, + 4, + 9, + 0, + 24, + 0, + 5, + 6, + 8, + 6, + 8, + 6, + 0, + 5, + 6, + 5, + 6, + 8, + 0, + 9, + 0, + 24, + 5, + 4, + 5, + 28, + 5, + 8, + 0, + 5, + 6, + 5, + 6, + 5, + 6, + 5, + 6, + 5, + 6, + 5, + 0, + 5, + 4, + 24, + 5, + 8, + 6, + 8, + 24, + 5, + 4, + 8, + 6, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 8, + 6, + 8, + 6, + 8, + 24, + 8, + 6, + 0, + 9, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 19, + 18, + 5, + 0, + 5, + 0, + 2, + 0, + 2, + 0, + 5, + 6, + 5, + 25, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 27, + 0, + 5, + 21, + 22, + 0, + 5, + 0, + 5, + 0, + 5, + 26, + 28, + 0, + 6, + 24, + 21, + 22, + 24, + 0, + 6, + 0, + 24, + 20, + 23, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 21, + 22, + 24, + 21, + 22, + 24, + 23, + 24, + 0, + 24, + 20, + 21, + 22, + 21, + 22, + 21, + 22, + 24, + 25, + 20, + 25, + 0, + 24, + 26, + 24, + 0, + 5, + 0, + 5, + 0, + 16, + 0, + 24, + 26, + 24, + 21, + 22, + 24, + 25, + 24, + 20, + 24, + 9, + 24, + 25, + 24, + 1, + 21, + 24, + 22, + 27, + 23, + 27, + 2, + 21, + 25, + 22, + 25, + 21, + 22, + 24, + 21, + 22, + 24, + 5, + 4, + 5, + 4, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 26, + 25, + 27, + 28, + 26, + 0, + 28, + 25, + 28, + 0, + 16, + 28, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 24, + 0, + 11, + 0, + 28, + 10, + 11, + 28, + 11, + 0, + 28, + 0, + 28, + 6, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 11, + 0, + 5, + 10, + 5, + 10, + 0, + 5, + 0, + 24, + 5, + 0, + 5, + 24, + 10, + 0, + 1, + 2, + 5, + 0, + 9, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 24, + 11, + 0, + 5, + 11, + 0, + 24, + 5, + 0, + 24, + 0, + 5, + 0, + 5, + 0, + 5, + 6, + 0, + 6, + 0, + 6, + 5, + 0, + 5, + 0, + 5, + 0, + 6, + 0, + 6, + 11, + 0, + 24, + 0, + 5, + 11, + 24, + 0, + 5, + 0, + 24, + 5, + 0, + 11, + 5, + 0, + 11, + 0, + 5, + 0, + 11, + 0, + 8, + 6, + 8, + 5, + 6, + 24, + 0, + 11, + 9, + 0, + 6, + 8, + 5, + 8, + 6, + 8, + 6, + 24, + 16, + 24, + 0, + 5, + 0, + 9, + 0, + 6, + 5, + 6, + 8, + 6, + 0, + 9, + 24, + 0, + 6, + 8, + 5, + 8, + 6, + 8, + 5, + 24, + 0, + 9, + 0, + 5, + 6, + 8, + 6, + 8, + 6, + 8, + 6, + 0, + 9, + 0, + 5, + 0, + 10, + 0, + 24, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 8, + 0, + 6, + 4, + 0, + 5, + 0, + 28, + 0, + 28, + 0, + 28, + 8, + 6, + 28, + 8, + 16, + 6, + 28, + 6, + 28, + 6, + 28, + 0, + 28, + 6, + 28, + 0, + 28, + 0, + 11, + 0, + 1, + 2, + 1, + 2, + 0, + 2, + 1, + 2, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 2, + 0, + 2, + 0, + 2, + 0, + 2, + 1, + 2, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 2, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 1, + 2, + 0, + 1, + 25, + 2, + 25, + 2, + 1, + 25, + 2, + 25, + 2, + 1, + 25, + 2, + 25, + 2, + 1, + 25, + 2, + 25, + 2, + 1, + 25, + 2, + 25, + 2, + 1, + 2, + 0, + 9, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 25, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 11, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 28, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 5, + 0, + 16, + 0, + 16, + 0, + 6, + 0, + 18, + 0, + 18, + 0 + ]), a10.xa = (4 | a10.xa) << 24 >> 24); + return a10.tja.n[0 > b10 ? -b10 | 0 : b10]; + } + function eVa(a10, b10) { + return 0 > b10 ? 0 : 256 > b10 ? fVa(a10).n[b10] : dVa(a10, b10); + } + function wva(a10, b10) { + return 256 > b10 ? 9 === b10 || 10 === b10 || 11 === b10 || 12 === b10 || 13 === b10 || 28 <= b10 && 31 >= b10 || 160 !== b10 && gVa(fVa(a10).n[b10]) : 8199 !== b10 && 8239 !== b10 && gVa(dVa(a10, b10)); + } + function fVa(a10) { + 0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24 && (a10.Bma = ha(Ja(Qa), [ + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 12, + 24, + 24, + 24, + 26, + 24, + 24, + 24, + 21, + 22, + 24, + 25, + 24, + 20, + 24, + 24, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 9, + 24, + 24, + 25, + 25, + 25, + 24, + 24, + 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, + 21, + 24, + 22, + 27, + 23, + 27, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 21, + 25, + 22, + 25, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 15, + 12, + 24, + 26, + 26, + 26, + 26, + 28, + 24, + 27, + 28, + 5, + 29, + 25, + 16, + 28, + 27, + 28, + 25, + 11, + 11, + 27, + 2, + 24, + 24, + 27, + 11, + 5, + 30, + 11, + 11, + 11, + 24, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 25, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 25, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2 + ]), a10.xa = (1 | a10.xa) << 24 >> 24); + return a10.Bma; + } + function Msa(a10, b10, c10) { + if (256 > b10) + a10 = 48 <= b10 && 57 >= b10 ? -48 + b10 | 0 : 65 <= b10 && 90 >= b10 ? -55 + b10 | 0 : 97 <= b10 && 122 >= b10 ? -87 + b10 | 0 : -1; + else if (65313 <= b10 && 65338 >= b10) + a10 = -65303 + b10 | 0; + else if (65345 <= b10 && 65370 >= b10) + a10 = -65335 + b10 | 0; + else { + var e10 = Tva(AI(), hVa(a10), b10); + e10 = 0 > e10 ? -2 - e10 | 0 : e10; + 0 > e10 ? a10 = -1 : (a10 = b10 - hVa(a10).n[e10] | 0, a10 = 9 < a10 ? -1 : a10); + } + return a10 < c10 ? a10 : -1; + } + function bva(a10, b10) { + a10 = eVa(a10, b10); + return 12 === a10 || 13 === a10 || 14 === a10; + } + function hVa(a10) { + 0 === (16 & a10.xa) << 24 >> 24 && 0 === (16 & a10.xa) << 24 >> 24 && (a10.xna = ha(Ja(Qa), [1632, 1776, 1984, 2406, 2534, 2662, 2790, 2918, 3046, 3174, 3302, 3430, 3664, 3792, 3872, 4160, 4240, 6112, 6160, 6470, 6608, 6784, 6800, 6992, 7088, 7232, 7248, 42528, 43216, 43264, 43472, 43600, 44016, 65296, 66720, 69734, 69872, 69942, 70096, 71360, 120782, 120792, 120802, 120812, 120822]), a10.xa = (16 | a10.xa) << 24 >> 24); + return a10.xna; + } + function sja(a10, b10) { + return 65535 & (ba.String.fromCharCode(b10).toUpperCase().charCodeAt(0) | 0); + } + function gVa(a10) { + return 12 === a10 || 13 === a10 || 14 === a10; + } + cVa.prototype.$classData = r8({ F7a: 0 }, false, "java.lang.Character$", { F7a: 1, f: 1, q: 1, o: 1 }); + var iVa = void 0; + function Ku() { + iVa || (iVa = new cVa().a()); + return iVa; + } + function l_() { + this.kka = this.lka = null; + this.xa = 0; + } + l_.prototype = new u7(); + l_.prototype.constructor = l_; + l_.prototype.a = function() { + return this; + }; + l_.prototype.nO = function(a10) { + throw new dH().e('For input string: "' + a10 + '"'); + }; + function saa(a10, b10, c10) { + return b10 !== b10 ? c10 !== c10 ? 0 : 1 : c10 !== c10 ? -1 : b10 === c10 ? 0 === b10 ? (a10 = 1 / b10, a10 === 1 / c10 ? 0 : 0 > a10 ? -1 : 1) : 0 : b10 < c10 ? -1 : 1; + } + function Oj(a10, b10) { + 0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24 && (a10.lka = new ba.RegExp("^[\\x00-\\x20]*([+-]?(?:NaN|Infinity|(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?)[fFdD]?)[\\x00-\\x20]*$"), a10.xa = (1 | a10.xa) << 24 >> 24); + var c10 = a10.lka.exec(b10); + if (null !== c10) + return c10 = c10[1], +ba.parseFloat(void 0 === c10 ? void 0 : c10); + 0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24 && (a10.kka = new ba.RegExp("^[\\x00-\\x20]*([+-]?)0[xX]([0-9A-Fa-f]*)\\.?([0-9A-Fa-f]*)[pP]([+-]?\\d+)[fFdD]?[\\x00-\\x20]*$"), a10.xa = (2 | a10.xa) << 24 >> 24); + var e10 = a10.kka.exec(b10); + if (null !== e10) { + c10 = e10[1]; + var f10 = e10[2], g10 = e10[3]; + e10 = e10[4]; + "" === f10 && "" === g10 && a10.nO(b10); + b10 = "" + f10 + g10; + a10 = -((g10.length | 0) << 2) | 0; + for (g10 = 0; ; ) + if (g10 !== (b10.length | 0) && 48 === (65535 & (b10.charCodeAt(g10) | 0))) + g10 = 1 + g10 | 0; + else + break; + g10 = b10.substring(g10); + "" === g10 ? c10 = "-" === c10 ? -0 : 0 : (b10 = (f10 = 15 < (g10.length | 0)) ? g10.substring(0, 15) : g10, g10 = a10 + (f10 ? (-15 + (g10.length | 0) | 0) << 2 : 0) | 0, a10 = +ba.parseInt(b10, 16), e10 = +ba.parseInt(e10, 10), b10 = Aa(e10) + g10 | 0, g10 = b10 / 3 | 0, e10 = +ba.Math.pow(2, g10), b10 = +ba.Math.pow(2, b10 - (g10 << 1) | 0), e10 = a10 * e10 * e10 * b10, c10 = "-" === c10 ? -e10 : e10); + } else + c10 = a10.nO(b10); + return c10; + } + l_.prototype.$classData = r8({ I7a: 0 }, false, "java.lang.Double$", { I7a: 1, f: 1, q: 1, o: 1 }); + var jVa = void 0; + function va() { + jVa || (jVa = new l_().a()); + return jVa; + } + function iJ() { + CF.call(this); + } + iJ.prototype = new hT(); + iJ.prototype.constructor = iJ; + function kVa() { + } + kVa.prototype = iJ.prototype; + iJ.prototype.kn = function(a10) { + var b10 = null === a10 ? null : a10.t(); + CF.prototype.Ge.call(this, b10, a10); + return this; + }; + function nb() { + CF.call(this); + } + nb.prototype = new hT(); + nb.prototype.constructor = nb; + function m_() { + } + m_.prototype = nb.prototype; + nb.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + nb.prototype.aH = function(a10, b10) { + CF.prototype.Ge.call(this, a10, b10); + return this; + }; + nb.prototype.$classData = r8({ wg: 0 }, false, "java.lang.Exception", { wg: 1, bf: 1, f: 1, o: 1 }); + function n_() { + } + n_.prototype = new u7(); + n_.prototype.constructor = n_; + n_.prototype.a = function() { + return this; + }; + n_.prototype.nO = function(a10) { + throw new dH().e('For input string: "' + a10 + '"'); + }; + function FD(a10, b10, c10) { + var e10 = null === b10 ? 0 : b10.length | 0; + (0 === e10 || 2 > c10 || 36 < c10) && a10.nO(b10); + var f10 = 65535 & (b10.charCodeAt(0) | 0), g10 = 45 === f10, h10 = g10 ? 2147483648 : 2147483647; + f10 = g10 || 43 === f10 ? 1 : 0; + f10 >= (b10.length | 0) && a10.nO(b10); + for (var k10 = 0; f10 !== e10; ) { + var l10 = Msa(Ku(), 65535 & (b10.charCodeAt(f10) | 0), c10); + k10 = k10 * c10 + l10; + (-1 === l10 || k10 > h10) && a10.nO(b10); + f10 = 1 + f10 | 0; + } + return g10 ? -k10 | 0 : k10 | 0; + } + function sK(a10, b10) { + a10 = b10 - (1431655765 & b10 >> 1) | 0; + a10 = (858993459 & a10) + (858993459 & a10 >> 2) | 0; + return ca(16843009, 252645135 & (a10 + (a10 >> 4) | 0)) >> 24; + } + n_.prototype.$classData = r8({ L7a: 0 }, false, "java.lang.Integer$", { L7a: 1, f: 1, q: 1, o: 1 }); + var lVa = void 0; + function ED() { + lVa || (lVa = new n_().a()); + return lVa; + } + function mVa() { + this.iia = null; + this.xa = false; + } + mVa.prototype = new u7(); + mVa.prototype.constructor = mVa; + mVa.prototype.a = function() { + return this; + }; + function TD(a10, b10, c10) { + "" === b10 && o_(b10); + var e10 = 0, f10 = false; + switch (65535 & (b10.charCodeAt(0) | 0)) { + case 43: + e10 = 1; + break; + case 45: + e10 = 1, f10 = true; + } + var g10 = e10; + e10 = b10.length | 0; + if (g10 >= e10 || 2 > c10 || 36 < c10) + o_(b10), e10 = void 0; + else { + if (!a10.xa && !a10.xa) { + for (var h10 = [], k10 = 0; 2 > k10; ) + h10.push(null), k10 = 1 + k10 | 0; + for (; 36 >= k10; ) { + for (var l10 = 2147483647 / k10 | 0, m10 = k10, p10 = 1; m10 <= l10; ) + m10 = ca(m10, k10), p10 = 1 + p10 | 0; + var t10 = m10, v10 = t10 >> 31; + m10 = Ea(); + l10 = bsa(m10, -1, -1, t10, v10); + var A10 = m10.Wj; + m10 = new Kva(); + t10 = new qa().Sc(t10, v10); + l10 = new qa().Sc(l10, A10); + m10.uja = p10; + m10.soa = t10; + m10.Rna = l10; + h10.push(m10); + k10 = 1 + k10 | 0; + } + a10.iia = h10; + a10.xa = true; + } + h10 = a10.iia[c10]; + for (k10 = h10.uja; ; ) { + if (a10 = g10 < e10) + a10 = Ku(), p10 = 65535 & (b10.charCodeAt(g10) | 0), a10 = 256 > p10 ? 48 === p10 : 0 <= Tva(AI(), hVa(a10), p10); + if (a10) + g10 = 1 + g10 | 0; + else + break; + } + (e10 - g10 | 0) > ca(3, k10) && o_(b10); + p10 = g10 + (1 + ((-1 + (e10 - g10 | 0) | 0) % k10 | 0) | 0) | 0; + l10 = nVa(g10, p10, b10, c10); + if (p10 === e10) + e10 = new qa().Sc(l10, 0); + else { + a10 = h10.soa; + g10 = a10.od; + a10 = a10.Ud; + k10 = p10 + k10 | 0; + m10 = 65535 & l10; + t10 = l10 >>> 16 | 0; + var D10 = 65535 & g10; + v10 = g10 >>> 16 | 0; + A10 = ca(m10, D10); + D10 = ca(t10, D10); + var C10 = ca(m10, v10); + m10 = A10 + ((D10 + C10 | 0) << 16) | 0; + A10 = (A10 >>> 16 | 0) + C10 | 0; + l10 = ((ca(l10, a10) + ca(t10, v10) | 0) + (A10 >>> 16 | 0) | 0) + (((65535 & A10) + D10 | 0) >>> 16 | 0) | 0; + p10 = nVa(p10, k10, b10, c10); + p10 = m10 + p10 | 0; + l10 = (-2147483648 ^ p10) < (-2147483648 ^ m10) ? 1 + l10 | 0 : l10; + k10 === e10 ? e10 = new qa().Sc(p10, l10) : (m10 = h10.Rna, h10 = m10.od, m10 = m10.Ud, c10 = nVa(k10, e10, b10, c10), (l10 === m10 ? (-2147483648 ^ p10) > (-2147483648 ^ h10) : l10 > m10) && o_(b10), k10 = 65535 & p10, e10 = p10 >>> 16 | 0, t10 = 65535 & g10, h10 = g10 >>> 16 | 0, m10 = ca(k10, t10), t10 = ca(e10, t10), v10 = ca(k10, h10), k10 = m10 + ((t10 + v10 | 0) << 16) | 0, m10 = (m10 >>> 16 | 0) + v10 | 0, g10 = (((ca(p10, a10) + ca(l10, g10) | 0) + ca(e10, h10) | 0) + (m10 >>> 16 | 0) | 0) + (((65535 & m10) + t10 | 0) >>> 16 | 0) | 0, e10 = k10 + c10 | 0, g10 = (-2147483648 ^ e10) < (-2147483648 ^ k10) ? 1 + g10 | 0 : g10, -2147483648 === (-2147483648 ^ g10) && (-2147483648 ^ e10) < (-2147483648 ^ c10) && o_(b10), e10 = new qa().Sc(e10, g10)); + } + } + c10 = e10.od; + e10 = e10.Ud; + if (f10) + return f10 = -c10 | 0, c10 = 0 !== c10 ? ~e10 : -e10 | 0, (0 === c10 ? 0 !== f10 : 0 < c10) && o_(b10), new qa().Sc(f10, c10); + 0 > e10 && o_(b10); + return new qa().Sc(c10, e10); + } + function o_(a10) { + throw new dH().e('For input string: "' + a10 + '"'); + } + function nVa(a10, b10, c10, e10) { + for (var f10 = 0; a10 !== b10; ) { + var g10 = Msa(Ku(), 65535 & (c10.charCodeAt(a10) | 0), e10); + -1 === g10 && o_(c10); + f10 = ca(f10, e10) + g10 | 0; + a10 = 1 + a10 | 0; + } + return f10; + } + mVa.prototype.$classData = r8({ P7a: 0 }, false, "java.lang.Long$", { P7a: 1, f: 1, q: 1, o: 1 }); + var oVa = void 0; + function UD() { + oVa || (oVa = new mVa().a()); + return oVa; + } + function pVa() { + this.Ema = this.Dma = null; + } + pVa.prototype = new u7(); + pVa.prototype.constructor = pVa; + pVa.prototype.a = function() { + qVa = this; + this.Dma = ha(Ja(ma), "Sun Mon Tue Wed Thu Fri Sat".split(" ")); + this.Ema = ha(Ja(ma), "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")); + return this; + }; + function rVa(a10, b10) { + a10 = "" + b10; + return 2 > (a10.length | 0) ? "0" + a10 : a10; + } + pVa.prototype.$classData = r8({ h8a: 0 }, false, "java.util.Date$", { h8a: 1, f: 1, q: 1, o: 1 }); + var qVa = void 0; + function p_() { + qVa || (qVa = new pVa().a()); + return qVa; + } + function sVa() { + this.r = null; + } + sVa.prototype = new u7(); + sVa.prototype.constructor = sVa; + function tVa() { + } + tVa.prototype = sVa.prototype; + function uVa(a10, b10, c10) { + return b10 === a10.r ? (a10.r = c10, true) : false; + } + sVa.prototype.d = function(a10) { + this.r = a10; + return this; + }; + function SI() { + } + SI.prototype = new u7(); + SI.prototype.constructor = SI; + SI.prototype.a = function() { + return this; + }; + SI.prototype.$classData = r8({ H8a: 0 }, false, "java.util.regex.GroupStartMap$OriginallyWrapped$", { H8a: 1, f: 1, q: 1, o: 1 }); + var Lwa = void 0; + function vVa() { + this.mX = this.rE = null; + } + vVa.prototype = new u7(); + vVa.prototype.constructor = vVa; + vVa.prototype.t = function() { + return this.mX; + }; + function twa(a10) { + return (a10.rE.global ? "g" : "") + (a10.rE.ignoreCase ? "i" : "") + (a10.rE.multiline ? "m" : ""); + } + vVa.prototype.$classData = r8({ P8a: 0 }, false, "java.util.regex.Pattern", { P8a: 1, f: 1, q: 1, o: 1 }); + function wVa() { + this.Gma = this.Hma = null; + } + wVa.prototype = new u7(); + wVa.prototype.constructor = wVa; + wVa.prototype.a = function() { + xVa = this; + this.Hma = new ba.RegExp("^\\\\Q(.|\\n|\\r)\\\\E$"); + this.Gma = new ba.RegExp("^\\(\\?([idmsuxU]*)(?:-([idmsuxU]*))?\\)"); + return this; + }; + function tf(a10, b10, c10) { + a10 = Hv(a10, b10, 0); + return sx(Iv(a10, c10, wa(c10))); + } + function Hv(a10, b10, c10) { + if (0 !== (16 & c10)) + a10 = new R6().M(yVa(b10), c10); + else { + a10 = a10.Hma.exec(b10); + if (null !== a10) { + a10 = a10[1]; + if (void 0 === a10) + throw new iL().e("undefined.get"); + a10 = new z7().d(new R6().M(yVa(a10), c10)); + } else + a10 = y7(); + if (a10.b()) { + var e10 = uf().Gma.exec(b10); + if (null !== e10) { + a10 = e10[0]; + if (void 0 === a10) + throw new iL().e("undefined.get"); + a10 = b10.substring(a10.length | 0); + var f10 = c10; + var g10 = e10[1]; + if (void 0 !== g10) + for (var h10 = g10.length | 0, k10 = 0; k10 < h10; ) { + var l10 = k10; + f10 |= zVa(uf(), 65535 & (g10.charCodeAt(l10) | 0)); + k10 = 1 + k10 | 0; + } + e10 = e10[2]; + if (void 0 !== e10) + for (g10 = e10.length | 0, h10 = 0; h10 < g10; ) + k10 = h10, f10 &= ~zVa(uf(), 65535 & (e10.charCodeAt(k10) | 0)), h10 = 1 + h10 | 0; + a10 = new z7().d(new R6().M(a10, f10)); + } else + a10 = y7(); + } + a10 = a10.b() ? new R6().M(b10, c10) : a10.c(); + } + if (null === a10) + throw new x7().d(a10); + c10 = a10.ma(); + a10 = a10.Ki(); + c10 = new ba.RegExp(c10, "g" + (0 !== (2 & a10) ? "i" : "") + (0 !== (8 & a10) ? "m" : "")); + a10 = new vVa(); + a10.rE = c10; + a10.mX = b10; + return a10; + } + function yVa(a10) { + for (var b10 = "", c10 = 0; c10 < (a10.length | 0); ) { + var e10 = 65535 & (a10.charCodeAt(c10) | 0); + switch (e10) { + case 92: + case 46: + case 40: + case 41: + case 91: + case 93: + case 123: + case 125: + case 124: + case 63: + case 42: + case 43: + case 94: + case 36: + e10 = "\\" + gc(e10); + break; + default: + e10 = gc(e10); + } + b10 = "" + b10 + e10; + c10 = 1 + c10 | 0; + } + return b10; + } + function zVa(a10, b10) { + switch (b10) { + case 105: + return 2; + case 100: + return 1; + case 109: + return 8; + case 115: + return 32; + case 117: + return 64; + case 120: + return 4; + case 85: + return 256; + default: + throw new Zj().e("bad in-pattern flag"); + } + } + wVa.prototype.$classData = r8({ Q8a: 0 }, false, "java.util.regex.Pattern$", { Q8a: 1, f: 1, q: 1, o: 1 }); + var xVa = void 0; + function uf() { + xVa || (xVa = new wVa().a()); + return xVa; + } + function q_() { + this.Cda = null; + this.mpa = false; + this.DE = 0; + this.xu = null; + this.zda = this.Bda = 0; + } + q_.prototype = new u7(); + q_.prototype.constructor = q_; + function AVa() { + } + AVa.prototype = q_.prototype; + q_.prototype.t = function() { + var a10 = Fj(la(this)); + a10 = new qg().e(a10); + a10 = aQ(a10, "$"); + a10 = new qg().e(a10); + a10 = pia(a10, 46); + a10 = Oc(new Pc().fd(a10)); + a10 = new qg().e(a10); + a10 = pia(a10, 36); + return Oc(new Pc().fd(a10)); + }; + q_.prototype.ue = function(a10) { + this.Cda = new wu().a(); + this.mpa = false; + new wu().a(); + this.Bda = this.DE = a10; + this.zda = 0 > a10 ? a10 : 0; + return this; + }; + function r_() { + } + r_.prototype = new u7(); + r_.prototype.constructor = r_; + r_.prototype.a = function() { + return this; + }; + r_.prototype.Ia = function(a10) { + return null === a10 ? y7() : new z7().d(a10); + }; + r_.prototype.$classData = r8({ $8a: 0 }, false, "scala.Option$", { $8a: 1, f: 1, q: 1, o: 1 }); + var BVa = void 0; + function Vb() { + BVa || (BVa = new r_().a()); + return BVa; + } + function CVa() { + this.si = this.uN = this.Qg = this.ab = null; + } + CVa.prototype = new Rwa(); + CVa.prototype.constructor = CVa; + function BKa(a10, b10) { + if (!b10) + throw new uK().d("assertion failed"); + } + CVa.prototype.a = function() { + DVa = this; + ue4(); + ii(); + this.ab = yC(); + this.Qg = qe2(); + Xxa || (Xxa = new FJ().a()); + Xxa || (Xxa = new FJ().a()); + EVa || (EVa = new s_().a()); + this.uN = new lT().a(); + this.si = new t_().a(); + new u_().a(); + return this; + }; + function FVa(a10, b10) { + if (xda(b10, 1)) + return new Pc().fd(b10); + if (uaa(b10, 1)) + return new GVa().NG(b10); + if (waa(b10, 1)) + return new HVa().HG(b10); + if (vaa(b10, 1)) + return new Ju().BB(b10); + if (Baa(b10, 1)) + return new IVa().IG(b10); + if (Aaa(b10, 1)) + return new JVa().JG(b10); + if (yaa(b10, 1)) + return new KVa().KG(b10); + if (zaa(b10, 1)) + return new LVa().LG(b10); + if (xaa(b10, 1)) + return new MVa().MG(b10); + if ($za(b10)) + return new NVa().OG(b10); + if (null === b10) + return null; + throw new x7().d(b10); + } + function OVa(a10, b10) { + if (!b10) + throw new Zj().e("requirement failed"); + } + CVa.prototype.$classData = r8({ e9a: 0 }, false, "scala.Predef$", { e9a: 1, Ihb: 1, f: 1, Ehb: 1 }); + var DVa = void 0; + function Gb() { + DVa || (DVa = new CVa().a()); + return DVa; + } + function PVa() { + this.l = this.kma = null; + } + PVa.prototype = new u7(); + PVa.prototype.constructor = PVa; + function QVa(a10, b10) { + var c10 = new PVa(); + c10.kma = b10; + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + return c10; + } + PVa.prototype.RE = function() { + OVa(Gb(), null === this.l.UE.c()); + if (null === Ywa().aT.c()) { + Mva || (Mva = new tI().a()); + var a10 = Mva.gia; + a10 && a10.$classData && a10.$classData.ge.Soa || VKa || (VKa = new mT().a()); + } + a10 = Ywa(); + var b10 = a10.aT.c(); + try { + wI(a10.aT, this); + try { + var c10 = this.kma; + a: + for (; ; ) { + var e10 = c10; + if (!H10().h(e10)) { + if (e10 instanceof Vt) { + var f10 = e10.Wn; + wI(this.l.UE, e10.Nf); + try { + f10.RE(); + } catch (l10) { + var g10 = Ph(E6(), l10); + if (null !== g10) { + var h10 = this.l.UE.c(); + wI(this.l.UE, H10()); + QVa(this.l, h10).RE(); + throw mb(E6(), g10); + } + throw l10; + } + c10 = this.l.UE.c(); + continue a; + } + throw new x7().d(e10); + } + break; + } + } finally { + var k10 = this.l.UE; + k10.W0 = false; + k10.lx = null; + } + } finally { + wI(a10.aT, b10); + } + }; + PVa.prototype.$classData = r8({ n9a: 0 }, false, "scala.concurrent.BatchingExecutor$Batch", { n9a: 1, f: 1, Lma: 1, Soa: 1 }); + function RVa() { + this.r = this.Fna = this.C0 = null; + } + RVa.prototype = new u7(); + RVa.prototype.constructor = RVa; + RVa.prototype.RE = function() { + OVa(Gb(), null !== this.r); + try { + this.Fna.P(this.r); + } catch (c10) { + var a10 = Ph(E6(), c10); + if (null !== a10) { + var b10 = JJ(KJ(), a10); + if (b10.b()) + throw mb(E6(), a10); + a10 = b10.c(); + this.C0.cW(a10); + } else + throw c10; + } + }; + function SVa(a10, b10) { + var c10 = new RVa(); + c10.C0 = a10; + c10.Fna = b10; + c10.r = null; + return c10; + } + function TVa(a10, b10) { + OVa(Gb(), null === a10.r); + a10.r = b10; + try { + a10.C0.B0(a10); + } catch (e10) { + if (b10 = Ph(E6(), e10), null !== b10) { + var c10 = JJ(KJ(), b10); + if (c10.b()) + throw mb(E6(), b10); + b10 = c10.c(); + a10.C0.cW(b10); + } else + throw e10; + } + } + RVa.prototype.$classData = r8({ v9a: 0 }, false, "scala.concurrent.impl.CallbackRunnable", { v9a: 1, f: 1, Lma: 1, t9a: 1 }); + function bxa(a10, b10, c10) { + var e10 = new AF().a(); + a10.wP(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + try { + var l10 = g10.P(k10); + if (l10 === f10) + return yda(h10, k10); + if (l10 instanceof AF) { + var m10 = h10.r; + var p10 = m10 instanceof AF ? UVa(h10, m10) : h10; + k10 = l10; + a: + for (; ; ) { + if (k10 !== p10) { + var t10 = k10.r; + b: + if (t10 instanceof v_) { + if (!p10.IW(t10)) + throw new Hj().e("Cannot link completed promises together"); + } else { + if (t10 instanceof AF) { + k10 = UVa(k10, t10); + continue a; + } + if (t10 instanceof qT && (l10 = t10, uVa(k10, l10, p10))) { + if (tc(l10)) + for (t10 = l10; !t10.b(); ) { + var v10 = t10.ga(); + VVa(p10, v10); + t10 = t10.ta(); + } + break b; + } + continue a; + } + } + break; + } + } else + return zda( + h10, + l10 + ); + } catch (A10) { + p10 = Ph(E6(), A10); + if (null !== p10) { + v10 = JJ(KJ(), p10); + if (!v10.b()) + return p10 = v10.c(), Gj(h10, p10); + throw mb(E6(), p10); + } + throw A10; + } + }; + }(a10, b10, e10)), c10); + return e10; + } + function WVa(a10) { + a10 = a10.Pea(); + if (a10 instanceof z7) + return "Future(" + a10.i + ")"; + if (y7() === a10) + return "Future()"; + throw new x7().d(a10); + } + function dxa(a10, b10, c10) { + var e10 = new AF().a(); + a10.wP(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + a: + try { + var l10 = h10.P(k10); + } catch (m10) { + k10 = Ph(E6(), m10); + if (null !== k10) { + l10 = JJ(KJ(), k10); + if (!l10.b()) { + k10 = l10.c(); + l10 = new Ld().kn(k10); + break a; + } + throw mb(E6(), k10); + } + throw m10; + } + return yda(g10, l10); + }; + }(a10, e10, b10)), c10); + return e10; + } + function XVa() { + this.M1 = this.jV = 0; + this.ypa = this.Wg = null; + } + XVa.prototype = new u7(); + XVa.prototype.constructor = XVa; + XVa.prototype.a = function() { + YVa = this; + this.jV = -1024; + this.M1 = 1024; + this.Wg = ja(Ja(ZVa), [1 + (this.M1 - this.jV | 0) | 0]); + this.ypa = GE(BE(), new qa().Sc(-1, -1)); + return this; + }; + function Kj(a10, b10) { + if (a10.jV <= b10 && b10 <= a10.M1) { + var c10 = b10 - a10.jV | 0, e10 = a10.Wg.n[c10]; + null === e10 && (e10 = BE(), e10 = Bua(new eH(), GE(e10, new qa().Sc(b10, b10 >> 31))), a10.Wg.n[c10] = e10); + return e10; + } + a10 = BE(); + return Bua(new eH(), GE(a10, new qa().Sc(b10, b10 >> 31))); + } + function $Va(a10, b10) { + var c10 = a10.jV, e10 = c10 >> 31, f10 = b10.Ud; + (e10 === f10 ? (-2147483648 ^ c10) <= (-2147483648 ^ b10.od) : e10 < f10) ? (c10 = a10.M1, e10 = c10 >> 31, f10 = b10.Ud, c10 = f10 === e10 ? (-2147483648 ^ b10.od) <= (-2147483648 ^ c10) : f10 < e10) : c10 = false; + return c10 ? Kj(a10, b10.od) : Bua(new eH(), GE(BE(), b10)); + } + XVa.prototype.$classData = r8({ D9a: 0 }, false, "scala.math.BigInt$", { D9a: 1, f: 1, q: 1, o: 1 }); + var YVa = void 0; + function Lj() { + YVa || (YVa = new XVa().a()); + return YVa; + } + function uJ() { + } + uJ.prototype = new u7(); + uJ.prototype.constructor = uJ; + uJ.prototype.a = function() { + return this; + }; + uJ.prototype.$classData = r8({ F9a: 0 }, false, "scala.math.Fractional$", { F9a: 1, f: 1, q: 1, o: 1 }); + var Cxa = void 0; + function vJ() { + } + vJ.prototype = new u7(); + vJ.prototype.constructor = vJ; + vJ.prototype.a = function() { + return this; + }; + vJ.prototype.$classData = r8({ G9a: 0 }, false, "scala.math.Integral$", { G9a: 1, f: 1, q: 1, o: 1 }); + var Dxa = void 0; + function wJ() { + } + wJ.prototype = new u7(); + wJ.prototype.constructor = wJ; + wJ.prototype.a = function() { + return this; + }; + wJ.prototype.$classData = r8({ I9a: 0 }, false, "scala.math.Numeric$", { I9a: 1, f: 1, q: 1, o: 1 }); + var Exa = void 0; + function mL() { + } + mL.prototype = new LKa(); + mL.prototype.constructor = mL; + function aWa() { + } + aWa.prototype = mL.prototype; + function bWa() { + } + bWa.prototype = new u7(); + bWa.prototype.constructor = bWa; + bWa.prototype.a = function() { + return this; + }; + function cRa(a10, b10) { + return b10 === q5(Oa) ? Jxa() : b10 === q5(Pa) ? Kxa() : b10 === q5(Na) ? Lxa() : b10 === q5(Qa) ? Mxa() : b10 === q5(Ra) ? Nxa() : b10 === q5(Sa) ? Oxa() : b10 === q5(Ta) ? Pxa() : b10 === q5(Ma) ? Qxa() : b10 === q5(Ka) ? Rxa() : b10 === q5(Ha) ? CJ() : b10 === q5(cWa) ? Uxa() : b10 === q5(Zza) ? Vxa() : new eT().$K(b10); + } + bWa.prototype.$classData = r8({ S9a: 0 }, false, "scala.reflect.ClassTag$", { S9a: 1, f: 1, q: 1, o: 1 }); + var dWa = void 0; + function dRa() { + dWa || (dWa = new bWa().a()); + return dWa; + } + function xJ() { + } + xJ.prototype = new u7(); + xJ.prototype.constructor = xJ; + xJ.prototype.a = function() { + return this; + }; + xJ.prototype.$classData = r8({ l$a: 0 }, false, "scala.util.Either$", { l$a: 1, f: 1, q: 1, o: 1 }); + var Fxa = void 0; + function yJ() { + } + yJ.prototype = new u7(); + yJ.prototype.constructor = yJ; + yJ.prototype.a = function() { + return this; + }; + yJ.prototype.t = function() { + return "Left"; + }; + yJ.prototype.$classData = r8({ q$a: 0 }, false, "scala.util.Left$", { q$a: 1, f: 1, q: 1, o: 1 }); + var Gxa = void 0; + function zJ() { + } + zJ.prototype = new u7(); + zJ.prototype.constructor = zJ; + zJ.prototype.a = function() { + return this; + }; + zJ.prototype.t = function() { + return "Right"; + }; + zJ.prototype.$classData = r8({ s$a: 0 }, false, "scala.util.Right$", { s$a: 1, f: 1, q: 1, o: 1 }); + var Hxa = void 0; + function eWa() { + this.zfa = false; + } + eWa.prototype = new u7(); + eWa.prototype.constructor = eWa; + eWa.prototype.a = function() { + this.zfa = false; + return this; + }; + eWa.prototype.$classData = r8({ x$a: 0 }, false, "scala.util.control.NoStackTrace$", { x$a: 1, f: 1, q: 1, o: 1 }); + var fWa = void 0; + function rg() { + this.nW = this.hh = null; + } + rg.prototype = new u7(); + rg.prototype.constructor = rg; + rg.prototype.vi = function(a10, b10) { + var c10 = uf(); + rg.prototype.w7a.call(this, Hv(c10, a10, 0), b10); + return this; + }; + function ira(a10, b10) { + a10 = Iv(a10.hh, b10, wa(b10)); + return Jv(a10) ? new z7().d(TKa(a10)) : y7(); + } + rg.prototype.w7a = function(a10, b10) { + this.hh = a10; + this.nW = b10; + }; + rg.prototype.t = function() { + return this.hh.mX; + }; + function yt(a10, b10) { + if (null === b10) + return y7(); + a10 = Iv(a10.hh, b10, wa(b10)); + if (sx(a10)) { + gWa || (gWa = new hWa().a()); + ii(); + var c10 = H10(); + for (b10 = RKa(a10); 0 < b10; ) { + var e10 = QKa(a10, b10); + c10 = ji(e10, c10); + b10 = -1 + b10 | 0; + } + a10 = new z7().d(c10); + } else + a10 = y7(); + return a10; + } + function ai(a10, b10) { + return Hia(b10, a10, a10.nW); + } + function cca(a10, b10) { + a10 = Iv(a10.hh, b10, wa(b10)); + return Jv(a10) ? new z7().d(cLa(b10, a10)) : y7(); + } + rg.prototype.$classData = r8({ B$a: 0 }, false, "scala.util.matching.Regex", { B$a: 1, f: 1, q: 1, o: 1 }); + function hWa() { + } + hWa.prototype = new u7(); + hWa.prototype.constructor = hWa; + hWa.prototype.a = function() { + return this; + }; + hWa.prototype.$classData = r8({ C$a: 0 }, false, "scala.util.matching.Regex$", { C$a: 1, f: 1, q: 1, o: 1 }); + var gWa = void 0; + function w_() { + this.l = null; + } + w_.prototype = new mLa(); + w_.prototype.constructor = w_; + w_.prototype.a = function() { + IT.prototype.EU.call(this, rw()); + return this; + }; + w_.prototype.es = function() { + rw(); + hG(); + iG(); + return new jG().a(); + }; + w_.prototype.$classData = r8({ L$a: 0 }, false, "scala.collection.IndexedSeq$$anon$1", { L$a: 1, zpa: 1, f: 1, VE: 1 }); + function bE() { + } + bE.prototype = new oLa(); + bE.prototype.constructor = bE; + bE.prototype.a = function() { + return this; + }; + bE.prototype.tG = function() { + return nu(); + }; + bE.prototype.$classData = r8({ hab: 0 }, false, "scala.collection.Map$", { hab: 1, hM: 1, gM: 1, f: 1 }); + var zra = void 0; + function WJ() { + } + WJ.prototype = new OT(); + WJ.prototype.constructor = WJ; + WJ.prototype.P = function() { + return this; + }; + WJ.prototype.DU = function() { + return this; + }; + WJ.prototype.$classData = r8({ Iab: 0 }, false, "scala.collection.TraversableOnce$$anon$1", { Iab: 1, bF: 1, f: 1, za: 1 }); + function iWa() { + this.u = null; + } + iWa.prototype = new GT(); + iWa.prototype.constructor = iWa; + function jWa() { + } + jWa.prototype = iWa.prototype; + function HT() { + this.Fa = this.l = null; + } + HT.prototype = new mLa(); + HT.prototype.constructor = HT; + HT.prototype.es = function() { + return this.Fa.Qd(); + }; + HT.prototype.EU = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + IT.prototype.EU.call(this, a10); + return this; + }; + HT.prototype.$classData = r8({ Vab: 0 }, false, "scala.collection.generic.GenTraversableFactory$$anon$1", { Vab: 1, zpa: 1, f: 1, VE: 1 }); + function kWa() { + } + kWa.prototype = new oLa(); + kWa.prototype.constructor = kWa; + function lWa() { + } + lWa.prototype = kWa.prototype; + function mWa() { + } + mWa.prototype = new oLa(); + mWa.prototype.constructor = mWa; + function nWa() { + } + nWa.prototype = mWa.prototype; + mWa.prototype.Qd = function() { + return this.ls(); + }; + function oJ() { + } + oJ.prototype = new u7(); + oJ.prototype.constructor = oJ; + oJ.prototype.a = function() { + return this; + }; + oJ.prototype.t = function() { + return "::"; + }; + oJ.prototype.$classData = r8({ Zab: 0 }, false, "scala.collection.immutable.$colon$colon$", { Zab: 1, f: 1, q: 1, o: 1 }); + var vxa = void 0; + function oWa() { + } + oWa.prototype = new u7(); + oWa.prototype.constructor = oWa; + oWa.prototype.a = function() { + return this; + }; + function dLa(a10, b10, c10, e10, f10) { + throw new Zj().e(b10 + (f10 ? " to " : " until ") + c10 + " by " + e10 + ": seqs cannot contain more than Int.MaxValue elements."); + } + oWa.prototype.$classData = r8({ Nbb: 0 }, false, "scala.collection.immutable.Range$", { Nbb: 1, f: 1, q: 1, o: 1 }); + var pWa = void 0; + function Axa() { + pWa || (pWa = new oWa().a()); + return pWa; + } + function Qt() { + this.l = null; + } + Qt.prototype = new mLa(); + Qt.prototype.constructor = Qt; + Qt.prototype.a = function() { + IT.prototype.EU.call(this, Pt()); + return this; + }; + Qt.prototype.$classData = r8({ dcb: 0 }, false, "scala.collection.immutable.Stream$StreamCanBuildFrom", { dcb: 1, zpa: 1, f: 1, VE: 1 }); + function sJ() { + } + sJ.prototype = new u7(); + sJ.prototype.constructor = sJ; + sJ.prototype.a = function() { + return this; + }; + sJ.prototype.$classData = r8({ geb: 0 }, false, "scala.collection.mutable.StringBuilder$", { geb: 1, f: 1, q: 1, o: 1 }); + var zxa = void 0; + function qWa() { + this.nh = null; + } + qWa.prototype = new uLa(); + qWa.prototype.constructor = qWa; + function Hb(a10) { + return (0, a10.nh)(); + } + function oq(a10) { + var b10 = new qWa(); + b10.nh = a10; + return b10; + } + qWa.prototype.$classData = r8({ Geb: 0 }, false, "scala.scalajs.runtime.AnonFunction0", { Geb: 1, Aib: 1, f: 1, ffb: 1 }); + function rWa() { + this.nh = null; + } + rWa.prototype = new OT(); + rWa.prototype.constructor = rWa; + rWa.prototype.P = function(a10) { + return (0, this.nh)(a10); + }; + function w6(a10) { + var b10 = new rWa(); + b10.nh = a10; + return b10; + } + rWa.prototype.$classData = r8({ Heb: 0 }, false, "scala.scalajs.runtime.AnonFunction1", { Heb: 1, bF: 1, f: 1, za: 1 }); + function sWa() { + this.nh = null; + } + sWa.prototype = new wLa(); + sWa.prototype.constructor = sWa; + function Uc(a10) { + var b10 = new sWa(); + b10.nh = a10; + return b10; + } + sWa.prototype.ug = function(a10, b10) { + return (0, this.nh)(a10, b10); + }; + sWa.prototype.$classData = r8({ Ieb: 0 }, false, "scala.scalajs.runtime.AnonFunction2", { Ieb: 1, Teb: 1, f: 1, cra: 1 }); + function tWa() { + this.nh = null; + } + tWa.prototype = new yLa(); + tWa.prototype.constructor = tWa; + function Vw(a10) { + var b10 = new tWa(); + b10.nh = a10; + return b10; + } + function oy(a10, b10, c10, e10) { + return (0, a10.nh)(b10, c10, e10); + } + tWa.prototype.$classData = r8({ Jeb: 0 }, false, "scala.scalajs.runtime.AnonFunction3", { Jeb: 1, Bib: 1, f: 1, gfb: 1 }); + function uWa() { + this.nh = null; + } + uWa.prototype = new ALa(); + uWa.prototype.constructor = uWa; + uWa.prototype.du = function(a10, b10, c10, e10) { + return (0, this.nh)(a10, b10, c10, e10); + }; + function dW(a10) { + var b10 = new uWa(); + b10.nh = a10; + return b10; + } + uWa.prototype.$classData = r8({ Keb: 0 }, false, "scala.scalajs.runtime.AnonFunction4", { Keb: 1, Ypa: 1, f: 1, aga: 1 }); + function vWa() { + this.nh = null; + } + vWa.prototype = new CLa(); + vWa.prototype.constructor = vWa; + function aW(a10) { + var b10 = new vWa(); + b10.nh = a10; + return b10; + } + function nD(a10, b10, c10, e10, f10, g10) { + return (0, a10.nh)(b10, c10, e10, f10, g10); + } + vWa.prototype.$classData = r8({ Leb: 0 }, false, "scala.scalajs.runtime.AnonFunction5", { Leb: 1, Cib: 1, f: 1, hfb: 1 }); + function wWa() { + this.Wj = 0; + this.dl = null; + } + wWa.prototype = new u7(); + wWa.prototype.constructor = wWa; + wWa.prototype.a = function() { + xWa = this; + this.dl = new qa().Sc(0, 0); + return this; + }; + function yWa(a10, b10, c10) { + return 0 === (-2097152 & c10) ? "" + (4294967296 * c10 + +(b10 >>> 0)) : zWa(a10, b10, c10, 1e9, 0, 2); + } + function Tya(a10, b10, c10, e10, f10) { + if (0 === (e10 | f10)) + throw new x_().e("/ by zero"); + if (c10 === b10 >> 31) { + if (f10 === e10 >> 31) { + if (-2147483648 === b10 && -1 === e10) + return a10.Wj = 0, -2147483648; + var g10 = b10 / e10 | 0; + a10.Wj = g10 >> 31; + return g10; + } + return -2147483648 === b10 && -2147483648 === e10 && 0 === f10 ? a10.Wj = -1 : a10.Wj = 0; + } + if (g10 = 0 > c10) { + var h10 = -b10 | 0; + c10 = 0 !== b10 ? ~c10 : -c10 | 0; + } else + h10 = b10; + if (b10 = 0 > f10) { + var k10 = -e10 | 0; + e10 = 0 !== e10 ? ~f10 : -f10 | 0; + } else + k10 = e10, e10 = f10; + h10 = AWa(a10, h10, c10, k10, e10); + if (g10 === b10) + return h10; + g10 = a10.Wj; + a10.Wj = 0 !== h10 ? ~g10 : -g10 | 0; + return -h10 | 0; + } + function SD(a10, b10, c10) { + return 0 > c10 ? -(4294967296 * +((0 !== b10 ? ~c10 : -c10 | 0) >>> 0) + +((-b10 | 0) >>> 0)) : 4294967296 * c10 + +(b10 >>> 0); + } + function Zsa(a10, b10) { + if (-9223372036854776e3 > b10) + return a10.Wj = -2147483648, 0; + if (9223372036854776e3 <= b10) + return a10.Wj = 2147483647, -1; + var c10 = b10 | 0, e10 = b10 / 4294967296 | 0; + a10.Wj = 0 > b10 && 0 !== c10 ? -1 + e10 | 0 : e10; + return c10; + } + function AWa(a10, b10, c10, e10, f10) { + return 0 === (-2097152 & c10) ? 0 === (-2097152 & f10) ? (c10 = (4294967296 * c10 + +(b10 >>> 0)) / (4294967296 * f10 + +(e10 >>> 0)), a10.Wj = c10 / 4294967296 | 0, c10 | 0) : a10.Wj = 0 : 0 === f10 && 0 === (e10 & (-1 + e10 | 0)) ? (e10 = 31 - ea(e10) | 0, a10.Wj = c10 >>> e10 | 0, b10 >>> e10 | 0 | c10 << 1 << (31 - e10 | 0)) : 0 === e10 && 0 === (f10 & (-1 + f10 | 0)) ? (b10 = 31 - ea(f10) | 0, a10.Wj = 0, c10 >>> b10 | 0) : zWa(a10, b10, c10, e10, f10, 0) | 0; + } + function bsa(a10, b10, c10, e10, f10) { + if (0 === (e10 | f10)) + throw new x_().e("/ by zero"); + return 0 === c10 ? 0 === f10 ? (a10.Wj = 0, +(b10 >>> 0) / +(e10 >>> 0) | 0) : a10.Wj = 0 : AWa(a10, b10, c10, e10, f10); + } + function yza(a10, b10, c10) { + return c10 === b10 >> 31 ? "" + b10 : 0 > c10 ? "-" + yWa(a10, -b10 | 0, 0 !== b10 ? ~c10 : -c10 | 0) : yWa(a10, b10, c10); + } + function zWa(a10, b10, c10, e10, f10, g10) { + var h10 = (0 !== f10 ? ea(f10) : 32 + ea(e10) | 0) - (0 !== c10 ? ea(c10) : 32 + ea(b10) | 0) | 0, k10 = h10, l10 = 0 === (32 & k10) ? e10 << k10 : 0, m10 = 0 === (32 & k10) ? (e10 >>> 1 | 0) >>> (31 - k10 | 0) | 0 | f10 << k10 : e10 << k10; + k10 = b10; + var p10 = c10; + for (b10 = c10 = 0; 0 <= h10 && 0 !== (-2097152 & p10); ) { + var t10 = k10, v10 = p10, A10 = l10, D10 = m10; + if (v10 === D10 ? (-2147483648 ^ t10) >= (-2147483648 ^ A10) : (-2147483648 ^ v10) >= (-2147483648 ^ D10)) + t10 = p10, v10 = m10, p10 = k10 - l10 | 0, t10 = (-2147483648 ^ p10) > (-2147483648 ^ k10) ? -1 + (t10 - v10 | 0) | 0 : t10 - v10 | 0, k10 = p10, p10 = t10, 32 > h10 ? c10 |= 1 << h10 : b10 |= 1 << h10; + h10 = -1 + h10 | 0; + t10 = m10 >>> 1 | 0; + l10 = l10 >>> 1 | 0 | m10 << 31; + m10 = t10; + } + h10 = p10; + if (h10 === f10 ? (-2147483648 ^ k10) >= (-2147483648 ^ e10) : (-2147483648 ^ h10) >= (-2147483648 ^ f10)) + h10 = 4294967296 * p10 + +(k10 >>> 0), e10 = 4294967296 * f10 + +(e10 >>> 0), 1 !== g10 && (m10 = h10 / e10, f10 = m10 / 4294967296 | 0, l10 = c10, c10 = m10 = l10 + (m10 | 0) | 0, b10 = (-2147483648 ^ m10) < (-2147483648 ^ l10) ? 1 + (b10 + f10 | 0) | 0 : b10 + f10 | 0), 0 !== g10 && (e10 = h10 % e10, k10 = e10 | 0, p10 = e10 / 4294967296 | 0); + if (0 === g10) + return a10.Wj = b10, c10; + if (1 === g10) + return a10.Wj = p10, k10; + a10 = "" + k10; + return "" + (4294967296 * b10 + +(c10 >>> 0)) + "000000000".substring(a10.length | 0) + a10; + } + function BWa(a10, b10, c10, e10, f10) { + if (0 === (e10 | f10)) + throw new x_().e("/ by zero"); + if (c10 === b10 >> 31) { + if (f10 === e10 >> 31) { + if (-1 !== e10) { + var g10 = b10 % e10 | 0; + a10.Wj = g10 >> 31; + return g10; + } + return a10.Wj = 0; + } + if (-2147483648 === b10 && -2147483648 === e10 && 0 === f10) + return a10.Wj = 0; + a10.Wj = c10; + return b10; + } + if (g10 = 0 > c10) { + var h10 = -b10 | 0; + c10 = 0 !== b10 ? ~c10 : -c10 | 0; + } else + h10 = b10; + 0 > f10 ? (b10 = -e10 | 0, e10 = 0 !== e10 ? ~f10 : -f10 | 0) : (b10 = e10, e10 = f10); + f10 = c10; + 0 === (-2097152 & f10) ? 0 === (-2097152 & e10) ? (h10 = (4294967296 * f10 + +(h10 >>> 0)) % (4294967296 * e10 + +(b10 >>> 0)), a10.Wj = h10 / 4294967296 | 0, h10 |= 0) : a10.Wj = f10 : 0 === e10 && 0 === (b10 & (-1 + b10 | 0)) ? (a10.Wj = 0, h10 &= -1 + b10 | 0) : 0 === b10 && 0 === (e10 & (-1 + e10 | 0)) ? a10.Wj = f10 & (-1 + e10 | 0) : h10 = zWa(a10, h10, f10, b10, e10, 1) | 0; + return g10 ? (g10 = a10.Wj, a10.Wj = 0 !== h10 ? ~g10 : -g10 | 0, -h10 | 0) : h10; + } + wWa.prototype.$classData = r8({ Oeb: 0 }, false, "scala.scalajs.runtime.RuntimeLong$", { Oeb: 1, f: 1, q: 1, o: 1 }); + var xWa = void 0; + function Ea() { + xWa || (xWa = new wWa().a()); + return xWa; + } + function CWa() { + } + CWa.prototype = new u7(); + CWa.prototype.constructor = CWa; + function y_() { + } + d7 = y_.prototype = CWa.prototype; + d7.P = function(a10) { + return this.Wa(a10, XI().u0); + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ro = function(a10) { + return this.Wa(a10, XI().u0) | 0; + }; + d7.t = function() { + return ""; + }; + d7.Ep = function(a10) { + return !!this.Wa(a10, XI().u0); + }; + var cWa = r8({ $eb: 0 }, false, "scala.runtime.Nothing$", { $eb: 1, bf: 1, f: 1, o: 1 }); + function z_() { + this.l = null; + } + z_.prototype = new u7(); + z_.prototype.constructor = z_; + z_.prototype.Kc = function(a10) { + return a10.k; + }; + z_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + z_.prototype.$classData = r8({ tra: 0 }, false, "amf.client.convert.Amqp091ChannelBindingConverter$Amqp091ChannelBindingMatcher$", { tra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function A_() { + this.l = null; + } + A_.prototype = new u7(); + A_.prototype.constructor = A_; + A_.prototype.Kc = function(a10) { + return a10.k; + }; + A_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + A_.prototype.$classData = r8({ ura: 0 }, false, "amf.client.convert.Amqp091ChannelExchangeConverter$Amqp091ChannelExchangeMatcher$", { ura: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function B_() { + this.l = null; + } + B_.prototype = new u7(); + B_.prototype.constructor = B_; + B_.prototype.Kc = function(a10) { + return a10.k; + }; + B_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + B_.prototype.$classData = r8({ vra: 0 }, false, "amf.client.convert.Amqp091MessageBindingConverter$Amqp091MessageBindingMatcher$", { vra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function C_() { + this.l = null; + } + C_.prototype = new u7(); + C_.prototype.constructor = C_; + C_.prototype.Kc = function(a10) { + return a10.k; + }; + C_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + C_.prototype.$classData = r8({ wra: 0 }, false, "amf.client.convert.Amqp091OperationBindingConverter$Amqp091OperationBindingMatcher$", { wra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function D_() { + this.l = null; + } + D_.prototype = new u7(); + D_.prototype.constructor = D_; + D_.prototype.Kc = function(a10) { + return a10.k; + }; + D_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + D_.prototype.$classData = r8({ xra: 0 }, false, "amf.client.convert.Amqp091QueueConverter$Amqp091QueueMatcher$", { xra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function E_() { + this.l = null; + } + E_.prototype = new u7(); + E_.prototype.constructor = E_; + E_.prototype.Kc = function(a10) { + return a10.Jh(); + }; + E_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + E_.prototype.$classData = r8({ yra: 0 }, false, "amf.client.convert.AnyShapeConverter$AnyShapeMatcher$", { yra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function F_() { + this.l = null; + } + F_.prototype = new u7(); + F_.prototype.constructor = F_; + function DWa(a10) { + var b10 = new F_(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + F_.prototype.Kc = function(a10) { + return a10.Be(); + }; + function gfa(a10, b10) { + return xu(a10.l.ea, b10); + } + F_.prototype.zc = function(a10) { + return gfa(this, a10); + }; + F_.prototype.$classData = r8({ zra: 0 }, false, "amf.client.convert.BaseUnitConverter$BaseUnitMatcher$", { zra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function G_() { + } + G_.prototype = new u7(); + G_.prototype.constructor = G_; + G_.prototype.Kc = function(a10) { + return a10.k; + }; + G_.prototype.zc = function(a10) { + return new H_().jla(a10); + }; + G_.prototype.$classData = r8({ Ara: 0 }, false, "amf.client.convert.CachedReferenceConverter$CachedReferenceMatcher$", { Ara: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function I_() { + this.l = null; + } + I_.prototype = new u7(); + I_.prototype.constructor = I_; + I_.prototype.Kc = function(a10) { + return a10.k; + }; + function EWa(a10, b10) { + return xu(a10.l.ea, b10); + } + I_.prototype.zc = function(a10) { + return EWa(this, a10); + }; + I_.prototype.$classData = r8({ Bra: 0 }, false, "amf.client.convert.CallbackConverter$CallbackMatcher$", { Bra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function J_() { + this.l = null; + } + J_.prototype = new u7(); + J_.prototype.constructor = J_; + J_.prototype.Kc = function(a10) { + return a10.k; + }; + J_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + J_.prototype.$classData = r8({ Cra: 0 }, false, "amf.client.convert.ChannelBindingConverter$ChannelBindingMatcher$", { Cra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function K_() { + this.l = null; + } + K_.prototype = new u7(); + K_.prototype.constructor = K_; + K_.prototype.Kc = function(a10) { + return a10.k; + }; + K_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + K_.prototype.$classData = r8({ Dra: 0 }, false, "amf.client.convert.ClassTermMappingConverter$ClassTermMappingConverter$", { Dra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function L_() { + this.l = null; + } + L_.prototype = new u7(); + L_.prototype.constructor = L_; + L_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + L_.prototype.Kc = function(a10) { + return a10; + }; + L_.prototype.zc = function(a10) { + return a10; + }; + L_.prototype.$classData = r8({ Kra: 0 }, false, "amf.client.convert.CoreBaseConverter$AnyMatcher$", { Kra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function M_() { + this.l = null; + } + M_.prototype = new u7(); + M_.prototype.constructor = M_; + M_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + M_.prototype.Kc = function(a10) { + return a10; + }; + M_.prototype.zc = function(a10) { + return a10; + }; + M_.prototype.$classData = r8({ Lra: 0 }, false, "amf.client.convert.CoreBaseConverter$BooleanMatcher$", { Lra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function N_() { + this.l = null; + } + N_.prototype = new u7(); + N_.prototype.constructor = N_; + N_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + N_.prototype.Kc = function(a10) { + return a10; + }; + N_.prototype.zc = function(a10) { + return a10; + }; + N_.prototype.$classData = r8({ Mra: 0 }, false, "amf.client.convert.CoreBaseConverter$ContentMatcher$", { Mra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function O_() { + this.l = null; + } + O_.prototype = new u7(); + O_.prototype.constructor = O_; + O_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + O_.prototype.Kc = function(a10) { + return a10; + }; + O_.prototype.zc = function(a10) { + return a10; + }; + O_.prototype.$classData = r8({ Nra: 0 }, false, "amf.client.convert.CoreBaseConverter$DoubleMatcher$", { Nra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function P_() { + this.l = null; + } + P_.prototype = new u7(); + P_.prototype.constructor = P_; + P_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + P_.prototype.Kc = function(a10) { + return a10; + }; + P_.prototype.zc = function(a10) { + return a10; + }; + P_.prototype.$classData = r8({ Ora: 0 }, false, "amf.client.convert.CoreBaseConverter$IntMatcher$", { Ora: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function hq() { + this.l = null; + } + hq.prototype = new u7(); + hq.prototype.constructor = hq; + hq.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + hq.prototype.Kc = function(a10) { + return a10; + }; + hq.prototype.zc = function(a10) { + return a10; + }; + hq.prototype.$classData = r8({ Pra: 0 }, false, "amf.client.convert.CoreBaseConverter$ProfileNameMatcher$", { Pra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function Q_() { + this.l = null; + } + Q_.prototype = new u7(); + Q_.prototype.constructor = Q_; + Q_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + Q_.prototype.Kc = function(a10) { + return a10; + }; + Q_.prototype.zc = function(a10) { + return a10; + }; + Q_.prototype.$classData = r8({ Qra: 0 }, false, "amf.client.convert.CoreBaseConverter$StringMatcher$", { Qra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function R_() { + this.l = null; + } + R_.prototype = new u7(); + R_.prototype.constructor = R_; + R_.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + R_.prototype.Kc = function(a10) { + return a10; + }; + R_.prototype.zc = function(a10) { + return a10; + }; + R_.prototype.$classData = r8({ Rra: 0 }, false, "amf.client.convert.CoreBaseConverter$UnitMatcher$", { Rra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function $T() { + this.l = null; + } + $T.prototype = new u7(); + $T.prototype.constructor = $T; + $T.prototype.ep = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + $T.prototype.Kc = function(a10) { + return a10; + }; + $T.prototype.zc = function(a10) { + return a10; + }; + $T.prototype.$classData = r8({ Sra: 0 }, false, "amf.client.convert.CoreBaseConverter$VendorMatcher$", { Sra: 1, f: 1, IF: 1, Fc: 1, Pc: 1 }); + function S_() { + this.l = null; + } + S_.prototype = new u7(); + S_.prototype.constructor = S_; + S_.prototype.Kc = function(a10) { + return a10.k; + }; + S_.prototype.zc = function(a10) { + return FWa(this, a10); + }; + function FWa(a10, b10) { + return xu(a10.l.ea, b10); + } + S_.prototype.$classData = r8({ Vra: 0 }, false, "amf.client.convert.CorrelationIdConverter$CorrelationIdMatcher$", { Vra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function T_() { + this.l = null; + } + T_.prototype = new u7(); + T_.prototype.constructor = T_; + T_.prototype.Kc = function(a10) { + return a10.k; + }; + T_.prototype.zc = function(a10) { + return U_(this, a10); + }; + function U_(a10, b10) { + return xu(a10.l.ea, b10); + } + T_.prototype.$classData = r8({ Wra: 0 }, false, "amf.client.convert.CreativeWorkConverter$CreativeWorkMatcher$", { Wra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function V_() { + } + V_.prototype = new u7(); + V_.prototype.constructor = V_; + V_.prototype.Kc = function(a10) { + return a10.k; + }; + V_.prototype.zc = function(a10) { + return new Tk().HO(a10); + }; + V_.prototype.$classData = r8({ Xra: 0 }, false, "amf.client.convert.CustomDomainPropertyConverter$CustomDomainPropertyMatcher$", { Xra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function W_() { + } + W_.prototype = new u7(); + W_.prototype.constructor = W_; + W_.prototype.Kc = function(a10) { + return a10.k; + }; + W_.prototype.zc = function(a10) { + return new cl().aU(a10); + }; + W_.prototype.Br = function() { + return this; + }; + W_.prototype.$classData = r8({ Yra: 0 }, false, "amf.client.convert.DataNodeConverter$ArrayNodeMatcher$", { Yra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function X_() { + this.l = null; + } + X_.prototype = new u7(); + X_.prototype.constructor = X_; + function fl(a10, b10) { + return b10 instanceof Xk ? (a10.l.cS(), new Yk().aE(b10)) : b10 instanceof Vi ? (a10.l.eS(), new Zk().GO(b10)) : b10 instanceof bl ? (a10.l.qR(), new cl().aU(b10)) : null; + } + X_.prototype.Kc = function(a10) { + return a10.k; + }; + X_.prototype.zc = function(a10) { + return fl(this, a10); + }; + X_.prototype.Br = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + X_.prototype.$classData = r8({ Zra: 0 }, false, "amf.client.convert.DataNodeConverter$DataNodeMatcher$", { Zra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function Y_() { + } + Y_.prototype = new u7(); + Y_.prototype.constructor = Y_; + Y_.prototype.Kc = function(a10) { + return a10.k; + }; + Y_.prototype.zc = function(a10) { + return new Yk().aE(a10); + }; + Y_.prototype.Br = function() { + return this; + }; + Y_.prototype.$classData = r8({ $ra: 0 }, false, "amf.client.convert.DataNodeConverter$ObjectNodeMatcher$", { $ra: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function Z_() { + } + Z_.prototype = new u7(); + Z_.prototype.constructor = Z_; + Z_.prototype.Kc = function(a10) { + return a10.k; + }; + Z_.prototype.zc = function(a10) { + return new Zk().GO(a10); + }; + Z_.prototype.Br = function() { + return this; + }; + Z_.prototype.$classData = r8({ asa: 0 }, false, "amf.client.convert.DataNodeConverter$ScalarNodeMatcher$", { asa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function $_() { + this.l = null; + } + $_.prototype = new u7(); + $_.prototype.constructor = $_; + $_.prototype.Kc = function(a10) { + return a10.k; + }; + $_.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + $_.prototype.$classData = r8({ bsa: 0 }, false, "amf.client.convert.DatatypePropertyMappingConverter$DatatypePropertyMappingConverter$", { bsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function a0() { + this.l = null; + } + a0.prototype = new u7(); + a0.prototype.constructor = a0; + a0.prototype.P$ = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + a0.prototype.Kc = function(a10) { + return a10.k; + }; + a0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + a0.prototype.$classData = r8({ csa: 0 }, false, "amf.client.convert.DeclarationsConverter$AbstractDeclarationMatcher$", { csa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function mU() { + this.l = null; + } + mU.prototype = new u7(); + mU.prototype.constructor = mU; + mU.prototype.P$ = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + mU.prototype.Kc = function(a10) { + return a10.k; + }; + mU.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + mU.prototype.$classData = r8({ dsa: 0 }, false, "amf.client.convert.DeclarationsConverter$ParameterizedDeclarationMatcher$", { dsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function b0() { + this.l = null; + } + b0.prototype = new u7(); + b0.prototype.constructor = b0; + b0.prototype.Kc = function(a10) { + return a10.k; + }; + b0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + b0.prototype.$classData = r8({ esa: 0 }, false, "amf.client.convert.DialectDomainElementConverter$DialectDomainElementConvertej$", { esa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function c0() { + this.l = null; + } + c0.prototype = new u7(); + c0.prototype.constructor = c0; + c0.prototype.Kc = function(a10) { + return a10.k; + }; + c0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + c0.prototype.$classData = r8({ fsa: 0 }, false, "amf.client.convert.DocumentMappingConverter$DocumentMappingConverter$", { fsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function d0() { + this.l = null; + } + d0.prototype = new u7(); + d0.prototype.constructor = d0; + function GWa(a10, b10) { + return xu(a10.l.ea, b10); + } + d0.prototype.Kc = function(a10) { + return a10.k; + }; + d0.prototype.zc = function(a10) { + return GWa(this, a10); + }; + d0.prototype.$classData = r8({ gsa: 0 }, false, "amf.client.convert.DocumentsModelConverter$DocumentModelConverter$", { gsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function e0() { + this.l = null; + } + e0.prototype = new u7(); + e0.prototype.constructor = e0; + e0.prototype.Kc = function(a10) { + return a10.Oc(); + }; + function HWa(a10) { + var b10 = new e0(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + e0.prototype.zc = function(a10) { + return cea(this, a10); + }; + function cea(a10, b10) { + return xu(a10.l.ea, b10); + } + e0.prototype.$classData = r8({ hsa: 0 }, false, "amf.client.convert.DomainElementConverter$DomainElementMatcher$", { hsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function f0() { + } + f0.prototype = new u7(); + f0.prototype.constructor = f0; + f0.prototype.Kc = function(a10) { + return a10.k; + }; + f0.prototype.zc = function(a10) { + return new Uk().cE(a10); + }; + f0.prototype.$classData = r8({ isa: 0 }, false, "amf.client.convert.DomainExtensionConverter$DomainExtensionMatcher$", { isa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function g0() { + this.l = null; + } + g0.prototype = new u7(); + g0.prototype.constructor = g0; + g0.prototype.Kc = function(a10) { + return a10.k; + }; + g0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + g0.prototype.$classData = r8({ jsa: 0 }, false, "amf.client.convert.DynamicBindingConverter$DynamicBindingMatcher$", { jsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function h0() { + this.l = null; + } + h0.prototype = new u7(); + h0.prototype.constructor = h0; + h0.prototype.Kc = function(a10) { + return a10.k; + }; + h0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + h0.prototype.$classData = r8({ ksa: 0 }, false, "amf.client.convert.EmptyBindingConverter$EmptyBindingMatcher$", { ksa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function i0() { + this.l = null; + } + i0.prototype = new u7(); + i0.prototype.constructor = i0; + i0.prototype.Kc = function(a10) { + return a10.k; + }; + i0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + i0.prototype.$classData = r8({ lsa: 0 }, false, "amf.client.convert.EncodingConverter$EncodingMatcher$", { lsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function j0() { + this.l = null; + } + j0.prototype = new u7(); + j0.prototype.constructor = j0; + j0.prototype.Kc = function(a10) { + return a10.k; + }; + j0.prototype.zc = function(a10) { + return IWa(this, a10); + }; + function IWa(a10, b10) { + return xu(a10.l.ea, b10); + } + j0.prototype.$classData = r8({ msa: 0 }, false, "amf.client.convert.EndPointConverter$EndPointMatcher$", { msa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function k0() { + this.l = null; + } + k0.prototype = new u7(); + k0.prototype.constructor = k0; + k0.prototype.Kc = function(a10) { + return a10.k; + }; + k0.prototype.zc = function(a10) { + return JWa(this, a10); + }; + function JWa(a10, b10) { + return xu(a10.l.ea, b10); + } + k0.prototype.$classData = r8({ nsa: 0 }, false, "amf.client.convert.ExampleConverter$ExampleMatcher$", { nsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function l0() { + this.l = null; + } + l0.prototype = new u7(); + l0.prototype.constructor = l0; + l0.prototype.Kc = function(a10) { + return a10.k; + }; + l0.prototype.zc = function(a10) { + return KWa(this, a10); + }; + function KWa(a10, b10) { + return xu(a10.l.ea, b10); + } + l0.prototype.$classData = r8({ osa: 0 }, false, "amf.client.convert.ExternalConverter$ExternalConverter$", { osa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function m0() { + } + m0.prototype = new u7(); + m0.prototype.constructor = m0; + m0.prototype.Kc = function(a10) { + return a10.k; + }; + m0.prototype.zc = function(a10) { + return new Uo().dq(a10); + }; + m0.prototype.$classData = r8({ psa: 0 }, false, "amf.client.convert.FieldConverter$AnnotationsFieldMatcher$", { psa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function n0() { + this.l = null; + } + n0.prototype = new u7(); + n0.prototype.constructor = n0; + n0.prototype.Kc = function(a10) { + return a10.k; + }; + n0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + n0.prototype.$classData = r8({ vsa: 0 }, false, "amf.client.convert.FileShapeConverter$FileShapeMatcher$", { vsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function kU() { + } + kU.prototype = new u7(); + kU.prototype.constructor = kU; + kU.prototype.Kc = function(a10) { + return a10.k; + }; + kU.prototype.zc = function(a10) { + return GLa(a10); + }; + kU.prototype.$classData = r8({ ysa: 0 }, false, "amf.client.convert.GraphDomainConverter$GraphDomainConverter$", { ysa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function o0() { + this.l = null; + } + o0.prototype = new u7(); + o0.prototype.constructor = o0; + o0.prototype.Kc = function(a10) { + return a10.k; + }; + o0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + o0.prototype.$classData = r8({ zsa: 0 }, false, "amf.client.convert.HttpMessageBindingConverter$HttpMessageBindingMatcher$", { zsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function p0() { + this.l = null; + } + p0.prototype = new u7(); + p0.prototype.constructor = p0; + p0.prototype.Kc = function(a10) { + return a10.k; + }; + p0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + p0.prototype.$classData = r8({ Asa: 0 }, false, "amf.client.convert.HttpOperationBindingConverter$HttpOperationBindingMatcher$", { Asa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function q0() { + this.l = null; + } + q0.prototype = new u7(); + q0.prototype.constructor = q0; + q0.prototype.Kc = function(a10) { + return a10.k; + }; + q0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + q0.prototype.$classData = r8({ Bsa: 0 }, false, "amf.client.convert.IriTemplateMappingConverter$IriTemplateMappingConverter$", { Bsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function r0() { + this.l = null; + } + r0.prototype = new u7(); + r0.prototype.constructor = r0; + r0.prototype.Kc = function(a10) { + return a10.k; + }; + r0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + r0.prototype.$classData = r8({ Csa: 0 }, false, "amf.client.convert.KafkaMessageBindingConverter$KafkaMessageBindingMatcher$", { Csa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function s0() { + this.l = null; + } + s0.prototype = new u7(); + s0.prototype.constructor = s0; + s0.prototype.Kc = function(a10) { + return a10.k; + }; + s0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + s0.prototype.$classData = r8({ Dsa: 0 }, false, "amf.client.convert.KafkaOperationBindingConverter$KafkaOperationBindingMatcher$", { Dsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function t0() { + this.l = null; + } + t0.prototype = new u7(); + t0.prototype.constructor = t0; + t0.prototype.Kc = function(a10) { + return a10.k; + }; + t0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + t0.prototype.$classData = r8({ Esa: 0 }, false, "amf.client.convert.LicenseConverter$LicenseMatcher$", { Esa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function u0() { + this.l = null; + } + u0.prototype = new u7(); + u0.prototype.constructor = u0; + u0.prototype.Kc = function(a10) { + return a10.k; + }; + u0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + u0.prototype.$classData = r8({ Fsa: 0 }, false, "amf.client.convert.MessageBindingConverter$MessageBindingMatcher$", { Fsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function v0() { + this.l = null; + } + v0.prototype = new u7(); + v0.prototype.constructor = v0; + v0.prototype.Kc = function(a10) { + return a10.k; + }; + v0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + v0.prototype.$classData = r8({ Gsa: 0 }, false, "amf.client.convert.MqttMessageBindingConverter$MqttMessageBindingMatcher$", { Gsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function w0() { + this.l = null; + } + w0.prototype = new u7(); + w0.prototype.constructor = w0; + w0.prototype.Kc = function(a10) { + return a10.k; + }; + w0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + w0.prototype.$classData = r8({ Hsa: 0 }, false, "amf.client.convert.MqttOperationBindingConverter$MqttOperationBindingMatcher$", { Hsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function x0() { + this.l = null; + } + x0.prototype = new u7(); + x0.prototype.constructor = x0; + x0.prototype.Kc = function(a10) { + return a10.k; + }; + x0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + x0.prototype.$classData = r8({ Isa: 0 }, false, "amf.client.convert.MqttServerBindingConverter$MqttServerBindingMatcher$", { Isa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function y0() { + this.l = null; + } + y0.prototype = new u7(); + y0.prototype.constructor = y0; + y0.prototype.Kc = function(a10) { + return a10.k; + }; + y0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + y0.prototype.$classData = r8({ Jsa: 0 }, false, "amf.client.convert.MqttServerLastWillConverter$MqttServerLastWillMatcher$", { Jsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function z0() { + this.l = null; + } + z0.prototype = new u7(); + z0.prototype.constructor = z0; + z0.prototype.Kc = function(a10) { + return a10.k; + }; + z0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + z0.prototype.$classData = r8({ Ksa: 0 }, false, "amf.client.convert.NilShapeConverter$NilShapeMatcher$", { Ksa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function A0() { + this.l = null; + } + A0.prototype = new u7(); + A0.prototype.constructor = A0; + A0.prototype.Kc = function(a10) { + return a10.k; + }; + A0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + A0.prototype.$classData = r8({ Lsa: 0 }, false, "amf.client.convert.NodeMappingConverter$NodeMappingConverter$", { Lsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function B0() { + this.l = null; + } + B0.prototype = new u7(); + B0.prototype.constructor = B0; + function LWa(a10, b10) { + return xu(a10.l.ea, b10); + } + B0.prototype.Kc = function(a10) { + return a10.k; + }; + B0.prototype.zc = function(a10) { + return LWa(this, a10); + }; + B0.prototype.$classData = r8({ Msa: 0 }, false, "amf.client.convert.NodeShapeConverter$NodeShapeMatcher$", { Msa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function C0() { + this.l = null; + } + C0.prototype = new u7(); + C0.prototype.constructor = C0; + C0.prototype.Kc = function(a10) { + return a10.k; + }; + C0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + C0.prototype.$classData = r8({ Nsa: 0 }, false, "amf.client.convert.OAuth2FlowConverter$OAuth2FlowMatcher$", { Nsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function D0() { + this.l = null; + } + D0.prototype = new u7(); + D0.prototype.constructor = D0; + D0.prototype.Kc = function(a10) { + return a10.k; + }; + D0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + D0.prototype.$classData = r8({ Osa: 0 }, false, "amf.client.convert.ObjectPropertyMappingConverter$ObjectPropertyMappingConverter$", { Osa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function E0() { + this.l = null; + } + E0.prototype = new u7(); + E0.prototype.constructor = E0; + E0.prototype.Kc = function(a10) { + return a10.k; + }; + E0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + E0.prototype.$classData = r8({ Psa: 0 }, false, "amf.client.convert.OperationBindingConverter$OperationBindingMatcher$", { Psa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function F0() { + this.l = null; + } + F0.prototype = new u7(); + F0.prototype.constructor = F0; + F0.prototype.Kc = function(a10) { + return a10.k; + }; + F0.prototype.zc = function(a10) { + return MWa(this, a10); + }; + function MWa(a10, b10) { + return xu(a10.l.ea, b10); + } + F0.prototype.$classData = r8({ Qsa: 0 }, false, "amf.client.convert.OperationConverter$OperationMatcher$", { Qsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function G0() { + this.l = null; + } + G0.prototype = new u7(); + G0.prototype.constructor = G0; + G0.prototype.Kc = function(a10) { + return a10.k; + }; + G0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + G0.prototype.$classData = r8({ Rsa: 0 }, false, "amf.client.convert.OrganizationConverter$OrganizationMatcher$", { Rsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function H0() { + this.l = null; + } + H0.prototype = new u7(); + H0.prototype.constructor = H0; + H0.prototype.Kc = function(a10) { + return a10.k; + }; + H0.prototype.zc = function(a10) { + return I0(this, a10); + }; + function I0(a10, b10) { + return xu(a10.l.ea, b10); + } + H0.prototype.$classData = r8({ Ssa: 0 }, false, "amf.client.convert.ParameterConverter$ParameterMatcher$", { Ssa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function J0() { + this.l = null; + } + J0.prototype = new u7(); + J0.prototype.constructor = J0; + J0.prototype.Kc = function(a10) { + return a10.k; + }; + J0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + J0.prototype.$classData = r8({ Tsa: 0 }, false, "amf.client.convert.ParametrizedSecuritySchemeConverter$ParametrizedSecuritySchemeMatcher$", { Tsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function K0() { + this.l = null; + } + K0.prototype = new u7(); + K0.prototype.constructor = K0; + K0.prototype.Kc = function(a10) { + return a10.k; + }; + K0.prototype.zc = function(a10) { + return L0(this, a10); + }; + function L0(a10, b10) { + return xu(a10.l.ea, b10); + } + K0.prototype.$classData = r8({ Usa: 0 }, false, "amf.client.convert.PayloadConverter$PayloadMatcher$", { Usa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function M0() { + this.l = null; + } + M0.prototype = new u7(); + M0.prototype.constructor = M0; + M0.prototype.Kc = function(a10) { + return a10.Sv(); + }; + M0.prototype.zc = function(a10) { + return nfa(this, a10); + }; + function nfa(a10, b10) { + return xu(a10.l.ea, b10); + } + M0.prototype.$classData = r8({ Vsa: 0 }, false, "amf.client.convert.PayloadFragmentConverter$PayloadFragmentMatcher$", { Vsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function N0() { + } + N0.prototype = new u7(); + N0.prototype.constructor = N0; + N0.prototype.Kc = function(a10) { + return a10.k; + }; + N0.prototype.zc = function(a10) { + var b10 = new Zp(); + b10.k = a10; + return b10; + }; + N0.prototype.$classData = r8({ Wsa: 0 }, false, "amf.client.convert.PayloadValidatorConverter$PayloadValidatorMatcher$", { Wsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function O0() { + this.l = null; + } + O0.prototype = new u7(); + O0.prototype.constructor = O0; + O0.prototype.Kc = function(a10) { + return a10.k; + }; + O0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + O0.prototype.$classData = r8({ Xsa: 0 }, false, "amf.client.convert.PropertyDependenciesConverter$PropertyDependenciesMatcher$", { Xsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function P0() { + this.l = null; + } + P0.prototype = new u7(); + P0.prototype.constructor = P0; + P0.prototype.Kc = function(a10) { + return a10.k; + }; + P0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + P0.prototype.$classData = r8({ Ysa: 0 }, false, "amf.client.convert.PropertyMappingConverter$PropertyMappingConverter$", { Ysa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function Q0() { + this.l = null; + } + Q0.prototype = new u7(); + Q0.prototype.constructor = Q0; + function NWa(a10, b10) { + return xu(a10.l.ea, b10); + } + Q0.prototype.Kc = function(a10) { + return a10.k; + }; + Q0.prototype.zc = function(a10) { + return NWa(this, a10); + }; + function OWa(a10) { + var b10 = new Q0(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + Q0.prototype.$classData = r8({ Zsa: 0 }, false, "amf.client.convert.PropertyShapeConverter$PropertyShapeMatcher$", { Zsa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function R0() { + this.l = null; + } + R0.prototype = new u7(); + R0.prototype.constructor = R0; + R0.prototype.Kc = function(a10) { + return a10.k; + }; + R0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + R0.prototype.$classData = r8({ $sa: 0 }, false, "amf.client.convert.PublicNodeMappingConverter$PublicNodeMappingConverter$", { $sa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function S0() { + } + S0.prototype = new u7(); + S0.prototype.constructor = S0; + S0.prototype.Kc = function(a10) { + return PWa(a10); + }; + S0.prototype.zc = function(a10) { + if (a10 instanceof T0) + a10 = a10.dv; + else + throw new x7().d(a10); + return a10; + }; + S0.prototype.$classData = r8({ ata: 0 }, false, "amf.client.convert.ReferenceResolverConverter$ReferenceResolverMatcher$", { ata: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function U0() { + this.l = null; + } + U0.prototype = new u7(); + U0.prototype.constructor = U0; + U0.prototype.Kc = function(a10) { + return a10.k; + }; + U0.prototype.zc = function(a10) { + return QWa(this, a10); + }; + function QWa(a10, b10) { + return xu(a10.l.ea, b10); + } + U0.prototype.$classData = r8({ bta: 0 }, false, "amf.client.convert.RequestConverter$RequestMatcher$", { bta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function V0() { + } + V0.prototype = new u7(); + V0.prototype.constructor = V0; + V0.prototype.Kc = function(a10) { + return RWa(a10); + }; + V0.prototype.zc = function(a10) { + if (a10 instanceof W0) + a10 = a10.dv; + else + throw new x7().d(a10); + return a10; + }; + V0.prototype.$classData = r8({ cta: 0 }, false, "amf.client.convert.ResourceLoaderConverter$ResourceLoaderMatcher$", { cta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function X0() { + } + X0.prototype = new u7(); + X0.prototype.constructor = X0; + X0.prototype.Kc = function(a10) { + return a10.k; + }; + X0.prototype.zc = function(a10) { + return new Wm().l1(a10); + }; + X0.prototype.$classData = r8({ dta: 0 }, false, "amf.client.convert.ResourceTypeConverter$ResourceTypeMatcher$", { dta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function Y0() { + this.l = null; + } + Y0.prototype = new u7(); + Y0.prototype.constructor = Y0; + Y0.prototype.Kc = function(a10) { + return a10.k; + }; + Y0.prototype.zc = function(a10) { + return SWa(this, a10); + }; + function SWa(a10, b10) { + return xu(a10.l.ea, b10); + } + Y0.prototype.$classData = r8({ eta: 0 }, false, "amf.client.convert.ResponseConverter$ResponseMatcher$", { eta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function Z0() { + this.l = null; + } + Z0.prototype = new u7(); + Z0.prototype.constructor = Z0; + Z0.prototype.Kc = function(a10) { + return a10.k; + }; + Z0.prototype.zc = function(a10) { + return TWa(this, a10); + }; + function TWa(a10, b10) { + return xu(a10.l.ea, b10); + } + Z0.prototype.$classData = r8({ fta: 0 }, false, "amf.client.convert.ScalarShapeConverter$ScalarShapeMatcher$", { fta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function $0() { + this.l = null; + } + $0.prototype = new u7(); + $0.prototype.constructor = $0; + $0.prototype.Kc = function(a10) { + return a10.k; + }; + $0.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + $0.prototype.$classData = r8({ gta: 0 }, false, "amf.client.convert.SchemaShapeConverter$SchemaShapeMatcher$", { gta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function a1() { + this.l = null; + } + a1.prototype = new u7(); + a1.prototype.constructor = a1; + a1.prototype.Kc = function(a10) { + return a10.k; + }; + a1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + a1.prototype.$classData = r8({ hta: 0 }, false, "amf.client.convert.ScopeConverter$ScopeMatcher$", { hta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function b1() { + this.l = null; + } + b1.prototype = new u7(); + b1.prototype.constructor = b1; + b1.prototype.Kc = function(a10) { + return a10.k; + }; + b1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + b1.prototype.$classData = r8({ ita: 0 }, false, "amf.client.convert.SecurityRequirementConverter$SecurityRequirementMatcher$", { ita: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function c1() { + this.l = null; + } + c1.prototype = new u7(); + c1.prototype.constructor = c1; + function UWa(a10, b10) { + return xu(a10.l.ea, b10); + } + c1.prototype.Kc = function(a10) { + return a10.k; + }; + c1.prototype.zc = function(a10) { + return UWa(this, a10); + }; + c1.prototype.$classData = r8({ jta: 0 }, false, "amf.client.convert.SecuritySchemeConverter$SecuritySchemeMatcher$", { jta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function d1() { + this.l = null; + } + d1.prototype = new u7(); + d1.prototype.constructor = d1; + d1.prototype.Kc = function(a10) { + return a10.k; + }; + d1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + d1.prototype.$classData = r8({ kta: 0 }, false, "amf.client.convert.ServerBindingConverter$ServerBindingMatcher$", { kta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function e1() { + this.l = null; + } + e1.prototype = new u7(); + e1.prototype.constructor = e1; + e1.prototype.Kc = function(a10) { + return a10.k; + }; + e1.prototype.zc = function(a10) { + return VWa(this, a10); + }; + function VWa(a10, b10) { + return xu(a10.l.ea, b10); + } + e1.prototype.$classData = r8({ lta: 0 }, false, "amf.client.convert.ServerConverter$ServerMatcher$", { lta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function f1() { + } + f1.prototype = new u7(); + f1.prototype.constructor = f1; + f1.prototype.Kc = function(a10) { + return a10.k; + }; + f1.prototype.zc = function(a10) { + return new g1().qU(a10); + }; + f1.prototype.Wz = function() { + return this; + }; + f1.prototype.$classData = r8({ mta: 0 }, false, "amf.client.convert.SettingsConverter$ApiKeySettingsMatcher$", { mta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function h1() { + } + h1.prototype = new u7(); + h1.prototype.constructor = h1; + h1.prototype.Kc = function(a10) { + return a10.k; + }; + h1.prototype.zc = function(a10) { + return new i1().rU(a10); + }; + h1.prototype.Wz = function() { + return this; + }; + h1.prototype.$classData = r8({ nta: 0 }, false, "amf.client.convert.SettingsConverter$HttpSettingsMatcher$", { nta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function j1() { + } + j1.prototype = new u7(); + j1.prototype.constructor = j1; + j1.prototype.Kc = function(a10) { + return a10.k; + }; + j1.prototype.zc = function(a10) { + return new k1().sU(a10); + }; + j1.prototype.Wz = function() { + return this; + }; + j1.prototype.$classData = r8({ ota: 0 }, false, "amf.client.convert.SettingsConverter$OAuth1SettingsMatcher$", { ota: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function l1() { + } + l1.prototype = new u7(); + l1.prototype.constructor = l1; + l1.prototype.Kc = function(a10) { + return a10.k; + }; + l1.prototype.zc = function(a10) { + return new m1().tU(a10); + }; + l1.prototype.Wz = function() { + return this; + }; + l1.prototype.$classData = r8({ pta: 0 }, false, "amf.client.convert.SettingsConverter$OAuth2SettingsMatcher$", { pta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function n1() { + } + n1.prototype = new u7(); + n1.prototype.constructor = n1; + n1.prototype.Kc = function(a10) { + return a10.k; + }; + n1.prototype.zc = function(a10) { + return new o1().uU(a10); + }; + n1.prototype.Wz = function() { + return this; + }; + n1.prototype.$classData = r8({ qta: 0 }, false, "amf.client.convert.SettingsConverter$OpenIdConnectSettingsMatcher$", { qta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function p1() { + this.l = null; + } + p1.prototype = new u7(); + p1.prototype.constructor = p1; + p1.prototype.Kc = function(a10) { + return a10.k; + }; + p1.prototype.zc = function(a10) { + return WWa(this, a10); + }; + p1.prototype.Wz = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function WWa(a10, b10) { + return b10 instanceof q1 ? (XWa(a10.l), new k1().sU(b10)) : b10 instanceof wE ? (YWa(a10.l), new m1().tU(b10)) : b10 instanceof bR ? (ZWa(a10.l), new g1().qU(b10)) : b10 instanceof r1 ? ($Wa(a10.l), new i1().rU(b10)) : b10 instanceof uE ? (aXa(a10.l), new o1().uU(b10)) : null !== b10 ? new Pm().XG(b10) : null; + } + p1.prototype.$classData = r8({ rta: 0 }, false, "amf.client.convert.SettingsConverter$SettingsMatcher$", { rta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function s1() { + this.l = null; + } + s1.prototype = new u7(); + s1.prototype.constructor = s1; + s1.prototype.Kc = function(a10) { + return a10.Ce(); + }; + s1.prototype.zc = function(a10) { + return t1(this, a10); + }; + function bXa(a10) { + var b10 = new s1(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + function t1(a10, b10) { + return xu(a10.l.ea, b10); + } + s1.prototype.$classData = r8({ sta: 0 }, false, "amf.client.convert.ShapeConverter$ShapeMatcher$", { sta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function u1() { + } + u1.prototype = new u7(); + u1.prototype.constructor = u1; + u1.prototype.Kc = function(a10) { + return a10.k; + }; + u1.prototype.zc = function(a10) { + return new v1().Z$(a10); + }; + u1.prototype.$classData = r8({ tta: 0 }, false, "amf.client.convert.ShapeExtensionConverter$ShapeExtensionMatcher$", { tta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function w1() { + this.l = null; + } + w1.prototype = new u7(); + w1.prototype.constructor = w1; + w1.prototype.Kc = function(a10) { + return a10.k; + }; + w1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + w1.prototype.$classData = r8({ uta: 0 }, false, "amf.client.convert.TagConverter$TagMatcher$", { uta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function x1() { + this.l = null; + } + x1.prototype = new u7(); + x1.prototype.constructor = x1; + x1.prototype.Kc = function(a10) { + return a10.k; + }; + x1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + x1.prototype.$classData = r8({ vta: 0 }, false, "amf.client.convert.TemplatedLinkConverter$TemplatedLinkConverter$", { vta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function y1() { + } + y1.prototype = new u7(); + y1.prototype.constructor = y1; + y1.prototype.Kc = function(a10) { + return a10.k; + }; + y1.prototype.zc = function(a10) { + return new Um().m1(a10); + }; + y1.prototype.$classData = r8({ wta: 0 }, false, "amf.client.convert.TraitConverter$TraitMatcher$", { wta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function z1() { + this.l = null; + } + z1.prototype = new u7(); + z1.prototype.constructor = z1; + z1.prototype.Kc = function(a10) { + return a10.ac; + }; + z1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + z1.prototype.$classData = r8({ xta: 0 }, false, "amf.client.convert.TupleShapeConverter$TupleShapeMatcher$", { xta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function A1() { + } + A1.prototype = new u7(); + A1.prototype.constructor = A1; + A1.prototype.Kc = function(a10) { + return a10.k; + }; + A1.prototype.zc = function(a10) { + return new B1().ila(a10); + }; + A1.prototype.$classData = r8({ yta: 0 }, false, "amf.client.convert.ValidationCandidateConverter$ValidationCandidateMatcher$", { yta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function C1() { + } + C1.prototype = new u7(); + C1.prototype.constructor = C1; + C1.prototype.Kc = function(a10) { + return a10.k; + }; + C1.prototype.zc = function(a10) { + return new $p().gla(a10); + }; + C1.prototype.$classData = r8({ zta: 0 }, false, "amf.client.convert.ValidationConverter$ValidationReportMatcher$", { zta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function D1() { + } + D1.prototype = new u7(); + D1.prototype.constructor = D1; + D1.prototype.Kc = function(a10) { + return a10.k; + }; + D1.prototype.zc = function(a10) { + return new eq2().hla(a10); + }; + D1.prototype.$classData = r8({ Ata: 0 }, false, "amf.client.convert.ValidationConverter$ValidationResultMatcher$", { Ata: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function E1() { + } + E1.prototype = new u7(); + E1.prototype.constructor = E1; + E1.prototype.Kc = function(a10) { + return a10.k; + }; + E1.prototype.zc = function(a10) { + return eea(a10); + }; + E1.prototype.$classData = r8({ Bta: 0 }, false, "amf.client.convert.VariableValueConverter$VariableValueMatcher$", { Bta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function F1() { + this.l = null; + } + F1.prototype = new u7(); + F1.prototype.constructor = F1; + F1.prototype.Kc = function(a10) { + return a10.k; + }; + F1.prototype.zc = function(a10) { + return cXa(this, a10); + }; + function cXa(a10, b10) { + return xu(a10.l.ea, b10); + } + F1.prototype.$classData = r8({ Dta: 0 }, false, "amf.client.convert.VocabularyReferenceConverter$VocabularyReferenceConverter$", { Dta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function G1() { + this.l = null; + } + G1.prototype = new u7(); + G1.prototype.constructor = G1; + G1.prototype.Kc = function(a10) { + return a10.k; + }; + G1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + G1.prototype.$classData = r8({ Gta: 0 }, false, "amf.client.convert.WebSocketsChannelBindingConverter$WebSocketsChannelBindingMatcher$", { Gta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function H1() { + this.l = null; + } + H1.prototype = new u7(); + H1.prototype.constructor = H1; + H1.prototype.Kc = function(a10) { + return a10.k; + }; + H1.prototype.zc = function(a10) { + return xu(this.l.ea, a10); + }; + H1.prototype.$classData = r8({ Hta: 0 }, false, "amf.client.convert.XMLSerializerConverter$XMLSerializerMatcher$", { Hta: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + function dXa(a10) { + ab(); + a10 = B6(a10.k.Y(), dl().R); + ab().cb(); + return gb(a10); + } + function eXa(a10, b10) { + var c10 = a10.k, e10 = dl().R; + eb(c10, e10, b10); + return a10; + } + function fXa() { + this.xja = null; + } + fXa.prototype = new u7(); + fXa.prototype.constructor = fXa; + d7 = fXa.prototype; + d7.Ar = function(a10, b10) { + WAa(this, a10, b10); + }; + function hfa(a10) { + var b10 = new fXa(); + b10.xja = a10; + return b10; + } + d7.yB = function(a10, b10) { + return YAa(this, a10, b10); + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + this.Gc(a10.j, b10, c10, e10, f10, Yb().dh, g10); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + var k10 = this.xja, l10 = ab(), m10 = ab().Lf(); + c10 = bb(l10, c10, m10).Ra(); + l10 = ab(); + gXa || (gXa = new I1().a()); + f10 = bb(l10, f10, gXa).Ra(); + l10 = ab(); + m10 = ab().Lf(); + k10.Eoa(a10, b10, c10, e10, f10, g10, bb(l10, h10, m10).Ra()); + }; + d7.$classData = r8({ swa: 0 }, false, "amf.client.resolve.ClientErrorHandlerConverter$$anon$1", { swa: 1, f: 1, zq: 1, Zp: 1, Bp: 1 }); + function I1() { + } + I1.prototype = new u7(); + I1.prototype.constructor = I1; + I1.prototype.a = function() { + return this; + }; + I1.prototype.Kc = function(a10) { + return new be4().jj(a10); + }; + I1.prototype.zc = function(a10) { + return a10.yc; + }; + I1.prototype.$classData = r8({ uwa: 0 }, false, "amf.client.resolve.ClientErrorHandlerConverter$RangeToLexicalConverter$", { uwa: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + var gXa = void 0; + function J1() { + CF.call(this); + this.mna = null; + } + J1.prototype = new YLa(); + J1.prototype.constructor = J1; + J1.prototype.e = function(a10) { + this.mna = a10; + var b10 = new CF().e(a10); + CF.prototype.Ge.call(this, a10, b10); + return this; + }; + Object.defineProperty(J1.prototype, "msj", { get: function() { + return this.mna; + }, configurable: true }); + J1.prototype.$classData = r8({ Awa: 0 }, false, "amf.client.resource.ResourceNotFound", { Awa: 1, Nga: 1, bf: 1, f: 1, o: 1 }); + function Ft() { + } + Ft.prototype = new u7(); + Ft.prototype.constructor = Ft; + Ft.prototype.a = function() { + return this; + }; + Ft.prototype.Ji = function(a10) { + a10 = Mc(ua(), a10, ","); + var b10 = []; + for (var c10 = 0, e10 = a10.n.length; c10 < e10; ) { + var f10 = a10.n[c10]; + f10 = Mc(ua(), f10, "->"); + a: { + var g10 = Fd(Gd(), f10); + if (!g10.b() && null !== g10.c() && 0 === g10.c().Oe(2)) { + f10 = g10.c().lb(0); + g10 = g10.c().lb(1); + var h10 = Mc(ua(), g10, "::"); + g10 = Fd(Gd(), h10); + if (!g10.b() && null !== g10.c() && 0 === g10.c().Oe(2)) { + h10 = g10.c().lb(0); + g10 = g10.c().lb(1); + g10 = new R6().M(h10, g10); + f10 = new R6().M(f10, g10); + break a; + } + throw new x7().d(h10); + } + throw new x7().d(f10); + } + b10.push(null === f10 ? null : f10); + c10 = 1 + c10 | 0; + } + a10 = ha(Ja(hXa), b10); + b10 = qe2(); + b10 = re4(b10).es(); + c10 = a10.n.length; + switch (c10) { + case -1: + break; + default: + b10.pj(c10); + } + b10.jh(new VI().fd(a10)); + return new z7().d(new tB().hk(b10.Rc())); + }; + Ft.prototype.$classData = r8({ Uwa: 0 }, false, "amf.core.annotations.Aliases$", { Uwa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var Zha = void 0; + function K1() { + } + K1.prototype = new u7(); + K1.prototype.constructor = K1; + K1.prototype.a = function() { + return this; + }; + K1.prototype.Ji = function() { + return new z7().d(new Kz().a()); + }; + K1.prototype.$classData = r8({ Wwa: 0 }, false, "amf.core.annotations.AutoGeneratedName$", { Wwa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var iXa = void 0; + function Dt() { + } + Dt.prototype = new u7(); + Dt.prototype.constructor = Dt; + Dt.prototype.a = function() { + return this; + }; + Dt.prototype.Ji = function(a10) { + a10 = AU(ae4(), a10); + return new z7().d(new L1().jj(a10)); + }; + Dt.prototype.$classData = r8({ Ywa: 0 }, false, "amf.core.annotations.BasePathLexicalInformation$", { Ywa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var Wha = void 0; + function It() { + } + It.prototype = new u7(); + It.prototype.constructor = It; + It.prototype.a = function() { + return this; + }; + It.prototype.Ji = function(a10) { + a10 = Mc(ua(), a10, "#"); + var b10 = []; + for (var c10 = 0, e10 = a10.n.length; c10 < e10; ) { + var f10 = a10.n[c10]; + f10 = Mc(ua(), f10, "->"); + var g10 = Fd(Gd(), f10); + if (g10.b() || null === g10.c() || 0 !== g10.c().Oe(2)) + throw new x7().d(f10); + f10 = g10.c().lb(0); + g10 = g10.c().lb(1); + g10 = ema(Uha(), g10); + f10 = new R6().M(f10, g10); + b10.push(null === f10 ? null : f10); + c10 = 1 + c10 | 0; + } + a10 = ha(Ja(hXa), b10); + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.n.length; c10 < e10; ) + WA(b10, a10.n[c10]), c10 = 1 + c10 | 0; + return new z7().d(jXa(b10.eb)); + }; + It.prototype.$classData = r8({ $wa: 0 }, false, "amf.core.annotations.DataNodePropertiesAnnotations$", { $wa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var bia = void 0; + function M1() { + } + M1.prototype = new u7(); + M1.prototype.constructor = M1; + M1.prototype.a = function() { + return this; + }; + M1.prototype.Ji = function() { + return new z7().d(new Zh().a()); + }; + M1.prototype.$classData = r8({ bxa: 0 }, false, "amf.core.annotations.DeclaredElement$", { bxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var kXa = void 0; + function Ht() { + } + Ht.prototype = new u7(); + Ht.prototype.constructor = Ht; + Ht.prototype.a = function() { + return this; + }; + Ht.prototype.Ji = function() { + return new z7().d(new N1().a()); + }; + Ht.prototype.$classData = r8({ exa: 0 }, false, "amf.core.annotations.DefaultNode$", { exa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var aia = void 0; + function O1() { + } + O1.prototype = new u7(); + O1.prototype.constructor = O1; + O1.prototype.a = function() { + return this; + }; + O1.prototype.Ji = function(a10) { + return new z7().d(new P1().e(a10)); + }; + O1.prototype.$classData = r8({ kxa: 0 }, false, "amf.core.annotations.ExternalFragmentRef$", { kxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var lXa = void 0; + function Ct() { + } + Ct.prototype = new u7(); + Ct.prototype.constructor = Ct; + Ct.prototype.a = function() { + return this; + }; + Ct.prototype.Ji = function(a10) { + a10 = AU(ae4(), a10); + return new z7().d(new Q1().jj(a10)); + }; + Ct.prototype.$classData = r8({ mxa: 0 }, false, "amf.core.annotations.HostLexicalInformation$", { mxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var Vha = void 0; + function HY() { + } + HY.prototype = new u7(); + HY.prototype.constructor = HY; + HY.prototype.a = function() { + return this; + }; + HY.prototype.Ji = function(a10) { + return new z7().d(new $i().e(a10)); + }; + HY.prototype.$classData = r8({ oxa: 0 }, false, "amf.core.annotations.InheritanceProvenance$", { oxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var pRa = void 0; + function IY() { + } + IY.prototype = new u7(); + IY.prototype.constructor = IY; + IY.prototype.a = function() { + return this; + }; + IY.prototype.Ji = function(a10) { + return new z7().d(new R1().ts(mD(Gb(), Mc(ua(), a10, ",")))); + }; + IY.prototype.$classData = r8({ qxa: 0 }, false, "amf.core.annotations.InheritedShapes$", { qxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var qRa = void 0; + function S1() { + } + S1.prototype = new u7(); + S1.prototype.constructor = S1; + S1.prototype.a = function() { + return this; + }; + S1.prototype.Ji = function() { + return new z7().d(new yN().a()); + }; + S1.prototype.$classData = r8({ sxa: 0 }, false, "amf.core.annotations.InlineElement$", { sxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var mXa = void 0; + function T1() { + } + T1.prototype = new u7(); + T1.prototype.constructor = T1; + T1.prototype.a = function() { + return this; + }; + T1.prototype.Ji = function(a10) { + return new z7().d(ema(Uha(), a10)); + }; + function ema(a10, b10) { + return new be4().jj(AU(ae4(), b10)); + } + T1.prototype.$classData = r8({ txa: 0 }, false, "amf.core.annotations.LexicalInformation$", { txa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var nXa = void 0; + function Uha() { + nXa || (nXa = new T1().a()); + return nXa; + } + function JY() { + } + JY.prototype = new u7(); + JY.prototype.constructor = JY; + JY.prototype.a = function() { + return this; + }; + JY.prototype.Ji = function(a10) { + return new z7().d(new U1().e(a10)); + }; + JY.prototype.$classData = r8({ wxa: 0 }, false, "amf.core.annotations.NilUnion$", { wxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var rRa = void 0; + function Kt() { + } + Kt.prototype = new u7(); + Kt.prototype.constructor = Kt; + Kt.prototype.a = function() { + return this; + }; + Kt.prototype.Ji = function() { + return new z7().d(new V1().a()); + }; + Kt.prototype.$classData = r8({ yxa: 0 }, false, "amf.core.annotations.NullSecurity$", { yxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var dia = void 0; + function Jt() { + } + Jt.prototype = new u7(); + Jt.prototype.constructor = Jt; + Jt.prototype.a = function() { + return this; + }; + Jt.prototype.Ji = function(a10) { + return new z7().d(new $u().e(a10)); + }; + Jt.prototype.$classData = r8({ Cxa: 0 }, false, "amf.core.annotations.ResolvedLinkAnnotation$", { Cxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var cia = void 0; + function Et() { + } + Et.prototype = new u7(); + Et.prototype.constructor = Et; + Et.prototype.a = function() { + return this; + }; + Et.prototype.Ji = function() { + return new z7().d(new W1().a()); + }; + Et.prototype.$classData = r8({ Gxa: 0 }, false, "amf.core.annotations.SingleValueArray$", { Gxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var Yha = void 0; + function X1() { + } + X1.prototype = new u7(); + X1.prototype.constructor = X1; + X1.prototype.a = function() { + return this; + }; + X1.prototype.Ji = function(a10) { + return Xha().AP(a10); + }; + X1.prototype.AP = function(a10) { + return Ob().$ === a10 ? new z7().d(Y1(new Z1(), Ob())) : Qb().$ === a10 ? new z7().d(Y1(new Z1(), Qb())) : Pb().$ === a10 ? new z7().d(Y1(new Z1(), Pb())) : Du().$ === a10 ? new z7().d(Y1(new Z1(), Du())) : Au().$ === a10 ? new z7().d(Y1(new Z1(), Au())) : Bu().$ === a10 ? new z7().d(Y1(new Z1(), Au())) : Cu().$ === a10 ? new z7().d(Y1(new Z1(), Cu())) : y7(); + }; + X1.prototype.$classData = r8({ Lxa: 0 }, false, "amf.core.annotations.SourceVendor$", { Lxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var oXa = void 0; + function Xha() { + oXa || (oXa = new X1().a()); + return oXa; + } + function Gt() { + } + Gt.prototype = new u7(); + Gt.prototype.constructor = Gt; + Gt.prototype.a = function() { + return this; + }; + Gt.prototype.Ji = function() { + return new z7().d(new Xz().a()); + }; + Gt.prototype.$classData = r8({ Nxa: 0 }, false, "amf.core.annotations.SynthesizedField$", { Nxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var $ha = void 0; + function $1() { + } + $1.prototype = new u7(); + $1.prototype.constructor = $1; + $1.prototype.a = function() { + return this; + }; + function Gpa(a10, b10) { + a10 = [b10]; + if (0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + for (var c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + return new GC().hk(a10); + } + $1.prototype.Ji = function(a10) { + a10 = Mc(ua(), a10, ","); + var b10 = qe2(); + b10 = re4(b10).es(); + var c10 = a10.n.length; + switch (c10) { + case -1: + break; + default: + b10.pj(c10); + } + b10.jh(new VI().fd(a10)); + return new z7().d(new GC().hk(b10.Rc())); + }; + $1.prototype.$classData = r8({ Pxa: 0 }, false, "amf.core.annotations.TrackedElement$", { Pxa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var pXa = void 0; + function Hpa() { + pXa || (pXa = new $1().a()); + return pXa; + } + function a22(a10) { + var b10 = nc(), c10 = F6().Zd; + a10.bq(rb(new sb(), b10, G5(c10, "encodes"), tb(new ub(), vb().hg, "encodes", "The encodes relationship links a parsing Unit with the DomainElement from a particular domain the unit contains.", H10()))); + } + function qXa() { + throw mb(E6(), new nb().e("Fragment is abstract instances cannot be created directly")); + } + function b22(a10) { + var b10 = new xc().yd(nc()), c10 = F6().Zd; + a10.Jx(rb(new sb(), b10, G5(c10, "declares"), tb(new ub(), vb().hg, "declares", "The declares relationship exposes a DomainElement as a re-usable unit that can be referenced from other units.\nURIs for the declared DomainElement are considered to be stable and safe to reference from other DomainElements.", H10()))); + } + function rXa() { + this.uc = this.xj = this.Rd = this.qa = this.ba = this.g = null; + } + rXa.prototype = new u7(); + rXa.prototype.constructor = rXa; + d7 = rXa.prototype; + d7.a = function() { + sXa = this; + Cr(this); + aM(this); + ii(); + for (var a10 = [this.Rd, this.xj, this.uc], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.g = c10; + ii(); + a10 = F6().Zd; + a10 = [G5(a10, "ExternalSource")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + this.qa = tb(new ub(), vb().hg, "External Source Element", "Inlined fragment of information", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.$classData = r8({ Xya: 0 }, false, "amf.core.metamodel.domain.ExternalSourceElementModel$", { Xya: 1, f: 1, Ty: 1, hc: 1, Rb: 1 }); + var sXa = void 0; + function Zf() { + sXa || (sXa = new rXa().a()); + return sXa; + } + function tXa() { + this.oe = this.ed = this.te = this.pf = this.qa = this.g = this.ba = null; + } + tXa.prototype = new u7(); + tXa.prototype.constructor = tXa; + d7 = tXa.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + uXa = this; + Cr(this); + bM(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "Linkable")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + ii(); + a10 = [this.pf, this.ed, this.oe]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.g = c10; + this.qa = tb( + new ub(), + vb().hg, + "Linkable Element", + "Reification of a link between elements in the model. Used when we want to capture the structure of the source document\nin the graph itself. Linkable elements are just replaced by regular links after resolution.", + H10() + ); + return this; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Zya: 0 }, false, "amf.core.metamodel.domain.LinkableElementModel$", { Zya: 1, f: 1, mm: 1, hc: 1, Rb: 1 }); + var uXa = void 0; + function db() { + uXa || (uXa = new tXa().a()); + return uXa; + } + function vXa(a10) { + var b10 = F6().Pg; + b10 = G5(b10, "Object"); + var c10 = dl().ba; + a10.yia(ji(b10, c10)); + a10.xia(tb(new ub(), vb().Pg, "Object Node", "Node that represents a dynamic object with records data structure", H10())); + } + function Ic(a10) { + a10 = a10.A; + return a10 instanceof z7 ? !!a10.i : false; + } + function vEa(a10) { + a10 = a10.A; + return a10 instanceof z7 ? a10.i | 0 : 0; + } + function wXa(a10, b10, c10) { + if (c10 instanceof rf) + return new z7().d(fha(Vca(), c10)); + var e10 = dc().rN; + yB(a10, e10, b10.j, "Recursive loop generated in reference expansion: " + b10.j + " => " + c10.j, b10.fa()); + return y7(); + } + function Kfa(a10, b10) { + a10.jp(new z7().d(b10)); + return a10; + } + function $aa(a10, b10) { + LAa || (LAa = new gM().a()); + var c10 = LAa; + var e10 = gC(); + a10 = VB(a10, e10, c10); + c10 = Jc; + e10 = new xXa(); + e10.AK = b10; + return c10(a10, e10); + } + function ELa(a10, b10) { + b10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + for (h10 = kb(h10).Kb(); !h10.b(); ) { + if (ic(h10.ga()) === g10) + return true; + h10 = h10.ta(); + } + return false; + }; + }(a10, b10)); + var c10 = gC(), e10 = UB(); + a10 = VB(a10, c10, e10); + a10 = Hoa(a10, yXa(b10)); + return Xv(a10); + } + function Lc(a10) { + var b10 = B6(a10.Y(), Bq().uc).A; + return b10.b() ? yb(a10) : b10; + } + var AXa = function zXa(a10, b10, c10, e10, f10, g10, h10) { + if (f10.Ha(b10.j)) + return ut(b10) && Za(b10).na() && c10.P(b10) ? (b10 = e10.ug(b10, true), b10.b() ? null : b10.c()) : b10; + if (c10.P(b10)) + return a10 = e10.ug(b10, false), a10 instanceof z7 && (c10 = a10.i, null !== c10) ? g10.Ha(c10.j) ? (b10 = h10.ug(b10, c10), b10.b() ? null : b10.c()) : c10 : a10.b() ? null : a10.c(); + f10.Tm(b10.j); + if (Zc(b10)) { + var l10 = b10.Y().vb, m10 = mz(); + m10 = Ua(m10); + var p10 = Id().u; + l10 = Jd(l10, m10, p10).Cb(w6(/* @__PURE__ */ function() { + return function(v10) { + v10 = v10.Lc; + var A10 = Gk().xc; + return null === v10 ? null === A10 : v10.h(A10); + }; + }(a10))); + m10 = b10.Y().vb; + p10 = mz(); + p10 = Ua(p10); + var t10 = Id().u; + m10 = Jd(m10, p10, t10).Cb(w6(/* @__PURE__ */ function() { + return function(v10) { + v10 = v10.Lc; + var A10 = Gk().Ic; + return null === v10 ? null === A10 : v10.h(A10); + }; + }(a10))); + p10 = Xd(); + l10 = l10.ia(m10, p10.u); + m10 = b10.Y().vb; + p10 = mz(); + p10 = Ua(p10); + t10 = Id().u; + m10 = Jd(m10, p10, t10).Si(w6(/* @__PURE__ */ function() { + return function(v10) { + var A10 = v10.Lc, D10 = Gk().Ic; + if (null === A10 ? null === D10 : A10.h(D10)) + return true; + v10 = v10.Lc; + A10 = Gk().xc; + return null === v10 ? null === A10 : v10.h(A10); + }; + }(a10))); + p10 = Xd(); + l10 = l10.ia(m10, p10.u); + } else + vu(b10) ? (l10 = b10.Y().vb, m10 = mz(), m10 = Ua(m10), p10 = Id().u, l10 = Jd(l10, m10, p10).Cb(w6(/* @__PURE__ */ function() { + return function(v10) { + v10 = v10.Lc; + var A10 = Gk().xc; + return null === v10 ? null === A10 : v10.h(A10); + }; + }(a10))), m10 = b10.Y().vb, p10 = mz(), p10 = Ua(p10), t10 = Id().u, m10 = Jd(m10, p10, t10).Si(w6(/* @__PURE__ */ function() { + return function(v10) { + v10 = v10.Lc; + var A10 = Gk().xc; + return null === v10 ? null === A10 : v10.h(A10); + }; + }(a10))), p10 = Xd(), l10 = l10.ia(m10, p10.u)) : (l10 = b10.Y().vb, m10 = mz(), m10 = Ua(m10), p10 = Id().u, l10 = Jd(l10, m10, p10)); + m10 = w6(/* @__PURE__ */ function() { + return function(v10) { + return new R6().M(v10.Lc, v10.r); + }; + }(a10)); + p10 = Xd(); + l10.ka(m10, p10.u).U(w6(/* @__PURE__ */ function(v10, A10, D10, C10, I10, L10, Y10) { + return function(ia) { + if (null !== ia) { + var pa = ia.ma(), La = ia.ya(); + if (null !== La && lb(La.r)) { + var ob = false; + ia = Vb(); + var zb = La.r, Zb = I10.Zj(L10.j); + zb = ia.Ia(zXa(v10, zb, A10, D10, C10, Zb, Y10)); + if (zb instanceof z7 && (ob = true, ia = zb.i, null !== ia)) { + ob = L10.Y(); + zb = La.x; + O7(); + La = new P6().a(); + Zb = zb.hf; + Ef(); + zb = Jf( + new Kf(), + new Lf().a() + ); + for (Zb = Zb.Dc; !Zb.b(); ) { + var Cc = Zb.ga(), vc = Cc; + false !== (vc instanceof be4 || vc instanceof c22 || vc instanceof Ds) && Of(zb, Cc); + Zb = Zb.ta(); + } + Ui(ob, pa, ia, La.IM(zb.eb)); + L10 instanceof rf && ia instanceof zi && (pa = ia.mn, pa.b() || (pa = pa.c(), L10.fh.Tm(pa))); + return; + } + if (ob) + return; + if (y7() === zb) + return it2(L10.Y(), pa); + throw new x7().d(zb); + } + } + if (null !== ia && (pa = ia.ma(), ia = ia.ya(), null !== ia && ia.r instanceof $r)) + return ob = ia.r.wb, La = w6(/* @__PURE__ */ function(id, yd, zd, rd, sd, le4, Vc) { + return function(Sc) { + if (lb(Sc)) { + var Qc = sd.Zj(le4.j); + Sc = zXa( + id, + Sc, + yd, + zd, + rd, + Qc, + Vc + ); + le4 instanceof rf && Sc instanceof zi && (Qc = Sc.mn, Qc.b() || (Qc = Qc.c(), le4.fh.Tm(Qc))); + } + return new z7().d(Sc); + }; + }(v10, A10, D10, C10, I10, L10, Y10)), zb = K7(), ob = ob.ka(La, zb.u).Cb(w6(/* @__PURE__ */ function() { + return function(id) { + return id.na(); + }; + }(v10))), La = w6(/* @__PURE__ */ function() { + return function(id) { + return id.i; + }; + }(v10)), zb = K7(), ob = ob.ka(La, zb.u), Ui(L10.Y(), pa, Zr(new $r(), ob, new P6().a()), ia.x); + }; + }(a10, c10, e10, f10, g10, b10, h10))); + return b10; + }; + function d22(a10, b10, c10, e10) { + b10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return Rk(l10) ? !!k10.P(l10) : false; + }; + }(a10, b10)); + c10 = Uc(/* @__PURE__ */ function(h10, k10) { + return function(l10, m10) { + return Rk(l10) ? k10.ug(l10, !!m10) : new z7().d(l10); + }; + }(a10, c10)); + e10 = Uc(/* @__PURE__ */ function(h10, k10) { + return function(l10, m10) { + return wXa(k10, l10, m10); + }; + }(a10, e10)); + var f10 = J5(DB(), H10()), g10 = vd(); + AXa(a10, a10, b10, c10, f10, g10, e10); + return a10; + } + function e22(a10) { + var b10 = Bq().tg; + eb(a10, b10, "2.0.0"); + b10 = Bq().De; + Bi(a10, b10, false); + a10.Io(y7()); + a10.jp(y7()); + } + function roa(a10, b10) { + return a10.Ve().Fb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return f10.j === e10; + }; + }(a10, b10))); + } + function VB(a10, b10, c10) { + return b10.Ama(c10.Jka(a10.Y())); + } + function dHa(a10, b10) { + var c10 = a10.Ve(), e10 = K7(); + b10 = c10.yg(b10, e10.u); + c10 = Gk().xc; + Bf(a10, c10, b10); + } + function cga(a10) { + if (ev(a10) && Vb().Ia(a10.qe()).na()) { + a10 = Ab(a10.qe().fa(), q5(rU)); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Se); + } + return Zc(a10) && (a10 = Ab(a10.fa(), q5(rU)), !a10.b()) ? (a10 = a10.c(), new z7().d(a10.Se)) : y7(); + } + function vu(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Wo); + } + function el() { + this.j = this.Ke = this.g = null; + this.xa = false; + } + el.prototype = new u7(); + el.prototype.constructor = el; + function BXa() { + } + BXa.prototype = el.prototype; + function lt2() { + return J5(K7(), H10()); + } + d7 = el.prototype; + d7.ub = function(a10) { + return f22(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.dd = function() { + var a10 = B6(this.Y(), dl().R).A; + a10 = a10.b() ? "data-node" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + function sO(a10) { + if (!a10.xa && !a10.xa) { + var b10 = new CXa(); + b10.Rh = a10; + a10.Ke = b10; + a10.xa = true; + } + return a10.Ke; + } + function f22(a10, b10) { + return Vb().Ia(a10.j).b() ? Ai(a10, b10) : a10; + } + d7.Ib = function() { + return yb(this); + }; + function $ga(a10, b10) { + var c10 = B6(a10.Y(), dl().R).A; + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new je4().e(c10), c10 = new z7().d(jj(c10.td))); + b10 = b10 + "/" + (c10.b() ? null : c10.c()); + c10 = Vb().Ia(a10.j); + c10 instanceof z7 && (c10 = c10.i, null !== c10 && Ed(ua(), c10, "/included") && (b10 += "/included")); + return Rd(a10, b10); + } + d7.dq = function() { + this.g = new S6().a(); + return this; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + function DXa() { + } + DXa.prototype = new u7(); + DXa.prototype.constructor = DXa; + d7 = DXa.prototype; + d7.a = function() { + return this; + }; + d7.Ar = function(a10, b10) { + throw mb(E6(), new nb().aH(b10.tt + " at: " + de4(ee4(), a10.rf, a10.If, a10.Yf, a10.bg), b10)); + }; + d7.yB = function(a10, b10) { + return YAa(this, a10, b10); + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + this.Gc(a10.j, b10, c10, e10, f10, Yb().dh, g10); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + throw mb(E6(), new nb().e(" Message: " + e10 + "\n Target: " + b10 + "\nProperty: " + (c10.b() ? "" : c10.c()) + "\n Position: " + f10 + "\n at location: " + h10)); + }; + d7.$classData = r8({ eBa: 0 }, false, "amf.core.parser.UnhandledErrorHandler$", { eBa: 1, f: 1, zq: 1, Zp: 1, Bp: 1 }); + var EXa = void 0; + function Vea() { + EXa || (EXa = new DXa().a()); + return EXa; + } + function Tq() { + CF.call(this); + } + Tq.prototype = new m_(); + Tq.prototype.constructor = Tq; + Tq.prototype.e = function(a10) { + CF.prototype.Ge.call(this, "Error resolving path: " + a10, null); + return this; + }; + Tq.prototype.$classData = r8({ SBa: 0 }, false, "amf.core.remote.PathResolutionError", { SBa: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function yu() { + CF.call(this); + } + yu.prototype = new m_(); + yu.prototype.constructor = yu; + yu.prototype.e = function(a10) { + CF.prototype.Ge.call(this, "Unsupported Url scheme: " + a10, null); + return this; + }; + yu.prototype.$classData = r8({ bCa: 0 }, false, "amf.core.remote.UnsupportedUrlScheme", { bCa: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function nja() { + this.uA = this.Am = this.Bf = this.EM = this.rQ = this.vb = null; + } + nja.prototype = new u7(); + nja.prototype.constructor = nja; + d7 = nja.prototype; + d7.a = function() { + yia(this); + bCa || (bCa = new cN().a()); + this.vb = bCa; + return this; + }; + d7.Vba = function() { + return "web"; + }; + d7.zia = function(a10) { + this.Am = a10; + }; + d7.qba = function() { + var a10 = K7(), b10 = [RWa(new g22().a())]; + return J5(a10, new Ib().ha(b10)); + }; + d7.Aia = function(a10) { + this.Bf = a10; + }; + d7.bda = function(a10) { + this.uA = a10; + }; + d7.Bia = function(a10) { + this.rQ = a10; + }; + d7.IP = function(a10) { + return a10; + }; + d7.Cia = function(a10) { + this.EM = a10; + }; + d7.$classData = r8({ fCa: 0 }, false, "amf.core.remote.browser.JsBrowserPlatform", { fCa: 1, f: 1, LBa: 1, UBa: 1, Oga: 1 }); + function oja() { + this.uA = this.Am = this.Bf = this.EM = this.rQ = this.vb = null; + } + oja.prototype = new u7(); + oja.prototype.constructor = oja; + d7 = oja.prototype; + d7.a = function() { + yia(this); + this.vb = QSa(); + return this; + }; + d7.Vba = function() { + var a10 = Caa.platform(); + return -1 !== (a10.indexOf("darwin") | 0) ? "mac" : -1 !== (a10.indexOf("win") | 0) ? "win" : "nux"; + }; + d7.zia = function(a10) { + this.Am = a10; + }; + d7.qba = function() { + var a10 = K7(), b10 = [RWa(new h22().a()), RWa(new i22().a())]; + return J5(a10, new Ib().ha(b10)); + }; + d7.Aia = function(a10) { + this.Bf = a10; + }; + d7.bda = function(a10) { + this.uA = a10; + }; + d7.Bia = function(a10) { + this.rQ = a10; + }; + d7.IP = function(a10) { + var b10 = Qp().qj(a10); + if (!b10.b() && (b10 = b10.c(), 47 === this.vb.W2())) + return "" + Qp().$I + Daa.normalize(b10); + b10 = Qp().qj(a10); + if (!b10.b()) { + b10 = b10.c(); + a10 = Qp().$I; + b10 = Daa.normalize(b10); + var c10 = this.vb.W2(); + c10 = ba.String.fromCharCode(c10); + return "" + a10 + b10.split(c10).join("/"); + } + c10 = Jha().qj(a10); + return c10.b() ? a10 : (a10 = c10.c().Uo, b10 = c10.c().Ag, c10 = c10.c().Ih, c10 = (0 <= (c10.length | 0) && "/" === c10.substring(0, 1) ? "" : "/") + c10, "" + a10 + b10 + Kq(c10)); + }; + d7.Cia = function(a10) { + this.EM = a10; + }; + d7.$classData = r8({ lCa: 0 }, false, "amf.core.remote.server.JsServerPlatform", { lCa: 1, f: 1, LBa: 1, UBa: 1, Oga: 1 }); + function FXa() { + this.ea = null; + } + FXa.prototype = new u7(); + FXa.prototype.constructor = FXa; + FXa.prototype.a = function() { + GXa = this; + this.ea = nv().ea; + return this; + }; + function fp() { + var a10 = HXa(); + return IXa(new j22(), a10.ea.qba(), y7()); + } + FXa.prototype.$classData = r8({ JDa: 0 }, false, "amf.internal.environment.Environment$", { JDa: 1, f: 1, ib: 1, q: 1, o: 1 }); + var GXa = void 0; + function HXa() { + GXa || (GXa = new FXa().a()); + return GXa; + } + function JXa() { + this.WB = 0; + this.To = this.Ig = null; + this.oo = false; + this.qi = null; + } + JXa.prototype = new RL(); + JXa.prototype.constructor = JXa; + d7 = JXa.prototype; + d7.a = function() { + rq.prototype.a.call(this); + KXa = this; + this.qi = nv().ea; + this.Ig = Du().$; + var a10 = K7(), b10 = [Du().$]; + this.To = J5(a10, new Ib().ha(b10)); + this.oo = true; + return this; + }; + d7.hI = function() { + throw new Hj().e("Unreachable"); + }; + function LXa(a10, b10) { + b10 = b10.FS; + if (b10 instanceof z7) + return b10.i; + if (y7() === b10) + return a10; + throw new x7().d(b10); + } + d7.NE = function() { + return WCa(); + }; + d7.FD = function() { + return true; + }; + d7.dy = function() { + var a10 = K7(), b10 = [dea(), Wi(), al(), os(), Ci()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.tA = function(a10, b10, c10) { + var e10 = false, f10 = null, g10 = a10.$g; + return g10 instanceof Dc && (e10 = true, f10 = g10, dka().OS(f10)) ? new z7().d(cka().PL(f10.Xd, LXa(a10.da, c10))) : e10 && Zja().OS(f10) ? new z7().d(Yja().PL(f10.Xd, LXa(a10.da, c10))) : g10 instanceof Mb ? new z7().d(rBa(wBa(b10), g10.xs, LXa(a10.da, c10))) : y7(); + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha(["application/ld+json", "application/json", "application/amf+json"])); + }; + d7.t0 = function(a10, b10, c10) { + return pga().jO(a10, b10, c10); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10) { + return new dN().Hb(b10).ye(a10); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + return J5(K7(), H10()); + }; + d7.nB = function(a10) { + a10 = a10.$g; + return a10 instanceof Dc ? dka().OS(a10) || Zja().OS(a10) : a10 instanceof Mb; + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return lq(); + }; + }(this)), ml()); + }; + d7.gB = function() { + return this.oo; + }; + d7.ry = function() { + return nu(); + }; + d7.$classData = r8({ QDa: 0 }, false, "amf.plugins.document.graph.AMFGraphPlugin$", { QDa: 1, bD: 1, f: 1, Zr: 1, ib: 1 }); + var KXa = void 0; + function lq() { + KXa || (KXa = new JXa().a()); + return KXa; + } + function MXa() { + } + MXa.prototype = new u7(); + MXa.prototype.constructor = MXa; + MXa.prototype.a = function() { + return this; + }; + function NXa(a10) { + var b10 = OXa(Ec(), a10); + if (b10.b()) + var c10 = false; + else + c10 = b10.c(), c10 = Ed(ua(), c10, ">") && -1 !== (c10.indexOf("|<") | 0); + if (c10) + return true; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = Mc(ua(), b10, "\\|"), b10 = new z7().d(zj(new Pc().fd(b10)))); + a: { + if (b10 instanceof z7 && (c10 = b10.i, zw().v5 === c10)) { + c10 = true; + break a; + } + if (b10 instanceof z7 && (c10 = b10.i, zw().u5 === c10)) { + c10 = true; + break a; + } + if (b10 instanceof z7 && (c10 = b10.i, zw().w5 === c10)) { + c10 = true; + break a; + } + if (b10 instanceof z7 && (c10 = b10.i, zw().u8 === c10)) { + c10 = true; + break a; + } + c10 = false; + } + return c10 ? true : b10 instanceof z7 ? (a10 = b10.i, Ec().kq.X.Ja(a10).na()) : oba(a10).na(); + } + MXa.prototype.$classData = r8({ AEa: 0 }, false, "amf.plugins.document.vocabularies.DialectHeader$", { AEa: 1, f: 1, LEa: 1, HEa: 1, JEa: 1 }); + var PXa = void 0; + function k22() { + } + k22.prototype = new u7(); + k22.prototype.constructor = k22; + k22.prototype.a = function() { + return this; + }; + k22.prototype.Ji = function(a10) { + var b10 = ED(); + return new z7().d(new l22().ue(FD(b10, a10, 10))); + }; + k22.prototype.$classData = r8({ OEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.AliasesLocation$", { OEa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var QXa = void 0; + function m22() { + } + m22.prototype = new u7(); + m22.prototype.constructor = m22; + m22.prototype.a = function() { + return this; + }; + m22.prototype.Ji = function() { + return new z7().d(new n22().a()); + }; + m22.prototype.$classData = r8({ QEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.CustomId$", { QEa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var RXa = void 0; + function o22() { + } + o22.prototype = new u7(); + o22.prototype.constructor = o22; + o22.prototype.a = function() { + return this; + }; + o22.prototype.Ji = function() { + return new z7().d(new p22().a()); + }; + o22.prototype.$classData = r8({ SEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.JsonPointerRef$", { SEa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var SXa = void 0; + function q22() { + } + q22.prototype = new u7(); + q22.prototype.constructor = q22; + q22.prototype.a = function() { + return this; + }; + q22.prototype.Ji = function() { + return new z7().d(new r22().a()); + }; + q22.prototype.$classData = r8({ UEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.RefInclude$", { UEa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var TXa = void 0; + function UXa() { + this.qa = this.vh = this.ba = this.g = null; + } + UXa.prototype = new u7(); + UXa.prototype.constructor = UXa; + d7 = UXa.prototype; + d7.a = function() { + VXa = this; + Cr(this); + NN(this); + var a10 = this.vh, b10 = H10(); + this.g = ji(a10, b10); + this.ba = H10(); + return this; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.Kb = function() { + return this.ba; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.$classData = r8({ oGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.ExternalContextModelFields$", { oGa: 1, f: 1, KF: 1, hc: 1, Rb: 1 }); + var VXa = void 0; + function Bd() { + VXa || (VXa = new UXa().a()); + return VXa; + } + function SV() { + this.j = this.Ke = null; + this.xa = false; + } + SV.prototype = new u7(); + SV.prototype.constructor = SV; + function WXa() { + } + WXa.prototype = SV.prototype; + function XXa(a10, b10) { + var c10 = eO().eB, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ih(new jh(), g10, new P6().a()); + }; + }(a10)), f10 = K7(); + b10 = Zr(new $r(), b10.ka(e10, f10.u), new P6().a()); + Vd(a10, c10, b10); + } + d7 = SV.prototype; + d7.ub = function(a10) { + Vb().Ia(this.j).b() && Ai(this, a10); + return this; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.dd = function() { + return ""; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + function s22() { + hO.call(this); + this.ku = this.iu = this.cO = null; + } + s22.prototype = new yDa(); + s22.prototype.constructor = s22; + s22.prototype.G$ = function(a10) { + return YXa(this, a10); + }; + function YXa(a10, b10) { + var c10 = a10.xi.Ja(b10); + if (c10 instanceof z7 && (c10 = c10.i, c10 instanceof s22)) + return c10; + c10 = a10.iu; + var e10 = new Mq().a(), f10 = Rb(Gb().ab, H10()); + c10 = new s22().FU(f10, c10, e10); + a10.xi = a10.xi.cc(new R6().M(b10, c10)); + return c10; + } + s22.prototype.et = function() { + var a10 = new Fc().Vd(this.cO), b10 = qe2(); + b10 = re4(b10); + a10 = qt(a10, b10); + return kz(a10); + }; + function ZXa(a10, b10, c10) { + a10.cO = a10.cO.cc(new R6().M(b10, c10)); + c10.Ie || Eb(a10.ku, b10, c10); + } + function $Xa(a10, b10, c10) { + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cO; + }; + }(a10)), c10); + b10 = new aYa(); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + s22.prototype.FU = function(a10, b10, c10) { + this.cO = a10; + this.iu = b10; + this.ku = c10; + hO.prototype.v1.call(this, Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), Rb(Gb().ab, H10()), b10, c10); + return this; + }; + function bYa(a10, b10, c10, e10) { + c10 = Rba(a10, c10); + a10 = a10.dp(b10, w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.cO; + }; + }(a10)), e10); + b10 = cYa(c10); + if (a10.b()) + return y7(); + b10 = $s(b10); + a10 = a10.c(); + return b10.Ia(a10); + } + s22.prototype.$classData = r8({ NHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceDeclarations", { NHa: 1, f7: 1, hN: 1, f: 1, $Ha: 1 }); + function t22() { + this.WB = 0; + this.Ig = this.To = null; + this.oo = false; + this.qi = null; + } + t22.prototype = new RL(); + t22.prototype.constructor = t22; + function dYa() { + } + d7 = dYa.prototype = t22.prototype; + d7.a = function() { + rq.prototype.a.call(this); + this.qi = nv().ea; + var a10 = K7(), b10 = [Wba().$]; + this.To = J5(a10, new Ib().ha(b10)); + this.Ig = "JSON Schema"; + this.oo = true; + return this; + }; + function eYa(a10, b10, c10, e10) { + var f10 = fYa(b10, e10); + a10 = gYa(a10, b10, c10, f10); + b10 = a10.$g; + if (b10 instanceof Dc) { + c10 = -1 !== (a10.da.indexOf("#") | 0) ? a10.da : a10.da + "#/"; + f10 = a10.da; + var g10 = Mc(ua(), f10, "#"); + f10 = zj(new Pc().fd(g10)); + if (0 === g10.n.length) { + if (0 === g10.n.length) + throw new Lu().e("empty.tail"); + var h10 = g10.n.length; + h10 = 0 < h10 ? h10 : 0; + var k10 = g10.n.length; + h10 = -1 + (h10 < k10 ? h10 : k10) | 0; + h10 = 0 < h10 ? h10 : 0; + k10 = Mu(Nu(), Ou(la(g10)), h10); + 0 < h10 && Pu(Gd(), g10, 1, k10, 0, h10); + g10 = k10; + } else + h10 = g10.n.length, h10 = 0 < h10 ? h10 : 0, k10 = g10.n.length, h10 = -1 + (h10 < k10 ? h10 : k10) | 0, h10 = 0 < h10 ? h10 : 0, k10 = Mu(Nu(), Ou(la(g10)), h10), 0 < h10 && Pu(Gd(), g10, 1, k10, 0, h10), g10 = k10; + g10 = Wt(new Pc().fd(g10)); + g10.b() ? g10 = y7() : (g10 = g10.c(), 0 <= (g10.length | 0) && "/" === g10.substring(0, 1) && (g10 = new qg().e(g10), g10 = Wp(g10, "/")), g10 = new z7().d(g10)); + e10 = hYa(a10, e10, f10); + e10 = iYa(a10, b10, c10, g10, f10, e10); + return new z7().d(e10); + } + return y7(); + } + d7.hI = function(a10, b10, c10) { + if (Zc(a10) && (b10 = a10.tk().Fb(w6(/* @__PURE__ */ function() { + return function(f10) { + return wh(f10.fa(), q5(jYa)) && f10 instanceof vh; + }; + }(this))), b10 instanceof z7 && (b10 = b10.i, b10 instanceof vh))) { + a10 = a10.tk(); + var e10 = tD(); + return new z7().d(kYa(b10, a10, e10, c10).sB()); + } + return y7(); + }; + function fYa(a10, b10) { + if (a10 instanceof Mk) { + var c10 = ar(a10.g, Jk().nb).$g; + return c10.b() ? (TG(), c10 = B6(ar(a10.g, Jk().nb).g, Ok().Rd).A, c10 = c10.b() ? null : c10.c(), a10 = Lc(a10), b10 = QG(0, c10, a10.b() ? "" : a10.c(), vF().dl, b10), Cj(b10).Fd) : c10.c(); + } + if (a10 instanceof u22 && a10.xe.na()) + return TG(), c10 = a10.xe.c(), a10 = Lc(a10), b10 = QG(0, c10, a10.b() ? "" : a10.c(), vF().dl, b10), Cj(b10).Fd; + c10 = sg().vN; + var e10 = y7(), f10 = a10.j, g10 = Ab(a10.fa(), q5(jd)); + a10 = Lc(a10); + b10.Gc(c10.j, f10, e10, "Cannot parse JSON Schema from unit with missing syntax information", g10, Yb().qb, a10); + T6(); + b10 = tr(ur(), J5(ue4().bga, H10()), ""); + return mr(T6(), b10, Q5().sa); + } + function gYa(a10, b10, c10, e10) { + $fa(); + e10 = $q(new Dc(), Wta(Dj(), e10), y7()); + var f10 = Lc(b10); + f10 = f10.b() ? b10.j : f10.c(); + c10 = c10.na() ? "#" + c10.c() : ""; + var g10 = ar(b10.Y(), Gk().xc); + a10 = w6(/* @__PURE__ */ function() { + return function(k10) { + var l10 = Lc(k10); + return Hq(new Iq(), k10, new v22().vi(l10.b() ? "" : l10.c(), H10()), y7()); + }; + }(a10)); + var h10 = K7(); + a10 = g10.ka(a10, h10.u); + g10 = hBa(); + b10 = b10.xe; + return Zfa(0, e10, f10 + c10, "application/json", a10, g10, b10.b() ? "" : b10.c()); + } + d7.FD = function(a10) { + Zc(a10) ? (a10 = a10.tk(), a10 = Jc(a10, new lYa())) : a10 = y7(); + return a10.na(); + }; + d7.NE = function() { + return nBa(); + }; + d7.tA = function(a10, b10) { + var c10 = a10.$g; + if (c10 instanceof Dc) { + var e10 = -1 !== (a10.da.indexOf("#") | 0) ? a10.da : a10.da + "#/", f10 = a10.da, g10 = Mc(ua(), f10, "#"); + f10 = zj(new Pc().fd(g10)); + if (0 === g10.n.length) { + if (0 === g10.n.length) + throw new Lu().e("empty.tail"); + var h10 = g10.n.length; + h10 = 0 < h10 ? h10 : 0; + var k10 = g10.n.length; + h10 = -1 + (h10 < k10 ? h10 : k10) | 0; + h10 = 0 < h10 ? h10 : 0; + k10 = Mu(Nu(), Ou(la(g10)), h10); + 0 < h10 && Pu(Gd(), g10, 1, k10, 0, h10); + g10 = k10; + } else + h10 = g10.n.length, h10 = 0 < h10 ? h10 : 0, k10 = g10.n.length, h10 = -1 + (h10 < k10 ? h10 : k10) | 0, h10 = 0 < h10 ? h10 : 0, k10 = Mu(Nu(), Ou(la(g10)), h10), 0 < h10 && Pu(Gd(), g10, 1, k10, 0, h10), g10 = k10; + g10 = Wt(new Pc().fd(g10)); + g10.b() ? g10 = y7() : (g10 = g10.c(), 0 <= (g10.length | 0) && "/definitions" === g10.substring(0, 12) && (g10 = new qg().e(g10), g10 = Wp(g10, "/")), g10 = new z7().d(g10)); + b10 = hYa(a10, b10, f10); + c10 = iYa(a10, c10, e10, g10, f10, b10); + f10 = nX(pX(), pG(wD(), (T6(), mh(T6(), "schema")), c10), w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + Rd(p10, m10); + }; + }(this, e10)), mYa(b10, c10), b10).Cc(); + if (f10 instanceof z7) + e10 = f10.i; + else { + if (y7() !== f10) + throw new x7().d(f10); + f10 = sg().vN; + g10 = "Cannot parse JSON Schema at " + a10.da; + h10 = y7(); + ec(b10, f10, e10, h10, g10, c10.da); + O7(); + c10 = new P6().a(); + c10 = new Gh().K(new S6().a(), c10); + e10 = Rd(c10, e10); + c10 = pn().Nd; + e10 = eb(e10, c10, "application/json"); + c10 = a10.xe; + f10 = pn().Rd; + e10 = eb(e10, f10, c10); + } + b10.mH = y7(); + O7(); + c10 = new P6().a(); + c10 = new ql().K(new S6().a(), c10); + c10 = Rd(c10, a10.da); + b10 = a10.da; + f10 = Bq().uc; + c10 = eb(c10, f10, b10); + b10 = Jk().nb; + e10 = Vd(c10, b10, e10); + Kfa(e10, a10.xe); + return new z7().d(e10); + } + return y7(); + }; + d7.dy = function() { + return H10(); + }; + function nYa(a10, b10, c10, e10) { + var f10 = fYa(b10, e10); + b10 = gYa(a10, b10, c10, f10); + a10 = a10.tA(b10, e10, new kp().a()); + if (a10.b()) + return y7(); + a10 = a10.c(); + return ev(a10) && a10.qe() instanceof vh ? new z7().d(a10.qe()) : y7(); + } + d7.Qz = function() { + return J5(K7(), new Ib().ha(["application/schema+json", "application/payload+json"])); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10) { + return new IQ().Hb(b10).ye(a10); + }; + function iYa(a10, b10, c10, e10, f10, g10) { + b10 = b10.Xd.Fd; + e10.na() ? (oYa(g10, b10), e10 = pYa(g10, e10.c()), g10.mH = y7(), e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.ya()))) : e10 = new z7().d(b10); + e10.b() ? (e10 = sg().vN, a10 = "Cannot find fragment " + f10 + " in JSON schema " + a10.da, f10 = y7(), ec(g10, e10, c10, f10, a10, b10.da), c10 = b10) : c10 = e10.c(); + oYa(g10, b10); + return c10; + } + d7.gi = function() { + return this.Ig; + }; + function hYa(a10, b10, c10) { + var e10 = new Aq().zo(c10, a10.Q, new Mq().a(), b10.lj, y7()); + e10.Ip = b10.Ip; + e10.Fu = b10.Fu; + b10 = b10 instanceof uB ? new z7().d(b10.Dl()) : y7(); + a10 = a10.Q; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(zna(uz(), b10))); + return new jA().Wx(c10, a10, e10, b10, y7(), y7()); + } + d7.wr = function() { + return H10(); + }; + d7.nB = function() { + return false; + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return nu(); + }; + d7.gB = function() { + return this.oo; + }; + function w22() { + } + w22.prototype = new u7(); + w22.prototype.constructor = w22; + w22.prototype.a = function() { + return this; + }; + w22.prototype.Ji = function(a10) { + var b10 = Mc(ua(), a10, ","); + a10 = Fd(Gd(), b10); + if (!a10.b() && null !== a10.c() && 0 === a10.c().Oe(2)) { + b10 = a10.c().lb(0); + a10 = a10.c().lb(1); + b10 = Mc(ua(), b10, "->"); + b10 = Oc(new Pc().fd(b10)); + var c10 = Vb(); + a10 = Mc(ua(), a10, "->"); + return new z7().d(new rB().Uq(b10, c10.Ia(Oc(new Pc().fd(a10))))); + } + a10 = Fd(Gd(), b10); + return a10.b() || null === a10.c() || 0 !== a10.c().Oe(1) ? y7() : (a10 = a10.c().lb(0), a10 = Mc(ua(), a10, "->"), new z7().d(new rB().Uq(Oc(new Pc().fd(a10)), y7()))); + }; + w22.prototype.$classData = r8({ UIa: 0 }, false, "amf.plugins.document.webapi.annotations.ExtensionProvenance$", { UIa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var qYa = void 0; + function x22() { + } + x22.prototype = new u7(); + x22.prototype.constructor = x22; + x22.prototype.a = function() { + return this; + }; + x22.prototype.Ji = function() { + return new z7().d(new y22().a()); + }; + x22.prototype.$classData = r8({ WIa: 0 }, false, "amf.plugins.document.webapi.annotations.FormBodyParameter$", { WIa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var rYa = void 0; + function z22() { + } + z22.prototype = new u7(); + z22.prototype.constructor = z22; + z22.prototype.a = function() { + return this; + }; + z22.prototype.Ji = function(a10) { + return new z7().d(new Ty().e(a10)); + }; + z22.prototype.$classData = r8({ bJa: 0 }, false, "amf.plugins.document.webapi.annotations.JSONSchemaId$", { bJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var sYa = void 0; + function A22() { + } + A22.prototype = new u7(); + A22.prototype.constructor = A22; + A22.prototype.a = function() { + return this; + }; + A22.prototype.Ji = function(a10) { + return new z7().d(new tYa().e(a10)); + }; + A22.prototype.$classData = r8({ eJa: 0 }, false, "amf.plugins.document.webapi.annotations.LocalLinkPath$", { eJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var uYa = void 0; + function B22() { + } + B22.prototype = new u7(); + B22.prototype.constructor = B22; + B22.prototype.a = function() { + return this; + }; + B22.prototype.Ji = function(a10) { + a10 = Mc(ua(), a10, "->"); + var b10 = Fd(Gd(), a10); + return b10.b() || null === b10.c() || 0 !== b10.c().Oe(2) ? y7() : (a10 = b10.c().lb(0), b10 = b10.c().lb(1), new z7().d(new C22().xU(a10, AU(ae4(), b10)))); + }; + B22.prototype.$classData = r8({ gJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParameterNameForPayload$", { gJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var vYa = void 0; + function D22() { + } + D22.prototype = new u7(); + D22.prototype.constructor = D22; + D22.prototype.a = function() { + return this; + }; + D22.prototype.Ji = function(a10) { + return new z7().d(new Mf().e(a10)); + }; + D22.prototype.$classData = r8({ jJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParsedJSONSchema$", { jJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var wYa = void 0; + function E22() { + } + E22.prototype = new u7(); + E22.prototype.constructor = E22; + E22.prototype.a = function() { + return this; + }; + E22.prototype.Ji = function(a10) { + return new z7().d(new jg().e(a10)); + }; + E22.prototype.$classData = r8({ lJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParsedRamlDatatype$", { lJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var xYa = void 0; + function F22() { + } + F22.prototype = new u7(); + F22.prototype.constructor = F22; + F22.prototype.a = function() { + return this; + }; + F22.prototype.Ji = function(a10) { + a10 = Mc(ua(), a10, "->"); + var b10 = Fd(Gd(), a10); + return b10.b() || null === b10.c() || 0 !== b10.c().Oe(2) ? y7() : (a10 = b10.c().lb(0), b10 = b10.c().lb(1), new z7().d(yYa(new G22(), "true" === a10, AU(ae4(), b10)))); + }; + F22.prototype.$classData = r8({ nJa: 0 }, false, "amf.plugins.document.webapi.annotations.RequiredParamPayload$", { nJa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var zYa = void 0; + function nW() { + oW.call(this); + this.q$ = this.Fa = this.Aa = null; + } + nW.prototype = new QOa(); + nW.prototype.constructor = nW; + nW.prototype.Qa = function() { + var a10 = this.Fa.N.Bc, b10 = Lo().Ix, c10 = y7(), e10 = "Custom facets not supported for vendor " + this.Fa.N.Gg(), f10 = Ab(this.q$.r.r.fa(), q5(jd)), g10 = this.q$.r.r.Ib(); + a10.Gc(b10.j, "", c10, e10, f10, Yb().qb, g10); + }; + nW.prototype.bea = function() { + Gb(); + throw new AYa().a(); + }; + nW.prototype.kL = function() { + return this.Aa; + }; + nW.prototype.$classData = r8({ FJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory$$anon$1", { FJa: 1, mha: 1, f: 1, db: 1, Ma: 1 }); + function hW() { + iW.call(this); + this.Z2 = this.Fa = this.de = null; + } + hW.prototype = new WOa(); + hW.prototype.constructor = hW; + hW.prototype.ve = function() { + return this.de; + }; + hW.prototype.Qa = function() { + var a10 = this.Fa.N.Bc, b10 = Lo().Ix, c10 = this.Z2.j, e10 = y7(), f10 = "Custom facets not supported for vendor " + this.Fa.N.Gg(), g10 = Ab(this.Z2.x, q5(jd)), h10 = yb(this.Z2); + a10.Gc(b10.j, c10, e10, f10, g10, Yb().qb, h10); + }; + hW.prototype.$classData = r8({ GJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory$$anon$2", { GJa: 1, nha: 1, f: 1, db: 1, Ma: 1 }); + function kW() { + lW.call(this); + this.o0 = this.Fa = this.de = null; + } + kW.prototype = new POa(); + kW.prototype.constructor = kW; + kW.prototype.ve = function() { + return this.de; + }; + kW.prototype.Qa = function() { + var a10 = this.Fa.N.Bc, b10 = Lo().Ix, c10 = this.o0.j, e10 = y7(), f10 = "Custom facets not supported for vendor " + this.Fa.N.Gg(), g10 = Ab(this.o0.x, q5(jd)), h10 = yb(this.o0); + a10.Gc(b10.j, c10, e10, f10, g10, Yb().qb, h10); + }; + kW.prototype.$classData = r8({ HJa: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08EmitterVersionFactory$$anon$3", { HJa: 1, kha: 1, f: 1, db: 1, Ma: 1 }); + function BYa() { + q_.call(this); + this.N7 = this.D5 = this.f8 = this.W7 = this.ho = null; + } + BYa.prototype = new AVa(); + BYa.prototype.constructor = BYa; + BYa.prototype.a = function() { + q_.prototype.ue.call(this, 0); + CYa = this; + var a10 = null !== this.xu && this.xu.Ya() ? this.xu.$a() : "DEFAULT"; + this.ho = DYa(this, this.DE, a10); + a10 = null !== this.xu && this.xu.Ya() ? this.xu.$a() : "RESOURCE_TYPE"; + this.W7 = DYa(this, this.DE, a10); + a10 = null !== this.xu && this.xu.Ya() ? this.xu.$a() : "TRAIT"; + this.f8 = DYa(this, this.DE, a10); + a10 = null !== this.xu && this.xu.Ya() ? this.xu.$a() : "EXTENSION"; + this.D5 = DYa(this, this.DE, a10); + a10 = null !== this.xu && this.xu.Ya() ? this.xu.$a() : "OVERLAY"; + this.N7 = DYa(this, this.DE, a10); + return this; + }; + BYa.prototype.$classData = r8({ VJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlWebApiContextType$", { VJa: 1, Fhb: 1, f: 1, q: 1, o: 1 }); + var CYa = void 0; + function iA() { + CYa || (CYa = new BYa().a()); + return CYa; + } + function H22() { + JW.call(this); + this.Ana = null; + } + H22.prototype = new zOa(); + H22.prototype.constructor = H22; + H22.prototype.rL = function(a10) { + return oy(this.Ana.eF(), a10, B6(a10.Y(), db().ed).A, H10()); + }; + H22.prototype.Ti = function(a10, b10, c10) { + JW.prototype.Ti.call(this, a10, b10, c10); + this.Ana = new ZV().aA(new YV().Ti(a10, b10, this.wc)); + return this; + }; + H22.prototype.$classData = r8({ $Ja: 0 }, false, "amf.plugins.document.webapi.contexts.XRaml10SpecEmitterContext", { $Ja: 1, gha: 1, hha: 1, TR: 1, f: 1 }); + function EYa() { + Jx.call(this); + this.Wna = null; + } + EYa.prototype = new DOa(); + EYa.prototype.constructor = EYa; + d7 = EYa.prototype; + d7.xB = function() { + return this.ku; + }; + d7.dp = function(a10, b10, c10) { + var e10 = Ws.prototype.dp.call(this, a10, b10, c10); + if (e10 instanceof z7) + return new z7().d(e10.i); + if (y7() === e10) + return this.Wna.dp(a10, b10, c10); + throw new x7().d(e10); + }; + function FYa(a10, b10, c10, e10, f10, g10) { + var h10 = new EYa(); + h10.Wna = c10; + Jx.prototype.GU.call(h10, a10, b10, e10, f10, g10); + return h10; + } + d7.wG = function() { + return this.iu; + }; + d7.bG = function() { + return this.AN; + }; + d7.$classData = r8({ eLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.ExtensionWebApiDeclarations", { eLa: 1, iha: 1, QY: 1, hN: 1, f: 1 }); + function I22() { + IP.call(this); + this.wV = null; + } + I22.prototype = new WFa(); + I22.prototype.constructor = I22; + function J22() { + } + J22.prototype = I22.prototype; + I22.prototype.Xi = function() { + IP.prototype.IV.call(this); + dca(this, this.wa, this.Za, this.zV(), this.l.Nb()); + return this.wa; + }; + I22.prototype.zV = function() { + return this.wV; + }; + I22.prototype.EB = function(a10) { + IP.prototype.EB.call(this, a10); + this.wV = GYa(); + }; + function K22() { + this.UX = this.Xd = this.N = null; + } + K22.prototype = new QGa(); + K22.prototype.constructor = K22; + function HYa() { + } + HYa.prototype = K22.prototype; + K22.prototype.FK = function(a10, b10) { + this.Xd = a10; + tQ.prototype.aA.call(this, b10); + return this; + }; + K22.prototype.sB = function() { + var a10 = this.Xd, b10 = tA(uA(), Au(), a10.qe().fa()), c10 = IYa(this, this.Xd, b10), e10 = this.Xqa(new L22().Jw(ar(a10.Y(), Gk().Ic), b10, this.Xd.Ve(), this.Lj()).Qc, b10); + var f10 = this.Xd.Ve(); + var g10 = this.Xd; + if (g10 instanceof mf) + g10 = g10.qe(); + else { + g10 = this.Lj().hj(); + var h10 = dc().Fh, k10 = this.Xd.j, l10 = y7(), m10 = Ab(this.Xd.fa(), q5(jd)), p10 = Lc(this.Xd); + g10.Gc(h10.j, k10, l10, "BaseUnit doesn't encode a WebApi.", m10, Yb().qb, p10); + O7(); + g10 = new P6().a(); + g10 = new Rm().K(new S6().a(), g10); + } + h10 = Ab(g10.x, q5(rU)); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(h10.Se)); + f10 = JYa(this, g10, b10, h10, f10).Qc; + g10 = hd(this.Xd.Y(), wB().mc); + g10.b() ? g10 = y7() : (g10 = g10.c(), h10 = jx(new je4().e("extends")), k10 = g10.r.r.t(), wr(), g10 = new z7().d(KYa(new LYa(), h10, k10, kr(0, g10.r.x, q5(jd)), this.Lj()))); + g10 = g10.ua(); + h10 = this.Xd; + if (h10 instanceof Fl) + h10 = Kka(), h10 = new z7().d(cx(new dx(), h10.la, h10.r, Q5().Na, ld())); + else if (h10 instanceof Hl) + h10 = Lka(), h10 = new z7().d(cx(new dx(), h10.la, h10.r, Q5().Na, ld())); + else if (h10 instanceof mf) + h10 = y7(); + else + throw mb(E6(), new nb().e("Document has no header.")); + h10 = h10.ua(); + k10 = ii(); + p10 = g10.ia(h10, k10.u); + a10 = hd(a10.Y(), Bq().ae); + if (a10.b()) + var t10 = y7(); + else + a10 = a10.c(), t10 = new z7().d($g( + new ah(), + jx(new je4().e("usage")), + a10, + y7() + )); + a10 = OA(); + g10 = new PA().e(a10.pi); + h10 = new qg().e(a10.mi); + tc(h10) && QA(g10, a10.mi); + h10 = g10.s; + k10 = g10.ca; + l10 = new rr().e(k10); + this.Rea(l10); + m10 = wr(); + var v10 = K7(); + f10 = f10.ia(p10, v10.u); + p10 = t10.ua(); + t10 = K7(); + f10 = f10.ia(p10, t10.u); + p10 = K7(); + e10 = f10.ia(e10, p10.u); + f10 = K7(); + jr(m10, b10.zb(e10.yg(c10, f10.u)), l10); + pr(h10, mr(T6(), tr(ur(), l10.s, k10), Q5().sa)); + return new RA().Ac(SA(zs(), a10.pi), g10.s); + }; + K22.prototype.Xqa = function(a10) { + return a10; + }; + function M22() { + this.kd = this.Sn = this.NC = null; + } + M22.prototype = new u7(); + M22.prototype.constructor = M22; + function MYa() { + } + MYa.prototype = M22.prototype; + M22.prototype.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function NYa(a10) { + null === a10.NC && a10.k5(); + return a10.NC; + } + M22.prototype.fE = function(a10) { + this.Sn = a10; + return this; + }; + M22.prototype.k5 = function() { + if (null === this.NC) { + var a10 = new iY(); + if (null === this) + throw mb(E6(), null); + a10.l = this; + this.NC = a10; + } + }; + function GP() { + this.kd = this.po = this.NC = null; + } + GP.prototype = new u7(); + GP.prototype.constructor = GP; + function N22() { + } + N22.prototype = GP.prototype; + function OYa(a10) { + null === a10.NC && a10.k5(); + return a10.NC; + } + d7 = GP.prototype; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.ss = function(a10) { + this.po = a10; + return this; + }; + d7.k5 = function() { + if (null === this.NC) { + var a10 = new PYa(); + if (null === this) + throw mb(E6(), null); + a10.l = this; + this.NC = a10; + } + }; + d7.Eba = function(a10) { + var b10 = ac(new M6().W(a10), "type"); + a10 = b10.b() ? ac(new M6().W(a10), "schema") : b10; + if (a10 instanceof z7) { + b10 = a10.i; + var c10 = b10.i.hb().gb, e10 = Q5().sa; + if (c10 === e10) + return a10 = b10.i, b10 = qc(), this.Eba(N6(a10, b10, this.po)); + } + return a10; + }; + d7.uM = function(a10) { + var b10 = ac(new M6().W(a10), "type"); + return b10.b() ? ac(new M6().W(a10), "schema") : b10; + }; + function PYa() { + this.l = null; + } + PYa.prototype = new u7(); + PYa.prototype.constructor = PYa; + PYa.prototype.h9 = function(a10, b10) { + var c10 = a10.i.hb().gb; + if (Q5().sa === c10) { + c10 = this.l; + var e10 = a10.Aa, f10 = bc(); + e10 = N6(e10, f10, this.l.po).va; + f10 = a10.i; + var g10 = qc(); + return QYa(new O22(), c10, a10, e10, N6(f10, g10, this.l.po), b10).AH(); + } + if (Q5().cd === c10) + return c10 = PLa(RLa(), a10), b10.P(c10), b10 = this.l.po, e10 = sg().aN, f10 = c10.j, a10 = a10.i, g10 = y7(), ec(b10, e10, f10, g10, "Invalid value type for annotation types parser, expected map or scalar reference", a10.da), c10; + c10 = a10.Aa; + e10 = bc(); + c10 = N6(c10, e10, this.l.po).va; + e10 = a10.i; + f10 = bc(); + f10 = N6(e10, f10, this.l.po); + e10 = PLa(RLa(), a10); + b10.P(e10); + g10 = sha(this.l.po.pe(), f10.va); + if (g10 instanceof z7) + return e10 = g10.i, f10 = f10.va, a10 = Od(O7(), a10), a10 = kM(e10, f10, a10), a10.j = null, O7(), e10 = new P6().a(), b10.P(Sd(a10, c10, e10)), a10; + a10 = PW(QW(), a10, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.ub(k10.j, lt2()); + }; + }(this, e10)), RW(true, false), QP(), this.l.po).Cc(); + if (a10 instanceof z7) + return a10 = a10.i, HC(EC(), a10, e10.j, y7()), b10 = Sk().Jc, Vd(e10, b10, a10); + a10 = this.l.po; + b10 = dc().UC; + c10 = e10.j; + g10 = y7(); + ec(a10, b10, c10, g10, "Could not find declared annotation link in references", f10.da); + return e10; + }; + PYa.prototype.$classData = r8({ dWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlSpecParser$AnnotationTypesParser$", { dWa: 1, f: 1, lr: 1, q: 1, o: 1 }); + function sY() { + EB.call(this); + this.iu = null; + } + sY.prototype = new kMa(); + sY.prototype.constructor = sY; + sY.prototype.mt = function(a10, b10) { + this.iu = b10; + EB.prototype.mt.call(this, a10, b10); + return this; + }; + sY.prototype.Aw = function() { + return this.iu; + }; + sY.prototype.Ija = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + if (b10 instanceof Em && B6(b10.g, Dm().In).A.na() && a10 instanceof Em) { + a10 = Qca(a10).pc(b10.j); + b10 = B6(b10.g, Dm().In).A; + b10 = b10.b() ? null : b10.c(); + var c10 = Dm().In; + return eb(a10, c10, b10); + } + return a10; + }; + }(this)); + }; + sY.prototype.$classData = r8({ zWa: 0 }, false, "amf.plugins.document.webapi.resolution.pipelines.WebApiReferenceResolutionStage", { zWa: 1, Pga: 1, ii: 1, f: 1, Qga: 1 }); + function RYa() { + this.CP = this.FF = null; + } + RYa.prototype = new u7(); + RYa.prototype.constructor = RYa; + d7 = RYa.prototype; + d7.a = function() { + SYa = this; + this.FF = "AMF Payload Validation"; + this.CP = J5(K7(), new Ib().ha(["application/json", "application/yaml", "text/vnd.yaml"])); + var a10 = H10(); + K7(); + pj(); + var b10 = new Lf().a(); + new oR().il("", a10, new Aq().zo("", b10.ua(), new Mq().a(), Nq(), y7()), y7(), y7(), y7(), iA().ho); + return this; + }; + d7.XW = function(a10, b10) { + var c10 = new lRa(); + c10.gg = a10; + c10.Lea = b10; + mR.prototype.Y6a.call(c10, a10); + return c10; + }; + d7.rja = function(a10) { + return !(a10 instanceof Gh) && a10 instanceof vh; + }; + d7.gi = function() { + return this.FF; + }; + d7.wr = function() { + return H10(); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.$classData = r8({ LXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadValidatorPlugin$", { LXa: 1, f: 1, Sga: 1, Zr: 1, Zy: 1 }); + var SYa = void 0; + function Iva() { + SYa || (SYa = new RYa().a()); + return SYa; + } + function GY() { + } + GY.prototype = new u7(); + GY.prototype.constructor = GY; + GY.prototype.a = function() { + return this; + }; + GY.prototype.Ji = function(a10) { + return new z7().d(new eB().e(a10)); + }; + GY.prototype.$classData = r8({ kYa: 0 }, false, "amf.plugins.domain.shapes.annotations.ParsedFromTypeExpression$", { kYa: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var oRa = void 0; + function xQ() { + this.ob = null; + this.Sk = false; + this.YN = null; + } + xQ.prototype = new gv(); + xQ.prototype.constructor = xQ; + xQ.prototype.rs = function(a10, b10, c10) { + this.Sk = b10; + fv.prototype.Hb.call(this, c10); + y7(); + this.YN = Qpa(c10, b10, a10, new TYa().a()); + return this; + }; + xQ.prototype.u3 = function(a10) { + return a10 instanceof rf ? $Ha(new ER().nU(this.YN), a10) : new z7().d(a10); + }; + xQ.prototype.ye = function(a10) { + new z7().d(a10); + return a10.Qm(UYa(), Uc(/* @__PURE__ */ function(b10) { + return function(c10, e10) { + return b10.u3(c10, !!e10); + }; + }(this)), this.ob); + }; + xQ.prototype.$classData = r8({ JZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.ShapeNormalizationStage", { JZa: 1, ii: 1, f: 1, lm: 1, Qga: 1 }); + function Hi() { + CF.call(this); + this.l2 = this.L1 = this.p2 = null; + this.yma = false; + } + Hi.prototype = new m_(); + Hi.prototype.constructor = Hi; + function Gi(a10, b10, c10, e10, f10, g10) { + a10.p2 = c10; + a10.L1 = e10; + a10.l2 = f10; + a10.yma = g10; + CF.prototype.Ge.call(a10, b10, null); + return a10; + } + Hi.prototype.$classData = r8({ OZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.InheritanceIncompatibleShapeError", { OZa: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function CZ() { + } + CZ.prototype = new u7(); + CZ.prototype.constructor = CZ; + CZ.prototype.a = function() { + return this; + }; + CZ.prototype.Ji = function(a10) { + return new z7().d(new P22().e(a10)); + }; + CZ.prototype.$classData = r8({ i_a: 0 }, false, "amf.plugins.domain.webapi.annotations.InvalidBinding$", { i_a: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var mSa = void 0; + function zZ() { + } + zZ.prototype = new u7(); + zZ.prototype.constructor = zZ; + zZ.prototype.a = function() { + return this; + }; + zZ.prototype.Ji = function(a10) { + return new z7().d(new Q22().e(a10)); + }; + zZ.prototype.$classData = r8({ k_a: 0 }, false, "amf.plugins.domain.webapi.annotations.OrphanOasExtension$", { k_a: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var jSa = void 0; + function BZ() { + } + BZ.prototype = new u7(); + BZ.prototype.constructor = BZ; + BZ.prototype.a = function() { + return this; + }; + BZ.prototype.Ji = function(a10) { + return new z7().d(new R22().jj(AU(ae4(), a10))); + }; + BZ.prototype.$classData = r8({ m_a: 0 }, false, "amf.plugins.domain.webapi.annotations.ParameterBindingInBodyLexicalInfo$", { m_a: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var lSa = void 0; + function S22() { + } + S22.prototype = new u7(); + S22.prototype.constructor = S22; + S22.prototype.a = function() { + return this; + }; + S22.prototype.Ji = function(a10, b10) { + a10 = new gQ().e(a10); + uBa(a10, b10); + return new z7().d(a10); + }; + S22.prototype.$classData = r8({ o_a: 0 }, false, "amf.plugins.domain.webapi.annotations.ParentEndPoint$", { o_a: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var VYa = void 0; + function EGa() { + VYa || (VYa = new S22().a()); + return VYa; + } + function AZ() { + } + AZ.prototype = new u7(); + AZ.prototype.constructor = AZ; + AZ.prototype.a = function() { + return this; + }; + AZ.prototype.Ji = function(a10) { + return new z7().d(new Jy().jj(AU(ae4(), a10))); + }; + AZ.prototype.$classData = r8({ q_a: 0 }, false, "amf.plugins.domain.webapi.annotations.TypePropertyLexicalInfo$", { q_a: 1, f: 1, Pi: 1, q: 1, o: 1 }); + var kSa = void 0; + function yo() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + yo.prototype = new u7(); + yo.prototype.constructor = yo; + d7 = yo.prototype; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return xo(); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/mqtt-last-will"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ b1a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.mqtt.MqttServerLastWill", { b1a: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function Om() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Om.prototype = new u7(); + Om.prototype.constructor = Om; + function WYa() { + } + d7 = WYa.prototype = Om.prototype; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Nm(); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/default"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ mN: 0 }, false, "amf.plugins.domain.webapi.models.security.Settings", { mN: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function XYa() { + this.qi = this.Ig = null; + } + XYa.prototype = new tAa(); + XYa.prototype.constructor = XYa; + d7 = XYa.prototype; + d7.a = function() { + YYa = this; + this.qi = nv().ea; + this.Ig = "Rdf"; + return this; + }; + d7.JV = function(a10, b10, c10, e10) { + return this.qi.uA instanceof z7 && !e10.Kx ? Oaa(a10, b10) : y7(); + }; + d7.gqa = function() { + K7(); + pj(); + return new Lf().a().ua(); + }; + d7.x3 = function(a10, b10) { + a10 = this.qi.uA; + return b10 instanceof Mb && a10 instanceof z7 ? (a10.i, bJa()) : y7(); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + return H10(); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return qga(); + }; + }(this)), ml()); + }; + d7.$classData = r8({ n2a: 0 }, false, "amf.plugins.syntax.RdfSyntaxPlugin$", { n2a: 1, Zva: 1, f: 1, Zr: 1, ib: 1 }); + var YYa = void 0; + function qga() { + YYa || (YYa = new XYa().a()); + return YYa; + } + function ZYa() { + this.qi = this.Ig = null; + } + ZYa.prototype = new tAa(); + ZYa.prototype.constructor = ZYa; + d7 = ZYa.prototype; + d7.a = function() { + $Ya = this; + this.qi = nv().ea; + this.Ig = "SYaml"; + return this; + }; + d7.JV = function(a10, b10, c10, e10) { + if (0 === wa(b10)) + return y7(); + if ("application/ld+json" !== a10 && "application/json" !== a10 || e10.Kx || !this.qi.uA.na()) { + b10 = ("json" === (-1 !== (a10.indexOf("json") | 0) ? "json" : "yaml") ? QG(TG(), b10, c10.qh, vF().dl, c10) : fHa(Oua(Rua(), b10, c10.qh, c10))).Gca(false); + a10 = new aZa().a(); + a10 = Jc(b10, a10); + e10 = new bZa().a(); + b10 = Jc(b10, e10); + if (b10 instanceof z7) + c10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + Dj(); + Gb(); + T6(); + b10 = ur().ce; + b10 = mD(0, ha(Ja(aua), [mr(T6(), b10, Q5().sa)])); + c10 = c10.qh; + c10 = new RA().Ac(SA(zs(), c10), b10); + } + return new z7().d($q(new Dc(), c10, a10)); + } + this.qi.uA.c(); + return Oaa( + a10, + b10 + ); + }; + d7.gqa = function() { + return J5(K7(), new Ib().ha("application/yaml application/x-yaml text/yaml text/x-yaml application/json text/json application/raml text/vnd.yaml".split(" "))); + }; + d7.x3 = function(a10, b10, c10, e10) { + if (b10 instanceof Dc) { + b10 = b10.Xd; + if ("yaml" === (-1 !== (a10.indexOf("json") | 0) ? "json" : "yaml")) + Oca(), a10 = K7(), zva(c10, J5(a10, new Ib().ha([b10])), e10); + else { + Vua || (Vua = new BH().a()); + try { + zH(Uua(Sua(c10, e10), b10.Fd), "\n"); + } finally { + new Aj().d(c10); + } + } + return new z7().d(c10); + } + return b10 instanceof Mb && this.qi.uA.na() ? (this.qi.uA.c(), bJa()) : y7(); + }; + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + return H10(); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return kq(); + }; + }(this)), ml()); + }; + d7.$classData = r8({ o2a: 0 }, false, "amf.plugins.syntax.SYamlSyntaxPlugin$", { o2a: 1, Zva: 1, f: 1, Zr: 1, ib: 1 }); + var $Ya = void 0; + function kq() { + $Ya || ($Ya = new ZYa().a()); + return $Ya; + } + function T22() { + CF.call(this); + } + T22.prototype = new m_(); + T22.prototype.constructor = T22; + function cZa() { + } + cZa.prototype = T22.prototype; + T22.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + T22.prototype.$classData = r8({ x7: 0 }, false, "java.io.IOException", { x7: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function dZa() { + } + dZa.prototype = new u7(); + dZa.prototype.constructor = dZa; + function eZa() { + } + eZa.prototype = dZa.prototype; + dZa.prototype.US = function() { + }; + function FE() { + this.cg = null; + this.HI = this.E1 = this.ri = this.ci = 0; + } + FE.prototype = new LKa(); + FE.prototype.constructor = FE; + d7 = FE.prototype; + d7.rba = function() { + if (1 < this.ci) + var a10 = this.cg.n[0], b10 = this.cg.n[1]; + else + a10 = this.cg.n[0], b10 = 0; + var c10 = this.ri, e10 = c10 >> 31, f10 = 65535 & c10, g10 = c10 >>> 16 | 0, h10 = 65535 & a10, k10 = a10 >>> 16 | 0, l10 = ca(f10, h10); + h10 = ca(g10, h10); + var m10 = ca(f10, k10); + f10 = l10 + ((h10 + m10 | 0) << 16) | 0; + l10 = (l10 >>> 16 | 0) + m10 | 0; + b10 = (((ca(c10, b10) + ca(e10, a10) | 0) + ca(g10, k10) | 0) + (l10 >>> 16 | 0) | 0) + (((65535 & l10) + h10 | 0) >>> 16 | 0) | 0; + return new qa().Sc(f10, b10); + }; + d7.a = function() { + this.E1 = -2; + this.HI = 0; + return this; + }; + d7.h = function(a10) { + if (a10 instanceof FE) { + var b10; + if (b10 = this.ri === a10.ri && this.ci === a10.ci) + a: { + for (b10 = 0; b10 !== this.ci; ) { + if (this.cg.n[b10] !== a10.cg.n[b10]) { + b10 = false; + break a; + } + b10 = 1 + b10 | 0; + } + b10 = true; + } + a10 = b10; + } else + a10 = false; + return a10; + }; + d7.t = function() { + return Mj(Nj(), this); + }; + d7.Sc = function(a10, b10) { + FE.prototype.a.call(this); + this.ri = a10; + this.ci = 1; + this.cg = ha(Ja(Qa), [b10]); + return this; + }; + d7.tr = function(a10) { + return fZa(this, a10); + }; + function Zra(a10) { + if (-2 === a10.E1) { + if (0 === a10.ri) + var b10 = -1; + else + for (b10 = 0; 0 === a10.cg.n[b10]; ) + b10 = 1 + b10 | 0; + a10.E1 = b10; + } + return a10.E1; + } + function AE(a10) { + a: + for (; ; ) { + if (0 < a10.ci && (a10.ci = -1 + a10.ci | 0, 0 === a10.cg.n[a10.ci])) + continue a; + break; + } + 0 === a10.cg.n[a10.ci] && (a10.ri = 0); + a10.ci = 1 + a10.ci | 0; + } + function gZa(a10) { + if (0 === a10.ri) + return -1; + var b10 = Zra(a10); + a10 = a10.cg.n[b10]; + return (b10 << 5) + (0 === a10 ? 32 : 31 - ea(a10 & (-a10 | 0)) | 0) | 0; + } + function zE(a10, b10, c10) { + var e10 = new FE(); + FE.prototype.a.call(e10); + e10.ri = a10; + e10.ci = b10; + e10.cg = c10; + return e10; + } + d7.r1 = function(a10, b10) { + FE.prototype.a.call(this); + BE(); + if (null === a10) + throw new sf().a(); + if (2 > b10 || 36 < b10) + throw new dH().e("Radix out of range"); + if (null === a10) + throw new sf().a(); + if ("" === a10) + throw new dH().e("Zero length BigInteger"); + if ("" === a10 || "+" === a10 || "-" === a10) + throw new dH().e("Zero length BigInteger"); + var c10 = a10.length | 0; + if (45 === (65535 & (a10.charCodeAt(0) | 0))) + var e10 = -1, f10 = 1, g10 = -1 + c10 | 0; + else + 43 === (65535 & (a10.charCodeAt(0) | 0)) ? (f10 = e10 = 1, g10 = -1 + c10 | 0) : (e10 = 1, f10 = 0, g10 = c10); + e10 |= 0; + var h10 = f10 | 0; + f10 = g10 | 0; + for (g10 = h10; g10 < c10; ) { + var k10 = 65535 & (a10.charCodeAt(g10) | 0); + if (43 === k10 || 45 === k10) + throw new dH().e("Illegal embedded sign character"); + g10 = 1 + g10 | 0; + } + g10 = Nj().Sfa.n[b10]; + k10 = f10 / g10 | 0; + var l10 = f10 % g10 | 0; + 0 !== l10 && (k10 = 1 + k10 | 0); + f10 = ja(Ja(Qa), [k10]); + k10 = Nj().Mfa.n[-2 + b10 | 0]; + var m10 = 0; + for (l10 = h10 + (0 === l10 ? g10 : l10) | 0; h10 < c10; ) { + var p10 = FD(ED(), a10.substring(h10, l10), b10); + h10 = nsa(JE(), f10, f10, m10, k10); + HE(); + var t10 = f10, v10 = m10, A10 = p10; + for (p10 = 0; 0 !== A10 && p10 < v10; ) { + var D10 = A10; + A10 = D10 + t10.n[p10] | 0; + D10 = (-2147483648 ^ A10) < (-2147483648 ^ D10) ? 1 : 0; + t10.n[p10] = A10; + A10 = D10; + p10 = 1 + p10 | 0; + } + h10 = h10 + A10 | 0; + f10.n[m10] = h10; + m10 = 1 + m10 | 0; + h10 = l10; + l10 = h10 + g10 | 0; + } + this.ri = e10; + this.ci = m10; + this.cg = f10; + AE(this); + return this; + }; + d7.z = function() { + if (0 === this.HI) { + for (var a10 = this.ci, b10 = 0; b10 < a10; ) { + var c10 = b10; + this.HI = ca(33, this.HI) + this.cg.n[c10] | 0; + b10 = 1 + b10 | 0; + } + this.HI = ca(this.HI, this.ri); + } + return this.HI; + }; + d7.e = function(a10) { + FE.prototype.r1.call(this, a10, 10); + return this; + }; + function psa(a10, b10) { + return 0 === b10 || 0 === a10.ri ? a10 : 0 < b10 ? Wra(CE(), a10, b10) : Xra(CE(), a10, -b10 | 0); + } + d7.gH = function() { + return ca(this.ri, this.cg.n[0]); + }; + function lsa(a10, b10) { + return 0 === b10.ri || 0 === a10.ri ? BE().zN : msa(JE(), a10, b10); + } + function ISa(a10, b10, c10) { + FE.prototype.a.call(a10); + a10.ri = b10; + b10 = c10.Ud; + 0 === b10 ? (a10.ci = 1, a10.cg = ha(Ja(Qa), [c10.od])) : (a10.ci = 2, a10.cg = ha(Ja(Qa), [c10.od, b10])); + return a10; + } + function osa(a10, b10) { + return 0 === b10 || 0 === a10.ri ? a10 : 0 < b10 ? Xra(CE(), a10, b10) : Wra(CE(), a10, -b10 | 0); + } + function fZa(a10, b10) { + return a10.ri > b10.ri ? 1 : a10.ri < b10.ri ? -1 : a10.ci > b10.ci ? a10.ri : a10.ci < b10.ci ? -b10.ri | 0 : ca(a10.ri, dsa(HE(), a10.cg, b10.cg, a10.ci)); + } + var ksa = r8({ z2a: 0 }, false, "java.math.BigInteger", { z2a: 1, iH: 1, f: 1, o: 1, ym: 1 }); + FE.prototype.$classData = ksa; + function ZM() { + this.xm = this.Y1 = null; + this.LA = this.JB = false; + this.It = this.Jt = this.Rs = this.bP = this.fA = this.dP = this.eL = this.cP = this.fL = null; + } + ZM.prototype = new u7(); + ZM.prototype.constructor = ZM; + d7 = ZM.prototype; + d7.h = function(a10) { + if (a10 instanceof ZM) { + var b10 = /* @__PURE__ */ function() { + return function(f10, g10) { + a: { + $M(); + var h10 = 0; + for (; ; ) { + if (h10 >= (f10.length | 0) || h10 >= (g10.length | 0)) { + f10 = (f10.length | 0) - (g10.length | 0) | 0; + break a; + } + var k10 = (65535 & (f10.charCodeAt(h10) | 0)) - (65535 & (g10.charCodeAt(h10) | 0)) | 0; + if (0 !== k10) { + f10 = k10; + break a; + } + if (37 === (65535 & (f10.charCodeAt(h10) | 0))) { + if ((2 + h10 | 0) >= (f10.length | 0) || (2 + h10 | 0) >= (g10.length | 0)) + throw new uK().d("Invalid escape in URI"); + ua(); + k10 = f10.substring(1 + h10 | 0, 3 + h10 | 0); + k10 = OK2(0, k10, g10.substring(1 + h10 | 0, 3 + h10 | 0)); + if (0 !== k10) { + f10 = k10; + break a; + } + h10 = 3 + h10 | 0; + } else + h10 = 1 + h10 | 0; + } + } + return f10; + }; + }(this), c10 = this.fL, e10 = a10.fL; + c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : OK2(ua(), c10, e10); + 0 !== c10 ? b10 = c10 : (c10 = this.LA, c10 = c10 === a10.LA ? 0 : c10 ? 1 : -1, 0 !== c10 ? b10 = c10 : this.LA ? (c10 = b10(this.cP, a10.cP) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Rs, e10 = a10.Rs, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Jt, e10 = a10.Jt, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.It, a10 = a10.It, b10 = Va(Wa(), c10, a10) ? 0 : void 0 === c10 ? -1 : void 0 === a10 ? 1 : b10(c10, a10) | 0)))) : void 0 !== this.fA && void 0 !== a10.fA ? (c10 = this.dP, e10 = a10.dP, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.fA, e10 = a10.fA, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : OK2(ua(), c10, e10), 0 !== c10 ? b10 = c10 : (c10 = this.bP, e10 = a10.bP, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : (c10 | 0) - (e10 | 0) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Rs, e10 = a10.Rs, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Jt, e10 = a10.Jt, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.It, a10 = a10.It, b10 = Va(Wa(), c10, a10) ? 0 : void 0 === c10 ? -1 : void 0 === a10 ? 1 : b10(c10, a10) | 0)))))) : (c10 = this.eL, e10 = a10.eL, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Rs, e10 = a10.Rs, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.Jt, e10 = a10.Jt, c10 = Va(Wa(), c10, e10) ? 0 : void 0 === c10 ? -1 : void 0 === e10 ? 1 : b10(c10, e10) | 0, 0 !== c10 ? b10 = c10 : (c10 = this.It, a10 = a10.It, b10 = Va(Wa(), c10, a10) ? 0 : void 0 === c10 ? -1 : void 0 === a10 ? 1 : b10(c10, a10) | 0))))); + return 0 === b10; + } + return false; + }; + d7.t = function() { + return this.Y1; + }; + d7.tr = function(a10) { + return hZa(this, a10); + }; + function hZa(a10, b10) { + var c10 = /* @__PURE__ */ function() { + return function(g10, h10) { + return g10 === h10 ? 0 : g10 < h10 ? -1 : 1; + }; + }(a10), e10 = a10.fL, f10 = b10.fL; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : OK2(ua(), e10, f10); + if (0 !== e10) + return e10; + e10 = a10.LA; + e10 = e10 === b10.LA ? 0 : e10 ? 1 : -1; + if (0 !== e10) + return e10; + if (a10.LA) { + e10 = c10(a10.cP, b10.cP) | 0; + if (0 !== e10) + return e10; + e10 = a10.Rs; + f10 = b10.Rs; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + e10 = a10.Jt; + f10 = b10.Jt; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + a10 = a10.It; + b10 = b10.It; + return Va(Wa(), a10, b10) ? 0 : void 0 === a10 ? -1 : void 0 === b10 ? 1 : c10(a10, b10) | 0; + } + if (void 0 !== a10.fA && void 0 !== b10.fA) { + e10 = a10.dP; + f10 = b10.dP; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + e10 = a10.fA; + f10 = b10.fA; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : OK2(ua(), e10, f10); + if (0 !== e10) + return e10; + e10 = a10.bP; + f10 = b10.bP; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : (e10 | 0) - (f10 | 0) | 0; + if (0 !== e10) + return e10; + e10 = a10.Rs; + f10 = b10.Rs; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + e10 = a10.Jt; + f10 = b10.Jt; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + a10 = a10.It; + b10 = b10.It; + return Va(Wa(), a10, b10) ? 0 : void 0 === a10 ? -1 : void 0 === b10 ? 1 : c10(a10, b10) | 0; + } + e10 = a10.eL; + f10 = b10.eL; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + e10 = a10.Rs; + f10 = b10.Rs; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + e10 = a10.Jt; + f10 = b10.Jt; + e10 = Va(Wa(), e10, f10) ? 0 : void 0 === e10 ? -1 : void 0 === f10 ? 1 : c10(e10, f10) | 0; + if (0 !== e10) + return e10; + a10 = a10.It; + b10 = b10.It; + return Va(Wa(), a10, b10) ? 0 : void 0 === a10 ? -1 : void 0 === b10 ? 1 : c10(a10, b10) | 0; + } + d7.z = function() { + var a10 = 53722356, b10 = MJ(); + OJ(); + var c10 = this.fL; + c10 = void 0 === c10 ? void 0 : c10.toLowerCase(); + a10 = b10.Ga(a10, NJ(0, c10)); + this.LA ? (b10 = MJ(), OJ(), $M(), a10 = b10.Ga(a10, NJ(0, MZ(0, this.cP)))) : void 0 !== this.fA ? (a10 = MJ().Ga(a10, NJ(OJ(), MZ($M(), this.dP))), b10 = MJ(), OJ(), c10 = this.fA, c10 = void 0 === c10 ? void 0 : c10.toLowerCase(), a10 = b10.Ga(a10, NJ(0, c10)), a10 = MJ().Ga(a10, NJ(OJ(), this.bP))) : a10 = MJ().Ga(a10, NJ(OJ(), MZ($M(), this.eL))); + a10 = MJ().Ga(a10, NJ(OJ(), MZ($M(), this.Rs))); + a10 = MJ().Ga(a10, NJ(OJ(), MZ($M(), this.Jt))); + a10 = MJ().mP(a10, NJ(OJ(), MZ($M(), this.It))); + return MJ().fe( + a10, + 3 + ); + }; + d7.e = function(a10) { + this.Y1 = a10; + a10 = Vb().Ia($M().Cma.exec(a10)); + if (a10.b()) + throw new Lq().Hc(this.Y1, "Malformed URI"); + this.xm = a10 = a10.c(); + this.JB = void 0 !== this.xm[1]; + this.LA = void 0 !== this.xm[10]; + this.fL = this.xm[1]; + a10 = this.JB ? this.LA ? this.xm[10] : this.xm[2] : this.xm[11]; + if (void 0 === a10) + throw new iL().e("undefined.get"); + this.cP = a10; + a10 = this.JB ? this.xm[3] : this.xm[12]; + this.eL = void 0 === a10 || "" !== a10 ? a10 : void 0; + this.dP = this.JB ? this.xm[4] : this.xm[13]; + this.fA = this.JB ? this.xm[5] : this.xm[14]; + a10 = this.JB ? this.xm[6] : this.xm[15]; + this.bP = void 0 === a10 ? void 0 : FD(ED(), a10, 10); + void 0 !== (this.JB ? this.xm[3] : this.xm[12]) ? (a10 = this.JB ? this.xm[7] : this.xm[16], a10 = void 0 === a10 ? "" : a10) : this.JB ? a10 = this.xm[8] : (a10 = this.xm[17], a10 = void 0 === a10 ? this.xm[18] : a10); + this.Rs = a10; + this.Jt = this.JB ? this.xm[9] : this.xm[19]; + this.It = this.xm[20]; + this.xm = null; + return this; + }; + d7.$classData = r8({ F2a: 0 }, false, "java.net.URI", { F2a: 1, f: 1, q: 1, o: 1, ym: 1 }); + function Lq() { + CF.call(this); + this.Dw = 0; + } + Lq.prototype = new m_(); + Lq.prototype.constructor = Lq; + Lq.prototype.Hc = function(a10, b10) { + Lq.prototype.s7a.call(this, a10, b10); + return this; + }; + Lq.prototype.s7a = function(a10, b10) { + this.Dw = -1; + CF.prototype.Ge.call(this, b10 + " in " + a10 + " at -1", null); + }; + Lq.prototype.$classData = r8({ H2a: 0 }, false, "java.net.URISyntaxException", { H2a: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function usa() { + NE.call(this); + this.Ss = false; + } + usa.prototype = new LSa(); + usa.prototype.constructor = usa; + function xJa(a10) { + var b10 = a10.ud; + if (b10 === a10.Ze) + throw new Lv().a(); + a10.ud = 1 + b10 | 0; + return a10.bj.n[a10.Mk + b10 | 0] | 0; + } + function cS(a10, b10) { + if (a10.Ss) + throw new VE().a(); + var c10 = a10.ud; + if (c10 === a10.Ze) + throw new RE().a(); + a10.ud = 1 + c10 | 0; + a10.bj.n[a10.Mk + c10 | 0] = b10 | 0; + } + usa.prototype.$classData = r8({ N2a: 0 }, false, "java.nio.HeapByteBuffer", { N2a: 1, mhb: 1, Rha: 1, f: 1, ym: 1 }); + function iZa() { + CF.call(this); + } + iZa.prototype = new kVa(); + iZa.prototype.constructor = iZa; + function Dsa(a10) { + var b10 = new iZa(); + iJ.prototype.kn.call(b10, a10); + return b10; + } + iZa.prototype.$classData = r8({ U2a: 0 }, false, "java.nio.charset.CoderMalfunctionError", { U2a: 1, Ima: 1, bf: 1, f: 1, o: 1 }); + function kG() { + KS.call(this); + this.xE = null; + } + kG.prototype = new ZUa(); + kG.prototype.constructor = kG; + d7 = kG.prototype; + d7.h = function(a10) { + return a10 instanceof kG ? this.xE === a10.xE : false; + }; + d7.t = function() { + return this.xE; + }; + d7.TO = function(a10, b10, c10) { + this.xE = a10; + KS.prototype.Ac.call(this, b10, c10); + return this; + }; + d7.z = function() { + var a10 = this.xE; + return ta(ua(), a10); + }; + d7.$classData = r8({ W4a: 0 }, false, "org.yaml.model.YComment", { W4a: 1, j5a: 1, z7: 1, $s: 1, f: 1 }); + function RA() { + EG.call(this); + this.aQ = this.Fd = null; + } + RA.prototype = new FG(); + RA.prototype.constructor = RA; + d7 = RA.prototype; + d7.Ac = function(a10, b10) { + EG.prototype.Ac.call(this, a10, b10); + a10 = Jc(this.Xf, new jZa()); + this.Fd = a10.b() ? T6().nd : a10.c(); + this.aQ = this.Fd.hb().gb; + a10 = this.Xf.xl(w6(/* @__PURE__ */ function() { + return function(e10) { + return !(e10 instanceof Cs); + }; + }(this))); + b10 = new kZa(); + var c10 = rw(); + a10.ec(b10, c10.sc).Kg("\n"); + return this; + }; + d7.h = function(a10) { + return a10 instanceof RA ? a10.Fd.h(this.Fd) : false; + }; + d7.t = function() { + return "Document: " + this.Fd.t(); + }; + d7.Qp = function(a10) { + return kx(this).Qp(a10); + }; + function kx(a10) { + var b10 = a10.Fd, c10 = T6().nd; + Bj(b10, c10) ? (XUa || (XUa = new VUa().a()), a10 = WUa(a10, oq(/* @__PURE__ */ function() { + return function() { + return "Empty Document"; + }; + }(a10)))) : a10 = new rM().wU(a10.Fd); + return a10; + } + d7.cQ = function() { + return this.Fd; + }; + var DKa = r8({ Y4a: 0 }, false, "org.yaml.model.YDocument", { Y4a: 1, $s: 1, f: 1, oJ: 1, $A: 1 }); + RA.prototype.$classData = DKa; + function vw() { + EG.call(this); + this.Za = this.sb = null; + } + vw.prototype = new $Ua(); + vw.prototype.constructor = vw; + d7 = vw.prototype; + d7.Ac = function(a10, b10) { + k_.prototype.Ac.call(this, a10, b10); + Gb(); + a10 = this.Xf; + b10 = new lZa().W(this); + var c10 = rw(); + this.sb = mD(0, a10.ec(b10, c10.sc).Ol(new eT().$K(q5(hKa)))); + a10 = UA(new VA(), nu()); + this.sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.jd(new R6().M(g10.Aa, g10.i)); + }; + }(this, a10))); + this.Za = a10.eb; + return this; + }; + d7.h = function(a10) { + if (a10 instanceof vw) { + var b10 = this.Za; + a10 = a10.Za; + return null === b10 ? null === a10 : U22(b10, a10); + } + return lua(a10) && (a10 = a10.Qp(qc()), a10 instanceof ye4) ? (b10 = this.Za, a10 = a10.i.Za, null === b10 ? null === a10 : U22(b10, a10)) : false; + }; + d7.t = function() { + return this.sb.Zn("{", ", ", "}"); + }; + d7.z = function() { + var a10 = this.Za, b10 = MJ(); + return aya(b10, a10, b10.sba); + }; + d7.$classData = r8({ k5a: 0 }, false, "org.yaml.model.YMap", { k5a: 1, bZ: 1, $s: 1, f: 1, $A: 1 }); + function Cs() { + EG.call(this); + } + Cs.prototype = new FG(); + Cs.prototype.constructor = Cs; + function mZa() { + } + d7 = mZa.prototype = Cs.prototype; + d7.Ac = function(a10, b10) { + EG.prototype.Ac.call(this, a10, b10); + return this; + }; + d7.h = function(a10) { + if (a10 instanceof sM) + return false; + if (a10 instanceof Cs) { + var b10 = this.hb().gb, c10 = a10.hb().gb; + if (b10 === c10) + return b10 = this.re(), a10 = a10.re(), Bj(b10, a10); + } else if (lua(a10)) + return a10 = a10.cQ(), Bj(this, a10); + return false; + }; + d7.t = function() { + return this.re().t(); + }; + d7.Qp = function(a10) { + return Iw(this, a10); + }; + function Kc(a10) { + a10 = a10.re(); + return a10 instanceof xt ? new z7().d(a10) : y7(); + } + d7.z = function() { + var a10 = this.hb().gb; + return ca(31, qaa(a10)) + this.re().z() | 0; + }; + function JHa(a10) { + var b10 = a10.hb().gb, c10 = Q5().nd; + return b10 === c10 ? true : Kc(a10).Ha(null); + } + d7.cQ = function() { + return this; + }; + var aua = r8({ aZ: 0 }, false, "org.yaml.model.YNode", { aZ: 1, $s: 1, f: 1, oJ: 1, $A: 1 }); + Cs.prototype.$classData = aua; + function aH() { + KS.call(this); + } + aH.prototype = new ZUa(); + aH.prototype.constructor = aH; + aH.prototype.Ac = function(a10, b10) { + KS.prototype.Ac.call(this, a10, b10); + return this; + }; + aH.prototype.t = function() { + return this.eI.Kg(", "); + }; + aH.prototype.$classData = r8({ w5a: 0 }, false, "org.yaml.model.YNonContent", { w5a: 1, j5a: 1, z7: 1, $s: 1, f: 1 }); + function nZa() { + } + nZa.prototype = new u7(); + nZa.prototype.constructor = nZa; + function oZa() { + } + oZa.prototype = nZa.prototype; + nZa.prototype.Qp = function(a10) { + return Iw(this, a10); + }; + function xt() { + EG.call(this); + this.oH = this.va = this.oq = null; + } + xt.prototype = new $Ua(); + xt.prototype.constructor = xt; + xt.prototype.h = function(a10) { + return a10 instanceof xt ? Va(Wa(), a10.oq, this.oq) : lua(a10) && (a10 = a10.Qp(IO()), a10 instanceof ye4) ? (a10 = a10.i.oq, Va(Wa(), this.oq, a10)) : false; + }; + xt.prototype.t = function() { + return this.oH.pH(this.va); + }; + xt.prototype.z = function() { + var a10 = this.oq; + return null === a10 ? 0 : sa(a10); + }; + function rG(a10, b10, c10, e10, f10) { + var g10 = new xt(); + g10.oq = a10; + g10.va = b10; + g10.oH = c10; + k_.prototype.Ac.call(g10, e10, f10); + return g10; + } + xt.prototype.$classData = r8({ A5a: 0 }, false, "org.yaml.model.YScalar", { A5a: 1, bZ: 1, $s: 1, f: 1, $A: 1 }); + function Sx() { + EG.call(this); + this.Cm = null; + } + Sx.prototype = new $Ua(); + Sx.prototype.constructor = Sx; + d7 = Sx.prototype; + d7.Ac = function(a10, b10) { + k_.prototype.Ac.call(this, a10, b10); + Gb(); + a10 = this.Xf; + b10 = new pZa(); + var c10 = rw(); + this.Cm = mD(0, a10.ec(b10, c10.sc).Ol(new eT().$K(q5(aua)))); + return this; + }; + d7.h = function(a10) { + if (a10 instanceof Sx) + return this.Cm.h(a10.Cm); + if (lua(a10)) { + var b10 = a10.Qp(tw()); + if (b10 instanceof ye4) + return a10 = this.Cm, b10 = b10.i.Cm, null === a10 ? null === b10 : a10.h(b10); + } + return false; + }; + d7.t = function() { + return this.Cm.Zn("[", ", ", "]"); + }; + d7.z = function() { + return this.Cm.z(); + }; + d7.$classData = r8({ C5a: 0 }, false, "org.yaml.model.YSequence", { C5a: 1, bZ: 1, $s: 1, f: 1, $A: 1 }); + function V22(a10, b10) { + var c10 = Rb(Ut(), H10()); + c10 = new qd().d(c10); + var e10 = eU(a10, "http://a.ml/vocabularies/shapes#Shape"), f10 = PH(), g10 = PH().jr(); + uk(tk(f10, e10, g10)).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = XKa(); + try { + if (l10 instanceof Hh) + var p10 = new nn().taa(l10); + else if (l10 instanceof Vh) + p10 = new yn().xaa(l10); + else if (l10 instanceof th) + p10 = new Zm().WG(l10); + else if (l10 instanceof Th) + p10 = new Ym().saa(l10); + else if (l10 instanceof Wh) + p10 = new mn().raa(l10); + else if (l10 instanceof Mh) + p10 = new on4().uaa(l10); + else if (l10 instanceof Gh) + p10 = new qn().vaa(l10); + else { + if (!(l10 instanceof vh)) + throw XKa().M2; + p10 = new Xm().Gw(l10); + } + if (Ya(p10)) + A10 = false; + else + var t10 = k10.oa, v10 = qZa(p10).Li, A10 = !t10.Ha(v10.b() ? null : v10.c()); + if (A10) { + var D10 = k10.oa, C10 = qZa(p10).Li, I10 = C10.b() ? null : C10.c(); + D10.Xh(new R6().M(I10, p10)); + } + } catch (L10) { + if (L10 instanceof HJ) { + if (l10 = L10, l10 !== m10.M2) + throw l10; + } else + throw L10; + } + }; + }(a10, c10))); + a10 = c10.oa.Ja(b10); + if (a10 instanceof z7) + return a10.i; + if (y7() === a10) + throw mb(E6(), new nb().e("Declaration with name '" + b10 + "' not found")); + throw new x7().d(a10); + } + function W22() { + } + W22.prototype = new u7(); + W22.prototype.constructor = W22; + W22.prototype.a = function() { + return this; + }; + W22.prototype.Kc = function(a10) { + return a10; + }; + W22.prototype.zc = function(a10) { + return a10; + }; + W22.prototype.$classData = r8({ A6a: 0 }, false, "webapi.WebApiClientConverters$WebApiBaseUnitMatcher$", { A6a: 1, f: 1, md: 1, Pc: 1, Fc: 1 }); + var rZa = void 0; + function sp(a10) { + return "string" === typeof a10; + } + var ma = r8({ P6a: 0 }, false, "java.lang.String", { P6a: 1, f: 1, o: 1, eP: 1, ym: 1 }, void 0, void 0, sp); + function uK() { + CF.call(this); + } + uK.prototype = new kVa(); + uK.prototype.constructor = uK; + uK.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + uK.prototype.d = function(a10) { + CF.prototype.Ge.call(this, "" + a10, a10 instanceof CF ? a10 : null); + return this; + }; + uK.prototype.$classData = r8({ B7a: 0 }, false, "java.lang.AssertionError", { B7a: 1, Ima: 1, bf: 1, f: 1, o: 1 }); + var gaa = r8({ D7a: 0 }, false, "java.lang.Byte", { D7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return faa(a10); + }); + var laa = r8({ H7a: 0 }, false, "java.lang.Double", { H7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return "number" === typeof a10; + }); + var kaa = r8({ J7a: 0 }, false, "java.lang.Float", { J7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return na(a10); + }); + var jaa = r8({ K7a: 0 }, false, "java.lang.Integer", { K7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return Ca(a10); + }); + var naa = r8( + { O7a: 0 }, + false, + "java.lang.Long", + { O7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, + void 0, + void 0, + function(a10) { + return a10 instanceof qa; + } + ); + function kf() { + CF.call(this); + } + kf.prototype = new m_(); + kf.prototype.constructor = kf; + function X22() { + } + X22.prototype = kf.prototype; + kf.prototype.kn = function(a10) { + var b10 = null === a10 ? null : a10.t(); + CF.prototype.Ge.call(this, b10, a10); + return this; + }; + kf.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + kf.prototype.aH = function(a10, b10) { + CF.prototype.Ge.call(this, a10, b10); + return this; + }; + kf.prototype.$classData = r8({ wi: 0 }, false, "java.lang.RuntimeException", { wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + var iaa = r8({ V7a: 0 }, false, "java.lang.Short", { V7a: 1, iH: 1, f: 1, o: 1, ym: 1 }, void 0, void 0, function(a10) { + return haa(a10); + }); + function Pj() { + this.s = null; + } + Pj.prototype = new u7(); + Pj.prototype.constructor = Pj; + function CJa(a10, b10) { + a10 = a10.s; + a10.qf = "" + a10.qf + b10; + } + d7 = Pj.prototype; + d7.a = function() { + Pj.prototype.AU.call(this, new Y22().a()); + return this; + }; + d7.bI = function(a10, b10) { + return this.s.qf.substring(a10, b10); + }; + d7.t = function() { + return this.s.qf; + }; + d7.Kaa = function(a10) { + Pj.prototype.e.call(this, ka(a10)); + return this; + }; + d7.xS = function(a10) { + CJa(this, a10); + }; + d7.Oa = function() { + return this.s.Oa(); + }; + function SKa(a10, b10) { + a10 = a10.s; + a10.qf = "" + a10.qf + b10; + } + d7.AU = function(a10) { + this.s = a10; + return this; + }; + d7.e = function(a10) { + Pj.prototype.AU.call(this, new Y22().e(a10)); + return this; + }; + d7.Hz = function(a10) { + return this.s.Hz(a10); + }; + d7.$classData = r8({ X7a: 0 }, false, "java.lang.StringBuffer", { X7a: 1, f: 1, eP: 1, SU: 1, o: 1 }); + function Y22() { + this.qf = null; + } + Y22.prototype = new u7(); + Y22.prototype.constructor = Y22; + function FH(a10, b10) { + if (0 > b10) + throw new Mv().ue(b10); + var c10 = a10.qf, e10 = b10 - (c10.length | 0) | 0; + if (0 > e10) + c10 = c10.substring(0, b10); + else + for (b10 = 0; b10 !== e10; ) + c10 += "\0", b10 = 1 + b10 | 0; + a10.qf = c10; + } + d7 = Y22.prototype; + d7.a = function() { + this.qf = ""; + return this; + }; + d7.bI = function(a10, b10) { + return this.qf.substring(a10, b10); + }; + d7.t = function() { + return this.qf; + }; + d7.Kaa = function(a10) { + Y22.prototype.e.call(this, ka(a10)); + return this; + }; + d7.xS = function(a10) { + this.qf = "" + this.qf + a10; + }; + d7.ue = function(a10) { + Y22.prototype.a.call(this); + if (0 > a10) + throw new sZa().a(); + return this; + }; + d7.Oa = function() { + return this.qf.length | 0; + }; + function jF(a10, b10) { + b10 = ba.String.fromCharCode(b10); + a10.qf = "" + a10.qf + b10; + } + d7.e = function(a10) { + Y22.prototype.a.call(this); + if (null === a10) + throw new sf().a(); + this.qf = a10; + return this; + }; + function tZa(a10) { + for (var b10 = a10.qf, c10 = "", e10 = -1 + (b10.length | 0) | 0; 0 < e10; ) { + var f10 = 65535 & (b10.charCodeAt(e10) | 0); + if (56320 === (64512 & f10)) { + var g10 = 65535 & (b10.charCodeAt(-1 + e10 | 0) | 0); + 55296 === (64512 & g10) ? (c10 = "" + c10 + ba.String.fromCharCode(g10) + ba.String.fromCharCode(f10), e10 = -2 + e10 | 0) : (c10 = "" + c10 + ba.String.fromCharCode(f10), e10 = -1 + e10 | 0); + } else + c10 = "" + c10 + ba.String.fromCharCode(f10), e10 = -1 + e10 | 0; + } + 0 === e10 && (b10 = 65535 & (b10.charCodeAt(0) | 0), c10 = "" + c10 + ba.String.fromCharCode(b10)); + a10.qf = c10; + return a10; + } + d7.Hz = function(a10) { + return 65535 & (this.qf.charCodeAt(a10) | 0); + }; + d7.$classData = r8({ Y7a: 0 }, false, "java.lang.StringBuilder", { Y7a: 1, f: 1, eP: 1, SU: 1, o: 1 }); + function QK() { + this.aI = this.KD = null; + this.RU = false; + } + QK.prototype = new u7(); + QK.prototype.constructor = QK; + d7 = QK.prototype; + d7.a = function() { + QK.prototype.v7a.call(this); + return this; + }; + function uZa(a10, b10, c10) { + null === a10.KD ? a10.aI = "" + a10.aI + b10 + c10 : vZa(a10, [b10, c10]); + } + function WK(a10, b10, c10) { + a10 = Dza(a10 & b10); + b10 = new wZa(); + b10.zG = a10; + b10.lG = c10; + CF.prototype.Ge.call(b10, null, null); + if (null === a10) + throw new sf().a(); + throw b10; + } + function Bza(a10, b10, c10) { + b10 = a10.toExponential(b10); + a10 = 0 === a10 && 0 > 1 / a10 ? "-" + b10 : b10; + b10 = a10.length | 0; + a10 = 101 !== (65535 & (a10.charCodeAt(-3 + b10 | 0) | 0)) ? a10 : a10.substring(0, -1 + b10 | 0) + "0" + a10.substring(-1 + b10 | 0); + if (!c10 || 0 <= (a10.indexOf(".") | 0)) + return a10; + c10 = a10.indexOf("e") | 0; + return a10.substring(0, c10) + "." + a10.substring(c10); + } + function xZa(a10, b10) { + for (var c10 = "", e10 = 0; e10 !== b10; ) + c10 = "" + c10 + a10, e10 = 1 + e10 | 0; + return c10; + } + function Eza(a10, b10, c10, e10) { + var f10 = e10.length | 0; + f10 >= c10 ? vza(a10, e10) : 0 !== (1 & b10) ? uZa(a10, e10, xZa(" ", c10 - f10 | 0)) : uZa(a10, xZa(" ", c10 - f10 | 0), e10); + } + function bL(a10, b10) { + return 0 !== (256 & a10) ? b10.toUpperCase() : b10; + } + d7.t = function() { + if (this.RU) + throw new RK().a(); + return null === this.KD ? this.aI : this.KD.t(); + }; + function Dza(a10) { + return (0 !== (1 & a10) ? "-" : "") + (0 !== (2 & a10) ? "#" : "") + (0 !== (4 & a10) ? "+" : "") + (0 !== (8 & a10) ? " " : "") + (0 !== (16 & a10) ? "0" : "") + (0 !== (32 & a10) ? "," : "") + (0 !== (64 & a10) ? "(" : "") + (0 !== (128 & a10) ? "<" : ""); + } + d7.v7a = function() { + this.KD = null; + this.aI = ""; + this.RU = false; + }; + function wza(a10, b10) { + if (void 0 === a10) + return b10; + a10 = +ba.parseInt(a10, 10); + return 2147483647 >= a10 ? Aa(a10) : -1; + } + function yZa(a10, b10, c10, e10) { + null === a10.KD ? a10.aI = a10.aI + ("" + b10 + c10) + e10 : vZa(a10, [b10, c10, e10]); + } + function zza(a10, b10, c10, e10, f10) { + var g10 = (e10.length | 0) + (f10.length | 0) | 0; + g10 >= c10 ? uZa(a10, e10, f10) : 0 !== (16 & b10) ? yZa(a10, e10, xZa("0", c10 - g10 | 0), f10) : 0 !== (1 & b10) ? yZa(a10, e10, f10, xZa(" ", c10 - g10 | 0)) : yZa(a10, xZa(" ", c10 - g10 | 0), e10, f10); + } + function Aza(a10, b10, c10, e10) { + Eza(a10, b10, c10, bL(b10, e10 !== e10 ? "NaN" : 0 < e10 ? 0 !== (4 & b10) ? "+Infinity" : 0 !== (8 & b10) ? " Infinity" : "Infinity" : 0 !== (64 & b10) ? "(Infinity)" : "-Infinity")); + } + function vZa(a10, b10) { + try { + for (var c10 = 0, e10 = b10.length | 0; c10 < e10; ) + a10.KD.xS(b10[c10]), c10 = 1 + c10 | 0; + } catch (f10) { + if (!(f10 instanceof T22)) + throw f10; + } + } + function $K(a10, b10, c10, e10, f10, g10) { + if (null === b10) + XK(a10, c10, e10, f10, "null"); + else { + a10 = new zZa(); + b10 = la(b10); + a10.lG = g10; + a10.eja = b10; + CF.prototype.Ge.call(a10, null, null); + if (null === b10) + throw new sf().a(); + throw a10; + } + } + function Cza(a10, b10, c10) { + b10 = a10.toFixed(b10); + a10 = 0 === a10 && 0 > 1 / a10 ? "-" + b10 : b10; + return c10 && 0 > (a10.indexOf(".") | 0) ? a10 + "." : a10; + } + function XK(a10, b10, c10, e10, f10) { + e10 = 0 > e10 ? f10 : f10.substring(0, e10); + Eza(a10, b10, c10, bL(b10, e10)); + } + function aL(a10) { + throw new cL().e(Dza(a10)); + } + function vza(a10, b10) { + null === a10.KD ? a10.aI = "" + a10.aI + b10 : vZa(a10, [b10]); + } + function xza(a10, b10, c10, e10) { + if ((e10.length | 0) >= c10 && 0 === (108 & b10)) + vza(a10, bL(b10, e10)); + else if (0 === (124 & b10)) + XK(a10, b10, c10, -1, e10); + else { + if (45 !== (65535 & (e10.charCodeAt(0) | 0))) + var f10 = 0 !== (4 & b10) ? "+" : 0 !== (8 & b10) ? " " : ""; + else + 0 !== (64 & b10) ? (e10 = e10.substring(1) + ")", f10 = "(") : (e10 = e10.substring(1), f10 = "-"); + if (0 !== (32 & b10)) { + for (var g10 = e10.length | 0, h10 = 0; ; ) { + if (h10 !== g10) { + var k10 = 65535 & (e10.charCodeAt(h10) | 0); + k10 = 48 <= k10 && 57 >= k10; + } else + k10 = false; + if (k10) + h10 = 1 + h10 | 0; + else + break; + } + h10 = -3 + h10 | 0; + if (!(0 >= h10)) { + for (g10 = e10.substring(h10); 3 < h10; ) + k10 = -3 + h10 | 0, g10 = e10.substring(k10, h10) + "," + g10, h10 = k10; + e10 = e10.substring(0, h10) + "," + g10; + } + } + zza( + a10, + b10, + c10, + f10, + bL(b10, e10) + ); + } + } + d7.US = function() { + if (!this.RU && null !== this.KD) { + var a10 = this.KD; + if (a10 && a10.$classData && a10.$classData.ge.ZY) + try { + a10.US(); + } catch (b10) { + if (!(b10 instanceof T22)) + throw b10; + } + } + this.RU = true; + }; + d7.$classData = r8({ k8a: 0 }, false, "java.util.Formatter", { k8a: 1, f: 1, ZY: 1, eba: 1, w7: 1 }); + function hJ() { + CF.call(this); + } + hJ.prototype = new m_(); + hJ.prototype.constructor = hJ; + hJ.prototype.aH = function(a10, b10) { + CF.prototype.Ge.call(this, a10, b10); + return this; + }; + hJ.prototype.$classData = r8({ w8a: 0 }, false, "java.util.concurrent.ExecutionException", { w8a: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function AZa() { + } + AZa.prototype = new Pwa(); + AZa.prototype.constructor = AZa; + AZa.prototype.a = function() { + return this; + }; + function Fd(a10, b10) { + if (null === b10) + return y7(); + a10 = FVa(Gb(), b10); + Gb(); + return new z7().d(qt(a10, new kT())); + } + function Pu(a10, b10, c10, e10, f10, g10) { + a10 = la(b10); + var h10; + if (h10 = !!a10.jg.isArrayClass) + h10 = la(e10), h10 = h10.jg.isPrimitive || a10.jg.isPrimitive ? h10 === a10 || (h10 === q5(Pa) ? a10 === q5(Oa) : h10 === q5(Qa) ? a10 === q5(Oa) || a10 === q5(Pa) : h10 === q5(Sa) ? a10 === q5(Oa) || a10 === q5(Pa) || a10 === q5(Qa) : h10 === q5(Ta) && (a10 === q5(Oa) || a10 === q5(Pa) || a10 === q5(Qa) || a10 === q5(Sa))) : Gga(h10, a10.jg.getFakeInstance()); + if (h10) + Ba(b10, c10, e10, f10, g10); + else + for (a10 = c10, c10 = c10 + g10 | 0; a10 < c10; ) + aAa(W5(), e10, f10, bAa(W5(), b10, a10)), a10 = 1 + a10 | 0, f10 = 1 + f10 | 0; + } + AZa.prototype.$classData = r8({ S8a: 0 }, false, "scala.Array$", { S8a: 1, Hhb: 1, f: 1, q: 1, o: 1 }); + var BZa = void 0; + function Gd() { + BZa || (BZa = new AZa().a()); + return BZa; + } + function AYa() { + CF.call(this); + } + AYa.prototype = new kVa(); + AYa.prototype.constructor = AYa; + AYa.prototype.a = function() { + CF.prototype.Ge.call(this, "an implementation is missing", null); + return this; + }; + AYa.prototype.$classData = r8({ Y8a: 0 }, false, "scala.NotImplementedError", { Y8a: 1, Ima: 1, bf: 1, f: 1, o: 1 }); + function Z22() { + } + Z22.prototype = new u7(); + Z22.prototype.constructor = Z22; + function CZa() { + } + CZa.prototype = Z22.prototype; + Z22.prototype.ro = function(a10) { + return a10; + }; + Z22.prototype.t = function() { + return ""; + }; + Z22.prototype.Ep = function(a10) { + return !!a10; + }; + function $22() { + } + $22.prototype = new u7(); + $22.prototype.constructor = $22; + function DZa() { + } + DZa.prototype = $22.prototype; + $22.prototype.ro = function(a10) { + return a10; + }; + $22.prototype.t = function() { + return ""; + }; + $22.prototype.Ep = function(a10) { + return !!a10; + }; + function a32() { + this.UE = null; + } + a32.prototype = new u7(); + a32.prototype.constructor = a32; + a32.prototype.a = function() { + EZa = this; + this.UE = new vI().a(); + return this; + }; + a32.prototype.cW = function(a10) { + throw new Hj().aH("problem in scala.concurrent internal callback", a10); + }; + a32.prototype.B0 = function(a10) { + if (a10 && a10.$classData && a10.$classData.ge.t9a) { + var b10 = this.UE.c(); + null === b10 ? (b10 = H10(), QVa(this, ji(a10, b10)).RE()) : wI(this.UE, ji(a10, b10)); + } else + a10.RE(); + }; + a32.prototype.$classData = r8({ s9a: 0 }, false, "scala.concurrent.Future$InternalCallbackExecutor$", { s9a: 1, f: 1, uda: 1, Rhb: 1, hba: 1 }); + var EZa = void 0; + function Ada() { + EZa || (EZa = new a32().a()); + return EZa; + } + function tJ() { + } + tJ.prototype = new u7(); + tJ.prototype.constructor = tJ; + tJ.prototype.a = function() { + return this; + }; + tJ.prototype.$classData = r8({ E9a: 0 }, false, "scala.math.Equiv$", { E9a: 1, f: 1, Shb: 1, q: 1, o: 1 }); + var Bxa = void 0; + function FZa() { + } + FZa.prototype = new u7(); + FZa.prototype.constructor = FZa; + FZa.prototype.a = function() { + return this; + }; + FZa.prototype.$classData = r8({ K9a: 0 }, false, "scala.math.Ordering$", { K9a: 1, f: 1, Thb: 1, q: 1, o: 1 }); + var GZa = void 0; + function TC() { + GZa || (GZa = new FZa().a()); + } + function s_() { + } + s_.prototype = new u7(); + s_.prototype.constructor = s_; + s_.prototype.a = function() { + return this; + }; + s_.prototype.t = function() { + return ""; + }; + s_.prototype.$classData = r8({ i$a: 0 }, false, "scala.reflect.NoManifest$", { i$a: 1, f: 1, Ju: 1, q: 1, o: 1 }); + var EVa = void 0; + function HZa() { + this.eV = null; + } + HZa.prototype = new u7(); + HZa.prototype.constructor = HZa; + d7 = HZa.prototype; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.Hd = function() { + return this; + }; + d7.$a = function() { + return this.FL(); + }; + d7.im = function() { + return this; + }; + d7.b = function() { + return !this.Ya(); + }; + d7.ua = function() { + var a10 = ii().u; + return TJ(this, a10); + }; + d7.bQ = function(a10) { + return this.iC(0, 0 < a10 ? a10 : 0); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.t = function() { + return ""; + }; + d7.iC = function(a10, b10) { + return fLa(this, a10, b10); + }; + d7.U = function(a10) { + yT(this, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.DI = function(a10) { + return gLa(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return TJ(this, a10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.Mj = function() { + var a10 = b32().u; + return TJ(this, a10); + }; + d7.Ya = function() { + return this.eV.Ya(); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.Dd = function() { + return Xv(this); + }; + d7.op = function() { + return Xv(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ke = function() { + return Xv(this); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return TJ(this, a10); + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + iLa(this, a10, b10, c10); + }; + d7.Do = function() { + return false; + }; + d7.OD = function(a10) { + return jLa(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()); this.Ya(); ) { + var b10 = this.FL(); + WA(a10, b10); + } + return a10.eb; + }; + d7.FL = function() { + this.eV.Tw(); + return $Ka(cLa(this.eV.c3, this.eV.Rw)); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.$classData = r8({ D$a: 0 }, false, "scala.util.matching.Regex$$anon$1", { D$a: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function IZa() { + } + IZa.prototype = new u7(); + IZa.prototype.constructor = IZa; + function c32() { + } + d7 = c32.prototype = IZa.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.im = function() { + return this; + }; + d7.ua = function() { + var a10 = ii().u; + return TJ(this, a10); + }; + d7.b = function() { + return !this.Ya(); + }; + d7.bQ = function(a10) { + return this.iC(0, 0 < a10 ? a10 : 0); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.t = function() { + return ""; + }; + d7.iC = function(a10, b10) { + return fLa(this, a10, b10); + }; + d7.U = function(a10) { + yT(this, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return TJ(this, a10); + }; + d7.DI = function(a10) { + return gLa(this, a10); + }; + d7.Mj = function() { + var a10 = b32().u; + return TJ(this, a10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.Dd = function() { + return Xv(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.op = function() { + return this.Dd(); + }; + d7.ke = function() { + return this.Dd(); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return TJ(this, a10); + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Do = function() { + return false; + }; + d7.Pk = function(a10, b10, c10) { + iLa(this, a10, b10, c10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()); this.Ya(); ) { + var b10 = this.$a(); + WA(a10, b10); + } + return a10.eb; + }; + d7.OD = function(a10) { + return jLa(this, a10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + function zT() { + this.XU = this.zn = this.fc = null; + this.qG = false; + } + zT.prototype = new u7(); + zT.prototype.constructor = zT; + d7 = zT.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.$a = function() { + return this.Ya() ? (this.qG = false, this.fc.$a()) : $B().ce.$a(); + }; + d7.im = function() { + return this; + }; + d7.b = function() { + return !this.Ya(); + }; + d7.ua = function() { + var a10 = ii().u; + return TJ(this, a10); + }; + d7.bQ = function(a10) { + return this.iC(0, 0 < a10 ? a10 : 0); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.t = function() { + return ""; + }; + d7.iC = function(a10, b10) { + return fLa(this, a10, b10); + }; + d7.U = function(a10) { + yT(this, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.DI = function(a10) { + var b10 = new gya(); + b10.AB = a10; + b10.zn = null; + null === this.zn ? this.zn = b10 : this.XU.zn = b10; + this.XU = b10; + null === this.fc && (this.fc = $B().ce); + return this; + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return TJ(this, a10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.Mj = function() { + var a10 = b32().u; + return TJ(this, a10); + }; + d7.Ya = function() { + if (this.qG) + return true; + if (null !== this.fc) { + if (this.fc.Ya()) + return this.qG = true; + a: + for (; ; ) { + if (null === this.zn) { + this.XU = this.fc = null; + var a10 = false; + break a; + } + this.fc = Hb(this.zn.AB).im(); + this.zn = this.zn.zn; + c: + for (; ; ) { + if (this.fc instanceof zT) { + a10 = this.fc; + this.fc = a10.fc; + this.qG = a10.qG; + null !== a10.zn && (a10.XU.zn = this.zn, this.zn = a10.zn); + continue c; + } + break; + } + if (this.qG) { + a10 = true; + break a; + } + if (null !== this.fc && this.fc.Ya()) { + a10 = this.qG = true; + break a; + } + } + return a10; + } + return false; + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.Dd = function() { + return Xv(this); + }; + d7.op = function() { + return Xv(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ke = function() { + return Xv(this); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return TJ(this, a10); + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + iLa(this, a10, b10, c10); + }; + d7.Do = function() { + return false; + }; + d7.OD = function(a10) { + return jLa(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()); this.Ya(); ) { + var b10 = this.$a(); + WA(a10, b10); + } + return a10.eb; + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.$classData = r8({ dab: 0 }, false, "scala.collection.Iterator$ConcatIterator", { dab: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function BT() { + } + BT.prototype = new u7(); + BT.prototype.constructor = BT; + d7 = BT.prototype; + d7.a = function() { + return this; + }; + d7.Kk = function() { + return this; + }; + d7.Rc = function() { + throw new Lu().e("TraversableView.Builder.result"); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.jd = function() { + return this; + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ Mab: 0 }, false, "scala.collection.TraversableView$NoBuilder", { Mab: 1, f: 1, vl: 1, ul: 1, tl: 1 }); + function JZa() { + } + JZa.prototype = new lLa(); + JZa.prototype.constructor = JZa; + function KZa() { + } + KZa.prototype = JZa.prototype; + function d32() { + } + d32.prototype = new lWa(); + d32.prototype.constructor = d32; + d32.prototype.a = function() { + return this; + }; + d32.prototype.tG = function() { + return nu(); + }; + d32.prototype.$classData = r8({ Dbb: 0 }, false, "scala.collection.immutable.Map$", { Dbb: 1, Apa: 1, hM: 1, gM: 1, f: 1 }); + var LZa = void 0; + function yC() { + LZa || (LZa = new d32().a()); + return LZa; + } + function MZa() { + this.hy = this.r = this.la = null; + } + MZa.prototype = new u7(); + MZa.prototype.constructor = MZa; + d7 = MZa.prototype; + d7.$a = function() { + return this.hy; + }; + function NZa(a10) { + return "(kv: " + a10.la + ", " + a10.r + ")" + (null !== a10.hy ? " -> " + NZa(a10.hy) : ""); + } + d7.M = function(a10, b10) { + this.la = a10; + this.r = b10; + return this; + }; + d7.t = function() { + return NZa(this); + }; + d7.uu = function() { + return this.la; + }; + d7.EL = function(a10) { + this.hy = a10; + }; + d7.$classData = r8({ ndb: 0 }, false, "scala.collection.mutable.DefaultEntry", { ndb: 1, f: 1, O2: 1, q: 1, o: 1 }); + function Kf() { + this.eb = this.ce = null; + } + Kf.prototype = new u7(); + Kf.prototype.constructor = Kf; + function Of(a10, b10) { + a10.eb.Kk(b10); + return a10; + } + function Jf(a10, b10) { + a10.ce = b10; + a10.eb = b10; + return a10; + } + d7 = Kf.prototype; + d7.Kk = function(a10) { + return Of(this, a10); + }; + d7.Rc = function() { + return this.eb; + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.jd = function(a10) { + return Of(this, a10); + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ rdb: 0 }, false, "scala.collection.mutable.GrowingBuilder", { rdb: 1, f: 1, vl: 1, ul: 1, tl: 1 }); + function OZa() { + this.hy = this.Eo = this.ks = this.r = this.la = null; + } + OZa.prototype = new u7(); + OZa.prototype.constructor = OZa; + d7 = OZa.prototype; + d7.$a = function() { + return this.hy; + }; + d7.M = function(a10, b10) { + this.la = a10; + this.r = b10; + this.Eo = this.ks = null; + return this; + }; + d7.uu = function() { + return this.la; + }; + d7.EL = function(a10) { + this.hy = a10; + }; + d7.$classData = r8({ Jdb: 0 }, false, "scala.collection.mutable.LinkedEntry", { Jdb: 1, f: 1, O2: 1, q: 1, o: 1 }); + function PZa() { + this.hy = this.Eo = this.ks = this.la = null; + } + PZa.prototype = new u7(); + PZa.prototype.constructor = PZa; + d7 = PZa.prototype; + d7.$a = function() { + return this.hy; + }; + d7.d = function(a10) { + this.la = a10; + this.Eo = this.ks = null; + return this; + }; + d7.uu = function() { + return this.la; + }; + d7.EL = function(a10) { + this.hy = a10; + }; + d7.$classData = r8({ Tdb: 0 }, false, "scala.collection.mutable.LinkedHashSet$Entry", { Tdb: 1, f: 1, O2: 1, q: 1, o: 1 }); + function e32() { + } + e32.prototype = new nWa(); + e32.prototype.constructor = e32; + e32.prototype.a = function() { + return this; + }; + e32.prototype.ls = function() { + return new wu().a(); + }; + e32.prototype.tG = function() { + return new wu().a(); + }; + e32.prototype.$classData = r8({ Zdb: 0 }, false, "scala.collection.mutable.Map$", { Zdb: 1, Oda: 1, hM: 1, gM: 1, f: 1 }); + var QZa = void 0; + function Ut() { + QZa || (QZa = new e32().a()); + return QZa; + } + function CK() { + this.Goa = null; + } + CK.prototype = new u7(); + CK.prototype.constructor = CK; + CK.prototype.a = function() { + this.Goa = ba.Promise.resolve(void 0); + return this; + }; + CK.prototype.cW = function(a10) { + iT(a10); + }; + CK.prototype.B0 = function(a10) { + this.Goa.then(/* @__PURE__ */ function(b10, c10) { + return function() { + try { + c10.RE(); + } catch (f10) { + var e10 = Ph(E6(), f10); + if (null !== e10) + iT(e10); + else + throw f10; + } + }; + }(this, a10)); + }; + CK.prototype.$classData = r8({ veb: 0 }, false, "scala.scalajs.concurrent.QueueExecutionContext$PromisesExecutionContext", { veb: 1, f: 1, Toa: 1, uda: 1, hba: 1 }); + function BK() { + } + BK.prototype = new u7(); + BK.prototype.constructor = BK; + BK.prototype.a = function() { + return this; + }; + BK.prototype.cW = function(a10) { + iT(a10); + }; + BK.prototype.B0 = function(a10) { + ba.setTimeout(/* @__PURE__ */ function(b10, c10) { + return function() { + try { + c10.RE(); + } catch (f10) { + var e10 = Ph(E6(), f10); + if (null !== e10) + iT(e10); + else + throw f10; + } + }; + }(this, a10), 0); + }; + BK.prototype.$classData = r8({ web: 0 }, false, "scala.scalajs.concurrent.QueueExecutionContext$TimeoutsExecutionContext", { web: 1, f: 1, Toa: 1, uda: 1, hba: 1 }); + function zK() { + } + zK.prototype = new u7(); + zK.prototype.constructor = zK; + zK.prototype.a = function() { + return this; + }; + zK.prototype.cW = function(a10) { + iT(a10); + }; + zK.prototype.B0 = function(a10) { + try { + a10.RE(); + } catch (b10) { + if (a10 = Ph(E6(), b10), null !== a10) + iT(a10); + else + throw b10; + } + }; + zK.prototype.$classData = r8({ xeb: 0 }, false, "scala.scalajs.concurrent.RunNowExecutionContext$", { xeb: 1, f: 1, Toa: 1, uda: 1, hba: 1 }); + var hza = void 0; + function qa() { + this.Ud = this.od = 0; + } + qa.prototype = new LKa(); + qa.prototype.constructor = qa; + d7 = qa.prototype; + d7.rba = function() { + return Da(this); + }; + d7.oja = function() { + return this.od << 24 >> 24; + }; + d7.h = function(a10) { + return a10 instanceof qa ? this.od === a10.od && this.Ud === a10.Ud : false; + }; + d7.Fi = function(a10, b10, c10) { + qa.prototype.Sc.call(this, a10 | b10 << 22, b10 >> 10 | c10 << 12); + return this; + }; + d7.t = function() { + return yza(Ea(), this.od, this.Ud); + }; + d7.Sc = function(a10, b10) { + this.od = a10; + this.Ud = b10; + return this; + }; + d7.tr = function(a10) { + Ea(); + var b10 = this.od, c10 = this.Ud, e10 = a10.od; + a10 = a10.Ud; + return c10 === a10 ? b10 === e10 ? 0 : (-2147483648 ^ b10) < (-2147483648 ^ e10) ? -1 : 1 : c10 < a10 ? -1 : 1; + }; + d7.ue = function(a10) { + qa.prototype.Sc.call(this, a10, a10 >> 31); + return this; + }; + d7.Upa = function() { + return this.od << 16 >> 16; + }; + d7.z = function() { + return this.od ^ this.Ud; + }; + d7.gH = function() { + return this.od; + }; + d7.$classData = r8({ Neb: 0 }, false, "scala.scalajs.runtime.RuntimeLong", { Neb: 1, iH: 1, f: 1, o: 1, ym: 1 }); + function QT() { + this.tD = this.Ll = null; + } + QT.prototype = new u7(); + QT.prototype.constructor = QT; + function f32() { + } + d7 = f32.prototype = QT.prototype; + d7.H = function() { + return "ProfileName"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof QT ? this.Ll === a10.Ll ? this.tD === a10.tD : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ll; + case 1: + return this.tD; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return this.Ll; + }; + d7.FB = function(a10, b10) { + this.Ll = a10; + this.tD = b10; + }; + d7.e = function(a10) { + QT.prototype.FB.call(this, a10, hk()); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ PA: 0 }, false, "amf.ProfileName", { PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function FL() { + this.k = null; + } + FL.prototype = new u7(); + FL.prototype.constructor = FL; + d7 = FL.prototype; + d7.a = function() { + FL.prototype.IO.call(this, (HXa(), IXa(new j22(), H10(), y7()))); + return this; + }; + d7.H = function() { + return "Environment"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof FL) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.IO = function(a10) { + this.k = a10; + return this; + }; + d7.P4 = function() { + var a10 = ab(), b10 = this.k.NH, c10 = RZa(); + return bb(a10, b10, c10).Ra(); + }; + d7.z = function() { + return X5(this); + }; + function mAa(a10, b10) { + a10 = a10.k; + var c10 = ab(), e10 = lAa(); + b10 = uk(tk(c10, b10, e10)); + return new FL().IO(IXa(new j22(), b10, a10.NH)); + } + FL.prototype.withResolver = function(a10) { + return new FL().IO(SZa(this.k, (ab(), RZa(), PWa(a10)))); + }; + FL.prototype.withLoaders = function(a10) { + return mAa(this, a10); + }; + FL.prototype.add = function(a10) { + return new FL().IO(Jea(this.k, (ab(), lAa(), RWa(a10)))); + }; + FL.prototype.withClientResolver = function(a10) { + var b10 = new HL(); + b10.Hoa = a10; + return new FL().IO(SZa(this.k, (ab(), RZa(), PWa(b10)))); + }; + FL.prototype.addClientLoader = function(a10) { + var b10 = new GL(); + b10.pba = a10; + return new FL().IO(Jea(this.k, (ab(), lAa(), RWa(b10)))); + }; + Object.defineProperty(FL.prototype, "reference", { get: function() { + return this.P4(); + }, configurable: true }); + Object.defineProperty(FL.prototype, "loaders", { get: function() { + var a10 = ab(), b10 = this.k.lH, c10 = lAa(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + FL.prototype.$classData = r8({ Jta: 0 }, false, "amf.client.environment.Environment", { Jta: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Uo() { + this.k = null; + } + Uo.prototype = new u7(); + Uo.prototype.constructor = Uo; + d7 = Uo.prototype; + d7.a = function() { + Uo.prototype.dq.call(this, (O7(), new P6().a())); + return this; + }; + d7.H = function() { + return "Annotations"; + }; + d7.E = function() { + return 1; + }; + d7.$k = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Uo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function TZa(a10) { + var b10 = ab(), c10 = new UZa(), e10 = a10.k.hf, f10 = Ef().u; + c10 = xs(e10, c10, f10); + a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.cp; + }; + }(a10)); + e10 = K7(); + a10 = c10.ka(a10, e10.u); + c10 = FLa(); + return Ak(b10, a10, c10).Ra(); + } + d7.dq = function(a10) { + this.k = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.sL = function() { + var a10 = ab(), b10 = Ab(this.k, q5(Bb)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.da)); + var c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }; + Object.defineProperty(Uo.prototype, "autoGeneratedName", { get: function() { + return Ab(this.k, q5(nN)).na(); + }, configurable: true }); + Object.defineProperty(Uo.prototype, "inlinedElement", { get: function() { + return Ab(this.k, q5(VZa)).na(); + }, configurable: true }); + Object.defineProperty(Uo.prototype, "inheritanceProvenance", { get: function() { + var a10 = ab(), b10 = Ab(this.k, q5(Zi)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.nw)); + var c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Uo.prototype, "resolvedLinkTarget", { get: function() { + var a10 = ab(), b10 = Ab(this.k, q5(WZa)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.iP)); + var c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Uo.prototype, "resolvedLink", { get: function() { + var a10 = ab(), b10 = Ab(this.k, q5(XZa)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.hP)); + var c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Uo.prototype, "isTracked", { get: function() { + var a10 = new YZa(), b10 = this.k.hf, c10 = Ef().u; + return xs(b10, a10, c10).Da(); + }, configurable: true }); + Uo.prototype.isTrackedBy = function(a10) { + var b10 = new ZZa(); + b10.sM = a10; + a10 = this.k.hf; + var c10 = Ef().u; + return xs(a10, b10, c10).Da(); + }; + Object.defineProperty(Uo.prototype, "isLocal", { get: function() { + return Ab(this.k, q5(zka)).na(); + }, configurable: true }); + Uo.prototype.location = function() { + return this.sL(); + }; + Uo.prototype.fragmentName = function() { + var a10 = ab(), b10 = Ab(this.k, q5($Za)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.vg)); + var c10 = ab().Lf(); + return bb(a10, b10, c10).Ra(); + }; + Uo.prototype.custom = function() { + return TZa(this); + }; + Uo.prototype.lexical = function() { + var a10 = Ab(this.k, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc)); + return a10.b() ? rfa() : a10.c(); + }; + Object.defineProperty(Uo.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + Uo.prototype.$classData = r8({ Ota: 0 }, false, "amf.client.model.Annotations", { Ota: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function g32() { + this.k = null; + } + g32.prototype = new u7(); + g32.prototype.constructor = g32; + d7 = g32.prototype; + d7.H = function() { + return "Graph"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g32) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.TV = function() { + var a10 = ab(), b10 = NDa(this.k), c10 = ab().Lf(); + return Ak(a10, b10, c10).Ra(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function GLa(a10) { + var b10 = new g32(); + b10.k = a10; + return b10; + } + d7.z = function() { + return X5(this); + }; + g32.prototype.remove = function(a10) { + Dha(this.k.Rh.Y(), a10); + return this; + }; + g32.prototype.getObjectByPropertyId = function(a10) { + var b10 = ab(); + a10 = a_a(this.k, a10); + var c10 = ab().jr(); + return Ak(b10, a10, c10).Ra(); + }; + g32.prototype.scalarByProperty = function(a10) { + var b10 = ab(); + a10 = b_a(this.k, a10); + var c10 = ab().QM(); + return Ak(b10, a10, c10).Ra(); + }; + g32.prototype.properties = function() { + return this.TV(); + }; + g32.prototype.types = function() { + var a10 = ab(), b10 = c_a(this.k), c10 = ab().Lf(); + return Ak(a10, b10, c10).Ra(); + }; + g32.prototype.$classData = r8({ Hua: 0 }, false, "amf.client.model.domain.Graph", { Hua: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function d_a(a10) { + ab(); + a10 = B6(a10.k.Y(), FY().R); + ab().cb(); + return gb(a10); + } + function e_a(a10) { + var b10 = ab(); + a10 = a10.k.kI(); + var c10 = f_a(); + return Ak(b10, a10, c10).Ra(); + } + function g_a(a10, b10) { + var c10 = a10.k; + ab(); + h_a(); + b10 = b10.k; + var e10 = FY().te; + Vd(c10, e10, b10); + return a10; + } + function i_a(a10, b10) { + var c10 = a10.k; + O7(); + var e10 = new P6().a(); + Sd(c10, b10, e10); + return a10; + } + function j_a(a10, b10) { + var c10 = a10.k, e10 = ab(), f10 = f_a(); + b10 = uk(tk(e10, b10, f10)); + e10 = FY().Aj; + Zd(c10, e10, b10); + return a10; + } + function k_a(a10) { + ab(); + a10 = iRa(a10.k); + var b10 = h_a(); + return xu(b10.l.ea, a10); + } + function h32() { + this.ea = this.k = null; + } + h32.prototype = new u7(); + h32.prototype.constructor = h32; + function l_a() { + } + d7 = l_a.prototype = h32.prototype; + d7.Xe = function() { + i32(); + var a10 = B6(this.k.Y(), eO().R); + i32().cb(); + return gb(a10); + }; + d7.tq = function() { + return this.LD(); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + i32(); + var a10 = B6(this.k.Y(), eO().Va); + i32().cb(); + return gb(a10); + }; + d7.O4 = function() { + i32(); + var a10 = B6(this.k.Y(), eO().Vf); + i32().cb(); + return gb(a10); + }; + d7.mla = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.sq = function(a10) { + var b10 = this.k, c10 = eO().Zc; + eb(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = eO().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.Oc().j; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.LD = function() { + i32(); + var a10 = B6(this.k.Y(), eO().Zc); + i32().cb(); + return gb(a10); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = eO().R; + eb(b10, c10, a10); + return this; + }; + h32.prototype.annotations = function() { + return this.rb(); + }; + h32.prototype.graph = function() { + return jU(this); + }; + h32.prototype.withId = function(a10) { + return this.$b(a10); + }; + h32.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + h32.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(h32.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(h32.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + h32.prototype.withSubClasOf = function(a10) { + XXa(this.k, a10); + return this; + }; + h32.prototype.withRange = function(a10) { + var b10 = this.k, c10 = eO().Vf; + eb(b10, c10, a10); + return this; + }; + h32.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + h32.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + h32.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(h32.prototype, "subPropertyOf", { get: function() { + var a10 = i32(), b10 = B6(this.k.Y(), eO().eB), c10 = i32().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "range", { get: function() { + return this.O4(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(h32.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + function Pm() { + this.ea = this.k = null; + } + Pm.prototype = new u7(); + Pm.prototype.constructor = Pm; + function m_a() { + } + d7 = m_a.prototype = Pm.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Pm.prototype.XG.call(this, new Om().K(new S6().a(), a10)); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.Oc().j; + }; + d7.oc = function() { + return this.k; + }; + d7.XG = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + Pm.prototype.annotations = function() { + return this.rb(); + }; + Pm.prototype.graph = function() { + return jU(this); + }; + Pm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Pm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Pm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Pm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Pm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Pm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Pm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Pm.prototype.withAdditionalProperties = function(a10) { + var b10 = this.k; + Z10(); + Z10().Um(); + a10 = a10.k; + var c10 = Nm().Dy; + Vd(b10, c10, a10); + return this; + }; + Object.defineProperty(Pm.prototype, "additionalProperties", { get: function() { + Z10(); + var a10 = ar(this.k.Y(), Nm().Dy); + return fl(Z10().Um(), a10); + }, configurable: true }); + Pm.prototype.$classData = r8({ fN: 0 }, false, "amf.client.model.domain.Settings", { fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1 }); + function H_() { + this.k = null; + } + H_.prototype = new u7(); + H_.prototype.constructor = H_; + d7 = H_.prototype; + d7.H = function() { + return "CachedReference"; + }; + d7.jla = function(a10) { + this.k = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.Rv = function() { + return this.k.Of; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof H_) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.r7a = function(a10, b10, c10) { + H_.prototype.jla.call(this, n_a(a10, b10.Be(), c10)); + }; + d7.z = function() { + return X5(this); + }; + Object.defineProperty(H_.prototype, "resolved", { get: function() { + return this.k.Hm; + }, configurable: true }); + Object.defineProperty(H_.prototype, "content", { get: function() { + ab(); + var a10 = this.k.ur; + return gfa(ab().$e(), a10); + }, configurable: true }); + Object.defineProperty(H_.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + H_.prototype.$classData = r8({ dwa: 0 }, false, "amf.client.reference.CachedReference", { dwa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function j32() { + this.yL = this.Of = this.hx = null; + } + j32.prototype = new u7(); + j32.prototype.constructor = j32; + d7 = j32.prototype; + d7.Hc = function(a10, b10) { + j32.prototype.YT.call(this, KLa(b10, a10), b10, y7()); + return this; + }; + d7.H = function() { + return "Content"; + }; + d7.E = function() { + return 3; + }; + d7.Rv = function() { + return this.Of; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof j32 && this.hx === a10.hx && this.Of === a10.Of) { + var b10 = this.yL; + a10 = a10.yL; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hx; + case 1: + return this.Of; + case 2: + return this.yL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.t1 = function(a10, b10, c10) { + j32.prototype.YT.call(this, KLa(b10, a10), b10, new z7().d(c10)); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.qv = function(a10, b10, c10) { + j32.prototype.YT.call(this, KLa(b10, a10), b10, c10); + return this; + }; + d7.YT = function(a10, b10, c10) { + this.hx = a10; + this.Of = b10; + this.yL = c10; + return this; + }; + Object.defineProperty(j32.prototype, "mime", { get: function() { + return this.yL; + }, configurable: true }); + Object.defineProperty(j32.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + Object.defineProperty(j32.prototype, "stream", { get: function() { + return this.hx; + }, configurable: true }); + j32.prototype.$classData = r8({ ewa: 0 }, false, "amf.client.remote.Content", { ewa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function B1() { + this.k = null; + } + B1.prototype = new u7(); + B1.prototype.constructor = B1; + d7 = B1.prototype; + d7.H = function() { + return "ValidationCandidate"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof B1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ila = function(a10) { + this.k = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.X6a = function(a10, b10) { + B1.prototype.ila.call(this, aC(a10.Ce(), b10.Sv())); + }; + Object.defineProperty(B1.prototype, "payload", { get: function() { + ab(); + var a10 = this.k.le; + return nfa(ofa(), a10); + }, configurable: true }); + Object.defineProperty(B1.prototype, "shape", { get: function() { + ab(); + var a10 = this.k.pa; + return t1(ab().Bg(), a10); + }, configurable: true }); + B1.prototype.$classData = r8({ Dwa: 0 }, false, "amf.client.validate.ValidationCandidate", { Dwa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function k32() { + this.k = null; + } + k32.prototype = new u7(); + k32.prototype.constructor = k32; + d7 = k32.prototype; + d7.H = function() { + return "ValidationShapeSet"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k32) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$6a = function(a10) { + this.k = a10; + }; + d7.z7a = function(a10, b10) { + var c10 = ab(), e10 = o_a(); + k32.prototype.$6a.call(this, p_a(new q_a(), uk(tk(c10, a10, e10)), b10)); + }; + Object.defineProperty(k32.prototype, "defaultSeverity", { get: function() { + return this.k.vo; + }, configurable: true }); + Object.defineProperty(k32.prototype, "candidates", { get: function() { + var a10 = ab(), b10 = this.k.Gz, c10 = o_a(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + k32.prototype.$classData = r8({ Gwa: 0 }, false, "amf.client.validate.ValidationShapeSet", { Gwa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function r_a() { + this.xe = this.YB = this.Q = this.OB = this.da = this.$g = null; + } + r_a.prototype = new u7(); + r_a.prototype.constructor = r_a; + d7 = r_a.prototype; + d7.H = function() { + return "Root"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof r_a) { + var b10 = this.$g, c10 = a10.$g; + (null === b10 ? null === c10 : b10.h(c10)) && this.da === a10.da && this.OB === a10.OB ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 && this.YB === a10.YB ? this.xe === a10.xe : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$g; + case 1: + return this.da; + case 2: + return this.OB; + case 3: + return this.Q; + case 4: + return this.YB; + case 5: + return this.xe; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function ega(a10, b10, c10, e10, f10, g10) { + var h10 = new r_a(); + h10.$g = a10; + h10.da = b10; + h10.OB = c10; + h10.Q = e10; + h10.YB = f10; + h10.xe = g10; + return h10; + } + d7.$classData = r8({ Rwa: 0 }, false, "amf.core.Root", { Rwa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function l32() { + } + l32.prototype = new OT(); + l32.prototype.constructor = l32; + l32.prototype.a = function() { + return this; + }; + l32.prototype.P = function(a10) { + return new NM().cE(a10); + }; + l32.prototype.t = function() { + return "DomainExtensionAnnotation"; + }; + l32.prototype.$classData = r8({ gxa: 0 }, false, "amf.core.annotations.DomainExtensionAnnotation$", { gxa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + var s_a = void 0; + function CFa() { + s_a || (s_a = new l32().a()); + return s_a; + } + function hr() { + this.cF = Ea().dl; + this.mK = Ea().dl; + this.nH = null; + } + hr.prototype = new u7(); + hr.prototype.constructor = hr; + d7 = hr.prototype; + d7.H = function() { + return "Execution"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof hr) { + var b10 = this.cF, c10 = b10.Ud, e10 = a10.cF; + b10.od === e10.od && c10 === e10.Ud ? (b10 = this.mK, c10 = b10.Ud, e10 = a10.mK, b10 = b10.od === e10.od && c10 === e10.Ud) : b10 = false; + if (b10) + return b10 = this.nH, a10 = a10.nH, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Fga(a10, b10, c10, e10) { + a10.cF = b10; + a10.mK = c10; + a10.nH = e10; + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cF; + case 1: + return this.mK; + case 2: + return this.nH; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Cga(a10, b10, c10) { + var e10 = a10.nH, f10 = K7(), g10 = new t_a(); + g10.XP = b10; + g10.nC = c10; + b10 = J5(f10, new Ib().ha([g10])); + f10 = K7(); + e10 = e10.ia(b10, f10.u); + b10 = a10.cF; + a10 = b10.od; + b10 = b10.Ud; + return Fga(new hr(), new qa().Sc(a10, b10), c10, e10); + } + function Ega(a10) { + var b10 = Bga(), c10 = b10.od; + b10 = b10.Ud; + var e10 = a10.cF, f10 = e10.od; + e10 = e10.Ud; + a10 = a10.nH; + return Fga(new hr(), new qa().Sc(f10, e10), new qa().Sc(c10, b10), a10); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, pL(OJ(), this.cF)); + a10 = OJ().Ga(a10, pL(OJ(), this.mK)); + a10 = OJ().Ga(a10, NJ(OJ(), this.nH)); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ Rxa: 0 }, false, "amf.core.benchmark.Execution", { Rxa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function t_a() { + this.XP = null; + this.nC = Ea().dl; + } + t_a.prototype = new u7(); + t_a.prototype.constructor = t_a; + d7 = t_a.prototype; + d7.H = function() { + return "Log"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof t_a && this.XP === a10.XP) { + var b10 = this.nC, c10 = b10.Ud; + a10 = a10.nC; + return b10.od === a10.od && c10 === a10.Ud; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.XP; + case 1: + return this.nC; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.XP)); + a10 = OJ().Ga(a10, pL(OJ(), this.nC)); + return OJ().fe(a10, 2); + }; + d7.$classData = r8({ Txa: 0 }, false, "amf.core.benchmark.Log", { Txa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Dq() { + CF.call(this); + this.Yka = null; + } + Dq.prototype = new X22(); + Dq.prototype.constructor = Dq; + Dq.prototype.bL = function(a10) { + this.Yka = a10; + a10 = "Cyclic found following references " + UJ(a10, "", " -> ", ""); + CF.prototype.Ge.call(this, a10, null); + return this; + }; + Dq.prototype.$classData = r8({ pya: 0 }, false, "amf.core.exception.CyclicReferenceException", { pya: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Fq() { + CF.call(this); + } + Fq.prototype = new X22(); + Fq.prototype.constructor = Fq; + Fq.prototype.e = function(a10) { + CF.prototype.Ge.call(this, "Cannot parse document with specified media type: " + a10, null); + return this; + }; + Fq.prototype.$classData = r8({ qya: 0 }, false, "amf.core.exception.UnsupportedMediaTypeException", { qya: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Cq() { + CF.call(this); + this.gr = null; + } + Cq.prototype = new X22(); + Cq.prototype.constructor = Cq; + Cq.prototype.e = function(a10) { + this.gr = a10; + CF.prototype.Ge.call(this, "Cannot parse document with specified vendor: " + a10, null); + return this; + }; + Cq.prototype.$classData = r8({ rya: 0 }, false, "amf.core.exception.UnsupportedVendorException", { rya: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function sb() { + this.qa = this.r = this.ba = null; + this.fP = false; + } + sb.prototype = new u7(); + sb.prototype.constructor = sb; + d7 = sb.prototype; + d7.H = function() { + return "Field"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + return a10 instanceof sb ? ic(a10.r) === ic(this.r) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ba; + case 1: + return this.r; + case 2: + return this.qa; + case 3: + return this.fP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return ic(this.r); + }; + function rb(a10, b10, c10, e10) { + a10.ba = b10; + a10.r = c10; + a10.qa = e10; + a10.fP = true; + return a10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ba)); + a10 = OJ().Ga(a10, NJ(OJ(), this.r)); + a10 = OJ().Ga(a10, NJ(OJ(), this.qa)); + a10 = OJ().Ga(a10, this.fP ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.$classData = r8({ tya: 0 }, false, "amf.core.metamodel.Field", { tya: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function u_a() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.qa = this.g = this.ba = null; + } + u_a.prototype = new u7(); + u_a.prototype.constructor = u_a; + d7 = u_a.prototype; + d7.a = function() { + v_a = this; + Cr(this); + tU(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "Unit")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + ii(); + a10 = [this.tg, this.xc, this.ae, this.Hg, this.De]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.g = c10; + this.qa = tb(new ub(), vb().hg, "Base Unit", "Base class for every single document model unit. After parsing a document the parser generate parsing Units. Units encode the domain elements and can reference other units to re-use descriptions.", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("BaseUnit is an abstract class")); + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Kya: 0 }, false, "amf.core.metamodel.document.BaseUnitModel$", { Kya: 1, f: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var v_a = void 0; + function Bq() { + v_a || (v_a = new u_a().a()); + return v_a; + } + function w_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.g = this.Tt = null; + this.xa = 0; + } + w_a.prototype = new u7(); + w_a.prototype.constructor = w_a; + d7 = w_a.prototype; + d7.a = function() { + x_a = this; + Cr(this); + uU(this); + var a10 = new xc().yd(dl()), b10 = F6().Ul; + a10 = this.Tt = rb(new sb(), a10, G5(b10, "member"), tb(new ub(), ci().Qi, "member", "", H10())); + b10 = dl().g; + this.g = ji(a10, b10); + a10 = F6().Pg; + a10 = G5(a10, "Array"); + b10 = F6().Qi; + b10 = G5(b10, "Seq"); + var c10 = dl().ba; + this.ba = ji(a10, ji(b10, c10)); + this.qa = tb(new ub(), vb().Pg, "Array Node", "Node that represents a dynamic array data structure", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + hs(); + O7(); + var a10 = new P6().a(); + return new bl().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Sya: 0 }, false, "amf.core.metamodel.domain.ArrayNodeModel$", { Sya: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var x_a = void 0; + function al() { + x_a || (x_a = new w_a().a()); + return x_a; + } + function y_a() { + this.wd = this.bb = this.mc = this.qa = this.g = this.ba = null; + this.xa = 0; + } + y_a.prototype = new u7(); + y_a.prototype.constructor = y_a; + function z_a(a10) { + if (0 === (1 & a10.xa) << 24 >> 24) { + var b10 = new xc().yd(nc()); + var c10 = F6().Zd; + b10 = rb(new sb(), b10, G5(c10, "extends"), tb(new ub(), vb().hg, "extends", "Entity that is going to be extended overlaying or adding additional information\nThe type of the relationship provide the semantics about thow the referenced and referencer elements must be combined when generating the domain model from the document model.", H10())); + a10.mc = b10; + a10.xa = (1 | a10.xa) << 24 >> 24; + } + return a10.mc; + } + d7 = y_a.prototype; + d7.a = function() { + A_a = this; + Cr(this); + uU(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "DomainElement")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + ii(); + a10 = [this.Ni()]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.g = c10; + this.qa = tb(new ub(), vb().hg, "Domain element", "Base class for any element describing a domain model. Domain Elements are encoded or declared into base units", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ni = function() { + return 0 === (1 & this.xa) << 24 >> 24 ? z_a(this) : this.mc; + }; + function Yd(a10) { + if (0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24) { + var b10 = new xc().yd(Ud()); + var c10 = F6().Zd; + b10 = rb(new sb(), b10, G5(c10, "customDomainProperties"), tb(new ub(), vb().hg, "custom domain properties", "Extensions provided for a particular domain element.", H10())); + a10.wd = b10; + a10.xa = (2 | a10.xa) << 24 >> 24; + } + return a10.wd; + } + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("DomainElement is an abstract class")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Uya: 0 }, false, "amf.core.metamodel.domain.DomainElementModel$", { Uya: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var A_a = void 0; + function nc() { + A_a || (A_a = new y_a().a()); + return A_a; + } + function B_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.g = this.Nd = this.Rd = null; + this.xa = 0; + } + B_a.prototype = new u7(); + B_a.prototype.constructor = B_a; + d7 = B_a.prototype; + d7.a = function() { + C_a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Zd; + this.Rd = rb(new sb(), a10, G5(b10, "raw"), tb(new ub(), vb().hg, "raw", "Raw textual information that cannot be processed for the current model semantics.", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Nd = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "mediaType", "Media type associated to the encoded fragment information", H10())); + ii(); + a10 = [this.Rd, this.Nd]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.g = c10; + a10 = F6().Zd; + a10 = G5(a10, "ExternalDomainElement"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "External Domain Element", "Domain element containing foreign information that cannot be included into the model semantics", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Pk().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Vya: 0 }, false, "amf.core.metamodel.domain.ExternalDomainElementModel$", { Vya: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var C_a = void 0; + function Ok() { + C_a || (C_a = new B_a().a()); + return C_a; + } + function D_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.Xp = this.vf = null; + this.xa = 0; + } + D_a.prototype = new u7(); + D_a.prototype.constructor = D_a; + d7 = D_a.prototype; + d7.a = function() { + E_a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Pg; + this.vf = rb(new sb(), a10, G5(b10, "value"), tb(new ub(), vb().Pg, "value", "", H10())); + a10 = qb(); + b10 = F6().Pg; + this.Xp = rb(new sb(), a10, G5(b10, "alias"), tb(new ub(), vb().Pg, "alias", "", H10())); + a10 = F6().Pg; + a10 = G5(a10, "Link"); + b10 = dl().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Pg, "Link Node", "Node that represents a dynamic link in a data structure", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.vf], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = dl().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + dha(); + O7(); + var a10 = new P6().a(); + return cha(0, "", "", a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Yya: 0 }, false, "amf.core.metamodel.domain.LinkNodeModel$", { Yya: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var E_a = void 0; + function os() { + E_a || (E_a = new D_a().a()); + return E_a; + } + function ub() { + this.f3 = this.l0 = this.nT = this.ff = null; + } + ub.prototype = new u7(); + ub.prototype.constructor = ub; + d7 = ub.prototype; + d7.H = function() { + return "ModelDoc"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ub) { + var b10 = this.ff, c10 = a10.ff; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.nT === a10.nT && this.l0 === a10.l0) + return b10 = this.f3, a10 = a10.f3, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ff; + case 1: + return this.nT; + case 2: + return this.l0; + case 3: + return this.f3; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function tb(a10, b10, c10, e10, f10) { + a10.ff = b10; + a10.nT = c10; + a10.l0 = e10; + a10.f3 = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $ya: 0 }, false, "amf.core.metamodel.domain.ModelDoc", { $ya: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Gr() { + this.K0 = this.y3 = this.he = this.rr = null; + } + Gr.prototype = new u7(); + Gr.prototype.constructor = Gr; + d7 = Gr.prototype; + d7.H = function() { + return "ModelVocabulary"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Gr ? this.rr === a10.rr && this.he === a10.he && this.y3 === a10.y3 && this.K0 === a10.K0 : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rr; + case 1: + return this.he; + case 2: + return this.y3; + case 3: + return this.K0; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Fr(a10, b10, c10, e10, f10) { + a10.rr = b10; + a10.he = c10; + a10.y3 = e10; + a10.K0 = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bza: 0 }, false, "amf.core.metamodel.domain.ModelVocabulary", { bza: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function F_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.af = this.vf = null; + this.xa = 0; + } + F_a.prototype = new u7(); + F_a.prototype.constructor = F_a; + d7 = F_a.prototype; + d7.a = function() { + G_a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Pg; + this.vf = rb(new sb(), a10, G5(b10, "value"), tb(new ub(), vb().Pg, "value", "value for an scalar dynamic node", H10())); + a10 = yc(); + b10 = F6().Ua; + this.af = rb(new sb(), a10, G5(b10, "datatype"), tb(new ub(), vb().Pg, "dataType", "Data type of value for an scalar dynamic node", H10())); + a10 = F6().Pg; + a10 = G5(a10, "Scalar"); + b10 = dl().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Pg, "Scalar Node", "Node that represents a dynamic scalar value data structure", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.vf, b10 = this.af, c10 = dl().g; + return ji(a10, ji(b10, c10)); + }; + d7.lc = function() { + vs(); + var a10 = y7(); + return ts(0, "", a10, (O7(), new P6().a())); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ fza: 0 }, false, "amf.core.metamodel.domain.ScalarNodeModel$", { fza: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var G_a = void 0; + function Wi() { + G_a || (G_a = new F_a().a()); + return G_a; + } + function H_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.g = this.zi = this.ig = null; + this.xa = 0; + } + H_a.prototype = new u7(); + H_a.prototype.constructor = H_a; + d7 = H_a.prototype; + d7.a = function() { + I_a = this; + Cr(this); + uU(this); + var a10 = Sk(), b10 = F6().Zd; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().hg, "defined by", "Definition for the extended entity", H10())); + a10 = dl(); + b10 = F6().Zd; + this.zi = rb(new sb(), a10, G5(b10, "extension"), tb(new ub(), vb().hg, "extension", "Data structure associated to the extension", H10())); + ii(); + a10 = [this.ig, this.zi]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + a10 = F6().Ta; + a10 = G5(a10, "ShapeExtension"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Ta, + "Shape Extension", + "Custom extensions for a data shape definition inside an API definition", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new m32().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ oza: 0 }, false, "amf.core.metamodel.domain.extensions.ShapeExtensionModel$", { oza: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var I_a = void 0; + function Ot() { + I_a || (I_a = new H_a().a()); + return I_a; + } + function J_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.vf = this.R = null; + this.xa = 0; + } + J_a.prototype = new u7(); + J_a.prototype.constructor = J_a; + d7 = J_a.prototype; + d7.a = function() { + K_a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "name of the template variable", H10())); + a10 = dl(); + b10 = F6().Zd; + this.vf = rb(new sb(), a10, G5(b10, "value"), tb(new ub(), vb().hg, "value", "value of the variables", H10())); + a10 = F6().Zd; + a10 = G5(a10, "VariableValue"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "Variable Value", "Value for a variable in a graph template", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.vf], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new hl().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ rza: 0 }, false, "amf.core.metamodel.domain.templates.VariableValueModel$", { rza: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var K_a = void 0; + function gl() { + K_a || (K_a = new J_a().a()); + return K_a; + } + function bl() { + el.call(this); + this.Xa = this.aa = null; + } + bl.prototype = new BXa(); + bl.prototype.constructor = bl; + function Mqa(a10, b10) { + var c10 = B6(a10.aa, al().Tt), e10 = K7(); + b10 = c10.yg(b10, e10.u); + c10 = al().Tt; + e10 = Zr(new $r(), b10, new P6().a()); + Vd(a10, c10, e10); + return b10; + } + function TBa(a10, b10) { + var c10 = al().Tt; + b10 = Zr(new $r(), b10, new P6().a()); + Vd(a10, c10, b10); + return a10; + } + d7 = bl.prototype; + d7.bc = function() { + return al(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.Y = function() { + return this.aa; + }; + function L_a(a10) { + var b10 = rt(pt(a10.aa), w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = f10.ma(); + var g10 = al().Tt; + return !(null === f10 ? null === g10 : ra(f10, g10)); + }; + }(a10))), c10 = a10.Xa; + b10 = new bl().K(b10, Yi(O7(), c10)); + b10 = Rd(b10, a10.j); + null !== a10.j && Rd(b10, a10.j); + c10 = B6(a10.aa, al().Tt); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.VJ(); + }; + }(a10)); + var e10 = K7(); + TBa(b10, c10.ka(a10, e10.u)); + return b10; + } + d7.YL = function(a10, b10, c10) { + var e10 = B6(this.aa, al().Tt); + a10 = w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + return l10.YL(g10, h10, k10); + }; + }(this, a10, b10, c10)); + b10 = K7(); + e10 = e10.ka(a10, b10.u); + return TBa(this, e10); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + el.prototype.dq.call(this, b10); + return this; + }; + d7.VJ = function() { + return L_a(this); + }; + d7.$classData = r8({ Mza: 0 }, false, "amf.core.model.domain.ArrayNode", { Mza: 1, IY: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function pB() { + this.dF = this.la = null; + } + pB.prototype = new u7(); + pB.prototype.constructor = pB; + d7 = pB.prototype; + d7.vi = function(a10, b10) { + this.la = a10; + this.dF = b10; + return this; + }; + d7.H = function() { + return "ElementTree"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pB && this.la === a10.la) { + var b10 = this.dF; + a10 = a10.dF; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.dF; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Pza: 0 }, false, "amf.core.model.domain.ElementTree", { Pza: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function CXa() { + this.Rh = null; + } + CXa.prototype = new u7(); + CXa.prototype.constructor = CXa; + d7 = CXa.prototype; + d7.H = function() { + return "Graph"; + }; + d7.E = function() { + return 1; + }; + function tO(a10, b10, c10) { + var e10 = a10.Rh; + c10 = Zr(new $r(), c10, new P6().a()); + a10 = QDa(a10, b10); + Rg(e10, b10, c10, a10); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof CXa) { + var b10 = this.Rh; + a10 = a10.Rh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Rh; + default: + throw new U6().e("" + a10); + } + }; + function c_a(a10) { + var b10 = a10.Rh.bc().Kb(); + a10 = /* @__PURE__ */ function() { + return function(g10) { + return ic(g10); + }; + }(a10); + var c10 = ii().u; + if (c10 === ii().u) + if (b10 === H10()) + a10 = H10(); + else { + c10 = b10.ga(); + var e10 = c10 = ji(a10(c10), H10()); + for (b10 = b10.ta(); b10 !== H10(); ) { + var f10 = b10.ga(); + f10 = ji(a10(f10), H10()); + e10 = e10.Nf = f10; + b10 = b10.ta(); + } + a10 = c10; + } + else { + for (c10 = se4(b10, c10); !b10.b(); ) + e10 = b10.ga(), c10.jd(a10(e10)), b10 = b10.ta(); + a10 = c10.Rc(); + } + return a10.fj(); + } + d7.t = function() { + return V5(W5(), this); + }; + function ODa(a10, b10, c10) { + var e10 = a10.Rh; + c10 = c10.r; + a10 = QDa(a10, b10); + Rg(e10, b10, c10, a10); + } + function NDa(a10) { + var b10 = a10.Rh.Y().vb, c10 = mz(); + c10 = Ua(c10); + var e10 = Id().u; + b10 = Jd(b10, c10, e10); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return ic(f10.Lc.r); + }; + }(a10)); + c10 = Xd(); + return b10.ka(a10, c10.u).ke(); + } + function b_a(a10, b10) { + var c10 = a10.Rh.Y().vb, e10 = mz(); + e10 = Ua(e10); + var f10 = Id().u; + a10 = Jd(c10, e10, f10).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return ic(k10.Lc.r) === ic(RB(F6(), h10)); + }; + }(a10, b10))); + if (a10 instanceof z7) { + a10 = a10.i.r.r; + if (a10 instanceof jh) { + ii(); + a10 = [a10.r]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + return a10 instanceof $r && a10.wb.Da() ? a10.wb.ua() : H10(); + } + if (y7() === a10) + return H10(); + throw new x7().d(a10); + } + function QDa(a10, b10) { + a10 = a10.Rh.Y().vb.Ja(b10); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.x)); + return a10.b() ? (O7(), new P6().a()) : a10.c(); + } + function a_a(a10, b10) { + var c10 = a10.Rh.Y().vb, e10 = mz(); + e10 = Ua(e10); + var f10 = Id().u; + b10 = Jd(c10, e10, f10).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return ic(k10.Lc.r) === ic(RB(F6(), h10)); + }; + }(a10, b10))); + if (b10 instanceof z7) { + b10 = b10.i.r.r; + if (Rk(b10)) { + ii(); + a10 = [b10]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + return b10 instanceof $r && b10.wb.Da() && Rk(b10.wb.ga()) ? (b10 = b10.wb, a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10; + }; + }(a10)), c10 = K7(), b10.ka(a10, c10.u).ua()) : H10(); + } + if (y7() === b10) + return H10(); + throw new x7().d(b10); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Rza: 0 }, false, "amf.core.model.domain.Graph", { Rza: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function ns() { + el.call(this); + this.MB = this.Xa = this.aa = null; + } + ns.prototype = new BXa(); + ns.prototype.constructor = ns; + function M_a() { + } + d7 = M_a.prototype = ns.prototype; + d7.bc = function() { + return os(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.Y = function() { + return this.aa; + }; + function QM(a10, b10) { + a10.MB = new z7().d(b10); + return a10; + } + d7.YL = function() { + return this; + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + el.prototype.dq.call(this, b10); + this.MB = y7(); + return this; + }; + d7.VJ = function() { + var a10 = pt(this.aa), b10 = this.Xa; + a10 = new ns().K(a10, Yi(O7(), b10)); + a10 = Rd(a10, this.j); + a10.MB = this.MB; + return a10; + }; + d7.$classData = r8({ Gga: 0 }, false, "amf.core.model.domain.LinkNode", { Gga: 1, IY: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function Xk() { + el.call(this); + this.ina = this.Xa = this.aa = null; + } + Xk.prototype = new BXa(); + Xk.prototype.constructor = Xk; + d7 = Xk.prototype; + d7.bc = function() { + return this.ina; + }; + d7.fa = function() { + return this.Xa; + }; + function N_a(a10) { + var b10 = pt(a10.aa), c10 = a10.Xa; + b10 = new Xk().K(b10, Yi(O7(), c10)); + null !== a10.j && Rd(b10, a10.j); + c10 = ls(a10); + var e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return hd(g10.aa, h10).ua(); + }; + }(a10)), f10 = Xd(); + c10.bd(e10, f10.u).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.r; + k10 = k10.Lc; + var m10 = l10.r.VJ(); + return Rg(h10, k10, m10, l10.x); + }; + }(a10, b10))); + return b10; + } + function ls(a10) { + var b10 = a10.aa.vb, c10 = mz(); + c10 = Ua(c10); + var e10 = Id().u; + b10 = Jd(b10, c10, e10); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + if (null !== f10) { + f10 = f10.Lc; + dea(); + var g10 = dl().g; + if (!Cg(g10, f10)) + return new z7().d(f10).ua(); + } + return y7().ua(); + }; + }(a10)); + c10 = Xd(); + return b10.bd(a10, c10.u); + } + d7.Y = function() { + return this.aa; + }; + function O_a(a10) { + var b10 = ls(a10); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = uCa(new je4().e(f10.r.$)); + f10 = ar(e10.aa, f10); + return new R6().M(g10, f10); + }; + }(a10)); + var c10 = Xd(); + return b10.ka(a10, c10.u).Ch(Gb().si); + } + d7.YL = function(a10, b10, c10) { + ls(this).U(w6(/* @__PURE__ */ function(e10, f10, g10, h10) { + return function(k10) { + var l10 = uCa(new je4().e(k10.r.$)), m10 = Ed(ua(), l10, "?") ? l10.substring(0, -1 + (l10.length | 0) | 0) : l10; + m10 = f10.Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + return C10.la === D10; + }; + }(e10, m10))); + var p10 = hd(e10.aa, k10); + if (p10 instanceof z7 && (p10 = p10.i, null !== p10)) { + p10 = p10.r; + var t10 = p10.r; + if (m10.b()) + var v10 = y7(); + else + v10 = m10.c(), v10 = new z7().d(v10.dF); + m10 = t10.YL(g10, v10.b() ? H10() : v10.c(), Ed(ua(), l10, "?") && m10.b() ? w6(/* @__PURE__ */ function() { + return function() { + }; + }(e10)) : h10); + it2(e10.aa, k10); + return oC(e10, Gia(Fu(), l10, g10, h10), m10, p10.x); + } + }; + }(this, b10, a10, c10))); + return this; + }; + function P_a(a10) { + var b10 = dl(), c10 = F6().Pg, e10 = new je4().e(a10); + e10 = jj(e10.td); + return rb(new sb(), b10, G5(c10, e10), tb(new ub(), vb().Pg, a10, "", H10())); + } + function Nqa(a10, b10, c10, e10) { + f22(c10, a10.j, J5(K7(), H10())); + Rg(a10, b10, c10, e10); + return a10; + } + function oC(a10, b10, c10, e10) { + var f10 = F6().Pg.he; + 0 === (b10.indexOf(f10) | 0) && (f10 = F6().Pg.he, b10 = b10.split(f10).join("")); + Nqa(a10, P_a(b10), c10, e10); + return a10; + } + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + el.prototype.dq.call(this, b10); + this.ina = new Q_a().aE(this); + return this; + }; + d7.VJ = function() { + return N_a(this); + }; + d7.$classData = r8({ Tza: 0 }, false, "amf.core.model.domain.ObjectNode", { Tza: 1, IY: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function Vi() { + el.call(this); + this.Xa = this.aa = null; + } + Vi.prototype = new BXa(); + Vi.prototype.constructor = Vi; + d7 = Vi.prototype; + d7.bc = function() { + return Wi(); + }; + d7.fa = function() { + return this.Xa; + }; + function jha(a10, b10) { + var c10 = Wi().af, e10 = vs(); + b10 = Uh().zj === b10 ? e10.fqa : Uh().hi === b10 ? e10.oma : Uh().Xo === b10 ? e10.RB : Uh().mr === b10 ? e10.ana : Uh().Nh === b10 ? e10.jka : Uh().of === b10 ? e10.Lka : Uh().TC === b10 ? e10.Nja : Uh().Mi === b10 ? e10.mja : Uh().jo === b10 ? e10.vr : Uh().hw === b10 ? e10.nC : Uh().tj === b10 ? e10.Kja : Uh().NA === b10 ? e10.Lja : Uh().Ly === b10 ? e10.Ika : Uh().rx === b10 ? e10.nja : Uh().MA === b10 ? e10.jja : Uh().bB === b10 ? e10.coa : Uh().Yr === b10 ? e10.aja : Uh().zp === b10 ? e10.bja : Uh().aB === b10 ? e10.uH : ih(new jh(), b10, (O7(), new P6().a())); + Vd(a10, c10, b10); + } + d7.Y = function() { + return this.aa; + }; + function Tia(a10, b10, c10) { + var e10 = Wi().vf; + Vd(a10, e10, ih(new jh(), b10, c10)); + } + d7.YL = function(a10, b10, c10) { + return Sia(Fu(), this, a10, c10); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + el.prototype.dq.call(this, b10); + return this; + }; + d7.VJ = function() { + var a10 = pt(this.aa), b10 = this.Xa; + a10 = new Vi().K(a10, Yi(O7(), b10)); + return Rd(a10, this.j); + }; + d7.$classData = r8({ $za: 0 }, false, "amf.core.model.domain.ScalarNode", { $za: 1, IY: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function n32() { + this.j = this.Ke = this.g = null; + this.xa = false; + } + n32.prototype = new u7(); + n32.prototype.constructor = n32; + function R_a() { + } + d7 = R_a.prototype = n32.prototype; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.dd = function() { + var a10 = B6(this.Y(), FY().R).A; + a10 = a10.b() ? "default-parametrized" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.kI = function() { + return B6(this.g, FY().Aj); + }; + function iRa(a10) { + return B6(a10.g, FY().te); + } + d7.Zg = function() { + return FY().R; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10) { + this.g = a10; + return this; + }; + function o32() { + this.r = this.$ = null; + } + o32.prototype = new u7(); + o32.prototype.constructor = o32; + d7 = o32.prototype; + d7.H = function() { + return "Variable"; + }; + d7.E = function() { + return 2; + }; + d7.Yd = function() { + return this.$; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof o32 ? this.$ === a10.$ ? this.r === a10.r : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.BI = function() { + return this.r; + }; + d7.z = function() { + return X5(this); + }; + d7.Haa = function(a10, b10) { + this.$ = a10; + this.r = b10; + return this; + }; + Object.defineProperty(o32.prototype, "value", { get: function() { + return this.BI(); + }, configurable: true }); + Object.defineProperty(o32.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + o32.prototype.$classData = r8({ jAa: 0 }, false, "amf.core.model.domain.templates.Variable", { jAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function mM() { + this.HN = this.IN = null; + this.Hm = false; + } + mM.prototype = new u7(); + mM.prototype.constructor = mM; + d7 = mM.prototype; + d7.H = function() { + return "DeclarationPromise"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mM) { + var b10 = this.IN, c10 = a10.IN; + return (null === b10 ? null === c10 : b10.h(c10)) && this.HN === a10.HN ? this.Hm === a10.Hm : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.IN; + case 1: + return this.HN; + case 2: + return this.Hm; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function OAa(a10, b10, c10) { + a10.IN = b10; + a10.HN = c10; + a10.Hm = false; + return a10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.IN)); + a10 = OJ().Ga(a10, NJ(OJ(), this.HN)); + a10 = OJ().Ga(a10, this.Hm ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ rAa: 0 }, false, "amf.core.parser.DeclarationPromise", { rAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function yha() { + this.lj = 0; + this.Lz = null; + } + yha.prototype = new u7(); + yha.prototype.constructor = yha; + d7 = yha.prototype; + d7.Ar = function(a10, b10) { + WAa(this, a10, b10); + }; + d7.yB = function(a10, b10) { + return YAa(this, a10, b10); + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + a10 = a10.j; + var h10 = Yb().dh; + EU(this, a10, b10, c10, e10, f10, h10, g10); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + EU(this, a10, b10, c10, e10, f10, g10, h10); + }; + d7.e1 = function(a10, b10) { + this.lj = a10; + this.Lz = b10; + return this; + }; + d7.$classData = r8({ uAa: 0 }, false, "amf.core.parser.DefaultParserSideErrorHandler", { uAa: 1, f: 1, a7: 1, zq: 1, Zp: 1, Bp: 1 }); + function S_a() { + this.r = this.Lc = null; + } + S_a.prototype = new u7(); + S_a.prototype.constructor = S_a; + d7 = S_a.prototype; + d7.H = function() { + return "FieldEntry"; + }; + function lh(a10, b10) { + var c10 = new S_a(); + c10.Lc = a10; + c10.r = b10; + return c10; + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof S_a) { + var b10 = this.Lc, c10 = a10.Lc; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.r === a10.r : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lc; + case 1: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function T_a(a10) { + var b10 = ih(new jh(), !aj(a10.r.r), a10.r.r.fa()); + b10 = kh(b10, a10.r.x); + return lh(a10.Lc, b10); + } + function YX(a10) { + var b10 = a10.r.r.wb; + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10; + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ AAa: 0 }, false, "amf.core.parser.FieldEntry", { AAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function p32() { + } + p32.prototype = new wLa(); + p32.prototype.constructor = p32; + p32.prototype.a = function() { + return this; + }; + p32.prototype.t = function() { + return "FieldEntry"; + }; + p32.prototype.ug = function(a10, b10) { + return lh(a10, b10); + }; + p32.prototype.$classData = r8({ BAa: 0 }, false, "amf.core.parser.FieldEntry$", { BAa: 1, Teb: 1, f: 1, cra: 1, q: 1, o: 1 }); + var U_a = void 0; + function mz() { + U_a || (U_a = new p32().a()); + return U_a; + } + function kD() { + this.da = this.ww = null; + } + kD.prototype = new u7(); + kD.prototype.constructor = kD; + d7 = kD.prototype; + d7.H = function() { + return "FragmentRef"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kD) { + var b10 = this.ww, c10 = a10.ww; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.da, a10 = a10.da, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function jD(a10, b10, c10) { + a10.ww = b10; + a10.da = c10; + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ww; + case 1: + return this.da; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ IAa: 0 }, false, "amf.core.parser.FragmentRef", { IAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Iq() { + this.ad = this.$n = this.Jd = null; + } + Iq.prototype = new u7(); + Iq.prototype.constructor = Iq; + d7 = Iq.prototype; + d7.H = function() { + return "ParsedReference"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Iq) { + var b10 = this.Jd, c10 = a10.Jd; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.$n, c10 = a10.$n, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.ad, a10 = a10.ad, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Jd; + case 1: + return this.$n; + case 2: + return this.ad; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Hq(a10, b10, c10, e10) { + a10.Jd = b10; + a10.$n = c10; + a10.ad = e10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NAa: 0 }, false, "amf.core.parser.ParsedReference", { NAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function BU() { + this.ms = this.$d = null; + } + BU.prototype = new u7(); + BU.prototype.constructor = BU; + function V_a() { + } + d7 = V_a.prototype = BU.prototype; + d7.H = function() { + return "Range"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof BU) { + var b10 = this.$d, c10 = a10.$d; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.ms, a10 = a10.ms, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return this.t(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$d; + case 1: + return this.ms; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return "[" + this.$d + "-" + this.ms + "]"; + }; + d7.fU = function(a10, b10) { + this.$d = a10; + this.ms = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + BU.prototype.contains = function(a10) { + return a10.$d.cf >= this.$d.cf && a10.ms.cf <= this.ms.cf; + }; + BU.prototype.toString = function() { + return this.sp(); + }; + BU.prototype.extent = function(a10) { + return new BU().fU(W_a(this.$d, a10.$d), X_a(this.ms, a10.ms)); + }; + Object.defineProperty(BU.prototype, "end", { get: function() { + return this.ms; + }, configurable: true }); + Object.defineProperty(BU.prototype, "start", { get: function() { + return this.$d; + }, configurable: true }); + BU.prototype.$classData = r8({ Kga: 0 }, false, "amf.core.parser.Range", { Kga: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y_a() { + this.vg = this.Ca = this.jP = null; + } + Y_a.prototype = new u7(); + Y_a.prototype.constructor = Y_a; + d7 = Y_a.prototype; + d7.H = function() { + return "RefContainer"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Y_a && this.jP === a10.jP && Bj(this.Ca, a10.Ca)) { + var b10 = this.vg; + a10 = a10.vg; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Z_a(a10, b10, c10) { + var e10 = new Y_a(); + e10.jP = a10; + e10.Ca = b10; + e10.vg = c10; + return e10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jP; + case 1: + return this.Ca; + case 2: + return this.vg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ RAa: 0 }, false, "amf.core.parser.RefContainer", { RAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function LN() { + this.Df = null; + } + LN.prototype = new u7(); + LN.prototype.constructor = LN; + function $_a() { + } + d7 = $_a.prototype = LN.prototype; + d7.a = function() { + this.Df = Rb(Ut(), H10()); + return this; + }; + d7.H = function() { + return "ReferenceCollector"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof LN && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function MN(a10, b10, c10, e10) { + var f10 = Hha(Lha(), b10); + if (null === f10) + throw new x7().d(f10); + b10 = f10.ma(); + f10 = f10.ya(); + var g10 = a10.Df.Ja(b10); + a: { + if (g10 instanceof z7) { + var h10 = g10.i; + if (null !== h10) { + a10.Df.jm(b10, a0a(h10, c10, e10, f10)); + break a; + } + } + if (y7() === g10) + a10 = a10.Df, VLa || (VLa = new DU().a()), g10 = K7(), c10 = new v22().vi(b10, J5(g10, new Ib().ha([Z_a(c10, e10, f10)]))), a10.Xh(new R6().M(b10, c10)); + else + throw new x7().d(g10); + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Lga: 0 }, false, "amf.core.parser.ReferenceCollector", { Lga: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q32() { + this.Jd = this.mO = null; + } + q32.prototype = new u7(); + q32.prototype.constructor = q32; + d7 = q32.prototype; + d7.H = function() { + return "ReferenceResolutionResult"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q32) { + var b10 = this.mO, c10 = a10.mO; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Jd, a10 = a10.Jd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.mO; + case 1: + return this.Jd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.bH = function(a10, b10) { + this.mO = a10; + this.Jd = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ XAa: 0 }, false, "amf.core.parser.ReferenceResolutionResult", { XAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function aO() { + this.Th = this.Ca = null; + } + aO.prototype = new u7(); + aO.prototype.constructor = aO; + d7 = aO.prototype; + d7.H = function() { + return "ValueNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof aO ? Bj(this.Ca, a10.Ca) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function kOa(a10) { + var b10 = a10.Ca, c10 = qTa(); + b10 = +N6(b10, c10, a10.Th); + return ih(new jh(), b10, b0a(a10)); + } + d7.Vb = function(a10, b10) { + this.Ca = a10; + this.Th = b10; + return this; + }; + d7.nf = function() { + var a10 = this.Ca, b10 = Dd(); + a10 = N6(a10, b10, this.Th); + return ih(new jh(), a10, b0a(this)); + }; + d7.z = function() { + return X5(this); + }; + function b0a(a10) { + return Od(O7(), a10.Ca.re()); + } + d7.Zf = function() { + var a10 = this.Ca, b10 = bc(); + a10 = N6(a10, b10, this.Th).va; + return ih(new jh(), a10, b0a(this)); + }; + d7.mE = function() { + var a10 = this.Ca, b10 = TAa(); + a10 = N6(a10, b10, this.Th) | 0; + return ih(new jh(), a10, b0a(this)); + }; + d7.Up = function() { + var a10 = this.Ca, b10 = pM(); + a10 = !!N6(a10, b10, this.Th); + return ih(new jh(), a10, b0a(this)); + }; + d7.$classData = r8({ iBa: 0 }, false, "amf.core.parser.ValueNode", { iBa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function c0a() { + this.lg = this.RS = this.lC = null; + } + c0a.prototype = new u7(); + c0a.prototype.constructor = c0a; + d7 = c0a.prototype; + d7.H = function() { + return "Node"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof c0a) { + if (this.lC === a10.lC) { + var b10 = this.RS, c10 = a10.RS; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.lg, a10 = a10.lg, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lC; + case 1: + return this.RS; + case 2: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function VM(a10) { + var b10 = pd(a10.lg); + return kz(b10).jC(Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + c10 = new qg().e(c10).ja; + return 0 < (c10 === e10 ? 0 : c10 < e10 ? -1 : 1); + }; + }(a10))); + } + function KM(a10, b10) { + b10 = a10.lg.Ja(b10); + if (b10.b()) + return y7(); + b10 = b10.c(); + return new z7().d(b10.jC(Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + c10 = c10.r; + e10 = e10.r; + return 0 < (c10 === e10 ? 0 : c10 < e10 ? -1 : 1); + }; + }(a10)))); + } + d7.z = function() { + return X5(this); + }; + function aJa(a10, b10, c10) { + var e10 = new c0a(); + e10.lC = a10; + e10.RS = b10; + e10.lg = c10; + return e10; + } + d7.$classData = r8({ oBa: 0 }, false, "amf.core.rdf.Node", { oBa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function GM() { + this.l = this.rda = this.dr = this.wc = null; + } + GM.prototype = new u7(); + GM.prototype.constructor = GM; + d7 = GM.prototype; + d7.hW = function(a10) { + this.rda = new z7().d(a10.j); + d0a(this, a10); + }; + function e0a(a10, b10, c10) { + var e10 = c10.Kb(); + c10 = /* @__PURE__ */ function() { + return function(k10) { + return ic(k10); + }; + }(a10); + var f10 = ii().u; + if (f10 === ii().u) + if (e10 === H10()) + c10 = H10(); + else { + f10 = e10.ga(); + var g10 = f10 = ji(c10(f10), H10()); + for (e10 = e10.ta(); e10 !== H10(); ) { + var h10 = e10.ga(); + h10 = ji(c10(h10), H10()); + g10 = g10.Nf = h10; + e10 = e10.ta(); + } + c10 = f10; + } + else { + for (f10 = se4(e10, f10); !e10.b(); ) + g10 = e10.ga(), f10.jd(c10(g10)), e10 = e10.ta(); + c10 = f10.Rc(); + } + for (; !c10.b(); ) + e10 = c10.ga(), f10 = a10.l.sm, g10 = F6().Qi, pE(f10, b10, ic(G5(g10, "type")), e10), c10 = c10.ta(); + } + d7.H = function() { + return "Emitter"; + }; + function f0a(a10, b10, c10, e10, f10) { + b10 = b10.fP ? hd(e10.Y(), b10) : y7(); + a: { + if (b10 instanceof z7 && (e10 = b10.i, null !== e10)) { + b10 = e10.Lc; + e10 = e10.r; + var g10 = ic(b10.r); + Nr(f10, g10, e10); + g0a(a10, c10, g10, b10.ba, e10); + break a; + } + if (y7() !== b10) + throw new x7().d(b10); + } + } + d7.E = function() { + return 1; + }; + function d0a(a10, b10) { + if (!a10.dr.to.Ha(b10.j) || h0a(a10, b10)) { + var c10 = b10.j; + Uca(a10.dr, c10); + var e10 = Sr(rc(), c10, b10), f10 = kb(b10); + e0a(a10, c10, f10, new z7().d(b10)); + var g10 = f10.Ub(); + if (AB(f10)) { + f10 = K7(); + var h10 = [ny(), nC()]; + f10 = J5(f10, new Ib().ha(h10)); + } else + f10 = H10(); + f10 = f10.Cb(w6(/* @__PURE__ */ function(m10) { + return function(p10) { + return !m10.wc.L0.P(p10); + }; + }(a10))); + h10 = ii(); + g10 = g10.ia(f10, h10.u); + if (b10 instanceof Xk && a10.wc.UW) { + f10 = F6().NM.he + "/properties"; + h10 = Ac(); + var k10 = ih(new jh(), ls(b10).jb(), new P6().a()); + O7(); + var l10 = new P6().a(); + g0a(a10, c10, f10, h10, kh(k10, l10)); + } + for (; !g10.b(); ) + f10 = g10.ga(), f0a(a10, f10, c10, b10, e10), g10 = g10.ta(); + i0a(a10, b10); + b10 = Ed( + ua(), + c10, + "/" + ) ? c10 + "source-map" : -1 !== (c10.indexOf("#") | 0) || 0 <= (c10.length | 0) && "null" === c10.substring(0, 4) ? c10 + "/source-map" : c10 + "#/source-map"; + j0a(a10, c10, e10, b10); + } + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof GM && a10.l === this.l ? this.wc === a10.wc : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + function k0a(a10, b10, c10, e10) { + pE(a10.l.sm, b10, c10, e10); + } + function l0a(a10, b10, c10, e10) { + pE(a10.l.sm, b10, c10, e10); + } + function m0a(a10, b10, c10) { + c10 = c10.x; + var e10 = Qr(); + e10 = zC(e10); + HN(c10, e10).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + a: { + if (null !== h10) { + var k10 = h10.ma(), l10 = h10.Ki(); + if (null !== k10) { + h10 = k10.ma(); + k10 = k10.ya(); + var m10 = Qr(); + m10 = zC(m10); + HN(k10, m10).U(w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + if (null !== D10) { + var C10 = D10.ma(), I10 = D10.Ki(); + if (null !== C10) { + D10 = C10.ma(); + C10 = C10.ya(); + I10 = t10 + "_" + v10 + "_" + I10; + var L10 = p10.l.sm, Y10 = F6().ez; + pE(L10, t10, ic(G5(Y10, A10)), I10); + pE(p10.l.sm, I10, ic(oc().ko.r), D10); + return oE(p10.l.sm, I10, ic(oc().vf.r), C10, y7()); + } + } + throw new x7().d(D10); + }; + }(f10, g10, l10, h10))); + break a; + } + } + throw new x7().d(h10); + } + }; + }(a10, b10))); + } + d7.t = function() { + return V5(W5(), this); + }; + function n0a(a10, b10, c10, e10) { + try { + var f10 = a10.l.sm, g10 = new qg().e(e10), h10 = Oj(va(), g10.ja); + oE(f10, b10, c10, "" + h10, new z7().d(Uh().Nh)); + } catch (k10) { + if (k10 instanceof dH) + oE(a10.l.sm, b10, c10, e10, y7()); + else + throw k10; + } + } + function j0a(a10, b10, c10, e10) { + a10.wc.pS && tc(c10.x) && (pE(a10.l.sm, b10, ic(nc().bb.r), e10), e0a(a10, e10, oc(), y7()), m0a(a10, e10, c10)); + } + function o0a(a10, b10, c10, e10) { + pE(a10.l.sm, b10, c10, e10.j); + d0a(a10, e10); + } + function i0a(a10, b10) { + var c10 = b10.j, e10 = J5(Ef(), H10()), f10 = hd(b10.Y(), Yd(nc())); + if (!f10.b()) + if (f10 = f10.c(), null !== f10) + f10 = f10.r.r, f10 instanceof $r && f10.wb.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + if (l10 instanceof Td) { + var m10 = B6(l10.g, Ud().ig).j; + Dg(h10, m10); + p0a(g10, k10, m10, l10, y7()); + } else + throw new x7().d(l10); + }; + }(a10, e10, c10))); + else + throw new x7().d(f10); + f10 = new lC().ue(1); + b10.Y().vb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10) { + return function(p10) { + if (null !== p10) { + var t10 = p10.ma(), v10 = p10.ya().r.fa(); + p10 = new q0a(); + v10 = v10.hf; + var A10 = Ef().u; + xs(v10, p10, A10).U(w6(/* @__PURE__ */ function(D10, C10, I10, L10, Y10, ia) { + return function(pa) { + pa = pa.cp; + var La = C10.j, ob = I10.oa, zb = B6(pa.g, Ud().R).A; + La = La + "/scalar-valued/" + ob + "/" + (zb.b() ? null : zb.c()); + Dg(L10, La); + js(ks(), La, B6(pa.g, Ud().zi)); + p0a(D10, Y10, La, pa, new z7().d(ia)); + I10.oa = 1 + I10.oa | 0; + }; + }(g10, h10, k10, l10, m10, t10))); + } else + throw new x7().d(p10); + }; + }(a10, b10, f10, e10, c10))); + if (e10.Da()) + for (b10 = e10.Dc; !b10.b(); ) + e10 = b10.ga(), k0a(a10, c10, ic(Yd(nc()).r), e10), b10 = b10.ta(); + } + function h0a(a10, b10) { + a10 = a10.rda; + return b10.j === (a10.b() ? "" : a10.c()) ? !vu(b10) : false; + } + function r0a(a10, b10, c10, e10) { + var f10 = Za(e10), g10 = Za(e10); + if (!g10.b()) { + g10 = g10.c(); + var h10 = db().pf; + eb(e10, h10, g10.j); + it2(e10.Y(), db().te); + } + pE(a10.l.sm, b10, c10, e10.j); + d0a(a10, e10); + f10.b() || (a10 = f10.c(), Ui(e10.Y(), db().te, a10, (O7(), new P6().a()))); + } + function s0a(a10, b10, c10, e10) { + try { + var f10 = a10.l.sm, g10 = new qg().e(e10), h10 = FD(ED(), g10.ja, 10); + oE(f10, b10, c10, "" + h10, new z7().d(Uh().mr)); + } catch (k10) { + if (k10 instanceof dH) + oE(a10.l.sm, b10, c10, e10, y7()); + else + throw k10; + } + } + function p0a(a10, b10, c10, e10, f10) { + pE(a10.l.sm, b10, c10, B6(e10.g, Ud().zi).j); + b10 = a10.l.sm; + var g10 = ic(Ud().R.r), h10 = B6(e10.g, Ud().R).A; + oE(b10, c10, g10, h10.b() ? null : h10.c(), y7()); + f10.b() || (f10 = f10.c(), pE(a10.l.sm, c10, ic(Ud().ko.r), ic(f10.r))); + d0a(a10, B6(e10.g, Ud().zi)); + } + function t0a(a10, b10, c10, e10, f10) { + f10 === Uh().hi ? oE(a10.l.sm, b10, c10, e10, new z7().d(Uh().mr)) : oE(a10.l.sm, b10, c10, e10, new z7().d(f10)); + } + d7.z = function() { + return X5(this); + }; + function g0a(a10, b10, c10, e10, f10) { + if (Rk(e10) && ut(e10) && Za(e10).na()) + r0a(a10, b10, c10, e10); + else if (Dr(e10)) + o0a(a10, b10, c10, f10.r); + else if (yc().h(e10)) + k0a(a10, b10, c10, f10.r.t()); + else if (zN().h(e10)) + l0a(a10, b10, c10, f10.r.t()); + else if (SM().h(e10)) + t0a(a10, b10, c10, f10.r.t(), Uh().zp); + else if (qb().h(e10)) + if (e10 = Ab(f10.x, q5(u0a)), e10 instanceof z7) + e10 = e10.i, t0a(a10, b10, c10, f10.r.t(), e10.Dj); + else { + if (y7() !== e10) + throw new x7().d(e10); + oE(a10.l.sm, b10, c10, f10.r.t(), y7()); + } + else if (zc().h(e10)) + oE(a10.l.sm, b10, c10, f10.r.t(), new z7().d(Uh().Mi)); + else if (Ac().h(e10)) + s0a(a10, b10, c10, f10.r.t()); + else if (hi().h(e10)) + oE(a10.l.sm, b10, c10, f10.r.t(), new z7().d(Uh().Nh)); + else if (et3().h(e10)) + n0a(a10, b10, c10, f10.r.t()); + else if (TM().h(e10)) + t0a(a10, b10, c10, f10.r.r.t(), Uh().tj); + else if (ZL().h(e10)) + f10 = f10.r.r, f10.Bt.na() || f10.Et.na() ? t0a(a10, b10, c10, f10.t(), Uh().tj) : t0a(a10, b10, c10, f10.t(), Uh().jo), void 0; + else if (e10 instanceof UM) + v0a(a10, b10, c10, f10.r.wb, e10.Fe); + else if (e10 instanceof xc) + f10.r.wb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + var p10 = l10.Fe; + O7(); + var t10 = new P6().a(); + g0a(g10, h10, k10, p10, kh(m10, t10)); + }; + }(a10, b10, c10, e10))); + else if (Bc() === e10) + if (e10 = f10.r.r, "boolean" === typeof e10) + oE(a10.l.sm, b10, c10, f10.r.t(), new z7().d(Uh().Mi)); + else if (Ca(e10)) + s0a(a10, b10, c10, f10.r.t()); + else if (na(e10)) + n0a( + a10, + b10, + c10, + f10.r.t() + ); + else if ("number" === typeof e10) + oE(a10.l.sm, b10, c10, f10.r.t(), new z7().d(Uh().Nh)); + else if (e10 = Ab(f10.x, q5(u0a)), e10 instanceof z7) + e10 = e10.i, t0a(a10, b10, c10, f10.r.t(), e10.Dj); + else { + if (y7() !== e10) + throw new x7().d(e10); + oE(a10.l.sm, b10, c10, f10.r.t(), y7()); + } + else + throw new x7().d(e10); + } + function v0a(a10, b10, c10, e10, f10) { + var g10 = b10 + "/list"; + b10 = pE(a10.l.sm, b10, c10, g10); + c10 = F6().Qi; + c10 = ic(G5(c10, "type")); + var h10 = F6().Ul; + pE(b10, g10, c10, ic(G5(h10, "Seq"))); + b10 = K7(); + e10.og(b10.u).U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + if (null !== p10) { + var t10 = p10.ma(); + p10 = p10.Ki(); + var v10 = F6().Ul; + p10 = ic(G5(v10, "_" + (1 + p10 | 0))); + O7(); + v10 = new P6().a(); + g0a(k10, l10, p10, m10, kh(t10, v10)); + } else + throw new x7().d(p10); + }; + }(a10, g10, f10))); + } + d7.$classData = r8({ sBa: 0 }, false, "amf.core.rdf.RdfModelEmitter$Emitter", { sBa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function kN() { + this.iT = null; + this.tm = 0; + this.l = null; + } + kN.prototype = new u7(); + kN.prototype.constructor = kN; + d7 = kN.prototype; + d7.H = function() { + return "Shortener"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kN && a10.l === this.l) { + var b10 = this.iT; + a10 = a10.iT; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + function lCa(a10, b10) { + var c10 = new qg().e(b10); + tc(c10) ? (c10 = a10.l.B_ + "#", c10 = !(0 <= (b10.length | 0) && b10.substring(0, c10.length | 0) === c10)) : c10 = false; + return c10 ? a10.iT.T0(b10, oq(/* @__PURE__ */ function(e10) { + return function() { + e10.tm = 1 + e10.tm | 0; + return e10.l.B_ + "#" + e10.tm; + }; + }(a10))) : b10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.iT; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function jCa(a10, b10, c10) { + a10.iT = c10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + a10.tm = -1; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ zCa: 0 }, false, "amf.core.resolution.stages.UrlShortenerStage$Shortener", { zCa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function lN() { + this.Fa = null; + } + lN.prototype = new OT(); + lN.prototype.constructor = lN; + lN.prototype.P = function(a10) { + return jCa(new kN(), this.Fa, a10); + }; + lN.prototype.t = function() { + return "Shortener"; + }; + lN.prototype.$classData = r8({ ACa: 0 }, false, "amf.core.resolution.stages.UrlShortenerStage$Shortener$", { ACa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function HM() { + this.eea = this.B8 = this.pq = this.to = this.Tea = null; + } + HM.prototype = new u7(); + HM.prototype.constructor = HM; + d7 = HM.prototype; + d7.a = function() { + this.Tea = J5(DB(), H10()); + this.to = vd(); + this.pq = J5(Gb().Qg, H10()); + this.B8 = J5(K7(), H10()); + this.eea = w6(/* @__PURE__ */ function() { + return function() { + return false; + }; + }(this)); + return this; + }; + d7.H = function() { + return "ModelTraversalRegistry"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof HM && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function Uca(a10, b10) { + a10.Tea.Tm(b10); + a10.to = a10.to.Zj(b10); + return a10; + } + function w0a(a10, b10, c10) { + a10.pq.Ha(b10.j) ? b10 = true : (b10 = B6(b10.aa, Ci().Ys).A, b10 = b10.b() ? "" : b10.c(), b10 = a10.pq.Ha(b10)); + return b10 ? true : c10.na() ? (c10 = c10.c(), a10.pq.Ha(c10)) : false; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ RCa: 0 }, false, "amf.core.traversal.ModelTraversalRegistry", { RCa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function rN() { + this.yM = this.ag = null; + } + rN.prototype = new u7(); + rN.prototype.constructor = rN; + d7 = rN.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.$a = function() { + return this.iq(); + }; + d7.im = function() { + return this; + }; + d7.iq = function() { + var a10 = this.ag.ga(); + this.ag = this.ag.ta(); + this.oS(); + return a10; + }; + d7.b = function() { + return !this.Ya(); + }; + d7.ua = function() { + var a10 = ii().u; + return TJ(this, a10); + }; + d7.bQ = function(a10) { + return this.iC(0, 0 < a10 ? a10 : 0); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.t = function() { + return ""; + }; + d7.iC = function(a10, b10) { + return fLa(this, a10, b10); + }; + d7.U = function(a10) { + yT(this, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.oS = function() { + a: + for (; ; ) { + if (tc(this.ag)) { + var a10 = this.ag.ga(); + this.ag = this.ag.ta(); + if (lb(a10)) { + var b10 = a10; + if (this.yM.Ha(b10.j)) + continue a; + var c10 = b10.Y().vb, e10 = mz(); + e10 = Ua(e10); + var f10 = Id().u; + c10 = Jd(c10, e10, f10); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.r.r; + }; + }(this)); + f10 = Xd(); + c10 = c10.ka(e10, f10.u); + this.yM.Tm(b10.j); + b10 = c10.ua(); + c10 = this.ag; + e10 = ii(); + b10 = b10.ia(c10, e10.u); + this.ag = ji(a10, b10); + } else + a10 instanceof $r ? (b10 = a10.wb.ua(), c10 = this.ag, e10 = ii(), b10 = b10.ia(c10, e10.u), this.ag = ji(a10, b10)) : this.ag = ji(a10, this.ag); + } + break; + } + }; + d7.DI = function(a10) { + return gLa(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return TJ(this, a10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.Mj = function() { + var a10 = b32().u; + return TJ(this, a10); + }; + d7.Ya = function() { + return tc(this.ag); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.Maa = function(a10, b10) { + this.ag = a10; + this.yM = b10; + }; + d7.Dd = function() { + return Xv(this); + }; + d7.op = function() { + return Xv(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.bL = function(a10) { + rN.prototype.Maa.call(this, a10, J5(DB(), H10())); + this.oS(); + return this; + }; + d7.ke = function() { + return Xv(this); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return TJ(this, a10); + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + iLa(this, a10, b10, c10); + }; + d7.Do = function() { + return false; + }; + d7.OD = function(a10) { + return jLa(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()); ; ) + if (tc(this.ag)) { + var b10 = this.iq(); + WA(a10, b10); + } else + break; + return a10.eb; + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.$classData = r8({ SCa: 0 }, false, "amf.core.traversal.iterator.AmfElementIterator", { SCa: 1, f: 1, UCa: 1, Ii: 1, Qb: 1, Pb: 1 }); + function tN() { + this.yM = this.ag = null; + } + tN.prototype = new u7(); + tN.prototype.constructor = tN; + d7 = tN.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.$a = function() { + return this.iq(); + }; + d7.im = function() { + return this; + }; + d7.iq = function() { + var a10 = this.ag.ga(); + this.ag = this.ag.ta(); + this.oS(); + return a10; + }; + d7.b = function() { + return !this.Ya(); + }; + d7.ua = function() { + var a10 = ii().u; + return TJ(this, a10); + }; + d7.bQ = function(a10) { + return this.iC(0, 0 < a10 ? a10 : 0); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.t = function() { + return ""; + }; + d7.iC = function(a10, b10) { + return fLa(this, a10, b10); + }; + d7.U = function(a10) { + yT(this, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.oS = function() { + a: + for (; ; ) { + if (tc(this.ag)) { + var a10 = this.ag.ga(); + this.ag = this.ag.ta(); + if (!lb(a10)) { + if (a10 instanceof $r) { + a10 = a10.wb.ua(); + var b10 = this.ag, c10 = ii(); + this.ag = a10.ia(b10, c10.u); + continue a; + } + continue a; + } + if (this.yM.Ha(a10.j)) + continue a; + b10 = a10.Y().vb; + c10 = mz(); + c10 = Ua(c10); + var e10 = Id().u; + b10 = Jd(b10, c10, e10); + c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.r.r; + }; + }(this)); + e10 = Xd(); + b10 = b10.ka(c10, e10.u).ua(); + this.yM.Tm(a10.j); + if (!Rk(a10)) { + a10 = this.ag; + c10 = ii(); + this.ag = b10.ia(a10, c10.u); + continue a; + } + c10 = this.ag; + e10 = ii(); + b10 = b10.ia(c10, e10.u); + this.ag = ji(a10, b10); + } + break; + } + }; + d7.DI = function(a10) { + return gLa(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return TJ(this, a10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.Mj = function() { + var a10 = b32().u; + return TJ(this, a10); + }; + d7.Ya = function() { + return tc(this.ag); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.Maa = function(a10, b10) { + this.ag = a10; + this.yM = b10; + }; + d7.Dd = function() { + return Xv(this); + }; + d7.op = function() { + return Xv(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.bL = function(a10) { + tN.prototype.Maa.call(this, a10, J5(DB(), H10())); + this.oS(); + return this; + }; + d7.ke = function() { + return Xv(this); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return TJ(this, a10); + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + iLa(this, a10, b10, c10); + }; + d7.Do = function() { + return false; + }; + d7.OD = function(a10) { + return jLa(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()); ; ) + if (tc(this.ag)) { + var b10 = this.iq(); + WA(a10, b10); + } else + break; + return a10.eb; + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.$classData = r8({ VCa: 0 }, false, "amf.core.traversal.iterator.DomainElementIterator", { VCa: 1, f: 1, UCa: 1, Ii: 1, Qb: 1, Pb: 1 }); + function Gv() { + this.MH = this.OH = null; + } + Gv.prototype = new u7(); + Gv.prototype.constructor = Gv; + d7 = Gv.prototype; + d7.Hc = function(a10, b10) { + this.OH = a10; + this.MH = b10; + return this; + }; + d7.H = function() { + return "Container"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Gv ? this.OH === a10.OH && this.MH === a10.MH : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.OH; + case 1: + return this.MH; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $Ca: 0 }, false, "amf.core.utils.InflectorBase$Container", { $Ca: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function GU() { + this.$ = this.FP = null; + this.Zaa = false; + } + GU.prototype = new u7(); + GU.prototype.constructor = GU; + d7 = GU.prototype; + d7.Hc = function(a10, b10) { + this.FP = a10; + this.$ = b10; + var c10 = new qg().e(a10); + this.Zaa = tc(c10); + if (null === a10) + throw new sf().a(); + if ("" === a10 && null === b10) + throw new sf().a(); + return this; + }; + d7.H = function() { + return "QName"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof GU ? this.FP === a10.FP && this.$ === a10.$ : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.FP; + case 1: + return this.$; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ gDa: 0 }, false, "amf.core.utils.package$QName", { gDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function bq() { + this.pB = false; + this.ll = this.Em = this.oi = null; + this.IX = 0; + } + bq.prototype = new u7(); + bq.prototype.constructor = bq; + d7 = bq.prototype; + d7.H = function() { + return "AMFValidationReport"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bq) { + if (this.pB === a10.pB && this.oi === a10.oi) { + var b10 = this.Em, c10 = a10.Em; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.ll, a10 = a10.ll, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pB; + case 1: + return this.oi; + case 2: + return this.Em; + case 3: + return this.ll; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return qfa(this, this.IX); + }; + function x0a(a10, b10, c10, e10) { + c10 = c10.Ja(e10); + if (c10 instanceof z7) + c10 = c10.i, Vj(b10, "\nLevel: " + e10 + "\n"), c10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return Wj(g10, h10); + }; + }(a10, b10))); + else if (y7() !== c10) + throw new x7().d(c10); + } + function aq(a10, b10, c10, e10, f10) { + a10.pB = b10; + a10.oi = c10; + a10.Em = e10; + a10.ll = f10; + a10.IX = 30; + return a10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.pB ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.oi)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Em)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ll)); + return OJ().fe(a10, 4); + }; + function qfa(a10, b10) { + ue4(); + var c10 = new Tj().a(); + b10 = a10.ll.Jk(b10); + TC(); + var e10 = Gb().si; + b10 = b10.nk(UC(e10)).am(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.zm; + }; + }(a10))); + Vj(c10, "Model: " + a10.oi + "\n"); + Vj(c10, "Profile: " + a10.Em.Ll + "\n"); + Vj(c10, "Conforms? " + a10.pB + "\n"); + Vj(c10, "Number of results: " + a10.ll.Oa() + "\n"); + x0a(a10, c10, b10, Yb().qb); + x0a(a10, c10, b10, Yb().dh); + x0a(a10, c10, b10, Yb().zx); + return c10.Ef.qf; + } + d7.$classData = r8({ lDa: 0 }, false, "amf.core.validation.AMFValidationReport", { lDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Yp() { + this.ll = this.vg = null; + } + Yp.prototype = new u7(); + Yp.prototype.constructor = Yp; + d7 = Yp.prototype; + d7.H = function() { + return "PayloadParsingResult"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Yp) { + var b10 = this.vg, c10 = a10.vg; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.ll, a10 = a10.ll, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vg; + case 1: + return this.ll; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function mfa(a10, b10, c10) { + a10.vg = b10; + a10.ll = c10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qDa: 0 }, false, "amf.core.validation.PayloadParsingResult", { qDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function y0a() { + this.le = this.pa = null; + } + y0a.prototype = new u7(); + y0a.prototype.constructor = y0a; + d7 = y0a.prototype; + d7.H = function() { + return "ValidationCandidate"; + }; + d7.E = function() { + return 2; + }; + function aC(a10, b10) { + var c10 = new y0a(); + c10.pa = a10; + c10.le = b10; + return c10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof y0a) { + var b10 = this.pa, c10 = a10.pa; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.le, a10 = a10.le, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.le; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tDa: 0 }, false, "amf.core.validation.ValidationCandidate", { tDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q_a() { + this.vo = this.Gz = null; + } + q_a.prototype = new u7(); + q_a.prototype.constructor = q_a; + d7 = q_a.prototype; + d7.H = function() { + return "ValidationShapeSet"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q_a) { + var b10 = this.Gz, c10 = a10.Gz; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.vo === a10.vo : false; + } + return false; + }; + function p_a(a10, b10, c10) { + a10.Gz = b10; + a10.vo = c10; + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Gz; + case 1: + return this.vo; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uDa: 0 }, false, "amf.core.validation.ValidationShapeSet", { uDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function z0a() { + this.LU = this.zh = this.xK = this.xi = this.nG = this.Ld = null; + } + z0a.prototype = new u7(); + z0a.prototype.constructor = z0a; + d7 = z0a.prototype; + d7.H = function() { + return "FunctionConstraint"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof z0a) { + var b10 = this.Ld, c10 = a10.Ld; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.nG, c10 = a10.nG, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.xi, c10 = a10.xi, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.xK, c10 = a10.xK, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.zh, c10 = a10.zh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.LU, a10 = a10.LU, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ld; + case 1: + return this.nG; + case 2: + return this.xi; + case 3: + return this.xK; + case 4: + return this.zh; + case 5: + return this.LU; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function zHa(a10, b10, c10, e10, f10, g10) { + var h10 = new z0a(); + h10.Ld = a10; + h10.nG = b10; + h10.xi = c10; + h10.xK = e10; + h10.zh = f10; + h10.LU = g10; + return h10; + } + function xra(a10, b10) { + a10 = a10.xK; + if (a10 instanceof z7) + return a10.i; + b10 = Mc(ua(), b10, "/"); + b10 = Oc(new Pc().fd(b10)); + b10 = Mc(ua(), b10, "#"); + return Oc(new Pc().fd(b10)).split("-").join("_").split(".").join("_") + "FnName"; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vDa: 0 }, false, "amf.core.validation.core.FunctionConstraint", { vDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function iR() { + this.r = this.gu = null; + } + iR.prototype = new u7(); + iR.prototype.constructor = iR; + d7 = iR.prototype; + d7.Hc = function(a10, b10) { + this.gu = a10; + this.r = b10; + return this; + }; + d7.H = function() { + return "NodeConstraint"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof iR ? this.gu === a10.gu && this.r === a10.r : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gu; + case 1: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wDa: 0 }, false, "amf.core.validation.core.NodeConstraint", { wDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function A0a() { + this.Mq = this.Cj = this.hn = this.fn = this.Dj = this.Ca = this.hq = this.zk = this.Bk = this.yk = this.Ak = this.gq = this.Lp = this.kl = this.Kp = this.Gr = this.hh = this.Ld = this.$ = this.Jj = null; + } + A0a.prototype = new u7(); + A0a.prototype.constructor = A0a; + d7 = A0a.prototype; + d7.H = function() { + return "PropertyConstraint"; + }; + function EO(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10, L10, Y10, ia) { + var pa = new A0a(); + pa.Jj = a10; + pa.$ = b10; + pa.Ld = c10; + pa.hh = e10; + pa.Gr = f10; + pa.Kp = g10; + pa.kl = h10; + pa.Lp = k10; + pa.gq = l10; + pa.Ak = m10; + pa.yk = p10; + pa.Bk = t10; + pa.zk = v10; + pa.hq = A10; + pa.Ca = D10; + pa.Dj = C10; + pa.fn = I10; + pa.hn = L10; + pa.Cj = Y10; + pa.Mq = ia; + return pa; + } + d7.E = function() { + return 20; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof A0a) { + if (this.Jj === a10.Jj && this.$ === a10.$) { + var b10 = this.Ld, c10 = a10.Ld; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.hh, c10 = a10.hh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Gr, c10 = a10.Gr, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Kp, c10 = a10.Kp, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.kl, c10 = a10.kl, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Lp, c10 = a10.Lp, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.gq, c10 = a10.gq, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ak, c10 = a10.Ak, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.yk, c10 = a10.yk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Bk, c10 = a10.Bk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.zk, c10 = a10.zk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.hq, c10 = a10.hq, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ca, c10 = a10.Ca, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Dj, c10 = a10.Dj, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.fn, c10 = a10.fn, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.hn, c10 = a10.hn, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Cj, c10 = a10.Cj, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Mq, a10 = a10.Mq, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Jj; + case 1: + return this.$; + case 2: + return this.Ld; + case 3: + return this.hh; + case 4: + return this.Gr; + case 5: + return this.Kp; + case 6: + return this.kl; + case 7: + return this.Lp; + case 8: + return this.gq; + case 9: + return this.Ak; + case 10: + return this.yk; + case 11: + return this.Bk; + case 12: + return this.zk; + case 13: + return this.hq; + case 14: + return this.Ca; + case 15: + return this.Dj; + case 16: + return this.fn; + case 17: + return this.hn; + case 18: + return this.Cj; + case 19: + return this.Mq; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xDa: 0 }, false, "amf.core.validation.core.PropertyConstraint", { xDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function B0a() { + this.KE = this.Bf = this.kT = this.ZW = this.WT = this.YW = this.RJ = this.$ = null; + } + B0a.prototype = new u7(); + B0a.prototype.constructor = B0a; + d7 = B0a.prototype; + d7.H = function() { + return "ValidationProfile"; + }; + d7.E = function() { + return 8; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof B0a) { + var b10 = this.$, c10 = a10.$; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.RJ, c10 = a10.RJ, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.YW, c10 = a10.YW, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.WT, c10 = a10.WT, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.ZW, c10 = a10.ZW, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.kT, c10 = a10.kT, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Bf, c10 = a10.Bf, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.KE, a10 = a10.KE, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.RJ; + case 2: + return this.YW; + case 3: + return this.WT; + case 4: + return this.ZW; + case 5: + return this.kT; + case 6: + return this.Bf; + case 7: + return this.KE; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function AEa(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new B0a(); + l10.$ = a10; + l10.RJ = b10; + l10.YW = c10; + l10.WT = e10; + l10.ZW = f10; + l10.kT = g10; + l10.Bf = h10; + l10.KE = k10; + return l10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yDa: 0 }, false, "amf.core.validation.core.ValidationProfile", { yDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function rj() { + this.j = this.Cj = this.Bw = this.Iz = this.QB = this.my = this.jy = this.xy = this.Lx = this.vy = this.Jv = this.Hv = this.At = this.vv = this.yv = this.Ld = this.$ = null; + } + rj.prototype = new u7(); + rj.prototype.constructor = rj; + d7 = rj.prototype; + d7.H = function() { + return "ValidationSpecification"; + }; + d7.E = function() { + return 16; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rj) { + if (this.$ === a10.$ && this.Ld === a10.Ld) { + var b10 = this.yv, c10 = a10.yv; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.vv, c10 = a10.vv, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.At, c10 = a10.At, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hv, c10 = a10.Hv, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Jv, c10 = a10.Jv, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.vy, c10 = a10.vy, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Lx, c10 = a10.Lx, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.xy, c10 = a10.xy, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.jy, c10 = a10.jy, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.my, c10 = a10.my, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.QB, c10 = a10.QB, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Iz, c10 = a10.Iz, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Bw, c10 = a10.Bw, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Cj, a10 = a10.Cj, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.Ld; + case 2: + return this.yv; + case 3: + return this.vv; + case 4: + return this.At; + case 5: + return this.Hv; + case 6: + return this.Jv; + case 7: + return this.vy; + case 8: + return this.Lx; + case 9: + return this.xy; + case 10: + return this.jy; + case 11: + return this.my; + case 12: + return this.QB; + case 13: + return this.Iz; + case 14: + return this.Bw; + case 15: + return this.Cj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Xaa(a10) { + if (a10.At.Da()) { + a10 = a10.At.ga(); + var b10 = oj().P7; + return null === a10 ? null === b10 : ra(a10, b10); + } + return false; + } + d7.z = function() { + return X5(this); + }; + function qj(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10, A10, D10, C10, I10) { + a10.$ = b10; + a10.Ld = c10; + a10.yv = e10; + a10.vv = f10; + a10.At = g10; + a10.Hv = h10; + a10.Jv = k10; + a10.vy = l10; + a10.Lx = m10; + a10.xy = p10; + a10.jy = t10; + a10.my = v10; + a10.QB = A10; + a10.Iz = D10; + a10.Bw = C10; + a10.Cj = I10; + 0 <= (b10.length | 0) && "http://" === b10.substring(0, 7) || 0 <= (b10.length | 0) && "https://" === b10.substring(0, 8) || 0 <= (b10.length | 0) && "file:" === b10.substring(0, 5) || (b10 = ic($v(F6(), b10)), 0 <= (b10.length | 0) && "http://" === b10.substring(0, 7) || 0 <= (b10.length | 0) && "https://" === b10.substring(0, 8) || 0 <= (b10.length | 0) && "file:" === b10.substring(0, 5) || (c10 = F6().Pg, b10 = ic(G5(c10, b10)))); + a10.j = b10; + return a10; + } + d7.$classData = r8({ BDa: 0 }, false, "amf.core.validation.core.ValidationSpecification", { BDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function sL() { + this.he = null; + } + sL.prototype = new u7(); + sL.prototype.constructor = sL; + d7 = sL.prototype; + d7.H = function() { + return "Namespace"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof sL ? this.he === a10.he : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.he; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.he = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DDa: 0 }, false, "amf.core.vocabulary.Namespace", { DDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function C0a() { + this.$ = this.yu = null; + } + C0a.prototype = new u7(); + C0a.prototype.constructor = C0a; + d7 = C0a.prototype; + d7.H = function() { + return "ValueType"; + }; + function G5(a10, b10) { + var c10 = new C0a(); + c10.yu = a10; + c10.$ = b10; + return c10; + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof C0a) { + var b10 = this.yu, c10 = a10.yu; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.$ === a10.$ : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yu; + case 1: + return this.$; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function ic(a10) { + return "" + a10.yu.he + a10.$; + } + d7.$classData = r8({ GDa: 0 }, false, "amf.core.vocabulary.ValueType", { GDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function j22() { + this.NH = this.lH = null; + } + j22.prototype = new u7(); + j22.prototype.constructor = j22; + d7 = j22.prototype; + d7.H = function() { + return "Environment"; + }; + function IXa(a10, b10, c10) { + a10.lH = b10; + a10.NH = c10; + return a10; + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof j22) { + var b10 = this.lH, c10 = a10.lH; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.NH, a10 = a10.NH, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lH; + case 1: + return this.NH; + default: + throw new U6().e("" + a10); + } + }; + function SZa(a10, b10) { + return IXa(new j22(), a10.lH, new z7().d(b10)); + } + function Jea(a10, b10) { + var c10 = a10.lH, e10 = K7(); + return IXa(new j22(), c10.Vr(b10, e10.u), a10.NH); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ IDa: 0 }, false, "amf.internal.environment.Environment", { IDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function D0a() { + this.ur = this.Of = null; + this.Hm = false; + } + D0a.prototype = new u7(); + D0a.prototype.constructor = D0a; + d7 = D0a.prototype; + d7.H = function() { + return "CachedReference"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof D0a) { + if (this.Of === a10.Of) { + var b10 = this.ur, c10 = a10.ur; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Hm === a10.Hm : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Of; + case 1: + return this.ur; + case 2: + return this.Hm; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function n_a(a10, b10, c10) { + var e10 = new D0a(); + e10.Of = a10; + e10.ur = b10; + e10.Hm = c10; + return e10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Of)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ur)); + a10 = OJ().Ga(a10, this.Hm ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ KDa: 0 }, false, "amf.internal.reference.CachedReference", { KDa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function NU() { + this.Uia = this.Fa = null; + } + NU.prototype = new OT(); + NU.prototype.constructor = NU; + NU.prototype.baa = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Uia = b10; + return this; + }; + NU.prototype.P = function(a10) { + this.CD(a10); + }; + NU.prototype.CD = function() { + this.Fa.kf.Gi(w6(/* @__PURE__ */ function(a10) { + return function(b10) { + ECa(a10.Fa, a10.Uia, b10); + }; + }(this))); + }; + NU.prototype.$classData = r8({ YDa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$1$$anonfun$$lessinit$greater$1", { YDa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function OU() { + this.Hka = this.o$ = this.Fa = null; + } + OU.prototype = new OT(); + OU.prototype.constructor = OU; + OU.prototype.P = function(a10) { + this.CD(a10); + }; + OU.prototype.CD = function(a10) { + a10.Gi(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + c10.kg(gw(b10.Fa.pg, ic(Ud().R.r)), w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = f10.Fa, k10 = B6(f10.o$.g, Ud().R).A; + k10 = k10.b() ? null : k10.c(); + var l10 = FF(); + h10.co(g10, k10, l10); + }; + }(b10))); + var e10 = b10.Hka; + e10.b() || (e10 = e10.c(), c10.kg(gw(b10.Fa.pg, ic(Ud().ko.r)), w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = f10.Fa, l10 = ic(g10.r), m10 = FF(); + k10.co(h10, l10, m10); + }; + }(b10, e10)))); + ECa(b10.Fa, B6(b10.o$.g, Ud().zi), c10); + }; + }(this))); + }; + OU.prototype.caa = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.o$ = b10; + this.Hka = c10; + return this; + }; + OU.prototype.$classData = r8({ $Da: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$2$$anonfun$$lessinit$greater$2", { $Da: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function PU() { + this.iea = this.$0 = this.Fa = null; + } + PU.prototype = new OT(); + PU.prototype.constructor = PU; + PU.prototype.P = function(a10) { + this.CD(a10); + }; + PU.prototype.CD = function(a10) { + a10.Gi(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + uN(b10.Fa, c10, b10.$0); + CCa(b10.Fa, c10, oc(), y7()); + wN(b10.Fa, b10.$0, c10, b10.iea.x); + wN(b10.Fa, b10.$0, c10, b10.iea.ju); + }; + }(this))); + }; + PU.prototype.KK = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.$0 = b10; + this.iea = c10; + return this; + }; + PU.prototype.$classData = r8({ bEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$3$$anonfun$$lessinit$greater$3", { bEa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function QU() { + this.Wpa = this.J$ = this.Fa = null; + } + QU.prototype = new OT(); + QU.prototype.constructor = QU; + QU.prototype.P = function(a10) { + this.CD(a10); + }; + QU.prototype.CD = function(a10) { + a10.Gi(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + uN(b10.Fa, c10, b10.J$); + CCa(b10.Fa, c10, oc(), y7()); + wN(b10.Fa, b10.J$, c10, b10.Wpa.ju); + }; + }(this))); + }; + QU.prototype.KK = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.J$ = b10; + this.Wpa = c10; + return this; + }; + QU.prototype.$classData = r8({ dEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$4$$anonfun$$lessinit$greater$4", { dEa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function RU() { + this.Jqa = this.pma = this.Zka = this.Fa = null; + } + RU.prototype = new OT(); + RU.prototype.constructor = RU; + RU.prototype.P = function(a10) { + this.CD(a10); + }; + RU.prototype.CD = function(a10) { + a10.Gi(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + uN(b10.Fa, c10, b10.Zka); + c10.kg(gw(b10.Fa.pg, ic(oc().ko.r)), w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.Fa, h10 = e10.pma, k10 = FF(); + g10.co(f10, h10, k10); + }; + }(b10))); + c10.kg(gw(b10.Fa.pg, ic(oc().vf.r)), w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.Fa, h10 = e10.Jqa, k10 = FF(); + g10.co(f10, h10, k10); + }; + }(b10))); + }; + }(this))); + }; + RU.prototype.daa = function(a10, b10, c10, e10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Zka = b10; + this.pma = c10; + this.Jqa = e10; + return this; + }; + RU.prototype.$classData = r8({ fEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anon$5$$anonfun$$lessinit$greater$5", { fEa: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function FN() { + this.gA = this.LE = null; + } + FN.prototype = new u7(); + FN.prototype.constructor = FN; + d7 = FN.prototype; + d7.a = function() { + this.LE = new wF().a(); + this.gA = J5(E0a(), H10()); + return this; + }; + d7.H = function() { + return "EmissionQueue"; + }; + function vN(a10, b10) { + var c10 = b10.kt; + c10.b() ? c10 = false : (c10 = c10.c(), c10 = null !== Sya(a10.gA, c10)); + return c10 ? new Ld().kn(new Zj().e("Element already emitted")) : (gta(a10.LE, b10), b10 = b10.kt, b10.b() || (b10 = b10.c(), new z7().d(F0a(a10.gA, b10))), new Kd().d(void 0)); + } + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof FN && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ kEa: 0 }, false, "amf.plugins.document.graph.emitter.flattened.utils.EmissionQueue", { kEa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function SU() { + this.l = this.py = this.Nu = this.er = this.Pe = null; + } + SU.prototype = new u7(); + SU.prototype.constructor = SU; + d7 = SU.prototype; + d7.PL = function(a10, b10) { + var c10 = kc(a10.Fd), e10 = qc(), f10 = rw().sc; + c10 = jc(c10, sw(f10, e10)); + c10 = c10.b() ? y7() : c10.c().kc(); + c10.b() ? c10 = y7() : (c10 = c10.c(), e10 = ac(new M6().W(c10), "@context"), e10.b() || (e10 = e10.c(), this.jca(e10.i)), c10 = this.wv(c10)); + if (c10 instanceof z7 && (c10 = c10.i, vu(c10))) + return a10 = Bq().uc, eb(c10, a10, b10); + c10 = this.l.m; + e10 = dc().rD; + f10 = "Unable to parse " + a10; + var g10 = y7(); + ec(c10, e10, b10, g10, f10, a10.da); + O7(); + b10 = new P6().a(); + return new mf().K(new S6().a(), b10); + }; + d7.H = function() { + return "Parser"; + }; + d7.zS = function(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + a: { + for (var g10 = Bg(e10.Y()); !g10.b(); ) { + var h10 = g10.ga(), k10 = B6(f10.g, Ud().ko); + if (xb(k10, ic(h10.r))) { + g10 = new z7().d(g10.ga()); + break a; + } + g10 = g10.ta(); + } + g10 = y7(); + } + if (!g10.b() && (g10 = g10.c(), g10 = hd(e10.Y(), g10), !g10.b())) + if (g10 = g10.c(), null !== g10) + g10.r.r.fa().Lb(new NM().cE(f10)); + else + throw new x7().d(g10); + }; + }(this, a10))); + }; + d7.E = function() { + return 1; + }; + d7.Cea = function(a10, b10, c10, e10, f10) { + var g10 = b10.ba; + if (Dr(g10)) + g10 = qc(), g10 = this.wv(N6(c10, g10, this.l.m)), g10.b() || (g10 = g10.c(), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10)); + else if (qb().h(g10) || kba().h(g10) || yc().h(g10) || SM().h(g10)) + g10 = DMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (zc().h(g10)) + g10 = wMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (Ac().h(g10)) + g10 = zMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (et3().h(g10)) + g10 = yMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (hi().h(g10)) + g10 = BMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (TM().h(g10)) + g10 = xMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (ZL().h(g10)) + g10 = xMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (Bc() === g10) + g10 = tMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (g10 instanceof UM) { + g10 = g10.Fe; + var h10 = qc(); + g10 = this.qca(g10, N6(c10, h10, this.l.m)); + e10 = sc(this.Pe, e10, f10); + bs(a10, b10, g10, e10); + } else if (g10 instanceof xc) { + h10 = lc(); + c10 = N6(c10, h10, this.l.m); + h10 = g10.Fe; + if (Dr(h10)) { + h10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = qc(); + return l10.wv(N6(m10, p10, l10.l.m)).ua(); + }; + }(this)); + var k10 = K7(); + c10 = c10.bd(h10, k10.u); + } else { + if (!qb().h(h10) && !yc().h(h10)) + throw new x7().d(h10); + h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return DMa(l10.l, pc3(l10.l, m10.Fe, p10)); + }; + }(this, g10)); + k10 = K7(); + c10 = c10.ka(h10, k10.u); + } + g10 = g10.Fe; + vB(g10) ? (h10 = Gk().Ic, h10 = null === b10 ? null === h10 : b10.h(h10)) : h10 = false; + h10 ? (e10 = sc(this.Pe, e10, f10), as(a10, b10, c10, e10)) : OBa(g10) ? (e10 = sc(this.Pe, e10, f10), as(a10, b10, c10, e10)) : (e10 = sc(this.Pe, e10, f10), bs(a10, b10, c10, e10)); + } else + throw new x7().d(g10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof SU && a10.l === this.l) { + var b10 = this.Pe; + a10 = a10.Pe; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Pe; + default: + throw new U6().e("" + a10); + } + }; + d7.sca = function(a10, b10, c10) { + b10.sb.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = Dd(); + k10 = N6(k10, l10, e10.l.m); + k10 = fc(k10, e10.l.m); + h10 = h10.i; + "@type" !== k10 && "@id" !== k10 && k10 !== ic(nc().bb.r) && "smaps" !== k10 ? (l10 = F6().Tb, l10 = k10 !== ic(G5(l10, "extensionName"))) : l10 = false; + if (l10) { + a: { + for (l10 = f10; !l10.b(); ) { + if (ic(l10.ga().r) === k10) { + l10 = true; + break a; + } + l10 = l10.ta(); + } + l10 = false; + } + l10 = !l10; + } else + l10 = false; + if (l10) { + l10 = qc(); + var m10 = rw().sc; + h10 = N6(h10, sw(m10, l10), e10.l.m).kc(); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = e10.wv(h10)); + l10 = new G0a(); + l10.tV = g10; + l10.SW = k10; + if (h10.b()) + return y7(); + k10 = $s(l10); + h10 = h10.c(); + return k10.Ia(h10); + } + }; + }(this, c10, a10))); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.qda = function(a10, b10) { + var c10 = eba(this.l, b10, a10, this.l.m), e10 = c10.Fb(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return uMa(h10.l, k10).na(); + }; + }(this))); + if (e10 instanceof z7) + return uMa(this.l, e10.i); + if (y7() === e10) { + e10 = this.l.m; + var f10 = dc().iS; + c10 = "Error parsing JSON-LD node, unknown @types " + c10; + var g10 = y7(); + ec(e10, f10, a10, g10, c10, b10.da); + return y7(); + } + throw new x7().d(e10); + }; + d7.jca = function(a10) { + var b10 = a10.hb().gb; + if (Q5().sa === b10) { + b10 = qc(); + b10 = N6(a10, b10, this.l.m); + a10 = this.l.m.UJ; + b10 = b10.sb; + var c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return f10.oca(g10).ua(); + }; + }(this)), e10 = rw(); + b10 = b10.bd(c10, e10.sc).Ch(Gb().si); + yi(a10, b10); + a10 = this.l.m; + b10 = this.l.m.UJ.mb(); + a: { + for (; b10.Ya(); ) { + e10 = c10 = b10.$a(); + if (null === e10) + throw new x7().d(e10); + if ("@base" === e10.ma()) { + b10 = new z7().d(c10); + break a; + } + } + b10 = y7(); + } + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + if (null === b10) + throw new x7().d(b10); + b10 = b10.ya(); + b10 = new z7().d(b10); + } + a10.S_ = b10; + } + }; + d7.QS = function(a10) { + if (Rk(a10) && ut(a10)) { + this.py.Xh(new R6().M(a10.j, a10)); + var b10 = this.er.Ja(a10.j); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = H10(); + } + b10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (ut(h10)) + return jb(h10, f10); + if (h10 instanceof ns) + return QM(h10, f10); + h10 = e10.l.m; + var k10 = dc().qZ; + yB(h10, k10, g10.j, "Only linkable elements can be linked", g10.fa()); + }; + }(this, a10, a10))); + this.er.jm(a10.j, H10()); + } else if (RM(a10)) { + b10 = this.Nu; + var c10 = B6(a10.Y(), Zf().xj).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + } + }; + d7.wW = function(a10, b10) { + var c10 = this.py.Ja(b10); + if (c10 instanceof z7) + jb(a10, c10.i); + else if (y7() === c10) { + c10 = this.er.Ja(b10); + if (c10 instanceof z7) + var e10 = c10.i; + else { + if (y7() !== c10) + throw new x7().d(c10); + e10 = H10(); + } + c10 = this.er; + a10 = J5(K7(), new Ib().ha([a10])); + var f10 = K7(); + a10 = e10.ia(a10, f10.u); + c10.Xh(new R6().M(b10, a10)); + } else + throw new x7().d(c10); + }; + d7.kca = function(a10, b10) { + var c10 = new M6().W(a10), e10 = ic(Yd(nc()).r); + c10 = ac(c10, hc(e10, this.l.m)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().i; + e10 = lc(); + c10 = N6(c10, e10, this.l.m); + e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = g10.l, l10 = yc(); + h10 = pc3(k10, l10, h10); + k10 = bc(); + return N6(h10, k10, g10.l.m).va; + }; + }(this)); + var f10 = K7(); + c10 = new z7().d(c10.ka(e10, f10.u)); + } + c10 = c10.b() ? H10() : c10.c(); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = ac(new M6().W(h10), hc(k10, g10.l.m)); + if (l10.b()) + l10 = y7(); + else { + var m10 = l10.c(); + O7(); + l10 = new P6().a(); + l10 = new Td().K(new S6().a(), l10); + m10 = m10.i; + var p10 = qc(); + m10 = N6(m10, p10, g10.l.m); + p10 = vMa(g10.l, m10, Ud().R); + if (!p10.b()) { + p10 = p10.c(); + var t10 = Ud().R; + new z7().d(eb(l10, t10, p10)); + } + p10 = vMa(g10.l, m10, Ud().ko); + p10.b() || (p10 = p10.c(), t10 = Ud().ko, new z7().d(eb(l10, t10, p10))); + O7(); + p10 = new P6().a(); + p10 = new Pd().K(new S6().a(), p10); + p10.j = k10; + k10 = Ud().ig; + Vd(l10, k10, p10); + k10 = g10.wv(m10); + m10 = new H0a(); + k10.b() ? k10 = y7() : (m10 = $s(m10), k10 = k10.c(), k10 = m10.Ia(k10)); + k10.b() || (k10 = k10.c(), Rd(l10, k10.j), m10 = Ud().zi, Vd(l10, m10, k10)); + k10 = fba(g10.l, h10, g10.l.m); + l10.x.Sp(sc(g10.Pe, k10, l10.j)); + l10 = new z7().d(l10); + } + return l10.ua(); + }; + }(this, a10)); + e10 = K7(); + a10 = c10.bd(a10, e10.u); + if (a10.Da()) + if (c10 = a10.Dm(w6(/* @__PURE__ */ function() { + return function(g10) { + return RBa(g10); + }; + }(this))), null !== c10) + a10 = c10.ma(), c10 = c10.ya(), e10 = Yd(nc()), Zd(b10, e10, c10), this.zS(b10, a10); + else + throw new x7().d(c10); + }; + d7.wv = function(a10) { + var b10 = $b(a10, this.l.m); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + var c10 = this.qda(b10, a10); + c10.b() ? b10 = y7() : (c10 = c10.c(), b10 = new z7().d(new R6().M(b10, c10))); + } + if (b10.b()) + return y7(); + c10 = b10.c(); + if (null === c10) + throw new x7().d(c10); + b10 = c10.ma(); + var e10 = c10.ya(), f10 = fba(this.l, a10, this.l.m); + b10 = dba(b10, this.l.m); + c10 = CMa(this.l, b10, a10, e10).P(sc(this.Pe, f10, b10)); + if (c10 instanceof z7) { + c10 = c10.i; + c10.pc(b10); + this.QS(c10); + if (AB(e10)) { + e10 = e10.Ub(); + var g10 = K7(), h10 = [ny(), nC()]; + g10 = J5(g10, new Ib().ha(h10)); + h10 = ii(); + e10 = e10.ia(g10, h10.u); + } else + e10 = e10.Ub(); + for (g10 = e10; !g10.b(); ) { + h10 = g10.ga(); + var k10 = hc(ic(h10.r), this.l.m), l10 = ac( + new M6().W(a10), + k10 + ); + l10 instanceof z7 && this.Cea(c10, h10, pc3(this.l, h10.ba, l10.i.i), f10, k10); + g10 = g10.ta(); + } + Rk(c10) && ut(c10) ? this.pca(a10, c10) : c10 instanceof Pk && this.Nu.Ja(c10.j).na() ? (f10 = this.Nu.Ja(c10.j), f10.b() || (f10 = f10.c(), e10 = B6(c10.g, Ok().Rd).A, e10.b() || (e10 = e10.c(), g10 = Zf().Rd, eb(f10, g10, e10)))) : c10 instanceof Xk && this.sca(c10, a10, e10); + Rk(c10) && this.kca(a10, c10); + this.Pe = this.Pe.cc(new R6().M(b10, c10)); + return new z7().d(c10); + } + return y7(); + }; + d7.qca = function(a10, b10) { + var c10 = J5(Ef(), H10()); + b10.sb.ei(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = h10.Aa; + var k10 = Dd(); + return N6(h10, k10, g10.l.m); + }; + }(this)), mc()).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.Aa, m10 = Dd(); + l10 = N6(l10, m10, g10.l.m); + m10 = F6().Ul; + m10 = hc(ic(G5(m10, "_")), g10.l.m); + if (0 <= (l10.length | 0) && l10.substring(0, m10.length | 0) === m10) + return k10 = k10.i, l10 = lc(), Dg(h10, N6(k10, l10, g10.l.m).ga()); + }; + }(this, c10))); + Ef(); + Ef(); + b10 = Jf(new Kf(), new Lf().a()); + for (c10 = c10.Dc; !c10.b(); ) { + var e10 = c10.ga(); + if (Dr(a10)) { + var f10 = qc(); + f10 = this.wv(N6(e10, f10, this.l.m)).ua(); + } else + try { + f10 = new z7().d(DMa(this.l, pc3( + this.l, + a10, + e10 + ))).ua(); + } catch (g10) { + if (Ph(E6(), g10) instanceof nb) + f10 = y7().ua(); + else + throw g10; + } + yi(b10, f10); + c10 = c10.ta(); + } + return b10.eb; + }; + d7.oca = function(a10) { + var b10 = a10.Aa.hb().gb, c10 = a10.i.hb().gb; + return Q5().Na === b10 && Q5().Na === c10 ? (b10 = a10.Aa, c10 = bc(), b10 = N6(b10, c10, this.l.m).va, a10 = a10.i, c10 = bc(), a10 = N6(a10, c10, this.l.m).va, new z7().d(new R6().M(b10, a10))) : y7(); + }; + d7.z = function() { + return X5(this); + }; + d7.pca = function(a10, b10) { + var c10 = new M6().W(a10), e10 = ic(db().pf.r); + c10 = ac(c10, hc(e10, this.l.m)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().i; + e10 = qc(); + var f10 = rw().sc; + c10 = N6(c10, sw(f10, e10), this.l.m).ga(); + c10 = $b(c10, this.l.m); + } + c10.b() || (c10 = c10.c(), c10 = dba(c10, this.l.m), this.wW(b10, c10)); + a10 = new M6().W(a10); + c10 = ic(db().ed.r); + a10 = ac(a10, hc(c10, this.l.m)); + a10.b() ? a10 = y7() : (a10 = a10.c().i, a10 = jc(kc(a10), lc()), a10.b() ? a10 = y7() : (a10 = a10.c().ga(), a10 = jc(kc(a10), qc())), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = ac(new M6().W(a10), "@value")), a10.b() ? a10 = y7() : (a10 = a10.c().i, a10 = jc(kc(a10), bc()), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.va)))); + a10.b() || (a10 = a10.c(), c10 = db().ed, eb(b10, c10, a10)); + }; + d7.$classData = r8({ nEa: 0 }, false, "amf.plugins.document.graph.parser.ExpandedGraphParser$Parser", { nEa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function TU() { + this.l = this.U0 = this.Wg = this.py = this.Nu = this.er = this.Pe = null; + } + TU.prototype = new u7(); + TU.prototype.constructor = TU; + d7 = TU.prototype; + d7.PL = function(a10, b10) { + a10 = a10.Fd.re(); + if (a10 instanceof vw) { + var c10 = ac(new M6().W(a10), "@context"); + c10.b() || (c10 = c10.c(), this.jca(c10.i)); + a10 = ac(new M6().W(a10), "@graph"); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = I0a(this, a10.i)); + if (a10 instanceof z7 && (a10 = a10.i, null !== a10)) + return c10 = Bq().uc, eb(a10, c10, b10); + b10 = this.l.m; + a10 = dc().rD; + c10 = y7(); + var e10 = y7(), f10 = y7(); + b10.Gc(a10.j, "", c10, "Error parsing root JSON-LD node", e10, Yb().qb, f10); + O7(); + b10 = new P6().a(); + return new mf().K(new S6().a(), b10); + } + b10 = this.l.m; + a10 = dc().rD; + c10 = y7(); + e10 = y7(); + f10 = y7(); + b10.Gc(a10.j, "", c10, "Error parsing root JSON-LD node", e10, Yb().qb, f10); + O7(); + b10 = new P6().a(); + return new mf().K(new S6().a(), b10); + }; + d7.H = function() { + return "Parser"; + }; + d7.zS = function(a10, b10) { + b10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + a: { + for (var g10 = Bg(e10.Y()); !g10.b(); ) { + var h10 = g10.ga(), k10 = B6(f10.g, Ud().ko); + if (xb(k10, ic(h10.r))) { + g10 = new z7().d(g10.ga()); + break a; + } + g10 = g10.ta(); + } + g10 = y7(); + } + if (!g10.b() && (g10 = g10.c(), g10 = hd(e10.Y(), g10), !g10.b())) + if (g10 = g10.c(), null !== g10) + g10.r.r.fa().Lb(new NM().cE(f10)); + else + throw new x7().d(g10); + }; + }(this, a10))); + }; + d7.E = function() { + return 1; + }; + d7.Cea = function(a10, b10, c10, e10, f10) { + var g10 = b10.ba; + if (Dr(g10)) + g10 = qc(), g10 = this.wv(N6(c10, g10, this.l.m)), g10.b() || (g10 = g10.c(), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10)); + else if (qb().h(g10) || kba().h(g10) || yc().h(g10) || SM().h(g10)) + g10 = IMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (zc().h(g10)) + g10 = EMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (Ac().h(g10)) + g10 = HMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (et3().h(g10)) + g10 = NMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (hi().h(g10)) + g10 = GMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (TM().h(g10)) + g10 = FMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (ZL().h(g10)) + g10 = FMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (Bc() === g10) + g10 = MMa(this.l, c10), e10 = sc(this.Pe, e10, f10), Rg(a10, b10, g10, e10); + else if (g10 instanceof UM) { + g10 = g10.Fe; + var h10 = qc(); + g10 = this.qca(g10, N6(c10, h10, this.l.m)); + e10 = sc(this.Pe, e10, f10); + bs(a10, b10, g10, e10); + } else if (g10 instanceof xc) { + h10 = lc(); + c10 = N6(c10, h10, this.l.m); + h10 = g10.Fe; + if (Dr(h10)) { + h10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = qc(); + return l10.wv(N6(m10, p10, l10.l.m)).ua(); + }; + }(this)); + var k10 = K7(); + c10 = c10.bd(h10, k10.u); + } else { + if (!qb().h(h10) && !yc().h(h10)) + throw new x7().d(h10); + h10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return IMa(l10.l, pc3(l10.l, m10.Fe, p10)); + }; + }(this, g10)); + k10 = K7(); + c10 = c10.ka(h10, k10.u); + } + g10 = g10.Fe; + vB(g10) ? (h10 = Gk().Ic, h10 = null === b10 ? null === h10 : b10.h(h10)) : h10 = false; + h10 ? (e10 = sc(this.Pe, e10, f10), as(a10, b10, c10, e10)) : OBa(g10) ? (e10 = sc(this.Pe, e10, f10), as(a10, b10, c10, e10)) : (e10 = sc(this.Pe, e10, f10), bs(a10, b10, c10, e10)); + } else + throw new x7().d(g10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof TU && a10.l === this.l) { + var b10 = this.Pe; + a10 = a10.Pe; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.sca = function(a10, b10, c10) { + b10.sb.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = Dd(); + k10 = N6(k10, l10, e10.l.m); + k10 = fc(k10, e10.l.m); + h10 = h10.i; + "@type" !== k10 && "@id" !== k10 && k10 !== ic(nc().bb.r) && "smaps" !== k10 ? (l10 = F6().Zd, l10 = k10 !== ic(G5(l10, "name"))) : l10 = false; + if (l10) { + a: { + for (l10 = f10; !l10.b(); ) { + if (ic(l10.ga().r) === k10) { + l10 = true; + break a; + } + l10 = l10.ta(); + } + l10 = false; + } + l10 = !l10; + } else + l10 = false; + if (l10) { + l10 = qc(); + var m10 = rw().sc; + h10 = N6(h10, sw(m10, l10), e10.l.m).kc(); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = e10.wv(h10)); + l10 = new J0a(); + l10.tV = g10; + l10.SW = k10; + if (h10.b()) + return y7(); + k10 = $s(l10); + h10 = h10.c(); + return k10.Ia(h10); + } + }; + }(this, c10, a10))); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Pe; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.qda = function(a10, b10) { + var c10 = eba(this.l, b10, a10, this.l.m), e10 = c10.Fb(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return LMa(h10.l, k10).na(); + }; + }(this))); + if (e10 instanceof z7) + return LMa(this.l, e10.i); + if (y7() === e10) { + e10 = this.l.m; + var f10 = dc().iS; + c10 = "Error parsing JSON-LD node, unknown @types " + c10; + var g10 = y7(); + ec(e10, f10, a10, g10, c10, b10.da); + return y7(); + } + throw new x7().d(e10); + }; + d7.jca = function(a10) { + var b10 = a10.hb().gb; + if (Q5().sa === b10) { + b10 = qc(); + b10 = N6(a10, b10, this.l.m); + a10 = this.l.m.UJ; + b10 = b10.sb; + var c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return f10.oca(g10).ua(); + }; + }(this)), e10 = rw(); + b10 = b10.bd(c10, e10.sc).Ch(Gb().si); + yi(a10, b10); + a10 = this.l.m; + b10 = this.l.m.UJ.mb(); + a: { + for (; b10.Ya(); ) { + e10 = c10 = b10.$a(); + if (null === e10) + throw new x7().d(e10); + if ("@base" === e10.ma()) { + b10 = new z7().d(c10); + break a; + } + } + b10 = y7(); + } + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + if (null === b10) + throw new x7().d(b10); + b10 = b10.ya(); + b10 = new z7().d(b10); + } + a10.S_ = b10; + } + }; + function K0a(a10, b10) { + b10 = b10.Cm; + var c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = qc(); + g10 = N6(g10, h10, f10.l.m); + h10 = $b(g10, f10.l.m); + return (h10 instanceof z7 ? new z7().d(new R6().M(h10.i, g10)) : y7()).ua(); + }; + }(a10)), e10 = rw(); + b10.bd(c10, e10.sc).U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + f10.U0.Ue(h10, g10); + } else + throw new x7().d(g10); + }; + }(a10))); + } + d7.QS = function(a10) { + if (Rk(a10) && ut(a10)) { + this.py.Xh(new R6().M(a10.j, a10)); + var b10 = this.er.Ja(a10.j); + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = H10(); + } + b10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (ut(h10)) + return jb(h10, f10); + if (h10 instanceof ns) + return QM(h10, f10); + h10 = e10.l.m; + var k10 = dc().qZ; + yB(h10, k10, g10.j, "Only linkable elements can be linked", g10.fa()); + }; + }(this, a10, a10))); + this.er.jm(a10.j, H10()); + } else if (RM(a10)) { + b10 = this.Nu; + var c10 = B6(a10.Y(), Zf().xj).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + } + }; + d7.wW = function(a10, b10) { + var c10 = this.py.Ja(b10); + if (c10 instanceof z7) + jb(a10, c10.i); + else if (y7() === c10) { + c10 = this.er.Ja(b10); + if (c10 instanceof z7) + var e10 = c10.i; + else { + if (y7() !== c10) + throw new x7().d(c10); + e10 = H10(); + } + c10 = this.er; + a10 = J5(K7(), new Ib().ha([a10])); + var f10 = K7(); + a10 = e10.ia(a10, f10.u); + c10.Xh(new R6().M(b10, a10)); + } else + throw new x7().d(c10); + }; + function I0a(a10, b10) { + var c10 = tw(); + K0a(a10, N6(b10, c10, a10.l.m)); + c10 = L0a(a10); + if (c10 instanceof z7) { + b10 = false; + c10 = a10.wv(c10.i); + if (c10 instanceof z7 && (b10 = true, c10 = c10.i, vu(c10))) + return new z7().d(c10); + if (b10) { + a10 = a10.l.m; + b10 = dc().rD; + c10 = y7(); + var e10 = y7(), f10 = y7(); + a10.Gc(b10.j, "", c10, "Root node is not a Base Unit", e10, Yb().qb, f10); + return y7(); + } + a10 = a10.l.m; + b10 = dc().rD; + c10 = y7(); + e10 = y7(); + f10 = y7(); + a10.Gc(b10.j, "", c10, "Unable to parse root node", e10, Yb().qb, f10); + return y7(); + } + if (y7() === c10) + return a10 = a10.l.m, b10 = dc().rD, c10 = y7(), e10 = y7(), f10 = y7(), a10.Gc(b10.j, "", c10, "Cannot find root node for flattened JSON-LD", e10, Yb().qb, f10), y7(); + throw new x7().d(c10); + } + d7.kca = function(a10, b10) { + var c10 = new M6().W(a10), e10 = ic(Yd(nc()).r); + c10 = ac(c10, hc(e10, this.l.m)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().i; + e10 = lc(); + c10 = N6(c10, e10, this.l.m); + e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = g10.l, l10 = yc(); + h10 = pc3(k10, l10, h10); + k10 = bc(); + return N6(h10, k10, g10.l.m).va; + }; + }(this)); + var f10 = K7(); + c10 = new z7().d(c10.ka(e10, f10.u)); + } + c10 = c10.b() ? H10() : c10.c(); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = ac(new M6().W(h10), hc(k10, g10.l.m)); + if (l10.b()) + l10 = y7(); + else { + var m10 = l10.c(); + O7(); + l10 = new P6().a(); + l10 = new Td().K(new S6().a(), l10); + m10 = m10.i; + var p10 = qc(); + m10 = N6(m10, p10, g10.l.m); + p10 = KMa(g10.l, m10, Ud().R); + if (!p10.b()) { + p10 = p10.c(); + var t10 = Ud().R; + new z7().d(eb(l10, t10, p10)); + } + p10 = KMa(g10.l, m10, Ud().ko); + p10.b() || (p10 = p10.c(), t10 = Ud().ko, new z7().d(eb(l10, t10, p10))); + O7(); + p10 = new P6().a(); + p10 = new Pd().K(new S6().a(), p10); + p10.j = k10; + k10 = Ud().ig; + Vd(l10, k10, p10); + k10 = g10.wv(m10); + m10 = new M0a(); + k10.b() ? k10 = y7() : (m10 = $s(m10), k10 = k10.c(), k10 = m10.Ia(k10)); + k10.b() || (k10 = k10.c(), Rd(l10, k10.j), m10 = Ud().zi, Vd(l10, m10, k10)); + k10 = fba(g10.l, h10, g10.l.m); + l10.x.Sp(sc(g10.Pe, k10, l10.j)); + l10 = new z7().d(l10); + } + return l10.ua(); + }; + }(this, a10)); + e10 = K7(); + a10 = c10.bd(a10, e10.u); + if (a10.Da()) + if (c10 = a10.Dm(w6(/* @__PURE__ */ function() { + return function(g10) { + return RBa(g10); + }; + }(this))), null !== c10) + a10 = c10.ma(), c10 = c10.ya(), e10 = Yd(nc()), Zd( + b10, + e10, + c10 + ), this.zS(b10, a10); + else + throw new x7().d(c10); + }; + d7.wv = function(a10) { + if (1 === a10.sb.jb() && ac(new M6().W(a10), "@id").na()) { + a10 = $b(a10, this.l.m); + if (a10.b()) + return y7(); + var b10 = a10.c(); + a10 = this.Wg.Ja(b10); + if (a10 instanceof z7) + return new z7().d(a10.i); + if (y7() !== a10) + throw new x7().d(a10); + a10 = this.U0.Ja(b10); + if (a10 instanceof z7) + return this.wv(a10.i); + if (y7() !== a10) + throw new x7().d(a10); + a10 = this.l.m; + var c10 = dc().rD; + b10 = "Cannot find node with " + b10; + var e10 = y7(), f10 = y7(), g10 = y7(); + a10.Gc(c10.j, "", e10, b10, f10, Yb().qb, g10); + return y7(); + } + c10 = $b(a10, this.l.m); + c10.b() ? c10 = y7() : (c10 = c10.c(), b10 = this.qda(c10, a10), b10.b() ? c10 = y7() : (b10 = b10.c(), c10 = new z7().d(new R6().M(c10, b10)))); + if (c10.b()) + return y7(); + b10 = c10.c(); + if (null === b10) + throw new x7().d(b10); + c10 = b10.ma(); + f10 = b10.ya(); + e10 = fba(this.l, a10, this.l.m); + c10 = dba(c10, this.l.m); + b10 = JMa(this.l, c10, a10, f10).P(sc(this.Pe, e10, c10)); + if (b10 instanceof z7) { + b10 = b10.i; + b10.pc(c10); + this.QS(b10); + if (AB(f10)) { + f10 = f10.Ub(); + g10 = K7(); + var h10 = [ny(), nC()]; + g10 = J5(g10, new Ib().ha(h10)); + h10 = ii(); + f10 = f10.ia(g10, h10.u); + } else + f10 = f10.Ub(); + for (g10 = f10; !g10.b(); ) { + h10 = g10.ga(); + var k10 = hc(ic(h10.r), this.l.m), l10 = ac(new M6().W(a10), k10); + l10 instanceof z7 && this.Cea(b10, h10, pc3(this.l, h10.ba, l10.i.i), e10, k10); + g10 = g10.ta(); + } + Rk(b10) && ut(b10) ? this.pca(a10, b10) : b10 instanceof Pk && this.Nu.Ja(b10.j).na() ? (e10 = this.Nu.Ja(b10.j), e10.b() || (e10 = e10.c(), f10 = B6(b10.g, Ok().Rd).A, f10.b() || (f10 = f10.c(), g10 = Zf().Rd, eb(e10, g10, f10)))) : b10 instanceof Xk && this.sca(b10, a10, f10); + Rk(b10) && this.kca(a10, b10); + this.Pe = this.Pe.cc(new R6().M(c10, b10)); + return new z7().d(b10); + } + return y7(); + }; + d7.qca = function(a10, b10) { + var c10 = J5(Ef(), H10()); + b10.sb.ei(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = h10.Aa; + var k10 = Dd(); + return N6(h10, k10, g10.l.m); + }; + }(this)), mc()).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.Aa, m10 = Dd(); + l10 = N6(l10, m10, g10.l.m); + m10 = F6().Ul; + m10 = hc(ic(G5(m10, "_")), g10.l.m); + if (0 <= (l10.length | 0) && l10.substring(0, m10.length | 0) === m10) + return k10 = k10.i, l10 = lc(), Dg(h10, N6(k10, l10, g10.l.m).ga()); + }; + }(this, c10))); + Ef(); + Ef(); + b10 = Jf(new Kf(), new Lf().a()); + for (c10 = c10.Dc; !c10.b(); ) { + var e10 = c10.ga(); + if (Dr(a10)) { + var f10 = qc(); + f10 = this.wv(N6(e10, f10, this.l.m)).ua(); + } else + try { + f10 = new z7().d(IMa(this.l, pc3( + this.l, + a10, + e10 + ))).ua(); + } catch (g10) { + if (Ph(E6(), g10) instanceof nb) + f10 = y7().ua(); + else + throw g10; + } + yi(b10, f10); + c10 = c10.ta(); + } + return b10.eb; + }; + function L0a(a10) { + for (var b10 = new wq().Yn(a10.U0).Sb.Ye(); b10.Ya(); ) { + var c10 = b10.$a(), e10 = c10.sb.Fb(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = h10.Aa; + var k10 = Dd(); + h10 = N6(h10, k10, g10.l.m); + h10 = fc(h10, g10.l.m); + k10 = Bq().De; + return h10 === ic(k10.r); + }; + }(a10))); + if (e10.b()) + e10 = false; + else { + e10 = e10.c().i; + var f10 = pM(); + e10 = !!N6(e10, f10, a10.l.m); + } + if (e10) + return new z7().d(c10); + } + return y7(); + } + d7.oca = function(a10) { + var b10 = a10.Aa.hb().gb, c10 = a10.i.hb().gb; + return Q5().Na === b10 && Q5().Na === c10 ? (b10 = a10.Aa, c10 = bc(), b10 = N6(b10, c10, this.l.m).va, a10 = a10.i, c10 = bc(), a10 = N6(a10, c10, this.l.m).va, new z7().d(new R6().M(b10, a10))) : y7(); + }; + d7.z = function() { + return X5(this); + }; + d7.pca = function(a10, b10) { + var c10 = new M6().W(a10), e10 = ic(db().pf.r); + c10 = ac(c10, hc(e10, this.l.m)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().i; + e10 = qc(); + var f10 = rw().sc; + c10 = N6(c10, sw(f10, e10), this.l.m).ga(); + c10 = $b(c10, this.l.m); + } + c10.b() || (c10 = c10.c(), c10 = dba(c10, this.l.m), this.wW(b10, c10)); + a10 = new M6().W(a10); + c10 = ic(db().ed.r); + a10 = ac(a10, hc(c10, this.l.m)); + a10.b() ? a10 = y7() : (a10 = a10.c().i, a10 = jc(kc(a10), lc()), a10.b() ? a10 = y7() : (a10 = a10.c().ga(), a10 = jc(kc(a10), qc())), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = ac(new M6().W(a10), "@value")), a10.b() ? a10 = y7() : (a10 = a10.c().i, a10 = jc(kc(a10), bc()), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.va)))); + a10.b() || (a10 = a10.c(), c10 = db().ed, eb(b10, c10, a10)); + }; + d7.$classData = r8({ sEa: 0 }, false, "amf.plugins.document.graph.parser.FlattenedGraphParser$Parser", { sEa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N0a() { + this.Vja = this.Wja = this.qB = this.bK = this.Ui = null; + } + N0a.prototype = new u7(); + N0a.prototype.constructor = N0a; + d7 = N0a.prototype; + d7.H = function() { + return "DiscriminatorHelper"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N0a) { + var b10 = this.Ui, c10 = a10.Ui; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.bK, a10 = a10.bK, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ui; + case 1: + return this.bK; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function O0a(a10, b10) { + var c10 = new N0a(); + c10.Ui = a10; + c10.bK = b10; + b10 = Vb().Ia(dV(a10)); + if (b10.b()) + a: { + if (b10 = B6(c10.Ui.Y(), Ae4().bh).ga().A, b10 = b10.b() ? null : b10.c(), b10 = nd(c10.bK, b10), null !== b10 && (b10 = b10.ya(), b10 instanceof ze2)) { + b10 = Vb().Ia(dV(b10)); + break a; + } + b10 = y7(); + } + c10.qB = b10; + a10 = B6(a10.Y(), Ae4().Zt).A; + if (a10.b()) + a: { + if (a10 = B6(c10.Ui.Y(), Ae4().bh).ga().A, a10 = a10.b() ? null : a10.c(), a10 = nd(c10.bK, a10), null !== a10 && (a10 = a10.ya(), a10 instanceof ze2)) { + a10 = B6(a10.g, Ae4().Zt).A; + break a; + } + a10 = y7(); + } + c10.Wja = a10; + a10 = c10.qB; + c10.Vja = (a10.b() ? Rb(Gb().ab, H10()) : a10.c()).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(e10) { + return function(f10, g10) { + g10 = new R6().M( + f10, + g10 + ); + f10 = g10.Tp; + var h10 = g10.hr; + if (null !== h10) + return g10 = h10.ma(), h10 = h10.ya(), h10 = nd(e10.bK, h10), null !== h10 && (h10 = h10.ya(), h10 instanceof Cd) ? f10.cc(new R6().M(g10, h10)) : f10; + throw new x7().d(g10); + }; + }(c10))); + return c10; + } + function mNa(a10, b10) { + var c10 = vO(b10).ba; + b10 = /* @__PURE__ */ function() { + return function(h10) { + return ic(h10); + }; + }(a10); + var e10 = ii().u; + if (e10 === ii().u) + if (c10 === H10()) + b10 = H10(); + else { + e10 = c10.ga(); + var f10 = e10 = ji(b10(e10), H10()); + for (c10 = c10.ta(); c10 !== H10(); ) { + var g10 = c10.ga(); + g10 = ji(b10(g10), H10()); + f10 = f10.Nf = g10; + c10 = c10.ta(); + } + b10 = e10; + } + else { + for (e10 = se4(c10, e10); !c10.b(); ) + f10 = c10.ga(), e10.jd(b10(f10)), c10 = c10.ta(); + b10 = e10.Rc(); + } + c10 = a10.Vja.mb(); + a: { + for (; c10.Ya(); ) { + f10 = e10 = c10.$a(); + if (null === f10) + throw new x7().d(f10); + f10 = B6(f10.ya().g, wj().Ut).A; + f10 = f10.b() ? null : f10.c(); + if (Cg(b10, f10)) { + b10 = new z7().d(e10); + break a; + } + } + b10 = y7(); + } + return b10 instanceof z7 && (b10 = b10.i, null !== b10) ? (b10 = b10.ma(), a10 = a10.Wja, new z7().d(new R6().M(a10.b() ? "type" : a10.c(), b10))) : y7(); + } + d7.$classData = r8({ PFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DiscriminatorHelper", { PFa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function P0a() { + this.qa = this.wd = this.bb = this.mc = this.ba = this.fz = this.kh = this.Va = this.Zc = this.R = null; + this.xa = 0; + } + P0a.prototype = new u7(); + P0a.prototype.constructor = P0a; + d7 = P0a.prototype; + d7.a = function() { + Q0a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the ClassTerm", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Zc = rb(new sb(), a10, G5(b10, "displayName"), tb(new ub(), vb().Tb, "displayName", "Human readable name for the term", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Va = rb(new sb(), a10, G5(b10, "description"), tb(new ub(), vb().Tb, "description", "Human readable description for the term", H10())); + a10 = new xc().yd(yc()); + b10 = F6().$c; + this.kh = rb(new sb(), a10, G5(b10, "properties"), tb( + new ub(), + vb().$c, + "properties", + "Properties that have the ClassTerm in the domain", + H10() + )); + a10 = new xc().yd(yc()); + b10 = F6().Ul; + this.fz = rb(new sb(), a10, G5(b10, "subClassOf"), tb(new ub(), ci().Ul, "subClassOf", "Subsumption relationship across terms", H10())); + a10 = F6().bv; + a10 = G5(a10, "Class"); + b10 = nc().ba; + this.ba = ji(a10, b10); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ub = function() { + var a10 = this.R, b10 = this.Zc, c10 = this.Va, e10 = this.kh, f10 = this.fz, g10 = nc().g; + return ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, g10))))); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new gO().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ qGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.ClassTermModel$", { qGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Q0a = void 0; + function fO() { + Q0a || (Q0a = new P0a().a()); + return Q0a; + } + function R0a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.Mt = this.Vs = this.vx = null; + this.xa = 0; + } + R0a.prototype = new u7(); + R0a.prototype.constructor = R0a; + d7 = R0a.prototype; + d7.a = function() { + S0a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.vx = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the document for a dialect base unit", H10())); + a10 = yc(); + b10 = F6().$c; + this.Vs = rb(new sb(), a10, G5(b10, "encodedNode"), tb(new ub(), vb().$c, "encoded node", "Node in the dialect encoded in the target mapped base unit", H10())); + a10 = new xc().yd(UV()); + b10 = F6().$c; + this.Mt = rb(new sb(), a10, G5(b10, "declaredNode"), tb(new ub(), vb().$c, "declared node", "Node in the dialect declared in the target mappend base unit", H10())); + a10 = F6().$c; + a10 = G5(a10, "DocumentMapping"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().$c, "Document Mapping", "Mapping for a particular dialect document into a graph base unit", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.vx, b10 = this.Vs, c10 = this.Mt, e10 = nc().g; + return ji(a10, ji(b10, ji(c10, e10))); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new IV().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ uGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.DocumentMappingModel$", { uGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var S0a = void 0; + function GO() { + S0a || (S0a = new R0a().a()); + return S0a; + } + function T0a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.dS = this.Py = this.Iy = this.cz = this.Fx = this.My = this.De = null; + this.xa = 0; + } + T0a.prototype = new u7(); + T0a.prototype.constructor = T0a; + d7 = T0a.prototype; + d7.a = function() { + U0a = this; + Cr(this); + uU(this); + var a10 = GO(), b10 = F6().$c; + this.De = rb(new sb(), a10, G5(b10, "rootDocument"), tb(new ub(), vb().$c, "root document", "Root node encoded in a mapped document base unit", H10())); + a10 = new xc().yd(GO()); + b10 = F6().$c; + this.My = rb(new sb(), a10, G5(b10, "fragments"), tb(new ub(), vb().$c, "fragments", "Mapping of fragment base unit for a particular dialect", H10())); + a10 = GO(); + b10 = F6().$c; + this.Fx = rb(new sb(), a10, G5(b10, "library"), tb(new ub(), vb().$c, "library", "Mappig of module base unit for a particular dialect", H10())); + a10 = zc(); + b10 = F6().$c; + this.cz = rb(new sb(), a10, G5(b10, "selfEncoded"), tb(new ub(), vb().$c, "self encoded", "Information about if the base unit URL should be the same as the URI of the parsed root nodes in the unit", H10())); + a10 = qb(); + b10 = F6().$c; + this.Iy = rb(new sb(), a10, G5(b10, "declarationsPath"), tb(new ub(), vb().$c, "declarations path", "Information about the AST location of the declarations to be parsed as declared domain elements", H10())); + a10 = zc(); + b10 = F6().$c; + this.Py = rb(new sb(), a10, G5(b10, "keyProperty"), tb( + new ub(), + vb().$c, + "key property", + "Information about whether the dialect is defined by the header or a key property", + H10() + )); + a10 = qb(); + b10 = F6().$c; + this.dS = rb(new sb(), a10, G5(b10, "referenceStyle"), tb(new ub(), vb().$c, "reference style", "Determines the style for inclusions (RamlStyle or JsonSchemaStyle)", H10())); + a10 = F6().$c; + a10 = G5(a10, "DocumentsModel"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().$c, "Documents Model", "Mapping from different type of dialect documents to base units in the parsed graph", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + var a10 = this.De, b10 = this.My, c10 = this.Fx, e10 = this.cz, f10 = this.Iy, g10 = this.Py, h10 = this.dS, k10 = nc().g; + return ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, ji(h10, k10))))))); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new VV().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ vGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.DocumentsModelModel$", { vGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var U0a = void 0; + function Hc() { + U0a || (U0a = new T0a().a()); + return U0a; + } + function V0a() { + this.qa = this.wd = this.bb = this.mc = this.ba = this.Kh = this.Zc = null; + this.xa = 0; + } + V0a.prototype = new u7(); + V0a.prototype.constructor = V0a; + d7 = V0a.prototype; + d7.a = function() { + W0a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.Zc = rb(new sb(), a10, G5(b10, "displayName"), tb(new ub(), vb().Tb, "displayName", "Display name for an external model", H10())); + a10 = qb(); + b10 = F6().$c; + this.Kh = rb(new sb(), a10, G5(b10, "base"), tb(new ub(), vb().$c, "base", "Base URI for the external model", H10())); + a10 = F6().bv; + a10 = G5(a10, "Ontology"); + b10 = F6().$c; + b10 = G5(b10, "ExternalVocabulary"); + var c10 = nc().ba; + this.ba = ji(a10, ji(b10, c10)); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ub = function() { + var a10 = this.Zc, b10 = this.Kh, c10 = nc().g; + return ji(a10, ji(b10, c10)); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new yO().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ wGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.ExternalModel$", { wGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var W0a = void 0; + function dd() { + W0a || (W0a = new V0a().a()); + return W0a; + } + function r32() { + this.qa = this.wd = this.bb = this.mc = this.eB = this.Vf = this.Va = this.Zc = this.R = null; + this.xa = 0; + } + r32.prototype = new u7(); + r32.prototype.constructor = r32; + function X0a() { + } + d7 = X0a.prototype = r32.prototype; + d7.a = function() { + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the property term", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Zc = rb(new sb(), a10, G5(b10, "displayName"), tb(new ub(), vb().Tb, "display name", "Human readable name for the property term", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Va = rb(new sb(), a10, G5(b10, "description"), tb(new ub(), vb().Tb, "description", "Human readable description of the property term", H10())); + a10 = yc(); + b10 = F6().Ul; + this.Vf = rb(new sb(), a10, G5(b10, "range"), tb( + new ub(), + ci().Ul, + "range", + "Range of the proeprty term, scalar or object", + H10() + )); + a10 = new xc().yd(yc()); + b10 = F6().Ul; + this.eB = rb(new sb(), a10, G5(b10, "subPropertyOf"), tb(new ub(), ci().Ul, "subPropertyOf", "Subsumption relationship for terms", H10())); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ub = function() { + var a10 = this.Zc, b10 = this.Va, c10 = this.Vf, e10 = this.eB, f10 = nc().g; + return ji(a10, ji(b10, ji(c10, ji(e10, f10)))); + }; + d7.jc = function() { + return this.qa; + }; + function Y0a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.$u = this.R = null; + this.xa = 0; + } + Y0a.prototype = new u7(); + Y0a.prototype.constructor = Y0a; + d7 = Y0a.prototype; + d7.a = function() { + Z0a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the mapping", H10())); + a10 = yc(); + b10 = F6().$c; + this.$u = rb(new sb(), a10, G5(b10, "mappedNode"), tb(new ub(), vb().$c, "mapped node", "Node in the dialect definition associated to this mapping", H10())); + a10 = F6().$c; + a10 = G5(a10, "PublicNodeMapping"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().$c, "Public Node Mapping", "Mapping for a graph node mapping to a particular function in a dialect", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.R, b10 = this.$u, c10 = nc().g; + return ji(a10, ji(b10, c10)); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new OV().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ CGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.PublicNodeMappingModel$", { CGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Z0a = void 0; + function UV() { + Z0a || (Z0a = new Y0a().a()); + return Z0a; + } + function $0a() { + this.qa = this.wd = this.bb = this.mc = this.ba = this.g = this.Kh = this.sN = this.Xp = null; + this.xa = 0; + } + $0a.prototype = new u7(); + $0a.prototype.constructor = $0a; + d7 = $0a.prototype; + d7.a = function() { + a1a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Zd; + this.Xp = rb(new sb(), a10, G5(b10, "alias"), tb(new ub(), vb().qm, "", "", H10())); + a10 = qb(); + b10 = F6().Zd; + this.sN = rb(new sb(), a10, G5(b10, "reference"), tb(new ub(), vb().qm, "", "", H10())); + a10 = qb(); + b10 = F6().$c; + this.Kh = rb(new sb(), a10, G5(b10, "base"), tb(new ub(), vb().qm, "", "", H10())); + a10 = this.Xp; + b10 = this.sN; + var c10 = this.Kh, e10 = nc().g; + this.g = ji(a10, ji(b10, ji(c10, e10))); + a10 = F6().$c; + a10 = G5(a10, "VocabularyReference"); + b10 = nc().ba; + this.ba = ji(a10, b10); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bO().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ EGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.VocabularyReferenceModel$", { EGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var a1a = void 0; + function td() { + a1a || (a1a = new $0a().a()); + return a1a; + } + function md(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Zga); + } + function Md() { + this.m = this.ai = this.Wd = this.Ca = null; + } + Md.prototype = new u7(); + Md.prototype.constructor = Md; + d7 = Md.prototype; + d7.tca = function(a10) { + qs(); + var b10 = Od(O7(), a10); + b10 = new Xk().K(new S6().a(), b10); + var c10 = this.ai.jt("object"), e10 = dl().R; + b10 = eb(b10, e10, c10); + c10 = this.Wd; + c10.b() || (c10 = c10.c(), f22(b10, c10, J5(K7(), H10()))); + a10 = a10.sb; + c10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = IO(); + k10 = N6(k10, l10, f10.m).va; + l10 = h10.i; + h10 = Od(O7(), h10); + l10 = $ga(Jba(new Md(), l10, new z7().d(g10.j), f10.ai, f10.m).Fr(), g10.j); + return oC(g10, k10, l10, h10); + }; + }(this, b10)); + e10 = rw(); + a10.ka(c10, e10.sc); + return b10; + }; + d7.H = function() { + return "DynamicExtensionParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Md) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.Wd, c10 = a10.Wd; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.ai === a10.ai : false; + } + return false; + }; + d7.Ho = function(a10, b10) { + b10 = new z7().d(yca(Uh(), b10)); + a10 = ts(vs(), a10.va, b10, Od(O7(), a10)); + b10 = this.ai.jt("scalar"); + var c10 = dl().R; + a10 = eb(a10, c10, b10); + b10 = this.Wd; + b10.b() || (b10 = b10.c(), f22(a10, b10, J5(K7(), H10()))); + return a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.Wd; + case 2: + return this.ai; + default: + throw new U6().e("" + a10); + } + }; + function Jba(a10, b10, c10, e10, f10) { + a10.Ca = b10; + a10.Wd = c10; + a10.ai = e10; + a10.m = f10; + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Fr = function() { + var a10 = this.Ca.hb().gb; + if (Q5().Na === a10) { + a10 = this.Ca; + var b10 = IO(); + return this.Ho(N6(a10, b10, this.m), "string"); + } + if (Q5().cj === a10) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "integer"); + if (Q5().of === a10) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "double"); + if (Q5().ti === a10) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "boolean"); + if (Q5().nd === a10) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "nil"); + if (Q5().cd === a10) + return a10 = this.Ca, b10 = lc(), this.ica(N6(a10, b10, this.m), this.Ca); + if (Q5().sa === a10) + return a10 = this.Ca, b10 = qc(), this.tca(N6( + a10, + b10, + this.m + )); + if (Q5().cs === a10) + if (a10 = jH(mF(), this.Ca.t()).pk(), a10 instanceof z7) { + a10 = a10.i; + try { + Xsa(Ysa(), a10); + if (a10.Bt.b()) { + b10 = this.Ca; + var c10 = IO(); + return this.Ho(N6(b10, c10, this.m), "date"); + } + if (a10.Et.b()) { + var e10 = this.Ca, f10 = IO(); + return this.Ho(N6(e10, f10, this.m), "dateTimeOnly"); + } + var g10 = this.Ca, h10 = IO(); + return this.Ho(N6(g10, h10, this.m), "dateTime"); + } catch (k10) { + if (Ph(E6(), k10) instanceof nb) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "string"); + throw k10; + } + } else { + if (y7() === a10) + return a10 = this.Ca, b10 = IO(), this.Ho(N6(a10, b10, this.m), "string"); + throw new x7().d(a10); + } + else + return b10 = this.Ho(nr(or(), a10.Vi.va), "string"), c10 = this.m, e10 = Wd().Cf, f10 = b10.j, g10 = y7(), ec(c10, e10, f10, g10, "Cannot parse data node from AST structure '" + a10 + "'", this.Ca.da), b10; + }; + d7.ica = function(a10, b10) { + hs(); + b10 = Od(O7(), b10); + b10 = new bl().K(new S6().a(), b10); + var c10 = this.ai.jt("array"), e10 = dl().R; + b10 = eb(b10, e10, c10); + c10 = this.Wd; + c10.b() || (c10 = c10.c(), f22(b10, c10, J5(K7(), H10()))); + a10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10 = $ga(Jba(new Md(), h10, new z7().d(g10.j), f10.ai, f10.m).Fr(), g10.j); + return Mqa(g10, h10); + }; + }(this, b10))); + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vHa: 0 }, false, "amf.plugins.document.vocabularies.parser.DynamicExtensionParser", { vHa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function b1a() { + this.m = this.Q = this.X = this.pb = null; + } + b1a.prototype = new u7(); + b1a.prototype.constructor = b1a; + d7 = b1a.prototype; + d7.H = function() { + return "DialectsReferencesParser"; + }; + d7.E = function() { + return 3; + }; + function c1a(a10, b10) { + var c10 = ac(new M6().W(a10.X), "external"); + if (!c10.b()) { + c10 = c10.c().i; + var e10 = qc(); + N6(c10, e10, a10.m).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.m).va; + T6(); + h10 = h10.i; + l10 = f10.m; + var m10 = Dd(); + h10 = N6(h10, m10, l10); + O7(); + l10 = new P6().a(); + l10 = new yO().K(new S6().a(), l10); + m10 = dd().Zc; + k10 = eb(l10, m10, k10); + l10 = dd().Kh; + g10.eR(eb(k10, l10, h10)); + }; + }(a10, b10))); + } + } + function d1a(a10, b10, c10, e10) { + var f10 = ac(new M6().W(a10.X), "uses"); + if (!f10.b()) { + f10 = f10.c().i; + var g10 = qc(); + N6(f10, g10, a10.m).sb.U(w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + var t10 = p10.Aa, v10 = bc(); + v10 = N6(t10, v10, h10.m).va; + var A10 = h10.mba(p10); + t10 = h10.rM(A10); + if (!t10.b()) + if (t10 = t10.c(), t10 instanceof ad) + p10 = B6(t10.g, bd().Kh).A, p10 = new R6().M(p10.b() ? null : p10.c(), A10), h10.oG(k10, new R6().M(v10, p10)), l10.Ht(v10, t10); + else if (Zc(t10)) + p10 = new R6().M(t10.j, A10), h10.oG(k10, new R6().M(v10, p10)), l10.Ht(v10, t10); + else + a: { + if (A10 = h10.m.$V.Ja(A10), A10 instanceof z7) { + var D10 = A10.i; + if (null !== D10) { + l10.Ht(v10, D10); + break a; + } + } + if (y7() === A10) + v10 = h10.m, A10 = Wd().Cf, t10 = "Expected vocabulary module but found: " + t10, D10 = y7(), ec(v10, A10, m10, D10, t10, p10.da); + else + throw new x7().d(A10); + } + }; + }(a10, b10, c10, e10))); + } + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof b1a) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.X, a10.X)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.X; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rM = function(a10) { + a10 = this.Q.Fb(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.$n.Of === c10; + }; + }(this, a10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Jd); + }; + function VNa(a10, b10) { + var c10 = e1a(new f1a(), Rb(Ut(), H10()), a10.m); + a10.Q.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + a: { + if (null !== g10) { + var h10 = g10.Jd, k10 = g10.$n, l10 = g10.ad; + if (h10 instanceof BO && null !== k10 && y7() === l10) { + f10.Ht(k10.Of, h10); + break a; + } + } + null !== g10 && (h10 = g10.Jd, g10 = g10.$n, h10 instanceof u22 && null !== g10 && f10.Ht(g10.Of, h10)); + } + }; + }(a10, c10))); + d1a(a10, a10.pb, c10, b10); + c1a(a10, c10); + return c10; + } + d7.oG = function(a10, b10) { + var c10 = Ab(a10.fa(), q5(Rc)); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = a10.fa(), f10 = e10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof tB) && Of(g10, h10); + f10 = f10.ta(); + } + e10.hf = g10.eb; + b10 = c10.Xb.Zj(b10); + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + if (y7() === c10) { + b10 = [b10]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + e10 = 0; + for (g10 = b10.length | 0; e10 < g10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + throw new x7().d(c10); + }; + function UNa(a10, b10, c10, e10) { + var f10 = new b1a(); + f10.pb = a10; + f10.X = b10; + f10.Q = c10; + f10.m = e10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.mba = function(a10) { + var b10 = a10.i.hb().gb; + if (Q5().wq === b10) + return a10 = a10.i, b10 = bc(), N6(a10, b10, this.m).va; + T6(); + a10 = a10.i; + b10 = this.m; + var c10 = Dd(); + return N6(a10, c10, b10); + }; + d7.$classData = r8({ IHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsReferencesParser", { IHa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function f1a() { + this.m = this.Q = null; + } + f1a.prototype = new u7(); + f1a.prototype.constructor = f1a; + d7 = f1a.prototype; + d7.H = function() { + return "ReferenceDeclarations"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f1a) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ht = function(a10, b10) { + this.Q.Xh(new R6().M(a10, b10)); + if (b10 instanceof ad) + DDa(this.m.rd, a10, b10), a10 = INa(this.m.rd, a10), B6(b10.g, bd().Ic).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + if (h10 instanceof SV) + zDa(g10, h10); + else if (h10 instanceof gO) + BDa(g10, h10); + else + throw new x7().d(h10); + }; + }(this, a10))); + else if (Zc(b10)) + a10 = INa(this.m.rd, a10), b10.tk().U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + if (md(h10)) { + var k10 = g10.GL, l10 = B6(h10.Y(), h10.R).A; + l10 = l10.b() ? null : l10.c(); + g10.GL = k10.cc(new R6().M(l10, h10)); + h10 = g10; + } else + h10 = g10.X4(h10); + return h10; + }; + }(this, a10))); + else if (b10 instanceof BO) { + var c10 = this.m.rd, e10 = this.m.rd.ij; + b10 = jD(new kD(), B6(b10.g, Gc().nb), Lc(b10)); + c10.ij = e10.cc(new R6().M(a10, b10)); + } else if (b10 instanceof u22) + this.m.$V = this.m.$V.Wh(a10, b10); + else + throw new x7().d(b10); + }; + function e1a(a10, b10, c10) { + a10.Q = b10; + a10.m = c10; + return a10; + } + d7.ow = function() { + return this.Q.Ur().xg().Cb(w6(/* @__PURE__ */ function() { + return function(a10) { + return vu(a10); + }; + }(this))).ke(); + }; + d7.z = function() { + return X5(this); + }; + d7.eR = function(a10) { + var b10 = this.Q, c10 = B6(a10.g, dd().Zc).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + b10 = this.m.rd; + c10 = this.m.rd.Vn; + var e10 = B6(a10.g, dd().Zc).A; + e10 = e10.b() ? null : e10.c(); + b10.Vn = c10.cc(new R6().M(e10, a10)); + }; + d7.$classData = r8({ JHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.ReferenceDeclarations", { JHa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function s32() { + this.ea = this.X = this.m = this.kf = null; + } + s32.prototype = new u7(); + s32.prototype.constructor = s32; + function g1a(a10, b10, c10, e10, f10, g10, h10, k10, l10) { + var m10 = e10.hb().gb; + if (Q5().sa === m10) { + m10 = qc(); + m10 = N6(e10, m10, a10.m); + var p10 = h1a(m10); + if ("$ref" === p10) + c10 = i1a(a10, m10, f10, c10), c10.b() ? c10 = y7() : (c10 = c10.c(), c10.x.Lb(new p22().a()), f10 instanceof Cd && VU(c10, f10), c10 = new z7().d(c10)); + else if ("$include" === p10) + c10 = j1a(a10, e10, f10, c10, k10), c10.b() ? c10 = y7() : (c10 = c10.c(), c10.x.Lb(new r22().a()), c10 = new z7().d(c10)); + else if (f10 instanceof Cd) + e10 = k10.b() ? Od(O7(), m10) : k10.c(), e10 = VU(new uO().K(new S6().a(), e10), f10), b10 = K7(), g10 = k1a(a10, e10, m10, J5(b10, new Ib().ha([c10])), c10, f10, g10, h10), Rd(e10, g10), Gba(a10, m10, e10, a10.m.rd, a10.m), B6(f10.g, wj().ej).U(w6(/* @__PURE__ */ function(t10, v10, A10, D10, C10) { + return function(I10) { + var L10 = B6(I10.g, $d().R).A; + L10 = L10.b() ? null : L10.c(); + L10 = ac(new M6().W(v10), L10); + if (L10 instanceof z7) { + L10 = L10.i; + var Y10 = B6(B6(t10.m.Qk.g, Gc().Pj).g, Hc().cz).A; + Y10 = (Y10.b() ? 0 : Y10.c()) && A10 ? D10 + "#/" : D10; + l1a(t10, Y10, L10, I10, C10); + } else if (y7() !== L10) + throw new x7().d(L10); + }; + }(a10, m10, h10, c10, e10))), m1a(a10, g10, f10.j, m10.Za, f10, m10, h10, l10), c10 = new z7().d(e10); + else { + if (!(f10 instanceof ze2)) + throw new x7().d(f10); + h10 = K7(); + c10 = n1a(a10, c10, J5(h10, new Ib().ha([b10])), e10, f10, g10); + } + } else + Q5().Na === m10 || Q5().nd === m10 ? c10 = j1a(a10, e10, f10, c10, k10) : Q5().wq === m10 ? c10 = j1a(a10, e10, f10, c10, k10) : (g10 = a10.m, h10 = Wd().Cf, l10 = y7(), ec( + g10, + h10, + c10, + l10, + "Cannot parse AST node for node in dialect instance", + e10.da + ), c10 = y7()); + c10 instanceof z7 && (e10 = c10.i, a10.m.B1 && o1a(e10, true), f10 instanceof Cd && (a10 = VU(e10, f10), e10 = K7(), f10 = [B6(f10.g, wj().Ut).A, new z7().d(f10.j)], f10 = J5(e10, new Ib().ha(f10)), e10 = new p1a(), g10 = K7(), WU(a10, f10.ec(e10, g10.u)))); + return c10; + } + function q1a(a10, b10, c10) { + b10 = B6(b10.g, $d().nr).A; + if (b10 instanceof z7) { + b10 = b10.i; + c10 = c10.Aa; + var e10 = bc(); + return new z7().d(new R6().M(b10, N6(c10, e10, a10.m).va)); + } + if (y7() === b10) + return y7(); + throw new x7().d(b10); + } + function r1a(a10, b10, c10, e10, f10) { + var g10 = Rb(Gb().ab, H10()), h10 = c10.Aa, k10 = bc(); + h10 = N6(h10, k10, a10.m).va; + ii(); + k10 = [h10]; + for (var l10 = -1 + (k10.length | 0) | 0, m10 = H10(); 0 <= l10; ) + m10 = ji(k10[l10], m10), l10 = -1 + l10 | 0; + k10 = s1a(b10, m10); + l10 = t32(e10); + if (null !== l10 && 1 < l10.jb()) + if (b10 = K7(), a10 = n1a(a10, k10, J5(b10, new Ib().ha([h10])), c10.i, e10, g10), a10 instanceof z7) + t1a(f10, e10, a10.i, c10.i); + else { + if (y7() !== a10) + throw new x7().d(a10); + } + else + null !== l10 && 1 === l10.jb() && (h10 = B6(a10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return v10.j === t10.ga(); + }; + }(a10, l10))), h10 instanceof z7 && (h10 = h10.i, md(h10) && (a10 = u1a(a10, b10, k10, c10.i, h10, g10), a10 instanceof z7 && t1a( + f10, + e10, + a10.i, + c10.i + )))); + } + function v1a(a10, b10) { + b10 = "root" === b10 ? a10.m.Noa : a10.m.Vma; + var c10 = B6(B6(a10.m.Qk.g, Gc().Pj).g, Hc().Iy).A; + if (c10.b()) + var e10 = y7(); + else + e10 = c10.c(), e10 = new z7().d(0 <= (e10.length | 0) && "/" === e10.substring(0, 1) ? e10 : "/" + e10); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(Ed(ua(), e10, "/") ? e10 : e10 + "/")); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + c10 = Mc(ua(), c10, "/"); + for (var f10 = -1 + c10.n.length | 0, g10 = H10(); 0 <= f10; ) + g10 = ji(c10.n[f10], g10), f10 = -1 + f10 | 0; + c10 = new z7().d(g10); + } + c10 = c10.b() ? H10() : c10.c(); + c10 = w1a(a10, c10, a10.X); + c10.b() || (c10 = c10.c(), b10.U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(); + m10 = m10.ya(); + var t10 = k10.sb.Fb(w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + I10 = I10.Aa; + var L10 = bc(); + return N6(I10, L10, D10.m).va === C10; + }; + }(h10, p10))); + if (!t10.b()) { + t10 = t10.c(); + var v10 = h10.kf.da, A10 = l10.b() ? "/" : l10.c(); + p10 = new je4().e(p10); + p10 = v10 + "#" + A10 + jj(p10.td); + v10 = t10.i; + A10 = qc(); + N6(v10, A10, h10.m).sb.U(w6(/* @__PURE__ */ function(D10, C10, I10, L10) { + return function(Y10) { + var ia = Y10.Aa, pa = bc(); + pa = N6(ia, pa, D10.m).va; + ii(); + ia = [pa]; + for (var La = -1 + (ia.length | 0) | 0, ob = H10(); 0 <= La; ) + ob = ji(ia[La], ob), La = -1 + La | 0; + ia = s1a(C10, ob); + La = Y10.i; + ob = Rb(Gb().ab, H10()); + var zb = new z7().d(Od(O7(), Y10)), Zb = y7(); + La = g1a(D10, C10, ia, La, I10, ob, false, zb, Zb); + La instanceof z7 ? (La = La.i, ob = Fw().HX, pa = ih(new jh(), pa, Od(O7(), Y10.Aa)), zb = Od(O7(), Y10.Aa), Rg(La, ob, pa, zb), pa = D10.m.rd, T6(), Y10 = Y10.Aa, ob = D10.m, zb = Dd(), ZXa(pa, N6(Y10, zb, ob), La), D10.m.Ip.jm(ia, La)) : (Y10 = D10.m, La = Wd().Cf, pa = "Cannot parse declaration for node with key '" + pa + "'", ob = L10.i, zb = y7(), ec(Y10, La, ia, zb, pa, ob.da)); + }; + }(h10, p10, m10, t10))); + } + } else + throw new x7().d(m10); + }; + }(a10, c10, e10)))); + } + function x1a(a10) { + a10 = a10.i.hb().gb; + return Q5().ti === a10 ? true : Q5().of === a10 ? true : Q5().Na === a10 ? true : Q5().cj === a10 ? true : Q5().cs === a10; + } + function n1a(a10, b10, c10, e10, f10, g10) { + var h10 = B6(f10.Y(), Ae4().bh), k10 = w6(/* @__PURE__ */ function(t10, v10, A10, D10) { + return function(C10) { + C10 = B6(t10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + var ob = pa.A; + return La.j === (ob.b() ? null : ob.c()); + }; + }(t10, C10))); + if (C10 instanceof z7) + return new z7().d(C10.i); + if (y7() === C10) { + C10 = t10.m; + var I10 = Wd().Cf, L10 = "Cannot find mapping for property " + A10.j + " in union", Y10 = y7(); + ec(C10, I10, v10, Y10, L10, D10.da); + return y7(); + } + throw new x7().d(C10); + }; + }(a10, b10, f10, e10)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + k10 = new y1a(); + l10 = K7(); + k10 = h10.ec(k10, l10.u); + h10 = Vb().Ia(dV(f10)); + var m10 = (h10.b() ? Rb(Gb().ab, H10()) : h10.c()).ne(Rb( + Gb().ab, + H10() + ), Uc(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10, C10) { + C10 = new R6().M(D10, C10); + D10 = C10.Tp; + var I10 = C10.hr; + if (null !== I10) { + C10 = I10.ma(); + I10 = I10.ya(); + var L10 = B6(t10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + return La.j === pa; + }; + }(t10, I10))); + if (L10 instanceof z7 && (L10 = L10.i, L10 instanceof Cd)) + return D10.cc(new R6().M(C10, L10)); + L10 = t10.m; + var Y10 = Wd().Cf; + C10 = "Cannot find mapping for property " + I10 + " in discriminator value '" + C10 + "' in union"; + I10 = y7(); + ec(L10, Y10, v10, I10, C10, A10.da); + return D10; + } + throw new x7().d(C10); + }; + }(a10, b10, e10))); + h10 = new Fc().Vd(m10); + l10 = K7(); + h10 = k10.ia(h10, l10.u).fj(); + l10 = e10.hb().gb; + if (Q5().sa === l10) { + l10 = qc(); + l10 = N6(e10, l10, a10.m); + var p10 = h1a(l10); + if ("$include" === p10) + return b10 = z1a(a10, e10, h10, b10).i, b10.x.Lb(new r22().a()), new z7().d(b10); + if ("$ref" === p10) { + b10 = A1a(a10, l10, h10, b10); + if (b10.b()) + return y7(); + b10 = b10.c(); + b10.x.Lb(new p22().a()); + return new z7().d(b10); + } + f10 = B6(f10.Y(), Ae4().Zt).A; + p10 = pd(g10); + f10 = B1a(a10, b10, k10, m10, f10, l10, kz(p10)); + if (f10.b()) + return c10 = a10.m, g10 = Wd().KX, f10 = h10.jb(), a10 = w6(/* @__PURE__ */ function() { + return function(t10) { + return t10.j; + }; + }(a10)), k10 = K7(), a10 = "Ambiguous node in union range, found 0 compatible mappings from " + f10 + " mappings: [" + h10.ka(a10, k10.u).Kg(",") + "]", f10 = y7(), ec(c10, g10, b10, f10, a10, e10.da), y7(); + if (1 === f10.jb()) + return e10 = VU(FV(GV(), l10), f10.ga()), b10 = k1a(a10, e10, l10, c10, b10, f10.ga(), g10, false), Rd(e10, b10), c10 = H10(), c10 = new qd().d(c10), f10.U(w6(/* @__PURE__ */ function(t10, v10, A10, D10, C10) { + return function(I10) { + var L10 = v10.g.vb, Y10 = mz(); + Y10 = Ua(Y10); + var ia = Id().u; + L10 = Jd(L10, Y10, ia).jb(); + B6(I10.g, wj().ej).U(w6(/* @__PURE__ */ function(La, ob, zb, Zb) { + return function(Cc) { + var vc = ob.g, id = xj(Cc); + if (!vc.vb.Ha(id)) { + if (vc = B6(Cc.g, $d().R).A, vc = vc.b() ? null : vc.c(), vc = zb.sb.Fb(w6(/* @__PURE__ */ function(yd, zd) { + return function(rd) { + rd = rd.Aa; + var sd = bc(); + return N6(rd, sd, yd.m).va === zd; + }; + }(La, vc))), vc instanceof z7) + l1a(La, Zb, vc.i, Cc, ob); + else if (y7() !== vc) + throw new x7().d(vc); + } + }; + }(t10, v10, A10, D10))); + Y10 = v10.g.vb; + ia = mz(); + ia = Ua(ia); + var pa = Id().u; + Jd(Y10, ia, pa).jb() !== L10 ? (L10 = B6(I10.g, wj().Ut), L10 = !oN(L10)) : L10 = false; + L10 && (L10 = C10.oa, Y10 = K7(), I10 = B6(I10.g, wj().Ut).A, I10 = [I10.b() ? null : I10.c()], I10 = J5(Y10, new Ib().ha(I10)), Y10 = K7(), C10.oa = L10.ia(I10, Y10.u)); + }; + }(a10, e10, l10, b10, c10))), b10 = c10.oa, a10 = K7(), c10 = [f10.ga().j], a10 = J5(a10, new Ib().ha(c10)), c10 = K7(), WU(e10, b10.ia(a10, c10.u)), new z7().d(e10); + e10 = a10.m; + c10 = Wd().KX; + g10 = y7(); + h10 = w6(/* @__PURE__ */ function() { + return function(t10) { + return t10.j; + }; + }(a10)); + k10 = K7(); + f10 = "Ambiguous node, please provide a type disambiguator. Nodes " + f10.ka(h10, k10.u).Kg(",") + " have been found compatible, only one is allowed"; + ec(e10, c10, b10, g10, f10, a10.X.da); + return y7(); + } + if (Q5().Na === l10 || Q5().wq === l10) + return z1a(a10, e10, h10, b10); + a10 = a10.m; + c10 = Wd().dN; + g10 = y7(); + ec(a10, c10, b10, g10, "Cannot parse AST for union node mapping", e10.da); + return y7(); + } + function A1a(a10, b10, c10, e10) { + var f10 = ac(new M6().W(b10), "$ref").c().i, g10 = Dd(); + g10 = N6(f10, g10, a10.m); + f10 = 0 <= (g10.length | 0) && "#" === g10.substring(0, 1) ? "" + a10.kf.da + g10 : g10; + var h10 = C1a(a10.m, f10); + h10.b() ? c10 = y7() : (h10 = h10.c(), c10.Od(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return m10.j === tj(l10).j; + }; + }(a10, h10))) ? (c10 = Od(O7(), b10), c10 = kM(h10, g10, c10), c10 = Rd(c10, e10)) : (c10 = FV(GV(), b10), c10 = Rd(c10, e10), lB(c10, f10, b10, a10.m)), c10 = new z7().d(c10)); + return c10.b() ? (c10 = FV(GV(), b10), e10 = Rd(c10, e10), lB(e10, f10, b10, a10.m), new z7().d(e10)) : c10; + } + function u1a(a10, b10, c10, e10, f10, g10) { + var h10 = y7(), k10 = y7(); + return g1a(a10, b10, c10, e10, f10, g10, false, h10, k10); + } + function D1a(a10, b10) { + var c10 = Vb().Ia(B6(a10.m.Qk.g, Gc().Pj)); + if (c10.b()) + return y7(); + var e10 = B6(c10.c().g, Hc().My).Fb(w6(/* @__PURE__ */ function(l10) { + return function(m10) { + fF(); + var p10 = l10.kf.$g.z9(); + p10 = p10.b() ? "" : p10.c(); + p10 = iF(0, p10); + m10 = B6(m10.g, GO().vx).A; + m10 = m10.b() ? null : m10.c(); + return -1 !== (p10.indexOf(m10) | 0); + }; + }(a10))); + if (e10 instanceof z7) { + c10 = a10.m; + e10 = B6(e10.i.g, GO().Vs).A; + c10 = E1a(c10, e10.b() ? null : e10.c()); + if (c10 instanceof z7) { + c10 = c10.i; + b10 = b10.j + "#"; + e10 = b10 + "/"; + T6(); + var f10 = a10.X; + T6(); + f10 = mr(T6(), f10, Q5().sa); + var g10 = Rb(Gb().ab, H10()), h10 = y7(), k10 = y7(); + return g1a(a10, b10, e10, f10, c10, g10, false, h10, k10); + } + return y7(); + } + if (y7() !== e10) + throw new x7().d(e10); + return y7(); + } + function i1a(a10, b10, c10, e10) { + var f10 = Rba(a10, c10), g10 = ac(new M6().W(b10), "$ref").c().i, h10 = Dd(); + h10 = N6(g10, h10, a10.m); + 0 <= (h10.length | 0) && "#" === h10.substring(0, 1) ? g10 = "" + a10.kf.da + h10 : (g10 = a10.kf.da, 0 <= (h10.length | 0) && "/" === h10.substring(0, 1) ? g10 = h10 : -1 !== (h10.indexOf("://") | 0) ? g10 = h10 : 0 <= (h10.length | 0) && "#" === h10.substring(0, 1) ? (g10 = Mc(ua(), g10, "#"), g10 = "" + zj(new Pc().fd(g10)) + h10) : g10 = "" + a10.T_(g10) + h10, -1 !== (g10.indexOf("#") | 0) ? (g10 = Mc(ua(), g10, "#"), g10 = a10.ea.IP(zj(new Pc().fd(g10))) + "#" + Oc(new Pc().fd(g10))) : g10 = a10.ea.IP(g10)); + var k10 = C1a(a10.m, g10); + k10.b() ? f10 = y7() : (k10 = k10.c(), f10.Ha(tj(k10).j) ? (f10 = Od( + O7(), + b10 + ), f10 = kM(k10, h10, f10), f10 = Rd(f10, e10), h10 = K7(), f10 = WU(f10, J5(h10, new Ib().ha([c10.j])))) : (f10 = FV(GV(), b10), f10 = Rd(f10, e10), h10 = K7(), f10 = WU(f10, J5(h10, new Ib().ha([c10.j]))), lB(f10, g10, b10, a10.m)), f10 = new z7().d(f10)); + return f10.b() ? (f10 = FV(GV(), b10), e10 = Rd(f10, e10), f10 = K7(), c10 = WU(e10, J5(f10, new Ib().ha([c10.j]))), lB(c10, g10, b10, a10.m), new z7().d(c10)) : f10; + } + function F1a(a10, b10) { + var c10 = Vb().Ia(B6(a10.m.Qk.g, Gc().Pj)); + if (c10.b()) + return y7(); + var e10 = c10.c(); + c10 = Vb().Ia(B6(e10.g, Hc().De)); + if (c10.b()) + return y7(); + var f10 = c10.c(); + c10 = a10.m; + f10 = B6(f10.g, GO().Vs).A; + c10 = E1a(c10, f10.b() ? null : f10.c()); + if (c10 instanceof z7) { + c10 = c10.i; + f10 = b10.j + "#"; + e10 = B6(e10.g, Hc().Py); + Ic(e10) ? (e10 = B6(a10.m.Qk.g, Gc().R).A, e10 = new z7().d(e10.b() ? null : e10.c())) : e10 = y7(); + var g10 = B6(B6(a10.m.Qk.g, Gc().Pj).g, Hc().cz).A; + (g10.b() ? 0 : g10.c()) ? (g10 = Lc(b10), b10 = g10.b() ? b10.j : g10.c()) : b10 = b10.j + "#/"; + T6(); + g10 = a10.X; + T6(); + return g1a(a10, f10, b10, mr(T6(), g10, Q5().sa), c10, Rb(Gb().ab, H10()), true, y7(), e10); + } + return y7(); + } + function G1a(a10) { + var b10 = Od(O7(), a10.X); + b10 = new pO().K(new S6().a(), b10); + var c10 = a10.kf.da, e10 = Bq().uc; + b10 = eb(b10, e10, c10); + b10 = Rd(b10, a10.kf.da); + c10 = a10.m.Qk.j; + e10 = qO().ig; + b10 = eb(b10, e10, c10); + v1a(a10, "root"); + c10 = H1a(b10, a10.X, a10.kf.Q, a10.m); + e10 = Lc(b10); + c10 = I1a(c10, e10.b() ? b10.j : e10.c()); + if (tc(a10.m.rd.Vn)) { + e10 = new Fc().Vd(a10.m.rd.Vn).Sb.Ye().Dd(); + var f10 = Bd().vh; + Zd(b10, f10, e10); + } + e10 = F1a(a10, b10); + e10 instanceof z7 ? (e10 = e10.i, a10.m.Ip.jm(a10.kf.da + "#/", e10), f10 = Jk().nb, Vd(b10, f10, e10), a10.m.rd.et().Da() && (e10 = a10.m.rd.et(), f10 = Af().Ic, Bf(b10, f10, e10)), c10.ow().Da() && (c10 = c10.ow(), e10 = Gk().xc, Bf(b10, e10, c10)), a10.m.AE.Da() && (c10 = a10.m.AE, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = Lc(g10); + return h10.b() ? g10.j : h10.c(); + }; + }(a10)), f10 = K7(), c10 = c10.ka(e10, f10.u), e10 = qO().Ot, Wr(b10, e10, c10)), b10 = new z7().d(b10)) : b10 = y7(); + Fb(a10.m.ni); + return b10; + } + function J1a(a10, b10, c10, e10, f10) { + var g10 = B6(e10.g, $d().nr).A, h10 = B6(e10.g, $d().Hx).A; + if (g10.na() && h10.na()) { + var k10 = B6(a10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.j; + var A10 = B6(t10.g, Ae4().bh).ga().A; + return v10 === (A10.b() ? null : A10.c()); + }; + }(a10, e10))); + a: { + if (k10 instanceof z7 && (k10 = k10.i, k10 instanceof Cd)) { + var l10 = c10.i, m10 = qc(); + l10 = N6(l10, m10, a10.m).sb; + b10 = w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10, C10) { + return function(I10) { + var L10 = v10.Aa, Y10 = bc(); + L10 = N6(L10, Y10, p10.m).va; + L10 = new je4().e(L10); + L10 = jj(L10.td); + Y10 = I10.Aa; + var ia = bc(); + Y10 = N6(Y10, ia, p10.m).va; + Y10 = new je4().e(Y10); + L10 = t10 + "/" + L10 + "/" + jj(Y10.td); + Y10 = Od(O7(), I10); + Y10 = new uO().K( + new S6().a(), + Y10 + ); + L10 = VU(Rd(Y10, L10), A10); + Y10 = K7(); + ia = B6(A10.g, wj().Ut).A; + ia = [ia.b() ? null : ia.c(), A10.j]; + L10 = WU(L10, J5(Y10, new Ib().ha(ia))); + try { + var pa = rb(new sb(), qb(), KU(LU(), D10.c()), tb(new ub(), vb().qm, "", "", H10())), La = I10.Aa, ob = bc(), zb = ih(new jh(), N6(La, ob, p10.m).va, new P6().a()), Zb = Od(O7(), I10.Aa); + Rg(L10, pa, zb, Zb); + var Cc = rb(new sb(), qb(), KU(LU(), C10.c()), tb(new ub(), vb().qm, "", "", H10())), vc = I10.i, id = bc(), yd = ih(new jh(), N6(vc, id, p10.m).va, new P6().a()), zd = Od(O7(), I10.i); + Rg(L10, Cc, yd, zd); + } catch (rd) { + throw rd; + } + return new z7().d(L10); + }; + }(a10, b10, c10, k10, g10, h10)); + a10 = rw(); + b10 = l10.ka(b10, a10.sc); + a10 = new u32(); + g10 = rw(); + b10 = b10.ec(a10, g10.sc); + break a; + } + a10 = a10.m; + g10 = Wd().Cf; + h10 = B6(e10.g, Ae4().bh).ga().A; + h10 = "Cannot find mapping for property range of mapValue property: " + (h10.b() ? null : h10.c()); + k10 = y7(); + ec(a10, g10, b10, k10, h10, c10.da); + b10 = H10(); + } + K1a(f10, e10, b10, c10.Aa); + } else + e10 = a10.m, f10 = Wd().Cf, a10 = y7(), ec(e10, f10, b10, a10, "Both 'mapKey' and 'mapValue' are mandatory in a map pair property mapping", c10.da); + } + function L1a(a10, b10, c10, e10) { + var f10 = e10.Ja(b10.j); + if (y7() === f10) + e10.jm(b10.j, true); + else { + a10 = a10.m; + e10 = Wd().Cf; + f10 = b10.j; + b10 = "Duplicated element in collection " + b10.j; + var g10 = y7(); + ec(a10, e10, f10, g10, b10, c10.da); + } + } + function w1a(a10, b10, c10) { + a: + for (; ; ) { + if (H10().h(b10)) + return new z7().d(c10); + if (b10 instanceof Vt) { + var e10 = b10; + b10 = e10.Nf; + var f10 = false, g10 = null; + c10 = ac(new M6().W(c10), e10.Wn); + if (c10 instanceof z7) { + f10 = true; + g10 = c10; + c10 = g10.i; + e10 = c10.i.hb().gb; + var h10 = Q5().sa; + if (e10 === h10) + if (tc(b10)) { + f10 = c10.i; + g10 = qc(); + c10 = f10 = N6(f10, g10, a10.m); + continue a; + } else + return jc(kc(c10.i), qc()); + } + f10 && (b10 = g10.i, a10 = a10.m, f10 = Wd().Cf, g10 = "Invalid node type for declarations path " + b10.i.hb().gb.Vi.va, c10 = y7(), ec(a10, f10, "", c10, g10, b10.da)); + return y7(); + } + throw new x7().d(b10); + } + } + function j1a(a10, b10, c10, e10, f10) { + var g10 = a10.m.hp(b10); + if (g10 instanceof ve4) { + g10 = g10.i; + var h10 = new R6().M(g10, bYa(a10.m.rd, g10, c10, Ys())); + } else + g10 = bc(), g10 = N6(b10, g10, a10.m).va, h10 = new R6().M(g10, bYa(a10.m.rd, g10, c10, Zs())); + if (null !== h10) { + g10 = h10.ma(); + var k10 = h10.ya(); + if (null !== g10 && k10 instanceof z7) + return a10 = k10.i, b10 = f10.b() ? Od(O7(), b10) : f10.c(), a10 = kM(a10, g10, b10), b10 = K7(), a10 = WU(a10, J5(b10, new Ib().ha([c10.j]))), a10 = Rd(a10, e10), new z7().d(a10); + } + if (null !== h10 && (g10 = h10.ma(), null !== g10)) + return h10 = f10.b() ? Od(O7(), b10) : f10.c(), h10 = new uO().K(new S6().a(), h10), e10 = Rd(h10, e10), h10 = K7(), c10 = WU(e10, J5(h10, new Ib().ha([c10.j]))), e10 = f10.b() ? y7() : Ab( + f10.c(), + q5(Qu) + ), e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.ad)), b10 = e10.b() ? b10 : e10.c(), lB(c10, g10, b10, a10.m), new z7().d(c10); + throw new x7().d(h10); + } + function m1a(a10, b10, c10, e10, f10, g10, h10, k10) { + h10 = h10 ? a10.m.B2 : J5(Gb().Qg, H10()); + f10 = B6(f10.g, wj().ej); + var l10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = B6(p10.g, $d().R).A; + return p10.b() ? null : p10.c(); + }; + }(a10)), m10 = K7(); + h10 = f10.ka(l10, m10.u).xg().OW(h10); + l10 = pd(e10); + f10 = Xd().u; + f10 = se4(l10, f10); + for (l10 = l10.th.Er(); l10.Ya(); ) + m10 = l10.$a(), f10.jd(m10.re().va); + k10 = f10.Rc().Cb(w6(/* @__PURE__ */ function() { + return function(p10) { + return !(0 <= (p10.length | 0) && "$" === p10.substring(0, 1)) && !(0 <= (p10.length | 0) && "(" === p10.substring(0, 1)) && !(0 <= (p10.length | 0) && "x-" === p10.substring(0, 2)); + }; + }(a10))).Si(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return t10.Ha(v10); + }; + }( + a10, + k10 + ))).xg().dO(h10); + tc(k10) && k10.U(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = t10.mb(); + a: { + for (; I10.Ya(); ) { + var L10 = I10.$a(); + if (L10.ma().t() === C10) { + I10 = new z7().d(L10); + break a; + } + } + I10 = y7(); + } + I10.b() ? I10 = y7() : (I10 = I10.c(), I10 = new z7().d(I10.ya())); + I10 = I10.b() ? v10 : I10.c(); + Nba(p10.m, A10, C10, D10, I10); + }; + }(a10, e10, g10, b10, c10))); + } + function M1a(a10, b10, c10, e10) { + var f10 = b10.i.hb().gb; + if (Q5().cd === f10) { + f10 = b10.i; + var g10 = tw(); + f10 = N6(f10, g10, a10.m).Cm; + a10 = w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + return N1a(k10, p10, l10, m10).ua(); + }; + }(a10, c10, e10)); + g10 = rw(); + a10 = f10.bd(a10, g10.sc); + f10 = a10.kc(); + f10 instanceof z7 && (f10 = f10.i, f10 instanceof R6 && "link" === f10.ma() && sp(f10.ya()) && (f10 = new v32(), g10 = rw(), a10 = a10.ec(f10, g10.sc))); + } else + a: { + if (f10 = false, g10 = null, a10 = N1a(a10, b10.i, c10, e10), a10 instanceof z7) { + f10 = true; + g10 = a10; + var h10 = g10.i; + if (h10 instanceof R6 && (a10 = h10.ma(), h10 = h10.ya(), "link" === a10)) { + a10 = J5(K7(), new Ib().ha([h10])); + break a; + } + } + f10 ? (a10 = g10.i, a10 = J5(K7(), new Ib().ha([a10]))) : a10 = H10(); + } + O1a( + e10, + c10, + a10, + b10 + ); + } + function P1a(a10, b10, c10, e10) { + c10 = B6(c10.g, $d().nr).A; + if (c10 instanceof z7) { + c10 = c10.i; + try { + var f10 = rb(new sb(), qb(), KU(LU(), c10), tb(new ub(), vb().qm, "", "", H10())), g10 = e10.Aa, h10 = bc(), k10 = ih(new jh(), N6(g10, h10, a10.m).va, new P6().a()), l10 = Od(O7(), e10.Aa); + return Rg(b10, f10, k10, l10); + } catch (m10) { + throw m10; + } + } else { + if (y7() === c10) + return b10; + throw new x7().d(c10); + } + } + function Q1a(a10, b10, c10, e10, f10, g10) { + var h10 = a10.m.hp(b10.i); + if (h10 instanceof ve4) { + h10 = h10.i; + var k10 = $Xa(a10.m.rd, h10, Ys()); + } else + h10 = b10.i, k10 = bc(), h10 = N6(h10, k10, a10.m).va, k10 = $Xa(a10.m.rd, h10, Xs()); + if (null !== h10 && k10 instanceof z7) { + k10 = k10.i; + var l10 = Ec().kq.vK(tj(k10).j); + b: { + if (l10 instanceof z7) { + var m10 = l10.i; + if (null !== m10) { + m10 = m10.ma(); + l10 = a10.m; + a10 = a10.m.AE; + m10 = J5(K7(), new Ib().ha([m10])); + var p10 = K7(); + l10.AE = a10.ia(m10, p10.u); + a10 = Od(O7(), b10.i); + a10 = kM(k10, h10, a10); + e10 = Rd(a10, e10); + g10 && e10.x.Lb(new r22().a()); + t1a(f10, c10, e10, b10.i); + break b; + } + } + if (y7() === l10) + c10 = a10.m, f10 = Wd().Cf, g10 = "Cannot find dialect for anyNode node mapping " + tj(k10).j, b10 = b10.i, a10 = y7(), ec(c10, f10, e10, a10, g10, b10.da); + else + throw new x7().d(l10); + } + } else + c10 = a10.m, f10 = Wd().Cf, g10 = "anyNode reference must be to a known node or an external fragment, unknown value: '" + b10.i + "'", b10 = b10.i, a10 = y7(), ec(c10, f10, e10, a10, g10, b10.da); + } + function k1a(a10, b10, c10, e10, f10, g10, h10, k10) { + k10 ? (k10 = B6(B6(a10.m.Qk.g, Gc().Pj).g, Hc().cz).A, k10 = !(k10.b() || !k10.c())) : k10 = false; + if (k10) + return f10; + if (ac(new M6().W(c10), "$id").na()) + return e10 = ac(new M6().W(c10), "$id").c().i, c10 = bc(), e10 = N6(e10, c10, a10.m).va, -1 !== (e10.indexOf("://") | 0) ? a10 = e10 : (c10 = Lc(a10.m.Qk), a10 = c10.b() ? a10.m.Qk.j : c10.c(), a10 = Mc(ua(), a10, "#"), a10 = (zj(new Pc().fd(a10)) + "#" + e10).split("##").join("#")), b10.x.Lb(new n22().a()), a10; + k10 = B6(g10.g, wj().Ax); + if (oN(k10)) + a10 = R1a(g10).Da() ? S1a(a10, b10, c10, e10, f10, g10, h10) : f10; + else { + f10 = B6(g10.g, wj().Ax).A; + f10 = f10.b() ? null : f10.c(); + g10 = new qg().e("(\\{[^}]+\\})"); + h10 = H10(); + for (g10 = ai(new rg().vi(g10.ja, h10), f10); g10.Ya(); ) { + k10 = g10.Tw(); + h10 = k10.split("{").join("").split("}").join(""); + var l10 = ac(new M6().W(c10), h10); + if (l10 instanceof z7) + h10 = l10.i.i.re().t(), f10 = f10.split(k10).join(h10); + else if (y7() === l10) { + k10 = a10.m; + l10 = Wd().Cf; + var m10 = b10.j; + h10 = "Missing ID template variable '" + h10 + "' in node"; + var p10 = y7(); + ec(k10, l10, m10, p10, h10, c10.da); + } else + throw new x7().d(l10); + } + -1 !== (f10.indexOf("://") | 0) ? a10 = f10 : (b10 = f10, 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) ? a10 = a10.kf.da + "#" + f10 : (b10 = f10, 0 <= (b10.length | 0) && "#" === b10.substring(0, 1) ? a10 = "" + a10.kf.da + f10 : (b10 = f10, b10 = Mc(ua(), b10, "/"), b10 = new Pc().fd(b10), c10 = K7(), b10 = e10.ia(b10, c10.u).Kg("/"), e10 = a10.kf.da, a10 = 0 <= (b10.length | 0) && b10.substring(0, e10.length | 0) === e10 || -1 !== (b10.indexOf("#") | 0) ? b10 : a10.kf.da + "#" + b10))); + } + return a10; + } + function T1a(a10, b10) { + var c10 = false, e10 = null, f10 = ac(new M6().W(a10.X), "$target"); + a: { + if (f10 instanceof z7) { + c10 = true; + e10 = f10; + f10 = e10.i; + var g10 = f10.i.hb().gb, h10 = Q5().Na; + if (g10 === h10) { + c10 = a10.ea; + e10 = f10.i; + f10 = Dd(); + a10 = c10.IP(N6(e10, f10, a10.m)); + c10 = UDa().mc; + eb(b10, c10, a10); + break a; + } + } + c10 && (f10 = e10.i, a10 = a10.m, c10 = Wd().Cf, e10 = b10.j, f10 = f10.i, g10 = y7(), ec(a10, c10, e10, g10, "Patch $target must be a valid URL", f10.da)); + } + return b10; + } + function U1a(a10, b10, c10) { + a10.kf = b10; + a10.m = c10; + a10.ea = nv().ea; + b10 = b10.$g.Xd; + var e10 = qc(); + a10.X = N6(b10, e10, c10); + return a10; + } + function z1a(a10, b10, c10, e10) { + var f10 = a10.m.hp(b10); + if (f10 instanceof ve4) { + f10 = f10.i; + var g10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return bYa(k10.m.rd, l10, m10, Ys()); + }; + }(a10, f10)), h10 = K7(); + c10 = c10.ka(g10, h10.u); + f10 = new R6().M(f10, Jc(c10, new V1a())); + } else + f10 = bc(), f10 = N6(b10, f10, a10.m).va, g10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return bYa(k10.m.rd, l10, m10, Zs()); + }; + }(a10, f10)), h10 = K7(), c10 = c10.ka(g10, h10.u), f10 = new R6().M(f10, Jc(c10, new W1a())); + if (null !== f10 && (c10 = f10.ma(), g10 = f10.ya(), null !== c10 && g10 instanceof z7)) + return a10 = g10.i, b10 = Od(O7(), b10.re()), a10 = kM(a10, c10, b10), e10 = Rd(a10, e10), new z7().d(e10); + if (null !== f10 && (b10 = f10.ma(), null !== b10)) + return c10 = FV(GV(), a10.X), e10 = Rd(c10, e10), lB(e10, b10, a10.X, a10.m), new z7().d(e10); + throw new x7().d(f10); + } + function l1a(a10, b10, c10, e10, f10) { + var g10 = MDa(e10); + if (YCa() === g10) + if (g10 = c10.i.hb().gb, Q5().Na === g10 || Q5().wq === g10) + Q1a(a10, c10, e10, b10, f10, false); + else if (Q5().sa === g10) { + g10 = c10.i; + var h10 = qc(); + g10 = N6(g10, h10, a10.m); + var k10 = ac(new M6().W(g10), "$dialect"); + a: { + if (k10 instanceof z7) { + h10 = k10.i; + var l10 = h10.i.hb().gb, m10 = Q5().Na; + if (l10 === m10) { + g10 = h10.i; + k10 = bc(); + g10 = N6(g10, k10, a10.m).va; + l10 = Ec().kq.vK(g10); + b: { + if (l10 instanceof z7 && (k10 = l10.i, null !== k10)) { + l10 = k10.ma(); + g10 = k10.ya(); + h10 = a10.m; + k10 = a10.m.AE; + m10 = J5(K7(), new Ib().ha([l10])); + var p10 = K7(); + h10.AE = k10.ia(m10, p10.u); + h10 = a10.m; + k10 = h10.Qk; + h10.Qk = l10; + h10.B2 = X1a(h10); + ii(); + l10 = c10.Aa; + m10 = bc(); + l10 = [N6(l10, m10, a10.m).va]; + m10 = -1 + (l10.length | 0) | 0; + for (p10 = H10(); 0 <= m10; ) + p10 = ji(l10[m10], p10), m10 = -1 + m10 | 0; + l10 = s1a(b10, p10); + b10 = u1a(a10, b10, l10, c10.i, g10, Rb(Gb().ab, H10())); + if (b10 instanceof z7) + t1a(f10, e10, b10.i, c10.i); + else if (y7() !== b10) + throw new x7().d(b10); + h10.Qk = k10; + h10.B2 = X1a(h10); + break b; + } + if (y7() === l10) + f10 = a10.m, e10 = Wd().Cf, c10 = "Cannot find dialect for nested anyNode mapping " + g10, a10 = h10.i, g10 = y7(), ec(f10, e10, b10, g10, c10, a10.da); + else + throw new x7().d(l10); + } + break a; + } + } + if (y7() === k10) + if (c10 = h1a(g10), "$include" === c10) + c10 = ac(new M6().W(g10), "$include").c(), Q1a(a10, c10, e10, b10, f10, true); + else if ("$ref" === c10) + if (c10 = ac(new M6().W(g10), "$ref").c().i, h10 = Dd(), c10 = N6(c10, h10, a10.m), h10 = 0 <= (c10.length | 0) && "#" === c10.substring(0, 1) ? "" + a10.kf.da + c10 : c10, h10 = C1a(a10.m, h10), h10.b() ? h10 = y7() : (h10 = h10.c(), k10 = Od(O7(), g10), h10 = kM(h10, c10, k10), h10 = new z7().d(Rd(h10, b10))), h10 instanceof z7) + b: { + if (h10 = h10.i, k10 = Ec().kq.vK(tj(h10).j), k10 instanceof z7 && (l10 = k10.i, null !== l10)) { + l10 = l10.ma(); + k10 = a10.m; + a10 = a10.m.AE; + l10 = J5(K7(), new Ib().ha([l10])); + m10 = K7(); + k10.AE = a10.ia(l10, m10.u); + a10 = Od(O7(), g10); + c10 = kM(h10, c10, a10); + b10 = Rd(c10, b10); + t1a(f10, e10, b10, (T6(), T6(), mr(T6(), g10, Q5().sa))); + break b; + } + if (y7() === k10) + f10 = a10.m, e10 = Wd().Cf, c10 = "Cannot find dialect for anyNode node mapping " + tj(h10).j, a10 = y7(), ec(f10, e10, b10, a10, c10, g10.da); + else + throw new x7().d(k10); + } + else if (y7() === h10) + f10 = a10.m, e10 = Wd().Cf, c10 = "anyNode reference must be to a known node or an external fragment, unknown JSON Pointer: '" + c10 + "'", a10 = y7(), ec(f10, e10, b10, a10, c10, g10.da); + else + throw new x7().d(h10); + else + f10 = a10.m, e10 = Wd().Cf, c10 = y7(), ec(f10, e10, b10, c10, "$dialect key without string value or link", g10.da); + else + throw new x7().d(k10); + } + } else + throw new x7().d(g10); + else if ($Ca() === g10) + a: { + if (b10 = false, g10 = null, a10 = N1a(a10, c10.i, e10, f10), a10 instanceof z7 && (b10 = true, g10 = a10, a10 = g10.i, "boolean" === typeof a10)) { + Y1a(f10, e10, !!a10, c10); + break a; + } + if (b10 && (a10 = g10.i, Ca(a10))) { + Z1a(f10, e10, a10 | 0, c10); + break a; + } + if (b10 && (a10 = g10.i, na(a10))) { + $1a(f10, e10, +a10, c10); + break a; + } + if (b10 && (a10 = g10.i, "number" === typeof a10)) { + a2a(f10, e10, +a10, c10); + break a; + } + if (b10 && (a10 = g10.i, sp(a10))) { + b2a(f10, e10, a10, c10); + break a; + } + if (b10 && (h10 = g10.i, h10 instanceof R6 && (a10 = h10.ma(), h10 = h10.ya(), "link" === a10 && sp(h10)))) { + b2a(f10, e10, h10, c10); + break a; + } + b10 && (a10 = g10.i, a10 instanceof DN && (b10 = xj(e10), e10 = ih(new jh(), a10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg(f10, b10, e10, c10))); + } + else + bDa() === g10 ? M1a(a10, c10, e10, f10) : WN() === g10 ? r1a(a10, b10, c10, e10, f10) : YN() === g10 ? c2a(a10, b10, c10, e10, f10) : TN() === g10 ? d2a(a10, b10, c10, e10, f10) : fDa() === g10 ? J1a(a10, b10, c10, e10, f10) : (f10 = a10.m, a10 = Wd().Cf, e10 = "Unknown type of node property " + e10.j, g10 = y7(), ec( + f10, + a10, + b10, + g10, + e10, + c10.da + )); + } + function s1a(a10, b10) { + var c10; + for (c10 = a10; !b10.b(); ) + a10 = b10.ga(), Ed(ua(), c10, "/") ? (a10 = new je4().e(a10), c10 = "" + c10 + jj(a10.td)) : (a10 = new je4().e(a10), c10 = c10 + "/" + jj(a10.td)), b10 = b10.ta(); + return c10; + } + function S1a(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new Uj().eq(true), l10 = J5(K7(), H10()); + l10 = new qd().d(l10); + R1a(g10).U(w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + var I10 = B6(C10.g, $d().R).A; + I10 = I10.b() ? null : I10.c(); + var L10 = p10.sb.Fb(w6(/* @__PURE__ */ function(pa, La) { + return function(ob) { + ob = ob.Aa; + var zb = bc(); + return N6(ob, zb, pa.m).va === La; + }; + }(m10, I10))); + a: { + if (L10 instanceof z7 && (L10 = L10.i, x1a(L10))) { + I10 = t10.oa; + C10 = K7(); + L10 = [L10.i.re().va]; + C10 = J5(C10, new Ib().ha(L10)); + L10 = K7(); + t10.oa = I10.ia(C10, L10.u); + break a; + } + C10 = B6(C10.g, $d().Yh).A; + C10 = v10.Ja(C10.b() ? null : C10.c()); + if (C10 instanceof z7) + C10 = C10.i, I10 = t10.oa, C10 = J5(K7(), new Ib().ha([ka(C10)])), L10 = K7(), t10.oa = I10.ia(C10, L10.u); + else { + C10 = m10.m; + L10 = Wd().Cf; + var Y10 = A10.j; + I10 = "Cannot find unique mandatory property '" + I10 + "'"; + var ia = y7(); + ec(C10, L10, Y10, ia, I10, p10.da); + D10.oa = false; + } + } + }; + }(a10, c10, l10, h10, b10, k10))); + return k10.oa ? (a10 = w6(/* @__PURE__ */ function() { + return function(m10) { + m10 = new je4().e(m10); + return ba.encodeURI(m10.td); + }; + }(a10)), b10 = K7(), e10 = e10.ka(a10, b10.u).Kg("/"), l10 = l10.oa.Kg("_"), l10 = new je4().e(l10), e10 + "/" + ba.encodeURI(l10.td)) : f10; + } + s32.prototype.Gp = function() { + return this.m; + }; + function N1a(a10, b10, c10, e10) { + var f10 = false, g10 = false, h10 = false, k10 = false, l10 = false, m10 = b10.hb().gb; + if (Q5().ti === m10) { + f10 = true; + var p10 = B6(c10.g, $d().Gf).A; + (p10.b() ? null : p10.c()) === Uh().Mi ? p10 = true : (p10 = B6(c10.g, $d().Gf).A, p10 = (p10.b() ? null : p10.c()) === Uh().Yr); + if (p10) + return c10 = pM(), new z7().d(N6(b10, c10, a10.m)); + } + if (f10) + return a10 = a10.m, e10 = e10.j, l10 = B6(c10.g, $d().Gf).A, l10 = l10.b() ? null : l10.c(), m10 = Uh().Mi, Lba(a10, e10, c10, l10, m10, b10), y7(); + if (Q5().cj === m10 && (g10 = true, f10 = B6(c10.g, $d().Gf).A, (f10.b() ? null : f10.c()) === Uh().hi ? f10 = true : (f10 = B6(c10.g, $d().Gf).A, f10 = (f10.b() ? null : f10.c()) === Uh().Xo), f10 ? f10 = true : (f10 = B6(c10.g, $d().Gf).A, f10 = (f10.b() ? null : f10.c()) === Uh().Yr), f10)) + return c10 = TAa(), new z7().d(N6(b10, c10, a10.m)); + if (g10) + return a10 = a10.m, e10 = e10.j, l10 = B6(c10.g, $d().Gf).A, l10 = l10.b() ? null : l10.c(), m10 = Uh().hi, Lba(a10, e10, c10, l10, m10, b10), y7(); + if (Q5().Na === m10 && (h10 = true, g10 = B6(c10.g, $d().Gf).A, (g10.b() ? null : g10.c()) === Uh().zj ? g10 = true : (g10 = B6(c10.g, $d().Gf).A, g10 = (g10.b() ? null : g10.c()) === Uh().Yr), g10)) + return c10 = bc(), new z7().d(N6(b10, c10, a10.m).va); + h10 ? (g10 = B6(c10.g, $d().Gf).A, g10 = (g10.b() ? null : g10.c()) === Uh().zp) : g10 = false; + if (g10) + return c10 = bc(), new z7().d(N6(b10, c10, a10.m).va); + h10 ? (g10 = B6(c10.g, $d().Gf).A, g10 = g10.b() ? null : g10.c(), f10 = F6().Eb, g10 = g10 === ic(G5(f10, "link"))) : g10 = false; + if (g10) + return c10 = bc(), new z7().d(new R6().M("link", N6(b10, c10, a10.m).va)); + h10 ? (g10 = B6(c10.g, $d().Gf).A, (g10.b() ? null : g10.c()) === Uh().hw ? g10 = true : (g10 = B6(c10.g, $d().Gf).A, g10 = (g10.b() ? null : g10.c()) === Uh().jo), g10 ? g10 = true : (g10 = B6(c10.g, $d().Gf).A, g10 = (g10.b() ? null : g10.c()) === Uh().tj)) : g10 = false; + if (g10) + return b10 = mr(T6(), b10.re(), Q5().cs), c10 = nTa(), new z7().d(N6(b10, c10, a10.m)); + h10 ? (g10 = B6(c10.g, $d().Gf).A, g10 = g10.b() ? null : g10.c(), f10 = F6().Eb, g10 = g10 === ic(G5(f10, "guid"))) : g10 = false; + if (g10) + return c10 = bc(), new z7().d(N6(b10, c10, a10.m).va); + if (h10) + return a10 = a10.m, e10 = e10.j, l10 = B6(c10.g, $d().Gf).A, l10 = l10.b() ? null : l10.c(), m10 = Uh().zj, Lba(a10, e10, c10, l10, m10, b10), y7(); + if (Q5().of === m10 && (k10 = true, h10 = B6(c10.g, $d().Gf).A, (h10.b() ? null : h10.c()) === Uh().of ? h10 = true : (h10 = B6(c10.g, $d().Gf).A, h10 = (h10.b() ? null : h10.c()) === Uh().Xo), h10 ? h10 = true : (h10 = B6(c10.g, $d().Gf).A, h10 = (h10.b() ? null : h10.c()) === Uh().Nh), h10 ? h10 = true : (h10 = B6(c10.g, $d().Gf).A, h10 = (h10.b() ? null : h10.c()) === Uh().Yr), h10)) + return c10 = qTa(), new z7().d(N6(b10, c10, a10.m)); + if (k10) + return a10 = a10.m, e10 = e10.j, l10 = B6(c10.g, $d().Gf).A, l10 = l10.b() ? null : l10.c(), m10 = Uh().of, Lba(a10, e10, c10, l10, m10, b10), y7(); + if (Q5().cs === m10 && (l10 = true, k10 = B6(c10.g, $d().Gf).A, (k10.b() ? null : k10.c()) === Uh().hw ? k10 = true : (k10 = B6(c10.g, $d().Gf).A, k10 = (k10.b() ? null : k10.c()) === Uh().jo), k10 ? k10 = true : (k10 = B6(c10.g, $d().Gf).A, k10 = (k10.b() ? null : k10.c()) === Uh().tj), k10 ? k10 = true : (k10 = B6(c10.g, $d().Gf).A, k10 = (k10.b() ? null : k10.c()) === Uh().Yr), k10)) + return c10 = nTa(), new z7().d(N6(b10, c10, a10.m)); + l10 ? (k10 = B6(c10.g, $d().Gf).A, k10 = (k10.b() ? null : k10.c()) === Uh().zj) : k10 = false; + if (k10) + return c10 = bc(), new z7().d(N6(b10, c10, a10.m).va); + if (l10) + return l10 = a10.m, e10 = e10.j, m10 = B6(c10.g, $d().Gf).A, m10 = m10.b() ? null : m10.c(), k10 = Uh().tj, Lba(l10, e10, c10, m10, k10, b10), c10 = Dd(), new z7().d(N6(b10, c10, a10.m)); + if (Q5().nd === m10) + return y7(); + c10 = a10.m; + l10 = Wd().Cf; + e10 = e10.j; + m10 = "Unsupported scalar type " + b10.hb().gb; + k10 = y7(); + ec(c10, l10, e10, k10, m10, b10.da); + c10 = Dd(); + return new z7().d(N6( + b10, + c10, + a10.m + )); + } + function h1a(a10) { + return ac(new M6().W(a10), "$include").na() ? "$include" : ac(new M6().W(a10), "$ref").na() ? "$ref" : "inline"; + } + function B1a(a10, b10, c10, e10, f10, g10, h10) { + if (f10 instanceof z7) { + c10 = f10.i; + h10 = g10.sb.Fb(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10 = m10.Aa; + var p10 = bc(); + return N6(m10, p10, k10.m).va === l10; + }; + }(a10, c10))); + h10.b() ? e10 = y7() : (h10 = h10.c().i, f10 = bc(), e10 = e10.Ja(N6(h10, f10, a10.m).va)); + if (e10 instanceof z7) + return a10 = e10.i, J5(K7(), new Ib().ha([a10])); + if (y7() === e10) + return a10 = a10.m, e10 = Wd().Cf, c10 = "Cannot find discriminator value for discriminator '" + c10 + "'", h10 = y7(), ec(a10, e10, b10, h10, c10, g10.da), H10(); + throw new x7().d(e10); + } + if (y7() === f10) + return b10 = g10.sb, g10 = w6(/* @__PURE__ */ function(k10) { + return function(l10) { + l10 = l10.Aa; + var m10 = bc(); + return N6(l10, m10, k10.m).va; + }; + }(a10)), e10 = rw(), b10 = b10.ka(g10, e10.sc).xg(), c10.Cb(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + p10 = B6(p10.g, wj().ej).Cb(w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + I10 = B6(I10.g, $d().Yh).A; + return !C10.Ha(I10.b() ? null : I10.c()); + }; + }(k10, l10))); + var t10 = p10.Cb(w6(/* @__PURE__ */ function() { + return function(D10) { + D10 = B6(D10.g, $d().ji); + return 0 < vEa(D10); + }; + }(k10))), v10 = w6(/* @__PURE__ */ function() { + return function(D10) { + D10 = B6(D10.g, $d().R).A; + return D10.b() ? null : D10.c(); + }; + }(k10)), A10 = K7(); + t10 = t10.ka(v10, A10.u).xg(); + v10 = w6(/* @__PURE__ */ function() { + return function(D10) { + D10 = B6(D10.g, $d().R).A; + return D10.b() ? null : D10.c(); + }; + }(k10)); + A10 = K7(); + p10 = p10.ka(v10, A10.u).xg(); + return m10.dO(p10).b() && t10.dO(m10).b(); + }; + }( + a10, + h10, + b10 + ))); + throw new x7().d(f10); + } + s32.prototype.T_ = function(a10) { + if (-1 !== (a10.indexOf("#") | 0)) { + a10 = Mc(ua(), a10, "#"); + var b10 = zj(new Pc().fd(a10)); + } else + b10 = a10; + a10 = new qg().e(b10); + b10 = b10.lastIndexOf("/") | 0; + return w32(a10, b10).ma() + "/"; + }; + function c2a(a10, b10, c10, e10, f10) { + var g10 = Rb(Gb().ab, H10()), h10 = Rb(Ut(), H10()), k10 = c10.i.hb().gb; + if (Q5().cd === k10) { + k10 = c10.i; + var l10 = tw(); + k10 = N6(k10, l10, a10.m).Cm; + } else + k10 = J5(K7(), new Ib().ha([c10.i])); + l10 = K7(); + k10 = k10.og(l10.u); + a10 = w6(/* @__PURE__ */ function(m10, p10, t10, v10, A10, D10) { + return function(C10) { + if (null !== C10) { + var I10 = C10.ma(); + C10 = C10.Ki(); + ii(); + var L10 = p10.Aa, Y10 = bc(); + C10 = [N6(L10, Y10, m10.m).va, "" + C10]; + L10 = -1 + (C10.length | 0) | 0; + for (Y10 = H10(); 0 <= L10; ) + Y10 = ji(C10[L10], Y10), L10 = -1 + L10 | 0; + L10 = Y10; + C10 = s1a(t10, L10); + Y10 = t32(v10); + if (null !== Y10 && 1 < Y10.jb()) { + C10 = n1a(m10, C10, L10, I10, v10, A10); + if (C10.b()) + return y7(); + C10 = C10.c(); + L1a(m10, C10, I10, D10); + return new z7().d(C10); + } + if (null !== Y10 && 1 === Y10.jb() && (L10 = B6(m10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + return La.j === pa.ga(); + }; + }(m10, Y10))), L10 instanceof z7 && (L10 = L10.i, md(L10)))) { + C10 = u1a(m10, t10, C10, I10, L10, A10); + if (C10 instanceof z7) + return C10 = C10.i, L1a(m10, C10, I10, D10), new z7().d(C10); + if (y7() !== C10) + throw new x7().d(C10); + } + return y7(); + } + throw new x7().d(C10); + }; + }(a10, c10, b10, e10, g10, h10)); + b10 = K7(); + a10 = k10.ka(a10, b10.u); + b10 = new e2a(); + g10 = K7(); + a10 = a10.ec(b10, g10.u); + K1a(f10, e10, a10, c10.i); + } + function d2a(a10, b10, c10, e10, f10) { + var g10 = Rb(Gb().ab, H10()), h10 = c10.i, k10 = qc(); + h10 = N6(h10, k10, a10.m).sb; + a10 = w6(/* @__PURE__ */ function(l10, m10, p10, t10, v10) { + return function(A10) { + ii(); + var D10 = m10.Aa, C10 = bc(); + D10 = N6(D10, C10, l10.m).va; + C10 = A10.Aa; + var I10 = bc(); + D10 = [D10, N6(C10, I10, l10.m).va]; + C10 = -1 + (D10.length | 0) | 0; + for (I10 = H10(); 0 <= C10; ) + I10 = ji(D10[C10], I10), C10 = -1 + C10 | 0; + C10 = I10; + D10 = s1a(p10, C10); + I10 = q1a(l10, t10, A10); + a: { + if (I10 instanceof z7) { + var L10 = I10.i; + if (null !== L10) { + I10 = L10.ma(); + L10 = L10.ya(); + I10 = v10.cc(new R6().M(I10, L10)); + break a; + } + } + I10 = v10; + } + L10 = t32(t10); + a: + if (null !== L10 && 1 < L10.jb()) + L10 = B6(t10.g, $d().Hx).A, I10 = L10 instanceof z7 ? I10.cc(new R6().M(L10.i, "")) : I10, D10 = n1a(l10, D10, C10, A10.i, t10, I10); + else { + if (null !== L10 && 1 === L10.jb() && (C10 = B6(l10.m.Qk.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + return La.j === pa.ga(); + }; + }(l10, L10))), C10 instanceof z7 && (C10 = C10.i, md(C10)))) { + L10 = A10.i.hb().gb; + var Y10 = Q5().nd; + if (L10 !== Y10) { + D10 = u1a(l10, p10, D10, A10.i, C10, I10); + break a; + } + } + D10 = y7(); + } + if (D10 instanceof z7) + return new z7().d(P1a(l10, D10.i, t10, A10)); + if (y7() === D10) + return y7(); + throw new x7().d(D10); + }; + }(a10, c10, b10, e10, g10)); + b10 = rw(); + a10 = h10.ka(a10, b10.sc); + b10 = new f2a(); + g10 = rw(); + K1a(f10, e10, a10.ec(b10, g10.sc), c10.i); + } + s32.prototype.$classData = r8({ QHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser", { QHa: 1, f: 1, $r: 1, ib: 1, wHa: 1, $Ha: 1 }); + function g2a() { + this.m = this.Q = this.X = this.hT = null; + } + g2a.prototype = new u7(); + g2a.prototype.constructor = g2a; + d7 = g2a.prototype; + d7.H = function() { + return "DialectInstanceReferencesParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g2a) { + var b10 = this.hT, c10 = a10.hT; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.X, a10.X)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hT; + case 1: + return this.X; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + function h2a(a10, b10, c10) { + c10 = c10.i; + var e10 = qc(); + N6(c10, e10, a10.m).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.m).va; + T6(); + h10 = h10.i; + l10 = f10.m; + var m10 = Dd(); + h10 = N6(h10, m10, l10); + O7(); + l10 = new P6().a(); + l10 = new yO().K(new S6().a(), l10); + m10 = dd().Zc; + k10 = eb(l10, m10, k10); + l10 = dd().Kh; + g10.eR(eb(k10, l10, h10)); + }; + }(a10, b10))); + } + d7.t = function() { + return V5(W5(), this); + }; + function i2a(a10, b10, c10, e10) { + var f10 = J5(DB(), H10()), g10 = ac(new M6().W(a10.X), "uses"); + if (!g10.b()) { + g10 = g10.c(); + var h10 = Ab(Od(O7(), g10.Aa), q5(jd)); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(h10.yc.$d.cf)); + h10 = new l22().ue((h10.b() ? 0 : h10.c()) | 0); + b10.fa().Lb(h10); + g10 = g10.i; + h10 = qc(); + N6(g10, h10, a10.m).sb.U(w6(/* @__PURE__ */ function(k10, l10, m10, p10, t10) { + return function(v10) { + var A10 = v10.Aa, D10 = bc(); + D10 = N6(A10, D10, k10.m).va; + var C10 = k10.mba(v10); + A10 = k10.rM(C10); + if (!A10.b()) + if (A10 = A10.c(), Zc(A10)) + l10.Tm(C10), v10 = new R6().M(A10.j, C10), k10.oG(m10, new R6().M(D10, v10)), p10.Ht(D10, A10); + else { + D10 = k10.m; + C10 = Wd().Cf; + A10 = "Expected vocabulary module but found: '" + A10 + "'"; + var I10 = y7(); + ec(D10, C10, t10, I10, A10, v10.da); + } + }; + }(a10, f10, b10, c10, e10))); + } + a10.Q.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + if (null !== p10 && (p10 = p10.Jd, p10 instanceof x32)) { + var t10 = Lc(p10); + l10.Ha(t10.b() ? p10.j : t10.c()) || m10.Ht(p10.j, p10); + } + }; + }(a10, f10, c10))); + } + function I1a(a10, b10) { + var c10 = j2a(new k2a(), Rb(Ut(), H10()), a10.m); + i2a(a10, a10.hT, c10, b10); + l2a(a10, c10); + a10.Q.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.Jd, k10 = g10.$n; + g10 = g10.ad; + h10 instanceof y32 && null !== k10 && y7() === g10 && f10.Ht(k10.Of, h10); + } + }; + }(a10, c10))); + a10.m.B1 && a10.Q.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.Jd, k10 = g10.$n; + g10 = g10.ad; + h10 instanceof pO && null !== k10 && y7() === g10 && f10.Ht(k10.Of, h10); + } + }; + }(a10, c10))); + return c10; + } + d7.rM = function(a10) { + a10 = this.Q.Fb(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.$n.Of === c10; + }; + }(this, a10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Jd); + }; + d7.oG = function(a10, b10) { + var c10 = Ab(a10.fa(), q5(Rc)); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = a10.fa(), f10 = e10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof tB) && Of(g10, h10); + f10 = f10.ta(); + } + e10.hf = g10.eb; + b10 = c10.Xb.Zj(b10); + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + if (y7() === c10) { + b10 = [b10]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + e10 = 0; + for (g10 = b10.length | 0; e10 < g10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + throw new x7().d(c10); + }; + d7.z = function() { + return X5(this); + }; + function H1a(a10, b10, c10, e10) { + var f10 = new g2a(); + f10.hT = a10; + f10.X = b10; + f10.Q = c10; + f10.m = e10; + return f10; + } + function l2a(a10, b10) { + var c10 = ac(new M6().W(a10.X), "external"); + c10.b() || (c10 = c10.c(), h2a(a10, b10, c10)); + c10 = ac(new M6().W(a10.X), "$external"); + c10.b() || (c10 = c10.c(), h2a(a10, b10, c10)); + } + d7.mba = function(a10) { + var b10 = a10.i.hb().gb; + if (Q5().wq === b10) + return a10 = a10.i, b10 = bc(), N6(a10, b10, this.m).va; + if (Q5().sa === b10) { + b10 = a10.i; + var c10 = qc(); + b10 = N6(b10, c10, this.m); + b10 = ac(new M6().W(b10), "$include").na(); + } else + b10 = false; + if (b10) + return a10 = a10.i, b10 = qc(), a10 = N6(a10, b10, this.m), a10 = ac(new M6().W(a10), "$include").c().i, b10 = Dd(), N6(a10, b10, this.m); + T6(); + a10 = a10.i; + b10 = this.m; + c10 = Dd(); + return N6(a10, c10, b10); + }; + d7.$classData = r8({ ZHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceReferencesParser", { ZHa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function k2a() { + this.m = this.Q = null; + } + k2a.prototype = new u7(); + k2a.prototype.constructor = k2a; + d7 = k2a.prototype; + d7.H = function() { + return "ReferenceDeclarations"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k2a) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ht = function(a10, b10) { + this.Q.Xh(new R6().M(a10, b10)); + b10 instanceof ad && DDa(this.m.rd, a10, b10); + if (Zc(b10)) { + var c10 = YXa(this.m.rd, a10); + b10.tk().U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + if (k10 instanceof uO) { + var l10 = m2a(k10); + ZXa(g10, l10, k10); + Eb(f10.m.ni, h10 + "." + l10, k10); + } else + return g10.X4(k10); + }; + }(this, c10, a10))); + } else if (b10 instanceof y32) { + c10 = this.m.rd; + var e10 = this.m.rd.ij; + b10 = jD(new kD(), B6(b10.g, qO().nb), Lc(b10)); + c10.ij = e10.cc(new R6().M(a10, b10)); + } else + throw new x7().d(b10); + }; + function j2a(a10, b10, c10) { + a10.Q = b10; + a10.m = c10; + return a10; + } + d7.ow = function() { + return this.Q.Ur().xg().Cb(w6(/* @__PURE__ */ function() { + return function(a10) { + return vu(a10); + }; + }(this))).ke(); + }; + d7.z = function() { + return X5(this); + }; + d7.eR = function(a10) { + var b10 = this.Q, c10 = B6(a10.g, dd().Zc).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + b10 = this.m.rd; + c10 = this.m.rd.Vn; + var e10 = B6(a10.g, dd().Zc).A; + e10 = e10.b() ? null : e10.c(); + b10.Vn = c10.cc(new R6().M(e10, a10)); + }; + d7.$classData = r8({ aIa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.ReferenceDeclarations", { aIa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function n2a() { + this.m = this.Q = null; + } + n2a.prototype = new u7(); + n2a.prototype.constructor = n2a; + d7 = n2a.prototype; + d7.H = function() { + return "ReferenceDeclarations"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n2a) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ht = function(a10, b10) { + this.Q.Xh(new R6().M(a10, b10)); + var c10 = this.m.rd.G$(a10); + if (b10 instanceof ad) + o2a(this.m, a10, b10), B6(b10.g, bd().Ic).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (g10 instanceof SV) + zDa(f10, g10); + else if (g10 instanceof gO) + BDa(f10, g10); + else + throw new x7().d(g10); + }; + }(this, c10))); + else + throw new x7().d(b10); + }; + d7.ow = function() { + return this.Q.Ur().xg().Cb(w6(/* @__PURE__ */ function() { + return function(a10) { + return vu(a10); + }; + }(this))).ke(); + }; + d7.z = function() { + return X5(this); + }; + d7.eR = function(a10) { + var b10 = this.Q, c10 = B6(a10.g, dd().Zc).A; + c10 = c10.b() ? null : c10.c(); + b10.Xh(new R6().M(c10, a10)); + b10 = this.m.rd; + c10 = this.m.rd.Vn; + var e10 = B6(a10.g, dd().Zc).A; + e10 = e10.b() ? null : e10.c(); + b10.Vn = c10.cc(new R6().M(e10, a10)); + }; + d7.$classData = r8({ bIa: 0 }, false, "amf.plugins.document.vocabularies.parser.vocabularies.ReferenceDeclarations", { bIa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function p2a() { + this.m = this.Q = this.X = null; + } + p2a.prototype = new u7(); + p2a.prototype.constructor = p2a; + d7 = p2a.prototype; + d7.H = function() { + return "VocabulariesReferencesParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof p2a && Bj(this.X, a10.X)) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function q2a(a10, b10) { + var c10 = ac(new M6().W(a10.X), "external"); + if (!c10.b()) { + c10 = c10.c().i; + var e10 = qc(); + N6(c10, e10, a10.m).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.m).va; + h10 = h10.i; + l10 = bc(); + h10 = N6(h10, l10, f10.m).va; + O7(); + l10 = new P6().a(); + l10 = new yO().K(new S6().a(), l10); + var m10 = dd().Zc; + k10 = eb(l10, m10, k10); + l10 = dd().Kh; + g10.eR(eb(k10, l10, h10)); + }; + }(a10, b10))); + } + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function r2a(a10, b10, c10) { + var e10 = ac(new M6().W(a10.X), "uses"); + if (!e10.b()) { + e10 = e10.c().i; + var f10 = qc(); + N6(e10, f10, a10.m).sb.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = l10.Aa, p10 = bc(); + m10 = N6(m10, p10, g10.m).va; + p10 = l10.i; + var t10 = bc(); + t10 = N6(p10, t10, g10.m).va; + p10 = g10.rM(t10); + if (!p10.b()) + if (p10 = p10.c(), Zc(p10)) + l10 = new R6().M(p10.j, t10), h10.Ht(m10, g10.oG(p10, new R6().M(m10, l10))); + else { + m10 = g10.m; + t10 = Wd().Yfa; + p10 = "Expected vocabulary module but found: " + p10; + var v10 = y7(); + ec(m10, t10, k10, v10, p10, l10.da); + } + }; + }(a10, b10, c10))); + } + } + function mDa(a10, b10, c10) { + var e10 = new p2a(); + e10.X = a10; + e10.Q = b10; + e10.m = c10; + return e10; + } + function nDa(a10, b10) { + var c10 = new n2a(), e10 = Rb(Ut(), H10()), f10 = a10.m; + c10.Q = e10; + c10.m = f10; + r2a(a10, c10, b10); + q2a(a10, c10); + return c10; + } + d7.rM = function(a10) { + a10 = this.Q.Fb(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.$n.Of === c10; + }; + }(this, a10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Jd); + }; + d7.oG = function(a10, b10) { + var c10 = Ab(a10.fa(), q5(Rc)); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = a10.fa(), f10 = e10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof tB) && Of(g10, h10); + f10 = f10.ta(); + } + e10.hf = g10.eb; + b10 = c10.Xb.Zj(b10); + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + if (y7() === c10) { + b10 = [b10]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + e10 = 0; + for (g10 = b10.length | 0; e10 < g10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + throw new x7().d(c10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dIa: 0 }, false, "amf.plugins.document.vocabularies.parser.vocabularies.VocabulariesReferencesParser", { dIa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function s2a() { + var a10 = K7(), b10 = [qea(), rea(), lea(), kea(), mea(), nea(), pea(), jea(), oea()]; + return J5(a10, new Ib().ha(b10)); + } + function t2a(a10, b10, c10, e10) { + var f10 = Mo().q8; + a10 = "Unsupported '" + e10 + "' on " + a10.gi() + " plugin"; + e10 = Lc(b10); + e10 = e10.b() ? b10.j : e10.c(); + var g10 = y7(), h10 = y7(), k10 = y7(); + c10.Gc(f10.j, a10, g10, e10, h10, Yb().qb, k10); + return b10; + } + function u2a(a10) { + a10.E_(a10.Gg().ve()); + a10.F_(false); + } + function v2a() { + var a10 = K7(), b10 = Cea(), c10 = vCa(); + w2a || (w2a = new x2a().a()); + return J5(a10, new Ib().ha([b10, c10, w2a])); + } + function y2a() { + wYa || (wYa = new D22().a()); + var a10 = new R6().M("parsed-json-schema", wYa); + xYa || (xYa = new E22().a()); + var b10 = new R6().M("parsed-raml-datatype", xYa); + lXa || (lXa = new O1().a()); + var c10 = new R6().M("external-fragment-ref", lXa); + sYa || (sYa = new z22().a()); + var e10 = new R6().M("json-schema-id", sYa); + kXa || (kXa = new M1().a()); + var f10 = new R6().M("declared-element", kXa); + mXa || (mXa = new S1().a()); + var g10 = new R6().M("inline-element", mXa); + uYa || (uYa = new A22().a()); + var h10 = new R6().M("local-link-path", uYa); + qYa || (qYa = new w22().a()); + var k10 = new R6().M( + "extension-provenance", + qYa + ); + rYa || (rYa = new x22().a()); + var l10 = new R6().M("form-body-parameter", rYa); + vYa || (vYa = new B22().a()); + var m10 = new R6().M("parameter-name-for-payload", vYa); + zYa || (zYa = new F22().a()); + var p10 = new R6().M("required-param-payload", zYa); + iXa || (iXa = new K1().a()); + a10 = [a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, new R6().M("auto-generated-name", iXa)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + return b10.eb; + } + function z32() { + t22.call(this); + this.moa = 0; + this.Tqa = this.S5 = null; + this.sia = false; + } + z32.prototype = new dYa(); + z32.prototype.constructor = z32; + function z2a() { + } + d7 = z2a.prototype = z32.prototype; + d7.a = function() { + t22.prototype.a.call(this); + this.moa = Sea().bna; + this.S5 = "JSON + Refs"; + this.Tqa = J5(K7(), new Ib().ha([this.S5])); + this.sia = true; + return this; + }; + d7.NE = function() { + return new HO().a(); + }; + d7.dy = function() { + return H10(); + }; + d7.tA = function(a10) { + var b10 = a10.$g; + if (b10 instanceof Dc) { + O7(); + var c10 = new P6().a(); + c10 = new Pk().K(new S6().a(), c10); + c10 = Rd(c10, a10.da + "#/"); + var e10 = a10.xe, f10 = Ok().Rd; + c10 = eb(c10, f10, e10); + e10 = Ok().Nd; + c10 = eb(c10, e10, "application/json"); + c10.$g = new z7().d(b10.Xd.Fd); + b10 = a10.Q; + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.Jd; + }; + }(this)); + f10 = K7(); + b10 = b10.ka(e10, f10.u); + O7(); + e10 = new P6().a(); + e10 = new Mk().K(new S6().a(), e10); + f10 = a10.da; + var g10 = Bq().uc; + e10 = eb(e10, g10, f10); + e10 = Rd(e10, a10.da); + f10 = Jk().nb; + c10 = Vd(e10, f10, c10); + a10 = a10.da; + e10 = Bq().uc; + a10 = eb(c10, e10, a10); + b10.Da() && (c10 = Gk().xc, Bf(a10, c10, b10)); + return new z7().d(a10); + } + return y7(); + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha(["application/json"])); + }; + d7.Pca = function() { + return this.moa; + }; + d7.pF = function() { + return this.Tqa; + }; + d7.PE = function(a10) { + return a10; + }; + d7.gi = function() { + return this.S5; + }; + d7.wr = function() { + return H10(); + }; + d7.nB = function(a10) { + return yja($f(), a10.xe); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return nu(); + }; + d7.gB = function() { + return this.sia; + }; + d7.$classData = r8({ aha: 0 }, false, "amf.plugins.document.webapi.ExternalJsonRefsPlugin", { aha: 1, bha: 1, bD: 1, f: 1, Zr: 1, ib: 1 }); + function A2a() { + t22.call(this); + } + A2a.prototype = new dYa(); + A2a.prototype.constructor = A2a; + A2a.prototype.a = function() { + t22.prototype.a.call(this); + return this; + }; + A2a.prototype.$classData = r8({ FIa: 0 }, false, "amf.plugins.document.webapi.JsonSchemaPlugin$", { FIa: 1, bha: 1, bD: 1, f: 1, Zr: 1, ib: 1 }); + var B2a = void 0; + function wCa() { + B2a || (B2a = new A2a().a()); + return B2a; + } + function UW() { + this.Id = null; + } + UW.prototype = new u7(); + UW.prototype.constructor = UW; + function A32() { + } + d7 = A32.prototype = UW.prototype; + d7.H = function() { + return "RamlHeader"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof UW ? this.Id === a10.Id : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Id; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.Id = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + function rx(a10) { + a10 = "\\s*" + Bx(ua(), a10.Id, " ", "\\\\s*") + "\\s*"; + a10 = new qg().e(a10); + var b10 = H10(); + return new rg().vi(a10.ja, b10); + } + d7.$classData = r8({ $v: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader", { $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function ox() { + this.fr = null; + } + ox.prototype = new u7(); + ox.prototype.constructor = ox; + d7 = ox.prototype; + d7.a = function() { + this.fr = J5(DB(), H10()); + return this; + }; + d7.H = function() { + return "AbstractVariables"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof ox && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function C2a(a10, b10) { + var c10 = Fu().yN; + c10 = ai(c10, b10); + b10 = new HZa(); + for (b10.eV = c10; b10.Ya(); ) + c10 = b10.$a(), a10.fr.Tm(Cda(c10, 1)); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.AbstractVariables", { yLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sy() { + this.m = this.Yk = this.X = this.Fe = null; + } + Sy.prototype = new u7(); + Sy.prototype.constructor = Sy; + d7 = Sy.prototype; + d7.H = function() { + return "AnnotationParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Sy) { + var b10 = this.Fe, c10 = a10.Fe; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.X, a10.X)) + return b10 = this.Yk, a10 = a10.Yk, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + case 1: + return this.X; + case 2: + return this.Yk; + default: + throw new U6().e("" + a10); + } + }; + function Ry(a10, b10, c10, e10, f10) { + a10.Fe = b10; + a10.X = c10; + a10.Yk = e10; + a10.m = f10; + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + function pna(a10, b10) { + var c10 = ac(new M6().W(a10.X), b10); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = c10.i.hb().gb, f10 = Q5().sa; + if (e10 === f10) { + e10 = FFa(); + f10 = a10.Fe.j; + c10 = c10.i; + var g10 = qc(); + c10 = EFa(e10, f10, N6(c10, g10, a10.m), H10(), a10.m); + c10.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = Vb().Ia(B6(l10.g, Ud().zi)); + l10.b() || l10.c().fa().Lb(new Q22().e(k10)); + }; + }(a10, b10))); + b10 = Vb().Ia(B6(a10.Fe.Y(), Yd(nc()))); + b10 = b10.b() ? H10() : b10.c(); + c10.Da() && (a10 = a10.Fe, e10 = K7(), b10 = b10.ia(c10, e10.u), c10 = Yd(nc()), Zd(a10, c10, b10)); + } + } + } + d7.hd = function() { + var a10 = EFa(FFa(), this.Fe.j, this.X, this.Yk, this.m), b10 = Vb().Ia(B6(this.Fe.Y(), Yd(nc()))), c10 = b10.b() ? H10() : b10.c(); + if (a10.Da()) { + b10 = this.Fe; + var e10 = K7(); + a10 = c10.ia(a10, e10.u); + c10 = Yd(nc()); + Zd(b10, c10, a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ zLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.AnnotationParser", { zLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function D2a() { + this.m = this.ai = this.Wd = this.zh = this.Ca = null; + } + D2a.prototype = new u7(); + D2a.prototype.constructor = D2a; + d7 = D2a.prototype; + d7.tca = function(a10) { + qs(); + var b10 = Od(O7(), a10); + b10 = new Xk().K(new S6().a(), b10); + var c10 = this.ai.jt("object"), e10 = dl().R; + b10 = eb(b10, e10, c10); + c10 = this.Wd; + c10.b() || (c10 = c10.c(), f22(b10, c10, J5(K7(), H10()))); + a10 = a10.sb; + c10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.m).va; + C2a(f10.zh, k10); + l10 = h10.i; + h10 = Od(O7(), h10); + l10 = $ga(px(l10, f10.zh, new z7().d(g10.j), f10.ai, f10.m).Fr(), g10.j); + return oC(g10, k10, l10, h10); + }; + }(this, b10)); + e10 = rw(); + a10.ka(c10, e10.sc); + return b10; + }; + d7.H = function() { + return "DataNodeParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof D2a) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.zh, c10 = a10.zh; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.Wd, c10 = a10.Wd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.ai === a10.ai : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.zh; + case 2: + return this.Wd; + case 3: + return this.ai; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Fr = function() { + var a10 = this.Ca.hb().gb; + if (Q5().cd === a10) { + a10 = this.Ca; + var b10 = lc(); + return this.ica(N6(a10, b10, this.m), this.Ca); + } + return Q5().sa === a10 ? (a10 = this.Ca, b10 = qc(), this.tca(N6(a10, b10, this.m))) : E2a(F2a(this.zh, this.Wd, this.ai, this.m), this.Ca); + }; + d7.ica = function(a10, b10) { + hs(); + b10 = Od(O7(), b10); + b10 = new bl().K(new S6().a(), b10); + var c10 = this.ai.jt("array"), e10 = dl().R; + b10 = eb(b10, e10, c10); + c10 = this.Wd; + c10.b() || (c10 = c10.c(), f22(b10, c10, J5(K7(), H10()))); + c10 = J5(Ef(), H10()); + e10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + return Dg(h10, $ga(px(l10, g10.zh, new z7().d(k10.j), g10.ai, g10.m).Fr(), k10.j)); + }; + }(this, c10, b10)); + var f10 = K7(); + a10.ka(e10, f10.u); + TBa(b10, c10); + return b10; + }; + function px(a10, b10, c10, e10, f10) { + var g10 = new D2a(); + g10.Ca = a10; + g10.zh = b10; + g10.Wd = c10; + g10.ai = e10; + g10.m = f10; + return g10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ BLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.DataNodeParser", { BLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function WW() { + this.m = this.Yk = this.tb = this.Wd = this.Ri = null; + } + WW.prototype = new u7(); + WW.prototype.constructor = WW; + d7 = WW.prototype; + d7.H = function() { + return "ExtensionParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof WW && this.Ri === a10.Ri && this.Wd === a10.Wd && this.tb === a10.tb) { + var b10 = this.Yk; + a10 = a10.Yk; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ri; + case 1: + return this.Wd; + case 2: + return this.tb; + case 3: + return this.Yk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function GOa(a10, b10) { + b10 = Vb().Ia(B6(b10.g, Sk().DF)); + if (b10 instanceof z7) { + var c10 = b10.i; + if (c10.Da() && tc(a10.Yk)) { + b10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = h10.A; + return h10.b() ? null : h10.c(); + }; + }(a10)); + var e10 = K7(); + if (c10.ka(b10, e10.u).gp(a10.Yk).b()) { + b10 = Zx().TW.Ja(a10.Yk.ga()); + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + var k10 = Zx().TW; + h10 = h10.A; + return k10.Ja(h10.b() ? null : h10.c()).ua(); + }; + }(a10)); + var f10 = K7(), g10 = c10.bd(e10, f10.u); + c10 = a10.m; + e10 = sg().Z5; + f10 = a10.Wd; + b10 = "Annotation " + a10.Ri + " not allowed in target " + (b10.b() ? "" : b10.c()) + ", allowed targets: " + g10.Kg(", "); + a10 = a10.tb; + g10 = y7(); + ec(c10, e10, f10, g10, b10, a10.da); + } + } + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.ExtensionParser", { DLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function G2a() { + this.Qc = this.Nma = this.wc = this.p = this.Ph = this.kf = null; + } + G2a.prototype = new u7(); + G2a.prototype.constructor = G2a; + d7 = G2a.prototype; + d7.H = function() { + return "JsonSchemaEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G2a) { + var b10 = this.kf, c10 = a10.kf; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Ph, c10 = a10.Ph, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 && this.p === a10.p ? this.wc === a10.wc : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.kf; + case 1: + return this.Ph; + case 2: + return this.p; + case 3: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function kYa(a10, b10, c10, e10) { + var f10 = new G2a(); + f10.kf = a10; + f10.Ph = b10; + f10.p = c10; + f10.wc = e10; + a10 = new YW(); + if (null === f10) + throw mb(E6(), null); + a10.l = f10; + f10.Nma = a10; + a10 = K7(); + KOa || (KOa = new ZW().a()); + a10 = J5(a10, new Ib().ha([KOa, f10.Nma])); + b10 = f10.p; + c10 = f10.Ph; + e10 = tD(); + var g10 = J5(K7(), H10()); + b10 = b10.zb(new L22().Jw(c10, e10, g10, new gy().cU(f10.wc.F8, f10.wc)).Qc); + c10 = K7(); + f10.Qc = a10.ia(b10, c10.u); + return f10; + } + d7.sB = function() { + var a10 = OA(), b10 = new PA().e(a10.pi), c10 = new qg().e(a10.mi); + tc(c10) && QA(b10, a10.mi); + c10 = b10.s; + var e10 = b10.ca, f10 = new rr().e(e10); + jr(wr(), this.Qc, f10); + pr(c10, mr(T6(), tr(ur(), f10.s, e10), Q5().sa)); + return new RA().Ac(SA(zs(), a10.pi), b10.s); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ELa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.JsonSchemaEmitter", { ELa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function XV() { + this.Bc = this.p = this.Cl = null; + } + XV.prototype = new u7(); + XV.prototype.constructor = XV; + d7 = XV.prototype; + d7.H = function() { + return "PayloadEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof XV ? this.Cl === a10.Cl ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Cl; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function qOa(a10, b10, c10, e10) { + a10.Cl = b10; + a10.p = c10; + a10.Bc = e10; + return a10; + } + d7.sB = function() { + var a10 = iy(new jy(), this.Cl, this.p, false, Rb(Ut(), H10()), this.Bc), b10 = OA(), c10 = new PA().e(b10.pi), e10 = new qg().e(b10.mi); + tc(e10) && QA(c10, b10.mi); + a10.Ob(c10); + return new RA().Ac(SA(zs(), b10.pi), c10.s); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ JLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.PayloadEmitter", { JLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function H2a() { + this.m = this.ai = this.Wd = this.zh = null; + } + H2a.prototype = new u7(); + H2a.prototype.constructor = H2a; + d7 = H2a.prototype; + d7.H = function() { + return "ScalarNodeParser"; + }; + function I2a(a10, b10, c10) { + c10 = fHa(Oua(Rua(), b10, c10.da.Rf, a10.m)); + c10 = Cj(c10).Fd; + return JHa(c10) ? (vs(), c10 = new z7().d(Uh().zj), b10 = ts(0, b10, c10, (O7(), new P6().a())), a10 = a10.Wd, a10 = (a10.b() ? "" : a10.c()) + "/included", Rd(b10, a10)) : px(c10, a10.zh, a10.Wd, a10.ai, a10.m).Fr(); + } + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof H2a) { + var b10 = this.zh, c10 = a10.zh; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Wd, c10 = a10.Wd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.ai === a10.ai : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zh; + case 1: + return this.Wd; + case 2: + return this.ai; + default: + throw new U6().e("" + a10); + } + }; + d7.Ho = function(a10, b10) { + b10 = new z7().d(yca(Uh(), b10)); + b10 = ts(vs(), a10.va, b10, Od(O7(), a10)); + var c10 = this.ai.jt("scalar"), e10 = dl().R; + b10 = eb(b10, e10, c10); + c10 = this.Wd; + c10.b() || (c10 = c10.c(), f22(b10, c10, J5(K7(), H10()))); + C2a(this.zh, a10.va); + return b10; + }; + function E2a(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().Na === c10) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "string"); + if (Q5().cj === c10) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "integer"); + if (Q5().of === c10) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "double"); + if (Q5().ti === c10) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "boolean"); + if (Q5().nd === c10) + return b10 = jc(kc(b10), bc()), a10.Ho(b10.b() ? nr(or(), "null") : b10.c(), "nil"); + if (Q5().cs === c10) + if (c10 = jH(mF(), b10.t()).pk(), c10 instanceof z7) { + c10 = c10.i; + try { + Xsa(Ysa(), c10); + if (c10.Bt.b()) { + var e10 = bc(); + return a10.Ho(N6(b10, e10, a10.m), "date"); + } + if (c10.Et.b()) { + var f10 = bc(); + return a10.Ho(N6( + b10, + f10, + a10.m + ), "dateTimeOnly"); + } + var g10 = bc(); + return a10.Ho(N6(b10, g10, a10.m), "dateTime"); + } catch (k10) { + if (Ph(E6(), k10) instanceof nb) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "string"); + throw k10; + } + } else { + if (y7() === c10) + return c10 = bc(), a10.Ho(N6(b10, c10, a10.m), "string"); + throw new x7().d(c10); + } + else { + e10 = b10.hb().gb; + f10 = Q5().wq; + if (e10 === f10) + return J2a(a10, b10); + e10 = a10.Ho(nr(or(), c10.Vi.va), "string"); + a10 = a10.m; + f10 = dc().gS; + g10 = e10.j; + var h10 = y7(); + ec(a10, f10, g10, h10, "Cannot parse scalar node from AST structure '" + c10 + "'", b10.da); + return e10; + } + } + d7.t = function() { + return V5(W5(), this); + }; + function F2a(a10, b10, c10, e10) { + var f10 = new H2a(); + f10.zh = a10; + f10.Wd = b10; + f10.ai = c10; + f10.m = e10; + return f10; + } + function J2a(a10, b10) { + var c10 = b10.re(); + if (c10 instanceof xt) { + var e10 = false, f10 = null, g10 = a10.m.Df.Fb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.$n.Of === k10.va; + }; + }(a10, c10))); + if (g10 instanceof z7 && (e10 = true, f10 = g10, g10 = f10.i, g10.Jd instanceof Mk)) + return c10 = B6(ar(g10.Jd.g, Jk().nb).g, Ok().Rd).A, c10 = c10.b() ? null : c10.c(), I2a(a10, c10, b10); + if (e10 && (b10 = f10.i, ev(b10.Jd))) + return QM(K2a(a10, c10.va), b10.Jd.qe()); + b10 = a10.m.Dl().ij.Ja(c10.va); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.ww)); + return b10 instanceof z7 ? (b10 = b10.i, QM(K2a(a10, c10.va), b10)) : K2a(a10, c10.va); + } + return K2a(a10, b10.re().t()); + } + d7.z = function() { + return X5(this); + }; + function K2a(a10, b10) { + if (-1 !== (b10.indexOf(":") | 0)) + return a10 = cha(dha(), b10, b10, (O7(), new P6().a())), b10 = Iha(new je4().e(b10)), Rd(a10, b10); + a10 = a10.Wd; + a10 = a10.b() ? "#" : a10.c(); + a10 = Mc(ua(), a10, "#"); + var c10 = zj(new Pc().fd(a10)); + if (Ed(ua(), c10, "/")) + a10 = c10; + else { + if (-1 !== (c10.indexOf("://") | 0)) { + a10 = Mc(ua(), c10, "://"); + a10 = zj(new Pc().fd(a10)); + c10 = Mc(ua(), c10, "://"); + c10 = Oc(new Pc().fd(c10)); + var e10 = Mc(ua(), c10, "/"); + c10 = -1 + e10.n.length | 0; + c10 = 0 < c10 ? c10 : 0; + var f10 = e10.n.length; + c10 = c10 < f10 ? c10 : f10; + f10 = 0 < c10 ? c10 : 0; + c10 = Mu(Nu(), Ou(la(e10)), f10); + 0 < f10 && Pu(Gd(), e10, 0, c10, 0, f10); + e10 = new Tj().a(); + f10 = true; + Vj(e10, ""); + for (var g10 = 0, h10 = c10.n.length; g10 < h10; ) { + var k10 = c10.n[g10]; + f10 ? (Wj(e10, k10), f10 = false) : (Vj(e10, "/"), Wj(e10, k10)); + g10 = 1 + g10 | 0; + } + Vj(e10, ""); + a10 = a10 + "://" + e10.Ef.qf; + } else { + c10 = Mc(ua(), c10, "/"); + a10 = -1 + c10.n.length | 0; + a10 = 0 < a10 ? a10 : 0; + e10 = c10.n.length; + a10 = a10 < e10 ? a10 : e10; + e10 = 0 < a10 ? a10 : 0; + a10 = Mu(Nu(), Ou(la(c10)), e10); + 0 < e10 && Pu(Gd(), c10, 0, a10, 0, e10); + c10 = new Tj().a(); + e10 = true; + Vj(c10, ""); + f10 = 0; + for (g10 = a10.n.length; f10 < g10; ) + h10 = a10.n[f10], e10 ? (Wj(c10, h10), e10 = false) : (Vj(c10, "/"), Wj(c10, h10)), f10 = 1 + f10 | 0; + Vj(c10, ""); + a10 = c10.Ef.qf; + } + a10 += "/"; + } + 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) ? (c10 = new qg().e(b10), e10 = c10.ja.length | 0, c10 = gh(hh(), c10.ja, 1, e10)) : c10 = b10; + c10 = "" + a10 + c10; + if (-1 !== (c10.indexOf("://") | 0)) { + a10 = Mc( + ua(), + c10, + "://" + ); + a10 = zj(new Pc().fd(a10)); + c10 = Mc(ua(), c10, "://"); + c10 = Oc(new Pc().fd(c10)); + c10 = Mc(ua(), c10, "/"); + g10 = new Lf().a(); + e10 = 0; + for (f10 = c10.n.length; e10 < f10; ) { + h10 = c10.n[e10]; + if ("." !== h10) + if (".." === h10) { + k10 = g10; + g10 = k10.Qd(); + sLa(g10, k10, -1); + h10 = k10.mb().OD(1); + for (k10 = k10.mb(); h10.Ya(); ) + g10.jd(k10.$a()), h10.$a(); + g10 = g10.Rc(); + } else + Dg(g10, h10); + e10 = 1 + e10 | 0; + } + a10 = a10 + "://" + UJ(g10.Dc, "", "/", ""); + } else + a10 = c10; + b10 = cha(dha(), b10, a10, (O7(), new P6().a())); + return Rd(b10, a10); + } + d7.$classData = r8({ OLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.ScalarNodeParser", { OLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function B32() { + this.xP = this.gQ = this.m = this.X = this.pa = null; + } + B32.prototype = new u7(); + B32.prototype.constructor = B32; + d7 = B32.prototype; + d7.H = function() { + return "ShapeExtensionParser"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof B32) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && Bj(this.X, a10.X) ? (b10 = this.m, c10 = a10.m, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.gQ, c10 = a10.gQ, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.xP, a10 = a10.xP, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.X; + case 2: + return this.m; + case 3: + return this.gQ; + case 4: + return this.xP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function L2a(a10, b10) { + b10 = a10.m.Nl.Pe.Ja(b10); + if (!b10.b()) { + b10 = b10.c(); + var c10 = B6(a10.pa.Y(), ny()), e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return B6(h10.aa, qf().R).A.ua(); + }; + }(a10)), f10 = K7(); + c10 = c10.bd(e10, f10.u); + e10 = mC(a10.pa, true, J5(DB(), H10())).ps(Gb().si); + f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.ma(); + }; + }(a10)); + var g10 = K7(); + e10 = e10.ka(f10, g10.u); + c10.xg().z1(b10).U(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = h10.m, m10 = sg().lia, p10 = h10.pa.j; + k10 = "Custom defined facet '" + k10 + "' matches built-in type facets"; + var t10 = h10.X, v10 = y7(); + ec(l10, m10, p10, v10, k10, t10.da); + }; + }(a10))); + c10.gp(e10).U(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = h10.m, m10 = sg().kia, p10 = h10.pa.j; + k10 = "Custom defined facet '" + k10 + "' matches custom facet from inherited type"; + var t10 = h10.X, v10 = y7(); + ec(l10, m10, p10, v10, k10, t10.da); + }; + }(a10))); + } + } + d7.hd = function() { + var a10 = mC(this.pa, true, J5(DB(), H10())), b10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return new Fc().Vd(f10); + }; + }(this)), c10 = K7(); + a10 = a10.bd(b10, c10.u).fj(); + b10 = M2a(this.pa); + c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return B6(f10.Y(), ny()); + }; + }(this)); + var e10 = K7(); + b10 = b10.bd(c10, e10.u); + a10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = f10.m.Gg(); + if (Cia(k10)) + k10 = B6(h10.aa, qf().R).A, k10 = k10.b() ? null : k10.c(); + else if (wia(k10)) + k10 = B6(h10.aa, qf().R).A, k10 = "facet-" + (k10.b() ? null : k10.c()), k10 = jx(new je4().e(k10)); + else { + k10 = f10.m; + var l10 = sg().k8, m10 = f10.pa.j, p10 = "Cannot parse shape extension for vendor " + f10.m.Gg(), t10 = f10.X, v10 = y7(); + ec(k10, l10, m10, v10, p10, t10.da); + k10 = B6(h10.aa, qf().R).A; + k10 = k10.b() ? null : k10.c(); + } + l10 = ac(new M6().W(f10.X), k10); + if (l10 instanceof z7) + return l10 = l10.i, m10 = l10.i, k10 = new z7().d(f10.pa.j + "/extension/" + k10), p10 = new ox().a(), t10 = new Nd().a(), k10 = px(m10, p10, k10, t10, f10.m).Fr(), SLa || (SLa = new xU().a()), l10 = Od(O7(), l10), l10 = new m32().K(new S6().a(), l10), m10 = Ot().ig, h10 = Vd(l10, m10, h10), l10 = Ot().zi, h10 = Vd(h10, l10, k10), k10 = f10.pa, l10 = nC(), ig(k10, l10, h10); + y7() === l10 && g10.Ha(h10) && (h10 = B6(h10.aa, Qi().ji).A, h10.b() ? 0 : 0 < (h10.c() | 0)) && (h10 = f10.m, l10 = sg().E7, m10 = f10.pa.j, k10 = "Missing required facet '" + k10 + "'", p10 = f10.X, t10 = y7(), ec( + h10, + l10, + m10, + t10, + k10, + p10.da + )); + }; + }(this, b10))); + if (!B6(this.pa.Y(), qf().xd).Od(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.Ie; + }; + }(this)))) { + b10 = this.xP; + c10 = b10 instanceof z7 && "anyShape" === b10.i ? true : b10 instanceof z7 && "shape" === b10.i ? true : false; + if (c10) + b10 = this.pa.zv(); + else if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = this.pa.zv(); + } + c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return B6(f10.aa, qf().R).A.ua(); + }; + }(this)); + e10 = K7(); + a10 = a10.bd(c10, e10.u); + a10 = tr(ur(), this.X.sb.Cb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return !g10.Ha(h10.Aa.re().t()); + }; + }(this, a10))), ""); + N2a( + this.m, + this.pa, + a10, + b10, + this.gQ + ); + L2a(this, b10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ PLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.ShapeExtensionParser", { PLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function aX() { + this.m = this.uG = this.la = this.Wd = this.Ei = null; + } + aX.prototype = new u7(); + aX.prototype.constructor = aX; + d7 = aX.prototype; + d7.H = function() { + return "AbstractDeclarationParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof aX) { + var b10 = this.Ei, c10 = a10.Ei; + return (null === b10 ? null === c10 : b10.h(c10)) && this.Wd === a10.Wd && this.la === a10.la ? Bj(this.uG, a10.uG) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ei; + case 1: + return this.Wd; + case 2: + return this.la; + case 3: + return this.uG; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function MOa(a10, b10, c10, e10, f10, g10) { + a10.Ei = b10; + a10.Wd = c10; + a10.la = e10; + a10.uG = f10; + a10.m = g10; + return a10; + } + d7.z = function() { + return X5(this); + }; + function O2a(a10, b10, c10, e10) { + if (b10 instanceof Tm) + b10 = kna(a10.m.Dl(), e10, c10, Ys()); + else { + if (!(b10 instanceof Vm)) + throw new x7().d(b10); + b10 = tFa(a10.m.Dl(), e10, c10, Ys()); + } + e10 = Od(O7(), e10); + c10 = kM(b10, c10, e10); + c10.pc(b10.j); + a10 = a10.la; + O7(); + b10 = new P6().a(); + return Sd(c10, a10, b10); + } + function P2a(a10) { + var b10 = a10.uG.hb().gb, c10 = Q5().nd; + if (b10 === c10) { + b10 = a10.m; + c10 = sg().rZ; + var e10 = a10.Wd, f10 = a10.uG, g10 = y7(); + nM(b10, c10, e10, g10, "Generating abstract declaration (resource type / trait) with null value", f10.da); + } + b10 = a10.m.hp(a10.uG); + if (b10 instanceof ve4) + return b10 = O2a(a10, a10.Ei, b10.i, a10.uG), a10 = a10.Wd, J5(K7(), H10()), Ai(b10, a10); + if (b10 instanceof ye4) { + e10 = b10.i; + b10 = new ox().a(); + c10 = -1 !== (a10.Wd.indexOf("#") | 0) ? a10.Wd + "/" + a10.la : a10.Wd + "#/" + a10.la; + f10 = e10.hb().gb; + if (Q5().sa === f10) { + f10 = qc(); + f10 = N6(e10, f10, a10.m); + f10 = ac(new M6().W(f10), "usage"); + if (!f10.b()) { + var h10 = f10.c(); + f10 = a10.Ei; + g10 = kP().Va; + var k10 = h10.i, l10 = Dd(); + h10 = ih(new jh(), N6(k10, l10, a10.m), Od(O7(), h10)); + Vd(f10, g10, h10); + } + f10 = qc(); + e10 = N6(e10, f10, a10.m).sb.Cb(w6(/* @__PURE__ */ function(m10) { + return function(p10) { + p10 = p10.Aa; + var t10 = bc(); + return "usage" !== N6(p10, t10, m10.m).va; + }; + }(a10))); + T6(); + ur(); + f10 = e10.kc(); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da.Rf)); + e10 = tr(0, e10, f10.b() ? "" : f10.c()); + T6(); + e10 = mr(T6(), e10, Q5().sa); + } + c10 = px(e10, b10, new z7().d(c10), new Nd().a(), a10.m).Fr(); + e10 = a10.Ei; + f10 = a10.la; + O7(); + g10 = new P6().a(); + e10 = Sd(e10, f10, g10); + f10 = a10.Wd; + J5(K7(), H10()); + e10 = Ai(e10, f10); + f10 = kP().SC; + Vd(e10, f10, c10); + tc(b10.fr) && (b10 = GN(b10.fr), c10 = a10.Ei, e10 = kP().Aj, Wr(c10, e10, b10)); + return a10.Ei; + } + throw new x7().d(b10); + } + d7.$classData = r8({ XLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AbstractDeclarationParser", { XLa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function C32() { + this.m = this.$N = this.X = this.xb = this.la = null; + } + C32.prototype = new u7(); + C32.prototype.constructor = C32; + d7 = C32.prototype; + d7.H = function() { + return "AbstractDeclarationsParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof C32) { + if (this.la === a10.la) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && Bj(this.X, a10.X) ? this.$N === a10.$N : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.xb; + case 2: + return this.X; + case 3: + return this.$N; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.hd = function() { + var a10 = ac(new M6().W(this.X), this.la); + if (!a10.b()) { + var b10 = a10.c(), c10 = b10.i.hb().gb; + if (Q5().sa === c10) { + a10 = b10.i; + var e10 = qc(); + a10 = N6(a10, e10, this.m).sb; + e10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = h10.m.Dl(); + k10 = P2a(LOa(OOa(), h10.xb.P(k10), h10.$N, k10, h10.m)); + var m10 = new Zh().a(); + return $h(l10, Cb(k10, m10)); + }; + }(this)); + var f10 = rw(); + a10.ka(e10, f10.sc); + } else if (Q5().nd !== c10) { + a10 = this.m; + e10 = sg().GR; + f10 = this.$N; + c10 = "Invalid type " + c10 + " for '" + this.la + "' node."; + b10 = b10.i; + var g10 = y7(); + ec(a10, e10, f10, g10, c10, b10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + function Q2a(a10, b10, c10, e10, f10, g10) { + a10.la = b10; + a10.xb = c10; + a10.X = e10; + a10.$N = f10; + a10.m = g10; + return a10; + } + d7.$classData = r8({ $La: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AbstractDeclarationsParser", { $La: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function R2a() { + this.N = this.p = this.Fe = null; + } + R2a.prototype = new u7(); + R2a.prototype.constructor = R2a; + d7 = R2a.prototype; + d7.H = function() { + return "AnnotationsEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof R2a) { + var b10 = this.Fe, c10 = a10.Fe; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = B6(this.Fe.Y(), Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return !wh(B6(e10.g, Ud().zi).fa(), q5(D32)); + }; + }(this))), b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.N.zf.tS().ug(f10, e10.p); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + function ay(a10, b10, c10) { + var e10 = new R2a(); + e10.Fe = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ aMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AnnotationsEmitter", { aMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function S2a() { + this.p = this.Lc = null; + this.uP = false; + this.Bc = null; + } + S2a.prototype = new u7(); + S2a.prototype.constructor = S2a; + d7 = S2a.prototype; + d7.H = function() { + return "ExtendsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof S2a) { + var b10 = this.Lc, c10 = a10.Lc; + return (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? this.uP === a10.uP : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lc; + case 1: + return this.p; + case 2: + return this.uP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.Lc.r.r.wb, c10 = new T2a(), e10 = K7(); + b10 = b10.ec(c10, e10.u); + if (b10.Da()) { + c10 = new U2a(); + e10 = V2a(this, "type"); + var f10 = this.p, g10 = this.Bc; + c10.la = e10; + c10.JP = b10; + c10.p = f10; + c10.Bc = g10; + Dg(a10, c10); + } + b10 = this.Lc.r.r.wb; + c10 = new W2a(); + e10 = K7(); + b10.ec(c10, e10.u).Da() && (b10 = new X2a(), c10 = V2a(this, "is"), e10 = this.Lc, f10 = this.p, g10 = this.Bc, b10.la = c10, b10.Ba = e10, b10.p = f10, b10.Bc = g10, Dg(a10, b10)); + return a10; + }; + function V2a(a10, b10) { + return a10.uP ? jx(new je4().e(b10)) : b10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Lc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.uP ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + function kQa(a10, b10, c10, e10) { + var f10 = new S2a(); + f10.Lc = a10; + f10.p = b10; + f10.uP = c10; + f10.Bc = e10; + return f10; + } + d7.$classData = r8({ nMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ExtendsEmitter", { nMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y2a() { + this.N = this.p = this.Fe = null; + } + Y2a.prototype = new u7(); + Y2a.prototype.constructor = Y2a; + d7 = Y2a.prototype; + d7.H = function() { + return "FacetsEmitter"; + }; + d7.E = function() { + return 2; + }; + function fma(a10, b10, c10) { + var e10 = new Y2a(); + e10.Fe = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Y2a) { + var b10 = this.Fe, c10 = a10.Fe; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = B6(this.Fe.Y(), nC()), b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.N.zf.r$().ug(f10, e10.p); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.FacetsEmitter", { qMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function gX() { + this.Rh = null; + } + gX.prototype = new u7(); + gX.prototype.constructor = gX; + d7 = gX.prototype; + d7.H = function() { + return "LibraryLocationParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof gX ? this.Rh === a10.Rh : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Rh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.LibraryLocationParser", { wMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Z2a() { + this.m = this.lg = this.tb = null; + } + Z2a.prototype = new u7(); + Z2a.prototype.constructor = Z2a; + d7 = Z2a.prototype; + d7.H = function() { + return "NodeDependencyParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Z2a && this.tb === a10.tb) { + var b10 = this.lg; + a10 = a10.lg; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.lg, b10 = this.tb.Aa, c10 = bc(); + a10 = a10.Ja(N6(b10, c10, this.m).va); + if (a10.b()) + return y7(); + a10 = a10.c(); + BRa || (BRa = new SY().a()); + b10 = this.tb; + b10 = Od(O7(), b10); + b10 = new vn().K(new S6().a(), b10); + c10 = un().uJ; + a10 = ih(new jh(), a10.j, new P6().a()); + var e10 = Od(O7(), this.tb.Aa); + a10 = Rg(b10, c10, a10, e10); + b10 = un().vJ; + c10 = Zr(new $r(), $2a(this), new P6().a()); + e10 = Od(O7(), this.tb.i); + return new z7().d(Rg(a10, b10, c10, e10)); + }; + function $2a(a10) { + var b10 = Yx(Gla().P_(a10.tb.i, a10.m).n3()); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.lg.Ja(ka(f10.r)); + g10.b() ? f10 = y7() : (g10 = g10.c(), f10 = new z7().d(ih(new jh(), g10.j, f10.x))); + return f10.ua(); + }; + }(a10)); + var c10 = K7(); + return b10.bd(a10, c10.u); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.NodeDependencyParser", { yMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function a3a() { + this.N = this.p = this.rh = null; + } + a3a.prototype = new u7(); + a3a.prototype.constructor = a3a; + d7 = a3a.prototype; + d7.H = function() { + return "Oas3OAuth2SettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof a3a) { + var b10 = this.rh, c10 = a10.rh; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rh; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()); + Dg(a10, new b3a().YK(this.rh, this.p, this.N)); + return a10; + }; + d7.YK = function(a10, b10, c10) { + this.rh = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ FMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3OAuth2SettingsEmitters", { FMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function c3a() { + this.N = this.p = this.lw = null; + } + c3a.prototype = new u7(); + c3a.prototype.constructor = c3a; + d7 = c3a.prototype; + d7.H = function() { + return "OasApiKeySettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof c3a) { + var b10 = this.lw, c10 = a10.lw; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lw; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = ws(J5(Ef(), H10()), d3a(this.lw, this.p).Pa()), b10 = J5(Ef(), H10()), c10 = hd(this.lw.g, Nm().Dy); + c10.b() || (c10 = c10.c(), ws(b10, iy(new jy(), c10.r.r, this.p, false, Rb(Ut(), H10()), this.N.hj()).Pa())); + b10.Da() && Dg(a10, e3a(b10, this.lw, this.p)); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ OMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasApiKeySettingsEmitters", { OMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function E32() { + this.N = this.p = this.Hl = null; + } + E32.prototype = new u7(); + E32.prototype.constructor = E32; + d7 = E32.prototype; + d7.h1 = function(a10, b10, c10) { + this.Hl = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.H = function() { + return "OasCreativeWorkItemsEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof E32 ? this.Hl === a10.Hl ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Hl; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Hl.g, b10 = J5(Ef(), H10()), c10 = hd(a10, li().Pf); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "url", c10, y7())))); + c10 = hd(a10, li().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "description", c10, y7())))); + a10 = hd(a10, li().Kn); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), jx(new je4().e("title")), a10, y7())))); + ws(b10, ay(this.Hl, this.p, this.N).Pa()); + return this.p.zb(b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ SMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasCreativeWorkItemsEmitter", { SMa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function f3a() { + this.N = this.p = this.rh = null; + } + f3a.prototype = new u7(); + f3a.prototype.constructor = f3a; + d7 = f3a.prototype; + d7.H = function() { + return "OasHttpSettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f3a) { + var b10 = this.rh, c10 = a10.rh; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rh; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.rh.Y(), b10 = J5(Ef(), H10()), c10 = hd(a10, F32().Eq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "scheme", c10, y7())))); + a10 = hd(a10, F32().RM); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), "bearerFormat", a10, y7())))); + return ws(b10, ay(this.rh, this.p, this.N).Pa()); + }; + d7.Aaa = function(a10, b10, c10) { + this.rh = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ aNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasHttpSettingsEmitters", { aNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function g3a() { + this.N = this.p = this.Uw = null; + } + g3a.prototype = new u7(); + g3a.prototype.constructor = g3a; + d7 = g3a.prototype; + d7.H = function() { + return "OasOAuth1SettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g3a) { + var b10 = this.Uw, c10 = a10.Uw; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uw; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = ws(J5(Ef(), H10()), new G32().k1(this.Uw, this.p, this.N).Pa()), b10 = hd(this.Uw.g, Nm().Dy); + b10.b() || (b10 = b10.c(), ws(a10, iy(new jy(), b10.r.r, this.p, false, Rb(Ut(), H10()), this.N.hj()).Pa())); + return J5(K7(), new Ib().ha([e3a(a10, this.Uw, this.p)])); + }; + d7.k1 = function(a10, b10, c10) { + this.Uw = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ hNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasOAuth1SettingsEmitters", { hNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function h3a() { + this.N = this.p = this.rh = null; + } + h3a.prototype = new u7(); + h3a.prototype.constructor = h3a; + d7 = h3a.prototype; + d7.H = function() { + return "OasOAuth2SettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof h3a) { + var b10 = this.rh, c10 = a10.rh; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rh; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.rh.g, b10 = J5(Ef(), H10()), c10 = B6(this.rh.g, xE().Ap).kc(); + c10.b() || (c10 = c10.c(), this.B$(c10, b10)); + c10 = J5(Ef(), H10()); + a10 = hd(a10, xE().Gy); + a10.b() || (a10 = a10.c(), new z7().d(Dg(c10, $x("authorizationGrants", a10, this.p, false)))); + a10 = hd(this.rh.g, Nm().Dy); + a10.b() || (a10 = a10.c(), ws(c10, iy(new jy(), a10.r.r, this.p, false, Rb(Ut(), H10()), this.N.hj()).Pa())); + c10.Da() && Dg(b10, e3a(c10, this.rh, this.p)); + ws(b10, ay(this.rh, this.p, this.N).Pa()); + return b10; + }; + d7.YK = function(a10, b10, c10) { + this.rh = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.B$ = function(a10, b10) { + a10 = a10.g; + var c10 = hd(a10, Jm().km); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "authorizationUrl", c10, y7())))); + c10 = hd(a10, Jm().vq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "tokenUrl", c10, y7())))); + c10 = hd(a10, Jm().Wv); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "flow", c10, y7())))); + c10 = B6(this.rh.g, Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(e10) { + return wh(B6(e10.g, Ud().zi).fa(), q5(D32)); + }; + }(this))); + a10 = hd(a10, Jm().lo); + a10.b() || (a10 = a10.c(), Dg(b10, new H32().Sq("scopes", a10, this.p, c10, this.N))); + }; + d7.$classData = r8({ jNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasOAuth2SettingsEmitters", { jNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function i3a() { + this.N = this.p = this.rh = null; + } + i3a.prototype = new u7(); + i3a.prototype.constructor = i3a; + d7 = i3a.prototype; + d7.H = function() { + return "OasOpenIdConnectSettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof i3a) { + var b10 = this.rh, c10 = a10.rh; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rh; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.rh.Y(), b10 = J5(Ef(), H10()); + a10 = hd(a10, vE().Pf); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), "openIdConnectUrl", a10, y7())))); + return ws(b10, ay(this.rh, this.p, this.N).Pa()); + }; + d7.Aaa = function(a10, b10, c10) { + this.rh = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ kNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasOpenIdConnectSettingsEmitters", { kNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function j3a() { + this.N = this.p = this.pa = null; + } + j3a.prototype = new u7(); + j3a.prototype.constructor = j3a; + d7 = j3a.prototype; + d7.H = function() { + return "OasSchemaShapeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof j3a) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.pa.aa; + Dg(a10, xka("object", this.pa)); + var c10 = hd(b10, pn().Nd); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), jx(new je4().e("mediaType")), c10, y7())))); + b10 = hd(b10, pn().Rd); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, $g(new ah(), jx(new je4().e("schema")), b10, y7())))); + ws(a10, ay(this.pa, this.p, this.N).Pa()); + ws(a10, fma(this.pa, this.p, this.N).Pa()); + return a10; + }; + function k3a(a10, b10, c10) { + var e10 = new j3a(); + e10.pa = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSchemaShapeEmitter", { tNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function l3a() { + this.Ba = null; + } + l3a.prototype = new u7(); + l3a.prototype.constructor = l3a; + d7 = l3a.prototype; + d7.H = function() { + return "OasScopeValuesEmitters"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l3a) { + var b10 = this.Ba; + a10 = a10.Ba; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ba.r.r.wb; + var b10 = new m3a(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasScopeValuesEmitters", { uNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function I32() { + this.N = this.p = this.jA = this.Qf = null; + } + I32.prototype = new u7(); + I32.prototype.constructor = I32; + d7 = I32.prototype; + d7.H = function() { + return "OasSecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof I32) { + var b10 = this.Qf, c10 = a10.Qf; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.jA, c10 = a10.jA, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Qf; + case 1: + return this.jA; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.Qf.g, c10 = hd(b10, Xh().Hf); + if (!c10.b()) { + var e10 = c10.c(); + c10 = this.jA.Id; + e10 = kr(wr(), e10.r.x, q5(jd)); + var f10 = Q5().Na; + new z7().d(Dg(a10, cx(new dx(), "type", c10, f10, e10))); + } + c10 = hd(b10, Xh().Zc); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), jx(new je4().e("displayName")), c10, y7())))); + c10 = hd(b10, Xh().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "description", c10, y7())))); + c10 = jx(new je4().e("describedBy")); + e10 = this.Qf; + f10 = this.p; + var g10 = H10(), h10 = this.N; + Dg(a10, new J32().yU(c10, e10, f10, g10, new JW().Ti(h10.hj(), h10.oy, new Yf().a()))); + b10 = hd(b10, Xh().Oh); + b10.b() || (b10 = b10.c(), new z7().d(ws(a10, new n3a().SG(b10, this.p, this.N).Pa()))); + return this.p.zb(a10); + }; + d7.vU = function(a10, b10, c10, e10) { + this.Qf = a10; + this.jA = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSecuritySchemeEmitter", { wNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function n3a() { + this.N = this.p = this.Ba = null; + } + n3a.prototype = new u7(); + n3a.prototype.constructor = n3a; + d7 = n3a.prototype; + d7.H = function() { + return "OasSecuritySettingsEmitter"; + }; + d7.SG = function(a10, b10, c10) { + this.Ba = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n3a) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ba.r.r, b10 = false, c10 = null; + if (a10 instanceof q1) + return new g3a().k1(a10, this.p, this.N).Pa(); + if (a10 instanceof wE) { + b10 = true; + c10 = a10; + var e10 = this.N.Gg(), f10 = Xq().Cp; + if (e10 === f10) + return new a3a().YK(c10, this.p, this.N).Pa(); + } + if (b10) + return new h3a().YK(c10, this.p, this.N).Pa(); + if (a10 instanceof bR) + return b10 = this.p, c10 = this.N, e10 = new c3a(), e10.lw = a10, e10.p = b10, e10.N = c10, e10.Pa(); + if (a10 instanceof r1) + return new f3a().Aaa(a10, this.p, this.N).Pa(); + if (a10 instanceof uE) + return new i3a().Aaa(a10, this.p, this.N).Pa(); + b10 = J5(Ef(), H10()); + c10 = hd(a10.Y(), Nm().Dy); + c10.b() || (c10 = c10.c(), ws(b10, iy(new jy(), c10.r.r, this.p, false, Rb(Ut(), H10()), this.N.hj()).Pa())); + return b10.Da() ? J5(K7(), new Ib().ha([e3a(b10, a10, this.p)])) : H10(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ zNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSecuritySettingsEmitter", { zNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function o3a() { + this.tf = this.Qe = this.Q = this.Fj = this.p = this.pa = null; + this.Nw = false; + this.N = null; + } + o3a.prototype = new u7(); + o3a.prototype.constructor = o3a; + d7 = o3a.prototype; + d7.H = function() { + return "OasTypeEmitter"; + }; + d7.E = function() { + return 7; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o3a) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Fj, c10 = a10.Fj, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.tf, c10 = a10.tf, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Nw === a10.Nw : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Fj; + case 3: + return this.Q; + case 4: + return this.Qe; + case 5: + return this.tf; + case 6: + return this.Nw; + default: + throw new U6().e("" + a10); + } + }; + function p3a(a10) { + return 1 === B6(a10.aa, xn().Le).jb() && wh(B6(a10.aa, xn().Le).ga().fa(), q5(dma)); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Qe, b10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return "/" + f10; + }; + }(this)), c10 = K7(); + b10 = "#" + a10.ka(b10, c10.u).cm(); + a10 = this.tf; + c10 = new R6().M(this.pa.j, b10); + var e10 = K7(); + a10 = a10.yg(c10, e10.u); + c10 = this.pa; + Kca(c10) && wh(this.pa.fa(), q5(cv)) && (c10 = c10.XT, b10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return new R6().M(h10, g10); + }; + }(this, b10)), e10 = oi(), b10 = c10.ka(b10, e10.u), c10 = K7(), a10 = a10.ia(b10, c10.u)); + e10 = false; + c10 = null; + b10 = this.pa; + if (null !== b10 && Za(b10).na()) + return a10 = K7(), b10 = [OO(this.pa, B6(b10.Y(), db().ed).A, H10(), this.N)], J5(a10, new Ib().ha(b10)); + if (b10 instanceof Gh) + return a10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), a10 = new Gh().K(a10, b10.Xa), k3a(a10, this.p, this.N).Pa(); + if (b10 instanceof Hh) + return c10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), b10 = new Hh().K(c10, b10.Xa), q3a(b10, this.p, this.Q, this.Qe, a10, this.Nw, this.N).Pa(); + if (b10 instanceof Vh && (e10 = true, c10 = b10, p3a(c10))) + return Vy(B6(c10.aa, xn().Le).ga(), this.p, this.Fj, this.Q, H10(), H10(), false, this.N).Pa(); + if (e10) + return b10 = rt(c10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), b10 = new Vh().K(b10, c10.Xa), r3a(b10, this.p, this.Q, this.Qe, a10, this.N).Pa(); + if (b10 instanceof th) + return c10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), b10 = new th().K(c10, b10.Xa), s3a(b10, this.p, this.Q, this.Qe, a10, this.Nw, this.N).Pa(); + if (b10 instanceof pi) + return c10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), c10 = new pi().K(c10, b10.Xa), b10 = Rd(c10, b10.j), s3a(b10.dI(), this.p, this.Q, this.Qe, a10, this.Nw, this.N).Pa(); + if (b10 instanceof qi) + return c10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), b10 = new qi().K(c10, b10.Xa), t3a( + b10, + this.p, + this.Q, + this.Qe, + a10, + this.Nw, + this.N + ).Pa(); + if (b10 instanceof Th) + return a10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), a10 = new Th().K(a10, b10.Xa), J5(K7(), new Ib().ha([u3a(a10, this.p)])); + if (b10 instanceof Wh) { + if (this.N instanceof gy) + return a10 = new Mh().K(b10.aa, b10.Xa), c10 = Uh().zj, e10 = Fg().af, a10 = eb(a10, e10, c10), b10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), a10 = new Mh().K(b10, a10.Xa), v3a(a10, this.p, this.Q, this.Nw, this.N).Pa(); + a10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))); + a10 = new Wh().K(a10, b10.Xa); + return w3a(a10, this.p, this.Q, this.Nw, this.N).Pa(); + } + return b10 instanceof Mh ? (a10 = rt(b10.aa, w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), a10 = new Mh().K(a10, b10.Xa), v3a(a10, this.p, this.Q, this.Nw, this.N).Pa()) : b10 instanceof zi ? J5(K7(), new Ib().ha([x3a(b10, this.p, this.tf, this.N)])) : b10 instanceof vh ? (b10 = y3a(b10, rt(b10.Y(), w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return !f10.Fj.Ha(g10.ma()); + }; + }(this))), b10.fa()), new AP().VK(b10, this.p, this.Q, this.Qe, a10, this.Nw, this.N).Pa()) : J5(K7(), H10()); + }; + function Vy(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new o3a(); + l10.pa = a10; + l10.p = b10; + l10.Fj = c10; + l10.Q = e10; + l10.Qe = f10; + l10.tf = g10; + l10.Nw = h10; + l10.N = k10; + return l10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.pa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Fj)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Q)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Qe)); + a10 = OJ().Ga(a10, NJ(OJ(), this.tf)); + a10 = OJ().Ga(a10, this.Nw ? 1231 : 1237); + return OJ().fe(a10, 7); + }; + d7.zw = function() { + var a10 = this.Pa(); + var b10 = new z3a(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.$classData = r8({ INa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeEmitter", { INa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function A3a() { + this.l = this.yb = this.Kq = null; + } + A3a.prototype = new u7(); + A3a.prototype.constructor = A3a; + d7 = A3a.prototype; + d7.H = function() { + return "AllOfParser"; + }; + d7.E = function() { + return 2; + }; + function B3a(a10, b10, c10, e10) { + a10.Kq = c10; + a10.yb = e10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof A3a && a10.l === this.l) { + var b10 = this.Kq, c10 = a10.Kq; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kq; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.Kq, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = jc(kc(f10), qc()); + if (g10.b()) + g10 = y7(); + else if (g10 = g10.c(), g10 = ac(new M6().W(g10), "$ref"), g10.b()) + g10 = y7(); + else { + g10 = g10.c(); + var h10 = e10.l.ra.Qh.Oo, k10 = g10.i, l10 = Dd(); + k10 = N6(k10, l10, e10.l.ra); + k10 = new qg().e(k10); + h10 = h10.Ja(Wp(k10, "#/definitions/")); + h10.b() ? g10 = y7() : (h10 = h10.c(), k10 = g10.i, l10 = Dd(), g10 = h10.Ug(N6(k10, l10, e10.l.ra), Od(O7(), g10.i)), h10 = B6(h10.Y(), qf().R).A, h10 = h10.b() ? "schema" : h10.c(), O7(), k10 = new P6().a(), g10 = new z7().d(Sd(g10, h10, k10))); + } + return (g10.b() ? aPa(pX(), f10, "", e10.yb, e10.l.Nj, e10.l.ra).Cc() : g10).ua(); + }; + }(this)), c10 = K7(); + return a10.bd( + b10, + c10.u + ); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$AllOfParser", { NNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ly() { + this.l = this.pa = this.X = null; + } + Ly.prototype = new u7(); + Ly.prototype.constructor = Ly; + d7 = Ly.prototype; + d7.H = function() { + return "AndConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ly && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + this.l.Wf.P(this.pa); + var a10 = ac(new M6().W(this.X), "allOf"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i, c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + k10 = pG(wD(), mh(T6(), "item" + h10), k10); + return nX(pX(), k10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(l10.pa.j + "/and/" + m10, lt2()); + }; + }(g10, h10)), g10.l.Nj, g10.l.ra).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().fi; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.ra; + c10 = sg().iY; + e10 = this.pa.j; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, e10, f10, "And constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ONa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$AndConstraintParser", { ONa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function C3a() { + this.l = this.yb = this.X = this.ad = this.$ = null; + } + C3a.prototype = new u7(); + C3a.prototype.constructor = C3a; + d7 = C3a.prototype; + d7.H = function() { + return "DataArrangementParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof C3a && a10.l === this.l) { + if (this.$ === a10.$) { + var b10 = this.ad, c10 = a10.ad; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && Bj(this.X, a10.X)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.ad; + case 2: + return this.X; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + var a10 = false, b10 = null; + var c10 = ac(new M6().W(this.X), "items"); + if (c10 instanceof z7) { + c10 = c10.i.i; + var e10 = lc(); + Iw(c10, e10) instanceof ye4 ? (ue4(), c10 = GRa(IRa(), this.ad), c10 = Sd(c10, this.$, this.l.Qj), e10 = new z7().d(new ve4().d(c10))) : (ue4(), c10 = tRa(vRa(), this.ad), c10 = Sd(c10, this.$, this.l.Qj), e10 = new z7().d(new ye4().d(c10))); + } else if (y7() === c10) + e10 = y7(); + else + throw new x7().d(c10); + if (y7() === e10) { + a10 = tRa(vRa(), this.ad); + a10 = Sd(a10, this.$, this.l.Qj); + a10 = D3a(this.l, a10, this.X, this.yb).Xi(); + if (this.l.Nj instanceof Qy) { + b10 = this.l.ra; + c10 = sg().w6; + e10 = a10.j; + var f10 = this.X, g10 = y7(); + ec(b10, c10, e10, g10, "'items' field is required when schema type is array", f10.da); + } + return a10; + } + if (e10 instanceof z7 && (a10 = true, b10 = e10, c10 = b10.i, c10 instanceof ve4)) + return a10 = this.l, b10 = this.X, e10 = this.yb, f10 = new E3a(), f10.wa = c10.i, f10.Za = b10, f10.eh = e10, CP.prototype.Ux.call(f10, a10), f10.Xi(); + if (a10 && (a10 = b10.i, a10 instanceof ye4)) + return D3a(this.l, a10.i, this.X, this.yb).Xi(); + throw new x7().d(e10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function F3a(a10, b10, c10, e10, f10, g10) { + a10.$ = c10; + a10.ad = e10; + a10.X = f10; + a10.yb = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ RNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$DataArrangementParser", { RNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function G3a() { + this.l = this.tb = this.pa = null; + } + G3a.prototype = new u7(); + G3a.prototype.constructor = G3a; + function H3a(a10, b10) { + var c10 = b10.i, e10 = qc(); + c10 = N6(c10, e10, a10.l.ra).sb; + e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + oSa || (oSa = new DZ().a()); + var k10 = h10.Aa, l10 = Dd(); + k10 = N6(k10, l10, g10.l.ra); + h10 = h10.i; + l10 = Dd(); + h10 = N6(h10, l10, g10.l.ra); + O7(); + l10 = new P6().a(); + l10 = new Hn().K(new S6().a(), l10); + var m10 = Gn().pD; + k10 = eb(l10, m10, k10); + l10 = Gn().jD; + return eb(k10, l10, h10); + }; + }(a10)); + var f10 = rw(); + c10 = c10.ka(e10, f10.sc); + a10 = a10.pa; + e10 = Ih().SI; + b10 = Od(O7(), b10); + bs(a10, e10, c10, b10); + } + d7 = G3a.prototype; + d7.H = function() { + return "DiscriminatorParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G3a && a10.l === this.l) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.tb === a10.tb : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.tb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.hd = function() { + var a10 = this.tb.i, b10 = qc(); + a10 = N6(a10, b10, this.l.ra); + b10 = ac(new M6().W(a10), "propertyName"); + if (b10 instanceof z7) { + b10 = b10.i; + var c10 = this.l, e10 = Ih().Us; + qP(Hg(Ig(c10, e10, this.l.ra), this.pa), b10); + } else if (y7() === b10) { + b10 = this.l.ra; + c10 = sg().y5; + e10 = this.pa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "Discriminator must have a propertyName defined", a10.da); + } else + throw new x7().d(b10); + b10 = ac(new M6().W(a10), "mapping"); + b10.b() || (b10 = b10.c(), H3a(this, b10)); + Zz(this.l.ra, this.pa.j, a10, "discriminator"); + }; + d7.z = function() { + return X5(this); + }; + function I3a(a10, b10, c10) { + var e10 = new G3a(); + e10.pa = b10; + e10.tb = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.$classData = r8({ SNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$DiscriminatorParser", { SNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ny() { + this.l = this.pa = this.X = null; + } + Ny.prototype = new u7(); + Ny.prototype.constructor = Ny; + d7 = Ny.prototype; + d7.H = function() { + return "NotConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ny && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + this.l.Wf.P(this.pa); + var a10 = ac(new M6().W(this.X), "not"); + if (!a10.b() && (a10 = a10.c(), a10 = nX(pX(), a10, w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10.ub(e10.pa.j + "/not", lt2()); + }; + }(this)), this.l.Nj, this.l.ra).Cc(), a10 instanceof z7)) { + a10 = a10.i; + var b10 = this.pa, c10 = qf().Bi; + Vd(b10, c10, a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ VNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$NotConstraintParser", { VNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ky() { + this.l = this.pa = this.X = null; + } + Ky.prototype = new u7(); + Ky.prototype.constructor = Ky; + d7 = Ky.prototype; + d7.H = function() { + return "OrConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ky && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + var a10 = ac(new M6().W(this.X), "anyOf"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i, c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + k10 = pG(wD(), mh(T6(), "item" + h10), k10); + return nX(pX(), k10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(l10.pa.j + "/or/" + m10, lt2()); + }; + }(g10, h10)), g10.l.Nj, g10.l.ra).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().ki; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.ra; + c10 = sg().nY; + e10 = this.pa.j; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, e10, f10, "Or constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$OrConstraintParser", { WNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Iy() { + this.Bv = this.xb = this.X = null; + this.Yw = false; + this.l = null; + } + Iy.prototype = new u7(); + Iy.prototype.constructor = Iy; + function oma(a10, b10, c10, e10, f10, g10) { + a10.X = c10; + a10.xb = e10; + a10.Bv = f10; + a10.Yw = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7 = Iy.prototype; + d7.H = function() { + return "PropertiesParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Iy && a10.l === this.l) { + if (Bj(this.X, a10.X)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.Bv, c10 = a10.Bv, b10 = null === b10 ? null === c10 : U22(b10, c10)) : b10 = false; + return b10 ? this.Yw === a10.Yw : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.xb; + case 2: + return this.Bv; + case 3: + return this.Yw; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = J3a, h10 = e10.l, k10 = e10.xb, l10 = e10.Bv, m10 = e10.Yw, p10 = new K3a(); + p10.tb = f10; + p10.xb = k10; + p10.Bv = l10; + p10.Yw = m10; + if (null === h10) + throw mb(E6(), null); + p10.l = h10; + return g10(p10); + }; + }(this)), c10 = rw(); + return a10.ka(b10, c10.sc); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.X)); + a10 = OJ().Ga(a10, NJ(OJ(), this.xb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Bv)); + a10 = OJ().Ga(a10, this.Yw ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.$classData = r8({ XNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$PropertiesParser", { XNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function K32() { + this.Fa = null; + } + K32.prototype = new ALa(); + K32.prototype.constructor = K32; + K32.prototype.Ux = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + return this; + }; + K32.prototype.du = function(a10, b10, c10, e10) { + return oma(new Iy(), this.Fa, a10, b10, c10, !!e10); + }; + K32.prototype.t = function() { + return "PropertiesParser"; + }; + K32.prototype.$classData = r8({ YNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$PropertiesParser$", { YNa: 1, Ypa: 1, f: 1, aga: 1, q: 1, o: 1 }); + function K3a() { + this.Bv = this.xb = this.tb = null; + this.Yw = false; + this.l = null; + } + K3a.prototype = new u7(); + K3a.prototype.constructor = K3a; + d7 = K3a.prototype; + d7.H = function() { + return "PropertyShapeParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof K3a && a10.l === this.l) { + if (this.tb === a10.tb) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.Bv, c10 = a10.Bv, b10 = null === b10 ? null === c10 : U22(b10, c10)) : b10 = false; + return b10 ? this.Yw === a10.Yw : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + case 2: + return this.Bv; + case 3: + return this.Yw; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function J3a(a10) { + var b10 = a10.tb.Aa, c10 = bc(); + b10 = N6(b10, c10, a10.l.ra).va; + var e10 = a10.Bv.Ha(b10); + c10 = a10.Bv.Ja(b10); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(Od(O7(), c10))); + c10 = c10.b() ? (O7(), new P6().a()) : c10.c(); + var f10 = a10.xb.P(b10), g10 = Od(O7(), a10.tb); + f10 = Db(f10, g10); + g10 = Qi().ji; + var h10 = ih(new jh(), e10 ? 1 : 0, new P6().a()); + c10 = c10.Lb(new xi().a()); + c10 = Rg(f10, g10, h10, c10); + f10 = Qi().Uf; + g10 = F6().Pg; + h10 = a10.tb.Aa; + var k10 = bc(); + h10 = N6(h10, k10, a10.l.ra).va; + h10 = new je4().e(h10); + h10 = jj(h10.td); + g10 = ih(new jh(), ic(G5(g10, h10)), Od(O7(), a10.tb.Aa)); + Vd(c10, f10, g10); + f10 = jc(kc(a10.tb.i), qc()); + f10.b() || (f10 = f10.c(), f10 = ac(new M6().W(f10), "readOnly"), f10.b() || (f10 = f10.c(), g10 = a10.l, h10 = Qi().cl, qP(Hg(Ig(g10, h10, a10.l.ra), c10), f10), a10.l.Nj instanceof hX ? (g10 = B6(c10.aa, qf().cl), g10 = Ic(g10)) : g10 = false, g10 && e10 && (e10 = a10.l.ra, g10 = sg().PZ, h10 = c10.j, k10 = y7(), nM(e10, g10, h10, k10, "Read only property should not be marked as required by a schema", f10.da)))); + a10.l.Nj instanceof Qy && (e10 = jc(kc(a10.tb.i), qc()), e10.b() || (e10 = e10.c(), e10 = new M6().W(e10), f10 = a10.l, g10 = Qi().Zm, Gg(e10, "writeOnly", Hg(Ig(f10, g10, a10.l.ra), c10)))); + e10 = jc(kc(a10.tb.i), qc()); + if (!e10.b() && (e10 = e10.c(), e10 = ac(new M6().W(e10), "required"), !e10.b() && (e10 = e10.c(), f10 = e10.i.hb().gb, g10 = Q5().ti, f10 === g10))) { + f10 = a10.l.Nj; + g10 = MFa(); + if (null !== f10 && f10 === g10 || a10.l.Nj instanceof zP) + f10 = a10.l.ra, g10 = sg().p6, h10 = c10.j, k10 = y7(), ec(f10, g10, h10, k10, "Required property boolean value is only supported in JSON Schema draft-3", e10.da); + g10 = !!new Qg().Vb(e10.i, a10.l.ra).Up().r; + f10 = Qi().ji; + g10 = ih(new jh(), g10 ? 1 : 0, new P6().a()); + e10 = Od(O7(), e10).Lb(new xi().a()); + Rg(c10, f10, g10, e10); + } + e10 = nX(pX(), a10.tb, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(m10.j, lt2()); + }; + }(a10, c10)), a10.l.Nj, a10.l.ra).Cc(); + e10.b() || (e10 = e10.c(), f10 = Qi().Vf, Vd(c10, f10, e10)); + a10.Yw && (a10 = Qi().cv, eb(c10, a10, b10)); + return c10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.tb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.xb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Bv)); + a10 = OJ().Ga(a10, this.Yw ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.$classData = r8({ ZNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$PropertyShapeParser", { ZNa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function My() { + this.l = this.pa = this.X = null; + } + My.prototype = new u7(); + My.prototype.constructor = My; + d7 = My.prototype; + d7.H = function() { + return "XoneConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof My && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + this.l.Wf.P(this.pa); + var a10 = ac(new M6().W(this.X), "oneOf"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i, c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + k10 = pG(wD(), mh(T6(), "item" + h10), k10); + return nX(pX(), k10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(l10.pa.j + "/xone/" + m10, lt2()); + }; + }(g10, h10)), g10.l.Nj, g10.l.ra).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().li; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.ra; + c10 = sg().uY; + e10 = this.pa.j; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, e10, f10, "Xone constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ eOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$XoneConstraintParser", { eOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function L3a() { + this.N = this.p = this.EV = null; + } + L3a.prototype = new u7(); + L3a.prototype.constructor = L3a; + function M3a(a10, b10, c10) { + var e10 = new L3a(); + e10.EV = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7 = L3a.prototype; + d7.H = function() { + return "OrphanAnnotationsEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof L3a) { + var b10 = this.EV, c10 = a10.EV; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.EV; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.EV, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return e10.N.zf.tS().ug(f10, e10.p); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ jOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OrphanAnnotationsEmitter", { jOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N3a() { + this.m = this.yb = this.ad = this.$ = this.fl = null; + } + N3a.prototype = new u7(); + N3a.prototype.constructor = N3a; + d7 = N3a.prototype; + d7.H = function() { + return "Raml08DefaultTypeParser"; + }; + function O3a(a10, b10, c10, e10, f10) { + var g10 = new N3a(); + g10.fl = a10; + g10.$ = b10; + g10.ad = c10; + g10.yb = e10; + g10.m = f10; + return g10; + } + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N3a) { + if (this.fl === a10.fl && this.$ === a10.$) { + var b10 = this.ad, c10 = a10.ad; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.fl; + case 1: + return this.$; + case 2: + return this.ad; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.fl; + if (df() === a10) { + a10 = PY(QY(), this.ad); + var b10 = this.$; + O7(); + var c10 = new P6().a(); + a10 = Sd(a10, b10, c10); + b10 = new L32().a(); + a10 = new z7().d(Cb(a10, b10)); + } else if (cf() === a10) + a10 = MY(NY(), this.ad), b10 = this.$, O7(), c10 = new P6().a(), a10 = new z7().d(Sd(a10, b10, c10)); + else if (Lca(a10)) { + a10 = UY(VY(), this.ad); + b10 = this.$; + O7(); + c10 = new P6().a(); + a10 = Sd(a10, b10, c10); + b10 = Fg().af; + c10 = ih(new jh(), LC(MC(), this.fl), new P6().a()); + var e10 = (O7(), new P6().a()).Lb(new L32().a()); + a10 = new z7().d(Rg(a10, b10, c10, e10)); + } else if (yx() === a10) + a10 = wpa(ypa(), this.ad), b10 = this.$, O7(), c10 = new P6().a(), a10 = Sd(a10, b10, c10), b10 = new L32().a(), a10 = new z7().d(Cb(a10, b10)); + else { + a10 = this.m; + b10 = sg().l8; + c10 = "Cannot set default type " + this.fl + " in raml 08"; + e10 = this.ad; + var f10 = y7(); + ec(a10, b10, "", f10, c10, e10.da); + a10 = y7(); + } + b10 = this.yb; + a10.b() || new z7().d(b10.P(a10.c())); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ lOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08DefaultTypeParser", { lOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function P3a() { + this.l = this.m = this.$ = this.Ca = this.Id = null; + } + P3a.prototype = new u7(); + P3a.prototype.constructor = P3a; + d7 = P3a.prototype; + d7.H = function() { + return "Raml08ReferenceParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof P3a && a10.l === this.l ? this.Id === a10.Id && Bj(this.Ca, a10.Ca) ? this.$ === a10.$ : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Id; + case 1: + return this.Ca; + case 2: + return this.$; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeParser$Raml08ReferenceParser", { vOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Q3a() { + this.l = this.m = this.yb = this.X = null; + } + Q3a.prototype = new u7(); + Q3a.prototype.constructor = Q3a; + d7 = Q3a.prototype; + d7.H = function() { + return "Raml08SchemaParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Q3a && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = ac(new M6().W(this.X), "schema"); + if (a10.b()) + return y7(); + a10 = a10.c(); + var b10 = a10.i.hb().gb; + return Q5().sa === b10 || Q5().cd === b10 ? wW(xW(), a10, this.yb, false, QP(), this.m).Cc() : R3a(this.l, a10.i, this.yb, "schema", this.l.Ox, this.m).Cc(); + }; + d7.z = function() { + return X5(this); + }; + function S3a(a10, b10, c10, e10) { + var f10 = new Q3a(); + f10.X = b10; + f10.yb = c10; + f10.m = e10; + if (null === a10) + throw mb(E6(), null); + f10.l = a10; + return f10; + } + d7.$classData = r8({ wOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeParser$Raml08SchemaParser", { wOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function T3a() { + this.l = this.m = this.fl = this.$ = this.yb = this.r = null; + } + T3a.prototype = new u7(); + T3a.prototype.constructor = T3a; + d7 = T3a.prototype; + d7.H = function() { + return "Raml08TextParser"; + }; + d7.E = function() { + return 4; + }; + function R3a(a10, b10, c10, e10, f10, g10) { + var h10 = new T3a(); + h10.r = b10; + h10.yb = c10; + h10.$ = e10; + h10.fl = f10; + h10.m = g10; + if (null === a10) + throw mb(E6(), null); + h10.l = a10; + return h10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof T3a && a10.l === this.l) { + if (Bj(this.r, a10.r)) { + var b10 = this.yb, c10 = a10.yb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && this.$ === a10.$ ? this.fl === a10.fl : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + case 1: + return this.yb; + case 2: + return this.$; + case 3: + return this.fl; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.r.hb().gb; + if (Q5().nd === a10) { + a10 = O3a(this.fl.gF, this.$, this.r, this.yb, this.m).Cc(); + if (a10.b()) + return y7(); + a10 = a10.c(); + a10 = Cb(a10, qha(this.r)); + var b10 = new Bs().e(this.r.da.Rf); + return new z7().d(Cb(a10, b10)); + } + a10 = this.r; + b10 = bc(); + b10 = N6(a10, b10, this.m).va; + if (!dla().qj(b10).b()) + return a10 = Vb(), b10 = new M32().ZK(this.l.Pw, this.r, this.yb, false, this.m), a10.Ia(FP(b10)); + if (!ela().qj(b10).b()) + return a10 = Vb(), b10 = new N32().ZK(this.l.Pw, this.r, this.yb, false, this.m), a10.Ia(FP(b10)); + if (ila(Nh(), b10).na()) + a10 = Vb().Ia(U3a(new O32(), this.$, this.yb, ur().ce, ila( + Nh(), + b10 + ).c(), this.m).Xi()); + else { + var c10 = this.l, e10 = this.l.Fd, f10 = this.$, g10 = this.m; + a10 = new P3a(); + a10.Id = b10; + a10.Ca = e10; + a10.$ = f10; + a10.m = g10; + if (null === c10) + throw mb(E6(), null); + a10.l = c10; + c10 = fB(a10.m.pe(), a10.Id, Xs(), y7()); + a: { + if (c10 instanceof z7 && (b10 = c10.i, null !== b10)) { + c10 = b10.Ug(a10.Id, Od(O7(), a10.Ca.re())); + a10 = a10.$; + b10 = B6(b10.Y(), qf().R).x; + a10 = Sd(c10, a10, b10); + break a; + } + if (y7() === c10) { + b10 = aSa(Rna(), a10.Id, a10.Ca); + c10 = a10.Id; + O7(); + e10 = new P6().a(); + b10 = Sd(b10, c10, e10); + Jb(b10, a10.m); + a10.l.eh.P(b10); + if (tCa(new je4().e(a10.Id))) + c10 = false; + else { + c10 = pd(a10.m.pe().xi).th.Er(); + for (e10 = false; !e10 && c10.Ya(); ) + e10 = c10.$a(), f10 = a10.Id, f10 = Mc(ua(), f10, "\\."), e10 = e10 === zj(new Pc().fd(f10)); + c10 = e10; + } + if (c10) { + c10 = a10.m; + e10 = sg().vR; + f10 = b10.j; + g10 = "Chained reference '" + a10.Id; + a10 = a10.Ca; + var h10 = y7(); + ec(c10, e10, f10, h10, g10, a10.da); + } else + lB(b10, a10.Id, a10.Ca, a10.m); + a10 = b10; + } else + throw new x7().d(c10); + } + a10 = new z7().d(a10); + } + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeParser$Raml08TextParser", { xOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function V3a() { + this.m = this.ad = this.Lv = this.pa = null; + } + V3a.prototype = new u7(); + V3a.prototype.constructor = V3a; + d7 = V3a.prototype; + d7.H = function() { + return "Raml08UnionTypeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof V3a) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Lv, c10 = a10.Lv, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.ad, a10 = a10.ad, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.Lv; + case 2: + return this.ad; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function W3a(a10, b10, c10, e10, f10) { + a10.pa = b10; + a10.Lv = c10; + a10.ad = e10; + a10.m = f10; + return a10; + } + d7.zP = function() { + var a10 = this.Lv, b10 = K7(); + a10 = a10.og(b10.u); + b10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.Ki(); + return gPa(xW(), h10, "item" + g10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return m10.ub(k10.pa.j + "/items/" + l10, lt2()); + }; + }(f10, g10)), vP(), f10.m).Cc(); + } + throw new x7().d(g10); + }; + }(this)); + var c10 = K7(); + a10 = a10.ka(b10, c10.u).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.na(); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.c(); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u); + b10 = this.pa; + c10 = xn().Le; + var e10 = Od(O7(), this.ad); + return bs(b10, c10, a10, e10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ AOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08UnionTypeParser", { AOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function X3a() { + this.N = this.Q = this.Fj = this.p = this.pa = null; + } + X3a.prototype = new u7(); + X3a.prototype.constructor = X3a; + d7 = X3a.prototype; + d7.H = function() { + return "Raml10TypeEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof X3a) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Fj, c10 = a10.Fj, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Fj; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = false, b10 = null, c10 = this.pa; + if (Vb().Ia(this.pa).na() && this.pa instanceof vh && Yca(this.pa) && this.Q.Da()) { + var e10 = this.Q, f10 = new Y3a().laa(this); + e10 = Jc(e10, f10).na(); + } else + e10 = false; + if (e10) + return J5(K7(), new Ib().ha([Z3a(this.pa, this.Q)])); + if (null !== c10 && Za(c10).na()) { + c10 = Aka(this.N, this.pa, this.Q); + if (c10 instanceof z7 && (c10 = c10.i, ev(c10))) + return b10 = K7(), a10 = B6(this.pa.Y(), db().ed).A, a10.b() ? Lc(c10).c() : a10.c(), J5(b10, new Ib().ha([AOa(this.pa)])); + c10 = K7(); + b10 = [this.N.rL(this.pa)]; + return J5(c10, new Ib().ha(b10)); + } + return c10 instanceof Gh ? J5(K7(), new Ib().ha([$3a( + c10, + this.p, + this.Q, + this.N + )])) : c10 instanceof Hh && (a10 = true, b10 = c10, Ab(b10.Xa, q5(xh)).na()) ? J5(K7(), new Ib().ha([a4a(b10, this.p, this.Q, "type", this.N)])) : a10 ? (c10 = rt(b10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new Hh().K(c10, b10.Xa), b4a(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof Vh ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new Vh().K(b10, c10.Xa), new c4a().WK(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof Wh ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new Wh().K(b10, c10.Xa), d4a(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof Mh ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new Mh().K(b10, c10.Xa), e4a(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof th ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new th().K(b10, c10.Xa), new P32().g1(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof qi ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new qi().K(b10, c10.Xa), new f4a().waa( + c10, + this.p, + this.Q, + this.N + ).Pa()) : c10 instanceof pi ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new pi().K(b10, c10.Xa), new P32().g1(c10.dI(), this.p, this.Q, this.N).Pa()) : c10 instanceof Th ? (b10 = rt(c10.aa, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10 = new Th().K(b10, c10.Xa), g4a(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof vh ? (c10 = y3a(c10, rt(c10.Y(), w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return !g10.Fj.Ha(h10.ma()); + }; + }(this))), c10.fa()), new AX().Vx(c10, this.p, this.Q, this.N).Pa()) : c10 instanceof zi ? new Zy().FO( + c10, + this.p, + this.Q, + this.N + ).Pa() : J5(K7(), H10()); + }; + function Q32(a10, b10, c10, e10, f10) { + var g10 = new X3a(); + g10.pa = a10; + g10.p = b10; + g10.Fj = c10; + g10.Q = e10; + g10.N = f10; + return g10; + } + d7.z = function() { + return X5(this); + }; + d7.zw = function() { + var a10 = this.Pa(), b10 = new h4a().laa(this), c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.$classData = r8({ EOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeEmitter", { EOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function i4a() { + this.p = this.lw = null; + } + i4a.prototype = new u7(); + i4a.prototype.constructor = i4a; + d7 = i4a.prototype; + d7.H = function() { + return "RamlApiKeySettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof i4a) { + var b10 = this.lw, c10 = a10.lw; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lw; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.lw.g, b10 = J5(Ef(), H10()), c10 = hd(a10, aR().R); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "name", c10, y7())))); + a10 = hd(a10, aR().Ny); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $g(new ah(), "in", a10, y7())))); + return b10; + }; + function d3a(a10, b10) { + var c10 = new i4a(); + c10.lw = a10; + c10.p = b10; + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ROa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlApiKeySettingsEmitters", { ROa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function R32() { + this.p = this.$l = null; + this.oQ = false; + this.N = null; + } + R32.prototype = new u7(); + R32.prototype.constructor = R32; + d7 = R32.prototype; + d7.H = function() { + return "RamlCreativeWorkItemsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.lU = function(a10, b10, c10, e10) { + this.$l = a10; + this.p = b10; + this.oQ = c10; + this.N = e10; + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof R32 ? this.$l === a10.$l && this.p === a10.p ? this.oQ === a10.oQ : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$l; + case 1: + return this.p; + case 2: + return this.oQ; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.$l.g, c10 = hd(b10, li().Pf); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), this.oQ ? fh(new je4().e("url")) : "url", c10, y7())))); + c10 = hd(b10, li().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "content", c10, y7(), this.N)))); + b10 = hd(b10, li().Kn); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, Yg(Zg(), "title", b10, y7(), this.N)))); + ws(a10, ay(this.$l, this.p, this.N).Pa()); + return this.p.zb(a10); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.$l)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.oQ ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ UOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlCreativeWorkItemsEmitter", { UOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function S32() { + this.m = this.Bh = this.X = this.la = null; + } + S32.prototype = new u7(); + S32.prototype.constructor = S32; + d7 = S32.prototype; + d7.H = function() { + return "RamlDescribedByParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof S32 && this.la === a10.la && Bj(this.X, a10.X)) { + var b10 = this.Bh; + a10 = a10.Bh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.X; + case 2: + return this.Bh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function j4a(a10, b10, c10, e10, f10) { + a10.la = b10; + a10.X = c10; + a10.Bh = e10; + a10.m = f10; + return a10; + } + d7.hd = function() { + var a10 = ac(new M6().W(this.X), this.la); + if (!a10.b()) { + var b10 = a10.c(); + a10 = b10.i.hb().gb; + if (Q5().sa === a10) { + a10 = b10.i; + var c10 = qc(); + a10 = N6(a10, c10, this.m); + Zz(this.m, this.Bh.j, a10, "describedBy"); + c10 = ac(new M6().W(a10), "headers"); + if (!c10.b()) { + c10 = c10.c(); + var e10 = c10.i; + b10 = qc(); + e10 = T32(new U32(), N6(e10, b10, this.m), w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = l10.Bh.j; + J5(K7(), H10()); + Ai(m10, p10); + }; + }(this)), this.m).Vg(); + b10 = w6(/* @__PURE__ */ function() { + return function(l10) { + var m10 = cj().We; + return eb(l10, m10, "header"); + }; + }(this)); + var f10 = K7(); + f10 = e10.ka(b10, f10.u); + e10 = this.Bh; + b10 = Xh().Tf; + f10 = Zr(new $r(), f10, Od(O7(), c10.i)); + c10 = Od(O7(), c10); + Rg(e10, b10, f10, c10); + } + ac(new M6().W(a10), "queryParameters").na() && ac(new M6().W(a10), "queryString").na() && (c10 = this.m, e10 = sg().ZM, b10 = this.Bh.j, f10 = y7(), ec(c10, e10, b10, f10, "Properties 'queryString' and 'queryParameters' are exclusive and cannot be declared together", a10.da)); + c10 = ac(new M6().W(a10), "queryParameters"); + c10.b() || (c10 = c10.c(), e10 = c10.i, b10 = qc(), e10 = T32(new U32(), N6(e10, b10, this.m), w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = l10.Bh.j; + J5(K7(), H10()); + Ai(m10, p10); + }; + }(this)), this.m).Vg(), b10 = w6(/* @__PURE__ */ function() { + return function(l10) { + var m10 = cj().We; + return eb(l10, m10, "query"); + }; + }(this)), f10 = K7(), f10 = e10.ka(b10, f10.u), e10 = this.Bh, b10 = Xh().Tl, f10 = Zr(new $r(), f10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg(e10, b10, f10, c10)); + c10 = ac(new M6().W(a10), "queryString"); + c10.b() || (c10 = c10.c(), c10 = PW(QW(), c10, w6(/* @__PURE__ */ function(l10) { + return function(m10) { + return m10.ub(l10.Bh.j, lt2()); + }; + }(this)), RW(false, false), QP(), this.m).Cc(), c10.b() || (e10 = c10.c(), c10 = this.Bh, e10 = HC(EC(), e10, this.Bh.j, y7()), b10 = Xh().Dq, Vd(c10, b10, e10))); + c10 = ac(new M6().W(a10), "responses"); + if (!c10.b()) { + c10 = c10.c(); + e10 = J5(Ef(), H10()); + b10 = c10.i.hb().gb; + if (Q5().nd !== b10) { + b10 = c10.i; + f10 = qc(); + b10 = N6(b10, f10, this.m).sb.Cb(w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = Px(); + m10 = m10.Aa; + var t10 = bc(); + return !Bla(p10, N6(m10, t10, l10.m).va); + }; + }(this))); + f10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + m10 = m10.Aa; + var p10 = bc(); + return N6(m10, p10, l10.m).va; + }; + }(this)); + var g10 = rw(); + f10 = b10.ka(f10, g10.sc); + g10 = qe2(); + g10 = re4(g10); + g10 = qt(f10, g10); + if (f10.jb() > g10.jb()) { + f10 = this.m; + g10 = sg().PX; + var h10 = this.Bh.j, k10 = y7(); + ec(f10, g10, h10, k10, "RAML Responses must not have duplicated status codes", c10.i.da); + } + b10.U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return Dg(m10, oy(l10.m.$h.x2(), p10, w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.Bh.j; + J5(K7(), H10()); + Ai(v10, A10); + }; + }(l10)), false).EH()); + }; + }(this, e10))); + } + b10 = this.Bh; + f10 = Xh().Al; + e10 = Zr( + new $r(), + e10, + Od(O7(), c10.i) + ); + c10 = Od(O7(), c10); + Rg(b10, f10, e10, c10); + } + Ry(new Sy(), this.Bh, a10, H10(), this.m).hd(); + } else + Q5().nd !== a10 && (a10 = this.m, c10 = sg().r6, e10 = this.Bh.j, b10 = b10.i, f10 = y7(), ec(a10, c10, e10, f10, "Invalid 'describedBy' type, map expected", b10.da)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlDescribedByParser", { YOa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function HP() { + this.l = this.AT = this.JL = this.Ou = this.Id = null; + } + HP.prototype = new u7(); + HP.prototype.constructor = HP; + d7 = HP.prototype; + d7.H = function() { + return "ValueAndOrigin"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof HP && a10.l === this.l) { + if (this.Id === a10.Id && Bj(this.Ou, a10.Ou)) { + var b10 = this.JL, c10 = a10.JL; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.AT, a10 = a10.AT, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Id; + case 1: + return this.Ou; + case 2: + return this.JL; + case 3: + return this.AT; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function UFa(a10, b10, c10, e10, f10, g10) { + a10.Id = c10; + a10.Ou = e10; + a10.JL = f10; + a10.AT = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlExternalTypesParser$ValueAndOrigin", { bPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function V32() { + this.Fa = null; + } + V32.prototype = new ALa(); + V32.prototype.constructor = V32; + V32.prototype.du = function(a10, b10, c10, e10) { + return UFa(new HP(), this.Fa, a10, b10, c10, e10); + }; + V32.prototype.t = function() { + return "ValueAndOrigin"; + }; + function k4a(a10) { + var b10 = new V32(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + return b10; + } + V32.prototype.$classData = r8({ cPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlExternalTypesParser$ValueAndOrigin$", { cPa: 1, Ypa: 1, f: 1, aga: 1, q: 1, o: 1 }); + function l4a() { + this.l = this.Jo = this.yw = null; + } + l4a.prototype = new u7(); + l4a.prototype.constructor = l4a; + d7 = l4a.prototype; + d7.H = function() { + return "MixedEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l4a && a10.l === this.l) { + var b10 = this.yw, c10 = a10.yw; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Jo, a10 = a10.Jo, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yw; + case 1: + return this.Jo; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function m4a(a10, b10) { + a10.Jo.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Ob(g10); + }; + }(a10, b10))); + if (a10.yw.Da()) { + var c10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10); + a10.yw.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10.Qa(g10); + }; + }(a10, e10))); + pr(c10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ iPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlInlinedUnionShapeEmitter$MixedEmitters", { iPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function n4a() { + this.l = this.ah = this.Ou = this.Id = this.m = null; + } + n4a.prototype = new u7(); + n4a.prototype.constructor = n4a; + d7 = n4a.prototype; + d7.H = function() { + return "RamlExternalOasLibParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n4a && a10.l === this.l) { + var b10 = this.m, c10 = a10.m; + return (null === b10 ? null === c10 : b10.h(c10)) && this.Id === a10.Id && Bj(this.Ou, a10.Ou) ? this.ah === a10.ah : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.m; + case 1: + return this.Id; + case 2: + return this.Ou; + case 3: + return this.ah; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.hd = function() { + var a10 = Iha(new je4().e(this.ah)) + (Ed(ua(), this.ah, "/") ? "" : "/"), b10 = QG(TG(), this.Id, this.Ou.da.Rf, vF().dl, this.m), c10 = Cj(b10); + b10 = o4a(this.l, this.m, this.Ou); + b10.mH = new z7().d(c10.Fd); + oYa(b10, c10.Fd); + var e10 = new W32().Tx(Zfa($fa(), $q(new Dc(), c10, y7()), a10, "application/json", H10(), dBa(), this.Id), b10); + c10 = c10.Fd; + var f10 = qc(), g10 = cc().bi; + e10.wca(N6(c10, f10, g10), a10 + "#/definitions/"); + b10 = b10.Qh.Oo; + a10 = new EB().mt(false, this.m); + b10 = new Fc().Vd(b10); + b10 = lMa(a10, b10.Sb.Ye().Dd()); + a10 = Rb(Ut(), H10()); + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return new R6().M(h10, Ab(h10.fa(), q5(p4a))); + }; + }(this)); + c10 = K7(); + b10.ka(e10, c10.u).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(), p10 = l10.ya(); + if (m10 instanceof vh && p10 instanceof z7) { + p10 = p10.i.j; + var t10 = B6(m10.Y(), qf().R).A; + t10 = t10.b() ? null : t10.c(); + if (p10 === t10) + return l10 = B6(m10.Y(), qf().R).A, l10 = l10.b() ? null : l10.c(), k10.Xh(new R6().M(l10, m10)); + } + } + if (null !== l10 && (m10 = l10.ma(), p10 = l10.ya(), m10 instanceof vh && p10 instanceof z7)) + return l10 = p10.i, p10 = B6(m10.Y(), qf().R).A, p10 = p10.b() ? null : p10.c(), k10.Xh(new R6().M(p10, m10)), k10.Xh(new R6().M(l10.j, m10)); + if (null !== l10 && (m10 = l10.ma(), p10 = l10.ya(), m10 instanceof vh && y7() === p10)) + return l10 = B6(m10.Y(), qf().R).A, l10 = l10.b() ? null : l10.c(), k10.Xh(new R6().M(l10, m10)); + throw new x7().d(l10); + }; + }(this, a10))); + b10 = this.m.pe(); + e10 = this.ah; + c10 = Gb().si; + f10 = UA(new VA(), nu()); + a10.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.jd(l10); + }; + }(a10, f10, c10))); + b10.FT = b10.FT.cc(new R6().M(e10, f10.eb)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ lPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlJsonSchemaExpression$RamlExternalOasLibParser", { lPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function G32() { + this.N = this.p = this.Uw = null; + } + G32.prototype = new u7(); + G32.prototype.constructor = G32; + d7 = G32.prototype; + d7.H = function() { + return "RamlOAuth1SettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G32) { + var b10 = this.Uw, c10 = a10.Uw; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uw; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Uw.g, b10 = J5(Ef(), H10()), c10 = hd(a10, vZ().zJ); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "requestTokenUri", c10, y7(), this.N)))); + c10 = hd(a10, vZ().km); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "authorizationUri", c10, y7(), this.N)))); + c10 = hd(a10, vZ().GJ); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "tokenCredentialsUri", c10, y7(), this.N)))); + a10 = hd(a10, vZ().DJ); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $x("signatures", a10, this.p, false)))); + return b10; + }; + d7.k1 = function(a10, b10, c10) { + this.Uw = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlOAuth1SettingsEmitters", { tPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q4a() { + this.N = this.p = this.tP = null; + } + q4a.prototype = new u7(); + q4a.prototype.constructor = q4a; + d7 = q4a.prototype; + d7.H = function() { + return "RamlOAuth2SettingsEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q4a) { + var b10 = this.tP, c10 = a10.tP; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tP; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.tP.g, b10 = J5(Ef(), H10()), c10 = B6(this.tP.g, xE().Ap).kc(); + c10.b() || (c10 = c10.c(), this.B$(c10, b10)); + a10 = hd(a10, xE().Gy); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, $x("authorizationGrants", a10, this.p, false)))); + return b10; + }; + d7.YK = function(a10, b10, c10) { + this.tP = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.B$ = function(a10, b10) { + a10 = a10.g; + var c10 = hd(a10, Jm().km); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "authorizationUri", c10, y7())))); + c10 = hd(a10, Jm().vq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "accessTokenUri", c10, y7(), this.N)))); + a10 = hd(a10, Jm().lo); + a10.b() || (a10 = a10.c(), new z7().d(Dg(b10, new r4a().Iaa("scopes", a10, this.p)))); + }; + d7.$classData = r8({ wPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlOAuth2SettingsEmitters", { wPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zy() { + this.Q = this.p = this.pa = null; + } + Zy.prototype = new u7(); + Zy.prototype.constructor = Zy; + d7 = Zy.prototype; + d7.H = function() { + return "RamlRecursiveShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Zy && this.pa === a10.pa && this.p === a10.p) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()); + Dg(a10, cx(new dx(), "type", "object", Q5().Na, ld())); + var b10 = fh(new je4().e("recursive")), c10 = B6(this.pa.aa, Ci().Ys).A; + Dg(a10, cx(new dx(), b10, c10.b() ? null : c10.c(), Q5().Na, ld())); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.FO = function(a10, b10, c10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + return this; + }; + d7.$classData = r8({ BPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlRecursiveShapeEmitter", { BPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function X32() { + this.N = this.p = this.Ba = null; + } + X32.prototype = new u7(); + X32.prototype.constructor = X32; + d7 = X32.prototype; + d7.H = function() { + return "RamlSecuritySettingsValuesEmitters"; + }; + d7.SG = function(a10, b10, c10) { + this.Ba = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof X32) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ba.r.r, b10 = J5(Ef(), H10()), c10 = a10 instanceof q1 ? new G32().k1(a10, this.p, this.N).Pa() : a10 instanceof wE ? new q4a().YK(a10, this.p, this.N).Pa() : a10 instanceof bR ? d3a(a10, this.p).Pa() : H10(); + ws(b10, c10); + a10 = hd(a10.Y(), Nm().Dy); + a10.b() || (a10 = a10.c(), ws(b10, iy(new jy(), a10.r.r, this.p, false, Rb(Ut(), H10()), this.N.hj()).Pa())); + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ JPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlSecuritySettingsValuesEmitters", { JPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y32() { + GP.call(this); + this.fv = this.Fd = this.se = this.mfa = this.de = this.ra = this.OJ = this.kB = this.Jq = this.Aa = this.HZ = null; + } + Y32.prototype = new N22(); + Y32.prototype.constructor = Y32; + function s4a() { + } + s4a.prototype = Y32.prototype; + Y32.prototype.HB = function(a10, b10, c10, e10, f10, g10) { + this.Aa = b10; + this.Jq = c10; + this.kB = e10; + this.OJ = f10; + this.ra = g10; + GP.prototype.ss.call(this, g10); + c10 = bc(); + this.de = N6(b10, c10, g10).va; + if (a10 instanceof ye4) + b10 = g10 = a10.i; + else { + if (!(a10 instanceof ve4)) + throw new x7().d(a10); + b10 = a10.i; + g10 = b10.i; + } + this.mfa = new R6().M(b10, g10); + this.se = this.mfa.ma(); + this.Fd = this.mfa.ya(); + a10 = new Bz().ln(a10).pk(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(Od(O7(), a10.Aa))); + this.fv = a10.b() ? (O7(), new P6().a()) : a10.c(); + return this; + }; + function t4a(a10) { + var b10 = wpa(ypa(), a10.se); + b10 = Sd(b10, a10.de, a10.fv); + a10.Jq.P(b10); + var c10 = a10.se; + if (c10 instanceof Es && c10.i.re() instanceof vw) { + var e10 = new u4a(); + c10 = c10.i.re(); + e10.wa = b10; + e10.Za = c10; + I22.prototype.EB.call(e10, a10); + e10.xV = fca(new EP().GB(true, true, false), b10); + return I22.prototype.Xi.call(e10); + } + return b10; + } + function v4a(a10) { + var b10 = a10.Fd, c10 = qc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) + a10 = w4a(new x4a(), a10, a10.de, a10.se, b10.i, w6(/* @__PURE__ */ function(e10) { + return function(f10) { + e10.Jq.P(f10); + }; + }(a10))).IV(); + else { + if (!(b10 instanceof ve4)) + throw new x7().d(b10); + b10 = a10.Jq; + c10 = tRa(vRa(), a10.se); + a10 = b10.P(Sd(c10, a10.de, a10.fv)); + } + return a10; + } + Y32.prototype.Cc = function() { + zma || (zma = new ez().a()); + var a10 = this.Fd, b10 = jc(kc(this.Fd), qc()); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + var c10 = ac(new M6().W(b10), "format"); + b10 = c10.b() ? ac(new M6().W(b10), fh(new je4().e("format"))) : c10; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.i.t())); + } + b10 = y4a(z4a("", b10, this.OJ, false, this.Nb()), a10); + if (b10.b()) + a10 = y7(); + else { + a10 = b10.c(); + if (hla() === a10) + a10 = new M32().ZK(this.Aa, this.Fd, this.Jq, true, this.Nb()), a10 = FP(a10); + else if (gla() === a10) + a10 = new N32().ZK(this.Aa, this.Fd, this.Jq, true, this.Nb()), a10 = FP(a10); + else if (UHa() === a10) + a10 = A4a(this); + else if (wca() === a10) + if (a10 = this.Fd.re(), a10 instanceof xt) { + c10 = this.Jq; + var e10 = new z7().d(this.se); + a10 = $A(c10, 0, e10, false, this.Nb()).AP(a10.va).c(); + "schema" !== this.de && "type" !== this.de && this.Jq.P(Sd(a10, this.de, this.fv)); + } else if (a10 instanceof vw) + a10 = B4a(this); + else + throw new x7().d(a10); + else if (zx() === a10) + a10 = this.xca(); + else if ($e2() === a10 || cf() === a10 || ff() === a10) + a10 = B4a(this); + else if (Ze() === a10) + a10 = v4a(this); + else if (yx() === a10) + a10 = t4a(this); + else if (Lca(a10)) + a10 = C4a(this, a10); + else { + if (SHa() !== a10) + throw new x7().d(a10); + a10 = this.OJ.gF; + a10 = Lca(a10) ? C4a(this, a10) : $e2() === a10 ? B4a(this) : t4a(this); + a10.fa().Lb(new N1().a()); + } + a10 = new z7().d(a10); + } + a10.b() || (c10 = a10.c(), this.Fd.re() instanceof xt && !b10.Ha(SHa()) && (b10 = new Z32().a(), Cb(c10, b10))); + e10 = a10; + b10 = this.Fd.re(); + if (b10 instanceof vw && e10.na()) { + c10 = new B32(); + e10 = e10.c(); + var f10 = this.Nb(), g10 = this.kB, h10 = y7(); + c10.pa = e10; + c10.X = b10; + c10.m = f10; + c10.gQ = g10; + c10.xP = h10; + c10.hd(); + } + b10 = this.Fd.re(); + if (b10 instanceof vw && a10.na()) { + c10 = a10.c(); + if (this.kB.Lw) { + ii(); + e10 = [Zx().H9]; + f10 = -1 + (e10.length | 0) | 0; + for (g10 = H10(); 0 <= f10; ) + g10 = ji(e10[f10], g10), f10 = -1 + f10 | 0; + e10 = g10; + } else { + e10 = H10(); + ii(); + f10 = [Zx().pa, Zx().le, Zx().jk]; + g10 = -1 + (f10.length | 0) | 0; + for (h10 = H10(); 0 <= g10; ) + h10 = ji(f10[g10], h10), g10 = -1 + g10 | 0; + f10 = h10; + g10 = ii(); + e10 = e10.ia(f10, g10.u); + } + Ry(new Sy(), c10, b10, e10, this.Nb()).hd(); + } + return a10; + }; + function A4a(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Vh().K(new S6().a(), b10); + b10 = Sd(b10, a10.de, a10.fv); + a10.Jq.P(b10); + var c10 = a10.Fd.re(); + if (c10 instanceof xt) { + wD(); + var e10 = mh(T6(), ""); + T6(); + c10 = new qg().e(c10.va); + e10 = pG(0, e10, mh(0, aQ(c10, "?"))); + e10 = a10.Nb().$h.iF().du(e10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Rd(k10, h10.j); + }; + }(a10, b10)), a10.kB.Lw, a10.OJ).Cc().c(); + } else { + if (!(c10 instanceof vw)) + throw new x7().d(c10); + e10 = c10.sb; + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + return "type" === N6(k10, l10, g10.Nb()).va ? (wD(), T6(), k10 = mh(T6(), "type"), T6(), h10 = h10.i, l10 = bc(), h10 = N6(h10, l10, g10.Nb()).va, h10 = new qg().e(h10), h10 = aQ(h10, "?"), pG(0, k10, mh(T6(), h10))) : h10; + }; + }(a10)); + var f10 = rw(); + c10 = e10.ka(c10, f10.sc); + wD(); + e10 = mh(T6(), ""); + T6(); + ur(); + f10 = c10.kc(); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da.Rf)); + c10 = tr(0, c10, f10.b() ? "" : f10.c()); + T6(); + e10 = pG(0, e10, mr(T6(), c10, Q5().sa)); + e10 = a10.Nb().$h.iF().du(e10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Rd(k10, h10.j); + }; + }(a10, b10)), a10.kB.Lw, a10.OJ).Cc().c(); + } + a10 = K7(); + O7(); + c10 = new P6().a(); + c10 = new Th().K(new S6().a(), c10); + e10 = [e10, Rd(c10, b10.j)]; + a10 = J5(a10, new Ib().ha(e10)); + e10 = xn().Le; + return Zd(b10, e10, a10); + } + function C4a(a10, b10) { + if (df() === b10) { + var c10 = PY(QY(), a10.se); + c10 = Sd(c10, a10.de, a10.fv); + a10.Jq.P(c10); + b10 = a10.Fd.hb().gb; + if (Q5().sa === b10) { + var e10 = a10.Fd, f10 = qc(); + b10 = new D4a(); + e10 = N6(e10, f10, a10.Nb()); + b10.wa = c10; + b10.Za = e10; + I22.prototype.EB.call(b10, a10); + return b10.Xi(); + } + return c10; + } + c10 = UY(VY(), a10.se); + c10 = Sd(c10, a10.de, a10.fv); + a10.Jq.P(c10); + e10 = a10.Fd.hb().gb; + if (Q5().sa === e10) { + f10 = a10.Fd; + var g10 = qc(); + e10 = new E4a(); + f10 = N6(f10, g10, a10.Nb()); + e10.nq = b10; + e10.wa = c10; + e10.Za = f10; + I22.prototype.EB.call(e10, a10); + return e10.DH(); + } + if (Q5().cd === e10) + return e10 = a10.se, YFa(new JP(), a10, e10, c10, y7(), a10.Nb()).hd(), a10 = Fg().af, b10 = ih(new jh(), LC(MC(), b10), new P6().a()), e10 = Od(O7(), e10), Rg(c10, a10, b10, e10), c10; + e10 = Fg().af; + a10 = ih(new jh(), LC(MC(), b10), Od(O7(), a10.Fd.re())); + return Vd(c10, e10, a10); + } + function B4a(a10) { + if (F4a(a10)) { + var b10 = a10.Fd.hb().gb; + if (Q5().Na === b10) + a10 = a10.Jq, O7(), b10 = new P6().a(), a10 = a10.P(new Wh().K(new S6().a(), b10)); + else { + if (Q5().sa !== b10) + throw new x7().d(b10); + a10 = G4a(a10, a10.Fd, a10.Jq).CH(); + } + return a10; + } + b10 = yRa(ARa(), a10.se); + b10 = Sd(b10, a10.de, a10.fv); + a10.Jq.P(b10); + var c10 = a10.Fd.hb().gb; + if (Q5().sa === c10) { + c10 = a10.Fd; + var e10 = qc(); + return H4a(new I4a(), a10, b10, N6(c10, e10, a10.Nb())).Xi(); + } + if (Q5().cd === c10) + return YFa(new JP(), a10, a10.se, b10, y7(), a10.Nb()).hd(), b10; + if (jc(kc(a10.Fd), bc()).na()) { + c10 = a10.Nb().hp(a10.Fd); + c10 instanceof ve4 ? (c10 = c10.i, e10 = new R6().M(c10, fB(a10.Nb().pe(), c10, Ys(), new z7().d(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = m10.Nb(), A10 = sg().Oy, D10 = p10.j, C10 = m10.Fd, I10 = y7(); + ec(v10, A10, D10, I10, t10, C10.da); + }; + }(a10, b10)))))) : (c10 = a10.Fd, e10 = bc(), c10 = N6(c10, e10, a10.Nb()).va, e10 = new R6().M(c10, fB(a10.Nb().pe(), c10, Zs(), y7()))); + if (null !== e10) { + c10 = e10.ma(); + var f10 = e10.ya(); + if (null !== c10 && f10 instanceof z7) + return c10 = f10.i.Ug(c10, Rs(O7(), a10.Fd)), Sd(c10, a10.de, a10.fv).pc(b10.j); + } + if (null !== e10 && (c10 = e10.ma(), null !== c10 && (f10 = ff(), Nh(), Nh(), c10 = Oh(Nh(), c10, "", f10, false), f10 = $e2(), null !== c10 && c10 === f10))) + return b10.Xa.Lb(new xi().a()), b10; + if (null !== e10 && (c10 = e10.ma(), null !== c10)) { + e10 = wi(new vi(), new S6().a(), Od(O7(), a10.Fd), c10, y7(), new z7().d(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = db().pf; + eb(p10, v10, t10); + }; + }(a10, b10))), false); + e10 = Sd(e10, c10, a10.fv); + Jb(e10, a10.Nb()); + a10.Jq.P(e10); + if (tCa(new je4().e(c10))) + f10 = false; + else { + f10 = pd(a10.Nb().pe().xi).th.Er(); + for (var g10 = false; !g10 && f10.Ya(); ) { + g10 = f10.$a(); + var h10 = Mc(ua(), c10, "\\."); + g10 = g10 === zj(new Pc().fd(h10)); + } + f10 = g10; + } + if (f10) { + f10 = a10.Nb(); + g10 = sg().vR; + h10 = b10.j; + var k10 = "Chained reference '" + c10; + a10 = a10.Fd; + var l10 = y7(); + ec(f10, g10, h10, l10, k10, a10.da); + } else + lB(e10, c10, a10.Fd, a10.Nb()); + a10 = jb(b10, e10); + b10 = db().ed; + return eb(a10, b10, c10); + } + throw new x7().d(e10); + } + throw new x7().d(c10); + } + Y32.prototype.xca = function() { + var a10 = Od(O7(), this.Fd); + a10 = new Vh().K(new S6().a(), a10); + a10 = Sd(a10, this.de, this.fv); + this.Jq.P(a10); + var b10 = this.Fd.hb().gb; + if (Q5().sa === b10) { + var c10 = this.Fd, e10 = qc(); + b10 = new J4a(); + c10 = N6(c10, e10, this.Nb()); + b10.Za = c10; + b10.wa = a10; + I22.prototype.EB.call(b10, this); + return b10.zP(); + } + if (Q5().cd === b10) + YFa(new JP(), this, this.se, a10, y7(), this.Nb()).hd(); + else { + b10 = this.Nb(); + c10 = Wd().dN; + e10 = a10.j; + var f10 = "Invalid node for union shape '" + this.Fd.t(), g10 = this.Fd, h10 = y7(); + ec(b10, c10, e10, h10, f10, g10.da); + } + return a10; + }; + function F4a(a10) { + var b10 = a10.Fd, c10 = qc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) + return b10 = b10.i, a10 = a10.uM(b10), a10.b() ? a10 = false : (a10 = a10.c().i, c10 = bc(), a10 = Iw(a10, c10), a10 = a10 instanceof ye4 ? "file" === a10.i.va : false), a10 ? true : ac(new M6().W(b10), "fileTypes").na(); + if (b10 instanceof ve4) + return b10 = a10.Fd, a10 = bc(), b10 = Iw(b10, a10), b10 instanceof ye4 ? "file" === b10.i.va : false; + throw new x7().d(b10); + } + function LP() { + this.l = this.pa = this.X = null; + } + LP.prototype = new u7(); + LP.prototype.constructor = LP; + d7 = LP.prototype; + d7.H = function() { + return "AndConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof LP && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.TK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + var a10 = new M6().W(this.X), b10 = fh(new je4().e("and")); + a10 = ac(a10, b10); + if (!a10.b()) { + a10 = a10.c(); + b10 = a10.i; + var c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + return nD(g10.l.hQ(), (ue4(), new ye4().d(k10)), "item" + h10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.ub(l10.pa.j + "/and/" + m10, lt2()); + }; + }(g10, h10)), g10.l.kB.Lw, vP()).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().fi; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.Nb(); + c10 = sg().iY; + e10 = this.pa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "And constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ XPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$AndConstraintParser", { XPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function x4a() { + this.l = this.yb = this.X = this.ad = this.$ = null; + } + x4a.prototype = new u7(); + x4a.prototype.constructor = x4a; + d7 = x4a.prototype; + d7.H = function() { + return "DataArrangementParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof x4a && a10.l === this.l) { + if (this.$ === a10.$) { + var b10 = this.ad, c10 = a10.ad; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && Bj(this.X, a10.X)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.ad; + case 2: + return this.X; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.IV = function() { + var a10 = ac(new M6().W(this.X), fh(new je4().e("tuple"))); + if (a10 instanceof z7) { + a10 = a10.i.i; + var b10 = lc(); + if (Iw(a10, b10) instanceof ye4) + ue4(), a10 = GRa(IRa(), this.ad), a10 = Sd(a10, this.$, this.l.fv), a10 = new ve4().d(a10); + else { + a10 = GRa(IRa(), this.ad); + a10 = Sd(a10, this.$, this.l.fv); + b10 = this.l.Nb(); + var c10 = sg().u6, e10 = a10.j, f10 = this.ad, g10 = y7(); + ec(b10, c10, e10, g10, "Tuples must have a list of types", f10.da); + ue4(); + a10 = new ve4().d(a10); + } + } else if (y7() === a10) + ue4(), a10 = tRa(vRa(), this.ad), a10 = Sd(a10, this.$, this.l.fv), a10 = new ye4().d(a10); + else + throw new x7().d(a10); + if (a10 instanceof ve4) + return b10 = K4a, c10 = this.l, e10 = this.X, f10 = this.yb, g10 = new L4a(), g10.wa = a10.i, g10.Za = e10, g10.eh = f10, I22.prototype.EB.call(g10, c10), b10(g10); + if (a10 instanceof ye4) + return b10 = this.l, c10 = this.X, e10 = this.yb, f10 = new M4a(), f10.wa = a10.i, f10.Za = c10, f10.eh = e10, I22.prototype.EB.call(f10, b10), f10.Xi(); + throw new x7().d(a10); + }; + function w4a(a10, b10, c10, e10, f10, g10) { + a10.$ = c10; + a10.ad = e10; + a10.X = f10; + a10.yb = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ aQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$DataArrangementParser", { aQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function NP() { + this.l = this.pa = this.X = null; + } + NP.prototype = new u7(); + NP.prototype.constructor = NP; + d7 = NP.prototype; + d7.H = function() { + return "NotConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NP && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.TK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + var a10 = new M6().W(this.X), b10 = fh(new je4().e("not")); + a10 = ac(a10, b10); + if (!a10.b() && (a10 = a10.c(), b10 = nD(this.l.hQ(), (ue4(), new ve4().d(a10)), "not", w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return Rd(g10, f10.pa.j + "/not"); + }; + }(this)), false, this.l.OJ).Cc(), b10 instanceof z7)) { + b10 = b10.i; + var c10 = this.pa, e10 = qf().Bi; + a10 = Od(O7(), a10.i); + Rg(c10, e10, b10, a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ fQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$NotConstraintParser", { fQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function KP() { + this.l = this.pa = this.X = null; + } + KP.prototype = new u7(); + KP.prototype.constructor = KP; + d7 = KP.prototype; + d7.H = function() { + return "OrConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof KP && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.TK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + var a10 = new M6().W(this.X), b10 = fh(new je4().e("or")); + a10 = ac(a10, b10); + if (!a10.b()) { + a10 = a10.c(); + b10 = a10.i; + var c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + return nD(g10.l.hQ(), (ue4(), new ye4().d(k10)), "item" + h10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.ub(l10.pa.j + "/or/" + m10, lt2()); + }; + }(g10, h10)), g10.l.kB.Lw, vP()).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().ki; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.Nb(); + c10 = sg().nY; + e10 = this.pa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "Or constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ gQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$OrConstraintParser", { gQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function OP() { + this.l = this.xb = this.ad = null; + } + OP.prototype = new u7(); + OP.prototype.constructor = OP; + d7 = OP.prototype; + d7.H = function() { + return "PropertiesParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof OP && a10.l === this.l && Bj(this.ad, a10.ad)) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.ad.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.l, h10 = e10.xb, k10 = new N4a(); + k10.tb = f10; + k10.xb = h10; + if (null === g10) + throw mb(E6(), null); + k10.l = g10; + return k10.Cc().ua(); + }; + }(this)), c10 = rw(); + return a10.bd(b10, c10.sc); + }; + function ZFa(a10, b10, c10, e10) { + a10.ad = c10; + a10.xb = e10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ hQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$PropertiesParser", { hQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N4a() { + this.l = this.xb = this.tb = null; + } + N4a.prototype = new u7(); + N4a.prototype.constructor = N4a; + d7 = N4a.prototype; + d7.H = function() { + return "PropertyShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N4a && a10.l === this.l && this.tb === a10.tb) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = Kc(this.tb.Aa); + if (a10 instanceof z7) { + var b10 = a10.i.va; + a10 = this.xb.P(b10); + var c10 = Od(O7(), this.tb); + a10 = Db(a10, c10); + if (0 <= (b10.length | 0) && "/" === b10.substring(0, 1) && Ed(ua(), b10, "/")) + if ("//" === b10) + c10 = Qi().cv, eb(a10, c10, "^.*$"); + else { + c10 = new qg().e(b10); + var e10 = c10.ja.length | 0; + c10 = gh(hh(), c10.ja, 1, e10); + c10 = new qg().e(c10); + c10 = c10.np(0, c10.Oa() - 1 | 0); + e10 = Qi().cv; + eb(a10, e10, c10); + } + c10 = jc(kc(this.tb.i), qc()); + if (c10 instanceof z7) { + c10 = c10.i; + e10 = ac(new M6().W(c10), "required"); + if (!e10.b()) { + var f10 = e10.c(), g10 = !!new Qg().Vb(f10.i, this.l.Nb()).Up().r; + e10 = Qi().ji; + g10 = ih( + new jh(), + g10 ? 1 : 0, + new P6().a() + ); + f10 = Od(O7(), f10).Lb(new xi().a()); + Rg(a10, e10, g10, f10); + } + c10 = new M6().W(c10); + e10 = fh(new je4().e("readOnly")); + f10 = this.l; + g10 = Qi().cl; + Gg(c10, e10, Hg(Ig(f10, g10, this.l.Nb()), a10)); + } + c10 = Qi().Uf; + e10 = F6().Pg; + f10 = this.tb.Aa; + g10 = bc(); + f10 = N6(f10, g10, this.l.Nb()).va; + f10 = new je4().e(f10); + f10 = jj(f10.td); + e10 = ih(new jh(), ic(G5(e10, f10)), Od(O7(), this.tb.Aa)); + Vd(a10, c10, e10); + cs(a10.aa, Qi().ji).b() && (B6(a10.aa, Qi().cv).A.na() ? (b10 = Qi().ji, es(a10, b10, 0)) : (e10 = !Ed(ua(), b10, "?"), c10 = Qi().ji, es(a10, c10, e10 ? 1 : 0), c10 = Qi().R, e10 || (b10 = new qg().e(b10), b10 = aQ(b10, "?"), b10 = new qg().e(b10), b10 = Wp(b10, "/"), b10 = new qg().e(b10), b10 = aQ(b10, "/")), eb(a10, c10, b10), b10 = Qi().Uf, c10 = F6().Pg, e10 = this.tb.Aa, f10 = bc(), e10 = N6(e10, f10, this.l.Nb()).va, e10 = new qg().e(e10), e10 = aQ(e10, "?"), eb(a10, b10, ic(G5(c10, e10))))); + b10 = PW(QW(), this.tb, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.ub(k10.j, lt2()); + }; + }(this, a10)), RW(false, true), QP(), this.l.Nb()).Cc(); + b10.b() || (b10 = b10.c(), c10 = this.tb.i.hb().gb, e10 = Q5().nd, c10 === e10 && b10.fa().Lb(new Xz().a()), c10 = Qi().Vf, Vd(a10, c10, b10)); + return new z7().d(a10); + } + if (y7() === a10) + return a10 = this.l.Nb(), b10 = sg().n6, c10 = this.tb.Aa, e10 = y7(), ec(a10, b10, "", e10, "Invalid property name", c10.da), y7(); + throw new x7().d(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ iQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$PropertyShapeParser", { iQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function MP() { + this.l = this.pa = this.X = null; + } + MP.prototype = new u7(); + MP.prototype.constructor = MP; + d7 = MP.prototype; + d7.H = function() { + return "XoneConstraintParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof MP && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.pa; + a10 = a10.pa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.pa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.TK = function(a10, b10, c10) { + this.X = b10; + this.pa = c10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + this.l.Jq.P(this.pa); + var a10 = new M6().W(this.X), b10 = fh(new je4().e("xor")); + a10 = ac(a10, b10); + if (!a10.b()) { + a10 = a10.c(); + b10 = a10.i; + var c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + return nD(g10.l.hQ(), (ue4(), new ye4().d(k10)), "item" + h10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.ub(l10.pa.j + "/xor/" + m10, lt2()); + }; + }(g10, h10)), g10.l.kB.Lw, vP()).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.pa; + e10 = qf().li; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.Nb(); + c10 = sg().uY; + e10 = this.pa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "Xone constraints are built from multiple shape nodes", a10.da); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ nQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$XoneConstraintParser", { nQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function EX() { + this.m = this.Q = null; + } + EX.prototype = new u7(); + EX.prototype.constructor = EX; + d7 = EX.prototype; + d7.H = function() { + return "ReferenceDeclarations"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof EX) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ht = function(a10, b10) { + this.Q.Xh(new R6().M(a10, b10)); + var c10 = lFa(this.m.Dl(), a10); + if (b10 instanceof ad || b10 instanceof $32) + this.m.Dl().dca = this.m.Dl().dca.cc(new R6().M(a10, b10)); + else if (Zc(b10)) + b10.tk().U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return $h(f10, g10); + }; + }(this, c10))); + else + throw new x7().d(b10); + }; + function O4a(a10) { + a10 = a10.Q.Ur().xg(); + return kz(a10); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ReferenceDeclarations", { uQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function P4a() { + this.m = this.Q = this.X = this.la = this.wf = null; + } + P4a.prototype = new u7(); + P4a.prototype.constructor = P4a; + d7 = P4a.prototype; + d7.H = function() { + return "ReferencesParser"; + }; + d7.E = function() { + return 4; + }; + function pz(a10, b10) { + b10 = Q4a(a10, b10); + a10.Q.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + a: { + if (null !== f10) { + var g10 = f10.Jd, h10 = f10.$n; + if (Kk(g10) && null !== h10) { + f10 = h10.Of; + e10.Q.Xh(new R6().M(f10, g10)); + h10 = e10.m.Dl(); + var k10 = h10.ij; + g10 = jD(new kD(), g10.qe(), Lc(g10)); + h10.ij = k10.cc(new R6().M(f10, g10)); + break a; + } + } + if (null !== f10 && (g10 = f10.Jd, h10 = f10.$n, g10 instanceof mf && null !== h10)) { + e10.Q.Xh(new R6().M(h10.Of, g10)); + break a; + } + null !== f10 && (g10 = f10.Jd, f10 = f10.$n, (g10 instanceof ad || g10 instanceof $32) && null !== f10 && e10.Ht(f10.Of, g10)); + } + }; + }(a10, b10))); + return b10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof P4a) { + var b10 = this.wf, c10 = a10.wf; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.la === a10.la && Bj(this.X, a10.X)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.la; + case 2: + return this.X; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rM = function(a10) { + a10 = this.Q.Fb(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return e10.$n.Of === c10; + }; + }(this, a10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Jd); + }; + function qz(a10, b10, c10, e10, f10) { + var g10 = new P4a(); + g10.wf = a10; + g10.la = b10; + g10.X = c10; + g10.Q = e10; + g10.m = f10; + return g10; + } + d7.oG = function(a10, b10) { + var c10 = Ab(a10.fa(), q5(Rc)); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = a10.fa(), f10 = e10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof tB) && Of(g10, h10); + f10 = f10.ta(); + } + e10.hf = g10.eb; + b10 = c10.Xb.Zj(b10); + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + if (y7() === c10) { + b10 = [b10]; + if (0 === (b10.length | 0)) + b10 = vd(); + else { + c10 = wd(new xd(), vd()); + e10 = 0; + for (g10 = b10.length | 0; e10 < g10; ) + Ad(c10, b10[e10]), e10 = 1 + e10 | 0; + b10 = c10.eb; + } + b10 = new tB().hk(b10); + return Cb(a10, b10); + } + throw new x7().d(c10); + }; + d7.z = function() { + return X5(this); + }; + function Q4a(a10, b10) { + MPa || (MPa = new DX().a()); + var c10 = LPa(a10.m), e10 = ac(new M6().W(a10.X), a10.la); + if (!e10.b()) { + e10 = e10.c(); + var f10 = e10.i.hb().gb; + if (Q5().sa === f10) + e10 = e10.i, f10 = qc(), N6(e10, f10, a10.m).sb.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + var t10 = p10.Aa, v10 = bc(); + t10 = N6(t10, v10, k10.m).va; + v10 = UGa(VGa(), p10, k10.m); + if (!v10.b()) { + var A10 = v10.c(); + v10 = k10.rM(A10); + if (!v10.b()) + if (v10 = v10.c(), Zc(v10)) + p10 = k10.wf, A10 = new R6().M(v10.j, A10), k10.oG(p10, new R6().M(t10, A10)), l10.Ht(t10, v10); + else { + t10 = k10.m; + A10 = dc().CR; + v10 = "Expected module but found: " + v10; + var D10 = y7(); + ec(t10, A10, m10, D10, v10, p10.da); + } + } + }; + }(a10, c10, b10))); + else if (Q5().nd !== f10) { + a10 = a10.m; + f10 = Wd().IR; + var g10 = "Invalid ast type for uses: " + e10.i.hb().gb; + e10 = e10.i; + var h10 = y7(); + ec(a10, f10, b10, h10, g10, e10.da); + } + } + return c10; + } + d7.$classData = r8({ wQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ReferencesParser", { wQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function a42() { + this.kl = this.pa = null; + } + a42.prototype = new u7(); + a42.prototype.constructor = a42; + d7 = a42.prototype; + d7.H = function() { + return "RequiredShapeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof a42) { + var b10 = this.pa, c10 = a10.pa; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.kl, a10 = a10.kl, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.kl; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function R4a(a10, b10, c10) { + a10.pa = b10; + a10.kl = c10; + return a10; + } + function S4a(a10) { + a10 = a10.kl; + if (a10.b()) + return y7(); + a10 = a10.c(); + return wh(a10.r.x, q5(b42)) ? new z7().d(ky("required", T4a(new c42(), 0 < za(Si(a10.r.r)) ? "true" : "false", Q5().ti), Q5().Na, ld())) : y7(); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RequiredShapeEmitter", { yQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function d42() { + this.m = this.lg = this.X = null; + } + d42.prototype = new u7(); + d42.prototype.constructor = d42; + d7 = d42.prototype; + d7.H = function() { + return "ShapeDependenciesParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof d42 && Bj(this.X, a10.X)) { + var b10 = this.lg; + a10 = a10.lg; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function U4a(a10, b10, c10, e10) { + a10.X = b10; + a10.lg = c10; + a10.m = e10; + return a10; + } + d7.Vg = function() { + var a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.lg, h10 = e10.m, k10 = new Z2a(); + k10.tb = f10; + k10.lg = g10; + k10.m = h10; + return k10.Cc().ua(); + }; + }(this)), c10 = rw(); + return a10.bd(b10, c10.sc); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ CQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ShapeDependenciesParser", { CQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function V4a() { + this.aP = this.Lw = false; + } + V4a.prototype = new u7(); + V4a.prototype.constructor = V4a; + d7 = V4a.prototype; + d7.H = function() { + return "TypeInfo"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof V4a ? this.Lw === a10.Lw && this.aP === a10.aP : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lw; + case 1: + return this.aP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.Lw ? 1231 : 1237); + a10 = OJ().Ga(a10, this.aP ? 1231 : 1237); + return OJ().fe(a10, 2); + }; + function RW(a10, b10) { + var c10 = new V4a(); + c10.Lw = a10; + c10.aP = b10; + return c10; + } + d7.$classData = r8({ IQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.TypeInfo", { IQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function W4a() { + this.X = this.m = this.Ca = this.i0 = null; + } + W4a.prototype = new u7(); + W4a.prototype.constructor = W4a; + d7 = W4a.prototype; + d7.H = function() { + return "XMLSerializerParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof W4a ? this.i0 === a10.i0 ? Bj(this.Ca, a10.Ca) : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.i0; + case 1: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function mma(a10) { + cSa || (cSa = new pZ().a()); + var b10 = a10.Ca; + b10 = Rs(O7(), b10); + b10 = new sn().K(new S6().a(), b10); + var c10 = rn().yF; + b10 = Bi(b10, c10, false); + c10 = rn().NJ; + b10 = Bi(b10, c10, false); + c10 = ac(new M6().W(a10.X), "attribute"); + if (!c10.b()) { + var e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m); + c10 = rn().yF; + f10 = f10.Up(); + e10 = Od(O7(), e10).Lb(new xi().a()); + Rg(b10, c10, f10, e10); + } + c10 = ac(new M6().W(a10.X), "wrapped"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = rn().NJ, f10 = f10.Up(), e10 = Od(O7(), e10).Lb(new xi().a()), Rg(b10, c10, f10, e10)); + c10 = ac(new M6().W(a10.X), "name"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = rn().R, f10 = f10.nf(), e10 = Od( + O7(), + e10 + ).Lb(new xi().a()), Rg(b10, c10, f10, e10)); + c10 = ac(new M6().W(a10.X), "namespace"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = rn().oN, f10 = f10.nf(), e10 = Od(O7(), e10), Rg(b10, c10, f10, e10)); + c10 = ac(new M6().W(a10.X), "prefix"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = rn().qN, f10 = f10.nf(), e10 = Od(O7(), e10), Rg(b10, c10, f10, e10)); + Zz(a10.m, b10.j, a10.X, "xmlSerialization"); + return b10; + } + d7.z = function() { + return X5(this); + }; + function nma(a10, b10, c10) { + var e10 = new W4a(); + e10.i0 = a10; + e10.Ca = b10; + e10.m = c10; + a10 = qc(); + e10.X = N6(b10, a10, c10); + return e10; + } + d7.$classData = r8({ LQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.XMLSerializerParser", { LQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function e42() { + this.Cl = this.A0 = null; + } + e42.prototype = new u7(); + e42.prototype.constructor = e42; + d7 = e42.prototype; + d7.H = function() { + return "DataNodeParserResult"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof e42) { + var b10 = this.A0, c10 = a10.A0; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Cl, a10 = a10.Cl, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A0; + case 1: + return this.Cl; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.bH = function(a10, b10) { + this.A0 = a10; + this.Cl = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.DataNodeParserResult", { NQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function EP() { + this.Ow = this.xv = this.$H = false; + } + EP.prototype = new u7(); + EP.prototype.constructor = EP; + function X4a() { + } + d7 = X4a.prototype = EP.prototype; + d7.H = function() { + return "ExampleOptions"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof EP ? this.$H === a10.$H && this.xv === a10.xv && this.Ow === a10.Ow : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$H; + case 1: + return this.xv; + case 2: + return this.Ow; + default: + throw new U6().e("" + a10); + } + }; + function fca(a10, b10) { + return b10 instanceof Mh ? new EP().GB(a10.$H, a10.xv, true) : a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.$H ? 1231 : 1237); + a10 = OJ().Ga(a10, this.xv ? 1231 : 1237); + a10 = OJ().Ga(a10, this.Ow ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.GB = function(a10, b10, c10) { + this.$H = a10; + this.xv = b10; + this.Ow = c10; + return this; + }; + d7.$classData = r8({ k7: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ExampleOptions", { k7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y4a() { + this.we = this.Ca = null; + this.Ow = this.wO = this.xv = false; + this.m = null; + } + Y4a.prototype = new u7(); + Y4a.prototype.constructor = Y4a; + d7 = Y4a.prototype; + d7.H = function() { + return "NodeDataNodeParser"; + }; + d7.E = function() { + return 5; + }; + function Fy(a10, b10, c10, e10, f10, g10) { + var h10 = new Y4a(); + h10.Ca = a10; + h10.we = b10; + h10.xv = c10; + h10.wO = e10; + h10.Ow = f10; + h10.m = g10; + return h10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Y4a ? Bj(this.Ca, a10.Ca) && this.we === a10.we && this.xv === a10.xv && this.wO === a10.wO ? this.Ow === a10.Ow : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.we; + case 2: + return this.xv; + case 3: + return this.wO; + case 4: + return this.Ow; + default: + throw new U6().e("" + a10); + } + }; + function Ey(a10) { + var b10 = a10.xv ? new f42().e(a10.m.qh) : a10.m, c10 = y7(), e10 = false, f10 = null, g10 = jc(kc(a10.Ca), bc()); + a: { + if (g10 instanceof z7 && (e10 = true, f10 = g10, Ota(f10.i.oH))) { + e10 = new z7().d(a10.Ca); + break a; + } + if (!e10 || !a10.Ow) { + if (e10 && (g10 = f10.i, ela().qj(g10.va).na())) { + c10 = new z7().d(g10.va); + e10 = jc(kc(a10.Ca), bc()); + if (e10.b()) + e10 = y7(); + else { + f10 = e10.c(); + if (a10.wO) + e10 = QG(TG(), f10.va, f10.da.Rf, vF().dl, a10.m); + else { + TG(); + e10 = f10.va; + f10 = f10.da.Rf; + g10 = vF(); + var h10 = a10.Ca.da; + h10 = de4(ee4(), h10.rf, h10.If, h10.Yf, h10.bg).rf; + var k10 = a10.Ca.da; + e10 = QG(0, e10, f10, uF(g10, h10, de4(ee4(), k10.rf, k10.If, k10.Yf, k10.bg).If, (vF(), 0)), b10); + } + e10 = new z7().d(Cj(e10).Fd); + } + break a; + } + if (e10 && (e10 = f10.i, dla().qj(e10.va).na())) { + e10 = y7(); + break a; + } + } + e10 = new z7().d(a10.Ca); + } + f10 = false; + g10 = null; + if (b10 instanceof f42 && (f10 = true, g10 = b10, g10.$W && c10.na())) + return b10 = c10, b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(new g42().e(b10))), b10 = b10.ua(), Z4a(a10, e10, b10); + if (f10 && g10.$W) + return new e42().bH(e10, y7()); + b10 = c10; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(new g42().e(b10))); + b10 = b10.ua(); + return Z4a(a10, e10, b10); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Ca)); + a10 = OJ().Ga(a10, NJ(OJ(), this.we)); + a10 = OJ().Ga(a10, this.xv ? 1231 : 1237); + a10 = OJ().Ga(a10, this.wO ? 1231 : 1237); + a10 = OJ().Ga(a10, this.Ow ? 1231 : 1237); + return OJ().fe(a10, 5); + }; + function Z4a(a10, b10, c10) { + if (b10.b()) + a10 = y7(); + else { + var e10 = b10.c(), f10 = new z7().d(a10.we), g10 = new ox().a(), h10 = new Nd().a(); + f10 = px(e10, g10, f10, h10, a10.m).Fr(); + g10 = f10.fa(); + var k10 = g10.hf; + Ef(); + h10 = Jf(new Kf(), new Lf().a()); + for (k10 = k10.Dc; !k10.b(); ) { + var l10 = k10.ga(); + false !== !(l10 instanceof be4) && Of(h10, l10); + k10 = k10.ta(); + } + g10.hf = h10.eb; + g10 = f10.fa(); + ae4(); + e10 = e10.re().da; + g10.Lb(new be4().jj(ce4(0, de4(ee4(), e10.rf, e10.If, e10.Yf, e10.bg)))); + c10.U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return p10.fa().Lb(t10); + }; + }(a10, f10))); + a10 = new z7().d(f10); + } + return new e42().bH(b10, a10); + } + d7.$classData = r8({ VQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.NodeDataNodeParser", { VQa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function $4a() { + this.m = this.we = this.tb = null; + } + $4a.prototype = new u7(); + $4a.prototype.constructor = $4a; + d7 = $4a.prototype; + d7.H = function() { + return "Oas3NamedExamplesParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof $4a ? this.tb === a10.tb ? this.we === a10.we : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.tb.i, b10 = qc(); + a10 = N6(a10, b10, this.m).sb; + b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = new a5a(), h10 = e10.we, k10 = b5a(), l10 = e10.m; + g10.tb = f10; + g10.we = h10; + g10.wc = k10; + g10.m = l10; + g10.Rma = new Qg().Vb(f10.Aa, l10); + return g10.Xw(); + }; + }(this)); + var c10 = rw(); + return a10.ka(b10, c10.sc); + }; + d7.z = function() { + return X5(this); + }; + function c5a(a10, b10, c10) { + var e10 = new $4a(); + e10.tb = a10; + e10.we = b10; + e10.m = c10; + return e10; + } + d7.$classData = r8({ eRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3NamedExamplesParser", { eRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function h42() { + this.m = this.xb = this.tb = null; + } + h42.prototype = new u7(); + h42.prototype.constructor = h42; + d7 = h42.prototype; + d7.H = function() { + return "OasContentsParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof h42 && this.tb === a10.tb) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.NO = function(a10, b10, c10) { + this.tb = a10; + this.xb = b10; + this.m = c10; + return this; + }; + d7.GH = function() { + var a10 = J5(Ef(), H10()), b10 = this.tb.i, c10 = qc(); + N6(b10, c10, this.m).sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return Dg(f10, new d5a().NO(g10, e10.xb, e10.m).ly()); + }; + }(this, a10))); + return a10.ua(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ oRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasContentsParser", { oRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function e5a() { + this.m = this.we = this.X = null; + } + e5a.prototype = new u7(); + e5a.prototype.constructor = e5a; + d7 = e5a.prototype; + d7.H = function() { + return "OasExamplesParser"; + }; + d7.E = function() { + return 2; + }; + function f5a(a10, b10, c10) { + var e10 = new e5a(); + e10.X = a10; + e10.we = b10; + e10.m = c10; + return e10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof e5a ? Bj(this.X, a10.X) ? this.we === a10.we : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = ac(new M6().W(this.X), "example"), b10 = ac(new M6().W(this.X), "examples"); + if (a10 instanceof z7) { + var c10 = a10.i; + if (y7() === b10) { + ii(); + a10 = c10.i; + b10 = Apa(Cpa(), a10); + c10 = this.we; + J5(K7(), H10()); + b10 = Ai(b10, c10); + a10 = [i42(j42(new k42(), a10, b10, b5a(), this.m))]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + } + if (y7() === a10 && b10 instanceof z7) + return c5a(b10.i, this.we, this.m).Vg(); + if (a10 instanceof z7 && b10 instanceof z7) { + a10 = this.m; + b10 = sg().ZM; + c10 = this.we; + var e10 = this.X, f10 = y7(); + ec( + a10, + b10, + c10, + f10, + "Properties 'example' and 'examples' are exclusive and cannot be declared together", + e10.da + ); + } + return H10(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasExamplesParser", { tRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function l42() { + this.m = this.yb = this.X = null; + } + l42.prototype = new u7(); + l42.prototype.constructor = l42; + d7 = l42.prototype; + d7.H = function() { + return "OasHeaderParametersParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l42 && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Hw = function(a10, b10, c10) { + this.X = a10; + this.yb = b10; + this.m = c10; + return this; + }; + d7.Vg = function() { + var a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = f10.i, h10 = qc(); + return new m42().Hw(N6(g10, h10, e10.m), w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = Od(O7(), l10); + Db(m10, p10); + p10 = cj().R; + var t10 = new Qg().Vb(l10.Aa, k10.m).nf(); + Vd(m10, p10, t10); + k10.yb.P(m10); + }; + }(e10, f10)), e10.m).SB(); + }; + }(this)), c10 = rw(); + return a10.ka(b10, c10.sc); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasHeaderParametersParser", { wRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function n42() { + this.N = this.Q = this.ip = this.p = this.zh = this.la = null; + } + n42.prototype = new u7(); + n42.prototype.constructor = n42; + function g5a(a10, b10, c10, e10, f10, g10, h10) { + a10.la = b10; + a10.zh = c10; + a10.p = e10; + a10.ip = f10; + a10.Q = g10; + a10.N = h10; + return a10; + } + d7 = n42.prototype; + d7.H = function() { + return "OasParametersEmitter"; + }; + d7.E = function() { + return 5; + }; + function h5a(a10) { + var b10 = K7(); + a10 = [i5a(a10, a10.zh, a10.Q)]; + return J5(b10, new Ib().ha(a10)); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n42) { + if (this.la === a10.la) { + var b10 = this.zh, c10 = a10.zh; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 && this.p === a10.p ? (b10 = this.ip, c10 = a10.ip, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.zh; + case 2: + return this.p; + case 3: + return this.ip; + case 4: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function j5a(a10) { + var b10 = J5(Ef(), H10()), c10 = a10.zh.Dm(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = f10.N.Gg(); + Xq().Cp === h10 ? (h10 = B6(g10.g, cj().We), xb(h10, "query") ? h10 = true : (h10 = B6(g10.g, cj().We), h10 = xb(h10, "header")), h10 ? h10 = true : (h10 = B6(g10.g, cj().We), h10 = xb(h10, "path")), h10 ? g10 = true : (g10 = B6(g10.g, cj().We), g10 = xb(g10, "cookie"))) : g10 = Vb().Ia(B6(g10.g, cj().Jc)).b() || B6(g10.g, cj().Jc) instanceof Mh || B6(g10.g, cj().Jc) instanceof th || B6(g10.g, cj().Jc) instanceof Wh; + return g10; + }; + }(a10))); + if (null === c10) + throw new x7().d(c10); + var e10 = c10.ma(); + c10 = c10.ya(); + (e10.Da() || a10.ip.Da()) && Dg(b10, i5a(a10, e10, a10.Q)); + c10.Da() && (e10 = c10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, cj().We); + return xb(f10, "path"); + }; + }(a10))), e10.Da() && Dg(b10, k5a(new o42(), a10, jx(new je4().e("uriParameters")), e10))); + return b10; + } + d7.Pa = function() { + var a10 = J5(Ef(), H10()), b10 = this.zh.Dm(w6(/* @__PURE__ */ function() { + return function(f10) { + return Vb().Ia(B6(f10.g, cj().Jc)).b() || B6(f10.g, cj().Jc) instanceof Mh || B6(f10.g, cj().Jc) instanceof th || B6(f10.g, cj().Jc) instanceof Wh; + }; + }(this))); + if (null === b10) + throw new x7().d(b10); + var c10 = b10.ma(); + b10 = b10.ya(); + (c10.Da() || this.ip.Da()) && Dg(a10, i5a(this, c10, this.Q)); + if (b10.Da()) { + c10 = b10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, cj().We); + return xb(f10, "query"); + }; + }(this))); + var e10 = b10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, cj().We); + return xb(f10, "header"); + }; + }(this))); + b10 = b10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, cj().We); + return xb(f10, "path"); + }; + }(this))); + c10.Da() && Dg(a10, k5a(new o42(), this, jx(new je4().e("queryParameters")), c10)); + e10.Da() && Dg(a10, k5a(new o42(), this, jx(new je4().e("headers")), e10)); + b10.Da() && Dg(a10, k5a(new o42(), this, jx(new je4().e("baseUriParameters")), b10)); + } + return a10; + }; + function l5a(a10, b10, c10, e10) { + var f10 = J5(Ef(), H10()); + b10.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + return Dg(h10, m5a(m10, k10, l10, false, g10.N)); + }; + }(a10, f10, c10, e10))); + a10.ip.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + return Dg(h10, new p42().pU(m10, k10, l10, g10.N)); + }; + }(a10, f10, c10, e10))); + return c10.zb(f10); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ERa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParametersEmitter", { ERa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function eQ() { + this.m = this.we = this.wb = null; + } + eQ.prototype = new u7(); + eQ.prototype.constructor = eQ; + d7 = eQ.prototype; + d7.H = function() { + return "OasParametersParser"; + }; + function BGa(a10, b10, c10, e10) { + a10.wb = b10; + a10.we = c10; + a10.m = e10; + return a10; + } + d7.E = function() { + return 2; + }; + function n5a(a10, b10) { + if (b10.b()) + return y7(); + O7(); + var c10 = new P6().a(); + c10 = new Hh().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + c10 = Sd(c10, "formData", e10); + e10 = a10.we; + var f10 = J5(K7(), H10()); + c10 = o5a(c10, e10, f10); + b10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (Za(k10).na()) { + var l10 = J5(K7(), H10()); + l10 = Az(k10, l10); + } else + l10 = k10; + k10 = B6(l10.g, xm().R).A; + k10 = p5a(h10, k10.b() ? null : k10.c()); + var m10 = false, p10 = null, t10 = Ab(l10.x, q5(q5a)); + a: + if (y7() === t10) { + var v10 = Qi().ji; + es(k10, v10, 0); + } else { + if (t10 instanceof z7 && (m10 = true, p10 = t10, v10 = p10.i, !v10.$L)) { + m10 = Qi().ji; + v10 = ih(new jh(), 0, (O7(), new P6().a()).Lb(new be4().jj(v10.yc)).Lb(new xi().a())); + Vd(k10, m10, v10); + break a; + } + if (m10) + m10 = p10.i, v10 = Qi().ji, m10 = ih(new jh(), 1, (O7(), new P6().a()).Lb(new be4().jj(m10.yc)).Lb(new xi().a())), Vd(k10, v10, m10); + else + throw new x7().d(t10); + } + l10 = Vb().Ia(B6(l10.g, xm().Jc)); + l10.b() || (l10 = l10.c(), v10 = Qi().Vf, l10 = Vd(k10, v10, l10), k10 = k10.j, v10 = J5(K7(), H10()), r5a(l10, k10, v10)); + }; + }(a10, c10))); + O7(); + b10 = new P6().a(); + b10 = new ym().K(new S6().a(), b10); + O7(); + e10 = new P6().a(); + b10 = Sd(b10, "formData", e10); + a10 = a10.we; + J5(K7(), H10()); + a10 = Ai(b10, a10); + b10 = xm().Jc; + a10 = Vd(a10, b10, c10); + c10 = new y22().a(); + return new z7().d(Cb(a10, c10)); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof eQ) { + var b10 = this.wb, c10 = a10.wb; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.we === a10.we : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wb; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + function s5a(a10, b10) { + var c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = g10.Fe; + if (h10 instanceof ve4) { + h10 = h10.i; + var k10 = J5(K7(), H10()); + h10 = Az(h10, k10); + k10 = Vb(); + var l10 = B6(h10.g, cj().gw).A; + k10 = k10.Ia(l10.b() ? null : l10.c()); + k10.b() ? g10 = y7() : (k10 = k10.c(), l10 = Vb(), h10 = B6(h10.g, cj().We).A, h10 = l10.Ia(h10.b() ? null : h10.c()), h10.b() ? g10 = y7() : (h10 = h10.c(), g10 = new z7().d(t5a(f10, g10, k10, h10)))); + return g10.ua(); + } + if (h10 instanceof ye4) + return h10 = h10.i, k10 = J5(K7(), H10()), h10 = Az(h10, k10), k10 = h10.g, l10 = xm().R, k10 = k10.vb.Ja(l10), k10.b() ? k10 = y7() : (k10 = Ab(k10.c().x, q5(u5a)), k10.b() ? k10 = y7() : (k10 = k10.c(), k10 = new z7().d(k10.KL))), k10.b() ? (h10 = B6(h10.g, xm().R).A, h10 = h10.b() ? null : h10.c()) : h10 = k10.c(), new z7().d(t5a(f10, g10, h10, g10.OU ? "formData" : "body")).ua(); + throw new x7().d(h10); + }; + }(a10)), e10 = K7(); + b10 = b10.bd(c10, e10.u).am(w6(/* @__PURE__ */ function() { + return function(f10) { + if (null !== f10) + return new R6().M(f10.$, f10.TN); + throw new x7().d(f10); + }; + }(a10))); + for (b10 = new Fc().Vd(b10).Sb.Ye(); b10.Ya(); ) + c10 = b10.$a(), 1 < c10.Oa() && c10.ta().U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.sV, k10 = g10.$; + g10 = g10.TN; + var l10 = h10.ad; + if (l10 instanceof z7) { + l10 = l10.i; + var m10 = f10.m, p10 = sg().QX; + h10 = h10.yr.j; + k10 = "Parameter " + k10 + " of type " + g10 + " was found duplicated"; + g10 = y7(); + ec(m10, p10, h10, g10, k10, l10.da); + } else { + if (y7() !== l10) + throw new x7().d(l10); + l10 = f10.m; + m10 = sg().QX; + h10 = h10.yr.j; + k10 = "Parameter " + k10 + " of type " + g10 + " was found duplicated"; + g10 = y7(); + p10 = y7(); + var t10 = y7(); + l10.Gc(m10.j, h10, g10, k10, p10, Yb().qb, t10); + } + } else + throw new x7().d(g10); + }; + }(a10))); + } + d7.t = function() { + return V5(W5(), this); + }; + function v5a(a10, b10) { + var c10 = sg().vZ; + 1 < b10.Oa() && b10.ta().U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = e10.m, k10 = g10.yr.j; + g10 = g10.ad.c(); + var l10 = y7(); + ec(h10, f10, k10, l10, "Cannot declare more than one body parameter for a request", g10.da); + }; + }(a10, c10))); + } + function CGa(a10, b10) { + var c10 = new Nd().a(), e10 = a10.wb; + c10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return p10.m.$h.HV((ue4(), new ye4().d(v10)), p10.we, y7(), t10).OL(); + }; + }(a10, c10)); + var f10 = K7(); + f10 = e10.ka(c10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return (p10.OU ? new zz().ln(p10.Fe).pk() : y7()).ua(); + }; + }(a10)); + c10 = K7(); + e10 = f10.bd(e10, c10.u); + c10 = f10.Cb(w6(/* @__PURE__ */ function() { + return function(p10) { + return p10.rma; + }; + }(a10))); + s5a(a10, f10); + if (b10) { + if (c10.Da() && e10.Da()) { + var g10 = c10.ga(); + b10 = a10.m; + var h10 = sg().tZ, k10 = g10.yr.j; + g10 = g10.ad.c(); + var l10 = y7(); + ec( + b10, + h10, + k10, + l10, + "Cannot declare body and formData params at the same time for a request", + g10.da + ); + } + v5a(a10, c10); + } + b10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.LL; + if (p10.b()) + var t10 = true; + else + t10 = B6(p10.c().g, cj().We), t10 = xb(t10, "query"); + return (t10 ? p10 : y7()).ua(); + }; + }(a10)); + h10 = K7(); + b10 = f10.bd(b10, h10.u); + h10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.LL; + if (p10.b()) + var t10 = true; + else { + t10 = p10.c(); + var v10 = B6(t10.g, cj().We); + xb(v10, "query") ? v10 = false : (v10 = B6(t10.g, cj().We), v10 = !xb(v10, "header")); + v10 ? (v10 = B6(t10.g, cj().We), v10 = !xb(v10, "path")) : v10 = false; + v10 ? (t10 = B6(t10.g, cj().We), t10 = !xb(t10, "cookie")) : t10 = false; + } + return (t10 ? p10 : y7()).ua(); + }; + }(a10)); + k10 = K7(); + h10 = f10.bd(h10, k10.u); + k10 = K7(); + b10 = b10.ia(h10, k10.u); + h10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.LL; + if (p10.b()) + var t10 = true; + else + t10 = B6(p10.c().g, cj().We), t10 = xb(t10, "path"); + return (t10 ? p10 : y7()).ua(); + }; + }(a10)); + k10 = K7(); + h10 = f10.bd(h10, k10.u); + k10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.LL; + if (p10.b()) + var t10 = true; + else + t10 = B6(p10.c().g, cj().We), t10 = xb(t10, "header"); + return (t10 ? p10 : y7()).ua(); + }; + }(a10)); + g10 = K7(); + k10 = f10.bd(k10, g10.u); + g10 = w6(/* @__PURE__ */ function() { + return function(p10) { + p10 = p10.LL; + if (p10.b()) + var t10 = true; + else + t10 = B6(p10.c().g, cj().We), t10 = xb(t10, "cookie"); + return (t10 ? p10 : y7()).ua(); + }; + }(a10)); + l10 = K7(); + f10 = f10.bd(g10, l10.u); + g10 = H10(); + l10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return (p10.OU ? y7() : new zz().ln(p10.Fe).pk()).ua(); + }; + }(a10)); + var m10 = K7(); + c10 = c10.bd(l10, m10.u); + a10 = n5a(a10, e10).ua(); + e10 = K7(); + return bQ(new cQ(), b10, h10, k10, f10, g10, c10.ia(a10, e10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ HRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParametersParser", { HRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function w5a() { + this.l = this.TN = this.$ = this.sV = null; + } + w5a.prototype = new u7(); + w5a.prototype.constructor = w5a; + d7 = w5a.prototype; + d7.H = function() { + return "ParameterInformation"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof w5a && a10.l === this.l ? this.sV === a10.sV && this.$ === a10.$ ? this.TN === a10.TN : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.sV; + case 1: + return this.$; + case 2: + return this.TN; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function t5a(a10, b10, c10, e10) { + var f10 = new w5a(); + f10.sV = b10; + f10.$ = c10; + f10.TN = e10; + if (null === a10) + throw mb(E6(), null); + f10.l = a10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ IRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParametersParser$ParameterInformation", { IRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function LX() { + this.yH = this.uo = null; + } + LX.prototype = new u7(); + LX.prototype.constructor = LX; + d7 = LX.prototype; + d7.H = function() { + return "OasPayloads"; + }; + d7.E = function() { + return 2; + }; + d7.WO = function(a10, b10) { + this.uo = a10; + this.yH = b10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof LX) { + var b10 = this.uo, c10 = a10.uo; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.yH, a10 = a10.yH, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uo; + case 1: + return this.yH; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ LRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasPayloads", { LRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function x5a() { + this.m = this.HM = null; + } + x5a.prototype = new u7(); + x5a.prototype.constructor = x5a; + d7 = x5a.prototype; + d7.H = function() { + return "OasResponseExampleParser"; + }; + d7.Xw = function() { + var a10 = Apa(Cpa(), this.HM), b10 = ag().Nd, c10 = this.HM.Aa, e10 = bc(); + c10 = N6(c10, e10, this.m).va; + a10 = eb(a10, b10, c10); + return i42(j42(new k42(), this.HM.i, a10, new EP().GB(false, true, false), this.m)); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof x5a ? this.HM === a10.HM : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.HM; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.p1 = function(a10, b10) { + this.HM = a10; + this.m = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExampleParser", { QRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function nQ() { + this.m = this.tb = null; + } + nQ.prototype = new u7(); + nQ.prototype.constructor = nQ; + d7 = nQ.prototype; + d7.H = function() { + return "OasResponseExamplesParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof nQ ? this.tb === a10.tb : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = J5(Ef(), H10()), b10 = this.tb.i, c10 = qc(); + b10 = N6(b10, c10, this.m); + b10 = wt(new M6().W(b10), ".*/.*"); + c10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return Dg(g10, new x5a().p1(h10, f10.m).Xw()); + }; + }(this, a10)); + var e10 = Xd(); + b10.ka(c10, e10.u); + return a10; + }; + d7.p1 = function(a10, b10) { + this.tb = a10; + this.m = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ URa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExamplesParser", { URa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vz() { + this.m = this.ai = this.xb = this.Ca = null; + } + Vz.prototype = new u7(); + Vz.prototype.constructor = Vz; + d7 = Vz.prototype; + d7.H = function() { + return "OasSecurityRequirementParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vz) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.ai === a10.ai : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.xb; + case 2: + return this.ai; + default: + throw new U6().e("" + a10); + } + }; + function lna(a10, b10, c10, e10, f10) { + a10.Ca = b10; + a10.xb = c10; + a10.ai = e10; + a10.m = f10; + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = false, b10 = null, c10 = this.Ca, e10 = qc(); + c10 = Iw(c10, e10); + if (c10 instanceof ye4 && (a10 = true, b10 = c10, c10 = b10.i, tc(c10.sb))) + return a10 = this.xb.P(this.ai.jt("requirement")), b10 = Od(O7(), this.Ca), a10 = Db(a10, b10), c10.sb.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return y5a(new z5a(), h10, l10, w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return A5a(p10, t10); + }; + }(h10, k10))).Cc(); + }; + }(this, a10))), new z7().d(a10); + if (a10 && b10.i.sb.b()) + return y7(); + c10 = this.xb.P(this.Ca.t()); + a10 = this.m; + b10 = sg().dga; + c10 = c10.j; + e10 = "Invalid security requirement " + this.Ca; + var f10 = this.Ca, g10 = y7(); + ec(a10, b10, c10, g10, e10, f10.da); + return y7(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ XRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasSecurityRequirementParser", { XRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function z5a() { + this.l = this.xb = this.cC = null; + } + z5a.prototype = new u7(); + z5a.prototype.constructor = z5a; + function y5a(a10, b10, c10, e10) { + a10.cC = c10; + a10.xb = e10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7 = z5a.prototype; + d7.H = function() { + return "OasParametrizedSecuritySchemeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof z5a && a10.l === this.l && this.cC === a10.cC) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cC; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.cC.Aa, b10 = IO(); + b10 = N6(a10, b10, this.l.m).va; + a10 = this.xb.P(b10); + var c10 = Od(O7(), this.cC); + a10 = Db(a10, c10); + b10 = B5a(this, b10, a10, this.cC); + c10 = Za(b10); + if (c10 instanceof z7) + b10 = c10.i; + else if (y7() !== c10) + throw new x7().d(c10); + c10 = B6(b10.g, Xh().Hf); + if (xb(c10, "OAuth 2.0")) { + O7(); + c10 = new P6().a(); + c10 = new wE().K(new S6().a(), c10); + var e10 = a10.j; + J5(K7(), H10()); + c10 = Ai(c10, e10); + e10 = this.cC.i; + var f10 = lc(); + e10 = N6(e10, f10, this.l.m); + f10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = ySa(ASa(), m10), t10 = Gm().R, v10 = Dd(); + v10 = ih(new jh(), N6(m10, v10, l10.l.m), new P6().a()); + m10 = Od(O7(), m10); + return Rg(p10, t10, v10, m10); + }; + }(this)); + var g10 = K7(); + f10 = e10.ka(f10, g10.u); + e10 = K7(); + g10 = oHa(c10); + var h10 = Jm().lo, k10 = Od(O7(), this.cC.i); + f10 = [bs(g10, h10, f10, k10)]; + f10 = J5(e10, new Ib().ha(f10)); + e10 = im().Oh; + g10 = xE().Ap; + c10 = Zd(c10, g10, f10); + Vd(a10, e10, c10); + } + C5a(this, a10, b10, this.cC); + return new z7().d(a10); + }; + function C5a(a10, b10, c10, e10) { + var f10 = B6(c10.g, Xh().Hf); + if (xb(f10, "OAuth 2.0")) { + O7(); + c10 = new P6().a(); + c10 = new wE().K(new S6().a(), c10); + f10 = b10.j; + J5(K7(), H10()); + c10 = Ai(c10, f10); + f10 = e10.i; + var g10 = lc(); + f10 = N6(f10, g10, a10.l.m); + a10 = w6(/* @__PURE__ */ function(k10) { + return function(l10) { + var m10 = ySa(ASa(), l10), p10 = Gm().R, t10 = Dd(); + t10 = ih(new jh(), N6(l10, t10, k10.l.m), new P6().a()); + l10 = Od(O7(), l10); + return Rg(m10, p10, t10, l10); + }; + }(a10)); + g10 = K7(); + f10 = f10.ka(a10, g10.u); + a10 = K7(); + g10 = oHa(c10); + var h10 = Jm().lo; + e10 = Od(O7(), e10.i); + e10 = [bs(g10, h10, f10, e10)]; + a10 = J5(a10, new Ib().ha(e10)); + e10 = im().Oh; + f10 = xE().Ap; + a10 = Zd(c10, f10, a10); + Vd(b10, e10, a10); + } else if (f10 = B6(c10.g, Xh().Hf), xb(f10, "openIdConnect")) + O7(), c10 = new P6().a(), c10 = new uE().K(new S6().a(), c10), f10 = b10.j, J5(K7(), H10()), c10 = Ai(c10, f10), f10 = e10.i, g10 = lc(), f10 = N6(f10, g10, a10.l.m), a10 = w6(/* @__PURE__ */ function(k10) { + return function(l10) { + var m10 = ySa(ASa(), l10), p10 = Gm().R, t10 = Dd(); + t10 = ih(new jh(), N6(l10, t10, k10.l.m), new P6().a()); + l10 = Od(O7(), l10); + return Rg(m10, p10, t10, l10); + }; + }(a10)), g10 = K7(), f10 = f10.ka(a10, g10.u), a10 = im().Oh, g10 = vE().lo, e10 = Od(O7(), e10.i), e10 = bs(c10, g10, f10, e10), Vd(b10, a10, e10); + else if (f10 = e10.i.hb().gb, Q5().cd === f10 ? (e10 = e10.i, f10 = lc(), e10 = N6(e10, f10, a10.l.m).Da()) : e10 = false, e10) { + e10 = B6(c10.g, Xh().Hf).A; + if (e10 instanceof z7) + e10 = "Scopes array must be empty for security scheme type " + e10.i; + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = "Scopes array must be empty for given security scheme"; + } + c10 = a10.l.m; + f10 = sg().$7; + b10 = b10.j; + a10 = a10.l.Ca; + g10 = y7(); + ec(c10, f10, b10, g10, e10, a10.da); + } + } + d7.z = function() { + return X5(this); + }; + function B5a(a10, b10, c10, e10) { + var f10 = lP(a10.l.m.Qh, b10, Xs()); + if (f10 instanceof z7) + return e10 = f10.i, b10 = im().Eq, Vd(c10, b10, e10), e10; + if (y7() === f10) { + O7(); + f10 = new P6().a(); + var g10 = new S6().a(); + f10 = new vm().K(g10, f10); + g10 = im().Eq; + Vd(c10, g10, f10); + c10 = a10.l.m; + a10 = dc().UC; + g10 = f10.j; + b10 = "Security scheme '" + b10 + "' not found in declarations."; + var h10 = y7(); + ec(c10, a10, g10, h10, b10, e10.da); + return f10; + } + throw new x7().d(f10); + } + d7.$classData = r8({ YRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasSecurityRequirementParser$OasParametrizedSecuritySchemeParser", { YRa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function cQ() { + this.pw = this.lB = this.Mx = this.Xg = this.ah = this.qt = null; + } + cQ.prototype = new u7(); + cQ.prototype.constructor = cQ; + d7 = cQ.prototype; + d7.H = function() { + return "Parameters"; + }; + function D5a(a10, b10, c10) { + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = B6(g10.g, cj().R).A; + h10 = h10.b() ? null : h10.c(); + return new R6().M(h10, g10); + }; + }(a10)), f10 = K7(); + b10 = b10.ka(e10, f10.u).Ch(Gb().si); + a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = B6(g10.g, cj().R).A; + h10 = h10.b() ? null : h10.c(); + return new R6().M(h10, g10); + }; + }(a10)); + e10 = K7(); + c10 = c10.ka(a10, e10.u).Ch(Gb().si); + c10 = b10.uq(c10); + return new Fc().Vd(c10).Sb.Ye().Dd(); + } + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof cQ) { + var b10 = this.qt, c10 = a10.qt; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.ah, c10 = a10.ah, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Xg, c10 = a10.Xg, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Mx, c10 = a10.Mx, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.lB, c10 = a10.lB, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.pw, a10 = a10.pw, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.qt; + case 1: + return this.ah; + case 2: + return this.Xg; + case 3: + return this.Mx; + case 4: + return this.lB; + case 5: + return this.pw; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function DIa(a10, b10) { + var c10 = E5a(a10, a10.qt, b10.qt), e10 = E5a(a10, a10.ah, b10.ah), f10 = E5a(a10, a10.Xg, b10.Xg), g10 = E5a(a10, a10.Mx, b10.Mx); + a10 = E5a(a10, a10.lB, b10.lB); + return bQ(new cQ(), c10, e10, f10, g10, a10, b10.pw); + } + function bQ(a10, b10, c10, e10, f10, g10, h10) { + a10.qt = b10; + a10.ah = c10; + a10.Xg = e10; + a10.Mx = f10; + a10.lB = g10; + a10.pw = h10; + return a10; + } + function dQ(a10, b10) { + var c10 = D5a(a10, a10.qt, b10.qt), e10 = D5a(a10, a10.ah, b10.ah), f10 = D5a(a10, a10.Xg, b10.Xg), g10 = D5a(a10, a10.Mx, b10.Mx), h10 = D5a(a10, a10.lB, b10.lB); + a10 = a10.pw; + b10 = b10.pw; + var k10 = K7(); + return bQ(new cQ(), c10, e10, f10, g10, h10, a10.ia(b10, k10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.Da = function() { + return this.qt.Da() || this.ah.Da() || this.Xg.Da() || this.pw.Da() || this.Mx.Da(); + }; + function E5a(a10, b10, c10) { + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = B6(g10.g, cj().R).A; + h10 = h10.b() ? null : h10.c(); + return new R6().M(h10, g10); + }; + }(a10)), f10 = K7(); + b10 = b10.ka(e10, f10.u).Ch(Gb().si); + a10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = B6(g10.g, cj().R).A; + h10 = h10.b() ? null : h10.c(); + return new R6().M(h10, g10); + }; + }(a10)); + e10 = K7(); + c10 = c10.ka(a10, e10.u).Ch(Gb().si); + c10 = b10.uq(c10); + return new Fc().Vd(c10).Sb.Ye().Dd(); + } + d7.$classData = r8({ gSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Parameters", { gSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Uz() { + this.m = this.Ph = this.xb = this.Ca = null; + } + Uz.prototype = new u7(); + Uz.prototype.constructor = Uz; + d7 = Uz.prototype; + d7.H = function() { + return "ParametrizedDeclarationParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Uz) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Ph === a10.Ph : false; + } + return false; + }; + function F5a(a10, b10) { + var c10 = a10.m.hp(b10); + if (c10 instanceof ve4) { + c10 = c10.i; + var e10 = a10.xb.P(c10); + b10 = Rs(O7(), b10); + b10 = Db(e10, b10); + e10 = FY().te; + a10 = a10.Ph.ug(c10, Ys()); + O7(); + var f10 = new P6().a(); + a10 = kM(a10, c10, f10); + return Vd(b10, e10, a10); + } + if (c10 instanceof ye4) { + c10 = c10.i; + e10 = bc(); + f10 = N6(c10, e10, a10.m).va; + e10 = a10.Ph.ug(f10, Xs()); + O7(); + var g10 = new P6().a(); + e10 = kM(e10, f10, g10); + a10 = a10.xb.P(f10); + G5a(a10, f10, c10); + b10 = Rs(O7(), b10); + a10 = Db(a10, b10); + b10 = FY().te; + return Vd(a10, b10, e10); + } + throw new x7().d(c10); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.xb; + case 2: + return this.Ph; + default: + throw new U6().e("" + a10); + } + }; + function G5a(a10, b10, c10) { + var e10 = FY().R; + b10 = ih(new jh(), b10, new P6().a()); + c10 = Od(O7(), c10); + Rg(a10, e10, b10, c10); + } + d7.t = function() { + return V5(W5(), this); + }; + function jna(a10, b10, c10, e10, f10) { + a10.Ca = b10; + a10.xb = c10; + a10.Ph = e10; + a10.m = f10; + return a10; + } + function ina(a10) { + var b10 = jc(kc(a10.Ca), qc()); + b10 = b10.b() ? y7() : b10.c().sb.kc(); + if (b10 instanceof z7) { + var c10 = b10.i; + b10 = c10.i.hb().gb; + if (Q5().nd === b10) + return F5a(a10, c10.Aa); + b10 = c10.Aa; + var e10 = bc(); + e10 = N6(b10, e10, a10.m).va; + b10 = a10.xb.P(e10); + var f10 = Rs(O7(), a10.Ca); + b10 = Db(b10, f10); + G5a(b10, e10, c10.Aa); + Ui(b10.Y(), FY().te, a10.Ph.ug(e10, Zs()), (O7(), new P6().a())); + c10 = c10.i; + e10 = qc(); + c10 = N6(c10, e10, a10.m).sb; + e10 = rw(); + c10 = c10.og(e10.sc); + a10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(), p10 = l10.Ki(); + l10 = m10.i; + p10 = new z7().d(k10.j + "_" + p10); + var t10 = new ox().a(), v10 = new Nd().a(); + l10 = px(l10, t10, p10, v10, h10.m).Fr(); + TLa || (TLa = new yU().a()); + p10 = Od(O7(), m10); + p10 = new hl().K(new S6().a(), p10); + m10 = m10.Aa; + t10 = bc(); + m10 = N6(m10, t10, h10.m).va; + t10 = gl().R; + m10 = eb(p10, t10, m10); + p10 = gl().vf; + return Vd(m10, p10, l10); + } + throw new x7().d(l10); + }; + }(a10, b10)); + e10 = rw(); + a10 = c10.ka(a10, e10.sc); + c10 = FY().Aj; + return Zd(b10, c10, a10); + } + b10 = a10.Ca.hb().gb; + c10 = Q5().Na; + if (b10 === c10) + return F5a(a10, a10.Ca); + b10 = a10.xb.P(""); + c10 = a10.m; + e10 = sg().GR; + f10 = b10.j; + a10 = a10.Ca; + var g10 = y7(); + ec(c10, e10, f10, g10, "Invalid model extension.", a10.da); + return b10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ iSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ParametrizedDeclarationParser", { iSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function H5a() { + this.Dea = this.Iia = this.p = this.le = null; + } + H5a.prototype = new u7(); + H5a.prototype.constructor = H5a; + d7 = H5a.prototype; + d7.H = function() { + return "Raml08PayloadEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof H5a) { + var b10 = this.le, c10 = a10.le; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.le; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = hd(this.le.g, xm().Nd); + if (a10 instanceof z7) { + a10 = K7(); + var b10 = [new RX().naa(this)]; + return J5(a10, new Ib().ha(b10)); + } + if (y7() === a10) + return this.Dea; + throw new x7().d(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadEmitter", { tSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function I5a() { + this.m = this.we = this.X = null; + } + I5a.prototype = new u7(); + I5a.prototype.constructor = I5a; + d7 = I5a.prototype; + d7.H = function() { + return "Raml08WebFormParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof I5a ? Bj(this.X, a10.X) ? this.we === a10.we : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function J5a(a10, b10, c10, e10) { + a10.X = b10; + a10.we = c10; + a10.m = e10; + return a10; + } + d7.Cc = function() { + var a10 = ac(new M6().W(this.X), "formParameters"); + if (a10.b()) + return y7(); + var b10 = a10.c(); + a10 = b10.i; + var c10 = qc(); + a10 = N6(a10, c10, this.m).sb; + c10 = a10.kc(); + if (c10.b()) + return y7(); + c10.c(); + b10 = yRa(ARa(), b10.i); + O7(); + c10 = new P6().a(); + b10 = Sd(b10, "schema", c10); + c10 = this.we; + var e10 = J5(K7(), H10()); + b10 = o5a(b10, c10, e10); + a10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = wW(xW(), h10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return D10.ub(A10.j, lt2()); + }; + }(f10, g10)), false, QP(), f10.m).Cc(); + if (!k10.b()) { + var l10 = k10.c(); + k10 = p5a(g10, h10.Aa.t()); + var m10 = Qi().ji; + es(k10, m10, 0); + m10 = h10.i; + var p10 = qc(); + m10 = m10.Qp(p10).pk(); + if (m10 instanceof z7 && (m10 = ac(new M6().W(m10.i), "required"), !m10.b())) { + p10 = m10.c(); + var t10 = !!new Qg().Vb(p10.i, f10.m).Up().r; + m10 = Qi().ji; + t10 = ih(new jh(), t10 ? 1 : 0, new P6().a()); + p10 = Od(O7(), p10).Lb(new xi().a()); + Rg(k10, m10, t10, p10); + } + h10 = Od(O7(), h10); + h10 = Db(k10, h10); + m10 = Qi().Vf; + l10 = Vd(h10, m10, l10); + k10 = k10.j; + h10 = J5(K7(), H10()); + r5a(l10, k10, h10); + } + }; + }(this, b10))); + a10 = Ih().Cn; + Bi(b10, a10, true); + return new z7().d(b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ESa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08WebFormParser", { ESa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function K5a() { + this.N = this.Q = this.p = this.le = null; + } + K5a.prototype = new u7(); + K5a.prototype.constructor = K5a; + d7 = K5a.prototype; + d7.H = function() { + return "Raml10Payloads"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof K5a) { + var b10 = this.le, c10 = a10.le; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.le; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + if (hd(this.le.g, xm().Nd).na()) + return J5(K7(), new Ib().ha([new L5a().yaa(this.le, this.p, this.Q, this.N)])); + var a10 = false, b10 = null, c10 = Vb().Ia(B6(this.le.g, xm().Jc)); + if (c10 instanceof z7 && (a10 = true, b10 = c10, c10 = b10.i, c10 instanceof vh)) { + a10 = this.p; + b10 = this.Q; + var e10 = H10(); + return Q32(c10, a10, e10, b10, this.N).Pa(); + } + if (a10) { + b10 = b10.i; + c10 = this.N.Bc; + a10 = dc().Fh; + b10 = b10.j; + e10 = y7(); + var f10 = Ab(this.le.x, q5(jd)), g10 = yb(this.le); + c10.Gc(a10.j, b10, e10, "Cannot emit a non WebAPI shape", f10, Yb().qb, g10); + } + return H10(); + }; + d7.z = function() { + return X5(this); + }; + d7.yaa = function(a10, b10, c10, e10) { + this.le = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.$classData = r8({ MSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10Payloads", { MSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function k42() { + this.m = this.wc = this.Kd = this.Ca = null; + } + k42.prototype = new u7(); + k42.prototype.constructor = k42; + d7 = k42.prototype; + d7.H = function() { + return "RamlExampleValueAsString"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k42) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.Kd, c10 = a10.Kd; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.Kd; + case 2: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function i42(a10) { + if (hd(a10.Kd.g, ag().Fq).b()) { + var b10 = a10.Kd, c10 = ag().Fq, e10 = ih(new jh(), a10.wc.$H, new P6().a()), f10 = (O7(), new P6().a()).Lb(new Xz().a()); + Rg(b10, c10, e10, f10); + } + b10 = a10.Ca; + if (b10 instanceof uG) { + c10 = a10.m.Dl().ij.Ja(b10.DV.va); + if (!c10.b()) { + c10 = c10.c(); + e10 = a10.Kd; + f10 = c10.ww.j; + var g10 = Zf().xj; + eb(e10, g10, f10); + e10 = a10.Kd; + f10 = Zf().uc; + c10 = c10.da; + c10 = c10.b() ? a10.m.qh : c10.c(); + eb(e10, f10, c10); + } + b10 = b10.Gv; + b10 = b10.b() ? a10.Ca : b10.c(); + c10 = true; + } else + b10 = a10.Ca, c10 = false; + c10 = !!c10; + e10 = false; + f10 = null; + g10 = jc(kc(a10.Ca), bc()); + a: { + if (g10 instanceof z7) { + e10 = true; + f10 = g10; + g10 = a10.Ca.hb().gb; + var h10 = Q5().nd; + if (g10 === h10) { + e10 = a10.Kd; + f10 = ag().Rd; + g10 = ih( + new jh(), + "null", + Rs(O7(), a10.Ca) + ); + h10 = Rs(O7(), a10.Ca); + Rg(e10, f10, g10, h10); + break a; + } + } + e10 ? (g10 = f10.i, e10 = a10.Kd, f10 = ag().Rd, g10 = ih(new jh(), g10.va, Rs(O7(), a10.Ca)), h10 = Rs(O7(), a10.Ca), Rg(e10, f10, g10, h10)) : (e10 = a10.Kd, f10 = ag().Rd, Oca(), g10 = ih(new jh(), Nca(0, b10), Rs(O7(), a10.Ca)), h10 = Rs(O7(), a10.Ca), Rg(e10, f10, g10, h10)); + } + b10 = Ey(Fy(b10, a10.Kd.j, a10.wc.xv, c10, a10.wc.Ow, a10.m)).Cl; + b10.b() || (b10 = b10.c(), c10 = a10.Kd, e10 = ag().mo, f10 = Od(O7(), a10.Ca), Rg(c10, e10, b10, f10)); + return a10.Kd; + } + function j42(a10, b10, c10, e10, f10) { + a10.Ca = b10; + a10.Kd = c10; + a10.wc = e10; + a10.m = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ VSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlExampleValueAsString", { VSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function tg() { + this.m = this.wc = this.xb = this.we = this.zL = this.lM = this.X = null; + } + tg.prototype = new u7(); + tg.prototype.constructor = tg; + d7 = tg.prototype; + d7.H = function() { + return "RamlExamplesParser"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tg) { + if (Bj(this.X, a10.X) && this.lM === a10.lM && this.zL === a10.zL) { + var b10 = this.we, c10 = a10.we; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.xb, c10 = a10.xb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function eca(a10, b10, c10, e10, f10, g10, h10) { + a10.X = b10; + a10.lM = "example"; + a10.zL = c10; + a10.we = e10; + a10.xb = f10; + a10.wc = g10; + a10.m = h10; + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.lM; + case 2: + return this.zL; + case 3: + return this.we; + case 4: + return this.xb; + case 5: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + if (ac(new M6().W(this.X), this.lM).na() && ac(new M6().W(this.X), this.zL).na() && this.we.na()) { + var a10 = this.m, b10 = sg().ZM, c10 = this.we.c(), e10 = "Properties '" + this.lM + "' and '" + this.zL + "' are exclusive and cannot be declared together", f10 = this.X, g10 = y7(); + ec(a10, b10, c10, g10, e10, f10.da); + } + a10 = new M5a().zU(this.zL, this.X, this.xb, this.wc, this.m).Vg(); + b10 = new q42().zU(this.lM, this.X, this.xb, this.wc, this.m).Cc().ua(); + c10 = K7(); + return a10.ia(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlExamplesParser", { WSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function M5a() { + this.m = this.wc = this.xb = this.X = this.la = null; + } + M5a.prototype = new u7(); + M5a.prototype.constructor = M5a; + d7 = M5a.prototype; + d7.H = function() { + return "RamlMultipleExampleParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof M5a) { + if (this.la === a10.la && Bj(this.X, a10.X)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.X; + case 2: + return this.xb; + case 3: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = J5(Ef(), H10()), b10 = ac(new M6().W(this.X), this.la); + if (!b10.b()) { + b10 = b10.c(); + var c10 = this.m.hp(b10.i); + if (c10 instanceof ve4) { + c10 = c10.i; + b10 = uFa(this.m.Dl(), b10.i, c10); + O7(); + var e10 = new P6().a(); + Dg(a10, kM(b10, c10, e10)); + } else if (c10 instanceof ye4) + if (c10 = c10.i, e10 = c10.hb().gb, Q5().sa === e10) + b10 = qc(), b10 = N6(c10, b10, this.m).sb, c10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return N5a(k10, h10.xb, h10.wc, h10.m).Xw(); + }; + }(this)), e10 = rw(), ws(a10, b10.ka(c10, e10.sc)); + else { + if (Q5().nd !== e10) { + if (Q5().Na === e10) { + c10 = c10.t(); + if (null === c10) + throw new sf().a(); + tf(uf(), "<<.*>>", c10) ? (c10 = this.m.iv, e10 = iA().ho, c10 = !(null === c10 ? null === e10 : c10.h(e10))) : c10 = false; + } else + c10 = false; + if (!c10) { + c10 = this.m; + e10 = sg().J5; + var f10 = "Property '" + this.la + "' should be a map", g10 = y7(); + ec(c10, e10, "", g10, f10, b10.da); + } + } + } + else + throw new x7().d(c10); + } + return a10; + }; + d7.zU = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.X = b10; + this.xb = c10; + this.wc = e10; + this.m = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlMultipleExampleParser", { YSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function O5a() { + this.m = this.wc = this.xb = this.tb = null; + } + O5a.prototype = new u7(); + O5a.prototype.constructor = O5a; + d7 = O5a.prototype; + d7.Xw = function() { + var a10 = new Qg().Vb(this.tb.Aa, this.m), b10 = oq(/* @__PURE__ */ function(g10, h10) { + return function() { + return g10.xb.P(new z7().d(h10.Zf().t())); + }; + }(this, a10)), c10 = this.m.hp(this.tb.i); + if (c10 instanceof ve4) { + c10 = c10.i; + var e10 = sFa(this.m.Dl(), c10, y7()); + if (e10.b()) + c10 = y7(); + else { + e10 = e10.c(); + O7(); + var f10 = new P6().a(); + c10 = new z7().d(kM(e10, c10, f10)); + } + b10 = c10.b() ? P5a(this.tb, b10, this.wc, this.m).Xw() : c10.c(); + } else { + if (!(c10 instanceof ye4)) + throw new x7().d(c10); + b10 = P5a(this.tb, b10, this.wc, this.m).Xw(); + } + c10 = ag().R; + a10 = a10.Zf(); + e10 = Od(O7(), this.tb); + return Rg(b10, c10, a10, e10); + }; + d7.H = function() { + return "RamlNamedExampleParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof O5a) { + if (this.tb === a10.tb) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + case 2: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function N5a(a10, b10, c10, e10) { + var f10 = new O5a(); + f10.tb = a10; + f10.xb = b10; + f10.wc = c10; + f10.m = e10; + return f10; + } + d7.$classData = r8({ ZSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlNamedExampleParser", { ZSa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function U32() { + this.aq = this.X = null; + this.tn = false; + this.m = null; + } + U32.prototype = new u7(); + U32.prototype.constructor = U32; + function T32(a10, b10, c10, e10) { + a10.X = b10; + a10.aq = c10; + a10.tn = false; + a10.m = e10; + return a10; + } + d7 = U32.prototype; + d7.H = function() { + return "RamlParametersParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof U32) { + if (Bj(this.X, a10.X)) { + var b10 = this.aq, c10 = a10.aq; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.tn === a10.tn : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.aq; + case 2: + return this.tn; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return oy(e10.m.$h.a2(), f10, e10.aq, e10.tn).SB(); + }; + }(this)), c10 = rw(); + return a10.ka(b10, c10.sc); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.X)); + a10 = OJ().Ga(a10, NJ(OJ(), this.aq)); + a10 = OJ().Ga(a10, this.tn ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ fTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlParametersParser", { fTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Q5a() { + this.m = this.xb = this.Ca = null; + } + Q5a.prototype = new u7(); + Q5a.prototype.constructor = Q5a; + d7 = Q5a.prototype; + d7.H = function() { + return "RamlParametrizedSecuritySchemeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Q5a && Bj(this.Ca, a10.Ca)) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Faa = function(a10, b10, c10) { + this.Ca = a10; + this.xb = b10; + this.m = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + function R5a(a10) { + var b10 = a10.Ca.hb().gb; + if (Q5().nd === b10) + b10 = a10.xb.P("null"), a10 = Od(O7(), a10.Ca).Lb(new V1().a()), Db(b10, a10); + else if (Q5().sa === b10) { + b10 = a10.Ca; + var c10 = qc(); + c10 = N6(b10, c10, a10.m).sb.ga(); + b10 = c10.Aa; + var e10 = bc(); + e10 = N6(b10, e10, a10.m).va; + b10 = a10.xb.P(e10); + var f10 = Od(O7(), a10.Ca); + b10 = Db(b10, f10); + f10 = lP(a10.m.Dl(), e10, Zs()); + if (f10 instanceof z7) + e10 = f10.i, f10 = im().Eq, Vd(b10, f10, e10), c10 = c10.i, f10 = qc(), c10 = N6(c10, f10, a10.m), e10 = B6(e10.g, Xh().Hf).A, a10 = S5a(T5a(new r42(), c10, e10.b() ? null : e10.c(), b10, a10.m)), c10 = im().Oh, Vd(b10, c10, a10); + else if (y7() === f10) { + c10 = a10.m; + f10 = sg().jS; + b10 = b10.j; + e10 = "Security scheme '" + e10 + "' not found in declarations (and name cannot be 'null')."; + a10 = a10.Ca; + var g10 = y7(); + ec(c10, f10, b10, g10, e10, a10.da); + } else + throw new x7().d(f10); + } else if (Q5().wq === b10) + b10 = a10.m, c10 = sg().jS, e10 = a10.Ca, f10 = y7(), ec(b10, c10, "", f10, "'securedBy' property doesn't accept !include tag, only references to security schemes.", e10.da), b10 = a10.xb.P("invalid"), a10 = Od(O7(), a10.Ca), Db(b10, a10); + else if (b10 = a10.Ca, c10 = bc(), b10 = N6(b10, c10, a10.m).va, c10 = a10.xb.P(b10), e10 = Od(O7(), a10.Ca), f10 = Db(c10, e10), c10 = lP(a10.m.Dl(), b10, Zs()), c10 instanceof z7) + a10 = c10.i, Ui(f10.g, im().Eq, a10, (O7(), new P6().a())); + else if (y7() === c10) + c10 = a10.m, e10 = sg().jS, f10 = f10.j, b10 = "Security scheme '" + b10 + "' not found in declarations.", a10 = a10.Ca, g10 = y7(), ec(c10, e10, f10, g10, b10, a10.da); + else + throw new x7().d(c10); + } + d7.$classData = r8({ hTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlParametrizedSecuritySchemeParser", { hTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function U5a() { + this.m = this.ai = this.xb = this.Ca = null; + } + U5a.prototype = new u7(); + U5a.prototype.constructor = U5a; + function yGa(a10, b10, c10, e10) { + var f10 = new U5a(); + f10.Ca = a10; + f10.xb = b10; + f10.ai = c10; + f10.m = e10; + return f10; + } + d7 = U5a.prototype; + d7.H = function() { + return "RamlSecurityRequirementParser"; + }; + function xGa(a10) { + var b10 = a10.xb.P(a10.ai.jt("default-requirement")), c10 = Od(O7(), a10.Ca); + b10 = Db(b10, c10); + R5a(new Q5a().Faa(a10.Ca, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return A5a(f10, g10); + }; + }(a10, b10)), a10.m)); + return b10; + } + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof U5a) { + if (Bj(this.Ca, a10.Ca)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.ai === a10.ai : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.xb; + case 2: + return this.ai; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ rTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSecurityRequirementParser", { rTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function V5a() { + this.N = this.Q = this.p = this.Ba = null; + } + V5a.prototype = new u7(); + V5a.prototype.constructor = V5a; + d7 = V5a.prototype; + d7.H = function() { + return "RamlServersEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof V5a) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + function W5a(a10, b10, c10) { + b10 = b10.g; + var e10 = hd(b10, Yl().Pf); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, Yg(Zg(), "baseUri", e10, y7(), a10.N)))); + e10 = hd(b10, Yl().Va); + e10.b() || (e10 = e10.c(), new z7().d(Dg(c10, Yg(Zg(), fh(new je4().e("serverDescription")), e10, y7(), a10.N)))); + b10 = hd(b10, Yl().Aj); + b10.b() ? y7() : (b10 = b10.c(), new z7().d(Dg(c10, new eX().Sq("baseUriParameters", b10, a10.p, a10.Q, a10.N)))); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.JK = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.Pa = function() { + var a10 = uQa(yQa(), this.Ba), b10 = J5(Ef(), H10()), c10 = false, e10 = a10.uo; + a: + if (e10 instanceof z7) + W5a(this, e10.i, b10), X5a(this, a10.yt, b10); + else { + if (y7() === e10 && (c10 = true, a10.yt.Da())) { + W5a(this, a10.yt.ga(), b10); + X5a(this, a10.yt.ta(), b10); + break a; + } + if (!c10) + throw new x7().d(e10); + } + return b10; + }; + d7.z = function() { + return X5(this); + }; + function X5a(a10, b10, c10) { + b10.Da() && Dg(c10, new Gz().eA(fh(new je4().e("servers")), b10, a10.p, a10.N)); + } + d7.$classData = r8({ vTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlServersEmitter", { vTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q42() { + this.m = this.wc = this.xb = this.X = this.la = null; + } + q42.prototype = new u7(); + q42.prototype.constructor = q42; + d7 = q42.prototype; + d7.H = function() { + return "RamlSingleExampleParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q42) { + if (this.la === a10.la && Bj(this.X, a10.X)) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.X; + case 2: + return this.xb; + case 3: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = oq(/* @__PURE__ */ function(f10) { + return function() { + return f10.xb.P(y7()); + }; + }(this)), b10 = ac(new M6().W(this.X), this.la); + if (b10.b()) + return y7(); + b10 = b10.c(); + var c10 = this.m.hp(b10.i); + if (c10 instanceof ve4) { + a10 = c10.i; + b10 = sFa(this.m.Dl(), a10, new z7().d(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = f10.m, m10 = sg().Oy, p10 = h10.i, t10 = y7(); + ec(l10, m10, g10, t10, k10, p10.da); + }; + }(this, a10, b10)))); + if (b10.b()) + return y7(); + b10 = b10.c(); + O7(); + c10 = new P6().a(); + return new z7().d(kM(b10, a10, c10)); + } + if (!(c10 instanceof ye4)) + throw new x7().d(c10); + c10 = c10.i; + var e10 = c10.hb().gb; + if (Q5().sa === e10) + return Vb().Ia(P5a( + b10, + a10, + this.wc, + this.m + ).Xw()); + if (Q5().nd === e10) + return y7(); + e10 = Vb(); + a10 = Hb(a10); + b10 = Od(O7(), b10.i); + return e10.Ia(i42(j42(new k42(), c10, Db(a10, b10), this.wc, this.m))); + }; + d7.zU = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.X = b10; + this.xb = c10; + this.wc = e10; + this.m = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSingleExampleParser", { xTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function fY() { + this.yt = this.uo = null; + } + fY.prototype = new u7(); + fY.prototype.constructor = fY; + d7 = fY.prototype; + d7.H = function() { + return "Servers"; + }; + d7.E = function() { + return 2; + }; + d7.WO = function(a10, b10) { + this.uo = a10; + this.yt = b10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fY) { + var b10 = this.uo, c10 = a10.uo; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.yt, a10 = a10.yt, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uo; + case 1: + return this.yt; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ CTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Servers", { CTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Tz() { + this.m = this.we = this.Ks = null; + } + Tz.prototype = new u7(); + Tz.prototype.constructor = Tz; + d7 = Tz.prototype; + d7.H = function() { + return "StringTagsParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Tz ? Bj(this.Ks, a10.Ks) ? this.we === a10.we : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ks; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = J5(Ef(), H10()); + this.Ks.Cm.U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + var f10 = e10.re(); + if (f10 instanceof xt) { + e10 = Od(O7(), f10); + e10 = new GZ().K(new S6().a(), e10); + f10 = f10.va; + O7(); + var g10 = new P6().a(); + e10 = Sd(e10, f10, g10); + f10 = b10.we; + J5(K7(), H10()); + Ai(e10, f10); + return Dg(c10, e10); + } + f10 = b10.m; + g10 = sg().t6; + var h10 = b10.we, k10 = y7(); + ec(f10, g10, h10, k10, "Tag value must be of type string", e10.da); + }; + }(this, a10))); + return a10; + }; + function hna(a10, b10, c10, e10) { + a10.Ks = b10; + a10.we = c10; + a10.m = e10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ HTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.StringTagsParser", { HTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y5a() { + this.l = this.Qc = this.Q = this.Se = this.p = this.qo = null; + } + Y5a.prototype = new u7(); + Y5a.prototype.constructor = Y5a; + d7 = Y5a.prototype; + d7.H = function() { + return "WebApiEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Y5a && a10.l === this.l) { + var b10 = this.qo, c10 = a10.qo; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Se, c10 = a10.Se, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.qo; + case 1: + return this.p; + case 2: + return this.Se; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function JYa(a10, b10, c10, e10, f10) { + var g10 = new Y5a(); + g10.qo = b10; + g10.p = c10; + g10.Se = e10; + g10.Q = f10; + if (null === a10) + throw mb(E6(), null); + g10.l = a10; + f10 = b10.g; + e10 = J5(Ef(), H10()); + Dg(e10, Z5a(g10, f10, c10)); + var h10 = hd(f10, Qm().lh); + h10.b() || (h10 = h10.c(), new z7().d(ws(e10, g10.l.Lj().zf.Opa(g10.qo, h10, g10.p, g10.Q).Pa()))); + h10 = hd(f10, Qm().Wp); + h10.b() || (h10 = h10.c(), new z7().d(Dg(e10, $x("consumes", h10, g10.p, true)))); + h10 = hd(f10, Qm().yl); + h10.b() || (h10 = h10.c(), new z7().d(Dg(e10, $x("produces", h10, g10.p, true)))); + h10 = hd(f10, Qm().Gh); + h10.b() || (h10 = h10.c(), new z7().d(Dg(e10, $x("schemes", h10, g10.p, false)))); + h10 = hd(f10, Qm().Xm); + h10.b() || (h10 = h10.c(), new z7().d(Dg(e10, new s42().eA( + "tags", + h10.r.r.wb, + g10.p, + g10.l.Lj() + )))); + h10 = hd(f10, Qm().Uv); + h10.b() || (h10 = h10.c(), new z7().d(ws(e10, $5a(h10, g10.p, g10.l.Lj()).Pa()))); + h10 = B6(b10.g, Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(l10) { + return wh(B6(l10.g, Ud().zi).fa(), q5(D32)); + }; + }(g10))); + var k10 = hd(f10, Qm().Yp); + k10.b() ? Dg(e10, ky("paths", a6a(), Q5().Na, ld())) : (k10 = k10.c(), Dg(e10, b6a(g10.l, k10, g10.p, g10.Q, h10))); + f10 = hd(f10, Qm().dc); + f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, new VX().hE("security", f10, g10.p, g10.l.Lj())))); + ws(e10, ay(b10, c10, a10.Lj()).Pa()); + g10.Qc = c10.zb(e10); + return g10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ iUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$WebApiEmitter", { iUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function t42() { + M22.call(this); + this.ra = this.ee = null; + } + t42.prototype = new MYa(); + t42.prototype.constructor = t42; + function c6a() { + } + c6a.prototype = t42.prototype; + function d6a(a10) { + var b10 = a10.Mb().Nl; + return rQ() === b10 ? Uc(/* @__PURE__ */ function(c10) { + return function(e10, f10) { + return new e6a().JO(c10, e10, f10); + }; + }(a10)) : Uc(/* @__PURE__ */ function(c10) { + return function(e10, f10) { + return new f6a().JO(c10, e10, f10); + }; + }(a10)); + } + d7 = t42.prototype; + d7.Yna = function(a10, b10) { + a10 = ac(new M6().W(a10), "parameters"); + if (!a10.b()) { + a10 = a10.c().i; + var c10 = qc(); + N6(a10, c10, this.Mb()).sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = g10.Aa, k10 = new Nd().a(), l10 = g10.i, m10 = qc(); + if (Iw(l10, m10) instanceof ye4) + g10 = e10.Mb().$h.HV((ue4(), new ve4().d(g10)), f10, new z7().d(h10), k10).OL(); + else { + l10 = e10.Mb().$h; + ue4(); + T6(); + m10 = ur().ce; + T6(); + m10 = mr(T6(), m10, Q5().sa); + h10 = l10.HV(new ye4().d(m10), f10, new z7().d(h10), k10).OL(); + k10 = e10.Mb(); + l10 = sg().oY; + m10 = h10.yr.j; + var p10 = y7(); + ec(k10, l10, m10, p10, "Map needed to parse a parameter declaration", g10.da); + g10 = h10; + } + bFa(e10.Mb().Qh, g10); + }; + }(this, b10))); + } + }; + function g6a(a10, b10) { + var c10 = wB().mc, e10 = a10.ee.$g.Xd, f10 = qc(); + e10 = N6(e10, f10, a10.Mb()); + h6a(a10, e10, b10).hd(); + e10 = ac(new M6().W(e10), jx(new je4().e("extends"))); + e10.b() || (e10 = e10.c(), f10 = a10.Mb().hp(e10.i), f10 instanceof ve4 && (a10 = a10.ee.Q.Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return k10.$n.Of === h10; + }; + }(a10, f10.i))), a10.b() || (a10 = a10.c(), a10 = ih(new jh(), a10.Jd.j, Od(O7(), e10.i)), e10 = Od(O7(), e10), Rg(b10, c10, a10, e10)))); + } + function i6a(a10, b10) { + var c10 = a10.ee.da; + J5(K7(), H10()); + c10 = Ai(b10, c10); + var e10 = a10.ee.da, f10 = Bq().uc; + eb(c10, f10, e10); + c10 = a10.ee.$g.Xd; + e10 = qc(); + e10 = N6(c10, e10, a10.Mb()); + oYa(a10.Mb(), (T6(), T6(), mr(T6(), e10, Q5().sa))); + c10 = pz(qz(b10, jx(new je4().e("uses")), e10, a10.ee.Q, a10.Mb()), a10.ee.da); + a10.rA(a10.ee, e10); + e10 = a10.ML(e10); + f10 = Y1(new Z1(), a10.Mb().Gg()); + e10 = Cb(e10, f10); + f10 = Jk().nb; + e10 = Vd(b10, f10, e10); + f10 = a10.ee.da; + J5(K7(), H10()); + Ai(e10, f10); + e10 = a10.Mb().Qh.et(); + e10.Da() && (f10 = Af().Ic, Bf(b10, f10, e10)); + tc(c10.Q) && (c10 = O4a(c10), e10 = Gk().xc, Bf(b10, e10, c10)); + Fb(a10.Mb().ni); + return b10; + } + function j6a(a10, b10) { + var c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + var g10 = B6(f10.g, dj().R).A; + g10.b() ? f10 = y7() : (g10 = g10.c(), f10 = new z7().d(new R6().M(g10, f10))); + return f10.ua(); + }; + }(a10)), e10 = K7(); + b10 = b10.bd(c10, e10.u).am(w6(/* @__PURE__ */ function() { + return function(f10) { + if (null !== f10) + return f10.ma(); + throw new x7().d(f10); + }; + }(a10))); + c10 = new k6a(); + e10 = Id().u; + xs(b10, c10, e10).ps(Gb().si).U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + var k10 = f10.Mb(), l10 = sg().C5; + yB(k10, l10, g10.j, "Tag with name '" + h10 + "' was found duplicated", g10.x); + } else + throw new x7().d(g10); + }; + }(a10))); + } + d7.nca = function() { + O7(); + var a10 = new P6().a(); + a10 = i6a(this, new Fl().K(new S6().a(), a10)); + g6a(this, a10); + return a10; + }; + d7.Tx = function(a10, b10) { + this.ee = a10; + this.ra = b10; + M22.prototype.fE.call(this, b10); + return this; + }; + d7.wca = function(a10, b10) { + a10 = ac(new M6().W(a10), this.j0); + if (!a10.b()) { + a10 = a10.c().i; + var c10 = qc(); + N6(a10, c10, this.Mb()).sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = g10.Aa, k10 = bc(), l10 = N6(h10, k10, e10.Mb()).va; + h10 = oX(pX(), g10, w6(/* @__PURE__ */ function(t10, v10, A10, D10) { + return function(C10) { + var I10 = qf().R, L10 = ih(new jh(), v10, Od(O7(), A10.Aa.re())), Y10 = Od(O7(), A10.Aa); + Rg(C10, I10, L10, Y10); + C10.ub(D10, lt2()); + }; + }(e10, l10, g10, f10)), e10.Mb()).Cc(); + if (h10 instanceof z7) + return g10 = h10.i, h10 = e10.Mb().Qh, k10 = new Zh().a(), $h(h10, Cb(g10, k10)); + if (y7() === h10) { + h10 = e10.Mb(); + k10 = sg().i_; + O7(); + var m10 = new P6().a(); + m10 = new Hh().K(new S6().a(), m10); + var p10 = J5(K7(), H10()); + m10 = o5a(m10, f10, p10).j; + l10 = "Error parsing shape at " + l10; + p10 = y7(); + ec(h10, k10, m10, p10, l10, g10.da); + } else + throw new x7().d(h10); + }; + }(this, b10))); + } + }; + d7.vca = function() { + O7(); + var a10 = new P6().a(); + a10 = i6a(this, new Hl().K(new S6().a(), a10)); + g6a(this, a10); + return a10; + }; + d7.f2 = function(a10, b10, c10) { + a10 = ac(new M6().W(b10), a10); + a10.b() || (a10 = a10.c().i, b10 = qc(), N6(a10, b10, this.Mb()).sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = new Qg().Vb(g10.Aa, e10.Mb()).Zf(), k10 = e10.Mb().Qh, l10 = g10.i, m10 = qc(); + return $h(k10, new Yz().Hw(N6(l10, m10, e10.Mb()), w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + var C10 = Dm().R; + C10 = Vd(D10, C10, t10); + J5(K7(), H10()); + C10 = Ai(C10, v10); + var I10 = new Zh().a(); + Cb(C10, I10); + D10.x.Sp(Od(O7(), A10)); + }; + }(e10, h10, f10, g10)), e10.Mb()).EH()); + }; + }(this, c10)))); + }; + d7.rA = function(a10, b10) { + a10 = a10.da + "#/declarations"; + this.wca(b10, a10 + "/types"); + this.d2(b10, a10); + Q2a(new C32(), jx(new je4().e("resourceTypes")), w6(/* @__PURE__ */ function() { + return function(c10) { + return dD(eD(), c10); + }; + }(this)), b10, a10 + "/resourceTypes", this.Mb()).hd(); + Q2a(new C32(), jx(new je4().e("traits")), w6(/* @__PURE__ */ function() { + return function(c10) { + return gD(hD(), c10); + }; + }(this)), b10, a10 + "/traits", this.Mb()).hd(); + this.zH(b10, a10 + "/securitySchemes"); + this.Yna(b10, a10 + "/parameters"); + this.f2("responses", b10, a10 + "/responses"); + }; + d7.d2 = function(a10, b10) { + a10 = new M6().W(a10); + var c10 = jx(new je4().e("annotationTypes")); + a10 = ac(a10, c10); + a10.b() || (a10 = a10.c().i, c10 = qc(), a10 = N6(a10, c10, this.Mb()).sb, b10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = g10.Aa, k10 = bc(); + h10 = N6(h10, k10, e10.Mb()).va; + g10 = NYa(e10).h9(g10, w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + O7(); + var v10 = new P6().a(); + t10 = Sd(t10, m10, v10); + J5(K7(), H10()); + l6a(t10, p10); + }; + }(e10, h10, f10))); + h10 = e10.Mb().Qh; + k10 = new Zh().a(); + return $h(h10, Cb(g10, k10)); + }; + }(this, b10)), c10 = rw(), a10.ka(b10, c10.sc)); + }; + d7.ML = function(a10) { + var b10 = sSa(uSa(), this.ee.$g.Xd.Fd), c10 = this.ee.da; + J5(K7(), H10()); + b10 = Ai(b10, c10); + c10 = ac(new M6().W(a10), "info"); + if (!c10.b()) { + c10 = c10.c().i; + var e10 = qc(); + c10 = N6(c10, e10, this.Mb()); + Zz(this.Mb(), b10.j, c10, "info"); + e10 = new M6().W(c10); + var f10 = Qm().R; + Gg(e10, "title", Hg(Ig(this, f10, this.Mb()), b10)); + e10 = new M6().W(c10); + f10 = Qm().Va; + Gg(e10, "description", Hg(Ig(this, f10, this.Mb()), b10)); + e10 = new M6().W(c10); + f10 = Qm().XF; + Gg(e10, "termsOfService", Hg(Ig(this, f10, this.Mb()), b10)); + e10 = new M6().W(c10); + f10 = Qm().Ym; + Gg(e10, "version", Hg(Ig(this, f10, this.Mb()), b10)); + e10 = new M6().W(c10); + f10 = Qm().SF; + Gg( + e10, + "contact", + Gy(Hg(Ig(this, f10, this.Mb()), b10), w6(/* @__PURE__ */ function(l10) { + return function(m10) { + Wma(); + var p10 = l10.Mb(); + Wma(); + m10 = new XP().pv(m10, wz(uz(), p10)); + return iGa(m10); + }; + }(this))) + ); + c10 = new M6().W(c10); + e10 = Qm().OF; + Gg(c10, "license", Gy(Hg(Ig(this, e10, this.Mb()), b10), w6(/* @__PURE__ */ function(l10) { + return function(m10) { + Pma(); + var p10 = l10.Mb(); + Pma(); + m10 = new RP().pv(m10, wz(uz(), p10)); + return aGa(m10); + }; + }(this)))); + } + this.Mb().$h.Rpa(a10, b10).hd(); + c10 = ac(new M6().W(a10), "tags"); + if (!c10.b() && (c10 = c10.c(), e10 = c10.i.hb().gb, Q5().cd === e10)) { + e10 = c10.i; + f10 = qc(); + var g10 = rw().sc; + e10 = N6(e10, sw(g10, f10), this.Mb()); + f10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return KGa(dna( + fna(), + (T6(), T6(), mr(T6(), p10, Q5().sa)), + w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + var D10 = v10.j; + J5(K7(), H10()); + return Ai(A10, D10); + }; + }(l10, m10)), + l10.Mb() + )); + }; + }(this, b10)); + g10 = K7(); + f10 = e10.ka(f10, g10.u); + j6a(this, f10); + e10 = Qm().Xm; + f10 = Zr(new $r(), f10, Od(O7(), c10.i)); + c10 = Od(O7(), c10); + Rg(b10, e10, f10, c10); + } + c10 = ac(new M6().W(a10), "security"); + if (!c10.b()) + if (c10 = c10.c(), e10 = c10.i.hb().gb, Q5().cd === e10) + e10 = new Nd().a(), f10 = c10.i, g10 = lc(), f10 = N6(f10, g10, this.Mb()), e10 = w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + return lna(new Vz(), t10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return A10.mI(D10); + }; + }(l10, m10)), p10, l10.Mb()).Cc(); + }; + }(this, b10, e10)), g10 = K7(), e10 = f10.ka( + e10, + g10.u + ), f10 = new m6a(), g10 = K7(), f10 = e10.ec(f10, g10.u), e10 = Qm().dc, f10 = Zr(new $r(), f10, Od(O7(), c10.i)), c10 = Od(O7(), c10), Rg(b10, e10, f10, c10); + else { + e10 = this.Mb(); + f10 = sg().ega; + T6(); + c10 = c10.i; + g10 = this.Mb(); + var h10 = Dd(); + c10 = N6(c10, h10, g10); + g10 = y7(); + h10 = y7(); + var k10 = y7(); + e10.Gc(f10.j, c10, g10, "'security' must be an array of security requirement object", h10, Yb().qb, k10); + } + c10 = J5(Ef(), H10()); + e10 = ac(new M6().W(a10), "externalDocs"); + e10.b() || (e10 = e10.c(), Dg(c10, YOa(new jX(), e10.i, b10.j, this.Mb()).BH())); + e10 = new M6().W(a10); + f10 = jx(new je4().e("userDocumentation")); + e10 = ac(e10, f10); + e10.b() || (e10 = e10.c().i, f10 = lc(), ws(c10, n6a(new o6a(), this, N6(e10, f10, this.Mb())).Vg())); + c10.Da() && (e10 = Qm().Uv, Zd(b10, e10, c10)); + c10 = ac(new M6().W(a10), "paths"); + c10.b() || (c10 = c10.c(), e10 = c10.i, f10 = qc(), e10 = N6(e10, f10, this.Mb()), f10 = wt(new M6().W(e10), "^/.*"), f10.Da() && (g10 = J5(Ef(), H10()), f10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + p6a(new u42(), l10, t10, w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + return q6a(A10, D10); + }; + }(l10, m10)), p10).hd(); + }; + }(this, b10, g10))), f10 = Qm().Yp, g10 = Zr(new $r(), g10, new P6().a()), c10 = Od(O7(), c10.i), Rg(b10, f10, g10, c10)), Zz(this.Mb(), b10.j, e10, "paths")); + Ry(new Sy(), b10, a10, H10(), this.Mb()).hd(); + pna(Ry(new Sy(), b10, a10, H10(), this.Mb()), "paths"); + Zz(this.Mb(), b10.j, a10, "webApi"); + return b10; + }; + d7.zH = function(a10, b10) { + var c10 = ac(new M6().W(a10), this.V2); + if (!c10.b()) { + c10 = c10.c().i; + var e10 = qc(); + N6(c10, e10, this.Mb()).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = f10.Mb().Qh; + h10 = Bca(Cca(), h10, Uc(/* @__PURE__ */ function(m10, p10, t10) { + return function(v10, A10) { + var D10 = im().R; + A10 = ih(new jh(), A10, Od(O7(), p10.Aa.re())); + var C10 = Od(O7(), p10.Aa); + Rg(v10, D10, A10, C10); + return Yh(v10, t10, J5(K7(), H10())); + }; + }(f10, h10, g10)), f10.Mb()).FH(); + var l10 = new Zh().a(); + return $h(k10, Cb(h10, l10)); + }; + }(this, b10))); + } + a10 = new M6().W(a10); + c10 = jx(new je4().e("securitySchemes")); + a10 = ac(a10, c10); + a10.b() || (a10 = a10.c().i, c10 = qc(), N6(a10, c10, this.Mb()).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = f10.Mb().Qh; + h10 = Bca(Cca(), h10, Uc(/* @__PURE__ */ function(m10, p10, t10) { + return function(v10, A10) { + var D10 = im().R; + A10 = ih(new jh(), A10, Od(O7(), p10.Aa.re())); + var C10 = Od(O7(), p10.Aa); + Rg(v10, D10, A10, C10); + return Yh(v10, t10, J5(K7(), H10())); + }; + }(f10, h10, g10)), f10.Mb()).FH(); + var l10 = new Zh().a(); + return $h(k10, Cb(h10, l10)); + }; + }(this, b10)))); + }; + function v42() { + this.l = this.MP = this.$ = this.yb = this.X = null; + } + v42.prototype = new u7(); + v42.prototype.constructor = v42; + function r6a(a10, b10, c10, e10, f10, g10) { + a10.X = c10; + a10.yb = e10; + a10.$ = f10; + a10.MP = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7 = v42.prototype; + d7.H = function() { + return "CallbackParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof v42 && a10.l === this.l) { + if (Bj(this.X, a10.X)) { + var b10 = this.yb, c10 = a10.yb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && this.$ === a10.$ ? this.MP === a10.MP : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + case 2: + return this.$; + case 3: + return this.MP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.GH = function() { + var a10 = this.l.Mb(); + T6(); + var b10 = this.X; + T6(); + a10 = a10.hp(mr(T6(), b10, Q5().sa)); + if (a10 instanceof ve4) { + b10 = a10.i; + a10 = oA(rA(), b10, "callbacks"); + var c10 = this.l.Mb().Qh.mB.Ja(a10); + if (c10.b()) + c10 = y7(); + else { + var e10 = c10.c(); + c10 = /* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = Od(O7(), k10.X); + m10 = kM(m10, l10, p10); + k10.yb.P(m10); + return m10; + }; + }(this, a10); + var f10 = ii().u; + if (f10 === ii().u) + if (e10 === H10()) + c10 = H10(); + else { + f10 = e10.ga(); + var g10 = f10 = ji(c10(f10), H10()); + for (e10 = e10.ta(); e10 !== H10(); ) { + var h10 = e10.ga(); + h10 = ji(c10(h10), H10()); + g10 = g10.Nf = h10; + e10 = e10.ta(); + } + c10 = f10; + } + else { + for (f10 = se4(e10, f10); !e10.b(); ) + g10 = e10.ga(), f10.jd(c10(g10)), e10 = e10.ta(); + c10 = f10.Rc(); + } + c10 = new z7().d(c10); + } + if (c10.b()) { + c10 = w42(this.l.Mb(), b10, this.l.Mb()); + if (c10 instanceof z7) + return a10 = c10.i, b10 = this.l, c10 = qc(), r6a(new v42(), b10, N6(a10, c10, this.l.Mb()), this.yb, this.$, this.MP).GH(); + if (y7() !== c10) + throw new x7().d(c10); + c10 = this.l.Mb(); + e10 = dc().au; + b10 = "Cannot find callback reference " + b10; + f10 = this.X; + g10 = y7(); + ec(c10, e10, "", g10, b10, f10.da); + a10 = new s6a().Tq(a10, this.X); + b10 = this.$; + c10 = Od(O7(), this.MP); + a10 = kM(a10, b10, c10); + this.yb.P(a10); + ii(); + a10 = [a10]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + return c10.c(); + } + if (a10 instanceof ye4) + return a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(k10) { + return function(l10) { + var m10 = l10.Aa, p10 = bc(); + m10 = N6(m10, p10, k10.l.Mb()).va; + O7(); + p10 = new P6().a(); + p10 = new bm().K(new S6().a(), p10); + var t10 = Od(O7(), l10); + p10 = Db(p10, t10); + Ui(p10.g, am().Ky, ih(new jh(), m10, Od(O7(), l10.Aa)), (O7(), new P6().a())); + k10.yb.P(p10); + t10 = J5(Ef(), H10()); + p6a(new u42(), k10.l, l10, w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + O7(); + var L10 = new P6().a(), Y10 = new S6().a(); + L10 = new Kl().K(Y10, L10); + Y10 = Jl().Uf; + I10 = eb(L10, Y10, I10); + L10 = am().YM; + Vd(C10, L10, I10); + return I10; + }; + }(k10, p10)), t10).hd(); + for (l10 = t10.Dc; !l10.b(); ) { + t10 = l10.ga(); + var v10 = "/" + m10, A10 = Jl().Uf; + eb(t10, A10, v10); + l10 = l10.ta(); + } + return p10; + }; + }(this)), c10 = rw(), a10.ka(b10, c10.sc).ua(); + throw new x7().d(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ nUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$CallbackParser", { nUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function u42() { + this.l = this.Lq = this.xb = this.tb = null; + } + u42.prototype = new u7(); + u42.prototype.constructor = u42; + d7 = u42.prototype; + d7.H = function() { + return "EndpointParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof u42 && a10.l === this.l) { + if (this.tb === a10.tb) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.Lq, a10 = a10.Lq, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + case 2: + return this.Lq; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function p6a(a10, b10, c10, e10, f10) { + a10.tb = c10; + a10.xb = e10; + a10.Lq = f10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + function t6a(a10) { + Ed(ua(), a10, "/") && (a10 = new qg().e(a10), a10 = Fca(a10)); + return Bx(ua(), a10, "\\{.*?\\}", ""); + } + d7.hd = function() { + var a10 = this.tb.Aa, b10 = bc(); + b10 = N6(a10, b10, this.l.Mb()).va; + a10 = this.xb.P(b10); + var c10 = Od(O7(), this.tb); + a10 = Db(a10, c10); + c10 = this.tb.i; + var e10 = a10.j, f10 = ic(Jl().Uf.r); + bca(b10, c10, e10, f10, this.l.Mb()); + c10 = Jl().Uf; + e10 = ih(new jh(), b10, Od(O7(), this.tb.Aa)); + Vd(a10, c10, e10); + if (!Cja(Yv(), b10)) { + c10 = this.l.Mb(); + e10 = sg().HR; + f10 = a10.j; + var g10 = Bja(Yv(), b10), h10 = this.tb.i, k10 = y7(); + ec(c10, e10, f10, k10, g10, h10.da); + } + a: { + for (c10 = this.Lq.Dc; !c10.b(); ) { + e10 = B6(c10.ga().g, Jl().Uf).A; + e10.b() ? e10 = false : (e10 = e10.c(), f10 = b10, g10 = this.l.Mb().Nl, h10 = rQ(), e10 = null !== g10 && g10 === h10 ? t6a(e10) === t6a(f10) : e10 === f10); + if (e10) { + c10 = true; + break a; + } + c10 = c10.ta(); + } + c10 = false; + } + if (c10) + c10 = this.l.Mb(), e10 = sg().OX, a10 = a10.j, b10 = "Duplicated resource path " + b10, f10 = this.tb, g10 = y7(), ec(c10, e10, a10, g10, b10, f10.da); + else + a: + if (b10 = this.l.Mb().hp(this.tb.i), b10 instanceof ve4) + b: { + if (b10 = b10.i, c10 = false, e10 = null, f10 = w42(this.l.Mb(), b10, this.l.Mb()), g10 = f10.b() ? this.l.Mb().Qh.gja.Ja(b10) : f10, g10 instanceof z7 && (c10 = true, e10 = g10, f10 = e10.i, h10 = f10.hb().gb, k10 = Q5().sa, h10 === k10)) { + b10 = qc(); + u6a(this, a10, N6(f10, b10, this.l.Mb())); + break b; + } + if (c10) + b10 = e10.i, c10 = this.l.Mb(), e10 = sg().g6, a10 = a10.j, f10 = y7(), ec(c10, e10, a10, f10, "Invalid node for path item", b10.da); + else if (y7() === g10) + c10 = this.l.Mb(), e10 = sg().HR, a10 = a10.j, b10 = "Cannot find fragment path item ref " + b10, f10 = this.tb.i, g10 = y7(), ec(c10, e10, a10, g10, b10, f10.da); + else + throw new x7().d(g10); + } + else { + if (b10 instanceof ye4 && (b10 = b10.i, c10 = b10.hb().gb, e10 = Q5().sa, c10 === e10)) { + c10 = qc(); + u6a(this, a10, N6(b10, c10, this.l.Mb())); + break a; + } + Dg(this.Lq, a10); + } + }; + d7.z = function() { + return X5(this); + }; + function u6a(a10, b10, c10) { + Zz(a10.l.Mb(), b10.j, c10, "pathItem"); + var e10 = new M6().W(c10), f10 = jx(new je4().e("displayName")), g10 = a10.l, h10 = Jl().R; + Gg(e10, f10, Hg(Ig(g10, h10, a10.l.Mb()), b10)); + e10 = new M6().W(c10); + f10 = jx(new je4().e("description")); + g10 = a10.l; + h10 = Jl().Va; + Gg(e10, f10, Hg(Ig(g10, h10, a10.l.Mb()), b10)); + e10 = a10.l.Mb().Nl; + f10 = rQ(); + null !== e10 && e10 === f10 && (e10 = new M6().W(c10), f10 = a10.l, g10 = Jl().ck, Gg(e10, "summary", Hg(Ig(f10, g10, a10.l.Mb()), b10)), e10 = new M6().W(c10), f10 = a10.l, g10 = Jl().Va, Gg(e10, "description", Hg(Ig(f10, g10, a10.l.Mb()), b10))); + f10 = null; + f10 = bQ(new cQ(), H10(), H10(), H10(), H10(), H10(), H10()); + e10 = J5(Ef(), H10()); + a10.l.Mb().$h.Ppa( + c10, + b10 + ).hd(); + g10 = ac(new M6().W(c10), "parameters"); + g10.b() || (g10 = g10.c(), Dg(e10, g10), g10 = g10.i, h10 = lc(), g10 = BGa(new eQ(), N6(g10, h10, a10.l.Mb()), b10.j, a10.l.Mb()), f10 = dQ(f10, CGa(g10, false))); + g10 = ac(new M6().W(c10), jx(new je4().e("uriParameters"))); + if (!g10.b()) { + g10 = g10.c(); + Dg(e10, g10); + g10 = g10.i; + h10 = qc(); + g10 = T32(new U32(), N6(g10, h10, a10.l.Mb()), w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + var D10 = v10.j; + J5(K7(), H10()); + Ai(A10, D10); + }; + }(a10, b10)), tz(uz(), a10.l.Mb())).Vg(); + h10 = w6(/* @__PURE__ */ function() { + return function(t10) { + var v10 = cj().We; + return eb(t10, v10, "path"); + }; + }(a10)); + var k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = H10(); + k10 = H10(); + var l10 = H10(), m10 = H10(), p10 = H10(); + f10 = dQ(f10, bQ( + new cQ(), + h10, + g10, + k10, + l10, + m10, + p10 + )); + } + g10 = f10; + null !== g10 && (l10 = g10.qt, m10 = g10.ah, k10 = g10.Xg, h10 = g10.Mx, l10.Da() || m10.Da() || k10.Da() || h10.Da()) && (g10 = Jl().Wm, p10 = K7(), l10 = l10.ia(m10, p10.u), m10 = K7(), k10 = l10.ia(k10, m10.u), l10 = K7(), h10 = Zr(new $r(), k10.ia(h10, l10.u), Od(O7(), e10.Dc.ga().i)), k10 = Od(O7(), e10.Dc.ga()), Rg(b10, g10, h10, k10)); + f10.pw.Da() && (g10 = Jl().Ne, f10 = Zr(new $r(), f10.pw, new P6().a()), e10 = Od(O7(), e10.Dc.ga()), Rg(b10, g10, f10, e10)); + e10 = new M6().W(c10); + f10 = jx(new je4().e("is")); + g10 = a10.l; + h10 = Jl().Ni(); + g10 = Hg(Ig(g10, h10, a10.l.Mb()), b10); + Gg(e10, f10, sP(Gy(g10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return tGa(uGa(), v10, A10, t10.l.Mb()); + }; + }(a10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return kda( + v10, + A10 + ); + }; + }(a10, b10))))))); + e10 = new M6().W(c10); + f10 = jx(new je4().e("type")); + e10 = ac(e10, f10); + e10.b() || (e10 = e10.c(), ina(jna(new Uz(), e10.i, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return jda(v10, A10); + }; + }(a10, b10)), Uc(/* @__PURE__ */ function(t10, v10) { + return function(A10, D10) { + return tFa(t10.l.Mb().Qh, v10.i, A10, D10); + }; + }(a10, e10)), a10.l.Mb()))); + Dg(a10.Lq, b10); + Ry(new Sy(), b10, c10, H10(), a10.l.Mb()).hd(); + e10 = new M6().W(c10); + f10 = jx(new je4().e("security")); + e10 = ac(e10, f10); + e10.b() || (e10 = e10.c(), f10 = new Nd().a(), g10 = e10.i, h10 = lc(), g10 = N6(g10, h10, a10.l.Mb()), f10 = w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + return lna(new Vz(), D10, w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + return I10.mI(L10); + }; + }( + t10, + v10 + )), A10, t10.l.Mb()).Cc(); + }; + }(a10, b10, f10)), h10 = K7(), f10 = g10.ka(f10, h10.u), g10 = new v6a(), h10 = K7(), g10 = f10.ec(g10, h10.u), g10.Da() && (f10 = Pl().dc, g10 = Zr(new $r(), g10, Od(O7(), e10.i)), e10 = Od(O7(), e10), Rg(b10, f10, g10, e10))); + e10 = wt(new M6().W(c10), "get|patch|put|post|delete|options|head|connect|trace"); + e10.Da() && (c10 = J5(Ef(), H10()), e10.U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + return Dg(v10, d6a(t10.l).ug(D10, w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + return vGa(I10, L10); + }; + }(t10, A10))).g2()); + }; + }(a10, c10, b10))), a10 = Jl().bk, c10 = Zr(new $r(), c10, new P6().a()), Vd(b10, a10, c10)); + } + d7.$classData = r8({ oUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$EndpointParser", { oUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function w6a() { + this.l = this.m = this.yb = this.X = null; + } + w6a.prototype = new u7(); + w6a.prototype.constructor = w6a; + d7 = w6a.prototype; + d7.H = function() { + return "Oas2RequestParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof w6a && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = new Nv().PG(oq(/* @__PURE__ */ function(p10) { + return function() { + O7(); + var t10 = new P6().a(); + t10 = new Bm().K(new S6().a(), t10); + var v10 = new x42().a(); + t10 = Cb(t10, v10); + p10.yb.P(t10); + return t10; + }; + }(this))), b10 = null; + b10 = bQ(new cQ(), H10(), H10(), H10(), H10(), H10(), H10()); + var c10 = null; + c10 = J5(Ef(), H10()); + var e10 = ac(new M6().W(this.X), "parameters"); + if (!e10.b()) { + e10 = e10.c(); + Dg(c10, e10); + e10 = e10.i; + var f10 = lc(); + b10 = dQ(b10, CGa(BGa(new eQ(), N6(e10, f10, this.m), Ov(a10).j, this.m), true)); + } + e10 = ac(new M6().W(this.X), jx(new je4().e("queryParameters"))); + if (!e10.b()) { + e10 = e10.c(); + Dg(c10, e10); + e10 = e10.i; + f10 = qc(); + e10 = T32(new U32(), N6( + e10, + f10, + this.m + ), w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = Ov(t10).j; + J5(K7(), H10()); + Ai(v10, A10); + }; + }(this, a10)), tz(uz(), this.m)).Vg(); + f10 = w6(/* @__PURE__ */ function() { + return function(p10) { + var t10 = cj().We; + return eb(p10, t10, "query"); + }; + }(this)); + var g10 = K7(); + e10 = e10.ka(f10, g10.u); + b10 = dQ(b10, bQ(new cQ(), e10, H10(), H10(), H10(), H10(), H10())); + } + e10 = ac(new M6().W(this.X), jx(new je4().e("headers"))); + if (!e10.b()) { + e10 = e10.c(); + Dg(c10, e10); + e10 = e10.i; + f10 = qc(); + e10 = T32(new U32(), N6(e10, f10, this.m), w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = Ov(t10).j; + J5(K7(), H10()); + Ai(v10, A10); + }; + }(this, a10)), tz(uz(), this.m)).Vg(); + f10 = w6(/* @__PURE__ */ function() { + return function(p10) { + var t10 = cj().We; + return eb(p10, t10, "header"); + }; + }(this)); + g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = H10(); + g10 = H10(); + var h10 = H10(), k10 = H10(), l10 = H10(); + b10 = dQ(b10, bQ(new cQ(), f10, g10, e10, h10, k10, l10)); + } + e10 = new M6().W(this.X); + f10 = jx(new je4().e("baseUriParameters")); + e10 = ac(e10, f10); + e10.b() || (e10 = e10.c().i, f10 = qc(), e10 = N6(e10, f10, this.m).sb.kc(), e10.b() || (e10 = e10.c(), e10 = new iQ().jn(e10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = Ov(t10).j; + J5(K7(), H10()); + Ai(v10, A10); + }; + }(this, a10)), false, tz(uz(), this.m)).SB(), f10 = cj().We, e10 = eb(e10, f10, "path"), e10 = J5(K7(), new Ib().ha([e10])), f10 = H10(), g10 = H10(), h10 = H10(), k10 = H10(), l10 = H10(), b10 = dQ(b10, bQ(new cQ(), f10, g10, h10, k10, e10, l10)))); + f10 = b10; + if (null !== f10) { + l10 = f10.qt; + e10 = f10.ah; + g10 = f10.Xg; + f10 = f10.lB; + if (l10.Da()) { + h10 = Ov(a10); + k10 = Am().Tl; + O7(); + l10 = Zr(new $r(), l10, Od(0, c10.Dc.ga())); + var m10 = Od(O7(), c10.Dc.ga()); + Rg(h10, k10, l10, m10); + } + g10.Da() && (h10 = Ov(a10), k10 = Am().Tf, O7(), g10 = Zr(new $r(), g10, Od(0, c10.Dc.ga())), l10 = Od(O7(), c10.Dc.ga()), Rg(h10, k10, g10, l10)); + if (e10.Da() || f10.Da()) + g10 = Ov(a10), h10 = Am().Zo, k10 = K7(), e10 = e10.ia(f10, k10.u), O7(), e10 = Zr(new $r(), e10, Od(0, c10.Dc.ga())), c10 = Od(O7(), c10.Dc.ga()), Rg(g10, h10, e10, c10); + } else + throw new x7().d(f10); + c10 = J5(Ef(), H10()); + b10.pw.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return Dg(t10, v10); + }; + }(this, c10))); + b10 = new M6().W(this.X); + e10 = jx(new je4().e("requestPayloads")); + b10 = ac(b10, e10); + b10.b() || (b10 = b10.c().i, e10 = lc(), b10 = N6(b10, e10, this.m), e10 = w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + var D10 = Ov(v10); + return Dg(t10, new y42().QO(A10, w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + return jQ(I10, L10); + }; + }(p10, D10)), p10.m).ly()); + }; + }(this, c10, a10)), f10 = K7(), b10.ka(e10, f10.u)); + c10.Da() && (b10 = Ov(a10), e10 = Am().Ne, c10 = Zr(new $r(), c10, new P6().a()), Vd(b10, e10, c10)); + c10 = new M6().W(this.X); + b10 = jx(new je4().e("queryString")); + c10 = ac(c10, b10); + c10.b() || (c10 = c10.c(), c10 = PW(QW(), c10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return v10.ub(Ov(t10).j, lt2()); + }; + }(this, a10)), RW(false, false), QP(), tz(uz(), this.m)).Cc(), c10.b() || (b10 = c10.c(), c10 = Ov(a10), b10 = HC(EC(), b10, Ov(a10).j, y7()), e10 = Am().Dq, new z7().d(Vd(c10, e10, b10)))); + return a10.r; + }; + d7.gE = function(a10, b10, c10, e10) { + this.X = b10; + this.yb = c10; + this.m = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ rUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$Oas2RequestParser", { rUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function x6a() { + this.l = this.m = this.xb = this.X = null; + } + x6a.prototype = new u7(); + x6a.prototype.constructor = x6a; + d7 = x6a.prototype; + d7.H = function() { + return "Oas3ParametersParser"; + }; + d7.E = function() { + return 2; + }; + function y6a(a10, b10, c10, e10, f10) { + a10.X = c10; + a10.xb = e10; + a10.m = f10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof x6a && a10.l === this.l ? Bj(this.X, a10.X) ? this.xb === a10.xb : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function z6a(a10) { + var b10 = new Nv().PG(a10.xb), c10 = ac(new M6().W(a10.X), "parameters"); + if (!c10.b()) { + c10 = c10.c(); + var e10 = c10.i, f10 = lc(); + f10 = CGa(BGa(new eQ(), N6(e10, f10, a10.m), Ov(b10).j, a10.m), true); + if (null !== f10) { + var g10 = f10.qt; + e10 = f10.ah; + var h10 = f10.Xg; + a10 = f10.Mx; + f10 = f10.lB; + if (g10.Da()) { + var k10 = Ov(b10), l10 = Am().Tl; + g10 = Zr(new $r(), g10, Od(O7(), c10)); + var m10 = Od(O7(), c10); + Rg(k10, l10, g10, m10); + } + h10.Da() && (k10 = Ov(b10), l10 = Am().Tf, h10 = Zr(new $r(), h10, Od(O7(), c10)), g10 = Od(O7(), c10), Rg(k10, l10, h10, g10)); + if (e10.Da() || f10.Da()) + h10 = Ov(b10), k10 = Am().Zo, l10 = K7(), e10 = Zr(new $r(), e10.ia(f10, l10.u), Od(O7(), c10)), f10 = Od(O7(), c10), Rg(h10, k10, e10, f10); + a10.Da() && (b10 = Ov(b10), e10 = Am().BF, a10 = Zr(new $r(), a10, Od(O7(), c10)), c10 = Od(O7(), c10), Rg(b10, e10, a10, c10)); + } else + throw new x7().d(f10); + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$Oas3ParametersParser", { tUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function z42() { + this.l = this.m = this.yb = this.X = null; + } + z42.prototype = new u7(); + z42.prototype.constructor = z42; + d7 = z42.prototype; + d7.H = function() { + return "Oas3RequestParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof z42 && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.m; + T6(); + var b10 = this.X; + T6(); + a10 = a10.hp(mr(T6(), b10, Q5().sa)); + if (a10 instanceof ve4) + return A6a(this, a10.i); + if (a10 instanceof ye4) { + O7(); + a10 = new P6().a(); + a10 = new Bm().K(new S6().a(), a10); + this.yb.P(a10); + b10 = new M6().W(this.X); + var c10 = this.l, e10 = Am().Va; + Gg(b10, "description", Hg(Ig(c10, e10, this.m), a10)); + b10 = new M6().W(this.X); + c10 = this.l; + e10 = Am().yj; + Gg(b10, "required", Hg(Ig(c10, e10, this.m), a10)); + b10 = J5(Ef(), H10()); + c10 = ac(new M6().W(this.X), "content"); + if (c10 instanceof z7) + ws(b10, new h42().NO( + c10.i, + w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return jQ(l10, m10); + }; + }(this, a10)), + this.m + ).GH()); + else if (y7() === c10) { + c10 = this.m; + e10 = sg().X7; + var f10 = a10.j, g10 = this.X, h10 = y7(); + ec(c10, e10, f10, h10, "Request body must have a 'content' field defined", g10.da); + } else + throw new x7().d(c10); + c10 = Dm().Ne; + b10 = Zr(new $r(), b10, new P6().a()); + Vd(a10, c10, b10); + Ry(new Sy(), a10, this.X, H10(), this.m).hd(); + Zz(this.m, a10.j, this.X, "request"); + return new z7().d(a10); + } + throw new x7().d(a10); + }; + d7.gE = function(a10, b10, c10, e10) { + this.X = b10; + this.yb = c10; + this.m = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + function A6a(a10, b10) { + var c10 = oA(rA(), b10, "requestBodies"), e10 = oFa(a10.m.Qh, c10); + if (e10.b()) + c10 = y7(); + else { + e10 = e10.c(); + var f10 = Od(O7(), a10.X); + e10 = kM(e10, c10, f10); + O7(); + f10 = new P6().a(); + Sd(e10, c10, f10); + a10.yb.P(e10); + c10 = new z7().d(e10); + } + if (c10.b()) { + c10 = w42(a10.m, b10, a10.m); + if (c10 instanceof z7) + return b10 = c10.i, c10 = a10.l, e10 = qc(), new z42().gE(c10, N6(b10, e10, a10.m), a10.yb, a10.m).Cc(); + if (y7() !== c10) + throw new x7().d(c10); + c10 = a10.m; + e10 = dc().au; + b10 = "Cannot find requestBody reference " + b10; + a10 = a10.X; + f10 = y7(); + ec(c10, e10, "", f10, b10, a10.da); + return y7(); + } + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$Oas3RequestParser", { uUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wz() { + this.l = this.m = this.yb = this.X = null; + } + Wz.prototype = new u7(); + Wz.prototype.constructor = Wz; + d7 = Wz.prototype; + d7.H = function() { + return "RequestParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Wz && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.m.Nl, b10 = rQ(); + return null !== a10 && a10 === b10 ? new z42().gE(this.l, this.X, this.yb, this.m).Cc() : new w6a().gE(this.l, this.X, this.yb, this.m).Cc(); + }; + d7.gE = function(a10, b10, c10, e10) { + this.X = b10; + this.yb = c10; + this.m = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$RequestParser", { xUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function sR() { + K22.call(this); + this.je = this.RT = null; + } + sR.prototype = new HYa(); + sR.prototype.constructor = sR; + function B6a() { + } + d7 = B6a.prototype = sR.prototype; + d7.fK = function() { + var a10 = tA(uA(), Au(), this.RT.fa()), b10 = this.RT; + if (b10 instanceof vl) { + var c10 = new C6a(); + c10.jv = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Dka()); + c10.Qc = new E32().h1(ar(b10.g, Jk().nb), a10, this.Lj()).Pa(); + var e10 = c10; + } else if (b10 instanceof ql) + e10 = D6a(this, b10, a10); + else if (b10 instanceof zl) { + var f10 = this.Lj().hj(); + c10 = new E6a(); + c10.w2 = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Gka()); + b10 = iy(new jy(), ar(b10.g, Jk().nb).Nz(), a10, false, Rb(Ut(), H10()), f10).Pa(); + f10 = new C42(); + var g10 = K7(); + c10.Qc = b10.ec( + f10, + g10.u + ); + e10 = c10; + } else if (b10 instanceof Dl) { + f10 = this.Lj().hj(); + c10 = new F6a(); + c10.s3 = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Hka()); + b10 = iy(new jy(), ar(b10.g, Jk().nb).Nz(), a10, false, Rb(Ut(), H10()), f10).Pa(); + f10 = new D42(); + g10 = K7(); + c10.Qc = b10.ec(f10, g10.u); + e10 = c10; + } else if (b10 instanceof ol) { + c10 = new G6a(); + c10.Ri = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Ika()); + b10 = this.Lj().zf.MN().ug(ar(b10.g, Jk().nb), a10).vT(); + if (b10 instanceof ve4) + b10 = b10.i; + else if (b10 instanceof ye4) + f10 = b10.i, b10 = K7(), f10 = [ky("type", f10, Q5().Na, ld())], b10 = J5(b10, new Ib().ha(f10)); + else + throw new x7().d(b10); + c10.Qc = b10; + e10 = c10; + } else if (b10 instanceof Bl) { + c10 = new H6a(); + c10.Qf = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Jka()); + f10 = ar(b10.g, Jk().nb); + wna || (wna = new $z().a()); + b10 = B6(ar(b10.g, Jk().nb).g, Xh().Hf).A; + c10.Qc = new I32().vU(f10, qna(b10.b() ? null : b10.c()), a10, this.Lj()).Pa(); + e10 = c10; + } else { + if (!(b10 instanceof xl)) + throw new Lu().e("Unsupported fragment type"); + c10 = new I6a(); + c10.P1 = b10; + c10.p = a10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + c10.Xg = A42(new B42(), this, Fka()); + f10 = K7(); + b10 = [new E42().bA(ar(b10.g, Jk().nb), a10, this.Lj())]; + c10.Qc = J5(f10, new Ib().ha(b10)); + e10 = c10; + } + a10 = IYa(this, this.RT, a10); + b10 = hd(this.RT.Y(), Bq().ae); + if (b10.b()) + var h10 = y7(); + else + b10 = b10.c(), h10 = new z7().d($g(new ah(), jx(new je4().e("usage")), b10, y7())); + b10 = OA(); + c10 = new PA().e(b10.pi); + f10 = new qg().e(b10.mi); + tc(f10) && QA(c10, b10.mi); + f10 = c10.s; + g10 = c10.ca; + var k10 = new rr().e(g10), l10 = wr(), m10 = J5(K7(), new Ib().ha([e10.Xg])); + e10 = e10.Pa(); + var p10 = K7(); + e10 = m10.ia(e10, p10.u); + h10 = h10.ua(); + m10 = K7(); + e10 = e10.ia(h10, m10.u); + h10 = K7(); + jr(l10, e10.yg(a10, h10.u), k10); + pr(f10, mr(T6(), tr(ur(), k10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), b10.pi), c10.s); + }; + d7.Rea = function(a10) { + UUa(a10, "swagger", mr(T6(), nr(or(), "2.0"), Q5().Na)); + }; + d7.U$ = function(a10, b10) { + this.RT = a10; + this.je = b10; + K22.prototype.FK.call(this, a10, b10); + return this; + }; + d7.Lj = function() { + return this.je; + }; + d7.$classData = r8({ uha: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter", { uha: 1, m7: 1, UR: 1, f: 1, QR: 1, SY: 1 }); + function J6a() { + this.l = this.X = null; + } + J6a.prototype = new u7(); + J6a.prototype.constructor = J6a; + d7 = J6a.prototype; + d7.H = function() { + return "AnnotationFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof J6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.Aca = function() { + O7(); + var a10 = new P6().a(); + a10 = new ol().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = EQa(new kY(), this.l, this.X, "annotation", this.X, w6(/* @__PURE__ */ function(e10) { + return function(f10) { + l6a(f10, e10.l.ee.da + "#/", J5(K7(), H10())); + }; + }(this))).AH(); + var c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ JUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$AnnotationFragmentParser", { JUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function K6a() { + this.l = this.X = null; + } + K6a.prototype = new u7(); + K6a.prototype.constructor = K6a; + d7 = K6a.prototype; + d7.H = function() { + return "DataTypeFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof K6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Bca = function() { + O7(); + var a10 = new P6().a(); + a10 = new ql().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + ur(); + b10 = this.X.sb.Cb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + if (null === f10) + return true; + f10 = new Qg().Vb(f10.Aa, e10.l.ra).Zf().t(); + var g10 = Eka().la; + return f10 !== g10 ? (g10 = lx().h3, f10 !== g10) : false; + }; + }(this))); + b10 = tr(0, b10, this.X.da.Rf); + pX(); + T6(); + T6(); + b10 = mr(T6(), b10, Q5().sa); + b10 = aPa(0, b10, "type", w6(/* @__PURE__ */ function(e10) { + return function(f10) { + Rd(f10, e10.l.ee.da + "#/shape"); + }; + }(this)), new hX().$G("schema", this.l.ra), this.l.ra).Cc(); + if (!b10.b()) { + b10 = b10.c(); + var c10 = Jk().nb; + new z7().d(Vd( + a10, + c10, + b10 + )); + } + return a10; + }; + d7.$classData = r8({ KUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$DataTypeFragmentParser", { KUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function L6a() { + this.l = this.X = null; + } + L6a.prototype = new u7(); + L6a.prototype.constructor = L6a; + d7 = L6a.prototype; + d7.H = function() { + return "DocumentationItemFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.Cca = function() { + O7(); + var a10 = new P6().a(); + a10 = new vl().K(new S6().a(), a10); + var b10 = this.l.ee.da + "#/"; + J5(K7(), H10()); + a10 = Ai(a10, b10); + T6(); + b10 = this.X; + T6(); + b10 = YOa(new jX(), mr(T6(), b10, Q5().sa), a10.j, this.l.ra).BH(); + var c10 = Jk().nb; + Vd(a10, c10, b10); + return a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof L6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ LUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$DocumentationItemFragmentParser", { LUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function M6a() { + this.l = this.X = null; + } + M6a.prototype = new u7(); + M6a.prototype.constructor = M6a; + d7 = M6a.prototype; + d7.H = function() { + return "NamedExampleFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof M6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function N6a(a10) { + var b10 = a10.X.sb.Cb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.Aa; + var h10 = IO(); + return N6(g10, h10, f10.l.ra).va !== jx(new je4().e("fragmentType")); + }; + }(a10))); + O7(); + var c10 = new P6().a(); + c10 = new xl().K(new S6().a(), c10); + var e10 = a10.l.ee.da + "#/"; + J5(K7(), H10()); + c10 = Ai(c10, e10); + e10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + O7(); + var k10 = new P6().a(), l10 = new S6().a(); + k10 = new en().K(l10, k10); + h10.b() || (h10 = h10.c(), O7(), l10 = new P6().a(), Sd(k10, h10, l10)); + h10 = Jk().nb; + Vd(g10, h10, k10); + return k10; + }; + }(a10, c10)); + a10 = N5a(b10.ga(), e10, new EP().GB(true, true, false), a10.l.ra).Xw(); + b10 = Jk().nb; + return Vd(c10, b10, a10); + } + d7.$classData = r8({ MUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$NamedExampleFragmentParser", { MUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function O6a() { + this.l = this.X = null; + } + O6a.prototype = new u7(); + O6a.prototype.constructor = O6a; + d7 = O6a.prototype; + d7.H = function() { + return "ResourceTypeFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof O6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Dca = function() { + O7(); + var a10 = new P6().a(); + a10 = new zl().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = dD(eD(), this.X).pc(a10.j + "#/"); + var c10 = a10.j; + T6(); + var e10 = this.X; + T6(); + b10 = P2a(MOa(new aX(), b10, c10, "resourceType", mr(T6(), e10, Q5().sa), this.l.ra)); + c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.$classData = r8({ NUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$ResourceTypeFragmentParser", { NUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function P6a() { + this.l = this.X = null; + } + P6a.prototype = new u7(); + P6a.prototype.constructor = P6a; + d7 = P6a.prototype; + d7.H = function() { + return "SecuritySchemeFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof P6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Eca = function() { + O7(); + var a10 = new P6().a(); + a10 = new Bl().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + T6(); + b10 = this.X; + T6(); + b10 = new vz().QO(mr(T6(), b10, Q5().sa), w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return Yh(f10, e10.l.ee.da + "#/", J5(K7(), H10())); + }; + }(this)), this.l.ra).FH(); + var c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ OUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$SecuritySchemeFragmentParser", { OUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Q6a() { + this.l = this.X = null; + } + Q6a.prototype = new u7(); + Q6a.prototype.constructor = Q6a; + d7 = Q6a.prototype; + d7.H = function() { + return "TraitFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Q6a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.Ew = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Fca = function() { + O7(); + var a10 = new P6().a(); + a10 = new Dl().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = gD(hD(), this.X).pc(a10.j + "#/"); + var c10 = a10.j; + T6(); + var e10 = this.X; + T6(); + b10 = P2a(MOa(new aX(), b10, c10, "trait", mr(T6(), e10, Q5().sa), this.l.ra)); + c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.$classData = r8({ PUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser$TraitFragmentParser", { PUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function fA() { + this.Id = null; + this.$O = false; + } + fA.prototype = new u7(); + fA.prototype.constructor = fA; + function R6a() { + } + d7 = R6a.prototype = fA.prototype; + d7.H = function() { + return "OasSecuritySchemeType"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof fA ? this.Id === a10.Id && this.$O === a10.$O : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Id; + case 1: + return this.$O; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Id)); + a10 = OJ().Ga(a10, this.$O ? 1231 : 1237); + return OJ().fe(a10, 2); + }; + d7.UO = function(a10, b10) { + this.Id = a10; + this.$O = b10; + return this; + }; + d7.$classData = r8({ kN: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeType", { kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function kY() { + this.l = this.yb = this.X = this.sr = this.ad = null; + } + kY.prototype = new u7(); + kY.prototype.constructor = kY; + d7 = kY.prototype; + d7.H = function() { + return "AnnotationTypesParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kY && a10.l === this.l) { + var b10 = this.ad, c10 = a10.ad; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.sr === a10.sr && Bj(this.X, a10.X)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function EQa(a10, b10, c10, e10, f10, g10) { + a10.ad = c10; + a10.sr = e10; + a10.X = f10; + a10.yb = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + case 1: + return this.sr; + case 2: + return this.X; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.AH = function() { + var a10 = PLa(RLa(), this.ad), b10 = this.sr; + O7(); + var c10 = new P6().a(); + Sd(a10, b10, c10); + this.yb.P(a10); + b10 = ac(new M6().W(this.X), "allowedTargets"); + if (!b10.b()) { + c10 = b10.c(); + b10 = Od(O7(), c10); + var e10 = c10.i.re(); + if (e10 instanceof xt) + b10.Lb(new W1().a()), e10 = K7(), c10 = [new Qg().Vb(c10.i, this.l.Sn).Zf()], c10 = Zr(new $r(), J5(e10, new Ib().ha(c10)), new P6().a()); + else { + if (!(e10 instanceof Sx)) + throw new x7().d(e10); + T6(); + T6(); + c10 = mr(T6(), e10, Q5().cd); + c10 = PAa(new Tx().Vb(c10, this.l.Sn)); + } + c10 = c10.wb; + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + if (g10 instanceof jh) { + var h10 = Zx().$ca.Ja(g10.t()); + if (h10 instanceof z7) + return ih(new jh(), h10.i, g10.x); + if (y7() === h10) + return g10; + throw new x7().d(h10); + } + return ih(new jh(), g10.t(), g10.fa()); + }; + }(this)); + var f10 = K7(); + e10 = c10.ka(e10, f10.u); + c10 = Sk().DF; + e10 = Zr(new $r(), e10, new P6().a()); + Rg(a10, c10, e10, b10); + } + b10 = ac(new M6().W(this.X), "displayName"); + b10.b() || (c10 = b10.c(), e10 = new Qg().Vb(c10.i, this.l.Sn), b10 = Sk().Zc, e10 = e10.nf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10)); + b10 = ac(new M6().W(this.X), "description"); + b10.b() || (c10 = b10.c(), e10 = new Qg().Vb(c10.i, this.l.Sn), b10 = Sk().Va, e10 = e10.nf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10)); + b10 = ac(new M6().W(this.X), "schema"); + b10.b() || (b10 = b10.c(), c10 = oX(pX(), b10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10.ub(h10.j, lt2()); + }; + }(this, a10)), this.l.Sn).Cc(), c10.b() || (c10 = c10.c(), HC(EC(), c10, a10.j, y7()), e10 = Sk().Jc, b10 = Od(O7(), b10), Rg(a10, e10, c10, b10))); + Ry(new Sy(), a10, this.X, H10(), this.l.Sn).hd(); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ eVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecParser$AnnotationTypesParser", { eVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function jY() { + this.l = this.yb = this.Qr = this.sr = this.ad = null; + } + jY.prototype = new u7(); + jY.prototype.constructor = jY; + d7 = jY.prototype; + d7.H = function() { + return "LinkedAnnotationTypeParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jY && a10.l === this.l) { + var b10 = this.ad, c10 = a10.ad; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.sr === a10.sr && Bj(this.Qr, a10.Qr)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + case 1: + return this.sr; + case 2: + return this.Qr; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function DQa(a10, b10, c10, e10, f10, g10) { + a10.ad = c10; + a10.sr = e10; + a10.Qr = f10; + a10.yb = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.AH = function() { + var a10 = sha(this.l.Sn.Qh, this.Qr.va); + if (a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + var b10 = this.Qr.va, c10 = Od(O7(), this.ad); + a10 = kM(a10, b10, c10); + a10.j = null; + b10 = this.yb; + c10 = this.sr; + O7(); + var e10 = new P6().a(); + b10.P(Sd(a10, c10, e10)); + a10 = new z7().d(a10); + } + if (a10.b()) { + O7(); + a10 = new P6().a(); + a10 = new Pd().K(new S6().a(), a10); + b10 = this.sr; + O7(); + c10 = new P6().a(); + a10 = Sd(a10, b10, c10); + this.yb.P(a10); + b10 = this.l.Sn; + c10 = dc().UC; + e10 = a10.j; + var f10 = this.Qr, g10 = y7(); + ec(b10, c10, e10, g10, "Could not find declared annotation link in references", f10.da); + return a10; + } + return a10.c(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ gVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecParser$LinkedAnnotationTypeParser", { gVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function S6a() { + this.l = this.wf = this.X = null; + } + S6a.prototype = new u7(); + S6a.prototype.constructor = S6a; + d7 = S6a.prototype; + d7.H = function() { + return "UsageParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof S6a && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.wf; + a10 = a10.wf; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.wf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.hd = function() { + var a10 = new M6().W(this.X), b10 = jx(new je4().e("usage")); + a10 = ac(a10, b10); + if (!a10.b()) { + var c10 = a10.c(), e10 = new Qg().Vb(c10.i, this.l.Sn); + a10 = this.wf; + b10 = Bq().ae; + e10 = e10.nf(); + c10 = Od(O7(), c10); + Rg(a10, b10, e10, c10); + } + }; + d7.z = function() { + return X5(this); + }; + function h6a(a10, b10, c10) { + var e10 = new S6a(); + e10.X = b10; + e10.wf = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.$classData = r8({ hVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecParser$UsageParser", { hVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function o6a() { + this.l = this.Ks = null; + } + o6a.prototype = new u7(); + o6a.prototype.constructor = o6a; + d7 = o6a.prototype; + d7.H = function() { + return "UserDocumentationParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o6a && a10.l === this.l) { + var b10 = this.Ks; + a10 = a10.Ks; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ks; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = this.Ks, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = f10.hb().gb; + if (Q5().sa === g10) + return new F42().pv(f10, e10.l.Sn).BH(); + if (Q5().Na === g10) { + g10 = bc(); + g10 = N6(f10, g10, e10.l.Sn).va; + var h10 = kFa(e10.l.Sn.Qh, g10, Xs(), y7()); + if (h10 instanceof z7) + return h10 = h10.i, f10 = Od(O7(), f10), kM(h10, g10, f10); + T6(); + g10 = ur().ce; + g10 = new F42().pv(mr(T6(), g10, Q5().sa), e10.l.Sn).BH(); + h10 = e10.l.Sn; + var k10 = dc().UC, l10 = g10.j, m10 = "not supported scalar " + f10 + ".text for documentation item", p10 = y7(); + ec(h10, k10, l10, p10, m10, f10.da); + return g10; + } + throw new x7().d(g10); + }; + }(this)), c10 = K7(); + return a10.ka(b10, c10.u); + }; + function n6a(a10, b10, c10) { + a10.Ks = c10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ iVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecParser$UserDocumentationParser", { iVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function T6a() { + this.N = this.p = this.Ba = null; + } + T6a.prototype = new u7(); + T6a.prototype.constructor = T6a; + d7 = T6a.prototype; + d7.H = function() { + return "OasUserDocumentationsEmitter"; + }; + d7.E = function() { + return 2; + }; + function $5a(a10, b10, c10) { + var e10 = new T6a(); + e10.Ba = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof T6a) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ba.r.r.wb; + var b10 = new U6a(); + var c10 = K7(); + c10 = a10.ec(b10, c10.u).ua(); + b10 = false; + a10 = null; + if (c10 instanceof Vt) { + b10 = true; + a10 = c10; + c10 = a10.Wn; + var e10 = a10.Nf; + if (H10().h(e10)) + return J5(K7(), new Ib().ha([ly("externalDocs", c10, this.p, this.N)])); + } + return b10 ? (b10 = a10.Wn, a10 = a10.Nf, J5(K7(), new Ib().ha([ly("externalDocs", b10, this.p, this.N), new V6a().CU(a10, this.p, this.N)]))) : H10(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ jVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasUserDocumentationsEmitter", { jVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function bB() { + this.GP = this.Hu = null; + } + bB.prototype = new u7(); + bB.prototype.constructor = bB; + d7 = bB.prototype; + d7.H = function() { + return "ParsingResult"; + }; + d7.E = function() { + return 2; + }; + d7.WO = function(a10, b10) { + this.Hu = a10; + this.GP = b10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bB) { + var b10 = this.Hu, c10 = a10.Hu; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.GP, a10 = a10.GP, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Hu; + case 1: + return this.GP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ParsingResult", { uVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function G42() { + this.N = this.Hl = null; + } + G42.prototype = new u7(); + G42.prototype.constructor = G42; + d7 = G42.prototype; + d7.H = function() { + return "RamlDocumentEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G42) { + var b10 = this.Hl; + a10 = a10.Hl; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Hl; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function W6a(a10, b10, c10) { + a10.Hl = b10; + a10.N = c10; + return a10; + } + d7.sB = function() { + var a10 = this.Hl, b10 = tA(uA(), Ob(), a10.qe().fa()); + a10 = this.N.zf.sda().ug(a10, b10).Pa(); + var c10 = this.Hl; + if (c10 instanceof mf) + var e10 = c10.qe(); + else + throw mb(E6(), new nb().e("BaseUnit doesn't encode a WebApi.")); + c10 = Ab(e10.x, q5(rU)); + if (c10.b()) + var f10 = y7(); + else + c10 = c10.c(), f10 = new z7().d(c10.Se); + c10 = new X6a(); + var g10 = f10, h10 = this.Hl.Ve(); + f10 = this.N; + c10.qo = e10; + c10.p = b10; + c10.Se = g10; + c10.Q = h10; + c10.N = f10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + h10 = e10.g; + g10 = J5(Ef(), H10()); + var k10 = hd(h10, Qm().R); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, Yg(Zg(), "title", k10, y7(), c10.N)))); + k10 = hd(h10, Qm().lh); + k10.b() || (k10 = k10.c(), new z7().d(ws(g10, new V5a().JK(k10, c10.p, c10.Q, c10.N).Pa()))); + k10 = hd(h10, Qm().Va); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, Yg(Zg(), "description", k10, y7(), c10.N)))); + k10 = hd(h10, Qm().yl); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, $x("mediaType", k10, c10.p, false)))); + k10 = hd(h10, Qm().Ym); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, Yg(Zg(), "version", k10, y7(), c10.N)))); + k10 = hd(h10, Qm().XF); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, $g(new ah(), fh(new je4().e("termsOfService")), k10, y7())))); + k10 = hd(h10, Qm().Gh); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, $x("protocols", k10, c10.p, false)))); + k10 = hd(h10, Qm().SF); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, new Y6a().paa(c10.l, fh(new je4().e("contact")), k10, c10.p)))); + k10 = hd(h10, Qm().Xm); + if (!k10.b()) { + k10 = k10.c(); + var l10 = fh(new je4().e("tags")), m10 = c10.N; + new z7().d(Dg(g10, new s42().eA(l10, k10.r.r.wb, c10.p, new YV().Ti(m10.Bc, m10.oy, new Yf().a())))); + } + k10 = hd(h10, Qm().Uv); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, Z6a(k10, c10.p, c10.N)))); + k10 = hd(h10, Qm().OF); + k10.b() || (k10 = k10.c(), new z7().d(Dg(g10, new $6a().paa(c10.l, fh(new je4().e("license")), k10, c10.p)))); + k10 = hd(h10, Qm().Yp); + k10.b() || (k10 = k10.c(), new z7().d(ws(g10, a7a(c10, k10, c10.p, c10.Se)))); + ws(g10, ay(e10, b10, f10).Pa()); + e10 = hd(h10, Qm().dc); + e10.b() || (e10 = e10.c(), new z7().d(Dg(g10, new VX().hE("securedBy", e10, c10.p, c10.N)))); + c10.Qc = b10.zb(g10); + c10 = c10.Qc; + e10 = K7(); + a10 = a10.ia(c10, e10.u); + c10 = OA(); + e10 = new PA().e(c10.pi); + f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + f10 = this.N.zf.Loa(this.Hl); + f10.b() || (f10 = f10.c(), QA(e10, f10)); + f10 = e10.s; + g10 = e10.ca; + h10 = new rr().e(g10); + jr(wr(), b10.zb(a10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), c10.pi), e10.s); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlDocumentEmitter", { DVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function X6a() { + this.l = this.Qc = this.N = this.Q = this.Se = this.p = this.qo = null; + } + X6a.prototype = new u7(); + X6a.prototype.constructor = X6a; + d7 = X6a.prototype; + d7.H = function() { + return "WebApiEmitter"; + }; + d7.E = function() { + return 4; + }; + function b7a(a10, b10) { + return b10.nk(c7a(a10)); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof X6a && a10.l === this.l) { + var b10 = this.qo, c10 = a10.qo; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Se, c10 = a10.Se, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.qo; + case 1: + return this.p; + case 2: + return this.Se; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function a7a(a10, b10, c10, e10) { + b10 = b10.r.r.wb; + if (e10.Ha(Au())) + return a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return g10.N.zf.j$().du(k10, h10, J5(Ef(), H10()), g10.Q); + }; + }(a10, c10)), c10 = K7(), b10.ka(a10, c10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = UX(g10).ua(), k10 = qe2(); + k10 = re4(k10); + return new R6().M(g10, qt(h10, k10)); + }; + }(a10)); + var f10 = K7(); + e10 = b10.ka(e10, f10.u).Ch(Gb().si); + b10 = Rb(Qr(), H10()); + vja || (vja = new Qv().a()); + e10 = uja(e10); + e10 instanceof ye4 && e10.i.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = g10.N.zf.j$().du(l10, h10, J5(Ef(), H10()), g10.Q), p10 = UX(l10); + p10 instanceof z7 && (p10 = iba(k10, p10.i), Dg(p10.Xf, m10)); + return Or( + k10, + new R6().M(l10, m10) + ); + }; + }(a10, c10, b10))); + c10 = new H42().u1(b10, w6(/* @__PURE__ */ function() { + return function(g10) { + return UX(g10).b(); + }; + }(a10))); + c10 = new Fc().Vd(c10); + return b7a(a10, c10.Sb.Ye().Dd()); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ GVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlDocumentEmitter$WebApiEmitter", { GVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function d7a() { + this.l = this.X = null; + } + d7a.prototype = new u7(); + d7a.prototype.constructor = d7a; + d7 = d7a.prototype; + d7.H = function() { + return "AnnotationFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof d7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.Aca = function() { + O7(); + var a10 = new P6().a(); + a10 = new ol().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = QYa(new O22(), this.l, this.X, "annotation", this.X, w6(/* @__PURE__ */ function(e10) { + return function(f10) { + l6a(f10, e10.l.ee.da + "#/", J5(K7(), H10())); + }; + }(this))).AH(); + var c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ TVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$AnnotationFragmentParser", { TVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function e7a() { + this.l = this.X = null; + } + e7a.prototype = new u7(); + e7a.prototype.constructor = e7a; + d7 = e7a.prototype; + d7.H = function() { + return "DataTypeFragmentParser"; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof e7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Bca = function() { + O7(); + var a10 = new P6().a(); + a10 = new ql().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + QW(); + T6(); + b10 = this.X; + T6(); + b10 = jPa(mr(T6(), b10, Q5().sa), "type", w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return Rd(f10, e10.l.ee.da + "#/shape"); + }; + }(this)), QP(), this.l.ra).Cc(); + if (!b10.b()) { + b10 = b10.c(); + var c10 = Jk().nb; + Vd(a10, c10, b10); + } + return a10; + }; + d7.$classData = r8({ UVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$DataTypeFragmentParser", { UVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function f7a() { + this.l = this.X = null; + } + f7a.prototype = new u7(); + f7a.prototype.constructor = f7a; + d7 = f7a.prototype; + d7.H = function() { + return "DocumentationItemFragmentParser"; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.Cca = function() { + O7(); + var a10 = new P6().a(); + a10 = new vl().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + T6(); + b10 = this.X; + T6(); + b10 = new F42().pv(mr(T6(), b10, Q5().sa), this.l.ra).BH(); + var c10 = Jk().nb; + Vd(a10, c10, b10); + return a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof f7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ VVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$DocumentationItemFragmentParser", { VVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function g7a() { + this.l = this.X = null; + } + g7a.prototype = new u7(); + g7a.prototype.constructor = g7a; + d7 = g7a.prototype; + d7.H = function() { + return "NamedExampleFragmentParser"; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof g7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$NamedExampleFragmentParser", { WVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function h7a() { + this.l = this.X = null; + } + h7a.prototype = new u7(); + h7a.prototype.constructor = h7a; + d7 = h7a.prototype; + d7.H = function() { + return "ResourceTypeFragmentParser"; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof h7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Dca = function() { + O7(); + var a10 = new P6().a(); + a10 = new zl().K(new S6().a(), a10); + var b10 = this.l.ee.da + "#"; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = dD(eD(), this.X).pc(a10.j); + var c10 = a10.j; + T6(); + var e10 = this.X; + T6(); + b10 = P2a(MOa(new aX(), b10, c10, "resourceType", mr(T6(), e10, Q5().sa), this.l.ra)); + c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.$classData = r8({ XVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$ResourceTypeFragmentParser", { XVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function i7a() { + this.l = this.X = null; + } + i7a.prototype = new u7(); + i7a.prototype.constructor = i7a; + d7 = i7a.prototype; + d7.H = function() { + return "SecuritySchemeFragmentParser"; + }; + d7.E = function() { + return 1; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof i7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Eca = function() { + O7(); + var a10 = new P6().a(); + a10 = new Bl().K(new S6().a(), a10); + var b10 = this.l.ee.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = this.X; + T6(); + var c10 = this.X; + T6(); + b10 = Mma(new sz(), b10, "securityDefinitions", mr(T6(), c10, Q5().sa), Uc(/* @__PURE__ */ function(e10) { + return function(f10) { + return Yh(f10, e10.l.ee.da + "#/", J5(K7(), H10())); + }; + }(this)), this.l.ra).FH(); + c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$SecuritySchemeFragmentParser", { YVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function j7a() { + this.l = this.X = null; + } + j7a.prototype = new u7(); + j7a.prototype.constructor = j7a; + d7 = j7a.prototype; + d7.H = function() { + return "TraitFragmentParser"; + }; + d7.Fw = function(a10, b10) { + this.X = b10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof j7a && a10.l === this.l ? Bj(this.X, a10.X) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Fca = function() { + O7(); + var a10 = new P6().a(); + a10 = new Dl().K(new S6().a(), a10); + var b10 = this.l.ee.da + "#"; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = gD(hD(), this.X).pc(a10.j); + var c10 = a10.j; + T6(); + var e10 = this.X; + T6(); + b10 = P2a(MOa(new aX(), b10, c10, "trait", mr(T6(), e10, Q5().sa), this.l.ra)); + c10 = Jk().nb; + return Vd(a10, c10, b10); + }; + d7.$classData = r8({ ZVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser$TraitFragmentParser", { ZVa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function k7a() { + this.N = this.nP = null; + } + k7a.prototype = new u7(); + k7a.prototype.constructor = k7a; + d7 = k7a.prototype; + d7.H = function() { + return "RamlModuleEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k7a) { + var b10 = this.nP; + a10 = a10.nP; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.r0 = function() { + var a10 = tA(uA(), Ob(), this.nP.x), b10 = this.N.zf.sda().ug(this.nP, a10).Pa(), c10 = OA(), e10 = new PA().e(c10.pi), f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + QA(e10, BOa().Id); + if (b10.Da()) { + f10 = e10.s; + var g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), a10.zb(b10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + return new RA().Ac(SA(zs(), c10.pi), e10.s); + }; + function l7a(a10, b10, c10) { + a10.nP = b10; + a10.N = c10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $Va: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlModuleEmitter", { $Va: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function O22() { + this.l = this.yb = this.X = this.sr = this.ad = null; + } + O22.prototype = new u7(); + O22.prototype.constructor = O22; + d7 = O22.prototype; + d7.H = function() { + return "AnnotationTypesParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof O22 && a10.l === this.l) { + var b10 = this.ad, c10 = a10.ad; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.sr === a10.sr && Bj(this.X, a10.X)) + return b10 = this.yb, a10 = a10.yb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + case 1: + return this.sr; + case 2: + return this.X; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function QYa(a10, b10, c10, e10, f10, g10) { + a10.ad = c10; + a10.sr = e10; + a10.X = f10; + a10.yb = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.AH = function() { + var a10 = PLa(RLa(), this.ad), b10 = this.sr; + O7(); + var c10 = new P6().a(); + Sd(a10, b10, c10); + this.yb.P(a10); + b10 = this.ad; + b10 = b10 instanceof Es ? new z7().d(b10) : b10 instanceof vw ? new z7().d(pG(wD(), mh(T6(), "annotationType"), (T6(), mr(T6(), b10, Q5().sa)))) : y7(); + if (b10 instanceof z7) { + b10 = b10.i; + b10 = PW(QW(), b10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + O7(); + var p10 = new P6().a(); + m10 = Sd(m10, "schema", p10); + p10 = l10.j; + var t10 = lt2(); + return m10.ub(p10, t10); + }; + }(this, a10)), RW(true, false), QP(), this.l.po).Cc(); + if (!b10.b()) { + b10 = b10.c(); + HC(EC(), b10, a10.j, y7()); + c10 = Sk().Jc; + var e10 = Od(O7(), this.ad); + Rg(a10, c10, b10, e10); + } + b10 = ac( + new M6().W(this.X), + "allowedTargets" + ); + if (!b10.b()) { + c10 = b10.c(); + b10 = Od(O7(), c10); + e10 = c10.i.hb().gb; + if (Q5().cd === e10) + c10 = VAa(new Tx().Vb(c10.i, this.l.po)); + else if (Q5().sa === e10) { + e10 = this.l.po; + var f10 = sg().Y5, g10 = a10.j; + c10 = c10.i; + var h10 = y7(); + ec(e10, f10, g10, h10, "Property 'allowedTargets' in a RAML annotation can only be a valid scalar or an array of valid scalars", c10.da); + c10 = Zr(new $r(), J5(K7(), H10()), new P6().a()); + } else + b10.Lb(new W1().a()), e10 = K7(), c10 = [new Qg().Vb(c10.i, this.l.po).nf()], c10 = Zr(new $r(), J5(e10, new Ib().ha(c10)), new P6().a()); + c10 = c10.wb; + e10 = w6(/* @__PURE__ */ function() { + return function(k10) { + if (k10 instanceof jh) { + var l10 = Zx().$ca.Ja(k10.t()); + if (l10 instanceof z7) + return ih(new jh(), l10.i, k10.x); + if (y7() === l10) + return k10; + throw new x7().d(l10); + } + return ih(new jh(), k10.t(), k10.fa()); + }; + }(this)); + f10 = K7(); + e10 = c10.ka(e10, f10.u); + c10 = Sk().DF; + e10 = Zr(new $r(), e10, new P6().a()); + Rg(a10, c10, e10, b10); + } + b10 = ac(new M6().W(this.X), "description"); + b10.b() || (c10 = b10.c(), e10 = new Qg().Vb(c10.i, this.l.po), b10 = Sk().Va, e10 = e10.nf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10)); + Ry(new Sy(), a10, this.X, H10(), this.l.po).hd(); + return a10; + } + if (y7() === b10) + return b10 = this.l.po, c10 = sg().aN, e10 = a10.j, f10 = this.ad, g10 = y7(), ec( + b10, + c10, + e10, + g10, + "Cannot parse annotation type fragment, cannot find information map", + f10.da + ), a10; + throw new x7().d(b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ cWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlSpecParser$AnnotationTypesParser", { cWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function m7a() { + this.l = this.wf = this.X = null; + } + m7a.prototype = new u7(); + m7a.prototype.constructor = m7a; + d7 = m7a.prototype; + d7.H = function() { + return "UsageParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof m7a && a10.l === this.l && Bj(this.X, a10.X)) { + var b10 = this.wf; + a10 = a10.wf; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.wf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function n7a(a10, b10, c10) { + var e10 = new m7a(); + e10.X = b10; + e10.wf = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.hd = function() { + var a10 = ac(new M6().W(this.X), "usage"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i.hb().gb; + if (Q5().Na === b10) { + var c10 = new Qg().Vb(a10.i, this.l.po); + b10 = this.wf; + var e10 = Bq().ae; + c10 = c10.nf(); + a10 = Od(O7(), a10); + Rg(b10, e10, c10, a10); + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ eWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlSpecParser$UsageParser", { eWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function o7a() { + this.l = this.Wd = this.Ph = this.Ks = null; + } + o7a.prototype = new u7(); + o7a.prototype.constructor = o7a; + d7 = o7a.prototype; + d7.H = function() { + return "UserDocumentationsParser"; + }; + d7.E = function() { + return 3; + }; + function p7a(a10, b10, c10, e10, f10) { + a10.Ks = c10; + a10.Ph = e10; + a10.Wd = f10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o7a && a10.l === this.l) { + var b10 = this.Ks, c10 = a10.Ks; + return (null === b10 ? null === c10 : b10.h(c10)) && this.Ph === a10.Ph ? this.Wd === a10.Wd : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ks; + case 1: + return this.Ph; + case 2: + return this.Wd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vg = function() { + var a10 = J5(Ef(), H10()); + this.Ks.U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + var f10 = e10.hb().gb; + if (Q5().sa === f10) + return Dg(c10, new F42().pv(e10, b10.l.po).BH()); + if (Q5().cd === f10) { + f10 = b10.l.po; + var g10 = sg().f6, h10 = b10.Wd, k10 = y7(); + ec(f10, g10, h10, k10, "Unexpected sequence. Options are object or scalar ", e10.da); + } else { + f10 = bc(); + e10 = N6(e10, f10, b10.l.po); + f10 = kFa(b10.Ph, e10.va, Ys(), new z7().d(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = m10.l.po, A10 = sg().Oy, D10 = y7(); + ec(v10, A10, "", D10, t10, p10.da); + }; + }(b10, e10)))); + if (f10 instanceof z7) + return f10 = f10.i, e10 = e10.va, O7(), g10 = new P6().a(), Dg(c10, kM(f10, e10, g10)); + f10 = b10.l.po; + g10 = dc().UC; + h10 = b10.Wd; + k10 = "not supported scalar " + e10.va + " for documentation"; + var l10 = y7(); + ec(f10, g10, h10, l10, k10, e10.da); + } + }; + }(this, a10))); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ fWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlSpecParser$UserDocumentationsParser", { fWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function I42() { + this.SJ = null; + } + I42.prototype = new u7(); + I42.prototype.constructor = I42; + d7 = I42.prototype; + d7.H = function() { + return "BranchContainer"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof I42) { + var b10 = this.SJ; + a10 = a10.SJ; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.SJ; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function q7a(a10, b10, c10, e10) { + a: + for (; ; ) { + var f10 = J5(Ef(), H10()); + e10.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + l10.Xf.Cb(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return p10.iz(t10.la); + }; + }(g10, h10))).U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return Dg(p10, t10); + }; + }(g10, k10))); + }; + }(a10, b10, f10))); + Dg(c10, f10); + if (f10.Da()) { + e10 = f10; + continue a; + } + break; + } + } + function bRa(a10) { + var b10 = J5(DB(), H10()), c10 = J5(Ef(), H10()); + Dg(c10, a10.SJ); + var e10 = a10.SJ, f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.la; + }; + }(a10)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + yi(b10, e10); + q7a(a10, b10, c10, a10.SJ); + a10 = J5(K7(), H10()); + for (c10 = c10.Dc; !c10.b(); ) + b10 = c10.ga(), e10 = K7(), a10 = a10.ia(b10, e10.u), c10 = c10.ta(); + return a10; + } + d7.ts = function(a10) { + this.SJ = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WWa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.BranchContainer", { WWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function zY() { + this.fr = this.oi = null; + } + zY.prototype = new u7(); + zY.prototype.constructor = zY; + d7 = zY.prototype; + d7.H = function() { + return "Context"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zY) { + var b10 = this.oi, c10 = a10.oi; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.fr, a10 = a10.fr, null === b10 ? null === a10 : r7a(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.oi; + case 1: + return this.fr; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function PQa(a10, b10, c10) { + var e10 = a10.fr; + vs(); + var f10 = y7(); + b10 = e10.Zj(new o32().Haa(b10, ts(0, c10, f10, (O7(), new P6().a())))); + return QQa(new zY(), a10.oi, b10); + } + function QQa(a10, b10, c10) { + a10.oi = b10; + a10.fr = c10; + return a10; + } + function kRa(a10, b10) { + var c10 = a10.fr, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + var h10 = B6(g10.g, gl().R).A; + return new o32().Haa(h10.b() ? null : h10.c(), B6(g10.g, gl().vf)); + }; + }(a10)), f10 = K7(); + b10 = c10.Lk(b10.ka(e10, f10.u)); + return QQa(new zY(), a10.oi, b10); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YWa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.Context", { YWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function s7a() { + this.l = this.Dka = null; + } + s7a.prototype = new u7(); + s7a.prototype.constructor = s7a; + function YQa(a10, b10) { + var c10 = new s7a(); + c10.Dka = b10; + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + return c10; + } + d7 = s7a.prototype; + d7.H = function() { + return "Branches"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof s7a && a10.l === this.l && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function ZQa(a10, b10, c10, e10, f10) { + return new I42().ts(t7a(a10, b10, c10.t3(), e10, f10.dF)); + } + function aRa(a10, b10, c10, e10, f10, g10) { + var h10 = B6(c10.g, Jl().bk).Fb(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10 = B6(p10.g, Pl().pm).A; + return (p10.b() ? null : p10.c()) === m10; + }; + }(a10, f10))); + if (h10.b()) + f10 = y7(); + else { + h10 = h10.c(); + var k10 = g10.dF.Fb(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.la === m10; + }; + }(a10, f10))); + f10 = new z7().d(bRa(ZQa(a10, b10, h10, e10, k10.b() ? new pB().vi(f10, H10()) : k10.c()))); + } + f10 = f10.b() ? J5(K7(), H10()) : f10.c(); + a10 = bRa($Qa(a10, b10, c10, e10, g10)); + return new I42().ts(LQa(NQa(), f10, a10)); + } + function t7a(a10, b10, c10, e10, f10) { + a10 = w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + return u7a(h10, m10, k10, g10.Dka, l10).ua(); + }; + }(a10, b10, e10, f10)); + b10 = K7(); + return c10.bd(a10, b10.u); + } + d7.z = function() { + return X5(this); + }; + function $Qa(a10, b10, c10, e10, f10) { + return new I42().ts(t7a(a10, b10, c10.t3(), e10, f10.dF)); + } + d7.$classData = r8({ aXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$Branches", { aXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function AY() { + this.l = this.Hm = null; + } + AY.prototype = new u7(); + AY.prototype.constructor = AY; + d7 = AY.prototype; + d7.H = function() { + return "TraitResolver"; + }; + d7.qaa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + this.Hm = Rb(Ut(), H10()); + return this; + }; + d7.E = function() { + return 0; + }; + function u7a(a10, b10, c10, e10, f10) { + var g10 = kRa(c10, b10.kI()), h10 = iRa(b10).j; + g10 = v7a(h10, g10.fr); + b10 = w7a(a10, g10, b10, c10, e10, f10); + if (b10 instanceof z7) + return new z7().d(a10.Hm.T0(g10, oq(/* @__PURE__ */ function(k10, l10) { + return function() { + return l10; + }; + }(a10, b10.i)))); + a10.Hm.KA(g10); + return y7(); + } + d7.h = function(a10) { + return a10 instanceof AY && a10.l === this.l && true; + }; + function w7a(a10, b10, c10, e10, f10, g10) { + var h10 = kRa(e10, c10.kI()), k10 = false, l10 = null, m10 = Vb().Ia(iRa(c10)); + if (m10 instanceof z7 && (k10 = true, l10 = m10, pCa(l10.i))) + return a10 = a10.l, O7(), e10 = new P6().a(), new z7().d(x7a(new J42(), a10, b10, new Ql().K(new S6().a(), e10), J5(K7(), H10()))); + if (k10 && (k10 = l10.i, k10 instanceof Tm)) { + m10 = J5(K7(), H10()); + m10 = Az(k10, m10); + if (m10 instanceof mP) + return a10 = a10.l, O7(), e10 = new P6().a(), e10 = new Ql().K(new S6().a(), e10), new z7().d(x7a(new J42(), a10, b10, Rd(e10, m10.j + "_op"), H10())); + if (m10 instanceof Tm) { + k10 = m10.Nz().VJ(); + k10.YL(h10.fr, g10, w6(/* @__PURE__ */ function(v10, A10, D10, C10) { + return function(I10) { + var L10 = dc().Fh, Y10 = D10.j, ia = y7(), pa = Ab(C10.Xa, q5(jd)), La = yb(C10); + A10.Gc(L10.j, Y10, ia, I10, pa, Yb().qb, La); + }; + }(a10, f10, m10, c10))); + h10 = GB(); + l10 = a10.l.H_; + var p10 = e10.oi, t10 = B6(c10.aa, FY().R).A; + c10 = Dqa(h10, l10, k10, p10, t10.b() ? "" : t10.c(), c10.Xa, m10.j, FB(GB(), m10.j, e10.oi), a10.l.Sk, new z7().d(f10)); + m10 = c10.t3(); + e10 = w6(/* @__PURE__ */ function(v10, A10, D10, C10) { + return function(I10) { + return u7a(v10, I10, A10, D10, C10).ua(); + }; + }(a10, e10, f10, g10)); + f10 = K7(); + e10 = m10.bd(e10, f10.u); + return new z7().d(x7a(new J42(), a10.l, b10, c10, e10)); + } + throw new x7().d(m10); + } + b10 = a10.l.ob; + a10 = dc().Fh; + yB(b10, a10, c10.j, "Looking for trait but " + m10 + " was found on model " + e10.oi, c10.Xa); + return y7(); + } + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ gXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$TraitResolver", { gXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function y7a() { + this.l = this.cp = this.dV = null; + } + y7a.prototype = new u7(); + y7a.prototype.constructor = y7a; + d7 = y7a.prototype; + d7.H = function() { + return "IriMerger"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof y7a && a10.l === this.l ? this.dV === a10.dV && this.cp === a10.cp : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.dV; + case 1: + return this.cp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function eoa(a10, b10, c10, e10) { + a10 = uza(ua(), e10.t(), a10.cp, a10.dV); + eb(b10, c10, a10); + } + function voa(a10, b10, c10) { + var e10 = new y7a(); + e10.dV = b10; + e10.cp = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ kXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtensionLikeResolutionStage$IriMerger", { kXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function sB() { + this.gA = null; + } + sB.prototype = new u7(); + sB.prototype.constructor = sB; + d7 = sB.prototype; + d7.a = function() { + this.gA = J5(DB(), H10()); + return this; + }; + d7.H = function() { + return "IdTracker"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof sB && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function joa(a10, b10) { + return b10.oh(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return !c10.gA.Ha(e10); + }; + }(a10))); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ nXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.IdTracker", { nXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function z7a() { + this.fr = this.$ = null; + } + z7a.prototype = new u7(); + z7a.prototype.constructor = z7a; + d7 = z7a.prototype; + d7.H = function() { + return "Key"; + }; + function v7a(a10, b10) { + var c10 = new z7a(); + c10.$ = a10; + c10.fr = b10; + return c10; + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof z7a && this.$ === a10.$) { + var b10 = this.fr; + a10 = a10.fr; + return null === b10 ? null === a10 : r7a(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.fr; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ oXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.Key", { oXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function A7a() { + this.yW = this.Mz = null; + } + A7a.prototype = new u7(); + A7a.prototype.constructor = A7a; + function B7a(a10, b10) { + var c10 = C7a(a10, b10), e10 = false, f10 = null; + b10 = b10.Ja(a10.Mz.j); + if (b10 instanceof z7) { + e10 = true; + f10 = b10; + var g10 = f10.i; + if (c10.Da()) + return new z7().d(D7a(a10, g10, E7a(a10, c10))); + } + if (e10) + return new z7().d(D7a(a10, f10.i, y7())); + if (y7() === b10 && c10.Da()) { + e10 = E7a(a10, c10); + e10 = e10.b() ? "" : e10.c(); + f10 = c10.Od(w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.zm === Yb().qb; + }; + }(a10))) ? Yb().qb : Yb().dh; + b10 = a10.Mz.j; + g10 = c10.ga().jx; + c10 = c10.ga().Ct; + var h10 = Ab(a10.Mz.fa(), q5(jd)); + a10 = yb(a10.Mz); + return new z7().d(Xb(e10, f10, b10, g10, c10, h10, a10, null)); + } + return y7(); + } + d7 = A7a.prototype; + d7.H = function() { + return "DataNodeEntry"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof A7a && this.Mz === a10.Mz) { + var b10 = this.yW; + a10 = a10.yW; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Mz; + case 1: + return this.yW; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function E7a(a10, b10) { + var c10 = new qd().d(""), e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.Ld; + }; + }(a10)), f10 = K7(); + b10.ka(e10, f10.u).fj().U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = h10.oa; + k10 += "\n"; + if (null === l10) + throw new sf().a(); + h10.oa = l10 + k10; + }; + }(a10, c10))); + return Vb().Ia(c10.oa); + } + function F7a(a10) { + TC(); + var b10 = Gb().si; + return a10.nk(UC(b10)); + } + function D7a(a10, b10, c10) { + b10 = F7a(b10); + var e10 = false, f10 = null; + if (b10 instanceof Vt) { + e10 = true; + f10 = b10; + var g10 = f10.Wn, h10 = f10.Nf; + if (H10().h(h10) && c10.na()) + return a10 = g10.Ld + "\n" + (c10.b() ? "" : c10.c()), Xb(a10, g10.zm, g10.Iv, g10.jx, g10.Ct, g10.Fg, g10.da, g10.sy); + } + if (e10 && (g10 = f10.Wn, f10 = f10.Nf, H10().h(f10))) + return g10; + if (e10) + return e10 = b10.Od(w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.zm === Yb().qb; + }; + }(a10))) ? Yb().qb : Yb().dh, f10 = new qd().d(""), g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.Ld; + }; + }(a10)), h10 = K7(), b10.ka(g10, h10.u).fj().U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + l10.oa = "" + l10.oa + m10 + "\n"; + }; + }(a10, f10))), c10.b() ? c10 = f10.oa : (c10 = c10.c(), c10 = "" + f10.oa + c10), f10 = b10.ga().Iv, g10 = Vb().Ia(a10.Mz.j), b10 = b10.ga().Ct, h10 = Ab(a10.Mz.fa(), q5(jd)), a10 = yb(a10.Mz), Xb(c10, e10, f10, g10, b10, h10, a10, null); + throw new x7().d(b10); + } + function C7a(a10, b10) { + var c10 = a10.yW; + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.lu(g10, oq(/* @__PURE__ */ function() { + return function() { + return H10(); + }; + }(e10))); + }; + }(a10, b10)); + b10 = K7(); + return F7a(c10.bd(a10, b10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xXa: 0 }, false, "amf.plugins.document.webapi.validation.DataNodeEntry", { xXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function G7a() { + this.Cw = this.I_ = null; + } + G7a.prototype = new u7(); + G7a.prototype.constructor = G7a; + d7 = G7a.prototype; + d7.H = function() { + return "DataNodeIndex"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G7a) { + var b10 = this.I_; + a10 = a10.I_; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.I_; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function H7a(a10, b10) { + var c10 = a10.Cw; + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) + return B7a(g10.ya(), f10).ua(); + throw new x7().d(g10); + }; + }(a10, b10)); + b10 = Id().u; + return hC(c10, a10, b10).ke(); + } + d7.ts = function(a10) { + this.I_ = a10; + var b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = f10.j, h10 = new A7a(), k10 = I7a(e10, f10); + h10.Mz = f10; + h10.yW = k10; + return new R6().M(g10, h10); + }; + }(this)), c10 = K7(); + this.Cw = a10.ka(b10, c10.u).Ch(Gb().si); + return this; + }; + d7.z = function() { + return X5(this); + }; + function I7a(a10, b10) { + if (b10 instanceof Xk) { + b10 = O_a(b10); + var c10 = new Fc().Vd(b10); + Xd(); + Xd(); + Id(); + b10 = new Lf().a(); + for (c10 = c10.Sb.Ye(); c10.Ya(); ) { + var e10 = c10.$a(), f10 = e10.j; + e10 = I7a(a10, e10); + var g10 = K7(); + f10 = e10.Vr(f10, g10.u).Hd(); + ws(b10, f10); + } + return b10.ua(); + } + return b10 instanceof bl ? (b10 = B6(b10.aa, al().Tt), a10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = k10.j; + k10 = I7a(h10, k10); + var m10 = K7(); + return k10.Vr(l10, m10.u); + }; + }(a10)), c10 = K7(), b10.bd(a10, c10.u)) : H10(); + } + d7.$classData = r8({ yXa: 0 }, false, "amf.plugins.document.webapi.validation.DataNodeIndex", { yXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function qC() { + this.ll = null; + this.Kqa = this.TD = false; + } + qC.prototype = new u7(); + qC.prototype.constructor = qC; + function J7a() { + } + d7 = J7a.prototype = qC.prototype; + d7.H = function() { + return "ResultContainer"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qC) { + var b10 = this.ll; + a10 = a10.ll; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ll; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ts = function(a10) { + this.ll = a10; + this.TD = a10.Od(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.zm === Yb().qb; + }; + }(this))); + this.Kqa = !this.TD; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xha: 0 }, false, "amf.plugins.document.webapi.validation.ResultContainer", { xha: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function K7a() { + this.Cw = this.Gz = this.ea = this.wf = null; + } + K7a.prototype = new u7(); + K7a.prototype.constructor = K7a; + d7 = K7a.prototype; + d7.H = function() { + return "UnitPayloadsValidation"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof K7a) { + var b10 = this.wf, c10 = a10.wf; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.ea === a10.ea : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.ea; + default: + throw new U6().e("" + a10); + } + }; + function L7a(a10, b10) { + yq(zq(), "UnitPayloadsValidation#validate: Validating all candidates " + a10.Gz.jb()); + return Soa().A3(a10.Gz, Yb().dh, b10).Yg(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return M7a(c10, e10); + }; + }(a10)), ml()); + } + function M7a(a10, b10) { + b10 = b10.ll.ua(); + TC(); + var c10 = Gb().si; + c10 = Dw(b10, UC(c10)).am(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.Iv; + }; + }(a10))); + b10 = H7a(a10.Cw, c10); + c10 = c10.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + if (null !== f10) { + for (f10 = f10.ya(); !f10.b(); ) { + if (f10.ga().Ct === Ko().UZ.j) + return true; + f10 = f10.ta(); + } + return false; + } + throw new x7().d(f10); + }; + }(a10))); + a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.ya(); + }; + }(a10)); + var e10 = Id(); + a10 = c10.bd(a10, e10.u); + c10 = K7(); + return b10.ia(a10, c10.u); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$T = function(a10, b10) { + this.wf = a10; + this.ea = b10; + Uoa || (Uoa = new iC().a()); + var c10 = Ooa(new dC().EK(a10)); + $oa || ($oa = new pC().a()); + var e10 = $oa.g9(a10, b10), f10 = K7(); + c10 = c10.ia(e10, f10.u); + Joa || (Joa = new bC().a()); + a10 = Joa.g9(a10, b10); + b10 = K7(); + this.Gz = c10.ia(a10, b10.u); + a10 = this.Gz.Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + g10 = g10.le.g; + var h10 = sl().nb; + return g10.vb.Ha(h10); + }; + }(this))); + b10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ar(g10.le.g, sl().nb); + }; + }(this)); + c10 = K7(); + a10 = a10.ka(b10, c10.u); + b10 = this.Gz; + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6(g10.pa.Y(), qf().ch); + }; + }(this)); + e10 = K7(); + b10 = b10.bd(c10, e10.u); + c10 = K7(); + a10 = a10.ia(b10, c10.u); + this.Cw = new G7a().ts(a10); + return this; + }; + d7.$classData = r8({ VXa: 0 }, false, "amf.plugins.document.webapi.validation.UnitPayloadsValidation", { VXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N7a() { + this.ns = this.Bf = this.sv = this.ea = this.Em = this.wf = null; + } + N7a.prototype = new u7(); + N7a.prototype.constructor = N7a; + d7 = N7a.prototype; + d7.H = function() { + return "ValidationContext"; + }; + d7.E = function() { + return 6; + }; + function dpa(a10, b10, c10, e10, f10, g10) { + var h10 = new N7a(); + h10.wf = a10; + h10.Em = b10; + h10.ea = c10; + h10.sv = e10; + h10.Bf = f10; + h10.ns = g10; + return h10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N7a) { + var b10 = this.wf, c10 = a10.wf; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Em, c10 = a10.Em, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.ea === a10.ea && this.sv === a10.sv && this.Bf === a10.Bf) + return b10 = this.ns, a10 = a10.ns, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.Em; + case 2: + return this.ea; + case 3: + return this.sv; + case 4: + return this.Bf; + case 5: + return this.ns; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WXa: 0 }, false, "amf.plugins.document.webapi.validation.ValidationContext", { WXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function sC() { + this.boa = this.Bka = this.lna = this.rj = null; + } + sC.prototype = new u7(); + sC.prototype.constructor = sC; + d7 = sC.prototype; + d7.H = function() { + return "WebApiValidationsRunner"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof sC) { + var b10 = this.rj; + a10 = a10.rj; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.UK = function(a10) { + this.rj = a10; + this.lna = new Z7a().UK(a10); + this.Bka = new $7a().UK(a10); + this.boa = new a8a().UK(a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + function cpa(a10) { + var b10 = a10.boa; + b8a || (b8a = new c8a().a()); + return apa(b10, b8a).Pq(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return (e10.TD ? ZC(hp(), e10) : apa(c10.lna, e10)).Pq(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return (g10.TD ? ZC(hp(), g10) : apa(f10.Bka, g10)).Yg(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return aq(new bq(), k10.Kqa, h10.rj.wf.j, h10.rj.Em, k10.ll); + }; + }(f10)), ml()); + }; + }(c10)), ml()); + }; + }(a10)), ml()); + } + d7.$classData = r8({ XXa: 0 }, false, "amf.plugins.document.webapi.validation.WebApiValidationsRunner", { XXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function pR() { + CF.call(this); + } + pR.prototype = new X22(); + pR.prototype.constructor = pR; + pR.prototype.kn = function(a10) { + kf.prototype.kn.call(this, a10); + return this; + }; + pR.prototype.$classData = r8({ aYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.InvalidJsonObject", { aYa: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function d8a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.vJ = this.uJ = null; + this.xa = 0; + } + d8a.prototype = new u7(); + d8a.prototype.constructor = d8a; + d7 = d8a.prototype; + d7.a = function() { + e8a = this; + Cr(this); + uU(this); + var a10 = yc(), b10 = F6().Eb; + this.uJ = rb(new sb(), a10, G5(b10, "propertySource"), tb(new ub(), vb().Eb, "property source", "Source property shape in the dependency", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Eb; + this.vJ = rb(new sb(), a10, G5(b10, "propertyTarget"), tb(new ub(), vb().Eb, "property target", "Target property shape in the dependency", H10())); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "PropertyDependencies")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().Eb, + "Property Dependencies", + "Dependency between sets of property shapes", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.uJ, this.vJ], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new vn().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ uYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.PropertyDependenciesModel$", { uYa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var e8a = void 0; + function un() { + e8a || (e8a = new d8a().a()); + return e8a; + } + function f8a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.g = this.qN = this.oN = this.R = this.NJ = this.yF = null; + this.xa = 0; + } + f8a.prototype = new u7(); + f8a.prototype.constructor = f8a; + d7 = f8a.prototype; + d7.a = function() { + g8a = this; + Cr(this); + uU(this); + var a10 = zc(), b10 = F6().Eb; + this.yF = rb(new sb(), a10, G5(b10, "xmlAttribute"), tb(new ub(), vb().Eb, "xml attribute", "XML attribute mapping", H10())); + a10 = zc(); + b10 = F6().Eb; + this.NJ = rb(new sb(), a10, G5(b10, "xmlWrapped"), tb(new ub(), vb().Eb, "xml wrapped", "XML wrapped mapping flag", H10())); + a10 = qb(); + b10 = F6().Eb; + this.R = rb(new sb(), a10, G5(b10, "xmlName"), tb(new ub(), vb().Eb, "xml name", "XML name mapping", H10())); + a10 = qb(); + b10 = F6().Eb; + this.oN = rb(new sb(), a10, G5(b10, "xmlNamespace"), tb( + new ub(), + vb().Eb, + "xml namespace", + "XML namespace mapping", + H10() + )); + a10 = qb(); + b10 = F6().Eb; + this.qN = rb(new sb(), a10, G5(b10, "xmlPrefix"), tb(new ub(), vb().Eb, "xml prefix", "XML prefix mapping", H10())); + ii(); + a10 = [this.yF, this.NJ, this.R, this.oN, this.qN]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "XMLSerializer")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().Eb, + "XML Serializer", + "Information about how to encode into XML a particular data shape", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new sn().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ zYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.XMLSerializerModel$", { zYa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var g8a = void 0; + function rn() { + g8a || (g8a = new f8a().a()); + return g8a; + } + function cn() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + cn.prototype = new u7(); + cn.prototype.constructor = cn; + d7 = cn.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new cn().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return li(); + }; + function Wca() { + return J5(K7(), H10()); + } + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + function h8a(a10) { + var b10 = Za(a10); + if (b10 instanceof z7 && (b10 = b10.i, b10 instanceof cn)) { + a10 = B6(b10.g, li().Kn).A; + a10 = a10.b() ? B6(b10.g, li().Pf).A : a10; + if (a10.b()) + return y7(); + a10 = a10.c(); + a10 = new je4().e(a10); + return new z7().d(jj(a10.td)); + } + b10 = B6(a10.g, li().Kn).A; + a10 = b10.b() ? B6(a10.g, li().Pf).A : b10; + if (a10.b()) + return y7(); + a10 = a10.c(); + a10 = new je4().e(a10); + return new z7().d(jj(a10.td)); + } + d7.dd = function() { + var a10 = h8a(this); + return "/creative-work/" + (a10.b() ? null : a10.c()); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new cn().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ GYa: 0 }, false, "amf.plugins.domain.shapes.models.CreativeWork", { GYa: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1 }); + function FR() { + this.m9 = null; + } + FR.prototype = new u7(); + FR.prototype.constructor = FR; + d7 = FR.prototype; + d7.a = function() { + this.m9 = J5(Ef(), H10()); + return this; + }; + function i8a(a10, b10, c10, e10, f10, g10) { + c10 = c10.b() ? e10.j : c10.c(); + e10 = fha(Vca(), e10); + var h10 = Ci().Ys; + c10 = eb(e10, h10, c10); + return j8a(a10, b10, c10, f10, new z7().d(b10.j), g10); + } + d7.H = function() { + return "RecursionErrorRegister"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof FR && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function j8a(a10, b10, c10, e10, f10, g10) { + var h10 = !Cg(a10.m9.Dc, c10.j), k10 = B6(c10.aa, db().oe).A; + !k10.b() && k10.c() || w0a(e10, c10, f10) || !h10 ? w0a(e10, c10, f10) && (a10 = db().oe, Bi(c10, a10, true)) : (e10 = g10.ob, f10 = dc().rN, g10 = b10.j, h10 = y7(), k10 = Ab(b10.fa(), q5(jd)), b10 = b10.Ib(), e10.Gc(f10.j, g10, h10, "Error recursive shape", k10, Yb().qb, b10), Dg(a10.m9, c10.j)); + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ IZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.RecursionErrorRegister", { IZa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function k8a() { + this.ek = null; + } + k8a.prototype = new u7(); + k8a.prototype.constructor = k8a; + d7 = k8a.prototype; + d7.H = function() { + return "AnyShapeAdjuster"; + }; + d7.E = function() { + return 1; + }; + d7.Gw = function(a10) { + this.ek = a10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k8a) { + var b10 = this.ek; + a10 = a10.ek; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ek; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function l8a(a10, b10) { + for (; !b10.b(); ) { + var c10 = b10.ga(); + if (a10.ek.Y().vb.Ha(c10)) + return true; + b10 = b10.ta(); + } + return false; + } + d7.$classData = r8({ LZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.AnyShapeAdjuster", { LZa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function jIa() { + this.lj = 0; + this.Lz = null; + } + jIa.prototype = new u7(); + jIa.prototype.constructor = jIa; + d7 = jIa.prototype; + d7.Ar = function(a10, b10) { + WAa(this, a10, b10); + }; + d7.yB = function() { + throw mb(E6(), new nb().e("raising exceptions in union processing")); + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + this.Gc(a10.j, b10, c10, e10, f10, Yb().dh, g10); + }; + d7.Gc = function() { + throw mb(E6(), new nb().e("raising exceptions in union processing")); + }; + d7.mU = function() { + this.lj = 0; + this.Lz = ""; + return this; + }; + d7.$classData = r8({ SZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.MinShapeAlgorithm$UnionErrorHandler$", { SZa: 1, f: 1, a7: 1, zq: 1, Zp: 1, Bp: 1 }); + function TYa() { + this.kA = this.wB = this.NS = this.Wg = null; + } + TYa.prototype = new u7(); + TYa.prototype.constructor = TYa; + d7 = TYa.prototype; + d7.a = function() { + this.Wg = Rb(Ut(), H10()); + this.NS = Rb(Ut(), H10()); + this.wB = Rb(Ut(), H10()); + this.kA = Rb(Ut(), H10()); + return this; + }; + d7.H = function() { + return "NormalizationCache"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof TYa && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + function m8a(a10, b10) { + a10.wB.Ur().ps(Gb().si).Cb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = f10.mn; + return f10.b() ? false : f10.c().j === e10.j; + }; + }(a10, b10))).U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return Di(f10, e10); + }; + }(a10, b10))); + } + d7.t = function() { + return V5(W5(), this); + }; + function n8a(a10, b10) { + var c10 = B6(b10.aa, Ci().Ys).A; + if (!c10.b()) { + c10 = c10.c(); + var e10 = a10.kA.Ja(c10), f10 = a10.wB.Ja(c10); + if (f10 instanceof z7) { + f10 = f10.i; + var g10 = K7(); + b10 = f10.yg(b10, g10.u); + e10.b() || (e10 = e10.c(), b10.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = Ci().Ys; + return eb(l10, m10, k10); + }; + }(a10, e10))), a10.wB.rt(c10), c10 = e10); + a10.wB.Ue(c10, b10); + } else + e10.b() ? (a10 = a10.wB, e10 = K7(), a10.Ue(c10, J5(e10, new Ib().ha([b10])))) : (c10 = e10.c(), e10 = Ci().Ys, eb(b10, e10, c10), a10 = a10.wB, e10 = K7(), a10.Ue(c10, J5(e10, new Ib().ha([b10])))); + } + } + function o8a(a10, b10, c10) { + var e10 = b10.fh.mb(); + a: { + for (; e10.Ya(); ) { + var f10 = e10.$a(); + if (f10.j === b10.j) { + e10 = new z7().d(f10); + break a; + } + } + e10 = y7(); + } + e10 instanceof z7 && (b10.fh.aW(e10.i), b10.fh.iz(b10)); + b10 instanceof zi && b10.mn.na() && b10.mn.c().j === b10.j && Di(b10, b10); + c10 || (m8a(a10, b10), c10 = a10.NS.Ja(b10.j), c10 instanceof z7 && c10.i.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.fh.mb(); + a: { + for (; l10.Ya(); ) { + var m10 = l10.$a(), p10 = m10; + if (p10.j === h10.j && (null === p10 ? null !== h10 : !p10.h(h10))) { + l10 = new z7().d(m10); + break a; + } + } + l10 = y7(); + } + if (l10 instanceof z7) + return k10.fh.aW(l10.i), k10.fh.Tm(h10); + }; + }(a10, b10)))); + } + function p8a(a10, b10, c10) { + var e10 = a10.kA.Ja(c10); + if (e10 instanceof z7) + e10 = e10.i, a10.kA.rt(c10), a10.kA.Ue(b10, e10); + else if (a10.kA.Ue(b10, c10), e10 = a10.wB.Ja(b10), !e10.b()) { + e10 = e10.c(); + a10.wB.rt(b10); + b10 = a10.wB; + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = Ci().Ys; + return eb(k10, l10, h10); + }; + }(a10, c10)); + var f10 = K7(); + b10.Ue(c10, e10.ka(a10, f10.u)); + } + } + d7.z = function() { + return X5(this); + }; + function lIa(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return q8a(e10, g10.j, f10); + }; + }(a10, c10))); + } + function q8a(a10, b10, c10) { + var e10 = a10.NS.Ja(b10); + if (e10 instanceof z7) { + e10 = e10.i; + var f10 = a10.NS, g10 = K7(); + f10.jm(b10, e10.yg(c10, g10.u)); + } else + e10 = a10.NS, f10 = K7(), e10.jm(b10, J5(f10, new Ib().ha([c10]))); + return a10; + } + d7.$classData = r8({ TZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.NormalizationCache", { TZa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function r8a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.jD = this.pD = null; + this.xa = 0; + } + r8a.prototype = new u7(); + r8a.prototype.constructor = r8a; + d7 = r8a.prototype; + d7.a = function() { + s8a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Ta; + this.pD = rb(new sb(), a10, G5(b10, "variable"), tb(new ub(), vb().Ta, "variable", "Variable defined inside an URL tempplate", H10())); + a10 = qb(); + b10 = F6().Ta; + this.jD = rb(new sb(), a10, G5(b10, "linkExpression"), tb(new ub(), vb().Ta, "link expression", "OAS 3 link expression", H10())); + a10 = F6().Ta; + a10 = G5(a10, "IriTemplateMapping"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Iri Template", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.pD, b10 = this.jD, c10 = nc().g; + return ji(a10, ji(b10, c10)); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Hn().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ v_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.IriTemplateMappingModel$", { v_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var s8a = void 0; + function Gn() { + s8a || (s8a = new r8a().a()); + return s8a; + } + function t8a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.oD = this.mD = this.g_ = null; + this.xa = 0; + } + t8a.prototype = new u7(); + t8a.prototype.constructor = t8a; + d7 = t8a.prototype; + d7.a = function() { + u8a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Jb; + this.g_ = rb(new sb(), a10, G5(b10, "topic"), tb(new ub(), vb().Jb, "topic", "The topic where the Last Will and Testament message will be sent", H10())); + a10 = Ac(); + b10 = F6().Jb; + this.mD = rb(new sb(), a10, G5(b10, "qos"), tb(new ub(), vb().Jb, "qos", "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received", H10())); + a10 = zc(); + b10 = F6().Jb; + this.oD = rb(new sb(), a10, G5(b10, "retain"), tb( + new ub(), + vb().Jb, + "retain", + "Whether the broker should retain the Last Will and Testament message or not", + H10() + )); + a10 = F6().Jb; + a10 = G5(a10, "MqttServerLastWill"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "MqttServerLastWill", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.g_, this.mD, this.oD], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new yo().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Y_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.MqttServerLastWillModel$", { Y_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var u8a = void 0; + function xo() { + u8a || (u8a = new t8a().a()); + return u8a; + } + function v8a() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.Va = this.R = null; + this.xa = 0; + } + v8a.prototype = new u7(); + v8a.prototype.constructor = v8a; + d7 = v8a.prototype; + d7.a = function() { + w8a = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the scope", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Va = rb(new sb(), a10, G5(b10, "description"), tb(new ub(), vb().dc, "description", "Human readable description for the scope", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "Scope")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "Scope", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Va], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Hm().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ i0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.ScopeModel$", { i0a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var w8a = void 0; + function Gm() { + w8a || (w8a = new v8a().a()); + return w8a; + } + function jQ(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new ym().K(new S6().a(), c10); + if (!b10.b()) { + b10 = b10.c(); + var e10 = xm().Nd; + new z7().d(eb(c10, e10, b10)); + } + b10 = zD().Ne; + ig(a10, b10, c10); + return c10; + } + function Rn() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Rn.prototype = new u7(); + Rn.prototype.constructor = Rn; + d7 = Rn.prototype; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Qn(); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/amqp091-exchange"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return Qn().R; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ R0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.amqp.Amqp091ChannelExchange", { R0a: 1, f: 1, qd: 1, vc: 1, tc: 1, xh: 1 }); + function Un() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Un.prototype = new u7(); + Un.prototype.constructor = Un; + d7 = Un.prototype; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Tn(); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/amqp091-queue"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return Tn().R; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ U0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.amqp.Amqp091Queue", { U0a: 1, f: 1, qd: 1, vc: 1, tc: 1, xh: 1 }); + function DY() { + this.joa = this.Wqa = this.m = null; + } + DY.prototype = new u7(); + DY.prototype.constructor = DY; + d7 = DY.prototype; + d7.H = function() { + return "DomainElementMerging"; + }; + function x8a(a10, b10, c10, e10, f10) { + f10.wb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + if (m10 instanceof Vi) { + if (Jc(h10, y8a(m10)).b()) + return ig(k10, l10, m10); + } else { + if (null !== m10) + return ig(k10, l10, m10); + throw new x7().d(m10); + } + }; + }(a10, e10.wb, b10, c10))); + } + d7.E = function() { + return 0; + }; + function CY(a10, b10, c10, e10) { + Qqa(Uqa(), b10, c10, e10); + var f10 = new Uj().eq(false); + c10 = c10.Y().vb; + var g10 = mz(); + g10 = Ua(g10); + var h10 = Id().u; + Jd(c10, g10, h10).Cb(w6(/* @__PURE__ */ function() { + return function(k10) { + return z8a(k10); + }; + }(a10))).U(w6(/* @__PURE__ */ function(k10, l10, m10, p10) { + return function(t10) { + if (null !== t10) { + var v10 = hd(l10.Y(), t10.Lc); + if (y7() === v10) + A8a(k10, l10, t10, m10); + else { + if (!(v10 instanceof z7)) + throw new x7().d(v10); + var A10 = v10.i; + v10 = t10.Lc; + var D10 = t10.r, C10 = A10.r, I10 = Vb().Ia(C10).na(), L10 = Vb().Ia(C10); + if (L10 instanceof z7) + var Y10 = Vb().Ia(C10.r).na(); + else { + if (y7() !== L10) + throw new x7().d(L10); + Y10 = false; + } + L10 = true; + if (I10 && Y10) { + I10 = C10.r instanceof vh; + Y10 = D10.r instanceof vh; + var ia = wh(C10.r.fa(), q5(loa)), pa = wh(C10.r.fa(), q5(B8a)); + if (I10 && Y10 && ia) + L10 = A10.r.r, I10 = D10.r, Y10 = y7(), ia = y7(), pa = new HM().a(), I10 = Rca(I10, Y10, ia, pa, false), Y10 = B6(L10.Y(), qf().R).A, Y10 = Y10.b() ? null : Y10.c(), O7(), ia = new P6().a(), I10 = Sd(I10, Y10, ia), B6(L10.Y(), Ag().Ec).Da() && (L10 = B6(L10.Y(), Ag().Ec), Y10 = Ag().Ec, Zd(I10, Y10, L10)), L10 = K42(k10, l10.j, I10, L42(k10)), Vd(l10, v10, L10), L10 = false; + else if (pa) { + L10 = v10.ba; + a: + if (!KAa(L10) || !C8a(L10, D10.r)) + if (L10 instanceof ht2) + L10 = new z7().d(L10.Fe).i, D8a(k10, l10, v10, D10, L10); + else if (vB(L10)) { + L10 = C10.r; + if (L10 instanceof Mh && (I10 = B6(L10.aa, Fg().af).A, (I10.b() ? null : I10.c()) === Uh().zj)) { + ia = false; + I10 = null; + Y10 = D10.r; + if (Y10 instanceof Mh && (ia = true, I10 = Y10, pa = B6(I10.aa, Fg().af).A, (pa.b() ? null : pa.c()) === Uh().zj)) { + CY(k10, A10.r.r, t10.r.r, m10); + break a; + } + if (ia) { + Y10 = Fg().af; + I10 = B6(I10.aa, Fg().af).A; + I10 = I10.b() ? null : I10.c(); + eb(L10, Y10, I10); + CY(k10, A10.r.r, t10.r.r, m10); + break a; + } + if (Y10 instanceof vh) { + L10 = B6(L10.aa, Ag().Ec); + I10 = K42(k10, l10.j, Y10, L42(k10)); + Vd(l10, v10, I10); + L10.Da() && (I10 = hd(l10.Y(), v10), I10.b() || (I10 = I10.c().r.r, Y10 = Ag().Ec, Zd(I10, Y10, L10))); + break a; + } + L10 = K42(k10, l10.j, Y10, L42(k10)); + Vd(l10, v10, L10); + break a; + } + L10 instanceof vh ? CY(k10, A10.r.r, t10.r.r, m10) : (L10 = K42(k10, l10.j, D10.r, L42(k10)), Vd(l10, v10, L10)); + } else + L10 = K42(k10, l10.j, D10.r, L42(k10)), Vd(l10, v10, L10); + L10 = false; + } + } + L10 && (I10 = v10.ba, I10 instanceof zB || (I10 instanceof ht2 ? (t10 = new z7().d(I10.Fe).i, C10 = C10.r, D10 = D10.r, t10 instanceof zB ? E8a(k10, l10, v10, C10, D10) : t10 && t10.$classData && t10.$classData.ge.Oi ? F8a(k10, l10, v10, t10, t10, C10, D10, m10) : dl() === t10 ? x8a(k10, l10, v10, C10, D10) : (v10 = dc().Fh, yB(m10, v10, l10.j, "Cannot merge '" + t10 + "': not a KeyField nor a Scalar", l10.fa()))) : vB(I10) ? CY(k10, A10.r.r, t10.r.r, m10) : (D10 = dc().Fh, yB(m10, D10, l10.j, "Cannot merge '" + v10.ba + "':not a (Scalar|Array|Object)", l10.fa())))); + p10.oa = L10; + } + } else + throw new x7().d(t10); + }; + }(a10, b10, e10, f10))); + return b10 instanceof rf && f10.oa ? G8a(a10, b10, J5(Gb().Qg, H10())) : b10; + } + function D8a(a10, b10, c10, e10, f10) { + KAa(f10) ? (e10 = e10.r.wb.Cb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return !C8a(h10, k10); + }; + }(a10, f10))), a10 = K42(a10, b10.j, Zr(new $r(), e10, new P6().a()), L42(a10)), Vd(b10, c10, a10)) : (a10 = K42(a10, b10.j, e10.r, L42(a10)), Vd(b10, c10, a10)); + } + d7.h = function(a10) { + return a10 instanceof DY && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function E8a(a10, b10, c10, e10, f10) { + e10 = e10.wb; + var g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.r; + }; + }(a10)), h10 = K7(); + e10 = e10.ka(g10, h10.u).xg(); + f10.wb.U(w6(/* @__PURE__ */ function(k10, l10, m10, p10) { + return function(t10) { + t10 = t10.r; + if (!l10.Ha(t10)) + return t10 = ih(new jh(), t10, new P6().a()), ig(m10, p10, t10); + }; + }(a10, e10, b10, c10))); + } + function H8a(a10, b10, c10) { + return b10 instanceof Mh || b10 instanceof Hh ? (a10 = a10.Wqa, b10 = I8a(b10.bc().Ub(), a10), Cg(b10, c10)) : true; + } + function J8a(a10, b10) { + return Cg(a10.joa, b10.Lc) ? wh(b10.r.x, q5(b42)) : true; + } + d7.ss = function(a10) { + this.m = a10; + ii(); + a10 = [Yd(nc()), Pl().fw]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.Wqa = c10; + ii(); + a10 = [Ih().Cn, Fg().af, xn().Le]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.joa = c10; + return this; + }; + function G8a(a10, b10, c10) { + try { + if (c10.Ha(b10.j)) { + if (b10 instanceof zi) + return b10; + if (b10 instanceof Vk) { + var e10 = fha(Vca(), B6(b10.aa, Qi().Vf)), f10 = Qi().Vf; + return Vd(b10, f10, e10); + } + return fha(Vca(), b10); + } + var g10 = K7(), h10 = c10.Lk(J5(g10, new Ib().ha([b10.j]))); + b10.Y().vb.U(w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + a: { + if (null !== p10) { + var t10 = p10.ma(), v10 = p10.ya(); + if (null !== t10 && null !== v10) { + p10 = v10.r; + v10 = v10.x; + if (p10 instanceof rf) + Ui(l10.Y(), t10, G8a(k10, p10, m10), v10); + else if (p10 instanceof $r) { + v10 = p10.wb; + var A10 = w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + return L10 instanceof rf ? G8a(C10, L10, I10) : L10; + }; + }(k10, m10)), D10 = K7(); + v10 = v10.ka( + A10, + D10.u + ); + Ui(l10.Y(), t10, Zr(new $r(), v10, p10.x), (O7(), new P6().a())); + } else + Ui(l10.Y(), t10, p10, v10); + break a; + } + } + throw new x7().d(p10); + } + }; + }(a10, b10, h10))); + return b10; + } catch (k10) { + if (k10 instanceof iJ) + return b10; + throw k10; + } + } + function F8a(a10, b10, c10, e10, f10, g10, h10, k10) { + g10 = g10.wb; + var l10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = hd(v10.Y(), t10.la); + A10.b() ? A10 = y7() : (A10 = A10.c(), A10 = new z7().d(A10.r.r.r)); + A10 = A10.b() ? y7() : A10.c(); + return new R6().M(A10, v10); + }; + }(a10, f10)), m10 = K7(); + g10 = g10.ka(l10, m10.u).Ch(Gb().si); + h10.wb.U(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10, C10, I10) { + return function(L10) { + var Y10 = hd(L10.Y(), t10.la); + if (Y10 instanceof z7) { + var ia = Y10.i; + if (!v10.Ha(y7())) { + if (v10.Ha(ia.r.r.r)) + return Y10 = Jl().bk, (null === A10 ? null === Y10 : A10.h(Y10)) && K8a(p10.m, L10.j), CY(p10, v10.P(ia.r.r.r), L10.ub(D10.j, lt2()), C10); + if (C8a(I10, L10)) + return; + ia = Jl().bk; + (null === A10 ? null === ia : A10.h(ia)) && K8a(p10.m, L10.j); + L10 = K42(p10, D10.j, L10, L42(p10)); + return ig(D10, A10, L10); + } + } + if (y7() === Y10) { + ia = v10.mb(); + for (Y10 = true; Y10 && ia.Ya(); ) { + Y10 = ia.$a().ma(); + var pa = y7(); + Y10 = !(null !== Y10 && ra(Y10, pa)); + } + ia = !Y10; + } else + ia = false; + if (ia) { + if (v10.Ha(y7())) + return CY(p10, v10.P(y7()), L10.ub(D10.j, lt2()), C10); + if (!C8a(I10, L10)) + return L10 = K42(p10, D10.j, L10, L42(p10)), ig(D10, A10, L10); + } + }; + }(a10, f10, g10, c10, b10, k10, e10))); + } + function z8a(a10) { + a10 = a10.Lc; + var b10 = nc().Ni(); + (null === b10 ? null === a10 : b10.h(a10)) ? a10 = true : (b10 = nc().bb, (null === b10 ? null === a10 : b10.h(a10)) ? a10 = true : (b10 = db().te, a10 = null === b10 ? null === a10 : b10.h(a10))); + return !a10; + } + d7.z = function() { + return X5(this); + }; + function K42(a10, b10, c10, e10) { + if (c10 instanceof $r) { + var f10 = c10.wb; + a10 = w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + return K42(g10, h10, l10, k10); + }; + }(a10, b10, e10)); + b10 = K7(); + return Zr(new $r(), f10.ka(a10, b10.u), c10.x); + } + Rk(c10) && !e10.aq.Ha(c10.j) && (f10 = c10.j, L8a(c10, b10), M8a(e10, c10.j), c10.Y().vb.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.ya(); + z8a(lh(m10, l10)) && K42(g10, h10.j, l10.r, k10); + } else + throw new x7().d(l10); + }; + }(a10, c10, e10))), c10 instanceof ym && HC(EC(), B6(c10.g, xm().Jc), c10.j, new z7().d(f10))); + return c10; + } + function A8a(a10, b10, c10, e10) { + var f10 = c10.Lc, g10 = c10.r, h10 = Jl().bk; + (null === f10 ? null === h10 : f10.h(h10)) && g10.r.wb.U(w6(/* @__PURE__ */ function(k10) { + return function(l10) { + l10 instanceof Ql && !C8a(Pl(), l10) && K8a(k10.m, l10.j); + }; + }(a10))); + H8a(a10, b10, f10) ? (e10 = f10.ba, KAa(e10) && C8a(e10, g10.r) || (e10 instanceof ht2 ? (e10 = new z7().d(e10.Fe).i, D8a(a10, b10, f10, g10, e10)) : (e10 = K42(a10, b10.j, g10.r, L42(a10)), Vd(b10, f10, e10)))) : J8a(a10, c10) && (a10 = dc().Fh, g10 = b10.j, f10 = "Cannot merge '" + f10.r.$ + "' into " + b10.bc().jc().nT, yB(e10, a10, g10, f10, b10.fa())); + } + function C8a(a10, b10) { + return KAa(a10) ? (a10 = hd(b10.Y(), a10.fw), a10.b() ? false : aj(a10.c().r.r)) : false; + } + function L8a(a10, b10) { + a10 instanceof rf ? Ai(a10, b10) : a10 instanceof el ? js(ks(), b10, a10) : a10.ub(b10, lt2()); + } + d7.$classData = r8({ C1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.DomainElementMerging", { C1a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N8a() { + this.l = this.aq = null; + } + N8a.prototype = new u7(); + N8a.prototype.constructor = N8a; + d7 = N8a.prototype; + d7.H = function() { + return "Adopted"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof N8a && a10.l === this.l && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function M8a(a10, b10) { + var c10 = a10.aq, e10 = K7(); + a10.aq = c10.yg(b10, e10.u); + } + d7.z = function() { + return X5(this); + }; + function L42(a10) { + var b10 = new N8a(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + b10.aq = H10(); + return b10; + } + d7.$classData = r8({ E1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.DomainElementMerging$Adopted", { E1a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function vq() { + this.$o = this.FF = null; + this.vw = false; + } + vq.prototype = new u7(); + vq.prototype.constructor = vq; + function O8a() { + } + O8a.prototype = vq.prototype; + function Hea() { + var a10 = gp(bp()); + a10.vw = true; + a10.$o = Rb(Gb().ab, H10()); + } + function WLa(a10, b10, c10, e10, f10, g10, h10, k10, l10) { + c10 = Xb(g10, b10, e10, f10, c10, h10, l10, a10); + if (a10.vw) + if (b10 = a10.$o.Ja(k10), b10 instanceof z7) { + a10 = b10.i; + a: { + for (k10 = a10.Dc; !k10.b(); ) { + if (k10.ga().h(c10)) { + k10 = true; + break a; + } + k10 = k10.ta(); + } + k10 = false; + } + k10 || Dg(a10, c10); + } else if (y7() === b10) { + b10 = a10.$o; + Ef(); + c10 = [c10]; + if (0 === (c10.length | 0)) + c10 = Jf(new Kf(), new Lf().a()).eb; + else { + e10 = Jf(new Kf(), new Lf().a()); + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + Of(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + } + a10.$o = b10.cc(new R6().M(k10, c10)); + } else + throw new x7().d(b10); + else if (b10 === Yb().qb) + throw mb(E6(), new nb().e(c10.t())); + } + d7 = vq.prototype; + d7.a = function() { + this.FF = "Parser side AMF Validation"; + this.$o = Rb(Gb().ab, H10()); + this.vw = true; + return this; + }; + d7.B3 = function(a10, b10, c10) { + return P8a(this, a10, b10, c10); + }; + function P8a(a10, b10, c10, e10) { + var f10 = Gja(Fja(), Q8a(a10, c10)), g10 = b10.Me; + g10 instanceof z7 ? (g10 = a10.$o.lu(g10.i | 0, oq(/* @__PURE__ */ function() { + return function() { + return H10(); + }; + }(a10))), e10 = w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + var p10 = m10.Ld; + p10 = "" === p10 ? "Constraint violation" : p10; + var t10 = Yaa(m10.Ct, l10, m10.zm); + return Xb(p10, t10, m10.Iv, m10.jx, m10.Ct, m10.Fg, m10.da, m10.sy); + }; + }(a10, e10, f10)), f10 = K7(), g10 = g10.ka(e10, f10.u)) : g10 = H10(); + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function() { + return aq(new bq(), !k10.Od(w6(/* @__PURE__ */ function() { + return function(p10) { + return p10.zm === Yb().qb; + }; + }(h10))), l10.j, m10, k10); + }; + }(a10, g10, b10, c10)), ml()); + } + d7.gi = function() { + return this.FF; + }; + d7.wr = function() { + return J5(K7(), H10()); + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function(a10) { + return function() { + var b10 = bp().E3; + if (!(b10 instanceof z7)) + if (y7() === b10) + hja(bp(), new vq().a()); + else + throw new x7().d(b10); + return a10; + }; + }(this)), ml()); + }; + d7.oba = function() { + return nq(hp(), oq(/* @__PURE__ */ function(a10) { + return function() { + return VC(WC(), a10.gi()); + }; + }(this)), ml()); + }; + function Q8a(a10, b10) { + var c10 = FO().Bf; + ii(); + for (var e10 = new Lf().a(); !c10.b(); ) { + var f10 = c10.ga(), g10 = f10; + jR(FO(), g10.j, b10) === Yb().qb !== false && Dg(e10, f10); + c10 = c10.ta(); + } + c10 = e10.ua(); + e10 = /* @__PURE__ */ function() { + return function(l10) { + return l10.$; + }; + }(a10); + f10 = ii().u; + if (f10 === ii().u) + if (c10 === H10()) + e10 = H10(); + else { + f10 = c10.ga(); + g10 = f10 = ji(e10(f10), H10()); + for (c10 = c10.ta(); c10 !== H10(); ) { + var h10 = c10.ga(); + h10 = ji(e10(h10), H10()); + g10 = g10.Nf = h10; + c10 = c10.ta(); + } + e10 = f10; + } + else { + for (f10 = se4(c10, f10); !c10.b(); ) + g10 = c10.ga(), f10.jd(e10(g10)), c10 = c10.ta(); + e10 = f10.Rc(); + } + f10 = FO().Bf; + ii(); + for (c10 = new Lf().a(); !f10.b(); ) + h10 = g10 = f10.ga(), jR(FO(), h10.j, b10) === Yb().zx !== false && Dg(c10, g10), f10 = f10.ta(); + f10 = c10.ua(); + c10 = /* @__PURE__ */ function() { + return function(l10) { + return l10.$; + }; + }(a10); + g10 = ii().u; + if (g10 === ii().u) + if (f10 === H10()) + c10 = H10(); + else { + g10 = f10.ga(); + h10 = g10 = ji(c10(g10), H10()); + for (f10 = f10.ta(); f10 !== H10(); ) { + var k10 = f10.ga(); + k10 = ji(c10(k10), H10()); + h10 = h10.Nf = k10; + f10 = f10.ta(); + } + c10 = g10; + } + else { + for (g10 = se4(f10, g10); !f10.b(); ) + h10 = f10.ga(), g10.jd(c10(h10)), f10 = f10.ta(); + c10 = g10.Rc(); + } + g10 = FO().Bf; + ii(); + for (f10 = new Lf().a(); !g10.b(); ) + k10 = h10 = g10.ga(), jR(FO(), k10.j, b10) === Yb().dh !== false && Dg(f10, h10), g10 = g10.ta(); + f10 = f10.ua(); + b10 = /* @__PURE__ */ function() { + return function(l10) { + return l10.$; + }; + }(a10); + g10 = ii().u; + if (g10 === ii().u) + if (f10 === H10()) + b10 = H10(); + else { + g10 = f10.ga(); + h10 = g10 = ji(b10(g10), H10()); + for (f10 = f10.ta(); f10 !== H10(); ) + k10 = f10.ga(), k10 = ji(b10(k10), H10()), h10 = h10.Nf = k10, f10 = f10.ta(); + b10 = g10; + } + else { + for (g10 = se4(f10, g10); !f10.b(); ) + h10 = f10.ga(), g10.jd(b10(h10)), f10 = f10.ta(); + b10 = g10.Rc(); + } + a10 = VC(WC(), a10.gi()); + f10 = y7(); + g10 = FO().Bf; + K7(); + pj(); + h10 = new Lf().a().ua(); + k10 = new wu().a(); + return AEa(a10, f10, e10, c10, b10, h10, g10, k10); + } + d7.aea = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return new NR(); + }; + }(this)), ml()); + }; + d7.b$ = function() { + throw mb(E6(), new nb().e("SHACL Support not available")); + }; + d7.$classData = r8({ Qha: 0 }, false, "amf.plugins.features.validation.ParserSideValidationPlugin", { Qha: 1, f: 1, Aga: 1, Zr: 1, OCa: 1, dD: 1 }); + function R8a() { + } + R8a.prototype = new eZa(); + R8a.prototype.constructor = R8a; + function S8a() { + } + S8a.prototype = R8a.prototype; + function Hp() { + } + Hp.prototype = new u7(); + Hp.prototype.constructor = Hp; + function T8a() { + } + T8a.prototype = Hp.prototype; + Hp.prototype.Uj = function(a10) { + a10.b() || a10.c(); + return this; + }; + function RE() { + CF.call(this); + } + RE.prototype = new X22(); + RE.prototype.constructor = RE; + RE.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + RE.prototype.$classData = r8({ I2a: 0 }, false, "java.nio.BufferOverflowException", { I2a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Lv() { + CF.call(this); + } + Lv.prototype = new X22(); + Lv.prototype.constructor = Lv; + Lv.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + Lv.prototype.$classData = r8({ J2a: 0 }, false, "java.nio.BufferUnderflowException", { J2a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function U8a() { + CF.call(this); + } + U8a.prototype = new cZa(); + U8a.prototype.constructor = U8a; + function V8a() { + } + V8a.prototype = U8a.prototype; + function fS() { + this.ah = null; + } + fS.prototype = new AJa(); + fS.prototype.constructor = fS; + function W8a(a10) { + var b10 = new AF().a(); + Gaa.readFile(a10.ah, "UTF-8", /* @__PURE__ */ function(c10, e10) { + return function(f10, g10) { + null === f10 ? f10 = Ij(e10, g10) : (f10 = new T22().e(f10.message), f10 = Gj(e10, f10)); + return f10; + }; + }(a10, b10)); + return b10; + } + fS.prototype.Caa = function(a10, b10) { + dS.prototype.Caa.call(this, a10, b10); + return this; + }; + function nga(a10, b10) { + var c10 = new AF().a(); + Gaa.writeFile(a10.ah, ka(b10), "UTF-8", /* @__PURE__ */ function(e10, f10) { + return function(g10) { + null === g10 ? g10 = Ij(f10, void 0) : (g10 = new T22().e(g10.message), g10 = Gj(f10, g10)); + return g10; + }; + }(a10, c10)); + } + fS.prototype.$classData = r8({ i3a: 0 }, false, "org.mulesoft.common.io.JsAsyncFile", { i3a: 1, thb: 1, f: 1, rhb: 1, qhb: 1, shb: 1 }); + function Ip() { + this.oL = 0; + this.UN = null; + } + Ip.prototype = new u7(); + Ip.prototype.constructor = Ip; + d7 = Ip.prototype; + d7.H = function() { + return "LimitedStringBuffer"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ip ? this.oL === a10.oL : false; + }; + d7.sp = function() { + return this.UN.t(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.oL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return this.UN.t(); + }; + d7.ue = function(a10) { + this.oL = a10; + this.UN = new Pj().a(); + return this; + }; + function EJa(a10, b10) { + if ((wa(b10) + a10.UN.Oa() | 0) > a10.oL) + throw new M42().a(); + CJa(a10.UN, b10); + return a10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.oL); + return OJ().fe(a10, 1); + }; + Ip.prototype.append = function(a10) { + return EJa(this, a10); + }; + Ip.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(Ip.prototype, "length", { get: function() { + return this.UN.Oa(); + }, configurable: true }); + Object.defineProperty(Ip.prototype, "limit", { get: function() { + return this.oL; + }, configurable: true }); + Ip.prototype.$classData = r8({ k3a: 0 }, false, "org.mulesoft.common.io.LimitedStringBuffer", { k3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function DN() { + this.Oz = this.mA = this.JA = 0; + this.Et = this.Bt = null; + } + DN.prototype = new u7(); + DN.prototype.constructor = DN; + d7 = DN.prototype; + d7.H = function() { + return "SimpleDateTime"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof DN) { + if (this.JA === a10.JA && this.mA === a10.mA && this.Oz === a10.Oz) { + var b10 = this.Bt, c10 = a10.Bt; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.Et, a10 = a10.Et, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.JA; + case 1: + return this.mA; + case 2: + return this.Oz; + case 3: + return this.Bt; + case 4: + return this.Et; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + var a10 = this.JA, b10 = this.mA, c10 = this.Oz, e10 = new qg().e("%04d-%02d-%02d"); + b10 = [a10, b10, c10]; + ua(); + e10 = e10.ja; + K7(); + vk(); + a10 = []; + c10 = 0; + for (var f10 = b10.length | 0; c10 < f10; ) + a10.push(EN(b10[c10])), c10 = 1 + c10 | 0; + CJ(); + b10 = a10.length | 0; + b10 = ja(Ja(Ha), [b10]); + var g10 = b10.n.length; + f10 = c10 = 0; + var h10 = a10.length | 0; + g10 = h10 < g10 ? h10 : g10; + h10 = b10.n.length; + for (g10 = g10 < h10 ? g10 : h10; c10 < g10; ) + b10.n[f10] = a10[c10], c10 = 1 + c10 | 0, f10 = 1 + f10 | 0; + e10 = PK(e10, b10); + a10 = this.Bt; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d("T" + a10.t())); + a10 = a10.b() ? "" : a10.c(); + b10 = this.Et; + b10.b() ? b10 = y7() : (b10 = b10.c() | 0, b10 = new z7().d(WSa(mF(), b10))); + b10 = b10.b() ? "" : b10.c(); + return "" + e10 + a10 + b10; + }; + function SSa(a10, b10, c10, e10, f10, g10) { + a10.JA = b10; + a10.mA = c10; + a10.Oz = e10; + a10.Bt = f10; + a10.Et = g10; + a: { + mF(); + if (0 === b10) + a10 = b10; + else if (1 > c10 || 12 < c10) + a10 = c10; + else { + if (!(1 > e10 || 31 < e10 || 31 === e10 && (4 === c10 || 6 === c10 || 9 === c10 || 11 === c10) || 2 === c10 && (29 < e10 || 29 === e10 && (0 !== (b10 % 4 | 0) || 1600 <= b10 && 0 === (b10 % 100 | 0) && 0 !== (b10 % 400 | 0))))) + break a; + a10 = e10; + } + throw Jua(new QZ().ue(a10)); + } + return a10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.JA); + a10 = OJ().Ga(a10, this.mA); + a10 = OJ().Ga(a10, this.Oz); + a10 = OJ().Ga(a10, NJ(OJ(), this.Bt)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Et)); + return OJ().fe(a10, 5); + }; + d7.$classData = r8({ u3a: 0 }, false, "org.mulesoft.common.time.SimpleDateTime", { u3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function PZ() { + this.AL = this.WH = this.qH = this.FG = 0; + } + PZ.prototype = new u7(); + PZ.prototype.constructor = PZ; + d7 = PZ.prototype; + d7.H = function() { + return "TimeOfDay"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof PZ ? this.FG === a10.FG && this.qH === a10.qH && this.WH === a10.WH && this.AL === a10.AL : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.FG; + case 1: + return this.qH; + case 2: + return this.WH; + case 3: + return this.AL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + var a10 = this.FG, b10 = this.qH, c10 = this.WH, e10 = new qg().e("%02d:%02d:%02d"); + b10 = [a10, b10, c10]; + ua(); + e10 = e10.ja; + K7(); + vk(); + a10 = []; + c10 = 0; + for (var f10 = b10.length | 0; c10 < f10; ) + a10.push(EN(b10[c10])), c10 = 1 + c10 | 0; + CJ(); + b10 = a10.length | 0; + b10 = ja(Ja(Ha), [b10]); + var g10 = b10.n.length; + f10 = c10 = 0; + var h10 = a10.length | 0; + g10 = h10 < g10 ? h10 : g10; + h10 = b10.n.length; + for (g10 = g10 < h10 ? g10 : h10; c10 < g10; ) + b10.n[f10] = a10[c10], c10 = 1 + c10 | 0, f10 = 1 + f10 | 0; + e10 = PK(e10, b10); + b10 = this.AL / 1e6; + a10 = Ea(); + b10 = +ba.Math.round(b10); + b10 = Zsa(a10, b10); + if (0 === b10) + return e10; + if (0 === (b10 % 100 | 0)) + a10 = "" + (b10 / 100 | 0); + else if (0 === (b10 % 10 | 0)) { + b10 = b10 / 10 | 0; + a10 = new qg().e("%02d"); + c10 = [b10]; + ua(); + a10 = a10.ja; + K7(); + vk(); + b10 = []; + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + b10.push(EN(c10[f10])), f10 = 1 + f10 | 0; + CJ(); + c10 = b10.length | 0; + c10 = ja(Ja(Ha), [c10]); + h10 = c10.n.length; + g10 = f10 = 0; + var k10 = b10.length | 0; + h10 = k10 < h10 ? k10 : h10; + k10 = c10.n.length; + for (h10 = h10 < k10 ? h10 : k10; f10 < h10; ) + c10.n[g10] = b10[f10], f10 = 1 + f10 | 0, g10 = 1 + g10 | 0; + a10 = PK(a10, c10); + } else { + a10 = new qg().e("%03d"); + c10 = [b10]; + ua(); + a10 = a10.ja; + K7(); + vk(); + b10 = []; + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + b10.push(EN(c10[f10])), f10 = 1 + f10 | 0; + CJ(); + c10 = b10.length | 0; + c10 = ja(Ja(Ha), [c10]); + h10 = c10.n.length; + g10 = f10 = 0; + k10 = b10.length | 0; + h10 = k10 < h10 ? k10 : h10; + k10 = c10.n.length; + for (h10 = h10 < k10 ? h10 : k10; f10 < h10; ) + c10.n[g10] = b10[f10], f10 = 1 + f10 | 0, g10 = 1 + g10 | 0; + a10 = PK(a10, c10); + } + return "" + e10 + gc(46) + a10; + }; + d7.CO = function(a10, b10, c10, e10) { + this.FG = a10; + this.qH = b10; + this.WH = c10; + this.AL = e10; + YSa || (YSa = new XSa().a()); + a: { + if (!(0 > a10 || 24 < a10)) + if (0 > b10 || 60 < b10 || 24 === a10 && 0 < b10) + a10 = b10; + else if (0 > c10 || 60 < c10 || 24 === a10 && 0 < c10) + a10 = c10; + else { + if (!(0 > e10 || 999999999 < e10 || 24 === a10 && 0 < e10)) + break a; + a10 = e10; + } + throw Jua(new QZ().ue(a10)); + } + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.FG); + a10 = OJ().Ga(a10, this.qH); + a10 = OJ().Ga(a10, this.WH); + a10 = OJ().Ga(a10, this.AL); + return OJ().fe(a10, 4); + }; + d7.$classData = r8({ w3a: 0 }, false, "org.mulesoft.common.time.TimeOfDay", { w3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function N42() { + this.yc = this.Id = this.HW = null; + } + N42.prototype = new u7(); + N42.prototype.constructor = N42; + d7 = N42.prototype; + d7.H = function() { + return "AstToken"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N42 && this.HW === a10.HW && this.Id === a10.Id) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.HW; + case 1: + return this.Id; + case 2: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + var a10 = this.HW; + fF(); + return a10 + " '" + eF(0, this.Id) + "'"; + }; + function zua(a10, b10, c10) { + var e10 = new N42(); + e10.HW = a10; + e10.Id = b10; + e10.yc = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + var YG = r8({ z3a: 0 }, false, "org.mulesoft.lexer.AstToken", { z3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + N42.prototype.$classData = YG; + function SZ() { + this.bg = this.Yf = this.If = this.rf = 0; + } + SZ.prototype = new u7(); + SZ.prototype.constructor = SZ; + d7 = SZ.prototype; + d7.H = function() { + return "InputRange"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof SZ ? this.rf === a10.rf && this.If === a10.If && this.Yf === a10.Yf && this.bg === a10.bg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rf; + case 1: + return this.If; + case 2: + return this.Yf; + case 3: + return this.bg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return "[" + this.rf + "," + this.If + ".." + this.Yf + "," + this.bg + "]"; + }; + d7.CO = function(a10, b10, c10, e10) { + this.rf = a10; + this.If = b10; + this.Yf = c10; + this.bg = e10; + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.rf); + a10 = OJ().Ga(a10, this.If); + a10 = OJ().Ga(a10, this.Yf); + a10 = OJ().Ga(a10, this.bg); + return OJ().fe(a10, 4); + }; + d7.$classData = r8({ E3a: 0 }, false, "org.mulesoft.lexer.InputRange", { E3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function jS() { + this.yc = this.kx = null; + } + jS.prototype = new u7(); + jS.prototype.constructor = jS; + d7 = jS.prototype; + d7.H = function() { + return "TokenData"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jS && this.kx === a10.kx) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.kx; + case 1: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ N3a: 0 }, false, "org.mulesoft.lexer.TokenData", { N3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function EF() { + this.r = this.pM = null; + } + EF.prototype = new u7(); + EF.prototype.constructor = EF; + d7 = EF.prototype; + d7.H = function() { + return "Scalar"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof EF ? this.pM === a10.pM ? Va(Wa(), this.r, a10.r) : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pM; + case 1: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function DF(a10, b10, c10) { + a10.pM = b10; + a10.r = c10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ U3a: 0 }, false, "org.yaml.builder.DocBuilder$Scalar", { U3a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function X8a() { + CF.call(this); + } + X8a.prototype = new X22(); + X8a.prototype.constructor = X8a; + function Y8a() { + } + Y8a.prototype = X8a.prototype; + function YF() { + CF.call(this); + this.ara = null; + } + YF.prototype = new X22(); + YF.prototype.constructor = YF; + YF.prototype.o1 = function(a10) { + this.ara = a10; + a10 = Hb(a10.mv); + CF.prototype.Ge.call(this, a10, null); + return this; + }; + YF.prototype.$classData = r8({ g5a: 0 }, false, "org.yaml.model.YException", { g5a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function KH() { + EG.call(this); + this.sS = null; + } + KH.prototype = new mZa(); + KH.prototype.constructor = KH; + function Z8a() { + } + Z8a.prototype = KH.prototype; + KH.prototype.Ac = function(a10, b10) { + Cs.prototype.Ac.call(this, a10, b10); + this.sS = y7(); + return this; + }; + function sG() { + EG.call(this); + this.sS = this.tea = this.oq = null; + } + sG.prototype = new mZa(); + sG.prototype.constructor = sG; + sG.prototype.hb = function() { + return this.tea; + }; + sG.prototype.re = function() { + return this.oq; + }; + sG.prototype.$classData = r8({ v5a: 0 }, false, "org.yaml.model.YNodePlain", { v5a: 1, aZ: 1, $s: 1, f: 1, oJ: 1, $A: 1 }); + function $8a() { + this.r = this.Ae = null; + } + $8a.prototype = new u7(); + $8a.prototype.constructor = $8a; + d7 = $8a.prototype; + d7.H = function() { + return "ParserResult"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof $8a ? this.Ae === a10.Ae ? Va(Wa(), this.r, a10.r) : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ae; + case 1: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function hH(a10, b10) { + var c10 = new $8a(); + c10.Ae = a10; + c10.r = b10; + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Q5a: 0 }, false, "org.yaml.parser.ParserResult", { Q5a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function x_() { + CF.call(this); + } + x_.prototype = new X22(); + x_.prototype.constructor = x_; + x_.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + x_.prototype.$classData = r8({ A7a: 0 }, false, "java.lang.ArithmeticException", { A7a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Zj() { + CF.call(this); + } + Zj.prototype = new X22(); + Zj.prototype.constructor = Zj; + function a9a() { + } + a9a.prototype = Zj.prototype; + Zj.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + Zj.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + Zj.prototype.$classData = r8({ Zx: 0 }, false, "java.lang.IllegalArgumentException", { Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Hj() { + CF.call(this); + } + Hj.prototype = new X22(); + Hj.prototype.constructor = Hj; + function b9a() { + } + b9a.prototype = Hj.prototype; + Hj.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + Hj.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + Hj.prototype.aH = function(a10, b10) { + CF.prototype.Ge.call(this, a10, b10); + return this; + }; + Hj.prototype.$classData = r8({ Jma: 0 }, false, "java.lang.IllegalStateException", { Jma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function U6() { + CF.call(this); + } + U6.prototype = new X22(); + U6.prototype.constructor = U6; + function c9a() { + } + c9a.prototype = U6.prototype; + U6.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + U6.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + U6.prototype.$classData = r8({ Kma: 0 }, false, "java.lang.IndexOutOfBoundsException", { Kma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function d9a() { + } + d9a.prototype = new eZa(); + d9a.prototype.constructor = d9a; + d9a.prototype.a = function() { + return this; + }; + d9a.prototype.$classData = r8({ N7a: 0 }, false, "java.lang.JSConsoleBasedPrintStream$DummyOutputStream", { N7a: 1, x2a: 1, f: 1, ZY: 1, eba: 1, w7: 1 }); + function sZa() { + CF.call(this); + } + sZa.prototype = new X22(); + sZa.prototype.constructor = sZa; + sZa.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + sZa.prototype.$classData = r8({ R7a: 0 }, false, "java.lang.NegativeArraySizeException", { R7a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function sf() { + CF.call(this); + } + sf.prototype = new X22(); + sf.prototype.constructor = sf; + sf.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + sf.prototype.$classData = r8({ S7a: 0 }, false, "java.lang.NullPointerException", { S7a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Lu() { + CF.call(this); + } + Lu.prototype = new X22(); + Lu.prototype.constructor = Lu; + function e9a() { + } + e9a.prototype = Lu.prototype; + Lu.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + Lu.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + Lu.prototype.$classData = r8({ Mma: 0 }, false, "java.lang.UnsupportedOperationException", { Mma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function iL() { + CF.call(this); + } + iL.prototype = new X22(); + iL.prototype.constructor = iL; + iL.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + iL.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + iL.prototype.$classData = r8({ u8a: 0 }, false, "java.util.NoSuchElementException", { u8a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function O42() { + this.l = this.Ada = null; + } + O42.prototype = new u7(); + O42.prototype.constructor = O42; + function f9a() { + } + d7 = f9a.prototype = O42.prototype; + d7.h = function(a10) { + return a10 instanceof O42 ? this.Ada === a10.Ada && this.vk === a10.vk : false; + }; + d7.tr = function(a10) { + return this.vk < a10.vk ? -1 : this.vk === a10.vk ? 0 : 1; + }; + d7.gs = function(a10) { + return this.vk < a10.vk ? -1 : this.vk === a10.vk ? 0 : 1; + }; + d7.x7a = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Ada = this.l = a10; + }; + d7.z = function() { + return this.vk; + }; + function x7() { + CF.call(this); + this.uV = this.Dna = null; + this.r9 = false; + } + x7.prototype = new X22(); + x7.prototype.constructor = x7; + x7.prototype.xo = function() { + if (!this.r9 && !this.r9) { + if (null === this.uV) + var a10 = "null"; + else + try { + a10 = ka(this.uV) + " (" + ("of class " + Fj(la(this.uV))) + ")"; + } catch (b10) { + if (null !== Ph(E6(), b10)) + a10 = "an instance of class " + Fj(la(this.uV)); + else + throw b10; + } + this.Dna = a10; + this.r9 = true; + } + return this.Dna; + }; + x7.prototype.d = function(a10) { + this.uV = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + x7.prototype.$classData = r8({ W8a: 0 }, false, "scala.MatchError", { W8a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function P42() { + } + P42.prototype = new u7(); + P42.prototype.constructor = P42; + function g9a() { + } + g9a.prototype = P42.prototype; + P42.prototype.ua = function() { + return this.b() ? H10() : ji(this.c(), H10()); + }; + P42.prototype.na = function() { + return !this.b(); + }; + P42.prototype.Ha = function(a10) { + return !this.b() && Va(Wa(), this.c(), a10); + }; + function Vwa() { + } + Vwa.prototype = new u7(); + Vwa.prototype.constructor = Vwa; + d7 = Vwa.prototype; + d7.a = function() { + return this; + }; + d7.P = function(a10) { + this.AS(a10); + }; + d7.vA = function() { + return XI().npa; + }; + d7.ro = function(a10) { + return this.AS(a10) | 0; + }; + d7.t = function() { + return ""; + }; + d7.Ep = function(a10) { + return !!this.AS(a10); + }; + d7.Sa = function() { + return false; + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.AS = function(a10) { + throw new x7().d(a10); + }; + d7.$classData = r8({ b9a: 0 }, false, "scala.PartialFunction$$anon$1", { b9a: 1, f: 1, Ea: 1, za: 1, q: 1, o: 1 }); + function Q42() { + this.eoa = null; + } + Q42.prototype = new OT(); + Q42.prototype.constructor = Q42; + Q42.prototype.P = function(a10) { + return this.Ia(a10); + }; + function $s(a10) { + var b10 = new Q42(); + b10.eoa = a10; + return b10; + } + Q42.prototype.Ia = function(a10) { + a10 = this.eoa.Wa(a10, XI().NP); + return Twa(XI(), a10) ? y7() : new z7().d(a10); + }; + Q42.prototype.$classData = r8({ d9a: 0 }, false, "scala.PartialFunction$Lifted", { d9a: 1, bF: 1, f: 1, za: 1, q: 1, o: 1 }); + function t_() { + } + t_.prototype = new DZa(); + t_.prototype.constructor = t_; + t_.prototype.a = function() { + return this; + }; + t_.prototype.P = function(a10) { + return a10; + }; + t_.prototype.$classData = r8({ g9a: 0 }, false, "scala.Predef$$anon$2", { g9a: 1, Khb: 1, f: 1, za: 1, q: 1, o: 1 }); + function u_() { + } + u_.prototype = new CZa(); + u_.prototype.constructor = u_; + u_.prototype.a = function() { + return this; + }; + u_.prototype.P = function(a10) { + return a10; + }; + u_.prototype.$classData = r8({ h9a: 0 }, false, "scala.Predef$$anon$3", { h9a: 1, Jhb: 1, f: 1, za: 1, q: 1, o: 1 }); + var i9a = function h9a(a10, b10) { + return b10.jg.isArrayClass ? (b10 = Ou(b10), "Array[" + h9a(a10, b10) + "]") : Fj(b10); + }; + function j9a() { + } + j9a.prototype = new u7(); + j9a.prototype.constructor = j9a; + function k9a() { + } + k9a.prototype = j9a.prototype; + j9a.prototype.pk = function() { + return this instanceof ye4 ? new z7().d(this.i) : y7(); + }; + function Bz() { + this.Rh = null; + } + Bz.prototype = new u7(); + Bz.prototype.constructor = Bz; + d7 = Bz.prototype; + d7.H = function() { + return "LeftProjection"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Bz) { + var b10 = this.Rh; + a10 = a10.Rh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Rh; + default: + throw new U6().e("" + a10); + } + }; + d7.c = function() { + var a10 = this.Rh; + if (a10 instanceof ve4) + return a10.i; + throw new iL().e("Either.left.get on Right"); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.ln = function(a10) { + this.Rh = a10; + return this; + }; + d7.pk = function() { + var a10 = this.Rh; + return a10 instanceof ve4 ? new z7().d(a10.i) : y7(); + }; + d7.$classData = r8({ m$a: 0 }, false, "scala.util.Either$LeftProjection", { m$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function zz() { + this.Rh = null; + } + zz.prototype = new u7(); + zz.prototype.constructor = zz; + d7 = zz.prototype; + d7.H = function() { + return "RightProjection"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zz) { + var b10 = this.Rh; + a10 = a10.Rh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Rh; + default: + throw new U6().e("" + a10); + } + }; + d7.c = function() { + var a10 = this.Rh; + if (a10 instanceof ye4) + return a10.i; + throw new iL().e("Either.right.get on Left"); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.ln = function(a10) { + this.Rh = a10; + return this; + }; + d7.pk = function() { + var a10 = this.Rh; + return a10 instanceof ye4 ? new z7().d(a10.i) : y7(); + }; + d7.$classData = r8({ n$a: 0 }, false, "scala.util.Either$RightProjection", { n$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function v_() { + } + v_.prototype = new u7(); + v_.prototype.constructor = v_; + function l9a() { + } + l9a.prototype = v_.prototype; + function HJ() { + CF.call(this); + } + HJ.prototype = new hT(); + HJ.prototype.constructor = HJ; + HJ.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + HJ.prototype.MT = function() { + fWa || (fWa = new eWa().a()); + return fWa.zfa ? CF.prototype.MT.call(this) : this; + }; + HJ.prototype.$classData = r8({ v$a: 0 }, false, "scala.util.control.BreakControl", { v$a: 1, bf: 1, f: 1, o: 1, jW: 1, wda: 1 }); + function U22(a10, b10) { + if (b10 && b10.$classData && b10.$classData.ge.lq) { + var c10; + if (!(c10 = a10 === b10) && (c10 = a10.jb() === b10.jb())) + try { + var e10 = a10.mb(); + for (a10 = true; a10 && e10.Ya(); ) { + var f10 = e10.$a(); + if (null === f10) + throw new x7().d(f10); + var g10 = f10.ma(), h10 = f10.ya(), k10 = b10.Ja(g10); + b: { + if (k10 instanceof z7) { + var l10 = k10.i; + if (Va(Wa(), h10, l10)) { + a10 = true; + break b; + } + } + a10 = false; + } + } + c10 = a10; + } catch (m10) { + throw m10; + } + b10 = c10; + } else + b10 = false; + return b10; + } + function m9a(a10, b10, c10) { + return a10.wm(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return Va(Wa(), f10, g10); + }; + }(a10, b10)), c10); + } + function R42(a10, b10) { + return b10 && b10.$classData && b10.$classData.ge.fg ? b10 === a10 || a10.fm(b10) : false; + } + function S42(a10, b10) { + return 0 <= b10 && b10 < a10.Oa(); + } + function T42() { + this.u = null; + } + T42.prototype = new GT(); + T42.prototype.constructor = T42; + T42.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + T42.prototype.Qd = function() { + Id(); + return new Lf().a(); + }; + T42.prototype.$classData = r8({ N$a: 0 }, false, "scala.collection.Iterable$", { N$a: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var n9a = void 0; + function Xd() { + n9a || (n9a = new T42().a()); + return n9a; + } + function YB() { + this.Eka = this.Fa = null; + } + YB.prototype = new c32(); + YB.prototype.constructor = YB; + YB.prototype.$a = function() { + return this.Eka.P(this.Fa.$a()); + }; + YB.prototype.ou = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Eka = b10; + return this; + }; + YB.prototype.Ya = function() { + return this.Fa.Ya(); + }; + YB.prototype.$classData = r8({ V$a: 0 }, false, "scala.collection.Iterator$$anon$10", { V$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function U42() { + this.Fka = this.Fa = this.el = null; + } + U42.prototype = new c32(); + U42.prototype.constructor = U42; + U42.prototype.$a = function() { + return (this.Ya() ? this.el : $B().ce).$a(); + }; + U42.prototype.ou = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Fka = b10; + this.el = $B().ce; + return this; + }; + U42.prototype.Ya = function() { + for (; !this.el.Ya(); ) { + if (!this.Fa.Ya()) + return false; + this.el = this.Fka.P(this.Fa.$a()).im(); + } + return true; + }; + U42.prototype.$classData = r8({ W$a: 0 }, false, "scala.collection.Iterator$$anon$11", { W$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function V42() { + this.Tz = null; + this.zB = false; + this.Sna = this.Fa = null; + } + V42.prototype = new c32(); + V42.prototype.constructor = V42; + V42.prototype.$a = function() { + return this.Ya() ? (this.zB = false, this.Tz) : $B().ce.$a(); + }; + V42.prototype.ou = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Sna = b10; + this.zB = false; + return this; + }; + V42.prototype.Ya = function() { + if (!this.zB) { + do { + if (!this.Fa.Ya()) + return false; + this.Tz = this.Fa.$a(); + } while (!this.Sna.P(this.Tz)); + this.zB = true; + } + return true; + }; + V42.prototype.$classData = r8({ X$a: 0 }, false, "scala.collection.Iterator$$anon$12", { X$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function W42() { + this.Tz = null; + this.Fv = 0; + this.Lca = this.Fa = null; + } + W42.prototype = new c32(); + W42.prototype.constructor = W42; + function Hoa(a10, b10) { + var c10 = new W42(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.Lca = b10; + c10.Fv = 0; + return c10; + } + W42.prototype.$a = function() { + return this.Ya() ? (this.Fv = 0, this.Lca.P(this.Tz)) : $B().ce.$a(); + }; + W42.prototype.Ya = function() { + for (; 0 === this.Fv; ) + this.Fa.Ya() ? (this.Tz = this.Fa.$a(), this.Lca.Sa(this.Tz) && (this.Fv = 1)) : this.Fv = -1; + return 1 === this.Fv; + }; + W42.prototype.$classData = r8({ Y$a: 0 }, false, "scala.collection.Iterator$$anon$13", { Y$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function X42() { + this.Tz = null; + this.zB = false; + this.Tna = this.l3 = null; + } + X42.prototype = new c32(); + X42.prototype.constructor = X42; + X42.prototype.$a = function() { + return this.Ya() ? (this.zB = false, this.Tz) : $B().ce.$a(); + }; + X42.prototype.ou = function(a10, b10) { + this.Tna = b10; + this.zB = false; + this.l3 = a10; + return this; + }; + X42.prototype.Ya = function() { + return this.zB ? true : this.l3.Ya() ? (this.Tz = this.l3.$a(), this.Tna.P(this.Tz) ? this.zB = true : this.l3 = $B().ce, this.zB) : false; + }; + X42.prototype.$classData = r8({ Z$a: 0 }, false, "scala.collection.Iterator$$anon$15", { Z$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function Y42() { + this.Fv = 0; + this.Vna = this.Fa = this.xO = null; + } + Y42.prototype = new c32(); + Y42.prototype.constructor = Y42; + Y42.prototype.$a = function() { + if (this.Ya()) { + if (1 === this.Fv) + return this.Fa.$a(); + this.Fv = 1; + return this.xO; + } + return $B().ce.$a(); + }; + Y42.prototype.ou = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.Vna = b10; + this.Fv = -1; + return this; + }; + Y42.prototype.Ya = function() { + if (1 === this.Fv) + return this.Fa.Ya(); + if (0 === this.Fv) + return true; + for (; this.Fa.Ya(); ) { + var a10 = this.Fa.$a(); + if (!this.Vna.P(a10)) + return this.xO = a10, this.Fv = 0, true; + } + this.Fv = 1; + return false; + }; + Y42.prototype.$classData = r8({ $$a: 0 }, false, "scala.collection.Iterator$$anon$17", { $$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function Z42() { + this.xea = this.Fa = null; + } + Z42.prototype = new c32(); + Z42.prototype.constructor = Z42; + Z42.prototype.$a = function() { + return this.Kba(); + }; + Z42.prototype.Kba = function() { + return new R6().M(this.Fa.$a(), this.xea.$a()); + }; + Z42.prototype.Ya = function() { + return this.Fa.Ya() && this.xea.Ya(); + }; + Z42.prototype.$classData = r8({ aab: 0 }, false, "scala.collection.Iterator$$anon$18", { aab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function RJ() { + } + RJ.prototype = new c32(); + RJ.prototype.constructor = RJ; + RJ.prototype.$a = function() { + throw new iL().e("next on empty iterator"); + }; + RJ.prototype.a = function() { + return this; + }; + RJ.prototype.Ya = function() { + return false; + }; + RJ.prototype.$classData = r8({ bab: 0 }, false, "scala.collection.Iterator$$anon$2", { bab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function $42() { + this.X0 = false; + this.pka = null; + } + $42.prototype = new c32(); + $42.prototype.constructor = $42; + $42.prototype.$a = function() { + return this.X0 ? (this.X0 = false, this.pka) : $B().ce.$a(); + }; + $42.prototype.d = function(a10) { + this.pka = a10; + this.X0 = true; + return this; + }; + $42.prototype.Ya = function() { + return this.X0; + }; + $42.prototype.$classData = r8({ cab: 0 }, false, "scala.collection.Iterator$$anon$3", { cab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function xT() { + this.jQ = null; + this.dK = this.bC = 0; + } + xT.prototype = new c32(); + xT.prototype.constructor = xT; + xT.prototype.$a = function() { + o9a(this); + return 0 < this.bC ? (this.bC = -1 + this.bC | 0, this.jQ.$a()) : 0 > this.bC ? this.jQ.$a() : $B().ce.$a(); + }; + function p9a(a10, b10) { + if (0 > a10.bC) + return -1; + a10 = a10.bC - b10 | 0; + return 0 > a10 ? 0 : a10; + } + xT.prototype.iC = function(a10, b10) { + a10 = 0 < a10 ? a10 : 0; + if (0 > b10) + b10 = p9a(this, a10); + else if (b10 <= a10) + b10 = 0; + else if (0 > this.bC) + b10 = b10 - a10 | 0; + else { + var c10 = p9a(this, a10); + b10 = b10 - a10 | 0; + b10 = c10 < b10 ? c10 : b10; + } + if (0 === b10) + return $B().ce; + this.dK = this.dK + a10 | 0; + this.bC = b10; + return this; + }; + function o9a(a10) { + for (; 0 < a10.dK; ) + a10.jQ.Ya() ? (a10.jQ.$a(), a10.dK = -1 + a10.dK | 0) : a10.dK = 0; + } + xT.prototype.Ya = function() { + o9a(this); + return 0 !== this.bC && this.jQ.Ya(); + }; + xT.prototype.$classData = r8({ fab: 0 }, false, "scala.collection.Iterator$SliceIterator", { fab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function a52() { + this.Mu = null; + } + a52.prototype = new c32(); + a52.prototype.constructor = a52; + a52.prototype.$a = function() { + if (this.Ya()) { + var a10 = this.Mu.ga(); + this.Mu = this.Mu.ta(); + return a10; + } + return $B().ce.$a(); + }; + function uc(a10) { + var b10 = new a52(); + b10.Mu = a10; + return b10; + } + a52.prototype.ua = function() { + var a10 = this.Mu.ua(); + this.Mu = this.Mu.Jk(0); + return a10; + }; + a52.prototype.Ya = function() { + return !this.Mu.b(); + }; + a52.prototype.$classData = r8({ gab: 0 }, false, "scala.collection.LinearSeqLike$$anon$1", { gab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function b52() { + this.su = null; + } + b52.prototype = new c32(); + b52.prototype.constructor = b52; + b52.prototype.$a = function() { + return this.su.$a().ma(); + }; + b52.prototype.Ya = function() { + return this.su.Ya(); + }; + b52.prototype.Vd = function(a10) { + this.su = a10.mb(); + return this; + }; + b52.prototype.$classData = r8({ iab: 0 }, false, "scala.collection.MapLike$$anon$1", { iab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function c52() { + this.su = null; + } + c52.prototype = new c32(); + c52.prototype.constructor = c52; + c52.prototype.$a = function() { + return this.su.$a().ya(); + }; + c52.prototype.Ya = function() { + return this.su.Ya(); + }; + c52.prototype.Vd = function(a10) { + this.su = a10.mb(); + return this; + }; + c52.prototype.$classData = r8({ jab: 0 }, false, "scala.collection.MapLike$$anon$2", { jab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function d52() { + } + d52.prototype = new KZa(); + d52.prototype.constructor = d52; + d52.prototype.a = function() { + return this; + }; + d52.prototype.Rz = function() { + return vd(); + }; + d52.prototype.Qd = function() { + return wd(new xd(), vd()); + }; + d52.prototype.$classData = r8({ Fab: 0 }, false, "scala.collection.Set$", { Fab: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1 }); + var q9a = void 0; + function r9a() { + q9a || (q9a = new d52().a()); + return q9a; + } + function nJ() { + this.u = null; + } + nJ.prototype = new GT(); + nJ.prototype.constructor = nJ; + nJ.prototype.a = function() { + FT.prototype.a.call(this); + uxa = this; + new GJ().a(); + return this; + }; + nJ.prototype.Qd = function() { + s9a || (s9a = new e52().a()); + return new Lf().a(); + }; + nJ.prototype.$classData = r8({ Gab: 0 }, false, "scala.collection.Traversable$", { Gab: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var uxa = void 0; + function ZB() { + this.D1 = this.bba = null; + } + ZB.prototype = new c32(); + ZB.prototype.constructor = ZB; + ZB.prototype.$a = function() { + return this.Ya() ? this.D1.$a() : $B().ce.$a(); + }; + ZB.prototype.Ya = function() { + for (; ; ) { + if (this.D1.Ya()) + return true; + if (this.bba.Ya()) + this.D1 = this.bba.$a().im(); + else + return false; + } + }; + ZB.prototype.$classData = r8({ Kab: 0 }, false, "scala.collection.TraversableOnce$FlattenOps$$anon$2", { Kab: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function t9a() { + } + t9a.prototype = new KZa(); + t9a.prototype.constructor = t9a; + function u9a() { + } + u9a.prototype = t9a.prototype; + t9a.prototype.Rz = function() { + return this.v0(); + }; + t9a.prototype.Qd = function() { + return wd(new xd(), this.v0()); + }; + function v9a() { + } + v9a.prototype = new KZa(); + v9a.prototype.constructor = v9a; + function w9a() { + } + w9a.prototype = v9a.prototype; + v9a.prototype.Qd = function() { + return Jf(new Kf(), this.Rz()); + }; + function f52() { + this.u = null; + } + f52.prototype = new GT(); + f52.prototype.constructor = f52; + f52.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + f52.prototype.Qd = function() { + return new Lf().a(); + }; + f52.prototype.$classData = r8({ rbb: 0 }, false, "scala.collection.immutable.Iterable$", { rbb: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var x9a = void 0; + function Id() { + x9a || (x9a = new f52().a()); + return x9a; + } + function y9a() { + this.Mu = null; + } + y9a.prototype = new c32(); + y9a.prototype.constructor = y9a; + d7 = y9a.prototype; + d7.$a = function() { + if (!this.Ya()) + return $B().ce.$a(); + var a10 = xya(this.Mu), b10 = a10.ga(); + this.Mu = wya(new eK(), this, oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return e10.ta(); + }; + }(this, a10))); + return b10; + }; + d7.ua = function() { + var a10 = this.Dd(), b10 = ii().u; + return qt(a10, b10); + }; + d7.w1 = function(a10) { + this.Mu = wya(new eK(), this, oq(/* @__PURE__ */ function(b10, c10) { + return function() { + return c10; + }; + }(this, a10))); + return this; + }; + d7.Ya = function() { + var a10 = xya(this.Mu); + return tc(a10); + }; + d7.Dd = function() { + var a10 = xya(this.Mu); + this.Mu = wya(new eK(), this, oq(/* @__PURE__ */ function() { + return function() { + Pt(); + return AT(); + }; + }(this))); + return a10; + }; + d7.$classData = r8({ fcb: 0 }, false, "scala.collection.immutable.StreamIterator", { fcb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function g52() { + this.nea = null; + this.Tj = this.kH = 0; + this.Fa = null; + } + g52.prototype = new c32(); + g52.prototype.constructor = g52; + g52.prototype.$a = function() { + return this.Tw(); + }; + g52.prototype.Tw = function() { + if (this.Tj >= this.kH) + throw new iL().e("next on empty iterator"); + for (var a10 = this.Tj; ; ) { + if (this.Tj < this.kH) { + var b10 = this.Fa.gG(this.Tj); + b10 = !(10 === b10 || 12 === b10); + } else + b10 = false; + if (b10) + this.Tj = 1 + this.Tj | 0; + else + break; + } + b10 = this.Tj = 1 + this.Tj | 0; + var c10 = this.kH; + return this.nea.substring(a10, b10 < c10 ? b10 : c10); + }; + g52.prototype.Ya = function() { + return this.Tj < this.kH; + }; + g52.prototype.$classData = r8({ scb: 0 }, false, "scala.collection.immutable.StringLike$$anon$1", { scb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function e52() { + this.u = null; + } + e52.prototype = new GT(); + e52.prototype.constructor = e52; + e52.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + e52.prototype.Qd = function() { + return new Lf().a(); + }; + e52.prototype.$classData = r8({ vcb: 0 }, false, "scala.collection.immutable.Traversable$", { vcb: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var s9a = void 0; + function h52() { + this.be = null; + this.bx = 0; + this.QP = this.Nda = this.L2 = null; + this.UH = 0; + this.eM = null; + } + h52.prototype = new c32(); + h52.prototype.constructor = h52; + function z9a() { + } + z9a.prototype = h52.prototype; + h52.prototype.$a = function() { + if (null !== this.eM) { + var a10 = this.eM.$a(); + this.eM.Ya() || (this.eM = null); + return a10; + } + a: { + a10 = this.QP; + var b10 = this.UH; + for (; ; ) { + b10 === (-1 + a10.n.length | 0) ? (this.bx = -1 + this.bx | 0, 0 <= this.bx ? (this.QP = this.L2.n[this.bx], this.UH = this.Nda.n[this.bx], this.L2.n[this.bx] = null) : (this.QP = null, this.UH = 0)) : this.UH = 1 + this.UH | 0; + a10 = a10.n[b10]; + if (a10 instanceof A9a || a10 instanceof i52) { + a10 = this.Rka(a10); + break a; + } + if (a10 instanceof j52 || a10 instanceof k52) + 0 <= this.bx && (this.L2.n[this.bx] = this.QP, this.Nda.n[this.bx] = this.UH), this.bx = 1 + this.bx | 0, this.QP = B9a(a10), this.UH = 0, a10 = B9a(a10), b10 = 0; + else { + this.eM = a10.mb(); + a10 = this.$a(); + break a; + } + } + } + return a10; + }; + h52.prototype.Ya = function() { + return null !== this.eM || 0 <= this.bx; + }; + function B9a(a10) { + if (a10 instanceof j52) + return a10.hl; + if (!(a10 instanceof k52)) + throw new x7().d(a10); + return a10.yf; + } + h52.prototype.bla = function(a10) { + this.be = a10; + this.bx = 0; + this.L2 = ja(Ja(Ja(C9a)), [6]); + this.Nda = ja(Ja(Qa), [6]); + this.QP = this.be; + this.UH = 0; + this.eM = null; + }; + function l52() { + this.vk = 0; + this.Fa = null; + } + l52.prototype = new c32(); + l52.prototype.constructor = l52; + l52.prototype.$a = function() { + return 0 < this.vk ? (this.vk = -1 + this.vk | 0, this.Fa.lb(this.vk)) : $B().ce.$a(); + }; + l52.prototype.Ya = function() { + return 0 < this.vk; + }; + function D9a(a10) { + var b10 = new l52(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + b10.vk = a10.Oa(); + return b10; + } + l52.prototype.$classData = r8({ zcb: 0 }, false, "scala.collection.immutable.Vector$$anon$1", { zcb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function Aya() { + this.nv = this.BA = null; + } + Aya.prototype = new u7(); + Aya.prototype.constructor = Aya; + function zya(a10, b10, c10) { + a10.nv = c10; + a10.BA = b10; + return a10; + } + d7 = Aya.prototype; + d7.h = function(a10) { + return null !== a10 && (a10 === this || a10 === this.BA || ra(a10, this.BA)); + }; + d7.Kk = function(a10) { + this.BA.jd(a10); + return this; + }; + d7.t = function() { + return "" + this.BA; + }; + d7.Rc = function() { + return this.nv.P(this.BA.Rc()); + }; + d7.zt = function(a10, b10) { + this.BA.zt(a10, b10); + }; + d7.jd = function(a10) { + this.BA.jd(a10); + return this; + }; + d7.z = function() { + return this.BA.z(); + }; + d7.pj = function(a10) { + this.BA.pj(a10); + }; + d7.jh = function(a10) { + this.BA.jh(a10); + return this; + }; + d7.$classData = r8({ mdb: 0 }, false, "scala.collection.mutable.Builder$$anon$1", { mdb: 1, f: 1, vl: 1, ul: 1, tl: 1, Phb: 1 }); + function m52() { + this.vk = 0; + this.Fa = null; + } + m52.prototype = new c32(); + m52.prototype.constructor = m52; + m52.prototype.$a = function() { + return this.Ya() ? (this.vk = 1 + this.vk | 0, Pda(this.Fa.ze.n[-1 + this.vk | 0])) : $B().ce.$a(); + }; + m52.prototype.Ya = function() { + for (; this.vk < this.Fa.ze.n.length && null === this.Fa.ze.n[this.vk]; ) + this.vk = 1 + this.vk | 0; + return this.vk < this.Fa.ze.n.length; + }; + m52.prototype.$classData = r8({ pdb: 0 }, false, "scala.collection.mutable.FlatHashTable$$anon$1", { pdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function n52() { + this.su = null; + } + n52.prototype = new c32(); + n52.prototype.constructor = n52; + n52.prototype.$a = function() { + return this.su.$a().la; + }; + n52.prototype.Ya = function() { + return this.su.Ya(); + }; + n52.prototype.Yn = function(a10) { + this.su = E9a(a10); + return this; + }; + n52.prototype.$classData = r8({ vdb: 0 }, false, "scala.collection.mutable.HashMap$$anon$3", { vdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function o52() { + this.su = null; + } + o52.prototype = new c32(); + o52.prototype.constructor = o52; + o52.prototype.$a = function() { + return this.su.$a().r; + }; + o52.prototype.Ya = function() { + return this.su.Ya(); + }; + o52.prototype.Yn = function(a10) { + this.su = E9a(a10); + return this; + }; + o52.prototype.$classData = r8({ wdb: 0 }, false, "scala.collection.mutable.HashMap$$anon$4", { wdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function p52() { + this.aba = null; + this.BO = 0; + this.pK = null; + } + p52.prototype = new c32(); + p52.prototype.constructor = p52; + p52.prototype.$a = function() { + var a10 = this.pK; + for (this.pK = this.pK.$a(); null === this.pK && 0 < this.BO; ) + this.BO = -1 + this.BO | 0, this.pK = this.aba.n[this.BO]; + return a10; + }; + function E9a(a10) { + var b10 = new p52(); + b10.aba = a10.ze; + b10.BO = pD(a10); + b10.pK = b10.aba.n[b10.BO]; + return b10; + } + p52.prototype.Ya = function() { + return null !== this.pK; + }; + p52.prototype.$classData = r8({ Adb: 0 }, false, "scala.collection.mutable.HashTable$$anon$1", { Adb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function q52() { + this.u = null; + } + q52.prototype = new GT(); + q52.prototype.constructor = q52; + q52.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + q52.prototype.Qd = function() { + return new Xj().a(); + }; + q52.prototype.$classData = r8({ Idb: 0 }, false, "scala.collection.mutable.Iterable$", { Idb: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var F9a = void 0; + function Toa() { + F9a || (F9a = new q52().a()); + return F9a; + } + function G9a() { + this.Jo = null; + } + G9a.prototype = new u7(); + G9a.prototype.constructor = G9a; + function H9a() { + } + d7 = H9a.prototype = G9a.prototype; + d7.a = function() { + this.Jo = new Lf().a(); + return this; + }; + d7.Kk = function(a10) { + return I9a(this, a10); + }; + function I9a(a10, b10) { + var c10 = a10.Jo; + ii(); + b10 = [b10]; + for (var e10 = -1 + (b10.length | 0) | 0, f10 = H10(); 0 <= e10; ) + f10 = ji(b10[e10], f10), e10 = -1 + e10 | 0; + Dg(c10, f10); + return a10; + } + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.jd = function(a10) { + return I9a(this, a10); + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + Dg(this.Jo, a10); + return this; + }; + function J9a() { + this.el = null; + } + J9a.prototype = new c32(); + J9a.prototype.constructor = J9a; + d7 = J9a.prototype; + d7.$a = function() { + return this.Kba(); + }; + d7.Kba = function() { + if (this.Ya()) { + var a10 = new R6().M(this.el.la, this.el.r); + this.el = this.el.Eo; + return a10; + } + return $B().ce.$a(); + }; + d7.Ya = function() { + return null !== this.el; + }; + d7.cL = function(a10) { + this.el = a10.it; + return this; + }; + d7.$classData = r8({ Mdb: 0 }, false, "scala.collection.mutable.LinkedHashMap$$anon$1", { Mdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function r52() { + this.el = null; + } + r52.prototype = new c32(); + r52.prototype.constructor = r52; + r52.prototype.$a = function() { + if (this.Ya()) { + var a10 = this.el.la; + this.el = this.el.Eo; + return a10; + } + return $B().ce.$a(); + }; + r52.prototype.Ya = function() { + return null !== this.el; + }; + r52.prototype.cL = function(a10) { + this.el = a10.it; + return this; + }; + r52.prototype.$classData = r8({ Ndb: 0 }, false, "scala.collection.mutable.LinkedHashMap$$anon$2", { Ndb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function s52() { + this.el = null; + } + s52.prototype = new c32(); + s52.prototype.constructor = s52; + s52.prototype.$a = function() { + if (this.Ya()) { + var a10 = this.el.r; + this.el = this.el.Eo; + return a10; + } + return $B().ce.$a(); + }; + s52.prototype.Ya = function() { + return null !== this.el; + }; + s52.prototype.cL = function(a10) { + this.el = a10.it; + return this; + }; + s52.prototype.$classData = r8({ Odb: 0 }, false, "scala.collection.mutable.LinkedHashMap$$anon$3", { Odb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function t52() { + this.el = null; + } + t52.prototype = new c32(); + t52.prototype.constructor = t52; + t52.prototype.$a = function() { + if (this.Ya()) { + var a10 = this.el.la; + this.el = this.el.Eo; + return a10; + } + return $B().ce.$a(); + }; + t52.prototype.Ya = function() { + return null !== this.el; + }; + t52.prototype.$classData = r8({ Sdb: 0 }, false, "scala.collection.mutable.LinkedHashSet$$anon$1", { Sdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function u52() { + this.dT = null; + } + u52.prototype = new c32(); + u52.prototype.constructor = u52; + u52.prototype.$a = function() { + if (this.Ya()) { + var a10 = this.dT.ga(); + this.dT = this.dT.ta(); + return a10; + } + throw new iL().e("next on empty Iterator"); + }; + u52.prototype.Ya = function() { + return this.dT !== H10(); + }; + u52.prototype.$classData = r8({ Wdb: 0 }, false, "scala.collection.mutable.ListBuffer$$anon$1", { Wdb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function VA() { + this.eb = this.ce = null; + } + VA.prototype = new u7(); + VA.prototype.constructor = VA; + function WA(a10, b10) { + a10.eb = a10.eb.Ru(b10); + return a10; + } + d7 = VA.prototype; + d7.Kk = function(a10) { + return WA(this, a10); + }; + d7.Rc = function() { + return this.eb; + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + function UA(a10, b10) { + a10.ce = b10; + a10.eb = b10; + return a10; + } + d7.jd = function(a10) { + return WA(this, a10); + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ $db: 0 }, false, "scala.collection.mutable.MapBuilder", { $db: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1 }); + function xd() { + this.eb = this.ce = null; + } + xd.prototype = new u7(); + xd.prototype.constructor = xd; + d7 = xd.prototype; + d7.Kk = function(a10) { + return Ad(this, a10); + }; + d7.Rc = function() { + return this.eb; + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + function Ad(a10, b10) { + a10.eb = a10.eb.Zj(b10); + return a10; + } + function wd(a10, b10) { + a10.ce = b10; + a10.eb = b10; + return a10; + } + d7.jd = function(a10) { + return Ad(this, a10); + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ deb: 0 }, false, "scala.collection.mutable.SetBuilder", { deb: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1 }); + function K9a() { + this.eb = this.Ae = null; + this.aF = this.oB = 0; + } + K9a.prototype = new u7(); + K9a.prototype.constructor = K9a; + d7 = K9a.prototype; + d7.XO = function(a10) { + this.Ae = a10; + this.aF = this.oB = 0; + return this; + }; + d7.Kk = function(a10) { + return L9a(this, a10); + }; + function L9a(a10, b10) { + var c10 = 1 + a10.aF | 0; + if (a10.oB < c10) { + for (var e10 = 0 === a10.oB ? 16 : a10.oB << 1; e10 < c10; ) + e10 <<= 1; + c10 = e10; + a10.eb = M9a(a10, c10); + a10.oB = c10; + } + a10.eb.qC(a10.aF, b10); + a10.aF = 1 + a10.aF | 0; + return a10; + } + function M9a(a10, b10) { + var c10 = a10.Ae.Lo(); + b10 = c10 === q5(Oa) ? new v52().HG(ja(Ja(Oa), [b10])) : c10 === q5(Pa) ? new w52().MG(ja(Ja(Pa), [b10])) : c10 === q5(Na) ? new dB().BB(ja(Ja(Na), [b10])) : c10 === q5(Qa) ? new x52().KG(ja(Ja(Qa), [b10])) : c10 === q5(Ra) ? new y52().LG(ja(Ja(Ra), [b10])) : c10 === q5(Sa) ? new z52().JG(ja(Ja(Sa), [b10])) : c10 === q5(Ta) ? new A52().IG(ja(Ja(Ta), [b10])) : c10 === q5(Ma) ? new B52().NG(ja(Ja(Ma), [b10])) : c10 === q5(Ka) ? new C52().OG(ja(Ja(oa), [b10])) : new VI().fd(a10.Ae.zs(b10)); + 0 < a10.aF && Pu(Gd(), a10.eb.L, 0, b10.L, 0, a10.aF); + return b10; + } + d7.Rc = function() { + if (0 !== this.oB && this.oB === this.aF) { + this.oB = 0; + var a10 = this.eb; + } else + a10 = M9a(this, this.aF); + return a10; + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.jd = function(a10) { + return L9a(this, a10); + }; + d7.pj = function(a10) { + this.oB < a10 && (this.eb = M9a(this, a10), this.oB = a10); + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ seb: 0 }, false, "scala.collection.mutable.WrappedArrayBuilder", { seb: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1 }); + function nz() { + CF.call(this); + this.Oqa = this.Aa = null; + } + nz.prototype = new hT(); + nz.prototype.constructor = nz; + function N9a() { + } + d7 = N9a.prototype = nz.prototype; + d7.MT = function() { + return this; + }; + d7.Dt = function() { + return this.Oqa; + }; + d7.Pqa = function() { + this.Dt(); + }; + d7.M = function(a10, b10) { + this.Aa = a10; + this.Oqa = b10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + d7.Oea = function() { + return !!this.Dt(); + }; + d7.$classData = r8({ jea: 0 }, false, "scala.runtime.NonLocalReturnControl", { jea: 1, bf: 1, f: 1, o: 1, jW: 1, wda: 1 }); + function oL() { + this.zja = this.MS = 0; + this.$qa = null; + } + oL.prototype = new c32(); + oL.prototype.constructor = oL; + oL.prototype.$a = function() { + var a10 = this.$qa.G(this.MS); + this.MS = 1 + this.MS | 0; + return a10; + }; + oL.prototype.Ya = function() { + return this.MS < this.zja; + }; + oL.prototype.$classData = r8({ dfb: 0 }, false, "scala.runtime.ScalaRunTime$$anon$1", { dfb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function O9a() { + QT.call(this); + } + O9a.prototype = new f32(); + O9a.prototype.constructor = O9a; + O9a.prototype.a = function() { + var a10 = Du().$; + QT.prototype.FB.call(this, a10, hk()); + return this; + }; + O9a.prototype.$classData = r8({ era: 0 }, false, "amf.AmfProfile$", { era: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var P9a = void 0; + function kk() { + P9a || (P9a = new O9a().a()); + return P9a; + } + function rk() { + QT.call(this); + } + rk.prototype = new f32(); + rk.prototype.constructor = rk; + rk.prototype.a = function() { + var a10 = Eia().$; + QT.prototype.FB.call(this, a10, hk()); + return this; + }; + rk.prototype.$classData = r8({ fra: 0 }, false, "amf.AmlProfile$", { fra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Tda = void 0; + function Q9a() { + QT.call(this); + } + Q9a.prototype = new f32(); + Q9a.prototype.constructor = Q9a; + Q9a.prototype.a = function() { + QT.prototype.FB.call(this, Bu().$, Ub()); + return this; + }; + Q9a.prototype.$classData = r8({ jra: 0 }, false, "amf.Oas20Profile$", { jra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var R9a = void 0; + function mk() { + R9a || (R9a = new Q9a().a()); + return R9a; + } + function S9a() { + QT.call(this); + } + S9a.prototype = new f32(); + S9a.prototype.constructor = S9a; + S9a.prototype.a = function() { + QT.prototype.FB.call(this, Cu().$, Ub()); + return this; + }; + S9a.prototype.$classData = r8({ kra: 0 }, false, "amf.Oas30Profile$", { kra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var T9a = void 0; + function nk() { + T9a || (T9a = new S9a().a()); + return T9a; + } + function U9a() { + QT.call(this); + } + U9a.prototype = new f32(); + U9a.prototype.constructor = U9a; + U9a.prototype.a = function() { + QT.prototype.FB.call(this, Au().$, Ub()); + return this; + }; + U9a.prototype.$classData = r8({ lra: 0 }, false, "amf.OasProfile$", { lra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var V9a = void 0; + function lk() { + V9a || (V9a = new U9a().a()); + return V9a; + } + function sk() { + QT.call(this); + } + sk.prototype = new f32(); + sk.prototype.constructor = sk; + sk.prototype.a = function() { + var a10 = Vf().$; + QT.prototype.FB.call(this, a10, hk()); + return this; + }; + sk.prototype.$classData = r8({ mra: 0 }, false, "amf.PayloadProfile$", { mra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Uda = void 0; + function W9a() { + QT.call(this); + } + W9a.prototype = new f32(); + W9a.prototype.constructor = W9a; + W9a.prototype.a = function() { + QT.prototype.FB.call(this, Qb().$, Tb()); + return this; + }; + W9a.prototype.$classData = r8({ qra: 0 }, false, "amf.Raml08Profile$", { qra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var X9a = void 0; + function qk() { + X9a || (X9a = new W9a().a()); + return X9a; + } + function Y9a() { + QT.call(this); + } + Y9a.prototype = new f32(); + Y9a.prototype.constructor = Y9a; + Y9a.prototype.a = function() { + QT.prototype.FB.call(this, Pb().$, Tb()); + return this; + }; + Y9a.prototype.$classData = r8({ rra: 0 }, false, "amf.Raml10Profile$", { rra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Z9a = void 0; + function pk() { + Z9a || (Z9a = new Y9a().a()); + return Z9a; + } + function $9a() { + QT.call(this); + } + $9a.prototype = new f32(); + $9a.prototype.constructor = $9a; + $9a.prototype.a = function() { + QT.prototype.FB.call(this, Ob().$, Tb()); + return this; + }; + $9a.prototype.$classData = r8({ sra: 0 }, false, "amf.RamlProfile$", { sra: 1, PA: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var a$a2 = void 0; + function ok2() { + a$a2 || (a$a2 = new $9a().a()); + return a$a2; + } + function UZa() { + } + UZa.prototype = new y_(); + UZa.prototype.constructor = UZa; + d7 = UZa.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ Pta: 0 }, false, "amf.client.model.Annotations$$anonfun$custom$1", { Pta: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function YZa() { + } + YZa.prototype = new y_(); + YZa.prototype.constructor = YZa; + d7 = YZa.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof GC ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof GC; + }; + d7.$classData = r8({ Qta: 0 }, false, "amf.client.model.Annotations$$anonfun$isTracked$1", { Qta: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ZZa() { + this.sM = null; + } + ZZa.prototype = new y_(); + ZZa.prototype.constructor = ZZa; + d7 = ZZa.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof GC && a10.Ds.Ha(this.sM) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof GC && a10.Ds.Ha(this.sM) ? true : false; + }; + d7.$classData = r8({ Rta: 0 }, false, "amf.client.model.Annotations$$anonfun$isTrackedBy$1", { Rta: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function D52() { + this.ea = this.k = null; + } + D52.prototype = new u7(); + D52.prototype.constructor = D52; + d7 = D52.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + D52.prototype.a7a.call(this, new BO().K(new S6().a(), a10)); + return this; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + d7.qk = function() { + return this.k; + }; + d7.Qv = function() { + i32(); + var a10 = B6(this.k.g, Gc().nb); + var b10 = i32(); + if (null === i32().nZ && null === i32().nZ) { + var c10 = i32(), e10 = new A0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.nZ = e10; + } + b10 = i32().nZ; + return xu(b10.l.ea, a10); + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + function E52() { + return new xp().a(); + } + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.a7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.rI = function(a10) { + var b10 = this.k, c10 = i32(), e10 = F52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Bd().vh; + Zd(b10, c10, a10); + return this; + }; + d7.eo = function() { + return ZT(this); + }; + d7.tK = function() { + var a10 = i32(), b10 = cd(this.k), c10 = F52(); + return Ak(a10, b10, c10).Ra(); + }; + D52.prototype.annotations = function() { + return this.rb(); + }; + D52.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(D52.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + D52.prototype.findByType = function(a10) { + return this.qp(a10); + }; + D52.prototype.findById = function(a10) { + return this.pp(a10); + }; + D52.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + D52.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + D52.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + D52.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + D52.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(D52.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(D52.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(D52.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(D52.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + D52.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(D52.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + D52.prototype.withEncodes = function(a10) { + if (a10 instanceof G52) { + var b10 = this.k; + a10 = a10.k; + var c10 = Gc().nb; + Vd(b10, c10, a10); + return this; + } + if (HLa(a10)) + return this.Pv(a10); + throw "No matching overload"; + }; + D52.prototype.withExternals = function(a10) { + return this.rI(a10); + }; + Object.defineProperty(D52.prototype, "externals", { get: function() { + return this.tK(); + }, configurable: true }); + Object.defineProperty(D52.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + D52.prototype.$classData = r8({ Zta: 0 }, false, "amf.client.model.document.DialectFragment", { Zta: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1 }); + function H5() { + this.ea = this.k = null; + } + H5.prototype = new u7(); + H5.prototype.constructor = H5; + d7 = H5.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + H5.prototype.c7a.call(this, new y32().K(new S6().a(), a10)); + return this; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.e4 = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Jk().nb; + Vd(b10, c10, a10); + return this; + }; + d7.c7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + function b$a2(a10) { + return new I52().$z(B6(a10.k.g, qO().nb)); + } + d7.Qv = function() { + return b$a2(this); + }; + d7.qk = function() { + return this.k; + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.eo = function() { + return ZT(this); + }; + H5.prototype.annotations = function() { + return this.rb(); + }; + H5.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(H5.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + H5.prototype.findByType = function(a10) { + return this.qp(a10); + }; + H5.prototype.findById = function(a10) { + return this.pp(a10); + }; + H5.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + H5.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + H5.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + H5.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + H5.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(H5.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(H5.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(H5.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(H5.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + H5.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(H5.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + H5.prototype.withEncodes = function(a10) { + if (a10 instanceof I52) + return this.e4(a10); + if (HLa(a10)) + return this.Pv(a10); + throw "No matching overload"; + }; + Object.defineProperty(H5.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + H5.prototype.$classData = r8({ aua: 0 }, false, "amf.client.model.document.DialectInstanceFragment", { aua: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1 }); + function J52() { + this.ea = this.k = null; + } + J52.prototype = new u7(); + J52.prototype.constructor = J52; + d7 = J52.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + J52.prototype.d7a.call(this, new x32().K(new S6().a(), a10)); + return this; + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.d7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + J52.prototype.annotations = function() { + return this.rb(); + }; + J52.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(J52.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + J52.prototype.findByType = function(a10) { + return this.qp(a10); + }; + J52.prototype.findById = function(a10) { + return this.pp(a10); + }; + J52.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + J52.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + J52.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + J52.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + J52.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(J52.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(J52.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(J52.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(J52.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + J52.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(J52.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + J52.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + J52.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(J52.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + J52.prototype.$classData = r8({ bua: 0 }, false, "amf.client.model.document.DialectInstanceLibrary", { bua: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1 }); + function K5() { + this.ea = this.k = null; + } + K5.prototype = new u7(); + K5.prototype.constructor = K5; + d7 = K5.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + K5.prototype.iaa.call(this, new AO().K(new S6().a(), a10)); + return this; + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.iaa = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + K5.prototype.annotations = function() { + return this.rb(); + }; + K5.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(K5.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + K5.prototype.findByType = function(a10) { + return this.qp(a10); + }; + K5.prototype.findById = function(a10) { + return this.pp(a10); + }; + K5.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + K5.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + K5.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + K5.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + K5.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(K5.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(K5.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(K5.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(K5.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + K5.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(K5.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + K5.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + K5.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(K5.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + K5.prototype.$classData = r8({ dua: 0 }, false, "amf.client.model.document.DialectLibrary", { dua: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1 }); + function Lk() { + this.ea = this.k = null; + } + Lk.prototype = new u7(); + Lk.prototype.constructor = Lk; + function L52() { + } + d7 = L52.prototype = Lk.prototype; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.yp(); + }; + d7.qk = function() { + return this.yp(); + }; + d7.Qv = function() { + return nAa(this); + }; + d7.CB = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.yp = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.Be().j; + }; + d7.oc = function() { + return this.yp(); + }; + d7.eo = function() { + return ZT(this); + }; + Lk.prototype.annotations = function() { + return this.rb(); + }; + Lk.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(Lk.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + Lk.prototype.findByType = function(a10) { + return this.qp(a10); + }; + Lk.prototype.findById = function(a10) { + return this.pp(a10); + }; + Lk.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + Lk.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + Lk.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + Lk.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + Lk.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(Lk.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(Lk.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(Lk.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(Lk.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + Lk.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(Lk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Lk.prototype.withEncodes = function(a10) { + return this.Pv(a10); + }; + Object.defineProperty(Lk.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + Lk.prototype.$classData = r8({ xq: 0 }, false, "amf.client.model.document.Fragment", { xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1 }); + function M52() { + this.ea = this.k = null; + } + M52.prototype = new u7(); + M52.prototype.constructor = M52; + function c$a2() { + } + d7 = c$a2.prototype = M52.prototype; + d7.TG = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + M52.prototype.TG.call(this, new ad().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + i32(); + var a10 = B6(this.Xr().g, bd().R); + i32().cb(); + return gb(a10); + }; + d7.Xr = function() { + return this.k; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.Xr(); + }; + d7.$3 = function(a10) { + var b10 = this.Xr(), c10 = bd().Kh; + eb(b10, c10, a10); + return this; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.Rj = function() { + i32(); + var a10 = B6(this.Xr().g, Bq().ae); + i32().cb(); + return gb(a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.Xr(); + }; + d7.p9 = function() { + i32(); + var a10 = B6(this.Xr().g, bd().Kh); + i32().cb(); + return gb(a10); + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.Xr().j; + }; + d7.oc = function() { + return this.Xr(); + }; + d7.sh = function() { + return this.Rj(); + }; + d7.rI = function(a10) { + var b10 = this.Xr(), c10 = i32(), e10 = F52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Bd().vh; + Zd(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + var b10 = this.Xr(), c10 = bd().R; + eb(b10, c10, a10); + return this; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + d7.tK = function() { + var a10 = i32(), b10 = cd(this.Xr()), c10 = F52(); + return Ak(a10, b10, c10).Ra(); + }; + M52.prototype.annotations = function() { + return this.rb(); + }; + M52.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(M52.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + M52.prototype.findByType = function(a10) { + return this.qp(a10); + }; + M52.prototype.findById = function(a10) { + return this.pp(a10); + }; + M52.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + M52.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + M52.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + M52.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + M52.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(M52.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(M52.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(M52.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(M52.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + M52.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(M52.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + M52.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + M52.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(M52.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + M52.prototype.classTerms = function() { + var a10 = i32(), b10 = B6(this.Xr().g, bd().Ic), c10 = new d$a2(), e10 = K7(); + b10 = b10.ec(c10, e10.u); + c10 = i32(); + if (null === i32().AX && null === i32().AX) { + e10 = i32(); + var f10 = new K_(); + if (null === c10) + throw mb(E6(), null); + f10.l = c10; + e10.AX = f10; + } + c10 = i32().AX; + return Ak(a10, b10, c10).Ra(); + }; + M52.prototype.datatypePropertyTerms = function() { + var a10 = i32(), b10 = B6(this.Xr().g, bd().Ic), c10 = new e$a2(), e10 = K7(); + b10 = b10.ec(c10, e10.u); + c10 = i32(); + if (null === i32().GX && null === i32().GX) { + e10 = i32(); + var f10 = new $_(); + if (null === c10) + throw mb(E6(), null); + f10.l = c10; + e10.GX = f10; + } + c10 = i32().GX; + return Ak(a10, b10, c10).Ra(); + }; + M52.prototype.objectPropertyTerms = function() { + var a10 = i32(), b10 = B6(this.Xr().g, bd().Ic), c10 = new f$a2(), e10 = K7(); + b10 = b10.ec(c10, e10.u); + c10 = i32(); + if (null === i32().xZ && null === i32().xZ) { + e10 = i32(); + var f10 = new D0(); + if (null === c10) + throw mb(E6(), null); + f10.l = c10; + e10.xZ = f10; + } + c10 = i32().xZ; + return Ak(a10, b10, c10).Ra(); + }; + M52.prototype.withImports = function(a10) { + var b10 = this.Xr(), c10 = i32(), e10 = g$a2(); + a10 = uk(tk(c10, a10, e10)); + c10 = bd().$C; + Zd(b10, c10, a10); + return this; + }; + M52.prototype.withExternals = function(a10) { + return this.rI(a10); + }; + M52.prototype.withBase = function(a10) { + return this.$3(a10); + }; + M52.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(M52.prototype, "externals", { get: function() { + return this.tK(); + }, configurable: true }); + Object.defineProperty(M52.prototype, "imports", { get: function() { + var a10 = i32(), b10 = B6(this.Xr().g, bd().$C), c10 = g$a2(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(M52.prototype, "base", { get: function() { + return this.p9(); + }, configurable: true }); + Object.defineProperty(M52.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(M52.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + M52.prototype.$classData = r8({ vga: 0 }, false, "amf.client.model.document.Vocabulary", { vga: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1 }); + function d$a2() { + } + d$a2.prototype = new y_(); + d$a2.prototype.constructor = d$a2; + d7 = d$a2.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof gO ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof gO; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ eua: 0 }, false, "amf.client.model.document.Vocabulary$$anonfun$classTerms$1", { eua: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function e$a2() { + } + e$a2.prototype = new y_(); + e$a2.prototype.constructor = e$a2; + d7 = e$a2.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof cO ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof cO; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ fua: 0 }, false, "amf.client.model.document.Vocabulary$$anonfun$datatypePropertyTerms$1", { fua: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function f$a2() { + } + f$a2.prototype = new y_(); + f$a2.prototype.constructor = f$a2; + d7 = f$a2.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof dO ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof dO; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ gua: 0 }, false, "amf.client.model.document.Vocabulary$$anonfun$objectPropertyTerms$1", { gua: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function h$a2() { + } + h$a2.prototype = new y_(); + h$a2.prototype.constructor = h$a2; + d7 = h$a2.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ vua: 0 }, false, "amf.client.model.domain.DialectDomainElement$$anonfun$1", { vua: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function i$a2(a10, b10) { + var c10 = a10.k, e10 = zD().ck; + eb(c10, e10, b10); + return a10; + } + function j$a2(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().CF); + return FWa(k$a2(), a10); + } + function l$a2(a10) { + Z10(); + a10 = a10.k; + a10 = B6(a10.Y(), a10.Zg()); + Z10().cb(); + return gb(a10); + } + function m$a2(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().Sf); + return U_(N52(), a10); + } + function n$a2(a10) { + Z10(); + a10 = a10.k; + var b10 = y7(); + a10 = jQ(a10, b10); + return L0(O52(), a10); + } + function o$a2(a10, b10) { + var c10 = a10.k, e10 = Z10(), f10 = p$a2(); + b10 = uk(tk(e10, b10, f10)); + e10 = zD().go; + Zd(c10, e10, b10); + return a10; + } + function q$a(a10) { + var b10 = Z10(); + a10 = B6(a10.k.Y(), zD().Ec); + var c10 = P52(); + return Ak(b10, a10, c10).Ra(); + } + function r$a2(a10, b10) { + var c10 = a10.k, e10 = Z10(), f10 = s$a2(); + b10 = uk(tk(e10, b10, f10)); + e10 = zD().Xm; + Zd(c10, e10, b10); + return a10; + } + function t$a2(a10, b10) { + var c10 = a10.k; + Z10(); + N52(); + b10 = b10.k; + var e10 = zD().Sf; + Vd(c10, e10, b10); + return a10; + } + function u$a2(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().Kn); + Z10().cb(); + return gb(a10); + } + function v$a2(a10) { + var b10 = Z10(); + a10 = B6(a10.k.Y(), zD().go); + var c10 = p$a2(); + return Ak(b10, a10, c10).Ra(); + } + function w$a2(a10, b10) { + var c10 = a10.k; + Z10(); + k$a2(); + b10 = b10.k; + var e10 = zD().CF; + Vd(c10, e10, b10); + return a10; + } + function x$a2(a10) { + var b10 = Z10(); + a10 = B6(a10.k.Y(), zD().Xm); + var c10 = s$a2(); + return Ak(b10, a10, c10).Ra(); + } + function y$a2(a10) { + var b10 = Z10(); + a10 = B6(a10.k.Y(), zD().Ne); + var c10 = O52(); + return Ak(b10, a10, c10).Ra(); + } + function z$a(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().Va); + Z10().cb(); + return gb(a10); + } + function A$a2(a10, b10) { + Z10(); + a10 = a10.k; + var c10 = Z10(); + b10 = yAa(Xda(c10, b10).gk); + b10 = jQ(a10, b10); + return L0(O52(), b10); + } + function B$a2(a10, b10) { + var c10 = a10.k; + O7(); + var e10 = new P6().a(); + Sd(c10, b10, e10); + return a10; + } + function C$a(a10, b10) { + var c10 = a10.k, e10 = zD().Kn; + eb(c10, e10, b10); + return a10; + } + function D$a(a10, b10) { + var c10 = a10.k, e10 = zD().Va; + eb(c10, e10, b10); + return a10; + } + function E$a2(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().ck); + Z10().cb(); + return gb(a10); + } + function F$a(a10, b10) { + var c10 = a10.k, e10 = Z10(), f10 = P52(); + b10 = uk(tk(e10, b10, f10)); + e10 = zD().Ec; + Zd(c10, e10, b10); + return a10; + } + function G$a(a10, b10) { + var c10 = a10.k, e10 = zD().Zc; + eb(c10, e10, b10); + return a10; + } + function H$a(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().Xv); + Z10().yi(); + return yL(a10); + } + function I$a2(a10) { + Z10(); + a10 = B6(a10.k.Y(), zD().Zc); + Z10().cb(); + return gb(a10); + } + function J$a(a10, b10) { + var c10 = a10.k, e10 = Z10(), f10 = O52(); + b10 = uk(tk(e10, b10, f10)); + e10 = zD().Ne; + Zd(c10, e10, b10); + return a10; + } + function K$a(a10) { + B6(a10.k.Y(), zD().Xv); + return a10; + } + function qZa(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().R); + ab().cb(); + return gb(a10); + } + function L$a(a10, b10) { + var c10 = a10.Ce(); + O7(); + var e10 = new P6().a(); + Sd(c10, b10, e10); + return a10; + } + function M$a2(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().uh); + ab().yi(); + return yL(a10); + } + function N$a(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Dn); + return t1(ab().Bg(), a10); + } + function O$a(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Bi); + return t1(ab().Bg(), a10); + } + function P$a(a10, b10) { + var c10 = a10.Ce(), e10 = qf().Zc; + eb(c10, e10, b10); + return a10; + } + function Q$a(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Mh); + return fl(ab().Um(), a10); + } + function R$a(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().Bg(); + b10 = uk(tk(e10, b10, f10)); + e10 = qf().xd; + Zd(c10, e10, b10); + return a10; + } + function S$a2(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), qf().ki); + var c10 = ab().Bg(); + return Ak(b10, a10, c10).Ra(); + } + function T$a(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().cl); + ab().yi(); + return yL(a10); + } + function U$a2(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Va); + ab().cb(); + return gb(a10); + } + function V$a(a10, b10) { + var c10 = a10.Ce(), e10 = qf().Zm; + Bi(c10, e10, b10); + return a10; + } + function W$a(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), qf().xd); + var c10 = ab().Bg(); + return Ak(b10, a10, c10).Ra(); + } + function X$a(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().Bg(); + b10 = uk(tk(e10, b10, f10)); + e10 = qf().fi; + Zd(c10, e10, b10); + return a10; + } + function Y$a(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().Bg(); + b10 = uk(tk(e10, b10, f10)); + e10 = qf().li; + Zd(c10, e10, b10); + return a10; + } + function Z$a(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), nC()); + var c10 = $$a(); + return Ak(b10, a10, c10).Ra(); + } + function aab(a10, b10) { + var c10 = a10.Ce(), e10 = qf().$j; + eb(c10, e10, b10); + return a10; + } + function bab(a10, b10) { + var c10 = a10.Ce(); + ab(); + ab().Bg(); + b10 = b10.Ce(); + var e10 = qf().Bi; + Vd(c10, e10, b10); + return a10; + } + function cab(a10, b10) { + var c10 = a10.Ce(); + ab(); + ab().Bg(); + b10 = b10.Ce(); + var e10 = qf().Dn; + Vd(c10, e10, b10); + return a10; + } + function dab(a10, b10) { + var c10 = a10.Ce(), e10 = qf().cl; + Bi(c10, e10, b10); + return a10; + } + function eab(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), qf().ch); + var c10 = ab().Um(); + return Ak(b10, a10, c10).Ra(); + } + function fab(a10, b10) { + ab(); + a10 = pma(a10.Ce(), b10); + return NWa(ab().cB(), a10); + } + function gab(a10, b10) { + var c10 = a10.Ce(); + ab(); + ab().Bg(); + b10 = b10.Ce(); + var e10 = qf().Gn; + Vd(c10, e10, b10); + return a10; + } + function hab(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = $$a(); + b10 = uk(tk(e10, b10, f10)); + e10 = nC(); + Zd(c10, e10, b10); + return a10; + } + function iab(a10, b10) { + var c10 = a10.Ce(), e10 = qf().Va; + eb(c10, e10, b10); + return a10; + } + function jab(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), ny()); + var c10 = ab().cB(); + return Ak(b10, a10, c10).Ra(); + } + function kab(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().$j); + ab().cb(); + return gb(a10); + } + function lab(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Gn); + return t1(ab().Bg(), a10); + } + function mab(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Jn); + return t1(ab().Bg(), a10); + } + function nab(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), qf().li); + var c10 = ab().Bg(); + return Ak(b10, a10, c10).Ra(); + } + function oab(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Zc); + ab().cb(); + return gb(a10); + } + function pab(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().Bg(); + b10 = uk(tk(e10, b10, f10)); + e10 = qf().ki; + Zd(c10, e10, b10); + return a10; + } + function qab(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().cB(); + b10 = uk(tk(e10, b10, f10)); + e10 = ny(); + Zd(c10, e10, b10); + return a10; + } + function rab(a10, b10) { + var c10 = a10.Ce(), e10 = qf().uh; + Bi(c10, e10, b10); + return a10; + } + function sab(a10, b10) { + var c10 = a10.Ce(); + ab(); + ab().Um(); + b10 = b10.k; + var e10 = qf().Mh; + Vd(c10, e10, b10); + return a10; + } + function tab(a10) { + ab(); + a10 = B6(a10.Ce().Y(), qf().Zm); + ab().yi(); + return yL(a10); + } + function uab(a10) { + var b10 = ab(); + a10 = B6(a10.Ce().Y(), qf().fi); + var c10 = ab().Bg(); + return Ak(b10, a10, c10).Ra(); + } + function vab(a10, b10) { + var c10 = a10.Ce(); + ab(); + ab().Bg(); + b10 = b10.Ce(); + var e10 = qf().Jn; + Vd(c10, e10, b10); + return a10; + } + function wab(a10, b10) { + var c10 = a10.Ce(), e10 = ab(), f10 = ab().Um(); + b10 = uk(tk(e10, b10, f10)); + e10 = qf().ch; + Zd(c10, e10, b10); + return a10; + } + function NM() { + this.cp = null; + } + NM.prototype = new u7(); + NM.prototype.constructor = NM; + d7 = NM.prototype; + d7.cE = function(a10) { + this.cp = a10; + return this; + }; + d7.H = function() { + return "DomainExtensionAnnotation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NM) { + var b10 = this.cp; + a10 = a10.cp; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var xab = r8({ fxa: 0 }, false, "amf.core.annotations.DomainExtensionAnnotation", { fxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + NM.prototype.$classData = xab; + function Vu() { + } + Vu.prototype = new u7(); + Vu.prototype.constructor = Vu; + d7 = Vu.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "ErrorRegistered"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Vu && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var Uia = r8({ hxa: 0 }, false, "amf.core.annotations.ErrorRegistered", { hxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Vu.prototype.$classData = Uia; + function xi() { + } + xi.prototype = new u7(); + xi.prototype.constructor = xi; + d7 = xi.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "ExplicitField"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof xi && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var b42 = r8({ ixa: 0 }, false, "amf.core.annotations.ExplicitField", { ixa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + xi.prototype.$classData = b42; + function Uq() { + this.Z1 = this.m3 = null; + } + Uq.prototype = new u7(); + Uq.prototype.constructor = Uq; + d7 = Uq.prototype; + d7.H = function() { + return "ReferenceTargets"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Uq && this.m3 === a10.m3) { + var b10 = this.Z1; + a10 = a10.Z1; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.m3; + case 1: + return this.Z1; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.xU = function(a10, b10) { + this.m3 = a10; + this.Z1 = b10; + return this; + }; + d7.$classData = r8({ zxa: 0 }, false, "amf.core.annotations.ReferenceTargets", { zxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function us() { + this.Dj = null; + } + us.prototype = new u7(); + us.prototype.constructor = us; + d7 = us.prototype; + d7.H = function() { + return "ScalarType"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof us ? this.Dj === a10.Dj : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Dj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.Dj = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var u0a = r8({ Exa: 0 }, false, "amf.core.annotations.ScalarType", { Exa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + us.prototype.$classData = u0a; + function c22() { + this.ad = null; + } + c22.prototype = new u7(); + c22.prototype.constructor = c22; + d7 = c22.prototype; + d7.H = function() { + return "SourceAST"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof c22) { + var b10 = this.ad; + a10 = a10.ad; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function qha(a10) { + var b10 = new c22(); + b10.ad = a10; + return b10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var Qu = r8({ Hxa: 0 }, false, "amf.core.annotations.SourceAST", { Hxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + c22.prototype.$classData = Qu; + function Ds() { + this.Ca = null; + } + Ds.prototype = new u7(); + Ds.prototype.constructor = Ds; + d7 = Ds.prototype; + d7.H = function() { + return "SourceNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ds ? Bj(this.Ca, a10.Ca) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.wU = function(a10) { + this.Ca = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Jxa: 0 }, false, "amf.core.annotations.SourceNode", { Jxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function x42() { + } + x42.prototype = new u7(); + x42.prototype.constructor = x42; + d7 = x42.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "VirtualObject"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof x42 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Qxa: 0 }, false, "amf.core.annotations.VirtualObject", { Qxa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function zB() { + this.ba = this.j = null; + } + zB.prototype = new u7(); + zB.prototype.constructor = zB; + function Q52() { + } + d7 = Q52.prototype = zB.prototype; + d7.H = function() { + return "Scalar"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zB ? this.j === a10.j : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.j; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.j = a10; + ii(); + var b10 = F6().Bj; + a10 = [G5(b10, a10)]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + this.ba = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.Kb = function() { + return this.ba; + }; + function R52(a10) { + var b10 = F6().Zd; + b10 = G5(b10, "Document"); + var c10 = F6().Zd; + c10 = G5(c10, "Fragment"); + var e10 = F6().Zd; + e10 = G5(e10, "Module"); + var f10 = Bq().ba; + a10.vD(ji(b10, ji(c10, ji(e10, f10)))); + b10 = a10.nb; + c10 = a10.Ic; + e10 = Bq().g; + a10.uD(ji(b10, ji(c10, e10))); + } + function yab() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + yab.prototype = new u7(); + yab.prototype.constructor = yab; + d7 = yab.prototype; + d7.a = function() { + zab = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "ExternalFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().hg, "External Fragment", "Fragment encoding an external entity", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Mk().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Nya: 0 }, false, "amf.core.metamodel.document.ExternalFragmentModel$", { Nya: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var zab = void 0; + function bea() { + zab || (zab = new yab().a()); + return zab; + } + function Aab() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.g = this.ba = null; + } + Aab.prototype = new u7(); + Aab.prototype.constructor = Aab; + d7 = Aab.prototype; + d7.a = function() { + Bab = this; + Cr(this); + tU(this); + a22(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "Fragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Bq().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + a10 = this.nb; + b10 = Bq().g; + this.g = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "Fragment", "A Fragment is a parsing Unit that encodes a DomainElement", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + return qXa(); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Oya: 0 }, false, "amf.core.metamodel.document.FragmentModel$", { Oya: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Bab = void 0; + function Jk() { + Bab || (Bab = new Aab().a()); + return Bab; + } + function Cab() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.Ic = this.qa = this.g = this.ba = null; + } + Cab.prototype = new u7(); + Cab.prototype.constructor = Cab; + d7 = Cab.prototype; + d7.a = function() { + Dab = this; + Cr(this); + tU(this); + b22(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "Module")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Bq().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + a10 = this.Ic; + b10 = Bq().g; + this.g = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "Module", "A Module is a parsing Unit that declares DomainElements that can be referenced from the DomainElements in other parsing Units.\nIt main purpose is to expose the declared references so they can be re-used", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bg().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Pya: 0 }, false, "amf.core.metamodel.document.ModuleModel$", { Pya: 1, f: 1, Sy: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Dab = void 0; + function Af() { + Dab || (Dab = new Cab().a()); + return Dab; + } + function Eab() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = this.Nd = null; + } + Eab.prototype = new u7(); + Eab.prototype.constructor = Eab; + d7 = Eab.prototype; + d7.a = function() { + Fab = this; + Cr(this); + tU(this); + a22(this); + var a10 = qb(), b10 = F6().Tb; + this.Nd = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "mediaType", "HTTP Media type associated to the encoded fragment information", H10())); + a10 = this.nb; + b10 = this.Nd; + var c10 = Bq().g; + this.g = ji(a10, ji(b10, c10)); + ii(); + a10 = F6().Ta; + a10 = [G5(a10, "PayloadFragment")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Payload Fragment", "Fragment encoding HTTP payload information", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + return qXa(); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Qya: 0 }, false, "amf.core.metamodel.document.PayloadFragmentModel$", { Qya: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Fab = void 0; + function sl() { + Fab || (Fab = new Eab().a()); + return Fab; + } + function Gab() { + this.wd = this.bb = this.mc = this.R = this.qa = this.ba = this.g = null; + this.xa = 0; + } + Gab.prototype = new u7(); + Gab.prototype.constructor = Gab; + d7 = Gab.prototype; + d7.a = function() { + Hab = this; + Cr(this); + uU(this); + wb(this); + ii(); + for (var a10 = [this.R], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + a10 = F6().Pg; + a10 = G5(a10, "Node"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Pg, "Data Node", "Base class for all data nodes parsed from the data structure", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("DataNode is an abstract class and it cannot be instantiated directly")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ Tya: 0 }, false, "amf.core.metamodel.domain.DataNodeModel$", { Tya: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1 }); + var Hab = void 0; + function dl() { + Hab || (Hab = new Gab().a()); + return Hab; + } + function Iab() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + } + Iab.prototype = new u7(); + Iab.prototype.constructor = Iab; + d7 = Iab.prototype; + d7.a = function() { + Jab = this; + Cr(this); + uU(this); + vXa(this); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return dl().g; + }; + d7.xia = function(a10) { + this.qa = a10; + }; + d7.yia = function(a10) { + this.ba = a10; + }; + d7.lc = function() { + qs(); + O7(); + var a10 = new P6().a(); + return new Xk().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ dza: 0 }, false, "amf.core.metamodel.domain.ObjectNodeModel$", { dza: 1, f: 1, cza: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Jab = void 0; + function dea() { + Jab || (Jab = new Iab().a()); + return Jab; + } + function Kab(a10) { + ii(); + a10 = [a10.R, a10.te, a10.Aj]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + } + function Lab(a10) { + var b10 = kP(), c10 = F6().Zd; + a10.K8(rb(new sb(), b10, G5(c10, "target"), tb(new ub(), vb().hg, "target", "Target node for the parameter", H10()))); + b10 = new xc().yd(gl()); + c10 = F6().Zd; + a10.L8(rb(new sb(), b10, G5(c10, "variable"), tb(new ub(), vb().hg, "variable", "Variables to be replaced in the graph template introduced by an AbstractDeclaration", H10()))); + a10.M8(a10.R); + } + function xXa() { + this.AK = null; + } + xXa.prototype = new y_(); + xXa.prototype.constructor = xXa; + d7 = xXa.prototype; + d7.eg = function(a10) { + return Rk(a10) && a10.j === this.AK ? true : false; + }; + d7.$f = function(a10, b10) { + return Rk(a10) && a10.j === this.AK ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ tza: 0 }, false, "amf.core.model.document.BaseUnit$$anonfun$findById$1", { tza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Mab() { + this.Oca = null; + } + Mab.prototype = new y_(); + Mab.prototype.constructor = Mab; + function yXa(a10) { + var b10 = new Mab(); + b10.Oca = a10; + return b10; + } + d7 = Mab.prototype; + d7.eg = function(a10) { + return Rk(a10) && this.Oca.P(a10) ? true : false; + }; + d7.$f = function(a10, b10) { + return Rk(a10) && this.Oca.P(a10) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ uza: 0 }, false, "amf.core.model.document.BaseUnit$$anonfun$findByType$3", { uza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function iM() { + } + iM.prototype = new y_(); + iM.prototype.constructor = iM; + iM.prototype.a = function() { + return this; + }; + iM.prototype.Sa = function(a10) { + a10 = a10.Lc; + var b10 = Gk().xc; + return !(null === a10 ? null === b10 : a10.h(b10)); + }; + iM.prototype.Wa = function(a10, b10) { + var c10 = a10.Lc, e10 = Gk().xc; + return (null === c10 ? null === e10 : c10.h(e10)) ? b10.P(a10) : a10.r.r; + }; + iM.prototype.$classData = r8({ Aza: 0 }, false, "amf.core.model.document.FieldsFilter$Local$$anonfun$filter$1", { Aza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Kk(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.UA); + } + function $r() { + this.x = this.wb = null; + } + $r.prototype = new u7(); + $r.prototype.constructor = $r; + d7 = $r.prototype; + d7.H = function() { + return "AmfArray"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $r) { + var b10 = this.wb, c10 = a10.wb; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.x === a10.x : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wb; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Md = function(a10) { + return Nab(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + function Zr(a10, b10, c10) { + a10.wb = b10; + a10.x = c10; + return a10; + } + d7.z = function() { + return X5(this); + }; + function Nab(a10, b10) { + var c10 = a10.wb; + b10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10.Md(g10); + }; + }(a10, b10)); + var e10 = K7(); + c10 = c10.ka(b10, e10.u); + a10 = a10.x; + return Zr(new $r(), c10, Yi(O7(), a10)); + } + function Yx(a10) { + a10 = a10.wb; + var b10 = new Oab(); + var c10 = K7(); + return a10.ec(b10, c10.u); + } + d7.$classData = r8({ Hza: 0 }, false, "amf.core.model.domain.AmfArray", { Hza: 1, f: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Oab() { + } + Oab.prototype = new y_(); + Oab.prototype.constructor = Oab; + d7 = Oab.prototype; + d7.eg = function(a10) { + return a10 instanceof jh; + }; + d7.$f = function(a10, b10) { + return a10 instanceof jh ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ Iza: 0 }, false, "amf.core.model.domain.AmfArray$$anonfun$scalars$1", { Iza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Pab() { + this.sM = null; + } + Pab.prototype = new y_(); + Pab.prototype.constructor = Pab; + d7 = Pab.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof GC && a10.Ds.Ha(this.sM) ? a10 : b10.P(a10); + }; + d7.GK = function(a10, b10) { + this.sM = b10; + return this; + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof GC && a10.Ds.Ha(this.sM) ? true : false; + }; + d7.$classData = r8({ Jza: 0 }, false, "amf.core.model.domain.AmfElement$$anonfun$isTrackedBy$1", { Jza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jh() { + this.x = this.r = null; + } + jh.prototype = new u7(); + jh.prototype.constructor = jh; + function Qab(a10) { + a10 = Vb().Ia(a10.r); + if (a10.b()) + return y7(); + a10 = a10.c(); + sp(a10) && (a10 = new qg().e(a10), a10 = Oj(va(), a10.ja)); + return new z7().d(a10); + } + d7 = jh.prototype; + d7.H = function() { + return "AmfScalar"; + }; + d7.E = function() { + return 2; + }; + function Si(a10) { + a10 = Qab(a10); + if (a10 instanceof z7) { + var b10 = a10.i; + if (null !== b10) + return b10; + } + if (y7() === a10) + throw mb(E6(), new nb().e("Cannot transform null value into Number")); + throw new x7().d(a10); + } + d7.h = function(a10) { + return a10 instanceof jh ? ra(this.r, a10.r) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + var a10 = Vb().Ia(this.r); + if (a10 instanceof z7) + return ka(a10.i); + if (y7() === a10) + return ""; + throw new x7().d(a10); + }; + function ih(a10, b10, c10) { + a10.r = b10; + a10.x = c10; + return a10; + } + d7.Md = function() { + var a10 = this.x; + return ih(new jh(), this.r, Yi(O7(), a10)); + }; + d7.Ib = function() { + return yb(this); + }; + d7.z = function() { + return X5(this); + }; + function aj(a10) { + var b10 = false, c10 = null; + a10 = Vb().Ia(a10.r); + if (a10 instanceof z7 && (b10 = true, c10 = a10, a10 = c10.i, sp(a10))) + return b10 = new qg().e(a10), iH(b10.ja); + if (b10 && (a10 = c10.i, Va(Wa(), true, a10))) + return true; + if (b10 && (b10 = c10.i, Va(Wa(), false, b10))) + return false; + throw mb(E6(), new nb().e("Cannot transform scalar value into Boolean")); + } + d7.$classData = r8({ Kza: 0 }, false, "amf.core.model.domain.AmfScalar", { Kza: 1, f: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Rab() { + } + Rab.prototype = new y_(); + Rab.prototype.constructor = Rab; + d7 = Rab.prototype; + d7.AD = function(a10, b10) { + var c10 = nt2(ot(), a10); + return !c10.b() && (c10 = c10.c().ma(), c10 instanceof el) ? c10 : b10.P(a10); + }; + d7.aE = function() { + return this; + }; + d7.oE = function(a10) { + a10 = nt2(ot(), a10); + return !a10.b() && a10.c().ma() instanceof el ? true : false; + }; + d7.Sa = function(a10) { + return this.oE(a10); + }; + d7.Wa = function(a10, b10) { + return this.AD(a10, b10); + }; + d7.$classData = r8({ Vza: 0 }, false, "amf.core.model.domain.ObjectNode$$anonfun$getFromKey$1", { Vza: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Q_a() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + this.l = null; + } + Q_a.prototype = new u7(); + Q_a.prototype.constructor = Q_a; + d7 = Q_a.prototype; + d7.aE = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + Cr(this); + uU(this); + vXa(this); + a10 = F6().Pg; + a10 = G5(a10, "Object"); + var b10 = dl().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Pg, "Object Node", "Node that represents a dynamic object with records data structure", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = ls(this.l).ua(), b10 = dl().g, c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.xia = function() { + }; + d7.lc = function() { + qs(); + O7(); + var a10 = new P6().a(); + return new Xk().K(new S6().a(), a10); + }; + d7.yia = function() { + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Wza: 0 }, false, "amf.core.model.domain.ObjectNode$ObjectNodeDynamicModel", { Wza: 1, f: 1, cza: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + function S52() { + this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + S52.prototype = new u7(); + S52.prototype.constructor = S52; + function Sab() { + } + d7 = Sab.prototype = S52.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.Y(), kP().R).A; + a10 = a10.b() ? "default-abstract" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Nz = function() { + return B6(this.g, kP().SC); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.kI = function() { + return B6(this.g, kP().Aj); + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return kP().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10) { + this.g = a10; + lM(this); + return this; + }; + function mha() { + } + mha.prototype = new y_(); + mha.prototype.constructor = mha; + d7 = mha.prototype; + d7.dn = function(a10, b10) { + return OLa(a10) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.dq = function() { + return this; + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return OLa(a10); + }; + d7.$classData = r8({ oAa: 0 }, false, "amf.core.parser.Annotations$$anonfun$eternals$1", { oAa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function lha() { + } + lha.prototype = new y_(); + lha.prototype.constructor = lha; + d7 = lha.prototype; + d7.dn = function(a10, b10) { + return a10 && a10.$classData && a10.$classData.ge.Eh && !OLa(a10) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.dq = function() { + return this; + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 && a10.$classData && a10.$classData.ge.Eh && !OLa(a10) ? true : false; + }; + d7.$classData = r8({ pAa: 0 }, false, "amf.core.parser.Annotations$$anonfun$serializables$1", { pAa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function vha() { + } + vha.prototype = new y_(); + vha.prototype.constructor = vha; + d7 = vha.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Pd ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Pd; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ sAa: 0 }, false, "amf.core.parser.Declarations$$anonfun$findAnnotation$2", { sAa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Tab() { + this.Df = null; + } + Tab.prototype = new $_a(); + Tab.prototype.constructor = Tab; + Tab.prototype.a = function() { + LN.prototype.a.call(this); + return this; + }; + Tab.prototype.$classData = r8({ yAa: 0 }, false, "amf.core.parser.EmptyReferenceCollector$", { yAa: 1, Lga: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Uab = void 0; + function lBa() { + Uab || (Uab = new Tab().a()); + return Uab; + } + function CU() { + this.Dg = this.cf = 0; + } + CU.prototype = new u7(); + CU.prototype.constructor = CU; + function Vab() { + } + d7 = Vab.prototype = CU.prototype; + d7.H = function() { + return "Position"; + }; + d7.ID = function(a10) { + var b10 = this.cf - a10.cf | 0; + return 0 === b10 ? this.Dg - a10.Dg | 0 : b10; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof CU ? this.cf === a10.cf && this.Dg === a10.Dg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cf; + case 1: + return this.Dg; + default: + throw new U6().e("" + a10); + } + }; + function W_a(a10, b10) { + return a10.cf < b10.cf || a10.cf === b10.cf && a10.Dg <= b10.Dg ? a10 : b10; + } + d7.sp = function() { + return this.t(); + }; + d7.Yx = function() { + var a10 = ld(); + return this.h(a10); + }; + d7.t = function() { + return "(" + this.cf + "," + this.Dg + ")"; + }; + d7.tr = function(a10) { + return this.ID(a10); + }; + d7.Sc = function(a10, b10) { + this.cf = a10; + this.Dg = b10; + return this; + }; + function X_a(a10, b10) { + return a10.cf > b10.cf || a10.cf === b10.cf && a10.Dg >= b10.Dg ? a10 : b10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.cf); + a10 = OJ().Ga(a10, this.Dg); + return OJ().fe(a10, 2); + }; + CU.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(CU.prototype, "isZero", { get: function() { + return this.Yx(); + }, configurable: true }); + CU.prototype.compareTo = function(a10) { + return this.ID(a10); + }; + CU.prototype.max = function(a10) { + return X_a(this, a10); + }; + CU.prototype.min = function(a10) { + return W_a(this, a10); + }; + CU.prototype.lt = function(a10) { + return 0 > this.ID(a10); + }; + Object.defineProperty(CU.prototype, "column", { get: function() { + return this.Dg; + }, configurable: true }); + Object.defineProperty(CU.prototype, "line", { get: function() { + return this.cf; + }, configurable: true }); + CU.prototype.$classData = r8({ Jga: 0 }, false, "amf.core.parser.Position", { Jga: 1, f: 1, ym: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wab() { + BU.call(this); + } + Wab.prototype = new V_a(); + Wab.prototype.constructor = Wab; + Wab.prototype.a = function() { + BU.prototype.fU.call(this, ld(), ld()); + return this; + }; + Wab.prototype.$classData = r8({ QAa: 0 }, false, "amf.core.parser.Range$NONE$", { QAa: 1, Kga: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Xab = void 0; + function rfa() { + Xab || (Xab = new Wab().a()); + return Xab; + } + function v22() { + this.ea = this.Df = this.Of = null; + } + v22.prototype = new u7(); + v22.prototype.constructor = v22; + d7 = v22.prototype; + d7.vi = function(a10, b10) { + this.Of = a10; + this.Df = b10; + this.ea = nv().ea; + return this; + }; + d7.H = function() { + return "Reference"; + }; + d7.E = function() { + return 2; + }; + function a0a(a10, b10, c10, e10) { + var f10 = a10.Df; + b10 = Z_a(b10, c10, e10); + c10 = K7(); + f10 = f10.yg(b10, c10.u); + return new v22().vi(a10.Of, f10); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof v22 && this.Of === a10.Of) { + var b10 = this.Df; + a10 = a10.Df; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Yab(a10, b10) { + yq(zq(), "AMFCompiler#parserReferences: Recursive reference " + b10); + var c10 = a10.ea, e10 = fp(); + return Vfa(c10, b10, e10).Yg(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = new u22().K(new S6().a(), (O7(), new P6().a())); + k10 = Rd(k10, g10); + var l10 = Bq().uc; + k10 = eb(k10, l10, g10); + h10 = h10.hx.t(); + Kfa(k10, h10); + return k10; + }; + }(a10, b10)), ml()); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Of; + case 1: + return this.Df; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Zab(a10, b10, c10, e10, f10, g10) { + if (b10 instanceof bg) + e10.Ha(wM()) && e10.Ha(yM()) ? f10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = dc().CR, A10 = p10.j, D10 = y7(); + ec(m10, v10, A10, D10, "The !include tag must be avoided when referencing a library", t10.da); + }; + }(a10, g10, b10))) : wM() !== c10 && f10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = dc().CR, A10 = p10.j, D10 = y7(); + ec(m10, v10, A10, D10, "Libraries must be applied by using 'uses'", t10.da); + }; + }(a10, g10, b10))); + else { + a: { + for (e10 = b10.bc().Kb(); !e10.b(); ) { + var h10 = ic(e10.ga()), k10 = F6().$c.he; + if (-1 !== (h10.indexOf(k10) | 0)) { + e10 = true; + break a; + } + e10 = e10.ta(); + } + e10 = false; + } + e10 || wM() === c10 && f10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = dc().lY, A10 = p10.j, D10 = y7(); + ec(m10, v10, A10, D10, "Fragments must be imported by using '!include'", t10.da); + }; + }(a10, g10, b10))); + } + } + function bga(a10, b10, c10, e10, f10, g10, h10) { + var k10 = f10.NH; + if (k10 instanceof z7) + return k10.i.JT(mia(b10, Kq(a10.Of))).Pq(w6(/* @__PURE__ */ function(l10) { + return function(m10) { + return nq(hp(), oq(/* @__PURE__ */ function(p10, t10) { + return function() { + return new q32().bH(y7(), new z7().d(t10.ur)); + }; + }(l10, m10)), ml()); + }; + }(a10)), ml()).YV($ab(a10, b10, c10, e10, f10, g10, h10), ml()); + if (y7() === k10) + return abb(a10, b10, c10, e10, f10, g10, h10); + throw new x7().d(k10); + } + function abb(a10, b10, c10, e10, f10, g10, h10) { + var k10 = a10.Df, l10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return p10.jP; + }; + }(a10)), m10 = K7(); + k10 = k10.ka(l10, m10.u).fj(); + l10 = 1 < k10.jb() ? Lea() : k10.ga(); + try { + return Mea(ap(), a10.Of, y7(), y7(), b10, l10, c10, new z7().d(e10), f10, (ap(), new kp().a())).Yg(w6(/* @__PURE__ */ function(p10, t10, v10, A10, D10) { + return function(C10) { + Zab(p10, C10, t10, v10, A10, D10); + return nq(hp(), oq(/* @__PURE__ */ function(I10, L10) { + return function() { + return new q32().bH(y7(), new z7().d(L10)); + }; + }(p10, C10)), ml()); + }; + }(a10, l10, k10, g10, e10)), ml()).ZV(bbb(a10, h10), ml()).Pq(w6(/* @__PURE__ */ function() { + return function(p10) { + return p10; + }; + }(a10)), ml()); + } catch (p10) { + b10 = Ph(E6(), p10); + if (null !== b10) + return nq(hp(), oq(/* @__PURE__ */ function(t10, v10) { + return function() { + return new q32().bH(new z7().d(v10), y7()); + }; + }(a10, b10)), ml()); + throw p10; + } + } + d7.z = function() { + return X5(this); + }; + function dga(a10) { + return a10.Df.Od(w6(/* @__PURE__ */ function() { + return function(b10) { + b10 = b10.jP; + var c10 = dBa(); + return null !== b10 && b10 === c10; + }; + }(a10))); + } + d7.$classData = r8({ SAa: 0 }, false, "amf.core.parser.Reference", { SAa: 1, f: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function cbb() { + this.Fa = null; + this.z8 = false; + } + cbb.prototype = new y_(); + cbb.prototype.constructor = cbb; + function bbb(a10, b10) { + var c10 = new cbb(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.z8 = b10; + return c10; + } + d7 = cbb.prototype; + d7.Mw = function(a10) { + return a10 instanceof Dq && this.z8 || null !== a10; + }; + d7.mw = function(a10, b10) { + return a10 instanceof Dq && this.z8 ? (a10 = lia(a10.Yka), Yab(this.Fa, a10).Yg(w6(/* @__PURE__ */ function() { + return function(c10) { + return new q32().bH(y7(), new z7().d(c10)); + }; + }(this)), ml())) : null !== a10 ? nq(hp(), oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return new q32().bH(new z7().d(e10), y7()); + }; + }(this, a10)), ml()) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ UAa: 0 }, false, "amf.core.parser.Reference$$anonfun$1", { UAa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function dbb() { + this.wna = this.wka = this.ZN = this.pja = this.ija = this.Fa = null; + this.tia = false; + } + dbb.prototype = new y_(); + dbb.prototype.constructor = dbb; + d7 = dbb.prototype; + d7.Mw = function() { + return true; + }; + d7.mw = function() { + return abb(this.Fa, this.ija, this.pja, this.ZN, this.wka, this.wna, this.tia); + }; + function $ab(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new dbb(); + if (null === a10) + throw mb(E6(), null); + k10.Fa = a10; + k10.ija = b10; + k10.pja = c10; + k10.ZN = e10; + k10.wka = f10; + k10.wna = g10; + k10.tia = h10; + return k10; + } + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ VAa: 0 }, false, "amf.core.parser.Reference$$anonfun$resolve$3", { VAa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Dc() { + this.Kz = this.Xd = null; + } + Dc.prototype = new Gha(); + Dc.prototype.constructor = Dc; + function $q(a10, b10, c10) { + a10.Xd = b10; + a10.Kz = c10; + return a10; + } + d7 = Dc.prototype; + d7.H = function() { + return "SyamlParsedDocument"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Dc && Bj(this.Xd, a10.Xd)) { + var b10 = this.Kz; + a10 = a10.Kz; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xd; + case 1: + return this.Kz; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.z9 = function() { + return this.Kz; + }; + d7.$classData = r8({ dBa: 0 }, false, "amf.core.parser.SyamlParsedDocument", { dBa: 1, MAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function PM() { + this.kP = this.r = null; + } + PM.prototype = new Qha(); + PM.prototype.constructor = PM; + d7 = PM.prototype; + d7.H = function() { + return "Literal"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof PM && this.r === a10.r) { + var b10 = this.kP; + a10 = a10.kP; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + case 1: + return this.kP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.Uq = function(a10, b10) { + this.kP = b10; + zt.prototype.e.call(this, a10); + return this; + }; + d7.$classData = r8({ nBa: 0 }, false, "amf.core.rdf.Literal", { nBa: 1, pBa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mb() { + this.xs = null; + } + Mb.prototype = new Gha(); + Mb.prototype.constructor = Mb; + d7 = Mb.prototype; + d7.H = function() { + return "RdfModelDocument"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Mb ? this.xs === a10.xs : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.xs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.gU = function(a10) { + this.xs = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qBa: 0 }, false, "amf.core.rdf.RdfModelDocument", { qBa: 1, MAa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q0a() { + } + q0a.prototype = new y_(); + q0a.prototype.constructor = q0a; + d7 = q0a.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ tBa: 0 }, false, "amf.core.rdf.RdfModelEmitter$Emitter$$anonfun$$nestedInanonfun$createCustomExtensions$3$1", { tBa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function tBa() { + } + tBa.prototype = new y_(); + tBa.prototype.constructor = tBa; + d7 = tBa.prototype; + d7.dn = function(a10, b10) { + return hha(a10) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return hha(a10); + }; + d7.$classData = r8({ vBa: 0 }, false, "amf.core.rdf.RdfModelParser$$anonfun$parse$1", { vBa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function QBa() { + } + QBa.prototype = new y_(); + QBa.prototype.constructor = QBa; + d7 = QBa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ wBa: 0 }, false, "amf.core.rdf.RdfModelParser$$anonfun$parseList$4", { wBa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function LM() { + this.r = null; + } + LM.prototype = new Qha(); + LM.prototype.constructor = LM; + d7 = LM.prototype; + d7.H = function() { + return "Uri"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof LM ? this.r === a10.r : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + zt.prototype.e.call(this, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xBa: 0 }, false, "amf.core.rdf.Uri", { xBa: 1, pBa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function ebb() { + this.jqa = this.Hqa = this.Fa = null; + } + ebb.prototype = new y_(); + ebb.prototype.constructor = ebb; + d7 = ebb.prototype; + d7.Mw = function() { + return true; + }; + d7.mw = function() { + return zia(this.Fa, this.Hqa, this.jqa); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + function Aia(a10, b10, c10) { + var e10 = new ebb(); + if (null === a10) + throw mb(E6(), null); + e10.Fa = a10; + e10.Hqa = b10; + e10.jqa = c10; + return e10; + } + d7.$classData = r8({ VBa: 0 }, false, "amf.core.remote.Platform$$anonfun$amf$core$remote$Platform$$loaderConcat$1", { VBa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function fbb() { + } + fbb.prototype = new y_(); + fbb.prototype.constructor = fbb; + d7 = fbb.prototype; + d7.Mw = function(a10) { + return null !== a10; + }; + d7.mw = function(a10, b10) { + if (null !== a10) + throw new T52().kn(a10); + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ eCa: 0 }, false, "amf.core.remote.browser.JsBrowserHttpResourceLoader$$anonfun$fetch$2", { eCa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function gbb() { + this.eW = this.Fa = null; + } + gbb.prototype = new y_(); + gbb.prototype.constructor = gbb; + d7 = gbb.prototype; + d7.Mw = function(a10) { + return a10 instanceof T22; + }; + function hbb(a10, b10) { + var c10 = new gbb(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.eW = b10; + return c10; + } + d7.mw = function(a10, b10) { + return a10 instanceof T22 ? (a10 = QSa(), b10 = new je4().e(this.eW), W8a(a10.R_(ba.decodeURI(b10.td))).Yg(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + e10 = KLa(c10.eW, e10); + var f10 = ibb(c10.eW); + Gq(); + var g10 = Saa(c10.eW); + g10.b() ? g10 = y7() : (g10 = g10.c(), Gq(), g10 = Taa(g10)); + return new j32().YT(e10, f10, g10); + }; + }(this)), ml()).ZV(new jbb(), ml())) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ hCa: 0 }, false, "amf.core.remote.server.JsServerFileResourceLoader$$anonfun$fetchFile$3", { hCa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jbb() { + } + jbb.prototype = new y_(); + jbb.prototype.constructor = jbb; + d7 = jbb.prototype; + d7.Mw = function(a10) { + return a10 instanceof T22; + }; + d7.mw = function(a10, b10) { + if (a10 instanceof T22) + throw new kbb().kn(a10); + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ iCa: 0 }, false, "amf.core.remote.server.JsServerFileResourceLoader$$anonfun$fetchFile$3$$anonfun$applyOrElse$3", { iCa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function lbb() { + } + lbb.prototype = new y_(); + lbb.prototype.constructor = lbb; + d7 = lbb.prototype; + d7.Mw = function(a10) { + return null !== a10; + }; + d7.mw = function(a10, b10) { + if (null !== a10) + throw new T52().kn(a10); + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Mw(a10); + }; + d7.Wa = function(a10, b10) { + return this.mw(a10, b10); + }; + d7.$classData = r8({ kCa: 0 }, false, "amf.core.remote.server.JsServerHttpResourceLoader$$anonfun$fetch$1", { kCa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Qia() { + this.eqa = this.uma = false; + this.nna = this.xka = null; + } + Qia.prototype = new y_(); + Qia.prototype.constructor = Qia; + d7 = Qia.prototype; + d7.wk = function(a10) { + return a10 instanceof xt && Ota(a10.oH) ? true : false; + }; + d7.fk = function(a10, b10) { + if (a10 instanceof xt && Ota(a10.oH)) { + Oca(); + a10 = nr(or(), a10.va); + a10 = Nca(0, a10); + if (null === a10) + throw new sf().a(); + tf(uf(), " *", a10) && this.uma && this.eqa && this.xka.P("Variable '" + this.nna + "' cannot have an empty value"); + return a10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ nCa: 0 }, false, "amf.core.resolution.VariableReplacer$$anonfun$$nestedInanonfun$replaceMatch$1$1", { nCa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Ru() { + ns.call(this); + this.Vpa = null; + } + Ru.prototype = new M_a(); + Ru.prototype.constructor = Ru; + function Yia(a10, b10) { + var c10 = new Ru(); + c10.Vpa = a10; + ns.prototype.K.call(c10, a10.aa, a10.Xa); + c10.MB = new z7().d(b10); + return c10; + } + Ru.prototype.$classData = r8({ wCa: 0 }, false, "amf.core.resolution.stages.ResolvedLinkNode", { wCa: 1, Gga: 1, IY: 1, f: 1, qd: 1, vc: 1, tc: 1 }); + function pN() { + this.nF = null; + } + pN.prototype = new u7(); + pN.prototype.constructor = pN; + d7 = pN.prototype; + d7.H = function() { + return "ResolvedNamedEntity"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pN) { + var b10 = this.nF; + a10 = a10.nF; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nF; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Yn = function(a10) { + this.nF = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var Cqa = r8({ xCa: 0 }, false, "amf.core.resolution.stages.ResolvedNamedEntity", { xCa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + pN.prototype.$classData = Cqa; + function mbb() { + } + mbb.prototype = new u7(); + mbb.prototype.constructor = mbb; + function U52() { + } + d7 = U52.prototype = mbb.prototype; + d7.H = function() { + return "Selector"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof mbb && true; + }; + d7.ro = function(a10) { + return this.cu(a10) | 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return ""; + }; + d7.Ep = function(a10) { + return this.cu(a10); + }; + d7.z = function() { + return X5(this); + }; + function lD() { + this.Me = 0; + } + lD.prototype = new u7(); + lD.prototype.constructor = lD; + d7 = lD.prototype; + d7.H = function() { + return "AllValidationsMerger"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof lD ? this.Me === a10.Me : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Me; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ue = function(a10) { + this.Me = a10; + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.Me); + return OJ().fe(a10, 1); + }; + d7.vba = function() { + return true; + }; + d7.$classData = r8({ JCa: 0 }, false, "amf.core.services.AllValidationsMerger", { JCa: 1, f: 1, QCa: 1, y: 1, v: 1, q: 1, o: 1 }); + function T0() { + this.dv = null; + } + T0.prototype = new u7(); + T0.prototype.constructor = T0; + d7 = T0.prototype; + d7.H = function() { + return "ReferenceResolverAdapter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof T0 ? this.dv === a10.dv : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.dv; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JT = function(a10) { + var b10 = ab(); + a10 = this.dv.vB(a10); + ab(); + null === ab().PI && null === ab().PI && (ab().PI = new G_()); + var c10 = ab().PI; + return il(jl(b10, a10, c10)); + }; + d7.z = function() { + return X5(this); + }; + function PWa(a10) { + var b10 = new T0(); + b10.dv = a10; + return b10; + } + d7.$classData = r8({ LDa: 0 }, false, "amf.internal.reference.ReferenceResolverAdapter", { LDa: 1, f: 1, Wgb: 1, y: 1, v: 1, q: 1, o: 1 }); + function W0() { + this.dv = null; + } + W0.prototype = new u7(); + W0.prototype.constructor = W0; + d7 = W0.prototype; + d7.H = function() { + return "ResourceLoaderAdapter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof W0) { + var b10 = this.dv; + a10 = a10.dv; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.dv; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JT = function(a10) { + var b10 = ab(); + a10 = this.dv.vB(a10); + var c10 = ab(); + null === ab().RI && null === ab().RI && (ab().RI = new N_().ep(c10)); + c10 = ab().RI; + return il(jl(b10, a10, c10)); + }; + d7.z = function() { + return X5(this); + }; + function RWa(a10) { + var b10 = new W0(); + b10.dv = a10; + return b10; + } + d7.aG = function(a10) { + return this.dv.aG(a10); + }; + d7.$classData = r8({ NDa: 0 }, false, "amf.internal.resource.ResourceLoaderAdapter", { NDa: 1, f: 1, MDa: 1, y: 1, v: 1, q: 1, o: 1 }); + function ip() { + this.yfa = this.ur = this.Of = null; + } + ip.prototype = new u7(); + ip.prototype.constructor = ip; + d7 = ip.prototype; + d7.Hc = function(a10, b10) { + this.Of = a10; + this.ur = b10; + this.yfa = new j32().Hc(b10, a10); + return this; + }; + d7.H = function() { + return "StringResourceLoader"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ip ? this.Of === a10.Of && this.ur === a10.ur : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Of; + case 1: + return this.ur; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JT = function() { + return ZC(hp(), this.yfa); + }; + d7.z = function() { + return X5(this); + }; + d7.aG = function(a10) { + return a10 === this.Of; + }; + d7.$classData = r8({ ODa: 0 }, false, "amf.internal.resource.StringResourceLoader", { ODa: 1, f: 1, MDa: 1, y: 1, v: 1, q: 1, o: 1 }); + function Oja() { + this.AK = null; + } + Oja.prototype = new y_(); + Oja.prototype.constructor = Oja; + d7 = Oja.prototype; + d7.eg = function(a10) { + return lb(a10) && a10.j === this.AK ? true : false; + }; + d7.$f = function(a10, b10) { + return lb(a10) && a10.j === this.AK ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ SDa: 0 }, false, "amf.plugins.document.graph.emitter.EmissionContext$$anonfun$isDeclared$1", { SDa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ICa() { + } + ICa.prototype = new y_(); + ICa.prototype.constructor = ICa; + d7 = ICa.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ gEa: 0 }, false, "amf.plugins.document.graph.emitter.FlattenedJsonLdEmitter$$anonfun$$nestedInanonfun$createCustomExtensions$4$1", { gEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function SCa() { + } + SCa.prototype = new y_(); + SCa.prototype.constructor = SCa; + d7 = SCa.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ jEa: 0 }, false, "amf.plugins.document.graph.emitter.JsonLdEmitter$$anonfun$$nestedInanonfun$createCustomExtensions$4$1", { jEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function H0a() { + } + H0a.prototype = new y_(); + H0a.prototype.constructor = H0a; + d7 = H0a.prototype; + d7.QJ = function(a10, b10) { + return a10 instanceof el ? a10 : b10.P(a10); + }; + d7.dL = function(a10) { + return a10 instanceof el; + }; + d7.Sa = function(a10) { + return this.dL(a10); + }; + d7.Wa = function(a10, b10) { + return this.QJ(a10, b10); + }; + d7.$classData = r8({ oEa: 0 }, false, "amf.plugins.document.graph.parser.ExpandedGraphParser$Parser$$anonfun$$nestedInanonfun$parseCustomProperties$5$1", { oEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function G0a() { + this.SW = this.tV = null; + } + G0a.prototype = new y_(); + G0a.prototype.constructor = G0a; + d7 = G0a.prototype; + d7.QJ = function(a10, b10) { + return a10 instanceof el ? oC(this.tV, this.SW, a10, (O7(), new P6().a())) : b10.P(a10); + }; + d7.dL = function(a10) { + return a10 instanceof el; + }; + d7.Sa = function(a10) { + return this.dL(a10); + }; + d7.Wa = function(a10, b10) { + return this.QJ(a10, b10); + }; + d7.$classData = r8({ pEa: 0 }, false, "amf.plugins.document.graph.parser.ExpandedGraphParser$Parser$$anonfun$$nestedInanonfun$parseObjectNodeProperties$1$1", { pEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function M0a() { + } + M0a.prototype = new y_(); + M0a.prototype.constructor = M0a; + d7 = M0a.prototype; + d7.QJ = function(a10, b10) { + return a10 instanceof el ? a10 : b10.P(a10); + }; + d7.dL = function(a10) { + return a10 instanceof el; + }; + d7.Sa = function(a10) { + return this.dL(a10); + }; + d7.Wa = function(a10, b10) { + return this.QJ(a10, b10); + }; + d7.$classData = r8({ tEa: 0 }, false, "amf.plugins.document.graph.parser.FlattenedGraphParser$Parser$$anonfun$$nestedInanonfun$parseCustomProperties$5$1", { tEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function J0a() { + this.SW = this.tV = null; + } + J0a.prototype = new y_(); + J0a.prototype.constructor = J0a; + d7 = J0a.prototype; + d7.QJ = function(a10, b10) { + return a10 instanceof el ? oC(this.tV, this.SW, a10, (O7(), new P6().a())) : b10.P(a10); + }; + d7.dL = function(a10) { + return a10 instanceof el; + }; + d7.Sa = function(a10) { + return this.dL(a10); + }; + d7.Wa = function(a10, b10) { + return this.QJ(a10, b10); + }; + d7.$classData = r8({ uEa: 0 }, false, "amf.plugins.document.graph.parser.FlattenedGraphParser$Parser$$anonfun$$nestedInanonfun$parseObjectNodeProperties$1$1", { uEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function XU() { + this.Cqa = null; + } + XU.prototype = new y_(); + XU.prototype.constructor = XU; + function nbb(a10, b10, c10) { + if (null !== b10) { + a10 = B6(b10.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return f10 instanceof Cd ? f10.j === e10.Cqa : false; + }; + }(a10))); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(new R6().M(b10, a10)); + } + return c10.P(b10); + } + XU.prototype.Sa = function(a10) { + return null !== a10; + }; + XU.prototype.Wa = function(a10, b10) { + return nbb(this, a10, b10); + }; + XU.prototype.$classData = r8({ CEa: 0 }, false, "amf.plugins.document.vocabularies.DialectsRegistry$$anonfun$1", { CEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function WMa() { + } + WMa.prototype = new y_(); + WMa.prototype.constructor = WMa; + d7 = WMa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ DEa: 0 }, false, "amf.plugins.document.vocabularies.DialectsRegistry$$anonfun$2", { DEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function TMa() { + } + TMa.prototype = new y_(); + TMa.prototype.constructor = TMa; + d7 = TMa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Cd ? B6(a10.g, wj().ej).Cb(w6(/* @__PURE__ */ function() { + return function(c10) { + c10 = MDa(c10); + var e10 = TN(); + return null !== c10 && c10 === e10; + }; + }(this))) : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Cd; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ EEa: 0 }, false, "amf.plugins.document.vocabularies.DialectsRegistry$$anonfun$3", { EEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function PMa() { + } + PMa.prototype = new y_(); + PMa.prototype.constructor = PMa; + d7 = PMa.prototype; + d7.BD = function(a10, b10) { + if (null !== a10) { + var c10 = a10.ma(), e10 = a10.ya(); + if (e10 instanceof z7 && (e10 = e10.i, e10 instanceof Cd)) + return new R6().M(c10, e10); + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.pE(a10); + }; + d7.Wa = function(a10, b10) { + return this.BD(a10, b10); + }; + d7.pE = function(a10) { + return null !== a10 && (a10 = a10.ya(), a10 instanceof z7 && a10.i instanceof Cd) ? true : false; + }; + d7.$classData = r8({ FEa: 0 }, false, "amf.plugins.document.vocabularies.DialectsRegistry$$anonfun$findNode$4", { FEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function obb() { + } + obb.prototype = new y_(); + obb.prototype.constructor = obb; + d7 = obb.prototype; + d7.NU = function(a10) { + a10 = Kc(a10.Aa); + return a10.b() ? false : "$dialect" === a10.c().va; + }; + d7.yS = function(a10, b10) { + var c10 = Kc(a10.Aa); + return (c10.b() ? 0 : "$dialect" === c10.c().va) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.NU(a10); + }; + d7.Wa = function(a10, b10) { + return this.yS(a10, b10); + }; + d7.$classData = r8({ IEa: 0 }, false, "amf.plugins.document.vocabularies.JsonHeaderExtractor$$anonfun$dialectForDoc$3", { IEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function pba() { + this.I9 = null; + } + pba.prototype = new y_(); + pba.prototype.constructor = pba; + d7 = pba.prototype; + d7.NU = function(a10) { + a10 = Kc(a10.Aa); + if (a10.b()) + return false; + a10 = a10.c(); + var b10 = B6(this.I9.g, Gc().R); + return xb(b10, a10.va); + }; + d7.yS = function(a10, b10) { + var c10 = Kc(a10.Aa); + if (c10.b()) + c10 = false; + else { + c10 = c10.c(); + var e10 = B6(this.I9.g, Gc().R); + c10 = xb(e10, c10.va); + } + return c10 ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.NU(a10); + }; + d7.Wa = function(a10, b10) { + return this.yS(a10, b10); + }; + d7.$classData = r8({ KEa: 0 }, false, "amf.plugins.document.vocabularies.KeyPropertyHeaderExtractor$$anonfun$containsVersion$3", { KEa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function sba() { + } + sba.prototype = new y_(); + sba.prototype.constructor = sba; + d7 = sba.prototype; + d7.Rg = function(a10, b10) { + return md(a10) ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return md(a10); + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ $Ea: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectDocumentsEmitters$$anonfun$7", { $Ea: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function pbb() { + this.Xb = this.p = this.pb = null; + } + pbb.prototype = new u7(); + pbb.prototype.constructor = pbb; + d7 = pbb.prototype; + d7.H = function() { + return "DialectEmitter"; + }; + function qbb(a10) { + var b10 = rba(a10, a10.p), c10 = a10.R9(a10.p), e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = OA(); + e10 = new PA().e(c10.pi); + var f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + QA(e10, "%Dialect 1.0"); + f10 = e10.s; + var g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), a10.p.zb(b10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), c10.pi), e10.s); + } + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pbb) { + var b10 = this.pb; + a10 = a10.pb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.R9 = function(a10) { + var b10 = H10(), c10 = K7(), e10 = [new bV().hU(this)]; + c10 = J5(c10, new Ib().ha(e10)); + e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = K7(); + e10 = [new cV().hU(this)]; + c10 = J5(c10, new Ib().ha(e10)); + e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = B6(this.pb.g, Bq().ae); + oN(c10) || (c10 = K7(), e10 = [new aV().hU(this)], c10 = J5(c10, new Ib().ha(e10)), e10 = K7(), b10 = b10.ia(c10, e10.u)); + Vb().Ia(B6(this.pb.g, Gc().Pj)).na() && (c10 = K7(), a10 = [new rbb().eE(this.pb, a10, this.Xb)], a10 = J5(c10, new Ib().ha(a10)), c10 = K7(), b10 = b10.ia(a10, c10.u)); + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.jU = function(a10) { + this.pb = a10; + this.p = tD(); + this.Xb = qba(this); + return this; + }; + d7.$classData = r8({ aFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DialectEmitter", { aFa: 1, f: 1, XEa: 1, y: 1, v: 1, q: 1, o: 1 }); + function sbb() { + } + sbb.prototype = new y_(); + sbb.prototype.constructor = sbb; + d7 = sbb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ hFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DocumentsModelEmitter$$anonfun$3", { hFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function tbb() { + } + tbb.prototype = new y_(); + tbb.prototype.constructor = tbb; + d7 = tbb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ jFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DocumentsModelOptionsEmitter$$anonfun$2", { jFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ubb() { + } + ubb.prototype = new y_(); + ubb.prototype.constructor = ubb; + d7 = ubb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ oFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.LibraryDocumentModelEmitter$$anonfun$1", { oFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function vbb() { + } + vbb.prototype = new y_(); + vbb.prototype.constructor = vbb; + d7 = vbb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ rFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.NodeMappingEmitter$$anonfun$5", { rFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function wbb() { + } + wbb.prototype = new y_(); + wbb.prototype.constructor = wbb; + d7 = wbb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ vFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.PropertyMappingEmitter$$anonfun$4", { vFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function xbb() { + this.Xb = this.pb = this.p = this.nL = null; + } + xbb.prototype = new u7(); + xbb.prototype.constructor = xbb; + d7 = xbb.prototype; + d7.H = function() { + return "RamlDialectLibraryEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xbb) { + var b10 = this.nL; + a10 = a10.nL; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function ybb(a10) { + var b10 = rba(a10, a10.p), c10 = a10.R9(a10.p), e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = OA(); + e10 = new PA().e(c10.pi); + var f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + QA(e10, "%Library / Dialect 1.0"); + f10 = e10.s; + var g10 = e10.ca, h10 = new rr().e(g10); + jr(wr(), a10.p.zb(b10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), c10.pi), e10.s); + } + d7.iaa = function(a10) { + this.nL = a10; + this.p = tD(); + var b10 = new zO().K(a10.g, a10.x); + this.pb = Rd(b10, a10.j); + this.Xb = qba(this); + return this; + }; + d7.R9 = function() { + var a10 = H10(), b10 = B6(this.pb.g, Bq().ae); + if (!oN(b10)) { + b10 = K7(); + var c10 = new kV(); + if (null === this) + throw mb(E6(), null); + c10.l = this; + b10 = J5(b10, new Ib().ha([c10])); + c10 = K7(); + a10 = a10.ia(b10, c10.u); + } + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.RamlDialectLibraryEmitter", { wFa: 1, f: 1, XEa: 1, y: 1, v: 1, q: 1, o: 1 }); + function zbb() { + } + zbb.prototype = new y_(); + zbb.prototype.constructor = zbb; + d7 = zbb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return Zc(a10) ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return Zc(a10); + }; + d7.$classData = r8({ AFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.ReferencesEmitter$$anonfun$6", { AFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Abb() { + this.una = null; + } + Abb.prototype = new y_(); + Abb.prototype.constructor = Abb; + d7 = Abb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof AO ? B6(a10.g, Gc().Ic).Fb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return e10.j === c10.una; + }; + }(this))) : b10.P(a10); + }; + function vba(a10) { + var b10 = new Abb(); + b10.una = a10; + return b10; + } + d7.bm = function(a10) { + return a10 instanceof AO; + }; + d7.$classData = r8({ FFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectEmitterHelper$$anonfun$$nestedInanonfun$maybeFindNodeMappingById$3$1", { FFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Bbb() { + this.Fa = null; + } + Bbb.prototype = new y_(); + Bbb.prototype.constructor = Bbb; + d7 = Bbb.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (md(c10)) + return new R6().M(this.Fa.pb, c10); + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + function wba(a10) { + var b10 = new Bbb(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + return b10; + } + d7.He = function(a10) { + return a10 instanceof z7 && md(a10.i) ? true : false; + }; + d7.$classData = r8({ GFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectEmitterHelper$$anonfun$$nestedInanonfun$maybeFindNodeMappingById$3$2", { GFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Cbb() { + this.Xb = this.p = this.kp = this.pb = this.gh = null; + } + Cbb.prototype = new u7(); + Cbb.prototype.constructor = Cbb; + function Dbb(a10, b10, c10) { + var e10 = B6(a10.pb.g, Gc().R).A; + e10 = e10.b() ? null : e10.c(); + var f10 = B6(a10.pb.g, Gc().Ym).A; + e10 = e10 + " " + (f10.b() ? null : f10.c()); + if (c10 instanceof pO) { + f10 = B6(B6(B6(a10.pb.g, Gc().Pj).g, Hc().De).g, GO().Vs).A; + f10 = f10.b() ? null : f10.c(); + var g10 = B6(B6(a10.pb.g, Gc().Pj).g, Hc().Py); + Ic(g10) ? e10 = Ebb(a10) : (QA(b10, "%" + e10), e10 = H10()); + } else { + if (!(c10 instanceof y32)) + throw new x7().d(c10); + QA(b10, "%" + B6(c10.g, Fbb().ER) + " / " + e10); + e10 = H10(); + f10 = B6(B6(a10.pb.g, Gc().Pj).g, Hc().My).Fb(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10 = B6(C10.g, GO().vx); + var I10 = B6(D10.g, Fbb().ER).A; + I10 = I10.b() ? null : I10.c(); + return xb( + C10, + I10 + ); + }; + }(a10, c10))); + f10.b() ? f10 = y7() : (f10 = B6(f10.c().g, GO().Vs).A, f10 = new z7().d(f10.b() ? null : f10.c())); + f10 = f10.c(); + } + var h10 = e10; + e10 = nd(a10, f10); + if (null === e10) + throw new x7().d(e10); + e10 = e10.ya(); + var k10 = e10 instanceof ze2 ? new z7().d(O0a(e10, a10)) : y7(); + c10 = c10.qe(); + f10 = a10.gh; + g10 = a10.pb; + var l10 = a10.p, m10 = a10.Xb, p10 = y7(), t10 = xba(a10.gh, a10.p), v10 = K7(); + h10 = t10.ia(h10, v10.u); + k10 = k10.b() ? y7() : mNa(k10.c(), c10); + a10 = a10.kp; + t10 = y7(); + nNa(c10, e10, f10, g10, l10, m10, p10, true, t10, k10, false, h10, a10).Ob(b10); + } + d7 = Cbb.prototype; + d7.H = function() { + return "DialectInstancesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Cbb) { + var b10 = this.gh, c10 = a10.gh; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.pb, c10 = a10.pb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kp === a10.kp : false; + } + return false; + }; + function Gbb(a10) { + var b10 = OA(), c10 = new PA().e(b10.pi), e10 = new qg().e(b10.mi); + tc(e10) && QA(c10, b10.mi); + e10 = a10.gh; + ev(e10) && Dbb(a10, c10, e10); + return new RA().Ac(SA(zs(), b10.pi), c10.s); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gh; + case 1: + return this.pb; + case 2: + return this.kp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Ebb(a10) { + var b10 = K7(), c10 = B6(a10.pb.g, Gc().R).A; + c10 = c10.b() ? null : c10.c(); + a10 = B6(a10.pb.g, Gc().Ym).A; + a10 = a10.b() ? null : a10.c(); + var e10 = new CU().Sc(0, 1), f10 = Q5().Na; + return J5(b10, new Ib().ha([cx(new dx(), c10, a10, f10, e10)])); + } + function Hbb(a10, b10, c10, e10) { + a10.gh = b10; + a10.pb = c10; + a10.kp = e10; + a10.p = tD(); + a10.Xb = Ibb(a10); + return a10; + } + function Ibb(a10) { + var b10 = Lc(a10.gh); + b10 = b10.b() ? a10.gh.j : b10.c(); + b10 = Mc(ua(), b10, "/"); + b10 = Oc(new Pc().fd(b10)); + var c10 = Lc(a10.gh); + b10 = (c10.b() ? a10.gh.j : c10.c()).split(b10).join(""); + c10 = Ab(a10.gh.fa(), q5(Rc)); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c().Xb; + var e10 = Rb(Gb().ab, H10()); + c10 = new z7().d(Tc(c10, e10, Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + f10 = new R6().M(f10, g10); + g10 = f10.Tp; + var h10 = f10.hr; + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.ya(); + if (null !== h10) + return g10.cc(new R6().M(h10.ma(), k10)); + } + throw new x7().d(f10); + }; + }(a10)))); + } + c10 = c10.b() ? Rb(Gb().ab, H10()) : c10.c(); + e10 = new Yc().a(); + return a10.gh.Ve().ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10, m10) { + var p10 = new R6().M(l10, m10); + l10 = p10.Tp; + m10 = p10.hr; + if (null !== l10 && Zc(m10)) { + p10 = Lc(m10); + p10 = (p10.b() ? m10.j : p10.c()).split("#").join(""); + p10 = -1 !== (p10.indexOf(g10) | 0) ? p10.split(g10).join("") : p10.split("file://").join(""); + if (h10.Ja(m10.j).na()) { + var t10 = h10.P(m10.j); + m10 = m10.j; + p10 = new R6().M(t10, p10); + return l10.cc(new R6().M(m10, p10)); + } + t10 = k10.jt("uses_"); + m10 = m10.j; + p10 = new R6().M(t10, p10); + return l10.cc(new R6().M(m10, p10)); + } + l10 = p10.Tp; + if (null !== l10) + return l10; + throw new x7().d(p10); + }; + }(a10, b10, c10, e10))); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ HFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectInstancesEmitter", { HFa: 1, f: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Jbb() { + this.Uca = null; + } + Jbb.prototype = new y_(); + Jbb.prototype.constructor = Jbb; + d7 = Jbb.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof uO && this.Uca.Ha(tj(a10).j) ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof uO && this.Uca.Ha(tj(a10).j) ? true : false; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + function Kbb(a10) { + var b10 = new Jbb(); + b10.Uca = a10; + return b10; + } + d7.$classData = r8({ MFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anonfun$2", { MFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Lbb() { + } + Lbb.prototype = new y_(); + Lbb.prototype.constructor = Lbb; + d7 = Lbb.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (null !== c10) + return c10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && null !== a10.i ? true : false; + }; + d7.$classData = r8({ NFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anonfun$3", { NFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function V52() { + } + V52.prototype = new y_(); + V52.prototype.constructor = V52; + V52.prototype.Sa = function(a10) { + return a10 instanceof Cd; + }; + V52.prototype.Wa = function(a10, b10) { + return a10 instanceof Cd ? a10 : b10.P(a10); + }; + V52.prototype.$classData = r8({ OFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter$$anonfun$findAllNodeMappings$2", { OFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Mbb() { + } + Mbb.prototype = new y_(); + Mbb.prototype.constructor = Mbb; + d7 = Mbb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return Zc(a10) ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return Zc(a10); + }; + d7.$classData = r8({ SFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.ReferencesEmitter$$anonfun$1", { SFa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Nbb() { + this.Dp = this.ff = null; + } + Nbb.prototype = new u7(); + Nbb.prototype.constructor = Nbb; + function Obb(a10, b10) { + var c10 = B6(a10.ff.g, bd().Ic).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10 instanceof SV; + }; + }(a10))); + if (c10.Da()) { + var e10 = K7(); + a10 = [new wV().haa(a10, b10, c10)]; + return J5(e10, new Ib().ha(a10)); + } + return H10(); + } + d7 = Nbb.prototype; + d7.H = function() { + return "VocabularyEmitter"; + }; + d7.TG = function(a10) { + this.ff = a10; + this.Dp = zba(this, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Nbb) { + var b10 = this.ff; + a10 = a10.ff; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ff; + default: + throw new U6().e("" + a10); + } + }; + function Pbb(a10) { + var b10 = tA(uA(), Ob(), a10.ff.x); + if (cd(a10.ff).Da()) { + var c10 = K7(); + var e10 = [new yV().gaa(a10, b10)]; + c10 = J5(c10, new Ib().ha(e10)); + } else + c10 = H10(); + if (B6(a10.ff.g, bd().$C).Da()) { + e10 = K7(); + var f10 = [new zV().gaa(a10, b10)]; + e10 = J5(e10, new Ib().ha(f10)); + } else + e10 = H10(); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + e10 = H10(); + f10 = K7(); + var g10 = [new BV().iU(a10)]; + f10 = J5(f10, new Ib().ha(g10)); + g10 = K7(); + e10 = e10.ia(f10, g10.u); + f10 = K7(); + g10 = [new CV().iU(a10)]; + f10 = J5(f10, new Ib().ha(g10)); + g10 = K7(); + e10 = e10.ia(f10, g10.u); + f10 = B6(a10.ff.g, Bq().ae); + oN(f10) || (f10 = K7(), g10 = [new DV().iU(a10)], f10 = J5(f10, new Ib().ha(g10)), g10 = K7(), e10 = e10.ia(f10, g10.u)); + f10 = Qbb(a10, b10); + g10 = K7(); + e10 = e10.ia(f10, g10.u); + a10 = Obb(a10, b10); + f10 = K7(); + a10 = e10.ia(a10, f10.u); + e10 = K7(); + a10 = c10.ia(a10, e10.u); + c10 = OA(); + e10 = new PA().e(c10.pi); + f10 = new qg().e(c10.mi); + tc(f10) && QA(e10, c10.mi); + QA(e10, "%Vocabulary 1.0"); + f10 = e10.s; + g10 = e10.ca; + var h10 = new rr().e(g10); + jr(wr(), b10.zb(a10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), c10.pi), e10.s); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function Qbb(a10, b10) { + var c10 = B6(a10.ff.g, bd().Ic).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10 instanceof gO; + }; + }(a10))); + if (c10.Da()) { + var e10 = K7(); + a10 = [new uV().haa(a10, b10, c10)]; + return J5(e10, new Ib().ha(a10)); + } + return H10(); + } + d7.$classData = r8({ $Fa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.VocabularyEmitter", { $Fa: 1, f: 1, Wga: 1, y: 1, v: 1, q: 1, o: 1 }); + function W52() { + r32.call(this); + this.Kv = null; + } + W52.prototype = new X0a(); + W52.prototype.constructor = W52; + W52.prototype.a = function() { + r32.prototype.a.call(this); + Rbb = this; + var a10 = F6().bv; + a10 = G5(a10, "DatatypeProperty"); + var b10 = F6().$c; + b10 = G5(b10, "Property"); + var c10 = nc().ba; + this.Kv = ji(a10, ji(b10, c10)); + return this; + }; + W52.prototype.lc = function() { + O7(); + var a10 = new P6().a(); + return new cO().K(new S6().a(), a10); + }; + W52.prototype.Kb = function() { + return this.Kv; + }; + W52.prototype.$classData = r8({ rGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.DatatypePropertyTermModel$", { rGa: 1, BGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Rbb = void 0; + function Sbb() { + Rbb || (Rbb = new W52().a()); + return Rbb; + } + function UU() { + this.qa = this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.ba = this.g = this.tna = this.Bqa = null; + this.xa = 0; + } + UU.prototype = new u7(); + UU.prototype.constructor = UU; + d7 = UU.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.lc = function() { + throw mb(E6(), new nb().e("DialectDomainElement is an abstract class and it cannot be isntantiated directly")); + }; + function UMa(a10, b10, c10, e10) { + a10.Bqa = b10; + a10.tna = e10; + Cr(a10); + uU(a10); + bM(a10); + e10 = Fw().oX; + var f10 = Fw().HX, g10 = nc().g, h10 = db().g, k10 = ii(); + g10 = g10.ia(h10, k10.u); + h10 = ii(); + c10 = g10.ia(c10, h10.u); + a10.g = ji(e10, ji(f10, c10)); + c10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return KU(LU(), l10); + }; + }(a10)); + e10 = K7(); + b10 = b10.ka(c10, e10.u).ua(); + c10 = F6().$c; + c10 = G5(c10, "DialectDomainElement"); + e10 = nc().ba; + c10 = ji(c10, e10); + e10 = ii(); + a10.ba = b10.ia(c10, e10.u); + return a10; + } + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ sGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.DialectDomainElementModel", { sGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1 }); + function X52() { + r32.call(this); + this.Kv = null; + } + X52.prototype = new X0a(); + X52.prototype.constructor = X52; + X52.prototype.a = function() { + r32.prototype.a.call(this); + Tbb = this; + var a10 = F6().bv; + a10 = G5(a10, "ObjectProperty"); + var b10 = F6().$c; + b10 = G5(b10, "Property"); + var c10 = nc().ba; + this.Kv = ji(a10, ji(b10, c10)); + return this; + }; + X52.prototype.lc = function() { + O7(); + var a10 = new P6().a(); + return new dO().K(new S6().a(), a10); + }; + X52.prototype.Kb = function() { + return this.Kv; + }; + X52.prototype.$classData = r8({ zGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.ObjectPropertyTermModel$", { zGa: 1, BGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Tbb = void 0; + function eO() { + Tbb || (Tbb = new X52().a()); + return Tbb; + } + function Ubb(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.OY); + } + function Eba() { + } + Eba.prototype = new y_(); + Eba.prototype.constructor = Eba; + d7 = Eba.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 && a10.$classData && a10.$classData.ge.e7 ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.e7); + }; + d7.$classData = r8({ MGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.MappingDeclarer$$anonfun$findNodeMapping$2", { MGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Vbb() { + } + Vbb.prototype = new y_(); + Vbb.prototype.constructor = Vbb; + d7 = Vbb.prototype; + d7.AD = function(a10, b10) { + var c10 = nt2(ot(), a10); + return !c10.b() && (c10 = c10.c().ma(), c10 instanceof $r) ? (a10 = c10.wb, b10 = new Wbb(), c10 = K7(), a10.ec(b10, c10.u)) : b10.P(a10); + }; + d7.oE = function(a10) { + a10 = nt2(ot(), a10); + return !a10.b() && a10.c().ma() instanceof $r ? true : false; + }; + d7.$z = function() { + return this; + }; + d7.Sa = function(a10) { + return this.oE(a10); + }; + d7.Wa = function(a10, b10) { + return this.AD(a10, b10); + }; + d7.$classData = r8({ SGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$literalProperties$1", { SGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Wbb() { + } + Wbb.prototype = new y_(); + Wbb.prototype.constructor = Wbb; + d7 = Wbb.prototype; + d7.eg = function(a10) { + return a10 instanceof jh; + }; + d7.$f = function(a10, b10) { + return a10 instanceof jh ? a10.r : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ TGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$literalProperties$1$$anonfun$applyOrElse$2", { TGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Xbb() { + } + Xbb.prototype = new y_(); + Xbb.prototype.constructor = Xbb; + d7 = Xbb.prototype; + d7.AD = function(a10, b10) { + var c10 = nt2(ot(), a10); + return !c10.b() && (c10 = c10.c().ma(), c10 instanceof jh) ? c10.r : b10.P(a10); + }; + d7.oE = function(a10) { + a10 = nt2(ot(), a10); + return !a10.b() && a10.c().ma() instanceof jh ? true : false; + }; + d7.$z = function() { + return this; + }; + d7.Sa = function(a10) { + return this.oE(a10); + }; + d7.Wa = function(a10, b10) { + return this.AD(a10, b10); + }; + d7.$classData = r8({ UGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$literalProperty$1", { UGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Ybb() { + } + Ybb.prototype = new y_(); + Ybb.prototype.constructor = Ybb; + d7 = Ybb.prototype; + d7.AD = function(a10, b10) { + var c10 = nt2(ot(), a10); + return !c10.b() && (c10 = c10.c().ma(), c10 instanceof $r) ? (a10 = c10.wb, b10 = new Zbb(), c10 = K7(), a10.ec(b10, c10.u)) : b10.P(a10); + }; + d7.oE = function(a10) { + a10 = nt2(ot(), a10); + return !a10.b() && a10.c().ma() instanceof $r ? true : false; + }; + d7.$z = function() { + return this; + }; + d7.Sa = function(a10) { + return this.oE(a10); + }; + d7.Wa = function(a10, b10) { + return this.AD(a10, b10); + }; + d7.$classData = r8({ VGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$objectCollectionProperty$1", { VGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Zbb() { + } + Zbb.prototype = new y_(); + Zbb.prototype.constructor = Zbb; + d7 = Zbb.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ WGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$objectCollectionProperty$1$$anonfun$applyOrElse$1", { WGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function $bb() { + } + $bb.prototype = new y_(); + $bb.prototype.constructor = $bb; + d7 = $bb.prototype; + d7.AD = function(a10, b10) { + var c10 = nt2(ot(), a10); + return !c10.b() && (c10 = c10.c().ma(), c10 instanceof uO) ? c10 : b10.P(a10); + }; + d7.oE = function(a10) { + a10 = nt2(ot(), a10); + return !a10.b() && a10.c().ma() instanceof uO ? true : false; + }; + d7.$z = function() { + return this; + }; + d7.Sa = function(a10) { + return this.oE(a10); + }; + d7.Wa = function(a10, b10) { + return this.AD(a10, b10); + }; + d7.$classData = r8({ XGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement$$anonfun$objectProperty$1", { XGa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Hba() { + } + Hba.prototype = new y_(); + Hba.prototype.constructor = Hba; + d7 = Hba.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ xHa: 0 }, false, "amf.plugins.document.vocabularies.parser.common.AnnotationsParser$$anonfun$1", { xHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Kba() { + } + Kba.prototype = new y_(); + Kba.prototype.constructor = Kba; + d7 = Kba.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ yHa: 0 }, false, "amf.plugins.document.vocabularies.parser.common.AnnotationsParser$$anonfun$2", { yHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function KNa() { + } + KNa.prototype = new y_(); + KNa.prototype.constructor = KNa; + d7 = KNa.prototype; + d7.Rg = function(a10, b10) { + return md(a10) ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return md(a10); + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ CHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectDeclarations$$anonfun$findNodeMapping$2", { CHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function WV() { + } + WV.prototype = new y_(); + WV.prototype.constructor = WV; + d7 = WV.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ EHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsParser$$anonfun$$nestedInanonfun$parsePropertyMapping$10$1", { EHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function nOa() { + } + nOa.prototype = new y_(); + nOa.prototype.constructor = nOa; + d7 = nOa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ FHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsParser$$anonfun$$nestedInanonfun$parseRootDocumentMapping$2$1", { FHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function RNa() { + } + RNa.prototype = new y_(); + RNa.prototype.constructor = RNa; + d7 = RNa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ GHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsParser$$anonfun$1", { GHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ZNa() { + } + ZNa.prototype = new y_(); + ZNa.prototype.constructor = ZNa; + d7 = ZNa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ HHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectsParser$$anonfun$parseLibraries$5", { HHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function acb() { + } + acb.prototype = new y_(); + acb.prototype.constructor = acb; + d7 = acb.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (null !== c10) + return c10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && null !== a10.i ? true : false; + }; + d7.$classData = r8({ LHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceContext$$anonfun$$nestedInanonfun$parseDeclaredNodeMappings$2$1", { LHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function bcb() { + this.tba = null; + } + bcb.prototype = new y_(); + bcb.prototype.constructor = bcb; + d7 = bcb.prototype; + d7.Rg = function(a10, b10) { + return md(a10) && a10.j === this.tba ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return md(a10) && a10.j === this.tba ? true : false; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ MHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceContext$$anonfun$findNodeMapping$1", { MHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function aYa() { + } + aYa.prototype = new y_(); + aYa.prototype.constructor = aYa; + d7 = aYa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof uO; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ OHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceDeclarations$$anonfun$findAnyDialectDomainElement$2", { OHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ccb() { + this.Nba = null; + } + ccb.prototype = new y_(); + ccb.prototype.constructor = ccb; + d7 = ccb.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof uO && this.Nba.Ha(tj(a10).j) ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof uO && this.Nba.Ha(tj(a10).j) ? true : false; + }; + function cYa(a10) { + var b10 = new ccb(); + b10.Nba = a10; + return b10; + } + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ PHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceDeclarations$$anonfun$findDialectDomainElement$2", { PHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function y1a() { + } + y1a.prototype = new y_(); + y1a.prototype.constructor = y1a; + d7 = y1a.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (c10 instanceof Cd) + return c10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && a10.i instanceof Cd ? true : false; + }; + d7.$classData = r8({ RHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$1", { RHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function u32() { + } + u32.prototype = new y_(); + u32.prototype.constructor = u32; + u32.prototype.Sa = function(a10) { + return null !== a10 && null !== a10.i ? true : false; + }; + u32.prototype.Wa = function(a10, b10) { + a: { + if (null !== a10) { + var c10 = a10.i; + if (null !== c10) { + a10 = c10; + break a; + } + } + a10 = b10.P(a10); + } + return a10; + }; + u32.prototype.$classData = r8({ SHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$2", { SHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function e2a() { + } + e2a.prototype = new y_(); + e2a.prototype.constructor = e2a; + d7 = e2a.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (null !== c10) + return c10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && null !== a10.i ? true : false; + }; + d7.$classData = r8({ THa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$3", { THa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function v32() { + } + v32.prototype = new y_(); + v32.prototype.constructor = v32; + v32.prototype.Sa = function(a10) { + return a10 instanceof R6; + }; + v32.prototype.Wa = function(a10, b10) { + return a10 instanceof R6 ? a10.ya() : b10.P(a10); + }; + v32.prototype.$classData = r8({ UHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$4", { UHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function V1a() { + } + V1a.prototype = new y_(); + V1a.prototype.constructor = V1a; + d7 = V1a.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ VHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$5", { VHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function W1a() { + } + W1a.prototype = new y_(); + W1a.prototype.constructor = W1a; + d7 = W1a.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ WHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$6", { WHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function p1a() { + } + p1a.prototype = new y_(); + p1a.prototype.constructor = p1a; + d7 = p1a.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ XHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$parseNode$6", { XHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function f2a() { + } + f2a.prototype = new y_(); + f2a.prototype.constructor = f2a; + d7 = f2a.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (null !== c10) + return c10; + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && null !== a10.i ? true : false; + }; + d7.$classData = r8({ YHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceParser$$anonfun$parseObjectMapProperty$3", { YHa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function YDa() { + } + YDa.prototype = new y_(); + YDa.prototype.constructor = YDa; + d7 = YDa.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ lIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$1", { lIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function gEa() { + } + gEa.prototype = new y_(); + gEa.prototype.constructor = gEa; + d7 = gEa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ mIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$10", { mIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ZDa() { + } + ZDa.prototype = new y_(); + ZDa.prototype.constructor = ZDa; + d7 = ZDa.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ nIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$2", { nIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function $Da() { + this.HH = this.cI = this.Fa = null; + } + $Da.prototype = new y_(); + $Da.prototype.constructor = $Da; + d7 = $Da.prototype; + d7.BD = function(a10, b10) { + if (null !== a10) { + b10 = a10.ma(); + a10 = a10.ya(); + b10 = this.cI.Ja(b10.split(this.HH).join("")); + if (b10 instanceof z7) + return y7(); + if (y7() === b10) + return new z7().d(a10); + throw new x7().d(b10); + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.pE(a10); + }; + d7.Wa = function(a10, b10) { + return this.BD(a10, b10); + }; + d7.kU = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.cI = b10; + this.HH = c10; + return this; + }; + d7.pE = function(a10) { + return null !== a10; + }; + d7.$classData = r8({ oIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$3", { oIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function aEa() { + } + aEa.prototype = new y_(); + aEa.prototype.constructor = aEa; + d7 = aEa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ pIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$4", { pIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function bEa() { + } + bEa.prototype = new y_(); + bEa.prototype.constructor = bEa; + d7 = bEa.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ qIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$5", { qIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function cEa() { + this.HH = this.cI = this.Fa = null; + } + cEa.prototype = new y_(); + cEa.prototype.constructor = cEa; + d7 = cEa.prototype; + d7.BD = function(a10, b10) { + return null !== a10 ? this.cI.Ja(a10.ma().split(this.HH).join("")) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.pE(a10); + }; + d7.Wa = function(a10, b10) { + return this.BD(a10, b10); + }; + d7.kU = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.cI = b10; + this.HH = c10; + return this; + }; + d7.pE = function(a10) { + return null !== a10; + }; + d7.$classData = r8({ rIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$6", { rIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function dEa() { + } + dEa.prototype = new y_(); + dEa.prototype.constructor = dEa; + d7 = dEa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ sIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$7", { sIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function eEa() { + } + eEa.prototype = new y_(); + eEa.prototype.constructor = eEa; + d7 = eEa.prototype; + d7.eg = function(a10) { + return a10 instanceof uO; + }; + d7.$f = function(a10, b10) { + return a10 instanceof uO ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ tIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$8", { tIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function fEa() { + this.HH = this.cI = this.Fa = null; + } + fEa.prototype = new y_(); + fEa.prototype.constructor = fEa; + d7 = fEa.prototype; + d7.BD = function(a10, b10) { + if (null !== a10) { + b10 = a10.ma(); + a10 = a10.ya(); + b10 = this.cI.Ja(b10.split(this.HH).join("")); + if (b10 instanceof z7) + return new z7().d(new R6().M(b10.i, a10)); + if (y7() === b10) + return y7(); + throw new x7().d(b10); + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.pE(a10); + }; + d7.Wa = function(a10, b10) { + return this.BD(a10, b10); + }; + d7.kU = function(a10, b10, c10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.cI = b10; + this.HH = c10; + return this; + }; + d7.pE = function(a10) { + return null !== a10; + }; + d7.$classData = r8({ uIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectPatchApplicationStage$$anonfun$9", { uIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function qEa() { + } + qEa.prototype = new y_(); + qEa.prototype.constructor = qEa; + d7 = qEa.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof ad ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof ad; + }; + d7.$classData = r8({ wIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$$nestedInanonfun$findVocabularies$1$1", { wIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jEa() { + } + jEa.prototype = new y_(); + jEa.prototype.constructor = jEa; + d7 = jEa.prototype; + d7.Rg = function(a10, b10) { + return md(a10) ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return md(a10); + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ xIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$1", { xIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function nEa() { + } + nEa.prototype = new y_(); + nEa.prototype.constructor = nEa; + d7 = nEa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ yIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$2", { yIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function oEa() { + } + oEa.prototype = new y_(); + oEa.prototype.constructor = oEa; + d7 = oEa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ zIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$3", { zIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function kEa() { + } + kEa.prototype = new y_(); + kEa.prototype.constructor = kEa; + d7 = kEa.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return Zc(a10) ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return Zc(a10); + }; + d7.$classData = r8({ AIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$findDeclarations$2", { AIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function rEa() { + } + rEa.prototype = new y_(); + rEa.prototype.constructor = rEa; + d7 = rEa.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof AO ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof AO; + }; + d7.$classData = r8({ BIa: 0 }, false, "amf.plugins.document.vocabularies.resolution.stages.DialectReferencesResolutionStage$$anonfun$findVocabularies$2", { BIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function x2a() { + z32.call(this); + } + x2a.prototype = new z2a(); + x2a.prototype.constructor = x2a; + x2a.prototype.a = function() { + z32.prototype.a.call(this); + return this; + }; + x2a.prototype.$classData = r8({ DIa: 0 }, false, "amf.plugins.document.webapi.ExternalJsonRefsPlugin$", { DIa: 1, aha: 1, bha: 1, bD: 1, f: 1, Zr: 1, ib: 1 }); + var w2a = void 0; + function lYa() { + } + lYa.prototype = new y_(); + lYa.prototype.constructor = lYa; + d7 = lYa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof vh ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof vh; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ GIa: 0 }, false, "amf.plugins.document.webapi.JsonSchemaPlugin$$anonfun$firstAnyShape$1", { GIa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function dcb(a10, b10, c10) { + c10 = a10.Fja(b10.da, b10.Q, c10, y7()); + var e10 = b10.YB; + wM() === e10 ? b10 = new z7().d(new ecb().Tx(b10, c10).rca()) : yM() === e10 ? b10 = new z7().d(fcb(new Y52(), b10, y7(), c10).e2()) : (e10 = lx().hG(b10), e10.b() ? b10 = y7() : (e10 = e10.c(), Lka() === e10 ? b10 = new W32().Tx(b10, c10).vca() : Kka() === e10 ? b10 = new W32().Tx(b10, c10).nca() : Cka() === e10 ? (b10 = new W32().Tx(b10, c10), O7(), e10 = new P6().a(), b10 = i6a(b10, new mf().K(new S6().a(), e10))) : mx() === e10 ? (b10 = new gcb().Tx(b10, c10), O7(), e10 = new P6().a(), b10 = i6a(b10, new mf().K(new S6().a(), e10))) : b10 = fcb(new Y52(), b10, new z7().d(e10), c10).e2(), b10 = new z7().d(b10))); + if (b10.b()) + return y7(); + b10 = b10.c(); + return new z7().d(hcb(a10, b10, c10)); + } + function icb(a10) { + var b10 = K7(), c10 = [a10.Gg().ve(), Au().$]; + a10.Fia(J5(b10, new Ib().ha(c10))); + } + function hcb(a10, b10, c10) { + var e10 = b10.Ve().ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + var h10 = new R6().M(f10, g10); + f10 = h10.Tp; + g10 = h10.hr; + if (null !== f10 && null !== g10) + return h10 = Lc(g10), h10 = h10.b() ? g10.j : h10.c(), f10.cc(new R6().M(h10, g10)); + throw new x7().d(h10); + }; + }(a10))); + e10 = new qd().d(e10); + c10.Qh.DP.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = Lc(h10); + k10 = k10.b() ? h10.j : k10.c(); + g10.oa = g10.oa.cc(new R6().M(k10, h10)); + }; + }(a10, e10))); + a10 = new Fc().Vd(e10.oa); + return tc(a10) ? (a10 = new Fc().Vd(e10.oa).Sb.Ye().Dd(), c10 = Gk().xc, Bf(b10, c10, a10)) : b10; + } + function jcb(a10, b10, c10) { + var e10 = a10.C9(c10, b10, y7()); + kcb(a10, b10, e10); + var f10 = new Aq().zo(b10.da, b10.Q, new Mq().a(), c10.lj, y7()); + a10 = a10.C9(f10, b10, y7()); + a10.Ip = c10.Ip; + a10.Fu = c10.Fu; + c10 = aHa().hG(b10); + if (c10.b()) + return y7(); + c10 = c10.c(); + f10 = false; + if (uOa().h(c10)) { + f10 = true; + var g10 = b10.YB, h10 = yM(); + if (null !== g10 && g10 === h10) + return y7(); + } + if (f10) + return b10 = new lcb().$D(b10, e10), O7(), e10 = new P6().a(), new z7().d(mcb(b10, new mf().K(new S6().a(), e10))); + if (yOa().h(c10)) + return b10 = new ncb().$D(b10, e10), O7(), e10 = new P6().a(), new z7().d(mcb(b10, new mf().K(new S6().a(), e10))); + ux().h(c10) ? b10 = new z7().d(FQa(IQa(), b10, e10).vca()) : vx().h(c10) ? b10 = new z7().d(FQa(IQa(), b10, e10).nca()) : BOa().h(c10) ? b10 = new z7().d(new ocb().$D(b10, a10).rca()) : c10 && c10.$classData && c10.$classData.ge.NF ? (a10 = pcb, f10 = new qcb(), f10.ee = b10, f10.vO = c10, f10.ra = e10, GP.prototype.ss.call(f10, e10), b10 = a10(f10)) : b10 = y7(); + return b10; + } + function rcb() { + return J5(K7(), new Ib().ha("application/raml application/raml+json application/raml+yaml text/yaml text/x-yaml application/yaml application/x-yaml text/vnd.yaml".split(" "))); + } + function scb(a10) { + var b10 = K7(), c10 = [a10.Gg().ve(), Ob().$]; + a10.Gia(J5(b10, new Ib().ha(c10))); + } + function tcb(a10, b10, c10, e10, f10, g10) { + b10.U(w6(/* @__PURE__ */ function(h10, k10, l10, m10, p10) { + return function(t10) { + t10 = t10.Ca; + if (t10 instanceof uG) + if (k10.U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + return eHa(D10, C10); + }; + }(h10, l10))), y7() === m10) { + T6(); + var v10 = B6(p10.g, Ok().Rd).A; + t10.Gv = new z7().d(mh(0, v10.b() ? null : v10.c())); + } else + t10.Gv = m10; + }; + }(a10, f10, g10, c10, e10))); + } + function kcb(a10, b10, c10) { + b10.Q.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = h10.Jd; + if (k10 instanceof Mk) { + var l10 = h10.$n.Df, m10 = h10.ad; + k10 = ar(k10.g, Jk().nb); + h10 = h10.Jd.Ve(); + tcb(e10, l10, m10, k10, h10, f10); + } else if (k10 instanceof ad || k10 instanceof zO) { + l10 = k10.xe; + l10 = l10.b() ? "" : l10.c(); + O7(); + m10 = new P6().a(); + m10 = new Mk().K(new S6().a(), m10); + var p10 = Lc(k10); + p10 = p10.b() ? g10.da : p10.c(); + var t10 = Bq().uc; + m10 = eb(m10, t10, p10); + k10 = Rd(m10, k10.j); + O7(); + m10 = new P6().a(); + m10 = new Pk().K(new S6().a(), m10); + p10 = Ok().Rd; + m10 = eb(m10, p10, l10); + l10 = 0 <= (l10.length | 0) && "#%" === l10.substring(0, 2) ? "application/yaml" : "application/json"; + p10 = Ok().Nd; + l10 = eb(m10, p10, l10); + m10 = Jk().nb; + m10 = Vd(k10, m10, l10); + l10 = h10.$n.Df; + k10 = y7(); + m10 = ar(m10.g, Jk().nb); + h10 = h10.Jd.Ve(); + tcb(e10, l10, k10, m10, h10, f10); + } + }; + }(a10, c10, b10))); + } + function Z5() { + } + Z5.prototype = new u7(); + Z5.prototype.constructor = Z5; + d7 = Z5.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "CollectionFormatFromItems"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Z5 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var ucb = r8({ PIa: 0 }, false, "amf.plugins.document.webapi.annotations.CollectionFormatFromItems", { PIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Z5.prototype.$classData = ucb; + function $5() { + } + $5.prototype = new u7(); + $5.prototype.constructor = $5; + d7 = $5.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "DefaultPayload"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof $5 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var XPa = r8({ QIa: 0 }, false, "amf.plugins.document.webapi.annotations.DefaultPayload", { QIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + $5.prototype.$classData = XPa; + function kQ() { + } + kQ.prototype = new u7(); + kQ.prototype.constructor = kQ; + d7 = kQ.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "EmptyPayload"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof kQ && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var Tqa = r8({ RIa: 0 }, false, "amf.plugins.document.webapi.annotations.EmptyPayload", { RIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + kQ.prototype.$classData = Tqa; + var WPa = r8({ SIa: 0 }, false, "amf.plugins.document.webapi.annotations.EndPointBodyParameter", { SIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nf() { + this.Vk = null; + } + Nf.prototype = new u7(); + Nf.prototype.constructor = Nf; + d7 = Nf.prototype; + d7.H = function() { + return "GeneratedJSONSchema"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Nf ? this.Vk === a10.Vk : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.Vk = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var vcb = r8({ XIa: 0 }, false, "amf.plugins.document.webapi.annotations.GeneratedJSONSchema", { XIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Nf.prototype.$classData = vcb; + function kg() { + this.Vk = null; + } + kg.prototype = new u7(); + kg.prototype.constructor = kg; + d7 = kg.prototype; + d7.H = function() { + return "GeneratedRamlDatatype"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof kg ? this.Vk === a10.Vk : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.Vk = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var wcb = r8({ YIa: 0 }, false, "amf.plugins.document.webapi.annotations.GeneratedRamlDatatype", { YIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + kg.prototype.$classData = wcb; + function L32() { + } + L32.prototype = new u7(); + L32.prototype.constructor = L32; + d7 = L32.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "Inferred"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof L32 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var loa = r8({ ZIa: 0 }, false, "amf.plugins.document.webapi.annotations.Inferred", { ZIa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + L32.prototype.$classData = loa; + function Z32() { + } + Z32.prototype = new u7(); + Z32.prototype.constructor = Z32; + d7 = Z32.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "InlineDefinition"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Z32 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var xcb = r8({ $Ia: 0 }, false, "amf.plugins.document.webapi.annotations.InlineDefinition", { $Ia: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Z32.prototype.$classData = xcb; + function nf() { + } + nf.prototype = new u7(); + nf.prototype.constructor = nf; + d7 = nf.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "JSONSchemaRoot"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof nf && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var jYa = r8({ cJa: 0 }, false, "amf.plugins.document.webapi.annotations.JSONSchemaRoot", { cJa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + nf.prototype.$classData = jYa; + function a62() { + } + a62.prototype = new u7(); + a62.prototype.constructor = a62; + d7 = a62.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "SchemaIsJsonSchema"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof a62 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var tca = r8({ oJa: 0 }, false, "amf.plugins.document.webapi.annotations.SchemaIsJsonSchema", { oJa: 1, f: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + a62.prototype.$classData = tca; + function tka() { + } + tka.prototype = new y_(); + tka.prototype.constructor = tka; + d7 = tka.prototype; + d7.a = function() { + return this; + }; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ RJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlScalarEmitter$$anonfun$1", { RJa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ycb() { + this.ZN = this.eda = null; + } + ycb.prototype = new y_(); + ycb.prototype.constructor = ycb; + d7 = ycb.prototype; + d7.Vaa = function(a10) { + return a10.Jd instanceof Mk || a10.Jd instanceof u22; + }; + function zcb(a10, b10) { + var c10 = new ycb(); + c10.eda = a10; + c10.ZN = b10; + return c10; + } + d7.Sa = function(a10) { + return this.Vaa(a10); + }; + d7.Wa = function(a10, b10) { + return this.e9(a10, b10); + }; + d7.e9 = function(a10, b10) { + return a10.Jd instanceof Mk || a10.Jd instanceof u22 ? (a10 = a10.Jd, nYa(wCa(), a10, this.eda, this.ZN)) : b10.P(a10); + }; + d7.$classData = r8({ YJa: 0 }, false, "amf.plugins.document.webapi.contexts.WebApiContext$$anonfun$1", { YJa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Acb() { + } + Acb.prototype = new y_(); + Acb.prototype.constructor = Acb; + d7 = Acb.prototype; + d7.Vaa = function(a10) { + return a10.Jd instanceof Mk || a10.Jd instanceof u22; + }; + d7.Sa = function(a10) { + return this.Vaa(a10); + }; + d7.Wa = function(a10, b10) { + return this.e9(a10, b10); + }; + d7.e9 = function(a10, b10) { + return a10.Jd instanceof Mk ? a10.Jd : a10.Jd instanceof u22 ? a10.Jd : b10.P(a10); + }; + d7.$classData = r8({ ZJa: 0 }, false, "amf.plugins.document.webapi.contexts.WebApiContext$$anonfun$obtainFragment$3", { ZJa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Bcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Bcb.prototype = new u7(); + Bcb.prototype.constructor = Bcb; + d7 = Bcb.prototype; + d7.a = function() { + Ccb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "AnnotationTypeDeclarationFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Annotation Type Fragment", "Fragment encoding a RAML annotation type", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ol().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ bKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$AnnotationTypeDeclarationFragmentModel$", { bKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Ccb = void 0; + function jea() { + Ccb || (Ccb = new Bcb().a()); + return Ccb; + } + function Dcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Dcb.prototype = new u7(); + Dcb.prototype.constructor = Dcb; + d7 = Dcb.prototype; + d7.a = function() { + Ecb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Eb; + a10 = [G5(a10, "DataTypeFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Data Type Fragment", "Fragment encoding a RAML data type", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ql().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ cKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$DataTypeFragmentModel$", { cKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Ecb = void 0; + function kea() { + Ecb || (Ecb = new Dcb().a()); + return Ecb; + } + function Fcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Fcb.prototype = new u7(); + Fcb.prototype.constructor = Fcb; + d7 = Fcb.prototype; + d7.a = function() { + Gcb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "UserDocumentationFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Documentation Item Fragment", "Fragment encoding a RAML documentation item", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new vl().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ dKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$DocumentationItemFragmentModel$", { dKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Gcb = void 0; + function lea() { + Gcb || (Gcb = new Fcb().a()); + return Gcb; + } + function Hcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Hcb.prototype = new u7(); + Hcb.prototype.constructor = Hcb; + d7 = Hcb.prototype; + d7.a = function() { + Icb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "NamedExampleFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Named Example Fragment", "Fragment encoding a RAML named example", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new xl().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ eKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$NamedExampleFragmentModel$", { eKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Icb = void 0; + function mea() { + Icb || (Icb = new Hcb().a()); + return Icb; + } + function Jcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Jcb.prototype = new u7(); + Jcb.prototype.constructor = Jcb; + d7 = Jcb.prototype; + d7.a = function() { + Kcb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "ResourceTypeFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Resource Type Fragment", "Fragment encoding a RAML resource type", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new zl().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ fKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$ResourceTypeFragmentModel$", { fKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Kcb = void 0; + function nea() { + Kcb || (Kcb = new Jcb().a()); + return Kcb; + } + function Lcb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Lcb.prototype = new u7(); + Lcb.prototype.constructor = Lcb; + d7 = Lcb.prototype; + d7.a = function() { + Mcb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().dc; + a10 = [G5(a10, "SecuritySchemeFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "Security Scheme Fragment", "Fragment encoding a RAML security scheme", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Bl().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ gKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$SecuritySchemeFragmentModel$", { gKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Mcb = void 0; + function oea() { + Mcb || (Mcb = new Lcb().a()); + return Mcb; + } + function Ncb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.qa = this.ba = this.g = null; + } + Ncb.prototype = new u7(); + Ncb.prototype.constructor = Ncb; + d7 = Ncb.prototype; + d7.a = function() { + Ocb = this; + Cr(this); + tU(this); + a22(this); + this.g = Jk().g; + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "TraitFragment")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Jk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Trait Fragment", "Fragment encoding a RAML trait", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Dl().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ hKa: 0 }, false, "amf.plugins.document.webapi.metamodel.FragmentsTypesModels$TraitFragmentModel$", { hKa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1 }); + var Ocb = void 0; + function pea() { + Ocb || (Ocb = new Ncb().a()); + return Ocb; + } + function Pcb() { + this.Id = null; + } + Pcb.prototype = new A32(); + Pcb.prototype.constructor = Pcb; + Pcb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 0.8"); + return this; + }; + Pcb.prototype.$classData = r8({ SKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$Raml08$", { SKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Qcb = void 0; + function uOa() { + Qcb || (Qcb = new Pcb().a()); + return Qcb; + } + function Rcb() { + this.Id = null; + } + Rcb.prototype = new A32(); + Rcb.prototype.constructor = Rcb; + Rcb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0"); + return this; + }; + Rcb.prototype.$classData = r8({ TKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$Raml10$", { TKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Scb = void 0; + function yOa() { + Scb || (Scb = new Rcb().a()); + return Scb; + } + function Tcb() { + this.Id = null; + } + Tcb.prototype = new A32(); + Tcb.prototype.constructor = Tcb; + Tcb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 Extension"); + return this; + }; + Tcb.prototype.$classData = r8({ UKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$Raml10Extension$", { UKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ucb = void 0; + function vx() { + Ucb || (Ucb = new Tcb().a()); + return Ucb; + } + function Vcb() { + this.Id = null; + } + Vcb.prototype = new A32(); + Vcb.prototype.constructor = Vcb; + Vcb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 Library"); + return this; + }; + Vcb.prototype.$classData = r8({ VKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$Raml10Library$", { VKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Wcb = void 0; + function BOa() { + Wcb || (Wcb = new Vcb().a()); + return Wcb; + } + function Xcb() { + this.Id = null; + } + Xcb.prototype = new A32(); + Xcb.prototype.constructor = Xcb; + Xcb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 Overlay"); + return this; + }; + Xcb.prototype.$classData = r8({ WKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlHeader$Raml10Overlay$", { WKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ycb = void 0; + function ux() { + Ycb || (Ycb = new Xcb().a()); + return Ycb; + } + function wFa() { + } + wFa.prototype = new y_(); + wFa.prototype.constructor = wFa; + d7 = wFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof en ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof en; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ jLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findExample$2", { jLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jFa() { + } + jFa.prototype = new y_(); + jFa.prototype.constructor = jFa; + d7 = jFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Wl ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Wl; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ kLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findHeader$2", { kLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function rFa() { + } + rFa.prototype = new y_(); + rFa.prototype.constructor = rFa; + d7 = rFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Wl ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Wl; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ lLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findParameter$2", { lLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function yFa() { + } + yFa.prototype = new y_(); + yFa.prototype.constructor = yFa; + d7 = yFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof ym ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof ym; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ mLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findPayload$2", { mLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function pFa() { + } + pFa.prototype = new y_(); + pFa.prototype.constructor = pFa; + d7 = pFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Bm ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Bm; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ nLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findRequestBody$2", { nLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function mFa() { + } + mFa.prototype = new y_(); + mFa.prototype.constructor = mFa; + d7 = mFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Em ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Em; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ oLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findResponse$2", { oLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function dFa() { + } + dFa.prototype = new y_(); + dFa.prototype.constructor = dFa; + d7 = dFa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof Bn ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Bn; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ pLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$$anonfun$findTemplatedLink$2", { pLa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function UP() { + } + UP.prototype = new u7(); + UP.prototype.constructor = UP; + d7 = UP.prototype; + d7.H = function() { + return "EmptyTarget"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "EmptyTarget"; + }; + d7.U = function() { + }; + d7.z = function() { + return -1432904418; + }; + d7.$classData = r8({ RLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.SpecParserOps$EmptyTarget$", { RLa: 1, f: 1, jha: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vx() { + this.l = this.oa = null; + } + Vx.prototype = new u7(); + Vx.prototype.constructor = Vx; + d7 = Vx.prototype; + d7.H = function() { + return "SingleTarget"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vx && a10.l === this.l) { + var b10 = this.oa; + a10 = a10.oa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.oa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.U = function(a10) { + a10.P(this.oa); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ULa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.SpecParserOps$SingleTarget", { ULa: 1, f: 1, jha: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zcb() { + this.Fa = null; + } + Zcb.prototype = new y_(); + Zcb.prototype.constructor = Zcb; + d7 = Zcb.prototype; + d7.Fp = function(a10) { + if (yr(a10)) + return new z7().d(a10); + if (a10 instanceof b62) + return new z7().d(ROa(a10)); + if (a10 instanceof c62) + return new z7().d(SOa(a10)); + var b10 = this.Fa.G_, c10 = Lo().Ix, e10 = this.Fa.Cl.j, f10 = y7(); + a10 = "Unsupported seq of emitter type in data node emitters " + a10; + var g10 = Ab(this.Fa.Cl.fa(), q5(jd)), h10 = yb(this.Fa.Cl); + b10.Gc(c10.j, e10, f10, a10, g10, Yb().qb, h10); + return y7(); + }; + function $cb(a10) { + var b10 = new Zcb(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + return b10; + } + d7.Jp = function(a10) { + return yr(a10) || a10 instanceof b62 || true; + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ dMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataNodeEmitter$$anonfun$1", { dMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function adb() { + } + adb.prototype = new y_(); + adb.prototype.constructor = adb; + d7 = adb.prototype; + d7.wk = function(a10) { + return a10 instanceof Es; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Es ? Od(O7(), a10.Aa) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ hMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataPropertyEmitter$$anonfun$2", { hMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ica() { + } + ica.prototype = new y_(); + ica.prototype.constructor = ica; + d7 = ica.prototype; + d7.eg = function(a10) { + return a10 instanceof en; + }; + d7.$f = function(a10, b10) { + return a10 instanceof en ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ mMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ExamplesEmitter$$anonfun$3", { mMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function T2a() { + } + T2a.prototype = new y_(); + T2a.prototype.constructor = T2a; + d7 = T2a.prototype; + d7.eg = function(a10) { + return a10 instanceof ij; + }; + d7.$f = function(a10, b10) { + return a10 instanceof ij ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ oMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ExtendsEmitter$$anonfun$1", { oMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function W2a() { + } + W2a.prototype = new y_(); + W2a.prototype.constructor = W2a; + d7 = W2a.prototype; + d7.eg = function(a10) { + return a10 instanceof kj; + }; + d7.$f = function(a10, b10) { + return a10 instanceof kj ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ pMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ExtendsEmitter$$anonfun$2", { pMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function QO() { + Xx.call(this); + this.YH = this.ST = this.sd = this.Ka = this.Ir = null; + } + QO.prototype = new Ola(); + QO.prototype.constructor = QO; + d7 = QO.prototype; + d7.H = function() { + return "OasAnnotationTypeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof QO) { + var b10 = this.Ir, c10 = a10.Ir; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ir; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.W$ = function(a10, b10, c10) { + this.Ir = a10; + this.Ka = b10; + this.sd = c10; + Xx.prototype.X$.call(this, a10, b10, c10); + this.ST = a10.g; + a10 = hd(this.ST, Sk().Jc); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(new d62().Zz(a10, this.Ka, H10(), this.sd))); + this.YH = a10.ua(); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ LMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAnnotationTypeEmitter", { LMa: 1, lha: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function PFa() { + } + PFa.prototype = new y_(); + PFa.prototype.constructor = PFa; + d7 = PFa.prototype; + d7.eg = function(a10) { + return a10 instanceof en; + }; + d7.$f = function(a10, b10) { + return a10 instanceof en ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ NMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAnyShapeEmitter$$anonfun$4", { NMa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jX() { + this.kd = this.m = this.we = this.Ca = null; + } + jX.prototype = new u7(); + jX.prototype.constructor = jX; + d7 = jX.prototype; + d7.H = function() { + return "OasCreativeWorkParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof jX ? Bj(this.Ca, a10.Ca) ? this.we === a10.we : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.we; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.BH = function() { + var a10 = this.Ca, b10 = qc(); + a10 = N6(a10, b10, this.m); + zpa || (zpa = new BC().a()); + b10 = this.Ca; + b10 = Rs(O7(), b10); + var c10 = new S6().a(); + b10 = new cn().K(c10, b10); + c10 = new M6().W(a10); + var e10 = li().Pf; + Gg(c10, "url", Hg(Ig(this, e10, this.m), b10)); + c10 = new M6().W(a10); + e10 = li().Va; + Gg(c10, "description", Hg(Ig(this, e10, this.m), b10)); + c10 = new M6().W(a10); + e10 = jx(new je4().e("title")); + var f10 = li().Kn; + Gg(c10, e10, Hg(Ig(this, f10, this.m), b10)); + c10 = this.we; + J5(K7(), H10()); + Ai(b10, c10); + Ry(new Sy(), b10, a10, H10(), this.m).hd(); + c10 = this.m.Nl; + e10 = nna(); + null !== c10 && c10 === e10 ? c10 = true : (c10 = this.m.Nl, e10 = rQ(), c10 = null !== c10 && c10 === e10); + c10 && Zz( + this.m, + b10.j, + a10, + "externalDoc" + ); + return b10; + }; + function YOa(a10, b10, c10, e10) { + a10.Ca = b10; + a10.we = c10; + a10.m = e10; + return a10; + } + d7.$classData = r8({ TMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasCreativeWorkParser", { TMa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function m3a() { + } + m3a.prototype = new y_(); + m3a.prototype.constructor = m3a; + d7 = m3a.prototype; + d7.eg = function(a10) { + return a10 instanceof Hm; + }; + d7.$f = function(a10, b10) { + return a10 instanceof Hm ? (b10 = B6(a10.g, Gm().R).A, b10 = b10.b() ? null : b10.c(), a10 = B6(a10.g, Gm().Va).A, cx(new dx(), b10, a10.b() ? null : a10.c(), Q5().Na, ld())) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ vNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasScopeValuesEmitters$$anonfun$emitters$26", { vNa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function bdb() { + } + bdb.prototype = new y_(); + bdb.prototype.constructor = bdb; + d7 = bdb.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ GNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTupleItemsShapeEmitter$$anonfun$5", { GNa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function z3a() { + } + z3a.prototype = new y_(); + z3a.prototype.constructor = z3a; + d7 = z3a.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ JNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeEmitter$$anonfun$entries$2", { JNa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function cdb() { + } + cdb.prototype = new y_(); + cdb.prototype.constructor = cdb; + d7 = cdb.prototype; + d7.Ee = function(a10, b10) { + if (a10 instanceof z7) { + var c10 = a10.i; + if (null !== c10) + return c10; + } + return b10.P(a10); + }; + d7.Ux = function() { + return this; + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7 && null !== a10.i ? true : false; + }; + d7.$classData = r8({ MNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$$anonfun$1", { MNa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ddb() { + } + ddb.prototype = new y_(); + ddb.prototype.constructor = ddb; + d7 = ddb.prototype; + d7.Waa = function(a10) { + a10 = a10.hb().gb; + var b10 = Q5().sa; + return a10 === b10; + }; + d7.f9 = function(a10, b10) { + var c10 = a10.hb().gb, e10 = Q5().sa; + return c10 === e10 ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Waa(a10); + }; + d7.Wa = function(a10, b10) { + return this.f9(a10, b10); + }; + d7.$classData = r8({ cOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$TupleShapeParser$$anonfun$2", { cOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function uma() { + } + uma.prototype = new y_(); + uma.prototype.constructor = uma; + d7 = uma.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ fOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypePartCollector$$anonfun$emitter$4", { fOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function edb() { + Wy.call(this); + this.sd = this.Ka = this.Gb = this.wn = null; + } + edb.prototype = new vma(); + edb.prototype.constructor = edb; + d7 = edb.prototype; + d7.H = function() { + return "Raml08SecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof edb) { + var b10 = this.wn, c10 = a10.wn; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wn; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.cA = function(a10, b10, c10, e10) { + this.wn = a10; + this.Gb = b10; + this.Ka = c10; + this.sd = e10; + Wy.prototype.bma.call(this, a10, b10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.Sja = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new J32().yU(b10, c10, e10, f10, a10.sd); + }; + }(this)); + }; + d7.$classData = r8({ nOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08SecuritySchemeEmitter", { nOa: 1, FPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function fdb() { + this.jw = this.p = this.pa = null; + } + fdb.prototype = new u7(); + fdb.prototype.constructor = fdb; + d7 = fdb.prototype; + d7.H = function() { + return "Raml08TypeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fdb) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = false, b10 = null, c10 = this.pa; + if (null !== c10 && Za(c10).na()) + return b10 = K7(), c10 = [this.jw.rL(c10)], J5(b10, new Ib().ha(c10)); + if (null !== c10 && B6(c10.Y(), qf().xd).Od(w6(/* @__PURE__ */ function() { + return function(e10) { + return wh(e10.fa(), q5(xh)); + }; + }(this)))) + return gdb(this); + if (c10 instanceof vh && (a10 = true, b10 = c10, Ab(b10.fa(), q5(xh)).na())) + return c10 = K7(), b10 = [a4a(b10, this.p, H10(), "schema", this.jw)], J5(c10, new Ib().ha(b10)); + if (c10 instanceof Mh) + return hdb(c10, this.p, this.jw).Pa(); + if (c10 instanceof th) { + b10 = B6(c10.aa, uh().Ff); + if (b10 instanceof Mh) + return c10 = hdb(b10, this.p, this.jw).Pa(), b10 = cx(new dx(), "repeat", "true", Q5().ti, ld()), a10 = K7(), c10.yg(b10, a10.u); + if (b10 instanceof Wh) + return c10 = new Mh().K(b10.aa, b10.Xa), b10 = Npa("file").ma().c(), a10 = Fg().af, c10 = eb(c10, a10, b10), c10 = hdb(c10, this.p, this.jw).Pa(), b10 = cx(new dx(), "repeat", "true", Q5().ti, ld()), a10 = K7(), c10.yg(b10, a10.u); + c10 = K7(); + b10 = [new e62().GK(b10, "Cannot emit array shape with items " + la(b10).t() + " in raml 08")]; + return J5(c10, new Ib().ha(b10)); + } + if (c10 instanceof Vh) + return b10 = K7(), c10 = [fPa(this, c10)], J5(b10, new Ib().ha(c10)); + if (c10 instanceof Gh) + return b10 = K7(), c10 = [$3a(c10, this.p, H10(), this.jw)], J5(b10, new Ib().ha(c10)); + if (c10 instanceof Th) + return g4a(c10, this.p, J5(K7(), H10()), this.jw).Pa(); + if (c10 instanceof Wh) + return c10 = new Mh().K(c10.aa, c10.Xa), b10 = Npa("file").ma().c(), a10 = Fg().af, c10 = eb(c10, a10, b10), hdb(c10, this.p, this.jw).Pa(); + if (a10) + return c10 = b10, b10 = this.p, a10 = H10(), new yX().Vx(c10, b10, a10, this.jw).Pa(); + b10 = K7(); + c10 = [new e62().GK(c10, "Unsupported shape class for emit raml 08 spec " + la(c10).t() + "`")]; + return J5(b10, new Ib().ha(c10)); + }; + d7.z = function() { + return X5(this); + }; + function gdb(a10) { + var b10 = B6(a10.pa.Y(), qf().xd); + b10 = Jc(b10, new idb()).c(); + var c10 = new qX(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + c10.u$ = b10; + b10 = J5(Ef(), H10()); + Dg(b10, c10); + c10 = a10.pa; + if (c10 instanceof vh && B6(c10.Y(), Ag().Ec).Da()) { + var e10 = a10.p, f10 = H10(); + gca(a10, c10, b10, e10, f10, a10.jw); + } + return b10; + } + d7.$classData = r8({ oOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeEmitter", { oOa: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function ePa() { + } + ePa.prototype = new y_(); + ePa.prototype.constructor = ePa; + d7 = ePa.prototype; + d7.nE = function(a10) { + return a10 instanceof vh; + }; + d7.Sa = function(a10) { + return this.nE(a10); + }; + d7.Wa = function(a10, b10) { + return this.zD(a10, b10); + }; + d7.zD = function(a10, b10) { + return a10 instanceof vh ? a10 : b10.P(a10); + }; + d7.$classData = r8({ rOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeEmitter$$anon$3$$anonfun$$nestedInanonfun$emit$135$1", { rOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function idb() { + } + idb.prototype = new y_(); + idb.prototype.constructor = idb; + d7 = idb.prototype; + d7.nE = function(a10) { + return null !== a10 && wh(a10.fa(), q5(xh)) ? true : false; + }; + d7.Sa = function(a10) { + return this.nE(a10); + }; + d7.Wa = function(a10, b10) { + return this.zD(a10, b10); + }; + d7.zD = function(a10, b10) { + return null !== a10 && wh(a10.fa(), q5(xh)) ? a10 : b10.P(a10); + }; + d7.$classData = r8({ sOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeEmitter$$anonfun$6", { sOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function f62() { + Wy.call(this); + this.sd = this.Ka = this.Gb = this.wn = null; + } + f62.prototype = new vma(); + f62.prototype.constructor = f62; + d7 = f62.prototype; + d7.H = function() { + return "Raml10SecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f62) { + var b10 = this.wn, c10 = a10.wn; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wn; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.cA = function(a10, b10, c10, e10) { + this.wn = a10; + this.Gb = b10; + this.Ka = c10; + this.sd = e10; + Wy.prototype.bma.call(this, a10, b10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.Sja = function() { + return dW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10) { + return new J32().yU(b10, c10, e10, f10, a10.sd); + }; + }(this)); + }; + d7.$classData = r8({ DOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10SecuritySchemeEmitter", { DOa: 1, FPa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y3a() { + this.Fa = null; + } + Y3a.prototype = new y_(); + Y3a.prototype.constructor = Y3a; + d7 = Y3a.prototype; + d7.laa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + return this; + }; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + if (a10 instanceof Mk) { + var c10 = ar(a10.g, Jk().nb).j, e10 = Xca(this.Fa.pa); + e10 = e10.b() ? "" : e10.c(); + if (c10 === e10) + return a10; + } + return b10.P(a10); + }; + d7.bm = function(a10) { + if (a10 instanceof Mk) { + a10 = ar(a10.g, Jk().nb).j; + var b10 = Xca(this.Fa.pa); + b10 = b10.b() ? "" : b10.c(); + if (a10 === b10) + return true; + } + return false; + }; + d7.$classData = r8({ FOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeEmitter$$anonfun$emitters$3", { FOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function h4a() { + } + h4a.prototype = new y_(); + h4a.prototype.constructor = h4a; + d7 = h4a.prototype; + d7.Fp = function(a10, b10) { + yr(a10) || (zr(a10) ? (b10 = new vX(), b10.pfa = a10, a10 = b10) : a10 = b10.P(a10)); + return a10; + }; + d7.laa = function() { + return this; + }; + d7.Jp = function(a10) { + return yr(a10) || zr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ GOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeEmitter$$anonfun$entries$1", { GOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function jdb() { + Xx.call(this); + this.YH = this.ST = this.sd = this.Ka = this.Ir = null; + } + jdb.prototype = new Ola(); + jdb.prototype.constructor = jdb; + d7 = jdb.prototype; + d7.H = function() { + return "RamlAnnotationTypeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jdb) { + var b10 = this.Ir, c10 = a10.Ir; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ir; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function xOa(a10, b10, c10) { + var e10 = new jdb(); + e10.Ir = a10; + e10.Ka = b10; + e10.sd = c10; + Xx.prototype.X$.call(e10, a10, b10, c10); + e10.ST = a10.g; + a10 = hd(e10.ST, Sk().Jc); + if (a10.b()) + a10 = y7(); + else { + c10 = a10.c(); + a10 = false; + b10 = null; + c10 = Vb().Ia(c10.r.r); + a: { + if (c10 instanceof z7 && (a10 = true, b10 = c10, c10 = b10.i, c10 instanceof vh)) { + a10 = Q32(c10, e10.Ka, H10(), H10(), e10.sd).Pa(); + if (!a10.oh(w6(/* @__PURE__ */ function() { + return function() { + return false; + }; + }(e10)))) { + if (!a10.oh(w6(/* @__PURE__ */ function() { + return function(k10) { + return yr(k10); + }; + }(e10)))) + throw mb(E6(), new nb().e("IllegalTypeDeclarations found: " + a10)); + b10 = new kdb(); + c10 = K7(); + a10 = a10.ec(b10, c10.u); + } + break a; + } + if (a10 && (c10 = b10.i, c10 instanceof zi)) { + a10 = new Zy().FO(c10, e10.Ka, H10(), e10.sd).Pa(); + break a; + } + if (a10) { + var f10 = b10.i; + a10 = e10.sd.Bc; + b10 = Lo().Ix; + c10 = e10.Ir.j; + var g10 = y7(), h10 = Ab(f10.fa(), q5(jd)); + f10 = f10.Ib(); + a10.Gc(b10.j, c10, g10, "Cannot emit raml type for a shape that is not an AnyShape", h10, Yb().qb, f10); + } + a10 = H10(); + } + a10 = new z7().d(a10); + } + e10.YH = a10 instanceof z7 ? a10.i : H10(); + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnnotationTypeEmitter", { NOa: 1, lha: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function kdb() { + } + kdb.prototype = new y_(); + kdb.prototype.constructor = kdb; + d7 = kdb.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ OOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnnotationTypeEmitter$$anonfun$$nestedInanonfun$shapeEmitters$1$1", { OOa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function F42() { + this.kd = this.m = this.Ca = null; + } + F42.prototype = new u7(); + F42.prototype.constructor = F42; + d7 = F42.prototype; + d7.H = function() { + return "RamlCreativeWorkParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof F42 ? Bj(this.Ca, a10.Ca) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.pv = function(a10, b10) { + this.Ca = a10; + this.m = b10; + return this; + }; + d7.rk = function() { + null === this.kd && eGa(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.BH = function() { + var a10 = this.Ca, b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = Rs(O7(), this.Ca); + var c10 = new S6().a(); + b10 = new cn().K(c10, b10); + c10 = new M6().W(a10); + var e10 = li().Kn; + Gg(c10, "title", nh(Hg(Ig(this, e10, this.m), b10))); + c10 = new M6().W(a10); + e10 = li().Va; + Gg(c10, "content", nh(Hg(Ig(this, e10, this.m), b10))); + var f10 = this.m.Gg(); + if (wia(f10)) + c10 = "url"; + else if (Cia(f10)) + c10 = fh(new je4().e("url")); + else { + c10 = this.m; + e10 = sg().l_; + f10 = "Unexpected vendor '" + f10 + "'"; + T6(); + var g10 = this.Ca, h10 = this.m, k10 = Dd(); + g10 = N6(g10, k10, h10); + h10 = y7(); + k10 = y7(); + var l10 = y7(); + c10.Gc(e10.j, f10, h10, g10, k10, Yb().qb, l10); + c10 = "url"; + } + e10 = new M6().W(a10); + f10 = li().Pf; + Gg(e10, c10, Hg(Ig(this, f10, this.m), b10)); + ii(); + c10 = [Zx().jv]; + e10 = -1 + (c10.length | 0) | 0; + for (f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Ry(new Sy(), b10, a10, f10, this.m).hd(); + return b10; + }; + d7.$classData = r8({ VOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlCreativeWorkParser", { VOa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function ldb() { + this.Fa = null; + } + ldb.prototype = new y_(); + ldb.prototype.constructor = ldb; + d7 = ldb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + if (a10 instanceof Mk) { + var c10 = ar(a10.g, Jk().nb).j, e10 = Xca(this.Fa.pa); + e10 = e10.b() ? "" : e10.c(); + if (c10 === e10) + return ar(a10.g, Jk().nb); + } + return b10.P(a10); + }; + d7.bm = function(a10) { + if (a10 instanceof Mk) { + a10 = ar(a10.g, Jk().nb).j; + var b10 = Xca(this.Fa.pa); + b10 = b10.b() ? "" : b10.c(); + if (a10 === b10) + return true; + } + return false; + }; + d7.$classData = r8({ $Oa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlExternalSourceEmitter$$anonfun$emit$7", { $Oa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function mdb() { + } + mdb.prototype = new y_(); + mdb.prototype.constructor = mdb; + d7 = mdb.prototype; + d7.eg = function(a10) { + return a10 instanceof Hm; + }; + d7.$f = function(a10, b10) { + return a10 instanceof Hm ? (a10 = B6(a10.g, Gm().R).A, T4a(new c42(), a10.b() ? null : a10.c(), Q5().Na)) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ vPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlOAuth2ScopeEmitter$$anonfun$1", { vPa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function yma() { + } + yma.prototype = new y_(); + yma.prototype.constructor = yma; + d7 = yma.prototype; + d7.nE = function(a10) { + return a10 instanceof zi; + }; + d7.Sa = function(a10) { + return this.nE(a10); + }; + d7.Wa = function(a10, b10) { + return this.zD(a10, b10); + }; + d7.zD = function(a10, b10) { + return a10 instanceof zi ? a10 : b10.P(a10); + }; + d7.$classData = r8({ LPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlShapeEmitter$$anonfun$2", { LPa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function iz() { + this.l = this.ea = this.m = this.MW = null; + } + iz.prototype = new u7(); + iz.prototype.constructor = iz; + d7 = iz.prototype; + d7.H = function() { + return "InheritsUnionMatcher"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof iz && a10.l === this.l) { + var b10 = this.MW; + a10 = a10.MW; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.MW; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function Ema(a10, b10) { + var c10 = B6(a10.MW.aa, xn().Le); + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return Bma(ndb(e10.l.l), g10, f10, true, e10.m).ua(); + }; + }(a10, b10)); + b10 = K7(); + c10 = c10.bd(a10, b10.u).xg(); + return 1 === c10.jb() ? new z7().d(c10.ga()) : new z7().d(zx()); + } + d7.$classData = r8({ UPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetector$ShapeClassTypeDefMatcher$InheritsUnionMatcher", { UPa: 1, f: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function odb() { + } + odb.prototype = new y_(); + odb.prototype.constructor = odb; + d7 = odb.prototype; + d7.Waa = function(a10) { + a10 = a10.hb().gb; + var b10 = Q5().sa; + return a10 === b10; + }; + d7.f9 = function(a10, b10) { + var c10 = a10.hb().gb, e10 = Q5().sa; + return c10 === e10 ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Waa(a10); + }; + d7.Wa = function(a10, b10) { + return this.f9(a10, b10); + }; + d7.$classData = r8({ lQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$TupleShapeParser$$anonfun$1", { lQa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function KPa() { + } + KPa.prototype = new y_(); + KPa.prototype.constructor = KPa; + d7 = KPa.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ pQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypePartEmitter$$anonfun$1", { pQa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function pdb() { + this.kd = this.m = this.oC = this.pa = null; + } + pdb.prototype = new u7(); + pdb.prototype.constructor = pdb; + d7 = pdb.prototype; + d7.H = function() { + return "ScalarFormatType"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pdb) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.oC === a10.oC : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.oC; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function qdb(a10, b10) { + return Zca(a10.oC) ? (b10 = "int" === b10 || "int8" === b10 || "int16" === b10 || "int32" === b10 ? new z7().d(Fe()) : "int64" === b10 || "long" === b10 ? new z7().d(Ge()) : "double" === b10 ? new z7().d(Ke()) : "float" === b10 ? new z7().d(Je()) : y7(), b10.b() ? a10.oC : b10.c()) : a10.oC; + } + function lca(a10, b10) { + b10 = ac(new M6().W(b10), "format"); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + var c10 = b10.i, e10 = bc(); + c10 = N6(c10, e10, a10.m).va; + Sla || (Sla = new by().a()); + if (!Rla(c10, a10.oC)) { + e10 = a10.m; + var f10 = sg().rY, g10 = a10.pa.j, h10 = "Format " + c10 + " is not valid for type " + LC(MC(), a10.oC), k10 = y7(); + nM(e10, f10, g10, k10, h10, b10.da); + } + e10 = Fg().Fn; + qP(nh(Hg(Ig(a10, e10, a10.m), a10.pa)), b10); + b10 = new z7().d(qdb(a10, c10)); + } + return b10.b() ? a10.oC : b10.c(); + } + d7.z = function() { + return X5(this); + }; + function mca(a10, b10, c10) { + var e10 = new pdb(); + e10.pa = a10; + e10.oC = b10; + e10.m = c10; + return e10; + } + d7.$classData = r8({ zQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ScalarFormatType", { zQa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function rdb() { + this.N = this.p = this.pa = null; + } + rdb.prototype = new u7(); + rdb.prototype.constructor = rdb; + d7 = rdb.prototype; + d7.H = function() { + return "SimpleTypeEmitter"; + }; + d7.E = function() { + return 2; + }; + function hdb(a10, b10, c10) { + var e10 = new rdb(); + e10.pa = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rdb) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.pa.aa, b10 = J5(Ef(), H10()), c10 = hd(a10, Fg().Zc); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "displayName", c10, y7())))); + c10 = B6(this.pa.aa, Fg().af).A; + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(Jpa(hz(), c10))); + var e10 = hd(a10, Fg().af); + if (!e10.b()) { + var f10 = e10.c(); + hz(); + e10 = B6(this.pa.aa, Fg().af).A; + e10 = Kpa(e10.b() ? null : e10.c()); + var g10 = Ab(this.pa.Xa, q5(bx)); + g10 instanceof z7 ? (f10 = g10.i.yc.$d, g10 = Q5().Na, e10 = Dg(b10, cx(new dx(), "type", e10, g10, f10))) : (f10 = kr(wr(), f10.r.x, q5(jd)), g10 = Q5().Na, e10 = Dg(b10, cx(new dx(), "type", e10, g10, f10))); + new z7().d(e10); + } + e10 = hd(a10, Fg().Va); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "description", e10, y7())))); + e10 = hd(a10, Fg().ch); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, cma(e10.r, this.p, this.N)))); + e10 = hd(a10, Fg().zl); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, Yg(Zg(), "pattern", oca(e10), y7(), this.N)))); + e10 = hd(a10, Fg().Cq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "minLength", e10, y7())))); + e10 = hd(a10, Fg().Aq); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "maxLength", e10, y7())))); + e10 = hd(a10, Fg().wj); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "minimum", e10, new z7().d(ey(fy(), c10)))))); + e10 = hd(a10, Fg().vj); + e10.b() || (e10 = e10.c(), new z7().d(Dg( + b10, + $g(new ah(), "maximum", e10, new z7().d(ey(fy(), c10))) + ))); + c10 = B6(this.pa.aa, Ag().Ec).kc(); + c10.b() || (c10 = c10.c(), Dg(b10, jca("example", c10, this.p, this.N))); + a10 = hd(a10, qf().Mh); + a10.b() || (a10 = a10.c(), c10 = B6(this.pa.aa, qf().Mh), e10 = this.p, f10 = Rb(Ut(), H10()), c10 = iy(new jy(), c10, e10, false, f10, this.N.Bc), a10 = kr(wr(), a10.r.x, q5(jd)), e10 = Q5().Na, new z7().d(Dg(b10, ky("default", c10, e10, a10)))); + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.SimpleTypeEmitter", { DQa: 1, f: 1, rha: 1, y: 1, v: 1, q: 1, o: 1 }); + function O32() { + this.kd = this.m = this.fl = this.X = this.yb = this.$ = null; + } + O32.prototype = new u7(); + O32.prototype.constructor = O32; + d7 = O32.prototype; + d7.H = function() { + return "SimpleTypeParser"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof O32) { + if (this.$ === a10.$) { + var b10 = this.yb, c10 = a10.yb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && Bj(this.X, a10.X) ? this.fl === a10.fl : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$; + case 1: + return this.yb; + case 2: + return this.X; + case 3: + return this.fl; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + var a10 = ac(new M6().W(this.X), "repeat"); + if (a10.b()) + a10 = false; + else { + a10 = a10.c().i; + var b10 = pM(); + a10 = !!N6(a10, b10, this.m); + } + if (a10) { + a10 = tRa(vRa(), this.X); + b10 = this.$; + O7(); + var c10 = new P6().a(); + a10 = Sd(a10, b10, c10); + this.yb.P(a10); + b10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return k10.ub(h10.j, lt2()); + }; + }(this, a10)); + ur(); + c10 = this.X.sb.Cb(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = h10.Aa; + var k10 = bc(); + return "repeat" !== N6(h10, k10, g10.m).va; + }; + }(this))); + var e10 = this.X.sb.kc(); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.da.Rf)); + b10 = U3a(new O32(), "items", b10, tr(0, c10, e10.b() ? "" : e10.c()), this.fl, this.m).Xi(); + ZA(a10, b10); + return a10; + } + a10 = ac(new M6().W(this.X), "type"); + a10.b() ? a10 = y7() : (a10 = a10.c(), b10 = a10.i.hb().gb, a10 = Q5().nd === b10 ? y7() : jc(kc(a10.i), bc())); + if (a10.b()) + a10 = O3a(this.fl, this.$, this.X, this.yb, this.m).Cc(); + else + a: { + if (a10 = a10.c(), b10 = Npa(a10.va), null !== b10 && (c10 = b10.ma(), c10 instanceof z7 && (c10 = c10.i, null !== c10 && (null !== b10.ya() ? (e10 = F6().Eb, c10 = c10 === ic(G5(e10, "file"))) : c10 = false, c10)))) { + a10 = MY(NY(), a10); + b10 = this.$; + O7(); + c10 = new P6().a(); + a10 = new z7().d(Sd(a10, b10, c10)); + break a; + } + if (null !== b10 && (c10 = b10.ma(), b10 = b10.ya(), c10 instanceof z7)) { + var f10 = c10.i; + if (null !== f10 && null !== b10) { + c10 = UY(VY(), a10); + e10 = Fg().af; + f10 = ih( + new jh(), + f10, + new P6().a() + ); + a10 = Od(O7(), a10); + a10 = Rg(c10, e10, f10, a10); + b10.b() || (c10 = b10.c(), "" !== c10 && (b10 = Fg().Fn, c10 = ih(new jh(), c10, new P6().a()), O7(), e10 = new P6().a(), Rg(a10, b10, c10, e10))); + b10 = this.$; + O7(); + c10 = new P6().a(); + a10 = new z7().d(Sd(a10, b10, c10)); + break a; + } + } + b10 = this.m; + c10 = sg().bJ; + e10 = "Invalid type def " + a10.va + " for " + Qb().$; + f10 = y7(); + ec(b10, c10, "", f10, e10, a10.da); + a10 = y7(); + } + a10.b() ? (a10 = UY(VY(), this.X), b10 = Uh().zj, c10 = Fg().af, a10 = eb(a10, c10, b10), b10 = this.$, O7(), c10 = new P6().a(), a10 = Sd(a10, b10, c10)) : a10 = a10.c(); + b10 = ac(new M6().W(this.X), "type"); + b10.b() || (c10 = b10.c(), b10 = a10.fa(), ae4(), c10 = c10.Aa.da, b10.Lb(new Jy().jj(ce4(0, de4( + ee4(), + c10.rf, + c10.If, + c10.Yf, + c10.bg + ))))); + this.yb.P(a10); + sdb(this, a10); + a10 instanceof Mh ? (b10 = B6(a10.aa, Fg().af).A, b10 = b10.b() ? null : b10.c()) : b10 = "#shape"; + b10 = Mc(ua(), b10, "#"); + b10 = Oc(new Pc().fd(b10)); + Zz(this.m, a10.j, this.X, "integer" === b10 || "float" === b10 || "double" === b10 || "long" === b10 || "number" === b10 ? "numberScalarShape" : "string" === b10 ? "stringScalarShape" : "dateTime" === b10 ? "dateScalarShape" : "shape"); + return a10; + }; + d7.t = function() { + return V5(W5(), this); + }; + function sdb(a10, b10) { + var c10 = new M6().W(a10.X), e10 = qf().Zc; + Gg(c10, "displayName", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new M6().W(a10.X); + e10 = qf().Va; + Gg(c10, "description", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new Nd().a(); + e10 = new M6().W(a10.X); + var f10 = qf().ch; + f10 = Hg(Ig(a10, f10, a10.m), b10); + var g10 = new z7().d(b10.j); + Gg(e10, "enum", Gy(f10, w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + return hma(ima(), k10, l10, m10, h10.m); + }; + }(a10, g10, c10)))); + c10 = ac(new M6().W(a10.X), "pattern"); + c10.b() || (c10 = c10.c(), e10 = c10.i, f10 = Dd(), f10 = e10 = N6(e10, f10, a10.m), 0 <= (f10.length | 0) && "^" === f10.substring(0, 1) || (e10 = "^" + e10), Ed(ua(), e10, "$") || (e10 += "$"), T6(), e10 = mh(T6(), e10), e10 = new Qg().Vb(e10, a10.m).Zf(), f10 = Od(O7(), c10), e10 = ih(new jh(), e10.r, f10), f10 = Fg().zl, c10 = Od(O7(), c10), Rg(b10, f10, e10, c10)); + c10 = new M6().W(a10.X); + e10 = Fg().Cq; + Gg(c10, "minLength", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new M6().W(a10.X); + e10 = Fg().Aq; + Gg(c10, "maxLength", Hg(Ig(a10, e10, a10.m), b10)); + c10 = ac(new M6().W(a10.X), "minimum"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = Fg().wj, f10 = f10.Zf(), e10 = Od(O7(), e10), Rg(b10, c10, f10, e10)); + c10 = ac(new M6().W(a10.X), "maximum"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = Fg().vj, f10 = f10.Zf(), e10 = Od(O7(), e10), Rg(b10, c10, f10, e10)); + b10 instanceof Mh && (c10 = B6(b10.aa, Fg().af).A, c10 = c10.b() ? "" : c10.c(), e10 = Uh().zj, null !== c10 && ra(c10, e10)); + c10 = new q42().zU("example", a10.X, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.qF(l10); + }; + }(a10, b10)), fca(new EP().GB(true, true, false), b10), a10.m).Cc(); + c10.b() || (e10 = c10.c(), c10 = Fg().Ec, e10 = J5(K7(), new Ib().ha([e10])), Zd(b10, c10, e10)); + c10 = ac(new M6().W(a10.X), "default"); + c10.b() || (c10 = c10.c(), e10 = c10.i.hb().gb, Q5().nd !== e10 && (a10 = Ey(Fy(c10.i, b10.j, false, false, false, a10.m)).Cl, a10.b() || (a10 = a10.c(), e10 = qf().Mh, f10 = Od(O7(), c10), Rg(b10, e10, a10, f10)), Mca(b10, c10))); + } + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + function U3a(a10, b10, c10, e10, f10, g10) { + a10.$ = b10; + a10.yb = c10; + a10.X = e10; + a10.fl = f10; + a10.m = g10; + return a10; + } + d7.$classData = r8({ EQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.SimpleTypeParser", { EQa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function tdb() { + } + tdb.prototype = new y_(); + tdb.prototype.constructor = tdb; + d7 = tdb.prototype; + d7.eg = function(a10) { + return a10 instanceof kj; + }; + d7.$f = function(a10, b10) { + return a10 instanceof kj ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ HQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.TraitExtendsEmitter$$anonfun$collect$1", { HQa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function udb() { + EP.call(this); + } + udb.prototype = new X4a(); + udb.prototype.constructor = udb; + udb.prototype.a = function() { + EP.prototype.GB.call(this, true, false, false); + return this; + }; + udb.prototype.$classData = r8({ OQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.DefaultExampleOptions$", { OQa: 1, k7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var vdb = void 0; + function GYa() { + vdb || (vdb = new udb().a()); + return vdb; + } + function wdb() { + } + wdb.prototype = new y_(); + wdb.prototype.constructor = wdb; + d7 = wdb.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ QQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ExampleValuesEmitter$$anonfun$1", { QQa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function xdb() { + Fz.call(this); + this.sd = this.Gb = this.Ka = this.nh = this.ds = null; + } + xdb.prototype = new Uma(); + xdb.prototype.constructor = xdb; + d7 = xdb.prototype; + d7.H = function() { + return "Oas2ServersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xdb) { + var b10 = this.ds, c10 = a10.ds; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.nh, c10 = a10.nh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ds; + case 1: + return this.nh; + case 2: + return this.Ka; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = uQa(yQa(), this.nh), b10 = J5(Ef(), H10()), c10 = a10.uo; + if (!c10.b()) { + c10 = c10.c().g; + var e10 = hd(c10, Yl().Pf); + if (!e10.b()) { + e10 = e10.c(); + pla || (pla = new Gx().a()); + var f10 = e10.r.r.t(); + f10 = Vb().Ia(f10); + if (f10.b()) + f10 = new Fx().t1("", "", ""); + else { + var g10 = f10.c(); + f10 = ""; + -1 !== (g10.indexOf("://") | 0) && (g10 = Mc(ua(), g10, "://"), f10 = zj(new Pc().fd(g10)), g10 = g10.n[1]); + var h10 = g10.indexOf("/") | 0, k10 = ""; + if (-1 < h10) { + var l10 = g10.substring(0, h10); + k10 = g10.substring(h10); + } else + l10 = g10; + f10 = new Fx().t1(f10, l10, k10); + } + g10 = new qg().e(f10.T9); + tc(g10) && (g10 = f10.T9, h10 = kr(wr(), e10.r.x, q5(ydb)), l10 = Q5().Na, Dg(b10, cx( + new dx(), + "host", + g10, + l10, + h10 + ))); + g10 = new qg().e(f10.ah); + tc(g10) && (g10 = f10.ah, h10 = kr(wr(), e10.r.x, q5(zdb)), l10 = Q5().Na, Dg(b10, cx(new dx(), "basePath", g10, l10, h10))); + g10 = new qg().e(f10.Tca); + tc(g10) ? (g10 = this.ds.g, h10 = Qm().Gh, g10 = !g10.vb.Ha(h10)) : g10 = false; + g10 ? (g10 = Qm().Gh, h10 = K7(), f10 = [ih(new jh(), f10.Tca, new P6().a())], f10 = Zr(new $r(), J5(h10, new Ib().ha(f10)), new P6().a()), e10 = Dg(b10, $x("schemes", lh(g10, kh(f10, e10.r.x)), this.Ka, false))) : e10 = void 0; + new z7().d(e10); + } + e10 = hd(c10, Yl().Va); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, Yg(Zg(), jx(new je4().e("serverDescription")), e10, y7(), this.sd)))); + c10 = hd(c10, Yl().Aj); + c10.b() ? y7() : (c10 = c10.c(), e10 = jx(new je4().e("baseUriParameters")), f10 = this.sd, new z7().d(Dg(b10, new eX().Sq(e10, c10, this.Ka, this.Gb, new JW().Ti(f10.hj(), f10.oy, new Yf().a()))))); + } + this.SN(jx(new je4().e("servers")), a10.yt, b10); + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.zaa = function(a10, b10, c10, e10, f10) { + this.ds = a10; + this.nh = b10; + this.Ka = c10; + this.Gb = e10; + this.sd = f10; + Fz.prototype.EO.call(this, a10, b10, c10, e10, f10); + return this; + }; + d7.$classData = r8({ WQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas2ServersEmitter", { WQa: 1, l7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Adb() { + Fz.call(this); + this.Gb = this.Ka = this.nh = this.uk = null; + } + Adb.prototype = new Uma(); + Adb.prototype.constructor = Adb; + d7 = Adb.prototype; + d7.H = function() { + return "Oas3EndPointServersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Adb) { + var b10 = this.uk, c10 = a10.uk; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.nh, c10 = a10.nh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uk; + case 1: + return this.nh; + case 2: + return this.Ka; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + function Bdb(a10, b10, c10, e10, f10) { + var g10 = new Adb(); + g10.uk = a10; + g10.nh = b10; + g10.Ka = c10; + g10.Gb = e10; + Fz.prototype.EO.call(g10, a10, b10, c10, e10, f10); + return g10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()); + this.SN("servers", B6(this.uk.g, Jl().lh), a10); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3EndPointServersEmitter", { YQa: 1, l7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cdb() { + EP.call(this); + } + Cdb.prototype = new X4a(); + Cdb.prototype.constructor = Cdb; + Cdb.prototype.a = function() { + EP.prototype.GB.call(this, true, true, false); + return this; + }; + Cdb.prototype.$classData = r8({ ZQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ExampleOptions$", { ZQa: 1, k7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ddb = void 0; + function b5a() { + Ddb || (Ddb = new Cdb().a()); + return Ddb; + } + function g62() { + this.kd = this.m = this.wc = this.Kd = this.X = null; + } + g62.prototype = new u7(); + g62.prototype.constructor = g62; + d7 = g62.prototype; + d7.Xw = function() { + var a10 = new M6().W(this.X), b10 = ag().ck; + Gg(a10, "summary", nh(Hg(Ig(this, b10, this.m), this.Kd))); + a10 = new M6().W(this.X); + b10 = ag().Va; + Gg(a10, "description", nh(Hg(Ig(this, b10, this.m), this.Kd))); + a10 = new M6().W(this.X); + b10 = ag().DR; + Gg(a10, "externalValue", nh(Hg(Ig(this, b10, this.m), this.Kd))); + a10 = this.Kd; + b10 = this.wc.$H; + var c10 = ag().Fq; + Bi(a10, c10, b10); + a10 = ac(new M6().W(this.X), "value"); + a10.b() || (a10 = a10.c(), i42(j42(new k42(), a10.i, this.Kd, this.wc, this.m))); + a10 = this.Kd; + b10 = this.X; + ii(); + c10 = [Zx().Kd]; + for (var e10 = -1 + (c10.length | 0) | 0, f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Ry(new Sy(), a10, b10, f10, this.m).hd(); + Zz(this.m, this.Kd.j, this.X, "example"); + return this.Kd; + }; + d7.H = function() { + return "Oas3ExampleValueParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g62) { + if (Bj(this.X, a10.X)) { + var b10 = this.Kd, c10 = a10.Kd; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.wc, a10 = a10.wc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.Kd; + case 2: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + function Edb(a10) { + null === a10.kd && (a10.kd = new UP()); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && Edb(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $Qa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ExampleValueParser", { $Qa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function a5a() { + this.kd = this.Rma = this.m = this.wc = this.we = this.tb = null; + } + a5a.prototype = new u7(); + a5a.prototype.constructor = a5a; + d7 = a5a.prototype; + d7.Xw = function() { + var a10 = this.tb.i, b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = this.m.hp((T6(), T6(), mr(T6(), a10, Q5().sa))); + if (b10 instanceof ve4) { + var c10 = b10.i; + b10 = oA(rA(), c10, "examples"); + var e10 = vFa(this.m.Dl(), b10); + if (e10.b()) + e10 = y7(); + else { + e10 = e10.c(); + O7(); + var f10 = new P6().a(); + e10 = new z7().d(Fdb(this, kM(e10, b10, f10))); + } + if (e10.b()) + if (e10 = w42(this.m, c10, this.m), e10 instanceof z7) + b10 = e10.i, c10 = qc(), a10 = new g62(), b10 = N6(b10, c10, this.m), c10 = Gdb(this), e10 = this.wc, f10 = this.m, a10.X = b10, a10.Kd = c10, a10.wc = e10, a10.m = f10, a10 = a10.Xw(); + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = this.m; + f10 = dc().au; + c10 = "Cannot find example reference " + c10; + var g10 = y7(); + ec(e10, f10, "", g10, c10, a10.da); + a10 = Fdb(this, new pP().Tq(b10, a10)); + b10 = this.we; + J5(K7(), H10()); + a10 = Ai(a10, b10); + } + else + a10 = e10.c(); + return a10; + } + if (b10 instanceof ye4) + return b10 = new g62(), c10 = Gdb(this), e10 = this.wc, f10 = this.m, b10.X = a10, b10.Kd = c10, b10.wc = e10, b10.m = f10, b10.Xw(); + throw new x7().d(b10); + }; + d7.H = function() { + return "Oas3NameExampleParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof a5a && this.tb === a10.tb && this.we === a10.we) { + var b10 = this.wc; + a10 = a10.wc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.we; + case 2: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && eGa(this); + return this.kd; + }; + function Fdb(a10, b10) { + var c10 = ag().R; + a10 = a10.Rma.nf(); + return Vd(b10, c10, a10); + } + function Gdb(a10) { + var b10 = Fdb(a10, Apa(Cpa(), a10.tb)); + a10 = a10.we; + J5(K7(), H10()); + return Ai(b10, a10); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3NameExampleParser", { dRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hdb() { + Fz.call(this); + this.Gb = this.Ka = this.nh = this.ds = null; + } + Hdb.prototype = new Uma(); + Hdb.prototype.constructor = Hdb; + d7 = Hdb.prototype; + d7.H = function() { + return "Oas3WebApiServersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Hdb) { + var b10 = this.ds, c10 = a10.ds; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.nh, c10 = a10.nh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ds; + case 1: + return this.nh; + case 2: + return this.Ka; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()); + this.SN("servers", YX(this.nh), a10); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.zaa = function(a10, b10, c10, e10, f10) { + this.ds = a10; + this.nh = b10; + this.Ka = c10; + this.Gb = e10; + Fz.prototype.EO.call(this, a10, b10, c10, e10, f10); + return this; + }; + d7.$classData = r8({ jRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3WebApiServersEmitter", { jRa: 1, l7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function d5a() { + this.kd = this.m = this.xb = this.tb = null; + } + d5a.prototype = new u7(); + d5a.prototype.constructor = d5a; + d7 = d5a.prototype; + d7.H = function() { + return "OasContentParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof d5a && this.tb === a10.tb) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.NO = function(a10, b10, c10) { + this.tb = a10; + this.xb = b10; + this.m = c10; + return this; + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + function Idb(a10) { + var b10 = new Qg().Vb(a10.tb.Aa, a10.m), c10 = b10.Zf().t(); + c10 = a10.xb.P(new z7().d(c10)); + a10 = Od(O7(), a10.tb); + a10 = Db(c10, a10); + c10 = xm().Nd; + b10 = b10.nf(); + return Vd(a10, c10, b10); + } + d7.ly = function() { + var a10 = this.tb.i, b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = Idb(this); + Zz(this.m, b10.j, a10, "content"); + var c10 = ac(new M6().W(a10), "schema"); + if (!c10.b()) { + c10 = c10.c(); + var e10 = oX(pX(), c10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + O7(); + var l10 = new P6().a(); + k10 = Sd(k10, "schema", l10); + l10 = h10.j; + var m10 = lt2(); + k10.ub(l10, m10); + }; + }(this, b10)), this.m).Cc(); + if (!e10.b()) { + var f10 = e10.c(); + e10 = xm().Jc; + f10 = HC(EC(), f10, b10.j, y7()); + c10 = Od(O7(), c10); + new z7().d(Rg(b10, e10, f10, c10)); + } + } + e10 = f5a(a10, b10.j, this.m).Vg(); + e10.Da() && (e10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = B6(h10.g, xm().Nd).A; + if (!l10.b()) { + l10 = l10.c(); + var m10 = ag().Nd; + eb(k10, m10, l10); + } + return k10.x.Lb(Gpa(Hpa(), h10.j)); + }; + }(this, b10))), c10 = xm().Ec, e10 = Zr(new $r(), e10, new P6().a()), Vd(b10, c10, e10)); + c10 = ac(new M6().W(a10), "encoding"); + c10.b() || (c10 = c10.c(), e10 = c10.i, f10 = qc(), e10 = new Jdb().Hw(N6(e10, f10, this.m), w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Kdb(h10, k10); + }; + }(this, b10)), this.m).Vg(), f10 = xm().XI, c10 = Od(O7(), c10), bs(b10, f10, e10, c10)); + Ry(new Sy(), b10, a10, H10(), this.m).hd(); + Zz(this.m, b10.j, a10, "content"); + return b10; + }; + d7.$classData = r8({ mRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasContentParser", { mRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Jdb() { + this.kd = this.m = this.xb = this.X = null; + } + Jdb.prototype = new u7(); + Jdb.prototype.constructor = Jdb; + d7 = Jdb.prototype; + d7.H = function() { + return "OasEncodingParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Jdb && Bj(this.X, a10.X)) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Ldb(a10, b10) { + var c10 = new Qg().Vb(b10.Aa, a10.m); + a10 = a10.xb.P(c10.Zf().t()); + b10 = Od(O7(), b10); + b10 = Db(a10, b10); + a10 = dm().lD; + c10 = c10.nf(); + return Vd(b10, a10, c10); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.Hw = function(a10, b10, c10) { + this.X = a10; + this.xb = b10; + this.m = c10; + return this; + }; + d7.Vg = function() { + var a10 = this.X.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = f10.i, h10 = qc(); + g10 = N6(g10, h10, e10.m); + f10 = Ldb(e10, f10); + h10 = new M6().W(g10); + var k10 = dm().yl; + Gg(h10, "contentType", Hg(Ig(e10, k10, e10.m), f10)); + h10 = ac(new M6().W(g10), "headers"); + if (!h10.b()) { + h10 = h10.c(); + k10 = h10.i; + var l10 = qc(); + k10 = new l42().Hw(N6(k10, l10, e10.m), w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = p10.j; + J5(K7(), H10()); + Ai(t10, v10); + v10 = Dm().Tf; + ig(p10, v10, t10); + }; + }(e10, f10)), e10.m).Vg(); + l10 = dm().Tf; + h10 = Od(O7(), h10); + bs(f10, l10, k10, h10); + } + h10 = new M6().W(g10); + k10 = dm().Yt; + Gg(h10, "style", Hg(Ig(e10, k10, e10.m), f10)); + h10 = new M6().W(g10); + k10 = dm().Vu; + Gg(h10, "explode", Hg(Ig( + e10, + k10, + e10.m + ), f10)); + h10 = new M6().W(g10); + k10 = dm().Su; + Gg(h10, "allowReserved", Hg(Ig(e10, k10, e10.m), f10)); + Ry(new Sy(), f10, g10, H10(), e10.m).hd(); + Zz(e10.m, f10.j, g10, "encoding"); + return f10; + }; + }(this)), c10 = rw(); + return a10.ka(b10, c10.sc); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ rRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasEncodingParser", { rRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function m42() { + this.kd = this.m = this.yb = this.X = null; + } + m42.prototype = new u7(); + m42.prototype.constructor = m42; + d7 = m42.prototype; + d7.SB = function() { + var a10 = this.m.Nl, b10 = rQ(); + if (null !== a10 && a10 === b10) + if (a10 = this.m, T6(), b10 = this.X, T6(), a10 = a10.hp(mr(T6(), b10, Q5().sa)), a10 instanceof ve4) { + b10 = a10.i; + a10 = oA(rA(), b10, "headers"); + var c10 = iFa(this.m.Qh, a10); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + O7(); + var e10 = new P6().a(); + c10 = kM(c10, a10, e10); + this.yb.P(c10); + c10 = new z7().d(c10); + } + if (c10.b()) + if (c10 = w42(this.m, b10, this.m), c10 instanceof z7) + a10 = c10.i, b10 = qc(), a10 = new m42().Hw(N6(a10, b10, this.m), this.yb, this.m).SB(); + else { + if (y7() !== c10) + throw new x7().d(c10); + c10 = this.m; + e10 = dc().au; + b10 = "Cannot find header reference " + b10; + var f10 = this.X, g10 = y7(); + ec( + c10, + e10, + "", + g10, + b10, + f10.da + ); + a10 = new Mdb().Tq(a10, this.X); + this.yb.P(a10); + } + else + a10 = c10.c(); + } else { + if (!(a10 instanceof ye4)) + throw new x7().d(a10); + a10 = Ndb(this); + Odb(this, a10, this.X); + } + else + a10 = Ndb(this), Pdb(this, a10, this.X); + b10 = cj().We; + c10 = ih(new jh(), "header", new P6().a()); + e10 = (O7(), new P6().a()).Lb(new Xz().a()); + Rg(a10, b10, c10, e10); + return a10; + }; + d7.H = function() { + return "OasHeaderParameterParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof m42 && Bj(this.X, a10.X)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.Hw = function(a10, b10, c10) { + this.X = a10; + this.yb = b10; + this.m = c10; + return this; + }; + function Ndb(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + a10.yb.P(b10); + var c10 = new M6().W(a10.X), e10 = cj().Va; + Gg(c10, "description", Hg(Ig(a10, e10, a10.m), b10)); + Ry(new Sy(), b10, a10.X, H10(), a10.m).hd(); + return b10; + } + function Pdb(a10, b10, c10) { + var e10 = Vb().Ia(B6(b10.g, cj().R)); + e10.b() ? e10 = y7() : (e10 = e10.c().A, e10 = new z7().d(e10.b() ? null : e10.c())); + var f10 = cj().yj; + if (e10.b()) + g10 = false; + else { + g10 = e10.c(); + var g10 = Ed(ua(), g10, "?"); + } + Bi(b10, f10, !g10); + f10 = new M6().W(c10); + g10 = cj().yj; + g10 = Hg(Ig(a10, g10, a10.m), b10); + Gg(f10, "x-amf-required", rP(g10, new xi().a())); + f10 = ac(new M6().W(c10), "type"); + f10.b() || (f10.c(), a10 = $Oa(pX(), (T6(), T6(), mr(T6(), c10, Q5().sa)), e10.b() ? "default" : e10.c(), w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + O7(); + var m10 = new P6().a(); + l10 = Sd(l10, "schema", m10); + m10 = k10.j; + var p10 = lt2(); + l10.ub(m10, p10); + }; + }(a10, b10)), a10.m).Cc(), a10.b() || (e10 = a10.c(), a10 = cj().Jc, e10 = HC(EC(), e10, b10.j, y7()), c10 = Od(O7(), c10), new z7().d(Rg(b10, a10, e10, c10)))); + } + function Odb(a10, b10, c10) { + var e10 = new M6().W(c10), f10 = cj().yj; + f10 = Hg(Ig(a10, f10, a10.m), b10); + Gg(e10, "required", rP(f10, new xi().a())); + e10 = new M6().W(c10); + f10 = cj().uh; + f10 = Hg(Ig(a10, f10, a10.m), b10); + Gg(e10, "deprecated", rP(f10, new xi().a())); + e10 = new M6().W(c10); + f10 = cj().wF; + f10 = Hg(Ig(a10, f10, a10.m), b10); + Gg(e10, "allowEmptyValue", rP(f10, new xi().a())); + e10 = ac(new M6().W(c10), "schema"); + if (!e10.b() && (e10 = e10.c(), f10 = oX(pX(), e10, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + O7(); + var m10 = new P6().a(); + l10 = Sd(l10, "schema", m10); + m10 = k10.j; + var p10 = lt2(); + l10.ub(m10, p10); + }; + }(a10, b10)), a10.m).Cc(), !f10.b())) { + var g10 = f10.c(); + f10 = cj().Jc; + g10 = HC( + EC(), + g10, + b10.j, + y7() + ); + e10 = Od(O7(), e10); + new z7().d(Rg(b10, f10, g10, e10)); + } + e10 = ac(new M6().W(c10), "content"); + e10.b() || (f10 = e10.c(), g10 = new h42().NO(f10, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + O7(); + var m10 = new P6().a(); + m10 = new ym().K(new S6().a(), m10); + if (!l10.b()) { + l10 = l10.c(); + var p10 = xm().Nd; + new z7().d(eb(m10, p10, l10)); + } + l10 = k10.j; + J5(K7(), H10()); + return Ai(m10, l10); + }; + }(a10, b10)), a10.m).GH(), tc(g10) && (e10 = Dm().Ne, g10 = Zr(new $r(), g10, new P6().a()), f10 = Od(O7(), f10), Rg(b10, e10, g10, f10))); + PPa(GX(), c10, b10, a10.m); + f10 = f5a(c10, b10.j, a10.m).Vg(); + f10.Da() && (e10 = xm().Ec, f10 = Zr(new $r(), f10, new P6().a()), Vd(b10, e10, f10)); + e10 = cj().We; + eb(b10, e10, "header"); + OPa(GX(), c10, b10); + NPa( + GX(), + c10, + b10 + ); + Zz(a10.m, b10.j, c10, "header"); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasHeaderParameterParser", { vRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function h62() { + this.kd = this.m = this.yb = this.$ = this.Ca = null; + } + h62.prototype = new u7(); + h62.prototype.constructor = h62; + d7 = h62.prototype; + d7.H = function() { + return "OasLinkParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof h62 && Bj(this.Ca, a10.Ca) && this.$ === a10.$) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.$; + case 2: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = this.Ca, b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = this.m.hp((T6(), T6(), mr(T6(), a10, Q5().sa))); + if (b10 instanceof ve4) { + b10 = b10.i; + var c10 = oA(rA(), b10, "links"), e10 = cFa(this.m.Qh, c10); + if (e10.b()) + c10 = y7(); + else { + e10 = e10.c(); + var f10 = Od(O7(), a10); + c10 = kM(e10, c10, f10); + e10 = this.$; + O7(); + f10 = new P6().a(); + Sd(c10, e10, f10); + this.yb.P(c10); + c10 = new z7().d(c10); + } + if (c10.b()) { + c10 = w42(this.m, b10, this.m); + if (c10 instanceof z7) + return a10 = c10.i, T6(), b10 = qc(), a10 = N6(a10, b10, this.m), T6(), Qdb(new h62(), mr(T6(), a10, Q5().sa), this.$, this.yb, this.m).Cc(); + if (y7() !== c10) + throw new x7().d(c10); + c10 = this.m; + e10 = dc().au; + b10 = "Cannot find link reference " + b10; + f10 = y7(); + ec(c10, e10, "", f10, b10, a10.da); + return y7(); + } + return c10; + } + if (b10 instanceof ye4) { + O7(); + b10 = new P6().a(); + b10 = new Bn().K(new S6().a(), b10); + c10 = this.$; + O7(); + e10 = new P6().a(); + b10 = Sd(b10, c10, e10); + c10 = Rs(O7(), (T6(), T6(), mr(T6(), a10, Q5().sa))); + b10 = Db(b10, c10); + this.yb.P(b10); + c10 = new M6().W(a10); + e10 = An().pN; + Gg(c10, "operationRef", Hg(Ig(this, e10, this.m), b10)); + c10 = new M6().W(a10); + e10 = An().RF; + Gg(c10, "operationId", Hg(Ig(this, e10, this.m), b10)); + if (B6(b10.g, An().pN).A.na() && B6(b10.g, An().RF).A.na()) { + c10 = this.m; + e10 = sg().$X; + f10 = b10.j; + var g10 = sg().$X.Ld; + yB(c10, e10, f10, g10, b10.x); + } + c10 = new M6().W(a10); + e10 = An().Va; + Gg( + c10, + "description", + Hg(Ig(this, e10, this.m), b10) + ); + c10 = ac(new M6().W(a10), "server"); + c10.b() || (c10 = c10.c().i, e10 = qc(), c10 = N6(c10, e10, this.m), c10 = gGa(hGa(b10.j, c10, this.m)), e10 = An().WF, Vd(b10, e10, c10)); + c10 = ac(new M6().W(a10), "parameters"); + c10.b() || (c10 = c10.c(), e10 = c10.i, f10 = qc(), e10 = N6(e10, f10, this.m).sb, f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = ka(new Qg().Vb(k10.Aa, h10.m).Zf().r), m10 = ka(new Qg().Vb(k10.i, h10.m).Zf().r); + k10 = Od(O7(), k10); + k10 = new Hn().K(new S6().a(), k10); + var p10 = Gn().pD; + l10 = eb(k10, p10, l10); + k10 = Gn().jD; + return eb(l10, k10, m10); + }; + }(this)), g10 = rw(), e10 = e10.ka(f10, g10.sc), f10 = An().kD, c10 = Od(O7(), c10.i), bs(b10, f10, e10, c10)); + c10 = new M6().W(a10); + e10 = An().VF; + Gg(c10, "requestBody", Hg(Ig(this, e10, this.m), b10)); + Ry(new Sy(), b10, a10, H10(), this.m).hd(); + Zz(this.m, b10.j, a10, "link"); + return new z7().d(b10); + } + throw new x7().d(b10); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function Qdb(a10, b10, c10, e10, f10) { + a10.Ca = b10; + a10.$ = c10; + a10.yb = e10; + a10.m = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ zRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasLinkParser", { zRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function y42() { + this.kd = this.m = this.xb = this.Ca = null; + } + y42.prototype = new u7(); + y42.prototype.constructor = y42; + d7 = y42.prototype; + d7.H = function() { + return "OasPayloadParser"; + }; + d7.E = function() { + return 2; + }; + d7.QO = function(a10, b10, c10) { + this.Ca = a10; + this.xb = b10; + this.m = c10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof y42 && Bj(this.Ca, a10.Ca)) { + var b10 = this.xb; + a10 = a10.xb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.ly = function() { + var a10 = this.Ca, b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = this.xb; + var c10 = ac(new M6().W(a10), "mediaType"); + c10.b() ? c10 = y7() : (c10 = c10.c().i, c10 = new z7().d(ka(new Qg().Vb(c10, this.m).Zf().r))); + b10 = b10.P(c10); + c10 = Rs(O7(), (T6(), T6(), mr(T6(), a10, Q5().sa))); + b10 = Db(b10, c10); + c10 = new M6().W(a10); + var e10 = xm().R; + Gg(c10, "name", Hg(Ig(this, e10, this.m), b10)); + c10 = new M6().W(a10); + e10 = xm().Nd; + Gg(c10, "mediaType", Hg(Ig(this, e10, this.m), b10)); + c10 = ac(new M6().W(a10), "schema"); + if (!c10.b() && (c10 = c10.c(), e10 = oX(pX(), c10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + O7(); + var l10 = new P6().a(); + k10 = Sd(k10, "schema", l10); + l10 = h10.j; + var m10 = lt2(); + k10.ub(l10, m10); + }; + }(this, b10)), this.m).Cc(), !e10.b())) { + var f10 = e10.c(); + e10 = xm().Jc; + f10 = HC(EC(), f10, b10.j, y7()); + c10 = Od(O7(), c10); + new z7().d(Rg(b10, e10, f10, c10)); + } + Ry(new Sy(), b10, a10, H10(), this.m).hd(); + return b10; + }; + d7.$classData = r8({ KRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasPayloadParser", { KRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function aQa() { + } + aQa.prototype = new y_(); + aQa.prototype.constructor = aQa; + d7 = aQa.prototype; + d7.a = function() { + return this; + }; + d7.eg = function(a10) { + return a10 instanceof en; + }; + d7.$f = function(a10, b10) { + return a10 instanceof en ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ TRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExamplesEmitter$$anonfun$apply$1", { TRa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Yz() { + this.kd = this.m = this.aq = this.X = null; + } + Yz.prototype = new u7(); + Yz.prototype.constructor = Yz; + d7 = Yz.prototype; + d7.H = function() { + return "OasResponseParser"; + }; + function Rdb(a10, b10, c10) { + O7(); + var e10 = new P6().a(); + e10 = new ym().K(new S6().a(), e10); + var f10 = new $5().a(); + e10 = Cb(e10, f10); + f10 = new M6().W(b10); + var g10 = jx(new je4().e("mediaType")); + f10 = ac(f10, g10); + if (!f10.b()) { + var h10 = f10.c(); + f10 = xm().Nd; + g10 = new Qg().Vb(h10.i, a10.m).nf(); + h10 = Od(O7(), h10); + Rg(e10, f10, g10, h10); + } + J5(K7(), H10()); + Ai(e10, c10); + b10 = ac(new M6().W(b10), "schema"); + b10.b() || (b10 = b10.c(), a10 = oX(pX(), b10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + O7(); + var p10 = new P6().a(); + m10 = Sd(m10, "default", p10); + p10 = l10.j; + var t10 = lt2(); + m10.ub(p10, t10); + }; + }(a10, e10)), a10.m).Cc(), a10.b() ? c10 = y7() : (a10 = a10.c(), Za(a10).na() ? Za(a10).na() ? (c10 = Za(a10), c10 = !(c10.b() ? 0 : wh(c10.c().fa(), q5(cv)))) : c10 = false : c10 = true, c10 && (c10 = new Kz().a(), Cb(a10, c10)), c10 = new z7().d(HC(EC(), a10, e10.j, y7()))), a10 = xm().Jc, c10 = c10.b() ? wpa(ypa(), b10.i) : c10.c(), f10 = Od(O7(), b10), Rg(e10, a10, c10, f10), e10.x.Sp(Od(O7(), b10))); + return tc(e10.g.vb) ? new z7().d(e10) : y7(); + } + d7.E = function() { + return 2; + }; + d7.EH = function() { + var a10 = this.m; + T6(); + var b10 = this.X; + T6(); + a10 = a10.hp(mr(T6(), b10, Q5().sa)); + if (a10 instanceof ve4) { + b10 = a10.i; + a10 = Dna(rA(), b10, this.m); + var c10 = hFa(this.m.Qh, a10, Zs()); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + O7(); + var e10 = new P6().a(); + c10 = kM(c10, a10, e10); + this.aq.P(c10); + c10 = new z7().d(c10); + } + if (c10.b()) { + c10 = w42(this.m, b10, this.m); + if (c10 instanceof z7) + return a10 = c10.i, b10 = qc(), new Yz().Hw(N6(a10, b10, this.m), this.aq, this.m).EH(); + if (y7() !== c10) + throw new x7().d(c10); + c10 = this.m; + e10 = dc().au; + var f10 = "Cannot find response reference " + b10, g10 = this.X, h10 = y7(); + ec(c10, e10, "", h10, f10, g10.da); + b10 = new nP().Tq(b10, this.X); + O7(); + c10 = new P6().a(); + a10 = kM(b10, a10, c10); + this.aq.P(a10); + return a10; + } + return c10.c(); + } + if (a10 instanceof ye4) + return O7(), a10 = new P6().a(), a10 = new Em().K(new S6().a(), a10), this.aq.P(a10), Zz(this.m, a10.j, this.X, "response"), b10 = new M6().W(this.X), c10 = Dm().Va, Gg(b10, "description", Hg(Ig(this, c10, this.m), a10)), b10 = ac(new M6().W(this.X), "headers"), b10.b() || (b10 = b10.c(), c10 = b10.i, e10 = qc(), e10 = new l42().Hw(N6(c10, e10, this.m), w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = l10.j; + J5(K7(), H10()); + Ai(m10, p10); + p10 = Dm().Tf; + ig(l10, p10, m10); + }; + }(this, a10)), this.m).Vg(), c10 = Am().Tf, e10 = Zr(new $r(), e10, Od(O7(), b10.i)), b10 = Od( + O7(), + b10 + ), Rg(a10, c10, e10, b10)), b10 = J5(Ef(), H10()), c10 = this.m.Nl, e10 = nna(), null !== c10 && c10 === e10 && (c10 = Rdb(this, this.X, a10.j), c10.b() || (c10 = c10.c(), Dg(b10, c10)), c10 = ac(new M6().W(this.X), "examples"), c10.b() || (e10 = c10.c(), f10 = new nQ().p1(e10, this.m).Vg(), f10.Da() && f10.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return m10.x.Lb(Gpa(Hpa(), l10.j)); + }; + }(this, a10))), c10 = Dm().Ec, f10 = Zr(new $r(), f10, Od(O7(), e10.i)), e10 = Od(O7(), e10), Rg(a10, c10, f10, e10)), Zz(this.m, a10.j, this.X, "response")), c10 = new M6().W(this.X), e10 = jx(new je4().e("responsePayloads")), c10 = ac(c10, e10), c10.b() || (c10 = c10.c().i, e10 = qc(), f10 = rw().sc, c10 = N6(c10, sw(f10, e10), this.m), e10 = w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + return Dg(l10, new y42().QO((T6(), T6(), mr(T6(), p10, Q5().sa)), w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return jQ(v10, A10); + }; + }(k10, m10)), k10.m).ly()); + }; + }(this, b10, a10)), f10 = K7(), c10.ka(e10, f10.u)), c10 = this.m.Nl, e10 = rQ(), null !== c10 && c10 === e10 && (c10 = ac(new M6().W(this.X), "content"), c10.b() || (c10 = c10.c(), ws(b10, new h42().NO(c10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return jQ(l10, m10); + }; + }(this, a10)), this.m).GH())), c10 = ac(new M6().W(this.X), "links"), c10.b() || (c10 = c10.c().i, e10 = qc(), N6(c10, e10, this.m).sb.U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = ka(new Qg().Vb( + m10.Aa, + k10.m + ).Zf().r); + return Qdb(new h62(), m10.i, p10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + var D10 = Dm().nN; + A10 = ig(v10, D10, A10); + D10 = v10.j; + J5(K7(), H10()); + Ai(A10, D10); + }; + }(k10, l10)), k10.m).Cc(); + }; + }(this, a10))))), b10.Da() && (c10 = Dm().Ne, b10 = Zr(new $r(), b10, new P6().a()), Vd(a10, c10, b10)), Ry(new Sy(), a10, this.X, H10(), this.m).hd(), a10; + throw new x7().d(a10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Yz && Bj(this.X, a10.X)) { + var b10 = this.aq; + a10 = a10.aq; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.aq; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.Hw = function(a10, b10, c10) { + this.X = a10; + this.aq = b10; + this.m = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ VRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseParser", { VRa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sdb() { + this.kd = this.m = this.X = this.Wd = null; + } + Sdb.prototype = new u7(); + Sdb.prototype.constructor = Sdb; + d7 = Sdb.prototype; + d7.H = function() { + return "OasServerParser"; + }; + d7.E = function() { + return 2; + }; + function gGa(a10) { + rSa || (rSa = new FZ().a()); + var b10 = qSa(a10.X), c10 = new M6().W(a10.X), e10 = Yl().Pf; + Gg(c10, "url", Hg(Ig(a10, e10, a10.m), b10)); + c10 = a10.Wd; + J5(K7(), H10()); + Ai(b10, c10); + c10 = new M6().W(a10.X); + e10 = Yl().Va; + Gg(c10, "description", Hg(Ig(a10, e10, a10.m), b10)); + c10 = ac(new M6().W(a10.X), "variables"); + if (!c10.b()) { + c10 = c10.c(); + e10 = c10.i; + var f10 = qc(); + e10 = N6(e10, f10, a10.m).sb; + f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = new MW().jn(l10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + var D10 = v10.j; + J5(K7(), H10()); + Ai(A10, D10); + }; + }(h10, k10)), false, tz(uz(), h10.m)).SB(), p10 = cj().We; + eb(m10, p10, "path"); + l10 = l10.i; + p10 = qc(); + Tdb(h10, m10, N6(l10, p10, h10.m)); + return m10; + }; + }( + a10, + b10 + )); + var g10 = rw(); + f10 = e10.ka(f10, g10.sc); + e10 = Yl().Aj; + f10 = Zr(new $r(), f10, Od(O7(), c10.i)); + c10 = Od(O7(), c10); + Rg(b10, e10, f10, c10); + } + Ry(new Sy(), b10, a10.X, H10(), a10.m).hd(); + Zz(a10.m, b10.j, a10.X, "server"); + return b10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Sdb ? this.Wd === a10.Wd ? Bj(this.X, a10.X) : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Wd; + case 1: + return this.X; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function hGa(a10, b10, c10) { + var e10 = new Sdb(); + e10.Wd = a10; + e10.X = b10; + e10.m = c10; + return e10; + } + d7.rk = function() { + null === this.kd && Edb(this); + return this.kd; + }; + function Tdb(a10, b10, c10) { + if (ac(new M6().W(c10), "default").b()) { + a10 = a10.m; + var e10 = sg().a8; + b10 = b10.j; + var f10 = y7(); + ec(a10, e10, b10, f10, "Server variable must define a 'default' field", c10.da); + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $Ra: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasServerParser", { $Ra: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function hQa() { + } + hQa.prototype = new y_(); + hQa.prototype.constructor = hQa; + d7 = hQa.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ vSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadEmitter$$anon$1$$anonfun$$nestedInanonfun$emit$14$1", { vSa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function uW() { + Oz.call(this); + this.ih = this.ic = null; + this.Lg = false; + this.ra = null; + } + uW.prototype = new bna(); + uW.prototype.constructor = uW; + d7 = uW.prototype; + d7.H = function() { + return "Raml08PayloadParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.ih = b10; + this.Lg = c10; + this.ra = e10; + Oz.prototype.jn.call(this, a10, b10, c10, e10); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof uW) { + if (this.ic === a10.ic) { + var b10 = this.ih, c10 = a10.ih; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.ly = function() { + var a10 = Oz.prototype.ly.call(this), b10 = B6(a10.g, xm().Nd).A; + b10 = b10.b() ? null : b10.c(); + if (Ed(ua(), b10, "?")) { + var c10 = xm().fw; + Bi(a10, c10, true); + c10 = xm().Nd; + var e10 = new qg().e(b10); + e10 = aQ(e10, "?"); + eb(a10, c10, e10); + } + c10 = this.ic.i.hb().gb; + if (Q5().nd === c10) + O7(), b10 = new P6().a(), c10 = new S6().a(), b10 = new vh().K(c10, b10), O7(), c10 = new P6().a(), b10 = Sd(b10, "schema", c10), c10 = a10.j, e10 = lt2(), b10 = b10.ub(c10, e10), b10.fa().Lb(new Xz().a()), c10 = xm().Jc, Vd(a10, c10, b10); + else if (Q5().sa === c10) { + ii(); + c10 = ["application/x-www-form-urlencoded", "multipart/form-data"]; + e10 = -1 + (c10.length | 0) | 0; + for (var f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Cg(f10, b10) ? (b10 = this.ic.i, c10 = qc(), b10 = J5a(new I5a(), N6(b10, c10, this.ra), a10.j, this.ra).Cc(), b10.b() || (b10 = b10.c(), c10 = xm().Jc, Vd(a10, c10, b10))) : (b10 = wW(xW(), this.ic, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return m10.ub(l10.j, lt2()); + }; + }(this, a10)), false, vP(), this.ra).Cc(), b10.b() || (b10 = b10.c(), b10 = HC(EC(), b10, a10.j, y7()), c10 = xm().Jc, Vd(a10, c10, b10))); + } else { + b10 = this.ra; + c10 = sg().pY; + e10 = a10.j; + f10 = y7(); + var g10 = y7(), h10 = y7(); + b10.Gc(c10.j, e10, f10, "Invalid payload. Payload must be a map or null", g10, Yb().qb, h10); + } + return a10; + }; + d7.$classData = r8({ xSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadParser", { xSa: 1, iTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Udb() { + } + Udb.prototype = new y_(); + Udb.prototype.constructor = Udb; + d7 = Udb.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ zSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadsEmitter$$anonfun$$nestedInanonfun$emit$11$1", { zSa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Vdb() { + } + Vdb.prototype = new y_(); + Vdb.prototype.constructor = Vdb; + d7 = Vdb.prototype; + d7.eg = function(a10) { + return a10 instanceof ym; + }; + d7.$f = function(a10, b10) { + return a10 instanceof ym ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ ASa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadsEmitter$$anonfun$1", { ASa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function fQ() { + Oz.call(this); + this.ih = this.ic = null; + this.Lg = false; + this.ra = null; + } + fQ.prototype = new bna(); + fQ.prototype.constructor = fQ; + d7 = fQ.prototype; + d7.H = function() { + return "Raml10PayloadParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.ih = b10; + this.Lg = c10; + this.ra = e10; + Oz.prototype.jn.call(this, a10, b10, c10, e10); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fQ) { + if (this.ic === a10.ic) { + var b10 = this.ih, c10 = a10.ih; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.ly = function() { + var a10 = Oz.prototype.ly.call(this), b10 = this.ic.i.hb().gb; + if (Q5().sa !== b10) { + b10 = this.ic.i; + var c10 = qc(); + b10 = Iw(b10, c10); + b10 instanceof ye4 && Ry(new Sy(), a10, b10.i, H10(), this.ra).hd(); + } + b10 = this.ic.i.hb().gb; + Q5().nd === b10 ? (b10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + O7(); + var h10 = new P6().a(); + g10 = Sd(g10, "schema", h10); + h10 = f10.j; + var k10 = lt2(); + return g10.ub(h10, k10); + }; + }(this, a10)), RW(false, false), vP(), this.ra).Cc(), b10.b() || (b10 = b10.c(), b10.fa().Lb(new Xz().a()), Jz(Lz(), b10), b10 = HC(EC(), b10, a10.j, y7()), c10 = xm().Jc, Vd(a10, c10, b10))) : (b10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + O7(); + var h10 = new P6().a(); + g10 = Sd(g10, "schema", h10); + h10 = f10.j; + var k10 = lt2(); + return g10.ub(h10, k10); + }; + }(this, a10)), RW(false, false), vP(), this.ra).Cc(), b10.b() || (b10 = b10.c(), Jz(Lz(), b10), b10 = HC(EC(), b10, a10.j, y7()), c10 = xm().Jc, Vd(a10, c10, b10))); + return a10; + }; + d7.$classData = r8({ LSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10PayloadParser", { LSa: 1, iTa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wdb() { + } + Wdb.prototype = new y_(); + Wdb.prototype.constructor = Wdb; + d7 = Wdb.prototype; + d7.Fp = function(a10, b10) { + return yr(a10) ? a10 : b10.P(a10); + }; + d7.Jp = function(a10) { + return yr(a10); + }; + d7.Sa = function(a10) { + return this.Jp(a10); + }; + d7.Wa = function(a10, b10) { + return this.Fp(a10, b10); + }; + d7.$classData = r8({ OSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10PayloadsEmitter$$anonfun$$nestedInanonfun$emit$26$1", { OSa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function zGa() { + } + zGa.prototype = new y_(); + zGa.prototype.constructor = zGa; + d7 = zGa.prototype; + d7.NU = function(a10) { + a10 = a10.i.hb().gb; + var b10 = Q5().sa; + return a10 === b10; + }; + d7.yS = function(a10, b10) { + var c10 = a10.i.hb().gb, e10 = Q5().sa; + return c10 === e10 ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.NU(a10); + }; + d7.Wa = function(a10, b10) { + return this.yS(a10, b10); + }; + d7.$classData = r8({ USa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlEndpointParser$$anonfun$1", { USa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function $P() { + this.xb = this.tb = null; + this.tn = false; + this.kd = this.m = null; + } + $P.prototype = new u7(); + $P.prototype.constructor = $P; + d7 = $P.prototype; + d7.H = function() { + return "RamlOperationParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.tb = a10; + this.xb = b10; + this.tn = c10; + this.m = e10; + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $P) { + if (this.tb === a10.tb) { + var b10 = this.xb, c10 = a10.xb; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.tn === a10.tn : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + case 2: + return this.tn; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.g2 = function() { + var a10 = this.tb.Aa, b10 = bc(); + b10 = N6(a10, b10, this.m).va; + a10 = this.xb.P(b10); + var c10 = Od(O7(), this.tb); + a10 = Db(a10, c10); + c10 = Pl().pm; + var e10 = new Qg().Vb(this.tb.Aa, this.m).nf(); + Vd(a10, c10, e10); + this.tn && Ed(ua(), b10, "?") && (c10 = Pl().fw, Bi(a10, c10, true), c10 = Pl().pm, e10 = new qg().e(b10), e10 = aQ(e10, "?"), eb(a10, c10, e10)); + c10 = this.tb.i.hb().gb; + if (Q5().sa === c10) + return b10 = this.tb.i, c10 = qc(), Xdb(this, N6(b10, c10, this.m), a10); + c10 = jc(kc(this.tb.i), bc()); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.va)); + c10.b() ? c10 = false : (c10 = c10.c(), c10 = "" === c10 || "null" === c10); + if (!c10) { + c10 = this.m; + e10 = sg().m6; + var f10 = a10.j; + b10 = "Invalid node " + this.tb.i + " for method " + b10; + var g10 = this.tb.i, h10 = y7(); + ec(c10, e10, f10, h10, b10, g10.da); + } + return a10; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.tb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.xb)); + a10 = OJ().Ga(a10, this.tn ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + function Xdb(a10, b10, c10) { + b10 = a10.tb.i; + var e10 = qc(); + b10 = N6(b10, e10, a10.m); + e10 = a10.m.iv; + var f10 = iA().f8; + e10 = null === e10 ? null === f10 : e10.h(f10); + Zz(a10.m, c10.j, b10, e10 ? "trait" : "operation"); + f10 = new M6().W(b10); + var g10 = Pl().R; + Gg(f10, "displayName", Hg(Ig(a10, g10, a10.m), c10)); + f10 = new M6().W(b10); + g10 = fh(new je4().e("oasDeprecated")); + var h10 = Pl().uh; + Gg(f10, g10, Hg(Ig(a10, h10, a10.m), c10)); + f10 = new M6().W(b10); + g10 = fh(new je4().e("summary")); + h10 = Pl().ck; + Gg(f10, g10, Hg(Ig(a10, h10, a10.m), c10)); + f10 = new M6().W(b10); + g10 = fh(new je4().e("externalDocs")); + h10 = Pl().Sf; + Gg(f10, g10, Gy(Hg(Ig(a10, h10, a10.m), c10), w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return jma( + kma(), + A10, + v10.j, + t10.m + ); + }; + }(a10, c10)))); + f10 = new M6().W(b10); + g10 = Pl().Gh; + Gg(f10, "protocols", sP(Hg(Ig(a10, g10, a10.m), c10))); + f10 = new M6().W(b10); + g10 = fh(new je4().e("consumes")); + h10 = Pl().Wp; + Gg(f10, g10, Hg(Ig(a10, h10, a10.m), c10)); + f10 = new M6().W(b10); + g10 = fh(new je4().e("produces")); + h10 = Pl().yl; + Gg(f10, g10, Hg(Ig(a10, h10, a10.m), c10)); + f10 = new M6().W(b10); + g10 = fh(new je4().e("tags")); + f10 = ac(f10, g10); + f10.b() || (f10 = f10.c().i, g10 = tw(), f10 = hna(new Tz(), N6(f10, g10, a10.m), c10.j, a10.m).Vg(), g10 = Pl().Xm, Zd(c10, g10, f10)); + f10 = w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return tGa(uGa(), v10, A10, t10.m); + }; + }(a10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return kda(v10, A10); + }; + }( + a10, + c10 + )))); + g10 = new M6().W(b10); + h10 = nc().Ni(); + Gg(g10, "is", HFa(sP(Gy(Hg(Ig(a10, h10, a10.m), c10), f10)))); + f10 = oy(a10.m.$h.Foa(), b10, oq(/* @__PURE__ */ function(t10, v10) { + return function() { + return xIa(v10); + }; + }(a10, c10)), a10.tn).Cc(); + if (!f10.b()) { + g10 = f10.c(); + f10 = Pl().dB; + ii(); + g10 = [g10]; + h10 = -1 + (g10.length | 0) | 0; + for (var k10 = H10(); 0 <= h10; ) + k10 = ji(g10[h10], k10), h10 = -1 + h10 | 0; + g10 = k10; + h10 = (O7(), new P6().a()).Lb(new Xz().a()); + bs(c10, f10, g10, h10); + } + f10 = new M6().W(b10); + g10 = fh(new je4().e("defaultResponse")); + f10 = ac(f10, g10); + f10.b() || (g10 = f10.c(), f10 = g10.i.hb().gb, h10 = Q5().sa, f10 === h10 && (f10 = J5(Ef(), H10()), g10 = g10.i, h10 = qc(), N6(g10, h10, a10.m).sb.U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + return Dg( + v10, + oy(t10.m.$h.x2(), D10, w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + var Y10 = I10.j; + J5(K7(), H10()); + Ai(L10, Y10); + }; + }(t10, A10)), t10.tn).EH() + ); + }; + }(a10, f10, c10))), g10 = Pl().Al, Zd(c10, g10, f10))); + f10 = ac(new M6().W(b10), "responses"); + if (!f10.b()) { + f10 = f10.c(); + g10 = J5(Ef(), H10()); + h10 = f10.i.hb().gb; + if (Q5().nd !== h10) { + h10 = f10.i; + k10 = qc(); + h10 = N6(h10, k10, a10.m).sb.Cb(w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = Px(); + v10 = v10.Aa; + var D10 = bc(); + return !Bla(A10, N6(v10, D10, t10.m).va); + }; + }(a10))); + k10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + v10 = v10.Aa; + var A10 = bc(); + return N6(v10, A10, t10.m).va; + }; + }(a10)); + var l10 = rw(); + k10 = h10.ka(k10, l10.sc); + l10 = qe2(); + l10 = re4(l10); + l10 = qt(k10, l10); + if (k10.jb() > l10.jb()) { + k10 = a10.m; + l10 = sg().PX; + var m10 = c10.j, p10 = y7(); + ec(k10, l10, m10, p10, "RAML Responses must not have duplicated status codes", f10.i.da); + } + h10.U(w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + return Dg(v10, oy(t10.m.$h.x2(), D10, w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + var Y10 = I10.j; + J5(K7(), H10()); + Ai(L10, Y10); + }; + }(t10, A10)), t10.tn).EH()); + }; + }(a10, g10, c10))); + } + k10 = B6(c10.g, Pl().Al); + h10 = Pl().Al; + g10 = ws(new Lf().a(), g10); + k10 = k10.Hd(); + g10 = Zr(new $r(), ws(g10, k10), Od(O7(), f10.i)); + f10 = Od(O7(), f10); + Rg(c10, h10, g10, f10); + } + f10 = new Nd().a(); + f10 = w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + wGa(); + return xGa(yGa(D10, v10, A10, t10.m)); + }; + }(a10, w6(/* @__PURE__ */ function(t10, v10) { + return function(A10) { + return v10.mI(A10); + }; + }( + a10, + c10 + )), f10)); + g10 = new M6().W(b10); + h10 = Pl().dc; + Gg(g10, "securedBy", sP(Gy(Hg(Ig(a10, h10, a10.m), c10), f10))); + f10 = new M6().W(b10); + g10 = Pl().Va; + Gg(f10, "description", nh(Hg(Ig(a10, g10, a10.m), c10))); + if (e10) { + ii(); + e10 = [Zx().Aea]; + f10 = -1 + (e10.length | 0) | 0; + for (g10 = H10(); 0 <= f10; ) + g10 = ji(e10[f10], g10), f10 = -1 + f10 | 0; + e10 = g10; + } else { + ii(); + e10 = [Zx().Kl]; + f10 = -1 + (e10.length | 0) | 0; + for (g10 = H10(); 0 <= f10; ) + g10 = ji(e10[f10], g10), f10 = -1 + f10 | 0; + e10 = g10; + } + Ry(new Sy(), c10, b10, e10, a10.m).hd(); + return c10; + } + d7.$classData = r8({ aTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlOperationParser", { aTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function r42() { + this.kd = this.cja = this.m = this.Bh = this.ba = this.X = null; + } + r42.prototype = new u7(); + r42.prototype.constructor = r42; + d7 = r42.prototype; + d7.H = function() { + return "RamlSecuritySettingsParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof r42 && Bj(this.X, a10.X) && this.ba === a10.ba) { + var b10 = this.Bh; + a10 = a10.Bh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Ydb(a10, b10, c10) { + c10 = a10.X.sb.Si(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = l10.Aa; + var m10 = bc(); + l10 = N6(l10, m10, h10.m).va; + return k10.Ha(l10) || Bla(Px(), l10); + }; + }(a10, c10))); + if (tc(c10)) { + T6(); + ur(); + var e10 = c10.kc(); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.da.Rf)); + c10 = tr(0, c10, e10.b() ? "" : e10.c()); + c10 = mr(T6(), c10, Q5().sa); + e10 = new z7().d(b10.j); + var f10 = new ox().a(), g10 = new Nd().a(); + a10 = px(c10, f10, e10, g10, a10.m).Fr(); + c10 = Nm().Dy; + Vd(b10, c10, a10); + } + return b10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.ba; + case 2: + return this.Bh; + default: + throw new U6().e("" + a10); + } + }; + function S5a(a10) { + var b10 = a10.ba; + if ("OAuth 1.0" === b10) { + b10 = a10.Bh.cX(); + var c10 = new M6().W(a10.X), e10 = vZ().zJ; + Gg(c10, "requestTokenUri", nh(Hg(Ig(a10, e10, a10.m), b10))); + c10 = new M6().W(a10.X); + e10 = vZ().km; + Gg(c10, "authorizationUri", nh(Hg(Ig(a10, e10, a10.m), b10))); + c10 = new M6().W(a10.X); + e10 = vZ().GJ; + Gg(c10, "tokenCredentialsUri", nh(Hg(Ig(a10, e10, a10.m), b10))); + c10 = new M6().W(a10.X); + e10 = vZ().DJ; + Gg(c10, "signatures", Hg(Ig(a10, e10, a10.m), b10)); + b10 = Ydb(a10, b10, new Ib().ha(["requestTokenUri", "authorizationUri", "tokenCredentialsUri", "signatures"])); + } else + "OAuth 2.0" === b10 ? b10 = Zdb(a10) : a10.cja === b10 ? (b10 = a10.Bh.mQ(), c10 = new M6().W(a10.X), e10 = aR().R, Gg(c10, "name", Hg(Ig(a10, e10, a10.m), b10)), c10 = new M6().W(a10.X), e10 = aR().Ny, Gg(c10, "in", Hg(Ig(a10, e10, a10.m), b10)), b10 = Ydb(a10, b10, new Ib().ha(["name", "in"]))) : (b10 = a10.Bh.aX(), b10 = Ydb(a10, b10, new Ib().ha([]))); + c10 = a10.X; + ii(); + e10 = [Zx().Xda]; + for (var f10 = -1 + (e10.length | 0) | 0, g10 = H10(); 0 <= f10; ) + g10 = ji(e10[f10], g10), f10 = -1 + f10 | 0; + Ry(new Sy(), b10, c10, g10, a10.m).hd(); + a10 = Od(O7(), a10.X); + return Db(b10, a10); + } + d7.t = function() { + return V5(W5(), this); + }; + function Zdb(a10) { + var b10 = a10.Bh.pQ(), c10 = new Nv().PG(oq(/* @__PURE__ */ function(h10, k10) { + return function() { + var l10 = vSa(xSa(), h10.X), m10 = k10.j; + J5(K7(), H10()); + return Ai(l10, m10); + }; + }(a10, b10))), e10 = ac(new M6().W(a10.X), "authorizationUri"); + if (!e10.b()) { + e10 = e10.c(); + var f10 = Jm().km; + qP(Hg(Ig(a10, f10, a10.m), Ov(c10)), e10); + } + e10 = ac(new M6().W(a10.X), "accessTokenUri"); + e10.b() || (e10 = e10.c(), f10 = Jm().vq, qP(nh(Hg(Ig(a10, f10, a10.m), Ov(c10))), e10)); + e10 = new M6().W(a10.X); + f10 = fh(new je4().e("flow")); + e10 = ac(e10, f10); + e10.b() || (e10 = e10.c(), f10 = Jm().Wv, qP(Hg(Ig(a10, f10, a10.m), Ov(c10)), e10)); + e10 = new M6().W(a10.X); + f10 = xE().Gy; + Gg( + e10, + "authorizationGrants", + sP(Hg(Ig(a10, f10, a10.m), b10)) + ); + e10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = new Qg().Vb(l10, h10.m).Zf(), p10 = h10.Bh; + if (p10 instanceof jm) { + var t10 = false, v10 = B6(B6(p10.g, im().Eq).g, Xh().Oh); + if (v10 instanceof wE) { + t10 = true; + v10 = B6(v10.g, xE().Ap).kc(); + if (v10.b()) + v10 = false; + else { + v10 = B6(v10.c().g, Jm().lo); + var A10 = w6(/* @__PURE__ */ function() { + return function(C10) { + C10 = B6(C10.g, Gm().R).A; + return C10.b() ? null : C10.c(); + }; + }(h10)), D10 = K7(); + v10 = v10.ka(A10, D10.u).Ha(m10.t()); + } + if (v10) + return O7(), p10 = new P6().a(), p10 = new Hm().K(new S6().a(), p10), m10 = Gm().R, l10 = new Qg().Vb(l10, h10.m).Zf(), l10 = Vd(p10, m10, l10), p10 = Ov(k10).j, J5(K7(), H10()), Ai(l10, p10); + } + if (t10) + return O7(), t10 = new P6().a(), t10 = new Hm().K(new S6().a(), t10), v10 = Ov(k10).j, J5(K7(), H10()), t10 = Ai(t10, v10), v10 = h10.m, A10 = sg().p8, D10 = t10.j, m10 = m10.t(), p10 = B6(B6(p10.g, im().Eq).g, Xh().R).A, p10 = "Scope '" + m10 + "' not found in settings of declared secured by " + (p10.b() ? null : p10.c()) + ".", m10 = y7(), ec(v10, A10, D10, m10, p10, l10.da), t10; + O7(); + p10 = new P6().a(); + p10 = new Hm().K(new S6().a(), p10); + m10 = Gm().R; + l10 = new Qg().Vb(l10, h10.m).Zf(); + l10 = Vd(p10, m10, l10); + p10 = Ov(k10).j; + J5(K7(), H10()); + return Ai(l10, p10); + } + O7(); + p10 = new P6().a(); + p10 = new Hm().K(new S6().a(), p10); + m10 = Gm().R; + l10 = new Qg().Vb(l10, h10.m).Zf(); + l10 = Vd(p10, m10, l10); + p10 = Ov(k10).j; + J5(K7(), H10()); + return Ai( + l10, + p10 + ); + }; + }(a10, c10)); + f10 = ac(new M6().W(a10.X), "scopes"); + if (!f10.b()) { + f10 = f10.c(); + var g10 = Jm().lo; + qP(sP(Gy(Hg(Ig(a10, g10, a10.m), Ov(c10)), e10)), f10); + } + c10 = c10.r; + c10.b() || (e10 = c10.c(), c10 = xE().Ap, e10 = J5(K7(), new Ib().ha([e10])), Zd(b10, c10, e10)); + return Ydb(a10, b10, new Ib().ha(["authorizationUri", "accessTokenUri", "authorizationGrants", "scopes"])); + } + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + function T5a(a10, b10, c10, e10, f10) { + a10.X = b10; + a10.ba = c10; + a10.Bh = e10; + a10.m = f10; + a10.cja = jx(new je4().e("apiKey")); + return a10; + } + d7.$classData = r8({ tTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSecuritySettingsParser", { tTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function $db() { + this.kd = this.m = this.qo = this.X = null; + } + $db.prototype = new u7(); + $db.prototype.constructor = $db; + function aeb(a10, b10, c10) { + var e10 = ac(new M6().W(a10.X), "baseUriParameters"); + if (e10 instanceof z7) { + e10 = e10.i; + var f10 = e10.i.hb().gb; + if (Q5().sa === f10) { + f10 = e10.i; + var g10 = qc(); + f10 = T32(new U32(), N6(f10, g10, a10.m), w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + var p10 = l10.j; + J5(K7(), H10()); + Ai(m10, p10); + }; + }(a10, b10)), a10.m).Vg(); + g10 = w6(/* @__PURE__ */ function() { + return function(k10) { + var l10 = cj().We; + return eb(k10, l10, "path"); + }; + }(a10)); + var h10 = K7(); + f10 = f10.ka(g10, h10.u); + g10 = w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + var t10 = l10.Fb(w6(/* @__PURE__ */ function(v10, A10) { + return function(D10) { + D10 = B6(D10.g, cj().R).A; + return (D10.b() ? null : D10.c()) === A10; + }; + }(k10, p10))); + return t10 instanceof z7 ? t10.i : beb(p10, m10.j); + }; + }(a10, f10, b10)); + h10 = K7(); + g10 = c10.ka(g10, h10.u); + c10 = f10.Dm(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return l10.Ha(m10); + }; + }(a10, g10))); + if (null === c10) + throw new x7().d(c10); + c10 = c10.ya(); + f10 = K7(); + g10 = g10.ia(c10, f10.u); + f10 = Yl().Aj; + g10 = Zr(new $r(), g10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(b10, f10, g10, e10); + c10.U(w6(/* @__PURE__ */ function(k10) { + return function(l10) { + var m10 = k10.m, p10 = sg().HJ, t10 = l10.j, v10 = y7(), A10 = B6(l10.g, cj().R).A; + m10.Ns(p10, t10, v10, "Unused base uri parameter " + (A10.b() ? null : A10.c()), Ab(l10.x, q5(jd)), yb(l10)); + }; + }(a10))); + } else + Q5().nd !== f10 && (b10 = a10.m, a10 = sg().a6, e10 = e10.i, c10 = y7(), ec( + b10, + a10, + "", + c10, + "Invalid node for baseUriParameters", + e10.da + )); + } else if (y7() === e10) + c10.Da() && (e10 = Yl().Aj, a10 = w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return beb(m10, l10.j); + }; + }(a10, b10)), f10 = K7(), a10 = Zr(new $r(), c10.ka(a10, f10.u), (O7(), new P6().a())), O7(), c10 = new P6().a(), Rg(b10, e10, a10, c10)); + else + throw new x7().d(e10); + } + d7 = $db.prototype; + d7.H = function() { + return "RamlServersParser"; + }; + d7.E = function() { + return 2; + }; + function ceb(a10, b10, c10) { + var e10 = new $db(); + e10.X = a10; + e10.qo = b10; + e10.m = c10; + return e10; + } + function beb(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new Wl().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + c10 = Sd(c10, a10, e10); + e10 = cj().We; + c10 = eb(c10, e10, "path"); + e10 = cj().yj; + c10 = Bi(c10, e10, true); + J5(K7(), H10()); + Ai(c10, b10); + a10 = c10.dX(a10); + b10 = Uh().zj; + e10 = Fg().af; + eb(a10, e10, b10); + c10.x.Lb(new Xz().a()); + return c10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $db && Bj(this.X, a10.X)) { + var b10 = this.qo; + a10 = a10.qo; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.qo; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.hd = function() { + var a10 = ac(new M6().W(this.X), "baseUri"); + if (a10 instanceof z7) { + a10 = a10.i; + var b10 = zla(Cla(), a10.i, this.m).Zf().t(), c10 = this.qo.CM(b10), e10 = Yl().Pf; + qP(nh(Hg(Ig(this, e10, this.m), c10)), a10); + e10 = a10.i; + var f10 = c10.j, g10 = ic(Yl().Pf.r); + bca(b10, e10, f10, g10, this.m); + if (!Cja(Yv(), b10)) { + e10 = this.m; + f10 = sg().s6; + g10 = this.qo.j; + var h10 = Bja(Yv(), b10), k10 = a10.i, l10 = y7(); + ec(e10, f10, g10, l10, h10, k10.da); + } + e10 = new M6().W(this.X); + f10 = fh(new je4().e("serverDescription")); + g10 = Yl().Va; + Gg(e10, f10, Hg(Ig(this, g10, this.m), c10)); + aeb(this, c10, Dja(Yv(), b10)); + b10 = this.qo; + e10 = Qm().lh; + f10 = K7(); + g10 = new Xz().a(); + c10 = [Cb(c10, g10)]; + c10 = Zr(new $r(), J5(f10, new Ib().ha(c10)), Od(O7(), a10.i)); + a10 = Od(O7(), a10); + Rg(b10, e10, c10, a10); + } else if (y7() === a10) + a10 = ac(new M6().W(this.X), "baseUriParameters"), a10.b() || (a10 = a10.c(), c10 = this.m, b10 = sg().S7, e10 = this.qo.j, f10 = y7(), ec(c10, b10, e10, f10, "'baseUri' not defined and 'baseUriParameters' defined.", a10.da), O7(), c10 = new P6().a(), c10 = new Zl().K(new S6().a(), c10), b10 = this.qo.j, J5(K7(), H10()), f10 = Ai(c10, b10), aeb(this, f10, H10()), c10 = this.qo, b10 = Qm().lh, e10 = K7(), g10 = new Xz().a(), f10 = [Cb(f10, g10)], e10 = Zr(new $r(), J5(e10, new Ib().ha(f10)), Od(O7(), a10.i)), a10 = Od(O7(), a10), Rg(c10, b10, e10, a10)); + else + throw new x7().d(a10); + a10 = ac( + new M6().W(this.X), + fh(new je4().e("servers")) + ); + a10.b() || (a10 = a10.c().i, c10 = qc(), b10 = rw().sc, a10 = N6(a10, sw(b10, c10), this.m), c10 = w6(/* @__PURE__ */ function(m10) { + return function(p10) { + return gGa(hGa(m10.qo.j, p10, wz(uz(), m10.m))); + }; + }(this)), b10 = K7(), a10.ka(c10, b10.u).U(w6(/* @__PURE__ */ function(m10) { + return function(p10) { + var t10 = m10.qo, v10 = Qm().lh; + return ig(t10, v10, p10); + }; + }(this)))); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlServersParser", { wTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function deb() { + this.kd = this.m = this.wc = this.xb = this.tb = null; + } + deb.prototype = new u7(); + deb.prototype.constructor = deb; + d7 = deb.prototype; + d7.Xw = function() { + var a10 = Hb(this.xb), b10 = Od(O7(), this.tb); + a10 = Db(a10, b10); + b10 = this.tb.i.hb().gb; + if (Q5().sa === b10) { + b10 = this.tb.i; + var c10 = qc(); + b10 = N6(b10, c10, this.m); + if (ac(new M6().W(b10), "value").na()) { + c10 = new M6().W(b10); + var e10 = ag().Zc; + Gg(c10, "displayName", nh(Hg(Ig(this, e10, this.m), a10))); + c10 = new M6().W(b10); + e10 = ag().Va; + Gg(c10, "description", nh(Hg(Ig(this, e10, this.m), a10))); + c10 = new M6().W(b10); + e10 = ag().Fq; + Gg(c10, "strict", nh(Hg(Ig(this, e10, this.m), a10))); + c10 = ac(new M6().W(b10), "value"); + c10.b() || (c10 = c10.c(), i42(j42(new k42(), c10.i, a10, this.wc, this.m))); + ii(); + c10 = [Zx().Kd]; + e10 = -1 + (c10.length | 0) | 0; + for (var f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Ry(new Sy(), a10, b10, f10, this.m).hd(); + c10 = this.m.Gg(); + Vaa(c10) && Zz(this.m, a10.j, b10, "example"); + } else + i42(j42(new k42(), this.tb.i, a10, this.wc, this.m)); + } else + Q5().nd !== b10 && i42(j42(new k42(), this.tb.i, a10, this.wc, this.m)); + return a10; + }; + d7.H = function() { + return "RamlSingleExampleValueParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof deb && this.tb === a10.tb && this.xb === a10.xb) { + var b10 = this.wc; + a10 = a10.wc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tb; + case 1: + return this.xb; + case 2: + return this.wc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + function P5a(a10, b10, c10, e10) { + var f10 = new deb(); + f10.tb = a10; + f10.xb = b10; + f10.wc = c10; + f10.m = e10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSingleExampleValueParser", { yTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function eeb() { + } + eeb.prototype = new y_(); + eeb.prototype.constructor = eeb; + d7 = eeb.prototype; + d7.eg = function(a10) { + return a10 instanceof tm; + }; + d7.$f = function(a10, b10) { + return a10 instanceof tm ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ BTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.SecurityRequirementsEmitter$$anonfun$collect$1", { BTa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function rR() { + sR.call(this); + this.O0 = null; + } + rR.prototype = new B6a(); + rR.prototype.constructor = rR; + rR.prototype.fK = function() { + var a10 = tA(uA(), Au(), this.O0.x), b10 = ar(this.O0.g, Jk().nb).fh, c10 = GN(b10); + b10 = OA(); + var e10 = new PA().e(b10.pi), f10 = new qg().e(b10.mi); + tc(f10) && QA(e10, b10.mi); + f10 = e10.s; + var g10 = e10.ca, h10 = new rr().e(g10), k10 = wr(), l10 = D6a(this, this.O0, a10).Qc, m10 = K7(); + a10 = [KEa(c10, H10(), a10, this.je)]; + a10 = J5(m10, new Ib().ha(a10)); + c10 = K7(); + jr(k10, l10.ia(a10, c10.u), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + return new RA().Ac(SA(zs(), b10.pi), e10.s); + }; + rR.prototype.Lj = function() { + return this.je; + }; + rR.prototype.$classData = r8({ PTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.JsonSchemaValidationFragmentEmitter", { PTa: 1, uha: 1, m7: 1, UR: 1, f: 1, QR: 1, SY: 1 }); + function L22() { + this.ea = this.Qc = this.Q = this.p = this.h0 = null; + } + L22.prototype = new u7(); + L22.prototype.constructor = L22; + d7 = L22.prototype; + d7.Jw = function(a10, b10, c10, e10) { + this.h0 = a10; + this.p = b10; + this.Q = c10; + this.ea = nv().ea; + var f10 = ula(wla(), a10, y7()); + a10 = J5(Ef(), H10()); + if (tc(f10.Oo)) { + var g10 = JEa(e10.zf), h10 = new Fc().Vd(f10.Oo); + Dg(a10, oy(g10, h10.Sb.Ye().Dd(), c10, b10)); + } + tc(f10.x) && (g10 = new Fc().Vd(f10.x), Dg(a10, new feb().CU(g10.Sb.Ye().Dd(), b10, e10))); + tc(f10.Ko) && (g10 = jx(new je4().e("resourceTypes")), h10 = new Fc().Vd(f10.Ko), Dg(a10, new i62().jE(g10, h10.Sb.Ye().Dd(), b10, H10(), e10))); + tc(f10.Ro) && (g10 = jx(new je4().e("traits")), h10 = new Fc().Vd(f10.Ro), Dg(a10, new i62().jE(g10, h10.Sb.Ye().Dd(), b10, H10(), e10))); + tc(f10.Pp) && (g10 = new Fc().Vd(f10.Pp), Dg( + a10, + new geb().CU(g10.Sb.Ye().Dd(), b10, e10) + )); + h10 = new Fc().Vd(f10.Cs); + g10 = Xd().u; + g10 = se4(h10, g10); + for (h10 = h10.Sb.Ye(); h10.Ya(); ) { + var k10 = h10.$a(); + g10.jd(Dz(Ez(), k10, y7())); + } + g10 = g10.Rc(); + k10 = new Fc().Vd(f10.Es); + h10 = Xd().u; + h10 = se4(k10, h10); + for (k10 = k10.Sb.Ye(); k10.Ya(); ) { + var l10 = k10.$a(); + h10.jd(Sma(Ez(), l10, y7())); + } + h10 = h10.Rc(); + k10 = Xd(); + h10 = g10.ia(h10, k10.u); + h10.Da() && (g10 = new j6(), h10 = h10.ke(), g10.zu = h10, g10.p = b10, g10.Q = c10, g10.la = "parameters", g10.N = e10, Dg(a10, g10)); + tc(f10.YD) && (g10 = new Fc().Vd(f10.YD), Dg(a10, new heb().Jw(g10.Sb.Ye().Dd(), b10, c10, e10))); + tc(f10.Np) && (g10 = new Fc().Vd(f10.Np), Dg(a10, new k6().VO( + "responses", + g10.Sb.Ye().Dd(), + b10, + c10, + e10 + ))); + tc(f10.qK) && (g10 = new Fc().Vd(f10.qK), Dg(a10, new NX().eA("examples", g10.Sb.Ye().Dd(), b10, e10))); + tc(f10.ZL) && (g10 = new Fc().Vd(f10.ZL), Dg(a10, new ieb().Jw(g10.Sb.Ye().Dd(), b10, c10, e10))); + tc(f10.pL) && (g10 = new Fc().Vd(f10.pL), Dg(a10, new jeb().Jw(g10.Sb.Ye().Dd(), b10, c10, e10))); + if (tc(f10.mB)) { + g10 = new Fc().Vd(f10.mB); + Xd(); + Id(); + f10 = new Lf().a(); + for (g10 = g10.Sb.Ye(); g10.Ya(); ) + h10 = g10.$a().Hd(), ws(f10, h10); + f10 = f10.ua(); + g10 = Wt(f10); + g10.b() ? g10 = y7() : (g10 = g10.c(), g10 = new z7().d(g10.x)); + g10 = g10.b() ? (O7(), new P6().a()) : g10.c(); + b10 = new ZX().kE(f10, b10, c10, g10, e10); + c10 = kr(wr(), g10, q5(jd)); + e10 = Q5().Na; + Dg(a10, ky( + "callbacks", + b10, + e10, + c10 + )); + } + this.Qc = a10; + return this; + }; + d7.H = function() { + return "OasDeclarationsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof L22) { + var b10 = this.h0, c10 = a10.h0; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.h0; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDeclarationsEmitter", { bUa: 1, f: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function m6a() { + } + m6a.prototype = new y_(); + m6a.prototype.constructor = m6a; + d7 = m6a.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ lUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$$anonfun$1", { lUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function k6a() { + } + k6a.prototype = new y_(); + k6a.prototype.constructor = k6a; + d7 = k6a.prototype; + d7.BD = function(a10, b10) { + if (null !== a10) { + var c10 = a10.ya(); + if (0 < c10.Oe(1)) + return c10.ta(); + } + return b10.P(a10); + }; + d7.Sa = function(a10) { + return this.pE(a10); + }; + d7.Wa = function(a10, b10) { + return this.BD(a10, b10); + }; + d7.pE = function(a10) { + return null !== a10 && 0 < a10.ya().Oe(1) ? true : false; + }; + d7.$classData = r8({ mUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$$anonfun$2", { mUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function v6a() { + } + v6a.prototype = new y_(); + v6a.prototype.constructor = v6a; + d7 = v6a.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ pUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$EndpointParser$$anonfun$3", { pUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function f6a() { + Sz.call(this); + this.ih = this.ic = null; + } + f6a.prototype = new gna(); + f6a.prototype.constructor = f6a; + d7 = f6a.prototype; + d7.H = function() { + return "Oas2OperationParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f6a && a10.l === this.l && this.ic === a10.ic) { + var b10 = this.ih; + a10 = a10.ih; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.$na = function(a10, b10) { + var c10 = new Wz().gE(this.l, b10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + ona(h10, k10); + }; + }(this, a10)), this.l.Mb()).Cc(); + if (!c10.b()) { + var e10 = c10.c(); + c10 = Pl().dB; + var f10 = K7(); + e10 = Zr(new $r(), J5(f10, new Ib().ha([e10])), new P6().a()); + f10 = (O7(), new P6().a()).Lb(new Xz().a()); + new z7().d(Rg(a10, c10, e10, f10)); + } + c10 = new M6().W(b10); + e10 = this.l; + f10 = Pl().Gh; + Gg(c10, "schemes", Hg(Ig(e10, f10, this.l.Mb()), a10)); + c10 = new M6().W(b10); + e10 = this.l; + f10 = Pl().Wp; + Gg(c10, "consumes", Hg(Ig(e10, f10, this.l.Mb()), a10)); + b10 = new M6().W(b10); + c10 = this.l; + e10 = Pl().yl; + Gg(b10, "produces", Hg(Ig(c10, e10, this.l.Mb()), a10)); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JO = function(a10, b10, c10) { + this.ic = b10; + this.ih = c10; + Sz.prototype.JO.call(this, a10, b10, c10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$Oas2OperationParser", { qUa: 1, vUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function e6a() { + Sz.call(this); + this.ih = this.ic = null; + } + e6a.prototype = new gna(); + e6a.prototype.constructor = e6a; + d7 = e6a.prototype; + d7.H = function() { + return "Oas3OperationParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof e6a && a10.l === this.l && this.ic === a10.ic) { + var b10 = this.ih; + a10 = a10.ih; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.$na = function(a10, b10) { + var c10 = ac(new M6().W(b10), "requestBody"); + if (!c10.b()) { + var e10 = c10.c(); + c10 = this.l; + e10 = e10.i; + var f10 = qc(); + new z42().gE(c10, N6(e10, f10, this.l.Mb()), w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + ona(h10, k10); + }; + }(this, a10)), this.l.Mb()).Cc(); + } + c10 = this.l; + e10 = Vb().Ia(AD(a10)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(oq(/* @__PURE__ */ function(g10, h10) { + return function() { + return h10; + }; + }(this, e10)))); + z6a(y6a(new x6a(), c10, b10, e10.b() ? oq(/* @__PURE__ */ function(g10, h10) { + return function() { + return xIa(h10); + }; + }(this, a10)) : e10.c(), this.l.Mb())); + c10 = ac(new M6().W(b10), "callbacks"); + c10.b() || (c10 = c10.c().i, e10 = qc(), c10 = N6(c10, e10, this.l.Mb()).sb, e10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = k10.Aa, m10 = bc(); + l10 = N6(l10, m10, g10.l.Mb()).va; + m10 = g10.l; + var p10 = k10.i, t10 = qc(); + return r6a(new v42(), m10, N6(p10, t10, g10.l.Mb()), w6(/* @__PURE__ */ function(v10, A10, D10) { + return function(C10) { + O7(); + var I10 = new P6().a(); + C10 = Sd(C10, A10, I10); + I10 = D10.j; + J5(K7(), H10()); + Ai(C10, I10); + }; + }(g10, l10, h10)), l10, k10).GH(); + }; + }(this, a10)), f10 = rw(), c10 = c10.bd(e10, f10.sc), e10 = Pl().AF, Zd(a10, e10, c10)); + c10 = a10.g; + e10 = Pl().dB; + c10.vb.Ha(e10) && AD(a10).x.Lb(new x42().a()); + this.l.Mb().$h.Qpa(b10, a10).hd(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JO = function(a10, b10, c10) { + this.ic = b10; + this.ih = c10; + Sz.prototype.JO.call(this, a10, b10, c10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ sUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$Oas3OperationParser", { sUa: 1, vUa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function mna() { + } + mna.prototype = new y_(); + mna.prototype.constructor = mna; + d7 = mna.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ wUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentParser$OperationParser$$anonfun$4", { wUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function G6a() { + this.l = this.Qc = this.Xg = this.p = this.Ri = null; + } + G6a.prototype = new u7(); + G6a.prototype.constructor = G6a; + d7 = G6a.prototype; + d7.H = function() { + return "AnnotationFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G6a && a10.l === this.l) { + var b10 = this.Ri, c10 = a10.Ri; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ri; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ yUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$AnnotationFragmentEmitter", { yUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function keb() { + this.l = this.Qc = this.Xg = this.p = this.hs = null; + } + keb.prototype = new u7(); + keb.prototype.constructor = keb; + d7 = keb.prototype; + d7.H = function() { + return "DataTypeFragmentEmitter"; + }; + function D6a(a10, b10, c10) { + var e10 = new keb(); + e10.hs = b10; + e10.p = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + e10.Xg = A42(new B42(), a10, Eka()); + var f10 = ar(b10.g, Jk().nb); + b10 = ar(b10.g, Gk().xc); + var g10 = H10(), h10 = H10(), k10 = H10(); + e10.Qc = Vy(f10, c10, g10, b10, h10, k10, false, a10.Lj()).zw(); + return e10; + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof keb && a10.l === this.l) { + var b10 = this.hs, c10 = a10.hs; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hs; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ zUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$DataTypeFragmentEmitter", { zUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function C6a() { + this.l = this.Qc = this.Xg = this.p = this.jv = null; + } + C6a.prototype = new u7(); + C6a.prototype.constructor = C6a; + d7 = C6a.prototype; + d7.H = function() { + return "DocumentationItemFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof C6a && a10.l === this.l) { + var b10 = this.jv, c10 = a10.jv; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jv; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ AUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$DocumentationItemFragmentEmitter", { AUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function I6a() { + this.l = this.Qc = this.Xg = this.p = this.P1 = null; + } + I6a.prototype = new u7(); + I6a.prototype.constructor = I6a; + d7 = I6a.prototype; + d7.H = function() { + return "NamedExampleFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof I6a && a10.l === this.l) { + var b10 = this.P1, c10 = a10.P1; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.P1; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ BUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$NamedExampleFragmentEmitter", { BUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function E6a() { + this.l = this.Qc = this.Xg = this.p = this.w2 = null; + } + E6a.prototype = new u7(); + E6a.prototype.constructor = E6a; + d7 = E6a.prototype; + d7.H = function() { + return "ResourceTypeFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof E6a && a10.l === this.l) { + var b10 = this.w2, c10 = a10.w2; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.w2; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$ResourceTypeFragmentEmitter", { DUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function C42() { + } + C42.prototype = new y_(); + C42.prototype.constructor = C42; + C42.prototype.PJ = function(a10) { + if (null !== a10) + return a10; + throw mb(E6(), new nb().e("Fragment not encoding DataObjectNode but " + a10)); + }; + C42.prototype.Sa = function() { + return true; + }; + C42.prototype.Wa = function(a10) { + return this.PJ(a10); + }; + C42.prototype.$classData = r8({ EUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$ResourceTypeFragmentEmitter$$anonfun$1", { EUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function H6a() { + this.l = this.Qc = this.Xg = this.p = this.Qf = null; + } + H6a.prototype = new u7(); + H6a.prototype.constructor = H6a; + d7 = H6a.prototype; + d7.H = function() { + return "SecuritySchemeFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof H6a && a10.l === this.l) { + var b10 = this.Qf, c10 = a10.Qf; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Qf; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ FUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$SecuritySchemeFragmentEmitter", { FUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function F6a() { + this.l = this.Qc = this.Xg = this.p = this.s3 = null; + } + F6a.prototype = new u7(); + F6a.prototype.constructor = F6a; + d7 = F6a.prototype; + d7.H = function() { + return "TraitFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof F6a && a10.l === this.l) { + var b10 = this.s3, c10 = a10.s3; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.s3; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.Qc; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ GUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$TraitFragmentEmitter", { GUa: 1, f: 1, jN: 1, y: 1, v: 1, q: 1, o: 1 }); + function D42() { + } + D42.prototype = new y_(); + D42.prototype.constructor = D42; + D42.prototype.PJ = function(a10) { + if (null !== a10) + return a10; + throw mb(E6(), new nb().e("Fragment not encoding DataObjectNode but " + a10)); + }; + D42.prototype.Sa = function() { + return true; + }; + D42.prototype.Wa = function(a10) { + return this.PJ(a10); + }; + D42.prototype.$classData = r8({ HUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$TraitFragmentEmitter$$anonfun$2", { HUa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function cA() { + fA.call(this); + } + cA.prototype = new R6a(); + cA.prototype.constructor = cA; + cA.prototype.a = function() { + fA.prototype.UO.call(this, "apiKey", true); + return this; + }; + cA.prototype.$classData = r8({ WUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$ApiKeyOas$", { WUa: 1, kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var tna = void 0; + function bA() { + fA.call(this); + } + bA.prototype = new R6a(); + bA.prototype.constructor = bA; + bA.prototype.a = function() { + fA.prototype.UO.call(this, "basic", true); + return this; + }; + bA.prototype.$classData = r8({ XUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$BasicAuthOas$", { XUa: 1, kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var sna = void 0; + function dA() { + fA.call(this); + } + dA.prototype = new R6a(); + dA.prototype.constructor = dA; + dA.prototype.a = function() { + fA.prototype.UO.call(this, "http", true); + return this; + }; + dA.prototype.$classData = r8({ YUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$Http$", { YUa: 1, kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var una = void 0; + function aA() { + fA.call(this); + } + aA.prototype = new R6a(); + aA.prototype.constructor = aA; + aA.prototype.a = function() { + fA.prototype.UO.call(this, "oauth2", true); + return this; + }; + aA.prototype.$classData = r8({ ZUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$OAuth20Oas$", { ZUa: 1, kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var rna = void 0; + function eA() { + fA.call(this); + } + eA.prototype = new R6a(); + eA.prototype.constructor = eA; + eA.prototype.a = function() { + fA.prototype.UO.call(this, "openIdConnect", true); + return this; + }; + eA.prototype.$classData = r8({ $Ua: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSecuritySchemeTypeMapping$OpenIdConnect$", { $Ua: 1, kN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var vna = void 0; + function leb() { + } + leb.prototype = new y_(); + leb.prototype.constructor = leb; + d7 = leb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof bg ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof bg; + }; + d7.$classData = r8({ cVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecEmitter$ReferencesEmitter$$anonfun$1", { cVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function meb() { + } + meb.prototype = new y_(); + meb.prototype.constructor = meb; + d7 = meb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ dVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecEmitter$ReferencesEmitter$$anonfun$2", { dVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function U6a() { + } + U6a.prototype = new y_(); + U6a.prototype.constructor = U6a; + d7 = U6a.prototype; + d7.eg = function(a10) { + return a10 instanceof cn; + }; + d7.$f = function(a10, b10) { + return a10 instanceof cn ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ kVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasUserDocumentationsEmitter$$anonfun$1", { kVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function neb() { + } + neb.prototype = new y_(); + neb.prototype.constructor = neb; + d7 = neb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof BB || a10 instanceof mf ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof BB || a10 instanceof mf; + }; + d7.$classData = r8({ tVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ExtensionLikeParser$$anonfun$getParent$2", { tVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function mW() { + this.Ka = this.Xd = this.N = null; + } + mW.prototype = new Jna(); + mW.prototype.constructor = mW; + d7 = mW.prototype; + d7.DO = function(a10, b10, c10) { + this.Xd = a10; + this.Ka = b10; + TA.prototype.DO.call(this, a10, b10, c10); + return this; + }; + d7.H = function() { + return "Raml08RootLevelEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mW) { + var b10 = this.Xd, c10 = a10.Xd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xd; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + return this.O9(); + }; + d7.z = function() { + return X5(this); + }; + d7.O9 = function() { + var a10 = ula(wla(), this.Xd.tk(), y7()), b10 = J5(Ef(), H10()); + if (tc(a10.Oo)) { + var c10 = rka(this.N.zf), e10 = new Fc().Vd(a10.Oo); + Dg(b10, oy(c10, e10.Sb.Ye().Dd(), this.Xd.Ve(), this.Ka)); + } + tc(a10.Ko) && (c10 = new Fc().Vd(a10.Ko), Dg(b10, new i62().jE("resourceTypes", c10.Sb.Ye().Dd(), this.Ka, this.Xd.Ve(), this.N))); + tc(a10.Ro) && (c10 = new Fc().Vd(a10.Ro), Dg(b10, new i62().jE("traits", c10.Sb.Ye().Dd(), this.Ka, this.Xd.Ve(), this.N))); + if (tc(a10.Pp)) { + e10 = new Fc().Vd(a10.Pp); + c10 = new l62(); + e10 = e10.Sb.Ye().Dd(); + var f10 = this.Xd.Ve(), g10 = this.Ka, h10 = this.N.zf.Dba(); + c10.Dv = e10; + c10.Q = f10; + c10.p = g10; + c10.pP = h10; + Dg(b10, c10); + } + tc(a10.Np) && (c10 = fh(new je4().e("responses")), a10 = new Fc().Vd(a10.Np).Sb.Ye().Dd(), e10 = this.Ka, f10 = this.Xd.Ve(), g10 = this.N, Dg(b10, new k6().VO(c10, a10, e10, f10, new YV().Ti(g10.Bc, g10.oy, new Yf().a())))); + return b10; + }; + d7.$classData = r8({ wVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml08RootLevelEmitters", { wVa: 1, bWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function FW() { + this.Ka = this.Xd = this.N = null; + } + FW.prototype = new Jna(); + FW.prototype.constructor = FW; + d7 = FW.prototype; + d7.DO = function(a10, b10, c10) { + this.Xd = a10; + this.Ka = b10; + TA.prototype.DO.call(this, a10, b10, c10); + return this; + }; + d7.H = function() { + return "Raml10RootLevelEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof FW) { + var b10 = this.Xd, c10 = a10.Xd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xd; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.O9(), b10 = Ina(this.Xd, this.Ka); + var c10 = hd(this.Xd.Y(), wB().mc); + if (c10.b()) + var e10 = y7(); + else { + e10 = c10.c(); + c10 = e10.r.r.t(); + e10 = kr(wr(), e10.r.x, q5(jd)); + var f10 = Q5().Na; + e10 = new z7().d(cx(new dx(), "extends", c10, f10, e10)); + } + c10 = hd(this.Xd.Y(), Bq().ae); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d($g(new ah(), "usage", c10, y7()))); + e10 = e10.ua(); + f10 = K7(); + a10 = a10.ia(e10, f10.u); + c10 = c10.ua(); + e10 = K7(); + a10 = a10.ia(c10, e10.u); + c10 = K7(); + return a10.yg(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.O9 = function() { + var a10 = ula(wla(), this.Xd.tk(), y7()), b10 = J5(Ef(), H10()); + if (tc(a10.Oo)) { + var c10 = rka(this.N.zf), e10 = new Fc().Vd(a10.Oo); + Dg(b10, oy(c10, e10.Sb.Ye().Dd(), this.Xd.Ve(), this.Ka)); + } + if (tc(a10.x)) { + e10 = new Fc().Vd(a10.x); + c10 = new oeb(); + e10 = e10.Sb.Ye().Dd(); + var f10 = this.Xd.Ve(), g10 = this.Ka; + c10.lg = e10; + c10.Q = f10; + c10.p = g10; + if (null === this) + throw mb(E6(), null); + c10.l = this; + Dg(b10, c10); + } + tc(a10.Ko) && (c10 = new Fc().Vd(a10.Ko), Dg(b10, new i62().jE("resourceTypes", c10.Sb.Ye().Dd(), this.Ka, this.Xd.Ve(), this.N))); + tc(a10.Ro) && (c10 = new Fc().Vd(a10.Ro), Dg(b10, new i62().jE( + "traits", + c10.Sb.Ye().Dd(), + this.Ka, + this.Xd.Ve(), + this.N + ))); + if (tc(a10.Pp)) { + e10 = new Fc().Vd(a10.Pp); + c10 = new l62(); + e10 = e10.Sb.Ye().Dd(); + f10 = this.Xd.Ve(); + g10 = this.Ka; + var h10 = this.N.zf.Dba(); + c10.Dv = e10; + c10.Q = f10; + c10.p = g10; + c10.pP = h10; + Dg(b10, c10); + } + e10 = new Fc().Vd(a10.Cs); + c10 = Xd().u; + c10 = se4(e10, c10); + for (e10 = e10.Sb.Ye(); e10.Ya(); ) + f10 = e10.$a(), c10.jd(Dz(Ez(), f10, y7())); + c10 = c10.Rc(); + f10 = new Fc().Vd(a10.Es); + e10 = Xd().u; + e10 = se4(f10, e10); + for (f10 = f10.Sb.Ye(); f10.Ya(); ) + g10 = f10.$a(), e10.jd(Sma(Ez(), g10, y7())); + e10 = e10.Rc(); + f10 = Xd(); + c10 = c10.ia(e10, f10.u); + if (c10.Da()) { + c10 = c10.ke(); + e10 = this.Ka; + f10 = this.Xd.Ve(); + g10 = fh(new je4().e("parameters")); + var k10 = this.N; + h10 = new j6(); + k10 = new YV().Ti( + k10.Bc, + k10.oy, + new Yf().a() + ); + h10.zu = c10; + h10.p = e10; + h10.Q = f10; + h10.la = g10; + h10.N = k10; + Dg(b10, h10); + } + tc(a10.Np) && (c10 = fh(new je4().e("responses")), a10 = new Fc().Vd(a10.Np).Sb.Ye().Dd(), e10 = this.Ka, f10 = this.Xd.Ve(), g10 = this.N, Dg(b10, new k6().VO(c10, a10, e10, f10, new YV().Ti(g10.Bc, g10.oy, new Yf().a())))); + return b10; + }; + d7.$classData = r8({ zVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml10RootLevelEmitters", { zVa: 1, bWa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function m62() { + GP.call(this); + this.ra = null; + } + m62.prototype = new N22(); + m62.prototype.constructor = m62; + function peb() { + } + peb.prototype = m62.prototype; + function qeb(a10, b10, c10) { + b10 = a10.uM(b10); + if (!b10.b()) { + var e10 = b10.c(), f10 = e10.i.hb().gb; + if (Q5().sa === f10) + b10 = e10.i, e10 = qc(), N6(b10, e10, a10.ra).sb.U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = l10.Aa, p10 = bc(); + m10 = N6(m10, p10, h10.ra).va; + if (zca(m10, false)) { + p10 = h10.ra; + var t10 = sg().bJ, v10 = "'" + m10 + "' cannot be used to name a custom type", A10 = l10.Aa, D10 = y7(); + ec(p10, t10, k10, D10, v10, A10.da); + } + m10 = PW(QW(), l10, w6(/* @__PURE__ */ function(C10, I10, L10, Y10) { + return function(ia) { + var pa = qf().R, La = ih(new jh(), I10, Od(O7(), L10.Aa.re())), ob = Od(O7(), L10.Aa); + Rg(ia, pa, La, ob); + return ia.ub(Y10, lt2()); + }; + }(h10, m10, l10, k10)), RW(false, false), QP(), h10.ra).Cc(); + if (m10 instanceof z7) + return m10 = m10.i, l10 = l10.i.hb().gb, p10 = Q5().nd, l10 === p10 && m10.fa().Lb(new Xz().a()), l10 = h10.ra.pe(), p10 = new Zh().a(), $h(l10, Cb(m10, p10)); + if (y7() === m10) + m10 = h10.ra, p10 = sg().i_, t10 = "Error parsing shape '" + l10 + "'", v10 = y7(), ec(m10, p10, k10, v10, t10, l10.da); + else + throw new x7().d(m10); + }; + }(a10, c10))); + else if (Q5().nd !== f10) { + a10 = a10.ra; + b10 = sg().sY; + f10 = "Invalid type " + f10 + " for 'types' node."; + e10 = e10.i; + var g10 = y7(); + ec(a10, b10, c10, g10, f10, e10.da); + } + } + } + d7 = m62.prototype; + d7.ss = function(a10) { + this.ra = a10; + GP.prototype.ss.call(this, a10); + return this; + }; + d7.f2 = function(a10, b10, c10) { + a10 = ac(new M6().W(b10), a10); + a10.b() || (a10 = a10.c().i, b10 = qc(), N6(a10, b10, this.ra).sb.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = new Qg().Vb(g10.Aa, e10.ra).Zf(), k10 = g10.i, l10 = qc(); + g10 = new Yz().Hw(N6(k10, l10, e10.ra), w6(/* @__PURE__ */ function(m10, p10, t10, v10) { + return function(A10) { + var D10 = Dm().R; + D10 = Vd(A10, D10, p10); + J5(K7(), H10()); + Ai(D10, t10); + A10.x.Sp(Od(O7(), v10)); + }; + }(e10, h10, f10, g10)), wz(uz(), e10.ra)).EH(); + h10 = new Zh().a(); + Cb(g10, h10); + return $h(e10.ra.pe(), g10); + }; + }(this, c10)))); + }; + d7.rA = function(a10, b10) { + var c10 = a10.da + "#/declarations"; + this.d2(b10, c10 + "/annotations"); + qeb(this, b10, c10 + "/types"); + Q2a(new C32(), "traits", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = gD(hD(), g10), k10 = g10.Aa, l10 = bc(); + k10 = N6(k10, l10, e10.ra).va; + O7(); + l10 = new P6().a(); + h10 = Sd(h10, k10, l10); + g10 = g10.Aa; + k10 = bc(); + g10 = N6(g10, k10, e10.ra).va; + g10 = new je4().e(g10); + return h10.pc(f10 + "/traits/" + jj(g10.td)); + }; + }(this, c10)), b10, c10 + "/traits", this.ra).hd(); + Q2a(new C32(), "resourceTypes", w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = dD(eD(), g10), k10 = g10.Aa, l10 = bc(); + k10 = N6(k10, l10, e10.ra).va; + O7(); + l10 = new P6().a(); + h10 = Sd(h10, k10, l10); + g10 = g10.Aa; + k10 = bc(); + g10 = N6(g10, k10, e10.ra).va; + g10 = new je4().e(g10); + return h10.pc(f10 + "/resourceTypes/" + jj(g10.td)); + }; + }(this, c10)), b10, c10 + "/resourceTypes", this.ra).hd(); + this.zH(b10, c10 + "/securitySchemes"); + reb(this, fh(new je4().e("parameters")), b10, a10.da + "#/parameters"); + this.f2(fh(new je4().e("responses")), b10, a10.da + "#/responses"); + }; + function reb(a10, b10, c10, e10) { + b10 = ac(new M6().W(c10), b10); + b10.b() || (b10 = b10.c().i, c10 = qc(), N6(b10, c10, a10.ra).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = new Nd().a(), m10 = h10.i, p10 = qc(); + if (Iw(m10, p10) instanceof ye4) + h10 = new n62().YO((ue4(), new ve4().d(h10)), g10, new z7().d(k10), l10, wz(uz(), f10.ra)).OL(); + else { + ue4(); + T6(); + m10 = ur().ce; + T6(); + m10 = mr(T6(), m10, Q5().sa); + k10 = new n62().YO(new ye4().d(m10), g10, new z7().d(k10), l10, wz(uz(), f10.ra)).OL(); + l10 = f10.ra; + m10 = sg().oY; + p10 = k10.yr.j; + var t10 = y7(); + ec(l10, m10, p10, t10, "Map needed to parse a parameter declaration", h10.da); + h10 = k10; + } + bFa(f10.ra.pe(), h10); + }; + }(a10, e10)))); + } + d7.uM = function(a10) { + var b10 = ac(new M6().W(a10), "types"); + a10 = ac(new M6().W(a10), "schemas"); + if (!b10.b() && (b10.c(), !a10.b())) { + var c10 = a10.c(), e10 = this.ra, f10 = sg().N5; + c10 = c10.Aa; + var g10 = y7(); + ec(e10, f10, "", g10, "'schemas' and 'types' properties are mutually exclusive", c10.da); + } + a10.b() || (c10 = a10.c(), e10 = this.ra, f10 = sg().WZ, c10 = c10.Aa, g10 = y7(), nM(e10, f10, "", g10, "'schemas' keyword it's deprecated for 1.0 version, should use 'types' instead", c10.da)); + return b10.b() ? a10 : b10; + }; + d7.d2 = function(a10, b10) { + a10 = ac(new M6().W(a10), "annotationTypes"); + if (!a10.b()) { + var c10 = a10.c(), e10 = c10.i.hb().gb; + if (Q5().sa === e10) { + a10 = c10.i; + var f10 = qc(); + a10 = N6(a10, f10, this.ra).sb; + b10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = l10.Aa, p10 = bc(); + m10 = N6(m10, p10, h10.ra).va; + l10 = OYa(h10).h9(l10, w6(/* @__PURE__ */ function(t10, v10, A10, D10) { + return function(C10) { + var I10 = Sk().R, L10 = ih(new jh(), v10, Od(O7(), A10.Aa.re())), Y10 = Od(O7(), A10.Aa); + Rg(C10, I10, L10, Y10); + l6a(C10, D10, J5(K7(), H10())); + }; + }(h10, m10, l10, k10))); + m10 = h10.ra.pe(); + p10 = new Zh().a(); + return $h(m10, Cb(l10, p10)); + }; + }(this, b10)); + f10 = rw(); + a10.ka(b10, f10.sc); + } else if (Q5().nd !== e10) { + a10 = this.ra; + f10 = sg().aN; + e10 = "Invalid type " + e10 + " for 'annotationTypes' node."; + c10 = c10.i; + var g10 = y7(); + ec(a10, f10, b10, g10, e10, c10.da); + } + } + }; + function MA() { + this.l = this.Xg = this.p = this.Ri = null; + } + MA.prototype = new u7(); + MA.prototype.constructor = MA; + d7 = MA.prototype; + d7.H = function() { + return "AnnotationFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof MA && a10.l === this.l) { + var b10 = this.Ri, c10 = a10.Ri; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ri; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + var a10 = this.l.N.zf.MN().ug(ar(this.Ri.g, Jk().nb), this.p).vT(); + if (a10 instanceof ve4) + return a10.i; + if (a10 instanceof ye4) { + var b10 = a10.i; + a10 = K7(); + b10 = [ky("type", b10, Q5().Na, ld())]; + return J5(a10, new Ib().ha(b10)); + } + throw new x7().d(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ JVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$AnnotationFragmentEmitter", { JVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function wA() { + this.l = this.Xg = this.p = this.hs = null; + } + wA.prototype = new u7(); + wA.prototype.constructor = wA; + d7 = wA.prototype; + d7.H = function() { + return "DataTypeFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wA && a10.l === this.l) { + var b10 = this.hs, c10 = a10.hs; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hs; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + var a10 = false, b10 = null, c10 = Vb().Ia(ar(this.hs.g, Jk().nb)); + if (c10 instanceof z7 && (a10 = true, b10 = c10, c10 = b10.i, c10 instanceof vh)) { + a10 = this.p; + b10 = H10(); + var e10 = H10(); + return Q32(c10, a10, e10, b10, this.l.N).zw(); + } + if (a10) { + var f10 = b10.i; + c10 = this.l.N.Bc; + a10 = dc().Fh; + b10 = f10.j; + e10 = y7(); + var g10 = Ab(f10.fa(), q5(jd)); + f10 = f10.Ib(); + c10.Gc(a10.j, b10, e10, "Cannot emit non WebApi Shape", g10, Yb().qb, f10); + } + return H10(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ KVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$DataTypeFragmentEmitter", { KVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function vA() { + this.l = this.Xg = this.p = this.jv = null; + } + vA.prototype = new u7(); + vA.prototype.constructor = vA; + d7 = vA.prototype; + d7.H = function() { + return "DocumentationItemFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vA && a10.l === this.l) { + var b10 = this.jv, c10 = a10.jv; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jv; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + return new R32().lU(ar(this.jv.g, Jk().nb), this.p, true, this.l.N).Pa(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ LVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$DocumentationItemFragmentEmitter", { LVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function xA() { + this.l = this.Xg = this.p = this.Kd = null; + } + xA.prototype = new u7(); + xA.prototype.constructor = xA; + d7 = xA.prototype; + d7.H = function() { + return "FragmentNamedExampleEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xA && a10.l === this.l) { + var b10 = this.Kd, c10 = a10.Kd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kd; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + var a10 = K7(), b10 = [new E42().bA(ar(this.Kd.g, Jk().nb), this.p, this.l.N)]; + return J5(a10, new Ib().ha(b10)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ MVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$FragmentNamedExampleEmitter", { MVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function yA() { + this.l = this.Xg = this.Bc = this.p = this.vg = null; + } + yA.prototype = new u7(); + yA.prototype.constructor = yA; + d7 = yA.prototype; + d7.H = function() { + return "ResourceTypeFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof yA && a10.l === this.l) { + var b10 = this.vg, c10 = a10.vg; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vg; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + var a10 = iy(new jy(), ar(this.vg.g, Jk().nb).Nz(), this.p, false, Rb(Ut(), H10()), this.Bc).Pa(); + var b10 = new o62(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$ResourceTypeFragmentEmitter", { NVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function o62() { + } + o62.prototype = new y_(); + o62.prototype.constructor = o62; + o62.prototype.PJ = function(a10) { + if (null !== a10) + return a10; + throw mb(E6(), new nb().e("Fragment not encoding DataObjectNode but " + a10)); + }; + o62.prototype.Sa = function() { + return true; + }; + o62.prototype.Wa = function(a10) { + return this.PJ(a10); + }; + o62.prototype.$classData = r8({ OVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$ResourceTypeFragmentEmitter$$anonfun$emitters$1", { OVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function NA() { + this.l = this.Xg = this.p = this.Qf = null; + } + NA.prototype = new u7(); + NA.prototype.constructor = NA; + d7 = NA.prototype; + d7.H = function() { + return "SecuritySchemeFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NA && a10.l === this.l) { + var b10 = this.Qf, c10 = a10.Qf; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Qf; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function(a10) { + return new f62().cA(ar(this.Qf.g, Jk().nb), a10, this.p, this.l.N).Pa(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ PVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$SecuritySchemeFragmentEmitter", { PVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function zA() { + this.l = this.Xg = this.Bc = this.p = this.vg = null; + } + zA.prototype = new u7(); + zA.prototype.constructor = zA; + d7 = zA.prototype; + d7.H = function() { + return "TraitFragmentEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zA && a10.l === this.l) { + var b10 = this.vg, c10 = a10.vg; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vg; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jK = function() { + var a10 = iy(new jy(), ar(this.vg.g, Jk().nb).Nz(), this.p, false, Rb(Ut(), H10()), this.Bc).Pa(); + var b10 = new p62(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$TraitFragmentEmitter", { QVa: 1, f: 1, lN: 1, y: 1, v: 1, q: 1, o: 1 }); + function p62() { + } + p62.prototype = new y_(); + p62.prototype.constructor = p62; + p62.prototype.PJ = function(a10) { + if (null !== a10) + return a10; + throw mb(E6(), new nb().e("Fragment not encoding DataObjectNode but " + a10)); + }; + p62.prototype.Sa = function() { + return true; + }; + p62.prototype.Wa = function(a10) { + return this.PJ(a10); + }; + p62.prototype.$classData = r8({ RVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentEmitter$TraitFragmentEmitter$$anonfun$emitters$2", { RVa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function seb() { + } + seb.prototype = new y_(); + seb.prototype.constructor = seb; + d7 = seb.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof bg ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof bg; + }; + d7.$classData = r8({ kWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ReferencesEmitter$$anonfun$1", { kWa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function teb() { + } + teb.prototype = new y_(); + teb.prototype.constructor = teb; + d7 = teb.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ lWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ReferencesEmitter$$anonfun$2", { lWa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function ueb() { + } + ueb.prototype = new y_(); + ueb.prototype.constructor = ueb; + d7 = ueb.prototype; + d7.eg = function(a10) { + return a10 instanceof cn; + }; + d7.$f = function(a10, b10) { + return a10 instanceof cn ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ nWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.UserDocumentationsEmitter$$anonfun$$nestedInanonfun$emit$31$1", { nWa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function BY() { + this.Fa = null; + } + BY.prototype = new y_(); + BY.prototype.constructor = BY; + BY.prototype.qaa = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + return this; + }; + BY.prototype.Sa = function(a10) { + return a10 instanceof J42 && a10.l === this.Fa; + }; + BY.prototype.Wa = function(a10, b10) { + return a10 instanceof J42 && a10.l === this.Fa ? a10 : b10.P(a10); + }; + BY.prototype.$classData = r8({ $Wa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$$anonfun$$nestedInanonfun$convert$3$1", { $Wa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Wna() { + } + Wna.prototype = new y_(); + Wna.prototype.constructor = Wna; + d7 = Wna.prototype; + d7.wk = function(a10) { + return a10 instanceof Es; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Es ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ cXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$ElementTreeBuilder$$anonfun$1", { cXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function veb() { + oB.call(this); + this.A2 = this.uk = null; + } + veb.prototype = new Una(); + veb.prototype.constructor = veb; + d7 = veb.prototype; + d7.H = function() { + return "EndPointTreeBuilder"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof veb && a10.l === this.l) { + var b10 = this.uk; + a10 = a10.uk; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fja = function() { + var a10 = OA(), b10 = new PA().e(a10.pi), c10 = new qg().e(a10.mi); + tc(c10) && QA(b10, a10.mi); + c10 = this.uk; + var e10 = tD(), f10 = J5(Ef(), H10()), g10 = J5(K7(), H10()); + c10 = new CW().i1(c10, e10, f10, g10, new JW().Ti(this.l.ob, WO(), new Yf().a())); + e10 = b10.s; + f10 = b10.ca; + g10 = new rr().e(f10); + c10.Qa(g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + a10 = new RA().Ac(SA(zs(), a10.pi), b10.s).Fd; + a10 = jc(kc(a10), qc()); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.sb)); + a10 = (a10.b() ? H10() : a10.c()).kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.i)); + return a10.b() ? T6().nd : a10.c(); + }; + d7.z = function() { + return X5(this); + }; + function TQa(a10, b10) { + var c10 = new veb(); + c10.uk = b10; + oB.prototype.nla.call(c10, a10, b10); + a10 = B6(b10.g, Jl().Uf).A; + c10.A2 = a10.b() ? null : a10.c(); + return c10; + } + d7.$classData = r8({ dXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$EndPointTreeBuilder", { dXa: 1, bXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function web() { + oB.call(this); + this.A2 = this.Bs = null; + } + web.prototype = new Una(); + web.prototype.constructor = web; + d7 = web.prototype; + d7.H = function() { + return "OperationTreeBuilder"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof web && a10.l === this.l) { + var b10 = this.Bs; + a10 = a10.Bs; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fja = function() { + var a10 = OA(), b10 = new PA().e(a10.pi), c10 = new qg().e(a10.mi); + tc(c10) && QA(b10, a10.mi); + c10 = this.Bs; + var e10 = tD(), f10 = H10(); + c10 = new IW().XK(c10, e10, f10, new JW().Ti(this.l.ob, WO(), new Yf().a())); + e10 = b10.s; + f10 = b10.ca; + var g10 = new rr().e(f10); + c10.Qa(g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + a10 = new RA().Ac(SA(zs(), a10.pi), b10.s).Fd; + b10 = qc(); + a10 = N6(a10, b10, this.l.ob).sb.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.i)); + return a10.b() ? T6().nd : a10.c(); + }; + d7.z = function() { + return X5(this); + }; + function XQa(a10, b10) { + var c10 = new web(); + c10.Bs = b10; + oB.prototype.nla.call(c10, a10, b10); + a10 = B6(b10.g, Pl().pm).A; + c10.A2 = a10.b() ? null : a10.c(); + return c10; + } + d7.$classData = r8({ eXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$OperationTreeBuilder", { eXa: 1, bXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function J42() { + this.l = this.Xf = this.Kl = this.la = null; + } + J42.prototype = new u7(); + J42.prototype.constructor = J42; + d7 = J42.prototype; + d7.H = function() { + return "TraitBranch"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof J42 && a10.l === this.l) { + var b10 = this.la, c10 = a10.la; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Kl, c10 = a10.Kl, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Xf, a10 = a10.Xf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Kl; + case 2: + return this.Xf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function x7a(a10, b10, c10, e10, f10) { + a10.la = c10; + a10.Kl = e10; + a10.Xf = f10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.$classData = r8({ fXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtendsResolutionStage$TraitBranch", { fXa: 1, f: 1, bhb: 1, y: 1, v: 1, q: 1, o: 1 }); + function foa() { + } + foa.prototype = new y_(); + foa.prototype.constructor = foa; + d7 = foa.prototype; + d7.eg = function(a10) { + return Rk(a10); + }; + d7.$f = function(a10, b10) { + return Rk(a10) ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ iXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtensionLikeResolutionStage$$anonfun$$nestedInanonfun$adoptIris$1$1", { iXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function hoa() { + } + hoa.prototype = new y_(); + hoa.prototype.constructor = hoa; + d7 = hoa.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof bg ? a10 : Kk(a10) ? a10 : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof bg || Kk(a10); + }; + d7.$classData = r8({ jXa: 0 }, false, "amf.plugins.document.webapi.resolution.stages.ExtensionLikeResolutionStage$$anonfun$1", { jXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function c8a() { + qC.call(this); + } + c8a.prototype = new J7a(); + c8a.prototype.constructor = c8a; + c8a.prototype.a = function() { + qC.prototype.ts.call(this, H10()); + return this; + }; + c8a.prototype.$classData = r8({ AXa: 0 }, false, "amf.plugins.document.webapi.validation.EmptyResultContainer$", { AXa: 1, xha: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var b8a = void 0; + function Ioa() { + } + Ioa.prototype = new y_(); + Ioa.prototype.constructor = Ioa; + d7 = Ioa.prototype; + d7.eg = function(a10) { + if (a10 instanceof Td) { + var b10 = Vb().Ia(B6(a10.g, Ud().ig)); + if (b10.b()) + b10 = false; + else { + var c10 = b10.c(); + Vb().Ia(B6(c10.g, Sk().Jc)).na() ? (b10 = Px(), c10 = B6(c10.g, Sk().R).A, b10 = Lla(b10, "(" + (c10.b() ? null : c10.c()) + ")").na()) : b10 = false; + } + if (b10) + return true; + } + return a10 instanceof m32 && (Vb().Ia(B6(a10.g, Ot().ig)).na() ? (b10 = Vb(), c10 = B6(a10.g, Ot().ig), b10 = b10.Ia(B6(c10.aa, Qi().Vf)).na()) : b10 = false, b10) ? true : a10 instanceof jh && wh(a10.x, q5(xab)) ? true : false; + }; + d7.$f = function(a10, b10) { + if (a10 instanceof Td) { + var c10 = Vb().Ia(B6(a10.g, Ud().ig)); + if (c10.b()) + c10 = false; + else { + var e10 = c10.c(); + Vb().Ia(B6(e10.g, Sk().Jc)).na() ? (c10 = Px(), e10 = B6(e10.g, Sk().R).A, c10 = Lla(c10, "(" + (e10.b() ? null : e10.c()) + ")").na()) : c10 = false; + } + if (c10) + return J5(K7(), new Ib().ha([a10])); + } + return a10 instanceof m32 && (Vb().Ia(B6(a10.g, Ot().ig)).na() ? (c10 = Vb(), e10 = B6(a10.g, Ot().ig), c10 = c10.Ia(B6(e10.aa, Qi().Vf)).na()) : c10 = false, c10) ? J5(K7(), new Ib().ha([a10])) : a10 instanceof jh && wh(a10.x, q5(xab)) ? (b10 = new xeb(), a10 = a10.x.hf, c10 = Ef().u, xs(a10, b10, c10)) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ EXa: 0 }, false, "amf.plugins.document.webapi.validation.ExtensionsCandidatesCollector$$anonfun$findExtensionsWithTypes$1", { EXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function xeb() { + } + xeb.prototype = new y_(); + xeb.prototype.constructor = xeb; + d7 = xeb.prototype; + d7.dn = function(a10, b10) { + return a10 instanceof NM ? a10.cp : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof NM; + }; + d7.$classData = r8({ FXa: 0 }, false, "amf.plugins.document.webapi.validation.ExtensionsCandidatesCollector$$anonfun$findExtensionsWithTypes$1$$anonfun$applyOrElse$2", { FXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function yeb() { + lv.call(this); + } + yeb.prototype = new ija(); + yeb.prototype.constructor = yeb; + d7 = yeb.prototype; + d7.a = function() { + lv.prototype.a.call(this); + return this; + }; + d7.H = function() { + return "FilterDataNodeOptions"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof yeb && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ GXa: 0 }, false, "amf.plugins.document.webapi.validation.FilterDataNodeOptions", { GXa: 1, Rga: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function q6() { + this.Fa = null; + } + q6.prototype = new y_(); + q6.prototype.constructor = q6; + function Poa(a10) { + var b10 = new q6(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + return b10; + } + q6.prototype.Sa = function(a10) { + a: { + if (null !== a10) { + var b10 = a10.g, c10 = ag().mo; + b10.vb.Ha(c10) ? (b10 = B6(a10.g, ag().Fq).A, b10 = !(!b10.b() && !b10.c())) : b10 = false; + if (b10) { + a10 = true; + break a; + } + } + if (null !== a10 && (b10 = a10.g, c10 = ag().Rd, b10.vb.Ha(c10) ? (a10 = B6(a10.g, ag().Fq).A, a10 = !(!a10.b() && !a10.c())) : a10 = false, a10)) { + a10 = true; + break a; + } + a10 = false; + } + return a10; + }; + q6.prototype.Wa = function(a10, b10) { + a: { + if (null !== a10) { + var c10 = a10.g, e10 = ag().mo; + c10.vb.Ha(e10) ? (c10 = B6(a10.g, ag().Fq).A, c10 = !(!c10.b() && !c10.c())) : c10 = false; + if (c10) { + b10 = this.Fa; + c10 = B6(a10.g, ag().mo); + e10 = a10.j; + var f10 = B6(a10.g, Zf().Rd).A; + a10 = Moa(new eC(), b10, c10, e10, f10.b() ? null : f10.c(), a10.x); + break a; + } + } + if (null !== a10 && (c10 = a10.g, e10 = ag().Rd, c10.vb.Ha(e10) ? (c10 = B6(a10.g, ag().Fq).A, c10 = !(!c10.b() && !c10.c())) : c10 = false, c10)) { + b10 = this.Fa; + c10 = a10.j; + e10 = B6(a10.g, Zf().Rd).A; + a10 = new fC().KO(b10, c10, e10.b() ? null : e10.c(), a10.x); + break a; + } + a10 = b10.P(a10); + } + return a10; + }; + q6.prototype.$classData = r8({ OXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadsInApiCollector$$anonfun$1", { OXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function eC() { + jC.call(this); + this.eT = null; + } + eC.prototype = new Voa(); + eC.prototype.constructor = eC; + d7 = eC.prototype; + d7.H = function() { + return "DataNodeCollectedElement"; + }; + d7.E = function() { + return 4; + }; + function Moa(a10, b10, c10, e10, f10, g10) { + a10.eT = c10; + jC.prototype.KO.call(a10, b10, e10, f10, g10); + return a10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof eC && a10.l === this.l ? this.eT === a10.eT && this.j === a10.j && this.xe === a10.xe ? this.ZF === a10.ZF : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.eT; + case 1: + return this.j; + case 2: + return this.xe; + case 3: + return this.ZF; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadsInApiCollector$DataNodeCollectedElement", { QXa: 1, PXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function fC() { + jC.call(this); + } + fC.prototype = new Voa(); + fC.prototype.constructor = fC; + d7 = fC.prototype; + d7.KO = function(a10, b10, c10, e10) { + jC.prototype.KO.call(this, a10, b10, c10, e10); + return this; + }; + d7.H = function() { + return "StringCollectedElement"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof fC && a10.l === this.l ? this.j === a10.j && this.xe === a10.xe ? this.ZF === a10.ZF : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.j; + case 1: + return this.xe; + case 2: + return this.ZF; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ RXa: 0 }, false, "amf.plugins.document.webapi.validation.PayloadsInApiCollector$StringCollectedElement", { RXa: 1, PXa: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function zeb() { + this.Eea = null; + } + zeb.prototype = new y_(); + zeb.prototype.constructor = zeb; + d7 = zeb.prototype; + d7.eg = function(a10) { + return Rk(a10) && c_a(sO(a10)).Od(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return b10.Eea.Ha(c10); + }; + }(this))) ? true : false; + }; + d7.$f = function(a10, b10) { + return Rk(a10) && c_a(sO(a10)).Od(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.Eea.Ha(e10); + }; + }(this))) ? a10 : b10.P(a10); + }; + function Yoa(a10) { + var b10 = new zeb(); + b10.Eea = a10; + return b10; + } + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ UXa: 0 }, false, "amf.plugins.document.webapi.validation.ShapeFacetsCandidatesCollector$$anonfun$1", { UXa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function oIa() { + } + oIa.prototype = new y_(); + oIa.prototype.constructor = oIa; + d7 = oIa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.mU = function() { + return this; + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ QZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.MinShapeAlgorithm$$anonfun$1", { QZa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function tIa() { + } + tIa.prototype = new y_(); + tIa.prototype.constructor = tIa; + d7 = tIa.prototype; + d7.Ee = function(a10, b10) { + return a10 instanceof z7 ? a10.i : b10.P(a10); + }; + d7.mU = function() { + return this; + }; + d7.Sa = function(a10) { + return this.He(a10); + }; + d7.Wa = function(a10, b10) { + return this.Ee(a10, b10); + }; + d7.He = function(a10) { + return a10 instanceof z7; + }; + d7.$classData = r8({ RZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.MinShapeAlgorithm$$anonfun$2", { RZa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function eda() { + } + eda.prototype = new y_(); + eda.prototype.constructor = eda; + d7 = eda.prototype; + d7.eg = function(a10) { + return a10 instanceof Vi; + }; + d7.$f = function(a10, b10) { + return a10 instanceof Vi ? (a10 = B6(a10.aa, Wi().vf).A, a10.b() ? null : a10.c()) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.eg(a10); + }; + d7.Wa = function(a10, b10) { + return this.$f(a10, b10); + }; + d7.$classData = r8({ VZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.RestrictionComputation$$anonfun$1", { VZa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function sZ() { + this.xf = null; + this.DM = false; + } + sZ.prototype = new u7(); + sZ.prototype.constructor = sZ; + d7 = sZ.prototype; + d7.nU = function(a10) { + this.xf = a10; + this.DM = false; + return this; + }; + function Aeb(a10, b10) { + r62(a10, b10); + if (B6(b10.aa, qf().xd).Da()) + return s62(a10, b10); + var c10 = K7(), e10 = [J5(K7(), H10())]; + c10 = J5(c10, new Ib().ha(e10)); + c10 = new qd().d(c10); + e10 = B6(b10.aa, an().$p); + var f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + k10 = bj(h10, k10); + if (null !== k10) + return J5(K7(), new Ib().ha([k10])); + throw new x7().d(k10); + }; + }(a10)), g10 = K7(); + e10.ka(f10, g10.u).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10.U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = p10.oa; + t10 = w6(/* @__PURE__ */ function(D10, C10) { + return function(I10) { + var L10 = J5(K7(), new Ib().ha([C10])), Y10 = K7(); + return I10.ia(L10, Y10.u); + }; + }(m10, t10)); + var A10 = K7(); + p10.oa = v10.ka(t10, A10.u); + }; + }(h10, k10))); + }; + }( + a10, + c10 + ))); + if (1 === c10.oa.Oa()) + return a10 = b10.aa, e10 = an().$p, c10 = Zr(new $r(), c10.oa.ga(), new P6().a()), f10 = Vb().Ia(Ti(b10.aa, an().$p)), f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.x)), Ui(a10, e10, c10, f10.b() ? (O7(), new P6().a()) : f10.c()), b10; + c10 = c10.oa; + a10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = new z7().d(h10.xf.ob), p10 = y7(), t10 = new HM().a(); + m10 = Rca(k10, m10, p10, t10, false).aa; + p10 = an().Ff; + l10 = Zr(new $r(), l10, new P6().a()); + t10 = Vb().Ia(Ti(k10.aa, an().Ff)); + t10.b() ? t10 = y7() : (t10 = t10.c(), t10 = new z7().d(t10.x)); + return Ui(m10, p10, l10, t10.b() ? (O7(), new P6().a()) : t10.c()); + }; + }(a10, b10)); + e10 = K7(); + c10.ka(a10, e10.u); + O7(); + a10 = new P6().a(); + a10 = new Vh().K( + new S6().a(), + a10 + ); + a10.j = b10.j + "resolved"; + b10 = B6(b10.aa, qf().R).A; + b10 = b10.b() ? null : b10.c(); + O7(); + c10 = new P6().a(); + Sd(a10, b10, c10); + return a10; + } + d7.H = function() { + return "ShapeCanonizer"; + }; + d7.E = function() { + return 0; + }; + function s62(a10, b10) { + if (Beb(a10, b10)) { + var c10 = B6(b10.Y(), qf().xd).ga(); + Ceb(a10, b10, c10); + wh(b10.fa(), q5(nN)) && (b10 = new Kz().a(), Cb(c10, b10)); + c10 instanceof zi || c10.fa().Lb(new bv().a()); + return bj(a10, c10); + } + c10 = B6(b10.Y(), qf().xd); + if (a10.xf.pn) { + var e10 = B6(b10.Y(), qf().xd), f10 = new Deb(), g10 = K7(); + f10 = e10.ec(f10, g10.u); + } else + f10 = H10(); + it2(b10.Y(), qf().xd); + e10 = Eeb(a10, b10); + e10 = new qd().d(e10); + g10 = H10(); + var h10 = new qd().d(g10); + g10 = H10(); + g10 = new qd().d(g10); + c10.U(w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + D10 = bj(p10, D10); + if (D10 instanceof Hh && B6(D10.aa, Ih().Us).A.na()) { + var C10 = t10.oa, I10 = J5(K7(), new Ib().ha([D10])), L10 = K7(); + t10.oa = C10.ia(I10, L10.u); + } + if (Kca(D10)) { + C10 = v10.oa; + I10 = J5(K7(), new Ib().ha([D10.j])); + L10 = D10.XT; + var Y10 = K7(); + I10 = I10.ia(L10, Y10.u); + L10 = K7(); + v10.oa = C10.ia(I10, L10.u); + } else + C10 = v10.oa, I10 = D10.j, L10 = K7(), v10.oa = C10.yg(I10, L10.u); + D10 = QC(p10.xf, A10.oa, D10); + p10.DM = true; + D10 = p10.Oba(D10); + p10.DM = false; + A10.oa = D10; + }; + }(a10, h10, g10, e10))); + if (a10.xf.pn) { + var k10 = e10.oa.fa(), l10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return p10.j; + }; + }(a10)), m10 = K7(); + k10.Lb(new R1().ts(f10.ka(l10, m10.u))); + } + b10.j !== e10.oa.j && (p8a(a10.xf.Wg, b10.j, e10.oa.j), Rd(e10.oa, b10.j)); + f10 = e10.oa; + f10 instanceof vh && h10.oa.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + Jca(v10, t10); + Ica(t10, v10); + }; + }(a10, f10))); + f10 = e10.oa; + Kca(f10) && (h10 = f10.XT, g10 = g10.oa, k10 = oi(), f10.XT = h10.ia(g10, k10.u)); + b10 instanceof Hh && Feb(b10, c10) && Ceb(a10, e10.oa, c10.ga()); + return e10.oa; + } + d7.h = function(a10) { + return a10 instanceof sZ && true; + }; + d7.Oba = function(a10) { + var b10 = a10.fa(), c10 = b10.hf; + Ef(); + var e10 = Jf(new Kf(), new Lf().a()); + for (c10 = c10.Dc; !c10.b(); ) { + var f10 = c10.ga(); + false !== !!(f10 && f10.$classData && f10.$classData.ge.Vm) && Of(e10, f10); + c10 = c10.ta(); + } + b10.hf = e10.eb; + if (a10 instanceof Vh) + a10 = Geb(this, a10); + else if (a10 instanceof Mh) + r62(this, a10), a10 = Vb().Ia(B6(a10.aa, qf().xd)).na() && B6(a10.aa, qf().xd).Da() ? s62(this, a10) : a10; + else if (a10 instanceof th) + r62(this, a10), B6(a10.aa, qf().xd).Da() ? a10 = s62(this, a10) : (b10 = Vb().Ia(B6(a10.aa, uh().Ff)), b10.b() || (b10 = b10.c(), b10 = bj(this, b10), a10.Xa.Lb(new xi().a()), it2(a10.aa, uh().Ff), a10 = b10 instanceof th ? (Ui( + a10.aa, + uh().Ff, + b10, + (O7(), new P6().a()) + ), YA(a10)) : (Ui(a10.aa, uh().Ff, b10, (O7(), new P6().a())), a10))); + else if (a10 instanceof pi) + a10 = Heb(this, a10); + else if (a10 instanceof qi) + a10 = Aeb(this, a10); + else if (a10 instanceof Vk) + b10 = a10.aa, e10 = Qi().Vf, c10 = B6(a10.aa, Qi().Vf), Ui(b10, e10, bj(this, c10), Ti(a10.aa, Qi().Vf).x); + else if (a10 instanceof Wh) + a10 = Ieb(this, a10); + else if (a10 instanceof Th) + a10 = Ieb(this, a10); + else if (a10 instanceof Hh) + a10 = Jeb(this, a10); + else if (!(a10 instanceof zi)) { + if (!(a10 instanceof vh)) + throw new x7().d(a10); + r62(this, a10); + B6(a10.Y(), qf().xd).Da() ? a10 = s62(this, a10) : (dSa || (dSa = new qZ().a()), a10 = new k8a().Gw(a10), l8a(a10, Ih().Po) ? (a10 = OC(a10, a10.ek), b10 = new Hh().K(a10.ek.Y(), a10.ek.fa()), a10 = Rd(b10, a10.ek.j)) : l8a(a10, uh().Po) ? a10 = OC(a10, a10.ek).dI() : l8a(a10, gn().Po) ? (a10 = OC(a10, a10.ek), b10 = new Wh().K(a10.ek.Y(), a10.ek.fa()), a10 = Rd(b10, a10.ek.j)) : l8a(a10, Fg().Po) ? (a10 = OC(a10, a10.ek), b10 = new Mh().K(a10.ek.Y(), a10.ek.fa()), a10 = Rd(b10, a10.ek.j)) : l8a(a10, pn().Po) ? (a10 = OC(a10, a10.ek), b10 = new Gh().K(a10.ek.Y(), a10.ek.fa()), a10 = Rd(b10, a10.ek.j)) : l8a(a10, xn().Po) ? (a10 = OC(a10, a10.ek), b10 = new Vh().K(a10.ek.Y(), a10.ek.fa()), a10 = Rd(b10, a10.ek.j)) : a10 = a10.ek); + } + this.DM || (b10 = this.xf.Wg, e10 = a10, e10 instanceof zi && n8a(b10, e10), b10.Wg.Ue(e10.j, e10)); + o8a(this.xf.Wg, a10, this.DM); + return a10; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function Eeb(a10, b10) { + a10.DM = true; + b10 = bj(a10, b10); + a10.DM = false; + return b10; + } + function Heb(a10, b10) { + r62(a10, b10); + if (B6(b10.aa, qf().xd).Da()) + return s62(a10, b10); + var c10 = Vb().Ia(B6(b10.aa, uh().Ff)); + if (c10 instanceof z7) { + c10 = bj(a10, c10.i); + it2(b10.aa, uh().Ff); + if (c10 instanceof Vh) { + var e10 = B6(c10.aa, xn().Le); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (k10 instanceof th) { + var l10 = new z7().d(g10.xf.ob), m10 = y7(), p10 = new HM().a(); + l10 = Rca(h10, l10, m10, p10, false); + m10 = uh().Ff; + return Vd(l10, m10, k10); + } + l10 = new z7().d(g10.xf.ob); + m10 = y7(); + p10 = new HM().a(); + return ZA(Rca(h10, l10, m10, p10, false).dI(), k10); + }; + }(a10, b10)); + var f10 = K7(); + e10 = e10.ka(a10, f10.u); + a10 = xn().Le; + Bf(c10, a10, e10); + b10 = Vb().Ia(Ti(b10.aa, qf().R)); + return b10 instanceof z7 ? (b10 = b10.i.r.t(), O7(), e10 = new P6().a(), Sd(c10, b10, e10)) : c10; + } + return c10 instanceof th ? (e10 = uh().Ff, Vd(b10, e10, c10)) : ZA(b10.dI(), c10); + } + return b10; + } + function Ceb(a10, b10, c10) { + if (b10 instanceof vh && c10 instanceof vh) { + if (wh(b10.fa(), q5(cv))) + var e10 = c10; + else + e10 = b10, b10 = c10; + Keb(a10, e10, b10); + e10 = J5(DB(), H10()); + 1 < B6(b10.Y(), Ag().Ec).jb() && B6(b10.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + if (B6(h10.g, ag().R).A.b()) + var k10 = true; + else + k10 = B6(h10.g, ag().R).A, k10 = g10.Ha(k10.b() ? null : k10.c()); + if (k10) { + k10 = 0; + for (var l10 = "example_" + k10; g10.Ha(l10); ) + k10 = 1 + k10 | 0, l10 = "example_" + k10; + g10.iz(l10); + k10 = l10; + O7(); + l10 = new P6().a(); + return Sd(h10, k10, l10); + } + h10 = B6(h10.g, ag().R).A; + return g10.iz(h10.b() ? null : h10.c()); + }; + }(a10, e10))); + } + } + function Beb(a10, b10) { + var c10 = false, e10 = null; + if (b10 instanceof vh && (c10 = true, e10 = b10, wh(e10.fa(), q5(cv)))) + return false; + if (c10 && 1 === B6(e10.Y(), qf().xd).jb()) { + c10 = B6(e10.Y(), qf().xd).ga(); + e10 = K7(); + var f10 = [qf().xd, Ag().Ec, Ag().R]; + e10 = J5(e10, new Ib().ha(f10)); + b10 = b10.Y().vb; + f10 = mz(); + f10 = Ua(f10); + var g10 = Id().u; + b10 = Jd(b10, f10, g10).Si(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.Ha(l10.Lc); + }; + }(a10, e10))); + return Leb(a10, b10, c10); + } + return false; + } + function Feb(a10, b10) { + return wh(a10.Xa, q5(cv)) && 1 === b10.jb() && B6(a10.aa, Ih().kh).b(); + } + function Geb(a10, b10) { + if (B6(b10.aa, qf().xd).Da()) + return s62(a10, b10); + var c10 = J5(Ef(), H10()); + B6(b10.aa, xn().Le).U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + h10 = Eeb(e10, h10); + if (h10 instanceof Vh) + yi(f10.fh, h10.fh), lIa(e10.xf.Wg, GN(h10.fh), f10), B6(h10.aa, xn().Le).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return Dg(t10, v10); + }; + }(e10, g10))); + else { + if (h10 instanceof zi) { + var k10 = h10.mn; + if (!k10.b()) { + k10 = k10.c(); + var l10 = f10.fh, m10 = J5(K7(), new Ib().ha([k10])).Cb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return v10.j !== t10.j; + }; + }(e10, f10))); + yi(l10, m10); + q8a(e10.xf.Wg, k10.j, f10); + } + return Dg(g10, h10); + } + if (null !== h10) + return lIa( + e10.xf.Wg, + GN(h10.fh), + f10 + ), yi(f10.fh, h10.fh), Dg(g10, h10); + throw new x7().d(h10); + } + }; + }(a10, b10, c10))); + a10 = Vb().Ia(Ti(b10.aa, xn().Le)); + a10 instanceof z7 ? a10 = a10.i.x : (O7(), a10 = new P6().a()); + Ui(b10.aa, xn().Le, Zr(new $r(), c10, new P6().a()), a10); + return b10; + } + function Meb(a10, b10) { + a10 = Ab(a10.x, q5(FC)); + if (!a10.b()) { + var c10 = a10.c(); + a10 = b10.x; + var e10 = Ab(b10.x, q5(FC)); + if (e10.b()) + c10 = new GC().hk(c10.Ds); + else { + e10 = e10.c(); + b10 = b10.x; + var f10 = b10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof GC) && Of(g10, h10); + f10 = f10.ta(); + } + b10.hf = g10.eb; + c10 = new GC().hk(e10.Ds.Lk(c10.Ds)); + } + a10.Lb(c10); + } + } + function r62(a10, b10) { + var c10 = Ti(b10.Y(), qf().fi); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.Y(), qf().fi), f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return bj(h10, k10); + }; + }(a10)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = qf().fi; + as(b10, f10, e10, c10.x); + } + c10 = Ti(b10.Y(), qf().ki); + Vb().Ia(c10).na() && (e10 = B6(b10.Y(), qf().ki), f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return bj(h10, k10); + }; + }(a10)), g10 = K7(), e10 = e10.ka(f10, g10.u), f10 = qf().ki, as(b10, f10, e10, c10.x)); + c10 = Ti(b10.Y(), qf().li); + Vb().Ia(c10).na() && (e10 = B6(b10.Y(), qf().li), f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return bj(h10, k10); + }; + }(a10)), g10 = K7(), e10 = e10.ka(f10, g10.u), f10 = qf().li, as(b10, f10, e10, c10.x)); + c10 = Ti(b10.Y(), qf().Bi); + Vb().Ia(c10).na() && (e10 = B6(b10.Y(), qf().Bi), a10 = bj(a10, e10), e10 = qf().Bi, Rg(b10, e10, a10, c10.x)); + } + function Keb(a10, b10, c10) { + B6(b10.Y(), Ag().Ec).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = B6(f10.Y(), Ag().Ec).Fb(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + if (p10.j === t10.j) + return true; + var v10 = B6(p10.g, Zf().Rd).A; + v10 = (v10.b() ? "" : v10.c()).trim(); + var A10 = B6(t10.g, Zf().Rd).A; + A10 = A10.b() ? "" : A10.c(); + return v10 === A10.trim() ? (v10 = B6(p10.g, ag().R).A, v10 = v10.b() ? null : v10.c(), t10 = B6(t10.g, ag().R).A, v10 === (t10.b() ? null : t10.c())) : false; + }; + }(e10, g10))); + if (h10 instanceof z7) + Meb(g10, h10.i); + else { + if (y7() === h10) { + g10.x.Lb(new t62().a()); + h10 = Ag().Ec; + var k10 = B6(f10.Y(), Ag().Ec); + g10 = J5(K7(), new Ib().ha([g10])); + var l10 = K7(); + k10 = k10.ia( + g10, + l10.u + ); + return Bf(f10, h10, k10); + } + throw new x7().d(h10); + } + }; + }(a10, c10))); + } + function Leb(a10, b10, c10) { + var e10 = new Ej().a(); + try { + return b10.U(w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = hd(g10.Y(), k10.Lc); + if (!(l10 instanceof z7 && l10.i.r.r.h(k10.r.r)) && (k10 = k10.Lc, l10 = Ih().Cn, (null === k10 ? null !== l10 : !k10.h(l10)) || g10 instanceof Hh)) + throw wQa(h10); + }; + }(a10, c10, e10))), true; + } catch (f10) { + if (f10 instanceof nz) { + a10 = f10; + if (a10.Aa === e10) + return a10.Oea(); + throw a10; + } + throw f10; + } + } + d7.z = function() { + return X5(this); + }; + function Ieb(a10, b10) { + r62(a10, b10); + return B6(b10.Y(), qf().xd).Da() ? s62(a10, b10) : b10; + } + function Jeb(a10, b10) { + r62(a10, b10); + var c10 = new xi().a(); + Cb(b10, c10); + if (B6(b10.aa, qf().xd).Da()) + return s62(a10, b10); + c10 = B6(b10.aa, Ih().kh); + a10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = bj(f10, g10); + if (h10 instanceof Vk) { + var k10 = Ab(g10.Xa, q5(Zi)); + g10 = Ab(h10.Xa, q5(Zi)); + k10 instanceof z7 && (k10 = k10.i, y7() === g10 && h10.Xa.Lb(k10)); + return h10; + } + k10 = f10.xf.ob; + var l10 = dc().Fh, m10 = h10.j, p10 = y7(), t10 = "Resolution error: Expecting property shape, found " + h10, v10 = Ab(h10.fa(), q5(jd)); + h10 = h10.Ib(); + k10.Gc(l10.j, m10, p10, t10, v10, Yb().qb, h10); + return g10; + }; + }(a10)); + var e10 = K7(); + c10 = c10.ka(a10, e10.u); + a10 = Ih().kh; + return Bf(b10, a10, c10); + } + d7.$classData = r8({ WZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeCanonizer", { WZa: 1, f: 1, b_a: 1, y: 1, v: 1, q: 1, o: 1 }); + function Deb() { + } + Deb.prototype = new y_(); + Deb.prototype.constructor = Deb; + d7 = Deb.prototype; + d7.nE = function(a10) { + return a10 instanceof zi || null !== a10; + }; + d7.Sa = function(a10) { + return this.nE(a10); + }; + d7.Wa = function(a10, b10) { + return this.zD(a10, b10); + }; + d7.zD = function(a10, b10) { + return a10 instanceof zi ? a10 : null !== a10 ? (b10 = B6(a10.Y(), qf().R).A, a10.Ug(b10.b() ? null : b10.c(), (O7(), new P6().a()))) : b10.P(a10); + }; + d7.$classData = r8({ YZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeCanonizer$$anonfun$1", { YZa: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function uZ() { + this.dr = this.xf = this.ME = this.kf = null; + } + uZ.prototype = new u7(); + uZ.prototype.constructor = uZ; + d7 = uZ.prototype; + d7.H = function() { + return "ShapeExpander"; + }; + function Neb(a10, b10) { + var c10 = Ti(b10.Y(), qf().xd); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.Y(), qf().xd); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = false, m10 = null; + if (k10 instanceof zi) { + l10 = true; + m10 = k10; + var p10 = B6(m10.aa, Ci().Ys).A; + if (p10.b() ? 0 : p10.c() === h10.j) + return k10 = m10.mn, k10.b() || (k10 = k10.c(), u62(g10, k10, h10)), v62(g10, GN(m10.fh), h10), j8a(g10.ME, h10, m10, g10.dr, y7(), g10.xf); + } + if (l10) + return k10 = m10.mn, k10.b() || (k10 = k10.c(), u62(g10, k10, h10)), v62(g10, GN(m10.fh), h10), m10; + m10 = w62(g10, k10); + m10 instanceof zi ? (k10 = m10.mn, k10.b() || (k10 = k10.c(), u62(g10, k10, h10)), v62(g10, GN(m10.fh), h10)) : (v62(g10, GN(m10.fh), h10), lIa(g10.xf.Wg, GN(h10.fh), h10)); + return m10; + }; + }(a10, b10)); + var f10 = K7(); + e10 = e10.ka(a10, f10.u); + a10 = qf().xd; + as(b10, a10, e10, c10.x); + } + } + d7.E = function() { + return 2; + }; + function Oeb(a10, b10) { + var c10 = Za(b10); + if (c10 instanceof z7) { + var e10 = a10.dr; + c10 = [a10.kf.j, c10.i.j]; + if (0 === (c10.length | 0)) + var f10 = vd(); + else { + f10 = wd(new xd(), vd()); + for (var g10 = 0, h10 = c10.length | 0; g10 < h10; ) + Ad(f10, c10[g10]), g10 = 1 + g10 | 0; + f10 = f10.eb; + } + c10 = e10.pq; + e10.pq = e10.pq.Lk(f10); + f10 = e10.to; + a10 = bj(a10, b10); + e10.to = f10; + e10.pq = c10; + return a10; + } + if (y7() === c10 && B6(b10.Y(), qf().xd).Da()) + return e10 = a10.dr, c10 = B6(b10.Y(), qf().xd), f10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return k10.j; + }; + }(a10)), g10 = K7(), f10 = c10.ka(f10, g10.u).xg().Zj(a10.kf.j), c10 = e10.pq, e10.pq = e10.pq.Lk(f10), f10 = e10.to, a10 = bj(a10, b10), e10.to = f10, e10.pq = c10, a10; + if (b10 instanceof zi) + return b10; + e10 = a10.dr; + c10 = [a10.kf.j]; + if (0 === (c10.length | 0)) + f10 = vd(); + else { + f10 = wd(new xd(), vd()); + g10 = 0; + for (h10 = c10.length | 0; g10 < h10; ) + Ad(f10, c10[g10]), g10 = 1 + g10 | 0; + f10 = f10.eb; + } + c10 = e10.pq; + e10.pq = e10.pq.Lk(f10); + f10 = e10.to; + a10 = bj(a10, b10); + e10.to = f10; + e10.pq = c10; + return a10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof uZ) { + var b10 = this.kf, c10 = a10.kf; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.ME, a10 = a10.ME, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oba = function(a10) { + if (null !== a10 && Za(a10).na()) + return i8a(this.ME, this.kf, new z7().d(this.kf.j), a10, this.dr, this.xf); + var b10 = this.dr; + if (b10.to.Ha(a10.j) && !b10.B8.Ha(la(a10)) && !(a10 instanceof zi)) + return i8a(this.ME, this.kf, y7(), a10, this.dr, this.xf); + if (this.dr.Tea.Ha(a10.j)) + return a10; + if (Vb().Ia(a10.j).b()) { + b10 = this.xf.ob; + var c10 = dc().Fh, e10 = a10.j, f10 = y7(), g10 = "Resolution error: Found shape without ID: " + a10, h10 = Ab(a10.fa(), q5(jd)), k10 = a10.Ib(); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + } + Uca(this.dr, a10.j); + b10 = this.dr; + c10 = b10.to; + if (a10 instanceof Vh) + a10 = Peb(this, a10); + else if (a10 instanceof Mh) + a10 = Qeb(this, a10); + else if (a10 instanceof th) + a10 = Reb(this, a10); + else if (a10 instanceof pi) + Seb(this, a10), e10 = Ti(a10.aa, xea().Ff), Vb().Ia(e10).na() && (f10 = w62(this, B6(a10.aa, uh().Ff)), f10 instanceof zi ? (g10 = f10.mn, g10.b() || (g10 = g10.c(), u62(this, g10, a10))) : v62(this, GN(f10.fh), a10), Ui(a10.aa, xea().Ff, f10, e10.x)); + else if (a10 instanceof qi) + a10 = Teb(this, a10); + else if (a10 instanceof Vk) { + e10 = false; + f10 = hd(a10.aa, Qi().ji); + if (y7() !== f10) + if (f10 instanceof z7) + f10 = f10.i, f10.r.x.Lb(new xi().a()), 0 !== za(Si(f10.r.r)) && (e10 = true); + else + throw new x7().d(f10); + f10 = Ti(a10.aa, Qi().Vf); + Vb().Ia(f10).na() ? (e10 = e10 ? w62(this, B6( + a10.aa, + Qi().Vf + )) : Oeb(this, B6(a10.aa, Qi().Vf)), Ui(a10.aa, Qi().Vf, e10, f10.x)) : (e10 = this.xf.ob, f10 = dc().Fh, yB(e10, f10, a10.j, "Resolution error: Property shape with missing range: " + a10, a10.Xa)); + } else if (a10 instanceof Wh) + a10 = Qeb(this, a10); + else if (!(a10 instanceof Th)) + if (a10 instanceof Hh) + a10 = Ueb(this, a10); + else if (a10 instanceof zi) + a10 = j8a(this.ME, a10, a10, this.dr, y7(), this.xf); + else { + if (!(a10 instanceof vh)) + throw new x7().d(a10); + a10 = Qeb(this, a10); + } + b10.to = c10; + return a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.kf; + case 1: + return this.ME; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Reb(a10, b10) { + Neb(a10, b10); + Seb(a10, b10); + var c10 = B6(b10.aa, uh().Bq).A, e10 = c10.b() ? false : 0 < (c10.c() | 0); + c10 = Ti(b10.aa, uh().Ff); + if (e10) { + var f10 = B6(b10.aa, qf().xd), g10 = new Veb(), h10 = K7(); + f10.ec(g10, h10.u).U(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10 = B6(m10.aa, uh().Ff); + j8a(k10.ME, l10, m10, k10.dr, new z7().d(l10.j), k10.xf); + m10 = m10.mn; + m10.b() || (m10 = m10.c(), u62(k10, m10, l10)); + }; + }(a10, b10))); + } + Vb().Ia(c10).na() && (e10 = e10 ? w62(a10, B6(b10.aa, uh().Ff)) : Oeb(a10, B6(b10.aa, uh().Ff)), e10 instanceof zi ? (f10 = e10.mn, f10.b() || (f10 = f10.c(), u62(a10, f10, b10))) : v62(a10, GN(e10.fh), b10), Ui(b10.aa, uh().Ff, e10, c10.x)); + return b10; + } + function u62(a10, b10, c10) { + var e10 = c10.fh, f10 = ii().u; + for (f10 = qt(e10, f10); !f10.b(); ) { + var g10 = f10.ga(), h10 = B6(g10.Y(), qf().R).A; + h10 = h10.b() ? null : h10.c(); + var k10 = B6(b10.Y(), qf().R).A; + h10 === (k10.b() ? null : k10.c()) && e10.gX(g10); + f10 = f10.ta(); + } + c10.fh.Tm(b10); + q8a(a10.xf.Wg, b10.j, c10); + return c10; + } + function Seb(a10, b10) { + var c10 = Ti(b10.Y(), qf().fi); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.Y(), qf().fi), f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w62(h10, l10); + if (l10 instanceof zi) { + var m10 = l10.mn; + m10.b() || (m10 = m10.c(), u62(h10, m10, k10)); + } else + v62(h10, GN(l10.fh), k10); + return l10; + }; + }(a10, b10)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = qf().fi; + as(b10, f10, e10, c10.x); + } + c10 = Ti(b10.Y(), qf().ki); + Vb().Ia(c10).na() && (e10 = B6(b10.Y(), qf().ki), f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w62(h10, l10); + if (l10 instanceof zi) { + var m10 = l10.mn; + m10.b() || (m10 = m10.c(), u62(h10, m10, k10)); + } else + v62(h10, GN(l10.fh), k10); + return l10; + }; + }(a10, b10)), g10 = K7(), e10 = e10.ka(f10, g10.u), f10 = qf().ki, as(b10, f10, e10, c10.x)); + c10 = Ti(b10.Y(), qf().li); + Vb().Ia(c10).na() && (e10 = B6(b10.Y(), qf().li), f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w62(h10, l10); + if (l10 instanceof zi) { + var m10 = l10.mn; + m10.b() || (m10 = m10.c(), u62(h10, m10, k10)); + } else + v62(h10, GN(l10.fh), k10); + return l10; + }; + }(a10, b10)), g10 = K7(), e10 = e10.ka(f10, g10.u), f10 = qf().li, as(b10, f10, e10, c10.x)); + c10 = Ti(b10.Y(), qf().Bi); + Vb().Ia(c10).na() && (e10 = w62(a10, B6(b10.Y(), qf().Bi)), e10 instanceof zi ? (f10 = e10.mn, f10.b() || (f10 = f10.c(), u62(a10, f10, b10))) : v62(a10, GN(e10.fh), b10), a10 = qf().Bi, Rg(b10, a10, e10, c10.x)); + } + function Teb(a10, b10) { + Seb(a10, b10); + var c10 = Ti(b10.aa, an().$p); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.aa, an().$p); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = w62(g10, k10); + if (k10 instanceof zi) { + var l10 = k10.mn; + l10.b() || (l10 = l10.c(), u62(g10, l10, h10)); + } else + v62(g10, GN(k10.fh), h10); + return k10; + }; + }(a10, b10)); + var f10 = K7(); + e10 = e10.ka(a10, f10.u); + a10 = an().$p; + as(b10, a10, e10, c10.x); + } + return b10; + } + function Ueb(a10, b10) { + var c10 = Ti(b10.aa, Ih().kh); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.aa, Ih().kh), f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w62(h10, l10); + var m10 = B6(l10.aa, Qi().Vf); + if (m10 instanceof zi) { + var p10 = m10.mn; + p10.b() || (p10 = p10.c(), u62(h10, p10, k10)); + } + v62(h10, GN(m10.fh), k10); + return l10; + }; + }(a10, b10)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = Ih().kh; + as(b10, f10, e10, c10.x); + } + Neb(a10, b10); + Seb(a10, b10); + a10 = hd(b10.aa, Ih().Cn); + if (a10 instanceof z7) + a10 = a10.i, Ui(b10.aa, Ih().Cn, a10.r.r, a10.r.x.Lb(new xi().a())); + else if (y7() === a10) + a10 = Ih().Cn, c10 = ih(new jh(), false, new P6().a()), e10 = (O7(), new P6().a()).Lb(new xi().a()), Rg(b10, a10, c10, e10); + else + throw new x7().d(a10); + return b10; + } + function w62(a10, b10) { + var c10 = a10.dr, e10 = c10.to; + a10 = bj(a10, b10); + c10.to = e10; + return a10; + } + d7.z = function() { + return X5(this); + }; + function v62(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return u62(e10, g10, f10); + }; + }(a10, c10))); + } + function Peb(a10, b10) { + Neb(a10, b10); + var c10 = Ti(b10.aa, xn().Le); + if (Vb().Ia(c10).na()) { + var e10 = B6(b10.aa, xn().Le); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = g10.dr, m10 = l10.to.Zj(k10.j), p10 = l10.pq; + l10.pq = l10.pq.Lk(m10); + m10 = l10.to; + k10 = w62(g10, k10); + l10.to = m10; + l10.pq = p10; + k10 instanceof zi ? (l10 = k10.mn, l10.b() || (l10 = l10.c(), u62(g10, l10, h10))) : v62(g10, GN(k10.fh), h10); + return k10; + }; + }(a10, b10)); + var f10 = K7(); + e10 = e10.ka(a10, f10.u); + a10 = xn().Le; + as(b10, a10, e10, c10.x); + } else if (Vb().Ia(B6(b10.aa, qf().xd)).b() || B6(b10.aa, qf().xd).b()) + c10 = a10.xf.ob, e10 = dc().Fh, yB(c10, e10, b10.j, "Resolution error: Union shape with missing anyof: " + b10, b10.Xa); + return b10; + } + function Qeb(a10, b10) { + Neb(a10, b10); + Seb(a10, b10); + return b10; + } + d7.$classData = r8({ ZZa: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeExpander", { ZZa: 1, f: 1, b_a: 1, y: 1, v: 1, q: 1, o: 1 }); + function Veb() { + } + Veb.prototype = new y_(); + Veb.prototype.constructor = Veb; + d7 = Veb.prototype; + d7.nE = function(a10) { + return a10 instanceof th && B6(a10.aa, uh().Ff) instanceof zi ? true : false; + }; + d7.Sa = function(a10) { + return this.nE(a10); + }; + d7.Wa = function(a10, b10) { + return this.zD(a10, b10); + }; + d7.zD = function(a10, b10) { + return a10 instanceof th && B6(a10.aa, uh().Ff) instanceof zi ? a10 : b10.P(a10); + }; + d7.$classData = r8({ a_a: 0 }, false, "amf.plugins.domain.shapes.resolution.stages.shape_normalization.ShapeExpander$$anonfun$expandArray$2", { a_a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Web() { + this.ns = this.vo = this.pa = null; + } + Web.prototype = new u7(); + Web.prototype.constructor = Web; + d7 = Web.prototype; + d7.H = function() { + return "AnyMathPayloadValidator"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Web) { + var b10 = this.pa, c10 = a10.pa; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.vo === a10.vo : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.vo; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.xma = function(a10, b10) { + return this.D3(a10, b10).Yg(w6(/* @__PURE__ */ function() { + return function(c10) { + return c10.pB; + }; + }(this)), ml()); + }; + d7.D3 = function(a10, b10) { + a10 = "Unsupported validation for mediatype: " + b10 + " and shape " + this.pa.j; + b10 = this.vo; + var c10 = F6().Zd; + c10 = new z7().d(ic(G5(c10, "value"))); + var e10 = this.vo === Yb().qb ? sg().xN.j : Ko().lS.j, f10 = y7(), g10 = y7(); + a10 = Xb(a10, b10, "", c10, e10, f10, g10, null); + return nq(hp(), oq(/* @__PURE__ */ function(h10, k10) { + return function() { + var l10 = pMa(), m10 = VC(WC(), ""), p10 = K7(); + return nMa(l10, m10, J5(p10, new Ib().ha([k10]))); + }; + }(this, a10)), ml()); + }; + d7.C3 = function(a10) { + var b10 = B6(a10.g, sl().Nd).A; + b10 = "Unsupported validation for mediatype: " + (b10.b() ? null : b10.c()) + " and shape " + this.pa.j; + var c10 = this.vo, e10 = ar(a10.g, sl().nb).j, f10 = F6().Zd; + f10 = new z7().d(ic(G5(f10, "value"))); + var g10 = this.vo === Yb().qb ? sg().xN.j : Ko().lS.j, h10 = Ab(ar(a10.g, sl().nb).fa(), q5(jd)); + a10 = ar(a10.g, sl().nb); + a10 = yb(a10); + b10 = Xb(b10, c10, e10, f10, g10, h10, a10, null); + return nq(hp(), oq(/* @__PURE__ */ function(k10, l10) { + return function() { + var m10 = pMa(), p10 = VC(WC(), ""), t10 = K7(); + return nMa(m10, p10, J5(t10, new Ib().ha([l10]))); + }; + }(this, b10)), ml()); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ e_a: 0 }, false, "amf.plugins.domain.shapes.validation.PayloadValidationPluginsHandler$AnyMathPayloadValidator", { e_a: 1, f: 1, rDa: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xeb() { + this.wd = this.bb = this.mc = this.qa = this.la = this.ba = this.Su = this.Vu = this.Yt = this.Tf = this.yl = this.lD = null; + this.xa = 0; + } + Xeb.prototype = new u7(); + Xeb.prototype.constructor = Xeb; + d7 = Xeb.prototype; + d7.a = function() { + Yeb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Ta; + this.lD = rb(new sb(), a10, G5(b10, "propertyName"), tb(new ub(), vb().Ta, "property name", "", H10())); + a10 = qb(); + b10 = F6().Ta; + this.yl = rb(new sb(), a10, G5(b10, "contentType"), tb(new ub(), vb().Ta, "content type", "", H10())); + a10 = new xc().yd(cj()); + b10 = F6().Ta; + this.Tf = rb(new sb(), a10, G5(b10, "header"), tb(new ub(), vb().Ta, "header", "", H10())); + a10 = qb(); + b10 = F6().Ta; + this.Yt = rb(new sb(), a10, G5(b10, "style"), tb(new ub(), vb().Ta, "style", "", H10())); + a10 = zc(); + b10 = F6().Ta; + this.Vu = rb(new sb(), a10, G5(b10, "explode"), tb( + new ub(), + vb().Ta, + "explode", + "", + H10() + )); + a10 = zc(); + b10 = F6().Ta; + this.Su = rb(new sb(), a10, G5(b10, "allowReserved"), tb(new ub(), vb().Ta, "allow reserved", "", H10())); + a10 = F6().Ta; + a10 = G5(a10, "Encoding"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.la = this.lD; + this.qa = tb(new ub(), vb().Ta, "Encoding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + var a10 = this.lD, b10 = this.yl, c10 = this.Tf, e10 = this.Yt, f10 = this.Vu, g10 = this.Su, h10 = nc().g; + return ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, h10)))))); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new em().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ t_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.EncodingModel$", { t_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1 }); + var Yeb = void 0; + function dm() { + Yeb || (Yeb = new Xeb().a()); + return Yeb; + } + function Zeb() { + this.wd = this.bb = this.mc = this.R = this.qa = this.ba = this.Pf = null; + this.xa = 0; + } + Zeb.prototype = new u7(); + Zeb.prototype.constructor = Zeb; + d7 = Zeb.prototype; + d7.a = function() { + $eb = this; + Cr(this); + uU(this); + wb(this); + var a10 = yc(), b10 = F6().Tb; + this.Pf = rb(new sb(), a10, G5(b10, "url"), tb(new ub(), vb().Tb, "url", "URL identifying the organization", H10())); + a10 = F6().Tb; + a10 = G5(a10, "License"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Tb, "License", "Licensing information for a resource", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.Pf, b10 = this.R, c10 = nc().g; + return ji(a10, ji(b10, c10)); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Nl().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ w_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.LicenseModel$", { w_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1 }); + var $eb = void 0; + function Ml() { + $eb || ($eb = new Zeb().a()); + return $eb; + } + function afb() { + this.wd = this.bb = this.mc = this.R = this.qa = this.ba = this.WI = this.Pf = null; + this.xa = 0; + } + afb.prototype = new u7(); + afb.prototype.constructor = afb; + d7 = afb.prototype; + d7.a = function() { + bfb = this; + Cr(this); + uU(this); + wb(this); + var a10 = yc(), b10 = F6().Tb; + this.Pf = rb(new sb(), a10, G5(b10, "url"), tb(new ub(), vb().Tb, "url", "URL identifying the organization", H10())); + a10 = qb(); + b10 = F6().Tb; + this.WI = rb(new sb(), a10, G5(b10, "email"), tb(new ub(), vb().Tb, "email", "Contact email for the organization", H10())); + a10 = F6().Tb; + a10 = G5(a10, "Organization"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Tb, "Organization", "Organization providing an good or service", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Pf, this.R, this.WI], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Ul().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ z_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.OrganizationModel$", { z_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1 }); + var bfb = void 0; + function Tl() { + bfb || (bfb = new afb().a()); + return bfb; + } + function cfb() { + this.wd = this.bb = this.mc = this.R = this.qa = this.ba = this.sD = this.OC = this.YC = this.Hf = null; + this.xa = 0; + } + cfb.prototype = new u7(); + cfb.prototype.constructor = cfb; + d7 = cfb.prototype; + d7.a = function() { + dfb = this; + Cr(this); + uU(this); + wb(this); + var a10 = qb(), b10 = F6().Jb; + this.Hf = rb(new sb(), a10, G5(b10, "type"), tb(new ub(), vb().Jb, "type", "The type of the exchange", H10())); + a10 = zc(); + b10 = F6().Jb; + this.YC = rb(new sb(), a10, G5(b10, "durable"), tb(new ub(), vb().Jb, "durable", "Whether the exchange should survive broker restarts or not", H10())); + a10 = zc(); + b10 = F6().Jb; + this.OC = rb(new sb(), a10, G5(b10, "autoDelete"), tb(new ub(), vb().Jb, "autoDelete", "Whether the exchange should be deleted when the last queue is unbound from it", H10())); + a10 = qb(); + b10 = F6().Jb; + this.sD = rb(new sb(), a10, G5(b10, "vhost"), tb(new ub(), vb().Jb, "vhost", "The virtual host of the exchange", H10())); + a10 = F6().Jb; + a10 = G5(a10, "Amqp091ChannelExchange"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "Amqp091ChannelExchange", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Hf, this.YC, this.OC, this.sD], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Rn().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ J_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.Amqp091ChannelExchangeModel$", { J_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1 }); + var dfb = void 0; + function Qn() { + dfb || (dfb = new cfb().a()); + return dfb; + } + function efb() { + this.wd = this.bb = this.mc = this.R = this.qa = this.ba = this.sD = this.OC = this.ZX = this.YC = null; + this.xa = 0; + } + efb.prototype = new u7(); + efb.prototype.constructor = efb; + d7 = efb.prototype; + d7.a = function() { + ffb = this; + Cr(this); + uU(this); + wb(this); + var a10 = zc(), b10 = F6().Jb; + this.YC = rb(new sb(), a10, G5(b10, "durable"), tb(new ub(), vb().Jb, "durable", "Whether the exchange should survive broker restarts or not", H10())); + a10 = zc(); + b10 = F6().Jb; + this.ZX = rb(new sb(), a10, G5(b10, "exclusive"), tb(new ub(), vb().Jb, "exclusive", "Whether the queue should be used only by one connection or not", H10())); + a10 = zc(); + b10 = F6().Jb; + this.OC = rb(new sb(), a10, G5(b10, "autoDelete"), tb( + new ub(), + vb().Jb, + "autoDelete", + "Whether the exchange should be deleted when the last queue is unbound from it", + H10() + )); + a10 = qb(); + b10 = F6().Jb; + this.sD = rb(new sb(), a10, G5(b10, "vhost"), tb(new ub(), vb().Jb, "vhost", "The virtual host of the exchange", H10())); + a10 = F6().Jb; + a10 = G5(a10, "Amqp091ChannelQueue"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "Amqp091Queue", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.YC, this.ZX, this.OC, this.sD], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Un().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ M_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.Amqp091QueueModel$", { M_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1 }); + var ffb = void 0; + function Tn() { + ffb || (ffb = new efb().a()); + return ffb; + } + function gfb() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + } + gfb.prototype = new u7(); + gfb.prototype.constructor = gfb; + d7 = gfb.prototype; + d7.a = function() { + hfb = this; + Cr(this); + uU(this); + var a10 = F6().Jb; + a10 = G5(a10, "ChannelBinding"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "ChannelBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return nc().g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("ChannelBinding is an abstract class")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ N_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.ChannelBindingModel$", { N_a: 1, f: 1, VY: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var hfb = void 0; + function xZ() { + hfb || (hfb = new gfb().a()); + return hfb; + } + function ifb() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + } + ifb.prototype = new u7(); + ifb.prototype.constructor = ifb; + d7 = ifb.prototype; + d7.a = function() { + jfb = this; + Cr(this); + uU(this); + var a10 = F6().Jb; + a10 = G5(a10, "MessageBinding"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "MessageBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return nc().g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("MessageBinding is an abstract class")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ U_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.MessageBindingModel$", { U_a: 1, f: 1, VR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var jfb = void 0; + function yZ() { + jfb || (jfb = new ifb().a()); + return jfb; + } + function kfb() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + } + kfb.prototype = new u7(); + kfb.prototype.constructor = kfb; + d7 = kfb.prototype; + d7.a = function() { + lfb = this; + Cr(this); + uU(this); + var a10 = F6().Jb; + a10 = G5(a10, "OperationBinding"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "OperationBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return nc().g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("OperationBinding is an abstract class")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Z_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.OperationBindingModel$", { Z_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var lfb = void 0; + function wZ() { + lfb || (lfb = new kfb().a()); + return lfb; + } + function mfb() { + this.wd = this.bb = this.mc = this.qa = this.ba = null; + this.xa = 0; + } + mfb.prototype = new u7(); + mfb.prototype.constructor = mfb; + d7 = mfb.prototype; + d7.a = function() { + nfb = this; + Cr(this); + uU(this); + var a10 = F6().Jb; + a10 = G5(a10, "ServerBinding"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "ServerBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return nc().g; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("ServerBinding is an abstract class")); + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ $_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.ServerBindingModel$", { $_a: 1, f: 1, s7: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var nfb = void 0; + function iSa() { + nfb || (nfb = new mfb().a()); + return nfb; + } + function ofb() { + this.wd = this.bb = this.mc = this.qa = this.g = this.ba = this.Ny = this.R = null; + this.xa = 0; + } + ofb.prototype = new u7(); + ofb.prototype.constructor = ofb; + d7 = ofb.prototype; + d7.a = function() { + pfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().dc, "name", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.Ny = rb(new sb(), a10, G5(b10, "in"), tb(new ub(), vb().dc, "in", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "ApiKeySettings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.R, this.Ny]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().dc, + "API Key Settings", + "Settings for an API Key security scheme", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bR().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ b0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.ApiKeySettingsModel$", { b0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var pfb = void 0; + function aR() { + pfb || (pfb = new ofb().a()); + return pfb; + } + function qfb() { + this.wd = this.bb = this.mc = this.qa = this.g = this.ba = this.RM = this.Eq = null; + this.xa = 0; + } + qfb.prototype = new u7(); + qfb.prototype.constructor = qfb; + d7 = qfb.prototype; + d7.a = function() { + rfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().dc; + this.Eq = rb(new sb(), a10, G5(b10, "scheme"), tb(new ub(), vb().dc, "scheme", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.RM = rb(new sb(), a10, G5(b10, "bearerFormat"), tb(new ub(), vb().dc, "bearer format", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "HttpSettings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.Eq, this.RM]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "HTTP Settings", "Settings for an HTTP security scheme", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bR().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ c0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.HttpSettingsModel$", { c0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var rfb = void 0; + function F32() { + rfb || (rfb = new qfb().a()); + return rfb; + } + function sfb() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.DJ = this.GJ = this.km = this.zJ = null; + this.xa = 0; + } + sfb.prototype = new u7(); + sfb.prototype.constructor = sfb; + d7 = sfb.prototype; + d7.a = function() { + tfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().dc; + this.zJ = rb(new sb(), a10, G5(b10, "requestTokenUri"), tb(new ub(), vb().dc, "request token URI", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.km = rb(new sb(), a10, G5(b10, "authorizationUri"), tb(new ub(), vb().dc, "authorization URI", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.GJ = rb(new sb(), a10, G5(b10, "tokenCredentialsUri"), tb(new ub(), vb().dc, "token credentials URI", "", H10())); + a10 = new xc().yd(qb()); + b10 = F6().dc; + this.DJ = rb(new sb(), a10, G5(b10, "signature"), tb(new ub(), vb().dc, "signature", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "OAuth1Settings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "OAuth1 Settings", "Settings for an OAuth1 security scheme", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.zJ, this.km, this.GJ, this.DJ], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new q1().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ d0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.OAuth1SettingsModel$", { d0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var tfb = void 0; + function vZ() { + tfb || (tfb = new sfb().a()); + return tfb; + } + function ufb() { + this.wd = this.bb = this.mc = this.la = this.qa = this.g = this.ba = this.lo = this.tN = this.Wv = this.vq = this.km = null; + this.xa = 0; + } + ufb.prototype = new u7(); + ufb.prototype.constructor = ufb; + d7 = ufb.prototype; + d7.a = function() { + vfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().dc; + this.km = rb(new sb(), a10, G5(b10, "authorizationUri"), tb(new ub(), vb().dc, "authorization URI", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.vq = rb(new sb(), a10, G5(b10, "accessTokenUri"), tb(new ub(), vb().dc, "access token URI", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.Wv = rb(new sb(), a10, G5(b10, "flow"), tb(new ub(), vb().dc, "flow", "", H10())); + a10 = qb(); + b10 = F6().dc; + this.tN = rb(new sb(), a10, G5(b10, "refreshUri"), tb(new ub(), vb().dc, "refresh URI", "", H10())); + a10 = new xc().yd(Gm()); + b10 = F6().dc; + this.lo = rb(new sb(), a10, G5(b10, "scope"), tb( + new ub(), + vb().dc, + "scope", + "", + H10() + )); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "OAuth2Flow")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.km, this.vq, this.Wv, this.tN, this.lo]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "OAuth2 Flow", "Flow for an OAuth2 security scheme setting", H10()); + this.la = this.Wv; + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Km().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ e0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.OAuth2FlowModel$", { e0a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1 }); + var vfb = void 0; + function Jm() { + vfb || (vfb = new ufb().a()); + return vfb; + } + function wfb() { + this.wd = this.bb = this.mc = this.qa = this.g = this.ba = this.Ap = this.Gy = null; + this.xa = 0; + } + wfb.prototype = new u7(); + wfb.prototype.constructor = wfb; + d7 = wfb.prototype; + d7.a = function() { + xfb = this; + Cr(this); + uU(this); + var a10 = new xc().yd(qb()), b10 = F6().dc; + this.Gy = rb(new sb(), a10, G5(b10, "authorizationGrant"), tb(new ub(), vb().dc, "authorization grant", "", H10())); + a10 = new xc().yd(Jm()); + b10 = F6().dc; + this.Ap = rb(new sb(), a10, G5(b10, "flows"), tb(new ub(), vb().dc, "flows", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "OAuth2Settings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.Gy, this.Ap]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "OAuth2 Settings", "Settings for an OAuth2 security scheme", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new wE().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ f0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.OAuth2SettingsModel$", { f0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var xfb = void 0; + function xE() { + xfb || (xfb = new wfb().a()); + return xfb; + } + function yfb() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.lo = this.Pf = null; + this.xa = 0; + } + yfb.prototype = new u7(); + yfb.prototype.constructor = yfb; + d7 = yfb.prototype; + d7.a = function() { + zfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().dc; + this.Pf = rb(new sb(), a10, G5(b10, "openIdConnectUrl"), tb(new ub(), vb().dc, "OpenID connect URL", "", H10())); + a10 = new xc().yd(Gm()); + b10 = F6().dc; + this.lo = rb(new sb(), a10, G5(b10, "scope"), tb(new ub(), vb().dc, "scope", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "OpenIdConnectSettings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "OpenID Settings", "Settings for an OpenID security scheme", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Pf, this.lo], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Nm().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bR().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ g0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.OpenIdConnectSettingsModel$", { g0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var zfb = void 0; + function vE() { + zfb || (zfb = new yfb().a()); + return zfb; + } + function Afb() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.la = this.Oh = this.Eq = this.Va = this.R = null; + this.xa = 0; + } + Afb.prototype = new u7(); + Afb.prototype.constructor = Afb; + d7 = Afb.prototype; + d7.a = function() { + Bfb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + b10 = G5(b10, "name"); + var c10 = vb().Tb, e10 = K7(), f10 = F6().Tb; + this.R = rb(new sb(), a10, b10, tb(new ub(), c10, "name", "Name for the security scheme", J5(e10, new Ib().ha([ic(G5(f10, "name"))])))); + a10 = qb(); + b10 = F6().Tb; + b10 = G5(b10, "description"); + c10 = vb().dc; + e10 = K7(); + f10 = F6().Tb; + this.Va = rb(new sb(), a10, b10, tb(new ub(), c10, "description", "Name for the security scheme", J5(e10, new Ib().ha([ic(G5(f10, "description"))])))); + a10 = Xh(); + b10 = F6().dc; + this.Eq = rb(new sb(), a10, G5(b10, "scheme"), tb(new ub(), vb().dc, "scheme", "", H10())); + a10 = Nm(); + b10 = F6().dc; + this.Oh = rb(new sb(), a10, G5(b10, "settings"), tb(new ub(), vb().dc, "settings", "Security scheme settings", H10())); + this.la = this.R; + ii(); + a10 = F6().dc; + a10 = [G5(a10, "ParametrizedSecurityScheme")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "Parametrized Security Scheme", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Eq, this.Oh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new jm().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ h0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.ParametrizedSecuritySchemeModel$", { h0a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1 }); + var Bfb = void 0; + function im() { + Bfb || (Bfb = new Afb().a()); + return Bfb; + } + function Cfb() { + this.wd = this.bb = this.mc = this.qa = this.g = this.ba = this.Dy = null; + this.xa = 0; + } + Cfb.prototype = new u7(); + Cfb.prototype.constructor = Cfb; + d7 = Cfb.prototype; + d7.a = function() { + Dfb = this; + Cr(this); + uU(this); + var a10 = dl(), b10 = F6().dc; + this.Dy = rb(new sb(), a10, G5(b10, "additionalProperties"), tb(new ub(), vb().dc, "additional properties", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "Settings")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.Dy]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "Settings", "Settings for a security scheme", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Om().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ l0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.SettingsModel$", { l0a: 1, f: 1, WR: 1, pd: 1, hc: 1, Rb: 1, rc: 1 }); + var Dfb = void 0; + function Nm() { + Dfb || (Dfb = new Cfb().a()); + return Dfb; + } + function Kn() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Kn.prototype = new u7(); + Kn.prototype.constructor = Kn; + d7 = Kn.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Kn().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Jn(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/default-id"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Kn().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return Jn().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ q0a: 0 }, false, "amf.plugins.domain.webapi.models.CorrelationId", { q0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1 }); + function jRa() { + } + jRa.prototype = new y_(); + jRa.prototype.constructor = jRa; + d7 = jRa.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof ij ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof ij; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.LO = function() { + return this; + }; + d7.$classData = r8({ s0a: 0 }, false, "amf.plugins.domain.webapi.models.EndPoint$$anonfun$resourceType$1", { s0a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Efb() { + } + Efb.prototype = new y_(); + Efb.prototype.constructor = Efb; + d7 = Efb.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof kj ? a10 : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof kj; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.LO = function() { + return this; + }; + d7.$classData = r8({ t0a: 0 }, false, "amf.plugins.domain.webapi.models.EndPoint$$anonfun$traits$1", { t0a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Ffb() { + } + Ffb.prototype = new y_(); + Ffb.prototype.constructor = Ffb; + d7 = Ffb.prototype; + d7.Rg = function(a10, b10) { + return a10 instanceof kj ? a10 : b10.P(a10); + }; + d7.oU = function() { + return this; + }; + d7.Sg = function(a10) { + return a10 instanceof kj; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ z0a: 0 }, false, "amf.plugins.domain.webapi.models.Operation$$anonfun$traits$1", { z0a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function xqa() { + } + xqa.prototype = new y_(); + xqa.prototype.constructor = xqa; + d7 = xqa.prototype; + d7.a = function() { + return this; + }; + d7.dn = function(a10, b10) { + return a10 instanceof rB ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.nn(a10); + }; + d7.Wa = function(a10, b10) { + return this.dn(a10, b10); + }; + d7.nn = function(a10) { + return a10 instanceof rB; + }; + d7.$classData = r8({ w1a: 0 }, false, "amf.plugins.domain.webapi.resolution.ExtendsHelper$$anonfun$$nestedInanonfun$annotateExtensionId$1$1", { w1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Hqa() { + } + Hqa.prototype = new y_(); + Hqa.prototype.constructor = Hqa; + d7 = Hqa.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof Es; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Es ? Od(O7(), a10.Aa) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ x1a: 0 }, false, "amf.plugins.domain.webapi.resolution.ExtendsHelper$$anonfun$$nestedInanonfun$asEndpoint$3$1", { x1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Eqa() { + } + Eqa.prototype = new y_(); + Eqa.prototype.constructor = Eqa; + d7 = Eqa.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof Es; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Es ? Od(O7(), a10.Aa) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ y1a: 0 }, false, "amf.plugins.domain.webapi.resolution.ExtendsHelper$$anonfun$$nestedInanonfun$asOperation$3$1", { y1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function yqa() { + this.qT = null; + } + yqa.prototype = new y_(); + yqa.prototype.constructor = yqa; + d7 = yqa.prototype; + d7.Sa = function(a10) { + return this.bm(a10); + }; + d7.e = function(a10) { + this.qT = a10; + return this; + }; + d7.Wa = function(a10, b10) { + return this.Wl(a10, b10); + }; + d7.Wl = function(a10, b10) { + return a10 instanceof bg && ar(a10.g, Af().Ic).Od(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return e10.j === c10.qT; + }; + }(this))) || Kk(a10) && a10.qe().j === this.qT ? (b10 = Lc(a10), b10.b() ? a10.j : b10.c()) : b10.P(a10); + }; + d7.bm = function(a10) { + return a10 instanceof bg && ar(a10.g, Af().Ic).Od(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return c10.j === b10.qT; + }; + }(this))) || Kk(a10) && a10.qe().j === this.qT ? true : false; + }; + d7.$classData = r8({ z1a: 0 }, false, "amf.plugins.domain.webapi.resolution.ExtendsHelper$$anonfun$findUnitLocationOfElement$1", { z1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Lqa() { + } + Lqa.prototype = new y_(); + Lqa.prototype.constructor = Lqa; + d7 = Lqa.prototype; + d7.a = function() { + return this; + }; + d7.Uaa = function(a10) { + return a10 instanceof Vi; + }; + d7.d9 = function(a10, b10) { + return a10 instanceof Vi ? B6(a10.aa, Wi().vf) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.Uaa(a10); + }; + d7.Wa = function(a10, b10) { + return this.d9(a10, b10); + }; + d7.$classData = r8({ B1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.DataNodeMerging$$anonfun$1", { B1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Gfb() { + this.nfa = null; + } + Gfb.prototype = new y_(); + Gfb.prototype.constructor = Gfb; + d7 = Gfb.prototype; + d7.Uaa = function(a10) { + if (a10 instanceof Vi) { + a10 = B6(a10.aa, Wi().vf).A; + var b10 = B6(this.nfa.aa, Wi().vf).A; + if (a10.Ha(b10.b() ? "" : b10.c())) + return true; + } + return false; + }; + d7.d9 = function(a10, b10) { + if (a10 instanceof Vi) { + var c10 = B6(a10.aa, Wi().vf).A, e10 = B6(this.nfa.aa, Wi().vf).A; + if (c10.Ha(e10.b() ? "" : e10.c())) + return a10; + } + return b10.P(a10); + }; + function y8a(a10) { + var b10 = new Gfb(); + b10.nfa = a10; + return b10; + } + d7.Sa = function(a10) { + return this.Uaa(a10); + }; + d7.Wa = function(a10, b10) { + return this.d9(a10, b10); + }; + d7.$classData = r8({ D1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.DomainElementMerging$$anonfun$$nestedInanonfun$mergeDataNodes$1$1", { D1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function MIa() { + } + MIa.prototype = new y_(); + MIa.prototype.constructor = MIa; + d7 = MIa.prototype; + d7.Rg = function(a10, b10) { + if (a10 instanceof Wl) { + b10 = B6(a10.g, cj().Ne); + var c10 = K7(); + return b10.yg(a10, c10.u); + } + return a10 instanceof Bm ? B6(a10.g, zD().Ne) : a10 instanceof Em ? B6(a10.g, zD().Ne) : b10.P(a10); + }; + d7.Sg = function(a10) { + return a10 instanceof Wl || a10 instanceof Bm || a10 instanceof Em; + }; + d7.Sa = function(a10) { + return this.Sg(a10); + }; + d7.Wa = function(a10, b10) { + return this.Rg(a10, b10); + }; + d7.$classData = r8({ K1a: 0 }, false, "amf.plugins.domain.webapi.resolution.stages.PayloadAndParameterResolutionStage$$anonfun$searchDeclarations$1", { K1a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function BD() { + this.AW = this.gC = this.PT = this.zW = this.ah = this.Ld = null; + } + BD.prototype = new u7(); + BD.prototype.constructor = BD; + d7 = BD.prototype; + d7.H = function() { + return "CustomValidationResult"; + }; + d7.Y2 = function() { + return this.gC; + }; + d7.E = function() { + return 6; + }; + d7.TB = function() { + return this.ah; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof BD) { + var b10 = this.Ld, c10 = a10.Ld; + return (null === b10 ? null === c10 : b10.h(c10)) && this.ah === a10.ah && this.zW === a10.zW && this.PT === a10.PT && this.gC === a10.gC ? this.AW === a10.AW : false; + } + return false; + }; + d7.xL = function() { + return this.Ld; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ld; + case 1: + return this.ah; + case 2: + return this.zW; + case 3: + return this.PT; + case 4: + return this.gC; + case 5: + return this.AW; + default: + throw new U6().e("" + a10); + } + }; + d7.d3 = function() { + return this.zW; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rO = function() { + return this.PT; + }; + function Yqa(a10, b10, c10, e10, f10, g10, h10) { + a10.Ld = b10; + a10.ah = c10; + a10.zW = e10; + a10.PT = f10; + a10.gC = g10; + a10.AW = h10; + return a10; + } + d7.Ev = function() { + return this.AW; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ S1a: 0 }, false, "amf.plugins.features.validation.CustomValidationResult", { S1a: 1, f: 1, ADa: 1, y: 1, v: 1, q: 1, o: 1 }); + function aZa() { + } + aZa.prototype = new y_(); + aZa.prototype.constructor = aZa; + d7 = aZa.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof kG; + }; + d7.fk = function(a10, b10) { + return a10 instanceof kG ? a10.xE : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ p2a: 0 }, false, "amf.plugins.syntax.SYamlSyntaxPlugin$$anonfun$1", { p2a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function bZa() { + } + bZa.prototype = new y_(); + bZa.prototype.constructor = bZa; + d7 = bZa.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof RA; + }; + d7.fk = function(a10, b10) { + return a10 instanceof RA ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ q2a: 0 }, false, "amf.plugins.syntax.SYamlSyntaxPlugin$$anonfun$2", { q2a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function Wq() { + this.IS = null; + } + Wq.prototype = new T8a(); + Wq.prototype.constructor = Wq; + d7 = Wq.prototype; + d7.a = function() { + Hp.prototype.Uj.call(this, y7()); + this.IS = new Pj().a(); + return this; + }; + d7.t = function() { + return this.IS.t(); + }; + d7.xS = function(a10) { + CJa(this.IS, a10); + }; + d7.US = function() { + }; + d7.$classData = r8({ y2a: 0 }, false, "java.io.StringWriter", { y2a: 1, lhb: 1, f: 1, SU: 1, ZY: 1, eba: 1, w7: 1 }); + function x62() { + KE.call(this); + this.bj = null; + this.Mk = 0; + } + x62.prototype = new qsa(); + x62.prototype.constructor = x62; + function Hfb() { + } + d7 = Hfb.prototype = x62.prototype; + d7.h = function(a10) { + return a10 instanceof x62 ? 0 === Ifb(this, a10) : false; + }; + d7.t = function() { + if (null !== this.bj) + return Nsa(ua(), this.bj, this.ud + this.Mk | 0, this.Ze - this.ud | 0); + var a10 = ja(Ja(Na), [this.Ze - this.ud | 0]), b10 = this.ud; + this.Ska(a10, 0, a10.n.length); + KE.prototype.qg.call(this, b10); + return Nsa(ua(), a10, 0, a10.n.length); + }; + d7.tr = function(a10) { + return Ifb(this, a10); + }; + d7.xS = function(a10) { + Fsa(this, ka(a10)); + }; + function Fsa(a10, b10) { + var c10 = b10.length | 0; + b10 = vsa(zsa(), b10, c10); + if (b10 === a10) + throw new Zj().a(); + if (a10.hH()) + throw new VE().a(); + c10 = b10.Ze; + var e10 = b10.ud, f10 = c10 - e10 | 0, g10 = a10.ud, h10 = g10 + f10 | 0; + if (h10 > a10.Ze) + throw new RE().a(); + a10.ud = h10; + KE.prototype.qg.call(b10, c10); + h10 = b10.bj; + if (null !== h10) + a10.cqa(g10, h10, b10.Mk + e10 | 0, f10); + else + for (; e10 !== c10; ) + f10 = g10, h10 = b10.aV(e10), a10.dqa(f10, h10), e10 = 1 + e10 | 0, g10 = 1 + g10 | 0; + } + d7.Oa = function() { + return this.Ze - this.ud | 0; + }; + function Ifb(a10, b10) { + if (a10 === b10) + return 0; + for (var c10 = a10.ud, e10 = a10.Ze - c10 | 0, f10 = b10.ud, g10 = b10.Ze - f10 | 0, h10 = e10 < g10 ? e10 : g10, k10 = 0; k10 !== h10; ) { + var l10 = a10.aV(c10 + k10 | 0), m10 = b10.aV(f10 + k10 | 0); + l10 = l10 - m10 | 0; + if (0 !== l10) + return l10; + k10 = 1 + k10 | 0; + } + return e10 === g10 ? 0 : e10 < g10 ? -1 : 1; + } + d7.cla = function(a10, b10, c10) { + this.bj = b10; + this.Mk = c10; + KE.prototype.ue.call(this, a10); + }; + d7.z = function() { + for (var a10 = this.ud, b10 = this.Ze, c10 = -182887236, e10 = a10; e10 !== b10; ) { + var f10 = MJ(); + OJ(); + var g10 = this.aV(e10); + c10 = f10.Ga(c10, NJ(0, gc(g10))); + e10 = 1 + e10 | 0; + } + return MJ().fe(c10, b10 - a10 | 0); + }; + d7.Hz = function(a10) { + return this.Tka(this.ud + a10 | 0); + }; + function VE() { + CF.call(this); + } + VE.prototype = new e9a(); + VE.prototype.constructor = VE; + VE.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + VE.prototype.$classData = r8({ Q2a: 0 }, false, "java.nio.ReadOnlyBufferException", { Q2a: 1, Mma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function XE() { + CF.call(this); + this.JU = 0; + } + XE.prototype = new V8a(); + XE.prototype.constructor = XE; + XE.prototype.xo = function() { + return "Input length = " + this.JU; + }; + XE.prototype.ue = function(a10) { + this.JU = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + XE.prototype.$classData = r8({ Z2a: 0 }, false, "java.nio.charset.MalformedInputException", { Z2a: 1, T2a: 1, x7: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function YE() { + CF.call(this); + this.JU = 0; + } + YE.prototype = new V8a(); + YE.prototype.constructor = YE; + YE.prototype.xo = function() { + return "Input length = " + this.JU; + }; + YE.prototype.ue = function(a10) { + this.JU = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + YE.prototype.$classData = r8({ c3a: 0 }, false, "java.nio.charset.UnmappableCharacterException", { c3a: 1, T2a: 1, x7: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function VSa() { + this.oP = this.r = null; + } + VSa.prototype = new u7(); + VSa.prototype.constructor = VSa; + d7 = VSa.prototype; + d7.Hc = function(a10, b10) { + this.r = a10; + this.oP = b10; + return this; + }; + d7.H = function() { + return "FormatError"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof VSa ? this.r === a10.r && this.oP === a10.oP : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + case 1: + return this.oP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.wba = function() { + var a10 = this.oP; + if (null === a10) + throw new sf().a(); + return "Format Error" + ("" === a10 ? "" : " (" + this.oP + ")") + " in '" + this.r + "'"; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ p3a: 0 }, false, "org.mulesoft.common.parse.FormatError", { p3a: 1, f: 1, q3a: 1, y: 1, v: 1, q: 1, o: 1 }); + function QZ() { + this.r = 0; + } + QZ.prototype = new u7(); + QZ.prototype.constructor = QZ; + d7 = QZ.prototype; + d7.H = function() { + return "RangeError"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof QZ ? this.r === a10.r : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ue = function(a10) { + this.r = a10; + return this; + }; + d7.wba = function() { + return "Value '" + this.r + "' out of range"; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.r); + return OJ().fe(a10, 1); + }; + d7.$classData = r8({ t3a: 0 }, false, "org.mulesoft.common.parse.RangeError", { t3a: 1, f: 1, q3a: 1, y: 1, v: 1, q: 1, o: 1 }); + function Jfb() { + this.fc = this.As = this.Ij = this.cf = this.Dg = 0; + } + Jfb.prototype = new u7(); + Jfb.prototype.constructor = Jfb; + d7 = Jfb.prototype; + d7.H = function() { + return "InputState"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Jfb ? this.Dg === a10.Dg && this.cf === a10.cf && this.Ij === a10.Ij && this.As === a10.As && this.fc === a10.fc : false; + }; + function oS(a10, b10, c10) { + 10 === a10.fc ? (a10.Dg = 0, a10.cf = 1 + a10.cf | 0) : a10.Dg = a10.Dg + (a10.As - a10.Ij | 0) | 0; + a10.Ij = a10.As; + if (a10.Ij >= c10) + a10.fc = rF().Xs; + else { + var e10 = xa(b10, a10.Ij); + a10.As = 1 + a10.As | 0; + if (55296 === (64512 & e10) && a10.As < c10 && (b10 = xa(b10, a10.As), 56320 === (64512 & b10))) { + a10.As = 1 + a10.As | 0; + a10.fc = 65536 + (((1023 & e10) << 10) + (1023 & b10) | 0) | 0; + return; + } + a10.fc = e10; + } + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Dg; + case 1: + return this.cf; + case 2: + return this.Ij; + case 3: + return this.As; + case 4: + return this.fc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function VZ(a10) { + return a10.fc !== rF().Xs; + } + function JJa(a10, b10, c10, e10, f10) { + var g10 = new Jfb(); + g10.Dg = a10; + g10.cf = b10; + g10.Ij = c10; + g10.As = e10; + g10.fc = f10; + return g10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.Dg); + a10 = OJ().Ga(a10, this.cf); + a10 = OJ().Ga(a10, this.Ij); + a10 = OJ().Ga(a10, this.As); + a10 = OJ().Ga(a10, this.fc); + return OJ().fe(a10, 5); + }; + d7.$classData = r8({ D3a: 0 }, false, "org.mulesoft.lexer.CharSequenceLexerInput$InputState", { D3a: 1, f: 1, whb: 1, y: 1, v: 1, q: 1, o: 1 }); + function Kfb() { + } + Kfb.prototype = new u7(); + Kfb.prototype.constructor = Kfb; + d7 = Kfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "Bool"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "Bool"; + }; + d7.z = function() { + return 2076426; + }; + d7.$classData = r8({ Q3a: 0 }, false, "org.yaml.builder.DocBuilder$SType$Bool$", { Q3a: 1, f: 1, y7: 1, y: 1, v: 1, q: 1, o: 1 }); + var Lfb = void 0; + function AN() { + Lfb || (Lfb = new Kfb().a()); + return Lfb; + } + function Mfb() { + } + Mfb.prototype = new u7(); + Mfb.prototype.constructor = Mfb; + d7 = Mfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "Float"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "Float"; + }; + d7.z = function() { + return 67973692; + }; + d7.$classData = r8({ R3a: 0 }, false, "org.yaml.builder.DocBuilder$SType$Float$", { R3a: 1, f: 1, y7: 1, y: 1, v: 1, q: 1, o: 1 }); + var Nfb = void 0; + function CN2() { + Nfb || (Nfb = new Mfb().a()); + return Nfb; + } + function Ofb() { + } + Ofb.prototype = new u7(); + Ofb.prototype.constructor = Ofb; + d7 = Ofb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "Int"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "Int"; + }; + d7.z = function() { + return 73679; + }; + d7.$classData = r8({ S3a: 0 }, false, "org.yaml.builder.DocBuilder$SType$Int$", { S3a: 1, f: 1, y7: 1, y: 1, v: 1, q: 1, o: 1 }); + var Pfb = void 0; + function BN() { + Pfb || (Pfb = new Ofb().a()); + return Pfb; + } + function Qfb() { + } + Qfb.prototype = new u7(); + Qfb.prototype.constructor = Qfb; + d7 = Qfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "Str"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "Str"; + }; + d7.z = function() { + return 83473; + }; + d7.$classData = r8({ T3a: 0 }, false, "org.yaml.builder.DocBuilder$SType$Str$", { T3a: 1, f: 1, y7: 1, y: 1, v: 1, q: 1, o: 1 }); + var Rfb = void 0; + function FF() { + Rfb || (Rfb = new Qfb().a()); + return Rfb; + } + function Sfb() { + } + Sfb.prototype = new QF(); + Sfb.prototype.constructor = Sfb; + d7 = Sfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "BlockIn"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "BlockIn"; + }; + d7.z = function() { + return 1643214450; + }; + d7.$classData = r8({ r4a: 0 }, false, "org.yaml.lexer.BlockIn$", { r4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Tfb = void 0; + function a_() { + Tfb || (Tfb = new Sfb().a()); + return Tfb; + } + function Ufb() { + } + Ufb.prototype = new QF(); + Ufb.prototype.constructor = Ufb; + d7 = Ufb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "BlockKey"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "BlockKey"; + }; + d7.z = function() { + return -599957838; + }; + d7.$classData = r8({ s4a: 0 }, false, "org.yaml.lexer.BlockKey$", { s4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Vfb = void 0; + function g_() { + Vfb || (Vfb = new Ufb().a()); + return Vfb; + } + function Wfb() { + } + Wfb.prototype = new QF(); + Wfb.prototype.constructor = Wfb; + d7 = Wfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "BlockOut"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "BlockOut"; + }; + d7.z = function() { + return -599953503; + }; + d7.$classData = r8({ t4a: 0 }, false, "org.yaml.lexer.BlockOut$", { t4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Xfb = void 0; + function VTa() { + Xfb || (Xfb = new Wfb().a()); + return Xfb; + } + function Yfb() { + } + Yfb.prototype = new QF(); + Yfb.prototype.constructor = Yfb; + d7 = Yfb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "FlowIn"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "FlowIn"; + }; + d7.z = function() { + return 2107204371; + }; + d7.$classData = r8({ u4a: 0 }, false, "org.yaml.lexer.FlowIn$", { u4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var Zfb = void 0; + function HTa() { + Zfb || (Zfb = new Yfb().a()); + return Zfb; + } + function $fb() { + } + $fb.prototype = new QF(); + $fb.prototype.constructor = $fb; + d7 = $fb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "FlowKey"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "FlowKey"; + }; + d7.z = function() { + return 898827825; + }; + d7.$classData = r8({ v4a: 0 }, false, "org.yaml.lexer.FlowKey$", { v4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var agb = void 0; + function d_() { + agb || (agb = new $fb().a()); + return agb; + } + function bgb() { + } + bgb.prototype = new QF(); + bgb.prototype.constructor = bgb; + d7 = bgb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "FlowOut"; + }; + d7.E = function() { + return 0; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "FlowOut"; + }; + d7.z = function() { + return 898832160; + }; + d7.$classData = r8({ w4a: 0 }, false, "org.yaml.lexer.FlowOut$", { w4a: 1, aS: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var cgb = void 0; + function GTa() { + cgb || (cgb = new bgb().a()); + return cgb; + } + function jZa() { + } + jZa.prototype = new y_(); + jZa.prototype.constructor = jZa; + d7 = jZa.prototype; + d7.wk = function(a10) { + return a10 instanceof Cs; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Cs ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ $4a: 0 }, false, "org.yaml.model.YDocument$$anonfun$1", { $4a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function kZa() { + } + kZa.prototype = new y_(); + kZa.prototype.constructor = kZa; + d7 = kZa.prototype; + d7.wk = function(a10) { + return a10 instanceof kG; + }; + d7.fk = function(a10, b10) { + return a10 instanceof kG ? a10.xE : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ a5a: 0 }, false, "org.yaml.model.YDocument$$anonfun$2", { a5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function lZa() { + } + lZa.prototype = new y_(); + lZa.prototype.constructor = lZa; + d7 = lZa.prototype; + d7.wk = function(a10) { + return a10 instanceof Es; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Es ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.W = function() { + return this; + }; + d7.$classData = r8({ m5a: 0 }, false, "org.yaml.model.YMap$$anonfun$1", { m5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function cua() { + } + cua.prototype = new y_(); + cua.prototype.constructor = cua; + d7 = cua.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof Cs; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Cs ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ p5a: 0 }, false, "org.yaml.model.YMapEntry$$anonfun$2", { p5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function HKa() { + } + HKa.prototype = new y_(); + HKa.prototype.constructor = HKa; + d7 = HKa.prototype; + d7.a = function() { + return this; + }; + d7.wk = function(a10) { + return a10 instanceof Cs; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Cs ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ q5a: 0 }, false, "org.yaml.model.YMapEntry$$anonfun$3", { q5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function LH() { + KH.call(this); + this.Gv = this.ona = null; + } + LH.prototype = new Z8a(); + LH.prototype.constructor = LH; + LH.prototype.t = function() { + return "*" + this.ona; + }; + LH.prototype.hb = function() { + return this.Gv.hb(); + }; + LH.prototype.re = function() { + return this.Gv.re(); + }; + LH.prototype.$classData = r8({ s5a: 0 }, false, "org.yaml.model.YNode$Alias", { s5a: 1, u5a: 1, aZ: 1, $s: 1, f: 1, oJ: 1, $A: 1 }); + function uG() { + KH.call(this); + this.Gv = this.cca = this.DV = null; + } + uG.prototype = new Z8a(); + uG.prototype.constructor = uG; + function jua(a10, b10, c10, e10, f10) { + a10.DV = b10; + a10.cca = c10; + KH.prototype.Ac.call(a10, e10, f10); + a10.Gv = y7(); + return a10; + } + uG.prototype.hb = function() { + var a10 = this.Gv; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.hb())); + return a10.b() ? this.cca : a10.c(); + }; + uG.prototype.re = function() { + var a10 = this.Gv; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.re())); + return a10.b() ? this.DV : a10.c(); + }; + uG.prototype.$classData = r8({ t5a: 0 }, false, "org.yaml.model.YNode$MutRef", { t5a: 1, u5a: 1, aZ: 1, $s: 1, f: 1, oJ: 1, $A: 1 }); + function pZa() { + } + pZa.prototype = new y_(); + pZa.prototype.constructor = pZa; + d7 = pZa.prototype; + d7.wk = function(a10) { + return a10 instanceof Cs; + }; + d7.fk = function(a10, b10) { + return a10 instanceof Cs ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ E5a: 0 }, false, "org.yaml.model.YSequence$$anonfun$1", { E5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function QS() { + this.l = null; + } + QS.prototype = new u7(); + QS.prototype.constructor = QS; + d7 = QS.prototype; + d7.H = function() { + return "MapEntryParser"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof QS && a10.l === this.l && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SO = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + this.l.sn.hz(); + kKa(this.l); + var a10 = AKa(this.l); + if (!a10) { + vKa(this.l); + for (var b10 = this.l, c10 = [VF().Ai, VF().wx]; ; ) { + if (pKa(b10)) + g10 = false; + else { + g10 = LS(b10); + for (var e10 = 0; ; ) { + if (e10 < (c10.length | 0)) { + var f10 = c10[e10]; + f10 = false === Va(Wa(), f10, g10); + } else + f10 = false; + if (f10) + e10 = 1 + e10 | 0; + else + break; + } + var g10 = e10 === (c10.length | 0); + } + if (g10) + NS(b10); + else + break; + } + } + if (a10 || rKa(this.l, VF().Ai, ":")) { + qKa(this.l, VF().Ai, ":") && (NS(this.l), CKa(this.l), this.l.sn.hz()); + if (b10 = mKa(this.l)) + this.l.sn.hz(); + else + for (vKa(this.l), c10 = this.l, g10 = [VF().Ai, VF().wx]; ; ) { + if (pKa(c10)) + e10 = false; + else { + e10 = LS(c10); + for (f10 = 0; ; ) { + if (f10 < (g10.length | 0)) { + var h10 = g10[f10]; + h10 = false === Va(Wa(), h10, e10); + } else + h10 = false; + if (h10) + f10 = 1 + f10 | 0; + else + break; + } + e10 = f10 === (g10.length | 0); + } + if (e10) + NS(c10); + else + break; + } + a10 = !!(a10 & b10); + } else { + a10 = this.l; + for (b10 = [new R6().M(VF().Ai, new z7().d(",")), new R6().M(VF().wx, y7())]; ; ) { + if (pKa(a10)) + c10 = false; + else { + for (c10 = 0; ; ) + if (c10 < (b10.length | 0) && false === EKa(a10, b10[c10])) + c10 = 1 + c10 | 0; + else + break; + c10 = c10 === (b10.length | 0); + } + if (c10) + NS(a10); + else + break; + } + a10 = false; + } + a10 ? (a10 = this.l.sn.eu(), uKa(this.l, vD(wD(), mD(Gb(), a10)))) : (this.l.sn.eu(), nKa(this.l)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ O5a: 0 }, false, "org.yaml.parser.JsonParser$MapEntryParser", { O5a: 1, f: 1, M5a: 1, y: 1, v: 1, q: 1, o: 1 }); + function PS() { + this.l = null; + } + PS.prototype = new u7(); + PS.prototype.constructor = PS; + d7 = PS.prototype; + d7.H = function() { + return "SequenceValueParser"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof PS && a10.l === this.l && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.SO = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.hd = function() { + if (!mKa(this.l)) { + vKa(this.l); + for (var a10 = this.l, b10 = [new R6().M(VF().Ai, new z7().d(",")), new R6().M(VF().ZC, y7())]; ; ) { + if (pKa(a10)) + c10 = false; + else { + for (c10 = 0; ; ) + if (c10 < (b10.length | 0) && false === EKa(a10, b10[c10])) + c10 = 1 + c10 | 0; + else + break; + var c10 = c10 === (b10.length | 0); + } + if (c10) + NS(a10); + else + break; + } + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ P5a: 0 }, false, "org.yaml.parser.JsonParser$SequenceValueParser", { P5a: 1, f: 1, M5a: 1, y: 1, v: 1, q: 1, o: 1 }); + function GKa() { + this.Fa = null; + } + GKa.prototype = new y_(); + GKa.prototype.constructor = GKa; + d7 = GKa.prototype; + d7.wk = function(a10) { + return a10 instanceof OG; + }; + d7.fk = function(a10, b10) { + return a10 instanceof OG ? Dg(this.Fa.CV, a10.va) : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ $5a: 0 }, false, "org.yaml.parser.YamlLoader$DirectiveBuilder$$anonfun$create$3", { $5a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function IKa() { + } + IKa.prototype = new y_(); + IKa.prototype.constructor = IKa; + d7 = IKa.prototype; + d7.wk = function(a10) { + return a10 instanceof RA; + }; + d7.fk = function(a10, b10) { + return a10 instanceof RA ? a10 : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ l6a: 0 }, false, "org.yaml.parser.YamlParser$$anonfun$1", { l6a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function xva() { + } + xva.prototype = new y_(); + xva.prototype.constructor = xva; + d7 = xva.prototype; + d7.wk = function(a10) { + return a10 instanceof kG; + }; + d7.fk = function(a10, b10) { + return a10 instanceof kG ? " #" + a10.xE : b10.P(a10); + }; + d7.Sa = function(a10) { + return this.wk(a10); + }; + d7.Wa = function(a10, b10) { + return this.fk(a10, b10); + }; + d7.$classData = r8({ s6a: 0 }, false, "org.yaml.render.YamlRender$$anonfun$1", { s6a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function R6() { + this.hr = this.Tp = null; + } + R6.prototype = new u7(); + R6.prototype.constructor = R6; + function dgb() { + } + d7 = dgb.prototype = R6.prototype; + d7.H = function() { + return "Tuple2"; + }; + d7.JM = function() { + return this.ma() | 0; + }; + d7.a5 = function() { + var a10 = this.ya(); + return null === a10 ? 0 : a10.r; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof R6 ? Va(Wa(), this.ma(), a10.ma()) && Va(Wa(), this.ya(), a10.ya()) : false; + }; + d7.G = function(a10) { + a: + switch (a10) { + case 0: + a10 = this.ma(); + break a; + case 1: + a10 = this.ya(); + break a; + default: + throw new U6().e("" + a10); + } + return a10; + }; + d7.vfa = function() { + return +this.ma(); + }; + d7.M = function(a10, b10) { + this.Tp = a10; + this.hr = b10; + return this; + }; + d7.t = function() { + return "(" + this.ma() + "," + this.ya() + ")"; + }; + d7.wfa = function() { + return +this.ya(); + }; + d7.ya = function() { + return this.hr; + }; + d7.Ki = function() { + return this.ya() | 0; + }; + d7.z = function() { + return X5(this); + }; + d7.ma = function() { + return this.Tp; + }; + var hXa = r8({ d_: 0 }, false, "scala.Tuple2", { d_: 1, f: 1, tda: 1, y: 1, v: 1, q: 1, o: 1 }); + R6.prototype.$classData = hXa; + function Hd() { + this.Ih = this.Ag = this.Uo = null; + } + Hd.prototype = new u7(); + Hd.prototype.constructor = Hd; + d7 = Hd.prototype; + d7.H = function() { + return "Tuple3"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Hd ? Va(Wa(), this.Uo, a10.Uo) && Va(Wa(), this.Ag, a10.Ag) && Va(Wa(), this.Ih, a10.Ih) : false; + }; + d7.G = function(a10) { + a: + switch (a10) { + case 0: + a10 = this.Uo; + break a; + case 1: + a10 = this.Ag; + break a; + case 2: + a10 = this.Ih; + break a; + default: + throw new U6().e("" + a10); + } + return a10; + }; + d7.t = function() { + return "(" + this.Uo + "," + this.Ag + "," + this.Ih + ")"; + }; + d7.Dr = function(a10, b10, c10) { + this.Uo = a10; + this.Ag = b10; + this.Ih = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Q6a: 0 }, false, "scala.Tuple3", { Q6a: 1, f: 1, Nhb: 1, y: 1, v: 1, q: 1, o: 1 }); + function y62() { + this.KM = this.Ih = this.Ag = this.Uo = null; + } + y62.prototype = new u7(); + y62.prototype.constructor = y62; + d7 = y62.prototype; + d7.H = function() { + return "Tuple4"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof y62 ? Va(Wa(), this.Uo, a10.Uo) && Va(Wa(), this.Ag, a10.Ag) && Va(Wa(), this.Ih, a10.Ih) && Va(Wa(), this.KM, a10.KM) : false; + }; + d7.G = function(a10) { + return UKa(this, a10); + }; + d7.t = function() { + return "(" + this.Uo + "," + this.Ag + "," + this.Ih + "," + this.KM + ")"; + }; + d7.dA = function(a10, b10, c10, e10) { + this.Uo = a10; + this.Ag = b10; + this.Ih = c10; + this.KM = e10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ R6a: 0 }, false, "scala.Tuple4", { R6a: 1, f: 1, Ohb: 1, y: 1, v: 1, q: 1, o: 1 }); + function dH() { + CF.call(this); + } + dH.prototype = new a9a(); + dH.prototype.constructor = dH; + dH.prototype.e = function(a10) { + CF.prototype.Ge.call(this, a10, null); + return this; + }; + dH.prototype.$classData = r8({ T7a: 0 }, false, "java.lang.NumberFormatException", { T7a: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function Mv() { + CF.call(this); + } + Mv.prototype = new c9a(); + Mv.prototype.constructor = Mv; + Mv.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + Mv.prototype.ue = function(a10) { + CF.prototype.Ge.call(this, "String index out of range: " + a10, null); + return this; + }; + Mv.prototype.$classData = r8({ Z7a: 0 }, false, "java.lang.StringIndexOutOfBoundsException", { Z7a: 1, Kma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function nF() { + this.vr = null; + } + nF.prototype = new u7(); + nF.prototype.constructor = nF; + d7 = nF.prototype; + d7.a = function() { + nF.prototype.jma.call(this, new ba.Date()); + return this; + }; + function Bga() { + var a10 = new nF().a(), b10 = Ea(); + a10 = +a10.vr.getTime(); + a10 = Zsa(b10, a10); + return new qa().Sc(a10, b10.Wj); + } + d7.O$ = function(a10) { + nF.prototype.jma.call(this, new ba.Date(SD(Ea(), a10.od, a10.Ud))); + return this; + }; + d7.h = function(a10) { + return a10 instanceof nF ? +a10.vr.getTime() === +this.vr.getTime() : false; + }; + d7.tr = function(a10) { + return saa(va(), +this.vr.getTime(), +a10.vr.getTime()); + }; + d7.t = function() { + this.vr.getTimezoneOffset(); + p_(); + p_(); + return p_().Dma.n[this.vr.getDay() | 0] + " " + p_().Ema.n[this.vr.getMonth() | 0] + " " + rVa(p_(), this.vr.getDate() | 0) + " " + rVa(p_(), this.vr.getHours() | 0) + ":" + rVa(p_(), this.vr.getMinutes() | 0) + ":" + rVa(p_(), this.vr.getSeconds() | 0) + " GMT " + (this.vr.getFullYear() | 0); + }; + d7.jma = function(a10) { + this.vr = a10; + }; + d7.z = function() { + var a10 = +this.vr.getTime(); + return oaa(paa(), a10); + }; + d7.$classData = r8({ g8a: 0 }, false, "java.util.Date", { g8a: 1, f: 1, q: 1, o: 1, em: 1, Jl: 1, ym: 1 }); + function RK() { + CF.call(this); + } + RK.prototype = new b9a(); + RK.prototype.constructor = RK; + RK.prototype.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + RK.prototype.$classData = r8({ m8a: 0 }, false, "java.util.FormatterClosedException", { m8a: 1, Jma: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function egb() { + CF.call(this); + } + egb.prototype = new a9a(); + egb.prototype.constructor = egb; + function z6() { + } + z6.prototype = egb.prototype; + function NI() { + this.Xf = null; + } + NI.prototype = new u7(); + NI.prototype.constructor = NI; + d7 = NI.prototype; + d7.H = function() { + return "DisjunctNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NI) { + var b10 = this.Xf; + a10 = a10.Xf; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ts = function(a10) { + this.Xf = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ B8a: 0 }, false, "java.util.regex.GroupStartMap$DisjunctNode", { B8a: 1, f: 1, Oma: 1, y: 1, v: 1, q: 1, o: 1 }); + function HI() { + this.RB = 0; + } + HI.prototype = new u7(); + HI.prototype.constructor = HI; + d7 = HI.prototype; + d7.H = function() { + return "OriginallyGroupped"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof HI ? this.RB === a10.RB : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.RB; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ue = function(a10) { + this.RB = a10; + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.RB); + return OJ().fe(a10, 1); + }; + d7.$classData = r8({ F8a: 0 }, false, "java.util.regex.GroupStartMap$OriginallyGroupped", { F8a: 1, f: 1, E8a: 1, y: 1, v: 1, q: 1, o: 1 }); + function EI() { + this.$B = this.LB = null; + } + EI.prototype = new u7(); + EI.prototype.constructor = EI; + d7 = EI.prototype; + d7.Hc = function(a10, b10) { + this.LB = a10; + this.$B = b10; + return this; + }; + d7.H = function() { + return "OriginallyWrapped"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof EI ? this.LB === a10.LB && this.$B === a10.$B : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.LB; + case 1: + return this.$B; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ G8a: 0 }, false, "java.util.regex.GroupStartMap$OriginallyWrapped", { G8a: 1, f: 1, E8a: 1, y: 1, v: 1, q: 1, o: 1 }); + function II() { + this.Xf = null; + } + II.prototype = new u7(); + II.prototype.constructor = II; + d7 = II.prototype; + d7.H = function() { + return "ParentNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof II) { + var b10 = this.Xf; + a10 = a10.Xf; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ts = function(a10) { + this.Xf = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ K8a: 0 }, false, "java.util.regex.GroupStartMap$ParentNode", { K8a: 1, f: 1, Oma: 1, y: 1, v: 1, q: 1, o: 1 }); + function FI() { + this.LH = null; + } + FI.prototype = new u7(); + FI.prototype.constructor = FI; + d7 = FI.prototype; + d7.H = function() { + return "RegexLeaf"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof FI ? this.LH === a10.LH : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.LH; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.LH = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ L8a: 0 }, false, "java.util.regex.GroupStartMap$RegexLeaf", { L8a: 1, f: 1, Oma: 1, y: 1, v: 1, q: 1, o: 1 }); + function fgb() { + O42.call(this); + this.vk = 0; + this.de = null; + } + fgb.prototype = new f9a(); + fgb.prototype.constructor = fgb; + fgb.prototype.t = function() { + return null !== this.de ? this.de : ""; + }; + function DYa(a10, b10, c10) { + var e10 = new fgb(); + e10.vk = b10; + e10.de = c10; + O42.prototype.x7a.call(e10, a10); + if (a10.Cda.Ha(b10)) + throw new uK().d("assertion failed: Duplicate id: " + e10.vk); + a10.Cda.jm(b10, e10); + a10.mpa = false; + a10.DE = 1 + b10 | 0; + a10.DE > a10.Bda && (a10.Bda = a10.DE); + b10 < a10.zda && (a10.zda = b10); + return e10; + } + fgb.prototype.$classData = r8({ U8a: 0 }, false, "scala.Enumeration$Val", { U8a: 1, Ghb: 1, f: 1, cM: 1, ym: 1, q: 1, o: 1 }); + function ggb() { + } + ggb.prototype = new g9a(); + ggb.prototype.constructor = ggb; + d7 = ggb.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "None"; + }; + d7.E = function() { + return 0; + }; + d7.b = function() { + return true; + }; + d7.c = function() { + throw new iL().e("None.get"); + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return "None"; + }; + d7.z = function() { + return 2433880; + }; + d7.$classData = r8({ X8a: 0 }, false, "scala.None$", { X8a: 1, Z8a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + var hgb = void 0; + function y7() { + hgb || (hgb = new ggb().a()); + return hgb; + } + function $I() { + } + $I.prototype = new y_(); + $I.prototype.constructor = $I; + $I.prototype.a = function() { + return this; + }; + $I.prototype.Sa = function() { + return true; + }; + $I.prototype.Wa = function() { + return XI().NP; + }; + $I.prototype.$classData = r8({ c9a: 0 }, false, "scala.PartialFunction$$anonfun$1", { c9a: 1, fb: 1, f: 1, za: 1, Ea: 1, q: 1, o: 1 }); + function z7() { + this.i = null; + } + z7.prototype = new g9a(); + z7.prototype.constructor = z7; + d7 = z7.prototype; + d7.H = function() { + return "Some"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof z7 ? Va(Wa(), this.i, a10.i) : false; + }; + d7.b = function() { + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.i; + default: + throw new U6().e("" + a10); + } + }; + d7.c = function() { + return this.i; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.d = function(a10) { + this.i = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ j9a: 0 }, false, "scala.Some", { j9a: 1, Z8a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function qxa() { + this.Hu = null; + } + qxa.prototype = new u7(); + qxa.prototype.constructor = qxa; + d7 = qxa.prototype; + d7.IW = function() { + return false; + }; + d7.t = function() { + return WVa(this); + }; + d7.Pq = function() { + return this; + }; + d7.wP = function(a10, b10) { + TVa(SVa(b10, a10), this.Hu); + }; + d7.rfa = function() { + return this; + }; + d7.Pea = function() { + return new z7().d(this.Hu); + }; + d7.Yg = function() { + return this; + }; + d7.ZV = function(a10, b10) { + return fxa(this, a10, b10); + }; + d7.YV = function(a10, b10) { + return gxa(this, a10, b10); + }; + d7.Taa = function() { + return true; + }; + d7.$classData = r8({ z9a: 0 }, false, "scala.concurrent.impl.Promise$KeptPromise$Failed", { z9a: 1, f: 1, A9a: 1, Voa: 1, Uoa: 1, vda: 1, Roa: 1 }); + function pxa() { + this.Hu = null; + } + pxa.prototype = new u7(); + pxa.prototype.constructor = pxa; + d7 = pxa.prototype; + d7.IW = function() { + return false; + }; + d7.t = function() { + return WVa(this); + }; + d7.Pq = function(a10, b10) { + return axa(this, a10, b10); + }; + d7.wP = function(a10, b10) { + TVa(SVa(b10, a10), this.Hu); + }; + d7.rfa = function(a10, b10, c10) { + return exa(this, a10, b10, c10); + }; + d7.Yg = function(a10, b10) { + return cxa(this, a10, b10); + }; + d7.Pea = function() { + return new z7().d(this.Hu); + }; + d7.ZV = function() { + return this; + }; + d7.Taa = function() { + return true; + }; + d7.YV = function() { + return this; + }; + d7.$classData = r8({ B9a: 0 }, false, "scala.concurrent.impl.Promise$KeptPromise$Successful", { B9a: 1, f: 1, A9a: 1, Voa: 1, Uoa: 1, vda: 1, Roa: 1 }); + function Ld() { + this.uB = null; + } + Ld.prototype = new l9a(); + Ld.prototype.constructor = Ld; + d7 = Ld.prototype; + d7.H = function() { + return "Failure"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ld) { + var b10 = this.uB; + a10 = a10.uB; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.dna = function() { + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uB; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.kn = function(a10) { + this.uB = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.woa = function(a10) { + try { + return a10.Sa(this.uB) ? new Kd().d(a10.P(this.uB)) : this; + } catch (c10) { + a10 = Ph(E6(), c10); + if (null !== a10) { + var b10 = JJ(KJ(), a10); + if (!b10.b()) + return a10 = b10.c(), new Ld().kn(a10); + throw mb(E6(), a10); + } + throw c10; + } + }; + d7.$classData = r8({ o$a: 0 }, false, "scala.util.Failure", { o$a: 1, u$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function ve4() { + this.i = null; + } + ve4.prototype = new k9a(); + ve4.prototype.constructor = ve4; + d7 = ve4.prototype; + d7.H = function() { + return "Left"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ve4 ? Va(Wa(), this.i, a10.i) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.i; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.d = function(a10) { + this.i = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.wma = function() { + return false; + }; + d7.$classData = r8({ p$a: 0 }, false, "scala.util.Left", { p$a: 1, k$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function ye4() { + this.i = null; + } + ye4.prototype = new k9a(); + ye4.prototype.constructor = ye4; + d7 = ye4.prototype; + d7.H = function() { + return "Right"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ye4 ? Va(Wa(), this.i, a10.i) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.i; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.d = function(a10) { + this.i = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.wma = function() { + return true; + }; + d7.$classData = r8({ r$a: 0 }, false, "scala.util.Right", { r$a: 1, k$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Kd() { + this.i = null; + } + Kd.prototype = new l9a(); + Kd.prototype.constructor = Kd; + d7 = Kd.prototype; + d7.H = function() { + return "Success"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Kd ? Va(Wa(), this.i, a10.i) : false; + }; + d7.dna = function(a10) { + try { + return new Kd().d(a10.P(this.i)); + } catch (c10) { + a10 = Ph(E6(), c10); + if (null !== a10) { + var b10 = JJ(KJ(), a10); + if (!b10.b()) + return a10 = b10.c(), new Ld().kn(a10); + throw mb(E6(), a10); + } + throw c10; + } + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.i; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.d = function(a10) { + this.i = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.woa = function() { + return this; + }; + d7.$classData = r8({ t$a: 0 }, false, "scala.util.Success", { t$a: 1, u$a: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function igb() { + this.Rw = this.T6a = this.c3 = null; + this.EE = 0; + this.Ci = false; + } + igb.prototype = new c32(); + igb.prototype.constructor = igb; + d7 = igb.prototype; + d7.$a = function() { + return this.Tw(); + }; + function Hia(a10, b10, c10) { + var e10 = new igb(); + e10.c3 = a10; + e10.T6a = c10; + e10.Rw = Iv(b10.hh, a10, wa(a10)); + e10.EE = 0; + return e10; + } + d7.oM = function(a10) { + jgb(this); + return this.Rw.oM(a10); + }; + d7.t = function() { + return ""; + }; + d7.Tw = function() { + var a10 = this.EE; + switch (a10) { + case 0: + if (!this.Ya()) + throw new iL().a(); + this.Tw(); + break; + case 1: + this.EE = 2; + break; + case 2: + this.EE = 0; + this.Tw(); + break; + case 3: + throw new iL().a(); + default: + throw new x7().d(a10); + } + return TKa(this.Rw); + }; + d7.xw = function() { + jgb(this); + return this.Rw.xw(); + }; + function jgb(a10) { + var b10 = a10.EE; + switch (b10) { + case 0: + if (!a10.Ya()) + throw new Hj().a(); + break; + case 1: + break; + case 2: + break; + case 3: + throw new Hj().a(); + default: + throw new x7().d(b10); + } + } + d7.hea = function() { + return this.c3; + }; + d7.Ya = function() { + var a10 = this.EE; + switch (a10) { + case 0: + this.EE = Jv(this.Rw) ? 1 : 3; + break; + case 1: + break; + case 2: + this.EE = 0; + this.Ya(); + break; + case 3: + break; + default: + throw new x7().d(a10); + } + return 1 === this.EE; + }; + d7.Ms = function() { + jgb(this); + return this.Rw.Ms(); + }; + d7.xT = function(a10) { + jgb(this); + return this.Rw.xT(a10); + }; + d7.$classData = r8({ G$a: 0 }, false, "scala.util.matching.Regex$MatchIterator", { G$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1, F$a: 1 }); + function A6() { + this.Fa = this.oW = null; + } + A6.prototype = new c32(); + A6.prototype.constructor = A6; + A6.prototype.$a = function() { + return this.FL(); + }; + A6.prototype.Ya = function() { + return this.Fa.Ya(); + }; + A6.prototype.FL = function() { + this.Fa.Tw(); + return $Ka(cLa(this.Fa.c3, this.Fa.Rw)); + }; + function Iia(a10) { + var b10 = new A6(); + if (null === a10) + throw mb(E6(), null); + b10.Fa = a10; + b10.oW = new Pj().a(); + return b10; + } + A6.prototype.$classData = r8({ H$a: 0 }, false, "scala.util.matching.Regex$MatchIterator$$anon$4", { H$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1, $hb: 1 }); + function r7a(a10, b10) { + if (b10 && b10.$classData && b10.$classData.ge.Kr) { + var c10; + if (!(c10 = a10 === b10) && (c10 = a10.jb() === b10.jb())) + try { + c10 = a10.qea(b10); + } catch (e10) { + throw e10; + } + a10 = c10; + } else + a10 = false; + return a10; + } + function hC(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + return f10.jh(g10.P(h10).Hd()); + }; + }(a10, c10, b10))); + return c10.Rc(); + } + function qt(a10, b10) { + b10 = b10.es(); + $Ja(b10, a10); + b10.jh(a10.ng()); + return b10.Rc(); + } + function kgb(a10, b10) { + var c10 = a10.Qd(), e10 = new Uj().eq(false); + a10.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + g10.oa || h10.P(l10) || (g10.oa = true); + return g10.oa ? k10.jd(l10) : void 0; + }; + }(a10, e10, b10, c10))); + return c10.Rc(); + } + function B62(a10) { + if (a10.b()) + throw new Lu().e("empty.init"); + var b10 = a10.ga(); + b10 = new qd().d(b10); + var c10 = new Uj().eq(false), e10 = a10.Qd(); + sLa(e10, a10, -1); + a10.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + g10.oa ? h10.jd(k10.oa) : g10.oa = true; + k10.oa = l10; + }; + }(a10, c10, e10, b10))); + return e10.Rc(); + } + function C6(a10) { + return a10.Zn(a10.Xk() + "(", ", ", ")"); + } + function Wt(a10) { + return a10.b() ? y7() : new z7().d(a10.ga()); + } + function D6(a10, b10, c10) { + var e10 = a10.Qd(); + a10.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + return !!g10.P(l10) !== h10 ? k10.jd(l10) : void 0; + }; + }(a10, b10, c10, e10))); + return e10.Rc(); + } + function lgb(a10, b10) { + var c10 = a10.Qd(), e10 = a10.Qd(), f10 = new Uj().eq(true); + a10.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10) { + return function(p10) { + h10.oa = h10.oa && !!k10.P(p10); + return (h10.oa ? l10 : m10).jd(p10); + }; + }(a10, f10, b10, c10, e10))); + return new R6().M(c10.Rc(), e10.Rc()); + } + function xq(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + if (b10 && b10.$classData && b10.$classData.ge.nj) { + var e10 = b10.Hd().jb(); + sLa(c10, a10, e10); + } + c10.jh(a10.ng()); + c10.jh(b10.Hd()); + return c10.Rc(); + } + function wja(a10, b10) { + var c10 = a10.Qd(), e10 = a10.Qd(); + a10.U(w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + return (g10.P(l10) ? h10 : k10).jd(l10); + }; + }(a10, b10, c10, e10))); + return new R6().M(c10.Rc(), e10.Rc()); + } + function E62(a10) { + var b10 = a10.ga(); + b10 = new qd().d(b10); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + e10.oa = f10; + }; + }(a10, b10))); + return b10.oa; + } + function Qx(a10) { + if (a10.b()) + throw new Lu().e("empty.tail"); + return a10.Rk(1); + } + function F62(a10, b10) { + var c10 = new wu().a(); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = f10.P(h10); + return g10.T0(k10, oq(/* @__PURE__ */ function(l10) { + return function() { + return l10.Qd(); + }; + }(e10))).jd(h10); + }; + }(a10, b10, c10))); + b10 = UA(new VA(), nu()); + gE(new hE(), c10, w6(/* @__PURE__ */ function() { + return function(e10) { + return null !== e10; + }; + }(a10))).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(); + g10 = g10.ya(); + return f10.jd(new R6().M(h10, g10.Rc())); + } + throw new x7().d(g10); + }; + }(a10, b10))); + return b10.eb; + } + function Jd(a10, b10, c10) { + c10 = se4(a10, c10); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + return f10.jd(g10.P(h10)); + }; + }(a10, c10, b10))); + return c10.Rc(); + } + function se4(a10, b10) { + b10 = b10.en(a10.Zi()); + $Ja(b10, a10); + return b10; + } + function xs(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + a10.U(b10.vA(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.jd(g10); + }; + }(a10, c10)))); + return c10.Rc(); + } + function G6(a10) { + a10 = Fj(la(a10.Zi())); + for (var b10 = -1 + (a10.length | 0) | 0; ; ) + if (-1 !== b10 && 36 === (65535 & (a10.charCodeAt(b10) | 0))) + b10 = -1 + b10 | 0; + else + break; + if (-1 === b10 || 46 === (65535 & (a10.charCodeAt(b10) | 0))) + return ""; + for (var c10 = ""; ; ) { + for (var e10 = 1 + b10 | 0; ; ) + if (-1 !== b10 && 57 >= (65535 & (a10.charCodeAt(b10) | 0)) && 48 <= (65535 & (a10.charCodeAt(b10) | 0))) + b10 = -1 + b10 | 0; + else + break; + for (var f10 = b10; ; ) + if (-1 !== b10 && 36 !== (65535 & (a10.charCodeAt(b10) | 0)) && 46 !== (65535 & (a10.charCodeAt(b10) | 0))) + b10 = -1 + b10 | 0; + else + break; + var g10 = 1 + b10 | 0; + if (b10 === f10 && e10 !== (a10.length | 0)) + return c10; + for (; ; ) + if (-1 !== b10 && 36 === (65535 & (a10.charCodeAt(b10) | 0))) + b10 = -1 + b10 | 0; + else + break; + f10 = -1 === b10 ? true : 46 === (65535 & (a10.charCodeAt(b10) | 0)); + var h10; + (h10 = f10) || (h10 = 65535 & (a10.charCodeAt(g10) | 0), h10 = !(90 < h10 && 127 > h10 || 65 > h10)); + if (h10) { + e10 = a10.substring(g10, e10); + g10 = c10; + if (null === g10) + throw new sf().a(); + c10 = "" === g10 ? e10 : "" + e10 + gc(46) + c10; + if (f10) + return c10; + } + } + } + function mgb() { + this.u = null; + } + mgb.prototype = new jWa(); + mgb.prototype.constructor = mgb; + function H6() { + } + H6.prototype = mgb.prototype; + function ngb() { + h52.call(this); + } + ngb.prototype = new z9a(); + ngb.prototype.constructor = ngb; + ngb.prototype.Rka = function(a10) { + return ogb(a10); + }; + ngb.prototype.$classData = r8({ hbb: 0 }, false, "scala.collection.immutable.HashMap$HashTrieMap$$anon$3", { hbb: 1, wcb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function pgb() { + h52.call(this); + } + pgb.prototype = new z9a(); + pgb.prototype.constructor = pgb; + pgb.prototype.Rka = function(a10) { + return a10.Tk; + }; + pgb.prototype.$classData = r8({ obb: 0 }, false, "scala.collection.immutable.HashSet$HashTrieSet$$anon$1", { obb: 1, wcb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1 }); + function I6() { + } + I6.prototype = new lWa(); + I6.prototype.constructor = I6; + I6.prototype.a = function() { + return this; + }; + I6.prototype.tG = function() { + return qgb(); + }; + I6.prototype.$classData = r8({ wbb: 0 }, false, "scala.collection.immutable.ListMap$", { wbb: 1, Apa: 1, hM: 1, gM: 1, f: 1, q: 1, o: 1 }); + var rgb = void 0; + function Aha() { + rgb || (rgb = new I6().a()); + return rgb; + } + function J6() { + } + J6.prototype = new u9a(); + J6.prototype.constructor = J6; + J6.prototype.a = function() { + return this; + }; + J6.prototype.v0 = function() { + return vd(); + }; + J6.prototype.$classData = r8({ Qbb: 0 }, false, "scala.collection.immutable.Set$", { Qbb: 1, Bpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1 }); + var sgb = void 0; + function qe2() { + sgb || (sgb = new J6().a()); + return sgb; + } + function K6() { + this.Jo = null; + } + K6.prototype = new H9a(); + K6.prototype.constructor = K6; + K6.prototype.a = function() { + G9a.prototype.a.call(this); + return this; + }; + K6.prototype.Rc = function() { + return tgb(this); + }; + function tgb(a10) { + return a10.Jo.Dc.Dd().bd(w6(/* @__PURE__ */ function() { + return function(b10) { + return b10.Dd(); + }; + }(a10)), (Pt(), new Qt().a())); + } + K6.prototype.$classData = r8({ ccb: 0 }, false, "scala.collection.immutable.Stream$StreamBuilder", { ccb: 1, yib: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1 }); + function jG() { + this.gT = this.qL = this.HS = 0; + this.eka = this.cka = this.aka = this.Zja = this.Xja = this.mT = null; + } + jG.prototype = new u7(); + jG.prototype.constructor = jG; + d7 = jG.prototype; + d7.Eg = function() { + return this.aka; + }; + d7.a = function() { + this.mT = ja(Ja(Ha), [32]); + this.gT = 1; + this.qL = this.HS = 0; + return this; + }; + d7.Un = function() { + return this.gT; + }; + d7.Kk = function(a10) { + return MS(this, a10); + }; + d7.rG = function(a10) { + this.eka = a10; + }; + d7.Fl = function() { + return this.mT; + }; + d7.ui = function(a10) { + this.Zja = a10; + }; + d7.Ej = function() { + return this.cka; + }; + function MS(a10, b10) { + if (a10.qL >= a10.mT.n.length) { + var c10 = 32 + a10.HS | 0, e10 = a10.HS ^ c10; + if (1024 > e10) + 1 === a10.Un() && (a10.Jg(ja(Ja(Ha), [32])), a10.me().n[0] = a10.Fl(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])), a10.me().n[31 & (c10 >>> 5 | 0)] = a10.Fl(); + else if (32768 > e10) + 2 === a10.Un() && (a10.ui(ja(Ja(Ha), [32])), a10.Te().n[0] = a10.me(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])), a10.Jg(ja(Ja(Ha), [32])), a10.me().n[31 & (c10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (c10 >>> 10 | 0)] = a10.me(); + else if (1048576 > e10) + 3 === a10.Un() && (a10.Gl(ja(Ja(Ha), [32])), a10.Eg().n[0] = a10.Te(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])), a10.Jg(ja(Ja(Ha), [32])), a10.ui(ja(Ja(Ha), [32])), a10.me().n[31 & (c10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (c10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (c10 >>> 15 | 0)] = a10.Te(); + else if (33554432 > e10) + 4 === a10.Un() && (a10.xr(ja(Ja(Ha), [32])), a10.Ej().n[0] = a10.Eg(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])), a10.Jg(ja(Ja(Ha), [32])), a10.ui(ja(Ja(Ha), [32])), a10.Gl(ja(Ja(Ha), [32])), a10.me().n[31 & (c10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (c10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (c10 >>> 15 | 0)] = a10.Te(), a10.Ej().n[31 & (c10 >>> 20 | 0)] = a10.Eg(); + else if (1073741824 > e10) + 5 === a10.Un() && (a10.rG(ja(Ja(Ha), [32])), a10.js().n[0] = a10.Ej(), a10.rw(1 + a10.Un() | 0)), a10.Zh(ja(Ja(Ha), [32])), a10.Jg(ja(Ja(Ha), [32])), a10.ui(ja(Ja(Ha), [32])), a10.Gl(ja(Ja(Ha), [32])), a10.xr(ja(Ja(Ha), [32])), a10.me().n[31 & (c10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (c10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (c10 >>> 15 | 0)] = a10.Te(), a10.Ej().n[31 & (c10 >>> 20 | 0)] = a10.Eg(), a10.js().n[31 & (c10 >>> 25 | 0)] = a10.Ej(); + else + throw new Zj().a(); + a10.HS = c10; + a10.qL = 0; + } + a10.mT.n[a10.qL] = b10; + a10.qL = 1 + a10.qL | 0; + return a10; + } + d7.Rc = function() { + return lG(this); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.Jg = function(a10) { + this.Xja = a10; + }; + d7.xr = function(a10) { + this.cka = a10; + }; + d7.me = function() { + return this.Xja; + }; + d7.js = function() { + return this.eka; + }; + function lG(a10) { + var b10 = a10.HS + a10.qL | 0; + if (0 === b10) + return iG().pJ; + var c10 = new L6().Fi(0, b10, 0); + ck(c10, a10, a10.gT); + 1 < a10.gT && Lda(c10, 0, -1 + b10 | 0); + return c10; + } + d7.jd = function(a10) { + return MS(this, a10); + }; + d7.pj = function() { + }; + d7.rw = function(a10) { + this.gT = a10; + }; + d7.Te = function() { + return this.Zja; + }; + d7.Zh = function(a10) { + this.mT = a10; + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.Gl = function(a10) { + this.aka = a10; + }; + d7.$classData = r8({ Acb: 0 }, false, "scala.collection.immutable.VectorBuilder", { Acb: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, Hpa: 1 }); + function ugb() { + this.h$ = this.od = this.jG = this.g$ = 0; + this.lX = false; + this.Q9 = 0; + this.fka = this.dka = this.bka = this.$ja = this.Yja = this.S9 = null; + } + ugb.prototype = new c32(); + ugb.prototype.constructor = ugb; + d7 = ugb.prototype; + d7.$a = function() { + if (!this.lX) + throw new iL().e("reached iterator end"); + var a10 = this.S9.n[this.od]; + this.od = 1 + this.od | 0; + if (this.od === this.h$) + if ((this.jG + this.od | 0) < this.g$) { + var b10 = 32 + this.jG | 0, c10 = this.jG ^ b10; + if (1024 > c10) + this.Zh(this.me().n[31 & (b10 >>> 5 | 0)]); + else if (32768 > c10) + this.Jg(this.Te().n[31 & (b10 >>> 10 | 0)]), this.Zh(this.me().n[0]); + else if (1048576 > c10) + this.ui(this.Eg().n[31 & (b10 >>> 15 | 0)]), this.Jg(this.Te().n[0]), this.Zh(this.me().n[0]); + else if (33554432 > c10) + this.Gl(this.Ej().n[31 & (b10 >>> 20 | 0)]), this.ui(this.Eg().n[0]), this.Jg(this.Te().n[0]), this.Zh(this.me().n[0]); + else if (1073741824 > c10) + this.xr(this.js().n[31 & (b10 >>> 25 | 0)]), this.Gl(this.Ej().n[0]), this.ui(this.Eg().n[0]), this.Jg(this.Te().n[0]), this.Zh(this.me().n[0]); + else + throw new Zj().a(); + this.jG = b10; + b10 = this.g$ - this.jG | 0; + this.h$ = 32 > b10 ? b10 : 32; + this.od = 0; + } else + this.lX = false; + return a10; + }; + d7.Eg = function() { + return this.bka; + }; + d7.Un = function() { + return this.Q9; + }; + d7.rG = function(a10) { + this.fka = a10; + }; + d7.Sc = function(a10, b10) { + this.g$ = b10; + this.jG = -32 & a10; + this.od = 31 & a10; + a10 = b10 - this.jG | 0; + this.h$ = 32 > a10 ? a10 : 32; + this.lX = (this.jG + this.od | 0) < b10; + return this; + }; + d7.Fl = function() { + return this.S9; + }; + d7.ui = function(a10) { + this.$ja = a10; + }; + d7.Ej = function() { + return this.dka; + }; + d7.Jg = function(a10) { + this.Yja = a10; + }; + d7.Ya = function() { + return this.lX; + }; + d7.xr = function(a10) { + this.dka = a10; + }; + d7.me = function() { + return this.Yja; + }; + d7.js = function() { + return this.fka; + }; + d7.rw = function(a10) { + this.Q9 = a10; + }; + d7.Te = function() { + return this.$ja; + }; + d7.Zh = function(a10) { + this.S9 = a10; + }; + d7.Gl = function(a10) { + this.bka = a10; + }; + d7.$classData = r8({ Bcb: 0 }, false, "scala.collection.immutable.VectorIterator", { Bcb: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1, Hpa: 1 }); + function M62() { + } + M62.prototype = new nWa(); + M62.prototype.constructor = M62; + M62.prototype.a = function() { + return this; + }; + M62.prototype.ls = function() { + return new wu().a(); + }; + M62.prototype.tG = function() { + return new wu().a(); + }; + M62.prototype.$classData = r8({ sdb: 0 }, false, "scala.collection.mutable.HashMap$", { sdb: 1, Oda: 1, hM: 1, gM: 1, f: 1, q: 1, o: 1 }); + var vgb = void 0; + function Sb() { + vgb || (vgb = new M62().a()); + return vgb; + } + function N62() { + } + N62.prototype = new nWa(); + N62.prototype.constructor = N62; + N62.prototype.a = function() { + return this; + }; + N62.prototype.ls = function() { + return new O62().a(); + }; + N62.prototype.tG = function() { + return new O62().a(); + }; + N62.prototype.$classData = r8({ Ldb: 0 }, false, "scala.collection.mutable.LinkedHashMap$", { Ldb: 1, Oda: 1, hM: 1, gM: 1, f: 1, q: 1, o: 1 }); + var wgb = void 0; + function xgb() { + wgb || (wgb = new N62().a()); + return wgb; + } + function P62() { + } + P62.prototype = new nWa(); + P62.prototype.constructor = P62; + P62.prototype.a = function() { + return this; + }; + P62.prototype.ls = function() { + return new Pr().a(); + }; + P62.prototype.tG = function() { + return new Pr().a(); + }; + P62.prototype.$classData = r8({ Ydb: 0 }, false, "scala.collection.mutable.ListMap$", { Ydb: 1, Oda: 1, hM: 1, gM: 1, f: 1, q: 1, o: 1 }); + var ygb = void 0; + function Qr() { + ygb || (ygb = new P62().a()); + return ygb; + } + function Q6() { + } + Q6.prototype = new w9a(); + Q6.prototype.constructor = Q6; + Q6.prototype.a = function() { + return this; + }; + Q6.prototype.Rz = function() { + return new mq().a(); + }; + Q6.prototype.$classData = r8({ ceb: 0 }, false, "scala.collection.mutable.Set$", { ceb: 1, Dpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1 }); + var zgb = void 0; + function DB() { + zgb || (zgb = new Q6().a()); + return zgb; + } + function R62() { + nz.call(this); + } + R62.prototype = new N9a(); + R62.prototype.constructor = R62; + R62.prototype.Dt = function() { + }; + R62.prototype.Pqa = function() { + }; + R62.prototype.$classData = r8({ Yeb: 0 }, false, "scala.runtime.NonLocalReturnControl$mcV$sp", { Yeb: 1, jea: 1, bf: 1, f: 1, o: 1, jW: 1, wda: 1 }); + function S62() { + nz.call(this); + this.Nea = false; + } + S62.prototype = new N9a(); + S62.prototype.constructor = S62; + S62.prototype.Dt = function() { + return this.Nea; + }; + function wQa(a10) { + var b10 = new S62(); + b10.Nea = false; + nz.prototype.M.call(b10, a10, null); + return b10; + } + S62.prototype.Oea = function() { + return this.Nea; + }; + S62.prototype.$classData = r8({ Zeb: 0 }, false, "scala.runtime.NonLocalReturnControl$mcZ$sp", { Zeb: 1, jea: 1, bf: 1, f: 1, o: 1, jW: 1, wda: 1 }); + function T62() { + this.ea = this.k = null; + } + T62.prototype = new u7(); + T62.prototype.constructor = T62; + d7 = T62.prototype; + d7.b7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + T62.prototype.b7a.call(this, new pO().K(new S6().a(), a10)); + return this; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.e4 = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Jk().nb; + Vd(b10, c10, a10); + return this; + }; + d7.N3 = function() { + i32(); + var a10 = B6(this.k.g, qO().ig); + i32().cb(); + return gb(a10); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.qk = function() { + return this.k; + }; + d7.Qv = function() { + return b$a2(this); + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.rI = function(a10) { + var b10 = this.k, c10 = i32(), e10 = F52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Bd().vh; + Zd(b10, c10, a10); + return this; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + d7.tK = function() { + var a10 = i32(), b10 = cd(this.k), c10 = F52(); + return Ak(a10, b10, c10).Ra(); + }; + T62.prototype.annotations = function() { + return this.rb(); + }; + T62.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(T62.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + T62.prototype.findByType = function(a10) { + return this.qp(a10); + }; + T62.prototype.findById = function(a10) { + return this.pp(a10); + }; + T62.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + T62.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + T62.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + T62.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + T62.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(T62.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(T62.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(T62.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(T62.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + T62.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(T62.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + T62.prototype.withEncodes = function(a10) { + if (a10 instanceof I52) + return this.e4(a10); + if (HLa(a10)) + return this.Pv(a10); + throw "No matching overload"; + }; + T62.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + T62.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(T62.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + T62.prototype.withExternals = function(a10) { + return this.rI(a10); + }; + T62.prototype.withGraphDependencies = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = qO().Ot; + Wr(b10, c10, a10); + return this; + }; + T62.prototype.withDefinedBy = function(a10) { + var b10 = this.k, c10 = qO().ig; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(T62.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + Object.defineProperty(T62.prototype, "externals", { get: function() { + return this.tK(); + }, configurable: true }); + T62.prototype.graphDependencies = function() { + var a10 = i32(), b10 = B6(this.k.g, qO().Ot), c10 = i32().cb(); + return Ak(a10, b10, c10).Ra(); + }; + T62.prototype.definedBy = function() { + return this.N3(); + }; + T62.prototype.$classData = r8({ $ta: 0 }, false, "amf.client.model.document.DialectInstance", { $ta: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1 }); + function U62() { + this.ea = this.k = null; + } + U62.prototype = new u7(); + U62.prototype.constructor = U62; + d7 = U62.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + U62.prototype.e7a.call(this, new wO().K(new S6().a(), a10)); + return this; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.k; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.qk = function() { + return this.k; + }; + d7.Qv = function() { + return b$a2(this); + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.e7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.Wr = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + U62.prototype.annotations = function() { + return this.rb(); + }; + U62.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(U62.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + U62.prototype.findByType = function(a10) { + return this.qp(a10); + }; + U62.prototype.findById = function(a10) { + return this.pp(a10); + }; + U62.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + U62.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + U62.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + U62.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + U62.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(U62.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(U62.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(U62.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(U62.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + U62.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(U62.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + U62.prototype.withEncodes = function(a10) { + return this.Pv(a10); + }; + Object.defineProperty(U62.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + U62.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + U62.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(U62.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + U62.prototype.$classData = r8({ cua: 0 }, false, "amf.client.model.document.DialectInstancePatch", { cua: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1 }); + function Ik() { + this.ea = this.k = null; + } + Ik.prototype = new u7(); + Ik.prototype.constructor = Ik; + function Agb() { + } + d7 = Agb.prototype = Ik.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Ik.prototype.Xz.call(this, new mf().K(new S6().a(), a10)); + return this; + }; + d7.MC = function() { + return this.k; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.R$ = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new mf().K(new S6().a(), b10); + ab(); + ab().jr(); + a10 = a10.Oc(); + var c10 = Jk().nb; + Ik.prototype.Xz.call(this, Vd(b10, c10, a10)); + }; + d7.Sl = function() { + return cU(this); + }; + d7.Be = function() { + return this.MC(); + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.Qv = function() { + return nAa(this); + }; + d7.qk = function() { + return this.MC(); + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.MC(); + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Xz = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.Be().j; + }; + d7.oc = function() { + return this.MC(); + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + Ik.prototype.annotations = function() { + return this.rb(); + }; + Ik.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(Ik.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + Ik.prototype.findByType = function(a10) { + return this.qp(a10); + }; + Ik.prototype.findById = function(a10) { + return this.pp(a10); + }; + Ik.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + Ik.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + Ik.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + Ik.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + Ik.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(Ik.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(Ik.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(Ik.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(Ik.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + Ik.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(Ik.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Ik.prototype.withEncodes = function(a10) { + return this.Pv(a10); + }; + Object.defineProperty(Ik.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + Ik.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + Ik.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(Ik.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + Ik.prototype.$classData = r8({ eN: 0 }, false, "amf.client.model.document.Document", { eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1 }); + function V6() { + this.ea = this.k = null; + } + V6.prototype = new u7(); + V6.prototype.constructor = V6; + function Bgb() { + } + d7 = Bgb.prototype = V6.prototype; + d7.Xe = function() { + ab(); + var a10 = B6(this.k.Y(), kP().R); + ab().cb(); + return gb(a10); + }; + d7.zg = function() { + return this.ZU(); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.L9 = function() { + ab(); + var a10 = this.k.Nz(); + return fl(ab().Um(), a10); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Qea = function() { + var a10 = ab(), b10 = this.k.kI(), c10 = ab().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + ab(); + var a10 = B6(this.k.g, kP().Va); + ab().cb(); + return gb(a10); + }; + d7.ZU = function() { + throw mb(E6(), new nb().e("AbstractDeclaration is abstract")); + }; + d7.Kf = function() { + return this.K1(); + }; + d7.Gj = function() { + return this.K1(); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = kP().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.Oc().j; + }; + d7.oc = function() { + return this.k; + }; + d7.CI = function() { + return this.Qea(); + }; + d7.sh = function() { + return this.Rj(); + }; + d7.$$ = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.yI = function(a10) { + var b10 = this.k, c10 = ab(), e10 = ab().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = kP().Aj; + Wr(b10, c10, a10); + return this; + }; + d7.K1 = function() { + throw mb(E6(), new nb().e("AbstractDeclaration is abstract")); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + V6.prototype.annotations = function() { + return this.rb(); + }; + V6.prototype.graph = function() { + return jU(this); + }; + V6.prototype.withId = function(a10) { + return this.$b(a10); + }; + V6.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + V6.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(V6.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(V6.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(V6.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(V6.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + V6.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + V6.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + V6.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(V6.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(V6.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + V6.prototype.linkCopy = function() { + return this.Kf(); + }; + Object.defineProperty(V6.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + V6.prototype.withVariables = function(a10) { + return this.yI(a10); + }; + V6.prototype.withDataNode = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = kP().SC; + Vd(b10, c10, a10); + return this; + }; + V6.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + V6.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(V6.prototype, "variables", { get: function() { + return this.CI(); + }, configurable: true }); + Object.defineProperty(V6.prototype, "dataNode", { get: function() { + return this.L9(); + }, configurable: true }); + Object.defineProperty(V6.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(V6.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + V6.prototype.$classData = r8({ V6: 0 }, false, "amf.client.model.domain.AbstractDeclaration", { V6: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1 }); + function Cgb() { + this.r = this.$ = this.lg = null; + } + Cgb.prototype = new u7(); + Cgb.prototype.constructor = Cgb; + d7 = Cgb.prototype; + d7.H = function() { + return "DataNodePropertiesAnnotations"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Cgb) { + var b10 = this.lg; + a10 = a10.lg; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + function jXa(a10) { + var b10 = new Cgb(); + b10.lg = a10; + b10.$ = "data-node-properties"; + var c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + if (null !== f10) { + var g10 = f10.ma(); + f10 = f10.ya(); + return g10 + "->" + f10.yc; + } + throw new x7().d(f10); + }; + }(b10)), e10 = Id().u; + b10.r = Jd(a10, c10, e10).Kg("#"); + return b10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Zwa: 0 }, false, "amf.core.annotations.DataNodePropertiesAnnotations", { Zwa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function N1() { + this.r = this.$ = null; + } + N1.prototype = new u7(); + N1.prototype.constructor = N1; + d7 = N1.prototype; + d7.a = function() { + this.$ = "default-node"; + this.r = ""; + return this; + }; + d7.H = function() { + return "DefaultNode"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof N1 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var B8a = r8({ dxa: 0 }, false, "amf.core.annotations.DefaultNode", { dxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + N1.prototype.$classData = B8a; + function yN() { + this.r = this.$ = null; + } + yN.prototype = new u7(); + yN.prototype.constructor = yN; + d7 = yN.prototype; + d7.a = function() { + this.$ = "inline-element"; + this.r = ""; + return this; + }; + d7.H = function() { + return "InlineElement"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof yN && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var VZa = r8({ rxa: 0 }, false, "amf.core.annotations.InlineElement", { rxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + yN.prototype.$classData = VZa; + function t62() { + this.r = this.$ = null; + } + t62.prototype = new u7(); + t62.prototype.constructor = t62; + d7 = t62.prototype; + d7.a = function() { + this.$ = "local-element"; + this.r = ""; + return this; + }; + d7.H = function() { + return "LocalElement"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof t62 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var zka = r8({ uxa: 0 }, false, "amf.core.annotations.LocalElement", { uxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + t62.prototype.$classData = zka; + function U1() { + this.r = this.$ = this.Fg = null; + } + U1.prototype = new u7(); + U1.prototype.constructor = U1; + d7 = U1.prototype; + d7.H = function() { + return "NilUnion"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof U1 ? this.Fg === a10.Fg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.Fg = a10; + this.$ = "nil-union"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var dma = r8({ vxa: 0 }, false, "amf.core.annotations.NilUnion", { vxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + U1.prototype.$classData = dma; + function V1() { + this.r = this.$ = null; + } + V1.prototype = new u7(); + V1.prototype.constructor = V1; + d7 = V1.prototype; + d7.a = function() { + this.$ = "null-security"; + this.r = ""; + return this; + }; + d7.H = function() { + return "NullSecurity"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof V1 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var mHa = r8({ xxa: 0 }, false, "amf.core.annotations.NullSecurity", { xxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + V1.prototype.$classData = mHa; + function bv() { + } + bv.prototype = new u7(); + bv.prototype.constructor = bv; + d7 = bv.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "ResolvedInheritance"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof bv && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + var GCa = r8({ Axa: 0 }, false, "amf.core.annotations.ResolvedInheritance", { Axa: 1, f: 1, Vm: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + bv.prototype.$classData = GCa; + function W1() { + this.r = this.$ = null; + } + W1.prototype = new u7(); + W1.prototype.constructor = W1; + d7 = W1.prototype; + d7.a = function() { + this.$ = "single-value-array"; + this.r = ""; + return this; + }; + d7.H = function() { + return "SingleValueArray"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof W1 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var JGa = r8({ Fxa: 0 }, false, "amf.core.annotations.SingleValueArray", { Fxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + W1.prototype.$classData = JGa; + function Bs() { + this.da = null; + } + Bs.prototype = new u7(); + Bs.prototype.constructor = Bs; + d7 = Bs.prototype; + d7.H = function() { + return "SourceLocation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Bs ? this.da === a10.da : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.da; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e = function(a10) { + this.da = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var Bb = r8({ Ixa: 0 }, false, "amf.core.annotations.SourceLocation", { Ixa: 1, f: 1, Vm: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Bs.prototype.$classData = Bb; + function Xz() { + this.r = this.$ = null; + } + Xz.prototype = new u7(); + Xz.prototype.constructor = Xz; + d7 = Xz.prototype; + d7.a = function() { + this.$ = "synthesized-field"; + this.r = "true"; + return this; + }; + d7.H = function() { + return "SynthesizedField"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Xz && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var IR = r8({ Mxa: 0 }, false, "amf.core.annotations.SynthesizedField", { Mxa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Xz.prototype.$classData = IR; + function Dgb() { + this.p = this.Ba = this.la = null; + this.sO = false; + this.oF = null; + } + Dgb.prototype = new u7(); + Dgb.prototype.constructor = Dgb; + d7 = Dgb.prototype; + d7.H = function() { + return "ArrayEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Dgb) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && this.p === a10.p && this.sO === a10.sO ? this.oF === a10.oF : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.sO; + case 4: + return this.oF; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Egb(a10, b10) { + T6(); + var c10 = a10.la, e10 = mh(T6(), c10); + c10 = new PA().e(b10.ca); + var f10 = J5(Ef(), H10()); + Yx(a10.Ba.r.r).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return Dg(t10, hV(new iV(), v10, p10.oF)); + }; + }(a10, f10))); + var g10 = c10.s, h10 = c10.ca, k10 = new PA().e(h10); + vr(wr(), a10.p.zb(f10), k10); + T6(); + eE(); + a10 = SA(zs(), h10); + a10 = mr(0, new Sx().Ac(a10, k10.s), Q5().cd); + pr(g10, a10); + g10 = c10.s; + e10 = [e10]; + if (0 > g10.w) + throw new U6().e("0"); + k10 = e10.length | 0; + a10 = g10.w + k10 | 0; + uD(g10, a10); + Ba(g10.L, 0, g10.L, k10, g10.w); + k10 = g10.L; + var l10 = k10.n.length; + h10 = f10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = k10.n.length; + for (l10 = l10 < m10 ? l10 : m10; f10 < l10; ) + k10.n[h10] = e10[f10], f10 = 1 + f10 | 0, h10 = 1 + h10 | 0; + g10.w = a10; + pr(b10.s, vD(wD(), c10.s)); + } + d7.Qa = function(a10) { + if (!wh(this.Ba.r.x, q5(JGa)) && !wh(this.Ba.r.r.fa(), q5(JGa)) || this.sO) + Egb(this, a10); + else { + var b10 = Yx(this.Ba.r.r).kc(); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.t())); + var c10 = b10.b() ? "" : b10.c(); + T6(); + b10 = this.la; + var e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + lr(wr(), b10, c10, this.oF); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + var f10 = e10.length | 0, g10 = c10.w + f10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.la)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ba)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.sO ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.oF)); + return OJ().fe(a10, 5); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + function $x(a10, b10, c10, e10) { + var f10 = new Dgb(), g10 = Q5().Na; + f10.la = a10; + f10.Ba = b10; + f10.p = c10; + f10.sO = e10; + f10.oF = g10; + return f10; + } + d7.$classData = r8({ Wxa: 0 }, false, "amf.core.emitter.BaseEmitters.package$ArrayEmitter", { Wxa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Fgb() { + this.Fg = null; + } + Fgb.prototype = new u7(); + Fgb.prototype.constructor = Fgb; + d7 = Fgb.prototype; + d7.H = function() { + return "EmptyMapEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.Ob = function(a10) { + T6(); + var b10 = ur().ce; + T6(); + b10 = mr(T6(), b10, Q5().sa); + pr(a10.s, b10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Fgb) { + var b10 = this.Fg; + a10 = a10.Fg; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function a6a() { + var a10 = new Fgb(), b10 = ld(); + a10.Fg = b10; + return a10; + } + d7.La = function() { + return this.Fg; + }; + d7.$classData = r8({ Yxa: 0 }, false, "amf.core.emitter.BaseEmitters.package$EmptyMapEmitter", { Yxa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ggb() { + this.Fg = this.Ae = this.r = this.la = null; + } + Ggb.prototype = new u7(); + Ggb.prototype.constructor = Ggb; + d7 = Ggb.prototype; + d7.H = function() { + return "EntryPartEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ggb) { + if (this.la === a10.la) { + var b10 = this.r, c10 = a10.r; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.Ae === a10.Ae) + return b10 = this.Fg, a10 = a10.Fg, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.r; + case 2: + return this.Ae; + case 3: + return this.Fg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function ky(a10, b10, c10, e10) { + var f10 = new Ggb(); + f10.la = a10; + f10.r = b10; + f10.Ae = c10; + f10.Fg = e10; + return f10; + } + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + this.r.Ob(b10); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return this.Fg; + }; + d7.$classData = r8({ Zxa: 0 }, false, "amf.core.emitter.BaseEmitters.package$EntryPartEmitter", { Zxa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function W6() { + this.x = this.rr = null; + } + W6.prototype = new u7(); + W6.prototype.constructor = W6; + d7 = W6.prototype; + d7.H = function() { + return "LinkScalaEmitter"; + }; + d7.Ob = function(a10) { + var b10 = mr(T6(), sD(or(), this.rr, Q5().wq, ys(this.x)), Q5().wq); + pr(a10.s, b10); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof W6 ? this.rr === a10.rr ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rr; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ $xa: 0 }, false, "amf.core.emitter.BaseEmitters.package$LinkScalaEmitter", { $xa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function dx() { + this.Fg = this.Ae = this.r = this.la = null; + } + dx.prototype = new u7(); + dx.prototype.constructor = dx; + d7 = dx.prototype; + d7.H = function() { + return "MapEntryEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof dx && this.la === a10.la && this.r === a10.r && this.Ae === a10.Ae) { + var b10 = this.Fg; + a10 = a10.Fg; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.r; + case 2: + return this.Ae; + case 3: + return this.Fg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + lr(wr(), b10, this.r, this.Ae); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + function cx(a10, b10, c10, e10, f10) { + a10.la = b10; + a10.r = c10; + a10.Ae = e10; + a10.Fg = f10; + return a10; + } + d7.La = function() { + return this.Fg; + }; + d7.$classData = r8({ aya: 0 }, false, "amf.core.emitter.BaseEmitters.package$MapEntryEmitter", { aya: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function c62() { + this.x = null; + } + c62.prototype = new u7(); + c62.prototype.constructor = c62; + d7 = c62.prototype; + d7.H = function() { + return "NullEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.Ob = function(a10) { + var b10 = mr(T6(), sD(or(), "null", Q5().nd, ys(this.x)), Q5().nd); + pr(a10.s, b10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof c62 ? this.x === a10.x : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dq = function(a10) { + this.x = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ bya: 0 }, false, "amf.core.emitter.BaseEmitters.package$NullEmitter", { bya: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function c42() { + this.x = this.Ae = this.ur = null; + } + c42.prototype = new u7(); + c42.prototype.constructor = c42; + d7 = c42.prototype; + d7.H = function() { + return "RawEmitter"; + }; + function T4a(a10, b10, c10) { + var e10 = (O7(), new P6().a()); + a10.ur = b10; + a10.Ae = c10; + a10.x = e10; + return a10; + } + d7.Ob = function(a10) { + lr(wr(), a10, this.ur, this.Ae); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof c42 ? this.ur === a10.ur && this.Ae === a10.Ae ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ur; + case 1: + return this.Ae; + case 2: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ cya: 0 }, false, "amf.core.emitter.BaseEmitters.package$RawEmitter", { cya: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function iV() { + this.Ae = this.lx = null; + } + iV.prototype = new u7(); + iV.prototype.constructor = iV; + d7 = iV.prototype; + d7.H = function() { + return "ScalarEmitter"; + }; + d7.Ob = function(a10) { + var b10 = mr(T6(), nr(or(), this.lx.r), this.Ae); + pr(a10.s, b10); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof iV) { + var b10 = this.lx, c10 = a10.lx; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ae === a10.Ae : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lx; + case 1: + return this.Ae; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function hV(a10, b10, c10) { + a10.lx = b10; + a10.Ae = c10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.lx.x, q5(jd)); + }; + d7.$classData = r8({ eya: 0 }, false, "amf.core.emitter.BaseEmitters.package$ScalarEmitter", { eya: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function b62() { + this.Ae = this.x = this.r = null; + } + b62.prototype = new u7(); + b62.prototype.constructor = b62; + d7 = b62.prototype; + d7.H = function() { + return "TextScalarEmitter"; + }; + d7.Ob = function(a10) { + var b10 = mr(T6(), sD(or(), this.r, this.Ae, ys(this.x)), this.Ae); + pr(a10.s, b10); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof b62 ? this.r === a10.r && this.x === a10.x ? this.Ae === a10.Ae : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + case 1: + return this.x; + case 2: + return this.Ae; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function X6(a10, b10, c10, e10) { + a10.r = b10; + a10.x = c10; + a10.Ae = e10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ fya: 0 }, false, "amf.core.emitter.BaseEmitters.package$TextScalarEmitter", { fya: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function xc() { + ht2.call(this); + } + xc.prototype = new EAa(); + xc.prototype.constructor = xc; + d7 = xc.prototype; + d7.H = function() { + return "Array"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xc) { + var b10 = this.Fe; + a10 = a10.Fe; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.yd = function(a10) { + ht2.prototype.yd.call(this, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vya: 0 }, false, "amf.core.metamodel.Type$Array", { vya: 1, wya: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hgb() { + zB.call(this); + } + Hgb.prototype = new Q52(); + Hgb.prototype.constructor = Hgb; + Hgb.prototype.a = function() { + zB.prototype.e.call(this, "boolean"); + return this; + }; + Hgb.prototype.$classData = r8({ xya: 0 }, false, "amf.core.metamodel.Type$Bool$", { xya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Igb = void 0; + function zc() { + Igb || (Igb = new Hgb().a()); + return Igb; + } + function Jgb() { + zB.call(this); + } + Jgb.prototype = new Q52(); + Jgb.prototype.constructor = Jgb; + Jgb.prototype.a = function() { + zB.prototype.e.call(this, "date"); + return this; + }; + Jgb.prototype.$classData = r8({ yya: 0 }, false, "amf.core.metamodel.Type$Date$", { yya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Kgb = void 0; + function ZL() { + Kgb || (Kgb = new Jgb().a()); + return Kgb; + } + function Lgb() { + zB.call(this); + } + Lgb.prototype = new Q52(); + Lgb.prototype.constructor = Lgb; + Lgb.prototype.a = function() { + zB.prototype.e.call(this, "dateTime"); + return this; + }; + Lgb.prototype.$classData = r8({ zya: 0 }, false, "amf.core.metamodel.Type$DateTime$", { zya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Mgb = void 0; + function TM() { + Mgb || (Mgb = new Lgb().a()); + return Mgb; + } + function Ngb() { + zB.call(this); + } + Ngb.prototype = new Q52(); + Ngb.prototype.constructor = Ngb; + Ngb.prototype.a = function() { + zB.prototype.e.call(this, "double"); + return this; + }; + Ngb.prototype.$classData = r8({ Aya: 0 }, false, "amf.core.metamodel.Type$Double$", { Aya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ogb = void 0; + function hi() { + Ogb || (Ogb = new Ngb().a()); + return Ogb; + } + function Pgb() { + zB.call(this); + } + Pgb.prototype = new Q52(); + Pgb.prototype.constructor = Pgb; + Pgb.prototype.a = function() { + zB.prototype.e.call(this, "encodedUrl"); + return this; + }; + Pgb.prototype.$classData = r8({ Bya: 0 }, false, "amf.core.metamodel.Type$EncodedIri$", { Bya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Qgb = void 0; + function zN() { + Qgb || (Qgb = new Pgb().a()); + return Qgb; + } + function Rgb() { + zB.call(this); + } + Rgb.prototype = new Q52(); + Rgb.prototype.constructor = Rgb; + Rgb.prototype.a = function() { + zB.prototype.e.call(this, "float"); + return this; + }; + Rgb.prototype.$classData = r8({ Cya: 0 }, false, "amf.core.metamodel.Type$Float$", { Cya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Sgb = void 0; + function et3() { + Sgb || (Sgb = new Rgb().a()); + return Sgb; + } + function Tgb() { + zB.call(this); + } + Tgb.prototype = new Q52(); + Tgb.prototype.constructor = Tgb; + Tgb.prototype.a = function() { + zB.prototype.e.call(this, "int"); + return this; + }; + Tgb.prototype.$classData = r8({ Dya: 0 }, false, "amf.core.metamodel.Type$Int$", { Dya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ugb = void 0; + function Ac() { + Ugb || (Ugb = new Tgb().a()); + return Ugb; + } + function Vgb() { + zB.call(this); + } + Vgb.prototype = new Q52(); + Vgb.prototype.constructor = Vgb; + Vgb.prototype.a = function() { + zB.prototype.e.call(this, "url"); + return this; + }; + Vgb.prototype.$classData = r8({ Eya: 0 }, false, "amf.core.metamodel.Type$Iri$", { Eya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Wgb = void 0; + function yc() { + Wgb || (Wgb = new Vgb().a()); + return Wgb; + } + function Xgb() { + zB.call(this); + } + Xgb.prototype = new Q52(); + Xgb.prototype.constructor = Xgb; + Xgb.prototype.a = function() { + zB.prototype.e.call(this, "literalUri"); + return this; + }; + Xgb.prototype.$classData = r8({ Fya: 0 }, false, "amf.core.metamodel.Type$LiteralUri$", { Fya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var Ygb = void 0; + function SM() { + Ygb || (Ygb = new Xgb().a()); + return Ygb; + } + function Zgb() { + zB.call(this); + } + Zgb.prototype = new Q52(); + Zgb.prototype.constructor = Zgb; + Zgb.prototype.a = function() { + zB.prototype.e.call(this, "regexp"); + return this; + }; + Zgb.prototype.$classData = r8({ Gya: 0 }, false, "amf.core.metamodel.Type$RegExp$", { Gya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var $gb = void 0; + function kba() { + $gb || ($gb = new Zgb().a()); + return $gb; + } + function UM() { + ht2.call(this); + } + UM.prototype = new EAa(); + UM.prototype.constructor = UM; + d7 = UM.prototype; + d7.H = function() { + return "SortedArray"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof UM) { + var b10 = this.Fe; + a10 = a10.Fe; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.yd = function(a10) { + ht2.prototype.yd.call(this, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Hya: 0 }, false, "amf.core.metamodel.Type$SortedArray", { Hya: 1, wya: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + function ahb() { + zB.call(this); + } + ahb.prototype = new Q52(); + ahb.prototype.constructor = ahb; + ahb.prototype.a = function() { + zB.prototype.e.call(this, "string"); + return this; + }; + ahb.prototype.$classData = r8({ Iya: 0 }, false, "amf.core.metamodel.Type$Str$", { Iya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var bhb = void 0; + function qb() { + bhb || (bhb = new ahb().a()); + return bhb; + } + function chb() { + zB.call(this); + } + chb.prototype = new Q52(); + chb.prototype.constructor = chb; + chb.prototype.a = function() { + zB.prototype.e.call(this, "time"); + return this; + }; + chb.prototype.$classData = r8({ Jya: 0 }, false, "amf.core.metamodel.Type$Time$", { Jya: 1, Ry: 1, f: 1, Rb: 1, y: 1, v: 1, q: 1, o: 1 }); + var dhb = void 0; + function ehb(a10) { + var b10 = yc(), c10 = F6().Zd; + a10.y_(rb(new sb(), b10, G5(c10, "extends"), tb(new ub(), vb().hg, "extends", "Target base unit being extended by this extension model", H10()))); + b10 = a10.Ni(); + c10 = Gk().g; + a10.z_(ji(b10, c10)); + } + function Y6(a10) { + var b10 = qb(), c10 = F6().Ua; + a10.tz(rb(new sb(), b10, G5(c10, "name"), tb(new ub(), ci().Ua, "name", "Name for a data shape", H10()))); + b10 = qb(); + c10 = F6().Tb; + a10.pz(rb(new sb(), b10, G5(c10, "name"), tb(new ub(), vb().Tb, "name", "Name for a data shape", H10()))); + b10 = dl(); + c10 = F6().Ua; + a10.mz(rb(new sb(), b10, G5(c10, "defaultValue"), tb(new ub(), ci().Ua, "default value", "Default value parsed for a data shape property", H10()))); + b10 = qb(); + c10 = F6().Ua; + a10.nz(rb(new sb(), b10, G5(c10, "defaultValueStr"), tb( + new ub(), + ci().Ua, + "default value String", + "Textual representation of the parsed default value for the shape property", + H10() + ))); + b10 = new UM().yd(dl()); + c10 = F6().Ua; + a10.yz(rb(new sb(), b10, G5(c10, "in"), tb(new ub(), ci().Ua, "in", "Enumeration of possible values for a data shape property", H10()))); + b10 = new xc().yd(yc()); + c10 = F6().Eb; + a10.lz(rb(new sb(), b10, G5(c10, "closure"), tb(new ub(), vb().Eb, "inheritance closure", "Transitive closure of data shapes this particular shape inherits structure from", H10()))); + b10 = new xc().yd(qf()); + c10 = F6().Eb; + a10.sz(rb(new sb(), b10, G5(c10, "inherits"), tb(new ub(), vb().Eb, "inherits", "Relationship of inheritance between data shapes", H10()))); + b10 = new xc().yd(qf()); + c10 = F6().Ua; + a10.vz(rb(new sb(), b10, G5(c10, "or"), tb(new ub(), ci().Ua, "or", "Logical or composition of data shapes", H10()))); + b10 = new xc().yd(qf()); + c10 = F6().Ua; + a10.kz(rb(new sb(), b10, G5(c10, "and"), tb(new ub(), ci().Ua, "and", "Logical and composition of data shapes", H10()))); + b10 = new xc().yd(qf()); + c10 = F6().Ua; + a10.Az(rb(new sb(), b10, G5(c10, "xone"), tb(new ub(), ci().Ua, "exclusive or", "Logical exclusive or composition of data shapes", H10()))); + b10 = qf(); + c10 = F6().Ua; + a10.uz(rb(new sb(), b10, G5(c10, "not"), tb(new ub(), ci().Ua, "not", "Logical not composition of data shapes", H10()))); + b10 = qf(); + c10 = F6().Ua; + a10.rz(rb(new sb(), b10, G5(c10, "if"), tb(new ub(), ci().Ua, "if", "Condition for applying composition of data shapes", H10()))); + b10 = qf(); + c10 = F6().Ua; + a10.xz(rb(new sb(), b10, G5(c10, "then"), tb(new ub(), ci().Ua, "then", "Composition of data shape when if data shape is valid", H10()))); + b10 = qf(); + c10 = F6().Ua; + a10.qz(rb(new sb(), b10, G5(c10, "else"), tb(new ub(), ci().Ua, "else", "Composition of data shape when if data shape is invalid", H10()))); + b10 = zc(); + c10 = F6().Eb; + a10.wz(rb(new sb(), b10, G5(c10, "readOnly"), tb( + new ub(), + vb().Eb, + "read only", + "Read only property constraint", + H10() + ))); + b10 = zc(); + c10 = F6().Eb; + a10.zz(rb(new sb(), b10, G5(c10, "writeOnly"), tb(new ub(), vb().Eb, "write only", "Write only property constraint", H10()))); + b10 = zc(); + c10 = F6().Eb; + a10.oz(rb(new sb(), b10, G5(c10, "deprecated"), tb(new ub(), vb().Eb, "deprecated", "Deprecated annotation for a property constraint", H10()))); + a10.Bz(a10.R); + } + function AB(a10) { + return !!(a10 && a10.$classData && a10.$classData.ge.Yv); + } + function fhb() { + this.wd = this.bb = this.mc = this.ba = this.la = this.ko = this.zi = this.ig = this.R = this.qa = null; + this.xa = 0; + } + fhb.prototype = new u7(); + fhb.prototype.constructor = fhb; + d7 = fhb.prototype; + d7.a = function() { + ghb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "extensionName"), tb(new ub(), vb().Tb, "name", "Name of an entity", H10())); + a10 = Sk(); + b10 = F6().Zd; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().hg, "defined by", "Definition for the extended entity", H10())); + a10 = dl(); + b10 = F6().Zd; + this.zi = rb(new sb(), a10, G5(b10, "extension"), tb(new ub(), vb().hg, "extension", "Data structure associated to the extension", H10())); + a10 = qb(); + b10 = F6().Zd; + this.ko = rb(new sb(), a10, G5(b10, "element"), tb( + new ub(), + vb().hg, + "element", + "Element being extended", + H10() + )); + this.la = this.R; + a10 = F6().Ta; + a10 = G5(a10, "DomainExtension"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Domain Extension", "Extension to the model being parsed from RAML annotation or OpenAPI extensions\nThey must be a DomainPropertySchema (only in RAML) defining them.\nThe DomainPropertySchema might have an associated Data Shape that must validate the extension nested graph.\nThey are parsed as RDF graphs using a default transformation from a set of nested records into RDF.", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.ig, this.zi, this.ko], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Td().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ mza: 0 }, false, "amf.core.metamodel.domain.extensions.DomainExtensionModel$", { mza: 1, f: 1, Igb: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1 }); + var ghb = void 0; + function Ud() { + ghb || (ghb = new fhb().a()); + return ghb; + } + function hhb(a10) { + ii(); + a10 = [a10.R, a10.Va, a10.SC, a10.Aj]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + } + function ihb(a10) { + var b10 = dl(), c10 = F6().Zd; + a10.H8(rb(new sb(), b10, G5(c10, "dataNode"), tb(new ub(), vb().hg, "data node", "Associated dynamic structure for the declaration", H10()))); + b10 = new xc().yd(qb()); + c10 = F6().Zd; + a10.I8(rb(new sb(), b10, G5(c10, "variable"), tb(new ub(), vb().hg, "variable", "Variables to be replaced in the graph template introduced by an AbstractDeclaration", H10()))); + a10.J8(a10.R); + } + function rf() { + this.fh = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + rf.prototype = new u7(); + rf.prototype.constructor = rf; + function jhb() { + } + jhb.prototype = rf.prototype; + function Tca(a10, b10, c10, e10, f10) { + a10.Y().vb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10) { + return function(p10) { + if (null !== p10) { + var t10 = p10.ma(); + p10 = p10.ya(); + var v10 = false, A10 = null; + A10 = null; + var D10 = p10.r; + a: { + if (D10 instanceof rf && (v10 = true, A10 = D10, A10.j !== g10.j && !h10.eea.P(A10.j))) { + D10 = h10.to; + A10 = A10.VN(k10, l10, h10, false); + h10.to = D10; + D10 = A10; + break a; + } + if (v10 && A10.j === g10.j) + D10 = A10; + else if (D10 instanceof $r) { + A10 = D10.wb; + v10 = w6(/* @__PURE__ */ function(I10, L10, Y10, ia) { + return function(pa) { + var La = false; + var ob = null; + return pa instanceof rf && (La = true, ob = pa, ob.j !== I10.j && !L10.eea.P(ob.j)) ? (pa = L10.to, ob = ob.VN(Y10, ia, L10, false), L10.to = pa, ob) : La && ob.j === I10.j ? ob : pa; + }; + }(g10, h10, k10, l10)); + var C10 = K7(); + D10 = Zr(new $r(), A10.ka(v10, C10.u), D10.x); + } + } + Ui(m10.Y(), t10, D10, p10.x); + } else + throw new x7().d(p10); + }; + }(a10, f10, b10, e10, c10))); + } + function pma(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new Vk().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + b10 = Sd(c10, b10, e10); + c10 = ny(); + ig(a10, c10, b10); + return b10; + } + d7 = rf.prototype; + d7.a = function() { + lM(this); + this.fh = J5(DB(), H10()); + return this; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + function khb(a10, b10) { + b10 = NAa(a10, b10); + yi(b10.fh, a10.fh); + return b10; + } + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.zv = function() { + return "shape"; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.pG = function() { + var a10 = this.fa(); + return khb(this, Yi(O7(), a10)); + }; + d7.Zg = function() { + return qf().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + function M2a(a10) { + var b10 = B6(a10.Y(), qf().xd), c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + if (Za(f10).na()) { + var g10 = f10.gj(Wca()); + return g10 instanceof rf ? g10 : f10; + } + return f10; + }; + }(a10)), e10 = K7(); + return b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return g10.j !== f10.j; + }; + }(a10))); + } + function mC(a10, b10, c10) { + var e10 = nu(); + b10 ? e10 = J5(K7(), new Ib().ha([e10])) : (b10 = K7(), e10 = [B6(a10.Y(), ny()).ne(e10, Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + var h10 = B6(g10.aa, qf().R).A; + return f10.Wh(h10.b() ? null : h10.c(), g10); + }; + }(a10)))], e10 = J5(b10, new Ib().ha(e10))); + return B6(a10.Y(), qf().xd).Da() ? M2a(a10).ne(e10, Uc(/* @__PURE__ */ function(f10, g10) { + return function(h10, k10) { + if (g10.Ha(k10.j)) + return h10; + k10 = mC(k10, false, g10.Tm(k10.j)); + h10 = w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + t10 = w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + return C10.uq(D10); + }; + }(m10, t10)); + var v10 = K7(); + return p10.ka(t10, v10.u); + }; + }(f10, h10)); + var l10 = K7(); + return k10.bd(h10, l10.u); + }; + }(a10, c10))) : e10; + } + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + function Qg() { + this.Th = this.Ca = null; + } + Qg.prototype = new u7(); + Qg.prototype.constructor = Qg; + d7 = Qg.prototype; + d7.H = function() { + return "DefaultScalarNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Qg ? Bj(this.Ca, a10.Ca) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.nV = function() { + return this.oV(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.g5 = function() { + var a10 = this.Ca, b10 = qTa(); + return ih(new jh(), +N6(a10, b10, this.Th), Rs(O7(), this.Ca)); + }; + d7.Vb = function(a10, b10) { + this.Ca = a10; + this.Th = b10; + return this; + }; + d7.nf = function() { + var a10 = this.Ca, b10 = Dd(); + return ih(new jh(), N6(a10, b10, this.Th), Rs(O7(), this.Ca)); + }; + d7.oV = function() { + var a10 = this.Ca, b10 = pM(); + return ih(new jh(), !N6(a10, b10, this.Th), Rs(O7(), this.Ca)); + }; + d7.z = function() { + return X5(this); + }; + d7.Zf = function() { + var a10 = this.Ca, b10 = bc(); + return ih(new jh(), N6(a10, b10, this.Th).va, Rs(O7(), this.Ca)); + }; + d7.Up = function() { + var a10 = this.Ca, b10 = pM(); + return ih(new jh(), !!N6(a10, b10, this.Th), Rs(O7(), this.Ca)); + }; + d7.mE = function() { + var a10 = this.Ca, b10 = TAa(); + return ih(new jh(), N6(a10, b10, this.Th) | 0, Rs(O7(), this.Ca)); + }; + d7.$classData = r8({ wAa: 0 }, false, "amf.core.parser.DefaultScalarNode", { wAa: 1, f: 1, YAa: 1, LY: 1, y: 1, v: 1, q: 1, o: 1 }); + function Z6() { + CU.call(this); + } + Z6.prototype = new Vab(); + Z6.prototype.constructor = Z6; + Z6.prototype.a = function() { + CU.prototype.Sc.call(this, 0, 0); + return this; + }; + Z6.prototype.ID = function() { + return 1; + }; + Z6.prototype.tr = function() { + return 1; + }; + Z6.prototype.$classData = r8({ OAa: 0 }, false, "amf.core.parser.Position$ZERO$", { OAa: 1, Jga: 1, f: 1, ym: 1, y: 1, v: 1, q: 1, o: 1 }); + var lhb = void 0; + function ld() { + lhb || (lhb = new Z6().a()); + return lhb; + } + function kbb() { + CF.call(this); + this.GD = null; + } + kbb.prototype = new YLa(); + kbb.prototype.constructor = kbb; + d7 = kbb.prototype; + d7.H = function() { + return "FileNotFound"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kbb) { + var b10 = this.GD; + a10 = a10.GD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.GD; + default: + throw new U6().e("" + a10); + } + }; + d7.kn = function(a10) { + this.GD = a10; + var b10 = "File Not Found: " + a10.xo(); + CF.prototype.Ge.call(this, b10, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ JBa: 0 }, false, "amf.core.remote.FileNotFound", { JBa: 1, Nga: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function T52() { + CF.call(this); + this.GD = null; + } + T52.prototype = new YLa(); + T52.prototype.constructor = T52; + d7 = T52.prototype; + d7.H = function() { + return "NetworkError"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof T52) { + var b10 = this.GD; + a10 = a10.GD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.GD; + default: + throw new U6().e("" + a10); + } + }; + d7.kn = function(a10) { + this.GD = a10; + var b10 = "Network Error: " + a10.xo(); + CF.prototype.Ge.call(this, b10, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ OBa: 0 }, false, "amf.core.remote.NetworkError", { OBa: 1, Nga: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function $6() { + CF.call(this); + this.fW = null; + this.VS = 0; + } + $6.prototype = new m_(); + $6.prototype.constructor = $6; + d7 = $6.prototype; + d7.H = function() { + return "UnexpectedStatusCode"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof $6 ? this.fW === a10.fW && this.VS === a10.VS : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.fW; + case 1: + return this.VS; + default: + throw new U6().e("" + a10); + } + }; + d7.r1 = function(a10, b10) { + this.fW = a10; + this.VS = b10; + CF.prototype.Ge.call(this, "Unexpected status code '" + b10 + "' for resource '" + a10 + "'", null); + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.fW)); + a10 = OJ().Ga(a10, this.VS); + return OJ().fe(a10, 2); + }; + d7.$classData = r8({ $Ba: 0 }, false, "amf.core.remote.UnexpectedStatusCode", { $Ba: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function g22() { + } + g22.prototype = new zAa(); + g22.prototype.constructor = g22; + d7 = g22.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "JsBrowserHttpResourceLoader"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof g22 && true; + }; + d7.sF = function(a10) { + return this.vB(a10); + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.vB = function(a10) { + GK(); + var b10 = jta(), c10 = nu(); + a10 = ita(b10, a10, c10).Pq(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = g10.status | 0; + switch (h10) { + case 200: + return ZC(hp(), new j32().Hc(g10.responseText, f10)); + default: + return Pea(hp(), new $6().r1(f10, h10)); + } + }; + }(this, a10)), ml()).ZV(new fbb(), ml()); + return FK(0, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dCa: 0 }, false, "amf.core.remote.browser.JsBrowserHttpResourceLoader", { dCa: 1, zwa: 1, f: 1, X6: 1, y: 1, v: 1, q: 1, o: 1 }); + function h22() { + } + h22.prototype = new u7(); + h22.prototype.constructor = h22; + d7 = h22.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "JsServerFileResourceLoader"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof h22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.sF = function(a10) { + return ifa(this, a10); + }; + function ibb(a10) { + return 0 <= (a10.length | 0) && "file:" === a10.substring(0, 5) ? a10 : "file://" + a10; + } + d7.t = function() { + return V5(W5(), this); + }; + function jfa(a10, b10) { + GK(); + a10 = W8a(QSa().R_(b10)).Yg(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = KLa(e10, f10); + var g10 = ibb(e10); + Gq(); + var h10 = Saa(e10); + h10.b() ? h10 = y7() : (h10 = h10.c(), Gq(), h10 = Taa(h10)); + return new j32().YT(f10, g10, h10); + }; + }(a10, b10)), ml()).YV(hbb(a10, b10), ml()); + return FK(0, a10); + } + d7.vB = function(a10) { + return ifa(this, a10); + }; + d7.sQ = function(a10) { + return kfa(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.aG = function(a10) { + return kfa(a10); + }; + h22.prototype.accepts = function(a10) { + return this.sQ(a10); + }; + h22.prototype.fetch = function(a10) { + return this.sF(a10); + }; + h22.prototype.ensureFileAuthority = function(a10) { + return ibb(a10); + }; + h22.prototype.fetchFile = function(a10) { + return jfa(this, a10); + }; + h22.prototype.$classData = r8({ gCa: 0 }, false, "amf.core.remote.server.JsServerFileResourceLoader", { gCa: 1, f: 1, Fgb: 1, X6: 1, y: 1, v: 1, q: 1, o: 1 }); + function i22() { + } + i22.prototype = new zAa(); + i22.prototype.constructor = i22; + d7 = i22.prototype; + d7.a = function() { + return this; + }; + d7.H = function() { + return "JsServerHttpResourceLoader"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof i22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.sF = function(a10) { + return this.vB(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.vB = function(a10) { + var b10 = new AF().a(); + if (0 <= (a10.length | 0) && "https:" === a10.substring(0, 6)) + try { + Faa.get(a10, mhb(this, a10, b10)).on("error", nhb(this, b10)); + } catch (e10) { + if (a10 = Ph(E6(), e10), null !== a10) + a10 = new T52().kn(a10), Gj(b10, a10); + else + throw e10; + } + else + try { + Eaa.get(a10, mhb(this, a10, b10)).on("error", nhb(this, b10)); + } catch (e10) { + if (a10 = Ph(E6(), e10), null !== a10) + a10 = new T52().kn(a10), Gj(b10, a10); + else + throw e10; + } + GK(); + a10 = new lbb(); + var c10 = ml(); + b10 = fxa(b10, a10, c10); + return FK(0, b10); + }; + function nhb(a10, b10) { + return /* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = new T52().kn(new nb().e(ka(f10))); + return Gj(e10, f10); + }; + }(a10, b10); + } + d7.z = function() { + return X5(this); + }; + function ohb(a10, b10, c10, e10) { + var f10 = new qd().d(""), g10 = b10.statusCode | 0; + if (300 <= g10) + return a10 = new $6().r1(e10, g10), Gj(c10, a10); + b10.on("data", /* @__PURE__ */ function(h10, k10) { + return function(l10) { + k10.oa = "" + k10.oa + ka(l10); + }; + }(a10, f10)); + return b10.on("end", /* @__PURE__ */ function(h10, k10, l10, m10, p10) { + return function() { + try { + var t10 = k10.headers; + if (LK().aC.call(t10, "content-type")) + var v10 = t10["content-type"]; + else + throw new iL().e("key not found: content-type"); + var A10 = new z7().d(v10); + } catch (D10) { + if (null !== Ph(E6(), D10)) + A10 = y7(); + else + throw D10; + } + t10 = new j32().qv(m10.oa, p10, A10); + return Ij(l10, t10); + }; + }(a10, b10, c10, f10, e10)); + } + function mhb(a10, b10, c10) { + return /* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + return ohb(e10, h10, f10, g10); + }; + }(a10, c10, b10); + } + d7.$classData = r8({ jCa: 0 }, false, "amf.core.remote.server.JsServerHttpResourceLoader", { jCa: 1, zwa: 1, f: 1, X6: 1, y: 1, v: 1, q: 1, o: 1 }); + function hN() { + } + hN.prototype = new U52(); + hN.prototype.constructor = hN; + hN.prototype.a = function() { + return this; + }; + hN.prototype.P = function(a10) { + return this.cu(a10); + }; + hN.prototype.cu = function(a10) { + if (RM(a10)) { + a10 = a10.Y(); + var b10 = Zf().xj; + return a10.vb.Ha(b10); + } + return false; + }; + hN.prototype.$classData = r8({ DCa: 0 }, false, "amf.core.resolution.stages.selectors.ExternalSourceElementSelector$", { DCa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1 }); + var fCa = void 0; + function a7() { + this.ox = null; + } + a7.prototype = new U52(); + a7.prototype.constructor = a7; + a7.prototype.P = function(a10) { + return this.cu(a10); + }; + a7.prototype.cu = function(a10) { + return this.ox.Ha(a10.j) || (this.ox.Tm(a10.j), false); + }; + function eCa(a10) { + var b10 = new a7(); + b10.ox = a10; + return b10; + } + a7.prototype.$classData = r8({ ECa: 0 }, false, "amf.core.resolution.stages.selectors.KnownElementIdSelector", { ECa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1 }); + function b72() { + } + b72.prototype = new U52(); + b72.prototype.constructor = b72; + b72.prototype.a = function() { + return this; + }; + b72.prototype.P = function(a10) { + return this.cu(a10); + }; + b72.prototype.cu = function(a10) { + return a10 instanceof ns; + }; + b72.prototype.$classData = r8({ FCa: 0 }, false, "amf.core.resolution.stages.selectors.LinkNodeSelector$", { FCa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1 }); + var phb = void 0; + function iCa() { + phb || (phb = new b72().a()); + return phb; + } + function c7() { + } + c7.prototype = new U52(); + c7.prototype.constructor = c7; + c7.prototype.a = function() { + return this; + }; + c7.prototype.P = function(a10) { + return this.cu(a10); + }; + c7.prototype.cu = function(a10) { + return ut(a10) ? Za(a10).na() : false; + }; + c7.prototype.$classData = r8({ GCa: 0 }, false, "amf.core.resolution.stages.selectors.LinkSelector$", { GCa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1 }); + var qhb = void 0; + function hCa() { + qhb || (qhb = new c7().a()); + return qhb; + } + function d72() { + this.Poa = this.Ooa = null; + } + d72.prototype = new U52(); + d72.prototype.constructor = d72; + d72.prototype.P = function(a10) { + return this.cu(a10); + }; + function gCa(a10, b10) { + var c10 = new d72(); + c10.Ooa = a10; + c10.Poa = b10; + return c10; + } + d72.prototype.cu = function(a10) { + return this.Ooa.cu(a10) ? true : this.Poa.cu(a10); + }; + d72.prototype.$classData = r8({ HCa: 0 }, false, "amf.core.resolution.stages.selectors.OrSelector", { HCa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1 }); + function rhb() { + this.sy = this.da = this.Fg = this.Ct = this.jx = this.Iv = this.zm = this.Ld = null; + } + rhb.prototype = new u7(); + rhb.prototype.constructor = rhb; + d7 = rhb.prototype; + d7.H = function() { + return "AMFValidationResult"; + }; + d7.E = function() { + return 8; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rhb) { + if (this.Ld === a10.Ld && this.zm === a10.zm && this.Iv === a10.Iv) { + var b10 = this.jx, c10 = a10.jx; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 && this.Ct === a10.Ct ? (b10 = this.Fg, c10 = a10.Fg, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.da, c10 = a10.da, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? Va(Wa(), this.sy, a10.sy) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ld; + case 1: + return this.zm; + case 2: + return this.Iv; + case 3: + return this.jx; + case 4: + return this.Ct; + case 5: + return this.Fg; + case 6: + return this.da; + case 7: + return this.sy; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + ue4(); + var a10 = new Tj().a(); + Vj(a10, "\n- Source: " + this.Ct + "\n"); + Vj(a10, " Message: " + this.Ld + "\n"); + Vj(a10, " Level: " + this.zm + "\n"); + Vj(a10, " Target: " + this.Iv + "\n"); + var b10 = this.jx; + Vj(a10, " Property: " + (b10.b() ? "" : b10.c()) + "\n"); + Vj(a10, " Position: " + this.Fg + "\n"); + b10 = this.da; + Vj(a10, " Location: " + (b10.b() ? "" : b10.c()) + "\n"); + return a10.Ef.qf; + }; + d7.tr = function(a10) { + return shb(this, a10); + }; + d7.gs = function(a10) { + return shb(this, a10); + }; + function Xb(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new rhb(); + l10.Ld = a10; + l10.zm = b10; + l10.Iv = c10; + l10.jx = e10; + l10.Ct = f10; + l10.Fg = g10; + l10.da = h10; + l10.sy = k10; + ue4(); + b10 = new Tj().a(); + Vj(b10, "\n- Source: " + f10 + "\n"); + Vj(b10, " Message: " + a10 + "\n"); + Vj(b10, " Property: " + (e10.b() ? "" : e10.c()) + "\n"); + return l10; + } + d7.z = function() { + return X5(this); + }; + function shb(a10, b10) { + var c10 = null !== b10.Fg ? b10.Fg : y7(), e10 = null !== a10.Fg ? a10.Fg : y7(); + if (e10.b()) + var f10 = y7(); + else + f10 = e10.c(), f10 = new z7().d(f10.yc.$d); + f10 = f10.b() ? new CU().Sc(0, 0) : f10.c(); + if (c10.b()) + var g10 = y7(); + else + g10 = c10.c(), g10 = new z7().d(g10.yc.$d); + f10 = f10.ID(g10.b() ? new CU().Sc(0, 0) : g10.c()); + switch (f10) { + case 0: + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.yc.ms)); + e10 = e10.b() ? new CU().Sc(0, 0) : e10.c(); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.yc.ms)); + c10 = e10.ID(c10.b() ? new CU().Sc(0, 0) : c10.c()); + switch (c10) { + case 0: + c10 = a10.jx; + c10 = c10.b() ? "" : c10.c(); + e10 = b10.jx; + e10 = e10.b() ? "" : e10.c(); + c10 = c10 === e10 ? 0 : c10 < e10 ? -1 : 1; + switch (c10) { + case 0: + c10 = Vb().Ia(a10.Iv); + c10 = c10.b() ? "" : c10.c(); + e10 = Vb().Ia(b10.Iv); + e10 = e10.b() ? "" : e10.c(); + c10 = c10 === e10 ? 0 : c10 < e10 ? -1 : 1; + switch (c10) { + case 0: + c10 = Vb().Ia(a10.Ct); + c10 = c10.b() ? "" : c10.c(); + e10 = Vb().Ia(b10.Ct); + e10 = e10.b() ? "" : e10.c(); + c10 = c10 === e10 ? 0 : c10 < e10 ? -1 : 1; + switch (c10) { + case 0: + a10 = Vb().Ia(a10.Ld); + a10 = a10.b() ? "" : a10.c(); + b10 = Vb().Ia(b10.Ld); + b10 = b10.b() ? "" : b10.c(); + b10 = a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + break; + default: + b10 = c10; + } + break; + default: + b10 = c10; + } + break; + default: + b10 = c10; + } + break; + default: + b10 = c10; + } + break; + default: + b10 = f10; + } + return 0 < b10 ? 1 : 0 === b10 ? b10 : -1; + } + d7.$classData = r8({ nDa: 0 }, false, "amf.core.validation.AMFValidationResult", { nDa: 1, f: 1, cM: 1, ym: 1, y: 1, v: 1, q: 1, o: 1 }); + function l22() { + this.Fg = 0; + this.r = this.$ = null; + } + l22.prototype = new u7(); + l22.prototype.constructor = l22; + d7 = l22.prototype; + d7.H = function() { + return "AliasesLocation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof l22 ? this.Fg === a10.Fg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.ue = function(a10) { + this.Fg = a10; + this.$ = "aliases-location"; + this.r = "" + a10; + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.Fg); + return OJ().fe(a10, 1); + }; + var thb = r8({ NEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.AliasesLocation", { NEa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + l22.prototype.$classData = thb; + function n22() { + this.r = this.$ = null; + } + n22.prototype = new u7(); + n22.prototype.constructor = n22; + d7 = n22.prototype; + d7.a = function() { + this.$ = "custom-id"; + this.r = "true"; + return this; + }; + d7.H = function() { + return "CustomId"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof n22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var uhb = r8({ PEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.CustomId", { PEa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + n22.prototype.$classData = uhb; + function p22() { + this.r = this.$ = null; + } + p22.prototype = new u7(); + p22.prototype.constructor = p22; + d7 = p22.prototype; + d7.a = function() { + this.$ = "json-pointer-ref"; + this.r = "true"; + return this; + }; + d7.H = function() { + return "JsonPointerRef"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof p22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var jNa = r8({ REa: 0 }, false, "amf.plugins.document.vocabularies.annotations.JsonPointerRef", { REa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + p22.prototype.$classData = jNa; + function r22() { + this.r = this.$ = null; + } + r22.prototype = new u7(); + r22.prototype.constructor = r22; + d7 = r22.prototype; + d7.a = function() { + this.$ = "ref-include"; + this.r = "true"; + return this; + }; + d7.H = function() { + return "RefInclude"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof r22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var hNa = r8({ TEa: 0 }, false, "amf.plugins.document.vocabularies.annotations.RefInclude", { TEa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + r22.prototype.$classData = hNa; + function vhb() { + this.p = this.sK = null; + } + vhb.prototype = new u7(); + vhb.prototype.constructor = vhb; + d7 = vhb.prototype; + d7.H = function() { + return "ExternalEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vhb) { + var b10 = this.sK, c10 = a10.sK; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.sK; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.sK.g, dd().Zc).A; + b10 = b10.b() ? null : b10.c(); + var c10 = B6(this.sK.g, dd().Kh).A; + cx(new dx(), b10, c10.b() ? null : c10.c(), Q5().Na, ld()).Qa(a10); + }; + function bNa(a10, b10) { + var c10 = new vhb(); + c10.sK = a10; + c10.p = b10; + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.sK.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ VEa: 0 }, false, "amf.plugins.document.vocabularies.emitters.common.ExternalEmitter", { VEa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function whb() { + this.Xb = this.p = this.Uh = null; + } + whb.prototype = new u7(); + whb.prototype.constructor = whb; + d7 = whb.prototype; + d7.H = function() { + return "ReferenceEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof whb) { + var b10 = this.Uh, c10 = a10.Uh; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Uh; + b10 instanceof ad ? (b10 = B6(b10.g, bd().Kh).A, b10 = b10.b() ? null : b10.c()) : b10 = this.Uh.j; + b10 = this.Xb.Ja(b10); + if (b10 instanceof z7) { + var c10 = b10.i; + null !== c10 && (b10 = c10.ma(), c10 = c10.ya(), cx(new dx(), b10, c10, Q5().Na, ld()).Qa(a10)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ yFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.ReferenceEmitter", { yFa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ed() { + this.Aba = this.Xb = this.p = this.wf = null; + } + ed.prototype = new u7(); + ed.prototype.constructor = ed; + d7 = ed.prototype; + d7.H = function() { + return "ReferencesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ed) { + var b10 = this.wf, c10 = a10.wf; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.Aba.Da()) { + T6(); + var b10 = mh(T6(), "uses"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.Aba, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.p, D10 = t10.Xb, C10 = new whb(); + C10.Uh = v10; + C10.p = A10; + C10.Xb = D10; + return C10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.ZT = function(a10, b10, c10) { + this.wf = a10; + this.p = b10; + this.Xb = c10; + a10 = a10.Ve(); + b10 = new zbb(); + c10 = K7(); + this.Aba = a10.ec(b10, c10.u); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.wf.fa(), q5(thb)); + a10.b() ? a10 = y7() : (a10 = a10.c().Fg, a10 = new z7().d(new CU().Sc(a10, 0))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ zFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.ReferencesEmitter", { zFa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function xhb() { + this.Xb = this.p = this.Uh = null; + } + xhb.prototype = new u7(); + xhb.prototype.constructor = xhb; + d7 = xhb.prototype; + d7.H = function() { + return "ReferenceEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xhb) { + var b10 = this.Uh, c10 = a10.Uh; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Xb.Ja(this.Uh.j); + if (b10 instanceof z7) { + var c10 = b10.i; + null !== c10 && (b10 = c10.ma(), c10 = c10.ya(), cx(new dx(), b10, c10, Q5().Na, ld()).Qa(a10)); + } + }; + d7.ZT = function(a10, b10, c10) { + this.Uh = a10; + this.p = b10; + this.Xb = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ QFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.ReferenceEmitter", { QFa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function yhb() { + this.Xb = this.p = this.wf = null; + } + yhb.prototype = new u7(); + yhb.prototype.constructor = yhb; + d7 = yhb.prototype; + d7.H = function() { + return "ReferencesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof yhb) { + var b10 = this.wf, c10 = a10.wf; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.wf.Ve(), c10 = new Mbb(), e10 = K7(); + c10 = b10.ec(c10, e10.u); + if (c10.Da()) { + T6(); + e10 = mh(T6(), "uses"); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10), k10 = wr(), l10 = this.p, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new xhb().ZT(v10, t10.p, t10.Xb); + }; + }(this)), p10 = K7(); + jr(k10, l10.zb(c10.ka(m10, p10.u)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.ZT = function(a10, b10, c10) { + this.wf = a10; + this.p = b10; + this.Xb = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.wf.fa(), q5(thb)); + a10.b() ? a10 = y7() : (a10 = a10.c().Fg, a10 = new z7().d(new CU().Sc(a10, 0))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ RFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.ReferencesEmitter", { RFa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function AV() { + this.p = this.ff = this.zM = null; + } + AV.prototype = new u7(); + AV.prototype.constructor = AV; + d7 = AV.prototype; + d7.H = function() { + return "ImportEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof AV) { + var b10 = this.zM, c10 = a10.zM; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.ff, c10 = a10.ff, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zM; + case 1: + return this.ff; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Lc(this.ff); + b10 = b10.b() ? this.ff.j : b10.c(); + b10 = Mc(ua(), b10, "/"); + b10 = Oc(new Pc().fd(b10)); + var c10 = Lc(this.ff); + b10 = (c10.b() ? this.ff.j : c10.c()).split(b10).join(""); + var e10 = B6(this.ff.g, bd().xc).Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + g10 = g10.j; + var h10 = B6(f10.zM.g, td().sN).A; + return g10 === (h10.b() ? null : h10.c()); + }; + }(this))); + a: { + if (e10 instanceof z7 && (c10 = e10.i, null !== c10)) { + e10 = Lc(c10); + c10 = e10.b() ? c10.j : e10.c(); + break a; + } + if (y7() === e10) + throw mb(E6(), new nb().e("Cannot regenerate vocabulary link without reference")); + throw new x7().d(e10); + } + b10 = -1 !== (c10.indexOf(b10) | 0) ? c10.split(b10).join("") : c10.split("file://").join(""); + c10 = B6(this.zM.g, td().Xp).A; + cx(new dx(), c10.b() ? null : c10.c(), b10, Q5().Na, ld()).Qa(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.zM.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ WFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.ImportEmitter", { WFa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function zhb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.vh = this.qa = this.g = this.ba = null; + } + zhb.prototype = new u7(); + zhb.prototype.constructor = zhb; + d7 = zhb.prototype; + d7.a = function() { + Ahb = this; + Cr(this); + tU(this); + a22(this); + NN(this); + var a10 = F6().$c; + a10 = G5(a10, "DialectFragment"); + var b10 = Jk().ba; + this.ba = ji(a10, b10); + a10 = this.vh; + b10 = this.uc; + var c10 = Jk().g; + this.g = ji(a10, ji(b10, c10)); + this.qa = tb(new ub(), vb().$c, "Dialect Fragment", "AML dialect mapping fragment that can be included in multiple AML dialects", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new BO().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ hGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectFragmentModel$", { hGa: 1, f: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, KF: 1 }); + var Ahb = void 0; + function Bhb() { + Ahb || (Ahb = new zhb().a()); + return Ahb; + } + function Chb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.Ic = this.vh = this.qa = this.g = this.ba = null; + } + Chb.prototype = new u7(); + Chb.prototype.constructor = Chb; + d7 = Chb.prototype; + d7.a = function() { + Dhb = this; + Cr(this); + tU(this); + b22(this); + NN(this); + var a10 = F6().$c; + a10 = G5(a10, "DialectLibrary"); + var b10 = Gk().ba; + this.ba = ji(a10, b10); + a10 = this.vh; + b10 = this.uc; + var c10 = Af().g; + this.g = ji(a10, ji(b10, c10)); + this.qa = tb(new ub(), vb().$c, "Dialect Library", "Library of AML mappings that can be reused in different AML dialects", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new AO().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ mGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectLibraryModel$", { mGa: 1, f: 1, Sy: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, KF: 1 }); + var Dhb = void 0; + function Ehb() { + Dhb || (Dhb = new Chb().a()); + return Dhb; + } + function Fhb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.Ic = this.vh = this.qa = this.g = this.ba = this.$C = this.Kh = this.R = null; + } + Fhb.prototype = new u7(); + Fhb.prototype.constructor = Fhb; + d7 = Fhb.prototype; + d7.a = function() { + Ghb = this; + Cr(this); + tU(this); + b22(this); + NN(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "name for an entity", H10())); + a10 = qb(); + b10 = F6().$c; + this.Kh = rb(new sb(), a10, G5(b10, "base"), tb(new ub(), vb().$c, "base", "Base URI prefix for definitions in this vocabulary", H10())); + a10 = new xc().yd(td()); + b10 = F6().bv; + this.$C = rb(new sb(), a10, G5(b10, "imports"), tb(new ub(), ci().bv, "import", "import relationships between vocabularies", H10())); + a10 = F6().$c; + a10 = G5(a10, "Vocabulary"); + b10 = F6().bv; + b10 = G5(b10, "Ontology"); + var c10 = Bq().ba; + this.ba = ji(a10, ji(b10, c10)); + a10 = this.R; + b10 = this.$C; + c10 = this.vh; + var e10 = this.Ic, f10 = this.Kh, g10 = Bq().uc, h10 = Bq().g; + this.g = ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, h10)))))); + this.qa = tb(new ub(), vb().$c, "Vocabulary", "Basic primitives for the declaration of vocabularies.", H10()); + return this; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ad().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ pGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.VocabularyModel$", { pGa: 1, f: 1, Sy: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, KF: 1 }); + var Ghb = void 0; + function bd() { + Ghb || (Ghb = new Fhb().a()); + return Ghb; + } + function Hhb() { + this.wd = this.bb = this.mc = this.Ts = this.at = this.Zt = this.qD = this.qa = this.ba = this.$fa = this.YF = this.ZI = this.Ey = this.vj = this.wj = this.zl = this.ji = this.EJ = this.Hx = this.nr = this.bw = this.St = this.bh = this.Gf = this.Yh = this.R = null; + this.xa = 0; + } + Hhb.prototype = new u7(); + Hhb.prototype.constructor = Hhb; + d7 = Hhb.prototype; + d7.a = function() { + Ihb = this; + Cr(this); + uU(this); + ud(this); + Bba(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name in the source AST for the mapped property", H10())); + a10 = yc(); + b10 = F6().Ua; + this.Yh = rb(new sb(), a10, G5(b10, "path"), tb(new ub(), ci().Ua, "path", "URI in the mapped graph for this mapped property", H10())); + a10 = yc(); + b10 = F6().Ua; + this.Gf = rb(new sb(), a10, G5(b10, "datatype"), tb(new ub(), ci().Ua, "datatype", "Scalar constraint over the type of the mapped property", H10())); + a10 = new UM().yd(yc()); + b10 = F6().Ua; + this.bh = rb(new sb(), a10, G5(b10, "node"), tb(new ub(), ci().Ua, "range", "Object constraint over the type of the mapped property", H10())); + a10 = qb(); + b10 = F6().$c; + this.St = rb(new sb(), a10, G5(b10, "mapProperty"), tb(new ub(), vb().$c, "map label property", "Marks the mapping as a 'map' mapping syntax. Directly related with mapTermKeyProperty", H10())); + a10 = qb(); + b10 = F6().$c; + this.bw = rb(new sb(), a10, G5(b10, "mapValueProperty"), tb( + new ub(), + vb().$c, + "map label value property", + "Marks the mapping as a 'map value' mapping syntax. Directly related with mapTermValueProperty", + H10() + )); + a10 = yc(); + b10 = F6().$c; + this.nr = rb(new sb(), a10, G5(b10, "mapTermProperty"), tb(new ub(), vb().$c, "map term property uri", "Marks the mapping as a 'map' mapping syntax. ", H10())); + a10 = yc(); + b10 = F6().$c; + this.Hx = rb(new sb(), a10, G5(b10, "mapTermValueProperty"), tb(new ub(), vb().$c, "map term value property", "Marks the mapping as a 'map value' mapping syntax", H10())); + a10 = zc(); + b10 = F6().$c; + this.EJ = rb(new sb(), a10, G5(b10, "sorted"), tb(new ub(), vb().$c, "sorted", "Marks the mapping as requiring order in the mapped collection of nodes", H10())); + a10 = Ac(); + b10 = F6().Ua; + this.ji = rb(new sb(), a10, G5(b10, "minCount"), tb(new ub(), ci().Ua, "min count", "Minimum count constraint over tha mapped property", H10())); + a10 = qb(); + b10 = F6().Ua; + this.zl = rb(new sb(), a10, G5(b10, "pattern"), tb(new ub(), ci().Ua, "pattern", "Pattern constraint over the mapped property", H10())); + a10 = hi(); + b10 = F6().Ua; + this.wj = rb(new sb(), a10, G5(b10, "minInclusive"), tb(new ub(), ci().Ua, "min inclusive", "Minimum inclusive constraint over the mapped property", H10())); + a10 = hi(); + b10 = F6().Ua; + this.vj = rb(new sb(), a10, G5(b10, "maxInclusive"), tb( + new ub(), + ci().Ua, + "max inclusive", + "Maximum inclusive constraint over the mapped property", + H10() + )); + a10 = zc(); + b10 = F6().$c; + this.Ey = rb(new sb(), a10, G5(b10, "allowMultiple"), tb(new ub(), vb().$c, "allow multiple", "Allows multiple mapped nodes for the property mapping", H10())); + a10 = new UM().yd(Bc()); + b10 = F6().Ua; + this.ZI = rb(new sb(), a10, G5(b10, "in"), tb(new ub(), ci().Ua, "in", "Enum constraint for the values of the property mapping", H10())); + a10 = zc(); + b10 = F6().$c; + this.YF = rb(new sb(), a10, G5(b10, "unique"), tb(new ub(), vb().$c, "unique", "Marks the values for the property mapping as a primary key for this type of node", H10())); + a10 = zc(); + b10 = F6().$c; + this.$fa = rb( + new sb(), + a10, + G5(b10, "externallyLinkable"), + tb(new ub(), vb().$c, "linkable", "Marks this object property as supporting external links", H10()) + ); + a10 = F6().$c; + a10 = G5(a10, "NodePropertyMapping"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().$c, "Node Property Mapping", "Semantic mapping from an input AST in a dialect document to the output graph of information for a class of output node", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.Eia = function(a10) { + this.Zt = a10; + }; + d7.nc = function() { + }; + d7.Dia = function(a10) { + this.qD = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + var a10 = this.Yh, b10 = this.R, c10 = this.Gf, e10 = this.bh, f10 = this.St, g10 = this.bw, h10 = this.nr, k10 = this.Hx, l10 = this.ji, m10 = this.zl, p10 = this.wj, t10 = this.vj, v10 = this.Ey, A10 = this.EJ, D10 = this.ZI, C10 = this.qD, I10 = this.YF, L10 = this.$fa, Y10 = this.Zt, ia = this.at, pa = nc().g; + return ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, ji(h10, ji(k10, ji(l10, ji(m10, ji(p10, ji(t10, ji(v10, ji(A10, ji(D10, ji(C10, ji(I10, ji(L10, ji(Y10, ji(ia, pa)))))))))))))))))))); + }; + d7.KN = function(a10) { + this.at = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new rO().K(new S6().a(), a10); + }; + d7.JN = function(a10) { + this.Ts = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ AGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.PropertyMappingModel$", { AGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, PR: 1, yGa: 1 }); + var Ihb = void 0; + function $d() { + Ihb || (Ihb = new Hhb().a()); + return Ihb; + } + function tYa() { + this.r = this.$ = this.q2 = null; + } + tYa.prototype = new u7(); + tYa.prototype.constructor = tYa; + d7 = tYa.prototype; + d7.H = function() { + return "LocalLinkPath"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof tYa ? this.q2 === a10.q2 : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.q2; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.q2 = a10; + this.$ = "local-link-path"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dJa: 0 }, false, "amf.plugins.document.webapi.annotations.LocalLinkPath", { dJa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function ZV() { + this.N = null; + } + ZV.prototype = new HEa(); + ZV.prototype.constructor = ZV; + d7 = ZV.prototype; + d7.H = function() { + return "Oas2SpecEmitterFactory"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ZV) { + var b10 = this.N; + a10 = a10.N; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.N; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Npa = function(a10, b10, c10, e10) { + return Jhb(a10, b10, c10, e10, this.N); + }; + d7.aA = function(a10) { + NO.prototype.aA.call(this, a10); + return this; + }; + d7.Opa = function(a10, b10, c10, e10) { + return new xdb().zaa(a10, b10, c10, e10, this.N); + }; + d7.z = function() { + return X5(this); + }; + d7.Lj = function() { + return this.N; + }; + d7.$classData = r8({ sJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas2SpecEmitterFactory", { sJa: 1, AJa: 1, f: 1, i7: 1, y: 1, v: 1, q: 1, o: 1 }); + function Khb() { + this.m = null; + } + Khb.prototype = new u7(); + Khb.prototype.constructor = Khb; + d7 = Khb.prototype; + d7.H = function() { + return "Oas2VersionFactory"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Khb) { + var b10 = this.m; + a10 = a10.m; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.m; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Rpa = function(a10, b10) { + var c10 = this.m, e10 = new Lhb(); + e10.ie = a10; + e10.ds = b10; + WP.prototype.ZG.call(e10, a10, b10, Qm().lh, c10); + return e10; + }; + d7.Qpa = function(a10, b10) { + return new e72().ZG(a10, b10, Pl().lh, this.m); + }; + d7.Mpa = function(a10, b10) { + return new f72().q1(a10, b10, this.m); + }; + d7.z = function() { + return X5(this); + }; + d7.fE = function(a10) { + this.m = a10; + return this; + }; + d7.Ppa = function(a10, b10) { + return new e72().ZG(a10, b10, Jl().lh, this.m); + }; + d7.HV = function(a10, b10, c10, e10) { + return new n62().YO(a10, b10, c10, e10, this.m); + }; + d7.$classData = r8({ tJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas2VersionFactory", { tJa: 1, f: 1, BJa: 1, j7: 1, y: 1, v: 1, q: 1, o: 1 }); + function pA() { + this.N = null; + } + pA.prototype = new HEa(); + pA.prototype.constructor = pA; + d7 = pA.prototype; + d7.H = function() { + return "Oas3SpecEmitterFactory"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pA) { + var b10 = this.N; + a10 = a10.N; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.N; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Npa = function(a10, b10, c10, e10) { + return Jhb(a10, b10, c10, e10, this.N); + }; + d7.aA = function(a10) { + NO.prototype.aA.call(this, a10); + return this; + }; + d7.Opa = function(a10, b10, c10, e10) { + return new Hdb().zaa(a10, b10, c10, e10, this.N); + }; + d7.z = function() { + return X5(this); + }; + d7.Lj = function() { + return this.N; + }; + d7.$classData = r8({ wJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas3SpecEmitterFactory", { wJa: 1, AJa: 1, f: 1, i7: 1, y: 1, v: 1, q: 1, o: 1 }); + function g7() { + this.m = null; + } + g7.prototype = new u7(); + g7.prototype.constructor = g7; + d7 = g7.prototype; + d7.H = function() { + return "Oas3VersionFactory"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g7) { + var b10 = this.m; + a10 = a10.m; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.m; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Rpa = function(a10, b10) { + return new e72().ZG(a10, b10, Qm().lh, this.m); + }; + d7.Qpa = function(a10, b10) { + return new e72().ZG(a10, b10, Pl().lh, this.m); + }; + d7.Mpa = function(a10, b10) { + return new h72().q1(a10, b10, this.m); + }; + d7.z = function() { + return X5(this); + }; + d7.fE = function(a10) { + this.m = a10; + return this; + }; + d7.Ppa = function(a10, b10) { + return new e72().ZG(a10, b10, Jl().lh, this.m); + }; + d7.HV = function(a10, b10, c10, e10) { + return new i7().YO(a10, b10, c10, e10, this.m); + }; + d7.$classData = r8({ xJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas3VersionFactory", { xJa: 1, f: 1, BJa: 1, j7: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mhb() { + this.Id = null; + } + Mhb.prototype = new A32(); + Mhb.prototype.constructor = Mhb; + Mhb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 AnnotationTypeDeclaration"); + return this; + }; + Mhb.prototype.$classData = r8({ KKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10AnnotationTypeDeclaration$", { KKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Nhb = void 0; + function Wka() { + Nhb || (Nhb = new Mhb().a()); + return Nhb; + } + function Ohb() { + this.Id = null; + } + Ohb.prototype = new A32(); + Ohb.prototype.constructor = Ohb; + Ohb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 DataType"); + return this; + }; + Ohb.prototype.$classData = r8({ LKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10DataType$", { LKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Phb = void 0; + function Tka() { + Phb || (Phb = new Ohb().a()); + return Phb; + } + function Qhb() { + this.Id = null; + } + Qhb.prototype = new A32(); + Qhb.prototype.constructor = Qhb; + Qhb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 DocumentationItem"); + return this; + }; + Qhb.prototype.$classData = r8({ MKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10DocumentationItem$", { MKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Rhb = void 0; + function Ska() { + Rhb || (Rhb = new Qhb().a()); + return Rhb; + } + function Shb() { + this.Id = null; + } + Shb.prototype = new A32(); + Shb.prototype.constructor = Shb; + Shb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 NamedExample"); + return this; + }; + Shb.prototype.$classData = r8({ NKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10NamedExample$", { NKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Thb = void 0; + function tx() { + Thb || (Thb = new Shb().a()); + return Thb; + } + function Uhb() { + this.Id = null; + } + Uhb.prototype = new A32(); + Uhb.prototype.constructor = Uhb; + Uhb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 ResourceType"); + return this; + }; + Uhb.prototype.$classData = r8({ OKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10ResourceType$", { OKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Vhb = void 0; + function Uka() { + Vhb || (Vhb = new Uhb().a()); + return Vhb; + } + function Whb() { + this.Id = null; + } + Whb.prototype = new A32(); + Whb.prototype.constructor = Whb; + Whb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 SecurityScheme"); + return this; + }; + Whb.prototype.$classData = r8({ PKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10SecurityScheme$", { PKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Xhb = void 0; + function Xka() { + Xhb || (Xhb = new Whb().a()); + return Xhb; + } + function Yhb() { + this.Id = null; + } + Yhb.prototype = new A32(); + Yhb.prototype.constructor = Yhb; + Yhb.prototype.a = function() { + UW.prototype.e.call(this, "%RAML 1.0 Trait"); + return this; + }; + Yhb.prototype.$classData = r8({ QKa: 0 }, false, "amf.plugins.document.webapi.parser.RamlFragmentHeader$Raml10Trait$", { QKa: 1, $v: 1, f: 1, y: 1, v: 1, q: 1, o: 1, NF: 1 }); + var Zhb = void 0; + function Vka() { + Zhb || (Zhb = new Yhb().a()); + return Zhb; + } + function tP() { + this.Qr = this.Vw = null; + } + tP.prototype = new u7(); + tP.prototype.constructor = tP; + d7 = tP.prototype; + d7.H = function() { + return "RamlScalarValuedNode"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tP && Bj(this.Vw, a10.Vw)) { + var b10 = this.Qr; + a10 = a10.Qr; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vw; + case 1: + return this.Qr; + default: + throw new U6().e("" + a10); + } + }; + d7.nV = function() { + return this.oV(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.g5 = function() { + return this.Qr.g5(); + }; + d7.nf = function() { + return this.Qr.nf(); + }; + d7.oV = function() { + return this.Qr.oV(); + }; + d7.z = function() { + return X5(this); + }; + function Dla(a10, b10) { + var c10 = new tP(); + c10.Vw = a10; + c10.Qr = b10; + return c10; + } + d7.Zf = function() { + return this.Qr.Zf(); + }; + d7.Up = function() { + return this.Qr.Up(); + }; + d7.mE = function() { + return this.Qr.mE(); + }; + d7.$classData = r8({ MLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.RamlScalarValuedNode", { MLa: 1, f: 1, YAa: 1, LY: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ux() { + this.Th = this.Ca = null; + } + Ux.prototype = new u7(); + Ux.prototype.constructor = Ux; + d7 = Ux.prototype; + d7.H = function() { + return "RamlSingleArrayNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ux ? Bj(this.Ca, a10.Ca) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.nV = function() { + return $hb(this, new Qg().Vb(this.Ca, this.Th).oV()); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.n3 = function() { + return $hb(this, new Qg().Vb(this.Ca, this.Th).Zf()); + }; + d7.e5 = function() { + return $hb(this, new Qg().Vb(this.Ca, this.Th).Up()); + }; + d7.pv = function(a10, b10) { + this.Ca = a10; + this.Th = b10; + return this; + }; + d7.Qaa = function() { + return $hb(this, new Qg().Vb(this.Ca, this.Th).mE()); + }; + d7.Sba = function(a10) { + return $hb(this, a10.P(this.Ca)); + }; + function $hb(a10, b10) { + var c10 = K7(); + return Zr(new $r(), J5(c10, new Ib().ha([b10])), Rs(O7(), a10.Ca).Lb(new W1().a())); + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ NLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.RamlSingleArrayNode", { NLa: 1, f: 1, Iga: 1, LY: 1, y: 1, v: 1, q: 1, o: 1 }); + function aib() { + this.N = this.Q = this.p = this.Ei = null; + } + aib.prototype = new u7(); + aib.prototype.constructor = aib; + d7 = aib.prototype; + d7.H = function() { + return "AbstractDeclarationEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof aib) { + var b10 = this.Ei, c10 = a10.Ei; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ei; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Ei.Y(), kP().R).A; + if (b10 instanceof z7) + b10 = b10.i; + else { + b10 = this.N.hj(); + var c10 = Lo().Ix, e10 = this.Ei.j, f10 = y7(), g10 = "Cannot declare abstract declaration without name " + this.Ei, h10 = Ab(this.Ei.fa(), q5(jd)), k10 = yb(this.Ei); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + b10 = "default-name"; + } + T6(); + c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + Za(this.Ei).na() ? (e10 = Za(this.Ei), e10.b() || (e10 = e10.c(), oy(this.N.zf.eF(), e10, B6(this.Ei.Y(), db().ed).A, this.Q).Ob(b10))) : (e10 = Vb().Ia(this.Ei.Nz()), e10.b() ? f10 = y7() : (e10 = e10.c(), f10 = new z7().d(iy( + new jy(), + e10, + this.p, + false, + Rb(Ut(), H10()), + this.N.hj() + ).Pa())), e10 = null, e10 = f10.b() ? H10() : f10.c(), f10 = B6(this.Ei.g, kP().Va).A, f10.b() || (f10 = f10.c(), g10 = K7(), h10 = Q5().Na, wr(), k10 = B6(this.Ei.g, kP().Va).x, f10 = [cx(new dx(), "usage", f10, h10, kr(0, k10, q5(jd)))], f10 = J5(g10, new Ib().ha(f10)), g10 = K7(), e10 = e10.ia(f10, g10.u)), f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10), this.p.zb(e10).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Qa(t10); + }; + }(this, h10))), pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa))); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ei.fa(), q5(jd)); + }; + d7.$classData = r8({ WLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AbstractDeclarationEmitter", { WLa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function i62() { + this.N = this.Q = this.p = this.Ph = this.la = null; + } + i62.prototype = new u7(); + i62.prototype.constructor = i62; + d7 = i62.prototype; + d7.H = function() { + return "AbstractDeclarationsEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof i62) { + if (this.la === a10.la) { + var b10 = this.Ph, c10 = a10.Ph; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ph; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.Ph, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.p, D10 = t10.Q, C10 = t10.N, I10 = new aib(); + I10.Ei = v10; + I10.p = A10; + I10.Q = D10; + I10.N = C10; + return I10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.jE = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ph = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Ph.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.fa(), q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ ZLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.AbstractDeclarationsEmitter", { ZLa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function jy() { + this.p = this.Cl = null; + this.Gu = false; + this.fX = this.Mv = this.Nv = this.Dz = this.px = this.Ov = this.IA = this.G_ = this.Eu = null; + } + jy.prototype = new u7(); + jy.prototype.constructor = jy; + d7 = jy.prototype; + d7.H = function() { + return "DataNodeEmitter"; + }; + function bib(a10, b10, c10) { + var e10 = c10.s, f10 = c10.ca; + c10 = new PA().e(f10); + a10.p.zb(cib(a10, b10)).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10.Ob(h10); + }; + }(a10, c10))); + T6(); + eE(); + a10 = SA(zs(), f10); + a10 = mr(0, new Sx().Ac(a10, c10.s), Q5().cd); + pr(e10, a10); + } + d7.E = function() { + return 4; + }; + d7.Ob = function(a10) { + var b10 = this.Cl; + if (b10 instanceof Vi) + dib(this, b10).Ob(a10); + else if (b10 instanceof bl) + bib(this, b10, a10); + else if (b10 instanceof Xk) + eib(this, b10, a10); + else if (b10 instanceof ns) + fib(this, b10, a10); + else + throw new x7().d(b10); + }; + function dib(a10, b10) { + var c10 = false, e10 = null, f10 = B6(b10.aa, Wi().af).A; + if (f10 instanceof z7 && (c10 = true, e10 = f10, e10.i === a10.IA)) + return a10 = B6(b10.aa, Wi().vf).A, X6(new b62(), a10.b() ? null : a10.c(), b10.Xa, Q5().Na); + if (c10 && e10.i === a10.Ov) + return a10 = B6(b10.aa, Wi().vf).A, X6(new b62(), a10.b() ? null : a10.c(), b10.Xa, Q5().cj); + if (c10 && (f10 = e10.i, f10 === a10.Nv | f10 === a10.Dz)) + return a10 = B6(b10.aa, Wi().vf).A, X6(new b62(), a10.b() ? null : a10.c(), b10.Xa, Q5().of); + if (c10 && e10.i === a10.Mv) + return a10 = B6(b10.aa, Wi().vf).A, X6(new b62(), a10.b() ? null : a10.c(), b10.Xa, Q5().ti); + if (c10 && e10.i === a10.fX) + return new c62().dq(b10.Xa); + b10 = B6(b10.aa, Wi().vf).A; + return X6( + new b62(), + b10.b() ? null : b10.c(), + (O7(), new P6().a()), + Q5().Na + ); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jy && this.Cl === a10.Cl && this.p === a10.p && this.Gu === a10.Gu) { + var b10 = this.Eu; + a10 = a10.Eu; + return null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + function gib(a10, b10) { + var c10 = b10.MB; + if (!c10.b()) { + c10 = c10.c(); + var e10 = a10.Eu, f10 = B6(b10.aa, os().Xp).A; + e10.jm(f10.b() ? null : f10.c(), c10); + } + if (a10.Gu) + return a10 = K7(), e10 = B6(b10.aa, os().Xp).A, c10 = new W6(), e10 = e10.b() ? null : e10.c(), b10 = b10.Xa, c10.rr = e10, c10.x = b10, J5(a10, new Ib().ha([c10])); + a10 = K7(); + e10 = B6(b10.aa, os().Xp).A; + c10 = new W6(); + e10 = e10.b() ? null : e10.c(); + b10 = b10.Xa; + c10.rr = e10; + c10.x = b10; + return J5(a10, new Ib().ha([c10])); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Cl; + case 1: + return this.p; + case 2: + return this.Gu; + case 3: + return this.Eu; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Cl; + if (a10 instanceof Vi) { + var b10 = K7(); + a10 = [dib(this, a10)]; + b10 = J5(b10, new Ib().ha(a10)); + } else if (a10 instanceof bl) + b10 = cib(this, a10); + else if (a10 instanceof Xk) + b10 = hib(this, a10); + else { + if (!(a10 instanceof ns)) + throw new x7().d(a10); + b10 = gib(this, a10); + } + a10 = $cb(this); + var c10 = K7(); + return b10.ec(a10, c10.u).ps(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.ua(); + }; + }(this))); + }; + function fib(a10, b10, c10) { + gib(a10, b10).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10.Ob(f10); + }; + }(a10, c10))); + } + function hib(a10, b10) { + var c10 = ls(b10); + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = Ti(f10.aa, g10), k10 = new iib(); + g10 = uCa(new je4().e(g10.r.$)); + var l10 = h10.r, m10 = e10.p, p10 = e10.Gu, t10 = e10.Eu; + h10 = h10.x; + var v10 = e10.G_; + k10.la = g10; + k10.r = l10; + k10.p = m10; + k10.Gu = p10; + k10.Eu = t10; + k10.SL = h10; + k10.Bc = v10; + return k10; + }; + }(a10, b10)); + b10 = Xd(); + return c10.ka(a10, b10.u).ke(); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Cl)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.Gu ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.Eu)); + return OJ().fe(a10, 4); + }; + function cib(a10, b10) { + b10 = B6(b10.aa, al().Tt); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + return iy(new jy(), f10, e10.p, e10.Gu, e10.Eu, e10.G_); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + function eib(a10, b10, c10) { + var e10 = c10.s; + c10 = c10.ca; + var f10 = new rr().e(c10); + a10.p.zb(hib(a10, b10)).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10.Qa(h10); + }; + }(a10, f10))); + pr(e10, mr(T6(), tr(ur(), f10.s, c10), Q5().sa)); + } + d7.La = function() { + return kr(wr(), this.Cl.fa(), q5(jd)); + }; + function iy(a10, b10, c10, e10, f10, g10) { + a10.Cl = b10; + a10.p = c10; + a10.Gu = e10; + a10.Eu = f10; + a10.G_ = g10; + a10.IA = ic(dw().IA); + a10.Ov = ic(dw().Ov); + a10.px = ic(dw().px); + a10.Dz = ic(dw().Dz); + a10.Nv = ic(dw().Nv); + a10.Mv = ic(dw().Mv); + a10.fX = ic(dw().fX); + return a10; + } + d7.$classData = r8({ cMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataNodeEmitter", { cMa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function iib() { + this.p = this.r = this.la = null; + this.Gu = false; + this.Bc = this.SL = this.Eu = null; + } + iib.prototype = new u7(); + iib.prototype.constructor = iib; + d7 = iib.prototype; + d7.H = function() { + return "DataPropertyEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof iib) { + if (this.la === a10.la && this.r === a10.r && this.p === a10.p && this.Gu === a10.Gu) { + var b10 = this.Eu, c10 = a10.Eu; + b10 = null === b10 ? null === c10 : U22(b10, c10); + } else + b10 = false; + return b10 ? this.SL === a10.SL : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.r; + case 2: + return this.p; + case 3: + return this.Gu; + case 4: + return this.Eu; + case 5: + return this.SL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Ab(this.SL, q5(Qu)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.ad)); + b10 = b10.ua(); + b10 = Jc(b10, new adb()); + b10 = b10.b() ? this.SL : b10.c(); + T6(); + or(); + var c10 = mr(0, sD(0, uCa(new je4().e(this.la)), Q5().Na, ys(b10)), Q5().Na); + b10 = new PA().e(a10.ca); + iy(new jy(), this.r, this.p, this.Gu, this.Eu, this.Bc).Ob(b10); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr( + a10.s, + vD(wD(), b10.s) + ); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.la)); + a10 = OJ().Ga(a10, NJ(OJ(), this.r)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.Gu ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.Eu)); + a10 = OJ().Ga(a10, NJ(OJ(), this.SL)); + return OJ().fe(a10, 6); + }; + d7.La = function() { + return kr(wr(), this.r.fa(), q5(jd)); + }; + d7.$classData = r8({ gMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.DataPropertyEmitter", { gMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function U2a() { + this.Bc = this.p = this.JP = this.la = null; + } + U2a.prototype = new u7(); + U2a.prototype.constructor = U2a; + d7 = U2a.prototype; + d7.H = function() { + return "EndPointExtendsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof U2a) { + if (this.la === a10.la) { + var b10 = this.JP, c10 = a10.JP; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.JP; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = new j7(), f10 = this.JP.ga(), g10 = this.p, h10 = this.Bc; + e10.Ei = f10; + e10.p = g10; + e10.Bc = h10; + e10.Ob(b10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.JP.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.Xa, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ kMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.EndPointExtendsEmitter", { kMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function jib() { + this.N = this.p = this.r = this.la = null; + } + jib.prototype = new u7(); + jib.prototype.constructor = jib; + d7 = jib.prototype; + d7.H = function() { + return "EnumValuesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof jib ? this.la === a10.la && this.r === a10.r ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.r; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.r.r.wb, c10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return iy(new jy(), t10, p10.p, false, Rb(Ut(), H10()), p10.N.hj()); + }; + }(this)), e10 = K7(), f10 = b10.ka(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + vr(wr(), this.p.zb(f10), h10); + T6(); + eE(); + f10 = SA(zs(), g10); + f10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, f10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + f10 = c10.w + h10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var k10 = h10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = h10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + h10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + function cma(a10, b10, c10) { + var e10 = new jib(); + e10.la = "enum"; + e10.r = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.r.x, q5(jd)); + }; + d7.$classData = r8({ lMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.EnumValuesEmitter", { lMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function kib() { + this.p = this.Ba = this.la = null; + } + kib.prototype = new u7(); + kib.prototype.constructor = kib; + d7 = kib.prototype; + d7.H = function() { + return "IriTemplateEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kib) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = YX(this.Ba), k10 = w6(/* @__PURE__ */ function() { + return function(p10) { + var t10 = hd(p10.Y(), Gn().pD); + t10.b() ? t10 = y7() : (t10 = t10.c(), p10 = hd(p10.Y(), Gn().jD), p10.b() ? t10 = y7() : (p10 = p10.c(), t10 = new z7().d($g(new ah(), t10.r.r.t(), p10, y7())))); + return t10.ua(); + }; + }(this)), l10 = K7(); + h10 = h10.bd(k10, l10.u); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.Iaa = function(a10, b10, c10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ sMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.IriTemplateEmitter", { sMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function f72() { + this.kd = this.m = this.Bh = this.X = null; + } + f72.prototype = new u7(); + f72.prototype.constructor = f72; + function lib2() { + } + d7 = lib2.prototype = f72.prototype; + d7.H = function() { + return "Oas2SecuritySettingsParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f72 && Bj(this.X, a10.X)) { + var b10 = this.Bh; + a10 = a10.Bh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.X; + case 1: + return this.Bh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = B6(this.Bh.g, Xh().Hf).A; + a10 = a10.b() ? null : a10.c(); + if ("OAuth 1.0" === a10) + a10 = new z7().d(mib(this)); + else if ("OAuth 2.0" === a10) + a10 = new z7().d(this.Cna()); + else if ("Api Key" === a10) + a10 = new z7().d(nib(this)); + else if (a10 = ac(new M6().W(this.X), jx(new je4().e("settings"))), a10.b()) + a10 = y7(); + else { + a10 = a10.c().i; + var b10 = qc(); + a10 = N6(a10, b10, this.m); + b10 = this.Bh.aX(); + a10 = new z7().d(oib(this, a10, b10, new Ib().ha([]))); + } + a10.b() || a10.c().fa().Lb(new x42().a()); + return pib(this, a10); + }; + function oib(a10, b10, c10, e10) { + e10 = b10.sb.Si(w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + m10 = m10.Aa; + var p10 = bc(); + m10 = N6(m10, p10, k10.m).va; + return l10.Ha(m10) || Nla(Px(), m10); + }; + }(a10, e10))); + if (tc(e10)) { + T6(); + ur(); + var f10 = e10.kc(); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da.Rf)); + e10 = tr(0, e10, f10.b() ? "" : f10.c()); + e10 = mr(T6(), e10, Q5().sa); + f10 = new z7().d(c10.j); + var g10 = new ox().a(), h10 = new Nd().a(); + e10 = px(e10, g10, f10, h10, a10.m).Fr(); + f10 = Nm().Dy; + Vd(c10, f10, e10); + } + Ry(new Sy(), a10.Bh, b10, H10(), a10.m).hd(); + return c10; + } + d7.rk = function() { + null === this.kd && Edb(this); + return this.kd; + }; + function mib(a10) { + var b10 = a10.Bh.cX(), c10 = new M6().W(a10.X), e10 = jx(new je4().e("settings")); + c10 = ac(c10, e10); + if (!c10.b()) { + c10 = c10.c().i; + e10 = qc(); + c10 = N6(c10, e10, a10.m); + e10 = new M6().W(c10); + var f10 = vZ().zJ; + Gg(e10, "requestTokenUri", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = vZ().km; + Gg(e10, "authorizationUri", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = vZ().GJ; + Gg(e10, "tokenCredentialsUri", Hg(Ig(a10, f10, a10.m), b10)); + e10 = new M6().W(c10); + f10 = vZ().DJ; + Gg(e10, "signatures", Hg(Ig(a10, f10, a10.m), b10)); + oib(a10, c10, b10, new Ib().ha(["requestTokenUri", "authorizationUri", "tokenCredentialsUri", "signatures"])); + } + return b10; + } + function nib(a10) { + var b10 = a10.Bh.mQ(), c10 = ac(new M6().W(a10.X), "name"); + if (!c10.b()) { + var e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m); + c10 = aR().R; + f10 = f10.nf(); + e10 = Od(O7(), e10); + Rg(b10, c10, f10, e10); + } + c10 = ac(new M6().W(a10.X), "in"); + c10.b() || (e10 = c10.c(), f10 = new Qg().Vb(e10.i, a10.m), c10 = aR().Ny, f10 = f10.nf(), e10 = Od(O7(), e10), Rg(b10, c10, f10, e10)); + c10 = new M6().W(a10.X); + e10 = jx(new je4().e("settings")); + c10 = ac(c10, e10); + c10.b() || (c10 = c10.c().i, e10 = qc(), c10 = N6(c10, e10, a10.m), oib(a10, c10, b10, new Ib().ha(["name", "in"]))); + return b10; + } + d7.q1 = function(a10, b10, c10) { + this.X = a10; + this.Bh = b10; + this.m = c10; + return this; + }; + d7.Cna = function() { + var a10 = this.Bh.pQ(), b10 = new Nv().PG(oq(/* @__PURE__ */ function(h10, k10) { + return function() { + var l10 = vSa(xSa(), h10.X), m10 = k10.j; + J5(K7(), H10()); + return Ai(l10, m10); + }; + }(this, a10))), c10 = ac(new M6().W(this.X), "authorizationUrl"); + if (!c10.b()) { + var e10 = c10.c(); + c10 = Ov(b10); + var f10 = Jm().km, g10 = new Qg().Vb(e10.i, this.m).nf(); + e10 = Od(O7(), e10.i); + Rg(c10, f10, g10, e10); + } + c10 = ac(new M6().W(this.X), "tokenUrl"); + c10.b() || (e10 = c10.c(), c10 = Ov(b10), f10 = Jm().vq, g10 = new Qg().Vb(e10.i, this.m).nf(), e10 = Od(O7(), e10.i), Rg(c10, f10, g10, e10)); + c10 = ac(new M6().W(this.X), "flow"); + c10.b() || (g10 = c10.c(), e10 = new Qg().Vb(g10.i, this.m), c10 = Ov(b10), f10 = Jm().Wv, e10 = e10.nf(), g10 = Od(O7(), g10), Rg(c10, f10, e10, g10)); + c10 = ac(new M6().W(this.X), "scopes"); + c10.b() || (c10.c(), qib(this, Ov(b10), this.X)); + c10 = new M6().W(this.X); + f10 = jx(new je4().e("settings")); + c10 = ac(c10, f10); + c10.b() || (c10 = c10.c().i, f10 = qc(), c10 = N6(c10, f10, this.m), f10 = new M6().W(c10), g10 = xE().Gy, Gg(f10, "authorizationGrants", Hg(Ig(this, g10, this.m), a10)), oib(this, c10, a10, new Ib().ha(["authorizationGrants"]))); + pna(Ry(new Sy(), a10, this.X, H10(), this.m), "scopes"); + b10 = b10.r; + b10.b() || (b10 = b10.c(), c10 = a10.j, J5(K7(), H10()), Ai(b10, c10), c10 = xE().Ap, ig(a10, c10, b10)); + return a10; + }; + d7.z = function() { + return X5(this); + }; + function qib(a10, b10, c10) { + c10 = ac(new M6().W(c10), "scopes"); + if (!c10.b()) { + c10 = c10.c(); + var e10 = c10.i, f10 = qc(); + e10 = N6(e10, f10, a10.m).sb.Si(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = Px(); + T6(); + h10 = h10.Aa; + var l10 = g10.m, m10 = Dd(); + return Nla(k10, N6(h10, m10, l10)); + }; + }(a10))); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + var l10 = h10.j, m10 = k10.Aa, p10 = bc(); + p10 = N6(m10, p10, g10.m).va; + T6(); + m10 = k10.i; + var t10 = g10.m, v10 = Dd(); + m10 = N6(m10, v10, t10); + t10 = ySa(ASa(), k10); + v10 = Gm().R; + p10 = ih(new jh(), p10, new P6().a()); + var A10 = Od(O7(), k10.Aa); + p10 = Rg(t10, v10, p10, A10); + t10 = Gm().Va; + m10 = ih(new jh(), m10, new P6().a()); + k10 = Od(O7(), k10.i); + k10 = Rg(p10, t10, m10, k10); + J5(K7(), H10()); + return Ai(k10, l10); + }; + }(a10, b10)); + f10 = rw(); + a10 = e10.ka(a10, f10.sc); + e10 = Jm().lo; + c10 = Od(O7(), c10); + bs(b10, e10, a10, c10); + } + } + function pib(a10, b10) { + if (b10.b()) + return y7(); + b10 = b10.c(); + Ry(new Sy(), b10, a10.X, H10(), a10.m).hd(); + a10 = Od(O7(), a10.X); + return new z7().d(Db(b10, a10)); + } + d7.$classData = r8({ oha: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas2SecuritySettingsParser", { oha: 1, f: 1, ANa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function rib() { + this.p = this.vb = this.QT = null; + } + rib.prototype = new u7(); + rib.prototype.constructor = rib; + d7 = rib.prototype; + d7.H = function() { + return "Oas3DiscriminatorEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rib) { + var b10 = this.QT, c10 = a10.QT; + return (null === b10 ? null === c10 : b10.h(c10)) && this.vb === a10.vb ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.QT; + case 1: + return this.vb; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "discriminator"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = J5(Ef(), H10()), k10 = hd(this.vb, Ih().Us); + k10.b() || (k10 = k10.c(), new z7().d(Dg(h10, $g(new ah(), "propertyName", k10, y7())))); + k10 = hd(this.vb, Ih().SI); + k10.b() || (k10 = k10.c(), new z7().d(Dg(h10, new kib().Iaa("mapping", k10, this.p)))); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + function sib(a10, b10, c10) { + var e10 = new rib(); + e10.QT = a10; + e10.vb = b10; + e10.p = c10; + return e10; + } + d7.La = function() { + return kr(wr(), this.QT.r.x, q5(jd)); + }; + d7.$classData = r8({ DMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3DiscriminatorEmitter", { DMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function b3a() { + this.N = this.p = this.rh = null; + } + b3a.prototype = new u7(); + b3a.prototype.constructor = b3a; + d7 = b3a.prototype; + d7.H = function() { + return "Oas3OAuth2FlowEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof b3a) { + var b10 = this.rh, c10 = a10.rh; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rh; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.rh.g, c10 = J5(Ef(), H10()), e10 = B6(this.rh.g, Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return wh(B6(f10.g, Ud().zi).fa(), q5(D32)); + }; + }(this))); + b10 = hd(b10, xE().Ap); + b10.b() || (b10 = b10.c(), Dg(c10, new tib().dU(b10, this.p, e10, this.N))); + ws(c10, ay(this.rh, this.p, this.N).Pa()); + jr(wr(), this.p.zb(c10), a10); + }; + d7.YK = function(a10, b10, c10) { + this.rh = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = B6(this.rh.g, xE().Ap).kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ EMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3OAuth2FlowEmitter", { EMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function uib() { + this.N = this.p = this.CG = null; + } + uib.prototype = new u7(); + uib.prototype.constructor = uib; + d7 = uib.prototype; + d7.H = function() { + return "Oas3OAuthFlowEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof uib) { + var b10 = this.CG, c10 = a10.CG; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.CG; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.CG.g; + T6(); + var c10 = B6(this.CG.g, Jm().Wv).A, e10 = mh(0, c10.b() ? null : c10.c()); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, Jm().km); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "authorizationUrl", l10, y7())))); + l10 = hd(b10, Jm().vq); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "tokenUrl", l10, y7())))); + l10 = hd(b10, Jm().tN); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "refreshUrl", l10, y7())))); + l10 = B6(this.CG.g, Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(p10) { + return wh(B6(p10.g, Ud().zi).fa(), q5(D32)); + }; + }(this))); + b10 = hd(b10, Jm().lo); + b10.b() || (b10 = b10.c(), Dg(k10, new H32().Sq("scopes", b10, this.p, l10, this.N))); + jr(wr(), this.p.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + f10 = c10.s; + e10 = [e10]; + if (0 > f10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + g10 = f10.w + h10 | 0; + uD(f10, g10); + Ba(f10.L, 0, f10.L, h10, f10.w); + h10 = f10.L; + l10 = h10.n.length; + b10 = k10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = h10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + h10.n[b10] = e10[k10], k10 = 1 + k10 | 0, b10 = 1 + b10 | 0; + f10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.CG.x, q5(jd)); + }; + d7.$classData = r8({ GMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3OAuthFlowEmitter", { GMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function tib() { + this.N = this.Go = this.p = this.Ba = null; + } + tib.prototype = new u7(); + tib.prototype.constructor = tib; + d7 = tib.prototype; + d7.H = function() { + return "Oas3OAuthFlowsEmitter"; + }; + d7.dU = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Go = c10; + this.N = e10; + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tib) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Go, a10 = a10.Go, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Go; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = YX(this.Ba), c10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.p, A10 = p10.N, D10 = new uib(); + D10.CG = t10; + D10.p = v10; + D10.N = A10; + return D10; + }; + }(this)), e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = M3a(this.Go, this.p, this.N).Pa(); + e10 = K7(); + c10 = b10.ia(c10, e10.u); + T6(); + e10 = mh(T6(), "flows"); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(c10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ HMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3OAuthFlowsEmitter", { HMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function zy() { + this.Qc = this.N = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + zy.prototype = new u7(); + zy.prototype.constructor = zy; + d7 = zy.prototype; + d7.H = function() { + return "OasAndConstraintEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zy) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "allOf"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.bE = function(a10, b10, c10, e10, f10, g10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.tf = f10; + this.N = g10; + a10 = B6(a10.Y(), qf().fi); + b10 = K7(); + a10 = a10.og(b10.u); + b10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(), m10 = k10.Ki(); + if (null !== l10) { + k10 = h10.p; + var p10 = H10(), t10 = h10.Q, v10 = h10.Qe; + m10 = J5(K7(), new Ib().ha(["allOf", "" + m10])); + var A10 = K7(); + return k7(new l7(), l10, k10, p10, t10, v10.ia(m10, A10.u), h10.tf, h10.N); + } + } + throw new x7().d(k10); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ JMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAndConstraintEmitter", { JMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function vib() { + this.N = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + vib.prototype = new u7(); + vib.prototype.constructor = vib; + d7 = vib.prototype; + d7.H = function() { + return "OasAnyOfShapeEmitter"; + }; + function wib(a10, b10, c10, e10, f10, g10) { + var h10 = new vib(); + h10.pa = a10; + h10.p = b10; + h10.Q = c10; + h10.Qe = e10; + h10.tf = f10; + h10.N = g10; + return h10; + } + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vib) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.N.$ia(), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10), h10 = B6(this.pa.aa, xn().Le), k10 = K7(); + h10 = h10.og(k10.u); + k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + if (null !== t10) { + var v10 = t10.ma(), A10 = t10.Ki(); + if (null !== v10) { + t10 = p10.p; + var D10 = H10(), C10 = p10.Q, I10 = p10.Qe; + A10 = J5(K7(), new Ib().ha(["anyOf", "" + A10])); + var L10 = K7(); + return k7(new l7(), v10, t10, D10, C10, I10.ia(A10, L10.u), p10.tf, p10.N); + } + } + throw new x7().d(t10); + }; + }(this)); + var l10 = K7(); + h10 = h10.ka(k10, l10.u); + vr(wr(), this.p.zb(h10), g10); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + l10 = f10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = f10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + f10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.pa.Xa, q5(jd)); + }; + d7.$classData = r8({ MMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAnyOfShapeEmitter", { MMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function xib() { + AP.call(this); + this.Hk = this.Ck = this.gd = this.Mc = this.wa = null; + this.kj = false; + this.je = null; + } + xib.prototype = new BP(); + xib.prototype.constructor = xib; + d7 = xib.prototype; + d7.H = function() { + return "OasArrayShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xib) { + var b10 = this.wa, c10 = a10.wa; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ck, c10 = a10.Ck, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hk, c10 = a10.Hk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.Ck; + case 4: + return this.Hk; + case 5: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function s3a(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new xib(); + k10.wa = a10; + k10.Mc = b10; + k10.gd = c10; + k10.Ck = e10; + k10.Hk = f10; + k10.kj = g10; + k10.je = h10; + e10 = H10(); + f10 = H10(); + AP.prototype.VK.call(k10, a10, b10, c10, e10, f10, g10, h10); + return k10; + } + d7.Pa = function() { + var a10 = J5(Ef(), AP.prototype.Pa.call(this)), b10 = this.wa.aa; + Dg(a10, xka("array", this.wa)); + var c10 = hd(b10, uh().pr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "maxItems", c10, y7())))); + c10 = hd(b10, uh().Bq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "minItems", c10, y7())))); + c10 = hd(b10, uh().qr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "uniqueItems", c10, y7())))); + c10 = false; + var e10 = null, f10 = hd(b10, uh().RC); + a: { + if (f10 instanceof z7) { + c10 = true; + e10 = f10; + var g10 = e10.i; + if (wh(g10.r.x, q5(ucb))) { + Dg(a10, yib(new m7(), this.wa, this.Mc, this.gd, new z7().d($g( + new ah(), + "collectionFormat", + g10, + y7() + )), this.Ck, this.Hk, this.je)); + break a; + } + } + if (c10) + c10 = e10.i, Dg(Dg(a10, yib(new m7(), this.wa, this.Mc, this.gd, y7(), this.Ck, this.Hk, this.je)), $g(new ah(), "collectionFormat", c10, y7())); + else if (y7() === f10) + Dg(a10, yib(new m7(), this.wa, this.Mc, this.gd, y7(), this.Ck, this.Hk, this.je)); + else + throw new x7().d(f10); + } + b10 = hd(b10, Ih().xd); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, new n72().Zz(b10, this.Mc, this.gd, this.je)))); + ws(a10, fma(this.wa, this.Mc, this.je).Pa()); + return a10; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.wa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ck)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Hk)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 6); + }; + d7.$classData = r8({ PMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasArrayShapeEmitter", { PMa: 1, hJ: 1, iN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function zib() { + this.N = this.p = this.Hl = null; + } + zib.prototype = new u7(); + zib.prototype.constructor = zib; + d7 = zib.prototype; + d7.h1 = function(a10, b10, c10) { + this.Hl = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.H = function() { + return "OasCreativeWorkEmitter"; + }; + d7.Ob = function(a10) { + if (Za(this.Hl).na()) { + wr(); + var b10 = B6(this.Hl.g, db().ed).A; + b10 = b10.b() ? Za(this.Hl).c().j : b10.c(); + lr(0, a10, b10, Q5().Na); + } else { + b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + jr(wr(), new E32().h1(this.Hl, this.p, this.N).Pa(), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + } + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zib ? this.Hl === a10.Hl ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Hl; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Hl.x, q5(jd)); + }; + d7.$classData = r8({ RMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasCreativeWorkEmitter", { RMa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Aib() { + this.N = this.p = this.$l = this.la = null; + } + Aib.prototype = new u7(); + Aib.prototype.constructor = Aib; + d7 = Aib.prototype; + d7.H = function() { + return "OasEntryCreativeWorkEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Aib ? this.la === a10.la && this.$l === a10.$l ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.$l; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + new zib().h1(this.$l, this.p, this.N).Ob(b10); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + function ly(a10, b10, c10, e10) { + var f10 = new Aib(); + f10.la = a10; + f10.$l = b10; + f10.p = c10; + f10.N = e10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.$l.x, q5(jd)); + }; + d7.$classData = r8({ XMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasEntryCreativeWorkEmitter", { XMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Bib() { + this.N = this.Q = this.p = this.Ba = this.la = null; + } + Bib.prototype = new u7(); + Bib.prototype.constructor = Bib; + d7 = Bib.prototype; + d7.H = function() { + return "OasEntryShapeEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Bib) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r, k10 = this.p, l10 = this.Q, m10 = H10(), p10 = H10(), t10 = H10(); + h10 = Vy(h10, k10, m10, l10, p10, t10, false, this.N).zw(); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + function Cib(a10, b10, c10, e10, f10) { + var g10 = new Bib(); + g10.la = a10; + g10.Ba = b10; + g10.p = c10; + g10.Q = e10; + g10.N = f10; + return g10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ YMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasEntryShapeEmitter", { YMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function o7() { + this.N = this.p = this.jA = this.Qf = null; + } + o7.prototype = new u7(); + o7.prototype.constructor = o7; + d7 = o7.prototype; + d7.H = function() { + return "OasNamedSecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o7) { + var b10 = this.Qf, c10 = a10.Qf; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.jA, c10 = a10.jA, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Qf; + case 1: + return this.jA; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Qf.g, Xh().R).A; + if (b10 instanceof z7) + b10 = b10.i; + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = this.N.hj(); + var c10 = dc().Fh, e10 = this.Qf.j, f10 = y7(), g10 = "Cannot declare security scheme without name " + this.Qf, h10 = Ab(this.Qf.x, q5(jd)), k10 = yb(this.Qf); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + b10 = "default-"; + } + T6(); + e10 = mh(T6(), b10); + c10 = Za(this.Qf).na() ? /* @__PURE__ */ function(p10) { + return function(t10) { + p10.hK(t10); + }; + }(this) : /* @__PURE__ */ function(p10) { + return function(t10) { + p10.gK(t10); + }; + }(this); + b10 = new PA().e(a10.ca); + c10(b10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD( + c10, + f10 + ); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.hK = function(a10) { + var b10 = Za(this.Qf); + b10.b() || (b10 = b10.c(), OO(b10, B6(this.Qf.g, db().ed).A, H10(), this.N).Ob(a10)); + }; + d7.vU = function(a10, b10, c10, e10) { + this.Qf = a10; + this.jA = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.gK = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + jr(wr(), this.p.zb(new I32().vU(this.Qf, this.jA, this.p, this.N).Pa()), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Qf.x, q5(jd)); + }; + d7.$classData = r8({ cNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasNamedSecuritySchemeEmitter", { cNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Dib() { + this.N = this.Qe = this.Q = this.p = this.pa = null; + } + Dib.prototype = new u7(); + Dib.prototype.constructor = Dib; + d7 = Dib.prototype; + d7.H = function() { + return "OasNamedTypeEmitter"; + }; + d7.bU = function(a10, b10, c10, e10, f10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.N = f10; + return this; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Dib) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Qe, a10 = a10.Qe, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.pa.Y(), qf().R).A, c10 = b10.b() ? "schema" : b10.c(); + T6(); + var e10 = mh(T6(), c10); + b10 = new PA().e(a10.ca); + var f10 = this.pa, g10 = this.p, h10 = this.Q, k10 = this.Qe, l10 = K7(); + c10 = k10.yg(c10, l10.u); + k10 = H10(); + l10 = H10(); + k7(new l7(), f10, g10, k10, h10, c10, l10, this.N).Ob(b10); + f10 = b10.s; + e10 = [e10]; + if (0 > f10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + g10 = f10.w + h10 | 0; + uD(f10, g10); + Ba(f10.L, 0, f10.L, h10, f10.w); + h10 = f10.L; + l10 = h10.n.length; + k10 = c10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = h10.n.length; + for (l10 = l10 < m10 ? l10 : m10; c10 < l10; ) + h10.n[k10] = e10[c10], c10 = 1 + c10 | 0, k10 = 1 + k10 | 0; + f10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.pa.fa(), q5(jd)); + }; + d7.$classData = r8({ dNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasNamedTypeEmitter", { dNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Eib() { + this.p = this.uH = null; + } + Eib.prototype = new u7(); + Eib.prototype.constructor = Eib; + d7 = Eib.prototype; + d7.H = function() { + return "OasNilShapeEmitter"; + }; + d7.E = function() { + return 2; + }; + function u3a(a10, b10) { + var c10 = new Eib(); + c10.uH = a10; + c10.p = b10; + return c10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Eib) { + var b10 = this.uH, c10 = a10.uH; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uH; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "type"); + T6(); + var c10 = mh(T6(), "null"); + sr(a10, b10, c10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.uH.Xa, q5(jd)); + }; + d7.$classData = r8({ eNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasNilShapeEmitter", { eNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Fib() { + AP.call(this); + this.Hk = this.Ck = this.gd = this.Mc = this.Bm = null; + this.kj = false; + this.je = null; + } + Fib.prototype = new BP(); + Fib.prototype.constructor = Fib; + d7 = Fib.prototype; + d7.H = function() { + return "OasNodeShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Fib) { + var b10 = this.Bm, c10 = a10.Bm; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ck, c10 = a10.Ck, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hk, c10 = a10.Hk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bm; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.Ck; + case 4: + return this.Hk; + case 5: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.je.Gg(), b10 = Xq().Cp, c10 = a10 === b10; + a10 = J5(Ef(), AP.prototype.Pa.call(this)); + b10 = this.Bm.aa; + Dg(a10, xka("object", this.Bm)); + var e10 = hd(b10, Ih().dw); + e10.b() || (e10 = e10.c(), new z7().d(Dg(a10, $g(new ah(), "minProperties", e10, y7())))); + e10 = hd(b10, Ih().cw); + e10.b() || (e10 = e10.c(), new z7().d(Dg(a10, $g(new ah(), "maxProperties", e10, y7())))); + e10 = hd(b10, Ih().Cn); + if (e10.b()) + var f10 = true; + else + f10 = e10.c(), f10 = wh(f10.r.x, q5(b42)) || aj(f10.r.r); + e10 = f10 ? e10 : y7(); + e10 instanceof z7 ? Dg(a10, $g(new ah(), "additionalProperties", T_a(e10.i), y7())) : (e10 = hd(b10, Ih().vF), e10.b() || (e10 = e10.c(), new z7().d(Dg( + a10, + Cib("additionalProperties", e10, this.Mc, this.gd, this.je) + )))); + c10 ? (c10 = hd(b10, Ih().Us), c10 = c10.b() ? hd(b10, Ih().SI) : c10, c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, sib(c10, b10, this.Mc))))) : (c10 = hd(b10, Ih().Us), c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "discriminator", c10, y7()))))); + c10 = hd(b10, Ih().Jy); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), jx(new je4().e("discriminatorValue")), c10, y7())))); + c10 = hd(b10, Ih().kh); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Gib(c10, this.gd)))); + c10 = hd(b10, Ih().kh); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Hib(c10, this.Mc, this.gd, this.Ck, this.Hk, this.je)))); + c10 = Aha(); + e10 = B6(this.Bm.aa, Ih().kh); + f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return new R6().M(h10.j, h10); + }; + }(this)); + var g10 = K7(); + c10 = Rb(c10, e10.ka(f10, g10.u)); + e10 = hd(b10, Ih().VC); + e10.b() || (e10 = e10.c(), new z7().d(Dg(a10, Iib(e10, this.Mc, c10)))); + b10 = hd(b10, Ih().xd); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, new n72().Zz(b10, this.Mc, this.gd, this.je)))); + return a10; + }; + function q3a(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new Fib(); + k10.Bm = a10; + k10.Mc = b10; + k10.gd = c10; + k10.Ck = e10; + k10.Hk = f10; + k10.kj = g10; + k10.je = h10; + e10 = H10(); + f10 = H10(); + AP.prototype.VK.call(k10, a10, b10, c10, e10, f10, g10, h10); + return k10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Bm)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ck)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Hk)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 6); + }; + d7.$classData = r8({ fNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasNodeShapeEmitter", { fNa: 1, hJ: 1, iN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cy() { + this.tw = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + Cy.prototype = new u7(); + Cy.prototype.constructor = Cy; + d7 = Cy.prototype; + d7.H = function() { + return "OasNotConstraintEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Cy) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "not"), c10 = new PA().e(a10.ca); + this.tw.Ob(c10); + var e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = b10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.bE = function(a10, b10, c10, e10, f10, g10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.tf = f10; + a10 = B6(a10.Y(), qf().Bi); + var h10 = H10(), k10 = K7(); + this.tw = k7(new l7(), a10, b10, h10, c10, e10.yg("not", k10.u), f10, g10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return this.tw.La(); + }; + d7.$classData = r8({ gNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasNotConstraintEmitter", { gNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function H32() { + this.N = this.Go = this.p = this.Ba = this.la = null; + } + H32.prototype = new u7(); + H32.prototype.constructor = H32; + d7 = H32.prototype; + d7.H = function() { + return "OasOAuth2ScopeEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof H32) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Go, a10 = a10.Go, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Go; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = new l3a(); + b10.Ba = this.Ba; + b10 = b10.Pa(); + var c10 = M3a(this.Go, this.p, this.N).Pa(), e10 = K7(); + c10 = b10.ia(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(c10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.Sq = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.Go = e10; + this.N = f10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ iNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasOAuth2ScopeEmitter", { iNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ay() { + this.Qc = this.N = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + Ay.prototype = new u7(); + Ay.prototype.constructor = Ay; + d7 = Ay.prototype; + d7.H = function() { + return "OasOrConstraintEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ay) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "anyOf"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.bE = function(a10, b10, c10, e10, f10, g10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.tf = f10; + this.N = g10; + a10 = B6(a10.Y(), qf().ki); + b10 = K7(); + a10 = a10.og(b10.u); + b10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(), m10 = k10.Ki(); + if (null !== l10) { + k10 = h10.p; + var p10 = H10(), t10 = h10.Q, v10 = h10.Qe; + m10 = J5(K7(), new Ib().ha(["anyOf", "" + m10])); + var A10 = K7(); + return k7(new l7(), l10, k10, p10, t10, v10.ia(m10, A10.u), h10.tf, h10.N); + } + } + throw new x7().d(k10); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ lNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasOrConstraintEmitter", { lNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Jib() { + this.N = this.tf = this.Qe = this.Q = this.p = this.Ba = null; + } + Jib.prototype = new u7(); + Jib.prototype.constructor = Jib; + d7 = Jib.prototype; + d7.H = function() { + return "OasPropertiesShapeEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Jib) { + var b10 = this.Ba, c10 = a10.Ba; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function Hib(a10, b10, c10, e10, f10, g10) { + var h10 = new Jib(); + h10.Ba = a10; + h10.p = b10; + h10.Q = c10; + h10.Qe = e10; + h10.tf = f10; + h10.N = g10; + return h10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r.wb.Dm(w6(/* @__PURE__ */ function() { + return function(e10) { + return B6(e10.aa, Qi().cv).A.na(); + }; + }(this))), c10 = b10.ya(); + H10().h(c10) || Kib(this, c10, "properties", a10); + b10 = b10.ma(); + H10().h(b10) || Kib(this, b10, "patternProperties", a10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + function Kib(a10, b10, c10, e10) { + T6(); + var f10 = mh(T6(), c10), g10 = new PA().e(e10.ca), h10 = g10.s, k10 = g10.ca, l10 = new rr().e(k10); + c10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return Lib(v10, p10.p, p10.Q, t10, p10.Qe, p10.tf, p10.N); + }; + }(a10, c10)); + var m10 = K7(); + b10 = b10.ka(c10, m10.u); + jr(wr(), a10.p.zb(b10), l10); + pr(h10, mr(T6(), tr(ur(), l10.s, k10), Q5().sa)); + a10 = g10.s; + f10 = [f10]; + if (0 > a10.w) + throw new U6().e("0"); + k10 = f10.length | 0; + h10 = a10.w + k10 | 0; + uD(a10, h10); + Ba(a10.L, 0, a10.L, k10, a10.w); + k10 = a10.L; + c10 = k10.n.length; + b10 = l10 = 0; + m10 = f10.length | 0; + c10 = m10 < c10 ? m10 : c10; + m10 = k10.n.length; + for (c10 = c10 < m10 ? c10 : m10; l10 < c10; ) + k10.n[b10] = f10[l10], l10 = 1 + l10 | 0, b10 = 1 + b10 | 0; + a10.w = h10; + pr(e10.s, vD(wD(), g10.s)); + } + d7.$classData = r8({ mNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasPropertiesShapeEmitter", { mNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mib() { + this.lg = this.p = this.Yi = null; + } + Mib.prototype = new u7(); + Mib.prototype.constructor = Mib; + d7 = Mib.prototype; + d7.H = function() { + return "OasPropertyDependenciesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Mib) { + var b10 = this.Yi, c10 = a10.Yi; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.lg, a10 = a10.lg, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Yi; + case 1: + return this.p; + case 2: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.lg, c10 = B6(this.Yi.g, un().uJ).A; + b10 = b10.Ja(c10.b() ? null : c10.c()); + if (!b10.b()) { + b10 = b10.c(); + T6(); + b10 = B6(b10.aa, qf().R).A; + b10 = b10.b() ? null : b10.c(); + c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10), h10 = hd(this.Yi.g, un().vJ); + if (h10.b()) + h10 = y7(); + else { + h10 = Yx(h10.c().r.r); + var k10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.lg.Ja(ka(v10.r)); + A10.b() ? v10 = y7() : (A10 = B6(A10.c().aa, qf().R).A, v10 = new z7().d(ih(new jh(), A10.b() ? null : A10.c(), v10.x))); + return v10.ua(); + }; + }(this)), l10 = K7(); + h10 = new z7().d(h10.bd(k10, l10.u)); + } + if (!h10.b()) { + h10 = h10.c(); + k10 = wr(); + l10 = this.p; + var m10 = w6(/* @__PURE__ */ function() { + return function(t10) { + return hV(new iV(), t10, Q5().Na); + }; + }(this)), p10 = K7(); + vr(k10, l10.zb(h10.ka(m10, p10.u)), g10); + } + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + l10 = f10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = f10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + f10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Yi.x, q5(jd)); + }; + d7.$classData = r8({ nNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasPropertyDependenciesEmitter", { nNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nib() { + this.N = this.tf = this.p = this.Jr = null; + } + Nib.prototype = new u7(); + Nib.prototype.constructor = Nib; + d7 = Nib.prototype; + d7.H = function() { + return "OasRecursiveShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Nib && this.Jr === a10.Jr && this.p === a10.p) { + var b10 = this.tf; + a10 = a10.tf; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Jr; + case 1: + return this.p; + case 2: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Jr.aa, Ci().Ys).A; + if (b10 instanceof z7) { + if (b10 = Oib(this, b10.i), b10.b()) + if (b10 = this.Jr.mn, b10 instanceof z7) + b10 = Oib(this, b10.i.j), b10.b() && (b10 = this.Jr.mn, b10.b() ? b10 = y7() : (b10 = B6(b10.c().Y(), qf().R).A, b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d("#" + this.N.Rda() + b10)))); + else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = y7(); + } + } else + b10 = y7(); + if (!b10.b()) { + var c10 = b10.c(); + T6(); + b10 = mh(T6(), "$ref"); + T6(); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + } + }; + function Oib(a10, b10) { + var c10 = J5(K7(), new Ib().ha([gc(94)])), e10 = false, f10 = null; + b10 = a10.tf.st().Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = k10.ma(); + return null === k10 ? null === h10 : ra(k10, h10); + }; + }(a10, b10))); + return b10 instanceof z7 && (e10 = true, f10 = b10, b10 = f10.i, null !== b10 && "#" === b10.ya() && !(a10.N instanceof gy)) ? y7() : e10 && (e10 = f10.i, null !== e10 && (e10 = e10.ya(), !c10.oh(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = null === k10 ? 0 : k10.r; + var l10 = new qg().e(h10); + return mu(l10, gc(k10)); + }; + }(a10, e10))))) ? new z7().d(e10) : y7(); + } + function x3a(a10, b10, c10, e10) { + var f10 = new Nib(); + f10.Jr = a10; + f10.p = b10; + f10.tf = c10; + f10.N = e10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ pNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasRecursiveShapeEmitter", { pNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Pib() { + this.Q = this.Ba = null; + } + Pib.prototype = new u7(); + Pib.prototype.constructor = Pib; + d7 = Pib.prototype; + d7.H = function() { + return "OasRequiredPropertiesShapeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Pib) { + var b10 = this.Ba, c10 = a10.Ba; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r.wb.Cb(w6(/* @__PURE__ */ function() { + return function(p10) { + if (p10 instanceof Vk) { + var t10 = B6(p10.aa, Qi().cv); + if (oN(t10)) + return p10 = B6(p10.aa, Qi().ji), 0 < vEa(p10); + } + return false; + }; + }(this))); + if (b10.Da()) { + T6(); + var c10 = mh(T6(), "required"), e10 = new PA().e(a10.ca), f10 = e10.s, g10 = e10.ca, h10 = new PA().e(g10); + b10.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + if (v10 instanceof Vk) + v10 = B6(v10.aa, qf().R).A, X6(new b62(), v10.b() ? null : v10.c(), (O7(), new P6().a()), Q5().Na).Ob(t10); + else + throw new x7().d(v10); + }; + }(this, h10))); + T6(); + eE(); + b10 = SA(zs(), g10); + h10 = mr(0, new Sx().Ac(b10, h10.s), Q5().cd); + pr(f10, h10); + f10 = e10.s; + c10 = [c10]; + if (0 > f10.w) + throw new U6().e("0"); + b10 = c10.length | 0; + h10 = f10.w + b10 | 0; + uD(f10, h10); + Ba(f10.L, 0, f10.L, b10, f10.w); + b10 = f10.L; + var k10 = b10.n.length, l10 = g10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = b10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + b10.n[l10] = c10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + f10.w = h10; + pr(a10.s, vD(wD(), e10.s)); + } + }; + function Gib(a10, b10) { + var c10 = new Pib(); + c10.Ba = a10; + c10.Q = b10; + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ qNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasRequiredPropertiesShapeEmitter", { qNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function d62() { + this.N = this.Q = this.p = this.Ba = null; + } + d62.prototype = new u7(); + d62.prototype.constructor = d62; + d7 = d62.prototype; + d7.H = function() { + return "OasSchemaEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof d62) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r; + T6(); + var c10 = mh(T6(), "schema"), e10 = new PA().e(a10.ca), f10 = this.p, g10 = this.Q, h10 = H10(), k10 = H10(), l10 = H10(); + k7(new l7(), b10, f10, h10, g10, k10, l10, this.N).Ob(e10); + b10 = e10.s; + c10 = [c10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), e10.s)); + }; + d7.Zz = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ sNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSchemaEmitter", { sNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function vz() { + this.kd = this.m = this.yb = this.Ca = null; + } + vz.prototype = new u7(); + vz.prototype.constructor = vz; + d7 = vz.prototype; + d7.H = function() { + return "OasSecuritySchemeParser"; + }; + d7.E = function() { + return 2; + }; + d7.QO = function(a10, b10, c10) { + this.Ca = a10; + this.yb = b10; + this.m = c10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vz && Bj(this.Ca, a10.Ca)) { + var b10 = this.yb; + a10 = a10.yb; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && eGa(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.FH = function() { + var a10 = this.m.hp(this.Ca); + if (a10 instanceof ve4) { + a10 = a10.i; + var b10 = this.Ca, c10 = this.yb, e10 = lP(this.m.Qh, a10, Ys()); + if (e10.b()) + e10 = y7(); + else { + e10 = e10.c(); + var f10 = Od(O7(), b10); + e10 = kM(e10, a10, f10); + c10.P(e10); + e10 = new z7().d(e10); + } + if (e10.b()) + if (e10 = w42(this.m, a10, this.m), e10 instanceof z7) + a10 = new vz().QO(e10.i, c10, this.m).FH(); + else { + if (y7() !== e10) + throw new x7().d(e10); + e10 = this.m; + f10 = dc().au; + var g10 = "Cannot find security scheme reference " + a10, h10 = Od(O7(), b10); + yB(e10, f10, "", g10, h10); + a10 = c10.P(new p7().Tq(a10, b10)); + } + else + a10 = e10.c(); + return a10; + } + if (a10 instanceof ye4) { + b10 = a10.i; + a10 = this.yb; + O7(); + c10 = new P6().a(); + e10 = new S6().a(); + a10 = a10.P(new vm().K(e10, c10)); + c10 = qc(); + b10 = N6(b10, c10, this.m); + c10 = new M6().W(b10); + e10 = Xh().Hf; + Gg(c10, "type", Hg(Ig(this, e10, this.m), a10)); + c10 = false; + e10 = null; + f10 = B6(a10.g, Xh().Hf).A; + a: { + if (f10 instanceof z7 && (c10 = true, e10 = f10, h10 = e10.i, 0 <= (h10.length | 0) && "x-" === h10.substring(0, 2))) { + c10 = this.m; + e10 = sg().VM; + f10 = a10.j; + g10 = new z7().d(ic(Xh().Hf.r)); + h10 = "RAML 1.0 extension security scheme type '" + h10 + "' detected in OAS 2.0 spec"; + var k10 = Ab(B6(a10.g, Xh().Hf).x, q5(jd)), l10 = new z7().d(this.m.qh); + c10.Gc(e10.j, f10, g10, h10, k10, Yb().dh, l10); + break a; + } + c10 && (c10 = e10.i, "OAuth 1.0" === c10 || "OAuth 2.0" === c10 || "Basic Authentication" === c10 || "Digest Authentication" === c10 || "Pass Through" === c10) && (c10 = this.m, e10 = sg().VM, f10 = a10.j, g10 = new z7().d(ic(Xh().Hf.r)), h10 = Ab(B6(a10.g, Xh().Hf).x, q5(jd)), k10 = new z7().d(this.m.qh), c10.Gc(e10.j, f10, g10, "RAML 1.0 security scheme type detected in OAS 2.0 spec", h10, Yb().dh, k10)); + } + c10 = ac(new M6().W(b10), "type"); + c10.b() || (c10 = c10.c().i.hb().gb, e10 = Q5().nd, c10 === e10 && B6(a10.g, Xh().Hf).A.Ha("") && (c10 = this.m, e10 = sg().hZ, f10 = a10.j, g10 = new z7().d(ic(Xh().Hf.r)), ae4(), h10 = b10.da, h10 = new z7().d(new be4().jj(ce4(0, de4(ee4(), h10.rf, h10.If, h10.Yf, h10.bg)))), k10 = new z7().d(this.m.qh), c10.Gc( + e10.j, + f10, + g10, + "Security Scheme must have a mandatory value from 'oauth2', 'basic' or 'apiKey'", + h10, + Yb().qb, + k10 + ))); + Qib(a10); + c10 = new M6().W(b10); + e10 = jx(new je4().e("displayName")); + f10 = Xh().Zc; + Gg(c10, e10, Hg(Ig(this, f10, this.m), a10)); + c10 = new M6().W(b10); + e10 = Xh().Va; + Gg(c10, "description", Hg(Ig(this, e10, this.m), a10)); + j4a(new S32(), jx(new je4().e("describedBy")), b10, a10, tz(uz(), this.m)).hd(); + c10 = this.m.$h.Mpa(b10, a10).Cc(); + c10.b() || (c10 = c10.c(), e10 = Xh().Oh, f10 = Od(O7(), b10), Rg(a10, e10, c10, f10)); + Ry(new Sy(), a10, b10, H10(), this.m).hd(); + return a10; + } + throw new x7().d(a10); + }; + d7.$classData = r8({ xNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSecuritySchemeParser", { xNa: 1, f: 1, AQa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function geb() { + this.N = this.p = this.Dv = null; + } + geb.prototype = new u7(); + geb.prototype.constructor = geb; + d7 = geb.prototype; + d7.H = function() { + return "OasSecuritySchemesEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof geb) { + var b10 = this.Dv, c10 = a10.Dv; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Dv; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Dv, c10 = w6(/* @__PURE__ */ function() { + return function(v10) { + wna || (wna = new $z().a()); + var A10 = B6(v10.g, Xh().Hf).A; + A10 = qna(A10.b() ? null : A10.c()); + return new R6().M(A10, v10); + }; + }(this)), e10 = K7(); + b10 = b10.ka(c10, e10.u).Ch(Gb().si); + b10 = wja(b10, w6(/* @__PURE__ */ function() { + return function(v10) { + return v10.ma().$O; + }; + }(this))); + if (null === b10) + throw new x7().d(b10); + e10 = b10.ma(); + b10 = b10.ya(); + c10 = this.N.Gg(); + var f10 = Xq().Cp; + c10 = c10 === f10; + if (tc(e10)) { + f10 = c10 ? (T6(), mh(T6(), "securitySchemes")) : (T6(), mh(T6(), "securityDefinitions")); + c10 = new PA().e(a10.ca); + var g10 = c10.s, h10 = c10.ca, k10 = new rr().e(h10), l10 = wr(), m10 = this.p, p10 = w6(/* @__PURE__ */ function(v10) { + return function(A10) { + return new o7().vU(A10.ya(), A10.ma(), v10.p, v10.N); + }; + }(this)), t10 = Id().u; + jr(l10, m10.zb(Jd(e10, p10, t10).ke()), k10); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + e10 = c10.s; + f10 = [f10]; + if (0 > e10.w) + throw new U6().e("0"); + h10 = f10.length | 0; + g10 = e10.w + h10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, h10, e10.w); + h10 = e10.L; + m10 = h10.n.length; + l10 = k10 = 0; + p10 = f10.length | 0; + m10 = p10 < m10 ? p10 : m10; + p10 = h10.n.length; + for (m10 = m10 < p10 ? m10 : p10; k10 < m10; ) + h10.n[l10] = f10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + } + if (tc(b10)) { + T6(); + c10 = jx(new je4().e("securitySchemes")); + e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + f10 = c10.s; + g10 = c10.ca; + h10 = new rr().e(g10); + k10 = wr(); + l10 = this.p; + m10 = w6(/* @__PURE__ */ function(v10) { + return function(A10) { + return new o7().vU(A10.ya(), A10.ma(), v10.p, v10.N); + }; + }(this)); + p10 = Id().u; + jr(k10, l10.zb(Jd(b10, m10, p10).ke()), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.CU = function(a10, b10, c10) { + this.Dv = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.La = function() { + var a10 = this.Dv.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ yNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSecuritySchemesEmitters", { yNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Rib() { + this.p = this.rh = this.TP = null; + } + Rib.prototype = new u7(); + Rib.prototype.constructor = Rib; + d7 = Rib.prototype; + d7.H = function() { + return "OasSettingsTypeEmitter"; + }; + function e3a(a10, b10, c10) { + var e10 = new Rib(); + e10.TP = a10; + e10.rh = b10; + e10.p = c10; + return e10; + } + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Rib) { + var b10 = this.TP, c10 = a10.TP; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.rh, c10 = a10.rh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.TP; + case 1: + return this.rh; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = jx(new je4().e("settings")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10); + jr(wr(), this.p.zb(this.TP), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.TP.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.La())); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ BNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasSettingsTypeEmitter", { BNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sib() { + this.SV = this.p = this.Ba = null; + } + Sib.prototype = new u7(); + Sib.prototype.constructor = Sib; + d7 = Sib.prototype; + d7.H = function() { + return "OasShapeDependenciesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Sib) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.SV, a10 = a10.SV, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.SV; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "dependencies"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.wb, k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.p, A10 = p10.SV, D10 = new Mib(); + D10.Yi = t10; + D10.p = v10; + D10.lg = A10; + return D10; + }; + }(this)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + function Iib(a10, b10, c10) { + var e10 = new Sib(); + e10.Ba = a10; + e10.p = b10; + e10.SV = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ CNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasShapeDependenciesEmitter", { CNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function n72() { + this.N = this.Q = this.p = this.Ba = null; + } + n72.prototype = new u7(); + n72.prototype.constructor = n72; + d7 = n72.prototype; + d7.H = function() { + return "OasShapeInheritsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n72) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r.wb, c10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return p10; + }; + }(this)), e10 = K7(), f10 = b10.ka(c10, e10.u); + T6(); + e10 = mh(T6(), "x-amf-merge"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + f10.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + if (wh(v10.fa(), q5(cv))) { + var A10 = p10.N, D10 = rA(); + v10 = B6(v10.Y(), qf().R).A; + ex(A10, t10, Fna(D10, v10.b() ? null : v10.c(), new z7().d(p10.N.Gg()))); + } else if (Za(v10).na()) + A10 = p10.N, D10 = rA(), v10 = B6(v10.Y(), qf().R).A, ex(A10, t10, Fna(D10, v10.b() ? null : v10.c(), new z7().d(p10.N.Gg()))); + else { + A10 = p10.p; + D10 = p10.Q; + var C10 = H10(), I10 = H10(), L10 = H10(); + k7( + new l7(), + v10, + A10, + C10, + D10, + I10, + L10, + p10.N + ).Ob(t10); + } + }; + }(this, h10))); + T6(); + eE(); + f10 = SA(zs(), g10); + h10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, h10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + f10 = e10.length | 0; + h10 = c10.w + f10 | 0; + uD(c10, h10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + var k10 = f10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = f10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + f10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = h10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.Zz = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ DNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasShapeInheritsEmitter", { DNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function q7() { + this.zma = this.N = this.tf = this.Qe = this.v_ = this.Q = this.p = this.Kq = null; + } + q7.prototype = new u7(); + q7.prototype.constructor = q7; + d7 = q7.prototype; + d7.H = function() { + return "OasTupleItemsShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q7) { + var b10 = this.Kq, c10 = a10.Kq; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.v_, c10 = a10.v_, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kq; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.v_; + case 4: + return this.Qe; + case 5: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Tib(a10, b10, c10, e10, f10, g10, h10, k10) { + a10.Kq = b10; + a10.p = c10; + a10.Q = e10; + a10.v_ = f10; + a10.Qe = g10; + a10.tf = h10; + a10.N = k10; + b10 = B6(b10.aa, an().$p); + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(l10) { + return function(m10) { + if (null !== m10) { + var p10 = m10.ma(), t10 = m10.Ki(); + m10 = l10.p; + var v10 = H10(), A10 = l10.Q, D10 = l10.Qe; + t10 = J5(K7(), new Ib().ha(["items", "" + t10])); + var C10 = K7(); + return Vy(p10, m10, v10, A10, D10.ia(t10, C10.u), l10.tf, false, l10.N); + } + throw new x7().d(m10); + }; + }(a10)); + e10 = K7(); + a10.zma = b10.ka(c10, e10.u); + return a10; + } + d7.Qa = function(a10) { + if (Vb().Ia(Ti(this.Kq.aa, an().$p)).na()) { + T6(); + var b10 = mh(T6(), "items"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.zma.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = v10.Pa(); + var A10 = new bdb(), D10 = K7(); + v10 = v10.ec(A10, D10.u); + A10 = t10.s; + D10 = t10.ca; + var C10 = new rr().e(D10); + v10.U(w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Y10.Qa(L10); + }; + }(p10, C10))); + pr(A10, mr(T6(), tr(ur(), C10.s, D10), Q5().sa)); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba( + e10.L, + 0, + e10.L, + f10, + e10.w + ); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Vb().Ia(Ti(this.Kq.aa, uh().Ff)); + return a10 instanceof z7 ? (a10 = a10.i, kr(wr(), a10.x, q5(jd))) : ld(); + }; + d7.$classData = r8({ FNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTupleItemsShapeEmitter", { FNa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Uib() { + AP.call(this); + this.Hk = this.Ck = this.gd = this.Mc = this.wa = null; + this.kj = false; + this.je = null; + } + Uib.prototype = new BP(); + Uib.prototype.constructor = Uib; + d7 = Uib.prototype; + d7.H = function() { + return "OasTupleShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Uib) { + var b10 = this.wa, c10 = a10.wa; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ck, c10 = a10.Ck, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hk, c10 = a10.Hk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.Ck; + case 4: + return this.Hk; + case 5: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), AP.prototype.Pa.call(this)), b10 = this.wa.aa; + Dg(a10, xka("array", this.wa)); + var c10 = hd(b10, uh().pr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "maxItems", c10, y7())))); + c10 = hd(b10, uh().Bq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "minItems", c10, y7())))); + c10 = hd(b10, uh().qr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), "uniqueItems", c10, y7())))); + c10 = hd(b10, an().UM); + if (c10 instanceof z7) + Dg(a10, $g(new ah(), "additionalItems", T_a(c10.i), y7())); + else if (y7() === c10) + c10 = hd(b10, an().pR), c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Cib( + "additionalItems", + c10, + this.Mc, + this.gd, + this.je + )))); + else + throw new x7().d(c10); + c10 = false; + var e10 = null, f10 = hd(b10, uh().RC); + a: { + if (f10 instanceof z7) { + c10 = true; + e10 = f10; + var g10 = e10.i; + if (wh(g10.r.x, q5(ucb))) { + Dg(a10, Tib(new q7(), this.wa, this.Mc, this.gd, new z7().d($g(new ah(), "collectionFormat", g10, y7())), this.Ck, this.Hk, this.je)); + break a; + } + } + if (c10) + c10 = e10.i, Dg(Dg(a10, Tib(new q7(), this.wa, this.Mc, this.gd, y7(), this.Ck, this.Hk, this.je)), $g(new ah(), "collectionFormat", c10, y7())); + else if (y7() === f10) + Dg(a10, Tib(new q7(), this.wa, this.Mc, this.gd, y7(), this.Ck, this.Hk, this.je)); + else + throw new x7().d(f10); + } + b10 = hd(b10, Ih().xd); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, new n72().Zz(b10, this.Mc, this.gd, this.je)))); + ws(a10, fma(this.wa, this.Mc, this.je).Pa()); + return a10; + }; + function t3a(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new Uib(); + k10.wa = a10; + k10.Mc = b10; + k10.gd = c10; + k10.Ck = e10; + k10.Hk = f10; + k10.kj = g10; + k10.je = h10; + e10 = H10(); + f10 = H10(); + AP.prototype.VK.call(k10, a10, b10, c10, e10, f10, g10, h10); + return k10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.wa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ck)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Hk)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 6); + }; + d7.$classData = r8({ HNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTupleShapeEmitter", { HNa: 1, hJ: 1, iN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vib() { + CP.call(this); + this.xV = this.Za = this.wa = null; + } + Vib.prototype = new DP(); + Vib.prototype.constructor = Vib; + d7 = Vib.prototype; + d7.H = function() { + return "AnyTypeShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vib && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.zV = function() { + return this.xV; + }; + d7.t = function() { + return V5(W5(), this); + }; + function Wib(a10, b10, c10) { + var e10 = new Vib(); + e10.wa = b10; + e10.Za = c10; + CP.prototype.Ux.call(e10, a10); + e10.xV = new EP().GB(true, true, false); + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ PNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$AnyTypeShapeParser", { PNa: 1, iJ: 1, jJ: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xib() { + CP.call(this); + this.eh = this.Za = this.wa = null; + } + Xib.prototype = new DP(); + Xib.prototype.constructor = Xib; + d7 = Xib.prototype; + d7.H = function() { + return "ArrayShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Xib && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Za, a10.Za)) + return b10 = this.eh, a10 = a10.eh, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + case 2: + return this.eh; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + Yib(this.l, this.wa, this.Za, this.eh, this.l.ra.Qh.ku); + CP.prototype.Xi.call(this); + var a10 = new M6().W(this.Za), b10 = this.l, c10 = uh().Bq; + Gg(a10, "minItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().pr; + Gg(a10, "maxItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().qr; + Gg(a10, "uniqueItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().RC; + Gg(a10, "collectionFormat", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = ac(new M6().W(this.Za), "items"); + a10.b() ? a10 = y7() : (a10 = a10.c().i, a10 = jc(kc(a10), qc())); + a10.b() || (a10 = a10.c(), a10 = new M6().W(a10), b10 = this.l, c10 = uh().RC, Gg(a10, "collectionFormat", rP(Hg(Ig(b10, c10, this.l.ra), this.wa), new Z5().a()))); + a10 = ac(new M6().W(this.Za), "items"); + if (a10.b()) + a10 = y7(); + else if (a10 = a10.c(), a10 = nX(pX(), a10, w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10.ub(e10.wa.j + "/items", lt2()); + }; + }(this)), this.l.Nj, this.l.ra).Cc(), a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + if (a10 instanceof th) + a10 = YA(ZA(this.wa, a10)); + else if (a10 instanceof pi) + a10 = YA(ZA(this.wa, a10)); + else { + if (null === a10) + throw new x7().d(a10); + a10 = ZA(this.wa, a10); + } + a10 = new z7().d(a10); + } + if (a10 instanceof z7 && (b10 = a10.i, null !== b10)) + return Rd(b10, this.wa.j); + if (y7() === a10) + return a10 = this.wa, O7(), b10 = new P6().a(), c10 = new S6().a(), ZA(a10, new vh().K(c10, b10)); + throw new x7().d(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + function D3a(a10, b10, c10, e10) { + var f10 = new Xib(); + f10.wa = b10; + f10.Za = c10; + f10.eh = e10; + CP.prototype.Ux.call(f10, a10); + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$ArrayShapeParser", { QNa: 1, iJ: 1, jJ: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zib() { + CP.call(this); + this.Je = this.Za = this.wa = null; + } + Zib.prototype = new DP(); + Zib.prototype.constructor = Zib; + d7 = Zib.prototype; + d7.H = function() { + return "NodeShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Zib && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function $ib(a10, b10, c10, e10) { + var f10 = new Zib(); + f10.wa = b10; + f10.Za = c10; + f10.Je = e10; + CP.prototype.Ux.call(f10, a10); + return f10; + } + function ajb(a10) { + CP.prototype.Xi.call(a10); + var b10 = ac(new M6().W(a10.Za), "type"); + if (!b10.b()) { + b10.c(); + var c10 = a10.wa, e10 = new xi().a(); + Cb(c10, e10); + } + var f10 = new M6().W(a10.Za), g10 = a10.l, h10 = Ih().dw; + Gg(f10, "minProperties", Hg(Ig(g10, h10, a10.Je), a10.wa)); + var k10 = new M6().W(a10.Za), l10 = a10.l, m10 = Ih().cw; + Gg(k10, "maxProperties", Hg(Ig(l10, m10, a10.Je), a10.wa)); + var p10 = a10.wa, t10 = Ih().Cn; + Bi(p10, t10, false); + var v10 = ac(new M6().W(a10.Za), "additionalProperties"); + if (!v10.b()) { + var A10 = v10.c(), D10 = A10.i.hb().gb; + if (Q5().ti === D10) { + var C10 = a10.l, I10 = Ih().Cn; + qP(rP(zFa(Hg(Ig(C10, I10, a10.Je), a10.wa)), new xi().a()), A10); + } else if (Q5().sa === D10) { + var L10 = nX(pX(), A10, w6(/* @__PURE__ */ function(fe4) { + return function(ge4) { + ge4.ub(fe4.wa.j, lt2()); + }; + }(a10)), a10.l.Nj, a10.Je).Cc(); + if (!L10.b()) { + var Y10 = L10.c(), ia = a10.wa, pa = Ih().vF, La = Od(O7(), A10); + Rg(ia, pa, Y10, La); + } + } else { + var ob = a10.Je, zb = sg().X5, Zb = a10.wa.j, Cc = y7(); + ec(ob, zb, Zb, Cc, "Invalid part type for additional properties node. Should be a boolean or a map", A10.da); + } + } + if (a10.l.Nj instanceof Qy) { + var vc = ac(new M6().W(a10.Za), "discriminator"); + if (!vc.b()) { + var id = vc.c(); + I3a(a10.l, a10.wa, id).hd(); + } + } else { + var yd = new M6().W(a10.Za), zd = a10.l, rd = Ih().Us; + Gg( + yd, + "discriminator", + Hg(Ig(zd, rd, a10.Je), a10.wa) + ); + var sd = new M6().W(a10.Za), le4 = jx(new je4().e("discriminatorValue")), Vc = a10.l, Sc = Ih().Jy; + Gg(sd, le4, Hg(Ig(Vc, Sc, a10.Je), a10.wa)); + } + var Qc = ac(new M6().W(a10.Za), "required"); + if (Qc.b()) + var $c = y7(); + else { + var Wc = Qc.c(), Qe = false, Qd = Wc.i.hb().gb; + a: { + if (Q5().cd === Qd) { + Qe = true; + var me4 = a10.l.Nj, of = KFa(); + if (null !== me4 && me4 === of) { + var Le2 = a10.Je, Ve = sg().o6, he4 = a10.wa.j, Wf = Wc.i, vf = y7(); + ec(Le2, Ve, he4, vf, "Required arrays of properties not supported in JSON Schema below version draft-4", Wf.da); + var He = Rb(Gb().ab, H10()); + break a; + } + } + if (Qe) { + var Ff = Wc.i, wf = tw(); + He = N6(Ff, wf, a10.Je).Cm.ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function(fe4) { + return function(ge4, ph) { + var hg = Dd(); + return ge4.Wh(N6(ph, hg, fe4.Je), ph); + }; + }(a10))); + } else + He = Rb(Gb().ab, H10()); + } + $c = new z7().d(He); + } + var Re2 = $c.b() ? Rb(Gb().ab, H10()) : $c.c(), we4 = Rb(xgb(), H10()), ne4 = ac(new M6().W(a10.Za), "properties"); + if (!ne4.b()) { + var Me2 = ne4.c().i, Se4 = jc(kc(Me2), qc()); + if (Se4 instanceof z7) { + var xf = oma(new Iy(), a10.l, Se4.i, w6(/* @__PURE__ */ function(fe4) { + return function(ge4) { + return p5a(fe4.wa, ge4); + }; + }(a10)), Re2, (qma(a10.l), false)).Vg(), ie3 = w6(/* @__PURE__ */ function() { + return function(fe4) { + var ge4 = B6( + fe4.aa, + qf().R + ).A; + ge4 = ge4.b() ? null : ge4.c(); + return new R6().M(ge4, fe4); + }; + }(a10)), gf = K7(), pf = xf.ka(ie3, gf.u); + yi(we4, pf); + } + } + var hf = ac(new M6().W(a10.Za), "patternProperties"); + if (!hf.b()) { + var Gf = hf.c().i, yf = jc(kc(Gf), qc()); + if (yf instanceof z7) { + var oe4 = oma(new Iy(), a10.l, yf.i, w6(/* @__PURE__ */ function(fe4) { + return function(ge4) { + return p5a(fe4.wa, ge4); + }; + }(a10)), Re2, true).Vg(), lg = w6(/* @__PURE__ */ function() { + return function(fe4) { + var ge4 = B6(fe4.aa, qf().R).A; + ge4 = ge4.b() ? null : ge4.c(); + return new R6().M(ge4, fe4); + }; + }(a10)), bh = K7(), Qh = oe4.ka(lg, bh.u); + yi(we4, Qh); + } + } + if (ne4.b()) + var af = y7(); + else { + var Pf = ne4.c(), oh = Od(O7(), Pf.i), ch = Od(O7(), Pf); + af = new z7().d(new R6().M(oh, ch)); + } + if (af.b()) + if (hf.b()) + var Ie2 = y7(); + else { + var ug = hf.c(), Sg = Od(O7(), ug.i), Tg = Od(O7(), ug); + Ie2 = new z7().d(new R6().M(Sg, Tg)); + } + else + Ie2 = af; + if (Ie2.b()) { + O7(); + var zh = new P6().a(); + O7(); + var Rh = new P6().a(), vg = new R6().M(zh, Rh); + } else + vg = Ie2.c(); + if (null === vg) + throw new x7().d(vg); + var dh = vg.ma(), Jg = vg.ya(); + if (tc(we4)) { + var Ah = a10.wa, Bh = Ih().kh, cg = new Fc().Vd(we4), Qf = Zr(new $r(), cg.Sb.Ye().Dd(), dh); + Rg(Ah, Bh, Qf, Jg); + } + B6(a10.wa.aa, Ih().kh).U(w6(/* @__PURE__ */ function(fe4, ge4) { + return function(ph) { + var hg = B6( + ph.aa, + qf().R + ).A; + hg = hg.b() ? null : hg.c(); + ge4.Ue(hg, ph); + return ge4; + }; + }(a10, we4))); + var Kg = ac(new M6().W(a10.Za), "dependencies"); + if (!Kg.b()) { + var Ne2 = Kg.c(), Xf = Ne2.i, di = qc(), dg = U4a(new d42(), N6(Xf, di, a10.Je), we4, a10.Je).Vg(), Hf = a10.wa, wg = Ih().VC, Lg = Zr(new $r(), dg, Od(O7(), Ne2.i)), jf = Od(O7(), Ne2); + Rg(Hf, wg, Lg, jf); + } + var mg = ac(new M6().W(a10.Za), "x-amf-merge"); + if (!mg.b()) { + var Mg = mg.c(), Ng = a10.l, eg = Mg.i, Oe4 = lc(), ng = B3a(new A3a(), Ng, N6(eg, Oe4, a10.Je), w6(/* @__PURE__ */ function(fe4) { + return function(ge4) { + ge4.ub(fe4.wa.j, lt2()); + }; + }(a10))).Vg(), fg = a10.wa, Ug = Ih().xd, xg = Zr(new $r(), ng, Od( + O7(), + Mg.i + )), gg = Od(O7(), Mg); + Rg(fg, Ug, xg, gg); + } + return a10.wa; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ UNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$NodeShapeParser", { UNa: 1, iJ: 1, jJ: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function E3a() { + CP.call(this); + this.eh = this.Za = this.wa = null; + } + E3a.prototype = new DP(); + E3a.prototype.constructor = E3a; + d7 = E3a.prototype; + d7.H = function() { + return "TupleShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof E3a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Za, a10.Za)) + return b10 = this.eh, a10 = a10.eh, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + case 2: + return this.eh; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + this.eh.P(this.wa); + CP.prototype.Xi.call(this); + var a10 = new M6().W(this.Za), b10 = this.l, c10 = uh().Bq; + Gg(a10, "minItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().pr; + Gg(a10, "maxItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = uh().qr; + Gg(a10, "uniqueItems", Hg(Ig(b10, c10, this.l.ra), this.wa)); + a10 = ac(new M6().W(this.Za), "additionalItems"); + if (!a10.b()) + if (a10 = a10.c(), b10 = a10.i.hb().gb, Q5().ti === b10) + b10 = this.l, c10 = an().UM, qP(zFa(Hg(Ig(b10, c10, this.l.ra), this.wa)), a10); + else if (Q5().sa === b10) { + if (b10 = nX(pX(), a10, w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10.ub(g10.wa.j, lt2()); + }; + }(this)), this.l.Nj, this.l.ra).Cc(), !b10.b()) { + b10 = b10.c(); + c10 = this.wa; + var e10 = an().pR; + a10 = Od(O7(), a10); + Rg(c10, e10, b10, a10); + } + } else { + b10 = this.l.ra; + c10 = sg().W5; + e10 = this.wa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "Invalid part type for additional items node. Should be a boolean or a map", a10.da); + } + a10 = ac(new M6().W(this.Za), "items"); + a10.b() || (a10 = a10.c().i, b10 = tw(), a10 = N6(a10, b10, this.l.ra).Cm, b10 = new ddb(), c10 = rw(), a10 = a10.ec(b10, c10.sc), b10 = rw(), a10 = a10.og(b10.sc), b10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + return aPa(pX(), k10, "member" + h10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(l10.wa.j + "/items/" + m10, lt2()); + }; + }(g10, h10)), g10.l.Nj, g10.l.ra).Cc(); + } + throw new x7().d(h10); + }; + }(this)), c10 = rw(), b10 = a10.ka(b10, c10.sc), a10 = this.wa, b10 = b10.Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))), c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)), e10 = rw(), b10 = b10.ka(c10, e10.sc), c10 = an().$p, Zd(a10, c10, b10)); + return this.wa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$TupleShapeParser", { bOa: 1, iJ: 1, jJ: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function r72() { + CP.call(this); + this.wa = this.Za = this.Bm = this.rH = this.qV = null; + } + r72.prototype = new DP(); + r72.prototype.constructor = r72; + d7 = r72.prototype; + d7.H = function() { + return "UnionShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof r72 && a10.l === this.l) { + var b10 = this.qV, c10 = a10.qV; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.rH === a10.rH : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.qV; + case 1: + return this.rH; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.zP = function() { + CP.prototype.Xi.call(this); + var a10 = ac(new M6().W(this.Za), "x-amf-union"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i, c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + k10 = pG(wD(), mh(T6(), "item" + h10), k10); + return nX(pX(), k10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + p10.ub(l10.wa.j + "/items/" + m10, lt2()); + }; + }(g10, h10)), g10.l.Nj, g10.l.ra).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.wa; + e10 = xn().Le; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.ra; + c10 = Wd().dN; + e10 = this.wa.j; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, e10, f10, "Unions are built from multiple shape nodes", a10.da); + } + } + return this.wa; + }; + function bjb(a10, b10, c10, e10) { + a10.qV = c10; + a10.rH = e10; + CP.prototype.Ux.call(a10, b10); + if (c10 instanceof ve4) + c10 = c10.i.i; + else if (c10 instanceof ye4) + c10 = c10.i; + else + throw new x7().d(c10); + a10.Bm = c10; + c10 = a10.Bm; + var f10 = qc(); + a10.Za = N6(c10, f10, b10.ra); + b10 = Rs(O7(), a10.Bm); + b10 = new Vh().K(new S6().a(), b10); + c10 = new Bz().ln(a10.qV).pk(); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(Od(O7(), c10.Aa))); + c10 = c10.b() ? (O7(), new P6().a()) : c10.c(); + a10.wa = Sd(b10, e10, c10); + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$UnionShapeParser", { dOa: 1, iJ: 1, jJ: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function cjb() { + AP.call(this); + this.Hk = this.Ck = this.gd = this.Mc = this.wa = null; + this.kj = false; + this.je = null; + } + cjb.prototype = new BP(); + cjb.prototype.constructor = cjb; + d7 = cjb.prototype; + d7.H = function() { + return "OasUnionShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof cjb) { + var b10 = this.wa, c10 = a10.wa; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Ck, c10 = a10.Ck, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hk, c10 = a10.Hk, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.Ck; + case 4: + return this.Hk; + case 5: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = AP.prototype.Pa.call(this), b10 = J5(K7(), new Ib().ha([wib(this.wa, this.Mc, this.gd, this.Ck, this.Hk, this.je)])), c10 = K7(); + return a10.ia(b10, c10.u); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.wa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ck)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Hk)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 6); + }; + function r3a(a10, b10, c10, e10, f10, g10) { + var h10 = new cjb(); + h10.wa = a10; + h10.Mc = b10; + h10.gd = c10; + h10.Ck = e10; + h10.Hk = f10; + h10.kj = false; + h10.je = g10; + e10 = H10(); + f10 = H10(); + AP.prototype.VK.call(h10, a10, b10, c10, e10, f10, false, g10); + return h10; + } + d7.$classData = r8({ hOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasUnionShapeEmitter", { hOa: 1, hJ: 1, iN: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function By() { + this.Qc = this.N = this.tf = this.Qe = this.Q = this.p = this.pa = null; + } + By.prototype = new u7(); + By.prototype.constructor = By; + d7 = By.prototype; + d7.H = function() { + return "OasXoneConstraintEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof By) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Qe, c10 = a10.Qe, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.tf, a10 = a10.tf, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.Qe; + case 4: + return this.tf; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "oneOf"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.bE = function(a10, b10, c10, e10, f10, g10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.Qe = e10; + this.tf = f10; + this.N = g10; + a10 = B6(a10.Y(), qf().li); + b10 = K7(); + a10 = a10.og(b10.u); + b10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(), m10 = k10.Ki(); + if (null !== l10) { + k10 = h10.p; + var p10 = H10(), t10 = h10.Q, v10 = h10.Qe; + m10 = J5(K7(), new Ib().ha(["oneOf", "" + m10])); + var A10 = K7(); + return k7(new l7(), l10, k10, p10, t10, v10.ia(m10, A10.u), h10.tf, h10.N); + } + } + throw new x7().d(k10); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ iOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasXoneConstraintEmitter", { iOa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function j7() { + this.Bc = this.p = this.Ei = null; + } + j7.prototype = new u7(); + j7.prototype.constructor = j7; + d7 = j7.prototype; + d7.H = function() { + return "ParametrizedDeclarationEmitter"; + }; + d7.Ob = function(a10) { + if (this.Ei.kI().Da()) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + T6(); + var e10 = B6(this.Ei.Y(), FY().R).A; + e10 = e10.b() ? null : e10.c(); + var f10 = mh(T6(), e10); + e10 = new PA().e(c10.ca); + var g10 = e10.s, h10 = e10.ca, k10 = new rr().e(h10), l10 = this.Ei.kI(), m10 = w6(/* @__PURE__ */ function(v10) { + return function(A10) { + var D10 = v10.p, C10 = v10.Bc, I10 = new djb(); + I10.Pu = A10; + I10.p = D10; + I10.Bc = C10; + return I10; + }; + }(this)), p10 = K7(); + l10 = l10.ka(m10, p10.u); + jr(wr(), this.p.zb(l10), k10); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + g10 = e10.s; + f10 = [f10]; + if (0 > g10.w) + throw new U6().e("0"); + k10 = f10.length | 0; + h10 = g10.w + k10 | 0; + uD(g10, h10); + Ba(g10.L, 0, g10.L, k10, g10.w); + k10 = g10.L; + p10 = k10.n.length; + m10 = l10 = 0; + var t10 = f10.length | 0; + p10 = t10 < p10 ? t10 : p10; + t10 = k10.n.length; + for (p10 = p10 < t10 ? p10 : t10; l10 < p10; ) + k10.n[m10] = f10[l10], l10 = 1 + l10 | 0, m10 = 1 + m10 | 0; + g10.w = h10; + pr(c10.s, vD(wD(), e10.s)); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + } else + wr(), b10 = B6(this.Ei.Y(), FY().R).A, lr(0, a10, b10.b() ? null : b10.c(), Q5().Na); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof j7) { + var b10 = this.Ei, c10 = a10.Ei; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ei; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ei.fa(), q5(jd)); + }; + d7.$classData = r8({ kOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.ParametrizedDeclarationEmitter", { kOa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function az() { + this.Qc = this.N = this.Q = this.p = this.pa = null; + } + az.prototype = new u7(); + az.prototype.constructor = az; + d7 = az.prototype; + d7.H = function() { + return "RamlAndConstraintEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof az) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.DB = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + a10 = B6(a10.Y(), qf().fi); + b10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return new yW().Cr(g10, f10.p, y7(), H10(), f10.Q, f10.N); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = fh(new je4().e("and")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ LOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAndConstraintEmitter", { LOa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ejb() { + this.N = this.Q = this.p = this.pa = null; + } + ejb.prototype = new u7(); + ejb.prototype.constructor = ejb; + d7 = ejb.prototype; + d7.H = function() { + return "RamlAnyOfShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ejb) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Hma(Ima(), this.pa); + if (b10 instanceof z7) { + var c10 = b10.i; + T6(); + b10 = mh(T6(), "type"); + T6(); + c10 = mh(T6(), c10); + sr(a10, b10, c10); + } else if (y7() === b10) + fjb(this, a10); + else + throw new x7().d(b10); + }; + function fjb(a10, b10) { + T6(); + var c10 = mh(T6(), "anyOf"), e10 = new PA().e(b10.ca), f10 = e10.s, g10 = e10.ca, h10 = new PA().e(g10), k10 = B6(a10.pa.aa, xn().Le), l10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.p, A10 = y7(), D10 = p10.Q, C10 = H10(); + return new yW().Cr(t10, v10, A10, C10, D10, p10.N); + }; + }(a10)), m10 = K7(); + k10 = k10.ka(l10, m10.u); + vr(wr(), a10.p.zb(k10), h10); + T6(); + eE(); + a10 = SA(zs(), g10); + h10 = mr(0, new Sx().Ac(a10, h10.s), Q5().cd); + pr(f10, h10); + f10 = e10.s; + c10 = [c10]; + if (0 > f10.w) + throw new U6().e("0"); + a10 = c10.length | 0; + h10 = f10.w + a10 | 0; + uD(f10, h10); + Ba(f10.L, 0, f10.L, a10, f10.w); + a10 = f10.L; + l10 = a10.n.length; + k10 = g10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = a10.n.length; + for (l10 = l10 < m10 ? l10 : m10; g10 < l10; ) + a10.n[k10] = c10[g10], g10 = 1 + g10 | 0, k10 = 1 + k10 | 0; + f10.w = h10; + pr(b10.s, vD(wD(), e10.s)); + } + d7.z = function() { + return X5(this); + }; + d7.WK = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.La = function() { + wr(); + var a10 = mt(this.pa.aa, xn().Le).fa(); + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ POa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnyOfShapeEmitter", { POa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function s7() { + this.p = this.$l = null; + this.nQ = false; + this.N = null; + } + s7.prototype = new u7(); + s7.prototype.constructor = s7; + d7 = s7.prototype; + d7.H = function() { + return "RamlCreativeWorkEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + jr(wr(), new R32().lU(this.$l, this.p, this.nQ, this.N).Pa(), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 3; + }; + d7.lU = function(a10, b10, c10, e10) { + this.$l = a10; + this.p = b10; + this.nQ = c10; + this.N = e10; + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof s7 ? this.$l === a10.$l && this.p === a10.p ? this.nQ === a10.nQ : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$l; + case 1: + return this.p; + case 2: + return this.nQ; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.$l)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.nQ ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.La = function() { + return kr(wr(), this.$l.x, q5(jd)); + }; + d7.$classData = r8({ TOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlCreativeWorkEmitter", { TOa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function gjb() { + this.Q = this.pa = null; + } + gjb.prototype = new u7(); + gjb.prototype.constructor = gjb; + d7 = gjb.prototype; + d7.H = function() { + return "RamlExternalSourceEmitter"; + }; + d7.Ob = function(a10) { + var b10 = this.Q, c10 = new ldb(); + if (null === this) + throw mb(E6(), null); + c10.Fa = this; + b10 = Jc(b10, c10); + b10 = b10.b() ? y7() : B6(b10.c().g, Ok().Rd).A; + b10.b() || (b10 = b10.c(), lr(wr(), a10, b10, Q5().Na)); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gjb) { + var b10 = this.pa, c10 = a10.pa; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Z3a(a10, b10) { + var c10 = new gjb(); + c10.pa = a10; + c10.Q = b10; + return c10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.pa.fa(), q5(jd)); + }; + d7.$classData = r8({ ZOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlExternalSourceEmitter", { ZOa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function hjb() { + this.N = this.Q = this.p = this.pa = null; + } + hjb.prototype = new u7(); + hjb.prototype.constructor = hjb; + d7 = hjb.prototype; + d7.H = function() { + return "RamlInlinedAnyOfShapeEmitter"; + }; + d7.Ob = function(a10) { + var b10 = Hma(Ima(), this.pa); + if (b10 instanceof z7) + a10.fo(b10.i); + else if (y7() === b10) + ijb(this, a10); + else + throw new x7().d(b10); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof hjb) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function ijb(a10, b10) { + var c10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10); + T6(); + var f10 = mh(T6(), "anyOf"), g10 = new PA().e(e10.ca), h10 = g10.s, k10 = g10.ca, l10 = new PA().e(k10), m10 = B6(a10.pa.aa, xn().Le), p10 = w6(/* @__PURE__ */ function(v10) { + return function(A10) { + var D10 = v10.p, C10 = y7(), I10 = v10.Q, L10 = H10(); + return new yW().Cr(A10, D10, C10, L10, I10, v10.N); + }; + }(a10)), t10 = K7(); + m10 = m10.ka(p10, t10.u); + vr(wr(), a10.p.zb(m10), l10); + T6(); + eE(); + a10 = SA(zs(), k10); + a10 = mr(0, new Sx().Ac(a10, l10.s), Q5().cd); + pr(h10, a10); + h10 = g10.s; + f10 = [f10]; + if (0 > h10.w) + throw new U6().e("0"); + l10 = f10.length | 0; + a10 = h10.w + l10 | 0; + uD(h10, a10); + Ba(h10.L, 0, h10.L, l10, h10.w); + l10 = h10.L; + p10 = l10.n.length; + m10 = k10 = 0; + t10 = f10.length | 0; + p10 = t10 < p10 ? t10 : p10; + t10 = l10.n.length; + for (p10 = p10 < t10 ? p10 : t10; k10 < p10; ) + l10.n[m10] = f10[k10], k10 = 1 + k10 | 0, m10 = 1 + m10 | 0; + h10.w = a10; + pr(e10.s, vD(wD(), g10.s)); + pr(c10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + } + d7.z = function() { + return X5(this); + }; + d7.WK = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.La = function() { + wr(); + var a10 = mt(this.pa.aa, xn().Le).fa(); + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ gPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlInlinedAnyOfShapeEmitter", { gPa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function jjb() { + this.N = this.Q = this.p = this.Kq = null; + } + jjb.prototype = new u7(); + jjb.prototype.constructor = jjb; + d7 = jjb.prototype; + d7.H = function() { + return "RamlItemsShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jjb) { + var b10 = this.Kq, c10 = a10.Kq; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kq; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.g1 = function(a10, b10, c10, e10) { + this.Kq = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.Qa = function(a10) { + var b10 = B6(this.Kq.aa, uh().Ff); + if (b10 instanceof vh) + if (Za(b10).na()) { + T6(); + var c10 = mh(T6(), "items"), e10 = new PA().e(a10.ca); + new yW().Cr(b10, this.p, y7(), H10(), this.Q, this.N).Ob(e10); + b10 = e10.s; + c10 = [c10]; + if (0 > b10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = b10.w + f10 | 0; + uD(b10, g10); + Ba(b10.L, 0, b10.L, f10, b10.w); + f10 = b10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = g10; + pr(a10.s, vD(wD(), e10.s)); + } else { + T6(); + c10 = mh(T6(), "items"); + e10 = new PA().e(a10.ca); + g10 = e10.s; + f10 = e10.ca; + k10 = new rr().e(f10); + l10 = this.p; + h10 = this.Q; + m10 = H10(); + Q32(b10, l10, m10, h10, this.N).zw().U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Qa(t10); + }; + }(this, k10))); + pr(g10, mr(T6(), tr(ur(), k10.s, f10), Q5().sa)); + b10 = e10.s; + c10 = [c10]; + if (0 > b10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = b10.w + f10 | 0; + uD(b10, g10); + Ba(b10.L, 0, b10.L, f10, b10.w); + f10 = b10.L; + h10 = f10.n.length; + l10 = k10 = 0; + m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = g10; + pr(a10.s, vD(wD(), e10.s)); + } + else if (b10 instanceof zi) { + T6(); + c10 = mh(T6(), "items"); + e10 = new PA().e(a10.ca); + g10 = e10.s; + f10 = e10.ca; + k10 = new rr().e(f10); + l10 = this.p; + h10 = this.Q; + m10 = H10(); + Q32(b10, l10, m10, h10, this.N).zw().U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Qa(t10); + }; + }(this, k10))); + pr(g10, mr(T6(), tr(ur(), k10.s, f10), Q5().sa)); + b10 = e10.s; + c10 = [c10]; + if (0 > b10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = b10.w + f10 | 0; + uD(b10, g10); + Ba(b10.L, 0, b10.L, f10, b10.w); + f10 = b10.L; + h10 = f10.n.length; + l10 = k10 = 0; + m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = g10; + pr(a10.s, vD(wD(), e10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + wr(); + var a10 = Ti(this.Kq.aa, uh().Ff).x; + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ jPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlItemsShapeEmitter", { jPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function YO() { + this.Uh = null; + } + YO.prototype = new u7(); + YO.prototype.constructor = YO; + d7 = YO.prototype; + d7.H = function() { + return "RamlLocalReferenceEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.Ob = function(a10) { + var b10 = B6(this.Uh.Y(), db().ed).A; + if (b10 instanceof z7) + b10 = b10.i, lr(wr(), a10, b10, Q5().Na); + else { + if (y7() === b10) + throw mb(E6(), new nb().e("Missing link label")); + throw new x7().d(b10); + } + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof YO) { + var b10 = this.Uh; + a10 = a10.Uh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Uh.fa(), q5(jd)); + }; + d7.$classData = r8({ nPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlLocalReferenceEmitter", { nPa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function t72() { + this.N = this.LW = this.Q = this.p = this.pa = null; + } + t72.prototype = new u7(); + t72.prototype.constructor = t72; + d7 = t72.prototype; + d7.H = function() { + return "RamlNamedTypeEmitter"; + }; + function kjb(a10, b10, c10, e10, f10, g10) { + a10.pa = b10; + a10.p = c10; + a10.Q = e10; + a10.LW = f10; + a10.N = g10; + return a10; + } + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof t72) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.LW === a10.LW : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.LW; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.pa.Y(), qf().R).A; + b10 = b10.b() ? "schema" : b10.c(); + T6(); + var c10 = mh(T6(), b10), e10 = Za(this.pa).na() ? /* @__PURE__ */ function(p10) { + return function(t10) { + p10.hK(t10); + }; + }(this) : /* @__PURE__ */ function(p10) { + return function(t10) { + p10.gK(t10); + }; + }(this); + b10 = new PA().e(a10.ca); + e10(b10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.hK = function(a10) { + var b10 = Za(this.pa); + b10.b() || (b10 = b10.c(), oy(this.N.zf.eF(), b10, B6(this.pa.Y(), db().ed).A, this.Q).Ob(a10)); + }; + d7.gK = function(a10) { + var b10 = this.pa; + if (null !== b10) + nD(this.LW, b10, this.p, y7(), J5(K7(), H10()), this.Q).Ob(a10); + else { + a10 = this.N.hj(); + b10 = dc().Fh; + var c10 = this.pa.j, e10 = y7(), f10 = Ab(this.pa.fa(), q5(jd)), g10 = yh(this.pa); + a10.Gc(b10.j, c10, e10, "Cannot emit inline shape that doesnt support type expressions", f10, Yb().qb, g10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.pa.fa(), q5(jd)); + }; + d7.$classData = r8({ pPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlNamedTypeEmitter", { pPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function dz() { + this.tw = this.Q = this.p = this.pa = null; + } + dz.prototype = new u7(); + dz.prototype.constructor = dz; + d7 = dz.prototype; + d7.H = function() { + return "RamlNotConstraintEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof dz) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.DB = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.tw = new yW().Cr(B6(a10.Y(), qf().Bi), b10, y7(), H10(), c10, e10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = fh(new je4().e("not")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + this.tw.Ob(b10); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return this.tw.La(); + }; + d7.$classData = r8({ sPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlNotConstraintEmitter", { sPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function r4a() { + this.p = this.Ba = this.la = null; + } + r4a.prototype = new u7(); + r4a.prototype.constructor = r4a; + d7 = r4a.prototype; + d7.H = function() { + return "RamlOAuth2ScopeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof r4a) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r.wb; + var c10 = new mdb(); + var e10 = K7(), f10 = b10.ec(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + vr(wr(), this.p.zb(f10), h10); + T6(); + eE(); + f10 = SA(zs(), g10); + f10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, f10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + f10 = c10.w + h10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var k10 = h10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = h10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + h10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.Iaa = function(a10, b10, c10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ uPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlOAuth2ScopeEmitter", { uPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function bz() { + this.Qc = this.N = this.Q = this.p = this.pa = null; + } + bz.prototype = new u7(); + bz.prototype.constructor = bz; + d7 = bz.prototype; + d7.H = function() { + return "RamlOrConstraintEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bz) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.DB = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + a10 = B6(a10.Y(), qf().ki); + b10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return new yW().Cr(g10, f10.p, y7(), H10(), f10.Q, f10.N); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = fh(new je4().e("or")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ xPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlOrConstraintEmitter", { xPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ljb() { + this.N = this.Q = this.p = this.Ba = null; + } + ljb.prototype = new u7(); + ljb.prototype.constructor = ljb; + d7 = ljb.prototype; + d7.H = function() { + return "RamlPropertiesShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ljb) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JK = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "properties"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.wb, k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return mjb(t10, p10.p, p10.Q, p10.N); + }; + }(this)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ yPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlPropertiesShapeEmitter", { yPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function njb() { + this.lg = this.p = this.Yi = null; + } + njb.prototype = new u7(); + njb.prototype.constructor = njb; + d7 = njb.prototype; + d7.H = function() { + return "RamlPropertyDependenciesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof njb) { + var b10 = this.Yi, c10 = a10.Yi; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.lg, a10 = a10.lg, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Yi; + case 1: + return this.p; + case 2: + return this.lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.lg, c10 = B6(this.Yi.g, un().uJ).A; + b10 = b10.Ja(c10.b() ? null : c10.c()); + if (!b10.b()) { + b10 = b10.c(); + T6(); + b10 = B6(b10.aa, qf().R).A; + b10 = b10.b() ? null : b10.c(); + c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = hd(this.Yi.g, un().vJ); + if (e10.b()) + e10 = y7(); + else { + e10 = Yx(e10.c().r.r); + var f10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.lg.Ja(ka(v10.r)); + A10.b() ? v10 = y7() : (A10 = B6(A10.c().aa, qf().R).A, v10 = new z7().d(ih(new jh(), A10.b() ? null : A10.c(), v10.x))); + return v10.ua(); + }; + }(this)), g10 = K7(); + e10 = new z7().d(e10.bd(f10, g10.u)); + } + if (!e10.b()) { + g10 = e10.c(); + e10 = b10.s; + var h10 = b10.ca; + f10 = new PA().e(h10); + var k10 = wr(), l10 = this.p, m10 = w6(/* @__PURE__ */ function() { + return function(t10) { + return hV(new iV(), t10, Q5().Na); + }; + }(this)), p10 = K7(); + vr(k10, l10.zb(g10.ka(m10, p10.u)), f10); + T6(); + eE(); + g10 = SA(zs(), h10); + f10 = mr(0, new Sx().Ac(g10, f10.s), Q5().cd); + pr(e10, f10); + } + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Yi.x, q5(jd)); + }; + d7.$classData = r8({ zPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlPropertyDependenciesEmitter", { zPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ojb() { + this.N = this.Q = this.p = this.Yi = null; + } + ojb.prototype = new u7(); + ojb.prototype.constructor = ojb; + d7 = ojb.prototype; + d7.H = function() { + return "RamlPropertyShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ojb) { + var b10 = this.Yi, c10 = a10.Yi; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + function mjb(a10, b10, c10, e10) { + var f10 = new ojb(); + f10.Yi = a10; + f10.p = b10; + f10.Q = c10; + f10.N = e10; + return f10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Yi; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = hd(this.Yi.aa, Qi().ji); + b10.b() ? b10 = y7() : (b10 = b10.c(), 0 !== (b10.r.r.r | 0) || wh(b10.r.x, q5(b42)) ? (B6(this.Yi.aa, Qi().cv).A.na() ? (b10 = B6(this.Yi.aa, qf().R).A, b10 = "//" !== (b10.b() ? null : b10.c())) : b10 = false, b10 ? (b10 = B6(this.Yi.aa, qf().R).A, b10 = "/" + (b10.b() ? null : b10.c()) + "/") : (b10 = B6(this.Yi.aa, qf().R).A, b10 = b10.b() ? null : b10.c())) : (b10 = B6(this.Yi.aa, qf().R).A, b10 = (b10.b() ? null : b10.c()) + "?"), b10 = new z7().d(b10)); + b10.b() ? (b10 = B6(this.Yi.aa, qf().R).A, b10 = b10.b() ? null : b10.c()) : b10 = b10.c(); + b10 = mr(T6(), nr(or(), b10), Q5().Na); + if (wh(B6(this.Yi.aa, Qi().Vf).fa(), q5(IR))) { + var c10 = new PA().e(a10.ca); + lr(wr(), c10, "", Q5().nd); + var e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = b10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + } else if (c10 = hd(this.Yi.aa, Qi().cl), c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d($g(new ah(), fh(new je4().e("readOnly")), c10, y7()))), c10 = c10.ua(), e10 = S4a(R4a(new a42(), B6(this.Yi.aa, Qi().Vf), hd(this.Yi.aa, Qi().ji))).ua(), g10 = Xd(), e10 = c10.ia(e10, g10.u).ke(), g10 = B6(this.Yi.aa, Qi().Vf), g10 instanceof vh) { + c10 = new PA().e(a10.ca); + f10 = this.p; + k10 = y7(); + l10 = this.Q; + h10 = H10(); + g10 = new yW().Cr(g10, f10, k10, h10, l10, this.N).tw; + if (g10 instanceof ve4) + g10.i.Ob(c10); + else if (g10 instanceof ye4) { + g10 = g10.i; + f10 = c10.s; + k10 = c10.ca; + l10 = new rr().e(k10); + h10 = wr(); + m10 = this.p; + var p10 = K7(); + jr(h10, m10.zb(g10.ia(e10, p10.u)), l10); + pr(f10, mr(T6(), tr(ur(), l10.s, k10), Q5().sa)); + } else + throw new x7().d(g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + h10 = f10.n.length; + l10 = k10 = 0; + m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + } else { + c10 = new PA().e(a10.ca); + g10 = c10.s; + f10 = c10.ca; + k10 = new rr().e(f10); + jr(wr(), e10, k10); + pr(g10, mr(T6(), tr(ur(), k10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + h10 = f10.n.length; + l10 = k10 = 0; + m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Yi.Xa, q5(jd)); + }; + d7.$classData = r8({ APa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlPropertyShapeEmitter", { APa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function pjb() { + this.N = this.Q = this.p = this.pa = null; + } + pjb.prototype = new u7(); + pjb.prototype.constructor = pjb; + d7 = pjb.prototype; + d7.H = function() { + return "RamlRecursiveShapeTypeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pjb && this.pa === a10.pa && this.p === a10.p) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + new Zy().FO(this.pa, this.p, this.Q, this.N).Pa().U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + e10.Qa(c10); + }; + }(this, a10))); + }; + d7.z = function() { + return X5(this); + }; + d7.FO = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.La = function() { + return kr(wr(), this.pa.Xa, q5(jd)); + }; + d7.$classData = r8({ CPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlRecursiveShapeTypeEmitter", { CPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function qjb() { + this.N = this.Q = this.p = this.pa = null; + } + qjb.prototype = new u7(); + qjb.prototype.constructor = qjb; + d7 = qjb.prototype; + d7.H = function() { + return "RamlSchemaShapeEmitter"; + }; + d7.Ob = function(a10) { + if (B6(this.pa.aa, Ag().Ec).Da()) { + var b10 = this.pa.aa, c10 = J5(Ef(), H10()); + ws(c10, new yX().Vx(this.pa, this.p, this.Q, this.N).Pa()); + b10 = hd(b10, pn().Rd); + b10.b() || (b10 = b10.c(), Dg(c10, $g(new ah(), "type", b10, y7()))); + b10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(c10), e10); + pr(b10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } else if (c10 = B6(this.pa.aa, Zf().Rd).A, c10 instanceof z7) + c10 = c10.i, lr(wr(), a10, c10, Q5().Na); + else if (y7() === c10) + c10 = T6().nd, pr(a10.s, c10); + else + throw new x7().d(c10); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qjb) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + function $3a(a10, b10, c10, e10) { + var f10 = new qjb(); + f10.pa = a10; + f10.p = b10; + f10.Q = c10; + f10.N = e10; + return f10; + } + d7.La = function() { + return kr(wr(), this.pa.Xa, q5(jd)); + }; + d7.$classData = r8({ EPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlSchemaShapeEmitter", { EPa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function sz() { + this.kd = this.m = this.yb = this.Ca = this.la = this.ad = null; + } + sz.prototype = new u7(); + sz.prototype.constructor = sz; + d7 = sz.prototype; + d7.H = function() { + return "RamlSecuritySchemeParser"; + }; + function Mma(a10, b10, c10, e10, f10, g10) { + a10.ad = b10; + a10.la = c10; + a10.Ca = e10; + a10.yb = f10; + a10.m = g10; + return a10; + } + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof sz) { + var b10 = this.ad, c10 = a10.ad; + return (null === b10 ? null === c10 : b10.h(c10)) && this.la === a10.la && Bj(this.Ca, a10.Ca) ? this.yb === a10.yb : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ad; + case 1: + return this.la; + case 2: + return this.Ca; + case 3: + return this.yb; + default: + throw new U6().e("" + a10); + } + }; + function rjb(a10, b10, c10, e10, f10) { + var g10 = a10.m.pe(); + a10 = a10.ad; + var h10 = Xs(); + h10 = lP(g10, c10, h10); + h10 instanceof z7 ? g10 = h10.i : (uha(g10, "SecurityScheme '" + c10 + "' not found", a10), g10 = new p7().Tq(c10, a10)); + c10 = kM(g10, c10, e10); + f10.ug(c10, b10); + O7(); + f10 = new P6().a(); + return Sd(c10, b10, f10); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.rk = function() { + null === this.kd && SP(this); + return this.kd; + }; + d7.z = function() { + return X5(this); + }; + d7.FH = function() { + var a10 = this.m.hp(this.Ca); + if (a10 instanceof ve4) + return rjb(this, this.la, a10.i, Od(O7(), this.Ca), this.yb); + if (a10 instanceof ye4) { + var b10 = a10.i; + a10 = this.yb.ug(gqa(iqa(), this.ad), this.la); + var c10 = qc(); + b10 = N6(b10, c10, this.m); + Zz(this.m, a10.j, b10, "securitySchema"); + c10 = new M6().W(b10); + var e10 = Xh().Hf; + Gg(c10, "type", nh(Hg(Ig(this, e10, this.m), a10))); + c10 = B6(a10.g, Xh().Hf).A; + c10 instanceof z7 && (c10 = c10.i, "oauth2" !== c10 && "basic" !== c10 && "apiKey" !== c10 || this.m.Ns( + sg().VM, + a10.j, + new z7().d(ic(Xh().Hf.r)), + "OAS 2.0 security scheme type detected in RAML 1.0 spec", + Ab(B6(a10.g, Xh().Hf).x, q5(jd)), + new z7().d(this.m.qh) + )); + c10 = ac(new M6().W(b10), "type"); + if (!c10.b() && (c10 = c10.c().i.hb().gb, e10 = Q5().nd, c10 === e10 && B6(a10.g, Xh().Hf).A.Ha(""))) { + c10 = this.m; + e10 = sg().hZ; + var f10 = a10.j, g10 = new z7().d(ic(Xh().Hf.r)); + ae4(); + var h10 = b10.da; + h10 = new z7().d(new be4().jj(ce4(0, de4(ee4(), h10.rf, h10.If, h10.Yf, h10.bg)))); + var k10 = new z7().d(this.m.qh); + c10.Gc(e10.j, f10, g10, "Security Scheme must have a mandatory value from 'OAuth 1.0', 'OAuth 2.0', 'Basic Authentication', 'Digest Authentication', 'Pass Through', x-'", h10, Yb().qb, k10); + } + Qib(a10); + c10 = new M6().W(b10); + e10 = Xh().Zc; + Gg(c10, "displayName", nh(Hg(Ig(this, e10, this.m), a10))); + c10 = new M6().W(b10); + e10 = Xh().Va; + Gg(c10, "description", nh(Hg(Ig(this, e10, this.m), a10))); + j4a(new S32(), "describedBy", b10, a10, this.m).hd(); + c10 = new M6().W(b10); + e10 = Xh().Oh; + Gg(c10, "settings", Gy(Hg(Ig(this, e10, this.m), a10), w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + rQa || (rQa = new dY().a()); + var t10 = l10.m, v10 = qc(); + p10 = N6(p10, v10, t10); + v10 = B6(m10.g, Xh().Hf).A; + return S5a(T5a(new r42(), p10, v10.b() ? null : v10.c(), m10, t10)); + }; + }(this, a10)))); + ii(); + c10 = [Zx().Qf]; + e10 = -1 + (c10.length | 0) | 0; + for (f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Ry( + new Sy(), + a10, + b10, + f10, + this.m + ).hd(); + return a10; + } + throw new x7().d(a10); + }; + d7.$classData = r8({ GPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlSecuritySchemeParser", { GPa: 1, f: 1, AQa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function l62() { + this.pP = this.p = this.Q = this.Dv = null; + } + l62.prototype = new u7(); + l62.prototype.constructor = l62; + d7 = l62.prototype; + d7.H = function() { + return "RamlSecuritySchemesEmitters"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l62) { + var b10 = this.Dv, c10 = a10.Dv; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 && this.p === a10.p ? this.pP === a10.pP : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Dv; + case 1: + return this.Q; + case 2: + return this.p; + case 3: + return this.pP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "securitySchemes"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.Dv, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return oy(t10.pP, v10, t10.Q, t10.p); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Dv.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ HPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlSecuritySchemesEmitters", { HPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xy() { + this.N = this.p = this.Ba = null; + } + Xy.prototype = new u7(); + Xy.prototype.constructor = Xy; + d7 = Xy.prototype; + d7.H = function() { + return "RamlSecuritySettingsEmitter"; + }; + d7.SG = function(a10, b10, c10) { + this.Ba = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Xy) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "settings"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + jr(wr(), this.p.zb(new X32().SG(this.Ba, this.p, this.N).Pa()), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ IPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlSecuritySettingsEmitter", { IPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function sjb() { + this.N = this.VV = this.p = this.Ba = null; + } + sjb.prototype = new u7(); + sjb.prototype.constructor = sjb; + d7 = sjb.prototype; + d7.H = function() { + return "RamlShapeDependenciesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof sjb) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.VV, a10 = a10.VV, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.VV; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = fh(new je4().e("dependencies")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.wb, k10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.p, A10 = p10.VV, D10 = new njb(); + D10.Yi = t10; + D10.p = v10; + D10.lg = A10; + return D10; + }; + }(this)), l10 = K7(); + h10 = h10.ka(k10, l10.u); + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + function tjb(a10, b10, c10, e10) { + var f10 = new sjb(); + f10.Ba = a10; + f10.p = b10; + f10.VV = c10; + f10.N = e10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ KPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlShapeDependenciesEmitter", { KPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function $y() { + this.N = this.Q = this.p = this.Ba = null; + } + $y.prototype = new u7(); + $y.prototype.constructor = $y; + function ujb(a10, b10, c10) { + if (b10 instanceof Vh && !Za(b10).na()) { + b10 = new vjb().WK(b10, a10.p, a10.Q, a10.N); + if (B6(b10.wa.aa, xn().Le).b() && B6(b10.wa.aa, qf().xd).Da()) + a10 = H10(); + else { + a10 = K7(); + var e10 = [new hjb().WK(b10.wa, b10.Mc, b10.gd, b10.je)]; + a10 = J5(a10, new Ib().ha(e10)); + } + e10 = new l4a(); + var f10 = yX.prototype.Pa.call(b10); + e10.yw = f10; + e10.Jo = a10; + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + m4a(e10, c10); + } else if (b10 && b10.$classData && b10.$classData.ge.Yy && (wh(b10.fa(), q5(cv)) || Za(b10).na())) + Za(b10).na() ? a10.N.rL(b10).Ob(c10) : (wr(), b10 = B6(b10.Y(), qf().R).A, lr(0, c10, b10.b() ? null : b10.c(), Q5().Na)); + else if (b10 instanceof vh) { + e10 = c10.s; + c10 = c10.ca; + f10 = new rr().e(c10); + var g10 = wr(), h10 = a10.p, k10 = a10.Q, l10 = H10(); + jr(g10, Q32(b10, h10, l10, k10, a10.N).zw(), f10); + pr(e10, mr(T6(), tr(ur(), f10.s, c10), Q5().sa)); + } else + c10 = a10.N.Bc, a10 = dc().Fh, e10 = b10.j, f10 = y7(), g10 = Ab(b10.fa(), q5(jd)), b10 = b10.Ib(), c10.Gc(a10.j, e10, f10, "Cannot emit for type shapes without WebAPI Shape support", g10, Yb().qb, b10); + } + d7 = $y.prototype; + d7.H = function() { + return "RamlShapeInheritsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $y) { + var b10 = this.Ba, c10 = a10.Ba; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JK = function(a10, b10, c10, e10) { + this.Ba = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.Qa = function(a10) { + var b10 = this.Ba.r.r.wb, c10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return p10; + }; + }(this)), e10 = K7(), f10 = b10.ka(c10, e10.u); + c10 = 1 < f10.jb(); + T6(); + e10 = mh(T6(), "type"); + b10 = new PA().e(a10.ca); + if (c10) { + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + f10.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + ujb(p10, v10, t10); + }; + }(this, h10))); + T6(); + eE(); + f10 = SA(zs(), g10); + f10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, f10); + } else + f10.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + ujb(p10, v10, t10); + }; + }(this, b10))); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + f10 = c10.w + h10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var k10 = h10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = h10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + h10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ MPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlShapeInheritsEmitter", { MPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function wjb() { + this.N = this.Q = this.p = this.tM = null; + } + wjb.prototype = new u7(); + wjb.prototype.constructor = wjb; + d7 = wjb.prototype; + d7.H = function() { + return "RamlTupleItemsShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wjb) { + var b10 = this.tM, c10 = a10.tM; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tM; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.waa = function(a10, b10, c10, e10) { + this.tM = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.Qa = function() { + var a10 = J5(Ef(), H10()), b10 = B6(this.tM.aa, an().$p); + b10 instanceof vh && B6(this.tM.aa, an().$p).U(w6(/* @__PURE__ */ function(c10, e10, f10) { + return function() { + var g10 = c10.p, h10 = c10.Q, k10 = H10(); + Q32(e10, g10, k10, h10, c10.N).zw().U(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return Dg(m10, p10); + }; + }(c10, f10))); + }; + }(this, b10, a10))); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + wr(); + var a10 = Ti(this.tM.aa, an().$p).x; + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ OPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTupleItemsShapeEmitter", { OPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function xjb() { + this.fl = this.wK = this.Wd = this.c_ = this.gY = null; + this.Jr = false; + this.ea = this.Iq = null; + } + xjb.prototype = new u7(); + xjb.prototype.constructor = xjb; + d7 = xjb.prototype; + d7.H = function() { + return "RamlTypeDetector"; + }; + function yjb(a10, b10) { + var c10 = ndb(a10), e10 = Fma(c10, b10).ua(); + var f10 = Vb(); + var g10 = false, h10 = false, k10 = null; + ii(); + for (var l10 = new Lf().a(), m10 = e10; !m10.b(); ) { + var p10 = m10.ga(); + "shape" !== p10 !== false && Dg(l10, p10); + m10 = m10.ta(); + } + l10 = l10.ua(); + a: { + if (H10().h(l10) && (g10 = true, Cg(e10, "shape"))) { + b10 = Ee4(); + break a; + } + if (g10 && !Cg(e10, "shape")) + b10 = c10.l.fl.gF; + else { + if (l10 instanceof Vt && (h10 = true, k10 = l10, c10 = k10.Wn, e10 = k10.Nf, H10().h(e10))) { + if ("nodeShape" === c10) + b10 = $e2(); + else if ("arrayShape" === c10) + b10 = Ze(); + else if ("stringScalarShape" === c10) + b10 = Ee4(); + else if ("numberScalarShape" === c10) + b10 = Fe(); + else { + if ("fileShape" !== c10) + throw new x7().d(c10); + b10 = cf(); + } + break a; + } + if (h10 && tc(k10.Nf) && ac(new M6().W(b10), "type").na()) + b10 = yx(); + else if (h10 && tc(k10.Nf)) + b10 = SHa(); + else + throw new x7().d(l10); + } + } + f10 = f10.Ia(b10); + return f10.b() ? new z7().d(a10.fl.gF) : f10; + } + d7.E = function() { + return 4; + }; + function ndb(a10) { + null === a10.c_ && null === a10.c_ && (a10.c_ = new gz().maa(a10)); + return a10.c_; + } + function z4a(a10, b10, c10, e10, f10) { + var g10 = new xjb(); + g10.Wd = a10; + g10.wK = b10; + g10.fl = c10; + g10.Jr = e10; + g10.Iq = f10; + g10.ea = nv().ea; + return g10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xjb) { + if (this.Wd === a10.Wd) { + var b10 = this.wK, c10 = a10.wK; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 && this.fl === a10.fl ? this.Jr === a10.Jr : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Wd; + case 1: + return this.wK; + case 2: + return this.fl; + case 3: + return this.Jr; + default: + throw new U6().e("" + a10); + } + }; + function zjb(a10) { + a10 = ac(new M6().W(a10), "properties"); + if (a10.b()) + return y7(); + a10.c(); + return new z7().d($e2()); + } + d7.t = function() { + return V5(W5(), this); + }; + function Ajb(a10) { + a10 = ac(new M6().W(a10), "fileTypes"); + if (a10.b()) + return y7(); + a10.c(); + return new z7().d(cf()); + } + function Bjb(a10) { + a10 = ac(new M6().W(a10), "items"); + if (a10 instanceof z7) + return new z7().d(Ze()); + if (y7() === a10) + return y7(); + throw new x7().d(a10); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Wd)); + a10 = OJ().Ga(a10, NJ(OJ(), this.wK)); + a10 = OJ().Ga(a10, NJ(OJ(), this.fl)); + a10 = OJ().Ga(a10, this.Jr ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + function y4a(a10, b10) { + var c10 = b10.hb().gb; + if (Q5().cd === c10) + return c10 = lc(), c10 = N6(b10, c10, a10.Iq), b10 = Ama(Cjb(a10), Djb(a10, c10), b10), b10.b() ? new z7().d($e2()) : b10; + if (Q5().sa === c10) { + c10 = qc(); + var e10 = N6(b10, c10, a10.Iq); + c10 = e10.sb.Cb(w6(/* @__PURE__ */ function(k10) { + return function(l10) { + l10 = l10.Aa; + var m10 = bc(); + l10 = N6(l10, m10, k10.Iq).va; + if (null === l10) + throw new sf().a(); + return !tf(uf(), ".*/.*", l10); + }; + }(a10))); + ur(); + var f10 = c10.kc(); + f10.b() ? f10 = y7() : (f10 = f10.c(), f10 = new z7().d(f10.da.Rf)); + f10 = tr(0, c10, f10.b() ? "" : f10.c()); + c10 = Ejb(a10, f10); + var g10 = Bjb(f10); + g10 = g10.b() ? Ajb(f10) : g10; + g10 = g10.b() ? zjb(f10) : g10; + f10 = g10.b() ? Fjb(f10) : g10; + g10 = false; + if (c10 instanceof z7) { + g10 = true; + var h10 = c10.i; + if (gla() === h10 && f10.na()) + return e10 = a10.Iq, f10 = sg().cJ, a10 = a10.Wd, g10 = new z7().d(ic(qf().xd.r)), b10 = b10.re().da, nM(e10, f10, a10, g10, "Inheritance from JSON Schema", b10), c10; + } + return g10 ? c10 : y7() === c10 && f10.na() ? f10 : yjb(a10, e10); + } + if (Q5().nd === c10) + return new z7().d(a10.fl.gF); + c10 = bc(); + e10 = N6(b10, c10, a10.Iq); + c10 = e10.va; + if (0 <= (c10.length | 0) && "<<" === c10.substring(0, 2) && Ed(ua(), c10, ">>")) { + e10 = a10.Iq.iv; + f10 = iA().ho; + if (null === e10 ? null === f10 : e10.h(f10)) + e10 = a10.Iq, f10 = sg().V5, a10 = a10.Wd, c10 = "Resource Type/Trait parameter " + c10 + " in type", g10 = y7(), ec(e10, f10, a10, g10, c10, b10.da); + return y7(); + } + if (!dla().qj(c10).b()) + return new z7().d(hla()); + if (!ela().qj(c10).b()) + return new z7().d(gla()); + f10 = fla().qj(c10); + if (!f10.b()) { + c10 = f10.c(); + e10 = w6(/* @__PURE__ */ function() { + return function(k10) { + return Rd(k10, "/"); + }; + }(a10)); + f10 = bc(); + f10 = new z7().d(N6(b10, f10, a10.Iq)); + c10 = $A(e10, 0, f10, true, a10.Iq).AP(c10); + c10.b() ? b10 = y7() : (c10 = c10.c(), b10 = Bma(ndb(a10), c10, b10, a10.Jr, a10.Iq)); + if (b10.b()) + return y7(); + b10 = b10.c(); + c10 = zx() === b10 ? true : Ze() === b10; + return new z7().d(c10 && !a10.Jr ? wca() : b10); + } + if (Ed(ua(), c10, "?")) + return new z7().d(UHa()); + if (null !== c10 && (f10 = ff(), Nh(), Nh(), c10 = Oh(Nh(), c10, "", f10, false), f10 = ff(), null !== c10 && c10 === f10)) { + c10 = false; + e10 = fB(a10.Iq.pe(), e10.va, Xs(), y7()); + if (e10 instanceof z7 && (c10 = true, f10 = e10.i, a10.Jr)) + return Bma(ndb(a10), f10, b10, a10.Jr, a10.Iq); + if (c10 && !a10.Jr) + return new z7().d($e2()); + if (y7() === e10) + return new z7().d(ff()); + throw new x7().d(e10); + } + b10 = e10.va; + if (a10.wK.na()) { + a10 = a10.wK; + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(Oh(Nh(), b10, a10, (Nh(), $e2()), (Nh(), false))); + } + return new z7().d(Oh(Nh(), b10, (Nh(), ""), (Nh(), $e2()), (Nh(), false))); + } + function Cjb(a10) { + null === a10.gY && null === a10.gY && (a10.gY = new fz().maa(a10)); + return a10.gY; + } + d7.uM = function(a10) { + var b10 = ac(new M6().W(a10), "type"); + a10 = ac(new M6().W(a10), "schema"); + if (!b10.b() && (b10.c(), !a10.b())) { + var c10 = a10.c(), e10 = this.Iq, f10 = sg().M5, g10 = this.Wd; + c10 = c10.Aa; + var h10 = y7(); + ec(e10, f10, g10, h10, "'schema' and 'type' properties are mutually exclusive", c10.da); + } + a10.b() || (c10 = a10.c(), e10 = this.Iq, f10 = sg().TZ, g10 = this.Wd, c10 = c10.Aa, h10 = y7(), nM(e10, f10, g10, h10, "'schema' keyword it's deprecated for 1.0 version, should use 'type' instead", c10.da)); + return b10.b() ? a10 : b10; + }; + function Djb(a10, b10) { + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.Wd, h10 = y7(), k10 = QP(); + return y4a(z4a(g10, h10, k10, true, e10.Iq), f10).ua(); + }; + }(a10)); + var c10 = K7(); + return b10.bd(a10, c10.u).ua(); + } + function Ejb(a10, b10) { + if (tc(b10.sb)) { + var c10 = a10.uM(b10); + if (c10.b()) + return y7(); + c10 = c10.c(); + var e10 = a10.Wd, f10 = ac(new M6().W(b10), "format"); + b10 = f10.b() ? ac(new M6().W(b10), fh(new je4().e("format"))) : f10; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.i.t())); + f10 = QP(); + a10 = y4a(z4a(e10, b10, f10, true, a10.Iq), c10.i); + e10 = false; + b10 = null; + if (a10 instanceof z7) { + e10 = true; + b10 = a10; + f10 = b10.i; + var g10 = ff(); + null !== f10 && f10 === g10 ? c10 = true : (g10 = yx(), c10 = null !== f10 && f10 === g10 ? "any" !== c10.i.t() : false); + if (c10) + return y7(); + } + if (e10) + return new z7().d(b10.i); + if (y7() === a10) + return a10; + throw new x7().d(a10); + } + return y7(); + } + function Fjb(a10) { + a10 = ac(new M6().W(a10), "anyOf"); + if (a10.b()) + return y7(); + a10.c(); + return new z7().d(zx()); + } + d7.$classData = r8({ RPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeDetector", { RPa: 1, f: 1, lr: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function cz() { + this.Qc = this.N = this.Q = this.p = this.pa = null; + } + cz.prototype = new u7(); + cz.prototype.constructor = cz; + d7 = cz.prototype; + d7.H = function() { + return "RamlXoneConstraintEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof cz) { + var b10 = this.pa, c10 = a10.pa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.DB = function(a10, b10, c10, e10) { + this.pa = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + a10 = B6(a10.Y(), qf().li); + b10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + return new yW().Cr(g10, f10.p, y7(), H10(), f10.Q, f10.N); + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = fh(new je4().e("xone")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10.Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La(); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u).ei(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.cf; + }; + }(this)), St()).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ tQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlXoneConstraintEmitter", { tQa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function djb() { + this.Bc = this.p = this.Pu = null; + } + djb.prototype = new u7(); + djb.prototype.constructor = djb; + d7 = djb.prototype; + d7.H = function() { + return "VariableEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof djb) { + var b10 = this.Pu, c10 = a10.Pu; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Pu; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = B6(this.Pu.g, gl().R).A; + b10 = b10.b() ? null : b10.c(); + var c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = Vb().Ia(B6(this.Pu.g, gl().vf)); + e10.b() ? (T6(), e10 = ur().ce, T6(), e10 = mr(T6(), e10, Q5().sa), pr(b10.s, e10)) : (e10 = e10.c(), iy(new jy(), e10, this.p, false, Rb(Ut(), H10()), this.Bc).Ob(b10)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Pu.x, q5(jd)); + }; + d7.$classData = r8({ JQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.VariableEmitter", { JQa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function my() { + this.N = this.p = this.Ba = this.la = null; + } + my.prototype = new u7(); + my.prototype.constructor = my; + d7 = my.prototype; + d7.H = function() { + return "XMLSerializerEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof my) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = this.Ba.r.r.Y(), f10 = J5(Ef(), H10()), g10 = hd(e10, rn().yF); + g10 = g10.b() || wh(g10.c().r.x, q5(b42)) ? g10 : y7(); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "attribute", g10, y7())))); + g10 = hd(e10, rn().NJ); + g10 = g10.b() || wh(g10.c().r.x, q5(b42)) ? g10 : y7(); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "wrapped", g10, y7())))); + g10 = hd(e10, rn().R); + g10 = g10.b() || wh(g10.c().r.x, q5(b42)) ? g10 : y7(); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "name", g10, y7())))); + g10 = hd(e10, rn().oN); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g( + new ah(), + "namespace", + g10, + y7() + )))); + e10 = hd(e10, rn().qN); + e10.b() || (e10 = e10.c(), new z7().d(Dg(f10, $g(new ah(), "prefix", e10, y7())))); + ws(f10, ay(this.Ba.r.r, this.p, this.N).Pa()); + e10 = b10.s; + g10 = b10.ca; + var h10 = new rr().e(g10); + jr(wr(), this.p.zb(f10), h10); + pr(e10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + f10 = b10.s; + c10 = [c10]; + if (0 > f10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + e10 = f10.w + g10 | 0; + uD(f10, e10); + Ba(f10.L, 0, f10.L, g10, f10.w); + g10 = f10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + f10.w = e10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.hE = function(a10, b10, c10, e10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ KQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.XMLSerializerEmitter", { KQa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function u72() { + this.Qc = this.yw = this.N = this.p = this.Kd = null; + } + u72.prototype = new u7(); + u72.prototype.constructor = u72; + d7 = u72.prototype; + d7.H = function() { + return "ExampleValuesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.Ob = function(a10) { + var b10 = this.Qc; + a: + if (b10 instanceof ve4) + b10.i.Ob(a10); + else { + if (b10 instanceof ye4 && (b10 = b10.i, b10.Da())) { + var c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + break a; + } + new c62().dq(this.Kd.x).Ob(a10); + } + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof u72) { + var b10 = this.Kd, c10 = a10.Kd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kd; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.bA = function(a10, b10, c10) { + this.Kd = a10; + this.p = b10; + this.N = c10; + var e10 = J5(Ef(), H10()), f10 = a10.g; + ii(); + for (var g10 = [ag().Fq, ag().Va, ag().Zc, Yd(ag())], h10 = -1 + (g10.length | 0) | 0, k10 = H10(); 0 <= h10; ) + k10 = ji(g10[h10], k10), h10 = -1 + h10 | 0; + h10 = k10; + ii(); + for (g10 = new Lf().a(); !h10.b(); ) { + k10 = h10.ga(); + var l10 = hd(f10, k10); + if (l10 instanceof z7) + l10 = !wh(l10.i.r.x, q5(IR)); + else { + if (y7() !== l10) + throw new x7().d(l10); + l10 = false; + } + false !== l10 && Dg(g10, k10); + h10 = h10.ta(); + } + g10 = g10.ua(); + a: { + for (h10 = Bg(f10); !h10.b(); ) { + k10 = h10.ga(); + if (Cg(g10, k10)) { + g10 = true; + break a; + } + h10 = h10.ta(); + } + g10 = false; + } + g10 ? g10 = true : (g10 = B6(a10.g, Zf().Rd).A, g10 = g10.b() ? false : -1 !== (g10.c().indexOf("value") | 0)); + g10 ? (g10 = hd( + f10, + ag().Zc + ), g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "displayName", g10, y7(), this.N))), g10 = hd(f10, ag().Va), g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "description", g10, y7(), this.N))), hd(f10, ag().Fq).na() && !wh(hd(f10, ag().Fq).c().r.x, q5(IR)) && (g10 = hd(f10, ag().Fq), g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "strict", g10, y7(), this.N)))), f10 = hd(f10, ag().mo), f10.b() ? (f10 = B6(this.Kd.g, Zf().Rd).A, f10.b() || (f10 = f10.c(), Dg(e10, new v72().e(f10)))) : (g10 = f10.c(), f10 = iy(new jy(), B6(this.Kd.g, ag().mo), this.p, false, Rb(Ut(), H10()), this.N.hj()), g10 = kr(wr(), g10.r.x, q5(jd)), h10 = Q5().Na, Dg(e10, ky("value", f10, h10, g10))), ws(e10, ay( + a10, + b10, + c10 + ).Pa())) : (b10 = hd(f10, ag().mo), b10.b() ? (b10 = B6(this.Kd.g, Zf().Rd).A, b10.b() || (b10 = b10.c(), Dg(e10, new v72().e(b10)))) : (b10.c(), Dg(e10, iy(new jy(), B6(this.Kd.g, ag().mo), this.p, false, Rb(Ut(), H10()), this.N.hj())))); + e10 = this.yw = e10; + a: { + K7(); + b10 = new z7().d(e10); + if (null !== b10.i && 0 === b10.i.Oe(1) && (b10 = b10.i.lb(0), zr(b10))) { + ue4(); + a10 = new ve4().d(b10); + break a; + } + e10.oh(w6(/* @__PURE__ */ function() { + return function(m10) { + return yr(m10); + }; + }(this))) ? (ue4(), a10 = new wdb(), c10 = K7(), a10 = e10.ec(a10, c10.u), a10 = new ye4().d(a10)) : (c10 = c10.hj(), b10 = dc().Fh, f10 = a10.j, g10 = y7(), e10 = "IllegalTypeDeclarations found: " + e10, h10 = Ab(a10.x, q5(jd)), a10 = yh(a10), c10.Gc( + b10.j, + f10, + g10, + e10, + h10, + Yb().qb, + a10 + ), ue4(), a10 = H10(), a10 = new ye4().d(a10)); + } + this.Qc = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Kd.x, q5(jd)); + }; + d7.$classData = r8({ PQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ExampleValuesEmitter", { PQa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Eg() { + this.N = this.Q = this.p = this.Oq = this.la = null; + } + Eg.prototype = new u7(); + Eg.prototype.constructor = Eg; + d7 = Eg.prototype; + d7.H = function() { + return "MultipleExampleEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Eg) { + if (this.la === a10.la) { + var b10 = this.Oq, c10 = a10.Oq; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Oq; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.Oq.Da()) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = this.Oq.ga(); + if (Za(e10).na()) { + if (e10 = this.Oq.ga(), e10 = Za(e10), !e10.b()) { + e10 = e10.c(); + var f10 = this.N.zf.eF(), g10 = this.Oq.ga(); + oy(f10, e10, B6(g10.Y(), db().ed).A, this.Q).Ob(b10); + } + } else { + e10 = this.Oq; + f10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return new E42().bA(t10, p10.p, p10.N); + }; + }(this)); + g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = b10.s; + g10 = b10.ca; + var h10 = new rr().e(g10); + jr(wr(), this.p.zb(e10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.jE = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Oq = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Oq.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ TQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.MultipleExampleEmitter", { TQa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function E42() { + this.N = this.p = this.Kd = null; + } + E42.prototype = new u7(); + E42.prototype.constructor = E42; + d7 = E42.prototype; + d7.H = function() { + return "NamedExampleEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof E42) { + var b10 = this.Kd, c10 = a10.Kd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kd; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = B6(this.Kd.g, ag().R).A; + b10 = b10.b() ? null : b10.c(); + var c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + new u72().bA(this.Kd, this.p, this.N).Ob(b10); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.bA = function(a10, b10, c10) { + this.Kd = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Kd.x, q5(jd)); + }; + d7.$classData = r8({ UQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.NamedExampleEmitter", { UQa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function n62() { + this.kd = this.X = this.m = this.lV = this.nA = this.we = this.ht = null; + } + n62.prototype = new u7(); + n62.prototype.constructor = n62; + function Gjb() { + } + Gjb.prototype = n62.prototype; + function Hjb(a10, b10) { + if ((Za(b10).na() ? Za(b10) : b10) instanceof Wh) { + var c10 = a10.m, e10 = sg().uZ; + b10 = b10.j; + a10 = a10.X; + var f10 = y7(); + ec(c10, e10, b10, f10, "File types in parameters must be declared in formData params", a10.da); + } + } + d7 = n62.prototype; + d7.H = function() { + return "Oas2ParameterParser"; + }; + d7.E = function() { + return 4; + }; + function Ijb(a10) { + pSa || (pSa = new EZ().a()); + var b10 = a10.ht.pk(); + b10 = b10.b() ? new Bz().ln(a10.ht).c() : b10.c(); + b10 = Od(O7(), b10); + b10 = new ym().K(new S6().a(), b10); + w7(a10, b10); + if (B6(b10.g, xm().R).A.b()) { + var c10 = cj().R, e10 = ih(new jh(), "default", new P6().a()), f10 = (O7(), new P6().a()).Lb(new L32().a()); + Rg(b10, c10, e10, f10); + } + c10 = ac(new M6().W(a10.X), "required"); + c10.b() || (c10 = c10.c(), e10 = c10.i, f10 = pM(), e10 = !!N6(e10, f10, a10.m), f10 = b10.x, ae4(), c10 = c10.da, f10.Lb(yYa(new G22(), e10, ce4(0, de4(ee4(), c10.rf, c10.If, c10.Yf, c10.bg))))); + Ry(new Sy(), b10, a10.X, H10(), a10.m).hd(); + return b10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n62) { + var b10 = this.ht, c10 = a10.ht; + (null === b10 ? null === c10 : b10.h(c10)) && this.we === a10.we ? (b10 = this.nA, c10 = a10.nA, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.lV === a10.lV : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ht; + case 1: + return this.we; + case 2: + return this.nA; + case 3: + return this.lV; + default: + throw new U6().e("" + a10); + } + }; + function Jjb(a10, b10) { + if (B6(b10.Y(), b10.Zg()).A.b()) { + var c10 = a10.lV.jt("parameter"), e10 = (O7(), new P6().a()).Lb(new Kz().a()); + Sd(b10, c10, e10); + } + b10.ub(a10.we, lt2()); + if (ac(new M6().W(a10.X), "name").b()) { + c10 = a10.m; + e10 = sg().R7; + b10 = b10.j; + a10 = a10.X; + var f10 = y7(); + ec(c10, e10, b10, f10, "'name' property is required in a parameter.", a10.da); + } + } + d7.t = function() { + return V5(W5(), this); + }; + function Kjb(a10, b10, c10) { + if ("body" === b10) { + Ez(); + c10.b() ? b10 = y7() : (b10 = c10.c(), ae4(), b10 = b10.da, b10 = new z7().d(ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg)))); + b10 = Ljb(a10, b10); + var e10 = a10.ht.pk(); + a10 = e10.b() ? new Bz().ln(a10.ht).pk() : e10; + return Sma(0, b10, a10); + } + if ("formData" === b10) + return Ez(), c10.b() ? y7() : (b10 = c10.c(), ae4(), b10 = b10.da, new z7().d(ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg)))), b10 = Mjb(a10), e10 = a10.ht.pk(), a10 = e10.b() ? new Bz().ln(a10.ht).pk() : e10, Sma(0, b10, a10); + if ("query" === b10 || "header" === b10 || "path" === b10) + return Ez(), b10 = Njb(a10), e10 = a10.ht.pk(), a10 = e10.b() ? new Bz().ln(a10.ht).pk() : e10, Dz(0, b10, a10); + e10 = Kjb; + var f10 = ac(new M6().W(a10.X), "schema"); + f10.b() ? f10 = y7() : (f10.c(), f10 = new z7().d("body")); + f10 = f10.b() ? "query" : f10.c(); + e10 = e10(a10, f10, y7()); + c10.b() ? f10 = y7() : (f10 = c10.c(), f10 = new z7().d(Od(O7(), f10.i))); + f10 = f10.b() ? (O7(), new P6().a()) : f10.c(); + var g10 = a10.m, h10 = sg().wZ, k10 = "Invalid parameter binding '" + b10 + "'"; + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.i)); + a10 = c10.b() ? a10.X : c10.c(); + c10 = y7(); + ec(g10, h10, "", c10, k10, a10.da); + a10 = e10.yr; + a10 instanceof Wl ? (c10 = cj().We, g10 = B6(a10.g, cj().We).A, g10 = ih(new jh(), g10.b() ? null : g10.c(), f10), b10 = f10.Lb(new P22().e(b10)), Rg(a10, c10, g10, b10)) : a10 instanceof ym && (b10 = new P22().e(b10), Cb(a10, b10)); + return e10; + } + d7.rk = function() { + null === this.kd && eGa(this); + return this.kd; + }; + function Ljb(a10, b10) { + var c10 = Ijb(a10); + Zz(a10.m, c10.j, a10.X, "bodyParameter"); + var e10 = new M6().W(a10.X), f10 = jx(new je4().e("mediaType")), g10 = xm().Nd; + Gg(e10, f10, Hg(Ig(a10, g10, a10.m), c10)); + e10 = B6(c10.g, xm().Nd); + !oN(e10) && Jjb(a10, c10); + e10 = ac(new M6().W(a10.X), "schema"); + e10.b() || (f10 = e10.c(), e10 = oX(pX(), f10, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w7(h10, l10); + var m10 = k10.j, p10 = lt2(); + l10.ub(m10, p10); + }; + }(a10, c10)), wz(uz(), a10.m)).Cc(), e10.b() || (e10 = e10.c(), Hjb(a10, e10), a10 = xm().Jc, g10 = HC(EC(), e10, c10.j, y7()), f10 = Od(O7(), f10), Rg(c10, a10, g10, f10), b10.b() || (b10 = b10.c(), e10.fa().Lb(new R22().jj(b10))), new z7().d(e10))); + return c10; + } + function Ojb(a10, b10, c10) { + var e10 = rA(); + T6(); + var f10 = b10.i, g10 = a10.m, h10 = Dd(); + f10 = N6(f10, h10, g10); + g10 = a10.m.Gg(); + h10 = Xq().Cp; + g10 === h10 ? e10 = oA(e10, f10, "parameters") : (f10 = new qg().e(f10), e10 = Wp(f10, e10.gca)); + f10 = gFa(a10.m.Dl(), e10, Xs()); + if (f10 instanceof z7) + return f10 = f10.i, a10 = Od(O7(), a10.X), a10 = kM(f10, e10, a10), O7(), f10 = new P6().a(), e10 = Sd(a10, e10, f10), J5(K7(), H10()), Ai(e10, c10), Dz(Ez(), a10, new z7().d(b10)); + if (y7() === f10) { + f10 = xFa(a10.m.Dl(), e10); + if (f10 instanceof z7) + return c10 = f10.i, Ez(), a10 = Od(O7(), a10.X), Sma(0, kM(c10, e10, a10), new z7().d(b10)); + if (y7() === f10) { + h10 = Pjb(a10.m, a10.m.qh, e10); + var k10 = a10.m; + f10 = wz(uz(), a10.m); + g10 = Qjb(h10); + h10 = Rjb(k10, h10); + h10.b() ? f10 = y7() : (h10 = h10.c(), k10 = wCa(), g10 = eYa(k10, h10, g10, f10), g10.b() ? f10 = y7() : (g10 = g10.c(), f10 = new z7().d(f10.$h.HV((ue4(), new ye4().d(g10)), c10, y7(), new Nd().a()).OL()))); + if (f10 instanceof z7) + return b10 = f10.i, e10 = b10.LL, e10.b() || (e10 = e10.c(), f10 = a10.nA, f10.b() ? a10 = y7() : (f10 = f10.c(), a10 = new z7().d(new Qg().Vb(f10, a10.m).Zf())), a10.b() || (a10 = a10.c(), f10 = cj().R, a10 = Vd(e10, f10, a10), J5(K7(), H10()), new z7().d(Ai(a10, c10)))), b10; + f10 = aqa(cqa(), b10); + w7(a10, f10); + J5(K7(), H10()); + Ai(f10, c10); + c10 = a10.m; + a10 = sg().kS; + g10 = f10.j; + e10 = "Cannot find parameter or payload reference " + e10; + h10 = y7(); + ec(c10, a10, g10, h10, e10, b10.da); + return Dz(Ez(), f10, new z7().d(b10)); + } + } + throw new x7().d(f10); + } + function w7(a10, b10) { + var c10 = false; + a: { + if (b10 instanceof rf && (c10 = true, a10.nA.na())) { + c10 = qf().R; + var e10 = a10.nA; + e10.b() ? a10 = y7() : (e10 = e10.c(), a10 = new z7().d(new Qg().Vb(e10, a10.m).Zf())); + a10 = a10.c(); + Vd(b10, c10, a10); + break a; + } + if (c10) + c10 = new M6().W(a10.X), e10 = qf().R, Gg(c10, "name", rP(Hg(Ig(a10, e10, a10.m), b10), new L32().a())); + else { + if (b10 instanceof ym) + if (a10.nA.na()) { + c10 = cj().R; + e10 = a10.nA; + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(new Qg().Vb(e10, a10.m).Zf())); + e10 = e10.c(); + var f10 = ac(new M6().W(a10.X), "name"); + if (f10.b()) + f10 = y7(); + else { + var g10 = f10.c(); + O7(); + f10 = ka(new Qg().Vb(g10.i, a10.m).Zf().r); + ae4(); + g10 = g10.da; + f10 = new C22().xU(f10, ce4( + 0, + de4(ee4(), g10.rf, g10.If, g10.Yf, g10.bg) + )); + f10 = new z7().d(new P6().a().Lb(f10)); + } + f10 = f10.b() ? (O7(), new P6().a()) : f10.c(); + Rg(b10, c10, e10, f10); + } else + c10 = new M6().W(a10.X), e10 = cj().R, Gg(c10, "name", Hg(Ig(a10, e10, a10.m), b10)); + else + a10.nA.na() ? (c10 = cj().R, e10 = a10.nA, e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(new Qg().Vb(e10, a10.m).Zf())), e10 = e10.c(), Vd(b10, c10, e10)) : (c10 = new M6().W(a10.X), e10 = cj().R, Gg(c10, "name", Hg(Ig(a10, e10, a10.m), b10))); + Jjb(a10, b10); + } + } + return b10; + } + d7.OL = function() { + var a10 = ac(new M6().W(this.X), "$ref"); + if (a10 instanceof z7) + return Ojb(this, a10.i, this.we); + if (y7() === a10) { + a10 = ac(new M6().W(this.X), "in"); + if (a10 instanceof z7 && (a10 = a10.i, null !== a10)) { + var b10 = a10.i, c10 = bc(); + b10 = N6(b10, c10, this.m).va; + return Kjb(this, b10, new z7().d(a10)); + } + a10 = aqa(cqa(), this.X); + w7(this, a10); + b10 = this.we; + J5(K7(), H10()); + Ai(a10, b10); + return Dz(Ez(), a10, new z7().d(this.X)); + } + throw new x7().d(a10); + }; + function Mjb(a10) { + var b10 = Ijb(a10); + Zz(a10.m, b10.j, a10.X, "parameter"); + var c10 = lX(new mX(), a10.ht, "schema", a10.X, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10 = w7(h10, l10); + var m10 = k10.j, p10 = lt2(); + l10.ub(m10, p10); + }; + }(a10, b10)), new hX().$G("parameter", a10.m), wz(uz(), a10.m)).Cc(); + if (c10.b()) + c10 = y7(); + else { + var e10 = c10.c(); + c10 = xm().Jc; + e10 = HC(EC(), e10, b10.j, y7()); + var f10 = Od(O7(), a10.X); + c10 = new z7().d(Rg(b10, c10, e10, f10)); + } + if (c10.b()) { + c10 = a10.m; + e10 = sg().kS; + f10 = b10.j; + a10 = a10.X; + var g10 = y7(); + ec(c10, e10, f10, g10, "Cannot find valid schema for parameter", a10.da); + } + b10.x.Lb(new y22().a()); + return b10; + } + d7.z = function() { + return X5(this); + }; + function Njb(a10) { + var b10 = Sjb(a10), c10 = lX(new mX(), a10.ht, "schema", a10.X, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + O7(); + var m10 = new P6().a(); + l10 = Sd(l10, "schema", m10); + m10 = k10.j; + var p10 = lt2(); + l10.ub(m10, p10); + }; + }(a10, b10)), new hX().$G("parameter", a10.m), wz(uz(), a10.m)).Cc(); + if (c10.b()) + c10 = y7(); + else { + c10 = c10.c(); + var e10 = cj().Jc, f10 = Od(O7(), a10.X); + c10 = new z7().d(Rg(b10, e10, c10, f10)); + } + if (c10.b()) { + c10 = a10.m; + e10 = sg().kS; + f10 = b10.j; + a10 = a10.X; + var g10 = y7(); + ec(c10, e10, f10, g10, "Cannot find valid schema for parameter", a10.da); + } + return b10; + } + d7.YO = function(a10, b10, c10, e10, f10) { + this.ht = a10; + this.we = b10; + this.nA = c10; + this.lV = e10; + this.m = f10; + if (a10 instanceof ve4) + a10 = a10.i.i, b10 = qc(), f10 = N6(a10, b10, f10); + else if (a10 instanceof ye4) + a10 = a10.i, b10 = qc(), f10 = N6(a10, b10, f10); + else + throw new x7().d(a10); + this.X = f10; + return this; + }; + function Sjb(a10) { + cqa(); + var b10 = a10.ht.pk(); + b10 = b10.b() ? new Bz().ln(a10.ht).c() : b10.c(); + b10 = aqa(0, b10); + w7(a10, b10); + var c10 = a10.we; + J5(K7(), H10()); + Ai(b10, c10); + c10 = cj().yj; + Bi(b10, c10, false); + c10 = new M6().W(a10.X); + var e10 = cj().gw; + Gg(c10, "name", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new M6().W(a10.X); + e10 = cj().We; + Gg(c10, "in", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new M6().W(a10.X); + e10 = cj().Va; + Gg(c10, "description", Hg(Ig(a10, e10, a10.m), b10)); + c10 = new M6().W(a10.X); + e10 = cj().yj; + e10 = Hg(Ig(a10, e10, a10.m), b10); + Gg(c10, "required", rP(e10, new xi().a())); + Zz(a10.m, b10.j, a10.X, "parameter"); + Ry(new Sy(), b10, a10.X, H10(), a10.m).hd(); + return b10; + } + d7.$classData = r8({ tha: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas2ParameterParser", { tha: 1, f: 1, DRa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Lhb() { + WP.call(this); + this.ds = this.ie = null; + } + Lhb.prototype = new dGa(); + Lhb.prototype.constructor = Lhb; + d7 = Lhb.prototype; + d7.H = function() { + return "Oas2ServersParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Lhb && Bj(this.ie, a10.ie)) { + var b10 = this.ds; + a10 = a10.ds; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ie; + case 1: + return this.ds; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Mb = function() { + return this.m; + }; + d7.hd = function() { + if (Tjb(this.ie)) { + var a10 = null; + a10 = ""; + var b10 = null; + b10 = ""; + O7(); + var c10 = new P6().a(), e10 = ac(new M6().W(this.ie), "basePath"); + if (!e10.b()) { + e10 = e10.c(); + ae4(); + b10 = e10.da; + b10 = ce4(0, de4(ee4(), b10.rf, b10.If, b10.Yf, b10.bg)); + c10.Lb(new L1().jj(b10)); + b10 = e10.i; + var f10 = Dd(); + f10 = b10 = N6(b10, f10, this.m); + if (!(0 <= (f10.length | 0) && "/" === f10.substring(0, 1))) { + f10 = this.m; + var g10 = sg().$5, h10 = this.ds.j; + e10 = e10.i; + var k10 = y7(); + ec(f10, g10, h10, k10, "'basePath' property must start with '/'", e10.da); + b10 = "/" + b10; + } + } + e10 = ac(new M6().W(this.ie), "host"); + e10.b() || (a10 = e10.c(), ae4(), e10 = a10.da, e10 = ce4(0, de4( + ee4(), + e10.rf, + e10.If, + e10.Yf, + e10.bg + )), c10.Lb(new Q1().jj(e10)), a10 = a10.i, e10 = Dd(), a10 = N6(a10, e10, this.m)); + O7(); + e10 = new P6().a(); + e10 = new Zl().K(new S6().a(), e10); + f10 = Yl().Pf; + b10 = ih(new jh(), "" + a10 + b10, new P6().a()); + c10 = Rg(e10, f10, b10, c10); + b10 = new M6().W(this.ie); + a10 = jx(new je4().e("serverDescription")); + e10 = Yl().Va; + Gg(b10, a10, Hg(Ig(this, e10, this.m), c10)); + b10 = new M6().W(this.ie); + a10 = jx(new je4().e("baseUriParameters")); + b10 = ac(b10, a10); + b10.b() || (b10 = b10.c(), a10 = b10.i, e10 = qc(), a10 = T32(new U32(), N6(a10, e10, this.m), w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = m10.j; + J5(K7(), H10()); + Ai(p10, t10); + }; + }(this, c10)), tz(uz(), this.m)).Vg(), e10 = w6(/* @__PURE__ */ function() { + return function(l10) { + var m10 = cj().We; + return eb(l10, m10, "path"); + }; + }(this)), f10 = K7(), e10 = a10.ka(e10, f10.u), a10 = Yl().Aj, e10 = Zr(new $r(), e10, Od(O7(), b10.i)), b10 = Od(O7(), b10), Rg(c10, a10, e10, b10)); + b10 = this.ds; + a10 = Qm().lh; + e10 = K7(); + f10 = new Xz().a(); + c10 = [Cb(c10, f10)]; + c10 = Zr(new $r(), J5(e10, new Ib().ha(c10)), (O7(), new P6().a())); + Vd(b10, a10, c10); + } + fGa(this, jx(new je4().e("servers"))); + }; + d7.z = function() { + return X5(this); + }; + function Tjb(a10) { + var b10 = ac(new M6().W(a10), "host"); + return (b10.b() ? ac(new M6().W(a10), "basePath") : b10).na(); + } + d7.$classData = r8({ XQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas2ServersParser", { XQa: 1, cSa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ujb() { + this.Qc = this.N = this.p = this.Kd = null; + } + Ujb.prototype = new u7(); + Ujb.prototype.constructor = Ujb; + d7 = Ujb.prototype; + d7.H = function() { + return "Oas3ExampleValuesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ujb) { + var b10 = this.Kd, c10 = a10.Kd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kd; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (Za(this.Kd).na()) { + var b10 = rA(), c10 = B6(this.Kd.g, db().ed).A; + c10 = qA(b10, c10.b() ? null : c10.c(), "examples"); + T6(); + b10 = this.TU(this.Kd); + var e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + T6(); + var k10 = mh(T6(), "$ref"); + T6(); + c10 = mh(T6(), c10); + sr(h10, k10, c10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } else { + T6(); + b10 = this.TU(this.Kd); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + f10 = b10.ca; + g10 = new rr().e(f10); + jr(wr(), this.p.zb(this.Qc), g10); + pr(c10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.bA = function(a10, b10, c10) { + this.Kd = a10; + this.p = b10; + this.N = c10; + var e10 = J5(Ef(), H10()), f10 = a10.g, g10 = hd(f10, ag().ck); + g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "summary", g10, y7(), this.N))); + g10 = hd(f10, ag().Va); + g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "description", g10, y7(), this.N))); + g10 = hd(f10, ag().DR); + g10.b() || (g10 = g10.c(), Dg(e10, Yg(Zg(), "externalValue", g10, y7(), this.N))); + f10 = hd(f10, ag().mo); + if (!f10.b()) { + g10 = f10.c(); + f10 = iy(new jy(), B6(this.Kd.g, ag().mo), this.p, false, Rb(Ut(), H10()), this.N.hj()); + g10 = kr(wr(), g10.r.x, q5(jd)); + var h10 = Q5().Na; + Dg(e10, ky("value", f10, h10, g10)); + } + ws(e10, ay(a10, b10, c10).Pa()); + this.Qc = e10; + return this; + }; + d7.TU = function(a10) { + a10 = B6(a10.g, ag().R).A; + return a10.b() ? "default" : a10.c(); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Kd.x, q5(jd)); + }; + d7.$classData = r8({ aRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ExampleValuesEmitter", { aRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function jeb() { + this.N = this.Q = this.p = this.cy = null; + } + jeb.prototype = new u7(); + jeb.prototype.constructor = jeb; + d7 = jeb.prototype; + d7.Jw = function(a10, b10, c10, e10) { + this.cy = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.H = function() { + return "Oas3LinkDeclarationEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof jeb) { + var b10 = this.cy, c10 = a10.cy; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cy; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "links"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + this.cy.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = RPa(TPa(), v10, p10.p, p10.Q, p10.N); + if (A10.Da()) { + T6(); + v10 = B6(v10.g, An().R).A; + v10 = v10.b() ? null : v10.c(); + var D10 = mh(T6(), v10); + v10 = new PA().e(t10.ca); + var C10 = v10.s, I10 = v10.ca, L10 = new rr().e(I10); + jr(wr(), p10.p.zb(A10), L10); + pr(C10, mr(T6(), tr(ur(), L10.s, I10), Q5().sa)); + A10 = v10.s; + D10 = [D10]; + if (0 > A10.w) + throw new U6().e("0"); + I10 = D10.length | 0; + C10 = A10.w + I10 | 0; + uD(A10, C10); + Ba(A10.L, 0, A10.L, I10, A10.w); + I10 = A10.L; + var Y10 = I10.n.length, ia = L10 = 0, pa = D10.length | 0; + Y10 = pa < Y10 ? pa : Y10; + pa = I10.n.length; + for (Y10 = Y10 < pa ? Y10 : pa; L10 < Y10; ) + I10.n[ia] = D10[L10], L10 = 1 + L10 | 0, ia = 1 + ia | 0; + A10.w = C10; + pr(t10.s, vD(wD(), v10.s)); + } + }; + }(this, g10))); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.cy.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ bRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3LinkDeclarationEmitter", { bRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function IX() { + this.Q = this.p = this.Ui = null; + } + IX.prototype = new u7(); + IX.prototype.constructor = IX; + d7 = IX.prototype; + d7.Jw = function(a10, b10, c10) { + this.Ui = a10; + this.p = b10; + this.Q = c10; + return this; + }; + d7.H = function() { + return "Oas3LinkParametersEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof IX) { + var b10 = this.Ui, c10 = a10.Ui; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ui; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Ui, c10 = w6(/* @__PURE__ */ function() { + return function(p10) { + var t10 = B6(p10.g, Gn().pD).A; + t10 = t10.b() ? null : t10.c(); + var v10 = B6(p10.g, Gn().jD).A; + v10 = v10.b() ? null : v10.c(); + p10 = kr(wr(), p10.x, q5(jd)); + var A10 = Q5().Na; + return cx(new dx(), t10, v10, A10, p10); + }; + }(this)), e10 = K7(); + c10 = b10.ka(c10, e10.u); + T6(); + e10 = mh(T6(), "parameters"); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(c10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + wr(); + var a10 = this.Ui.ga().x; + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ cRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3LinkParametersEmitter", { cRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vjb() { + VP.call(this); + this.gd = this.Mc = this.H0 = this.vV = null; + } + Vjb.prototype = new cGa(); + Vjb.prototype.constructor = Vjb; + d7 = Vjb.prototype; + d7.H = function() { + return "Oas3OperationServersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vjb) { + var b10 = this.vV, c10 = a10.vV; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.H0, c10 = a10.H0, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vV; + case 1: + return this.H0; + case 2: + return this.Mc; + case 3: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), H10()); + this.SN("servers", B6(this.vV.g, Pl().lh), a10); + return a10; + }; + d7.z = function() { + return X5(this); + }; + function Jhb(a10, b10, c10, e10, f10) { + var g10 = new Vjb(); + g10.vV = a10; + g10.H0 = b10; + g10.Mc = c10; + g10.gd = e10; + VP.prototype.EO.call(g10, a10, b10, c10, e10, f10); + return g10; + } + d7.$classData = r8({ fRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3OperationServersEmitter", { fRa: 1, $gb: 1, l7: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function e72() { + WP.call(this); + this.J0 = this.q0 = this.ie = null; + } + e72.prototype = new dGa(); + e72.prototype.constructor = e72; + d7 = e72.prototype; + d7.H = function() { + return "Oas3ServersParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof e72) { + if (Bj(this.ie, a10.ie)) { + var b10 = this.q0, c10 = a10.q0; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.J0, a10 = a10.J0, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ie; + case 1: + return this.q0; + case 2: + return this.J0; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Mb = function() { + return this.m; + }; + d7.hd = function() { + var a10 = this.m.Nl, b10 = rQ(); + null !== a10 && a10 === b10 && fGa(this, "servers"); + }; + d7.z = function() { + return X5(this); + }; + d7.ZG = function(a10, b10, c10, e10) { + this.ie = a10; + this.q0 = b10; + this.J0 = c10; + WP.prototype.ZG.call(this, a10, b10, c10, e10); + return this; + }; + d7.$classData = r8({ iRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ServersParser", { iRa: 1, cSa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wjb() { + this.N = this.Q = this.p = this.fu = null; + } + Wjb.prototype = new u7(); + Wjb.prototype.constructor = Wjb; + d7 = Wjb.prototype; + d7.Jw = function(a10, b10, c10, e10) { + this.fu = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.H = function() { + return "OasCallbackEmitter"; + }; + d7.Ob = function(a10) { + var b10 = this.fu.kc(); + b10.b() ? b10 = false : (b10 = b10.c(), b10 = Za(b10).na()); + if (b10) { + if (b10 = this.fu.ga(), b10 = Za(b10), !b10.b()) { + b10 = b10.c(); + var c10 = this.fu.ga(); + OO(b10, B6(c10.Y(), db().ed).A, this.Q, this.N).Ob(a10); + } + } else { + b10 = a10.s; + a10 = a10.ca; + c10 = new rr().e(a10); + var e10 = wr(), f10 = this.fu, g10 = w6(/* @__PURE__ */ function(k10) { + return function(l10) { + PGa || (PGa = new sQ().a()); + var m10 = PGa; + var p10 = B6(l10.g, am().YM); + l10 = B6(l10.g, am().Ky).A; + l10 = l10.b() ? null : l10.c(); + var t10 = k10.p, v10 = k10.Q, A10 = k10.N, D10 = Jl().Uf; + eb(p10, D10, l10); + return Xjb(new x72(), m10, p10, new z7().d(l10), t10, v10, A10); + }; + }(this)), h10 = K7(); + jr(e10, f10.ka(g10, h10.u), c10); + pr(b10, mr(T6(), tr( + ur(), + c10.s, + a10 + ), Q5().sa)); + } + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Wjb) { + var b10 = this.fu, c10 = a10.fu; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.fu; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + wr(); + var a10 = this.fu.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.x)); + a10 = a10.b() ? (O7(), new P6().a()) : a10.c(); + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ kRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasCallbackEmitter", { kRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ZX() { + this.N = this.x = this.Q = this.p = this.fu = null; + } + ZX.prototype = new u7(); + ZX.prototype.constructor = ZX; + d7 = ZX.prototype; + d7.H = function() { + return "OasCallbacksEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10), e10 = this.fu.am(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.g, am().R).A; + return h10.b() ? null : h10.c(); + }; + }(this))), f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(), m10 = k10.ya(); + k10 = new Wjb().Jw(m10, h10.p, h10.Q, h10.N); + var p10 = Q5().Na; + wr(); + m10 = m10.kc(); + m10.b() ? m10 = y7() : (m10 = m10.c(), m10 = new z7().d(m10.x)); + m10 = m10.b() ? (O7(), new P6().a()) : m10.c(); + return ky(l10, k10, p10, kr(0, m10, q5(jd))); + } + throw new x7().d(k10); + }; + }(this)), g10 = Id().u; + e10 = Jd(e10, f10, g10).ke(); + jr(wr(), this.p.zb(e10), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 4; + }; + d7.kE = function(a10, b10, c10, e10, f10) { + this.fu = a10; + this.p = b10; + this.Q = c10; + this.x = e10; + this.N = f10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ZX) { + var b10 = this.fu, c10 = a10.fu; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.x === a10.x : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.fu; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ lRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasCallbacksEmitter", { lRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function hY() { + this.N = this.x = this.Q = this.p = this.ip = null; + } + hY.prototype = new u7(); + hY.prototype.constructor = hY; + d7 = hY.prototype; + d7.H = function() { + return "OasContentPayloadsEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10), e10 = this.ip, f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = B6(k10.g, xm().Nd).A; + l10 = l10.b() ? null : l10.c(); + var m10 = new y72().pU(k10, h10.p, h10.Q, h10.N), p10 = Q5().Na; + wr(); + return ky(l10, m10, p10, kr(0, k10.x, q5(jd))); + }; + }(this)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + jr(wr(), this.p.zb(e10), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 4; + }; + d7.kE = function(a10, b10, c10, e10, f10) { + this.ip = a10; + this.p = b10; + this.Q = c10; + this.x = e10; + this.N = f10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof hY) { + var b10 = this.ip, c10 = a10.ip; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.x === a10.x : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ip; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ nRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasContentPayloadsEmitter", { nRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function heb() { + this.N = this.Q = this.p = this.zh = null; + } + heb.prototype = new u7(); + heb.prototype.constructor = heb; + d7 = heb.prototype; + d7.Jw = function(a10, b10, c10, e10) { + this.zh = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.H = function() { + return "OasDeclaredHeadersEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof heb) { + var b10 = this.zh, c10 = a10.zh; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zh; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "headers"), c10 = new PA().e(a10.ca), e10 = this.zh, f10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return IEa(t10, p10.p, p10.Q, p10.N); + }; + }(this)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + f10 = c10.s; + g10 = c10.ca; + var h10 = new rr().e(g10); + jr(wr(), this.p.zb(e10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = b10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = b10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.zh.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ pRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasDeclaredHeadersEmitter", { pRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Yjb() { + this.N = this.Q = this.p = this.kK = null; + } + Yjb.prototype = new u7(); + Yjb.prototype.constructor = Yjb; + d7 = Yjb.prototype; + d7.H = function() { + return "OasEncodingEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Yjb) { + var b10 = this.kK, c10 = a10.kK; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.kK; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.kK.g; + T6(); + var c10 = B6(this.kK.g, dm().lD).A; + c10 = c10.b() ? null : c10.c(); + var e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, dm().yl); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "contentType", l10, y7())))); + l10 = hd(b10, dm().Tf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, new eX().Sq("headers", l10, this.p, this.Q, this.N)))); + l10 = hd(b10, dm().Yt); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "style", l10, y7())))); + l10 = hd(b10, dm().Vu); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "explode", l10, y7())))); + b10 = hd( + b10, + dm().Su + ); + b10.b() || (b10 = b10.c(), new z7().d(Dg(k10, $g(new ah(), "allowReserved", b10, y7())))); + jr(wr(), this.p.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.kK.x, q5(jd)); + }; + d7.$classData = r8({ qRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasEncodingEmitter", { qRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zjb() { + this.N = this.Q = this.p = this.Ba = this.la = null; + } + Zjb.prototype = new u7(); + Zjb.prototype.constructor = Zjb; + function $jb(a10, b10, c10, e10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = f10.N, m10 = new Yjb(); + m10.kK = k10; + m10.p = g10; + m10.Q = h10; + m10.N = l10; + return m10; + }; + }(a10, c10, e10)); + e10 = K7(); + b10 = b10.ka(a10, e10.u); + return c10.zb(b10); + } + d7 = Zjb.prototype; + d7.H = function() { + return "OasEncodingsEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Zjb) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = $jb(this, this.Ba, this.p, this.Q); + T6(); + var c10 = this.la, e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10); + jr(wr(), b10, h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.Sq = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ sRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasEncodingsEmitter", { sRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function akb() { + this.N = this.Q = this.p = this.Wi = null; + } + akb.prototype = new u7(); + akb.prototype.constructor = akb; + d7 = akb.prototype; + d7.H = function() { + return "OasHeaderEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof akb) { + var b10 = this.Wi, c10 = a10.Wi; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Wi; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.iK = function(a10, b10) { + a10 = hd(a10, cj().R).c(); + hV(new iV(), a10.r.r, Q5().Na).Ob(b10); + }; + d7.Qa = function(a10) { + !Za(this.Wi).na() || this.N.zf instanceof pA ? this.s0(a10) : this.$9(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.s0 = function(a10) { + T6(); + var b10 = B6(this.Wi.g, cj().R).A.c(), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + if (this.N.zf instanceof pA) + m5a(this.Wi, this.p, this.Q, true, this.N).Ob(b10); + else { + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = J5(Ef(), H10()), k10 = this.Wi.g; + if (Vb().Ia(B6(this.Wi.g, cj().Jc)).na()) { + var l10 = Vb(), m10 = B6(this.Wi.g, cj().Jc); + l10 = l10.Ia(B6(m10.Y(), qf().Va)).b(); + } else + l10 = false; + l10 && (l10 = hd(k10, cj().Va), l10.b() || (l10 = l10.c(), new z7().d(Dg(h10, Yg(Zg(), "description", l10, y7(), this.N))))); + l10 = hd(k10, cj().yj); + l10 = l10.b() || wh(l10.c().r.x, q5(b42)) ? l10 : y7(); + l10.b() || (l10 = l10.c(), new z7().d(Dg( + h10, + Yg(Zg(), "x-amf-required", l10, y7(), this.N) + ))); + k10 = hd(k10, cj().Jc); + if (!k10.b()) { + k10.c(); + k10 = B6(this.Wi.g, cj().Jc); + l10 = this.p; + m10 = this.Q; + var p10 = H10(), t10 = H10(), v10 = H10(); + new z7().d(ws(h10, Vy(k10, l10, p10, m10, t10, v10, true, this.N).zw())); + } + jr(wr(), this.p.zb(h10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + } + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.La = function() { + return kr(wr(), this.Wi.x, q5(jd)); + }; + function IEa(a10, b10, c10, e10) { + var f10 = new akb(); + f10.Wi = a10; + f10.p = b10; + f10.Q = c10; + f10.N = e10; + return f10; + } + d7.$9 = function(a10) { + var b10 = Za(this.Wi).c().Y(), c10 = new PA().e(a10.ca); + this.iK(b10, c10); + b10 = new PA().e(a10.ca); + var e10 = Za(this.Wi); + e10.b() || (e10 = e10.c(), oy(this.N.zf.eF(), e10, B6(this.Wi.g, db().ed).A, this.Q).Ob(b10)); + c10 = xF(c10.s, 0); + sr(a10, c10, xF(b10.s, 0)); + }; + d7.$classData = r8({ uRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasHeaderEmitter", { uRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function bkb() { + this.N = this.Q = this.p = this.tE = null; + } + bkb.prototype = new u7(); + bkb.prototype.constructor = bkb; + d7 = bkb.prototype; + d7.H = function() { + return "OasLinkEmitter"; + }; + d7.Ob = function(a10) { + if (Za(this.tE).na()) { + var b10 = Za(this.tE); + b10.b() || (b10 = b10.c(), OO(b10, B6(this.tE.g, db().ed).A, this.Q, this.N).Ob(a10)); + } else { + b10 = RPa(TPa(), this.tE, this.p, this.Q, this.N); + var c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bkb) { + var b10 = this.tE, c10 = a10.tE; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.tE; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.tE.x, q5(jd)); + }; + d7.$classData = r8({ xRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasLinkEmitter", { xRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ckb() { + this.N = this.x = this.Q = this.p = this.cy = null; + } + ckb.prototype = new u7(); + ckb.prototype.constructor = ckb; + d7 = ckb.prototype; + d7.H = function() { + return "OasLinksEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10), e10 = this.cy, f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = B6(k10.g, An().R).A; + l10 = l10.b() ? null : l10.c(); + var m10 = h10.p, p10 = h10.Q, t10 = h10.N, v10 = new bkb(); + v10.tE = k10; + v10.p = m10; + v10.Q = p10; + v10.N = t10; + m10 = Q5().Na; + wr(); + return ky(l10, v10, m10, kr(0, k10.x, q5(jd))); + }; + }(this)), g10 = K7(); + e10 = e10.ka(f10, g10.u); + jr(wr(), this.p.zb(e10), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 4; + }; + d7.kE = function(a10, b10, c10, e10, f10) { + this.cy = a10; + this.p = b10; + this.Q = c10; + this.x = e10; + this.N = f10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ckb) { + var b10 = this.cy, c10 = a10.cy; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.x === a10.x : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.cy; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.x, q5(jd)); + }; + d7.$classData = r8({ ARa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasLinksEmitter", { ARa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function dkb() { + this.l = this.Q = this.zu = null; + } + dkb.prototype = new u7(); + dkb.prototype.constructor = dkb; + function i5a(a10, b10, c10) { + var e10 = new dkb(); + e10.zu = b10; + e10.Q = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7 = dkb.prototype; + d7.H = function() { + return "OasParameterEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof dkb && a10.l === this.l) { + var b10 = this.zu, c10 = a10.zu; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zu; + case 1: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.zu.Da() || this.l.ip.Da()) { + T6(); + var b10 = this.l.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10); + vr(wr(), l5a(this.l, this.zu, this.l.p, this.Q), g10); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.zu.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? (a10 = this.l.ip.kc(), a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))), a10.b() ? ld() : a10.c()) : a10.c(); + }; + d7.$classData = r8({ FRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParametersEmitter$OasParameterEmitter", { FRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function o42() { + this.l = this.UL = this.la = null; + } + o42.prototype = new u7(); + o42.prototype.constructor = o42; + d7 = o42.prototype; + d7.H = function() { + return "XRamlParameterEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o42 && a10.l === this.l && this.la === a10.la) { + var b10 = this.UL; + a10 = a10.UL; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.UL; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.UL.Da()) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.UL, l10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + return new zW().j1(t10, p10.l.p, H10(), new H22().Ti(p10.l.N.hj(), KO(), new Yf().a())); + }; + }(this)), m10 = K7(); + jr(h10, k10.ka(l10, m10.u), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + function k5a(a10, b10, c10, e10) { + a10.la = c10; + a10.UL = e10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.UL.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ GRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasParametersEmitter$XRamlParameterEmitter", { GRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function y72() { + this.N = this.Q = this.p = this.le = null; + } + y72.prototype = new u7(); + y72.prototype.constructor = y72; + d7 = y72.prototype; + d7.H = function() { + return "OasPayloadEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10), e10 = this.le.g, f10 = J5(Ef(), H10()); + if (this.N.zf instanceof pA) { + var g10 = hd(e10, xm().Ec); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $Pa(cQa(), "examples", g10, this.p, this.N)))); + g10 = hd(e10, xm().XI); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, new Zjb().Sq("encoding", g10, this.p, this.Q, this.N)))); + } + if (this.N.zf instanceof ZV) { + g10 = hd(e10, xm().R); + if (!g10.b()) { + g10 = g10.c(); + var h10 = Ab(g10.r.x, q5(u5a)); + if (h10 instanceof z7) { + h10 = h10.i; + g10 = h10.KL; + h10 = h10.yc.$d; + var k10 = Q5().Na; + g10 = Dg(f10, cx(new dx(), "name", g10, k10, h10)); + } else + g10 = Dg(f10, $g( + new ah(), + "name", + g10, + y7() + )); + new z7().d(g10); + } + g10 = hd(e10, xm().Nd); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "mediaType", g10, y7())))); + } + e10 = hd(e10, xm().Jc); + e10.b() || (e10 = e10.c(), new z7().d(wh(e10.r.r.fa(), q5(IR)) ? void 0 : Dg(f10, new d62().Zz(e10, this.p, this.Q, this.N)))); + ws(f10, ay(this.le, this.p, this.N).Pa()); + jr(wr(), this.p.zb(f10), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof y72) { + var b10 = this.le, c10 = a10.le; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.le; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.pU = function(a10, b10, c10, e10) { + this.le = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.le.x, q5(jd)); + }; + d7.$classData = r8({ JRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasPayloadEmitter", { JRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function z72() { + this.N = this.Q = this.p = this.ip = this.la = null; + } + z72.prototype = new u7(); + z72.prototype.constructor = z72; + d7 = z72.prototype; + d7.H = function() { + return "OasPayloadsEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof z72) { + if (this.la === a10.la) { + var b10 = this.ip, c10 = a10.ip; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.ip; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10), h10 = wr(), k10 = this.p, l10 = this.ip, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new y72().pU(v10, t10.p, t10.Q, t10.N); + }; + }(this)), p10 = K7(); + vr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + l10 = f10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = f10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + f10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.VO = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.ip = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return this.ip.Cb(w6(/* @__PURE__ */ function() { + return function(a10) { + a10 = Ab(a10.x, q5(jd)); + return a10.b() ? false : !a10.c().yc.$d.Yx(); + }; + }(this))).ne(ld(), Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + b10 = Ab(b10.x, q5(jd)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.yc.$d)); + if (b10.b()) + var c10 = true; + else + c10 = b10.c(), c10 = a10.Yx() || 0 > a10.ID(c10); + b10 = c10 ? b10 : y7(); + return b10.b() ? a10 : b10.c(); + }; + }(this))); + }; + d7.$classData = r8({ NRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasPayloadsEmitter", { NRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ekb() { + this.N = this.Q = this.p = this.lp = null; + } + ekb.prototype = new u7(); + ekb.prototype.constructor = ekb; + d7 = ekb.prototype; + d7.H = function() { + return "OasResponseEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ekb) { + var b10 = this.lp, c10 = a10.lp; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lp; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.lp.g, c10 = new PA().e(a10.ca), e10 = hd(b10, Dm().R); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.r.r)); + hV(new iV(), e10.b() ? ih(new jh(), "default", new P6().a()) : e10.c(), Q5().Na).Ob(c10); + e10 = new PA().e(a10.ca); + if (Za(this.lp).na()) + this.N.rL(this.lp).Ob(e10); + else { + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, Dm().Va); + if (l10.b()) { + l10 = Dm().Va; + var m10 = ih(new jh(), "", new P6().a()); + O7(); + var p10 = new P6().a(); + l10 = new z7().d(lh(l10, kh(m10, p10))); + } + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "description", l10, y7())))); + l10 = hd(b10, Am().Tf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, new eX().Sq("headers", l10, this.p, this.Q, this.N)))); + this.N.zf instanceof pA && (l10 = this.lp.g.vb, m10 = mz(), m10 = Ua(m10), p10 = Id().u, l10 = Jd(l10, m10, p10).Fb(w6(/* @__PURE__ */ function() { + return function(t10) { + t10 = t10.Lc; + var v10 = Dm().Ne; + return null === t10 ? null === v10 : t10.h(v10); + }; + }(this))), l10.b() || (l10 = l10.c(), m10 = YX(l10), Dg(k10, ky("content", new hY().kE(m10, this.p, this.Q, l10.r.x, this.N), Q5().Na, ld()))), l10 = this.lp.g.vb, m10 = mz(), m10 = Ua(m10), p10 = Id().u, l10 = Jd(l10, m10, p10).Fb(w6(/* @__PURE__ */ function() { + return function(t10) { + t10 = t10.Lc; + var v10 = Dm().nN; + return null === t10 ? null === v10 : t10.h(v10); + }; + }(this))), l10.b() || (l10 = l10.c(), m10 = YX(l10), Dg(k10, ky("links", new ckb().kE(m10, this.p, this.Q, l10.r.x, this.N), Q5().Na, ld())))); + this.N.zf instanceof ZV && (l10 = VPa(YPa(), B6(this.lp.g, zD().Ne)), m10 = l10.uo, m10.b() || (m10 = m10.c(), p10 = hd(m10.g, xm().Nd), p10.b() || (p10 = p10.c(), new z7().d(Dg(k10, $g(new ah(), jx(new je4().e("mediaType")), p10, y7())))), m10 = hd(m10.g, xm().Jc), m10.b() || (m10 = m10.c(), new z7().d(wh(m10.r.r.fa(), q5(IR)) ? void 0 : Dg(k10, new d62().Zz(m10, this.p, this.Q, this.N))))), l10.yH.Da() && Dg(k10, new z72().VO(jx(new je4().e("responsePayloads")), l10.yH, this.p, this.Q, this.N))); + b10 = hd(b10, Dm().Ec); + b10.b() || (b10 = b10.c(), new z7().d(Dg(k10, $Pa(cQa(), "examples", b10, this.p, this.N)))); + ws(k10, ay(this.lp, this.p, this.N).Pa()); + jr(wr(), this.p.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } + c10 = xF(c10.s, 0); + sr(a10, c10, xF(e10.s, 0)); + }; + d7.z = function() { + return X5(this); + }; + function fkb(a10, b10, c10, e10) { + var f10 = new ekb(); + f10.lp = a10; + f10.p = b10; + f10.Q = c10; + f10.N = e10; + return f10; + } + d7.La = function() { + return kr(wr(), this.lp.x, q5(jd)); + }; + d7.$classData = r8({ ORa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseEmitter", { ORa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function gkb() { + this.N = this.p = this.Kd = null; + } + gkb.prototype = new u7(); + gkb.prototype.constructor = gkb; + d7 = gkb.prototype; + d7.H = function() { + return "OasResponseExampleEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gkb) { + var b10 = this.Kd, c10 = a10.Kd; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kd; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = hd(this.Kd.g, ag().mo); + if (b10.b()) { + if (b10 = B6(this.Kd.g, Zf().Rd).A, !b10.b()) { + var c10 = b10.c(); + T6(); + b10 = this.TU(this.Kd); + var e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + new v72().e(c10).Ob(b10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + var f10 = e10.length | 0, g10 = c10.w + f10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + } else { + b10.c(); + T6(); + b10 = this.TU(this.Kd); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + iy(new jy(), B6( + this.Kd.g, + ag().mo + ), this.p, false, Rb(Ut(), H10()), this.N.hj()).Ob(b10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + f10 = e10.length | 0; + g10 = c10.w + f10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, f10, c10.w); + f10 = c10.L; + h10 = f10.n.length; + l10 = k10 = 0; + m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.bA = function(a10, b10, c10) { + this.Kd = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.TU = function(a10) { + if (this.N.zf instanceof pA) + return a10 = B6(a10.g, ag().R).A, a10.b() ? null : a10.c(); + a10 = B6(a10.g, ag().Nd).A; + return a10.b() ? null : a10.c(); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Kd.x, q5(jd)); + }; + d7.$classData = r8({ PRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExampleEmitter", { PRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function NX() { + this.N = this.p = this.Oq = this.la = null; + } + NX.prototype = new u7(); + NX.prototype.constructor = NX; + d7 = NX.prototype; + d7.H = function() { + return "OasResponseExamplesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.eA = function(a10, b10, c10, e10) { + this.la = a10; + this.Oq = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NX) { + if (this.la === a10.la) { + var b10 = this.Oq, c10 = a10.Oq; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Oq; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.Oq.Da()) + if (this.N.zf instanceof pA) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.Oq, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new Ujb().bA(v10, t10.p, t10.N); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } else { + T6(); + b10 = this.la; + c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + e10 = b10.s; + f10 = b10.ca; + g10 = new rr().e(f10); + h10 = wr(); + k10 = this.p; + l10 = this.Oq; + m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new gkb().bA(v10, t10.p, t10.N); + }; + }(this)); + p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD( + wD(), + b10.s + )); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Oq.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ RRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasResponseExamplesEmitter", { RRa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function JX() { + this.N = this.p = this.XH = null; + } + JX.prototype = new u7(); + JX.prototype.constructor = JX; + d7 = JX.prototype; + d7.H = function() { + return "OasServerEmitter"; + }; + d7.Ob = function(a10) { + var b10 = J5(Ef(), H10()), c10 = this.XH.g, e10 = hd(c10, Yl().Pf); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "url", e10, y7())))); + e10 = hd(c10, Yl().Va); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "description", e10, y7())))); + c10 = hd(c10, Yl().Aj); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new hkb().SG(c10, this.p, this.N)))); + ws(b10, ay(this.XH, this.p, this.N).Pa()); + c10 = a10.s; + a10 = a10.ca; + e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof JX) { + var b10 = this.XH, c10 = a10.XH; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.XH; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.XH.x, q5(jd)); + }; + d7.$classData = r8({ ZRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasServerEmitter", { ZRa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ikb() { + this.N = this.p = this.Pu = null; + } + ikb.prototype = new u7(); + ikb.prototype.constructor = ikb; + d7 = ikb.prototype; + d7.H = function() { + return "OasServerVariableEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ikb) { + var b10 = this.Pu, c10 = a10.Pu; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Pu; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = B6(this.Pu.g, cj().R).A; + b10 = b10.b() ? null : b10.c(); + var c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.Pu, l10 = J5(Ef(), H10()); + k10 = B6(k10.g, cj().Jc); + var m10 = k10.Y(), p10 = hd(m10, qf().Va); + p10.b() || (p10 = p10.c(), new z7().d(Dg(l10, $g(new ah(), "description", p10, y7())))); + p10 = hd(m10, qf().ch); + p10.b() || (p10 = p10.c(), new z7().d(Dg(l10, cma(p10.r, this.p, this.N)))); + m10 = hd(m10, qf().Mh); + if (m10 instanceof z7) + m10 = m10.i, k10 = iy(new jy(), B6(k10.Y(), qf().Mh), this.p, false, Rb(Ut(), H10()), this.N.hj()), m10 = kr(wr(), m10.r.x, q5(jd)), p10 = Q5().Na, Dg(l10, ky( + "default", + k10, + p10, + m10 + )); + else if (y7() === m10) + Dg(l10, cx(new dx(), "default", "", Q5().Na, ld())); + else + throw new x7().d(m10); + jr(h10, l10, g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + k10 = g10.n.length; + l10 = h10 = 0; + m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Pu.x, q5(jd)); + }; + d7.$classData = r8({ aSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasServerVariableEmitter", { aSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function hkb() { + this.N = this.p = this.Ba = null; + } + hkb.prototype = new u7(); + hkb.prototype.constructor = hkb; + d7 = hkb.prototype; + d7.H = function() { + return "OasServerVariablesEmitter"; + }; + d7.SG = function(a10, b10, c10) { + this.Ba = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof hkb) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = YX(this.Ba), c10 = b10.Od(w6(/* @__PURE__ */ function() { + return function(t10) { + return !vQa(yQa(), t10); + }; + }(this))); + T6(); + var e10 = mh(T6(), "variables"), f10 = new PA().e(a10.ca), g10 = f10.s, h10 = f10.ca, k10 = new rr().e(h10); + jr(wr(), jkb(this, b10), k10); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + b10 = f10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + g10 = b10.w + h10 | 0; + uD(b10, g10); + Ba(b10.L, 0, b10.L, h10, b10.w); + h10 = b10.L; + var l10 = h10.n.length, m10 = k10 = 0, p10 = e10.length | 0; + l10 = p10 < l10 ? p10 : l10; + p10 = h10.n.length; + for (l10 = l10 < p10 ? l10 : p10; k10 < l10; ) + h10.n[m10] = e10[k10], k10 = 1 + k10 | 0, m10 = 1 + m10 | 0; + b10.w = g10; + pr(a10.s, vD(wD(), f10.s)); + c10 && (c10 = jx(new je4().e("parameters")), f10 = this.Ba, b10 = this.p, e10 = J5(K7(), H10()), g10 = this.N, new eX().Sq(c10, f10, b10, e10, new JW().Ti(g10.hj(), g10.oy, new Yf().a())).Qa(a10)); + }; + function jkb(a10, b10) { + var c10 = a10.p; + a10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = f10.p, k10 = f10.N, l10 = new ikb(); + l10.Pu = g10; + l10.p = h10; + l10.N = k10; + return l10; + }; + }(a10)); + var e10 = K7(); + return c10.zb(b10.ka(a10, e10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.r.fa(), q5(jd)); + }; + d7.$classData = r8({ bSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasServerVariablesEmitter", { bSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function kkb() { + this.Q = this.p = this.Wi = null; + this.iG = false; + this.N = null; + } + kkb.prototype = new u7(); + kkb.prototype.constructor = kkb; + d7 = kkb.prototype; + d7.H = function() { + return "ParameterEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.Ob = function(a10) { + if (Za(this.Wi).na()) { + var b10 = this.N; + if (this.iG) { + var c10 = rA(), e10 = B6(this.Wi.g, db().ed).A; + c10 = qA(c10, e10.b() ? null : e10.c(), "headers"); + } else + c10 = rA(), e10 = B6(this.Wi.g, db().ed).A, c10 = Ena(c10, e10.b() ? null : e10.c(), this.N); + ex(b10, a10, c10); + } else { + b10 = J5(Ef(), H10()); + c10 = this.Wi.g; + this.iG || (e10 = hd(c10, cj().gw), e10 = e10.b() ? hd(c10, cj().R) : e10, e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "name", e10, y7()))))); + e10 = hd(c10, cj().Va); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "description", e10, y7())))); + e10 = hd(c10, cj().yj); + if (e10.b()) + var f10 = true; + else + f10 = e10.c(), lkb(f10) ? f10 = true : (f10 = B6( + this.Wi.g, + cj().yj + ), f10 = Ic(f10)); + e10 = f10 ? e10 : y7(); + e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, $g(new ah(), "required", e10, y7())))); + this.iG || (e10 = hd(c10, cj().We), e10.b() || (e10 = e10.c(), new z7().d(Dg(b10, Iga(Kga(), "in", cj().We, mkb(e10), e10.r.x))))); + e10 = hd(c10, cj().Jc); + if (!e10.b()) + if (e10 = e10.c(), this.N.zf instanceof pA ? f10 = true : (f10 = B6(this.Wi.g, cj().We), f10 = xb(f10, "body")), f10) + Dg(b10, new d62().Zz(e10, this.p, this.Q, this.N)), ws(b10, ay(this.Wi, this.p, this.N).Pa()); + else { + e10 = e10.r.r; + f10 = this.p; + var g10 = K7(), h10 = [qf().Va, qf().Zc]; + ws(b10, Vy(e10, f10, J5(g10, new Ib().ha(h10)), this.Q, H10(), H10(), false, this.N).zw()); + } + e10 = this.N.Gg(); + f10 = Xq().Cp; + e10 === f10 && (e10 = J5(Ef(), H10()), f10 = hd(c10, cj().uh), f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, $g(new ah(), "deprecated", f10, y7())))), f10 = hd(c10, cj().wF), f10.b() ? g10 = true : (g10 = f10.c(), g10 = lkb(g10)), f10 = g10 ? f10 : y7(), f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, $g(new ah(), "allowEmptyValue", f10, y7())))), f10 = hd(c10, cj().Yt), f10.b() ? g10 = true : (g10 = f10.c(), g10 = lkb(g10)), f10 = g10 ? f10 : y7(), f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, $g(new ah(), "style", f10, y7())))), f10 = hd(c10, cj().Vu), f10.b() ? g10 = true : (g10 = f10.c(), g10 = lkb(g10)), f10 = g10 ? f10 : y7(), f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, $g(new ah(), "explode", f10, y7())))), f10 = hd(c10, cj().Su), f10.b() ? g10 = true : (g10 = f10.c(), g10 = lkb(g10)), f10 = g10 ? f10 : y7(), f10.b() || (f10 = f10.c(), new z7().d(Dg(e10, $g(new ah(), "allowReserved", f10, y7())))), f10 = hd(c10, cj().Ne), f10.b() || (g10 = f10.c(), f10 = YX(g10), g10 = g10.r.x, f10 = new hY().kE(f10, this.p, this.Q, g10, this.N), g10 = kr(wr(), g10, q5(jd)), h10 = Q5().Na, new z7().d(Dg(e10, ky("content", f10, h10, g10)))), c10 = hd(c10, xm().Ec), c10.b() || (c10 = c10.c(), new z7().d(Dg(e10, $Pa(cQa(), "examples", c10, this.p, this.N)))), ws(b10, e10)); + c10 = a10.s; + a10 = a10.ca; + e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kkb) { + var b10 = this.Wi, c10 = a10.Wi; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.iG === a10.iG : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Wi; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.iG; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function mkb(a10) { + var b10 = Ab(a10.r.x, q5(nkb)); + if (b10 instanceof z7) + return b10.i.r; + if (y7() === b10) + return a10.r.r.t(); + throw new x7().d(b10); + } + function m5a(a10, b10, c10, e10, f10) { + var g10 = new kkb(); + g10.Wi = a10; + g10.p = b10; + g10.Q = c10; + g10.iG = e10; + g10.N = f10; + return g10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Wi)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Q)); + a10 = OJ().Ga(a10, this.iG ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.La = function() { + return kr(wr(), this.Wi.x, q5(jd)); + }; + function lkb(a10) { + return wh(a10.r.x, q5(b42)); + } + d7.$classData = r8({ fSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ParameterEmitter", { fSa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function p42() { + this.N = this.Q = this.p = this.le = null; + } + p42.prototype = new u7(); + p42.prototype.constructor = p42; + function okb(a10) { + a10 = Vb().Ia(a10); + a10 = a10.b() ? y7() : Ab(a10.c().fa(), q5(pkb)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + } + d7 = p42.prototype; + d7.H = function() { + return "PayloadAsParameterEmitter"; + }; + d7.E = function() { + return 3; + }; + function qkb(a10, b10, c10) { + var e10 = c10.s; + c10 = c10.ca; + var f10 = new rr().e(c10), g10 = J5(Ef(), H10()), h10 = b10.aa, k10 = hd(h10, gn().R); + if (k10 instanceof z7) + Dg(g10, $g(new ah(), "name", k10.i, y7())); + else if (y7() === k10) + rkb(a10, g10); + else + throw new x7().d(k10); + h10 = hd(h10, gn().Va); + h10.b() || (h10 = h10.c(), new z7().d(Dg(g10, $g(new ah(), "description", h10, y7())))); + h10 = okb(b10); + k10 = Q5().Na; + Dg(g10, cx(new dx(), "in", "formData", k10, h10)); + h10 = a10.p; + k10 = K7(); + var l10 = [qf().Va]; + ws(g10, Vy(b10, h10, J5(k10, new Ib().ha(l10)), a10.Q, H10(), H10(), false, a10.N).zw()); + ws(g10, ay(a10.le, a10.p, a10.N).Pa()); + jr(wr(), a10.p.zb(g10), f10); + pr(e10, mr(T6(), tr(ur(), f10.s, c10), Q5().sa)); + } + d7.Ob = function(a10) { + if (Za(this.le).na()) { + var b10 = this.N, c10 = rA(), e10 = B6(this.le.g, db().ed).A; + ex(b10, a10, Ena(c10, e10.b() ? null : e10.c(), this.N)); + } else + b10 = B6(this.le.g, xm().Jc), b10 instanceof Wh ? qkb(this, b10, a10) : b10 instanceof Hh && Ab(this.le.x, q5(Rma)).na() ? (B6(b10.aa, Ih().kh).Da() ? B6(b10.aa, Ih().kh).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = g10.s, l10 = g10.ca, m10 = new rr().e(l10), p10 = J5(Ef(), H10()), t10 = hd(h10.aa, Qi().ji); + t10 = t10.b() || wh(t10.c().r.r.x, q5(b42)) ? t10 : y7(); + if (!t10.b()) { + t10 = t10.c(); + var v10 = Qi().ji, A10 = ih(new jh(), 0 !== za(Si(t10.r.r)), new P6().a()); + new z7().d(Dg(p10, $g( + new ah(), + "required", + lh(v10, kh(A10, t10.r.r.x)), + new z7().d(Q5().ti) + ))); + } + h10 = Vb().Ia(B6(h10.aa, Qi().Vf)); + if (!h10.b()) { + h10 = h10.c(); + t10 = hd(h10.Y(), qf().R); + if (t10 instanceof z7) + Dg(p10, $g(new ah(), "name", t10.i, y7())); + else if (y7() === t10) + rkb(f10, p10); + else + throw new x7().d(t10); + t10 = okb(h10); + v10 = Q5().Na; + Dg(p10, cx(new dx(), "in", "formData", v10, t10)); + t10 = f10.p; + v10 = f10.Q; + A10 = H10(); + var D10 = H10(), C10 = H10(); + ws(p10, Vy(h10, t10, A10, v10, D10, C10, false, f10.N).zw()); + ws(p10, ay(f10.le, f10.p, f10.N).Pa()); + } + jr(wr(), f10.p.zb(p10), m10); + pr(k10, mr(T6(), tr(ur(), m10.s, l10), Q5().sa)); + }; + }(this, a10))) : skb(this, this.le, a10), void 0) : tkb(this, a10); + }; + function rkb(a10, b10) { + a10 = hd(a10.le.g, xm().R); + if (a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + var c10 = Ab(a10.r.x, q5(u5a)); + if (c10.b()) + c10 = y7(); + else { + var e10 = c10.c(); + c10 = e10.KL; + e10 = e10.yc.$d; + var f10 = Q5().Na; + c10 = new z7().d(cx(new dx(), "name", c10, f10, e10)); + } + c10.b() ? (c10 = a10.r.r.t(), a10 = kr(wr(), a10.r.x, q5(jd)), e10 = Q5().Na, a10 = new z7().d(cx(new dx(), "name", c10, e10, a10))) : a10 = c10; + } + if (a10 instanceof z7) + Dg(b10, a10.i); + else if (y7() === a10) + Dg(b10, cx(new dx(), "name", "generated", Q5().Na, ld())); + else + throw new x7().d(a10); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof p42) { + var b10 = this.le, c10 = a10.le; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.le; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.pU = function(a10, b10, c10, e10) { + this.le = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + function skb(a10, b10, c10) { + var e10 = c10.s; + c10 = c10.ca; + var f10 = new rr().e(c10), g10 = J5(Ef(), H10()); + rkb(a10, g10); + var h10 = okb(B6(b10.g, xm().Jc)), k10 = Q5().Na; + Dg(g10, cx(new dx(), "in", "formData", k10, h10)); + h10 = Ab(b10.x, q5(q5a)); + if (h10 instanceof z7) { + k10 = h10.i; + h10 = "" + k10.$L; + k10 = k10.yc.$d; + var l10 = Q5().Na; + Dg(g10, cx(new dx(), "in", h10, l10, k10)); + } else if (y7() !== h10) + throw new x7().d(h10); + b10 = okb(B6(b10.g, xm().Jc)); + h10 = Q5().Na; + Dg(g10, cx(new dx(), "type", "object", h10, b10)); + jr(wr(), a10.p.zb(g10), f10); + pr(e10, mr(T6(), tr(ur(), f10.s, c10), Q5().sa)); + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.le.x, q5(jd)); + }; + function tkb(a10, b10) { + var c10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10), f10 = J5(Ef(), H10()), g10 = hd(a10.le.g, xm().Nd); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), jx(new je4().e("mediaType")), g10, y7())))); + g10 = Ab(a10.le.x, q5(nkb)); + if (g10 instanceof z7) + g10 = g10.i.r; + else if (y7() === g10) + g10 = "body"; + else + throw new x7().d(g10); + var h10 = okb(B6(a10.le.g, xm().Jc)), k10 = Q5().Na; + Dg(f10, cx(new dx(), "in", g10, k10, h10)); + rkb(a10, f10); + g10 = hd(a10.le.g, xm().Jc); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, new d62().Zz(g10, a10.p, a10.Q, a10.N)))); + ws(f10, ay(a10.le, a10.p, a10.N).Pa()); + jr(wr(), a10.p.zb(f10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + } + d7.$classData = r8({ kSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.PayloadAsParameterEmitter", { kSa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function tW() { + ZP.call(this); + this.Jz = this.qA = this.ih = this.ic = null; + this.sA = false; + } + tW.prototype = new kGa(); + tW.prototype.constructor = tW; + d7 = tW.prototype; + d7.H = function() { + return "Raml08EndpointParser"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tW) { + if (this.ic === a10.ic) { + var b10 = this.ih, c10 = a10.ih; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.qA, c10 = a10.qA, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Jz, c10 = a10.Jz, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.sA === a10.sA : false; + } + return false; + }; + d7.Gqa = function() { + return "uriParameters|baseUriParameters"; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + case 2: + return this.qA; + case 3: + return this.Jz; + case 4: + return this.sA; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.OO = function(a10, b10, c10, e10, f10, g10) { + this.ic = a10; + this.ih = b10; + this.qA = c10; + this.Jz = e10; + this.sA = f10; + ZP.prototype.OO.call(this, a10, b10, c10, e10, f10, g10); + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, NJ(OJ(), this.qA)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Jz)); + a10 = OJ().Ga(a10, this.sA ? 1231 : 1237); + return OJ().fe(a10, 5); + }; + d7.$classData = r8({ nSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08EndpointParser", { nSa: 1, TSa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function ukb() { + this.N = this.p = this.sP = null; + } + ukb.prototype = new u7(); + ukb.prototype.constructor = ukb; + d7 = ukb.prototype; + d7.H = function() { + return "Raml08FormPropertiesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ukb) { + var b10 = this.sP, c10 = a10.sP; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.sP; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "formParameters"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + B6(this.sP.aa, Ih().kh).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = B6(v10.aa, Qi().Vf); + if (A10 instanceof vh) { + T6(); + var D10 = B6(v10.aa, qf().R).A; + D10 = D10.b() ? null : D10.c(); + var C10 = mh(T6(), D10); + D10 = new PA().e(t10.ca); + A10 = new bW().Cr(A10, p10.p, y7(), J5(K7(), H10()), J5(K7(), H10()), p10.N).tw; + if (A10 instanceof ve4) + A10.i.Ob(D10); + else if (A10 instanceof ye4) { + A10 = A10.i; + v10 = S4a(R4a(new a42(), B6(v10.aa, Qi().Vf), hd(v10.aa, Qi().ji))); + if (v10 instanceof z7) + v10 = v10.i, v10 = J5(K7(), new Ib().ha([v10])); + else { + if (y7() !== v10) + throw new x7().d(v10); + v10 = H10(); + } + var I10 = D10.s, L10 = D10.ca, Y10 = new rr().e(L10), ia = wr(), pa = p10.p, La = K7(); + jr(ia, pa.zb(A10.ia(v10, La.u)), Y10); + pr(I10, mr(T6(), tr(ur(), Y10.s, L10), Q5().sa)); + } else + throw new x7().d(A10); + A10 = D10.s; + C10 = [C10]; + if (0 > A10.w) + throw new U6().e("0"); + I10 = C10.length | 0; + v10 = A10.w + I10 | 0; + uD(A10, v10); + Ba(A10.L, 0, A10.L, I10, A10.w); + I10 = A10.L; + ia = I10.n.length; + Y10 = L10 = 0; + pa = C10.length | 0; + ia = pa < ia ? pa : ia; + pa = I10.n.length; + for (ia = ia < pa ? ia : pa; L10 < ia; ) + I10.n[Y10] = C10[L10], L10 = 1 + L10 | 0, Y10 = 1 + Y10 | 0; + A10.w = v10; + pr(t10.s, vD(wD(), D10.s)); + } else { + T6(); + D10 = B6(v10.aa, qf().R).A; + D10 = D10.b() ? null : D10.c(); + v10 = mh(T6(), D10); + D10 = new PA().e(t10.ca); + new e62().GK( + A10, + "Cannot emit property " + la(A10).t() + " in raml 08 form properties" + ).Ob(D10); + C10 = D10.s; + A10 = [v10]; + if (0 > C10.w) + throw new U6().e("0"); + I10 = A10.length | 0; + v10 = C10.w + I10 | 0; + uD(C10, v10); + Ba(C10.L, 0, C10.L, I10, C10.w); + I10 = C10.L; + ia = I10.n.length; + Y10 = L10 = 0; + pa = A10.length | 0; + ia = pa < ia ? pa : ia; + pa = I10.n.length; + for (ia = ia < pa ? ia : pa; L10 < ia; ) + I10.n[Y10] = A10[L10], L10 = 1 + L10 | 0, Y10 = 1 + Y10 | 0; + C10.w = v10; + pr(t10.s, vD(wD(), D10.s)); + } + }; + }(this, g10))); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + function vkb(a10, b10, c10) { + var e10 = new ukb(); + e10.sP = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.sP.Xa, q5(jd)); + }; + d7.$classData = r8({ oSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08FormPropertiesEmitter", { oSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function sW() { + hQ.call(this); + this.ih = this.ie = null; + this.Lg = false; + this.qw = this.V_ = null; + } + sW.prototype = new FGa(); + sW.prototype.constructor = sW; + d7 = sW.prototype; + d7.H = function() { + return "Raml08RequestParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof sW ? Bj(this.ie, a10.ie) && this.ih === a10.ih ? this.Lg === a10.Lg : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ie; + case 1: + return this.ih; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.aoa = function() { + }; + d7.PO = function(a10, b10, c10, e10) { + this.ie = a10; + this.ih = b10; + this.Lg = c10; + hQ.prototype.PO.call(this, a10, b10, c10, e10); + this.V_ = "baseUriParameters"; + this.qw = vP(); + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ie)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ BSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08RequestParser", { BSa: 1, lTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function vW() { + mQ.call(this); + this.Wf = this.ic = null; + this.Lg = false; + this.qw = null; + } + vW.prototype = new HGa(); + vW.prototype.constructor = vW; + d7 = vW.prototype; + d7.H = function() { + return "Raml08ResponseParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.Wf = b10; + this.Lg = c10; + mQ.prototype.jn.call(this, a10, b10, c10, e10); + this.qw = vP(); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vW) { + if (this.ic === a10.ic) { + var b10 = this.Wf, c10 = a10.Wf; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.Wf; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Wf)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.Xna = function() { + }; + d7.$classData = r8({ DSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08ResponseParser", { DSa: 1, oTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function NW() { + ZP.call(this); + this.Jz = this.qA = this.ih = this.ic = null; + this.sA = false; + } + NW.prototype = new kGa(); + NW.prototype.constructor = NW; + d7 = NW.prototype; + d7.H = function() { + return "Raml10EndpointParser"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof NW) { + if (this.ic === a10.ic) { + var b10 = this.ih, c10 = a10.ih; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.qA, c10 = a10.qA, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Jz, c10 = a10.Jz, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.sA === a10.sA : false; + } + return false; + }; + d7.Gqa = function() { + return "uriParameters"; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.ih; + case 2: + return this.qA; + case 3: + return this.Jz; + case 4: + return this.sA; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.OO = function(a10, b10, c10, e10, f10, g10) { + this.ic = a10; + this.ih = b10; + this.qA = c10; + this.Jz = e10; + this.sA = f10; + ZP.prototype.OO.call(this, a10, b10, c10, e10, f10, g10); + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, NJ(OJ(), this.qA)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Jz)); + a10 = OJ().Ga(a10, this.sA ? 1231 : 1237); + return OJ().fe(a10, 5); + }; + d7.$classData = r8({ GSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10EndpointParser", { GSa: 1, TSa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function L5a() { + this.N = this.Q = this.p = this.le = null; + } + L5a.prototype = new u7(); + L5a.prototype.constructor = L5a; + d7 = L5a.prototype; + d7.H = function() { + return "Raml10PayloadEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof L5a) { + var b10 = this.le, c10 = a10.le; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.le; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.le.g, c10 = false, e10 = null, f10 = Vb().Ia(B6(this.le.g, xm().Jc)); + a: { + if (f10 instanceof z7) { + c10 = true; + e10 = f10; + var g10 = e10.i; + if (g10 instanceof vh) { + b10 = hd(b10, xm().Nd); + if (!b10.b()) { + c10 = b10.c(); + b10 = new PA().e(a10.ca); + hV(new iV(), c10.r.r, Q5().Na).Ob(b10); + c10 = new PA().e(a10.ca); + e10 = this.p; + f10 = new z7().d(ay(this.le, this.p, this.N)); + var h10 = this.Q, k10 = H10(); + new yW().Cr(g10, e10, f10, k10, h10, this.N).Ob(c10); + g10 = xF(b10.s, 0); + sr(a10, g10, xF(c10.s, 0)); + } + break a; + } + } + if (c10) + f10 = e10.i, a10 = this.N.Bc, g10 = dc().Fh, b10 = f10.j, c10 = y7(), e10 = Ab(f10.fa(), q5(jd)), f10 = f10.Ib(), a10.Gc( + g10.j, + b10, + c10, + "Cannot emit a non WebAPI Shape", + e10, + Yb().qb, + f10 + ); + else if (y7() === f10) + g10 = hd(b10, xm().Nd), g10.b() || (b10 = g10.c(), g10 = new PA().e(a10.ca), hV(new iV(), b10.r.r, Q5().Na).Ob(g10), b10 = new PA().e(a10.ca), c10 = this.p, e10 = new z7().d(ay(this.le, this.p, this.N)), f10 = this.Q, h10 = H10(), new yW().Cr(null, c10, e10, h10, f10, this.N).Ob(b10), g10 = xF(g10.s, 0), sr(a10, g10, xF(b10.s, 0))); + else + throw new x7().d(f10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.le.x, q5(jd)); + }; + d7.yaa = function(a10, b10, c10, e10) { + this.le = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.$classData = r8({ KSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10PayloadEmitter", { KSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function LW() { + hQ.call(this); + this.ih = this.ie = null; + this.Lg = false; + this.qw = this.V_ = this.ra = null; + } + LW.prototype = new FGa(); + LW.prototype.constructor = LW; + d7 = LW.prototype; + d7.H = function() { + return "Raml10RequestParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof LW ? Bj(this.ie, a10.ie) && this.ih === a10.ih ? this.Lg === a10.Lg : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ie; + case 1: + return this.ih; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.aoa = function(a10) { + var b10 = ac(new M6().W(this.ie), "queryString"); + if (!b10.b() && (b10 = b10.c(), b10 = PW(QW(), b10, w6(/* @__PURE__ */ function(k10, l10) { + return function(m10) { + return m10.ub(Ov(l10).j, lt2()); + }; + }(this, a10)), RW(false, false), QP(), this.ra).Cc(), !b10.b())) { + b10 = b10.c(); + a10 = Ov(a10); + if (ac(new M6().W(this.ie), "queryParameters").na()) { + var c10 = this.ra, e10 = sg().ZM, f10 = a10.j, g10 = this.ie, h10 = y7(); + ec(c10, e10, f10, h10, "Properties 'queryString' and 'queryParameters' are exclusive and cannot be declared together", g10.da); + } + b10 = HC(EC(), b10, a10.j, y7()); + c10 = Am().Dq; + new z7().d(Vd(a10, c10, b10)); + } + }; + d7.PO = function(a10, b10, c10, e10) { + this.ie = a10; + this.ih = b10; + this.Lg = c10; + this.ra = e10; + hQ.prototype.PO.call(this, a10, b10, c10, e10); + this.V_ = fh(new je4().e("baseUriParameters")); + this.qw = vP(); + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ie)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ih)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ PSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10RequestParser", { PSa: 1, lTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function OW() { + mQ.call(this); + this.Wf = this.ic = null; + this.Lg = false; + this.qw = this.ra = null; + } + OW.prototype = new HGa(); + OW.prototype.constructor = OW; + d7 = OW.prototype; + d7.H = function() { + return "Raml10ResponseParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.Wf = b10; + this.Lg = c10; + this.ra = e10; + mQ.prototype.jn.call(this, a10, b10, c10, e10); + this.qw = vP(); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof OW) { + if (this.ic === a10.ic) { + var b10 = this.Wf, c10 = a10.Wf; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.Wf; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Wf)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.Xna = function(a10, b10) { + ii(); + for (var c10 = [Zx().lp], e10 = -1 + (c10.length | 0) | 0, f10 = H10(); 0 <= e10; ) + f10 = ji(c10[e10], f10), e10 = -1 + e10 | 0; + Ry(new Sy(), a10, b10, f10, this.ra).hd(); + }; + d7.$classData = r8({ RSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10ResponseParser", { RSa: 1, oTa: 1, f: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function eX() { + this.N = this.Q = this.p = this.Ba = this.la = null; + } + eX.prototype = new u7(); + eX.prototype.constructor = eX; + d7 = eX.prototype; + d7.H = function() { + return "RamlParametersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof eX) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = wkb(this, this.Ba, this.p, this.Q); + if (b10.Da()) { + T6(); + var c10 = this.la, e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10); + jr(wr(), b10, h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + function wkb(a10, b10, c10, e10) { + var f10 = J5(Ef(), H10()); + b10.r.r.wb.Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return !wh(g10.fa(), q5(IR)); + }; + }(a10))).U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + return Dg(h10, oy(g10.N.zf.H$(), m10, k10, l10)); + }; + }(a10, f10, c10, e10))); + return c10.zb(f10); + } + d7.z = function() { + return X5(this); + }; + d7.Sq = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ eTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlParametersEmitter", { eTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function xkb() { + this.Q = this.p = this.Ba = this.la = null; + this.bO = false; + this.N = null; + } + xkb.prototype = new u7(); + xkb.prototype.constructor = xkb; + d7 = xkb.prototype; + d7.H = function() { + return "RamlResponsesEmitter"; + }; + d7.E = function() { + return 5; + }; + function ykb(a10, b10, c10) { + var e10 = zkb(a10); + a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + return oy(f10.N.zf.Ioa(), k10, g10, h10); + }; + }(a10, b10, c10)); + c10 = K7(); + e10 = e10.ka(a10, c10.u); + return b10.zb(e10); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xkb) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.bO === a10.bO : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + case 4: + return this.bO; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (zkb(this).Da()) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10); + jr(wr(), ykb(this, this.p, this.Q), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + function zkb(a10) { + return a10.bO ? a10.Ba.r.r.wb.Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + b10 = B6(b10.g, Dm().In).A; + b10 = b10.b() ? "default" : b10.c(); + return null !== b10 && ra(b10, "default"); + }; + }(a10))) : a10.Ba.r.r.wb.Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + b10 = B6(b10.g, Dm().In).A; + b10 = b10.b() ? "default" : b10.c(); + return !(null !== b10 && ra(b10, "default")); + }; + }(a10))); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.la)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Ba)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Q)); + a10 = OJ().Ga(a10, this.bO ? 1231 : 1237); + return OJ().fe(a10, 5); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + function VOa(a10, b10, c10, e10, f10, g10) { + var h10 = new xkb(); + h10.la = a10; + h10.Ba = b10; + h10.p = c10; + h10.Q = e10; + h10.bO = f10; + h10.N = g10; + return h10; + } + d7.$classData = r8({ pTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlResponsesEmitter", { pTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Gz() { + this.N = this.p = this.yt = this.la = null; + } + Gz.prototype = new u7(); + Gz.prototype.constructor = Gz; + d7 = Gz.prototype; + d7.H = function() { + return "ServersEmitters"; + }; + d7.E = function() { + return 3; + }; + d7.eA = function(a10, b10, c10, e10) { + this.la = a10; + this.yt = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Gz) { + if (this.la === a10.la) { + var b10 = this.yt, c10 = a10.yt; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.yt; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10); + vr(wr(), Akb(this, this.yt), g10); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + function Akb(a10, b10) { + var c10 = a10.p; + a10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = new JX(), k10 = f10.p, l10 = f10.N; + h10.XH = g10; + h10.p = k10; + h10.N = l10; + return h10; + }; + }(a10)); + var e10 = K7(); + return c10.zb(b10.ka(a10, e10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.yt.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.x)); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ ETa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.ServersEmitters", { ETa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Bkb() { + this.Qqa = this.p = this.Kd = this.la = null; + } + Bkb.prototype = new u7(); + Bkb.prototype.constructor = Bkb; + d7 = Bkb.prototype; + d7.H = function() { + return "SingleExampleEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Bkb) { + if (this.la === a10.la) { + var b10 = this.Kd, c10 = a10.Kd; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Kd; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = this.Qqa; + if (e10 instanceof ve4) { + e10 = e10.i; + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + e10.Qa(h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else if (e10 instanceof ye4) + e10.i.Ob(b10); + else + throw new x7().d(e10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Kd.x, q5(jd)); + }; + function jca(a10, b10, c10, e10) { + var f10 = new Bkb(); + f10.la = a10; + f10.Kd = b10; + f10.p = c10; + hd(b10.g, ag().R) instanceof z7 ? (ue4(), a10 = new E42().bA(b10, c10, e10), a10 = new ve4().d(a10)) : (ue4(), a10 = new u72().bA(b10, c10, e10), a10 = new ye4().d(a10)); + f10.Qqa = a10; + return f10; + } + d7.$classData = r8({ FTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.SingleExampleEmitter", { FTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function v72() { + this.r = null; + } + v72.prototype = new u7(); + v72.prototype.constructor = v72; + d7 = v72.prototype; + d7.H = function() { + return "StringToAstEmitter"; + }; + d7.Ob = function(a10) { + if (xja($f(), this.r) || yja($f(), this.r)) + var b10 = mh(T6(), this.r); + else { + Rua(); + var c10 = this.r; + b10 = Mta().mca; + c10 = Fta(Hta(), c10); + b10 = Pua(c10, b10); + b10 = Cj(b10).Fd; + } + Ckb(this, b10, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof v72 ? this.r === a10.r : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Ckb(a10, b10, c10) { + var e10 = b10.hb().gb; + if (Q5().sa === e10) { + e10 = qc(); + var f10 = cc().bi; + b10 = N6(b10, e10, f10); + e10 = c10.s; + c10 = c10.ca; + f10 = new rr().e(c10); + b10.sb.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + T6(); + var l10 = k10.Aa, m10 = Dd(), p10 = cc().bi; + l10 = N6(l10, m10, p10); + m10 = mh(T6(), l10); + l10 = new PA().e(h10.ca); + Ckb(g10, k10.i, l10); + k10 = l10.s; + m10 = [m10]; + if (0 > k10.w) + throw new U6().e("0"); + var t10 = m10.length | 0; + p10 = k10.w + t10 | 0; + uD(k10, p10); + Ba(k10.L, 0, k10.L, t10, k10.w); + t10 = k10.L; + var v10 = t10.n.length, A10 = 0, D10 = 0, C10 = m10.length | 0; + v10 = C10 < v10 ? C10 : v10; + C10 = t10.n.length; + for (v10 = v10 < C10 ? v10 : C10; A10 < v10; ) + t10.n[D10] = m10[A10], A10 = 1 + A10 | 0, D10 = 1 + D10 | 0; + k10.w = p10; + pr(h10.s, vD(wD(), l10.s)); + }; + }(a10, f10))); + pr(e10, mr(T6(), tr( + ur(), + f10.s, + c10 + ), Q5().sa)); + } else + Q5().cd === e10 ? (e10 = lc(), f10 = cc().bi, e10 = N6(b10, e10, f10), b10 = c10.s, f10 = c10.ca, c10 = new PA().e(f10), e10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + Ckb(g10, k10, h10); + }; + }(a10, c10))), T6(), eE(), a10 = SA(zs(), f10), a10 = mr(0, new Sx().Ac(a10, c10.s), Q5().cd), pr(b10, a10)) : (a10 = IO(), e10 = cc().bi, a10 = N6(b10, a10, e10), c10.fo(a10.va)); + } + d7.e = function(a10) { + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ ITa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.StringToAstEmitter", { ITa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function x72() { + this.l = this.N = this.Q = this.p = this.MV = this.hu = null; + } + x72.prototype = new u7(); + x72.prototype.constructor = x72; + d7 = x72.prototype; + d7.H = function() { + return "EndPointEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof x72 && a10.l === this.l) { + var b10 = this.hu, c10 = a10.hu; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.MV, c10 = a10.MV, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hu; + case 1: + return this.MV; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + function Dkb(a10, b10, c10, e10, f10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + var p10 = g10.l, t10 = g10.N, v10 = new Ekb(); + v10.Kl = m10; + v10.p = h10; + v10.yT = k10; + v10.Q = l10; + v10.N = t10; + if (null === p10) + throw mb(E6(), null); + v10.l = p10; + return v10; + }; + }(a10, c10, e10, f10)); + c10 = K7(); + return b10.ka(a10, c10.u); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.hu.g, c10 = new PA().e(a10.ca), e10 = this.MV; + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(ih(new jh(), e10, new P6().a()))); + e10 = e10.b() ? hd(b10, Jl().Uf).c().r.r : e10.c(); + hV(new iV(), e10, Q5().Na).Ob(c10); + e10 = new PA().e(a10.ca); + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, Jl().R); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), jx(new je4().e("displayName")), l10, y7())))); + l10 = hd(b10, Jl().Va); + if (!l10.b()) { + l10 = l10.c(); + var m10 = this.N instanceof $V ? "description" : jx(new je4().e("description")); + new z7().d(Dg(k10, $g(new ah(), m10, l10, y7()))); + } + l10 = hd(b10, nc().Ni()); + l10.b() || (l10 = l10.c(), new z7().d(ws(k10, kQa(l10, this.p, true, this.N.hj()).Pa()))); + l10 = CIa(); + m10 = B6(this.hu.g, Jl().Uf).A; + m10 = m10.b() ? null : m10.c(); + var p10 = B6(this.hu.g, Jl().Wm); + l10 = EIa(l10, m10, p10, B6(this.hu.g, Jl().Ne)); + this.N instanceof $V && (m10 = hd(b10, Jl().ck), m10.b() || (m10 = m10.c(), new z7().d(Dg(k10, $g(new ah(), "summary", m10, y7())))), m10 = hd(b10, Jl().lh), m10.b() || (m10 = m10.c(), new z7().d(ws(k10, Bdb(this.hu, m10, this.p, this.Q, this.N.zf.N).Pa())))); + if (l10.Da()) { + m10 = l10.qt; + p10 = l10.ah; + var t10 = K7(); + m10 = m10.ia(p10, t10.u); + p10 = l10.Xg; + t10 = K7(); + m10 = m10.ia(p10, t10.u); + p10 = l10.Mx; + t10 = K7(); + ws(k10, j5a(g5a(new n42(), "parameters", m10.ia( + p10, + t10.u + ), this.p, l10.pw, this.Q, this.N))); + } + m10 = hd(b10, Jl().bk); + m10.b() || (m10 = m10.c(), new z7().d(ws(k10, Dkb(this, m10, this.p, l10.pw.Da(), this.Q)))); + b10 = hd(b10, Jl().dc); + b10.b() || (b10 = b10.c(), new z7().d(Dg(k10, new VX().hE(jx(new je4().e("security")), b10, this.p, this.N)))); + ws(k10, ay(this.hu, this.p, this.N).Pa()); + jr(wr(), this.p.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = xF(c10.s, 0); + sr(a10, c10, xF(e10.s, 0)); + }; + function Xjb(a10, b10, c10, e10, f10, g10, h10) { + a10.hu = c10; + a10.MV = e10; + a10.p = f10; + a10.Q = g10; + a10.N = h10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.hu.x, q5(jd)); + }; + d7.$classData = r8({ LTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.AccessibleOasDocumentEmitters$EndPointEmitter", { LTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ekb() { + this.p = this.Kl = null; + this.yT = false; + this.l = this.N = this.Q = null; + } + Ekb.prototype = new u7(); + Ekb.prototype.constructor = Ekb; + d7 = Ekb.prototype; + d7.H = function() { + return "OperationEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ekb && a10.l === this.l) { + var b10 = this.Kl, c10 = a10.Kl; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p && this.yT === a10.yT) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Kl; + case 1: + return this.p; + case 2: + return this.yT; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.Kl.g, c10 = new PA().e(a10.ca), e10 = hd(b10, Pl().pm).c(); + hV(new iV(), e10.r.r, Q5().Na).Ob(c10); + e10 = new PA().e(a10.ca); + var f10 = e10.s, g10 = e10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, Pl().R); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "operationId", l10, y7())))); + l10 = hd(b10, Pl().Va); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "description", l10, y7())))); + l10 = hd(b10, Pl().uh); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "deprecated", l10, y7())))); + l10 = hd(b10, Pl().ck); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "summary", l10, y7())))); + l10 = hd(b10, Pl().Xm); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, new XX().eA("tags", l10.r.r.wb, this.p, this.N)))); + l10 = hd(b10, Pl().Sf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, ly("externalDocs", l10.r.r, this.p, this.N)))); + l10 = hd(b10, Pl().Gh); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $x("schemes", l10, this.p, false)))); + l10 = hd(b10, Pl().Wp); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $x("consumes", l10, this.p, false)))); + l10 = hd(b10, Pl().yl); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $x("produces", l10, this.p, false)))); + l10 = hd(b10, nc().Ni()); + l10.b() || (l10 = l10.c(), new z7().d(ws(k10, kQa(l10, this.p, true, this.N.hj()).Pa()))); + l10 = Vb().Ia(AD(this.Kl)); + l10.b() || (l10 = l10.c(), ws(k10, Fkb(this, l10, this.p, this.Q))); + l10 = B6(this.Kl.g, Yd(nc())).Cb(w6(/* @__PURE__ */ function() { + return function(t10) { + return wh(B6(t10.g, Ud().zi).fa(), q5(D32)); + }; + }(this))); + var m10 = hd(b10, Pl().Al); + m10.b() ? Dg(k10, ky("responses", a6a(), Q5().Na, ld())) : (m10 = m10.c(), Dg(k10, Gkb(this.l, m10, this.p, this.Q, l10, this.N))); + l10 = hd(b10, Pl().dc); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, new VX().hE("security", l10, this.p, this.N)))); + if (this.N.zf instanceof pA) { + l10 = this.Kl.g.vb; + m10 = mz(); + m10 = Ua(m10); + var p10 = Id().u; + l10 = Jd(l10, m10, p10).Fb(w6(/* @__PURE__ */ function() { + return function(t10) { + t10 = t10.Lc; + var v10 = Pl().AF; + return null === t10 ? null === v10 : t10.h(v10); + }; + }(this))); + l10.b() || (l10 = l10.c(), m10 = YX(l10), Dg(k10, ky("callbacks", new ZX().kE(m10, this.p, this.Q, l10.r.x, this.N), Q5().Na, ld()))); + b10 = hd(b10, Pl().lh); + b10.b() || (b10 = b10.c(), new z7().d(ws(k10, this.N.zf.Npa(this.Kl, b10, this.p, this.Q).Pa()))); + } + ws(k10, ay(this.Kl, this.p, this.N).Pa()); + jr(wr(), this.p.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = xF(c10.s, 0); + sr(a10, c10, xF(e10.s, 0)); + }; + function Fkb(a10, b10, c10, e10) { + var f10 = J5(Ef(), H10()); + if (a10.N.zf instanceof pA) { + var g10 = B6(b10.g, Am().Tl), h10 = B6(b10.g, Am().Zo), k10 = K7(); + g10 = g10.ia(h10, k10.u); + h10 = B6(b10.g, Am().Tf); + k10 = K7(); + g10 = g10.ia(h10, k10.u); + h10 = B6(b10.g, Am().BF); + k10 = K7(); + g10 = g10.ia(h10, k10.u); + g10.Da() && ws(f10, g5a(new n42(), "parameters", g10, c10, H10(), e10, a10.N).Pa()); + g10 = K7(); + ws(f10, J5(g10, new Ib().ha([Hkb(b10, c10, e10, a10.N)]))); + } else { + g10 = b10.g; + h10 = B6(b10.g, Am().Tl); + k10 = B6(b10.g, Am().Zo); + var l10 = K7(); + h10 = h10.ia(k10, l10.u); + k10 = B6(b10.g, Am().Tf); + l10 = K7(); + h10 = h10.ia(k10, l10.u); + k10 = B6(b10.g, zD().Ne).Dm(w6(/* @__PURE__ */ function() { + return function(t10) { + return !wh(t10.x, q5(Rma)); + }; + }(a10))); + if (null === k10) + throw new x7().d(k10); + l10 = k10.ma(); + k10 = k10.ya(); + l10 = VPa(YPa(), l10); + if (h10.Da() || l10.uo.na() || k10.Da()) { + var m10 = l10.uo.ua(), p10 = K7(); + ws(f10, g5a(new n42(), "parameters", h10, c10, m10.ia(k10, p10.u), e10, a10.N).Pa()); + } + l10.yH.Da() && Dg(f10, new z72().VO(jx(new je4().e("requestPayloads")), l10.yH, c10, e10, a10.N)); + e10 = hd(g10, Am().Dq); + if (!e10.b()) + a: { + if (h10 = e10.c(), e10 = false, g10 = null, h10 = Vb().Ia(h10.r.r), h10 instanceof z7 && (e10 = true, g10 = h10, k10 = g10.i, k10 instanceof vh)) { + Dg(f10, kjb(new t72(), k10, c10, H10(), aW(/* @__PURE__ */ function(t10) { + return function(v10, A10, D10, C10, I10) { + return new yW().Cr(v10, A10, D10, C10, I10, new JW().Ti(t10.N.hj(), WO(), new Yf().a())); + }; + }(a10)), a10.N)); + break a; + } + if (e10) + m10 = g10.i, e10 = a10.N.hj(), g10 = dc().Fh, h10 = b10.j, k10 = y7(), l10 = Ab(m10.fa(), q5(jd)), m10 = m10.Ib(), e10.Gc(g10.j, h10, k10, "Cannot emit a non WebApi Shape", l10, Yb().qb, m10); + else if (y7() !== h10) + throw new x7().d(h10); + } + } + ws(f10, ay(b10, c10, a10.N).Pa()); + return f10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Kl)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, this.yT ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.Q)); + return OJ().fe(a10, 4); + }; + d7.La = function() { + return kr(wr(), this.Kl.x, q5(jd)); + }; + d7.$classData = r8({ NTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.AccessibleOasDocumentEmitters$OperationEmitter", { NTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ikb() { + this.l = this.N = this.Go = this.Q = this.p = this.Ba = this.la = null; + } + Ikb.prototype = new u7(); + Ikb.prototype.constructor = Ikb; + d7 = Ikb.prototype; + d7.H = function() { + return "ResponsesEmitter"; + }; + d7.E = function() { + return 5; + }; + function Gkb(a10, b10, c10, e10, f10, g10) { + var h10 = new Ikb(); + h10.la = "responses"; + h10.Ba = b10; + h10.p = c10; + h10.Q = e10; + h10.Go = f10; + h10.N = g10; + if (null === a10) + throw mb(E6(), null); + h10.l = a10; + return h10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ikb && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Go, a10 = a10.Go, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + case 4: + return this.Go; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Jkb(this, this.Ba, this.p), c10 = M3a(this.Go, this.p, this.N).Pa(), e10 = K7(); + c10 = b10.ia(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), c10, h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + function Jkb(a10, b10, c10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return fkb(h10, g10, f10.Q, f10.N); + }; + }(a10, c10)); + var e10 = K7(); + return c10.zb(b10.ka(a10, e10.u)); + } + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ OTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.AccessibleOasDocumentEmitters$ResponsesEmitter", { OTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Kkb() { + this.l = this.p = this.Qc = null; + } + Kkb.prototype = new u7(); + Kkb.prototype.constructor = Kkb; + d7 = Kkb.prototype; + d7.H = function() { + return "DeclarationsWrapper"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Kkb && a10.l === this.l) { + var b10 = this.Qc, c10 = a10.Qc; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Qc; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.Qc.Da()) { + T6(); + var b10 = mh(T6(), "components"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + jr(wr(), this.p.zb(this.Qc), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Qc.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.La())); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ UTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3DocumentEmitter$DeclarationsWrapper", { UTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function ieb() { + this.N = this.Q = this.p = this.HP = null; + } + ieb.prototype = new u7(); + ieb.prototype.constructor = ieb; + d7 = ieb.prototype; + d7.Jw = function(a10, b10, c10, e10) { + this.HP = a10; + this.p = b10; + this.Q = c10; + this.N = e10; + return this; + }; + d7.H = function() { + return "Oas3RequestBodyDeclarationsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ieb) { + var b10 = this.HP, c10 = a10.HP; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.HP; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "requestBodies"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + this.HP.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + var A10 = AQa(CQa(), v10, p10.p, p10.Q, p10.N); + if (A10.Da()) { + T6(); + v10 = B6(v10.g, zD().R).A; + v10 = v10.b() ? null : v10.c(); + var D10 = mh(T6(), v10); + v10 = new PA().e(t10.ca); + var C10 = v10.s, I10 = v10.ca, L10 = new rr().e(I10); + jr(wr(), p10.p.zb(A10), L10); + pr(C10, mr(T6(), tr(ur(), L10.s, I10), Q5().sa)); + A10 = v10.s; + D10 = [D10]; + if (0 > A10.w) + throw new U6().e("0"); + I10 = D10.length | 0; + C10 = A10.w + I10 | 0; + uD(A10, C10); + Ba(A10.L, 0, A10.L, I10, A10.w); + I10 = A10.L; + var Y10 = I10.n.length, ia = L10 = 0, pa = D10.length | 0; + Y10 = pa < Y10 ? pa : Y10; + pa = I10.n.length; + for (Y10 = Y10 < pa ? Y10 : pa; L10 < Y10; ) + I10.n[ia] = D10[L10], L10 = 1 + L10 | 0, ia = 1 + ia | 0; + A10.w = C10; + pr(t10.s, vD(wD(), v10.s)); + } + }; + }(this, g10))); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.HP.kc(); + if (a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + wr(); + var b10 = B6(a10.g, zD().Ne).kc(); + a10 = (b10.b() ? a10 : b10.c()).fa(); + a10 = new z7().d(kr(0, a10, q5(jd))); + } + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ WTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3RequestBodyDeclarationsEmitter", { WTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Lkb() { + this.N = this.Q = this.p = this.jk = null; + } + Lkb.prototype = new u7(); + Lkb.prototype.constructor = Lkb; + d7 = Lkb.prototype; + d7.H = function() { + return "Oas3RequestBodyEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Lkb && this.jk === a10.jk && this.p === a10.p) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jk; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (Za(this.jk).na()) { + var b10 = rA(), c10 = B6(this.jk.g, db().ed).A, e10 = qA(b10, c10.b() ? null : c10.c(), "requestBodies"); + T6(); + var f10 = mh(T6(), "requestBody"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new rr().e(g10); + T6(); + var k10 = mh(T6(), "$ref"); + T6(); + e10 = mh(T6(), e10); + sr(h10, k10, e10); + pr(c10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = f10.length | 0; + g10 = c10.w + h10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var l10 = h10.n.length; + e10 = k10 = 0; + var m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = h10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + h10.n[e10] = f10[k10], k10 = 1 + k10 | 0, e10 = 1 + e10 | 0; + c10.w = g10; + pr( + a10.s, + vD(wD(), b10.s) + ); + } else if (c10 = AQa(CQa(), this.jk, this.p, this.Q, this.N), c10.Da()) { + T6(); + f10 = mh(T6(), "requestBody"); + b10 = new PA().e(a10.ca); + g10 = b10.s; + h10 = b10.ca; + k10 = new rr().e(h10); + jr(wr(), this.p.zb(c10), k10); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + c10 = b10.s; + f10 = [f10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = f10.length | 0; + g10 = c10.w + h10 | 0; + uD(c10, g10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + l10 = h10.n.length; + e10 = k10 = 0; + m10 = f10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = h10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + h10.n[e10] = f10[k10], k10 = 1 + k10 | 0, e10 = 1 + e10 | 0; + c10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + function Hkb(a10, b10, c10, e10) { + var f10 = new Lkb(); + f10.jk = a10; + f10.p = b10; + f10.Q = c10; + f10.N = e10; + return f10; + } + d7.La = function() { + wr(); + var a10 = B6(this.jk.g, zD().Ne).kc(); + a10 = (a10.b() ? this.jk : a10.c()).fa(); + return kr(0, a10, q5(jd)); + }; + d7.$classData = r8({ XTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3RequestBodyEmitter", { XTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function feb() { + this.N = this.p = this.lg = null; + } + feb.prototype = new u7(); + feb.prototype.constructor = feb; + d7 = feb.prototype; + d7.H = function() { + return "OasAnnotationsTypesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof feb) { + var b10 = this.lg, c10 = a10.lg; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lg; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = jx(new je4().e("annotationTypes")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.lg, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new Mkb().W$(v10, t10.p, t10.N); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr( + a10.s, + vD(wD(), b10.s) + ); + }; + d7.z = function() { + return X5(this); + }; + d7.CU = function(a10, b10, c10) { + this.lg = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.La = function() { + var a10 = this.lg.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ $Ta: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasAnnotationsTypesEmitter", { $Ta: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function V6a() { + this.N = this.p = this.gt = null; + } + V6a.prototype = new u7(); + V6a.prototype.constructor = V6a; + d7 = V6a.prototype; + d7.H = function() { + return "OasCreativeWorkEmitters"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof V6a) { + var b10 = this.gt, c10 = a10.gt; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gt; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = jx(new je4().e("userDocumentation")), c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new PA().e(f10), h10 = wr(), k10 = this.p, l10 = this.gt, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return new s7().lU(v10, t10.p, false, t10.N); + }; + }(this)), p10 = K7(); + vr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = c10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + l10 = f10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = f10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + f10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.CU = function(a10, b10, c10) { + this.gt = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.La = function() { + var a10 = this.gt.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.x)); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ aUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasCreativeWorkEmitters", { aUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function j6() { + this.N = this.la = this.Q = this.p = this.zu = null; + } + j6.prototype = new u7(); + j6.prototype.constructor = j6; + d7 = j6.prototype; + d7.H = function() { + return "OasDeclaredParametersEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof j6) { + var b10 = this.zu, c10 = a10.zu; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.la === a10.la : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zu; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.la; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.zu, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.p, D10 = t10.Q, C10 = t10.N, I10 = new Nkb(); + I10.oA = v10; + I10.p = A10; + I10.Q = D10; + I10.N = C10; + return I10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.zu.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.yr.fa(), q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ cUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDeclaredParametersEmitter", { cUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function k6() { + this.N = this.Q = this.p = this.KP = this.la = null; + } + k6.prototype = new u7(); + k6.prototype.constructor = k6; + d7 = k6.prototype; + d7.H = function() { + return "OasDeclaredResponsesEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k6) { + if (this.la === a10.la) { + var b10 = this.KP, c10 = a10.KP; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.KP; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.KP, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + return fkb(v10, t10.p, t10.Q, t10.N); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.VO = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.KP = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.KP.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ dUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDeclaredResponsesEmitter", { dUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Okb() { + this.l = this.Go = this.Q = this.p = this.Ba = this.la = null; + } + Okb.prototype = new u7(); + Okb.prototype.constructor = Okb; + d7 = Okb.prototype; + d7.H = function() { + return "EndpointsEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Okb && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Go, a10 = a10.Go, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + case 4: + return this.Go; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function b6a(a10, b10, c10, e10, f10) { + var g10 = new Okb(); + g10.la = "paths"; + g10.Ba = b10; + g10.p = c10; + g10.Q = e10; + g10.Go = f10; + if (null === a10) + throw mb(E6(), null); + g10.l = a10; + return g10; + } + d7.Qa = function(a10) { + var b10 = Pkb(this, this.Ba, this.p, this.Q), c10 = M3a(this.Go, this.p, this.l.Lj()).Pa(), e10 = K7(); + c10 = b10.ia(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), c10, h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + function Pkb(a10, b10, c10, e10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + var l10 = f10.l; + if (null === l10.UX && null === l10.UX) { + var m10 = new zQa(); + if (null === l10) + throw mb(E6(), null); + m10.l = l10; + l10.UX = m10; + } + m10 = f10.l.Lj(); + return Xjb(new x72(), l10.UX.l, k10, y7(), g10, h10, m10); + }; + }(a10, c10, e10)); + e10 = K7(); + b10 = b10.ka(a10, e10.u); + return c10.zb(b10); + } + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ fUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$EndpointsEmitter", { fUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Qkb() { + this.l = this.p = this.Ba = this.la = null; + } + Qkb.prototype = new u7(); + Qkb.prototype.constructor = Qkb; + d7 = Qkb.prototype; + d7.H = function() { + return "LicenseEmitter"; + }; + d7.oaa = function(a10, b10, c10, e10) { + this.la = b10; + this.Ba = c10; + this.p = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Qkb && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.Y(), k10 = J5(Ef(), H10()), l10 = hd(h10, Ml().Pf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "url", l10, y7())))); + h10 = hd(h10, Ml().R); + h10.b() || (h10 = h10.c(), new z7().d(Dg(k10, $g(new ah(), "name", h10, y7())))); + ws(k10, ay(this.Ba.r.r, this.p, this.l.Lj()).Pa()); + jr(wr(), this.p.zb(k10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + h10 = k10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + g10.n[h10] = c10[k10], k10 = 1 + k10 | 0, h10 = 1 + h10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ gUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$LicenseEmitter", { gUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Rkb() { + this.l = this.p = this.Ba = this.la = null; + } + Rkb.prototype = new u7(); + Rkb.prototype.constructor = Rkb; + d7 = Rkb.prototype; + d7.H = function() { + return "OrganizationEmitter"; + }; + d7.oaa = function(a10, b10, c10, e10) { + this.la = b10; + this.Ba = c10; + this.p = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Rkb && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.Y(), k10 = J5(Ef(), H10()), l10 = hd(h10, Tl().Pf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "url", l10, y7())))); + l10 = hd(h10, Tl().R); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "name", l10, y7())))); + h10 = hd(h10, Tl().WI); + h10.b() || (h10 = h10.c(), new z7().d(Dg(k10, $g(new ah(), "email", h10, y7())))); + ws(k10, ay(this.Ba.r.r, this.p, this.l.Lj()).Pa()); + jr(wr(), this.p.zb(k10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + h10 = k10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + g10.n[h10] = c10[k10], k10 = 1 + k10 | 0, h10 = 1 + h10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ hUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$OrganizationEmitter", { hUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Skb() { + this.l = this.p = this.vb = null; + } + Skb.prototype = new u7(); + Skb.prototype.constructor = Skb; + d7 = Skb.prototype; + d7.H = function() { + return "InfoEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Skb && a10.l === this.l ? this.vb === a10.vb ? this.p === a10.p : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vb; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(this.vb, Qm().R); + c10.b() ? Dg(b10, cx(new dx(), "title", "API", Q5().Na, ld())) : (c10 = c10.c(), Dg(b10, $g(new ah(), "title", c10, y7()))); + c10 = hd(this.vb, Qm().Va); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "description", c10, y7())))); + c10 = hd(this.vb, Qm().XF); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "termsOfService", c10, y7())))); + c10 = hd(this.vb, Qm().Ym); + c10.b() ? Dg(b10, cx(new dx(), "version", "1.0", Q5().Na, ld())) : (c10 = c10.c(), Dg(b10, $g(new ah(), "version", c10, y7()))); + c10 = hd(this.vb, Qm().OF); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new Qkb().oaa( + this.l.l, + "license", + c10, + this.p + )))); + c10 = hd(this.vb, Qm().SF); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new Rkb().oaa(this.l.l, "contact", c10, this.p)))); + T6(); + var e10 = mh(T6(), "info"); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(b10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + function Z5a(a10, b10, c10) { + var e10 = new Skb(); + e10.vb = b10; + e10.p = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.La = function() { + var a10 = ld(); + var b10 = hd(this.vb, Qm().Ym); + if (!b10.b() && (b10 = Ab(b10.c().r.x, q5(jd)), !b10.b())) + if (a10 = b10.c(), null !== a10) + a10 = a10.yc.$d; + else + throw new x7().d(a10); + b10 = hd(this.vb, Qm().R); + if (!b10.b() && (b10 = Ab(b10.c().r.x, q5(jd)), !b10.b())) + if (b10 = b10.c(), null !== b10) { + if (b10 = b10.yc, a10.Yx() || 0 > b10.$d.ID(a10)) + a10 = b10.$d; + } else + throw new x7().d(b10); + return a10; + }; + d7.$classData = r8({ jUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasDocumentEmitter$WebApiEmitter$InfoEmitter", { jUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function B42() { + this.l = this.vP = null; + } + B42.prototype = new u7(); + B42.prototype.constructor = B42; + d7 = B42.prototype; + d7.H = function() { + return "OasHeaderEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof B42 && a10.l === this.l ? this.vP === a10.vP : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + cx(new dx(), this.vP.la, this.vP.r, Q5().Na, ld()).Qa(a10); + }; + d7.z = function() { + return X5(this); + }; + function A42(a10, b10, c10) { + a10.vP = c10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ CUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentEmitter$OasHeaderEmitter", { CUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function A7() { + this.zE = this.N = null; + } + A7.prototype = new QGa(); + A7.prototype.constructor = A7; + d7 = A7.prototype; + d7.H = function() { + return "OasModuleEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof A7) { + var b10 = this.zE; + a10 = a10.zE; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zE; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.r0 = function() { + var a10 = tA(uA(), Au(), this.zE.x), b10 = K7(), c10 = [IYa(this, this.zE, a10)]; + b10 = J5(b10, new Ib().ha(c10)); + c10 = ar(this.zE.g, Af().Ic); + c10 = new L22().Jw(c10, a10, ar(this.zE.g, Af().xc), this.N).Qc; + var e10 = hd(this.zE.g, Bq().ae); + if (e10.b()) + var f10 = y7(); + else + e10 = e10.c(), f10 = new z7().d($g(new ah(), jx(new je4().e("usage")), e10, y7())); + e10 = OA(); + var g10 = new PA().e(e10.pi), h10 = new qg().e(e10.mi); + tc(h10) && QA(g10, e10.mi); + h10 = g10.s; + var k10 = g10.ca, l10 = new rr().e(k10); + UUa(l10, "swagger", (T6(), mh(T6(), "2.0"))); + var m10 = wr(); + f10 = f10.ua(); + var p10 = K7(); + c10 = c10.ia(f10, p10.u); + f10 = K7(); + jr(m10, a10.zb(c10.ia(b10, f10.u)), l10); + pr( + h10, + mr(T6(), tr(ur(), l10.s, k10), Q5().sa) + ); + return new RA().Ac(SA(zs(), e10.pi), g10.s); + }; + function Tkb(a10, b10, c10) { + a10.zE = b10; + tQ.prototype.aA.call(a10, c10); + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasModuleEmitter", { QUa: 1, UR: 1, f: 1, QR: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nkb() { + this.N = this.Q = this.p = this.oA = null; + } + Nkb.prototype = new u7(); + Nkb.prototype.constructor = Nkb; + d7 = Nkb.prototype; + d7.H = function() { + return "OasNamedParameterEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Nkb && this.oA === a10.oA && this.p === a10.p) { + var b10 = this.Q; + a10 = a10.Q; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.oA; + case 1: + return this.p; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.oA.yr; + b10 = B6(b10.Y(), b10.Zg()).A; + if (b10 instanceof z7) + b10 = b10.i; + else { + b10 = this.N.hj(); + var c10 = dc().Fh, e10 = this.oA.yr.j, f10 = y7(), g10 = "Cannot declare parameter without name " + this.oA.yr, h10 = Ab(this.oA.yr.fa(), q5(jd)), k10 = this.oA.yr.Ib(); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + b10 = "default-name"; + } + T6(); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = this.oA.yr; + c10 instanceof Wl ? m5a(c10, this.p, this.Q, false, this.N).Ob(b10) : c10 instanceof ym && new p42().pU(c10, this.p, this.Q, this.N).Ob(b10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.oA.yr.fa(), q5(jd)); + }; + d7.$classData = r8({ SUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasNamedParameterEmitter", { SUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mkb() { + this.N = this.p = this.Ez = null; + } + Mkb.prototype = new u7(); + Mkb.prototype.constructor = Mkb; + d7 = Mkb.prototype; + d7.H = function() { + return "OasNamedPropertyTypeEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Mkb) { + var b10 = this.Ez, c10 = a10.Ez; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ez; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = B6(this.Ez.g, Sk().R).A; + if (b10.b()) + throw mb(E6(), new nb().e("Cannot declare annotation type without name " + this.Ez)); + b10 = b10.c(); + var c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + if (Za(this.Ez).na()) + OO(this.Ez, B6(this.Ez.g, db().ed).A, H10(), this.N).Ob(b10); + else { + var e10 = this.N.zf.MN().ug(this.Ez, this.p).vT(); + if (e10 instanceof ve4) { + e10 = e10.i; + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(e10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else if (e10 instanceof ye4) + e10.i.Ob(b10); + else + throw new x7().d(e10); + } + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = c10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = c10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.W$ = function(a10, b10, c10) { + this.Ez = a10; + this.p = b10; + this.N = c10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ez.x, q5(jd)); + }; + d7.$classData = r8({ TUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasNamedPropertyTypeEmitter", { TUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function LYa() { + this.N = this.PV = this.Of = this.la = null; + } + LYa.prototype = new u7(); + LYa.prototype.constructor = LYa; + d7 = LYa.prototype; + d7.H = function() { + return "OasNamedRefEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof LYa && this.la === a10.la && this.Of === a10.Of) { + var b10 = this.PV; + a10 = a10.PV; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Of; + case 2: + return this.PV; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + ex(this.N, b10, this.Of); + var e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + var f10 = c10.length | 0, g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + var h10 = f10.n.length, k10 = 0, l10 = 0, m10 = c10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = f10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + f10.n[l10] = c10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), b10.s)); + }; + function KYa(a10, b10, c10, e10, f10) { + a10.la = b10; + a10.Of = c10; + a10.PV = e10; + a10.N = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return this.PV; + }; + d7.$classData = r8({ UUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasNamedRefEmitter", { UUa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function B7() { + this.l = this.jz = this.p = this.Xb = this.Uh = null; + } + B7.prototype = new u7(); + B7.prototype.constructor = B7; + d7 = B7.prototype; + d7.H = function() { + return "ReferenceEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof B7 && a10.l === this.l) { + var b10 = this.Uh, c10 = a10.Uh; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Xb, c10 = a10.Xb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 && this.p === a10.p ? this.jz === a10.jz : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + case 1: + return this.Xb; + case 2: + return this.p; + case 3: + return this.jz; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cba = function() { + var a10 = Lc(this.Uh); + return a10.b() ? this.Uh.j : a10.c(); + }; + d7.Qa = function(a10) { + var b10 = this.Xb; + b10 = (b10.b() ? new tB().hk(J5(Gb().Qg, H10())) : b10.c()).Xb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ya(); + if (null !== h10) + return h10.ma() === f10.Uh.j; + } + throw new x7().d(g10); + }; + }(this))); + if (b10.b()) + b10 = y7(); + else { + var c10 = b10.c(); + a: { + if (null !== c10) { + b10 = c10.ma(); + var e10 = c10.ya(); + if (null !== e10) { + c10 = e10.ya(); + b10 = new R6().M(b10, c10); + break a; + } + } + throw new x7().d(c10); + } + b10 = new z7().d(b10); + } + b10 = b10.b() ? new R6().M(Hb(this.jz), this.Cba()) : b10.c(); + cx(new dx(), b10.ma(), b10.ya(), Q5().Na, ld()).Qa(a10); + }; + function Ukb(a10, b10, c10, e10, f10, g10) { + a10.Uh = c10; + a10.Xb = e10; + a10.p = f10; + a10.jz = g10; + if (null === b10) + throw mb(E6(), null); + a10.l = b10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ aVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecEmitter$ReferenceEmitter", { aVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vkb() { + this.l = this.p = this.wf = null; + } + Vkb.prototype = new u7(); + Vkb.prototype.constructor = Vkb; + d7 = Vkb.prototype; + d7.H = function() { + return "ReferencesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vkb && a10.l === this.l) { + var b10 = this.wf, c10 = a10.wf; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Ab(this.wf.fa(), q5(Rc)), c10 = b10.b() ? new tB().hk(J5(Gb().Qg, H10())) : b10.c(); + b10 = this.wf.Ve(); + var e10 = new leb(), f10 = K7(); + b10 = b10.ec(e10, f10.u); + if (b10.Da()) { + e10 = Rb(Gb().ab, H10()); + f10 = new qd().d(e10); + e10 = new Nd().a(); + c10 = c10.Xb; + var g10 = w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + if (null !== D10) { + var C10 = D10.ma(), I10 = D10.ya(); + if (null !== I10) { + var L10 = I10.ma(), Y10 = I10.ya(); + I10 = t10.Fb(w6(/* @__PURE__ */ function(pa, La) { + return function(ob) { + return ob.j === La; + }; + }(p10, L10))); + if (I10 instanceof z7) { + I10 = I10.i; + v10.oa = v10.oa.cc(new R6().M(I10.j, I10)); + D10 = p10.l; + L10 = new R6().M(L10, Y10); + C10 = [new R6().M(C10, L10)]; + if (0 === (C10.length | 0)) + C10 = vd(); + else { + L10 = wd(new xd(), vd()); + Y10 = 0; + for (var ia = C10.length | 0; Y10 < ia; ) + Ad(L10, C10[Y10]), Y10 = 1 + Y10 | 0; + C10 = L10.eb; + } + return new z7().d(Ukb(new B7(), D10, I10, new z7().d(new tB().hk(C10)), p10.p, oq(/* @__PURE__ */ function(pa, La) { + return function() { + return La.jt("uses"); + }; + }(p10, A10)))); + } + return y7(); + } + } + throw new x7().d(D10); + }; + }(this, b10, f10, e10)), h10 = qe2(); + h10 = re4(h10); + c10 = Jd(c10, g10, h10).ke(); + b10 = b10.Cb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return t10.oa.Ja(v10.j).b(); + }; + }(this, f10))); + e10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return new z7().d(Ukb(new B7(), p10.l, v10, new z7().d(new tB().hk(J5(Gb().Qg, H10()))), p10.p, oq(/* @__PURE__ */ function(A10, D10) { + return function() { + return D10.jt("uses"); + }; + }(p10, t10)))); + }; + }(this, e10)); + f10 = K7(); + b10 = b10.ka(e10, f10.u); + e10 = K7(); + b10 = c10.ia(b10, e10.u); + e10 = new meb(); + f10 = K7(); + e10 = b10.ec(e10, f10.u); + T6(); + b10 = jx(new je4().e("uses")); + f10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + g10 = b10.ca; + h10 = new rr().e(g10); + jr(wr(), this.p.zb(e10), h10); + pr(c10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + e10 = b10.s; + f10 = [f10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = f10.length | 0; + c10 = e10.w + g10 | 0; + uD(e10, c10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = f10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = f10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = c10; + pr(a10.s, vD( + wD(), + b10.s + )); + } + }; + function IYa(a10, b10, c10) { + var e10 = new Vkb(); + e10.wf = b10; + e10.p = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ bVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasSpecEmitter$ReferencesEmitter", { bVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function XX() { + this.p = this.ix = this.la = null; + } + XX.prototype = new u7(); + XX.prototype.constructor = XX; + d7 = XX.prototype; + d7.H = function() { + return "StringArrayTagsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.eA = function(a10, b10, c10) { + this.la = a10; + this.ix = b10; + this.p = c10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof XX) { + if (this.la === a10.la) { + var b10 = this.ix, c10 = a10.ix; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.ix; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.ix, c10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return B6(p10.g, dj().R).A.ua(); + }; + }(this)), e10 = K7(); + b10 = b10.bd(c10, e10.u); + c10 = w6(/* @__PURE__ */ function() { + return function(p10) { + return hV(new iV(), ih(new jh(), p10, new P6().a()), Q5().Na); + }; + }(this)); + e10 = K7(); + var f10 = b10.ka(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + vr(wr(), this.p.zb(f10), h10); + T6(); + eE(); + f10 = SA(zs(), g10); + f10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, f10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + f10 = c10.w + h10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var k10 = h10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = h10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + h10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.ix.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ lVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.StringArrayTagsEmitter", { lVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function s42() { + this.S8 = this.p = this.ix = this.la = null; + } + s42.prototype = new u7(); + s42.prototype.constructor = s42; + d7 = s42.prototype; + d7.H = function() { + return "TagsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.eA = function(a10, b10, c10, e10) { + this.la = a10; + this.ix = b10; + this.p = c10; + this.S8 = e10; + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof s42) { + if (this.la === a10.la) { + var b10 = this.ix, c10 = a10.ix; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.ix; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = this.ix, c10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = p10.p, A10 = new Wkb(); + A10.Ae = t10; + A10.p = v10; + if (null === p10) + throw mb(E6(), null); + A10.l = p10; + return A10; + }; + }(this)), e10 = K7(), f10 = b10.ka(c10, e10.u); + T6(); + b10 = this.la; + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var g10 = b10.ca, h10 = new PA().e(g10); + vr(wr(), this.p.zb(f10), h10); + T6(); + eE(); + f10 = SA(zs(), g10); + f10 = mr(0, new Sx().Ac(f10, h10.s), Q5().cd); + pr(c10, f10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + h10 = e10.length | 0; + f10 = c10.w + h10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, h10, c10.w); + h10 = c10.L; + var k10 = h10.n.length, l10 = g10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = h10.n.length; + for (k10 = k10 < m10 ? k10 : m10; g10 < k10; ) + h10.n[l10] = e10[g10], g10 = 1 + g10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.ix.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ mVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.TagsEmitter", { mVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wkb() { + this.l = this.p = this.Ae = null; + } + Wkb.prototype = new u7(); + Wkb.prototype.constructor = Wkb; + d7 = Wkb.prototype; + d7.H = function() { + return "TagEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10), e10 = this.Ae.g, f10 = J5(Ef(), H10()), g10 = hd(e10, dj().R); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "name", g10, y7())))); + g10 = hd(e10, dj().Va); + g10.b() || (g10 = g10.c(), new z7().d(Dg(f10, $g(new ah(), "description", g10, y7())))); + e10 = hd(e10, dj().Sf); + e10.b() || (e10.c(), new z7().d(Dg(f10, ly("externalDocs", ar(this.Ae.g, dj().Sf), this.p, this.l.S8)))); + ws(f10, ay(this.Ae, this.p, this.l.S8).Pa()); + jr(wr(), this.p.zb(f10), c10); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Wkb && a10.l === this.l) { + var b10 = this.Ae, c10 = a10.Ae; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ae; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ae.x, q5(jd)); + }; + d7.$classData = r8({ nVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.TagsEmitter$TagEmitter", { nVa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function e62() { + this.Ld = this.Fe = null; + } + e62.prototype = new u7(); + e62.prototype.constructor = e62; + d7 = e62.prototype; + d7.H = function() { + return "CommentEmitter"; + }; + d7.Ob = function(a10) { + var b10 = T6().En; + pr(a10.s, b10); + QA(a10, this.Ld); + b10 = Ab(this.Fe.fa(), q5(Qu)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.ad)); + b10.b() || (b10 = b10.c(), Oca(), QA(a10, Nca(0, b10))); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof e62) { + var b10 = this.Fe, c10 = a10.Fe; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ld === a10.Ld : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fe; + case 1: + return this.Ld; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.GK = function(a10, b10) { + this.Fe = a10; + this.Ld = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ qVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.CommentEmitter", { qVa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function oeb() { + this.l = this.p = this.Q = this.lg = null; + } + oeb.prototype = new u7(); + oeb.prototype.constructor = oeb; + d7 = oeb.prototype; + d7.H = function() { + return "AnnotationsTypesEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof oeb && a10.l === this.l) { + var b10 = this.lg, c10 = a10.lg; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lg; + case 1: + return this.Q; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "annotationTypes"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.p, l10 = this.lg, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.l, D10 = t10.Q, C10 = t10.p, I10 = new Xkb(); + I10.Ri = v10; + I10.Q = D10; + I10.p = C10; + if (null === A10) + throw mb(E6(), null); + I10.l = A10; + return I10; + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.lg.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10.x, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ AVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml10RootLevelEmitters$AnnotationsTypesEmitter", { AVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xkb() { + this.l = this.p = this.Q = this.Ri = null; + } + Xkb.prototype = new u7(); + Xkb.prototype.constructor = Xkb; + d7 = Xkb.prototype; + d7.H = function() { + return "NamedPropertyTypeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Xkb && a10.l === this.l) { + var b10 = this.Ri, c10 = a10.Ri; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ri; + case 1: + return this.Q; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Ri.g, Sk().R).A; + if (b10 instanceof z7) + b10 = b10.i; + else { + b10 = this.l.N.Bc; + var c10 = dc().Fh, e10 = this.Ri.j, f10 = y7(), g10 = "Annotation type without name " + this.Ri, h10 = Ab(this.Ri.x, q5(jd)), k10 = yb(this.Ri); + b10.Gc(c10.j, e10, f10, g10, h10, Yb().qb, k10); + b10 = "default-name"; + } + T6(); + e10 = mh(T6(), b10); + c10 = Za(this.Ri).na() ? /* @__PURE__ */ function(p10) { + return function(t10) { + p10.hK(t10); + }; + }(this) : /* @__PURE__ */ function(p10) { + return function(t10) { + p10.gK(t10); + }; + }(this); + b10 = new PA().e(a10.ca); + c10(b10); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.hK = function(a10) { + var b10 = Za(this.Ri); + b10.b() || (b10 = b10.c(), oy(pka(this.l.N.zf), b10, B6(this.Ri.g, db().ed).A, this.Q).Ob(a10)); + }; + d7.gK = function(a10) { + var b10 = this.l.N.zf.MN().ug(this.Ri, this.p).vT(); + if (b10 instanceof ve4) { + b10 = b10.i; + var c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } else if (b10 instanceof ye4) + b10.i.Ob(a10); + else + throw new x7().d(b10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ri.x, q5(jd)); + }; + d7.$classData = r8({ BVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml10RootLevelEmitters$NamedPropertyTypeEmitter", { BVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function $6a() { + this.l = this.p = this.Ba = this.la = null; + } + $6a.prototype = new u7(); + $6a.prototype.constructor = $6a; + d7 = $6a.prototype; + d7.paa = function(a10, b10, c10, e10) { + this.la = b10; + this.Ba = c10; + this.p = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.H = function() { + return "LicenseEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $6a && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.Y(), k10 = J5(Ef(), H10()), l10 = hd(h10, Ml().Pf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "url", l10, y7())))); + h10 = hd(h10, Ml().R); + h10.b() || (h10 = h10.c(), new z7().d(Dg(k10, $g(new ah(), "name", h10, y7())))); + ws(k10, ay(this.Ba.r.r, this.p, this.l.N).Pa()); + jr(wr(), this.p.zb(k10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + h10 = k10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + g10.n[h10] = c10[k10], k10 = 1 + k10 | 0, h10 = 1 + h10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ EVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlDocumentEmitter$LicenseEmitter", { EVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y6a() { + this.l = this.p = this.Ba = this.la = null; + } + Y6a.prototype = new u7(); + Y6a.prototype.constructor = Y6a; + d7 = Y6a.prototype; + d7.paa = function(a10, b10, c10, e10) { + this.la = b10; + this.Ba = c10; + this.p = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.H = function() { + return "OrganizationEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Y6a && a10.l === this.l) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = this.la, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = this.Ba.r.r.Y(), k10 = J5(Ef(), H10()), l10 = hd(h10, Tl().Pf); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "url", l10, y7())))); + l10 = hd(h10, Tl().R); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, $g(new ah(), "name", l10, y7())))); + h10 = hd(h10, Tl().WI); + h10.b() || (h10 = h10.c(), new z7().d(Dg(k10, $g(new ah(), "email", h10, y7())))); + ws(k10, ay(this.Ba.r.r, this.p, this.l.N).Pa()); + jr(wr(), this.p.zb(k10), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + h10 = k10 = 0; + var m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; k10 < l10; ) + g10.n[h10] = c10[k10], k10 = 1 + k10 | 0, h10 = 1 + h10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ FVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlDocumentEmitter$OrganizationEmitter", { FVa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function C7() { + this.l = null; + } + C7.prototype = new u7(); + C7.prototype.constructor = C7; + function c7a(a10) { + var b10 = new C7(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + C7.prototype.ap = function(a10, b10) { + a: { + var c10 = B6(a10.uk.g, Jl().Uf).A; + c10 = c10.b() ? null : c10.c(); + c10 = new qg().e(c10); + for (var e10, f10 = e10 = 0, g10 = c10.ja.length | 0; f10 < g10; ) { + var h10 = c10.lb(f10); + 47 === (null === h10 ? 0 : h10.r) && (e10 = 1 + e10 | 0); + f10 = 1 + f10 | 0; + } + c10 = e10; + e10 = B6(b10.uk.g, Jl().Uf).A; + e10 = e10.b() ? null : e10.c(); + e10 = new qg().e(e10); + g10 = f10 = 0; + for (h10 = e10.ja.length | 0; g10 < h10; ) { + var k10 = e10.lb(g10); + 47 === (null === k10 ? 0 : k10.r) && (f10 = 1 + f10 | 0); + g10 = 1 + g10 | 0; + } + e10 = f10; + c10 = c10 === e10 ? 0 : c10 < e10 ? -1 : 1; + switch (c10) { + case 0: + a10 = B6(a10.uk.g, Jl().Uf).A; + a10 = a10.b() ? null : a10.c(); + b10 = B6(b10.uk.g, Jl().Uf).A; + b10 = b10.b() ? null : b10.c(); + b10 = a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + break a; + default: + b10 = c10; + } + } + return b10; + }; + C7.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + C7.prototype.$classData = r8({ HVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlDocumentEmitter$WebApiEmitter$$anonfun$defaultOrder$1$1", { HVa: 1, f: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + function oY() { + m62.call(this); + this.Je = this.lk = null; + } + oY.prototype = new peb(); + oY.prototype.constructor = oY; + function Ykb() { + } + Ykb.prototype = oY.prototype; + function mcb(a10, b10) { + var c10 = a10.lk.da; + J5(K7(), H10()); + c10 = Ai(b10, c10); + var e10 = a10.lk.da, f10 = Bq().uc; + eb(c10, f10, e10); + c10 = a10.lk.$g.Xd; + e10 = qc(); + e10 = N6(c10, e10, a10.Nb()); + c10 = pz(qz(b10, "uses", e10, a10.lk.Q, a10.Nb()), a10.lk.da); + a10.rA(a10.lk, e10); + e10 = a10.ML(e10); + f10 = Y1(new Z1(), a10.Nb().Gg()); + e10 = Cb(e10, f10); + f10 = Jk().nb; + Vd(b10, f10, e10); + e10 = a10.Nb().pe().et(); + e10.Da() && (f10 = Af().Ic, Bf(b10, f10, e10)); + tc(c10.Q) && (c10 = O4a(c10), e10 = Gk().xc, Bf(b10, e10, c10)); + Fb(a10.Nb().ni); + return b10; + } + function Zkb(a10) { + var b10 = iA().ho; + if (null === b10 ? null === a10 : b10.h(a10)) { + ii(); + a10 = [Zx().Uea]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + b10 = iA().N7; + if (null === b10 ? null === a10 : b10.h(a10)) { + ii(); + a10 = [Zx().eca]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + b10 = iA().D5; + if (null === b10 ? null === a10 : b10.h(a10)) { + ii(); + a10 = [Zx().cp]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + } + return H10(); + } + oY.prototype.ML = function(a10) { + var b10 = sSa(uSa(), this.lk.$g.Xd.Fd), c10 = this.lk.da; + J5(K7(), H10()); + b10 = Ai(b10, c10); + Zz(this.Nb(), b10.j, a10, "webApi"); + c10 = new M6().W(a10); + var e10 = Qm().R; + Gg(c10, "title", nh(Hg(Ig(this, e10, this.Nb()), b10))); + c10 = new M6().W(a10); + e10 = Qm().Va; + Gg(c10, "description", nh(Hg(Ig(this, e10, this.Nb()), b10))); + c10 = ac(new M6().W(a10), "mediaType"); + if (!c10.b()) { + e10 = c10.c(); + this.Nb().Vka = true; + c10 = Od(O7(), e10); + var f10 = e10.i.hb().gb; + Q5().cd === f10 ? e10 = PAa(new Tx().Vb(e10.i, this.Nb())) : (c10.Lb(new W1().a()), f10 = K7(), e10 = [zla(Cla(), e10.i, this.Nb()).Zf()], e10 = Zr( + new $r(), + J5(f10, new Ib().ha(e10)), + new P6().a() + )); + f10 = Qm().yl; + Rg(b10, f10, e10, c10); + f10 = Qm().Wp; + Rg(b10, f10, e10, c10); + } + c10 = new M6().W(a10); + e10 = Qm().Ym; + Gg(c10, "version", nh(Hg(Ig(this, e10, this.Nb()), b10))); + c10 = new M6().W(a10); + e10 = fh(new je4().e("termsOfService")); + f10 = Qm().XF; + Gg(c10, e10, Hg(Ig(this, f10, this.Nb()), b10)); + c10 = new M6().W(a10); + e10 = Qm().Gh; + Gg(c10, "protocols", sP(Hg(Ig(this, e10, this.Nb()), b10))); + c10 = new M6().W(a10); + e10 = fh(new je4().e("contact")); + f10 = Qm().SF; + Gg(c10, e10, Gy(Hg(Ig(this, f10, this.Nb()), b10), w6(/* @__PURE__ */ function(h10) { + return function(k10) { + Wma(); + var l10 = h10.Nb(); + Wma(); + k10 = new XP().pv(k10, wz(uz(), l10)); + return iGa(k10); + }; + }(this)))); + c10 = new M6().W(a10); + e10 = fh(new je4().e("license")); + f10 = Qm().OF; + Gg(c10, e10, Gy(Hg(Ig(this, f10, this.Nb()), b10), w6(/* @__PURE__ */ function(h10) { + return function(k10) { + Pma(); + var l10 = h10.Nb(); + Pma(); + k10 = new RP().pv(k10, wz(uz(), l10)); + return aGa(k10); + }; + }(this)))); + c10 = new M6().W(a10); + e10 = fh(new je4().e("tags")); + c10 = ac(c10, e10); + if (!c10.b()) { + c10 = c10.c(); + e10 = c10.i; + f10 = qc(); + var g10 = rw().sc; + e10 = N6(e10, sw(g10, f10), this.Nb()); + f10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return KGa(dna(fna(), (T6(), T6(), mr(T6(), l10, Q5().sa)), w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = p10.j; + J5(K7(), H10()); + return Ai(t10, v10); + }; + }(h10, k10)), h10.Nb())); + }; + }(this, b10)); + g10 = K7(); + f10 = e10.ka(f10, g10.u); + e10 = Qm().Xm; + f10 = Zr(new $r(), f10, Od(O7(), c10.i)); + c10 = Od(O7(), c10); + Rg(b10, e10, f10, c10); + } + e10 = wt(new M6().W(a10), "^/.*"); + e10.Da() && (c10 = J5(Ef(), H10()), e10.U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + nD(h10.Nb().$h.x0(), m10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return q6a(t10, v10); + }; + }(h10, k10)), y7(), l10, false).hd(); + }; + }(this, b10, c10))), e10 = Qm().Yp, c10 = Zr(new $r(), c10, new P6().a()), Vd(b10, e10, c10), $kb(this.Nb())); + ceb(a10, b10, this.Nb()).hd(); + c10 = new Nd().a(); + c10 = w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + wGa(); + return xGa(yGa(m10, k10, l10, h10.Nb())); + }; + }(this, w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return k10.mI(l10); + }; + }( + this, + b10 + )), c10)); + e10 = new M6().W(a10); + f10 = Qm().dc; + Gg(e10, "securedBy", sP(Gy(Hg(Ig(this, f10, this.Nb()), b10), c10))); + c10 = ac(new M6().W(a10), "documentation"); + c10.b() || (e10 = c10.c(), c10 = Qm().Uv, f10 = e10.i, g10 = lc(), f10 = p7a(new o7a(), this, N6(f10, g10, this.Nb()), this.Nb().pe(), b10.j).Vg(), e10 = Od(O7(), e10), bs(b10, c10, f10, e10)); + Ry(new Sy(), b10, a10, Zkb(this.Nb().iv), this.Nb()).hd(); + return b10; + }; + oY.prototype.$D = function(a10, b10) { + this.lk = a10; + this.Je = b10; + m62.prototype.ss.call(this, b10); + return this; + }; + function D7() { + this.jz = this.p = this.Xb = this.Uh = null; + } + D7.prototype = new u7(); + D7.prototype.constructor = D7; + d7 = D7.prototype; + d7.H = function() { + return "ReferenceEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof D7) { + var b10 = this.Uh, c10 = a10.Uh; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Xb, c10 = a10.Xb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 && this.p === a10.p ? this.jz === a10.jz : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + case 1: + return this.Xb; + case 2: + return this.p; + case 3: + return this.jz; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cba = function() { + var a10 = Lc(this.Uh); + return a10.b() ? this.Uh.j : a10.c(); + }; + d7.Qa = function(a10) { + var b10 = this.Xb; + b10 = (b10.b() ? new tB().hk(J5(Gb().Qg, H10())) : b10.c()).Xb.Fb(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ya(); + if (null !== h10) + return h10.ma() === f10.Uh.j; + } + throw new x7().d(g10); + }; + }(this))); + if (b10.b()) + b10 = y7(); + else { + var c10 = b10.c(); + a: { + if (null !== c10) { + b10 = c10.ma(); + var e10 = c10.ya(); + if (null !== e10) { + c10 = e10.ya(); + b10 = new R6().M(b10, c10); + break a; + } + } + throw new x7().d(c10); + } + b10 = new z7().d(b10); + } + b10 = b10.b() ? new R6().M(Hb(this.jz), this.Cba()) : b10.c(); + cx(new dx(), b10.ma(), b10.ya(), Q5().Na, ld()).Qa(a10); + }; + function alb(a10, b10, c10, e10, f10) { + a10.Uh = b10; + a10.Xb = c10; + a10.p = e10; + a10.jz = f10; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ iWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ReferenceEmitter", { iWa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function blb() { + this.p = this.wf = null; + } + blb.prototype = new u7(); + blb.prototype.constructor = blb; + d7 = blb.prototype; + d7.H = function() { + return "ReferencesEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof blb) { + var b10 = this.wf, c10 = a10.wf; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wf; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = Ab(this.wf.fa(), q5(Rc)), c10 = b10.b() ? new tB().hk(J5(Gb().Qg, H10())) : b10.c(); + b10 = this.wf.Ve(); + var e10 = new seb(), f10 = K7(); + b10 = b10.ec(e10, f10.u); + if (b10.Da()) { + e10 = Rb(Gb().ab, H10()); + f10 = new qd().d(e10); + e10 = new Nd().a(); + c10 = c10.Xb; + var g10 = w6(/* @__PURE__ */ function(p10, t10, v10, A10) { + return function(D10) { + if (null !== D10) { + var C10 = D10.ma(), I10 = D10.ya(); + if (null !== I10) { + D10 = I10.ma(); + var L10 = I10.ya(); + I10 = t10.Fb(w6(/* @__PURE__ */ function(ia, pa) { + return function(La) { + return La.j === pa; + }; + }(p10, D10))); + if (I10 instanceof z7) { + I10 = I10.i; + v10.oa = v10.oa.cc(new R6().M(I10.j, I10)); + D10 = new R6().M(D10, L10); + C10 = [new R6().M(C10, D10)]; + if (0 === (C10.length | 0)) + C10 = vd(); + else { + D10 = wd(new xd(), vd()); + L10 = 0; + for (var Y10 = C10.length | 0; L10 < Y10; ) + Ad(D10, C10[L10]), L10 = 1 + L10 | 0; + C10 = D10.eb; + } + return new z7().d(alb(new D7(), I10, new z7().d(new tB().hk(C10)), p10.p, oq(/* @__PURE__ */ function(ia, pa) { + return function() { + return pa.jt("uses"); + }; + }(p10, A10)))); + } + return y7(); + } + } + throw new x7().d(D10); + }; + }(this, b10, f10, e10)), h10 = qe2(); + h10 = re4(h10); + c10 = Jd(c10, g10, h10).ke(); + b10 = b10.Cb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return t10.oa.Ja(v10.j).b(); + }; + }(this, f10))); + e10 = w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return new z7().d(alb(new D7(), v10, new z7().d(new tB().hk(J5(Gb().Qg, H10()))), p10.p, oq(/* @__PURE__ */ function(A10, D10) { + return function() { + return D10.jt("uses"); + }; + }( + p10, + t10 + )))); + }; + }(this, e10)); + f10 = K7(); + b10 = b10.ka(e10, f10.u); + e10 = K7(); + b10 = c10.ia(b10, e10.u); + e10 = new teb(); + f10 = K7(); + e10 = b10.ec(e10, f10.u); + T6(); + f10 = mh(T6(), "uses"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + g10 = b10.ca; + h10 = new rr().e(g10); + jr(wr(), this.p.zb(e10), h10); + pr(c10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + e10 = b10.s; + f10 = [f10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = f10.length | 0; + c10 = e10.w + g10 | 0; + uD(e10, c10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = f10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = f10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + e10.w = c10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + function Ina(a10, b10) { + var c10 = new blb(); + c10.wf = a10; + c10.p = b10; + return c10; + } + d7.La = function() { + return ld(); + }; + d7.$classData = r8({ jWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ReferencesEmitter", { jWa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function clb() { + this.N = this.p = this.Ba = null; + } + clb.prototype = new u7(); + clb.prototype.constructor = clb; + d7 = clb.prototype; + d7.H = function() { + return "UserDocumentationsEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof clb) { + var b10 = this.Ba, c10 = a10.Ba; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ba; + case 1: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function Z6a(a10, b10, c10) { + var e10 = new clb(); + e10.Ba = a10; + e10.p = b10; + e10.N = c10; + return e10; + } + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "documentation"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new PA().e(f10), h10 = this.Ba.r.r.wb, k10 = new ueb(), l10 = K7(); + h10.ec(k10, l10.u).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + if (Za(v10).na()) { + wr(); + var A10 = B6(v10.g, db().ed).A; + lr(0, t10, A10.b() ? Za(v10).c().j : A10.c(), Q5().Na); + } else + new s7().lU(v10, p10.p, true, p10.N).Ob(t10); + }; + }(this, g10))); + T6(); + eE(); + f10 = SA(zs(), f10); + g10 = mr(0, new Sx().Ac(f10, g10.s), Q5().cd); + pr(e10, g10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + f10 = b10.length | 0; + g10 = e10.w + f10 | 0; + uD(e10, g10); + Ba(e10.L, 0, e10.L, f10, e10.w); + f10 = e10.L; + l10 = f10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = f10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + f10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = g10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.Ba.r.r.wb.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.fa())); + a10.b() ? a10 = y7() : (a10 = a10.c(), wr(), a10 = new z7().d(kr(0, a10, q5(jd)))); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ mWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.UserDocumentationsEmitter", { mWa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function $7a() { + this.rj = null; + } + $7a.prototype = new u7(); + $7a.prototype.constructor = $7a; + d7 = $7a.prototype; + d7.H = function() { + return "ExamplesValidationStep"; + }; + d7.E = function() { + return 1; + }; + d7.Kea = function() { + return L7a(new K7a().$T(this.rj.wf, this.rj.ea), this.rj.ns).Yg(w6(/* @__PURE__ */ function(a10) { + return function(b10) { + var c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = Yaa(g10.Ct, f10.rj.Bf, ""); + return new z7().d(Xb(g10.Ld, h10, g10.Iv, g10.jx, g10.Ct, g10.Fg, g10.da, g10.sy)).ua(); + }; + }(a10)), e10 = K7(); + return b10.bd(c10, e10.u); + }; + }(this)), ml()); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $7a) { + var b10 = this.rj; + a10 = a10.rj; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.UK = function(a10) { + this.rj = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ BXa: 0 }, false, "amf.plugins.document.webapi.validation.ExamplesValidationStep", { BXa: 1, f: 1, yha: 1, dD: 1, y: 1, v: 1, q: 1, o: 1 }); + function Z7a() { + this.rj = null; + } + Z7a.prototype = new u7(); + Z7a.prototype.constructor = Z7a; + d7 = Z7a.prototype; + d7.H = function() { + return "ModelValidationStep"; + }; + d7.E = function() { + return 1; + }; + d7.Kea = function() { + var a10 = lja(new yeb().a(), this.rj.sv), b10 = this.rj.Em; + a10 = ok2().h(b10) || pk().h(b10) || qk().h(b10) || lk().h(b10) || mk().h(b10) || nk().h(b10) || kk().h(b10) ? kja(a10) : jja(a10); + yq(zq(), "WebApiValidations#validationRequestsForBaseUnit: validating now WebAPI"); + b10 = bp(); + var c10 = this.rj.wf, e10 = this.rj.Bf, f10 = Ura().TT; + return gp(b10).aea(c10, e10, f10, a10).Yg(w6(/* @__PURE__ */ function(g10) { + return function(h10) { + var k10 = h10.aM(); + h10 = /* @__PURE__ */ function(A10) { + return function(D10) { + return Waa(A10.rj.wf, D10, A10.rj.sv, A10.rj.Bf).ua(); + }; + }(g10); + if (ii().u === ii().u) { + if (k10 === H10()) + return H10(); + for (var l10 = k10, m10 = new Uj().eq(false), p10 = new qd().d(null), t10 = new qd().d(null); l10 !== H10(); ) { + var v10 = l10.ga(); + h10(v10).Hd().U(w6(/* @__PURE__ */ function(A10, D10, C10, I10) { + return function(L10) { + D10.oa ? (L10 = ji(L10, H10()), I10.oa.Nf = L10, I10.oa = L10) : (C10.oa = ji(L10, H10()), I10.oa = C10.oa, D10.oa = true); + }; + }(k10, m10, p10, t10))); + l10 = l10.ta(); + } + return m10.oa ? p10.oa : H10(); + } + ii(); + for (l10 = new Lf().a(); !k10.b(); ) + m10 = k10.ga(), m10 = h10(m10).Hd(), ws(l10, m10), k10 = k10.ta(); + return l10.ua(); + }; + }(this)), ml()); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Z7a) { + var b10 = this.rj; + a10 = a10.rj; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.UK = function(a10) { + this.rj = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ IXa: 0 }, false, "amf.plugins.document.webapi.validation.ModelValidationStep", { IXa: 1, f: 1, yha: 1, dD: 1, y: 1, v: 1, q: 1, o: 1 }); + function a8a() { + this.rj = null; + } + a8a.prototype = new u7(); + a8a.prototype.constructor = a8a; + d7 = a8a.prototype; + d7.H = function() { + return "ParserValidationStep"; + }; + d7.E = function() { + return 1; + }; + d7.Kea = function() { + var a10 = bp(), b10 = this.rj.wf, c10 = this.rj.Em, e10 = this.rj.sv; + bp(); + return P8a(gp(a10), b10, c10, e10).Yg(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.ll; + }; + }(this)), ml()); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof a8a) { + var b10 = this.rj; + a10 = a10.rj; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.rj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.UK = function(a10) { + this.rj = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ KXa: 0 }, false, "amf.plugins.document.webapi.validation.ParserValidationStep", { KXa: 1, f: 1, yha: 1, dD: 1, y: 1, v: 1, q: 1, o: 1 }); + function qR() { + this.RV = null; + } + qR.prototype = new u7(); + qR.prototype.constructor = qR; + d7 = qR.prototype; + d7.H = function() { + return "JsReportValidationProcessor"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qR) { + var b10 = this.RV; + a10 = a10.RV; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.RV; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.m2 = function(a10, b10) { + if (a10 instanceof EK) { + var c10 = K7(), e10 = "Internal error during validation " + ka(a10.Px), f10 = Yb().qb; + if (b10.b()) + var g10 = y7(); + else + g10 = b10.c(), g10 = new z7().d(g10.j); + g10 = g10.b() ? "" : g10.c(); + if (b10.b()) + var h10 = y7(); + else + h10 = b10.c(), h10 = new z7().d(h10.j); + var k10 = Ko().EF.j, l10 = b10.b() ? y7() : Ab(b10.c().fa(), q5(jd)); + b10 = b10.b() ? y7() : b10.c().Ib(); + a10 = [Xb(e10, f10, g10, h10, k10, l10, b10, a10)]; + a10 = J5(c10, new Ib().ha(a10)); + } else + a10 instanceof pR ? (c10 = K7(), e10 = Yb().qb, b10.b() ? f10 = y7() : (f10 = b10.c(), f10 = new z7().d(f10.j)), f10 = f10.b() ? "" : f10.c(), g10 = y7(), h10 = Ko().EF.j, k10 = b10.b() ? y7() : Ab(b10.c().fa(), q5(jd)), b10 = b10.b() ? y7() : b10.c().Ib(), a10 = [Xb("Unsupported chars in string value (probably a binary file)", e10, f10, g10, h10, k10, b10, a10)], a10 = J5(c10, new Ib().ha(a10))) : a10 = H10(); + return qpa(this, a10); + }; + d7.f1 = function(a10) { + this.RV = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.RL = function(a10) { + return qpa(this, a10); + }; + d7.$classData = r8({ cYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.JsReportValidationProcessor", { cYa: 1, f: 1, fhb: 1, gYa: 1, y: 1, v: 1, q: 1, o: 1 }); + function eB() { + this.r = this.$ = this.E0 = null; + } + eB.prototype = new u7(); + eB.prototype.constructor = eB; + d7 = eB.prototype; + d7.H = function() { + return "ParsedFromTypeExpression"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof eB ? this.E0 === a10.E0 : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.E0; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.E0 = a10; + this.$ = "type-expression"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ jYa: 0 }, false, "amf.plugins.domain.shapes.annotations.ParsedFromTypeExpression", { jYa: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + function dlb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.qa = this.g = this.ba = this.Kn = this.Pf = null; + this.xa = 0; + } + dlb.prototype = new u7(); + dlb.prototype.constructor = dlb; + d7 = dlb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + elb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + var a10 = yc(), b10 = F6().Tb; + this.Pf = rb(new sb(), a10, G5(b10, "url"), tb(new ub(), vb().Tb, "url", "URL for the creative work", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Kn = rb(new sb(), a10, G5(b10, "title"), tb(new ub(), vb().Tb, "title", "Title of the creative work", H10())); + a10 = F6().Tb; + a10 = G5(a10, "CreativeWork"); + b10 = nc().ba; + this.ba = ji(a10, b10); + a10 = this.Pf; + b10 = this.Kn; + var c10 = this.Va, e10 = nc().g, f10 = db().g, g10 = ii(); + e10 = e10.ia(f10, g10.u); + this.g = ji(a10, ji(b10, ji(c10, e10))); + this.qa = tb( + new ub(), + vb().Tb, + "Creative Work", + "The most generic kind of creative work, including books, movies, photographs, software programs, etc.", + H10() + ); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new cn().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ oYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.CreativeWorkModel$", { oYa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, sk: 1 }); + var elb = void 0; + function li() { + elb || (elb = new dlb().a()); + return elb; + } + function XC() { + this.FF = this.CP = this.vo = null; + } + XC.prototype = new u7(); + XC.prototype.constructor = XC; + d7 = XC.prototype; + d7.H = function() { + return "AnyMatchPayloadPlugin"; + }; + d7.XW = function(a10) { + var b10 = this.vo, c10 = new Web(); + c10.pa = a10; + c10.vo = b10; + vp(); + c10.ns = fp(); + return c10; + }; + d7.E = function() { + return 1; + }; + d7.rja = function() { + return false; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof XC ? this.vo === a10.vo : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vo; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.gi = function() { + return this.FF; + }; + d7.wr = function() { + return H10(); + }; + d7.e = function(a10) { + this.vo = a10; + this.CP = H10(); + this.FF = "Any match"; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.$classData = r8({ d_a: 0 }, false, "amf.plugins.domain.shapes.validation.PayloadValidationPluginsHandler$AnyMatchPayloadPlugin", { d_a: 1, f: 1, Sga: 1, Zr: 1, y: 1, v: 1, q: 1, o: 1 }); + function P22() { + this.$ = this.r = null; + } + P22.prototype = new u7(); + P22.prototype.constructor = P22; + d7 = P22.prototype; + d7.H = function() { + return "InvalidBinding"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof P22 ? this.r === a10.r : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.r; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.r = a10; + this.$ = "invalid-binding"; + return this; + }; + d7.z = function() { + return X5(this); + }; + var nkb = r8({ h_a: 0 }, false, "amf.plugins.domain.webapi.annotations.InvalidBinding", { h_a: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + P22.prototype.$classData = nkb; + function Q22() { + this.r = this.$ = this.da = null; + } + Q22.prototype = new u7(); + Q22.prototype.constructor = Q22; + d7 = Q22.prototype; + d7.H = function() { + return "OrphanOasExtension"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Q22 ? this.da === a10.da : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.da; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.da = a10; + this.$ = "orphan-oas-extension"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var D32 = r8({ j_a: 0 }, false, "amf.plugins.domain.webapi.annotations.OrphanOasExtension", { j_a: 1, f: 1, Eh: 1, gf: 1, y: 1, v: 1, q: 1, o: 1 }); + Q22.prototype.$classData = D32; + function flb() { + this.wd = this.bb = this.mc = this.R = this.qa = this.la = this.g = this.ba = this.YM = this.Ky = null; + this.xa = 0; + } + flb.prototype = new u7(); + flb.prototype.constructor = flb; + d7 = flb.prototype; + d7.a = function() { + glb = this; + Cr(this); + uU(this); + wb(this); + var a10 = qb(), b10 = F6().Ta; + this.Ky = rb(new sb(), a10, G5(b10, "expression"), tb(new ub(), vb().Ta, "expression", "structural location of the information to fulfill the callback", H10())); + a10 = Jl(); + b10 = F6().Ta; + this.YM = rb(new sb(), a10, G5(b10, "endpoint"), tb(new ub(), vb().Ta, "endpoint", "Endpoint targeted by the callback", H10())); + a10 = F6().Ta; + a10 = G5(a10, "Callback"); + b10 = nc().ba; + this.ba = ji(a10, b10); + a10 = this.R; + b10 = this.Ky; + var c10 = this.YM, e10 = nc().g; + this.g = ji(a10, ji(b10, ji(c10, e10))); + this.la = this.R; + this.qa = tb( + new ub(), + vb().Ta, + "Callback", + "Model defining the information for a HTTP callback/ webhook", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bm().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ r_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.CallbackModel$", { r_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1 }); + var glb = void 0; + function am() { + glb || (glb = new flb().a()); + return glb; + } + function hlb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.qa = this.ba = this.go = this.dc = this.MZ = this.LZ = this.Aj = this.Pf = null; + this.xa = 0; + } + hlb.prototype = new u7(); + hlb.prototype.constructor = hlb; + d7 = hlb.prototype; + d7.a = function() { + ilb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + var a10 = qb(), b10 = F6().Tb; + this.Pf = rb(new sb(), a10, G5(b10, "urlTemplate"), tb(new ub(), vb().Tb, "urlTemplate", "URL (potentially a template) for the server", H10())); + a10 = new xc().yd(cj()); + b10 = F6().Ta; + this.Aj = rb(new sb(), a10, G5(b10, "variable"), tb(new ub(), vb().Ta, "variable", "Variables in the URL for the server", H10())); + a10 = qb(); + b10 = F6().Ta; + this.LZ = rb(new sb(), a10, G5(b10, "protocol"), tb(new ub(), vb().Tb, "protocol", "The protocol this URL supports for connection", H10())); + a10 = qb(); + b10 = F6().Ta; + this.MZ = rb( + new sb(), + a10, + G5(b10, "protocolVersion"), + tb(new ub(), vb().Tb, "protocolVersion", "The version of the protocol used for connection", H10()) + ); + a10 = new xc().yd(rm2()); + b10 = F6().dc; + this.dc = rb(new sb(), a10, G5(b10, "security"), tb(new ub(), vb().dc, "security", "Textual indication of the kind of security scheme used", H10())); + a10 = new xc().yd(iSa()); + b10 = F6().Jb; + this.go = rb(new sb(), a10, G5(b10, "binding"), tb(new ub(), vb().Jb, "binding", "Bindings for this server", H10())); + a10 = F6().Ta; + a10 = G5(a10, "Server"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Ta, + "Server", + "Information about the network accessible locations where the API is available", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Pf, this.Va, this.Aj, this.LZ, this.MZ, this.dc, this.go], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Zl().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ E_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.ServerModel$", { E_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1, sk: 1 }); + var ilb = void 0; + function Yl() { + ilb || (ilb = new hlb().a()); + return ilb; + } + function jlb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.qa = this.ba = this.Sf = null; + this.xa = 0; + } + jlb.prototype = new u7(); + jlb.prototype.constructor = jlb; + d7 = jlb.prototype; + d7.a = function() { + klb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + var a10 = li(), b10 = F6().Tb; + this.Sf = rb(new sb(), a10, G5(b10, "documentation"), tb(new ub(), vb().Tb, "documentation", "Documentation about the tag", H10())); + a10 = F6().Ta; + a10 = G5(a10, "Tag"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Tag", "Categorical information provided by some API spec format. Tags are extensions to the model supported directly in the input API spec format.", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Va, this.Sf], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.jc = function() { + return this.qa; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new GZ().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ F_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.TagModel$", { F_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1, sk: 1 }); + var klb = void 0; + function dj() { + klb || (klb = new jlb().a()); + return klb; + } + function llb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.OZ = this.YX = this.wY = null; + this.xa = 0; + } + llb.prototype = new u7(); + llb.prototype.constructor = llb; + d7 = llb.prototype; + d7.a = function() { + mlb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.wY = rb(new sb(), a10, G5(b10, "is"), tb(new ub(), vb().Jb, "is", "Defines what type of channel is it", H10())); + a10 = Qn(); + b10 = F6().Jb; + this.YX = rb(new sb(), a10, G5(b10, "exchange"), tb(new ub(), vb().Jb, "exchange", "Defines the exchange properties", H10())); + a10 = Tn(); + b10 = F6().Jb; + this.OZ = rb(new sb(), a10, G5(b10, "queue"), tb(new ub(), vb().Jb, "queue", "Defines the queue properties", H10())); + a10 = F6().Jb; + a10 = G5(a10, "Amqp091ChannelBinding"); + b10 = xZ().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Jb, + "Amqp091ChannelBinding", + "", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.wY, this.YX, this.OZ, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + xZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new On().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ I_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.Amqp091ChannelBindingModel$", { I_a: 1, f: 1, VY: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var mlb = void 0; + function Nn() { + mlb || (mlb = new llb().a()); + return mlb; + } + function nlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.dZ = this.DX = null; + this.xa = 0; + } + nlb.prototype = new u7(); + nlb.prototype.constructor = nlb; + d7 = nlb.prototype; + d7.a = function() { + olb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.DX = rb(new sb(), a10, G5(b10, "contentEncoding"), tb(new ub(), vb().Jb, "contentEncoding", "MIME encoding for the message content", H10())); + a10 = qb(); + b10 = F6().Jb; + this.dZ = rb(new sb(), a10, G5(b10, "messageType"), tb(new ub(), vb().Jb, "messageType", "Application-specific message type", H10())); + a10 = F6().Jb; + a10 = G5(a10, "Amqp091MessageBinding"); + b10 = yZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "Amqp091MessageBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.DX, this.dZ, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + yZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Xn().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ K_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.Amqp091MessageBindingModel$", { K_a: 1, f: 1, VR: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var olb = void 0; + function Wn() { + olb || (olb = new nlb().a()); + return olb; + } + function plb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.Gfa = this.cs = this.cia = this.Kfa = this.Wha = this.Rfa = this.$ha = this.Pfa = this.mia = this.Zfa = null; + this.xa = 0; + } + plb.prototype = new u7(); + plb.prototype.constructor = plb; + d7 = plb.prototype; + d7.a = function() { + qlb = this; + Cr(this); + uU(this); + ej(this); + var a10 = Ac(), b10 = F6().Jb; + this.Zfa = rb(new sb(), a10, G5(b10, "expiration"), tb(new ub(), vb().Jb, "expiration", "TTL (Time-To-Live) for the message", H10())); + a10 = qb(); + b10 = F6().Jb; + this.mia = rb(new sb(), a10, G5(b10, "userId"), tb(new ub(), vb().Jb, "userId", "Identifies the user who has sent the message", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Jb; + this.Pfa = rb(new sb(), a10, G5(b10, "cc"), tb(new ub(), vb().Jb, "cc", "The routing keys the message should be routed to at the time of publishing", H10())); + a10 = Ac(); + b10 = F6().Jb; + this.$ha = rb(new sb(), a10, G5(b10, "priority"), tb(new ub(), vb().Jb, "priority", "A priority for the message", H10())); + a10 = Ac(); + b10 = F6().Jb; + this.Rfa = rb(new sb(), a10, G5(b10, "deliveryMode"), tb(new ub(), vb().Jb, "deliveryMode", "Delivery mode of the message", H10())); + a10 = zc(); + b10 = F6().Jb; + this.Wha = rb(new sb(), a10, G5(b10, "mandatory"), tb(new ub(), vb().Jb, "mandatory", "Whether the message is mandatory or not", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Jb; + this.Kfa = rb(new sb(), a10, G5(b10, "bcc"), tb(new ub(), vb().Jb, "bcc", "Like cc but consumers will not receive this information", H10())); + a10 = qb(); + b10 = F6().Jb; + this.cia = rb(new sb(), a10, G5(b10, "replyTo"), tb(new ub(), vb().Jb, "replyTo", "Name of the queue where the consumer should send the response", H10())); + a10 = zc(); + b10 = F6().Jb; + this.cs = rb(new sb(), a10, G5(b10, "timestamp"), tb(new ub(), vb().Jb, "timestamp", "Whether the message should include a timestamp or not", H10())); + a10 = zc(); + b10 = F6().Jb; + this.Gfa = rb(new sb(), a10, G5(b10, "ack"), tb(new ub(), vb().Jb, "ack", "Whether the consumer should ack the message or not", H10())); + a10 = F6().Jb; + a10 = G5(a10, "Amqp091OperationBinding"); + b10 = wZ().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Jb, + "Amqp091OperationBinding", + "", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Zfa, this.mia, this.Pfa, this.$ha, this.Rfa, this.Wha, this.Kfa, this.cia, this.cs, this.Gfa, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + wZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Zn().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ L_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.Amqp091OperationBindingModel$", { L_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var qlb = void 0; + function yea() { + qlb || (qlb = new plb().a()); + return qlb; + } + function rlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.Tf = null; + this.xa = 0; + } + rlb.prototype = new u7(); + rlb.prototype.constructor = rlb; + d7 = rlb.prototype; + d7.a = function() { + slb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qf(), b10 = F6().Jb; + this.Tf = rb(new sb(), a10, G5(b10, "headers"), tb(new ub(), vb().Jb, "headers", "A Schema object containing the definitions for HTTP-specific headers", H10())); + a10 = F6().Jb; + a10 = G5(a10, "HttpMessageBinding"); + b10 = yZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "HttpMessageBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Tf, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + yZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new fo().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ Q_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.HttpMessageBindingModel$", { Q_a: 1, f: 1, VR: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var slb = void 0; + function eo() { + slb || (slb = new rlb().a()); + return slb; + } + function tlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.nD = this.pm = this.Hf = null; + this.xa = 0; + } + tlb.prototype = new u7(); + tlb.prototype.constructor = tlb; + d7 = tlb.prototype; + d7.a = function() { + ulb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.Hf = rb(new sb(), a10, G5(b10, "type"), tb(new ub(), vb().Jb, "type", "Type of operation", H10())); + a10 = qb(); + b10 = F6().Jb; + this.pm = rb(new sb(), a10, G5(b10, "method"), tb(new ub(), vb().Jb, "method", "Operation binding method", H10())); + a10 = qf(); + b10 = F6().Jb; + this.nD = rb(new sb(), a10, G5(b10, "query"), tb(new ub(), vb().Jb, "query", "A Schema object containing the definitions for each query parameter", H10())); + a10 = F6().Jb; + a10 = G5(a10, "HttpOperationBinding"); + b10 = wZ().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Jb, + "HttpOperationBinding", + "", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Hf, this.pm, this.nD, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + wZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new io().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ R_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.HttpOperationBindingModel$", { R_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var ulb = void 0; + function ho() { + ulb || (ulb = new tlb().a()); + return ulb; + } + function vlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.AY = null; + this.xa = 0; + } + vlb.prototype = new u7(); + vlb.prototype.constructor = vlb; + d7 = vlb.prototype; + d7.a = function() { + wlb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.AY = rb(new sb(), a10, G5(b10, "key"), tb(new ub(), vb().Jb, "key", "The message key", H10())); + a10 = F6().Jb; + a10 = G5(a10, "KafkaMessageBinding"); + b10 = yZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "KafkaMessageBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.AY, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + yZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new ko().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ S_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.KafkaMessageBindingModel$", { S_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var wlb = void 0; + function zea() { + wlb || (wlb = new vlb().a()); + return wlb; + } + function xlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.QC = this.cY = null; + this.xa = 0; + } + xlb.prototype = new u7(); + xlb.prototype.constructor = xlb; + d7 = xlb.prototype; + d7.a = function() { + ylb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.cY = rb(new sb(), a10, G5(b10, "groupId"), tb(new ub(), vb().Jb, "groupId", "Id of the consumer group", H10())); + a10 = qb(); + b10 = F6().Jb; + this.QC = rb(new sb(), a10, G5(b10, "clientId"), tb(new ub(), vb().Jb, "clientId", "Id of the consumer inside a consumer group", H10())); + a10 = F6().Jb; + a10 = G5(a10, "KafkaOperationBinding"); + b10 = wZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "KafkaOperationBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.cY, this.QC, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + wZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new no().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ T_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.KafkaOperationBindingModel$", { T_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var ylb = void 0; + function mo() { + ylb || (ylb = new xlb().a()); + return ylb; + } + function zlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = null; + this.xa = 0; + } + zlb.prototype = new u7(); + zlb.prototype.constructor = zlb; + d7 = zlb.prototype; + d7.a = function() { + Alb = this; + Cr(this); + uU(this); + ej(this); + var a10 = F6().Jb; + a10 = G5(a10, "MqttMessageBinding"); + var b10 = yZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "MqttMessageBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + yZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new po().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ V_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.MqttMessageBindingModel$", { V_a: 1, f: 1, VR: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var Alb = void 0; + function Aea() { + Alb || (Alb = new zlb().a()); + return Alb; + } + function Blb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.oD = this.mD = null; + this.xa = 0; + } + Blb.prototype = new u7(); + Blb.prototype.constructor = Blb; + d7 = Blb.prototype; + d7.a = function() { + Clb = this; + Cr(this); + uU(this); + ej(this); + var a10 = Ac(), b10 = F6().Jb; + this.mD = rb(new sb(), a10, G5(b10, "qos"), tb(new ub(), vb().Jb, "qos", "Defines how hard the broker/client will try to ensure that a message is received", H10())); + a10 = zc(); + b10 = F6().Jb; + this.oD = rb(new sb(), a10, G5(b10, "retain"), tb(new ub(), vb().Jb, "retain", "Whether the broker should retain the message or not", H10())); + a10 = F6().Jb; + a10 = G5(a10, "MqttOperationBinding"); + b10 = wZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "MqttOperationBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.mD, this.oD, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + wZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new so().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ W_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.MqttOperationBindingModel$", { W_a: 1, f: 1, mJ: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var Clb = void 0; + function ro() { + Clb || (Clb = new Blb().a()); + return Clb; + } + function Dlb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.zY = this.WY = this.BX = this.QC = null; + this.xa = 0; + } + Dlb.prototype = new u7(); + Dlb.prototype.constructor = Dlb; + d7 = Dlb.prototype; + d7.a = function() { + Elb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.QC = rb(new sb(), a10, G5(b10, "clientId"), tb(new ub(), vb().Jb, "clientId", "The client identifier", H10())); + a10 = zc(); + b10 = F6().Jb; + this.BX = rb(new sb(), a10, G5(b10, "cleanSession"), tb(new ub(), vb().Jb, "cleanSession", "Whether to create a persistent connection or not", H10())); + a10 = xo(); + b10 = F6().Jb; + this.WY = rb(new sb(), a10, G5(b10, "lastWill"), tb(new ub(), vb().Jb, "lastWill", "Last Will and Testament configuration", H10())); + a10 = Ac(); + b10 = F6().Jb; + this.zY = rb(new sb(), a10, G5(b10, "keepAlive"), tb( + new ub(), + vb().Jb, + "keepAlive", + "Interval in seconds of the longest period of time the broker and the client can endure without sending a message", + H10() + )); + a10 = F6().Jb; + a10 = G5(a10, "MqttServerBinding"); + b10 = iSa().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "MqttServerBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.QC, this.BX, this.WY, this.zY, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + iSa(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.jc = function() { + return this.qa; + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new vo().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ X_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.MqttServerBindingModel$", { X_a: 1, f: 1, s7: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var Elb = void 0; + function uo() { + Elb || (Elb = new Dlb().a()); + return Elb; + } + function Flb() { + this.wd = this.bb = this.mc = this.Lh = this.qa = this.ba = this.Tf = this.nD = this.pm = null; + this.xa = 0; + } + Flb.prototype = new u7(); + Flb.prototype.constructor = Flb; + d7 = Flb.prototype; + d7.a = function() { + Glb = this; + Cr(this); + uU(this); + ej(this); + var a10 = qb(), b10 = F6().Jb; + this.pm = rb(new sb(), a10, G5(b10, "method"), tb(new ub(), vb().Jb, "method", "The HTTP method to use when establishing the connection", H10())); + a10 = qf(); + b10 = F6().Jb; + this.nD = rb(new sb(), a10, G5(b10, "query"), tb(new ub(), vb().Jb, "query", "A Schema object containing the definitions for each query parameter", H10())); + a10 = qf(); + b10 = F6().Jb; + this.Tf = rb(new sb(), a10, G5(b10, "headers"), tb(new ub(), vb().Jb, "query", "A Schema object containing the definitions for each query parameter", H10())); + a10 = F6().Jb; + a10 = G5(a10, "WebSocketsChannelBinding"); + b10 = xZ().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "WebSocketsChannelBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.pm, this.nD, this.Tf, this.Lh], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + xZ(); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Cz = function(a10) { + this.Lh = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Bo().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ a0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.WebSocketsChannelBindingModel$", { a0a: 1, f: 1, VY: 1, pd: 1, hc: 1, Rb: 1, rc: 1, YA: 1 }); + var Glb = void 0; + function Ao() { + Glb || (Glb = new Flb().a()); + return Glb; + } + function Hlb() { + this.wd = this.bb = this.mc = this.R = this.la = this.qa = this.g = this.ba = this.Gh = null; + this.xa = 0; + } + Hlb.prototype = new u7(); + Hlb.prototype.constructor = Hlb; + d7 = Hlb.prototype; + d7.a = function() { + Ilb = this; + Cr(this); + uU(this); + wb(this); + var a10 = new xc().yd(im()), b10 = F6().dc; + this.Gh = rb(new sb(), a10, G5(b10, "schemes"), tb(new ub(), vb().dc, "schemes", "", H10())); + ii(); + a10 = F6().dc; + a10 = [G5(a10, "SecurityRequirement")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + ii(); + a10 = [this.Gh]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().dc, + "Security Requirement", + "Flow for an OAuth2 security scheme setting", + H10() + ); + this.la = this.R; + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new tm().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ j0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.SecurityRequirementModel$", { j0a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1, Oi: 1 }); + var Ilb = void 0; + function rm2() { + Ilb || (Ilb = new Hlb().a()); + return Ilb; + } + function Kl() { + this.j = this.Ke = this.hna = this.x = this.g = null; + this.xa = false; + } + Kl.prototype = new u7(); + Kl.prototype.constructor = Kl; + function Jlb() { + } + d7 = Jlb.prototype = Kl.prototype; + d7.CM = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Zl().K(new S6().a(), b10); + var c10 = Yl().Pf; + a10 = eb(b10, c10, a10); + b10 = Jl().lh; + ig(this, b10, a10); + return a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.hda = function() { + it2(this.g, Jl().lh); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return this.hna; + }; + d7.mI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new tm().K(new S6().a(), b10); + var c10 = rm2().R; + a10 = eb(b10, c10, a10); + b10 = Jl().dc; + ig(this, b10, a10); + return a10; + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + var a10 = B6(this.g, Jl().Uf).A; + a10 = a10.b() ? null : a10.c(); + a10 = new je4().e(a10); + return "/end-points/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + function oGa(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new Wl().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + c10 = Sd(c10, b10, e10); + e10 = cj().gw; + b10 = eb(c10, e10, b10); + c10 = Jl().Wm; + ig(a10, c10, b10); + return b10; + } + d7.ifa = function(a10) { + var b10 = Jl().lh; + return Zd(this, b10, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.t3 = function() { + var a10 = B6(this.g, nc().Ni()), b10 = new Efb().LO(this), c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.Y = function() { + return this.g; + }; + function vGa(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new Ql().K(new S6().a(), c10); + var e10 = Pl().pm; + b10 = eb(c10, e10, b10); + c10 = Jl().bk; + ig(a10, c10, b10); + return b10; + } + function jQa(a10) { + var b10 = UX(a10); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + var c10 = B6(a10.g, Jl().Uf).A; + c10 = c10.b() ? null : c10.c(); + c10 = new qg().e(c10); + b10 = B6(b10.g, Jl().Uf).A; + b10 = b10.b() ? null : b10.c(); + b10 = new z7().d(Wp(c10, b10)); + } + return b10.b() ? (a10 = B6(a10.g, Jl().Uf).A, a10.b() ? null : a10.c()) : b10.c(); + } + d7.Zg = function() { + return Jl().R; + }; + function UX(a10) { + a10 = Ab(a10.x, q5(Klb)); + return a10.b() ? y7() : a10.c().Wd; + } + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.hna = Jl(); + return this; + }; + d7.uW = function() { + return B6(this.g, Jl().lh); + }; + function DGa(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new ym().K(new S6().a(), c10); + if (!b10.b()) { + b10 = b10.c(); + var e10 = xm().Nd; + eb(c10, e10, b10); + } + b10 = Jl().Ne; + ig(a10, b10, c10); + return c10; + } + d7.$classData = r8({ Fha: 0 }, false, "amf.plugins.domain.webapi.models.EndPoint", { Fha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, Gha: 1, t7: 1 }); + function Wl() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Wl.prototype = new u7(); + Wl.prototype.constructor = Wl; + function Llb() { + } + d7 = Llb.prototype = Wl.prototype; + d7.Doa = function() { + it2(this.g, cj().Ec); + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.Cka = function() { + return B6(this.g, cj().Ec); + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Wl().K(new S6().a(), a10); + var b10 = B6(this.g, cj().We).A; + b10 = b10.b() ? null : b10.c(); + var c10 = cj().We; + return eb(a10, c10, b10).pc(this.j); + }; + d7.bc = function() { + return cj(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, cj().R).A; + a10 = a10.b() ? "default-parameter" : a10.c(); + a10 = new je4().e(a10); + return "/parameter/" + jj(a10.td); + }; + d7.cfa = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Hh().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = cj().Jc; + Vd(this, b10, a10); + return a10; + }; + d7.Epa = function() { + return B6(this.g, cj().Jc); + }; + d7.dX = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Mh().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = cj().Jc; + Vd(this, b10, a10); + return a10; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Wl().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return cj().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + function nGa(a10, b10) { + var c10 = Yi(O7(), a10.x); + c10 = new Wl().K(new S6().a(), c10); + var e10 = B6(a10.g, cj().R).A; + e10 = e10.b() ? null : e10.c(); + O7(); + var f10 = new P6().a(); + c10 = Sd(c10, e10, f10); + J5(K7(), H10()); + b10 = Ai(c10, b10); + a10.g.vb.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(); + k10 = k10.ya(); + var m10 = k10.r; + m10 = m10 instanceof rf ? m10.VN(y7(), y7(), new HM().a(), false) : m10; + Rg(h10, l10, m10, k10.x); + } else + throw new x7().d(k10); + }; + }(a10, b10))); + return b10; + } + d7.qF = function(a10) { + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new en().K(c10, b10); + a10.b() || (a10 = a10.c(), O7(), c10 = new P6().a(), Sd(b10, a10, c10)); + a10 = cj().Ec; + ig(this, a10, b10); + return b10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Iha: 0 }, false, "amf.plugins.domain.webapi.models.Parameter", { Iha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, Kha: 1 }); + function Bm() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Bm.prototype = new u7(); + Bm.prototype.constructor = Bm; + d7 = Bm.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.lI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = Am().Tf; + ig(this, b10, a10); + return a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Bm().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Am(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, zD().R).A; + a10 = a10.b() ? "request" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.K3 = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = Am().Tl; + ig(this, b10, a10); + return a10; + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Bm().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return zD().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ F0a: 0 }, false, "amf.plugins.domain.webapi.models.Request", { F0a: 1, f: 1, Hha: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1 }); + function Em() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Em.prototype = new u7(); + Em.prototype.constructor = Em; + function Mlb() { + } + d7 = Mlb.prototype = Em.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.lI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = Dm().Tf; + ig(this, b10, a10); + return a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Em().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Dm(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Dm().R).A; + a10 = a10.b() ? "default-response" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Em().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return Dm().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Jha: 0 }, false, "amf.plugins.domain.webapi.models.Response", { Jha: 1, f: 1, Hha: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1 }); + function On() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + On.prototype = new u7(); + On.prototype.constructor = On; + d7 = On.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new On().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Nn(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/amqp091-channel"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new On().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Q0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.amqp.Amqp091ChannelBinding", { Q0a: 1, f: 1, u7: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function Xn() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Xn.prototype = new u7(); + Xn.prototype.constructor = Xn; + d7 = Xn.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Xn().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Wn(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/amqp091-message"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Xn().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ S0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.amqp.Amqp091MessageBinding", { S0a: 1, f: 1, XR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function Zn() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Zn.prototype = new u7(); + Zn.prototype.constructor = Zn; + d7 = Zn.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Zn().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return yea(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/amqp091-operation"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Zn().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ T0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.amqp.Amqp091OperationBinding", { T0a: 1, f: 1, YR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function fo() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + fo.prototype = new u7(); + fo.prototype.constructor = fo; + d7 = fo.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new fo().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return eo(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/http-message"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new fo().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ V0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.http.HttpMessageBinding", { V0a: 1, f: 1, XR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function io() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + io.prototype = new u7(); + io.prototype.constructor = io; + d7 = io.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new io().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return ho(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/http-operation"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new io().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ W0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.http.HttpOperationBinding", { W0a: 1, f: 1, YR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function ko() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + ko.prototype = new u7(); + ko.prototype.constructor = ko; + d7 = ko.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new ko().K(b10, a10); + }; + d7.bc = function() { + return zea(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/kafka-message"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new ko().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ X0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.kafka.KafkaMessageBinding", { X0a: 1, f: 1, XR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function no() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + no.prototype = new u7(); + no.prototype.constructor = no; + d7 = no.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new no().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return mo(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/kafka-operation"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new no().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Y0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.kafka.KafkaOperationBinding", { Y0a: 1, f: 1, YR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function po() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + po.prototype = new u7(); + po.prototype.constructor = po; + d7 = po.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new po().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Aea(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/mqtt-message"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new po().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Z0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.mqtt.MqttMessageBinding", { Z0a: 1, f: 1, XR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function so() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + so.prototype = new u7(); + so.prototype.constructor = so; + d7 = so.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new so().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return ro(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/mqtt-operation"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new so().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ $0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.mqtt.MqttOperationBinding", { $0a: 1, f: 1, YR: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function vo() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + vo.prototype = new u7(); + vo.prototype.constructor = vo; + d7 = vo.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new vo().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return uo(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/mqtt-server"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new vo().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ a1a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.mqtt.MqttServerBinding", { a1a: 1, f: 1, Lha: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function Bo() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Bo.prototype = new u7(); + Bo.prototype.constructor = Bo; + d7 = Bo.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Bo().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Ao(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return "/web-socket-channel"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Bo().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ c1a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.websockets.WebSocketsChannelBinding", { c1a: 1, f: 1, u7: 1, qd: 1, vc: 1, tc: 1, rg: 1, ZA: 1 }); + function vm() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + vm.prototype = new u7(); + vm.prototype.constructor = vm; + function Nlb() { + } + d7 = Nlb.prototype = vm.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.mQ = function() { + O7(); + var a10 = new P6().a(); + a10 = new bR().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.cX = function() { + O7(); + var a10 = new P6().a(); + a10 = new q1().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.ub = function(a10) { + return Yh(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + function Yh(a10, b10) { + if (-1 !== (b10.indexOf("#") | 0)) { + var c10 = a10.dd(); + c10 = new je4().e(c10); + return a10.pc(b10 + "/" + jj(c10.td)); + } + c10 = a10.dd(); + c10 = new je4().e(c10); + return a10.pc(b10 + "#" + jj(c10.td)); + } + d7.lI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = Xh().Tf; + ig(this, b10, a10); + return a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new vm().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Xh(); + }; + d7.aX = function() { + O7(); + var a10 = new P6().a(); + a10 = new Om().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + function Qib(a10) { + var b10 = B6(a10.g, Xh().Hf).A; + if (b10 instanceof z7) { + b10 = b10.i; + var c10 = "oauth2" === b10 ? "OAuth 2.0" : "basic" === b10 ? "Basic Authentication" : "apiKey" === b10 || "x-apiKey" === b10 ? "Api Key" : b10; + b10 = Xh().Hf; + var e10 = B6(a10.g, Xh().Hf).x, f10 = e10.hf; + Ef(); + var g10 = Jf(new Kf(), new Lf().a()); + for (f10 = f10.Dc; !f10.b(); ) { + var h10 = f10.ga(); + false !== !(h10 instanceof c22) && Of(g10, h10); + f10 = f10.ta(); + } + e10.hf = g10.eb; + c10 = ih(new jh(), c10, e10); + e10 = Ti(a10.g, Xh().Hf).x; + Rg(a10, b10, c10, e10); + } + } + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Xh().R).A; + a10 = a10.b() ? "fragment" : a10.c(); + a10 = new je4().e(a10); + return jj(a10.td); + }; + d7.pQ = function() { + O7(); + var a10 = new P6().a(); + a10 = new wE().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.K3 = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = Xh().Tl; + ig(this, b10, a10); + return a10; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new vm().K(a10, b10); + }; + }(this)); + }; + d7.I3 = function() { + O7(); + var a10 = new P6().a(); + a10 = new r1().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gfa = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Em().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + b10 = Sd(b10, a10, c10); + a10 = "default" === a10 ? "200" : a10; + c10 = Dm().In; + a10 = eb(b10, c10, a10); + b10 = Xh().Al; + ig(this, b10, a10); + return a10; + }; + d7.Zg = function() { + return Xh().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.J3 = function() { + O7(); + var a10 = new P6().a(); + a10 = new uE().K(new S6().a(), a10); + var b10 = Xh().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Mha: 0 }, false, "amf.plugins.domain.webapi.models.security.SecurityScheme", { Mha: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Nha: 1 }); + function Vm() { + S52.call(this); + this.Xa = this.aa = null; + } + Vm.prototype = new Sab(); + Vm.prototype.constructor = Vm; + function Olb() { + } + d7 = Olb.prototype = Vm.prototype; + d7.bc = function() { + return vea(); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Vm().K(b10, a10); + return Rd(a10, this.j); + }; + d7.fa = function() { + return this.Xa; + }; + function Plb(a10, b10, c10, e10) { + if (Za(a10) instanceof z7) { + var f10 = J5(K7(), H10()); + return Plb(Az(a10, f10), b10, c10, e10); + } + f10 = Vb().Ia(a10.Nz()); + if (f10.b()) + b10 = y7(); + else { + f10 = f10.c(); + var g10 = a10.Xa, h10 = B6(a10.aa, kP().R).A; + h10 = h10.b() ? null : h10.c(); + var k10 = a10.j; + a10 = FB(GB(), a10.j, b10); + var l10 = y7(); + b10 = new z7().d(Gqa(GB(), b10, c10, f10, g10, h10, k10, a10, false, l10, e10)); + } + return b10.b() ? null : b10.c(); + } + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Vm().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + S52.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ Oha: 0 }, false, "amf.plugins.domain.webapi.models.templates.ResourceType", { Oha: 1, $6: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1 }); + function Tm() { + S52.call(this); + this.Xa = this.aa = null; + } + Tm.prototype = new Sab(); + Tm.prototype.constructor = Tm; + function Qlb() { + } + d7 = Qlb.prototype = Tm.prototype; + d7.bc = function() { + return uea(); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Tm().K(b10, a10); + return Rd(a10, this.j); + }; + d7.fa = function() { + return this.Xa; + }; + function Rlb(a10, b10, c10) { + if (Za(a10) instanceof z7) { + var e10 = J5(K7(), H10()); + return Rlb(Az(a10, e10), b10, c10); + } + e10 = Vb().Ia(a10.Nz()); + if (e10.b()) + a10 = y7(); + else { + e10 = e10.c(); + var f10 = GB(), g10 = B6(a10.aa, kP().R).A; + a10 = new z7().d(Dqa(f10, c10, e10, b10, g10.b() ? "" : g10.c(), a10.Xa, a10.j, FB(GB(), a10.j, b10), false, y7())); + } + return a10.b() ? null : a10.c(); + } + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Tm().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + S52.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ Pha: 0 }, false, "amf.plugins.domain.webapi.models.templates.Trait", { Pha: 1, $6: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1 }); + function Slb() { + vq.call(this); + this.qi = this.e0 = this.d0 = this.Hea = this.Ig = null; + } + Slb.prototype = new O8a(); + Slb.prototype.constructor = Slb; + d7 = Slb.prototype; + d7.a = function() { + vq.prototype.a.call(this); + Tlb = this; + this.qi = nv().ea; + this.Ig = "AMF Validation"; + this.Hea = "http://a.ml/dialects/profile.raml"; + this.d0 = nu(); + this.e0 = nu(); + return this; + }; + d7.B3 = function(a10, b10, c10, e10, f10) { + b10 = Ulb(a10, b10); + return P8a(this, a10, b10, c10).Pq(w6(/* @__PURE__ */ function(g10, h10, k10, l10, m10, p10) { + return function(t10) { + return t10.pB ? Vlb(qI(), h10, k10, m10, p10) : ZC(hp(), t10); + }; + }(this, a10, b10, c10, e10, f10)), ml()); + }; + function Ulb(a10, b10) { + return lk().h(b10) ? (a10 = Wlb(a10), a10 instanceof z7 && (a10 = a10.i, Cu() === a10) ? nk() : mk()) : ok2().h(b10) ? (a10 = Wlb(a10), a10 instanceof z7 && (a10 = a10.i, Qb() === a10) ? qk() : pk()) : b10; + } + function Xlb(a10, b10, c10) { + var e10 = qq().cK; + e10 = new wq().Yn(e10); + var f10 = Rb(Gb().ab, H10()); + var g10 = e10.th; + e10 = g10.ze; + g10 = pD(g10); + for (var h10 = e10.n[g10]; null !== h10; ) { + var k10 = h10.$a(); + h10 = h10.r; + f10 = Tea(h10) ? f10.uq(h10.eO(qI().qi)) : f10; + for (h10 = k10; null === h10 && 0 < g10; ) + g10 = -1 + g10 | 0, h10 = e10.n[g10]; + } + b10 = f10.uq(a10.d0).Ja(b10.Ll); + b10 = b10 instanceof z7 ? new z7().d(Hb(b10.i)) : y7(); + if (b10 instanceof z7) + return b10 = b10.i, b10.RJ.na() ? Gja(Xlb(a10, b10.RJ.c(), c10), b10) : Gja(c10, b10); + if (y7() === b10) + return c10; + throw new x7().d(b10); + } + function Vlb(a10, b10, c10, e10, f10) { + var g10 = Ylb(a10).Ja(c10.Ll); + if (g10 instanceof z7 && (g10 = g10.i, Tea(g10))) { + var h10 = Xlb(a10, c10, Fja()); + return g10.WW(b10, c10, h10, a10.qi, e10, f10); + } + return nq(hp(), oq(/* @__PURE__ */ function(k10, l10, m10) { + return function() { + qI(); + var p10 = Lc(l10); + return aq(new bq(), true, p10.b() ? l10.j : p10.c(), m10, J5(K7(), H10())); + }; + }(a10, b10, c10)), ml()); + } + function Zlb(a10, b10) { + return LT(new wq().Yn(b10.eK).Sb.Ye().Dd(), w6(/* @__PURE__ */ function() { + return function(c10) { + return !Xaa(c10); + }; + }(a10)), false); + } + d7.gi = function() { + return this.Ig; + }; + d7.wr = function() { + var a10 = K7(), b10 = [kq(), Ec(), lq()]; + return J5(a10, new Ib().ha(b10)); + }; + function Ylb(a10) { + var b10 = qq().cK; + b10 = new wq().Yn(b10); + var c10 = null; + c10 = Rb(Gb().ab, H10()); + var e10 = b10.th; + b10 = e10.ze; + e10 = pD(e10); + for (var f10 = b10.n[e10]; null !== f10; ) { + var g10 = f10.$a(); + f10 = f10.r; + if (Tea(f10)) { + var h10 = f10.eO(qI().qi); + h10 = pd(h10); + var k10 = Rb(Gb().ab, H10()); + f10 = Tc(h10, k10, Uc(/* @__PURE__ */ function(l10, m10) { + return function(p10, t10) { + return p10.Wh(t10, m10); + }; + }(a10, f10))); + c10 = c10.uq(f10); + } + for (f10 = g10; null === f10 && 0 < e10; ) + e10 = -1 + e10 | 0, f10 = b10.n[e10]; + } + return c10.uq(a10.e0); + } + d7.fp = function() { + hja(bp(), qI()); + yq(zq(), "Register RDF framework"); + this.qi.bda(new z7().d(sra().gh)); + yq(zq(), "AMFValidatorPlugin#init: registering validation dialect"); + var a10 = Ec().kq, b10 = this.Hea, c10 = Rra(); + return QMa(a10, b10, c10).Yg(w6(/* @__PURE__ */ function() { + return function() { + yq(zq(), "AMFValidatorPlugin#init: validation dialect registered"); + return qI(); + }; + }(this)), ml()); + }; + function Wlb(a10) { + if (a10 instanceof mf) { + a10 = Ab(a10.qe().fa(), q5(rU)); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Se); + } + if (a10 instanceof bg) { + a10 = Ab(a10.x, q5(rU)); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Se); + } + if (Kk(a10)) { + a10 = Ab(a10.qe().fa(), q5(rU)); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.Se); + } + return y7(); + } + d7.oba = function(a10, b10) { + var c10 = new z7().d("application/yaml"), e10 = new z7().d(Ec().Ig), f10 = Kea(Zo(), this.qi), g10 = new $o().a(); + ap(); + var h10 = Lea(); + ap(); + var k10 = y7(); + ap(); + var l10 = new kp().a(); + return Mea(ap(), a10, c10, e10, f10, h10, g10, k10, b10, l10).Yg(w6(/* @__PURE__ */ function() { + return function(m10) { + if (m10 instanceof pO) { + var p10 = B6(m10.g, qO().ig), t10 = qI().Hea; + if (xb(p10, t10)) + return B6(m10.g, qO().nb); + } + throw mb(E6(), new nb().e("Trying to load as a validation profile that does not match the Validation Profile dialect")); + }; + }(this)), ml()).Yg(w6(/* @__PURE__ */ function(m10) { + return function(p10) { + if (p10 instanceof uO) { + var t10 = tj(p10); + t10 = B6(t10.g, t10.R); + if (xb(t10, "profileNode")) { + lJa || (lJa = new SR().a()); + p10 = kJa(p10); + t10 = Ylb(qI()).Ja(p10.$.Ll); + if (t10 instanceof z7) + t10 = t10.i; + else { + if (y7() !== t10) + throw new x7().d(t10); + t10 = Ylb(qI()); + var v10 = p10.RJ; + v10 = v10.b() ? kk() : v10.c(); + t10 = t10.Ja(v10.Ll); + if (t10 instanceof z7) + t10 = t10.i; + else { + if (y7() !== t10) + throw new x7().d(t10); + t10 = Ec(); + } + } + v10 = qI(); + var A10 = qI().d0; + v10.d0 = A10.cc(new R6().M(p10.$.Ll, oq(/* @__PURE__ */ function(D10, C10) { + return function() { + return C10; + }; + }(m10, p10)))); + v10 = qI(); + A10 = qI().e0; + v10.e0 = A10.cc(new R6().M(p10.$.Ll, t10)); + return p10.$; + } + } + throw mb(E6(), new nb().e("Trying to load as a validation profile that does not match the Validation Profile dialect")); + }; + }(this)), ml()); + }; + function $lb(a10, b10, c10, e10) { + var f10 = zq(), g10 = new wq().Yn(c10.eK); + yq(f10, "AMFValidatorPlugin#shaclValidation: shacl validation for " + g10.Sb.jb() + " validations"); + f10 = new aE().Uj(y7()); + g10 = new wq().Yn(c10.eK); + f10 = Ara(f10, g10.Sb.Ye().Dd()); + f10 instanceof z7 && (f10 = f10.i, GSa(sra().gh, Hra(), f10)); + yq(zq(), "AMFValidatorPlugin#shaclValidation: jsLibrary generated"); + c10 = Zlb(a10, c10); + yq(zq(), "AMFValidatorPlugin#shaclValidation: Invoking platform validation"); + return ESa(sra().gh, b10, c10, e10).Yg( + w6(/* @__PURE__ */ function() { + return function(h10) { + yq(zq(), "AMFValidatorPlugin#shaclValidation: validation finished"); + return h10; + }; + }(a10)), + ml() + ); + } + d7.aea = function(a10, b10, c10, e10) { + if ("partial" === e10.zm) { + var f10 = new Vqa(); + f10.oi = a10; + f10.Bf = b10; + f10.Jja = c10; + f10.wc = e10; + f10.VW = new KR().bL(H10()); + a10 = kra(f10); + } else + a10 = $lb(this, a10, b10, e10); + return a10; + }; + d7.b$ = function(a10) { + var b10 = Xlb(this, a10, Fja()); + a10 = new cE().f1(a10); + b10 = Zlb(this, b10); + Vua || (Vua = new BH().a()); + b10 = Gra(a10, b10); + a10 = new Wq().a(); + var c10 = cfa(); + try { + zH(Uua(Sua(a10, c10), b10.Fd), "\n"); + } finally { + new Aj().d(a10); + } + return a10.t(); + }; + d7.$classData = r8({ O1a: 0 }, false, "amf.plugins.features.validation.AMFValidatorPlugin$", { O1a: 1, Qha: 1, f: 1, Aga: 1, Zr: 1, OCa: 1, dD: 1, ib: 1 }); + var Tlb = void 0; + function qI() { + Tlb || (Tlb = new Slb().a()); + return Tlb; + } + function amb() { + this.Cg = false; + } + amb.prototype = new S8a(); + amb.prototype.constructor = amb; + function bmb() { + } + bmb.prototype = amb.prototype; + amb.prototype.xS = function(a10) { + a10 = null === a10 ? "null" : ka(a10); + cmb(this, null === a10 ? "null" : a10); + }; + function er(a10, b10) { + cmb(a10, null === b10 ? "null" : b10); + cmb(a10, "\n"); + } + function dmb() { + x62.call(this); + this.Ss = false; + } + dmb.prototype = new Hfb(); + dmb.prototype.constructor = dmb; + d7 = dmb.prototype; + d7.EP = function(a10) { + if (this.Ss) + throw new VE().a(); + var b10 = this.ud; + if (b10 === this.Ze) + throw new RE().a(); + this.ud = 1 + b10 | 0; + this.bj.n[this.Mk + b10 | 0] = a10; + }; + d7.bI = function(a10, b10) { + return this.pea(a10, b10); + }; + d7.AO = function() { + var a10 = this.ud; + if (a10 === this.Ze) + throw new Lv().a(); + this.ud = 1 + a10 | 0; + return this.bj.n[this.Mk + a10 | 0]; + }; + function KSa(a10, b10, c10, e10, f10, g10) { + var h10 = new dmb(); + h10.Ss = g10; + x62.prototype.cla.call(h10, a10, b10, c10); + KE.prototype.qg.call(h10, e10); + KE.prototype.J1.call(h10, f10); + return h10; + } + d7.pea = function(a10, b10) { + if (0 > a10 || b10 < a10 || b10 > (this.Ze - this.ud | 0)) + throw new U6().a(); + return KSa(this.By, this.bj, this.Mk, this.ud + a10 | 0, this.ud + b10 | 0, this.Ss); + }; + d7.Ska = function(a10, b10, c10) { + if (0 > b10 || 0 > c10 || b10 > (a10.n.length - c10 | 0)) + throw new U6().a(); + var e10 = this.ud, f10 = e10 + c10 | 0; + if (f10 > this.Ze) + throw new Lv().a(); + this.ud = f10; + Ba(this.bj, this.Mk + e10 | 0, a10, b10, c10); + }; + d7.Tka = function(a10) { + if (0 > a10 || a10 >= this.Ze) + throw new U6().a(); + return this.bj.n[this.Mk + a10 | 0]; + }; + d7.dqa = function(a10, b10) { + this.bj.n[this.Mk + a10 | 0] = b10; + }; + d7.aV = function(a10) { + return this.bj.n[this.Mk + a10 | 0]; + }; + d7.cqa = function(a10, b10, c10, e10) { + Ba(b10, c10, this.bj, this.Mk + a10 | 0, e10); + }; + d7.hH = function() { + return this.Ss; + }; + d7.$classData = r8({ P2a: 0 }, false, "java.nio.HeapCharBuffer", { P2a: 1, L2a: 1, Rha: 1, f: 1, ym: 1, eP: 1, SU: 1, U7a: 1 }); + function emb() { + x62.call(this); + this.gL = null; + this.hL = 0; + } + emb.prototype = new Hfb(); + emb.prototype.constructor = emb; + d7 = emb.prototype; + d7.EP = function() { + throw new VE().a(); + }; + d7.bI = function(a10, b10) { + return this.pea(a10, b10); + }; + d7.AO = function() { + var a10 = this.ud; + if (a10 === this.Ze) + throw new Lv().a(); + this.ud = 1 + a10 | 0; + return xa(this.gL, this.hL + a10 | 0); + }; + d7.t = function() { + var a10 = this.hL; + return ka(ya(this.gL, this.ud + a10 | 0, this.Ze + a10 | 0)); + }; + function xsa(a10, b10, c10, e10, f10) { + var g10 = new emb(); + g10.gL = b10; + g10.hL = c10; + x62.prototype.cla.call(g10, a10, null, -1); + KE.prototype.qg.call(g10, e10); + KE.prototype.J1.call(g10, f10); + return g10; + } + d7.pea = function(a10, b10) { + if (0 > a10 || b10 < a10 || b10 > (this.Ze - this.ud | 0)) + throw new U6().a(); + return xsa(this.By, this.gL, this.hL, this.ud + a10 | 0, this.ud + b10 | 0); + }; + d7.Ska = function(a10, b10, c10) { + if (0 > b10 || 0 > c10 || b10 > (a10.n.length - c10 | 0)) + throw new U6().a(); + var e10 = this.ud, f10 = e10 + c10 | 0; + if (f10 > this.Ze) + throw new Lv().a(); + this.ud = f10; + for (c10 = e10 + c10 | 0; e10 !== c10; ) { + f10 = b10; + var g10 = xa(this.gL, this.hL + e10 | 0); + a10.n[f10] = g10; + e10 = 1 + e10 | 0; + b10 = 1 + b10 | 0; + } + }; + d7.Tka = function(a10) { + if (0 > a10 || a10 >= this.Ze) + throw new U6().a(); + return xa(this.gL, this.hL + a10 | 0); + }; + d7.dqa = function() { + throw new VE().a(); + }; + d7.aV = function(a10) { + return xa(this.gL, this.hL + a10 | 0); + }; + d7.cqa = function() { + throw new VE().a(); + }; + d7.hH = function() { + return true; + }; + d7.$classData = r8({ R2a: 0 }, false, "java.nio.StringCharBuffer", { R2a: 1, L2a: 1, Rha: 1, f: 1, ym: 1, eP: 1, SU: 1, U7a: 1 }); + function M42() { + CF.call(this); + } + M42.prototype = new m_(); + M42.prototype.constructor = M42; + d7 = M42.prototype; + d7.a = function() { + CF.prototype.Ge.call(this, null, null); + return this; + }; + d7.H = function() { + return "LimitReachedException"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof M42 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ j3a: 0 }, false, "org.mulesoft.common.io.LimitReachedException", { j3a: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function fmb() { + this.Rf = null; + this.bg = this.Yf = this.If = this.rf = this.pA = this.Au = 0; + } + fmb.prototype = new u7(); + fmb.prototype.constructor = fmb; + d7 = fmb.prototype; + d7.H = function() { + return "SourceLocation"; + }; + d7.E = function() { + return 7; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof fmb ? this.Rf === a10.Rf && this.Au === a10.Au && this.pA === a10.pA && this.rf === a10.rf && this.If === a10.If && this.Yf === a10.Yf && this.bg === a10.bg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Rf; + case 1: + return this.Au; + case 2: + return this.pA; + case 3: + return this.rf; + case 4: + return this.If; + case 5: + return this.Yf; + case 6: + return this.bg; + default: + throw new U6().e("" + a10); + } + }; + d7.Yx = function() { + return 0 === this.rf && 0 === this.If && 0 === this.Yf && 0 === this.bg && 0 === this.Au && 0 === this.pA; + }; + d7.t = function() { + var a10 = this.Rf; + if (null === a10) + throw new sf().a(); + return ("" === a10 ? "Unknown" : this.Rf) + ((0 >= this.Au && 0 >= this.pA && 1 !== this.rf && 1 !== this.Yf) & 0 !== this.If && 0 !== this.bg ? "" : "[" + this.Au + "," + this.pA + "]") + (0 >= this.rf && 0 >= this.Yf ? "" : ": " + this.rf + "," + this.If + ".." + this.Yf + "," + this.bg); + }; + d7.tr = function(a10) { + return gmb(this, a10); + }; + d7.gs = function(a10) { + return gmb(this, a10); + }; + function nha(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new fmb(); + k10.Rf = a10; + k10.Au = b10; + k10.pA = c10; + k10.rf = e10; + k10.If = f10; + k10.Yf = g10; + k10.bg = h10; + return k10; + } + function gmb(a10, b10) { + if (a10.Rf !== b10.Rf) + return a10 = a10.Rf, b10 = b10.Rf, a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + if (a10.Au !== b10.Au) + return a10 = a10.Au, b10 = b10.Au, a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + if (a10.rf !== b10.rf) + return a10 = a10.rf, b10 = b10.rf, a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + a10 = a10.If; + b10 = b10.If; + return a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + } + function oua(a10, b10) { + var c10 = zs().Hq; + if (a10.h(c10)) + return b10; + c10 = zs().Hq; + return (null === b10 ? null === c10 : b10.h(c10)) ? a10 : pua(zs(), a10.Rf, uF(vF(), a10.rf, a10.If, a10.Au), uF(vF(), b10.Yf, b10.bg, b10.pA)); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Rf)); + a10 = OJ().Ga(a10, this.Au); + a10 = OJ().Ga(a10, this.pA); + a10 = OJ().Ga(a10, this.rf); + a10 = OJ().Ga(a10, this.If); + a10 = OJ().Ga(a10, this.Yf); + a10 = OJ().Ga(a10, this.bg); + return OJ().fe(a10, 7); + }; + d7.$classData = r8({ L3a: 0 }, false, "org.mulesoft.lexer.SourceLocation", { L3a: 1, f: 1, cM: 1, ym: 1, y: 1, v: 1, q: 1, o: 1 }); + function BF() { + CF.call(this); + this.L3 = null; + } + BF.prototype = new m_(); + BF.prototype.constructor = BF; + d7 = BF.prototype; + d7.H = function() { + return "AjaxException"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof BF ? Va(Wa(), this.L3, a10.L3) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.L3; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ P3a: 0 }, false, "org.scalajs.dom.ext.AjaxException", { P3a: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function zI() { + this.Aja = null; + } + zI.prototype = new u7(); + zI.prototype.constructor = zI; + zI.prototype.ap = function(a10, b10) { + return this.Aja.ap(a10, b10); + }; + zI.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + zI.prototype.$classData = r8({ f8a: 0 }, false, "java.util.Arrays$$anon$3", { f8a: 1, f: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + function TK() { + CF.call(this); + this.zG = null; + } + TK.prototype = new z6(); + TK.prototype.constructor = TK; + TK.prototype.xo = function() { + return "Flags = '" + this.zG + "'"; + }; + TK.prototype.e = function(a10) { + this.zG = a10; + CF.prototype.Ge.call(this, null, null); + if (null === a10) + throw new sf().a(); + return this; + }; + TK.prototype.$classData = r8({ i8a: 0 }, false, "java.util.DuplicateFormatFlagsException", { i8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function wZa() { + CF.call(this); + this.zG = null; + this.lG = 0; + } + wZa.prototype = new z6(); + wZa.prototype.constructor = wZa; + wZa.prototype.xo = function() { + return "Conversion = " + gc(this.lG) + ", Flags = " + this.zG; + }; + wZa.prototype.$classData = r8({ j8a: 0 }, false, "java.util.FormatFlagsConversionMismatchException", { j8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function ZK() { + CF.call(this); + this.lG = 0; + } + ZK.prototype = new z6(); + ZK.prototype.constructor = ZK; + ZK.prototype.xo = function() { + return "Code point = 0x" + (+(this.lG >>> 0)).toString(16); + }; + ZK.prototype.ue = function(a10) { + this.lG = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + ZK.prototype.$classData = r8({ n8a: 0 }, false, "java.util.IllegalFormatCodePointException", { n8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function zZa() { + CF.call(this); + this.lG = 0; + this.eja = null; + } + zZa.prototype = new z6(); + zZa.prototype.constructor = zZa; + zZa.prototype.xo = function() { + return ba.String.fromCharCode(this.lG) + " != " + Fj(this.eja); + }; + zZa.prototype.$classData = r8({ o8a: 0 }, false, "java.util.IllegalFormatConversionException", { o8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function cL() { + CF.call(this); + this.zG = null; + } + cL.prototype = new z6(); + cL.prototype.constructor = cL; + cL.prototype.xo = function() { + return "Flags = '" + this.zG + "'"; + }; + cL.prototype.e = function(a10) { + this.zG = a10; + CF.prototype.Ge.call(this, null, null); + if (null === a10) + throw new sf().a(); + return this; + }; + cL.prototype.$classData = r8({ p8a: 0 }, false, "java.util.IllegalFormatFlagsException", { p8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function YK() { + CF.call(this); + this.Una = 0; + } + YK.prototype = new z6(); + YK.prototype.constructor = YK; + YK.prototype.xo = function() { + return "" + this.Una; + }; + YK.prototype.ue = function(a10) { + this.Una = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + YK.prototype.$classData = r8({ q8a: 0 }, false, "java.util.IllegalFormatPrecisionException", { q8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function dL() { + CF.call(this); + this.Vqa = 0; + } + dL.prototype = new z6(); + dL.prototype.constructor = dL; + dL.prototype.xo = function() { + return "" + this.Vqa; + }; + dL.prototype.ue = function(a10) { + this.Vqa = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + dL.prototype.$classData = r8({ r8a: 0 }, false, "java.util.IllegalFormatWidthException", { r8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function VK() { + CF.call(this); + this.PH = null; + } + VK.prototype = new z6(); + VK.prototype.constructor = VK; + VK.prototype.xo = function() { + return "Format specifier '" + this.PH + "'"; + }; + VK.prototype.e = function(a10) { + this.PH = a10; + CF.prototype.Ge.call(this, null, null); + if (null === a10) + throw new sf().a(); + return this; + }; + VK.prototype.$classData = r8({ s8a: 0 }, false, "java.util.MissingFormatArgumentException", { s8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function UK() { + CF.call(this); + this.PH = null; + } + UK.prototype = new z6(); + UK.prototype.constructor = UK; + UK.prototype.xo = function() { + return this.PH; + }; + UK.prototype.e = function(a10) { + this.PH = a10; + CF.prototype.Ge.call(this, null, null); + if (null === a10) + throw new sf().a(); + return this; + }; + UK.prototype.$classData = r8({ t8a: 0 }, false, "java.util.MissingFormatWidthException", { t8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function SK() { + CF.call(this); + this.PH = null; + } + SK.prototype = new z6(); + SK.prototype.constructor = SK; + SK.prototype.xo = function() { + return "Conversion = '" + this.PH + "'"; + }; + SK.prototype.e = function(a10) { + this.PH = a10; + CF.prototype.Ge.call(this, null, null); + if (null === a10) + throw new sf().a(); + return this; + }; + SK.prototype.$classData = r8({ v8a: 0 }, false, "java.util.UnknownFormatConversionException", { v8a: 1, sE: 1, Zx: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1 }); + function RUa() { + R6.call(this); + this.$4 = this.FI = 0; + } + RUa.prototype = new dgb(); + RUa.prototype.constructor = RUa; + d7 = RUa.prototype; + d7.JM = function() { + return this.FI; + }; + d7.a5 = function() { + return this.$4; + }; + d7.ya = function() { + return gc(this.$4); + }; + d7.ma = function() { + return this.FI; + }; + d7.$classData = r8({ l9a: 0 }, false, "scala.Tuple2$mcIC$sp", { l9a: 1, d_: 1, f: 1, tda: 1, y: 1, v: 1, q: 1, o: 1 }); + function E7() { + this.zka = null; + } + E7.prototype = new u7(); + E7.prototype.constructor = E7; + function UC(a10) { + var b10 = new E7(); + b10.zka = a10; + return b10; + } + E7.prototype.ap = function(a10, b10) { + return raa(this.zka.P(a10), b10); + }; + E7.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + E7.prototype.$classData = r8({ H9a: 0 }, false, "scala.math.LowPriorityOrderingImplicits$$anon$3", { H9a: 1, f: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + function F7() { + this.nv = this.l = null; + } + F7.prototype = new u7(); + F7.prototype.constructor = F7; + F7.prototype.ap = function(a10, b10) { + return this.l.ap(this.nv.P(a10), this.nv.P(b10)); + }; + function hmb(a10, b10) { + var c10 = new F7(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + c10.nv = b10; + return c10; + } + F7.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + F7.prototype.$classData = r8({ L9a: 0 }, false, "scala.math.Ordering$$anon$2", { L9a: 1, f: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + function OR() { + this.Y_ = null; + } + OR.prototype = new u7(); + OR.prototype.constructor = OR; + OR.prototype.d1 = function(a10) { + this.Y_ = a10; + return this; + }; + OR.prototype.ap = function(a10, b10) { + return this.Y_.ug(a10, b10) ? -1 : this.Y_.ug(b10, a10) ? 1 : 0; + }; + OR.prototype.wE = function(a10, b10) { + return !this.Y_.ug(b10, a10); + }; + OR.prototype.$classData = r8({ M9a: 0 }, false, "scala.math.Ordering$$anon$6", { M9a: 1, f: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + function eT() { + this.C2 = null; + } + eT.prototype = new u7(); + eT.prototype.constructor = eT; + d7 = eT.prototype; + d7.zs = function(a10) { + var b10 = this.Lo(); + return b10 === q5(Oa) ? ja(Ja(Oa), [a10]) : b10 === q5(Pa) ? ja(Ja(Pa), [a10]) : b10 === q5(Na) ? ja(Ja(Na), [a10]) : b10 === q5(Qa) ? ja(Ja(Qa), [a10]) : b10 === q5(Ra) ? ja(Ja(Ra), [a10]) : b10 === q5(Sa) ? ja(Ja(Sa), [a10]) : b10 === q5(Ta) ? ja(Ja(Ta), [a10]) : b10 === q5(Ma) ? ja(Ja(Ma), [a10]) : b10 === q5(Ka) ? ja(Ja(oa), [a10]) : Mu(Nu(), this.Lo(), a10); + }; + d7.h = function(a10) { + if (a10 && a10.$classData && a10.$classData.ge.Iu) { + var b10 = this.Lo(); + a10 = a10.Lo(); + b10 = b10 === a10; + } else + b10 = false; + return b10; + }; + d7.t = function() { + return i9a(this, this.C2); + }; + d7.Lo = function() { + return this.C2; + }; + d7.$K = function(a10) { + this.C2 = a10; + return this; + }; + d7.z = function() { + return NJ(OJ(), this.C2); + }; + d7.$classData = r8({ T9a: 0 }, false, "scala.reflect.ClassTag$GenericClassTag", { T9a: 1, f: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + function G7() { + this.u = null; + } + G7.prototype = new H6(); + G7.prototype.constructor = G7; + G7.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + G7.prototype.Qd = function() { + pj(); + return new Lf().a(); + }; + G7.prototype.$classData = r8({ kab: 0 }, false, "scala.collection.Seq$", { kab: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var imb = void 0; + function K7() { + imb || (imb = new G7().a()); + return imb; + } + function jmb() { + this.u = null; + } + jmb.prototype = new H6(); + jmb.prototype.constructor = jmb; + function kmb() { + } + kmb.prototype = jmb.prototype; + function H7() { + } + H7.prototype = new lWa(); + H7.prototype.constructor = H7; + H7.prototype.a = function() { + lmb = this; + new JT().d1(Uc(/* @__PURE__ */ function() { + return function(a10) { + return a10; + }; + }(this))); + return this; + }; + function mmb(a10, b10, c10, e10, f10, g10, h10) { + var k10 = 31 & (b10 >>> g10 | 0), l10 = 31 & (e10 >>> g10 | 0); + if (k10 !== l10) + return a10 = 1 << k10 | 1 << l10, b10 = ja(Ja(I7), [2]), k10 < l10 ? (b10.n[0] = c10, b10.n[1] = f10) : (b10.n[0] = f10, b10.n[1] = c10), J7(a10, b10, h10); + l10 = ja(Ja(I7), [1]); + k10 = 1 << k10; + l10.n[0] = mmb(a10, b10, c10, e10, f10, 5 + g10 | 0, h10); + return J7(k10, l10, h10); + } + H7.prototype.tG = function() { + return K72(); + }; + H7.prototype.$classData = r8({ abb: 0 }, false, "scala.collection.immutable.HashMap$", { abb: 1, Apa: 1, hM: 1, gM: 1, f: 1, cib: 1, q: 1, o: 1 }); + var lmb = void 0; + function L7() { + lmb || (lmb = new H7().a()); + return lmb; + } + function M7() { + this.u = null; + } + M7.prototype = new H6(); + M7.prototype.constructor = M7; + M7.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + M7.prototype.Qd = function() { + return new Lf().a(); + }; + M7.prototype.$classData = r8({ Pbb: 0 }, false, "scala.collection.immutable.Seq$", { Pbb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var nmb = void 0; + function pj() { + nmb || (nmb = new M7().a()); + return nmb; + } + function N7() { + } + N7.prototype = new u7(); + N7.prototype.constructor = N7; + function O72() { + } + O72.prototype = N7.prototype; + N7.prototype.zt = function(a10, b10) { + MT(this, a10, b10); + }; + N7.prototype.pj = function() { + }; + N7.prototype.jh = function(a10) { + return yi(this, a10); + }; + function P7() { + this.u = null; + } + P7.prototype = new H6(); + P7.prototype.constructor = P7; + P7.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + P7.prototype.Qd = function() { + return new Xj().a(); + }; + P7.prototype.$classData = r8({ Bdb: 0 }, false, "scala.collection.mutable.IndexedSeq$", { Bdb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var omb = void 0; + function pmb() { + omb || (omb = new P7().a()); + return omb; + } + function Q7() { + this.u = null; + } + Q7.prototype = new H6(); + Q7.prototype.constructor = Q7; + Q7.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + Q7.prototype.Qd = function() { + return new Xj().a(); + }; + Q7.prototype.$classData = r8({ aeb: 0 }, false, "scala.collection.mutable.Seq$", { aeb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var qmb = void 0; + function oi() { + qmb || (qmb = new Q7().a()); + return qmb; + } + function R7() { + this.u = null; + } + R7.prototype = new H6(); + R7.prototype.constructor = R7; + R7.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + R7.prototype.Qd = function() { + return new Ib().a(); + }; + R7.prototype.$classData = r8({ Eeb: 0 }, false, "scala.scalajs.js.WrappedArray$", { Eeb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var rmb = void 0; + function vk() { + rmb || (rmb = new R7().a()); + return rmb; + } + function wL() { + this.A = this.Li = this.BN = null; + } + wL.prototype = new u7(); + wL.prototype.constructor = wL; + d7 = wL.prototype; + d7.H = function() { + return "AnyField"; + }; + d7.uC = function(a10) { + return Iaa(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wL) { + var b10 = this.BN; + a10 = a10.BN; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return Xa(this); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.BN; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Xa(this); + }; + d7.xD = function() { + ab(); + var a10 = this.BN.x; + To(); + return new Uo().dq(a10); + }; + d7.AC = function() { + var a10 = this.Li; + return a10.b() ? null : a10.c(); + }; + d7.rb = function() { + return this.xD(); + }; + d7.tC = function(a10) { + return Jaa(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.xC = function() { + var a10 = this.BN; + it2(a10.l, a10.Lc); + }; + wL.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(wL.prototype, "nonNull", { get: function() { + return this.Li.na(); + }, configurable: true }); + Object.defineProperty(wL.prototype, "isNull", { get: function() { + return this.Li.b(); + }, configurable: true }); + wL.prototype.is = function(a10) { + return Haa(a10) ? this.tC(a10) : this.uC(a10); + }; + wL.prototype.remove = function() { + return this.xC(); + }; + wL.prototype.value = function() { + return this.AC(); + }; + wL.prototype.annotations = function() { + return this.rb(); + }; + Object.defineProperty(wL.prototype, "option", { get: function() { + return this.A; + }, configurable: true }); + wL.prototype.$classData = r8({ Sta: 0 }, false, "amf.client.model.AnyField", { Sta: 1, f: 1, BY: 1, gc: 1, CY: 1, y: 1, v: 1, q: 1, o: 1 }); + function S7() { + this.A = this.Li = this.FN = null; + } + S7.prototype = new u7(); + S7.prototype.constructor = S7; + d7 = S7.prototype; + d7.H = function() { + return "StrField"; + }; + d7.uC = function(a10) { + return Iaa(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof S7) { + var b10 = this.FN; + a10 = a10.FN; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return Xa(this); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.FN; + default: + throw new U6().e("" + a10); + } + }; + function smb(a10) { + a10 = a10.Li; + if (a10.b()) + return true; + a10 = a10.c(); + if (null === a10) + throw new sf().a(); + return "" === a10; + } + d7.t = function() { + return Xa(this); + }; + d7.xD = function() { + ab(); + var a10 = this.FN.x; + To(); + return new Uo().dq(a10); + }; + d7.AC = function() { + var a10 = this.Li; + return a10.b() ? null : a10.c(); + }; + d7.rb = function() { + return this.xD(); + }; + d7.tC = function(a10) { + return Jaa(this, a10); + }; + d7.z = function() { + return X5(this); + }; + function gb(a10) { + var b10 = new S7(); + b10.FN = a10; + b10.Li = a10.A; + a10 = ab(); + var c10 = b10.Li, e10 = ab().Lf(); + b10.A = bb(a10, c10, e10).Ra(); + return b10; + } + d7.Da = function() { + return !smb(this); + }; + d7.xC = function() { + var a10 = this.FN; + it2(a10.l, a10.Lc); + }; + S7.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(S7.prototype, "nonNull", { get: function() { + return this.Li.na(); + }, configurable: true }); + Object.defineProperty(S7.prototype, "isNull", { get: function() { + return this.Li.b(); + }, configurable: true }); + S7.prototype.is = function(a10) { + return Haa(a10) ? this.tC(a10) : this.uC(a10); + }; + S7.prototype.remove = function() { + return this.xC(); + }; + Object.defineProperty(S7.prototype, "nonEmpty", { get: function() { + return this.Da(); + }, configurable: true }); + Object.defineProperty(S7.prototype, "isNullOrEmpty", { get: function() { + return smb(this); + }, configurable: true }); + S7.prototype.value = function() { + return this.AC(); + }; + S7.prototype.annotations = function() { + return this.rb(); + }; + Object.defineProperty(S7.prototype, "option", { get: function() { + return this.A; + }, configurable: true }); + S7.prototype.$classData = r8({ Xta: 0 }, false, "amf.client.model.StrField", { Xta: 1, f: 1, BY: 1, gc: 1, CY: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xm() { + this.ea = this.k = null; + } + Xm.prototype = new u7(); + Xm.prototype.constructor = Xm; + function T7() { + } + d7 = T7.prototype = Xm.prototype; + d7.IQ = function(a10) { + return pab(this, a10); + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Xm.prototype.Gw.call(this, new vh().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.HC = function() { + return M$a2(this); + }; + d7.TQ = function(a10) { + return V$a(this, a10); + }; + d7.Ce = function() { + return this.Jh(); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.oT = function() { + Z10(); + var a10 = B6(this.Jh().Y(), Ag().Sf); + return U_(N52(), a10); + }; + d7.tq = function() { + return oab(this); + }; + d7.vQ = function(a10) { + return fab(this, a10); + }; + d7.Yd = function() { + return qZa(this); + }; + d7.JC = function() { + return this.DT(); + }; + d7.Gw = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.DT = function() { + var a10 = Z10(), b10 = B6(this.Jh().Y(), Ag().Ec), c10 = P52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.UQ = function(a10) { + return Y$a(this, a10); + }; + d7.tQ = function(a10) { + return X$a(this, a10); + }; + d7.Oc = function() { + return this.Jh(); + }; + d7.uQ = function(a10) { + return hab(this, a10); + }; + d7.Jea = function(a10) { + var b10 = Z10(), c10 = this.Jh(); + a10 = a10.Sv(); + var e10 = fp(); + c10 = Upa(SC(), c10, a10, Yb().qb, e10); + a10 = Z10().no(); + return ll(b10, c10, a10).Ra(); + }; + d7.DC = function(a10) { + var b10 = this.Jh(), c10 = Z10(), e10 = P52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Ag().Ec; + Zd(b10, c10, a10); + return this; + }; + d7.QQ = function(a10) { + return vab(this, a10); + }; + d7.KQ = function(a10) { + return dab(this, a10); + }; + d7.zQ = function(a10) { + return cab(this, a10); + }; + d7.HQ = function(a10) { + return bab(this, a10); + }; + d7.wQ = function(a10) { + return qab(this, a10); + }; + d7.yQ = function(a10) { + return sab(this, a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.BQ = function(a10) { + return gab(this, a10); + }; + d7.AQ = function(a10) { + return this.bX(a10); + }; + d7.IC = function() { + return this.oT(); + }; + d7.Jh = function() { + return this.k; + }; + d7.sq = function(a10) { + return P$a(this, a10); + }; + d7.qI = function(a10) { + var b10 = this.Jh(); + Z10(); + N52(); + a10 = a10.k; + var c10 = Ag().Sf; + Vd(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return this.uE(); + }; + d7.Gj = function() { + return this.uE(); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + return iab(this, a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.Oc().j; + }; + d7.oc = function() { + return this.Jh(); + }; + d7.sh = function() { + return U$a2(this); + }; + d7.U3 = function(a10) { + return this.Jea(a10); + }; + d7.uE = function() { + Z10(); + var a10 = this.Jh().by(); + var b10 = Z10(); + if (null === Z10().uX && null === Z10().uX) { + var c10 = Z10(), e10 = new E_(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.uX = e10; + } + b10 = Z10().uX; + return xu(b10.l.ea, a10); + }; + d7.Td = function(a10) { + return L$a(this, a10); + }; + d7.CQ = function(a10) { + return R$a(this, a10); + }; + d7.SQ = function(a10) { + return wab(this, a10); + }; + d7.xQ = function(a10) { + return aab(this, a10); + }; + d7.bX = function(a10) { + Z10(); + a10 = this.Jh().qF(new z7().d(a10)); + return JWa(P52(), a10); + }; + d7.CC = function(a10) { + return rab(this, a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Xm.prototype.annotations = function() { + return this.rb(); + }; + Xm.prototype.graph = function() { + return jU(this); + }; + Xm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Xm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Xm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Xm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Xm.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Xm.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Xm.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Xm.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Xm.prototype.withThen = function(a10) { + return this.QQ(a10); + }; + Xm.prototype.withElse = function(a10) { + return this.zQ(a10); + }; + Xm.prototype.withIf = function(a10) { + return this.BQ(a10); + }; + Xm.prototype.withDeprecated = function(a10) { + return this.CC(!!a10); + }; + Xm.prototype.withWriteOnly = function(a10) { + return this.TQ(!!a10); + }; + Xm.prototype.withReadOnly = function(a10) { + return this.KQ(!!a10); + }; + Xm.prototype.withCustomShapePropertyDefinition = function(a10) { + return this.vQ(a10); + }; + Xm.prototype.withCustomShapePropertyDefinitions = function(a10) { + return this.wQ(a10); + }; + Xm.prototype.withCustomShapeProperties = function(a10) { + return this.uQ(a10); + }; + Xm.prototype.withDefaultStr = function(a10) { + return this.xQ(a10); + }; + Xm.prototype.withNode = function(a10) { + return this.HQ(a10); + }; + Xm.prototype.withXone = function(a10) { + return this.UQ(a10); + }; + Xm.prototype.withAnd = function(a10) { + return this.tQ(a10); + }; + Xm.prototype.withOr = function(a10) { + return this.IQ(a10); + }; + Xm.prototype.withInherits = function(a10) { + return this.CQ(a10); + }; + Xm.prototype.withValues = function(a10) { + return this.SQ(a10); + }; + Xm.prototype.withDefaultValue = function(a10) { + return this.yQ(a10); + }; + Xm.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Xm.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + Xm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Xm.prototype, "thenShape", { get: function() { + return mab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "elseShape", { get: function() { + return N$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "ifShape", { get: function() { + return lab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "deprecated", { get: function() { + return this.HC(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "writeOnly", { get: function() { + return tab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "readOnly", { get: function() { + return T$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "not", { get: function() { + return O$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "xone", { get: function() { + return nab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "and", { get: function() { + return uab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "or", { get: function() { + return S$a2(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "customShapePropertyDefinitions", { get: function() { + return jab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "customShapeProperties", { get: function() { + return Z$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "inherits", { get: function() { + return W$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "values", { get: function() { + return eab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "defaultValueStr", { get: function() { + return kab(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "defaultValue", { get: function() { + return Q$a(this); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Xm.prototype.inlined = function() { + return Ab(this.Jh().fa(), q5(xcb)).na(); + }; + Xm.prototype.trackedExample = function(a10) { + var b10 = Z10(); + a10 = tmb(this.Jh(), a10); + var c10 = P52(); + return bb(b10, a10, c10).Ra(); + }; + Object.defineProperty(Xm.prototype, "isDefaultEmpty", { get: function() { + return umb(this.Jh()); + }, configurable: true }); + Xm.prototype.parameterValidator = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return b10 = Z10(), c10 = this.Jh(), e10 = fp(), c10 = Wpa(SC(), c10, a10, e10, wp()), e10 = vmb(), bb(b10, c10, e10).Ra(); + case 1: + return e10 = e10[0], b10 = Z10(), c10 = this.Jh(), e10 = e10.k, c10 = Wpa(SC(), c10, a10, e10, wp()), e10 = vmb(), bb(b10, c10, e10).Ra(); + default: + throw "No matching overload"; + } + }; + Xm.prototype.payloadValidator = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + return e10 = e10[0], b10 = Z10(), c10 = this.Jh(), e10 = e10.k, c10 = Wpa(SC(), c10, a10, e10, vp()), e10 = vmb(), bb(b10, c10, e10).Ra(); + case 0: + return b10 = Z10(), c10 = this.Jh(), e10 = fp(), c10 = Wpa(SC(), c10, a10, e10, vp()), e10 = vmb(), bb(b10, c10, e10).Ra(); + default: + throw "No matching overload"; + } + }; + Xm.prototype.validateParameter = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + return b10 = Z10(), c10 = this.Jh(), e10 = fp(), c10 = Spa(SC(), c10, a10, Yb().qb, e10, wp()), e10 = Z10().no(), ll(b10, c10, e10).Ra(); + case 1: + return e10 = e10[0], b10 = Z10(), c10 = this.Jh(), e10 = e10.k, c10 = Spa(SC(), c10, a10, Yb().qb, e10, wp()), e10 = Z10().no(), ll(b10, c10, e10).Ra(); + default: + throw "No matching overload"; + } + }; + Xm.prototype.validate = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + if (sp(a10)) + return e10 = b10 = e10[0], b10 = Z10(), c10 = this.Jh(), e10 = e10.k, c10 = Spa(SC(), c10, a10, Yb().qb, e10, vp()), e10 = Z10().no(), ll(b10, c10, e10).Ra(); + if (a10 instanceof ul) { + var f10 = b10 = e10[0]; + b10 = Z10(); + c10 = this.Jh(); + e10 = a10.Sv(); + f10 = f10.k; + c10 = Upa(SC(), c10, e10, Yb().qb, f10); + e10 = Z10().no(); + return ll(b10, c10, e10).Ra(); + } + throw "No matching overload"; + case 0: + if (sp(a10)) + return b10 = Z10(), c10 = this.Jh(), e10 = fp(), c10 = Spa(SC(), c10, a10, Yb().qb, e10, vp()), e10 = Z10().no(), ll(b10, c10, e10).Ra(); + if (a10 instanceof ul) + return this.U3(a10); + throw "No matching overload"; + default: + throw "No matching overload"; + } + }; + Xm.prototype.buildRamlDatatype = function() { + return aca(this.Jh()); + }; + Object.defineProperty(Xm.prototype, "toRamlDatatype", { get: function() { + var a10 = this.Jh(); + var b10 = Ab(a10.fa(), q5(wmb)); + b10 instanceof z7 ? a10 = b10.i.Vk : (b10 = Ab(a10.fa(), q5(wcb)), a10 = b10 instanceof z7 ? b10.i.Vk : aca(a10)); + return a10; + }, configurable: true }); + Xm.prototype.buildJsonSchema = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 0: + return a10 = this.Jh(), b10 = new Yf().a(), Uba(a10, b10); + case 1: + return a10 = c10[0], b10 = this.Jh(), Oga || (Oga = new Br().a()), c10 = new Yf().a(), c10.qS = a10.$l, c10.F8 = hfa(a10.Bc), Uba(b10, c10); + default: + throw "No matching overload"; + } + }; + Object.defineProperty(Xm.prototype, "toJsonSchema", { get: function() { + var a10 = this.Jh(); + var b10 = Ab(a10.fa(), q5(xh)); + b10 instanceof z7 ? a10 = b10.i.Vk : (b10 = Ab(a10.fa(), q5(vcb)), b10 instanceof z7 ? a10 = b10.i.Vk : (b10 = new Yf().a(), a10 = Uba(a10, b10))); + return a10; + }, configurable: true }); + Xm.prototype.linkCopy = function() { + return this.Kf(); + }; + Xm.prototype.withExample = function(a10) { + return this.AQ(a10); + }; + Xm.prototype.withComment = function(a10) { + var b10 = this.Jh(), c10 = Ag().ir; + eb(b10, c10, a10); + return this; + }; + Xm.prototype.withExamples = function(a10) { + return this.DC(a10); + }; + Xm.prototype.withXMLSerialization = function(a10) { + var b10 = this.Jh(); + Z10(); + xmb(); + a10 = a10.k; + var c10 = Ag().Ln; + Vd(b10, c10, a10); + return this; + }; + Xm.prototype.withDocumentation = function(a10) { + return this.qI(a10); + }; + Object.defineProperty(Xm.prototype, "comment", { get: function() { + Z10(); + var a10 = B6(this.Jh().Y(), Ag().ir); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "examples", { get: function() { + return this.JC(); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "xmlSerialization", { get: function() { + Z10(); + var a10 = B6(this.Jh().Y(), Ag().Ln), b10 = xmb(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(Xm.prototype, "documentation", { get: function() { + return this.IC(); + }, configurable: true }); + Xm.prototype.$classData = r8({ QA: 0 }, false, "amf.client.model.domain.AnyShape", { QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1 }); + function tB() { + this.r = this.$ = this.Xb = null; + } + tB.prototype = new u7(); + tB.prototype.constructor = tB; + d7 = tB.prototype; + d7.H = function() { + return "Aliases"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tB) { + var b10 = this.Xb; + a10 = a10.Xb; + return null === b10 ? null === a10 : r7a(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.hk = function(a10) { + this.Xb = a10; + this.$ = "aliases-array"; + var b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(), g10 = e10.ya(); + if (null !== g10) + return e10 = g10.ma(), g10 = g10.ya(), f10 + "->" + e10 + "::" + g10; + } + throw new x7().d(e10); + }; + }(this)), c10 = qe2(); + c10 = re4(c10); + this.r = Jd(a10, b10, c10).Kg(","); + b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.ya().ma(); + }; + }(this)); + c10 = qe2(); + c10 = re4(c10); + Jd(a10, b10, c10).ke(); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.kM = function(a10) { + var b10 = this.Xb; + a10 = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + if (null !== g10) { + var h10 = g10.ma(), k10 = g10.ya(); + if (null !== k10) + return g10 = k10.ma(), k10 = k10.ya(), k10 = new R6().M(f10.P(g10), k10), new R6().M(h10, k10); + } + throw new x7().d(g10); + }; + }(this, a10)); + var c10 = qe2(); + c10 = re4(c10); + return new tB().hk(Jd(b10, a10, c10)); + }; + var Rc = r8({ Twa: 0 }, false, "amf.core.annotations.Aliases", { Twa: 1, f: 1, Eh: 1, gf: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + tB.prototype.$classData = Rc; + function Kz() { + this.r = this.$ = null; + } + Kz.prototype = new u7(); + Kz.prototype.constructor = Kz; + d7 = Kz.prototype; + d7.a = function() { + this.$ = "auto-generated-name"; + this.r = ""; + return this; + }; + d7.H = function() { + return "AutoGeneratedName"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Kz && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var nN = r8({ Vwa: 0 }, false, "amf.core.annotations.AutoGeneratedName", { Vwa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Kz.prototype.$classData = nN; + function Zh() { + this.r = this.$ = null; + } + Zh.prototype = new u7(); + Zh.prototype.constructor = Zh; + d7 = Zh.prototype; + d7.a = function() { + this.$ = "declared-element"; + this.r = ""; + return this; + }; + d7.H = function() { + return "DeclaredElement"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof Zh && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var cv = r8({ axa: 0 }, false, "amf.core.annotations.DeclaredElement", { axa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Zh.prototype.$classData = cv; + function U7() { + this.r = this.$ = null; + } + U7.prototype = new u7(); + U7.prototype.constructor = U7; + d7 = U7.prototype; + d7.a = function() { + this.$ = "declared-header"; + this.r = ""; + return this; + }; + d7.H = function() { + return "DeclaredHeader"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof U7 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var nFa = r8({ cxa: 0 }, false, "amf.core.annotations.DeclaredHeader", { cxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + U7.prototype.$classData = nFa; + function P1() { + this.r = this.$ = this.vg = null; + } + P1.prototype = new u7(); + P1.prototype.constructor = P1; + d7 = P1.prototype; + d7.H = function() { + return "ExternalFragmentRef"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof P1 ? this.vg === a10.vg : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.vg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.vg = a10; + this.$ = "external-fragment-ref"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var $Za = r8({ jxa: 0 }, false, "amf.core.annotations.ExternalFragmentRef", { jxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + P1.prototype.$classData = $Za; + function be4() { + this.r = this.$ = this.yc = null; + } + be4.prototype = new u7(); + be4.prototype.constructor = be4; + function ymb() { + } + d7 = ymb.prototype = be4.prototype; + d7.H = function() { + return "LexicalInformation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof be4) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.jj = function(a10) { + this.yc = a10; + this.$ = "lexical"; + this.r = a10.t(); + return this; + }; + d7.z = function() { + return X5(this); + }; + var jd = r8({ Y6: 0 }, false, "amf.core.annotations.LexicalInformation", { Y6: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + be4.prototype.$classData = jd; + function Z1() { + this.r = this.$ = this.Se = null; + } + Z1.prototype = new u7(); + Z1.prototype.constructor = Z1; + d7 = Z1.prototype; + d7.H = function() { + return "SourceVendor"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Z1 ? this.Se === a10.Se : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + function Y1(a10, b10) { + a10.Se = b10; + a10.$ = "source-vendor"; + a10.r = b10.ve(); + return a10; + } + d7.z = function() { + return X5(this); + }; + var rU = r8({ Kxa: 0 }, false, "amf.core.annotations.SourceVendor", { Kxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Z1.prototype.$classData = rU; + function ah() { + this.Ae = this.hs = this.Ba = this.la = null; + } + ah.prototype = new u7(); + ah.prototype.constructor = ah; + d7 = ah.prototype; + d7.H = function() { + return "ValueEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ah) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.hs, a10 = a10.hs, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.hs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = false, c10 = null, e10 = this.hs; + a: { + if (e10 instanceof z7 && (b10 = true, c10 = e10, e10 = c10.i, Q5().cj === e10)) { + b10 = new qg().e(ka(this.Ba.r.r.r)); + b10 = Oj(va(), b10.ja); + c10 = "" + Aa(+ba.Math.floor(b10)); + break a; + } + if (b10 && (b10 = c10.i, Q5().of === b10)) { + b10 = new qg().e(ka(this.Ba.r.r.r)); + b10 = "" + Oj(va(), b10.ja); + Ed(ua(), b10, ".0") ? (c10 = b10.indexOf(".0") | 0, c10 = b10.substring(0, c10)) : c10 = b10; + break a; + } + c10 = this.Ba.r.r.r; + } + T6(); + b10 = this.la; + b10 = mh(T6(), b10); + T6(); + c10 = nr(or(), c10); + e10 = this.hs; + c10 = mr(0, c10, e10.b() ? this.Ae : e10.c()); + sr(a10, b10, c10); + }; + d7.z = function() { + return X5(this); + }; + function $g(a10, b10, c10, e10) { + a10.la = b10; + a10.Ba = c10; + a10.hs = e10; + AAa(a10); + return a10; + } + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.wia = function(a10) { + this.Ae = a10; + }; + d7.$classData = r8({ gya: 0 }, false, "amf.core.emitter.BaseEmitters.package$ValueEmitter", { gya: 1, f: 1, Xxa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function zmb() { + } + zmb.prototype = new u7(); + zmb.prototype.constructor = zmb; + d7 = zmb.prototype; + d7.a = function() { + return this; + }; + d7.zb = function(a10) { + return a10; + }; + d7.ap = function() { + return 1; + }; + d7.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + d7.$classData = r8({ nya: 0 }, false, "amf.core.emitter.SpecOrdering$Default$", { nya: 1, f: 1, lya: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + var Amb = void 0; + function Fqa() { + Amb || (Amb = new zmb().a()); + return Amb; + } + function Bmb() { + } + Bmb.prototype = new u7(); + Bmb.prototype.constructor = Bmb; + d7 = Bmb.prototype; + d7.a = function() { + return this; + }; + d7.zb = function(a10) { + var b10 = a10.Dm(w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.La().Yx(); + }; + }(this))); + if (null !== b10) { + a10 = b10.ma(); + b10 = b10.ya().nk(this); + var c10 = K7(); + return b10.ia(a10, c10.u); + } + throw new x7().d(b10); + }; + d7.ap = function(a10, b10) { + return a10.La().ID(b10.La()); + }; + d7.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + d7.$classData = r8({ oya: 0 }, false, "amf.core.emitter.SpecOrdering$Lexical$", { oya: 1, f: 1, lya: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + var Cmb = void 0; + function tD() { + Cmb || (Cmb = new Bmb().a()); + return Cmb; + } + function Dmb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.g = this.ba = this.qa = null; + } + Dmb.prototype = new u7(); + Dmb.prototype.constructor = Dmb; + d7 = Dmb.prototype; + d7.a = function() { + Emb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + this.qa = tb( + new ub(), + vb().hg, + "Document", + "A Document is a parsing Unit that encodes a stand-alone DomainElement and can include references to other DomainElements that reference from the encoded DomainElement.\nSince it encodes a DomainElement, but also declares references, it behaves like a Fragment and a Module at the same time.\nThe main difference is that the Document encoded DomainElement is stand-alone and that the references declared are supposed to be private not for re-use from other Units", + H10() + ); + return this; + }; + d7.uD = function(a10) { + this.g = a10; + }; + d7.nc = function() { + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new mf().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function(a10) { + this.ba = a10; + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Lya: 0 }, false, "amf.core.metamodel.document.DocumentModel$", { Lya: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1 }); + var Emb = void 0; + function Gk() { + Emb || (Emb = new Dmb().a()); + return Emb; + } + function Fmb() { + this.wd = this.bb = this.mc = this.Zc = this.Va = this.qa = this.ba = this.g = this.Jc = this.DF = this.la = this.R = null; + this.xa = 0; + } + Fmb.prototype = new u7(); + Fmb.prototype.constructor = Fmb; + d7 = Fmb.prototype; + d7.a = function() { + Gmb = this; + Cr(this); + uU(this); + Laa(this); + pb(this); + var a10 = qb(), b10 = F6().Tb; + this.la = this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "name for an entity", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Ul; + this.DF = rb(new sb(), a10, G5(b10, "domain"), tb(new ub(), ci().Ul, "domain", "RDFS domain property", H10())); + a10 = qf(); + b10 = F6().Eb; + this.Jc = rb(new sb(), a10, G5(b10, "schema"), tb(new ub(), vb().Eb, "schema", "Schema for an entity", H10())); + ii(); + a10 = [this.DF, this.Jc, this.R]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + a10 = F6().Zd; + a10 = G5(a10, "DomainProperty"); + b10 = F6().Qi; + b10 = G5(b10, "Property"); + c10 = nc().ba; + this.ba = ji(a10, ji(b10, c10)); + this.qa = tb( + new ub(), + vb().hg, + "Custom Domain Property", + "Definition of an extension to the domain model defined directly by a user in the RAML/OpenAPI document.\nThis can be achieved by using an annotationType in RAML. In OpenAPI thy don't need to\n be declared, they can just be used.\n This should be mapped to new RDF properties declared directly in the main document or module.\n Contrast this extension mechanism with the creation of a propertyTerm in a vocabulary, a more\nre-usable and generic way of achieving the same functionality.\nIt can be validated using a SHACL shape", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.G8 = function(a10) { + this.Zc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Pd().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ lza: 0 }, false, "amf.core.metamodel.domain.extensions.CustomDomainPropertyModel$", { lza: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, Bga: 1, sk: 1 }); + var Gmb = void 0; + function Sk() { + Gmb || (Gmb = new Fmb().a()); + return Gmb; + } + function Hmb() { + this.wd = this.bb = this.mc = this.R = this.la = this.Aj = this.te = this.qa = this.ba = null; + this.xa = 0; + } + Hmb.prototype = new u7(); + Hmb.prototype.constructor = Hmb; + d7 = Hmb.prototype; + d7.a = function() { + Imb = this; + Cr(this); + uU(this); + wb(this); + Lab(this); + var a10 = F6().Zd; + a10 = G5(a10, "ParametrizedDeclaration"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "Parametrized Declaration", "Generic graph template supporting variables that can be transformed into a domain element", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return Kab(this); + }; + d7.K8 = function(a10) { + this.te = a10; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("ParametrizedDeclaration is abstract and cannot be instantiated by default")); + }; + d7.M8 = function(a10) { + this.la = a10; + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.L8 = function(a10) { + this.Aj = a10; + }; + d7.$classData = r8({ qza: 0 }, false, "amf.core.metamodel.domain.templates.ParametrizedDeclarationModel$", { qza: 1, f: 1, Dga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1 }); + var Imb = void 0; + function FY() { + Imb || (Imb = new Hmb().a()); + return Imb; + } + function Pk() { + this.j = this.Ke = this.$g = this.x = this.g = null; + this.xa = false; + } + Pk.prototype = new u7(); + Pk.prototype.constructor = Pk; + d7 = Pk.prototype; + d7.H = function() { + return "ExternalDomainElement"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Pk ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Ok(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return "#/external"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.$g = y7(); + return this; + }; + d7.$classData = r8({ Qza: 0 }, false, "amf.core.model.domain.ExternalDomainElement", { Qza: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function zi() { + rf.call(this); + this.mn = this.Xa = this.aa = null; + } + zi.prototype = new jhb(); + zi.prototype.constructor = zi; + d7 = zi.prototype; + d7.yh = function() { + throw mb(E6(), new nb().e("Recursive shape cannot be linked")); + }; + d7.bc = function() { + return Ci(); + }; + d7.fa = function() { + return this.Xa; + }; + function Di(a10, b10) { + a10.mn = new z7().d(b10); + a10.fh.iz(b10); + b10.fh.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.fh.iz(e10); + }; + }(a10))); + return a10; + } + d7.dd = function() { + return "/recursive"; + }; + d7.VN = function(a10, b10, c10) { + b10 = new S6().a(); + O7(); + var e10 = new P6().a(); + b10 = new zi().K(b10, e10); + b10.j = this.j; + Tca(this, a10, b10, y7(), c10); + a10 = this.mn; + a10.b() || (a10 = a10.c(), Di(b10, a10)); + this.fh.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return g10.fh.iz(h10); + }; + }(this, b10))); + return b10; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new zi().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + rf.prototype.a.call(this); + this.mn = y7(); + return this; + }; + d7.$classData = r8({ Xza: 0 }, false, "amf.core.model.domain.RecursiveShape", { Xza: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1 }); + function hl() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + hl.prototype = new u7(); + hl.prototype.constructor = hl; + d7 = hl.prototype; + d7.H = function() { + return "VariableValue"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof hl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return gl(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, gl().R).A; + a10 = a10.b() ? "default-variable" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ kAa: 0 }, false, "amf.core.model.domain.templates.VariableValue", { kAa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Tx() { + this.Th = this.Ca = null; + } + Tx.prototype = new u7(); + Tx.prototype.constructor = Tx; + d7 = Tx.prototype; + d7.H = function() { + return "DefaultArrayNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Tx ? Bj(this.Ca, a10.Ca) : false; + }; + d7.rV = function() { + var a10 = this.Ca, b10 = lc(); + return new R6().M(N6(a10, b10, this.Th), this.Ca); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + default: + throw new U6().e("" + a10); + } + }; + d7.nV = function() { + return UAa(this); + }; + d7.n3 = function() { + return PAa(this); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e5 = function() { + return RAa(this); + }; + d7.Qaa = function() { + return SAa(this); + }; + d7.Vb = function(a10, b10) { + this.Ca = a10; + this.Th = b10; + return this; + }; + d7.Sba = function(a10) { + return oM(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tAa: 0 }, false, "amf.core.parser.DefaultArrayNode", { tAa: 1, f: 1, qAa: 1, Iga: 1, LY: 1, y: 1, v: 1, q: 1, o: 1 }); + function Aq() { + this.ni = this.Df = this.qh = null; + this.lj = 0; + this.Fu = this.a3 = this.Ip = this.Bc = null; + } + Aq.prototype = new u7(); + Aq.prototype.constructor = Aq; + function Jmb() { + } + d7 = Jmb.prototype = Aq.prototype; + d7.H = function() { + return "ParserContext"; + }; + d7.Ar = function(a10, b10) { + WAa(this, a10, b10); + }; + function Ifa(a10) { + var b10 = a10.a3.Ur(); + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + var f10 = Lc(e10); + return Hq(new Iq(), e10, new v22().vi(f10.b() ? e10.j : f10.c(), H10()), y7()); + }; + }(a10)); + var c10 = Xd(); + return b10.ka(a10, c10.u).ke(); + } + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Aq) { + if (this.qh === a10.qh) { + var b10 = this.Df, c10 = a10.Df; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.ni === a10.ni && this.lj === a10.lj) + return b10 = this.Hp(), a10 = a10.Hp(), null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.yB = function(a10, b10) { + return YAa(this, a10, b10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.qh; + case 1: + return this.Df; + case 2: + return this.ni; + case 3: + return this.lj; + case 4: + return this.Hp(); + default: + throw new U6().e("" + a10); + } + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + this.Gc(a10.j, b10, c10, e10, f10, Yb().dh, g10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new qg().e(e10); + var l10 = h10.b() ? "" : h10.c(); + l10 = new qg().e(l10); + var m10 = Gb().uN; + k10 = xq(k10, l10, m10); + k10 = new qg().e(k10); + f10.b() ? l10 = y7() : (l10 = f10.c(), l10 = new z7().d(l10.r)); + l10 = l10.b() ? "" : l10.c(); + l10 = new qg().e(l10); + m10 = Gb().uN; + k10 = xq(k10, l10, m10); + this.Fu.Ha(k10) || (this.Fu.Tm(k10), k10 = this.Hp(), k10 instanceof z7 ? k10.i.Gc(a10, b10, c10, e10, f10, g10, h10.b() ? new z7().d(this.qh) : h10) : (k10 = bp(), l10 = this.lj, h10 = h10.b() ? new z7().d(this.qh) : h10, WLa(gp(k10), g10, a10, b10, c10, e10, f10, l10, h10))); + }; + function eHa(a10, b10) { + var c10 = a10.a3, e10 = Lc(b10); + c10.Ja(e10.b() ? b10.j : e10.c()) instanceof z7 || (c10 = a10.a3, e10 = Lc(b10), c10.Ue(e10.b() ? b10.j : e10.c(), b10)); + return a10; + } + d7.Hp = function() { + return this.Bc; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.qh)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Df)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ni)); + a10 = OJ().Ga(a10, this.lj); + a10 = OJ().Ga(a10, NJ(OJ(), this.Hp())); + return OJ().fe(a10, 5); + }; + d7.zo = function(a10, b10, c10, e10, f10) { + this.qh = a10; + this.Df = b10; + this.ni = c10; + this.lj = e10; + this.Bc = f10; + this.Ip = Rb(Ut(), H10()); + this.a3 = Rb(Ut(), H10()); + this.Fu = J5(DB(), H10()); + return this; + }; + d7.$classData = r8({ Xu: 0 }, false, "amf.core.parser.ParserContext", { Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1 }); + function V7() { + } + V7.prototype = new U52(); + V7.prototype.constructor = V7; + V7.prototype.a = function() { + return this; + }; + V7.prototype.P = function(a10) { + return this.cu(a10); + }; + V7.prototype.cu = function(a10) { + a10 = kb(a10); + var b10 = F6().Eb; + b10 = ic(G5(b10, "Shape")); + for (a10 = a10.Kb(); !a10.b(); ) { + if (ic(a10.ga()) === b10) + return true; + a10 = a10.ta(); + } + return false; + }; + V7.prototype.$classData = r8({ ICa: 0 }, false, "amf.core.resolution.stages.selectors.ShapeSelector$", { ICa: 1, OR: 1, f: 1, za: 1, y: 1, v: 1, q: 1, o: 1, lm: 1 }); + var Kmb = void 0; + function UYa() { + Kmb || (Kmb = new V7().a()); + return Kmb; + } + function W7() { + this.kp = this.ws = this.Xb = this.ZJ = this.p = this.pb = this.gh = this.dm = this.TL = this.$J = null; + } + W7.prototype = new u7(); + W7.prototype.constructor = W7; + d7 = W7.prototype; + d7.H = function() { + return "DeclarationsGroupEmitter"; + }; + d7.E = function() { + return 10; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof W7) { + var b10 = this.$J, c10 = a10.$J; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.TL, c10 = a10.TL, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.dm, c10 = a10.dm, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.gh, c10 = a10.gh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.pb, c10 = a10.pb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 && this.p === a10.p ? (b10 = this.ZJ, c10 = a10.ZJ, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Xb, c10 = a10.Xb, b10 = null === b10 ? null === c10 : U22(b10, c10)) : b10 = false; + b10 ? (b10 = this.ws, c10 = a10.ws, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kp === a10.kp : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$J; + case 1: + return this.TL; + case 2: + return this.dm; + case 3: + return this.gh; + case 4: + return this.pb; + case 5: + return this.p; + case 6: + return this.ZJ; + case 7: + return this.Xb; + case 8: + return this.ws; + case 9: + return this.kp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.TL.g, UV().$u).A; + b10 = b10.b() ? null : b10.c(); + b10 = nd(this, b10); + a: { + if (null !== b10 && (b10 = b10.ya(), b10 instanceof ze2)) { + var c10 = new z7().d(O0a(b10, this)); + break a; + } + c10 = y7(); + } + if (this.ZJ.b()) { + b10 = B6(this.TL.g, UV().R).A; + b10 = b10.b() ? null : b10.c(); + T6(); + var e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10); + Lmb(this).U(w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + var D10 = B6(A10.g, Fw().HX).A; + D10 instanceof z7 ? D10 = D10.i : (D10 = A10.j, D10 = Mc(ua(), D10, "#"), D10 = Oc(new Pc().fd(D10)), D10 = Mc(ua(), D10, "/"), D10 = Oc(new Pc().fd(D10)), D10 = new je4().e(D10), D10 = ba.decodeURI(D10.td)); + var C10 = mh(T6(), D10); + D10 = new PA().e(t10.ca); + var I10 = v10.b() ? y7() : mNa(v10.c(), A10), L10 = p10.dm, Y10 = p10.gh, ia = p10.pb, pa = p10.p, La = p10.Xb, ob = p10.kp, zb = y7(), Zb = y7(), Cc = H10(); + nNa(A10, L10, Y10, ia, pa, La, zb, false, Zb, I10, false, Cc, ob).Ob(D10); + A10 = D10.s; + C10 = [C10]; + if (0 > A10.w) + throw new U6().e("0"); + L10 = C10.length | 0; + I10 = A10.w + L10 | 0; + uD(A10, I10); + Ba(A10.L, 0, A10.L, L10, A10.w); + L10 = A10.L; + pa = L10.n.length; + ia = Y10 = 0; + La = C10.length | 0; + pa = La < pa ? La : pa; + La = L10.n.length; + for (pa = pa < La ? pa : La; Y10 < pa; ) + L10.n[ia] = C10[Y10], Y10 = 1 + Y10 | 0, ia = 1 + ia | 0; + A10.w = I10; + pr(t10.s, vD(wD(), D10.s)); + }; + }(this, h10, c10))); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } else { + T6(); + b10 = this.ZJ.ga(); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + c10 = b10.s; + f10 = b10.ca; + g10 = new rr().e(f10); + Mmb(new W7(), this.$J, this.TL, this.dm, this.gh, this.pb, this.p, this.ZJ.ta(), this.Xb, this.ws, this.kp).Qa(g10); + pr(c10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + k10 = g10.n.length; + l10 = h10 = 0; + m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + function Lmb(a10) { + var b10 = a10.$J; + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.yc.$d)); + return e10.b() ? ld() : e10.c(); + }; + }(a10)); + TC(); + var c10 = Gb().si; + return b10.ei(a10, UC(c10)); + } + function Mmb(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10) { + a10.$J = b10; + a10.TL = c10; + a10.dm = e10; + a10.gh = f10; + a10.pb = g10; + a10.p = h10; + a10.ZJ = k10; + a10.Xb = l10; + a10.ws = m10; + a10.kp = p10; + return a10; + } + d7.La = function() { + var a10 = this.$J, b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.yc.$d)); + return e10.ua(); + }; + }(this)), c10 = K7(); + a10 = a10.bd(b10, c10.u); + TC(); + b10 = Gb().si; + a10 = a10.nk(UC(b10)).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ DFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DeclarationsGroupEmitter", { DFa: 1, f: 1, db: 1, Ma: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nmb() { + this.ws = this.Xb = this.p = this.pb = this.gh = this.dm = this.Ca = null; + this.bM = false; + this.qB = this.lT = null; + this.hO = false; + this.kp = this.eQ = null; + } + Nmb.prototype = new u7(); + Nmb.prototype.constructor = Nmb; + d7 = Nmb.prototype; + d7.H = function() { + return "DialectNodeEmitter"; + }; + function nNa(a10, b10, c10, e10, f10, g10, h10, k10, l10, m10, p10, t10, v10) { + var A10 = new Nmb(); + A10.Ca = a10; + A10.dm = b10; + A10.gh = c10; + A10.pb = e10; + A10.p = f10; + A10.Xb = g10; + A10.ws = h10; + A10.bM = k10; + A10.lT = l10; + A10.qB = m10; + A10.hO = p10; + A10.eQ = t10; + A10.kp = v10; + return A10; + } + function Omb(a10, b10, c10) { + return c10.Ve().Od(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return Zc(g10) && g10.tk().Od(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return l10.j === Za(k10).c().j; + }; + }(e10, f10))); + }; + }(a10, b10))); + } + d7.E = function() { + return 13; + }; + d7.Ob = function(a10) { + if (Za(this.Ca).na()) + Pmb(this, this.Ca, this.gh) ? kNa(this.Ca).Ob(a10) : Omb(this, this.Ca, this.gh) ? Qmb(this, this.Ca, this.gh, a10) : Rmb(this.Ca, a10); + else { + var b10 = new qd().d(this.eQ); + if (this.hO) { + var c10 = b10.oa, e10 = K7(), f10 = [cx(new dx(), "$dialect", this.dm.j, Q5().Na, ld())]; + e10 = J5(e10, new Ib().ha(f10)); + f10 = K7(); + b10.oa = c10.ia(e10, f10.u); + } + if (this.qB.na()) { + c10 = this.qB.c(); + if (null === c10) + throw new x7().d(c10); + e10 = c10.ma(); + var g10 = c10.ya(); + c10 = b10.oa; + f10 = K7(); + e10 = [cx(new dx(), e10, g10, Q5().Na, ld())]; + e10 = J5(f10, new Ib().ha(e10)); + f10 = K7(); + b10.oa = c10.ia(e10, f10.u); + } + if (Ab(this.Ca.x, q5(uhb)).na() || this.kp.iO) + c10 = this.Ca.j, e10 = Lc(this.pb), e10 = e10.b() ? "" : e10.c(), f10 = -1 !== (c10.indexOf(ka(e10)) | 0) ? this.Ca.j.split(this.pb.j).join("") : this.Ca.j, c10 = b10.oa, e10 = K7(), f10 = [cx(new dx(), "$id", f10, Q5().Na, ld())], e10 = J5(e10, new Ib().ha(f10)), f10 = K7(), b10.oa = c10.ia(e10, f10.u); + Smb(vO(this.Ca)).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + var m10 = Tmb(h10, l10); + if (!m10.b()) { + var p10 = m10.c(); + h10.ws.b() ? m10 = true : (m10 = B6(p10.g, $d().Yh).A, m10 = (m10.b() ? null : m10.c()) !== h10.ws.c()); + if (m10) { + m10 = B6(p10.g, $d().R).A; + m10 = m10.b() ? null : m10.c(); + var t10 = MDa(p10), v10 = false, A10 = null, D10 = h10.Ca.g.vb.Ja(l10); + a: { + if (D10 instanceof z7) { + v10 = true; + A10 = D10; + var C10 = A10.i; + if (C10.r instanceof jh) { + p10 = C10.r; + t10 = new z7().d(C10.x); + D10 = p10.r; + v10 = D10 instanceof DN ? D10.t() : D10; + D10 = K7(); + v10 = ih(new jh(), v10, new P6().a()); + p10 = t10.b() ? p10.x : t10.c(); + m10 = [$g(new ah(), m10, lh(l10, kh(v10, p10)), y7())]; + m10 = J5(D10, new Ib().ha(m10)); + break a; + } + } + if (v10) { + C10 = A10.i; + if (C10.r instanceof $r) { + var I10 = bDa(); + I10 = null !== t10 && t10 === I10; + } else + I10 = false; + if (I10) { + p10 = C10.r; + t10 = new z7().d(C10.x); + D10 = K7(); + t10 = t10.b() ? p10.x : t10.c(); + m10 = [$x(m10, lh(l10, kh(p10, t10)), h10.p, false)]; + m10 = J5(D10, new Ib().ha(m10)); + break a; + } + } + if (v10 && (l10 = A10.i, l10.r instanceof uO ? (C10 = YCa(), C10 = null !== t10 && t10 === C10) : C10 = false, C10)) { + p10 = l10.r; + D10 = tj(p10).j; + t10 = nd(h10, D10); + if (null === t10) + throw new x7().d(t10); + D10 = t10.ma(); + v10 = t10.ya(); + t10 = K7(); + A10 = h10.gh; + l10 = h10.p; + C10 = h10.Xb; + I10 = h10.kp; + var L10 = y7(), Y10 = y7(), ia = y7(), pa = H10(); + m10 = [ky(m10, nNa(p10, v10, A10, D10, l10, C10, L10, false, Y10, ia, true, pa, I10), Q5().Na, ld())]; + m10 = J5(t10, new Ib().ha(m10)); + break a; + } + if (v10 && (l10 = A10.i, l10.r instanceof uO ? (C10 = WN(), C10 = null !== t10 && t10 === C10) : C10 = false, C10 && !(1 < t32(p10).jb()))) { + m10 = Umb(h10, m10, l10.r, p10, new z7().d(l10.x)); + break a; + } + if (v10 && (l10 = A10.i, l10.r instanceof $r ? (C10 = YN(), C10 = null !== t10 && t10 === C10) : C10 = false, C10 && !(1 < t32(p10).jb()))) { + m10 = Umb(h10, m10, l10.r, p10, new z7().d(l10.x)); + break a; + } + if (v10 && (l10 = A10.i, l10.r instanceof $r ? (C10 = TN(), C10 = null !== t10 && t10 === C10) : C10 = false, C10)) { + m10 = Umb(h10, m10, l10.r, p10, new z7().d(l10.x)); + break a; + } + if (v10 && (l10 = A10.i, l10.r instanceof uO ? (C10 = WN(), C10 = null !== t10 && t10 === C10) : C10 = false, C10 && 1 < t32(p10).jb())) { + m10 = Umb(h10, m10, l10.r, p10, y7()); + break a; + } + if (v10 && (l10 = A10.i, l10.r instanceof $r ? (C10 = YN(), C10 = null !== t10 && t10 === C10) : C10 = false, C10 && 1 < t32(p10).jb())) { + m10 = Umb(h10, m10, l10.r, p10, new z7().d(l10.x)); + break a; + } + if (v10 && (v10 = A10.i, v10.r instanceof $r ? (A10 = fDa(), t10 = null !== t10 && t10 === A10) : t10 = false, t10)) { + D10 = v10.r; + t10 = new z7().d(v10.x); + v10 = B6(p10.g, $d().nr).A; + v10 = v10.b() ? null : v10.c(); + p10 = B6(p10.g, $d().Hx).A; + p10 = p10.b() ? null : p10.c(); + m10 = J5(K7(), new Ib().ha([sNa(m10, D10, v10, p10, t10)])); + break a; + } + if (y7() === D10) + m10 = H10(); + else + throw new x7().d(D10); + } + p10 = k10.oa; + D10 = K7(); + k10.oa = p10.ia(m10, D10.u); + } + } + }; + }(this, b10))); + this.bM && (c10 = b10.oa, e10 = Vmb(this), f10 = K7(), b10.oa = c10.ia(e10, f10.u)); + this.bM && (c10 = b10.oa, e10 = K7(), f10 = [new yhb().ZT(this.gh, this.p, this.Xb)], e10 = J5(e10, new Ib().ha(f10)), f10 = K7(), b10.oa = c10.ia(e10, f10.u)); + c10 = a10.s; + a10 = a10.ca; + e10 = new rr().e(a10); + this.p.zb(b10.oa).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + l10.Qa(k10); + }; + }(this, e10))); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Nmb) { + var b10 = this.Ca, c10 = a10.Ca; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.dm, c10 = a10.dm, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.gh, c10 = a10.gh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.pb, c10 = a10.pb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 && this.p === a10.p ? (b10 = this.Xb, c10 = a10.Xb, b10 = null === b10 ? null === c10 : U22(b10, c10)) : b10 = false; + b10 ? (b10 = this.ws, c10 = a10.ws, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 && this.bM === a10.bM ? (b10 = this.lT, c10 = a10.lT, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.qB, c10 = a10.qB, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 && this.hO === a10.hO ? (b10 = this.eQ, c10 = a10.eQ, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kp === a10.kp : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ca; + case 1: + return this.dm; + case 2: + return this.gh; + case 3: + return this.pb; + case 4: + return this.p; + case 5: + return this.Xb; + case 6: + return this.ws; + case 7: + return this.bM; + case 8: + return this.lT; + case 9: + return this.qB; + case 10: + return this.hO; + case 11: + return this.eQ; + case 12: + return this.kp; + default: + throw new U6().e("" + a10); + } + }; + function Qmb(a10, b10, c10, e10) { + if (wh(b10.x, q5(jNa))) { + b10 = e10.s; + e10 = e10.ca; + c10 = new rr().e(e10); + T6(); + var f10 = mh(T6(), "$ref"); + T6(); + var g10 = B6(a10.Ca.g, db().ed).A; + a10 = g10.b() ? Za(a10.Ca).c().j : g10.c(); + a10 = mh(T6(), a10); + sr(c10, f10, a10); + pr(b10, mr(T6(), tr(ur(), c10.s, e10), Q5().sa)); + } else + c10 = c10.Ve().Fb(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + return Zc(l10) && l10.tk().Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return t10.j === Za(p10).c().j; + }; + }(h10, k10))); + }; + }(a10, b10))), a10 = a10.Xb.P(c10.c().j).ma(), X6(new b62(), a10 + "." + m2a(b10), b10.x, Q5().Na).Ob(e10); + } + function rNa(a10, b10) { + b10 = nd(a10, b10); + if (null !== b10) { + var c10 = b10.ya(); + if (c10 instanceof Cd) + return J5(K7(), new Ib().ha([c10])); + } + return null !== b10 && (b10 = b10.ya(), b10 instanceof ze2) ? (b10 = B6(b10.g, Ae4().bh), a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + f10 = f10.A; + f10 = f10.b() ? null : f10.c(); + return nd(e10, f10).ya(); + }; + }(a10)), c10 = K7(), a10 = b10.ka(a10, c10.u), b10 = new V52(), c10 = K7(), a10.ec(b10, c10.u)) : H10(); + } + function Umb(a10, b10, c10, e10, f10) { + if (c10 instanceof $r) + var g10 = c10.wb; + else { + if (!(c10 instanceof uO)) + throw new x7().d(c10); + g10 = J5(K7(), new Ib().ha([c10])); + } + var h10 = c10 instanceof $r, k10 = O0a(e10, a10), l10 = K7(); + a10 = [qNa(a10, e10, g10, k10, h10, b10, f10, c10)]; + return J5(l10, new Ib().ha(a10)); + } + d7.t = function() { + return V5(W5(), this); + }; + function Wmb(a10) { + a10 = a10.gh; + return Zc(a10) ? new z7().d(a10) : y7(); + } + function Rmb(a10, b10) { + if (wh(a10.x, q5(jNa))) { + var c10 = b10.s; + b10 = b10.ca; + var e10 = new rr().e(b10); + T6(); + var f10 = mh(T6(), "$ref"); + T6(); + var g10 = B6(a10.g, db().ed).A; + a10 = g10.b() ? Za(a10).c().j : g10.c(); + a10 = mh(T6(), a10); + sr(e10, f10, a10); + pr(c10, mr(T6(), tr(ur(), e10.s, b10), Q5().sa)); + } else + X6(new b62(), m2a(a10), a10.x, Q5().Na).Ob(b10); + } + function Pmb(a10, b10, c10) { + var e10 = Za(b10); + if (e10 instanceof z7) + return b10 = e10.i, c10.Ve().Od(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return h10 instanceof y32 ? B6(h10.g, qO().nb).j === g10.j : false; + }; + }(a10, b10))); + throw mb(E6(), new nb().e("Cannot check fragment for an element without target for element " + b10.j)); + } + function Vmb(a10) { + var b10 = Vb().Ia(B6(a10.pb.g, Gc().Pj)); + if (b10.b()) + a10 = y7(); + else { + b10 = b10.c(); + var c10 = Vb().Ia(B6(b10.g, Hc().De)); + if (c10.b()) + a10 = y7(); + else { + c10 = c10.c(); + var e10 = Wmb(a10); + if (e10.b()) + a10 = y7(); + else { + e10 = e10.c(); + var f10 = B6(c10.g, GO().Vs).A; + a10 = new z7().d((f10.b() ? null : f10.c()) === a10.Ca.j ? H10() : B6(c10.g, GO().Mt).ne(J5(K7(), H10()), Uc(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10, m10) { + var p10 = B6(m10.g, UV().$u).A; + p10 = rNa(g10, p10.b() ? null : p10.c()); + var t10 = w6(/* @__PURE__ */ function() { + return function(pa) { + return pa.j; + }; + }(g10)), v10 = K7(); + t10 = p10.ka(t10, v10.u).xg(); + p10 = h10.tk(); + t10 = Kbb(t10); + v10 = K7(); + p10 = p10.ec(t10, v10.u); + if (p10.Da()) { + t10 = B6(m10.g, UV().$u).A; + t10 = t10.b() ? null : t10.c(); + v10 = nd(g10, t10); + if (null !== v10 && (t10 = v10.ya(), null !== t10)) { + v10 = K7(); + var A10 = g10.gh, D10 = g10.pb, C10 = g10.p; + Gb(); + var I10 = B6(k10.g, Hc().Iy).A; + I10 = I10.b() ? "/" : I10.c(); + I10 = mD(0, Mc(ua(), I10, "/")); + var L10 = g10.Xb, Y10 = g10.kp, ia = y7(); + m10 = J5(v10, new Ib().ha([Mmb(new W7(), p10, m10, t10, A10, D10, C10, I10, L10, ia, Y10)])); + p10 = K7(); + return l10.ia(m10, p10.u); + } + throw new x7().d(v10); + } + return l10; + }; + }(a10, e10, b10)))); + } + } + } + return a10.b() ? H10() : a10.c(); + } + function Smb(a10) { + var b10 = a10.g; + for (a10 = Rb(Gb().ab, H10()); !b10.b(); ) { + var c10 = b10.ga(); + a10.Ja(ic(c10.r)) instanceof z7 || (a10 = a10.Wh(ic(c10.r), c10)); + b10 = b10.ta(); + } + return new Fc().Vd(a10); + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Ca)); + a10 = OJ().Ga(a10, NJ(OJ(), this.dm)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gh)); + a10 = OJ().Ga(a10, NJ(OJ(), this.pb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.p)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Xb)); + a10 = OJ().Ga(a10, NJ(OJ(), this.ws)); + a10 = OJ().Ga(a10, this.bM ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.lT)); + a10 = OJ().Ga(a10, NJ(OJ(), this.qB)); + a10 = OJ().Ga(a10, this.hO ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.eQ)); + a10 = OJ().Ga(a10, NJ(OJ(), this.kp)); + return OJ().fe(a10, 13); + }; + function Tmb(a10, b10) { + b10 = ic(b10.r); + var c10 = a10.dm; + if (c10 instanceof Cd) + return B6(c10.g, wj().ej).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = B6(k10.g, $d().Yh).A; + return (k10.b() ? null : k10.c()) === h10; + }; + }(a10, b10))); + if (c10 instanceof ze2) { + c10 = B6(c10.g, Ae4().bh); + var e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + g10 = g10.A; + return g10.b() ? null : g10.c(); + }; + }(a10)), f10 = K7(); + c10 = c10.ka(e10, f10.u); + e10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + h10 = nd(g10, h10); + return null !== h10 && (h10 = h10.ya(), h10 instanceof Cd) ? new z7().d(h10) : y7(); + }; + }(a10)); + f10 = K7(); + c10 = c10.ka(e10, f10.u); + e10 = new Lbb(); + f10 = K7(); + c10 = c10.ec(e10, f10.u); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return B6( + g10.g, + wj().ej + ); + }; + }(a10)); + f10 = K7(); + return c10.bd(e10, f10.u).Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = B6(k10.g, $d().Yh).A; + return (k10.b() ? null : k10.c()) === h10; + }; + }(a10, b10))); + } + throw new x7().d(c10); + } + d7.La = function() { + var a10 = Ab(this.Ca.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ IFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.instances.DialectNodeEmitter", { IFa: 1, f: 1, wh: 1, Ma: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function vV() { + this.Dp = this.p = this.dt = null; + } + vV.prototype = new u7(); + vV.prototype.constructor = vV; + d7 = vV.prototype; + d7.H = function() { + return "ClassTermEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vV) { + var b10 = this.dt, c10 = a10.dt; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Dp, a10 = a10.Dp, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.dt; + case 1: + return this.p; + case 2: + return this.Dp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = od(this.dt.j, this.Dp); + var c10 = J5(K7(), H10()); + var e10 = B6(this.dt.g, fO().Zc).A; + if (!e10.b()) { + e10 = e10.c(); + var f10 = K7(); + e10 = [cx(new dx(), "displayName", e10, Q5().Na, ld())]; + e10 = J5(f10, new Ib().ha(e10)); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + } + e10 = B6(this.dt.g, fO().Va).A; + e10.b() || (e10 = e10.c(), f10 = K7(), e10 = [cx(new dx(), "description", e10, Q5().Na, ld())], e10 = J5(f10, new Ib().ha(e10)), f10 = K7(), c10 = c10.ia(e10, f10.u)); + B6(this.dt.g, fO().fz).Da() && (e10 = K7(), f10 = [new qV().eaa(this)], e10 = J5(e10, new Ib().ha(f10)), f10 = K7(), c10 = c10.ia(e10, f10.u)); + B6(this.dt.g, fO().kh).Da() && (e10 = K7(), f10 = [new rV().eaa(this)], e10 = J5( + e10, + new Ib().ha(f10) + ), f10 = K7(), c10 = c10.ia(e10, f10.u)); + if (c10.b()) + cx(new dx(), b10, "", Q5().nd, ld()).Qa(a10); + else { + T6(); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + f10 = b10.s; + var g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(c10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.dt.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ TFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.ClassTermEmitter", { TFa: 1, f: 1, db: 1, Ma: 1, Wga: 1, y: 1, v: 1, q: 1, o: 1 }); + function xV() { + this.Dp = this.p = this.pt = null; + } + xV.prototype = new u7(); + xV.prototype.constructor = xV; + d7 = xV.prototype; + d7.H = function() { + return "PropertyTermEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xV) { + var b10 = this.pt, c10 = a10.pt; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Dp, a10 = a10.Dp, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pt; + case 1: + return this.p; + case 2: + return this.Dp; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = od(this.pt.j, this.Dp); + var c10 = J5(K7(), H10()); + var e10 = B6(this.pt.Y(), eO().Zc).A; + if (!e10.b()) { + e10 = e10.c(); + var f10 = K7(); + e10 = [cx(new dx(), "displayName", e10, Q5().Na, ld())]; + e10 = J5(f10, new Ib().ha(e10)); + f10 = K7(); + c10 = c10.ia(e10, f10.u); + } + e10 = B6(this.pt.Y(), eO().Va).A; + e10.b() || (e10 = e10.c(), f10 = K7(), e10 = [cx(new dx(), "description", e10, Q5().Na, ld())], e10 = J5(f10, new Ib().ha(e10)), f10 = K7(), c10 = c10.ia(e10, f10.u)); + B6(this.pt.Y(), eO().eB).Da() && (e10 = K7(), f10 = [new sV().faa(this)], e10 = J5(e10, new Ib().ha(f10)), f10 = K7(), c10 = c10.ia(e10, f10.u)); + B6(this.pt.Y(), eO().Vf).A.na() && (e10 = K7(), f10 = [new tV().faa(this)], e10 = J5(e10, new Ib().ha(f10)), f10 = K7(), c10 = c10.ia(e10, f10.u)); + if (c10.b()) + cx(new dx(), b10, "", Q5().nd, ld()).Qa(a10); + else { + T6(); + e10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + f10 = b10.s; + var g10 = b10.ca, h10 = new rr().e(g10); + jr(wr(), this.p.zb(c10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var k10 = g10.n.length, l10 = h10 = 0, m10 = e10.length | 0; + k10 = m10 < k10 ? m10 : k10; + m10 = g10.n.length; + for (k10 = k10 < m10 ? k10 : m10; h10 < k10; ) + g10.n[l10] = e10[h10], h10 = 1 + h10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.pt.fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ XFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.vocabularies.PropertyTermEmitter", { XFa: 1, f: 1, db: 1, Ma: 1, Wga: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xmb() { + this.qa = this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Ts = this.at = this.R = this.ba = this.Y7 = this.Ax = this.ej = this.Ut = null; + this.xa = 0; + } + Xmb.prototype = new u7(); + Xmb.prototype.constructor = Xmb; + d7 = Xmb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + Ymb = this; + Cr(this); + uU(this); + bM(this); + ud(this); + Aba(this); + var a10 = yc(), b10 = F6().Ua; + this.Ut = rb(new sb(), a10, G5(b10, "targetClass"), tb(new ub(), ci().Ua, "target class", "Target class whose instances will need to match the constraint described for the node", H10())); + a10 = new xc().yd($d()); + b10 = F6().Ua; + this.ej = rb(new sb(), a10, G5(b10, "property"), tb(new ub(), ci().Ua, "property", "Data shape constraint for a property of the target node", H10())); + a10 = qb(); + b10 = F6().Ta; + this.Ax = rb(new sb(), a10, G5(b10, "uriTemplate"), tb( + new ub(), + vb().Ta, + "uriTemplate", + "URI template that will be used to generate the URI of the parsed nodeds in the graph", + H10() + )); + a10 = new xc().yd(yc()); + b10 = F6().$c; + this.Y7 = rb(new sb(), a10, G5(b10, "resolvedExtends"), tb(new ub(), vb().qm, "", "", H10())); + a10 = F6().$c; + a10 = G5(a10, "NodeMapping"); + b10 = F6().Ua; + b10 = G5(b10, "Shape"); + var c10 = nc().ba; + this.ba = ji(a10, ji(b10, c10)); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.D_ = function(a10) { + this.R = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ni = function() { + return 0 === (1 & this.xa) << 24 >> 24 ? z_a(this) : this.mc; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.Ub = function() { + var a10 = this.Ut, b10 = this.R, c10 = this.ej, e10 = this.Ax, f10 = this.at, g10 = this.Y7, h10 = db().g, k10 = nc().g, l10 = ii(); + h10 = h10.ia(k10, l10.u); + return ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, h10)))))); + }; + d7.jc = function() { + return this.qa; + }; + d7.KN = function(a10) { + this.at = a10; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Cd().K(new S6().a(), a10); + }; + d7.JN = function(a10) { + this.Ts = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ xGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.NodeMappingModel$", { xGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, PR: 1, d7: 1 }); + var Ymb = void 0; + function wj() { + Ymb || (Ymb = new Xmb().a()); + return Ymb; + } + function gO() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + gO.prototype = new u7(); + gO.prototype.constructor = gO; + d7 = gO.prototype; + d7.H = function() { + return "ClassTerm"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + Vb().Ia(this.j).b() && Ai(this, a10); + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof gO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + function Zmb(a10, b10) { + var c10 = fO().kh, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ih(new jh(), g10, new P6().a()); + }; + }(a10)), f10 = K7(); + b10 = Zr(new $r(), b10.ka(e10, f10.u), new P6().a()); + Vd(a10, c10, b10); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return fO(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return ""; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + function $mb(a10, b10) { + var c10 = fO().fz, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ih(new jh(), g10, new P6().a()); + }; + }(a10)), f10 = K7(); + b10 = Zr(new $r(), b10.ka(e10, f10.u), new P6().a()); + Vd(a10, c10, b10); + } + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ OGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ClassTerm", { OGa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function IV() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + IV.prototype = new u7(); + IV.prototype.constructor = IV; + d7 = IV.prototype; + d7.H = function() { + return "DocumentMapping"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + Vb().Ia(this.j).b() && Ai(this, a10); + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof IV ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return GO(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return ""; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ YGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DocumentMapping", { YGa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function VV() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + VV.prototype = new u7(); + VV.prototype.constructor = VV; + d7 = VV.prototype; + d7.H = function() { + return "DocumentsModel"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof VV ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Hc(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/documents"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ $Ga: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DocumentsModel", { $Ga: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function yO() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + yO.prototype = new u7(); + yO.prototype.constructor = yO; + d7 = yO.prototype; + d7.H = function() { + return "External"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof yO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return dd(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, dd().Zc).A; + if (a10 instanceof z7) + return a10 = new je4().e(a10.i), "/externals/" + jj(a10.td); + if (y7() === a10) + throw mb(E6(), new nb().e("Cannot set ID of external without alias")); + throw new x7().d(a10); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ bHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.External", { bHa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function OV() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + OV.prototype = new u7(); + OV.prototype.constructor = OV; + d7 = OV.prototype; + d7.H = function() { + return "PublicNodeMapping"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + Vb().Ia(this.j).b() && Ai(this, a10); + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof OV ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return UV(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return ""; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ qHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.PublicNodeMapping", { qHa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function bO() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + bO.prototype = new u7(); + bO.prototype.constructor = bO; + d7 = bO.prototype; + d7.H = function() { + return "VocabularyReference"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof bO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return td(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, td().Xp).A; + if (a10 instanceof z7) + return a10 = new je4().e(a10.i), "/vocabularyReference/" + jj(a10.td); + if (y7() === a10) + throw mb(E6(), new nb().e("Cannot set ID of VocabularyReference without alias")); + throw new x7().d(a10); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ uHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.VocabularyReference", { uHa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function y22() { + this.r = this.$ = null; + } + y22.prototype = new u7(); + y22.prototype.constructor = y22; + d7 = y22.prototype; + d7.a = function() { + this.$ = "form-body-parameter"; + this.r = "true"; + return this; + }; + d7.H = function() { + return "FormBodyParameter"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof y22 && true; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + var Rma = r8({ VIa: 0 }, false, "amf.plugins.document.webapi.annotations.FormBodyParameter", { VIa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + y22.prototype.$classData = Rma; + function Ty() { + this.r = this.$ = this.j = null; + } + Ty.prototype = new u7(); + Ty.prototype.constructor = Ty; + d7 = Ty.prototype; + d7.H = function() { + return "JSONSchemaId"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ty ? this.j === a10.j : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.j; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.j = a10; + this.$ = "json-schema-id"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var p4a = r8({ aJa: 0 }, false, "amf.plugins.document.webapi.annotations.JSONSchemaId", { aJa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Ty.prototype.$classData = p4a; + function C22() { + this.r = this.$ = this.yc = this.KL = null; + } + C22.prototype = new u7(); + C22.prototype.constructor = C22; + d7 = C22.prototype; + d7.H = function() { + return "ParameterNameForPayload"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof C22 && this.KL === a10.KL) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.KL; + case 1: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.xU = function(a10, b10) { + this.KL = a10; + this.yc = b10; + this.$ = "parameter-name-for-payload"; + this.r = a10 + "->" + b10.t(); + return this; + }; + var u5a = r8({ fJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParameterNameForPayload", { fJa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + C22.prototype.$classData = u5a; + function g42() { + this.r = this.$ = this.Vk = null; + } + g42.prototype = new u7(); + g42.prototype.constructor = g42; + d7 = g42.prototype; + d7.H = function() { + return "ParsedJSONExample"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof g42 ? this.Vk === a10.Vk : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.Vk = a10; + this.$ = "parsed-json-example"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ hJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParsedJSONExample", { hJa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + function jg() { + this.r = this.$ = this.Vk = null; + } + jg.prototype = new u7(); + jg.prototype.constructor = jg; + d7 = jg.prototype; + d7.H = function() { + return "ParsedRamlDatatype"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof jg ? this.Vk === a10.Vk : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.Vk = a10; + this.$ = "parsed-raml-datatype"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var wmb = r8({ kJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParsedRamlDatatype", { kJa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + jg.prototype.$classData = wmb; + function G22() { + this.$L = false; + this.r = this.$ = this.yc = null; + } + G22.prototype = new u7(); + G22.prototype.constructor = G22; + d7 = G22.prototype; + d7.H = function() { + return "RequiredParamPayload"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G22 && this.$L === a10.$L) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$L; + case 1: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, this.$L ? 1231 : 1237); + a10 = OJ().Ga(a10, NJ(OJ(), this.yc)); + return OJ().fe(a10, 2); + }; + function yYa(a10, b10, c10) { + a10.$L = b10; + a10.yc = c10; + a10.$ = "required-param-payload"; + a10.r = "" + vva(MH(), b10, "->") + c10.t(); + return a10; + } + var q5a = r8({ mJa: 0 }, false, "amf.plugins.document.webapi.annotations.RequiredParamPayload", { mJa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + G22.prototype.$classData = q5a; + function gy() { + YV.call(this); + this.Zia = this.zqa = this.yV = this.um = null; + } + gy.prototype = new sOa(); + gy.prototype.constructor = gy; + d7 = gy.prototype; + d7.H = function() { + return "JsonSchemaEmitterContext"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gy) { + var b10 = this.um, c10 = a10.um; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.yV === a10.yV : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.um; + case 1: + return this.yV; + default: + throw new U6().e("" + a10); + } + }; + d7.Xba = function() { + return this.yV; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.hj = function() { + return this.um; + }; + d7.Aqa = function() { + return this.zqa; + }; + d7.cU = function(a10, b10) { + this.um = a10; + this.yV = b10; + var c10 = KO(); + YV.prototype.Ti.call(this, a10, c10, b10); + PEa || (PEa = new ZO().a()); + this.zqa = PEa; + this.Zia = "anyOf"; + return this; + }; + d7.$ia = function() { + return this.Zia; + }; + d7.z = function() { + return X5(this); + }; + d7.Rda = function() { + return "/definitions/"; + }; + d7.$classData = r8({ rJa: 0 }, false, "amf.plugins.document.webapi.contexts.JsonSchemaEmitterContext", { rJa: 1, cha: 1, dha: 1, TR: 1, f: 1, y: 1, v: 1, q: 1, o: 1 }); + function $w() { + this.Ae = this.N = this.Hj = this.ET = this.Ba = this.la = null; + } + $w.prototype = new u7(); + $w.prototype.constructor = $w; + d7 = $w.prototype; + d7.H = function() { + return "RamlScalarValueEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $w) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.ET, c10 = a10.ET, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Hj, a10 = a10.Hj, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.ET; + case 3: + return this.Hj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function anb(a10, b10) { + T6(); + var c10 = a10.la, e10 = mh(T6(), c10); + c10 = new PA().e(b10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10); + T6(); + var k10 = nr(or(), a10.Ba.r.r.r), l10 = a10.Hj; + UUa(h10, "value", mr(0, k10, l10.b() ? a10.Ae : l10.c())); + a10.ET.U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + p10.N.zf.tS().ug(v10, Fqa()).Qa(t10); + }; + }(a10, h10))); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + a10 = c10.s; + e10 = [e10]; + if (0 > a10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = a10.w + g10 | 0; + uD(a10, f10); + Ba(a10.L, 0, a10.L, g10, a10.w); + g10 = a10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + a10.w = f10; + pr(b10.s, vD(wD(), c10.s)); + } + d7.Qa = function(a10) { + anb(this, a10); + }; + d7.z = function() { + return X5(this); + }; + function uka(a10, b10, c10, e10, f10, g10) { + a10.la = b10; + a10.Ba = c10; + a10.ET = e10; + a10.Hj = f10; + a10.N = g10; + AAa(a10); + return a10; + } + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.wia = function(a10) { + this.Ae = a10; + }; + d7.$classData = r8({ SJa: 0 }, false, "amf.plugins.document.webapi.contexts.RamlScalarValueEmitter", { SJa: 1, f: 1, Xxa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nx() { + this.Th = this.Vw = null; + } + Nx.prototype = new u7(); + Nx.prototype.constructor = Nx; + d7 = Nx.prototype; + d7.H = function() { + return "MapEntriesArrayNode"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Nx ? Bj(this.Vw, a10.Vw) : false; + }; + d7.rV = function() { + var a10 = this.Vw.sb, b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + T6(); + ur(); + ue4(); + f10 = [f10]; + if (0 === (f10.length | 0)) + hG(), iG(), f10 = lG(new jG().a()); + else { + hG(); + iG(); + for (var g10 = new jG().a(), h10 = 0, k10 = f10.length | 0; h10 < k10; ) + MS(g10, f10[h10]), h10 = 1 + h10 | 0; + f10 = lG(g10); + } + f10 = tr(0, f10, e10.Vw.da.Rf); + return mr(T6(), f10, Q5().sa); + }; + }(this)), c10 = rw(); + a10 = a10.ka(b10, c10.sc); + T6(); + b10 = this.Vw; + T6(); + return new R6().M(a10, mr(T6(), b10, Q5().sa)); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vw; + default: + throw new U6().e("" + a10); + } + }; + d7.nV = function() { + return UAa(this); + }; + d7.n3 = function() { + return PAa(this); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.e5 = function() { + return RAa(this); + }; + d7.Qaa = function() { + return SAa(this); + }; + d7.Sba = function(a10) { + return oM(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ILa: 0 }, false, "amf.plugins.document.webapi.parser.spec.common.MapEntriesArrayNode", { ILa: 1, f: 1, qAa: 1, Iga: 1, LY: 1, y: 1, v: 1, q: 1, o: 1 }); + function h72() { + f72.call(this); + this.ra = null; + } + h72.prototype = new lib2(); + h72.prototype.constructor = h72; + function bnb(a10) { + var b10 = a10.Bh.I3(), c10 = new M6().W(a10.X), e10 = F32().Eq; + Gg(c10, "scheme", Hg(Ig(a10, e10, a10.ra), b10)); + c10 = new M6().W(a10.X); + e10 = F32().RM; + Gg(c10, "bearerFormat", Hg(Ig(a10, e10, a10.ra), b10)); + return b10; + } + h72.prototype.Cc = function() { + var a10 = f72.prototype.Cc.call(this); + if (!(a10 instanceof z7)) { + if (y7() !== a10) + throw new x7().d(a10); + a10 = B6(this.Bh.g, Xh().Hf).A; + a10 = a10.b() ? null : a10.c(); + a10 = "openIdConnect" === a10 ? new z7().d(cnb(this)) : "http" === a10 ? new z7().d(bnb(this)) : y7(); + } + return pib(this, a10); + }; + function dnb(a10, b10, c10) { + b10 = b10.i; + var e10 = qc(); + N6(b10, e10, a10.ra).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = vSa(xSa(), h10), l10 = h10.i, m10 = qc(); + l10 = N6(l10, m10, f10.ra); + h10 = new Qg().Vb(h10.Aa, f10.ra).nf(); + m10 = Jm().Wv; + Vd(k10, m10, h10); + h10 = g10.j; + J5(K7(), H10()); + Ai(k10, h10); + h10 = new M6().W(l10); + m10 = Jm().km; + Gg(h10, "authorizationUrl", Hg(Ig(f10, m10, f10.ra), k10)); + h10 = new M6().W(l10); + m10 = Jm().vq; + Gg(h10, "tokenUrl", Hg(Ig(f10, m10, f10.ra), k10)); + h10 = new M6().W(l10); + m10 = Jm().tN; + Gg(h10, "refreshUrl", Hg(Ig(f10, m10, f10.ra), k10)); + qib(f10, k10, l10); + l10 = xE().Ap; + return ig(g10, l10, k10); + }; + }(a10, c10))); + } + function cnb(a10) { + var b10 = a10.Bh.J3(), c10 = new M6().W(a10.X), e10 = vE().Pf; + Gg(c10, "openIdConnectUrl", Hg(Ig(a10, e10, a10.ra), b10)); + c10 = new M6().W(a10.X); + e10 = jx(new je4().e("settings")); + c10 = ac(c10, e10); + c10.b() || (c10 = c10.c().i, e10 = qc(), c10 = N6(c10, e10, a10.ra), oib(a10, c10, b10, new Ib().ha([]))); + return b10; + } + h72.prototype.q1 = function(a10, b10, c10) { + this.ra = c10; + f72.prototype.q1.call(this, a10, b10, c10); + return this; + }; + h72.prototype.Cna = function() { + var a10 = this.Bh.pQ(), b10 = ac(new M6().W(this.X), "flows"); + b10.b() || (b10 = b10.c(), dnb(this, b10, a10)); + b10 = new M6().W(this.X); + var c10 = jx(new je4().e("settings")); + b10 = ac(b10, c10); + b10.b() || (b10 = b10.c().i, c10 = qc(), b10 = N6(b10, c10, this.ra), oib(this, b10, a10, new Ib().ha(["authorizationGrants"]))); + pna(Ry(new Sy(), a10, this.X, H10(), this.ra), "flows"); + return a10; + }; + h72.prototype.$classData = r8({ IMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Oas3SecuritySettingsParser", { IMa: 1, oha: 1, f: 1, ANa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function RO() { + lW.call(this); + this.de = this.Ka = this.ND = null; + } + RO.prototype = new POa(); + RO.prototype.constructor = RO; + d7 = RO.prototype; + d7.H = function() { + return "OasAnnotationEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof RO) { + var b10 = this.ND, c10 = a10.ND; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ND; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.de; + }; + d7.HK = function(a10, b10, c10) { + this.ND = a10; + this.Ka = b10; + lW.prototype.HK.call(this, a10, b10, c10); + a10 = B6(a10.g, Ud().R).A; + this.de = "x-" + (a10.b() ? null : a10.c()); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ KMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasAnnotationEmitter", { KMa: 1, kha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function SO() { + oW.call(this); + this.Aa = this.sd = this.Gb = this.Ka = this.nh = null; + } + SO.prototype = new QOa(); + SO.prototype.constructor = SO; + d7 = SO.prototype; + d7.H = function() { + return "OasCustomFacetsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof SO) { + var b10 = this.nh, c10 = a10.nh; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nh; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.bea = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return Lib(b10, c10, e10, "properties", H10(), H10(), a10.sd); + }; + }(this)); + }; + d7.Zz = function(a10, b10, c10, e10) { + this.nh = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + oW.prototype.dU.call(this, a10, b10, c10, e10); + this.Aa = jx(new je4().e("facets")); + return this; + }; + d7.kL = function() { + return this.Aa; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ VMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasCustomFacetsEmitter", { VMa: 1, mha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function enb() { + Xw.call(this); + this.sd = this.Ka = this.Gb = this.FA = null; + } + enb.prototype = new TOa(); + enb.prototype.constructor = enb; + d7 = enb.prototype; + d7.H = function() { + return "OasDeclaredTypesEmitters"; + }; + function KEa(a10, b10, c10, e10) { + var f10 = new enb(); + f10.FA = a10; + f10.Gb = b10; + f10.Ka = c10; + f10.sd = e10; + Xw.prototype.gma.call(f10, a10, e10); + return f10; + } + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof enb) { + var b10 = this.FA, c10 = a10.FA; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.FA; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.tka = function(a10) { + var b10 = this.sd.Gg(), c10 = Xq().Cp, e10 = b10 === c10 ? (T6(), mh(T6(), "schemas")) : (T6(), mh(T6(), "definitions")); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.Ka, l10 = this.FA, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.Ka, D10 = t10.Gb, C10 = K7(); + return new Dib().bU(v10, A10, D10, J5(C10, new Ib().ha(["definitions"])), t10.sd); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.ka(m10, p10.u)), g10); + pr(c10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = e10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = e10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasDeclaredTypesEmitters", { WMa: 1, iMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function PO() { + iW.call(this); + this.de = this.Ka = this.$E = null; + } + PO.prototype = new WOa(); + PO.prototype.constructor = PO; + d7 = PO.prototype; + d7.H = function() { + return "OasFacetsInstanceEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof PO) { + var b10 = this.$E, c10 = a10.$E; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$E; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.de; + }; + d7.IK = function(a10, b10, c10) { + this.$E = a10; + this.Ka = b10; + iW.prototype.IK.call(this, a10, b10, c10); + a10 = B6(B6(a10.g, Ot().ig).aa, qf().R).A; + a10 = "facet-" + (a10.b() ? null : a10.c()); + this.de = jx(new je4().e(a10)); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ZMa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasFacetsInstanceEmitter", { ZMa: 1, nha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function m7() { + Uy.call(this); + this.xt = this.Hr = this.nS = this.Gb = this.Ka = this.ON = null; + } + m7.prototype = new rma(); + m7.prototype.constructor = m7; + d7 = m7.prototype; + d7.H = function() { + return "OasItemsShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof m7) { + var b10 = this.ON, c10 = a10.ON; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.nS, c10 = a10.nS, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hr, c10 = a10.Hr, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.xt, a10 = a10.xt, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ON; + case 1: + return this.Ka; + case 2: + return this.Gb; + case 3: + return this.nS; + case 4: + return this.Hr; + case 5: + return this.xt; + default: + throw new U6().e("" + a10); + } + }; + function yib(a10, b10, c10, e10, f10, g10, h10, k10) { + a10.ON = b10; + a10.Ka = c10; + a10.Gb = e10; + a10.nS = f10; + a10.Hr = g10; + a10.xt = h10; + Uy.prototype.bU.call(a10, B6(b10.aa, uh().Ff), c10, H10(), e10, k10); + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (Vb().Ia(Ti(this.ON.aa, uh().Ff)).na()) { + T6(); + var b10 = mh(T6(), "items"), c10 = new PA().e(a10.ca), e10 = this.Hr, f10 = K7(); + e10 = sma(this, e10.yg("items", f10.u), this.xt); + if (e10 instanceof ve4) + e10.i.Ob(c10); + else if (e10 instanceof ye4) { + e10 = e10.i; + f10 = c10.s; + var g10 = c10.ca, h10 = new rr().e(g10), k10 = wr(), l10 = this.nS.ua(), m10 = K7(); + jr(k10, e10.ia(l10, m10.u), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else + throw new x7().d(e10); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Vb().Ia(Ti(this.ON.aa, uh().Ff)); + return a10 instanceof z7 ? (a10 = a10.i, kr(wr(), a10.x, q5(jd))) : ld(); + }; + d7.$classData = r8({ bNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasItemsShapeEmitter", { bNa: 1, qha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function fnb() { + Uy.call(this); + this.Dja = this.Qca = this.Rca = this.cda = this.xt = this.Hr = this.o2 = this.Gb = this.Ka = this.Ir = null; + } + fnb.prototype = new rma(); + fnb.prototype.constructor = fnb; + d7 = fnb.prototype; + d7.H = function() { + return "OasPropertyShapeEmitter"; + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fnb) { + var b10 = this.Ir, c10 = a10.Ir; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 && this.o2 === a10.o2 ? (b10 = this.Hr, c10 = a10.Hr, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.xt, a10 = a10.xt, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ir; + case 1: + return this.Ka; + case 2: + return this.Gb; + case 3: + return this.o2; + case 4: + return this.Hr; + case 5: + return this.xt; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Ir.aa, Qi().Vf); + if (b10 instanceof vh || b10 instanceof zi) { + var c10 = this.Qca; + b10 = new PA().e(a10.ca); + var e10 = this.Dja; + if (e10 instanceof ve4) + e10.i.Ob(b10); + else if (e10 instanceof ye4) { + e10 = e10.i; + var f10 = b10.s, g10 = b10.ca, h10 = new rr().e(g10), k10 = wr(), l10 = this.Ka, m10 = this.cda.ua(), p10 = K7(); + jr(k10, l10.zb(e10.ia(m10, p10.u)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else + throw new x7().d(e10); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } else { + c10 = this.Qca; + b10 = new PA().e(a10.ca); + e10 = b10.s; + f10 = b10.ca; + g10 = new rr().e(f10); + h10 = wr(); + k10 = this.cda.ua(); + jr(h10, k10, g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + } + }; + function Lib(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new fnb(); + k10.Ir = a10; + k10.Ka = b10; + k10.Gb = c10; + k10.o2 = e10; + k10.Hr = f10; + k10.xt = g10; + Uy.prototype.bU.call(k10, B6(a10.aa, Qi().Vf), b10, H10(), c10, h10); + b10 = hd(a10.aa, Qi().cl); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d($g(new ah(), "readOnly", b10, y7()))); + k10.cda = b10; + a10 = B6(a10.aa, Qi().cv).A; + a10.b() ? (a10 = B6(k10.Ir.aa, qf().R).A, a10 = a10.b() ? null : a10.c()) : a10 = a10.c(); + k10.Rca = a10; + k10.Qca = mr(T6(), nr(or(), k10.Rca), Q5().Na); + e10 = J5(K7(), new Ib().ha([e10, k10.Rca])); + a10 = K7(); + k10.Dja = sma(k10, f10.ia(e10, a10.u), g10); + return k10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ir.Xa, q5(jd)); + }; + d7.$classData = r8({ oNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasPropertyShapeEmitter", { oNa: 1, qha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function gnb() { + CP.call(this); + this.Za = this.wa = this.nq = null; + } + gnb.prototype = new DP(); + gnb.prototype.constructor = gnb; + d7 = gnb.prototype; + d7.H = function() { + return "FileShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gnb && a10.l === this.l) { + if (this.nq === a10.nq) { + var b10 = this.wa, c10 = a10.wa; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nq; + case 1: + return this.wa; + case 2: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + function hnb(a10, b10, c10, e10) { + var f10 = new gnb(); + f10.nq = b10; + f10.wa = c10; + f10.Za = e10; + CP.prototype.Ux.call(f10, a10); + return f10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.CH = function() { + CP.prototype.Xi.call(this); + kca(this, this.Za, this.wa, this.nq); + var a10 = new M6().W(this.Za), b10 = jx(new je4().e("fileTypes")), c10 = this.l, e10 = gn().OA; + Gg(a10, b10, Hg(Ig(c10, e10, this.l.ra), this.wa)); + return this.wa; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ TNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$FileShapeParser", { TNa: 1, iJ: 1, jJ: 1, f: 1, pha: 1, y: 1, v: 1, q: 1, o: 1 }); + function inb() { + CP.call(this); + this.Za = this.wa = this.nq = this.YJ = null; + this.Cg = false; + } + inb.prototype = new DP(); + inb.prototype.constructor = inb; + d7 = inb.prototype; + d7.H = function() { + return "ScalarShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof inb && a10.l === this.l) { + if (this.nq === a10.nq) { + var b10 = this.wa, c10 = a10.wa; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.fT = function() { + return this.Cg ? this.YJ : this.K9(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nq; + case 1: + return this.wa; + case 2: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.DH = function() { + CP.prototype.Xi.call(this); + var a10 = kca(this, this.Za, this.wa, this.nq), b10 = ac(new M6().W(this.Za), "type"); + if (b10.b()) { + b10 = this.wa; + var c10 = Fg().af; + a10 = ih(new jh(), LC(MC(), a10), new P6().a()); + O7(); + var e10 = new P6().a(); + Rg(b10, c10, a10, e10); + } else + e10 = b10.c(), b10 = this.wa, c10 = Fg().af, a10 = ih(new jh(), LC(MC(), a10), new P6().a()), e10 = Od(O7(), e10), Rg(b10, c10, a10, e10); + return this.wa; + }; + d7.K9 = function() { + if (!this.Cg) { + var a10 = new z7().d(this.wa.j), b10 = new ox().a(), c10 = new Nd().a(); + this.YJ = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return E2a(f10, g10); + }; + }(this, F2a(b10, a10, c10, this.l.ra))); + this.Cg = true; + } + return this.YJ; + }; + function jnb(a10, b10, c10, e10) { + var f10 = new inb(); + f10.nq = b10; + f10.wa = c10; + f10.Za = e10; + CP.prototype.Ux.call(f10, a10); + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ $Na: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$ScalarShapeParser", { $Na: 1, iJ: 1, jJ: 1, f: 1, pha: 1, y: 1, v: 1, q: 1, o: 1 }); + function knb() { + CP.call(this); + this.Za = this.wa = null; + } + knb.prototype = new DP(); + knb.prototype.constructor = knb; + d7 = knb.prototype; + d7.H = function() { + return "SchemaShapeParser"; + }; + d7.E = function() { + return 2; + }; + function lnb(a10, b10, c10) { + var e10 = new knb(); + e10.wa = b10; + e10.Za = c10; + CP.prototype.Ux.call(e10, a10); + CP.prototype.Xi.call(e10); + return e10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof knb && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + var a10 = new M6().W(this.Za), b10 = jx(new je4().e("schema")); + a10 = ac(a10, b10); + if (!a10.b()) { + a10 = a10.c(); + b10 = a10.i; + var c10 = Dd(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) + a10 = b10.i, b10 = this.wa, c10 = pn().Rd, eb(b10, c10, a10); + else { + b10 = this.l.ra; + c10 = sg().q6; + var e10 = this.wa.j; + a10 = a10.i; + var f10 = y7(); + ec(b10, c10, e10, f10, "Cannot parse non string schema shape", a10.da); + a10 = this.wa; + b10 = pn().Rd; + eb(a10, b10, ""); + } + } + a10 = new M6().W(this.Za); + b10 = jx(new je4().e("mediaType")); + a10 = ac(a10, b10); + a10.b() || (a10 = a10.c(), b10 = a10.i, c10 = Dd(), b10 = Iw(b10, c10), b10 instanceof ye4 ? (a10 = b10.i, b10 = this.wa, c10 = pn().Nd, eb(b10, c10, a10)) : (b10 = this.l.ra, c10 = sg().l6, e10 = this.wa.j, a10 = a10.i, f10 = y7(), ec(b10, c10, e10, f10, "Cannot parse non string schema shape", a10.da), a10 = this.wa, b10 = pn().Nd, eb(a10, b10, "*/*"))); + return this.wa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ aOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser$SchemaShapeParser", { aOa: 1, iJ: 1, jJ: 1, f: 1, pha: 1, y: 1, v: 1, q: 1, o: 1 }); + function l7() { + Uy.call(this); + this.xt = this.Hr = this.Gb = this.mu = this.Ka = this.gg = null; + } + l7.prototype = new rma(); + l7.prototype.constructor = l7; + d7 = l7.prototype; + d7.H = function() { + return "OasTypePartEmitter"; + }; + d7.Ob = function(a10) { + var b10 = sma(this, this.Hr, this.xt); + if (b10 instanceof ve4) + b10.i.Ob(a10); + else if (b10 instanceof ye4) { + b10 = b10.i; + var c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), b10, e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } else + throw new x7().d(b10); + }; + d7.E = function() { + return 6; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l7) { + var b10 = this.gg, c10 = a10.gg; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.mu, c10 = a10.mu, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.Hr, c10 = a10.Hr, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.xt, a10 = a10.xt, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gg; + case 1: + return this.Ka; + case 2: + return this.mu; + case 3: + return this.Gb; + case 4: + return this.Hr; + case 5: + return this.xt; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function k7(a10, b10, c10, e10, f10, g10, h10, k10) { + a10.gg = b10; + a10.Ka = c10; + a10.mu = e10; + a10.Gb = f10; + a10.Hr = g10; + a10.xt = h10; + Uy.prototype.bU.call(a10, b10, c10, e10, f10, k10); + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.fR; + a10 = (a10.b() ? H10() : a10.c()).kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.La())); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ gOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypePartEmitter", { gOa: 1, qha: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function fW() { + BX.call(this); + this.sd = this.Ka = this.Gb = this.wn = null; + } + fW.prototype = new IPa(); + fW.prototype.constructor = fW; + d7 = fW.prototype; + d7.H = function() { + return "Raml08NamedSecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fW) { + var b10 = this.wn, c10 = a10.wn; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wn; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Lpa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new edb().cA(b10, c10, e10, a10.sd); + }; + }(this)); + }; + d7.cA = function(a10, b10, c10, e10) { + this.wn = a10; + this.Gb = b10; + this.Ka = c10; + this.sd = e10; + BX.prototype.cA.call(this, a10, b10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ mOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08NamedSecuritySchemeEmitter", { mOa: 1, oPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function bW() { + CX.call(this); + this.sd = this.Gb = this.mu = this.Xa = this.Ka = this.gg = null; + } + bW.prototype = new JPa(); + bW.prototype.constructor = bW; + d7 = bW.prototype; + d7.H = function() { + return "Raml08TypePartEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bW) { + var b10 = this.gg, c10 = a10.gg; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.Xa, c10 = a10.Xa, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.mu, c10 = a10.mu, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gg; + case 1: + return this.Ka; + case 2: + return this.Xa; + case 3: + return this.mu; + case 4: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ka, b10 = this.sd, c10 = new fdb(); + c10.pa = this.gg; + c10.p = a10; + c10.jw = b10; + return c10.Pa(); + }; + d7.z = function() { + return X5(this); + }; + d7.Cr = function(a10, b10, c10, e10, f10, g10) { + this.gg = a10; + this.Ka = b10; + this.Xa = c10; + this.mu = e10; + this.Gb = f10; + this.sd = g10; + CX.prototype.fla.call(this, a10, b10, g10); + return this; + }; + d7.$classData = r8({ yOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypePartEmitter", { yOa: 1, oQa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function J32() { + dX.call(this); + this.sd = this.Gb = this.Ka = this.wn = this.Aa = null; + } + J32.prototype = new UOa(); + J32.prototype.constructor = J32; + d7 = J32.prototype; + d7.H = function() { + return "Raml10DescribedByEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof J32) { + if (this.Aa === a10.Aa) { + var b10 = this.wn, c10 = a10.wn; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Aa; + case 1: + return this.wn; + case 2: + return this.Ka; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.oK = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Xh().Dq); + c10.b() || (c10 = c10.c().r.r, c10 instanceof vh && Dg(b10, kjb(new t72(), c10, this.Ka, this.Gb, aW(/* @__PURE__ */ function(e10) { + return function(f10, g10, h10, k10, l10) { + return new yW().Cr(f10, g10, h10, k10, l10, e10.sd); + }; + }(this)), this.sd))); + ws(b10, ay(this.wn, this.Ka, this.sd).Pa()); + a10 = dX.prototype.oK.call(this, a10); + c10 = K7(); + return a10.ia(b10, c10.u); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.yU = function(a10, b10, c10, e10, f10) { + this.Aa = a10; + this.wn = b10; + this.Ka = c10; + this.Gb = e10; + this.sd = f10; + dX.prototype.yU.call(this, a10, b10, c10, e10, f10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ BOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10DescribedByEmitter", { BOa: 1, Zgb: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function BW() { + BX.call(this); + this.sd = this.Ka = this.Gb = this.wn = null; + } + BW.prototype = new IPa(); + BW.prototype.constructor = BW; + d7 = BW.prototype; + d7.H = function() { + return "Raml10NamedSecuritySchemeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof BW) { + var b10 = this.wn, c10 = a10.wn; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wn; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Lpa = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return new f62().cA(b10, c10, e10, a10.sd); + }; + }(this)); + }; + d7.cA = function(a10, b10, c10, e10) { + this.wn = a10; + this.Gb = b10; + this.Ka = c10; + this.sd = e10; + BX.prototype.cA.call(this, a10, b10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ COa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10NamedSecuritySchemeEmitter", { COa: 1, oPa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function yW() { + CX.call(this); + this.sd = this.Gb = this.mu = this.Xa = this.Ka = this.gg = null; + } + yW.prototype = new JPa(); + yW.prototype.constructor = yW; + d7 = yW.prototype; + d7.H = function() { + return "Raml10TypePartEmitter"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof yW) { + var b10 = this.gg, c10 = a10.gg; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.Xa, c10 = a10.Xa, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.mu, c10 = a10.mu, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.gg; + case 1: + return this.Ka; + case 2: + return this.Xa; + case 3: + return this.mu; + case 4: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Ka, b10 = Q32(this.gg, this.Ka, this.mu, this.Gb, this.sd).Pa(), c10 = this.Xa; + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(c10.Pa())); + c10 = c10.b() ? H10() : c10.c(); + var e10 = K7(); + return a10.zb(b10.ia(c10, e10.u)); + }; + d7.z = function() { + return X5(this); + }; + d7.Cr = function(a10, b10, c10, e10, f10, g10) { + this.gg = a10; + this.Ka = b10; + this.Xa = c10; + this.mu = e10; + this.Gb = f10; + this.sd = g10; + CX.prototype.fla.call(this, a10, b10, g10); + return this; + }; + d7.$classData = r8({ KOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypePartEmitter", { KOa: 1, oQa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function EW() { + lW.call(this); + this.de = this.Ka = this.ND = null; + } + EW.prototype = new POa(); + EW.prototype.constructor = EW; + d7 = EW.prototype; + d7.H = function() { + return "RamlAnnotationEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof EW) { + var b10 = this.ND, c10 = a10.ND; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ND; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.de; + }; + d7.HK = function(a10, b10, c10) { + this.ND = a10; + this.Ka = b10; + lW.prototype.HK.call(this, a10, b10, c10); + a10 = B6(a10.g, Ud().R).A; + this.de = "(" + (a10.b() ? null : a10.c()) + ")"; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ MOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlAnnotationEmitter", { MOa: 1, kha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function P32() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.PN = null; + } + P32.prototype = new zX(); + P32.prototype.constructor = P32; + d7 = P32.prototype; + d7.H = function() { + return "RamlArrayShapeEmitter"; + }; + d7.pC = function() { + return this.So; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof P32) { + var b10 = this.PN, c10 = a10.PN; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.PN; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.g1 = function(a10, b10, c10, e10) { + this.PN = a10; + this.Mc = b10; + this.gd = c10; + this.je = e10; + yX.prototype.Vx.call(this, a10, b10, c10, e10); + a10 = Ab(a10.Xa, q5(b42)); + a10.b() ? a10 = y7() : (a10.c(), a10 = new z7().d("array")); + this.So = a10; + return this; + }; + d7.Pa = function() { + var a10 = J5(Ef(), yX.prototype.Pa.call(this)), b10 = this.PN.aa, c10 = hd(b10, uh().Ff); + c10.b() || (c10.c(), this.EA = true, Dg(a10, new jjb().g1(this.PN, this.Mc, this.gd, this.je))); + c10 = hd(b10, uh().pr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "maxItems", c10, y7(), this.je)))); + c10 = hd(b10, uh().Bq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "minItems", c10, y7(), this.je)))); + c10 = hd(b10, uh().qr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "uniqueItems", c10, y7(), this.je)))); + b10 = hd(b10, uh().RC); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, $g( + new ah(), + fh(new je4().e("collectionFormat")), + b10, + y7() + )))); + this.EA || Dg(a10, cx(new dx(), "type", "array", Q5().Na, ld())); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ SOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlArrayShapeEmitter", { SOa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function GW() { + oW.call(this); + this.Aa = this.sd = this.Gb = this.Ka = this.nh = null; + } + GW.prototype = new QOa(); + GW.prototype.constructor = GW; + d7 = GW.prototype; + d7.H = function() { + return "RamlCustomFacetsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof GW) { + var b10 = this.nh, c10 = a10.nh; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nh; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.JK = function(a10, b10, c10, e10) { + this.nh = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + oW.prototype.dU.call(this, a10, b10, c10, e10); + this.Aa = "facets"; + return this; + }; + d7.bea = function() { + return Vw(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10) { + return mjb(b10, c10, e10, a10.sd); + }; + }(this)); + }; + d7.kL = function() { + return this.Aa; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ WOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlCustomFacetsEmitter", { WOa: 1, mha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ww() { + Xw.call(this); + this.sd = this.Ka = this.Gb = this.FA = null; + } + Ww.prototype = new TOa(); + Ww.prototype.constructor = Ww; + d7 = Ww.prototype; + d7.H = function() { + return "RamlDeclaredTypesEmitters"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ww) { + var b10 = this.FA, c10 = a10.FA; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Gb, c10 = a10.Gb, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.FA; + case 1: + return this.Gb; + case 2: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.tka = function(a10) { + T6(); + var b10 = this.sd.zf.w3, c10 = mh(T6(), b10); + b10 = new PA().e(a10.ca); + var e10 = b10.s, f10 = b10.ca, g10 = new rr().e(f10), h10 = wr(), k10 = this.Ka, l10 = this.FA, m10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + if (v10 instanceof vh) + return new z7().d(kjb(new t72(), v10, t10.Ka, t10.Gb, t10.sd.zf.Dqa(), t10.sd)).ua(); + if (v10 instanceof zi) + return new z7().d(new pjb().FO(v10, t10.Ka, t10.Gb, t10.sd)).ua(); + var A10 = t10.sd.Bc, D10 = Lo().Ix, C10 = v10.j, I10 = y7(), L10 = Ab(v10.fa(), q5(jd)); + v10 = v10.Ib(); + A10.Gc(D10.j, C10, I10, "Cannot emit non WebApi shape", L10, Yb().qb, v10); + return y7().ua(); + }; + }(this)), p10 = K7(); + jr(h10, k10.zb(l10.bd(m10, p10.u)), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = b10.s; + c10 = [c10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = c10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + m10 = c10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = c10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ XOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlDeclaredTypesEmitters", { XOa: 1, iMa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function DW() { + iW.call(this); + this.de = this.Ka = this.$E = null; + } + DW.prototype = new WOa(); + DW.prototype.constructor = DW; + d7 = DW.prototype; + d7.H = function() { + return "RamlFacetsInstanceEmitter"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof DW) { + var b10 = this.$E, c10 = a10.$E; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$E; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.de; + }; + d7.IK = function(a10, b10, c10) { + this.$E = a10; + this.Ka = b10; + iW.prototype.IK.call(this, a10, b10, c10); + a10 = B6(B6(a10.g, Ot().ig).aa, qf().R).A; + this.de = a10.b() ? null : a10.c(); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlFacetsInstanceEmitter", { dPa: 1, nha: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function vjb() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.wa = null; + } + vjb.prototype = new zX(); + vjb.prototype.constructor = vjb; + d7 = vjb.prototype; + d7.H = function() { + return "RamlInlinedUnionShapeEmitter"; + }; + d7.pC = function() { + return this.So; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vjb) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.WK = function(a10, b10, c10, e10) { + this.wa = a10; + this.Mc = b10; + this.gd = c10; + this.je = e10; + yX.prototype.Vx.call(this, a10, b10, c10, e10); + this.So = new z7().d("union"); + return this; + }; + d7.$classData = r8({ hPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlInlinedUnionShapeEmitter", { hPa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function mnb() { + this.N = this.JW = this.Q = this.p = this.pa = null; + } + mnb.prototype = new u7(); + mnb.prototype.constructor = mnb; + d7 = mnb.prototype; + d7.H = function() { + return "RamlJsonShapeEmitter"; + }; + d7.Ob = function(a10) { + var b10 = Ab(this.pa.fa(), q5(xh)); + if (b10 instanceof z7) { + var c10 = b10.i; + if (B6(this.pa.Y(), Ag().Ec).Da()) { + b10 = J5(Ef(), H10()); + gca(this, this.pa, b10, this.p, this.Q, this.N); + Dg(b10, cx(new dx(), this.JW, c10.Vk, Q5().Na, ld())); + c10 = a10.s; + a10 = a10.ca; + var e10 = new rr().e(a10); + jr(wr(), this.p.zb(b10), e10); + pr(c10, mr(T6(), tr(ur(), e10.s, a10), Q5().sa)); + } else + lr(wr(), a10, c10.Vk, Q5().Na); + } else if (y7() !== b10) + throw new x7().d(b10); + }; + d7.E = function() { + return 4; + }; + function a4a(a10, b10, c10, e10, f10) { + var g10 = new mnb(); + g10.pa = a10; + g10.p = b10; + g10.Q = c10; + g10.JW = e10; + g10.N = f10; + return g10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mnb) { + var b10 = this.pa, c10 = a10.pa; + (null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p ? (b10 = this.Q, c10 = a10.Q, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.JW === a10.JW : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pa; + case 1: + return this.p; + case 2: + return this.Q; + case 3: + return this.JW; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.pa.fa(), q5(jd)); + }; + d7.$classData = r8({ mPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlJsonShapeEmitter", { mPa: 1, f: 1, wh: 1, Ma: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function nnb() { + yX.call(this); + this.So = this.gd = this.Mc = this.wa = null; + } + nnb.prototype = new zX(); + nnb.prototype.constructor = nnb; + d7 = nnb.prototype; + d7.H = function() { + return "RamlNilShapeEmitter"; + }; + d7.pC = function() { + return this.So; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof nnb) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = yX.prototype.Pa.call(this); + if (!this.EA) { + var b10 = cx(new dx(), "type", "nil", Q5().Na, ld()); + b10 = J5(K7(), new Ib().ha([b10])); + var c10 = K7(); + a10 = a10.ia(b10, c10.u); + } + return a10; + }; + function g4a(a10, b10, c10, e10) { + var f10 = new nnb(); + f10.wa = a10; + f10.Mc = b10; + f10.gd = c10; + yX.prototype.Vx.call(f10, a10, b10, c10, e10); + f10.So = new z7().d("nil"); + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlNilShapeEmitter", { qPa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function onb() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.Bm = null; + } + onb.prototype = new zX(); + onb.prototype.constructor = onb; + d7 = onb.prototype; + d7.H = function() { + return "RamlNodeShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.pC = function() { + return this.So; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof onb) { + var b10 = this.Bm, c10 = a10.Bm; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bm; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), yX.prototype.Pa.call(this)), b10 = this.Bm.aa, c10 = hd(b10, Ih().dw); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "minProperties", c10, y7(), this.je)))); + c10 = hd(b10, Ih().cw); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "maxProperties", c10, y7(), this.je)))); + var e10 = B6(this.Bm.aa, Ih().kh).Od(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = B6(h10.aa, Qi().cv); + return !oN(h10); + }; + }(this))); + c10 = hd(b10, Ih().Cn); + if (!c10.b()) { + c10 = c10.c(); + var f10 = B6(this.Bm.aa, Ih().Cn); + f10 = Ic(f10); + e10 || !f10 && !wh(c10.r.x, q5(b42)) || (e10 = !f10, f10 = Q5().ti, wr(), Dg(a10, cx( + new dx(), + "additionalProperties", + "" + e10, + f10, + kr(0, c10.r.x, q5(jd)) + ))); + } + c10 = hd(b10, Ih().vF); + c10.b() || (c10 = c10.c(), e10 = fh(new je4().e("additionalProperties")), f10 = this.je, new z7().d(Dg(a10, Cib(e10, c10, this.Mc, this.gd, new YV().Ti(f10.Bc, f10.oy, new Yf().a()))))); + c10 = hd(b10, Ih().Us); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "discriminator", c10, y7(), this.je)))); + c10 = hd(b10, Ih().Jy); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "discriminatorValue", c10, y7(), this.je)))); + c10 = hd(b10, Ih().kh); + c10.b() || (c10 = c10.c(), this.EA = true, new z7().d(Dg(a10, new ljb().JK(c10, this.Mc, this.gd, this.je)))); + c10 = Aha(); + e10 = B6(this.Bm.aa, Ih().kh); + f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return new R6().M(h10.j, h10); + }; + }(this)); + var g10 = K7(); + c10 = Rb(c10, e10.ka(f10, g10.u)); + b10 = hd(b10, Ih().VC); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, tjb(b10, this.Mc, c10, this.je)))); + this.EA || Dg(a10, cx(new dx(), "type", "object", Q5().Na, ld())); + return a10; + }; + function b4a(a10, b10, c10, e10) { + var f10 = new onb(); + f10.Bm = a10; + f10.Mc = b10; + f10.gd = c10; + f10.je = e10; + yX.prototype.Vx.call(f10, a10, b10, c10, e10); + a10 = Ab(a10.Xa, q5(b42)); + a10.b() ? a10 = y7() : (a10.c(), a10 = new z7().d("object")); + f10.So = a10; + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ rPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlNodeShapeEmitter", { rPa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function pnb() { + this.dda = this.N = this.Q = this.VU = this.Yk = null; + } + pnb.prototype = new u7(); + pnb.prototype.constructor = pnb; + d7 = pnb.prototype; + d7.pqa = function() { + return this.Yk; + }; + d7.H = function() { + return "RamlTagToReferenceEmitter"; + }; + d7.Ob = function(a10) { + var b10 = this.Q.Fb(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + if (e10 instanceof bg) + return ar(e10.g, Af().Ic).Ha(c10.Yk); + if (Kk(e10)) { + e10 = e10.qe(); + var f10 = c10.Yk; + return null === e10 ? null === f10 : e10.h(f10); + } + throw new x7().d(e10); + }; + }(this))); + b10 instanceof z7 && Kk(b10.i) ? ex(this.N, a10, this.dda) : lr(wr(), a10, this.dda, Q5().Na); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pnb) { + var b10 = this.Yk, c10 = a10.Yk; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.VU, c10 = a10.VU, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Yk; + case 1: + return this.VU; + case 2: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.Hia = function(a10) { + this.dda = a10; + }; + d7.t = function() { + return V5(W5(), this); + }; + function qka(a10, b10, c10, e10) { + var f10 = new pnb(); + f10.Yk = a10; + f10.VU = b10; + f10.Q = c10; + f10.N = e10; + OEa(f10); + return f10; + } + d7.Tma = function() { + return this.VU; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Yk.fa(), q5(jd)); + }; + d7.$classData = r8({ NPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTagToReferenceEmitter", { NPa: 1, f: 1, wh: 1, Ma: 1, XJa: 1, y: 1, v: 1, q: 1, o: 1 }); + function f4a() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.fQ = null; + } + f4a.prototype = new zX(); + f4a.prototype.constructor = f4a; + d7 = f4a.prototype; + d7.H = function() { + return "RamlTupleShapeEmitter"; + }; + d7.pC = function() { + return this.So; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof f4a) { + var b10 = this.fQ, c10 = a10.fQ; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.fQ; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.waa = function(a10, b10, c10, e10) { + this.fQ = a10; + this.Mc = b10; + this.gd = c10; + this.je = e10; + yX.prototype.Vx.call(this, a10, b10, c10, e10); + a10 = Ab(a10.Xa, q5(b42)); + a10.b() ? a10 = y7() : (a10.c(), a10 = new z7().d("array")); + this.So = a10; + return this; + }; + d7.Pa = function() { + var a10 = J5(Ef(), yX.prototype.Pa.call(this)), b10 = this.fQ.aa; + Dg(a10, new wjb().waa(this.fQ, this.Mc, this.gd, this.je)); + Dg(a10, cx(new dx(), fh(new je4().e("tuple")), "true", Q5().ti, ld())); + var c10 = hd(b10, uh().pr); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "maxItems", c10, y7(), this.je)))); + c10 = hd(b10, uh().Bq); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, Yg(Zg(), "minItems", c10, y7(), this.je)))); + b10 = hd(b10, uh().qr); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, Yg(Zg(), "uniqueItems", b10, y7(), this.je)))); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ PPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTupleShapeEmitter", { PPa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function c4a() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.wa = null; + } + c4a.prototype = new zX(); + c4a.prototype.constructor = c4a; + d7 = c4a.prototype; + d7.H = function() { + return "RamlUnionShapeEmitter"; + }; + d7.pC = function() { + return this.So; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof c4a) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + if (B6(this.wa.aa, xn().Le).b() && B6(this.wa.aa, qf().xd).Da()) + var a10 = H10(); + else { + a10 = K7(); + var b10 = [new ejb().WK(this.wa, this.Mc, this.gd, this.je)]; + a10 = J5(a10, new Ib().ha(b10)); + } + b10 = yX.prototype.Pa.call(this); + var c10 = K7(); + return b10.ia(a10, c10.u); + }; + d7.z = function() { + return X5(this); + }; + d7.WK = function(a10, b10, c10, e10) { + this.wa = a10; + this.Mc = b10; + this.gd = c10; + this.je = e10; + yX.prototype.Vx.call(this, a10, b10, c10, e10); + this.So = new z7().d("union"); + return this; + }; + d7.$classData = r8({ rQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlUnionShapeEmitter", { rQa: 1, fD: 1, gD: 1, f: 1, Vy: 1, y: 1, v: 1, q: 1, o: 1 }); + function X2a() { + this.Bc = this.p = this.Ba = this.la = null; + } + X2a.prototype = new u7(); + X2a.prototype.constructor = X2a; + d7 = X2a.prototype; + d7.H = function() { + return "TraitExtendsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof X2a) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + IGa(this, a10); + }; + d7.d$ = function(a10) { + var b10 = new j7(), c10 = this.p, e10 = this.Bc; + b10.Ei = a10; + b10.p = c10; + b10.Bc = e10; + return b10; + }; + d7.Bja = function(a10) { + var b10 = new tdb(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.kL = function() { + return this.la; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ GQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.TraitExtendsEmitter", { GQa: 1, f: 1, GTa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function i7() { + n62.call(this); + this.ra = null; + } + i7.prototype = new Gjb(); + i7.prototype.constructor = i7; + function qnb(a10, b10) { + var c10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + O7(); + var k10 = new P6().a(); + k10 = new ym().K(new S6().a(), k10); + if (!h10.b()) { + h10 = h10.c(); + var l10 = xm().Nd; + new z7().d(eb(k10, l10, h10)); + } + h10 = g10.j; + J5(K7(), H10()); + return Ai(k10, h10); + }; + }(a10, b10)), e10 = ac(new M6().W(a10.X), "content"); + e10.b() || (e10 = e10.c(), c10 = new h42().NO(e10, c10, wz(uz(), a10.ra)).GH(), tc(c10) && (a10 = Dm().Ne, c10 = Zr(new $r(), c10, new P6().a()), e10 = Od(O7(), e10), Rg(b10, a10, c10, e10))); + } + i7.prototype.OL = function() { + var a10 = ac(new M6().W(this.X), "$ref"); + if (a10 instanceof z7) + return Ojb(this, a10.i, this.we); + if (y7() === a10) { + a10 = Sjb(this); + rnb(this, a10); + var b10 = f5a(this.X, a10.j, this.ra).Vg(); + if (b10.Da()) { + var c10 = xm().Ec; + b10 = Zr(new $r(), b10, new P6().a()); + Vd(a10, c10, b10); + } + qnb(this, a10); + c10 = B6(a10.g, cj().We).A; + c10.b() || "query" !== c10.c() || (c10 = cj().Su, Bi(a10, c10, false), c10 = cj().wF, Bi(a10, c10, false), c10 = new M6().W(this.X), b10 = cj().Su, b10 = Hg(Ig(this, b10, this.ra), a10), Gg(c10, "allowReserved", rP(b10, new xi().a())), c10 = new M6().W(this.X), b10 = cj().wF, b10 = Hg(Ig(this, b10, this.ra), a10), Gg( + c10, + "allowEmptyValue", + rP(b10, new xi().a()) + )); + OPa(GX(), this.X, a10); + NPa(GX(), this.X, a10); + c10 = new M6().W(this.X); + b10 = cj().uh; + Gg(c10, "deprecated", Hg(Ig(this, b10, this.ra), a10)); + PPa(GX(), this.X, a10, this.ra); + return Dz(Ez(), a10, y7()); + } + throw new x7().d(a10); + }; + function rnb(a10, b10) { + var c10 = ac(new M6().W(a10.X), "schema"); + if (!c10.b() && (c10 = c10.c(), a10 = nX(pX(), c10, w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10 = w7(f10, h10); + var k10 = g10.j, l10 = lt2(); + h10.ub(k10, l10); + }; + }(a10, b10)), new Qy().$G("schema", a10.ra), wz(uz(), a10.ra)).Cc(), !a10.b())) { + a10 = a10.c(); + var e10 = cj().Jc; + c10 = Od(O7(), c10); + new z7().d(Rg(b10, e10, a10, c10)); + } + } + i7.prototype.YO = function(a10, b10, c10, e10, f10) { + this.ra = f10; + n62.prototype.YO.call(this, a10, b10, c10, e10, f10); + return this; + }; + i7.prototype.$classData = r8({ gRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Oas3ParameterParser", { gRa: 1, tha: 1, f: 1, DRa: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function TO() { + this.Ka = this.$w = null; + } + TO.prototype = new tQa(); + TO.prototype.constructor = TO; + d7 = TO.prototype; + d7.H = function() { + return "OasSecurityRequirementEmitter"; + }; + d7.Ob = function(a10) { + var b10 = a10.s; + a10 = a10.ca; + var c10 = new rr().e(a10); + B6(this.$w.g, rm2().Gh).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = hd(g10.g, im().Oh); + if (h10 instanceof z7) { + h10 = h10.i.r.r; + if (h10 instanceof wE) { + var k10 = B6(h10.g, xE().Ap).kc().ua(); + h10 = /* @__PURE__ */ function(D10) { + return function(C10) { + C10 = B6(C10.g, Jm().lo); + var I10 = w6(/* @__PURE__ */ function() { + return function(Y10) { + var ia = B6(Y10.g, Gm().R).A; + return hV(new iV(), ih(new jh(), ia.b() ? null : ia.c(), Y10.x), Q5().Na); + }; + }(D10)), L10 = K7(); + return C10.ka(I10, L10.u); + }; + }(e10); + if (ii().u === ii().u) + if (k10 === H10()) + h10 = H10(); + else { + for (var l10 = k10, m10 = new Uj().eq(false), p10 = new qd().d(null), t10 = new qd().d(null); l10 !== H10(); ) { + var v10 = l10.ga(); + h10(v10).Hd().U(w6(/* @__PURE__ */ function(D10, C10, I10, L10) { + return function(Y10) { + C10.oa ? (Y10 = ji(Y10, H10()), L10.oa.Nf = Y10, L10.oa = Y10) : (I10.oa = ji(Y10, H10()), L10.oa = I10.oa, C10.oa = true); + }; + }(k10, m10, p10, t10))); + l10 = l10.ta(); + } + h10 = m10.oa ? p10.oa : H10(); + } + else { + ii(); + for (l10 = new Lf().a(); !k10.b(); ) + m10 = k10.ga(), m10 = h10(m10).Hd(), ws(l10, m10), k10 = k10.ta(); + h10 = l10.ua(); + } + } else + h10 instanceof uE ? (h10 = B6(h10.g, vE().lo), k10 = w6(/* @__PURE__ */ function() { + return function(D10) { + var C10 = B6(D10.g, Gm().R).A; + return hV(new iV(), ih(new jh(), C10.b() ? null : C10.c(), D10.x), Q5().Na); + }; + }(e10)), l10 = K7(), h10 = h10.ka(k10, l10.u)) : h10 = H10(); + T6(); + g10 = B6(g10.g, im().R).A; + g10 = g10.b() ? null : g10.c(); + k10 = mh(T6(), g10); + g10 = new PA().e(f10.ca); + l10 = g10.s; + p10 = g10.ca; + m10 = new PA().e(p10); + vr(wr(), e10.Ka.zb(h10), m10); + T6(); + eE(); + h10 = SA(zs(), p10); + h10 = mr(0, new Sx().Ac(h10, m10.s), Q5().cd); + pr(l10, h10); + h10 = g10.s; + k10 = [k10]; + if (0 > h10.w) + throw new U6().e("0"); + m10 = k10.length | 0; + l10 = h10.w + m10 | 0; + uD(h10, l10); + Ba(h10.L, 0, h10.L, m10, h10.w); + m10 = h10.L; + v10 = m10.n.length; + t10 = p10 = 0; + var A10 = k10.length | 0; + v10 = A10 < v10 ? A10 : v10; + A10 = m10.n.length; + for (v10 = v10 < A10 ? v10 : A10; p10 < v10; ) + m10.n[t10] = k10[p10], p10 = 1 + p10 | 0, t10 = 1 + t10 | 0; + h10.w = l10; + pr(f10.s, vD(wD(), g10.s)); + } else if (y7() === h10) { + T6(); + g10 = B6(g10.g, im().R).A; + g10 = g10.b() ? null : g10.c(); + k10 = mh(T6(), g10); + g10 = new PA().e(f10.ca); + h10 = g10.s; + m10 = g10.ca; + l10 = new PA().e(m10); + T6(); + eE(); + m10 = SA(zs(), m10); + l10 = mr(0, new Sx().Ac(m10, l10.s), Q5().cd); + pr(h10, l10); + h10 = g10.s; + k10 = [k10]; + if (0 > h10.w) + throw new U6().e("0"); + m10 = k10.length | 0; + l10 = h10.w + m10 | 0; + uD(h10, l10); + Ba(h10.L, 0, h10.L, m10, h10.w); + m10 = h10.L; + v10 = m10.n.length; + t10 = p10 = 0; + A10 = k10.length | 0; + v10 = A10 < v10 ? A10 : v10; + A10 = m10.n.length; + for (v10 = v10 < A10 ? v10 : A10; p10 < v10; ) + m10.n[t10] = k10[p10], p10 = 1 + p10 | 0, t10 = 1 + t10 | 0; + h10.w = l10; + pr(f10.s, vD(wD(), g10.s)); + } else + throw new x7().d(h10); + }; + }(this, c10))); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof TO) { + var b10 = this.$w, c10 = a10.$w; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$w; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.$w.x, q5(jd)); + }; + d7.$classData = r8({ WRa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.OasSecurityRequirementEmitter", { WRa: 1, zTa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function gW() { + TX.call(this); + this.Gb = this.HD = this.Ka = this.uk = null; + } + gW.prototype = new iQa(); + gW.prototype.constructor = gW; + d7 = gW.prototype; + d7.H = function() { + return "Raml08EndPointEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gW) { + var b10 = this.uk, c10 = a10.uk; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.HD, c10 = a10.HD, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uk; + case 1: + return this.Ka; + case 2: + return this.HD; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.i1 = function(a10, b10, c10, e10, f10) { + this.uk = a10; + this.Ka = b10; + this.HD = c10; + this.Gb = e10; + TX.prototype.dla.call(this, b10, c10, e10, f10); + return this; + }; + d7.RD = function(a10) { + var b10 = TX.prototype.RD.call(this, a10), c10 = Yv(), e10 = B6(this.uk.g, Jl().Uf).A; + c10 = Dja(c10, e10.b() ? null : e10.c()); + a10 = hd(a10, Jl().Wm); + if (!a10.b()) { + a10 = a10.c(); + if (a10.r.r.wb.Od(w6(/* @__PURE__ */ function() { + return function(g10) { + return !wh(g10.fa(), q5(IR)); + }; + }(this)))) { + e10 = H10(); + e10 = new qd().d(e10); + var f10 = H10(); + f10 = new qd().d(f10); + a10.r.r.wb.U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + if (m10 instanceof Wl) { + var p10 = B6(m10.g, cj().R).A; + h10.Ha(p10.b() ? null : p10.c()) ? p10 = true : (p10 = B6(m10.g, cj().gw).A, p10 = h10.Ha(p10.b() ? null : p10.c())); + if (p10) { + p10 = k10.oa; + m10 = J5(K7(), new Ib().ha([m10])); + var t10 = K7(); + k10.oa = p10.ia( + m10, + t10.u + ); + } else + p10 = l10.oa, m10 = J5(K7(), new Ib().ha([m10])), t10 = K7(), l10.oa = p10.ia(m10, t10.u); + } else + throw new x7().d(m10); + }; + }(this, c10, f10, e10))); + c10 = Jl().Wm; + f10 = Zr(new $r(), f10.oa, new P6().a()); + Dg(b10, new eX().Sq("uriParameters", lh(c10, kh(f10, a10.r.x)), this.Ka, this.Gb, this.N)); + c10 = Jl().Wm; + e10 = Zr(new $r(), e10.oa, new P6().a()); + a10 = Dg(b10, new eX().Sq("baseUriParameters", lh(c10, kh(e10, a10.r.x)), this.Ka, this.Gb, this.N)); + } else + a10 = void 0; + new z7().d(a10); + } + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ mSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08EndPointEmitter", { mSa: 1, SSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function qW() { + WX.call(this); + this.U_ = this.Gb = this.Ka = this.Bs = null; + } + qW.prototype = new mQa(); + qW.prototype.constructor = qW; + d7 = qW.prototype; + d7.H = function() { + return "Raml08OperationEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qW) { + var b10 = this.Bs, c10 = a10.Bs; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bs; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.XK = function(a10, b10, c10, e10) { + this.Bs = a10; + this.Ka = b10; + this.Gb = c10; + WX.prototype.XK.call(this, a10, b10, c10, e10); + this.U_ = "baseUriParameters"; + return this; + }; + d7.$classData = r8({ pSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08OperationEmitter", { pSa: 1, $Sa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function cW() { + $X.call(this); + this.sd = this.Gb = this.Ka = this.jq = null; + } + cW.prototype = new nQa(); + cW.prototype.constructor = cW; + d7 = cW.prototype; + d7.H = function() { + return "Raml08ParameterEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof cW) { + var b10 = this.jq, c10 = a10.jq; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jq; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.iK = function(a10, b10) { + a10 = hd(a10, cj().R).c(); + hV(new iV(), a10.r.r, Q5().Na).Ob(b10); + }; + d7.j1 = function(a10, b10, c10, e10) { + this.jq = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + $X.prototype.Ala.call(this, a10, c10, e10); + return this; + }; + d7.s0 = function(a10) { + var b10 = B6(this.jq.g, cj().Jc), c10 = b10 instanceof vh ? /* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.s; + h10 = h10.ca; + var l10 = new rr().e(h10), m10 = J5(Ef(), H10()), p10 = cPa(dPa(), g10, f10.Ka, 0, f10.sd).tw; + a: { + if (p10 instanceof ve4) { + var t10 = p10.i; + if (null !== t10) { + p10 = new QX(); + p10.GM = t10; + Dg(m10, p10); + break a; + } + } + if (p10 instanceof ye4 && (t10 = p10.i, null !== t10)) { + ws(m10, t10); + break a; + } + throw new x7().d(p10); + } + p10 = hd(f10.jq.g, cj().yj); + p10 = p10.b() || wh(p10.c().r.x, q5(b42)) ? p10 : y7(); + p10.b() || (p10 = p10.c(), new z7().d(Dg(m10, Yg(Zg(), "required", p10, y7(), f10.sd)))); + jr(wr(), f10.Ka.zb(m10), l10); + pr(k10, mr(T6(), tr(ur(), l10.s, h10), Q5().sa)); + }; + }( + this, + b10 + ) : /* @__PURE__ */ function(f10, g10) { + return function(h10) { + g10.Ob(h10); + }; + }(this, new e62().GK(b10, "Cannot emit " + la(b10).t() + " type of shape in raml 08")), e10 = new PA().e(a10.ca); + this.iK(this.jq.g, e10); + b10 = new PA().e(a10.ca); + c10(b10); + c10 = xF(e10.s, 0); + sr(a10, c10, xF(b10.s, 0)); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08ParameterEmitter", { qSa: 1, bTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function iQ() { + aY.call(this); + this.iw = this.ic = null; + this.Lg = false; + } + iQ.prototype = new oQa(); + iQ.prototype.constructor = iQ; + d7 = iQ.prototype; + d7.SB = function() { + var a10 = new Qg().Vb(this.ic.Aa, this.m), b10 = aqa(cqa(), this.ic), c10 = cj().R, e10 = a10.Zf(); + b10 = Vd(b10, c10, e10); + c10 = a10.Zf().t(); + e10 = cj().gw; + b10 = eb(b10, e10, c10); + this.iw.P(b10); + c10 = this.ic.i.hb().gb; + if (Q5().nd === c10) { + if (c10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + O7(); + var l10 = new P6().a(); + k10 = Sd(k10, "schema", l10); + l10 = h10.j; + var m10 = lt2(); + return k10.ub(l10, m10); + }; + }(this, b10)), RW(false, false), QP(), this.m).Cc(), !c10.b()) { + c10 = c10.c(); + HC(EC(), c10, b10.j, y7()).fa().Lb(new Xz().a()); + e10 = cj().Jc; + var f10 = Od(O7(), this.ic); + Rg(b10, e10, c10, f10); + } + } else + c10 = wW(xW(), this.ic, w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = h10.Zf().t(); + O7(); + var p10 = new P6().a(); + l10 = Sd(l10, m10, p10); + m10 = k10.j; + p10 = lt2(); + return l10.ub(m10, p10); + }; + }(this, a10, b10)), false, QP(), this.m).Cc(), c10.b() || (c10 = c10.c(), c10 = HC(EC(), c10, b10.j, y7()), e10 = cj().Jc, Vd(b10, e10, c10)); + c10 = jc(kc(this.ic.i), qc()); + c10 instanceof z7 && (c10 = new M6().W(c10.i), e10 = cj().yj, e10 = Hg(Ig(this, e10, this.m), b10), Gg(c10, "required", rP(e10, new xi().a()))); + hd(b10.g, cj().yj).b() && (c10 = cj().yj, Bi(b10, c10, false)); + c10 = a10.Zf().t(); + this.Lg && Ed(ua(), c10, "?") && (e10 = cj().fw, Bi(b10, e10, true), c10 = new qg().e(c10), c10 = aQ(c10, "?"), e10 = cj().R, a10 = ih(new jh(), c10, a10.Zf().x), a10 = Vd(b10, e10, a10), e10 = cj().gw, eb(a10, e10, c10)); + return b10; + }; + d7.H = function() { + return "Raml08ParameterParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.iw = b10; + this.Lg = c10; + aY.prototype.ema.call(this, e10); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof iQ) { + if (this.ic === a10.ic) { + var b10 = this.iw, c10 = a10.iw; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.iw; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.iw)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ sSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08ParameterParser", { sSa: 1, cTa: 1, f: 1, lr: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function eW() { + this.N = this.Q = this.p = this.Ba = this.la = null; + } + eW.prototype = new u7(); + eW.prototype.constructor = eW; + d7 = eW.prototype; + d7.H = function() { + return "Raml08PayloadsEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof eW) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = new PA().e(a10.ca); + T4a(new c42(), this.la, Q5().Na).Ob(b10); + var c10 = new PA().e(a10.ca), e10 = this.Ba.r.r.wb, f10 = new Vdb(), g10 = K7(); + e10 = e10.ec(f10, g10.u); + if (e10.b()) + T6(), e10 = ur().ce, T6(), e10 = mr(T6(), e10, Q5().sa), pr(c10.s, e10); + else + a: { + f10 = w6(/* @__PURE__ */ function(t10) { + return function(v10) { + var A10 = t10.p, D10 = t10.N, C10 = new H5a(); + C10.le = v10; + C10.p = A10; + C10.Iia = D10; + var I10 = false, L10 = null; + v10 = Vb().Ia(B6(v10.g, xm().Jc)); + a: { + if (v10 instanceof z7) { + I10 = true; + L10 = v10; + var Y10 = L10.i; + if (null !== Y10 && wh(Y10.fa(), q5(IR))) { + A10 = H10(); + break a; + } + } + if (I10 && (Y10 = L10.i, Y10 instanceof Hh && !Za(Y10).na() && Ab(Y10.Xa, q5(xh)).b())) { + A10 = J5(K7(), new Ib().ha([vkb( + Y10, + A10, + D10 + )])); + break a; + } + if (I10 && (Y10 = L10.i, Y10 instanceof vh)) { + A10 = cPa(dPa(), Y10, A10, J5(K7(), H10()), D10).Pa(); + break a; + } + if (I10) + D10 = L10.i, A10 = K7(), D10 = [new e62().GK(D10, "Cannot emit schema " + la(D10).t() + " in raml 08 body request")], A10 = J5(A10, new Ib().ha(D10)); + else if (y7() === v10) + A10 = K7(), D10 = [new SX().naa(C10)], A10 = J5(A10, new Ib().ha(D10)); + else + throw new x7().d(v10); + } + C10.Dea = A10; + return C10.Pa(); + }; + }(this)), g10 = K7(), e10 = e10.bd(f10, g10.u), K7(); + f10 = new z7().d(e10); + if (null !== f10.i && 0 === f10.i.Oe(1) && (f10 = f10.i.lb(0), zr(f10))) { + f10.Ob(c10); + break a; + } + if (e10.oh(w6(/* @__PURE__ */ function() { + return function(t10) { + return yr(t10); + }; + }(this)))) { + f10 = c10.s; + g10 = c10.ca; + var h10 = new rr().e(g10), k10 = wr(), l10 = this.p, m10 = new Udb(), p10 = K7(); + jr(k10, l10.zb(e10.ec(m10, p10.u)), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + } else + throw mb(E6(), new nb().e("IllegalTypeDeclarations found: " + e10)); + } + b10 = xF(b10.s, 0); + sr(a10, b10, xF(c10.s, 0)); + }; + d7.s1 = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ ySa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08PayloadsEmitter", { ySa: 1, f: 1, jTa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function pW() { + bY.call(this); + this.Gb = this.Ka = this.ZB = null; + } + pW.prototype = new pQa(); + pW.prototype.constructor = pW; + d7 = pW.prototype; + d7.H = function() { + return "Raml08ResponseEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pW) { + var b10 = this.ZB, c10 = a10.ZB; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ZB; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.MO = function(a10, b10, c10, e10) { + this.ZB = a10; + this.Ka = b10; + this.Gb = c10; + bY.prototype.MO.call(this, a10, b10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ CSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml08ResponseEmitter", { CSa: 1, nTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function CW() { + TX.call(this); + this.Gb = this.HD = this.Ka = this.uk = null; + } + CW.prototype = new iQa(); + CW.prototype.constructor = CW; + d7 = CW.prototype; + d7.H = function() { + return "Raml10EndPointEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof CW) { + var b10 = this.uk, c10 = a10.uk; + (null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka ? (b10 = this.HD, c10 = a10.HD, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.uk; + case 1: + return this.Ka; + case 2: + return this.HD; + case 3: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.i1 = function(a10, b10, c10, e10, f10) { + this.uk = a10; + this.Ka = b10; + this.HD = c10; + this.Gb = e10; + TX.prototype.dla.call(this, b10, c10, e10, f10); + return this; + }; + d7.RD = function(a10) { + var b10 = TX.prototype.RD.call(this, a10), c10 = hd(a10, Jl().Ne); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, new AW().s1(fh(new je4().e("payloads")), c10, this.Ka, this.Gb, this.N)))); + a10 = hd(a10, Jl().Wm); + if (!a10.b()) { + a10 = a10.c(); + if (a10.r.r.wb.Od(w6(/* @__PURE__ */ function() { + return function(m10) { + return !wh(m10.fa(), q5(IR)); + }; + }(this)))) { + var e10 = a10.r.r.wb.Dm(w6(/* @__PURE__ */ function() { + return function(m10) { + m10 = B6(m10.g, cj().We); + return xb(m10, "path"); + }; + }(this))); + if (null === e10) + throw new x7().d(e10); + c10 = e10.ma(); + e10 = e10.ya(); + var f10 = fh(new je4().e("parameters")), g10 = this.Ka, h10 = this.Gb, k10 = H10(), l10 = this.N; + l10 = new YV().Ti(l10.Bc, l10.oy, new Yf().a()); + ws(b10, h5a(g5a(new n42(), f10, e10, g10, k10, h10, l10))); + c10.Da() ? (e10 = Jl().Wm, a10 = lh(e10, kh(Zr(new $r(), c10, a10.r.r.fa()), a10.r.x)), a10 = Dg(b10, new eX().Sq("uriParameters", a10, this.Ka, this.Gb, this.N))) : a10 = void 0; + } else + a10 = void 0; + new z7().d(a10); + } + return b10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ FSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10EndPointEmitter", { FSa: 1, SSa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function IW() { + WX.call(this); + this.U_ = this.sd = this.Gb = this.Ka = this.Bs = null; + } + IW.prototype = new mQa(); + IW.prototype.constructor = IW; + d7 = IW.prototype; + d7.H = function() { + return "Raml10OperationEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof IW) { + var b10 = this.Bs, c10 = a10.Bs; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bs; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.oK = function(a10) { + a10 = WX.prototype.oK.call(this, a10); + var b10 = J5(Ef(), H10()), c10 = Vb().Ia(AD(this.Bs)); + if (!c10.b()) { + c10 = c10.c(); + var e10 = hd(c10.g, Am().Dq); + if (!e10.b()) { + var f10 = e10.c(); + e10 = false; + var g10 = null; + f10 = Vb().Ia(f10.r.r); + a: { + if (f10 instanceof z7 && (e10 = true, g10 = f10, f10 = g10.i, f10 instanceof vh)) { + Dg(b10, kjb(new t72(), f10, this.Ka, this.Gb, aW(/* @__PURE__ */ function(l10) { + return function(m10, p10, t10, v10, A10) { + return new yW().Cr(m10, p10, t10, v10, A10, l10.sd); + }; + }(this)), this.sd)); + break a; + } + if (e10) { + f10 = g10.i; + e10 = this.sd.Bc; + g10 = dc().Fh; + c10 = c10.j; + var h10 = y7(), k10 = Ab(f10.fa(), q5(jd)); + f10 = f10.Ib(); + e10.Gc( + g10.j, + c10, + h10, + "Cannot emit non WebApi Shape", + k10, + Yb().qb, + f10 + ); + } + } + } + } + b10 = ws(new Lf().a(), b10); + a10 = a10.Hd(); + b10 = ws(b10, a10); + a10 = ay(this.Bs, this.Ka, this.sd).Pa(); + b10 = ws(new Lf().a(), b10); + a10 = a10.Hd(); + return ws(b10, a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.XK = function(a10, b10, c10, e10) { + this.Bs = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + WX.prototype.XK.call(this, a10, b10, c10, e10); + this.U_ = fh(new je4().e("baseUriParameters")); + return this; + }; + d7.$classData = r8({ HSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10OperationEmitter", { HSa: 1, $Sa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function zW() { + $X.call(this); + this.sd = this.Gb = this.Ka = this.jq = null; + } + zW.prototype = new nQa(); + zW.prototype.constructor = zW; + d7 = zW.prototype; + d7.H = function() { + return "Raml10ParameterEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zW) { + var b10 = this.jq, c10 = a10.jq; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.jq; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.iK = function(a10, b10) { + var c10 = hd(a10, cj().yj); + (c10.b() ? 0 : wh(c10.c().r.x, q5(b42))) ? c10 = false : (c10 = B6(this.jq.g, cj().yj), c10 = !Ic(c10)); + c10 ? (a10 = B6(this.jq.g, cj().R).A, hV(new iV(), ih(new jh(), (a10.b() ? null : a10.c()) + "?", new P6().a()), Q5().Na).Ob(b10)) : (a10 = hd(a10, cj().R).c(), hV(new iV(), a10.r.r, Q5().Na).Ob(b10)); + }; + d7.j1 = function(a10, b10, c10, e10) { + this.jq = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + $X.prototype.Ala.call(this, a10, c10, e10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.s0 = function(a10) { + var b10 = this.jq.g; + if (Vb().Ia(B6(this.jq.g, cj().Jc)).na() && wh(B6(this.jq.g, cj().Jc).fa(), q5(IR))) { + var c10 = new PA().e(a10.ca); + this.iK(b10, c10); + var e10 = new PA().e(a10.ca); + lr(wr(), e10, "", Q5().nd); + c10 = xF(c10.s, 0); + sr(a10, c10, xF(e10.s, 0)); + } else { + e10 = new PA().e(a10.ca); + this.iK(b10, e10); + c10 = new PA().e(a10.ca); + var f10 = c10.s, g10 = c10.ca, h10 = new rr().e(g10), k10 = J5(Ef(), H10()), l10 = hd(b10, cj().Va); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, Yg(Zg(), "description", l10, y7(), this.sd)))); + l10 = hd(b10, cj().yj); + l10 = l10.b() || wh(l10.c().r.x, q5(b42)) ? l10 : y7(); + l10.b() || (l10 = l10.c(), new z7().d(Dg(k10, Yg( + Zg(), + "required", + l10, + y7(), + this.sd + )))); + var m10 = false, p10 = null, t10 = Vb().Ia(B6(this.jq.g, cj().Jc)); + a: { + if (t10 instanceof z7 && (m10 = true, p10 = t10, l10 = p10.i, l10 instanceof vh && Za(l10).na())) { + m10 = this.Ka; + p10 = K7(); + t10 = [Ag().Va]; + l10 = Q32(l10, m10, J5(p10, new Ib().ha(t10)), this.Gb, this.sd).Pa().kc(); + l10.b() || (l10 = l10.c(), Dg(k10, ky("type", l10, Q5().Na, ld()))); + break a; + } + if (m10 && (l10 = p10.i, l10 instanceof vh)) { + m10 = this.Ka; + p10 = K7(); + t10 = [Ag().Va]; + ws(k10, Q32(l10, m10, J5(p10, new Ib().ha(t10)), this.Gb, this.sd).zw()); + break a; + } + if (m10) { + var v10 = p10.i; + l10 = this.sd.Bc; + m10 = dc().Fh; + p10 = v10.j; + t10 = y7(); + var A10 = Ab(v10.fa(), q5(jd)); + v10 = v10.Ib(); + l10.Gc( + m10.j, + p10, + t10, + "Cannot emit parameter for a non WebAPI shape", + A10, + Yb().qb, + v10 + ); + } else if (y7() === t10) + ws(k10, ay(this.jq, this.Ka, this.sd).Pa()); + else + throw new x7().d(t10); + } + l10 = Vb().Ia(Ti(this.jq.g, cj().We)); + if (l10 instanceof z7) { + if (l10 = Ab(l10.i.x, q5(b42)), l10 instanceof z7) + b10 = hd(b10, cj().We), b10.b() || (b10 = b10.c(), new z7().d(Dg(k10, $g(new ah(), fh(new je4().e("binding")), b10, y7())))); + else if (y7() !== l10) + throw new x7().d(l10); + } + jr(wr(), this.Ka.zb(k10), h10); + pr(f10, mr(T6(), tr(ur(), h10.s, g10), Q5().sa)); + e10 = xF(e10.s, 0); + sr(a10, e10, xF(c10.s, 0)); + } + }; + d7.$classData = r8({ ISa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10ParameterEmitter", { ISa: 1, bTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function MW() { + aY.call(this); + this.iw = this.ic = null; + this.Lg = false; + } + MW.prototype = new oQa(); + MW.prototype.constructor = MW; + d7 = MW.prototype; + d7.SB = function() { + var a10 = new Qg().Vb(this.ic.Aa, this.m), b10 = aqa(cqa(), this.ic), c10 = cj().R, e10 = a10.Zf(); + b10 = Vd(b10, c10, e10); + c10 = a10.Zf().t(); + e10 = cj().gw; + b10 = eb(b10, e10, c10); + this.iw.P(b10); + c10 = this.ic.i; + e10 = qc(); + c10 = Iw(c10, e10); + if (c10 instanceof ye4) { + c10 = c10.i; + e10 = new M6().W(c10); + var f10 = cj().yj; + f10 = Hg(Ig(this, f10, this.m), b10); + Gg(e10, "required", nh(rP(f10, new xi().a()))); + e10 = new M6().W(c10); + f10 = cj().Va; + Gg(e10, "description", nh(Hg(Ig(this, f10, this.m), b10))); + e10 = new M6().W(c10); + f10 = fh(new je4().e("binding")); + var g10 = cj().We; + g10 = Hg(Ig(this, g10, this.m), b10); + Gg(e10, f10, rP(g10, new xi().a())); + e10 = PW( + QW(), + this.ic, + w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + O7(); + var t10 = new P6().a(); + p10 = Sd(p10, "schema", t10); + t10 = m10.j; + var v10 = lt2(); + return p10.ub(t10, v10); + }; + }(this, b10)), + RW(false, true), + QP(), + this.m + ).Cc(); + e10.b() || (f10 = e10.c(), e10 = cj().Jc, f10 = HC(EC(), f10, b10.j, y7()), g10 = Od(O7(), this.ic), Rg(b10, e10, f10, g10)); + Ry(new Sy(), b10, c10, H10(), this.m).hd(); + } else if (c10 = this.m.hp(this.ic.i) instanceof ve4 ? Ys() : Zs(), e10 = this.ic.i.hb().gb, Q5().nd === e10) + c10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + O7(); + var t10 = new P6().a(); + p10 = Sd(p10, "schema", t10); + t10 = m10.j; + var v10 = lt2(); + return p10.ub(t10, v10); + }; + }(this, b10)), RW(false, false), QP(), this.m).Cc(), c10.b() || (c10 = c10.c(), HC(EC(), c10, b10.j, y7()).fa().Lb(new Xz().a()), e10 = cj().Jc, f10 = Od(O7(), this.ic), Rg(b10, e10, c10, f10)); + else { + e10 = false; + f10 = null; + g10 = this.ic.i; + var h10 = bc(); + g10 = Iw(g10, h10); + a: { + if (g10 instanceof ye4 && (e10 = true, f10 = g10, g10 = f10.i, gFa(this.m.pe(), g10.va, c10).na())) { + b10 = gFa(this.m.pe(), g10.va, c10).c().Ug(g10.va, Od(O7(), this.ic)); + c10 = cj().R; + e10 = a10.Zf(); + b10 = Vd(b10, c10, e10); + break a; + } + if (e10 && (g10 = f10.i, fB(this.m.pe(), g10.va, c10, y7()).na())) { + c10 = fB(this.m.pe(), g10.va, c10, new z7().d(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = l10.m, v10 = sg().Oy, A10 = m10.j, D10 = l10.ic.i, C10 = y7(); + ec(t10, v10, A10, C10, p10, D10.da); + }; + }(this, b10)))).c().Ug( + g10.va, + Od(O7(), this.ic) + ); + O7(); + e10 = new P6().a(); + c10 = Sd(c10, "schema", e10); + e10 = b10.j; + f10 = lt2(); + c10 = c10.ub(e10, f10); + e10 = cj().Jc; + b10 = Vd(b10, e10, c10); + break a; + } + if (e10 && (c10 = f10.i, zca(c10.va, true))) { + c10 = xca(c10.va); + O7(); + e10 = new P6().a(); + c10 = Sd(c10, "schema", e10); + e10 = b10.j; + f10 = lt2(); + c10 = c10.ub(e10, f10); + e10 = cj().Jc; + b10 = Vd(b10, e10, c10); + break a; + } + if (e10 && (c10 = f10.i, vca(c10.va))) { + e10 = w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + O7(); + var t10 = new P6().a(); + p10 = Sd(p10, "schema", t10); + t10 = m10.j; + var v10 = lt2(); + return p10.ub(t10, v10); + }; + }(this, b10)); + f10 = y7(); + c10 = $A(e10, 0, f10, false, this.m).AP(c10.va); + if (c10 instanceof z7) + c10 = c10.i, e10 = cj().Jc, b10 = Vd(b10, e10, c10); + else { + c10 = this.m; + e10 = dc().au; + f10 = b10.j; + g10 = "Cannot parse type expression for unresolved parameter '" + B6(b10.g, cj().R) + "'"; + h10 = this.ic.i; + var k10 = y7(); + ec(c10, e10, f10, k10, g10, h10.da); + } + break a; + } + c10 = this.m; + e10 = dc().au; + f10 = b10.j; + g10 = this.ic.i; + h10 = y7(); + ec(c10, e10, f10, h10, "Cannot declare unresolved parameter", g10.da); + } + } + hd(b10.g, cj().yj).b() && (c10 = a10.Zf().t(), e10 = !Ed(ua(), c10, "?"), e10 || (c10 = new qg().e(c10), c10 = aQ(c10, "?")), f10 = cj().yj, Bi(b10, f10, e10), e10 = cj().R, a10 = ih(new jh(), c10, a10.Zf().x), a10 = Vd(b10, e10, a10), e10 = cj().gw, eb(a10, e10, c10)); + return b10; + }; + d7.H = function() { + return "Raml10ParameterParser"; + }; + d7.jn = function(a10, b10, c10, e10) { + this.ic = a10; + this.iw = b10; + this.Lg = c10; + aY.prototype.ema.call(this, e10); + return this; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof MW) { + if (this.ic === a10.ic) { + var b10 = this.iw, c10 = a10.iw; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.Lg === a10.Lg : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.iw; + case 2: + return this.Lg; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.ic)); + a10 = OJ().Ga(a10, NJ(OJ(), this.iw)); + a10 = OJ().Ga(a10, this.Lg ? 1231 : 1237); + return OJ().fe(a10, 3); + }; + d7.$classData = r8({ JSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10ParameterParser", { JSa: 1, cTa: 1, f: 1, lr: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function AW() { + this.N = this.Q = this.p = this.Ba = this.la = null; + } + AW.prototype = new u7(); + AW.prototype.constructor = AW; + d7 = AW.prototype; + d7.H = function() { + return "Raml10PayloadsEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof AW) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Q, a10 = a10.Q, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + case 3: + return this.Q; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = snb(this, this.Ba, this.p, this.Q); + a: { + K7(); + var c10 = new z7().d(b10); + if (null !== c10.i && 0 === c10.i.Oe(1)) { + var e10 = c10.i.lb(0); + if (zr(e10)) { + T6(); + c10 = this.la; + var f10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + e10.Ob(c10); + b10 = c10.s; + e10 = [f10]; + if (0 > b10.w) + throw new U6().e("0"); + var g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + break a; + } + } + if (b10.oh(w6(/* @__PURE__ */ function() { + return function(p10) { + return yr(p10); + }; + }(this)))) { + T6(); + c10 = this.la; + e10 = mh(T6(), c10); + c10 = new PA().e(a10.ca); + f10 = c10.s; + g10 = c10.ca; + k10 = new rr().e(g10); + l10 = wr(); + h10 = new Wdb(); + m10 = K7(); + jr(l10, b10.ec(h10, m10.u), k10); + pr(f10, mr(T6(), tr(ur(), k10.s, g10), Q5().sa)); + b10 = c10.s; + e10 = [e10]; + if (0 > b10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = b10.w + g10 | 0; + uD(b10, f10); + Ba(b10.L, 0, b10.L, g10, b10.w); + g10 = b10.L; + h10 = g10.n.length; + l10 = k10 = 0; + m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + b10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } else + throw mb(E6(), new nb().e("IllegalTypeDeclarations found: " + b10)); + } + }; + d7.s1 = function(a10, b10, c10, e10, f10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.Q = e10; + this.N = f10; + return this; + }; + function snb(a10, b10, c10, e10) { + b10 = b10.r.r.wb; + a10 = w6(/* @__PURE__ */ function(f10, g10, h10) { + return function(k10) { + return new K5a().yaa(k10, g10, h10, f10.N).Pa(); + }; + }(a10, c10, e10)); + e10 = K7(); + return c10.zb(b10.bd(a10, e10.u)); + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ NSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10PayloadsEmitter", { NSa: 1, f: 1, jTa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function HW() { + bY.call(this); + this.sd = this.Gb = this.Ka = this.ZB = null; + } + HW.prototype = new pQa(); + HW.prototype.constructor = HW; + d7 = HW.prototype; + d7.H = function() { + return "Raml10ResponseEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof HW) { + var b10 = this.ZB, c10 = a10.ZB; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Ka === a10.Ka) + return b10 = this.Gb, a10 = a10.Gb, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ZB; + case 1: + return this.Ka; + case 2: + return this.Gb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.MO = function(a10, b10, c10, e10) { + this.ZB = a10; + this.Ka = b10; + this.Gb = c10; + this.sd = e10; + bY.prototype.MO.call(this, a10, b10, c10, e10); + return this; + }; + d7.RD = function(a10) { + var b10 = J5(Ef(), H10()), c10 = hd(a10, Dm().Ec); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $Pa(cQa(), fh(new je4().e("examples")), c10, this.Ka, this.sd)))); + ws(b10, ay(this.ZB, this.Ka, this.sd).Pa()); + a10 = bY.prototype.RD.call(this, a10); + return ws(ws(new Lf().a(), a10), b10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ QSa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.Raml10ResponseEmitter", { QSa: 1, nTa: 1, f: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function tnb() { + this.sd = this.Ka = this.HE = null; + } + tnb.prototype = new gQa(); + tnb.prototype.constructor = tnb; + d7 = tnb.prototype; + d7.H = function() { + return "RamlParametrizedSecuritySchemeEmitter"; + }; + d7.Ob = function(a10) { + var b10 = false, c10 = hd(this.HE.g, im().Oh); + a: + if (c10 instanceof z7) { + var e10 = c10.i; + b10 = a10.s; + a10 = a10.ca; + c10 = new rr().e(a10); + T6(); + var f10 = B6(this.HE.g, im().R).A; + f10 = f10.b() ? null : f10.c(); + var g10 = mh(T6(), f10); + f10 = new PA().e(c10.ca); + var h10 = f10.s, k10 = f10.ca, l10 = new rr().e(k10); + jr(wr(), this.Ka.zb(new X32().SG(e10, this.Ka, this.sd).Pa()), l10); + pr(h10, mr(T6(), tr(ur(), l10.s, k10), Q5().sa)); + e10 = f10.s; + g10 = [g10]; + if (0 > e10.w) + throw new U6().e("0"); + k10 = g10.length | 0; + h10 = e10.w + k10 | 0; + uD(e10, h10); + Ba(e10.L, 0, e10.L, k10, e10.w); + k10 = e10.L; + var m10 = k10.n.length, p10 = l10 = 0, t10 = g10.length | 0; + m10 = t10 < m10 ? t10 : m10; + t10 = k10.n.length; + for (m10 = m10 < t10 ? m10 : t10; l10 < m10; ) + k10.n[p10] = g10[l10], l10 = 1 + l10 | 0, p10 = 1 + p10 | 0; + e10.w = h10; + pr(c10.s, vD(wD(), f10.s)); + pr(b10, mr(T6(), tr(ur(), c10.s, a10), Q5().sa)); + } else { + if (y7() === c10 && (b10 = true, wh(this.HE.x, q5(mHa)))) { + b10 = mr(T6(), or().nd, Q5().nd); + pr(a10.s, b10); + break a; + } + if (b10) + b10 = B6(this.HE.g, im().R).A, a10.fo(b10.b() ? null : b10.c()); + else + throw new x7().d(c10); + } + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tnb) { + var b10 = this.HE, c10 = a10.HE; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.HE; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.HE.x, q5(jd)); + }; + d7.$classData = r8({ gTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlParametrizedSecuritySchemeEmitter", { gTa: 1, ahb: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function Yw() { + this.sd = this.Ka = this.$w = null; + } + Yw.prototype = new tQa(); + Yw.prototype.constructor = Yw; + d7 = Yw.prototype; + d7.H = function() { + return "RamlSecurityRequirementEmitter"; + }; + d7.Ob = function(a10) { + B6(this.$w.g, rm2().Gh).U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + var f10 = b10.Ka, g10 = b10.sd, h10 = new tnb(); + h10.HE = e10; + h10.Ka = f10; + h10.sd = g10; + h10.Ob(c10); + }; + }(this, a10))); + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Yw) { + var b10 = this.$w, c10 = a10.$w; + return (null === b10 ? null === c10 : b10.h(c10)) ? this.Ka === a10.Ka : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.$w; + case 1: + return this.Ka; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.$w.x, q5(jd)); + }; + d7.$classData = r8({ qTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.RamlSecurityRequirementEmitter", { qTa: 1, zTa: 1, f: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function VX() { + this.N = this.p = this.Ba = this.la = null; + } + VX.prototype = new u7(); + VX.prototype.constructor = VX; + d7 = VX.prototype; + d7.H = function() { + return "SecurityRequirementsEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof VX) { + if (this.la === a10.la) { + var b10 = this.Ba, c10 = a10.Ba; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.p === a10.p : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.la; + case 1: + return this.Ba; + case 2: + return this.p; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + IGa(this, a10); + }; + d7.d$ = function(a10) { + return this.N.zf.Wda().ug(a10, this.p); + }; + d7.Bja = function() { + var a10 = this.Ba.r.r.wb; + var b10 = new eeb(); + var c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.hE = function(a10, b10, c10, e10) { + this.la = a10; + this.Ba = b10; + this.p = c10; + this.N = e10; + return this; + }; + d7.kL = function() { + return this.la; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.Ba.r.x, q5(jd)); + }; + d7.$classData = r8({ ATa: 0 }, false, "amf.plugins.document.webapi.parser.spec.domain.SecurityRequirementsEmitter", { ATa: 1, f: 1, GTa: 1, db: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function en() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + en.prototype = new u7(); + en.prototype.constructor = en; + function unb() { + } + d7 = unb.prototype = en.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new en().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return ag(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, ag().R).A; + a10 = a10.b() ? "default-example" : a10.c(); + a10 = new je4().e(a10); + return "/example/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yh(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new en().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return ag().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Bha: 0 }, false, "amf.plugins.domain.shapes.models.Example", { Bha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, Zv: 1, KLa: 1 }); + function vn() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + vn.prototype = new u7(); + vn.prototype.constructor = vn; + d7 = vn.prototype; + d7.H = function() { + return "PropertyDependencies"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof vn ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return un(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return "/dependency"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ RYa: 0 }, false, "amf.plugins.domain.shapes.models.PropertyDependencies", { RYa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function sn() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + sn.prototype = new u7(); + sn.prototype.constructor = sn; + d7 = sn.prototype; + d7.H = function() { + return "XMLSerializer"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof sn ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return rn(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/xml"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ DZa: 0 }, false, "amf.plugins.domain.shapes.models.XMLSerializer", { DZa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function R22() { + this.r = this.$ = this.yc = null; + } + R22.prototype = new u7(); + R22.prototype.constructor = R22; + d7 = R22.prototype; + d7.H = function() { + return "ParameterBindingInBodyLexicalInfo"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof R22) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.jj = function(a10) { + this.yc = a10; + this.$ = "parameter-binding-in-body-lexical-info"; + this.r = a10.t(); + return this; + }; + d7.z = function() { + return X5(this); + }; + var pkb = r8({ l_a: 0 }, false, "amf.plugins.domain.webapi.annotations.ParameterBindingInBodyLexicalInfo", { l_a: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + R22.prototype.$classData = pkb; + function gQ() { + this.Wd = this.r = this.$ = this.Uh = null; + } + gQ.prototype = new u7(); + gQ.prototype.constructor = gQ; + d7 = gQ.prototype; + d7.H = function() { + return "ParentEndPoint"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof gQ ? this.Uh === a10.Uh : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Uh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.Uh = a10; + this.$ = "parent-end-point"; + this.r = a10; + this.Wd = y7(); + return this; + }; + d7.z = function() { + return X5(this); + }; + function uBa(a10, b10) { + a10.Wd.b() && (b10 = b10.Ja(a10.Uh), b10 instanceof z7 && (b10 = b10.i, b10 instanceof Kl && (a10.Wd = new z7().d(b10)))); + } + var Klb = r8({ n_a: 0 }, false, "amf.plugins.domain.webapi.annotations.ParentEndPoint", { n_a: 1, f: 1, Eh: 1, gf: 1, Zza: 1, y: 1, v: 1, q: 1, o: 1 }); + gQ.prototype.$classData = Klb; + function Jy() { + this.r = this.$ = this.yc = null; + } + Jy.prototype = new u7(); + Jy.prototype.constructor = Jy; + d7 = Jy.prototype; + d7.H = function() { + return "TypePropertyLexicalInfo"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Jy) { + var b10 = this.yc; + a10 = a10.yc; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.jj = function(a10) { + this.yc = a10; + this.$ = "type-property-lexical-info"; + this.r = a10.t(); + return this; + }; + d7.z = function() { + return X5(this); + }; + var bx = r8({ p_a: 0 }, false, "amf.plugins.domain.webapi.annotations.TypePropertyLexicalInfo", { p_a: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Jy.prototype.$classData = bx; + function vnb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.oe = this.ed = this.te = this.pf = this.qa = this.g = this.ba = this.uc = null; + this.xa = 0; + } + vnb.prototype = new u7(); + vnb.prototype.constructor = vnb; + d7 = vnb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + wnb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + bM(this); + var a10 = qb(), b10 = F6().Tb; + this.uc = rb(new sb(), a10, G5(b10, "location"), tb(new ub(), vb().Tb, "location", "structural location of the information where the id is located", H10())); + a10 = F6().Tb; + a10 = G5(a10, "CorrelationId"); + b10 = nc().ba; + this.ba = ji(a10, b10); + a10 = this.R; + b10 = this.Va; + var c10 = this.uc, e10 = db().g, f10 = nc().g, g10 = ii(); + e10 = e10.ia(f10, g10.u); + this.g = ji(a10, ji(b10, ji(c10, e10))); + this.qa = tb( + new ub(), + vb().Tb, + "CorrelationId", + "Model defining an identifier that can used for message tracing and correlation", + H10() + ); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Kn().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ s_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.CorrelationIdModel$", { s_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1, sk: 1, mm: 1 }); + var wnb = void 0; + function Jn() { + wnb || (wnb = new vnb().a()); + return wnb; + } + function xnb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.qa = this.g = this.ba = this.la = this.go = this.dc = this.lh = this.Ne = this.Wm = this.bk = this.ck = this.Uf = null; + this.xa = 0; + } + xnb.prototype = new u7(); + xnb.prototype.constructor = xnb; + d7 = xnb.prototype; + d7.a = function() { + ynb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + var a10 = qb(), b10 = F6().Ta; + this.Uf = rb(new sb(), a10, G5(b10, "path"), tb(new ub(), vb().Ta, "path", "Path template for an endpoint", H10())); + a10 = qb(); + b10 = F6().Tb; + this.ck = rb(new sb(), a10, G5(b10, "summary"), tb(new ub(), vb().Tb, "summary", "Human readable short description of the endpoint", H10())); + a10 = new xc().yd(Pl()); + b10 = F6().Ta; + this.bk = rb(new sb(), a10, G5(b10, "supportedOperation"), tb(new ub(), vb().Ta, "supported operation", "Operations supported by an endpoint", H10())); + a10 = new xc().yd(cj()); + b10 = F6().Ta; + this.Wm = rb(new sb(), a10, G5(b10, "parameter"), tb(new ub(), vb().Ta, "parameter", "Additional data required or returned by an operation", H10())); + a10 = new xc().yd(xm()); + b10 = F6().Ta; + this.Ne = rb(new sb(), a10, G5(b10, "payload"), tb(new ub(), vb().Ta, "payload", "Main payload data required or returned by an operation", H10())); + a10 = new xc().yd(Yl()); + b10 = F6().Ta; + this.lh = rb(new sb(), a10, G5(b10, "server"), tb(new ub(), vb().Ta, "servers", "Specific information about the server where the endpoint is accessible", H10())); + a10 = new xc().yd(rm2()); + b10 = F6().dc; + this.dc = rb( + new sb(), + a10, + G5(b10, "security"), + tb(new ub(), vb().dc, "security", "Security information associated to the endpoint", H10()) + ); + a10 = new xc().yd(xZ()); + b10 = F6().Jb; + this.go = rb(new sb(), a10, G5(b10, "binding"), tb(new ub(), vb().Jb, "binding", "Bindings for this endpoint", H10())); + this.la = this.Uf; + a10 = F6().Ta; + a10 = G5(a10, "EndPoint"); + b10 = nc().ba; + this.ba = ji(a10, b10); + ii(); + a10 = [this.Uf, this.R, this.ck, this.Va, this.bk, this.Wm, this.Ne, this.lh, this.dc, this.go]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().Ta, + "EndPoint", + "EndPoint in the API holding a number of executable operations", + H10() + ); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.Ni = function() { + return 0 === (1 & this.xa) << 24 >> 24 ? z_a(this) : this.mc; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Kl().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ u_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.EndPointModel$", { u_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1, sk: 1 }); + var ynb = void 0; + function Jl() { + ynb || (ynb = new xnb().a()); + return ynb; + } + function znb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.R = this.Va = this.qa = this.g = this.ba = this.WF = this.VF = this.kD = this.pN = this.RF = this.g8 = null; + this.xa = 0; + } + znb.prototype = new u7(); + znb.prototype.constructor = znb; + d7 = znb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + Anb = this; + Cr(this); + uU(this); + bM(this); + wb(this); + pb(this); + var a10 = qb(), b10 = F6().Ta; + this.g8 = rb(new sb(), a10, G5(b10, "template"), tb(new ub(), vb().Ta, "template", "URL template for a templated link", H10())); + a10 = qb(); + b10 = F6().Ta; + this.RF = rb(new sb(), a10, G5(b10, "operationId"), tb(new ub(), vb().Ta, "operation ID", "Identifier of the target operation", H10())); + a10 = qb(); + b10 = F6().Ta; + this.pN = rb(new sb(), a10, G5(b10, "operationRef"), tb(new ub(), vb().Ta, "operation Ref", "Reference of the target operation", H10())); + a10 = new xc().yd(Gn()); + b10 = F6().Ta; + this.kD = rb( + new sb(), + a10, + G5(b10, "mapping"), + tb(new ub(), vb().Ta, "mapping", "Variable mapping for the URL template", H10()) + ); + a10 = qb(); + b10 = F6().Ta; + this.VF = rb(new sb(), a10, G5(b10, "requestBody"), tb(new ub(), vb().Ta, "request body", "", H10())); + a10 = Yl(); + b10 = F6().Ta; + this.WF = rb(new sb(), a10, G5(b10, "server"), tb(new ub(), vb().Ta, "server", "", H10())); + a10 = F6().Ta; + a10 = G5(a10, "TemplatedLink"); + b10 = nc().ba; + this.ba = ji(a10, b10); + a10 = this.R; + b10 = this.g8; + var c10 = this.RF, e10 = this.kD, f10 = this.VF, g10 = this.Va, h10 = this.WF, k10 = nc().g, l10 = db().g, m10 = ii(); + k10 = k10.ia(l10, m10.u); + this.g = ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, ji(h10, k10))))))); + this.qa = tb(new ub(), vb().Ta, "Templated Link", "Templated link containing URL template and variables mapping", H10()); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Bn().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ G_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.TemplatedLinkModel$", { G_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, nm: 1, sk: 1 }); + var Anb = void 0; + function An() { + Anb || (Anb = new znb().a()); + return Anb; + } + function Bnb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.Xm = this.qa = this.ba = this.dc = this.Yp = this.Uv = this.OF = this.SF = this.XF = this.Ym = this.Gh = this.fY = this.yl = this.Wp = this.lh = null; + this.xa = 0; + } + Bnb.prototype = new u7(); + Bnb.prototype.constructor = Bnb; + d7 = Bnb.prototype; + d7.a = function() { + Cnb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + ida(this); + var a10 = new xc().yd(Yl()), b10 = F6().Ta; + this.lh = rb(new sb(), a10, G5(b10, "server"), tb(new ub(), vb().Ta, "server", "server information", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Ta; + this.Wp = rb(new sb(), a10, G5(b10, "accepts"), tb(new ub(), vb().Ta, "accepts", "Media-types accepted in a API request", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Ta; + this.yl = rb(new sb(), a10, G5(b10, "contentType"), tb(new ub(), vb().Ta, "content type", "Media types returned by a API response", H10())); + a10 = qb(); + b10 = F6().Ta; + this.fY = rb(new sb(), a10, G5(b10, "identifier"), tb(new ub(), vb().Ta, "identifier", "Specific api identifier", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Ta; + this.Gh = rb(new sb(), a10, G5(b10, "scheme"), tb(new ub(), vb().Ta, "scheme", "URI scheme for the API protocol", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Ym = rb(new sb(), a10, G5(b10, "version"), tb(new ub(), vb().Tb, "version", "Version of the API", H10())); + a10 = qb(); + b10 = F6().Tb; + this.XF = rb(new sb(), a10, G5(b10, "termsOfService"), tb(new ub(), vb().Tb, "terms of service", "Terms and conditions when using the API", H10())); + a10 = Tl(); + b10 = F6().Tb; + this.SF = rb( + new sb(), + a10, + G5(b10, "provider"), + tb(new ub(), vb().Tb, "provider", "Organization providing some kind of asset or service", H10()) + ); + a10 = Ml(); + b10 = F6().Tb; + this.OF = rb(new sb(), a10, G5(b10, "license"), tb(new ub(), vb().Tb, "license", "License for the API", H10())); + a10 = new xc().yd(li()); + b10 = F6().Tb; + this.Uv = rb(new sb(), a10, G5(b10, "documentation"), tb(new ub(), vb().Tb, "documentation", "Documentation associated to the API", H10())); + a10 = new xc().yd(Jl()); + b10 = F6().Ta; + this.Yp = rb(new sb(), a10, G5(b10, "endpoint"), tb(new ub(), vb().Ta, "endpoint", "End points defined in the API", H10())); + a10 = new xc().yd(rm2()); + b10 = F6().dc; + this.dc = rb(new sb(), a10, G5(b10, "security"), tb(new ub(), vb().dc, "security", "Textual indication of the kind of security scheme used", H10())); + a10 = F6().Ta; + a10 = G5(a10, "WebAPI"); + b10 = F6().Zd; + b10 = G5(b10, "RootDomainElement"); + var c10 = nc().ba; + this.ba = ji(a10, ji(b10, c10)); + this.qa = tb(new ub(), vb().Ta, "Web API", "Top level element describing a HTTP API", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.R, this.Va, this.fY, this.lh, this.Wp, this.yl, this.Gh, this.Ym, this.XF, this.SF, this.OF, this.Uv, this.Yp, this.dc, this.Xm], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Rm().K(new S6().a(), a10); + }; + d7.rS = function(a10) { + this.Xm = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ H_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.WebApiModel$", { H_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, nm: 1, sk: 1, UY: 1 }); + var Cnb = void 0; + function Qm() { + Cnb || (Cnb = new Bnb().a()); + return Cnb; + } + function Dnb() { + this.wd = this.bb = this.mc = this.R = this.la = this.Aj = this.te = this.qa = this.ba = null; + this.xa = 0; + } + Dnb.prototype = new u7(); + Dnb.prototype.constructor = Dnb; + d7 = Dnb.prototype; + d7.a = function() { + Enb = this; + Cr(this); + uU(this); + wb(this); + Lab(this); + var a10 = F6().Ta; + a10 = G5(a10, "ParametrizedResourceType"); + var b10 = FY().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Parametrized Resource Type", "RAML resource type that can accept parameters", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return Kab(this); + }; + d7.K8 = function(a10) { + this.te = a10; + }; + d7.M8 = function(a10) { + this.la = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ij().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.L8 = function(a10) { + this.Aj = a10; + }; + d7.$classData = r8({ m0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.templates.ParametrizedResourceTypeModel$", { m0a: 1, f: 1, Dga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1 }); + var Enb = void 0; + function sea() { + Enb || (Enb = new Dnb().a()); + return Enb; + } + function Fnb() { + this.wd = this.bb = this.mc = this.R = this.la = this.Aj = this.te = this.qa = this.ba = null; + this.xa = 0; + } + Fnb.prototype = new u7(); + Fnb.prototype.constructor = Fnb; + d7 = Fnb.prototype; + d7.a = function() { + Gnb = this; + Cr(this); + uU(this); + wb(this); + Lab(this); + var a10 = F6().Ta; + a10 = G5(a10, "ParametrizedTrait"); + var b10 = FY().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Parametrized Trait", "RAML trait with declared parameters", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return Kab(this); + }; + d7.K8 = function(a10) { + this.te = a10; + }; + d7.M8 = function(a10) { + this.la = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new kj().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.L8 = function(a10) { + this.Aj = a10; + }; + d7.$classData = r8({ n0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.templates.ParametrizedTraitModel$", { n0a: 1, f: 1, Dga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1 }); + var Gnb = void 0; + function tea() { + Gnb || (Gnb = new Fnb().a()); + return Gnb; + } + function em() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + em.prototype = new u7(); + em.prototype.constructor = em; + d7 = em.prototype; + d7.H = function() { + return "Encoding"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof em ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.lI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Wl().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = dm().Tf; + ig(this, b10, a10); + return a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return dm(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + var a10 = B6(this.g, dm().lD).A; + a10 = a10.b() ? "default-encoding" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ r0a: 0 }, false, "amf.plugins.domain.webapi.models.Encoding", { r0a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hn() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Hn.prototype = new u7(); + Hn.prototype.constructor = Hn; + d7 = Hn.prototype; + d7.H = function() { + return "IriTemplateMapping"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Hn ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Gn(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, Gn().pD).A; + a10 = a10.b() ? "unknownVar" : a10.c(); + a10 = new je4().e(a10); + return "/mapping/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ u0a: 0 }, false, "amf.plugins.domain.webapi.models.IriTemplateMapping", { u0a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zl() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Zl.prototype = new u7(); + Zl.prototype.constructor = Zl; + d7 = Zl.prototype; + d7.H = function() { + return "Server"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Zl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Yl(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + var a10 = B6(this.g, Yl().Pf).A; + a10 = a10.b() ? null : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ H0a: 0 }, false, "amf.plugins.domain.webapi.models.Server", { H0a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Km() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Km.prototype = new u7(); + Km.prototype.constructor = Km; + d7 = Km.prototype; + d7.H = function() { + return "OAuth2Flow"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Km ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Jm(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + var a10 = B6(this.g, Jm().Wv).A; + a10 = a10.b() ? "default-flow" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ g1a: 0 }, false, "amf.plugins.domain.webapi.models.security.OAuth2Flow", { g1a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hm() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Hm.prototype = new u7(); + Hm.prototype.constructor = Hm; + d7 = Hm.prototype; + d7.H = function() { + return "Scope"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Hm ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Gm(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, Gm().R).A; + a10 = a10.b() ? "default-scope" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ l1a: 0 }, false, "amf.plugins.domain.webapi.models.security.Scope", { l1a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function tm() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + tm.prototype = new u7(); + tm.prototype.constructor = tm; + d7 = tm.prototype; + d7.H = function() { + return "SecurityRequirement"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof tm ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return rm2(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, rm2().R).A; + a10 = a10.b() ? "default-requirement" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + function A5a(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new jm().K(new S6().a(), c10); + var e10 = im().R; + b10 = eb(c10, e10, b10); + c10 = rm2().Gh; + ig(a10, c10, b10); + return b10; + } + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ n1a: 0 }, false, "amf.plugins.domain.webapi.models.security.SecurityRequirement", { n1a: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function RZ() { + CF.call(this); + this.yP = null; + } + RZ.prototype = new X22(); + RZ.prototype.constructor = RZ; + d7 = RZ.prototype; + d7.H = function() { + return "ParseException"; + }; + function Jua(a10) { + var b10 = new RZ(); + b10.yP = a10; + CF.prototype.Ge.call(b10, null, null); + return b10; + } + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof RZ) { + var b10 = this.yP; + a10 = a10.yP; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.yP; + default: + throw new U6().e("" + a10); + } + }; + d7.xo = function() { + return this.yP.wba(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ s3a: 0 }, false, "org.mulesoft.common.parse.ParseException", { s3a: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function X7() { + M52.call(this); + this.xp = null; + } + X7.prototype = new c$a2(); + X7.prototype.constructor = X7; + d7 = X7.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + X7.prototype.TG.call(this, new ad().K(new S6().a(), a10)); + return this; + }; + d7.TG = function(a10) { + this.xp = a10; + M52.prototype.TG.call(this, a10); + return this; + }; + d7.$k = function() { + return this.xp; + }; + d7.Xr = function() { + return this.xp; + }; + d7.Be = function() { + return this.xp; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.Wr = function() { + return this.xp; + }; + d7.oc = function() { + return this.xp; + }; + X7.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(X7.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + X7.prototype.$classData = r8({ O6a: 0 }, false, "webapi.WebApiVocabulary", { O6a: 1, vga: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1, aw: 1 }); + function sI() { + this.tma = this.Cg = false; + this.JS = null; + } + sI.prototype = new bmb(); + sI.prototype.constructor = sI; + function cmb(a10, b10) { + for (; "" !== b10; ) { + var c10 = b10.indexOf("\n") | 0; + if (0 > c10) + a10.JS = "" + a10.JS + b10, b10 = ""; + else { + var e10 = "" + a10.JS + b10.substring(0, c10); + ba.console && (a10.tma && ba.console.error ? ba.console.error(e10) : ba.console.log(e10)); + a10.JS = ""; + b10 = b10.substring(1 + c10 | 0); + } + } + } + sI.prototype.eq = function(a10) { + this.tma = a10; + new d9a().a(); + this.JS = ""; + return this; + }; + sI.prototype.US = function() { + }; + sI.prototype.$classData = r8({ M7a: 0 }, false, "java.lang.JSConsoleBasedPrintStream", { M7a: 1, khb: 1, jhb: 1, x2a: 1, f: 1, ZY: 1, eba: 1, w7: 1, SU: 1 }); + function Hnb() { + R6.call(this); + this.b5 = this.Z4 = 0; + } + Hnb.prototype = new dgb(); + Hnb.prototype.constructor = Hnb; + d7 = Hnb.prototype; + d7.vfa = function() { + return this.Z4; + }; + d7.ya = function() { + return this.b5; + }; + d7.wfa = function() { + return this.b5; + }; + function ama(a10, b10) { + var c10 = new Hnb(); + c10.Z4 = a10; + c10.b5 = b10; + R6.prototype.M.call(c10, null, null); + return c10; + } + d7.ma = function() { + return this.Z4; + }; + d7.$classData = r8({ k9a: 0 }, false, "scala.Tuple2$mcDD$sp", { k9a: 1, d_: 1, f: 1, tda: 1, y: 1, v: 1, q: 1, o: 1, Lhb: 1 }); + function JI() { + R6.call(this); + this.c5 = this.FI = 0; + } + JI.prototype = new dgb(); + JI.prototype.constructor = JI; + d7 = JI.prototype; + d7.JM = function() { + return this.FI; + }; + d7.Sc = function(a10, b10) { + this.FI = a10; + this.c5 = b10; + R6.prototype.M.call(this, null, null); + return this; + }; + d7.ya = function() { + return this.c5; + }; + d7.Ki = function() { + return this.c5; + }; + d7.ma = function() { + return this.FI; + }; + d7.$classData = r8({ m9a: 0 }, false, "scala.Tuple2$mcII$sp", { m9a: 1, d_: 1, f: 1, tda: 1, y: 1, v: 1, q: 1, o: 1, Mhb: 1 }); + function AF() { + this.r = null; + } + AF.prototype = new tVa(); + AF.prototype.constructor = AF; + function UVa(a10, b10) { + for (; ; ) { + b: { + var c10 = b10; + for (; ; ) { + var e10 = c10.r; + if (e10 instanceof AF) + c10 = e10; + else + break b; + } + } + if (b10 === c10 || uVa(a10, b10, c10)) + return c10; + b10 = a10.r; + if (!(b10 instanceof AF)) + return a10; + } + } + d7 = AF.prototype; + d7.a = function() { + sVa.prototype.d.call(this, H10()); + return this; + }; + function VVa(a10, b10) { + a: + for (; ; ) { + var c10 = a10.r; + if (c10 instanceof v_) + TVa(b10, c10); + else { + if (c10 instanceof AF) { + a10 = UVa(a10, c10); + continue a; + } + if (!(c10 instanceof qT)) + throw new x7().d(c10); + if (!uVa(a10, c10, ji(b10, c10))) + continue a; + } + break; + } + } + d7.IW = function(a10) { + a10 = mxa(oxa(), a10); + a: { + var b10 = this; + for (; ; ) { + var c10 = b10.r; + if (c10 instanceof qT) { + if (uVa(b10, c10, a10)) { + b10 = c10; + break a; + } + } else if (c10 instanceof AF) + b10 = UVa(b10, c10); + else { + b10 = null; + break a; + } + } + } + if (null !== b10) { + if (!b10.b()) + for (; !b10.b(); ) + TVa(b10.ga(), a10), b10 = b10.ta(); + return true; + } + return false; + }; + d7.t = function() { + return WVa(this); + }; + d7.Pq = function(a10, b10) { + return axa(this, a10, b10); + }; + d7.wP = function(a10, b10) { + VVa(this, SVa(b10, a10)); + }; + d7.rfa = function(a10, b10, c10) { + return exa(this, a10, b10, c10); + }; + d7.Yg = function(a10, b10) { + return cxa(this, a10, b10); + }; + d7.Pea = function() { + a: { + var a10 = this; + for (; ; ) { + var b10 = a10.r; + if (b10 instanceof v_) { + a10 = new z7().d(b10); + break a; + } + if (b10 instanceof AF) + a10 = UVa(a10, b10); + else { + a10 = y7(); + break a; + } + } + } + return a10; + }; + d7.ZV = function(a10, b10) { + return fxa(this, a10, b10); + }; + d7.YV = function(a10, b10) { + return gxa(this, a10, b10); + }; + d7.Taa = function() { + a: { + var a10 = this; + for (; ; ) { + var b10 = a10.r; + if (b10 instanceof v_) { + a10 = true; + break a; + } + if (b10 instanceof AF) + a10 = UVa(a10, b10); + else { + a10 = false; + break a; + } + } + } + return a10; + }; + d7.$classData = r8({ x9a: 0 }, false, "scala.concurrent.impl.Promise$DefaultPromise", { x9a: 1, Chb: 1, f: 1, q: 1, o: 1, Voa: 1, Uoa: 1, vda: 1, Roa: 1 }); + function Y7() { + } + Y7.prototype = new u7(); + Y7.prototype.constructor = Y7; + Y7.prototype.a = function() { + return this; + }; + Y7.prototype.ap = function(a10, b10) { + a10 |= 0; + b10 |= 0; + return a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + }; + Y7.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + Y7.prototype.$classData = r8({ N9a: 0 }, false, "scala.math.Ordering$Int$", { N9a: 1, f: 1, Uhb: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + var Inb = void 0; + function St() { + Inb || (Inb = new Y7().a()); + return Inb; + } + function Z7() { + } + Z7.prototype = new u7(); + Z7.prototype.constructor = Z7; + Z7.prototype.a = function() { + return this; + }; + Z7.prototype.ap = function(a10, b10) { + return a10 === b10 ? 0 : a10 < b10 ? -1 : 1; + }; + Z7.prototype.wE = function(a10, b10) { + return 0 >= this.ap(a10, b10); + }; + Z7.prototype.$classData = r8({ O9a: 0 }, false, "scala.math.Ordering$String$", { O9a: 1, f: 1, Vhb: 1, RH: 1, jH: 1, SH: 1, QH: 1, q: 1, o: 1 }); + var Jnb = void 0; + function mc() { + Jnb || (Jnb = new Z7().a()); + return Jnb; + } + function $7() { + this.cr = null; + } + $7.prototype = new u7(); + $7.prototype.constructor = $7; + function a8() { + } + a8.prototype = $7.prototype; + $7.prototype.h = function(a10) { + return this === a10; + }; + $7.prototype.t = function() { + return this.cr; + }; + $7.prototype.z = function() { + return qaa(this); + }; + function Knb() { + } + Knb.prototype = new u7(); + Knb.prototype.constructor = Knb; + function Lnb() { + } + Lnb.prototype = Knb.prototype; + function b8() { + this.sc = this.u = null; + } + b8.prototype = new kmb(); + b8.prototype.constructor = b8; + b8.prototype.a = function() { + FT.prototype.a.call(this); + Mnb = this; + this.sc = new w_().a(); + return this; + }; + b8.prototype.Qd = function() { + hG(); + iG(); + return new jG().a(); + }; + b8.prototype.$classData = r8({ K$a: 0 }, false, "scala.collection.IndexedSeq$", { K$a: 1, Cpa: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var Mnb = void 0; + function rw() { + Mnb || (Mnb = new b8().a()); + return Mnb; + } + function rS() { + this.Tj = this.tB = 0; + this.Fa = null; + } + rS.prototype = new c32(); + rS.prototype.constructor = rS; + d7 = rS.prototype; + d7.$a = function() { + this.Tj >= this.tB && $B().ce.$a(); + var a10 = this.Fa.lb(this.Tj); + this.Tj = 1 + this.Tj | 0; + return a10; + }; + d7.bQ = function(a10) { + if (0 >= a10) + a10 = $B().ce; + else { + var b10 = this.tB - this.Tj | 0; + a10 = a10 <= (0 < b10 ? b10 : 0) ? qS(new rS(), this.Fa, this.Tj, this.Tj + a10 | 0) : qS(new rS(), this.Fa, this.Tj, this.tB); + } + return a10; + }; + function qS(a10, b10, c10, e10) { + a10.tB = e10; + if (null === b10) + throw mb(E6(), null); + a10.Fa = b10; + a10.Tj = c10; + return a10; + } + d7.Ya = function() { + return this.Tj < this.tB; + }; + d7.OD = function(a10) { + return 0 >= a10 ? qS(new rS(), this.Fa, this.Tj, this.tB) : (this.Tj + a10 | 0) >= this.tB ? qS(new rS(), this.Fa, this.tB, this.tB) : qS(new rS(), this.Fa, this.Tj + a10 | 0, this.tB); + }; + d7.$classData = r8({ M$a: 0 }, false, "scala.collection.IndexedSeqLike$Elements", { M$a: 1, mk: 1, f: 1, Ii: 1, Qb: 1, Pb: 1, aib: 1, q: 1, o: 1 }); + function c8() { + } + c8.prototype = new u9a(); + c8.prototype.constructor = c8; + c8.prototype.a = function() { + return this; + }; + function Nnb(a10, b10, c10, e10, f10, g10) { + var h10 = 31 & (b10 >>> g10 | 0), k10 = 31 & (e10 >>> g10 | 0); + if (h10 !== k10) + return a10 = 1 << h10 | 1 << k10, b10 = ja(Ja(d8), [2]), h10 < k10 ? (b10.n[0] = c10, b10.n[1] = f10) : (b10.n[0] = f10, b10.n[1] = c10), e82(new k52(), a10, b10, c10.jb() + f10.jb() | 0); + k10 = ja(Ja(d8), [1]); + h10 = 1 << h10; + c10 = Nnb(a10, b10, c10, e10, f10, 5 + g10 | 0); + k10.n[0] = c10; + return e82(new k52(), h10, k10, c10.Ls); + } + c8.prototype.v0 = function() { + return f8(); + }; + c8.prototype.$classData = r8({ jbb: 0 }, false, "scala.collection.immutable.HashSet$", { jbb: 1, Bpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1, q: 1, o: 1 }); + var Onb = void 0; + function Pnb() { + Onb || (Onb = new c8().a()); + return Onb; + } + function g8() { + this.u = null; + } + g8.prototype = new kmb(); + g8.prototype.constructor = g8; + g8.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + g8.prototype.Qd = function() { + iG(); + return new jG().a(); + }; + g8.prototype.$classData = r8({ qbb: 0 }, false, "scala.collection.immutable.IndexedSeq$", { qbb: 1, Cpa: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1 }); + var Qnb = void 0; + function hG() { + Qnb || (Qnb = new g8().a()); + return Qnb; + } + function h8() { + } + h8.prototype = new u9a(); + h8.prototype.constructor = h8; + h8.prototype.a = function() { + return this; + }; + h8.prototype.v0 = function() { + return Rnb(); + }; + h8.prototype.$classData = r8({ Abb: 0 }, false, "scala.collection.immutable.ListSet$", { Abb: 1, Bpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1, q: 1, o: 1 }); + var Snb = void 0; + function jT() { + this.fO = null; + this.sma = false; + this.be = null; + } + jT.prototype = new O72(); + jT.prototype.constructor = jT; + d7 = jT.prototype; + d7.Kk = function(a10) { + return Tnb(this, a10); + }; + d7.t = function() { + return "ArrayBuilder.generic"; + }; + function Tnb(a10, b10) { + a10.be.push(a10.sma ? null === b10 ? 0 : b10.r : null === b10 ? a10.fO.jg.M3 : b10); + return a10; + } + d7.Rc = function() { + var a10 = this.fO === q5(Ka) ? q5(oa) : this.fO === q5(Zza) || this.fO === q5(cWa) ? q5(Ha) : this.fO; + return ha(Ja(a10.jg), this.be); + }; + d7.$K = function(a10) { + this.fO = a10; + this.sma = a10 === q5(Na); + this.be = []; + return this; + }; + d7.jd = function(a10) { + return Tnb(this, a10); + }; + d7.$classData = r8({ Icb: 0 }, false, "scala.collection.mutable.ArrayBuilder$generic", { Icb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Unb() { + this.be = null; + this.Bb = this.ld = 0; + } + Unb.prototype = new O72(); + Unb.prototype.constructor = Unb; + d7 = Unb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + function Vnb(a10, b10) { + b10 = ja(Ja(Ma), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.h = function(a10) { + return a10 instanceof Unb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return Wnb(this, !!a10); + }; + d7.t = function() { + return "ArrayBuilder.ofBoolean"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Vnb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Vnb(this, a10); + this.ld = a10; + }; + d7.jd = function(a10) { + return Wnb(this, !!a10); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + function Wnb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.jh = function(a10) { + a10 instanceof B52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Jcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofBoolean", { Jcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Xnb() { + this.be = null; + this.Bb = this.ld = 0; + } + Xnb.prototype = new O72(); + Xnb.prototype.constructor = Xnb; + d7 = Xnb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof Xnb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return Ynb(this, a10 | 0); + }; + function Znb(a10, b10) { + b10 = ja(Ja(Oa), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.t = function() { + return "ArrayBuilder.ofByte"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Znb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Znb(this, a10); + this.ld = a10; + }; + d7.jd = function(a10) { + return Ynb(this, a10 | 0); + }; + function Ynb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof v52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Kcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofByte", { Kcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function $nb() { + this.be = null; + this.Bb = this.ld = 0; + } + $nb.prototype = new O72(); + $nb.prototype.constructor = $nb; + d7 = $nb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof $nb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return aob(this, null === a10 ? 0 : a10.r); + }; + d7.t = function() { + return "ArrayBuilder.ofChar"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = bob(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = bob(this, a10); + this.ld = a10; + }; + d7.jd = function(a10) { + return aob(this, null === a10 ? 0 : a10.r); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + function bob(a10, b10) { + b10 = ja(Ja(Na), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + function aob(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.jh = function(a10) { + a10 instanceof dB ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Lcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofChar", { Lcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function cob() { + this.be = null; + this.Bb = this.ld = 0; + } + cob.prototype = new O72(); + cob.prototype.constructor = cob; + d7 = cob.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof cob ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return yqb(this, +a10); + }; + d7.t = function() { + return "ArrayBuilder.ofDouble"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = zqb(this, this.Bb); + return a10; + }; + function zqb(a10, b10) { + b10 = ja(Ja(Ta), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.Gm = function(a10) { + this.be = zqb(this, a10); + this.ld = a10; + }; + d7.jd = function(a10) { + return yqb(this, +a10); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + function yqb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof A52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Mcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofDouble", { Mcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Aqb() { + this.be = null; + this.Bb = this.ld = 0; + } + Aqb.prototype = new O72(); + Aqb.prototype.constructor = Aqb; + d7 = Aqb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof Aqb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return Bqb(this, +a10); + }; + d7.t = function() { + return "ArrayBuilder.ofFloat"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Cqb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Cqb(this, a10); + this.ld = a10; + }; + function Bqb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.jd = function(a10) { + return Bqb(this, +a10); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + function Cqb(a10, b10) { + b10 = ja(Ja(Sa), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof z52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Ncb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofFloat", { Ncb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Dqb() { + this.be = null; + this.Bb = this.ld = 0; + } + Dqb.prototype = new O72(); + Dqb.prototype.constructor = Dqb; + d7 = Dqb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof Dqb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return Eqb(this, a10 | 0); + }; + d7.t = function() { + return "ArrayBuilder.ofInt"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Fqb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Fqb(this, a10); + this.ld = a10; + }; + function Eqb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.jd = function(a10) { + return Eqb(this, a10 | 0); + }; + function Fqb(a10, b10) { + b10 = ja(Ja(Qa), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof x52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Ocb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofInt", { Ocb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Gqb() { + this.be = null; + this.Bb = this.ld = 0; + } + Gqb.prototype = new O72(); + Gqb.prototype.constructor = Gqb; + d7 = Gqb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + function Hqb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.h = function(a10) { + return a10 instanceof Gqb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return Hqb(this, Da(a10)); + }; + d7.t = function() { + return "ArrayBuilder.ofLong"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Iqb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Iqb(this, a10); + this.ld = a10; + }; + function Iqb(a10, b10) { + b10 = ja(Ja(Ra), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.jd = function(a10) { + return Hqb(this, Da(a10)); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof y52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Pcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofLong", { Pcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function EY() { + this.be = this.Aka = null; + this.Bb = this.ld = 0; + } + EY.prototype = new O72(); + EY.prototype.constructor = EY; + d7 = EY.prototype; + d7.XO = function(a10) { + this.Aka = a10; + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof EY ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + d7.Kk = function(a10) { + return eRa(this, a10); + }; + d7.t = function() { + return "ArrayBuilder.ofRef"; + }; + d7.Rc = function() { + return fRa(this); + }; + d7.Gm = function(a10) { + this.be = Jqb(this, a10); + this.ld = a10; + }; + function eRa(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + function fRa(a10) { + return 0 !== a10.ld && a10.ld === a10.Bb ? (a10.ld = 0, a10.be) : Jqb(a10, a10.Bb); + } + d7.jd = function(a10) { + return eRa(this, a10); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + function Jqb(a10, b10) { + b10 = a10.Aka.zs(b10); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.jh = function(a10) { + a10 instanceof VI ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Qcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofRef", { Qcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Kqb() { + this.be = null; + this.Bb = this.ld = 0; + } + Kqb.prototype = new O72(); + Kqb.prototype.constructor = Kqb; + d7 = Kqb.prototype; + d7.a = function() { + this.Bb = this.ld = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof Kqb ? this.Bb === a10.Bb && this.be === a10.be : false; + }; + function Lqb(a10, b10) { + a10.vm(1 + a10.Bb | 0); + a10.be.n[a10.Bb] = b10; + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.Kk = function(a10) { + return Lqb(this, a10 | 0); + }; + d7.t = function() { + return "ArrayBuilder.ofShort"; + }; + d7.Rc = function() { + if (0 !== this.ld && this.ld === this.Bb) { + this.ld = 0; + var a10 = this.be; + } else + a10 = Mqb(this, this.Bb); + return a10; + }; + d7.Gm = function(a10) { + this.be = Mqb(this, a10); + this.ld = a10; + }; + function Mqb(a10, b10) { + b10 = ja(Ja(Pa), [b10]); + 0 < a10.Bb && Pu(Gd(), a10.be, 0, b10, 0, a10.Bb); + return b10; + } + d7.jd = function(a10) { + return Lqb(this, a10 | 0); + }; + d7.pj = function(a10) { + this.ld < a10 && this.Gm(a10); + }; + d7.vm = function(a10) { + if (this.ld < a10 || 0 === this.ld) { + for (var b10 = 0 === this.ld ? 16 : this.ld << 1; b10 < a10; ) + b10 <<= 1; + this.Gm(b10); + } + }; + d7.jh = function(a10) { + a10 instanceof w52 ? (this.vm(this.Bb + a10.Oa() | 0), Pu(Gd(), a10.L, 0, this.be, this.Bb, a10.Oa()), this.Bb = this.Bb + a10.Oa() | 0, a10 = this) : a10 = yi(this, a10); + return a10; + }; + d7.$classData = r8({ Rcb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofShort", { Rcb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Nqb() { + this.Bb = 0; + } + Nqb.prototype = new O72(); + Nqb.prototype.constructor = Nqb; + d7 = Nqb.prototype; + d7.a = function() { + this.Bb = 0; + return this; + }; + d7.h = function(a10) { + return a10 instanceof Nqb ? this.Bb === a10.Bb : false; + }; + d7.Kk = function() { + return Oqb(this); + }; + d7.t = function() { + return "ArrayBuilder.ofUnit"; + }; + function Oqb(a10) { + a10.Bb = 1 + a10.Bb | 0; + return a10; + } + d7.Rc = function() { + for (var a10 = ja(Ja(oa), [this.Bb]), b10 = 0; b10 < this.Bb; ) + a10.n[b10] = void 0, b10 = 1 + b10 | 0; + return a10; + }; + d7.jd = function() { + return Oqb(this); + }; + d7.jh = function(a10) { + this.Bb = this.Bb + a10.jb() | 0; + return this; + }; + d7.$classData = r8({ Scb: 0 }, false, "scala.collection.mutable.ArrayBuilder$ofUnit", { Scb: 1, eC: 1, f: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function i8() { + } + i8.prototype = new w9a(); + i8.prototype.constructor = i8; + i8.prototype.a = function() { + return this; + }; + i8.prototype.Rz = function() { + return new mq().a(); + }; + i8.prototype.$classData = r8({ ydb: 0 }, false, "scala.collection.mutable.HashSet$", { ydb: 1, Dpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1, q: 1, o: 1 }); + var Pqb = void 0; + function E0a() { + Pqb || (Pqb = new i8().a()); + return Pqb; + } + function j8() { + } + j8.prototype = new w9a(); + j8.prototype.constructor = j8; + j8.prototype.a = function() { + return this; + }; + j8.prototype.Rz = function() { + return new fw().a(); + }; + j8.prototype.$classData = r8({ Rdb: 0 }, false, "scala.collection.mutable.LinkedHashSet$", { Rdb: 1, Dpa: 1, SP: 1, RP: 1, Mo: 1, f: 1, No: 1, q: 1, o: 1 }); + var Qqb = void 0; + function Pja() { + Qqb || (Qqb = new j8().a()); + return Qqb; + } + function EK() { + CF.call(this); + this.Px = null; + } + EK.prototype = new X22(); + EK.prototype.constructor = EK; + d7 = EK.prototype; + d7.H = function() { + return "JavaScriptException"; + }; + d7.E = function() { + return 1; + }; + d7.MT = function() { + this.stackdata = this.Px; + return this; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof EK ? Va(Wa(), this.Px, a10.Px) : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Px; + default: + throw new U6().e("" + a10); + } + }; + d7.xo = function() { + return ka(this.Px); + }; + d7.d = function(a10) { + this.Px = a10; + CF.prototype.Ge.call(this, null, null); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Beb: 0 }, false, "scala.scalajs.js.JavaScriptException", { Beb: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function k8() { + this.A = this.Li = this.CN = null; + } + k8.prototype = new u7(); + k8.prototype.constructor = k8; + d7 = k8.prototype; + d7.H = function() { + return "BoolField"; + }; + d7.uC = function(a10) { + return Iaa(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k8) { + var b10 = this.CN; + a10 = a10.CN; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return Xa(this); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.CN; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Xa(this); + }; + d7.xD = function() { + ab(); + var a10 = this.CN.x; + To(); + return new Uo().dq(a10); + }; + d7.AC = function() { + var a10 = this.Li; + return a10 instanceof z7 ? !!a10.i : false; + }; + function yL(a10) { + var b10 = new k8(); + b10.CN = a10; + b10.Li = a10.A; + a10 = ab(); + var c10 = b10.Li, e10 = pfa(); + b10.A = bb(a10, c10, e10).Ra(); + return b10; + } + d7.rb = function() { + return this.xD(); + }; + d7.tC = function(a10) { + return Jaa(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.xC = function() { + var a10 = this.CN; + it2(a10.l, a10.Lc); + }; + k8.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(k8.prototype, "nonNull", { get: function() { + return this.Li.na(); + }, configurable: true }); + Object.defineProperty(k8.prototype, "isNull", { get: function() { + return this.Li.b(); + }, configurable: true }); + k8.prototype.is = function(a10) { + return Haa(a10) ? this.tC(a10) : this.uC(a10); + }; + k8.prototype.remove = function() { + return this.xC(); + }; + k8.prototype.value = function() { + return this.AC(); + }; + k8.prototype.annotations = function() { + return this.rb(); + }; + Object.defineProperty(k8.prototype, "option", { get: function() { + return this.A; + }, configurable: true }); + k8.prototype.$classData = r8({ Tta: 0 }, false, "amf.client.model.BoolField", { Tta: 1, f: 1, iga: 1, BY: 1, gc: 1, CY: 1, y: 1, v: 1, q: 1, o: 1 }); + function l8() { + this.A = this.Li = this.DN = null; + } + l8.prototype = new u7(); + l8.prototype.constructor = l8; + d7 = l8.prototype; + d7.H = function() { + return "DoubleField"; + }; + d7.uC = function(a10) { + return Iaa(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof l8) { + var b10 = this.DN; + a10 = a10.DN; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return Xa(this); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.DN; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Xa(this); + }; + d7.xD = function() { + ab(); + var a10 = this.DN.x; + To(); + return new Uo().dq(a10); + }; + d7.AC = function() { + var a10 = this.Li; + return a10 instanceof z7 ? +a10.i : 0; + }; + function AL(a10) { + var b10 = new l8(); + b10.DN = a10; + b10.Li = a10.A; + a10 = ab(); + var c10 = b10.Li; + var e10 = ab(); + null === ab().UI && null === ab().UI && (ab().UI = new O_().ep(e10)); + e10 = ab().UI; + b10.A = bb(a10, c10, e10).Ra(); + return b10; + } + d7.rb = function() { + return this.xD(); + }; + d7.tC = function(a10) { + return Jaa(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.xC = function() { + var a10 = this.DN; + it2(a10.l, a10.Lc); + }; + l8.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(l8.prototype, "nonNull", { get: function() { + return this.Li.na(); + }, configurable: true }); + Object.defineProperty(l8.prototype, "isNull", { get: function() { + return this.Li.b(); + }, configurable: true }); + l8.prototype.is = function(a10) { + return Haa(a10) ? this.tC(a10) : this.uC(a10); + }; + l8.prototype.remove = function() { + return this.xC(); + }; + l8.prototype.value = function() { + return this.AC(); + }; + l8.prototype.annotations = function() { + return this.rb(); + }; + Object.defineProperty(l8.prototype, "option", { get: function() { + return this.A; + }, configurable: true }); + l8.prototype.$classData = r8({ Vta: 0 }, false, "amf.client.model.DoubleField", { Vta: 1, f: 1, iga: 1, BY: 1, gc: 1, CY: 1, y: 1, v: 1, q: 1, o: 1 }); + function m8() { + this.A = this.Li = this.EN = null; + } + m8.prototype = new u7(); + m8.prototype.constructor = m8; + d7 = m8.prototype; + d7.H = function() { + return "IntField"; + }; + d7.uC = function(a10) { + return Iaa(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof m8) { + var b10 = this.EN; + a10 = a10.EN; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.sp = function() { + return Xa(this); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.EN; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Xa(this); + }; + function CL(a10) { + var b10 = new m8(); + b10.EN = a10; + b10.Li = a10.A; + a10 = ab(); + var c10 = b10.Li; + var e10 = ab(); + null === ab().aJ && null === ab().aJ && (ab().aJ = new P_().ep(e10)); + e10 = ab().aJ; + b10.A = bb(a10, c10, e10).Ra(); + return b10; + } + d7.xD = function() { + ab(); + var a10 = this.EN.x; + To(); + return new Uo().dq(a10); + }; + d7.AC = function() { + var a10 = this.Li; + return a10 instanceof z7 ? a10.i | 0 : 0; + }; + d7.rb = function() { + return this.xD(); + }; + d7.tC = function(a10) { + return Jaa(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.xC = function() { + var a10 = this.EN; + it2(a10.l, a10.Lc); + }; + m8.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(m8.prototype, "nonNull", { get: function() { + return this.Li.na(); + }, configurable: true }); + Object.defineProperty(m8.prototype, "isNull", { get: function() { + return this.Li.b(); + }, configurable: true }); + m8.prototype.is = function(a10) { + return Haa(a10) ? this.tC(a10) : this.uC(a10); + }; + m8.prototype.remove = function() { + return this.xC(); + }; + m8.prototype.value = function() { + return this.AC(); + }; + m8.prototype.annotations = function() { + return this.rb(); + }; + Object.defineProperty(m8.prototype, "option", { get: function() { + return this.A; + }, configurable: true }); + m8.prototype.$classData = r8({ Wta: 0 }, false, "amf.client.model.IntField", { Wta: 1, f: 1, iga: 1, BY: 1, gc: 1, CY: 1, y: 1, v: 1, q: 1, o: 1 }); + function n8() { + this.ea = this.k = null; + } + n8.prototype = new u7(); + n8.prototype.constructor = n8; + d7 = n8.prototype; + d7.H = function() { + return "ClassTerm"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + n8.prototype.f7a.call(this, new gO().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + i32(); + var a10 = B6(this.k.g, fO().R); + i32().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return this.LD(); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.TV = function() { + var a10 = i32(), b10 = B6(this.k.g, fO().kh), c10 = i32().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof n8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + i32(); + var a10 = B6(this.k.g, fO().Va); + i32().cb(); + return gb(a10); + }; + d7.sq = function(a10) { + var b10 = this.k, c10 = fO().Zc; + eb(b10, c10, a10); + return this; + }; + d7.YQ = function() { + return this.TV(); + }; + d7.f7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = fO().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.t4 = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().Lf(); + Zmb(b10, uk(tk(c10, a10, e10))); + return this; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.LD = function() { + i32(); + var a10 = B6(this.k.g, fO().Zc); + i32().cb(); + return gb(a10); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = fO().R; + eb(b10, c10, a10); + return this; + }; + n8.prototype.annotations = function() { + return this.rb(); + }; + n8.prototype.graph = function() { + return jU(this); + }; + n8.prototype.withId = function(a10) { + return this.$b(a10); + }; + n8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + n8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(n8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(n8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + n8.prototype.withSubClassOf = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().Lf(); + $mb(b10, uk(tk(c10, a10, e10))); + return this; + }; + n8.prototype.withProperties = function(a10) { + return this.t4(a10); + }; + n8.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + n8.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + n8.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(n8.prototype, "subClassOf", { get: function() { + var a10 = i32(), b10 = B6(this.k.g, fO().fz), c10 = i32().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "properties", { get: function() { + return this.YQ(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(n8.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + n8.prototype.$classData = r8({ pua: 0 }, false, "amf.client.model.domain.ClassTerm", { pua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function dn() { + this.ea = this.k = null; + } + dn.prototype = new u7(); + dn.prototype.constructor = dn; + d7 = dn.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + dn.prototype.ola.call(this, new cn().K(b10, a10)); + return this; + }; + d7.H = function() { + return "CreativeWork"; + }; + d7.E = function() { + return 1; + }; + d7.RQ = function(a10) { + var b10 = this.k, c10 = li().Kn; + eb(b10, c10, a10); + return this; + }; + d7.Rv = function() { + return this.lF(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof dn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.lF = function() { + Z10(); + var a10 = B6(this.k.g, li().Pf); + Z10().cb(); + return gb(a10); + }; + d7.FC = function(a10) { + var b10 = this.k, c10 = li().Pf; + eb(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ola = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, li().Va); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = li().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.bR = function() { + Z10(); + var a10 = B6(this.k.g, li().Kn); + Z10().cb(); + return gb(a10); + }; + dn.prototype.annotations = function() { + return this.rb(); + }; + dn.prototype.graph = function() { + return jU(this); + }; + dn.prototype.withId = function(a10) { + return this.$b(a10); + }; + dn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + dn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(dn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(dn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(dn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(dn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + dn.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + dn.prototype.withTitle = function(a10) { + return this.RQ(a10); + }; + dn.prototype.withUrl = function(a10) { + return this.FC(a10); + }; + Object.defineProperty(dn.prototype, "title", { get: function() { + return this.bR(); + }, configurable: true }); + Object.defineProperty(dn.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(dn.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + dn.prototype.$classData = r8({ rua: 0 }, false, "amf.client.model.domain.CreativeWork", { rua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function o8() { + Xm.call(this); + } + o8.prototype = new T7(); + o8.prototype.constructor = o8; + function Rqb() { + } + Rqb.prototype = o8.prototype; + o8.prototype.withUniqueItems = function(a10) { + a10 = !!a10; + var b10 = this.ac, c10 = uh().qr; + Bi(b10, c10, a10); + return this; + }; + o8.prototype.withMaxItems = function(a10) { + a10 |= 0; + var b10 = this.ac, c10 = uh().pr; + es(b10, c10, a10); + return this; + }; + o8.prototype.withMinItems = function(a10) { + a10 |= 0; + var b10 = this.ac, c10 = uh().Bq; + es(b10, c10, a10); + return this; + }; + Object.defineProperty(o8.prototype, "uniqueItems", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, uh().qr); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(o8.prototype, "maxItems", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, uh().pr); + Z10().Pt(); + return CL(a10); + }, configurable: true }); + Object.defineProperty(o8.prototype, "minItems", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, uh().Bq); + Z10().Pt(); + return CL(a10); + }, configurable: true }); + function I52() { + this.ea = this.k = null; + } + I52.prototype = new u7(); + I52.prototype.constructor = I52; + d7 = I52.prototype; + d7.H = function() { + return "DialectDomainElement"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + I52.prototype.$z.call(this, new uO().K(new S6().a(), a10)); + return this; + }; + function Sqb(a10) { + var b10 = i32(), c10 = vO(a10.k).g; + a10 = /* @__PURE__ */ function() { + return function(h10) { + return ic(h10.r); + }; + }(a10); + var e10 = ii().u; + if (e10 === ii().u) + if (c10 === H10()) + a10 = H10(); + else { + e10 = c10.ga(); + var f10 = e10 = ji(a10(e10), H10()); + for (c10 = c10.ta(); c10 !== H10(); ) { + var g10 = c10.ga(); + g10 = ji(a10(g10), H10()); + f10 = f10.Nf = g10; + c10 = c10.ta(); + } + a10 = e10; + } + else { + for (e10 = se4(c10, e10); !c10.b(); ) + f10 = c10.ga(), e10.jd(a10(f10)), c10 = c10.ta(); + a10 = e10.Rc(); + } + c10 = i32().Lf(); + return Ak(b10, a10, c10).Ra(); + } + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof I52) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.N3 = function() { + return new G52().lla(tj(this.k)); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.$z = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + function Tqb(a10) { + var b10 = i32(), c10 = vO(a10.k).ba; + a10 = /* @__PURE__ */ function() { + return function(h10) { + return ic(h10); + }; + }(a10); + var e10 = ii().u; + if (e10 === ii().u) + if (c10 === H10()) + a10 = H10(); + else { + e10 = c10.ga(); + var f10 = e10 = ji(a10(e10), H10()); + for (c10 = c10.ta(); c10 !== H10(); ) { + var g10 = c10.ga(); + g10 = ji(a10(g10), H10()); + f10 = f10.Nf = g10; + c10 = c10.ta(); + } + a10 = e10; + } + else { + for (e10 = se4(c10, e10); !c10.b(); ) + f10 = c10.ga(), e10.jd(a10(f10)), c10 = c10.ta(); + a10 = e10.Rc(); + } + c10 = i32().Lf(); + return Ak(b10, a10, c10).Ra(); + } + d7.pI = function(a10) { + o1a(this.k, a10); + return this; + }; + I52.prototype.annotations = function() { + return this.rb(); + }; + I52.prototype.graph = function() { + return jU(this); + }; + I52.prototype.withId = function(a10) { + return this.$b(a10); + }; + I52.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + I52.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(I52.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(I52.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(I52.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(I52.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + I52.prototype.setLiteralProperty = function(a10, b10) { + if ("boolean" === typeof b10) { + b10 = !!b10; + var c10 = p8(this.k, ic($v(F6(), a10))); + if (c10 instanceof z7) + a10 = Y1a(this.k, c10.i, b10, pG(wD(), T6().En, T6().En)); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + } else if (Ca(b10)) + if (b10 |= 0, c10 = p8(this.k, ic($v(F6(), a10))), c10 instanceof z7) + a10 = Z1a(this.k, c10.i, b10, pG(wD(), T6().En, T6().En)); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + else if (na(b10)) + if (b10 = +b10, c10 = p8(this.k, ic($v(F6(), a10))), c10 instanceof z7) + a10 = $1a(this.k, c10.i, b10, pG(wD(), T6().En, T6().En)); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + else if ("number" === typeof b10) + if (b10 = +b10, c10 = p8(this.k, ic($v(F6(), a10))), c10 instanceof z7) + a10 = a2a(this.k, c10.i, b10, pG(wD(), T6().En, T6().En)); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + else if (sp(b10)) + if (c10 = p8(this.k, ic($v(F6(), a10))), c10 instanceof z7) + a10 = b2a(this.k, c10.i, b10, pG( + wD(), + T6().En, + T6().En + )); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + else if (c10 = p8(this.k, ic($v(F6(), a10))), c10 instanceof z7) { + a10 = c10.i; + c10 = this.k; + var e10 = i32(), f10 = i32().QM(); + a10 = O1a(c10, a10, uk(tk(e10, b10, f10)), pG(wD(), T6().En, T6().En)); + } else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + return a10; + }; + I52.prototype.getObjectPropertyUri = function(a10) { + a10 = ic($v(F6(), a10)); + a10 = p8(this.k, a10); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(xj(a10))); + if (a10 instanceof z7) { + var b10 = false, c10 = null; + a10 = this.k.g.vb.Ja(a10.i); + a: { + if (a10 instanceof z7) { + b10 = true; + c10 = a10; + var e10 = c10.i; + e10 = nt2(ot(), e10); + if (!e10.b() && (e10 = e10.c().ma(), e10 instanceof $r)) { + a10 = e10.wb; + b10 = new h$a2(); + c10 = K7(); + a10 = a10.ec(b10, c10.u); + break a; + } + } + if (b10 && (b10 = c10.i, b10 = nt2(ot(), b10), !b10.b() && (b10 = b10.c().ma(), b10 instanceof uO))) { + a10 = K7(); + i32(); + b10 = new I52().$z(b10); + Uqb(); + a10 = J5(a10, new Ib().ha([b10.k])); + break a; + } + if (y7() === a10) + a10 = H10(); + else + throw new x7().d(a10); + } + } else + a10 = H10(); + b10 = i32(); + c10 = Uqb(); + return Ak(b10, a10, c10).Ra(); + }; + I52.prototype.getScalarByPropertyUri = function(a10) { + a10 = ic($v(F6(), a10)); + a10 = p8(this.k, a10); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(xj(a10))); + if (a10 instanceof z7) { + a10 = a10.i; + var b10 = false, c10 = null, e10 = this.k.g.vb.Ja(a10); + a: { + if (e10 instanceof z7) { + b10 = true; + c10 = e10; + var f10 = c10.i; + if (f10 && f10.$classData && f10.$classData.ge.mg) { + a10 = f10; + break a; + } + } + if (b10) + a10 = c10.i, a10 = J5(K7(), new Ib().ha([a10])); + else if (y7() === e10) + a10 = this.k.g.vb.Ja(a10), a10.b() ? a10 = y7() : (a10 = a10.c(), b10 = K7(), a10 = new z7().d(J5(b10, new Ib().ha([a10])))), a10 = a10.b() ? H10() : a10.c(); + else + throw new x7().d(e10); + } + } else + a10 = H10(); + b10 = i32(); + c10 = i32().QM(); + return Ak(b10, a10, c10).Ra(); + }; + I52.prototype.getPropertyUris = function() { + return Sqb(this); + }; + I52.prototype.getTypeUris = function() { + return Tqb(this); + }; + I52.prototype.setObjectCollectionProperty = function(a10, b10) { + var c10 = p8(this.k, ic($v(F6(), a10))); + if (c10 instanceof z7) { + a10 = c10.i; + c10 = this.k; + var e10 = i32(), f10 = Uqb(); + b10 = K1a(c10, a10, uk(tk(e10, b10, f10)), T6().En); + } else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + return b10; + }; + I52.prototype.setObjectProperty = function(a10, b10) { + var c10 = p8(this.k, ic($v(F6(), a10))); + if (c10 instanceof z7) + a10 = t1a(this.k, c10.i, b10.k, T6().En); + else { + if (y7() === c10) + throw mb(E6(), new nb().e("Cannot find node mapping for propertyId " + a10)); + throw new x7().d(c10); + } + return a10; + }; + I52.prototype.includeName = function() { + return iNa(this.k); + }; + I52.prototype.localRefName = function() { + return m2a(this.k); + }; + I52.prototype.definedBy = function() { + return this.N3(); + }; + I52.prototype.withDefinedby = function(a10) { + VU(this.k, a10.k); + return this; + }; + I52.prototype.withInstanceTypes = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().Lf(); + WU(b10, uk(tk(c10, a10, e10))); + return this; + }; + I52.prototype.withAbstract = function(a10) { + return this.pI(!!a10); + }; + I52.prototype.isAbstract = function() { + return B6(this.k.g, Fw().oX); + }; + I52.prototype.$classData = r8({ uua: 0 }, false, "amf.client.model.domain.DialectDomainElement", { uua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function q8() { + this.ea = this.k = null; + } + q8.prototype = new u7(); + q8.prototype.constructor = q8; + d7 = q8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + q8.prototype.jaa.call(this, new IV().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "DocumentMapping"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof q8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jaa = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + q8.prototype.annotations = function() { + return this.rb(); + }; + q8.prototype.graph = function() { + return jU(this); + }; + q8.prototype.withId = function(a10) { + return this.$b(a10); + }; + q8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + q8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(q8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(q8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(q8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(q8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + q8.prototype.withDeclaredNodes = function(a10) { + var b10 = this.k, c10 = i32(), e10 = Vqb(); + a10 = uk(tk(c10, a10, e10)); + c10 = GO().Mt; + return Bf(b10, c10, a10); + }; + q8.prototype.declaredNodes = function() { + var a10 = i32(), b10 = B6(this.k.g, GO().Mt), c10 = Vqb(); + return Ak(a10, b10, c10).Ra(); + }; + q8.prototype.withEncoded = function(a10) { + var b10 = this.k, c10 = GO().Vs; + eb(b10, c10, a10); + return this; + }; + q8.prototype.encoded = function() { + i32(); + var a10 = B6(this.k.g, GO().Vs); + i32().cb(); + return gb(a10); + }; + q8.prototype.withDocumentName = function(a10) { + var b10 = this.k, c10 = GO().vx; + eb(b10, c10, a10); + return this; + }; + q8.prototype.documentName = function() { + i32(); + var a10 = B6(this.k.g, GO().vx); + i32().cb(); + return gb(a10); + }; + q8.prototype.$classData = r8({ wua: 0 }, false, "amf.client.model.domain.DocumentMapping", { wua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function r82() { + this.ea = this.k = null; + } + r82.prototype = new u7(); + r82.prototype.constructor = r82; + d7 = r82.prototype; + d7.H = function() { + return "DocumentsModel"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + r82.prototype.kla.call(this, new VV().K(new S6().a(), a10)); + return this; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof r82) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.kla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + r82.prototype.annotations = function() { + return this.rb(); + }; + r82.prototype.graph = function() { + return jU(this); + }; + r82.prototype.withId = function(a10) { + return this.$b(a10); + }; + r82.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + r82.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(r82.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(r82.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(r82.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(r82.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + r82.prototype.withKeyProperty = function(a10) { + a10 = !!a10; + i32(); + var b10 = this.k, c10 = Hc().Py; + a10 = Bi(b10, c10, a10); + return GWa(Wqb(), a10); + }; + r82.prototype.keyProperty = function() { + i32(); + var a10 = B6(this.k.g, Hc().Py); + i32().yi(); + return yL(a10); + }; + r82.prototype.withDeclarationsPath = function(a10) { + i32(); + var b10 = this.k, c10 = Hc().Iy; + a10 = eb(b10, c10, a10); + return GWa(Wqb(), a10); + }; + r82.prototype.declarationsPath = function() { + i32(); + var a10 = B6(this.k.g, Hc().Iy); + i32().cb(); + return gb(a10); + }; + r82.prototype.withSelfEncoded = function(a10) { + a10 = !!a10; + i32(); + var b10 = this.k, c10 = Hc().cz; + a10 = Bi(b10, c10, a10); + return GWa(Wqb(), a10); + }; + r82.prototype.selfEncoded = function() { + i32(); + var a10 = B6(this.k.g, Hc().cz); + i32().yi(); + return yL(a10); + }; + r82.prototype.withLibrary = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Hc().Fx; + return Vd(b10, c10, a10); + }; + r82.prototype.library = function() { + return new q8().jaa(B6(this.k.g, Hc().Fx)); + }; + r82.prototype.withFragments = function(a10) { + var b10 = this.k, c10 = i32(), e10 = Xqb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Hc().My; + return Bf(b10, c10, a10); + }; + r82.prototype.fragments = function() { + var a10 = i32(), b10 = B6(this.k.g, Hc().My), c10 = Xqb(); + return Ak(a10, b10, c10).Ra(); + }; + r82.prototype.withRoot = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Hc().De; + return Vd(b10, c10, a10); + }; + r82.prototype.root = function() { + return new q8().jaa(B6(this.k.g, Hc().De)); + }; + r82.prototype.$classData = r8({ xua: 0 }, false, "amf.client.model.domain.DocumentsModel", { xua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Uk() { + this.ea = this.k = null; + } + Uk.prototype = new u7(); + Uk.prototype.constructor = Uk; + d7 = Uk.prototype; + d7.cE = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Uk.prototype.cE.call(this, new Td().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "DomainExtension"; + }; + d7.Xe = function() { + ab(); + var a10 = B6(this.k.g, Ud().R); + ab().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Uk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.K4 = function() { + ab(); + var a10 = B6(this.k.g, Ud().ig); + Yqb(); + return new Tk().HO(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.j4 = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Ud().zi; + Vd(b10, c10, a10); + return this; + }; + d7.p$ = function() { + ab(); + var a10 = B6(this.k.g, Ud().zi); + return fl(ab().Um(), a10); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = Ud().R; + eb(b10, c10, a10); + return this; + }; + Uk.prototype.annotations = function() { + return this.rb(); + }; + Uk.prototype.graph = function() { + return jU(this); + }; + Uk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Uk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Uk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Uk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Uk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Uk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Uk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Uk.prototype.withExtension = function(a10) { + return this.j4(a10); + }; + Uk.prototype.withDefinedBy = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Ud().ig; + Vd(b10, c10, a10); + return this; + }; + Uk.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Uk.prototype, "extension", { get: function() { + return this.p$(); + }, configurable: true }); + Object.defineProperty(Uk.prototype, "definedBy", { get: function() { + return this.K4(); + }, configurable: true }); + Object.defineProperty(Uk.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Uk.prototype.$classData = r8({ yua: 0 }, false, "amf.client.model.domain.DomainExtension", { yua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function fm() { + this.ea = this.k = null; + } + fm.prototype = new u7(); + fm.prototype.constructor = fm; + d7 = fm.prototype; + d7.sI = function(a10) { + return this.AM(a10); + }; + d7.H = function() { + return "Encoding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + fm.prototype.vla.call(this, new em().K(new S6().a(), a10)); + return this; + }; + d7.tI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = dm().Tf; + Zd(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.n$ = function() { + Z10(); + var a10 = B6(this.k.g, dm().Vu); + Z10().yi(); + return yL(a10); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.VQ = function() { + Z10(); + var a10 = B6(this.k.g, dm().yl); + Z10().cb(); + return gb(a10); + }; + d7.AM = function(a10) { + Z10(); + a10 = this.k.lI(a10); + return I0(s8(), a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.oea = function() { + Z10(); + var a10 = B6(this.k.g, dm().Yt); + Z10().cb(); + return gb(a10); + }; + d7.F4 = function(a10) { + var b10 = this.k, c10 = dm().Yt; + eb(b10, c10, a10); + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.i4 = function(a10) { + var b10 = this.k, c10 = dm().Vu; + Bi(b10, c10, a10); + return this; + }; + d7.yK = function() { + var a10 = Z10(), b10 = B6(this.k.g, dm().Tf), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.yy = function() { + return this.yK(); + }; + d7.rb = function() { + return So(this); + }; + d7.X3 = function(a10) { + var b10 = this.k, c10 = dm().Su; + Bi(b10, c10, a10); + return this; + }; + d7.vla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.A8 = function() { + Z10(); + var a10 = B6(this.k.g, dm().Su); + Z10().yi(); + return yL(a10); + }; + fm.prototype.annotations = function() { + return this.rb(); + }; + fm.prototype.graph = function() { + return jU(this); + }; + fm.prototype.withId = function(a10) { + return this.$b(a10); + }; + fm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + fm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(fm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(fm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + fm.prototype.withHeader = function(a10) { + return this.sI(a10); + }; + fm.prototype.withAllowReserved = function(a10) { + return this.X3(!!a10); + }; + fm.prototype.withExplode = function(a10) { + return this.i4(!!a10); + }; + fm.prototype.withStyle = function(a10) { + return this.F4(a10); + }; + fm.prototype.withHeaders = function(a10) { + return this.tI(a10); + }; + fm.prototype.withContentType = function(a10) { + var b10 = this.k, c10 = dm().yl; + eb(b10, c10, a10); + return this; + }; + fm.prototype.withPropertyName = function(a10) { + var b10 = this.k, c10 = dm().lD; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(fm.prototype, "allowReserved", { get: function() { + return this.A8(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "explode", { get: function() { + return this.n$(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "style", { get: function() { + return this.oea(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "contentType", { get: function() { + return this.VQ(); + }, configurable: true }); + Object.defineProperty(fm.prototype, "propertyName", { get: function() { + Z10(); + var a10 = B6(this.k.g, dm().lD); + Z10().cb(); + return gb(a10); + }, configurable: true }); + fm.prototype.$classData = r8({ Bua: 0 }, false, "amf.client.model.domain.Encoding", { Bua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function t8() { + this.ea = this.k = null; + } + t8.prototype = new u7(); + t8.prototype.constructor = t8; + d7 = t8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + t8.prototype.h7a.call(this, new yO().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "External"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof t8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.$3 = function(a10) { + i32(); + var b10 = this.k, c10 = dd().Kh; + a10 = eb(b10, c10, a10); + return KWa(F52(), a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.W3 = function(a10) { + i32(); + var b10 = this.k, c10 = dd().Zc; + a10 = eb(b10, c10, a10); + return KWa(F52(), a10); + }; + d7.x8 = function() { + i32(); + var a10 = B6(this.k.g, dd().Zc); + i32().cb(); + return gb(a10); + }; + d7.p9 = function() { + i32(); + var a10 = B6(this.k.g, dd().Kh); + i32().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.h7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + t8.prototype.annotations = function() { + return this.rb(); + }; + t8.prototype.graph = function() { + return jU(this); + }; + t8.prototype.withId = function(a10) { + return this.$b(a10); + }; + t8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + t8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(t8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(t8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(t8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(t8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + t8.prototype.withBase = function(a10) { + return this.$3(a10); + }; + t8.prototype.withAlias = function(a10) { + return this.W3(a10); + }; + Object.defineProperty(t8.prototype, "base", { get: function() { + return this.p9(); + }, configurable: true }); + Object.defineProperty(t8.prototype, "alias", { get: function() { + return this.x8(); + }, configurable: true }); + t8.prototype.$classData = r8({ Eua: 0 }, false, "amf.client.model.domain.External", { Eua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Qk() { + this.ea = this.k = null; + } + Qk.prototype = new u7(); + Qk.prototype.constructor = Qk; + d7 = Qk.prototype; + d7.V$ = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Qk.prototype.V$.call(this, new Pk().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ExternalDomainElement"; + }; + d7.Rm = function(a10) { + var b10 = this.k, c10 = Ok().Rd; + eb(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.wL = function() { + ab(); + var a10 = B6(this.k.g, Ok().Nd); + ab().cb(); + return gb(a10); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Qk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ada = function() { + ab(); + var a10 = B6(this.k.g, Ok().Rd); + ab().cb(); + return gb(a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Sm = function() { + return this.ada(); + }; + d7.EQ = function(a10) { + var b10 = this.k, c10 = Ok().Nd; + eb(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.zy = function() { + return this.wL(); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + Qk.prototype.annotations = function() { + return this.rb(); + }; + Qk.prototype.graph = function() { + return jU(this); + }; + Qk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Qk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Qk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Qk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Qk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Qk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Qk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Qk.prototype.withMediaType = function(a10) { + return this.EQ(a10); + }; + Qk.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + Object.defineProperty(Qk.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + Object.defineProperty(Qk.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + Qk.prototype.$classData = r8({ Fua: 0 }, false, "amf.client.model.domain.ExternalDomainElement", { Fua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function In() { + this.ea = this.k = null; + } + In.prototype = new u7(); + In.prototype.constructor = In; + d7 = In.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + In.prototype.wla.call(this, new Hn().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "IriTemplateMapping"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof In) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.wla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + In.prototype.annotations = function() { + return this.rb(); + }; + In.prototype.graph = function() { + return jU(this); + }; + In.prototype.withId = function(a10) { + return this.$b(a10); + }; + In.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + In.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(In.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(In.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(In.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(In.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + In.prototype.withLinkExpression = function(a10) { + var b10 = this.k, c10 = Gn().jD; + eb(b10, c10, a10); + return this; + }; + In.prototype.withTemplateVariable = function(a10) { + var b10 = this.k, c10 = Gn().pD; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(In.prototype, "linkExpression", { get: function() { + Z10(); + var a10 = B6(this.k.g, Gn().jD); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(In.prototype, "templateVariable", { get: function() { + Z10(); + var a10 = B6(this.k.g, Gn().pD); + Z10().cb(); + return gb(a10); + }, configurable: true }); + In.prototype.$classData = r8({ Lua: 0 }, false, "amf.client.model.domain.IriTemplateMapping", { Lua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function zo() { + this.ea = this.k = null; + } + zo.prototype = new u7(); + zo.prototype.constructor = zo; + d7 = zo.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + zo.prototype.Vla.call(this, new yo().K(b10, a10)); + return this; + }; + d7.H = function() { + return "MqttServerLastWill"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.Q4 = function() { + Z10(); + var a10 = B6(this.k.g, xo().oD); + Z10().yi(); + return yL(a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.C4 = function(a10) { + var b10 = this.k, c10 = xo().oD; + Bi(b10, c10, a10); + return this; + }; + d7.Vla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.u4 = function(a10) { + var b10 = this.k, c10 = xo().mD; + es(b10, c10, a10); + return this; + }; + d7.N4 = function() { + Z10(); + var a10 = B6(this.k.g, xo().mD); + Z10().Pt(); + return CL(a10); + }; + zo.prototype.annotations = function() { + return this.rb(); + }; + zo.prototype.graph = function() { + return jU(this); + }; + zo.prototype.withId = function(a10) { + return this.$b(a10); + }; + zo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + zo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(zo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(zo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(zo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(zo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + zo.prototype.withRetain = function(a10) { + return this.C4(!!a10); + }; + zo.prototype.withQos = function(a10) { + return this.u4(a10 | 0); + }; + zo.prototype.withTopic = function(a10) { + var b10 = this.k, c10 = xo().g_; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(zo.prototype, "retain", { get: function() { + return this.Q4(); + }, configurable: true }); + Object.defineProperty(zo.prototype, "qos", { get: function() { + return this.N4(); + }, configurable: true }); + Object.defineProperty(zo.prototype, "topic", { get: function() { + Z10(); + var a10 = B6(this.k.g, xo().g_); + Z10().cb(); + return gb(a10); + }, configurable: true }); + zo.prototype.$classData = r8({ Uua: 0 }, false, "amf.client.model.domain.MqttServerLastWill", { Uua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function G52() { + this.ea = this.k = null; + } + G52.prototype = new u7(); + G52.prototype.constructor = G52; + d7 = G52.prototype; + d7.H = function() { + return "NodeMapping"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + G52.prototype.lla.call(this, new Cd().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + i32(); + var a10 = this.k; + a10 = B6(a10.g, a10.R); + i32().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof G52) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.lla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + eb(b10, b10.R, a10); + return this; + }; + G52.prototype.annotations = function() { + return this.rb(); + }; + G52.prototype.graph = function() { + return jU(this); + }; + G52.prototype.withId = function(a10) { + return this.$b(a10); + }; + G52.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + G52.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(G52.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(G52.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(G52.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(G52.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + G52.prototype.withMergePolicy = function(a10) { + jka(this.k, a10); + return this; + }; + G52.prototype.withIdTemplate = function(a10) { + var b10 = this.k, c10 = wj().Ax; + eb(b10, c10, a10); + return this; + }; + G52.prototype.withPropertiesMapping = function(a10) { + var b10 = this.k, c10 = i32(), e10 = Zqb(); + a10 = uk(tk(c10, a10, e10)); + c10 = wj().ej; + Bf(b10, c10, a10); + return this; + }; + G52.prototype.withNodeTypeMapping = function(a10) { + var b10 = this.k, c10 = wj().Ut; + eb(b10, c10, a10); + return this; + }; + G52.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(G52.prototype, "mergePolicy", { get: function() { + i32(); + var a10 = ika(this.k); + i32().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(G52.prototype, "idTemplate", { get: function() { + i32(); + var a10 = B6(this.k.g, wj().Ax); + i32().cb(); + return gb(a10); + }, configurable: true }); + G52.prototype.propertiesMapping = function() { + var a10 = i32(), b10 = B6(this.k.g, wj().ej), c10 = Zqb(); + return Ak(a10, b10, c10).Ra(); + }; + Object.defineProperty(G52.prototype, "nodetypeMapping", { get: function() { + i32(); + var a10 = B6(this.k.g, wj().Ut); + i32().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(G52.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + G52.prototype.$classData = r8({ Wua: 0 }, false, "amf.client.model.domain.NodeMapping", { Wua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mm() { + this.ea = this.k = null; + } + Mm.prototype = new u7(); + Mm.prototype.constructor = Mm; + d7 = Mm.prototype; + d7.H = function() { + return "OAuth2Flow"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Mm.prototype.Xla.call(this, new Km().K(new S6().a(), a10)); + return this; + }; + d7.E = function() { + return 1; + }; + d7.k9 = function() { + Z10(); + var a10 = B6(this.k.g, Jm().km); + Z10().cb(); + return gb(a10); + }; + d7.Y3 = function(a10) { + var b10 = this.k, c10 = Jm().km; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Mm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vda = function() { + var a10 = Z10(), b10 = B6(this.k.g, Jm().lo), c10 = $qb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Xla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + Mm.prototype.annotations = function() { + return this.rb(); + }; + Mm.prototype.graph = function() { + return jU(this); + }; + Mm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Mm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Mm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Mm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Mm.prototype.withFlow = function(a10) { + var b10 = this.k, c10 = Jm().Wv; + eb(b10, c10, a10); + return this; + }; + Mm.prototype.withScopes = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = $qb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jm().lo; + Zd(b10, c10, a10); + return this; + }; + Mm.prototype.withRefreshUri = function(a10) { + var b10 = this.k, c10 = Jm().tN; + eb(b10, c10, a10); + return this; + }; + Mm.prototype.withAccessTokenUri = function(a10) { + var b10 = this.k, c10 = Jm().vq; + eb(b10, c10, a10); + return this; + }; + Mm.prototype.withAuthorizationUri = function(a10) { + return this.Y3(a10); + }; + Object.defineProperty(Mm.prototype, "flow", { get: function() { + Z10(); + var a10 = B6(this.k.g, Jm().Wv); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "scopes", { get: function() { + return this.Vda(); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "refreshUri", { get: function() { + Z10(); + var a10 = B6(this.k.g, Jm().tN); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "accessTokenUri", { get: function() { + Z10(); + var a10 = B6(this.k.g, Jm().vq); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Mm.prototype, "authorizationUri", { get: function() { + return this.k9(); + }, configurable: true }); + Mm.prototype.$classData = r8({ Zua: 0 }, false, "amf.client.model.domain.OAuth2Flow", { Zua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function km() { + this.ea = this.k = null; + } + km.prototype = new u7(); + km.prototype.constructor = km; + d7 = km.prototype; + d7.$da = function() { + Z10(); + var a10 = B6(this.k.g, im().Oh); + return WWa(arb(), a10); + }; + d7.H = function() { + return "ParametrizedSecurityScheme"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + km.prototype.Yla.call(this, new jm().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, im().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof km) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.$ea = function() { + Z10(); + var a10 = this.k.cX(); + XWa(Z10()); + return new k1().sU(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.R4 = function() { + Z10(); + var a10 = B6(this.k.g, im().Eq); + return UWa(brb(), a10); + }; + d7.Xea = function() { + Z10(); + var a10 = this.k.I3(); + $Wa(Z10()); + return new i1().rU(a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Vea = function() { + Z10(); + var a10 = this.k.mQ(); + ZWa(Z10()); + return new g1().qU(a10); + }; + d7.Yla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.dfa = function() { + Z10(); + var a10 = this.k.J3(); + aXa(Z10()); + return new o1().uU(a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.afa = function() { + Z10(); + var a10 = this.k.pQ(); + YWa(Z10()); + return new m1().tU(a10); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = im().R; + eb(b10, c10, a10); + return this; + }; + d7.E4 = function(a10) { + var b10 = this.k; + Z10(); + arb(); + a10 = a10.k; + var c10 = im().Oh; + Vd(b10, c10, a10); + return this; + }; + d7.Wea = function() { + Z10(); + var a10 = this.k.aX(); + return WWa(arb(), a10); + }; + km.prototype.annotations = function() { + return this.rb(); + }; + km.prototype.graph = function() { + return jU(this); + }; + km.prototype.withId = function(a10) { + return this.$b(a10); + }; + km.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + km.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(km.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(km.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(km.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(km.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + km.prototype.withOpenIdConnectSettings = function() { + return this.dfa(); + }; + km.prototype.withHttpSettings = function() { + return this.Xea(); + }; + km.prototype.withApiKeySettings = function() { + return this.Vea(); + }; + km.prototype.withOAuth2Settings = function() { + return this.afa(); + }; + km.prototype.withOAuth1Settings = function() { + return this.$ea(); + }; + km.prototype.withDefaultSettings = function() { + return this.Wea(); + }; + km.prototype.withSettings = function(a10) { + return this.E4(a10); + }; + km.prototype.withScheme = function(a10) { + var b10 = this.k; + Z10(); + brb(); + a10 = a10.k; + var c10 = im().Eq; + Vd(b10, c10, a10); + return this; + }; + km.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(km.prototype, "settings", { get: function() { + return this.$da(); + }, configurable: true }); + Object.defineProperty(km.prototype, "scheme", { get: function() { + return this.R4(); + }, configurable: true }); + Object.defineProperty(km.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + km.prototype.$classData = r8({ iva: 0 }, false, "amf.client.model.domain.ParametrizedSecurityScheme", { iva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function wn() { + this.ea = this.k = null; + } + wn.prototype = new u7(); + wn.prototype.constructor = wn; + d7 = wn.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + wn.prototype.qla.call(this, new vn().K(new S6().a(), a10)); + return this; + }; + d7.qla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.H = function() { + return "PropertyDependencies"; + }; + d7.aR = function() { + var a10 = Z10(), b10 = B6(this.k.g, un().vJ), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.S4 = function() { + Z10(); + var a10 = B6(this.k.g, un().uJ); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + wn.prototype.annotations = function() { + return this.rb(); + }; + wn.prototype.graph = function() { + return jU(this); + }; + wn.prototype.withId = function(a10) { + return this.$b(a10); + }; + wn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + wn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(wn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(wn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(wn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(wn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + wn.prototype.withPropertyTarget = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = un().vJ; + Wr(b10, c10, a10); + return this; + }; + wn.prototype.withPropertySource = function(a10) { + var b10 = this.k, c10 = un().uJ; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(wn.prototype, "target", { get: function() { + return this.aR(); + }, configurable: true }); + Object.defineProperty(wn.prototype, "source", { get: function() { + return this.S4(); + }, configurable: true }); + wn.prototype.$classData = r8({ lva: 0 }, false, "amf.client.model.domain.PropertyDependencies", { lva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function u8() { + this.ea = this.k = null; + } + u8.prototype = new u7(); + u8.prototype.constructor = u8; + d7 = u8.prototype; + d7.H = function() { + return "PropertyMapping"; + }; + d7.Xe = function() { + i32(); + var a10 = B6(this.k.g, $d().R); + i32().cb(); + return gb(a10); + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + u8.prototype.j7a.call(this, new rO().K(new S6().a(), a10)); + return this; + }; + d7.j7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.E = function() { + return 1; + }; + d7.xba = function() { + i32(); + var a10 = B6(this.k.g, $d().ji); + i32().Pt(); + return CL(a10); + }; + d7.JQ = function(a10) { + var b10 = this.k, c10 = $d().zl; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof u8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function crb(a10) { + var b10 = Vb().Ia(dV(a10.k)); + if (b10 instanceof z7) { + var c10 = b10.i; + b10 = i32(); + var e10 = Rb(Ut(), H10()); + a10 = Tc(c10, e10, Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + var h10 = new R6().M(f10, g10); + f10 = h10.Tp; + g10 = h10.hr; + if (null !== g10) + return h10 = g10.ma(), g10 = g10.ya(), f10.Ue(h10, g10), f10; + throw new x7().d(h10); + }; + }(a10))); + c10 = i32().Lf(); + return Zda(b10, a10, c10).Ra(); + } + if (y7() === b10) + return b10 = i32(), a10 = Rb(Ut(), H10()), c10 = i32().Lf(), Zda(b10, a10, c10).Ra(); + throw new x7().d(b10); + } + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.NV = function() { + i32(); + var a10 = B6(this.k.g, $d().zl); + i32().cb(); + return gb(a10); + }; + d7.gV = function() { + i32(); + var a10 = B6(this.k.g, $d().vj); + i32().XC(); + return AL(a10); + }; + function drb(a10) { + a10 = MDa(a10.k); + if (YCa() === a10) + return "extension_property"; + if ($Ca() === a10) + return "literal_property"; + if (WN() === a10) + return "object_property"; + if (YN() === a10) + return "object_property_collection"; + if (TN() === a10) + return "object_map_property"; + cDa || (cDa = new RN().a()); + if (cDa === a10) + return "object_map_inheritance"; + if (fDa() === a10) + return "object_pair_property"; + if (bDa() === a10) + return "literal_property_collection"; + throw mb(E6(), new nb().e("Unknown property classification " + a10)); + } + d7.rb = function() { + return So(this); + }; + d7.DQ = function(a10) { + var b10 = this.k, c10 = $d().vj; + Xr(b10, c10, a10); + return this; + }; + d7.GQ = function(a10) { + var b10 = this.k, c10 = $d().wj; + Xr(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.kV = function() { + i32(); + var a10 = B6(this.k.g, $d().wj); + i32().XC(); + return AL(a10); + }; + d7.n4 = function(a10) { + var b10 = this.k, c10 = $d().ji; + es(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = $d().R; + eb(b10, c10, a10); + return this; + }; + u8.prototype.annotations = function() { + return this.rb(); + }; + u8.prototype.graph = function() { + return jU(this); + }; + u8.prototype.withId = function(a10) { + return this.$b(a10); + }; + u8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + u8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(u8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(u8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(u8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(u8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + u8.prototype.classification = function() { + return drb(this); + }; + u8.prototype.withTypeDiscriminatorName = function(a10) { + var b10 = this.k, c10 = Ae4().Zt; + eb(b10, c10, a10); + return this; + }; + u8.prototype.typeDiscriminatorName = function() { + i32(); + var a10 = B6(this.k.g, Ae4().Zt); + i32().cb(); + return gb(a10); + }; + u8.prototype.withTypeDiscriminator = function() { + throw mb(E6(), new nb().e("Not implemented yet")); + }; + u8.prototype.typeDiscriminator = function() { + return crb(this); + }; + u8.prototype.withSorted = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = $d().EJ; + Bi(b10, c10, a10); + return this; + }; + u8.prototype.sorted = function() { + i32(); + var a10 = B6(this.k.g, $d().EJ); + i32().yi(); + return yL(a10); + }; + u8.prototype.withEnum = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().QM(); + lOa(b10, uk(tk(c10, a10, e10))); + return this; + }; + u8.prototype["enum"] = function() { + var a10 = i32(), b10 = B6(this.k.g, $d().ZI); + i32(); + null === i32().MI && null === i32().MI && (i32().MI = new vL()); + var c10 = i32().MI; + return Ak(a10, b10, c10).Ra(); + }; + u8.prototype.withAllowMultiple = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = $d().Ey; + Bi(b10, c10, a10); + return this; + }; + u8.prototype.allowMultiple = function() { + i32(); + var a10 = B6(this.k.g, $d().Ey); + i32().yi(); + return yL(a10); + }; + u8.prototype.withMaximum = function(a10) { + return this.DQ(+a10); + }; + u8.prototype.maximum = function() { + return this.gV(); + }; + u8.prototype.withMinimum = function(a10) { + return this.GQ(+a10); + }; + u8.prototype.minimum = function() { + return this.kV(); + }; + u8.prototype.withPattern = function(a10) { + return this.JQ(a10); + }; + u8.prototype.pattern = function() { + return this.NV(); + }; + u8.prototype.withMinCount = function(a10) { + return this.n4(a10 | 0); + }; + u8.prototype.minCount = function() { + return this.xba(); + }; + u8.prototype.withMapValueProperty = function(a10) { + var b10 = this.k, c10 = $d().bw; + eb(b10, c10, a10); + return this; + }; + u8.prototype.mapValueProperty = function() { + i32(); + var a10 = B6(this.k.g, $d().St); + i32().cb(); + return gb(a10); + }; + u8.prototype.withMapKeyProperty = function(a10) { + var b10 = this.k, c10 = $d().St; + eb(b10, c10, a10); + return this; + }; + u8.prototype.mapKeyProperty = function() { + i32(); + var a10 = B6(this.k.g, $d().St); + i32().cb(); + return gb(a10); + }; + u8.prototype.objectRange = function() { + var a10 = i32(), b10 = B6(this.k.g, Ae4().bh), c10 = i32().cb(); + return Ak(a10, b10, c10).Ra(); + }; + u8.prototype.withObjectRange = function(a10) { + var b10 = this.k, c10 = i32(), e10 = i32().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = Ae4().bh; + Wr(b10, c10, a10); + return this; + }; + u8.prototype.literalRange = function() { + i32(); + var a10 = B6(this.k.g, $d().Gf); + i32().cb(); + return gb(a10); + }; + u8.prototype.withLiteralRange = function(a10) { + var b10 = this.k, c10 = $d().Gf; + eb(b10, c10, a10); + return this; + }; + u8.prototype.nodePropertyMapping = function() { + i32(); + var a10 = B6(this.k.g, $d().Yh); + i32().cb(); + return gb(a10); + }; + u8.prototype.withNodePropertyMapping = function(a10) { + var b10 = this.k, c10 = $d().Yh; + eb(b10, c10, a10); + return this; + }; + u8.prototype.name = function() { + return this.Xe(); + }; + u8.prototype.withName = function(a10) { + return this.Td(a10); + }; + u8.prototype.$classData = r8({ mva: 0 }, false, "amf.client.model.domain.PropertyMapping", { mva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function v8() { + this.ea = this.k = null; + } + v8.prototype = new u7(); + v8.prototype.constructor = v8; + d7 = v8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + v8.prototype.k7a.call(this, new OV().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "PublicNodeMapping"; + }; + d7.Xe = function() { + i32(); + var a10 = B6(this.k.g, UV().R); + i32().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof v8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.k7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = UV().R; + eb(b10, c10, a10); + return this; + }; + v8.prototype.annotations = function() { + return this.rb(); + }; + v8.prototype.graph = function() { + return jU(this); + }; + v8.prototype.withId = function(a10) { + return this.$b(a10); + }; + v8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + v8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(v8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(v8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(v8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(v8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + v8.prototype.withMappedNode = function(a10) { + var b10 = this.k, c10 = UV().$u; + eb(b10, c10, a10); + return this; + }; + v8.prototype.mappedNode = function() { + i32(); + var a10 = B6(this.k.g, UV().$u); + i32().cb(); + return gb(a10); + }; + v8.prototype.withName = function(a10) { + return this.Td(a10); + }; + v8.prototype.name = function() { + return this.Xe(); + }; + v8.prototype.$classData = r8({ pva: 0 }, false, "amf.client.model.domain.PublicNodeMapping", { pva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Im() { + this.ea = this.k = null; + } + Im.prototype = new u7(); + Im.prototype.constructor = Im; + d7 = Im.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Im.prototype.Zla.call(this, new Hm().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Scope"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Gm().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Im) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Gm().Va); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Gm().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.Zla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = Gm().R; + eb(b10, c10, a10); + return this; + }; + Im.prototype.annotations = function() { + return this.rb(); + }; + Im.prototype.graph = function() { + return jU(this); + }; + Im.prototype.withId = function(a10) { + return this.$b(a10); + }; + Im.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Im.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Im.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Im.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Im.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Im.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Im.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Im.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Im.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Im.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Im.prototype.$classData = r8({ xva: 0 }, false, "amf.client.model.domain.Scope", { xva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function um() { + this.ea = this.k = null; + } + um.prototype = new u7(); + um.prototype.constructor = um; + d7 = um.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + um.prototype.$la.call(this, new tm().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "SecurityRequirement"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, rm2().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.MQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = erb(); + a10 = uk(tk(c10, a10, e10)); + c10 = rm2().Gh; + Zd(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof um) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.$la = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.qW = function() { + var a10 = Z10(), b10 = B6(this.k.g, rm2().Gh), c10 = erb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = rm2().R; + eb(b10, c10, a10); + return this; + }; + um.prototype.annotations = function() { + return this.rb(); + }; + um.prototype.graph = function() { + return jU(this); + }; + um.prototype.withId = function(a10) { + return this.$b(a10); + }; + um.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + um.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(um.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(um.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(um.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(um.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + um.prototype.withScheme = function() { + Z10(); + var a10 = this.k; + O7(); + var b10 = new P6().a(); + b10 = new jm().K(new S6().a(), b10); + var c10 = rm2().Gh; + ig(a10, c10, b10); + a10 = erb(); + return xu(a10.l.ea, b10); + }; + um.prototype.withSchemes = function(a10) { + return this.MQ(a10); + }; + um.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(um.prototype, "schemes", { get: function() { + return this.qW(); + }, configurable: true }); + Object.defineProperty(um.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + um.prototype.$classData = r8({ yva: 0 }, false, "amf.client.model.domain.SecurityRequirement", { yva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function $l() { + this.ea = this.k = null; + } + $l.prototype = new u7(); + $l.prototype.constructor = $l; + d7 = $l.prototype; + d7.H = function() { + return "Server"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + $l.prototype.Ela.call(this, new Zl().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Yl().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Rv = function() { + return this.lF(); + }; + d7.Qea = function() { + var a10 = Z10(), b10 = B6(this.k.g, Yl().Aj), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $l) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.lF = function() { + Z10(); + var a10 = B6(this.k.g, Yl().Pf); + Z10().cb(); + return gb(a10); + }; + d7.FC = function(a10) { + var b10 = this.k, c10 = Yl().Pf; + eb(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.GS = function() { + var a10 = Z10(), b10 = B6(this.k.g, Yl().go), c10 = frb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.GC = function() { + return this.GS(); + }; + d7.Ela = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Yl().Va); + Z10().cb(); + return gb(a10); + }; + d7.wI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = w8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Yl().dc; + Zd(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Yl().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.CI = function() { + return this.Qea(); + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.BC = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = frb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Yl().go; + Zd(b10, c10, a10); + return this; + }; + d7.yI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Yl().Aj; + Zd(b10, c10, a10); + return this; + }; + d7.iM = function() { + var a10 = Z10(), b10 = B6(this.k.g, Yl().dc), c10 = w8(); + return Ak(a10, b10, c10).Ra(); + }; + $l.prototype.annotations = function() { + return this.rb(); + }; + $l.prototype.graph = function() { + return jU(this); + }; + $l.prototype.withId = function(a10) { + return this.$b(a10); + }; + $l.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + $l.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty($l.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty($l.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty($l.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty($l.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + $l.prototype.withVariable = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new Wl().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Yl().Aj; + ig(b10, c10, a10); + return I0(s8(), a10); + }; + $l.prototype.withBindings = function(a10) { + return this.BC(a10); + }; + $l.prototype.withSecurity = function(a10) { + return this.wI(a10); + }; + $l.prototype.withProtocolVersion = function(a10) { + var b10 = this.k, c10 = Yl().MZ; + eb(b10, c10, a10); + return this; + }; + $l.prototype.withProtocol = function(a10) { + var b10 = this.k, c10 = Yl().LZ; + eb(b10, c10, a10); + return this; + }; + $l.prototype.withVariables = function(a10) { + return this.yI(a10); + }; + $l.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + $l.prototype.withUrl = function(a10) { + return this.FC(a10); + }; + Object.defineProperty($l.prototype, "bindings", { get: function() { + return this.GC(); + }, configurable: true }); + Object.defineProperty($l.prototype, "security", { get: function() { + return this.iM(); + }, configurable: true }); + Object.defineProperty($l.prototype, "protocolVersion", { get: function() { + Z10(); + var a10 = B6(this.k.g, Yl().MZ); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty($l.prototype, "protocol", { get: function() { + Z10(); + var a10 = B6(this.k.g, Yl().LZ); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty($l.prototype, "variables", { get: function() { + return this.CI(); + }, configurable: true }); + Object.defineProperty($l.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty($l.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + Object.defineProperty($l.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + $l.prototype.$classData = r8({ Ava: 0 }, false, "amf.client.model.domain.Server", { Ava: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function v1() { + this.ea = this.k = null; + } + v1.prototype = new u7(); + v1.prototype.constructor = v1; + d7 = v1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + v1.prototype.Z$.call(this, new m32().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ShapeExtension"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Z$ = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof v1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.K4 = function() { + ab(); + var a10 = B6(this.k.g, Ot().ig); + return NWa(ab().cB(), a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.j4 = function(a10) { + var b10 = this.k; + ab(); + ab().Um(); + a10 = a10.k; + var c10 = Ot().zi; + Vd(b10, c10, a10); + return this; + }; + d7.p$ = function() { + ab(); + var a10 = B6(this.k.g, Ud().zi); + return fl(ab().Um(), a10); + }; + v1.prototype.annotations = function() { + return this.rb(); + }; + v1.prototype.graph = function() { + return jU(this); + }; + v1.prototype.withId = function(a10) { + return this.$b(a10); + }; + v1.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + v1.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(v1.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(v1.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(v1.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(v1.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + v1.prototype.withExtension = function(a10) { + return this.j4(a10); + }; + v1.prototype.withDefinedBy = function(a10) { + var b10 = this.k; + ab(); + ab().cB(); + a10 = a10.k; + var c10 = Ot().ig; + Vd(b10, c10, a10); + return this; + }; + Object.defineProperty(v1.prototype, "extension", { get: function() { + return this.p$(); + }, configurable: true }); + Object.defineProperty(v1.prototype, "definedBy", { get: function() { + return this.K4(); + }, configurable: true }); + v1.prototype.$classData = r8({ Bva: 0 }, false, "amf.client.model.domain.ShapeExtension", { Bva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function x8() { + this.ea = this.k = null; + } + x8.prototype = new u7(); + x8.prototype.constructor = x8; + d7 = x8.prototype; + d7.H = function() { + return "VariableValue"; + }; + d7.Xe = function() { + ab(); + var a10 = B6(this.k.g, gl().R); + ab().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof x8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function eea(a10) { + var b10 = new x8(); + b10.k = a10; + b10.ea = nv().ea; + return b10; + } + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.BI = function() { + ab(); + var a10 = B6(this.k.g, gl().vf); + return fl(ab().Um(), a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = gl().R; + eb(b10, c10, a10); + return this; + }; + x8.prototype.annotations = function() { + return this.rb(); + }; + x8.prototype.graph = function() { + return jU(this); + }; + x8.prototype.withId = function(a10) { + return this.$b(a10); + }; + x8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + x8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(x8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(x8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(x8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(x8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + x8.prototype.withValue = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = gl().vf; + Vd(b10, c10, a10); + return this; + }; + x8.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(x8.prototype, "value", { get: function() { + return this.BI(); + }, configurable: true }); + Object.defineProperty(x8.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + x8.prototype.$classData = r8({ Hva: 0 }, false, "amf.client.model.domain.VariableValue", { Hva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function y8() { + this.ea = this.k = null; + } + y8.prototype = new u7(); + y8.prototype.constructor = y8; + d7 = y8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + y8.prototype.l7a.call(this, new bO().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "VocabularyReference"; + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof y8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.P4 = function() { + i32(); + var a10 = B6(this.k.g, td().sN); + i32().cb(); + return gb(a10); + }; + d7.W3 = function(a10) { + i32(); + var b10 = this.k, c10 = td().Xp; + a10 = eb(b10, c10, a10); + return cXa(g$a2(), a10); + }; + d7.x8 = function() { + i32(); + var a10 = B6(this.k.g, td().Xp); + i32().cb(); + return gb(a10); + }; + d7.l7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + y8.prototype.annotations = function() { + return this.rb(); + }; + y8.prototype.graph = function() { + return jU(this); + }; + y8.prototype.withId = function(a10) { + return this.$b(a10); + }; + y8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + y8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(y8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(y8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(y8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(y8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + y8.prototype.withReference = function(a10) { + i32(); + var b10 = this.k, c10 = td().sN; + a10 = eb(b10, c10, a10); + return cXa(g$a2(), a10); + }; + y8.prototype.withAlias = function(a10) { + return this.W3(a10); + }; + Object.defineProperty(y8.prototype, "reference", { get: function() { + return this.P4(); + }, configurable: true }); + Object.defineProperty(y8.prototype, "alias", { get: function() { + return this.x8(); + }, configurable: true }); + y8.prototype.$classData = r8({ Iva: 0 }, false, "amf.client.model.domain.VocabularyReference", { Iva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function tn() { + this.ea = this.k = null; + } + tn.prototype = new u7(); + tn.prototype.constructor = tn; + d7 = tn.prototype; + d7.H = function() { + return "XMLSerializer"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + tn.prototype.sla.call(this, new sn().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, rn().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.sla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = rn().R; + eb(b10, c10, a10); + return this; + }; + tn.prototype.annotations = function() { + return this.rb(); + }; + tn.prototype.graph = function() { + return jU(this); + }; + tn.prototype.withId = function(a10) { + return this.$b(a10); + }; + tn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + tn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(tn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(tn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(tn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(tn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + tn.prototype.withPrefix = function(a10) { + var b10 = this.k, c10 = rn().qN; + eb(b10, c10, a10); + return this; + }; + tn.prototype.withNamespace = function(a10) { + var b10 = this.k, c10 = rn().oN; + eb(b10, c10, a10); + return this; + }; + tn.prototype.withName = function(a10) { + return this.Td(a10); + }; + tn.prototype.withWrapped = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = rn().NJ; + Bi(b10, c10, a10); + return this; + }; + tn.prototype.withAttribute = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = rn().yF; + Bi(b10, c10, a10); + return this; + }; + Object.defineProperty(tn.prototype, "prefix", { get: function() { + Z10(); + var a10 = B6(this.k.g, rn().qN); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(tn.prototype, "namespace", { get: function() { + Z10(); + var a10 = B6(this.k.g, rn().oN); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(tn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Object.defineProperty(tn.prototype, "wrapped", { get: function() { + Z10(); + var a10 = B6(this.k.g, rn().NJ); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(tn.prototype, "attribute", { get: function() { + Z10(); + var a10 = B6(this.k.g, rn().yF); + Z10().yi(); + return yL(a10); + }, configurable: true }); + tn.prototype.$classData = r8({ Lva: 0 }, false, "amf.client.model.domain.XMLSerializer", { Lva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function L1() { + be4.call(this); + this.de = null; + } + L1.prototype = new ymb(); + L1.prototype.constructor = L1; + L1.prototype.ve = function() { + return this.de; + }; + L1.prototype.jj = function(a10) { + be4.prototype.jj.call(this, a10); + this.de = "base-path-lexical"; + return this; + }; + var zdb = r8({ Xwa: 0 }, false, "amf.core.annotations.BasePathLexicalInformation", { Xwa: 1, Y6: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + L1.prototype.$classData = zdb; + function Q1() { + be4.call(this); + this.de = null; + } + Q1.prototype = new ymb(); + Q1.prototype.constructor = Q1; + Q1.prototype.ve = function() { + return this.de; + }; + Q1.prototype.jj = function(a10) { + be4.prototype.jj.call(this, a10); + this.de = "host-lexical"; + return this; + }; + var ydb = r8({ lxa: 0 }, false, "amf.core.annotations.HostLexicalInformation", { lxa: 1, Y6: 1, f: 1, Eh: 1, gf: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + Q1.prototype.$classData = ydb; + function $i() { + this.r = this.$ = this.nw = null; + } + $i.prototype = new u7(); + $i.prototype.constructor = $i; + d7 = $i.prototype; + d7.H = function() { + return "InheritanceProvenance"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof $i ? this.nw === a10.nw : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nw; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.e = function(a10) { + this.nw = a10; + this.$ = "inheritance-provenance"; + this.r = a10; + J5(K7(), new Ib().ha([a10])); + return this; + }; + d7.kM = function(a10) { + return new $i().e(a10.P(this.nw)); + }; + var Zi = r8({ nxa: 0 }, false, "amf.core.annotations.InheritanceProvenance", { nxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + $i.prototype.$classData = Zi; + function R1() { + this.r = this.$ = this.DS = null; + } + R1.prototype = new u7(); + R1.prototype.constructor = R1; + d7 = R1.prototype; + d7.H = function() { + return "InheritedShapes"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof R1) { + var b10 = this.DS; + a10 = a10.DS; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.DS; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.ts = function(a10) { + this.DS = a10; + this.$ = "inherited-shapes"; + this.r = a10.Kg(","); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.kM = function(a10) { + var b10 = this.DS, c10 = K7(); + return new R1().ts(b10.ka(a10, c10.u)); + }; + d7.$classData = r8({ pxa: 0 }, false, "amf.core.annotations.InheritedShapes", { pxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + function $u() { + this.r = this.$ = this.hP = null; + } + $u.prototype = new u7(); + $u.prototype.constructor = $u; + d7 = $u.prototype; + d7.H = function() { + return "ResolvedLinkAnnotation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof $u ? this.hP === a10.hP : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.hP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.e = function(a10) { + this.hP = a10; + this.$ = "resolved-link"; + this.r = a10; + J5(K7(), new Ib().ha([a10])); + return this; + }; + d7.kM = function(a10) { + return new $u().e(a10.P(this.hP)); + }; + var XZa = r8({ Bxa: 0 }, false, "amf.core.annotations.ResolvedLinkAnnotation", { Bxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + $u.prototype.$classData = XZa; + function av() { + this.r = this.$ = this.iP = null; + } + av.prototype = new u7(); + av.prototype.constructor = av; + d7 = av.prototype; + d7.H = function() { + return "ResolvedLinkTargetAnnotation"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof av ? this.iP === a10.iP : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.iP; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.e = function(a10) { + this.iP = a10; + this.$ = "resolved-link-target"; + this.r = a10; + J5(K7(), new Ib().ha([a10])); + return this; + }; + d7.kM = function(a10) { + return new av().e(a10.P(this.iP)); + }; + var WZa = r8({ Dxa: 0 }, false, "amf.core.annotations.ResolvedLinkTargetAnnotation", { Dxa: 1, f: 1, Eh: 1, gf: 1, Vm: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + av.prototype.$classData = WZa; + function grb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.g = this.mc = this.qa = this.ba = null; + } + grb.prototype = new u7(); + grb.prototype.constructor = grb; + d7 = grb.prototype; + d7.a = function() { + hrb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + ehb(this); + ii(); + var a10 = F6().Zd; + a10 = [G5(a10, "DocumentExtension")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Bq().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().hg, "Document Extension", "A Document that extends a target document, overwriting part of the information or overlaying additional information.", H10()); + return this; + }; + d7.uD = function() { + }; + d7.nc = function() { + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Ni = function() { + return this.mc; + }; + d7.y_ = function(a10) { + this.mc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new bg().K(new S6().a(), a10); + }; + d7.z_ = function(a10) { + this.g = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ Mya: 0 }, false, "amf.core.metamodel.document.ExtensionLikeModel$", { Mya: 1, f: 1, DY: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1 }); + var hrb = void 0; + function wB() { + hrb || (hrb = new grb().a()); + return hrb; + } + function irb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.qa = this.ba = this.Ys = null; + this.xa = 0; + } + irb.prototype = new u7(); + irb.prototype.constructor = irb; + d7 = irb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + jrb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + var a10 = yc(), b10 = F6().Eb; + this.Ys = rb(new sb(), a10, G5(b10, "fixPoint"), tb(new ub(), vb().Eb, "fixpoint", "Link to the base of the recursion for a recursive shape", H10())); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "RecursiveShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = qf().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().Eb, + "Recursive Shape", + "Recursion on a Shape structure, used when expanding a shape and finding the canonical representation of that shape.", + H10() + ); + return this; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Ys], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = qf().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + var a10 = new S6().a(); + O7(); + var b10 = new P6().a(); + return new zi().K(a10, b10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ eza: 0 }, false, "amf.core.metamodel.domain.RecursiveShapeModel$", { eza: 1, f: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1 }); + var jrb = void 0; + function Ci() { + jrb || (jrb = new irb().a()); + return jrb; + } + function krb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.qa = this.ba = this.g = null; + this.xa = 0; + } + krb.prototype = new u7(); + krb.prototype.constructor = krb; + d7 = krb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + lrb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + var a10 = db().g; + ii(); + for (var b10 = [this.R, this.Zc, this.Va, this.Mh, this.ch, this.xd, this.$j, this.Bi, this.fi, this.ki, this.li, this.Vo, this.Gn, this.Jn, this.Dn, this.cl, this.Zm, this.uh], c10 = -1 + (b10.length | 0) | 0, e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + b10 = e10; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Ua; + a10 = G5(a10, "Shape"); + b10 = F6().Eb; + a10 = [a10, G5(b10, "Shape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + a10 = vb().Eb; + b10 = K7(); + c10 = F6().Ua; + this.qa = tb(new ub(), a10, "Shape", "Base class for all shapes. Shapes are Domain Entities that define constraints over parts of a data graph.\nThey can be used to define and enforce schemas for the data graph information through SHACL.\nShapes can be recursive and inherit from other shapes.", J5(b10, new Ib().ha([ic(G5(c10, "Shape"))]))); + return this; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + function ny() { + var a10 = qf(); + if (0 === (1 & a10.xa) << 24 >> 24 && 0 === (1 & a10.xa) << 24 >> 24) { + var b10 = new xc().yd(Qi()); + var c10 = F6().Eb; + b10 = rb(new sb(), b10, G5(c10, "customShapePropertyDefinitions"), tb(new ub(), vb().Eb, "custom shape property definitions", "Custom constraint definitions added over a data shape", H10())); + a10.tx = b10; + a10.xa = (1 | a10.xa) << 24 >> 24; + } + return a10.tx; + } + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("Shape is abstract and it cannot be instantiated by default")); + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + function nC() { + var a10 = qf(); + if (0 === (2 & a10.xa) << 24 >> 24 && 0 === (2 & a10.xa) << 24 >> 24) { + var b10 = new xc().yd(Ot()); + var c10 = F6().Eb; + b10 = rb(new sb(), b10, G5(c10, "customShapeProperties"), tb(new ub(), vb().Eb, "custom shape properties", "Custom constraint values for a data shape", H10())); + a10.sx = b10; + a10.xa = (2 | a10.xa) << 24 >> 24; + } + return a10.sx; + } + d7.lc = function() { + this.Vq(); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ gza: 0 }, false, "amf.core.metamodel.domain.ShapeModel$", { gza: 1, f: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1 }); + var lrb = void 0; + function qf() { + lrb || (lrb = new krb().a()); + return lrb; + } + function mrb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.qa = this.ba = this.cv = this.PF = this.ji = this.Vf = this.Uf = null; + this.xa = 0; + } + mrb.prototype = new u7(); + mrb.prototype.constructor = mrb; + d7 = mrb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + nrb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + var a10 = yc(), b10 = F6().Ua; + this.Uf = rb(new sb(), a10, G5(b10, "path"), tb(new ub(), ci().Ua, "path", "Path to the constrained property", H10())); + a10 = qf(); + b10 = F6().Eb; + this.Vf = rb(new sb(), a10, G5(b10, "range"), tb(new ub(), vb().Eb, "range", "Range property constraint", H10())); + a10 = Ac(); + b10 = F6().Ua; + this.ji = rb(new sb(), a10, G5(b10, "minCount"), tb(new ub(), ci().Ua, "min. count", "Minimum count property constraint", H10())); + a10 = Ac(); + b10 = F6().Ua; + this.PF = rb(new sb(), a10, G5(b10, "maxCount"), tb( + new ub(), + ci().Ua, + "max. count", + "Maximum count property constraint", + H10() + )); + a10 = qb(); + b10 = F6().Eb; + this.cv = rb(new sb(), a10, G5(b10, "patternName"), tb(new ub(), vb().Eb, "pattern name", "Patterned property constraint", H10())); + ii(); + a10 = F6().Ua; + a10 = [G5(a10, "PropertyShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = qf().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Property Shape", "Constraint over a property in a data shape.", H10()); + return this; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Uf, this.Vf, this.ji, this.PF, this.cv], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = qf().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Vk().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ nza: 0 }, false, "amf.core.metamodel.domain.extensions.PropertyShapeModel$", { nza: 1, f: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1 }); + var nrb = void 0; + function Qi() { + nrb || (nrb = new mrb().a()); + return nrb; + } + function orb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.la = this.Aj = this.SC = this.qa = this.ba = null; + this.xa = 0; + } + orb.prototype = new u7(); + orb.prototype.constructor = orb; + d7 = orb.prototype; + d7.a = function() { + prb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + ihb(this); + var a10 = F6().Zd; + a10 = G5(a10, "AbstractDeclaration"); + var b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().hg, "Abstract Declaration", "Graph template that can be used to declare a re-usable graph structure that can be applied to different domain elements\nin order to re-use common semantics. Similar to a Lisp macro or a C++ template.\nIt can be extended by any domain element adding bindings for the variables in the declaration.", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.J8 = function(a10) { + this.la = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return hhb(this); + }; + d7.H8 = function(a10) { + this.SC = a10; + }; + d7.Vq = function() { + throw mb(E6(), new nb().e("AbstractDeclarationModel is abstract and cannot be instantiated")); + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + this.Vq(); + }; + d7.Kb = function() { + return this.ba; + }; + d7.I8 = function(a10) { + this.Aj = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ pza: 0 }, false, "amf.core.metamodel.domain.templates.AbstractDeclarationModel$", { pza: 1, f: 1, Cga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1, sk: 1 }); + var prb = void 0; + function kP() { + prb || (prb = new orb().a()); + return prb; + } + function Td() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Td.prototype = new u7(); + Td.prototype.constructor = Td; + d7 = Td.prototype; + d7.H = function() { + return "DomainExtension"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return HOa(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Td ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Ud(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/extension"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + function RBa(a10) { + a10 = B6(a10.g, Ud().ko); + return !oN(a10); + } + function HOa(a10, b10) { + if (Vb().Ia(a10.j).b()) + var c10 = true; + else + c10 = a10.j, c10 = 0 <= (c10.length | 0) && "null/" === c10.substring(0, 5); + c10 && Ai(a10, b10); + return a10; + } + d7.Ena = function() { + return B6(B6(this.g, Ud().ig).g, Sk().Jc); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ dAa: 0 }, false, "amf.core.model.domain.extensions.DomainExtension", { dAa: 1, f: 1, eAa: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function m32() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + m32.prototype = new u7(); + m32.prototype.constructor = m32; + d7 = m32.prototype; + d7.H = function() { + return "ShapeExtension"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof m32 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Ot(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = Vb().Ia(B6(this.g, Ot().ig)); + a10 = a10.b() ? y7() : B6(a10.c().aa, qf().R).A; + a10 = a10.b() ? "default-extension" : a10.c(); + a10 = new je4().e(a10); + return "/shape-extension/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Ena = function() { + return B6(B6(this.g, Ot().ig).aa, Qi().Vf); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.j = "http://a.ml/vocabularies#document/shape_extension"; + return this; + }; + d7.$classData = r8({ gAa: 0 }, false, "amf.core.model.domain.extensions.ShapeExtension", { gAa: 1, f: 1, eAa: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function f42() { + this.Lz = null; + this.lj = 0; + this.$W = false; + } + f42.prototype = new u7(); + f42.prototype.constructor = f42; + d7 = f42.prototype; + d7.Ar = function(a10, b10) { + var c10 = dc().hS; + b10 = b10.tt; + var e10 = y7(); + nM(this, c10, "", e10, b10, a10); + this.$W = true; + }; + d7.H = function() { + return "WarningOnlyHandler"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof f42 ? this.Lz === a10.Lz : false; + }; + d7.yB = function(a10, b10) { + var c10 = dc().hS, e10 = Hb(a10.mv); + a10 = ZAa(this, a10); + var f10 = y7(); + nM(this, c10, "", f10, e10, a10.da); + this.$W = true; + return b10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lz; + default: + throw new U6().e("" + a10); + } + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + a10 = a10.j; + var h10 = Yb().dh; + EU(this, a10, b10, c10, e10, f10, h10, g10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + EU(this, a10, b10, c10, e10, f10, g10, h10); + }; + d7.z = function() { + return X5(this); + }; + d7.e = function(a10) { + this.Lz = a10; + this.lj = jga().bT; + this.$W = false; + return this; + }; + d7.$classData = r8({ jBa: 0 }, false, "amf.core.parser.WarningOnlyHandler", { jBa: 1, f: 1, a7: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1 }); + function qw() { + Aq.call(this); + this.S_ = this.UJ = null; + } + qw.prototype = new Jmb(); + qw.prototype.constructor = qw; + function $ja(a10, b10) { + var c10 = new Mq().a(), e10 = Nq(), f10 = y7(), g10 = Rb(Ut(), H10()), h10 = y7(); + a10.UJ = g10; + a10.S_ = h10; + Aq.prototype.zo.call(a10, "", b10, c10, e10, f10); + return a10; + } + qw.prototype.$classData = r8({ xEa: 0 }, false, "amf.plugins.document.graph.parser.GraphParserContext", { xEa: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1 }); + function qrb() { + this.WB = 0; + this.To = this.Ig = this.kq = null; + this.oo = false; + this.qi = null; + } + qrb.prototype = new RL(); + qrb.prototype.constructor = qrb; + d7 = qrb.prototype; + d7.WW = function(a10, b10, c10) { + if (Ubb(a10)) { + var e10 = new lO().Hb(Np(Op(), a10)).ye(a10), f10 = hp(), g10 = B6(a10.g, qO().Ot), h10 = w6(/* @__PURE__ */ function() { + return function(l10) { + var m10 = Ec().kq; + l10 = l10.A; + return RMa(m10, l10.b() ? null : l10.c(), (Ec(), fp())); + }; + }(this)), k10 = K7(); + g10 = g10.ka(h10, k10.u); + h10 = K7(); + return Bfa(f10, g10, h10.u).Yg(w6(/* @__PURE__ */ function(l10) { + return function(m10) { + var p10 = w6(/* @__PURE__ */ function() { + return function(v10) { + return rrb(Ec(), v10); + }; + }(l10)), t10 = K7(); + return m10.ka(p10, t10.u); + }; + }(this)), ml()).Pq(w6(/* @__PURE__ */ function(l10, m10, p10, t10, v10) { + return function(A10) { + A10 = srb(Ec(), p10, A10); + var D10 = jja(new lv().a()); + bp(); + var C10 = Rb(Gb().ab, H10()); + return gp(bp()).aea( + m10, + A10, + C10, + D10 + ).Yg(w6(/* @__PURE__ */ function(I10, L10, Y10, ia) { + return function(pa) { + var La = pa.aM(); + pa = /* @__PURE__ */ function(id, yd, zd) { + return function(rd) { + Ec(); + var sd = ok2().tD; + return Waa(yd, rd, sd, zd).ua(); + }; + }(I10, L10, Y10); + if (ii().u === ii().u) + if (La === H10()) + pa = H10(); + else { + for (var ob = La, zb = new Uj().eq(false), Zb = new qd().d(null), Cc = new qd().d(null); ob !== H10(); ) { + var vc = ob.ga(); + pa(vc).Hd().U(w6(/* @__PURE__ */ function(id, yd, zd, rd) { + return function(sd) { + yd.oa ? (sd = ji(sd, H10()), rd.oa.Nf = sd, rd.oa = sd) : (zd.oa = ji(sd, H10()), rd.oa = zd.oa, yd.oa = true); + }; + }(La, zb, Zb, Cc))); + ob = ob.ta(); + } + pa = zb.oa ? Zb.oa : H10(); + } + else { + ii(); + for (ob = new Lf().a(); !La.b(); ) + zb = La.ga(), zb = pa(zb).Hd(), ws(ob, zb), La = La.ta(); + pa = ob.ua(); + } + a: { + for (La = pa; !La.b(); ) { + if (La.ga().zm === Yb().qb) { + La = true; + break a; + } + La = La.ta(); + } + La = false; + } + return aq(new bq(), !La, L10.j, ia, pa); + }; + }(l10, t10, p10, v10)), ml()); + }; + }(this, e10, c10, a10, b10)), ml()); + } + throw mb(E6(), new nb().e("Cannot resolve base unit of type " + la(a10))); + }; + d7.a = function() { + rq.prototype.a.call(this); + trb = this; + this.qi = nv().ea; + this.kq = new OMa().a(); + this.Ig = Eia().$; + var a10 = K7(), b10 = [Eia().$]; + this.To = J5(a10, new Ib().ha(b10)); + this.oo = true; + return this; + }; + d7.kna = function() { + return new z7().d(this.kq); + }; + function OXa(a10, b10) { + a10 = b10.$g.z9(); + a10.b() ? (Ec(), b10 = b10.$g, b10 instanceof Dc ? (b10 = jc(kc(b10.Xd.Fd), qc()), b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.sb)), b10 = b10.b() ? H10() : b10.c(), b10 = Jc(b10, new obb()), b10.b() ? b10 = y7() : (b10 = Kc(b10.c().i), b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.va)))) : b10 = y7(), b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d("%" + b10))) : b10 = a10; + if (b10.b()) + return y7(); + b10 = b10.c(); + return new z7().d(iF(fF(), b10)); + } + d7.hI = function(a10, b10) { + return a10 instanceof ad ? new z7().d(Pbb(new Nbb().TG(a10))) : a10 instanceof zO ? new z7().d(qbb(new pbb().jU(a10))) : a10 instanceof AO ? new z7().d(ybb(new xbb().iaa(a10))) : Ubb(a10) ? new z7().d(Gbb(Hbb(new Cbb(), a10, ZMa(this.kq, a10).c(), b10))) : y7(); + }; + function rrb(a10, b10) { + var c10 = YU(b10), e10 = a10.kq.Bf.Ja(c10); + if (e10 instanceof z7) + return e10.i; + b10 = new mO().Hb(Np(Op(), b10)).ye(b10); + b10 = xEa(new CO().jU(b10)); + a10.kq.Bf = a10.kq.Bf.cc(new R6().M(c10, b10)); + return b10; + } + d7.NE = function(a10) { + var b10 = new ZN(); + b10.Coa = this.kq; + b10.Bc = a10; + b10.Lq = new LN().a(); + return b10; + }; + d7.FD = function(a10) { + return a10 instanceof ad ? true : a10 instanceof zO ? true : a10 instanceof AO ? true : Ubb(a10) ? ZMa(this.kq, a10).na() : false; + }; + d7.tA = function(a10, b10) { + var c10 = OXa(0, a10), e10 = false, f10 = null; + if (c10 instanceof z7) { + e10 = true; + f10 = c10; + var g10 = f10.i; + if (zw().u8 === g10) + return new z7().d(vDa(new $N(), a10, new urb().eU(b10, y7())).lca()); + } + if (e10 && (g10 = f10.i, zw().w5 === g10)) + return new z7().d(TNa(SNa(new TV(), a10, vrb(b10, a10)))); + if (e10 && (g10 = f10.i, zw().u5 === g10)) + return new z7().d(SNa(new TV(), a10, new z8().eU(b10, y7())).e2()); + if (e10 && (e10 = f10.i, zw().v5 === e10)) + return b10 = vrb(b10, a10), a10 = SNa(new TV(), a10, new z8().eU(b10, y7())).lca(), a10 instanceof zO && $Ma(this.kq, a10), new z7().d(a10); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = Mc(ua(), c10, "\\|"), c10 = new z7().d(zj(new Pc().fd(c10)))); + c10.b() ? e10 = y7() : (e10 = c10.c(), e10 = Ec().kq.X.Ja(e10)); + e10.b() && (Ec(), e10 = oba(a10)); + if (e10 instanceof z7) + a10 = wrb(this, a10, b10, e10.i, c10); + else + throw mb(E6(), new nb().e("Unknown Dialect for document: " + a10.da)); + return a10; + }; + d7.dy = function() { + var a10 = K7(), b10 = [bd(), dd(), td(), fO(), eO(), Sbb(), Gc(), wj(), Ae4(), $d(), Hc(), UV(), GO(), Ehb(), Bhb(), qO(), xrb(), Fbb(), UDa()]; + return J5(a10, new Ib().ha(b10)); + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha("application/aml+json application/aml+yaml application/raml application/raml+json application/raml+yaml text/yaml text/x-yaml application/yaml application/x-yaml application/json".split(" "))); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10) { + return a10 instanceof wO ? new iO().Hb(b10).ye(a10) : a10 instanceof zO ? new mO().Hb(b10).ye(a10) : a10 instanceof pO ? new lO().Hb(b10).ye(a10) : a10; + }; + d7.gi = function() { + return this.Ig; + }; + function srb(a10, b10, c10) { + return c10.ne(b10, Uc(/* @__PURE__ */ function() { + return function(e10, f10) { + return Gja(e10, f10); + }; + }(a10))); + } + d7.eO = function() { + var a10 = new Fc().Vd(this.kq.X), b10 = null; + b10 = Rb(Gb().ab, H10()); + for (a10 = a10.Sb.Ye(); a10.Ya(); ) { + var c10 = a10.$a(); + b10 = -1 === (zEa(c10).indexOf("Validation Profile") | 0) ? b10.Wh(zEa(c10), oq(/* @__PURE__ */ function(e10, f10) { + return function() { + return rrb(Ec(), f10); + }; + }(this, c10))) : b10; + } + return b10; + }; + d7.wr = function() { + return J5(K7(), H10()); + }; + d7.nB = function(a10) { + var b10; + if (b10 = a10.$g instanceof Dc) + PXa || (PXa = new MXa().a()), b10 = NXa(a10); + return b10; + }; + d7.fp = function() { + return nq(hp(), oq(/* @__PURE__ */ function() { + return function() { + return Ec(); + }; + }(this)), ml()); + }; + function wrb(a10, b10, c10, e10, f10) { + var g10 = a10.kq; + a10 = /* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + var t10 = false, v10 = null; + if (k10 instanceof z7) { + t10 = true; + v10 = k10; + var A10 = v10.i; + if (yrb(p10, A10)) { + v10 = A10.indexOf("/") | 0; + v10 = A10.substring(1, v10); + p10 = U1a(new s32(), l10, zrb(p10, m10)); + A10 = Od(O7(), p10.X); + A10 = new y32().K(new S6().a(), A10); + t10 = p10.kf.da; + var D10 = Bq().uc; + A10 = eb(A10, D10, t10); + A10 = Rd(A10, p10.kf.da); + t10 = p10.m.Qk.j; + D10 = qO().ig; + A10 = eb(A10, D10, t10); + t10 = Fbb().ER; + v10 = eb(A10, t10, v10); + I1a(H1a(v10, p10.X, p10.kf.Q, p10.m), p10.kf.da); + tc(p10.m.rd.Vn) && (A10 = new Fc().Vd(p10.m.rd.Vn).Sb.Ye().Dd(), t10 = Bd().vh, Zd(v10, t10, A10)); + A10 = D1a(p10, v10); + A10 instanceof z7 ? (A10 = A10.i, p10.m.Ip.jm(p10.kf.da + "#/", A10), p10 = Jk().nb, p10 = new z7().d(Vd(v10, p10, A10))) : p10 = y7(); + return p10; + } + } + if (t10 && Arb(p10, v10.i)) + p10 = U1a(new s32(), l10, zrb(p10, m10)), v10 = Od(O7(), p10.X), v10 = new x32().K(new S6().a(), v10), A10 = p10.kf.da, t10 = Bq().uc, v10 = eb(v10, t10, A10), v10 = Rd(v10, p10.kf.da), A10 = p10.m.Qk.j, t10 = qO().ig, v10 = eb(v10, t10, A10), v1a(p10, "library"), A10 = H1a(v10, p10.X, p10.kf.Q, p10.m), t10 = Lc(v10), A10 = I1a(A10, t10.b() ? v10.j : t10.c()), tc(p10.m.rd.Vn) && (t10 = new Fc().Vd(p10.m.rd.Vn).Sb.Ye().Dd(), D10 = Bd().vh, Zd(v10, D10, t10)), p10.m.rd.et().Da() && (t10 = p10.m.rd.et(), D10 = Af().Ic, Bf(v10, D10, t10)), A10.ow().Da() && (A10 = A10.ow(), t10 = Gk().xc, Bf(v10, t10, A10)), Fb(p10.m.ni), p10 = new z7().d(v10); + else { + if (A10 = t10) + v10 = v10.i, A10 = Brb(p10) === iF(fF(), v10); + A10 ? (v10 = new s32(), p10 = zrb(p10, m10), p10.B1 = true, p10 = U1a(v10, l10, p10), v10 = G1a(p10), v10 instanceof z7 ? (v10 = v10.i, A10 = new wO().K(v10.g, v10.x), Rd(A10, v10.j), p10 = new z7().d(T1a(p10, A10))) : p10 = y7()) : p10 = G1a(U1a(new s32(), l10, zrb(p10, m10))); + } + return p10; + }; + }(a10, f10, b10, c10); + if (g10.Hm.Ha(YU(e10))) + return a10(e10); + e10 = XMa(g10, e10); + return a10(e10); + } + d7.ry = function() { + QXa || (QXa = new k22().a()); + var a10 = new R6().M("aliases-location", QXa); + RXa || (RXa = new m22().a()); + var b10 = new R6().M("custom-id", RXa); + TXa || (TXa = new q22().a()); + var c10 = new R6().M("ref-include", TXa); + SXa || (SXa = new o22().a()); + a10 = [a10, b10, c10, new R6().M("json-pointer-ref", SXa)]; + b10 = UA(new VA(), nu()); + c10 = 0; + for (var e10 = a10.length | 0; c10 < e10; ) + WA(b10, a10[c10]), c10 = 1 + c10 | 0; + return b10.eb; + }; + d7.gB = function() { + return this.oo; + }; + function vrb(a10, b10) { + a10 = new Aq().zo(b10.da, b10.Q, new Mq().a(), a10.lj, y7()); + return new z8().eU(a10, y7()); + } + d7.$classData = r8({ zEa: 0 }, false, "amf.plugins.document.vocabularies.AMLPlugin$", { zEa: 1, bD: 1, f: 1, Zr: 1, LEa: 1, HEa: 1, MR: 1, dD: 1, ib: 1, JEa: 1 }); + var trb = void 0; + function Ec() { + trb || (trb = new qrb().a()); + return trb; + } + function rbb() { + this.Qc = this.gt = this.Xb = this.p = this.pb = null; + } + rbb.prototype = new u7(); + rbb.prototype.constructor = rbb; + d7 = rbb.prototype; + d7.H = function() { + return "DocumentsModelEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rbb) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "documents"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + if (Vb().Ia(B6(this.gt.g, Hc().De)).na()) { + var h10 = this.Qc, k10 = K7(), l10 = [new Crb().eE(this.pb, this.p, this.Xb)]; + k10 = J5(k10, new Ib().ha(l10)); + l10 = K7(); + this.Qc = h10.ia(k10, l10.u); + } + B6(this.gt.g, Hc().My).Da() && (h10 = this.Qc, k10 = K7(), l10 = [new Drb().eE(this.pb, this.p, this.Xb)], k10 = J5(k10, new Ib().ha(l10)), l10 = K7(), this.Qc = h10.ia(k10, l10.u)); + Vb().Ia(B6(this.gt.g, Hc().Fx)).na() && (h10 = this.Qc, k10 = K7(), l10 = [new Erb().eE(this.pb, this.p, this.Xb)], k10 = J5(k10, new Ib().ha(l10)), l10 = K7(), this.Qc = h10.ia(k10, l10.u)); + h10 = this.Qc; + k10 = K7(); + l10 = [new Frb().eE(this.pb, this.p, Rb(Gb().ab, H10()))]; + k10 = J5(k10, new Ib().ha(l10)); + l10 = K7(); + this.Qc = h10.ia(k10, l10.u); + jr(wr(), this.p.zb(this.Qc), g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + l10 = g10.n.length; + k10 = h10 = 0; + var m10 = b10.length | 0; + l10 = m10 < l10 ? m10 : l10; + m10 = g10.n.length; + for (l10 = l10 < m10 ? l10 : m10; h10 < l10; ) + g10.n[k10] = b10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.eE = function(a10, b10, c10) { + this.pb = a10; + this.p = b10; + this.Xb = c10; + this.gt = B6(a10.g, Gc().Pj); + this.Qc = J5(K7(), H10()); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Vb().Ia(B6(this.gt.g, Hc().De)); + a10.b() ? a10 = y7() : (a10.c(), a10 = hd(B6(this.gt.g, Hc().De).g, GO().Vs), a10.b() ? a10 = y7() : (a10 = Ab(a10.c().r.x, q5(jd)), a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)))); + if (a10.b()) + a10 = y7(); + else { + a10 = a10.c(); + var b10 = K7(); + a10 = new z7().d(J5(b10, new Ib().ha([a10]))); + } + a10 = a10.b() ? H10() : a10.c(); + b10 = Vb().Ia(B6(this.gt.g, Hc().De)); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(B6(b10.g, GO().Mt))); + b10 = b10.b() ? H10() : b10.c(); + var c10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return Ab(h10.x, q5(jd)).ua(); + }; + }(this)), e10 = K7(); + b10 = b10.bd(c10, e10.u); + c10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.yc.$d; + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = Vb().Ia(B6(this.gt.g, Hc().Fx)); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(B6(c10.g, GO().Mt))); + c10 = c10.b() ? H10() : c10.c(); + e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = Ab(h10.x, q5(jd)); + if (h10.b()) + return y7(); + h10 = h10.c(); + return new z7().d(h10.yc.$d); + }; + }(this)); + var f10 = K7(); + c10 = c10.ka(e10, f10.u); + e10 = new sbb(); + f10 = K7(); + c10 = c10.ec(e10, f10.u); + e10 = B6(this.gt.g, Hc().My); + f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = Ab(h10.x, q5(jd)); + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(h10.yc.$d)); + return h10.ua(); + }; + }(this)); + var g10 = K7(); + e10 = e10.bd(f10, g10.u); + f10 = K7(); + a10 = a10.ia(b10, f10.u); + b10 = K7(); + a10 = a10.ia(e10, b10.u); + b10 = K7(); + a10 = a10.ia( + c10, + b10.u + ); + TC(); + b10 = Gb().si; + a10 = a10.nk(UC(b10)).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ gFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DocumentsModelEmitter", { gFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Frb() { + this.b3 = this.Qc = this.Ui = this.Xb = this.p = this.pb = null; + } + Frb.prototype = new u7(); + Frb.prototype.constructor = Frb; + d7 = Frb.prototype; + d7.H = function() { + return "DocumentsModelOptionsEmitter"; + }; + d7.E = function() { + return 3; + }; + function Grb(a10) { + var b10 = K7(), c10 = B6(a10.Ui.g, Hc().cz).A, e10 = B6(a10.Ui.g, Hc().Iy).A; + c10 = [c10, e10, B6(a10.Ui.g, Hc().Py).A]; + return J5(b10, new Ib().ha(c10)).ps(w6(/* @__PURE__ */ function() { + return function(f10) { + return f10.ua(); + }; + }(a10))).Da(); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Frb) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (this.b3.Da()) { + T6(); + var b10 = mh(T6(), "options"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + jr(wr(), this.b3, g10); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + } + }; + d7.eE = function(a10, b10, c10) { + this.pb = a10; + this.p = b10; + this.Xb = c10; + this.Ui = B6(a10.g, Gc().Pj); + this.Qc = J5(K7(), H10()); + if (Grb(this)) { + a10 = B6(this.Ui.g, Hc().cz).A; + a10 = new R6().M("selfEncoded", a10); + c10 = B6(this.Ui.g, Hc().Iy).A; + c10 = new R6().M("declarationsPath", c10); + var e10 = B6(this.Ui.g, Hc().Py).A; + e10 = new R6().M("keyProperty", e10); + var f10 = B6(this.Ui.g, Hc().dS).A; + a10 = [a10, c10, e10, new R6().M("referenceStyle", f10)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + a10 = c10.eb; + c10 = Q5().ti; + c10 = new R6().M("selfEncoded", c10); + e10 = Q5().ti; + e10 = new R6().M("keyProperty", e10); + f10 = Q5().Na; + f10 = new R6().M("declarationsPath", f10); + var g10 = Q5().Na; + c10 = [c10, e10, f10, new R6().M("referenceStyle", g10)]; + e10 = UA(new VA(), nu()); + f10 = 0; + for (g10 = c10.length | 0; f10 < g10; ) + WA(e10, c10[f10]), f10 = 1 + f10 | 0; + c10 = e10.eb; + e10 = B6(this.Ui.g, Hc().cz).x; + e10 = new R6().M("selfEncoded", e10); + f10 = B6(this.Ui.g, Hc().Iy).x; + f10 = new R6().M("declarationsPath", f10); + g10 = B6(this.Ui.g, Hc().Py).x; + g10 = new R6().M("keyProperty", g10); + var h10 = B6(this.Ui.g, Hc().dS).x; + e10 = [e10, f10, g10, new R6().M("referenceStyle", h10)]; + f10 = UA(new VA(), nu()); + g10 = 0; + for (h10 = e10.length | 0; g10 < h10; ) + WA(f10, e10[g10]), g10 = 1 + g10 | 0; + c10 = w6(/* @__PURE__ */ function(k10, l10, m10) { + return function(p10) { + if (null !== p10) { + var t10 = p10.ma(); + p10 = p10.ya(); + if (p10.b()) + return y7(); + p10 = p10.c(); + var v10 = l10.P(t10); + wr(); + var A10 = m10.P(t10); + A10 = kr(0, A10, q5(jd)); + return new z7().d(cx(new dx(), t10, ka(p10), v10, A10)); + } + throw new x7().d(p10); + }; + }(this, c10, f10.eb)); + e10 = Id().u; + a10 = Jd(a10, c10, e10); + c10 = new tbb(); + e10 = Id(); + a10 = a10.ec(c10, e10.u).ke(); + b10 = b10.zb(a10); + } else + b10 = H10(); + this.b3 = b10; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.b3.kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.Fg)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ iFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.DocumentsModelOptionsEmitter", { iFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hrb() { + this.Xb = this.p = this.vg = this.pb = null; + } + Hrb.prototype = new u7(); + Hrb.prototype.constructor = Hrb; + d7 = Hrb.prototype; + d7.H = function() { + return "FragmentMappingEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Hrb) { + var b10 = this.pb, c10 = a10.pb; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.vg, c10 = a10.vg, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.vg; + case 2: + return this.p; + case 3: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.vg.g, GO().Vs).A; + b10 = b10.b() ? null : b10.c(); + b10 = Bw(this, b10); + if (b10 instanceof z7) { + b10 = b10.i; + var c10 = B6(this.vg.g, GO().vx).A; + cx(new dx(), c10.b() ? null : c10.c(), b10, Q5().Na, ld()).Qa(a10); + } else + b10 = B6(this.vg.g, GO().vx).A, b10 = b10.b() ? null : b10.c(), c10 = B6(this.vg.g, GO().Vs).A, cx(new dx(), b10, c10.b() ? null : c10.c(), Q5().Na, ld()).Qa(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.vg.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ kFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.FragmentMappingEmitter", { kFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Drb() { + this.Qc = this.Xb = this.p = this.pb = null; + } + Drb.prototype = new u7(); + Drb.prototype.constructor = Drb; + d7 = Drb.prototype; + d7.H = function() { + return "FragmentsDocumentModelEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Drb) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = mh(T6(), "fragments"), c10 = new PA().e(a10.ca), e10 = c10.s, f10 = c10.ca, g10 = new rr().e(f10); + T6(); + var h10 = mh(T6(), "encodes"), k10 = new PA().e(g10.ca), l10 = k10.s, m10 = k10.ca, p10 = new rr().e(m10); + this.p.zb(this.Qc).U(w6(/* @__PURE__ */ function(C10, I10) { + return function(L10) { + L10.Qa(I10); + }; + }(this, p10))); + pr(l10, mr(T6(), tr(ur(), p10.s, m10), Q5().sa)); + l10 = k10.s; + h10 = [h10]; + if (0 > l10.w) + throw new U6().e("0"); + p10 = h10.length | 0; + m10 = l10.w + p10 | 0; + uD(l10, m10); + Ba(l10.L, 0, l10.L, p10, l10.w); + p10 = l10.L; + var t10 = p10.n.length, v10 = 0, A10 = 0, D10 = h10.length | 0; + t10 = D10 < t10 ? D10 : t10; + D10 = p10.n.length; + for (t10 = t10 < D10 ? t10 : D10; v10 < t10; ) + p10.n[A10] = h10[v10], v10 = 1 + v10 | 0, A10 = 1 + A10 | 0; + l10.w = m10; + pr( + g10.s, + vD(wD(), k10.s) + ); + pr(e10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + e10 = c10.s; + b10 = [b10]; + if (0 > e10.w) + throw new U6().e("0"); + g10 = b10.length | 0; + f10 = e10.w + g10 | 0; + uD(e10, f10); + Ba(e10.L, 0, e10.L, g10, e10.w); + g10 = e10.L; + h10 = g10.n.length; + l10 = k10 = 0; + m10 = b10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = b10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + e10.w = f10; + pr(a10.s, vD(wD(), c10.s)); + }; + d7.eE = function(a10, b10, c10) { + this.pb = a10; + this.p = b10; + this.Xb = c10; + a10 = B6(B6(a10.g, Gc().Pj).g, Hc().My); + b10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.p, h10 = e10.Xb, k10 = new Hrb(); + k10.pb = e10.pb; + k10.vg = f10; + k10.p = g10; + k10.Xb = h10; + return k10; + }; + }(this)); + c10 = K7(); + this.Qc = a10.ka(b10, c10.u); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = this.p.zb(this.Qc).kc(); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.La())); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ lFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.FragmentsDocumentModelEmitter", { lFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Erb() { + this.Qc = this.Ui = this.Xb = this.p = this.pb = null; + } + Erb.prototype = new u7(); + Erb.prototype.constructor = Erb; + d7 = Erb.prototype; + d7.H = function() { + return "LibraryDocumentModelEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Erb) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Ui.g, GO().Mt), c10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = B6(t10.g, UV().$u).A; + v10 = v10.b() ? null : v10.c(); + v10 = Bw(p10, v10); + if (v10 instanceof z7) + return v10 = v10.i, t10 = B6(t10.g, UV().R).A, cx(new dx(), t10.b() ? null : t10.c(), v10, Q5().Na, ld()); + v10 = B6(t10.g, UV().R).A; + v10 = v10.b() ? null : v10.c(); + t10 = B6(t10.g, UV().$u).A; + return cx(new dx(), v10, t10.b() ? null : t10.c(), Q5().Na, ld()); + }; + }(this)), e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.p.zb(b10); + b10 = this.Qc; + c10 = J5(K7(), new Ib().ha([dNa(c10)])); + e10 = K7(); + this.Qc = b10.ia(c10, e10.u); + T6(); + e10 = mh(T6(), "library"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var f10 = b10.ca, g10 = new rr().e(f10); + jr(wr(), this.p.zb(this.Qc), g10); + pr(c10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba(c10.L, 0, c10.L, g10, c10.w); + g10 = c10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.eE = function(a10, b10, c10) { + this.pb = a10; + this.p = b10; + this.Xb = c10; + this.Ui = B6(B6(a10.g, Gc().Pj).g, Hc().Fx); + this.Qc = J5(K7(), H10()); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = B6(B6(B6(this.pb.g, Gc().Pj).g, Hc().Fx).g, GO().Mt), b10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = Ab(e10.x, q5(jd)); + if (e10.b()) + return y7(); + e10 = e10.c(); + return new z7().d(e10.yc.$d); + }; + }(this)), c10 = K7(); + a10 = a10.ka(b10, c10.u); + b10 = new ubb(); + c10 = K7(); + a10 = a10.ec(b10, c10.u); + TC(); + b10 = Gb().si; + a10 = a10.nk(UC(b10)).kc(); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ mFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.LibraryDocumentModelEmitter", { mFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Crb() { + this.Qc = this.Ui = this.Xb = this.p = this.pb = null; + } + Crb.prototype = new u7(); + Crb.prototype.constructor = Crb; + d7 = Crb.prototype; + d7.H = function() { + return "RootDocumentModelEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Crb) { + var b10 = this.pb, c10 = a10.pb; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.p; + case 2: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + var b10 = B6(this.Ui.g, GO().Vs).A; + if (!b10.b()) { + var c10 = b10.c(); + b10 = Bw(this, c10); + if (b10 instanceof z7) { + var e10 = b10.i; + b10 = this.Qc; + c10 = K7(); + e10 = [cx(new dx(), "encodes", e10, Q5().Na, ld())]; + c10 = J5(c10, new Ib().ha(e10)); + e10 = K7(); + this.Qc = b10.ia(c10, e10.u); + } else if (y7() === b10) + b10 = this.Qc, e10 = K7(), c10 = [cx(new dx(), "encodes", c10, Q5().Na, ld())], c10 = J5(e10, new Ib().ha(c10)), e10 = K7(), this.Qc = b10.ia(c10, e10.u); + else + throw new x7().d(b10); + } + b10 = B6(this.Ui.g, GO().Mt); + b10.Da() && (c10 = w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = B6(t10.g, UV().$u).A; + v10 = v10.b() ? null : v10.c(); + v10 = Bw(p10, v10); + if (v10 instanceof z7) + return v10 = v10.i, t10 = B6(t10.g, UV().R).A, cx(new dx(), t10.b() ? null : t10.c(), v10, Q5().Na, ld()); + v10 = B6(t10.g, UV().R).A; + v10 = v10.b() ? null : v10.c(); + t10 = B6(t10.g, UV().$u).A; + return cx(new dx(), v10, t10.b() ? null : t10.c(), Q5().Na, ld()); + }; + }(this)), e10 = K7(), b10 = b10.ka(c10, e10.u), c10 = this.p.zb(b10), b10 = this.Qc, c10 = J5(K7(), new Ib().ha([gNa(c10)])), e10 = K7(), this.Qc = b10.ia(c10, e10.u)); + T6(); + e10 = mh(T6(), "root"); + b10 = new PA().e(a10.ca); + c10 = b10.s; + var f10 = b10.ca, g10 = new rr().e(f10); + jr(wr(), this.p.zb(this.Qc), g10); + pr(c10, mr(T6(), tr(ur(), g10.s, f10), Q5().sa)); + c10 = b10.s; + e10 = [e10]; + if (0 > c10.w) + throw new U6().e("0"); + g10 = e10.length | 0; + f10 = c10.w + g10 | 0; + uD(c10, f10); + Ba( + c10.L, + 0, + c10.L, + g10, + c10.w + ); + g10 = c10.L; + var h10 = g10.n.length, k10 = 0, l10 = 0, m10 = e10.length | 0; + h10 = m10 < h10 ? m10 : h10; + m10 = g10.n.length; + for (h10 = h10 < m10 ? h10 : m10; k10 < h10; ) + g10.n[l10] = e10[k10], k10 = 1 + k10 | 0, l10 = 1 + l10 | 0; + c10.w = f10; + pr(a10.s, vD(wD(), b10.s)); + }; + d7.eE = function(a10, b10, c10) { + this.pb = a10; + this.p = b10; + this.Xb = c10; + this.Ui = B6(B6(a10.g, Gc().Pj).g, Hc().De); + this.Qc = J5(K7(), H10()); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(B6(B6(this.pb.g, Gc().Pj).g, Hc().De).x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ BFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.RootDocumentModelEmitter", { BFa: 1, f: 1, db: 1, Ma: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Irb() { + this.qa = this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.vh = this.g = this.ba = this.Ot = this.ER = this.ig = null; + } + Irb.prototype = new u7(); + Irb.prototype.constructor = Irb; + d7 = Irb.prototype; + d7.a = function() { + Jrb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + NN(this); + var a10 = yc(), b10 = F6().$c; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().qm, "", "", H10())); + a10 = qb(); + b10 = F6().$c; + this.ER = rb(new sb(), a10, G5(b10, "fragment"), tb(new ub(), vb().qm, "", "", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Zd; + this.Ot = rb(new sb(), a10, G5(b10, "graphDependencies"), tb(new ub(), vb().qm, "", "", H10())); + a10 = F6().$c; + a10 = G5(a10, "DialectInstanceFragment"); + b10 = Jk().ba; + this.ba = ji(a10, b10); + a10 = this.ig; + b10 = this.ER; + var c10 = this.Ot, e10 = this.vh, f10 = Jk().g; + this.g = ji(a10, ji(b10, ji(c10, ji(e10, f10)))); + return this; + }; + d7.uD = function() { + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new y32().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ iGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectInstanceFragmentModel$", { iGa: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1, KF: 1 }); + var Jrb = void 0; + function Fbb() { + Jrb || (Jrb = new Irb().a()); + return Jrb; + } + function Krb() { + this.qa = this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.vh = this.g = this.ba = this.Ot = this.ig = null; + } + Krb.prototype = new u7(); + Krb.prototype.constructor = Krb; + d7 = Krb.prototype; + d7.a = function() { + Lrb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + NN(this); + var a10 = yc(), b10 = F6().$c; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().qm, "", "", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Zd; + this.Ot = rb(new sb(), a10, G5(b10, "graphDependencies"), tb(new ub(), vb().qm, "", "", H10())); + a10 = F6().$c; + a10 = G5(a10, "DialectInstanceLibrary"); + b10 = Af().ba; + this.ba = ji(a10, b10); + a10 = this.ig; + b10 = this.Ot; + var c10 = this.vh, e10 = Af().g; + this.g = ji(a10, ji(b10, ji(c10, e10))); + return this; + }; + d7.uD = function() { + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new x32().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ jGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectInstanceLibraryModel$", { jGa: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1, KF: 1 }); + var Lrb = void 0; + function xrb() { + Lrb || (Lrb = new Krb().a()); + return Lrb; + } + function Mrb() { + this.qa = this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.vh = this.g = this.ba = this.Ot = this.ig = null; + } + Mrb.prototype = new u7(); + Mrb.prototype.constructor = Mrb; + d7 = Mrb.prototype; + d7.a = function() { + Nrb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + NN(this); + var a10 = yc(), b10 = F6().$c; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().qm, "", "", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Zd; + this.Ot = rb(new sb(), a10, G5(b10, "graphDependencies"), tb(new ub(), vb().qm, "", "", H10())); + a10 = F6().$c; + a10 = G5(a10, "DialectInstance"); + b10 = Gk().ba; + this.ba = ji(a10, b10); + a10 = this.ig; + b10 = this.Ot; + var c10 = this.vh, e10 = Gk().g; + this.g = ji(a10, ji(b10, ji(c10, e10))); + return this; + }; + d7.uD = function() { + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new pO().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ kGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectInstanceModel$", { kGa: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1, KF: 1 }); + var Nrb = void 0; + function qO() { + Nrb || (Nrb = new Mrb().a()); + return Nrb; + } + function Orb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.vh = this.qa = this.g = this.ba = this.Pj = this.Ym = this.R = null; + } + Orb.prototype = new u7(); + Orb.prototype.constructor = Orb; + d7 = Orb.prototype; + d7.a = function() { + Prb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + NN(this); + var a10 = qb(), b10 = F6().Tb; + this.R = rb(new sb(), a10, G5(b10, "name"), tb(new ub(), vb().Tb, "name", "Name of the dialect", H10())); + a10 = qb(); + b10 = F6().Tb; + this.Ym = rb(new sb(), a10, G5(b10, "version"), tb(new ub(), vb().Tb, "version", "Version of the dialect", H10())); + a10 = Hc(); + b10 = F6().$c; + this.Pj = rb(new sb(), a10, G5(b10, "documents"), tb(new ub(), vb().$c, "documents", "Document mapping for the the dialect", H10())); + a10 = F6().$c; + a10 = G5(a10, "Dialect"); + b10 = Gk().ba; + this.ba = ji(a10, b10); + a10 = this.R; + b10 = this.Ym; + var c10 = this.vh, e10 = this.Pj, f10 = Bq().uc, g10 = Gk().g; + this.g = ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, g10))))); + this.qa = tb(new ub(), vb().$c, "Dialect", "Definition of an AML dialect, mapping AST nodes from dialect documents into an output semantic graph", H10()); + return this; + }; + d7.uD = function() { + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new zO().K(new S6().a(), a10); + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.$classData = r8({ nGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectModel$", { nGa: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1, KF: 1 }); + var Prb = void 0; + function Gc() { + Prb || (Prb = new Orb().a()); + return Prb; + } + function Qrb() { + this.qa = this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Ts = this.at = this.Zt = this.qD = this.R = this.ba = this.g = this.bh = null; + this.xa = 0; + } + Qrb.prototype = new u7(); + Qrb.prototype.constructor = Qrb; + d7 = Qrb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + Rrb = this; + Cr(this); + uU(this); + bM(this); + ud(this); + Bba(this); + Aba(this); + var a10 = new UM().yd(yc()), b10 = F6().Ua; + this.bh = rb(new sb(), a10, G5(b10, "node"), tb(new ub(), ci().Ua, "range", "Object constraint over the type of the mapped property", H10())); + a10 = this.R; + b10 = this.qD; + var c10 = this.Zt, e10 = this.bh, f10 = db().g, g10 = nc().g, h10 = ii(); + f10 = f10.ia(g10, h10.u); + this.g = ji(a10, ji(b10, ji(c10, ji(e10, f10)))); + a10 = F6().$c; + a10 = G5(a10, "UnionNodeMapping"); + b10 = F6().Ua; + b10 = G5(b10, "Shape"); + c10 = nc().ba; + this.ba = ji(a10, ji(b10, c10)); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.D_ = function(a10) { + this.R = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Eia = function(a10) { + this.Zt = a10; + }; + d7.Dia = function(a10) { + this.qD = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.jc = function() { + return this.qa; + }; + d7.KN = function(a10) { + this.at = a10; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ze2().K(new S6().a(), a10); + }; + d7.JN = function(a10) { + this.Ts = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ DGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.domain.UnionNodeMappingModel$", { DGa: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, PR: 1, yGa: 1, d7: 1 }); + var Rrb = void 0; + function Ae4() { + Rrb || (Rrb = new Qrb().a()); + return Rrb; + } + function cO() { + SV.call(this); + this.Xa = this.aa = null; + } + cO.prototype = new WXa(); + cO.prototype.constructor = cO; + d7 = cO.prototype; + d7.H = function() { + return "DatatypePropertyTerm"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof cO ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return Sbb(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Y = function() { + return this.aa; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + return this; + }; + d7.$classData = r8({ PGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DatatypePropertyTerm", { PGa: 1, pHa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function uO() { + this.Paa = this.KU = this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + uO.prototype = new u7(); + uO.prototype.constructor = uO; + function t1a(a10, b10, c10, e10) { + c10.Ie ? Nha(c10, w6(/* @__PURE__ */ function(f10, g10, h10, k10) { + return function(l10) { + if (l10 instanceof uO) { + var m10 = xj(g10), p10 = h10.Re, t10 = h10.x, v10 = B6(h10.g, db().oe).A; + l10 = f10.kk(p10, t10, l10, !(v10.b() || !v10.c())).pc(h10.j); + p10 = Od(O7(), k10); + Rg(f10, m10, l10, p10); + } else + throw mb(E6(), new nb().e("Cannot resolve reference with not dialect domain element value " + l10.j)); + }; + }(a10, b10, c10, e10))) : (b10 = xj(b10), e10 = Od(O7(), e10), Rg(a10, b10, c10, e10)); + return a10; + } + d7 = uO.prototype; + d7.H = function() { + return "DialectDomainElement"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + function WU(a10, b10) { + a10.KU = b10; + return a10; + } + d7.ub = function(a10) { + return Vb().Ia(this.j).b() ? Ai(this, a10) : this; + }; + function K1a(a10, b10, c10, e10) { + b10 = xj(b10); + if (H10().h(c10) && !a10.g.vb.Ha(b10)) + c10 = Zr(new $r(), H10(), new P6().a()), e10 = Od(O7(), e10), Rg(a10, b10, c10, e10); + else { + var f10 = c10.Dm(w6(/* @__PURE__ */ function() { + return function(h10) { + return null !== h10 && h10.Ie ? true : false; + }; + }(a10))); + if (null === f10) + throw new x7().d(f10); + c10 = f10.ma(); + f10 = f10.ya(); + f10 = Zr(new $r(), f10, new P6().a()); + var g10 = Od(O7(), e10); + Rg(a10, b10, f10, g10); + c10.U(w6(/* @__PURE__ */ function(h10, k10, l10) { + return function(m10) { + null !== m10 && m10.Ie && Nha(m10, w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + if (A10 instanceof uO) { + var D10 = B6(p10.g, t10), C10 = K7(); + A10 = Zr(new $r(), D10.yg(A10, C10.u), new P6().a()); + D10 = Od(O7(), v10); + Rg(p10, t10, A10, D10); + } + }; + }( + h10, + k10, + l10 + ))); + }; + }(a10, b10, e10))); + } + return a10; + } + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof uO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + function O1a(a10, b10, c10, e10) { + b10 = xj(b10); + var f10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return ih(new jh(), h10, new P6().a()); + }; + }(a10)), g10 = K7(); + c10 = Zr(new $r(), c10.ka(f10, g10.u), Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new uO().K(new S6().a(), a10); + return WU(VU(Rd(a10, this.j), tj(this)), this.KU); + }; + function rda(a10, b10) { + b10 = a10.g.vb.Ja(b10); + a10 = new Ybb().$z(a10); + b10.b() ? b10 = y7() : (a10 = $s(a10), b10 = b10.c(), b10 = a10.Ia(b10)); + return b10.b() ? H10() : b10.c(); + } + function iNa(a10) { + if (Za(a10).na()) { + var b10 = B6(a10.g, db().ed).A; + if (b10.b() && (b10 = Za(a10), b10.b() ? b10 = y7() : (b10 = b10.c().j, b10 = Mc(ua(), b10, "#"), b10 = new z7().d(zj(new Pc().fd(b10)))), b10.b())) + throw mb(E6(), new nb().e("Cannot produce include reference without linked element at elem " + a10.j)); + return b10.c(); + } + throw mb(E6(), new nb().e("Cannot produce include reference without linked element at elem " + a10.j)); + } + d7.bc = function() { + return vO(this); + }; + function Z1a(a10, b10, c10, e10) { + b10 = xj(b10); + c10 = ih(new jh(), c10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + function Y1a(a10, b10, c10, e10) { + b10 = xj(b10); + c10 = ih(new jh(), c10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + return ""; + }; + function m2a(a10) { + if (Za(a10).na()) { + var b10 = Za(a10); + b10.b() ? b10 = y7() : (b10 = b10.c().j, b10 = Mc(ua(), b10, "#"), b10 = Oc(new Pc().fd(b10)), b10 = Mc(ua(), b10, "/"), b10 = new z7().d(Oc(new Pc().fd(b10)))); + if (b10.b()) + throw mb(E6(), new nb().e("Cannot produce local reference without linked element at elem " + a10.j)); + return b10.c(); + } + a10 = a10.j; + a10 = Mc(ua(), a10, "#"); + a10 = Oc(new Pc().fd(a10)); + a10 = Mc(ua(), a10, "/"); + return Oc(new Pc().fd(a10)); + } + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + a10 = kM(c10, a10, b10); + e10 && ut(a10) && (b10 = db().oe, Bi(a10, b10, e10)); + return a10; + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new uO().K(a10, b10); + }; + }(this)); + }; + function b2a(a10, b10, c10, e10) { + b10 = xj(b10); + c10 = ih(new jh(), c10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + function mda(a10, b10) { + b10 = a10.g.vb.Ja(b10); + a10 = new Vbb().$z(a10); + b10.b() ? b10 = y7() : (a10 = $s(a10), b10 = b10.c(), b10 = a10.Ia(b10)); + return b10.b() ? H10() : b10.c(); + } + function a2a(a10, b10, c10, e10) { + b10 = xj(b10); + c10 = ih(new jh(), c10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + function oJa(a10, b10) { + b10 = a10.g.vb.Ja(b10); + a10 = new $bb().$z(a10); + if (b10.b()) + return y7(); + a10 = $s(a10); + b10 = b10.c(); + return a10.Ia(b10); + } + function vO(a10) { + if (a10.KU.b()) + return Fw(), UMa(new UU(), (Fw(), J5(K7(), H10())), (Fw(), H10()), (Fw(), y7())); + var b10 = a10.KU.fj(), c10 = B6(tj(a10).g, wj().ej), e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return xj(g10); + }; + }(a10)), f10 = K7(); + return UMa(new UU(), b10, c10.ka(e10, f10.u), new z7().d(tj(a10))); + } + function p8(a10, b10) { + return B6(tj(a10).g, wj().ej).Fb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = B6(f10.g, $d().Yh).A; + return (f10.b() ? null : f10.c()) === e10; + }; + }(a10, b10))); + } + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + function o1a(a10, b10) { + var c10 = Fw().oX; + Bi(a10, c10, b10); + } + function oda(a10, b10) { + b10 = a10.g.vb.Ja(b10); + a10 = new Xbb().$z(a10); + if (b10.b()) + return y7(); + a10 = $s(a10); + b10 = b10.c(); + return a10.Ia(b10); + } + d7.Sd = function(a10) { + this.j = a10; + }; + function $1a(a10, b10, c10, e10) { + b10 = xj(b10); + c10 = ih(new jh(), c10, Od(O7(), e10.i)); + e10 = Od(O7(), e10); + Rg(a10, b10, c10, e10); + return a10; + } + function VU(a10, b10) { + a10.Paa = new z7().d(b10); + return a10; + } + function tj(a10) { + a10 = a10.Paa; + if (a10 instanceof z7) + return a10.i; + if (y7() === a10) + throw mb(E6(), new nb().e("NodeMapping for the instance not defined")); + throw new x7().d(a10); + } + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + this.KU = H10(); + this.Paa = y7(); + return this; + }; + d7.$classData = r8({ QGa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.DialectDomainElement", { QGa: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, y: 1, v: 1, q: 1, o: 1 }); + function dO() { + SV.call(this); + this.Xa = this.aa = null; + } + dO.prototype = new WXa(); + dO.prototype.constructor = dO; + d7 = dO.prototype; + d7.H = function() { + return "ObjectPropertyTerm"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof dO ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return eO(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Y = function() { + return this.aa; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + return this; + }; + d7.$classData = r8({ mHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.ObjectPropertyTerm", { mHa: 1, pHa: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Srb() { + this.WB = 0; + this.Ig = this.To = this.mx = null; + this.oo = false; + this.Pz = this.qi = null; + } + Srb.prototype = new RL(); + Srb.prototype.constructor = Srb; + d7 = Srb.prototype; + d7.WW = function(a10, b10, c10, e10, f10, g10) { + return bpa(a10, b10, c10, this.mx.tD, e10, f10, g10); + }; + d7.Fia = function(a10) { + this.To = a10; + }; + d7.a = function() { + rq.prototype.a.call(this); + Trb = this; + epa(this); + this.qi = nv().ea; + u2a(this); + icb(this); + this.mx = mk(); + return this; + }; + d7.hI = function(a10, b10) { + return a10 instanceof bg ? new z7().d(Tkb(new A7(), a10, new YV().Ti(b10.Bc, KO(), new Yf().a())).r0()) : a10 instanceof mf ? new z7().d(new Urb().FK(a10, new YV().Ti(b10.Bc, KO(), new Yf().a())).sB()) : a10 instanceof Mk ? (T6(), a10 = B6(ar(a10.g, Jk().nb).g, Ok().Rd).A, a10 = mh(0, a10.b() ? null : a10.c()), new z7().d(Wta(Dj(), a10))) : Kk(a10) ? new z7().d(new sR().U$(a10, new YV().Ti(b10.Bc, KO(), new Yf().a())).fK()) : y7(); + }; + d7.FD = function(a10) { + return a10 instanceof Hl ? true : a10 instanceof Fl ? true : a10 instanceof mf ? a10.qe() instanceof Rm : a10 instanceof bg ? ar(a10.g, Af().Ic).Od(w6(/* @__PURE__ */ function() { + return function(b10) { + return null !== b10; + }; + }(this))) : Kk(a10); + }; + d7.NE = function() { + return cHa(this.Ig, this); + }; + d7.tA = function(a10, b10) { + return dcb(this, a10, b10); + }; + d7.Gg = function() { + return Bu(); + }; + d7.dy = function() { + return s2a(); + }; + d7.J_ = function(a10) { + this.Pz = a10; + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha("application/json application/yaml application/x-yaml text/yaml text/vnd.yaml text/x-yaml application/openapi+json application/swagger+json application/openapi+yaml application/swagger+yaml application/openapi application/swagger".split(" "))); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10, c10) { + return Pp().ux === c10 ? new IQ().Hb(b10).ye(a10) : Pp().VI === c10 ? new uY().nu(b10, true).ye(a10) : Pp().xX === c10 ? jHa(new FQ(), b10, lk()).ye(a10) : Pp().uR === c10 ? new uY().nu(b10, false).ye(a10) : t2a(this, a10, b10, c10); + }; + d7.gi = function() { + return this.Ig; + }; + d7.F_ = function(a10) { + this.oo = a10; + }; + d7.eO = function() { + return new jz().dH(this.Pz, w6(/* @__PURE__ */ function() { + return function(a10) { + return a10 === mk().Ll || a10 === lk().Ll; + }; + }(this))); + }; + d7.wr = function() { + return v2a(); + }; + d7.nB = function(a10) { + a10 = lx().hG(a10); + if (a10.b()) + return false; + a10 = a10.c(); + var b10 = mx(); + return !(null !== a10 && a10 === b10); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return y2a(); + }; + d7.gB = function() { + return this.oo; + }; + d7.E_ = function(a10) { + this.Ig = a10; + }; + d7.Fja = function(a10, b10, c10, e10) { + return new mA().Wx(a10, b10, c10, e10, y7(), y7()); + }; + d7.$classData = r8({ IIa: 0 }, false, "amf.plugins.document.webapi.Oas20Plugin$", { IIa: 1, bD: 1, f: 1, Zr: 1, KIa: 1, g7: 1, MR: 1, q7: 1, dD: 1, ib: 1 }); + var Trb = void 0; + function oAa() { + Trb || (Trb = new Srb().a()); + return Trb; + } + function Vrb() { + this.WB = 0; + this.Ig = this.To = this.mx = null; + this.oo = false; + this.Pz = this.qi = null; + } + Vrb.prototype = new RL(); + Vrb.prototype.constructor = Vrb; + d7 = Vrb.prototype; + d7.WW = function(a10, b10, c10, e10, f10, g10) { + return bpa(a10, b10, c10, this.mx.tD, e10, f10, g10); + }; + d7.Fia = function(a10) { + this.To = a10; + }; + d7.a = function() { + rq.prototype.a.call(this); + Wrb = this; + epa(this); + this.qi = nv().ea; + u2a(this); + icb(this); + this.mx = nk(); + return this; + }; + d7.hI = function(a10, b10) { + return a10 instanceof bg ? new z7().d(Tkb(new A7(), a10, new $V().Ti(b10.Bc, KO(), new Yf().a())).r0()) : a10 instanceof mf ? new z7().d(new Xrb().FK(a10, new $V().Ti(b10.Bc, KO(), new Yf().a())).sB()) : a10 instanceof Mk ? (T6(), a10 = B6(ar(a10.g, Jk().nb).g, Ok().Rd).A, a10 = mh(0, a10.b() ? null : a10.c()), new z7().d(Wta(Dj(), a10))) : Kk(a10) ? new z7().d(new sR().U$(a10, new $V().Ti(b10.Bc, KO(), new Yf().a())).fK()) : y7(); + }; + d7.FD = function(a10) { + return a10 instanceof Hl ? true : a10 instanceof Fl ? true : a10 instanceof mf ? a10.qe() instanceof Rm : a10 instanceof bg ? ar(a10.g, Af().Ic).Od(w6(/* @__PURE__ */ function() { + return function(b10) { + return null !== b10; + }; + }(this))) : Kk(a10); + }; + d7.NE = function() { + return cHa(this.Ig, this); + }; + d7.tA = function(a10, b10) { + return dcb(this, a10, b10); + }; + d7.Gg = function() { + return Cu(); + }; + d7.dy = function() { + return s2a(); + }; + d7.J_ = function(a10) { + this.Pz = a10; + }; + d7.Qz = function() { + return J5(K7(), new Ib().ha("application/json application/yaml application/x-yaml text/yaml text/vnd.yaml text/x-yaml application/openapi+json application/swagger+json application/openapi+yaml application/swagger+yaml application/openapi application/swagger".split(" "))); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10, c10) { + return Pp().ux === c10 ? new tY().Hb(b10).ye(a10) : Pp().VI === c10 ? new rY().nu(b10, true).ye(a10) : t2a(this, a10, b10, c10); + }; + d7.gi = function() { + return this.Ig; + }; + d7.F_ = function(a10) { + this.oo = a10; + }; + d7.eO = function() { + return new jz().dH(this.Pz, w6(/* @__PURE__ */ function() { + return function(a10) { + return a10 === pAa().mx.Ll; + }; + }(this))); + }; + d7.wr = function() { + return v2a(); + }; + d7.nB = function(a10) { + return lx().hG(a10).Ha(mx()); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return y2a(); + }; + d7.gB = function() { + return this.oo; + }; + d7.E_ = function(a10) { + this.Ig = a10; + }; + d7.Fja = function(a10, b10, c10, e10) { + return new lA().Wx(a10, b10, c10, e10, y7(), y7()); + }; + d7.$classData = r8({ JIa: 0 }, false, "amf.plugins.document.webapi.Oas30Plugin$", { JIa: 1, bD: 1, f: 1, Zr: 1, KIa: 1, g7: 1, MR: 1, q7: 1, dD: 1, ib: 1 }); + var Wrb = void 0; + function pAa() { + Wrb || (Wrb = new Vrb().a()); + return Wrb; + } + function Yrb() { + this.WB = 0; + this.Ig = this.To = this.mx = null; + this.oo = false; + this.Pz = this.qi = null; + } + Yrb.prototype = new RL(); + Yrb.prototype.constructor = Yrb; + d7 = Yrb.prototype; + d7.WW = function(a10, b10, c10, e10, f10, g10) { + return bpa(a10, b10, c10, this.mx.tD, e10, f10, g10); + }; + d7.a = function() { + rq.prototype.a.call(this); + Zrb = this; + epa(this); + this.qi = nv().ea; + u2a(this); + scb(this); + this.mx = qk(); + return this; + }; + d7.Gia = function(a10) { + this.To = a10; + }; + d7.hI = function(a10, b10) { + return a10 instanceof mf ? new z7().d(W6a(new G42(), a10, new rW().cU(b10.Bc, new Yf().a())).sB()) : Kk(a10) ? new z7().d(Hna(new sA(), a10, new rW().cU(b10.Bc, new Yf().a())).fK()) : y7(); + }; + d7.FD = function(a10) { + return a10 instanceof Hl ? false : a10 instanceof Fl ? false : a10 instanceof mf ? a10.qe() instanceof Rm : !(a10 instanceof bg) && (a10 instanceof vl || a10 instanceof ql || a10 instanceof xl || a10 instanceof zl || a10 instanceof Dl || a10 instanceof ol || a10 instanceof Bl || a10 instanceof Mk); + }; + d7.NE = function() { + return cHa(this.Ig, this); + }; + d7.tA = function(a10, b10) { + return jcb(this, a10, b10); + }; + d7.Gg = function() { + return Qb(); + }; + d7.dy = function() { + return s2a(); + }; + d7.J_ = function(a10) { + this.Pz = a10; + }; + d7.Qz = function() { + return rcb(); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10, c10) { + return Pp().ux === c10 ? new wY().Hb(b10).ye(a10) : Pp().VI === c10 ? new vY().nu(b10, true).ye(a10) : Pp().uR === c10 ? new vY().nu(b10, false).ye(a10) : t2a(this, a10, b10, c10); + }; + d7.C9 = function(a10, b10, c10) { + var e10 = b10.da; + b10 = b10.Q; + var f10 = a10.Df, g10 = K7(); + b10 = b10.ia(f10, g10.u); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(rla(tla(), c10))); + return new uB().il(e10, b10, a10, c10, y7(), y7(), iA().ho); + }; + d7.gi = function() { + return this.Ig; + }; + d7.F_ = function(a10) { + this.oo = a10; + }; + d7.eO = function() { + return new jz().dH(this.Pz, w6(/* @__PURE__ */ function() { + return function(a10) { + return a10 === qAa().mx.Ll; + }; + }(this))); + }; + d7.wr = function() { + return v2a(); + }; + d7.nB = function(a10) { + a10 = aHa().hG(a10); + if (a10.b()) + return false; + a10 = a10.c(); + return uOa().h(a10) ? true : !!(a10 && a10.$classData && a10.$classData.ge.NF); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return y2a(); + }; + d7.gB = function() { + return this.oo; + }; + d7.E_ = function(a10) { + this.Ig = a10; + }; + d7.$classData = r8({ MIa: 0 }, false, "amf.plugins.document.webapi.Raml08Plugin$", { MIa: 1, bD: 1, f: 1, Zr: 1, OIa: 1, g7: 1, MR: 1, q7: 1, dD: 1, ib: 1 }); + var Zrb = void 0; + function qAa() { + Zrb || (Zrb = new Yrb().a()); + return Zrb; + } + function $rb() { + this.WB = 0; + this.Ig = this.To = this.mx = null; + this.oo = false; + this.Pz = this.qi = null; + } + $rb.prototype = new RL(); + $rb.prototype.constructor = $rb; + d7 = $rb.prototype; + d7.WW = function(a10, b10, c10, e10, f10, g10) { + return bpa(a10, b10, c10, this.mx.tD, e10, f10, g10); + }; + d7.a = function() { + rq.prototype.a.call(this); + asb = this; + epa(this); + this.qi = nv().ea; + u2a(this); + scb(this); + this.mx = ok2(); + return this; + }; + d7.Gia = function(a10) { + this.To = a10; + }; + d7.hI = function(a10, b10) { + return a10 instanceof bg ? new z7().d(l7a(new k7a(), a10, new JW().Ti(b10.Bc, WO(), new Yf().a())).r0()) : a10 instanceof mf ? new z7().d(W6a(new G42(), a10, new JW().Ti(b10.Bc, WO(), new Yf().a())).sB()) : a10 instanceof Mk ? (T6(), a10 = B6(ar(a10.g, Jk().nb).g, Ok().Rd).A, a10 = mh(0, a10.b() ? null : a10.c()), new z7().d(Wta(Dj(), a10))) : Kk(a10) ? new z7().d(Hna(new sA(), a10, new JW().Ti(b10.Bc, WO(), new Yf().a())).fK()) : y7(); + }; + d7.FD = function(a10) { + return a10 instanceof Hl ? true : a10 instanceof Fl ? true : a10 instanceof mf ? a10.qe() instanceof Rm : a10 instanceof bg || a10 instanceof vl || a10 instanceof ql || a10 instanceof xl || a10 instanceof zl || a10 instanceof Dl || a10 instanceof ol || a10 instanceof Bl || a10 instanceof Mk; + }; + d7.NE = function() { + return cHa(this.Ig, this); + }; + d7.tA = function(a10, b10) { + return jcb(this, a10, b10); + }; + d7.Gg = function() { + return Pb(); + }; + d7.dy = function() { + return s2a(); + }; + d7.J_ = function(a10) { + this.Pz = a10; + }; + d7.Qz = function() { + return rcb(); + }; + d7.pF = function() { + return this.To; + }; + d7.PE = function(a10, b10, c10) { + return Pp().ux === c10 ? new PQ().Hb(b10).ye(a10) : Pp().VI === c10 ? new xY().nu(b10, true).ye(a10) : Pp().xX === c10 ? jHa(new FQ(), b10, ok2()).ye(a10) : Pp().uR === c10 ? new xY().nu(b10, false).ye(a10) : t2a(this, a10, b10, c10); + }; + d7.C9 = function(a10, b10, c10) { + var e10 = b10.da; + b10 = b10.Q; + var f10 = a10.Df, g10 = K7(); + b10 = b10.ia(f10, g10.u); + c10.b() ? c10 = y7() : (c10 = c10.c(), c10 = new z7().d(rla(tla(), c10))); + return new hA().il(e10, b10, a10, c10, y7(), y7(), iA().ho); + }; + d7.gi = function() { + return this.Ig; + }; + d7.F_ = function(a10) { + this.oo = a10; + }; + d7.eO = function() { + return new jz().dH(this.Pz, w6(/* @__PURE__ */ function() { + return function(a10) { + return a10 === pk().Ll || a10 === ok2().Ll || a10 === kk().Ll; + }; + }(this))); + }; + d7.wr = function() { + return v2a(); + }; + d7.nB = function(a10) { + a10 = aHa().hG(a10); + if (a10.b()) + return false; + a10 = a10.c(); + return yOa().h(a10) || ux().h(a10) || vx().h(a10) || BOa().h(a10) ? true : Ska().h(a10) ? true : tx().h(a10) ? true : Tka().h(a10) ? true : Uka().h(a10) ? true : Vka().h(a10) ? true : Wka().h(a10) ? true : Xka().h(a10); + }; + d7.fp = function() { + return ZC(hp(), this); + }; + d7.ry = function() { + return y2a(); + }; + d7.gB = function() { + return this.oo; + }; + d7.E_ = function(a10) { + this.Ig = a10; + }; + d7.$classData = r8({ NIa: 0 }, false, "amf.plugins.document.webapi.Raml10Plugin$", { NIa: 1, bD: 1, f: 1, Zr: 1, OIa: 1, g7: 1, MR: 1, q7: 1, dD: 1, ib: 1 }); + var asb = void 0; + function rAa() { + asb || (asb = new $rb().a()); + return asb; + } + function rB() { + this.r = this.$ = this.ES = this.nw = null; + } + rB.prototype = new u7(); + rB.prototype.constructor = rB; + d7 = rB.prototype; + d7.H = function() { + return "ExtensionProvenance"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rB && this.nw === a10.nw) { + var b10 = this.ES; + a10 = a10.ES; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nw; + case 1: + return this.ES; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.z = function() { + return X5(this); + }; + d7.Uq = function(a10, b10) { + this.nw = a10; + this.ES = b10; + this.$ = "extension-provenance"; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(",location->" + b10)); + this.r = "id->" + a10 + (b10.b() ? "" : b10.c()); + J5(K7(), new Ib().ha([a10])); + return this; + }; + d7.kM = function(a10) { + return new rB().Uq(a10.P(this.nw), this.ES); + }; + d7.$classData = r8({ TIa: 0 }, false, "amf.plugins.document.webapi.annotations.ExtensionProvenance", { TIa: 1, f: 1, Eh: 1, gf: 1, dJ: 1, Vm: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mf() { + this.r = this.$ = this.Vk = null; + } + Mf.prototype = new u7(); + Mf.prototype.constructor = Mf; + d7 = Mf.prototype; + d7.H = function() { + return "ParsedJSONSchema"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Mf ? this.Vk === a10.Vk : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Vk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.e = function(a10) { + this.Vk = a10; + this.$ = "parsed-json-schema"; + this.r = a10; + return this; + }; + d7.z = function() { + return X5(this); + }; + var xh = r8({ iJa: 0 }, false, "amf.plugins.document.webapi.annotations.ParsedJSONSchema", { iJa: 1, f: 1, Fga: 1, Vm: 1, gf: 1, Eh: 1, y: 1, v: 1, q: 1, o: 1 }); + Mf.prototype.$classData = xh; + function bsb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.g = this.mc = this.qa = this.ba = null; + } + bsb.prototype = new u7(); + bsb.prototype.constructor = bsb; + d7 = bsb.prototype; + d7.a = function() { + csb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + ehb(this); + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "Extension")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Gk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Extension", "API spec information designed to be applied and compelement the information of a base specification. RAML extensions and overlays are examples of extensions.", H10()); + return this; + }; + d7.uD = function() { + }; + d7.nc = function() { + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Ni = function() { + return this.mc; + }; + d7.y_ = function(a10) { + this.mc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Fl().K(new S6().a(), a10); + }; + d7.z_ = function(a10) { + this.g = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ aKa: 0 }, false, "amf.plugins.document.webapi.metamodel.ExtensionModel$", { aKa: 1, f: 1, DY: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1 }); + var csb = void 0; + function qea() { + csb || (csb = new bsb().a()); + return csb; + } + function dsb() { + this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.g = this.mc = this.qa = this.ba = null; + } + dsb.prototype = new u7(); + dsb.prototype.constructor = dsb; + d7 = dsb.prototype; + d7.a = function() { + esb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + ehb(this); + ii(); + var a10 = F6().Ta; + a10 = [G5(a10, "Overlay")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Gk().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Overlay Model", "Model defining a RAML overlay", H10()); + return this; + }; + d7.uD = function() { + }; + d7.nc = function() { + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Ni = function() { + return this.mc; + }; + d7.y_ = function(a10) { + this.mc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Hl().K(new S6().a(), a10); + }; + d7.z_ = function(a10) { + this.g = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.$classData = r8({ iKa: 0 }, false, "amf.plugins.document.webapi.metamodel.OverlayModel$", { iKa: 1, f: 1, DY: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1 }); + var esb = void 0; + function rea() { + esb || (esb = new dsb().a()); + return esb; + } + function fsb() { + AP.call(this); + this.gd = this.Mc = this.Gk = null; + this.kj = false; + this.je = null; + } + fsb.prototype = new BP(); + fsb.prototype.constructor = fsb; + d7 = fsb.prototype; + d7.H = function() { + return "OasFileShapeEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.fI = function() { + return y7(); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fsb) { + var b10 = this.Gk, c10 = a10.Gk; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Gk; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), AP.prototype.Pa.call(this)), b10 = this.Gk.aa; + Dg(a10, xka("file", this.Gk)); + $la(this, b10, a10); + b10 = hd(b10, gn().OA); + b10.b() || (b10 = b10.c(), new z7().d(Dg(a10, $x(jx(new je4().e("fileTypes")), b10, this.Mc, false)))); + return a10; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Gk)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.Lj = function() { + return this.je; + }; + function w3a(a10, b10, c10, e10, f10) { + var g10 = new fsb(); + g10.Gk = a10; + g10.Mc = b10; + g10.gd = c10; + g10.kj = e10; + g10.je = f10; + var h10 = H10(), k10 = H10(); + AP.prototype.VK.call(g10, a10, b10, c10, h10, k10, e10, f10); + return g10; + } + d7.$classData = r8({ $Ma: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasFileShapeEmitter", { $Ma: 1, hJ: 1, iN: 1, f: 1, QMa: 1, fPa: 1, y: 1, v: 1, q: 1, o: 1 }); + function gsb() { + AP.call(this); + this.gd = this.Mc = this.Gk = null; + this.kj = false; + this.je = null; + } + gsb.prototype = new BP(); + gsb.prototype.constructor = gsb; + d7 = gsb.prototype; + d7.H = function() { + return "OasScalarShapeEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.fI = function() { + var a10 = B6(this.Gk.aa, Fg().af).A; + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(Cma(hz(), a10)); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gsb) { + var b10 = this.Gk, c10 = a10.Gk; + (null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc ? (b10 = this.gd, c10 = a10.gd, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.kj === a10.kj : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Gk; + case 1: + return this.Mc; + case 2: + return this.gd; + case 3: + return this.kj; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), AP.prototype.Pa.call(this)), b10 = this.Gk.aa, c10 = hd(b10, Fg().af); + if (!c10.b()) { + var e10 = c10.c(); + c10 = this.je.Aqa().ena(this.fI().c()); + var f10 = Ab(this.Gk.Xa, q5(bx)); + f10 instanceof z7 ? (e10 = f10.i, Dg(a10, cx(new dx(), "type", c10, Q5().Na, e10.yc.$d))) : (e10 = kr(wr(), e10.r.x, q5(jd)), f10 = Q5().Na, Dg(a10, cx(new dx(), "type", c10, f10, e10))); + } + c10 = hd(b10, Fg().Fn); + if (!(c10 instanceof z7)) + if (y7() === c10) + if (c10 = this.fI(), c10 = c10.b() ? ff() : c10.c(), c10 = Be3() === c10 ? new z7().d("byte") : Ce() === c10 ? new z7().d("binary") : De2() === c10 ? new z7().d("password") : Ue() === c10 ? new z7().d("date-time") : We() === c10 ? new z7().d("date-time-only") : Xe() === c10 ? new z7().d("time-only") : Ye() === c10 ? new z7().d("date-only") : Ge() === c10 ? new z7().d("int64") : Ke() === c10 ? new z7().d("double") : y7(), c10 instanceof z7) + c10 = c10.i, Dg(a10, Iga(Kga(), "format", Fg().Fn, pca(c10), (O7(), new P6().a()))); + else { + if (y7() !== c10) + throw new x7().d(c10); + } + else + throw new x7().d(c10); + $la(this, b10, a10); + return a10; + }; + function v3a(a10, b10, c10, e10, f10) { + var g10 = new gsb(); + g10.Gk = a10; + g10.Mc = b10; + g10.gd = c10; + g10.kj = e10; + g10.je = f10; + var h10 = H10(), k10 = H10(); + AP.prototype.VK.call(g10, a10, b10, c10, h10, k10, e10, f10); + return g10; + } + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Gk)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Mc)); + a10 = OJ().Ga(a10, NJ(OJ(), this.gd)); + a10 = OJ().Ga(a10, this.kj ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.Lj = function() { + return this.je; + }; + d7.$classData = r8({ rNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasScalarShapeEmitter", { rNa: 1, hJ: 1, iN: 1, f: 1, QMa: 1, fPa: 1, y: 1, v: 1, q: 1, o: 1 }); + function mX() { + M22.call(this); + this.zna = this.yna = this.Qj = this.se = this.ra = this.Nj = this.Wf = this.ie = this.de = this.zT = this.HZ = null; + } + mX.prototype = new MYa(); + mX.prototype.constructor = mX; + function hsb(a10, b10, c10, e10) { + var f10 = wpa(ypa(), a10.se); + b10 = Sd(f10, b10, a10.Qj); + e10.P(b10); + return Wib(a10, b10, c10).Xi(); + } + d7 = mX.prototype; + d7.H = function() { + return "OasTypeParser"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mX) { + var b10 = this.zT, c10 = a10.zT; + (null === b10 ? null === c10 : b10.h(c10)) && this.de === a10.de && Bj(this.ie, a10.ie) ? (b10 = this.Wf, c10 = a10.Wf, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Nj === a10.Nj : false; + } + return false; + }; + function isb(a10, b10, c10, e10) { + return F3a(new C3a(), a10, b10, a10.se, c10, w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + g10.P(h10); + }; + }(a10, e10))).Xi(); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.zT; + case 1: + return this.de; + case 2: + return this.ie; + case 3: + return this.Wf; + case 4: + return this.Nj; + default: + throw new U6().e("" + a10); + } + }; + function jsb(a10) { + ur(); + var b10 = a10.ie.sb.Cb(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + k10 = k10.Aa; + var l10 = Dd(); + k10 = N6(k10, l10, h10.ra); + return !(null !== k10 && ra(k10, "type")); + }; + }(a10))), c10 = tr(0, b10, a10.ie.da.Rf); + ue4(); + T6(); + T6(); + b10 = mr(T6(), c10, Q5().sa); + b10 = bjb(new r72(), a10, new ye4().d(b10), a10.de); + a10.Wf.P(b10.wa); + b10 = b10.zP(); + c10 = c10.sb.Cb(w6(/* @__PURE__ */ function(h10) { + return function(k10) { + k10 = k10.Aa; + var l10 = Dd(); + k10 = N6(k10, l10, h10.ra); + return "example" !== k10 && k10 !== jx(new je4().e("examples")) && "title" !== k10 && "description" !== k10 && "default" !== k10 && "enum" !== k10 && "externalDocs" !== k10 && "xml" !== k10 && k10 !== jx(new je4().e("facets")) && "anyOf" !== k10 && "allOf" !== k10 && "oneOf" !== k10 && "not" !== k10; + }; + }(a10))); + ur(); + var e10 = c10.kc(); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.da.Rf)); + c10 = tr(0, c10, e10.b() ? "" : e10.c()); + e10 = new lC().ue(0); + var f10 = ac(new M6().W(a10.ie), "type").c().i, g10 = tw(); + f10 = N6(f10, g10, a10.ra).Cm; + c10 = w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + k10.oa = 1 + k10.oa | 0; + var t10 = p10.hb().gb, v10 = Q5().Na; + if (t10 === v10) { + t10 = Dd(); + var A10 = N6(p10, t10, h10.ra); + if ("object" === A10) + return p10 = "" + h10.de + k10.oa, v10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/object"); + }; + }(h10, m10), ac(new M6().W(l10), jx(new je4().e("schema"))).na() ? (t10 = DRa(FRa(), h10.se), p10 = Sd( + t10, + p10, + h10.Qj + ), v10(p10), p10 = lnb(h10, p10, l10).Xi()) : (t10 = yRa(ARa(), h10.se), p10 = Sd(t10, p10, h10.Qj), t10 = h10.ra.Qh.ku, v10(p10), h10.Nj instanceof zP || h10.Nj instanceof Qy || (v10 = l10.Za.Ja((T6(), mh(T6(), "id"))), v10.b() || (v10 = v10.c(), A10 = Dd(), v10 = v10.Qp(A10).pk(), v10.b() || (v10 = v10.c(), Eb(t10, v10, p10), A8(h10.ra, v10, p10)))), p10 = ajb($ib(h10, p10, l10, h10.ra))), new z7().d(p10); + if ("array" === A10) + return new z7().d(isb(h10, "" + h10.de + k10.oa, l10, w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/array"); + }; + }(h10, m10)))); + if ("number" === A10) + return t10 = ef(), v10 = "" + h10.de + k10.oa, p10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/number"); + }; + }(h10, m10), df() === t10 ? (t10 = PY(QY(), h10.se), t10 = Sd(t10, v10, h10.Qj), p10(t10), p10 = t10) : cf() === t10 ? (A10 = MY(NY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = hnb(h10, t10, v10, l10).CH()) : (A10 = UY(VY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = jnb(h10, t10, v10, l10).DH()), new z7().d(p10); + if ("integer" === A10) + return t10 = Fe(), v10 = "" + h10.de + k10.oa, p10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/integer"); + }; + }(h10, m10), df() === t10 ? (t10 = PY(QY(), h10.se), t10 = Sd(t10, v10, h10.Qj), p10(t10), p10 = t10) : cf() === t10 ? (A10 = MY(NY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = hnb(h10, t10, v10, l10).CH()) : (A10 = UY(VY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = jnb(h10, t10, v10, l10).DH()), new z7().d(p10); + if ("string" === A10) + return t10 = Ee4(), v10 = "" + h10.de + k10.oa, p10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/string"); + }; + }(h10, m10), df() === t10 ? (t10 = PY(QY(), h10.se), t10 = Sd(t10, v10, h10.Qj), p10(t10), p10 = t10) : cf() === t10 ? (A10 = MY(NY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = hnb(h10, t10, v10, l10).CH()) : (A10 = UY(VY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = jnb(h10, t10, v10, l10).DH()), new z7().d(p10); + if ("boolean" === A10) + return t10 = Pe2(), v10 = "" + h10.de + k10.oa, p10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/boolean"); + }; + }(h10, m10), df() === t10 ? (t10 = PY(QY(), h10.se), t10 = Sd(t10, v10, h10.Qj), p10(t10), p10 = t10) : cf() === t10 ? (A10 = MY(NY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = hnb(h10, t10, v10, l10).CH()) : (A10 = UY(VY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = jnb(h10, t10, v10, l10).DH()), new z7().d(p10); + if ("null" === A10) + return t10 = df(), v10 = "" + h10.de + k10.oa, p10 = /* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Rd(Y10, L10.j + "/nil"); + }; + }(h10, m10), df() === t10 ? (t10 = PY(QY(), h10.se), t10 = Sd(t10, v10, h10.Qj), p10(t10), p10 = t10) : cf() === t10 ? (A10 = MY(NY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = hnb(h10, t10, v10, l10).CH()) : (A10 = UY(VY(), h10.se), v10 = Sd(A10, v10, h10.Qj), p10(v10), p10 = jnb(h10, t10, v10, l10).DH()), new z7().d(p10); + if ("any" === A10) + return p10 = "" + h10.de + k10.oa, t10 = wpa(ypa(), h10.se), p10 = Sd(t10, p10, h10.Qj), Rd(p10, m10.j + "/any"), new z7().d(Wib(h10, p10, l10).Xi()); + p10 = h10.ra; + t10 = sg().jY; + v10 = m10.j; + A10 = "Invalid type for disjointUnion " + A10; + var D10 = ac(new M6().W(h10.ie), "type").c().i, C10 = y7(); + ec(p10, t10, v10, C10, A10, D10.da); + return y7(); + } + t10 = p10.hb().gb; + v10 = Q5().sa; + if (t10 === v10) + return wD(), T6(), t10 = "union_member_" + k10.oa, p10 = pG(0, mh(T6(), t10), p10), nX(pX(), p10, w6(/* @__PURE__ */ function(I10, L10) { + return function(Y10) { + Y10.ub(L10.j, lt2()); + }; + }(h10, m10)), h10.Nj, h10.ra).Cc(); + t10 = h10.ra; + v10 = sg().jY; + A10 = m10.j; + p10 = "Invalid type for disjointUnion " + p10.hb().gb; + D10 = ac(new M6().W(h10.ie), "type").c().i; + C10 = y7(); + ec(t10, v10, A10, C10, p10, D10.da); + return y7(); + }; + }(a10, e10, c10, b10)); + e10 = rw(); + c10 = f10.ka(c10, e10.sc); + a10 = new cdb().Ux(a10); + e10 = rw(); + a10 = c10.ec(a10, e10.sc); + a10.Da() && (c10 = xn().Le, Bf(b10, c10, a10)); + return b10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + if (ac(new M6().W(this.ie), "type").na()) { + var a10 = ac(new M6().W(this.ie), "type").c().i; + var b10 = tw(); + a10 = a10.Qp(b10).pk().na(); + } else + a10 = false; + if (a10) { + if (this.Nj instanceof Qy) { + a10 = this.ra; + b10 = sg().mY; + var c10 = ac(new M6().W(this.ie), "type").c(), e10 = y7(); + ec(a10, b10, "", e10, "Value of field 'type' must be a string, multiple types are not supported", c10.da); + } + return new z7().d(jsb(this)); + } + a10 = this.Nj; + a10 = a10 instanceof zP && "parameter" === a10.Nca ? ff() : yx(); + b10 = ac(new M6().W(this.ie), "$ref"); + b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(QHa())); + if (b10.b()) + if (b10 = ac( + new M6().W(this.ie), + "type" + ), b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + c10 = b10.i; + e10 = bc(); + c10 = N6(c10, e10, this.ra).va; + e10 = ac(new M6().W(this.ie), "format"); + e10.b() ? e10 = y7() : (e10 = e10.c().i, e10 = jc(kc(e10), bc()), e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10.va))); + e10 = e10.b() ? "" : e10.c(); + Nka(); + var f10 = ff(); + e10 = "string" === c10 ? "time-only" === e10 ? Xe() : "date" === e10 ? Ye() : "date-only" === e10 ? Ye() : "date-time" === e10 ? Ue() : "date-time-only" === e10 ? We() : "password" === e10 ? De2() : "byte" === e10 ? Be3() : "binary" === e10 ? Ce() : Ee4() : "null" === c10 ? df() : "integer" === c10 ? "int64" === e10 ? Ge() : Fe() : "number" === c10 ? "float" === e10 ? Je() : "double" === e10 ? Ke() : ef() : "boolean" === c10 ? Pe2() : "object" === c10 ? $e2() : "array" === c10 ? Ze() : "file" === c10 ? cf() : f10; + f10 = ff(); + if (null !== e10 && e10 === f10) { + e10 = this.ra; + f10 = sg().mY; + c10 = "Invalid type " + c10; + b10 = b10.i; + var g10 = y7(); + ec(e10, f10, "", g10, c10, b10.da); + b10 = y7(); + } else + b10 = new z7().d(e10); + } + b10.b() && (b10 = ac(new M6().W(this.ie), "properties"), b10 = b10.b() ? ac(new M6().W(this.ie), "x-amf-merge") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "minProperties") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "maxProperties") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "dependencies") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "patternProperties") : b10, b10 = b10.b() ? ac( + new M6().W(this.ie), + "additionalProperties" + ) : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "discriminator") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "required") : b10, b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d($e2()))); + b10.b() && (b10 = ac(new M6().W(this.ie), "x-amf-union"), b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(zx()))); + b10.b() && (b10 = ac(new M6().W(this.ie), "items"), b10 = b10.b() ? ac(new M6().W(this.ie), "minItems") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "maxItems") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "uniqueItems") : b10, b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(Ze()))); + b10.b() && (b10 = ac(new M6().W(this.ie), "multipleOf"), b10 = b10.b() ? ac(new M6().W(this.ie), "minimum") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "maximum") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "exclusiveMinimum") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "exclusiveMaximum") : b10, b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(ef()))); + b10.b() && (b10 = ac(new M6().W(this.ie), "minLength"), b10 = b10.b() ? ac(new M6().W(this.ie), "maxLength") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "pattern") : b10, b10 = b10.b() ? ac(new M6().W(this.ie), "format") : b10, b10.b() ? b10 = y7() : (b10.c(), b10 = new z7().d(Ee4()))); + a10 = b10.b() ? a10 : b10.c(); + a10 = zx() === a10 ? new z7().d(this.xca()) : QHa() === a10 ? ksb(this) : $e2() === a10 ? new z7().d(lsb(this, this.de, this.ie, this.Wf)) : Ze() === a10 ? new z7().d(isb(this, this.de, this.ie, this.Wf)) : yx() === a10 ? new z7().d(hsb(this, this.de, this.ie, this.Wf)) : Lca(a10) ? new z7().d(msb(this, a10, this.de, this.ie, this.Wf)) : y7(); + if (a10 instanceof z7 && (b10 = a10.i, null !== b10)) + return this.Nj instanceof zP && Zz(this.ra, b10.j, this.ie, this.Nj.Nca), this.Nj instanceof Qy ? new z7().d(nsb(this, b10)) : new z7().d(b10); + if (y7() === a10) + return y7(); + throw new x7().d(a10); + }; + function lX(a10, b10, c10, e10, f10, g10, h10) { + a10.zT = b10; + a10.de = c10; + a10.ie = e10; + a10.Wf = f10; + a10.Nj = g10; + a10.ra = h10; + M22.prototype.fE.call(a10, h10); + if (b10 instanceof ve4) + c10 = b10.i; + else if (b10 instanceof ye4) + c10 = b10.i; + else + throw new x7().d(b10); + a10.se = c10; + b10 = new Bz().ln(b10).pk(); + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(Od(O7(), b10.Aa))); + a10.Qj = b10.b() ? (O7(), new P6().a()) : b10.c(); + a10.yna = "^(\\#\\/definitions\\/){1}([^/\\n])+$"; + a10.zna = "^(\\#\\/components\\/){1}((schemas|parameters|securitySchemes|requestBodies|responses|headers|examples|links|callbacks){1}\\/){1}([^/\\n])+"; + return a10; + } + d7.xca = function() { + return bjb(new r72(), this, this.zT, this.de).zP(); + }; + function ksb(a10) { + var b10 = ac(new M6().W(a10.ie), "$ref"); + if (b10.b()) + return y7(); + var c10 = b10.c(), e10 = c10.i.hb().gb; + if (Q5().nd === e10) + return y7(); + T6(); + var f10 = c10.i, g10 = a10.ra, h10 = Dd(), k10 = N6(f10, h10, g10); + var l10 = rA(), m10 = a10.ra.Gg(), p10 = Xq().Cp; + if (m10 === p10) { + var t10 = new qg().e(k10); + var v10 = Wp(t10, l10.T1); + } else { + var A10 = new qg().e(k10); + v10 = Wp(A10, l10.S1); + } + var D10 = fB(a10.ra.Qh, v10, Xs(), y7()); + if (D10 instanceof z7) { + var C10 = D10.i.Ug(v10, Od(O7(), a10.se)), I10 = Sd(C10, a10.de, a10.Qj), L10 = db().oe, Y10 = Bi(I10, L10, true); + a10.Wf.P(Y10); + return new z7().d(Y10); + } + var ia = pYa(a10.ra, k10); + if (ia instanceof z7 && null !== ia.i) + b: { + if (a10.ra.$U()) + var pa = k10, La = a10.ra.$U() ? v10 : k10; + else { + var ob = Pjb(a10.ra, a10.ra.qh, k10); + La = pa = ob; + } + var zb = pa, Zb = La, Cc = osb(a10.ra, zb); + if (Cc instanceof z7) { + var vc = Cc.i, id = Od(O7(), a10.se), yd = vc.Ug(zb, id), zd = a10.de; + O7(); + var rd = new P6().a(), sd = Sd(yd, zd, rd), le4 = db().oe, Vc = Bi(sd, le4, true); + a10.Wf.P(Vc); + var Sc = new z7().d(Vc); + } else { + if (y7() === Cc) { + var Qc = aSa(Rna(), zb, a10.ie); + O7(); + var $c = new P6().a(), Wc = Sd(Qc, Zb, $c), Qe = db().oe, Qd = Bi(Wc, Qe, true); + lB(Qd, Zb, c10, a10.ra); + Jb(Qd, a10.ra); + a10.Wf.P(Qd); + var me4 = a10.ra, of; + if (of = me4 instanceof mA || me4 instanceof lA) { + var Le2 = a10.ra; + if (Le2 instanceof mA) { + var Ve = a10.yna; + if (null === zb) + throw new sf().a(); + var he4 = tf(uf(), Ve, zb); + } else + he4 = false; + if (he4) + of = true; + else if (Le2 instanceof lA) { + var Wf = a10.zna; + if (null === zb) + throw new sf().a(); + of = tf(uf(), Wf, zb); + } else + of = false; + } + if (of) { + var vf = yRa(ARa(), a10.se), He = Sd(vf, a10.de, a10.Qj), Ff = jb(He, Qd), wf = db().ed; + eb(Ff, wf, zb); + a10.Wf.P(He); + Sc = new z7().d(He); + break b; + } + A8(a10.ra, zb, Qd); + var Re2 = pYa(a10.ra, k10); + if (Re2 instanceof z7) { + var we4 = Re2.i; + if (null !== we4) { + var ne4 = we4.ya(); + pX(); + wD(); + T6(); + var Me2 = a10.de, Se4 = nX(0, pG(0, mh(T6(), Me2), ne4), a10.Wf, a10.Nj, a10.ra).Cc(); + if (Se4.b()) + var xf = y7(); + else { + var ie3 = Se4.c(); + Eb(a10.ra.ni, Zb, ie3); + A8(a10.ra, zb, ie3); + if (a10.ra.$U() || "#" === zb) { + var gf = ie3.Ug(zb, Od(O7(), a10.se)), pf = a10.de; + O7(); + var hf = new P6().a(), Gf = Sd(gf, pf, hf); + } else + Gf = ie3; + xf = new z7().d(Gf); + } + Sc = xf.b() ? new z7().d(Qd) : xf; + break b; + } + } + if (y7() === Re2) { + Sc = new z7().d(Qd); + break b; + } + throw new x7().d(Re2); + } + throw new x7().d(Cc); + } + } + else + b: { + var yf = a10.ra.$U() ? v10 : k10, oe4 = Pjb(a10.ra, a10.ra.qh, k10), lg = false, bh = null, Qh = osb(a10.ra, oe4); + if (Qh instanceof z7) { + lg = true; + bh = Qh; + var af = bh.i; + if (af instanceof vi) { + var Pf = Od(O7(), a10.se), oh = af.Xa, ch = khb(af, Pf.Sp(Yi(O7(), oh))), Ie2 = db().ed, ug = eb(ch, Ie2, k10); + lB(ug, oe4, c10, a10.ra); + a10.Wf.P(ug); + Sc = new z7().d(ug); + break b; + } + } + if (lg) { + var Sg = bh.i, Tg = Od(O7(), a10.se), zh = Sg.Ug(k10, Tg), Rh = Sd(zh, a10.de, a10.Qj), vg = db().oe, dh = Bi(Rh, vg, true); + a10.Wf.P(dh); + Sc = new z7().d(dh); + } else { + var Jg = aSa(Rna(), oe4, c10); + O7(); + var Ah = new P6().a(), Bh = Sd(Jg, oe4, Ah).pc(oe4), cg = db().oe, Qf = Bi(Bh, cg, true); + lB(Qf, oe4, c10, a10.ra); + Jb(Qf, a10.ra); + a10.Wf.P(Qf); + A8(a10.ra, oe4, Qf); + var Kg = psb(a10.ra, oe4, a10.ra); + if (Kg.b()) + var Ne2 = y7(); + else { + var Xf = Kg.c(); + A8(a10.ra, oe4, Xf); + Eb(a10.ra.ni, oe4, Xf); + Ne2 = new z7().d(Xf); + } + if (y7() === Ne2) { + var di = lB(Qf, yf, c10, a10.ra), dg = db().oe; + Bi(di, dg, true); + Sc = new z7().d(Qf); + } else if (Ne2 instanceof z7) { + var Hf = Ne2.i; + if (a10.ra.Qh.ij.Ha(yf)) { + var wg = a10.ra.Qh, Lg = wg.ij.Ja(yf); + if (Lg instanceof z7) { + var jf = Lg.i, mg = wg.DP; + O7(); + var Mg = new P6().a(), Ng = new ql().K(new S6().a(), Mg), eg = jf.da, Oe4 = eg.b() ? oe4 : eg.c(), ng = Rd(Ng, Oe4), fg = jf.da, Ug = fg.b() ? oe4 : fg.c(), xg = Bq().uc, gg = eb(ng, xg, Ug), fe4 = Jk().nb, ge4 = Vd(gg, fe4, Hf), ph = K7(); + wg.DP = mg.yg(ge4, ph.u); + wg.ij = wg.ij.cc(new R6().M(yf, jD(new kD(), Hf, jf.da))); + } else { + var hg = wg.DP; + O7(); + var Jh = new P6().a(), fj = new ql().K(new S6().a(), Jh), yg = Rd( + fj, + oe4 + ), qh = Bq().uc, og = eb(yg, qh, oe4), rh = Jk().nb, Ch = Vd(og, rh, Hf), Vg = K7(); + wg.DP = hg.yg(Ch, Vg.u); + var Wg = wg.ij, Rf = jD(new kD(), Hf, y7()); + wg.ij = Wg.cc(new R6().M(yf, Rf)); + } + var Sh = Hf.Ug(yf, Od(O7(), a10.se)), zg = Sd(Sh, a10.de, a10.Qj), Ji = db().oe; + Sc = new z7().d(Bi(zg, Ji, true)); + } else + Sc = new z7().d(Hf); + } else + throw new x7().d(Ne2); + } + } + var Kh = Sc; + if (!Kh.b()) { + var Lh = Kh.c(); + a10.Wf.P(Lh); + } + return Kh; + } + d7.z = function() { + return X5(this); + }; + function nsb(a10, b10) { + var c10 = ac(new M6().W(a10.ie), "nullable"); + if (c10 instanceof z7) { + c10 = c10.i; + var e10 = jc(kc(c10.i), pM()); + if (e10.b() ? 0 : e10.c()) + return O7(), e10 = new P6().a(), e10 = new Vh().K(new S6().a(), e10), a10 = Sd(e10, a10.de, a10.Qj).pc(b10.j + "/nilUnion"), e10 = b10.fa(), ae4(), c10 = c10.Aa.da, e10.Lb(new U1().e(ce4(0, de4(ee4(), c10.rf, c10.If, c10.Yf, c10.bg)).t())), c10 = K7(), O7(), e10 = new P6().a(), e10 = new Th().K(new S6().a(), e10), b10 = [b10, Rd(e10, a10.j + "_nil")], b10 = J5(c10, new Ib().ha(b10)), c10 = xn().Le, Zd(a10, c10, b10), a10; + } + return b10; + } + function qma(a10) { + null === a10.HZ && null === a10.HZ && (a10.HZ = new K32().Ux(a10)); + } + d7.Gp = function() { + return this.ra; + }; + function lsb(a10, b10, c10, e10) { + if (ac(new M6().W(c10), jx(new je4().e("schema"))).na()) { + var f10 = DRa(FRa(), a10.se); + b10 = Sd(f10, b10, a10.Qj); + e10.P(b10); + return lnb(a10, b10, c10).Xi(); + } + f10 = yRa(ARa(), a10.se); + b10 = Sd(f10, b10, a10.Qj); + Yib(a10, b10, c10, e10, a10.ra.Qh.ku); + return ajb($ib(a10, b10, c10, a10.ra)); + } + function Yib(a10, b10, c10, e10, f10) { + e10.P(b10); + a10.Nj instanceof zP || a10.Nj instanceof Qy || (c10 = c10.Za.Ja((T6(), mh(T6(), "id"))), c10.b() || (c10 = c10.c(), e10 = Dd(), c10 = c10.Qp(e10).pk(), c10.b() || (c10 = c10.c(), Eb(f10, c10, b10), A8(a10.ra, c10, b10)))); + } + function msb(a10, b10, c10, e10, f10) { + if (df() === b10) + b10 = PY(QY(), a10.se), a10 = Sd(b10, c10, a10.Qj), f10.P(a10), f10 = a10; + else if (cf() === b10) { + var g10 = MY(NY(), a10.se); + c10 = Sd(g10, c10, a10.Qj); + f10.P(c10); + f10 = hnb(a10, b10, c10, e10).CH(); + } else + g10 = UY(VY(), a10.se), c10 = Sd(g10, c10, a10.Qj), f10.P(c10), f10 = jnb(a10, b10, c10, e10).DH(); + return f10; + } + d7.$classData = r8({ KNa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTypeParser", { KNa: 1, TY: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function qsb() { + yX.call(this); + this.So = this.je = this.gd = this.Mc = this.Gk = null; + } + qsb.prototype = new zX(); + qsb.prototype.constructor = qsb; + d7 = qsb.prototype; + d7.H = function() { + return "RamlFileShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.pC = function() { + return this.So; + }; + function d4a(a10, b10, c10, e10) { + var f10 = new qsb(); + f10.Gk = a10; + f10.Mc = b10; + f10.gd = c10; + f10.je = e10; + yX.prototype.Vx.call(f10, a10, b10, c10, e10); + f10.So = new z7().d("file"); + return f10; + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qsb) { + var b10 = this.Gk, c10 = a10.Gk; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Gk; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = J5(Ef(), yX.prototype.Pa.call(this)), b10 = this.Gk.aa; + nca(b10, a10, this.je); + var c10 = hd(b10, gn().OA); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $x("fileTypes", c10, this.Mc, false)))); + c10 = hd(b10, Fg().zl); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), fh(new je4().e("pattern")), oca(c10), y7())))); + c10 = hd(b10, Fg().wj); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), fh(new je4().e("minimum")), c10, y7())))); + c10 = hd(b10, Fg().vj); + c10.b() || (c10 = c10.c(), new z7().d(Dg(a10, $g(new ah(), fh(new je4().e("maximum")), c10, y7())))); + b10 = hd(b10, Fg().av); + b10.b() || (b10 = b10.c(), new z7().d(Dg( + a10, + $g(new ah(), fh(new je4().e("multipleOf")), b10, y7()) + ))); + (a10.b() || 1 === a10.vu && cs(this.Gk.aa, Ag().Ec).na()) && Dg(a10, cx(new dx(), "type", "file", Q5().Na, ld())); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ePa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlFileShapeEmitter", { ePa: 1, fD: 1, gD: 1, f: 1, Vy: 1, rha: 1, y: 1, v: 1, q: 1, o: 1 }); + function rsb() { + yX.call(this); + this.So = this.Nka = this.nq = this.lfa = this.WL = this.je = this.gd = this.Mc = this.Gk = null; + } + rsb.prototype = new zX(); + rsb.prototype.constructor = rsb; + d7 = rsb.prototype; + d7.H = function() { + return "RamlScalarShapeEmitter"; + }; + d7.E = function() { + return 3; + }; + d7.pC = function() { + return this.So; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rsb) { + var b10 = this.Gk, c10 = a10.Gk; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.Mc === a10.Mc) + return b10 = this.gd, a10 = a10.gd, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Gk; + case 1: + return this.Mc; + case 2: + return this.gd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Pa = function() { + var a10 = this.Gk.aa; + if (B6(this.Gk.aa, qf().xd).b()) { + var b10 = hd(a10, Fg().af); + if (b10.b()) + var c10 = y7(); + else if (c10 = b10.c(), wh(c10.r.x, q5(loa))) + c10 = y7(); + else { + it2(this.Gk.aa, qf().xd); + b10 = this.nq; + c10 = kr(wr(), c10.r.x, q5(jd)); + var e10 = Q5().Na; + c10 = new z7().d(cx(new dx(), "type", b10, e10, c10)); + } + } else + c10 = y7(); + b10 = J5(Ef(), yX.prototype.Pa.call(this)); + c10 = c10.ua(); + b10 = b10.yja().jh(c10); + nca(a10, b10, this.je); + c10 = hd(a10, Fg().zl); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "pattern", oca(c10), y7(), this.je)))); + c10 = hd(a10, Fg().wj); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "minimum", c10, new z7().d(Ula( + fy(), + this.WL + )))))); + c10 = hd(a10, Fg().vj); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, $g(new ah(), "maximum", c10, new z7().d(Ula(fy(), this.WL)))))); + c10 = hd(a10, Fg().av); + c10.b() || (c10 = c10.c(), new z7().d(Dg(b10, Yg(Zg(), "multipleOf", c10, new z7().d(Ula(fy(), this.WL)), this.je)))); + e10 = this.WL; + var f10 = this.Nka; + c10 = Zca(e10); + e10 = Ue() === e10 ? true : We() === e10 ? true : Xe() === e10 ? true : Ye() === e10; + c10 = c10 | e10 ? "format" : fh(new je4().e("format")); + var g10 = Nka().UU.dO(Nh().UU); + e10 = false; + var h10 = hd(a10, Fg().Fn); + b: { + if (h10 instanceof z7 && (h10 = h10.i, h10.r.r instanceof jh)) { + h10 = ka(h10.r.r.r); + g10.Ha(h10) ? g10 = f10 : (e10 = true, g10 = h10); + break b; + } + g10 = f10; + } + f10 = g10 !== f10 ? g10 : f10; + a10 = hd(a10, Fg().Fn); + b: { + if (a10 instanceof z7 && (a10 = a10.i, a10.r.r instanceof jh)) { + a10 = a10.r.x; + break b; + } + O7(); + a10 = new P6().a(); + } + g10 = new qg().e(f10); + tc(g10) && "float" !== f10 && "int32" !== f10 ? a10 = new z7().d(Iga(Kga(), c10, Fg().Fn, f10, a10)) : (g10 = new qg().e(f10), a10 = tc(g10) && ("float" === f10 || "int32" === f10) && e10 ? new z7().d(Iga(Kga(), c10, Fg().Fn, f10, a10)) : y7()); + ws(b10, a10.ua()); + return b10; + }; + function e4a(a10, b10, c10, e10) { + var f10 = new rsb(); + f10.Gk = a10; + f10.Mc = b10; + f10.gd = c10; + f10.je = e10; + yX.prototype.Vx.call(f10, a10, b10, c10, e10); + hz(); + b10 = B6(a10.aa, Fg().af).A; + f10.WL = Cma(0, b10.b() ? null : b10.c()); + b10 = mla(ola(), f10.WL, ni(a10).A); + if (null !== b10) + a10 = b10.ma(), b10 = b10.ya(), a10 = new R6().M(a10, b10); + else + throw new x7().d(b10); + f10.lfa = a10; + f10.nq = f10.lfa.ma(); + f10.Nka = f10.lfa.ya(); + Mpa || (Mpa = new JC().a()); + a10 = f10.WL; + Fe() === a10 || Ge() === a10 || Be3() === a10 || Ce() === a10 ? Q5() : Je() === a10 || Ke() === a10 || ef() === a10 ? Q5() : Pe2() === a10 ? Q5() : (Ue() === a10 || We() === a10 || Xe() === a10 || Ye(), Q5()); + f10.So = y7(); + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ DPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlScalarShapeEmitter", { DPa: 1, fD: 1, gD: 1, f: 1, Vy: 1, rha: 1, y: 1, v: 1, q: 1, o: 1 }); + function u4a() { + I22.call(this); + this.xV = this.Za = this.wa = null; + } + u4a.prototype = new J22(); + u4a.prototype.constructor = u4a; + d7 = u4a.prototype; + d7.H = function() { + return "AnyTypeShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof u4a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.zV = function() { + return this.xV; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ YPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$AnyTypeShapeParser", { YPa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, y: 1, v: 1, q: 1, o: 1 }); + function D4a() { + I22.call(this); + this.Za = this.wa = null; + } + D4a.prototype = new J22(); + D4a.prototype.constructor = D4a; + d7 = D4a.prototype; + d7.H = function() { + return "NilShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof D4a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ dQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$NilShapeParser", { dQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, y: 1, v: 1, q: 1, o: 1 }); + function L4a() { + I22.call(this); + this.eh = this.Za = this.wa = null; + } + L4a.prototype = new J22(); + L4a.prototype.constructor = L4a; + d7 = L4a.prototype; + d7.H = function() { + return "TupleShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof L4a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Za, a10.Za)) + return b10 = this.eh, a10 = a10.eh, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + case 2: + return this.eh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function K4a(a10) { + a10.eh.P(a10.wa); + I22.prototype.Xi.call(a10); + XFa(a10); + var b10 = new M6().W(a10.Za), c10 = a10.l, e10 = uh().Bq; + Gg(b10, "minItems", nh(Hg(Ig(c10, e10, a10.l.Nb()), a10.wa))); + b10 = new M6().W(a10.Za); + c10 = a10.l; + e10 = uh().pr; + Gg(b10, "maxItems", nh(Hg(Ig(c10, e10, a10.l.Nb()), a10.wa))); + b10 = new M6().W(a10.Za); + c10 = a10.l; + e10 = uh().qr; + Gg(b10, "uniqueItems", nh(Hg(Ig(c10, e10, a10.l.Nb()), a10.wa))); + b10 = ac(new M6().W(a10.Za), "items"); + if (y7() !== b10) + if (b10 instanceof z7) { + b10 = b10.i.i; + c10 = tw(); + b10 = N6(b10, c10, a10.l.Nb()).Cm; + c10 = new odb(); + e10 = rw(); + b10 = b10.ec(c10, e10.sc); + c10 = rw(); + b10 = b10.og(c10.sc); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + QW(); + T6(); + var l10 = qc(); + k10 = N6(k10, l10, g10.l.Nb()); + T6(); + return jPa(mr(T6(), k10, Q5().sa), "member" + h10, w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + return t10.ub(m10.wa.j + "/items/" + p10, lt2()); + }; + }(g10, h10)), vP(), g10.l.Nb()).Cc(); + } + throw new x7().d(h10); + }; + }(a10)); + e10 = rw(); + c10 = b10.ka(c10, e10.sc); + b10 = a10.wa; + c10 = c10.Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(a10))); + e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(a10)); + var f10 = rw(); + c10 = c10.ka(e10, f10.sc); + e10 = an().$p; + Zd(b10, e10, c10); + } else + throw new x7().d(b10); + return a10.wa; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ kQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$TupleShapeParser", { kQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, y: 1, v: 1, q: 1, o: 1 }); + function J4a() { + I22.call(this); + this.wa = this.Za = null; + } + J4a.prototype = new J22(); + J4a.prototype.constructor = J4a; + d7 = J4a.prototype; + d7.H = function() { + return "UnionShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof J4a && a10.l === this.l && Bj(this.Za, a10.Za)) { + var b10 = this.wa; + a10 = a10.wa; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Za; + case 1: + return this.wa; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.zP = function() { + I22.prototype.Xi.call(this); + var a10 = ac(new M6().W(this.Za), "anyOf"); + if (!a10.b()) { + a10 = a10.c(); + var b10 = a10.i, c10 = lc(); + b10 = Iw(b10, c10); + if (b10 instanceof ye4) { + b10 = b10.i; + c10 = K7(); + b10 = b10.og(c10.u); + c10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.Ki(); + return nD(g10.l.hQ(), (ue4(), new ye4().d(k10)), "item" + h10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + return p10.ub(l10.wa.j + "/items/" + m10, lt2()); + }; + }(g10, h10)), g10.l.kB.Lw, vP()).Cc(); + } + throw new x7().d(h10); + }; + }(this)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u).Cb(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.na(); + }; + }(this))); + c10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return g10.c(); + }; + }(this)); + e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = this.wa; + e10 = xn().Le; + a10 = Od(O7(), a10.i); + bs(c10, e10, b10, a10); + } else { + b10 = this.l.Nb(); + c10 = Wd().dN; + e10 = this.wa.j; + var f10 = y7(); + ec(b10, c10, e10, f10, "Unions are built from multiple shape nodes", a10.da); + } + } + return this.wa; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ mQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$UnionShapeParser", { mQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, y: 1, v: 1, q: 1, o: 1 }); + function Urb() { + K22.call(this); + this.je = this.MD = null; + } + Urb.prototype = new HYa(); + Urb.prototype.constructor = Urb; + d7 = Urb.prototype; + d7.H = function() { + return "Oas2DocumentEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Urb) { + var b10 = this.MD; + a10 = a10.MD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.MD; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.FK = function(a10, b10) { + this.MD = a10; + this.je = b10; + K22.prototype.FK.call(this, a10, b10); + return this; + }; + d7.Rea = function(a10) { + UUa(a10, "swagger", mr(T6(), nr(or(), "2.0"), Q5().Na)); + }; + d7.z = function() { + return X5(this); + }; + d7.Lj = function() { + return this.je; + }; + d7.$classData = r8({ QTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas2DocumentEmitter", { QTa: 1, m7: 1, UR: 1, f: 1, QR: 1, SY: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xrb() { + K22.call(this); + this.je = this.MD = null; + } + Xrb.prototype = new HYa(); + Xrb.prototype.constructor = Xrb; + d7 = Xrb.prototype; + d7.H = function() { + return "Oas3DocumentEmitter"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Xrb) { + var b10 = this.MD; + a10 = a10.MD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.MD; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.FK = function(a10, b10) { + this.MD = a10; + this.je = b10; + K22.prototype.FK.call(this, a10, b10); + return this; + }; + d7.Xqa = function(a10, b10) { + var c10 = K7(), e10 = new Kkb(); + e10.Qc = a10; + e10.p = b10; + if (null === this) + throw mb(E6(), null); + e10.l = this; + return J5(c10, new Ib().ha([e10])); + }; + d7.Rea = function(a10) { + UUa(a10, "openapi", mr(T6(), nr(or(), "3.0.0"), Q5().Na)); + }; + d7.z = function() { + return X5(this); + }; + d7.Lj = function() { + return this.je; + }; + d7.$classData = r8({ TTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3DocumentEmitter", { TTa: 1, m7: 1, UR: 1, f: 1, QR: 1, SY: 1, y: 1, v: 1, q: 1, o: 1 }); + function ecb() { + M22.call(this); + this.ra = this.ee = null; + } + ecb.prototype = new MYa(); + ecb.prototype.constructor = ecb; + d7 = ecb.prototype; + d7.H = function() { + return "OasModuleParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ecb) { + var b10 = this.ee; + a10 = a10.ee; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ee; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.rca = function() { + var a10 = Y1(new Z1(), this.ra.Gg()), b10 = Od(O7(), this.ee.$g.Xd); + b10 = new bg().K(new S6().a(), b10); + var c10 = this.ee.da, e10 = Bq().uc; + b10 = eb(b10, e10, c10); + c10 = this.ee.da; + J5(K7(), H10()); + b10 = Ai(b10, c10); + a10 = Cb(b10, a10); + b10 = Bq().uc; + eb(a10, b10, this.ee.da); + b10 = jc(kc(this.ee.$g.Xd), qc()); + b10.b() || (c10 = b10.c(), b10 = pz(qz(a10, jx(new je4().e("uses")), c10, this.ee.Q, this.ra), this.ee.da), new W32().Tx(this.ee, this.ra).rA(this.ee, c10), h6a(this, c10, a10).hd(), c10 = this.ra.Qh.et(), c10.Da() && (e10 = Af().Ic, Bf(a10, e10, c10)), tc(b10.Q) && (b10 = O4a(b10), c10 = Gk().xc, Bf(a10, c10, b10))); + return a10; + }; + d7.Tx = function(a10, b10) { + this.ee = a10; + this.ra = b10; + M22.prototype.fE.call(this, b10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.$classData = r8({ RUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasModuleParser", { RUa: 1, TY: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function qcb() { + GP.call(this); + this.ra = this.vO = this.ee = null; + } + qcb.prototype = new N22(); + qcb.prototype.constructor = qcb; + d7 = qcb.prototype; + d7.H = function() { + return "RamlFragmentParser"; + }; + function pcb(a10) { + var b10 = a10.ee.$g.Xd, c10 = qc(); + b10 = kx(b10).Qp(c10); + if (b10 instanceof ye4) + c10 = b10.i; + else { + b10 = a10.vO; + c10 = tx(); + if (null === b10 || !b10.h(c10)) { + b10 = a10.ra; + c10 = sg().Oy; + var e10 = a10.ee.da, f10 = a10.ee.$g.Xd, g10 = y7(); + ec(b10, c10, e10, g10, "Cannot parse empty map", f10.da); + } + c10 = ur().ce; + } + Lma || (Lma = new oz().a()); + e10 = Kma(c10, a10.ee, a10.ra); + if (null === e10) + throw new x7().d(e10); + b10 = e10.ma(); + e10 = e10.ya(); + f10 = tr(ur(), c10.sb.Cb(w6(/* @__PURE__ */ function(m10) { + return function(p10) { + var t10 = p10.Aa, v10 = bc(); + return "usage" !== N6(t10, v10, m10.ra).va ? (p10 = p10.Aa, t10 = bc(), "uses" !== N6(p10, t10, m10.ra).va) : false; + }; + }(a10))), a10.ee.da); + g10 = a10.vO; + Ska().h(g10) ? f10 = new z7().d(new f7a().Fw( + a10, + f10 + ).Cca()) : Tka().h(g10) ? f10 = new z7().d(new e7a().Fw(a10, f10).Bca()) : Uka().h(g10) ? f10 = new z7().d(new h7a().Fw(a10, f10).Dca()) : Vka().h(g10) ? f10 = new z7().d(new j7a().Fw(a10, f10).Fca()) : Wka().h(g10) ? f10 = new z7().d(new d7a().Fw(a10, f10).Aca()) : Xka().h(g10) ? f10 = new z7().d(new i7a().Fw(a10, f10).Eca()) : tx().h(g10) ? (f10 = new g7a().Fw(a10, f10), f10 = new z7().d(ssb(f10.l))) : f10 = y7(); + if (f10 instanceof z7) { + f10 = f10.i; + g10 = ac(new M6().W(c10), "usage"); + if (!g10.b()) { + var h10 = g10.c(); + g10 = Jk().ae; + var k10 = h10.i, l10 = Dd(); + k10 = ih(new jh(), N6(k10, l10, a10.ra), Od(O7(), h10.i)); + h10 = Od(O7(), h10.i); + Rg(f10, g10, k10, h10); + } + g10 = a10.ee.da; + h10 = Bq().uc; + eb( + f10, + h10, + g10 + ); + n7a(a10, c10, f10).hd(); + a10 = Od(O7(), a10.ee.$g.Xd); + Db(f10, a10); + e10.na() && f10.fa().Lb(e10.c()); + a10 = f10.qe(); + c10 = Y1(new Z1(), Pb()); + Cb(a10, c10); + tc(b10.Q) && (a10 = O4a(b10), b10 = Gk().xc, Bf(f10, b10, a10)); + return new z7().d(f10); + } + return y7(); + } + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qcb) { + var b10 = this.ee, c10 = a10.ee; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.vO, a10 = a10.vO, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ee; + case 1: + return this.vO; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function ssb(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Mk().K(new S6().a(), b10); + var c10 = a10.ee.da, e10 = Bq().uc; + b10 = eb(b10, e10, c10); + b10 = Rd(b10, a10.ee.da); + O7(); + c10 = new P6().a(); + c10 = new Pk().K(new S6().a(), c10); + e10 = a10.ee.xe; + var f10 = Ok().Rd; + c10 = eb(c10, f10, e10); + a10 = a10.ee.OB; + e10 = Ok().Nd; + a10 = eb(c10, e10, a10); + c10 = Jk().nb; + return Vd(b10, c10, a10); + } + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.$classData = r8({ SVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlFragmentParser", { SVa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function nR() { + this.Lz = null; + this.lj = 0; + this.l = this.TD = null; + } + nR.prototype = new u7(); + nR.prototype.constructor = nR; + d7 = nR.prototype; + d7.Ar = function(a10, b10) { + Dg(this.TD, Xb(b10.tt, Yb().qb, "", y7(), "", y7(), y7(), "")); + }; + d7.H = function() { + return "PayloadErrorHandler"; + }; + d7.E = function() { + return 0; + }; + d7.h = function(a10) { + return a10 instanceof nR && a10.l === this.l && true; + }; + d7.yB = function(a10, b10) { + var c10 = this.TD; + a10 = Hb(a10.mv); + Dg(c10, Xb(a10, Yb().qb, "", y7(), "", y7(), y7(), "")); + return b10; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.Ns = function(a10, b10, c10, e10, f10, g10) { + a10 = a10.j; + var h10 = Yb().dh; + EU(this, a10, b10, c10, e10, f10, h10, g10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Gc = function(a10, b10, c10, e10, f10, g10, h10) { + EU(this, a10, b10, c10, e10, f10, g10, h10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ eYa: 0 }, false, "amf.plugins.document.webapi.validation.remote.PlatformPayloadValidator$PayloadErrorHandler", { eYa: 1, f: 1, a7: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1 }); + function tsb(a10) { + var b10 = new xc().yd(xm()), c10 = F6().Ta; + a10.W8(rb(new sb(), b10, G5(c10, "payload"), tb(new ub(), vb().Ta, "payload", "Payload for a Request/Response", H10()))); + b10 = Jn(); + c10 = F6().Tb; + a10.U8(rb(new sb(), b10, G5(c10, "correlationId"), tb(new ub(), vb().Tb, "correlationId", "an identifier that can be used for message tracing and correlation", H10()))); + b10 = qb(); + c10 = F6().Tb; + a10.V8(rb(new sb(), b10, G5(c10, "displayName"), tb(new ub(), vb().Tb, "displayName", "a display name for the request/response", H10()))); + b10 = qb(); + c10 = F6().Tb; + a10.Y8(rb(new sb(), b10, G5(c10, "title"), tb( + new ub(), + vb().Tb, + "title", + "a title for the request/response", + H10() + ))); + b10 = qb(); + c10 = F6().Tb; + a10.X8(rb(new sb(), b10, G5(c10, "summary"), tb(new ub(), vb().Tb, "summary", "Human readable short description of the request/response", H10()))); + b10 = new xc().yd(yZ()); + c10 = F6().Jb; + a10.T8(rb(new sb(), b10, G5(c10, "binding"), tb(new ub(), vb().Jb, "binding", "Bindings for this request/response", H10()))); + } + function usb() { + this.wd = this.bb = this.mc = this.qa = this.ba = this.Hf = null; + this.xa = 0; + } + usb.prototype = new u7(); + usb.prototype.constructor = usb; + d7 = usb.prototype; + d7.a = function() { + vsb = this; + Cr(this); + uU(this); + var a10 = qb(), b10 = F6().Jb; + this.Hf = rb(new sb(), a10, G5(b10, "type"), tb(new ub(), vb().Jb, "type", "empty binding for a corresponding known type", H10())); + a10 = F6().Jb; + a10 = G5(a10, "EmptyBinding"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Jb, "EmptyBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.Hf], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + return c10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Ho().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ P_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.EmptyBindingModel$", { P_a: 1, f: 1, s7: 1, pd: 1, hc: 1, Rb: 1, rc: 1, VY: 1, mJ: 1, VR: 1 }); + var vsb = void 0; + function Bea() { + vsb || (vsb = new usb().a()); + return vsb; + } + function wsb() { + this.wd = this.bb = this.mc = this.Va = this.Zc = this.Zo = this.Dq = this.Tl = this.Tf = this.qa = this.g = this.ba = this.la = this.Oh = this.Al = this.Hf = this.R = null; + this.xa = 0; + } + wsb.prototype = new u7(); + wsb.prototype.constructor = wsb; + d7 = wsb.prototype; + d7.a = function() { + xsb = this; + Cr(this); + uU(this); + pb(this); + Laa(this); + hda(this); + var a10 = qb(), b10 = F6().Tb; + b10 = G5(b10, "name"); + var c10 = vb().Tb, e10 = K7(), f10 = F6().Tb; + this.R = rb(new sb(), a10, b10, tb(new ub(), c10, "name", "Name for the security scheme", J5(e10, new Ib().ha([ic(G5(f10, "name"))])))); + a10 = qb(); + b10 = F6().dc; + this.Hf = rb(new sb(), a10, G5(b10, "type"), tb(new ub(), vb().dc, "type", "Type of security scheme", H10())); + a10 = new xc().yd(Dm()); + b10 = F6().Ta; + this.Al = rb(new sb(), a10, G5(b10, "response"), tb(new ub(), vb().Ta, "response", "Response associated to this security scheme", H10())); + a10 = Nm(); + b10 = F6().dc; + this.Oh = rb(new sb(), a10, G5(b10, "settings"), tb(new ub(), vb().dc, "settings", "Security scheme settings", H10())); + this.la = this.R; + a10 = F6().dc; + a10 = G5(a10, "SecurityScheme"); + b10 = nc().ba; + this.ba = ji(a10, b10); + ii(); + a10 = [this.R, this.Hf, this.Zc, this.Va, this.Tf, this.Tl, this.Al, this.Oh, this.Dq]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().dc, "Security Scheme", "Authentication and access control mechanism defined in an API", H10()); + return this; + }; + d7.b9 = function(a10) { + this.Zo = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.G8 = function(a10) { + this.Zc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Z8 = function(a10) { + this.Tf = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new vm().K(b10, a10); + }; + d7.$8 = function(a10) { + this.Tl = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.a9 = function(a10) { + this.Dq = a10; + }; + d7.$classData = r8({ k0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.security.SecuritySchemeModel$", { k0a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, sk: 1, Bga: 1, Dha: 1 }); + var xsb = void 0; + function Xh() { + xsb || (xsb = new wsb().a()); + return xsb; + } + function ysb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.la = this.Aj = this.SC = this.qa = this.ba = null; + this.xa = 0; + } + ysb.prototype = new u7(); + ysb.prototype.constructor = ysb; + d7 = ysb.prototype; + d7.a = function() { + zsb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + ihb(this); + var a10 = F6().Ta; + a10 = G5(a10, "ResourceType"); + var b10 = kP().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Resource Type", "Type of document base unit encoding a RAML resource type", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.J8 = function(a10) { + this.la = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return hhb(this); + }; + d7.H8 = function(a10) { + this.SC = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Vm().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.I8 = function(a10) { + this.Aj = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ o0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.templates.ResourceTypeModel$", { o0a: 1, f: 1, Cga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1, sk: 1 }); + var zsb = void 0; + function vea() { + zsb || (zsb = new ysb().a()); + return zsb; + } + function Asb() { + this.wd = this.bb = this.mc = this.R = this.Va = this.la = this.Aj = this.SC = this.qa = this.ba = null; + this.xa = 0; + } + Asb.prototype = new u7(); + Asb.prototype.constructor = Asb; + d7 = Asb.prototype; + d7.a = function() { + Bsb = this; + Cr(this); + uU(this); + wb(this); + pb(this); + ihb(this); + var a10 = F6().Ta; + a10 = G5(a10, "Trait"); + var b10 = kP().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Trait", "Type of document base unit encoding a RAML trait", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.J8 = function(a10) { + this.la = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return hhb(this); + }; + d7.H8 = function(a10) { + this.SC = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Tm().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.I8 = function(a10) { + this.Aj = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ p0a: 0 }, false, "amf.plugins.domain.webapi.metamodel.templates.TraitModel$", { p0a: 1, f: 1, Cga: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, nm: 1, sk: 1 }); + var Bsb = void 0; + function uea() { + Bsb || (Bsb = new Asb().a()); + return Bsb; + } + function Nl() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Nl.prototype = new u7(); + Nl.prototype.constructor = Nl; + d7 = Nl.prototype; + d7.H = function() { + return "License"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Nl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Ml(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return "/license"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return Ml().R; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ w0a: 0 }, false, "amf.plugins.domain.webapi.models.License", { w0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ul() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Ul.prototype = new u7(); + Ul.prototype.constructor = Ul; + d7 = Ul.prototype; + d7.H = function() { + return "Organization"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ul ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Tl(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + return "/organization"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return Tl().R; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ A0a: 0 }, false, "amf.plugins.domain.webapi.models.Organization", { A0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function GZ() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + GZ.prototype = new u7(); + GZ.prototype.constructor = GZ; + d7 = GZ.prototype; + d7.H = function() { + return "Tag"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof GZ ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return dj(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.g, dj().R).A; + a10 = a10.b() ? "default-type" : a10.c(); + a10 = new je4().e(a10); + return "/tag/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return dj().R; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ J0a: 0 }, false, "amf.plugins.domain.webapi.models.Tag", { J0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function Eo() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Eo.prototype = new u7(); + Eo.prototype.constructor = Eo; + d7 = Eo.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Eo().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Do(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Do().Hf).A; + a10 = a10.b() ? "dynamic-binding" : a10.c(); + a10 = new je4().e(a10); + return jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Eo().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ O0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.DynamicBinding", { O0a: 1, f: 1, qd: 1, vc: 1, tc: 1, Lha: 1, rg: 1, u7: 1, YR: 1, XR: 1 }); + function Ho() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Ho.prototype = new u7(); + Ho.prototype.constructor = Ho; + d7 = Ho.prototype; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new Ho().K(b10, a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Bea(); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Do().Hf).A; + a10 = a10.b() ? "empty-binding" : a10.c(); + a10 = new je4().e(a10); + return jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Ho().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ P0a: 0 }, false, "amf.plugins.domain.webapi.models.bindings.EmptyBinding", { P0a: 1, f: 1, qd: 1, vc: 1, tc: 1, Lha: 1, rg: 1, u7: 1, YR: 1, XR: 1 }); + function bR() { + Om.call(this); + } + bR.prototype = new WYa(); + bR.prototype.constructor = bR; + d7 = bR.prototype; + d7.H = function() { + return "ApiKeySettings"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof bR ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return aR(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/api-key"; + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + Om.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ d1a: 0 }, false, "amf.plugins.domain.webapi.models.security.ApiKeySettings", { d1a: 1, mN: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function r1() { + Om.call(this); + } + r1.prototype = new WYa(); + r1.prototype.constructor = r1; + d7 = r1.prototype; + d7.H = function() { + return "HttpSettings"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof r1 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return F32(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/http"; + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + Om.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ e1a: 0 }, false, "amf.plugins.domain.webapi.models.security.HttpSettings", { e1a: 1, mN: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function q1() { + Om.call(this); + } + q1.prototype = new WYa(); + q1.prototype.constructor = q1; + d7 = q1.prototype; + d7.H = function() { + return "OAuth1Settings"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof q1 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return vZ(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/oauth1"; + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + Om.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ f1a: 0 }, false, "amf.plugins.domain.webapi.models.security.OAuth1Settings", { f1a: 1, mN: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function wE() { + Om.call(this); + } + wE.prototype = new WYa(); + wE.prototype.constructor = wE; + d7 = wE.prototype; + d7.H = function() { + return "OAuth2Settings"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof wE ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return xE(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/oauth2"; + }; + function oHa(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Km().K(new S6().a(), b10); + var c10 = xE().Ap; + ig(a10, c10, b10); + return b10; + } + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + Om.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ i1a: 0 }, false, "amf.plugins.domain.webapi.models.security.OAuth2Settings", { i1a: 1, mN: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function uE() { + Om.call(this); + } + uE.prototype = new WYa(); + uE.prototype.constructor = uE; + d7 = uE.prototype; + d7.H = function() { + return "OpenIdConnectSettings"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof uE ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return vE(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "/settings/open-id-connect"; + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + Om.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ j1a: 0 }, false, "amf.plugins.domain.webapi.models.security.OpenIdConnectSettings", { j1a: 1, mN: 1, f: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function jm() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + jm.prototype = new u7(); + jm.prototype.constructor = jm; + d7 = jm.prototype; + d7.H = function() { + return "ParametrizedSecurityScheme"; + }; + d7.mQ = function() { + O7(); + var a10 = new P6().a(); + a10 = new bR().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.cX = function() { + O7(); + var a10 = new P6().a(); + a10 = new q1().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof jm ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return im(); + }; + d7.aX = function() { + O7(); + var a10 = new P6().a(); + a10 = new Om().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + var a10 = B6(this.g, im().R).A; + a10 = a10.b() ? "default-parametrized" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.pQ = function() { + O7(); + var a10 = new P6().a(); + a10 = new wE().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.I3 = function() { + O7(); + var a10 = new P6().a(); + a10 = new r1().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.J3 = function() { + O7(); + var a10 = new P6().a(); + a10 = new uE().K(new S6().a(), a10); + var b10 = im().Oh; + Vd(this, b10, a10); + return a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.$classData = r8({ k1a: 0 }, false, "amf.plugins.domain.webapi.models.security.ParametrizedSecurityScheme", { k1a: 1, f: 1, qd: 1, vc: 1, tc: 1, Nha: 1, y: 1, v: 1, q: 1, o: 1 }); + function XS() { + CF.call(this); + this.Tn = this.H1 = null; + } + XS.prototype = new Y8a(); + XS.prototype.constructor = XS; + d7 = XS.prototype; + d7.H = function() { + return "DuplicateKeyException"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof XS && this.H1 === a10.H1) { + var b10 = this.Tn; + a10 = a10.Tn; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.iE = function(a10, b10) { + this.H1 = a10; + this.Tn = b10; + CF.prototype.Ge.call(this, "Duplicate key : '" + a10 + "'", b10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.H1; + case 1: + return this.Tn; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ F4a: 0 }, false, "org.yaml.model.DuplicateKeyException", { F4a: 1, $Y: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function qM() { + CF.call(this); + this.Tn = this.Lu = null; + } + qM.prototype = new Y8a(); + qM.prototype.constructor = qM; + d7 = qM.prototype; + d7.H = function() { + return "LexerException"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qM && this.Lu === a10.Lu) { + var b10 = this.Tn; + a10 = a10.Tn; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.iE = function(a10, b10) { + this.Lu = a10; + this.Tn = b10; + CF.prototype.Ge.call(this, "Syntax error in the following text: '" + a10 + "'", b10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lu; + case 1: + return this.Tn; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ J4a: 0 }, false, "org.yaml.model.LexerException", { J4a: 1, $Y: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function kH() { + CF.call(this); + this.Tn = this.Lu = this.k3 = null; + } + kH.prototype = new Y8a(); + kH.prototype.constructor = kH; + d7 = kH.prototype; + d7.H = function() { + return "ParseException"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof kH && this.k3 === a10.k3 && this.Lu === a10.Lu) { + var b10 = this.Tn; + a10 = a10.Tn; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k3; + case 1: + return this.Lu; + case 2: + return this.Tn; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + function Cua(a10, b10, c10) { + var e10 = new kH(); + e10.k3 = a10; + e10.Lu = b10; + e10.Tn = c10; + CF.prototype.Ge.call(e10, "Cannot parse '" + b10 + "' with tag '" + a10 + "'", c10); + return e10; + } + d7.$classData = r8({ P4a: 0 }, false, "org.yaml.model.ParseException", { P4a: 1, $Y: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function OS() { + CF.call(this); + this.Tn = this.Lu = null; + } + OS.prototype = new Y8a(); + OS.prototype.constructor = OS; + d7 = OS.prototype; + d7.H = function() { + return "ParserException"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof OS && this.Lu === a10.Lu) { + var b10 = this.Tn; + a10 = a10.Tn; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.iE = function(a10, b10) { + this.Lu = a10; + this.Tn = b10; + CF.prototype.Ge.call(this, "Syntax error : " + a10, b10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Lu; + case 1: + return this.Tn; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ Q4a: 0 }, false, "org.yaml.model.ParserException", { Q4a: 1, $Y: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function ZS() { + CF.call(this); + this.Tn = this.M_ = null; + } + ZS.prototype = new Y8a(); + ZS.prototype.constructor = ZS; + d7 = ZS.prototype; + d7.H = function() { + return "UndefinedAnchorException"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ZS && this.M_ === a10.M_) { + var b10 = this.Tn; + a10 = a10.Tn; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.iE = function(a10, b10) { + this.M_ = a10; + this.Tn = b10; + CF.prototype.Ge.call(this, "Undefined anchor : '" + a10 + "'", b10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.M_; + case 1: + return this.Tn; + default: + throw new U6().e("" + a10); + } + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ T4a: 0 }, false, "org.yaml.model.UndefinedAnchorException", { T4a: 1, $Y: 1, wi: 1, wg: 1, bf: 1, f: 1, o: 1, y: 1, v: 1, q: 1 }); + function sM() { + this.aQ = this.z0 = null; + } + sM.prototype = new oZa(); + sM.prototype.constructor = sM; + d7 = sM.prototype; + d7.H = function() { + return "YFail"; + }; + d7.E = function() { + return 1; + }; + d7.h = function() { + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.z0; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qp = function() { + ue4(); + return new ve4().d(this.z0); + }; + d7.o1 = function(a10) { + this.z0 = a10; + this.aQ = Q5().Hq; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.cQ = function() { + throw new Hj().a(); + }; + d7.$classData = r8({ h5a: 0 }, false, "org.yaml.model.YFail", { h5a: 1, y5a: 1, f: 1, oJ: 1, $A: 1, Qoa: 1, y: 1, v: 1, q: 1, o: 1 }); + function rM() { + this.aQ = this.Fd = null; + } + rM.prototype = new oZa(); + rM.prototype.constructor = rM; + d7 = rM.prototype; + d7.H = function() { + return "YSuccess"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (a10 instanceof sM) + return false; + if (lua(a10)) { + var b10 = this.Fd; + a10 = a10.cQ(); + return Bj(b10, a10); + } + if (a10 instanceof k_) + return Bj(a10, this); + throw new x7().d(a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fd; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return this.Fd.t(); + }; + d7.wU = function(a10) { + this.Fd = a10; + this.aQ = a10.hb().gb; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.cQ = function() { + return this.Fd; + }; + d7.$classData = r8({ F5a: 0 }, false, "org.yaml.model.YSuccess", { F5a: 1, y5a: 1, f: 1, oJ: 1, $A: 1, Qoa: 1, y: 1, v: 1, q: 1, o: 1 }); + function B8() { + Ik.call(this); + this.xp = null; + } + B8.prototype = new Agb(); + B8.prototype.constructor = B8; + d7 = B8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + B8.prototype.Xz.call(this, new mf().K(new S6().a(), a10)); + return this; + }; + d7.MC = function() { + return this.xp; + }; + d7.$k = function() { + return this.xp; + }; + d7.R$ = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new mf().K(new S6().a(), b10); + PH(); + PH().jr(); + a10 = a10.Oc(); + var c10 = Jk().nb; + B8.prototype.Xz.call(this, Vd(b10, c10, a10)); + }; + d7.Be = function() { + return this.xp; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.xp; + }; + d7.Wr = function() { + return this.xp; + }; + d7.Xz = function(a10) { + this.xp = a10; + Ik.prototype.Xz.call(this, a10); + return this; + }; + d7.oc = function() { + return this.xp; + }; + B8.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(B8.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + B8.prototype.$classData = r8({ C6a: 0 }, false, "webapi.WebApiDocument", { C6a: 1, eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, aw: 1 }); + function eH() { + this.Xl = null; + } + eH.prototype = new aWa(); + eH.prototype.constructor = eH; + d7 = eH.prototype; + d7.oja = function() { + return this.Xl.gH() << 24 >> 24; + }; + d7.h = function(a10) { + if (a10 instanceof eH) + return 0 === fZa(this.Xl, a10.Xl); + if ("number" === typeof a10) { + a10 = +a10; + var b10 = this.Xl; + b10 = Yra(CE(), b10); + if (53 >= b10) + b10 = true; + else { + var c10 = gZa(this.Xl); + b10 = 1024 >= b10 && c10 >= (-53 + b10 | 0) && 1024 > c10; + } + return b10 && !Csb(this) ? (b10 = this.Xl, Oj(va(), Mj(Nj(), b10)) === a10) : false; + } + return na(a10) ? (a10 = +a10, b10 = this.Xl, b10 = Yra(CE(), b10), 24 >= b10 ? b10 = true : (c10 = gZa(this.Xl), b10 = 128 >= b10 && c10 >= (-24 + b10 | 0) && 128 > c10), b10 && !Csb(this) ? (b10 = this.Xl, b10 = Mj(Nj(), b10), da(Oj(va(), b10)) === a10) : false) : Dsb(this) && Bda(this, a10); + }; + function Csb(a10) { + a10 = osa(a10.Xl, 2147483647); + return 0 !== a10.ri && !a10.h(Lj().ypa); + } + d7.t = function() { + var a10 = this.Xl; + return Mj(Nj(), a10); + }; + d7.tr = function(a10) { + return fZa(this.Xl, a10.Xl); + }; + d7.gs = function(a10) { + return fZa(this.Xl, a10.Xl); + }; + d7.Upa = function() { + return this.Xl.gH() << 16 >> 16; + }; + d7.z = function() { + if (Dsb(this)) { + var a10 = this.Xl.rba(); + var b10 = a10.od; + a10 = a10.Ud; + b10 = (-1 === a10 ? 0 <= (-2147483648 ^ b10) : -1 < a10) && (0 === a10 ? -1 >= (-2147483648 ^ b10) : 0 > a10) ? b10 : pL(OJ(), new qa().Sc(b10, a10)); + } else + b10 = NJ(OJ(), this.Xl); + return b10; + }; + d7.gH = function() { + return this.Xl.gH(); + }; + function Bua(a10, b10) { + a10.Xl = b10; + return a10; + } + function Dsb(a10) { + var b10 = $Va(Lj(), new qa().Sc(0, -2147483648)); + return 0 <= a10.gs(b10) ? (b10 = $Va(Lj(), new qa().Sc(-1, 2147483647)), 0 >= a10.gs(b10)) : false; + } + var ZVa = r8({ C9a: 0 }, false, "scala.math.BigInt", { C9a: 1, Whb: 1, iH: 1, f: 1, o: 1, Yhb: 1, Xhb: 1, q: 1, cM: 1, ym: 1 }); + eH.prototype.$classData = ZVa; + function C8() { + this.cr = null; + } + C8.prototype = new a8(); + C8.prototype.constructor = C8; + C8.prototype.a = function() { + this.cr = "Boolean"; + return this; + }; + C8.prototype.zs = function(a10) { + return ja(Ja(Ma), [a10]); + }; + C8.prototype.Lo = function() { + return q5(Ma); + }; + C8.prototype.$classData = r8({ X9a: 0 }, false, "scala.reflect.ManifestFactory$BooleanManifest$", { X9a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Esb = void 0; + function Qxa() { + Esb || (Esb = new C8().a()); + return Esb; + } + function D8() { + this.cr = null; + } + D8.prototype = new a8(); + D8.prototype.constructor = D8; + D8.prototype.a = function() { + this.cr = "Byte"; + return this; + }; + D8.prototype.zs = function(a10) { + return ja(Ja(Oa), [a10]); + }; + D8.prototype.Lo = function() { + return q5(Oa); + }; + D8.prototype.$classData = r8({ Y9a: 0 }, false, "scala.reflect.ManifestFactory$ByteManifest$", { Y9a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Fsb = void 0; + function Jxa() { + Fsb || (Fsb = new D8().a()); + return Fsb; + } + function E8() { + this.cr = null; + } + E8.prototype = new a8(); + E8.prototype.constructor = E8; + E8.prototype.a = function() { + this.cr = "Char"; + return this; + }; + E8.prototype.zs = function(a10) { + return ja(Ja(Na), [a10]); + }; + E8.prototype.Lo = function() { + return q5(Na); + }; + E8.prototype.$classData = r8({ Z9a: 0 }, false, "scala.reflect.ManifestFactory$CharManifest$", { Z9a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Gsb = void 0; + function Lxa() { + Gsb || (Gsb = new E8().a()); + return Gsb; + } + function F8() { + this.cr = null; + } + F8.prototype = new a8(); + F8.prototype.constructor = F8; + F8.prototype.a = function() { + this.cr = "Double"; + return this; + }; + F8.prototype.zs = function(a10) { + return ja(Ja(Ta), [a10]); + }; + F8.prototype.Lo = function() { + return q5(Ta); + }; + F8.prototype.$classData = r8({ $9a: 0 }, false, "scala.reflect.ManifestFactory$DoubleManifest$", { $9a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Hsb = void 0; + function Pxa() { + Hsb || (Hsb = new F8().a()); + return Hsb; + } + function G8() { + this.cr = null; + } + G8.prototype = new a8(); + G8.prototype.constructor = G8; + G8.prototype.a = function() { + this.cr = "Float"; + return this; + }; + G8.prototype.zs = function(a10) { + return ja(Ja(Sa), [a10]); + }; + G8.prototype.Lo = function() { + return q5(Sa); + }; + G8.prototype.$classData = r8({ a$a: 0 }, false, "scala.reflect.ManifestFactory$FloatManifest$", { a$a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Isb = void 0; + function Oxa() { + Isb || (Isb = new G8().a()); + return Isb; + } + function H8() { + this.cr = null; + } + H8.prototype = new a8(); + H8.prototype.constructor = H8; + H8.prototype.a = function() { + this.cr = "Int"; + return this; + }; + H8.prototype.zs = function(a10) { + return ja(Ja(Qa), [a10]); + }; + H8.prototype.Lo = function() { + return q5(Qa); + }; + H8.prototype.$classData = r8({ b$a: 0 }, false, "scala.reflect.ManifestFactory$IntManifest$", { b$a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Jsb = void 0; + function Mxa() { + Jsb || (Jsb = new H8().a()); + return Jsb; + } + function I8() { + this.cr = null; + } + I8.prototype = new a8(); + I8.prototype.constructor = I8; + I8.prototype.a = function() { + this.cr = "Long"; + return this; + }; + I8.prototype.zs = function(a10) { + return ja(Ja(Ra), [a10]); + }; + I8.prototype.Lo = function() { + return q5(Ra); + }; + I8.prototype.$classData = r8({ c$a: 0 }, false, "scala.reflect.ManifestFactory$LongManifest$", { c$a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Ksb = void 0; + function Nxa() { + Ksb || (Ksb = new I8().a()); + return Ksb; + } + function J8() { + this.DA = null; + } + J8.prototype = new Lnb(); + J8.prototype.constructor = J8; + function Lsb() { + } + Lsb.prototype = J8.prototype; + J8.prototype.h = function(a10) { + return this === a10; + }; + J8.prototype.t = function() { + return this.DA; + }; + J8.prototype.z = function() { + return qaa(this); + }; + function K8() { + this.cr = null; + } + K8.prototype = new a8(); + K8.prototype.constructor = K8; + K8.prototype.a = function() { + this.cr = "Short"; + return this; + }; + K8.prototype.zs = function(a10) { + return ja(Ja(Pa), [a10]); + }; + K8.prototype.Lo = function() { + return q5(Pa); + }; + K8.prototype.$classData = r8({ g$a: 0 }, false, "scala.reflect.ManifestFactory$ShortManifest$", { g$a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Msb = void 0; + function Kxa() { + Msb || (Msb = new K8().a()); + return Msb; + } + function L8() { + this.cr = null; + } + L8.prototype = new a8(); + L8.prototype.constructor = L8; + L8.prototype.a = function() { + this.cr = "Unit"; + return this; + }; + L8.prototype.zs = function(a10) { + return ja(Ja(oa), [a10]); + }; + L8.prototype.Lo = function() { + return q5(Ka); + }; + L8.prototype.$classData = r8({ h$a: 0 }, false, "scala.reflect.ManifestFactory$UnitManifest$", { h$a: 1, TH: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Nsb = void 0; + function Rxa() { + Nsb || (Nsb = new L8().a()); + return Nsb; + } + function M8(a10, b10) { + if (b10 instanceof L6 && a10 instanceof L6) { + if (a10 === b10) + return true; + var c10 = a10.Oa() === b10.Oa(); + if (c10) + for (var e10 = b10.Oa(), f10 = 0; f10 < e10 && c10; ) + c10 = Va(Wa(), a10.lb(f10), b10.lb(f10)), f10 = 1 + f10 | 0; + return c10; + } + a10 = a10.mb(); + for (b10 = b10.mb(); a10.Ya() && b10.Ya(); ) + if (!Va(Wa(), a10.$a(), b10.$a())) + return false; + return !a10.Ya() && !b10.Ya(); + } + function HN(a10, b10) { + b10 = b10.en(a10.Zi()); + var c10 = new lC().ue(0); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + f10.jd(new R6().M(h10, g10.oa)); + g10.oa = 1 + g10.oa | 0; + }; + }(a10, b10, c10))); + return b10.Rc(); + } + function Osb(a10, b10) { + var c10 = a10.Qd(); + if (!(0 >= b10)) { + c10.zt(b10, a10); + var e10 = 0; + for (a10 = a10.mb(); e10 < b10 && a10.Ya(); ) + c10.jd(a10.$a()), e10 = 1 + e10 | 0; + } + return c10.Rc(); + } + function Psb(a10, b10, c10, e10) { + var f10 = c10; + c10 = c10 + e10 | 0; + e10 = SJ(W5(), b10); + c10 = c10 < e10 ? c10 : e10; + for (a10 = a10.mb(); f10 < c10 && a10.Ya(); ) + aAa(W5(), b10, f10, a10.$a()), f10 = 1 + f10 | 0; + } + function N8(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + a10 = a10.mb(); + for (b10 = b10.mb(); a10.Ya() && b10.Ya(); ) + c10.jd(new R6().M(a10.$a(), b10.$a())); + return c10.Rc(); + } + function O8() { + this.LV = this.u = null; + } + O8.prototype = new H6(); + O8.prototype.constructor = O8; + O8.prototype.a = function() { + FT.prototype.a.call(this); + Qsb = this; + this.LV = new pLa().a(); + return this; + }; + O8.prototype.Rz = function() { + return H10(); + }; + O8.prototype.Qd = function() { + return new Lf().a(); + }; + O8.prototype.$classData = r8({ tbb: 0 }, false, "scala.collection.immutable.List$", { tbb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1, q: 1, o: 1 }); + var Qsb = void 0; + function ii() { + Qsb || (Qsb = new O8().a()); + return Qsb; + } + function P8() { + this.u = null; + } + P8.prototype = new H6(); + P8.prototype.constructor = P8; + P8.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + function Rsb(a10, b10, c10) { + return dK(b10, oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + return Rsb(Pt(), f10 + g10 | 0, g10); + }; + }(a10, b10, c10))); + } + function Ssb(a10, b10, c10, e10) { + var f10 = b10.ga(); + return dK(f10, oq(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function() { + return LT(h10.ta(), k10, l10); + }; + }(a10, b10, c10, e10))); + } + P8.prototype.Rz = function() { + return AT(); + }; + function Tsb(a10, b10, c10, e10, f10) { + return dK(b10, oq(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function() { + return h10.ta().ec(k10, l10); + }; + }(a10, c10, e10, f10))); + } + P8.prototype.Qd = function() { + return new K6().a(); + }; + P8.prototype.$classData = r8({ Xbb: 0 }, false, "scala.collection.immutable.Stream$", { Xbb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1, q: 1, o: 1 }); + var Usb = void 0; + function Pt() { + Usb || (Usb = new P8().a()); + return Usb; + } + function Q8() { + this.u = null; + } + Q8.prototype = new H6(); + Q8.prototype.constructor = Q8; + Q8.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + Q8.prototype.Qd = function() { + return new Xj().a(); + }; + Q8.prototype.$classData = r8({ Hcb: 0 }, false, "scala.collection.mutable.ArrayBuffer$", { Hcb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1, q: 1, o: 1 }); + var Vsb = void 0; + function b32() { + Vsb || (Vsb = new Q8().a()); + return Vsb; + } + function R8() { + this.u = null; + } + R8.prototype = new H6(); + R8.prototype.constructor = R8; + R8.prototype.a = function() { + FT.prototype.a.call(this); + return this; + }; + R8.prototype.Qd = function() { + return Jf(new Kf(), new Lf().a()); + }; + R8.prototype.$classData = r8({ Vdb: 0 }, false, "scala.collection.mutable.ListBuffer$", { Vdb: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1, q: 1, o: 1 }); + var Wsb = void 0; + function Ef() { + Wsb || (Wsb = new R8().a()); + return Wsb; + } + function Fk() { + this.ea = this.k = null; + } + Fk.prototype = new u7(); + Fk.prototype.constructor = Fk; + function Xsb() { + } + d7 = Xsb.prototype = Fk.prototype; + d7.H = function() { + return "Module"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Fk.prototype.RG.call(this, new bg().K(new S6().a(), a10)); + return this; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Fk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Sl = function() { + return cU(this); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.hR(); + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.hR = function() { + return this.k; + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.hR(); + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.RG = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.hR().j; + }; + d7.oc = function() { + return this.hR(); + }; + d7.z = function() { + return X5(this); + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + Fk.prototype.annotations = function() { + return this.rb(); + }; + Fk.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty(Fk.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + Fk.prototype.findByType = function(a10) { + return this.qp(a10); + }; + Fk.prototype.findById = function(a10) { + return this.pp(a10); + }; + Fk.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + Fk.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + Fk.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + Fk.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + Fk.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty(Fk.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty(Fk.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty(Fk.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(Fk.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + Fk.prototype.references = function() { + return TT(this); + }; + Object.defineProperty(Fk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Fk.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + Fk.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty(Fk.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + Fk.prototype.$classData = r8({ oga: 0 }, false, "amf.client.model.document.Module", { oga: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sn() { + this.ea = this.k = null; + } + Sn.prototype = new u7(); + Sn.prototype.constructor = Sn; + d7 = Sn.prototype; + d7.H = function() { + return "Amqp091ChannelExchange"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Sn.prototype.Kla.call(this, new Rn().K(b10, a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Qn().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.H4 = function(a10) { + var b10 = this.k, c10 = Qn().sD; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Sn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Z3 = function(a10) { + var b10 = this.k, c10 = Qn().OC; + Bi(b10, c10, a10); + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.jF = function() { + Z10(); + var a10 = B6(this.k.g, Qn().Hf); + Z10().cb(); + return gb(a10); + }; + d7.EC = function(a10) { + var b10 = this.k, c10 = Qn().Hf; + eb(b10, c10, a10); + return this; + }; + d7.d4 = function(a10) { + var b10 = this.k, c10 = Qn().YC; + Bi(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Iea = function() { + Z10(); + var a10 = B6(this.k.g, Qn().sD); + Z10().cb(); + return gb(a10); + }; + d7.l9 = function() { + Z10(); + var a10 = B6(this.k.g, Qn().OC); + Z10().yi(); + return yL(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.X9 = function() { + Z10(); + var a10 = B6(this.k.g, Qn().YC); + Z10().yi(); + return yL(a10); + }; + d7.Kla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + Sn.prototype.annotations = function() { + return this.rb(); + }; + Sn.prototype.graph = function() { + return jU(this); + }; + Sn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Sn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Sn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Sn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Sn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Sn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Sn.prototype.withVHost = function(a10) { + return this.H4(a10); + }; + Sn.prototype.withAutoDelete = function(a10) { + return this.Z3(!!a10); + }; + Sn.prototype.withDurable = function(a10) { + return this.d4(!!a10); + }; + Sn.prototype.withType = function(a10) { + return this.EC(a10); + }; + Object.defineProperty(Sn.prototype, "vHost", { get: function() { + return this.Iea(); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "autoDelete", { get: function() { + return this.l9(); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "durable", { get: function() { + return this.X9(); + }, configurable: true }); + Object.defineProperty(Sn.prototype, "type", { get: function() { + return this.jF(); + }, configurable: true }); + Sn.prototype.$classData = r8({ iua: 0 }, false, "amf.client.model.domain.Amqp091ChannelExchange", { iua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vn() { + this.ea = this.k = null; + } + Vn.prototype = new u7(); + Vn.prototype.constructor = Vn; + d7 = Vn.prototype; + d7.H = function() { + return "Amqp091Queue"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Vn.prototype.Nla.call(this, new Un().K(b10, a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Tn().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.H4 = function(a10) { + var b10 = this.k, c10 = Tn().sD; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Vn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Z3 = function(a10) { + var b10 = this.k, c10 = Tn().OC; + Bi(b10, c10, a10); + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.d4 = function(a10) { + var b10 = this.k, c10 = Tn().YC; + Bi(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Nla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Iea = function() { + Z10(); + var a10 = B6(this.k.g, Tn().sD); + Z10().cb(); + return gb(a10); + }; + d7.l9 = function() { + Z10(); + var a10 = B6(this.k.g, Tn().OC); + Z10().yi(); + return yL(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.X9 = function() { + Z10(); + var a10 = B6(this.k.g, Tn().YC); + Z10().yi(); + return yL(a10); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + Vn.prototype.annotations = function() { + return this.rb(); + }; + Vn.prototype.graph = function() { + return jU(this); + }; + Vn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Vn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Vn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Vn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Vn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Vn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Vn.prototype.withVHost = function(a10) { + return this.H4(a10); + }; + Vn.prototype.withAutoDelete = function(a10) { + return this.Z3(!!a10); + }; + Vn.prototype.withExclusive = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = Tn().ZX; + Bi(b10, c10, a10); + return this; + }; + Vn.prototype.withDurable = function(a10) { + return this.d4(!!a10); + }; + Object.defineProperty(Vn.prototype, "vHost", { get: function() { + return this.Iea(); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "autoDelete", { get: function() { + return this.l9(); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "exclusive", { get: function() { + Z10(); + var a10 = B6(this.k.g, Tn().ZX); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(Vn.prototype, "durable", { get: function() { + return this.X9(); + }, configurable: true }); + Vn.prototype.$classData = r8({ lua: 0 }, false, "amf.client.model.domain.Amqp091Queue", { lua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function g1() { + Pm.call(this); + } + g1.prototype = new m_a(); + g1.prototype.constructor = g1; + d7 = g1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + g1.prototype.qU.call(this, new bR().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, aR().R); + Z10().cb(); + return gb(a10); + }; + d7.H = function() { + return "ApiKeySettings"; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof g1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = aR().R; + eb(b10, c10, a10); + return this; + }; + d7.qU = function(a10) { + Pm.prototype.XG.call(this, a10); + return this; + }; + g1.prototype.withIn = function(a10) { + var b10 = this.k, c10 = aR().Ny; + eb(b10, c10, a10); + return this; + }; + g1.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(g1.prototype, "in", { get: function() { + Z10(); + var a10 = B6(this.k.g, aR().Ny); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(g1.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + g1.prototype.$classData = r8({ mua: 0 }, false, "amf.client.model.domain.ApiKeySettings", { mua: 1, fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function cl() { + this.ea = this.k = null; + } + cl.prototype = new u7(); + cl.prototype.constructor = cl; + d7 = cl.prototype; + d7.a = function() { + hs(); + O7(); + var a10 = new P6().a(); + cl.prototype.aU.call(this, new bl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ArrayNode"; + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return dXa(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof cl ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.aU = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return eXa(this, a10); + }; + cl.prototype.annotations = function() { + return this.rb(); + }; + cl.prototype.graph = function() { + return jU(this); + }; + cl.prototype.withId = function(a10) { + return this.$b(a10); + }; + cl.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + cl.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(cl.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(cl.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(cl.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(cl.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + cl.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(cl.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + cl.prototype.addMember = function(a10) { + Mqa(this.k, a10.k); + return this; + }; + Object.defineProperty(cl.prototype, "members", { get: function() { + var a10 = ab(), b10 = B6(this.k.aa, al().Tt), c10 = ab().Um(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + cl.prototype.$classData = r8({ nua: 0 }, false, "amf.client.model.domain.ArrayNode", { nua: 1, f: 1, yga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function cm() { + this.ea = this.k = null; + } + cm.prototype = new u7(); + cm.prototype.constructor = cm; + function Ysb(a10) { + Z10(); + a10 = a10.k; + return Ysb(EWa(Zsb(), a10)); + } + d7 = cm.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + cm.prototype.tla.call(this, new bm().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Callback"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, am().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof cm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.tla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + cm.prototype.annotations = function() { + return this.rb(); + }; + cm.prototype.graph = function() { + return jU(this); + }; + cm.prototype.withId = function(a10) { + return this.$b(a10); + }; + cm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + cm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(cm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(cm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(cm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(cm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + cm.prototype.withEndpoint = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 1: + return b10 = c10[0], a10 = this.k, Z10(), S8(), b10 = b10.k, c10 = am().YM, Vd(a10, c10, b10), this; + case 0: + return Ysb(this); + default: + throw "No matching overload"; + } + }; + cm.prototype.withExpression = function(a10) { + var b10 = this.k, c10 = am().Ky; + eb(b10, c10, a10); + return this; + }; + cm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(cm.prototype, "endpoint", { get: function() { + Z10(); + var a10 = B6(this.k.g, am().YM); + return IWa(S8(), a10); + }, configurable: true }); + Object.defineProperty(cm.prototype, "expression", { get: function() { + Z10(); + var a10 = B6(this.k.g, am().Ky); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(cm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + cm.prototype.$classData = r8({ oua: 0 }, false, "amf.client.model.domain.Callback", { oua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Tk() { + this.ea = this.k = null; + } + Tk.prototype = new u7(); + Tk.prototype.constructor = Tk; + d7 = Tk.prototype; + d7.H = function() { + return "CustomDomainProperty"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Tk.prototype.HO.call(this, new Pd().K(new S6().a(), a10)); + return this; + }; + d7.LQ = function(a10) { + var b10 = this.k; + ab(); + ab().Bg(); + a10 = a10.Ce(); + var c10 = Sk().Jc; + Vd(b10, c10, a10); + return this; + }; + d7.Xe = function() { + ab(); + var a10 = B6(this.k.g, Sk().R); + ab().cb(); + return gb(a10); + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return this.LD(); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Tk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + ab(); + var a10 = B6(this.k.g, Sk().Va); + ab().cb(); + return gb(a10); + }; + d7.sq = function(a10) { + var b10 = this.k, c10 = Sk().Zc; + eb(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return $sb(this); + }; + function $sb(a10) { + ab(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Pd().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + Yqb(); + return new Tk().HO(a10); + } + d7.pW = function() { + ab(); + var a10 = B6(this.k.g, Sk().Jc); + return t1(ab().Bg(), a10); + }; + d7.Gj = function() { + return $sb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Sk().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.HO = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.LD = function() { + ab(); + var a10 = B6(this.k.g, Sk().Zc); + ab().cb(); + return gb(a10); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Tk.prototype.annotations = function() { + return this.rb(); + }; + Tk.prototype.graph = function() { + return jU(this); + }; + Tk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Tk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Tk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Tk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Tk.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Tk.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Tk.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Tk.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Tk.prototype.linkCopy = function() { + return this.Kf(); + }; + Tk.prototype.withSchema = function(a10) { + return this.LQ(a10); + }; + Tk.prototype.withDomain = function(a10) { + var b10 = this.k, c10 = ab(), e10 = ab().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = Sk().DF; + Wr(b10, c10, a10); + return this; + }; + Tk.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Tk.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + Tk.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Tk.prototype, "schema", { get: function() { + return this.pW(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "domain", { get: function() { + var a10 = ab(), b10 = B6(this.k.g, Sk().DF), c10 = ab().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(Tk.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Tk.prototype.$classData = r8({ sua: 0 }, false, "amf.client.model.domain.CustomDomainProperty", { sua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function T8() { + h32.call(this); + } + T8.prototype = new l_a(); + T8.prototype.constructor = T8; + d7 = T8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + T8.prototype.g7a.call(this, new cO().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "DatatypePropertyTerm"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof T8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.g7a = function(a10) { + h32.prototype.mla.call(this, a10); + }; + d7.$classData = r8({ tua: 0 }, false, "amf.client.model.domain.DatatypePropertyTerm", { tua: 1, ova: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ll() { + this.ea = this.k = null; + } + Ll.prototype = new u7(); + Ll.prototype.constructor = Ll; + d7 = Ll.prototype; + d7.H = function() { + return "EndPoint"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Ll.prototype.LO.call(this, new Kl().K(b10, a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Jl().R); + Z10().cb(); + return gb(a10); + }; + d7.r4 = function(a10) { + var b10 = this.k, c10 = Jl().Uf; + eb(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ll) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Hca = function() { + Z10(); + var a10 = B6(this.k.g, Jl().Uf); + Z10().cb(); + return gb(a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.zI = function() { + return this.Kca(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.GS = function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().go), c10 = atb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.Kca = function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().Ne), c10 = O52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.GC = function() { + return this.GS(); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Jl().Va); + Z10().cb(); + return gb(a10); + }; + d7.vW = function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().lh), c10 = U8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.eX = function(a10) { + Z10(); + a10 = this.k.CM(a10); + return VWa(U8(), a10); + }; + d7.NQ = function(a10) { + return this.eX(a10); + }; + d7.wI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = w8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().dc; + Zd(b10, c10, a10); + return this; + }; + d7.rea = function() { + Z10(); + var a10 = B6(this.k.g, Jl().ck); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.BM = function(a10) { + Z10(); + a10 = DGa(this.k, new z7().d(a10)); + return L0(O52(), a10); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Jl().Va; + eb(b10, c10, a10); + return this; + }; + d7.uI = function(a10) { + return this.BM(a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.AI = function() { + return this.rea(); + }; + d7.XQ = function() { + return this.Hca(); + }; + d7.BC = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = atb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().go; + Zd(b10, c10, a10); + return this; + }; + d7.xI = function(a10) { + var b10 = this.k, c10 = Jl().ck; + eb(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.LO = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.OQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = U8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().lh; + Zd(b10, c10, a10); + return this; + }; + d7.vI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = O52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().Ne; + Zd(b10, c10, a10); + return this; + }; + d7.iM = function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().dc), c10 = w8(); + return Ak(a10, b10, c10).Ra(); + }; + Ll.prototype.annotations = function() { + return this.rb(); + }; + Ll.prototype.graph = function() { + return jU(this); + }; + Ll.prototype.withId = function(a10) { + return this.$b(a10); + }; + Ll.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Ll.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Ll.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Ll.prototype.withBindings = function(a10) { + return this.BC(a10); + }; + Ll.prototype.withServer = function(a10) { + return this.NQ(a10); + }; + Ll.prototype.withPayload = function(a10) { + return this.uI(a10); + }; + Ll.prototype.withParameter = function(a10) { + Z10(); + a10 = oGa(this.k, a10); + return I0(s8(), a10); + }; + Ll.prototype.withOperation = function(a10) { + Z10(); + a10 = vGa(this.k, a10); + return MWa(btb(), a10); + }; + Ll.prototype.withSecurity = function(a10) { + return this.wI(a10); + }; + Ll.prototype.withServers = function(a10) { + return this.OQ(a10); + }; + Ll.prototype.withPayloads = function(a10) { + return this.vI(a10); + }; + Ll.prototype.withParameters = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().Wm; + Zd(b10, c10, a10); + return this; + }; + Ll.prototype.withOperations = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = btb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Jl().bk; + Zd(b10, c10, a10); + return this; + }; + Ll.prototype.withPath = function(a10) { + return this.r4(a10); + }; + Ll.prototype.withSummary = function(a10) { + return this.xI(a10); + }; + Ll.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Ll.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Ll.prototype, "relativePath", { get: function() { + return jQa(this.k); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "parent", { get: function() { + var a10 = Z10(), b10 = UX(this.k), c10 = S8(); + return bb(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "bindings", { get: function() { + return this.GC(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "security", { get: function() { + return this.iM(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "servers", { get: function() { + return this.vW(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "payloads", { get: function() { + return this.zI(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "parameters", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().Wm), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "operations", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Jl().bk), c10 = btb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "path", { get: function() { + return this.XQ(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "summary", { get: function() { + return this.AI(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Ll.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Ll.prototype.$classData = r8({ Cua: 0 }, false, "amf.client.model.domain.EndPoint", { Cua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function i1() { + Pm.call(this); + } + i1.prototype = new m_a(); + i1.prototype.constructor = i1; + d7 = i1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + i1.prototype.rU.call(this, new r1().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "HttpSettings"; + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof i1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.rU = function(a10) { + Pm.prototype.XG.call(this, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.R4 = function() { + Z10(); + var a10 = B6(this.k.g, F32().Eq); + Z10().cb(); + return gb(a10); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + i1.prototype.withBearerFormat = function(a10) { + var b10 = this.k, c10 = F32().RM; + eb(b10, c10, a10); + return this; + }; + i1.prototype.withScheme = function(a10) { + var b10 = this.k, c10 = F32().Eq; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(i1.prototype, "bearerFormat", { get: function() { + Z10(); + var a10 = B6(this.k.g, F32().RM); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(i1.prototype, "scheme", { get: function() { + return this.R4(); + }, configurable: true }); + i1.prototype.$classData = r8({ Kua: 0 }, false, "amf.client.model.domain.HttpSettings", { Kua: 1, fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ol() { + this.ea = this.k = null; + } + Ol.prototype = new u7(); + Ol.prototype.constructor = Ol; + d7 = Ol.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Ol.prototype.xla.call(this, new Nl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "License"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Ml().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Rv = function() { + return this.lF(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ol) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.lF = function() { + Z10(); + var a10 = B6(this.k.g, Ml().Pf); + Z10().cb(); + return gb(a10); + }; + d7.FC = function(a10) { + var b10 = this.k, c10 = Ml().Pf; + eb(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.xla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + Ol.prototype.annotations = function() { + return this.rb(); + }; + Ol.prototype.graph = function() { + return jU(this); + }; + Ol.prototype.withId = function(a10) { + return this.$b(a10); + }; + Ol.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Ol.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Ol.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Ol.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Ol.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Ol.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Ol.prototype.withName = function(a10) { + return this.Td(a10); + }; + Ol.prototype.withUrl = function(a10) { + return this.FC(a10); + }; + Object.defineProperty(Ol.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Object.defineProperty(Ol.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + Ol.prototype.$classData = r8({ Oua: 0 }, false, "amf.client.model.domain.License", { Oua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function k1() { + Pm.call(this); + } + k1.prototype = new m_a(); + k1.prototype.constructor = k1; + d7 = k1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + k1.prototype.sU.call(this, new q1().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "OAuth1Settings"; + }; + d7.E = function() { + return 1; + }; + d7.k9 = function() { + Z10(); + var a10 = B6(this.k.g, vZ().km); + Z10().cb(); + return gb(a10); + }; + d7.Y3 = function(a10) { + var b10 = this.k, c10 = vZ().km; + eb(b10, c10, a10); + return this; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof k1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.sU = function(a10) { + Pm.prototype.XG.call(this, a10); + return this; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + k1.prototype.withSignatures = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = vZ().DJ; + Wr(b10, c10, a10); + return this; + }; + k1.prototype.withTokenCredentialsUri = function(a10) { + var b10 = this.k, c10 = vZ().GJ; + eb(b10, c10, a10); + return this; + }; + k1.prototype.withAuthorizationUri = function(a10) { + return this.Y3(a10); + }; + k1.prototype.withRequestTokenUri = function(a10) { + var b10 = this.k, c10 = vZ().zJ; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(k1.prototype, "signatures", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, vZ().DJ), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(k1.prototype, "tokenCredentialsUri", { get: function() { + Z10(); + var a10 = B6(this.k.g, vZ().GJ); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(k1.prototype, "authorizationUri", { get: function() { + return this.k9(); + }, configurable: true }); + Object.defineProperty(k1.prototype, "requestTokenUri", { get: function() { + Z10(); + var a10 = B6(this.k.g, vZ().zJ); + Z10().cb(); + return gb(a10); + }, configurable: true }); + k1.prototype.$classData = r8({ Yua: 0 }, false, "amf.client.model.domain.OAuth1Settings", { Yua: 1, fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function m1() { + Pm.call(this); + } + m1.prototype = new m_a(); + m1.prototype.constructor = m1; + d7 = m1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + m1.prototype.tU.call(this, new wE().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "OAuth2Settings"; + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof m1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.tU = function(a10) { + Pm.prototype.XG.call(this, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + m1.prototype.withAuthorizationGrants = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = xE().Gy; + Wr(b10, c10, a10); + return this; + }; + m1.prototype.withFlows = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = ctb(); + a10 = uk(tk(c10, a10, e10)); + c10 = xE().Ap; + Zd(b10, c10, a10); + return this; + }; + Object.defineProperty(m1.prototype, "authorizationGrants", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, xE().Gy), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(m1.prototype, "flows", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, xE().Ap), c10 = ctb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + m1.prototype.$classData = r8({ $ua: 0 }, false, "amf.client.model.domain.OAuth2Settings", { $ua: 1, fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Yk() { + this.ea = this.k = null; + } + Yk.prototype = new u7(); + Yk.prototype.constructor = Yk; + d7 = Yk.prototype; + d7.a = function() { + qs(); + O7(); + var a10 = new P6().a(); + Yk.prototype.aE.call(this, new Xk().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ObjectNode"; + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return dXa(this); + }; + d7.aE = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Yk ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.YQ = function() { + var a10 = ab(), b10 = O_a(this.k), c10 = ab().Um(), e10 = new wk(); + e10.gk = b10; + e10.fq = c10; + if (null === a10) + throw mb(E6(), null); + e10.l = a10; + return e10.Ra(); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return eXa(this, a10); + }; + Yk.prototype.annotations = function() { + return this.rb(); + }; + Yk.prototype.graph = function() { + return jU(this); + }; + Yk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Yk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Yk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Yk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Yk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Yk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Yk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Yk.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Yk.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Yk.prototype.addProperty = function(a10, b10) { + oC(this.k, a10, b10.k, (O7(), new P6().a())); + return this; + }; + Yk.prototype.getProperty = function(a10) { + var b10 = ab(); + var c10 = this.k; + var e10 = c10.aa; + a10 = P_a(a10); + e10 = e10.vb.Ja(a10).ua(); + c10 = new Rab().aE(c10); + c10 = Jc(e10, c10); + e10 = ab().Um(); + return bb(b10, c10, e10).Ra(); + }; + Object.defineProperty(Yk.prototype, "properties", { get: function() { + return this.YQ(); + }, configurable: true }); + Yk.prototype.$classData = r8({ ava: 0 }, false, "amf.client.model.domain.ObjectNode", { ava: 1, f: 1, yga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function V8() { + h32.call(this); + } + V8.prototype = new l_a(); + V8.prototype.constructor = V8; + d7 = V8.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + V8.prototype.i7a.call(this, new dO().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ObjectPropertyTerm"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof V8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.i7a = function(a10) { + h32.prototype.mla.call(this, a10); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bva: 0 }, false, "amf.client.model.domain.ObjectPropertyTerm", { bva: 1, ova: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function o1() { + Pm.call(this); + } + o1.prototype = new m_a(); + o1.prototype.constructor = o1; + d7 = o1.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + o1.prototype.uU.call(this, new uE().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "OpenIdConnectSettings"; + }; + d7.uU = function(a10) { + Pm.prototype.XG.call(this, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.Rv = function() { + return this.lF(); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof o1) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.FC = function(a10) { + var b10 = this.k, c10 = vE().Pf; + eb(b10, c10, a10); + return this; + }; + d7.lF = function() { + Z10(); + var a10 = B6(this.k.g, vE().Pf); + Z10().cb(); + return gb(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Vda = function() { + var a10 = Z10(), b10 = B6(this.k.g, vE().lo), c10 = $qb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + o1.prototype.withUrl = function(a10) { + return this.FC(a10); + }; + Object.defineProperty(o1.prototype, "scopes", { get: function() { + return this.Vda(); + }, configurable: true }); + Object.defineProperty(o1.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + o1.prototype.$classData = r8({ cva: 0 }, false, "amf.client.model.domain.OpenIdConnectSettings", { cva: 1, fN: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vl() { + this.ea = this.k = null; + } + Vl.prototype = new u7(); + Vl.prototype.constructor = Vl; + d7 = Vl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Vl.prototype.yla.call(this, new Ul().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Organization"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Tl().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Rv = function() { + return this.lF(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Vl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.lF = function() { + Z10(); + var a10 = B6(this.k.g, Tl().Pf); + Z10().cb(); + return gb(a10); + }; + d7.FC = function(a10) { + var b10 = this.k, c10 = Tl().Pf; + eb(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.yla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + Vl.prototype.annotations = function() { + return this.rb(); + }; + Vl.prototype.graph = function() { + return jU(this); + }; + Vl.prototype.withId = function(a10) { + return this.$b(a10); + }; + Vl.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Vl.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Vl.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Vl.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Vl.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Vl.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Vl.prototype.withEmail = function(a10) { + var b10 = this.k, c10 = Tl().WI; + eb(b10, c10, a10); + return this; + }; + Vl.prototype.withName = function(a10) { + return this.Td(a10); + }; + Vl.prototype.withUrl = function(a10) { + return this.FC(a10); + }; + Object.defineProperty(Vl.prototype, "email", { get: function() { + Z10(); + var a10 = B6(this.k.g, Tl().WI); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Vl.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Object.defineProperty(Vl.prototype, "url", { get: function() { + return this.Rv(); + }, configurable: true }); + Vl.prototype.$classData = r8({ eva: 0 }, false, "amf.client.model.domain.Organization", { eva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Xl() { + this.ea = this.k = null; + } + Xl.prototype = new u7(); + Xl.prototype.constructor = Xl; + d7 = Xl.prototype; + d7.D4 = function(a10) { + return this.hfa(a10); + }; + d7.H = function() { + return "Parameter"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Xl.prototype.zla.call(this, new Wl().K(new S6().a(), a10)); + return this; + }; + d7.zla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.LQ = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = cj().Jc; + Vd(b10, c10, a10); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, cj().R); + Z10().cb(); + return gb(a10); + }; + d7.q4 = function(a10) { + return this.bfa(a10); + }; + d7.HC = function() { + return this.P9(); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.hfa = function(a10) { + Z10(); + a10 = this.k.dX(a10); + return TWa(dtb(), a10); + }; + d7.JC = function() { + return this.DT(); + }; + d7.n$ = function() { + Z10(); + var a10 = B6(this.k.g, cj().Vu); + Z10().yi(); + return yL(a10); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.P9 = function() { + Z10(); + var a10 = B6(this.k.g, cj().uh); + Z10().yi(); + return yL(a10); + }; + d7.DT = function() { + var a10 = Z10(), b10 = B6(this.k.g, cj().Ec), c10 = P52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Xl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.zI = function() { + return this.Kca(); + }; + d7.DC = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = P52(); + a10 = uk(tk(c10, a10, e10)); + c10 = cj().Ec; + Zd(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jda = function() { + Z10(); + var a10 = B6(this.k.g, cj().yj); + Z10().yi(); + return yL(a10); + }; + d7.oea = function() { + Z10(); + var a10 = B6(this.k.g, cj().Yt); + Z10().cb(); + return gb(a10); + }; + d7.F4 = function(a10) { + var b10 = this.k, c10 = cj().Yt; + eb(b10, c10, a10); + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.Kca = function() { + var a10 = Z10(), b10 = B6(this.k.g, cj().Ne), c10 = O52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.i4 = function(a10) { + var b10 = this.k, c10 = cj().Vu; + Bi(b10, c10, a10); + return this; + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, cj().Va); + Z10().cb(); + return gb(a10); + }; + d7.AQ = function(a10) { + return this.bX(a10); + }; + d7.pW = function() { + Z10(); + var a10 = B6(this.k.g, cj().Jc); + return t1(Z10().Bg(), a10); + }; + d7.z4 = function(a10) { + var b10 = this.k, c10 = cj().yj; + Bi(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.BM = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new ym().K(new S6().a(), c10); + var e10 = xm().Nd; + a10 = eb(c10, e10, a10); + c10 = cj().Ne; + ig(b10, c10, a10); + return L0(O52(), a10); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = cj().Va; + eb(b10, c10, a10); + return this; + }; + d7.X3 = function(a10) { + var b10 = this.k, c10 = cj().Su; + Bi(b10, c10, a10); + return this; + }; + d7.uI = function(a10) { + return this.BM(a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.bfa = function(a10) { + Z10(); + a10 = this.k.cfa(a10); + return LWa(etb(), a10); + }; + d7.bX = function(a10) { + Z10(); + a10 = this.k.qF(new z7().d(a10)); + return JWa(P52(), a10); + }; + d7.vI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = O52(); + a10 = uk(tk(c10, a10, e10)); + c10 = cj().Ne; + Zd(b10, c10, a10); + return this; + }; + d7.A8 = function() { + Z10(); + var a10 = B6(this.k.g, cj().Su); + Z10().yi(); + return yL(a10); + }; + d7.CC = function(a10) { + var b10 = this.k, c10 = cj().uh; + Bi(b10, c10, a10); + return this; + }; + Xl.prototype.annotations = function() { + return this.rb(); + }; + Xl.prototype.graph = function() { + return jU(this); + }; + Xl.prototype.withId = function(a10) { + return this.$b(a10); + }; + Xl.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Xl.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Xl.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Xl.prototype.withExample = function(a10) { + return this.AQ(a10); + }; + Xl.prototype.withPayload = function(a10) { + return this.uI(a10); + }; + Xl.prototype.withScalarSchema = function(a10) { + return this.D4(a10); + }; + Xl.prototype.withObjectSchema = function(a10) { + return this.q4(a10); + }; + Xl.prototype.withSchema = function(a10) { + return this.LQ(a10); + }; + Xl.prototype.withExamples = function(a10) { + return this.DC(a10); + }; + Xl.prototype.withPayloads = function(a10) { + return this.vI(a10); + }; + Xl.prototype.withBinding = function(a10) { + var b10 = this.k, c10 = cj().We; + eb(b10, c10, a10); + return this; + }; + Xl.prototype.withAllowReserved = function(a10) { + return this.X3(!!a10); + }; + Xl.prototype.withExplode = function(a10) { + return this.i4(!!a10); + }; + Xl.prototype.withStyle = function(a10) { + return this.F4(a10); + }; + Xl.prototype.withAllowEmptyValue = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = cj().wF; + Bi(b10, c10, a10); + return this; + }; + Xl.prototype.withDeprecated = function(a10) { + return this.CC(!!a10); + }; + Xl.prototype.withRequired = function(a10) { + return this.z4(!!a10); + }; + Xl.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Xl.prototype.withParameterName = function(a10) { + var b10 = this.k, c10 = cj().gw; + eb(b10, c10, a10); + return this; + }; + Xl.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Xl.prototype, "examples", { get: function() { + return this.JC(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "payloads", { get: function() { + return this.zI(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "schema", { get: function() { + return this.pW(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "binding", { get: function() { + Z10(); + var a10 = B6(this.k.g, cj().We); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "allowReserved", { get: function() { + return this.A8(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "explode", { get: function() { + return this.n$(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "style", { get: function() { + return this.oea(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "allowEmptyValue", { get: function() { + Z10(); + var a10 = B6(this.k.g, cj().wF); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "deprecated", { get: function() { + return this.HC(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "required", { get: function() { + return this.jda(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "parameterName", { get: function() { + Z10(); + var a10 = B6(this.k.g, cj().gw); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Xl.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Xl.prototype.$classData = r8({ fva: 0 }, false, "amf.client.model.domain.Parameter", { fva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function zm() { + this.ea = this.k = null; + } + zm.prototype = new u7(); + zm.prototype.constructor = zm; + d7 = zm.prototype; + d7.D4 = function(a10) { + return this.hfa(a10); + }; + d7.H = function() { + return "Payload"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + zm.prototype.Bla.call(this, new ym().K(new S6().a(), a10)); + return this; + }; + d7.LQ = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = xm().Jc; + Vd(b10, c10, a10); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, xm().R); + Z10().cb(); + return gb(a10); + }; + d7.q4 = function(a10) { + return this.bfa(a10); + }; + d7.E = function() { + return 1; + }; + d7.wL = function() { + Z10(); + var a10 = B6(this.k.g, xm().Nd); + Z10().cb(); + return gb(a10); + }; + d7.hfa = function(a10) { + Z10(); + a10 = this.k.dX(a10); + return TWa(dtb(), a10); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.JC = function() { + return this.DT(); + }; + d7.DT = function() { + var a10 = Z10(), b10 = B6(this.k.g, xm().Ec), c10 = P52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof zm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.DC = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = P52(); + a10 = uk(tk(c10, a10, e10)); + c10 = xm().Ec; + Zd(b10, c10, a10); + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.AQ = function(a10) { + return this.bX(a10); + }; + d7.pW = function() { + Z10(); + var a10 = B6(this.k.g, xm().Jc); + return t1(Z10().Bg(), a10); + }; + d7.Bla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.EQ = function(a10) { + var b10 = this.k, c10 = xm().Nd; + eb(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.zy = function() { + return this.wL(); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.bfa = function(a10) { + Z10(); + a10 = this.k.cfa(a10); + return LWa(etb(), a10); + }; + d7.bX = function(a10) { + Z10(); + a10 = this.k.qF(new z7().d(a10)); + return JWa(P52(), a10); + }; + zm.prototype.annotations = function() { + return this.rb(); + }; + zm.prototype.graph = function() { + return jU(this); + }; + zm.prototype.withId = function(a10) { + return this.$b(a10); + }; + zm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + zm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(zm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(zm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + zm.prototype.withEncoding = function(a10) { + if (sp(a10)) { + Z10(); + var b10 = Kdb(this.k, a10); + a10 = ftb(); + b10 = xu(a10.l.ea, b10); + } else { + b10 = this.k; + var c10 = Z10(), e10 = ftb(); + a10 = uk(tk(c10, a10, e10)); + c10 = xm().XI; + Zd(b10, c10, a10); + b10 = this; + } + return b10; + }; + zm.prototype.withExample = function(a10) { + return this.AQ(a10); + }; + zm.prototype.withScalarSchema = function(a10) { + return this.D4(a10); + }; + zm.prototype.withObjectSchema = function(a10) { + return this.q4(a10); + }; + zm.prototype.withExamples = function(a10) { + return this.DC(a10); + }; + zm.prototype.withSchema = function(a10) { + return this.LQ(a10); + }; + zm.prototype.withMediaType = function(a10) { + return this.EQ(a10); + }; + zm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(zm.prototype, "encoding", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, xm().XI), c10 = ftb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "examples", { get: function() { + return this.JC(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "schema", { get: function() { + return this.pW(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + Object.defineProperty(zm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + zm.prototype.$classData = r8({ kva: 0 }, false, "amf.client.model.domain.Payload", { kva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Zk() { + this.ea = this.k = null; + } + Zk.prototype = new u7(); + Zk.prototype.constructor = Zk; + d7 = Zk.prototype; + d7.Hc = function(a10, b10) { + vs(); + b10 = Vb().Ia(b10); + Zk.prototype.GO.call(this, ts(0, a10, b10, (O7(), new P6().a()))); + return this; + }; + d7.a = function() { + vs(); + var a10 = y7(); + Zk.prototype.GO.call(this, ts(0, "", a10, (O7(), new P6().a()))); + return this; + }; + d7.H = function() { + return "ScalarNode"; + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return dXa(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Zk ? this.k === a10.k : false; + }; + d7.sp = function() { + return this.t(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + var a10 = dXa(this).Li; + return (a10.b() ? null : a10.c()) + ":" + this.g0() + "=" + this.F3(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.F3 = function() { + ab(); + var a10 = B6(this.k.aa, Wi().vf); + ab().cb(); + return gb(a10); + }; + d7.GO = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.g0 = function() { + ab(); + var a10 = B6(this.k.aa, Wi().af); + ab().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.BI = function() { + return this.F3(); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return eXa(this, a10); + }; + Zk.prototype.annotations = function() { + return this.rb(); + }; + Zk.prototype.graph = function() { + return jU(this); + }; + Zk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Zk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Zk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Zk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Zk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Zk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Zk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Zk.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Zk.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Zk.prototype.toString = function() { + return this.sp(); + }; + Object.defineProperty(Zk.prototype, "dataType", { get: function() { + return this.g0(); + }, configurable: true }); + Object.defineProperty(Zk.prototype, "value", { get: function() { + return this.BI(); + }, configurable: true }); + Zk.prototype.$classData = r8({ uva: 0 }, false, "amf.client.model.domain.ScalarNode", { uva: 1, f: 1, yga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function wm() { + this.ea = this.k = null; + } + wm.prototype = new u7(); + wm.prototype.constructor = wm; + d7 = wm.prototype; + d7.ffa = function(a10) { + Z10(); + a10 = this.k.gfa(a10); + return SWa(W8(), a10); + }; + d7.$da = function() { + Z10(); + var a10 = B6(this.k.g, Xh().Oh); + return WWa(arb(), a10); + }; + d7.sI = function(a10) { + return this.AM(a10); + }; + d7.H = function() { + return "SecurityScheme"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Xh().R); + Z10().cb(); + return gb(a10); + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + wm.prototype.ama.call(this, new vm().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.ama = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.tI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Xh().Tf; + Zd(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return this.LD(); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.efa = function(a10) { + Z10(); + a10 = this.k.K3(a10); + return I0(s8(), a10); + }; + d7.AM = function(a10) { + Z10(); + a10 = this.k.lI(a10); + return I0(s8(), a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.$ea = function() { + Z10(); + var a10 = this.k.cX(); + XWa(Z10()); + return new k1().sU(a10); + }; + d7.v4 = function(a10) { + return this.efa(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Xea = function() { + Z10(); + var a10 = this.k.I3(); + $Wa(Z10()); + return new i1().rU(a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Xh().Va); + Z10().cb(); + return gb(a10); + }; + d7.B4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = W8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Xh().Al; + Zd(b10, c10, a10); + return this; + }; + d7.sq = function(a10) { + var b10 = this.k, c10 = Xh().Zc; + eb(b10, c10, a10); + return this; + }; + d7.jF = function() { + Z10(); + var a10 = B6(this.k.g, Xh().Hf); + Z10().cb(); + return gb(a10); + }; + d7.Vea = function() { + Z10(); + var a10 = this.k.mQ(); + ZWa(Z10()); + return new g1().qU(a10); + }; + d7.Kf = function() { + return gtb(this); + }; + d7.yK = function() { + var a10 = Z10(), b10 = B6(this.k.g, Xh().Tf), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.EC = function(a10) { + var b10 = this.k, c10 = Xh().Hf; + eb(b10, c10, a10); + return this; + }; + d7.yy = function() { + return this.yK(); + }; + d7.Gj = function() { + return gtb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Vca = function() { + var a10 = Z10(), b10 = B6(this.k.g, Xh().Tl), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Xh().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.dfa = function() { + Z10(); + var a10 = this.k.J3(); + aXa(Z10()); + return new o1().uU(a10); + }; + d7.Wca = function() { + Z10(); + var a10 = B6(this.k.g, Xh().Dq); + return t1(Z10().Bg(), a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.x4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = Xh().Dq; + Vd(b10, c10, a10); + return this; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.LD = function() { + Z10(); + var a10 = B6(this.k.g, Xh().Zc); + Z10().cb(); + return gb(a10); + }; + function gtb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new vm().K(c10, b10); + a10 = Rd(b10, a10.j); + return UWa(brb(), a10); + } + d7.A4 = function(a10) { + return this.ffa(a10); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.afa = function() { + Z10(); + var a10 = this.k.pQ(); + YWa(Z10()); + return new m1().tU(a10); + }; + d7.mda = function() { + var a10 = Z10(), b10 = B6(this.k.g, Xh().Al), c10 = W8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.E4 = function(a10) { + var b10 = this.k; + Z10(); + arb(); + a10 = a10.k; + var c10 = Xh().Oh; + Vd(b10, c10, a10); + return this; + }; + d7.w4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Xh().Tl; + Zd(b10, c10, a10); + return this; + }; + d7.Wea = function() { + Z10(); + var a10 = this.k.aX(); + return WWa(arb(), a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + wm.prototype.annotations = function() { + return this.rb(); + }; + wm.prototype.graph = function() { + return jU(this); + }; + wm.prototype.withId = function(a10) { + return this.$b(a10); + }; + wm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + wm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(wm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(wm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + wm.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + wm.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + wm.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(wm.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(wm.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(wm.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + wm.prototype.linkCopy = function() { + return this.Kf(); + }; + wm.prototype.withOpenIdConnectSettings = function() { + return this.dfa(); + }; + wm.prototype.withHttpSettings = function() { + return this.Xea(); + }; + wm.prototype.withApiKeySettings = function() { + return this.Vea(); + }; + wm.prototype.withOAuth2Settings = function() { + return this.afa(); + }; + wm.prototype.withOAuth1Settings = function() { + return this.$ea(); + }; + wm.prototype.withDefaultSettings = function() { + return this.Wea(); + }; + wm.prototype.withResponse = function(a10) { + return this.A4(a10); + }; + wm.prototype.withQueryParameter = function(a10) { + return this.v4(a10); + }; + wm.prototype.withHeader = function(a10) { + return this.sI(a10); + }; + wm.prototype.withQueryString = function(a10) { + return this.x4(a10); + }; + wm.prototype.withSettings = function(a10) { + return this.E4(a10); + }; + wm.prototype.withResponses = function(a10) { + return this.B4(a10); + }; + wm.prototype.withQueryParameters = function(a10) { + return this.w4(a10); + }; + wm.prototype.withHeaders = function(a10) { + return this.tI(a10); + }; + wm.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + wm.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + wm.prototype.withType = function(a10) { + return this.EC(a10); + }; + wm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(wm.prototype, "queryString", { get: function() { + return this.Wca(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "settings", { get: function() { + return this.$da(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "responses", { get: function() { + return this.mda(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "queryParameters", { get: function() { + return this.Vca(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "type", { get: function() { + return this.jF(); + }, configurable: true }); + Object.defineProperty(wm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + wm.prototype.$classData = r8({ zva: 0 }, false, "amf.client.model.domain.SecurityScheme", { zva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function X8() { + this.ea = this.k = null; + } + X8.prototype = new u7(); + X8.prototype.constructor = X8; + d7 = X8.prototype; + d7.n7a = function(a10) { + this.k = a10; + this.ea = nv().ea; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + X8.prototype.n7a.call(this, new GZ().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Tag"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, dj().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.oT = function() { + Z10(); + var a10 = ar(this.k.g, dj().Sf); + return U_(N52(), a10); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof X8) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, dj().Va); + Z10().cb(); + return gb(a10); + }; + d7.IC = function() { + return this.oT(); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = dj().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + X8.prototype.annotations = function() { + return this.rb(); + }; + X8.prototype.graph = function() { + return jU(this); + }; + X8.prototype.withId = function(a10) { + return this.$b(a10); + }; + X8.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + X8.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(X8.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(X8.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(X8.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(X8.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + X8.prototype.withVariables = function(a10) { + var b10 = this.k; + Z10(); + N52(); + a10 = a10.k; + var c10 = dj().Sf; + Vd(b10, c10, a10); + return this; + }; + X8.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + X8.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(X8.prototype, "documentation", { get: function() { + return this.IC(); + }, configurable: true }); + Object.defineProperty(X8.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(X8.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + X8.prototype.$classData = r8({ Cva: 0 }, false, "amf.client.model.domain.Tag", { Cva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cn() { + this.ea = this.k = null; + } + Cn.prototype = new u7(); + Cn.prototype.constructor = Cn; + d7 = Cn.prototype; + d7.H = function() { + return "TemplatedLink"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Cn.prototype.Fla.call(this, new Bn().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, An().R); + Z10().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Cn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.Fla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, An().Va); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = An().Va; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + Cn.prototype.annotations = function() { + return this.rb(); + }; + Cn.prototype.graph = function() { + return jU(this); + }; + Cn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Cn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Cn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Cn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Cn.prototype.withServer = function(a10) { + var b10 = this.k; + Z10(); + U8(); + a10 = a10.k; + var c10 = An().WF; + Vd(b10, c10, a10); + return this; + }; + Cn.prototype.withRequestBody = function(a10) { + var b10 = this.k, c10 = An().VF; + eb(b10, c10, a10); + return this; + }; + Cn.prototype.withMapping = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = htb(); + a10 = uk(tk(c10, a10, e10)); + c10 = An().kD; + Zd(b10, c10, a10); + return this; + }; + Cn.prototype.withOperationRef = function(a10) { + var b10 = this.k, c10 = An().pN; + eb(b10, c10, a10); + return this; + }; + Cn.prototype.withOperationId = function(a10) { + var b10 = this.k, c10 = An().RF; + eb(b10, c10, a10); + return this; + }; + Cn.prototype.withTemplate = function(a10) { + var b10 = this.k, c10 = An().g8; + eb(b10, c10, a10); + return this; + }; + Cn.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Cn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Cn.prototype, "server", { get: function() { + Z10(); + var a10 = B6(this.k.g, An().WF); + return VWa(U8(), a10); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "requestBody", { get: function() { + Z10(); + var a10 = B6(this.k.g, An().VF); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "mapping", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, An().kD), c10 = htb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "operationRef", { get: function() { + Z10(); + var a10 = B6(this.k.g, An().pN); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "operationId", { get: function() { + Z10(); + var a10 = B6(this.k.g, An().RF); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "template", { get: function() { + Z10(); + var a10 = B6(this.k.g, An().RF); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Cn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Cn.prototype.$classData = r8({ Dva: 0 }, false, "amf.client.model.domain.TemplatedLink", { Dva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sm() { + this.ea = this.k = null; + } + Sm.prototype = new u7(); + Sm.prototype.constructor = Sm; + d7 = Sm.prototype; + d7.H = function() { + return "WebApi"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Qm().R); + Z10().cb(); + return gb(a10); + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Sm.prototype.Gla.call(this, new Rm().K(new S6().a(), a10)); + return this; + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.MQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().Gh; + Wr(b10, c10, a10); + return this; + }; + d7.B9 = function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().yl), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Sm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.VQ = function() { + return this.B9(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Gla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.w8 = function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().Wp), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Qm().Va); + Z10().cb(); + return gb(a10); + }; + d7.vW = function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().lh), c10 = U8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.b4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().yl; + Wr(b10, c10, a10); + return this; + }; + d7.eX = function(a10) { + Z10(); + a10 = this.k.CM(a10); + return VWa(U8(), a10); + }; + d7.NQ = function(a10) { + return this.eX(a10); + }; + d7.wI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = w8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().dc; + Zd(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.qW = function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().Gh), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Qm().Va; + eb(b10, c10, a10); + return this; + }; + d7.I4 = function(a10) { + var b10 = this.k, c10 = Qm().Ym; + eb(b10, c10, a10); + return this; + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Sea = function() { + Z10(); + var a10 = B6(this.k.g, Qm().Ym); + Z10().cb(); + return gb(a10); + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.V3 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().Wp; + Wr(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.eo = function() { + var a10 = Ab(this.k.x, q5(rU)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.Se)); + return a10; + }; + d7.OQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = U8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().lh; + Zd(b10, c10, a10); + return this; + }; + d7.iM = function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().dc), c10 = w8(); + return Ak(a10, b10, c10).Ra(); + }; + Sm.prototype.annotations = function() { + return this.rb(); + }; + Sm.prototype.graph = function() { + return jU(this); + }; + Sm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Sm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Sm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Sm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + Sm.prototype.withDefaultServer = function(a10) { + Z10(); + a10 = this.k.CM(a10); + var b10 = new Xz().a(); + a10 = Cb(a10, b10); + return VWa(U8(), a10); + }; + Sm.prototype.withServer = function(a10) { + return this.NQ(a10); + }; + Sm.prototype.withEndPoint = function(a10) { + Z10(); + a10 = q6a(this.k, a10); + return IWa(S8(), a10); + }; + Sm.prototype.withDocumentationUrl = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(), e10 = new S6().a(); + c10 = new cn().K(e10, c10); + e10 = li().Pf; + a10 = eb(c10, e10, a10); + c10 = Qm().Uv; + ig(b10, c10, a10); + return U_(N52(), a10); + }; + Sm.prototype.withDocumentationTitle = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(), e10 = new S6().a(); + c10 = new cn().K(e10, c10); + e10 = li().Kn; + a10 = eb(c10, e10, a10); + c10 = Qm().Uv; + ig(b10, c10, a10); + return U_(N52(), a10); + }; + Sm.prototype.withSecurity = function(a10) { + return this.wI(a10); + }; + Sm.prototype.withServers = function(a10) { + return this.OQ(a10); + }; + Sm.prototype.withDocumentation = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = N52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().Uv; + Zd(b10, c10, a10); + return this; + }; + Sm.prototype.withLicense = function(a10) { + var b10 = this.k; + Z10(); + itb(); + a10 = a10.k; + var c10 = Qm().OF; + Vd(b10, c10, a10); + return this; + }; + Sm.prototype.withProvider = function(a10) { + var b10 = this.k; + Z10(); + jtb(); + a10 = a10.k; + var c10 = Qm().SF; + Vd(b10, c10, a10); + return this; + }; + Sm.prototype.withTermsOfService = function(a10) { + var b10 = this.k, c10 = Qm().XF; + eb(b10, c10, a10); + return this; + }; + Sm.prototype.withVersion = function(a10) { + return this.I4(a10); + }; + Sm.prototype.withContentType = function(a10) { + return this.b4(a10); + }; + Sm.prototype.withAccepts = function(a10) { + return this.V3(a10); + }; + Sm.prototype.withEndPoints = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = S8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Qm().Yp; + Zd(b10, c10, a10); + return this; + }; + Sm.prototype.withSchemes = function(a10) { + return this.MQ(a10); + }; + Sm.prototype.withIdentifier = function(a10) { + var b10 = this.k, c10 = Qm().fY; + eb(b10, c10, a10); + return this; + }; + Sm.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Sm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Sm.prototype, "security", { get: function() { + return this.iM(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "servers", { get: function() { + return this.vW(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "documentations", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().Uv), c10 = N52(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "license", { get: function() { + Z10(); + var a10 = B6(this.k.g, Qm().OF), b10 = itb(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "provider", { get: function() { + Z10(); + var a10 = B6(this.k.g, Qm().SF), b10 = jtb(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "termsOfService", { get: function() { + Z10(); + var a10 = B6(this.k.g, Qm().XF); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "version", { get: function() { + return this.Sea(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "contentType", { get: function() { + return this.VQ(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "accepts", { get: function() { + return this.w8(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "endPoints", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Qm().Yp), c10 = S8(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "schemes", { get: function() { + return this.qW(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "identifier", { get: function() { + Z10(); + var a10 = B6(this.k.g, Qm().fY); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Sm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Sm.prototype.$classData = r8({ Jva: 0 }, false, "amf.client.model.domain.WebApi", { Jva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function GC() { + this.r = this.$ = this.Ds = null; + } + GC.prototype = new u7(); + GC.prototype.constructor = GC; + d7 = GC.prototype; + d7.H = function() { + return "TrackedElement"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof GC) { + var b10 = this.Ds; + a10 = a10.Ds; + return null === b10 ? null === a10 : r7a(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Ds; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ve = function() { + return this.$; + }; + d7.hk = function(a10) { + this.Ds = a10; + this.$ = "tracked-element"; + this.r = UJ(a10, "", ",", ""); + kz(a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.kM = function(a10) { + var b10 = this.Ds, c10 = qe2(); + c10 = re4(c10); + return new GC().hk(Jd(b10, a10, c10)); + }; + var FC = r8({ Oxa: 0 }, false, "amf.core.annotations.TrackedElement", { Oxa: 1, f: 1, Fga: 1, Vm: 1, gf: 1, Eh: 1, dJ: 1, y: 1, v: 1, q: 1, o: 1 }); + GC.prototype.$classData = FC; + function Pd() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Pd.prototype = new u7(); + Pd.prototype.constructor = Pd; + d7 = Pd.prototype; + d7.H = function() { + return "CustomDomainProperty"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return l6a(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Pd ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Pd().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Sk(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Sk().R).A; + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new je4().e(a10), a10 = new z7().d(jj(a10.td))); + return a10.b() ? "" : a10.c(); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + function l6a(a10, b10) { + if (Vb().Ia(a10.j).b()) { + if (-1 !== (b10.indexOf("#") | 0)) { + var c10 = a10.dd(); + c10 = new je4().e(c10); + b10 = b10 + "/" + jj(c10.td); + return Rd(a10, b10); + } + c10 = a10.dd(); + c10 = new je4().e(c10); + b10 = b10 + "#" + jj(c10.td); + return Rd(a10, b10); + } + return a10; + } + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Pd().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return Sk().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ bAa: 0 }, false, "amf.core.model.domain.extensions.CustomDomainProperty", { bAa: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, y: 1, v: 1, q: 1, o: 1 }); + function gt2() { + this.l = this.Lc = this.x = this.A = null; + } + gt2.prototype = new u7(); + gt2.prototype.constructor = gt2; + d7 = gt2.prototype; + d7.H = function() { + return "AnyFieldImpl"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gt2 && a10.l === this.l) { + var b10 = this.A, c10 = a10.A; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.x === a10.x) + return b10 = this.Lc, a10 = a10.Lc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A; + case 1: + return this.x; + case 2: + return this.Lc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Maa(this); + }; + d7.dE = function(a10, b10, c10) { + gt2.prototype.ov.call(this, a10, Vb().Ia(b10.r), b10.x, c10); + return this; + }; + d7.Bu = function() { + return this.A; + }; + d7.z = function() { + return X5(this); + }; + d7.ov = function(a10, b10, c10, e10) { + this.A = b10; + this.x = c10; + this.Lc = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.$classData = r8({ DAa: 0 }, false, "amf.core.parser.Fields$AnyFieldImpl", { DAa: 1, f: 1, Jgb: 1, GY: 1, FY: 1, HY: 1, JY: 1, y: 1, v: 1, q: 1, o: 1 }); + function bt() { + this.l = this.Lc = this.x = this.A = null; + } + bt.prototype = new u7(); + bt.prototype.constructor = bt; + d7 = bt.prototype; + d7.H = function() { + return "StrFieldImpl"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bt && a10.l === this.l) { + var b10 = this.A, c10 = a10.A; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.x === a10.x) + return b10 = this.Lc, a10 = a10.Lc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A; + case 1: + return this.x; + case 2: + return this.Lc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Maa(this); + }; + d7.dE = function(a10, b10, c10) { + var e10 = Vb().Ia(b10.r); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10)); + bt.prototype.ov.call(this, a10, e10, b10.x, c10); + return this; + }; + d7.Bu = function() { + return this.A; + }; + d7.z = function() { + return X5(this); + }; + d7.ov = function(a10, b10, c10, e10) { + this.A = b10; + this.x = c10; + this.Lc = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.$classData = r8({ HAa: 0 }, false, "amf.core.parser.Fields$StrFieldImpl", { HAa: 1, f: 1, Ngb: 1, GY: 1, FY: 1, HY: 1, JY: 1, y: 1, v: 1, q: 1, o: 1 }); + function ktb() { + this.qa = this.tg = this.Hg = this.ae = this.xc = this.uc = this.De = this.nb = this.Ic = this.vh = this.mc = this.g = this.ba = this.Ot = this.ig = null; + } + ktb.prototype = new u7(); + ktb.prototype.constructor = ktb; + d7 = ktb.prototype; + d7.a = function() { + ltb = this; + Cr(this); + tU(this); + a22(this); + b22(this); + R52(this); + NN(this); + ehb(this); + var a10 = yc(), b10 = F6().$c; + this.ig = rb(new sb(), a10, G5(b10, "definedBy"), tb(new ub(), vb().qm, "", "", H10())); + a10 = new xc().yd(yc()); + b10 = F6().Zd; + this.Ot = rb(new sb(), a10, G5(b10, "graphDependencies"), tb(new ub(), vb().qm, "", "", H10())); + a10 = F6().$c; + a10 = G5(a10, "DialectInstancePatch"); + b10 = F6().Zd; + b10 = G5(b10, "DocumentExtension"); + var c10 = Bq().ba; + this.ba = ji(a10, ji(b10, c10)); + a10 = this.ig; + b10 = this.Ot; + c10 = this.vh; + var e10 = this.mc, f10 = Jk().g; + this.g = ji(a10, ji(b10, ji(c10, ji(e10, f10)))); + return this; + }; + d7.uD = function() { + }; + d7.Pn = function(a10) { + this.xc = a10; + }; + d7.Mn = function(a10) { + this.Hg = a10; + }; + d7.nc = function(a10) { + this.qa = a10; + }; + d7.Ni = function() { + return this.mc; + }; + d7.y_ = function(a10) { + this.mc = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.On = function(a10) { + this.tg = a10; + }; + d7.Jx = function(a10) { + this.Ic = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new wO().K(new S6().a(), a10); + }; + d7.z_ = function() { + }; + d7.bq = function(a10) { + this.nb = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Rn = function(a10) { + this.ae = a10; + }; + d7.vD = function() { + }; + d7.Nn = function(a10) { + this.uc = a10; + }; + d7.Qn = function(a10) { + this.De = a10; + }; + d7.wD = function(a10) { + this.vh = a10; + }; + d7.$classData = r8({ lGa: 0 }, false, "amf.plugins.document.vocabularies.metamodel.document.DialectInstancePatchModel$", { lGa: 1, f: 1, SA: 1, yq: 1, Hn: 1, hc: 1, Rb: 1, rc: 1, Sy: 1, KF: 1, DY: 1 }); + var ltb = void 0; + function UDa() { + ltb || (ltb = new ktb().a()); + return ltb; + } + function mtb() { + Aq.call(this); + this.Qk = null; + this.B1 = false; + this.rd = this.B2 = this.Noa = this.Vma = this.AE = null; + } + mtb.prototype = new Jmb(); + mtb.prototype.constructor = mtb; + function C1a(a10, b10) { + a10 = a10.Ip.Ja(b10); + return a10 instanceof z7 && (a10 = a10.i, a10 instanceof uO) ? new z7().d(a10) : y7(); + } + function zrb(a10, b10) { + var c10 = new mtb(), e10 = y7(); + c10.Qk = a10; + Aq.prototype.zo.call(c10, b10.qh, b10.Df, b10.ni, b10.lj, y7()); + c10.B1 = false; + c10.AE = H10(); + c10.Vma = ntb(c10, "library"); + c10.Noa = ntb(c10, "root"); + c10.B2 = X1a(c10); + c10.Ip = b10.Ip; + c10.Fu = b10.Fu; + e10.b() ? (a10 = new z7().d(c10), b10 = c10.ni, e10 = Rb(Gb().ab, H10()), a10 = new s22().FU(e10, a10, b10)) : a10 = e10.c(); + c10.rd = a10; + return c10; + } + mtb.prototype.hp = function(a10) { + var b10 = a10.hb().gb, c10 = Q5().wq; + if (b10 === c10) + return ue4(), b10 = bc(), c10 = cc().bi, a10 = N6(a10, b10, c10).va, new ve4().d(a10); + a10.re() instanceof vw ? (b10 = qc(), c10 = cc().bi, b10 = N6(a10, b10, c10), b10 = ac(new M6().W(b10), "$include").na()) : b10 = false; + if (b10) + return ue4(), b10 = qc(), c10 = cc().bi, a10 = N6(a10, b10, c10), a10 = ac(new M6().W(a10), "$include").c().i, b10 = Dd(), c10 = cc().bi, a10 = N6(a10, b10, c10), new ve4().d(a10); + ue4(); + return new ye4().d(a10); + }; + function E1a(a10, b10) { + a10 = B6(a10.Qk.g, Gc().Ic); + var c10 = Jc, e10 = new bcb(); + e10.tba = b10; + return c10(a10, e10); + } + function X1a(a10) { + var b10 = B6(B6(a10.Qk.g, Gc().Pj).g, Hc().Iy).A; + if (b10 instanceof z7) + if (a10 = b10.i, a10 = Mc(ua(), a10, "/"), a10 = [zj(new Pc().fd(a10))], 0 === (a10.length | 0)) + a10 = vd(); + else { + b10 = wd(new xd(), vd()); + for (var c10 = 0, e10 = a10.length | 0; c10 < e10; ) + Ad(b10, a10[c10]), c10 = 1 + c10 | 0; + a10 = b10.eb; + } + else + b10 = Vb(), c10 = B6(a10.Qk.g, Gc().Pj), b10 = b10.Ia(B6(c10.g, Hc().De)), b10.b() ? b10 = y7() : (b10 = B6(b10.c().g, GO().Mt), c10 = w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, UV().R).A; + return f10.b() ? null : f10.c(); + }; + }(a10)), e10 = K7(), b10 = new z7().d(b10.ka(c10, e10.u))), b10 = b10.b() ? J5(K7(), H10()) : b10.c(), c10 = Vb(), e10 = B6(a10.Qk.g, Gc().Pj), c10 = c10.Ia(B6(e10.g, Hc().Fx)), c10.b() ? a10 = y7() : (c10 = B6(c10.c().g, GO().Mt), a10 = w6(/* @__PURE__ */ function() { + return function(f10) { + f10 = B6(f10.g, UV().R).A; + return f10.b() ? null : f10.c(); + }; + }(a10)), e10 = K7(), a10 = new z7().d(c10.ka(a10, e10.u))), a10 = a10.b() ? J5(K7(), H10()) : a10.c(), c10 = K7(), a10 = b10.ia(a10, c10.u).xg(); + b10 = K7(); + return a10.Lk(J5(b10, new Ib().ha(["uses", "external"])).xg()); + } + function ntb(a10, b10) { + var c10 = Vb().Ia(B6(a10.Qk.g, Gc().Pj)); + if (c10.b()) + b10 = y7(); + else if (c10 = c10.c(), b10 = "root" === b10 ? Vb().Ia(B6(c10.g, Hc().De)) : Vb().Ia(B6(c10.g, Hc().Fx)), b10.b()) + b10 = y7(); + else { + b10 = B6(b10.c().g, GO().Mt); + c10 = w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = B6(g10.g, UV().$u).A; + h10 = E1a(f10, h10.b() ? null : h10.c()); + if (h10.b()) + return y7(); + h10 = h10.c(); + g10 = B6(g10.g, UV().R).A; + return new z7().d(new R6().M(g10.b() ? null : g10.c(), h10)); + }; + }(a10)); + var e10 = K7(); + b10 = b10.ka(c10, e10.u); + c10 = new acb(); + e10 = K7(); + b10 = new z7().d(b10.ec(c10, e10.u)); + } + return (b10.b() ? H10() : b10.c()).ne(Rb(Gb().ab, H10()), Uc(/* @__PURE__ */ function() { + return function(f10, g10) { + var h10 = new R6().M(f10, g10); + f10 = h10.Tp; + g10 = h10.hr; + if (null !== g10) + return h10 = g10.ma(), g10 = g10.ya(), f10.cc(new R6().M(h10, g10)); + throw new x7().d(h10); + }; + }(a10))); + } + mtb.prototype.$classData = r8({ KHa: 0 }, false, "amf.plugins.document.vocabularies.parser.instances.DialectInstanceContext", { KHa: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, $ga: 1 }); + function otb() { + this.KH = this.t2 = this.WU = this.mC = this.N = null; + } + otb.prototype = new QGa(); + otb.prototype.constructor = otb; + d7 = otb.prototype; + d7.pqa = function() { + return this.mC; + }; + d7.H = function() { + return "OasTagToReferenceEmitter"; + }; + d7.Ob = function(a10) { + var b10 = this.mC; + if (ut(b10) && Za(b10).na()) { + var c10 = Za(b10); + if (c10 instanceof z7) + b10 = c10.i; + else { + c10 = this.N.hj(); + var e10 = dc().Fh, f10 = b10.j, g10 = y7(), h10 = "Expected shape link target on " + this.mC, k10 = Ab(this.mC.fa(), q5(jd)), l10 = this.mC.Ib(); + c10.Gc(e10.j, f10, g10, h10, k10, Yb().qb, l10); + } + } + b10 instanceof rf && wh(b10.fa(), q5(cv)) ? ex(this.N, a10, Fna(rA(), this.KH, new z7().d(this.N.Gg()))) : b10 instanceof Wl && wh(b10.x, q5(cv)) ? ex(this.N, a10, Ena(rA(), this.KH, this.N)) : b10 instanceof ym && wh(b10.x, q5(cv)) ? ex(this.N, a10, Ena(rA(), this.KH, this.N)) : b10 instanceof Em && wh(b10.x, q5(cv)) ? (b10 = this.N, c10 = rA(), e10 = this.KH, ex(b10, a10, this.N.zf instanceof pA ? qA(c10, e10, "responses") : "" + c10.lda + e10)) : b10 instanceof bm && wh(b10.x, q5(cv)) ? ex(this.N, a10, qA(rA(), this.KH, "callbacks")) : b10 instanceof Bn && wh(b10.x, q5(cv)) ? ex(this.N, a10, qA(rA(), this.KH, "links")) : ex(this.N, a10, this.KH); + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof otb) { + var b10 = this.mC, c10 = a10.mC; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.WU, c10 = a10.WU, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10) + return b10 = this.t2, a10 = a10.t2, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.mC; + case 1: + return this.WU; + case 2: + return this.t2; + default: + throw new U6().e("" + a10); + } + }; + d7.Hia = function(a10) { + this.KH = a10; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tma = function() { + return this.WU; + }; + function OO(a10, b10, c10, e10) { + var f10 = new otb(); + f10.mC = a10; + f10.WU = b10; + f10.t2 = c10; + tQ.prototype.aA.call(f10, e10); + OEa(f10); + return f10; + } + d7.z = function() { + return X5(this); + }; + d7.La = function() { + return kr(wr(), this.mC.fa(), q5(jd)); + }; + d7.$classData = r8({ ENa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.OasTagToReferenceEmitter", { ENa: 1, UR: 1, f: 1, QR: 1, XJa: 1, wh: 1, Ma: 1, y: 1, v: 1, q: 1, o: 1 }); + function tX() { + Y32.call(this); + this.Ox = this.hF = this.eh = this.Pw = this.SD = null; + } + tX.prototype = new s4a(); + tX.prototype.constructor = tX; + d7 = tX.prototype; + d7.H = function() { + return "Raml08TypeParser"; + }; + d7.HB = function(a10, b10, c10, e10, f10, g10) { + this.SD = a10; + this.Pw = b10; + this.eh = c10; + this.hF = e10; + this.Ox = f10; + Y32.prototype.HB.call(this, a10, b10, c10, e10, f10, g10); + return this; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof tX) { + var b10 = this.SD, c10 = a10.SD; + (null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Pw, a10.Pw) ? (b10 = this.eh, c10 = a10.eh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.hF, c10 = a10.hF, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ox === a10.Ox : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.SD; + case 1: + return this.Pw; + case 2: + return this.eh; + case 3: + return this.hF; + case 4: + return this.Ox; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Cc = function() { + var a10 = UY(VY(), this.Fd), b10 = this.de, c10 = Od(O7(), this.Pw); + b10 = Sd(a10, b10, c10); + this.eh.P(b10); + a10 = this.Fd.hb().gb; + if (Q5().sa === a10) { + a10 = this.Fd; + b10 = qc(); + c10 = N6(a10, b10, this.ra); + a10 = ac(new M6().W(c10), "schema"); + if (a10.b()) + return Vb().Ia(U3a(new O32(), this.de, this.eh, c10, this.Ox.gF, this.ra).Xi()); + a10.c(); + a10 = S3a(this, c10, this.eh, this.ra).Cc(); + if (a10.b()) + return y7(); + b10 = a10.c(); + a10 = b10.uv().PB(); + O7(); + var e10 = new P6().a(); + a10 = Sd(a10, "inherits", e10); + this.eh.P(a10); + c10 = new q42().zU("example", c10, w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return h10.qF(k10); + }; + }(this, a10)), fca(new EP().GB( + true, + true, + false + ), b10), this.ra).Cc(); + if (c10.b()) + a10 = b10; + else { + c10 = c10.c(); + e10 = qf().xd; + var f10 = K7(); + b10 = Zr(new $r(), J5(f10, new Ib().ha([b10])), new P6().a()); + Vd(a10, e10, b10); + b10 = Fg().Ec; + c10 = J5(K7(), new Ib().ha([c10])); + a10 = Zd(a10, b10, c10); + } + return new z7().d(a10); + } + return Q5().cd === a10 ? (a10 = Vb(), $Ra || ($Ra = new nZ().a()), c10 = ZRa(this.Fd), e10 = this.de, f10 = Od(O7(), this.Pw), c10 = Sd(c10, e10, f10), b10 = b10.j, J5(K7(), H10()), b10 = Ai(c10, b10), c10 = this.Fd, e10 = lc(), a10.Ia(W3a(new V3a(), b10, N6(c10, e10, this.ra), this.Fd, this.ra).zP())) : R3a(this, this.Fd, this.eh, this.de, this.Ox, this.ra).Cc(); + }; + d7.Nb = function() { + return this.ra; + }; + d7.hQ = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + f10 = !!f10; + xW(); + var h10 = a10.ra; + return new tX().HB(b10, (T6(), mh(T6(), c10)), e10, RW(f10, false), g10, new uB().il(h10.qh, h10.Df, h10, new z7().d(h10.pe()), y7(), y7(), iA().ho)); + }; + }(this)); + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.$classData = r8({ tOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml08TypeParser", { tOa: 1, WPa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function xX() { + Y32.call(this); + this.Ox = this.hF = this.eh = this.Pw = this.SD = null; + } + xX.prototype = new s4a(); + xX.prototype.constructor = xX; + d7 = xX.prototype; + d7.HB = function(a10, b10, c10, e10, f10, g10) { + this.SD = a10; + this.Pw = b10; + this.eh = c10; + this.hF = e10; + this.Ox = f10; + Y32.prototype.HB.call(this, a10, b10, c10, e10, f10, g10); + return this; + }; + d7.H = function() { + return "Raml10TypeParser"; + }; + d7.E = function() { + return 5; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof xX) { + var b10 = this.SD, c10 = a10.SD; + (null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Pw, a10.Pw) ? (b10 = this.eh, c10 = a10.eh, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + b10 ? (b10 = this.hF, c10 = a10.hF, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.Ox === a10.Ox : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.SD; + case 1: + return this.Pw; + case 2: + return this.eh; + case 3: + return this.hF; + case 4: + return this.Ox; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Nb = function() { + return this.ra; + }; + d7.hQ = function() { + return aW(/* @__PURE__ */ function(a10) { + return function(b10, c10, e10, f10, g10) { + f10 = !!f10; + QW(); + var h10 = a10.ra; + return new xX().HB(b10, (T6(), mh(T6(), c10)), e10, RW(f10, false), g10, h10); + }; + }(this)); + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.$classData = r8({ IOa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.Raml10TypeParser", { IOa: 1, WPa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function M4a() { + I22.call(this); + this.eh = this.Za = this.wa = null; + } + M4a.prototype = new J22(); + M4a.prototype.constructor = M4a; + d7 = M4a.prototype; + d7.H = function() { + return "ArrayShapeParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof M4a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + if ((null === b10 ? null === c10 : b10.h(c10)) && Bj(this.Za, a10.Za)) + return b10 = this.eh, a10 = a10.eh, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + case 2: + return this.eh; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + this.eh.P(this.wa); + I22.prototype.Xi.call(this); + var a10 = new M6().W(this.Za), b10 = this.l, c10 = uh().qr; + Gg(a10, "uniqueItems", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = fh(new je4().e("collectionFormat")); + c10 = this.l; + var e10 = uh().RC; + Gg(a10, b10, Hg(Ig(c10, e10, this.l.Nb()), this.wa)); + a10 = ac(new M6().W(this.Za), "items"); + if (a10.b()) + a10 = y7(); + else if (a10 = a10.c(), b10 = w6(/* @__PURE__ */ function(g10) { + return function(h10) { + return h10.ub(g10.wa.j, lt2()); + }; + }(this)), c10 = this.l.OJ, e10 = RW(false, false), b10 = PW(QW(), a10, b10, e10, c10, this.l.Nb()).Cc(), b10.b()) + a10 = y7(); + else { + b10 = b10.c(); + c10 = J5(K7(), new Ib().ha([b10])); + e10 = yh(this.wa); + ae4(); + a10 = a10.da; + a10 = ce4(0, de4(ee4(), a10.rf, a10.If, a10.Yf, a10.bg)); + sca(this, c10, e10, a10); + if (b10 instanceof th) + a10 = YA(ZA(this.wa, b10)); + else if (b10 instanceof pi) + a10 = YA(ZA(this.wa, b10)); + else { + if (null === b10) + throw new x7().d(b10); + a10 = ZA(this.wa, b10); + } + a10 = new z7().d(a10); + } + a10 = a10.b() ? ptb(this) : a10; + a10 = a10.b() ? new z7().d(this.wa) : a10; + if (a10 instanceof z7 && (a10 = a10.i, a10 instanceof vh)) + return this.eh.P(a10), a10; + a10 = this.l.Nb(); + b10 = sg().j8; + c10 = this.wa.j; + e10 = this.Za; + var f10 = y7(); + ec(a10, b10, c10, f10, "Cannot parse data arrangement shape", e10.da); + return this.wa; + }; + d7.t = function() { + return V5(W5(), this); + }; + function ptb(a10) { + var b10 = B6(a10.wa.aa, qf().xd).kc(); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c(); + if (b10 instanceof pi) + b10 = B6(b10.aa, uh().Ff); + else if (b10 instanceof qi) + b10 = B6(b10.aa, an().$p).ga(); + else if (b10 instanceof th) + b10 = B6(b10.aa, uh().Ff); + else if (null === b10) + throw new x7().d(b10); + b10 = new z7().d(b10); + } + var c10 = false, e10 = null; + return b10 instanceof z7 && (c10 = true, e10 = b10, e10.i instanceof th) ? new z7().d(YA(a10.wa)) : c10 && e10.i instanceof pi || c10 && e10.i instanceof qi ? new z7().d(YA(a10.wa)) : c10 && null !== e10.i ? new z7().d(a10.wa) : y7(); + } + d7.LN = function() { + return this.l; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ ZPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$ArrayShapeParser", { ZPa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, sha: 1, y: 1, v: 1, q: 1, o: 1 }); + function qtb() { + I22.call(this); + this.wa = this.Za = this.eh = this.Bm = null; + } + qtb.prototype = new J22(); + qtb.prototype.constructor = qtb; + d7 = qtb.prototype; + d7.H = function() { + return "FileShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qtb && a10.l === this.l && Bj(this.Bm, a10.Bm)) { + var b10 = this.eh; + a10 = a10.eh; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Bm; + case 1: + return this.eh; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.CH = function() { + I22.prototype.Xi.call(this); + qca(this, this.Za, this.wa); + var a10 = false, b10 = null, c10 = ac(new M6().W(this.Za), "fileTypes"); + a: { + if (c10 instanceof z7) { + a10 = true; + b10 = c10; + c10 = b10.i; + var e10 = c10.i.hb().gb, f10 = Q5().cd; + if (e10 === f10) { + a10 = this.wa; + b10 = gn().OA; + e10 = c10.i; + f10 = tw(); + e10 = N6(e10, f10, this.l.Nb()).Cm; + f10 = w6(/* @__PURE__ */ function(h10) { + return function(k10) { + var l10 = bc(); + return ih(new jh(), N6(k10, l10, h10.l.Nb()).va, new P6().a()); + }; + }(this)); + var g10 = rw(); + e10 = e10.ka(f10, g10.sc); + c10 = Od(O7(), c10.i); + bs(a10, b10, e10, c10); + break a; + } + } + if (a10 && (c10 = b10.i, e10 = c10.i.hb().gb, f10 = Q5().Na, e10 === f10)) { + a10 = this.wa; + b10 = gn().OA; + e10 = K7(); + f10 = c10.i; + g10 = bc(); + f10 = [ih(new jh(), N6(f10, g10, this.l.Nb()).va, new P6().a())]; + e10 = J5(e10, new Ib().ha(f10)); + c10 = Od(O7(), c10.i); + bs(a10, b10, e10, c10); + break a; + } + a10 && (c10 = b10.i, a10 = this.l.Nb(), b10 = sg().m8, e10 = this.wa.j, f10 = new z7().d(ic(gn().OA.r)), g10 = "Unexpected syntax for the fileTypes property: " + c10.i.hb().gb, ec(a10, b10, e10, f10, g10, c10.i.da)); + } + c10 = new M6().W(this.Za); + a10 = fh(new je4().e("minimum")); + c10 = ac(c10, a10); + c10.b() || (b10 = c10.c(), e10 = new Qg().Vb(b10.i, this.l.Nb()), c10 = this.wa, a10 = Fg().wj, e10 = e10.Zf(), b10 = Od(O7(), b10), Rg(c10, a10, e10, b10)); + c10 = new M6().W(this.Za); + a10 = fh(new je4().e("maximum")); + c10 = ac(c10, a10); + c10.b() || (b10 = c10.c(), e10 = new Qg().Vb( + b10.i, + this.l.Nb() + ), c10 = this.wa, a10 = Fg().vj, e10 = e10.Zf(), b10 = Od(O7(), b10), Rg(c10, a10, e10, b10)); + c10 = new M6().W(this.Za); + a10 = fh(new je4().e("format")); + b10 = this.l; + e10 = Fg().Fn; + Gg(c10, a10, Hg(Ig(b10, e10, this.l.Nb()), this.wa)); + c10 = ac(new M6().W(this.Za), "multipleOf"); + c10.b() || (b10 = c10.c(), e10 = new Qg().Vb(b10.i, this.l.Nb()), c10 = this.wa, a10 = Fg().av, e10 = e10.Zf(), b10 = Od(O7(), b10), Rg(c10, a10, e10, b10)); + return this.wa; + }; + function G4a(a10, b10, c10) { + var e10 = new qtb(); + e10.Bm = b10; + e10.eh = c10; + I22.prototype.EB.call(e10, a10); + var f10 = qc(); + e10.Za = N6(b10, f10, a10.Nb()); + a10 = Od(O7(), e10.Za); + a10 = new Wh().K(new S6().a(), a10); + c10.P(a10); + e10.wa = a10; + return e10; + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ bQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$FileShapeParser", { bQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, $Pa: 1, y: 1, v: 1, q: 1, o: 1 }); + function I4a() { + I22.call(this); + this.Za = this.wa = null; + } + I4a.prototype = new J22(); + I4a.prototype.constructor = I4a; + function H4a(a10, b10, c10, e10) { + a10.wa = c10; + a10.Za = e10; + I22.prototype.EB.call(a10, b10); + return a10; + } + d7 = I4a.prototype; + d7.H = function() { + return "NodeShapeParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof I4a && a10.l === this.l) { + var b10 = this.wa, c10 = a10.wa; + return (null === b10 ? null === c10 : b10.h(c10)) ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.wa; + case 1: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.Xi = function() { + I22.prototype.Xi.call(this); + rtb(this); + var a10 = new M6().W(this.Za), b10 = this.l, c10 = Ih().dw; + Gg(a10, "minProperties", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ih().cw; + Gg(a10, "maxProperties", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + B6(this.wa.aa, qf().xd).b() ? (a10 = this.wa, b10 = Ih().Cn, Bi(a10, b10, false)) : ac(new M6().W(this.Za), "additionalProperties").b() && (a10 = M2a(this.wa).Od(w6(/* @__PURE__ */ function() { + return function(m10) { + return m10 instanceof Hh && B6(m10.aa, Ih().Cn).A.na() ? (m10 = B6(m10.aa, Ih().Cn), Ic(m10)) : false; + }; + }(this))), b10 = this.wa, c10 = Ih().Cn, Bi(b10, c10, a10)); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ih().Cn; + b10 = zFa(Hg(Ig(b10, c10, this.l.Nb()), this.wa)); + Gg(a10, "additionalProperties", rP(b10, new xi().a())); + a10 = ac(new M6().W(this.Za), fh(new je4().e("additionalProperties"))); + if (!a10.b() && (a10 = a10.c(), b10 = oX(pX(), a10, w6(/* @__PURE__ */ function(m10) { + return function(p10) { + p10.ub(m10.wa.j, lt2()); + }; + }(this)), wz(uz(), this.l.Nb())).Cc(), !b10.b())) { + b10 = b10.c(); + c10 = this.wa; + var e10 = Ih().vF; + a10 = Od(O7(), a10); + Rg(c10, e10, b10, a10); + } + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ih().Us; + Gg(a10, "discriminator", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = new M6().W(this.Za); + b10 = this.l; + c10 = Ih().Jy; + Gg(a10, "discriminatorValue", nh(Hg(Ig(b10, c10, this.l.Nb()), this.wa))); + a10 = ac(new M6().W(this.Za), "properties"); + if (!a10.b()) + if (a10 = a10.c(), b10 = a10.i.hb().gb, Q5().sa === b10) { + b10 = a10.i; + c10 = qc(); + b10 = N6(b10, c10, this.l.Nb()); + b10 = ZFa(new OP(), this.l, b10, w6(/* @__PURE__ */ function(m10) { + return function(p10) { + return p5a(m10.wa, p10); + }; + }(this))).Vg(); + b10.Od(w6(/* @__PURE__ */ function() { + return function(m10) { + m10 = B6(m10.aa, Qi().cv); + return !oN(m10); + }; + }(this))) ? (c10 = B6(this.wa.aa, Ih().Cn), c10 = Ic(c10)) : c10 = false; + if (c10) { + c10 = this.l.Nb(); + e10 = sg().EZ; + var f10 = this.wa.j, g10 = this.l.Fd, h10 = y7(); + ec( + c10, + e10, + f10, + h10, + "Node without additional properties support cannot have pattern properties", + g10.da + ); + } + b10.U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = K7(), A10 = [B6(t10.aa, Qi().Vf)]; + v10 = J5(v10, new Ib().ha(A10)); + t10 = yb(t10); + ae4(); + A10 = p10.da; + A10 = ce4(0, de4(ee4(), A10.rf, A10.If, A10.Yf, A10.bg)); + sca(m10, v10, t10, A10); + }; + }(this, a10))); + c10 = B6(this.wa.aa, Ih().Us).A; + if (!c10.b() && (g10 = c10.c(), !b10.Od(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + t10 = B6(t10.aa, qf().R).A; + return (t10.b() ? null : t10.c()) === p10; + }; + }(this, g10))))) { + c10 = this.l.Nb(); + e10 = sg().eZ; + f10 = this.wa.j; + g10 = "Property '" + g10 + "' marked as discriminator is missing in properties facet"; + h10 = y7(); + var k10 = y7(), l10 = y7(); + c10.Gc(e10.j, f10, h10, g10, k10, Yb().qb, l10); + } + c10 = this.wa; + e10 = Ih().kh; + b10 = Zr(new $r(), b10, Od(O7(), a10.i)); + a10 = Od(O7(), a10); + Rg(c10, e10, b10, a10); + } else + Q5().nd !== b10 && (b10 = this.l.Nb(), c10 = sg().v6, e10 = this.wa.j, f10 = y7(), ec(b10, c10, e10, f10, "Properties facet must be a map of key and values", a10.da)); + b10 = Rb(xgb(), H10()); + B6(this.wa.aa, Ih().kh).U(w6(/* @__PURE__ */ function(m10, p10) { + return function(t10) { + var v10 = B6(t10.aa, qf().R).A; + v10 = v10.b() ? null : v10.c(); + p10.Ue(v10, t10); + return p10; + }; + }(this, b10))); + a10 = new M6().W(this.Za); + c10 = fh(new je4().e("dependencies")); + a10 = ac(a10, c10); + a10.b() || (a10 = a10.c(), c10 = a10.i, e10 = qc(), e10 = U4a( + new d42(), + N6(c10, e10, this.l.Nb()), + b10, + this.l.Nb() + ).Vg(), b10 = this.wa, c10 = Ih().VC, e10 = Zr(new $r(), e10, Od(O7(), a10.i)), a10 = Od(O7(), a10), Rg(b10, c10, e10, a10)); + return this.wa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.LN = function() { + return this.l; + }; + function rtb(a10) { + if (1 === B6(a10.wa.aa, qf().xd).Oa() && B6(a10.wa.aa, qf().xd).ga() instanceof Vh) { + var b10 = ac(new M6().W(a10.Za), "discriminator"); + if (!b10.b()) { + b10 = b10.c(); + var c10 = a10.l.Nb(), e10 = sg().yR, f10 = a10.wa.j, g10 = y7(); + ec(c10, e10, f10, g10, "Property discriminator forbidden in a node extending a unionShape", b10.da); + } + b10 = ac(new M6().W(a10.Za), "discriminatorValue"); + b10.b() || (b10 = b10.c(), c10 = a10.l.Nb(), e10 = sg().yR, a10 = a10.wa.j, f10 = y7(), ec(c10, e10, a10, f10, "Property discriminatorValue forbidden in a node extending a unionShape", b10.da)); + } + } + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ eQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$NodeShapeParser", { eQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, sha: 1, y: 1, v: 1, q: 1, o: 1 }); + function E4a() { + I22.call(this); + this.Za = this.wa = this.nq = this.YJ = null; + this.Cg = false; + } + E4a.prototype = new J22(); + E4a.prototype.constructor = E4a; + d7 = E4a.prototype; + d7.H = function() { + return "ScalarShapeParser"; + }; + function stb(a10, b10, c10, e10) { + b10.b() ? b10 = false : (b10 = b10.c(), b10 = Ed(ua(), b10, "#integer")); + if (b10 && -1 !== (c10.indexOf(".") | 0)) { + b10 = a10.l.Nb(); + var f10 = sg().e6; + a10 = a10.wa.j; + c10 = "Invalid decimal point for an integer: " + c10; + var g10 = y7(); + ec(b10, f10, a10, g10, c10, e10.da); + return false; + } + return true; + } + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof E4a && a10.l === this.l) { + if (this.nq === a10.nq) { + var b10 = this.wa, c10 = a10.wa; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? Bj(this.Za, a10.Za) : false; + } + return false; + }; + d7.fT = function() { + return this.Cg ? this.YJ : this.K9(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.nq; + case 1: + return this.wa; + case 2: + return this.Za; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.DH = function() { + I22.prototype.Xi.call(this); + qca(this, this.Za, this.wa); + var a10 = lca(mca(this.wa, this.nq, this.l.Nb()), this.Za); + if (Ue() === a10) { + var b10 = ni(this.wa).A; + if (!b10.b() && (b10 = b10.c(), "rfc3339" !== b10 && "rfc2616" !== b10)) { + b10 = this.l.Nb(); + var c10 = sg().d6, e10 = this.wa.j, f10 = this.l.se, g10 = y7(); + ec(b10, c10, e10, g10, "Invalid format value for datetime, must be 'rfc3339' or 'rfc2616'", f10.da); + } + } + b10 = this.l.uM(this.Za); + b10.b() ? (b10 = this.wa, c10 = Fg().af, a10 = ih(new jh(), LC(MC(), a10), new P6().a()), e10 = (O7(), new P6().a()).Lb(new L32().a()), Rg(b10, c10, a10, e10)) : (e10 = b10.c(), b10 = this.wa, c10 = Fg().af, a10 = ih(new jh(), LC(MC(), a10), new P6().a()), e10 = Od(O7(), e10), Rg(b10, c10, a10, e10)); + a10 = ac(new M6().W(this.Za), "minimum"); + a10.b() || (c10 = a10.c(), e10 = new Qg().Vb(c10.i, this.l.Nb()), stb(this, B6(this.wa.aa, Fg().af).A, c10.i.t(), c10.i) && (a10 = this.wa, b10 = Fg().wj, e10 = e10.Zf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10))); + a10 = ac(new M6().W(this.Za), "maximum"); + a10.b() || (c10 = a10.c(), e10 = new Qg().Vb(c10.i, this.l.Nb()), stb(this, B6(this.wa.aa, Fg().af).A, c10.i.t(), c10.i) && (a10 = this.wa, b10 = Fg().vj, e10 = e10.Zf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10))); + a10 = ac(new M6().W(this.Za), "multipleOf"); + a10.b() || (c10 = a10.c(), e10 = new Qg().Vb( + c10.i, + this.l.Nb() + ), stb(this, B6(this.wa.aa, Fg().af).A, c10.i.t(), c10.i) && (a10 = this.wa, b10 = Fg().av, e10 = e10.Zf(), c10 = Od(O7(), c10), Rg(a10, b10, e10, c10))); + return this.wa; + }; + d7.K9 = function() { + if (!this.Cg) { + var a10 = new z7().d(this.wa.j), b10 = new ox().a(), c10 = new Nd().a(); + this.YJ = w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return E2a(f10, g10); + }; + }(this, F2a(b10, a10, c10, this.l.Nb()))); + this.Cg = true; + } + return this.YJ; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ jQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$ScalarShapeParser", { jQa: 1, kJ: 1, lJ: 1, f: 1, lr: 1, eD: 1, $Pa: 1, y: 1, v: 1, q: 1, o: 1 }); + function W32() { + t42.call(this); + this.V2 = this.j0 = this.lk = null; + } + W32.prototype = new c6a(); + W32.prototype.constructor = W32; + d7 = W32.prototype; + d7.H = function() { + return "Oas2DocumentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof W32) { + var b10 = this.lk; + a10 = a10.lk; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Mb = function() { + return this.ra; + }; + d7.Tx = function(a10, b10) { + this.lk = a10; + t42.prototype.Tx.call(this, a10, b10); + this.j0 = "definitions"; + this.V2 = "securityDefinitions"; + return this; + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.ML = function(a10) { + var b10 = t42.prototype.ML.call(this, a10), c10 = new M6().W(a10), e10 = Qm().Wp; + Gg(c10, "consumes", Hg(Ig(this, e10, this.ra), b10)); + c10 = new M6().W(a10); + e10 = Qm().yl; + Gg(c10, "produces", Hg(Ig(this, e10, this.ra), b10)); + a10 = new M6().W(a10); + c10 = Qm().Gh; + Gg(a10, "schemes", Hg(Ig(this, c10, this.ra), b10)); + return b10; + }; + d7.$classData = r8({ RTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas2DocumentParser", { RTa: 1, kUa: 1, TY: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function gcb() { + t42.call(this); + this.V2 = this.j0 = this.lk = null; + } + gcb.prototype = new c6a(); + gcb.prototype.constructor = gcb; + d7 = gcb.prototype; + d7.H = function() { + return "Oas3DocumentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gcb) { + var b10 = this.lk; + a10 = a10.lk; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function ttb(a10) { + var b10 = a10.ra.Qh.et(), c10 = new qg().e("^[a-zA-Z0-9\\.\\-_]+$"), e10 = H10(); + c10 = new rg().vi(c10.ja, e10); + b10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + if (qD(h10)) { + var k10 = B6(h10.Y(), h10.Zg()).A; + if (k10 instanceof z7) { + if (k10 = k10.i, !sx(Iv(g10.hh, k10, k10.length | 0))) { + k10 = "Name " + k10 + " does not match regular expression " + g10.hh.mX + " for component declarations"; + var l10 = f10.ra, m10 = sg().kY; + yB(l10, m10, h10.j, k10, h10.fa()); + } + } else { + if (y7() !== k10) + throw new x7().d(k10); + k10 = f10.ra; + l10 = sg().kY; + yB(k10, l10, h10.j, "No name is defined for given component declaration", h10.fa()); + } + } + }; + }(a10, c10))); + } + function utb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "requestBodies"); + if (!b10.b()) { + b10 = b10.c().i; + var e10 = qc(); + N6(b10, e10, a10.ra).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.ra).va; + h10 = h10.i; + l10 = qc(); + h10 = new z42().gE(f10, N6(h10, l10, f10.ra), w6(/* @__PURE__ */ function(m10, p10, t10) { + return function(v10) { + O7(); + var A10 = new P6().a(); + v10 = Sd(v10, p10, A10); + J5(K7(), H10()); + Ai(v10, t10); + }; + }(f10, k10, g10)), f10.ra).Cc(); + h10.b() || (h10 = h10.c(), k10 = f10.ra.Qh, l10 = new Zh().a(), $h(k10, Cb(h10, l10))); + }; + }(a10, c10))); + } + } + function vtb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "examples"); + b10.b() || (b10 = b10.c(), c5a(b10, c10, a10.ra).Vg().U(w6(/* @__PURE__ */ function(e10) { + return function(f10) { + var g10 = e10.ra.Qh, h10 = new Zh().a(); + return $h(g10, Cb(f10, h10)); + }; + }(a10)))); + } + d7.Mb = function() { + return this.ra; + }; + d7.Tx = function(a10, b10) { + this.lk = a10; + t42.prototype.Tx.call(this, a10, b10); + this.j0 = "schemas"; + this.V2 = "securitySchemes"; + return this; + }; + function wtb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "callbacks"); + if (!b10.b()) { + b10 = b10.c().i; + var e10 = qc(); + N6(b10, e10, a10.ra).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = h10.Aa, l10 = bc(); + k10 = N6(k10, l10, f10.ra).va; + l10 = h10.i; + var m10 = qc(); + for (h10 = r6a(new v42(), f10, N6(l10, m10, f10.ra), w6(/* @__PURE__ */ function(p10, t10, v10) { + return function(A10) { + O7(); + var D10 = new P6().a(); + A10 = Sd(A10, t10, D10); + J5(K7(), H10()); + Ai(A10, v10); + }; + }(f10, k10, g10)), k10, h10).GH(); !h10.b(); ) + k10 = h10.ga(), l10 = new Zh().a(), Cb(k10, l10), $h(f10.ra.Qh, k10), h10 = h10.ta(); + }; + }(a10, c10))); + } + } + d7.rA = function(a10, b10) { + b10 = ac(new M6().W(b10), "components"); + if (!b10.b()) { + b10 = b10.c(); + a10 = a10.da + "#/declarations"; + b10 = b10.i; + var c10 = qc(); + b10 = N6(b10, c10, this.ra); + vtb(this, b10, a10 + "/examples"); + xtb(this, b10, a10 + "/links"); + t42.prototype.zH.call(this, b10, a10 + "/securitySchemes"); + t42.prototype.wca.call(this, b10, a10 + "/types"); + ytb(this, b10, a10 + "/headers"); + t42.prototype.Yna.call(this, b10, a10 + "/parameters"); + t42.prototype.f2.call(this, "responses", b10, a10 + "/responses"); + utb(this, b10, a10 + "/requestBodies"); + wtb(this, b10, a10 + "/callbacks"); + t42.prototype.d2.call(this, b10, a10); + Q2a( + new C32(), + jx(new je4().e("resourceTypes")), + w6(/* @__PURE__ */ function() { + return function(e10) { + return dD(eD(), e10); + }; + }(this)), + b10, + a10 + "/resourceTypes", + this.ra + ).hd(); + Q2a(new C32(), jx(new je4().e("traits")), w6(/* @__PURE__ */ function() { + return function(e10) { + return gD(hD(), e10); + }; + }(this)), b10, a10 + "/traits", this.ra).hd(); + Zz(this.ra, a10, b10, "components"); + ttb(this); + } + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + function ytb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "headers"); + if (!b10.b()) { + b10 = b10.c().i; + var e10 = qc(); + new l42().Hw(N6(b10, e10, a10.ra), w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + J5(K7(), H10()); + Ai(h10, g10); + }; + }(a10, c10)), a10.ra).Vg().U(w6(/* @__PURE__ */ function(f10) { + return function(g10) { + var h10 = new Zh().a(); + h10 = Cb(g10, h10); + var k10 = new U7().a(); + Cb(h10, k10); + h10 = f10.ra.Qh; + k10 = h10.YD; + var l10 = B6(g10.g, cj().R).A; + l10 = l10.b() ? null : l10.c(); + h10.YD = k10.cc(new R6().M(l10, g10)); + }; + }(a10))); + } + } + d7.ML = function(a10) { + var b10 = t42.prototype.ML.call(this, a10), c10 = new M6().W(a10), e10 = jx(new je4().e("consumes")), f10 = Qm().Wp; + Gg(c10, e10, Hg(Ig(this, f10, this.ra), b10)); + c10 = new M6().W(a10); + e10 = jx(new je4().e("produces")); + f10 = Qm().yl; + Gg(c10, e10, Hg(Ig(this, f10, this.ra), b10)); + a10 = new M6().W(a10); + c10 = jx(new je4().e("schemes")); + e10 = Qm().Gh; + Gg(a10, c10, Hg(Ig(this, e10, this.ra), b10)); + return b10; + }; + function xtb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "links"); + if (!b10.b()) { + b10 = b10.c().i; + var e10 = qc(); + N6(b10, e10, a10.ra).sb.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + var k10 = ka(new Qg().Vb(h10.Aa, f10.ra).Zf().r); + h10 = Qdb(new h62(), h10.i, k10, w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + J5(K7(), H10()); + Ai(p10, m10); + }; + }(f10, g10)), f10.ra).Cc(); + h10.b() || (h10 = h10.c(), k10 = new Zh().a(), Cb(h10, k10), $h(f10.ra.Qh, h10)); + }; + }(a10, c10))); + } + } + d7.$classData = r8({ VTa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.Oas3DocumentParser", { VTa: 1, kUa: 1, TY: 1, f: 1, Yu: 1, $r: 1, sg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Y52() { + M22.call(this); + this.qi = this.ra = this.EG = this.ee = null; + } + Y52.prototype = new MYa(); + Y52.prototype.constructor = Y52; + d7 = Y52.prototype; + d7.H = function() { + return "OasFragmentParser"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Y52) { + var b10 = this.ee, c10 = a10.ee; + if (null === b10 ? null === c10 : b10.h(c10)) + return b10 = this.EG, a10 = a10.EG, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ee; + case 1: + return this.EG; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + function fcb(a10, b10, c10, e10) { + a10.ee = b10; + a10.EG = c10; + a10.ra = e10; + M22.prototype.fE.call(a10, e10); + a10.qi = nv().ea; + return a10; + } + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.ra; + }; + d7.e2 = function() { + var a10 = this.ee.$g.Xd, b10 = qc(); + a10 = kx(a10).Qp(b10); + if (a10 instanceof ye4) + a10 = a10.i; + else { + a10 = this.ra; + b10 = sg().Oy; + var c10 = this.ee.da, e10 = this.ee.$g.Xd, f10 = y7(); + ec(a10, b10, c10, f10, "Cannot parse empty map", e10.da); + a10 = ur().ce; + } + b10 = this.EG; + b10 = b10.b() ? lx().hG(this.ee) : b10; + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = Dka() === b10 ? new z7().d(new L6a().Ew(this, a10).Cca()) : Eka() === b10 ? new z7().d(new K6a().Ew(this, a10).Bca()) : Gka() === b10 ? new z7().d(new O6a().Ew(this, a10).Dca()) : Hka() === b10 ? new z7().d(new Q6a().Ew(this, a10).Fca()) : Ika() === b10 ? new z7().d(new J6a().Ew(this, a10).Aca()) : Jka() === b10 ? new z7().d(new P6a().Ew(this, a10).Eca()) : Fka() === b10 ? new z7().d(N6a(new M6a().Ew(this, a10))) : Cka() === b10 || mx() === b10 ? new z32().a().tA(this.ee, this.ra, new kp().a()) : y7()); + if (b10.b()) { + O7(); + b10 = new P6().a(); + b10 = new Mk().K(new S6().a(), b10); + c10 = this.ee.da; + e10 = Bq().uc; + b10 = eb(b10, e10, c10); + b10 = Rd(b10, this.ee.da); + O7(); + c10 = new P6().a(); + c10 = new Pk().K(new S6().a(), c10); + e10 = this.ee.xe; + f10 = Ok().Rd; + c10 = eb(c10, f10, e10); + e10 = Jk().nb; + b10 = Vd(b10, e10, c10); + c10 = this.ra; + e10 = sg().Oy; + f10 = b10.j; + var g10 = y7(); + ec(c10, e10, f10, g10, "Unsupported oas type", a10.da); + } else + b10 = b10.c(); + c10 = pz(qz( + b10, + jx(new je4().e("uses")), + a10, + this.ee.Q, + this.ra + ), this.ee.da); + e10 = this.ee.da; + f10 = Bq().uc; + e10 = eb(b10, f10, e10); + f10 = Od(O7(), this.ee.$g.Xd); + Db(e10, f10); + h6a(this, a10, b10).hd(); + tc(c10.Q) && (a10 = O4a(c10), c10 = Gk().xc, Bf(b10, c10, a10)); + return b10; + }; + d7.$classData = r8({ IUa: 0 }, false, "amf.plugins.document.webapi.parser.spec.oas.OasFragmentParser", { IUa: 1, TY: 1, f: 1, Yu: 1, $r: 1, sg: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function ztb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.uc = this.xj = this.Rd = this.R = this.qa = this.ba = this.g = this.la = this.Nd = this.Fq = this.mo = this.DR = this.Va = this.ck = this.Zc = null; + this.xa = 0; + } + ztb.prototype = new u7(); + ztb.prototype.constructor = ztb; + d7 = ztb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + Atb = this; + Cr(this); + uU(this); + bM(this); + aM(this); + wb(this); + var a10 = qb(), b10 = F6().Tb; + b10 = G5(b10, "displayName"); + var c10 = vb().Tb, e10 = K7(), f10 = F6().Tb; + this.Zc = rb(new sb(), a10, b10, tb(new ub(), c10, "display name", "Human readable name for the example", J5(e10, new Ib().ha([ic(G5(f10, "name"))])))); + a10 = qb(); + b10 = F6().Ta; + b10 = G5(b10, "guiSummary"); + c10 = vb().Ta; + e10 = K7(); + f10 = F6().Ta; + this.ck = rb(new sb(), a10, b10, tb(new ub(), c10, "gui summary", "Human readable description of the example", J5(e10, new Ib().ha([ic(G5(f10, "description"))])))); + a10 = qb(); + b10 = F6().Tb; + this.Va = rb(new sb(), a10, G5( + b10, + "description" + ), tb(new ub(), vb().Tb, "description", "", H10())); + a10 = qb(); + b10 = F6().Zd; + this.DR = rb(new sb(), a10, G5(b10, "externalValue"), tb(new ub(), vb().hg, "external value", "Raw text containing an unparsable example", H10())); + a10 = dl(); + b10 = F6().Zd; + this.mo = rb(new sb(), a10, G5(b10, "structuredValue"), tb(new ub(), vb().hg, "structured value", "Data structure containing the value of the example", H10())); + a10 = zc(); + b10 = F6().Zd; + this.Fq = rb(new sb(), a10, G5(b10, "strict"), tb( + new ub(), + vb().hg, + "strict", + "Indicates if this example should be validated against an associated schema", + H10() + )); + a10 = qb(); + b10 = F6().Tb; + this.Nd = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "media type", "Media type associated to the example", H10())); + this.la = this.R; + ii(); + a10 = [this.R, this.Zc, this.ck, this.Va, this.DR, this.Fq, this.Nd, this.mo]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = Zf().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + a10 = F6().Ta; + a10 = G5(a10, "Example"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb( + new ub(), + vb().Ta, + "Example", + "Example value for a schema inside an API", + H10() + ); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new en().K(b10, a10); + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ pYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.ExampleModel$", { pYa: 1, f: 1, ghb: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, Ty: 1, nm: 1 }); + var Atb = void 0; + function ag() { + Atb || (Atb = new ztb().a()); + return Atb; + } + function Btb() { + this.wd = this.bb = this.mc = this.qa = this.la = this.ba = this.Hf = this.JX = null; + this.xa = 0; + } + Btb.prototype = new u7(); + Btb.prototype.constructor = Btb; + d7 = Btb.prototype; + d7.a = function() { + Ctb = this; + Cr(this); + uU(this); + var a10 = dl(), b10 = F6().Jb; + this.JX = rb(new sb(), a10, G5(b10, "definition"), tb(new ub(), vb().Jb, "definition", "definition of the unknown dynamic binding", H10())); + a10 = qb(); + b10 = F6().Jb; + this.Hf = rb(new sb(), a10, G5(b10, "type"), tb(new ub(), vb().Jb, "type", "type that the binding is defining", H10())); + a10 = F6().Jb; + a10 = G5(a10, "DynamicBinding"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.la = this.Hf; + this.qa = tb(new ub(), vb().Jb, "DynamicBinding", "", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.nc = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.JX], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = nc().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new Eo().K(b10, a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.$classData = r8({ O_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.bindings.DynamicBindingModel$", { O_a: 1, f: 1, s7: 1, pd: 1, hc: 1, Rb: 1, rc: 1, VY: 1, mJ: 1, VR: 1, Oi: 1 }); + var Ctb = void 0; + function Do() { + Ctb || (Ctb = new Btb().a()); + return Ctb; + } + function bm() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + bm.prototype = new u7(); + bm.prototype.constructor = bm; + function Dtb() { + } + d7 = Dtb.prototype = bm.prototype; + d7.H = function() { + return "Callback"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof bm ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new bm().K(new S6().a(), a10); + a10 = Rd(a10, this.j); + var b10 = B6(this.g, am().R).A; + if (!b10.b()) { + b10 = b10.c(); + O7(); + var c10 = new P6().a(); + Sd(a10, b10, c10); + } + b10 = B6(this.g, am().Ky).A; + b10.b() || (b10 = b10.c(), c10 = am().Ky, eb(a10, c10, b10)); + return a10; + }; + d7.bc = function() { + return am(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, am().R).A; + a10 = a10.b() ? "default-callback" : a10.c(); + a10 = new je4().e(a10); + a10 = jj(a10.td); + var b10 = B6(this.g, am().Ky).A; + b10 = b10.b() ? "default-expression" : b10.c(); + b10 = new je4().e(b10); + return "/" + a10 + "/" + jj(b10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new bm().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return am().R; + }; + d7.z = function() { + return X5(this); + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ Eha: 0 }, false, "amf.plugins.domain.webapi.models.Callback", { Eha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Bn() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Bn.prototype = new u7(); + Bn.prototype.constructor = Bn; + d7 = Bn.prototype; + d7.H = function() { + return "TemplatedLink"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Bn ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Bn().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return An(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, An().R).A; + a10 = a10.b() ? "UnknownTemplatedLink" : a10.c(); + a10 = new je4().e(a10); + return "/templatedLink/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Bn().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return An().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ L0a: 0 }, false, "amf.plugins.domain.webapi.models.TemplatedLink", { L0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, y: 1, v: 1, q: 1, o: 1 }); + function Rm() { + this.j = this.Ke = this.x = this.g = null; + this.xa = false; + } + Rm.prototype = new u7(); + Rm.prototype.constructor = Rm; + d7 = Rm.prototype; + d7.H = function() { + return "WebApi"; + }; + d7.CM = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Zl().K(new S6().a(), b10); + var c10 = Yl().Pf; + a10 = eb(b10, c10, a10); + b10 = Qm().lh; + ig(this, b10, a10); + return a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.hda = function() { + it2(this.g, Qm().lh); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Rm ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Qm(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.mI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new tm().K(new S6().a(), b10); + var c10 = rm2().R; + a10 = eb(b10, c10, a10); + b10 = Qm().dc; + ig(this, b10, a10); + return a10; + }; + d7.fa = function() { + return this.x; + }; + d7.dd = function() { + return "#/web-api"; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.ifa = function(a10) { + var b10 = Qm().lh; + return Zd(this, b10, a10); + }; + d7.Ib = function() { + return yb(this); + }; + function q6a(a10, b10) { + O7(); + var c10 = new P6().a(), e10 = new S6().a(); + c10 = new Kl().K(e10, c10); + e10 = Jl().Uf; + b10 = eb(c10, e10, b10); + c10 = Qm().Yp; + ig(a10, c10, b10); + return b10; + } + d7.Y = function() { + return this.g; + }; + d7.Zg = function() { + return Qm().R; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + return this; + }; + d7.uW = function() { + return B6(this.g, Qm().lh); + }; + d7.$classData = r8({ M0a: 0 }, false, "amf.plugins.domain.webapi.models.WebApi", { M0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, t7: 1, y: 1, v: 1, q: 1, o: 1 }); + function ij() { + n32.call(this); + this.Xa = this.aa = null; + } + ij.prototype = new R_a(); + ij.prototype.constructor = ij; + d7 = ij.prototype; + d7.H = function() { + return "ParametrizedResourceType"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ij ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return sea(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Y = function() { + return this.aa; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + n32.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ p1a: 0 }, false, "amf.plugins.domain.webapi.models.templates.ParametrizedResourceType", { p1a: 1, iAa: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function kj() { + n32.call(this); + this.Xa = this.aa = null; + } + kj.prototype = new R_a(); + kj.prototype.constructor = kj; + d7 = kj.prototype; + d7.H = function() { + return "ParametrizedTrait"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof kj ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.bc = function() { + return tea(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Y = function() { + return this.aa; + }; + d7.z = function() { + return X5(this); + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + n32.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ q1a: 0 }, false, "amf.plugins.domain.webapi.models.templates.ParametrizedTrait", { q1a: 1, iAa: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, y: 1, v: 1, q: 1, o: 1 }); + function BJ() { + this.DA = null; + } + BJ.prototype = new Lsb(); + BJ.prototype.constructor = BJ; + BJ.prototype.a = function() { + this.DA = "Any"; + y7(); + H10(); + q5(Ha); + return this; + }; + BJ.prototype.zs = function(a10) { + return ja(Ja(Ha), [a10]); + }; + BJ.prototype.Lo = function() { + return q5(Ha); + }; + BJ.prototype.$classData = r8({ V9a: 0 }, false, "scala.reflect.ManifestFactory$AnyManifest$", { V9a: 1, E2: 1, D2: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Sxa = void 0; + function DJ() { + this.DA = null; + } + DJ.prototype = new Lsb(); + DJ.prototype.constructor = DJ; + DJ.prototype.a = function() { + this.DA = "AnyVal"; + y7(); + H10(); + q5(Ha); + return this; + }; + DJ.prototype.zs = function(a10) { + return ja(Ja(Ha), [a10]); + }; + DJ.prototype.Lo = function() { + return q5(Ha); + }; + DJ.prototype.$classData = r8({ W9a: 0 }, false, "scala.reflect.ManifestFactory$AnyValManifest$", { W9a: 1, E2: 1, D2: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Txa = void 0; + function Y8() { + this.DA = null; + } + Y8.prototype = new Lsb(); + Y8.prototype.constructor = Y8; + Y8.prototype.a = function() { + this.DA = "Nothing"; + y7(); + H10(); + q5(cWa); + return this; + }; + Y8.prototype.zs = function(a10) { + return ja(Ja(Ha), [a10]); + }; + Y8.prototype.Lo = function() { + return q5(cWa); + }; + Y8.prototype.$classData = r8({ d$a: 0 }, false, "scala.reflect.ManifestFactory$NothingManifest$", { d$a: 1, E2: 1, D2: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Etb = void 0; + function Uxa() { + Etb || (Etb = new Y8().a()); + return Etb; + } + function Z8() { + this.DA = null; + } + Z8.prototype = new Lsb(); + Z8.prototype.constructor = Z8; + Z8.prototype.a = function() { + this.DA = "Null"; + y7(); + H10(); + q5(Zza); + return this; + }; + Z8.prototype.zs = function(a10) { + return ja(Ja(Ha), [a10]); + }; + Z8.prototype.Lo = function() { + return q5(Zza); + }; + Z8.prototype.$classData = r8({ e$a: 0 }, false, "scala.reflect.ManifestFactory$NullManifest$", { e$a: 1, E2: 1, D2: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Ftb = void 0; + function Vxa() { + Ftb || (Ftb = new Z8().a()); + return Ftb; + } + function $8() { + this.DA = null; + } + $8.prototype = new Lsb(); + $8.prototype.constructor = $8; + $8.prototype.a = function() { + this.DA = "Object"; + y7(); + H10(); + q5(Ha); + return this; + }; + $8.prototype.zs = function(a10) { + return ja(Ja(Ha), [a10]); + }; + $8.prototype.Lo = function() { + return q5(Ha); + }; + $8.prototype.$classData = r8({ f$a: 0 }, false, "scala.reflect.ManifestFactory$ObjectManifest$", { f$a: 1, E2: 1, D2: 1, f: 1, ax: 1, Iu: 1, Cv: 1, Ju: 1, q: 1, o: 1, v: 1 }); + var Gtb = void 0; + function CJ() { + Gtb || (Gtb = new $8().a()); + return Gtb; + } + function a9() { + this.pJ = this.u = null; + } + a9.prototype = new kmb(); + a9.prototype.constructor = a9; + a9.prototype.a = function() { + FT.prototype.a.call(this); + Htb = this; + this.pJ = new L6().Fi(0, 0, 0); + return this; + }; + a9.prototype.Rz = function() { + return this.pJ; + }; + a9.prototype.Qd = function() { + return new jG().a(); + }; + a9.prototype.$classData = r8({ ycb: 0 }, false, "scala.collection.immutable.Vector$", { ycb: 1, Cpa: 1, xA: 1, wA: 1, vt: 1, Mo: 1, f: 1, wt: 1, No: 1, q: 1, o: 1 }); + var Htb = void 0; + function iG() { + Htb || (Htb = new a9().a()); + return Htb; + } + function pl() { + Lk.call(this); + } + pl.prototype = new L52(); + pl.prototype.constructor = pl; + function Itb() { + } + d7 = Itb.prototype = pl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + pl.prototype.LK.call(this, new ol().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "AnnotationTypeDeclaration"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.iR(); + }; + d7.qk = function() { + return this.iR(); + }; + d7.LK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.yp = function() { + return this.iR(); + }; + d7.oc = function() { + return this.iR(); + }; + d7.z = function() { + return X5(this); + }; + d7.iR = function() { + return this.k; + }; + d7.$classData = r8({ jga: 0 }, false, "amf.client.model.document.AnnotationTypeDeclaration", { jga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function rl() { + Lk.call(this); + } + rl.prototype = new L52(); + rl.prototype.constructor = rl; + function Jtb() { + } + d7 = Jtb.prototype = rl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + rl.prototype.MK.call(this, new ql().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "DataType"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof rl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.MK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.jR(); + }; + d7.qk = function() { + return this.jR(); + }; + d7.jR = function() { + return this.k; + }; + d7.yp = function() { + return this.jR(); + }; + d7.oc = function() { + return this.jR(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ kga: 0 }, false, "amf.client.model.document.DataType", { kga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function $32() { + this.ea = this.k = null; + } + $32.prototype = new u7(); + $32.prototype.constructor = $32; + d7 = $32.prototype; + d7.H = function() { + return "Dialect"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + $32.prototype.jU.call(this, new zO().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + i32(); + var a10 = B6(this.k.g, Gc().R); + i32().cb(); + return gb(a10); + }; + d7.E = function() { + return 1; + }; + d7.Rm = function(a10) { + return aU(this, a10); + }; + d7.pp = function(a10) { + return RT(this, a10); + }; + d7.up = function(a10) { + return VT(this, a10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $32) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Sl = function() { + return cU(this); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.k; + }; + d7.Gt = function(a10) { + return KL(this, a10); + }; + d7.qk = function() { + return this.k; + }; + d7.Qv = function() { + return nAa(this); + }; + d7.Pv = function(a10) { + return LL(this, a10); + }; + d7.qp = function(a10) { + return eU(this, a10); + }; + d7.tp = function(a10) { + return ST(this, a10); + }; + d7.Sm = function() { + return bU(this); + }; + d7.Wr = function() { + return this.k; + }; + d7.rp = function(a10) { + return WT(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.I4 = function(a10) { + var b10 = this.k, c10 = Gc().Ym; + eb(b10, c10, a10); + return this; + }; + d7.vp = function(a10) { + return UT(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Sea = function() { + i32(); + var a10 = B6(this.k.g, Gc().Ym); + i32().cb(); + return gb(a10); + }; + d7.z = function() { + return X5(this); + }; + d7.rI = function(a10) { + var b10 = this.k, c10 = i32(), e10 = F52(); + a10 = uk(tk(c10, a10, e10)); + c10 = Bd().vh; + Zd(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + var b10 = this.k, c10 = Gc().R; + eb(b10, c10, a10); + return this; + }; + d7.Ft = function(a10) { + return IL(this, a10); + }; + d7.eo = function() { + return ZT(this); + }; + d7.tK = function() { + var a10 = i32(), b10 = cd(this.k), c10 = F52(); + return Ak(a10, b10, c10).Ra(); + }; + d7.jU = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + $32.prototype.annotations = function() { + return this.rb(); + }; + $32.prototype.cloneUnit = function() { + return XT(this); + }; + Object.defineProperty($32.prototype, "sourceVendor", { get: function() { + return this.eo(); + }, configurable: true }); + $32.prototype.findByType = function(a10) { + return this.qp(a10); + }; + $32.prototype.findById = function(a10) { + return this.pp(a10); + }; + $32.prototype.toNativeRdfModel = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? E52() : c10[0]; + return this.rp(a10); + }; + $32.prototype.withUsage = function(a10) { + return this.vp(a10); + }; + $32.prototype.withLocation = function(a10) { + return this.tp(a10); + }; + $32.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + $32.prototype.withReferences = function(a10) { + return this.up(a10); + }; + Object.defineProperty($32.prototype, "modelVersion", { get: function() { + return dU(this); + }, configurable: true }); + Object.defineProperty($32.prototype, "usage", { get: function() { + return YT(this); + }, configurable: true }); + Object.defineProperty($32.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty($32.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + $32.prototype.references = function() { + return TT(this); + }; + Object.defineProperty($32.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + $32.prototype.withEncodes = function(a10) { + return this.Pv(a10); + }; + Object.defineProperty($32.prototype, "encodes", { get: function() { + return this.Qv(); + }, configurable: true }); + $32.prototype.withDeclares = function(a10) { + return this.Gt(a10); + }; + $32.prototype.withDeclaredElement = function(a10) { + return this.Ft(a10); + }; + Object.defineProperty($32.prototype, "declares", { get: function() { + return JL(this); + }, configurable: true }); + $32.prototype.withDocuments = function(a10) { + var b10 = this.k; + a10 = a10.k; + var c10 = Gc().Pj; + Vd(b10, c10, a10); + return this; + }; + $32.prototype.withExternals = function(a10) { + return this.rI(a10); + }; + $32.prototype.withVersion = function(a10) { + return this.I4(a10); + }; + $32.prototype.withName = function(a10) { + return this.Td(a10); + }; + $32.prototype.documents = function() { + return new r82().kla(B6(this.k.g, Gc().Pj)); + }; + Object.defineProperty($32.prototype, "externals", { get: function() { + return this.tK(); + }, configurable: true }); + Object.defineProperty($32.prototype, "allHeaders", { get: function() { + var a10 = i32(), b10 = YMa(this.k), c10 = i32().Lf(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty($32.prototype, "fragmentHeaders", { get: function() { + var a10 = i32(), b10 = Ktb(this.k), c10 = i32().Lf(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty($32.prototype, "libraryHeader", { get: function() { + var a10 = i32(), b10 = Ltb(this.k), c10 = i32().Lf(); + return bb(a10, b10, c10).Ra(); + }, configurable: true }); + $32.prototype.isFragmentHeader = function(a10) { + return yrb(this.k, a10); + }; + $32.prototype.isLibraryHeader = function(a10) { + return Arb(this.k, a10); + }; + Object.defineProperty($32.prototype, "header", { get: function() { + return YU(this.k); + }, configurable: true }); + $32.prototype.nameAndVersion = function() { + return zEa(this.k); + }; + $32.prototype.version = function() { + return this.Sea(); + }; + $32.prototype.name = function() { + return this.Xe(); + }; + $32.prototype.$classData = r8({ Yta: 0 }, false, "amf.client.model.document.Dialect", { Yta: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1 }); + function wl() { + Lk.call(this); + } + wl.prototype = new L52(); + wl.prototype.constructor = wl; + function Mtb() { + } + d7 = Mtb.prototype = wl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + wl.prototype.NK.call(this, new vl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "DocumentationItem"; + }; + d7.E = function() { + return 1; + }; + d7.kR = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof wl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.NK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.Be = function() { + return this.kR(); + }; + d7.qk = function() { + return this.kR(); + }; + d7.yp = function() { + return this.kR(); + }; + d7.oc = function() { + return this.kR(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ lga: 0 }, false, "amf.client.model.document.DocumentationItem", { lga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function Nk() { + Lk.call(this); + } + Nk.prototype = new L52(); + Nk.prototype.constructor = Nk; + function Ntb() { + } + d7 = Ntb.prototype = Nk.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Nk.prototype.QG.call(this, new Mk().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ExternalFragment"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Nk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.gR(); + }; + d7.qk = function() { + return this.gR(); + }; + d7.QG = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.yp = function() { + return this.gR(); + }; + d7.oc = function() { + return this.gR(); + }; + d7.z = function() { + return X5(this); + }; + d7.gR = function() { + return this.k; + }; + d7.$classData = r8({ nga: 0 }, false, "amf.client.model.document.ExternalFragment", { nga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function yl() { + Lk.call(this); + } + yl.prototype = new L52(); + yl.prototype.constructor = yl; + function Otb() { + } + d7 = Otb.prototype = yl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + yl.prototype.OK.call(this, new xl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "NamedExample"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof yl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.lR = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.lR(); + }; + d7.qk = function() { + return this.lR(); + }; + d7.yp = function() { + return this.lR(); + }; + d7.oc = function() { + return this.lR(); + }; + d7.z = function() { + return X5(this); + }; + d7.OK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.$classData = r8({ pga: 0 }, false, "amf.client.model.document.NamedExample", { pga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function ul() { + Lk.call(this); + } + ul.prototype = new L52(); + ul.prototype.constructor = ul; + function Ptb() { + } + d7 = Ptb.prototype = ul.prototype; + d7.H = function() { + return "PayloadFragment"; + }; + d7.L9 = function() { + ab(); + var a10 = ar(this.Sv().g, sl().nb); + return fl(ab().Um(), a10); + }; + d7.E = function() { + return 1; + }; + d7.Sv = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ul) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Q$ = function(a10, b10) { + ul.prototype.Yz.call(this, Tf(Uf(), a10.k, b10)); + }; + d7.Be = function() { + return this.Sv(); + }; + d7.S$ = function(a10, b10) { + ul.prototype.Yz.call(this, Tf(Uf(), a10.k, b10)); + }; + d7.qk = function() { + return this.Sv(); + }; + d7.Yz = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.yp = function() { + return this.Sv(); + }; + d7.zy = function() { + return B6(this.Sv().g, sl().Nd); + }; + d7.oc = function() { + return this.Sv(); + }; + d7.z = function() { + return X5(this); + }; + d7.T$ = function(a10, b10) { + ul.prototype.Yz.call(this, Tf(Uf(), a10.k, b10)); + }; + Object.defineProperty(ul.prototype, "dataNode", { get: function() { + return this.L9(); + }, configurable: true }); + Object.defineProperty(ul.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + ul.prototype.$classData = r8({ rga: 0 }, false, "amf.client.model.document.PayloadFragment", { rga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function Al() { + Lk.call(this); + } + Al.prototype = new L52(); + Al.prototype.constructor = Al; + function Qtb() { + } + d7 = Qtb.prototype = Al.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Al.prototype.PK.call(this, new zl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ResourceTypeFragment"; + }; + d7.E = function() { + return 1; + }; + d7.mR = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Al) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.mR(); + }; + d7.qk = function() { + return this.mR(); + }; + d7.yp = function() { + return this.mR(); + }; + d7.oc = function() { + return this.mR(); + }; + d7.z = function() { + return X5(this); + }; + d7.PK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.$classData = r8({ sga: 0 }, false, "amf.client.model.document.ResourceTypeFragment", { sga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cl() { + Lk.call(this); + } + Cl.prototype = new L52(); + Cl.prototype.constructor = Cl; + function Rtb() { + } + d7 = Rtb.prototype = Cl.prototype; + d7.QK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.nR = function() { + return this.k; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Cl.prototype.QK.call(this, new Bl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "SecuritySchemeFragment"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Cl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.nR(); + }; + d7.qk = function() { + return this.nR(); + }; + d7.yp = function() { + return this.nR(); + }; + d7.oc = function() { + return this.nR(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tga: 0 }, false, "amf.client.model.document.SecuritySchemeFragment", { tga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function El() { + Lk.call(this); + } + El.prototype = new L52(); + El.prototype.constructor = El; + function Stb() { + } + d7 = Stb.prototype = El.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + El.prototype.RK.call(this, new Dl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "TraitFragment"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof El) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.RK = function(a10) { + Lk.prototype.CB.call(this, a10); + return this; + }; + d7.Be = function() { + return this.oR(); + }; + d7.qk = function() { + return this.oR(); + }; + d7.yp = function() { + return this.oR(); + }; + d7.oc = function() { + return this.oR(); + }; + d7.z = function() { + return X5(this); + }; + d7.oR = function() { + return this.k; + }; + d7.$classData = r8({ uga: 0 }, false, "amf.client.model.document.TraitFragment", { uga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1 }); + function co() { + this.ea = this.k = null; + } + co.prototype = new u7(); + co.prototype.constructor = co; + d7 = co.prototype; + d7.H = function() { + return "Amqp091OperationBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + co.prototype.Mla.call(this, new Zn().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof co ? this.k === a10.k : false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Mla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + function Ttb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Zn().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().sX && null === Z10().sX) { + c10 = Z10(); + var e10 = new C_(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.sX = e10; + } + b10 = Z10().sX; + return xu(b10.l.ea, a10); + } + d7.Kf = function() { + return Ttb(this); + }; + d7.Gj = function() { + return Ttb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + co.prototype.annotations = function() { + return this.rb(); + }; + co.prototype.graph = function() { + return jU(this); + }; + co.prototype.withId = function(a10) { + return this.$b(a10); + }; + co.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + co.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(co.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(co.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(co.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(co.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + co.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + co.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + co.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(co.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(co.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(co.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + co.prototype.linkCopy = function() { + return this.Kf(); + }; + co.prototype.$classData = r8({ kua: 0 }, false, "amf.client.model.domain.Amqp091OperationBinding", { kua: 1, f: 1, LR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mn() { + this.ea = this.k = null; + } + Mn.prototype = new u7(); + Mn.prototype.constructor = Mn; + d7 = Mn.prototype; + d7.H = function() { + return "CorrelationId"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Mn.prototype.ula.call(this, new Kn().K(new S6().a(), a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Jn().R); + Z10().cb(); + return gb(a10); + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Mn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Jn().Va); + Z10().cb(); + return gb(a10); + }; + d7.ula = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Kf = function() { + return Utb(this); + }; + d7.Gj = function() { + return Utb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Jn().Va; + eb(b10, c10, a10); + return this; + }; + function Utb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Kn().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return FWa(k$a2(), a10); + } + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Mn.prototype.annotations = function() { + return this.rb(); + }; + Mn.prototype.graph = function() { + return jU(this); + }; + Mn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Mn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Mn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Mn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Mn.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Mn.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Mn.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Mn.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Mn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Mn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Mn.prototype.linkCopy = function() { + return this.Kf(); + }; + Mn.prototype.withIdLocation = function(a10) { + var b10 = this.k, c10 = Jn().uc; + eb(b10, c10, a10); + return this; + }; + Mn.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Object.defineProperty(Mn.prototype, "idLocation", { get: function() { + Z10(); + var a10 = B6(this.k.g, Jn().uc); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Mn.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Mn.prototype.$classData = r8({ qua: 0 }, false, "amf.client.model.domain.CorrelationId", { qua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function fn() { + this.ea = this.k = null; + } + fn.prototype = new u7(); + fn.prototype.constructor = fn; + d7 = fn.prototype; + d7.H = function() { + return "Example"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + fn.prototype.pla.call(this, new en().K(b10, a10)); + return this; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, ag().R); + Z10().cb(); + return gb(a10); + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return this.LD(); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.wL = function() { + Z10(); + var a10 = B6(this.k.g, ag().Nd); + Z10().cb(); + return gb(a10); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof fn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Sl = function() { + return this.sL(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, ag().Va); + Z10().cb(); + return gb(a10); + }; + d7.F3 = function() { + Z10(); + var a10 = B6(this.k.g, Zf().Rd); + Z10().cb(); + return gb(a10); + }; + d7.sq = function(a10) { + var b10 = this.k, c10 = ag().Zc; + eb(b10, c10, a10); + return this; + }; + function Vtb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new en().K(c10, b10); + a10 = Rd(b10, a10.j); + return JWa(P52(), a10); + } + d7.Kf = function() { + return Vtb(this); + }; + d7.Gj = function() { + return Vtb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.EQ = function(a10) { + var b10 = this.k, c10 = ag().Nd; + eb(b10, c10, a10); + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = ag().Va; + eb(b10, c10, a10); + return this; + }; + d7.BI = function() { + return this.F3(); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.zy = function() { + return this.wL(); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.pla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.LD = function() { + Z10(); + var a10 = B6(this.k.g, ag().Zc); + Z10().cb(); + return gb(a10); + }; + d7.sL = function() { + var a10 = Z10(), b10 = yh(this.k), c10 = Z10().Lf(); + return bb(a10, b10, c10).Ra(); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + fn.prototype.annotations = function() { + return this.rb(); + }; + fn.prototype.graph = function() { + return jU(this); + }; + fn.prototype.withId = function(a10) { + return this.$b(a10); + }; + fn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + fn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(fn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(fn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + fn.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + fn.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + fn.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(fn.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(fn.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(fn.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "toYaml", { get: function() { + return Zba(this.k); + }, configurable: true }); + Object.defineProperty(fn.prototype, "toJson", { get: function() { + a: { + var a10 = this.k; + var b10 = false, c10 = null, e10 = B6(a10.g, Zf().Rd).A; + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d($ba($f(), e10, false))); + if (e10 instanceof z7 && (b10 = true, c10 = e10, "application/json" === c10.i)) { + a10 = B6(a10.g, Zf().Rd).A; + a10 = a10.b() ? null : a10.c(); + break a; + } + b10 && "application/xml" === c10.i ? a10 = "" : (a10 = B6(a10.g, ag().mo), a10 = Yba(a10)); + } + return a10; + }, configurable: true }); + fn.prototype.linkCopy = function() { + return this.Kf(); + }; + fn.prototype.withMediaType = function(a10) { + return this.EQ(a10); + }; + fn.prototype.withStrict = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = ag().Fq; + Bi(b10, c10, a10); + return this; + }; + fn.prototype.withStructuredValue = function(a10) { + var b10 = this.k; + Z10(); + Z10().Um(); + a10 = a10.k; + var c10 = ag().mo; + Vd(b10, c10, a10); + return this; + }; + fn.prototype.withValue = function(a10) { + var b10 = this.k, c10 = Zf().Rd; + eb(b10, c10, a10); + return this; + }; + fn.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + fn.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + fn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(fn.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "strict", { get: function() { + Z10(); + var a10 = B6(this.k.g, ag().Fq); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(fn.prototype, "structuredValue", { get: function() { + Z10(); + var a10 = B6(this.k.g, ag().mo); + return fl(Z10().Um(), a10); + }, configurable: true }); + Object.defineProperty(fn.prototype, "value", { get: function() { + return this.BI(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(fn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + fn.prototype.$classData = r8({ Dua: 0 }, false, "amf.client.model.domain.Example", { Dua: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Sl() { + this.ea = this.k = null; + } + Sl.prototype = new u7(); + Sl.prototype.constructor = Sl; + d7 = Sl.prototype; + d7.PQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s$a2(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().Xm; + Zd(b10, c10, a10); + return this; + }; + d7.ffa = function(a10) { + Z10(); + a10 = this.k.gfa(a10); + return SWa(W8(), a10); + }; + d7.H = function() { + return "Operation"; + }; + d7.Xe = function() { + Z10(); + var a10 = B6(this.k.g, Pl().R); + Z10().cb(); + return gb(a10); + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Sl.prototype.oU.call(this, new Ql().K(new S6().a(), a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.HC = function() { + return this.P9(); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.oT = function() { + Z10(); + var a10 = B6(this.k.g, Pl().Sf); + return U_(N52(), a10); + }; + d7.Yd = function() { + return this.Xe(); + }; + d7.MQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + c10 = uk(tk(c10, a10, e10)); + a10 = Pl().Gh; + c10 = c10.ua(); + Wr(b10, a10, c10); + return this; + }; + d7.B9 = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().yl), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.P9 = function() { + Z10(); + var a10 = B6(this.k.g, Pl().uh); + Z10().yi(); + return yL(a10); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Sl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.VQ = function() { + return this.B9(); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.GS = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().go), c10 = Wtb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.w8 = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().Wp), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Wb = function() { + return hU(this); + }; + d7.GC = function() { + return this.GS(); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.Rj = function() { + Z10(); + var a10 = B6(this.k.g, Pl().Va); + Z10().cb(); + return gb(a10); + }; + d7.oU = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.IC = function() { + return this.oT(); + }; + d7.B4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = W8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().Al; + Zd(b10, c10, a10); + return this; + }; + d7.FQ = function(a10) { + var b10 = this.k, c10 = Pl().pm; + eb(b10, c10, a10); + return this; + }; + d7.qI = function(a10) { + var b10 = this.k; + Z10(); + N52(); + a10 = a10.k; + var c10 = Pl().Sf; + Vd(b10, c10, a10); + return this; + }; + d7.vW = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().lh), c10 = U8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.b4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + c10 = uk(tk(c10, a10, e10)); + a10 = Pl().yl; + c10 = c10.ua(); + Wr(b10, a10, c10); + return this; + }; + d7.eX = function(a10) { + Z10(); + a10 = this.k.CM(a10); + return VWa(U8(), a10); + }; + function Xtb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Ql().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return MWa(btb(), a10); + } + d7.Kf = function() { + return Xtb(this); + }; + d7.NQ = function(a10) { + return this.eX(a10); + }; + d7.Gj = function() { + return Xtb(this); + }; + d7.wI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = w8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().dc; + Zd(b10, c10, a10); + return this; + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.WQ = function() { + Z10(); + var a10 = B6(this.k.g, Pl().Xv); + Z10().yi(); + return yL(a10); + }; + d7.rea = function() { + Z10(); + var a10 = B6(this.k.g, Pl().ck); + Z10().cb(); + return gb(a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + var b10 = this.k, c10 = Pl().Va; + eb(b10, c10, a10); + return this; + }; + d7.qW = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().Gh), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }; + d7.$Q = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().Xm), c10 = s$a2(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.iV = function() { + Z10(); + var a10 = B6(this.k.g, Pl().pm); + Z10().cb(); + return gb(a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return this.Rj(); + }; + d7.z = function() { + return X5(this); + }; + d7.AI = function() { + return this.rea(); + }; + d7.BC = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Wtb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().go; + Zd(b10, c10, a10); + return this; + }; + d7.V3 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + c10 = uk(tk(c10, a10, e10)); + a10 = Pl().Wp; + c10 = c10.ua(); + Wr(b10, a10, c10); + return this; + }; + d7.A4 = function(a10) { + return this.ffa(a10); + }; + d7.Td = function(a10) { + var b10 = this.k; + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + return this; + }; + d7.xI = function(a10) { + var b10 = this.k, c10 = Pl().ck; + eb(b10, c10, a10); + return this; + }; + d7.mda = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().Al), c10 = W8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.OQ = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = U8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().lh; + Zd(b10, c10, a10); + return this; + }; + d7.pI = function(a10) { + var b10 = this.k, c10 = Pl().Xv; + Bi(b10, c10, a10); + return this; + }; + d7.iM = function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().dc), c10 = w8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.CC = function(a10) { + var b10 = this.k, c10 = Pl().uh; + Bi(b10, c10, a10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Sl.prototype.annotations = function() { + return this.rb(); + }; + Sl.prototype.graph = function() { + return jU(this); + }; + Sl.prototype.withId = function(a10) { + return this.$b(a10); + }; + Sl.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Sl.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Sl.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Sl.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Sl.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Sl.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Sl.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Sl.prototype.linkCopy = function() { + return this.Kf(); + }; + Sl.prototype.withBindings = function(a10) { + return this.BC(a10); + }; + Sl.prototype.withServer = function(a10) { + return this.NQ(a10); + }; + Sl.prototype.withCallback = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new bm().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Pl().AF; + ig(b10, c10, a10); + return EWa(Zsb(), a10); + }; + Sl.prototype.withRequest = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 0: + return Z10(), a10 = xIa(this.k), QWa(Ytb(), a10); + case 1: + return a10 = c10[0], ona(this.k, (Z10(), Ytb(), a10.k)), this; + default: + throw "No matching overload"; + } + }; + Sl.prototype.withResponse = function(a10) { + return this.A4(a10); + }; + Sl.prototype.withAbstract = function(a10) { + return this.pI(!!a10); + }; + Sl.prototype.withTags = function(a10) { + return this.PQ(a10); + }; + Sl.prototype.withServers = function(a10) { + return this.OQ(a10); + }; + Sl.prototype.withCallbacks = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Zsb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Pl().AF; + Zd(b10, c10, a10); + return this; + }; + Sl.prototype.withSecurity = function(a10) { + return this.wI(a10); + }; + Sl.prototype.withResponses = function(a10) { + return this.B4(a10); + }; + Sl.prototype.withContentType = function(a10) { + return this.b4(a10); + }; + Sl.prototype.withAccepts = function(a10) { + return this.V3(a10); + }; + Sl.prototype.withSchemes = function(a10) { + return this.MQ(a10); + }; + Sl.prototype.withDocumentation = function(a10) { + return this.qI(a10); + }; + Sl.prototype.withSummary = function(a10) { + return this.xI(a10); + }; + Sl.prototype.withDeprecated = function(a10) { + return this.CC(!!a10); + }; + Sl.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Sl.prototype.withName = function(a10) { + return this.Td(a10); + }; + Sl.prototype.withMethod = function(a10) { + return this.FQ(a10); + }; + Object.defineProperty(Sl.prototype, "bindings", { get: function() { + return this.GC(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "isAbstract", { get: function() { + return this.WQ(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "servers", { get: function() { + return this.vW(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "callbacks", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().AF), c10 = Zsb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "tags", { get: function() { + return this.$Q(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "security", { get: function() { + return this.iM(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "responses", { get: function() { + return this.mda(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "requests", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Pl().dB), c10 = Ytb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "request", { get: function() { + Z10(); + var a10 = AD(this.k); + return QWa(Ytb(), a10); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "contentType", { get: function() { + return this.VQ(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "accepts", { get: function() { + return this.w8(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "schemes", { get: function() { + return this.qW(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "documentation", { get: function() { + return this.IC(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "summary", { get: function() { + return this.AI(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "deprecated", { get: function() { + return this.HC(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Object.defineProperty(Sl.prototype, "method", { get: function() { + return this.iV(); + }, configurable: true }); + Sl.prototype.$classData = r8({ dva: 0 }, false, "amf.client.model.domain.Operation", { dva: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function gm() { + this.ea = this.k = null; + } + gm.prototype = new u7(); + gm.prototype.constructor = gm; + d7 = gm.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + gm.prototype.cma.call(this, new ij().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ParametrizedResourceType"; + }; + d7.E = function() { + return 1; + }; + d7.aR = function() { + return k_a(this); + }; + d7.Yd = function() { + return d_a(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof gm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G4 = function(a10) { + return g_a(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.cma = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.CI = function() { + return e_a(this); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return i_a(this, a10); + }; + d7.yI = function(a10) { + return j_a(this, a10); + }; + gm.prototype.annotations = function() { + return this.rb(); + }; + gm.prototype.graph = function() { + return jU(this); + }; + gm.prototype.withId = function(a10) { + return this.$b(a10); + }; + gm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + gm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(gm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(gm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(gm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(gm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + gm.prototype.withVariables = function(a10) { + return this.yI(a10); + }; + gm.prototype.withTarget = function(a10) { + return this.G4(a10); + }; + gm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(gm.prototype, "variables", { get: function() { + return this.CI(); + }, configurable: true }); + Object.defineProperty(gm.prototype, "target", { get: function() { + return this.aR(); + }, configurable: true }); + Object.defineProperty(gm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + gm.prototype.$classData = r8({ hva: 0 }, false, "amf.client.model.domain.ParametrizedResourceType", { hva: 1, f: 1, gva: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function hm() { + this.ea = this.k = null; + } + hm.prototype = new u7(); + hm.prototype.constructor = hm; + d7 = hm.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + hm.prototype.dma.call(this, new kj().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ParametrizedTrait"; + }; + d7.E = function() { + return 1; + }; + d7.aR = function() { + return k_a(this); + }; + d7.Yd = function() { + return d_a(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof hm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G4 = function(a10) { + return g_a(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.dma = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.CI = function() { + return e_a(this); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return i_a(this, a10); + }; + d7.yI = function(a10) { + return j_a(this, a10); + }; + hm.prototype.annotations = function() { + return this.rb(); + }; + hm.prototype.graph = function() { + return jU(this); + }; + hm.prototype.withId = function(a10) { + return this.$b(a10); + }; + hm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + hm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(hm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(hm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(hm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(hm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + hm.prototype.withVariables = function(a10) { + return this.yI(a10); + }; + hm.prototype.withTarget = function(a10) { + return this.G4(a10); + }; + hm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(hm.prototype, "variables", { get: function() { + return this.CI(); + }, configurable: true }); + Object.defineProperty(hm.prototype, "target", { get: function() { + return this.aR(); + }, configurable: true }); + Object.defineProperty(hm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + hm.prototype.$classData = r8({ jva: 0 }, false, "amf.client.model.domain.ParametrizedTrait", { jva: 1, f: 1, gva: 1, Pd: 1, qc: 1, gc: 1, ib: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function bg() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + bg.prototype = new u7(); + bg.prototype.constructor = bg; + d7 = bg.prototype; + d7.H = function() { + return "Module"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof bg ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Af(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Af().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return ar(this.g, Af().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ Bza: 0 }, false, "amf.core.model.document.Module", { Bza: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, TA: 1, y: 1, v: 1, q: 1, o: 1 }); + function ct() { + this.l = this.Lc = this.x = this.A = null; + } + ct.prototype = new u7(); + ct.prototype.constructor = ct; + d7 = ct.prototype; + d7.H = function() { + return "BoolFieldImpl"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ct && a10.l === this.l) { + var b10 = this.A, c10 = a10.A; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.x === a10.x) + return b10 = this.Lc, a10 = a10.Lc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A; + case 1: + return this.x; + case 2: + return this.Lc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Maa(this); + }; + d7.dE = function(a10, b10, c10) { + var e10 = Vb().Ia(b10.r); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(!!e10)); + ct.prototype.ov.call(this, a10, e10, b10.x, c10); + return this; + }; + d7.Bu = function() { + return this.A; + }; + d7.z = function() { + return X5(this); + }; + d7.ov = function(a10, b10, c10, e10) { + this.A = b10; + this.x = c10; + this.Lc = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.$classData = r8({ EAa: 0 }, false, "amf.core.parser.Fields$BoolFieldImpl", { EAa: 1, f: 1, Kgb: 1, Ega: 1, GY: 1, FY: 1, HY: 1, JY: 1, y: 1, v: 1, q: 1, o: 1 }); + function ft() { + this.l = this.Lc = this.x = this.A = null; + } + ft.prototype = new u7(); + ft.prototype.constructor = ft; + d7 = ft.prototype; + d7.H = function() { + return "DoubleFieldImpl"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ft && a10.l === this.l) { + var b10 = this.A, c10 = a10.A; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.x === a10.x) + return b10 = this.Lc, a10 = a10.Lc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A; + case 1: + return this.x; + case 2: + return this.Lc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Maa(this); + }; + d7.dE = function(a10, b10, c10) { + var e10 = Qab(b10); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(+e10)); + ft.prototype.ov.call(this, a10, e10, b10.x, c10); + return this; + }; + d7.Bu = function() { + return this.A; + }; + d7.z = function() { + return X5(this); + }; + d7.ov = function(a10, b10, c10, e10) { + this.A = b10; + this.x = c10; + this.Lc = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.$classData = r8({ FAa: 0 }, false, "amf.core.parser.Fields$DoubleFieldImpl", { FAa: 1, f: 1, Lgb: 1, Ega: 1, GY: 1, FY: 1, HY: 1, JY: 1, y: 1, v: 1, q: 1, o: 1 }); + function dt() { + this.l = this.Lc = this.x = this.A = null; + } + dt.prototype = new u7(); + dt.prototype.constructor = dt; + d7 = dt.prototype; + d7.H = function() { + return "IntFieldImpl"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof dt && a10.l === this.l) { + var b10 = this.A, c10 = a10.A; + if ((null === b10 ? null === c10 : b10.h(c10)) && this.x === a10.x) + return b10 = this.Lc, a10 = a10.Lc, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.A; + case 1: + return this.x; + case 2: + return this.Lc; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return Maa(this); + }; + d7.dE = function(a10, b10, c10) { + var e10 = Vb().Ia(b10.r); + e10.b() ? e10 = y7() : (e10 = e10.c(), e10 = new z7().d(e10 | 0)); + dt.prototype.ov.call(this, a10, e10, b10.x, c10); + return this; + }; + d7.Bu = function() { + return this.A; + }; + d7.z = function() { + return X5(this); + }; + d7.ov = function(a10, b10, c10, e10) { + this.A = b10; + this.x = c10; + this.Lc = e10; + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.$classData = r8({ GAa: 0 }, false, "amf.core.parser.Fields$IntFieldImpl", { GAa: 1, f: 1, Mgb: 1, Ega: 1, GY: 1, FY: 1, HY: 1, JY: 1, y: 1, v: 1, q: 1, o: 1 }); + function $U() { + this.Xb = this.p = this.dm = this.pb = null; + } + $U.prototype = new u7(); + $U.prototype.constructor = $U; + d7 = $U.prototype; + d7.H = function() { + return "NodeMappingEmitter"; + }; + function Ztb(a10, b10, c10) { + return B6(c10.g, Gc().xc).Od(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return g10 instanceof BO ? B6(g10.g, Gc().nb).j === f10.j : false; + }; + }(a10, b10))); + } + d7.E = function() { + return 4; + }; + function $tb(a10, b10, c10) { + T6(); + var e10 = B6(c10.g, c10.R).A; + e10 = e10.b() ? null : e10.c(); + var f10 = mh(T6(), e10); + e10 = new PA().e(b10.ca); + var g10 = e10.s, h10 = e10.ca, k10 = new rr().e(h10), l10 = J5(K7(), H10()), m10 = B6(c10.g, Ae4().bh); + if (m10.Da()) { + var p10 = Ae4().bh; + p10 = gd(c10, p10); + var t10 = w6(/* @__PURE__ */ function(A10) { + return function(D10) { + D10 = D10.A; + D10 = D10.b() ? null : D10.c(); + D10 = Bw(A10, D10); + return D10 instanceof z7 ? new z7().d(D10.i) : y7(); + }; + }(a10)), v10 = K7(); + m10 = m10.ka(t10, v10.u); + t10 = new vbb(); + v10 = K7(); + m10 = m10.ec(t10, v10.u); + p10 = J5(K7(), new Ib().ha([eNa(m10, p10)])); + m10 = K7(); + l10 = l10.ia(p10, m10.u); + c10 = cNa(a10, c10); + p10 = K7(); + l10 = l10.ia(c10, p10.u); + a10.p.zb(l10).U(w6(/* @__PURE__ */ function(A10, D10) { + return function(C10) { + C10.Qa(D10); + }; + }( + a10, + k10 + ))); + } + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + a10 = e10.s; + f10 = [f10]; + if (0 > a10.w) + throw new U6().e("0"); + g10 = f10.length | 0; + c10 = a10.w + g10 | 0; + uD(a10, c10); + Ba(a10.L, 0, a10.L, g10, a10.w); + g10 = a10.L; + l10 = g10.n.length; + k10 = h10 = 0; + p10 = f10.length | 0; + l10 = p10 < l10 ? p10 : l10; + p10 = g10.n.length; + for (l10 = l10 < p10 ? l10 : p10; h10 < l10; ) + g10.n[k10] = f10[h10], h10 = 1 + h10 | 0, k10 = 1 + k10 | 0; + a10.w = c10; + pr(b10.s, vD(wD(), e10.s)); + } + function aub(a10, b10, c10) { + T6(); + var e10 = B6(c10.g, c10.R).A; + e10 = e10.b() ? null : e10.c(); + var f10 = mh(T6(), e10); + e10 = new PA().e(b10.ca); + var g10 = e10.s, h10 = e10.ca, k10 = new rr().e(h10), l10 = B6(c10.g, wj().Ut).A; + l10 = l10.b() ? null : l10.c(); + l10 = Bw(a10, l10); + if (l10 instanceof z7) + cx(new dx(), "classTerm", l10.i, Q5().Na, ld()).Qa(k10); + else if (y7() === l10) + B6(c10.g, wj().Ut); + else + throw new x7().d(l10); + var m10 = B6(c10.g, wj().ej); + if (null !== m10 && m10.Da()) { + T6(); + var p10 = mh(T6(), "mapping"); + l10 = new PA().e(k10.ca); + var t10 = l10.s, v10 = l10.ca, A10 = new rr().e(v10), D10 = w6(/* @__PURE__ */ function(I10) { + return function(L10) { + var Y10 = I10.p, ia = I10.Xb, pa = new bub(); + pa.pb = I10.pb; + pa.Ah = L10; + pa.p = Y10; + pa.Xb = ia; + return pa; + }; + }(a10)), C10 = K7(); + m10 = m10.ka(D10, C10.u); + jr(wr(), a10.p.zb(m10), A10); + pr(t10, mr(T6(), tr(ur(), A10.s, v10), Q5().sa)); + a10 = l10.s; + p10 = [p10]; + if (0 > a10.w) + throw new U6().e("0"); + v10 = p10.length | 0; + t10 = a10.w + v10 | 0; + uD(a10, t10); + Ba(a10.L, 0, a10.L, v10, a10.w); + v10 = a10.L; + D10 = v10.n.length; + m10 = A10 = 0; + C10 = p10.length | 0; + D10 = C10 < D10 ? C10 : D10; + C10 = v10.n.length; + for (D10 = D10 < C10 ? D10 : C10; A10 < D10; ) + v10.n[m10] = p10[A10], A10 = 1 + A10 | 0, m10 = 1 + m10 | 0; + a10.w = t10; + pr(k10.s, vD(wD(), l10.s)); + } + l10 = B6(c10.g, nc().Ni()).kc(); + l10 instanceof z7 && (a10 = l10.i, ut(a10) && (T6(), l10 = mh(T6(), "extends"), T6(), a10 = B6(a10.Y(), db().ed).A, a10 = a10.b() ? null : a10.c(), a10 = mh(T6(), a10), sr(k10, l10, a10))); + l10 = B6(c10.g, wj().Ax).A; + l10.b() || (a10 = l10.c(), T6(), l10 = mh(T6(), "idTemplate"), T6(), a10 = mh(T6(), a10), sr(k10, l10, a10)); + c10 = ika(c10).A; + c10.b() || (l10 = c10.c(), T6(), c10 = mh(T6(), "patch"), T6(), l10 = mh(T6(), l10), sr(k10, c10, l10)); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + g10 = e10.s; + f10 = [f10]; + if (0 > g10.w) + throw new U6().e("0"); + k10 = f10.length | 0; + h10 = g10.w + k10 | 0; + uD(g10, h10); + Ba(g10.L, 0, g10.L, k10, g10.w); + k10 = g10.L; + a10 = k10.n.length; + l10 = c10 = 0; + p10 = f10.length | 0; + a10 = p10 < a10 ? p10 : a10; + p10 = k10.n.length; + for (a10 = a10 < p10 ? a10 : p10; c10 < a10; ) + k10.n[l10] = f10[c10], c10 = 1 + c10 | 0, l10 = 1 + l10 | 0; + g10.w = h10; + pr(b10.s, vD(wD(), e10.s)); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof $U) { + var b10 = this.pb, c10 = a10.pb; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.dm, c10 = a10.dm, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.dm; + case 2: + return this.p; + case 3: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + if (Za(this.dm).na()) + if (Ztb(this, Za(this.dm).c(), this.pb)) { + T6(); + var b10 = this.dm; + b10 = B6(b10.Y(), b10.R).A; + b10 = b10.b() ? null : b10.c(); + b10 = mh(T6(), b10); + T6(); + var c10 = B6(this.dm.Y(), db().ed).A; + c10 = iua(0, c10.b() ? null : c10.c()); + sr(a10, b10, c10); + } else + T6(), b10 = this.dm, b10 = B6(b10.Y(), b10.R).A, b10 = b10.b() ? null : b10.c(), b10 = mh(T6(), b10), T6(), c10 = B6(this.dm.Y(), db().ed).A, c10 = c10.b() ? null : c10.c(), c10 = mh(T6(), c10), sr(a10, b10, c10); + else if (b10 = this.dm, b10 instanceof Cd) + aub(this, a10, b10); + else if (b10 instanceof ze2) + $tb(this, a10, b10); + else + throw new x7().d(b10); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.dm.fa(), q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ pFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.NodeMappingEmitter", { pFa: 1, f: 1, db: 1, Ma: 1, eFa: 1, sFa: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function bub() { + this.Xb = this.p = this.Ah = this.pb = null; + } + bub.prototype = new u7(); + bub.prototype.constructor = bub; + d7 = bub.prototype; + d7.H = function() { + return "PropertyMappingEmitter"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bub) { + var b10 = this.pb, c10 = a10.pb; + (null === b10 ? null === c10 : b10.h(c10)) ? (b10 = this.Ah, c10 = a10.Ah, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + if (b10 && this.p === a10.p) + return b10 = this.Xb, a10 = a10.Xb, null === b10 ? null === a10 : U22(b10, a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.pb; + case 1: + return this.Ah; + case 2: + return this.p; + case 3: + return this.Xb; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Qa = function(a10) { + T6(); + var b10 = B6(this.Ah.g, $d().R).A, c10 = b10.b() ? null : b10.c(), e10 = mh(T6(), c10), f10 = new PA().e(a10.ca), g10 = f10.s, h10 = f10.ca, k10 = new rr().e(h10), l10 = null; + l10 = J5(K7(), H10()); + var m10 = B6(this.Ah.g, $d().Yh).A, p10 = m10.b() ? null : m10.c(), t10 = Bw(this, p10); + if (t10 instanceof z7) { + var v10 = t10.i, A10 = this.Ah, D10 = $d().Yh, C10 = gd(A10, D10), I10 = l10, L10 = K7(), Y10 = [cx(new dx(), "propertyTerm", v10, Q5().Na, C10)], ia = J5(L10, new Ib().ha(Y10)), pa = K7(); + l10 = I10.ia(ia, pa.u); + } else if (y7() !== t10) + throw new x7().d(t10); + var La = B6(this.Ah.g, $d().Gf).A; + if (!La.b()) { + var ob = La.c(), zb = F6().Eb; + if (ob === ic(G5(zb, "guid"))) { + var Zb = this.Ah, Cc = $d().Gf, vc = gd(Zb, Cc), id = l10, yd = K7(), zd = [cx(new dx(), "range", "guid", Q5().Na, vc)], rd = J5(yd, new Ib().ha(zd)), sd = K7(); + l10 = id.ia(rd, sd.u); + } else if (Ed(ua(), ob, "anyURI")) { + var le4 = this.Ah, Vc = $d().Gf, Sc = gd(le4, Vc), Qc = l10, $c = K7(), Wc = [cx(new dx(), "range", "uri", Q5().Na, Sc)], Qe = J5($c, new Ib().ha(Wc)), Qd = K7(); + l10 = Qc.ia(Qe, Qd.u); + } else if (Ed(ua(), ob, "link")) { + var me4 = this.Ah, of = $d().Gf, Le2 = gd(me4, of), Ve = l10, he4 = K7(), Wf = [cx(new dx(), "range", "link", Q5().Na, Le2)], vf = J5(he4, new Ib().ha(Wf)), He = K7(); + l10 = Ve.ia(vf, He.u); + } else if (Ed(ua(), ob, "anyType")) { + var Ff = this.Ah, wf = $d().Gf, Re2 = gd(Ff, wf), we4 = l10, ne4 = K7(), Me2 = [cx(new dx(), "range", "any", Q5().Na, Re2)], Se4 = J5(ne4, new Ib().ha(Me2)), xf = K7(); + l10 = we4.ia(Se4, xf.u); + } else if (Ed(ua(), ob, "number")) { + var ie3 = this.Ah, gf = $d().Gf, pf = gd(ie3, gf), hf = l10, Gf = K7(), yf = [cx(new dx(), "range", "number", Q5().Na, pf)], oe4 = J5(Gf, new Ib().ha(yf)), lg = K7(); + l10 = hf.ia(oe4, lg.u); + } else { + var bh = this.Ah, Qh = $d().Gf, af = gd(bh, Qh), Pf = l10, oh = K7(), ch = F6().Bj.he, Ie2 = Mc(ua(), ob, ch), ug = [cx(new dx(), "range", Oc(new Pc().fd(Ie2)), Q5().Na, af)], Sg = J5(oh, new Ib().ha(ug)), Tg = K7(); + l10 = Pf.ia(Sg, Tg.u); + } + } + var zh = ika(this.Ah).A; + if (!zh.b()) { + var Rh = zh.c(), vg = this.Ah, dh = $d().at, Jg = gd(vg, dh), Ah = l10, Bh = K7(), cg = [cx(new dx(), "patch", Rh, Q5().Na, Jg)], Qf = J5(Bh, new Ib().ha(cg)), Kg = K7(); + l10 = Ah.ia(Qf, Kg.u); + } + var Ne2 = B6(this.Ah.g, Ae4().bh); + if (Ne2.Da()) { + var Xf = this.Ah, di = $d().bh, dg = gd(Xf, di), Hf = w6(/* @__PURE__ */ function(Up) { + return function(kn) { + var Vp = kn.A; + Vp = Vp.b() ? null : Vp.c(); + var sy = F6().$c; + if (Vp === ic(G5(sy, "anyNode"))) + return new z7().d("anyNode"); + kn = kn.A; + kn = kn.b() ? null : kn.c(); + kn = Bw(Up, kn); + return kn instanceof z7 ? new z7().d(kn.i) : y7(); + }; + }(this)), wg = K7(), Lg = Ne2.ka( + Hf, + wg.u + ), jf = new wbb(), mg = K7(), Mg = Lg.ec(jf, mg.u); + if (1 === Mg.jb()) { + var Ng = l10, eg = K7(), Oe4 = [cx(new dx(), "range", Mg.ga(), Q5().Na, dg)], ng = J5(eg, new Ib().ha(Oe4)), fg = K7(); + l10 = Ng.ia(ng, fg.u); + } else if (1 < Mg.jb()) { + var Ug = l10, xg = J5(K7(), new Ib().ha([fNa(Mg, dg)])), gg = K7(); + l10 = Ug.ia(xg, gg.u); + } + } + var fe4 = B6(this.Ah.g, $d().St).A; + if (fe4.b()) { + var ge4 = B6(this.Ah.g, $d().nr).A; + if (!ge4.b()) { + var ph = ge4.c(), hg = this.Ah, Jh = $d().nr, fj = gd(hg, Jh), yg = Bw(this, ph); + if (yg instanceof z7) { + var qh = yg.i, og = l10, rh = K7(), Ch = [cx(new dx(), "mapTermKey", qh, Q5().Na, fj)], Vg = J5(rh, new Ib().ha(Ch)), Wg = K7(); + l10 = og.ia(Vg, Wg.u); + } + } + } else { + var Rf = fe4.c(), Sh = this.Ah, zg = $d().St, Ji = gd(Sh, zg), Kh = l10, Lh = K7(), Ki = [cx(new dx(), "mapKey", Rf, Q5().Na, Ji)], gj = J5(Lh, new Ib().ha(Ki)), Rl = K7(); + l10 = Kh.ia(gj, Rl.u); + } + var ek = B6(this.Ah.g, $d().bw).A; + if (ek.b()) { + var Dh = B6(this.Ah.g, $d().Hx).A; + if (!Dh.b()) { + var Eh = Dh.c(), Li = this.Ah, Mi = $d().Hx, uj = gd(Li, Mi), Ni = Bw(this, Eh); + if (Ni instanceof z7) { + var fk = Ni.i, Ck = l10, Dk = K7(), hj = [cx(new dx(), "mapTermValue", fk, Q5().Na, uj)], ri = J5(Dk, new Ib().ha(hj)), gk = K7(); + l10 = Ck.ia(ri, gk.u); + } + } + } else { + var $k = ek.c(), lm = this.Ah, si = $d().bw, bf = gd(lm, si), ei = l10, vj = K7(), ti = [cx(new dx(), "mapValue", $k, Q5().Na, bf)], Og = J5(vj, new Ib().ha(ti)), Oi = K7(); + l10 = ei.ia(Og, Oi.u); + } + var pg = B6(this.Ah.g, $d().YF).A; + if (!pg.b()) { + var zf = !!pg.c(), Sf = this.Ah, eh = $d().YF, Fh = gd(Sf, eh), fi = l10, hn = K7(), mm = [cx(new dx(), "unique", "" + zf, Q5().ti, Fh)], nm = J5(hn, new Ib().ha(mm)), kd = K7(); + l10 = fi.ia(nm, kd.u); + } + var Pi = hd(this.Ah.g, $d().ji); + if (!Pi.b()) { + var sh = Pi.c(), Pg = sh.r.r.r, Xc = gd(this.Ah, sh.Lc); + if (Va(Wa(), 0, Pg)) { + var xe2 = l10, Nc = K7(), om = [cx(new dx(), "mandatory", "false", Q5().ti, Xc)], Dn = J5(Nc, new Ib().ha(om)), gi = K7(); + l10 = xe2.ia(Dn, gi.u); + } else if (Va(Wa(), 1, Pg)) { + var Te = l10, pm = K7(), jn = [cx(new dx(), "mandatory", "true", Q5().ti, Xc)], Oq = J5(pm, new Ib().ha(jn)), En = K7(); + l10 = Te.ia(Oq, En.u); + } else + throw new x7().d(Pg); + } + var $n = hd(this.Ah.g, $d().zl); + if (!$n.b()) { + var Rp = $n.c(), ao = ka(Rp.r.r.r), Xt = gd(this.Ah, Rp.Lc), Fs = l10, Sp = K7(), bo = [cx(new dx(), "pattern", ao, Q5().Na, Xt)], Gs = J5(Sp, new Ib().ha(bo)), Fn = K7(); + l10 = Fs.ia(Gs, Fn.u); + } + var Pq = hd(this.Ah.g, $d().wj); + if (!Pq.b()) { + var Jr = Pq.c(), Hs = Jr.r.r.r, Is = gd(this.Ah, Jr.Lc), Kr = l10, Js = K7(), Ks = [cx( + new dx(), + "minimum", + ka(Hs), + Q5().cj, + Is + )], ov = J5(Js, new Ib().ha(Ks)), pv = K7(); + l10 = Kr.ia(ov, pv.u); + } + var Ls = hd(this.Ah.g, $d().vj); + if (!Ls.b()) { + var qv = Ls.c(), rv = qv.r.r.r, Yt = gd(this.Ah, qv.Lc), sv = l10, Qq = K7(), tv = [cx(new dx(), "maximum", ka(rv), Q5().cj, Yt)], Ms = J5(Qq, new Ib().ha(tv)), Zt = K7(); + l10 = sv.ia(Ms, Zt.u); + } + var uv = hd(this.Ah.g, $d().Ey); + if (!uv.b()) { + var cp = uv.c(), Ns = cp.r.r.r, $t = gd(this.Ah, cp.Lc), au = l10, Qj = K7(), Jw = [cx(new dx(), "allowMultiple", ka(Ns), Q5().ti, $t)], dp = J5(Qj, new Ib().ha(Jw)), bu = K7(); + l10 = au.ia(dp, bu.u); + } + var ui = hd(this.Ah.g, $d().EJ); + if (!ui.b()) { + var Os = ui.c(), Ps = Os.r.r.r, cu = gd(this.Ah, Os.Lc), Qs = l10, du = K7(), vv = [cx(new dx(), "sorted", ka(Ps), Q5().ti, cu)], wv = J5(du, new Ib().ha(vv)), xv = K7(); + l10 = Qs.ia(wv, xv.u); + } + var py = hd(this.Ah.g, $d().ZI); + if (!py.b()) { + var Rq = py.c(), Kw = l10, Lw = K7(), eu = [$x("enum", Rq, this.p, false)], yv = J5(Lw, new Ib().ha(eu)), qy = K7(); + l10 = Kw.ia(yv, qy.u); + } + var zv = l10, Mw = cNa(this, this.Ah), ry = K7(); + l10 = zv.ia(Mw, ry.u); + this.p.zb(l10).U(w6(/* @__PURE__ */ function(Up, kn) { + return function(Vp) { + Vp.Qa(kn); + }; + }(this, k10))); + pr(g10, mr(T6(), tr(ur(), k10.s, h10), Q5().sa)); + var Tp = f10.s, Ss = [e10]; + if (0 > Tp.w) + throw new U6().e("0"); + var Nw = Ss.length | 0, fu = Tp.w + Nw | 0; + uD(Tp, fu); + Ba(Tp.L, 0, Tp.L, Nw, Tp.w); + for (var Ow = Tp.L, Pw = Ow.n.length, Sq = 0, gu = 0, Qw = Ss.length | 0, Rw = Qw < Pw ? Qw : Pw, Sw = Ow.n.length, AA = Rw < Sw ? Rw : Sw; Sq < AA; ) + Ow.n[gu] = Ss[Sq], Sq = 1 + Sq | 0, gu = 1 + gu | 0; + Tp.w = fu; + pr(a10.s, vD(wD(), f10.s)); + }; + d7.z = function() { + return X5(this); + }; + d7.La = function() { + var a10 = Ab(this.Ah.x, q5(jd)); + a10.b() ? a10 = y7() : (a10 = a10.c(), a10 = new z7().d(a10.yc.$d)); + return a10.b() ? ld() : a10.c(); + }; + d7.$classData = r8({ tFa: 0 }, false, "amf.plugins.document.vocabularies.emitters.dialects.PropertyMappingEmitter", { tFa: 1, f: 1, db: 1, Ma: 1, eFa: 1, sFa: 1, eJ: 1, Uy: 1, y: 1, v: 1, q: 1, o: 1 }); + function rO() { + this.j = this.Ke = this.Ts = this.at = this.x = this.g = null; + this.xa = false; + } + rO.prototype = new u7(); + rO.prototype.constructor = rO; + d7 = rO.prototype; + d7.H = function() { + return "PropertyMapping"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof rO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return $d(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + function lOa(a10, b10) { + var c10 = $d().ZI, e10 = w6(/* @__PURE__ */ function() { + return function(g10) { + return ih(new jh(), g10, new P6().a()); + }; + }(a10)), f10 = K7(); + b10 = b10.ka(e10, f10.u); + Zd(a10, c10, b10); + } + d7.dd = function() { + return ""; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.KN = function(a10) { + this.at = a10; + }; + function xj(a10) { + var b10 = B6(a10.g, $d().Yh).A; + if (b10.b()) { + b10 = F6().Pg; + var c10 = B6(a10.g, $d().R).A; + c10 = c10.b() ? null : c10.c(); + b10 = ic(G5(b10, c10)); + } else + b10 = b10.c(); + b10 = KU(LU(), b10); + if (B6(a10.g, Ae4().bh).Da() || Vb().Ia(dV(a10)).na()) + return c10 = B6(a10.g, $d().Ey), Ic(c10) || B6(a10.g, $d().nr).A.na() ? rb(new sb(), new xc().yd((Fw(), UMa(new UU(), (Fw(), J5(K7(), H10())), (Fw(), H10()), (Fw(), y7())))), b10, tb(new ub(), vb().qm, "", "", H10())) : rb(new sb(), (Fw(), UMa(new UU(), (Fw(), J5(K7(), H10())), (Fw(), H10()), (Fw(), y7()))), b10, tb(new ub(), vb().qm, "", "", H10())); + c10 = false; + var e10 = null, f10 = B6(a10.g, $d().Gf).A; + a: { + if (f10 instanceof z7) { + c10 = true; + e10 = f10; + f10 = e10.i; + var g10 = F6().Eb; + if (f10 === ic(G5(g10, "link"))) { + c10 = yc(); + break a; + } + } + if (c10 && e10.i === Uh().zp) + c10 = SM(); + else { + if (c10 && (f10 = e10.i, Ed(ua(), f10, "anyType"))) { + c10 = Bc(); + break a; + } + if (c10 && (f10 = e10.i, Ed(ua(), f10, "number"))) { + c10 = et3(); + break a; + } + c10 && e10.i === Uh().hi ? c10 = Ac() : c10 && e10.i === Uh().of ? c10 = et3() : c10 && e10.i === Uh().Nh ? c10 = hi() : c10 && e10.i === Uh().Mi ? c10 = zc() : c10 && e10.i === Uh().TC ? c10 = Ac() : c10 && e10.i === Uh().hw ? (dhb || (dhb = new chb().a()), c10 = dhb) : c10 = c10 && e10.i === Uh().jo ? ZL() : c10 && e10.i === Uh().tj ? ZL() : qb(); + } + } + a10 = B6(a10.g, $d().Ey); + return Ic(a10) ? rb(new sb(), new xc().yd(c10), b10, tb( + new ub(), + vb().qm, + "", + "", + H10() + )) : rb(new sb(), c10, b10, tb(new ub(), vb().qm, "", "", H10())); + } + d7.Y = function() { + return this.g; + }; + function t32(a10) { + var b10 = B6(a10.g, Ae4().bh); + if (b10.b()) + return b10 = Vb().Ia(dV(a10)), (b10.b() ? Rb(Gb().ab, H10()) : b10.c()).Ur().ke(); + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + e10 = e10.A; + return e10.b() ? null : e10.c(); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + d7.JN = function(a10) { + this.Ts = a10; + }; + function MDa(a10) { + var b10 = B6(a10.g, Ae4().bh).Od(w6(/* @__PURE__ */ function() { + return function(h10) { + h10 = h10.A; + h10 = h10.b() ? null : h10.c(); + var k10 = F6().$c; + return h10 === ic(G5(k10, "anyNode")); + }; + }(a10))), c10 = B6(a10.g, $d().Gf).A.na(), e10 = B6(a10.g, Ae4().bh).Da(), f10 = B6(a10.g, $d().Ey).A; + f10 = !(f10.b() || !f10.c()); + var g10 = B6(a10.g, $d().nr).A.na(); + a10 = B6(a10.g, $d().Hx).A.na(); + return b10 ? YCa() : c10 && !f10 ? $Ca() : c10 ? bDa() : e10 && g10 && a10 ? fDa() : e10 && g10 ? TN() : e10 && !f10 ? WN() : YN(); + } + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + ud(this); + return this; + }; + d7.$classData = r8({ nHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.PropertyMapping", { nHa: 1, f: 1, qd: 1, vc: 1, tc: 1, Yga: 1, PR: 1, gHa: 1, y: 1, v: 1, q: 1, o: 1 }); + function z8() { + Aq.call(this); + this.hka = this.gka = this.qoa = this.EG = this.Lba = this.Uma = this.Qk = this.rd = this.$V = null; + } + z8.prototype = new Jmb(); + z8.prototype.constructor = z8; + z8.prototype.eU = function(a10, b10) { + Aq.prototype.zo.call(this, a10.qh, a10.Df, a10.ni, a10.lj, y7()); + a10 = [new R6().M("$dialect", false), new R6().M("dialect", true), new R6().M("version", true), new R6().M("usage", false), new R6().M("external", false), new R6().M("uses", false), new R6().M("nodeMappings", false), new R6().M("documents", false)]; + for (var c10 = UA(new VA(), nu()), e10 = 0, f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.Qk = c10.eb; + a10 = [new R6().M("usage", false), new R6().M("external", false), new R6().M("uses", false), new R6().M("nodeMappings", false)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.Uma = c10.eb; + a10 = [new R6().M("classTerm", false), new R6().M("mapping", false), new R6().M("idProperty", false), new R6().M("idTemplate", false), new R6().M("patch", false), new R6().M("extends", false)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.Lba = c10.eb; + a10 = [new R6().M("usage", false), new R6().M("external", false), new R6().M("uses", false)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.EG = c10.eb.uq(this.Lba); + a10 = [new R6().M("propertyTerm", false), new R6().M("range", false), new R6().M( + "mapKey", + false + ), new R6().M("mapValue", false), new R6().M("mapTermKey", false), new R6().M("mapTermValue", false), new R6().M("mandatory", false), new R6().M("pattern", false), new R6().M("sorted", false), new R6().M("minimum", false), new R6().M("maximum", false), new R6().M("allowMultiple", false), new R6().M("enum", false), new R6().M("typeDiscriminatorName", false), new R6().M("typeDiscriminator", false), new R6().M("unique", false), new R6().M("patch", false)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.qoa = c10.eb; + a10 = [ + new R6().M("root", false), + new R6().M("fragments", false), + new R6().M("library", false), + new R6().M("options", false) + ]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.gka = c10.eb; + a10 = [new R6().M("selfEncoded", false), new R6().M("declarationsPath", false), new R6().M("keyProperty", false), new R6().M("referenceStyle", false)]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.hka = c10.eb; + this.$V = Rb(Gb().ab, H10()); + b10.b() ? (b10 = new z7().d(this), a10 = this.ni, c10 = Rb(Gb().ab, H10()), b10 = new QV().FU(c10, b10, a10)) : b10 = b10.c(); + this.rd = b10; + return this; + }; + z8.prototype.$classData = r8({ AHa: 0 }, false, "amf.plugins.document.vocabularies.parser.dialects.DialectContext", { AHa: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, Xgb: 1, $ga: 1 }); + function urb() { + Aq.call(this); + this.roa = this.vja = this.Uqa = this.rd = this.UB = this.a1 = null; + } + urb.prototype = new Jmb(); + urb.prototype.constructor = urb; + function tDa(a10, b10, c10, e10, f10) { + if (-1 !== (c10.indexOf(".") | 0)) { + b10 = Mc(ua(), c10, "\\."); + b10 = zj(new Pc().fd(b10)); + c10 = Mc(ua(), c10, "\\."); + c10 = Oc(new Pc().fd(c10)); + e10 = a10.rd.Vn.Ja(b10); + if (e10 instanceof z7) + return a10 = B6(e10.i.g, dd().Kh).A, new z7().d("" + (a10.b() ? null : a10.c()) + c10); + if (y7() === e10) + return a10 = a10.rd.xi.Ja(b10), a10 instanceof z7 && (a10 = a10.i, a10 instanceof hO) ? CDa(a10, c10) : y7(); + throw new x7().d(e10); + } + b10 = "" + b10 + c10; + var g10 = CDa(a10.rd, c10); + if (!(g10 instanceof z7)) + if (y7() === g10) + f10 && (f10 = a10.UB, c10 = J5(K7(), new Ib().ha([new y62().dA(b10, c10, e10, false)])), e10 = K7(), a10.UB = f10.ia(c10, e10.u)); + else + throw new x7().d(g10); + return new z7().d(b10); + } + function xDa(a10, b10, c10) { + a10.UB = a10.UB.Cb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = g10.Uo; + var h10 = f10.j; + return !(null === g10 ? null === h10 : ra(g10, h10)); + }; + }(a10, c10))); + a10.rd.mG = a10.rd.mG.cc(new R6().M(b10, c10)); + } + function qDa(a10) { + var b10 = new Fc().Vd(a10.rd.mG).Sb.Ye().Dd(); + a10 = new Fc().Vd(a10.rd.IH).Sb.Ye().Dd(); + var c10 = K7(); + return b10.ia(a10, c10.u); + } + function o2a(a10, b10, c10) { + a10.a1 = a10.a1.cc(new R6().M(b10, c10)); + } + function uDa(a10, b10, c10) { + a10.UB = a10.UB.Cb(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + g10 = g10.Uo; + var h10 = f10.j; + return !(null === g10 ? null === h10 : ra(g10, h10)); + }; + }(a10, c10))); + a10.rd.IH = a10.rd.IH.cc(new R6().M(b10, c10)); + } + function sDa(a10, b10, c10, e10, f10) { + if (-1 !== (c10.indexOf(".") | 0)) { + b10 = Mc(ua(), c10, "\\."); + b10 = zj(new Pc().fd(b10)); + c10 = Mc(ua(), c10, "\\."); + c10 = Oc(new Pc().fd(c10)); + e10 = a10.rd.Vn.Ja(b10); + if (e10 instanceof z7) + return a10 = B6(e10.i.g, dd().Kh).A, new z7().d("" + (a10.b() ? null : a10.c()) + c10); + if (y7() === e10) + return a10 = a10.rd.xi.Ja(b10), a10 instanceof z7 && (a10 = a10.i, a10 instanceof hO) ? ADa(a10, c10) : y7(); + throw new x7().d(e10); + } + b10 = "" + b10 + c10; + var g10 = ADa(a10.rd, c10); + if (!(g10 instanceof z7)) + if (y7() === g10) + f10 && (f10 = a10.UB, c10 = J5(K7(), new Ib().ha([new y62().dA(b10, c10, e10, true)])), e10 = K7(), a10.UB = f10.ia(c10, e10.u)); + else + throw new x7().d(g10); + return new z7().d(b10); + } + urb.prototype.eU = function(a10, b10) { + Aq.prototype.zo.call(this, a10.qh, a10.Df, a10.ni, a10.lj, y7()); + a10 = [new R6().M("$dialect", "string"), new R6().M("base", "string"), new R6().M("usage", "string"), new R6().M("vocabulary", "string"), new R6().M("uses", "libraries"), new R6().M("external", "libraries"), new R6().M("classTerms", "ClassTerm[]"), new R6().M("propertyTerms", "PropertyTerm[]")]; + for (var c10 = UA(new VA(), nu()), e10 = 0, f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.Uqa = c10.eb; + a10 = [ + new R6().M("displayName", "string"), + new R6().M("description", "string"), + new R6().M("properties", "string[]"), + new R6().M("extends", "string[]") + ]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.vja = c10.eb; + a10 = [new R6().M("displayName", "string"), new R6().M("description", "string"), new R6().M("range", "string[]"), new R6().M("extends", "string[]")]; + c10 = UA(new VA(), nu()); + e10 = 0; + for (f10 = a10.length | 0; e10 < f10; ) + WA(c10, a10[e10]), e10 = 1 + e10 | 0; + this.roa = c10.eb; + this.a1 = Rb(Gb().ab, H10()); + this.UB = H10(); + if (b10.b()) { + b10 = new z7().d(this); + a10 = this.ni; + c10 = Rb(Gb().ab, H10()); + e10 = Rb(Gb().ab, H10()); + f10 = Rb(Gb().ab, H10()); + var g10 = Rb( + Gb().ab, + H10() + ), h10 = Rb(Gb().ab, H10()); + b10 = new hO().v1(c10, e10, f10, g10, h10, b10, a10); + } else + b10 = b10.c(); + this.rd = b10; + return this; + }; + urb.prototype.$classData = r8({ eIa: 0 }, false, "amf.plugins.document.vocabularies.parser.vocabularies.VocabularyContext", { eIa: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, Ygb: 1, $ga: 1 }); + function b9() { + Aq.call(this); + this.qi = this.F1 = this.mH = this.rd = null; + } + b9.prototype = new Jmb(); + b9.prototype.constructor = b9; + function cub() { + } + cub.prototype = b9.prototype; + function oYa(a10, b10) { + a10.mH = new z7().d(b10); + a10.F1 = new z7().d(new Hw().pv(b10, a10)); + } + function A8(a10, b10, c10) { + a10.Ip.jm(dub(b10), c10); + } + function Pjb(a10, b10, c10) { + if (null === c10) + throw new sf().a(); + if ("" === c10) + return Kq(b10); + if (0 <= (c10.length | 0) && "/" === c10.substring(0, 1) || -1 !== (c10.indexOf(":") | 0)) + return c10; + if (0 <= (c10.length | 0) && "#" === c10.substring(0, 1)) + return a10 = Mc(ua(), b10, "#"), "" + zj(new Pc().fd(a10)) + c10; + a10 = a10.T_(b10); + a10 = new je4().e(a10); + c10 = "" + ba.decodeURI(a10.td) + c10; + return Kq(c10); + } + function w42(a10, b10, c10) { + var e10 = Pjb(c10, c10.qh, b10); + b10 = Qjb(e10); + a10 = Rjb(a10, e10); + if (a10.b()) + return y7(); + a10 = a10.c(); + return eYa(wCa(), a10, b10, c10); + } + function pYa(a10, b10) { + a10 = a10.F1; + if (a10 instanceof z7) { + a10 = a10.i; + if ("#" === b10 || "" === b10 || "/" === b10) + var c10 = "/"; + else + c10 = 0 <= (b10.length | 0) && "#" === b10.substring(0, 1) ? b10.split("#").join("") : b10, 0 <= (c10.length | 0) && "/" === c10.substring(0, 1) && (c10 = new qg().e(c10), c10 = Wp(c10, "/")); + a10 = a10.Cw.Ja(c10); + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(new R6().M(b10, a10)); + } + return y7(); + } + function osb(a10, b10) { + a10 = a10.Ip.Ja(dub(b10)); + return a10 instanceof z7 && (a10 = a10.i, a10 instanceof vh) ? new z7().d(a10) : y7(); + } + function Rjb(a10, b10) { + b10 = Mc(ua(), b10, "#"); + b10 = zj(new Pc().fd(b10)); + a10 = a10.Df.Cb(w6(/* @__PURE__ */ function() { + return function(c10) { + return Lc(c10.Jd).na(); + }; + }(a10))).Cb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + f10 = Lc(f10.Jd).c(); + return null === f10 ? null === e10 : ra(f10, e10); + }; + }(a10, b10))); + return Jc(a10, new Acb()); + } + function psb(a10, b10, c10) { + var e10 = Mc(ua(), b10, "#"); + e10 = null !== e10 && 1 < e10.n.length ? new z7().d(Oc(new Pc().fd(e10))) : y7(); + b10 = Mc(ua(), b10, "#"); + b10 = zj(new Pc().fd(b10)); + a10 = a10.Df.Cb(w6(/* @__PURE__ */ function() { + return function(f10) { + return Lc(f10.Jd).na(); + }; + }(a10))).Cb(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + h10 = Lc(h10.Jd).c(); + return null === h10 ? null === g10 : ra(h10, g10); + }; + }(a10, b10))); + c10 = Jc(a10, zcb(e10, c10)); + return c10.b() ? y7() : c10.c(); + } + function mYa(a10, b10) { + b10 = b10.re(); + if (b10 instanceof vw && (b10 = b10.Za.Ja((T6(), mh(T6(), "$schema"))), b10 instanceof z7)) { + b10 = b10.i; + var c10 = b10.re(); + if (c10 instanceof xt) + return a10 = c10.va, -1 !== (a10.indexOf("http://json-schema.org/draft-01/schema") | 0) ? KFa() : -1 !== (a10.indexOf("http://json-schema.org/draft-02/schema") | 0) ? KFa() : -1 !== (a10.indexOf("http://json-schema.org/draft-03/schema") | 0) ? KFa() : MFa(); + c10 = sg().k6; + var e10 = y7(); + ec(a10, c10, "", e10, "JSON Schema version value must be a string", b10.da); + return MFa(); + } + NFa || (NFa = new yP().a()); + return NFa; + } + b9.prototype.Wx = function(a10, b10, c10, e10, f10, g10) { + Aq.prototype.zo.call(this, a10, b10, c10.ni, (f10.b() ? c10.lj : f10.c()) | 0, g10.b() ? c10.Hp() : g10); + this.qi = nv().ea; + if (e10.b()) { + a10 = y7(); + b10 = new z7().d(this); + e10 = this.ni; + f10 = Rb(Gb().ab, H10()); + g10 = Rb(Gb().ab, H10()); + var h10 = Rb(Gb().ab, H10()), k10 = Rb(Gb().ab, H10()), l10 = Rb(Gb().ab, H10()), m10 = Rb(Gb().ab, H10()), p10 = Rb(Gb().ab, H10()), t10 = Rb(Gb().ab, H10()), v10 = Rb(Gb().ab, H10()), A10 = Rb(Gb().ab, H10()), D10 = Rb(Gb().ab, H10()), C10 = Rb(Gb().ab, H10()), I10 = Rb(Gb().ab, H10()), L10 = Rb(Gb().ab, H10()), Y10 = Rb(Gb().ab, H10()), ia = Rb(Gb().ab, H10()); + a10 = new Lx().BU( + a10, + f10, + g10, + h10, + k10, + l10, + m10, + p10, + t10, + v10, + A10, + D10, + C10, + I10, + L10, + Y10, + b10, + e10, + ia + ); + } else + a10 = e10.c(); + this.rd = a10; + this.mH = c10 instanceof b9 ? c10.mH : y7(); + this.F1 = c10 instanceof b9 ? c10.F1 : y7(); + this.Ip = c10.Ip; + this.Fu = c10.Fu; + return this; + }; + function Qjb(a10) { + a10 = Mc(ua(), a10, "#"); + return null !== a10 && 1 < a10.n.length ? new z7().d(Oc(new Pc().fd(a10))) : y7(); + } + b9.prototype.T_ = function(a10) { + if (-1 !== (a10.indexOf("#") | 0)) { + a10 = Mc(ua(), a10, "#"); + var b10 = zj(new Pc().fd(a10)); + } else + b10 = a10; + a10 = new qg().e(b10); + b10 = b10.lastIndexOf("/") | 0; + return w32(a10, b10).ma() + "/"; + }; + function Zz(a10, b10, c10, e10) { + var f10 = a10.Nl.Pe.Ja(e10); + if (f10 instanceof z7) + c10.sb.U(w6(/* @__PURE__ */ function(h10, k10, l10, m10) { + return function(p10) { + var t10 = p10.Aa, v10 = IO(); + t10 = t10.Qp(v10).pk(); + t10.b() ? t10 = y7() : (t10 = t10.c(), t10 = new z7().d(t10.va)); + v10 = t10.b() ? p10.Aa.t() : t10.c(); + if (!h10.K$(k10, v10) && !l10.Ha(v10)) { + t10 = Wd().QI; + v10 = "Property '" + v10 + "' not supported in a " + h10.Gg() + " " + k10 + " node"; + var A10 = y7(); + ec(h10, t10, m10, A10, v10, p10.da); + } + }; + }(a10, e10, f10.i, b10))); + else if (y7() === f10) { + f10 = Wd().QI; + e10 = "Cannot validate unknown node type " + e10 + " for " + a10.Gg(); + var g10 = y7(); + ec(a10, f10, b10, g10, e10, c10.da); + } else + throw new x7().d(f10); + } + function dub(a10) { + return Ed(ua(), a10, "/") ? (a10 = new qg().e(a10), a10.np(0, a10.Oa() - 1 | 0)) : a10; + } + function JP() { + GP.call(this); + this.Fa = this.ra = this.HT = this.gg = this.ic = null; + } + JP.prototype = new N22(); + JP.prototype.constructor = JP; + d7 = JP.prototype; + d7.H = function() { + return "InheritanceParser"; + }; + d7.E = function() { + return 3; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof JP && a10.Fa === this.Fa) { + if (this.ic === a10.ic) { + var b10 = this.gg, c10 = a10.gg; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + if (b10) + return b10 = this.HT, a10 = a10.HT, null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ic; + case 1: + return this.gg; + case 2: + return this.HT; + default: + throw new U6().e("" + a10); + } + }; + function YFa(a10, b10, c10, e10, f10, g10) { + a10.ic = c10; + a10.gg = e10; + a10.HT = f10; + a10.ra = g10; + if (null === b10) + throw mb(E6(), null); + a10.Fa = b10; + GP.prototype.ss.call(a10, g10); + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.LN = function() { + return this.Fa; + }; + d7.hd = function() { + var a10 = this.ic.i.hb().gb; + if (Q5().cd === a10) { + a10 = this.ic.i; + var b10 = lc(); + b10 = N6(a10, b10, this.ra); + a10 = 1 < b10.jb(); + var c10 = K7(); + b10 = b10.og(c10.u); + a10 = w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + if (null !== l10) { + var m10 = l10.ma(); + l10 = l10.Ki(); + l10 = k10 ? "" + h10.gg.j + l10 : h10.gg.j; + var p10 = bc(); + p10 = N6(m10, p10, h10.ra).va; + var t10 = fla().qj(p10); + if (!t10.b()) + return p10 = t10.c(), t10 = h10.Fa.Jq, m10 = new z7().d(m10), m10 = $A(t10, 0, m10, false, h10.ra).AP(p10).c(), p10 = lt2(), m10.ub(l10, p10); + if (zca(p10, false)) + return m10 = xca(p10), t10 = Od(O7(), h10.ic.Aa), m10 = Sd(m10, p10, t10), p10 = lt2(), m10.ub(l10, p10); + l10 = fB(h10.ra.pe(), p10, Xs(), y7()); + return l10 instanceof z7 ? l10.i : eub( + h10, + m10, + h10.gg + ); + } + throw new x7().d(l10); + }; + }(this, a10)); + c10 = K7(); + a10 = b10.ka(a10, c10.u); + b10 = this.gg; + ae4(); + c10 = this.Fa.Fd.da; + c10 = ce4(0, de4(ee4(), c10.rf, c10.If, c10.Yf, c10.bg)); + uca(this, b10, a10, c10); + Ui(this.gg.Y(), qf().xd, Zr(new $r(), a10, Od(O7(), this.ic.i)), Od(O7(), this.ic)); + } else if (Q5().sa === a10) { + if (a10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return k10.ub(h10.gg.j, lt2()); + }; + }(this)), RW(false, false), QP(), this.ra).Cc(), !a10.b()) { + a10 = a10.c(); + b10 = this.gg; + c10 = J5(K7(), new Ib().ha([a10])); + ae4(); + var e10 = this.ic.da; + e10 = ce4(0, de4(ee4(), e10.rf, e10.If, e10.Yf, e10.bg)); + uca(this, b10, c10, e10); + b10 = this.gg; + c10 = qf().xd; + e10 = K7(); + a10 = Zr(new $r(), J5(e10, new Ib().ha([a10])), Od(O7(), this.ic.i)); + e10 = Od(O7(), this.ic); + Rg(b10, c10, a10, e10); + } + } else if (b10 = fla(), c10 = this.ic.i, e10 = bc(), b10.qj(N6(c10, e10, this.ra).va).na()) + a10 = PW(QW(), this.ic, w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return k10.ub(h10.gg.j, lt2()); + }; + }(this)), RW(false, false), QP(), this.ra).Cc(), a10.b() || (a10 = a10.c(), b10 = this.gg, c10 = J5(K7(), new Ib().ha([a10])), ae4(), e10 = this.ic.da, e10 = ce4(0, de4(ee4(), e10.rf, e10.If, e10.Yf, e10.bg)), uca(this, b10, c10, e10), b10 = this.gg, c10 = qf().xd, e10 = K7(), a10 = Zr(new $r(), J5(e10, new Ib().ha([a10])), Od(O7(), this.ic.i)), e10 = Od(O7(), this.ic), Rg(b10, c10, a10, e10)); + else if (Q5().Na === a10 ? (a10 = dla(), T6(), b10 = this.ic.i, c10 = this.ra, e10 = Dd(), a10 = a10.qj(N6(b10, e10, c10)).na()) : a10 = false, a10) + a10 = new M32().ZK((T6(), mh(T6(), "schema")), this.ic.i, w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return Rd(k10, h10.gg.j + "/xmlSchema"); + }; + }(this)), false, this.ra), a10 = FP(a10), b10 = this.gg, c10 = J5(K7(), new Ib().ha([a10])), ae4(), e10 = this.ic.da, e10 = ce4(0, de4(ee4(), e10.rf, e10.If, e10.Yf, e10.bg)), uca(this, b10, c10, e10), b10 = this.gg, c10 = qf().xd, e10 = K7(), a10 = Zr(new $r(), J5(e10, new Ib().ha([a10])), Od(O7(), this.ic.i)), e10 = Od(O7(), this.ic), Rg(b10, c10, a10, e10); + else if (a10 = this.ic.i, b10 = bc(), a10 = N6(a10, b10, this.ra).va, zca(a10, false)) + a10 = this.gg, b10 = new xi().a(), Cb(a10, b10); + else if (a10 = this.ic.i, b10 = bc(), a10 = N6(a10, b10, this.ra).va, b10 = fB(this.ra.pe(), a10, Xs(), y7()), b10 instanceof z7) { + var f10 = b10.i; + b10 = this.gg; + c10 = J5(K7(), new Ib().ha([f10])); + ae4(); + e10 = this.ic.da; + e10 = ce4(0, de4(ee4(), e10.rf, e10.If, e10.Yf, e10.bg)); + uca(this, b10, c10, e10); + b10 = this.gg.Y(); + c10 = qf().xd; + e10 = K7(); + a10 = f10.Ug(a10, Od(O7(), this.ic.i)); + f10 = B6(f10.Y(), qf().R).A; + f10 = f10.b() ? "schema" : f10.c(); + var g10 = Od(O7(), this.ic.Aa); + a10 = Sd(a10, f10, g10); + f10 = new Kz().a(); + a10 = [Cb(a10, f10)]; + Ui(b10, c10, Zr(new $r(), J5(e10, new Ib().ha(a10)), Od(O7(), this.ic.i)), Od(O7(), this.ic)); + } else { + ela().qj(a10).b() ? c10 = eub( + this, + this.ic.i, + this.gg + ) : (b10 = this.ra, c10 = sg().cJ, e10 = this.gg.j, f10 = new z7().d(ic(qf().xd.r)), nM(b10, c10, e10, f10, "Inheritance from JSON Schema", this.ic.i.da), b10 = new N32().ZK((T6(), mh(T6(), "schema")), this.ic.i, w6(/* @__PURE__ */ function(h10) { + return function(k10) { + return Rd(k10, h10.gg.j + "/jsonSchema"); + }; + }(this)), false, this.ra), c10 = FP(b10)); + if (null === a10) + throw new sf().a(); + tf(uf(), "<<.*>>", a10) || (a10 = this.gg, b10 = qf().xd, e10 = K7(), c10 = Zr(new $r(), J5(e10, new Ib().ha([c10])), Od(O7(), this.ic.i)), e10 = Od(O7(), this.ic), Rg(a10, b10, c10, e10)); + } + }; + d7.z = function() { + return X5(this); + }; + function eub(a10, b10, c10) { + var e10 = bc(); + e10 = N6(b10, e10, a10.ra).va; + var f10 = new S6().a(), g10 = Od(O7(), b10), h10 = a10.HT; + h10.b() ? h10 = y7() : (h10 = h10.c(), h10 = new z7().d(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + var v10 = new B32(), A10 = l10.ra, D10 = l10.Fa.kB; + v10.pa = m10; + v10.X = p10; + v10.m = A10; + v10.gQ = D10; + v10.xP = t10; + return v10; + }; + }(a10, c10, h10)))); + c10 = wi(new vi(), f10, g10, e10, h10, new z7().d(w6(/* @__PURE__ */ function(l10, m10) { + return function(p10) { + var t10 = m10.Y(), v10 = db().pf; + t10.vb.Ha(v10) && (t10 = db().pf, eb(m10, t10, p10)); + }; + }(a10, c10))), true); + Jb(c10, a10.ra); + if (tCa(new je4().e(e10))) + f10 = false; + else { + f10 = pd(a10.ra.pe().xi).th.Er(); + for (g10 = false; !g10 && f10.Ya(); ) + g10 = f10.$a(), h10 = Mc(ua(), e10, "\\."), g10 = g10 === zj(new Pc().fd(h10)); + f10 = g10; + } + if (f10) { + f10 = a10.ra; + g10 = sg().vR; + h10 = c10.j; + e10 = "Chained reference '" + e10; + var k10 = y7(); + ec(f10, g10, h10, k10, e10, b10.da); + } else + lB(c10, e10, b10, a10.ra); + a10.Fa.Jq.P(c10); + return c10; + } + d7.Gp = function() { + return this.ra; + }; + d7.$classData = r8({ cQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlTypeParser$InheritanceParser", { cQa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, lr: 1, sha: 1, y: 1, v: 1, q: 1, o: 1 }); + function c9(a10) { + var b10 = rn(), c10 = F6().Eb; + a10.eG(rb(new sb(), b10, G5(c10, "xmlSerialization"), tb(new ub(), vb().Eb, "XML serialization", "information about how to serialize", H10()))); + b10 = qb(); + c10 = F6().Tb; + a10.dG(rb(new sb(), b10, G5(c10, "comment"), tb(new ub(), vb().Tb, "comment", "Comment associated to schema", H10()))); + ii(); + b10 = F6().Eb; + b10 = [G5(b10, "AnyShape")]; + c10 = -1 + (b10.length | 0) | 0; + for (var e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + b10 = e10; + c10 = qf().ba; + e10 = ii(); + a10.fG(b10.ia(c10, e10.u)); + } + function fub() { + this.Xm = this.Ec = this.Sf = this.Xv = this.R = this.Va = this.oe = this.ed = this.te = this.pf = this.go = this.ck = this.Kn = this.Zc = this.CF = this.Ne = this.qa = this.ba = this.g = null; + } + fub.prototype = new u7(); + fub.prototype.constructor = fub; + d7 = fub.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + gub = this; + ida(this); + mi(this); + ki(this); + gda(this); + wb(this); + pb(this); + Cr(this); + bM(this); + tsb(this); + ii(); + for (var a10 = [this.R, this.Va, this.Ne, this.CF, this.Zc, this.Kn, this.ck, this.go, this.Xm, this.Ec, this.Sf, this.Xv], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + a10 = F6().Ta; + a10 = G5(a10, "Message"); + b10 = nc().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Message", "", H10()); + return this; + }; + d7.U8 = function(a10) { + this.CF = a10; + }; + d7.K_ = function(a10) { + this.Xv = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.W8 = function(a10) { + this.Ne = a10; + }; + d7.nc = function() { + }; + d7.T8 = function(a10) { + this.go = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.X8 = function(a10) { + this.ck = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.rS = function(a10) { + this.Xm = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Y8 = function(a10) { + this.Kn = a10; + }; + d7.V8 = function(a10) { + this.Zc = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ x_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.MessageModel$", { x_a: 1, f: 1, Cha: 1, UY: 1, Rt: 1, Zu: 1, r7: 1, nm: 1, sk: 1, mm: 1, hc: 1, Rb: 1 }); + var gub = void 0; + function zD() { + gub || (gub = new fub().a()); + return gub; + } + function hub() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.R = this.fw = this.Ec = this.Va = this.qa = this.g = this.ba = this.la = this.Ne = this.Jc = this.We = this.Su = this.Vu = this.Yt = this.wF = this.uh = this.yj = this.gw = null; + this.xa = 0; + } + hub.prototype = new u7(); + hub.prototype.constructor = hub; + d7 = hub.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + iub = this; + Cr(this); + uU(this); + bM(this); + wb(this); + JAa(this); + mi(this); + pb(this); + var a10 = qb(), b10 = F6().Ta; + b10 = G5(b10, "paramName"); + var c10 = vb().Ta, e10 = K7(), f10 = F6().Tb; + this.gw = rb(new sb(), a10, b10, tb(new ub(), c10, "param name", "Name of a parameter", J5(e10, new Ib().ha([ic(G5(f10, "name"))])))); + a10 = zc(); + b10 = F6().Ta; + this.yj = rb(new sb(), a10, G5(b10, "required"), tb(new ub(), vb().Ta, "required", "Marks the parameter as required", H10())); + a10 = zc(); + b10 = F6().Zd; + this.uh = rb(new sb(), a10, G5(b10, "deprecated"), tb( + new ub(), + vb().Ta, + "deprecated", + "Marks the parameter as deprecated", + H10() + )); + a10 = zc(); + b10 = F6().Ta; + this.wF = rb(new sb(), a10, G5(b10, "allowEmptyValue"), tb(new ub(), vb().Ta, "allow empty value", "Parameter can be passed without value", H10())); + a10 = qb(); + b10 = F6().Ta; + this.Yt = rb(new sb(), a10, G5(b10, "style"), tb(new ub(), vb().Ta, "style", "Encoding style for the parameter information", H10())); + a10 = zc(); + b10 = F6().Ta; + this.Vu = rb(new sb(), a10, G5(b10, "explode"), tb(new ub(), vb().Ta, "explode", "", H10())); + a10 = zc(); + b10 = F6().Ta; + this.Su = rb(new sb(), a10, G5(b10, "allowReserved"), tb(new ub(), vb().Ta, "allow reserved", "", H10())); + a10 = qb(); + b10 = F6().Ta; + this.We = rb( + new sb(), + a10, + G5(b10, "binding"), + tb(new ub(), vb().Ta, "binding", "Part of the Request model where the parameter can be encoded (header, path, query param, etc.)", H10()) + ); + a10 = qf(); + b10 = F6().Eb; + this.Jc = rb(new sb(), a10, G5(b10, "schema"), tb(new ub(), vb().Eb, "schema", "Schema the parameter value must validate", H10())); + a10 = new xc().yd(xm()); + b10 = F6().Ta; + this.Ne = rb(new sb(), a10, G5(b10, "payload"), tb(new ub(), vb().Ta, "payload", "", H10())); + this.la = this.R; + a10 = F6().Ta; + a10 = G5(a10, "Parameter"); + b10 = nc().ba; + this.ba = ji(a10, b10); + ii(); + a10 = [ + this.R, + this.gw, + this.Va, + this.yj, + this.uh, + this.wF, + this.Yt, + this.Vu, + this.Su, + this.We, + this.Jc, + this.Ne, + this.Ec + ]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Parameter", "Piece of data required or returned by an Operation", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.A_ = function(a10) { + this.fw = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Wl().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ A_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.ParameterModel$", { A_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, nm: 1, EY: 1, Rt: 1, sk: 1 }); + var iub = void 0; + function cj() { + iub || (iub = new hub().a()); + return iub; + } + function jub() { + this.wd = this.bb = this.mc = this.fw = this.R = this.Va = this.oe = this.ed = this.te = this.pf = this.Ec = this.qa = this.g = this.ba = this.la = this.XI = this.Jc = this.fia = this.Nd = null; + this.xa = 0; + } + jub.prototype = new u7(); + jub.prototype.constructor = jub; + d7 = jub.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.a = function() { + kub = this; + Cr(this); + uU(this); + JAa(this); + wb(this); + pb(this); + bM(this); + mi(this); + var a10 = qb(), b10 = F6().Tb; + this.Nd = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "media type", "Media types supported in the payload", H10())); + a10 = qb(); + b10 = F6().Ta; + this.fia = rb(new sb(), a10, G5(b10, "schemaMediaType"), tb(new ub(), vb().Ta, "schemaMediaType", "defines the format of the defined payload schema", H10())); + a10 = qf(); + b10 = F6().Eb; + this.Jc = rb(new sb(), a10, G5(b10, "schema"), tb(new ub(), vb().Eb, "schema", "Schema associated to this payload", H10())); + a10 = new xc().yd(dm()); + b10 = F6().Ta; + this.XI = rb(new sb(), a10, G5(b10, "encoding"), tb(new ub(), vb().Ta, "encoding", "", H10())); + this.la = this.Nd; + a10 = F6().Ta; + a10 = G5(a10, "Payload"); + b10 = nc().ba; + this.ba = ji(a10, b10); + a10 = this.R; + b10 = this.Nd; + var c10 = this.fia, e10 = this.Jc, f10 = this.Ec, g10 = this.XI, h10 = nc().g, k10 = db().g, l10 = ii(); + h10 = h10.ia(k10, l10.u); + this.g = ji(a10, ji(b10, ji(c10, ji(e10, ji(f10, ji(g10, h10)))))); + this.qa = tb(new ub(), vb().Ta, "Payload", "Encoded payload using certain media-type", H10()); + return this; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.A_ = function(a10) { + this.fw = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new ym().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ B_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.PayloadModel$", { B_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, EY: 1, nm: 1, sk: 1, mm: 1, Rt: 1 }); + var kub = void 0; + function xm() { + kub || (kub = new jub().a()); + return kub; + } + function ym() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + ym.prototype = new u7(); + ym.prototype.constructor = ym; + d7 = ym.prototype; + d7.Doa = function() { + it2(this.g, xm().Ec); + }; + d7.H = function() { + return "Payload"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.Cka = function() { + return B6(this.g, xm().Ec); + }; + function Kdb(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new em().K(new S6().a(), c10); + var e10 = dm().lD; + b10 = eb(c10, e10, b10); + c10 = xm().XI; + ig(a10, c10, b10); + return b10; + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ym ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new ym().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return xm(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, xm().Nd).A; + a10.b() ? (a10 = B6(this.g, xm().R).A, a10 = a10.b() ? "default" : a10.c()) : a10 = a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.cfa = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Hh().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = xm().Jc; + Vd(this, b10, a10); + return a10; + }; + d7.Epa = function() { + return B6(this.g, xm().Jc); + }; + d7.dX = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Mh().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + a10 = Sd(b10, a10, c10); + b10 = xm().Jc; + Vd(this, b10, a10); + return a10; + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new ym().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.Zg = function() { + return xm().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.qF = function(a10) { + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new en().K(c10, b10); + a10.b() || (a10 = a10.c(), O7(), c10 = new P6().a(), Sd(b10, a10, c10)); + a10 = xm().Ec; + ig(this, a10, b10); + return b10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.$classData = r8({ D0a: 0 }, false, "amf.plugins.domain.webapi.models.Payload", { D0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, Kha: 1, y: 1, v: 1, q: 1, o: 1 }); + function lub() { + } + lub.prototype = new u7(); + lub.prototype.constructor = lub; + function mub() { + } + d7 = mub.prototype = lub.prototype; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ps = function(a10) { + return nya(this, a10); + }; + d7.ua = function() { + var a10 = ii().u; + return qt(this, a10); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.gl = function(a10) { + return kgb(this, a10); + }; + d7.Kg = function(a10) { + return this.Zn("", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return this.v$(a10, false); + }; + d7.Mj = function() { + var a10 = b32().u; + return qt(this, a10); + }; + d7.v$ = function(a10, b10) { + return D6(this, a10, b10); + }; + d7.jb = function() { + return VJ(this); + }; + d7.Pm = function(a10) { + return lgb(this, a10); + }; + d7.cm = function() { + return this.Kg(""); + }; + d7.Si = function(a10) { + return this.v$(a10, true); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.hm = function() { + return -1; + }; + d7.Dm = function(a10) { + return wja(this, a10); + }; + d7.ta = function() { + return Qx(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.op = function() { + return this.ng(); + }; + d7.ke = function() { + return this.Dd(); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Ql = function(a10, b10) { + return this.ne(a10, b10); + }; + d7.Zi = function() { + return this; + }; + d7.Vh = function() { + return this.ke(); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.Ch = function(a10) { + var b10 = UA(new VA(), nu()); + this.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.jd(f10); + }; + }(this, b10, a10))); + return b10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return this.Di().Qd(); + }; + d7.Xk = function() { + return G6(this); + }; + function nub(a10, b10) { + if (0 > b10) + return 1; + var c10 = 0; + for (a10 = a10.mb(); a10.Ya(); ) { + if (c10 === b10) + return a10.Ya() ? 1 : 0; + a10.$a(); + c10 = 1 + c10 | 0; + } + return c10 - b10 | 0; + } + function ju(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + c10.jh(a10.ok()); + c10.jd(b10); + return c10.Rc(); + } + function Dw(a10, b10) { + var c10 = a10.Oa(), e10 = a10.Qd(); + if (1 === c10) + e10.jh(a10); + else if (1 < c10) { + e10.pj(c10); + c10 = ja(Ja(Ha), [c10]); + var f10 = new lC().ue(0); + a10.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + h10.n[k10.oa] = l10; + k10.oa = 1 + k10.oa | 0; + }; + }(a10, c10, f10))); + Zva(AI(), c10, b10); + for (f10.oa = 0; f10.oa < c10.n.length; ) + e10.jd(c10.n[f10.oa]), f10.oa = 1 + f10.oa | 0; + } + return e10.Rc(); + } + function oub(a10, b10, c10) { + var e10 = 0 < c10 ? c10 : 0; + for (a10 = a10.mb().OD(c10); a10.Ya(); ) { + if (b10.P(a10.$a())) + return e10; + e10 = 1 + e10 | 0; + } + return -1; + } + function d9(a10, b10) { + b10 = pub(a10, b10); + var c10 = a10.Qd(); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = f10.P(h10) | 0; + 0 < k10 && (g10.jd(h10), f10.jm(h10, -1 + k10 | 0)); + }; + }(a10, b10, c10))); + return c10.Rc(); + } + function soa(a10) { + var b10 = H10(), c10 = new qd().d(b10); + a10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + f10.oa = ji(g10, f10.oa); + }; + }(a10, c10))); + b10 = a10.Qd(); + $Ja(b10, a10); + for (a10 = c10.oa; !a10.b(); ) + c10 = a10.ga(), b10.jd(c10), a10 = a10.ta(); + return b10.Rc(); + } + function xN(a10) { + var b10 = !!(a10 && a10.$classData && a10.$classData.ge.VH); + if (b10 && 0 >= a10.Oe(1)) + return a10.Zi(); + for (var c10 = a10.Qd(), e10 = new mq().a(), f10 = a10.mb(), g10 = false; f10.Ya(); ) { + var h10 = f10.$a(); + Nya(e10, h10) ? c10.jd(h10) : g10 = true; + } + return g10 || !b10 ? c10.Rc() : a10.Zi(); + } + function qub(a10, b10, c10) { + c10 = c10.en(a10.Zi()); + c10.jd(b10); + c10.jh(a10.ok()); + return c10.Rc(); + } + function e92(a10, b10) { + b10 = pub(a10, b10); + var c10 = a10.Qd(); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + var k10 = f10.P(h10) | 0; + return 0 === k10 ? g10.jd(h10) : (f10.jm(h10, -1 + k10 | 0), void 0); + }; + }(a10, b10, c10))); + return c10.Rc(); + } + function pub(a10, b10) { + var c10 = new f9().aL(a10); + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = 1 + (f10.P(g10) | 0) | 0; + f10.Ue(g10, h10); + }; + }(a10, c10))); + return c10; + } + function mu(a10, b10) { + return a10.Od(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return Va(Wa(), f10, e10); + }; + }(a10, b10))); + } + function g9(a10, b10, c10) { + return a10.nk(hmb(c10, b10)); + } + function rub(a10, b10, c10) { + var e10 = 0; + for (a10 = a10.mb().OD(c10); a10.Ya() && b10.P(a10.$a()); ) + e10 = 1 + e10 | 0; + return e10; + } + function sIa(a10, b10) { + return a10.rn(b10); + } + function sub(a10, b10) { + var c10 = a10.gy(b10); + a10 = a10.fy(b10); + return new R6().M(c10, a10); + } + function tub(a10, b10) { + return a10.BL(b10.Hd().op()); + } + function uub(a10, b10) { + var c10 = a10.rn(b10); + a10 = a10.rn(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return !f10.P(g10); + }; + }(a10, b10))); + return new R6().M(c10, a10); + } + function h9(a10) { + return "" + a10.Xk() + a10.xM() + "(...)"; + } + function vub(a10, b10) { + b10 = Sj(a10).am(b10); + return new Rv().dH(b10, w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.CL(oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return g10; + }; + }(c10, e10))); + }; + }(a10))); + } + function i9(a10, b10) { + return a10.rn(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return !e10.P(f10); + }; + }(a10, b10))); + } + function wub(a10, b10) { + return a10.uK(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.Sa(f10); + }; + }(a10, b10))).BE(b10); + } + function xub(a10) { + throw new Lu().e(vva(MH(), a10, ".newBuilder")); + } + function j9(a10) { + return a10.b() ? a10.mW() : yub(a10, 1); + } + function Gl() { + Ik.call(this); + } + Gl.prototype = new Agb(); + Gl.prototype.constructor = Gl; + function zub() { + } + d7 = zub.prototype = Gl.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Gl.prototype.UG.call(this, new Fl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Extension"; + }; + d7.MC = function() { + return this.LM(); + }; + d7.E = function() { + return 1; + }; + d7.LM = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Gl) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.LM(); + }; + d7.qk = function() { + return this.LM(); + }; + d7.Wr = function() { + return this.LM(); + }; + d7.UG = function(a10) { + Ik.prototype.Xz.call(this, a10); + return this; + }; + d7.oc = function() { + return this.LM(); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ mga: 0 }, false, "amf.client.model.document.Extension", { mga: 1, eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1 }); + function Il() { + Ik.call(this); + } + Il.prototype = new Agb(); + Il.prototype.constructor = Il; + function Aub() { + } + d7 = Aub.prototype = Il.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Il.prototype.VG.call(this, new Hl().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "Overlay"; + }; + d7.MC = function() { + return this.MM(); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Il) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Be = function() { + return this.MM(); + }; + d7.qk = function() { + return this.MM(); + }; + d7.Wr = function() { + return this.MM(); + }; + d7.VG = function(a10) { + Ik.prototype.Xz.call(this, a10); + return this; + }; + d7.oc = function() { + return this.MM(); + }; + d7.MM = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ qga: 0 }, false, "amf.client.model.document.Overlay", { qga: 1, eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1 }); + function Pn() { + this.ea = this.k = null; + } + Pn.prototype = new u7(); + Pn.prototype.constructor = Pn; + d7 = Pn.prototype; + d7.H = function() { + return "Amqp091ChannelBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Pn.prototype.Jla.call(this, new On().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Pn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = Nn().Lh; + eb(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return Bub(this); + }; + d7.Gj = function() { + return Bub(this); + }; + d7.Jla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + function Bub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new On().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().pX && null === Z10().pX) { + c10 = Z10(); + var e10 = new z_(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.pX = e10; + } + b10 = Z10().pX; + return xu(b10.l.ea, a10); + } + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Pn.prototype.annotations = function() { + return this.rb(); + }; + Pn.prototype.graph = function() { + return jU(this); + }; + Pn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Pn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Pn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Pn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Pn.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Pn.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Pn.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Pn.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Pn.prototype.linkCopy = function() { + return this.Kf(); + }; + Pn.prototype.withQueue = function(a10) { + var b10 = this.k; + Z10(); + Cub(); + a10 = a10.k; + var c10 = Nn().OZ; + Vd(b10, c10, a10); + return this; + }; + Pn.prototype.withExchange = function(a10) { + var b10 = this.k; + Z10(); + Dub(); + a10 = a10.k; + var c10 = Nn().YX; + Vd(b10, c10, a10); + return this; + }; + Pn.prototype.withIs = function(a10) { + var b10 = this.k, c10 = Nn().wY; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(Pn.prototype, "queue", { get: function() { + Z10(); + var a10 = B6(this.k.g, Nn().OZ), b10 = Cub(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "exchange", { get: function() { + Z10(); + var a10 = B6(this.k.g, Nn().YX), b10 = Dub(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(Pn.prototype, "is", { get: function() { + Z10(); + var a10 = B6(this.k.g, Nn().wY); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Pn.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + Pn.prototype.$classData = r8({ hua: 0 }, false, "amf.client.model.domain.Amqp091ChannelBinding", { hua: 1, f: 1, W6: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function Yn() { + this.ea = this.k = null; + } + Yn.prototype = new u7(); + Yn.prototype.constructor = Yn; + d7 = Yn.prototype; + d7.H = function() { + return "Amqp091MessageBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Yn.prototype.Lla.call(this, new Xn().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Yn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = Wn().Lh; + eb(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return Eub(this); + }; + d7.Gj = function() { + return Eub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.Lla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.z = function() { + return X5(this); + }; + function Eub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Xn().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().rX && null === Z10().rX) { + c10 = Z10(); + var e10 = new B_(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.rX = e10; + } + b10 = Z10().rX; + return xu(b10.l.ea, a10); + } + d7.Og = function(a10) { + return ib(this, a10); + }; + Yn.prototype.annotations = function() { + return this.rb(); + }; + Yn.prototype.graph = function() { + return jU(this); + }; + Yn.prototype.withId = function(a10) { + return this.$b(a10); + }; + Yn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Yn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Yn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Yn.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Yn.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Yn.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Yn.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Yn.prototype.linkCopy = function() { + return this.Kf(); + }; + Yn.prototype.withMessageType = function(a10) { + var b10 = this.k, c10 = Wn().dZ; + eb(b10, c10, a10); + return this; + }; + Yn.prototype.withContentEncoding = function(a10) { + var b10 = this.k, c10 = Wn().DX; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(Yn.prototype, "messageType", { get: function() { + Z10(); + var a10 = B6(this.k.g, Wn().dZ); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Yn.prototype, "contentEncoding", { get: function() { + Z10(); + var a10 = B6(this.k.g, Wn().DX); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Yn.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + Yn.prototype.$classData = r8({ jua: 0 }, false, "amf.client.model.domain.Amqp091MessageBinding", { jua: 1, f: 1, KR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function go() { + this.ea = this.k = null; + } + go.prototype = new u7(); + go.prototype.constructor = go; + d7 = go.prototype; + d7.H = function() { + return "HttpMessageBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + go.prototype.Ola.call(this, new fo().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof go ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Ola = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = eo().Lh; + eb(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return Fub(this); + }; + d7.yy = function() { + return this.I$(); + }; + d7.Gj = function() { + return Fub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + function Fub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new fo().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().dY && null === Z10().dY) { + c10 = Z10(); + var e10 = new o0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.dY = e10; + } + b10 = Z10().dY; + return xu(b10.l.ea, a10); + } + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.I$ = function() { + Z10(); + var a10 = B6(this.k.g, eo().Tf); + return t1(Z10().Bg(), a10); + }; + d7.l4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = eo().Tf; + Vd(b10, c10, a10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + go.prototype.annotations = function() { + return this.rb(); + }; + go.prototype.graph = function() { + return jU(this); + }; + go.prototype.withId = function(a10) { + return this.$b(a10); + }; + go.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + go.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(go.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(go.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(go.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(go.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + go.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + go.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + go.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(go.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(go.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(go.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + go.prototype.linkCopy = function() { + return this.Kf(); + }; + go.prototype.withHeaders = function(a10) { + return this.l4(a10); + }; + Object.defineProperty(go.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + go.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + go.prototype.$classData = r8({ Iua: 0 }, false, "amf.client.model.domain.HttpMessageBinding", { Iua: 1, f: 1, KR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function jo() { + this.ea = this.k = null; + } + jo.prototype = new u7(); + jo.prototype.constructor = jo; + d7 = jo.prototype; + d7.H = function() { + return "HttpOperationBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + jo.prototype.Pla.call(this, new io().K(b10, a10)); + return this; + }; + d7.Xca = function() { + Z10(); + var a10 = B6(this.k.g, ho().nD); + return t1(Z10().Bg(), a10); + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof jo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = ho().Lh; + eb(b10, c10, a10); + return this; + }; + d7.y4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = ho().nD; + Vd(b10, c10, a10); + return this; + }; + d7.FQ = function(a10) { + var b10 = this.k, c10 = ho().pm; + eb(b10, c10, a10); + return this; + }; + d7.jF = function() { + Z10(); + var a10 = B6(this.k.g, ho().Hf); + Z10().cb(); + return gb(a10); + }; + d7.Kf = function() { + return Gub(this); + }; + d7.EC = function(a10) { + var b10 = this.k, c10 = ho().Hf; + eb(b10, c10, a10); + return this; + }; + d7.Gj = function() { + return Gub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.iV = function() { + Z10(); + var a10 = B6(this.k.g, ho().pm); + Z10().cb(); + return gb(a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Pla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + function Gub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new io().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().eY && null === Z10().eY) { + c10 = Z10(); + var e10 = new p0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.eY = e10; + } + b10 = Z10().eY; + return xu(b10.l.ea, a10); + } + d7.Og = function(a10) { + return ib(this, a10); + }; + jo.prototype.annotations = function() { + return this.rb(); + }; + jo.prototype.graph = function() { + return jU(this); + }; + jo.prototype.withId = function(a10) { + return this.$b(a10); + }; + jo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + jo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(jo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(jo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(jo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(jo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + jo.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + jo.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + jo.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(jo.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(jo.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(jo.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + jo.prototype.linkCopy = function() { + return this.Kf(); + }; + jo.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + jo.prototype.withQuery = function(a10) { + return this.y4(a10); + }; + jo.prototype.withMethod = function(a10) { + return this.FQ(a10); + }; + jo.prototype.withType = function(a10) { + return this.EC(a10); + }; + Object.defineProperty(jo.prototype, "query", { get: function() { + return this.Xca(); + }, configurable: true }); + Object.defineProperty(jo.prototype, "method", { get: function() { + return this.iV(); + }, configurable: true }); + Object.defineProperty(jo.prototype, "type", { get: function() { + return this.jF(); + }, configurable: true }); + jo.prototype.$classData = r8({ Jua: 0 }, false, "amf.client.model.domain.HttpOperationBinding", { Jua: 1, f: 1, LR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function lo() { + this.ea = this.k = null; + } + lo.prototype = new u7(); + lo.prototype.constructor = lo; + d7 = lo.prototype; + d7.H = function() { + return "KafkaMessageBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + lo.prototype.Qla.call(this, new ko().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof lo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Qla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function() { + return this; + }; + d7.Kf = function() { + return Hub(); + }; + function Hub() { + Z10(); + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new ko().K(b10, a10); + b10 = Z10(); + if (null === Z10().xY && null === Z10().xY) { + var c10 = Z10(), e10 = new r0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.xY = e10; + } + b10 = Z10().xY; + return xu(b10.l.ea, a10); + } + d7.Gj = function() { + return Hub(); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + lo.prototype.annotations = function() { + return this.rb(); + }; + lo.prototype.graph = function() { + return jU(this); + }; + lo.prototype.withId = function(a10) { + return this.$b(a10); + }; + lo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + lo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(lo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(lo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(lo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(lo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + lo.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + lo.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + lo.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(lo.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(lo.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(lo.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + lo.prototype.linkCopy = function() { + return this.Kf(); + }; + lo.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + lo.prototype.withKey = function(a10) { + var b10 = this.k, c10 = zea().AY; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(lo.prototype, "key", { get: function() { + return B6(this.k.g, zea().AY); + }, configurable: true }); + lo.prototype.$classData = r8({ Mua: 0 }, false, "amf.client.model.domain.KafkaMessageBinding", { Mua: 1, f: 1, KR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function oo() { + this.ea = this.k = null; + } + oo.prototype = new u7(); + oo.prototype.constructor = oo; + d7 = oo.prototype; + d7.w9 = function() { + Z10(); + var a10 = B6(this.k.g, mo().QC); + Z10().cb(); + return gb(a10); + }; + d7.H = function() { + return "KafkaOperationBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + oo.prototype.Rla.call(this, new no().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.a4 = function(a10) { + var b10 = this.k, c10 = mo().QC; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof oo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = mo().Lh; + eb(b10, c10, a10); + return this; + }; + function Iub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new no().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().yY && null === Z10().yY) { + c10 = Z10(); + var e10 = new s0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.yY = e10; + } + b10 = Z10().yY; + return xu(b10.l.ea, a10); + } + d7.Kf = function() { + return Iub(this); + }; + d7.Gj = function() { + return Iub(this); + }; + d7.Rla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + oo.prototype.annotations = function() { + return this.rb(); + }; + oo.prototype.graph = function() { + return jU(this); + }; + oo.prototype.withId = function(a10) { + return this.$b(a10); + }; + oo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + oo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(oo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(oo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(oo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(oo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + oo.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + oo.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + oo.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(oo.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(oo.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(oo.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + oo.prototype.linkCopy = function() { + return this.Kf(); + }; + oo.prototype.withClientId = function(a10) { + return this.a4(a10); + }; + oo.prototype.withGroupId = function(a10) { + var b10 = this.k, c10 = mo().cY; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(oo.prototype, "clientId", { get: function() { + return this.w9(); + }, configurable: true }); + Object.defineProperty(oo.prototype, "groupId", { get: function() { + Z10(); + var a10 = B6(this.k.g, mo().cY); + Z10().cb(); + return gb(a10); + }, configurable: true }); + oo.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + oo.prototype.$classData = r8({ Nua: 0 }, false, "amf.client.model.domain.KafkaOperationBinding", { Nua: 1, f: 1, LR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function qo() { + this.ea = this.k = null; + } + qo.prototype = new u7(); + qo.prototype.constructor = qo; + d7 = qo.prototype; + d7.H = function() { + return "MqttMessageBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + qo.prototype.Sla.call(this, new po().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof qo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + function Jub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new po().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().iZ && null === Z10().iZ) { + c10 = Z10(); + var e10 = new v0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.iZ = e10; + } + b10 = Z10().iZ; + return xu(b10.l.ea, a10); + } + d7.rq = function(a10) { + var b10 = this.k, c10 = Aea().Lh; + eb(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return Jub(this); + }; + d7.Gj = function() { + return Jub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Sla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + qo.prototype.annotations = function() { + return this.rb(); + }; + qo.prototype.graph = function() { + return jU(this); + }; + qo.prototype.withId = function(a10) { + return this.$b(a10); + }; + qo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + qo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(qo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(qo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(qo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(qo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + qo.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + qo.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + qo.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(qo.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(qo.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(qo.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + qo.prototype.linkCopy = function() { + return this.Kf(); + }; + qo.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + qo.prototype.$classData = r8({ Rua: 0 }, false, "amf.client.model.domain.MqttMessageBinding", { Rua: 1, f: 1, KR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function to() { + this.ea = this.k = null; + } + to.prototype = new u7(); + to.prototype.constructor = to; + d7 = to.prototype; + d7.H = function() { + return "MqttOperationBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + to.prototype.Tla.call(this, new so().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Q4 = function() { + return B6(this.k.g, ro().oD); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof to ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = ro().Lh; + eb(b10, c10, a10); + return this; + }; + function Kub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new so().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().jZ && null === Z10().jZ) { + c10 = Z10(); + var e10 = new w0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.jZ = e10; + } + b10 = Z10().jZ; + return xu(b10.l.ea, a10); + } + d7.C4 = function(a10) { + var b10 = this.k, c10 = ro().oD; + Bi(b10, c10, a10); + return this; + }; + d7.Kf = function() { + return Kub(this); + }; + d7.Gj = function() { + return Kub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.u4 = function(a10) { + var b10 = this.k, c10 = ro().mD; + es(b10, c10, a10); + return this; + }; + d7.Tla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.N4 = function() { + return B6(this.k.g, ro().mD); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + to.prototype.annotations = function() { + return this.rb(); + }; + to.prototype.graph = function() { + return jU(this); + }; + to.prototype.withId = function(a10) { + return this.$b(a10); + }; + to.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + to.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(to.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(to.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(to.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(to.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + to.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + to.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + to.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(to.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(to.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(to.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + to.prototype.linkCopy = function() { + return this.Kf(); + }; + to.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + to.prototype.withRetain = function(a10) { + return this.C4(!!a10); + }; + to.prototype.withQos = function(a10) { + return this.u4(a10 | 0); + }; + Object.defineProperty(to.prototype, "retain", { get: function() { + return this.Q4(); + }, configurable: true }); + Object.defineProperty(to.prototype, "qos", { get: function() { + return this.N4(); + }, configurable: true }); + to.prototype.$classData = r8({ Sua: 0 }, false, "amf.client.model.domain.MqttOperationBinding", { Sua: 1, f: 1, LR: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function wo() { + this.ea = this.k = null; + } + wo.prototype = new u7(); + wo.prototype.constructor = wo; + d7 = wo.prototype; + d7.w9 = function() { + Z10(); + var a10 = B6(this.k.g, uo().QC); + Z10().cb(); + return gb(a10); + }; + function Lub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new vo().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().kZ && null === Z10().kZ) { + c10 = Z10(); + var e10 = new x0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.kZ = e10; + } + b10 = Z10().kZ; + return xu(b10.l.ea, a10); + } + d7.H = function() { + return "MqttServerBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + wo.prototype.Ula.call(this, new vo().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.a4 = function(a10) { + var b10 = this.k, c10 = uo().QC; + eb(b10, c10, a10); + return this; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof wo ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = uo().Lh; + eb(b10, c10, a10); + return this; + }; + d7.Ula = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Kf = function() { + return Lub(this); + }; + d7.Gj = function() { + return Lub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + wo.prototype.annotations = function() { + return this.rb(); + }; + wo.prototype.graph = function() { + return jU(this); + }; + wo.prototype.withId = function(a10) { + return this.$b(a10); + }; + wo.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + wo.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(wo.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(wo.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(wo.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(wo.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + wo.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + wo.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + wo.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(wo.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(wo.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(wo.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + wo.prototype.linkCopy = function() { + return this.Kf(); + }; + wo.prototype.withKeepAlive = function(a10) { + a10 |= 0; + var b10 = this.k, c10 = uo().zY; + es(b10, c10, a10); + return this; + }; + wo.prototype.withLastWill = function(a10) { + var b10 = this.k; + Z10(); + Mub(); + a10 = a10.k; + var c10 = uo().WY; + Vd(b10, c10, a10); + return this; + }; + wo.prototype.withClientSession = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = uo().BX; + Bi(b10, c10, a10); + return this; + }; + wo.prototype.withClientId = function(a10) { + return this.a4(a10); + }; + Object.defineProperty(wo.prototype, "keepAlive", { get: function() { + Z10(); + var a10 = B6(this.k.g, uo().zY); + Z10().Pt(); + return CL(a10); + }, configurable: true }); + Object.defineProperty(wo.prototype, "lastWill", { get: function() { + Z10(); + var a10 = B6(this.k.g, uo().WY), b10 = Mub(); + return xu(b10.l.ea, a10); + }, configurable: true }); + Object.defineProperty(wo.prototype, "clientSession", { get: function() { + Z10(); + var a10 = B6(this.k.g, uo().BX); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(wo.prototype, "clientId", { get: function() { + return this.w9(); + }, configurable: true }); + wo.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + wo.prototype.$classData = r8({ Tua: 0 }, false, "amf.client.model.domain.MqttServerBinding", { Tua: 1, f: 1, zga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wk() { + this.ea = this.k = null; + } + Wk.prototype = new u7(); + Wk.prototype.constructor = Wk; + d7 = Wk.prototype; + d7.IQ = function(a10) { + return pab(this, a10); + }; + d7.H = function() { + return "PropertyShape"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Wk.prototype.Y$.call(this, new Vk().K(new S6().a(), a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.HC = function() { + return M$a2(this); + }; + d7.TQ = function(a10) { + return V$a(this, a10); + }; + d7.Ce = function() { + return this.k; + }; + d7.r4 = function(a10) { + var b10 = this.k, c10 = Qi().Uf; + eb(b10, c10, a10); + return this; + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return oab(this); + }; + d7.xba = function() { + ab(); + var a10 = B6(this.k.aa, Qi().ji); + ab().Pt(); + return CL(a10); + }; + d7.vQ = function(a10) { + return fab(this, a10); + }; + d7.Yd = function() { + return qZa(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.UQ = function(a10) { + return Y$a(this, a10); + }; + d7.tQ = function(a10) { + return X$a(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Wk) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Hca = function() { + ab(); + var a10 = B6(this.k.aa, Qi().Uf); + ab().cb(); + return gb(a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.uQ = function(a10) { + return hab(this, a10); + }; + d7.QQ = function(a10) { + return vab(this, a10); + }; + d7.KQ = function(a10) { + return dab(this, a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.zQ = function(a10) { + return cab(this, a10); + }; + d7.HQ = function(a10) { + return bab(this, a10); + }; + d7.wQ = function(a10) { + return qab(this, a10); + }; + d7.yQ = function(a10) { + return sab(this, a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.BQ = function(a10) { + return gab(this, a10); + }; + d7.O4 = function() { + ab(); + var a10 = B6(this.k.aa, Qi().Vf); + return t1(ab().Bg(), a10); + }; + d7.sq = function(a10) { + return P$a(this, a10); + }; + d7.Kf = function() { + return Nub(this); + }; + d7.Gj = function() { + return Nub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + return iab(this, a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return U$a2(this); + }; + d7.z = function() { + return X5(this); + }; + d7.XQ = function() { + return this.Hca(); + }; + d7.n4 = function(a10) { + var b10 = this.k, c10 = Qi().ji; + es(b10, c10, a10); + return this; + }; + d7.Td = function(a10) { + return L$a(this, a10); + }; + function Nub(a10) { + ab(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Vk().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return NWa(ab().cB(), a10); + } + d7.CQ = function(a10) { + return R$a(this, a10); + }; + d7.Y$ = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.SQ = function(a10) { + return wab(this, a10); + }; + d7.xQ = function(a10) { + return aab(this, a10); + }; + d7.CC = function(a10) { + return rab(this, a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Wk.prototype.annotations = function() { + return this.rb(); + }; + Wk.prototype.graph = function() { + return jU(this); + }; + Wk.prototype.withId = function(a10) { + return this.$b(a10); + }; + Wk.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Wk.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Wk.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Wk.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Wk.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Wk.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Wk.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Wk.prototype.withThen = function(a10) { + return this.QQ(a10); + }; + Wk.prototype.withElse = function(a10) { + return this.zQ(a10); + }; + Wk.prototype.withIf = function(a10) { + return this.BQ(a10); + }; + Wk.prototype.withDeprecated = function(a10) { + return this.CC(!!a10); + }; + Wk.prototype.withWriteOnly = function(a10) { + return this.TQ(!!a10); + }; + Wk.prototype.withReadOnly = function(a10) { + return this.KQ(!!a10); + }; + Wk.prototype.withCustomShapePropertyDefinition = function(a10) { + return this.vQ(a10); + }; + Wk.prototype.withCustomShapePropertyDefinitions = function(a10) { + return this.wQ(a10); + }; + Wk.prototype.withCustomShapeProperties = function(a10) { + return this.uQ(a10); + }; + Wk.prototype.withDefaultStr = function(a10) { + return this.xQ(a10); + }; + Wk.prototype.withNode = function(a10) { + return this.HQ(a10); + }; + Wk.prototype.withXone = function(a10) { + return this.UQ(a10); + }; + Wk.prototype.withAnd = function(a10) { + return this.tQ(a10); + }; + Wk.prototype.withOr = function(a10) { + return this.IQ(a10); + }; + Wk.prototype.withInherits = function(a10) { + return this.CQ(a10); + }; + Wk.prototype.withValues = function(a10) { + return this.SQ(a10); + }; + Wk.prototype.withDefaultValue = function(a10) { + return this.yQ(a10); + }; + Wk.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Wk.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + Wk.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Wk.prototype, "thenShape", { get: function() { + return mab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "elseShape", { get: function() { + return N$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "ifShape", { get: function() { + return lab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "deprecated", { get: function() { + return this.HC(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "writeOnly", { get: function() { + return tab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "readOnly", { get: function() { + return T$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "not", { get: function() { + return O$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "xone", { get: function() { + return nab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "and", { get: function() { + return uab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "or", { get: function() { + return S$a2(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "customShapePropertyDefinitions", { get: function() { + return jab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "customShapeProperties", { get: function() { + return Z$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "inherits", { get: function() { + return W$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "values", { get: function() { + return eab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "defaultValueStr", { get: function() { + return kab(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "defaultValue", { get: function() { + return Q$a(this); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Wk.prototype.linkCopy = function() { + return this.Kf(); + }; + Wk.prototype.withPatternName = function(a10) { + var b10 = this.k, c10 = Qi().cv; + eb(b10, c10, a10); + return this; + }; + Wk.prototype.withMaxCount = function(a10) { + a10 |= 0; + var b10 = this.k, c10 = Qi().PF; + es(b10, c10, a10); + return this; + }; + Wk.prototype.withMinCount = function(a10) { + return this.n4(a10 | 0); + }; + Wk.prototype.withRange = function(a10) { + var b10 = this.k; + a10 = a10.Ce(); + var c10 = Qi().Vf; + Vd(b10, c10, a10); + return this; + }; + Wk.prototype.withPath = function(a10) { + return this.r4(a10); + }; + Object.defineProperty(Wk.prototype, "patternName", { get: function() { + ab(); + var a10 = B6(this.k.aa, Qi().cv); + ab().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "maxCount", { get: function() { + ab(); + var a10 = B6(this.k.aa, Qi().PF); + ab().Pt(); + return CL(a10); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "minCount", { get: function() { + return this.xba(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "range", { get: function() { + return this.O4(); + }, configurable: true }); + Object.defineProperty(Wk.prototype, "path", { get: function() { + return this.XQ(); + }, configurable: true }); + Wk.prototype.$classData = r8({ nva: 0 }, false, "amf.client.model.domain.PropertyShape", { nva: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function zn() { + this.ea = this.k = null; + } + zn.prototype = new u7(); + zn.prototype.constructor = zn; + d7 = zn.prototype; + d7.IQ = function(a10) { + return pab(this, a10); + }; + d7.H = function() { + return "RecursiveShape"; + }; + d7.zg = function() { + return $a(this); + }; + d7.HC = function() { + return M$a2(this); + }; + d7.TQ = function(a10) { + return V$a(this, a10); + }; + d7.Ce = function() { + return this.k; + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.tq = function() { + return oab(this); + }; + d7.vQ = function(a10) { + return fab(this, a10); + }; + d7.Yd = function() { + return qZa(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.UQ = function(a10) { + return Y$a(this, a10); + }; + d7.tQ = function(a10) { + return X$a(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zn ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.uQ = function(a10) { + return hab(this, a10); + }; + d7.ela = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.QQ = function(a10) { + return vab(this, a10); + }; + d7.KQ = function(a10) { + return dab(this, a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.zQ = function(a10) { + return cab(this, a10); + }; + d7.HQ = function(a10) { + return bab(this, a10); + }; + d7.wQ = function(a10) { + return qab(this, a10); + }; + d7.yQ = function(a10) { + return sab(this, a10); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.BQ = function(a10) { + return gab(this, a10); + }; + d7.sq = function(a10) { + return P$a(this, a10); + }; + d7.Kf = function() { + return this.Gj(); + }; + d7.Gj = function() { + throw mb(E6(), new nb().e("Recursive shape cannot be linked")); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Hh = function(a10) { + return iab(this, a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return U$a2(this); + }; + d7.z = function() { + return X5(this); + }; + d7.Td = function(a10) { + return L$a(this, a10); + }; + d7.CQ = function(a10) { + return R$a(this, a10); + }; + d7.SQ = function(a10) { + return wab(this, a10); + }; + d7.xQ = function(a10) { + return aab(this, a10); + }; + d7.CC = function(a10) { + return rab(this, a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + zn.prototype.annotations = function() { + return this.rb(); + }; + zn.prototype.graph = function() { + return jU(this); + }; + zn.prototype.withId = function(a10) { + return this.$b(a10); + }; + zn.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + zn.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(zn.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(zn.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(zn.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + zn.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + zn.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + zn.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(zn.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + zn.prototype.withThen = function(a10) { + return this.QQ(a10); + }; + zn.prototype.withElse = function(a10) { + return this.zQ(a10); + }; + zn.prototype.withIf = function(a10) { + return this.BQ(a10); + }; + zn.prototype.withDeprecated = function(a10) { + return this.CC(!!a10); + }; + zn.prototype.withWriteOnly = function(a10) { + return this.TQ(!!a10); + }; + zn.prototype.withReadOnly = function(a10) { + return this.KQ(!!a10); + }; + zn.prototype.withCustomShapePropertyDefinition = function(a10) { + return this.vQ(a10); + }; + zn.prototype.withCustomShapePropertyDefinitions = function(a10) { + return this.wQ(a10); + }; + zn.prototype.withCustomShapeProperties = function(a10) { + return this.uQ(a10); + }; + zn.prototype.withDefaultStr = function(a10) { + return this.xQ(a10); + }; + zn.prototype.withNode = function(a10) { + return this.HQ(a10); + }; + zn.prototype.withXone = function(a10) { + return this.UQ(a10); + }; + zn.prototype.withAnd = function(a10) { + return this.tQ(a10); + }; + zn.prototype.withOr = function(a10) { + return this.IQ(a10); + }; + zn.prototype.withInherits = function(a10) { + return this.CQ(a10); + }; + zn.prototype.withValues = function(a10) { + return this.SQ(a10); + }; + zn.prototype.withDefaultValue = function(a10) { + return this.yQ(a10); + }; + zn.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + zn.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + zn.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(zn.prototype, "thenShape", { get: function() { + return mab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "elseShape", { get: function() { + return N$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "ifShape", { get: function() { + return lab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "deprecated", { get: function() { + return this.HC(); + }, configurable: true }); + Object.defineProperty(zn.prototype, "writeOnly", { get: function() { + return tab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "readOnly", { get: function() { + return T$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "not", { get: function() { + return O$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "xone", { get: function() { + return nab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "and", { get: function() { + return uab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "or", { get: function() { + return S$a2(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "customShapePropertyDefinitions", { get: function() { + return jab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "customShapeProperties", { get: function() { + return Z$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "inherits", { get: function() { + return W$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "values", { get: function() { + return eab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "defaultValueStr", { get: function() { + return kab(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "defaultValue", { get: function() { + return Q$a(this); + }, configurable: true }); + Object.defineProperty(zn.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(zn.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(zn.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + zn.prototype.linkCopy = function() { + return this.Kf(); + }; + zn.prototype.withFixPoint = function(a10) { + var b10 = this.k, c10 = Ci().Ys; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(zn.prototype, "fixpoint", { get: function() { + ab(); + var a10 = B6(this.k.aa, Ci().Ys); + ab().cb(); + return gb(a10); + }, configurable: true }); + zn.prototype.$classData = r8({ qva: 0 }, false, "amf.client.model.domain.RecursiveShape", { qva: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cm() { + this.ea = this.k = null; + } + Cm.prototype = new u7(); + Cm.prototype.constructor = Cm; + d7 = Cm.prototype; + d7.PQ = function(a10) { + return r$a2(this, a10); + }; + d7.sI = function(a10) { + return this.AM(a10); + }; + d7.H = function() { + return "Request"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Cm.prototype.Cla.call(this, new Bm().K(new S6().a(), a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.tI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Am().Tf; + Zd(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.RQ = function(a10) { + return C$a(this, a10); + }; + d7.tq = function() { + return I$a2(this); + }; + d7.Yd = function() { + return l$a2(this); + }; + d7.JC = function() { + return q$a(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Cm ? this.k === a10.k : false; + }; + d7.efa = function(a10) { + Z10(); + a10 = this.k.K3(a10); + return I0(s8(), a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.AM = function(a10) { + Z10(); + a10 = this.k.lI(a10); + return I0(s8(), a10); + }; + d7.zI = function() { + return y$a2(this); + }; + d7.DC = function(a10) { + return F$a(this, a10); + }; + d7.c4 = function(a10) { + return w$a2(this, a10); + }; + d7.v4 = function(a10) { + return this.efa(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.jda = function() { + Z10(); + var a10 = B6(this.k.g, Am().yj); + Z10().yi(); + return yL(a10); + }; + d7.Cla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.GC = function() { + return v$a2(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + function Oub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Bm().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return QWa(Ytb(), a10); + } + d7.IC = function() { + return m$a2(this); + }; + d7.sq = function(a10) { + return G$a(this, a10); + }; + d7.qI = function(a10) { + return t$a2(this, a10); + }; + d7.Kf = function() { + return Oub(this); + }; + d7.yK = function() { + var a10 = Z10(), b10 = B6(this.k.g, Am().Tf), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.z4 = function(a10) { + var b10 = this.k, c10 = Am().yj; + Bi(b10, c10, a10); + return this; + }; + d7.yy = function() { + return this.yK(); + }; + d7.Gj = function() { + return Oub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.WQ = function() { + return H$a(this); + }; + d7.rb = function() { + return So(this); + }; + d7.BM = function(a10) { + Z10(); + var b10 = this.k; + a10 = new z7().d(a10); + b10 = jQ(b10, a10); + return L0(O52(), b10); + }; + d7.Hh = function(a10) { + return D$a(this, a10); + }; + d7.Vca = function() { + var a10 = Z10(), b10 = B6(this.k.g, Am().Tl), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.s4 = function(a10) { + return A$a2(this, a10); + }; + d7.$Q = function() { + return x$a2(this); + }; + d7.uI = function(a10) { + return this.BM(a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Wca = function() { + Z10(); + var a10 = B6(this.k.g, Am().Dq); + return t1(Z10().Bg(), a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.x4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = Am().Dq; + Vd(b10, c10, a10); + return this; + }; + d7.sh = function() { + return z$a(this); + }; + d7.z = function() { + return X5(this); + }; + d7.AI = function() { + return E$a2(this); + }; + d7.BC = function(a10) { + return o$a2(this, a10); + }; + d7.Td = function(a10) { + return B$a2(this, a10); + }; + d7.xI = function(a10) { + return i$a2(this, a10); + }; + d7.bR = function() { + return u$a2(this); + }; + d7.w4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Am().Tl; + Zd(b10, c10, a10); + return this; + }; + d7.pI = function() { + return K$a(this); + }; + d7.vI = function(a10) { + return J$a(this, a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Cm.prototype.annotations = function() { + return this.rb(); + }; + Cm.prototype.graph = function() { + return jU(this); + }; + Cm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Cm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Cm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Cm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Cm.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Cm.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Cm.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Cm.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Cm.prototype.withPayload = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 1: + if (sp(c10[0])) + return a10 = c10[0], this.uI(a10); + a10 = c10[0]; + return this.s4(a10); + case 0: + return n$a2(this); + default: + throw "No matching overload"; + } + }; + Cm.prototype.withBindings = function(a10) { + return this.BC(a10); + }; + Cm.prototype.withSummary = function(a10) { + return this.xI(a10); + }; + Cm.prototype.withTitle = function(a10) { + return this.RQ(a10); + }; + Cm.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + Cm.prototype.withCorrelationId = function(a10) { + return this.c4(a10); + }; + Cm.prototype.withPayloads = function(a10) { + return this.vI(a10); + }; + Cm.prototype.withExamples = function(a10) { + return this.DC(a10); + }; + Cm.prototype.withTags = function(a10) { + return this.PQ(a10); + }; + Cm.prototype.withDocumentation = function(a10) { + return this.qI(a10); + }; + Cm.prototype.withAbstract = function(a10) { + return this.pI(!!a10); + }; + Cm.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Cm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Cm.prototype, "bindings", { get: function() { + return this.GC(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "summary", { get: function() { + return this.AI(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "title", { get: function() { + return this.bR(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "correlationId", { get: function() { + return j$a2(this); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "payloads", { get: function() { + return this.zI(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "examples", { get: function() { + return this.JC(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "tags", { get: function() { + return this.$Q(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "documentation", { get: function() { + return this.IC(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "isAbstract", { get: function() { + return this.WQ(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Cm.prototype.linkCopy = function() { + return this.Kf(); + }; + Cm.prototype.withCookieParameter = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new Wl().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Am().BF; + ig(b10, c10, a10); + return I0(s8(), a10); + }; + Cm.prototype.withUriParameter = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new Wl().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Am().Zo; + ig(b10, c10, a10); + return I0(s8(), a10); + }; + Cm.prototype.withHeader = function(a10) { + return this.sI(a10); + }; + Cm.prototype.withQueryParameter = function(a10) { + return this.v4(a10); + }; + Cm.prototype.withCookieParameters = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Am().BF; + Zd(b10, c10, a10); + return this; + }; + Cm.prototype.withUriParameters = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Am().Zo; + Zd(b10, c10, a10); + return this; + }; + Cm.prototype.withQueryString = function(a10) { + return this.x4(a10); + }; + Cm.prototype.withHeaders = function(a10) { + return this.tI(a10); + }; + Cm.prototype.withQueryParameters = function(a10) { + return this.w4(a10); + }; + Cm.prototype.withRequired = function(a10) { + return this.z4(!!a10); + }; + Object.defineProperty(Cm.prototype, "cookieParameters", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Am().BF), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "uriParameters", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Am().Zo), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "queryString", { get: function() { + return this.Wca(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "queryParameters", { get: function() { + return this.Vca(); + }, configurable: true }); + Object.defineProperty(Cm.prototype, "required", { get: function() { + return this.jda(); + }, configurable: true }); + Cm.prototype.$classData = r8({ rva: 0 }, false, "amf.client.model.domain.Request", { rva: 1, f: 1, Qua: 1, ak: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wm() { + V6.call(this); + } + Wm.prototype = new Bgb(); + Wm.prototype.constructor = Wm; + d7 = Wm.prototype; + d7.H = function() { + return "ResourceType"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Wm.prototype.l1.call(this, new Vm().K(b10, a10)); + return this; + }; + d7.zg = function() { + return this.ZU(); + }; + d7.E = function() { + return 1; + }; + d7.l1 = function(a10) { + V6.prototype.$$.call(this, a10); + return this; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Wm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ZU = function() { + var a10 = Z10(), b10 = Za(this.k), c10 = Z10().jr(); + return bb(a10, b10, c10).Ra(); + }; + d7.Kf = function() { + return Pub(this); + }; + d7.Gj = function() { + return Pub(this); + }; + function Pub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Vm().K(c10, b10); + a10 = Rd(b10, a10.j); + Z10(); + null === Z10().Z7 && null === Z10().Z7 && (Z10().Z7 = new X0()); + Z10(); + return new Wm().l1(a10); + } + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.K1 = function() { + return Pub(this); + }; + Wm.prototype.asEndpoint = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + b10 = void 0 === e10[0] ? ok2() : e10[0]; + Z10(); + b10 = Plb(this.k, a10.Be(), b10, (this.k, Vea())); + return IWa(S8(), b10); + }; + Wm.prototype.$classData = r8({ sva: 0 }, false, "amf.client.model.domain.ResourceType", { sva: 1, V6: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Fm() { + this.ea = this.k = null; + } + Fm.prototype = new u7(); + Fm.prototype.constructor = Fm; + d7 = Fm.prototype; + d7.PQ = function(a10) { + return r$a2(this, a10); + }; + d7.sI = function(a10) { + return this.AM(a10); + }; + d7.H = function() { + return "Response"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Fm.prototype.Dla.call(this, new Em().K(new S6().a(), a10)); + return this; + }; + d7.Dla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.tI = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = s8(); + a10 = uk(tk(c10, a10, e10)); + c10 = Dm().Tf; + Zd(b10, c10, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.RQ = function(a10) { + return C$a(this, a10); + }; + d7.tq = function() { + return I$a2(this); + }; + function Qub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Em().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return SWa(W8(), a10); + } + d7.Yd = function() { + return l$a2(this); + }; + d7.JC = function() { + return q$a(this); + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Fm) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.AM = function(a10) { + Z10(); + a10 = this.k.lI(a10); + return I0(s8(), a10); + }; + d7.zI = function() { + return y$a2(this); + }; + d7.DC = function(a10) { + return F$a(this, a10); + }; + d7.c4 = function(a10) { + return w$a2(this, a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.GC = function() { + return v$a2(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.IC = function() { + return m$a2(this); + }; + d7.sq = function(a10) { + return G$a(this, a10); + }; + d7.qI = function(a10) { + return t$a2(this, a10); + }; + d7.Kf = function() { + return Qub(this); + }; + d7.yK = function() { + var a10 = Z10(), b10 = B6(this.k.g, Dm().Tf), c10 = s8(); + return Ak(a10, b10, c10).Ra(); + }; + d7.yy = function() { + return this.yK(); + }; + d7.Gj = function() { + return Qub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.WQ = function() { + return H$a(this); + }; + d7.rb = function() { + return So(this); + }; + d7.BM = function(a10) { + Z10(); + var b10 = this.k; + a10 = new z7().d(a10); + b10 = jQ(b10, a10); + return L0(O52(), b10); + }; + d7.Hh = function(a10) { + return D$a(this, a10); + }; + d7.s4 = function(a10) { + return A$a2(this, a10); + }; + d7.$Q = function() { + return x$a2(this); + }; + d7.uI = function(a10) { + return this.BM(a10); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.sh = function() { + return z$a(this); + }; + d7.z = function() { + return X5(this); + }; + d7.AI = function() { + return E$a2(this); + }; + d7.BC = function(a10) { + return o$a2(this, a10); + }; + d7.Td = function(a10) { + return B$a2(this, a10); + }; + d7.xI = function(a10) { + return i$a2(this, a10); + }; + d7.bR = function() { + return u$a2(this); + }; + d7.pI = function() { + return K$a(this); + }; + d7.vI = function(a10) { + return J$a(this, a10); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Fm.prototype.annotations = function() { + return this.rb(); + }; + Fm.prototype.graph = function() { + return jU(this); + }; + Fm.prototype.withId = function(a10) { + return this.$b(a10); + }; + Fm.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Fm.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Fm.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Fm.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Fm.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Fm.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Fm.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Fm.prototype.withPayload = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + switch (c10.length | 0) { + case 1: + if (sp(c10[0])) + return a10 = c10[0], this.uI(a10); + a10 = c10[0]; + return this.s4(a10); + case 0: + return n$a2(this); + default: + throw "No matching overload"; + } + }; + Fm.prototype.withBindings = function(a10) { + return this.BC(a10); + }; + Fm.prototype.withSummary = function(a10) { + return this.xI(a10); + }; + Fm.prototype.withTitle = function(a10) { + return this.RQ(a10); + }; + Fm.prototype.withDisplayName = function(a10) { + return this.sq(a10); + }; + Fm.prototype.withCorrelationId = function(a10) { + return this.c4(a10); + }; + Fm.prototype.withPayloads = function(a10) { + return this.vI(a10); + }; + Fm.prototype.withExamples = function(a10) { + return this.DC(a10); + }; + Fm.prototype.withTags = function(a10) { + return this.PQ(a10); + }; + Fm.prototype.withDocumentation = function(a10) { + return this.qI(a10); + }; + Fm.prototype.withAbstract = function(a10) { + return this.pI(!!a10); + }; + Fm.prototype.withDescription = function(a10) { + return this.Hh(a10); + }; + Fm.prototype.withName = function(a10) { + return this.Td(a10); + }; + Object.defineProperty(Fm.prototype, "bindings", { get: function() { + return this.GC(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "summary", { get: function() { + return this.AI(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "title", { get: function() { + return this.bR(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "displayName", { get: function() { + return this.tq(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "correlationId", { get: function() { + return j$a2(this); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "payloads", { get: function() { + return this.zI(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "examples", { get: function() { + return this.JC(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "tags", { get: function() { + return this.$Q(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "documentation", { get: function() { + return this.IC(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "isAbstract", { get: function() { + return this.WQ(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "description", { get: function() { + return this.sh(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "name", { get: function() { + return this.Yd(); + }, configurable: true }); + Fm.prototype.linkCopy = function() { + return this.Kf(); + }; + Fm.prototype.withHeader = function(a10) { + return this.sI(a10); + }; + Fm.prototype.withLinks = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Rub(); + a10 = uk(tk(c10, a10, e10)); + c10 = Dm().nN; + Zd(b10, c10, a10); + return this; + }; + Fm.prototype.withHeaders = function(a10) { + return this.tI(a10); + }; + Fm.prototype.withStatusCode = function(a10) { + var b10 = this.k, c10 = Dm().In; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(Fm.prototype, "links", { get: function() { + var a10 = Z10(), b10 = B6(this.k.g, Dm().nN), c10 = Rub(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + Object.defineProperty(Fm.prototype, "statusCode", { get: function() { + Z10(); + var a10 = B6(this.k.g, Dm().In); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Fm.prototype.$classData = r8({ tva: 0 }, false, "amf.client.model.domain.Response", { tva: 1, f: 1, Qua: 1, ak: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, y: 1, v: 1, q: 1, o: 1 }); + function Um() { + V6.call(this); + } + Um.prototype = new Bgb(); + Um.prototype.constructor = Um; + d7 = Um.prototype; + d7.H = function() { + return "Trait"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Um.prototype.m1.call(this, new Tm().K(b10, a10)); + return this; + }; + d7.zg = function() { + return this.ZU(); + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Um) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.k; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + function Sub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Tm().K(c10, b10); + a10 = Rd(b10, a10.j); + Z10(); + null === Z10().h8 && null === Z10().h8 && (Z10().h8 = new y1()); + Z10(); + return new Um().m1(a10); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.ZU = function() { + var a10 = Z10(), b10 = Za(this.k), c10 = Z10().jr(); + return bb(a10, b10, c10).Ra(); + }; + d7.m1 = function(a10) { + V6.prototype.$$.call(this, a10); + return this; + }; + d7.Kf = function() { + return Sub(this); + }; + d7.Gj = function() { + return Sub(this); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.K1 = function() { + return Sub(this); + }; + Um.prototype.asOperation = function(a10) { + for (var b10 = arguments.length | 0, c10 = 1, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + b10 = void 0 === e10[0] ? ok2() : e10[0]; + return new Sl().oU(Rlb(this.k, a10.Be(), b10)); + }; + Um.prototype.$classData = r8({ Eva: 0 }, false, "amf.client.model.domain.Trait", { Eva: 1, V6: 1, f: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Co() { + this.ea = this.k = null; + } + Co.prototype = new u7(); + Co.prototype.constructor = Co; + d7 = Co.prototype; + d7.H = function() { + return "WebSocketsChannelBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Co.prototype.Wla.call(this, new Bo().K(b10, a10)); + return this; + }; + d7.Xca = function() { + Z10(); + var a10 = B6(this.k.g, Ao().nD); + return t1(Z10().Bg(), a10); + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Co ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.y4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = Ao().nD; + Vd(b10, c10, a10); + return this; + }; + d7.rq = function(a10) { + var b10 = this.k, c10 = Ao().Lh; + eb(b10, c10, a10); + return this; + }; + d7.FQ = function(a10) { + var b10 = this.k, c10 = Ao().pm; + eb(b10, c10, a10); + return this; + }; + function Tub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Bo().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().o_ && null === Z10().o_) { + c10 = Z10(); + var e10 = new G1(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.o_ = e10; + } + b10 = Z10().o_; + return xu(b10.l.ea, a10); + } + d7.Kf = function() { + return Tub(this); + }; + d7.yy = function() { + return this.I$(); + }; + d7.Gj = function() { + return Tub(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.iV = function() { + Z10(); + var a10 = B6(this.k.g, Ao().pm); + Z10().cb(); + return gb(a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.I$ = function() { + Z10(); + var a10 = B6(this.k.g, Ao().Tf); + return t1(Z10().Bg(), a10); + }; + d7.l4 = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = Ao().Tf; + Vd(b10, c10, a10); + return this; + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Co.prototype.annotations = function() { + return this.rb(); + }; + Co.prototype.graph = function() { + return jU(this); + }; + Co.prototype.withId = function(a10) { + return this.$b(a10); + }; + Co.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Co.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Co.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Co.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Co.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Co.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Co.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Co.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Co.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Co.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Co.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Co.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Co.prototype.linkCopy = function() { + return this.Kf(); + }; + Co.prototype.withHeaders = function(a10) { + return this.l4(a10); + }; + Co.prototype.withQuery = function(a10) { + return this.y4(a10); + }; + Co.prototype.withMethod = function(a10) { + return this.FQ(a10); + }; + Object.defineProperty(Co.prototype, "headers", { get: function() { + return this.yy(); + }, configurable: true }); + Object.defineProperty(Co.prototype, "query", { get: function() { + return this.Xca(); + }, configurable: true }); + Object.defineProperty(Co.prototype, "method", { get: function() { + return this.iV(); + }, configurable: true }); + Co.prototype.withBindingVersion = function(a10) { + return this.rq(a10); + }; + Co.prototype.$classData = r8({ Kva: 0 }, false, "amf.client.model.domain.WebSocketsChannelBinding", { Kva: 1, f: 1, W6: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, aD: 1, y: 1, v: 1, q: 1, o: 1 }); + function mf() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + mf.prototype = new u7(); + mf.prototype.constructor = mf; + function Uub() { + } + d7 = Uub.prototype = mf.prototype; + d7.H = function() { + return "Document"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof mf ? this.Y() === a10.Y() ? this.fa() === a10.fa() : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Y(); + case 1: + return this.fa(); + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Gk(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.Y(), Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return ar(this.Y(), Gk().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.Y(), Gk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ Z6: 0 }, false, "amf.core.model.document.Document", { Z6: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, TA: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mk() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + Mk.prototype = new u7(); + Mk.prototype.constructor = Mk; + d7 = Mk.prototype; + d7.H = function() { + return "ExternalFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Mk ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return bea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ wza: 0 }, false, "amf.core.model.document.ExternalFragment", { wza: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function tl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + tl.prototype = new u7(); + tl.prototype.constructor = tl; + d7 = tl.prototype; + d7.H = function() { + return "PayloadFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof tl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return sl(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + function Qoa(a10, b10) { + var c10 = sl().Nd; + eb(a10, c10, b10); + return a10; + } + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, sl().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ Cza: 0 }, false, "amf.core.model.document.PayloadFragment", { Cza: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function u22() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + u22.prototype = new u7(); + u22.prototype.constructor = u22; + d7 = u22.prototype; + d7.H = function() { + return "RecursiveUnit"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof u22 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Jk(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ Eza: 0 }, false, "amf.core.model.document.RecursiveUnit", { Eza: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vk() { + rf.call(this); + this.Xa = this.aa = null; + } + Vk.prototype = new jhb(); + Vk.prototype.constructor = Vk; + d7 = Vk.prototype; + d7.H = function() { + return "PropertyShape"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10, b10) { + return r5a(this, a10, b10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Vk ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + function r5a(a10, b10, c10) { + Ai(a10, b10); + if (Vb().Ia(B6(a10.aa, Qi().Vf)).na()) { + b10 = B6(a10.aa, Qi().Vf); + var e10 = a10.j, f10 = a10.j, g10 = K7(); + b10.ub(e10, c10.yg(f10, g10.u)); + } + return a10; + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Vk().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Qi(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.Xa; + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-property" : a10.c(); + a10 = new je4().e(a10); + return "/property/" + jj(a10.td); + }; + d7.VN = function(a10, b10, c10) { + return gIa(this, a10, b10, c10); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Vk().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.z = function() { + return X5(this); + }; + function gIa(a10, b10, c10, e10) { + var f10 = Yi(O7(), a10.Xa); + f10 = new Vk().K(new S6().a(), f10); + f10.j = a10.j; + Tca(a10, b10, f10, c10, e10); + return f10; + } + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + rf.prototype.a.call(this); + return this; + }; + d7.$classData = r8({ fAa: 0 }, false, "amf.core.model.domain.extensions.PropertyShape", { fAa: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, y: 1, v: 1, q: 1, o: 1 }); + function BO() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + BO.prototype = new u7(); + BO.prototype.constructor = BO; + d7 = BO.prototype; + d7.H = function() { + return "DialectFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof BO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Bhb(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, Gc().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return B6(this.g, Gc().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ GGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectFragment", { GGa: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, fJ: 1, y: 1, v: 1, q: 1, o: 1 }); + function ad() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + ad.prototype = new u7(); + ad.prototype.constructor = ad; + d7 = ad.prototype; + d7.H = function() { + return "Vocabulary"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ad ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return bd(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, bd().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return B6(this.g, bd().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ NGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.Vocabulary", { NGa: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, TA: 1, fJ: 1, y: 1, v: 1, q: 1, o: 1 }); + function k9() { + b9.call(this); + this.Qh = this.Jna = this.qQ = null; + this.Xma = false; + } + k9.prototype = new cub(); + k9.prototype.constructor = k9; + function Vub() { + } + d7 = Vub.prototype = k9.prototype; + d7.K$ = function(a10, b10) { + return 0 <= (b10.length | 0) && "x-" === b10.substring(0, 2) || "$ref" === b10 || 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) && ("webApi" === a10 || "paths" === a10); + }; + d7.$U = function() { + return this.Xma; + }; + d7.hp = function(a10) { + var b10 = qc(); + b10 = Iw(a10, b10); + if (b10 instanceof ye4) { + b10 = ac(new M6().W(b10.i), "$ref"); + if (b10.b()) + b10 = y7(); + else { + b10 = b10.c().i; + var c10 = IO(); + b10 = b10.Qp(c10).pk(); + } + b10.b() ? b10 = y7() : (b10 = b10.c(), b10 = new z7().d(b10.va)); + if (b10 instanceof z7) + return a10 = b10.i, ue4(), new ve4().d(a10); + if (y7() === b10) + return ue4(), new ye4().d(a10); + throw new x7().d(b10); + } + ue4(); + return new ye4().d(a10); + }; + d7.Jaa = function(a10, b10, c10, e10, f10, g10) { + var h10 = J5(E0a(), H10()); + this.qQ = c10; + this.Jna = h10; + b9.prototype.Wx.call(this, a10, b10, c10, e10, f10, g10); + e10.b() ? (a10 = this.Df, b10 = w6(/* @__PURE__ */ function() { + return function(k10) { + if (k10.Jd instanceof Mk) { + var l10 = ar(k10.Jd.g, Jk().nb).$g; + l10.b() ? k10 = y7() : (l10 = l10.c(), k10 = new z7().d(new R6().M(k10.$n.Of, l10))); + return k10.ua(); + } + return y7().ua(); + }; + }(this)), e10 = K7(), a10 = Ana(new kA(), a10.bd(b10, e10.u).Ch(Gb().si), y7(), new z7().d(this), this.ni)) : a10 = e10.c(); + this.Qh = a10; + this.Xma = !(c10 instanceof l9); + }; + d7.Dl = function() { + return this.Qh; + }; + function ol() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + ol.prototype = new u7(); + ol.prototype.constructor = ol; + d7 = ol.prototype; + d7.H = function() { + return "AnnotationTypeDeclarationFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ol ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return jea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ jKa: 0 }, false, "amf.plugins.document.webapi.model.AnnotationTypeDeclarationFragment", { jKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function ql() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + ql.prototype = new u7(); + ql.prototype.constructor = ql; + d7 = ql.prototype; + d7.H = function() { + return "DataTypeFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ql ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return kea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ kKa: 0 }, false, "amf.plugins.document.webapi.model.DataTypeFragment", { kKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function vl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + vl.prototype = new u7(); + vl.prototype.constructor = vl; + d7 = vl.prototype; + d7.H = function() { + return "DocumentationItemFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof vl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return lea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ lKa: 0 }, false, "amf.plugins.document.webapi.model.DocumentationItemFragment", { lKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function xl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + xl.prototype = new u7(); + xl.prototype.constructor = xl; + d7 = xl.prototype; + d7.H = function() { + return "NamedExampleFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof xl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return mea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ nKa: 0 }, false, "amf.plugins.document.webapi.model.NamedExampleFragment", { nKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function zl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + zl.prototype = new u7(); + zl.prototype.constructor = zl; + d7 = zl.prototype; + d7.H = function() { + return "ResourceTypeFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return nea(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ pKa: 0 }, false, "amf.plugins.document.webapi.model.ResourceTypeFragment", { pKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function Bl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + Bl.prototype = new u7(); + Bl.prototype.constructor = Bl; + d7 = Bl.prototype; + d7.H = function() { + return "SecuritySchemeFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Bl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return oea(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ qKa: 0 }, false, "amf.plugins.document.webapi.model.SecuritySchemeFragment", { qKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function Dl() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + Dl.prototype = new u7(); + Dl.prototype.constructor = Dl; + d7 = Dl.prototype; + d7.H = function() { + return "TraitFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Dl ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return pea(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return ar(this.g, Gk().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return ar(this.g, Jk().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ rKa: 0 }, false, "amf.plugins.document.webapi.model.TraitFragment", { rKa: 1, f: 1, UA: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function s6a() { + bm.call(this); + this.ys = null; + } + s6a.prototype = new Dtb(); + s6a.prototype.constructor = s6a; + d7 = s6a.prototype; + d7.sH = function() { + return this.ys; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.Tq = function(a10, b10) { + bm.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorCallback/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.$classData = r8({ qLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorCallback", { qLa: 1, Eha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, y: 1, v: 1, q: 1, o: 1, JF: 1 }); + function N32() { + GP.call(this); + this.Wf = this.i = this.Aa = null; + this.ky = false; + this.KJ = this.G0 = this.ra = null; + } + N32.prototype = new N22(); + N32.prototype.constructor = N32; + d7 = N32.prototype; + d7.H = function() { + return "RamlJsonSchemaExpression"; + }; + d7.E = function() { + return 4; + }; + function o4a(a10, b10, c10) { + if (c10 instanceof uG) { + var e10 = c10.cca.gb, f10 = Q5().wq; + if (e10 === f10) { + e10 = c10.DV.va; + e10 = Mc(ua(), e10, "#"); + e10 = zj(new Pc().fd(e10)); + e10 = b10.Df.Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = Lc(k10.Jd); + if (k10.b()) + return false; + k10 = k10.c(); + return Ed(ua(), k10, h10); + }; + }(a10, e10))); + if (e10 instanceof z7) + return f10 = e10.i, uz(), c10 = Lc(f10.Jd).c(), e10 = f10.Jd.Ve(), a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Hq(new Iq(), k10, new v22().vi(Lc(h10.Jd).c(), H10()), y7()); + }; + }(a10, f10)), f10 = K7(), Bna(c10, e10.ka(a10, f10.u), b10); + a10 = Vb(); + e10 = c10.re(); + if (a10.Ia(e10.da.Rf).na()) + return uz(), a10 = c10.re(), Bna(a10.da.Rf, b10.Df, b10); + } + } + return yna( + uz(), + b10 + ); + } + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof N32) { + if (Bj(this.Aa, a10.Aa) && Bj(this.i, a10.i)) { + var b10 = this.Wf, c10 = a10.Wf; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.ky === a10.ky : false; + } + return false; + }; + d7.ZK = function(a10, b10, c10, e10, f10) { + this.Aa = a10; + this.i = b10; + this.Wf = c10; + this.ky = e10; + this.ra = f10; + GP.prototype.ss.call(this, f10); + this.G0 = "JSON"; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Aa; + case 1: + return this.i; + case 2: + return this.Wf; + case 3: + return this.ky; + default: + throw new U6().e("" + a10); + } + }; + function Wub(a10, b10, c10, e10, f10, g10, h10) { + var k10 = a10.ra.pe().ij; + h10.b() ? k10 = y7() : (h10 = h10.c(), k10 = k10.Ja(h10)); + k10 = k10.b() ? y7() : k10.c().da; + if (k10.na()) + b10 = QG(TG(), b10, k10.c(), vF().dl, a10.ra); + else { + TG(); + k10 = e10.re().da.Rf; + h10 = vF(); + var l10 = e10.da; + l10 = de4(ee4(), l10.rf, l10.If, l10.Yf, l10.bg).rf; + var m10 = e10.da; + b10 = QG(0, b10, k10, uF(h10, l10, de4(ee4(), m10.rf, m10.If, m10.Yf, m10.bg).If, (vF(), 0)), a10.ra); + } + c10 = pG(wD(), c10, Cj(b10).Fd); + oYa(a10.ra, c10.i); + b10 = o4a(a10, a10.ra, e10); + e10 = Pjb(b10, b10.qh, ""); + k10 = aSa(Rna(), e10, c10); + O7(); + h10 = new P6().a(); + k10 = Sd(k10, e10, h10).pc(e10); + h10 = db().oe; + k10 = Bi(k10, h10, true); + lB(k10, e10, c10, b10); + Jb(k10, b10); + f10.P(k10); + A8(a10.ra, e10, k10); + c10 = nX(pX(), c10, w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + t10.P(v10); + }; + }(a10, f10)), mYa(a10.ra, c10.i), b10).Cc(); + if (c10 instanceof z7) + g10 = c10.i, Eb(a10.ra.ni, e10, g10), Xub(k10, g10), A8(a10.ra, e10, g10), g10 = Za(g10).na() ? g10.gj(Wca()) : g10; + else { + if (y7() !== c10) + throw new x7().d(c10); + O7(); + e10 = new P6().a(); + e10 = new Gh().K(new S6().a(), e10); + f10.P(e10); + f10 = a10.ra; + c10 = sg().vN; + b10 = e10.j; + k10 = y7(); + ec(f10, c10, b10, k10, "Cannot parse JSON Schema", g10.da); + g10 = e10; + } + a10.ra.Ip.U(w6(/* @__PURE__ */ function(p10) { + return function(t10) { + var v10 = t10.ma(); + v10 = Mc(ua(), v10, "#"); + v10 = Wt(new Pc().fd(v10)); + v10 = v10.b() ? "" : v10.c(); + var A10 = p10.ra.mH.c(); + if (v10 === A10.da.Rf) + return p10.ra.Ip.rt(t10.ma()); + }; + }(a10))); + a10.ra.mH = y7(); + return g10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Zna = function(a10) { + var b10 = a10.JL; + if (b10 instanceof z7) { + b10 = b10.i; + var c10 = Hha(Lha(), b10); + if (null === c10) + throw new x7().d(c10); + b10 = c10.ma(); + c10 = c10.ya(); + if (c10.b()) + var e10 = y7(); + else + e10 = c10.c(), e10 = new qg().e(e10), e10 = Wp(e10, "/definitions/"), e10 = new qg().e(e10), e10 = new z7().d(Wp(e10, "definitions/")); + if (e10.b()) + var f10 = y7(); + else + f10 = e10.c(), f10 = FOa(this.ra.pe(), b10, f10); + f10 = f10.b() ? this.ra.pe().os.Ja(b10) : f10; + if (f10 instanceof z7) + a10 = f10.i, e10 = rf.prototype.pG.call(a10), a10 = Rd(e10, a10.j), e10 = this.Aa, f10 = Dd(), e10 = N6(e10, f10, this.ra), O7(), f10 = new P6().a(), a10 = Sd(a10, e10, f10), b10 = this.ra.pe().ij.Ja(b10), b10.b() || (b10 = "" + b10.c().ww.j + (c10.b() ? "" : c10.c()), c10 = Zf().xj, eb(a10, c10, b10)), B6(a10.Y(), Ag().Ec).Da() && (a10.j = null, this.Wf.P(a10), Dha(a10.Y(), ic(Ag().Ec.r))), b10 = a10; + else if (e10.na()) { + f10 = a10.Id; + var g10 = a10.Ou, h10 = new n4a(); + h10.m = this.ra; + h10.Id = f10; + h10.Ou = g10; + h10.ah = b10; + if (null === this) + throw mb(E6(), null); + h10.l = this; + h10.hd(); + e10 = FOa(this.ra.pe(), b10, e10.c()); + if (e10 instanceof z7) + a10 = e10.i, e10 = rf.prototype.pG.call(a10), a10 = Rd(e10, a10.j), e10 = this.Aa, f10 = Dd(), e10 = N6(e10, f10, this.ra), O7(), f10 = new P6().a(), a10 = Sd(a10, e10, f10); + else { + O7(); + e10 = new P6().a(); + f10 = new S6().a(); + e10 = new vh().K(f10, e10); + this.Wf.P(e10); + f10 = this.ra; + g10 = sg().x6; + h10 = e10.j; + var k10 = "could not find json schema fragment " + c10.c() + " in file " + b10; + a10 = a10.Ou; + var l10 = y7(); + ec(f10, g10, h10, l10, k10, a10.da); + a10 = e10; + } + b10 = this.ra.pe().ij.Ja(b10); + b10.b() || (b10 = "" + b10.c().ww.j + c10.c(), e10 = Zf().xj, eb(a10, e10, b10)); + a10.fa().Lb(new P1().e(c10.c())); + b10 = a10; + } else + c10 = Wub(this, a10.Id, this.Aa, a10.Ou, this.Wf, this.i, a10.JL), e10 = this.ra.pe().ij.Ja(b10), e10.b() || (e10 = e10.c().ww.j, f10 = Zf().xj, eb(c10, f10, e10)), e10 = this.ra.pe(), e10.os = e10.os.cc(new R6().M(b10, c10)), c10.fa().Lb(new Mf().e(a10.Id.trim())), b10 = c10; + } else { + if (y7() !== b10) + throw new x7().d(b10); + b10 = Wub(this, a10.Id, this.Aa, a10.Ou, this.Wf, this.i, y7()); + b10.fa().Lb(new Mf().e(a10.Id)); + } + this.ky ? (c10 = this.i.hb().gb, a10 = Q5().sa, c10 = c10 === a10) : c10 = false; + c10 && (c10 = this.i, a10 = qc(), c10 = N6(c10, a10, this.ra), a10 = new M6().W(c10), e10 = qf().Zc, Gg(a10, "displayName", nh(Hg(Ig(this, e10, this.ra), b10))), a10 = new M6().W(c10), e10 = qf().Va, Gg(a10, "description", nh(Hg(Ig(this, e10, this.ra), b10))), c10 = ac(new M6().W(c10), "default"), c10.b() || (c10 = c10.c(), a10 = Ey(Fy(c10.i, b10.j, false, false, false, this.ra)), Mca(b10, c10), a10 = a10.Cl, a10.b() || (a10 = a10.c(), e10 = qf().Mh, c10 = Od(O7(), c10), Rg(b10, e10, a10, c10))), c10 = this.i, a10 = qc(), c10 = N6(c10, a10, this.ra), a10 = GYa(), dca(this, b10, c10, a10, this.ra)); + b10.fa().Lb(new a62().a()); + return b10; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Aa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.i)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Wf)); + a10 = OJ().Ga(a10, this.ky ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.Gp = function() { + return this.ra; + }; + d7.s8 = function() { + null === this.KJ && null === this.KJ && (this.KJ = k4a(this)); + }; + d7.$classData = r8({ kPa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlJsonSchemaExpression", { kPa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, aPa: 1, eD: 1, lr: 1, y: 1, v: 1, q: 1, o: 1 }); + function M32() { + GP.call(this); + this.Wf = this.i = this.Aa = null; + this.ky = false; + this.KJ = this.G0 = this.ra = null; + } + M32.prototype = new N22(); + M32.prototype.constructor = M32; + d7 = M32.prototype; + d7.H = function() { + return "RamlXmlSchemaExpression"; + }; + d7.E = function() { + return 4; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof M32) { + if (Bj(this.Aa, a10.Aa) && Bj(this.i, a10.i)) { + var b10 = this.Wf, c10 = a10.Wf; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + return b10 ? this.ky === a10.ky : false; + } + return false; + }; + d7.ZK = function(a10, b10, c10, e10, f10) { + this.Aa = a10; + this.i = b10; + this.Wf = c10; + this.ky = e10; + this.ra = f10; + GP.prototype.ss.call(this, f10); + this.G0 = "XML"; + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Aa; + case 1: + return this.i; + case 2: + return this.Wf; + case 3: + return this.ky; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Zna = function(a10) { + a10 = a10.JL; + if (a10.b()) + var b10 = y7(); + else + a10 = a10.c(), b10 = new z7().d(Hha(Lha(), a10)); + a: { + if (b10 instanceof z7 && (a10 = b10.i, null !== a10)) { + b10 = a10.ma(); + a10 = a10.ya(); + b10 = this.ra.pe().ij.Ja(b10); + if (b10.b()) + var c10 = y7(); + else { + c10 = b10.c().ww.j; + if (a10.b()) + var e10 = y7(); + else + e10 = a10.c(), e10 = new z7().d(0 <= (e10.length | 0) && "/" === e10.substring(0, 1) ? e10 : "/" + e10); + c10 = new z7().d("" + c10 + (e10.b() ? "" : e10.c())); + } + e10 = b10.b() ? y7() : b10.c().da; + b10 = c10; + var f10 = a10; + break a; + } + if (y7() === b10) + b10 = y7(), c10 = y7(), a10 = y7(), e10 = c10, f10 = a10; + else + throw new x7().d(b10); + } + c10 = b10; + a10 = e10; + b10 = f10; + e10 = this.i.hb().gb; + if (Q5().sa === e10) { + e10 = this.i; + f10 = qc(); + e10 = N6(e10, f10, this.ra); + f10 = this.Eba(e10); + a: { + if (f10 instanceof z7) { + var g10 = f10.i; + if (null !== g10 && jc(kc(g10.i), bc()).na()) { + O7(); + f10 = new P6().a(); + f10 = new Gh().K(new S6().a(), f10); + g10 = g10.i; + var h10 = bc(); + g10 = N6(g10, h10, this.ra).va; + h10 = pn().Rd; + f10 = eb(f10, h10, g10); + g10 = pn().Nd; + f10 = eb(f10, g10, "application/xml"); + g10 = this.Aa; + h10 = Dd(); + g10 = N6(g10, h10, this.ra); + O7(); + h10 = new P6().a(); + Sd(f10, g10, h10); + this.Wf.P(f10); + break a; + } + } + O7(); + f10 = new P6().a(); + f10 = new Gh().K(new S6().a(), f10); + this.Wf.P(f10); + g10 = this.ra; + h10 = sg().tY; + var k10 = f10.j, l10 = this.i, m10 = y7(); + ec(g10, h10, k10, m10, "Cannot parse XML Schema expression out of a non string value", l10.da); + } + g10 = new M6().W(e10); + h10 = qf().Zc; + Gg(g10, "displayName", nh(Hg(Ig(this, h10, this.ra), f10))); + g10 = new M6().W(e10); + h10 = qf().Va; + Gg(g10, "description", nh(Hg(Ig(this, h10, this.ra), f10))); + e10 = ac(new M6().W(e10), "default"); + e10.b() || (e10 = e10.c(), g10 = Ey(Fy(e10.i, f10.j, false, false, false, this.ra)), Mca(f10, e10), g10 = g10.Cl, g10.b() || (g10 = g10.c(), h10 = qf().Mh, e10 = Od(O7(), e10), Rg(f10, h10, g10, e10))); + e10 = this.i; + g10 = qc(); + e10 = N6(e10, g10, this.ra); + g10 = GYa(); + dca(this, f10, e10, g10, this.ra); + e10 = f10; + } else + Q5().cd === e10 ? (O7(), e10 = new P6().a(), e10 = new Gh().K(new S6().a(), e10), this.Wf.P(e10), f10 = this.ra, g10 = sg().tY, h10 = e10.j, k10 = this.i, l10 = y7(), ec( + f10, + g10, + h10, + l10, + "Cannot parse XML Schema expression out of a non string value", + k10.da + )) : (e10 = this.i, f10 = bc(), e10 = N6(e10, f10, this.ra).va, O7(), f10 = new P6().a(), f10 = new Gh().K(new S6().a(), f10), g10 = pn().Rd, e10 = eb(f10, g10, e10), f10 = pn().Nd, e10 = eb(e10, f10, "application/xml"), f10 = this.Aa, g10 = Dd(), f10 = N6(f10, g10, this.ra), O7(), g10 = new P6().a(), Sd(e10, f10, g10), this.Wf.P(e10)); + c10 instanceof z7 ? (c10 = c10.i, f10 = Zf().xj, eb(e10, f10, c10)) : (c10 = e10.Xa, ae4(), f10 = this.i.da, c10.Lb(new be4().jj(ce4(0, de4(ee4(), f10.rf, f10.If, f10.Yf, f10.bg))))); + c10 = pn().uc; + a10 = a10.b() ? this.ra.qh : a10.c(); + eb(e10, c10, a10); + b10.b() || (a10 = b10.c(), e10.Xa.Lb(new P1().e(a10))); + return e10; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.Aa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.i)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Wf)); + a10 = OJ().Ga(a10, this.ky ? 1231 : 1237); + return OJ().fe(a10, 4); + }; + d7.Gp = function() { + return this.ra; + }; + d7.s8 = function() { + null === this.KJ && null === this.KJ && (this.KJ = k4a(this)); + }; + d7.$classData = r8({ sQa: 0 }, false, "amf.plugins.document.webapi.parser.spec.declaration.RamlXmlSchemaExpression", { sQa: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, aPa: 1, eD: 1, lr: 1, y: 1, v: 1, q: 1, o: 1 }); + function ocb() { + m62.call(this); + this.Je = this.lk = null; + } + ocb.prototype = new peb(); + ocb.prototype.constructor = ocb; + d7 = ocb.prototype; + d7.H = function() { + return "RamlModuleParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ocb) { + var b10 = this.lk; + a10 = a10.lk; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.lk; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Nb = function() { + return this.Je; + }; + d7.rca = function() { + var a10 = Od(O7(), this.lk.$g.Xd); + a10 = new bg().K(new S6().a(), a10); + var b10 = this.lk.da, c10 = Bq().uc; + a10 = eb(a10, c10, b10); + b10 = this.lk.da; + J5(K7(), H10()); + a10 = Ai(a10, b10); + b10 = Y1(new Z1(), this.Je.Gg()); + a10 = Cb(a10, b10); + b10 = this.lk.da; + c10 = Bq().uc; + eb(a10, c10, b10); + b10 = jc(kc(this.lk.$g.Xd), qc()); + if (!b10.b()) { + c10 = b10.c(); + Zz(this.Je, a10.j, c10, "module"); + b10 = pz(qz(a10, "uses", c10, this.lk.Q, this.Je), this.lk.da); + this.rA(this.lk, c10); + n7a(this, c10, a10).hd(); + c10 = this.Je.pe().et(); + if (c10.Da()) { + var e10 = Af().Ic; + Bf(a10, e10, c10); + } + tc(b10.Q) && (b10 = O4a(b10), c10 = Gk().xc, Bf(a10, c10, b10)); + } + Fb(this.Je.ni); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.Je; + }; + d7.$D = function(a10, b10) { + this.lk = a10; + this.Je = b10; + m62.prototype.ss.call(this, b10); + return this; + }; + d7.zH = function(a10, b10) { + Aca(this, a10, b10); + }; + d7.$classData = r8({ aWa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.RamlModuleParser", { aWa: 1, n7: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, lr: 1, vha: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ql() { + this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Ql.prototype = new u7(); + Ql.prototype.constructor = Ql; + function AD(a10) { + a10 = B6(a10.g, Pl().dB).kc(); + return a10.b() ? null : a10.c(); + } + d7 = Ql.prototype; + d7.H = function() { + return "Operation"; + }; + d7.CM = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Zl().K(new S6().a(), b10); + var c10 = Yl().Pf; + a10 = eb(b10, c10, a10); + b10 = Pl().lh; + ig(this, b10, a10); + return a10; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.hda = function() { + it2(this.g, Pl().lh); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Ql ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Ql().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Pl(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.x; + }; + d7.mI = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new tm().K(new S6().a(), b10); + var c10 = rm2().R; + a10 = eb(b10, c10, a10); + b10 = Pl().dc; + ig(this, b10, a10); + return a10; + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, Pl().pm).A; + a10 = a10.b() ? "default-operation" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.ifa = function(a10) { + var b10 = Pl().lh; + return Zd(this, b10, a10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + function ona(a10, b10) { + var c10 = Pl().dB; + b10 = J5(K7(), new Ib().ha([b10])); + Zd(a10, c10, b10); + } + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Ql().K(a10, b10); + }; + }(this)); + }; + d7.t3 = function() { + var a10 = B6(this.g, nc().Ni()), b10 = new Ffb().oU(this), c10 = K7(); + return a10.ec(b10, c10.u); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + function xIa(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Bm().K(new S6().a(), b10); + var c10 = Pl().dB, e10 = J5(K7(), new Ib().ha([b10])); + Zd(a10, c10, e10); + return b10; + } + d7.gfa = function(a10) { + O7(); + var b10 = new P6().a(); + b10 = new Em().K(new S6().a(), b10); + O7(); + var c10 = new P6().a(); + b10 = Sd(b10, a10, c10); + a10 = "default" === a10 ? "200" : a10; + c10 = Dm().In; + a10 = eb(b10, c10, a10); + b10 = Pl().Al; + ig(this, b10, a10); + return a10; + }; + d7.Zg = function() { + return Pl().R; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + return this; + }; + d7.uW = function() { + return B6(this.g, Pl().lh); + }; + d7.$classData = r8({ y0a: 0 }, false, "amf.plugins.domain.webapi.models.Operation", { y0a: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, Gha: 1, t7: 1, rg: 1, y: 1, v: 1, q: 1, o: 1 }); + function m9() { + Fk.call(this); + this.xp = null; + } + m9.prototype = new Xsb(); + m9.prototype.constructor = m9; + d7 = m9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + m9.prototype.RG.call(this, new bg().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.xp; + }; + d7.Be = function() { + return this.xp; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.hR = function() { + return this.xp; + }; + d7.Wr = function() { + return this.xp; + }; + d7.RG = function(a10) { + this.xp = a10; + Fk.prototype.RG.call(this, a10); + return this; + }; + d7.oc = function() { + return this.xp; + }; + m9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(m9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + m9.prototype.$classData = r8({ G6a: 0 }, false, "webapi.WebApiModule", { G6a: 1, oga: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function n9(a10) { + var b10 = new Xj().ue(a10.jb()); + a10 = a10.Hd(); + Gda(b10, a10); + return b10; + } + function mn() { + Xm.call(this); + } + mn.prototype = new T7(); + mn.prototype.constructor = mn; + d7 = mn.prototype; + d7.H = function() { + return "FileShape"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + mn.prototype.raa.call(this, new Wh().K(new S6().a(), a10)); + return this; + }; + d7.k4 = function(a10) { + var b10 = this.k, c10 = Fg().Fn; + eb(b10, c10, a10); + return this; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.uba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().Aq); + Z10().Pt(); + return CL(a10); + }; + d7.JQ = function(a10) { + var b10 = this.k, c10 = Fg().zl; + eb(b10, c10, a10); + return this; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.k$ = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().xx); + Z10().yi(); + return yL(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Bba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().av); + Z10().XC(); + return AL(a10); + }; + d7.NV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().zl); + Z10().cb(); + return gb(a10); + }; + d7.Jh = function() { + return this.k; + }; + d7.Kf = function() { + return Yub(this); + }; + d7.gV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().vj); + Z10().XC(); + return AL(a10); + }; + d7.Gj = function() { + return Yub(this); + }; + d7.DQ = function(a10) { + var b10 = this.k, c10 = Fg().vj; + Xr(b10, c10, a10); + return this; + }; + d7.l$ = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().yx); + Z10().yi(); + return yL(a10); + }; + d7.GQ = function(a10) { + var b10 = this.k, c10 = Fg().wj; + Xr(b10, c10, a10); + return this; + }; + d7.oc = function() { + return this.k; + }; + function Yub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Wh().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().bY && null === Z10().bY) { + var c10 = Z10(), e10 = new n0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.bY = e10; + } + b10 = Z10().bY; + return xu(b10.l.ea, a10); + } + d7.z = function() { + return X5(this); + }; + d7.kV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().wj); + Z10().XC(); + return AL(a10); + }; + d7.C$ = function() { + Z10(); + var a10 = ni(this.k); + Z10().cb(); + return gb(a10); + }; + d7.h4 = function(a10) { + var b10 = this.k, c10 = Fg().yx; + Bi(b10, c10, a10); + return this; + }; + d7.o4 = function(a10) { + var b10 = this.k, c10 = Fg().Cq; + es(b10, c10, a10); + return this; + }; + d7.uE = function() { + return Yub(this); + }; + d7.raa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.m4 = function(a10) { + var b10 = this.k, c10 = Fg().Aq; + es(b10, c10, a10); + return this; + }; + d7.g4 = function(a10) { + var b10 = this.k, c10 = Fg().xx; + Bi(b10, c10, a10); + return this; + }; + d7.p4 = function(a10) { + var b10 = this.k, c10 = Fg().av; + Xr(b10, c10, a10); + return this; + }; + d7.yba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().Cq); + Z10().Pt(); + return CL(a10); + }; + mn.prototype.withMultipleOf = function(a10) { + return this.p4(+a10); + }; + mn.prototype.withFormat = function(a10) { + return this.k4(a10); + }; + mn.prototype.withExclusiveMaximum = function(a10) { + return this.g4(!!a10); + }; + mn.prototype.withExclusiveMinimum = function(a10) { + return this.h4(!!a10); + }; + mn.prototype.withMaximum = function(a10) { + return this.DQ(+a10); + }; + mn.prototype.withMinimum = function(a10) { + return this.GQ(+a10); + }; + mn.prototype.withMaxLength = function(a10) { + return this.m4(a10 | 0); + }; + mn.prototype.withMinLength = function(a10) { + return this.o4(a10 | 0); + }; + mn.prototype.withPattern = function(a10) { + return this.JQ(a10); + }; + mn.prototype.withFileTypes = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Lf(); + a10 = uk(tk(c10, a10, e10)); + c10 = gn().OA; + Wr(b10, c10, a10); + return this; + }; + Object.defineProperty(mn.prototype, "multipleOf", { get: function() { + return this.Bba(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "format", { get: function() { + return this.C$(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "exclusiveMaximum", { get: function() { + return this.k$(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "exclusiveMinimum", { get: function() { + return this.l$(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "maximum", { get: function() { + return this.gV(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "minimum", { get: function() { + return this.kV(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "maxLength", { get: function() { + return this.uba(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "minLength", { get: function() { + return this.yba(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "pattern", { get: function() { + return this.NV(); + }, configurable: true }); + Object.defineProperty(mn.prototype, "fileTypes", { get: function() { + var a10 = Z10(), b10 = B6(this.k.aa, gn().OA), c10 = Z10().cb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + mn.prototype.$classData = r8({ Gua: 0 }, false, "amf.client.model.domain.FileShape", { Gua: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Ym() { + Xm.call(this); + } + Ym.prototype = new T7(); + Ym.prototype.constructor = Ym; + d7 = Ym.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Ym.prototype.saa.call(this, new Th().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "NilShape"; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Ym) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.saa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Jh = function() { + return this.k; + }; + d7.Kf = function() { + return Zub(this); + }; + d7.Gj = function() { + return Zub(this); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.uE = function() { + return Zub(this); + }; + function Zub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Th().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().mZ && null === Z10().mZ) { + var c10 = Z10(), e10 = new z0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.mZ = e10; + } + b10 = Z10().mZ; + return xu(b10.l.ea, a10); + } + d7.$classData = r8({ Vua: 0 }, false, "amf.client.model.domain.NilShape", { Vua: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function nn() { + Xm.call(this); + } + nn.prototype = new T7(); + nn.prototype.constructor = nn; + d7 = nn.prototype; + d7.H = function() { + return "NodeShape"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + nn.prototype.taa.call(this, new Hh().K(new S6().a(), a10)); + return this; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.TV = function() { + var a10 = Z10(), b10 = B6(this.k.aa, Ih().kh), c10 = Z10().cB(); + return Ak(a10, b10, c10).Ra(); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof nn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Jh = function() { + return this.k; + }; + d7.Kf = function() { + return $ub(this); + }; + d7.YQ = function() { + return this.TV(); + }; + d7.Gj = function() { + return $ub(this); + }; + d7.oc = function() { + return this.k; + }; + d7.t4 = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().cB(); + a10 = uk(tk(c10, a10, e10)); + c10 = Ih().kh; + Zd(b10, c10, a10); + return this; + }; + d7.z = function() { + return X5(this); + }; + function $ub(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Hh().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return LWa(etb(), a10); + } + d7.uE = function() { + return $ub(this); + }; + d7.taa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + nn.prototype.withPropertyNames = function(a10) { + var b10 = this.k; + Z10(); + Z10().Bg(); + a10 = a10.Ce(); + var c10 = Ih().KZ; + return Vd(b10, c10, a10); + }; + nn.prototype.withInheritsScalar = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new Mh().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Ih().xd; + ig(b10, c10, a10); + return TWa(dtb(), a10); + }; + nn.prototype.withInheritsObject = function(a10) { + Z10(); + var b10 = this.k; + O7(); + var c10 = new P6().a(); + c10 = new Hh().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + a10 = Sd(c10, a10, e10); + c10 = Ih().xd; + ig(b10, c10, a10); + return LWa(etb(), a10); + }; + nn.prototype.withDependency = function() { + Z10(); + var a10 = this.k; + O7(); + var b10 = new P6().a(); + b10 = new vn().K(new S6().a(), b10); + var c10 = Ih().VC; + ig(a10, c10, b10); + a10 = avb(); + return xu(a10.l.ea, b10); + }; + nn.prototype.withDependencies = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = avb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Ih().VC; + Zd(b10, c10, a10); + return this; + }; + nn.prototype.withProperty = function(a10) { + Z10(); + a10 = p5a(this.k, a10); + return NWa(Z10().cB(), a10); + }; + nn.prototype.withProperties = function(a10) { + return this.t4(a10); + }; + nn.prototype.withDiscriminatorMapping = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = htb(); + a10 = uk(tk(c10, a10, e10)); + c10 = Ih().SI; + Zd(b10, c10, a10); + return this; + }; + nn.prototype.withDiscriminatorValue = function(a10) { + var b10 = this.k, c10 = Ih().Jy; + eb(b10, c10, a10); + return this; + }; + nn.prototype.withDiscriminator = function(a10) { + var b10 = this.k, c10 = Ih().Us; + eb(b10, c10, a10); + return this; + }; + nn.prototype.withClosed = function(a10) { + a10 = !!a10; + var b10 = this.k, c10 = Ih().Cn; + Bi(b10, c10, a10); + return this; + }; + nn.prototype.withMaxProperties = function(a10) { + a10 |= 0; + var b10 = this.k, c10 = Ih().cw; + es(b10, c10, a10); + return this; + }; + nn.prototype.withMinProperties = function(a10) { + a10 |= 0; + var b10 = this.k, c10 = Ih().dw; + es(b10, c10, a10); + return this; + }; + Object.defineProperty(nn.prototype, "propertyNames", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().KZ); + return t1(Z10().Bg(), a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "dependencies", { get: function() { + var a10 = Z10(), b10 = B6(this.k.aa, Ih().VC), c10 = avb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(nn.prototype, "additionalPropertiesSchema", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().vF); + return t1(Z10().Bg(), a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "properties", { get: function() { + return this.YQ(); + }, configurable: true }); + Object.defineProperty(nn.prototype, "discriminatorMapping", { get: function() { + var a10 = Z10(), b10 = B6(this.k.aa, Ih().SI), c10 = htb(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + Object.defineProperty(nn.prototype, "discriminatorValue", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().Jy); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "discriminator", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().Us); + Z10().cb(); + return gb(a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "closed", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().Cn); + Z10().yi(); + return yL(a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "maxProperties", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().cw); + Z10().Pt(); + return CL(a10); + }, configurable: true }); + Object.defineProperty(nn.prototype, "minProperties", { get: function() { + Z10(); + var a10 = B6(this.k.aa, Ih().dw); + Z10().Pt(); + return CL(a10); + }, configurable: true }); + nn.prototype.$classData = r8({ Xua: 0 }, false, "amf.client.model.domain.NodeShape", { Xua: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function on4() { + Xm.call(this); + } + on4.prototype = new T7(); + on4.prototype.constructor = on4; + d7 = on4.prototype; + d7.H = function() { + return "ScalarShape"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + on4.prototype.uaa.call(this, new Mh().K(new S6().a(), a10)); + return this; + }; + d7.k4 = function(a10) { + var b10 = this.k, c10 = Fg().Fn; + eb(b10, c10, a10); + return this; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.uba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().Aq); + Z10().Pt(); + return CL(a10); + }; + d7.JQ = function(a10) { + var b10 = this.k, c10 = Fg().zl; + eb(b10, c10, a10); + return this; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof on4) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.k$ = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().xx); + Z10().yi(); + return yL(a10); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Bba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().av); + Z10().XC(); + return AL(a10); + }; + d7.NV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().zl); + Z10().cb(); + return gb(a10); + }; + d7.Jh = function() { + return this.k; + }; + d7.g0 = function() { + Z10(); + var a10 = B6(this.k.aa, Fg().af); + Z10().cb(); + return gb(a10); + }; + d7.Kf = function() { + return bvb(this); + }; + d7.uaa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.gV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().vj); + Z10().XC(); + return AL(a10); + }; + d7.Gj = function() { + return bvb(this); + }; + d7.DQ = function(a10) { + var b10 = this.k, c10 = Fg().vj; + Xr(b10, c10, a10); + return this; + }; + d7.l$ = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().yx); + Z10().yi(); + return yL(a10); + }; + d7.GQ = function(a10) { + var b10 = this.k, c10 = Fg().wj; + Xr(b10, c10, a10); + return this; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.kV = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().wj); + Z10().XC(); + return AL(a10); + }; + d7.C$ = function() { + Z10(); + var a10 = ni(this.k); + Z10().cb(); + return gb(a10); + }; + d7.h4 = function(a10) { + var b10 = this.k, c10 = Fg().yx; + Bi(b10, c10, a10); + return this; + }; + d7.o4 = function(a10) { + var b10 = this.k, c10 = Fg().Cq; + es(b10, c10, a10); + return this; + }; + d7.uE = function() { + return bvb(this); + }; + d7.m4 = function(a10) { + var b10 = this.k, c10 = Fg().Aq; + es(b10, c10, a10); + return this; + }; + d7.g4 = function(a10) { + var b10 = this.k, c10 = Fg().xx; + Bi(b10, c10, a10); + return this; + }; + function bvb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Mh().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + return TWa(dtb(), a10); + } + d7.p4 = function(a10) { + var b10 = this.k, c10 = Fg().av; + Xr(b10, c10, a10); + return this; + }; + d7.yba = function() { + Z10(); + var a10 = B6(this.k.Y(), Fg().Cq); + Z10().Pt(); + return CL(a10); + }; + on4.prototype.withMultipleOf = function(a10) { + return this.p4(+a10); + }; + on4.prototype.withFormat = function(a10) { + return this.k4(a10); + }; + on4.prototype.withExclusiveMaximum = function(a10) { + return this.g4(!!a10); + }; + on4.prototype.withExclusiveMinimum = function(a10) { + return this.h4(!!a10); + }; + on4.prototype.withMaximum = function(a10) { + return this.DQ(+a10); + }; + on4.prototype.withMinimum = function(a10) { + return this.GQ(+a10); + }; + on4.prototype.withMaxLength = function(a10) { + return this.m4(a10 | 0); + }; + on4.prototype.withMinLength = function(a10) { + return this.o4(a10 | 0); + }; + on4.prototype.withPattern = function(a10) { + return this.JQ(a10); + }; + on4.prototype.withDataType = function(a10) { + var b10 = this.k, c10 = Fg().af; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(on4.prototype, "multipleOf", { get: function() { + return this.Bba(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "format", { get: function() { + return this.C$(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "exclusiveMaximum", { get: function() { + return this.k$(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "exclusiveMinimum", { get: function() { + return this.l$(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "maximum", { get: function() { + return this.gV(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "minimum", { get: function() { + return this.kV(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "maxLength", { get: function() { + return this.uba(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "minLength", { get: function() { + return this.yba(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "pattern", { get: function() { + return this.NV(); + }, configurable: true }); + Object.defineProperty(on4.prototype, "dataType", { get: function() { + return this.g0(); + }, configurable: true }); + on4.prototype.$classData = r8({ vva: 0 }, false, "amf.client.model.domain.ScalarShape", { vva: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function qn() { + Xm.call(this); + } + qn.prototype = new T7(); + qn.prototype.constructor = qn; + d7 = qn.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + qn.prototype.vaa.call(this, new Gh().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "SchemaShape"; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.Rm = function(a10) { + var b10 = this.k, c10 = pn().Rd; + eb(b10, c10, a10); + return this; + }; + d7.wL = function() { + Z10(); + var a10 = B6(this.k.aa, pn().Nd); + Z10().cb(); + return gb(a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof qn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.Sl = function() { + return this.sL(); + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.ada = function() { + Z10(); + var a10 = B6(this.k.aa, Zf().Rd); + Z10().cb(); + return gb(a10); + }; + function cvb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(); + b10 = new Gh().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().VZ && null === Z10().VZ) { + var c10 = Z10(), e10 = new $0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.VZ = e10; + } + b10 = Z10().VZ; + return xu(b10.l.ea, a10); + } + d7.Jh = function() { + return this.k; + }; + d7.Sm = function() { + return this.ada(); + }; + d7.Kf = function() { + return cvb(this); + }; + d7.Gj = function() { + return cvb(this); + }; + d7.zy = function() { + return this.wL(); + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.sL = function() { + var a10 = Z10(), b10 = yh(this.k), c10 = Z10().Lf(); + return bb(a10, b10, c10).Ra(); + }; + d7.uE = function() { + return cvb(this); + }; + d7.vaa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + qn.prototype.withRaw = function(a10) { + return this.Rm(a10); + }; + qn.prototype.withMediatype = function(a10) { + var b10 = this.k, c10 = pn().Nd; + eb(b10, c10, a10); + return this; + }; + Object.defineProperty(qn.prototype, "location", { get: function() { + return this.Sl(); + }, configurable: true }); + Object.defineProperty(qn.prototype, "raw", { get: function() { + return this.Sm(); + }, configurable: true }); + Object.defineProperty(qn.prototype, "mediaType", { get: function() { + return this.zy(); + }, configurable: true }); + qn.prototype.$classData = r8({ wva: 0 }, false, "amf.client.model.domain.SchemaShape", { wva: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function yn() { + Xm.call(this); + } + yn.prototype = new T7(); + yn.prototype.constructor = yn; + d7 = yn.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + yn.prototype.xaa.call(this, new Vh().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "UnionShape"; + }; + d7.Ce = function() { + return this.k; + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof yn) { + var b10 = this.k; + a10 = a10.k; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.xaa = function(a10) { + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.Jh = function() { + return this.k; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + yn.prototype.withAnyOf = function(a10) { + var b10 = this.k, c10 = Z10(), e10 = Z10().Bg(); + a10 = uk(tk(c10, a10, e10)); + c10 = xn().Le; + Zd(b10, c10, a10); + return this; + }; + Object.defineProperty(yn.prototype, "anyOf", { get: function() { + var a10 = Z10(), b10 = B6(this.k.aa, xn().Le), c10 = Z10().Bg(); + return Ak(a10, b10, c10).Ra(); + }, configurable: true }); + yn.prototype.$classData = r8({ Gva: 0 }, false, "amf.client.model.domain.UnionShape", { Gva: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function BB() { + mf.call(this); + } + BB.prototype = new Uub(); + BB.prototype.constructor = BB; + function dvb() { + } + dvb.prototype = BB.prototype; + BB.prototype.qe = function() { + return ar(this.Y(), Gk().nb); + }; + function AO() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + AO.prototype = new u7(); + AO.prototype.constructor = AO; + d7 = AO.prototype; + d7.H = function() { + return "DialectLibrary"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof AO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Ehb(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, Gc().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return B6(this.g, Gc().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ LGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectLibrary", { LGa: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, TA: 1, e7: 1, y: 1, v: 1, q: 1, o: 1 }); + function Cd() { + this.Ts = this.at = this.R = this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + Cd.prototype = new u7(); + Cd.prototype.constructor = Cd; + d7 = Cd.prototype; + d7.H = function() { + return "NodeMapping"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.D_ = function(a10) { + this.R = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Cd ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Cd().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return wj(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + function R1a(a10) { + return B6(a10.g, wj().ej).Cb(w6(/* @__PURE__ */ function() { + return function(b10) { + b10 = B6(b10.g, $d().YF).A; + return !(b10.b() || !b10.c()); + }; + }(a10))).ei(w6(/* @__PURE__ */ function() { + return function(b10) { + b10 = B6(b10.g, $d().Yh).A; + return b10.b() ? null : b10.c(); + }; + }(a10)), mc()); + } + d7.dd = function() { + var a10 = B6(this.g, this.R).A; + a10 = a10.b() ? null : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + a10 = kM(this, a10, b10); + e10 && ut(a10) && (b10 = db().oe, Bi(a10, b10, e10)); + e10 = Rd(a10, c10.j); + c10 = B6(c10.g, c10.R).A; + c10 = c10.b() ? null : c10.c(); + return eb(e10, e10.R, c10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.KN = function(a10) { + this.at = a10; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Cd().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.JN = function(a10) { + this.Ts = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Zea = function(a10) { + return eb(this, this.R, a10); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + ud(this); + Aba(this); + return this; + }; + d7.$classData = r8({ eHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.NodeMapping", { eHa: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, Yga: 1, PR: 1, Zga: 1, d7: 1, y: 1, v: 1, q: 1, o: 1 }); + function jA() { + k9.call(this); + this.gr = this.Nl = this.$h = this.um = null; + this.Yma = false; + } + jA.prototype = new Vub(); + jA.prototype.constructor = jA; + d7 = jA.prototype; + d7.Gg = function() { + return this.gr; + }; + d7.$U = function() { + return this.Yma; + }; + d7.Hp = function() { + return this.um; + }; + d7.Wx = function(a10, b10, c10, e10, f10, g10) { + this.um = g10; + k9.prototype.Jaa.call(this, a10, b10, c10, e10, f10, g10); + this.$h = new g7().fE(this); + this.Nl = rQ(); + this.gr = Wba(); + this.Yma = !(c10 instanceof l9) && c10 instanceof k9; + return this; + }; + d7.$classData = r8({ HIa: 0 }, false, "amf.plugins.document.webapi.JsonSchemaWebApiContext", { HIa: 1, eha: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1 }); + function mA() { + k9.call(this); + this.Nl = this.gr = this.$h = this.um = null; + } + mA.prototype = new Vub(); + mA.prototype.constructor = mA; + mA.prototype.Gg = function() { + return this.gr; + }; + mA.prototype.Hp = function() { + return this.um; + }; + mA.prototype.Wx = function(a10, b10, c10, e10, f10, g10) { + this.um = g10; + k9.prototype.Jaa.call(this, a10, b10, c10, e10, f10, g10); + this.$h = new Khb().fE(this); + this.gr = Bu(); + this.Nl = nna(); + return this; + }; + mA.prototype.$classData = r8({ uJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas2WebApiContext", { uJa: 1, eha: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1 }); + function lA() { + k9.call(this); + this.Nl = this.gr = this.$h = this.um = null; + } + lA.prototype = new Vub(); + lA.prototype.constructor = lA; + lA.prototype.Gg = function() { + return this.gr; + }; + lA.prototype.Hp = function() { + return this.um; + }; + lA.prototype.Wx = function(a10, b10, c10, e10, f10, g10) { + this.um = g10; + k9.prototype.Jaa.call(this, a10, b10, c10, e10, f10, g10); + this.$h = new g7().fE(this); + this.gr = Cu(); + this.Nl = rQ(); + return this; + }; + lA.prototype.$classData = r8({ yJa: 0 }, false, "amf.plugins.document.webapi.contexts.Oas3WebApiContext", { yJa: 1, eha: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1 }); + function l9() { + b9.call(this); + this.iv = this.qQ = null; + this.Vka = false; + this.Qh = this.FE = null; + } + l9.prototype = new cub(); + l9.prototype.constructor = l9; + function evb() { + } + d7 = evb.prototype = l9.prototype; + d7.il = function(a10, b10, c10, e10, f10, g10, h10) { + this.qQ = c10; + this.iv = h10; + b9.prototype.Wx.call(this, a10, b10, c10, e10, f10, g10); + this.Vka = false; + this.FE = Rb(Ut(), H10()); + e10.b() ? (a10 = y7(), b10 = new z7().d(this), c10 = this.ni, e10 = Rb(Gb().ab, H10()), f10 = Rb(Gb().ab, H10()), a10 = new Jx().GU(e10, f10, a10, b10, c10)) : a10 = e10.c(); + this.Qh = a10; + return this; + }; + d7.hqa = function() { + return true; + }; + d7.pe = function() { + return this.Qh; + }; + function sqa(a10, b10, c10) { + if (!b10.b()) { + var e10 = b10.ga(); + e10 = c10.xi.Ja(e10); + if (e10 instanceof z7 && (e10 = e10.i, e10 instanceof Jx)) + return sqa(a10, b10.ta(), e10); + e10 = dc().UC; + var f10 = y7(); + b10 = "Cannot find declarations in context '" + b10.Kg("."); + var g10 = y7(), h10 = y7(); + a10.Gc(e10.j, "", f10, b10, g10, Yb().qb, h10); + } + return c10; + } + function N2a(a10, b10, c10, e10, f10) { + var g10 = b10.j, h10 = mC(b10, true, J5(DB(), H10())), k10 = $ka(bla(), e10), l10 = a10.Nl.Pe.Ja(e10); + if (l10 instanceof z7) + a: { + if (b10 = new qd().d(l10.i), f10.Lw && (b10.oa = b10.oa.Lk(a10.Nl.Pe.P("annotation"))), f10.aP && (b10.oa = b10.oa.Lk(a10.Nl.Pe.P("property"))), b10 = w6(/* @__PURE__ */ function(m10, p10, t10, v10) { + return function(A10) { + A10 = p10.oa.Lk(pd(A10)); + K7(); + pj(); + var D10 = new Lf().a().ua(); + return t10.sb.ne(D10, Uc(/* @__PURE__ */ function(C10, I10, L10) { + return function(Y10, ia) { + var pa = ia.Aa, La = IO(), ob = cc().bi; + pa = N6(pa, La, ob).va; + if (C10.K$(I10, pa) || L10.Ha(pa)) + return Y10; + ia = J5(K7(), new Ib().ha([ia])); + pa = K7(); + return Y10.ia( + ia, + pa.u + ); + }; + }(m10, v10, A10))); + }; + }(a10, b10, c10, e10)), e10 = K7(), h10 = h10.ka(b10, e10.u).Fb(w6(/* @__PURE__ */ function() { + return function(m10) { + return m10.Da(); + }; + }(a10))), y7() !== h10) { + if (h10 instanceof z7 && (b10 = h10.i, null !== b10)) { + e10 = 1 < b10.jb() ? "Properties" : "Property"; + h10 = Wd().QI; + c10 = w6(/* @__PURE__ */ function() { + return function(m10) { + m10 = m10.Aa; + var p10 = IO(), t10 = cc().bi; + return N6(m10, p10, t10).va; + }; + }(a10)); + f10 = K7(); + c10 = b10.ka(c10, f10.u); + f10 = w6(/* @__PURE__ */ function() { + return function(m10) { + return "'" + m10 + "'"; + }; + }(a10)); + l10 = K7(); + k10 = e10 + " " + c10.ka(f10, l10.u).Kg(",") + " not supported in a " + a10.Gg() + " " + k10 + " node"; + b10 = b10.ga(); + e10 = y7(); + ec(a10, h10, g10, e10, k10, b10.da); + break a; + } + throw new x7().d(h10); + } + } + else if (y7() === l10) + k10 = Wd().QI, h10 = "Cannot validate unknown node type " + e10 + " for " + a10.Gg(), yB(a10, k10, g10, h10, b10.fa()); + else + throw new x7().d(l10); + } + d7.K$ = function(a10, b10) { + var c10; + (c10 = this.hqa() && 0 <= (b10.length | 0) && "(" === b10.substring(0, 1) && Ed(ua(), b10, ")")) || (c10 = H10(), c10 = ji("webApi", ji("endPoint", c10)), c10 = 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) && Cg(c10, a10)); + if (!c10) { + c10 = H10(); + c10 = ji("resourceType", ji("trait", c10)); + if (null === b10) + throw new sf().a(); + c10 = tf(uf(), "<<.+>>", b10) ? Cg(c10, a10) : false; + } + c10 || (c10 = H10(), c10 = ji("resourceType", c10), c10 = 0 <= (b10.length | 0) && "/" === b10.substring(0, 1) && Cg(c10, a10)); + return c10; + }; + function $kb(a10) { + a10.FE.Ur().U(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + fvb(b10, c10); + }; + }(a10))); + a10.FE.KB().U(w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return b10.FE.rt(c10); + }; + }(a10))); + } + d7.hp = function(a10) { + var b10 = a10.hb().gb, c10 = Q5().wq; + if (b10 === c10) + return ue4(), b10 = IO(), c10 = cc().bi, a10 = N6(a10, b10, c10).va, new ve4().d(a10); + ue4(); + return new ye4().d(a10); + }; + function fvb(a10, b10) { + EOa(a10.pe(), b10.pe()); + b10.pe().xB().XB.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.pe().xB().XB.Xh(e10); + }; + }(a10))); + b10.ni.XB.U(w6(/* @__PURE__ */ function(c10) { + return function(e10) { + return c10.ni.XB.Xh(e10); + }; + }(a10))); + } + function K8a(a10, b10) { + var c10 = a10.FE.Ja(b10); + c10.b() || (c10 = c10.c(), fvb(a10, c10)); + a10.FE.rt(b10); + } + d7.Dl = function() { + return this.pe(); + }; + function oD() { + Kl.call(this); + this.ys = this.se = this.Xn = null; + } + oD.prototype = new Jlb(); + oD.prototype.constructor = oD; + d7 = oD.prototype; + d7.H = function() { + return "ErrorEndPoint"; + }; + d7.sH = function() { + return this.ys; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof oD && this.Xn === a10.Xn) { + var b10 = this.se; + a10 = a10.se; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xn; + case 1: + return this.se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.Xn = a10; + this.se = b10; + Kl.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorEndPoint/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ rLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorEndPoint", { rLa: 1, Fha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, Gha: 1, t7: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mdb() { + Wl.call(this); + this.ys = this.se = this.Xn = null; + } + Mdb.prototype = new Llb(); + Mdb.prototype.constructor = Mdb; + d7 = Mdb.prototype; + d7.H = function() { + return "ErrorParameter"; + }; + d7.sH = function() { + return this.ys; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Mdb && this.Xn === a10.Xn) { + var b10 = this.se; + a10 = a10.se; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xn; + case 1: + return this.se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.Xn = a10; + this.se = b10; + Wl.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorParameter/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ tLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorParameter", { tLa: 1, Iha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, Kha: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function oP() { + Vm.call(this); + this.mV = this.DD = this.ZD = null; + } + oP.prototype = new Olb(); + oP.prototype.constructor = oP; + d7 = oP.prototype; + d7.H = function() { + return "ErrorResourceType"; + }; + d7.sH = function() { + return this.mV; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof oP && this.ZD === a10.ZD) { + var b10 = this.DD; + a10 = a10.DD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ZD; + case 1: + return this.DD; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Nz = function() { + qs(); + O7(); + var a10 = new P6().a(); + return new Xk().K(new S6().a(), a10); + }; + d7.Tq = function(a10, b10) { + this.ZD = a10; + this.DD = b10; + Vm.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.mV = "http://amferror.com/#errorResourceType/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ uLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorResourceType", { uLa: 1, Oha: 1, $6: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function nP() { + Em.call(this); + this.ys = this.se = this.Xn = null; + } + nP.prototype = new Mlb(); + nP.prototype.constructor = nP; + d7 = nP.prototype; + d7.H = function() { + return "ErrorResponse"; + }; + d7.sH = function() { + return this.ys; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof nP && this.Xn === a10.Xn) { + var b10 = this.se; + a10 = a10.se; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xn; + case 1: + return this.se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.Xn = a10; + this.se = b10; + Em.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorResponse/"; + a10 = pU(this, a10); + b10 = Dm().In; + eb(a10, b10, "200"); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ vLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorResponse", { vLa: 1, Jha: 1, f: 1, Hha: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function p7() { + vm.call(this); + this.ys = this.se = this.Xn = null; + } + p7.prototype = new Nlb(); + p7.prototype.constructor = p7; + d7 = p7.prototype; + d7.H = function() { + return "ErrorSecurityScheme"; + }; + d7.sH = function() { + return this.ys; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof p7 && this.Xn === a10.Xn) { + var b10 = this.se; + a10 = a10.se; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xn; + case 1: + return this.se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.Xn = a10; + this.se = b10; + vm.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorSecurityScheme/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ wLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorSecurityScheme", { wLa: 1, Mha: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Nha: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function mP() { + Tm.call(this); + this.mV = this.DD = this.ZD = null; + } + mP.prototype = new Qlb(); + mP.prototype.constructor = mP; + d7 = mP.prototype; + d7.H = function() { + return "ErrorTrait"; + }; + d7.sH = function() { + return this.mV; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof mP && this.ZD === a10.ZD) { + var b10 = this.DD; + a10 = a10.DD; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ZD; + case 1: + return this.DD; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.ZD = a10; + this.DD = b10; + Tm.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.mV = "http://amferror.com/#errorTrait/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ xLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorTrait", { xLa: 1, Pha: 1, $6: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function nY() { + oY.call(this); + this.Fs = null; + } + nY.prototype = new Ykb(); + nY.prototype.constructor = nY; + d7 = nY.prototype; + d7.H = function() { + return "ExtensionLikeParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof nY) { + var b10 = this.Fs; + a10 = a10.Fs; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.nca = function() { + this.Je.iv = iA().D5; + var a10 = gvb(this); + a10 instanceof z7 && hvb(this, a10.i, this.Je.c2); + O7(); + a10 = new P6().a(); + a10 = mcb(this, new Fl().K(new S6().a(), a10)); + ivb(this, a10); + return a10; + }; + d7.Nb = function() { + return this.Je; + }; + function hvb(a10, b10, c10) { + ar(b10.Y(), Gk().Ic).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return $h(h10, k10); + }; + }(a10, c10))); + var e10 = b10.Ve().Dm(w6(/* @__PURE__ */ function() { + return function(g10) { + return g10 instanceof BB || g10 instanceof mf; + }; + }(a10))); + if (null === e10) + throw new x7().d(e10); + var f10 = e10.ma(); + e10 = e10.ya(); + b10 = Ab(b10.fa(), q5(Rc)); + b10.b() || b10.c().Xb.U(w6(/* @__PURE__ */ function(g10, h10, k10) { + return function(l10) { + var m10 = l10.ya().ma(); + m10 = h10.Fb(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + v10 = Lc(v10); + return v10.b() ? false : v10.c() === t10; + }; + }(g10, m10))); + m10 instanceof z7 && (m10 = m10.i, m10 instanceof bg && (l10 = lFa(k10, l10.ma()), ar(m10.g, Af().Ic).U(w6(/* @__PURE__ */ function(p10, t10) { + return function(v10) { + return $h(t10, v10); + }; + }(g10, l10))))); + }; + }(a10, e10, c10))); + f10.U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + hvb(g10, k10, h10); + }; + }(a10, c10))); + } + function gvb(a10) { + var b10 = a10.Fs.Q; + a10 = w6(/* @__PURE__ */ function() { + return function(e10) { + return e10.Jd; + }; + }(a10)); + var c10 = K7(); + b10 = b10.ka(a10, c10.u); + return Jc(b10, new neb()); + } + d7.vca = function() { + this.Je.iv = iA().N7; + var a10 = gvb(this); + a10 instanceof z7 && hvb(this, a10.i, this.Je.c2); + O7(); + a10 = new P6().a(); + a10 = mcb(this, new Hl().K(new S6().a(), a10)); + ivb(this, a10); + return a10; + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.Je; + }; + d7.zH = function(a10, b10) { + Aca(this, a10, b10); + }; + function ivb(a10, b10) { + var c10 = wB().mc, e10 = a10.Fs.$g.Xd, f10 = qc(); + e10 = N6(e10, f10, a10.Je); + n7a(a10, e10, b10).hd(); + e10 = ac(new M6().W(e10), "extends"); + e10.b() || (e10 = e10.c(), a10 = a10.Fs.Q.Fb(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + k10 = k10.$n.Of; + var l10 = h10.i, m10 = Dd(); + return k10 === N6(l10, m10, g10.Je); + }; + }(a10, e10))), a10.b() || (a10 = a10.c(), a10 = ih(new jh(), a10.Jd.j, Od(O7(), e10.i)), e10 = Od(O7(), e10), Rg(b10, c10, a10, e10))); + } + d7.$classData = r8({ rVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.ExtensionLikeParser", { rVa: 1, wha: 1, n7: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, lr: 1, vha: 1, y: 1, v: 1, q: 1, o: 1 }); + function lcb() { + oY.call(this); + this.Fs = null; + } + lcb.prototype = new Ykb(); + lcb.prototype.constructor = lcb; + d7 = lcb.prototype; + d7.H = function() { + return "Raml08DocumentParser"; + }; + function jvb(a10, b10, c10) { + b10 = ac(new M6().W(b10), "schemas"); + if (!b10.b()) { + var e10 = b10.c(), f10 = e10.i.hb().gb; + if (Q5().sa === f10) + b10 = e10.i, e10 = qc(), kvb(a10, N6(b10, e10, a10.Je).sb, c10); + else if (Q5().nd !== f10) + if (Q5().cd === f10) + b10 = e10.i, e10 = qc(), f10 = rw().sc, b10 = N6(b10, sw(f10, e10), a10.Je), e10 = w6(/* @__PURE__ */ function() { + return function(h10) { + return h10.sb; + }; + }(a10)), f10 = K7(), kvb(a10, b10.bd(e10, f10.u), c10); + else { + a10 = a10.Je; + b10 = sg().sY; + f10 = "Invalid type " + f10 + " for 'types' node."; + e10 = e10.i; + var g10 = y7(); + ec(a10, b10, c10, g10, f10, e10.da); + } + } + } + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof lcb) { + var b10 = this.Fs; + a10 = a10.Fs; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Nb = function() { + return this.Je; + }; + function lvb(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + var h10 = e10.Je.pe(); + g10 = Bca(Cca(), g10, Uc(/* @__PURE__ */ function(l10, m10) { + return function(p10, t10) { + O7(); + var v10 = new P6().a(); + p10 = Sd(p10, t10, v10); + J5(K7(), H10()); + return Yh(p10, m10); + }; + }(e10, f10)), e10.Je).FH(); + var k10 = new Zh().a(); + return $h(h10, Cb(g10, k10)); + }; + }(a10, c10))); + } + function mvb(a10, b10, c10, e10, f10) { + b10 = ac(new M6().W(e10), b10); + if (!b10.b()) { + var g10 = b10.c(), h10 = g10.i.hb().gb; + if (Q5().cd === h10) + b10 = g10.i, e10 = qc(), h10 = rw().sc, b10 = N6(b10, sw(h10, e10), a10.Je), e10 = w6(/* @__PURE__ */ function() { + return function(l10) { + return l10.sb; + }; + }(a10)), h10 = K7(), b10 = b10.bd(e10, h10.u); + else if (Q5().sa === h10) + b10 = g10.i, e10 = qc(), b10 = N6(b10, e10, a10.Je).sb; + else { + b10 = a10.Je; + e10 = sg().GR; + h10 = "Invalid node " + h10 + " in abstract declaration"; + g10 = g10.i; + var k10 = y7(); + ec(b10, e10, f10, k10, h10, g10.da); + b10 = H10(); + } + b10.U(w6(/* @__PURE__ */ function(l10, m10, p10) { + return function(t10) { + return $h(l10.Je.pe(), P2a(LOa(OOa(), m10.P(t10), p10, t10, l10.Je))); + }; + }(a10, c10, f10))); + } + } + function kvb(a10, b10, c10) { + b10.U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + Nh(); + var h10 = g10.Aa, k10 = IO(); + if (ila(0, N6(h10, k10, e10.Je).va).na()) { + h10 = e10.Je; + k10 = sg().bJ; + var l10 = g10.Aa, m10 = IO(); + l10 = "'" + N6(l10, m10, e10.Je).va + "' cannot be used to name a custom type"; + m10 = g10.Aa; + var p10 = y7(); + ec(h10, k10, f10, p10, l10, m10.da); + } + h10 = wW(xW(), g10, w6(/* @__PURE__ */ function(t10, v10, A10) { + return function(D10) { + T6(); + var C10 = v10.Aa, I10 = t10.Je, L10 = Dd(); + C10 = N6(C10, L10, I10); + O7(); + I10 = new P6().a(); + D10 = Sd(D10, C10, I10); + C10 = lt2(); + return D10.ub(A10, C10); + }; + }(e10, g10, f10)), false, QP(), e10.Je).Cc(); + if (h10 instanceof z7) + g10 = h10.i, h10 = e10.Je.pe(), k10 = new Zh().a(), $h(h10, Cb(g10, k10)), h10 = e10.Je.T_(e10.Je.qh), k10 = B6(g10.Y(), qf().R).A, h10 = "" + h10 + (k10.b() ? null : k10.c()), h10 = Kq(h10), Eb(e10.Je.ni, h10, g10); + else if (y7() === h10) + h10 = e10.Je, k10 = sg().bJ, l10 = "Error parsing shape '" + g10 + "'", m10 = y7(), ec(h10, k10, f10, m10, l10, g10.da); + else + throw new x7().d(h10); + }; + }(a10, c10))); + } + d7.rA = function(a10, b10) { + a10 = a10.da + "#/declarations"; + jvb(this, b10, a10 + "/schemas"); + mvb(this, "resourceTypes", w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = dD(eD(), f10), h10 = f10.Aa, k10 = IO(); + h10 = N6(h10, k10, c10.Je).va; + O7(); + k10 = new P6().a(); + g10 = Sd(g10, h10, k10); + f10 = f10.Aa; + h10 = IO(); + f10 = N6(f10, h10, c10.Je).va; + f10 = new je4().e(f10); + return g10.pc(e10 + "/resourceTypes/" + jj(f10.td)); + }; + }(this, a10)), b10, a10 + "/resourceTypes"); + mvb(this, "traits", w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = gD(hD(), f10), h10 = f10.Aa, k10 = IO(); + h10 = N6(h10, k10, c10.Je).va; + O7(); + k10 = new P6().a(); + g10 = Sd(g10, h10, k10); + f10 = f10.Aa; + h10 = IO(); + f10 = N6(f10, h10, c10.Je).va; + f10 = new je4().e(f10); + return g10.pc(e10 + "/traits/" + jj(f10.td)); + }; + }(this, a10)), b10, a10 + "/traits"); + this.zH(b10, a10 + "/securitySchemes"); + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.Je; + }; + d7.$D = function(a10, b10) { + this.Fs = a10; + oY.prototype.$D.call(this, a10, b10); + nv(); + return this; + }; + d7.zH = function(a10, b10) { + a10 = ac(new M6().W(a10), "securitySchemes"); + if (!a10.b()) { + var c10 = a10.c(), e10 = c10.i.hb().gb; + if (Q5().cd === e10) { + a10 = c10.i; + var f10 = qc(); + e10 = rw().sc; + N6(a10, sw(e10, f10), this.Je).U(w6(/* @__PURE__ */ function(h10, k10) { + return function(l10) { + lvb(h10, l10.sb, k10); + }; + }(this, b10))); + } else if (Q5().sa === e10) + a10 = c10.i, f10 = qc(), lvb(this, N6(a10, f10, this.Je).sb, b10); + else if (Q5().nd !== e10) { + a10 = this.Je; + f10 = sg().qY; + e10 = "Invalid type " + e10 + " for 'securitySchemes' node."; + c10 = c10.i; + var g10 = y7(); + ec(a10, f10, b10, g10, e10, c10.da); + } + } + }; + d7.$classData = r8({ vVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml08DocumentParser", { vVa: 1, wha: 1, n7: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, lr: 1, ib: 1, y: 1, v: 1, q: 1, o: 1 }); + function ncb() { + oY.call(this); + this.Fs = null; + } + ncb.prototype = new Ykb(); + ncb.prototype.constructor = ncb; + d7 = ncb.prototype; + d7.H = function() { + return "Raml10DocumentParser"; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof ncb) { + var b10 = this.Fs; + a10 = a10.Fs; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Fs; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Nb = function() { + return this.Je; + }; + d7.z = function() { + return X5(this); + }; + d7.Gp = function() { + return this.Je; + }; + d7.$D = function(a10, b10) { + this.Fs = a10; + oY.prototype.$D.call(this, a10, b10); + return this; + }; + d7.zH = function(a10, b10) { + Aca(this, a10, b10); + }; + d7.$classData = r8({ yVa: 0 }, false, "amf.plugins.document.webapi.parser.spec.raml.Raml10DocumentParser", { yVa: 1, wha: 1, n7: 1, hD: 1, f: 1, Yu: 1, $r: 1, sg: 1, lr: 1, vha: 1, y: 1, v: 1, q: 1, o: 1 }); + function nvb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ba = this.ir = this.Ln = this.g = this.qa = null; + this.xa = 0; + } + nvb.prototype = new u7(); + nvb.prototype.constructor = nvb; + d7 = nvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + ovb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + var a10 = vb().Eb, b10 = K7(), c10 = F6().Eb; + this.qa = tb(new ub(), a10, "Any Shape", "Base class for all shapes stored in the graph model", J5(b10, new Ib().ha([ic(G5(c10, "Shape"))]))); + a10 = qf().g; + ii(); + b10 = [this.Sf, this.Ln, this.ir, this.Ec]; + c10 = -1 + (b10.length | 0) | 0; + for (var e10 = H10(); 0 <= c10; ) + e10 = ji(b10[c10], e10), c10 = -1 + c10 | 0; + b10 = e10; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = Zf().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function(a10) { + this.ba = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new vh().K(b10, a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + return new vh().K(b10, a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ lYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.AnyShapeModel$", { lYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var ovb = void 0; + function Ag() { + ovb || (ovb = new nvb().a()); + return ovb; + } + function o9() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ba = this.ir = this.Ln = this.qa = this.g = this.Po = this.RC = this.qr = this.pr = this.Bq = this.CX = this.Ff = null; + this.xa = 0; + } + o9.prototype = new u7(); + o9.prototype.constructor = o9; + function pvb() { + } + d7 = pvb.prototype = o9.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + var a10 = qf(), b10 = F6().Eb; + this.Ff = rb(new sb(), a10, G5(b10, "items"), tb(new ub(), vb().Eb, "items", "Shapes inside the data arrangement", H10())); + a10 = qf(); + b10 = F6().Eb; + this.CX = rb(new sb(), a10, G5(b10, "contains"), tb(new ub(), vb().Eb, "contains", "One of the shapes in the data arrangement", H10())); + a10 = Ac(); + b10 = F6().Ua; + this.Bq = rb(new sb(), a10, G5(b10, "minCount"), tb(new ub(), ci().Ua, "min count", "Minimum items count constraint", H10())); + a10 = Ac(); + b10 = F6().Ua; + this.pr = rb( + new sb(), + a10, + G5(b10, "maxCount"), + tb(new ub(), ci().Ua, "max count", "Maximum items count constraint", H10()) + ); + a10 = zc(); + b10 = F6().Eb; + this.qr = rb(new sb(), a10, G5(b10, "uniqueItems"), tb(new ub(), vb().Eb, "uinque items", "Unique items constraint", H10())); + a10 = qb(); + b10 = F6().Eb; + this.RC = rb(new sb(), a10, G5(b10, "collectionFormat"), tb(new ub(), vb().Eb, "collection format", "Input collection format information", H10())); + ii(); + a10 = [this.Ff, this.CX, this.Bq, this.pr, this.qr, this.RC]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia( + b10, + c10.u + ); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Data Arrangement Shape", "Base shape class for any data shape that contains a nested collection of data shapes", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function(a10) { + this.ba = a10; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + function qvb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.qa = this.g = this.ba = null; + this.xa = 0; + } + qvb.prototype = new u7(); + qvb.prototype.constructor = qvb; + d7 = qvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + rvb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + ii(); + var a10 = F6().Eb; + a10 = [G5(a10, "NilShape")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = qf().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.g = Ag().g; + this.qa = tb(new ub(), vb().Eb, "Nil Shape", "Data shape representing the null/nil value in the input schema", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Th().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Th().K(new S6().a(), a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ sYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.NilShapeModel$", { sYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var rvb = void 0; + function wea() { + rvb || (rvb = new qvb().a()); + return rvb; + } + function svb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.qa = this.ba = this.g = this.Po = this.VC = this.KZ = this.kh = this.SI = this.Jy = this.Us = this.vF = this.Cn = this.cw = this.dw = null; + this.xa = 0; + } + svb.prototype = new u7(); + svb.prototype.constructor = svb; + d7 = svb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + tvb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + var a10 = Ac(), b10 = F6().Eb; + this.dw = rb(new sb(), a10, G5(b10, "minProperties"), tb(new ub(), vb().Eb, "min properties", "Minimum number of properties in the input node constraint", H10())); + a10 = Ac(); + b10 = F6().Eb; + this.cw = rb(new sb(), a10, G5(b10, "maxProperties"), tb(new ub(), vb().Eb, "max properties", "Maximum number of properties in the input node constraint", H10())); + a10 = zc(); + b10 = F6().Ua; + this.Cn = rb(new sb(), a10, G5(b10, "closed"), tb( + new ub(), + ci().Ua, + "closed", + "Additional properties in the input node accepted constraint", + H10() + )); + a10 = qf(); + b10 = F6().Ua; + this.vF = rb(new sb(), a10, G5(b10, "additionalPropertiesSchema"), tb(new ub(), ci().Ua, "additional properties schema", "", H10())); + a10 = qb(); + b10 = F6().Eb; + this.Us = rb(new sb(), a10, G5(b10, "discriminator"), tb(new ub(), vb().Eb, "discriminator", "Discriminator property", H10())); + a10 = qb(); + b10 = F6().Eb; + this.Jy = rb(new sb(), a10, G5(b10, "discriminatorValue"), tb(new ub(), vb().Eb, "discriminator value", "Values for the discriminator property", H10())); + a10 = new xc().yd(Gn()); + b10 = F6().Eb; + this.SI = rb(new sb(), a10, G5(b10, "discriminatorMapping"), tb(new ub(), vb().Eb, "discriminator mapping", "Mappping of acceptable values for the ndoe discriminator", H10())); + a10 = new xc().yd(Qi()); + b10 = F6().Ua; + this.kh = rb(new sb(), a10, G5(b10, "property"), tb(new ub(), ci().Ua, "property", "Properties associated to this node", H10())); + a10 = qf(); + b10 = F6().Ua; + this.KZ = rb(new sb(), a10, G5(b10, "propertyNames"), tb(new ub(), ci().Ua, "property", "property names schema", H10())); + a10 = new xc().yd(un()); + b10 = F6().Eb; + this.VC = rb(new sb(), a10, G5(b10, "dependencies"), tb( + new ub(), + vb().Eb, + "dependencies", + "Dependent properties constraint", + H10() + )); + ii(); + a10 = [this.dw, this.cw, this.Cn, this.vF, this.Us, this.Jy, this.SI, this.kh, this.KZ, this.VC]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Ua; + a10 = [G5(a10, "NodeShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb( + new ub(), + vb().Eb, + "Node Shape", + "Shape that validates a record of fields, like a JS object", + H10() + ); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Hh().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Hh().K(new S6().a(), a10); + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ tYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.NodeShapeModel$", { tYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var tvb = void 0; + function Ih() { + tvb || (tvb = new svb().a()); + return tvb; + } + function uvb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.qa = this.ba = this.g = this.Po = this.Le = null; + this.xa = 0; + } + uvb.prototype = new u7(); + uvb.prototype.constructor = uvb; + d7 = uvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + vvb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + var a10 = new xc().yd(qf()), b10 = F6().Eb; + this.Le = rb(new sb(), a10, G5(b10, "anyOf"), tb(new ub(), vb().Eb, "any of", "Data shapes in the union", H10())); + ii(); + a10 = [this.Le]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "UnionShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Union Shape", "Shape representing the union of many alternative data shapes", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Vh().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Vh().K(new S6().a(), a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ yYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.UnionShapeModel$", { yYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var vvb = void 0; + function xn() { + vvb || (vvb = new uvb().a()); + return vvb; + } + function wvb() { + this.wd = this.bb = this.mc = this.fw = this.R = this.Va = this.Sf = this.Xm = this.Xv = this.oe = this.ed = this.te = this.pf = this.qa = this.g = this.ba = this.la = this.go = this.lh = this.AF = this.dc = this.Al = this.dB = this.yl = this.Wp = this.Gh = this.ck = this.uh = this.pm = null; + this.xa = 0; + } + wvb.prototype = new u7(); + wvb.prototype.constructor = wvb; + d7 = wvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + xvb = this; + Cr(this); + uU(this); + JAa(this); + wb(this); + pb(this); + ki(this); + ida(this); + gda(this); + bM(this); + var a10 = qb(), b10 = F6().Ta; + this.pm = rb(new sb(), a10, G5(b10, "method"), tb(new ub(), vb().Ta, "method", "HTTP method required to invoke the operation", H10())); + a10 = zc(); + b10 = F6().Tb; + this.uh = rb(new sb(), a10, G5(b10, "deprecated"), tb(new ub(), vb().Tb, "deprecated", "Marks the operation as deprecated", H10())); + a10 = qb(); + b10 = F6().Ta; + b10 = G5(b10, "guiSummary"); + var c10 = vb().Ta, e10 = K7(), f10 = F6().Tb; + this.ck = rb(new sb(), a10, b10, tb( + new ub(), + c10, + "gui summary", + "Human readable description of the operation", + J5(e10, new Ib().ha([ic(G5(f10, "description"))])) + )); + a10 = new xc().yd(qb()); + b10 = F6().Ta; + this.Gh = rb(new sb(), a10, G5(b10, "scheme"), tb(new ub(), vb().Ta, "scheme", "URI scheme for the API protocol", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Ta; + this.Wp = rb(new sb(), a10, G5(b10, "accepts"), tb(new ub(), vb().Ta, "accepts", "Media-types accepted in a API request", H10())); + a10 = new xc().yd(qb()); + b10 = F6().Tb; + this.yl = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "media type", "Media types returned by a API response", H10())); + a10 = new xc().yd(Am()); + b10 = F6().Ta; + this.dB = rb( + new sb(), + a10, + G5(b10, "expects"), + tb(new ub(), vb().Ta, "expects", "Request information required by the operation", H10()) + ); + a10 = new xc().yd(Dm()); + b10 = F6().Ta; + this.Al = rb(new sb(), a10, G5(b10, "returns"), tb(new ub(), vb().Ta, "returns", "Response data returned by the operation", H10())); + a10 = new xc().yd(rm2()); + b10 = F6().dc; + this.dc = rb(new sb(), a10, G5(b10, "security"), tb(new ub(), vb().dc, "security", "security schemes applied to an element in the API spec", H10())); + a10 = new xc().yd(am()); + b10 = F6().Ta; + this.AF = rb(new sb(), a10, G5(b10, "callback"), tb( + new ub(), + vb().Ta, + "callback", + "associated callbacks", + H10() + )); + a10 = new xc().yd(Yl()); + b10 = F6().Ta; + this.lh = rb(new sb(), a10, G5(b10, "server"), tb(new ub(), vb().Ta, "server", "server information", H10())); + a10 = new xc().yd(wZ()); + b10 = F6().Jb; + this.go = rb(new sb(), a10, G5(b10, "binding"), tb(new ub(), vb().Jb, "binding", "Bindings for this operation", H10())); + this.la = this.pm; + a10 = F6().Ta; + a10 = G5(a10, "Operation"); + b10 = nc().ba; + this.ba = ji(a10, b10); + ii(); + a10 = [this.pm, this.R, this.Va, this.uh, this.ck, this.Sf, this.Gh, this.Wp, this.yl, this.dB, this.Al, this.dc, this.Xm, this.AF, this.lh, this.go, this.Xv]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = db().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Operation", "Action that can be executed using a particular HTTP invocation", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.K_ = function(a10) { + this.Xv = a10; + }; + d7.A_ = function(a10) { + this.fw = a10; + }; + d7.nc = function() { + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Ql().K(new S6().a(), a10); + }; + d7.rS = function(a10) { + this.Xm = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ y_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.OperationModel$", { y_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, EY: 1, nm: 1, sk: 1, Zu: 1, UY: 1, r7: 1, mm: 1 }); + var xvb = void 0; + function Pl() { + xvb || (xvb = new wvb().a()); + return xvb; + } + function p9() { + Lk.call(this); + this.ac = null; + } + p9.prototype = new Itb(); + p9.prototype.constructor = p9; + d7 = p9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + p9.prototype.LK.call(this, new ol().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.ac; + }; + d7.LK = function(a10) { + this.ac = a10; + pl.prototype.LK.call(this, a10); + return this; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.iR = function() { + return this.ac; + }; + p9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(p9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + p9.prototype.$classData = r8({ y6a: 0 }, false, "webapi.WebApiAnnotationTypeDeclaration", { y6a: 1, jga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function q9() { + Lk.call(this); + this.ac = null; + } + q9.prototype = new Jtb(); + q9.prototype.constructor = q9; + d7 = q9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + q9.prototype.MK.call(this, new ql().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.MK = function(a10) { + this.ac = a10; + rl.prototype.MK.call(this, a10); + return this; + }; + d7.Be = function() { + return this.ac; + }; + d7.qk = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.jR = function() { + return this.ac; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + q9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(q9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + q9.prototype.$classData = r8({ B6a: 0 }, false, "webapi.WebApiDataType", { B6a: 1, kga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function r9() { + Lk.call(this); + this.ac = null; + } + r9.prototype = new Mtb(); + r9.prototype.constructor = r9; + d7 = r9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + r9.prototype.NK.call(this, new vl().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.kR = function() { + return this.ac; + }; + d7.NK = function(a10) { + this.ac = a10; + wl.prototype.NK.call(this, a10); + return this; + }; + d7.Be = function() { + return this.ac; + }; + d7.qk = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + r9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(r9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + r9.prototype.$classData = r8({ D6a: 0 }, false, "webapi.WebApiDocumentationItem", { D6a: 1, lga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function s9() { + Lk.call(this); + this.ac = null; + } + s9.prototype = new Ntb(); + s9.prototype.constructor = s9; + d7 = s9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + s9.prototype.QG.call(this, new Mk().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.qk = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.QG = function(a10) { + this.ac = a10; + Nk.prototype.QG.call(this, a10); + return this; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.gR = function() { + return this.ac; + }; + s9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(s9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + s9.prototype.$classData = r8({ F6a: 0 }, false, "webapi.WebApiExternalFragment", { F6a: 1, nga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function t9() { + Lk.call(this); + this.ac = null; + } + t9.prototype = new Otb(); + t9.prototype.constructor = t9; + d7 = t9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + t9.prototype.OK.call(this, new xl().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.lR = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.ac; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.OK = function(a10) { + this.ac = a10; + yl.prototype.OK.call(this, a10); + return this; + }; + t9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(t9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + t9.prototype.$classData = r8({ H6a: 0 }, false, "webapi.WebApiNamedExample", { H6a: 1, pga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function u9() { + Lk.call(this); + this.ac = null; + } + u9.prototype = new Ptb(); + u9.prototype.constructor = u9; + d7 = u9.prototype; + d7.$k = function() { + return this.ac; + }; + d7.Sv = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Q$ = function(a10, b10) { + u9.prototype.Yz.call(this, Tf(Uf(), (PH(), PH().Um(), a10.k), b10)); + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.S$ = function(a10, b10) { + u9.prototype.Yz.call(this, Tf(Uf(), (PH(), PH().Um(), a10.k), b10)); + }; + d7.qk = function() { + return this.ac; + }; + d7.Yz = function(a10) { + this.ac = a10; + ul.prototype.Yz.call(this, a10); + return this; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.T$ = function(a10, b10) { + u9.prototype.Yz.call(this, Tf(Uf(), (PH(), PH().Um(), a10.k), b10)); + }; + u9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(u9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + u9.prototype.$classData = r8({ K6a: 0 }, false, "webapi.WebApiPayloadFragment", { K6a: 1, rga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function v9() { + Lk.call(this); + this.ac = null; + } + v9.prototype = new Qtb(); + v9.prototype.constructor = v9; + d7 = v9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + v9.prototype.PK.call(this, new zl().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.mR = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.qk = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.PK = function(a10) { + this.ac = a10; + Al.prototype.PK.call(this, a10); + return this; + }; + v9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(v9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + v9.prototype.$classData = r8({ L6a: 0 }, false, "webapi.WebApiResourceTypeFragment", { L6a: 1, sga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function w9() { + Lk.call(this); + this.ac = null; + } + w9.prototype = new Rtb(); + w9.prototype.constructor = w9; + d7 = w9.prototype; + d7.nR = function() { + return this.ac; + }; + d7.QK = function(a10) { + this.ac = a10; + Cl.prototype.QK.call(this, a10); + return this; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(); + w9.prototype.QK.call(this, new Bl().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.ac; + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + w9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(w9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + w9.prototype.$classData = r8({ M6a: 0 }, false, "webapi.WebApiSecuritySchemeFragment", { M6a: 1, tga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function x9() { + Lk.call(this); + this.ac = null; + } + x9.prototype = new Stb(); + x9.prototype.constructor = x9; + d7 = x9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + x9.prototype.RK.call(this, new Dl().K(new S6().a(), a10)); + return this; + }; + d7.$k = function() { + return this.ac; + }; + d7.RK = function(a10) { + this.ac = a10; + El.prototype.RK.call(this, a10); + return this; + }; + d7.Be = function() { + return this.ac; + }; + d7.qk = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.yp = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + d7.oR = function() { + return this.ac; + }; + x9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(x9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + x9.prototype.$classData = r8({ N6a: 0 }, false, "webapi.WebApiTraitFragment", { N6a: 1, uga: 1, xq: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function zj(a10) { + return XG(a10) ? a10.mb().$a() : a10.lb(0); + } + function y9(a10, b10) { + return a10.Oa() - b10 | 0; + } + function z9(a10, b10) { + if (b10 && b10.$classData && b10.$classData.ge.bo) { + var c10 = a10.Oa(); + if (c10 === b10.Oa()) { + for (var e10 = 0; e10 < c10 && Va(Wa(), a10.lb(e10), b10.lb(e10)); ) + e10 = 1 + e10 | 0; + return e10 === c10; + } + return false; + } + return M8(a10, b10); + } + function A9(a10, b10) { + return yvb(a10, b10, false) !== a10.Oa(); + } + function Wv(a10) { + for (var b10 = -1 + a10.Oa() | 0, c10 = H10(); 0 <= b10; ) { + var e10 = a10.lb(b10); + c10 = ji(e10, c10); + b10 = -1 + b10 | 0; + } + return c10; + } + function XG(a10) { + return 0 === a10.Oa(); + } + function yvb(a10, b10, c10) { + for (var e10 = 0; e10 < a10.Oa() && !!b10.P(a10.lb(e10)) === c10; ) + e10 = 1 + e10 | 0; + return e10; + } + function B9(a10, b10) { + return a10.Rk(C9(a10, b10, 0)); + } + function D9(a10, b10) { + return yvb(a10, b10, true) === a10.Oa(); + } + function Fca(a10) { + return 0 < a10.Oa() ? a10.np(0, -1 + a10.Oa() | 0) : a10.Mr(); + } + function E9(a10, b10) { + for (var c10 = 0, e10 = a10.Oa(); c10 < e10; ) + b10.P(a10.lb(c10)), c10 = 1 + c10 | 0; + } + function F9(a10, b10, c10) { + c10 = 0 < c10 ? c10 : 0; + for (var e10 = a10.Oa(), f10 = c10; ; ) { + if (f10 < e10) { + var g10 = a10.lb(f10); + g10 = !b10.P(g10); + } else + g10 = false; + if (g10) + f10 = 1 + f10 | 0; + else + break; + } + b10 = c10 + (f10 - c10 | 0) | 0; + return b10 >= a10.Oa() ? -1 : b10; + } + function G9(a10, b10) { + return a10.Jk(C9(a10, b10, 0)); + } + function H9(a10, b10, c10) { + b10 = 0 < b10 ? b10 : 0; + c10 = 0 < c10 ? c10 : 0; + var e10 = a10.Oa(); + c10 = c10 < e10 ? c10 : e10; + e10 = c10 - b10 | 0; + var f10 = 0 < e10 ? e10 : 0; + e10 = a10.Qd(); + for (e10.pj(f10); b10 < c10; ) + e10.jd(a10.lb(b10)), b10 = 1 + b10 | 0; + return e10.Rc(); + } + function zvb(a10) { + var b10 = a10.Qd(); + b10.pj(a10.Oa()); + for (var c10 = a10.Oa(); 0 < c10; ) + c10 = -1 + c10 | 0, b10.jd(a10.lb(c10)); + return b10.Rc(); + } + function I9(a10, b10) { + for (var c10 = a10.Oa(), e10 = 0; ; ) { + if (e10 < c10) { + var f10 = a10.lb(e10); + f10 = !b10.P(f10); + } else + f10 = false; + if (f10) + e10 = 1 + e10 | 0; + else + break; + } + b10 = e10; + return b10 < a10.Oa() ? new z7().d(a10.lb(b10)) : y7(); + } + function J9(a10, b10) { + return a10.Sr(C9(a10, b10, 0)); + } + function K9(a10, b10) { + b10 = b10.en(a10.Zi()); + var c10 = a10.Oa(); + b10.pj(c10); + for (var e10 = 0; e10 < c10; ) + b10.jd(new R6().M(a10.lb(e10), e10)), e10 = 1 + e10 | 0; + return b10.Rc(); + } + function L9(a10, b10, c10, e10) { + for (; ; ) { + if (0 === b10) + return c10; + var f10 = -1 + b10 | 0; + c10 = e10.ug(a10.lb(-1 + b10 | 0), c10); + b10 = f10; + } + } + function w32(a10, b10) { + return new R6().M(a10.Jk(b10), a10.Rk(b10)); + } + function Oc(a10) { + return 0 < a10.Oa() ? a10.lb(-1 + a10.Oa() | 0) : a10.Nr(); + } + function M9(a10, b10, c10, e10) { + var f10 = 0; + for (; ; ) { + if (f10 === b10) + return c10; + var g10 = 1 + f10 | 0; + c10 = e10.ug(c10, a10.lb(f10)); + f10 = g10; + } + } + function bi(a10) { + return XG(a10) ? a10.Or() : a10.np(1, a10.Oa()); + } + function N9(a10, b10, c10, e10) { + var f10 = 0, g10 = c10, h10 = a10.Oa(); + e10 = h10 < e10 ? h10 : e10; + c10 = SJ(W5(), b10) - c10 | 0; + for (c10 = e10 < c10 ? e10 : c10; f10 < c10; ) + aAa(W5(), b10, g10, a10.lb(f10)), f10 = 1 + f10 | 0, g10 = 1 + g10 | 0; + } + function C9(a10, b10, c10) { + for (var e10 = a10.Oa(), f10 = c10; f10 < e10 && b10.P(a10.lb(f10)); ) + f10 = 1 + f10 | 0; + return f10 - c10 | 0; + } + function Uu(a10, b10) { + a10 = a10.V9(b10); + if (0 > b10 || a10.b()) + throw new U6().e("" + b10); + return a10.ga(); + } + function Tu(a10, b10) { + if (0 > b10) + b10 = 1; + else + a: { + var c10 = 0; + for (; ; ) { + if (c10 === b10) { + b10 = a10.b() ? 0 : 1; + break a; + } + if (a10.b()) { + b10 = -1; + break a; + } + c10 = 1 + c10 | 0; + a10 = a10.ta(); + } + } + return b10; + } + function Avb(a10, b10) { + for (; !a10.b(); ) { + if (b10.P(a10.ga())) + return true; + a10 = a10.ta(); + } + return false; + } + function Bvb(a10, b10) { + if (b10 && b10.$classData && b10.$classData.ge.kW) { + if (a10 === b10) + return true; + for (; !a10.b() && !b10.b() && Va(Wa(), a10.ga(), b10.ga()); ) + a10 = a10.ta(), b10 = b10.ta(); + return a10.b() && b10.b(); + } + return M8(a10, b10); + } + function Cvb(a10, b10) { + for (; !a10.b(); ) { + if (!b10.P(a10.ga())) + return false; + a10 = a10.ta(); + } + return true; + } + function Dvb(a10, b10, c10) { + for (; !a10.b(); ) + b10 = c10.ug(b10, a10.ga()), a10 = a10.ta(); + return b10; + } + function Evb(a10, b10, c10) { + var e10 = 0 < c10 ? c10 : 0; + for (a10 = a10.V9(c10); ; ) + if (tc(a10)) { + if (b10.P(a10.ga())) + return e10; + e10 = 1 + e10 | 0; + a10 = a10.ta(); + } else + break; + return -1; + } + function Fvb(a10, b10) { + for (; !a10.b(); ) { + if (b10.P(a10.ga())) + return new z7().d(a10.ga()); + a10 = a10.ta(); + } + return y7(); + } + function Eq(a10) { + for (var b10 = 0; !a10.b(); ) + b10 = 1 + b10 | 0, a10 = a10.ta(); + return b10; + } + function lia(a10) { + if (a10.b()) + throw new iL().a(); + for (var b10 = a10.ta(); !b10.b(); ) + a10 = b10, b10 = b10.ta(); + return a10.ga(); + } + function Cg(a10, b10) { + for (; !a10.b(); ) { + if (Va(Wa(), a10.ga(), b10)) + return true; + a10 = a10.ta(); + } + return false; + } + function Gvb(a10, b10) { + return 0 <= b10 && 0 < Tu(a10, b10); + } + function Hvb(a10) { + var b10 = new Xj().ue(a10.jb()); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return pr(e10, f10); + }; + }(a10, b10))); + return b10; + } + function kz(a10) { + if (a10.b()) + return ue4().t8.pJ; + ue4(); + var b10 = new jG().a(); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.jd(f10); + }; + }(a10, b10))); + return lG(b10); + } + function Ivb(a10, b10) { + return b10.Hd().Ql(a10, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return c10.Zj(e10); + }; + }(a10))); + } + function Jvb(a10) { + var b10 = new Ej().a(); + try { + return a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + throw new nz().M(e10, new z7().d(f10)); + }; + }(a10, b10))), y7(); + } catch (c10) { + if (c10 instanceof nz) { + a10 = c10; + if (a10.Aa === b10) + return a10.Dt(); + throw a10; + } + throw c10; + } + } + function Kvb(a10) { + var b10 = new Uj().eq(true), c10 = new qd().d(null); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + f10.oa = false; + g10.oa = h10; + }; + }(a10, b10, c10))); + if (b10.oa) + throw new iL().e("last of empty traversable"); + return c10.oa; + } + function Zm() { + Xm.call(this); + this.ac = null; + } + Zm.prototype = new Rqb(); + Zm.prototype.constructor = Zm; + function Lvb() { + } + d7 = Lvb.prototype = Zm.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Zm.prototype.WG.call(this, new th().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "ArrayShape"; + }; + d7.Ce = function() { + return this.ac; + }; + d7.WG = function(a10) { + this.ac = a10; + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.E = function() { + return 1; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof Zm) { + var b10 = this.ac; + a10 = a10.ac; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.Oc = function() { + return this.ac; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ac; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Jh = function() { + return this.ac; + }; + d7.Kf = function() { + return Mvb(this); + }; + d7.Gj = function() { + return Mvb(this); + }; + d7.L4 = function() { + Z10(); + var a10 = B6(this.ac.aa, uh().Ff); + return t1(Z10().Bg(), a10); + }; + d7.oc = function() { + return this.ac; + }; + function Mvb(a10) { + a10 = a10.ac; + O7(); + var b10 = new P6().a(); + b10 = new th().K(new S6().a(), b10); + return new Zm().WG(Rd(b10, a10.j)); + } + d7.z = function() { + return X5(this); + }; + d7.uE = function() { + return Mvb(this); + }; + d7.Yea = function(a10) { + ZA(this.ac, (Z10(), Z10().Bg(), a10.Ce())); + return this; + }; + d7.sfa = function(a10) { + return this.Yea(a10); + }; + Zm.prototype.withContains = function(a10) { + var b10 = this.ac; + a10 = (Z10(), Z10().Bg(), a10.Ce()); + var c10 = uh().CX; + Vd(b10, c10, a10); + return this; + }; + Zm.prototype.withItems = function(a10) { + return this.sfa(a10); + }; + Object.defineProperty(Zm.prototype, "contains", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, uh().CX); + return t1(Z10().Bg(), a10); + }, configurable: true }); + Object.defineProperty(Zm.prototype, "items", { get: function() { + return this.L4(); + }, configurable: true }); + Zm.prototype.$classData = r8({ wga: 0 }, false, "amf.client.model.domain.ArrayShape", { wga: 1, xga: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function Go() { + this.ea = this.k = null; + } + Go.prototype = new u7(); + Go.prototype.constructor = Go; + d7 = Go.prototype; + d7.H = function() { + return "DynamicBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Go.prototype.Hla.call(this, new Eo().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Go ? this.k === a10.k : false; + }; + function Nvb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Eo().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().RX && null === Z10().RX) { + c10 = Z10(); + var e10 = new g0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.RX = e10; + } + b10 = Z10().RX; + return xu(b10.l.ea, a10); + } + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.Hla = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.jF = function() { + Z10(); + var a10 = B6(this.k.g, Do().Hf); + Z10().cb(); + return gb(a10); + }; + d7.Kf = function() { + return Nvb(this); + }; + d7.EC = function(a10) { + var b10 = this.k, c10 = Do().Hf; + eb(b10, c10, a10); + return this; + }; + d7.Gj = function() { + return Nvb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Go.prototype.annotations = function() { + return this.rb(); + }; + Go.prototype.graph = function() { + return jU(this); + }; + Go.prototype.withId = function(a10) { + return this.$b(a10); + }; + Go.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Go.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Go.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Go.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Go.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Go.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Go.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Go.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Go.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Go.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Go.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Go.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Go.prototype.linkCopy = function() { + return this.Kf(); + }; + Go.prototype.withType = function(a10) { + return this.EC(a10); + }; + Go.prototype.withDefinition = function(a10) { + var b10 = this.k; + Z10(); + Z10().Um(); + a10 = a10.k; + var c10 = Do().JX; + Vd(b10, c10, a10); + return this; + }; + Object.defineProperty(Go.prototype, "type", { get: function() { + return this.jF(); + }, configurable: true }); + Object.defineProperty(Go.prototype, "definition", { get: function() { + Z10(); + var a10 = B6(this.k.g, Do().JX); + return fl(Z10().Um(), a10); + }, configurable: true }); + Go.prototype.$classData = r8({ zua: 0 }, false, "amf.client.model.domain.DynamicBinding", { zua: 1, f: 1, zga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, LR: 1, W6: 1, KR: 1, y: 1, v: 1, q: 1, o: 1 }); + function Io() { + this.ea = this.k = null; + } + Io.prototype = new u7(); + Io.prototype.constructor = Io; + d7 = Io.prototype; + d7.H = function() { + return "EmptyBinding"; + }; + d7.a = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + Io.prototype.Ila.call(this, new Ho().K(b10, a10)); + return this; + }; + d7.zg = function() { + return $a(this); + }; + d7.Ng = function(a10) { + return cb(this, a10); + }; + d7.E = function() { + return 1; + }; + d7.Zb = function(a10) { + return lU(this, a10); + }; + d7.Oc = function() { + return this.k; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Io ? this.k === a10.k : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.k; + default: + throw new U6().e("" + a10); + } + }; + function Ovb(a10) { + Z10(); + a10 = a10.k; + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new Ho().K(c10, b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().SX && null === Z10().SX) { + c10 = Z10(); + var e10 = new h0(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.SX = e10; + } + b10 = Z10().SX; + return xu(b10.l.ea, a10); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Wb = function() { + return hU(this); + }; + d7.$b = function(a10) { + return iU(this, a10); + }; + d7.jF = function() { + Z10(); + var a10 = B6(this.k.g, Do().Hf); + Z10().cb(); + return gb(a10); + }; + d7.Kf = function() { + return Ovb(this); + }; + d7.EC = function(a10) { + var b10 = this.k, c10 = Do().Hf; + eb(b10, c10, a10); + return this; + }; + d7.Gj = function() { + return Ovb(this); + }; + d7.Mg = function(a10) { + return hb(this, a10); + }; + d7.rb = function() { + return So(this); + }; + d7.Yb = function(a10) { + return nU(this, a10); + }; + d7.Ila = function(a10) { + this.k = a10; + this.ea = nv().ea; + return this; + }; + d7.Ab = function() { + return this.k.j; + }; + d7.oc = function() { + return this.k; + }; + d7.z = function() { + return X5(this); + }; + d7.Og = function(a10) { + return ib(this, a10); + }; + Io.prototype.annotations = function() { + return this.rb(); + }; + Io.prototype.graph = function() { + return jU(this); + }; + Io.prototype.withId = function(a10) { + return this.$b(a10); + }; + Io.prototype.withExtendsNode = function(a10) { + return this.Zb(a10); + }; + Io.prototype.withCustomDomainProperties = function(a10) { + return this.Yb(a10); + }; + Object.defineProperty(Io.prototype, "position", { get: function() { + return this.Wb(); + }, configurable: true }); + Object.defineProperty(Io.prototype, "id", { get: function() { + return this.Ab(); + }, configurable: true }); + Object.defineProperty(Io.prototype, "extendsNode", { get: function() { + return fU(this); + }, configurable: true }); + Object.defineProperty(Io.prototype, "customDomainProperties", { get: function() { + return gU(this); + }, configurable: true }); + Io.prototype.link = function() { + for (var a10 = arguments.length | 0, b10 = 0, c10 = []; b10 < a10; ) + c10.push(arguments[b10]), b10 = b10 + 1 | 0; + a10 = void 0 === c10[0] ? y7() : c10[0]; + return this.Mg(a10); + }; + Io.prototype.withLinkLabel = function(a10) { + return this.Ng(a10); + }; + Io.prototype.withLinkTarget = function(a10) { + return this.Og(a10); + }; + Object.defineProperty(Io.prototype, "linkLabel", { get: function() { + return fb(this); + }, configurable: true }); + Object.defineProperty(Io.prototype, "isLink", { get: function() { + return Ya(this); + }, configurable: true }); + Object.defineProperty(Io.prototype, "linkTarget", { get: function() { + return this.zg(); + }, configurable: true }); + Io.prototype.linkCopy = function() { + return this.Kf(); + }; + Io.prototype.withType = function(a10) { + return this.EC(a10); + }; + Object.defineProperty(Io.prototype, "type", { get: function() { + return this.jF(); + }, configurable: true }); + Io.prototype.$classData = r8({ Aua: 0 }, false, "amf.client.model.domain.EmptyBinding", { Aua: 1, f: 1, zga: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, LR: 1, W6: 1, KR: 1, y: 1, v: 1, q: 1, o: 1 }); + function bn() { + Xm.call(this); + this.ac = null; + } + bn.prototype = new Rqb(); + bn.prototype.constructor = bn; + d7 = bn.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + bn.prototype.rla.call(this, new qi().K(new S6().a(), a10)); + return this; + }; + d7.H = function() { + return "TupleShape"; + }; + d7.Ce = function() { + return this.ac; + }; + d7.E = function() { + return 1; + }; + d7.Oc = function() { + return this.ac; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof bn) { + var b10 = this.ac; + a10 = a10.ac; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.ac; + default: + throw new U6().e("" + a10); + } + }; + function Pvb(a10) { + Z10(); + a10 = a10.ac; + O7(); + var b10 = new P6().a(); + b10 = new qi().K(new S6().a(), b10); + a10 = Rd(b10, a10.j); + b10 = Z10(); + if (null === Z10().h_ && null === Z10().h_) { + var c10 = Z10(), e10 = new z1(); + if (null === b10) + throw mb(E6(), null); + e10.l = b10; + c10.h_ = e10; + } + b10 = Z10().h_; + return xu(b10.l.ea, a10); + } + d7.t = function() { + return V5(W5(), this); + }; + d7.Jh = function() { + return this.ac; + }; + d7.Kf = function() { + return Pvb(this); + }; + d7.rla = function(a10) { + this.ac = a10; + Xm.prototype.Gw.call(this, a10); + return this; + }; + d7.Gj = function() { + return Pvb(this); + }; + d7.L4 = function() { + var a10 = Z10(), b10 = B6(this.ac.aa, an().$p), c10 = Z10().Bg(); + return Ak(a10, b10, c10).Ra(); + }; + d7.oc = function() { + return this.ac; + }; + d7.z = function() { + return X5(this); + }; + d7.uE = function() { + return Pvb(this); + }; + Object.defineProperty(bn.prototype, "additionalItemsSchema", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, an().pR); + return t1(Z10().Bg(), a10); + }, configurable: true }); + bn.prototype.withClosedItems = function(a10) { + a10 = !!a10; + var b10 = this.ac, c10 = an().UM; + Bi(b10, c10, a10); + return this; + }; + Object.defineProperty(bn.prototype, "closedItems", { get: function() { + Z10(); + var a10 = B6(this.ac.aa, an().UM); + Z10().yi(); + return yL(a10); + }, configurable: true }); + bn.prototype.withItems = function(a10) { + var b10 = this.ac, c10 = Z10(), e10 = Z10().Bg(); + a10 = uk(tk(c10, a10, e10)); + c10 = an().$p; + Zd(b10, c10, a10); + return this; + }; + Object.defineProperty(bn.prototype, "items", { get: function() { + return this.L4(); + }, configurable: true }); + bn.prototype.$classData = r8({ Fva: 0 }, false, "amf.client.model.domain.TupleShape", { Fva: 1, xga: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function zO() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + zO.prototype = new u7(); + zO.prototype.constructor = zO; + d7 = zO.prototype; + d7.H = function() { + return "Dialect"; + }; + function YMa(a10) { + var b10 = K7(), c10 = [YU(a10)]; + b10 = J5(b10, new Ib().ha(c10)); + c10 = Ltb(a10).ua(); + var e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = Ktb(a10); + e10 = K7(); + b10 = b10.ia(c10, e10.u); + c10 = K7(); + a10 = [Brb(a10)]; + a10 = J5(c10, new Ib().ha(a10)); + c10 = K7(); + return b10.ia(a10, c10.u); + } + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof zO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Gc(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, Gc().xc); + }; + function yrb(a10, b10) { + return Ktb(a10).Ha(iF(fF(), b10)); + } + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return B6(this.g, Gc().Ic); + }; + function Arb(a10, b10) { + return Ltb(a10).Ha(iF(fF(), b10)); + } + function zEa(a10) { + var b10 = B6(a10.g, Gc().R).A; + b10 = b10.b() ? null : b10.c(); + a10 = B6(a10.g, Gc().Ym).A; + return b10 + " " + (a10.b() ? null : a10.c()); + } + function Brb(a10) { + a10 = YU(a10); + a10 = new qg().e(a10); + return "%Patch/" + Wp(a10, "%"); + } + function Ktb(a10) { + var b10 = B6(B6(a10.g, Gc().Pj).g, Hc().My); + a10 = w6(/* @__PURE__ */ function(e10) { + return function(f10) { + fF(); + f10 = B6(f10.g, GO().vx).A; + f10 = f10.b() ? null : f10.c(); + f10 = iF(0, f10); + var g10 = YU(e10); + g10 = new qg().e(g10); + return "%" + f10 + "/" + Wp(g10, "%"); + }; + }(a10)); + var c10 = K7(); + return b10.ka(a10, c10.u); + } + d7.Y = function() { + return this.g; + }; + function YU(a10) { + fF(); + a10 = "%" + zEa(a10); + return iF(0, a10); + } + d7.qe = function() { + return B6(this.g, Gc().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + function Ltb(a10) { + var b10 = Vb(), c10 = B6(a10.g, Gc().Pj); + b10 = b10.Ia(B6(c10.g, Hc().Fx)); + if (b10.b()) + return y7(); + b10.c(); + a10 = YU(a10); + a10 = new qg().e(a10); + return new z7().d("%Library/" + Wp(a10, "%")); + } + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ FGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.Dialect", { FGa: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, TA: 1, kr: 1, e7: 1, y: 1, v: 1, q: 1, o: 1 }); + function y32() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + y32.prototype = new u7(); + y32.prototype.constructor = y32; + d7 = y32.prototype; + d7.H = function() { + return "DialectInstanceFragment"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof y32 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return Fbb(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, qO().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return B6(this.g, qO().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + Cba(); + return this; + }; + d7.$classData = r8({ IGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectInstanceFragment", { IGa: 1, f: 1, OY: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, kr: 1, Xga: 1, y: 1, v: 1, q: 1, o: 1 }); + function x32() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + x32.prototype = new u7(); + x32.prototype.constructor = x32; + d7 = x32.prototype; + d7.H = function() { + return "DialectInstanceLibrary"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof x32 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return xrb(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, qO().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return B6(this.g, qO().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + Cba(); + return this; + }; + d7.$classData = r8({ JGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectInstanceLibrary", { JGa: 1, f: 1, OY: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, TA: 1, Xga: 1, y: 1, v: 1, q: 1, o: 1 }); + function wO() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + wO.prototype = new u7(); + wO.prototype.constructor = wO; + d7 = wO.prototype; + d7.H = function() { + return "DialectInstancePatch"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof wO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return UDa(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, qO().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + return d22(this, a10, b10, c10); + }; + d7.tk = function() { + return B6(this.g, qO().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return B6(this.g, qO().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + return this; + }; + d7.$classData = r8({ KGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectInstancePatch", { KGa: 1, f: 1, OY: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, TA: 1, kr: 1, y: 1, v: 1, q: 1, o: 1 }); + function ze2() { + this.Ts = this.at = this.R = this.x = this.g = null; + this.Ie = this.Gd = false; + this.j = this.Ke = this.sf = this.jf = this.Re = this.uf = null; + this.xa = false; + } + ze2.prototype = new u7(); + ze2.prototype.constructor = ze2; + d7 = ze2.prototype; + d7.H = function() { + return "UnionNodeMapping"; + }; + d7.Zk = function(a10) { + this.uf = a10; + }; + d7.E = function() { + return 2; + }; + d7.D_ = function(a10) { + this.R = a10; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.dk = function() { + }; + d7.Fk = function(a10) { + this.Re = a10; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof ze2 ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new ze2().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return Ae4(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ok = function(a10) { + this.Gd = a10; + }; + d7.Ik = function() { + return this.Gd; + }; + d7.dd = function() { + var a10 = B6(this.g, this.R).A; + a10 = a10.b() ? null : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.kk = function(a10, b10, c10, e10) { + return jM(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yb(this); + }; + d7.Ug = function(a10, b10) { + return kM(this, a10, b10); + }; + d7.KN = function(a10) { + this.at = a10; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new ze2().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.g; + }; + d7.Ek = function(a10) { + this.sf = a10; + }; + d7.JN = function(a10) { + this.Ts = a10; + }; + d7.gj = function(a10) { + return Az(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.Dk = function(a10) { + this.jf = a10; + }; + d7.xk = function(a10) { + this.Ie = a10; + }; + d7.Zea = function(a10) { + return eb(this, this.R, a10); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + lM(this); + ud(this); + Aba(this); + return this; + }; + d7.$classData = r8({ sHa: 0 }, false, "amf.plugins.document.vocabularies.model.domain.UnionNodeMapping", { sHa: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, Yga: 1, PR: 1, gHa: 1, Zga: 1, d7: 1, y: 1, v: 1, q: 1, o: 1 }); + function oR() { + l9.call(this); + this.gr = this.Nl = this.$h = this.um = null; + } + oR.prototype = new evb(); + oR.prototype.constructor = oR; + d7 = oR.prototype; + d7.il = function(a10, b10, c10, e10, f10, g10, h10) { + this.um = f10; + l9.prototype.il.call(this, a10, b10, c10, e10, g10, f10, h10); + this.$h = new KW().ss(this); + a10 = new LEa(); + a10.Pe = Rb(Gb().ab, H10()); + this.Nl = a10; + this.gr = Vf(); + return this; + }; + d7.Gg = function() { + return this.gr; + }; + d7.Hp = function() { + return this.um; + }; + d7.TS = function(a10) { + return new oR().il(this.qh, this.Df, this.qQ, new z7().d(a10), this.um, y7(), iA().ho); + }; + d7.$classData = r8({ CJa: 0 }, false, "amf.plugins.document.webapi.contexts.PayloadContext", { CJa: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function uB() { + l9.call(this); + this.Nl = this.gr = this.$h = this.um = null; + } + uB.prototype = new evb(); + uB.prototype.constructor = uB; + function Qvb() { + } + d7 = Qvb.prototype = uB.prototype; + d7.il = function(a10, b10, c10, e10, f10, g10, h10) { + this.um = g10; + l9.prototype.il.call(this, a10, b10, c10, e10, f10, g10, h10); + this.$h = new vOa().ss(this); + this.gr = Qb(); + JQa || (JQa = new pY().a()); + this.Nl = JQa; + return this; + }; + d7.hqa = function() { + return false; + }; + d7.Gg = function() { + return this.gr; + }; + d7.Hp = function() { + return this.um; + }; + d7.TS = function(a10) { + var b10 = this.qh, c10 = this.Df, e10 = this.qQ; + a10 = new z7().d(a10); + var f10 = this.um, g10 = y7(), h10 = iA().ho; + return new uB().il(b10, c10, e10, a10, g10, f10, h10); + }; + d7.$classData = r8({ fha: 0 }, false, "amf.plugins.document.webapi.contexts.Raml08WebApiContext", { fha: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function hA() { + l9.call(this); + this.Nl = this.gr = this.$h = this.um = null; + } + hA.prototype = new evb(); + hA.prototype.constructor = hA; + function Rvb() { + } + d7 = Rvb.prototype = hA.prototype; + d7.Yqa = function() { + return this.qQ; + }; + d7.il = function(a10, b10, c10, e10, f10, g10, h10) { + this.um = g10; + l9.prototype.il.call(this, a10, b10, c10, e10, f10, g10, h10); + this.$h = new KW().ss(this); + this.gr = Pb(); + KQa || (KQa = new qY().a()); + this.Nl = KQa; + return this; + }; + d7.Gg = function() { + return this.gr; + }; + d7.Hp = function() { + return this.um; + }; + d7.TS = function(a10) { + var b10 = this.qh, c10 = this.Df, e10 = this.Yqa(); + a10 = new z7().d(a10); + var f10 = this.um, g10 = y7(), h10 = iA().ho; + return new hA().il(b10, c10, e10, a10, g10, f10, h10); + }; + d7.$classData = r8({ h7: 0 }, false, "amf.plugins.document.webapi.contexts.Raml10WebApiContext", { h7: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function Fl() { + mf.call(this); + this.uS = this.KT = null; + } + Fl.prototype = new dvb(); + Fl.prototype.constructor = Fl; + d7 = Fl.prototype; + d7.bc = function() { + return qea(); + }; + d7.fa = function() { + return this.uS; + }; + d7.Y = function() { + return this.KT; + }; + d7.K = function(a10, b10) { + this.KT = a10; + this.uS = b10; + mf.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ mKa: 0 }, false, "amf.plugins.document.webapi.model.Extension", { mKa: 1, vza: 1, Z6: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, TA: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hl() { + mf.call(this); + this.uS = this.KT = null; + } + Hl.prototype = new dvb(); + Hl.prototype.constructor = Hl; + d7 = Hl.prototype; + d7.bc = function() { + return rea(); + }; + d7.fa = function() { + return this.uS; + }; + d7.Y = function() { + return this.KT; + }; + d7.K = function(a10, b10) { + this.KT = a10; + this.uS = b10; + mf.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ oKa: 0 }, false, "amf.plugins.document.webapi.model.Overlay", { oKa: 1, vza: 1, Z6: 1, f: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, kr: 1, TA: 1, y: 1, v: 1, q: 1, o: 1 }); + function pP() { + en.call(this); + this.ys = this.se = this.Xn = null; + } + pP.prototype = new unb(); + pP.prototype.constructor = pP; + d7 = pP.prototype; + d7.H = function() { + return "ErrorNamedExample"; + }; + d7.sH = function() { + return this.ys; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof pP && this.Xn === a10.Xn) { + var b10 = this.se; + a10 = a10.se; + return null === b10 ? null === a10 : b10.h(a10); + } + return false; + }; + d7.pc = function(a10) { + return pU(this, a10); + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Xn; + case 1: + return this.se; + default: + throw new U6().e("" + a10); + } + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Tq = function(a10, b10) { + this.Xn = a10; + this.se = b10; + en.prototype.K.call(this, new S6().a(), Od(O7(), b10)); + this.ys = "http://amferror.com/#errorNamedExample/"; + pU(this, a10); + return this; + }; + d7.cG = function(a10) { + return Rd(this, a10); + }; + d7.z = function() { + return X5(this); + }; + d7.$classData = r8({ sLa: 0 }, false, "amf.plugins.document.webapi.parser.spec.WebApiDeclarations$ErrorNamedExample", { sLa: 1, Bha: 1, f: 1, xh: 1, qd: 1, vc: 1, tc: 1, rg: 1, Zv: 1, KLa: 1, JF: 1, y: 1, v: 1, q: 1, o: 1 }); + function Svb() { + o9.call(this); + this.sG = this.Kv = null; + } + Svb.prototype = new pvb(); + Svb.prototype.constructor = Svb; + d7 = Svb.prototype; + d7.a = function() { + o9.prototype.a.call(this); + Tvb = this; + ii(); + var a10 = F6().Eb; + a10 = [G5(a10, "ArrayShape")]; + for (var b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.Kv = a10.ia(b10, c10.u); + this.sG = tb(new ub(), vb().Eb, "Array Shape", "Shape that contains a nested collection of data shapes", H10()); + return this; + }; + d7.jc = function() { + return this.sG; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new th().K(new S6().a(), a10); + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new th().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.Kv; + }; + d7.$classData = r8({ mYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.ArrayShapeModel$", { mYa: 1, zha: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var Tvb = void 0; + function uh() { + Tvb || (Tvb = new Svb().a()); + return Tvb; + } + function Uvb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.YS = this.av = this.Fn = this.xx = this.yx = this.vj = this.wj = this.Aq = this.Cq = this.zl = this.qa = this.ba = this.g = this.Po = this.OA = null; + this.xa = 0; + } + Uvb.prototype = new u7(); + Uvb.prototype.constructor = Uvb; + d7 = Uvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + Vvb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + Hca(this); + var a10 = new xc().yd(qb()), b10 = F6().Eb; + this.OA = rb(new sb(), a10, G5(b10, "fileType"), tb(new ub(), vb().Eb, "file type", "Type of file described by this shape", H10())); + ii(); + a10 = [this.OA]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = this.YS; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "FileShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "File Shape", "Shape describing data uploaded in an API request", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Nia = function(a10) { + this.Aq = a10; + }; + d7.Mia = function(a10) { + this.Fn = a10; + }; + d7.Lia = function(a10) { + this.yx = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.Kia = function(a10) { + this.xx = a10; + }; + d7.nc = function() { + }; + d7.Sia = function(a10) { + this.zl = a10; + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.Qia = function(a10) { + this.wj = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.Ria = function(a10) { + this.av = a10; + }; + d7.fG = function() { + }; + d7.Pia = function(a10) { + this.Cq = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Oia = function(a10) { + this.vj = a10; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Tia = function(a10) { + this.YS = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Wh().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Wh().K(new S6().a(), a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ qYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.FileShapeModel$", { qYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1, nYa: 1 }); + var Vvb = void 0; + function gn() { + Vvb || (Vvb = new Uvb().a()); + return Vvb; + } + function Wvb() { + o9.call(this); + this.sG = this.Kv = null; + } + Wvb.prototype = new pvb(); + Wvb.prototype.constructor = Wvb; + d7 = Wvb.prototype; + d7.a = function() { + o9.prototype.a.call(this); + Xvb = this; + ii(); + var a10 = F6().Eb; + a10 = G5(a10, "MatrixShape"); + var b10 = F6().Eb; + a10 = [a10, G5(b10, "ArrayShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.Kv = a10.ia(b10, c10.u); + this.sG = tb(new ub(), vb().Eb, "Matrix Shape", "Data shape containing nested multi-dimensional collection shapes", H10()); + return this; + }; + d7.jc = function() { + return this.sG; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new pi().K(new S6().a(), a10); + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new pi().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.Kv; + }; + d7.$classData = r8({ rYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.MatrixShapeModel$", { rYa: 1, zha: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var Xvb = void 0; + function xea() { + Xvb || (Xvb = new Wvb().a()); + return Xvb; + } + function Yvb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.YS = this.av = this.Fn = this.xx = this.yx = this.vj = this.wj = this.Aq = this.Cq = this.zl = this.qa = this.ba = this.g = this.Po = this.af = null; + this.xa = 0; + } + Yvb.prototype = new u7(); + Yvb.prototype.constructor = Yvb; + d7 = Yvb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + Zvb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + Hca(this); + var a10 = yc(), b10 = F6().Ua; + this.af = rb(new sb(), a10, G5(b10, "datatype"), tb(new ub(), ci().Ua, "datatype", "Scalar range constraining this scalar shape", H10())); + ii(); + a10 = [this.af]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = this.YS; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "ScalarShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Scalar Shape", "Data shape describing a scalar value in the input data model, reified as an scalar node in the mapped graph", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Nia = function(a10) { + this.Aq = a10; + }; + d7.Mia = function(a10) { + this.Fn = a10; + }; + d7.Lia = function(a10) { + this.yx = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.Kia = function(a10) { + this.xx = a10; + }; + d7.nc = function() { + }; + d7.Sia = function(a10) { + this.zl = a10; + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.Qia = function(a10) { + this.wj = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.Ria = function(a10) { + this.av = a10; + }; + d7.fG = function() { + }; + d7.Pia = function(a10) { + this.Cq = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.Oia = function(a10) { + this.vj = a10; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Tia = function(a10) { + this.YS = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Mh().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Mh().K(new S6().a(), a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ vYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.ScalarShapeModel$", { vYa: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1, nYa: 1 }); + var Zvb = void 0; + function Fg() { + Zvb || (Zvb = new Yvb().a()); + return Zvb; + } + function $vb() { + this.wd = this.bb = this.mc = this.oe = this.ed = this.te = this.pf = this.Va = this.sx = this.tx = this.la = this.uh = this.Zm = this.cl = this.Dn = this.Jn = this.Gn = this.Bi = this.li = this.fi = this.ki = this.xd = this.Vo = this.ch = this.$j = this.Mh = this.Zc = this.R = this.uc = this.xj = this.Rd = this.Ec = this.Sf = this.ir = this.Ln = this.qa = this.ba = this.g = this.Po = this.Nd = null; + this.xa = 0; + } + $vb.prototype = new u7(); + $vb.prototype.constructor = $vb; + d7 = $vb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.eG = function(a10) { + this.Ln = a10; + }; + d7.dG = function(a10) { + this.ir = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + awb = this; + Cr(this); + uU(this); + bM(this); + pb(this); + Y6(this); + aM(this); + mi(this); + ki(this); + c9(this); + var a10 = qb(), b10 = F6().Tb; + this.Nd = rb(new sb(), a10, G5(b10, "mediaType"), tb(new ub(), vb().Tb, "media type", "Media type associated to a shape", H10())); + ii(); + a10 = [this.Nd]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = this.Po = c10; + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + ii(); + a10 = F6().Eb; + a10 = [G5(a10, "SchemaShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.ba = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Eb, "Schema Shape", "Raw schema that cannot be parsed using AMF shapes model", H10()); + return this; + }; + d7.iB = function(a10) { + this.Rd = a10; + }; + d7.wz = function(a10) { + this.cl = a10; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.oz = function(a10) { + this.uh = a10; + }; + d7.nc = function() { + }; + d7.nz = function(a10) { + this.$j = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.fG = function() { + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.zz = function(a10) { + this.Zm = a10; + }; + d7.pz = function(a10) { + this.Zc = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.hB = function(a10) { + this.uc = a10; + }; + d7.Bz = function(a10) { + this.la = a10; + }; + d7.qz = function(a10) { + this.Dn = a10; + }; + d7.sz = function(a10) { + this.xd = a10; + }; + d7.kz = function(a10) { + this.fi = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Gh().K(new S6().a(), a10); + }; + d7.uz = function(a10) { + this.Bi = a10; + }; + d7.rz = function(a10) { + this.Gn = a10; + }; + d7.lz = function(a10) { + this.Vo = a10; + }; + d7.jB = function(a10) { + this.xj = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Az = function(a10) { + this.li = a10; + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new Gh().K(new S6().a(), a10); + }; + d7.yz = function(a10) { + this.ch = a10; + }; + d7.vz = function(a10) { + this.ki = a10; + }; + d7.tz = function(a10) { + this.R = a10; + }; + d7.xz = function(a10) { + this.Jn = a10; + }; + d7.mz = function(a10) { + this.Mh = a10; + }; + d7.$classData = r8({ wYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.SchemaShapeModel$", { wYa: 1, f: 1, hhb: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var awb = void 0; + function pn() { + awb || (awb = new $vb().a()); + return awb; + } + function bwb() { + o9.call(this); + this.sG = this.aa = this.Kv = this.$p = this.pR = this.UM = null; + } + bwb.prototype = new pvb(); + bwb.prototype.constructor = bwb; + d7 = bwb.prototype; + d7.a = function() { + o9.prototype.a.call(this); + cwb = this; + var a10 = zc(), b10 = F6().Eb; + this.UM = rb(new sb(), a10, G5(b10, "closedItems"), tb(new ub(), vb().Eb, "closed items", "Constraint limiting additional shapes in the collection", H10())); + a10 = qf(); + b10 = F6().Eb; + this.pR = rb(new sb(), a10, G5(b10, "additionalItemsSchema"), tb(new ub(), vb().Eb, "additional items schema", "", H10())); + a10 = new UM().yd(qf()); + b10 = F6().Eb; + this.$p = rb(new sb(), a10, G5(b10, "items"), tb(new ub(), vb().Eb, "items", "Shapes contained in the Tuple Shape", H10())); + ii(); + a10 = F6().Eb; + a10 = G5(a10, "TupleShape"); + b10 = F6().Eb; + a10 = [a10, G5(b10, "ArrayShape")]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().ba; + c10 = ii(); + this.Kv = a10.ia(b10, c10.u); + ii(); + a10 = [this.$p, this.Bq, this.pr, this.qr, this.UM, this.pR, this.RC]; + b10 = -1 + (a10.length | 0) | 0; + for (c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = Ag().g; + c10 = ii(); + a10 = a10.ia(b10, c10.u); + b10 = nc().g; + c10 = ii(); + this.aa = a10.ia(b10, c10.u); + this.sG = tb(new ub(), vb().Eb, "Tuple Shape", "Data shape containing a multi-valued collection of shapes", H10()); + return this; + }; + d7.jc = function() { + return this.sG; + }; + d7.Ub = function() { + return this.aa; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new qi().K(new S6().a(), a10); + }; + d7.PB = function() { + O7(); + var a10 = new P6().a(); + return new qi().K(new S6().a(), a10); + }; + d7.Kb = function() { + return this.Kv; + }; + d7.$classData = r8({ xYa: 0 }, false, "amf.plugins.domain.shapes.metamodel.TupleShapeModel$", { xYa: 1, zha: 1, f: 1, iD: 1, Yv: 1, pd: 1, hc: 1, Rb: 1, rc: 1, mm: 1, Oi: 1, sk: 1, Ty: 1, Rt: 1, Zu: 1 }); + var cwb = void 0; + function an() { + cwb || (cwb = new bwb().a()); + return cwb; + } + function vh() { + rf.call(this); + this.XT = this.g3 = this.e3 = this.Xa = this.aa = null; + } + vh.prototype = new jhb(); + vh.prototype.constructor = vh; + function O9() { + } + d7 = O9.prototype = vh.prototype; + d7.yh = function() { + return this.by(); + }; + d7.bc = function() { + return this.uv(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.dd = function() { + var a10 = B6(this.Y(), qf().R).A; + a10 = a10.b() ? "default-any" : a10.c(); + a10 = new je4().e(a10); + return "/any/" + jj(a10.td); + }; + d7.VN = function(a10, b10, c10, e10) { + return Rca(this, a10, b10, c10, e10); + }; + d7.Ib = function() { + return yh(this); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new vh().K(a10, b10); + }; + }(this)); + }; + d7.zv = function() { + return "anyShape"; + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(), b10 = new S6().a(); + a10 = new vh().K(b10, a10); + return Rd(a10, this.j); + }; + function umb(a10) { + if (a10.uv().Kb().h(Ag().ba)) { + var b10 = rt(a10.Y(), w6(/* @__PURE__ */ function() { + return function(c10) { + c10 = c10.ma(); + var e10 = Ag().Ec; + return !(null === c10 ? null === e10 : ra(c10, e10)); + }; + }(a10))).vb; + b10 = tc(b10); + } else + b10 = false; + return b10 ? Ab(a10.fa(), q5(bx)).b() : false; + } + function tmb(a10, b10) { + return B6(a10.Y(), Ag().Ec).Fb(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + var g10 = new Pab().GK(f10, e10); + f10 = f10.fa().hf; + var h10 = Ef().u; + return xs(f10, g10, h10).Da(); + }; + }(a10, b10))); + } + d7.uv = function() { + return Ag(); + }; + d7.qF = function(a10) { + O7(); + var b10 = new P6().a(), c10 = new S6().a(); + b10 = new en().K(c10, b10); + a10.b() || (a10 = a10.c(), O7(), c10 = new P6().a(), Sd(b10, a10, c10)); + a10 = Ag().Ec; + ig(this, a10, b10); + return b10; + }; + d7.K = function(a10, b10) { + this.aa = a10; + this.Xa = b10; + rf.prototype.a.call(this); + this.e3 = J5(oi(), H10()); + this.g3 = J5(oi(), H10()); + this.XT = J5(oi(), H10()); + return this; + }; + function y3a(a10, b10, c10) { + b10 = new vh().K(b10, c10); + return Rd(b10, a10.j); + } + d7.$classData = r8({ Wy: 0 }, false, "amf.plugins.domain.shapes.models.AnyShape", { Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1 }); + function P9() { + Ik.call(this); + this.ac = null; + } + P9.prototype = new zub(); + P9.prototype.constructor = P9; + d7 = P9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + P9.prototype.UG.call(this, new Fl().K(new S6().a(), a10)); + return this; + }; + d7.MC = function() { + return this.ac; + }; + d7.$k = function() { + return this.ac; + }; + d7.LM = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.ac; + }; + d7.Wr = function() { + return this.ac; + }; + d7.UG = function(a10) { + this.ac = a10; + Gl.prototype.UG.call(this, a10); + return this; + }; + d7.oc = function() { + return this.ac; + }; + P9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(P9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + P9.prototype.$classData = r8({ E6a: 0 }, false, "webapi.WebApiExtension", { E6a: 1, mga: 1, eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function Q9() { + Ik.call(this); + this.ac = null; + } + Q9.prototype = new Aub(); + Q9.prototype.constructor = Q9; + d7 = Q9.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + Q9.prototype.VG.call(this, new Hl().K(new S6().a(), a10)); + return this; + }; + d7.MC = function() { + return this.ac; + }; + d7.$k = function() { + return this.ac; + }; + d7.Be = function() { + return this.ac; + }; + d7.Rl = function(a10) { + return V22(this, a10); + }; + d7.qk = function() { + return this.ac; + }; + d7.Wr = function() { + return this.ac; + }; + d7.VG = function(a10) { + this.ac = a10; + Il.prototype.VG.call(this, a10); + return this; + }; + d7.oc = function() { + return this.ac; + }; + d7.MM = function() { + return this.ac; + }; + Q9.prototype.getDeclarationByName = function(a10) { + return this.Rl(a10); + }; + Object.defineProperty(Q9.prototype, "_internal", { get: function() { + return this.$k(); + }, configurable: true }); + Q9.prototype.$classData = r8({ I6a: 0 }, false, "webapi.WebApiOverlay", { I6a: 1, qga: 1, eN: 1, f: 1, dj: 1, qc: 1, gc: 1, ib: 1, bl: 1, Wu: 1, y: 1, v: 1, q: 1, o: 1, aw: 1 }); + function iba(a10, b10) { + var c10 = a10.Ja(b10); + if (y7() === c10) + return a10.f5(b10); + if (c10 instanceof z7) + return c10.i; + throw new x7().d(c10); + } + function dwb(a10) { + var b10 = new Xj().ue(a10.jb()); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return pr(e10, f10); + }; + }(a10, b10))); + return b10; + } + function ewb(a10, b10, c10, e10, f10) { + var g10 = a10.mb(); + a10 = new YB().ou(g10, w6(/* @__PURE__ */ function() { + return function(h10) { + if (null !== h10) { + var k10 = h10.ma(); + h10 = h10.ya(); + return "" + vva(MH(), k10, " -> ") + h10; + } + throw new x7().d(h10); + }; + }(a10))); + return XJ(a10, b10, c10, e10, f10); + } + function xO(a10) { + if (a10.b()) + return ue4().t8.pJ; + ue4(); + var b10 = new jG().a(); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.jd(f10); + }; + }(a10, b10))); + return lG(b10); + } + function R9(a10, b10) { + var c10 = new qd().d(a10); + a10.U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + f10.P(h10) && (g10.oa = g10.oa.wp(h10.ma())); + }; + }(a10, b10, c10))); + return c10.oa; + } + function fwb(a10, b10, c10) { + return a10.lu(b10, oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + return f10.P(g10); + }; + }(a10, c10, b10))); + } + function gwb(a10, b10) { + var c10 = new Uj().eq(false); + a10.Ida().U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + f10.oa || e10.Du().P(h10) || (f10.oa = true); + return f10.oa ? g10.P(h10) : void 0; + }; + }(a10, c10, b10))); + } + function hwb(a10, b10) { + a10.Jda().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return c10.Du().P(f10) ? e10.P(f10) : void 0; + }; + }(a10, b10))); + } + function iwb(a10, b10) { + a10.vpa().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + c10.NB().P(f10).Hd().U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return h10.P(k10); + }; + }(c10, e10))); + }; + }(a10, b10))); + } + function jwb(a10, b10) { + a10.wpa().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.P(c10.NB().P(f10)); + }; + }(a10, b10))); + } + function kwb(a10, b10) { + var c10 = new Ej().a(); + try { + a10.Lda().U(w6(/* @__PURE__ */ function(e10, f10, g10) { + return function(h10) { + if (!e10.Du().P(h10)) + throw h10 = new R62(), nz.prototype.M.call(h10, f10, void 0), h10; + return g10.P(h10); + }; + }(a10, c10, b10))); + } catch (e10) { + if (e10 instanceof nz) + if (a10 = e10, a10.Aa === c10) + a10.Pqa(); + else + throw a10; + else + throw e10; + } + } + function $m() { + Zm.call(this); + } + $m.prototype = new Lvb(); + $m.prototype.constructor = $m; + d7 = $m.prototype; + d7.a = function() { + O7(); + var a10 = new P6().a(); + a10 = new th().K(new S6().a(), a10); + Zm.prototype.WG.call(this, a10); + return this; + }; + d7.WG = function(a10) { + Zm.prototype.WG.call(this, a10); + return this; + }; + d7.Ce = function() { + return this.ac; + }; + d7.Oc = function() { + return this.ac; + }; + d7.Jh = function() { + return this.ac; + }; + d7.oc = function() { + return this.ac; + }; + function lwb(a10, b10) { + if (b10 instanceof Zm) + return Zm.prototype.Yea.call(a10, b10); + throw mb(E6(), new nb().e("Matrix shapes can only accept arrays as items")); + } + d7.Yea = function(a10) { + return lwb(this, a10); + }; + d7.sfa = function(a10) { + return lwb(this, a10); + }; + d7.$classData = r8({ Pua: 0 }, false, "amf.client.model.domain.MatrixShape", { Pua: 1, wga: 1, xga: 1, QA: 1, f: 1, Qy: 1, Pd: 1, qc: 1, gc: 1, ib: 1, uj: 1, ak: 1, y: 1, v: 1, q: 1, o: 1 }); + function pO() { + this.j = this.ea = this.xe = this.Me = this.x = this.g = null; + } + pO.prototype = new u7(); + pO.prototype.constructor = pO; + d7 = pO.prototype; + d7.H = function() { + return "DialectInstance"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10) { + return Ai(this, a10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof pO ? this.g === a10.g ? this.x === a10.x : false : false; + }; + d7.jp = function(a10) { + this.xe = a10; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.g; + case 1: + return this.x; + default: + throw new U6().e("" + a10); + } + }; + d7.pc = function(a10) { + return Rd(this, a10); + }; + d7.bc = function() { + return qO(); + }; + d7.fa = function() { + return this.x; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Io = function(a10) { + this.Me = a10; + }; + d7.dd = function() { + return ""; + }; + d7.Ve = function() { + return B6(this.g, qO().xc); + }; + d7.Md = function(a10) { + return ds(this, a10); + }; + d7.Ib = function() { + return Lc(this); + }; + d7.Qm = function(a10, b10, c10) { + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + return Rk(k10) ? !!h10.P(k10) : false; + }; + }(this, a10)); + b10 = Uc(/* @__PURE__ */ function(g10, h10) { + return function(k10, l10) { + return Rk(k10) ? h10.ug(k10, !!l10) : new z7().d(k10); + }; + }(this, b10)); + c10 = Uc(/* @__PURE__ */ function(g10, h10) { + return function(k10, l10) { + return wXa(h10, k10, l10); + }; + }(this, c10)); + var e10 = J5(DB(), H10()), f10 = vd(); + AXa(this, this, a10, b10, e10, f10, c10); + return this; + }; + d7.tk = function() { + return B6(this.g, qO().Ic); + }; + d7.Y = function() { + return this.g; + }; + d7.qe = function() { + return B6(this.g, qO().nb); + }; + d7.z = function() { + return X5(this); + }; + d7.Sd = function(a10) { + this.j = a10; + }; + d7.K = function(a10, b10) { + this.g = a10; + this.x = b10; + this.ea = nv().ea; + e22(this); + Cba(); + return this; + }; + d7.$classData = r8({ HGa: 0 }, false, "amf.plugins.document.vocabularies.model.document.DialectInstance", { HGa: 1, f: 1, OY: 1, Wo: 1, vc: 1, tc: 1, lm: 1, ib: 1, fJ: 1, TA: 1, kr: 1, Xga: 1, y: 1, v: 1, q: 1, o: 1 }); + function mY() { + hA.call(this); + this.N9 = this.c2 = this.jfa = this.zoa = this.$ma = null; + } + mY.prototype = new Rvb(); + mY.prototype.constructor = mY; + d7 = mY.prototype; + d7.Yqa = function() { + return this.jfa; + }; + d7.pe = function() { + return this.N9; + }; + function GQa(a10, b10, c10, e10, f10, g10) { + var h10 = y7(), k10 = iA().ho; + a10.$ma = b10; + a10.zoa = c10; + a10.jfa = e10; + a10.c2 = g10; + var l10 = y7(); + hA.prototype.il.call(a10, b10, c10, e10, f10, h10, l10, k10); + if (f10 instanceof z7) + b10 = f10.i, g10 = FYa(b10.os, b10.FT, g10, b10.bG(), b10.wG(), b10.xB()); + else if (y7() === f10) + b10 = y7(), c10 = new z7().d(a10), e10 = a10.ni, f10 = Rb(Gb().ab, H10()), h10 = Rb(Gb().ab, H10()), g10 = FYa(f10, h10, g10, b10, c10, e10); + else + throw new x7().d(f10); + a10.N9 = g10; + return a10; + } + d7.TS = function(a10) { + return GQa(new mY(), this.$ma, this.zoa, this.jfa, new z7().d(a10), this.c2); + }; + d7.Dl = function() { + return this.N9; + }; + d7.$classData = r8({ pJa: 0 }, false, "amf.plugins.document.webapi.contexts.ExtensionLikeWebApiContext", { pJa: 1, h7: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function mB() { + vh.call(this); + } + mB.prototype = new O9(); + mB.prototype.constructor = mB; + function mwb() { + } + mwb.prototype = mB.prototype; + mB.prototype.ub = function(a10, b10) { + return Sna(this, a10, b10); + }; + mB.prototype.dd = function() { + var a10 = B6(this.Y(), qf().R).A; + a10 = a10.b() ? "default-array" : a10.c(); + a10 = new je4().e(a10); + return "/array/" + jj(a10.td); + }; + mB.prototype.zv = function() { + return "arrayShape"; + }; + function Sna(a10, b10, c10) { + var e10 = c10.Ha(a10.j); + -1 !== (("" + b10).indexOf("#") | 0) ? Ai(a10, b10) : Ai(a10, b10 + "#/"); + if (!e10 && (b10 = hd(a10.aa, uh().Ff), b10 instanceof z7)) + if (b10 = b10.i.r.r, b10 instanceof rf) { + var f10 = e10 = a10.j, g10 = K7(); + b10.ub(e10 + "/items", c10.yg(f10, g10.u)); + } else if (b10 instanceof $r) + c10 = a10.j + "/itemsTuple" + b10.wb.Oa(), Ai(a10, c10); + else + throw new x7().d(b10); + return a10; + } + function nwb() { + this.wd = this.bb = this.mc = this.Zo = this.Dq = this.Tl = this.Tf = this.Xm = this.Ec = this.Sf = this.Xv = this.R = this.Va = this.oe = this.ed = this.te = this.pf = this.go = this.ck = this.Kn = this.Zc = this.CF = this.Ne = this.la = this.qa = this.ba = this.BF = this.yj = null; + this.xa = 0; + } + nwb.prototype = new u7(); + nwb.prototype.constructor = nwb; + d7 = nwb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + owb = this; + Cr(this); + uU(this); + hda(this); + ida(this); + mi(this); + ki(this); + gda(this); + wb(this); + pb(this); + bM(this); + tsb(this); + var a10 = zc(), b10 = F6().Ta; + this.yj = rb(new sb(), a10, G5(b10, "required"), tb(new ub(), vb().Ta, "required", "", H10())); + a10 = new xc().yd(cj()); + b10 = F6().Ta; + this.BF = rb(new sb(), a10, G5(b10, "cookieParameter"), tb(new ub(), vb().Ta, "cookie parameter", "", H10())); + a10 = F6().Ta; + a10 = G5(a10, "Request"); + b10 = zD().ba; + this.ba = ji(a10, b10); + this.qa = tb(new ub(), vb().Ta, "Request", "Request information for an operation", H10()); + this.la = this.R; + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.b9 = function(a10) { + this.Zo = a10; + }; + d7.U8 = function(a10) { + this.CF = a10; + }; + d7.K_ = function(a10) { + this.Xv = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.nc = function() { + }; + d7.W8 = function(a10) { + this.Ne = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.T8 = function(a10) { + this.go = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + ii(); + for (var a10 = [this.yj, this.Tl, this.Tf, this.Dq, this.Zo, this.BF], b10 = -1 + (a10.length | 0) | 0, c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = zD().g; + c10 = ii(); + return a10.ia(b10, c10.u); + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.X8 = function(a10) { + this.ck = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Z8 = function(a10) { + this.Tf = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Bm().K(new S6().a(), a10); + }; + d7.$8 = function(a10) { + this.Tl = a10; + }; + d7.rS = function(a10) { + this.Xm = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Y8 = function(a10) { + this.Kn = a10; + }; + d7.a9 = function(a10) { + this.Dq = a10; + }; + d7.V8 = function(a10) { + this.Zc = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.$classData = r8({ C_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.RequestModel$", { C_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Dha: 1, Cha: 1, UY: 1, Rt: 1, Zu: 1, r7: 1, nm: 1, sk: 1, mm: 1, Oi: 1 }); + var owb = void 0; + function Am() { + owb || (owb = new nwb().a()); + return owb; + } + function zqa() { + uB.call(this); + } + zqa.prototype = new Qvb(); + zqa.prototype.constructor = zqa; + d7 = zqa.prototype; + d7.a = function() { + var a10 = H10(); + K7(); + pj(); + var b10 = new Lf().a(); + uB.prototype.il.call(this, "", a10, new Aq().zo("", b10.ua(), new Mq().a(), Nq(), y7()), y7(), y7(), y7(), iA().ho); + return this; + }; + d7.Ar = function() { + }; + d7.yB = function(a10, b10) { + return b10; + }; + d7.Ns = function() { + }; + d7.$classData = r8({ t1a: 0 }, false, "amf.plugins.domain.webapi.resolution.CustomRaml08WebApiContext", { t1a: 1, fha: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function Aqa() { + hA.call(this); + } + Aqa.prototype = new Rvb(); + Aqa.prototype.constructor = Aqa; + d7 = Aqa.prototype; + d7.a = function() { + var a10 = H10(); + K7(); + pj(); + var b10 = new Lf().a(); + hA.prototype.il.call(this, "", a10, new Aq().zo("", b10.ua(), new Mq().a(), Nq(), y7()), y7(), y7(), y7(), iA().ho); + return this; + }; + d7.Ar = function() { + }; + d7.yB = function(a10, b10) { + return b10; + }; + d7.Ns = function() { + }; + d7.$classData = r8({ u1a: 0 }, false, "amf.plugins.domain.webapi.resolution.CustomRaml10WebApiContext", { u1a: 1, h7: 1, SR: 1, MF: 1, Xu: 1, f: 1, zq: 1, Zp: 1, Bp: 1, y: 1, v: 1, q: 1, o: 1, LF: 1, ib: 1, RR: 1 }); + function AMa(a10, b10) { + return b10.Hd().Ql(a10, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return c10.cc(e10); + }; + }(a10))); + } + function pwb() { + this.wd = this.bb = this.mc = this.fw = this.Zo = this.Dq = this.Tl = this.Tf = this.Xm = this.Ec = this.Sf = this.Xv = this.R = this.Va = this.oe = this.ed = this.te = this.pf = this.go = this.ck = this.Kn = this.Zc = this.CF = this.Ne = this.qa = this.g = this.ba = this.la = this.nN = this.In = null; + this.xa = 0; + } + pwb.prototype = new u7(); + pwb.prototype.constructor = pwb; + d7 = pwb.prototype; + d7.bn = function(a10) { + this.te = a10; + }; + d7.cn = function(a10) { + this.pf = a10; + }; + d7.a = function() { + qwb = this; + Cr(this); + uU(this); + JAa(this); + hda(this); + ida(this); + mi(this); + ki(this); + gda(this); + wb(this); + pb(this); + bM(this); + tsb(this); + var a10 = qb(), b10 = F6().Ta; + this.In = rb(new sb(), a10, G5(b10, "statusCode"), tb(new ub(), vb().Ta, "status code", "HTTP status code returned by a response", H10())); + a10 = new xc().yd(An()); + b10 = F6().Ta; + this.nN = rb(new sb(), a10, G5(b10, "link"), tb(new ub(), vb().Ta, "links", "Structural definition of links on the source data shape AST", H10())); + this.la = this.In; + a10 = F6().Ta; + a10 = G5(a10, "Response"); + b10 = zD().ba; + this.ba = ji(a10, b10); + ii(); + a10 = [this.In, this.Tf, this.nN]; + b10 = -1 + (a10.length | 0) | 0; + for (var c10 = H10(); 0 <= b10; ) + c10 = ji(a10[b10], c10), b10 = -1 + b10 | 0; + a10 = c10; + b10 = zD().g; + c10 = ii(); + this.g = a10.ia(b10, c10.u); + this.qa = tb(new ub(), vb().Ta, "Response", "Response information for an operation", H10()); + return this; + }; + d7.Ed = function(a10) { + this.bb = a10; + }; + d7.b9 = function(a10) { + this.Zo = a10; + }; + d7.A_ = function(a10) { + this.fw = a10; + }; + d7.U8 = function(a10) { + this.CF = a10; + }; + d7.K_ = function(a10) { + this.Xv = a10; + }; + d7.kw = function(a10) { + this.Sf = a10; + }; + d7.nc = function() { + }; + d7.W8 = function(a10) { + this.Ne = a10; + }; + d7.an = function(a10) { + this.oe = a10; + }; + d7.T8 = function(a10) { + this.go = a10; + }; + d7.jc = function() { + return this.qa; + }; + d7.Ub = function() { + return this.g; + }; + d7.$m = function(a10) { + this.ed = a10; + }; + d7.X8 = function(a10) { + this.ck = a10; + }; + d7.gv = function(a10) { + this.Ec = a10; + }; + d7.Z8 = function(a10) { + this.Tf = a10; + }; + d7.Nk = function(a10) { + this.Va = a10; + }; + d7.lc = function() { + O7(); + var a10 = new P6().a(); + return new Em().K(new S6().a(), a10); + }; + d7.$8 = function(a10) { + this.Tl = a10; + }; + d7.rS = function(a10) { + this.Xm = a10; + }; + d7.Kb = function() { + return this.ba; + }; + d7.Y8 = function(a10) { + this.Kn = a10; + }; + d7.V8 = function(a10) { + this.Zc = a10; + }; + d7.Vl = function(a10) { + this.R = a10; + }; + d7.a9 = function(a10) { + this.Dq = a10; + }; + d7.$classData = r8({ D_a: 0 }, false, "amf.plugins.domain.webapi.metamodel.ResponseModel$", { D_a: 1, f: 1, pd: 1, hc: 1, Rb: 1, rc: 1, Oi: 1, EY: 1, Dha: 1, Cha: 1, UY: 1, Rt: 1, Zu: 1, r7: 1, nm: 1, sk: 1, mm: 1 }); + var qwb = void 0; + function Dm() { + qwb || (qwb = new pwb().a()); + return qwb; + } + function iH(a10) { + if (null !== a10) { + var b10 = a10.toLowerCase(); + if ("true" === b10) + return true; + if ("false" === b10) + return false; + throw new Zj().e('For input string: "' + a10 + '"'); + } + throw new Zj().e('For input string: "null"'); + } + function EN(a10) { + return a10 instanceof mL ? a10.Xl : a10; + } + function rwb(a10, b10, c10) { + b10 = 0 < b10 ? b10 : 0; + var e10 = a10.Oa(); + e10 = c10 < e10 ? c10 : e10; + if (b10 >= e10) + return a10.Qd().Rc(); + c10 = a10.Qd(); + a10 = a10.t().substring(b10, e10); + return c10.jh(new qg().e(a10)).Rc(); + } + function pia(a10, b10) { + a10 = a10.t(); + b10 = 97 <= b10 && 122 >= b10 || 65 <= b10 && 90 >= b10 || 48 <= b10 && 57 >= b10 ? ba.String.fromCharCode(b10) : "\\" + gc(b10); + return Mc(ua(), a10, b10); + } + function zga(a10, b10) { + var c10 = new Tj().a(), e10 = -1 + b10 | 0; + if (!(0 >= b10)) + for (b10 = 0; ; ) { + Vj(c10, a10.t()); + if (b10 === e10) + break; + b10 = 1 + b10 | 0; + } + return c10.Ef.qf; + } + function Oia(a10) { + if (null === a10.t()) + return null; + if (0 === (a10.t().length | 0)) + return ""; + var b10 = 65535 & (a10.t().charCodeAt(0) | 0), c10 = Ku(); + if (8544 <= b10 && 8559 >= b10 || 9398 <= b10 && 9423 >= b10 || 1 === eVa(c10, b10)) + return a10.t(); + a10 = Iu(ua(), a10.t()); + b10 = a10.n[0]; + a10.n[0] = sja(Ku(), b10); + return Nsa(ua(), a10, 0, a10.n.length); + } + function Wp(a10, b10) { + var c10 = a10.t(); + return 0 <= (c10.length | 0) && c10.substring(0, b10.length | 0) === b10 ? a10.t().substring(b10.length | 0) : a10.t(); + } + function aQ(a10, b10) { + if (Ed(ua(), a10.t(), b10)) { + var c10 = a10.t(); + a10 = (a10.t().length | 0) - (b10.length | 0) | 0; + return c10.substring(0, a10); + } + return a10.t(); + } + function OB(a10) { + var b10 = new Tj().a(), c10 = new g52(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.nea = a10.t(); + c10.kH = c10.nea.length | 0; + for (c10.Tj = 0; c10.Ya(); ) { + a10 = c10.Tw(); + for (var e10 = a10.length | 0, f10 = 0; ; ) + if (f10 < e10 && 32 >= (65535 & (a10.charCodeAt(f10) | 0))) + f10 = 1 + f10 | 0; + else + break; + a10 = f10 < e10 && 124 === (65535 & (a10.charCodeAt(f10) | 0)) ? a10.substring(1 + f10 | 0) : a10; + Vj(b10, a10); + } + return b10.Ef.qf; + } + function mRa(a10) { + var b10 = a10.t().length | 0; + if (0 === b10) + return a10.t(); + var c10 = a10.gG(-1 + b10 | 0); + if (10 === c10 || 12 === c10) { + var e10 = a10.t(); + a10 = 10 === c10 && 2 <= b10 && 13 === a10.gG(-2 + b10 | 0) ? -2 + b10 | 0 : -1 + b10 | 0; + return e10.substring(0, a10); + } + return a10.t(); + } + function swb() { + } + swb.prototype = new mub(); + swb.prototype.constructor = swb; + function twb() { + } + d7 = twb.prototype = swb.prototype; + d7.Hd = function() { + return this.Kj(); + }; + d7.ga = function() { + return this.mb().$a(); + }; + d7.im = function() { + return this.mb(); + }; + d7.fm = function(a10) { + return M8(this, a10); + }; + d7.Od = function(a10) { + var b10 = this.mb(); + return eLa(b10, a10); + }; + d7.ng = function() { + return this; + }; + d7.Kj = function() { + return this; + }; + d7.b = function() { + return !this.mb().Ya(); + }; + d7.Di = function() { + return Xd(); + }; + d7.oh = function(a10) { + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.U = function(a10) { + var b10 = this.mb(); + yT(b10, a10); + }; + d7.qs = function(a10, b10) { + var c10 = this.mb(); + return hya(c10, a10, b10); + }; + d7.xl = function(a10) { + for (var b10 = this.Qd(), c10 = this.mb(); c10.Ya(); ) { + var e10 = c10.$a(); + if (!a10.P(e10)) + break; + b10.jd(e10); + } + return b10.Rc(); + }; + d7.Fb = function(a10) { + var b10 = this.mb(); + return hLa(b10, a10); + }; + d7.og = function(a10) { + return HN(this, a10); + }; + d7.Jk = function(a10) { + return Osb(this, a10); + }; + d7.Dd = function() { + return this.mb().Dd(); + }; + d7.Rk = function(a10) { + var b10 = this.Qd(); + sLa(b10, this, -(0 > a10 ? 0 : a10) | 0); + for (var c10 = 0, e10 = this.mb(); c10 < a10 && e10.Ya(); ) + e10.$a(), c10 = 1 + c10 | 0; + return b10.jh(e10).Rc(); + }; + d7.Pk = function(a10, b10, c10) { + Psb(this, a10, b10, c10); + }; + var C9a = r8({ $i: 0 }, true, "scala.collection.immutable.Iterable", { $i: 1, oj: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, mj: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1 }); + function uwb(a10, b10) { + var c10 = Pt(); + return a10.rF(Rsb(c10, 0, 1), b10); + } + function qg() { + this.ja = null; + } + qg.prototype = new u7(); + qg.prototype.constructor = qg; + d7 = qg.prototype; + d7.Hd = function() { + return new hK().e(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + a10 = 65535 & (this.ja.charCodeAt(a10) | 0); + return gc(a10); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.length | 0); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new hK().e(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + hh(); + return a10 instanceof qg ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.gG = function(a10) { + return 65535 & (this.ja.charCodeAt(a10) | 0); + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return this.ja; + }; + d7.tr = function(a10) { + var b10 = this.ja; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.length | 0, a10, b10); + }; + d7.gs = function(a10) { + var b10 = this.ja; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return gh(hh(), this.ja, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.length | 0; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.length | 0); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return this.ja; + }; + d7.Oa = function() { + return this.ja.length | 0; + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Nr = function() { + return E62(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.length | 0; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return gh(hh(), this.ja, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.length | 0); + return Xv(a10); + }; + d7.Rk = function(a10) { + var b10 = this.ja.length | 0; + return gh(hh(), this.ja, a10, b10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return new hK().e(this.ja); + }; + d7.ta = function() { + return bi(this); + }; + d7.op = function() { + return new hK().e(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new hK().e(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.length | 0, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.z = function() { + var a10 = this.ja; + return ta(ua(), a10); + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.e = function(a10) { + this.ja = a10; + return this; + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.length | 0; b10 < c10; ) { + var e10 = this.lb(b10); + WA(a10, e10); + b10 = 1 + b10 | 0; + } + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function() { + return Iu(ua(), this.ja); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Tj().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ tcb: 0 }, false, "scala.collection.immutable.StringOps", { tcb: 1, f: 1, Gpa: 1, Wk: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, cM: 1, ym: 1 }); + function S9(a10, b10, c10) { + var e10 = a10.Zi(); + b10 = 0 < b10 ? b10 : 0; + c10 = 0 < c10 ? c10 : 0; + var f10 = SJ(W5(), e10); + c10 = (c10 < f10 ? c10 : f10) - b10 | 0; + c10 = 0 < c10 ? c10 : 0; + a10 = Mu(Nu(), Ou(la(a10.Zi())), c10); + 0 < c10 && Pu(Gd(), e10, b10, a10, 0, c10); + return a10; + } + function T9(a10, b10, c10, e10) { + var f10 = SJ(W5(), a10.Zi()); + e10 = e10 < f10 ? e10 : f10; + f10 = SJ(W5(), b10) - c10 | 0; + e10 = e10 < f10 ? e10 : f10; + 0 < e10 && Pu(Gd(), a10.Zi(), 0, b10, c10, e10); + } + function U9(a10, b10) { + var c10 = b10.Lo(); + return Ou(la(a10.Zi())) === c10 ? a10.Zi() : YJ(a10, b10); + } + function Th() { + vh.call(this); + this.Fo = null; + } + Th.prototype = new O9(); + Th.prototype.constructor = Th; + d7 = Th.prototype; + d7.H = function() { + return "NilShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Th ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Th().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.Fo; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.Xa; + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-nil" : a10.c(); + a10 = new je4().e(a10); + return "/nil/" + jj(a10.td); + }; + d7.zv = function() { + return "shape"; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Th().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Th().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.Fo; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.Fo = wea(); + return this; + }; + d7.$classData = r8({ NYa: 0 }, false, "amf.plugins.domain.shapes.models.NilShape", { NYa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Hh() { + vh.call(this); + this.XV = this.Fo = null; + } + Hh.prototype = new O9(); + Hh.prototype.constructor = Hh; + function p5a(a10, b10) { + O7(); + var c10 = new P6().a(); + c10 = new Vk().K(new S6().a(), c10); + O7(); + var e10 = new P6().a(); + b10 = Sd(c10, b10, e10); + c10 = Ih().kh; + ig(a10, c10, b10); + return b10; + } + d7 = Hh.prototype; + d7.H = function() { + return "NodeShape"; + }; + d7.E = function() { + return 2; + }; + d7.ub = function(a10, b10) { + return o5a(this, a10, b10); + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Hh ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Hh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.Fo; + }; + d7.fa = function() { + return this.Xa; + }; + function o5a(a10, b10, c10) { + var e10 = c10.Ha(a10.j); + -1 !== (("" + b10).indexOf("#") | 0) ? Ai(a10, b10) : Ai(a10, b10 + "#/"); + e10 || (b10 = a10.j, e10 = K7(), c10 = c10.yg(b10, e10.u), B6(a10.aa, Ih().kh).U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return r5a(h10, f10.j, g10); + }; + }(a10, c10))), b10 = Vb().Ia(B6(a10.aa, Ih().vF)), b10.b() || b10.c().ub(a10.j, c10)); + return a10; + } + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-node" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.zv = function() { + return this.XV; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Hh().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Hh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.Fo; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.Fo = Ih(); + this.XV = "nodeShape"; + return this; + }; + d7.$classData = r8({ PYa: 0 }, false, "amf.plugins.domain.shapes.models.NodeShape", { PYa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Gh() { + vh.call(this); + } + Gh.prototype = new O9(); + Gh.prototype.constructor = Gh; + d7 = Gh.prototype; + d7.H = function() { + return "SchemaShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Gh ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Gh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return pn(); + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-schema" : a10.c(); + a10 = new je4().e(a10); + return "/schema/" + jj(a10.td); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Gh().K(a10, b10); + }; + }(this)); + }; + d7.zv = function() { + return "schemaShape"; + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Gh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return pn(); + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + return this; + }; + d7.$classData = r8({ VYa: 0 }, false, "amf.plugins.domain.shapes.models.SchemaShape", { VYa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Vh() { + vh.call(this); + this.Fo = null; + } + Vh.prototype = new O9(); + Vh.prototype.constructor = Vh; + d7 = Vh.prototype; + d7.H = function() { + return "UnionShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Vh ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Vh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.Fo; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.Xa; + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-union" : a10.c(); + a10 = new je4().e(a10); + return "/union/" + jj(a10.td); + }; + d7.zv = function() { + return "unionShape"; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Vh().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Vh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.Fo; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.Fo = xn(); + return this; + }; + d7.$classData = r8({ zZa: 0 }, false, "amf.plugins.domain.shapes.models.UnionShape", { zZa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function th() { + vh.call(this); + this.lA = null; + } + th.prototype = new mwb(); + th.prototype.constructor = th; + d7 = th.prototype; + d7.H = function() { + return "ArrayShape"; + }; + d7.E = function() { + return 2; + }; + function YA(a10) { + var b10 = new pi().K(a10.aa, a10.Xa); + return Rd(b10, a10.j); + } + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof th ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new th().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.lA; + }; + function ZA(a10, b10) { + Yr(a10.aa, a10.j + "/items", uh().Ff, b10, (O7(), new P6().a())); + return a10; + } + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new th().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new th().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.lA; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.lA = uh(); + return this; + }; + d7.$classData = r8({ DYa: 0 }, false, "amf.plugins.domain.shapes.models.ArrayShape", { DYa: 1, Aha: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Wh() { + vh.call(this); + this.XV = this.Fo = null; + } + Wh.prototype = new O9(); + Wh.prototype.constructor = Wh; + d7 = Wh.prototype; + d7.H = function() { + return "FileShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Wh ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Wh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.Fo; + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-file" : a10.c(); + a10 = new je4().e(a10); + return "/" + jj(a10.td); + }; + d7.zv = function() { + return this.XV; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Wh().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Wh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.Fo; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.Fo = gn(); + this.XV = "fileShape"; + return this; + }; + d7.$classData = r8({ KYa: 0 }, false, "amf.plugins.domain.shapes.models.FileShape", { KYa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, FYa: 1, y: 1, v: 1, q: 1, o: 1 }); + function pi() { + vh.call(this); + this.lA = null; + } + pi.prototype = new mwb(); + pi.prototype.constructor = pi; + d7 = pi.prototype; + d7.dI = function() { + var a10 = new th().K(this.aa, this.Xa), b10 = Vb().Ia(this.j); + if (b10 instanceof z7) { + var c10 = b10.i; + if (null !== c10) + return Rd(a10, c10); + } + if (y7() === b10) + return a10; + throw new x7().d(b10); + }; + d7.H = function() { + return "MatrixShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof pi ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new pi().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.lA; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.Xa; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new pi().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new pi().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.lA; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.lA = xea(); + return this; + }; + d7.$classData = r8({ MYa: 0 }, false, "amf.plugins.domain.shapes.models.MatrixShape", { MYa: 1, Aha: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function Mh() { + vh.call(this); + this.Fo = null; + } + Mh.prototype = new O9(); + Mh.prototype.constructor = Mh; + d7 = Mh.prototype; + d7.H = function() { + return "ScalarShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof Mh ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new Mh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.Fo; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.fa = function() { + return this.Xa; + }; + d7.dd = function() { + var a10 = B6(this.aa, qf().R).A; + a10 = a10.b() ? "default-scalar" : a10.c(); + a10 = new je4().e(a10); + return "/scalar/" + jj(a10.td); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new Mh().K(a10, b10); + }; + }(this)); + }; + d7.zv = function() { + var a10 = B6(this.aa, Fg().af).A; + a10 = a10.b() ? "#shape" : a10.c(); + a10 = Mc(ua(), a10, "#"); + a10 = Oc(new Pc().fd(a10)); + return "integer" === a10 || "float" === a10 || "double" === a10 || "long" === a10 || "number" === a10 ? "numberScalarShape" : "string" === a10 ? "stringScalarShape" : "dateTime" === a10 ? "dateScalarShape" : "shape"; + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new Mh().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.Fo; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.Fo = Fg(); + return this; + }; + d7.$classData = r8({ TYa: 0 }, false, "amf.plugins.domain.shapes.models.ScalarShape", { TYa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, FYa: 1, y: 1, v: 1, q: 1, o: 1 }); + function qi() { + vh.call(this); + this.lA = null; + } + qi.prototype = new mwb(); + qi.prototype.constructor = qi; + d7 = qi.prototype; + d7.H = function() { + return "TupleShape"; + }; + d7.E = function() { + return 2; + }; + d7.h = function(a10) { + return this === a10 ? true : a10 instanceof qi ? this.aa === a10.aa ? this.Xa === a10.Xa : false : false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + O7(); + var a10 = new P6().a(); + a10 = new qi().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.bc = function() { + return this.lA; + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function() { + return function(a10, b10) { + return new qi().K(a10, b10); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + O7(); + var a10 = new P6().a(); + a10 = new qi().K(new S6().a(), a10); + return Rd(a10, this.j); + }; + d7.z = function() { + return X5(this); + }; + d7.uv = function() { + return this.lA; + }; + d7.K = function(a10, b10) { + vh.prototype.K.call(this, a10, b10); + this.lA = an(); + return this; + }; + d7.$classData = r8({ XYa: 0 }, false, "amf.plugins.domain.shapes.models.TupleShape", { XYa: 1, Aha: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, y: 1, v: 1, q: 1, o: 1 }); + function vi() { + vh.call(this); + this.kQ = this.AG = this.JH = null; + this.VP = false; + this.Je = this.Fo = null; + } + vi.prototype = new O9(); + vi.prototype.constructor = vi; + d7 = vi.prototype; + d7.H = function() { + return "UnresolvedShape"; + }; + d7.E = function() { + return 6; + }; + d7.dk = function(a10, b10) { + var c10 = this.AG; + c10.b() || c10.c().P(a10).hd(); + a10 = this.kQ; + a10.b() || a10.c().P(b10); + }; + d7.h = function(a10) { + if (this === a10) + return true; + if (a10 instanceof vi) { + if (this.aa === a10.aa && this.Xa === a10.Xa && this.JH === a10.JH) { + var b10 = this.AG, c10 = a10.AG; + b10 = null === b10 ? null === c10 : b10.h(c10); + } else + b10 = false; + b10 ? (b10 = this.kQ, c10 = a10.kQ, b10 = null === b10 ? null === c10 : b10.h(c10)) : b10 = false; + return b10 ? this.VP === a10.VP : false; + } + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.aa; + case 1: + return this.Xa; + case 2: + return this.JH; + case 3: + return this.AG; + case 4: + return this.kQ; + case 5: + return this.VP; + default: + throw new U6().e("" + a10); + } + }; + d7.yh = function() { + return this; + }; + d7.bc = function() { + return this.Fo; + }; + d7.fa = function() { + return this.Xa; + }; + d7.t = function() { + return V5(W5(), this); + }; + d7.Ik = function() { + return this.VP; + }; + d7.dd = function() { + return "/unresolved"; + }; + d7.Ug = function() { + return this; + }; + d7.mh = function() { + return Uc(/* @__PURE__ */ function(a10) { + return function(b10, c10) { + return wi(new vi(), b10, c10, a10.JH, a10.AG, y7(), true); + }; + }(this)); + }; + d7.Y = function() { + return this.aa; + }; + d7.by = function() { + return this; + }; + function wi(a10, b10, c10, e10, f10, g10, h10) { + a10.JH = e10; + a10.AG = f10; + a10.kQ = g10; + a10.VP = h10; + vh.prototype.K.call(a10, b10, c10); + a10.Je = y7(); + a10.Fo = Ag(); + return a10; + } + d7.gj = function() { + return this; + }; + d7.z = function() { + var a10 = -889275714; + a10 = OJ().Ga(a10, NJ(OJ(), this.aa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.Xa)); + a10 = OJ().Ga(a10, NJ(OJ(), this.JH)); + a10 = OJ().Ga(a10, NJ(OJ(), this.AG)); + a10 = OJ().Ga(a10, NJ(OJ(), this.kQ)); + a10 = OJ().Ga(a10, this.VP ? 1231 : 1237); + return OJ().fe(a10, 6); + }; + d7.uv = function() { + return this.Fo; + }; + function Xub(a10, b10) { + b10 = b10.Ug(a10.JH, a10.Xa); + a10 = B6(a10.aa, qf().R).A; + a10 = a10.b() ? null : a10.c(); + O7(); + var c10 = new P6().a(); + Sd(b10, a10, c10); + } + var fSa = r8({ BZa: 0 }, false, "amf.plugins.domain.shapes.models.UnresolvedShape", { BZa: 1, Wy: 1, Dx: 1, f: 1, qd: 1, vc: 1, tc: 1, rg: 1, xh: 1, Ex: 1, Zy: 1, Yy: 1, WA: 1, XA: 1, Zv: 1, Xy: 1, Pgb: 1, y: 1, v: 1, q: 1, o: 1 }); + vi.prototype.$classData = fSa; + function Fc() { + this.Sb = null; + } + Fc.prototype = new twb(); + Fc.prototype.constructor = Fc; + function vwb() { + } + d7 = vwb.prototype = Fc.prototype; + d7.U = function(a10) { + var b10 = this.Sb.Ye(); + yT(b10, a10); + }; + d7.jb = function() { + return this.Sb.jb(); + }; + d7.mb = function() { + return this.Sb.Ye(); + }; + d7.Vd = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + return this; + }; + d7.$classData = r8({ bpa: 0 }, false, "scala.collection.MapLike$DefaultValuesIterable", { bpa: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, q: 1, o: 1 }); + function GVa() { + this.ja = null; + } + GVa.prototype = new u7(); + GVa.prototype.constructor = GVa; + d7 = GVa.prototype; + d7.Hd = function() { + return new B52().NG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new B52().NG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Cya || (Cya = new iK().a()); + return a10 instanceof GVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new B52().NG(this.ja); + }; + d7.op = function() { + return new B52().NG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new B52().NG(this.ja); + }; + d7.NG = function(a10) { + this.ja = a10; + return this; + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Unb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ Tcb: 0 }, false, "scala.collection.mutable.ArrayOps$ofBoolean", { Tcb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function HVa() { + this.ja = null; + } + HVa.prototype = new u7(); + HVa.prototype.constructor = HVa; + d7 = HVa.prototype; + d7.Hd = function() { + return new v52().HG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new v52().HG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Dya || (Dya = new jK().a()); + return a10 instanceof HVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new v52().HG(this.ja); + }; + d7.op = function() { + return new v52().HG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new v52().HG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.HG = function(a10) { + this.ja = a10; + return this; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Xnb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ Vcb: 0 }, false, "scala.collection.mutable.ArrayOps$ofByte", { Vcb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function Ju() { + this.ja = null; + } + Ju.prototype = new u7(); + Ju.prototype.constructor = Ju; + d7 = Ju.prototype; + d7.Hd = function() { + return new dB().BB(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return gc(this.ja.n[a10]); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new dB().BB(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Eya || (Eya = new kK().a()); + return a10 instanceof Ju ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.BB = function(a10) { + this.ja = a10; + return this; + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new dB().BB(this.ja); + }; + d7.op = function() { + return new dB().BB(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new dB().BB(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) { + var e10 = this.lb(b10); + WA(a10, e10); + b10 = 1 + b10 | 0; + } + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new $nb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ Xcb: 0 }, false, "scala.collection.mutable.ArrayOps$ofChar", { Xcb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function IVa() { + this.ja = null; + } + IVa.prototype = new u7(); + IVa.prototype.constructor = IVa; + d7 = IVa.prototype; + d7.Hd = function() { + return new A52().IG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new A52().IG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Fya || (Fya = new lK().a()); + return a10 instanceof IVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.IG = function(a10) { + this.ja = a10; + return this; + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new A52().IG(this.ja); + }; + d7.op = function() { + return new A52().IG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new A52().IG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new cob().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ Zcb: 0 }, false, "scala.collection.mutable.ArrayOps$ofDouble", { Zcb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function JVa() { + this.ja = null; + } + JVa.prototype = new u7(); + JVa.prototype.constructor = JVa; + d7 = JVa.prototype; + d7.Hd = function() { + return new z52().JG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new z52().JG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Gya || (Gya = new mK().a()); + return a10 instanceof JVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.JG = function(a10) { + this.ja = a10; + return this; + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new z52().JG(this.ja); + }; + d7.op = function() { + return new z52().JG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new z52().JG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Aqb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ adb: 0 }, false, "scala.collection.mutable.ArrayOps$ofFloat", { adb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function KVa() { + this.ja = null; + } + KVa.prototype = new u7(); + KVa.prototype.constructor = KVa; + d7 = KVa.prototype; + d7.Hd = function() { + return new x52().KG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new x52().KG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Hya || (Hya = new nK().a()); + return a10 instanceof KVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.KG = function(a10) { + this.ja = a10; + return this; + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new x52().KG(this.ja); + }; + d7.op = function() { + return new x52().KG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new x52().KG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Dqb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ cdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofInt", { cdb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function LVa() { + this.ja = null; + } + LVa.prototype = new u7(); + LVa.prototype.constructor = LVa; + d7 = LVa.prototype; + d7.Hd = function() { + return new y52().LG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.LG = function(a10) { + this.ja = a10; + return this; + }; + d7.ng = function() { + return new y52().LG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Iya || (Iya = new oK().a()); + return a10 instanceof LVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new y52().LG(this.ja); + }; + d7.op = function() { + return new y52().LG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new y52().LG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) { + var e10 = this.ja.n[b10]; + WA(a10, new qa().Sc(e10.od, e10.Ud)); + b10 = 1 + b10 | 0; + } + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Gqb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ edb: 0 }, false, "scala.collection.mutable.ArrayOps$ofLong", { edb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function Pc() { + this.ja = null; + } + Pc.prototype = new u7(); + Pc.prototype.constructor = Pc; + d7 = Pc.prototype; + d7.Hd = function() { + return new VI().fd(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new VI().fd(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Jya || (Jya = new pK().a()); + return a10 instanceof Pc ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.fd = function(a10) { + this.ja = a10; + return this; + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new VI().fd(this.ja); + }; + d7.op = function() { + return new VI().fd(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new VI().fd(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + var a10 = this.ja; + return new EY().XO(cRa(dRa(), Ou(la(a10)))); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ gdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofRef", { gdb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function MVa() { + this.ja = null; + } + MVa.prototype = new u7(); + MVa.prototype.constructor = MVa; + d7 = MVa.prototype; + d7.Hd = function() { + return new w52().MG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.ja.n[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.MG = function(a10) { + this.ja = a10; + return this; + }; + d7.ng = function() { + return new w52().MG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Kya || (Kya = new qK().a()); + return a10 instanceof MVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new w52().MG(this.ja); + }; + d7.op = function() { + return new w52().MG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new w52().MG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, this.ja.n[b10]), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Kqb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ idb: 0 }, false, "scala.collection.mutable.ArrayOps$ofShort", { idb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function NVa() { + this.ja = null; + } + NVa.prototype = new u7(); + NVa.prototype.constructor = NVa; + d7 = NVa.prototype; + d7.Hd = function() { + return new C52().OG(this.ja); + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function() { + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.ng = function() { + return new C52().OG(this.ja); + }; + d7.bd = function(a10, b10) { + return hC(this, a10, b10); + }; + d7.h = function(a10) { + Lya || (Lya = new rK().a()); + return a10 instanceof NVa ? this.ja === (null === a10 ? null : a10.ja) : false; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return gE(new hE(), this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.np = function(a10, b10) { + return S9(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return D6(this, a10, false); + }; + d7.jb = function() { + return this.ja.n.length; + }; + d7.Mj = function() { + return n9(this); + }; + d7.fj = function() { + return xN(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.ja.n.length); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.cm = function() { + return UJ(this, "", "", ""); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.ia = function(a10, b10) { + return xq(this, a10, b10); + }; + d7.Oa = function() { + return this.ja.n.length; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Si = function(a10) { + return D6(this, a10, true); + }; + d7.hm = function() { + return this.ja.n.length; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return S9(this, 0, a10); + }; + d7.Dd = function() { + var a10 = qS(new rS(), this, 0, this.ja.n.length); + return Xv(a10); + }; + d7.Rk = function(a10) { + return S9(this, a10, this.ja.n.length); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return new C52().OG(this.ja); + }; + d7.OG = function(a10) { + this.ja = a10; + return this; + }; + d7.op = function() { + return new C52().OG(this.ja); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return new C52().OG(this.ja); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this.ja; + }; + d7.Ql = function(a10, b10) { + return M9(this, this.ja.n.length, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + T9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return F62(this, a10); + }; + d7.z = function() { + return this.ja.z(); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.ja.n.length; b10 < c10; ) + WA(a10, void 0), b10 = 1 + b10 | 0; + return a10.eb; + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.Ol = function(a10) { + return U9(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.ec = function(a10, b10) { + return xs(this, a10, b10); + }; + d7.Qd = function() { + return new Nqb().a(); + }; + d7.Xk = function() { + return G6(this); + }; + d7.$classData = r8({ kdb: 0 }, false, "scala.collection.mutable.ArrayOps$ofUnit", { kdb: 1, f: 1, YE: 1, mq: 1, gm: 1, Ml: 1, nj: 1, ef: 1, Vc: 1, v: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, Tc: 1, df: 1, Wk: 1, Hi: 1 }); + function wwb() { + } + wwb.prototype = new twb(); + wwb.prototype.constructor = wwb; + function xwb() { + } + xwb.prototype = wwb.prototype; + function ywb(a10) { + var b10 = a10.Qd(); + b10.jh(a10); + return b10.Rc(); + } + function zwb(a10, b10) { + b10 = a10.$ka(b10); + -1 !== b10 && a10.ida(b10); + return a10; + } + function wq() { + this.th = this.Sb = null; + } + wq.prototype = new vwb(); + wq.prototype.constructor = wq; + wq.prototype.U = function(a10) { + var b10 = this.th, c10 = b10.ze; + b10 = pD(b10); + for (var e10 = c10.n[b10]; null !== e10; ) { + var f10 = e10.$a(); + a10.P(e10.r); + for (e10 = f10; null === e10 && 0 < b10; ) + b10 = -1 + b10 | 0, e10 = c10.n[b10]; + } + }; + wq.prototype.Yn = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.th = a10; + Fc.prototype.Vd.call(this, a10); + return this; + }; + wq.prototype.$classData = r8({ udb: 0 }, false, "scala.collection.mutable.HashMap$$anon$2", { udb: 1, bpa: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, q: 1, o: 1 }); + function Awb(a10, b10) { + var c10 = UA(new VA(), a10.ls()); + a10 = D6(a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return !Va(Wa(), f10, g10.ma()); + }; + }(a10, b10)), false); + yi(c10, a10); + return c10.eb; + } + function Bwb(a10) { + var b10 = a10.spa().mb(); + a10 = a10.$1().mb(); + var c10 = new Z42(); + if (null === b10) + throw mb(E6(), null); + c10.Fa = b10; + c10.xea = a10; + return c10; + } + function Cwb(a10) { + var b10 = new Xj().ue(a10.jb()); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return pr(e10, f10); + }; + }(a10, b10))); + return b10; + } + function Dwb(a10) { + return a10.lv().jh(a10); + } + function GN(a10) { + var b10 = new Xj().ue(a10.jb()); + a10.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return pr(e10, f10); + }; + }(a10, b10))); + return b10; + } + function $da(a10, b10, c10) { + var e10 = mza(); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(); + k10 = k10.ya(); + k10 = h10.zc(k10); + return new R6().M(l10, k10); + } + throw new x7().d(k10); + }; + }(a10, c10)); + c10 = Ut(); + c10 = zC(c10); + var f10 = {}; + Jd(b10, a10, c10).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(); + k10 = k10.ya(); + h10[l10] = k10; + } else + throw new x7().d(k10); + }; + }(e10, f10))); + return f10; + } + function aea(a10, b10, c10) { + oza || (oza = new IK().a()); + var e10 = oza; + a10 = w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + return g10.zc(h10); + }; + }(a10, c10)); + c10 = K7(); + b10 = b10.ka(a10, c10.u); + return nza(e10, b10); + } + function Yda(a10, b10, c10) { + var e10 = mza(); + a10 = w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(); + k10 = k10.ya(); + k10 = h10.zc(k10); + return new R6().M(l10, k10); + } + throw new x7().d(k10); + }; + }(a10, c10)); + c10 = yC(); + c10 = zC(c10); + var f10 = {}; + Jd(b10, a10, c10).U(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + if (null !== k10) { + var l10 = k10.ma(); + k10 = k10.ya(); + h10[l10] = k10; + } else + throw new x7().d(k10); + }; + }(e10, f10))); + return f10; + } + function iea(a10) { + return FK(GK(), a10); + } + function yAa(a10) { + return void 0 === a10 ? y7() : new z7().d(a10); + } + function hea(a10, b10, c10) { + return pza(qza(), b10).Yg(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.Kc(g10); + }; + }(a10, c10)), ml()); + } + function Ewb(a10) { + return a10.opa().mb().DI(oq(/* @__PURE__ */ function(b10) { + return function() { + return b10.z2(); + }; + }(a10))); + } + function Fwb(a10) { + var b10 = a10.Dda().mb(); + return new Y42().ou(b10, a10.Du()); + } + function Gwb(a10) { + var b10 = a10.Eda().mb(); + return new V42().ou(b10, a10.Du()); + } + function Hwb(a10) { + var b10 = a10.ppa().mb(); + return new U42().ou(b10, a10.NB()); + } + function Iwb(a10) { + var b10 = a10.qpa().mb(); + return new YB().ou(b10, a10.NB()); + } + function Jwb(a10) { + return a10.Q0().mb().DI(oq(/* @__PURE__ */ function(b10) { + return function() { + return b10.rpa(); + }; + }(a10))); + } + function Kwb(a10) { + var b10 = a10.Fda().mb(); + return new X42().ou(b10, a10.Du()); + } + function Lwb() { + } + Lwb.prototype = new twb(); + Lwb.prototype.constructor = Lwb; + function V9() { + } + d7 = V9.prototype = Lwb.prototype; + d7.ala = function(a10, b10) { + return m9a(this, a10, b10); + }; + d7.Oe = function(a10) { + return nub(this, a10); + }; + d7.b = function() { + return 0 === this.Oe(0); + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.ro = function(a10) { + return this.P(a10) | 0; + }; + d7.yg = function(a10, b10) { + return ju(this, a10, b10); + }; + d7.nk = function(a10) { + return Dw(this, a10); + }; + d7.t = function() { + return C6(this); + }; + d7.Tr = function(a10, b10) { + return this.ia(a10, b10); + }; + d7.wm = function(a10, b10) { + return oub(this, a10, b10); + }; + d7.gp = function(a10) { + return d9(this, a10); + }; + d7.st = function() { + return soa(this); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Vr = function(a10, b10) { + return qub(this, a10, b10); + }; + d7.fj = function() { + return xN(this); + }; + d7.Ep = function(a10) { + return !!this.P(a10); + }; + d7.cq = function(a10) { + return e92(this, a10); + }; + d7.wy = function() { + return new W9().aL(this); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ei = function(a10, b10) { + return g9(this, a10, b10); + }; + d7.ke = function() { + return this.ok(); + }; + d7.$ka = function(a10) { + return this.ala(a10, 0); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.z = function() { + return pT(this); + }; + d7.jC = function(a10) { + return this.nk(new OR().d1(a10)); + }; + function Mwb() { + this.ea = this.PM = this.MI = this.WC = this.qx = this.Bx = this.Xt = this.WM = this.dz = this.bz = this.CJ = this.Lt = this.Kt = this.Wt = this.Vt = this.TI = this.rJ = this.LI = this.LJ = this.JJ = this.bu = this.Nt = this.Hy = this.AJ = this.$M = this.IJ = this.sJ = this.PI = this.yJ = this.RI = this.MJ = this.tJ = this.gz = this.Fy = this.UI = this.aJ = this.OI = this.Gq = null; + } + Mwb.prototype = new u7(); + Mwb.prototype.constructor = Mwb; + function To() { + ab(); + null === ab().PM && null === ab().PM && (ab().PM = new m0()); + ab(); + } + function h_a() { + var a10 = ab(); + null === ab().LI && null === ab().LI && (ab().LI = new a0().P$(a10)); + return ab().LI; + } + function lAa() { + ab(); + null === ab().AJ && null === ab().AJ && (ab().AJ = new V0()); + return ab().AJ; + } + d7 = Mwb.prototype; + d7.a = function() { + Nwb = this; + this.ea = nv().ea; + return this; + }; + d7.cS = function() { + null === ab().Vt && this.qJ(); + ab(); + }; + d7.BJ = function() { + null === ab().Wt && (ab().Wt = new Z_().Br(this)); + }; + d7.cb = function() { + null === ab().Xt && this.fS(); + return ab().Xt; + }; + d7.QM = function() { + null === ab().Fy && this.l5(); + return ab().Fy; + }; + d7.l5 = function() { + null === ab().Fy && (ab().Fy = new L_().ep(this)); + }; + d7.tR = function() { + null === ab().qx && (ab().qx = new xL()); + }; + d7.Lf = function() { + null === ab().Gq && this.FJ(); + return ab().Gq; + }; + d7.n5 = function() { + null === ab().Hy && (ab().Hy = DWa(this)); + }; + function FLa() { + ab(); + null === ab().TI && null === ab().TI && (ab().TI = new f0()); + return ab().TI; + } + function o_a() { + ab(); + null === ab().IJ && null === ab().IJ && (ab().IJ = new A1()); + return ab().IJ; + } + function RZa() { + ab(); + null === ab().yJ && null === ab().yJ && (ab().yJ = new S0()); + return ab().yJ; + } + d7.FJ = function() { + null === ab().Gq && (ab().Gq = new Q_().ep(this)); + }; + d7.NI = function() { + null === ab().Kt && (ab().Kt = new W_().Br(this)); + }; + d7.no = function() { + null === ab().bu && this.mS(); + return ab().bu; + }; + d7.qJ = function() { + null === ab().Vt && (ab().Vt = new Y_().Br(this)); + }; + d7.o8 = function() { + null === ab().gz && (ab().gz = new R_().ep(this)); + }; + d7.Pt = function() { + null === ab().Bx && this.FR(); + ab(); + }; + d7.fS = function() { + null === ab().Xt && (ab().Xt = new DL()); + }; + d7.Um = function() { + null === ab().Lt && this.xR(); + return ab().Lt; + }; + function Yqb() { + ab(); + null === ab().WM && null === ab().WM && (ab().WM = new V_()); + ab(); + } + d7.b8 = function() { + null === ab().dz && (ab().dz = bXa(this)); + }; + d7.Yo = function() { + null === ab().gz && this.o8(); + return ab().gz; + }; + d7.yi = function() { + null === ab().qx && this.tR(); + ab(); + }; + function lfa() { + ab(); + null === ab().JJ && null === ab().JJ && (ab().JJ = new D1()); + return ab().JJ; + } + d7.$e = function() { + null === ab().Hy && this.n5(); + return ab().Hy; + }; + function pfa() { + var a10 = ab(); + null === ab().OI && null === ab().OI && (ab().OI = new M_().ep(a10)); + return ab().OI; + } + function f_a() { + ab(); + null === ab().LJ && null === ab().LJ && (ab().LJ = new E1()); + return ab().LJ; + } + d7.qR = function() { + null === ab().Kt && this.NI(); + ab(); + }; + d7.eS = function() { + null === ab().Wt && this.BJ(); + ab(); + }; + d7.xR = function() { + null === ab().Lt && (ab().Lt = new X_().Br(this)); + }; + d7.zR = function() { + null === ab().Nt && (ab().Nt = HWa(this)); + }; + d7.mS = function() { + null === ab().bu && (ab().bu = new C1()); + }; + d7.jr = function() { + null === ab().Nt && this.zR(); + return ab().Nt; + }; + d7.FR = function() { + null === ab().Bx && (ab().Bx = new BL()); + }; + d7.cB = function() { + null === ab().bz && this.V7(); + return ab().bz; + }; + d7.V7 = function() { + null === ab().bz && (ab().bz = OWa(this)); + }; + d7.Bg = function() { + null === ab().dz && this.b8(); + return ab().dz; + }; + function $$a() { + ab(); + null === ab().CJ && null === ab().CJ && (ab().CJ = new u1()); + return ab().CJ; + } + function ofa() { + var a10 = ab(); + if (null === ab().sJ && null === ab().sJ) { + var b10 = ab(), c10 = new M0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.sJ = c10; + } + return ab().sJ; + } + d7.$classData = r8({ Tra: 0 }, false, "amf.client.convert.CoreClientConverters$", { Tra: 1, f: 1, C6: 1, ib: 1, A6: 1, J6: 1, I6: 1, D6: 1, P6: 1, M6: 1, Q6: 1, E6: 1, H6: 1, F6: 1, U6: 1, S6: 1, G6: 1, y6: 1, O6: 1, K6: 1, R6: 1, T6: 1, L6: 1, z6: 1, N6: 1, B6: 1 }); + var Nwb = void 0; + function ab() { + Nwb || (Nwb = new Mwb().a()); + return Nwb; + } + function Owb() { + this.ea = this.PM = this.MI = this.WC = this.qx = this.Bx = this.Xt = this.WM = this.dz = this.bz = this.CJ = this.Lt = this.Kt = this.Wt = this.Vt = this.TI = this.rJ = this.LI = this.LJ = this.JJ = this.bu = this.Nt = this.Hy = this.AJ = this.$M = this.IJ = this.sJ = this.PI = this.yJ = this.RI = this.MJ = this.tJ = this.gz = this.Fy = this.UI = this.aJ = this.OI = this.Gq = null; + } + Owb.prototype = new u7(); + Owb.prototype.constructor = Owb; + d7 = Owb.prototype; + d7.a = function() { + Pwb = this; + this.ea = nv().ea; + return this; + }; + d7.cS = function() { + null === PH().Vt && this.qJ(); + PH(); + }; + d7.BJ = function() { + null === PH().Wt && (PH().Wt = new Z_().Br(this)); + }; + d7.Lf = function() { + null === PH().Gq && this.FJ(); + return PH().Gq; + }; + function UH(a10, b10) { + var c10 = a10.$e(); + b10 = il(jl(a10, b10, c10)).Yg(w6(/* @__PURE__ */ function() { + return function(e10) { + if (e10 instanceof Fl) + e10 = new P9().UG(e10); + else if (e10 instanceof Hl) + e10 = new Q9().VG(e10); + else if (e10 instanceof mf) + e10 = new B8().Xz(e10); + else if (e10 instanceof bg) + e10 = new m9().RG(e10); + else if (e10 instanceof Mk) + e10 = new s9().QG(e10); + else if (e10 instanceof vl) + e10 = new r9().NK(e10); + else if (e10 instanceof ql) + e10 = new q9().MK(e10); + else if (e10 instanceof xl) + e10 = new t9().OK(e10); + else if (e10 instanceof zl) + e10 = new v9().PK(e10); + else if (e10 instanceof Dl) + e10 = new x9().RK(e10); + else if (e10 instanceof ol) + e10 = new p9().LK(e10); + else if (e10 instanceof Bl) + e10 = new w9().QK(e10); + else if (e10 instanceof tl) + e10 = new u9().Yz(e10); + else { + if (!(e10 instanceof ad)) + throw new x7().d(e10); + e10 = new X7().TG(e10); + } + return e10; + }; + }(a10)), ml()); + rZa || (rZa = new W22().a()); + return ll(a10, b10, rZa).Ra(); + } + d7.n5 = function() { + null === PH().Hy && (PH().Hy = DWa(this)); + }; + d7.FJ = function() { + null === PH().Gq && (PH().Gq = new Q_().ep(this)); + }; + d7.NI = function() { + null === PH().Kt && (PH().Kt = new W_().Br(this)); + }; + d7.no = function() { + null === PH().bu && this.mS(); + return PH().bu; + }; + d7.qJ = function() { + null === PH().Vt && (PH().Vt = new Y_().Br(this)); + }; + d7.o8 = function() { + null === PH().gz && (PH().gz = new R_().ep(this)); + }; + d7.Um = function() { + null === PH().Lt && this.xR(); + return PH().Lt; + }; + d7.Yo = function() { + null === PH().gz && this.o8(); + return PH().gz; + }; + d7.$e = function() { + null === PH().Hy && this.n5(); + return PH().Hy; + }; + d7.qR = function() { + null === PH().Kt && this.NI(); + PH(); + }; + d7.eS = function() { + null === PH().Wt && this.BJ(); + PH(); + }; + d7.xR = function() { + null === PH().Lt && (PH().Lt = new X_().Br(this)); + }; + d7.zR = function() { + null === PH().Nt && (PH().Nt = HWa(this)); + }; + d7.jr = function() { + null === PH().Nt && this.zR(); + return PH().Nt; + }; + d7.mS = function() { + null === PH().bu && (PH().bu = new C1()); + }; + d7.$classData = r8({ z6a: 0 }, false, "webapi.WebApiClientConverters$", { z6a: 1, f: 1, B6: 1, C6: 1, ib: 1, A6: 1, J6: 1, I6: 1, D6: 1, P6: 1, M6: 1, Q6: 1, E6: 1, H6: 1, F6: 1, U6: 1, S6: 1, G6: 1, y6: 1, O6: 1, K6: 1, R6: 1, T6: 1, L6: 1, z6: 1, N6: 1 }); + var Pwb = void 0; + function PH() { + Pwb || (Pwb = new Owb().a()); + return Pwb; + } + function Qwb() { + } + Qwb.prototype = new twb(); + Qwb.prototype.constructor = Qwb; + function Rwb() { + } + d7 = Rwb.prototype = Qwb.prototype; + d7.Hd = function() { + return this; + }; + d7.P = function(a10) { + return iba(this, a10); + }; + d7.Kj = function() { + return this; + }; + d7.b = function() { + return 0 === this.jb(); + }; + d7.ng = function() { + return this; + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.h = function(a10) { + return U22(this, a10); + }; + d7.ro = function(a10) { + return this.P(a10) | 0; + }; + d7.lu = function(a10, b10) { + a10 = this.Ja(a10); + if (a10 instanceof z7) + b10 = a10.i; + else if (y7() === a10) + b10 = Hb(b10); + else + throw new x7().d(a10); + return b10; + }; + d7.t = function() { + return C6(this); + }; + d7.Er = function() { + return new b52().Vd(this); + }; + d7.ls = function() { + return nu(); + }; + d7.Mj = function() { + return dwb(this); + }; + d7.Ur = function() { + return new Fc().Vd(this); + }; + d7.Ep = function(a10) { + return !!this.P(a10); + }; + d7.Ye = function() { + return new c52().Vd(this); + }; + d7.f5 = function(a10) { + throw new iL().e("key not found: " + a10); + }; + d7.Si = function(a10) { + return this.w$(a10); + }; + d7.Ha = function(a10) { + return this.Ja(a10).na(); + }; + d7.rm = function(a10, b10, c10, e10) { + return ewb(this, a10, b10, c10, e10); + }; + d7.ke = function() { + return xO(this); + }; + d7.w$ = function(a10) { + return R9(this, a10); + }; + d7.Sa = function(a10) { + return this.Ha(a10); + }; + d7.KB = function() { + return new X9().Vd(this); + }; + d7.Vh = function() { + return this.ke(); + }; + d7.z = function() { + var a10 = MJ(); + return aya(a10, this, a10.sba); + }; + d7.Wa = function(a10, b10) { + return fwb(this, a10, b10); + }; + d7.Qd = function() { + return UA(new VA(), this.ls()); + }; + d7.Xk = function() { + return "Map"; + }; + function Swb() { + } + Swb.prototype = new twb(); + Swb.prototype.constructor = Swb; + function Y9() { + } + d7 = Y9.prototype = Swb.prototype; + d7.Hd = function() { + return this; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.Kj = function() { + return this; + }; + d7.b = function() { + return 0 === this.jb(); + }; + d7.ng = function() { + return this; + }; + d7.h = function(a10) { + return r7a(this, a10); + }; + d7.ro = function(a10) { + return this.Ha(a10) | 0; + }; + d7.t = function() { + return C6(this); + }; + d7.Di = function() { + return r9a(); + }; + d7.qea = function(a10) { + return this.oh(a10); + }; + d7.W4 = function(a10) { + return Ida(this, a10); + }; + d7.Mj = function() { + return Hvb(this); + }; + d7.Ep = function(a10) { + return this.Ha(a10); + }; + d7.lv = function() { + return this.e$(); + }; + d7.ke = function() { + return kz(this); + }; + d7.dO = function(a10) { + return Ida(this, a10); + }; + d7.e$ = function() { + return this.Di().Rz(); + }; + d7.Vh = function() { + return kz(this); + }; + d7.z = function() { + var a10 = MJ(); + return aya(a10, this, a10.Zda); + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.z1 = function(a10) { + return this.Cb(a10); + }; + d7.Lk = function(a10) { + return Ivb(this, a10); + }; + d7.Qd = function() { + return wd(new xd(), this.lv()); + }; + d7.Xk = function() { + return "Set"; + }; + d7.OW = function(a10) { + return this.Lk(a10); + }; + function Z9(a10, b10) { + return a10.Sw(oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return Sj(c10).gp(e10); + }; + }(a10, b10))); + } + function $9(a10) { + return a10.Sw(oq(/* @__PURE__ */ function(b10) { + return function() { + return Sj(b10).fj(); + }; + }(a10))); + } + function a$(a10, b10) { + return a10.Sw(oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return Sj(c10).jC(e10); + }; + }(a10, b10))); + } + function Twb(a10, b10) { + $B(); + b10 = new $42().d(b10); + return tub(a10, b10); + } + function b$(a10, b10, c10) { + return a10.Sw(oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + return Sj(e10).ei(f10, g10); + }; + }(a10, b10, c10))); + } + function Uwb(a10, b10) { + return a10.Sw(oq(/* @__PURE__ */ function(c10, e10) { + return function() { + var f10 = Sj(c10), g10 = K7(); + return f10.Tr(e10, g10.u); + }; + }(a10, b10))); + } + function c$(a10, b10) { + return a10.Sw(oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return Sj(c10).cq(e10); + }; + }(a10, b10))); + } + function Vwb(a10, b10) { + var c10 = H10(); + return a10.qP(ji(b10, c10)); + } + function Wwb(a10, b10) { + return a10.CE(aK(bK(), 0, b10)); + } + function d$(a10, b10) { + return a10.Sw(oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return Sj(c10).nk(e10); + }; + }(a10, b10))); + } + function yub(a10, b10) { + return a10.CE(aK(bK(), b10, 2147483647)); + } + function H42() { + this.th = this.GV = null; + } + H42.prototype = new Rwb(); + H42.prototype.constructor = H42; + function Xwb() { + } + d7 = Xwb.prototype = H42.prototype; + d7.al = function(a10) { + return this.wp(a10); + }; + d7.ufa = function(a10) { + var b10 = UA(new VA(), nu()); + yi(b10, this); + a10 = new R6().M(a10.ma(), a10.ya()); + WA(b10, a10); + return b10.eb; + }; + d7.U = function(a10) { + this.th.U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + return b10.GV.P(e10.ma()) ? c10.P(e10) : void 0; + }; + }(this, a10))); + }; + d7.wp = function(a10) { + return Awb(this, a10); + }; + d7.u1 = function(a10, b10) { + this.GV = b10; + if (null === a10) + throw mb(E6(), null); + this.th = a10; + return this; + }; + d7.mb = function() { + var a10 = this.th.mb(); + return new V42().ou(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + return !!b10.GV.P(c10.ma()); + }; + }(this))); + }; + d7.Ja = function(a10) { + return this.GV.P(a10) ? this.th.Ja(a10) : y7(); + }; + d7.Ha = function(a10) { + return !!this.GV.P(a10) && this.th.Ha(a10); + }; + d7.Ru = function(a10) { + return this.ufa(a10); + }; + d7.$classData = r8({ cpa: 0 }, false, "scala.collection.MapLike$FilteredKeys", { cpa: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, Xoa: 1 }); + function Ywb() { + this.th = this.I0 = null; + } + Ywb.prototype = new Rwb(); + Ywb.prototype.constructor = Ywb; + function Zwb() { + } + d7 = Zwb.prototype = Ywb.prototype; + d7.U = function(a10) { + gE(new hE(), this.th, w6(/* @__PURE__ */ function() { + return function(b10) { + return null !== b10; + }; + }(this))).U(w6(/* @__PURE__ */ function(b10, c10) { + return function(e10) { + if (null !== e10) { + var f10 = e10.ma(); + e10 = e10.ya(); + return c10.P(new R6().M(f10, b10.I0.P(e10))); + } + throw new x7().d(e10); + }; + }(this, a10))); + }; + d7.u1 = function(a10, b10) { + this.I0 = b10; + if (null === a10) + throw mb(E6(), null); + this.th = a10; + return this; + }; + d7.jb = function() { + return this.th.jb(); + }; + d7.mb = function() { + var a10 = this.th.mb(); + a10 = new V42().ou(a10, w6(/* @__PURE__ */ function() { + return function(b10) { + return null !== b10; + }; + }(this))); + return new YB().ou(a10, w6(/* @__PURE__ */ function(b10) { + return function(c10) { + if (null !== c10) { + var e10 = c10.ma(); + c10 = c10.ya(); + return new R6().M(e10, b10.I0.P(c10)); + } + throw new x7().d(c10); + }; + }(this))); + }; + d7.Ja = function(a10) { + a10 = this.th.Ja(a10); + var b10 = this.I0; + return a10.b() ? y7() : new z7().d(b10.P(a10.c())); + }; + d7.Ha = function(a10) { + return this.th.Ha(a10); + }; + function $wb(a10, b10) { + var c10 = UA(new VA(), nu()); + yi(c10, a10); + a10 = new R6().M(b10.ma(), b10.ya()); + WA(c10, a10); + return c10.eb; + } + function axb(a10, b10) { + var c10 = UA(new VA(), nu()); + gE(new hE(), a10, w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return !Va(Wa(), g10.ma(), f10); + }; + }(a10, b10))).U(w6(/* @__PURE__ */ function(e10, f10) { + return function(g10) { + return f10.jd(g10); + }; + }(a10, c10))); + return c10.eb; + } + function X9() { + this.th = null; + } + X9.prototype = new Y9(); + X9.prototype.constructor = X9; + function bxb() { + } + d7 = bxb.prototype = X9.prototype; + d7.al = function(a10) { + return this.Qs(a10); + }; + d7.U = function(a10) { + var b10 = this.th.Er(); + yT(b10, a10); + }; + d7.jb = function() { + return this.th.jb(); + }; + d7.mb = function() { + return this.th.Er(); + }; + d7.Qs = function(a10) { + return J5(r9a(), H10()).Lk(this).Qs(a10); + }; + d7.Vd = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.th = a10; + return this; + }; + d7.Ha = function(a10) { + return this.th.Ha(a10); + }; + d7.Zj = function(a10) { + return J5(r9a(), H10()).Lk(this).Zj(a10); + }; + d7.$classData = r8({ F2: 0 }, false, "scala.collection.MapLike$DefaultKeySet", { F2: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, q: 1, o: 1 }); + function W9() { + this.xa = false; + this.l = null; + } + W9.prototype = new u7(); + W9.prototype.constructor = W9; + d7 = W9.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.CE = function(a10) { + return cxb(this, a10); + }; + d7.ga = function() { + return this.mb().$a(); + }; + d7.lb = function(a10) { + return this.l.lb(a10); + }; + d7.Oe = function(a10) { + return nub(this, a10); + }; + d7.im = function() { + return this.mb(); + }; + d7.fm = function(a10) { + return M8(this, a10); + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.ps = function(a10) { + return new e$().Ao(this, a10); + }; + d7.Od = function(a10) { + var b10 = this.mb(); + return eLa(b10, a10); + }; + d7.ua = function() { + var a10 = ii().u; + return qt(this, a10); + }; + d7.b = function() { + return 0 === this.Oe(0); + }; + d7.mW = function() { + return Qx(this); + }; + d7.Kj = function() { + return this; + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.bd = function(a10) { + return new e$().Ao(this, a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.ro = function(a10) { + return this.lb(a10) | 0; + }; + d7.gl = function(a10) { + return this.fy(a10); + }; + d7.Kg = function(a10) { + return Rj(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return Rj(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.yg = function(a10) { + return Twb(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.t = function() { + return h9(this); + }; + d7.Di = function() { + return K7(); + }; + d7.U = function(a10) { + var b10 = this.mb(); + yT(b10, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.xM = function() { + return ""; + }; + d7.qs = function(a10, b10) { + var c10 = this.mb(); + return hya(c10, a10, b10); + }; + d7.qP = function(a10) { + return new f$().cH(this, a10); + }; + d7.wm = function(a10, b10) { + return oub(this, a10, b10); + }; + d7.Tr = function(a10) { + return Uwb(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.xl = function(a10) { + return this.gy(a10); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return this.rn(a10); + }; + d7.st = function() { + return new dxb().nt(this); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Mj = function() { + var a10 = b32().u; + return qt(this, a10); + }; + d7.fj = function() { + return $9(this); + }; + d7.Vr = function(a10) { + return Vwb(this, a10); + }; + d7.Ep = function(a10) { + return !!this.lb(a10); + }; + d7.mb = function() { + return this.l.mb(); + }; + d7.Fb = function(a10) { + var b10 = this.mb(); + return hLa(b10, a10); + }; + d7.Pm = function(a10) { + return sub(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.cm = function() { + return Rj(this, "", "", ""); + }; + d7.BL = function(a10) { + return new g$().cH(this, a10); + }; + d7.ia = function(a10) { + return tub(this, a10); + }; + d7.og = function(a10) { + return uwb(this, a10); + }; + d7.Oa = function() { + return this.l.Oa(); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.hm = function() { + return -1; + }; + d7.Dm = function(a10) { + return uub(this, a10); + }; + d7.gy = function(a10) { + return new exb().Ao(this, a10); + }; + d7.Jk = function(a10) { + return Wwb(this, a10); + }; + d7.Dd = function() { + return this.mb().Dd(); + }; + d7.wy = function() { + return new W9().aL(this); + }; + d7.Rk = function(a10) { + return yub(this, a10); + }; + d7.BE = function(a10) { + return new h$().Ao(this, a10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return j9(this); + }; + d7.op = function() { + return this; + }; + d7.rm = function(a10, b10, c10, e10) { + return Fda(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.ke = function() { + return this; + }; + d7.uK = function(a10) { + return this.rn(a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this; + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Sw = function(a10) { + return fxb(this, a10); + }; + d7.DL = function(a10) { + return cxb(this, a10); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + Psb(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.am = function(a10) { + return vub(this, a10); + }; + d7.rn = function(a10) { + return new gxb().Ao(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = this.mb(); b10.Ya(); ) { + var c10 = b10.$a(); + WA(a10, c10); + } + return a10.eb; + }; + d7.ka = function(a10) { + return new h$().Ao(this, a10); + }; + d7.jM = function(a10, b10) { + return rub(this, a10, b10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.aL = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.Da = function() { + return tc(this); + }; + d7.fy = function(a10) { + return new hxb().Ao(this, a10); + }; + d7.ec = function(a10) { + return wub(this, a10); + }; + d7.Qd = function() { + return xub(this); + }; + d7.CL = function(a10) { + return fxb(this, a10); + }; + d7.Xk = function() { + return "SeqView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.rF = function(a10) { + return ixb(this, a10); + }; + d7.$classData = r8({ mab: 0 }, false, "scala.collection.SeqLike$$anon$2", { mab: 1, f: 1, ol: 1, pl: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1 }); + function ru() { + this.cR = this.th = null; + } + ru.prototype = new bxb(); + ru.prototype.constructor = ru; + ru.prototype.U = function(a10) { + var b10 = this.cR, c10 = b10.ze; + b10 = pD(b10); + for (var e10 = c10.n[b10]; null !== e10; ) { + var f10 = e10.$a(); + a10.P(e10.la); + for (e10 = f10; null === e10 && 0 < b10; ) + b10 = -1 + b10 | 0, e10 = c10.n[b10]; + } + }; + ru.prototype.Yn = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.cR = a10; + X9.prototype.Vd.call(this, a10); + return this; + }; + ru.prototype.$classData = r8({ tdb: 0 }, false, "scala.collection.mutable.HashMap$$anon$1", { tdb: 1, F2: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, q: 1, o: 1 }); + function i$() { + this.th = null; + } + i$.prototype = new bxb(); + i$.prototype.constructor = i$; + i$.prototype.lv = function() { + return new fw().a(); + }; + i$.prototype.e$ = function() { + return new fw().a(); + }; + i$.prototype.cL = function(a10) { + X9.prototype.Vd.call(this, a10); + return this; + }; + i$.prototype.$classData = r8({ Pdb: 0 }, false, "scala.collection.mutable.LinkedHashMap$DefaultKeySet", { Pdb: 1, F2: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, q: 1, o: 1 }); + function j$(a10, b10) { + return a10.lW().lb((-1 + a10.lW().Oa() | 0) - b10 | 0); + } + function k$(a10) { + var b10 = H10(); + b10 = new qd().d(b10); + a10.lW().U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + e10.oa = ji(f10, e10.oa); + }; + }(a10, b10))); + return uc(b10.oa); + } + function jxb() { + } + jxb.prototype = new Rwb(); + jxb.prototype.constructor = jxb; + function l$() { + } + d7 = l$.prototype = jxb.prototype; + d7.Hd = function() { + return this; + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Di = function() { + return Id(); + }; + d7.ls = function() { + return this.f$(); + }; + d7.f$ = function() { + return nu(); + }; + d7.uq = function(a10) { + return AMa(this, a10); + }; + d7.Si = function(a10) { + return this.w$(a10); + }; + d7.KB = function() { + return pd(this); + }; + d7.Ch = function() { + return this; + }; + d7.Vh = function() { + return xO(this); + }; + function kxb() { + this.xa = false; + this.l = null; + } + kxb.prototype = new u7(); + kxb.prototype.constructor = kxb; + d7 = kxb.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.CE = function(a10) { + return lxb(this, a10); + }; + d7.ga = function() { + return this.mb().$a(); + }; + d7.lb = function(a10) { + return Uu(this.l, a10); + }; + d7.Oe = function(a10) { + return nub(this, a10); + }; + d7.im = function() { + return this.mb(); + }; + d7.fm = function(a10) { + return M8(this, a10); + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.ps = function(a10) { + return new m$().jl(this, a10); + }; + d7.Od = function(a10) { + var b10 = this.mb(); + return eLa(b10, a10); + }; + d7.ua = function() { + var a10 = ii().u; + return qt(this, a10); + }; + d7.b = function() { + return 0 === this.Oe(0); + }; + d7.mW = function() { + return Qx(this); + }; + d7.Kj = function() { + return this; + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.bd = function(a10) { + return new m$().jl(this, a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.ro = function(a10) { + return this.lb(a10) | 0; + }; + d7.gl = function(a10) { + return this.fy(a10); + }; + d7.Kg = function(a10) { + return Rj(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return Rj(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.yg = function(a10) { + return Twb(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.t = function() { + return h9(this); + }; + d7.Di = function() { + return K7(); + }; + d7.U = function(a10) { + var b10 = this.mb(); + yT(b10, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.xM = function() { + return ""; + }; + d7.qs = function(a10, b10) { + var c10 = this.mb(); + return hya(c10, a10, b10); + }; + d7.qP = function(a10) { + return new n$().eH(this, a10); + }; + d7.wm = function(a10, b10) { + return oub(this, a10, b10); + }; + d7.Tr = function(a10) { + return Uwb(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.xl = function(a10) { + return this.gy(a10); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.w1 = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.Cb = function(a10) { + return this.rn(a10); + }; + d7.st = function() { + return new o$().pu(this); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Mj = function() { + var a10 = b32().u; + return qt(this, a10); + }; + d7.fj = function() { + return $9(this); + }; + d7.Vr = function(a10) { + return Vwb(this, a10); + }; + d7.Ep = function(a10) { + return !!this.lb(a10); + }; + d7.mb = function() { + return new y9a().w1(this.l); + }; + d7.Fb = function(a10) { + var b10 = this.mb(); + return hLa(b10, a10); + }; + d7.Pm = function(a10) { + return sub(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.cm = function() { + return Rj(this, "", "", ""); + }; + d7.BL = function(a10) { + return new p$().eH(this, a10); + }; + d7.ia = function(a10) { + return tub(this, a10); + }; + d7.og = function(a10) { + return uwb(this, a10); + }; + d7.Oa = function() { + return this.l.Oa(); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.hm = function() { + return -1; + }; + d7.Dm = function(a10) { + return uub(this, a10); + }; + d7.gy = function(a10) { + return new q$().jl(this, a10); + }; + d7.Jk = function(a10) { + return Wwb(this, a10); + }; + d7.Dd = function() { + return this.mb().Dd(); + }; + d7.wy = function() { + return new W9().aL(this); + }; + d7.Rk = function(a10) { + return yub(this, a10); + }; + d7.BE = function(a10) { + return new r$().jl(this, a10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return j9(this); + }; + d7.op = function() { + return this; + }; + d7.rm = function(a10, b10, c10, e10) { + return Fda(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.ke = function() { + return this; + }; + d7.uK = function(a10) { + return this.rn(a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this; + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Sw = function(a10) { + return mxb(this, a10); + }; + d7.DL = function(a10) { + return lxb(this, a10); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + Psb(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.am = function(a10) { + return vub(this, a10); + }; + d7.rn = function(a10) { + return new s$().jl(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = this.mb(); b10.Ya(); ) { + var c10 = b10.$a(); + WA(a10, c10); + } + return a10.eb; + }; + d7.ka = function(a10) { + return new r$().jl(this, a10); + }; + d7.jM = function(a10, b10) { + return rub(this, a10, b10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.fy = function(a10) { + return new t$().jl(this, a10); + }; + d7.ec = function(a10) { + return wub(this, a10); + }; + d7.Qd = function() { + return xub(this); + }; + d7.CL = function(a10) { + return mxb(this, a10); + }; + d7.Xk = function() { + return "StreamView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.rF = function(a10) { + return nxb(this, a10); + }; + d7.$classData = r8({ Ybb: 0 }, false, "scala.collection.immutable.Stream$$anon$1", { Ybb: 1, f: 1, zA: 1, AA: 1, ol: 1, pl: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1 }); + function u$() { + this.xa = false; + this.l = null; + } + u$.prototype = new u7(); + u$.prototype.constructor = u$; + function v$() { + } + d7 = v$.prototype = u$.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.CE = function(a10) { + return cxb(this, a10); + }; + d7.ga = function() { + return this.mb().$a(); + }; + d7.Oe = function(a10) { + return nub(this, a10); + }; + d7.mqa = function(a10) { + return Wwb(this, a10); + }; + d7.im = function() { + return this.mb(); + }; + d7.fm = function(a10) { + return M8(this, a10); + }; + d7.ps = function(a10) { + return this.Q1(a10); + }; + d7.Od = function(a10) { + var b10 = this.mb(); + return eLa(b10, a10); + }; + d7.ua = function() { + var a10 = ii().u; + return qt(this, a10); + }; + d7.b = function() { + return !this.mb().Ya(); + }; + d7.Kj = function() { + return this; + }; + d7.mW = function() { + return Qx(this); + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ng = function() { + return this.ok(); + }; + d7.nt = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.bd = function(a10) { + return this.Q1(a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.gl = function(a10) { + return this.mka(a10); + }; + d7.ro = function(a10) { + return this.P(a10) | 0; + }; + d7.Kg = function(a10) { + return Rj(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return Rj(this, a10, b10, c10); + }; + d7.Fba = function(a10) { + return new hxb().Ao(this, a10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.yg = function(a10) { + return Twb(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.Hba = function() { + return new dxb().nt(this); + }; + d7.t = function() { + return h9(this); + }; + d7.Di = function() { + return K7(); + }; + d7.Gba = function(a10) { + return new gxb().Ao(this, a10); + }; + d7.U = function(a10) { + var b10 = this.mb(); + yT(b10, a10); + }; + d7.lqa = function(a10) { + return this.gy(a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.xM = function() { + return "" + this.l.xM() + this.Pl(); + }; + d7.qP = function(a10) { + return new f$().cH(this, a10); + }; + d7.qs = function(a10, b10) { + var c10 = this.mb(); + return hya(c10, a10, b10); + }; + d7.wm = function(a10, b10) { + return oub(this, a10, b10); + }; + d7.Tr = function(a10) { + return Uwb(this, a10); + }; + d7.xl = function(a10) { + return this.lqa(a10); + }; + d7.kc = function() { + return Jvb(this); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return this.uK(a10); + }; + d7.st = function() { + return this.Moa(); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Mj = function() { + var a10 = b32().u; + return qt(this, a10); + }; + d7.Q1 = function(a10) { + return this.qna(a10); + }; + d7.fj = function() { + return $9(this); + }; + d7.Vr = function(a10) { + return Vwb(this, a10); + }; + d7.Ep = function(a10) { + return !!this.P(a10); + }; + d7.Iba = function(a10) { + return new exb().Ao(this, a10); + }; + d7.Fb = function(a10) { + var b10 = this.mb(); + return hLa(b10, a10); + }; + d7.Pm = function(a10) { + return sub(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.mka = function(a10) { + return this.fy(a10); + }; + d7.rna = function(a10) { + return new h$().Ao(this, a10); + }; + d7.Moa = function() { + return this.Hba(); + }; + d7.BL = function(a10) { + return this.pna(a10); + }; + d7.cm = function() { + return Rj(this, "", "", ""); + }; + d7.ia = function(a10) { + return tub(this, a10); + }; + d7.og = function(a10) { + return uwb(this, a10); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.sna = function(a10) { + return ixb(this, a10); + }; + d7.hm = function() { + return -1; + }; + d7.Dm = function(a10) { + return uub(this, a10); + }; + d7.gy = function(a10) { + return this.Iba(a10); + }; + d7.Jk = function(a10) { + return this.mqa(a10); + }; + d7.nka = function(a10) { + return yub(this, a10); + }; + d7.Dd = function() { + return this.mb().Dd(); + }; + d7.wy = function() { + return new W9().aL(this); + }; + d7.Rk = function(a10) { + return this.nka(a10); + }; + d7.BE = function(a10) { + return this.rna(a10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ta = function() { + return this.kqa(); + }; + d7.ok = function() { + return this; + }; + d7.rm = function(a10, b10, c10, e10) { + return Fda(this, a10, b10, c10, e10); + }; + d7.op = function() { + return this.ng(); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.ke = function() { + return this.ok(); + }; + d7.uK = function(a10) { + return this.rn(a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this; + }; + d7.Ql = function(a10, b10) { + return this.ne(a10, b10); + }; + d7.Sw = function(a10) { + return fxb(this, a10); + }; + d7.DL = function(a10) { + return this.CE(a10); + }; + d7.Jba = function(a10) { + return this.sna(a10); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + Psb(this, a10, b10, c10); + }; + d7.Vh = function() { + return this.ok(); + }; + d7.Do = function() { + return true; + }; + d7.am = function(a10) { + return vub(this, a10); + }; + d7.z = function() { + return pT(this); + }; + d7.rn = function(a10) { + return this.Gba(a10); + }; + d7.pna = function(a10) { + return new g$().cH(this, a10); + }; + d7.Ch = function(a10) { + var b10 = UA(new VA(), nu()); + this.U(w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return e10.jd(f10); + }; + }(this, b10, a10))); + return b10.eb; + }; + d7.ka = function(a10) { + return this.BE(a10); + }; + d7.jM = function(a10, b10) { + return rub(this, a10, b10); + }; + d7.qna = function(a10) { + return new e$().Ao(this, a10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.fy = function(a10) { + return this.Fba(a10); + }; + d7.ec = function(a10) { + return wub(this, a10); + }; + d7.CL = function(a10) { + return this.Sw(a10); + }; + d7.Qd = function() { + return xub(this); + }; + d7.Xk = function() { + return "SeqView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.kqa = function() { + return j9(this); + }; + d7.rF = function(a10) { + return this.Jba(a10); + }; + function oxb(a10) { + return 0 >= a10.o3().Oe(a10.K2().Oa()) ? a10.o3().Oa() : a10.K2().Oa(); + } + function pxb(a10, b10) { + return new R6().M(a10.K2().lb(b10), a10.o3().lb(b10)); + } + function qxb() { + } + qxb.prototype = new Y9(); + qxb.prototype.constructor = qxb; + function rxb() { + } + d7 = rxb.prototype = qxb.prototype; + d7.Hd = function() { + return this; + }; + d7.rP = function() { + throw new iL().e("next of empty set"); + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return this.iX(a10); + }; + d7.b = function() { + return true; + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.KC = function(a10) { + return sxb(this, a10); + }; + d7.Di = function() { + Snb || (Snb = new h8().a()); + return Snb; + }; + d7.jb = function() { + return 0; + }; + d7.mb = function() { + var a10 = w$(this); + return uc(a10); + }; + d7.Qs = function(a10) { + return this.iX(a10); + }; + d7.lv = function() { + return Rnb(); + }; + function w$(a10) { + for (var b10 = H10(); !a10.b(); ) { + var c10 = a10.pT(); + b10 = ji(c10, b10); + a10 = a10.rP(); + } + return b10; + } + d7.pT = function() { + throw new iL().e("elem of empty set"); + }; + d7.Ha = function() { + return false; + }; + function txb(a10, b10) { + return b10.b() ? a10 : b10.Ql(a10, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return c10.KC(e10); + }; + }(a10))); + } + d7.xg = function() { + return this; + }; + d7.iX = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.KC(a10); + }; + d7.Lk = function(a10) { + return txb(this, a10); + }; + d7.Xk = function() { + return "ListSet"; + }; + function uxb() { + } + uxb.prototype = new Y9(); + uxb.prototype.constructor = uxb; + d7 = uxb.prototype; + d7.Hd = function() { + return this; + }; + d7.a = function() { + return this; + }; + d7.P = function() { + return false; + }; + d7.al = function() { + return this; + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Di = function() { + return qe2(); + }; + d7.U = function() { + }; + d7.jb = function() { + return 0; + }; + d7.mb = function() { + return $B().ce; + }; + d7.Qs = function() { + return this; + }; + d7.lv = function() { + return vd(); + }; + d7.Ha = function() { + return false; + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return new x$().d(a10); + }; + d7.$classData = r8({ Rbb: 0 }, false, "scala.collection.immutable.Set$EmptySet$", { Rbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + var vxb = void 0; + function vd() { + vxb || (vxb = new uxb().a()); + return vxb; + } + function x$() { + this.dg = null; + } + x$.prototype = new Y9(); + x$.prototype.constructor = x$; + d7 = x$.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return this.dg; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return this.Qu(a10); + }; + d7.Od = function(a10) { + return !!a10.P(this.dg); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.oh = function(a10) { + return !!a10.P(this.dg); + }; + d7.Di = function() { + return qe2(); + }; + d7.U = function(a10) { + a10.P(this.dg); + }; + d7.jb = function() { + return 1; + }; + d7.d = function(a10) { + this.dg = a10; + return this; + }; + d7.mb = function() { + $B(); + var a10 = new Ib().ha([this.dg]); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Qs = function(a10) { + return this.Qu(a10); + }; + d7.Fb = function(a10) { + return a10.P(this.dg) ? new z7().d(this.dg) : y7(); + }; + d7.lv = function() { + return vd(); + }; + d7.LC = function(a10) { + return this.Ha(a10) ? this : new y$().M(this.dg, a10); + }; + d7.ta = function() { + return vd(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.dg); + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.LC(a10); + }; + d7.Qu = function(a10) { + return Va(Wa(), a10, this.dg) ? vd() : this; + }; + d7.$classData = r8({ Sbb: 0 }, false, "scala.collection.immutable.Set$Set1", { Sbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + function y$() { + this.Sh = this.dg = null; + } + y$.prototype = new Y9(); + y$.prototype.constructor = y$; + d7 = y$.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return this.dg; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return this.Qu(a10); + }; + d7.Od = function(a10) { + return !!a10.P(this.dg) || !!a10.P(this.Sh); + }; + d7.FW = function() { + return new x$().d(this.Sh); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.M = function(a10, b10) { + this.dg = a10; + this.Sh = b10; + return this; + }; + d7.oh = function(a10) { + return !!a10.P(this.dg) && !!a10.P(this.Sh); + }; + d7.Di = function() { + return qe2(); + }; + d7.U = function(a10) { + a10.P(this.dg); + a10.P(this.Sh); + }; + d7.jb = function() { + return 2; + }; + d7.mb = function() { + $B(); + var a10 = new Ib().ha([this.dg, this.Sh]); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Qs = function(a10) { + return this.Qu(a10); + }; + d7.Fb = function(a10) { + return a10.P(this.dg) ? new z7().d(this.dg) : a10.P(this.Sh) ? new z7().d(this.Sh) : y7(); + }; + d7.lv = function() { + return vd(); + }; + d7.LC = function(a10) { + return this.Ha(a10) ? this : new z$().Dr(this.dg, this.Sh, a10); + }; + d7.ta = function() { + return this.FW(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.dg) || Va(Wa(), a10, this.Sh); + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.LC(a10); + }; + d7.Qu = function(a10) { + return Va(Wa(), a10, this.dg) ? new x$().d(this.Sh) : Va(Wa(), a10, this.Sh) ? new x$().d(this.dg) : this; + }; + d7.$classData = r8({ Tbb: 0 }, false, "scala.collection.immutable.Set$Set2", { Tbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + function z$() { + this.Il = this.Sh = this.dg = null; + } + z$.prototype = new Y9(); + z$.prototype.constructor = z$; + d7 = z$.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return this.dg; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return this.Qu(a10); + }; + d7.Od = function(a10) { + return !!a10.P(this.dg) || !!a10.P(this.Sh) || !!a10.P(this.Il); + }; + d7.FW = function() { + return new y$().M(this.Sh, this.Il); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.oh = function(a10) { + return !!a10.P(this.dg) && !!a10.P(this.Sh) && !!a10.P(this.Il); + }; + d7.Di = function() { + return qe2(); + }; + d7.U = function(a10) { + a10.P(this.dg); + a10.P(this.Sh); + a10.P(this.Il); + }; + d7.jb = function() { + return 3; + }; + d7.Dr = function(a10, b10, c10) { + this.dg = a10; + this.Sh = b10; + this.Il = c10; + return this; + }; + d7.mb = function() { + $B(); + var a10 = new Ib().ha([this.dg, this.Sh, this.Il]); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Qs = function(a10) { + return this.Qu(a10); + }; + d7.Fb = function(a10) { + return a10.P(this.dg) ? new z7().d(this.dg) : a10.P(this.Sh) ? new z7().d(this.Sh) : a10.P(this.Il) ? new z7().d(this.Il) : y7(); + }; + d7.lv = function() { + return vd(); + }; + d7.LC = function(a10) { + return this.Ha(a10) ? this : new wxb().dA(this.dg, this.Sh, this.Il, a10); + }; + d7.ta = function() { + return this.FW(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.dg) || Va(Wa(), a10, this.Sh) || Va(Wa(), a10, this.Il); + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.LC(a10); + }; + d7.Qu = function(a10) { + return Va(Wa(), a10, this.dg) ? new y$().M(this.Sh, this.Il) : Va(Wa(), a10, this.Sh) ? new y$().M(this.dg, this.Il) : Va(Wa(), a10, this.Il) ? new y$().M(this.dg, this.Sh) : this; + }; + d7.$classData = r8({ Ubb: 0 }, false, "scala.collection.immutable.Set$Set3", { Ubb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + function wxb() { + this.kv = this.Il = this.Sh = this.dg = null; + } + wxb.prototype = new Y9(); + wxb.prototype.constructor = wxb; + d7 = wxb.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return this.dg; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return this.Qu(a10); + }; + d7.Od = function(a10) { + return !!a10.P(this.dg) || !!a10.P(this.Sh) || !!a10.P(this.Il) || !!a10.P(this.kv); + }; + d7.FW = function() { + return new z$().Dr(this.Sh, this.Il, this.kv); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.oh = function(a10) { + return !!a10.P(this.dg) && !!a10.P(this.Sh) && !!a10.P(this.Il) && !!a10.P(this.kv); + }; + d7.Di = function() { + return qe2(); + }; + d7.U = function(a10) { + a10.P(this.dg); + a10.P(this.Sh); + a10.P(this.Il); + a10.P(this.kv); + }; + d7.jb = function() { + return 4; + }; + d7.mb = function() { + $B(); + var a10 = new Ib().ha([this.dg, this.Sh, this.Il, this.kv]); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Qs = function(a10) { + return this.Qu(a10); + }; + d7.Fb = function(a10) { + return a10.P(this.dg) ? new z7().d(this.dg) : a10.P(this.Sh) ? new z7().d(this.Sh) : a10.P(this.Il) ? new z7().d(this.Il) : a10.P(this.kv) ? new z7().d(this.kv) : y7(); + }; + d7.lv = function() { + return vd(); + }; + d7.LC = function(a10) { + return this.Ha(a10) ? this : xxb(xxb(xxb(xxb(xxb(new A$().a(), this.dg), this.Sh), this.Il), this.kv), a10); + }; + d7.ta = function() { + return this.FW(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.dg) || Va(Wa(), a10, this.Sh) || Va(Wa(), a10, this.Il) || Va(Wa(), a10, this.kv); + }; + d7.dA = function(a10, b10, c10, e10) { + this.dg = a10; + this.Sh = b10; + this.Il = c10; + this.kv = e10; + return this; + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.LC(a10); + }; + d7.Qu = function(a10) { + return Va(Wa(), a10, this.dg) ? new z$().Dr(this.Sh, this.Il, this.kv) : Va(Wa(), a10, this.Sh) ? new z$().Dr(this.dg, this.Il, this.kv) : Va(Wa(), a10, this.Il) ? new z$().Dr(this.dg, this.Sh, this.kv) : Va(Wa(), a10, this.kv) ? new z$().Dr(this.dg, this.Sh, this.Il) : this; + }; + d7.$classData = r8({ Vbb: 0 }, false, "scala.collection.immutable.Set$Set4", { Vbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + function yxb(a10, b10) { + return b10 < a10.OP().Oa() ? a10.OP().lb(b10) : a10.y2().lb(b10 - a10.OP().Oa() | 0); + } + function zxb(a10, b10) { + if (0 <= b10) + return a10.H2().lb(b10 + a10.Ms() | 0); + throw new U6().e("" + b10); + } + function Axb(a10) { + return a10.H2().Oa() - a10.Ms() | 0; + } + function Bxb(a10, b10) { + return a10.PP().lb(a10.Rx().n[b10]); + } + function Cxb(a10) { + var b10 = 0; + var c10 = ja(Ja(Qa), [a10.PP().Oa()]), e10 = a10.PP().Oa(), f10 = -1 + e10 | 0; + if (!(0 >= e10)) + for (e10 = 0; ; ) { + var g10 = e10; + a10.Du().P(a10.PP().lb(g10)) && (c10.n[b10] = g10, b10 = 1 + b10 | 0); + if (e10 === f10) + break; + e10 = 1 + e10 | 0; + } + a10 = b10; + a10 = 0 < a10 ? a10 : 0; + b10 = c10.n.length; + a10 = a10 < b10 ? a10 : b10; + a10 = 0 < a10 ? a10 : 0; + b10 = ja(Ja(Qa), [a10]); + 0 < a10 && Pu(Gd(), c10, 0, b10, 0, a10); + return b10; + } + function Dxb(a10, b10) { + if (0 > b10 || b10 >= Exb(a10)) + throw new U6().e("" + b10); + var c10 = -1 + a10.dM().Oa() | 0; + c10 = Fxb(a10, b10, 0, c10); + return a10.NB().P(a10.dM().lb(c10)).Hd().ke().lb(b10 - a10.Rx().n[c10] | 0); + } + function Exb(a10) { + return a10.Rx().n[a10.dM().Oa()]; + } + var Fxb = function Gxb(a10, b10, c10, e10) { + var g10 = (c10 + e10 | 0) / 2 | 0; + return b10 < a10.Rx().n[g10] ? Gxb(a10, b10, c10, -1 + g10 | 0) : b10 >= a10.Rx().n[1 + g10 | 0] ? Gxb(a10, b10, 1 + g10 | 0, e10) : g10; + }; + function Hxb(a10) { + var b10 = ja(Ja(Qa), [1 + a10.dM().Oa() | 0]); + b10.n[0] = 0; + var c10 = a10.dM().Oa(), e10 = -1 + c10 | 0; + if (!(0 >= c10)) + for (c10 = 0; ; ) { + var f10 = c10; + b10.n[1 + f10 | 0] = b10.n[f10] + a10.NB().P(a10.dM().lb(f10)).Hd().jb() | 0; + if (c10 === e10) + break; + c10 = 1 + c10 | 0; + } + return b10; + } + function Ixb(a10, b10) { + return a10.NB().P(a10.tpa().lb(b10)); + } + function Jxb(a10, b10) { + return b10 < a10.yO().Oa() ? a10.yO().lb(b10) : a10.I2().lb(b10 - a10.yO().Oa() | 0); + } + function Kxb(a10, b10) { + if (0 <= b10 && (b10 + a10.nK().gk | 0) < a10.nK().iI) + return a10.J2().lb(b10 + a10.nK().gk | 0); + throw new U6().e("" + b10); + } + function B$(a10) { + return a10.J2().mb().OD(a10.nK().gk).bQ(pya(a10.nK())); + } + function Lxb(a10, b10) { + if (b10 < a10.gP()) + return a10.Gda().lb(b10); + throw new U6().e("" + b10); + } + function A$() { + } + A$.prototype = new Y9(); + A$.prototype.constructor = A$; + function Mxb() { + } + d7 = Mxb.prototype = A$.prototype; + d7.QW = function(a10, b10) { + return C$(a10, b10); + }; + d7.Hd = function() { + return this; + }; + d7.JD = function(a10) { + return this.M$(NJ(OJ(), a10)); + }; + d7.a = function() { + return this; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + function xxb(a10, b10) { + return a10.QW(b10, a10.JD(b10), 0); + } + d7.al = function(a10) { + return Nxb(this, a10); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.NW = function(a10) { + return a10; + }; + d7.Di = function() { + return Pnb(); + }; + function Oxb(a10, b10) { + var c10 = 6 + a10.jb() | 0; + c10 = ja(Ja(d8), [224 > c10 ? c10 : 224]); + a10 = a10.pO(b10, false, 0, c10, 0); + return null === a10 ? f8() : a10; + } + d7.U = function() { + }; + d7.gI = function(a10) { + return a10; + }; + d7.qea = function(a10) { + if (a10 instanceof A$) + return this.DW(a10, 0); + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.Cb = function(a10) { + return Oxb(this, a10); + }; + d7.jb = function() { + return 0; + }; + d7.mb = function() { + return $B().ce; + }; + d7.Qs = function(a10) { + return Nxb(this, a10); + }; + d7.XL = function() { + return this; + }; + d7.lv = function() { + return f8(); + }; + d7.Si = function(a10) { + var b10 = 6 + this.jb() | 0; + b10 = ja(Ja(d8), [224 > b10 ? b10 : 224]); + a10 = this.pO(a10, true, 0, b10, 0); + return null === a10 ? f8() : a10; + }; + d7.M$ = function(a10) { + a10 = a10 + ~(a10 << 9) | 0; + a10 ^= a10 >>> 14 | 0; + a10 = a10 + (a10 << 4) | 0; + return a10 ^ (a10 >>> 10 | 0); + }; + function Nxb(a10, b10) { + a10 = a10.XL(b10, a10.JD(b10), 0); + return null === a10 ? f8() : a10; + } + d7.ZO = function() { + return null; + }; + d7.Ha = function(a10) { + return this.Qx(a10, this.JD(a10), 0); + }; + d7.ta = function() { + return this.vea(); + }; + d7.vea = function() { + return Nxb(this, this.ga()); + }; + d7.dO = function(a10) { + if (a10 instanceof A$) { + var b10 = 6 + this.jb() | 0; + b10 = ja(Ja(d8), [224 > b10 ? b10 : 224]); + a10 = this.jT(a10, 0, b10, 0); + a10 = null === a10 ? f8() : a10; + } else + a10 = Ida(this, a10); + return a10; + }; + d7.e$ = function() { + return f8(); + }; + d7.xg = function() { + return this; + }; + d7.jT = function() { + return null; + }; + d7.Vh = function() { + return kz(this); + }; + d7.pO = function() { + return null; + }; + d7.Qx = function() { + return false; + }; + d7.z1 = function(a10) { + if (a10 instanceof A$) { + var b10 = this.jb(), c10 = a10.jb(); + b10 = 6 + (b10 < c10 ? b10 : c10) | 0; + b10 = ja(Ja(d8), [224 > b10 ? b10 : 224]); + a10 = this.ZO(a10, 0, b10, 0); + a10 = null === a10 ? f8() : a10; + } else + a10 = Oxb(this, a10); + return a10; + }; + d7.Zj = function(a10) { + return xxb(this, a10); + }; + d7.DW = function() { + return true; + }; + d7.OW = function(a10) { + if (a10 instanceof A$) { + var b10 = 6 + (this.jb() + a10.jb() | 0) | 0; + b10 = ja(Ja(d8), [224 > b10 ? b10 : 224]); + a10 = this.NW(a10, 0, b10, 0); + a10 = null === a10 ? f8() : a10; + } else + a10 = Ivb(this, a10); + return a10; + }; + var d8 = r8({ sW: 0 }, false, "scala.collection.immutable.HashSet", { sW: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, Hi: 1, q: 1, o: 1 }); + A$.prototype.$classData = d8; + function Pxb() { + } + Pxb.prototype = new rxb(); + Pxb.prototype.constructor = Pxb; + Pxb.prototype.a = function() { + return this; + }; + Pxb.prototype.$classData = r8({ Bbb: 0 }, false, "scala.collection.immutable.ListSet$EmptyListSet$", { Bbb: 1, zbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + var Qxb = void 0; + function Rnb() { + Qxb || (Qxb = new Pxb().a()); + return Qxb; + } + function Rxb() { + this.cR = this.qka = null; + } + Rxb.prototype = new rxb(); + Rxb.prototype.constructor = Rxb; + d7 = Rxb.prototype; + d7.rP = function() { + return this.cR; + }; + d7.al = function(a10) { + return Sxb(a10, this); + }; + d7.b = function() { + return false; + }; + d7.KC = function(a10) { + return Txb(this, a10) ? this : sxb(this, a10); + }; + d7.jb = function() { + a: { + var a10 = this, b10 = 0; + for (; ; ) { + if (a10.b()) + break a; + a10 = a10.rP(); + b10 = 1 + b10 | 0; + } + } + return b10; + }; + function Sxb(a10, b10) { + var c10 = H10(); + for (; ; ) { + if (b10.b()) + return lia(c10); + if (Va(Wa(), a10, b10.pT())) { + b10 = b10.rP(); + for (a10 = c10; !a10.b(); ) + c10 = a10.ga(), b10 = sxb(b10, c10.pT()), a10 = a10.ta(); + return b10; + } + var e10 = b10.rP(); + c10 = ji(b10, c10); + b10 = e10; + } + } + d7.Qs = function(a10) { + return Sxb(a10, this); + }; + function sxb(a10, b10) { + var c10 = new Rxb(); + c10.qka = b10; + if (null === a10) + throw mb(E6(), null); + c10.cR = a10; + return c10; + } + d7.Ha = function(a10) { + return Txb(this, a10); + }; + d7.pT = function() { + return this.qka; + }; + d7.iX = function(a10) { + return Sxb(a10, this); + }; + function Txb(a10, b10) { + for (; ; ) { + if (a10.b()) + return false; + if (Va(Wa(), a10.pT(), b10)) + return true; + a10 = a10.rP(); + } + } + d7.Zj = function(a10) { + return this.KC(a10); + }; + d7.$classData = r8({ Cbb: 0 }, false, "scala.collection.immutable.ListSet$Node", { Cbb: 1, zbb: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, q: 1, o: 1 }); + function Uxb() { + this.th = null; + } + Uxb.prototype = new bxb(); + Uxb.prototype.constructor = Uxb; + d7 = Uxb.prototype; + d7.Hd = function() { + return this; + }; + d7.P = function(a10) { + return this.th.Ha(a10); + }; + d7.al = function(a10) { + return this.Qu(a10); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Di = function() { + return qe2(); + }; + function pd(a10) { + var b10 = new Uxb(); + X9.prototype.Vd.call(b10, a10); + return b10; + } + d7.Qs = function(a10) { + return this.Qu(a10); + }; + d7.lv = function() { + return vd(); + }; + d7.LC = function(a10) { + return this.th.Ha(a10) ? this : J5(qe2(), H10()).Lk(this).Zj(a10); + }; + d7.xg = function() { + return this; + }; + d7.Vh = function() { + return kz(this); + }; + d7.Zj = function(a10) { + return this.LC(a10); + }; + d7.Qu = function(a10) { + return this.th.Ha(a10) ? J5(qe2(), H10()).Lk(this).Qs(a10) : this; + }; + d7.$classData = r8({ Lbb: 0 }, false, "scala.collection.immutable.MapLike$ImmutableDefaultKeySet", { Lbb: 1, F2: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, q: 1, o: 1, qy: 1, $i: 1, oj: 1, mj: 1 }); + function Vxb() { + } + Vxb.prototype = new V9(); + Vxb.prototype.constructor = Vxb; + function Wxb() { + } + Wxb.prototype = Vxb.prototype; + Vxb.prototype.Hd = function() { + return this; + }; + Vxb.prototype.Kj = function() { + return this; + }; + function dxb() { + u$.call(this); + this.Fa = null; + } + dxb.prototype = new v$(); + dxb.prototype.constructor = dxb; + d7 = dxb.prototype; + d7.lb = function(a10) { + return j$(this, a10); + }; + d7.P = function(a10) { + return j$(this, a10 | 0); + }; + d7.nt = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.lW = function() { + return this.Fa; + }; + d7.mb = function() { + return k$(this); + }; + d7.Pl = function() { + return "R"; + }; + d7.Oa = function() { + return this.Fa.Oa(); + }; + d7.$classData = r8({ qab: 0 }, false, "scala.collection.SeqViewLike$$anon$12", { qab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, fpa: 1 }); + function Xxb() { + } + Xxb.prototype = new Mxb(); + Xxb.prototype.constructor = Xxb; + d7 = Xxb.prototype; + d7.a = function() { + return this; + }; + d7.ga = function() { + throw new iL().e("Empty Set"); + }; + d7.ta = function() { + return this.vea(); + }; + d7.vea = function() { + throw new iL().e("Empty Set"); + }; + d7.$classData = r8({ kbb: 0 }, false, "scala.collection.immutable.HashSet$EmptyHashSet$", { kbb: 1, sW: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, Hi: 1, q: 1, o: 1 }); + var Yxb = void 0; + function f8() { + Yxb || (Yxb = new Xxb().a()); + return Yxb; + } + function k52() { + this.Bl = 0; + this.yf = null; + this.Ls = 0; + } + k52.prototype = new Mxb(); + k52.prototype.constructor = k52; + d7 = k52.prototype; + d7.QW = function(a10, b10, c10) { + var e10 = 1 << (31 & (b10 >>> c10 | 0)), f10 = sK(ED(), this.Bl & (-1 + e10 | 0)); + if (0 !== (this.Bl & e10)) { + e10 = this.yf.n[f10]; + a10 = e10.QW(a10, b10, 5 + c10 | 0); + if (e10 === a10) + return this; + b10 = ja(Ja(d8), [this.yf.n.length]); + Pu(Gd(), this.yf, 0, b10, 0, this.yf.n.length); + b10.n[f10] = a10; + return e82(new k52(), this.Bl, b10, this.Ls + (a10.jb() - e10.jb() | 0) | 0); + } + c10 = ja(Ja(d8), [1 + this.yf.n.length | 0]); + Pu(Gd(), this.yf, 0, c10, 0, f10); + c10.n[f10] = C$(a10, b10); + Pu(Gd(), this.yf, f10, c10, 1 + f10 | 0, this.yf.n.length - f10 | 0); + return e82(new k52(), this.Bl | e10, c10, 1 + this.Ls | 0); + }; + d7.NW = function(a10, b10, c10, e10) { + if (a10 === this) + return this; + if (a10 instanceof D$) + return this.gI(a10, b10); + if (a10 instanceof k52) { + for (var f10 = this.yf, g10 = this.Bl, h10 = 0, k10 = a10.yf, l10 = a10.Bl, m10 = 0, p10 = e10, t10 = 0; 0 !== (g10 | l10); ) { + var v10 = g10 ^ g10 & (-1 + g10 | 0), A10 = l10 ^ l10 & (-1 + l10 | 0); + if (v10 === A10) { + var D10 = f10.n[h10].NW(k10.n[m10], 5 + b10 | 0, c10, p10); + t10 = t10 + D10.jb() | 0; + c10.n[p10] = D10; + p10 = 1 + p10 | 0; + g10 &= ~v10; + h10 = 1 + h10 | 0; + l10 &= ~A10; + m10 = 1 + m10 | 0; + } else { + D10 = -1 + v10 | 0; + var C10 = -1 + A10 | 0; + D10 < C10 !== 0 > D10 !== 0 > C10 ? (A10 = f10.n[h10], t10 = t10 + A10.jb() | 0, c10.n[p10] = A10, p10 = 1 + p10 | 0, g10 &= ~v10, h10 = 1 + h10 | 0) : (v10 = k10.n[m10], t10 = t10 + v10.jb() | 0, c10.n[p10] = v10, p10 = 1 + p10 | 0, l10 &= ~A10, m10 = 1 + m10 | 0); + } + } + if (t10 === this.Ls) + return this; + if (t10 === a10.Ls) + return a10; + b10 = p10 - e10 | 0; + f10 = ja(Ja(d8), [b10]); + Ba(c10, e10, f10, 0, b10); + return e82(new k52(), this.Bl | a10.Bl, f10, t10); + } + return this; + }; + d7.U = function(a10) { + for (var b10 = 0; b10 < this.yf.n.length; ) + this.yf.n[b10].U(a10), b10 = 1 + b10 | 0; + }; + d7.gI = function(a10, b10) { + var c10 = 1 << (31 & (a10.Mf >>> b10 | 0)), e10 = sK(ED(), this.Bl & (-1 + c10 | 0)); + if (0 !== (this.Bl & c10)) { + c10 = this.yf.n[e10]; + a10 = c10.gI(a10, 5 + b10 | 0); + if (c10 === a10) + return this; + b10 = ja(Ja(d8), [this.yf.n.length]); + Pu(Gd(), this.yf, 0, b10, 0, this.yf.n.length); + b10.n[e10] = a10; + return e82(new k52(), this.Bl, b10, this.Ls + (a10.jb() - c10.jb() | 0) | 0); + } + b10 = ja(Ja(d8), [1 + this.yf.n.length | 0]); + Pu(Gd(), this.yf, 0, b10, 0, e10); + b10.n[e10] = a10; + Pu(Gd(), this.yf, e10, b10, 1 + e10 | 0, this.yf.n.length - e10 | 0); + return e82(new k52(), this.Bl | c10, b10, this.Ls + a10.jb() | 0); + }; + d7.jb = function() { + return this.Ls; + }; + d7.mb = function() { + var a10 = new pgb(); + h52.prototype.bla.call(a10, this.yf); + return a10; + }; + d7.XL = function(a10, b10, c10) { + var e10 = 1 << (31 & (b10 >>> c10 | 0)), f10 = sK(ED(), this.Bl & (-1 + e10 | 0)); + if (0 !== (this.Bl & e10)) { + var g10 = this.yf.n[f10]; + a10 = g10.XL(a10, b10, 5 + c10 | 0); + return g10 === a10 ? this : null === a10 ? (e10 ^= this.Bl, 0 !== e10 ? (a10 = ja(Ja(d8), [-1 + this.yf.n.length | 0]), Pu(Gd(), this.yf, 0, a10, 0, f10), Pu(Gd(), this.yf, 1 + f10 | 0, a10, f10, -1 + (this.yf.n.length - f10 | 0) | 0), f10 = this.Ls - g10.jb() | 0, 1 !== a10.n.length || a10.n[0] instanceof k52 ? e82(new k52(), e10, a10, f10) : a10.n[0]) : null) : 1 !== this.yf.n.length || a10 instanceof k52 ? (e10 = ja(Ja(d8), [this.yf.n.length]), Pu(Gd(), this.yf, 0, e10, 0, this.yf.n.length), e10.n[f10] = a10, f10 = this.Ls + (a10.jb() - g10.jb() | 0) | 0, e82(new k52(), this.Bl, e10, f10)) : a10; + } + return this; + }; + d7.ZO = function(a10, b10, c10, e10) { + if (a10 === this) + return this; + if (a10 instanceof D$) + return a10.ZO(this, b10, c10, e10); + if (a10 instanceof k52) { + var f10 = this.yf, g10 = this.Bl, h10 = 0, k10 = a10.yf, l10 = a10.Bl, m10 = 0; + if (0 === (g10 & l10)) + return null; + for (var p10 = e10, t10 = 0, v10 = 0; 0 !== (g10 & l10); ) { + var A10 = g10 ^ g10 & (-1 + g10 | 0), D10 = l10 ^ l10 & (-1 + l10 | 0); + if (A10 === D10) { + var C10 = f10.n[h10].ZO(k10.n[m10], 5 + b10 | 0, c10, p10); + null !== C10 && (t10 = t10 + C10.jb() | 0, v10 |= A10, c10.n[p10] = C10, p10 = 1 + p10 | 0); + g10 &= ~A10; + h10 = 1 + h10 | 0; + l10 &= ~D10; + m10 = 1 + m10 | 0; + } else { + C10 = -1 + A10 | 0; + var I10 = -1 + D10 | 0; + C10 < I10 !== 0 > C10 !== 0 > I10 ? (g10 &= ~A10, h10 = 1 + h10 | 0) : (l10 &= ~D10, m10 = 1 + m10 | 0); + } + } + if (0 === v10) + return null; + if (t10 === this.Ls) + return this; + if (t10 === a10.Ls) + return a10; + a10 = p10 - e10 | 0; + return 1 !== a10 || c10.n[e10] instanceof k52 ? (b10 = ja(Ja(d8), [a10]), Ba(c10, e10, b10, 0, a10), e82(new k52(), v10, b10, t10)) : c10.n[e10]; + } + return null; + }; + d7.jT = function(a10, b10, c10, e10) { + if (a10 === this) + return null; + if (a10 instanceof i52) + return this.XL(a10.Tk, a10.Mf, b10); + if (a10 instanceof k52) { + for (var f10 = this.yf, g10 = this.Bl, h10 = 0, k10 = a10.yf, l10 = a10.Bl, m10 = 0, p10 = e10, t10 = a10 = 0; 0 !== g10; ) { + var v10 = g10 ^ g10 & (-1 + g10 | 0), A10 = l10 ^ l10 & (-1 + l10 | 0); + if (v10 === A10) { + var D10 = f10.n[h10].jT(k10.n[m10], 5 + b10 | 0, c10, p10); + null !== D10 && (a10 = a10 + D10.jb() | 0, t10 |= v10, c10.n[p10] = D10, p10 = 1 + p10 | 0); + g10 &= ~v10; + h10 = 1 + h10 | 0; + l10 &= ~A10; + m10 = 1 + m10 | 0; + } else { + D10 = -1 + v10 | 0; + var C10 = -1 + A10 | 0; + D10 < C10 !== 0 > D10 !== 0 > C10 ? (A10 = f10.n[h10], a10 = a10 + A10.jb() | 0, t10 |= v10, c10.n[p10] = A10, p10 = 1 + p10 | 0, g10 &= ~v10, h10 = 1 + h10 | 0) : (l10 &= ~A10, m10 = 1 + m10 | 0); + } + } + if (0 === t10) + return null; + if (a10 === this.Ls) + return this; + b10 = p10 - e10 | 0; + return 1 !== b10 || c10.n[e10] instanceof k52 ? (f10 = ja(Ja(d8), [b10]), Ba(c10, e10, f10, 0, b10), e82(new k52(), t10, f10, a10)) : c10.n[e10]; + } + if (a10 instanceof E$) + a: + for (e10 = this, c10 = a10.qn; ; ) { + if (c10.b() || null === e10) { + b10 = e10; + break a; + } + t10 = w$(c10); + e10 = e10.XL(uc(t10).$a(), a10.Mf, b10); + c10 = Qx(c10); + } + else + b10 = this; + return b10; + }; + function e82(a10, b10, c10, e10) { + a10.Bl = b10; + a10.yf = c10; + a10.Ls = e10; + BKa(Gb(), sK(ED(), b10) === c10.n.length); + return a10; + } + d7.pO = function(a10, b10, c10, e10, f10) { + for (var g10 = f10, h10 = 0, k10 = 0, l10 = 0; l10 < this.yf.n.length; ) { + var m10 = this.yf.n[l10].pO(a10, b10, 5 + c10 | 0, e10, g10); + null !== m10 && (e10.n[g10] = m10, g10 = 1 + g10 | 0, h10 = h10 + m10.jb() | 0, k10 |= 1 << l10); + l10 = 1 + l10 | 0; + } + if (g10 === f10) + return null; + if (h10 === this.Ls) + return this; + if (g10 !== (1 + f10 | 0) || e10.n[f10] instanceof k52) { + b10 = g10 - f10 | 0; + a10 = ja(Ja(d8), [b10]); + Ba(e10, f10, a10, 0, b10); + if (b10 === this.yf.n.length) + k10 = this.Bl; + else { + Pnb(); + e10 = 0; + for (f10 = this.Bl; 0 !== k10; ) + b10 = f10 ^ f10 & (-1 + f10 | 0), 0 !== (1 & k10) && (e10 |= b10), f10 &= ~b10, k10 = k10 >>> 1 | 0; + k10 = e10; + } + return e82(new k52(), k10, a10, h10); + } + return e10.n[f10]; + }; + d7.Qx = function(a10, b10, c10) { + var e10 = 31 & (b10 >>> c10 | 0), f10 = 1 << e10; + return -1 === this.Bl ? this.yf.n[31 & e10].Qx(a10, b10, 5 + c10 | 0) : 0 !== (this.Bl & f10) ? (e10 = sK(ED(), this.Bl & (-1 + f10 | 0)), this.yf.n[e10].Qx(a10, b10, 5 + c10 | 0)) : false; + }; + d7.DW = function(a10, b10) { + if (a10 === this) + return true; + if (a10 instanceof k52 && this.Ls <= a10.Ls) { + var c10 = this.Bl, e10 = this.yf, f10 = 0, g10 = a10.yf; + a10 = a10.Bl; + var h10 = 0; + if ((c10 & a10) === c10) { + for (; 0 !== c10; ) { + var k10 = c10 ^ c10 & (-1 + c10 | 0), l10 = a10 ^ a10 & (-1 + a10 | 0); + if (k10 === l10) { + if (!e10.n[f10].DW(g10.n[h10], 5 + b10 | 0)) + return false; + c10 &= ~k10; + f10 = 1 + f10 | 0; + } + a10 &= ~l10; + h10 = 1 + h10 | 0; + } + return true; + } + } + return false; + }; + d7.$classData = r8({ nbb: 0 }, false, "scala.collection.immutable.HashSet$HashTrieSet", { nbb: 1, sW: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, Hi: 1, q: 1, o: 1 }); + function D$() { + } + D$.prototype = new Mxb(); + D$.prototype.constructor = D$; + function Zxb() { + } + Zxb.prototype = D$.prototype; + function $xb() { + } + $xb.prototype = new l$(); + $xb.prototype.constructor = $xb; + function ayb() { + } + d7 = ayb.prototype = $xb.prototype; + d7.Dt = function() { + throw new iL().e("value of empty map"); + }; + d7.al = function(a10) { + return this.hX(a10); + }; + d7.b = function() { + return true; + }; + d7.ng = function() { + return this; + }; + d7.cc = function(a10) { + return this.EI(a10); + }; + d7.ls = function() { + return qgb(); + }; + d7.wp = function(a10) { + return this.hX(a10); + }; + d7.f$ = function() { + return qgb(); + }; + d7.jb = function() { + return 0; + }; + d7.uq = function(a10) { + return byb(this, a10); + }; + d7.uu = function() { + throw new iL().e("key of empty map"); + }; + d7.mb = function() { + var a10 = cyb(this); + return uc(a10); + }; + d7.EI = function(a10) { + return dyb(new F$(), this, a10.ma(), a10.ya()); + }; + function byb(a10, b10) { + return b10.b() ? a10 : b10.Ql(a10, Uc(/* @__PURE__ */ function() { + return function(c10, e10) { + return c10.EI(e10); + }; + }(a10))); + } + d7.Wh = function(a10, b10) { + return this.RW(a10, b10); + }; + d7.RW = function(a10, b10) { + return dyb(new F$(), this, a10, b10); + }; + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.hX = function() { + return this; + }; + d7.Ja = function() { + return y7(); + }; + function cyb(a10) { + for (var b10 = H10(); !a10.b(); ) { + var c10 = new R6().M(a10.uu(), a10.Dt()); + b10 = ji(c10, b10); + a10 = a10.tH(); + } + return b10; + } + d7.KB = function() { + return pd(this); + }; + d7.Vh = function() { + return xO(this); + }; + d7.tH = function() { + throw new iL().e("next of empty map"); + }; + d7.Ru = function(a10) { + return this.EI(a10); + }; + d7.Xk = function() { + return "ListMap"; + }; + function eyb() { + } + eyb.prototype = new l$(); + eyb.prototype.constructor = eyb; + d7 = eyb.prototype; + d7.a = function() { + return this; + }; + d7.P = function(a10) { + this.AS(a10); + }; + d7.al = function() { + return this; + }; + d7.lu = function(a10, b10) { + return Hb(b10); + }; + d7.cc = function(a10) { + var b10 = a10.ma(); + a10 = a10.ya(); + return new G$().M(b10, a10); + }; + d7.wp = function() { + return this; + }; + d7.jb = function() { + return 0; + }; + d7.mb = function() { + return $B().ce; + }; + d7.Wh = function(a10, b10) { + return new G$().M(a10, b10); + }; + d7.Ja = function() { + return y7(); + }; + d7.Ha = function() { + return false; + }; + d7.AS = function(a10) { + throw new iL().e("key not found: " + a10); + }; + d7.Ru = function(a10) { + var b10 = a10.ma(); + a10 = a10.ya(); + return new G$().M(b10, a10); + }; + d7.$classData = r8({ Ebb: 0 }, false, "scala.collection.immutable.Map$EmptyMap$", { Ebb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + var fyb = void 0; + function nu() { + fyb || (fyb = new eyb().a()); + return fyb; + } + function G$() { + this.Dh = this.Af = null; + } + G$.prototype = new l$(); + G$.prototype.constructor = G$; + d7 = G$.prototype; + d7.P = function(a10) { + if (Va(Wa(), a10, this.Af)) + return this.Dh; + throw new iL().e("key not found: " + a10); + }; + d7.al = function(a10) { + return this.Ay(a10); + }; + d7.lu = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? this.Dh : Hb(b10); + }; + d7.M = function(a10, b10) { + this.Af = a10; + this.Dh = b10; + return this; + }; + d7.cc = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.U = function(a10) { + a10.P(new R6().M(this.Af, this.Dh)); + }; + d7.wp = function(a10) { + return this.Ay(a10); + }; + d7.jb = function() { + return 1; + }; + d7.mb = function() { + $B(); + var a10 = [new R6().M(this.Af, this.Dh)]; + a10 = new Ib().ha(a10); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Wh = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? new G$().M(this.Af, b10) : new H$().dA(this.Af, this.Dh, a10, b10); + }; + d7.Ja = function(a10) { + return Va(Wa(), a10, this.Af) ? new z7().d(this.Dh) : y7(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.Af); + }; + d7.Ay = function(a10) { + return Va(Wa(), a10, this.Af) ? nu() : this; + }; + d7.Ru = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.$classData = r8({ Fbb: 0 }, false, "scala.collection.immutable.Map$Map1", { Fbb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + function H$() { + this.sj = this.Tg = this.Dh = this.Af = null; + } + H$.prototype = new l$(); + H$.prototype.constructor = H$; + d7 = H$.prototype; + d7.P = function(a10) { + if (Va(Wa(), a10, this.Af)) + return this.Dh; + if (Va(Wa(), a10, this.Tg)) + return this.sj; + throw new iL().e("key not found: " + a10); + }; + d7.al = function(a10) { + return this.Ay(a10); + }; + d7.lu = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? this.Dh : Va(Wa(), a10, this.Tg) ? this.sj : Hb(b10); + }; + d7.cc = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.U = function(a10) { + a10.P(new R6().M(this.Af, this.Dh)); + a10.P(new R6().M(this.Tg, this.sj)); + }; + d7.wp = function(a10) { + return this.Ay(a10); + }; + d7.jb = function() { + return 2; + }; + d7.mb = function() { + $B(); + var a10 = [new R6().M(this.Af, this.Dh), new R6().M(this.Tg, this.sj)]; + a10 = new Ib().ha(a10); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Wh = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? new H$().dA(this.Af, b10, this.Tg, this.sj) : Va(Wa(), a10, this.Tg) ? new H$().dA(this.Af, this.Dh, this.Tg, b10) : I$(this.Af, this.Dh, this.Tg, this.sj, a10, b10); + }; + d7.Ja = function(a10) { + return Va(Wa(), a10, this.Af) ? new z7().d(this.Dh) : Va(Wa(), a10, this.Tg) ? new z7().d(this.sj) : y7(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.Af) || Va(Wa(), a10, this.Tg); + }; + d7.dA = function(a10, b10, c10, e10) { + this.Af = a10; + this.Dh = b10; + this.Tg = c10; + this.sj = e10; + return this; + }; + d7.Ay = function(a10) { + return Va(Wa(), a10, this.Af) ? new G$().M(this.Tg, this.sj) : Va(Wa(), a10, this.Tg) ? new G$().M(this.Af, this.Dh) : this; + }; + d7.Ru = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.$classData = r8({ Gbb: 0 }, false, "scala.collection.immutable.Map$Map2", { Gbb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + function gyb() { + this.An = this.Vj = this.sj = this.Tg = this.Dh = this.Af = null; + } + gyb.prototype = new l$(); + gyb.prototype.constructor = gyb; + d7 = gyb.prototype; + d7.P = function(a10) { + if (Va(Wa(), a10, this.Af)) + return this.Dh; + if (Va(Wa(), a10, this.Tg)) + return this.sj; + if (Va(Wa(), a10, this.Vj)) + return this.An; + throw new iL().e("key not found: " + a10); + }; + d7.al = function(a10) { + return this.Ay(a10); + }; + d7.lu = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? this.Dh : Va(Wa(), a10, this.Tg) ? this.sj : Va(Wa(), a10, this.Vj) ? this.An : Hb(b10); + }; + d7.cc = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.U = function(a10) { + a10.P(new R6().M(this.Af, this.Dh)); + a10.P(new R6().M(this.Tg, this.sj)); + a10.P(new R6().M(this.Vj, this.An)); + }; + d7.wp = function(a10) { + return this.Ay(a10); + }; + function I$(a10, b10, c10, e10, f10, g10) { + var h10 = new gyb(); + h10.Af = a10; + h10.Dh = b10; + h10.Tg = c10; + h10.sj = e10; + h10.Vj = f10; + h10.An = g10; + return h10; + } + d7.jb = function() { + return 3; + }; + d7.mb = function() { + $B(); + var a10 = [new R6().M(this.Af, this.Dh), new R6().M(this.Tg, this.sj), new R6().M(this.Vj, this.An)]; + a10 = new Ib().ha(a10); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.Wh = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? I$(this.Af, b10, this.Tg, this.sj, this.Vj, this.An) : Va(Wa(), a10, this.Tg) ? I$(this.Af, this.Dh, this.Tg, b10, this.Vj, this.An) : Va(Wa(), a10, this.Vj) ? I$(this.Af, this.Dh, this.Tg, this.sj, this.Vj, b10) : hyb(this.Af, this.Dh, this.Tg, this.sj, this.Vj, this.An, a10, b10); + }; + d7.Ja = function(a10) { + return Va(Wa(), a10, this.Af) ? new z7().d(this.Dh) : Va(Wa(), a10, this.Tg) ? new z7().d(this.sj) : Va(Wa(), a10, this.Vj) ? new z7().d(this.An) : y7(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.Af) || Va(Wa(), a10, this.Tg) || Va(Wa(), a10, this.Vj); + }; + d7.Ay = function(a10) { + return Va(Wa(), a10, this.Af) ? new H$().dA(this.Tg, this.sj, this.Vj, this.An) : Va(Wa(), a10, this.Tg) ? new H$().dA(this.Af, this.Dh, this.Vj, this.An) : Va(Wa(), a10, this.Vj) ? new H$().dA(this.Af, this.Dh, this.Tg, this.sj) : this; + }; + d7.Ru = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.$classData = r8({ Hbb: 0 }, false, "scala.collection.immutable.Map$Map3", { Hbb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + function iyb() { + this.nx = this.vs = this.An = this.Vj = this.sj = this.Tg = this.Dh = this.Af = null; + } + iyb.prototype = new l$(); + iyb.prototype.constructor = iyb; + d7 = iyb.prototype; + d7.P = function(a10) { + if (Va(Wa(), a10, this.Af)) + return this.Dh; + if (Va(Wa(), a10, this.Tg)) + return this.sj; + if (Va(Wa(), a10, this.Vj)) + return this.An; + if (Va(Wa(), a10, this.vs)) + return this.nx; + throw new iL().e("key not found: " + a10); + }; + d7.al = function(a10) { + return this.Ay(a10); + }; + d7.lu = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? this.Dh : Va(Wa(), a10, this.Tg) ? this.sj : Va(Wa(), a10, this.Vj) ? this.An : Va(Wa(), a10, this.vs) ? this.nx : Hb(b10); + }; + d7.cc = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.U = function(a10) { + a10.P(new R6().M(this.Af, this.Dh)); + a10.P(new R6().M(this.Tg, this.sj)); + a10.P(new R6().M(this.Vj, this.An)); + a10.P(new R6().M(this.vs, this.nx)); + }; + d7.wp = function(a10) { + return this.Ay(a10); + }; + d7.jb = function() { + return 4; + }; + d7.mb = function() { + $B(); + var a10 = [new R6().M(this.Af, this.Dh), new R6().M(this.Tg, this.sj), new R6().M(this.Vj, this.An), new R6().M(this.vs, this.nx)]; + a10 = new Ib().ha(a10); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + function hyb(a10, b10, c10, e10, f10, g10, h10, k10) { + var l10 = new iyb(); + l10.Af = a10; + l10.Dh = b10; + l10.Tg = c10; + l10.sj = e10; + l10.Vj = f10; + l10.An = g10; + l10.vs = h10; + l10.nx = k10; + return l10; + } + d7.Wh = function(a10, b10) { + return Va(Wa(), a10, this.Af) ? hyb(this.Af, b10, this.Tg, this.sj, this.Vj, this.An, this.vs, this.nx) : Va(Wa(), a10, this.Tg) ? hyb(this.Af, this.Dh, this.Tg, b10, this.Vj, this.An, this.vs, this.nx) : Va(Wa(), a10, this.Vj) ? hyb(this.Af, this.Dh, this.Tg, this.sj, this.Vj, b10, this.vs, this.nx) : Va(Wa(), a10, this.vs) ? hyb(this.Af, this.Dh, this.Tg, this.sj, this.Vj, this.An, this.vs, b10) : jyb(jyb(jyb(jyb(jyb(new kyb().a(), this.Af, this.Dh), this.Tg, this.sj), this.Vj, this.An), this.vs, this.nx), a10, b10); + }; + d7.Ja = function(a10) { + return Va(Wa(), a10, this.Af) ? new z7().d(this.Dh) : Va(Wa(), a10, this.Tg) ? new z7().d(this.sj) : Va(Wa(), a10, this.Vj) ? new z7().d(this.An) : Va(Wa(), a10, this.vs) ? new z7().d(this.nx) : y7(); + }; + d7.Ha = function(a10) { + return Va(Wa(), a10, this.Af) || Va(Wa(), a10, this.Tg) || Va(Wa(), a10, this.Vj) || Va(Wa(), a10, this.vs); + }; + d7.Ay = function(a10) { + return Va(Wa(), a10, this.Af) ? I$(this.Tg, this.sj, this.Vj, this.An, this.vs, this.nx) : Va(Wa(), a10, this.Tg) ? I$(this.Af, this.Dh, this.Vj, this.An, this.vs, this.nx) : Va(Wa(), a10, this.Vj) ? I$(this.Af, this.Dh, this.Tg, this.sj, this.vs, this.nx) : Va(Wa(), a10, this.vs) ? I$(this.Af, this.Dh, this.Tg, this.sj, this.Vj, this.An) : this; + }; + d7.Ru = function(a10) { + return this.Wh(a10.ma(), a10.ya()); + }; + d7.$classData = r8({ Ibb: 0 }, false, "scala.collection.immutable.Map$Map4", { Ibb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + function jz() { + H42.call(this); + } + jz.prototype = new Xwb(); + jz.prototype.constructor = jz; + d7 = jz.prototype; + d7.Hd = function() { + return this; + }; + d7.dH = function(a10, b10) { + H42.prototype.u1.call(this, a10, b10); + return this; + }; + d7.al = function(a10) { + return axb(this, a10); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.ufa = function(a10) { + return $wb(this, a10); + }; + d7.cc = function(a10) { + return $wb(this, a10); + }; + d7.Di = function() { + return Id(); + }; + d7.wp = function(a10) { + return axb(this, a10); + }; + d7.ls = function() { + return nu(); + }; + d7.uq = function(a10) { + return AMa(this, a10); + }; + d7.Wh = function(a10, b10) { + return this.cc(new R6().M(a10, b10)); + }; + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.KB = function() { + return pd(this); + }; + d7.Vh = function() { + return xO(this); + }; + d7.Ch = function() { + return this; + }; + d7.Ru = function(a10) { + return $wb(this, a10); + }; + d7.$classData = r8({ Jbb: 0 }, false, "scala.collection.immutable.MapLike$$anon$1", { Jbb: 1, cpa: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, Xoa: 1, $ab: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1 }); + function Rv() { + Ywb.call(this); + } + Rv.prototype = new Zwb(); + Rv.prototype.constructor = Rv; + d7 = Rv.prototype; + d7.Hd = function() { + return this; + }; + d7.dH = function(a10, b10) { + Ywb.prototype.u1.call(this, a10, b10); + return this; + }; + d7.al = function(a10) { + return axb(this, a10); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.cc = function(a10) { + return $wb(this, a10); + }; + d7.Di = function() { + return Id(); + }; + d7.wp = function(a10) { + return axb(this, a10); + }; + d7.ls = function() { + return nu(); + }; + d7.uq = function(a10) { + return AMa(this, a10); + }; + d7.Wh = function(a10, b10) { + return this.cc(new R6().M(a10, b10)); + }; + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.KB = function() { + return pd(this); + }; + d7.Vh = function() { + return xO(this); + }; + d7.Ch = function() { + return this; + }; + d7.Ru = function(a10) { + return $wb(this, a10); + }; + d7.$classData = r8({ Kbb: 0 }, false, "scala.collection.immutable.MapLike$$anon$2", { Kbb: 1, bib: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, Xoa: 1, $ab: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1 }); + function lyb() { + u$.call(this); + this.sqa = this.Pna = null; + this.Ci = false; + this.Fa = null; + } + lyb.prototype = new v$(); + lyb.prototype.constructor = lyb; + d7 = lyb.prototype; + d7.lb = function(a10) { + return pxb(this, a10); + }; + d7.P = function(a10) { + return pxb(this, a10 | 0); + }; + d7.$1 = function() { + return this.Pna; + }; + d7.mb = function() { + return Bwb(this); + }; + d7.Pl = function() { + return "Z"; + }; + d7.Oa = function() { + return oxb(this); + }; + d7.spa = function() { + return this.Fa; + }; + d7.o3 = function() { + this.Ci || this.Ci || (this.sqa = this.$1().Kj().ke(), this.Ci = true); + return this.sqa; + }; + function ixb(a10, b10) { + var c10 = new lyb(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.Pna = b10; + u$.prototype.nt.call(c10, a10); + return c10; + } + d7.K2 = function() { + return this.Fa; + }; + d7.$classData = r8({ pab: 0 }, false, "scala.collection.SeqViewLike$$anon$10", { pab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, Eab: 1, T$a: 1 }); + function kyb() { + } + kyb.prototype = new l$(); + kyb.prototype.constructor = kyb; + function myb() { + } + d7 = myb.prototype = kyb.prototype; + d7.Hd = function() { + return this; + }; + d7.JD = function(a10) { + return this.M$(NJ(OJ(), a10)); + }; + d7.a = function() { + return this; + }; + d7.al = function(a10) { + return nyb(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.lQ = function(a10, b10, c10, e10, f10) { + return J$(a10, b10, e10, f10); + }; + d7.zO = function() { + return y7(); + }; + d7.cc = function(a10) { + return oyb(this, a10); + }; + d7.U = function() { + }; + function oyb(a10, b10) { + return a10.lQ(b10.ma(), a10.JD(b10.ma()), 0, b10.ya(), b10, null); + } + function pyb(a10, b10) { + L7(); + var c10 = 6 + a10.jb() | 0; + c10 = ja(Ja(I7), [224 > c10 ? c10 : 224]); + L7(); + a10 = a10.oO(b10, true, 0, c10, 0); + return null === a10 ? K72() : a10; + } + function jyb(a10, b10, c10) { + return a10.lQ(b10, a10.JD(b10), 0, c10, null, null); + } + d7.wp = function(a10) { + return nyb(this, a10); + }; + d7.ls = function() { + L7(); + return K72(); + }; + d7.bW = function() { + return this; + }; + d7.oO = function() { + return null; + }; + function nyb(a10, b10) { + return a10.bW(b10, a10.JD(b10), 0); + } + d7.Cb = function(a10) { + L7(); + var b10 = 6 + this.jb() | 0; + b10 = ja(Ja(I7), [224 > b10 ? b10 : 224]); + L7(); + a10 = this.oO(a10, false, 0, b10, 0); + return null === a10 ? K72() : a10; + }; + d7.f$ = function() { + L7(); + return K72(); + }; + d7.jb = function() { + return 0; + }; + d7.mb = function() { + return $B().ce; + }; + d7.Wh = function(a10, b10) { + return jyb(this, a10, b10); + }; + d7.uea = function() { + return nyb(this, this.ga().ma()); + }; + d7.Si = function(a10) { + return pyb(this, a10); + }; + d7.M$ = function(a10) { + a10 = a10 + ~(a10 << 9) | 0; + a10 ^= a10 >>> 14 | 0; + a10 = a10 + (a10 << 4) | 0; + return a10 ^ (a10 >>> 10 | 0); + }; + d7.Ja = function(a10) { + return this.zO(a10, this.JD(a10), 0); + }; + d7.XN = function() { + return false; + }; + d7.Ha = function(a10) { + return this.XN(a10, this.JD(a10), 0); + }; + d7.ta = function() { + return this.uea(); + }; + d7.w$ = function(a10) { + return pyb(this, a10); + }; + d7.KB = function() { + return pd(this); + }; + d7.Vh = function() { + return xO(this); + }; + d7.Ru = function(a10) { + return oyb(this, a10); + }; + var I7 = r8({ rW: 0 }, false, "scala.collection.immutable.HashMap", { rW: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1, Hi: 1 }); + kyb.prototype.$classData = I7; + function i52() { + this.Tk = null; + this.Mf = 0; + } + i52.prototype = new Zxb(); + i52.prototype.constructor = i52; + d7 = i52.prototype; + d7.QW = function(a10, b10, c10) { + if (b10 === this.Mf && Va(Wa(), a10, this.Tk)) + return this; + if (b10 !== this.Mf) + return Nnb(Pnb(), this.Mf, this, b10, C$(a10, b10), c10); + c10 = Rnb(); + return K$(new E$(), b10, sxb(c10, this.Tk).KC(a10)); + }; + d7.NW = function(a10, b10) { + return a10.gI(this, b10); + }; + function C$(a10, b10) { + var c10 = new i52(); + c10.Tk = a10; + c10.Mf = b10; + return c10; + } + d7.U = function(a10) { + a10.P(this.Tk); + }; + d7.gI = function(a10, b10) { + if (a10.Mf !== this.Mf) + return Nnb(Pnb(), this.Mf, this, a10.Mf, a10, b10); + if (a10 instanceof i52) { + if (Va(Wa(), this.Tk, a10.Tk)) + return this; + b10 = this.Mf; + var c10 = Rnb(); + return K$(new E$(), b10, sxb(c10, this.Tk).KC(a10.Tk)); + } + if (a10 instanceof E$) + return b10 = a10.qn.KC(this.Tk), b10.jb() === a10.qn.jb() ? a10 : K$(new E$(), this.Mf, b10); + throw new x7().d(a10); + }; + d7.jb = function() { + return 1; + }; + d7.mb = function() { + $B(); + var a10 = new Ib().ha([this.Tk]); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.XL = function(a10, b10) { + return b10 === this.Mf && Va(Wa(), a10, this.Tk) ? null : this; + }; + d7.ZO = function(a10, b10) { + return a10.Qx(this.Tk, this.Mf, b10) ? this : null; + }; + d7.jT = function(a10, b10) { + return a10.Qx(this.Tk, this.Mf, b10) ? null : this; + }; + d7.pO = function(a10, b10) { + return b10 !== !!a10.P(this.Tk) ? this : null; + }; + d7.Qx = function(a10, b10) { + return b10 === this.Mf && Va(Wa(), a10, this.Tk); + }; + d7.DW = function(a10, b10) { + return a10.Qx(this.Tk, this.Mf, b10); + }; + d7.$classData = r8({ lbb: 0 }, false, "scala.collection.immutable.HashSet$HashSet1", { lbb: 1, pbb: 1, sW: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, Hi: 1, q: 1, o: 1 }); + function E$() { + this.Mf = 0; + this.qn = null; + } + E$.prototype = new Zxb(); + E$.prototype.constructor = E$; + d7 = E$.prototype; + d7.QW = function(a10, b10, c10) { + return b10 === this.Mf ? K$(new E$(), b10, this.qn.KC(a10)) : Nnb(Pnb(), this.Mf, this, b10, C$(a10, b10), c10); + }; + d7.NW = function(a10, b10) { + return a10 instanceof D$ ? this.gI(a10, b10) : a10 instanceof k52 ? a10.gI(this, b10) : this; + }; + d7.U = function(a10) { + var b10 = w$(this.qn); + yT(uc(b10), a10); + }; + d7.gI = function(a10, b10) { + if (a10.Mf !== this.Mf) + return Nnb(Pnb(), this.Mf, this, a10.Mf, a10, b10); + if (a10 instanceof i52) + return a10 = this.qn.KC(a10.Tk), a10.jb() === this.qn.jb() ? this : K$(new E$(), this.Mf, a10); + if (a10 instanceof E$) { + b10 = txb(this.qn, a10.qn); + var c10 = b10.jb(); + return c10 === this.qn.jb() ? this : c10 === a10.qn.jb() ? a10 : K$(new E$(), this.Mf, b10); + } + throw new x7().d(a10); + }; + d7.jb = function() { + return this.qn.jb(); + }; + d7.mb = function() { + var a10 = w$(this.qn); + return uc(a10); + }; + d7.XL = function(a10, b10) { + if (b10 === this.Mf) { + a10 = this.qn.iX(a10); + var c10 = a10.jb(); + switch (c10) { + case 0: + return null; + case 1: + return a10 = w$(a10), C$(uc(a10).$a(), b10); + default: + return c10 === this.qn.jb() ? this : K$(new E$(), b10, a10); + } + } else + return this; + }; + d7.ZO = function(a10, b10) { + var c10 = this.qn, e10 = wd(new xd(), Rnb()); + c10 = w$(c10); + for (c10 = uc(c10); c10.Ya(); ) { + var f10 = c10.$a(); + false !== a10.Qx(f10, this.Mf, b10) && Ad(e10, f10); + } + b10 = e10.eb; + e10 = b10.jb(); + return 0 === e10 ? null : e10 === this.qn.jb() ? this : e10 === a10.jb() ? a10 : 1 === e10 ? (a10 = w$(b10), C$(uc(a10).$a(), this.Mf)) : K$(new E$(), this.Mf, b10); + }; + function K$(a10, b10, c10) { + a10.Mf = b10; + a10.qn = c10; + return a10; + } + d7.jT = function(a10, b10) { + var c10 = this.qn, e10 = wd(new xd(), Rnb()); + c10 = w$(c10); + for (c10 = uc(c10); c10.Ya(); ) { + var f10 = c10.$a(); + true !== a10.Qx(f10, this.Mf, b10) && Ad(e10, f10); + } + a10 = e10.eb; + b10 = a10.jb(); + return 0 === b10 ? null : b10 === this.qn.jb() ? this : 1 === b10 ? (a10 = w$(a10), C$(uc(a10).$a(), this.Mf)) : K$(new E$(), this.Mf, a10); + }; + d7.pO = function(a10, b10) { + a10 = b10 ? D6(this.qn, a10, true) : D6(this.qn, a10, false); + b10 = a10.jb(); + switch (b10) { + case 0: + return null; + case 1: + return a10 = w$(a10), C$(uc(a10).$a(), this.Mf); + default: + return b10 === this.qn.jb() ? this : K$(new E$(), this.Mf, a10); + } + }; + d7.Qx = function(a10, b10) { + return b10 === this.Mf && this.qn.Ha(a10); + }; + d7.DW = function(a10, b10) { + var c10 = w$(this.qn); + c10 = uc(c10); + for (var e10 = true; e10 && c10.Ya(); ) + e10 = c10.$a(), e10 = a10.Qx(e10, this.Mf, b10); + return e10; + }; + d7.$classData = r8({ mbb: 0 }, false, "scala.collection.immutable.HashSet$HashSetCollision1", { mbb: 1, pbb: 1, sW: 1, Ku: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, qy: 1, $i: 1, oj: 1, mj: 1, Hi: 1, q: 1, o: 1 }); + function qyb() { + } + qyb.prototype = new ayb(); + qyb.prototype.constructor = qyb; + qyb.prototype.a = function() { + return this; + }; + qyb.prototype.$classData = r8({ xbb: 0 }, false, "scala.collection.immutable.ListMap$EmptyListMap$", { xbb: 1, vbb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + var ryb = void 0; + function qgb() { + ryb || (ryb = new qyb().a()); + return ryb; + } + function F$() { + this.tfa = this.jI = this.Tk = null; + } + F$.prototype = new ayb(); + F$.prototype.constructor = F$; + function syb(a10, b10) { + var c10 = H10(); + for (; ; ) { + if (b10.b()) + return lia(c10); + if (Va(Wa(), a10, b10.uu())) { + b10 = b10.tH(); + for (a10 = c10; !a10.b(); ) + c10 = a10.ga(), b10 = dyb(new F$(), b10, c10.uu(), c10.Dt()), a10 = a10.ta(); + return b10; + } + var e10 = b10.tH(); + c10 = ji(b10, c10); + b10 = e10; + } + } + d7 = F$.prototype; + d7.P = function(a10) { + a: { + var b10 = this; + for (; ; ) { + if (b10.b()) + throw new iL().e("key not found: " + a10); + if (Va(Wa(), a10, b10.uu())) { + a10 = b10.Dt(); + break a; + } + b10 = b10.tH(); + } + } + return a10; + }; + d7.al = function(a10) { + return syb(a10, this); + }; + d7.Dt = function() { + return this.jI; + }; + d7.b = function() { + return false; + }; + d7.cc = function(a10) { + return this.EI(a10); + }; + d7.wp = function(a10) { + return syb(a10, this); + }; + d7.jb = function() { + a: { + var a10 = this, b10 = 0; + for (; ; ) { + if (a10.b()) + break a; + a10 = a10.tH(); + b10 = 1 + b10 | 0; + } + } + return b10; + }; + d7.uu = function() { + return this.Tk; + }; + d7.EI = function(a10) { + var b10 = syb(a10.ma(), this); + return dyb(new F$(), b10, a10.ma(), a10.ya()); + }; + d7.Wh = function(a10, b10) { + return this.RW(a10, b10); + }; + d7.RW = function(a10, b10) { + var c10 = syb(a10, this); + return dyb(new F$(), c10, a10, b10); + }; + d7.hX = function(a10) { + return syb(a10, this); + }; + d7.Ja = function(a10) { + a: { + var b10 = this; + for (; ; ) { + if (b10.b()) { + a10 = y7(); + break a; + } + if (Va(Wa(), a10, b10.uu())) { + a10 = new z7().d(b10.Dt()); + break a; + } + b10 = b10.tH(); + } + } + return a10; + }; + function dyb(a10, b10, c10, e10) { + a10.Tk = c10; + a10.jI = e10; + if (null === b10) + throw mb(E6(), null); + a10.tfa = b10; + return a10; + } + d7.Ha = function(a10) { + a: { + var b10 = this; + for (; ; ) { + if (b10.b()) { + a10 = false; + break a; + } + if (Va(Wa(), a10, b10.uu())) { + a10 = true; + break a; + } + b10 = b10.tH(); + } + } + return a10; + }; + d7.tH = function() { + return this.tfa; + }; + d7.Ru = function(a10) { + return this.EI(a10); + }; + d7.$classData = r8({ ybb: 0 }, false, "scala.collection.immutable.ListMap$Node", { ybb: 1, vbb: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1 }); + function pS() { + this.Xj = this.lK = this.xn = 0; + this.rv = false; + this.Mda = this.TE = 0; + } + pS.prototype = new V9(); + pS.prototype.constructor = pS; + function tyb() { + } + d7 = tyb.prototype = pS.prototype; + d7.Hd = function() { + return this; + }; + d7.qE = function() { + return false; + }; + d7.ga = function() { + return this.rv ? H10().Z0() : this.xn; + }; + d7.lb = function(a10) { + return this.ro(a10); + }; + d7.P = function(a10) { + return this.ro(a10 | 0); + }; + d7.b = function() { + return this.rv; + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.h = function(a10) { + if (a10 instanceof pS) { + if (this.rv) + return a10.rv; + if (tc(a10) && this.xn === a10.xn) { + var b10 = L$(this); + return b10 === L$(a10) && (this.xn === b10 || this.Xj === a10.Xj); + } + return false; + } + return R42(this, a10); + }; + function uyb(a10, b10) { + if (a10.rv) + return a10 = a10.xn, new qa().Sc(a10, a10 >> 31); + for (var c10 = a10.xn, e10 = L$(a10); c10 !== e10 && b10.Ep(c10); ) + c10 = c10 + a10.Xj | 0; + if (c10 === e10 && b10.Ep(c10)) + return b10 = c10, c10 = b10 >> 31, e10 = a10.Xj, a10 = e10 >> 31, e10 = b10 + e10 | 0, new qa().Sc(e10, (-2147483648 ^ e10) < (-2147483648 ^ b10) ? 1 + (c10 + a10 | 0) | 0 : c10 + a10 | 0); + a10 = c10; + return new qa().Sc(a10, a10 >> 31); + } + d7.ro = function(a10) { + 0 > this.TE && dLa(Axa(), this.xn, this.lK, this.Xj, this.qE()); + if (0 > a10 || a10 >= this.TE) + throw new U6().e("" + a10); + return this.xn + ca(this.Xj, a10) | 0; + }; + d7.gl = function(a10) { + var b10 = uyb(this, a10); + a10 = b10.od; + b10 = b10.Ud; + var c10 = this.xn; + a10 === c10 && b10 === c10 >> 31 ? a10 = this : (a10 = a10 - this.Xj | 0, a10 === L$(this) ? (a10 = L$(this), a10 = new pS().Fi(a10, a10, this.Xj)) : a10 = new M$().Fi(a10 + this.Xj | 0, L$(this), this.Xj)); + return a10; + }; + d7.Fi = function(a10, b10, c10) { + this.xn = a10; + this.lK = b10; + this.Xj = c10; + this.rv = a10 > b10 && 0 < c10 || a10 < b10 && 0 > c10 || a10 === b10 && !this.qE(); + if (0 === c10) + throw new Zj().e("step cannot be 0."); + if (this.rv) + a10 = 0; + else { + var e10 = vyb(this); + a10 = e10.od; + var f10 = e10.Ud, g10 = this.Xj, h10 = g10 >> 31; + e10 = Ea(); + a10 = Tya(e10, a10, f10, g10, h10); + e10 = e10.Wj; + g10 = this.qE() || !wyb(this) ? 1 : 0; + f10 = g10 >> 31; + g10 = a10 + g10 | 0; + e10 = new qa().Sc(g10, (-2147483648 ^ g10) < (-2147483648 ^ a10) ? 1 + (e10 + f10 | 0) | 0 : e10 + f10 | 0); + a10 = e10.od; + e10 = e10.Ud; + a10 = (0 === e10 ? -1 < (-2147483648 ^ a10) : 0 < e10) ? -1 : a10; + } + this.TE = a10; + switch (c10) { + case 1: + b10 = this.qE() ? b10 : -1 + b10 | 0; + break; + case -1: + b10 = this.qE() ? b10 : 1 + b10 | 0; + break; + default: + e10 = vyb(this), a10 = e10.od, e10 = e10.Ud, f10 = c10 >> 31, a10 = BWa(Ea(), a10, e10, c10, f10), b10 = 0 !== a10 ? b10 - a10 | 0 : this.qE() ? b10 : b10 - c10 | 0; + } + this.Mda = b10; + return this; + }; + d7.t = function() { + var a10 = this.qE() ? "to" : "until", b10 = 1 === this.Xj ? "" : " by " + this.Xj; + return (this.rv ? "empty " : wyb(this) ? "" : "inexact ") + "Range " + this.xn + " " + a10 + " " + this.lK + b10; + }; + d7.Di = function() { + return hG(); + }; + d7.U = function(a10) { + if (!this.rv) + for (var b10 = this.xn; ; ) { + a10.P(b10); + if (b10 === this.Mda) + break; + b10 = b10 + this.Xj | 0; + } + }; + d7.xl = function(a10) { + var b10 = uyb(this, a10); + a10 = b10.od; + b10 = b10.Ud; + var c10 = this.xn; + a10 === c10 && b10 === c10 >> 31 ? (a10 = this.xn, a10 = new pS().Fi(a10, a10, this.Xj)) : (a10 = a10 - this.Xj | 0, a10 = a10 === L$(this) ? this : new M$().Fi(this.xn, a10, this.Xj)); + return a10; + }; + d7.Gja = function(a10, b10, c10) { + return new pS().Fi(a10, b10, c10); + }; + d7.st = function() { + return this.rv ? this : new M$().Fi(L$(this), this.xn, -this.Xj | 0); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Mj = function() { + return n9(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.Oa()); + }; + d7.Pm = function(a10) { + var b10 = uyb(this, a10); + a10 = b10.od; + b10 = b10.Ud; + var c10 = this.xn; + if (a10 === c10 && b10 === c10 >> 31) + return a10 = this.xn, new R6().M(new pS().Fi(a10, a10, this.Xj), this); + a10 = a10 - this.Xj | 0; + return a10 === L$(this) ? (a10 = L$(this), new R6().M(this, new pS().Fi(a10, a10, this.Xj))) : new R6().M(new M$().Fi(this.xn, a10, this.Xj), new M$().Fi(a10 + this.Xj | 0, L$(this), this.Xj)); + }; + d7.Oa = function() { + return 0 > this.TE ? dLa(Axa(), this.xn, this.lK, this.Xj, this.qE()) : this.TE; + }; + d7.hm = function() { + return this.Oa(); + }; + function xyb(a10, b10) { + return 0 >= b10 || a10.rv ? a10 : b10 >= a10.TE && 0 <= a10.TE ? (b10 = a10.lK, new pS().Fi(b10, b10, a10.Xj)) : a10.Gja(a10.xn + ca(a10.Xj, b10) | 0, a10.lK, a10.Xj); + } + d7.Jk = function(a10) { + 0 >= a10 || this.rv ? (a10 = this.xn, a10 = new pS().Fi(a10, a10, this.Xj)) : a10 = a10 >= this.TE && 0 <= this.TE ? this : new M$().Fi(this.xn, this.xn + ca(this.Xj, -1 + a10 | 0) | 0, this.Xj); + return a10; + }; + function wyb(a10) { + var b10 = vyb(a10), c10 = b10.od; + b10 = b10.Ud; + var e10 = a10.Xj, f10 = e10 >> 31; + a10 = Ea(); + c10 = BWa(a10, c10, b10, e10, f10); + b10 = a10.Wj; + return 0 === c10 && 0 === b10; + } + d7.hA = function() { + return L$(this); + }; + d7.Rk = function(a10) { + return xyb(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + this.rv && yyb(H10()); + return xyb(this, 1); + }; + d7.ke = function() { + return this; + }; + function L$(a10) { + return a10.rv ? (a10 = H10(), lia(a10) | 0) : a10.Mda; + } + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + function vyb(a10) { + var b10 = a10.lK, c10 = b10 >> 31, e10 = a10.xn; + a10 = e10 >> 31; + e10 = b10 - e10 | 0; + return new qa().Sc(e10, (-2147483648 ^ e10) > (-2147483648 ^ b10) ? -1 + (c10 - a10 | 0) | 0 : c10 - a10 | 0); + } + d7.$classData = r8({ Fpa: 0 }, false, "scala.collection.immutable.Range", { Fpa: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Sda: 1, VH: 1, $i: 1, oj: 1, mj: 1, bo: 1, nj: 1, Hi: 1, q: 1, o: 1 }); + function zyb() { + } + zyb.prototype = new V9(); + zyb.prototype.constructor = zyb; + function Ayb() { + } + d7 = Ayb.prototype = zyb.prototype; + d7.Hd = function() { + return this; + }; + function Byb(a10) { + var b10 = AT(); + b10 = new qd().d(b10); + for (var c10 = a10; !c10.b(); ) { + Pt(); + var e10 = tya(new cK().PG(oq(/* @__PURE__ */ function(f10, g10) { + return function() { + return g10.oa; + }; + }(a10, b10))), c10.ga()); + e10.ta(); + b10.oa = e10; + c10 = c10.ta(); + } + return b10.oa; + } + d7.lb = function(a10) { + return Uu(this, a10); + }; + function Cyb(a10, b10) { + if (!a10.b() && b10.P(a10.ga())) { + var c10 = a10.ga(); + return dK(c10, oq(/* @__PURE__ */ function(e10, f10) { + return function() { + return Cyb(e10.ta(), f10); + }; + }(a10, b10))); + } + return AT(); + } + d7.Oe = function(a10) { + return Tu(this, a10); + }; + d7.P = function(a10) { + return Uu(this, a10 | 0); + }; + d7.fm = function(a10) { + return Bvb(this, a10); + }; + d7.ps = function(a10) { + return Dyb(this, a10); + }; + d7.Od = function(a10) { + return Avb(this, a10); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.h = function(a10) { + return this === a10 || R42(this, a10); + }; + d7.bd = function(a10, b10) { + if (b10.en(this) instanceof K6) { + if (this.b()) + a10 = AT(); + else { + b10 = new qd().d(this); + for (var c10 = a10.P(b10.oa.ga()).Dd(); !b10.oa.b() && c10.b(); ) + b10.oa = b10.oa.ta(), b10.oa.b() || (c10 = a10.P(b10.oa.ga()).Dd()); + a10 = b10.oa.b() ? (Pt(), AT()) : vya(c10, oq(/* @__PURE__ */ function(e10, f10, g10) { + return function() { + return f10.oa.ta().bd(g10, (Pt(), new Qt().a())); + }; + }(this, b10, a10))); + } + return a10; + } + return hC(this, a10, b10); + }; + function LT(a10, b10, c10) { + for (; !a10.b() && !!b10.P(a10.ga()) === c10; ) + a10 = a10.ta(); + return tc(a10) ? Ssb(Pt(), a10, b10, c10) : AT(); + } + d7.V9 = function(a10) { + return Eyb(this, a10); + }; + d7.gl = function(a10) { + for (var b10 = this; !b10.b() && a10.P(b10.ga()); ) + b10 = b10.ta(); + return b10; + }; + d7.Kg = function(a10) { + return this.Zn("", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + var e10 = this, f10 = this; + for (e10.b() || (e10 = e10.ta()); f10 !== e10 && !e10.b(); ) { + e10 = e10.ta(); + if (e10.b()) + break; + e10 = e10.ta(); + if (e10 === f10) + break; + f10 = f10.ta(); + } + return UJ(this, a10, b10, c10); + }; + d7.oh = function(a10) { + return Cvb(this, a10); + }; + d7.qq = function(a10) { + return rLa(new KT(), oq(/* @__PURE__ */ function(b10) { + return function() { + return b10; + }; + }(this)), a10); + }; + d7.Di = function() { + return Pt(); + }; + d7.t = function() { + return UJ(this, "Stream(", ", ", ")"); + }; + d7.U = function(a10) { + var b10 = this; + a: + for (; ; ) { + if (!b10.b()) { + a10.P(b10.ga()); + b10 = b10.ta(); + continue a; + } + break; + } + }; + d7.ne = function(a10, b10) { + var c10 = this; + for (; ; ) { + if (c10.b()) + return a10; + var e10 = c10.ta(); + a10 = b10.ug(a10, c10.ga()); + c10 = e10; + } + }; + d7.qs = function(a10, b10) { + return this.b() ? a10 : b10.ug(this.ga(), this.ta().qs(a10, b10)); + }; + d7.wm = function(a10, b10) { + return Evb(this, a10, b10); + }; + d7.xl = function(a10) { + return Cyb(this, a10); + }; + function VMa(a10, b10, c10) { + for (; ; ) { + if (c10.b()) + return c10; + var e10 = c10.ga(); + if (b10.Ha(e10)) + c10 = c10.ta(); + else + return e10 = c10.ga(), dK(e10, oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + return VMa(f10, g10.Zj(h10.ga()), h10.ta()); + }; + }(a10, b10, c10))); + } + } + d7.st = function() { + return Byb(this); + }; + d7.v$ = function(a10, b10) { + return LT(this, a10, b10); + }; + d7.fj = function() { + return VMa(this, J5(qe2(), H10()), this); + }; + d7.Vr = function(a10, b10) { + return b10.en(this) instanceof K6 ? dK(a10, oq(/* @__PURE__ */ function(c10) { + return function() { + return c10; + }; + }(this))) : qub(this, a10, b10); + }; + d7.mb = function() { + return new y9a().w1(this); + }; + d7.Fb = function(a10) { + return Fvb(this, a10); + }; + d7.Pm = function(a10) { + for (var b10 = this, c10 = this.Di().Qd(); !b10.b() && a10.P(b10.ga()); ) + c10.jd(b10.ga()), b10 = b10.ta(); + return new R6().M(c10.Rc(), b10); + }; + d7.Oa = function() { + for (var a10 = 0, b10 = this; !b10.b(); ) + a10 = 1 + a10 | 0, b10 = b10.ta(); + return a10; + }; + d7.ia = function(a10, b10) { + return b10.en(this) instanceof K6 ? (this.b() ? a10 = a10.Dd() : (b10 = this.ga(), a10 = dK(b10, oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return c10.ta().ia(e10, (Pt(), new Qt().a())); + }; + }(this, a10)))), a10) : xq(this, a10, b10); + }; + d7.og = function(a10) { + var b10 = Pt(); + return this.rF(Rsb(b10, 0, 1), a10); + }; + d7.cm = function() { + return this.Zn("", "", ""); + }; + d7.Dm = function(a10) { + var b10 = LT(this, w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return !!e10.P(f10); + }; + }(this, a10)), false); + return new R6().M(b10, LT(this, w6(/* @__PURE__ */ function(c10, e10) { + return function(f10) { + return !!e10.P(f10); + }; + }(this, a10)), true)); + }; + d7.Jk = function(a10) { + return Fyb(this, a10); + }; + d7.Dd = function() { + return this; + }; + d7.wy = function() { + return new kxb().w1(this); + }; + function Dyb(a10, b10) { + for (var c10 = new qd().d(a10); ; ) + if (tc(c10.oa)) { + var e10 = b10.P(c10.oa.ga()); + if (e10.b()) + c10.oa = c10.oa.ta(); + else + return e10 = e10.Dd(), Pt(), uya(new cK().PG(oq(/* @__PURE__ */ function(f10, g10, h10) { + return function() { + return Dyb(g10.oa.ta(), h10); + }; + }(a10, c10, b10))), e10); + } else + break; + Pt(); + return AT(); + } + d7.Rk = function(a10) { + return Eyb(this, a10); + }; + function Eyb(a10, b10) { + for (; ; ) { + if (0 >= b10 || a10.b()) + return a10; + a10 = a10.ta(); + b10 = -1 + b10 | 0; + } + } + d7.ok = function() { + return this; + }; + d7.Ha = function(a10) { + return Cg(this, a10); + }; + d7.rm = function(a10, b10, c10, e10) { + Vj(a10, b10); + if (!this.b()) { + Wj(a10, this.ga()); + b10 = this; + if (b10.fF()) { + var f10 = this.ta(); + if (f10.b()) + return Vj(a10, e10), a10; + if (b10 !== f10 && (b10 = f10, f10.fF())) + for (f10 = f10.ta(); b10 !== f10 && f10.fF(); ) + Wj(Vj(a10, c10), b10.ga()), b10 = b10.ta(), f10 = f10.ta(), f10.fF() && (f10 = f10.ta()); + if (f10.fF()) { + for (var g10 = this, h10 = 0; g10 !== f10; ) + g10 = g10.ta(), f10 = f10.ta(), h10 = 1 + h10 | 0; + b10 === f10 && 0 < h10 && (Wj(Vj(a10, c10), b10.ga()), b10 = b10.ta()); + for (; b10 !== f10; ) + Wj(Vj(a10, c10), b10.ga()), b10 = b10.ta(); + } else { + for (; b10 !== f10; ) + Wj(Vj(a10, c10), b10.ga()), b10 = b10.ta(); + tc(b10) && Wj(Vj(a10, c10), b10.ga()); + } + } + b10.b() || (b10.fF() ? Vj(Vj(a10, c10), "...") : Vj(Vj(a10, c10), "?")); + } + Vj(a10, e10); + return a10; + }; + d7.ke = function() { + return this; + }; + d7.Sa = function(a10) { + return Gvb(this, a10 | 0); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.ka = function(a10, b10) { + return b10.en(this) instanceof K6 ? (this.b() ? a10 = AT() : (b10 = a10.P(this.ga()), a10 = dK(b10, oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return c10.ta().ka(e10, (Pt(), new Qt().a())); + }; + }(this, a10)))), a10) : Jd(this, a10, b10); + }; + function Fyb(a10, b10) { + if (0 >= b10 || a10.b()) + return Pt(), AT(); + if (1 === b10) + return b10 = a10.ga(), dK(b10, oq(/* @__PURE__ */ function() { + return function() { + Pt(); + return AT(); + }; + }(a10))); + var c10 = a10.ga(); + return dK(c10, oq(/* @__PURE__ */ function(e10, f10) { + return function() { + return Fyb(e10.ta(), -1 + f10 | 0); + }; + }(a10, b10))); + } + d7.ec = function(a10, b10) { + if (b10.en(this) instanceof K6) { + for (var c10 = this, e10 = new qd().d(null), f10 = a10.vA(w6(/* @__PURE__ */ function(g10, h10) { + return function(k10) { + h10.oa = k10; + }; + }(this, e10))); ; ) + if (tc(c10) && !f10.P(c10.ga())) + c10 = c10.ta(); + else + break; + return c10.b() ? AT() : Tsb(Pt(), e10.oa, c10, a10, b10); + } + return xs(this, a10, b10); + }; + function vya(a10, b10) { + if (a10.b()) + return Hb(b10).Dd(); + var c10 = a10.ga(); + return dK(c10, oq(/* @__PURE__ */ function(e10, f10) { + return function() { + return vya(e10.ta(), f10); + }; + }(a10, b10))); + } + d7.Xk = function() { + return "Stream"; + }; + d7.rF = function(a10, b10) { + return b10.en(this) instanceof K6 ? (this.b() || a10.b() ? a10 = AT() : (b10 = new R6().M(this.ga(), a10.ga()), a10 = dK(b10, oq(/* @__PURE__ */ function(c10, e10) { + return function() { + return c10.ta().rF(e10.ta(), (Pt(), new Qt().a())); + }; + }(this, a10)))), a10) : N8(this, a10, b10); + }; + function xF(a10, b10) { + if (b10 >= a10.w) + throw new U6().e("" + b10); + return a10.L.n[b10]; + } + function uD(a10, b10) { + var c10 = a10.L.n.length, e10 = c10 >> 31, f10 = b10 >> 31; + if (f10 === e10 ? (-2147483648 ^ b10) > (-2147483648 ^ c10) : f10 > e10) { + f10 = c10 << 1; + for (c10 = c10 >>> 31 | 0 | e10 << 1; ; ) { + e10 = b10 >> 31; + var g10 = f10, h10 = c10; + if (e10 === h10 ? (-2147483648 ^ b10) > (-2147483648 ^ g10) : e10 > h10) + c10 = f10 >>> 31 | 0 | c10 << 1, f10 <<= 1; + else + break; + } + b10 = c10; + if (0 === b10 ? -1 < (-2147483648 ^ f10) : 0 < b10) + f10 = 2147483647; + b10 = f10; + b10 = ja(Ja(Ha), [b10]); + Ba(a10.L, 0, b10, 0, a10.w); + a10.L = b10; + } + } + function $G(a10, b10) { + for (OVa(Gb(), b10 <= a10.w); a10.w > b10; ) + a10.w = -1 + a10.w | 0, a10.L.n[a10.w] = null; + } + function Gyb() { + u$.call(this); + this.Fa = this.tO = null; + } + Gyb.prototype = new v$(); + Gyb.prototype.constructor = Gyb; + d7 = Gyb.prototype; + d7.lb = function(a10) { + return this.tO.lb(a10); + }; + d7.P = function(a10) { + return this.tO.lb(a10 | 0); + }; + function fxb(a10, b10) { + var c10 = new Gyb(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.tO = Hb(b10); + u$.prototype.nt.call(c10, a10); + return c10; + } + d7.U = function(a10) { + this.tO.U(a10); + }; + d7.mb = function() { + return this.tO.mb(); + }; + d7.Pl = function() { + return "C"; + }; + d7.Oa = function() { + return this.tO.Oa(); + }; + d7.$classData = r8({ oab: 0 }, false, "scala.collection.SeqViewLike$$anon$1", { oab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, Bab: 1, Q$a: 1, Pab: 1 }); + function g$() { + u$.call(this); + this.Joa = this.nda = null; + this.Ci = false; + this.Fa = null; + } + g$.prototype = new v$(); + g$.prototype.constructor = g$; + d7 = g$.prototype; + d7.lb = function(a10) { + return yxb(this, a10); + }; + d7.P = function(a10) { + return yxb(this, a10 | 0); + }; + d7.U = function(a10) { + this.Hda().U(a10); + this.z2().U(a10); + }; + d7.cH = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.nda = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Hda = function() { + return this.Fa; + }; + d7.z2 = function() { + return this.nda; + }; + d7.mb = function() { + return Ewb(this); + }; + d7.Pl = function() { + return "A"; + }; + d7.Oa = function() { + return this.OP().Oa() + this.y2().Oa() | 0; + }; + d7.OP = function() { + return this.Fa; + }; + d7.opa = function() { + return this.Fa; + }; + d7.y2 = function() { + this.Ci || this.Ci || (this.Joa = this.nda.Vh(), this.Ci = true); + return this.Joa; + }; + d7.$classData = r8({ rab: 0 }, false, "scala.collection.SeqViewLike$$anon$2", { rab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, zab: 1, O$a: 1, Nab: 1 }); + function f$() { + u$.call(this); + this.Oka = this.xO = null; + this.Ci = false; + this.Fa = null; + } + f$.prototype = new v$(); + f$.prototype.constructor = f$; + d7 = f$.prototype; + d7.lb = function(a10) { + return Jxb(this, a10); + }; + d7.P = function(a10) { + return Jxb(this, a10 | 0); + }; + d7.I2 = function() { + return this.Fa; + }; + d7.yO = function() { + this.Ci || this.Ci || (this.Oka = this.xO.Vh(), this.Ci = true); + return this.Oka; + }; + d7.U = function(a10) { + this.Q0().U(a10); + this.Kda().U(a10); + }; + d7.cH = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.xO = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Q0 = function() { + return this.xO; + }; + d7.mb = function() { + return Jwb(this); + }; + d7.Pl = function() { + return "A"; + }; + d7.Oa = function() { + return this.yO().Oa() + this.I2().Oa() | 0; + }; + d7.Kda = function() { + return this.Fa; + }; + d7.rpa = function() { + return this.Fa; + }; + d7.$classData = r8({ sab: 0 }, false, "scala.collection.SeqViewLike$$anon$3", { sab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, Dab: 1, S$a: 1, Rab: 1 }); + function h$() { + u$.call(this); + this.Fa = this.bV = null; + } + h$.prototype = new v$(); + h$.prototype.constructor = h$; + d7 = h$.prototype; + d7.lb = function(a10) { + return Ixb(this, a10); + }; + d7.P = function(a10) { + return Ixb(this, a10 | 0); + }; + d7.U = function(a10) { + jwb(this, a10); + }; + d7.NB = function() { + return this.bV; + }; + d7.tpa = function() { + return this.Fa; + }; + d7.mb = function() { + return Iwb(this); + }; + d7.Pl = function() { + return "M"; + }; + d7.Oa = function() { + return this.Fa.Oa(); + }; + d7.qpa = function() { + return this.Fa; + }; + d7.Ao = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.bV = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.wpa = function() { + return this.Fa; + }; + d7.$classData = r8({ tab: 0 }, false, "scala.collection.SeqViewLike$$anon$4", { tab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, Cab: 1, R$a: 1, Qab: 1 }); + function e$() { + u$.call(this); + this.Tj = this.bV = null; + this.Ci = false; + this.Fa = null; + } + e$.prototype = new v$(); + e$.prototype.constructor = e$; + d7 = e$.prototype; + d7.lb = function(a10) { + return Dxb(this, a10); + }; + d7.P = function(a10) { + return Dxb(this, a10 | 0); + }; + d7.dM = function() { + return this.Fa; + }; + d7.U = function(a10) { + iwb(this, a10); + }; + d7.NB = function() { + return this.bV; + }; + d7.mb = function() { + return Hwb(this); + }; + d7.Pl = function() { + return "N"; + }; + d7.Oa = function() { + return Exb(this); + }; + d7.ppa = function() { + return this.Fa; + }; + d7.N$ = function() { + this.Ci || (this.Tj = Hxb(this), this.Ci = true); + return this.Tj; + }; + d7.vpa = function() { + return this.Fa; + }; + d7.Ao = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.bV = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Rx = function() { + return this.Ci ? this.Tj : this.N$(); + }; + d7.$classData = r8({ uab: 0 }, false, "scala.collection.SeqViewLike$$anon$5", { uab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, Aab: 1, P$a: 1, Oab: 1 }); + function gxb() { + u$.call(this); + this.Tj = this.VB = null; + this.Ci = false; + this.Fa = null; + } + gxb.prototype = new v$(); + gxb.prototype.constructor = gxb; + d7 = gxb.prototype; + d7.lb = function(a10) { + return Bxb(this, a10); + }; + d7.P = function(a10) { + return Bxb(this, a10 | 0); + }; + d7.Eda = function() { + return this.Fa; + }; + d7.U = function(a10) { + hwb(this, a10); + }; + d7.mb = function() { + return Gwb(this); + }; + d7.Pl = function() { + return "F"; + }; + d7.Oa = function() { + return this.Rx().n.length; + }; + d7.N$ = function() { + this.Ci || (this.Tj = Cxb(this), this.Ci = true); + return this.Tj; + }; + d7.Ao = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.VB = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Rx = function() { + return this.Ci ? this.Tj : this.N$(); + }; + d7.Du = function() { + return this.VB; + }; + d7.PP = function() { + return this.Fa; + }; + d7.Jda = function() { + return this.Fa; + }; + d7.$classData = r8({ vab: 0 }, false, "scala.collection.SeqViewLike$$anon$6", { vab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, epa: 1, Zoa: 1, jpa: 1 }); + function Hyb() { + u$.call(this); + this.Fa = this.uka = null; + } + Hyb.prototype = new v$(); + Hyb.prototype.constructor = Hyb; + d7 = Hyb.prototype; + d7.lb = function(a10) { + return Kxb(this, a10); + }; + d7.P = function(a10) { + return Kxb(this, a10 | 0); + }; + d7.J2 = function() { + return this.Fa; + }; + d7.U = function(a10) { + var b10 = B$(this); + yT(b10, a10); + }; + d7.mb = function() { + return B$(this); + }; + d7.Pl = function() { + return "S"; + }; + d7.Oa = function() { + var a10 = B$(this); + return VJ(a10); + }; + function cxb(a10, b10) { + var c10 = new Hyb(); + if (null === a10) + throw mb(E6(), null); + c10.Fa = a10; + c10.uka = b10; + u$.prototype.nt.call(c10, a10); + return c10; + } + d7.nK = function() { + return this.uka; + }; + d7.$classData = r8({ wab: 0 }, false, "scala.collection.SeqViewLike$$anon$7", { wab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, gpa: 1, $oa: 1, kpa: 1 }); + function hxb() { + u$.call(this); + this.VB = null; + this.$pa = 0; + this.Ci = false; + this.Fa = null; + } + hxb.prototype = new v$(); + hxb.prototype.constructor = hxb; + d7 = hxb.prototype; + d7.lb = function(a10) { + return zxb(this, a10); + }; + d7.P = function(a10) { + return zxb(this, a10 | 0); + }; + d7.H2 = function() { + return this.Fa; + }; + d7.U = function(a10) { + gwb(this, a10); + }; + d7.Dda = function() { + return this.Fa; + }; + d7.mb = function() { + return Fwb(this); + }; + d7.Pl = function() { + return "D"; + }; + d7.Oa = function() { + return Axb(this); + }; + d7.Ida = function() { + return this.Fa; + }; + d7.Ms = function() { + this.Ci || this.Ci || (this.$pa = this.Fa.jM(this.VB, 0), this.Ci = true); + return this.$pa; + }; + d7.Ao = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.VB = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Du = function() { + return this.VB; + }; + d7.$classData = r8({ xab: 0 }, false, "scala.collection.SeqViewLike$$anon$8", { xab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dpa: 1, Yoa: 1, ipa: 1 }); + function exb() { + u$.call(this); + this.VB = null; + this.kH = 0; + this.Ci = false; + this.Fa = null; + } + exb.prototype = new v$(); + exb.prototype.constructor = exb; + d7 = exb.prototype; + d7.lb = function(a10) { + return Lxb(this, a10); + }; + d7.P = function(a10) { + return Lxb(this, a10 | 0); + }; + d7.Fda = function() { + return this.Fa; + }; + d7.gP = function() { + this.Ci || this.Ci || (this.kH = this.Fa.jM(this.VB, 0), this.Ci = true); + return this.kH; + }; + d7.U = function(a10) { + kwb(this, a10); + }; + d7.Lda = function() { + return this.Fa; + }; + d7.mb = function() { + return Kwb(this); + }; + d7.Pl = function() { + return "T"; + }; + d7.Oa = function() { + return this.gP(); + }; + d7.Gda = function() { + return this.Fa; + }; + d7.Ao = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Fa = a10; + this.VB = b10; + u$.prototype.nt.call(this, a10); + return this; + }; + d7.Du = function() { + return this.VB; + }; + d7.$classData = r8({ yab: 0 }, false, "scala.collection.SeqViewLike$$anon$9", { yab: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, hpa: 1, apa: 1, lpa: 1 }); + function Iyb() { + } + Iyb.prototype = new myb(); + Iyb.prototype.constructor = Iyb; + d7 = Iyb.prototype; + d7.a = function() { + return this; + }; + d7.ga = function() { + throw new iL().e("Empty Map"); + }; + d7.uea = function() { + throw new iL().e("Empty Map"); + }; + d7.ta = function() { + return this.uea(); + }; + d7.$classData = r8({ dbb: 0 }, false, "scala.collection.immutable.HashMap$EmptyHashMap$", { dbb: 1, rW: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1, Hi: 1 }); + var Jyb = void 0; + function K72() { + Jyb || (Jyb = new Iyb().a()); + return Jyb; + } + function A9a() { + this.Tk = null; + this.Mf = 0; + this.I1 = this.jI = null; + } + A9a.prototype = new myb(); + A9a.prototype.constructor = A9a; + function ogb(a10) { + null === a10.I1 && (a10.I1 = new R6().M(a10.Tk, a10.jI)); + return a10.I1; + } + function J$(a10, b10, c10, e10) { + var f10 = new A9a(); + f10.Tk = a10; + f10.Mf = b10; + f10.jI = c10; + f10.I1 = e10; + return f10; + } + d7 = A9a.prototype; + d7.lQ = function(a10, b10, c10, e10, f10, g10) { + if (b10 === this.Mf && Va(Wa(), a10, this.Tk)) { + if (null === g10) + return this.jI === e10 ? this : J$(a10, b10, e10, f10); + a10 = g10.dja(ogb(this), null !== f10 ? f10 : new R6().M(a10, e10)); + return J$(a10.ma(), b10, a10.ya(), a10); + } + if (b10 !== this.Mf) + return a10 = J$(a10, b10, e10, f10), mmb(L7(), this.Mf, this, b10, a10, c10, 2); + c10 = qgb(); + return Kyb(new N$(), b10, dyb(new F$(), c10, this.Tk, this.jI).RW(a10, e10)); + }; + d7.zO = function(a10, b10) { + return b10 === this.Mf && Va(Wa(), a10, this.Tk) ? new z7().d(this.jI) : y7(); + }; + d7.U = function(a10) { + a10.P(ogb(this)); + }; + d7.bW = function(a10, b10) { + return b10 === this.Mf && Va(Wa(), a10, this.Tk) ? (L7(), K72()) : this; + }; + d7.oO = function(a10, b10) { + return b10 !== !!a10.P(ogb(this)) ? this : null; + }; + d7.jb = function() { + return 1; + }; + d7.mb = function() { + $B(); + var a10 = [ogb(this)]; + a10 = new Ib().ha(a10); + return qS(new rS(), a10, 0, a10.L.length | 0); + }; + d7.XN = function(a10, b10) { + return b10 === this.Mf && Va(Wa(), a10, this.Tk); + }; + d7.$classData = r8({ ebb: 0 }, false, "scala.collection.immutable.HashMap$HashMap1", { ebb: 1, rW: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1, Hi: 1 }); + function N$() { + this.Mf = 0; + this.ot = null; + } + N$.prototype = new myb(); + N$.prototype.constructor = N$; + d7 = N$.prototype; + d7.lQ = function(a10, b10, c10, e10, f10, g10) { + if (b10 === this.Mf) + return null !== g10 && this.ot.Ha(a10) ? Kyb(new N$(), b10, this.ot.EI(g10.dja(new R6().M(a10, this.ot.P(a10)), f10))) : Kyb(new N$(), b10, this.ot.RW(a10, e10)); + a10 = J$(a10, b10, e10, f10); + return mmb(L7(), this.Mf, this, b10, a10, c10, 1 + this.ot.jb() | 0); + }; + d7.zO = function(a10, b10) { + return b10 === this.Mf ? this.ot.Ja(a10) : y7(); + }; + d7.U = function(a10) { + var b10 = cyb(this.ot); + yT(uc(b10), a10); + }; + d7.bW = function(a10, b10) { + if (b10 === this.Mf) { + a10 = this.ot.hX(a10); + var c10 = a10.jb(); + switch (c10) { + case 0: + return L7(), K72(); + case 1: + return a10 = cyb(a10), a10 = uc(a10).$a(), J$(a10.ma(), b10, a10.ya(), a10); + default: + return c10 === this.ot.jb() ? this : Kyb(new N$(), b10, a10); + } + } else + return this; + }; + d7.oO = function(a10, b10) { + a10 = b10 ? R9(this.ot, a10) : D6(this.ot, a10, false); + b10 = a10.jb(); + switch (b10) { + case 0: + return null; + case 1: + a10 = cyb(a10); + a10 = uc(a10).$a(); + if (null === a10) + throw new x7().d(a10); + b10 = a10.ma(); + var c10 = a10.ya(); + return J$(b10, this.Mf, c10, a10); + default: + return b10 === this.ot.jb() ? this : Kyb(new N$(), this.Mf, a10); + } + }; + d7.mb = function() { + var a10 = cyb(this.ot); + return uc(a10); + }; + d7.jb = function() { + return this.ot.jb(); + }; + function Kyb(a10, b10, c10) { + a10.Mf = b10; + a10.ot = c10; + return a10; + } + d7.XN = function(a10, b10) { + return b10 === this.Mf && this.ot.Ha(a10); + }; + d7.$classData = r8({ fbb: 0 }, false, "scala.collection.immutable.HashMap$HashMapCollision1", { fbb: 1, rW: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1, Hi: 1 }); + function j52() { + this.fs = 0; + this.hl = null; + this.w = 0; + } + j52.prototype = new myb(); + j52.prototype.constructor = j52; + d7 = j52.prototype; + d7.lQ = function(a10, b10, c10, e10, f10, g10) { + var h10 = 1 << (31 & (b10 >>> c10 | 0)), k10 = sK(ED(), this.fs & (-1 + h10 | 0)); + if (0 !== (this.fs & h10)) { + h10 = this.hl.n[k10]; + a10 = h10.lQ(a10, b10, 5 + c10 | 0, e10, f10, g10); + if (a10 === h10) + return this; + b10 = ja(Ja(I7), [this.hl.n.length]); + Pu(Gd(), this.hl, 0, b10, 0, this.hl.n.length); + b10.n[k10] = a10; + return J7(this.fs, b10, this.w + (a10.jb() - h10.jb() | 0) | 0); + } + c10 = ja(Ja(I7), [1 + this.hl.n.length | 0]); + Pu(Gd(), this.hl, 0, c10, 0, k10); + c10.n[k10] = J$(a10, b10, e10, f10); + Pu(Gd(), this.hl, k10, c10, 1 + k10 | 0, this.hl.n.length - k10 | 0); + return J7(this.fs | h10, c10, 1 + this.w | 0); + }; + d7.zO = function(a10, b10, c10) { + var e10 = 31 & (b10 >>> c10 | 0); + if (-1 === this.fs) + return this.hl.n[e10].zO(a10, b10, 5 + c10 | 0); + e10 = 1 << e10; + return 0 !== (this.fs & e10) ? (e10 = sK(ED(), this.fs & (-1 + e10 | 0)), this.hl.n[e10].zO(a10, b10, 5 + c10 | 0)) : y7(); + }; + d7.U = function(a10) { + for (var b10 = 0; b10 < this.hl.n.length; ) + this.hl.n[b10].U(a10), b10 = 1 + b10 | 0; + }; + d7.bW = function(a10, b10, c10) { + var e10 = 1 << (31 & (b10 >>> c10 | 0)), f10 = sK(ED(), this.fs & (-1 + e10 | 0)); + if (0 !== (this.fs & e10)) { + var g10 = this.hl.n[f10]; + a10 = g10.bW(a10, b10, 5 + c10 | 0); + if (a10 === g10) + return this; + if (0 === a10.jb()) { + e10 ^= this.fs; + if (0 !== e10) + return a10 = ja(Ja(I7), [-1 + this.hl.n.length | 0]), Pu(Gd(), this.hl, 0, a10, 0, f10), Pu(Gd(), this.hl, 1 + f10 | 0, a10, f10, -1 + (this.hl.n.length - f10 | 0) | 0), f10 = this.w - g10.jb() | 0, 1 !== a10.n.length || a10.n[0] instanceof j52 ? J7(e10, a10, f10) : a10.n[0]; + L7(); + return K72(); + } + return 1 !== this.hl.n.length || a10 instanceof j52 ? (e10 = ja(Ja(I7), [this.hl.n.length]), Pu(Gd(), this.hl, 0, e10, 0, this.hl.n.length), e10.n[f10] = a10, f10 = this.w + (a10.jb() - g10.jb() | 0) | 0, J7(this.fs, e10, f10)) : a10; + } + return this; + }; + d7.oO = function(a10, b10, c10, e10, f10) { + for (var g10 = f10, h10 = 0, k10 = 0, l10 = 0; l10 < this.hl.n.length; ) { + var m10 = this.hl.n[l10].oO(a10, b10, 5 + c10 | 0, e10, g10); + null !== m10 && (e10.n[g10] = m10, g10 = 1 + g10 | 0, h10 = h10 + m10.jb() | 0, k10 |= 1 << l10); + l10 = 1 + l10 | 0; + } + if (g10 === f10) + return null; + if (h10 === this.w) + return this; + if (g10 !== (1 + f10 | 0) || e10.n[f10] instanceof j52) { + b10 = g10 - f10 | 0; + a10 = ja(Ja(I7), [b10]); + Ba(e10, f10, a10, 0, b10); + if (b10 === this.hl.n.length) + k10 = this.fs; + else { + L7(); + e10 = 0; + for (f10 = this.fs; 0 !== k10; ) + b10 = f10 ^ f10 & (-1 + f10 | 0), 0 !== (1 & k10) && (e10 |= b10), f10 &= ~b10, k10 = k10 >>> 1 | 0; + k10 = e10; + } + return J7(k10, a10, h10); + } + return e10.n[f10]; + }; + d7.mb = function() { + var a10 = new ngb(); + h52.prototype.bla.call(a10, this.hl); + return a10; + }; + d7.jb = function() { + return this.w; + }; + function J7(a10, b10, c10) { + var e10 = new j52(); + e10.fs = a10; + e10.hl = b10; + e10.w = c10; + return e10; + } + d7.XN = function(a10, b10, c10) { + var e10 = 31 & (b10 >>> c10 | 0); + if (-1 === this.fs) + return this.hl.n[e10].XN(a10, b10, 5 + c10 | 0); + e10 = 1 << e10; + return 0 !== (this.fs & e10) ? (e10 = sK(ED(), this.fs & (-1 + e10 | 0)), this.hl.n[e10].XN(a10, b10, 5 + c10 | 0)) : false; + }; + d7.$classData = r8({ gbb: 0 }, false, "scala.collection.immutable.HashMap$HashTrieMap", { gbb: 1, rW: 1, yA: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, cx: 1, $i: 1, oj: 1, mj: 1, dx: 1, q: 1, o: 1, Hi: 1 }); + function qT() { + } + qT.prototype = new V9(); + qT.prototype.constructor = qT; + function Lyb() { + } + d7 = Lyb.prototype = qT.prototype; + d7.Hd = function() { + return this; + }; + d7.lb = function(a10) { + return Uu(this, a10); + }; + d7.Oe = function(a10) { + return Tu(this, a10); + }; + d7.P = function(a10) { + return Uu(this, a10 | 0); + }; + d7.fm = function(a10) { + return Bvb(this, a10); + }; + d7.Od = function(a10) { + return Avb(this, a10); + }; + d7.ua = function() { + return this; + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.bd = function(a10, b10) { + if (b10 === ii().u) { + if (this === H10()) + return H10(); + b10 = this; + for (var c10 = new Uj().eq(false), e10 = new qd().d(null), f10 = new qd().d(null); b10 !== H10(); ) + a10.P(b10.ga()).Hd().U(w6(/* @__PURE__ */ function(g10, h10, k10, l10) { + return function(m10) { + h10.oa ? (m10 = ji(m10, H10()), l10.oa.Nf = m10, l10.oa = m10) : (k10.oa = ji(m10, H10()), l10.oa = k10.oa, h10.oa = true); + }; + }(this, c10, e10, f10))), b10 = b10.ta(); + return c10.oa ? e10.oa : H10(); + } + return hC(this, a10, b10); + }; + d7.V9 = function(a10) { + return kia(this, a10); + }; + d7.gl = function(a10) { + a: { + var b10 = this; + for (; ; ) { + if (b10.b() || !a10.P(b10.ga())) + break a; + b10 = b10.ta(); + } + } + return b10; + }; + d7.oh = function(a10) { + return Cvb(this, a10); + }; + d7.Di = function() { + return ii(); + }; + d7.U = function(a10) { + for (var b10 = this; !b10.b(); ) + a10.P(b10.ga()), b10 = b10.ta(); + }; + d7.ne = function(a10, b10) { + return Dvb(this, a10, b10); + }; + d7.qs = function(a10, b10) { + for (var c10 = Cw(this); !c10.b(); ) { + var e10 = c10.ga(); + a10 = b10.ug(e10, a10); + c10 = c10.ta(); + } + return a10; + }; + d7.wm = function(a10, b10) { + return Evb(this, a10, b10); + }; + d7.xl = function(a10) { + for (var b10 = new Lf().a(), c10 = this; !c10.b() && a10.P(c10.ga()); ) + Dg(b10, c10.ga()), c10 = c10.ta(); + return b10.ua(); + }; + function I8a(a10, b10) { + a10.b() ? a10 = b10 : b10.b() || (b10 = ws(new Lf().a(), b10), b10.b() || (b10.rK && Myb(b10), b10.Qw.Nf = a10, a10 = b10.ua())); + return a10; + } + d7.st = function() { + return Cw(this); + }; + d7.Vr = function(a10, b10) { + return b10 instanceof IT ? ji(a10, this) : qub(this, a10, b10); + }; + d7.mb = function() { + return uc(this); + }; + function kia(a10, b10) { + for (; !a10.b() && 0 < b10; ) + a10 = a10.ta(), b10 = -1 + b10 | 0; + return a10; + } + d7.Fb = function(a10) { + return Fvb(this, a10); + }; + d7.Pm = function(a10) { + for (var b10 = new Lf().a(), c10 = this; !c10.b() && a10.P(c10.ga()); ) + Dg(b10, c10.ga()), c10 = c10.ta(); + return new R6().M(b10.ua(), c10); + }; + d7.ia = function(a10, b10) { + return b10 === ii().u ? I8a(a10.Hd().ua(), this) : xq(this, a10, b10); + }; + d7.Oa = function() { + return Eq(this); + }; + d7.Jk = function(a10) { + a: + if (this.b() || 0 >= a10) + a10 = H10(); + else { + for (var b10 = ji(this.ga(), H10()), c10 = b10, e10 = this.ta(), f10 = 1; ; ) { + if (e10.b()) { + a10 = this; + break a; + } + if (f10 < a10) { + f10 = 1 + f10 | 0; + var g10 = ji(e10.ga(), H10()); + c10 = c10.Nf = g10; + e10 = e10.ta(); + } else + break; + } + a10 = b10; + } + return a10; + }; + d7.Dd = function() { + return this.b() ? AT() : dK(this.ga(), oq(/* @__PURE__ */ function(a10) { + return function() { + return a10.ta().Dd(); + }; + }(this))); + }; + d7.Rk = function(a10) { + return kia(this, a10); + }; + d7.Ha = function(a10) { + return Cg(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ke = function() { + return this; + }; + d7.Sa = function(a10) { + return Gvb(this, a10 | 0); + }; + d7.z = function() { + return pT(this); + }; + d7.Vh = function() { + return this; + }; + d7.ka = function(a10, b10) { + if (b10 === ii().u) { + if (this === H10()) + return H10(); + for (var c10 = b10 = ji(a10.P(this.ga()), H10()), e10 = this.ta(); e10 !== H10(); ) { + var f10 = ji(a10.P(e10.ga()), H10()); + c10 = c10.Nf = f10; + e10 = e10.ta(); + } + return b10; + } + return Jd(this, a10, b10); + }; + d7.ec = function(a10, b10) { + if (b10 === ii().u) { + if (this === H10()) + return H10(); + b10 = this; + var c10 = null; + do { + var e10 = a10.Wa(b10.ga(), ii().LV); + e10 !== ii().LV && (c10 = ji(e10, H10())); + b10 = b10.ta(); + if (b10 === H10()) + return null === c10 ? H10() : c10; + } while (null === c10); + e10 = c10; + do { + var f10 = a10.Wa(b10.ga(), ii().LV); + f10 !== ii().LV && (f10 = ji(f10, H10()), e10 = e10.Nf = f10); + b10 = b10.ta(); + } while (b10 !== H10()); + return c10; + } + return xs(this, a10, b10); + }; + function Cw(a10) { + for (var b10 = H10(); !a10.b(); ) { + var c10 = a10.ga(); + b10 = ji(c10, b10); + a10 = a10.ta(); + } + return b10; + } + d7.Xk = function() { + return "List"; + }; + function M$() { + pS.call(this); + } + M$.prototype = new tyb(); + M$.prototype.constructor = M$; + M$.prototype.qE = function() { + return true; + }; + M$.prototype.Fi = function(a10, b10, c10) { + pS.prototype.Fi.call(this, a10, b10, c10); + return this; + }; + M$.prototype.Gja = function(a10, b10, c10) { + return new M$().Fi(a10, b10, c10); + }; + M$.prototype.$classData = r8({ Obb: 0 }, false, "scala.collection.immutable.Range$Inclusive", { Obb: 1, Fpa: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Sda: 1, VH: 1, $i: 1, oj: 1, mj: 1, bo: 1, nj: 1, Hi: 1, q: 1, o: 1 }); + function O$() { + this.r3 = this.vqa = this.Y0 = null; + } + O$.prototype = new Ayb(); + O$.prototype.constructor = O$; + d7 = O$.prototype; + d7.ga = function() { + return this.Y0; + }; + function Nyb(a10) { + a10.fF() || a10.fF() || (a10.vqa = Hb(a10.r3), a10.r3 = null); + return a10.vqa; + } + d7.fm = function(a10) { + return a10 instanceof O$ ? Oyb(this, a10) : Bvb(this, a10); + }; + d7.fF = function() { + return null === this.r3; + }; + d7.b = function() { + return false; + }; + function Oyb(a10, b10) { + for (; ; ) + if (Va(Wa(), a10.Y0, b10.Y0)) + if (a10 = Nyb(a10), a10 instanceof O$) + if (b10 = Nyb(b10), b10 instanceof O$) { + if (a10 === b10) + return true; + } else + return false; + else + return Nyb(b10).b(); + else + return false; + } + d7.ta = function() { + return Nyb(this); + }; + function dK(a10, b10) { + var c10 = new O$(); + c10.Y0 = a10; + c10.r3 = b10; + return c10; + } + d7.$classData = r8({ $bb: 0 }, false, "scala.collection.immutable.Stream$Cons", { $bb: 1, Wbb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Tda: 1, VH: 1, $i: 1, oj: 1, mj: 1, kW: 1, xda: 1, yda: 1, q: 1, o: 1 }); + function Pyb() { + } + Pyb.prototype = new Ayb(); + Pyb.prototype.constructor = Pyb; + d7 = Pyb.prototype; + d7.a = function() { + return this; + }; + d7.ga = function() { + this.Z0(); + }; + d7.fF = function() { + return false; + }; + d7.b = function() { + return true; + }; + d7.Z0 = function() { + throw new iL().e("head of empty stream"); + }; + d7.ta = function() { + throw new Lu().e("tail of empty stream"); + }; + d7.$classData = r8({ bcb: 0 }, false, "scala.collection.immutable.Stream$Empty$", { bcb: 1, Wbb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Tda: 1, VH: 1, $i: 1, oj: 1, mj: 1, kW: 1, xda: 1, yda: 1, q: 1, o: 1 }); + var Qyb = void 0; + function AT() { + Qyb || (Qyb = new Pyb().a()); + return Qyb; + } + function P$() { + u$.call(this); + } + P$.prototype = new v$(); + P$.prototype.constructor = P$; + function Q$() { + } + d7 = Q$.prototype = P$.prototype; + d7.CE = function(a10) { + return lxb(this, a10); + }; + d7.ps = function(a10) { + return new m$().jl(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.gl = function(a10) { + return this.fy(a10); + }; + d7.Fba = function(a10) { + return new t$().jl(this, a10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.t = function() { + return h9(this); + }; + d7.Hba = function() { + return new o$().pu(this); + }; + d7.Gba = function(a10) { + return new s$().jl(this, a10); + }; + d7.qP = function(a10) { + return new n$().eH(this, a10); + }; + d7.xl = function(a10) { + return this.gy(a10); + }; + d7.pu = function(a10) { + u$.prototype.nt.call(this, a10); + return this; + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Cb = function(a10) { + return this.rn(a10); + }; + d7.st = function() { + return new o$().pu(this); + }; + d7.fj = function() { + return $9(this); + }; + d7.Q1 = function(a10) { + return new m$().jl(this, a10); + }; + d7.Iba = function(a10) { + return new q$().jl(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.rna = function(a10) { + return new r$().jl(this, a10); + }; + d7.BL = function(a10) { + return new p$().eH(this, a10); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.sna = function(a10) { + return nxb(this, a10); + }; + d7.Jk = function(a10) { + return Wwb(this, a10); + }; + d7.gy = function(a10) { + return new q$().jl(this, a10); + }; + d7.Rk = function(a10) { + return yub(this, a10); + }; + d7.BE = function(a10) { + return new r$().jl(this, a10); + }; + d7.ta = function() { + return j9(this); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.Sw = function(a10) { + return mxb(this, a10); + }; + d7.DL = function(a10) { + return lxb(this, a10); + }; + d7.Jba = function(a10) { + return nxb(this, a10); + }; + d7.Vh = function() { + return this; + }; + d7.pna = function(a10) { + return new p$().eH(this, a10); + }; + d7.rn = function(a10) { + return new s$().jl(this, a10); + }; + d7.qna = function(a10) { + return new m$().jl(this, a10); + }; + d7.fy = function(a10) { + return new t$().jl(this, a10); + }; + d7.CL = function(a10) { + return mxb(this, a10); + }; + d7.Xk = function() { + return "StreamView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + function L6() { + this.Qq = this.wo = this.wl = 0; + this.El = false; + this.Yl = 0; + this.sw = this.ft = this.Nq = this.bp = this.gn = this.Zl = null; + } + L6.prototype = new V9(); + L6.prototype.constructor = L6; + d7 = L6.prototype; + d7.Hd = function() { + return this; + }; + d7.Eg = function() { + return this.Nq; + }; + function Ryb(a10, b10, c10, e10) { + if (a10.El) + if (32 > e10) + a10.Zh(Yj(a10.Fl())); + else if (1024 > e10) + a10.Jg(Yj(a10.me())), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + else if (32768 > e10) + a10.Jg(Yj(a10.me())), a10.ui(Yj(a10.Te())), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(), a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))), a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + else if (1048576 > e10) + a10.Jg(Yj(a10.me())), a10.ui(Yj(a10.Te())), a10.Gl(Yj(a10.Eg())), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(), a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))), a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))), a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + else if (33554432 > e10) + a10.Jg(Yj(a10.me())), a10.ui(Yj(a10.Te())), a10.Gl(Yj(a10.Eg())), a10.xr(Yj(a10.Ej())), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(), a10.Ej().n[31 & (b10 >>> 20 | 0)] = a10.Eg(), a10.Gl(bk(a10.Ej(), 31 & (c10 >>> 20 | 0))), a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))), a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))), a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + else if (1073741824 > e10) + a10.Jg(Yj(a10.me())), a10.ui(Yj(a10.Te())), a10.Gl(Yj(a10.Eg())), a10.xr(Yj(a10.Ej())), a10.rG(Yj(a10.js())), a10.me().n[31 & (b10 >>> 5 | 0)] = a10.Fl(), a10.Te().n[31 & (b10 >>> 10 | 0)] = a10.me(), a10.Eg().n[31 & (b10 >>> 15 | 0)] = a10.Te(), a10.Ej().n[31 & (b10 >>> 20 | 0)] = a10.Eg(), a10.js().n[31 & (b10 >>> 25 | 0)] = a10.Ej(), a10.xr(bk(a10.js(), 31 & (c10 >>> 25 | 0))), a10.Gl(bk(a10.Ej(), 31 & (c10 >>> 20 | 0))), a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))), a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))), a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + else + throw new Zj().a(); + else { + b10 = -1 + a10.Un() | 0; + switch (b10) { + case 5: + a10.rG(Yj(a10.js())); + a10.xr(bk(a10.js(), 31 & (c10 >>> 25 | 0))); + a10.Gl(bk(a10.Ej(), 31 & (c10 >>> 20 | 0))); + a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))); + a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))); + a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + break; + case 4: + a10.xr(Yj(a10.Ej())); + a10.Gl(bk(a10.Ej(), 31 & (c10 >>> 20 | 0))); + a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))); + a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))); + a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + break; + case 3: + a10.Gl(Yj(a10.Eg())); + a10.ui(bk(a10.Eg(), 31 & (c10 >>> 15 | 0))); + a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))); + a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + break; + case 2: + a10.ui(Yj(a10.Te())); + a10.Jg(bk(a10.Te(), 31 & (c10 >>> 10 | 0))); + a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + break; + case 1: + a10.Jg(Yj(a10.me())); + a10.Zh(bk(a10.me(), 31 & (c10 >>> 5 | 0))); + break; + case 0: + a10.Zh(Yj(a10.Fl())); + break; + default: + throw new x7().d(b10); + } + a10.El = true; + } + } + d7.ga = function() { + if (0 === this.Oe(0)) + throw new Lu().e("empty.head"); + return this.lb(0); + }; + d7.lb = function(a10) { + var b10 = a10 + this.wl | 0; + if (0 <= a10 && b10 < this.wo) + a10 = b10; + else + throw new U6().e("" + a10); + return Jda(this, a10, a10 ^ this.Qq); + }; + d7.Oe = function(a10) { + return this.Oa() - a10 | 0; + }; + d7.Un = function() { + return this.Yl; + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Fi = function(a10, b10, c10) { + this.wl = a10; + this.wo = b10; + this.Qq = c10; + this.El = false; + return this; + }; + d7.rG = function(a10) { + this.sw = a10; + }; + d7.yg = function(a10, b10) { + return b10 === (hG(), rw().sc) || b10 === pj().u || b10 === K7().u ? Syb(this, a10) : ju(this, a10, b10); + }; + d7.Di = function() { + return iG(); + }; + d7.Fl = function() { + return this.Zl; + }; + d7.Ej = function() { + return this.ft; + }; + d7.ui = function(a10) { + this.bp = a10; + }; + function Tyb(a10, b10, c10) { + var e10 = -1 + a10.Yl | 0; + switch (e10) { + case 0: + a10.Zl = ak(a10.Zl, b10, c10); + break; + case 1: + a10.gn = ak(a10.gn, b10, c10); + break; + case 2: + a10.bp = ak(a10.bp, b10, c10); + break; + case 3: + a10.Nq = ak(a10.Nq, b10, c10); + break; + case 4: + a10.ft = ak(a10.ft, b10, c10); + break; + case 5: + a10.sw = ak(a10.sw, b10, c10); + break; + default: + throw new x7().d(e10); + } + } + d7.Qo = function() { + return this; + }; + function Syb(a10, b10) { + if (a10.wo !== a10.wl) { + var c10 = -32 & a10.wo, e10 = 31 & a10.wo; + if (a10.wo !== c10) { + var f10 = new L6().Fi(a10.wl, 1 + a10.wo | 0, c10); + ck(f10, a10, a10.Yl); + f10.El = a10.El; + Ryb(f10, a10.Qq, c10, a10.Qq ^ c10); + f10.Zl.n[e10] = b10; + return f10; + } + var g10 = a10.wl & ~(-1 + (1 << ca(5, -1 + a10.Yl | 0)) | 0); + f10 = a10.wl >>> ca(5, -1 + a10.Yl | 0) | 0; + if (0 !== g10) { + if (1 < a10.Yl) { + c10 = c10 - g10 | 0; + var h10 = a10.Qq - g10 | 0; + g10 = new L6().Fi(a10.wl - g10 | 0, (1 + a10.wo | 0) - g10 | 0, c10); + ck(g10, a10, a10.Yl); + g10.El = a10.El; + Tyb(g10, f10, 0); + Uyb(g10, h10, c10, h10 ^ c10); + g10.Zl.n[e10] = b10; + return g10; + } + e10 = -32 + c10 | 0; + c10 = a10.Qq; + h10 = new L6().Fi(a10.wl - g10 | 0, (1 + a10.wo | 0) - g10 | 0, e10); + ck(h10, a10, a10.Yl); + h10.El = a10.El; + Tyb(h10, f10, 0); + Ryb(h10, c10, e10, c10 ^ e10); + h10.Zl.n[32 - g10 | 0] = b10; + return h10; + } + f10 = a10.Qq; + g10 = new L6().Fi(a10.wl, 1 + a10.wo | 0, c10); + ck(g10, a10, a10.Yl); + g10.El = a10.El; + Uyb(g10, f10, c10, f10 ^ c10); + g10.Zl.n[e10] = b10; + return g10; + } + a10 = ja(Ja(Ha), [32]); + a10.n[0] = b10; + b10 = new L6().Fi(0, 1, 0); + b10.Yl = 1; + b10.Zl = a10; + return b10; + } + d7.Mj = function() { + return n9(this); + }; + function Vyb(a10, b10) { + a10.Yl = b10; + b10 = -1 + b10 | 0; + switch (b10) { + case 0: + a10.gn = null; + a10.bp = null; + a10.Nq = null; + a10.ft = null; + a10.sw = null; + break; + case 1: + a10.bp = null; + a10.Nq = null; + a10.ft = null; + a10.sw = null; + break; + case 2: + a10.Nq = null; + a10.ft = null; + a10.sw = null; + break; + case 3: + a10.ft = null; + a10.sw = null; + break; + case 4: + a10.sw = null; + break; + case 5: + break; + default: + throw new x7().d(b10); + } + } + d7.Vr = function(a10, b10) { + return b10 === (hG(), rw().sc) || b10 === pj().u || b10 === K7().u ? Wyb(this, a10) : qub(this, a10, b10); + }; + d7.mb = function() { + var a10 = new ugb().Sc(this.wl, this.wo); + ck(a10, this, this.Yl); + this.El && Mda(a10, this.Qq); + 1 < a10.Q9 && Lda(a10, this.wl, this.wl ^ this.Qq); + return a10; + }; + d7.Jg = function(a10) { + this.gn = a10; + }; + function Xyb(a10, b10) { + for (; b10 < a10.n.length; ) + a10.n[b10] = null, b10 = 1 + b10 | 0; + } + d7.Oa = function() { + return this.wo - this.wl | 0; + }; + d7.ia = function(a10, b10) { + if (b10 === (hG(), rw().sc) || b10 === pj().u || b10 === K7().u) { + if (a10.b()) + return this; + var c10 = a10.Do() ? a10.Hd() : a10.Qo(), e10 = c10.jb(); + if (2 >= e10 || e10 < (this.Oa() >>> 5 | 0)) + return a10 = new qd().d(this), c10.U(w6(/* @__PURE__ */ function(f10, g10) { + return function(h10) { + g10.oa = g10.oa.yg(h10, (iG(), rw().sc)); + }; + }(this, a10))), a10.oa; + if (this.Oa() < (e10 >>> 5 | 0) && c10 instanceof L6) { + for (a10 = D9a(this); a10.Ya(); ) + b10 = a10.$a(), c10 = c10.Vr(b10, (iG(), rw().sc)); + return c10; + } + return xq(this, c10, b10); + } + return xq(this, a10.Hd(), b10); + }; + d7.xr = function(a10) { + this.ft = a10; + }; + function Uyb(a10, b10, c10, e10) { + a10.El ? (Mda(a10, b10), Kda(a10, b10, c10, e10)) : (Kda(a10, b10, c10, e10), a10.El = true); + } + d7.hm = function() { + return this.Oa(); + }; + d7.me = function() { + return this.gn; + }; + d7.Jk = function(a10) { + if (0 >= a10) + a10 = iG().pJ; + else if (this.wl < (this.wo - a10 | 0)) { + var b10 = this.wl + a10 | 0, c10 = -32 & (-1 + b10 | 0), e10 = Yyb(this.wl ^ (-1 + b10 | 0)), f10 = this.wl & ~(-1 + (1 << ca(5, e10)) | 0); + a10 = new L6().Fi(this.wl - f10 | 0, b10 - f10 | 0, c10 - f10 | 0); + ck(a10, this, this.Yl); + a10.El = this.El; + Ryb(a10, this.Qq, c10, this.Qq ^ c10); + Vyb(a10, e10); + b10 = b10 - f10 | 0; + if (32 >= b10) + Xyb(a10.Zl, b10); + else if (1024 >= b10) + Xyb(a10.Zl, 1 + (31 & (-1 + b10 | 0)) | 0), a10.gn = R$(a10.gn, b10 >>> 5 | 0); + else if (32768 >= b10) + Xyb(a10.Zl, 1 + (31 & (-1 + b10 | 0)) | 0), a10.gn = R$(a10.gn, 1 + (31 & ((-1 + b10 | 0) >>> 5 | 0)) | 0), a10.bp = R$(a10.bp, b10 >>> 10 | 0); + else if (1048576 >= b10) + Xyb(a10.Zl, 1 + (31 & (-1 + b10 | 0)) | 0), a10.gn = R$(a10.gn, 1 + (31 & ((-1 + b10 | 0) >>> 5 | 0)) | 0), a10.bp = R$(a10.bp, 1 + (31 & ((-1 + b10 | 0) >>> 10 | 0)) | 0), a10.Nq = R$(a10.Nq, b10 >>> 15 | 0); + else if (33554432 >= b10) + Xyb(a10.Zl, 1 + (31 & (-1 + b10 | 0)) | 0), a10.gn = R$(a10.gn, 1 + (31 & ((-1 + b10 | 0) >>> 5 | 0)) | 0), a10.bp = R$(a10.bp, 1 + (31 & ((-1 + b10 | 0) >>> 10 | 0)) | 0), a10.Nq = R$(a10.Nq, 1 + (31 & ((-1 + b10 | 0) >>> 15 | 0)) | 0), a10.ft = R$(a10.ft, b10 >>> 20 | 0); + else if (1073741824 >= b10) + Xyb(a10.Zl, 1 + (31 & (-1 + b10 | 0)) | 0), a10.gn = R$(a10.gn, 1 + (31 & ((-1 + b10 | 0) >>> 5 | 0)) | 0), a10.bp = R$(a10.bp, 1 + (31 & ((-1 + b10 | 0) >>> 10 | 0)) | 0), a10.Nq = R$(a10.Nq, 1 + (31 & ((-1 + b10 | 0) >>> 15 | 0)) | 0), a10.ft = R$(a10.ft, 1 + (31 & ((-1 + b10 | 0) >>> 20 | 0)) | 0), a10.sw = R$(a10.sw, b10 >>> 25 | 0); + else + throw new Zj().a(); + } else + a10 = this; + return a10; + }; + d7.hA = function() { + if (0 === this.Oe(0)) + throw new Lu().e("empty.last"); + return this.lb(-1 + this.Oa() | 0); + }; + d7.js = function() { + return this.sw; + }; + d7.Rk = function(a10) { + return Zyb(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + if (0 === this.Oe(0)) + throw new Lu().e("empty.tail"); + return Zyb(this, 1); + }; + d7.ke = function() { + return this; + }; + function Yyb(a10) { + if (32 > a10) + return 1; + if (1024 > a10) + return 2; + if (32768 > a10) + return 3; + if (1048576 > a10) + return 4; + if (33554432 > a10) + return 5; + if (1073741824 > a10) + return 6; + throw new Zj().a(); + } + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + function $yb(a10, b10) { + for (var c10 = 0; c10 < b10; ) + a10.n[c10] = null, c10 = 1 + c10 | 0; + } + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.rw = function(a10) { + this.Yl = a10; + }; + d7.Te = function() { + return this.bp; + }; + d7.Zh = function(a10) { + this.Zl = a10; + }; + function Zyb(a10, b10) { + if (!(0 >= b10)) + if (a10.wl < (a10.wo - b10 | 0)) { + var c10 = a10.wl + b10 | 0, e10 = -32 & c10, f10 = Yyb(c10 ^ (-1 + a10.wo | 0)), g10 = c10 & ~(-1 + (1 << ca(5, f10)) | 0); + b10 = new L6().Fi(c10 - g10 | 0, a10.wo - g10 | 0, e10 - g10 | 0); + ck(b10, a10, a10.Yl); + b10.El = a10.El; + Ryb(b10, a10.Qq, e10, a10.Qq ^ e10); + Vyb(b10, f10); + a10 = c10 - g10 | 0; + if (32 > a10) + $yb(b10.Zl, a10); + else if (1024 > a10) + $yb(b10.Zl, 31 & a10), b10.gn = S$(b10.gn, a10 >>> 5 | 0); + else if (32768 > a10) + $yb(b10.Zl, 31 & a10), b10.gn = S$(b10.gn, 31 & (a10 >>> 5 | 0)), b10.bp = S$(b10.bp, a10 >>> 10 | 0); + else if (1048576 > a10) + $yb(b10.Zl, 31 & a10), b10.gn = S$(b10.gn, 31 & (a10 >>> 5 | 0)), b10.bp = S$(b10.bp, 31 & (a10 >>> 10 | 0)), b10.Nq = S$(b10.Nq, a10 >>> 15 | 0); + else if (33554432 > a10) + $yb( + b10.Zl, + 31 & a10 + ), b10.gn = S$(b10.gn, 31 & (a10 >>> 5 | 0)), b10.bp = S$(b10.bp, 31 & (a10 >>> 10 | 0)), b10.Nq = S$(b10.Nq, 31 & (a10 >>> 15 | 0)), b10.ft = S$(b10.ft, a10 >>> 20 | 0); + else if (1073741824 > a10) + $yb(b10.Zl, 31 & a10), b10.gn = S$(b10.gn, 31 & (a10 >>> 5 | 0)), b10.bp = S$(b10.bp, 31 & (a10 >>> 10 | 0)), b10.Nq = S$(b10.Nq, 31 & (a10 >>> 15 | 0)), b10.ft = S$(b10.ft, 31 & (a10 >>> 20 | 0)), b10.sw = S$(b10.sw, a10 >>> 25 | 0); + else + throw new Zj().a(); + a10 = b10; + } else + a10 = iG().pJ; + return a10; + } + function Wyb(a10, b10) { + if (a10.wo !== a10.wl) { + var c10 = -32 & (-1 + a10.wl | 0), e10 = 31 & (-1 + a10.wl | 0); + if (a10.wl !== (32 + c10 | 0)) { + var f10 = new L6().Fi(-1 + a10.wl | 0, a10.wo, c10); + ck(f10, a10, a10.Yl); + f10.El = a10.El; + Ryb(f10, a10.Qq, c10, a10.Qq ^ c10); + f10.Zl.n[e10] = b10; + return f10; + } + var g10 = (1 << ca(5, a10.Yl)) - a10.wo | 0; + f10 = g10 & ~(-1 + (1 << ca(5, -1 + a10.Yl | 0)) | 0); + g10 = g10 >>> ca(5, -1 + a10.Yl | 0) | 0; + if (0 !== f10) { + if (1 < a10.Yl) { + c10 = c10 + f10 | 0; + var h10 = a10.Qq + f10 | 0; + f10 = new L6().Fi((-1 + a10.wl | 0) + f10 | 0, a10.wo + f10 | 0, c10); + ck(f10, a10, a10.Yl); + f10.El = a10.El; + Tyb(f10, 0, g10); + Uyb(f10, h10, c10, h10 ^ c10); + f10.Zl.n[e10] = b10; + return f10; + } + e10 = 32 + c10 | 0; + c10 = a10.Qq; + h10 = new L6().Fi((-1 + a10.wl | 0) + f10 | 0, a10.wo + f10 | 0, e10); + ck( + h10, + a10, + a10.Yl + ); + h10.El = a10.El; + Tyb(h10, 0, g10); + Ryb(h10, c10, e10, c10 ^ e10); + h10.Zl.n[-1 + f10 | 0] = b10; + return h10; + } + if (0 > c10) + return f10 = (1 << ca(5, 1 + a10.Yl | 0)) - (1 << ca(5, a10.Yl)) | 0, g10 = c10 + f10 | 0, c10 = a10.Qq + f10 | 0, f10 = new L6().Fi((-1 + a10.wl | 0) + f10 | 0, a10.wo + f10 | 0, g10), ck(f10, a10, a10.Yl), f10.El = a10.El, Uyb(f10, c10, g10, c10 ^ g10), f10.Zl.n[e10] = b10, f10; + f10 = a10.Qq; + g10 = new L6().Fi(-1 + a10.wl | 0, a10.wo, c10); + ck(g10, a10, a10.Yl); + g10.El = a10.El; + Uyb(g10, f10, c10, f10 ^ c10); + g10.Zl.n[e10] = b10; + return g10; + } + a10 = ja(Ja(Ha), [32]); + a10.n[31] = b10; + b10 = new L6().Fi(31, 32, 0); + b10.Yl = 1; + b10.Zl = a10; + return b10; + } + function R$(a10, b10) { + var c10 = ja(Ja(Ha), [a10.n.length]); + Ba(a10, 0, c10, 0, b10); + return c10; + } + function S$(a10, b10) { + var c10 = ja(Ja(Ha), [a10.n.length]); + Ba(a10, b10, c10, b10, c10.n.length - b10 | 0); + return c10; + } + d7.Gl = function(a10) { + this.Nq = a10; + }; + d7.$classData = r8({ xcb: 0 }, false, "scala.collection.immutable.Vector", { xcb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Sda: 1, VH: 1, $i: 1, oj: 1, mj: 1, bo: 1, nj: 1, Hpa: 1, q: 1, o: 1, Hi: 1 }); + function hK() { + this.br = null; + } + hK.prototype = new V9(); + hK.prototype.constructor = hK; + d7 = hK.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + a10 = 65535 & (this.br.charCodeAt(a10) | 0); + return gc(a10); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.P = function(a10) { + a10 = 65535 & (this.br.charCodeAt(a10 | 0) | 0); + return gc(a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.gG = function(a10) { + return 65535 & (this.br.charCodeAt(a10) | 0); + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.Di = function() { + return hG(); + }; + d7.t = function() { + return this.br; + }; + d7.tr = function(a10) { + var b10 = this.br; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.br.length | 0, a10, b10); + }; + d7.qs = function(a10, b10) { + return L9(this, this.br.length | 0, a10, b10); + }; + d7.gs = function(a10) { + var b10 = this.br; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.np = function(a10, b10) { + return azb(this, a10, b10); + }; + d7.st = function() { + return zvb(this); + }; + d7.Mj = function() { + return n9(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.br.length | 0); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.cm = function() { + return this.br; + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Oa = function() { + return this.br.length | 0; + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.hm = function() { + return this.br.length | 0; + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return azb(this, 0, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.Rk = function(a10) { + return azb(this, a10, this.br.length | 0); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return this; + }; + d7.ke = function() { + return this; + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.e = function(a10) { + this.br = a10; + return this; + }; + function azb(a10, b10, c10) { + b10 = 0 > b10 ? 0 : b10; + if (c10 <= b10 || b10 >= (a10.br.length | 0)) + return new hK().e(""); + c10 = c10 > (a10.br.length | 0) ? a10.br.length | 0 : c10; + Gb(); + return new hK().e((null !== a10 ? a10.br : null).substring(b10, c10)); + } + d7.Ol = function() { + return Iu(ua(), this.br); + }; + d7.Qd = function() { + Bya || (Bya = new gK().a()); + return Bya.Qd(); + }; + d7.$classData = r8({ Ccb: 0 }, false, "scala.collection.immutable.WrappedString", { Ccb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Sda: 1, VH: 1, $i: 1, oj: 1, mj: 1, bo: 1, nj: 1, Gpa: 1, Wk: 1, cM: 1, ym: 1 }); + function Vt() { + this.Nf = this.Wn = null; + } + Vt.prototype = new Lyb(); + Vt.prototype.constructor = Vt; + d7 = Vt.prototype; + d7.H = function() { + return "::"; + }; + d7.ga = function() { + return this.Wn; + }; + d7.E = function() { + return 2; + }; + d7.b = function() { + return false; + }; + d7.G = function(a10) { + switch (a10) { + case 0: + return this.Wn; + case 1: + return this.Nf; + default: + throw new U6().e("" + a10); + } + }; + d7.ta = function() { + return this.Nf; + }; + function ji(a10, b10) { + var c10 = new Vt(); + c10.Wn = a10; + c10.Nf = b10; + return c10; + } + d7.$classData = r8({ Yab: 0 }, false, "scala.collection.immutable.$colon$colon", { Yab: 1, sbb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Tda: 1, VH: 1, $i: 1, oj: 1, mj: 1, kW: 1, xda: 1, y: 1, yda: 1, q: 1, o: 1 }); + function bzb() { + } + bzb.prototype = new Lyb(); + bzb.prototype.constructor = bzb; + d7 = bzb.prototype; + d7.H = function() { + return "Nil"; + }; + d7.ga = function() { + this.Z0(); + }; + d7.a = function() { + return this; + }; + d7.E = function() { + return 0; + }; + d7.b = function() { + return true; + }; + function yyb() { + throw new Lu().e("tail of empty list"); + } + d7.h = function(a10) { + return a10 && a10.$classData && a10.$classData.ge.fg ? a10.b() : false; + }; + d7.G = function(a10) { + throw new U6().e("" + a10); + }; + d7.Z0 = function() { + throw new iL().e("head of empty list"); + }; + d7.ta = function() { + return yyb(); + }; + d7.$classData = r8({ Mbb: 0 }, false, "scala.collection.immutable.Nil$", { Mbb: 1, sbb: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, Tda: 1, VH: 1, $i: 1, oj: 1, mj: 1, kW: 1, xda: 1, y: 1, yda: 1, q: 1, o: 1 }); + var czb = void 0; + function H10() { + czb || (czb = new bzb().a()); + return czb; + } + function o$() { + this.xa = false; + this.l = null; + } + o$.prototype = new u7(); + o$.prototype.constructor = o$; + d7 = o$.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.CE = function(a10) { + return lxb(this, a10); + }; + d7.ga = function() { + return k$(this).$a(); + }; + d7.lb = function(a10) { + return j$(this, a10); + }; + d7.Oe = function(a10) { + return nub(this, a10); + }; + d7.im = function() { + return k$(this); + }; + d7.fm = function(a10) { + return M8(this, a10); + }; + d7.P = function(a10) { + return j$(this, a10 | 0); + }; + d7.ps = function(a10) { + return new m$().jl(this, a10); + }; + d7.Od = function(a10) { + var b10 = k$(this); + return eLa(b10, a10); + }; + d7.ua = function() { + var a10 = ii().u; + return qt(this, a10); + }; + d7.b = function() { + return !this.mb().Ya(); + }; + d7.mW = function() { + return Qx(this); + }; + d7.Kj = function() { + return this; + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.bd = function(a10) { + return new m$().jl(this, a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.ro = function(a10) { + return j$(this, a10) | 0; + }; + d7.gl = function(a10) { + return this.fy(a10); + }; + d7.Kg = function(a10) { + return Rj(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return Rj(this, a10, b10, c10); + }; + d7.lW = function() { + return this.l; + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + var b10 = k$(this); + return wT(b10, a10); + }; + d7.yg = function(a10) { + return Twb(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.t = function() { + return h9(this); + }; + d7.Di = function() { + return K7(); + }; + d7.U = function(a10) { + var b10 = k$(this); + yT(b10, a10); + }; + d7.ne = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.xM = function() { + return "" + this.l.xM() + this.Pl(); + }; + d7.qs = function(a10, b10) { + var c10 = k$(this); + return hya(c10, a10, b10); + }; + d7.qP = function(a10) { + return new n$().eH(this, a10); + }; + d7.wm = function(a10, b10) { + return oub(this, a10, b10); + }; + d7.Tr = function(a10) { + return Uwb(this, a10); + }; + d7.kc = function() { + return Jvb(this); + }; + d7.xl = function(a10) { + return this.gy(a10); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.pu = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.l = a10; + return this; + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return this.rn(a10); + }; + d7.st = function() { + return new o$().pu(this); + }; + d7.jb = function() { + return this.l.Oa(); + }; + d7.Mj = function() { + var a10 = b32().u; + return qt(this, a10); + }; + d7.fj = function() { + return $9(this); + }; + d7.Vr = function(a10) { + return Vwb(this, a10); + }; + d7.Ep = function(a10) { + return !!j$(this, a10); + }; + d7.mb = function() { + return k$(this); + }; + d7.Fb = function(a10) { + var b10 = k$(this); + return hLa(b10, a10); + }; + d7.Pm = function(a10) { + return sub(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.Pl = function() { + return "R"; + }; + d7.cm = function() { + return Rj(this, "", "", ""); + }; + d7.BL = function(a10) { + return new p$().eH(this, a10); + }; + d7.ia = function(a10) { + return tub(this, a10); + }; + d7.Oa = function() { + return this.l.Oa(); + }; + d7.og = function(a10) { + return uwb(this, a10); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.hm = function() { + return -1; + }; + d7.Dm = function(a10) { + return uub(this, a10); + }; + d7.gy = function(a10) { + return new q$().jl(this, a10); + }; + d7.Jk = function(a10) { + return Wwb(this, a10); + }; + d7.Dd = function() { + return k$(this).Dd(); + }; + d7.wy = function() { + return new W9().aL(this); + }; + d7.Rk = function(a10) { + return yub(this, a10); + }; + d7.BE = function(a10) { + return new r$().jl(this, a10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return j9(this); + }; + d7.op = function() { + return this; + }; + d7.rm = function(a10, b10, c10, e10) { + return Fda(this, a10, b10, c10, e10); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.ke = function() { + return this; + }; + d7.uK = function(a10) { + return this.rn(a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this; + }; + d7.Ql = function(a10, b10) { + return Tc(this, a10, b10); + }; + d7.Sw = function(a10) { + return mxb(this, a10); + }; + d7.DL = function(a10) { + return lxb(this, a10); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + Psb(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.am = function(a10) { + return vub(this, a10); + }; + d7.rn = function(a10) { + return new s$().jl(this, a10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = k$(this); b10.Ya(); ) { + var c10 = b10.$a(); + WA(a10, c10); + } + return a10.eb; + }; + d7.ka = function(a10) { + return new r$().jl(this, a10); + }; + d7.jM = function(a10, b10) { + return rub(this, a10, b10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.fy = function(a10) { + return new t$().jl(this, a10); + }; + d7.ec = function(a10) { + return wub(this, a10); + }; + d7.Qd = function() { + return xub(this); + }; + d7.CL = function(a10) { + return mxb(this, a10); + }; + d7.Xk = function() { + return "StreamView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.rF = function(a10) { + return nxb(this, a10); + }; + d7.$classData = r8({ jcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$12", { jcb: 1, f: 1, nib: 1, fpa: 1, Km: 1, ol: 1, pl: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Jm: 1, Lm: 1, dC: 1, zA: 1, AA: 1 }); + function dzb() { + } + dzb.prototype = new Rwb(); + dzb.prototype.constructor = dzb; + function ezb() { + } + d7 = ezb.prototype = dzb.prototype; + d7.Hd = function() { + return this; + }; + d7.Ue = function(a10, b10) { + var c10 = this.Ja(a10); + this.jm(a10, b10); + return c10; + }; + d7.Kj = function() { + return this; + }; + d7.rt = function(a10) { + var b10 = this.Ja(a10); + this.KA(a10); + return b10; + }; + d7.Di = function() { + return Toa(); + }; + d7.jm = function(a10, b10) { + this.Xh(new R6().M(a10, b10)); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.T0 = function(a10, b10) { + var c10 = this.Ja(a10); + if (c10 instanceof z7) + a10 = c10.i; + else if (y7() === c10) + b10 = Hb(b10), this.jm(a10, b10), a10 = b10; + else + throw new x7().d(c10); + return a10; + }; + d7.ke = function() { + return Cwb(this); + }; + d7.pj = function() { + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.Qd = function() { + return this.ls(); + }; + function fzb() { + this.ea = this.PM = this.MI = this.WC = this.qx = this.Bx = this.Xt = this.WM = this.dz = this.bz = this.CJ = this.Lt = this.Kt = this.Wt = this.Vt = this.TI = this.rJ = this.LI = this.LJ = this.JJ = this.bu = this.Nt = this.Hy = this.AJ = this.$M = this.IJ = this.sJ = this.PI = this.yJ = this.RI = this.MJ = this.tJ = this.gz = this.Fy = this.UI = this.aJ = this.OI = this.Gq = this.JZ = this.NZ = this.NX = this.MX = this.n_ = this.aY = this.nZ = this.LX = this.GX = this.xZ = this.AX = null; + } + fzb.prototype = new u7(); + fzb.prototype.constructor = fzb; + function Wqb() { + var a10 = i32(); + if (null === i32().NX && null === i32().NX) { + var b10 = i32(), c10 = new d0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.NX = c10; + } + return i32().NX; + } + d7 = fzb.prototype; + d7.a = function() { + gzb = this; + this.ea = nv().ea; + return this; + }; + d7.cS = function() { + null === i32().Vt && this.qJ(); + i32(); + }; + d7.BJ = function() { + null === i32().Wt && (i32().Wt = new Z_().Br(this)); + }; + d7.cb = function() { + null === i32().Xt && this.fS(); + return i32().Xt; + }; + d7.tR = function() { + null === i32().qx && (i32().qx = new xL()); + }; + d7.l5 = function() { + null === i32().Fy && (i32().Fy = new L_().ep(this)); + }; + d7.QM = function() { + null === i32().Fy && this.l5(); + return i32().Fy; + }; + d7.Lf = function() { + null === i32().Gq && this.FJ(); + return i32().Gq; + }; + d7.z5 = function() { + null === i32().WC && (i32().WC = new zL()); + }; + function Xqb() { + var a10 = i32(); + if (null === i32().MX && null === i32().MX) { + var b10 = i32(), c10 = new c0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.MX = c10; + } + return i32().MX; + } + d7.FJ = function() { + null === i32().Gq && (i32().Gq = new Q_().ep(this)); + }; + d7.NI = function() { + null === i32().Kt && (i32().Kt = new W_().Br(this)); + }; + d7.qJ = function() { + null === i32().Vt && (i32().Vt = new Y_().Br(this)); + }; + d7.Pt = function() { + null === i32().Bx && this.FR(); + i32(); + }; + d7.fS = function() { + null === i32().Xt && (i32().Xt = new DL()); + }; + function g$a2() { + var a10 = i32(); + if (null === i32().n_ && null === i32().n_) { + var b10 = i32(), c10 = new F1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.n_ = c10; + } + return i32().n_; + } + function F52() { + var a10 = i32(); + if (null === i32().aY && null === i32().aY) { + var b10 = i32(), c10 = new l0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.aY = c10; + } + return i32().aY; + } + d7.yi = function() { + null === i32().qx && this.tR(); + i32(); + }; + function Vqb() { + var a10 = i32(); + if (null === i32().NZ && null === i32().NZ) { + var b10 = i32(), c10 = new R0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.NZ = c10; + } + return i32().NZ; + } + d7.XC = function() { + null === i32().WC && this.z5(); + i32(); + }; + function Zqb() { + var a10 = i32(); + if (null === i32().JZ && null === i32().JZ) { + var b10 = i32(), c10 = new P0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.JZ = c10; + } + return i32().JZ; + } + d7.qR = function() { + null === i32().Kt && this.NI(); + i32(); + }; + function Uqb() { + var a10 = i32(); + if (null === i32().LX && null === i32().LX) { + var b10 = i32(), c10 = new b0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.LX = c10; + } + return i32().LX; + } + d7.eS = function() { + null === i32().Wt && this.BJ(); + i32(); + }; + d7.FR = function() { + null === i32().Bx && (i32().Bx = new BL()); + }; + d7.$classData = r8({ Cta: 0 }, false, "amf.client.convert.VocabulariesClientConverter$", { Cta: 1, f: 1, ygb: 1, C6: 1, ib: 1, A6: 1, J6: 1, I6: 1, D6: 1, P6: 1, M6: 1, Q6: 1, E6: 1, H6: 1, F6: 1, U6: 1, S6: 1, G6: 1, y6: 1, O6: 1, K6: 1, R6: 1, T6: 1, L6: 1, z6: 1, N6: 1, fgb: 1, ggb: 1, xfb: 1, Afb: 1, zfb: 1, zgb: 1, Gfb: 1, Ufb: 1, yfb: 1, wfb: 1, Xfb: 1, rfb: 1, xgb: 1, B6: 1 }); + var gzb = void 0; + function i32() { + gzb || (gzb = new fzb().a()); + return gzb; + } + function hzb() { + } + hzb.prototype = new xwb(); + hzb.prototype.constructor = hzb; + function izb() { + } + d7 = izb.prototype = hzb.prototype; + d7.Hd = function() { + return this; + }; + d7.Kj = function() { + return this; + }; + d7.b = function() { + return 0 === this.jb(); + }; + d7.h = function(a10) { + return r7a(this, a10); + }; + d7.ro = function(a10) { + return this.Ha(a10) | 0; + }; + d7.t = function() { + return C6(this); + }; + d7.qea = function(a10) { + var b10 = this.mb(); + return wT(b10, a10); + }; + d7.Mj = function() { + return Hvb(this); + }; + d7.Ep = function(a10) { + return this.Ha(a10); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.ke = function() { + return GN(this); + }; + d7.z = function() { + var a10 = MJ(); + return aya(a10, this, a10.Zda); + }; + d7.pj = function() { + }; + d7.ka = function(a10, b10) { + return Jd(this, a10, b10); + }; + d7.z1 = function(a10) { + return D6(this, a10, false); + }; + d7.Qd = function() { + return this.lv(); + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.Xk = function() { + return "Set"; + }; + function jzb() { + u$.call(this); + this.tqa = this.Qna = null; + this.Cg = false; + this.Sb = null; + } + jzb.prototype = new Q$(); + jzb.prototype.constructor = jzb; + d7 = jzb.prototype; + d7.lb = function(a10) { + return pxb(this, a10); + }; + d7.P = function(a10) { + return pxb(this, a10 | 0); + }; + function nxb(a10, b10) { + var c10 = new jzb(); + if (null === a10) + throw mb(E6(), null); + c10.Sb = a10; + c10.Qna = b10; + P$.prototype.pu.call(c10, a10); + return c10; + } + d7.$1 = function() { + return this.Qna; + }; + d7.mb = function() { + return Bwb(this); + }; + d7.Pl = function() { + return "Z"; + }; + d7.Oa = function() { + return oxb(this); + }; + d7.spa = function() { + return this.Sb; + }; + d7.o3 = function() { + this.Cg || this.Cg || (this.tqa = this.$1().Kj().ke(), this.Cg = true); + return this.tqa; + }; + d7.K2 = function() { + return this.Sb; + }; + d7.$classData = r8({ icb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$10", { icb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, qib: 1, Eab: 1, T$a: 1 }); + function kzb() { + u$.call(this); + this.Sb = this.uO = null; + } + kzb.prototype = new Q$(); + kzb.prototype.constructor = kzb; + d7 = kzb.prototype; + d7.lb = function(a10) { + return this.uO.lb(a10); + }; + d7.P = function(a10) { + return this.uO.lb(a10 | 0); + }; + d7.U = function(a10) { + this.uO.U(a10); + }; + d7.mb = function() { + return this.uO.mb(); + }; + d7.Pl = function() { + return "C"; + }; + d7.Oa = function() { + return this.uO.Oa(); + }; + function mxb(a10, b10) { + var c10 = new kzb(); + if (null === a10) + throw mb(E6(), null); + c10.Sb = a10; + c10.uO = Hb(b10); + P$.prototype.pu.call(c10, a10); + return c10; + } + d7.$classData = r8({ hcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$1", { hcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, kib: 1, Bab: 1, Q$a: 1, Pab: 1 }); + function p$() { + u$.call(this); + this.Koa = this.oda = null; + this.Cg = false; + this.Sb = null; + } + p$.prototype = new Q$(); + p$.prototype.constructor = p$; + d7 = p$.prototype; + d7.lb = function(a10) { + return yxb(this, a10); + }; + d7.P = function(a10) { + return yxb(this, a10 | 0); + }; + d7.eH = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.oda = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.U = function(a10) { + this.Hda().U(a10); + this.z2().U(a10); + }; + d7.Hda = function() { + return this.Sb; + }; + d7.z2 = function() { + return this.oda; + }; + d7.mb = function() { + return Ewb(this); + }; + d7.Pl = function() { + return "A"; + }; + d7.Oa = function() { + return this.OP().Oa() + this.y2().Oa() | 0; + }; + d7.OP = function() { + return this.Sb; + }; + d7.opa = function() { + return this.Sb; + }; + d7.y2 = function() { + this.Cg || this.Cg || (this.Koa = this.oda.Vh(), this.Cg = true); + return this.Koa; + }; + d7.$classData = r8({ kcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$2", { kcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, gib: 1, zab: 1, O$a: 1, Nab: 1 }); + function n$() { + u$.call(this); + this.Pka = this.D$ = null; + this.Cg = false; + this.Sb = null; + } + n$.prototype = new Q$(); + n$.prototype.constructor = n$; + d7 = n$.prototype; + d7.lb = function(a10) { + return Jxb(this, a10); + }; + d7.P = function(a10) { + return Jxb(this, a10 | 0); + }; + d7.I2 = function() { + return this.Sb; + }; + d7.yO = function() { + this.Cg || this.Cg || (this.Pka = this.D$.Vh(), this.Cg = true); + return this.Pka; + }; + d7.eH = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.D$ = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.U = function(a10) { + this.Q0().U(a10); + this.Kda().U(a10); + }; + d7.Q0 = function() { + return this.D$; + }; + d7.mb = function() { + return Jwb(this); + }; + d7.Pl = function() { + return "A"; + }; + d7.Oa = function() { + return this.yO().Oa() + this.I2().Oa() | 0; + }; + d7.Kda = function() { + return this.Sb; + }; + d7.rpa = function() { + return this.Sb; + }; + d7.$classData = r8({ lcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$3", { lcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, mib: 1, Dab: 1, S$a: 1, Rab: 1 }); + function r$() { + u$.call(this); + this.Sb = this.cV = null; + } + r$.prototype = new Q$(); + r$.prototype.constructor = r$; + d7 = r$.prototype; + d7.lb = function(a10) { + return Ixb(this, a10); + }; + d7.P = function(a10) { + return Ixb(this, a10 | 0); + }; + d7.U = function(a10) { + jwb(this, a10); + }; + d7.NB = function() { + return this.cV; + }; + d7.tpa = function() { + return this.Sb; + }; + d7.jl = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.cV = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.mb = function() { + return Iwb(this); + }; + d7.Pl = function() { + return "M"; + }; + d7.Oa = function() { + return this.Sb.Oa(); + }; + d7.qpa = function() { + return this.Sb; + }; + d7.wpa = function() { + return this.Sb; + }; + d7.$classData = r8({ mcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$4", { mcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, lib: 1, Cab: 1, R$a: 1, Qab: 1 }); + function m$() { + u$.call(this); + this.Dw = this.cV = null; + this.Cg = false; + this.Sb = null; + } + m$.prototype = new Q$(); + m$.prototype.constructor = m$; + d7 = m$.prototype; + d7.lb = function(a10) { + return Dxb(this, a10); + }; + d7.P = function(a10) { + return Dxb(this, a10 | 0); + }; + d7.dM = function() { + return this.Sb; + }; + d7.VT = function() { + this.Cg || (this.Dw = Hxb(this), this.Cg = true); + return this.Dw; + }; + d7.U = function(a10) { + iwb(this, a10); + }; + d7.NB = function() { + return this.cV; + }; + d7.jl = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.cV = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.mb = function() { + return Hwb(this); + }; + d7.Pl = function() { + return "N"; + }; + d7.Oa = function() { + return Exb(this); + }; + d7.ppa = function() { + return this.Sb; + }; + d7.vpa = function() { + return this.Sb; + }; + d7.Rx = function() { + return this.Cg ? this.Dw : this.VT(); + }; + d7.$classData = r8({ ncb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$5", { ncb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, jib: 1, Aab: 1, P$a: 1, Oab: 1 }); + function s$() { + u$.call(this); + this.Dw = this.Mp = null; + this.Cg = false; + this.Sb = null; + } + s$.prototype = new Q$(); + s$.prototype.constructor = s$; + d7 = s$.prototype; + d7.lb = function(a10) { + return Bxb(this, a10); + }; + d7.P = function(a10) { + return Bxb(this, a10 | 0); + }; + d7.Eda = function() { + return this.Sb; + }; + d7.VT = function() { + this.Cg || (this.Dw = Cxb(this), this.Cg = true); + return this.Dw; + }; + d7.U = function(a10) { + hwb(this, a10); + }; + d7.jl = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.mb = function() { + return Gwb(this); + }; + d7.Pl = function() { + return "F"; + }; + d7.Oa = function() { + return this.Rx().n.length; + }; + d7.Rx = function() { + return this.Cg ? this.Dw : this.VT(); + }; + d7.Du = function() { + return this.Mp; + }; + d7.PP = function() { + return this.Sb; + }; + d7.Jda = function() { + return this.Sb; + }; + d7.$classData = r8({ ocb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$6", { ocb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, iib: 1, epa: 1, Zoa: 1, jpa: 1 }); + function lzb() { + u$.call(this); + this.Sb = this.kO = null; + } + lzb.prototype = new Q$(); + lzb.prototype.constructor = lzb; + d7 = lzb.prototype; + d7.lb = function(a10) { + return Kxb(this, a10); + }; + d7.P = function(a10) { + return Kxb(this, a10 | 0); + }; + d7.J2 = function() { + return this.Sb; + }; + d7.U = function(a10) { + var b10 = B$(this); + yT(b10, a10); + }; + d7.mb = function() { + return B$(this); + }; + d7.Pl = function() { + return "S"; + }; + d7.Oa = function() { + var a10 = B$(this); + return VJ(a10); + }; + function lxb(a10, b10) { + var c10 = new lzb(); + if (null === a10) + throw mb(E6(), null); + c10.Sb = a10; + c10.kO = b10; + P$.prototype.pu.call(c10, a10); + return c10; + } + d7.nK = function() { + return this.kO; + }; + d7.$classData = r8({ pcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$7", { pcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, oib: 1, gpa: 1, $oa: 1, kpa: 1 }); + function t$() { + u$.call(this); + this.Mp = null; + this.nM = 0; + this.Cg = false; + this.Sb = null; + } + t$.prototype = new Q$(); + t$.prototype.constructor = t$; + d7 = t$.prototype; + d7.lb = function(a10) { + return zxb(this, a10); + }; + d7.P = function(a10) { + return zxb(this, a10 | 0); + }; + d7.H2 = function() { + return this.Sb; + }; + d7.U = function(a10) { + gwb(this, a10); + }; + d7.Dda = function() { + return this.Sb; + }; + d7.jl = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.mb = function() { + return Fwb(this); + }; + d7.Pl = function() { + return "D"; + }; + d7.Oa = function() { + return Axb(this); + }; + d7.Ida = function() { + return this.Sb; + }; + d7.Ms = function() { + return this.Cg ? this.nM : this.lea(); + }; + d7.Du = function() { + return this.Mp; + }; + d7.lea = function() { + this.Cg || (this.nM = rub(this.Sb, this.Mp, 0), this.Cg = true); + return this.nM; + }; + d7.$classData = r8({ qcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$8", { qcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, hib: 1, dpa: 1, Yoa: 1, ipa: 1 }); + function q$() { + u$.call(this); + this.Mp = null; + this.lL = 0; + this.Cg = false; + this.Sb = null; + } + q$.prototype = new Q$(); + q$.prototype.constructor = q$; + d7 = q$.prototype; + d7.lb = function(a10) { + return Lxb(this, a10); + }; + d7.P = function(a10) { + return Lxb(this, a10 | 0); + }; + d7.Fda = function() { + return this.Sb; + }; + d7.gP = function() { + return this.Cg ? this.lL : this.kba(); + }; + d7.U = function(a10) { + kwb(this, a10); + }; + d7.Lda = function() { + return this.Sb; + }; + d7.jl = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + P$.prototype.pu.call(this, a10); + return this; + }; + d7.mb = function() { + return Kwb(this); + }; + d7.Pl = function() { + return "T"; + }; + d7.Oa = function() { + return this.gP(); + }; + d7.Gda = function() { + return this.Sb; + }; + d7.kba = function() { + this.Cg || (this.lL = rub(this.Sb, this.Mp, 0), this.Cg = true); + return this.lL; + }; + d7.Du = function() { + return this.Mp; + }; + d7.$classData = r8({ rcb: 0 }, false, "scala.collection.immutable.StreamViewLike$$anon$9", { rcb: 1, XE: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, dC: 1, zA: 1, AA: 1, pib: 1, hpa: 1, apa: 1, lpa: 1 }); + function T$() { + } + T$.prototype = new Wxb(); + T$.prototype.constructor = T$; + function mzb() { + } + mzb.prototype = T$.prototype; + T$.prototype.yja = function() { + return ywb(this); + }; + T$.prototype.V4 = function(a10) { + return zwb(this, a10); + }; + T$.prototype.jh = function(a10) { + return yi(this, a10); + }; + function Pr() { + this.yf = null; + this.mM = 0; + } + Pr.prototype = new ezb(); + Pr.prototype.constructor = Pr; + d7 = Pr.prototype; + d7.a = function() { + this.yf = H10(); + this.mM = 0; + return this; + }; + d7.KA = function(a10) { + return nzb(this, a10); + }; + d7.al = function(a10) { + var b10 = new Pr().a(); + return yi(b10, this).KA(a10); + }; + d7.ng = function() { + return this; + }; + d7.Kk = function(a10) { + return Or(this, a10); + }; + d7.wp = function(a10) { + var b10 = new Pr().a(); + return yi(b10, this).KA(a10); + }; + d7.ls = function() { + return new Pr().a(); + }; + function Or(a10, b10) { + a10.yf = ozb(a10, b10.ma(), a10.yf); + a10.yf = ji(b10, a10.yf); + a10.mM = 1 + a10.mM | 0; + return a10; + } + d7.jb = function() { + return this.mM; + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + return uc(this.yf); + }; + function ozb(a10, b10, c10) { + var e10 = H10(); + for (; ; ) { + if (c10.b()) + return e10; + if (Va(Wa(), c10.ga().ma(), b10)) + return a10.mM = -1 + a10.mM | 0, a10 = e10, I8a(c10.ta(), a10); + var f10 = c10.ta(); + c10 = c10.ga(); + e10 = ji(c10, e10); + c10 = f10; + } + } + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.Ja = function(a10) { + a: { + for (var b10 = this.yf; !b10.b(); ) { + var c10 = b10.ga(); + if (Va(Wa(), c10.ma(), a10)) { + a10 = new z7().d(b10.ga()); + break a; + } + b10 = b10.ta(); + } + a10 = y7(); + } + if (a10.b()) + return y7(); + a10 = a10.c(); + return new z7().d(a10.ya()); + }; + d7.Xh = function(a10) { + return Or(this, a10); + }; + d7.jd = function(a10) { + return Or(this, a10); + }; + d7.Vh = function() { + return Cwb(this); + }; + d7.tF = function(a10) { + return nzb(this, a10); + }; + d7.SS = function() { + this.yf = H10(); + this.mM = 0; + }; + function nzb(a10, b10) { + a10.yf = ozb(a10, b10, a10.yf); + return a10; + } + d7.Ru = function(a10) { + var b10 = new Pr().a(); + return yi(b10, this).Xh(a10); + }; + d7.$classData = r8({ Xdb: 0 }, false, "scala.collection.mutable.ListMap", { Xdb: 1, N2: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, T2: 1, Nm: 1, Om: 1, Im: 1, U2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, q: 1, o: 1 }); + function pzb(a10, b10, c10) { + bK(); + var e10 = a10.Oa(); + b10 = aK(0, b10, c10 < e10 ? c10 : e10); + return U$(a10, b10); + } + function qzb(a10, b10) { + return new R6().M(new V$().Bo(a10, b10), new W$().Bo(a10, b10)); + } + function rzb(a10, b10) { + return new R6().M(szb(a10, b10), tzb(a10, b10)); + } + function uzb(a10) { + if (XG(a10)) + return a10.xpa(); + var b10 = a10.Oa(); + return pzb(a10, 1, b10); + } + function tzb(a10, b10) { + b10 = aK(bK(), b10, a10.Oa()); + return U$(a10, b10); + } + function szb(a10, b10) { + bK(); + var c10 = a10.Oa(); + b10 = aK(0, 0, b10 < c10 ? b10 : c10); + return U$(a10, b10); + } + function fra() { + } + fra.prototype = new Wxb(); + fra.prototype.constructor = fra; + function X$() { + } + d7 = X$.prototype = fra.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return zj(this); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.b = function() { + return XG(this); + }; + d7.ua = function() { + return Wv(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.Di = function() { + return pmb(); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + var c10 = this.Oa(); + return M9(this, c10, a10, b10); + }; + d7.qs = function(a10, b10) { + var c10 = this.Oa(); + return L9(this, c10, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.np = function(a10, b10) { + return H9(this, a10, b10); + }; + d7.st = function() { + return zvb(this); + }; + d7.Mj = function() { + return n9(this); + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.Oa()); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Nr = function() { + return E62(this); + }; + d7.hm = function() { + return this.Oa(); + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return H9(this, 0, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.wy = function() { + return vzb(this); + }; + d7.Rk = function(a10) { + var b10 = this.Oa(); + return H9(this, a10, b10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return bi(this); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ol = function(a10) { + var b10 = a10.Lo(); + return Ou(la(this.L)) === b10 ? this.L : YJ(this, a10); + }; + d7.Qd = function() { + return new K9a().XO(this.rB()); + }; + d7.Xk = function() { + return "WrappedArray"; + }; + function O62() { + this.$x = this.it = null; + this.Cy = 0; + this.ze = null; + this.CA = this.yn = 0; + this.mp = null; + this.fC = 0; + } + O62.prototype = new ezb(); + O62.prototype.constructor = O62; + d7 = O62.prototype; + d7.Ue = function(a10, b10) { + a10 = Zv(this, a10, b10); + if (null === a10) + return y7(); + var c10 = a10.r; + a10.r = b10; + return new z7().d(c10); + }; + d7.a = function() { + $ya(this); + this.$x = this.it = null; + return this; + }; + d7.KA = function(a10) { + this.rt(a10); + return this; + }; + d7.Yda = function(a10) { + this.fC = a10; + }; + d7.al = function(a10) { + var b10 = new O62().a(); + return yi(b10, this).KA(a10); + }; + d7.ng = function() { + return this; + }; + d7.rt = function(a10) { + a10 = bza(this, a10); + if (null === a10) + return y7(); + null === a10.ks ? this.it = a10.Eo : a10.ks.Eo = a10.Eo; + null === a10.Eo ? this.$x = a10.ks : a10.Eo.ks = a10.ks; + a10.ks = null; + a10.Eo = null; + return new z7().d(a10.r); + }; + d7.Kk = function(a10) { + return wzb(this, a10); + }; + d7.U = function(a10) { + for (var b10 = this.it; null !== b10; ) + a10.P(new R6().M(b10.la, b10.r)), b10 = b10.Eo; + }; + d7.Er = function() { + return new r52().cL(this); + }; + d7.wp = function(a10) { + var b10 = new O62().a(); + return yi(b10, this).KA(a10); + }; + d7.ls = function() { + return new O62().a(); + }; + d7.jb = function() { + return this.yn; + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + return new J9a().cL(this); + }; + d7.Ye = function() { + return new s52().cL(this); + }; + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.F9 = function(a10, b10) { + a10 = new OZa().M(a10, b10); + null === this.it ? this.it = a10 : (this.$x.Eo = a10, a10.ks = this.$x); + return this.$x = a10; + }; + d7.Ja = function(a10) { + a10 = eza(this, a10); + return null === a10 ? y7() : new z7().d(a10.r); + }; + d7.Xh = function(a10) { + return wzb(this, a10); + }; + d7.$2 = function(a10) { + this.mp = a10; + }; + d7.j3 = function(a10) { + this.ze = a10; + }; + d7.IU = function() { + return 16; + }; + d7.KB = function() { + return new i$().cL(this); + }; + d7.jd = function(a10) { + return wzb(this, a10); + }; + d7.Vh = function() { + return Cwb(this); + }; + d7.tF = function(a10) { + this.rt(a10); + return this; + }; + d7.SS = function() { + Xya(this); + this.$x = this.it = null; + }; + function wzb(a10, b10) { + a10.Ue(b10.ma(), b10.ya()); + return a10; + } + d7.d5 = function(a10) { + this.Cy = a10; + }; + d7.p3 = function(a10) { + this.CA = a10; + }; + d7.Ru = function(a10) { + var b10 = new O62().a(); + return yi(b10, this).Xh(a10); + }; + d7.qM = function(a10) { + this.yn = a10; + }; + d7.$classData = r8({ Kdb: 0 }, false, "scala.collection.mutable.LinkedHashMap", { Kdb: 1, N2: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, T2: 1, Nm: 1, Om: 1, Im: 1, U2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, P2: 1, Q2: 1, q: 1, o: 1 }); + function wu() { + this.Cy = 0; + this.ze = null; + this.CA = this.yn = 0; + this.mp = null; + this.fC = 0; + } + wu.prototype = new ezb(); + wu.prototype.constructor = wu; + function xzb() { + } + d7 = xzb.prototype = wu.prototype; + d7.Hd = function() { + return this; + }; + d7.Ue = function(a10, b10) { + a10 = Zv(this, a10, b10); + if (null === a10) + return y7(); + var c10 = a10.r; + a10.r = b10; + return new z7().d(c10); + }; + d7.a = function() { + wu.prototype.Naa.call(this); + return this; + }; + d7.KA = function(a10) { + bza(this, a10); + return this; + }; + d7.Yda = function(a10) { + this.fC = a10; + }; + d7.P = function(a10) { + var b10 = eza(this, a10); + return null === b10 ? this.f5(a10) : b10.r; + }; + d7.al = function(a10) { + var b10 = new wu().a(); + return yi(b10, this).KA(a10); + }; + d7.ng = function() { + return this; + }; + d7.rt = function(a10) { + a10 = bza(this, a10); + return null !== a10 ? new z7().d(a10.r) : y7(); + }; + function Mt(a10, b10) { + var c10 = b10.ma(), e10 = b10.ya(); + c10 = Zv(a10, c10, e10); + null !== c10 && (c10.r = b10.ya()); + return a10; + } + d7.Kk = function(a10) { + return Mt(this, a10); + }; + d7.U = function(a10) { + for (var b10 = this.ze, c10 = pD(this), e10 = b10.n[c10]; null !== e10; ) { + var f10 = e10.$a(); + a10.P(new R6().M(e10.la, e10.r)); + for (e10 = f10; null === e10 && 0 < c10; ) + c10 = -1 + c10 | 0, e10 = b10.n[c10]; + } + }; + function yzb(a10, b10, c10) { + for (a10 = a10.ze.n[c10]; zzb(b10, a10); ) + a10 = a10.hy; + return a10; + } + d7.Er = function() { + return new n52().Yn(this); + }; + d7.wp = function(a10) { + var b10 = new wu().a(); + return yi(b10, this).KA(a10); + }; + d7.ls = function() { + return new wu().a(); + }; + d7.jm = function(a10, b10) { + this.Ue(a10, b10); + }; + d7.jb = function() { + return this.yn; + }; + d7.Rc = function() { + return this; + }; + d7.Ur = function() { + return new wq().Yn(this); + }; + d7.mb = function() { + return new YB().ou(E9a(this), w6(/* @__PURE__ */ function() { + return function(a10) { + return new R6().M(a10.la, a10.r); + }; + }(this))); + }; + d7.Ye = function() { + return new o52().Yn(this); + }; + d7.Naa = function() { + $ya(this); + }; + function zzb(a10, b10) { + return null !== b10 ? (b10 = b10.la, !Va(Wa(), b10, a10)) : false; + } + d7.Si = function(a10) { + return R9(this, a10); + }; + d7.T0 = function(a10, b10) { + var c10 = NJ(OJ(), a10), e10 = wK(this, c10), f10 = yzb(this, a10, e10); + if (null !== f10) + return f10.r; + f10 = this.ze; + b10 = Hb(b10); + e10 = f10 === this.ze ? e10 : wK(this, c10); + c10 = new MZa().M(a10, b10); + a10 = yzb(this, a10, e10); + null === a10 ? this.yn >= this.CA ? (a10 = c10.uu(), a10 = NJ(OJ(), a10), a10 = wK(this, a10), dza(this, c10, a10)) : (c10.hy = this.ze.n[e10], this.ze.n[e10] = c10, this.yn = 1 + this.yn | 0, fza(this, e10)) : a10.r = b10; + return b10; + }; + d7.F9 = function(a10, b10) { + return new MZa().M(a10, b10); + }; + d7.Ja = function(a10) { + a10 = eza(this, a10); + return null === a10 ? y7() : new z7().d(a10.r); + }; + d7.Xh = function(a10) { + return Mt(this, a10); + }; + d7.$2 = function(a10) { + this.mp = a10; + }; + d7.Ha = function(a10) { + return null !== eza(this, a10); + }; + d7.j3 = function(a10) { + this.ze = a10; + }; + d7.IU = function() { + return 16; + }; + d7.KB = function() { + return new ru().Yn(this); + }; + d7.jd = function(a10) { + return Mt(this, a10); + }; + d7.Vh = function() { + return Cwb(this); + }; + d7.tF = function(a10) { + bza(this, a10); + return this; + }; + d7.SS = function() { + Xya(this); + }; + d7.d5 = function(a10) { + this.Cy = a10; + }; + d7.p3 = function(a10) { + this.CA = a10; + }; + d7.Ru = function(a10) { + var b10 = new wu().a(); + return yi(b10, this).Xh(a10); + }; + d7.qM = function(a10) { + this.yn = a10; + }; + d7.$classData = r8({ Uda: 0 }, false, "scala.collection.mutable.HashMap", { Uda: 1, N2: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, T2: 1, Nm: 1, Om: 1, Im: 1, U2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, P2: 1, Q2: 1, Hi: 1, q: 1, o: 1 }); + function Azb() { + this.xa = false; + this.l = null; + } + Azb.prototype = new u7(); + Azb.prototype.constructor = Azb; + d7 = Azb.prototype; + d7.Hd = function() { + return this; + }; + d7.so = function(a10, b10) { + ZG(this, a10, b10); + }; + d7.CE = function(a10) { + return U$(this, a10); + }; + d7.ga = function() { + return zj(this); + }; + d7.lb = function(a10) { + return this.l.lb(a10); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.im = function() { + return this.mb(); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.ps = function(a10) { + return new e$().Ao(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.mW = function() { + return bi(this); + }; + d7.Kj = function() { + return this; + }; + d7.vA = function(a10) { + return WI(this, a10); + }; + d7.ng = function() { + return this; + }; + d7.bd = function(a10) { + return new e$().Ao(this, a10); + }; + d7.h = function(a10) { + return R42(this, a10); + }; + d7.Mr = function() { + return B62(this); + }; + d7.ro = function(a10) { + return this.lb(a10) | 0; + }; + d7.gl = function(a10) { + return new W$().Bo(this, a10); + }; + d7.Kg = function(a10) { + return Rj(this, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return Rj(this, a10, b10, c10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.yg = function(a10) { + return Twb(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.t = function() { + return h9(this); + }; + d7.Di = function() { + return pmb(); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + var c10 = this.Oa(); + return M9(this, c10, a10, b10); + }; + d7.xM = function() { + return ""; + }; + d7.qs = function(a10, b10) { + var c10 = this.Oa(); + return L9(this, c10, a10, b10); + }; + d7.qP = function(a10) { + return new f$().cH(this, a10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.Tr = function(a10) { + return Uwb(this, a10); + }; + d7.kc = function() { + return Wt(this); + }; + d7.xl = function(a10) { + return new V$().Bo(this, a10); + }; + d7.np = function(a10, b10) { + return pzb(this, a10, b10); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Qo = function() { + iG(); + var a10 = rw().sc; + return qt(this, a10); + }; + d7.Cb = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.st = function() { + return new Z$().IB(this); + }; + d7.jb = function() { + return this.Oa(); + }; + d7.Mj = function() { + return n9(this); + }; + d7.xpa = function() { + return j9(this); + }; + d7.fj = function() { + return $9(this); + }; + d7.Vr = function(a10) { + return Vwb(this, a10); + }; + d7.Ep = function(a10) { + return !!this.lb(a10); + }; + d7.mb = function() { + return this.l.mb(); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return qzb(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + function vzb(a10) { + var b10 = new Azb(); + if (null === a10) + throw mb(E6(), null); + b10.l = a10; + return b10; + } + d7.cm = function() { + return Rj(this, "", "", ""); + }; + d7.BL = function(a10) { + return new g$().cH(this, a10); + }; + d7.ia = function(a10) { + return tub(this, a10); + }; + d7.og = function(a10) { + return uwb(this, a10); + }; + d7.Oa = function() { + return this.l.Oa(); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Nr = function() { + return E62(this); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.hm = function() { + return this.Oa(); + }; + d7.Dm = function(a10) { + return uub(this, a10); + }; + d7.Sr = function(a10) { + return rzb(this, a10); + }; + d7.gy = function(a10) { + return new V$().Bo(this, a10); + }; + d7.Jk = function(a10) { + return szb(this, a10); + }; + d7.Dd = function() { + return this.mb().Dd(); + }; + d7.wy = function() { + return vzb(this); + }; + d7.hA = function() { + return Oc(this); + }; + d7.Rk = function(a10) { + return tzb(this, a10); + }; + d7.BE = function(a10) { + return new h$().Ao(this, a10); + }; + d7.Ha = function(a10) { + return mu(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return uzb(this); + }; + d7.rm = function(a10, b10, c10, e10) { + return Fda(this, a10, b10, c10, e10); + }; + d7.op = function() { + return this; + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.ke = function() { + return this; + }; + d7.uK = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.xg = function() { + var a10 = qe2(); + a10 = re4(a10); + return qt(this, a10); + }; + d7.Zi = function() { + return this; + }; + d7.Ql = function(a10, b10) { + var c10 = this.Oa(); + return M9(this, c10, a10, b10); + }; + d7.Sw = function(a10) { + return fxb(this, a10); + }; + d7.DL = function(a10) { + return U$(this, a10); + }; + d7.Wa = function(a10, b10) { + return YI(this, a10, b10); + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Do = function() { + return true; + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.am = function(a10) { + return vub(this, a10); + }; + d7.rn = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ch = function() { + for (var a10 = UA(new VA(), nu()), b10 = 0, c10 = this.Oa(); b10 < c10; ) { + var e10 = this.lb(b10); + WA(a10, e10); + b10 = 1 + b10 | 0; + } + return a10.eb; + }; + d7.ka = function(a10) { + return new h$().Ao(this, a10); + }; + d7.jM = function(a10, b10) { + return C9(this, a10, b10); + }; + d7.Ol = function(a10) { + return YJ(this, a10); + }; + d7.Da = function() { + return tc(this); + }; + d7.fy = function(a10) { + return new W$().Bo(this, a10); + }; + d7.ec = function(a10) { + return wub(this, a10); + }; + d7.Qd = function() { + return xub(this); + }; + d7.CL = function(a10) { + return fxb(this, a10); + }; + d7.Xk = function() { + return "SeqView"; + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.rF = function(a10) { + return ixb(this, a10); + }; + d7.$classData = r8({ Cdb: 0 }, false, "scala.collection.mutable.IndexedSeqLike$$anon$1", { Cdb: 1, f: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Im: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, ol: 1, pl: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1 }); + function fw() { + this.$x = this.it = null; + this.Cy = 0; + this.ze = null; + this.CA = this.yn = 0; + this.mp = null; + this.fC = 0; + } + fw.prototype = new izb(); + fw.prototype.constructor = fw; + d7 = fw.prototype; + d7.gX = function(a10) { + this.aW(a10); + return this; + }; + d7.a = function() { + $ya(this); + this.$x = this.it = null; + return this; + }; + d7.Yda = function(a10) { + this.fC = a10; + }; + d7.P = function(a10) { + return this.Ha(a10); + }; + d7.al = function(a10) { + return Dwb(this).gX(a10); + }; + d7.ng = function() { + return this; + }; + d7.Kk = function(a10) { + return DCa(this, a10); + }; + d7.Di = function() { + return Pja(); + }; + d7.U = function(a10) { + for (var b10 = this.it; null !== b10; ) + a10.P(b10.la), b10 = b10.Eo; + }; + function DCa(a10, b10) { + a10.iz(b10); + return a10; + } + d7.W4 = function(a10) { + var b10 = Dwb(this); + a10 = a10.Hd(); + return Hda(b10, a10); + }; + d7.Tm = function(a10) { + return DCa(this, a10); + }; + d7.jb = function() { + return this.yn; + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + var a10 = new t52(); + a10.el = this.it; + return a10; + }; + d7.Qs = function(a10) { + return Dwb(this).gX(a10); + }; + d7.lv = function() { + return new fw().a(); + }; + d7.F9 = function(a10) { + a10 = new PZa().d(a10); + null === this.it ? this.it = a10 : (this.$x.Eo = a10, a10.ks = this.$x); + return this.$x = a10; + }; + d7.$2 = function(a10) { + this.mp = a10; + }; + d7.Ha = function(a10) { + return null !== eza(this, a10); + }; + d7.j3 = function(a10) { + this.ze = a10; + }; + d7.IU = function() { + return 16; + }; + d7.jd = function(a10) { + return DCa(this, a10); + }; + d7.Vh = function() { + return GN(this); + }; + d7.tF = function(a10) { + this.aW(a10); + return this; + }; + d7.aW = function(a10) { + a10 = bza(this, a10); + null !== a10 && (null === a10.ks ? this.it = a10.Eo : a10.ks.Eo = a10.Eo, null === a10.Eo ? this.$x = a10.ks : a10.Eo.ks = a10.ks, a10.ks = null, a10.Eo = null); + }; + d7.iz = function(a10) { + return null === Zv(this, a10, null); + }; + d7.Zj = function(a10) { + return Dwb(this).Tm(a10); + }; + d7.Lk = function(a10) { + var b10 = Dwb(this); + a10 = a10.Hd(); + return yi(b10, a10); + }; + d7.d5 = function(a10) { + this.Cy = a10; + }; + d7.p3 = function(a10) { + this.CA = a10; + }; + d7.qM = function(a10) { + this.yn = a10; + }; + d7.$classData = r8({ Qdb: 0 }, false, "scala.collection.mutable.LinkedHashSet", { Qdb: 1, Fcb: 1, Ecb: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Nm: 1, Om: 1, Im: 1, beb: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, eeb: 1, G2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, P2: 1, Q2: 1, q: 1, o: 1 }); + function Lt() { + wu.call(this); + } + Lt.prototype = new xzb(); + Lt.prototype.constructor = Lt; + Lt.prototype.a = function() { + wu.prototype.Naa.call(this); + return this; + }; + Lt.prototype.IU = function() { + return this.yn; + }; + Lt.prototype.$classData = r8({ zBa: 0 }, false, "amf.core.registries.AMFDomainRegistry$$anon$1", { zBa: 1, Uda: 1, N2: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, T2: 1, Nm: 1, Om: 1, Im: 1, U2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, P2: 1, Q2: 1, Hi: 1, q: 1, o: 1 }); + function f9() { + wu.call(this); + } + f9.prototype = new xzb(); + f9.prototype.constructor = f9; + f9.prototype.f5 = function() { + return 0; + }; + f9.prototype.aL = function() { + wu.prototype.Naa.call(this); + return this; + }; + f9.prototype.$classData = r8({ lab: 0 }, false, "scala.collection.SeqLike$$anon$1", { lab: 1, Uda: 1, N2: 1, Wq: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Yq: 1, lq: 1, Xq: 1, Zq: 1, Ea: 1, za: 1, di: 1, T2: 1, Nm: 1, Om: 1, Im: 1, U2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, P2: 1, Q2: 1, Hi: 1, q: 1, o: 1 }); + function mq() { + this.Cy = 0; + this.ze = null; + this.CA = this.yn = 0; + this.mp = null; + this.fC = 0; + } + mq.prototype = new izb(); + mq.prototype.constructor = mq; + d7 = mq.prototype; + d7.Hd = function() { + return this; + }; + d7.gX = function(a10) { + return Bzb(this, a10); + }; + d7.a = function() { + mq.prototype.y7a.call(this); + return this; + }; + d7.P = function(a10) { + return null !== Sya(this, a10); + }; + d7.al = function(a10) { + var b10 = new mq().a(); + return Bzb(yi(b10, this), a10); + }; + d7.ng = function() { + return this; + }; + d7.Kk = function(a10) { + return F0a(this, a10); + }; + d7.Di = function() { + return E0a(); + }; + d7.U = function(a10) { + for (var b10 = 0, c10 = this.ze.n.length; b10 < c10; ) { + var e10 = this.ze.n[b10]; + null !== e10 && a10.P(Pda(e10)); + b10 = 1 + b10 | 0; + } + }; + d7.W4 = function(a10) { + var b10 = new mq().a(); + b10 = yi(b10, this); + a10 = a10.Hd(); + return Hda(b10, a10); + }; + d7.Tm = function(a10) { + return F0a(this, a10); + }; + d7.jb = function() { + return this.yn; + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + var a10 = new m52(); + if (null === this) + throw mb(E6(), null); + a10.Fa = this; + a10.vk = 0; + return a10; + }; + d7.Qs = function(a10) { + var b10 = new mq().a(); + return Bzb(yi(b10, this), a10); + }; + d7.lv = function() { + return new mq().a(); + }; + d7.Ha = function(a10) { + return null !== Sya(this, a10); + }; + d7.y7a = function() { + this.Cy = 450; + this.ze = ja(Ja(Ha), [aza(xK(), 32)]); + this.yn = 0; + this.CA = Qya().pV(this.Cy, aza(xK(), 32)); + this.mp = null; + this.fC = Mya(this); + }; + d7.jd = function(a10) { + return F0a(this, a10); + }; + d7.Vh = function() { + return GN(this); + }; + d7.tF = function(a10) { + return Bzb(this, a10); + }; + function Bzb(a10, b10) { + Rya(a10, b10); + return a10; + } + d7.aW = function(a10) { + Rya(this, a10); + }; + d7.iz = function(a10) { + return Nya(this, a10); + }; + d7.Zj = function(a10) { + var b10 = new mq().a(); + return F0a(yi(b10, this), a10); + }; + d7.Lk = function(a10) { + var b10 = new mq().a(); + b10 = yi(b10, this); + a10 = a10.Hd(); + return yi(b10, a10); + }; + function F0a(a10, b10) { + Nya(a10, b10); + return a10; + } + d7.$classData = r8({ xdb: 0 }, false, "scala.collection.mutable.HashSet", { xdb: 1, Fcb: 1, Ecb: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, Nm: 1, Om: 1, Im: 1, beb: 1, Lr: 1, za: 1, Kr: 1, Gs: 1, Is: 1, Hs: 1, di: 1, eeb: 1, G2: 1, vl: 1, ul: 1, tl: 1, WE: 1, Mm: 1, em: 1, Jl: 1, rib: 1, sib: 1, Hi: 1, q: 1, o: 1 }); + function B52() { + this.L = null; + } + B52.prototype = new X$(); + B52.prototype.constructor = B52; + d7 = B52.prototype; + d7.lb = function(a10) { + return this.Ep(a10); + }; + d7.P = function(a10) { + return this.Ep(a10 | 0); + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = !!b10; + }; + d7.h = function(a10) { + return a10 instanceof B52 ? Uva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.Ep = function(a10) { + return this.L.n[a10]; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Qxa(); + }; + d7.NG = function(a10) { + this.L = a10; + return this; + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, b10.n[e10] ? 1231 : 1237), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ ieb: 0 }, false, "scala.collection.mutable.WrappedArray$ofBoolean", { ieb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function v52() { + this.L = null; + } + v52.prototype = new X$(); + v52.prototype.constructor = v52; + d7 = v52.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.L.n[a10 | 0]; + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = b10 | 0; + }; + d7.h = function(a10) { + return a10 instanceof v52 ? Sva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Jxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = b10.n.length, e10 = a10.fx, f10 = 0; 4 <= c10; ) { + var g10 = 255 & b10.n[f10]; + g10 |= (255 & b10.n[1 + f10 | 0]) << 8; + g10 |= (255 & b10.n[2 + f10 | 0]) << 16; + g10 |= (255 & b10.n[3 + f10 | 0]) << 24; + e10 = a10.Ga(e10, g10); + f10 = 4 + f10 | 0; + c10 = -4 + c10 | 0; + } + g10 = 0; + 3 === c10 && (g10 ^= (255 & b10.n[2 + f10 | 0]) << 16); + 2 <= c10 && (g10 ^= (255 & b10.n[1 + f10 | 0]) << 8); + 1 <= c10 && (g10 ^= 255 & b10.n[f10], e10 = a10.mP(e10, g10)); + return a10.fe(e10, b10.n.length); + }; + d7.HG = function(a10) { + this.L = a10; + return this; + }; + d7.$classData = r8({ jeb: 0 }, false, "scala.collection.mutable.WrappedArray$ofByte", { jeb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function dB() { + this.L = null; + } + dB.prototype = new X$(); + dB.prototype.constructor = dB; + d7 = dB.prototype; + d7.lb = function(a10) { + a10 = this.gG(a10); + return gc(a10); + }; + d7.P = function(a10) { + a10 = this.gG(a10 | 0); + return gc(a10); + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = null === b10 ? 0 : b10.r; + }; + d7.h = function(a10) { + return a10 instanceof dB ? Xva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.gG = function(a10) { + return this.L.n[a10]; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.BB = function(a10) { + this.L = a10; + return this; + }; + d7.rB = function() { + return Lxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, b10.n[e10]), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ keb: 0 }, false, "scala.collection.mutable.WrappedArray$ofChar", { keb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function A52() { + this.L = null; + } + A52.prototype = new X$(); + A52.prototype.constructor = A52; + d7 = A52.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.L.n[a10 | 0]; + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = +b10; + }; + d7.h = function(a10) { + return a10 instanceof A52 ? Ova(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.IG = function(a10) { + this.L = a10; + return this; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Pxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, eAa(OJ(), b10.n[e10])), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ leb: 0 }, false, "scala.collection.mutable.WrappedArray$ofDouble", { leb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function z52() { + this.L = null; + } + z52.prototype = new X$(); + z52.prototype.constructor = z52; + d7 = z52.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.L.n[a10 | 0]; + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = +b10; + }; + d7.h = function(a10) { + return a10 instanceof z52 ? Qva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.JG = function(a10) { + this.L = a10; + return this; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Oxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + OJ(), c10 = a10.Ga(c10, eAa(0, b10.n[e10])), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ meb: 0 }, false, "scala.collection.mutable.WrappedArray$ofFloat", { meb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function x52() { + this.L = null; + } + x52.prototype = new X$(); + x52.prototype.constructor = x52; + d7 = x52.prototype; + d7.lb = function(a10) { + return this.ro(a10); + }; + d7.P = function(a10) { + return this.ro(a10 | 0); + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = b10 | 0; + }; + d7.h = function(a10) { + return a10 instanceof x52 ? Pva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.ro = function(a10) { + return this.L.n[a10]; + }; + d7.KG = function(a10) { + this.L = a10; + return this; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Mxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, b10.n[e10]), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ neb: 0 }, false, "scala.collection.mutable.WrappedArray$ofInt", { neb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function y52() { + this.L = null; + } + y52.prototype = new X$(); + y52.prototype.constructor = y52; + d7 = y52.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.L.n[a10 | 0]; + }; + d7.LG = function(a10) { + this.L = a10; + return this; + }; + d7.qC = function(a10, b10) { + b10 = Da(b10); + this.L.n[a10] = b10; + }; + d7.h = function(a10) { + return a10 instanceof y52 ? Rva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Nxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, pL(OJ(), b10.n[e10])), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ oeb: 0 }, false, "scala.collection.mutable.WrappedArray$ofLong", { oeb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function VI() { + this.L = this.rka = null; + this.s9 = false; + } + VI.prototype = new X$(); + VI.prototype.constructor = VI; + d7 = VI.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = b10; + }; + d7.fd = function(a10) { + this.L = a10; + return this; + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + this.s9 || this.s9 || (this.rka = cRa(dRa(), Ou(la(this.L))), this.s9 = true); + return this.rka; + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < SJ(W5(), b10); ) + c10 = a10.Ga(c10, NJ(OJ(), bAa(W5(), b10, e10))), e10 = 1 + e10 | 0; + return a10.fe(c10, SJ(W5(), b10)); + }; + d7.$classData = r8({ peb: 0 }, false, "scala.collection.mutable.WrappedArray$ofRef", { peb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function w52() { + this.L = null; + } + w52.prototype = new X$(); + w52.prototype.constructor = w52; + d7 = w52.prototype; + d7.lb = function(a10) { + return this.L.n[a10]; + }; + d7.P = function(a10) { + return this.L.n[a10 | 0]; + }; + d7.MG = function(a10) { + this.L = a10; + return this; + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = b10 | 0; + }; + d7.h = function(a10) { + return a10 instanceof w52 ? Yva(AI(), this.L, a10.L) : R42(this, a10); + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Kxa(); + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, b10.n[e10]), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ qeb: 0 }, false, "scala.collection.mutable.WrappedArray$ofShort", { qeb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function C52() { + this.L = null; + } + C52.prototype = new X$(); + C52.prototype.constructor = C52; + d7 = C52.prototype; + d7.lb = function(a10) { + this.L.n[a10]; + }; + d7.P = function(a10) { + this.L.n[a10 | 0]; + }; + d7.qC = function(a10, b10) { + this.L.n[a10] = b10; + }; + d7.h = function(a10) { + return a10 instanceof C52 ? this.L.n.length === a10.L.n.length : R42(this, a10); + }; + d7.Oa = function() { + return this.L.n.length; + }; + d7.rB = function() { + return Rxa(); + }; + d7.OG = function(a10) { + this.L = a10; + return this; + }; + d7.z = function() { + for (var a10 = MJ(), b10 = this.L, c10 = a10.fx, e10 = 0; e10 < b10.n.length; ) + c10 = a10.Ga(c10, 0), e10 = 1 + e10 | 0; + return a10.fe(c10, b10.n.length); + }; + d7.$classData = r8({ reb: 0 }, false, "scala.collection.mutable.WrappedArray$ofUnit", { reb: 1, ZE: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, Hi: 1, q: 1, o: 1 }); + function $$() { + u$.call(this); + } + $$.prototype = new v$(); + $$.prototype.constructor = $$; + function Czb() { + } + d7 = Czb.prototype = $$.prototype; + d7.Hd = function() { + return this; + }; + d7.CE = function(a10) { + return U$(this, a10); + }; + d7.ga = function() { + return zj(this); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.mqa = function(a10) { + return szb(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.ps = function(a10) { + return new e$().Ao(this, a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Mr = function() { + return this.DL(aK(bK(), 0, -1 + this.Oa() | 0)); + }; + d7.gl = function(a10) { + return new W$().Bo(this, a10); + }; + d7.Fba = function(a10) { + return new W$().Bo(this, a10); + }; + d7.qq = function(a10) { + return this.rn(a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.nk = function(a10) { + return d$(this, a10); + }; + d7.Di = function() { + return pmb(); + }; + d7.t = function() { + return h9(this); + }; + d7.Hba = function() { + return new Z$().IB(this); + }; + d7.Gba = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.lqa = function(a10) { + return new V$().Bo(this, a10); + }; + d7.ne = function(a10, b10) { + var c10 = this.Oa(); + return M9(this, c10, a10, b10); + }; + d7.qs = function(a10, b10) { + var c10 = this.Oa(); + return L9(this, c10, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return new V$().Bo(this, a10); + }; + d7.np = function(a10, b10) { + return pzb(this, a10, b10); + }; + d7.gp = function(a10) { + return Z9(this, a10); + }; + d7.Cb = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.st = function() { + return new Z$().IB(this); + }; + d7.Mj = function() { + return n9(this); + }; + d7.xpa = function() { + return bi(this); + }; + d7.Q1 = function(a10) { + return new e$().Ao(this, a10); + }; + d7.fj = function() { + return $9(this); + }; + d7.Iba = function(a10) { + return new V$().Bo(this, a10); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return qzb(this, a10); + }; + d7.cq = function(a10) { + return c$(this, a10); + }; + d7.mka = function(a10) { + return new W$().Bo(this, a10); + }; + d7.Moa = function() { + return new Z$().IB(this); + }; + d7.BL = function(a10) { + return new g$().cH(this, a10); + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Or = function() { + return j9(this); + }; + d7.Nr = function() { + return Kvb(this); + }; + d7.Si = function(a10) { + return i9(this, a10); + }; + d7.hm = function() { + return this.Oa(); + }; + d7.Sr = function(a10) { + return rzb(this, a10); + }; + d7.Jk = function(a10) { + return szb(this, a10); + }; + d7.nka = function(a10) { + return tzb(this, a10); + }; + d7.gy = function(a10) { + return new V$().Bo(this, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.wy = function() { + return vzb(this); + }; + d7.Rk = function(a10) { + return tzb(this, a10); + }; + d7.BE = function(a10) { + return new h$().Ao(this, a10); + }; + d7.ok = function() { + return this; + }; + d7.ta = function() { + return uzb(this); + }; + d7.ei = function(a10, b10) { + return b$(this, a10, b10); + }; + d7.uK = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.IB = function(a10) { + u$.prototype.nt.call(this, a10); + return this; + }; + d7.DL = function(a10) { + return U$(this, a10); + }; + d7.Jba = function(a10) { + return ixb(this, a10); + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.rn = function(a10) { + return new Y$().Bo(this, a10); + }; + d7.Pr = function(a10) { + return ixb(this, a10); + }; + d7.jM = function(a10, b10) { + return C9(this, a10, b10); + }; + d7.fy = function(a10) { + return new W$().Bo(this, a10); + }; + d7.CL = function(a10) { + return fxb(this, a10); + }; + d7.jC = function(a10) { + return a$(this, a10); + }; + d7.kqa = function() { + return uzb(this); + }; + d7.rF = function(a10, b10) { + if (a10 && a10.$classData && a10.$classData.ge.bo) { + b10 = b10.en(this.Zi()); + var c10 = 0, e10 = this.Oa(), f10 = a10.Oa(); + e10 = e10 < f10 ? e10 : f10; + for (b10.pj(e10); c10 < e10; ) + b10.jd(new R6().M(this.lb(c10), a10.lb(c10))), c10 = 1 + c10 | 0; + a10 = b10.Rc(); + } else + a10 = this.Pr(a10, b10); + return a10; + }; + function Lf() { + this.Qw = this.Dc = null; + this.rK = false; + this.vu = 0; + } + Lf.prototype = new mzb(); + Lf.prototype.constructor = Lf; + d7 = Lf.prototype; + d7.ala = function(a10, b10) { + return m9a(this.Dc, a10, b10); + }; + d7.so = function(a10, b10) { + ZG(this.Dc, a10, b10); + }; + function Myb(a10) { + if (!a10.b()) { + var b10 = a10.Dc, c10 = a10.Qw.Nf; + for (a10.SS(); b10 !== c10; ) + Dg(a10, b10.ga()), b10 = b10.ta(); + } + } + d7.ga = function() { + return this.Dc.ga(); + }; + d7.a = function() { + this.Dc = H10(); + this.rK = false; + this.vu = 0; + return this; + }; + d7.lb = function(a10) { + if (0 > a10 || a10 >= this.vu) + throw new U6().e("" + a10); + return Uu(this.Dc, a10); + }; + d7.Oe = function(a10) { + return Tu(this.Dc, a10); + }; + d7.fm = function(a10) { + return Bvb(this.Dc, a10); + }; + d7.P = function(a10) { + return this.lb(a10 | 0); + }; + d7.Od = function(a10) { + return Avb(this.Dc, a10); + }; + d7.al = function(a10) { + return Dzb(ws(new Lf().a(), this), a10); + }; + d7.ua = function() { + this.rK = !this.b(); + return this.Dc; + }; + d7.b = function() { + return 0 === this.vu; + }; + d7.ng = function() { + return this; + }; + d7.h = function(a10) { + return a10 instanceof Lf ? this.Dc.h(a10.Dc) : R42(this, a10); + }; + d7.Kg = function(a10) { + return UJ(this.Dc, "", a10, ""); + }; + d7.Zn = function(a10, b10, c10) { + return UJ(this.Dc, a10, b10, c10); + }; + d7.Kk = function(a10) { + return Dg(this, a10); + }; + d7.yja = function() { + return ws(new Lf().a(), this); + }; + d7.oh = function(a10) { + return Cvb(this.Dc, a10); + }; + d7.Di = function() { + return Ef(); + }; + d7.U = function(a10) { + for (var b10 = this.Dc; !b10.b(); ) + a10.P(b10.ga()), b10 = b10.ta(); + }; + d7.ne = function(a10, b10) { + return Dvb(this.Dc, a10, b10); + }; + d7.qs = function(a10, b10) { + return this.Dc.qs(a10, b10); + }; + d7.wm = function(a10, b10) { + return Evb(this.Dc, a10, b10); + }; + d7.kc = function() { + return Wt(this.Dc); + }; + d7.jb = function() { + return this.vu; + }; + d7.Mj = function() { + var a10 = this.Dc, b10 = b32().u; + return qt(a10, b10); + }; + d7.Rc = function() { + return this.ua(); + }; + d7.mb = function() { + var a10 = new u52(); + a10.dT = this.b() ? H10() : this.Dc; + return a10; + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.Fb = function(a10) { + return Fvb(this.Dc, a10); + }; + d7.cm = function() { + return UJ(this.Dc, "", "", ""); + }; + d7.Oa = function() { + return this.vu; + }; + d7.ida = function(a10) { + if (0 > a10 || a10 >= this.vu) + throw new U6().e("" + a10); + this.rK && Myb(this); + this.Dc.ga(); + if (0 === a10) + this.Dc = this.Dc.ta(); + else { + for (var b10 = this.Dc, c10 = 1; c10 < a10; ) + b10 = b10.ta(), c10 = 1 + c10 | 0; + b10.ta().ga(); + this.Qw === b10.ta() && (this.Qw = b10); + b10.Nf = b10.ta().ta(); + } + Ezb(this); + }; + function Dzb(a10, b10) { + a10.rK && Myb(a10); + if (!a10.b()) + if (Va(Wa(), a10.Dc.ga(), b10)) + a10.Dc = a10.Dc.ta(), Ezb(a10); + else { + for (var c10 = a10.Dc; !c10.ta().b() && !Va(Wa(), c10.ta().ga(), b10); ) + c10 = c10.ta(); + if (!c10.ta().b()) { + b10 = c10; + var e10 = b10.Nf, f10 = a10.Qw; + if (null === e10 ? null === f10 : e10.h(f10)) + a10.Qw = b10; + b10.Nf = c10.ta().ta(); + Ezb(a10); + } + } + return a10; + } + d7.Dd = function() { + return this.Dc.Dd(); + }; + function Ezb(a10) { + a10.vu = a10.vu - 1 | 0; + 0 >= a10.vu && (a10.Qw = null); + } + d7.Ha = function(a10) { + return Cg(this.Dc, a10); + }; + d7.rm = function(a10, b10, c10, e10) { + return XJ(this.Dc, a10, b10, c10, e10); + }; + function Dg(a10, b10) { + a10.rK && Myb(a10); + if (a10.b()) + a10.Qw = ji(b10, H10()), a10.Dc = a10.Qw; + else { + var c10 = a10.Qw; + a10.Qw = ji(b10, H10()); + c10.Nf = a10.Qw; + } + a10.vu = 1 + a10.vu | 0; + return a10; + } + d7.ke = function() { + return this.Dc; + }; + d7.Sa = function(a10) { + return Gvb(this.Dc, a10 | 0); + }; + d7.V4 = function(a10) { + return Dzb(this, a10); + }; + d7.xg = function() { + var a10 = this.Dc, b10 = qe2(); + b10 = re4(b10); + return qt(a10, b10); + }; + d7.Ql = function(a10, b10) { + return Dvb(this.Dc, a10, b10); + }; + d7.jd = function(a10) { + return Dg(this, a10); + }; + d7.$ka = function(a10) { + return m9a(this.Dc, a10, 0); + }; + d7.pj = function() { + }; + d7.Pk = function(a10, b10, c10) { + Psb(this.Dc, a10, b10, c10); + }; + d7.Vh = function() { + return this.Dc; + }; + d7.Ch = function() { + for (var a10 = this.Dc, b10 = UA(new VA(), nu()); !a10.b(); ) { + var c10 = a10.ga(); + WA(b10, c10); + a10 = a10.ta(); + } + return b10.eb; + }; + d7.tF = function(a10) { + return Dzb(this, a10); + }; + d7.SS = function() { + this.Dc = H10(); + this.Qw = null; + this.rK = false; + this.vu = 0; + }; + d7.Ol = function(a10) { + return YJ(this.Dc, a10); + }; + d7.Da = function() { + return 0 < this.vu; + }; + function ws(a10, b10) { + a: + for (; ; ) { + var c10 = b10; + if (null !== c10 && c10 === a10) { + b10 = Osb(a10, a10.vu); + continue a; + } + return yi(a10, b10); + } + } + d7.jh = function(a10) { + return ws(this, a10); + }; + d7.Xk = function() { + return "ListBuffer"; + }; + d7.$classData = r8({ Udb: 0 }, false, "scala.collection.mutable.ListBuffer", { Udb: 1, Ipa: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Jpa: 1, Kpa: 1, ul: 1, tl: 1, WE: 1, G2: 1, di: 1, Js: 1, vl: 1, eib: 1, dib: 1, fib: 1, q: 1, o: 1 }); + function Tj() { + this.Ef = null; + } + Tj.prototype = new Wxb(); + Tj.prototype.constructor = Tj; + d7 = Tj.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return zj(this); + }; + function hF(a10, b10) { + jF(a10.Ef, b10); + return a10; + } + d7.a = function() { + Tj.prototype.e1.call(this, 16, ""); + return this; + }; + d7.lb = function(a10) { + a10 = this.Ef.Hz(a10); + return gc(a10); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.P = function(a10) { + a10 = this.Ef.Hz(a10 | 0); + return gc(a10); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.bI = function(a10, b10) { + return this.Ef.qf.substring(a10, b10); + }; + d7.gG = function(a10) { + return this.Ef.Hz(a10); + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + function gF(a10, b10) { + a10 = a10.Ef; + a10.qf = "" + a10.qf + b10; + } + d7.Kk = function(a10) { + return hF(this, null === a10 ? 0 : a10.r); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.Di = function() { + return pmb(); + }; + d7.t = function() { + return this.Ef.qf; + }; + d7.tr = function(a10) { + var b10 = this.Ef.qf; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + var c10 = this.Ef.Oa(); + return M9(this, c10, a10, b10); + }; + d7.qs = function(a10, b10) { + var c10 = this.Ef.Oa(); + return L9(this, c10, a10, b10); + }; + d7.gs = function(a10) { + var b10 = this.Ef.qf; + return b10 === a10 ? 0 : b10 < a10 ? -1 : 1; + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.np = function(a10, b10) { + return rwb(this, a10, b10); + }; + d7.st = function() { + return new Tj().AU(tZa(new Y22().Kaa(this.Ef))); + }; + d7.Mj = function() { + return n9(this); + }; + d7.Rc = function() { + return this.Ef.qf; + }; + function Vj(a10, b10) { + var c10 = a10.Ef; + c10.qf = "" + c10.qf + b10; + return a10; + } + d7.mb = function() { + return qS(new rS(), this, 0, this.Ef.Oa()); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.ue = function(a10) { + Tj.prototype.e1.call(this, a10, ""); + return this; + }; + d7.e1 = function(a10, b10) { + a10 = new Y22().ue((b10.length | 0) + a10 | 0); + a10.qf = "" + a10.qf + b10; + Tj.prototype.AU.call(this, a10); + return this; + }; + d7.cm = function() { + return this.Ef.qf; + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Oa = function() { + return this.Ef.Oa(); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Nr = function() { + return E62(this); + }; + d7.hm = function() { + return this.Ef.Oa(); + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return rwb(this, 0, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.wy = function() { + return vzb(this); + }; + d7.Rk = function(a10) { + var b10 = this.Ef.Oa(); + return rwb(this, a10, b10); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return this; + }; + d7.AU = function(a10) { + this.Ef = a10; + return this; + }; + function Wj(a10, b10) { + var c10 = a10.Ef; + c10.qf += "" + b10; + return a10; + } + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.jd = function(a10) { + return hF(this, null === a10 ? 0 : a10.r); + }; + d7.pj = function() { + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.Ol = function() { + return Iu(ua(), this.Ef.qf); + }; + d7.Hz = function(a10) { + return this.Ef.Hz(a10); + }; + d7.Qd = function() { + return Jf(new Kf(), new Tj().a()); + }; + d7.jh = function(a10) { + return yi(this, a10); + }; + d7.$classData = r8({ feb: 0 }, false, "scala.collection.mutable.StringBuilder", { feb: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, eP: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, Gpa: 1, Wk: 1, cM: 1, ym: 1, Js: 1, vl: 1, ul: 1, tl: 1, q: 1, o: 1 }); + function Ib() { + this.L = null; + } + Ib.prototype = new mzb(); + Ib.prototype.constructor = Ib; + d7 = Ib.prototype; + d7.Hd = function() { + return this; + }; + d7.ga = function() { + return zj(this); + }; + d7.a = function() { + Ib.prototype.ha.call(this, []); + return this; + }; + d7.lb = function(a10) { + return this.L[a10]; + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.P = function(a10) { + return this.L[a10 | 0]; + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.al = function(a10) { + return ywb(this).V4(a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kk = function(a10) { + this.L.push(a10); + return this; + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.Di = function() { + return vk(); + }; + d7.U = function(a10) { + E9(this, a10); + }; + d7.ne = function(a10, b10) { + return M9(this, this.L.length | 0, a10, b10); + }; + d7.qs = function(a10, b10) { + return L9(this, this.L.length | 0, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.np = function(a10, b10) { + return H9(this, a10, b10); + }; + d7.st = function() { + return zvb(this); + }; + d7.Mj = function() { + return n9(this); + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.L.length | 0); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.Oa = function() { + return this.L.length | 0; + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Nr = function() { + return E62(this); + }; + d7.Or = function() { + return Qx(this); + }; + d7.hm = function() { + return this.L.length | 0; + }; + d7.ida = function(a10) { + if (0 > a10 || a10 >= (this.L.length | 0)) + throw new U6().a(); + this.L.splice(a10, 1); + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return H9(this, 0, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.wy = function() { + return vzb(this); + }; + d7.Rk = function(a10) { + return H9(this, a10, this.L.length | 0); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return this; + }; + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.jd = function(a10) { + this.L.push(a10); + return this; + }; + d7.pj = function() { + }; + d7.Pk = function(a10, b10, c10) { + N9(this, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.tF = function(a10) { + return zwb(this, a10); + }; + d7.ha = function(a10) { + this.L = a10; + return this; + }; + d7.Xk = function() { + return "WrappedArray"; + }; + d7.$classData = r8({ Deb: 0 }, false, "scala.scalajs.js.WrappedArray", { Deb: 1, Ipa: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Jpa: 1, Kpa: 1, ul: 1, tl: 1, WE: 1, G2: 1, di: 1, Rr: 1, bo: 1, nj: 1, Ml: 1, mq: 1, gm: 1, Wk: 1, vl: 1 }); + function Z$() { + u$.call(this); + this.Sb = null; + } + Z$.prototype = new Czb(); + Z$.prototype.constructor = Z$; + d7 = Z$.prototype; + d7.lb = function(a10) { + return j$(this, a10); + }; + d7.P = function(a10) { + return j$(this, a10 | 0); + }; + d7.lW = function() { + return this.Sb; + }; + d7.mb = function() { + return k$(this); + }; + d7.Pl = function() { + return "R"; + }; + d7.Oa = function() { + return this.Sb.Oa(); + }; + d7.IB = function(a10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + $$.prototype.IB.call(this, a10); + return this; + }; + d7.$classData = r8({ Hdb: 0 }, false, "scala.collection.mutable.IndexedSeqView$$anon$5", { Hdb: 1, R2: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, S2: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, vib: 1, fpa: 1 }); + function Xj() { + this.lma = 0; + this.L = null; + this.w = 0; + } + Xj.prototype = new mzb(); + Xj.prototype.constructor = Xj; + d7 = Xj.prototype; + d7.Hd = function() { + return this; + }; + function pr(a10, b10) { + uD(a10, 1 + a10.w | 0); + a10.L.n[a10.w] = b10; + a10.w = 1 + a10.w | 0; + return a10; + } + d7.ga = function() { + return zj(this); + }; + d7.a = function() { + Xj.prototype.ue.call(this, 16); + return this; + }; + d7.lb = function(a10) { + return xF(this, a10); + }; + d7.Oe = function(a10) { + return y9(this, a10); + }; + d7.fm = function(a10) { + return z9(this, a10); + }; + d7.P = function(a10) { + return xF(this, a10 | 0); + }; + d7.Od = function(a10) { + return A9(this, a10); + }; + d7.al = function(a10) { + return ywb(this).V4(a10); + }; + d7.ua = function() { + return Wv(this); + }; + d7.b = function() { + return XG(this); + }; + d7.Kj = function() { + return this; + }; + d7.ng = function() { + return this; + }; + d7.Mr = function() { + return B62(this); + }; + d7.gl = function(a10) { + return B9(this, a10); + }; + d7.Kk = function(a10) { + return pr(this, a10); + }; + d7.oh = function(a10) { + return D9(this, a10); + }; + d7.Di = function() { + return b32(); + }; + d7.U = function(a10) { + for (var b10 = 0, c10 = this.w; b10 < c10; ) + a10.P(this.L.n[b10]), b10 = 1 + b10 | 0; + }; + d7.ne = function(a10, b10) { + return M9(this, this.w, a10, b10); + }; + d7.qs = function(a10, b10) { + return L9(this, this.w, a10, b10); + }; + d7.wm = function(a10, b10) { + return F9(this, a10, b10); + }; + d7.xl = function(a10) { + return G9(this, a10); + }; + d7.np = function(a10, b10) { + return H9(this, a10, b10); + }; + d7.st = function() { + return zvb(this); + }; + d7.Mj = function() { + return n9(this); + }; + d7.Rc = function() { + return this; + }; + d7.mb = function() { + return qS(new rS(), this, 0, this.w); + }; + d7.zt = function(a10, b10) { + MT(this, a10, b10); + }; + d7.Fb = function(a10) { + return I9(this, a10); + }; + d7.Pm = function(a10) { + return J9(this, a10); + }; + d7.ue = function(a10) { + a10 = this.lma = a10; + this.L = ja(Ja(Ha), [1 < a10 ? a10 : 1]); + this.w = 0; + return this; + }; + d7.Oa = function() { + return this.w; + }; + d7.og = function(a10) { + return K9(this, a10); + }; + d7.Or = function() { + return Qx(this); + }; + d7.Nr = function() { + return E62(this); + }; + d7.hm = function() { + return this.w; + }; + d7.ida = function(a10) { + xF(this, a10); + if (0 > a10 || a10 > (this.w - 1 | 0)) + throw new U6().e("at " + a10 + " deleting 1"); + Ba(this.L, a10 + 1 | 0, this.L, a10, this.w - (a10 + 1 | 0) | 0); + $G(this, this.w - 1 | 0); + }; + d7.Sr = function(a10) { + return w32(this, a10); + }; + d7.Jk = function(a10) { + return H9(this, 0, a10); + }; + d7.hA = function() { + return Oc(this); + }; + d7.wy = function() { + return vzb(this); + }; + d7.Rk = function(a10) { + return H9(this, a10, this.w); + }; + d7.ta = function() { + return bi(this); + }; + d7.ok = function() { + return this; + }; + function Gda(a10, b10) { + if (b10 && b10.$classData && b10.$classData.ge.nj) { + var c10 = b10.Oa(); + uD(a10, a10.w + c10 | 0); + b10.Pk(a10.L, a10.w, c10); + a10.w = a10.w + c10 | 0; + return a10; + } + return yi(a10, b10); + } + d7.Sa = function(a10) { + return S42(this, a10 | 0); + }; + d7.jd = function(a10) { + return pr(this, a10); + }; + d7.pj = function(a10) { + a10 > this.w && 1 <= a10 && (a10 = ja(Ja(Ha), [a10]), Ba(this.L, 0, a10, 0, this.w), this.L = a10); + }; + d7.Pk = function(a10, b10, c10) { + var e10 = SJ(W5(), a10) - b10 | 0; + c10 = c10 < e10 ? c10 : e10; + e10 = this.w; + c10 = c10 < e10 ? c10 : e10; + 0 < c10 && Pu(Gd(), this.L, 0, a10, b10, c10); + }; + d7.Vh = function() { + return this; + }; + d7.z = function() { + return pT(this); + }; + d7.Pr = function(a10, b10) { + return N8(this, a10, b10); + }; + d7.tF = function(a10) { + return zwb(this, a10); + }; + d7.jh = function(a10) { + return Gda(this, a10); + }; + d7.Xk = function() { + return "ArrayBuffer"; + }; + d7.$classData = r8({ Gcb: 0 }, false, "scala.collection.mutable.ArrayBuffer", { Gcb: 1, Ipa: 1, ex: 1, Op: 1, lf: 1, mf: 1, f: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, Ad: 1, vd: 1, Tc: 1, Vc: 1, v: 1, mg: 1, Ea: 1, za: 1, fg: 1, df: 1, ef: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, Jpa: 1, Kpa: 1, ul: 1, tl: 1, WE: 1, G2: 1, di: 1, gm: 1, Ml: 1, nj: 1, Wk: 1, vl: 1, zib: 1, Rr: 1, bo: 1, Hi: 1, q: 1, o: 1 }); + function Y$() { + u$.call(this); + this.Dw = this.Mp = null; + this.Cg = false; + this.Sb = null; + } + Y$.prototype = new Czb(); + Y$.prototype.constructor = Y$; + d7 = Y$.prototype; + d7.lb = function(a10) { + return Bxb(this, a10); + }; + d7.P = function(a10) { + return Bxb(this, a10 | 0); + }; + d7.Eda = function() { + return this.Sb; + }; + d7.VT = function() { + this.Cg || (this.Dw = Cxb(this), this.Cg = true); + return this.Dw; + }; + d7.U = function(a10) { + hwb(this, a10); + }; + d7.mb = function() { + return Gwb(this); + }; + d7.Pl = function() { + return "F"; + }; + d7.Oa = function() { + return this.Rx().n.length; + }; + d7.Bo = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + $$.prototype.IB.call(this, a10); + return this; + }; + d7.Rx = function() { + return this.Cg ? this.Dw : this.VT(); + }; + d7.Du = function() { + return this.Mp; + }; + d7.PP = function() { + return this.Sb; + }; + d7.Jda = function() { + return this.Sb; + }; + d7.$classData = r8({ Ddb: 0 }, false, "scala.collection.mutable.IndexedSeqView$$anon$1", { Ddb: 1, R2: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, S2: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, uib: 1, epa: 1, Zoa: 1, jpa: 1 }); + function Fzb() { + u$.call(this); + this.Sb = this.kO = null; + } + Fzb.prototype = new Czb(); + Fzb.prototype.constructor = Fzb; + d7 = Fzb.prototype; + d7.lb = function(a10) { + return Kxb(this, a10); + }; + d7.P = function(a10) { + return Kxb(this, a10 | 0); + }; + d7.J2 = function() { + return this.Sb; + }; + d7.U = function(a10) { + var b10 = B$(this); + yT(b10, a10); + }; + d7.mb = function() { + return B$(this); + }; + d7.Pl = function() { + return "S"; + }; + d7.Oa = function() { + return pya(this.kO); + }; + function U$(a10, b10) { + var c10 = new Fzb(); + if (null === a10) + throw mb(E6(), null); + c10.Sb = a10; + c10.kO = b10; + $$.prototype.IB.call(c10, a10); + return c10; + } + d7.nK = function() { + return this.kO; + }; + d7.$classData = r8({ Edb: 0 }, false, "scala.collection.mutable.IndexedSeqView$$anon$2", { Edb: 1, R2: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, S2: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, wib: 1, gpa: 1, $oa: 1, kpa: 1 }); + function W$() { + u$.call(this); + this.Mp = null; + this.nM = 0; + this.Cg = false; + this.Sb = null; + } + W$.prototype = new Czb(); + W$.prototype.constructor = W$; + d7 = W$.prototype; + d7.lb = function(a10) { + return zxb(this, a10); + }; + d7.P = function(a10) { + return zxb(this, a10 | 0); + }; + d7.H2 = function() { + return this.Sb; + }; + d7.U = function(a10) { + gwb(this, a10); + }; + d7.Dda = function() { + return this.Sb; + }; + d7.mb = function() { + return Fwb(this); + }; + d7.Pl = function() { + return "D"; + }; + d7.Oa = function() { + return Axb(this); + }; + d7.Bo = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + $$.prototype.IB.call(this, a10); + return this; + }; + d7.Ida = function() { + return this.Sb; + }; + d7.Ms = function() { + return this.Cg ? this.nM : this.lea(); + }; + d7.Du = function() { + return this.Mp; + }; + d7.lea = function() { + this.Cg || (this.nM = C9(this.Sb, this.Mp, 0), this.Cg = true); + return this.nM; + }; + d7.$classData = r8({ Fdb: 0 }, false, "scala.collection.mutable.IndexedSeqView$$anon$3", { Fdb: 1, R2: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, S2: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, tib: 1, dpa: 1, Yoa: 1, ipa: 1 }); + function V$() { + u$.call(this); + this.Mp = null; + this.lL = 0; + this.Cg = false; + this.Sb = null; + } + V$.prototype = new Czb(); + V$.prototype.constructor = V$; + d7 = V$.prototype; + d7.lb = function(a10) { + return Lxb(this, a10); + }; + d7.P = function(a10) { + return Lxb(this, a10 | 0); + }; + d7.Fda = function() { + return this.Sb; + }; + d7.gP = function() { + return this.Cg ? this.lL : this.kba(); + }; + d7.U = function(a10) { + kwb(this, a10); + }; + d7.Lda = function() { + return this.Sb; + }; + d7.mb = function() { + return Kwb(this); + }; + d7.Pl = function() { + return "T"; + }; + d7.Oa = function() { + return this.gP(); + }; + d7.Bo = function(a10, b10) { + if (null === a10) + throw mb(E6(), null); + this.Sb = a10; + this.Mp = b10; + $$.prototype.IB.call(this, a10); + return this; + }; + d7.Gda = function() { + return this.Sb; + }; + d7.kba = function() { + this.Cg || (this.lL = C9(this.Sb, this.Mp, 0), this.Cg = true); + return this.lL; + }; + d7.Du = function() { + return this.Mp; + }; + d7.$classData = r8({ Gdb: 0 }, false, "scala.collection.mutable.IndexedSeqView$$anon$4", { Gdb: 1, R2: 1, vn: 1, f: 1, mg: 1, Ea: 1, za: 1, Ad: 1, Bd: 1, Xc: 1, Yc: 1, Nc: 1, Qb: 1, Pb: 1, Uc: 1, Wc: 1, zd: 1, Cd: 1, vd: 1, Tc: 1, Vc: 1, v: 1, fg: 1, df: 1, ef: 1, Jm: 1, ml: 1, nl: 1, ql: 1, rl: 1, sl: 1, Lm: 1, Km: 1, ol: 1, pl: 1, S2: 1, tW: 1, Rr: 1, $q: 1, Nm: 1, Om: 1, Im: 1, ar: 1, Mm: 1, em: 1, Jl: 1, bo: 1, nj: 1, Ml: 1, gm: 1, Wk: 1, xib: 1, hpa: 1, apa: 1, lpa: 1 }); + function Gzb() { + this.ea = this.PM = this.MI = this.WC = this.qx = this.Bx = this.Xt = this.WM = this.dz = this.bz = this.CJ = this.Lt = this.Kt = this.Wt = this.Vt = this.TI = this.rJ = this.LI = this.LJ = this.JJ = this.bu = this.Nt = this.Hy = this.AJ = this.$M = this.IJ = this.sJ = this.PI = this.yJ = this.RI = this.MJ = this.tJ = this.gz = this.Fy = this.UI = this.aJ = this.OI = this.Gq = this.VX = this.Z7 = this.h8 = this.AZ = this.XY = this.FX = this.QZ = this.RZ = this.zZ = this.e_ = this.CZ = this.FZ = this.DZ = this.ZZ = this.b_ = this.O7 = this.R5 = this.m5 = this.M7 = this.L7 = this.XZ = this.a_ = this.vY = this.f_ = this.yX = this.TX = this.GZ = this.sZ = this.YZ = this.EX = this.pX = this.rX = this.sX = this.RX = this.SX = this.dY = this.eY = this.xY = this.yY = this.iZ = this.jZ = this.kZ = this.o_ = this.lZ = this.qX = this.tX = this.zX = this.yZ = this.cZ = this.$Z = this.mZ = this.VZ = this.pZ = this.SZ = this.bY = this.uX = this.h_ = this.p_ = this.XX = this.IZ = null; + } + Gzb.prototype = new u7(); + Gzb.prototype.constructor = Gzb; + function P52() { + var a10 = Z10(); + if (null === Z10().XX && null === Z10().XX) { + var b10 = Z10(), c10 = new k0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.XX = c10; + } + return Z10().XX; + } + d7 = Gzb.prototype; + d7.a = function() { + Hzb = this; + this.ea = nv().ea; + return this; + }; + d7.cS = function() { + null === Z10().Vt && this.qJ(); + Z10(); + }; + d7.BJ = function() { + null === Z10().Wt && (Z10().Wt = new Z_().Br(this)); + }; + function $qb() { + var a10 = Z10(); + if (null === Z10().XZ && null === Z10().XZ) { + var b10 = Z10(), c10 = new a1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.XZ = c10; + } + return Z10().XZ; + } + function vmb() { + Z10(); + null === Z10().GZ && null === Z10().GZ && (Z10().GZ = new N0()); + return Z10().GZ; + } + function etb() { + var a10 = Z10(); + if (null === Z10().pZ && null === Z10().pZ) { + var b10 = Z10(), c10 = new B0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.pZ = c10; + } + return Z10().pZ; + } + function erb() { + var a10 = Z10(); + if (null === Z10().DZ && null === Z10().DZ) { + var b10 = Z10(), c10 = new J0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.DZ = c10; + } + return Z10().DZ; + } + d7.cb = function() { + null === Z10().Xt && this.fS(); + return Z10().Xt; + }; + function k$a2() { + var a10 = Z10(); + if (null === Z10().EX && null === Z10().EX) { + var b10 = Z10(), c10 = new S_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.EX = c10; + } + return Z10().EX; + } + function Cub() { + var a10 = Z10(); + if (null === Z10().tX && null === Z10().tX) { + var b10 = Z10(), c10 = new D_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.tX = c10; + } + return Z10().tX; + } + function Dub() { + var a10 = Z10(); + if (null === Z10().qX && null === Z10().qX) { + var b10 = Z10(), c10 = new A_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.qX = c10; + } + return Z10().qX; + } + function p$a2() { + var a10 = Z10(); + if (null === Z10().cZ && null === Z10().cZ) { + var b10 = Z10(), c10 = new u0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.cZ = c10; + } + return Z10().cZ; + } + d7.tR = function() { + null === Z10().qx && (Z10().qx = new xL()); + }; + function frb() { + var a10 = Z10(); + if (null === Z10().$Z && null === Z10().$Z) { + var b10 = Z10(), c10 = new d1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.$Z = c10; + } + return Z10().$Z; + } + function W8() { + var a10 = Z10(); + if (null === Z10().RZ && null === Z10().RZ) { + var b10 = Z10(), c10 = new Y0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.RZ = c10; + } + return Z10().RZ; + } + function w8() { + var a10 = Z10(); + if (null === Z10().YZ && null === Z10().YZ) { + var b10 = Z10(), c10 = new b1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.YZ = c10; + } + return Z10().YZ; + } + d7.Lf = function() { + null === Z10().Gq && this.FJ(); + return Z10().Gq; + }; + function s$a2() { + var a10 = Z10(); + if (null === Z10().e_ && null === Z10().e_) { + var b10 = Z10(), c10 = new w1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.e_ = c10; + } + return Z10().e_; + } + function btb() { + var a10 = Z10(); + if (null === Z10().zZ && null === Z10().zZ) { + var b10 = Z10(), c10 = new F0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.zZ = c10; + } + return Z10().zZ; + } + d7.z5 = function() { + null === Z10().WC && (Z10().WC = new zL()); + }; + function dtb() { + var a10 = Z10(); + if (null === Z10().SZ && null === Z10().SZ) { + var b10 = Z10(), c10 = new Z0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.SZ = c10; + } + return Z10().SZ; + } + function O52() { + var a10 = Z10(); + if (null === Z10().FZ && null === Z10().FZ) { + var b10 = Z10(), c10 = new K0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.FZ = c10; + } + return Z10().FZ; + } + d7.FJ = function() { + null === Z10().Gq && (Z10().Gq = new Q_().ep(this)); + }; + function $Wa(a10) { + null === Z10().R5 && null === Z10().R5 && (Z10().R5 = new h1().Wz(a10)); + Z10(); + } + function Wtb() { + var a10 = Z10(); + if (null === Z10().yZ && null === Z10().yZ) { + var b10 = Z10(), c10 = new E0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.yZ = c10; + } + return Z10().yZ; + } + function XWa(a10) { + null === Z10().L7 && null === Z10().L7 && (Z10().L7 = new j1().Wz(a10)); + Z10(); + } + function S8() { + var a10 = Z10(); + if (null === Z10().VX && null === Z10().VX) { + var b10 = Z10(), c10 = new j0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.VX = c10; + } + return Z10().VX; + } + function brb() { + var a10 = Z10(); + if (null === Z10().ZZ && null === Z10().ZZ) { + var b10 = Z10(), c10 = new c1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.ZZ = c10; + } + return Z10().ZZ; + } + d7.NI = function() { + null === Z10().Kt && (Z10().Kt = new W_().Br(this)); + }; + function avb() { + var a10 = Z10(); + if (null === Z10().IZ && null === Z10().IZ) { + var b10 = Z10(), c10 = new O0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.IZ = c10; + } + return Z10().IZ; + } + d7.no = function() { + null === Z10().bu && this.mS(); + return Z10().bu; + }; + function Mub() { + var a10 = Z10(); + if (null === Z10().lZ && null === Z10().lZ) { + var b10 = Z10(), c10 = new y0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.lZ = c10; + } + return Z10().lZ; + } + function Zsb() { + var a10 = Z10(); + if (null === Z10().yX && null === Z10().yX) { + var b10 = Z10(), c10 = new I_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.yX = c10; + } + return Z10().yX; + } + d7.qJ = function() { + null === Z10().Vt && (Z10().Vt = new Y_().Br(this)); + }; + function N52() { + var a10 = Z10(); + if (null === Z10().FX && null === Z10().FX) { + var b10 = Z10(), c10 = new T_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.FX = c10; + } + return Z10().FX; + } + d7.Pt = function() { + null === Z10().Bx && this.FR(); + Z10(); + }; + d7.fS = function() { + null === Z10().Xt && (Z10().Xt = new DL()); + }; + d7.Um = function() { + null === Z10().Lt && this.xR(); + return Z10().Lt; + }; + function U8() { + var a10 = Z10(); + if (null === Z10().a_ && null === Z10().a_) { + var b10 = Z10(), c10 = new e1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.a_ = c10; + } + return Z10().a_; + } + function Ytb() { + var a10 = Z10(); + if (null === Z10().QZ && null === Z10().QZ) { + var b10 = Z10(), c10 = new U0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.QZ = c10; + } + return Z10().QZ; + } + function YWa(a10) { + null === Z10().M7 && null === Z10().M7 && (Z10().M7 = new l1().Wz(a10)); + Z10(); + } + function htb() { + var a10 = Z10(); + if (null === Z10().vY && null === Z10().vY) { + var b10 = Z10(), c10 = new q0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.vY = c10; + } + return Z10().vY; + } + d7.b8 = function() { + null === Z10().dz && (Z10().dz = bXa(this)); + }; + function ctb() { + var a10 = Z10(); + if (null === Z10().sZ && null === Z10().sZ) { + var b10 = Z10(), c10 = new C0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.sZ = c10; + } + return Z10().sZ; + } + d7.yi = function() { + null === Z10().qx && this.tR(); + Z10(); + }; + function atb() { + var a10 = Z10(); + if (null === Z10().zX && null === Z10().zX) { + var b10 = Z10(), c10 = new J_(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.zX = c10; + } + return Z10().zX; + } + function aXa(a10) { + null === Z10().O7 && null === Z10().O7 && (Z10().O7 = new n1().Wz(a10)); + Z10(); + } + d7.XC = function() { + null === Z10().WC && this.z5(); + Z10(); + }; + function ZWa(a10) { + null === Z10().m5 && null === Z10().m5 && (Z10().m5 = new f1().Wz(a10)); + Z10(); + } + function ftb() { + var a10 = Z10(); + if (null === Z10().TX && null === Z10().TX) { + var b10 = Z10(), c10 = new i0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.TX = c10; + } + return Z10().TX; + } + function jtb() { + var a10 = Z10(); + if (null === Z10().AZ && null === Z10().AZ) { + var b10 = Z10(), c10 = new G0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.AZ = c10; + } + return Z10().AZ; + } + d7.qR = function() { + null === Z10().Kt && this.NI(); + Z10(); + }; + d7.xR = function() { + null === Z10().Lt && (Z10().Lt = new X_().Br(this)); + }; + d7.eS = function() { + null === Z10().Wt && this.BJ(); + Z10(); + }; + d7.zR = function() { + null === Z10().Nt && (Z10().Nt = HWa(this)); + }; + function arb() { + var a10 = Z10(); + null === Z10().b_ && null === Z10().b_ && (Z10().b_ = new p1().Wz(a10)); + return Z10().b_; + } + d7.mS = function() { + null === Z10().bu && (Z10().bu = new C1()); + }; + d7.jr = function() { + null === Z10().Nt && this.zR(); + return Z10().Nt; + }; + function xmb() { + var a10 = Z10(); + if (null === Z10().p_ && null === Z10().p_) { + var b10 = Z10(), c10 = new H1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.p_ = c10; + } + return Z10().p_; + } + function itb() { + var a10 = Z10(); + if (null === Z10().XY && null === Z10().XY) { + var b10 = Z10(), c10 = new t0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.XY = c10; + } + return Z10().XY; + } + d7.FR = function() { + null === Z10().Bx && (Z10().Bx = new BL()); + }; + function s8() { + var a10 = Z10(); + if (null === Z10().CZ && null === Z10().CZ) { + var b10 = Z10(), c10 = new H0(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.CZ = c10; + } + return Z10().CZ; + } + d7.cB = function() { + null === Z10().bz && this.V7(); + return Z10().bz; + }; + d7.V7 = function() { + null === Z10().bz && (Z10().bz = OWa(this)); + }; + function Rub() { + var a10 = Z10(); + if (null === Z10().f_ && null === Z10().f_) { + var b10 = Z10(), c10 = new x1(); + if (null === a10) + throw mb(E6(), null); + c10.l = a10; + b10.f_ = c10; + } + return Z10().f_; + } + d7.Bg = function() { + null === Z10().dz && this.b8(); + return Z10().dz; + }; + d7.$classData = r8({ Eta: 0 }, false, "amf.client.convert.WebApiClientConverters$", { + Eta: 1, + f: 1, + Bgb: 1, + C6: 1, + ib: 1, + A6: 1, + J6: 1, + I6: 1, + D6: 1, + P6: 1, + M6: 1, + Q6: 1, + E6: 1, + H6: 1, + F6: 1, + U6: 1, + S6: 1, + G6: 1, + y6: 1, + O6: 1, + K6: 1, + R6: 1, + T6: 1, + L6: 1, + z6: 1, + N6: 1, + Efb: 1, + igb: 1, + ugb: 1, + $fb: 1, + Nfb: 1, + tfb: 1, + hgb: 1, + jgb: 1, + Zfb: 1, + sgb: 1, + agb: 1, + cgb: 1, + bgb: 1, + ogb: 1, + rgb: 1, + mgb: 1, + qgb: 1, + Kfb: 1, + tgb: 1, + pfb: 1, + Dfb: 1, + dgb: 1, + Wfb: 1, + ngb: 1, + sfb: 1, + ifb: 1, + kfb: 1, + lfb: 1, + Bfb: 1, + Cfb: 1, + Ifb: 1, + Jfb: 1, + Lfb: 1, + Mfb: 1, + Pfb: 1, + Qfb: 1, + Rfb: 1, + Cgb: 1, + Sfb: 1, + jfb: 1, + mfb: 1, + qfb: 1, + Yfb: 1, + Ofb: 1, + pgb: 1, + vfb: 1, + Tfb: 1, + lgb: 1, + Vfb: 1, + kgb: 1, + Hfb: 1, + nfb: 1, + ofb: 1, + vgb: 1, + Dgb: 1, + Ffb: 1, + wgb: 1, + egb: 1, + Agb: 1, + B6: 1, + ufb: 1 + }); + var Hzb = void 0; + function Z10() { + Hzb || (Hzb = new Gzb().a()); + return Hzb; + } + n7.MessageStyles = ik(); + n7.ProfileNames = mj(); + Fea || (Fea = new Qo().a()); + n7.ErrorHandler = Fea; + n7.client = n7.client || {}; + n7.client.model = n7.client.model || {}; + var Izb = n7.client.model; + Gea || (Gea = new Vo().a()); + Izb.DataTypes = Gea; + Uea || (Uea = new up().a()); + n7.ValidationMode = Uea; + n7.render = n7.render || {}; + n7.render.RenderOptions = function() { + var a10 = new xp(); + xp.prototype.a.call(a10); + return a10; + }; + n7.render.RenderOptions.prototype = xp.prototype; + n7.render = n7.render || {}; + n7.render.ShapeRenderOptions = function() { + var a10 = new Jp(); + Jp.prototype.a.call(a10); + return a10; + }; + n7.render.ShapeRenderOptions.prototype = Jp.prototype; + n7.Resolver = function(a10) { + var b10 = new Kp(); + Kp.prototype.e.call(b10, a10); + return b10; + }; + n7.Resolver.prototype = Kp.prototype; + n7.client = n7.client || {}; + n7.client.validate = n7.client.validate || {}; + n7.client.validate.PayloadParsingResult = function(a10, b10) { + var c10 = new Xp(); + Xp.prototype.W6a.call(c10, a10, b10); + return c10; + }; + n7.client.validate.PayloadParsingResult.prototype = Xp.prototype; + n7.client = n7.client || {}; + n7.client.validate = n7.client.validate || {}; + n7.client.validate.ValidationReport = function(a10, b10, c10, e10) { + var f10 = new $p(); + $p.prototype.u7a.call(f10, !!a10, b10, c10, e10); + return f10; + }; + n7.client.validate.ValidationReport.prototype = $p.prototype; + n7.client = n7.client || {}; + n7.client.validate = n7.client.validate || {}; + n7.client.validate.ValidationResult = function(a10, b10, c10, e10, f10, g10, h10) { + var k10 = new eq2(); + eq2.prototype.t7a.call(k10, a10, b10, c10, e10, f10, g10, h10); + return k10; + }; + n7.client.validate.ValidationResult.prototype = eq2.prototype; + n7.ExecutionLog = zq(); + n7.parser = n7.parser || {}; + n7.parser.ParsingOptions = function() { + var a10 = new kp(); + kp.prototype.a.call(a10); + return a10; + }; + n7.parser.ParsingOptions.prototype = kp.prototype; + n7.core = n7.core || {}; + n7.core.Vendor = Xq(); + n7.ResolutionPipeline = Pp(); + n7.core = n7.core || {}; + n7.core.validation = n7.core.validation || {}; + n7.core.validation.SeverityLevels = Yb(); + n7.WebApiParser = n7.WebApiParser || {}; + var Jzb = n7.WebApiParser; + Bva || (Bva = new OH().a()); + Jzb.amfGraph = Bva; + n7.WebApiParser = n7.WebApiParser || {}; + var Kzb = n7.WebApiParser; + Cva || (Cva = new XH().a()); + Kzb.oas20 = Cva; + n7.WebApiParser = n7.WebApiParser || {}; + var Lzb = n7.WebApiParser; + Dva || (Dva = new bI().a()); + Lzb.oas30 = Dva; + n7.WebApiParser = n7.WebApiParser || {}; + var Mzb = n7.WebApiParser; + Eva || (Eva = new gI().a()); + Mzb.raml08 = Eva; + n7.WebApiParser = n7.WebApiParser || {}; + var Nzb = n7.WebApiParser; + Fva || (Fva = new kI().a()); + Nzb.raml10 = Fva; + n7.WebApiParser = n7.WebApiParser || {}; + n7.WebApiParser.init = function() { + return RH().HU(); + }; + n7.client = n7.client || {}; + n7.client.DefaultEnvironment = pp(); + n7.AmfGraphParser = function() { + for (var a10 = new VH(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + VH.prototype.a.call(a10); + break; + case 1: + VH.prototype.Rq.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.AmfGraphParser.prototype = VH.prototype; + n7.Aml10Parser = function() { + for (var a10 = new ML(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + b10 = e10[0]; + ML.prototype.e.call(a10, b10); + break; + case 2: + b10 = e10[0]; + ML.prototype.q7a.call(a10, b10, e10[1]); + break; + case 0: + ML.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Aml10Parser.prototype = ML.prototype; + n7.JsonPayloadParser = function() { + for (var a10 = new NL(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + NL.prototype.Rq.call(a10, e10[0]); + break; + case 0: + NL.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.JsonPayloadParser.prototype = NL.prototype; + n7.Oas20Parser = function() { + for (var a10 = new aI(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + aI.prototype.Rq.call(a10, e10[0]); + break; + case 0: + aI.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Oas20Parser.prototype = aI.prototype; + n7.Oas20YamlParser = function() { + for (var a10 = new ZH(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + ZH.prototype.a.call(a10); + break; + case 1: + ZH.prototype.Rq.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Oas20YamlParser.prototype = ZH.prototype; + n7.Oas30Parser = function() { + for (var a10 = new fI(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + fI.prototype.a.call(a10); + break; + case 1: + fI.prototype.Rq.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Oas30Parser.prototype = fI.prototype; + n7.Oas30YamlParser = function() { + for (var a10 = new dI(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + dI.prototype.Rq.call(a10, e10[0]); + break; + case 0: + dI.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Oas30YamlParser.prototype = dI.prototype; + n7.Raml08Parser = function() { + for (var a10 = new jI(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + jI.prototype.Rq.call(a10, e10[0]); + break; + case 0: + jI.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Raml08Parser.prototype = jI.prototype; + n7.Raml10Parser = function() { + for (var a10 = new nI(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + nI.prototype.a.call(a10); + break; + case 1: + nI.prototype.Rq.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Raml10Parser.prototype = nI.prototype; + n7.RamlParser = function() { + for (var a10 = new PL(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + PL.prototype.a.call(a10); + break; + case 1: + PL.prototype.Rq.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.RamlParser.prototype = PL.prototype; + n7.YamlPayloadParser = function() { + for (var a10 = new QL(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + QL.prototype.Rq.call(a10, e10[0]); + break; + case 0: + QL.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.YamlPayloadParser.prototype = QL.prototype; + n7.AmfGraphRenderer = function() { + var a10 = new SH(); + SH.prototype.a.call(a10); + return a10; + }; + n7.AmfGraphRenderer.prototype = SH.prototype; + n7.Aml10Renderer = function() { + for (var a10 = new UL(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + UL.prototype.e.call(a10, e10[0]); + break; + case 0: + UL.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.Aml10Renderer.prototype = UL.prototype; + n7.JsonPayloadRenderer = function() { + var a10 = new VL(); + VL.prototype.a.call(a10); + return a10; + }; + n7.JsonPayloadRenderer.prototype = VL.prototype; + n7.JsonldRenderer = function() { + var a10 = new WL(); + WL.prototype.a.call(a10); + return a10; + }; + n7.JsonldRenderer.prototype = WL.prototype; + n7.Oas20Renderer = function() { + var a10 = new YH(); + YH.prototype.a.call(a10); + return a10; + }; + n7.Oas20Renderer.prototype = YH.prototype; + n7.Oas30Renderer = function() { + var a10 = new cI(); + cI.prototype.a.call(a10); + return a10; + }; + n7.Oas30Renderer.prototype = cI.prototype; + n7.Raml08Renderer = function() { + var a10 = new hI(); + hI.prototype.a.call(a10); + return a10; + }; + n7.Raml08Renderer.prototype = hI.prototype; + n7.Raml10Renderer = function() { + var a10 = new lI(); + lI.prototype.a.call(a10); + return a10; + }; + n7.Raml10Renderer.prototype = lI.prototype; + n7.YamlPayloadRenderer = function() { + var a10 = new XL(); + XL.prototype.a.call(a10); + return a10; + }; + n7.YamlPayloadRenderer.prototype = XL.prototype; + n7.AmfGraphResolver = function() { + var a10 = new TH(); + TH.prototype.a.call(a10); + return a10; + }; + n7.AmfGraphResolver.prototype = TH.prototype; + n7.Oas20Resolver = function() { + var a10 = new $H(); + $H.prototype.a.call(a10); + return a10; + }; + n7.Oas20Resolver.prototype = $H.prototype; + n7.Oas30Resolver = function() { + var a10 = new eI(); + eI.prototype.a.call(a10); + return a10; + }; + n7.Oas30Resolver.prototype = eI.prototype; + n7.Raml08Resolver = function() { + var a10 = new iI(); + iI.prototype.a.call(a10); + return a10; + }; + n7.Raml08Resolver.prototype = iI.prototype; + n7.Raml10Resolver = function() { + var a10 = new mI(); + mI.prototype.a.call(a10); + return a10; + }; + n7.Raml10Resolver.prototype = mI.prototype; + n7.org = n7.org || {}; + n7.org.yaml = n7.org.yaml || {}; + n7.org.yaml.builder = n7.org.yaml.builder || {}; + n7.org.yaml.builder.JsOutputBuilder = function() { + var a10 = new xS(); + xS.prototype.a.call(a10); + return a10; + }; + n7.org.yaml.builder.JsOutputBuilder.prototype = xS.prototype; + n7.SHACLValidator = function() { + var a10 = new YD(); + YD.prototype.a.call(a10); + return a10; + }; + n7.SHACLValidator.prototype = YD.prototype; + n7.ResourceNotFound = function(a10) { + var b10 = new J1(); + J1.prototype.e.call(b10, a10); + return b10; + }; + n7.ResourceNotFound.prototype = J1.prototype; + n7.ProfileName = function(a10) { + var b10 = new QT(); + QT.prototype.e.call(b10, a10); + return b10; + }; + n7.ProfileName.prototype = QT.prototype; + n7.client = n7.client || {}; + n7.client.environment = n7.client.environment || {}; + n7.client.environment.Environment = function() { + var a10 = new FL(); + FL.prototype.a.call(a10); + return a10; + }; + n7.client.environment.Environment.prototype = FL.prototype; + n7.model = n7.model || {}; + n7.model.Annotations = function() { + var a10 = new Uo(); + Uo.prototype.a.call(a10); + return a10; + }; + n7.model.Annotations.prototype = Uo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Settings = function() { + var a10 = new Pm(); + Pm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Settings.prototype = Pm.prototype; + n7.client = n7.client || {}; + n7.client.remote = n7.client.remote || {}; + n7.client.remote.CachedReference = function(a10, b10, c10) { + var e10 = new H_(); + H_.prototype.r7a.call(e10, a10, b10, !!c10); + return e10; + }; + n7.client.remote.CachedReference.prototype = H_.prototype; + n7.client = n7.client || {}; + n7.client.remote = n7.client.remote || {}; + n7.client.remote.Content = function(a10, b10) { + for (var c10 = new j32(), e10 = arguments.length | 0, f10 = 2, g10 = []; f10 < e10; ) + g10.push(arguments[f10]), f10 = f10 + 1 | 0; + switch (g10.length | 0) { + case 1: + j32.prototype.t1.call(c10, a10, b10, g10[0]); + break; + case 0: + j32.prototype.Hc.call(c10, a10, b10); + break; + default: + throw "No matching overload"; + } + return c10; + }; + n7.client.remote.Content.prototype = j32.prototype; + n7.client = n7.client || {}; + n7.client.plugins = n7.client.plugins || {}; + n7.client.plugins.ValidationCandidate = function(a10, b10) { + var c10 = new B1(); + B1.prototype.X6a.call(c10, a10, b10); + return c10; + }; + n7.client.plugins.ValidationCandidate.prototype = B1.prototype; + n7.client = n7.client || {}; + n7.client.plugins = n7.client.plugins || {}; + n7.client.plugins.ValidationShapeSet = function(a10, b10, c10) { + b10 = new k32(); + k32.prototype.z7a.call(b10, a10, c10); + return b10; + }; + n7.client.plugins.ValidationShapeSet.prototype = k32.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Variable = function(a10, b10) { + var c10 = new o32(); + o32.prototype.Haa.call(c10, a10, b10); + return c10; + }; + n7.model.domain.Variable.prototype = o32.prototype; + n7.core = n7.core || {}; + n7.core.parser = n7.core.parser || {}; + n7.core.parser.Range = function(a10, b10) { + var c10 = new BU(); + BU.prototype.fU.call(c10, a10, b10); + return c10; + }; + n7.core.parser.Range.prototype = BU.prototype; + n7.org = n7.org || {}; + n7.org.mulesoft = n7.org.mulesoft || {}; + n7.org.mulesoft.common = n7.org.mulesoft.common || {}; + n7.org.mulesoft.common.io = n7.org.mulesoft.common.io || {}; + n7.org.mulesoft.common.io.LimitedStringBuffer = function(a10) { + var b10 = new Ip(); + Ip.prototype.ue.call(b10, a10 | 0); + return b10; + }; + n7.org.mulesoft.common.io.LimitedStringBuffer.prototype = Ip.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectFragment = function() { + var a10 = new D52(); + D52.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectFragment.prototype = D52.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectInstanceFragment = function() { + var a10 = new H5(); + H5.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectInstanceFragment.prototype = H5.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectInstanceLibrary = function() { + var a10 = new J52(); + J52.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectInstanceLibrary.prototype = J52.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectLibrary = function() { + var a10 = new K5(); + K5.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectLibrary.prototype = K5.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.Vocabulary = function() { + var a10 = new M52(); + M52.prototype.a.call(a10); + return a10; + }; + n7.model.document.Vocabulary.prototype = M52.prototype; + n7.core = n7.core || {}; + n7.core.parser = n7.core.parser || {}; + n7.core.parser.Position = function(a10, b10) { + var c10 = new CU(); + CU.prototype.Sc.call(c10, a10 | 0, b10 | 0); + return c10; + }; + n7.core.parser.Position.prototype = CU.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectInstance = function() { + var a10 = new T62(); + T62.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectInstance.prototype = T62.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.DialectInstancePatch = function() { + var a10 = new U62(); + U62.prototype.a.call(a10); + return a10; + }; + n7.model.document.DialectInstancePatch.prototype = U62.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.Document = function() { + for (var a10 = new Ik(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Ik.prototype.R$.call(a10, e10[0]); + break; + case 0: + Ik.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.document.Document.prototype = Ik.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.AbstractDeclaration = function(a10) { + var b10 = new V6(); + V6.prototype.$$.call(b10, a10); + return b10; + }; + n7.model.domain.AbstractDeclaration.prototype = V6.prototype; + n7.JsBrowserHttpResourceLoader = function() { + var a10 = new g22(); + g22.prototype.a.call(a10); + return a10; + }; + n7.JsBrowserHttpResourceLoader.prototype = g22.prototype; + n7.JsServerFileResourceLoader = function() { + var a10 = new h22(); + h22.prototype.a.call(a10); + return a10; + }; + n7.JsServerFileResourceLoader.prototype = h22.prototype; + n7.JsServerHttpResourceLoader = function() { + var a10 = new i22(); + i22.prototype.a.call(a10); + return a10; + }; + n7.JsServerHttpResourceLoader.prototype = i22.prototype; + n7.org = n7.org || {}; + n7.org.mulesoft = n7.org.mulesoft || {}; + n7.org.mulesoft.common = n7.org.mulesoft.common || {}; + n7.org.mulesoft.common.io = n7.org.mulesoft.common.io || {}; + n7.org.mulesoft.common.io.LimitReachedException = function() { + var a10 = new M42(); + M42.prototype.a.call(a10); + return a10; + }; + n7.org.mulesoft.common.io.LimitReachedException.prototype = M42.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.AnyShape = function() { + var a10 = new Xm(); + Xm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.AnyShape.prototype = Xm.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiVocabulary = function() { + for (var a10 = new X7(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + X7.prototype.TG.call(a10, e10[0]); + break; + case 0: + X7.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiVocabulary.prototype = X7.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ClassTerm = function() { + var a10 = new n8(); + n8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ClassTerm.prototype = n8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.CreativeWork = function() { + var a10 = new dn(); + dn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.CreativeWork.prototype = dn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DialectDomainElement = function() { + var a10 = new I52(); + I52.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DialectDomainElement.prototype = I52.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DocumentMapping = function() { + var a10 = new q8(); + q8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DocumentMapping.prototype = q8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DocumentsModel = function() { + var a10 = new r82(); + r82.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DocumentsModel.prototype = r82.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DomainExtension = function() { + for (var a10 = new Uk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + Uk.prototype.a.call(a10); + break; + case 1: + Uk.prototype.cE.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.DomainExtension.prototype = Uk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Encoding = function() { + var a10 = new fm(); + fm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Encoding.prototype = fm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.External = function() { + var a10 = new t8(); + t8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.External.prototype = t8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ExternalDomainElement = function() { + for (var a10 = new Qk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + Qk.prototype.a.call(a10); + break; + case 1: + Qk.prototype.V$.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.ExternalDomainElement.prototype = Qk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.IriTemplateMapping = function() { + var a10 = new In(); + In.prototype.a.call(a10); + return a10; + }; + n7.model.domain.IriTemplateMapping.prototype = In.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.MqttServerLastWill = function() { + var a10 = new zo(); + zo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.MqttServerLastWill.prototype = zo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.NodeMapping = function() { + var a10 = new G52(); + G52.prototype.a.call(a10); + return a10; + }; + n7.model.domain.NodeMapping.prototype = G52.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.OAuth2Flow = function() { + var a10 = new Mm(); + Mm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.OAuth2Flow.prototype = Mm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ParametrizedSecurityScheme = function() { + var a10 = new km(); + km.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ParametrizedSecurityScheme.prototype = km.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.PropertyDependencies = function() { + var a10 = new wn(); + wn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.PropertyDependencies.prototype = wn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.PropertyMapping = function() { + var a10 = new u8(); + u8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.PropertyMapping.prototype = u8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.PublicNodeMapping = function() { + var a10 = new v8(); + v8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.PublicNodeMapping.prototype = v8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Scope = function() { + var a10 = new Im(); + Im.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Scope.prototype = Im.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.SecurityRequirement = function() { + var a10 = new um(); + um.prototype.a.call(a10); + return a10; + }; + n7.model.domain.SecurityRequirement.prototype = um.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Server = function() { + var a10 = new $l(); + $l.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Server.prototype = $l.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ShapeExtension = function() { + for (var a10 = new v1(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + v1.prototype.a.call(a10); + break; + case 1: + v1.prototype.Z$.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.ShapeExtension.prototype = v1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.VocabularyReference = function() { + var a10 = new y8(); + y8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.VocabularyReference.prototype = y8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.XMLSerializer = function() { + var a10 = new tn(); + tn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.XMLSerializer.prototype = tn.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiDocument = function() { + for (var a10 = new B8(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + if (e10[0] instanceof mf) + b10 = e10[0], B8.prototype.Xz.call(a10, b10); + else if (HLa(e10[0])) + b10 = e10[0], B8.prototype.R$.call(a10, b10); + else + throw "No matching overload"; + break; + case 0: + B8.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiDocument.prototype = B8.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.Module = function() { + for (var a10 = new Fk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Fk.prototype.RG.call(a10, e10[0]); + break; + case 0: + Fk.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.document.Module.prototype = Fk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Amqp091ChannelExchange = function() { + var a10 = new Sn(); + Sn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Amqp091ChannelExchange.prototype = Sn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Amqp091Queue = function() { + var a10 = new Vn(); + Vn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Amqp091Queue.prototype = Vn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ApiKeySettings = function() { + var a10 = new g1(); + g1.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ApiKeySettings.prototype = g1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ArrayNode = function() { + for (var a10 = new cl(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + cl.prototype.aU.call(a10, e10[0]); + break; + case 0: + cl.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.ArrayNode.prototype = cl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Callback = function() { + var a10 = new cm(); + cm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Callback.prototype = cm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.CustomDomainProperty = function() { + for (var a10 = new Tk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Tk.prototype.HO.call(a10, e10[0]); + break; + case 0: + Tk.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.CustomDomainProperty.prototype = Tk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DatatypePropertyTerm = function() { + var a10 = new T8(); + T8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DatatypePropertyTerm.prototype = T8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.EndPoint = function() { + var a10 = new Ll(); + Ll.prototype.a.call(a10); + return a10; + }; + n7.model.domain.EndPoint.prototype = Ll.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.HttpSettings = function() { + var a10 = new i1(); + i1.prototype.a.call(a10); + return a10; + }; + n7.model.domain.HttpSettings.prototype = i1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.License = function() { + var a10 = new Ol(); + Ol.prototype.a.call(a10); + return a10; + }; + n7.model.domain.License.prototype = Ol.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.OAuth1Settings = function() { + var a10 = new k1(); + k1.prototype.a.call(a10); + return a10; + }; + n7.model.domain.OAuth1Settings.prototype = k1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.OAuth2Settings = function() { + var a10 = new m1(); + m1.prototype.a.call(a10); + return a10; + }; + n7.model.domain.OAuth2Settings.prototype = m1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ObjectNode = function() { + for (var a10 = new Yk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Yk.prototype.aE.call(a10, e10[0]); + break; + case 0: + Yk.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.ObjectNode.prototype = Yk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ObjectPropertyTerm = function() { + var a10 = new V8(); + V8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ObjectPropertyTerm.prototype = V8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.OpenIdConnectSettings = function() { + var a10 = new o1(); + o1.prototype.a.call(a10); + return a10; + }; + n7.model.domain.OpenIdConnectSettings.prototype = o1.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Organization = function() { + var a10 = new Vl(); + Vl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Organization.prototype = Vl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Parameter = function() { + var a10 = new Xl(); + Xl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Parameter.prototype = Xl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Payload = function() { + var a10 = new zm(); + zm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Payload.prototype = zm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ScalarNode = function() { + for (var a10 = new Zk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 2: + b10 = e10[0]; + Zk.prototype.Hc.call(a10, b10, e10[1]); + break; + case 1: + b10 = e10[0]; + Zk.prototype.GO.call(a10, b10); + break; + case 0: + Zk.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.ScalarNode.prototype = Zk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.SecurityScheme = function() { + var a10 = new wm(); + wm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.SecurityScheme.prototype = wm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Tag = function() { + var a10 = new X8(); + X8.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Tag.prototype = X8.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.TemplatedLink = function() { + var a10 = new Cn(); + Cn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.TemplatedLink.prototype = Cn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.WebApi = function() { + var a10 = new Sm(); + Sm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.WebApi.prototype = Sm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.AnnotationTypeDeclaration = function() { + var a10 = new pl(); + pl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.AnnotationTypeDeclaration.prototype = pl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DataType = function() { + var a10 = new rl(); + rl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DataType.prototype = rl.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.Dialect = function() { + var a10 = new $32(); + $32.prototype.a.call(a10); + return a10; + }; + n7.model.document.Dialect.prototype = $32.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DocumentationItem = function() { + var a10 = new wl(); + wl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DocumentationItem.prototype = wl.prototype; + n7.model = n7.model || {}; + n7.model.document = n7.model.document || {}; + n7.model.document.ExternalFragment = function() { + for (var a10 = new Nk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + Nk.prototype.a.call(a10); + break; + case 1: + Nk.prototype.QG.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.document.ExternalFragment.prototype = Nk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.NamedExample = function() { + var a10 = new yl(); + yl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.NamedExample.prototype = yl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.PayloadFragment = function(a10, b10) { + var c10 = new ul(); + if (a10 instanceof Zk) + ul.prototype.T$.call(c10, a10, b10); + else if (a10 instanceof Yk) + ul.prototype.S$.call(c10, a10, b10); + else if (a10 instanceof cl) + ul.prototype.Q$.call(c10, a10, b10); + else + throw "No matching overload"; + return c10; + }; + n7.model.domain.PayloadFragment.prototype = ul.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ResourceTypeFragment = function() { + var a10 = new Al(); + Al.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ResourceTypeFragment.prototype = Al.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.SecuritySchemeFragment = function() { + var a10 = new Cl(); + Cl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.SecuritySchemeFragment.prototype = Cl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.TraitFragment = function() { + var a10 = new El(); + El.prototype.a.call(a10); + return a10; + }; + n7.model.domain.TraitFragment.prototype = El.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Amqp091OperationBinding = function() { + var a10 = new co(); + co.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Amqp091OperationBinding.prototype = co.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.CorrelationId = function() { + var a10 = new Mn(); + Mn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.CorrelationId.prototype = Mn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Example = function() { + var a10 = new fn(); + fn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Example.prototype = fn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Operation = function() { + var a10 = new Sl(); + Sl.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Operation.prototype = Sl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ParametrizedResourceType = function() { + var a10 = new gm(); + gm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ParametrizedResourceType.prototype = gm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ParametrizedTrait = function() { + var a10 = new hm(); + hm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ParametrizedTrait.prototype = hm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Extension = function() { + for (var a10 = new Gl(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Gl.prototype.UG.call(a10, e10[0]); + break; + case 0: + Gl.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.Extension.prototype = Gl.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Overlay = function() { + for (var a10 = new Il(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + Il.prototype.VG.call(a10, e10[0]); + break; + case 0: + Il.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.Overlay.prototype = Il.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Amqp091ChannelBinding = function() { + var a10 = new Pn(); + Pn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Amqp091ChannelBinding.prototype = Pn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Amqp091MessageBinding = function() { + var a10 = new Yn(); + Yn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Amqp091MessageBinding.prototype = Yn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.HttpMessageBinding = function() { + var a10 = new go(); + go.prototype.a.call(a10); + return a10; + }; + n7.model.domain.HttpMessageBinding.prototype = go.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.HttpOperationBinding = function() { + var a10 = new jo(); + jo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.HttpOperationBinding.prototype = jo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.KafkaMessageBinding = function() { + var a10 = new lo(); + lo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.KafkaMessageBinding.prototype = lo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.KafkaOperationBinding = function() { + var a10 = new oo(); + oo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.KafkaOperationBinding.prototype = oo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.MqttMessageBinding = function() { + var a10 = new qo(); + qo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.MqttMessageBinding.prototype = qo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.MqttOperationBinding = function() { + var a10 = new to(); + to.prototype.a.call(a10); + return a10; + }; + n7.model.domain.MqttOperationBinding.prototype = to.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.MqttServerBinding = function() { + var a10 = new wo(); + wo.prototype.a.call(a10); + return a10; + }; + n7.model.domain.MqttServerBinding.prototype = wo.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.PropertyShape = function() { + for (var a10 = new Wk(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + Wk.prototype.a.call(a10); + break; + case 1: + Wk.prototype.Y$.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.model.domain.PropertyShape.prototype = Wk.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.RecursiveShape = function(a10) { + var b10 = new zn(); + zn.prototype.ela.call(b10, a10); + return b10; + }; + n7.model.domain.RecursiveShape.prototype = zn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Request = function() { + var a10 = new Cm(); + Cm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Request.prototype = Cm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ResourceType = function() { + var a10 = new Wm(); + Wm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ResourceType.prototype = Wm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Response = function() { + var a10 = new Fm(); + Fm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Response.prototype = Fm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.Trait = function() { + var a10 = new Um(); + Um.prototype.a.call(a10); + return a10; + }; + n7.model.domain.Trait.prototype = Um.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.WebSocketsChannelBinding = function() { + var a10 = new Co(); + Co.prototype.a.call(a10); + return a10; + }; + n7.model.domain.WebSocketsChannelBinding.prototype = Co.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiModule = function() { + for (var a10 = new m9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + m9.prototype.RG.call(a10, e10[0]); + break; + case 0: + m9.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiModule.prototype = m9.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.FileShape = function() { + var a10 = new mn(); + mn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.FileShape.prototype = mn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.NilShape = function() { + var a10 = new Ym(); + Ym.prototype.a.call(a10); + return a10; + }; + n7.model.domain.NilShape.prototype = Ym.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.NodeShape = function() { + var a10 = new nn(); + nn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.NodeShape.prototype = nn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ScalarShape = function() { + var a10 = new on4(); + on4.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ScalarShape.prototype = on4.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.SchemaShape = function() { + var a10 = new qn(); + qn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.SchemaShape.prototype = qn.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.UnionShape = function() { + var a10 = new yn(); + yn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.UnionShape.prototype = yn.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiAnnotationTypeDeclaration = function() { + for (var a10 = new p9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + p9.prototype.LK.call(a10, e10[0]); + break; + case 0: + p9.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiAnnotationTypeDeclaration.prototype = p9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiDataType = function() { + for (var a10 = new q9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + q9.prototype.a.call(a10); + break; + case 1: + q9.prototype.MK.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiDataType.prototype = q9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiDocumentationItem = function() { + for (var a10 = new r9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + r9.prototype.a.call(a10); + break; + case 1: + r9.prototype.NK.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiDocumentationItem.prototype = r9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiExternalFragment = function() { + for (var a10 = new s9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + s9.prototype.a.call(a10); + break; + case 1: + s9.prototype.QG.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiExternalFragment.prototype = s9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiNamedExample = function() { + for (var a10 = new t9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + t9.prototype.OK.call(a10, e10[0]); + break; + case 0: + t9.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiNamedExample.prototype = t9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiPayloadFragment = function(a10) { + for (var b10 = new u9(), c10 = arguments.length | 0, e10 = 1, f10 = []; e10 < c10; ) + f10.push(arguments[e10]), e10 = e10 + 1 | 0; + switch (f10.length | 0) { + case 0: + u9.prototype.Yz.call(b10, a10); + break; + case 1: + if (a10 instanceof Zk) + c10 = f10[0], u9.prototype.T$.call(b10, a10, c10); + else if (a10 instanceof Yk) + c10 = f10[0], u9.prototype.S$.call(b10, a10, c10); + else if (a10 instanceof cl) + c10 = f10[0], u9.prototype.Q$.call(b10, a10, c10); + else + throw "No matching overload"; + break; + default: + throw "No matching overload"; + } + return b10; + }; + n7.webapi.WebApiPayloadFragment.prototype = u9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiResourceTypeFragment = function() { + for (var a10 = new v9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + v9.prototype.PK.call(a10, e10[0]); + break; + case 0: + v9.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiResourceTypeFragment.prototype = v9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiSecuritySchemeFragment = function() { + for (var a10 = new w9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + w9.prototype.a.call(a10); + break; + case 1: + w9.prototype.QK.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiSecuritySchemeFragment.prototype = w9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiTraitFragment = function() { + for (var a10 = new x9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + x9.prototype.a.call(a10); + break; + case 1: + x9.prototype.RK.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiTraitFragment.prototype = x9.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.ArrayShape = function() { + var a10 = new Zm(); + Zm.prototype.a.call(a10); + return a10; + }; + n7.model.domain.ArrayShape.prototype = Zm.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.DynamicBinding = function() { + var a10 = new Go(); + Go.prototype.a.call(a10); + return a10; + }; + n7.model.domain.DynamicBinding.prototype = Go.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.EmptyBinding = function() { + var a10 = new Io(); + Io.prototype.a.call(a10); + return a10; + }; + n7.model.domain.EmptyBinding.prototype = Io.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.TupleShape = function() { + var a10 = new bn(); + bn.prototype.a.call(a10); + return a10; + }; + n7.model.domain.TupleShape.prototype = bn.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiExtension = function() { + for (var a10 = new P9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 1: + P9.prototype.UG.call(a10, e10[0]); + break; + case 0: + P9.prototype.a.call(a10); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiExtension.prototype = P9.prototype; + n7.webapi = n7.webapi || {}; + n7.webapi.WebApiOverlay = function() { + for (var a10 = new Q9(), b10 = arguments.length | 0, c10 = 0, e10 = []; c10 < b10; ) + e10.push(arguments[c10]), c10 = c10 + 1 | 0; + switch (e10.length | 0) { + case 0: + Q9.prototype.a.call(a10); + break; + case 1: + Q9.prototype.VG.call(a10, e10[0]); + break; + default: + throw "No matching overload"; + } + return a10; + }; + n7.webapi.WebApiOverlay.prototype = Q9.prototype; + n7.model = n7.model || {}; + n7.model.domain = n7.model.domain || {}; + n7.model.domain.MatrixShape = function() { + var a10 = new $m(); + $m.prototype.a.call(a10); + return a10; + }; + n7.model.domain.MatrixShape.prototype = $m.prototype; + } +}); + +// node_modules/ramldt2jsonschema/src/utils.js +var require_utils9 = __commonJS({ + "node_modules/ramldt2jsonschema/src/utils.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var url = (init_url(), __toCommonJS(url_exports)); + function basePathToURL(basePath, ext) { + if (!basePath.endsWith(`.${ext}`)) { + basePath = path2.join(basePath, `basepath_default_doc.${ext}`); + } + return url.pathToFileURL(basePath.replace(/\\/g, "/")).href; + } + function validateDraft(draft) { + const supportedDrafts = ["04", "06", "07"]; + if (supportedDrafts.indexOf(draft) < 0) { + throw new Error( + `Unsupported draft version. Supported versions are: ${supportedDrafts}` + ); + } + } + module5.exports = { + basePathToURL, + validateDraft, + DEFAULT_DRAFT: "07" + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/fast-deep-equal/index.js +var require_fast_deep_equal3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/fast-deep-equal/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var isArray3 = Array.isArray; + var keyList = Object.keys; + var hasProp = Object.prototype.hasOwnProperty; + module5.exports = function equal2(a7, b8) { + if (a7 === b8) + return true; + var arrA = isArray3(a7), arrB = isArray3(b8), i7, length, key; + if (arrA && arrB) { + length = a7.length; + if (length != b8.length) + return false; + for (i7 = 0; i7 < length; i7++) + if (!equal2(a7[i7], b8[i7])) + return false; + return true; + } + if (arrA != arrB) + return false; + var dateA = a7 instanceof Date, dateB = b8 instanceof Date; + if (dateA != dateB) + return false; + if (dateA && dateB) + return a7.getTime() == b8.getTime(); + var regexpA = a7 instanceof RegExp, regexpB = b8 instanceof RegExp; + if (regexpA != regexpB) + return false; + if (regexpA && regexpB) + return a7.toString() == b8.toString(); + if (a7 instanceof Object && b8 instanceof Object) { + var keys2 = keyList(a7); + length = keys2.length; + if (length !== keyList(b8).length) + return false; + for (i7 = 0; i7 < length; i7++) + if (!hasProp.call(b8, keys2[i7])) + return false; + for (i7 = 0; i7 < length; i7++) { + key = keys2[i7]; + if (!equal2(a7[key], b8[key])) + return false; + } + return true; + } + return false; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/ucs2length.js +var require_ucs2length3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/ucs2length.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function ucs2length(str2) { + var length = 0, len = str2.length, pos = 0, value2; + while (pos < len) { + length++; + value2 = str2.charCodeAt(pos++); + if (value2 >= 55296 && value2 <= 56319 && pos < len) { + value2 = str2.charCodeAt(pos); + if ((value2 & 64512) == 56320) + pos++; + } + } + return length; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/util.js +var require_util4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/util.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + copy: copy4, + checkDataType, + checkDataTypes, + coerceToTypes, + toHash, + getProperty, + escapeQuotes, + equal: require_fast_deep_equal3(), + ucs2length: require_ucs2length3(), + varOccurences, + varReplace, + cleanUpCode, + finalCleanUpCode, + schemaHasRules, + schemaHasRulesExcept, + toQuotedString, + getPathExpr, + getPath, + getData: getData2, + unescapeFragment, + unescapeJsonPointer, + escapeFragment, + escapeJsonPointer + }; + function copy4(o7, to) { + to = to || {}; + for (var key in o7) + to[key] = o7[key]; + return to; + } + function checkDataType(dataType, data, negate2) { + var EQUAL = negate2 ? " !== " : " === ", AND = negate2 ? " || " : " && ", OK2 = negate2 ? "!" : "", NOT = negate2 ? "" : "!"; + switch (dataType) { + case "null": + return data + EQUAL + "null"; + case "array": + return OK2 + "Array.isArray(" + data + ")"; + case "object": + return "(" + OK2 + data + AND + "typeof " + data + EQUAL + '"object"' + AND + NOT + "Array.isArray(" + data + "))"; + case "integer": + return "(typeof " + data + EQUAL + '"number"' + AND + NOT + "(" + data + " % 1)" + AND + data + EQUAL + data + ")"; + default: + return "typeof " + data + EQUAL + '"' + dataType + '"'; + } + } + function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: + return checkDataType(dataTypes[0], data, true); + default: + var code = ""; + var types3 = toHash(dataTypes); + if (types3.array && types3.object) { + code = types3.null ? "(" : "(!" + data + " || "; + code += "typeof " + data + ' !== "object")'; + delete types3.null; + delete types3.array; + delete types3.object; + } + if (types3.number) + delete types3.integer; + for (var t8 in types3) + code += (code ? " && " : "") + checkDataType(t8, data, true); + return code; + } + } + var COERCE_TO_TYPES = toHash(["string", "number", "integer", "boolean", "null"]); + function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types3 = []; + for (var i7 = 0; i7 < dataTypes.length; i7++) { + var t8 = dataTypes[i7]; + if (COERCE_TO_TYPES[t8]) + types3[types3.length] = t8; + else if (optionCoerceTypes === "array" && t8 === "array") + types3[types3.length] = t8; + } + if (types3.length) + return types3; + } else if (COERCE_TO_TYPES[dataTypes]) { + return [dataTypes]; + } else if (optionCoerceTypes === "array" && dataTypes === "array") { + return ["array"]; + } + } + function toHash(arr) { + var hash = {}; + for (var i7 = 0; i7 < arr.length; i7++) + hash[arr[i7]] = true; + return hash; + } + var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; + var SINGLE_QUOTE = /'|\\/g; + function getProperty(key) { + return typeof key == "number" ? "[" + key + "]" : IDENTIFIER.test(key) ? "." + key : "['" + escapeQuotes(key) + "']"; + } + function escapeQuotes(str2) { + return str2.replace(SINGLE_QUOTE, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t"); + } + function varOccurences(str2, dataVar) { + dataVar += "[^0-9]"; + var matches2 = str2.match(new RegExp(dataVar, "g")); + return matches2 ? matches2.length : 0; + } + function varReplace(str2, dataVar, expr) { + dataVar += "([^0-9])"; + expr = expr.replace(/\$/g, "$$$$"); + return str2.replace(new RegExp(dataVar, "g"), expr + "$1"); + } + var EMPTY_ELSE = /else\s*{\s*}/g; + var EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g; + var EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g; + function cleanUpCode(out) { + return out.replace(EMPTY_ELSE, "").replace(EMPTY_IF_NO_ELSE, "").replace(EMPTY_IF_WITH_ELSE, "if (!($1))"); + } + var ERRORS_REGEXP = /[^v.]errors/g; + var REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g; + var REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g; + var RETURN_VALID = "return errors === 0;"; + var RETURN_TRUE = "validate.errors = null; return true;"; + var RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/; + var RETURN_DATA_ASYNC = "return data;"; + var ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g; + var REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; + function finalCleanUpCode(out, async) { + var matches2 = out.match(ERRORS_REGEXP); + if (matches2 && matches2.length == 2) { + out = async ? out.replace(REMOVE_ERRORS_ASYNC, "").replace(RETURN_ASYNC, RETURN_DATA_ASYNC) : out.replace(REMOVE_ERRORS, "").replace(RETURN_VALID, RETURN_TRUE); + } + matches2 = out.match(ROOTDATA_REGEXP); + if (!matches2 || matches2.length !== 3) + return out; + return out.replace(REMOVE_ROOTDATA, ""); + } + function schemaHasRules(schema8, rules) { + if (typeof schema8 == "boolean") + return !schema8; + for (var key in schema8) + if (rules[key]) + return true; + } + function schemaHasRulesExcept(schema8, rules, exceptKeyword) { + if (typeof schema8 == "boolean") + return !schema8 && exceptKeyword != "not"; + for (var key in schema8) + if (key != exceptKeyword && rules[key]) + return true; + } + function toQuotedString(str2) { + return "'" + escapeQuotes(str2) + "'"; + } + function getPathExpr(currentPath, expr, jsonPointers, isNumber3) { + var path2 = jsonPointers ? "'/' + " + expr + (isNumber3 ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber3 ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"; + return joinPaths(currentPath, path2); + } + function getPath(currentPath, prop, jsonPointers) { + var path2 = jsonPointers ? toQuotedString("/" + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); + return joinPaths(currentPath, path2); + } + var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; + var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; + function getData2($data, lvl, paths) { + var up, jsonPointer, data, matches2; + if ($data === "") + return "rootData"; + if ($data[0] == "/") { + if (!JSON_POINTER.test($data)) + throw new Error("Invalid JSON-pointer: " + $data); + jsonPointer = $data; + data = "rootData"; + } else { + matches2 = $data.match(RELATIVE_JSON_POINTER); + if (!matches2) + throw new Error("Invalid JSON-pointer: " + $data); + up = +matches2[1]; + jsonPointer = matches2[2]; + if (jsonPointer == "#") { + if (up >= lvl) + throw new Error("Cannot access property/index " + up + " levels up, current level is " + lvl); + return paths[lvl - up]; + } + if (up > lvl) + throw new Error("Cannot access data " + up + " levels up, current level is " + lvl); + data = "data" + (lvl - up || ""); + if (!jsonPointer) + return data; + } + var expr = data; + var segments = jsonPointer.split("/"); + for (var i7 = 0; i7 < segments.length; i7++) { + var segment = segments[i7]; + if (segment) { + data += getProperty(unescapeJsonPointer(segment)); + expr += " && " + data; + } + } + return expr; + } + function joinPaths(a7, b8) { + if (a7 == '""') + return b8; + return (a7 + " + " + b8).replace(/' \+ '/g, ""); + } + function unescapeFragment(str2) { + return unescapeJsonPointer(decodeURIComponent(str2)); + } + function escapeFragment(str2) { + return encodeURIComponent(escapeJsonPointer(str2)); + } + function escapeJsonPointer(str2) { + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + function unescapeJsonPointer(str2) { + return str2.replace(/~1/g, "/").replace(/~0/g, "~"); + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/schema_obj.js +var require_schema_obj2 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/schema_obj.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = require_util4(); + module5.exports = SchemaObject; + function SchemaObject(obj) { + util2.copy(obj, this); + } + } +}); + +// node_modules/json-schema-migrate/node_modules/json-schema-traverse/index.js +var require_json_schema_traverse3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/json-schema-traverse/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var traverse4 = module5.exports = function(schema8, opts, cb) { + if (typeof opts == "function") { + cb = opts; + opts = {}; + } + _traverse(opts, cb, schema8, "", schema8); + }; + traverse4.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true + }; + traverse4.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true + }; + traverse4.propsKeywords = { + definitions: true, + properties: true, + patternProperties: true, + dependencies: true + }; + traverse4.skipKeywords = { + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true + }; + function _traverse(opts, cb, schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema8 && typeof schema8 == "object" && !Array.isArray(schema8)) { + cb(schema8, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema8) { + var sch = schema8[key]; + if (Array.isArray(sch)) { + if (key in traverse4.arrayKeywords) { + for (var i7 = 0; i7 < sch.length; i7++) + _traverse(opts, cb, sch[i7], jsonPtr + "/" + key + "/" + i7, rootSchema, jsonPtr, key, schema8, i7); + } + } else if (key in traverse4.propsKeywords) { + if (sch && typeof sch == "object") { + for (var prop in sch) + _traverse(opts, cb, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema8, prop); + } + } else if (key in traverse4.keywords || opts.allKeys && !(key in traverse4.skipKeywords)) { + _traverse(opts, cb, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema8); + } + } + } + } + function escapeJsonPtr(str2) { + return str2.replace(/~/g, "~0").replace(/\//g, "~1"); + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/resolve.js +var require_resolve3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/resolve.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var url = (init_url(), __toCommonJS(url_exports)); + var equal2 = require_fast_deep_equal3(); + var util2 = require_util4(); + var SchemaObject = require_schema_obj2(); + var traverse4 = require_json_schema_traverse3(); + module5.exports = resolve3; + resolve3.normalizeId = normalizeId; + resolve3.fullPath = getFullPath; + resolve3.url = resolveUrl; + resolve3.ids = resolveIds; + resolve3.inlineRef = inlineRef; + resolve3.schema = resolveSchema; + function resolve3(compile, root2, ref) { + var refVal = this._refs[ref]; + if (typeof refVal == "string") { + if (this._refs[refVal]) + refVal = this._refs[refVal]; + else + return resolve3.call(this, compile, root2, refVal); + } + refVal = refVal || this._schemas[ref]; + if (refVal instanceof SchemaObject) { + return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); + } + var res = resolveSchema.call(this, root2, ref); + var schema8, v8, baseId; + if (res) { + schema8 = res.schema; + root2 = res.root; + baseId = res.baseId; + } + if (schema8 instanceof SchemaObject) { + v8 = schema8.validate || compile.call(this, schema8.schema, root2, void 0, baseId); + } else if (schema8 !== void 0) { + v8 = inlineRef(schema8, this._opts.inlineRefs) ? schema8 : compile.call(this, schema8, root2, void 0, baseId); + } + return v8; + } + function resolveSchema(root2, ref) { + var p7 = url.parse(ref, false, true), refPath = _getFullPath(p7), baseId = getFullPath(this._getId(root2.schema)); + if (refPath !== baseId) { + var id = normalizeId(refPath); + var refVal = this._refs[id]; + if (typeof refVal == "string") { + return resolveRecursive.call(this, root2, refVal, p7); + } else if (refVal instanceof SchemaObject) { + if (!refVal.validate) + this._compile(refVal); + root2 = refVal; + } else { + refVal = this._schemas[id]; + if (refVal instanceof SchemaObject) { + if (!refVal.validate) + this._compile(refVal); + if (id == normalizeId(ref)) + return { schema: refVal, root: root2, baseId }; + root2 = refVal; + } else { + return; + } + } + if (!root2.schema) + return; + baseId = getFullPath(this._getId(root2.schema)); + } + return getJsonPointer.call(this, p7, baseId, root2.schema, root2); + } + function resolveRecursive(root2, ref, parsedRef) { + var res = resolveSchema.call(this, root2, ref); + if (res) { + var schema8 = res.schema; + var baseId = res.baseId; + root2 = res.root; + var id = this._getId(schema8); + if (id) + baseId = resolveUrl(baseId, id); + return getJsonPointer.call(this, parsedRef, baseId, schema8, root2); + } + } + var PREVENT_SCOPE_CHANGE = util2.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]); + function getJsonPointer(parsedRef, baseId, schema8, root2) { + parsedRef.hash = parsedRef.hash || ""; + if (parsedRef.hash.slice(0, 2) != "#/") + return; + var parts = parsedRef.hash.split("/"); + for (var i7 = 1; i7 < parts.length; i7++) { + var part = parts[i7]; + if (part) { + part = util2.unescapeFragment(part); + schema8 = schema8[part]; + if (schema8 === void 0) + break; + var id; + if (!PREVENT_SCOPE_CHANGE[part]) { + id = this._getId(schema8); + if (id) + baseId = resolveUrl(baseId, id); + if (schema8.$ref) { + var $ref = resolveUrl(baseId, schema8.$ref); + var res = resolveSchema.call(this, root2, $ref); + if (res) { + schema8 = res.schema; + root2 = res.root; + baseId = res.baseId; + } + } + } + } + } + if (schema8 !== void 0 && schema8 !== root2.schema) + return { schema: schema8, root: root2, baseId }; + } + var SIMPLE_INLINED = util2.toHash([ + "type", + "format", + "pattern", + "maxLength", + "minLength", + "maxProperties", + "minProperties", + "maxItems", + "minItems", + "maximum", + "minimum", + "uniqueItems", + "multipleOf", + "required", + "enum" + ]); + function inlineRef(schema8, limit) { + if (limit === false) + return false; + if (limit === void 0 || limit === true) + return checkNoRef(schema8); + else if (limit) + return countKeys(schema8) <= limit; + } + function checkNoRef(schema8) { + var item; + if (Array.isArray(schema8)) { + for (var i7 = 0; i7 < schema8.length; i7++) { + item = schema8[i7]; + if (typeof item == "object" && !checkNoRef(item)) + return false; + } + } else { + for (var key in schema8) { + if (key == "$ref") + return false; + item = schema8[key]; + if (typeof item == "object" && !checkNoRef(item)) + return false; + } + } + return true; + } + function countKeys(schema8) { + var count2 = 0, item; + if (Array.isArray(schema8)) { + for (var i7 = 0; i7 < schema8.length; i7++) { + item = schema8[i7]; + if (typeof item == "object") + count2 += countKeys(item); + if (count2 == Infinity) + return Infinity; + } + } else { + for (var key in schema8) { + if (key == "$ref") + return Infinity; + if (SIMPLE_INLINED[key]) { + count2++; + } else { + item = schema8[key]; + if (typeof item == "object") + count2 += countKeys(item) + 1; + if (count2 == Infinity) + return Infinity; + } + } + } + return count2; + } + function getFullPath(id, normalize2) { + if (normalize2 !== false) + id = normalizeId(id); + var p7 = url.parse(id, false, true); + return _getFullPath(p7); + } + function _getFullPath(p7) { + var protocolSeparator = p7.protocol || p7.href.slice(0, 2) == "//" ? "//" : ""; + return (p7.protocol || "") + protocolSeparator + (p7.host || "") + (p7.path || "") + "#"; + } + var TRAILING_SLASH_HASH = /#\/?$/; + function normalizeId(id) { + return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; + } + function resolveUrl(baseId, id) { + id = normalizeId(id); + return url.resolve(baseId, id); + } + function resolveIds(schema8) { + var schemaId = normalizeId(this._getId(schema8)); + var baseIds = { "": schemaId }; + var fullPaths = { "": getFullPath(schemaId, false) }; + var localRefs = {}; + var self2 = this; + traverse4(schema8, { allKeys: true }, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (jsonPtr === "") + return; + var id = self2._getId(sch); + var baseId = baseIds[parentJsonPtr]; + var fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword; + if (keyIndex !== void 0) + fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util2.escapeFragment(keyIndex)); + if (typeof id == "string") { + id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id); + var refVal = self2._refs[id]; + if (typeof refVal == "string") + refVal = self2._refs[refVal]; + if (refVal && refVal.schema) { + if (!equal2(sch, refVal.schema)) + throw new Error('id "' + id + '" resolves to more than one schema'); + } else if (id != normalizeId(fullPath)) { + if (id[0] == "#") { + if (localRefs[id] && !equal2(sch, localRefs[id])) + throw new Error('id "' + id + '" resolves to more than one schema'); + localRefs[id] = sch; + } else { + self2._refs[id] = fullPath; + } + } + } + baseIds[jsonPtr] = baseId; + fullPaths[jsonPtr] = fullPath; + }); + return localRefs; + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/error_classes.js +var require_error_classes2 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/error_classes.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var resolve3 = require_resolve3(); + module5.exports = { + Validation: errorSubclass(ValidationError), + MissingRef: errorSubclass(MissingRefError) + }; + function ValidationError(errors) { + this.message = "validation failed"; + this.errors = errors; + this.ajv = this.validation = true; + } + MissingRefError.message = function(baseId, ref) { + return "can't resolve reference " + ref + " from id " + baseId; + }; + function MissingRefError(baseId, ref, message) { + this.message = message || MissingRefError.message(baseId, ref); + this.missingRef = resolve3.url(baseId, ref); + this.missingSchema = resolve3.normalizeId(resolve3.fullPath(this.missingRef)); + } + function errorSubclass(Subclass) { + Subclass.prototype = Object.create(Error.prototype); + Subclass.prototype.constructor = Subclass; + return Subclass; + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/validate.js +var require_validate3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/validate.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_validate(it2, $keyword, $ruleType) { + var out = ""; + var $async = it2.schema.$async === true, $refKeywords = it2.util.schemaHasRulesExcept(it2.schema, it2.RULES.all, "$ref"), $id = it2.self._getId(it2.schema); + if (it2.isTop) { + if ($async) { + it2.async = true; + var $es7 = it2.opts.async == "es7"; + it2.yieldAwait = $es7 ? "await" : "yield"; + } + out += " var validate = "; + if ($async) { + if ($es7) { + out += " (async function "; + } else { + if (it2.opts.async != "*") { + out += "co.wrap"; + } + out += "(function* "; + } + } else { + out += " (function "; + } + out += " (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; "; + if ($id && (it2.opts.sourceCode || it2.opts.processCode)) { + out += " " + ("/*# sourceURL=" + $id + " */") + " "; + } + } + if (typeof it2.schema == "boolean" || !($refKeywords || it2.schema.$ref)) { + var $keyword = "false schema"; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + if (it2.schema === false) { + if (it2.isTop) { + $breakOnError = true; + } else { + out += " var " + $valid + " = false; "; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "false schema") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'boolean schema is false' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } else { + if (it2.isTop) { + if ($async) { + out += " return data; "; + } else { + out += " validate.errors = null; return true; "; + } + } else { + out += " var " + $valid + " = true; "; + } + } + if (it2.isTop) { + out += " }); return validate; "; + } + return out; + } + if (it2.isTop) { + var $top = it2.isTop, $lvl = it2.level = 0, $dataLvl = it2.dataLevel = 0, $data = "data"; + it2.rootId = it2.resolve.fullPath(it2.self._getId(it2.root.schema)); + it2.baseId = it2.baseId || it2.rootId; + delete it2.isTop; + it2.dataPathArr = [void 0]; + out += " var vErrors = null; "; + out += " var errors = 0; "; + out += " if (rootData === undefined) rootData = data; "; + } else { + var $lvl = it2.level, $dataLvl = it2.dataLevel, $data = "data" + ($dataLvl || ""); + if ($id) + it2.baseId = it2.resolve.url(it2.baseId, $id); + if ($async && !it2.async) + throw new Error("async schema in sync schema"); + out += " var errs_" + $lvl + " = errors;"; + } + var $valid = "valid" + $lvl, $breakOnError = !it2.opts.allErrors, $closingBraces1 = "", $closingBraces2 = ""; + var $errorKeyword; + var $typeSchema = it2.schema.type, $typeIsArray = Array.isArray($typeSchema); + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it2.schema.$ref && $refKeywords) { + if (it2.opts.extendRefs == "fail") { + throw new Error('$ref: validation keywords used in schema at path "' + it2.errSchemaPath + '" (see option extendRefs)'); + } else if (it2.opts.extendRefs !== true) { + $refKeywords = false; + it2.logger.warn('$ref: keywords ignored in schema at path "' + it2.errSchemaPath + '"'); + } + } + if ($typeSchema) { + if (it2.opts.coerceTypes) { + var $coerceToTypes = it2.util.coerceToTypes(it2.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it2.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || $rulesGroup && !$shouldUseGroup($rulesGroup)) { + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type"; + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type", $method = $typeIsArray ? "checkDataTypes" : "checkDataType"; + out += " if (" + it2.util[$method]($typeSchema, $data, true) + ") { "; + if ($coerceToTypes) { + var $dataType = "dataType" + $lvl, $coerced = "coerced" + $lvl; + out += " var " + $dataType + " = typeof " + $data + "; "; + if (it2.opts.coerceTypes == "array") { + out += " if (" + $dataType + " == 'object' && Array.isArray(" + $data + ")) " + $dataType + " = 'array'; "; + } + out += " var " + $coerced + " = undefined; "; + var $bracesCoercion = ""; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += " if (" + $coerced + " === undefined) { "; + $bracesCoercion += "}"; + } + if (it2.opts.coerceTypes == "array" && $type != "array") { + out += " if (" + $dataType + " == 'array' && " + $data + ".length == 1) { " + $coerced + " = " + $data + " = " + $data + "[0]; " + $dataType + " = typeof " + $data + "; } "; + } + if ($type == "string") { + out += " if (" + $dataType + " == 'number' || " + $dataType + " == 'boolean') " + $coerced + " = '' + " + $data + "; else if (" + $data + " === null) " + $coerced + " = ''; "; + } else if ($type == "number" || $type == "integer") { + out += " if (" + $dataType + " == 'boolean' || " + $data + " === null || (" + $dataType + " == 'string' && " + $data + " && " + $data + " == +" + $data + " "; + if ($type == "integer") { + out += " && !(" + $data + " % 1)"; + } + out += ")) " + $coerced + " = +" + $data + "; "; + } else if ($type == "boolean") { + out += " if (" + $data + " === 'false' || " + $data + " === 0 || " + $data + " === null) " + $coerced + " = false; else if (" + $data + " === 'true' || " + $data + " === 1) " + $coerced + " = true; "; + } else if ($type == "null") { + out += " if (" + $data + " === '' || " + $data + " === 0 || " + $data + " === false) " + $coerced + " = null; "; + } else if (it2.opts.coerceTypes == "array" && $type == "array") { + out += " if (" + $dataType + " == 'string' || " + $dataType + " == 'number' || " + $dataType + " == 'boolean' || " + $data + " == null) " + $coerced + " = [" + $data + "]; "; + } + } + } + out += " " + $bracesCoercion + " if (" + $coerced + " === undefined) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " " + $data + " = " + $coerced + "; "; + if (!$dataLvl) { + out += "if (" + $parentData + " !== undefined)"; + } + out += " " + $parentData + "[" + $parentDataProperty + "] = " + $coerced + "; } "; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } + out += " } "; + } + } + if (it2.schema.$ref && !$refKeywords) { + out += " " + it2.RULES.all.$ref.code(it2, "$ref") + " "; + if ($breakOnError) { + out += " } if (errors === "; + if ($top) { + out += "0"; + } else { + out += "errs_" + $lvl; + } + out += ") { "; + $closingBraces2 += "}"; + } + } else { + if (it2.opts.v5 && it2.schema.patternGroups) { + it2.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); + } + var arr2 = it2.RULES; + if (arr2) { + var $rulesGroup, i22 = -1, l22 = arr2.length - 1; + while (i22 < l22) { + $rulesGroup = arr2[i22 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += " if (" + it2.util.checkDataType($rulesGroup.type, $data) + ") { "; + } + if (it2.opts.useDefaults && !it2.compositeRule) { + if ($rulesGroup.type == "object" && it2.schema.properties) { + var $schema = it2.schema.properties, $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i32 = -1, l32 = arr3.length - 1; + while (i32 < l32) { + $propertyKey = arr3[i32 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== void 0) { + var $passData = $data + it2.util.getProperty($propertyKey); + out += " if (" + $passData + " === undefined) " + $passData + " = "; + if (it2.opts.useDefaults == "shared") { + out += " " + it2.useDefault($sch.default) + " "; + } else { + out += " " + JSON.stringify($sch.default) + " "; + } + out += "; "; + } + } + } + } else if ($rulesGroup.type == "array" && Array.isArray(it2.schema.items)) { + var arr4 = it2.schema.items; + if (arr4) { + var $sch, $i = -1, l42 = arr4.length - 1; + while ($i < l42) { + $sch = arr4[$i += 1]; + if ($sch.default !== void 0) { + var $passData = $data + "[" + $i + "]"; + out += " if (" + $passData + " === undefined) " + $passData + " = "; + if (it2.opts.useDefaults == "shared") { + out += " " + it2.useDefault($sch.default) + " "; + } else { + out += " " + JSON.stringify($sch.default) + " "; + } + out += "; "; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i52 = -1, l52 = arr5.length - 1; + while (i52 < l52) { + $rule = arr5[i52 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it2, $rule.keyword, $rulesGroup.type); + if ($code) { + out += " " + $code + " "; + if ($breakOnError) { + $closingBraces1 += "}"; + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces1 + " "; + $closingBraces1 = ""; + } + if ($rulesGroup.type) { + out += " } "; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += " else { "; + var $schemaPath = it2.schemaPath + ".type", $errSchemaPath = it2.errSchemaPath + "/type"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "type") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { type: '"; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be "; + if ($typeIsArray) { + out += "" + $typeSchema.join(","); + } else { + out += "" + $typeSchema; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + } + } + if ($breakOnError) { + out += " if (errors === "; + if ($top) { + out += "0"; + } else { + out += "errs_" + $lvl; + } + out += ") { "; + $closingBraces2 += "}"; + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces2 + " "; + } + if ($top) { + if ($async) { + out += " if (errors === 0) return data; "; + out += " else throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; "; + out += " return errors === 0; "; + } + out += " }); return validate;"; + } else { + out += " var " + $valid + " = errors === errs_" + $lvl + ";"; + } + out = it2.util.cleanUpCode(out); + if ($top) { + out = it2.util.finalCleanUpCode(out, $async); + } + function $shouldUseGroup($rulesGroup2) { + var rules = $rulesGroup2.rules; + for (var i7 = 0; i7 < rules.length; i7++) + if ($shouldUseRule(rules[i7])) + return true; + } + function $shouldUseRule($rule2) { + return it2.schema[$rule2.keyword] !== void 0 || $rule2.implements && $ruleImplementsSomeKeyword($rule2); + } + function $ruleImplementsSomeKeyword($rule2) { + var impl = $rule2.implements; + for (var i7 = 0; i7 < impl.length; i7++) + if (it2.schema[impl[i7]] !== void 0) + return true; + } + return out; + }; + } +}); + +// node_modules/co/index.js +var require_co = __commonJS({ + "node_modules/co/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var slice2 = Array.prototype.slice; + module5.exports = co["default"] = co.co = co; + co.wrap = function(fn) { + createPromise.__generatorFunction__ = fn; + return createPromise; + function createPromise() { + return co.call(this, fn.apply(this, arguments)); + } + }; + function co(gen) { + var ctx = this; + var args = slice2.call(arguments, 1); + return new Promise(function(resolve3, reject2) { + if (typeof gen === "function") + gen = gen.apply(ctx, args); + if (!gen || typeof gen.next !== "function") + return resolve3(gen); + onFulfilled(); + function onFulfilled(res) { + var ret; + try { + ret = gen.next(res); + } catch (e10) { + return reject2(e10); + } + next(ret); + } + function onRejected(err) { + var ret; + try { + ret = gen.throw(err); + } catch (e10) { + return reject2(e10); + } + next(ret); + } + function next(ret) { + if (ret.done) + return resolve3(ret.value); + var value2 = toPromise.call(ctx, ret.value); + if (value2 && isPromise(value2)) + return value2.then(onFulfilled, onRejected); + return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "' + String(ret.value) + '"')); + } + }); + } + function toPromise(obj) { + if (!obj) + return obj; + if (isPromise(obj)) + return obj; + if (isGeneratorFunction(obj) || isGenerator(obj)) + return co.call(this, obj); + if ("function" == typeof obj) + return thunkToPromise.call(this, obj); + if (Array.isArray(obj)) + return arrayToPromise.call(this, obj); + if (isObject8(obj)) + return objectToPromise.call(this, obj); + return obj; + } + function thunkToPromise(fn) { + var ctx = this; + return new Promise(function(resolve3, reject2) { + fn.call(ctx, function(err, res) { + if (err) + return reject2(err); + if (arguments.length > 2) + res = slice2.call(arguments, 1); + resolve3(res); + }); + }); + } + function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); + } + function objectToPromise(obj) { + var results = new obj.constructor(); + var keys2 = Object.keys(obj); + var promises3 = []; + for (var i7 = 0; i7 < keys2.length; i7++) { + var key = keys2[i7]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) + defer2(promise, key); + else + results[key] = obj[key]; + } + return Promise.all(promises3).then(function() { + return results; + }); + function defer2(promise2, key2) { + results[key2] = void 0; + promises3.push(promise2.then(function(res) { + results[key2] = res; + })); + } + } + function isPromise(obj) { + return "function" == typeof obj.then; + } + function isGenerator(obj) { + return "function" == typeof obj.next && "function" == typeof obj.throw; + } + function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) + return false; + if ("GeneratorFunction" === constructor.name || "GeneratorFunction" === constructor.displayName) + return true; + return isGenerator(constructor.prototype); + } + function isObject8(val) { + return Object == val.constructor; + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/index.js +var require_compile3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var resolve3 = require_resolve3(); + var util2 = require_util4(); + var errorClasses = require_error_classes2(); + var stableStringify = require_fast_json_stable_stringify(); + var validateGenerator = require_validate3(); + var co = require_co(); + var ucs2length = util2.ucs2length; + var equal2 = require_fast_deep_equal3(); + var ValidationError = errorClasses.Validation; + module5.exports = compile; + function compile(schema8, root2, localRefs, baseId) { + var self2 = this, opts = this._opts, refVal = [void 0], refs = {}, patterns = [], patternsHash = {}, defaults2 = [], defaultsHash = {}, customRules = []; + root2 = root2 || { schema: schema8, refVal, refs }; + var c7 = checkCompiling.call(this, schema8, root2, baseId); + var compilation = this._compilations[c7.index]; + if (c7.compiling) + return compilation.callValidate = callValidate; + var formats = this._formats; + var RULES = this.RULES; + try { + var v8 = localCompile(schema8, root2, localRefs, baseId); + compilation.validate = v8; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v8.schema; + cv.errors = null; + cv.refs = v8.refs; + cv.refVal = v8.refVal; + cv.root = v8.root; + cv.$async = v8.$async; + if (opts.sourceCode) + cv.source = v8.source; + } + return v8; + } finally { + endCompiling.call(this, schema8, root2, baseId); + } + function callValidate() { + var validate15 = compilation.validate; + var result2 = validate15.apply(null, arguments); + callValidate.errors = validate15.errors; + return result2; + } + function localCompile(_schema, _root, localRefs2, baseId2) { + var isRoot = !_root || _root && _root.schema == _schema; + if (_root.schema != root2.schema) + return compile.call(self2, _schema, _root, localRefs2, baseId2); + var $async = _schema.$async === true; + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot, + baseId: baseId2, + root: _root, + schemaPath: "", + errSchemaPath: "#", + errorPath: '""', + MissingRefError: errorClasses.MissingRef, + RULES, + validate: validateGenerator, + util: util2, + resolve: resolve3, + resolveRef, + usePattern, + useDefault, + useCustomRule, + opts, + formats, + logger: self2.logger, + self: self2 + }); + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults2, defaultCode) + vars(customRules, customRuleCode) + sourceCode; + if (opts.processCode) + sourceCode = opts.processCode(sourceCode); + var validate15; + try { + var makeValidate = new Function( + "self", + "RULES", + "formats", + "root", + "refVal", + "defaults", + "customRules", + "co", + "equal", + "ucs2length", + "ValidationError", + sourceCode + ); + validate15 = makeValidate( + self2, + RULES, + formats, + root2, + refVal, + defaults2, + customRules, + co, + equal2, + ucs2length, + ValidationError + ); + refVal[0] = validate15; + } catch (e10) { + self2.logger.error("Error compiling schema, function code:", sourceCode); + throw e10; + } + validate15.schema = _schema; + validate15.errors = null; + validate15.refs = refs; + validate15.refVal = refVal; + validate15.root = isRoot ? validate15 : _root; + if ($async) + validate15.$async = true; + if (opts.sourceCode === true) { + validate15.source = { + code: sourceCode, + patterns, + defaults: defaults2 + }; + } + return validate15; + } + function resolveRef(baseId2, ref, isRoot) { + ref = resolve3.url(baseId2, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== void 0) { + _refVal = refVal[refIndex]; + refCode = "refVal[" + refIndex + "]"; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root2.refs) { + var rootRefId = root2.refs[ref]; + if (rootRefId !== void 0) { + _refVal = root2.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + refCode = addLocalRef(ref); + var v9 = resolve3.call(self2, localCompile, root2, ref); + if (v9 === void 0) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v9 = resolve3.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self2, localSchema, root2, localRefs, baseId2); + } + } + if (v9 === void 0) { + removeLocalRef(ref); + } else { + replaceLocalRef(ref, v9); + return resolvedRef(v9, refCode); + } + } + function addLocalRef(ref, v9) { + var refId = refVal.length; + refVal[refId] = v9; + refs[ref] = refId; + return "refVal" + refId; + } + function removeLocalRef(ref) { + delete refs[ref]; + } + function replaceLocalRef(ref, v9) { + var refId = refs[ref]; + refVal[refId] = v9; + } + function resolvedRef(refVal2, code) { + return typeof refVal2 == "object" || typeof refVal2 == "boolean" ? { code, schema: refVal2, inline: true } : { code, $async: refVal2 && refVal2.$async }; + } + function usePattern(regexStr) { + var index4 = patternsHash[regexStr]; + if (index4 === void 0) { + index4 = patternsHash[regexStr] = patterns.length; + patterns[index4] = regexStr; + } + return "pattern" + index4; + } + function useDefault(value2) { + switch (typeof value2) { + case "boolean": + case "number": + return "" + value2; + case "string": + return util2.toQuotedString(value2); + case "object": + if (value2 === null) + return "null"; + var valueStr = stableStringify(value2); + var index4 = defaultsHash[valueStr]; + if (index4 === void 0) { + index4 = defaultsHash[valueStr] = defaults2.length; + defaults2[index4] = value2; + } + return "default" + index4; + } + } + function useCustomRule(rule, schema9, parentSchema, it2) { + var validateSchema4 = rule.definition.validateSchema; + if (validateSchema4 && self2._opts.validateSchema !== false) { + var valid = validateSchema4(schema9); + if (!valid) { + var message = "keyword schema is invalid: " + self2.errorsText(validateSchema4.errors); + if (self2._opts.validateSchema == "log") + self2.logger.error(message); + else + throw new Error(message); + } + } + var compile2 = rule.definition.compile, inline = rule.definition.inline, macro = rule.definition.macro; + var validate15; + if (compile2) { + validate15 = compile2.call(self2, schema9, parentSchema, it2); + } else if (macro) { + validate15 = macro.call(self2, schema9, parentSchema, it2); + if (opts.validateSchema !== false) + self2.validateSchema(validate15, true); + } else if (inline) { + validate15 = inline.call(self2, it2, rule.keyword, schema9, parentSchema); + } else { + validate15 = rule.definition.validate; + if (!validate15) + return; + } + if (validate15 === void 0) + throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); + var index4 = customRules.length; + customRules[index4] = validate15; + return { + code: "customRule" + index4, + validate: validate15 + }; + } + } + function checkCompiling(schema8, root2, baseId) { + var index4 = compIndex.call(this, schema8, root2, baseId); + if (index4 >= 0) + return { index: index4, compiling: true }; + index4 = this._compilations.length; + this._compilations[index4] = { + schema: schema8, + root: root2, + baseId + }; + return { index: index4, compiling: false }; + } + function endCompiling(schema8, root2, baseId) { + var i7 = compIndex.call(this, schema8, root2, baseId); + if (i7 >= 0) + this._compilations.splice(i7, 1); + } + function compIndex(schema8, root2, baseId) { + for (var i7 = 0; i7 < this._compilations.length; i7++) { + var c7 = this._compilations[i7]; + if (c7.schema == schema8 && c7.root == root2 && c7.baseId == baseId) + return i7; + } + return -1; + } + function patternCode(i7, patterns) { + return "var pattern" + i7 + " = new RegExp(" + util2.toQuotedString(patterns[i7]) + ");"; + } + function defaultCode(i7) { + return "var default" + i7 + " = defaults[" + i7 + "];"; + } + function refValCode(i7, refVal) { + return refVal[i7] === void 0 ? "" : "var refVal" + i7 + " = refVal[" + i7 + "];"; + } + function customRuleCode(i7) { + return "var customRule" + i7 + " = customRules[" + i7 + "];"; + } + function vars(arr, statement) { + if (!arr.length) + return ""; + var code = ""; + for (var i7 = 0; i7 < arr.length; i7++) + code += statement(i7, arr); + return code; + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/cache.js +var require_cache3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/cache.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Cache4 = module5.exports = function Cache5() { + this._cache = {}; + }; + Cache4.prototype.put = function Cache_put(key, value2) { + this._cache[key] = value2; + }; + Cache4.prototype.get = function Cache_get(key) { + return this._cache[key]; + }; + Cache4.prototype.del = function Cache_del(key) { + delete this._cache[key]; + }; + Cache4.prototype.clear = function Cache_clear() { + this._cache = {}; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/formats.js +var require_formats4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/formats.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = require_util4(); + var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/; + var DAYS = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; + var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; + var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; + var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; + var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; + var URL2 = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; + var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; + var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; + var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; + module5.exports = formats; + function formats(mode) { + mode = mode == "full" ? "full" : "fast"; + return util2.copy(formats[mode]); + } + formats.fast = { + // date: http://tools.ietf.org/html/rfc3339#section-5.6 + date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, + // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 + time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, + "date-time": /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, + // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js + uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i, + "uri-reference": /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i, + "uri-template": URITEMPLATE, + url: URL2, + // email (sources from jsen validator): + // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 + // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') + email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, + hostname: HOSTNAME, + // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex, + // uuid: http://tools.ietf.org/html/rfc4122 + uuid: UUID, + // JSON-pointer: https://tools.ietf.org/html/rfc6901 + // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A + "json-pointer": JSON_POINTER, + // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 + "relative-json-pointer": RELATIVE_JSON_POINTER + }; + formats.full = { + date, + time: time2, + "date-time": date_time, + uri, + "uri-reference": URIREF, + "uri-template": URITEMPLATE, + url: URL2, + email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, + hostname: hostname2, + ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, + ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, + regex, + uuid: UUID, + "json-pointer": JSON_POINTER, + "relative-json-pointer": RELATIVE_JSON_POINTER + }; + function date(str2) { + var matches2 = str2.match(DATE); + if (!matches2) + return false; + var month = +matches2[1]; + var day = +matches2[2]; + return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; + } + function time2(str2, full) { + var matches2 = str2.match(TIME); + if (!matches2) + return false; + var hour = matches2[1]; + var minute = matches2[2]; + var second = matches2[3]; + var timeZone = matches2[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); + } + var DATE_TIME_SEPARATOR = /t|\s/i; + function date_time(str2) { + var dateTime = str2.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time2(dateTime[1], true); + } + function hostname2(str2) { + return str2.length <= 255 && HOSTNAME.test(str2); + } + var NOT_URI_FRAGMENT = /\/|:/; + function uri(str2) { + return NOT_URI_FRAGMENT.test(str2) && URI.test(str2); + } + var Z_ANCHOR = /[^\\]\\Z/; + function regex(str2) { + if (Z_ANCHOR.test(str2)) + return false; + try { + new RegExp(str2); + return true; + } catch (e10) { + return false; + } + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/ref.js +var require_ref4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/ref.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_ref(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $async, $refCode; + if ($schema == "#" || $schema == "#/") { + if (it2.isRoot) { + $async = it2.async; + $refCode = "validate"; + } else { + $async = it2.root.schema.$async === true; + $refCode = "root.refVal[0]"; + } + } else { + var $refVal = it2.resolveRef(it2.baseId, $schema, it2.isRoot); + if ($refVal === void 0) { + var $message = it2.MissingRefError.message(it2.baseId, $schema); + if (it2.opts.missingRefs == "fail") { + it2.logger.error($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '$ref' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { ref: '" + it2.util.escapeQuotes($schema) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'can\\'t resolve reference " + it2.util.escapeQuotes($schema) + "' "; + } + if (it2.opts.verbose) { + out += " , schema: " + it2.util.toQuotedString($schema) + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + if ($breakOnError) { + out += " if (false) { "; + } + } else if (it2.opts.missingRefs == "ignore") { + it2.logger.warn($message); + if ($breakOnError) { + out += " if (true) { "; + } + } else { + throw new it2.MissingRefError(it2.baseId, $schema, $message); + } + } else if ($refVal.inline) { + var $it = it2.util.copy(it2); + $it.level++; + var $nextValid = "valid" + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ""; + $it.errSchemaPath = $schema; + var $code = it2.validate($it).replace(/validate\.schema/g, $refVal.code); + out += " " + $code + " "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.opts.passContext) { + out += " " + $refCode + ".call(this, "; + } else { + out += " " + $refCode + "( "; + } + out += " " + $data + ", (dataPath || '')"; + if (it2.errorPath != '""') { + out += " + " + it2.errorPath; + } + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " , " + $parentData + " , " + $parentDataProperty + ", rootData) "; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it2.async) + throw new Error("async schema referenced by sync schema"); + if ($breakOnError) { + out += " var " + $valid + "; "; + } + out += " try { " + it2.yieldAwait + " " + __callValidate + "; "; + if ($breakOnError) { + out += " " + $valid + " = true; "; + } + out += " } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; "; + if ($breakOnError) { + out += " " + $valid + " = false; "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $valid + ") { "; + } + } else { + out += " if (!" + __callValidate + ") { if (vErrors === null) vErrors = " + $refCode + ".errors; else vErrors = vErrors.concat(" + $refCode + ".errors); errors = vErrors.length; } "; + if ($breakOnError) { + out += " else { "; + } + } + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/allOf.js +var require_allOf3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/allOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_allOf(it2, $keyword, $ruleType) { + var out = " "; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $currentBaseId = $it.baseId, $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += " if (true) { "; + } else { + out += " " + $closingBraces.slice(0, -1) + " "; + } + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/anyOf.js +var require_anyOf3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/anyOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_anyOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $noEmptySchema = $schema.every(function($sch2) { + return it2.util.schemaHasRules($sch2, it2.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += " var " + $errs + " = errors; var " + $valid + " = false; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " " + $valid + " = " + $valid + " || " + $nextValid + "; if (!" + $valid + ") { "; + $closingBraces += "}"; + } + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $closingBraces + " if (!" + $valid + ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'anyOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should match some schema in anyOf' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; return false; "; + } + } + out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + if (it2.opts.allErrors) { + out += " } "; + } + out = it2.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += " if (true) { "; + } + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/const.js +var require_const3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/const.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_const(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += " var schema" + $lvl + " = validate.schema" + $schemaPath + ";"; + } + out += "var " + $valid + " = equal(" + $data + ", schema" + $lvl + "); if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'const' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should be equal to constant' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " }"; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/contains.js +var require_contains3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/contains.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_contains(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it2.baseId, $nonEmptySchema = it2.util.schemaHasRules($schema, it2.RULES.all); + out += "var " + $errs + " = errors;var " + $valid + ";"; + if ($nonEmptySchema) { + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " var " + $nextValid + " = false; for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " if (" + $nextValid + ") break; } "; + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $closingBraces + " if (!" + $nextValid + ") {"; + } else { + out += " if (" + $data + ".length == 0) {"; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'contains' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should contain a valid item' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + if ($nonEmptySchema) { + out += " errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + } + if (it2.opts.allErrors) { + out += " } "; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/dependencies.js +var require_dependencies3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/dependencies.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_dependencies(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it2.opts.ownProperties; + for ($property in $schema) { + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } + out += "var " + $errs + " = errors;"; + var $currentErrorPath = it2.errorPath; + out += "var missing" + $lvl + ";"; + for (var $property in $propertyDeps) { + $deps = $propertyDeps[$property]; + if ($deps.length) { + out += " if ( " + $data + it2.util.getProperty($property) + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($property) + "') "; + } + if ($breakOnError) { + out += " && ( "; + var arr1 = $deps; + if (arr1) { + var $propertyKey, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $propertyKey = arr1[$i += 1]; + if ($i) { + out += " || "; + } + var $prop = it2.util.getProperty($propertyKey), $useData = $data + $prop; + out += " ( ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") && (missing" + $lvl + " = " + it2.util.toQuotedString(it2.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; + } + } + out += ")) { "; + var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.opts.jsonPointers ? it2.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it2.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it2.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should have "; + if ($deps.length == 1) { + out += "property " + it2.util.escapeQuotes($deps[0]); + } else { + out += "properties " + it2.util.escapeQuotes($deps.join(", ")); + } + out += " when property " + it2.util.escapeQuotes($property) + " is present' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + } else { + out += " ) { "; + var arr2 = $deps; + if (arr2) { + var $propertyKey, i22 = -1, l22 = arr2.length - 1; + while (i22 < l22) { + $propertyKey = arr2[i22 += 1]; + var $prop = it2.util.getProperty($propertyKey), $missingProperty = it2.util.escapeQuotes($propertyKey), $useData = $data + $prop; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'dependencies' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { property: '" + it2.util.escapeQuotes($property) + "', missingProperty: '" + $missingProperty + "', depsCount: " + $deps.length + ", deps: '" + it2.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", ")) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should have "; + if ($deps.length == 1) { + out += "property " + it2.util.escapeQuotes($deps[0]); + } else { + out += "properties " + it2.util.escapeQuotes($deps.join(", ")); + } + out += " when property " + it2.util.escapeQuotes($property) + " is present' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; + } + } + } + out += " } "; + if ($breakOnError) { + $closingBraces += "}"; + out += " else { "; + } + } + } + it2.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; + for (var $property in $schemaDeps) { + var $sch = $schemaDeps[$property]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + out += " " + $nextValid + " = true; if ( " + $data + it2.util.getProperty($property) + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($property) + "') "; + } + out += ") { "; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it2.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + "/" + it2.util.escapeFragment($property); + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/enum.js +var require_enum4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/enum.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_enum(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $i = "i" + $lvl, $vSchema = "schema" + $lvl; + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + ";"; + } + out += "var " + $valid + ";"; + if ($isData) { + out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"; + } + out += "" + $valid + " = false;for (var " + $i + "=0; " + $i + "<" + $vSchema + ".length; " + $i + "++) if (equal(" + $data + ", " + $vSchema + "[" + $i + "])) { " + $valid + " = true; break; }"; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'enum' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { allowedValues: schema" + $lvl + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be equal to one of the allowed values' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " }"; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/format.js +var require_format5 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/format.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_format(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + if (it2.opts.format === false) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $unknownFormats = it2.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); + if ($isData) { + var $format = "format" + $lvl, $isObject = "isObject" + $lvl, $formatType = "formatType" + $lvl; + out += " var " + $format + " = formats[" + $schemaValue + "]; var " + $isObject + " = typeof " + $format + " == 'object' && !(" + $format + " instanceof RegExp) && " + $format + ".validate; var " + $formatType + " = " + $isObject + " && " + $format + ".type || 'string'; if (" + $isObject + ") { "; + if (it2.async) { + out += " var async" + $lvl + " = " + $format + ".async; "; + } + out += " " + $format + " = " + $format + ".validate; } if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "; + } + out += " ("; + if ($unknownFormats != "ignore") { + out += " (" + $schemaValue + " && !" + $format + " "; + if ($allowUnknown) { + out += " && self._opts.unknownFormats.indexOf(" + $schemaValue + ") == -1 "; + } + out += ") || "; + } + out += " (" + $format + " && " + $formatType + " == '" + $ruleType + "' && !(typeof " + $format + " == 'function' ? "; + if (it2.async) { + out += " (async" + $lvl + " ? " + it2.yieldAwait + " " + $format + "(" + $data + ") : " + $format + "(" + $data + ")) "; + } else { + out += " " + $format + "(" + $data + ") "; + } + out += " : " + $format + ".test(" + $data + "))))) {"; + } else { + var $format = it2.formats[$schema]; + if (!$format) { + if ($unknownFormats == "ignore") { + it2.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it2.errSchemaPath + '"'); + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } else { + throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it2.errSchemaPath + '"'); + } + } + var $isObject = typeof $format == "object" && !($format instanceof RegExp) && $format.validate; + var $formatType = $isObject && $format.type || "string"; + if ($isObject) { + var $async = $format.async === true; + $format = $format.validate; + } + if ($formatType != $ruleType) { + if ($breakOnError) { + out += " if (true) { "; + } + return out; + } + if ($async) { + if (!it2.async) + throw new Error("async format in sync schema"); + var $formatRef = "formats" + it2.util.getProperty($schema) + ".validate"; + out += " if (!(" + it2.yieldAwait + " " + $formatRef + "(" + $data + "))) { "; + } else { + out += " if (! "; + var $formatRef = "formats" + it2.util.getProperty($schema); + if ($isObject) + $formatRef += ".validate"; + if (typeof $format == "function") { + out += " " + $formatRef + "(" + $data + ") "; + } else { + out += " " + $formatRef + ".test(" + $data + ") "; + } + out += ") { "; + } + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'format' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { format: "; + if ($isData) { + out += "" + $schemaValue; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should match format "`; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + it2.util.escapeQuotes($schema); + } + out += `"' `; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/items.js +var require_items3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/items.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_items(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $idx = "i" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $currentBaseId = it2.baseId; + out += "var " + $errs + " = errors;var " + $valid + ";"; + if (Array.isArray($schema)) { + var $additionalItems = it2.schema.additionalItems; + if ($additionalItems === false) { + out += " " + $valid + " = " + $data + ".length <= " + $schema.length + "; "; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it2.errSchemaPath + "/additionalItems"; + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'additionalItems' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schema.length + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have more than " + $schema.length + " items' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + $closingBraces += "}"; + out += " else { "; + } + } + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + out += " " + $nextValid + " = true; if (" + $data + ".length > " + $i + ") { "; + var $passData = $data + "[" + $i + "]"; + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $i, it2.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if (typeof $additionalItems == "object" && it2.util.schemaHasRules($additionalItems, it2.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it2.schemaPath + ".additionalItems"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalItems"; + out += " " + $nextValid + " = true; if (" + $data + ".length > " + $schema.length + ") { for (var " + $idx + " = " + $schema.length + "; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " } } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } else if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " for (var " + $idx + " = 0; " + $idx + " < " + $data + ".length; " + $idx + "++) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $idx, it2.opts.jsonPointers, true); + var $passData = $data + "[" + $idx + "]"; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " }"; + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limit.js +var require_limit3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limit.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limit(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == "maximum", $exclusiveKeyword = $isMax ? "exclusiveMaximum" : "exclusiveMinimum", $schemaExcl = it2.schema[$exclusiveKeyword], $isDataExcl = it2.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? "<" : ">", $notOp = $isMax ? ">" : "<", $errorKeyword = void 0; + if ($isDataExcl) { + var $schemaValueExcl = it2.util.getData($schemaExcl.$data, $dataLvl, it2.dataPathArr), $exclusive = "exclusive" + $lvl, $exclType = "exclType" + $lvl, $exclIsNumber = "exclIsNumber" + $lvl, $opExpr = "op" + $lvl, $opStr = "' + " + $opExpr + " + '"; + out += " var schemaExcl" + $lvl + " = " + $schemaValueExcl + "; "; + $schemaValueExcl = "schemaExcl" + $lvl; + out += " var " + $exclusive + "; var " + $exclType + " = typeof " + $schemaValueExcl + "; if (" + $exclType + " != 'boolean' && " + $exclType + " != 'undefined' && " + $exclType + " != 'number') { "; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_exclusiveLimit") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: '" + $exclusiveKeyword + " should be boolean' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $exclType + " == 'number' ? ( (" + $exclusive + " = " + $schemaValue + " === undefined || " + $schemaValueExcl + " " + $op + "= " + $schemaValue + ") ? " + $data + " " + $notOp + "= " + $schemaValueExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) : ( (" + $exclusive + " = " + $schemaValueExcl + " === true) ? " + $data + " " + $notOp + "= " + $schemaValue + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { var op" + $lvl + " = " + $exclusive + " ? '" + $op + "' : '" + $op + "=';"; + } else { + var $exclIsNumber = typeof $schemaExcl == "number", $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = "'" + $opStr + "'"; + out += " if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " ( " + $schemaValue + " === undefined || " + $schemaExcl + " " + $op + "= " + $schemaValue + " ? " + $data + " " + $notOp + "= " + $schemaExcl + " : " + $data + " " + $notOp + " " + $schemaValue + " ) || " + $data + " !== " + $data + ") { "; + } else { + if ($exclIsNumber && $schema === void 0) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it2.errSchemaPath + "/" + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += "="; + } else { + if ($exclIsNumber) + $schemaValue = Math[$isMax ? "min" : "max"]($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it2.errSchemaPath + "/" + $exclusiveKeyword; + $notOp += "="; + } else { + $exclusive = false; + $opStr += "="; + } + } + var $opExpr = "'" + $opStr + "'"; + out += " if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $data + " " + $notOp + " " + $schemaValue + " || " + $data + " !== " + $data + ") { "; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limit") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { comparison: " + $opExpr + ", limit: " + $schemaValue + ", exclusive: " + $exclusive + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be " + $opStr + " "; + if ($isData) { + out += "' + " + $schemaValue; + } else { + out += "" + $schemaValue + "'"; + } + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitItems.js +var require_limitItems3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitItems.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitItems(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxItems" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " " + $data + ".length " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitItems") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have "; + if ($keyword == "maxItems") { + out += "more"; + } else { + out += "less"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " items' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitLength.js +var require_limitLength3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitLength.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitLength(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxLength" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + if (it2.opts.unicode === false) { + out += " " + $data + ".length "; + } else { + out += " ucs2length(" + $data + ") "; + } + out += " " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitLength") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be "; + if ($keyword == "maxLength") { + out += "longer"; + } else { + out += "shorter"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " characters' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitProperties.js +var require_limitProperties3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/_limitProperties.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate__limitProperties(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == "maxProperties" ? ">" : "<"; + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'number') || "; + } + out += " Object.keys(" + $data + ").length " + $op + " " + $schemaValue + ") { "; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "_limitProperties") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { limit: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have "; + if ($keyword == "maxProperties") { + out += "more"; + } else { + out += "less"; + } + out += " than "; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + $schema; + } + out += " properties' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/multipleOf.js +var require_multipleOf3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/multipleOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_multipleOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + out += "var division" + $lvl + ";if ("; + if ($isData) { + out += " " + $schemaValue + " !== undefined && ( typeof " + $schemaValue + " != 'number' || "; + } + out += " (division" + $lvl + " = " + $data + " / " + $schemaValue + ", "; + if (it2.opts.multipleOfPrecision) { + out += " Math.abs(Math.round(division" + $lvl + ") - division" + $lvl + ") > 1e-" + it2.opts.multipleOfPrecision + " "; + } else { + out += " division" + $lvl + " !== parseInt(division" + $lvl + ") "; + } + out += " ) "; + if ($isData) { + out += " ) "; + } + out += " ) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'multipleOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { multipleOf: " + $schemaValue + " } "; + if (it2.opts.messages !== false) { + out += " , message: 'should be multiple of "; + if ($isData) { + out += "' + " + $schemaValue; + } else { + out += "" + $schemaValue + "'"; + } + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/not.js +var require_not3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/not.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_not(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + $it.level++; + var $nextValid = "valid" + $it.level; + if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += " var " + $errs + " = errors; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += " " + it2.validate($it) + " "; + $it.createErrors = true; + if ($allErrorsOption) + $it.opts.allErrors = $allErrorsOption; + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " if (" + $nextValid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be valid' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; } "; + if (it2.opts.allErrors) { + out += " } "; + } + } else { + out += " var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'not' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT be valid' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if ($breakOnError) { + out += " if (false) { "; + } + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/oneOf.js +var require_oneOf3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/oneOf.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_oneOf(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + out += "var " + $errs + " = errors;var prevValid" + $lvl + " = false;var " + $valid + " = false;"; + var $currentBaseId = $it.baseId; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + "[" + $i + "]"; + $it.errSchemaPath = $errSchemaPath + "/" + $i; + out += " " + it2.validate($it) + " "; + $it.baseId = $currentBaseId; + } else { + out += " var " + $nextValid + " = true; "; + } + if ($i) { + out += " if (" + $nextValid + " && prevValid" + $lvl + ") " + $valid + " = false; else { "; + $closingBraces += "}"; + } + out += " if (" + $nextValid + ") " + $valid + " = prevValid" + $lvl + " = true;"; + } + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += "" + $closingBraces + "if (!" + $valid + ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'oneOf' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: {} "; + if (it2.opts.messages !== false) { + out += " , message: 'should match exactly one schema in oneOf' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError(vErrors); "; + } else { + out += " validate.errors = vErrors; return false; "; + } + } + out += "} else { errors = " + $errs + "; if (vErrors !== null) { if (" + $errs + ") vErrors.length = " + $errs + "; else vErrors = null; }"; + if (it2.opts.allErrors) { + out += " } "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/pattern.js +var require_pattern5 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/pattern.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_pattern(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? "(new RegExp(" + $schemaValue + "))" : it2.usePattern($schema); + out += "if ( "; + if ($isData) { + out += " (" + $schemaValue + " !== undefined && typeof " + $schemaValue + " != 'string') || "; + } + out += " !" + $regexp + ".test(" + $data + ") ) { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'pattern' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { pattern: "; + if ($isData) { + out += "" + $schemaValue; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should match pattern "`; + if ($isData) { + out += "' + " + $schemaValue + " + '"; + } else { + out += "" + it2.util.escapeQuotes($schema); + } + out += `"' `; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + it2.util.toQuotedString($schema); + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += "} "; + if ($breakOnError) { + out += " else { "; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/properties.js +var require_properties3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/properties.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_properties(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + var $key = "key" + $lvl, $idx = "idx" + $lvl, $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl; + var $schemaKeys = Object.keys($schema || {}), $pProperties = it2.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties), $aProperties = it2.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == "object" && Object.keys($aProperties).length, $removeAdditional = it2.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it2.opts.ownProperties, $currentBaseId = it2.baseId; + var $required = it2.schema.required; + if ($required && !(it2.opts.v5 && $required.$data) && $required.length < it2.opts.loopRequired) + var $requiredHash = it2.util.toHash($required); + if (it2.opts.patternGroups) { + var $pgProperties = it2.schema.patternGroups || {}, $pgPropertyKeys = Object.keys($pgProperties); + } + out += "var " + $errs + " = errors;var " + $nextValid + " = true;"; + if ($ownProperties) { + out += " var " + $dataProperties + " = undefined;"; + } + if ($checkAdditional) { + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + if ($someProperties) { + out += " var isAdditional" + $lvl + " = !(false "; + if ($schemaKeys.length) { + if ($schemaKeys.length > 5) { + out += " || validate.schema" + $schemaPath + "[" + $key + "] "; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += " || " + $key + " == " + it2.util.toQuotedString($propertyKey) + " "; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, l22 = arr2.length - 1; + while ($i < l22) { + $pProperty = arr2[$i += 1]; + out += " || " + it2.usePattern($pProperty) + ".test(" + $key + ") "; + } + } + } + if (it2.opts.patternGroups && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, l32 = arr3.length - 1; + while ($i < l32) { + $pgProperty = arr3[$i += 1]; + out += " || " + it2.usePattern($pgProperty) + ".test(" + $key + ") "; + } + } + } + out += " ); if (isAdditional" + $lvl + ") { "; + } + if ($removeAdditional == "all") { + out += " delete " + $data + "[" + $key + "]; "; + } else { + var $currentErrorPath = it2.errorPath; + var $additionalProperty = "' + " + $key + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += " delete " + $data + "[" + $key + "]; "; + } else { + out += " " + $nextValid + " = false; "; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'additionalProperties' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { additionalProperty: '" + $additionalProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have additional properties' "; + } + if (it2.opts.verbose) { + out += " , schema: false , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += " break; "; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == "failing") { + out += " var " + $errs + " = errors; "; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it2.schemaPath + ".additionalProperties"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + $it.errorPath = it2.opts._errorDataPathProperty ? it2.errorPath : it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + out += " if (!" + $nextValid + ") { errors = " + $errs + "; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete " + $data + "[" + $key + "]; } "; + it2.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it2.schemaPath + ".additionalProperties"; + $it.errSchemaPath = it2.errSchemaPath + "/additionalProperties"; + $it.errorPath = it2.opts._errorDataPathProperty ? it2.errorPath : it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + } + } + it2.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += " } "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + var $useDefaults = it2.opts.useDefaults && !it2.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i42 = -1, l42 = arr4.length - 1; + while (i42 < l42) { + $propertyKey = arr4[i42 += 1]; + var $sch = $schema[$propertyKey]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + var $prop = it2.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== void 0; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + "/" + it2.util.escapeFragment($propertyKey); + $it.errorPath = it2.util.getPath(it2.errorPath, $propertyKey, it2.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it2.util.toQuotedString($propertyKey); + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + $code = it2.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += " var " + $nextData + " = " + $passData + "; "; + } + if ($hasDefault) { + out += " " + $code + " "; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { " + $nextValid + " = false; "; + var $currentErrorPath = it2.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it2.util.escapeQuotes($propertyKey); + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + $errSchemaPath = it2.errSchemaPath + "/required"; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + $errSchemaPath = $currErrSchemaPath; + it2.errorPath = $currentErrorPath; + out += " } else { "; + } else { + if ($breakOnError) { + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { " + $nextValid + " = true; } else { "; + } else { + out += " if (" + $useData + " !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += " ) { "; + } + } + out += " " + $code + " } "; + } + } + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + if ($pPropertyKeys.length) { + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i52 = -1, l52 = arr5.length - 1; + while (i52 < l52) { + $pProperty = arr5[i52 += 1]; + var $sch = $pProperties[$pProperty]; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it2.schemaPath + ".patternProperties" + it2.util.getProperty($pProperty); + $it.errSchemaPath = it2.errSchemaPath + "/patternProperties/" + it2.util.escapeFragment($pProperty); + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + out += " if (" + it2.usePattern($pProperty) + ".test(" + $key + ")) { "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " } "; + if ($breakOnError) { + out += " else " + $nextValid + " = true; "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + } + } + } + } + if (it2.opts.patternGroups && $pgPropertyKeys.length) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i62 = -1, l62 = arr6.length - 1; + while (i62 < l62) { + $pgProperty = arr6[i62 += 1]; + var $pgSchema = $pgProperties[$pgProperty], $sch = $pgSchema.schema; + if (it2.util.schemaHasRules($sch, it2.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it2.schemaPath + ".patternGroups" + it2.util.getProperty($pgProperty) + ".schema"; + $it.errSchemaPath = it2.errSchemaPath + "/patternGroups/" + it2.util.escapeFragment($pgProperty) + "/schema"; + out += " var pgPropCount" + $lvl + " = 0; "; + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + out += " if (" + it2.usePattern($pgProperty) + ".test(" + $key + ")) { pgPropCount" + $lvl + "++; "; + $it.errorPath = it2.util.getPathExpr(it2.errorPath, $key, it2.opts.jsonPointers); + var $passData = $data + "[" + $key + "]"; + $it.dataPathArr[$dataNxt] = $key; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + if ($breakOnError) { + out += " if (!" + $nextValid + ") break; "; + } + out += " } "; + if ($breakOnError) { + out += " else " + $nextValid + " = true; "; + } + out += " } "; + if ($breakOnError) { + out += " if (" + $nextValid + ") { "; + $closingBraces += "}"; + } + var $pgMin = $pgSchema.minimum, $pgMax = $pgSchema.maximum; + if ($pgMin !== void 0 || $pgMax !== void 0) { + out += " var " + $valid + " = true; "; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== void 0) { + var $limit = $pgMin, $reason = "minimum", $moreOrLess = "less"; + out += " " + $valid + " = pgPropCount" + $lvl + " >= " + $pgMin + "; "; + $errSchemaPath = it2.errSchemaPath + "/patternGroups/minimum"; + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'patternGroups' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { reason: '" + $reason + "', limit: " + $limit + ", pattern: '" + it2.util.escapeQuotes($pgProperty) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have " + $moreOrLess + " than " + $limit + ' properties matching pattern "' + it2.util.escapeQuotes($pgProperty) + `"' `; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($pgMax !== void 0) { + out += " else "; + } + } + if ($pgMax !== void 0) { + var $limit = $pgMax, $reason = "maximum", $moreOrLess = "more"; + out += " " + $valid + " = pgPropCount" + $lvl + " <= " + $pgMax + "; "; + $errSchemaPath = it2.errSchemaPath + "/patternGroups/maximum"; + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'patternGroups' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { reason: '" + $reason + "', limit: " + $limit + ", pattern: '" + it2.util.escapeQuotes($pgProperty) + "' } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have " + $moreOrLess + " than " + $limit + ' properties matching pattern "' + it2.util.escapeQuotes($pgProperty) + `"' `; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += " if (" + $valid + ") { "; + $closingBraces += "}"; + } + } + } + } + } + } + if ($breakOnError) { + out += " " + $closingBraces + " if (" + $errs + " == errors) {"; + } + out = it2.util.cleanUpCode(out); + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/propertyNames.js +var require_propertyNames3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/propertyNames.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_propertyNames(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $errs = "errs__" + $lvl; + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + if (it2.util.schemaHasRules($schema, it2.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + var $key = "key" + $lvl, $idx = "idx" + $lvl, $i = "i" + $lvl, $invalidName = "' + " + $key + " + '", $dataNxt = $it.dataLevel = it2.dataLevel + 1, $nextData = "data" + $dataNxt, $dataProperties = "dataProperties" + $lvl, $ownProperties = it2.opts.ownProperties, $currentBaseId = it2.baseId; + out += " var " + $errs + " = errors; "; + if ($ownProperties) { + out += " var " + $dataProperties + " = undefined; "; + } + if ($ownProperties) { + out += " " + $dataProperties + " = " + $dataProperties + " || Object.keys(" + $data + "); for (var " + $idx + "=0; " + $idx + "<" + $dataProperties + ".length; " + $idx + "++) { var " + $key + " = " + $dataProperties + "[" + $idx + "]; "; + } else { + out += " for (var " + $key + " in " + $data + ") { "; + } + out += " var startErrs" + $lvl + " = errors; "; + var $passData = $key; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var $code = it2.validate($it); + $it.baseId = $currentBaseId; + if (it2.util.varOccurences($code, $nextData) < 2) { + out += " " + it2.util.varReplace($code, $nextData, $passData) + " "; + } else { + out += " var " + $nextData + " = " + $passData + "; " + $code + " "; + } + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " if (!" + $nextValid + ") { for (var " + $i + "=startErrs" + $lvl + "; " + $i + "= it2.opts.loopRequired, $ownProperties = it2.opts.ownProperties; + if ($breakOnError) { + out += " var missing" + $lvl + "; "; + if ($loopRequired) { + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "; + } + var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr($currentErrorPath, $propertyPath, it2.opts.jsonPointers); + } + out += " var " + $valid + " = true; "; + if ($isData) { + out += " if (schema" + $lvl + " === undefined) " + $valid + " = true; else if (!Array.isArray(schema" + $lvl + ")) " + $valid + " = false; else {"; + } + out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { " + $valid + " = " + $data + "[" + $vSchema + "[" + $i + "]] !== undefined "; + if ($ownProperties) { + out += " && Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "; + } + out += "; if (!" + $valid + ") break; } "; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + } else { + out += " if ( "; + var arr2 = $required; + if (arr2) { + var $propertyKey, $i = -1, l22 = arr2.length - 1; + while ($i < l22) { + $propertyKey = arr2[$i += 1]; + if ($i) { + out += " || "; + } + var $prop = it2.util.getProperty($propertyKey), $useData = $data + $prop; + out += " ( ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") && (missing" + $lvl + " = " + it2.util.toQuotedString(it2.opts.jsonPointers ? $propertyKey : $prop) + ") ) "; + } + } + out += ") { "; + var $propertyPath = "missing" + $lvl, $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.opts.jsonPointers ? it2.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + " + " + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } else { "; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += " var " + $vSchema + " = validate.schema" + $schemaPath + "; "; + } + var $i = "i" + $lvl, $propertyPath = "schema" + $lvl + "[" + $i + "]", $missingProperty = "' + " + $propertyPath + " + '"; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPathExpr($currentErrorPath, $propertyPath, it2.opts.jsonPointers); + } + if ($isData) { + out += " if (" + $vSchema + " && !Array.isArray(" + $vSchema + ")) { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (" + $vSchema + " !== undefined) { "; + } + out += " for (var " + $i + " = 0; " + $i + " < " + $vSchema + ".length; " + $i + "++) { if (" + $data + "[" + $vSchema + "[" + $i + "]] === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", " + $vSchema + "[" + $i + "]) "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } "; + if ($isData) { + out += " } "; + } + } else { + var arr3 = $required; + if (arr3) { + var $propertyKey, i32 = -1, l32 = arr3.length - 1; + while (i32 < l32) { + $propertyKey = arr3[i32 += 1]; + var $prop = it2.util.getProperty($propertyKey), $missingProperty = it2.util.escapeQuotes($propertyKey), $useData = $data + $prop; + if (it2.opts._errorDataPathProperty) { + it2.errorPath = it2.util.getPath($currentErrorPath, $propertyKey, it2.opts.jsonPointers); + } + out += " if ( " + $useData + " === undefined "; + if ($ownProperties) { + out += " || ! Object.prototype.hasOwnProperty.call(" + $data + ", '" + it2.util.escapeQuotes($propertyKey) + "') "; + } + out += ") { var err = "; + if (it2.createErrors !== false) { + out += " { keyword: 'required' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { missingProperty: '" + $missingProperty + "' } "; + if (it2.opts.messages !== false) { + out += " , message: '"; + if (it2.opts._errorDataPathProperty) { + out += "is a required property"; + } else { + out += "should have required property \\'" + $missingProperty + "\\'"; + } + out += "' "; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + out += "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "; + } + } + } + } + it2.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += " if (true) {"; + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/uniqueItems.js +var require_uniqueItems3 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/uniqueItems.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_uniqueItems(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it2.opts.uniqueItems !== false) { + if ($isData) { + out += " var " + $valid + "; if (" + $schemaValue + " === false || " + $schemaValue + " === undefined) " + $valid + " = true; else if (typeof " + $schemaValue + " != 'boolean') " + $valid + " = false; else { "; + } + out += " var " + $valid + " = true; if (" + $data + ".length > 1) { var i = " + $data + ".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(" + $data + "[i], " + $data + "[j])) { " + $valid + " = false; break outer; } } } } "; + if ($isData) { + out += " } "; + } + out += " if (!" + $valid + ") { "; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: 'uniqueItems' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { i: i, j: j } "; + if (it2.opts.messages !== false) { + out += " , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "; + } + if (it2.opts.verbose) { + out += " , schema: "; + if ($isData) { + out += "validate.schema" + $schemaPath; + } else { + out += "" + $schema; + } + out += " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + out += " } "; + if ($breakOnError) { + out += " else { "; + } + } else { + if ($breakOnError) { + out += " if (true) { "; + } + } + return out; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/_rules.js +var require_rules4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/_rules.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + "$ref": require_ref4(), + allOf: require_allOf3(), + anyOf: require_anyOf3(), + const: require_const3(), + contains: require_contains3(), + dependencies: require_dependencies3(), + "enum": require_enum4(), + format: require_format5(), + items: require_items3(), + maximum: require_limit3(), + minimum: require_limit3(), + maxItems: require_limitItems3(), + minItems: require_limitItems3(), + maxLength: require_limitLength3(), + minLength: require_limitLength3(), + maxProperties: require_limitProperties3(), + minProperties: require_limitProperties3(), + multipleOf: require_multipleOf3(), + not: require_not3(), + oneOf: require_oneOf3(), + pattern: require_pattern5(), + properties: require_properties3(), + propertyNames: require_propertyNames3(), + required: require_required4(), + uniqueItems: require_uniqueItems3(), + validate: require_validate3() + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/rules.js +var require_rules5 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/rules.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ruleModules = require_rules4(); + var toHash = require_util4().toHash; + module5.exports = function rules() { + var RULES = [ + { + type: "number", + rules: [ + { "maximum": ["exclusiveMaximum"] }, + { "minimum": ["exclusiveMinimum"] }, + "multipleOf", + "format" + ] + }, + { + type: "string", + rules: ["maxLength", "minLength", "pattern", "format"] + }, + { + type: "array", + rules: ["maxItems", "minItems", "uniqueItems", "contains", "items"] + }, + { + type: "object", + rules: [ + "maxProperties", + "minProperties", + "required", + "dependencies", + "propertyNames", + { "properties": ["additionalProperties", "patternProperties"] } + ] + }, + { rules: ["$ref", "const", "enum", "not", "anyOf", "oneOf", "allOf"] } + ]; + var ALL = ["type"]; + var KEYWORDS = [ + "additionalItems", + "$schema", + "$id", + "id", + "title", + "description", + "default", + "definitions" + ]; + var TYPES2 = ["number", "integer", "string", "array", "object", "boolean", "null"]; + RULES.all = toHash(ALL); + RULES.types = toHash(TYPES2); + RULES.forEach(function(group2) { + group2.rules = group2.rules.map(function(keyword) { + var implKeywords; + if (typeof keyword == "object") { + var key = Object.keys(keyword)[0]; + implKeywords = keyword[key]; + keyword = key; + implKeywords.forEach(function(k6) { + ALL.push(k6); + RULES.all[k6] = true; + }); + } + ALL.push(keyword); + var rule = RULES.all[keyword] = { + keyword, + code: ruleModules[keyword], + implements: implKeywords + }; + return rule; + }); + if (group2.type) + RULES.types[group2.type] = group2; + }); + RULES.keywords = toHash(ALL.concat(KEYWORDS)); + RULES.custom = {}; + return RULES; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/$data.js +var require_data4 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/$data.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var KEYWORDS = [ + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "additionalItems", + "maxItems", + "minItems", + "uniqueItems", + "maxProperties", + "minProperties", + "required", + "additionalProperties", + "enum", + "format", + "const" + ]; + module5.exports = function(metaSchema, keywordsJsonPointers) { + for (var i7 = 0; i7 < keywordsJsonPointers.length; i7++) { + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + var segments = keywordsJsonPointers[i7].split("/"); + var keywords = metaSchema; + var j6; + for (j6 = 1; j6 < segments.length; j6++) + keywords = keywords[segments[j6]]; + for (j6 = 0; j6 < KEYWORDS.length; j6++) { + var key = KEYWORDS[j6]; + var schema8 = keywords[key]; + if (schema8) { + keywords[key] = { + anyOf: [ + schema8, + { $ref: "https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#" } + ] + }; + } + } + } + return metaSchema; + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/patternGroups.js +var require_patternGroups = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/patternGroups.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var META_SCHEMA_ID = "http://json-schema.org/draft-06/schema"; + module5.exports = function(ajv2) { + var defaultMeta = ajv2._opts.defaultMeta; + var metaSchemaRef = typeof defaultMeta == "string" ? { $ref: defaultMeta } : ajv2.getSchema(META_SCHEMA_ID) ? { $ref: META_SCHEMA_ID } : {}; + ajv2.addKeyword("patternGroups", { + // implemented in properties.jst + metaSchema: { + type: "object", + additionalProperties: { + type: "object", + required: ["schema"], + properties: { + maximum: { + type: "integer", + minimum: 0 + }, + minimum: { + type: "integer", + minimum: 0 + }, + schema: metaSchemaRef + }, + additionalProperties: false + } + } + }); + ajv2.RULES.all.properties.implements.push("patternGroups"); + }; + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/compile/async.js +var require_async2 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/compile/async.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var MissingRefError = require_error_classes2().MissingRef; + module5.exports = compileAsync; + function compileAsync(schema8, meta, callback) { + var self2 = this; + if (typeof this._opts.loadSchema != "function") + throw new Error("options.loadSchema should be a function"); + if (typeof meta == "function") { + callback = meta; + meta = void 0; + } + var p7 = loadMetaSchemaOf(schema8).then(function() { + var schemaObj = self2._addSchema(schema8, void 0, meta); + return schemaObj.validate || _compileAsync(schemaObj); + }); + if (callback) { + p7.then( + function(v8) { + callback(null, v8); + }, + callback + ); + } + return p7; + function loadMetaSchemaOf(sch) { + var $schema = sch.$schema; + return $schema && !self2.getSchema($schema) ? compileAsync.call(self2, { $ref: $schema }, true) : Promise.resolve(); + } + function _compileAsync(schemaObj) { + try { + return self2._compile(schemaObj); + } catch (e10) { + if (e10 instanceof MissingRefError) + return loadMissingSchema(e10); + throw e10; + } + function loadMissingSchema(e10) { + var ref = e10.missingSchema; + if (added(ref)) + throw new Error("Schema " + ref + " is loaded but " + e10.missingRef + " cannot be resolved"); + var schemaPromise = self2._loadingSchemas[ref]; + if (!schemaPromise) { + schemaPromise = self2._loadingSchemas[ref] = self2._opts.loadSchema(ref); + schemaPromise.then(removePromise, removePromise); + } + return schemaPromise.then(function(sch) { + if (!added(ref)) { + return loadMetaSchemaOf(sch).then(function() { + if (!added(ref)) + self2.addSchema(sch, ref, void 0, meta); + }); + } + }).then(function() { + return _compileAsync(schemaObj); + }); + function removePromise() { + delete self2._loadingSchemas[ref]; + } + function added(ref2) { + return self2._refs[ref2] || self2._schemas[ref2]; + } + } + } + } + } +}); + +// node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/custom.js +var require_custom2 = __commonJS({ + "node_modules/json-schema-migrate/node_modules/ajv/lib/dotjs/custom.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function generate_custom(it2, $keyword, $ruleType) { + var out = " "; + var $lvl = it2.level; + var $dataLvl = it2.dataLevel; + var $schema = it2.schema[$keyword]; + var $schemaPath = it2.schemaPath + it2.util.getProperty($keyword); + var $errSchemaPath = it2.errSchemaPath + "/" + $keyword; + var $breakOnError = !it2.opts.allErrors; + var $errorKeyword; + var $data = "data" + ($dataLvl || ""); + var $valid = "valid" + $lvl; + var $errs = "errs__" + $lvl; + var $isData = it2.opts.$data && $schema && $schema.$data, $schemaValue; + if ($isData) { + out += " var schema" + $lvl + " = " + it2.util.getData($schema.$data, $dataLvl, it2.dataPathArr) + "; "; + $schemaValue = "schema" + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, $definition = "definition" + $lvl, $rDef = $rule.definition, $closingBraces = ""; + var $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = "keywordValidate" + $lvl; + var $validateSchema = $rDef.validateSchema; + out += " var " + $definition + " = RULES.custom['" + $keyword + "'].definition; var " + $validateCode + " = " + $definition + ".validate;"; + } else { + $ruleValidate = it2.useCustomRule($rule, $schema, it2.schema, it2); + if (!$ruleValidate) + return; + $schemaValue = "validate.schema" + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + ".errors", $i = "i" + $lvl, $ruleErr = "ruleErr" + $lvl, $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it2.async) + throw new Error("async keyword in sync schema"); + if (!($inline || $macro)) { + out += "" + $ruleErrs + " = null;"; + } + out += "var " + $errs + " = errors;var " + $valid + ";"; + if ($isData && $rDef.$data) { + $closingBraces += "}"; + out += " if (" + $schemaValue + " === undefined) { " + $valid + " = true; } else { "; + if ($validateSchema) { + $closingBraces += "}"; + out += " " + $valid + " = " + $definition + ".validateSchema(" + $schemaValue + "); if (" + $valid + ") { "; + } + } + if ($inline) { + if ($rDef.statements) { + out += " " + $ruleValidate.validate + " "; + } else { + out += " " + $valid + " = " + $ruleValidate.validate + "; "; + } + } else if ($macro) { + var $it = it2.util.copy(it2); + var $closingBraces = ""; + $it.level++; + var $nextValid = "valid" + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ""; + var $wasComposite = it2.compositeRule; + it2.compositeRule = $it.compositeRule = true; + var $code = it2.validate($it).replace(/validate\.schema/g, $validateCode); + it2.compositeRule = $it.compositeRule = $wasComposite; + out += " " + $code; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + out += " " + $validateCode + ".call( "; + if (it2.opts.passContext) { + out += "this"; + } else { + out += "self"; + } + if ($compile || $rDef.schema === false) { + out += " , " + $data + " "; + } else { + out += " , " + $schemaValue + " , " + $data + " , validate.schema" + it2.schemaPath + " "; + } + out += " , (dataPath || '')"; + if (it2.errorPath != '""') { + out += " + " + it2.errorPath; + } + var $parentData = $dataLvl ? "data" + ($dataLvl - 1 || "") : "parentData", $parentDataProperty = $dataLvl ? it2.dataPathArr[$dataLvl] : "parentDataProperty"; + out += " , " + $parentData + " , " + $parentDataProperty + " , rootData ) "; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += " " + $valid + " = "; + if ($asyncKeyword) { + out += "" + it2.yieldAwait; + } + out += "" + def_callRuleValidate + "; "; + } else { + if ($asyncKeyword) { + $ruleErrs = "customErrors" + $lvl; + out += " var " + $ruleErrs + " = null; try { " + $valid + " = " + it2.yieldAwait + def_callRuleValidate + "; } catch (e) { " + $valid + " = false; if (e instanceof ValidationError) " + $ruleErrs + " = e.errors; else throw e; } "; + } else { + out += " " + $ruleErrs + " = null; " + $valid + " = " + def_callRuleValidate + "; "; + } + } + } + if ($rDef.modifying) { + out += " if (" + $parentData + ") " + $data + " = " + $parentData + "[" + $parentDataProperty + "];"; + } + out += "" + $closingBraces; + if ($rDef.valid) { + if ($breakOnError) { + out += " if (true) { "; + } + } else { + out += " if ( "; + if ($rDef.valid === void 0) { + out += " !"; + if ($macro) { + out += "" + $nextValid; + } else { + out += "" + $valid; + } + } else { + out += " " + !$rDef.valid + " "; + } + out += ") { "; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ""; + if (it2.createErrors !== false) { + out += " { keyword: '" + ($errorKeyword || "custom") + "' , dataPath: (dataPath || '') + " + it2.errorPath + " , schemaPath: " + it2.util.toQuotedString($errSchemaPath) + " , params: { keyword: '" + $rule.keyword + "' } "; + if (it2.opts.messages !== false) { + out += ` , message: 'should pass "` + $rule.keyword + `" keyword validation' `; + } + if (it2.opts.verbose) { + out += " , schema: validate.schema" + $schemaPath + " , parentSchema: validate.schema" + it2.schemaPath + " , data: " + $data + " "; + } + out += " } "; + } else { + out += " {} "; + } + var __err = out; + out = $$outStack.pop(); + if (!it2.compositeRule && $breakOnError) { + if (it2.async) { + out += " throw new ValidationError([" + __err + "]); "; + } else { + out += " validate.errors = [" + __err + "]; return false; "; + } + } else { + out += " var err = " + __err + "; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != "full") { + out += " for (var " + $i + "=" + $errs + "; " + $i + " fixStructureInconsistencies( + removeXAmfProperties( + fixFileTypeProperties(val) + ) + ), + 2 + ); + const finalSchema = migrateDraft(JSON.parse(jsonSchema), options.draft); + if (options.validate) { + validateJsonSchema(finalSchema); + } + return finalSchema; + } + function migrateDraft(schema8, draft = utils.DEFAULT_DRAFT) { + utils.validateDraft(draft); + if (draft === "04") { + return schema8; + } + const migrate = require_lib4(); + const mSchema = migrate.draft6(schema8); + if (draft === "07") { + mSchema.$schema = "http://json-schema.org/draft-07/schema#"; + } + return mSchema; + } + function patchRamlData(ramlData, typeName) { + let dataPieces = ramlData.split("\n"); + dataPieces = dataPieces.filter((p7) => !!p7); + dataPieces[0] = "#%RAML 1.0"; + dataPieces.push(` +/for/conversion/${typeName}: + get: + responses: + 200: + body: + application/json: + type: ${typeName}`); + return dataPieces.join("\n"); + } + function fixStructureInconsistencies(obj) { + if (!obj || obj.constructor !== Object) { + return obj; + } + if (obj.examples) { + obj.examples = Object.values(obj.examples); + } + return obj; + } + function fixFileTypeProperties(obj) { + if (!obj || obj.constructor !== Object) { + return obj; + } + if (obj.type === "file") { + obj.type = "string"; + obj.media = { + binaryEncoding: "binary" + }; + const fileTypes = obj["x-amf-fileTypes"] || []; + if (fileTypes.length > 0) { + obj.media.anyOf = fileTypes.map((el) => { + return { mediaType: el }; + }); + } + delete obj["x-amf-fileTypes"]; + } + return obj; + } + function removeXAmfProperties(obj) { + if (!obj || obj.constructor !== Object) { + return obj; + } + const newObj = {}; + Object.entries(obj).map(([k6, v8]) => { + k6 = k6.startsWith("x-amf-facet-") ? k6.replace("x-amf-facet-", "") : k6; + k6 = k6.startsWith("x-amf-") ? k6.replace("x-amf-", "") : k6; + newObj[k6] = v8; + }); + return newObj; + } + function validateJsonSchema(obj) { + let Ajv7; + try { + Ajv7 = require_ajv(); + } catch (err) { + throw new Error( + `Validation requires "ajv" to be installed. ${err.message}` + ); + } + const ajv2 = new Ajv7({ allErrors: true, schemaId: "auto" }); + if (obj.$schema.indexOf("draft-04") > -1) { + ajv2.addMetaSchema(__require("ajv/lib/refs/json-schema-draft-04.json")); + } else if (obj.$schema.indexOf("draft-06") > -1) { + ajv2.addMetaSchema(require_json_schema_draft_063()); + } + const valid = ajv2.validateSchema(obj); + if (!valid) { + const errorsText = ajv2.errorsText(ajv2.errors, { separator: "; " }); + throw new Error(`Invalid JSON Schema: ${errorsText}`); + } + } + module5.exports.dt2js = dt2js; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/common.js +var require_common2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/common.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function isNothing2(subject) { + return typeof subject === "undefined" || subject === null; + } + function isObject8(subject) { + return typeof subject === "object" && subject !== null; + } + function toArray3(sequence) { + if (Array.isArray(sequence)) + return sequence; + else if (isNothing2(sequence)) + return []; + return [sequence]; + } + function extend3(target, source) { + var index4, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index4 = 0, length = sourceKeys.length; index4 < length; index4 += 1) { + key = sourceKeys[index4]; + target[key] = source[key]; + } + } + return target; + } + function repeat3(string2, count2) { + var result2 = "", cycle; + for (cycle = 0; cycle < count2; cycle += 1) { + result2 += string2; + } + return result2; + } + function isNegativeZero2(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; + } + module5.exports.isNothing = isNothing2; + module5.exports.isObject = isObject8; + module5.exports.toArray = toArray3; + module5.exports.repeat = repeat3; + module5.exports.isNegativeZero = isNegativeZero2; + module5.exports.extend = extend3; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/exception.js +var require_exception2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/exception.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function YAMLException2(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || "(unknown reason)") + (this.mark ? " " + this.mark.toString() : ""); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; + } + } + YAMLException2.prototype = Object.create(Error.prototype); + YAMLException2.prototype.constructor = YAMLException2; + YAMLException2.prototype.toString = function toString3(compact2) { + var result2 = this.name + ": "; + result2 += this.reason || "(unknown reason)"; + if (!compact2 && this.mark) { + result2 += " " + this.mark.toString(); + } + return result2; + }; + module5.exports = YAMLException2; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/mark.js +var require_mark2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/mark.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + function Mark(name2, buffer2, position, line, column) { + this.name = name2; + this.buffer = buffer2; + this.position = position; + this.line = line; + this.column = column; + } + Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head2, start, tail2, end, snippet2; + if (!this.buffer) + return null; + indent = indent || 4; + maxLength = maxLength || 75; + head2 = ""; + start = this.position; + while (start > 0 && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > maxLength / 2 - 1) { + head2 = " ... "; + start += 5; + break; + } + } + tail2 = ""; + end = this.position; + while (end < this.buffer.length && "\0\r\n\x85\u2028\u2029".indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > maxLength / 2 - 1) { + tail2 = " ... "; + end -= 5; + break; + } + } + snippet2 = this.buffer.slice(start, end); + return common3.repeat(" ", indent) + head2 + snippet2 + tail2 + "\n" + common3.repeat(" ", indent + this.position - start + head2.length) + "^"; + }; + Mark.prototype.toString = function toString3(compact2) { + var snippet2, where = ""; + if (this.name) { + where += 'in "' + this.name + '" '; + } + where += "at line " + (this.line + 1) + ", column " + (this.column + 1); + if (!compact2) { + snippet2 = this.getSnippet(); + if (snippet2) { + where += ":\n" + snippet2; + } + } + return where; + }; + module5.exports = Mark; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type.js +var require_type3 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var YAMLException2 = require_exception2(); + var TYPE_CONSTRUCTOR_OPTIONS2 = [ + "kind", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS2 = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases2(map4) { + var result2 = {}; + if (map4 !== null) { + Object.keys(map4).forEach(function(style) { + map4[style].forEach(function(alias) { + result2[String(alias)] = style; + }); + }); + } + return result2; + } + function Type3(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name2) { + if (TYPE_CONSTRUCTOR_OPTIONS2.indexOf(name2) === -1) { + throw new YAMLException2('Unknown option "' + name2 + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.styleAliases = compileStyleAliases2(options["styleAliases"] || null); + if (YAML_NODE_KINDS2.indexOf(this.kind) === -1) { + throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + module5.exports = Type3; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema.js +var require_schema6 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + var YAMLException2 = require_exception2(); + var Type3 = require_type3(); + function compileList2(schema8, name2, result2) { + var exclude = []; + schema8.include.forEach(function(includedSchema) { + result2 = compileList2(includedSchema, name2, result2); + }); + schema8[name2].forEach(function(currentType) { + result2.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + result2.push(currentType); + }); + return result2.filter(function(type3, index4) { + return exclude.indexOf(index4) === -1; + }); + } + function compileMap2() { + var result2 = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index4, length; + function collectType(type3) { + result2[type3.kind][type3.tag] = result2["fallback"][type3.tag] = type3; + } + for (index4 = 0, length = arguments.length; index4 < length; index4 += 1) { + arguments[index4].forEach(collectType); + } + return result2; + } + function Schema9(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + this.implicit.forEach(function(type3) { + if (type3.loadKind && type3.loadKind !== "scalar") { + throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + }); + this.compiledImplicit = compileList2(this, "implicit", []); + this.compiledExplicit = compileList2(this, "explicit", []); + this.compiledTypeMap = compileMap2(this.compiledImplicit, this.compiledExplicit); + } + Schema9.DEFAULT = null; + Schema9.create = function createSchema() { + var schemas5, types3; + switch (arguments.length) { + case 1: + schemas5 = Schema9.DEFAULT; + types3 = arguments[0]; + break; + case 2: + schemas5 = arguments[0]; + types3 = arguments[1]; + break; + default: + throw new YAMLException2("Wrong number of arguments for Schema.create function"); + } + schemas5 = common3.toArray(schemas5); + types3 = common3.toArray(types3); + if (!schemas5.every(function(schema8) { + return schema8 instanceof Schema9; + })) { + throw new YAMLException2("Specified list of super schemas (or a single Schema object) contains a non-Schema object."); + } + if (!types3.every(function(type3) { + return type3 instanceof Type3; + })) { + throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + return new Schema9({ + include: schemas5, + explicit: types3 + }); + }; + module5.exports = Schema9; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/str.js +var require_str2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/str.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + module5.exports = new Type3("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return data !== null ? data : ""; + } + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/seq.js +var require_seq2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/seq.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + module5.exports = new Type3("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return data !== null ? data : []; + } + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/map.js +var require_map2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/map.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + module5.exports = new Type3("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return data !== null ? data : {}; + } + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +var require_failsafe2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema6(); + module5.exports = new Schema9({ + explicit: [ + require_str2(), + require_seq2(), + require_map2() + ] + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/null.js +var require_null2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/null.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + function resolveYamlNull2(data) { + if (data === null) + return true; + var max2 = data.length; + return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); + } + function constructYamlNull2() { + return null; + } + function isNull4(object) { + return object === null; + } + module5.exports = new Type3("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull2, + construct: constructYamlNull2, + predicate: isNull4, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/bool.js +var require_bool2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/bool.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + function resolveYamlBoolean2(data) { + if (data === null) + return false; + var max2 = data.length; + return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); + } + function constructYamlBoolean2(data) { + return data === "true" || data === "True" || data === "TRUE"; + } + function isBoolean4(object) { + return Object.prototype.toString.call(object) === "[object Boolean]"; + } + module5.exports = new Type3("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean2, + construct: constructYamlBoolean2, + predicate: isBoolean4, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/int.js +var require_int2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/int.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + var Type3 = require_type3(); + function isHexCode2(c7) { + return 48 <= c7 && c7 <= 57 || 65 <= c7 && c7 <= 70 || 97 <= c7 && c7 <= 102; + } + function isOctCode2(c7) { + return 48 <= c7 && c7 <= 55; + } + function isDecCode2(c7) { + return 48 <= c7 && c7 <= 57; + } + function resolveYamlInteger2(data) { + if (data === null) + return false; + var max2 = data.length, index4 = 0, hasDigits = false, ch; + if (!max2) + return false; + ch = data[index4]; + if (ch === "-" || ch === "+") { + ch = data[++index4]; + } + if (ch === "0") { + if (index4 + 1 === max2) + return true; + ch = data[++index4]; + if (ch === "b") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (ch !== "0" && ch !== "1") + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isHexCode2(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isOctCode2(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "_") + return false; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (ch === ":") + break; + if (!isDecCode2(data.charCodeAt(index4))) { + return false; + } + hasDigits = true; + } + if (!hasDigits || ch === "_") + return false; + if (ch !== ":") + return true; + return /^(:[0-5]?[0-9])+$/.test(data.slice(index4)); + } + function constructYamlInteger2(data) { + var value2 = data, sign = 1, ch, base, digits = []; + if (value2.indexOf("_") !== -1) { + value2 = value2.replace(/_/g, ""); + } + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") + sign = -1; + value2 = value2.slice(1); + ch = value2[0]; + } + if (value2 === "0") + return 0; + if (ch === "0") { + if (value2[1] === "b") + return sign * parseInt(value2.slice(2), 2); + if (value2[1] === "x") + return sign * parseInt(value2, 16); + return sign * parseInt(value2, 8); + } + if (value2.indexOf(":") !== -1) { + value2.split(":").forEach(function(v8) { + digits.unshift(parseInt(v8, 10)); + }); + value2 = 0; + base = 1; + digits.forEach(function(d7) { + value2 += d7 * base; + base *= 60; + }); + return sign * value2; + } + return sign * parseInt(value2, 10); + } + function isInteger3(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common3.isNegativeZero(object)); + } + module5.exports = new Type3("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger2, + construct: constructYamlInteger2, + predicate: isInteger3, + represent: { + binary: function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, + octal: function(obj) { + return obj >= 0 ? "0" + obj.toString(8) : "-0" + obj.toString(8).slice(1); + }, + decimal: function(obj) { + return obj.toString(10); + }, + /* eslint-disable max-len */ + hexadecimal: function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/float.js +var require_float2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/float.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + var Type3 = require_type3(); + var YAML_FLOAT_PATTERN2 = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" + ); + function resolveYamlFloat2(data) { + if (data === null) + return false; + if (!YAML_FLOAT_PATTERN2.test(data) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === "_") { + return false; + } + return true; + } + function constructYamlFloat2(data) { + var value2, sign, base, digits; + value2 = data.replace(/_/g, "").toLowerCase(); + sign = value2[0] === "-" ? -1 : 1; + digits = []; + if ("+-".indexOf(value2[0]) >= 0) { + value2 = value2.slice(1); + } + if (value2 === ".inf") { + return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (value2 === ".nan") { + return NaN; + } else if (value2.indexOf(":") >= 0) { + value2.split(":").forEach(function(v8) { + digits.unshift(parseFloat(v8, 10)); + }); + value2 = 0; + base = 1; + digits.forEach(function(d7) { + value2 += d7 * base; + base *= 60; + }); + return sign * value2; + } + return sign * parseFloat(value2, 10); + } + var SCIENTIFIC_WITHOUT_DOT2 = /^[-+]?[0-9]+e/; + function representYamlFloat2(object, style) { + var res; + if (isNaN(object)) { + switch (style) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common3.isNegativeZero(object)) { + return "-0.0"; + } + res = object.toString(10); + return SCIENTIFIC_WITHOUT_DOT2.test(res) ? res.replace("e", ".e") : res; + } + function isFloat2(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common3.isNegativeZero(object)); + } + module5.exports = new Type3("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat2, + construct: constructYamlFloat2, + predicate: isFloat2, + represent: representYamlFloat2, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/json.js +var require_json4 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/json.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema6(); + module5.exports = new Schema9({ + include: [ + require_failsafe2() + ], + implicit: [ + require_null2(), + require_bool2(), + require_int2(), + require_float2() + ] + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/core.js +var require_core8 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/core.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema6(); + module5.exports = new Schema9({ + include: [ + require_json4() + ] + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +var require_timestamp2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/timestamp.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + var YAML_DATE_REGEXP2 = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" + ); + var YAML_TIMESTAMP_REGEXP2 = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" + ); + function resolveYamlTimestamp2(data) { + if (data === null) + return false; + if (YAML_DATE_REGEXP2.exec(data) !== null) + return true; + if (YAML_TIMESTAMP_REGEXP2.exec(data) !== null) + return true; + return false; + } + function constructYamlTimestamp2(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_DATE_REGEXP2.exec(data); + if (match === null) + match = YAML_TIMESTAMP_REGEXP2.exec(data); + if (match === null) + throw new Error("Date resolve error"); + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { + fraction += "0"; + } + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match[9] === "-") + delta = -delta; + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) + date.setTime(date.getTime() - delta); + return date; + } + function representYamlTimestamp2(object) { + return object.toISOString(); + } + module5.exports = new Type3("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp2, + construct: constructYamlTimestamp2, + instanceOf: Date, + represent: representYamlTimestamp2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/merge.js +var require_merge2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/merge.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + function resolveYamlMerge2(data) { + return data === "<<" || data === null; + } + module5.exports = new Type3("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/binary.js +var require_binary2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/binary.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var NodeBuffer; + try { + _require = __require; + NodeBuffer = _require("buffer").Buffer; + } catch (__) { + } + var _require; + var Type3 = require_type3(); + var BASE64_MAP2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + function resolveYamlBinary2(data) { + if (data === null) + return false; + var code, idx, bitlen = 0, max2 = data.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + code = map4.indexOf(data.charAt(idx)); + if (code > 64) + continue; + if (code < 0) + return false; + bitlen += 6; + } + return bitlen % 8 === 0; + } + function constructYamlBinary2(data) { + var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map4 = BASE64_MAP2, bits = 0, result2 = []; + for (idx = 0; idx < max2; idx++) { + if (idx % 4 === 0 && idx) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } + bits = bits << 6 | map4.indexOf(input.charAt(idx)); + } + tailbits = max2 % 4 * 6; + if (tailbits === 0) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } else if (tailbits === 18) { + result2.push(bits >> 10 & 255); + result2.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result2.push(bits >> 4 & 255); + } + if (NodeBuffer) { + return NodeBuffer.from ? NodeBuffer.from(result2) : new NodeBuffer(result2); + } + return result2; + } + function representYamlBinary2(object) { + var result2 = "", bits = 0, idx, tail2, max2 = object.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + if (idx % 3 === 0 && idx) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail2 = max2 % 3; + if (tail2 === 0) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } else if (tail2 === 2) { + result2 += map4[bits >> 10 & 63]; + result2 += map4[bits >> 4 & 63]; + result2 += map4[bits << 2 & 63]; + result2 += map4[64]; + } else if (tail2 === 1) { + result2 += map4[bits >> 2 & 63]; + result2 += map4[bits << 4 & 63]; + result2 += map4[64]; + result2 += map4[64]; + } + return result2; + } + function isBinary2(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); + } + module5.exports = new Type3("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary2, + construct: constructYamlBinary2, + predicate: isBinary2, + represent: representYamlBinary2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/omap.js +var require_omap2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/omap.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var _toString2 = Object.prototype.toString; + function resolveYamlOmap2(data) { + if (data === null) + return true; + var objectKeys = [], index4, length, pair, pairKey, pairHasKey, object = data; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + pairHasKey = false; + if (_toString2.call(pair) !== "[object Object]") + return false; + for (pairKey in pair) { + if (_hasOwnProperty2.call(pair, pairKey)) { + if (!pairHasKey) + pairHasKey = true; + else + return false; + } + } + if (!pairHasKey) + return false; + if (objectKeys.indexOf(pairKey) === -1) + objectKeys.push(pairKey); + else + return false; + } + return true; + } + function constructYamlOmap2(data) { + return data !== null ? data : []; + } + module5.exports = new Type3("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap2, + construct: constructYamlOmap2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/pairs.js +var require_pairs2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/pairs.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + var _toString2 = Object.prototype.toString; + function resolveYamlPairs2(data) { + if (data === null) + return true; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + if (_toString2.call(pair) !== "[object Object]") + return false; + keys2 = Object.keys(pair); + if (keys2.length !== 1) + return false; + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return true; + } + function constructYamlPairs2(data) { + if (data === null) + return []; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + keys2 = Object.keys(pair); + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return result2; + } + module5.exports = new Type3("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs2, + construct: constructYamlPairs2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/set.js +var require_set2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/set.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + function resolveYamlSet2(data) { + if (data === null) + return true; + var key, object = data; + for (key in object) { + if (_hasOwnProperty2.call(object, key)) { + if (object[key] !== null) + return false; + } + } + return true; + } + function constructYamlSet2(data) { + return data !== null ? data : {}; + } + module5.exports = new Type3("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet2, + construct: constructYamlSet2 + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +var require_default_safe2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema6(); + module5.exports = new Schema9({ + include: [ + require_core8() + ], + implicit: [ + require_timestamp2(), + require_merge2() + ], + explicit: [ + require_binary2(), + require_omap2(), + require_pairs2(), + require_set2() + ] + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +var require_undefined3 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + function resolveJavascriptUndefined() { + return true; + } + function constructJavascriptUndefined() { + return void 0; + } + function representJavascriptUndefined() { + return ""; + } + function isUndefined3(object) { + return typeof object === "undefined"; + } + module5.exports = new Type3("tag:yaml.org,2002:js/undefined", { + kind: "scalar", + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined3, + represent: representJavascriptUndefined + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +var require_regexp2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type3(); + function resolveJavascriptRegExp(data) { + if (data === null) + return false; + if (data.length === 0) + return false; + var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = ""; + if (regexp[0] === "/") { + if (tail2) + modifiers = tail2[1]; + if (modifiers.length > 3) + return false; + if (regexp[regexp.length - modifiers.length - 1] !== "/") + return false; + } + return true; + } + function constructJavascriptRegExp(data) { + var regexp = data, tail2 = /\/([gim]*)$/.exec(data), modifiers = ""; + if (regexp[0] === "/") { + if (tail2) + modifiers = tail2[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + return new RegExp(regexp, modifiers); + } + function representJavascriptRegExp(object) { + var result2 = "/" + object.source + "/"; + if (object.global) + result2 += "g"; + if (object.multiline) + result2 += "m"; + if (object.ignoreCase) + result2 += "i"; + return result2; + } + function isRegExp3(object) { + return Object.prototype.toString.call(object) === "[object RegExp]"; + } + module5.exports = new Type3("tag:yaml.org,2002:js/regexp", { + kind: "scalar", + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp3, + represent: representJavascriptRegExp + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/function.js +var require_function4 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/type/js/function.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var esprima; + try { + _require = __require; + esprima = _require("esprima"); + } catch (_6) { + if (typeof window !== "undefined") + esprima = window.esprima; + } + var _require; + var Type3 = require_type3(); + function resolveJavascriptFunction(data) { + if (data === null) + return false; + try { + var source = "(" + data + ")", ast = esprima.parse(source, { range: true }); + if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") { + return false; + } + return true; + } catch (err) { + return false; + } + } + function constructJavascriptFunction(data) { + var source = "(" + data + ")", ast = esprima.parse(source, { range: true }), params = [], body; + if (ast.type !== "Program" || ast.body.length !== 1 || ast.body[0].type !== "ExpressionStatement" || ast.body[0].expression.type !== "ArrowFunctionExpression" && ast.body[0].expression.type !== "FunctionExpression") { + throw new Error("Failed to resolve function"); + } + ast.body[0].expression.params.forEach(function(param) { + params.push(param.name); + }); + body = ast.body[0].expression.body.range; + if (ast.body[0].expression.body.type === "BlockStatement") { + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + return new Function(params, "return " + source.slice(body[0], body[1])); + } + function representJavascriptFunction(object) { + return object.toString(); + } + function isFunction3(object) { + return Object.prototype.toString.call(object) === "[object Function]"; + } + module5.exports = new Type3("tag:yaml.org,2002:js/function", { + kind: "scalar", + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction3, + represent: representJavascriptFunction + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +var require_default_full2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/schema/default_full.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema6(); + module5.exports = Schema9.DEFAULT = new Schema9({ + include: [ + require_default_safe2() + ], + explicit: [ + require_undefined3(), + require_regexp2(), + require_function4() + ] + }); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/loader.js +var require_loader2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/loader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + var YAMLException2 = require_exception2(); + var Mark = require_mark2(); + var DEFAULT_SAFE_SCHEMA = require_default_safe2(); + var DEFAULT_FULL_SCHEMA = require_default_full2(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CONTEXT_FLOW_IN2 = 1; + var CONTEXT_FLOW_OUT2 = 2; + var CONTEXT_BLOCK_IN2 = 3; + var CONTEXT_BLOCK_OUT2 = 4; + var CHOMPING_CLIP2 = 1; + var CHOMPING_STRIP2 = 2; + var CHOMPING_KEEP2 = 3; + var PATTERN_NON_PRINTABLE2 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS2 = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS2 = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE2 = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI2 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function _class2(obj) { + return Object.prototype.toString.call(obj); + } + function is_EOL2(c7) { + return c7 === 10 || c7 === 13; + } + function is_WHITE_SPACE2(c7) { + return c7 === 9 || c7 === 32; + } + function is_WS_OR_EOL2(c7) { + return c7 === 9 || c7 === 32 || c7 === 10 || c7 === 13; + } + function is_FLOW_INDICATOR2(c7) { + return c7 === 44 || c7 === 91 || c7 === 93 || c7 === 123 || c7 === 125; + } + function fromHexCode2(c7) { + var lc; + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + lc = c7 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; + } + function escapedHexLen2(c7) { + if (c7 === 120) { + return 2; + } + if (c7 === 117) { + return 4; + } + if (c7 === 85) { + return 8; + } + return 0; + } + function fromDecimalCode2(c7) { + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + return -1; + } + function simpleEscapeSequence2(c7) { + return c7 === 48 ? "\0" : c7 === 97 ? "\x07" : c7 === 98 ? "\b" : c7 === 116 ? " " : c7 === 9 ? " " : c7 === 110 ? "\n" : c7 === 118 ? "\v" : c7 === 102 ? "\f" : c7 === 114 ? "\r" : c7 === 101 ? "\x1B" : c7 === 32 ? " " : c7 === 34 ? '"' : c7 === 47 ? "/" : c7 === 92 ? "\\" : c7 === 78 ? "\x85" : c7 === 95 ? "\xA0" : c7 === 76 ? "\u2028" : c7 === 80 ? "\u2029" : ""; + } + function charFromCodepoint2(c7) { + if (c7 <= 65535) { + return String.fromCharCode(c7); + } + return String.fromCharCode( + (c7 - 65536 >> 10) + 55296, + (c7 - 65536 & 1023) + 56320 + ); + } + var simpleEscapeCheck2 = new Array(256); + var simpleEscapeMap2 = new Array(256); + for (i7 = 0; i7 < 256; i7++) { + simpleEscapeCheck2[i7] = simpleEscapeSequence2(i7) ? 1 : 0; + simpleEscapeMap2[i7] = simpleEscapeSequence2(i7); + } + var i7; + function State2(input, options) { + this.input = input; + this.filename = options["filename"] || null; + this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; + this.onWarning = options["onWarning"] || null; + this.legacy = options["legacy"] || false; + this.json = options["json"] || false; + this.listener = options["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.documents = []; + } + function generateError2(state, message) { + return new YAMLException2( + message, + new Mark(state.filename, state.input, state.position, state.line, state.position - state.lineStart) + ); + } + function throwError2(state, message) { + throw generateError2(state, message); + } + function throwWarning2(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError2(state, message)); + } + } + var directiveHandlers2 = { + YAML: function handleYamlDirective2(state, name2, args) { + var match, major, minor; + if (state.version !== null) { + throwError2(state, "duplication of %YAML directive"); + } + if (args.length !== 1) { + throwError2(state, "YAML directive accepts exactly one argument"); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) { + throwError2(state, "ill-formed argument of the YAML directive"); + } + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (major !== 1) { + throwError2(state, "unacceptable YAML version of the document"); + } + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning2(state, "unsupported YAML version of the document"); + } + }, + TAG: function handleTagDirective2(state, name2, args) { + var handle, prefix; + if (args.length !== 2) { + throwError2(state, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE2.test(handle)) { + throwError2(state, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty2.call(state.tagMap, handle)) { + throwError2(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI2.test(prefix)) { + throwError2(state, "ill-formed tag prefix (second argument) of the TAG directive"); + } + state.tagMap[handle] = prefix; + } + }; + function captureSegment2(state, start, end, checkJson) { + var _position, _length, _character, _result; + if (start < end) { + _result = state.input.slice(start, end); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { + throwError2(state, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE2.test(_result)) { + throwError2(state, "the stream contains non-printable characters"); + } + state.result += _result; + } + } + function mergeMappings2(state, destination, source, overridableKeys) { + var sourceKeys, key, index4, quantity; + if (!common3.isObject(source)) { + throwError2(state, "cannot merge mappings; the provided source object is unacceptable"); + } + sourceKeys = Object.keys(source); + for (index4 = 0, quantity = sourceKeys.length; index4 < quantity; index4 += 1) { + key = sourceKeys[index4]; + if (!_hasOwnProperty2.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } + } + function storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index4, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index4 = 0, quantity = keyNode.length; index4 < quantity; index4 += 1) { + if (Array.isArray(keyNode[index4])) { + throwError2(state, "nested arrays are not supported inside keys"); + } + if (typeof keyNode === "object" && _class2(keyNode[index4]) === "[object Object]") { + keyNode[index4] = "[object Object]"; + } + } + } + if (typeof keyNode === "object" && _class2(keyNode) === "[object Object]") { + keyNode = "[object Object]"; + } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; + } + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index4 = 0, quantity = valueNode.length; index4 < quantity; index4 += 1) { + mergeMappings2(state, _result, valueNode[index4], overridableKeys); + } + } else { + mergeMappings2(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && !_hasOwnProperty2.call(overridableKeys, keyNode) && _hasOwnProperty2.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError2(state, "duplicated mapping key"); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + return _result; + } + function readLineBreak2(state) { + var ch; + ch = state.input.charCodeAt(state.position); + if (ch === 10) { + state.position++; + } else if (ch === 13) { + state.position++; + if (state.input.charCodeAt(state.position) === 10) { + state.position++; + } + } else { + throwError2(state, "a line break is expected"); + } + state.line += 1; + state.lineStart = state.position; + } + function skipSeparationSpace2(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); + } + if (is_EOL2(ch)) { + readLineBreak2(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning2(state, "deficient indentation"); + } + return lineBreaks; + } + function testDocumentSeparator2(state) { + var _position = state.position, ch; + ch = state.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL2(ch)) { + return true; + } + } + return false; + } + function writeFoldedLines2(state, count2) { + if (count2 === 1) { + state.result += " "; + } else if (count2 > 1) { + state.result += common3.repeat("\n", count2 - 1); + } + } + function readPlainScalar2(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; + ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL2(ch) || is_FLOW_INDICATOR2(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { + return false; + } + if (ch === 63 || ch === 45) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + return false; + } + } + state.kind = "scalar"; + state.result = ""; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + break; + } + } else if (ch === 35) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL2(preceding)) { + break; + } + } else if (state.position === state.lineStart && testDocumentSeparator2(state) || withinFlowCollection && is_FLOW_INDICATOR2(ch)) { + break; + } else if (is_EOL2(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace2(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment2(state, captureStart, captureEnd, false); + writeFoldedLines2(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE2(ch)) { + captureEnd = state.position + 1; + } + ch = state.input.charCodeAt(++state.position); + } + captureSegment2(state, captureStart, captureEnd, false); + if (state.result) { + return true; + } + state.kind = _kind; + state.result = _result; + return false; + } + function readSingleQuotedScalar2(state, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state.input.charCodeAt(state.position); + if (ch !== 39) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 39) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (ch === 39) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a single quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError2(state, "unexpected end of the stream within a single quoted scalar"); + } + function readDoubleQuotedScalar2(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 34) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 34) { + captureSegment2(state, captureStart, state.position, true); + state.position++; + return true; + } else if (ch === 92) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL2(ch)) { + skipSeparationSpace2(state, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck2[ch]) { + state.result += simpleEscapeMap2[ch]; + state.position++; + } else if ((tmp = escapedHexLen2(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode2(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError2(state, "expected hexadecimal character"); + } + } + state.result += charFromCodepoint2(hexResult); + state.position++; + } else { + throwError2(state, "unknown escape sequence"); + } + captureStart = captureEnd = state.position; + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a double quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError2(state, "unexpected end of the stream within a double quoted scalar"); + } + function readFlowCollection2(state, nodeIndent) { + var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair2, isExplicitPair, isMapping, overridableKeys = {}, keyNode, keyTag, valueNode, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(++state.position); + while (ch !== 0) { + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + return true; + } else if (!readNext) { + throwError2(state, "missed comma between flow collection entries"); + } + keyTag = keyNode = valueNode = null; + isPair2 = isExplicitPair = false; + if (ch === 63) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following)) { + isPair2 = isExplicitPair = true; + state.position++; + skipSeparationSpace2(state, true, nodeIndent); + } + } + _line = state.line; + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && ch === 58) { + isPair2 = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace2(state, true, nodeIndent); + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair2) { + _result.push(storeMappingPair2(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === 44) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + throwError2(state, "unexpected end of the stream within a flow collection"); + } + function readBlockScalar2(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP2, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + state.kind = "scalar"; + state.result = ""; + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP2 === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP2 : CHOMPING_STRIP2; + } else { + throwError2(state, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode2(ch)) >= 0) { + if (tmp === 0) { + throwError2(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError2(state, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE2(ch)) { + do { + ch = state.input.charCodeAt(++state.position); + } while (is_WHITE_SPACE2(ch)); + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (!is_EOL2(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak2(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + if (is_EOL2(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP2) { + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP2) { + if (didReadContent) { + state.result += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE2(ch)) { + atMoreIndented = true; + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common3.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state.result += " "; + } + } else { + state.result += common3.repeat("\n", emptyLines); + } + } else { + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL2(ch) && ch !== 0) { + ch = state.input.charCodeAt(++state.position); + } + captureSegment2(state, captureStart, state.position, false); + } + return true; + } + function readBlockSequence2(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (ch !== 45) { + break; + } + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL2(following)) { + break; + } + detected = true; + state.position++; + if (skipSeparationSpace2(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode3(state, nodeIndent, CONTEXT_BLOCK_IN2, false, true); + _result.push(state.result); + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError2(state, "bad indentation of a sequence entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + return true; + } + return false; + } + function readBlockMapping2(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _pos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + _pos = state.position; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL2(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else { + throwError2(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + } + state.position += 1; + ch = following; + } else if (composeNode3(state, flowIndent, CONTEXT_FLOW_OUT2, false, true)) { + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 58) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL2(ch)) { + throwError2(state, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (detected) { + throwError2(state, "can not read an implicit mapping pair; a colon is missed"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) { + throwError2(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else { + break; + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode3(state, nodeIndent, CONTEXT_BLOCK_OUT2, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + if (!atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if (state.lineIndent > nodeIndent && ch !== 0) { + throwError2(state, "bad indentation of a mapping entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null); + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; + } + function readTagProperty2(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 33) + return false; + if (state.tag !== null) { + throwError2(state, "duplication of a tag property"); + } + ch = state.input.charCodeAt(++state.position); + if (ch === 60) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 33) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else { + tagHandle = "!"; + } + _position = state.position; + if (isVerbatim) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && ch !== 62); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError2(state, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + if (ch === 33) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE2.test(tagHandle)) { + throwError2(state, "named tag handle cannot contain such characters"); + } + isNamed = true; + _position = state.position + 1; + } else { + throwError2(state, "tag suffix cannot contain exclamation marks"); + } + } + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS2.test(tagName)) { + throwError2(state, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI2.test(tagName)) { + throwError2(state, "tag name cannot contain such characters: " + tagName); + } + if (isVerbatim) { + state.tag = tagName; + } else if (_hasOwnProperty2.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError2(state, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; + } + function readAnchorProperty2(state) { + var _position, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 38) + return false; + if (state.anchor !== null) { + throwError2(state, "duplication of an anchor property"); + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError2(state, "name of an anchor node must contain at least one character"); + } + state.anchor = state.input.slice(_position, state.position); + return true; + } + function readAlias2(state) { + var _position, alias, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 42) + return false; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError2(state, "name of an alias node must contain at least one character"); + } + alias = state.input.slice(_position, state.position); + if (!_hasOwnProperty2.call(state.anchorMap, alias)) { + throwError2(state, 'unidentified alias "' + alias + '"'); + } + state.result = state.anchorMap[alias]; + skipSeparationSpace2(state, true, -1); + return true; + } + function composeNode3(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type3, flowIndent, blockIndent; + if (state.listener !== null) { + state.listener("open", state); + } + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT2 === nodeContext || CONTEXT_BLOCK_IN2 === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty2(state) || readAnchorProperty2(state)) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (indentStatus === 1 || CONTEXT_BLOCK_OUT2 === nodeContext) { + if (CONTEXT_FLOW_IN2 === nodeContext || CONTEXT_FLOW_OUT2 === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state.position - state.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence2(state, blockIndent) || readBlockMapping2(state, blockIndent, flowIndent)) || readFlowCollection2(state, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar2(state, flowIndent) || readSingleQuotedScalar2(state, flowIndent) || readDoubleQuotedScalar2(state, flowIndent)) { + hasContent = true; + } else if (readAlias2(state)) { + hasContent = true; + if (state.tag !== null || state.anchor !== null) { + throwError2(state, "alias node should not have any properties"); + } + } else if (readPlainScalar2(state, flowIndent, CONTEXT_FLOW_IN2 === nodeContext)) { + hasContent = true; + if (state.tag === null) { + state.tag = "?"; + } + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence2(state, blockIndent); + } + } + if (state.tag !== null && state.tag !== "!") { + if (state.tag === "?") { + if (state.result !== null && state.kind !== "scalar") { + throwError2(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state.implicitTypes[typeIndex]; + if (type3.resolve(state.result)) { + state.result = type3.construct(state.result); + state.tag = type3.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty2.call(state.typeMap[state.kind || "fallback"], state.tag)) { + type3 = state.typeMap[state.kind || "fallback"][state.tag]; + if (state.result !== null && type3.kind !== state.kind) { + throwError2(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type3.kind + '", not "' + state.kind + '"'); + } + if (!type3.resolve(state.result)) { + throwError2(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + } else { + state.result = type3.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError2(state, "unknown tag !<" + state.tag + ">"); + } + } + if (state.listener !== null) { + state.listener("close", state); + } + return state.tag !== null || state.anchor !== null || hasContent; + } + function readDocument2(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || ch !== 37) { + break; + } + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError2(state, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && !is_EOL2(ch)); + break; + } + if (is_EOL2(ch)) + break; + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (ch !== 0) + readLineBreak2(state); + if (_hasOwnProperty2.call(directiveHandlers2, directiveName)) { + directiveHandlers2[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning2(state, 'unknown document directive "' + directiveName + '"'); + } + } + skipSeparationSpace2(state, true, -1); + if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } else if (hasDirectives) { + throwError2(state, "directives end mark is expected"); + } + composeNode3(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT2, false, true); + skipSeparationSpace2(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS2.test(state.input.slice(documentStart, state.position))) { + throwWarning2(state, "non-ASCII line breaks are interpreted as content"); + } + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator2(state)) { + if (state.input.charCodeAt(state.position) === 46) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } + return; + } + if (state.position < state.length - 1) { + throwError2(state, "end of the stream or a document separator is expected"); + } else { + return; + } + } + function loadDocuments2(input, options) { + input = String(input); + options = options || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state = new State2(input, options); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state.position = nullpos; + throwError2(state, "null byte is not allowed in input"); + } + state.input += "\0"; + while (state.input.charCodeAt(state.position) === 32) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) { + readDocument2(state); + } + return state.documents; + } + function loadAll2(input, iterator, options) { + if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { + options = iterator; + iterator = null; + } + var documents = loadDocuments2(input, options); + if (typeof iterator !== "function") { + return documents; + } + for (var index4 = 0, length = documents.length; index4 < length; index4 += 1) { + iterator(documents[index4]); + } + } + function load2(input, options) { + var documents = loadDocuments2(input, options); + if (documents.length === 0) { + return void 0; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException2("expected a single document in the stream, but found more"); + } + function safeLoadAll2(input, iterator, options) { + if (typeof iterator === "object" && iterator !== null && typeof options === "undefined") { + options = iterator; + iterator = null; + } + return loadAll2(input, iterator, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + function safeLoad2(input, options) { + return load2(input, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + module5.exports.loadAll = loadAll2; + module5.exports.load = load2; + module5.exports.safeLoadAll = safeLoadAll2; + module5.exports.safeLoad = safeLoad2; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/dumper.js +var require_dumper2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml/dumper.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common2(); + var YAMLException2 = require_exception2(); + var DEFAULT_FULL_SCHEMA = require_default_full2(); + var DEFAULT_SAFE_SCHEMA = require_default_safe2(); + var _toString2 = Object.prototype.toString; + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CHAR_TAB2 = 9; + var CHAR_LINE_FEED2 = 10; + var CHAR_CARRIAGE_RETURN2 = 13; + var CHAR_SPACE2 = 32; + var CHAR_EXCLAMATION2 = 33; + var CHAR_DOUBLE_QUOTE2 = 34; + var CHAR_SHARP2 = 35; + var CHAR_PERCENT2 = 37; + var CHAR_AMPERSAND2 = 38; + var CHAR_SINGLE_QUOTE2 = 39; + var CHAR_ASTERISK2 = 42; + var CHAR_COMMA2 = 44; + var CHAR_MINUS2 = 45; + var CHAR_COLON2 = 58; + var CHAR_EQUALS2 = 61; + var CHAR_GREATER_THAN2 = 62; + var CHAR_QUESTION2 = 63; + var CHAR_COMMERCIAL_AT2 = 64; + var CHAR_LEFT_SQUARE_BRACKET2 = 91; + var CHAR_RIGHT_SQUARE_BRACKET2 = 93; + var CHAR_GRAVE_ACCENT2 = 96; + var CHAR_LEFT_CURLY_BRACKET2 = 123; + var CHAR_VERTICAL_LINE2 = 124; + var CHAR_RIGHT_CURLY_BRACKET2 = 125; + var ESCAPE_SEQUENCES2 = {}; + ESCAPE_SEQUENCES2[0] = "\\0"; + ESCAPE_SEQUENCES2[7] = "\\a"; + ESCAPE_SEQUENCES2[8] = "\\b"; + ESCAPE_SEQUENCES2[9] = "\\t"; + ESCAPE_SEQUENCES2[10] = "\\n"; + ESCAPE_SEQUENCES2[11] = "\\v"; + ESCAPE_SEQUENCES2[12] = "\\f"; + ESCAPE_SEQUENCES2[13] = "\\r"; + ESCAPE_SEQUENCES2[27] = "\\e"; + ESCAPE_SEQUENCES2[34] = '\\"'; + ESCAPE_SEQUENCES2[92] = "\\\\"; + ESCAPE_SEQUENCES2[133] = "\\N"; + ESCAPE_SEQUENCES2[160] = "\\_"; + ESCAPE_SEQUENCES2[8232] = "\\L"; + ESCAPE_SEQUENCES2[8233] = "\\P"; + var DEPRECATED_BOOLEANS_SYNTAX2 = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" + ]; + function compileStyleMap2(schema8, map4) { + var result2, keys2, index4, length, tag, style, type3; + if (map4 === null) + return {}; + result2 = {}; + keys2 = Object.keys(map4); + for (index4 = 0, length = keys2.length; index4 < length; index4 += 1) { + tag = keys2[index4]; + style = String(map4[tag]); + if (tag.slice(0, 2) === "!!") { + tag = "tag:yaml.org,2002:" + tag.slice(2); + } + type3 = schema8.compiledTypeMap["fallback"][tag]; + if (type3 && _hasOwnProperty2.call(type3.styleAliases, style)) { + style = type3.styleAliases[style]; + } + result2[tag] = style; + } + return result2; + } + function encodeHex2(character) { + var string2, handle, length; + string2 = character.toString(16).toUpperCase(); + if (character <= 255) { + handle = "x"; + length = 2; + } else if (character <= 65535) { + handle = "u"; + length = 4; + } else if (character <= 4294967295) { + handle = "U"; + length = 8; + } else { + throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF"); + } + return "\\" + handle + common3.repeat("0", length - string2.length) + string2; + } + function State2(options) { + this.schema = options["schema"] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, options["indent"] || 2); + this.noArrayIndent = options["noArrayIndent"] || false; + this.skipInvalid = options["skipInvalid"] || false; + this.flowLevel = common3.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; + this.styleMap = compileStyleMap2(this.schema, options["styles"] || null); + this.sortKeys = options["sortKeys"] || false; + this.lineWidth = options["lineWidth"] || 80; + this.noRefs = options["noRefs"] || false; + this.noCompatMode = options["noCompatMode"] || false; + this.condenseFlow = options["condenseFlow"] || false; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; + } + function indentString2(string2, spaces) { + var ind = common3.repeat(" ", spaces), position = 0, next = -1, result2 = "", line, length = string2.length; + while (position < length) { + next = string2.indexOf("\n", position); + if (next === -1) { + line = string2.slice(position); + position = length; + } else { + line = string2.slice(position, next + 1); + position = next + 1; + } + if (line.length && line !== "\n") + result2 += ind; + result2 += line; + } + return result2; + } + function generateNextLine2(state, level) { + return "\n" + common3.repeat(" ", state.indent * level); + } + function testImplicitResolving2(state, str2) { + var index4, length, type3; + for (index4 = 0, length = state.implicitTypes.length; index4 < length; index4 += 1) { + type3 = state.implicitTypes[index4]; + if (type3.resolve(str2)) { + return true; + } + } + return false; + } + function isWhitespace2(c7) { + return c7 === CHAR_SPACE2 || c7 === CHAR_TAB2; + } + function isPrintable2(c7) { + return 32 <= c7 && c7 <= 126 || 161 <= c7 && c7 <= 55295 && c7 !== 8232 && c7 !== 8233 || 57344 <= c7 && c7 <= 65533 && c7 !== 65279 || 65536 <= c7 && c7 <= 1114111; + } + function isNsChar(c7) { + return isPrintable2(c7) && !isWhitespace2(c7) && c7 !== 65279 && c7 !== CHAR_CARRIAGE_RETURN2 && c7 !== CHAR_LINE_FEED2; + } + function isPlainSafe2(c7, prev) { + return isPrintable2(c7) && c7 !== 65279 && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2 && c7 !== CHAR_COLON2 && (c7 !== CHAR_SHARP2 || prev && isNsChar(prev)); + } + function isPlainSafeFirst2(c7) { + return isPrintable2(c7) && c7 !== 65279 && !isWhitespace2(c7) && c7 !== CHAR_MINUS2 && c7 !== CHAR_QUESTION2 && c7 !== CHAR_COLON2 && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2 && c7 !== CHAR_SHARP2 && c7 !== CHAR_AMPERSAND2 && c7 !== CHAR_ASTERISK2 && c7 !== CHAR_EXCLAMATION2 && c7 !== CHAR_VERTICAL_LINE2 && c7 !== CHAR_EQUALS2 && c7 !== CHAR_GREATER_THAN2 && c7 !== CHAR_SINGLE_QUOTE2 && c7 !== CHAR_DOUBLE_QUOTE2 && c7 !== CHAR_PERCENT2 && c7 !== CHAR_COMMERCIAL_AT2 && c7 !== CHAR_GRAVE_ACCENT2; + } + function needIndentIndicator2(string2) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string2); + } + var STYLE_PLAIN2 = 1; + var STYLE_SINGLE2 = 2; + var STYLE_LITERAL2 = 3; + var STYLE_FOLDED2 = 4; + var STYLE_DOUBLE2 = 5; + function chooseScalarStyle2(string2, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i7; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst2(string2.charCodeAt(0)) && !isWhitespace2(string2.charCodeAt(string2.length - 1)); + if (singleLineOnly) { + for (i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + prev_char = i7 > 0 ? string2.charCodeAt(i7 - 1) : null; + plain = plain && isPlainSafe2(char, prev_char); + } + } else { + for (i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (char === CHAR_LINE_FEED2) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. + i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "; + previousLineBreak = i7; + } + } else if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + prev_char = i7 > 0 ? string2.charCodeAt(i7 - 1) : null; + plain = plain && isPlainSafe2(char, prev_char); + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "); + } + if (!hasLineBreak && !hasFoldableLine) { + return plain && !testAmbiguousType(string2) ? STYLE_PLAIN2 : STYLE_SINGLE2; + } + if (indentPerLevel > 9 && needIndentIndicator2(string2)) { + return STYLE_DOUBLE2; + } + return hasFoldableLine ? STYLE_FOLDED2 : STYLE_LITERAL2; + } + function writeScalar2(state, string2, level, iskey) { + state.dump = function() { + if (string2.length === 0) { + return "''"; + } + if (!state.noCompatMode && DEPRECATED_BOOLEANS_SYNTAX2.indexOf(string2) !== -1) { + return "'" + string2 + "'"; + } + var indent = state.indent * Math.max(1, level); + var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; + function testAmbiguity(string3) { + return testImplicitResolving2(state, string3); + } + switch (chooseScalarStyle2(string2, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN2: + return string2; + case STYLE_SINGLE2: + return "'" + string2.replace(/'/g, "''") + "'"; + case STYLE_LITERAL2: + return "|" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(string2, indent)); + case STYLE_FOLDED2: + return ">" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(foldString2(string2, lineWidth), indent)); + case STYLE_DOUBLE2: + return '"' + escapeString2(string2, lineWidth) + '"'; + default: + throw new YAMLException2("impossible error: invalid scalar style"); + } + }(); + } + function blockHeader2(string2, indentPerLevel) { + var indentIndicator = needIndentIndicator2(string2) ? String(indentPerLevel) : ""; + var clip = string2[string2.length - 1] === "\n"; + var keep = clip && (string2[string2.length - 2] === "\n" || string2 === "\n"); + var chomp = keep ? "+" : clip ? "" : "-"; + return indentIndicator + chomp + "\n"; + } + function dropEndingNewline2(string2) { + return string2[string2.length - 1] === "\n" ? string2.slice(0, -1) : string2; + } + function foldString2(string2, width) { + var lineRe = /(\n+)([^\n]*)/g; + var result2 = function() { + var nextLF = string2.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string2.length; + lineRe.lastIndex = nextLF; + return foldLine2(string2.slice(0, nextLF), width); + }(); + var prevMoreIndented = string2[0] === "\n" || string2[0] === " "; + var moreIndented; + var match; + while (match = lineRe.exec(string2)) { + var prefix = match[1], line = match[2]; + moreIndented = line[0] === " "; + result2 += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine2(line, width); + prevMoreIndented = moreIndented; + } + return result2; + } + function foldLine2(line, width) { + if (line === "" || line[0] === " ") + return line; + var breakRe = / [^ ]/g; + var match; + var start = 0, end, curr = 0, next = 0; + var result2 = ""; + while (match = breakRe.exec(line)) { + next = match.index; + if (next - start > width) { + end = curr > start ? curr : next; + result2 += "\n" + line.slice(start, end); + start = end + 1; + } + curr = next; + } + result2 += "\n"; + if (line.length - start > width && curr > start) { + result2 += line.slice(start, curr) + "\n" + line.slice(curr + 1); + } else { + result2 += line.slice(start); + } + return result2.slice(1); + } + function escapeString2(string2) { + var result2 = ""; + var char, nextChar; + var escapeSeq; + for (var i7 = 0; i7 < string2.length; i7++) { + char = string2.charCodeAt(i7); + if (char >= 55296 && char <= 56319) { + nextChar = string2.charCodeAt(i7 + 1); + if (nextChar >= 56320 && nextChar <= 57343) { + result2 += encodeHex2((char - 55296) * 1024 + nextChar - 56320 + 65536); + i7++; + continue; + } + } + escapeSeq = ESCAPE_SEQUENCES2[char]; + result2 += !escapeSeq && isPrintable2(char) ? string2[i7] : escapeSeq || encodeHex2(char); + } + return result2; + } + function writeFlowSequence2(state, level, object) { + var _result = "", _tag = state.tag, index4, length; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + if (writeNode2(state, level, object[index4], false, false)) { + if (index4 !== 0) + _result += "," + (!state.condenseFlow ? " " : ""); + _result += state.dump; + } + } + state.tag = _tag; + state.dump = "[" + _result + "]"; + } + function writeBlockSequence2(state, level, object, compact2) { + var _result = "", _tag = state.tag, index4, length; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + if (writeNode2(state, level + 1, object[index4], true, true)) { + if (!compact2 || index4 !== 0) { + _result += generateNextLine2(state, level); + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state.dump; + } + } + state.tag = _tag; + state.dump = _result || "[]"; + } + function writeFlowMapping2(state, level, object) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, pairBuffer; + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (index4 !== 0) + pairBuffer += ", "; + if (state.condenseFlow) + pairBuffer += '"'; + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (!writeNode2(state, level, objectKey, false, false)) { + continue; + } + if (state.dump.length > 1024) + pairBuffer += "? "; + pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " "); + if (!writeNode2(state, level, objectValue, false, false)) { + continue; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = "{" + _result + "}"; + } + function writeBlockMapping2(state, level, object, compact2) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, explicitPair, pairBuffer; + if (state.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state.sortKeys === "function") { + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + throw new YAMLException2("sortKeys must be a boolean or a function"); + } + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (!compact2 || index4 !== 0) { + pairBuffer += generateNextLine2(state, level); + } + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (!writeNode2(state, level + 1, objectKey, true, true, true)) { + continue; + } + explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; + } + } + pairBuffer += state.dump; + if (explicitPair) { + pairBuffer += generateNextLine2(state, level); + } + if (!writeNode2(state, level + 1, objectValue, true, explicitPair)) { + continue; + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = _result || "{}"; + } + function detectType2(state, object, explicit) { + var _result, typeList, index4, length, type3, style; + typeList = explicit ? state.explicitTypes : state.implicitTypes; + for (index4 = 0, length = typeList.length; index4 < length; index4 += 1) { + type3 = typeList[index4]; + if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object === "object" && object instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object))) { + state.tag = explicit ? type3.tag : "?"; + if (type3.represent) { + style = state.styleMap[type3.tag] || type3.defaultStyle; + if (_toString2.call(type3.represent) === "[object Function]") { + _result = type3.represent(object, style); + } else if (_hasOwnProperty2.call(type3.represent, style)) { + _result = type3.represent[style](object, style); + } else { + throw new YAMLException2("!<" + type3.tag + '> tag resolver accepts not "' + style + '" style'); + } + state.dump = _result; + } + return true; + } + } + return false; + } + function writeNode2(state, level, object, block, compact2, iskey) { + state.tag = null; + state.dump = object; + if (!detectType2(state, object, false)) { + detectType2(state, object, true); + } + var type3 = _toString2.call(state.dump); + if (block) { + block = state.flowLevel < 0 || state.flowLevel > level; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block && Object.keys(state.dump).length !== 0) { + writeBlockMapping2(state, level, state.dump, compact2); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowMapping2(state, level, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object Array]") { + var arrayLevel = state.noArrayIndent && level > 0 ? level - 1 : level; + if (block && state.dump.length !== 0) { + writeBlockSequence2(state, arrayLevel, state.dump, compact2); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowSequence2(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object String]") { + if (state.tag !== "?") { + writeScalar2(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) + return false; + throw new YAMLException2("unacceptable kind of an object to dump " + type3); + } + if (state.tag !== null && state.tag !== "?") { + state.dump = "!<" + state.tag + "> " + state.dump; + } + } + return true; + } + function getDuplicateReferences2(object, state) { + var objects = [], duplicatesIndexes = [], index4, length; + inspectNode2(object, objects, duplicatesIndexes); + for (index4 = 0, length = duplicatesIndexes.length; index4 < length; index4 += 1) { + state.duplicates.push(objects[duplicatesIndexes[index4]]); + } + state.usedDuplicates = new Array(length); + } + function inspectNode2(object, objects, duplicatesIndexes) { + var objectKeyList, index4, length; + if (object !== null && typeof object === "object") { + index4 = objects.indexOf(object); + if (index4 !== -1) { + if (duplicatesIndexes.indexOf(index4) === -1) { + duplicatesIndexes.push(index4); + } + } else { + objects.push(object); + if (Array.isArray(object)) { + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + inspectNode2(object[index4], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + inspectNode2(object[objectKeyList[index4]], objects, duplicatesIndexes); + } + } + } + } + } + function dump2(input, options) { + options = options || {}; + var state = new State2(options); + if (!state.noRefs) + getDuplicateReferences2(input, state); + if (writeNode2(state, 0, input, true, true)) + return state.dump + "\n"; + return ""; + } + function safeDump2(input, options) { + return dump2(input, common3.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); + } + module5.exports.dump = dump2; + module5.exports.safeDump = safeDump2; + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml.js +var require_js_yaml = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/lib/js-yaml.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var loader2 = require_loader2(); + var dumper2 = require_dumper2(); + function deprecated(name2) { + return function() { + throw new Error("Function " + name2 + " is deprecated and cannot be used."); + }; + } + module5.exports.Type = require_type3(); + module5.exports.Schema = require_schema6(); + module5.exports.FAILSAFE_SCHEMA = require_failsafe2(); + module5.exports.JSON_SCHEMA = require_json4(); + module5.exports.CORE_SCHEMA = require_core8(); + module5.exports.DEFAULT_SAFE_SCHEMA = require_default_safe2(); + module5.exports.DEFAULT_FULL_SCHEMA = require_default_full2(); + module5.exports.load = loader2.load; + module5.exports.loadAll = loader2.loadAll; + module5.exports.safeLoad = loader2.safeLoad; + module5.exports.safeLoadAll = loader2.safeLoadAll; + module5.exports.dump = dumper2.dump; + module5.exports.safeDump = dumper2.safeDump; + module5.exports.YAMLException = require_exception2(); + module5.exports.MINIMAL_SCHEMA = require_failsafe2(); + module5.exports.SAFE_SCHEMA = require_default_safe2(); + module5.exports.DEFAULT_SCHEMA = require_default_full2(); + module5.exports.scan = deprecated("scan"); + module5.exports.parse = deprecated("parse"); + module5.exports.compose = deprecated("compose"); + module5.exports.addConstructor = deprecated("addConstructor"); + } +}); + +// node_modules/ramldt2jsonschema/node_modules/js-yaml/index.js +var require_js_yaml2 = __commonJS({ + "node_modules/ramldt2jsonschema/node_modules/js-yaml/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var yaml = require_js_yaml(); + module5.exports = yaml; + } +}); + +// node_modules/ramldt2jsonschema/src/js2dt.js +var require_js2dt = __commonJS({ + "node_modules/ramldt2jsonschema/src/js2dt.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var wap2 = require_webapi_parser().WebApiParser; + var yaml = require_js_yaml2(); + var utils = require_utils9(); + async function js2dt(jsonData, typeName, options = {}) { + const schema8 = { + swagger: "2.0", + definitions: {}, + paths: {} + }; + schema8.paths[`/for/conversion/${typeName}`] = { + get: { + responses: { + 200: { + schema: { + $ref: `#/definitions/${typeName}` + } + } + } + } + }; + schema8.definitions[typeName] = JSON.parse(jsonData); + const schemaString = JSON.stringify(schema8); + let model; + if (options.basePath) { + const location2 = utils.basePathToURL(options.basePath, "json"); + model = await wap2.oas20.parse(schemaString, location2); + } else { + model = await wap2.oas20.parse(schemaString); + } + const resolved = await wap2.oas20.resolve(model); + const raml = getDeclarationByName(resolved, typeName); + if (options.validate) { + await validateRaml(raml); + } + return yaml.safeLoad(raml); + } + function getDeclarationByName(model, typeName) { + try { + return model.getDeclarationByName(typeName).toRamlDatatype; + } catch (err) { + throw new Error( + `Failed to convert to RAML Library: ${err.toString()}` + ); + } + } + async function validateRaml(ramlStr) { + const model = await wap2.raml10.parse(ramlStr); + const report = await wap2.raml10.validate(model); + if (!report.conforms) { + throw new Error(`Invalid RAML: ${report.results[0].message}`); + } + } + module5.exports.js2dt = js2dt; + } +}); + +// node_modules/ramldt2jsonschema/src/index.js +var require_src4 = __commonJS({ + "node_modules/ramldt2jsonschema/src/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var dt2js = require_dt2js(); + var js2dt = require_js2dt(); + module5.exports.dt2js = dt2js.dt2js; + module5.exports.js2dt = js2dt.js2dt; + } +}); + +// node_modules/@protobufjs/aspromise/index.js +var require_aspromise = __commonJS({ + "node_modules/@protobufjs/aspromise/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = asPromise; + function asPromise(fn, ctx) { + var params = new Array(arguments.length - 1), offset = 0, index4 = 2, pending = true; + while (index4 < arguments.length) + params[offset++] = arguments[index4++]; + return new Promise(function executor(resolve3, reject2) { + params[offset] = function callback(err) { + if (pending) { + pending = false; + if (err) + reject2(err); + else { + var params2 = new Array(arguments.length - 1), offset2 = 0; + while (offset2 < params2.length) + params2[offset2++] = arguments[offset2]; + resolve3.apply(null, params2); + } + } + }; + try { + fn.apply(ctx || null, params); + } catch (err) { + if (pending) { + pending = false; + reject2(err); + } + } + }); + } + } +}); + +// node_modules/@protobufjs/base64/index.js +var require_base64 = __commonJS({ + "node_modules/@protobufjs/base64/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var base64 = exports28; + base64.length = function length(string2) { + var p7 = string2.length; + if (!p7) + return 0; + var n7 = 0; + while (--p7 % 4 > 1 && string2.charAt(p7) === "=") + ++n7; + return Math.ceil(string2.length * 3) / 4 - n7; + }; + var b64 = new Array(64); + var s64 = new Array(123); + for (i7 = 0; i7 < 64; ) + s64[b64[i7] = i7 < 26 ? i7 + 65 : i7 < 52 ? i7 + 71 : i7 < 62 ? i7 - 4 : i7 - 59 | 43] = i7++; + var i7; + base64.encode = function encode2(buffer2, start, end) { + var parts = null, chunk2 = []; + var i8 = 0, j6 = 0, t8; + while (start < end) { + var b8 = buffer2[start++]; + switch (j6) { + case 0: + chunk2[i8++] = b64[b8 >> 2]; + t8 = (b8 & 3) << 4; + j6 = 1; + break; + case 1: + chunk2[i8++] = b64[t8 | b8 >> 4]; + t8 = (b8 & 15) << 2; + j6 = 2; + break; + case 2: + chunk2[i8++] = b64[t8 | b8 >> 6]; + chunk2[i8++] = b64[b8 & 63]; + j6 = 0; + break; + } + if (i8 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk2)); + i8 = 0; + } + } + if (j6) { + chunk2[i8++] = b64[t8]; + chunk2[i8++] = 61; + if (j6 === 1) + chunk2[i8++] = 61; + } + if (parts) { + if (i8) + parts.push(String.fromCharCode.apply(String, chunk2.slice(0, i8))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk2.slice(0, i8)); + }; + var invalidEncoding = "invalid encoding"; + base64.decode = function decode2(string2, buffer2, offset) { + var start = offset; + var j6 = 0, t8; + for (var i8 = 0; i8 < string2.length; ) { + var c7 = string2.charCodeAt(i8++); + if (c7 === 61 && j6 > 1) + break; + if ((c7 = s64[c7]) === void 0) + throw Error(invalidEncoding); + switch (j6) { + case 0: + t8 = c7; + j6 = 1; + break; + case 1: + buffer2[offset++] = t8 << 2 | (c7 & 48) >> 4; + t8 = c7; + j6 = 2; + break; + case 2: + buffer2[offset++] = (t8 & 15) << 4 | (c7 & 60) >> 2; + t8 = c7; + j6 = 3; + break; + case 3: + buffer2[offset++] = (t8 & 3) << 6 | c7; + j6 = 0; + break; + } + } + if (j6 === 1) + throw Error(invalidEncoding); + return offset - start; + }; + base64.test = function test(string2) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string2); + }; + } +}); + +// node_modules/@protobufjs/eventemitter/index.js +var require_eventemitter = __commonJS({ + "node_modules/@protobufjs/eventemitter/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = EventEmitter2; + function EventEmitter2() { + this._listeners = {}; + } + EventEmitter2.prototype.on = function on4(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn, + ctx: ctx || this + }); + return this; + }; + EventEmitter2.prototype.off = function off3(evt, fn) { + if (evt === void 0) + this._listeners = {}; + else { + if (fn === void 0) + this._listeners[evt] = []; + else { + var listeners3 = this._listeners[evt]; + for (var i7 = 0; i7 < listeners3.length; ) + if (listeners3[i7].fn === fn) + listeners3.splice(i7, 1); + else + ++i7; + } + } + return this; + }; + EventEmitter2.prototype.emit = function emit3(evt) { + var listeners3 = this._listeners[evt]; + if (listeners3) { + var args = [], i7 = 1; + for (; i7 < arguments.length; ) + args.push(arguments[i7++]); + for (i7 = 0; i7 < listeners3.length; ) + listeners3[i7].fn.apply(listeners3[i7++].ctx, args); + } + return this; + }; + } +}); + +// node_modules/@protobufjs/float/index.js +var require_float3 = __commonJS({ + "node_modules/@protobufjs/float/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = factory(factory); + function factory(exports29) { + if (typeof Float32Array !== "undefined") + (function() { + var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le4 = f8b[3] === 128; + function writeFloat_f32_cpy(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + } + function writeFloat_f32_rev(val, buf, pos) { + f32[0] = val; + buf[pos] = f8b[3]; + buf[pos + 1] = f8b[2]; + buf[pos + 2] = f8b[1]; + buf[pos + 3] = f8b[0]; + } + exports29.writeFloatLE = le4 ? writeFloat_f32_cpy : writeFloat_f32_rev; + exports29.writeFloatBE = le4 ? writeFloat_f32_rev : writeFloat_f32_cpy; + function readFloat_f32_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + return f32[0]; + } + function readFloat_f32_rev(buf, pos) { + f8b[3] = buf[pos]; + f8b[2] = buf[pos + 1]; + f8b[1] = buf[pos + 2]; + f8b[0] = buf[pos + 3]; + return f32[0]; + } + exports29.readFloatLE = le4 ? readFloat_f32_cpy : readFloat_f32_rev; + exports29.readFloatBE = le4 ? readFloat_f32_rev : readFloat_f32_cpy; + })(); + else + (function() { + function writeFloat_ieee754(writeUint, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) + writeUint(1 / val > 0 ? ( + /* positive */ + 0 + ) : ( + /* negative 0 */ + 2147483648 + ), buf, pos); + else if (isNaN(val)) + writeUint(2143289344, buf, pos); + else if (val > 34028234663852886e22) + writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); + else if (val < 11754943508222875e-54) + writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos); + else { + var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; + writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); + } + } + exports29.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); + exports29.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); + function readFloat_ieee754(readUint, buf, pos) { + 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 * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); + } + exports29.readFloatLE = readFloat_ieee754.bind(null, readUintLE); + exports29.readFloatBE = readFloat_ieee754.bind(null, readUintBE); + })(); + if (typeof Float64Array !== "undefined") + (function() { + var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le4 = f8b[7] === 128; + function writeDouble_f64_cpy(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[0]; + buf[pos + 1] = f8b[1]; + buf[pos + 2] = f8b[2]; + buf[pos + 3] = f8b[3]; + buf[pos + 4] = f8b[4]; + buf[pos + 5] = f8b[5]; + buf[pos + 6] = f8b[6]; + buf[pos + 7] = f8b[7]; + } + function writeDouble_f64_rev(val, buf, pos) { + f64[0] = val; + buf[pos] = f8b[7]; + buf[pos + 1] = f8b[6]; + buf[pos + 2] = f8b[5]; + buf[pos + 3] = f8b[4]; + buf[pos + 4] = f8b[3]; + buf[pos + 5] = f8b[2]; + buf[pos + 6] = f8b[1]; + buf[pos + 7] = f8b[0]; + } + exports29.writeDoubleLE = le4 ? writeDouble_f64_cpy : writeDouble_f64_rev; + exports29.writeDoubleBE = le4 ? writeDouble_f64_rev : writeDouble_f64_cpy; + function readDouble_f64_cpy(buf, pos) { + f8b[0] = buf[pos]; + f8b[1] = buf[pos + 1]; + f8b[2] = buf[pos + 2]; + f8b[3] = buf[pos + 3]; + f8b[4] = buf[pos + 4]; + f8b[5] = buf[pos + 5]; + f8b[6] = buf[pos + 6]; + f8b[7] = buf[pos + 7]; + return f64[0]; + } + function readDouble_f64_rev(buf, pos) { + f8b[7] = buf[pos]; + f8b[6] = buf[pos + 1]; + f8b[5] = buf[pos + 2]; + f8b[4] = buf[pos + 3]; + f8b[3] = buf[pos + 4]; + f8b[2] = buf[pos + 5]; + f8b[1] = buf[pos + 6]; + f8b[0] = buf[pos + 7]; + return f64[0]; + } + exports29.readDoubleLE = le4 ? readDouble_f64_cpy : readDouble_f64_rev; + exports29.readDoubleBE = le4 ? readDouble_f64_rev : readDouble_f64_cpy; + })(); + else + (function() { + function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { + var sign = val < 0 ? 1 : 0; + if (sign) + val = -val; + if (val === 0) { + writeUint(0, buf, pos + off0); + writeUint(1 / val > 0 ? ( + /* positive */ + 0 + ) : ( + /* negative 0 */ + 2147483648 + ), buf, pos + off1); + } else if (isNaN(val)) { + writeUint(0, buf, pos + off0); + writeUint(2146959360, buf, pos + off1); + } else if (val > 17976931348623157e292) { + writeUint(0, buf, pos + off0); + writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); + } else { + var mantissa; + if (val < 22250738585072014e-324) { + mantissa = val / 5e-324; + writeUint(mantissa >>> 0, buf, pos + off0); + 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((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); + } + } + } + exports29.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); + exports29.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 sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; + return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); + } + exports29.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); + exports29.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); + })(); + return exports29; + } + function writeUintLE(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + function writeUintBE(val, buf, pos) { + buf[pos] = val >>> 24; + buf[pos + 1] = val >>> 16 & 255; + buf[pos + 2] = val >>> 8 & 255; + buf[pos + 3] = val & 255; + } + function readUintLE(buf, pos) { + return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; + } + function readUintBE(buf, pos) { + return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + } + } +}); + +// node_modules/@protobufjs/inquire/index.js +var require_inquire = __commonJS({ + "node_modules/@protobufjs/inquire/index.js"(exports, module) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module.exports = inquire; + function inquire(moduleName) { + try { + var mod = eval("quire".replace(/^/, "re"))(moduleName); + if (mod && (mod.length || Object.keys(mod).length)) + return mod; + } catch (e10) { + } + return null; + } + } +}); + +// node_modules/@protobufjs/utf8/index.js +var require_utf8 = __commonJS({ + "node_modules/@protobufjs/utf8/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var utf8 = exports28; + utf8.length = function utf8_length(string2) { + var len = 0, c7 = 0; + for (var i7 = 0; i7 < string2.length; ++i7) { + c7 = string2.charCodeAt(i7); + if (c7 < 128) + len += 1; + else if (c7 < 2048) + len += 2; + else if ((c7 & 64512) === 55296 && (string2.charCodeAt(i7 + 1) & 64512) === 56320) { + ++i7; + len += 4; + } else + len += 3; + } + return len; + }; + utf8.read = function utf8_read(buffer2, start, end) { + var len = end - start; + if (len < 1) + return ""; + var parts = null, chunk2 = [], i7 = 0, t8; + while (start < end) { + t8 = buffer2[start++]; + if (t8 < 128) + chunk2[i7++] = t8; + else if (t8 > 191 && t8 < 224) + chunk2[i7++] = (t8 & 31) << 6 | buffer2[start++] & 63; + else if (t8 > 239 && t8 < 365) { + t8 = ((t8 & 7) << 18 | (buffer2[start++] & 63) << 12 | (buffer2[start++] & 63) << 6 | buffer2[start++] & 63) - 65536; + chunk2[i7++] = 55296 + (t8 >> 10); + chunk2[i7++] = 56320 + (t8 & 1023); + } else + chunk2[i7++] = (t8 & 15) << 12 | (buffer2[start++] & 63) << 6 | buffer2[start++] & 63; + if (i7 > 8191) { + (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk2)); + i7 = 0; + } + } + if (parts) { + if (i7) + parts.push(String.fromCharCode.apply(String, chunk2.slice(0, i7))); + return parts.join(""); + } + return String.fromCharCode.apply(String, chunk2.slice(0, i7)); + }; + utf8.write = function utf8_write(string2, buffer2, offset) { + var start = offset, c1, c22; + for (var i7 = 0; i7 < string2.length; ++i7) { + c1 = string2.charCodeAt(i7); + if (c1 < 128) { + buffer2[offset++] = c1; + } else if (c1 < 2048) { + buffer2[offset++] = c1 >> 6 | 192; + buffer2[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c22 = string2.charCodeAt(i7 + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c22 & 1023); + ++i7; + buffer2[offset++] = c1 >> 18 | 240; + buffer2[offset++] = c1 >> 12 & 63 | 128; + buffer2[offset++] = c1 >> 6 & 63 | 128; + buffer2[offset++] = c1 & 63 | 128; + } else { + buffer2[offset++] = c1 >> 12 | 224; + buffer2[offset++] = c1 >> 6 & 63 | 128; + buffer2[offset++] = c1 & 63 | 128; + } + } + return offset - start; + }; + } +}); + +// node_modules/@protobufjs/pool/index.js +var require_pool = __commonJS({ + "node_modules/@protobufjs/pool/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = pool; + function pool(alloc, slice2, size2) { + var SIZE = size2 || 8192; + var MAX = SIZE >>> 1; + var slab = null; + var offset = 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 = slice2.call(slab, offset, offset += size3); + if (offset & 7) + offset = (offset | 7) + 1; + return buf; + }; + } + } +}); + +// node_modules/protobufjs/src/util/longbits.js +var require_longbits = __commonJS({ + "node_modules/protobufjs/src/util/longbits.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = LongBits; + var util2 = require_minimal(); + function LongBits(lo, hi) { + this.lo = lo >>> 0; + this.hi = hi >>> 0; + } + var zero = LongBits.zero = new LongBits(0, 0); + zero.toNumber = function() { + return 0; + }; + zero.zzEncode = zero.zzDecode = function() { + return this; + }; + zero.length = function() { + return 1; + }; + var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; + LongBits.fromNumber = function fromNumber(value2) { + if (value2 === 0) + return zero; + var sign = value2 < 0; + if (sign) + value2 = -value2; + var lo = value2 >>> 0, hi = (value2 - lo) / 4294967296 >>> 0; + if (sign) { + hi = ~hi >>> 0; + lo = ~lo >>> 0; + if (++lo > 4294967295) { + lo = 0; + if (++hi > 4294967295) + hi = 0; + } + } + return new LongBits(lo, hi); + }; + LongBits.from = function from(value2) { + if (typeof value2 === "number") + return LongBits.fromNumber(value2); + if (util2.isString(value2)) { + if (util2.Long) + value2 = util2.Long.fromString(value2); + else + return LongBits.fromNumber(parseInt(value2, 10)); + } + return value2.low || value2.high ? new LongBits(value2.low >>> 0, value2.high >>> 0) : zero; + }; + LongBits.prototype.toNumber = function toNumber3(unsigned) { + if (!unsigned && this.hi >>> 31) { + var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; + if (!lo) + hi = hi + 1 >>> 0; + return -(lo + hi * 4294967296); + } + return this.lo + this.hi * 4294967296; + }; + LongBits.prototype.toLong = function toLong(unsigned) { + return util2.Long ? new util2.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(hash) { + if (hash === zeroHash) + return zero; + return new LongBits( + (charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0, + (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0 + ); + }; + LongBits.prototype.toHash = function toHash() { + return String.fromCharCode( + this.lo & 255, + this.lo >>> 8 & 255, + this.lo >>> 16 & 255, + this.lo >>> 24, + this.hi & 255, + this.hi >>> 8 & 255, + this.hi >>> 16 & 255, + this.hi >>> 24 + ); + }; + LongBits.prototype.zzEncode = function zzEncode() { + var mask = this.hi >> 31; + this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; + this.lo = (this.lo << 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.zzDecode = function zzDecode() { + var mask = -(this.lo & 1); + this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; + this.hi = (this.hi >>> 1 ^ mask) >>> 0; + return this; + }; + LongBits.prototype.length = function length() { + var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; + return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; + }; + } +}); + +// node_modules/protobufjs/src/util/minimal.js +var require_minimal = __commonJS({ + "node_modules/protobufjs/src/util/minimal.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = exports28; + util2.asPromise = require_aspromise(); + util2.base64 = require_base64(); + util2.EventEmitter = require_eventemitter(); + util2.float = require_float3(); + util2.inquire = require_inquire(); + util2.utf8 = require_utf8(); + util2.pool = require_pool(); + util2.LongBits = require_longbits(); + util2.isNode = Boolean(typeof globalThis !== "undefined" && globalThis && globalThis.process && globalThis.process.versions && globalThis.process.versions.node); + util2.global = util2.isNode && globalThis || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports28; + util2.emptyArray = Object.freeze ? Object.freeze([]) : ( + /* istanbul ignore next */ + [] + ); + util2.emptyObject = Object.freeze ? Object.freeze({}) : ( + /* istanbul ignore next */ + {} + ); + util2.isInteger = Number.isInteger || /* istanbul ignore next */ + function isInteger3(value2) { + return typeof value2 === "number" && isFinite(value2) && Math.floor(value2) === value2; + }; + util2.isString = function isString4(value2) { + return typeof value2 === "string" || value2 instanceof String; + }; + util2.isObject = function isObject8(value2) { + return value2 && typeof value2 === "object"; + }; + util2.isset = /** + * Checks if a property on a message is considered to be present. + * @param {Object} obj Plain object or message instance + * @param {string} prop Property name + * @returns {boolean} `true` if considered to be present, otherwise `false` + */ + util2.isSet = function isSet2(obj, prop) { + var value2 = obj[prop]; + if (value2 != null && obj.hasOwnProperty(prop)) + return typeof value2 !== "object" || (Array.isArray(value2) ? value2.length : Object.keys(value2).length) > 0; + return false; + }; + util2.Buffer = function() { + try { + var Buffer4 = util2.inquire("buffer").Buffer; + return Buffer4.prototype.utf8Write ? Buffer4 : ( + /* istanbul ignore next */ + null + ); + } catch (e10) { + return null; + } + }(); + util2._Buffer_from = null; + util2._Buffer_allocUnsafe = null; + util2.newBuffer = function newBuffer(sizeOrArray) { + return typeof sizeOrArray === "number" ? util2.Buffer ? util2._Buffer_allocUnsafe(sizeOrArray) : new util2.Array(sizeOrArray) : util2.Buffer ? util2._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); + }; + util2.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + util2.Long = /* istanbul ignore next */ + util2.global.dcodeIO && /* istanbul ignore next */ + util2.global.dcodeIO.Long || /* istanbul ignore next */ + util2.global.Long || util2.inquire("long"); + util2.key2Re = /^true|false|0|1$/; + util2.key32Re = /^-?(?:0|[1-9][0-9]*)$/; + util2.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; + util2.longToHash = function longToHash(value2) { + return value2 ? util2.LongBits.from(value2).toHash() : util2.LongBits.zeroHash; + }; + util2.longFromHash = function longFromHash(hash, unsigned) { + var bits = util2.LongBits.fromHash(hash); + if (util2.Long) + return util2.Long.fromBits(bits.lo, bits.hi, unsigned); + return bits.toNumber(Boolean(unsigned)); + }; + function merge7(dst, src, ifNotSet) { + for (var keys2 = Object.keys(src), i7 = 0; i7 < keys2.length; ++i7) + if (dst[keys2[i7]] === void 0 || !ifNotSet) + dst[keys2[i7]] = src[keys2[i7]]; + return dst; + } + util2.merge = merge7; + util2.lcFirst = function lcFirst(str2) { + return str2.charAt(0).toLowerCase() + str2.substring(1); + }; + function newError(name2) { + function CustomError(message, properties) { + if (!(this instanceof CustomError)) + return new CustomError(message, properties); + Object.defineProperty(this, "message", { get: function() { + return message; + } }); + if (Error.captureStackTrace) + Error.captureStackTrace(this, CustomError); + else + Object.defineProperty(this, "stack", { value: new Error().stack || "" }); + if (properties) + merge7(this, properties); + } + CustomError.prototype = Object.create(Error.prototype, { + constructor: { + value: CustomError, + writable: true, + enumerable: false, + configurable: true + }, + name: { + get: function get4() { + return name2; + }, + set: void 0, + enumerable: false, + // configurable: false would accurately preserve the behavior of + // the original, but I'm guessing that was not intentional. + // For an actual error subclass, this property would + // be configurable. + configurable: true + }, + toString: { + value: function value2() { + return this.name + ": " + this.message; + }, + writable: true, + enumerable: false, + configurable: true + } + }); + return CustomError; + } + util2.newError = newError; + util2.ProtocolError = newError("ProtocolError"); + util2.oneOfGetter = function getOneOf(fieldNames) { + var fieldMap = {}; + for (var i7 = 0; i7 < fieldNames.length; ++i7) + fieldMap[fieldNames[i7]] = 1; + return function() { + for (var keys2 = Object.keys(this), i8 = keys2.length - 1; i8 > -1; --i8) + if (fieldMap[keys2[i8]] === 1 && this[keys2[i8]] !== void 0 && this[keys2[i8]] !== null) + return keys2[i8]; + }; + }; + util2.oneOfSetter = function setOneOf(fieldNames) { + return function(name2) { + for (var i7 = 0; i7 < fieldNames.length; ++i7) + if (fieldNames[i7] !== name2) + delete this[fieldNames[i7]]; + }; + }; + util2.toJSONOptions = { + longs: String, + enums: String, + bytes: String, + json: true + }; + util2._configure = function() { + var Buffer4 = util2.Buffer; + if (!Buffer4) { + util2._Buffer_from = util2._Buffer_allocUnsafe = null; + return; + } + util2._Buffer_from = Buffer4.from !== Uint8Array.from && Buffer4.from || /* istanbul ignore next */ + function Buffer_from(value2, encoding) { + return new Buffer4(value2, encoding); + }; + util2._Buffer_allocUnsafe = Buffer4.allocUnsafe || /* istanbul ignore next */ + function Buffer_allocUnsafe(size2) { + return new Buffer4(size2); + }; + }; + } +}); + +// node_modules/protobufjs/src/writer.js +var require_writer = __commonJS({ + "node_modules/protobufjs/src/writer.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Writer; + var util2 = require_minimal(); + var BufferWriter; + var LongBits = util2.LongBits; + var base64 = util2.base64; + var utf8 = util2.utf8; + function Op(fn, len, val) { + this.fn = fn; + this.len = len; + this.next = void 0; + this.val = val; + } + function noop4() { + } + function State2(writer) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } + function Writer() { + this.len = 0; + this.head = new Op(noop4, 0, 0); + this.tail = this.head; + this.states = null; + } + var create2 = function create3() { + return util2.Buffer ? function create_buffer_setup() { + return (Writer.create = function create_buffer() { + return new BufferWriter(); + })(); + } : function create_array() { + return new Writer(); + }; + }; + Writer.create = create2(); + Writer.alloc = function alloc(size2) { + return new util2.Array(size2); + }; + if (util2.Array !== Array) + Writer.alloc = util2.pool(Writer.alloc, util2.Array.prototype.subarray); + Writer.prototype._push = function push4(fn, len, val) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + }; + function writeByte(val, buf, pos) { + buf[pos] = val & 255; + } + function writeVarint32(val, buf, pos) { + while (val > 127) { + buf[pos++] = val & 127 | 128; + val >>>= 7; + } + buf[pos] = val; + } + function VarintOp(len, val) { + this.len = len; + this.next = void 0; + this.val = val; + } + VarintOp.prototype = Object.create(Op.prototype); + VarintOp.prototype.fn = writeVarint32; + Writer.prototype.uint32 = function write_uint32(value2) { + this.len += (this.tail = this.tail.next = new VarintOp( + (value2 = value2 >>> 0) < 128 ? 1 : value2 < 16384 ? 2 : value2 < 2097152 ? 3 : value2 < 268435456 ? 4 : 5, + value2 + )).len; + return this; + }; + Writer.prototype.int32 = function write_int32(value2) { + return value2 < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value2)) : this.uint32(value2); + }; + Writer.prototype.sint32 = function write_sint32(value2) { + return this.uint32((value2 << 1 ^ value2 >> 31) >>> 0); + }; + function writeVarint64(val, buf, pos) { + while (val.hi) { + buf[pos++] = val.lo & 127 | 128; + val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = val.lo & 127 | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; + } + Writer.prototype.uint64 = function write_uint64(value2) { + var bits = LongBits.from(value2); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.int64 = Writer.prototype.uint64; + Writer.prototype.sint64 = function write_sint64(value2) { + var bits = LongBits.from(value2).zzEncode(); + return this._push(writeVarint64, bits.length(), bits); + }; + Writer.prototype.bool = function write_bool(value2) { + return this._push(writeByte, 1, value2 ? 1 : 0); + }; + function writeFixed32(val, buf, pos) { + buf[pos] = val & 255; + buf[pos + 1] = val >>> 8 & 255; + buf[pos + 2] = val >>> 16 & 255; + buf[pos + 3] = val >>> 24; + } + Writer.prototype.fixed32 = function write_fixed32(value2) { + return this._push(writeFixed32, 4, value2 >>> 0); + }; + Writer.prototype.sfixed32 = Writer.prototype.fixed32; + Writer.prototype.fixed64 = function write_fixed64(value2) { + var bits = LongBits.from(value2); + return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); + }; + Writer.prototype.sfixed64 = Writer.prototype.fixed64; + Writer.prototype.float = function write_float(value2) { + return this._push(util2.float.writeFloatLE, 4, value2); + }; + Writer.prototype.double = function write_double(value2) { + return this._push(util2.float.writeDoubleLE, 8, value2); + }; + var writeBytes = util2.Array.prototype.set ? function writeBytes_set(val, buf, pos) { + buf.set(val, pos); + } : function writeBytes_for(val, buf, pos) { + for (var i7 = 0; i7 < val.length; ++i7) + buf[pos + i7] = val[i7]; + }; + Writer.prototype.bytes = function write_bytes(value2) { + var len = value2.length >>> 0; + if (!len) + return this._push(writeByte, 1, 0); + if (util2.isString(value2)) { + var buf = Writer.alloc(len = base64.length(value2)); + base64.decode(value2, buf, 0); + value2 = buf; + } + return this.uint32(len)._push(writeBytes, len, value2); + }; + Writer.prototype.string = function write_string(value2) { + var len = utf8.length(value2); + return len ? this.uint32(len)._push(utf8.write, len, value2) : this._push(writeByte, 1, 0); + }; + Writer.prototype.fork = function fork() { + this.states = new State2(this); + this.head = this.tail = new Op(noop4, 0, 0); + this.len = 0; + return this; + }; + Writer.prototype.reset = function reset() { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(noop4, 0, 0); + this.len = 0; + } + return this; + }; + Writer.prototype.ldelim = function ldelim() { + var head2 = this.head, tail2 = this.tail, len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head2.next; + this.tail = tail2; + this.len += len; + } + return this; + }; + Writer.prototype.finish = function finish() { + 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 = create2(); + BufferWriter._configure(); + }; + } +}); + +// node_modules/protobufjs/src/writer_buffer.js +var require_writer_buffer = __commonJS({ + "node_modules/protobufjs/src/writer_buffer.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = BufferWriter; + var Writer = require_writer(); + (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; + var util2 = require_minimal(); + function BufferWriter() { + Writer.call(this); + } + BufferWriter._configure = function() { + BufferWriter.alloc = util2._Buffer_allocUnsafe; + BufferWriter.writeBytesBuffer = util2.Buffer && util2.Buffer.prototype instanceof Uint8Array && util2.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 i7 = 0; i7 < val.length; ) + buf[pos++] = val[i7++]; + }; + }; + BufferWriter.prototype.bytes = function write_bytes_buffer(value2) { + if (util2.isString(value2)) + value2 = util2._Buffer_from(value2, "base64"); + var len = value2.length >>> 0; + this.uint32(len); + if (len) + this._push(BufferWriter.writeBytesBuffer, len, value2); + return this; + }; + function writeStringBuffer(val, buf, pos) { + if (val.length < 40) + util2.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(value2) { + var len = util2.Buffer.byteLength(value2); + this.uint32(len); + if (len) + this._push(writeStringBuffer, len, value2); + return this; + }; + BufferWriter._configure(); + } +}); + +// node_modules/protobufjs/src/reader.js +var require_reader2 = __commonJS({ + "node_modules/protobufjs/src/reader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Reader; + var util2 = require_minimal(); + var BufferReader; + var LongBits = util2.LongBits; + var utf8 = util2.utf8; + function indexOutOfRange(reader, writeLength) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); + } + function Reader(buffer2) { + this.buf = buffer2; + this.pos = 0; + this.len = buffer2.length; + } + var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer2) { + if (buffer2 instanceof Uint8Array || Array.isArray(buffer2)) + return new Reader(buffer2); + throw Error("illegal buffer"); + } : function create_array2(buffer2) { + if (Array.isArray(buffer2)) + return new Reader(buffer2); + throw Error("illegal buffer"); + }; + var create2 = function create3() { + return util2.Buffer ? function create_buffer_setup(buffer2) { + return (Reader.create = function create_buffer(buffer3) { + return util2.Buffer.isBuffer(buffer3) ? new BufferReader(buffer3) : create_array(buffer3); + })(buffer2); + } : create_array; + }; + Reader.create = create2(); + Reader.prototype._slice = util2.Array.prototype.subarray || /* istanbul ignore next */ + util2.Array.prototype.slice; + Reader.prototype.uint32 = /* @__PURE__ */ function read_uint32_setup() { + var value2 = 4294967295; + return function read_uint32() { + value2 = (this.buf[this.pos] & 127) >>> 0; + if (this.buf[this.pos++] < 128) + return value2; + value2 = (value2 | (this.buf[this.pos] & 127) << 7) >>> 0; + if (this.buf[this.pos++] < 128) + return value2; + value2 = (value2 | (this.buf[this.pos] & 127) << 14) >>> 0; + if (this.buf[this.pos++] < 128) + return value2; + value2 = (value2 | (this.buf[this.pos] & 127) << 21) >>> 0; + if (this.buf[this.pos++] < 128) + return value2; + value2 = (value2 | (this.buf[this.pos] & 15) << 28) >>> 0; + if (this.buf[this.pos++] < 128) + return value2; + if ((this.pos += 5) > this.len) { + this.pos = this.len; + throw indexOutOfRange(this, 10); + } + return value2; + }; + }(); + Reader.prototype.int32 = function read_int32() { + return this.uint32() | 0; + }; + Reader.prototype.sint32 = function read_sint32() { + var value2 = this.uint32(); + return value2 >>> 1 ^ -(value2 & 1) | 0; + }; + function readLongVarint() { + var bits = new LongBits(0, 0); + var i7 = 0; + if (this.len - this.pos > 4) { + for (; i7 < 4; ++i7) { + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i7 * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; + bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + i7 = 0; + } else { + for (; i7 < 3; ++i7) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i7 * 7) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i7 * 7) >>> 0; + return bits; + } + if (this.len - this.pos > 4) { + for (; i7 < 5; ++i7) { + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i7 * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } else { + for (; i7 < 5; ++i7) { + if (this.pos >= this.len) + throw indexOutOfRange(this); + bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i7 * 7 + 3) >>> 0; + if (this.buf[this.pos++] < 128) + return bits; + } + } + throw Error("invalid varint encoding"); + } + Reader.prototype.bool = function read_bool() { + return this.uint32() !== 0; + }; + function readFixed32_end(buf, end) { + return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; + } + Reader.prototype.fixed32 = function read_fixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4); + }; + Reader.prototype.sfixed32 = function read_sfixed32() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + return readFixed32_end(this.buf, this.pos += 4) | 0; + }; + function readFixed64() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 8); + return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); + } + Reader.prototype.float = function read_float() { + if (this.pos + 4 > this.len) + throw indexOutOfRange(this, 4); + var value2 = util2.float.readFloatLE(this.buf, this.pos); + this.pos += 4; + return value2; + }; + Reader.prototype.double = function read_double() { + if (this.pos + 8 > this.len) + throw indexOutOfRange(this, 4); + var value2 = util2.float.readDoubleLE(this.buf, this.pos); + this.pos += 8; + return value2; + }; + Reader.prototype.bytes = function read_bytes() { + var length = this.uint32(), start = this.pos, end = this.pos + length; + if (end > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + if (Array.isArray(this.buf)) + return this.buf.slice(start, end); + if (start === end) { + var nativeBuffer = util2.Buffer; + return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); + } + return this._slice.call(this.buf, start, end); + }; + Reader.prototype.string = function read_string() { + var bytes = this.bytes(); + return utf8.read(bytes, 0, bytes.length); + }; + Reader.prototype.skip = function skip(length) { + if (typeof length === "number") { + if (this.pos + length > this.len) + throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) + throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + }; + Reader.prototype.skipType = function(wireType) { + switch (wireType) { + case 0: + this.skip(); + break; + case 1: + this.skip(8); + break; + case 2: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case 5: + this.skip(4); + break; + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + }; + Reader._configure = function(BufferReader_) { + BufferReader = BufferReader_; + Reader.create = create2(); + BufferReader._configure(); + var fn = util2.Long ? "toLong" : ( + /* istanbul ignore next */ + "toNumber" + ); + util2.merge(Reader.prototype, { + int64: function read_int64() { + return readLongVarint.call(this)[fn](false); + }, + uint64: function read_uint64() { + return readLongVarint.call(this)[fn](true); + }, + sint64: function read_sint64() { + return readLongVarint.call(this).zzDecode()[fn](false); + }, + fixed64: function read_fixed64() { + return readFixed64.call(this)[fn](true); + }, + sfixed64: function read_sfixed64() { + return readFixed64.call(this)[fn](false); + } + }); + }; + } +}); + +// node_modules/protobufjs/src/reader_buffer.js +var require_reader_buffer = __commonJS({ + "node_modules/protobufjs/src/reader_buffer.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = BufferReader; + var Reader = require_reader2(); + (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; + var util2 = require_minimal(); + function BufferReader(buffer2) { + Reader.call(this, buffer2); + } + BufferReader._configure = function() { + if (util2.Buffer) + BufferReader.prototype._slice = util2.Buffer.prototype.slice; + }; + BufferReader.prototype.string = function read_string_buffer() { + var len = this.uint32(); + return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); + }; + BufferReader._configure(); + } +}); + +// node_modules/protobufjs/src/rpc/service.js +var require_service = __commonJS({ + "node_modules/protobufjs/src/rpc/service.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Service; + var util2 = require_minimal(); + (Service.prototype = Object.create(util2.EventEmitter.prototype)).constructor = Service; + function Service(rpcImpl, requestDelimited, responseDelimited) { + if (typeof rpcImpl !== "function") + throw TypeError("rpcImpl must be a function"); + util2.EventEmitter.call(this); + this.rpcImpl = rpcImpl; + this.requestDelimited = Boolean(requestDelimited); + this.responseDelimited = Boolean(responseDelimited); + } + Service.prototype.rpcCall = function rpcCall(method2, requestCtor, responseCtor, request3, callback) { + if (!request3) + throw TypeError("request must be specified"); + var self2 = this; + if (!callback) + return util2.asPromise(rpcCall, self2, method2, requestCtor, responseCtor, request3); + if (!self2.rpcImpl) { + setTimeout(function() { + callback(Error("already ended")); + }, 0); + return void 0; + } + try { + return self2.rpcImpl( + method2, + requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request3).finish(), + function rpcCallback(err, response) { + if (err) { + self2.emit("error", err, method2); + return callback(err); + } + if (response === null) { + self2.end( + /* endedByRPC */ + true + ); + return void 0; + } + if (!(response instanceof responseCtor)) { + try { + response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response); + } catch (err2) { + self2.emit("error", err2, method2); + return callback(err2); + } + } + self2.emit("data", response, method2); + return callback(null, response); + } + ); + } catch (err) { + self2.emit("error", err, method2); + setTimeout(function() { + callback(err); + }, 0); + return void 0; + } + }; + Service.prototype.end = function end(endedByRPC) { + if (this.rpcImpl) { + if (!endedByRPC) + this.rpcImpl(null, null, null); + this.rpcImpl = null; + this.emit("end").off(); + } + return this; + }; + } +}); + +// node_modules/protobufjs/src/rpc.js +var require_rpc = __commonJS({ + "node_modules/protobufjs/src/rpc.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var rpc = exports28; + rpc.Service = require_service(); + } +}); + +// node_modules/protobufjs/src/roots.js +var require_roots = __commonJS({ + "node_modules/protobufjs/src/roots.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = {}; + } +}); + +// node_modules/protobufjs/src/index-minimal.js +var require_index_minimal = __commonJS({ + "node_modules/protobufjs/src/index-minimal.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var protobuf2 = exports28; + protobuf2.build = "minimal"; + protobuf2.Writer = require_writer(); + protobuf2.BufferWriter = require_writer_buffer(); + protobuf2.Reader = require_reader2(); + protobuf2.BufferReader = require_reader_buffer(); + protobuf2.util = require_minimal(); + protobuf2.rpc = require_rpc(); + protobuf2.roots = require_roots(); + protobuf2.configure = configure; + function configure() { + protobuf2.util._configure(); + protobuf2.Writer._configure(protobuf2.BufferWriter); + protobuf2.Reader._configure(protobuf2.BufferReader); + } + configure(); + } +}); + +// node_modules/@protobufjs/codegen/index.js +var require_codegen2 = __commonJS({ + "node_modules/@protobufjs/codegen/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = codegen; + function codegen(functionParams, functionName) { + if (typeof functionParams === "string") { + functionName = functionParams; + functionParams = void 0; + } + var body = []; + function Codegen(formatStringOrScope) { + if (typeof formatStringOrScope !== "string") { + var source = toString3(); + if (codegen.verbose) + console.log("codegen: " + source); + source = "return " + source; + if (formatStringOrScope) { + var scopeKeys = Object.keys(formatStringOrScope), scopeParams = new Array(scopeKeys.length + 1), scopeValues = new Array(scopeKeys.length), scopeOffset = 0; + while (scopeOffset < scopeKeys.length) { + scopeParams[scopeOffset] = scopeKeys[scopeOffset]; + scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]]; + } + scopeParams[scopeOffset] = source; + return Function.apply(null, scopeParams).apply(null, scopeValues); + } + return Function(source)(); + } + var formatParams = new Array(arguments.length - 1), formatOffset = 0; + while (formatOffset < formatParams.length) + formatParams[formatOffset] = arguments[++formatOffset]; + formatOffset = 0; + formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace3($0, $1) { + var value2 = formatParams[formatOffset++]; + switch ($1) { + case "d": + case "f": + return String(Number(value2)); + case "i": + return String(Math.floor(value2)); + case "j": + return JSON.stringify(value2); + case "s": + return String(value2); + } + return "%"; + }); + if (formatOffset !== formatParams.length) + throw Error("parameter count mismatch"); + body.push(formatStringOrScope); + return Codegen; + } + function toString3(functionNameOverride) { + return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}"; + } + Codegen.toString = toString3; + return Codegen; + } + codegen.verbose = false; + } +}); + +// node_modules/@protobufjs/fetch/index.js +var require_fetch2 = __commonJS({ + "node_modules/@protobufjs/fetch/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = fetch2; + var asPromise = require_aspromise(); + var inquire2 = require_inquire(); + var fs = inquire2("fs"); + function fetch2(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else if (!options) + options = {}; + if (!callback) + return asPromise(fetch2, this, filename, options); + if (!options.xhr && fs && fs.readFile) + return fs.readFile(filename, function fetchReadFileCallback(err, contents) { + return err && typeof XMLHttpRequest !== "undefined" ? fetch2.xhr(filename, options, callback) : err ? callback(err) : callback(null, options.binary ? contents : contents.toString("utf8")); + }); + return fetch2.xhr(filename, options, callback); + } + fetch2.xhr = function fetch_xhr(filename, options, callback) { + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function fetchOnReadyStateChange() { + if (xhr.readyState !== 4) + return void 0; + if (xhr.status !== 0 && xhr.status !== 200) + return callback(Error("status " + xhr.status)); + if (options.binary) { + var buffer2 = xhr.response; + if (!buffer2) { + buffer2 = []; + for (var i7 = 0; i7 < xhr.responseText.length; ++i7) + buffer2.push(xhr.responseText.charCodeAt(i7) & 255); + } + return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer2) : buffer2); + } + return callback(null, xhr.responseText); + }; + if (options.binary) { + if ("overrideMimeType" in xhr) + xhr.overrideMimeType("text/plain; charset=x-user-defined"); + xhr.responseType = "arraybuffer"; + } + xhr.open("GET", filename); + xhr.send(); + }; + } +}); + +// node_modules/@protobufjs/path/index.js +var require_path = __commonJS({ + "node_modules/@protobufjs/path/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = exports28; + var isAbsolute2 = ( + /** + * Tests if the specified path is absolute. + * @param {string} path Path to test + * @returns {boolean} `true` if path is absolute + */ + path2.isAbsolute = function isAbsolute3(path3) { + return /^(?:\/|\w+:)/.test(path3); + } + ); + var normalize2 = ( + /** + * Normalizes the specified path. + * @param {string} path Path to normalize + * @returns {string} Normalized path + */ + path2.normalize = function normalize3(path3) { + path3 = path3.replace(/\\/g, "/").replace(/\/{2,}/g, "/"); + var parts = path3.split("/"), absolute = isAbsolute2(path3), prefix = ""; + if (absolute) + prefix = parts.shift() + "/"; + for (var i7 = 0; i7 < parts.length; ) { + if (parts[i7] === "..") { + if (i7 > 0 && parts[i7 - 1] !== "..") + parts.splice(--i7, 2); + else if (absolute) + parts.splice(i7, 1); + else + ++i7; + } else if (parts[i7] === ".") + parts.splice(i7, 1); + else + ++i7; + } + return prefix + parts.join("/"); + } + ); + path2.resolve = function resolve3(originPath, includePath, alreadyNormalized) { + if (!alreadyNormalized) + includePath = normalize2(includePath); + if (isAbsolute2(includePath)) + return includePath; + if (!alreadyNormalized) + originPath = normalize2(originPath); + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize2(originPath + "/" + includePath) : includePath; + }; + } +}); + +// node_modules/protobufjs/src/namespace.js +var require_namespace = __commonJS({ + "node_modules/protobufjs/src/namespace.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Namespace; + var ReflectionObject = require_object(); + ((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace"; + var Field = require_field(); + var util2 = require_util5(); + var OneOf = require_oneof(); + var Type3; + var Service; + var Enum2; + Namespace.fromJSON = function fromJSON(name2, json2) { + return new Namespace(name2, json2.options).addJSON(json2.nested); + }; + function arrayToJSON(array, toJSONOptions) { + if (!(array && array.length)) + return void 0; + var obj = {}; + for (var i7 = 0; i7 < array.length; ++i7) + obj[array[i7].name] = array[i7].toJSON(toJSONOptions); + return obj; + } + Namespace.arrayToJSON = arrayToJSON; + Namespace.isReservedId = function isReservedId(reserved, id) { + if (reserved) { + for (var i7 = 0; i7 < reserved.length; ++i7) + if (typeof reserved[i7] !== "string" && reserved[i7][0] <= id && reserved[i7][1] > id) + return true; + } + return false; + }; + Namespace.isReservedName = function isReservedName(reserved, name2) { + if (reserved) { + for (var i7 = 0; i7 < reserved.length; ++i7) + if (reserved[i7] === name2) + return true; + } + return false; + }; + function Namespace(name2, options) { + ReflectionObject.call(this, name2, options); + this.nested = void 0; + this._nestedArray = null; + this._lookupCache = {}; + this._needsRecursiveFeatureResolution = true; + this._needsRecursiveResolve = true; + } + function clearCache(namespace) { + namespace._nestedArray = null; + namespace._lookupCache = {}; + var parent2 = namespace; + while (parent2 = parent2.parent) { + parent2._lookupCache = {}; + } + return namespace; + } + Object.defineProperty(Namespace.prototype, "nestedArray", { + get: function() { + return this._nestedArray || (this._nestedArray = util2.toArray(this.nested)); + } + }); + Namespace.prototype.toJSON = function toJSON(toJSONOptions) { + return util2.toObject([ + "options", + this.options, + "nested", + arrayToJSON(this.nestedArray, toJSONOptions) + ]); + }; + Namespace.prototype.addJSON = function addJSON(nestedJson) { + var ns = this; + if (nestedJson) { + for (var names = Object.keys(nestedJson), i7 = 0, nested; i7 < names.length; ++i7) { + nested = nestedJson[names[i7]]; + ns.add( + // most to least likely + (nested.fields !== void 0 ? Type3.fromJSON : nested.values !== void 0 ? Enum2.fromJSON : nested.methods !== void 0 ? Service.fromJSON : nested.id !== void 0 ? Field.fromJSON : Namespace.fromJSON)(names[i7], nested) + ); + } + } + return this; + }; + Namespace.prototype.get = function get4(name2) { + return this.nested && this.nested[name2] || null; + }; + Namespace.prototype.getEnum = function getEnum(name2) { + if (this.nested && this.nested[name2] instanceof Enum2) + return this.nested[name2].values; + throw Error("no such enum: " + name2); + }; + Namespace.prototype.add = function add2(object) { + if (!(object instanceof Field && object.extend !== void 0 || object instanceof Type3 || object instanceof OneOf || object instanceof Enum2 || object instanceof Service || object instanceof Namespace)) + throw TypeError("object must be a valid nested object"); + if (!this.nested) + this.nested = {}; + else { + var prev = this.get(object.name); + if (prev) { + if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type3 || prev instanceof Service)) { + var nested = prev.nestedArray; + for (var i7 = 0; i7 < nested.length; ++i7) + object.add(nested[i7]); + this.remove(prev); + if (!this.nested) + this.nested = {}; + object.setOptions(prev.options, true); + } else + throw Error("duplicate name '" + object.name + "' in " + this); + } + } + this.nested[object.name] = object; + if (!(this instanceof Type3 || this instanceof Service || this instanceof Enum2 || this instanceof Field)) { + if (!object._edition) { + object._edition = object._defaultEdition; + } + } + this._needsRecursiveFeatureResolution = true; + this._needsRecursiveResolve = true; + var parent2 = this; + while (parent2 = parent2.parent) { + parent2._needsRecursiveFeatureResolution = true; + parent2._needsRecursiveResolve = true; + } + object.onAdd(this); + return clearCache(this); + }; + Namespace.prototype.remove = function remove2(object) { + if (!(object instanceof ReflectionObject)) + throw TypeError("object must be a ReflectionObject"); + if (object.parent !== this) + throw Error(object + " is not a member of " + this); + delete this.nested[object.name]; + if (!Object.keys(this.nested).length) + this.nested = void 0; + object.onRemove(this); + return clearCache(this); + }; + Namespace.prototype.define = function define2(path2, json2) { + if (util2.isString(path2)) + path2 = path2.split("."); + else if (!Array.isArray(path2)) + throw TypeError("illegal path"); + if (path2 && path2.length && path2[0] === "") + throw Error("path must be relative"); + var ptr = this; + while (path2.length > 0) { + var part = path2.shift(); + if (ptr.nested && ptr.nested[part]) { + ptr = ptr.nested[part]; + if (!(ptr instanceof Namespace)) + throw Error("path conflicts with non-namespace objects"); + } else + ptr.add(ptr = new Namespace(part)); + } + if (json2) + ptr.addJSON(json2); + return ptr; + }; + Namespace.prototype.resolveAll = function resolveAll() { + if (!this._needsRecursiveResolve) + return this; + this._resolveFeaturesRecursive(this._edition); + var nested = this.nestedArray, i7 = 0; + this.resolve(); + while (i7 < nested.length) + if (nested[i7] instanceof Namespace) + nested[i7++].resolveAll(); + else + nested[i7++].resolve(); + this._needsRecursiveResolve = false; + return this; + }; + Namespace.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) { + if (!this._needsRecursiveFeatureResolution) + return this; + this._needsRecursiveFeatureResolution = false; + edition = this._edition || edition; + ReflectionObject.prototype._resolveFeaturesRecursive.call(this, edition); + this.nestedArray.forEach((nested) => { + nested._resolveFeaturesRecursive(edition); + }); + return this; + }; + Namespace.prototype.lookup = function lookup(path2, filterTypes, parentAlreadyChecked) { + if (typeof filterTypes === "boolean") { + parentAlreadyChecked = filterTypes; + filterTypes = void 0; + } else if (filterTypes && !Array.isArray(filterTypes)) + filterTypes = [filterTypes]; + if (util2.isString(path2) && path2.length) { + if (path2 === ".") + return this.root; + path2 = path2.split("."); + } else if (!path2.length) + return this; + var flatPath = path2.join("."); + if (path2[0] === "") + return this.root.lookup(path2.slice(1), filterTypes); + var found = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + flatPath]; + if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) { + return found; + } + found = this._lookupImpl(path2, flatPath); + if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) { + return found; + } + if (parentAlreadyChecked) + return null; + var current = this; + while (current.parent) { + found = current.parent._lookupImpl(path2, flatPath); + if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) { + return found; + } + current = current.parent; + } + return null; + }; + Namespace.prototype._lookupImpl = function lookup(path2, flatPath) { + if (Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) { + return this._lookupCache[flatPath]; + } + var found = this.get(path2[0]); + var exact = null; + if (found) { + if (path2.length === 1) { + exact = found; + } else if (found instanceof Namespace) { + path2 = path2.slice(1); + exact = found._lookupImpl(path2, path2.join(".")); + } + } else { + for (var i7 = 0; i7 < this.nestedArray.length; ++i7) + if (this._nestedArray[i7] instanceof Namespace && (found = this._nestedArray[i7]._lookupImpl(path2, flatPath))) + exact = found; + } + this._lookupCache[flatPath] = exact; + return exact; + }; + Namespace.prototype.lookupType = function lookupType(path2) { + var found = this.lookup(path2, [Type3]); + if (!found) + throw Error("no such type: " + path2); + return found; + }; + Namespace.prototype.lookupEnum = function lookupEnum(path2) { + var found = this.lookup(path2, [Enum2]); + if (!found) + throw Error("no such Enum '" + path2 + "' in " + this); + return found; + }; + Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path2) { + var found = this.lookup(path2, [Type3, Enum2]); + if (!found) + throw Error("no such Type or Enum '" + path2 + "' in " + this); + return found; + }; + Namespace.prototype.lookupService = function lookupService(path2) { + var found = this.lookup(path2, [Service]); + if (!found) + throw Error("no such Service '" + path2 + "' in " + this); + return found; + }; + Namespace._configure = function(Type_, Service_, Enum_) { + Type3 = Type_; + Service = Service_; + Enum2 = Enum_; + }; + } +}); + +// node_modules/protobufjs/src/mapfield.js +var require_mapfield = __commonJS({ + "node_modules/protobufjs/src/mapfield.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = MapField; + var Field = require_field(); + ((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField"; + var types3 = require_types8(); + var util2 = require_util5(); + function MapField(name2, id, keyType, type3, options, comment) { + Field.call(this, name2, id, type3, void 0, void 0, options, comment); + if (!util2.isString(keyType)) + throw TypeError("keyType must be a string"); + this.keyType = keyType; + this.resolvedKeyType = null; + this.map = true; + } + MapField.fromJSON = function fromJSON(name2, json2) { + return new MapField(name2, json2.id, json2.keyType, json2.type, json2.options, json2.comment); + }; + MapField.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "keyType", + this.keyType, + "type", + this.type, + "id", + this.id, + "extend", + this.extend, + "options", + this.options, + "comment", + keepComments ? this.comment : void 0 + ]); + }; + MapField.prototype.resolve = function resolve3() { + if (this.resolved) + return this; + if (types3.mapKey[this.keyType] === void 0) + throw Error("invalid key type: " + this.keyType); + return Field.prototype.resolve.call(this); + }; + MapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) { + if (typeof fieldValueType === "function") + fieldValueType = util2.decorateType(fieldValueType).name; + else if (fieldValueType && typeof fieldValueType === "object") + fieldValueType = util2.decorateEnum(fieldValueType).name; + return function mapFieldDecorator(prototype, fieldName) { + util2.decorateType(prototype.constructor).add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType)); + }; + }; + } +}); + +// node_modules/protobufjs/src/method.js +var require_method = __commonJS({ + "node_modules/protobufjs/src/method.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Method; + var ReflectionObject = require_object(); + ((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method"; + var util2 = require_util5(); + function Method(name2, type3, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) { + if (util2.isObject(requestStream)) { + options = requestStream; + requestStream = responseStream = void 0; + } else if (util2.isObject(responseStream)) { + options = responseStream; + responseStream = void 0; + } + if (!(type3 === void 0 || util2.isString(type3))) + throw TypeError("type must be a string"); + if (!util2.isString(requestType)) + throw TypeError("requestType must be a string"); + if (!util2.isString(responseType)) + throw TypeError("responseType must be a string"); + ReflectionObject.call(this, name2, options); + this.type = type3 || "rpc"; + this.requestType = requestType; + this.requestStream = requestStream ? true : void 0; + this.responseType = responseType; + this.responseStream = responseStream ? true : void 0; + this.resolvedRequestType = null; + this.resolvedResponseType = null; + this.comment = comment; + this.parsedOptions = parsedOptions; + } + Method.fromJSON = function fromJSON(name2, json2) { + return new Method(name2, json2.type, json2.requestType, json2.responseType, json2.requestStream, json2.responseStream, json2.options, json2.comment, json2.parsedOptions); + }; + Method.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "type", + this.type !== "rpc" && /* istanbul ignore next */ + this.type || void 0, + "requestType", + this.requestType, + "requestStream", + this.requestStream, + "responseType", + this.responseType, + "responseStream", + this.responseStream, + "options", + this.options, + "comment", + keepComments ? this.comment : void 0, + "parsedOptions", + this.parsedOptions + ]); + }; + Method.prototype.resolve = function resolve3() { + if (this.resolved) + return this; + this.resolvedRequestType = this.parent.lookupType(this.requestType); + this.resolvedResponseType = this.parent.lookupType(this.responseType); + return ReflectionObject.prototype.resolve.call(this); + }; + } +}); + +// node_modules/protobufjs/src/service.js +var require_service2 = __commonJS({ + "node_modules/protobufjs/src/service.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Service; + var Namespace = require_namespace(); + ((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service"; + var Method = require_method(); + var util2 = require_util5(); + var rpc = require_rpc(); + function Service(name2, options) { + Namespace.call(this, name2, options); + this.methods = {}; + this._methodsArray = null; + } + Service.fromJSON = function fromJSON(name2, json2) { + var service = new Service(name2, json2.options); + if (json2.methods) + for (var names = Object.keys(json2.methods), i7 = 0; i7 < names.length; ++i7) + service.add(Method.fromJSON(names[i7], json2.methods[names[i7]])); + if (json2.nested) + service.addJSON(json2.nested); + if (json2.edition) + service._edition = json2.edition; + service.comment = json2.comment; + service._defaultEdition = "proto3"; + return service; + }; + Service.prototype.toJSON = function toJSON(toJSONOptions) { + var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions); + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "edition", + this._editionToJSON(), + "options", + inherited && inherited.options || void 0, + "methods", + Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ + {}, + "nested", + inherited && inherited.nested || void 0, + "comment", + keepComments ? this.comment : void 0 + ]); + }; + Object.defineProperty(Service.prototype, "methodsArray", { + get: function() { + return this._methodsArray || (this._methodsArray = util2.toArray(this.methods)); + } + }); + function clearCache(service) { + service._methodsArray = null; + return service; + } + Service.prototype.get = function get4(name2) { + return this.methods[name2] || Namespace.prototype.get.call(this, name2); + }; + Service.prototype.resolveAll = function resolveAll() { + if (!this._needsRecursiveResolve) + return this; + Namespace.prototype.resolve.call(this); + var methods = this.methodsArray; + for (var i7 = 0; i7 < methods.length; ++i7) + methods[i7].resolve(); + return this; + }; + Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) { + if (!this._needsRecursiveFeatureResolution) + return this; + edition = this._edition || edition; + Namespace.prototype._resolveFeaturesRecursive.call(this, edition); + this.methodsArray.forEach((method2) => { + method2._resolveFeaturesRecursive(edition); + }); + return this; + }; + Service.prototype.add = function add2(object) { + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + if (object instanceof Method) { + this.methods[object.name] = object; + object.parent = this; + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); + }; + Service.prototype.remove = function remove2(object) { + if (object instanceof Method) { + if (this.methods[object.name] !== object) + throw Error(object + " is not a member of " + this); + delete this.methods[object.name]; + object.parent = null; + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); + }; + Service.prototype.create = function create2(rpcImpl, requestDelimited, responseDelimited) { + var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited); + for (var i7 = 0, method2; i7 < /* initializes */ + this.methodsArray.length; ++i7) { + var methodName = util2.lcFirst((method2 = this._methodsArray[i7]).resolve().name).replace(/[^$\w_]/g, ""); + rpcService[methodName] = util2.codegen(["r", "c"], util2.isReserved(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({ + m: method2, + q: method2.resolvedRequestType.ctor, + s: method2.resolvedResponseType.ctor + }); + } + return rpcService; + }; + } +}); + +// node_modules/protobufjs/src/message.js +var require_message2 = __commonJS({ + "node_modules/protobufjs/src/message.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Message7; + var util2 = require_minimal(); + function Message7(properties) { + if (properties) + for (var keys2 = Object.keys(properties), i7 = 0; i7 < keys2.length; ++i7) + this[keys2[i7]] = properties[keys2[i7]]; + } + Message7.create = function create2(properties) { + return this.$type.create(properties); + }; + Message7.encode = function encode2(message, writer) { + return this.$type.encode(message, writer); + }; + Message7.encodeDelimited = function encodeDelimited(message, writer) { + return this.$type.encodeDelimited(message, writer); + }; + Message7.decode = function decode2(reader) { + return this.$type.decode(reader); + }; + Message7.decodeDelimited = function decodeDelimited(reader) { + return this.$type.decodeDelimited(reader); + }; + Message7.verify = function verify(message) { + return this.$type.verify(message); + }; + Message7.fromObject = function fromObject(object) { + return this.$type.fromObject(object); + }; + Message7.toObject = function toObject(message, options) { + return this.$type.toObject(message, options); + }; + Message7.prototype.toJSON = function toJSON() { + return this.$type.toObject(this, util2.toJSONOptions); + }; + } +}); + +// node_modules/protobufjs/src/decoder.js +var require_decoder = __commonJS({ + "node_modules/protobufjs/src/decoder.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = decoder; + var Enum2 = require_enum5(); + var types3 = require_types8(); + var util2 = require_util5(); + function missing(field) { + return "missing required '" + field.name + "'"; + } + function decoder(mtype) { + var gen = util2.codegen(["r", "l", "e"], mtype.name + "$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field2) { + return field2.map; + }).length ? ",k,value" : ""))("while(r.pos>>3){"); + var i7 = 0; + for (; i7 < /* initializes */ + mtype.fieldsArray.length; ++i7) { + var field = mtype._fieldsArray[i7].resolve(), type3 = field.resolvedType instanceof Enum2 ? "int32" : field.type, ref = "m" + util2.safeProp(field.name); + gen("case %i: {", field.id); + if (field.map) { + gen("if(%s===util.emptyObject)", ref)("%s={}", ref)("var c2 = r.uint32()+r.pos"); + if (types3.defaults[field.keyType] !== void 0) + gen("k=%j", types3.defaults[field.keyType]); + else + gen("k=null"); + if (types3.defaults[type3] !== void 0) + gen("value=%j", types3.defaults[type3]); + else + gen("value=null"); + gen("while(r.pos>>3){")("case 1: k=r.%s(); break", field.keyType)("case 2:"); + if (types3.basic[type3] === void 0) + gen("value=types[%i].decode(r,r.uint32())", i7); + else + gen("value=r.%s()", type3); + gen("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"); + if (types3.long[field.keyType] !== void 0) + gen('%s[typeof k==="object"?util.longToHash(k):k]=value', ref); + else + gen("%s[k]=value", ref); + } else if (field.repeated) { + gen("if(!(%s&&%s.length))", ref, ref)("%s=[]", ref); + if (types3.packed[type3] !== void 0) + gen("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0", prop, prop); + break; + case "int32": + case "sint32": + case "sfixed32": + gen("m%s=d%s|0", prop, prop); + break; + case "uint64": + isUnsigned = true; + case "int64": + case "sint64": + case "fixed64": + case "sfixed64": + gen("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j", prop, prop, isUnsigned)('else if(typeof d%s==="string")', prop)("m%s=parseInt(d%s,10)", prop, prop)('else if(typeof d%s==="number")', prop)("m%s=d%s", prop, prop)('else if(typeof d%s==="object")', prop)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", prop, prop, prop, isUnsigned ? "true" : ""); + break; + case "bytes": + gen('if(typeof d%s==="string")', prop)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", prop, prop, prop)("else if(d%s.length >= 0)", prop)("m%s=d%s", prop, prop); + break; + case "string": + gen("m%s=String(d%s)", prop, prop); + break; + case "bool": + gen("m%s=Boolean(d%s)", prop, prop); + break; + } + } + return gen; + } + converter.fromObject = function fromObject(mtype) { + var fields = mtype.fieldsArray; + var gen = util2.codegen(["d"], mtype.name + "$fromObject")("if(d instanceof this.ctor)")("return d"); + if (!fields.length) + return gen("return new this.ctor"); + gen("var m=new this.ctor"); + for (var i7 = 0; i7 < fields.length; ++i7) { + var field = fields[i7].resolve(), prop = util2.safeProp(field.name); + if (field.map) { + gen("if(d%s){", prop)('if(typeof d%s!=="object")', prop)("throw TypeError(%j)", field.fullName + ": object expected")("m%s={}", prop)("for(var ks=Object.keys(d%s),i=0;i>>0,m%s.high>>>0).toNumber(%s):m%s", prop, prop, prop, prop, isUnsigned ? "true" : "", prop); + break; + case "bytes": + gen("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", prop, prop, prop, prop, prop); + break; + default: + gen("d%s=m%s", prop, prop); + break; + } + } + return gen; + } + converter.toObject = function toObject(mtype) { + var fields = mtype.fieldsArray.slice().sort(util2.compareFieldsById); + if (!fields.length) + return util2.codegen()("return {}"); + var gen = util2.codegen(["m", "o"], mtype.name + "$toObject")("if(!o)")("o={}")("var d={}"); + var repeatedFields = [], mapFields = [], normalFields = [], i7 = 0; + for (; i7 < fields.length; ++i7) + if (!fields[i7].partOf) + (fields[i7].resolve().repeated ? repeatedFields : fields[i7].map ? mapFields : normalFields).push(fields[i7]); + if (repeatedFields.length) { + gen("if(o.arrays||o.defaults){"); + for (i7 = 0; i7 < repeatedFields.length; ++i7) + gen("d%s=[]", util2.safeProp(repeatedFields[i7].name)); + gen("}"); + } + if (mapFields.length) { + gen("if(o.objects||o.defaults){"); + for (i7 = 0; i7 < mapFields.length; ++i7) + gen("d%s={}", util2.safeProp(mapFields[i7].name)); + gen("}"); + } + if (normalFields.length) { + gen("if(o.defaults){"); + for (i7 = 0; i7 < normalFields.length; ++i7) { + var field = normalFields[i7], prop = util2.safeProp(field.name); + if (field.resolvedType instanceof Enum2) + gen("d%s=o.enums===String?%j:%j", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault); + else if (field.long) + gen("if(util.Long){")("var n=new util.Long(%i,%i,%j)", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", prop)("}else")("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber()); + else if (field.bytes) { + var arrayDefault = "[" + Array.prototype.slice.call(field.typeDefault).join(",") + "]"; + gen("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault))("else{")("d%s=%s", prop, arrayDefault)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop)("}"); + } else + gen("d%s=%j", prop, field.typeDefault); + } + gen("}"); + } + var hasKs2 = false; + for (i7 = 0; i7 < fields.length; ++i7) { + var field = fields[i7], index4 = mtype._fieldsArray.indexOf(field), prop = util2.safeProp(field.name); + if (field.map) { + if (!hasKs2) { + hasKs2 = true; + gen("var ks2"); + } + gen("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop)("d%s={}", prop)("for(var j=0;j} + * @readonly + */ + fieldsById: { + get: function() { + if (this._fieldsById) + return this._fieldsById; + this._fieldsById = {}; + for (var names = Object.keys(this.fields), i7 = 0; i7 < names.length; ++i7) { + var field = this.fields[names[i7]], id = field.id; + if (this._fieldsById[id]) + throw Error("duplicate id " + id + " in " + this); + this._fieldsById[id] = field; + } + return this._fieldsById; + } + }, + /** + * Fields of this message as an array for iteration. + * @name Type#fieldsArray + * @type {Field[]} + * @readonly + */ + fieldsArray: { + get: function() { + return this._fieldsArray || (this._fieldsArray = util2.toArray(this.fields)); + } + }, + /** + * Oneofs of this message as an array for iteration. + * @name Type#oneofsArray + * @type {OneOf[]} + * @readonly + */ + oneofsArray: { + get: function() { + return this._oneofsArray || (this._oneofsArray = util2.toArray(this.oneofs)); + } + }, + /** + * The registered constructor, if any registered, otherwise a generic constructor. + * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor. + * @name Type#ctor + * @type {Constructor<{}>} + */ + ctor: { + get: function() { + return this._ctor || (this.ctor = Type3.generateConstructor(this)()); + }, + set: function(ctor) { + var prototype = ctor.prototype; + if (!(prototype instanceof Message7)) { + (ctor.prototype = new Message7()).constructor = ctor; + util2.merge(ctor.prototype, prototype); + } + ctor.$type = ctor.prototype.$type = this; + util2.merge(ctor, Message7, true); + this._ctor = ctor; + var i7 = 0; + for (; i7 < /* initializes */ + this.fieldsArray.length; ++i7) + this._fieldsArray[i7].resolve(); + var ctorProperties = {}; + for (i7 = 0; i7 < /* initializes */ + this.oneofsArray.length; ++i7) + ctorProperties[this._oneofsArray[i7].resolve().name] = { + get: util2.oneOfGetter(this._oneofsArray[i7].oneof), + set: util2.oneOfSetter(this._oneofsArray[i7].oneof) + }; + if (i7) + Object.defineProperties(ctor.prototype, ctorProperties); + } + } + }); + Type3.generateConstructor = function generateConstructor(mtype) { + var gen = util2.codegen(["p"], mtype.name); + for (var i7 = 0, field; i7 < mtype.fieldsArray.length; ++i7) + if ((field = mtype._fieldsArray[i7]).map) + gen("this%s={}", util2.safeProp(field.name)); + else if (field.repeated) + gen("this%s=[]", util2.safeProp(field.name)); + return gen("if(p)for(var ks=Object.keys(p),i=0;i { + oneof._resolveFeatures(edition); + }); + this.fieldsArray.forEach((field) => { + field._resolveFeatures(edition); + }); + return this; + }; + Type3.prototype.get = function get4(name2) { + return this.fields[name2] || this.oneofs && this.oneofs[name2] || this.nested && this.nested[name2] || null; + }; + Type3.prototype.add = function add2(object) { + if (this.get(object.name)) + throw Error("duplicate name '" + object.name + "' in " + this); + if (object instanceof Field && object.extend === void 0) { + if (this._fieldsById ? ( + /* istanbul ignore next */ + this._fieldsById[object.id] + ) : this.fieldsById[object.id]) + throw Error("duplicate id " + object.id + " in " + this); + if (this.isReservedId(object.id)) + throw Error("id " + object.id + " is reserved in " + this); + if (this.isReservedName(object.name)) + throw Error("name '" + object.name + "' is reserved in " + this); + if (object.parent) + object.parent.remove(object); + this.fields[object.name] = object; + object.message = this; + object.onAdd(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs) + this.oneofs = {}; + this.oneofs[object.name] = object; + object.onAdd(this); + return clearCache(this); + } + return Namespace.prototype.add.call(this, object); + }; + Type3.prototype.remove = function remove2(object) { + if (object instanceof Field && object.extend === void 0) { + if (!this.fields || this.fields[object.name] !== object) + throw Error(object + " is not a member of " + this); + delete this.fields[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + if (object instanceof OneOf) { + if (!this.oneofs || this.oneofs[object.name] !== object) + throw Error(object + " is not a member of " + this); + delete this.oneofs[object.name]; + object.parent = null; + object.onRemove(this); + return clearCache(this); + } + return Namespace.prototype.remove.call(this, object); + }; + Type3.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); + }; + Type3.prototype.isReservedName = function isReservedName(name2) { + return Namespace.isReservedName(this.reserved, name2); + }; + Type3.prototype.create = function create2(properties) { + return new this.ctor(properties); + }; + Type3.prototype.setup = function setup() { + var fullName = this.fullName, types3 = []; + for (var i7 = 0; i7 < /* initializes */ + this.fieldsArray.length; ++i7) + types3.push(this._fieldsArray[i7].resolve().resolvedType); + this.encode = encoder(this)({ + Writer, + types: types3, + util: util2 + }); + this.decode = decoder(this)({ + Reader, + types: types3, + util: util2 + }); + this.verify = verifier(this)({ + types: types3, + util: util2 + }); + this.fromObject = converter.fromObject(this)({ + types: types3, + util: util2 + }); + this.toObject = converter.toObject(this)({ + types: types3, + util: util2 + }); + var wrapper = wrappers[fullName]; + if (wrapper) { + var originalThis = Object.create(this); + originalThis.fromObject = this.fromObject; + this.fromObject = wrapper.fromObject.bind(originalThis); + originalThis.toObject = this.toObject; + this.toObject = wrapper.toObject.bind(originalThis); + } + return this; + }; + Type3.prototype.encode = function encode_setup(message, writer) { + return this.setup().encode(message, writer); + }; + Type3.prototype.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); + }; + Type3.prototype.decode = function decode_setup(reader, length) { + return this.setup().decode(reader, length); + }; + Type3.prototype.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof Reader)) + reader = Reader.create(reader); + return this.decode(reader, reader.uint32()); + }; + Type3.prototype.verify = function verify_setup(message) { + return this.setup().verify(message); + }; + Type3.prototype.fromObject = function fromObject(object) { + return this.setup().fromObject(object); + }; + Type3.prototype.toObject = function toObject(message, options) { + return this.setup().toObject(message, options); + }; + Type3.d = function decorateType(typeName) { + return function typeDecorator(target) { + util2.decorateType(target, typeName); + }; + }; + } +}); + +// node_modules/protobufjs/src/root.js +var require_root2 = __commonJS({ + "node_modules/protobufjs/src/root.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Root2; + var Namespace = require_namespace(); + ((Root2.prototype = Object.create(Namespace.prototype)).constructor = Root2).className = "Root"; + var Field = require_field(); + var Enum2 = require_enum5(); + var OneOf = require_oneof(); + var util2 = require_util5(); + var Type3; + var parse17; + var common3; + function Root2(options) { + Namespace.call(this, "", options); + this.deferred = []; + this.files = []; + this._edition = "proto2"; + this._fullyQualifiedObjects = {}; + } + Root2.fromJSON = function fromJSON(json2, root2) { + if (!root2) + root2 = new Root2(); + if (json2.options) + root2.setOptions(json2.options); + return root2.addJSON(json2.nested).resolveAll(); + }; + Root2.prototype.resolvePath = util2.path.resolve; + Root2.prototype.fetch = util2.fetch; + function SYNC() { + } + Root2.prototype.load = function load2(filename, options, callback) { + if (typeof options === "function") { + callback = options; + options = void 0; + } + var self2 = this; + if (!callback) { + return util2.asPromise(load2, self2, filename, options); + } + var sync = callback === SYNC; + function finish(err, root2) { + if (!callback) { + return; + } + if (sync) { + throw err; + } + if (root2) { + root2.resolveAll(); + } + var cb = callback; + callback = null; + cb(err, root2); + } + function getBundledFileName(filename2) { + var idx = filename2.lastIndexOf("google/protobuf/"); + if (idx > -1) { + var altname = filename2.substring(idx); + if (altname in common3) + return altname; + } + return null; + } + function process5(filename2, source) { + try { + if (util2.isString(source) && source.charAt(0) === "{") + source = JSON.parse(source); + if (!util2.isString(source)) + self2.setOptions(source.options).addJSON(source.nested); + else { + parse17.filename = filename2; + var parsed = parse17(source, self2, options), resolved2, i8 = 0; + if (parsed.imports) { + for (; i8 < parsed.imports.length; ++i8) + if (resolved2 = getBundledFileName(parsed.imports[i8]) || self2.resolvePath(filename2, parsed.imports[i8])) + fetch2(resolved2); + } + if (parsed.weakImports) { + for (i8 = 0; i8 < parsed.weakImports.length; ++i8) + if (resolved2 = getBundledFileName(parsed.weakImports[i8]) || self2.resolvePath(filename2, parsed.weakImports[i8])) + fetch2(resolved2, true); + } + } + } catch (err) { + finish(err); + } + if (!sync && !queued) { + finish(null, self2); + } + } + function fetch2(filename2, weak) { + filename2 = getBundledFileName(filename2) || filename2; + if (self2.files.indexOf(filename2) > -1) { + return; + } + self2.files.push(filename2); + if (filename2 in common3) { + if (sync) { + process5(filename2, common3[filename2]); + } else { + ++queued; + setTimeout(function() { + --queued; + process5(filename2, common3[filename2]); + }); + } + return; + } + if (sync) { + var source; + try { + source = util2.fs.readFileSync(filename2).toString("utf8"); + } catch (err) { + if (!weak) + finish(err); + return; + } + process5(filename2, source); + } else { + ++queued; + self2.fetch(filename2, function(err, source2) { + --queued; + if (!callback) { + return; + } + if (err) { + if (!weak) + finish(err); + else if (!queued) + finish(null, self2); + return; + } + process5(filename2, source2); + }); + } + } + var queued = 0; + if (util2.isString(filename)) { + filename = [filename]; + } + for (var i7 = 0, resolved; i7 < filename.length; ++i7) + if (resolved = self2.resolvePath("", filename[i7])) + fetch2(resolved); + if (sync) { + self2.resolveAll(); + return self2; + } + if (!queued) { + finish(null, self2); + } + return self2; + }; + Root2.prototype.loadSync = function loadSync(filename, options) { + if (!util2.isNode) + throw Error("not supported"); + return this.load(filename, options, SYNC); + }; + Root2.prototype.resolveAll = function resolveAll() { + if (!this._needsRecursiveResolve) + return this; + if (this.deferred.length) + throw Error("unresolvable extensions: " + this.deferred.map(function(field) { + return "'extend " + field.extend + "' in " + field.parent.fullName; + }).join(", ")); + return Namespace.prototype.resolveAll.call(this); + }; + var exposeRe = /^[A-Z]/; + function tryHandleExtension(root2, field) { + var extendedType = field.parent.lookup(field.extend); + if (extendedType) { + var sisterField = new Field(field.fullName, field.id, field.type, field.rule, void 0, field.options); + if (extendedType.get(sisterField.name)) { + return true; + } + sisterField.declaringField = field; + field.extensionField = sisterField; + extendedType.add(sisterField); + return true; + } + return false; + } + Root2.prototype._handleAdd = function _handleAdd(object) { + if (object instanceof Field) { + if ( + /* an extension field (implies not part of a oneof) */ + object.extend !== void 0 && /* not already handled */ + !object.extensionField + ) { + if (!tryHandleExtension(this, object)) + this.deferred.push(object); + } + } else if (object instanceof Enum2) { + if (exposeRe.test(object.name)) + object.parent[object.name] = object.values; + } else if (!(object instanceof OneOf)) { + if (object instanceof Type3) + for (var i7 = 0; i7 < this.deferred.length; ) + if (tryHandleExtension(this, this.deferred[i7])) + this.deferred.splice(i7, 1); + else + ++i7; + for (var j6 = 0; j6 < /* initializes */ + object.nestedArray.length; ++j6) + this._handleAdd(object._nestedArray[j6]); + if (exposeRe.test(object.name)) + object.parent[object.name] = object; + } + if (object instanceof Type3 || object instanceof Enum2 || object instanceof Field) { + this._fullyQualifiedObjects[object.fullName] = object; + } + }; + Root2.prototype._handleRemove = function _handleRemove(object) { + if (object instanceof Field) { + if ( + /* an extension field */ + object.extend !== void 0 + ) { + if ( + /* already handled */ + object.extensionField + ) { + object.extensionField.parent.remove(object.extensionField); + object.extensionField = null; + } else { + var index4 = this.deferred.indexOf(object); + if (index4 > -1) + this.deferred.splice(index4, 1); + } + } + } else if (object instanceof Enum2) { + if (exposeRe.test(object.name)) + delete object.parent[object.name]; + } else if (object instanceof Namespace) { + for (var i7 = 0; i7 < /* initializes */ + object.nestedArray.length; ++i7) + this._handleRemove(object._nestedArray[i7]); + if (exposeRe.test(object.name)) + delete object.parent[object.name]; + } + delete this._fullyQualifiedObjects[object.fullName]; + }; + Root2._configure = function(Type_, parse_, common_) { + Type3 = Type_; + parse17 = parse_; + common3 = common_; + }; + } +}); + +// node_modules/protobufjs/src/util.js +var require_util5 = __commonJS({ + "node_modules/protobufjs/src/util.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = module5.exports = require_minimal(); + var roots = require_roots(); + var Type3; + var Enum2; + util2.codegen = require_codegen2(); + util2.fetch = require_fetch2(); + util2.path = require_path(); + util2.fs = util2.inquire("fs"); + util2.toArray = function toArray3(object) { + if (object) { + var keys2 = Object.keys(object), array = new Array(keys2.length), index4 = 0; + while (index4 < keys2.length) + array[index4] = object[keys2[index4++]]; + return array; + } + return []; + }; + util2.toObject = function toObject(array) { + var object = {}, index4 = 0; + while (index4 < array.length) { + var key = array[index4++], val = array[index4++]; + if (val !== void 0) + object[key] = val; + } + return object; + }; + var safePropBackslashRe = /\\/g; + var safePropQuoteRe = /"/g; + util2.isReserved = function isReserved(name2) { + return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name2); + }; + util2.safeProp = function safeProp(prop) { + if (!/^[$\w_]+$/.test(prop) || util2.isReserved(prop)) + return '["' + prop.replace(safePropBackslashRe, "\\\\").replace(safePropQuoteRe, '\\"') + '"]'; + return "." + prop; + }; + util2.ucFirst = function ucFirst(str2) { + return str2.charAt(0).toUpperCase() + str2.substring(1); + }; + var camelCaseRe = /_([a-z])/g; + util2.camelCase = function camelCase3(str2) { + return str2.substring(0, 1) + str2.substring(1).replace(camelCaseRe, function($0, $1) { + return $1.toUpperCase(); + }); + }; + util2.compareFieldsById = function compareFieldsById(a7, b8) { + return a7.id - b8.id; + }; + util2.decorateType = function decorateType(ctor, typeName) { + if (ctor.$type) { + if (typeName && ctor.$type.name !== typeName) { + util2.decorateRoot.remove(ctor.$type); + ctor.$type.name = typeName; + util2.decorateRoot.add(ctor.$type); + } + return ctor.$type; + } + if (!Type3) + Type3 = require_type4(); + var type3 = new Type3(typeName || ctor.name); + util2.decorateRoot.add(type3); + type3.ctor = ctor; + Object.defineProperty(ctor, "$type", { value: type3, enumerable: false }); + Object.defineProperty(ctor.prototype, "$type", { value: type3, enumerable: false }); + return type3; + }; + var decorateEnumIndex = 0; + util2.decorateEnum = function decorateEnum(object) { + if (object.$type) + return object.$type; + if (!Enum2) + Enum2 = require_enum5(); + var enm = new Enum2("Enum" + decorateEnumIndex++, object); + util2.decorateRoot.add(enm); + Object.defineProperty(object, "$type", { value: enm, enumerable: false }); + return enm; + }; + util2.setProperty = function setProperty3(dst, path2, value2, ifNotSet) { + function setProp(dst2, path3, value3) { + var part = path3.shift(); + if (part === "__proto__" || part === "prototype") { + return dst2; + } + if (path3.length > 0) { + dst2[part] = setProp(dst2[part] || {}, path3, value3); + } else { + var prevValue = dst2[part]; + if (prevValue && ifNotSet) + return dst2; + if (prevValue) + value3 = [].concat(prevValue).concat(value3); + dst2[part] = value3; + } + return dst2; + } + if (typeof dst !== "object") + throw TypeError("dst must be an object"); + if (!path2) + throw TypeError("path must be specified"); + path2 = path2.split("."); + return setProp(dst, path2, value2); + }; + Object.defineProperty(util2, "decorateRoot", { + get: function() { + return roots["decorated"] || (roots["decorated"] = new (require_root2())()); + } + }); + } +}); + +// node_modules/protobufjs/src/types.js +var require_types8 = __commonJS({ + "node_modules/protobufjs/src/types.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var types3 = exports28; + var util2 = require_util5(); + var s7 = [ + "double", + // 0 + "float", + // 1 + "int32", + // 2 + "uint32", + // 3 + "sint32", + // 4 + "fixed32", + // 5 + "sfixed32", + // 6 + "int64", + // 7 + "uint64", + // 8 + "sint64", + // 9 + "fixed64", + // 10 + "sfixed64", + // 11 + "bool", + // 12 + "string", + // 13 + "bytes" + // 14 + ]; + function bake(values2, offset) { + var i7 = 0, o7 = {}; + offset |= 0; + while (i7 < values2.length) + o7[s7[i7 + offset]] = values2[i7++]; + return o7; + } + types3.basic = bake([ + /* double */ + 1, + /* float */ + 5, + /* int32 */ + 0, + /* uint32 */ + 0, + /* sint32 */ + 0, + /* fixed32 */ + 5, + /* sfixed32 */ + 5, + /* int64 */ + 0, + /* uint64 */ + 0, + /* sint64 */ + 0, + /* fixed64 */ + 1, + /* sfixed64 */ + 1, + /* bool */ + 0, + /* string */ + 2, + /* bytes */ + 2 + ]); + types3.defaults = bake([ + /* double */ + 0, + /* float */ + 0, + /* int32 */ + 0, + /* uint32 */ + 0, + /* sint32 */ + 0, + /* fixed32 */ + 0, + /* sfixed32 */ + 0, + /* int64 */ + 0, + /* uint64 */ + 0, + /* sint64 */ + 0, + /* fixed64 */ + 0, + /* sfixed64 */ + 0, + /* bool */ + false, + /* string */ + "", + /* bytes */ + util2.emptyArray, + /* message */ + null + ]); + types3.long = bake([ + /* int64 */ + 0, + /* uint64 */ + 0, + /* sint64 */ + 0, + /* fixed64 */ + 1, + /* sfixed64 */ + 1 + ], 7); + types3.mapKey = bake([ + /* int32 */ + 0, + /* uint32 */ + 0, + /* sint32 */ + 0, + /* fixed32 */ + 5, + /* sfixed32 */ + 5, + /* int64 */ + 0, + /* uint64 */ + 0, + /* sint64 */ + 0, + /* fixed64 */ + 1, + /* sfixed64 */ + 1, + /* bool */ + 0, + /* string */ + 2 + ], 2); + types3.packed = bake([ + /* double */ + 1, + /* float */ + 5, + /* int32 */ + 0, + /* uint32 */ + 0, + /* sint32 */ + 0, + /* fixed32 */ + 5, + /* sfixed32 */ + 5, + /* int64 */ + 0, + /* uint64 */ + 0, + /* sint64 */ + 0, + /* fixed64 */ + 1, + /* sfixed64 */ + 1, + /* bool */ + 0 + ]); + } +}); + +// node_modules/protobufjs/src/field.js +var require_field = __commonJS({ + "node_modules/protobufjs/src/field.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Field; + var ReflectionObject = require_object(); + ((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field"; + var Enum2 = require_enum5(); + var types3 = require_types8(); + var util2 = require_util5(); + var Type3; + var ruleRe = /^required|optional|repeated$/; + Field.fromJSON = function fromJSON(name2, json2) { + var field = new Field(name2, json2.id, json2.type, json2.rule, json2.extend, json2.options, json2.comment); + if (json2.edition) + field._edition = json2.edition; + field._defaultEdition = "proto3"; + return field; + }; + function Field(name2, id, type3, rule, extend3, options, comment) { + if (util2.isObject(rule)) { + comment = extend3; + options = rule; + rule = extend3 = void 0; + } else if (util2.isObject(extend3)) { + comment = options; + options = extend3; + extend3 = void 0; + } + ReflectionObject.call(this, name2, options); + if (!util2.isInteger(id) || id < 0) + throw TypeError("id must be a non-negative integer"); + if (!util2.isString(type3)) + throw TypeError("type must be a string"); + if (rule !== void 0 && !ruleRe.test(rule = rule.toString().toLowerCase())) + throw TypeError("rule must be a string rule"); + if (extend3 !== void 0 && !util2.isString(extend3)) + throw TypeError("extend must be a string"); + if (rule === "proto3_optional") { + rule = "optional"; + } + this.rule = rule && rule !== "optional" ? rule : void 0; + this.type = type3; + this.id = id; + this.extend = extend3 || void 0; + this.repeated = rule === "repeated"; + this.map = false; + this.message = null; + this.partOf = null; + this.typeDefault = null; + this.defaultValue = null; + this.long = util2.Long ? types3.long[type3] !== void 0 : ( + /* istanbul ignore next */ + false + ); + this.bytes = type3 === "bytes"; + this.resolvedType = null; + this.extensionField = null; + this.declaringField = null; + this.comment = comment; + } + Object.defineProperty(Field.prototype, "required", { + get: function() { + return this._features.field_presence === "LEGACY_REQUIRED"; + } + }); + Object.defineProperty(Field.prototype, "optional", { + get: function() { + return !this.required; + } + }); + Object.defineProperty(Field.prototype, "delimited", { + get: function() { + return this.resolvedType instanceof Type3 && this._features.message_encoding === "DELIMITED"; + } + }); + Object.defineProperty(Field.prototype, "packed", { + get: function() { + return this._features.repeated_field_encoding === "PACKED"; + } + }); + Object.defineProperty(Field.prototype, "hasPresence", { + get: function() { + if (this.repeated || this.map) { + return false; + } + return this.partOf || // oneofs + this.declaringField || this.extensionField || // extensions + this._features.field_presence !== "IMPLICIT"; + } + }); + Field.prototype.setOption = function setOption(name2, value2, ifNotSet) { + return ReflectionObject.prototype.setOption.call(this, name2, value2, ifNotSet); + }; + Field.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "edition", + this._editionToJSON(), + "rule", + this.rule !== "optional" && this.rule || void 0, + "type", + this.type, + "id", + this.id, + "extend", + this.extend, + "options", + this.options, + "comment", + keepComments ? this.comment : void 0 + ]); + }; + Field.prototype.resolve = function resolve3() { + if (this.resolved) + return this; + if ((this.typeDefault = types3.defaults[this.type]) === void 0) { + this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type); + if (this.resolvedType instanceof Type3) + this.typeDefault = null; + else + this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; + } else if (this.options && this.options.proto3_optional) { + this.typeDefault = null; + } + if (this.options && this.options["default"] != null) { + this.typeDefault = this.options["default"]; + if (this.resolvedType instanceof Enum2 && typeof this.typeDefault === "string") + this.typeDefault = this.resolvedType.values[this.typeDefault]; + } + if (this.options) { + if (this.options.packed !== void 0 && this.resolvedType && !(this.resolvedType instanceof Enum2)) + delete this.options.packed; + if (!Object.keys(this.options).length) + this.options = void 0; + } + if (this.long) { + this.typeDefault = util2.Long.fromNumber(this.typeDefault, this.type.charAt(0) === "u"); + if (Object.freeze) + Object.freeze(this.typeDefault); + } else if (this.bytes && typeof this.typeDefault === "string") { + var buf; + if (util2.base64.test(this.typeDefault)) + util2.base64.decode(this.typeDefault, buf = util2.newBuffer(util2.base64.length(this.typeDefault)), 0); + else + util2.utf8.write(this.typeDefault, buf = util2.newBuffer(util2.utf8.length(this.typeDefault)), 0); + this.typeDefault = buf; + } + if (this.map) + this.defaultValue = util2.emptyObject; + else if (this.repeated) + this.defaultValue = util2.emptyArray; + else + this.defaultValue = this.typeDefault; + if (this.parent instanceof Type3) + this.parent.ctor.prototype[this.name] = this.defaultValue; + return ReflectionObject.prototype.resolve.call(this); + }; + Field.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(edition) { + if (edition !== "proto2" && edition !== "proto3") { + return {}; + } + var features3 = {}; + if (this.rule === "required") { + features3.field_presence = "LEGACY_REQUIRED"; + } + if (this.parent && types3.defaults[this.type] === void 0) { + var type3 = this.parent.get(this.type.split(".").pop()); + if (type3 && type3 instanceof Type3 && type3.group) { + features3.message_encoding = "DELIMITED"; + } + } + if (this.getOption("packed") === true) { + features3.repeated_field_encoding = "PACKED"; + } else if (this.getOption("packed") === false) { + features3.repeated_field_encoding = "EXPANDED"; + } + return features3; + }; + Field.prototype._resolveFeatures = function _resolveFeatures(edition) { + return ReflectionObject.prototype._resolveFeatures.call(this, this._edition || edition); + }; + Field.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) { + if (typeof fieldType === "function") + fieldType = util2.decorateType(fieldType).name; + else if (fieldType && typeof fieldType === "object") + fieldType = util2.decorateEnum(fieldType).name; + return function fieldDecorator(prototype, fieldName) { + util2.decorateType(prototype.constructor).add(new Field(fieldName, fieldId, fieldType, fieldRule, { "default": defaultValue })); + }; + }; + Field._configure = function configure(Type_) { + Type3 = Type_; + }; + } +}); + +// node_modules/protobufjs/src/oneof.js +var require_oneof = __commonJS({ + "node_modules/protobufjs/src/oneof.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = OneOf; + var ReflectionObject = require_object(); + ((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf"; + var Field = require_field(); + var util2 = require_util5(); + function OneOf(name2, fieldNames, options, comment) { + if (!Array.isArray(fieldNames)) { + options = fieldNames; + fieldNames = void 0; + } + ReflectionObject.call(this, name2, options); + if (!(fieldNames === void 0 || Array.isArray(fieldNames))) + throw TypeError("fieldNames must be an Array"); + this.oneof = fieldNames || []; + this.fieldsArray = []; + this.comment = comment; + } + OneOf.fromJSON = function fromJSON(name2, json2) { + return new OneOf(name2, json2.oneof, json2.options, json2.comment); + }; + OneOf.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "options", + this.options, + "oneof", + this.oneof, + "comment", + keepComments ? this.comment : void 0 + ]); + }; + function addFieldsToParent(oneof) { + if (oneof.parent) { + for (var i7 = 0; i7 < oneof.fieldsArray.length; ++i7) + if (!oneof.fieldsArray[i7].parent) + oneof.parent.add(oneof.fieldsArray[i7]); + } + } + OneOf.prototype.add = function add2(field) { + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + if (field.parent && field.parent !== this.parent) + field.parent.remove(field); + this.oneof.push(field.name); + this.fieldsArray.push(field); + field.partOf = this; + addFieldsToParent(this); + return this; + }; + OneOf.prototype.remove = function remove2(field) { + if (!(field instanceof Field)) + throw TypeError("field must be a Field"); + var index4 = this.fieldsArray.indexOf(field); + if (index4 < 0) + throw Error(field + " is not a member of " + this); + this.fieldsArray.splice(index4, 1); + index4 = this.oneof.indexOf(field.name); + if (index4 > -1) + this.oneof.splice(index4, 1); + field.partOf = null; + return this; + }; + OneOf.prototype.onAdd = function onAdd(parent2) { + ReflectionObject.prototype.onAdd.call(this, parent2); + var self2 = this; + for (var i7 = 0; i7 < this.oneof.length; ++i7) { + var field = parent2.get(this.oneof[i7]); + if (field && !field.partOf) { + field.partOf = self2; + self2.fieldsArray.push(field); + } + } + addFieldsToParent(this); + }; + OneOf.prototype.onRemove = function onRemove(parent2) { + for (var i7 = 0, field; i7 < this.fieldsArray.length; ++i7) + if ((field = this.fieldsArray[i7]).parent) + field.parent.remove(field); + ReflectionObject.prototype.onRemove.call(this, parent2); + }; + Object.defineProperty(OneOf.prototype, "isProto3Optional", { + get: function() { + if (this.fieldsArray == null || this.fieldsArray.length !== 1) { + return false; + } + var field = this.fieldsArray[0]; + return field.options != null && field.options["proto3_optional"] === true; + } + }); + OneOf.d = function decorateOneOf() { + var fieldNames = new Array(arguments.length), index4 = 0; + while (index4 < arguments.length) + fieldNames[index4] = arguments[index4++]; + return function oneOfDecorator(prototype, oneofName) { + util2.decorateType(prototype.constructor).add(new OneOf(oneofName, fieldNames)); + Object.defineProperty(prototype, oneofName, { + get: util2.oneOfGetter(fieldNames), + set: util2.oneOfSetter(fieldNames) + }); + }; + }; + } +}); + +// node_modules/protobufjs/src/object.js +var require_object = __commonJS({ + "node_modules/protobufjs/src/object.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = ReflectionObject; + ReflectionObject.className = "ReflectionObject"; + var OneOf = require_oneof(); + var util2 = require_util5(); + var Root2; + var editions2023Defaults = { enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY" }; + var proto2Defaults = { enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE" }; + var proto3Defaults = { enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY" }; + function ReflectionObject(name2, options) { + if (!util2.isString(name2)) + throw TypeError("name must be a string"); + if (options && !util2.isObject(options)) + throw TypeError("options must be an object"); + this.options = options; + this.parsedOptions = null; + this.name = name2; + this._edition = null; + this._defaultEdition = "proto2"; + this._features = {}; + this._featuresResolved = false; + this.parent = null; + this.resolved = false; + this.comment = null; + this.filename = null; + } + Object.defineProperties(ReflectionObject.prototype, { + /** + * Reference to the root namespace. + * @name ReflectionObject#root + * @type {Root} + * @readonly + */ + root: { + get: function() { + var ptr = this; + while (ptr.parent !== null) + ptr = ptr.parent; + return ptr; + } + }, + /** + * Full name including leading dot. + * @name ReflectionObject#fullName + * @type {string} + * @readonly + */ + fullName: { + get: function() { + var path2 = [this.name], ptr = this.parent; + while (ptr) { + path2.unshift(ptr.name); + ptr = ptr.parent; + } + return path2.join("."); + } + } + }); + ReflectionObject.prototype.toJSON = /* istanbul ignore next */ + function toJSON() { + throw Error(); + }; + ReflectionObject.prototype.onAdd = function onAdd(parent2) { + if (this.parent && this.parent !== parent2) + this.parent.remove(this); + this.parent = parent2; + this.resolved = false; + var root2 = parent2.root; + if (root2 instanceof Root2) + root2._handleAdd(this); + }; + ReflectionObject.prototype.onRemove = function onRemove(parent2) { + var root2 = parent2.root; + if (root2 instanceof Root2) + root2._handleRemove(this); + this.parent = null; + this.resolved = false; + }; + ReflectionObject.prototype.resolve = function resolve3() { + if (this.resolved) + return this; + if (this.root instanceof Root2) + this.resolved = true; + return this; + }; + ReflectionObject.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) { + return this._resolveFeatures(this._edition || edition); + }; + ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition) { + if (this._featuresResolved) { + return; + } + var defaults2 = {}; + if (!edition) { + throw new Error("Unknown edition for " + this.fullName); + } + var protoFeatures = Object.assign( + this.options ? Object.assign({}, this.options.features) : {}, + this._inferLegacyProtoFeatures(edition) + ); + if (this._edition) { + if (edition === "proto2") { + defaults2 = Object.assign({}, proto2Defaults); + } else if (edition === "proto3") { + defaults2 = Object.assign({}, proto3Defaults); + } else if (edition === "2023") { + defaults2 = Object.assign({}, editions2023Defaults); + } else { + throw new Error("Unknown edition: " + edition); + } + this._features = Object.assign(defaults2, protoFeatures || {}); + this._featuresResolved = true; + return; + } + if (this.partOf instanceof OneOf) { + var lexicalParentFeaturesCopy = Object.assign({}, this.partOf._features); + this._features = Object.assign(lexicalParentFeaturesCopy, protoFeatures || {}); + } else if (this.declaringField) { + } else if (this.parent) { + var parentFeaturesCopy = Object.assign({}, this.parent._features); + this._features = Object.assign(parentFeaturesCopy, protoFeatures || {}); + } else { + throw new Error("Unable to find a parent for " + this.fullName); + } + if (this.extensionField) { + this.extensionField._features = this._features; + } + this._featuresResolved = true; + }; + ReflectionObject.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures() { + return {}; + }; + ReflectionObject.prototype.getOption = function getOption(name2) { + if (this.options) + return this.options[name2]; + return void 0; + }; + ReflectionObject.prototype.setOption = function setOption(name2, value2, ifNotSet) { + if (!this.options) + this.options = {}; + if (/^features\./.test(name2)) { + util2.setProperty(this.options, name2, value2, ifNotSet); + } else if (!ifNotSet || this.options[name2] === void 0) { + if (this.getOption(name2) !== value2) + this.resolved = false; + this.options[name2] = value2; + } + return this; + }; + ReflectionObject.prototype.setParsedOption = function setParsedOption(name2, value2, propName2) { + if (!this.parsedOptions) { + this.parsedOptions = []; + } + var parsedOptions = this.parsedOptions; + if (propName2) { + var opt = parsedOptions.find(function(opt2) { + return Object.prototype.hasOwnProperty.call(opt2, name2); + }); + if (opt) { + var newValue = opt[name2]; + util2.setProperty(newValue, propName2, value2); + } else { + opt = {}; + opt[name2] = util2.setProperty({}, propName2, value2); + parsedOptions.push(opt); + } + } else { + var newOpt = {}; + newOpt[name2] = value2; + parsedOptions.push(newOpt); + } + return this; + }; + ReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) { + if (options) + for (var keys2 = Object.keys(options), i7 = 0; i7 < keys2.length; ++i7) + this.setOption(keys2[i7], options[keys2[i7]], ifNotSet); + return this; + }; + ReflectionObject.prototype.toString = function toString3() { + var className = this.constructor.className, fullName = this.fullName; + if (fullName.length) + return className + " " + fullName; + return className; + }; + ReflectionObject.prototype._editionToJSON = function _editionToJSON() { + if (!this._edition || this._edition === "proto3") { + return void 0; + } + return this._edition; + }; + ReflectionObject._configure = function(Root_) { + Root2 = Root_; + }; + } +}); + +// node_modules/protobufjs/src/enum.js +var require_enum5 = __commonJS({ + "node_modules/protobufjs/src/enum.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = Enum2; + var ReflectionObject = require_object(); + ((Enum2.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum2).className = "Enum"; + var Namespace = require_namespace(); + var util2 = require_util5(); + function Enum2(name2, values2, options, comment, comments, valuesOptions) { + ReflectionObject.call(this, name2, options); + if (values2 && typeof values2 !== "object") + throw TypeError("values must be an object"); + this.valuesById = {}; + this.values = Object.create(this.valuesById); + this.comment = comment; + this.comments = comments || {}; + this.valuesOptions = valuesOptions; + this._valuesFeatures = {}; + this.reserved = void 0; + if (values2) { + for (var keys2 = Object.keys(values2), i7 = 0; i7 < keys2.length; ++i7) + if (typeof values2[keys2[i7]] === "number") + this.valuesById[this.values[keys2[i7]] = values2[keys2[i7]]] = keys2[i7]; + } + } + Enum2.prototype._resolveFeatures = function _resolveFeatures(edition) { + edition = this._edition || edition; + ReflectionObject.prototype._resolveFeatures.call(this, edition); + Object.keys(this.values).forEach((key) => { + var parentFeaturesCopy = Object.assign({}, this._features); + this._valuesFeatures[key] = Object.assign(parentFeaturesCopy, this.valuesOptions && this.valuesOptions[key] && this.valuesOptions[key].features); + }); + return this; + }; + Enum2.fromJSON = function fromJSON(name2, json2) { + var enm = new Enum2(name2, json2.values, json2.options, json2.comment, json2.comments); + enm.reserved = json2.reserved; + if (json2.edition) + enm._edition = json2.edition; + enm._defaultEdition = "proto3"; + return enm; + }; + Enum2.prototype.toJSON = function toJSON(toJSONOptions) { + var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false; + return util2.toObject([ + "edition", + this._editionToJSON(), + "options", + this.options, + "valuesOptions", + this.valuesOptions, + "values", + this.values, + "reserved", + this.reserved && this.reserved.length ? this.reserved : void 0, + "comment", + keepComments ? this.comment : void 0, + "comments", + keepComments ? this.comments : void 0 + ]); + }; + Enum2.prototype.add = function add2(name2, id, comment, options) { + if (!util2.isString(name2)) + throw TypeError("name must be a string"); + if (!util2.isInteger(id)) + throw TypeError("id must be an integer"); + if (this.values[name2] !== void 0) + throw Error("duplicate name '" + name2 + "' in " + this); + if (this.isReservedId(id)) + throw Error("id " + id + " is reserved in " + this); + if (this.isReservedName(name2)) + throw Error("name '" + name2 + "' is reserved in " + this); + if (this.valuesById[id] !== void 0) { + if (!(this.options && this.options.allow_alias)) + throw Error("duplicate id " + id + " in " + this); + this.values[name2] = id; + } else + this.valuesById[this.values[name2] = id] = name2; + if (options) { + if (this.valuesOptions === void 0) + this.valuesOptions = {}; + this.valuesOptions[name2] = options || null; + } + this.comments[name2] = comment || null; + return this; + }; + Enum2.prototype.remove = function remove2(name2) { + if (!util2.isString(name2)) + throw TypeError("name must be a string"); + var val = this.values[name2]; + if (val == null) + throw Error("name '" + name2 + "' does not exist in " + this); + delete this.valuesById[val]; + delete this.values[name2]; + delete this.comments[name2]; + if (this.valuesOptions) + delete this.valuesOptions[name2]; + return this; + }; + Enum2.prototype.isReservedId = function isReservedId(id) { + return Namespace.isReservedId(this.reserved, id); + }; + Enum2.prototype.isReservedName = function isReservedName(name2) { + return Namespace.isReservedName(this.reserved, name2); + }; + } +}); + +// node_modules/protobufjs/src/encoder.js +var require_encoder = __commonJS({ + "node_modules/protobufjs/src/encoder.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = encoder; + var Enum2 = require_enum5(); + var types3 = require_types8(); + var util2 = require_util5(); + function genTypePartial(gen, field, fieldIndex, ref) { + return field.delimited ? gen("types[%i].encode(%s,w.uint32(%i)).uint32(%i)", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0) : gen("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", fieldIndex, ref, (field.id << 3 | 2) >>> 0); + } + function encoder(mtype) { + var gen = util2.codegen(["m", "w"], mtype.name + "$encode")("if(!w)")("w=Writer.create()"); + var i7, ref; + var fields = ( + /* initializes */ + mtype.fieldsArray.slice().sort(util2.compareFieldsById) + ); + for (var i7 = 0; i7 < fields.length; ++i7) { + var field = fields[i7].resolve(), index4 = mtype._fieldsArray.indexOf(field), type3 = field.resolvedType instanceof Enum2 ? "int32" : field.type, wireType = types3.basic[type3]; + ref = "m" + util2.safeProp(field.name); + if (field.map) { + gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){", ref, field.name)("for(var ks=Object.keys(%s),i=0;i>> 0, 8 | types3.mapKey[field.keyType], field.keyType); + if (wireType === void 0) + gen("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", index4, ref); + else + gen(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | wireType, type3, ref); + gen("}")("}"); + } else if (field.repeated) { + gen("if(%s!=null&&%s.length){", ref, ref); + if (field.packed && types3.packed[type3] !== void 0) { + gen("w.uint32(%i).fork()", (field.id << 3 | 2) >>> 0)("for(var i=0;i<%s.length;++i)", ref)("w.%s(%s[i])", type3, ref)("w.ldelim()"); + } else { + gen("for(var i=0;i<%s.length;++i)", ref); + if (wireType === void 0) + genTypePartial(gen, field, index4, ref + "[i]"); + else + gen("w.uint32(%i).%s(%s[i])", (field.id << 3 | wireType) >>> 0, type3, ref); + } + gen("}"); + } else { + if (field.optional) + gen("if(%s!=null&&Object.hasOwnProperty.call(m,%j))", ref, field.name); + if (wireType === void 0) + genTypePartial(gen, field, index4, ref); + else + gen("w.uint32(%i).%s(%s)", (field.id << 3 | wireType) >>> 0, type3, ref); + } + } + return gen("return w"); + } + } +}); + +// node_modules/protobufjs/src/index-light.js +var require_index_light = __commonJS({ + "node_modules/protobufjs/src/index-light.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var protobuf2 = module5.exports = require_index_minimal(); + protobuf2.build = "light"; + function load2(filename, root2, callback) { + if (typeof root2 === "function") { + callback = root2; + root2 = new protobuf2.Root(); + } else if (!root2) + root2 = new protobuf2.Root(); + return root2.load(filename, callback); + } + protobuf2.load = load2; + function loadSync(filename, root2) { + if (!root2) + root2 = new protobuf2.Root(); + return root2.loadSync(filename); + } + protobuf2.loadSync = loadSync; + protobuf2.encoder = require_encoder(); + protobuf2.decoder = require_decoder(); + protobuf2.verifier = require_verifier(); + protobuf2.converter = require_converter(); + protobuf2.ReflectionObject = require_object(); + protobuf2.Namespace = require_namespace(); + protobuf2.Root = require_root2(); + protobuf2.Enum = require_enum5(); + protobuf2.Type = require_type4(); + protobuf2.Field = require_field(); + protobuf2.OneOf = require_oneof(); + protobuf2.MapField = require_mapfield(); + protobuf2.Service = require_service2(); + protobuf2.Method = require_method(); + protobuf2.Message = require_message2(); + protobuf2.wrappers = require_wrappers(); + protobuf2.types = require_types8(); + protobuf2.util = require_util5(); + protobuf2.ReflectionObject._configure(protobuf2.Root); + protobuf2.Namespace._configure(protobuf2.Type, protobuf2.Service, protobuf2.Enum); + protobuf2.Root._configure(protobuf2.Type); + protobuf2.Field._configure(protobuf2.Type); + } +}); + +// node_modules/protobufjs/src/tokenize.js +var require_tokenize = __commonJS({ + "node_modules/protobufjs/src/tokenize.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = tokenize; + var delimRe = /[\s{}=;:[\],'"()<>]/g; + var stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g; + var stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g; + var setCommentRe = /^ *[*/]+ */; + var setCommentAltRe = /^\s*\*?\/*/; + var setCommentSplitRe = /\n/g; + var whitespaceRe = /\s/; + var unescapeRe = /\\(.?)/g; + var unescapeMap = { + "0": "\0", + "r": "\r", + "n": "\n", + "t": " " + }; + function unescape3(str2) { + return str2.replace(unescapeRe, function($0, $1) { + switch ($1) { + case "\\": + case "": + return $1; + default: + return unescapeMap[$1] || ""; + } + }); + } + tokenize.unescape = unescape3; + function tokenize(source, alternateCommentMode) { + source = source.toString(); + var offset = 0, length = source.length, line = 1, lastCommentLine = 0, comments = {}; + var stack = []; + var stringDelim = null; + function illegal(subject) { + return Error("illegal " + subject + " (line " + line + ")"); + } + function readString() { + var re4 = stringDelim === "'" ? stringSingleRe : stringDoubleRe; + re4.lastIndex = offset - 1; + var match = re4.exec(source); + if (!match) + throw illegal("string"); + offset = re4.lastIndex; + push4(stringDelim); + stringDelim = null; + return unescape3(match[1]); + } + function charAt(pos) { + return source.charAt(pos); + } + function setComment(start, end, isLeading) { + var comment = { + type: source.charAt(start++), + lineEmpty: false, + leading: isLeading + }; + var lookback; + if (alternateCommentMode) { + lookback = 2; + } else { + lookback = 3; + } + var commentOffset = start - lookback, c7; + do { + if (--commentOffset < 0 || (c7 = source.charAt(commentOffset)) === "\n") { + comment.lineEmpty = true; + break; + } + } while (c7 === " " || c7 === " "); + var lines = source.substring(start, end).split(setCommentSplitRe); + for (var i7 = 0; i7 < lines.length; ++i7) + lines[i7] = lines[i7].replace(alternateCommentMode ? setCommentAltRe : setCommentRe, "").trim(); + comment.text = lines.join("\n").trim(); + comments[line] = comment; + lastCommentLine = line; + } + function isDoubleSlashCommentLine(startOffset) { + var endOffset = findEndOfLine(startOffset); + var lineText = source.substring(startOffset, endOffset); + var isComment = /^\s*\/\//.test(lineText); + return isComment; + } + function findEndOfLine(cursor) { + var endOffset = cursor; + while (endOffset < length && charAt(endOffset) !== "\n") { + endOffset++; + } + return endOffset; + } + function next() { + if (stack.length > 0) + return stack.shift(); + if (stringDelim) + return readString(); + var repeat3, prev, curr, start, isDoc, isLeadingComment = offset === 0; + do { + if (offset === length) + return null; + repeat3 = false; + while (whitespaceRe.test(curr = charAt(offset))) { + if (curr === "\n") { + isLeadingComment = true; + ++line; + } + if (++offset === length) + return null; + } + if (charAt(offset) === "/") { + if (++offset === length) { + throw illegal("comment"); + } + if (charAt(offset) === "/") { + if (!alternateCommentMode) { + isDoc = charAt(start = offset + 1) === "/"; + while (charAt(++offset) !== "\n") { + if (offset === length) { + return null; + } + } + ++offset; + if (isDoc) { + setComment(start, offset - 1, isLeadingComment); + isLeadingComment = true; + } + ++line; + repeat3 = true; + } else { + start = offset; + isDoc = false; + if (isDoubleSlashCommentLine(offset - 1)) { + isDoc = true; + do { + offset = findEndOfLine(offset); + if (offset === length) { + break; + } + offset++; + if (!isLeadingComment) { + break; + } + } while (isDoubleSlashCommentLine(offset)); + } else { + offset = Math.min(length, findEndOfLine(offset) + 1); + } + if (isDoc) { + setComment(start, offset, isLeadingComment); + isLeadingComment = true; + } + line++; + repeat3 = true; + } + } else if ((curr = charAt(offset)) === "*") { + start = offset + 1; + isDoc = alternateCommentMode || charAt(start) === "*"; + do { + if (curr === "\n") { + ++line; + } + if (++offset === length) { + throw illegal("comment"); + } + prev = curr; + curr = charAt(offset); + } while (prev !== "*" || curr !== "/"); + ++offset; + if (isDoc) { + setComment(start, offset - 2, isLeadingComment); + isLeadingComment = true; + } + repeat3 = true; + } else { + return "/"; + } + } + } while (repeat3); + var end = offset; + delimRe.lastIndex = 0; + var delim = delimRe.test(charAt(end++)); + if (!delim) + while (end < length && !delimRe.test(charAt(end))) + ++end; + var token = source.substring(offset, offset = end); + if (token === '"' || token === "'") + stringDelim = token; + return token; + } + function push4(token) { + stack.push(token); + } + function peek() { + if (!stack.length) { + var token = next(); + if (token === null) + return null; + push4(token); + } + return stack[0]; + } + function skip(expected, optional) { + var actual = peek(), equals = actual === expected; + if (equals) { + next(); + return true; + } + if (!optional) + throw illegal("token '" + actual + "', '" + expected + "' expected"); + return false; + } + function cmnt(trailingLine) { + var ret = null; + var comment; + if (trailingLine === void 0) { + comment = comments[line - 1]; + delete comments[line - 1]; + if (comment && (alternateCommentMode || comment.type === "*" || comment.lineEmpty)) { + ret = comment.leading ? comment.text : null; + } + } else { + if (lastCommentLine < trailingLine) { + peek(); + } + comment = comments[trailingLine]; + delete comments[trailingLine]; + if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === "/")) { + ret = comment.leading ? null : comment.text; + } + } + return ret; + } + return Object.defineProperty({ + next, + peek, + push: push4, + skip, + cmnt + }, "line", { + get: function() { + return line; + } + }); + } + } +}); + +// node_modules/protobufjs/src/parse.js +var require_parse2 = __commonJS({ + "node_modules/protobufjs/src/parse.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = parse17; + parse17.filename = null; + parse17.defaults = { keepCase: false }; + var tokenize = require_tokenize(); + var Root2 = require_root2(); + var Type3 = require_type4(); + var Field = require_field(); + var MapField = require_mapfield(); + var OneOf = require_oneof(); + var Enum2 = require_enum5(); + var Service = require_service2(); + var Method = require_method(); + var ReflectionObject = require_object(); + var types3 = require_types8(); + var util2 = require_util5(); + var base10Re = /^[1-9][0-9]*$/; + var base10NegRe = /^-?[1-9][0-9]*$/; + var base16Re = /^0[x][0-9a-fA-F]+$/; + var base16NegRe = /^-?0[x][0-9a-fA-F]+$/; + var base8Re = /^0[0-7]+$/; + var base8NegRe = /^-?0[0-7]+$/; + var numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/; + var nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/; + var typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/; + function parse17(source, root2, options) { + if (!(root2 instanceof Root2)) { + options = root2; + root2 = new Root2(); + } + if (!options) + options = parse17.defaults; + var preferTrailingComment = options.preferTrailingComment || false; + var tn = tokenize(source, options.alternateCommentMode || false), next = tn.next, push4 = tn.push, peek = tn.peek, skip = tn.skip, cmnt = tn.cmnt; + var head2 = true, pkg, imports, weakImports, edition = "proto2"; + var ptr = root2; + var topLevelObjects = []; + var topLevelOptions = {}; + var applyCase = options.keepCase ? function(name2) { + return name2; + } : util2.camelCase; + function resolveFileFeatures() { + topLevelObjects.forEach((obj) => { + obj._edition = edition; + Object.keys(topLevelOptions).forEach((opt) => { + if (obj.getOption(opt) !== void 0) + return; + obj.setOption(opt, topLevelOptions[opt], true); + }); + }); + } + function illegal(token2, name2, insideTryCatch) { + var filename = parse17.filename; + if (!insideTryCatch) + parse17.filename = null; + return Error("illegal " + (name2 || "token") + " '" + token2 + "' (" + (filename ? filename + ", " : "") + "line " + tn.line + ")"); + } + function readString() { + var values2 = [], token2; + do { + if ((token2 = next()) !== '"' && token2 !== "'") + throw illegal(token2); + values2.push(next()); + skip(token2); + token2 = peek(); + } while (token2 === '"' || token2 === "'"); + return values2.join(""); + } + function readValue(acceptTypeRef) { + var token2 = next(); + switch (token2) { + case "'": + case '"': + push4(token2); + return readString(); + case "true": + case "TRUE": + return true; + case "false": + case "FALSE": + return false; + } + try { + return parseNumber( + token2, + /* insideTryCatch */ + true + ); + } catch (e10) { + if (acceptTypeRef && typeRefRe.test(token2)) + return token2; + throw illegal(token2, "value"); + } + } + function readRanges(target, acceptStrings) { + var token2, start; + do { + if (acceptStrings && ((token2 = peek()) === '"' || token2 === "'")) { + var str2 = readString(); + target.push(str2); + if (edition >= 2023) { + throw illegal(str2, "id"); + } + } else { + try { + target.push([start = parseId(next()), skip("to", true) ? parseId(next()) : start]); + } catch (err) { + if (acceptStrings && typeRefRe.test(token2) && edition >= 2023) { + target.push(token2); + } else { + throw err; + } + } + } + } while (skip(",", true)); + var dummy = { options: void 0 }; + dummy.setOption = function(name2, value2) { + if (this.options === void 0) + this.options = {}; + this.options[name2] = value2; + }; + ifBlock( + dummy, + function parseRange_block(token3) { + if (token3 === "option") { + parseOption(dummy, token3); + skip(";"); + } else + throw illegal(token3); + }, + function parseRange_line() { + parseInlineOptions(dummy); + } + ); + } + function parseNumber(token2, insideTryCatch) { + var sign = 1; + if (token2.charAt(0) === "-") { + sign = -1; + token2 = token2.substring(1); + } + switch (token2) { + case "inf": + case "INF": + case "Inf": + return sign * Infinity; + case "nan": + case "NAN": + case "Nan": + case "NaN": + return NaN; + case "0": + return 0; + } + if (base10Re.test(token2)) + return sign * parseInt(token2, 10); + if (base16Re.test(token2)) + return sign * parseInt(token2, 16); + if (base8Re.test(token2)) + return sign * parseInt(token2, 8); + if (numberRe.test(token2)) + return sign * parseFloat(token2); + throw illegal(token2, "number", insideTryCatch); + } + function parseId(token2, acceptNegative) { + switch (token2) { + case "max": + case "MAX": + case "Max": + return 536870911; + case "0": + return 0; + } + if (!acceptNegative && token2.charAt(0) === "-") + throw illegal(token2, "id"); + if (base10NegRe.test(token2)) + return parseInt(token2, 10); + if (base16NegRe.test(token2)) + return parseInt(token2, 16); + if (base8NegRe.test(token2)) + return parseInt(token2, 8); + throw illegal(token2, "id"); + } + function parsePackage() { + if (pkg !== void 0) + throw illegal("package"); + pkg = next(); + if (!typeRefRe.test(pkg)) + throw illegal(pkg, "name"); + ptr = ptr.define(pkg); + skip(";"); + } + function parseImport() { + var token2 = peek(); + var whichImports; + switch (token2) { + case "weak": + whichImports = weakImports || (weakImports = []); + next(); + break; + case "public": + next(); + default: + whichImports = imports || (imports = []); + break; + } + token2 = readString(); + skip(";"); + whichImports.push(token2); + } + function parseSyntax() { + skip("="); + edition = readString(); + if (edition < 2023) + throw illegal(edition, "syntax"); + skip(";"); + } + function parseEdition() { + skip("="); + edition = readString(); + const supportedEditions = ["2023"]; + if (!supportedEditions.includes(edition)) + throw illegal(edition, "edition"); + skip(";"); + } + function parseCommon(parent2, token2) { + switch (token2) { + case "option": + parseOption(parent2, token2); + skip(";"); + return true; + case "message": + parseType(parent2, token2); + return true; + case "enum": + parseEnum(parent2, token2); + return true; + case "service": + parseService(parent2, token2); + return true; + case "extend": + parseExtension(parent2, token2); + return true; + } + return false; + } + function ifBlock(obj, fnIf, fnElse) { + var trailingLine = tn.line; + if (obj) { + if (typeof obj.comment !== "string") { + obj.comment = cmnt(); + } + obj.filename = parse17.filename; + } + if (skip("{", true)) { + var token2; + while ((token2 = next()) !== "}") + fnIf(token2); + skip(";", true); + } else { + if (fnElse) + fnElse(); + skip(";"); + if (obj && (typeof obj.comment !== "string" || preferTrailingComment)) + obj.comment = cmnt(trailingLine) || obj.comment; + } + } + function parseType(parent2, token2) { + if (!nameRe.test(token2 = next())) + throw illegal(token2, "type name"); + var type3 = new Type3(token2); + ifBlock(type3, function parseType_block(token3) { + if (parseCommon(type3, token3)) + return; + switch (token3) { + case "map": + parseMapField(type3, token3); + break; + case "required": + if (edition !== "proto2") + throw illegal(token3); + case "repeated": + parseField(type3, token3); + break; + case "optional": + if (edition === "proto3") { + parseField(type3, "proto3_optional"); + } else if (edition !== "proto2") { + throw illegal(token3); + } else { + parseField(type3, "optional"); + } + break; + case "oneof": + parseOneOf(type3, token3); + break; + case "extensions": + readRanges(type3.extensions || (type3.extensions = [])); + break; + case "reserved": + readRanges(type3.reserved || (type3.reserved = []), true); + break; + default: + if (edition === "proto2" || !typeRefRe.test(token3)) { + throw illegal(token3); + } + push4(token3); + parseField(type3, "optional"); + break; + } + }); + parent2.add(type3); + if (parent2 === ptr) { + topLevelObjects.push(type3); + } + } + function parseField(parent2, rule, extend3) { + var type3 = next(); + if (type3 === "group") { + parseGroup(parent2, rule); + return; + } + while (type3.endsWith(".") || peek().startsWith(".")) { + type3 += next(); + } + if (!typeRefRe.test(type3)) + throw illegal(type3, "type"); + var name2 = next(); + if (!nameRe.test(name2)) + throw illegal(name2, "name"); + name2 = applyCase(name2); + skip("="); + var field = new Field(name2, parseId(next()), type3, rule, extend3); + ifBlock(field, function parseField_block(token2) { + if (token2 === "option") { + parseOption(field, token2); + skip(";"); + } else + throw illegal(token2); + }, function parseField_line() { + parseInlineOptions(field); + }); + if (rule === "proto3_optional") { + var oneof = new OneOf("_" + name2); + field.setOption("proto3_optional", true); + oneof.add(field); + parent2.add(oneof); + } else { + parent2.add(field); + } + if (parent2 === ptr) { + topLevelObjects.push(field); + } + } + function parseGroup(parent2, rule) { + if (edition >= 2023) { + throw illegal("group"); + } + var name2 = next(); + if (!nameRe.test(name2)) + throw illegal(name2, "name"); + var fieldName = util2.lcFirst(name2); + if (name2 === fieldName) + name2 = util2.ucFirst(name2); + skip("="); + var id = parseId(next()); + var type3 = new Type3(name2); + type3.group = true; + var field = new Field(fieldName, id, name2, rule); + field.filename = parse17.filename; + ifBlock(type3, function parseGroup_block(token2) { + switch (token2) { + case "option": + parseOption(type3, token2); + skip(";"); + break; + case "required": + case "repeated": + parseField(type3, token2); + break; + case "optional": + if (edition === "proto3") { + parseField(type3, "proto3_optional"); + } else { + parseField(type3, "optional"); + } + break; + case "message": + parseType(type3, token2); + break; + case "enum": + parseEnum(type3, token2); + break; + case "reserved": + readRanges(type3.reserved || (type3.reserved = []), true); + break; + default: + throw illegal(token2); + } + }); + parent2.add(type3).add(field); + } + function parseMapField(parent2) { + skip("<"); + var keyType = next(); + if (types3.mapKey[keyType] === void 0) + throw illegal(keyType, "type"); + skip(","); + var valueType = next(); + if (!typeRefRe.test(valueType)) + throw illegal(valueType, "type"); + skip(">"); + var name2 = next(); + if (!nameRe.test(name2)) + throw illegal(name2, "name"); + skip("="); + var field = new MapField(applyCase(name2), parseId(next()), keyType, valueType); + ifBlock(field, function parseMapField_block(token2) { + if (token2 === "option") { + parseOption(field, token2); + skip(";"); + } else + throw illegal(token2); + }, function parseMapField_line() { + parseInlineOptions(field); + }); + parent2.add(field); + } + function parseOneOf(parent2, token2) { + if (!nameRe.test(token2 = next())) + throw illegal(token2, "name"); + var oneof = new OneOf(applyCase(token2)); + ifBlock(oneof, function parseOneOf_block(token3) { + if (token3 === "option") { + parseOption(oneof, token3); + skip(";"); + } else { + push4(token3); + parseField(oneof, "optional"); + } + }); + parent2.add(oneof); + } + function parseEnum(parent2, token2) { + if (!nameRe.test(token2 = next())) + throw illegal(token2, "name"); + var enm = new Enum2(token2); + ifBlock(enm, function parseEnum_block(token3) { + switch (token3) { + case "option": + parseOption(enm, token3); + skip(";"); + break; + case "reserved": + readRanges(enm.reserved || (enm.reserved = []), true); + if (enm.reserved === void 0) + enm.reserved = []; + break; + default: + parseEnumValue(enm, token3); + } + }); + parent2.add(enm); + if (parent2 === ptr) { + topLevelObjects.push(enm); + } + } + function parseEnumValue(parent2, token2) { + if (!nameRe.test(token2)) + throw illegal(token2, "name"); + skip("="); + var value2 = parseId(next(), true), dummy = { + options: void 0 + }; + dummy.getOption = function(name2) { + return this.options[name2]; + }; + dummy.setOption = function(name2, value3) { + ReflectionObject.prototype.setOption.call(dummy, name2, value3); + }; + dummy.setParsedOption = function() { + return void 0; + }; + ifBlock(dummy, function parseEnumValue_block(token3) { + if (token3 === "option") { + parseOption(dummy, token3); + skip(";"); + } else + throw illegal(token3); + }, function parseEnumValue_line() { + parseInlineOptions(dummy); + }); + parent2.add(token2, value2, dummy.comment, dummy.parsedOptions || dummy.options); + } + function parseOption(parent2, token2) { + var option; + var propName2; + var isOption = true; + if (token2 === "option") { + token2 = next(); + } + while (token2 !== "=") { + if (token2 === "(") { + var parensValue = next(); + skip(")"); + token2 = "(" + parensValue + ")"; + } + if (isOption) { + isOption = false; + if (token2.includes(".") && !token2.includes("(")) { + var tokens = token2.split("."); + option = tokens[0] + "."; + token2 = tokens[1]; + continue; + } + option = token2; + } else { + propName2 = propName2 ? propName2 += token2 : token2; + } + token2 = next(); + } + var name2 = propName2 ? option.concat(propName2) : option; + var optionValue = parseOptionValue(parent2, name2); + propName2 = propName2 && propName2[0] === "." ? propName2.slice(1) : propName2; + option = option && option[option.length - 1] === "." ? option.slice(0, -1) : option; + setParsedOption(parent2, option, optionValue, propName2); + } + function parseOptionValue(parent2, name2) { + if (skip("{", true)) { + var objectResult = {}; + while (!skip("}", true)) { + if (!nameRe.test(token = next())) { + throw illegal(token, "name"); + } + if (token === null) { + throw illegal(token, "end of input"); + } + var value2; + var propName2 = token; + skip(":", true); + if (peek() === "{") { + value2 = parseOptionValue(parent2, name2 + "." + token); + } else if (peek() === "[") { + value2 = []; + var lastValue; + if (skip("[", true)) { + do { + lastValue = readValue(true); + value2.push(lastValue); + } while (skip(",", true)); + skip("]"); + if (typeof lastValue !== "undefined") { + setOption(parent2, name2 + "." + token, lastValue); + } + } + } else { + value2 = readValue(true); + setOption(parent2, name2 + "." + token, value2); + } + var prevValue = objectResult[propName2]; + if (prevValue) + value2 = [].concat(prevValue).concat(value2); + objectResult[propName2] = value2; + skip(",", true); + skip(";", true); + } + return objectResult; + } + var simpleValue = readValue(true); + setOption(parent2, name2, simpleValue); + return simpleValue; + } + function setOption(parent2, name2, value2) { + if (ptr === parent2 && /^features\./.test(name2)) { + topLevelOptions[name2] = value2; + return; + } + if (parent2.setOption) + parent2.setOption(name2, value2); + } + function setParsedOption(parent2, name2, value2, propName2) { + if (parent2.setParsedOption) + parent2.setParsedOption(name2, value2, propName2); + } + function parseInlineOptions(parent2) { + if (skip("[", true)) { + do { + parseOption(parent2, "option"); + } while (skip(",", true)); + skip("]"); + } + return parent2; + } + function parseService(parent2, token2) { + if (!nameRe.test(token2 = next())) + throw illegal(token2, "service name"); + var service = new Service(token2); + ifBlock(service, function parseService_block(token3) { + if (parseCommon(service, token3)) { + return; + } + if (token3 === "rpc") + parseMethod(service, token3); + else + throw illegal(token3); + }); + parent2.add(service); + if (parent2 === ptr) { + topLevelObjects.push(service); + } + } + function parseMethod(parent2, token2) { + var commentText = cmnt(); + var type3 = token2; + if (!nameRe.test(token2 = next())) + throw illegal(token2, "name"); + var name2 = token2, requestType, requestStream, responseType, responseStream; + skip("("); + if (skip("stream", true)) + requestStream = true; + if (!typeRefRe.test(token2 = next())) + throw illegal(token2); + requestType = token2; + skip(")"); + skip("returns"); + skip("("); + if (skip("stream", true)) + responseStream = true; + if (!typeRefRe.test(token2 = next())) + throw illegal(token2); + responseType = token2; + skip(")"); + var method2 = new Method(name2, type3, requestType, responseType, requestStream, responseStream); + method2.comment = commentText; + ifBlock(method2, function parseMethod_block(token3) { + if (token3 === "option") { + parseOption(method2, token3); + skip(";"); + } else + throw illegal(token3); + }); + parent2.add(method2); + } + function parseExtension(parent2, token2) { + if (!typeRefRe.test(token2 = next())) + throw illegal(token2, "reference"); + var reference = token2; + ifBlock(null, function parseExtension_block(token3) { + switch (token3) { + case "required": + case "repeated": + parseField(parent2, token3, reference); + break; + case "optional": + if (edition === "proto3") { + parseField(parent2, "proto3_optional", reference); + } else { + parseField(parent2, "optional", reference); + } + break; + default: + if (edition === "proto2" || !typeRefRe.test(token3)) + throw illegal(token3); + push4(token3); + parseField(parent2, "optional", reference); + break; + } + }); + } + var token; + while ((token = next()) !== null) { + switch (token) { + case "package": + if (!head2) + throw illegal(token); + parsePackage(); + break; + case "import": + if (!head2) + throw illegal(token); + parseImport(); + break; + case "syntax": + if (!head2) + throw illegal(token); + parseSyntax(); + break; + case "edition": + if (!head2) + throw illegal(token); + parseEdition(); + break; + case "option": + parseOption(ptr, token); + skip(";", true); + break; + default: + if (parseCommon(ptr, token)) { + head2 = false; + continue; + } + throw illegal(token); + } + } + resolveFileFeatures(); + parse17.filename = null; + return { + "package": pkg, + "imports": imports, + weakImports, + root: root2 + }; + } + } +}); + +// node_modules/protobufjs/src/common.js +var require_common3 = __commonJS({ + "node_modules/protobufjs/src/common.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = common3; + var commonRe = /\/|\./; + function common3(name2, json2) { + if (!commonRe.test(name2)) { + name2 = "google/protobuf/" + name2 + ".proto"; + json2 = { nested: { google: { nested: { protobuf: { nested: json2 } } } } }; + } + common3[name2] = json2; + } + common3("any", { + /** + * Properties of a google.protobuf.Any message. + * @interface IAny + * @type {Object} + * @property {string} [typeUrl] + * @property {Uint8Array} [bytes] + * @memberof common + */ + Any: { + fields: { + type_url: { + type: "string", + id: 1 + }, + value: { + type: "bytes", + id: 2 + } + } + } + }); + var timeType; + common3("duration", { + /** + * Properties of a google.protobuf.Duration message. + * @interface IDuration + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Duration: timeType = { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } + }); + common3("timestamp", { + /** + * Properties of a google.protobuf.Timestamp message. + * @interface ITimestamp + * @type {Object} + * @property {number|Long} [seconds] + * @property {number} [nanos] + * @memberof common + */ + Timestamp: timeType + }); + common3("empty", { + /** + * Properties of a google.protobuf.Empty message. + * @interface IEmpty + * @memberof common + */ + Empty: { + fields: {} + } + }); + common3("struct", { + /** + * Properties of a google.protobuf.Struct message. + * @interface IStruct + * @type {Object} + * @property {Object.} [fields] + * @memberof common + */ + Struct: { + fields: { + fields: { + keyType: "string", + type: "Value", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.Value message. + * @interface IValue + * @type {Object} + * @property {string} [kind] + * @property {0} [nullValue] + * @property {number} [numberValue] + * @property {string} [stringValue] + * @property {boolean} [boolValue] + * @property {IStruct} [structValue] + * @property {IListValue} [listValue] + * @memberof common + */ + Value: { + oneofs: { + kind: { + oneof: [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + fields: { + nullValue: { + type: "NullValue", + id: 1 + }, + numberValue: { + type: "double", + id: 2 + }, + stringValue: { + type: "string", + id: 3 + }, + boolValue: { + type: "bool", + id: 4 + }, + structValue: { + type: "Struct", + id: 5 + }, + listValue: { + type: "ListValue", + id: 6 + } + } + }, + NullValue: { + values: { + NULL_VALUE: 0 + } + }, + /** + * Properties of a google.protobuf.ListValue message. + * @interface IListValue + * @type {Object} + * @property {Array.} [values] + * @memberof common + */ + ListValue: { + fields: { + values: { + rule: "repeated", + type: "Value", + id: 1 + } + } + } + }); + common3("wrappers", { + /** + * Properties of a google.protobuf.DoubleValue message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.FloatValue message. + * @interface IFloatValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.Int64Value message. + * @interface IInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.UInt64Value message. + * @interface IUInt64Value + * @type {Object} + * @property {number|Long} [value] + * @memberof common + */ + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.Int32Value message. + * @interface IInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.UInt32Value message. + * @interface IUInt32Value + * @type {Object} + * @property {number} [value] + * @memberof common + */ + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.BoolValue message. + * @interface IBoolValue + * @type {Object} + * @property {boolean} [value] + * @memberof common + */ + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.StringValue message. + * @interface IStringValue + * @type {Object} + * @property {string} [value] + * @memberof common + */ + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + /** + * Properties of a google.protobuf.BytesValue message. + * @interface IBytesValue + * @type {Object} + * @property {Uint8Array} [value] + * @memberof common + */ + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } + }); + common3("field_mask", { + /** + * Properties of a google.protobuf.FieldMask message. + * @interface IDoubleValue + * @type {Object} + * @property {number} [value] + * @memberof common + */ + FieldMask: { + fields: { + paths: { + rule: "repeated", + type: "string", + id: 1 + } + } + } + }); + common3.get = function get4(file) { + return common3[file] || null; + }; + } +}); + +// node_modules/protobufjs/src/index.js +var require_src5 = __commonJS({ + "node_modules/protobufjs/src/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var protobuf2 = module5.exports = require_index_light(); + protobuf2.build = "full"; + protobuf2.tokenize = require_tokenize(); + protobuf2.parse = require_parse2(); + protobuf2.common = require_common3(); + protobuf2.Root._configure(protobuf2.Type, protobuf2.parse, protobuf2.common); + } +}); + +// node_modules/protobufjs/index.js +var require_protobufjs = __commonJS({ + "node_modules/protobufjs/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_src5(); + } +}); + +// node_modules/@stoplight/types/dist/index.js +var require_dist15 = __commonJS({ + "node_modules/@stoplight/types/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.HttpOperationSecurityDeclarationTypes = void 0; + (function(HttpOperationSecurityDeclarationTypes2) { + HttpOperationSecurityDeclarationTypes2["None"] = "none"; + HttpOperationSecurityDeclarationTypes2["Declared"] = "declared"; + HttpOperationSecurityDeclarationTypes2["InheritedFromService"] = "inheritedFromService"; + })(exports28.HttpOperationSecurityDeclarationTypes || (exports28.HttpOperationSecurityDeclarationTypes = {})); + exports28.HttpParamStyles = void 0; + (function(HttpParamStyles2) { + HttpParamStyles2["Unspecified"] = "unspecified"; + HttpParamStyles2["Simple"] = "simple"; + HttpParamStyles2["Matrix"] = "matrix"; + HttpParamStyles2["Label"] = "label"; + HttpParamStyles2["Form"] = "form"; + HttpParamStyles2["CommaDelimited"] = "commaDelimited"; + HttpParamStyles2["SpaceDelimited"] = "spaceDelimited"; + HttpParamStyles2["PipeDelimited"] = "pipeDelimited"; + HttpParamStyles2["DeepObject"] = "deepObject"; + HttpParamStyles2["TabDelimited"] = "tabDelimited"; + })(exports28.HttpParamStyles || (exports28.HttpParamStyles = {})); + exports28.DiagnosticSeverity = void 0; + (function(DiagnosticSeverity2) { + DiagnosticSeverity2[DiagnosticSeverity2["Error"] = 0] = "Error"; + DiagnosticSeverity2[DiagnosticSeverity2["Warning"] = 1] = "Warning"; + DiagnosticSeverity2[DiagnosticSeverity2["Information"] = 2] = "Information"; + DiagnosticSeverity2[DiagnosticSeverity2["Hint"] = 3] = "Hint"; + })(exports28.DiagnosticSeverity || (exports28.DiagnosticSeverity = {})); + exports28.NodeType = void 0; + (function(NodeType2) { + NodeType2["Article"] = "article"; + NodeType2["HttpService"] = "http_service"; + NodeType2["HttpServer"] = "http_server"; + NodeType2["HttpOperation"] = "http_operation"; + NodeType2["HttpCallback"] = "http_callback"; + NodeType2["Model"] = "model"; + NodeType2["Generic"] = "generic"; + NodeType2["Unknown"] = "unknown"; + NodeType2["TableOfContents"] = "table_of_contents"; + NodeType2["SpectralRuleset"] = "spectral_ruleset"; + NodeType2["Styleguide"] = "styleguide"; + NodeType2["Image"] = "image"; + NodeType2["StoplightResolutions"] = "stoplight_resolutions"; + NodeType2["StoplightOverride"] = "stoplight_override"; + })(exports28.NodeType || (exports28.NodeType = {})); + exports28.NodeFormat = void 0; + (function(NodeFormat2) { + NodeFormat2["Json"] = "json"; + NodeFormat2["Markdown"] = "markdown"; + NodeFormat2["Yaml"] = "yaml"; + NodeFormat2["Javascript"] = "javascript"; + NodeFormat2["Apng"] = "apng"; + NodeFormat2["Avif"] = "avif"; + NodeFormat2["Bmp"] = "bmp"; + NodeFormat2["Gif"] = "gif"; + NodeFormat2["Jpeg"] = "jpeg"; + NodeFormat2["Png"] = "png"; + NodeFormat2["Svg"] = "svg"; + NodeFormat2["Webp"] = "webp"; + })(exports28.NodeFormat || (exports28.NodeFormat = {})); + } +}); + +// node_modules/@asyncapi/parser/cjs/utils.js +var require_utils10 = __commonJS({ + "node_modules/@asyncapi/parser/cjs/utils.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.retrieveDeepData = exports28.resolveServerUrl = exports28.findSubArrayIndex = exports28.untilde = exports28.tilde = exports28.createUncaghtDiagnostic = exports28.toJSONPathArray = exports28.hasRef = exports28.isObject = exports28.mergePatch = exports28.setExtensionOnJson = exports28.setExtension = exports28.hasHintDiagnostic = exports28.hasInfoDiagnostic = exports28.hasWarningDiagnostic = exports28.hasErrorDiagnostic = exports28.normalizeInput = exports28.getSemver = exports28.createDetailedAsyncAPI = void 0; + var spectral_core_1 = require_dist11(); + var types_1 = require_dist15(); + function createDetailedAsyncAPI5(parsed, input, source) { + return { + source, + input, + parsed, + semver: getSemver4(parsed.asyncapi) + }; + } + exports28.createDetailedAsyncAPI = createDetailedAsyncAPI5; + function getSemver4(version5) { + const [major, minor, patchWithRc] = version5.split("."); + const [patch, rc] = patchWithRc.split("-rc"); + return { + version: version5, + major: Number(major), + minor: Number(minor), + patch: Number(patch), + rc: rc && Number(rc) + }; + } + exports28.getSemver = getSemver4; + function normalizeInput4(asyncapi) { + if (typeof asyncapi === "string") { + return asyncapi; + } + return JSON.stringify(asyncapi, void 0, 2); + } + exports28.normalizeInput = normalizeInput4; + function hasErrorDiagnostic4(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === types_1.DiagnosticSeverity.Error); + } + exports28.hasErrorDiagnostic = hasErrorDiagnostic4; + function hasWarningDiagnostic4(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === types_1.DiagnosticSeverity.Warning); + } + exports28.hasWarningDiagnostic = hasWarningDiagnostic4; + function hasInfoDiagnostic4(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === types_1.DiagnosticSeverity.Information); + } + exports28.hasInfoDiagnostic = hasInfoDiagnostic4; + function hasHintDiagnostic4(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === types_1.DiagnosticSeverity.Hint); + } + exports28.hasHintDiagnostic = hasHintDiagnostic4; + function setExtension4(id, value2, model) { + const modelValue = model.json(); + setExtensionOnJson3(id, value2, modelValue); + } + exports28.setExtension = setExtension4; + function setExtensionOnJson3(id, value2, model) { + if (typeof model === "object" && model) { + id = id.startsWith("x-") ? id : `x-${id}`; + model[String(id)] = value2; + } + } + exports28.setExtensionOnJson = setExtensionOnJson3; + function mergePatch4(origin, patch) { + if (!isObject8(patch)) { + return patch; + } + const result2 = !isObject8(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = mergePatch4(result2[key], patchVal); + } + }); + return result2; + } + exports28.mergePatch = mergePatch4; + function isObject8(value2) { + return Boolean(value2) && typeof value2 === "object" && Array.isArray(value2) === false; + } + exports28.isObject = isObject8; + function hasRef(value2) { + return isObject8(value2) && "$ref" in value2 && typeof value2.$ref === "string"; + } + exports28.hasRef = hasRef; + function toJSONPathArray4(jsonPath) { + return splitPath7(serializePath4(jsonPath)); + } + exports28.toJSONPathArray = toJSONPathArray4; + function createUncaghtDiagnostic4(err, message, document2) { + if (!(err instanceof Error)) { + return []; + } + const range2 = document2 ? document2.getRangeForJsonPath([]) : spectral_core_1.Document.DEFAULT_RANGE; + return [ + { + code: "uncaught-error", + message: `${message}. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: [], + severity: types_1.DiagnosticSeverity.Error, + range: range2 + } + ]; + } + exports28.createUncaghtDiagnostic = createUncaghtDiagnostic4; + function tilde4(str2) { + return str2.replace(/[~/]{1}/g, (sub) => { + switch (sub) { + case "/": + return "~1"; + case "~": + return "~0"; + } + return sub; + }); + } + exports28.tilde = tilde4; + function untilde4(str2) { + if (!str2.includes("~")) + return str2; + return str2.replace(/~[01]/g, (sub) => { + switch (sub) { + case "~1": + return "/"; + case "~0": + return "~"; + } + return sub; + }); + } + exports28.untilde = untilde4; + function findSubArrayIndex4(arr, subarr, fromIndex = 0) { + let i7, found, j6; + for (i7 = fromIndex; i7 < 1 + (arr.length - subarr.length); ++i7) { + found = true; + for (j6 = 0; j6 < subarr.length; ++j6) { + if (arr[i7 + j6] !== subarr[j6]) { + found = false; + break; + } + } + if (found) { + return i7; + } + } + return -1; + } + exports28.findSubArrayIndex = findSubArrayIndex4; + function resolveServerUrl(url) { + let [maybeProtocol, maybeHost] = url.split("://"); + if (!maybeHost) { + maybeHost = maybeProtocol; + } + const [host, ...pathnames] = maybeHost.split("/"); + if (pathnames.length) { + return { host, pathname: `/${pathnames.join("/")}` }; + } + return { host, pathname: void 0 }; + } + exports28.resolveServerUrl = resolveServerUrl; + function retrieveDeepData4(value2, path2) { + let index4 = 0; + const length = path2.length; + while (typeof value2 === "object" && value2 && index4 < length) { + value2 = value2[path2[index4++]]; + } + return index4 === length ? value2 : void 0; + } + exports28.retrieveDeepData = retrieveDeepData4; + function serializePath4(path2) { + if (path2.startsWith("#")) + return path2.substring(1); + return path2; + } + function splitPath7(path2) { + return path2.split("/").filter(Boolean).map(untilde4); + } + } +}); + +// node_modules/fs.realpath/old.js +var require_old = __commonJS({ + "node_modules/fs.realpath/old.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + var pathModule = (init_path(), __toCommonJS(path_exports)); + var isWindows3 = process.platform === "win32"; + var fs = (init_fs(), __toCommonJS(fs_exports)); + var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + function rethrow() { + var callback; + if (DEBUG) { + var backtrace = new Error(); + callback = debugCallback; + } else + callback = missingCallback; + return callback; + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; + else if (!process.noDeprecation) { + var msg = "fs: missing callback " + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } + } + function maybeCallback(cb) { + return typeof cb === "function" ? cb : rethrow(); + } + var normalize2 = pathModule.normalize; + if (isWindows3) { + nextPartRe = /(.*?)(?:[\/\\]+|$)/g; + } else { + nextPartRe = /(.*?)(?:[\/]+|$)/g; + } + var nextPartRe; + if (isWindows3) { + splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; + } else { + splitRootRe = /^[\/]*/; + } + var splitRootRe; + exports28.realpathSync = function realpathSync2(p7, cache) { + p7 = pathModule.resolve(p7); + if (cache && Object.prototype.hasOwnProperty.call(cache, p7)) { + return cache[p7]; + } + var original = p7, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m7 = splitRootRe.exec(p7); + pos = m7[0].length; + current = m7[0]; + base = m7[0]; + previous = ""; + if (isWindows3 && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + while (pos < p7.length) { + nextPartRe.lastIndex = pos; + var result2 = nextPartRe.exec(p7); + previous = current; + current += result2[0]; + base = previous + result2[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache && cache[base] === base) { + continue; + } + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + resolvedLink = cache[base]; + } else { + var stat2 = fs.lstatSync(base); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache) + cache[base] = base; + continue; + } + var linkTarget = null; + if (!isWindows3) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + if (cache) + cache[base] = resolvedLink; + if (!isWindows3) + seenLinks[id] = linkTarget; + } + p7 = pathModule.resolve(resolvedLink, p7.slice(pos)); + start(); + } + if (cache) + cache[original] = p7; + return p7; + }; + exports28.realpath = function realpath2(p7, cache, cb) { + if (typeof cb !== "function") { + cb = maybeCallback(cache); + cache = null; + } + p7 = pathModule.resolve(p7); + if (cache && Object.prototype.hasOwnProperty.call(cache, p7)) { + return process.nextTick(cb.bind(null, null, cache[p7])); + } + var original = p7, seenLinks = {}, knownHard = {}; + var pos; + var current; + var base; + var previous; + start(); + function start() { + var m7 = splitRootRe.exec(p7); + pos = m7[0].length; + current = m7[0]; + base = m7[0]; + previous = ""; + if (isWindows3 && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) + return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + function LOOP() { + if (pos >= p7.length) { + if (cache) + cache[original] = p7; + return cb(null, p7); + } + nextPartRe.lastIndex = pos; + var result2 = nextPartRe.exec(p7); + previous = current; + current += result2[0]; + base = previous + result2[1]; + pos = nextPartRe.lastIndex; + if (knownHard[base] || cache && cache[base] === base) { + return process.nextTick(LOOP); + } + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + return gotResolvedLink(cache[base]); + } + return fs.lstat(base, gotStat); + } + function gotStat(err, stat2) { + if (err) + return cb(err); + if (!stat2.isSymbolicLink()) { + knownHard[base] = true; + if (cache) + cache[base] = base; + return process.nextTick(LOOP); + } + if (!isWindows3) { + var id = stat2.dev.toString(32) + ":" + stat2.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err2) { + if (err2) + return cb(err2); + fs.readlink(base, function(err3, target) { + if (!isWindows3) + seenLinks[id] = target; + gotTarget(err3, target); + }); + }); + } + function gotTarget(err, target, base2) { + if (err) + return cb(err); + var resolvedLink = pathModule.resolve(previous, target); + if (cache) + cache[base2] = resolvedLink; + gotResolvedLink(resolvedLink); + } + function gotResolvedLink(resolvedLink) { + p7 = pathModule.resolve(resolvedLink, p7.slice(pos)); + start(); + } + }; + } +}); + +// node_modules/fs.realpath/index.js +var require_fs = __commonJS({ + "node_modules/fs.realpath/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = realpath2; + realpath2.realpath = realpath2; + realpath2.sync = realpathSync2; + realpath2.realpathSync = realpathSync2; + realpath2.monkeypatch = monkeypatch; + realpath2.unmonkeypatch = unmonkeypatch; + var fs = (init_fs(), __toCommonJS(fs_exports)); + var origRealpath = fs.realpath; + var origRealpathSync = fs.realpathSync; + var version5 = process.version; + var ok2 = /^v[0-5]\./.test(version5); + var old = require_old(); + function newError(er) { + return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG"); + } + function realpath2(p7, cache, cb) { + if (ok2) { + return origRealpath(p7, cache, cb); + } + if (typeof cache === "function") { + cb = cache; + cache = null; + } + origRealpath(p7, cache, function(er, result2) { + if (newError(er)) { + old.realpath(p7, cache, cb); + } else { + cb(er, result2); + } + }); + } + function realpathSync2(p7, cache) { + if (ok2) { + return origRealpathSync(p7, cache); + } + try { + return origRealpathSync(p7, cache); + } catch (er) { + if (newError(er)) { + return old.realpathSync(p7, cache); + } else { + throw er; + } + } + } + function monkeypatch() { + fs.realpath = realpath2; + fs.realpathSync = realpathSync2; + } + function unmonkeypatch() { + fs.realpath = origRealpath; + fs.realpathSync = origRealpathSync; + } + } +}); + +// node_modules/glob/node_modules/brace-expansion/index.js +var require_brace_expansion2 = __commonJS({ + "node_modules/glob/node_modules/brace-expansion/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var concatMap = require_concat_map(); + var balanced = require_balanced_match(); + module5.exports = expandTop; + var escSlash = "\0SLASH" + Math.random() + "\0"; + var escOpen = "\0OPEN" + Math.random() + "\0"; + var escClose = "\0CLOSE" + Math.random() + "\0"; + var escComma = "\0COMMA" + Math.random() + "\0"; + var escPeriod = "\0PERIOD" + Math.random() + "\0"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + } + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m7 = balanced("{", "}", str2); + if (!m7) + return str2.split(","); + var pre = m7.pre; + var body = m7.body; + var post = m7.post; + var p7 = pre.split(","); + p7[p7.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p7[p7.length - 1] += postParts.shift(); + p7.push.apply(p7, postParts); + } + parts.push.apply(parts, p7); + return parts; + } + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); + } + return expand(escapeBraces(str2), true).map(unescapeBraces); + } + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte2(i7, y7) { + return i7 <= y7; + } + function gte2(i7, y7) { + return i7 >= y7; + } + function expand(str2, isTop) { + var expansions = []; + var m7 = balanced("{", "}", str2); + if (!m7 || /\$$/.test(m7.pre)) + return [str2]; + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m7.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m7.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m7.body.indexOf(",") >= 0; + if (!isSequence && !isOptions) { + if (m7.post.match(/,(?!,).*\}/)) { + str2 = m7.pre + "{" + m7.body + escClose + m7.post; + return expand(str2); + } + return [str2]; + } + var n7; + if (isSequence) { + n7 = m7.body.split(/\.\./); + } else { + n7 = parseCommaParts(m7.body); + if (n7.length === 1) { + n7 = expand(n7[0], false).map(embrace); + if (n7.length === 1) { + var post = m7.post.length ? expand(m7.post, false) : [""]; + return post.map(function(p7) { + return m7.pre + n7[0] + p7; + }); + } + } + } + var pre = m7.pre; + var post = m7.post.length ? expand(m7.post, false) : [""]; + var N6; + if (isSequence) { + var x7 = numeric(n7[0]); + var y7 = numeric(n7[1]); + var width = Math.max(n7[0].length, n7[1].length); + var incr = n7.length == 3 ? Math.abs(numeric(n7[2])) : 1; + var test = lte2; + var reverse2 = y7 < x7; + if (reverse2) { + incr *= -1; + test = gte2; + } + var pad2 = n7.some(isPadded); + N6 = []; + for (var i7 = x7; test(i7, y7); i7 += incr) { + var c7; + if (isAlphaSequence) { + c7 = String.fromCharCode(i7); + if (c7 === "\\") + c7 = ""; + } else { + c7 = String(i7); + if (pad2) { + var need = width - c7.length; + if (need > 0) { + var z6 = new Array(need + 1).join("0"); + if (i7 < 0) + c7 = "-" + z6 + c7.slice(1); + else + c7 = z6 + c7; + } + } + } + N6.push(c7); + } + } else { + N6 = concatMap(n7, function(el) { + return expand(el, false); + }); + } + for (var j6 = 0; j6 < N6.length; j6++) { + for (var k6 = 0; k6 < post.length; k6++) { + var expansion = pre + N6[j6] + post[k6]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + return expansions; + } + } +}); + +// node_modules/glob/node_modules/minimatch/minimatch.js +var require_minimatch3 = __commonJS({ + "node_modules/glob/node_modules/minimatch/minimatch.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path2 = function() { + try { + return init_path(), __toCommonJS(path_exports); + } catch (e10) { + } + }() || { + sep: "/" + }; + minimatch.sep = path2.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion2(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s7) { + return s7.split("").reduce(function(set4, c7) { + set4[c7] = true; + return set4; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter2; + function filter2(pattern5, options) { + options = options || {}; + return function(p7, i7, list) { + return minimatch(p7, pattern5, options); + }; + } + function ext(a7, b8) { + b8 = b8 || {}; + var t8 = {}; + Object.keys(a7).forEach(function(k6) { + t8[k6] = a7[k6]; + }); + Object.keys(b8).forEach(function(k6) { + t8[k6] = b8[k6]; + }); + return t8; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; + } + var orig = minimatch; + var m7 = function minimatch2(p7, pattern5, options) { + return orig(p7, pattern5, ext(def, options)); + }; + m7.Minimatch = function Minimatch2(pattern5, options) { + return new orig.Minimatch(pattern5, ext(def, options)); + }; + m7.Minimatch.defaults = function defaults2(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m7.filter = function filter3(pattern5, options) { + return orig.filter(pattern5, ext(def, options)); + }; + m7.defaults = function defaults2(options) { + return orig.defaults(ext(def, options)); + }; + m7.makeRe = function makeRe2(pattern5, options) { + return orig.makeRe(pattern5, ext(def, options)); + }; + m7.braceExpand = function braceExpand2(pattern5, options) { + return orig.braceExpand(pattern5, ext(def, options)); + }; + m7.match = function(list, pattern5, options) { + return orig.match(list, pattern5, ext(def, options)); + }; + return m7; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p7, pattern5, options) { + assertValidPattern(pattern5); + if (!options) + options = {}; + if (!options.nocomment && pattern5.charAt(0) === "#") { + return false; + } + return new Minimatch(pattern5, options).match(p7); + } + function Minimatch(pattern5, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern5, options); + } + assertValidPattern(pattern5); + if (!options) + options = {}; + pattern5 = pattern5.trim(); + if (!options.allowWindowsEscape && path2.sep !== "/") { + pattern5 = pattern5.split(path2.sep).join("/"); + } + this.options = options; + this.set = []; + this.pattern = pattern5; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern5 = this.pattern; + var options = this.options; + if (!options.nocomment && pattern5.charAt(0) === "#") { + this.comment = true; + return; + } + if (!pattern5) { + this.empty = true; + return; + } + this.parseNegate(); + var set4 = this.globSet = this.braceExpand(); + if (options.debug) + this.debug = function debug2() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set4); + set4 = this.globParts = set4.map(function(s7) { + return s7.split(slashSplit); + }); + this.debug(this.pattern, set4); + set4 = set4.map(function(s7, si, set5) { + return s7.map(this.parse, this); + }, this); + this.debug(this.pattern, set4); + set4 = set4.filter(function(s7) { + return s7.indexOf(false) === -1; + }); + this.debug(this.pattern, set4); + this.set = set4; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern5 = this.pattern; + var negate2 = false; + var options = this.options; + var negateOffset = 0; + if (options.nonegate) + return; + for (var i7 = 0, l7 = pattern5.length; i7 < l7 && pattern5.charAt(i7) === "!"; i7++) { + negate2 = !negate2; + negateOffset++; + } + if (negateOffset) + this.pattern = pattern5.substr(negateOffset); + this.negate = negate2; + } + minimatch.braceExpand = function(pattern5, options) { + return braceExpand(pattern5, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern5, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern5 = typeof pattern5 === "undefined" ? this.pattern : pattern5; + assertValidPattern(pattern5); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern5)) { + return [pattern5]; + } + return expand(pattern5); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern5) { + if (typeof pattern5 !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern5.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse17; + var SUBPARSE = {}; + function parse17(pattern5, isSub) { + assertValidPattern(pattern5); + var options = this.options; + if (pattern5 === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern5 = "*"; + } + if (pattern5 === "") + return ""; + var re4 = ""; + var hasMagic = !!options.nocase; + var escaping = false; + var patternListStack = []; + var negativeLists = []; + var stateChar; + var inClass = false; + var reClassStart = -1; + var classStart = -1; + var patternStart = pattern5.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)"; + var self2 = this; + function clearStateChar() { + if (stateChar) { + switch (stateChar) { + case "*": + re4 += star; + hasMagic = true; + break; + case "?": + re4 += qmark; + hasMagic = true; + break; + default: + re4 += "\\" + stateChar; + break; + } + self2.debug("clearStateChar %j %j", stateChar, re4); + stateChar = false; + } + } + for (var i7 = 0, len = pattern5.length, c7; i7 < len && (c7 = pattern5.charAt(i7)); i7++) { + this.debug("%s %s %s %j", pattern5, i7, re4, c7); + if (escaping && reSpecials[c7]) { + re4 += "\\" + c7; + escaping = false; + continue; + } + switch (c7) { + case "/": { + return false; + } + case "\\": + clearStateChar(); + escaping = true; + continue; + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s %s %s %j <-- stateChar", pattern5, i7, re4, c7); + if (inClass) { + this.debug(" in class"); + if (c7 === "!" && i7 === classStart + 1) + c7 = "^"; + re4 += c7; + continue; + } + self2.debug("call clearStateChar %j", stateChar); + clearStateChar(); + stateChar = c7; + if (options.noext) + clearStateChar(); + continue; + case "(": + if (inClass) { + re4 += "("; + continue; + } + if (!stateChar) { + re4 += "\\("; + continue; + } + patternListStack.push({ + type: stateChar, + start: i7 - 1, + reStart: re4.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }); + re4 += stateChar === "!" ? "(?:(?!(?:" : "(?:"; + this.debug("plType %j %j", stateChar, re4); + stateChar = false; + continue; + case ")": + if (inClass || !patternListStack.length) { + re4 += "\\)"; + continue; + } + clearStateChar(); + hasMagic = true; + var pl = patternListStack.pop(); + re4 += pl.close; + if (pl.type === "!") { + negativeLists.push(pl); + } + pl.reEnd = re4.length; + continue; + case "|": + if (inClass || !patternListStack.length || escaping) { + re4 += "\\|"; + escaping = false; + continue; + } + clearStateChar(); + re4 += "|"; + continue; + case "[": + clearStateChar(); + if (inClass) { + re4 += "\\" + c7; + continue; + } + inClass = true; + classStart = i7; + reClassStart = re4.length; + re4 += c7; + continue; + case "]": + if (i7 === classStart + 1 || !inClass) { + re4 += "\\" + c7; + escaping = false; + continue; + } + var cs = pattern5.substring(classStart + 1, i7); + try { + RegExp("[" + cs + "]"); + } catch (er) { + var sp = this.parse(cs, SUBPARSE); + re4 = re4.substr(0, reClassStart) + "\\[" + sp[0] + "\\]"; + hasMagic = hasMagic || sp[1]; + inClass = false; + continue; + } + hasMagic = true; + inClass = false; + re4 += c7; + continue; + default: + clearStateChar(); + if (escaping) { + escaping = false; + } else if (reSpecials[c7] && !(c7 === "^" && inClass)) { + re4 += "\\"; + } + re4 += c7; + } + } + if (inClass) { + cs = pattern5.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re4 = re4.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; + } + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail2 = re4.slice(pl.reStart + pl.open.length); + this.debug("setting tail", re4, pl); + tail2 = tail2.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_6, $1, $22) { + if (!$22) { + $22 = "\\"; + } + return $1 + $1 + $22 + "|"; + }); + this.debug("tail=%j\n %s", tail2, tail2, pl, re4); + var t8 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re4 = re4.slice(0, pl.reStart) + t8 + "\\(" + tail2; + } + clearStateChar(); + if (escaping) { + re4 += "\\\\"; + } + var addPatternStart = false; + switch (re4.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; + } + for (var n7 = negativeLists.length - 1; n7 > -1; n7--) { + var nl = negativeLists[n7]; + var nlBefore = re4.slice(0, nl.reStart); + var nlFirst = re4.slice(nl.reStart, nl.reEnd - 8); + var nlLast = re4.slice(nl.reEnd - 8, nl.reEnd); + var nlAfter = re4.slice(nl.reEnd); + nlLast += nlAfter; + var openParensBefore = nlBefore.split("(").length - 1; + var cleanAfter = nlAfter; + for (i7 = 0; i7 < openParensBefore; i7++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ""); + } + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re4 = newRe; + } + if (re4 !== "" && hasMagic) { + re4 = "(?=.)" + re4; + } + if (addPatternStart) { + re4 = patternStart + re4; + } + if (isSub === SUBPARSE) { + return [re4, hasMagic]; + } + if (!hasMagic) { + return globUnescape(pattern5); + } + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re4 + "$", flags); + } catch (er) { + return new RegExp("$."); + } + regExp._glob = pattern5; + regExp._src = re4; + return regExp; + } + minimatch.makeRe = function(pattern5, options) { + return new Minimatch(pattern5, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) + return this.regexp; + var set4 = this.set; + if (!set4.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re4 = set4.map(function(pattern5) { + return pattern5.map(function(p7) { + return p7 === GLOBSTAR ? twoStar : typeof p7 === "string" ? regExpEscape(p7) : p7._src; + }).join("\\/"); + }).join("|"); + re4 = "^(?:" + re4 + ")$"; + if (this.negate) + re4 = "^(?!" + re4 + ").*$"; + try { + this.regexp = new RegExp(re4, flags); + } catch (ex) { + this.regexp = false; + } + return this.regexp; + } + minimatch.match = function(list, pattern5, options) { + options = options || {}; + var mm = new Minimatch(pattern5, options); + list = list.filter(function(f8) { + return mm.match(f8); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern5); + } + return list; + }; + Minimatch.prototype.match = function match(f8, partial2) { + if (typeof partial2 === "undefined") + partial2 = this.partial; + this.debug("match", f8, this.pattern); + if (this.comment) + return false; + if (this.empty) + return f8 === ""; + if (f8 === "/" && partial2) + return true; + var options = this.options; + if (path2.sep !== "/") { + f8 = f8.split(path2.sep).join("/"); + } + f8 = f8.split(slashSplit); + this.debug(this.pattern, "split", f8); + var set4 = this.set; + this.debug(this.pattern, "set", set4); + var filename; + var i7; + for (i7 = f8.length - 1; i7 >= 0; i7--) { + filename = f8[i7]; + if (filename) + break; + } + for (i7 = 0; i7 < set4.length; i7++) { + var pattern5 = set4[i7]; + var file = f8; + if (options.matchBase && pattern5.length === 1) { + file = [filename]; + } + var hit = this.matchOne(file, pattern5, partial2); + if (hit) { + if (options.flipNegate) + return true; + return !this.negate; + } + } + if (options.flipNegate) + return false; + return this.negate; + }; + Minimatch.prototype.matchOne = function(file, pattern5, partial2) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern: pattern5 } + ); + this.debug("matchOne", file.length, pattern5.length); + for (var fi = 0, pi = 0, fl = file.length, pl = pattern5.length; fi < fl && pi < pl; fi++, pi++) { + this.debug("matchOne loop"); + var p7 = pattern5[pi]; + var f8 = file[fi]; + this.debug(pattern5, p7, f8); + if (p7 === false) + return false; + if (p7 === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern5, p7, f8]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") + return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern5, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern5.slice(pr), partial2)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern5, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial2) { + this.debug("\n>>> no match, partial?", file, fr, pattern5, pr); + if (fr === fl) + return true; + } + return false; + } + var hit; + if (typeof p7 === "string") { + hit = f8 === p7; + this.debug("string match", p7, f8, hit); + } else { + hit = f8.match(p7); + this.debug("pattern match", p7, f8, hit); + } + if (!hit) + return false; + } + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial2; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; + } + throw new Error("wtf?"); + }; + function globUnescape(s7) { + return s7.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s7) { + return s7.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } + } +}); + +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + if (typeof Object.create === "function") { + module5.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + module5.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + } +}); + +// node_modules/@jspm/core/nodelibs/browser/assert.js +var assert_exports = {}; +__export(assert_exports, { + AssertionError: () => AssertionError, + deepEqual: () => deepEqual, + deepStrictEqual: () => deepStrictEqual, + default: () => exports26, + doesNotReject: () => doesNotReject, + doesNotThrow: () => doesNotThrow, + equal: () => equal, + fail: () => fail, + ifError: () => ifError, + notDeepEqual: () => notDeepEqual, + notDeepStrictEqual: () => notDeepStrictEqual, + notEqual: () => notEqual, + notStrictEqual: () => notStrictEqual, + ok: () => ok, + rejects: () => rejects, + strict: () => strict, + strictEqual: () => strictEqual, + throws: () => throws +}); +function dew$h5() { + if (_dewExec$h5) + return exports$i5; + _dewExec$h5 = true; + function _typeof3(o7) { + "@babel/helpers - typeof"; + return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o8) { + return typeof o8; + } : function(o8) { + return o8 && "function" == typeof Symbol && o8.constructor === Symbol && o8 !== Symbol.prototype ? "symbol" : typeof o8; + }, _typeof3(o7); + } + function _createClass3(Constructor, protoProps, staticProps) { + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _inherits3(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) + _setPrototypeOf3(subClass, superClass); + } + function _setPrototypeOf3(o7, p7) { + _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf4(o8, p8) { + o8.__proto__ = p8; + return o8; + }; + return _setPrototypeOf3(o7, p7); + } + function _createSuper3(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct3(); + return function _createSuperInternal() { + var Super = _getPrototypeOf3(Derived), result2; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf3(this).constructor; + result2 = Reflect.construct(Super, arguments, NewTarget); + } else { + result2 = Super.apply(this, arguments); + } + return _possibleConstructorReturn3(this, result2); + }; + } + function _possibleConstructorReturn3(self2, call) { + if (call && (_typeof3(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized3(self2); + } + function _assertThisInitialized3(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _isNativeReflectConstruct3() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e10) { + return false; + } + } + function _getPrototypeOf3(o7) { + _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf4(o8) { + return o8.__proto__ || Object.getPrototypeOf(o8); + }; + return _getPrototypeOf3(o7); + } + var codes2 = {}; + var assert4; + var util2; + function createErrorType(code, message, Base2) { + if (!Base2) { + Base2 = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + var NodeError = /* @__PURE__ */ function(_Base) { + _inherits3(NodeError2, _Base); + var _super = _createSuper3(NodeError2); + function NodeError2(arg1, arg2, arg3) { + var _this; + _classCallCheck3(this, NodeError2); + _this = _super.call(this, getMessage(arg1, arg2, arg3)); + _this.code = code; + return _this; + } + return _createClass3(NodeError2); + }(Base2); + codes2[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + var len = expected.length; + expected = expected.map(function(i7) { + return String(i7); + }); + if (len > 2) { + return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1]; + } else if (len === 2) { + return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); + } else { + return "of ".concat(thing, " ").concat(expected[0]); + } + } else { + return "of ".concat(thing, " ").concat(String(expected)); + } + } + function startsWith2(str2, search, pos) { + return str2.substr(0, search.length) === search; + } + function endsWith2(str2, search, this_len) { + if (this_len === void 0 || this_len > str2.length) { + this_len = str2.length; + } + return str2.substring(this_len - search.length, this_len) === search; + } + function includes2(str2, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str2.length) { + return false; + } else { + return str2.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_AMBIGUOUS_ARGUMENT", 'The "%s" argument is ambiguous. %s', TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) { + if (assert4 === void 0) + assert4 = dew23(); + assert4(typeof name2 === "string", "'name' must be a string"); + var determiner; + if (typeof expected === "string" && startsWith2(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + var msg; + if (endsWith2(name2, " argument")) { + msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type")); + } else { + var type3 = includes2(name2, ".") ? "property" : "argument"; + msg = 'The "'.concat(name2, '" ').concat(type3, " ").concat(determiner, " ").concat(oneOf(expected, "type")); + } + msg += ". Received type ".concat(_typeof3(actual)); + return msg; + }, TypeError); + createErrorType("ERR_INVALID_ARG_VALUE", function(name2, value2) { + var reason = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "is invalid"; + if (util2 === void 0) + util2 = exports8; + var inspected = util2.inspect(value2); + if (inspected.length > 128) { + inspected = "".concat(inspected.slice(0, 128), "..."); + } + return "The argument '".concat(name2, "' ").concat(reason, ". Received ").concat(inspected); + }, TypeError); + createErrorType("ERR_INVALID_RETURN_VALUE", function(input, name2, value2) { + var type3; + if (value2 && value2.constructor && value2.constructor.name) { + type3 = "instance of ".concat(value2.constructor.name); + } else { + type3 = "type ".concat(_typeof3(value2)); + } + return "Expected ".concat(input, ' to be returned from the "').concat(name2, '"') + " function but got ".concat(type3, "."); + }, TypeError); + createErrorType("ERR_MISSING_ARGS", function() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (assert4 === void 0) + assert4 = dew23(); + assert4(args.length > 0, "At least one arg needs to be specified"); + var msg = "The "; + var len = args.length; + args = args.map(function(a7) { + return '"'.concat(a7, '"'); + }); + switch (len) { + case 1: + msg += "".concat(args[0], " argument"); + break; + case 2: + msg += "".concat(args[0], " and ").concat(args[1], " arguments"); + break; + default: + msg += args.slice(0, len - 1).join(", "); + msg += ", and ".concat(args[len - 1], " arguments"); + break; + } + return "".concat(msg, " must be specified"); + }, TypeError); + exports$i5.codes = codes2; + return exports$i5; +} +function dew$g6() { + if (_dewExec$g6) + return exports$h5; + _dewExec$g6 = true; + var process$1 = process3; + function ownKeys2(e10, r8) { + var t8 = Object.keys(e10); + if (Object.getOwnPropertySymbols) { + var o7 = Object.getOwnPropertySymbols(e10); + r8 && (o7 = o7.filter(function(r9) { + return Object.getOwnPropertyDescriptor(e10, r9).enumerable; + })), t8.push.apply(t8, o7); + } + return t8; + } + function _objectSpread(e10) { + for (var r8 = 1; r8 < arguments.length; r8++) { + var t8 = null != arguments[r8] ? arguments[r8] : {}; + r8 % 2 ? ownKeys2(Object(t8), true).forEach(function(r9) { + _defineProperty(e10, r9, t8[r9]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e10, Object.getOwnPropertyDescriptors(t8)) : ownKeys2(Object(t8)).forEach(function(r9) { + Object.defineProperty(e10, r9, Object.getOwnPropertyDescriptor(t8, r9)); + }); + } + return e10; + } + function _defineProperty(obj, key, value2) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value2, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value2; + } + return obj; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties3(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass3(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties3(Constructor.prototype, protoProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return _typeof3(key) === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (_typeof3(input) !== "object" || input === null) + return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (_typeof3(res) !== "object") + return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _inherits3(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) + _setPrototypeOf3(subClass, superClass); + } + function _createSuper3(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct3(); + return function _createSuperInternal() { + var Super = _getPrototypeOf3(Derived), result2; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf3(this).constructor; + result2 = Reflect.construct(Super, arguments, NewTarget); + } else { + result2 = Super.apply(this, arguments); + } + return _possibleConstructorReturn3(this, result2); + }; + } + function _possibleConstructorReturn3(self2, call) { + if (call && (_typeof3(call) === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized3(self2); + } + function _assertThisInitialized3(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; + } + function _wrapNativeSuper3(Class) { + var _cache2 = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; + _wrapNativeSuper3 = function _wrapNativeSuper4(Class2) { + if (Class2 === null || !_isNativeFunction3(Class2)) + return Class2; + if (typeof Class2 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache2 !== "undefined") { + if (_cache2.has(Class2)) + return _cache2.get(Class2); + _cache2.set(Class2, Wrapper); + } + function Wrapper() { + return _construct3(Class2, arguments, _getPrototypeOf3(this).constructor); + } + Wrapper.prototype = Object.create(Class2.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf3(Wrapper, Class2); + }; + return _wrapNativeSuper3(Class); + } + function _construct3(Parent, args, Class) { + if (_isNativeReflectConstruct3()) { + _construct3 = Reflect.construct.bind(); + } else { + _construct3 = function _construct4(Parent2, args2, Class2) { + var a7 = [null]; + a7.push.apply(a7, args2); + var Constructor = Function.bind.apply(Parent2, a7); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf3(instance, Class2.prototype); + return instance; + }; + } + return _construct3.apply(null, arguments); + } + function _isNativeReflectConstruct3() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e10) { + return false; + } + } + function _isNativeFunction3(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _setPrototypeOf3(o7, p7) { + _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf4(o8, p8) { + o8.__proto__ = p8; + return o8; + }; + return _setPrototypeOf3(o7, p7); + } + function _getPrototypeOf3(o7) { + _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf4(o8) { + return o8.__proto__ || Object.getPrototypeOf(o8); + }; + return _getPrototypeOf3(o7); + } + function _typeof3(o7) { + "@babel/helpers - typeof"; + return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o8) { + return typeof o8; + } : function(o8) { + return o8 && "function" == typeof Symbol && o8.constructor === Symbol && o8 !== Symbol.prototype ? "symbol" : typeof o8; + }, _typeof3(o7); + } + var _require = exports8, inspect2 = _require.inspect; + var _require2 = dew$h5(), ERR_INVALID_ARG_TYPE2 = _require2.codes.ERR_INVALID_ARG_TYPE; + function endsWith2(str2, search, this_len) { + if (this_len === void 0 || this_len > str2.length) { + this_len = str2.length; + } + return str2.substring(this_len - search.length, this_len) === search; + } + function repeat3(str2, count2) { + count2 = Math.floor(count2); + if (str2.length == 0 || count2 == 0) + return ""; + var maxCount = str2.length * count2; + count2 = Math.floor(Math.log(count2) / Math.log(2)); + while (count2) { + str2 += str2; + count2--; + } + str2 += str2.substring(0, maxCount - str2.length); + return str2; + } + var blue = ""; + var green = ""; + var red = ""; + var white = ""; + var kReadableOperator = { + deepStrictEqual: "Expected values to be strictly deep-equal:", + strictEqual: "Expected values to be strictly equal:", + strictEqualObject: 'Expected "actual" to be reference-equal to "expected":', + deepEqual: "Expected values to be loosely deep-equal:", + equal: "Expected values to be loosely equal:", + notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:', + notStrictEqual: 'Expected "actual" to be strictly unequal to:', + notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":', + notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:', + notEqual: 'Expected "actual" to be loosely unequal to:', + notIdentical: "Values identical but not reference-equal:" + }; + var kMaxShortLength = 10; + function copyError(source) { + var keys2 = Object.keys(source); + var target = Object.create(Object.getPrototypeOf(source)); + keys2.forEach(function(key) { + target[key] = source[key]; + }); + Object.defineProperty(target, "message", { + value: source.message + }); + return target; + } + function inspectValue(val) { + return inspect2(val, { + compact: false, + customInspect: false, + depth: 1e3, + maxArrayLength: Infinity, + // Assert compares only enumerable properties (with a few exceptions). + showHidden: false, + // Having a long line as error is better than wrapping the line for + // comparison for now. + // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we + // have meta information about the inspected properties (i.e., know where + // in what line the property starts and ends). + breakLength: Infinity, + // Assert does not detect proxies currently. + showProxy: false, + sorted: true, + // Inspect getters as we also check them when comparing entries. + getters: true + }); + } + function createErrDiff(actual, expected, operator) { + var other = ""; + var res = ""; + var lastPos = 0; + var end = ""; + var skipped = false; + var actualInspected = inspectValue(actual); + var actualLines = actualInspected.split("\n"); + var expectedLines = inspectValue(expected).split("\n"); + var i7 = 0; + var indicator = ""; + if (operator === "strictEqual" && _typeof3(actual) === "object" && _typeof3(expected) === "object" && actual !== null && expected !== null) { + operator = "strictEqualObject"; + } + if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) { + var inputLength = actualLines[0].length + expectedLines[0].length; + if (inputLength <= kMaxShortLength) { + if ((_typeof3(actual) !== "object" || actual === null) && (_typeof3(expected) !== "object" || expected === null) && (actual !== 0 || expected !== 0)) { + return "".concat(kReadableOperator[operator], "\n\n") + "".concat(actualLines[0], " !== ").concat(expectedLines[0], "\n"); + } + } else if (operator !== "strictEqualObject") { + var maxLength = process$1.stderr && process$1.stderr.isTTY ? process$1.stderr.columns : 80; + if (inputLength < maxLength) { + while (actualLines[0][i7] === expectedLines[0][i7]) { + i7++; + } + if (i7 > 2) { + indicator = "\n ".concat(repeat3(" ", i7), "^"); + i7 = 0; + } + } + } + } + var a7 = actualLines[actualLines.length - 1]; + var b8 = expectedLines[expectedLines.length - 1]; + while (a7 === b8) { + if (i7++ < 2) { + end = "\n ".concat(a7).concat(end); + } else { + other = a7; + } + actualLines.pop(); + expectedLines.pop(); + if (actualLines.length === 0 || expectedLines.length === 0) + break; + a7 = actualLines[actualLines.length - 1]; + b8 = expectedLines[expectedLines.length - 1]; + } + var maxLines = Math.max(actualLines.length, expectedLines.length); + if (maxLines === 0) { + var _actualLines = actualInspected.split("\n"); + if (_actualLines.length > 30) { + _actualLines[26] = "".concat(blue, "...").concat(white); + while (_actualLines.length > 27) { + _actualLines.pop(); + } + } + return "".concat(kReadableOperator.notIdentical, "\n\n").concat(_actualLines.join("\n"), "\n"); + } + if (i7 > 3) { + end = "\n".concat(blue, "...").concat(white).concat(end); + skipped = true; + } + if (other !== "") { + end = "\n ".concat(other).concat(end); + other = ""; + } + var printedLines = 0; + var msg = kReadableOperator[operator] + "\n".concat(green, "+ actual").concat(white, " ").concat(red, "- expected").concat(white); + var skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped"); + for (i7 = 0; i7 < maxLines; i7++) { + var cur = i7 - lastPos; + if (actualLines.length < i7 + 1) { + if (cur > 1 && i7 > 2) { + if (cur > 4) { + res += "\n".concat(blue, "...").concat(white); + skipped = true; + } else if (cur > 3) { + res += "\n ".concat(expectedLines[i7 - 2]); + printedLines++; + } + res += "\n ".concat(expectedLines[i7 - 1]); + printedLines++; + } + lastPos = i7; + other += "\n".concat(red, "-").concat(white, " ").concat(expectedLines[i7]); + printedLines++; + } else if (expectedLines.length < i7 + 1) { + if (cur > 1 && i7 > 2) { + if (cur > 4) { + res += "\n".concat(blue, "...").concat(white); + skipped = true; + } else if (cur > 3) { + res += "\n ".concat(actualLines[i7 - 2]); + printedLines++; + } + res += "\n ".concat(actualLines[i7 - 1]); + printedLines++; + } + lastPos = i7; + res += "\n".concat(green, "+").concat(white, " ").concat(actualLines[i7]); + printedLines++; + } else { + var expectedLine = expectedLines[i7]; + var actualLine = actualLines[i7]; + var divergingLines = actualLine !== expectedLine && (!endsWith2(actualLine, ",") || actualLine.slice(0, -1) !== expectedLine); + if (divergingLines && endsWith2(expectedLine, ",") && expectedLine.slice(0, -1) === actualLine) { + divergingLines = false; + actualLine += ","; + } + if (divergingLines) { + if (cur > 1 && i7 > 2) { + if (cur > 4) { + res += "\n".concat(blue, "...").concat(white); + skipped = true; + } else if (cur > 3) { + res += "\n ".concat(actualLines[i7 - 2]); + printedLines++; + } + res += "\n ".concat(actualLines[i7 - 1]); + printedLines++; + } + lastPos = i7; + res += "\n".concat(green, "+").concat(white, " ").concat(actualLine); + other += "\n".concat(red, "-").concat(white, " ").concat(expectedLine); + printedLines += 2; + } else { + res += other; + other = ""; + if (cur === 1 || i7 === 0) { + res += "\n ".concat(actualLine); + printedLines++; + } + } + } + if (printedLines > 20 && i7 < maxLines - 2) { + return "".concat(msg).concat(skippedMsg, "\n").concat(res, "\n").concat(blue, "...").concat(white).concat(other, "\n") + "".concat(blue, "...").concat(white); + } + } + return "".concat(msg).concat(skipped ? skippedMsg : "", "\n").concat(res).concat(other).concat(end).concat(indicator); + } + var AssertionError2 = /* @__PURE__ */ function(_Error, _inspect$custom) { + _inherits3(AssertionError3, _Error); + var _super = _createSuper3(AssertionError3); + function AssertionError3(options) { + var _this; + _classCallCheck3(this, AssertionError3); + if (_typeof3(options) !== "object" || options === null) { + throw new ERR_INVALID_ARG_TYPE2("options", "Object", options); + } + var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn; + var actual = options.actual, expected = options.expected; + var limit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + if (message != null) { + _this = _super.call(this, String(message)); + } else { + if (process$1.stderr && process$1.stderr.isTTY) { + if (process$1.stderr && process$1.stderr.getColorDepth && process$1.stderr.getColorDepth() !== 1) { + blue = "\x1B[34m"; + green = "\x1B[32m"; + white = "\x1B[39m"; + red = "\x1B[31m"; + } else { + blue = ""; + green = ""; + white = ""; + red = ""; + } + } + if (_typeof3(actual) === "object" && actual !== null && _typeof3(expected) === "object" && expected !== null && "stack" in actual && actual instanceof Error && "stack" in expected && expected instanceof Error) { + actual = copyError(actual); + expected = copyError(expected); + } + if (operator === "deepStrictEqual" || operator === "strictEqual") { + _this = _super.call(this, createErrDiff(actual, expected, operator)); + } else if (operator === "notDeepStrictEqual" || operator === "notStrictEqual") { + var base = kReadableOperator[operator]; + var res = inspectValue(actual).split("\n"); + if (operator === "notStrictEqual" && _typeof3(actual) === "object" && actual !== null) { + base = kReadableOperator.notStrictEqualObject; + } + if (res.length > 30) { + res[26] = "".concat(blue, "...").concat(white); + while (res.length > 27) { + res.pop(); + } + } + if (res.length === 1) { + _this = _super.call(this, "".concat(base, " ").concat(res[0])); + } else { + _this = _super.call(this, "".concat(base, "\n\n").concat(res.join("\n"), "\n")); + } + } else { + var _res = inspectValue(actual); + var other = ""; + var knownOperators = kReadableOperator[operator]; + if (operator === "notDeepEqual" || operator === "notEqual") { + _res = "".concat(kReadableOperator[operator], "\n\n").concat(_res); + if (_res.length > 1024) { + _res = "".concat(_res.slice(0, 1021), "..."); + } + } else { + other = "".concat(inspectValue(expected)); + if (_res.length > 512) { + _res = "".concat(_res.slice(0, 509), "..."); + } + if (other.length > 512) { + other = "".concat(other.slice(0, 509), "..."); + } + if (operator === "deepEqual" || operator === "equal") { + _res = "".concat(knownOperators, "\n\n").concat(_res, "\n\nshould equal\n\n"); + } else { + other = " ".concat(operator, " ").concat(other); + } + } + _this = _super.call(this, "".concat(_res).concat(other)); + } + } + Error.stackTraceLimit = limit; + _this.generatedMessage = !message; + Object.defineProperty(_assertThisInitialized3(_this), "name", { + value: "AssertionError [ERR_ASSERTION]", + enumerable: false, + writable: true, + configurable: true + }); + _this.code = "ERR_ASSERTION"; + _this.actual = actual; + _this.expected = expected; + _this.operator = operator; + if (Error.captureStackTrace) { + Error.captureStackTrace(_assertThisInitialized3(_this), stackStartFn); + } + _this.stack; + _this.name = "AssertionError"; + return _possibleConstructorReturn3(_this); + } + _createClass3(AssertionError3, [{ + key: "toString", + value: function toString3() { + return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message); + } + }, { + key: _inspect$custom, + value: function value2(recurseTimes, ctx) { + return inspect2(this, _objectSpread(_objectSpread({}, ctx), {}, { + customInspect: false, + depth: 0 + })); + } + }]); + return AssertionError3; + }(/* @__PURE__ */ _wrapNativeSuper3(Error), inspect2.custom); + exports$h5 = AssertionError2; + return exports$h5; +} +function dew$f6() { + if (_dewExec$f6) + return exports$g6; + _dewExec$f6 = true; + var toStr = Object.prototype.toString; + exports$g6 = function isArguments2(value2) { + var str2 = toStr.call(value2); + var isArgs = str2 === "[object Arguments]"; + if (!isArgs) { + isArgs = str2 !== "[object Array]" && value2 !== null && typeof value2 === "object" && typeof value2.length === "number" && value2.length >= 0 && toStr.call(value2.callee) === "[object Function]"; + } + return isArgs; + }; + return exports$g6; +} +function dew$e6() { + if (_dewExec$e6) + return exports$f6; + _dewExec$e6 = true; + var keysShim; + if (!Object.keys) { + var has2 = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = dew$f6(); + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ + toString: null + }, "toString"); + var hasProtoEnumBug = isEnumerable.call(function() { + }, "prototype"); + var dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]; + var equalsConstructorPrototype = function(o7) { + var ctor = o7.constructor; + return ctor && ctor.prototype === o7; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = function() { + if (typeof window === "undefined") { + return false; + } + for (var k6 in window) { + try { + if (!excludedKeys["$" + k6] && has2.call(window, k6) && window[k6] !== null && typeof window[k6] === "object") { + try { + equalsConstructorPrototype(window[k6]); + } catch (e10) { + return true; + } + } + } catch (e10) { + return true; + } + } + return false; + }(); + var equalsConstructorPrototypeIfNotBuggy = function(o7) { + if (typeof window === "undefined" || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o7); + } + try { + return equalsConstructorPrototype(o7); + } catch (e10) { + return false; + } + }; + keysShim = function keys2(object) { + var isObject8 = object !== null && typeof object === "object"; + var isFunction3 = toStr.call(object) === "[object Function]"; + var isArguments2 = isArgs(object); + var isString4 = isObject8 && toStr.call(object) === "[object String]"; + var theKeys = []; + if (!isObject8 && !isFunction3 && !isArguments2) { + throw new TypeError("Object.keys called on a non-object"); + } + var skipProto = hasProtoEnumBug && isFunction3; + if (isString4 && object.length > 0 && !has2.call(object, 0)) { + for (var i7 = 0; i7 < object.length; ++i7) { + theKeys.push(String(i7)); + } + } + if (isArguments2 && object.length > 0) { + for (var j6 = 0; j6 < object.length; ++j6) { + theKeys.push(String(j6)); + } + } else { + for (var name2 in object) { + if (!(skipProto && name2 === "prototype") && has2.call(object, name2)) { + theKeys.push(String(name2)); + } + } + } + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + for (var k6 = 0; k6 < dontEnums.length; ++k6) { + if (!(skipConstructor && dontEnums[k6] === "constructor") && has2.call(object, dontEnums[k6])) { + theKeys.push(dontEnums[k6]); + } + } + } + return theKeys; + }; + } + exports$f6 = keysShim; + return exports$f6; +} +function dew$d6() { + if (_dewExec$d6) + return exports$e6; + _dewExec$d6 = true; + var slice2 = Array.prototype.slice; + var isArgs = dew$f6(); + var origKeys = Object.keys; + var keysShim = origKeys ? function keys2(o7) { + return origKeys(o7); + } : dew$e6(); + var originalKeys = Object.keys; + keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = function() { + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2); + if (!keysWorksWithArguments) { + Object.keys = function keys2(object) { + if (isArgs(object)) { + return originalKeys(slice2.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; + }; + exports$e6 = keysShim; + return exports$e6; +} +function dew$c7() { + if (_dewExec$c7) + return exports$d7; + _dewExec$c7 = true; + var objectKeys = dew$d6(); + var hasSymbols = dew$k()(); + var callBound = dew3(); + var toObject = Object; + var $push = callBound("Array.prototype.push"); + var $propIsEnumerable = callBound("Object.prototype.propertyIsEnumerable"); + var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; + exports$d7 = function assign3(target, source1) { + if (target == null) { + throw new TypeError("target must be an object"); + } + var to = toObject(target); + if (arguments.length === 1) { + return to; + } + for (var s7 = 1; s7 < arguments.length; ++s7) { + var from = toObject(arguments[s7]); + var keys2 = objectKeys(from); + var getSymbols2 = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); + if (getSymbols2) { + var syms = getSymbols2(from); + for (var j6 = 0; j6 < syms.length; ++j6) { + var key = syms[j6]; + if ($propIsEnumerable(from, key)) { + $push(keys2, key); + } + } + } + for (var i7 = 0; i7 < keys2.length; ++i7) { + var nextKey = keys2[i7]; + if ($propIsEnumerable(from, nextKey)) { + var propValue = from[nextKey]; + to[nextKey] = propValue; + } + } + } + return to; + }; + return exports$d7; +} +function dew$b8() { + if (_dewExec$b8) + return exports$c8; + _dewExec$b8 = true; + var implementation = dew$c7(); + var lacksProperEnumerationOrder = function() { + if (!Object.assign) { + return false; + } + var str2 = "abcdefghijklmnopqrst"; + var letters = str2.split(""); + var map4 = {}; + for (var i7 = 0; i7 < letters.length; ++i7) { + map4[letters[i7]] = letters[i7]; + } + var obj = Object.assign({}, map4); + var actual = ""; + for (var k6 in obj) { + actual += k6; + } + return str2 !== actual; + }; + var assignHasPendingExceptions = function() { + if (!Object.assign || !Object.preventExtensions) { + return false; + } + var thrower = Object.preventExtensions({ + 1: 2 + }); + try { + Object.assign(thrower, "xy"); + } catch (e10) { + return thrower[1] === "y"; + } + return false; + }; + exports$c8 = function getPolyfill() { + if (!Object.assign) { + return implementation; + } + if (lacksProperEnumerationOrder()) { + return implementation; + } + if (assignHasPendingExceptions()) { + return implementation; + } + return Object.assign; + }; + return exports$c8; +} +function dew$a8() { + if (_dewExec$a8) + return exports$b8; + _dewExec$a8 = true; + var numberIsNaN = function(value2) { + return value2 !== value2; + }; + exports$b8 = function is(a7, b8) { + if (a7 === 0 && b8 === 0) { + return 1 / a7 === 1 / b8; + } + if (a7 === b8) { + return true; + } + if (numberIsNaN(a7) && numberIsNaN(b8)) { + return true; + } + return false; + }; + return exports$b8; +} +function dew$98() { + if (_dewExec$98) + return exports$a8; + _dewExec$98 = true; + var implementation = dew$a8(); + exports$a8 = function getPolyfill() { + return typeof Object.is === "function" ? Object.is : implementation; + }; + return exports$a8; +} +function dew$88() { + if (_dewExec$88) + return exports$98; + _dewExec$88 = true; + var keys2 = dew$d6(); + var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol"; + var toStr = Object.prototype.toString; + var concat2 = Array.prototype.concat; + var defineDataProperty = dew$4(); + var isFunction3 = function(fn) { + return typeof fn === "function" && toStr.call(fn) === "[object Function]"; + }; + var supportsDescriptors = dew$3()(); + var defineProperty2 = function(object, name2, value2, predicate) { + if (name2 in object) { + if (predicate === true) { + if (object[name2] === value2) { + return; + } + } else if (!isFunction3(predicate) || !predicate()) { + return; + } + } + if (supportsDescriptors) { + defineDataProperty(object, name2, value2, true); + } else { + defineDataProperty(object, name2, value2); + } + }; + var defineProperties = function(object, map4) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys2(map4); + if (hasSymbols) { + props = concat2.call(props, Object.getOwnPropertySymbols(map4)); + } + for (var i7 = 0; i7 < props.length; i7 += 1) { + defineProperty2(object, props[i7], map4[props[i7]], predicates[props[i7]]); + } + }; + defineProperties.supportsDescriptors = !!supportsDescriptors; + exports$98 = defineProperties; + return exports$98; +} +function dew$79() { + if (_dewExec$79) + return exports$89; + _dewExec$79 = true; + var getPolyfill = dew$98(); + var define2 = dew$88(); + exports$89 = function shimObjectIs() { + var polyfill = getPolyfill(); + define2(Object, { + is: polyfill + }, { + is: function testObjectIs() { + return Object.is !== polyfill; + } + }); + return polyfill; + }; + return exports$89; +} +function dew$610() { + if (_dewExec$610) + return exports$710; + _dewExec$610 = true; + var define2 = dew$88(); + var callBind = dew$12(); + var implementation = dew$a8(); + var getPolyfill = dew$98(); + var shim = dew$79(); + var polyfill = callBind(getPolyfill(), Object); + define2(polyfill, { + getPolyfill, + implementation, + shim + }); + exports$710 = polyfill; + return exports$710; +} +function dew$510() { + if (_dewExec$510) + return exports$610; + _dewExec$510 = true; + exports$610 = function isNaN3(value2) { + return value2 !== value2; + }; + return exports$610; +} +function dew$410() { + if (_dewExec$410) + return exports$510; + _dewExec$410 = true; + var implementation = dew$510(); + exports$510 = function getPolyfill() { + if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a")) { + return Number.isNaN; + } + return implementation; + }; + return exports$510; +} +function dew$315() { + if (_dewExec$315) + return exports$410; + _dewExec$315 = true; + var define2 = dew$88(); + var getPolyfill = dew$410(); + exports$410 = function shimNumberIsNaN() { + var polyfill = getPolyfill(); + define2(Number, { + isNaN: polyfill + }, { + isNaN: function testIsNaN() { + return Number.isNaN !== polyfill; + } + }); + return polyfill; + }; + return exports$410; +} +function dew$215() { + if (_dewExec$215) + return exports$315; + _dewExec$215 = true; + var callBind = dew$12(); + var define2 = dew$88(); + var implementation = dew$510(); + var getPolyfill = dew$410(); + var shim = dew$315(); + var polyfill = callBind(getPolyfill(), Number); + define2(polyfill, { + getPolyfill, + implementation, + shim + }); + exports$315 = polyfill; + return exports$315; +} +function dew$116() { + if (_dewExec$116) + return exports$216; + _dewExec$116 = true; + function _slicedToArray(arr, i7) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i7) || _unsupportedIterableToArray3(arr, i7) || _nonIterableRest(); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _unsupportedIterableToArray3(o7, minLen) { + if (!o7) + return; + if (typeof o7 === "string") + return _arrayLikeToArray3(o7, minLen); + var n7 = Object.prototype.toString.call(o7).slice(8, -1); + if (n7 === "Object" && o7.constructor) + n7 = o7.constructor.name; + if (n7 === "Map" || n7 === "Set") + return Array.from(o7); + if (n7 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n7)) + return _arrayLikeToArray3(o7, minLen); + } + function _arrayLikeToArray3(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i7 = 0, arr2 = new Array(len); i7 < len; i7++) + arr2[i7] = arr[i7]; + return arr2; + } + function _iterableToArrayLimit(r8, l7) { + var t8 = null == r8 ? null : "undefined" != typeof Symbol && r8[Symbol.iterator] || r8["@@iterator"]; + if (null != t8) { + var e10, n7, i7, u7, a7 = [], f8 = true, o7 = false; + try { + if (i7 = (t8 = t8.call(r8)).next, 0 === l7) + ; + else + for (; !(f8 = (e10 = i7.call(t8)).done) && (a7.push(e10.value), a7.length !== l7); f8 = true) + ; + } catch (r9) { + o7 = true, n7 = r9; + } finally { + try { + if (!f8 && null != t8.return && (u7 = t8.return(), Object(u7) !== u7)) + return; + } finally { + if (o7) + throw n7; + } + } + return a7; + } + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) + return arr; + } + function _typeof3(o7) { + "@babel/helpers - typeof"; + return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o8) { + return typeof o8; + } : function(o8) { + return o8 && "function" == typeof Symbol && o8.constructor === Symbol && o8 !== Symbol.prototype ? "symbol" : typeof o8; + }, _typeof3(o7); + } + var regexFlagsSupported = /a/g.flags !== void 0; + var arrayFromSet = function arrayFromSet2(set4) { + var array = []; + set4.forEach(function(value2) { + return array.push(value2); + }); + return array; + }; + var arrayFromMap = function arrayFromMap2(map4) { + var array = []; + map4.forEach(function(value2, key) { + return array.push([key, value2]); + }); + return array; + }; + var objectIs = Object.is ? Object.is : dew$610(); + var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() { + return []; + }; + var numberIsNaN = Number.isNaN ? Number.isNaN : dew$215(); + function uncurryThis(f8) { + return f8.call.bind(f8); + } + var hasOwnProperty27 = uncurryThis(Object.prototype.hasOwnProperty); + var propertyIsEnumerable3 = uncurryThis(Object.prototype.propertyIsEnumerable); + var objectToString2 = uncurryThis(Object.prototype.toString); + var _require$types = exports8.types, isAnyArrayBuffer = _require$types.isAnyArrayBuffer, isArrayBufferView = _require$types.isArrayBufferView, isDate3 = _require$types.isDate, isMap3 = _require$types.isMap, isRegExp3 = _require$types.isRegExp, isSet2 = _require$types.isSet, isNativeError = _require$types.isNativeError, isBoxedPrimitive = _require$types.isBoxedPrimitive, isNumberObject = _require$types.isNumberObject, isStringObject = _require$types.isStringObject, isBooleanObject = _require$types.isBooleanObject, isBigIntObject = _require$types.isBigIntObject, isSymbolObject = _require$types.isSymbolObject, isFloat32Array = _require$types.isFloat32Array, isFloat64Array = _require$types.isFloat64Array; + function isNonIndex(key) { + if (key.length === 0 || key.length > 10) + return true; + for (var i7 = 0; i7 < key.length; i7++) { + var code = key.charCodeAt(i7); + if (code < 48 || code > 57) + return true; + } + return key.length === 10 && key >= Math.pow(2, 32); + } + function getOwnNonIndexProperties(value2) { + return Object.keys(value2).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value2).filter(Object.prototype.propertyIsEnumerable.bind(value2))); + } + function compare(a7, b8) { + if (a7 === b8) { + return 0; + } + var x7 = a7.length; + var y7 = b8.length; + for (var i7 = 0, len = Math.min(x7, y7); i7 < len; ++i7) { + if (a7[i7] !== b8[i7]) { + x7 = a7[i7]; + y7 = b8[i7]; + break; + } + } + if (x7 < y7) { + return -1; + } + if (y7 < x7) { + return 1; + } + return 0; + } + var kStrict = true; + var kLoose = false; + var kNoIterator = 0; + var kIsArray = 1; + var kIsSet = 2; + var kIsMap = 3; + function areSimilarRegExps(a7, b8) { + return regexFlagsSupported ? a7.source === b8.source && a7.flags === b8.flags : RegExp.prototype.toString.call(a7) === RegExp.prototype.toString.call(b8); + } + function areSimilarFloatArrays(a7, b8) { + if (a7.byteLength !== b8.byteLength) { + return false; + } + for (var offset = 0; offset < a7.byteLength; offset++) { + if (a7[offset] !== b8[offset]) { + return false; + } + } + return true; + } + function areSimilarTypedArrays(a7, b8) { + if (a7.byteLength !== b8.byteLength) { + return false; + } + return compare(new Uint8Array(a7.buffer, a7.byteOffset, a7.byteLength), new Uint8Array(b8.buffer, b8.byteOffset, b8.byteLength)) === 0; + } + function areEqualArrayBuffers(buf1, buf2) { + return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0; + } + function isEqualBoxedPrimitive(val1, val2) { + if (isNumberObject(val1)) { + return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2)); + } + if (isStringObject(val1)) { + return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2); + } + if (isBooleanObject(val1)) { + return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2); + } + if (isBigIntObject(val1)) { + return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2); + } + return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2); + } + function innerDeepEqual(val1, val2, strict2, memos) { + if (val1 === val2) { + if (val1 !== 0) + return true; + return strict2 ? objectIs(val1, val2) : true; + } + if (strict2) { + if (_typeof3(val1) !== "object") { + return typeof val1 === "number" && numberIsNaN(val1) && numberIsNaN(val2); + } + if (_typeof3(val2) !== "object" || val1 === null || val2 === null) { + return false; + } + if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) { + return false; + } + } else { + if (val1 === null || _typeof3(val1) !== "object") { + if (val2 === null || _typeof3(val2) !== "object") { + return val1 == val2; + } + return false; + } + if (val2 === null || _typeof3(val2) !== "object") { + return false; + } + } + var val1Tag = objectToString2(val1); + var val2Tag = objectToString2(val2); + if (val1Tag !== val2Tag) { + return false; + } + if (Array.isArray(val1)) { + if (val1.length !== val2.length) { + return false; + } + var keys1 = getOwnNonIndexProperties(val1); + var keys2 = getOwnNonIndexProperties(val2); + if (keys1.length !== keys2.length) { + return false; + } + return keyCheck(val1, val2, strict2, memos, kIsArray, keys1); + } + if (val1Tag === "[object Object]") { + if (!isMap3(val1) && isMap3(val2) || !isSet2(val1) && isSet2(val2)) { + return false; + } + } + if (isDate3(val1)) { + if (!isDate3(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) { + return false; + } + } else if (isRegExp3(val1)) { + if (!isRegExp3(val2) || !areSimilarRegExps(val1, val2)) { + return false; + } + } else if (isNativeError(val1) || val1 instanceof Error) { + if (val1.message !== val2.message || val1.name !== val2.name) { + return false; + } + } else if (isArrayBufferView(val1)) { + if (!strict2 && (isFloat32Array(val1) || isFloat64Array(val1))) { + if (!areSimilarFloatArrays(val1, val2)) { + return false; + } + } else if (!areSimilarTypedArrays(val1, val2)) { + return false; + } + var _keys = getOwnNonIndexProperties(val1); + var _keys2 = getOwnNonIndexProperties(val2); + if (_keys.length !== _keys2.length) { + return false; + } + return keyCheck(val1, val2, strict2, memos, kNoIterator, _keys); + } else if (isSet2(val1)) { + if (!isSet2(val2) || val1.size !== val2.size) { + return false; + } + return keyCheck(val1, val2, strict2, memos, kIsSet); + } else if (isMap3(val1)) { + if (!isMap3(val2) || val1.size !== val2.size) { + return false; + } + return keyCheck(val1, val2, strict2, memos, kIsMap); + } else if (isAnyArrayBuffer(val1)) { + if (!areEqualArrayBuffers(val1, val2)) { + return false; + } + } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) { + return false; + } + return keyCheck(val1, val2, strict2, memos, kNoIterator); + } + function getEnumerables(val, keys2) { + return keys2.filter(function(k6) { + return propertyIsEnumerable3(val, k6); + }); + } + function keyCheck(val1, val2, strict2, memos, iterationType, aKeys) { + if (arguments.length === 5) { + aKeys = Object.keys(val1); + var bKeys = Object.keys(val2); + if (aKeys.length !== bKeys.length) { + return false; + } + } + var i7 = 0; + for (; i7 < aKeys.length; i7++) { + if (!hasOwnProperty27(val2, aKeys[i7])) { + return false; + } + } + if (strict2 && arguments.length === 5) { + var symbolKeysA = objectGetOwnPropertySymbols(val1); + if (symbolKeysA.length !== 0) { + var count2 = 0; + for (i7 = 0; i7 < symbolKeysA.length; i7++) { + var key = symbolKeysA[i7]; + if (propertyIsEnumerable3(val1, key)) { + if (!propertyIsEnumerable3(val2, key)) { + return false; + } + aKeys.push(key); + count2++; + } else if (propertyIsEnumerable3(val2, key)) { + return false; + } + } + var symbolKeysB = objectGetOwnPropertySymbols(val2); + if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count2) { + return false; + } + } else { + var _symbolKeysB = objectGetOwnPropertySymbols(val2); + if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) { + return false; + } + } + } + if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) { + return true; + } + if (memos === void 0) { + memos = { + val1: /* @__PURE__ */ new Map(), + val2: /* @__PURE__ */ new Map(), + position: 0 + }; + } else { + var val2MemoA = memos.val1.get(val1); + if (val2MemoA !== void 0) { + var val2MemoB = memos.val2.get(val2); + if (val2MemoB !== void 0) { + return val2MemoA === val2MemoB; + } + } + memos.position++; + } + memos.val1.set(val1, memos.position); + memos.val2.set(val2, memos.position); + var areEq = objEquiv(val1, val2, strict2, aKeys, memos, iterationType); + memos.val1.delete(val1); + memos.val2.delete(val2); + return areEq; + } + function setHasEqualElement(set4, val1, strict2, memo) { + var setValues = arrayFromSet(set4); + for (var i7 = 0; i7 < setValues.length; i7++) { + var val2 = setValues[i7]; + if (innerDeepEqual(val1, val2, strict2, memo)) { + set4.delete(val2); + return true; + } + } + return false; + } + function findLooseMatchingPrimitives(prim) { + switch (_typeof3(prim)) { + case "undefined": + return null; + case "object": + return void 0; + case "symbol": + return false; + case "string": + prim = +prim; + case "number": + if (numberIsNaN(prim)) { + return false; + } + } + return true; + } + function setMightHaveLoosePrim(a7, b8, prim) { + var altValue = findLooseMatchingPrimitives(prim); + if (altValue != null) + return altValue; + return b8.has(altValue) && !a7.has(altValue); + } + function mapMightHaveLoosePrim(a7, b8, prim, item, memo) { + var altValue = findLooseMatchingPrimitives(prim); + if (altValue != null) { + return altValue; + } + var curB = b8.get(altValue); + if (curB === void 0 && !b8.has(altValue) || !innerDeepEqual(item, curB, false, memo)) { + return false; + } + return !a7.has(altValue) && innerDeepEqual(item, curB, false, memo); + } + function setEquiv(a7, b8, strict2, memo) { + var set4 = null; + var aValues = arrayFromSet(a7); + for (var i7 = 0; i7 < aValues.length; i7++) { + var val = aValues[i7]; + if (_typeof3(val) === "object" && val !== null) { + if (set4 === null) { + set4 = /* @__PURE__ */ new Set(); + } + set4.add(val); + } else if (!b8.has(val)) { + if (strict2) + return false; + if (!setMightHaveLoosePrim(a7, b8, val)) { + return false; + } + if (set4 === null) { + set4 = /* @__PURE__ */ new Set(); + } + set4.add(val); + } + } + if (set4 !== null) { + var bValues = arrayFromSet(b8); + for (var _i = 0; _i < bValues.length; _i++) { + var _val = bValues[_i]; + if (_typeof3(_val) === "object" && _val !== null) { + if (!setHasEqualElement(set4, _val, strict2, memo)) + return false; + } else if (!strict2 && !a7.has(_val) && !setHasEqualElement(set4, _val, strict2, memo)) { + return false; + } + } + return set4.size === 0; + } + return true; + } + function mapHasEqualEntry(set4, map4, key1, item1, strict2, memo) { + var setValues = arrayFromSet(set4); + for (var i7 = 0; i7 < setValues.length; i7++) { + var key2 = setValues[i7]; + if (innerDeepEqual(key1, key2, strict2, memo) && innerDeepEqual(item1, map4.get(key2), strict2, memo)) { + set4.delete(key2); + return true; + } + } + return false; + } + function mapEquiv(a7, b8, strict2, memo) { + var set4 = null; + var aEntries = arrayFromMap(a7); + for (var i7 = 0; i7 < aEntries.length; i7++) { + var _aEntries$i = _slicedToArray(aEntries[i7], 2), key = _aEntries$i[0], item1 = _aEntries$i[1]; + if (_typeof3(key) === "object" && key !== null) { + if (set4 === null) { + set4 = /* @__PURE__ */ new Set(); + } + set4.add(key); + } else { + var item2 = b8.get(key); + if (item2 === void 0 && !b8.has(key) || !innerDeepEqual(item1, item2, strict2, memo)) { + if (strict2) + return false; + if (!mapMightHaveLoosePrim(a7, b8, key, item1, memo)) + return false; + if (set4 === null) { + set4 = /* @__PURE__ */ new Set(); + } + set4.add(key); + } + } + } + if (set4 !== null) { + var bEntries = arrayFromMap(b8); + for (var _i2 = 0; _i2 < bEntries.length; _i2++) { + var _bEntries$_i = _slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1]; + if (_typeof3(_key) === "object" && _key !== null) { + if (!mapHasEqualEntry(set4, a7, _key, item, strict2, memo)) + return false; + } else if (!strict2 && (!a7.has(_key) || !innerDeepEqual(a7.get(_key), item, false, memo)) && !mapHasEqualEntry(set4, a7, _key, item, false, memo)) { + return false; + } + } + return set4.size === 0; + } + return true; + } + function objEquiv(a7, b8, strict2, keys2, memos, iterationType) { + var i7 = 0; + if (iterationType === kIsSet) { + if (!setEquiv(a7, b8, strict2, memos)) { + return false; + } + } else if (iterationType === kIsMap) { + if (!mapEquiv(a7, b8, strict2, memos)) { + return false; + } + } else if (iterationType === kIsArray) { + for (; i7 < a7.length; i7++) { + if (hasOwnProperty27(a7, i7)) { + if (!hasOwnProperty27(b8, i7) || !innerDeepEqual(a7[i7], b8[i7], strict2, memos)) { + return false; + } + } else if (hasOwnProperty27(b8, i7)) { + return false; + } else { + var keysA = Object.keys(a7); + for (; i7 < keysA.length; i7++) { + var key = keysA[i7]; + if (!hasOwnProperty27(b8, key) || !innerDeepEqual(a7[key], b8[key], strict2, memos)) { + return false; + } + } + if (keysA.length !== Object.keys(b8).length) { + return false; + } + return true; + } + } + } + for (i7 = 0; i7 < keys2.length; i7++) { + var _key2 = keys2[i7]; + if (!innerDeepEqual(a7[_key2], b8[_key2], strict2, memos)) { + return false; + } + } + return true; + } + function isDeepEqual(val1, val2) { + return innerDeepEqual(val1, val2, kLoose); + } + function isDeepStrictEqual(val1, val2) { + return innerDeepEqual(val1, val2, kStrict); + } + exports$216 = { + isDeepEqual, + isDeepStrictEqual + }; + return exports$216; +} +function dew23() { + if (_dewExec23) + return exports$119; + _dewExec23 = true; + var process$1 = process3; + function _typeof3(o7) { + "@babel/helpers - typeof"; + return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o8) { + return typeof o8; + } : function(o8) { + return o8 && "function" == typeof Symbol && o8.constructor === Symbol && o8 !== Symbol.prototype ? "symbol" : typeof o8; + }, _typeof3(o7); + } + function _createClass3(Constructor, protoProps, staticProps) { + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _classCallCheck3(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + var _require = dew$h5(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE2 = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE2 = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; + var AssertionError2 = dew$g6(); + var _require2 = exports8, inspect2 = _require2.inspect; + var _require$types = exports8.types, isPromise = _require$types.isPromise, isRegExp3 = _require$types.isRegExp; + var objectAssign = dew$b8()(); + var objectIs = dew$98()(); + var RegExpPrototypeTest = dew3()("RegExp.prototype.test"); + var isDeepEqual; + var isDeepStrictEqual; + function lazyLoadComparison() { + var comparison = dew$116(); + isDeepEqual = comparison.isDeepEqual; + isDeepStrictEqual = comparison.isDeepStrictEqual; + } + var warned = false; + var assert4 = exports$119 = ok2; + var NO_EXCEPTION_SENTINEL = {}; + function innerFail(obj) { + if (obj.message instanceof Error) + throw obj.message; + throw new AssertionError2(obj); + } + function fail2(actual, expected, message, operator, stackStartFn) { + var argsLen = arguments.length; + var internalMessage; + if (argsLen === 0) { + internalMessage = "Failed"; + } else if (argsLen === 1) { + message = actual; + actual = void 0; + } else { + if (warned === false) { + warned = true; + var warn3 = process$1.emitWarning ? process$1.emitWarning : console.warn.bind(console); + warn3("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094"); + } + if (argsLen === 2) + operator = "!="; + } + if (message instanceof Error) + throw message; + var errArgs = { + actual, + expected, + operator: operator === void 0 ? "fail" : operator, + stackStartFn: stackStartFn || fail2 + }; + if (message !== void 0) { + errArgs.message = message; + } + var err = new AssertionError2(errArgs); + if (internalMessage) { + err.message = internalMessage; + err.generatedMessage = true; + } + throw err; + } + assert4.fail = fail2; + assert4.AssertionError = AssertionError2; + function innerOk(fn, argLen, value2, message) { + if (!value2) { + var generatedMessage = false; + if (argLen === 0) { + generatedMessage = true; + message = "No value argument passed to `assert.ok()`"; + } else if (message instanceof Error) { + throw message; + } + var err = new AssertionError2({ + actual: value2, + expected: true, + message, + operator: "==", + stackStartFn: fn + }); + err.generatedMessage = generatedMessage; + throw err; + } + } + function ok2() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + innerOk.apply(void 0, [ok2, args.length].concat(args)); + } + assert4.ok = ok2; + assert4.equal = function equal2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (actual != expected) { + innerFail({ + actual, + expected, + message, + operator: "==", + stackStartFn: equal2 + }); + } + }; + assert4.notEqual = function notEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (actual == expected) { + innerFail({ + actual, + expected, + message, + operator: "!=", + stackStartFn: notEqual2 + }); + } + }; + assert4.deepEqual = function deepEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (isDeepEqual === void 0) + lazyLoadComparison(); + if (!isDeepEqual(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "deepEqual", + stackStartFn: deepEqual2 + }); + } + }; + assert4.notDeepEqual = function notDeepEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (isDeepEqual === void 0) + lazyLoadComparison(); + if (isDeepEqual(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "notDeepEqual", + stackStartFn: notDeepEqual2 + }); + } + }; + assert4.deepStrictEqual = function deepStrictEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (isDeepEqual === void 0) + lazyLoadComparison(); + if (!isDeepStrictEqual(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "deepStrictEqual", + stackStartFn: deepStrictEqual2 + }); + } + }; + assert4.notDeepStrictEqual = notDeepStrictEqual2; + function notDeepStrictEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (isDeepEqual === void 0) + lazyLoadComparison(); + if (isDeepStrictEqual(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "notDeepStrictEqual", + stackStartFn: notDeepStrictEqual2 + }); + } + } + assert4.strictEqual = function strictEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (!objectIs(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "strictEqual", + stackStartFn: strictEqual2 + }); + } + }; + assert4.notStrictEqual = function notStrictEqual2(actual, expected, message) { + if (arguments.length < 2) { + throw new ERR_MISSING_ARGS("actual", "expected"); + } + if (objectIs(actual, expected)) { + innerFail({ + actual, + expected, + message, + operator: "notStrictEqual", + stackStartFn: notStrictEqual2 + }); + } + }; + var Comparison = /* @__PURE__ */ _createClass3(function Comparison2(obj, keys2, actual) { + var _this = this; + _classCallCheck3(this, Comparison2); + keys2.forEach(function(key) { + if (key in obj) { + if (actual !== void 0 && typeof actual[key] === "string" && isRegExp3(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) { + _this[key] = actual[key]; + } else { + _this[key] = obj[key]; + } + } + }); + }); + function compareExceptionKey(actual, expected, key, message, keys2, fn) { + if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) { + if (!message) { + var a7 = new Comparison(actual, keys2); + var b8 = new Comparison(expected, keys2, actual); + var err = new AssertionError2({ + actual: a7, + expected: b8, + operator: "deepStrictEqual", + stackStartFn: fn + }); + err.actual = actual; + err.expected = expected; + err.operator = fn.name; + throw err; + } + innerFail({ + actual, + expected, + message, + operator: fn.name, + stackStartFn: fn + }); + } + } + function expectedException(actual, expected, msg, fn) { + if (typeof expected !== "function") { + if (isRegExp3(expected)) + return RegExpPrototypeTest(expected, actual); + if (arguments.length === 2) { + throw new ERR_INVALID_ARG_TYPE2("expected", ["Function", "RegExp"], expected); + } + if (_typeof3(actual) !== "object" || actual === null) { + var err = new AssertionError2({ + actual, + expected, + message: msg, + operator: "deepStrictEqual", + stackStartFn: fn + }); + err.operator = fn.name; + throw err; + } + var keys2 = Object.keys(expected); + if (expected instanceof Error) { + keys2.push("name", "message"); + } else if (keys2.length === 0) { + throw new ERR_INVALID_ARG_VALUE2("error", expected, "may not be an empty object"); + } + if (isDeepEqual === void 0) + lazyLoadComparison(); + keys2.forEach(function(key) { + if (typeof actual[key] === "string" && isRegExp3(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) { + return; + } + compareExceptionKey(actual, expected, key, msg, keys2, fn); + }); + return true; + } + if (expected.prototype !== void 0 && actual instanceof expected) { + return true; + } + if (Error.isPrototypeOf(expected)) { + return false; + } + return expected.call({}, actual) === true; + } + function getActual(fn) { + if (typeof fn !== "function") { + throw new ERR_INVALID_ARG_TYPE2("fn", "Function", fn); + } + try { + fn(); + } catch (e10) { + return e10; + } + return NO_EXCEPTION_SENTINEL; + } + function checkIsPromise(obj) { + return isPromise(obj) || obj !== null && _typeof3(obj) === "object" && typeof obj.then === "function" && typeof obj.catch === "function"; + } + function waitForActual(promiseFn) { + return Promise.resolve().then(function() { + var resultPromise; + if (typeof promiseFn === "function") { + resultPromise = promiseFn(); + if (!checkIsPromise(resultPromise)) { + throw new ERR_INVALID_RETURN_VALUE("instance of Promise", "promiseFn", resultPromise); + } + } else if (checkIsPromise(promiseFn)) { + resultPromise = promiseFn; + } else { + throw new ERR_INVALID_ARG_TYPE2("promiseFn", ["Function", "Promise"], promiseFn); + } + return Promise.resolve().then(function() { + return resultPromise; + }).then(function() { + return NO_EXCEPTION_SENTINEL; + }).catch(function(e10) { + return e10; + }); + }); + } + function expectsError(stackStartFn, actual, error2, message) { + if (typeof error2 === "string") { + if (arguments.length === 4) { + throw new ERR_INVALID_ARG_TYPE2("error", ["Object", "Error", "Function", "RegExp"], error2); + } + if (_typeof3(actual) === "object" && actual !== null) { + if (actual.message === error2) { + throw new ERR_AMBIGUOUS_ARGUMENT("error/message", 'The error message "'.concat(actual.message, '" is identical to the message.')); + } + } else if (actual === error2) { + throw new ERR_AMBIGUOUS_ARGUMENT("error/message", 'The error "'.concat(actual, '" is identical to the message.')); + } + message = error2; + error2 = void 0; + } else if (error2 != null && _typeof3(error2) !== "object" && typeof error2 !== "function") { + throw new ERR_INVALID_ARG_TYPE2("error", ["Object", "Error", "Function", "RegExp"], error2); + } + if (actual === NO_EXCEPTION_SENTINEL) { + var details = ""; + if (error2 && error2.name) { + details += " (".concat(error2.name, ")"); + } + details += message ? ": ".concat(message) : "."; + var fnType = stackStartFn.name === "rejects" ? "rejection" : "exception"; + innerFail({ + actual: void 0, + expected: error2, + operator: stackStartFn.name, + message: "Missing expected ".concat(fnType).concat(details), + stackStartFn + }); + } + if (error2 && !expectedException(actual, error2, message, stackStartFn)) { + throw actual; + } + } + function expectsNoError(stackStartFn, actual, error2, message) { + if (actual === NO_EXCEPTION_SENTINEL) + return; + if (typeof error2 === "string") { + message = error2; + error2 = void 0; + } + if (!error2 || expectedException(actual, error2)) { + var details = message ? ": ".concat(message) : "."; + var fnType = stackStartFn.name === "doesNotReject" ? "rejection" : "exception"; + innerFail({ + actual, + expected: error2, + operator: stackStartFn.name, + message: "Got unwanted ".concat(fnType).concat(details, "\n") + 'Actual message: "'.concat(actual && actual.message, '"'), + stackStartFn + }); + } + throw actual; + } + assert4.throws = function throws2(promiseFn) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + expectsError.apply(void 0, [throws2, getActual(promiseFn)].concat(args)); + }; + assert4.rejects = function rejects2(promiseFn) { + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + return waitForActual(promiseFn).then(function(result2) { + return expectsError.apply(void 0, [rejects2, result2].concat(args)); + }); + }; + assert4.doesNotThrow = function doesNotThrow2(fn) { + for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + args[_key4 - 1] = arguments[_key4]; + } + expectsNoError.apply(void 0, [doesNotThrow2, getActual(fn)].concat(args)); + }; + assert4.doesNotReject = function doesNotReject2(fn) { + for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { + args[_key5 - 1] = arguments[_key5]; + } + return waitForActual(fn).then(function(result2) { + return expectsNoError.apply(void 0, [doesNotReject2, result2].concat(args)); + }); + }; + assert4.ifError = function ifError2(err) { + if (err !== null && err !== void 0) { + var message = "ifError got unwanted exception: "; + if (_typeof3(err) === "object" && typeof err.message === "string") { + if (err.message.length === 0 && err.constructor) { + message += err.constructor.name; + } else { + message += err.message; + } + } else { + message += inspect2(err); + } + var newErr = new AssertionError2({ + actual: err, + expected: null, + operator: "ifError", + message, + stackStartFn: ifError2 + }); + var origStack = err.stack; + if (typeof origStack === "string") { + var tmp2 = origStack.split("\n"); + tmp2.shift(); + var tmp1 = newErr.stack.split("\n"); + for (var i7 = 0; i7 < tmp2.length; i7++) { + var pos = tmp1.indexOf(tmp2[i7]); + if (pos !== -1) { + tmp1 = tmp1.slice(0, pos); + break; + } + } + newErr.stack = "".concat(tmp1.join("\n"), "\n").concat(tmp2.join("\n")); + } + throw newErr; + } + }; + function internalMatch(string2, regexp, message, fn, fnName) { + if (!isRegExp3(regexp)) { + throw new ERR_INVALID_ARG_TYPE2("regexp", "RegExp", regexp); + } + var match = fnName === "match"; + if (typeof string2 !== "string" || RegExpPrototypeTest(regexp, string2) !== match) { + if (message instanceof Error) { + throw message; + } + var generatedMessage = !message; + message = message || (typeof string2 !== "string" ? 'The "string" argument must be of type string. Received type ' + "".concat(_typeof3(string2), " (").concat(inspect2(string2), ")") : (match ? "The input did not match the regular expression " : "The input was expected to not match the regular expression ") + "".concat(inspect2(regexp), ". Input:\n\n").concat(inspect2(string2), "\n")); + var err = new AssertionError2({ + actual: string2, + expected: regexp, + message, + operator: fnName, + stackStartFn: fn + }); + err.generatedMessage = generatedMessage; + throw err; + } + } + assert4.match = function match(string2, regexp, message) { + internalMatch(string2, regexp, message, match, "match"); + }; + assert4.doesNotMatch = function doesNotMatch(string2, regexp, message) { + internalMatch(string2, regexp, message, doesNotMatch, "doesNotMatch"); + }; + function strict2() { + for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + args[_key6] = arguments[_key6]; + } + innerOk.apply(void 0, [strict2, args.length].concat(args)); + } + assert4.strict = objectAssign(strict2, assert4, { + equal: assert4.strictEqual, + deepEqual: assert4.deepStrictEqual, + notEqual: assert4.notStrictEqual, + notDeepEqual: assert4.notDeepStrictEqual + }); + assert4.strict.strict = assert4.strict; + return exports$119; +} +var exports$i5, _dewExec$h5, exports$h5, _dewExec$g6, exports$g6, _dewExec$f6, exports$f6, _dewExec$e6, exports$e6, _dewExec$d6, exports$d7, _dewExec$c7, exports$c8, _dewExec$b8, exports$b8, _dewExec$a8, exports$a8, _dewExec$98, exports$98, _dewExec$88, exports$89, _dewExec$79, exports$710, _dewExec$610, exports$610, _dewExec$510, exports$510, _dewExec$410, exports$410, _dewExec$315, exports$315, _dewExec$215, exports$216, _dewExec$116, exports$119, _dewExec23, exports26, AssertionError, deepEqual, deepStrictEqual, doesNotReject, doesNotThrow, equal, fail, ifError, notDeepEqual, notDeepStrictEqual, notEqual, notStrictEqual, ok, rejects, strict, strictEqual, throws; +var init_assert = __esm({ + "node_modules/@jspm/core/nodelibs/browser/assert.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_util2(); + init_chunk_DEMDiNwt(); + init_chunk_DtcTpLWz(); + init_chunk_CkFCi_G1(); + exports$i5 = {}; + _dewExec$h5 = false; + exports$h5 = {}; + _dewExec$g6 = false; + exports$g6 = {}; + _dewExec$f6 = false; + exports$f6 = {}; + _dewExec$e6 = false; + exports$e6 = {}; + _dewExec$d6 = false; + exports$d7 = {}; + _dewExec$c7 = false; + exports$c8 = {}; + _dewExec$b8 = false; + exports$b8 = {}; + _dewExec$a8 = false; + exports$a8 = {}; + _dewExec$98 = false; + exports$98 = {}; + _dewExec$88 = false; + exports$89 = {}; + _dewExec$79 = false; + exports$710 = {}; + _dewExec$610 = false; + exports$610 = {}; + _dewExec$510 = false; + exports$510 = {}; + _dewExec$410 = false; + exports$410 = {}; + _dewExec$315 = false; + exports$315 = {}; + _dewExec$215 = false; + exports$216 = {}; + _dewExec$116 = false; + exports$119 = {}; + _dewExec23 = false; + exports26 = dew23(); + AssertionError = exports26.AssertionError; + deepEqual = exports26.deepEqual; + deepStrictEqual = exports26.deepStrictEqual; + doesNotReject = exports26.doesNotReject; + doesNotThrow = exports26.doesNotThrow; + equal = exports26.equal; + fail = exports26.fail; + ifError = exports26.ifError; + notDeepEqual = exports26.notDeepEqual; + notDeepStrictEqual = exports26.notDeepStrictEqual; + notEqual = exports26.notEqual; + notStrictEqual = exports26.notStrictEqual; + ok = exports26.ok; + rejects = exports26.rejects; + strict = exports26.strict; + strictEqual = exports26.strictEqual; + throws = exports26.throws; + } +}); + +// node_modules/path-is-absolute/index.js +var require_path_is_absolute = __commonJS({ + "node_modules/path-is-absolute/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function posix2(path2) { + return path2.charAt(0) === "/"; + } + function win322(path2) { + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result2 = splitDeviceRe.exec(path2); + var device = result2[1] || ""; + var isUnc = Boolean(device && device.charAt(1) !== ":"); + return Boolean(result2[2] || isUnc); + } + module5.exports = process.platform === "win32" ? win322 : posix2; + module5.exports.posix = posix2; + module5.exports.win32 = win322; + } +}); + +// node_modules/glob/common.js +var require_common4 = __commonJS({ + "node_modules/glob/common.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + exports28.setopts = setopts; + exports28.ownProp = ownProp; + exports28.makeAbs = makeAbs; + exports28.finish = finish; + exports28.mark = mark; + exports28.isIgnored = isIgnored; + exports28.childrenIgnored = childrenIgnored; + function ownProp(obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field); + } + var fs = (init_fs(), __toCommonJS(fs_exports)); + var path2 = (init_path(), __toCommonJS(path_exports)); + var minimatch = require_minimatch3(); + var isAbsolute2 = require_path_is_absolute(); + var Minimatch = minimatch.Minimatch; + function alphasort(a7, b8) { + return a7.localeCompare(b8, "en"); + } + function setupIgnores(self2, options) { + self2.ignore = options.ignore || []; + if (!Array.isArray(self2.ignore)) + self2.ignore = [self2.ignore]; + if (self2.ignore.length) { + self2.ignore = self2.ignore.map(ignoreMap); + } + } + function ignoreMap(pattern5) { + var gmatcher = null; + if (pattern5.slice(-3) === "/**") { + var gpattern = pattern5.replace(/(\/\*\*)+$/, ""); + gmatcher = new Minimatch(gpattern, { dot: true }); + } + return { + matcher: new Minimatch(pattern5, { dot: true }), + gmatcher + }; + } + function setopts(self2, pattern5, options) { + if (!options) + options = {}; + if (options.matchBase && -1 === pattern5.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar"); + } + pattern5 = "**/" + pattern5; + } + self2.silent = !!options.silent; + self2.pattern = pattern5; + self2.strict = options.strict !== false; + self2.realpath = !!options.realpath; + self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null); + self2.follow = !!options.follow; + self2.dot = !!options.dot; + self2.mark = !!options.mark; + self2.nodir = !!options.nodir; + if (self2.nodir) + self2.mark = true; + self2.sync = !!options.sync; + self2.nounique = !!options.nounique; + self2.nonull = !!options.nonull; + self2.nosort = !!options.nosort; + self2.nocase = !!options.nocase; + self2.stat = !!options.stat; + self2.noprocess = !!options.noprocess; + self2.absolute = !!options.absolute; + self2.fs = options.fs || fs; + self2.maxLength = options.maxLength || Infinity; + self2.cache = options.cache || /* @__PURE__ */ Object.create(null); + self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null); + self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null); + setupIgnores(self2, options); + self2.changedCwd = false; + var cwd3 = process.cwd(); + if (!ownProp(options, "cwd")) + self2.cwd = cwd3; + else { + self2.cwd = path2.resolve(options.cwd); + self2.changedCwd = self2.cwd !== cwd3; + } + self2.root = options.root || path2.resolve(self2.cwd, "/"); + self2.root = path2.resolve(self2.root); + if (process.platform === "win32") + self2.root = self2.root.replace(/\\/g, "/"); + self2.cwdAbs = isAbsolute2(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd); + if (process.platform === "win32") + self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/"); + self2.nomount = !!options.nomount; + options.nonegate = true; + options.nocomment = true; + options.allowWindowsEscape = false; + self2.minimatch = new Minimatch(pattern5, options); + self2.options = self2.minimatch.options; + } + function finish(self2) { + var nou = self2.nounique; + var all = nou ? [] : /* @__PURE__ */ Object.create(null); + for (var i7 = 0, l7 = self2.matches.length; i7 < l7; i7++) { + var matches2 = self2.matches[i7]; + if (!matches2 || Object.keys(matches2).length === 0) { + if (self2.nonull) { + var literal = self2.minimatch.globSet[i7]; + if (nou) + all.push(literal); + else + all[literal] = true; + } + } else { + var m7 = Object.keys(matches2); + if (nou) + all.push.apply(all, m7); + else + m7.forEach(function(m8) { + all[m8] = true; + }); + } + } + if (!nou) + all = Object.keys(all); + if (!self2.nosort) + all = all.sort(alphasort); + if (self2.mark) { + for (var i7 = 0; i7 < all.length; i7++) { + all[i7] = self2._mark(all[i7]); + } + if (self2.nodir) { + all = all.filter(function(e10) { + var notDir = !/\/$/.test(e10); + var c7 = self2.cache[e10] || self2.cache[makeAbs(self2, e10)]; + if (notDir && c7) + notDir = c7 !== "DIR" && !Array.isArray(c7); + return notDir; + }); + } + } + if (self2.ignore.length) + all = all.filter(function(m8) { + return !isIgnored(self2, m8); + }); + self2.found = all; + } + function mark(self2, p7) { + var abs = makeAbs(self2, p7); + var c7 = self2.cache[abs]; + var m7 = p7; + if (c7) { + var isDir = c7 === "DIR" || Array.isArray(c7); + var slash = p7.slice(-1) === "/"; + if (isDir && !slash) + m7 += "/"; + else if (!isDir && slash) + m7 = m7.slice(0, -1); + if (m7 !== p7) { + var mabs = makeAbs(self2, m7); + self2.statCache[mabs] = self2.statCache[abs]; + self2.cache[mabs] = self2.cache[abs]; + } + } + return m7; + } + function makeAbs(self2, f8) { + var abs = f8; + if (f8.charAt(0) === "/") { + abs = path2.join(self2.root, f8); + } else if (isAbsolute2(f8) || f8 === "") { + abs = f8; + } else if (self2.changedCwd) { + abs = path2.resolve(self2.cwd, f8); + } else { + abs = path2.resolve(f8); + } + if (process.platform === "win32") + abs = abs.replace(/\\/g, "/"); + return abs; + } + function isIgnored(self2, path3) { + if (!self2.ignore.length) + return false; + return self2.ignore.some(function(item) { + return item.matcher.match(path3) || !!(item.gmatcher && item.gmatcher.match(path3)); + }); + } + function childrenIgnored(self2, path3) { + if (!self2.ignore.length) + return false; + return self2.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path3)); + }); + } + } +}); + +// node_modules/glob/sync.js +var require_sync = __commonJS({ + "node_modules/glob/sync.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = globSync; + globSync.GlobSync = GlobSync; + var rp = require_fs(); + var minimatch = require_minimatch3(); + var Minimatch = minimatch.Minimatch; + var Glob = require_glob().Glob; + var util2 = (init_util2(), __toCommonJS(util_exports)); + var path2 = (init_path(), __toCommonJS(path_exports)); + var assert4 = (init_assert(), __toCommonJS(assert_exports)); + var isAbsolute2 = require_path_is_absolute(); + var common3 = require_common4(); + var setopts = common3.setopts; + var ownProp = common3.ownProp; + var childrenIgnored = common3.childrenIgnored; + var isIgnored = common3.isIgnored; + function globSync(pattern5, options) { + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + return new GlobSync(pattern5, options).found; + } + function GlobSync(pattern5, options) { + if (!pattern5) + throw new Error("must provide pattern"); + if (typeof options === "function" || arguments.length === 3) + throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167"); + if (!(this instanceof GlobSync)) + return new GlobSync(pattern5, options); + setopts(this, pattern5, options); + if (this.noprocess) + return this; + var n7 = this.minimatch.set.length; + this.matches = new Array(n7); + for (var i7 = 0; i7 < n7; i7++) { + this._process(this.minimatch.set[i7], i7, false); + } + this._finish(); + } + GlobSync.prototype._finish = function() { + assert4.ok(this instanceof GlobSync); + if (this.realpath) { + var self2 = this; + this.matches.forEach(function(matchset, index4) { + var set4 = self2.matches[index4] = /* @__PURE__ */ Object.create(null); + for (var p7 in matchset) { + try { + p7 = self2._makeAbs(p7); + var real = rp.realpathSync(p7, self2.realpathCache); + set4[real] = true; + } catch (er) { + if (er.syscall === "stat") + set4[self2._makeAbs(p7)] = true; + else + throw er; + } + } + }); + } + common3.finish(this); + }; + GlobSync.prototype._process = function(pattern5, index4, inGlobStar) { + assert4.ok(this instanceof GlobSync); + var n7 = 0; + while (typeof pattern5[n7] === "string") { + n7++; + } + var prefix; + switch (n7) { + case pattern5.length: + this._processSimple(pattern5.join("/"), index4); + return; + case 0: + prefix = null; + break; + default: + prefix = pattern5.slice(0, n7).join("/"); + break; + } + var remain = pattern5.slice(n7); + var read; + if (prefix === null) + read = "."; + else if (isAbsolute2(prefix) || isAbsolute2(pattern5.map(function(p7) { + return typeof p7 === "string" ? p7 : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute2(prefix)) + prefix = "/" + prefix; + read = prefix; + } else + read = prefix; + var abs = this._makeAbs(read); + if (childrenIgnored(this, read)) + return; + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar); + else + this._processReaddir(prefix, read, abs, remain, index4, inGlobStar); + }; + GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var pn = remain[0]; + var negate2 = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i7 = 0; i7 < entries.length; i7++) { + var e10 = entries[i7]; + if (e10.charAt(0) !== "." || dotOk) { + var m7; + if (negate2 && !prefix) { + m7 = !e10.match(pn); + } else { + m7 = e10.match(pn); + } + if (m7) + matchedEntries.push(e10); + } + } + var len = matchedEntries.length; + if (len === 0) + return; + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index4]) + this.matches[index4] = /* @__PURE__ */ Object.create(null); + for (var i7 = 0; i7 < len; i7++) { + var e10 = matchedEntries[i7]; + if (prefix) { + if (prefix.slice(-1) !== "/") + e10 = prefix + "/" + e10; + else + e10 = prefix + e10; + } + if (e10.charAt(0) === "/" && !this.nomount) { + e10 = path2.join(this.root, e10); + } + this._emitMatch(index4, e10); + } + return; + } + remain.shift(); + for (var i7 = 0; i7 < len; i7++) { + var e10 = matchedEntries[i7]; + var newPattern; + if (prefix) + newPattern = [prefix, e10]; + else + newPattern = [e10]; + this._process(newPattern.concat(remain), index4, inGlobStar); + } + }; + GlobSync.prototype._emitMatch = function(index4, e10) { + if (isIgnored(this, e10)) + return; + var abs = this._makeAbs(e10); + if (this.mark) + e10 = this._mark(e10); + if (this.absolute) { + e10 = abs; + } + if (this.matches[index4][e10]) + return; + if (this.nodir) { + var c7 = this.cache[abs]; + if (c7 === "DIR" || Array.isArray(c7)) + return; + } + this.matches[index4][e10] = true; + if (this.stat) + this._stat(e10); + }; + GlobSync.prototype._readdirInGlobStar = function(abs) { + if (this.follow) + return this._readdir(abs, false); + var entries; + var lstat2; + var stat2; + try { + lstat2 = this.fs.lstatSync(abs); + } catch (er) { + if (er.code === "ENOENT") { + return null; + } + } + var isSym = lstat2 && lstat2.isSymbolicLink(); + this.symlinks[abs] = isSym; + if (!isSym && lstat2 && !lstat2.isDirectory()) + this.cache[abs] = "FILE"; + else + entries = this._readdir(abs, false); + return entries; + }; + GlobSync.prototype._readdir = function(abs, inGlobStar) { + var entries; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs); + if (ownProp(this.cache, abs)) { + var c7 = this.cache[abs]; + if (!c7 || c7 === "FILE") + return null; + if (Array.isArray(c7)) + return c7; + } + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)); + } catch (er) { + this._readdirError(abs, er); + return null; + } + }; + GlobSync.prototype._readdirEntries = function(abs, entries) { + if (!this.mark && !this.stat) { + for (var i7 = 0; i7 < entries.length; i7++) { + var e10 = entries[i7]; + if (abs === "/") + e10 = abs + e10; + else + e10 = abs + "/" + e10; + this.cache[e10] = true; + } + } + this.cache[abs] = entries; + return entries; + }; + GlobSync.prototype._readdirError = function(f8, er) { + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f8); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + throw error2; + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f8)] = false; + break; + default: + this.cache[this._makeAbs(f8)] = false; + if (this.strict) + throw er; + if (!this.silent) + console.error("glob error", er); + break; + } + }; + GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) { + var entries = this._readdir(abs, inGlobStar); + if (!entries) + return; + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index4, false); + var len = entries.length; + var isSym = this.symlinks[abs]; + if (isSym && inGlobStar) + return; + for (var i7 = 0; i7 < len; i7++) { + var e10 = entries[i7]; + if (e10.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i7], remainWithoutGlobStar); + this._process(instead, index4, true); + var below = gspref.concat(entries[i7], remain); + this._process(below, index4, true); + } + }; + GlobSync.prototype._processSimple = function(prefix, index4) { + var exists = this._stat(prefix); + if (!this.matches[index4]) + this.matches[index4] = /* @__PURE__ */ Object.create(null); + if (!exists) + return; + if (prefix && isAbsolute2(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path2.join(this.root, prefix); + } else { + prefix = path2.resolve(this.root, prefix); + if (trail) + prefix += "/"; + } + } + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index4, prefix); + }; + GlobSync.prototype._stat = function(f8) { + var abs = this._makeAbs(f8); + var needDir = f8.slice(-1) === "/"; + if (f8.length > this.maxLength) + return false; + if (!this.stat && ownProp(this.cache, abs)) { + var c7 = this.cache[abs]; + if (Array.isArray(c7)) + c7 = "DIR"; + if (!needDir || c7 === "DIR") + return c7; + if (needDir && c7 === "FILE") + return false; + } + var exists; + var stat2 = this.statCache[abs]; + if (!stat2) { + var lstat2; + try { + lstat2 = this.fs.lstatSync(abs); + } catch (er) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return false; + } + } + if (lstat2 && lstat2.isSymbolicLink()) { + try { + stat2 = this.fs.statSync(abs); + } catch (er) { + stat2 = lstat2; + } + } else { + stat2 = lstat2; + } + } + this.statCache[abs] = stat2; + var c7 = true; + if (stat2) + c7 = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c7; + if (needDir && c7 === "FILE") + return false; + return c7; + }; + GlobSync.prototype._mark = function(p7) { + return common3.mark(this, p7); + }; + GlobSync.prototype._makeAbs = function(f8) { + return common3.makeAbs(this, f8); + }; + } +}); + +// node_modules/wrappy/wrappy.js +var require_wrappy = __commonJS({ + "node_modules/wrappy/wrappy.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = wrappy; + function wrappy(fn, cb) { + if (fn && cb) + return wrappy(fn)(cb); + if (typeof fn !== "function") + throw new TypeError("need wrapper function"); + Object.keys(fn).forEach(function(k6) { + wrapper[k6] = fn[k6]; + }); + return wrapper; + function wrapper() { + var args = new Array(arguments.length); + for (var i7 = 0; i7 < args.length; i7++) { + args[i7] = arguments[i7]; + } + var ret = fn.apply(this, args); + var cb2 = args[args.length - 1]; + if (typeof ret === "function" && ret !== cb2) { + Object.keys(cb2).forEach(function(k6) { + ret[k6] = cb2[k6]; + }); + } + return ret; + } + } + } +}); + +// node_modules/once/once.js +var require_once = __commonJS({ + "node_modules/once/once.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var wrappy = require_wrappy(); + module5.exports = wrappy(once5); + module5.exports.strict = wrappy(onceStrict); + once5.proto = once5(function() { + Object.defineProperty(Function.prototype, "once", { + value: function() { + return once5(this); + }, + configurable: true + }); + Object.defineProperty(Function.prototype, "onceStrict", { + value: function() { + return onceStrict(this); + }, + configurable: true + }); + }); + function once5(fn) { + var f8 = function() { + if (f8.called) + return f8.value; + f8.called = true; + return f8.value = fn.apply(this, arguments); + }; + f8.called = false; + return f8; + } + function onceStrict(fn) { + var f8 = function() { + if (f8.called) + throw new Error(f8.onceError); + f8.called = true; + return f8.value = fn.apply(this, arguments); + }; + var name2 = fn.name || "Function wrapped with `once`"; + f8.onceError = name2 + " shouldn't be called more than once"; + f8.called = false; + return f8; + } + } +}); + +// node_modules/inflight/inflight.js +var require_inflight = __commonJS({ + "node_modules/inflight/inflight.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var wrappy = require_wrappy(); + var reqs = /* @__PURE__ */ Object.create(null); + var once5 = require_once(); + module5.exports = wrappy(inflight); + function inflight(key, cb) { + if (reqs[key]) { + reqs[key].push(cb); + return null; + } else { + reqs[key] = [cb]; + return makeres(key); + } + } + function makeres(key) { + return once5(function RES() { + var cbs = reqs[key]; + var len = cbs.length; + var args = slice2(arguments); + try { + for (var i7 = 0; i7 < len; i7++) { + cbs[i7].apply(null, args); + } + } finally { + if (cbs.length > len) { + cbs.splice(0, len); + process.nextTick(function() { + RES.apply(null, args); + }); + } else { + delete reqs[key]; + } + } + }); + } + function slice2(args) { + var length = args.length; + var array = []; + for (var i7 = 0; i7 < length; i7++) + array[i7] = args[i7]; + return array; + } + } +}); + +// node_modules/glob/glob.js +var require_glob = __commonJS({ + "node_modules/glob/glob.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = glob; + var rp = require_fs(); + var minimatch = require_minimatch3(); + var Minimatch = minimatch.Minimatch; + var inherits2 = require_inherits_browser(); + var EE = (init_events(), __toCommonJS(events_exports)).EventEmitter; + var path2 = (init_path(), __toCommonJS(path_exports)); + var assert4 = (init_assert(), __toCommonJS(assert_exports)); + var isAbsolute2 = require_path_is_absolute(); + var globSync = require_sync(); + var common3 = require_common4(); + var setopts = common3.setopts; + var ownProp = common3.ownProp; + var inflight = require_inflight(); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var childrenIgnored = common3.childrenIgnored; + var isIgnored = common3.isIgnored; + var once5 = require_once(); + function glob(pattern5, options, cb) { + if (typeof options === "function") + cb = options, options = {}; + if (!options) + options = {}; + if (options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return globSync(pattern5, options); + } + return new Glob(pattern5, options, cb); + } + glob.sync = globSync; + var GlobSync = glob.GlobSync = globSync.GlobSync; + glob.glob = glob; + function extend3(origin, add2) { + if (add2 === null || typeof add2 !== "object") { + return origin; + } + var keys2 = Object.keys(add2); + var i7 = keys2.length; + while (i7--) { + origin[keys2[i7]] = add2[keys2[i7]]; + } + return origin; + } + glob.hasMagic = function(pattern5, options_) { + var options = extend3({}, options_); + options.noprocess = true; + var g7 = new Glob(pattern5, options); + var set4 = g7.minimatch.set; + if (!pattern5) + return false; + if (set4.length > 1) + return true; + for (var j6 = 0; j6 < set4[0].length; j6++) { + if (typeof set4[0][j6] !== "string") + return true; + } + return false; + }; + glob.Glob = Glob; + inherits2(Glob, EE); + function Glob(pattern5, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + if (options && options.sync) { + if (cb) + throw new TypeError("callback provided to sync glob"); + return new GlobSync(pattern5, options); + } + if (!(this instanceof Glob)) + return new Glob(pattern5, options, cb); + setopts(this, pattern5, options); + this._didRealPath = false; + var n7 = this.minimatch.set.length; + this.matches = new Array(n7); + if (typeof cb === "function") { + cb = once5(cb); + this.on("error", cb); + this.on("end", function(matches2) { + cb(null, matches2); + }); + } + var self2 = this; + this._processing = 0; + this._emitQueue = []; + this._processQueue = []; + this.paused = false; + if (this.noprocess) + return this; + if (n7 === 0) + return done(); + var sync = true; + for (var i7 = 0; i7 < n7; i7++) { + this._process(this.minimatch.set[i7], i7, false, done); + } + sync = false; + function done() { + --self2._processing; + if (self2._processing <= 0) { + if (sync) { + process.nextTick(function() { + self2._finish(); + }); + } else { + self2._finish(); + } + } + } + } + Glob.prototype._finish = function() { + assert4(this instanceof Glob); + if (this.aborted) + return; + if (this.realpath && !this._didRealpath) + return this._realpath(); + common3.finish(this); + this.emit("end", this.found); + }; + Glob.prototype._realpath = function() { + if (this._didRealpath) + return; + this._didRealpath = true; + var n7 = this.matches.length; + if (n7 === 0) + return this._finish(); + var self2 = this; + for (var i7 = 0; i7 < this.matches.length; i7++) + this._realpathSet(i7, next); + function next() { + if (--n7 === 0) + self2._finish(); + } + }; + Glob.prototype._realpathSet = function(index4, cb) { + var matchset = this.matches[index4]; + if (!matchset) + return cb(); + var found = Object.keys(matchset); + var self2 = this; + var n7 = found.length; + if (n7 === 0) + return cb(); + var set4 = this.matches[index4] = /* @__PURE__ */ Object.create(null); + found.forEach(function(p7, i7) { + p7 = self2._makeAbs(p7); + rp.realpath(p7, self2.realpathCache, function(er, real) { + if (!er) + set4[real] = true; + else if (er.syscall === "stat") + set4[p7] = true; + else + self2.emit("error", er); + if (--n7 === 0) { + self2.matches[index4] = set4; + cb(); + } + }); + }); + }; + Glob.prototype._mark = function(p7) { + return common3.mark(this, p7); + }; + Glob.prototype._makeAbs = function(f8) { + return common3.makeAbs(this, f8); + }; + Glob.prototype.abort = function() { + this.aborted = true; + this.emit("abort"); + }; + Glob.prototype.pause = function() { + if (!this.paused) { + this.paused = true; + this.emit("pause"); + } + }; + Glob.prototype.resume = function() { + if (this.paused) { + this.emit("resume"); + this.paused = false; + if (this._emitQueue.length) { + var eq2 = this._emitQueue.slice(0); + this._emitQueue.length = 0; + for (var i7 = 0; i7 < eq2.length; i7++) { + var e10 = eq2[i7]; + this._emitMatch(e10[0], e10[1]); + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0); + this._processQueue.length = 0; + for (var i7 = 0; i7 < pq.length; i7++) { + var p7 = pq[i7]; + this._processing--; + this._process(p7[0], p7[1], p7[2], p7[3]); + } + } + } + }; + Glob.prototype._process = function(pattern5, index4, inGlobStar, cb) { + assert4(this instanceof Glob); + assert4(typeof cb === "function"); + if (this.aborted) + return; + this._processing++; + if (this.paused) { + this._processQueue.push([pattern5, index4, inGlobStar, cb]); + return; + } + var n7 = 0; + while (typeof pattern5[n7] === "string") { + n7++; + } + var prefix; + switch (n7) { + case pattern5.length: + this._processSimple(pattern5.join("/"), index4, cb); + return; + case 0: + prefix = null; + break; + default: + prefix = pattern5.slice(0, n7).join("/"); + break; + } + var remain = pattern5.slice(n7); + var read; + if (prefix === null) + read = "."; + else if (isAbsolute2(prefix) || isAbsolute2(pattern5.map(function(p7) { + return typeof p7 === "string" ? p7 : "[*]"; + }).join("/"))) { + if (!prefix || !isAbsolute2(prefix)) + prefix = "/" + prefix; + read = prefix; + } else + read = prefix; + var abs = this._makeAbs(read); + if (childrenIgnored(this, read)) + return cb(); + var isGlobStar = remain[0] === minimatch.GLOBSTAR; + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb); + else + this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb); + }; + Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) { + var self2 = this; + this._readdir(abs, inGlobStar, function(er, entries) { + return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb); + }); + }; + Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var pn = remain[0]; + var negate2 = !!this.minimatch.negate; + var rawGlob = pn._glob; + var dotOk = this.dot || rawGlob.charAt(0) === "."; + var matchedEntries = []; + for (var i7 = 0; i7 < entries.length; i7++) { + var e10 = entries[i7]; + if (e10.charAt(0) !== "." || dotOk) { + var m7; + if (negate2 && !prefix) { + m7 = !e10.match(pn); + } else { + m7 = e10.match(pn); + } + if (m7) + matchedEntries.push(e10); + } + } + var len = matchedEntries.length; + if (len === 0) + return cb(); + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index4]) + this.matches[index4] = /* @__PURE__ */ Object.create(null); + for (var i7 = 0; i7 < len; i7++) { + var e10 = matchedEntries[i7]; + if (prefix) { + if (prefix !== "/") + e10 = prefix + "/" + e10; + else + e10 = prefix + e10; + } + if (e10.charAt(0) === "/" && !this.nomount) { + e10 = path2.join(this.root, e10); + } + this._emitMatch(index4, e10); + } + return cb(); + } + remain.shift(); + for (var i7 = 0; i7 < len; i7++) { + var e10 = matchedEntries[i7]; + var newPattern; + if (prefix) { + if (prefix !== "/") + e10 = prefix + "/" + e10; + else + e10 = prefix + e10; + } + this._process([e10].concat(remain), index4, inGlobStar, cb); + } + cb(); + }; + Glob.prototype._emitMatch = function(index4, e10) { + if (this.aborted) + return; + if (isIgnored(this, e10)) + return; + if (this.paused) { + this._emitQueue.push([index4, e10]); + return; + } + var abs = isAbsolute2(e10) ? e10 : this._makeAbs(e10); + if (this.mark) + e10 = this._mark(e10); + if (this.absolute) + e10 = abs; + if (this.matches[index4][e10]) + return; + if (this.nodir) { + var c7 = this.cache[abs]; + if (c7 === "DIR" || Array.isArray(c7)) + return; + } + this.matches[index4][e10] = true; + var st2 = this.statCache[abs]; + if (st2) + this.emit("stat", e10, st2); + this.emit("match", e10); + }; + Glob.prototype._readdirInGlobStar = function(abs, cb) { + if (this.aborted) + return; + if (this.follow) + return this._readdir(abs, false, cb); + var lstatkey = "lstat\0" + abs; + var self2 = this; + var lstatcb = inflight(lstatkey, lstatcb_); + if (lstatcb) + self2.fs.lstat(abs, lstatcb); + function lstatcb_(er, lstat2) { + if (er && er.code === "ENOENT") + return cb(); + var isSym = lstat2 && lstat2.isSymbolicLink(); + self2.symlinks[abs] = isSym; + if (!isSym && lstat2 && !lstat2.isDirectory()) { + self2.cache[abs] = "FILE"; + cb(); + } else + self2._readdir(abs, false, cb); + } + }; + Glob.prototype._readdir = function(abs, inGlobStar, cb) { + if (this.aborted) + return; + cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb); + if (!cb) + return; + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb); + if (ownProp(this.cache, abs)) { + var c7 = this.cache[abs]; + if (!c7 || c7 === "FILE") + return cb(); + if (Array.isArray(c7)) + return cb(null, c7); + } + var self2 = this; + self2.fs.readdir(abs, readdirCb(this, abs, cb)); + }; + function readdirCb(self2, abs, cb) { + return function(er, entries) { + if (er) + self2._readdirError(abs, er, cb); + else + self2._readdirEntries(abs, entries, cb); + }; + } + Glob.prototype._readdirEntries = function(abs, entries, cb) { + if (this.aborted) + return; + if (!this.mark && !this.stat) { + for (var i7 = 0; i7 < entries.length; i7++) { + var e10 = entries[i7]; + if (abs === "/") + e10 = abs + e10; + else + e10 = abs + "/" + e10; + this.cache[e10] = true; + } + } + this.cache[abs] = entries; + return cb(null, entries); + }; + Glob.prototype._readdirError = function(f8, er, cb) { + if (this.aborted) + return; + switch (er.code) { + case "ENOTSUP": + case "ENOTDIR": + var abs = this._makeAbs(f8); + this.cache[abs] = "FILE"; + if (abs === this.cwdAbs) { + var error2 = new Error(er.code + " invalid cwd " + this.cwd); + error2.path = this.cwd; + error2.code = er.code; + this.emit("error", error2); + this.abort(); + } + break; + case "ENOENT": + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[this._makeAbs(f8)] = false; + break; + default: + this.cache[this._makeAbs(f8)] = false; + if (this.strict) { + this.emit("error", er); + this.abort(); + } + if (!this.silent) + console.error("glob error", er); + break; + } + return cb(); + }; + Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) { + var self2 = this; + this._readdir(abs, inGlobStar, function(er, entries) { + self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb); + }); + }; + Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) { + if (!entries) + return cb(); + var remainWithoutGlobStar = remain.slice(1); + var gspref = prefix ? [prefix] : []; + var noGlobStar = gspref.concat(remainWithoutGlobStar); + this._process(noGlobStar, index4, false, cb); + var isSym = this.symlinks[abs]; + var len = entries.length; + if (isSym && inGlobStar) + return cb(); + for (var i7 = 0; i7 < len; i7++) { + var e10 = entries[i7]; + if (e10.charAt(0) === "." && !this.dot) + continue; + var instead = gspref.concat(entries[i7], remainWithoutGlobStar); + this._process(instead, index4, true, cb); + var below = gspref.concat(entries[i7], remain); + this._process(below, index4, true, cb); + } + cb(); + }; + Glob.prototype._processSimple = function(prefix, index4, cb) { + var self2 = this; + this._stat(prefix, function(er, exists) { + self2._processSimple2(prefix, index4, er, exists, cb); + }); + }; + Glob.prototype._processSimple2 = function(prefix, index4, er, exists, cb) { + if (!this.matches[index4]) + this.matches[index4] = /* @__PURE__ */ Object.create(null); + if (!exists) + return cb(); + if (prefix && isAbsolute2(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix); + if (prefix.charAt(0) === "/") { + prefix = path2.join(this.root, prefix); + } else { + prefix = path2.resolve(this.root, prefix); + if (trail) + prefix += "/"; + } + } + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/"); + this._emitMatch(index4, prefix); + cb(); + }; + Glob.prototype._stat = function(f8, cb) { + var abs = this._makeAbs(f8); + var needDir = f8.slice(-1) === "/"; + if (f8.length > this.maxLength) + return cb(); + if (!this.stat && ownProp(this.cache, abs)) { + var c7 = this.cache[abs]; + if (Array.isArray(c7)) + c7 = "DIR"; + if (!needDir || c7 === "DIR") + return cb(null, c7); + if (needDir && c7 === "FILE") + return cb(); + } + var exists; + var stat2 = this.statCache[abs]; + if (stat2 !== void 0) { + if (stat2 === false) + return cb(null, stat2); + else { + var type3 = stat2.isDirectory() ? "DIR" : "FILE"; + if (needDir && type3 === "FILE") + return cb(); + else + return cb(null, type3, stat2); + } + } + var self2 = this; + var statcb = inflight("stat\0" + abs, lstatcb_); + if (statcb) + self2.fs.lstat(abs, statcb); + function lstatcb_(er, lstat2) { + if (lstat2 && lstat2.isSymbolicLink()) { + return self2.fs.stat(abs, function(er2, stat3) { + if (er2) + self2._stat2(f8, abs, null, lstat2, cb); + else + self2._stat2(f8, abs, er2, stat3, cb); + }); + } else { + self2._stat2(f8, abs, er, lstat2, cb); + } + } + }; + Glob.prototype._stat2 = function(f8, abs, er, stat2, cb) { + if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) { + this.statCache[abs] = false; + return cb(); + } + var needDir = f8.slice(-1) === "/"; + this.statCache[abs] = stat2; + if (abs.slice(-1) === "/" && stat2 && !stat2.isDirectory()) + return cb(null, false, stat2); + var c7 = true; + if (stat2) + c7 = stat2.isDirectory() ? "DIR" : "FILE"; + this.cache[abs] = this.cache[abs] || c7; + if (needDir && c7 === "FILE") + return cb(); + return cb(null, c7, stat2); + }; + } +}); + +// node_modules/typescript-json-schema/node_modules/safe-stable-stringify/index.js +var require_safe_stable_stringify2 = __commonJS({ + "node_modules/typescript-json-schema/node_modules/safe-stable-stringify/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { hasOwnProperty: hasOwnProperty27 } = Object.prototype; + var stringify5 = configure(); + stringify5.configure = configure; + stringify5.stringify = stringify5; + stringify5.default = stringify5; + exports28.stringify = stringify5; + exports28.configure = configure; + module5.exports = stringify5; + var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/; + function strEscape(str2) { + if (str2.length < 5e3 && !strEscapeSequencesRegExp.test(str2)) { + return `"${str2}"`; + } + return JSON.stringify(str2); + } + function insertSort(array) { + if (array.length > 200) { + return array.sort(); + } + for (let i7 = 1; i7 < array.length; i7++) { + const currentValue = array[i7]; + let position = i7; + while (position !== 0 && array[position - 1] > currentValue) { + array[position] = array[position - 1]; + position--; + } + array[position] = currentValue; + } + return array; + } + var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf( + Object.getPrototypeOf( + new Int8Array() + ) + ), + Symbol.toStringTag + ).get; + function isTypedArrayWithEntries(value2) { + return typedArrayPrototypeGetSymbolToStringTag.call(value2) !== void 0 && value2.length !== 0; + } + function stringifyTypedArray(array, separator, maximumBreadth) { + if (array.length < maximumBreadth) { + maximumBreadth = array.length; + } + const whitespace = separator === "," ? "" : " "; + let res = `"0":${whitespace}${array[0]}`; + for (let i7 = 1; i7 < maximumBreadth; i7++) { + res += `${separator}"${i7}":${whitespace}${array[i7]}`; + } + return res; + } + function getCircularValueOption(options) { + if (hasOwnProperty27.call(options, "circularValue")) { + const circularValue = options.circularValue; + if (typeof circularValue === "string") { + return `"${circularValue}"`; + } + if (circularValue == null) { + return circularValue; + } + if (circularValue === Error || circularValue === TypeError) { + return { + toString() { + throw new TypeError("Converting circular structure to JSON"); + } + }; + } + throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); + } + return '"[Circular]"'; + } + function getBooleanOption(options, key) { + let value2; + if (hasOwnProperty27.call(options, key)) { + value2 = options[key]; + if (typeof value2 !== "boolean") { + throw new TypeError(`The "${key}" argument must be of type boolean`); + } + } + return value2 === void 0 ? true : value2; + } + function getPositiveIntegerOption(options, key) { + let value2; + if (hasOwnProperty27.call(options, key)) { + value2 = options[key]; + if (typeof value2 !== "number") { + throw new TypeError(`The "${key}" argument must be of type number`); + } + if (!Number.isInteger(value2)) { + throw new TypeError(`The "${key}" argument must be an integer`); + } + if (value2 < 1) { + throw new RangeError(`The "${key}" argument must be >= 1`); + } + } + return value2 === void 0 ? Infinity : value2; + } + function getItemCount(number) { + if (number === 1) { + return "1 item"; + } + return `${number} items`; + } + function getUniqueReplacerSet(replacerArray) { + const replacerSet = /* @__PURE__ */ new Set(); + for (const value2 of replacerArray) { + if (typeof value2 === "string" || typeof value2 === "number") { + replacerSet.add(String(value2)); + } + } + return replacerSet; + } + function getStrictOption(options) { + if (hasOwnProperty27.call(options, "strict")) { + const value2 = options.strict; + if (typeof value2 !== "boolean") { + throw new TypeError('The "strict" argument must be of type boolean'); + } + if (value2) { + return (value3) => { + let message = `Object can not safely be stringified. Received type ${typeof value3}`; + if (typeof value3 !== "function") + message += ` (${value3.toString()})`; + throw new Error(message); + }; + } + } + } + function configure(options) { + options = { ...options }; + const fail2 = getStrictOption(options); + if (fail2) { + if (options.bigint === void 0) { + options.bigint = false; + } + if (!("circularValue" in options)) { + options.circularValue = Error; + } + } + const circularValue = getCircularValueOption(options); + const bigint = getBooleanOption(options, "bigint"); + const deterministic = getBooleanOption(options, "deterministic"); + const maximumDepth = getPositiveIntegerOption(options, "maximumDepth"); + const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth"); + function stringifyFnReplacer(key, parent2, stack, replacer, spacer, indentation) { + let value2 = parent2[key]; + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + value2 = replacer.call(parent2, key, value2); + switch (typeof value2) { + case "string": + return strEscape(value2); + case "object": { + if (value2 === null) { + return "null"; + } + if (stack.indexOf(value2) !== -1) { + return circularValue; + } + let res = ""; + let join3 = ","; + const originalIndentation = indentation; + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value2); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value2.length, maximumBreadth); + let i7 = 0; + for (; i7 < maximumValuesToStringify - 1; i7++) { + const tmp2 = stringifyFnReplacer(String(i7), value2, stack, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join3; + } + const tmp = stringifyFnReplacer(String(i7), value2, stack, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value2.length - 1 > maximumBreadth) { + const removedKeys = value2.length - maximumBreadth - 1; + res += `${join3}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack.pop(); + return `[${res}]`; + } + let keys2 = Object.keys(value2); + const keyLength = keys2.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + let whitespace = ""; + let separator = ""; + if (spacer !== "") { + indentation += spacer; + join3 = `, +${indentation}`; + whitespace = " "; + } + const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (deterministic && !isTypedArrayWithEntries(value2)) { + keys2 = insertSort(keys2); + } + stack.push(value2); + for (let i7 = 0; i7 < maximumPropertiesToStringify; i7++) { + const key2 = keys2[i7]; + const tmp = stringifyFnReplacer(key2, value2, stack, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; + separator = join3; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`; + separator = join3; + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value2) ? String(value2) : fail2 ? fail2(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value2); + } + default: + return fail2 ? fail2(value2) : void 0; + } + } + function stringifyArrayReplacer(key, value2, stack, replacer, spacer, indentation) { + if (typeof value2 === "object" && value2 !== null && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + switch (typeof value2) { + case "string": + return strEscape(value2); + case "object": { + if (value2 === null) { + return "null"; + } + if (stack.indexOf(value2) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + let res = ""; + let join3 = ","; + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value2); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join3 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value2.length, maximumBreadth); + let i7 = 0; + for (; i7 < maximumValuesToStringify - 1; i7++) { + const tmp2 = stringifyArrayReplacer(String(i7), value2[i7], stack, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join3; + } + const tmp = stringifyArrayReplacer(String(i7), value2[i7], stack, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value2.length - 1 > maximumBreadth) { + const removedKeys = value2.length - maximumBreadth - 1; + res += `${join3}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack.pop(); + return `[${res}]`; + } + stack.push(value2); + let whitespace = ""; + if (spacer !== "") { + indentation += spacer; + join3 = `, +${indentation}`; + whitespace = " "; + } + let separator = ""; + for (const key2 of replacer) { + const tmp = stringifyArrayReplacer(key2, value2[key2], stack, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; + separator = join3; + } + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value2) ? String(value2) : fail2 ? fail2(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value2); + } + default: + return fail2 ? fail2(value2) : void 0; + } + } + function stringifyIndent(key, value2, stack, spacer, indentation) { + switch (typeof value2) { + case "string": + return strEscape(value2); + case "object": { + if (value2 === null) { + return "null"; + } + if (typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + if (typeof value2 !== "object") { + return stringifyIndent(key, value2, stack, spacer, indentation); + } + if (value2 === null) { + return "null"; + } + } + if (stack.indexOf(value2) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value2); + indentation += spacer; + let res2 = ` +${indentation}`; + const join4 = `, +${indentation}`; + const maximumValuesToStringify = Math.min(value2.length, maximumBreadth); + let i7 = 0; + for (; i7 < maximumValuesToStringify - 1; i7++) { + const tmp2 = stringifyIndent(String(i7), value2[i7], stack, spacer, indentation); + res2 += tmp2 !== void 0 ? tmp2 : "null"; + res2 += join4; + } + const tmp = stringifyIndent(String(i7), value2[i7], stack, spacer, indentation); + res2 += tmp !== void 0 ? tmp : "null"; + if (value2.length - 1 > maximumBreadth) { + const removedKeys = value2.length - maximumBreadth - 1; + res2 += `${join4}"... ${getItemCount(removedKeys)} not stringified"`; + } + res2 += ` +${originalIndentation}`; + stack.pop(); + return `[${res2}]`; + } + let keys2 = Object.keys(value2); + const keyLength = keys2.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + indentation += spacer; + const join3 = `, +${indentation}`; + let res = ""; + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (isTypedArrayWithEntries(value2)) { + res += stringifyTypedArray(value2, join3, maximumBreadth); + keys2 = keys2.slice(value2.length); + maximumPropertiesToStringify -= value2.length; + separator = join3; + } + if (deterministic) { + keys2 = insertSort(keys2); + } + stack.push(value2); + for (let i7 = 0; i7 < maximumPropertiesToStringify; i7++) { + const key2 = keys2[i7]; + const tmp = stringifyIndent(key2, value2[key2], stack, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}: ${tmp}`; + separator = join3; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`; + separator = join3; + } + if (separator !== "") { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value2) ? String(value2) : fail2 ? fail2(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value2); + } + default: + return fail2 ? fail2(value2) : void 0; + } + } + function stringifySimple(key, value2, stack) { + switch (typeof value2) { + case "string": + return strEscape(value2); + case "object": { + if (value2 === null) { + return "null"; + } + if (typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + if (typeof value2 !== "object") { + return stringifySimple(key, value2, stack); + } + if (value2 === null) { + return "null"; + } + } + if (stack.indexOf(value2) !== -1) { + return circularValue; + } + let res = ""; + if (Array.isArray(value2)) { + if (value2.length === 0) { + return "[]"; + } + if (maximumDepth < stack.length + 1) { + return '"[Array]"'; + } + stack.push(value2); + const maximumValuesToStringify = Math.min(value2.length, maximumBreadth); + let i7 = 0; + for (; i7 < maximumValuesToStringify - 1; i7++) { + const tmp2 = stringifySimple(String(i7), value2[i7], stack); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifySimple(String(i7), value2[i7], stack); + res += tmp !== void 0 ? tmp : "null"; + if (value2.length - 1 > maximumBreadth) { + const removedKeys = value2.length - maximumBreadth - 1; + res += `,"... ${getItemCount(removedKeys)} not stringified"`; + } + stack.pop(); + return `[${res}]`; + } + let keys2 = Object.keys(value2); + const keyLength = keys2.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack.length + 1) { + return '"[Object]"'; + } + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (isTypedArrayWithEntries(value2)) { + res += stringifyTypedArray(value2, ",", maximumBreadth); + keys2 = keys2.slice(value2.length); + maximumPropertiesToStringify -= value2.length; + separator = ","; + } + if (deterministic) { + keys2 = insertSort(keys2); + } + stack.push(value2); + for (let i7 = 0; i7 < maximumPropertiesToStringify; i7++) { + const key2 = keys2[i7]; + const tmp = stringifySimple(key2, value2[key2], stack); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${tmp}`; + separator = ","; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`; + } + stack.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value2) ? String(value2) : fail2 ? fail2(value2) : "null"; + case "boolean": + return value2 === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value2); + } + default: + return fail2 ? fail2(value2) : void 0; + } + } + function stringify6(value2, replacer, space) { + if (arguments.length > 1) { + let spacer = ""; + if (typeof space === "number") { + spacer = " ".repeat(Math.min(space, 10)); + } else if (typeof space === "string") { + spacer = space.slice(0, 10); + } + if (replacer != null) { + if (typeof replacer === "function") { + return stringifyFnReplacer("", { "": value2 }, [], replacer, spacer, ""); + } + if (Array.isArray(replacer)) { + return stringifyArrayReplacer("", value2, [], getUniqueReplacerSet(replacer), spacer, ""); + } + } + if (spacer.length !== 0) { + return stringifyIndent("", value2, [], spacer, ""); + } + } + return stringifySimple("", value2, []); + } + return stringify6; + } + } +}); + +// node_modules/@jspm/core/nodelibs/browser/perf_hooks.js +var perf_hooks_exports = {}; +__export(perf_hooks_exports, { + PerformanceObserver: () => PerformanceObserver2, + constants: () => constants4, + default: () => perf_hooks, + monitorEventLoopDelay: () => monitorEventLoopDelay, + performance: () => performance2 +}); +function unimplemented3(functionName) { + throw new Error( + `Node.js performance method ${functionName} is not currently supported by JSPM core in the browser` + ); +} +var PerformanceObserver2, constants4, performance2, monitorEventLoopDelay, perf_hooks; +var init_perf_hooks = __esm({ + "node_modules/@jspm/core/nodelibs/browser/perf_hooks.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + PerformanceObserver2 = globalThis.PerformanceObserver; + constants4 = {}; + performance2 = { + clearMarks: globalThis.performance.clearMarks, + eventLoopUtilization: () => unimplemented3("eventLoopUtilization"), + mark: globalThis.performance.mark, + measure: globalThis.performance.measure, + nodeTiming: {}, + now: globalThis.performance.now, + timeOrigin: globalThis.performance.timeOrigin, + timerify: () => unimplemented3("timerify") + }; + monitorEventLoopDelay = () => unimplemented3("monitorEventLoopDelay"); + perf_hooks = { + performance: performance2, + PerformanceObserver: PerformanceObserver2, + monitorEventLoopDelay, + constants: constants4 + }; + } +}); + +// (disabled):node_modules/source-map-support/source-map-support.js +var require_source_map_support = __commonJS({ + "(disabled):node_modules/source-map-support/source-map-support.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + } +}); + +// node_modules/typescript-json-schema/node_modules/typescript/lib/typescript.js +var require_typescript = __commonJS({ + "node_modules/typescript-json-schema/node_modules/typescript/lib/typescript.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __spreadArray9 = exports28 && exports28.__spreadArray || function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i7 = 0, l7 = from.length, ar; i7 < l7; i7++) { + if (ar || !(i7 in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i7); + ar[i7] = from[i7]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + }; + var __assign16 = exports28 && exports28.__assign || function() { + __assign16 = Object.assign || function(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign16.apply(this, arguments); + }; + var __makeTemplateObject10 = exports28 && exports28.__makeTemplateObject || function(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; + } + return cooked; + }; + var __generator10 = exports28 && exports28.__generator || function(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (g7 && (g7 = 0, op[0] && (_6 = 0)), _6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __rest13 = exports28 && exports28.__rest || function(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; + }; + var __extends10 = exports28 && exports28.__extends || /* @__PURE__ */ function() { + var extendStatics10 = function(d7, b8) { + extendStatics10 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d8, b9) { + d8.__proto__ = b9; + } || function(d8, b9) { + for (var p7 in b9) + if (Object.prototype.hasOwnProperty.call(b9, p7)) + d8[p7] = b9[p7]; + }; + return extendStatics10(d7, b8); + }; + return function(d7, b8) { + if (typeof b8 !== "function" && b8 !== null) + throw new TypeError("Class extends value " + String(b8) + " is not a constructor or null"); + extendStatics10(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); + }; + }(); + var ts; + (function(ts2) { + ts2.versionMajorMinor = "4.9"; + ts2.version = "".concat(ts2.versionMajorMinor, ".5"); + var Comparison; + (function(Comparison2) { + Comparison2[Comparison2["LessThan"] = -1] = "LessThan"; + Comparison2[Comparison2["EqualTo"] = 0] = "EqualTo"; + Comparison2[Comparison2["GreaterThan"] = 1] = "GreaterThan"; + })(Comparison = ts2.Comparison || (ts2.Comparison = {})); + var NativeCollections; + (function(NativeCollections2) { + var globals3 = typeof globalThis !== "undefined" ? globalThis : typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : void 0; + function tryGetNativeMap() { + var gMap = globals3 === null || globals3 === void 0 ? void 0 : globals3.Map; + var constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : void 0; + if (!constructor) { + throw new Error("No compatible Map implementation found."); + } + return constructor; + } + NativeCollections2.tryGetNativeMap = tryGetNativeMap; + function tryGetNativeSet() { + var gSet = globals3 === null || globals3 === void 0 ? void 0 : globals3.Set; + var constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : void 0; + if (!constructor) { + throw new Error("No compatible Set implementation found."); + } + return constructor; + } + NativeCollections2.tryGetNativeSet = tryGetNativeSet; + })(NativeCollections || (NativeCollections = {})); + ts2.Map = NativeCollections.tryGetNativeMap(); + ts2.Set = NativeCollections.tryGetNativeSet(); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getIterator(iterable) { + if (iterable) { + if (isArray3(iterable)) + return arrayIterator(iterable); + if (iterable instanceof ts2.Map) + return iterable.entries(); + if (iterable instanceof ts2.Set) + return iterable.values(); + throw new Error("Iteration not supported."); + } + } + ts2.getIterator = getIterator; + ts2.emptyArray = []; + ts2.emptyMap = new ts2.Map(); + ts2.emptySet = new ts2.Set(); + function length(array) { + return array ? array.length : 0; + } + ts2.length = length; + function forEach4(array, callback) { + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + return void 0; + } + ts2.forEach = forEach4; + function forEachRight2(array, callback) { + if (array) { + for (var i7 = array.length - 1; i7 >= 0; i7--) { + var result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + return void 0; + } + ts2.forEachRight = forEachRight2; + function firstDefined(array, callback) { + if (array === void 0) { + return void 0; + } + for (var i7 = 0; i7 < array.length; i7++) { + var result2 = callback(array[i7], i7); + if (result2 !== void 0) { + return result2; + } + } + return void 0; + } + ts2.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var iterResult = iter.next(); + if (iterResult.done) { + return void 0; + } + var result2 = callback(iterResult.value); + if (result2 !== void 0) { + return result2; + } + } + } + ts2.firstDefinedIterator = firstDefinedIterator; + function reduceLeftIterator(iterator, f8, initial2) { + var result2 = initial2; + if (iterator) { + for (var step = iterator.next(), pos = 0; !step.done; step = iterator.next(), pos++) { + result2 = f8(result2, step.value, pos); + } + } + return result2; + } + ts2.reduceLeftIterator = reduceLeftIterator; + function zipWith2(arrayA, arrayB, callback) { + var result2 = []; + ts2.Debug.assertEqual(arrayA.length, arrayB.length); + for (var i7 = 0; i7 < arrayA.length; i7++) { + result2.push(callback(arrayA[i7], arrayB[i7], i7)); + } + return result2; + } + ts2.zipWith = zipWith2; + function zipToIterator(arrayA, arrayB) { + ts2.Debug.assertEqual(arrayA.length, arrayB.length); + var i7 = 0; + return { + next: function() { + if (i7 === arrayA.length) { + return { value: void 0, done: true }; + } + i7++; + return { value: [arrayA[i7 - 1], arrayB[i7 - 1]], done: false }; + } + }; + } + ts2.zipToIterator = zipToIterator; + function zipToMap(keys2, values2) { + ts2.Debug.assert(keys2.length === values2.length); + var map5 = new ts2.Map(); + for (var i7 = 0; i7 < keys2.length; ++i7) { + map5.set(keys2[i7], values2[i7]); + } + return map5; + } + ts2.zipToMap = zipToMap; + function intersperse(input, element) { + if (input.length <= 1) { + return input; + } + var result2 = []; + for (var i7 = 0, n7 = input.length; i7 < n7; i7++) { + if (i7) + result2.push(element); + result2.push(input[i7]); + } + return result2; + } + ts2.intersperse = intersperse; + function every2(array, callback) { + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + if (!callback(array[i7], i7)) { + return false; + } + } + } + return true; + } + ts2.every = every2; + function find2(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (var i7 = startIndex !== null && startIndex !== void 0 ? startIndex : 0; i7 < array.length; i7++) { + var value2 = array[i7]; + if (predicate(value2, i7)) { + return value2; + } + } + return void 0; + } + ts2.find = find2; + function findLast2(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (var i7 = startIndex !== null && startIndex !== void 0 ? startIndex : array.length - 1; i7 >= 0; i7--) { + var value2 = array[i7]; + if (predicate(value2, i7)) { + return value2; + } + } + return void 0; + } + ts2.findLast = findLast2; + function findIndex2(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (var i7 = startIndex !== null && startIndex !== void 0 ? startIndex : 0; i7 < array.length; i7++) { + if (predicate(array[i7], i7)) { + return i7; + } + } + return -1; + } + ts2.findIndex = findIndex2; + function findLastIndex2(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (var i7 = startIndex !== null && startIndex !== void 0 ? startIndex : array.length - 1; i7 >= 0; i7--) { + if (predicate(array[i7], i7)) { + return i7; + } + } + return -1; + } + ts2.findLastIndex = findLastIndex2; + function findMap(array, callback) { + for (var i7 = 0; i7 < array.length; i7++) { + var result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + return ts2.Debug.fail(); + } + ts2.findMap = findMap; + function contains2(array, value2, equalityComparer) { + if (equalityComparer === void 0) { + equalityComparer = equateValues; + } + if (array) { + for (var _i = 0, array_1 = array; _i < array_1.length; _i++) { + var v8 = array_1[_i]; + if (equalityComparer(v8, value2)) { + return true; + } + } + } + return false; + } + ts2.contains = contains2; + function arraysEqual(a7, b8, equalityComparer) { + if (equalityComparer === void 0) { + equalityComparer = equateValues; + } + return a7.length === b8.length && a7.every(function(x7, i7) { + return equalityComparer(x7, b8[i7]); + }); + } + ts2.arraysEqual = arraysEqual; + function indexOfAnyCharCode(text, charCodes, start) { + for (var i7 = start || 0; i7 < text.length; i7++) { + if (contains2(charCodes, text.charCodeAt(i7))) { + return i7; + } + } + return -1; + } + ts2.indexOfAnyCharCode = indexOfAnyCharCode; + function countWhere(array, predicate) { + var count2 = 0; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var v8 = array[i7]; + if (predicate(v8, i7)) { + count2++; + } + } + } + return count2; + } + ts2.countWhere = countWhere; + function filter2(array, f8) { + if (array) { + var len = array.length; + var i7 = 0; + while (i7 < len && f8(array[i7])) + i7++; + if (i7 < len) { + var result2 = array.slice(0, i7); + i7++; + while (i7 < len) { + var item = array[i7]; + if (f8(item)) { + result2.push(item); + } + i7++; + } + return result2; + } + } + return array; + } + ts2.filter = filter2; + function filterMutate(array, f8) { + var outIndex = 0; + for (var i7 = 0; i7 < array.length; i7++) { + if (f8(array[i7], i7, array)) { + array[outIndex] = array[i7]; + outIndex++; + } + } + array.length = outIndex; + } + ts2.filterMutate = filterMutate; + function clear2(array) { + array.length = 0; + } + ts2.clear = clear2; + function map4(array, f8) { + var result2; + if (array) { + result2 = []; + for (var i7 = 0; i7 < array.length; i7++) { + result2.push(f8(array[i7], i7)); + } + } + return result2; + } + ts2.map = map4; + function mapIterator(iter, mapFn) { + return { + next: function() { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; + } + ts2.mapIterator = mapIterator; + function sameMap(array, f8) { + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var item = array[i7]; + var mapped = f8(item, i7); + if (item !== mapped) { + var result2 = array.slice(0, i7); + result2.push(mapped); + for (i7++; i7 < array.length; i7++) { + result2.push(f8(array[i7], i7)); + } + return result2; + } + } + } + return array; + } + ts2.sameMap = sameMap; + function flatten2(array) { + var result2 = []; + for (var _i = 0, array_2 = array; _i < array_2.length; _i++) { + var v8 = array_2[_i]; + if (v8) { + if (isArray3(v8)) { + addRange(result2, v8); + } else { + result2.push(v8); + } + } + } + return result2; + } + ts2.flatten = flatten2; + function flatMap2(array, mapfn) { + var result2; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var v8 = mapfn(array[i7], i7); + if (v8) { + if (isArray3(v8)) { + result2 = addRange(result2, v8); + } else { + result2 = append(result2, v8); + } + } + } + } + return result2 || ts2.emptyArray; + } + ts2.flatMap = flatMap2; + function flatMapToMutable(array, mapfn) { + var result2 = []; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var v8 = mapfn(array[i7], i7); + if (v8) { + if (isArray3(v8)) { + addRange(result2, v8); + } else { + result2.push(v8); + } + } + } + } + return result2; + } + ts2.flatMapToMutable = flatMapToMutable; + function flatMapIterator(iter, mapfn) { + var first2 = iter.next(); + if (first2.done) { + return ts2.emptyIterator; + } + var currentIter = getIterator2(first2.value); + return { + next: function() { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator2(iterRes.value); + } + } + }; + function getIterator2(x7) { + var res = mapfn(x7); + return res === void 0 ? ts2.emptyIterator : isArray3(res) ? arrayIterator(res) : res; + } + } + ts2.flatMapIterator = flatMapIterator; + function sameFlatMap(array, mapfn) { + var result2; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var item = array[i7]; + var mapped = mapfn(item, i7); + if (result2 || item !== mapped || isArray3(mapped)) { + if (!result2) { + result2 = array.slice(0, i7); + } + if (isArray3(mapped)) { + addRange(result2, mapped); + } else { + result2.push(mapped); + } + } + } + } + return result2 || array; + } + ts2.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result2 = []; + for (var i7 = 0; i7 < array.length; i7++) { + var mapped = mapFn(array[i7], i7); + if (mapped === void 0) { + return void 0; + } + result2.push(mapped); + } + return result2; + } + ts2.mapAllOrFail = mapAllOrFail; + function mapDefined(array, mapFn) { + var result2 = []; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var mapped = mapFn(array[i7], i7); + if (mapped !== void 0) { + result2.push(mapped); + } + } + } + return result2; + } + ts2.mapDefined = mapDefined; + function mapDefinedIterator(iter, mapFn) { + return { + next: function() { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value2 = mapFn(res.value); + if (value2 !== void 0) { + return { value: value2, done: false }; + } + } + } + }; + } + ts2.mapDefinedIterator = mapDefinedIterator; + function mapDefinedEntries(map5, f8) { + if (!map5) { + return void 0; + } + var result2 = new ts2.Map(); + map5.forEach(function(value2, key) { + var entry = f8(key, value2); + if (entry !== void 0) { + var newKey = entry[0], newValue = entry[1]; + if (newKey !== void 0 && newValue !== void 0) { + result2.set(newKey, newValue); + } + } + }); + return result2; + } + ts2.mapDefinedEntries = mapDefinedEntries; + function mapDefinedValues(set4, f8) { + if (set4) { + var result_1 = new ts2.Set(); + set4.forEach(function(value2) { + var newValue = f8(value2); + if (newValue !== void 0) { + result_1.add(newValue); + } + }); + return result_1; + } + } + ts2.mapDefinedValues = mapDefinedValues; + function getOrUpdate(map5, key, callback) { + if (map5.has(key)) { + return map5.get(key); + } + var value2 = callback(); + map5.set(key, value2); + return value2; + } + ts2.getOrUpdate = getOrUpdate; + function tryAddToSet(set4, value2) { + if (!set4.has(value2)) { + set4.add(value2); + return true; + } + return false; + } + ts2.tryAddToSet = tryAddToSet; + ts2.emptyIterator = { next: function() { + return { value: void 0, done: true }; + } }; + function singleIterator(value2) { + var done = false; + return { + next: function() { + var wasDone = done; + done = true; + return wasDone ? { value: void 0, done: true } : { value: value2, done: false }; + } + }; + } + ts2.singleIterator = singleIterator; + function spanMap(array, keyfn, mapfn) { + var result2; + if (array) { + result2 = []; + var len = array.length; + var previousKey = void 0; + var key = void 0; + var start = 0; + var pos = 0; + while (start < len) { + while (pos < len) { + var value2 = array[pos]; + key = keyfn(value2, pos); + if (pos === 0) { + previousKey = key; + } else if (key !== previousKey) { + break; + } + pos++; + } + if (start < pos) { + var v8 = mapfn(array.slice(start, pos), previousKey, start, pos); + if (v8) { + result2.push(v8); + } + start = pos; + } + previousKey = key; + pos++; + } + } + return result2; + } + ts2.spanMap = spanMap; + function mapEntries(map5, f8) { + if (!map5) { + return void 0; + } + var result2 = new ts2.Map(); + map5.forEach(function(value2, key) { + var _a2 = f8(key, value2), newKey = _a2[0], newValue = _a2[1]; + result2.set(newKey, newValue); + }); + return result2; + } + ts2.mapEntries = mapEntries; + function some2(array, predicate) { + if (array) { + if (predicate) { + for (var _i = 0, array_3 = array; _i < array_3.length; _i++) { + var v8 = array_3[_i]; + if (predicate(v8)) { + return true; + } + } + } else { + return array.length > 0; + } + } + return false; + } + ts2.some = some2; + function getRangesWhere(arr, pred, cb) { + var start; + for (var i7 = 0; i7 < arr.length; i7++) { + if (pred(arr[i7])) { + start = start === void 0 ? i7 : start; + } else { + if (start !== void 0) { + cb(start, i7); + start = void 0; + } + } + } + if (start !== void 0) + cb(start, arr.length); + } + ts2.getRangesWhere = getRangesWhere; + function concatenate(array1, array2) { + if (!some2(array2)) + return array1; + if (!some2(array1)) + return array2; + return __spreadArray9(__spreadArray9([], array1, true), array2, true); + } + ts2.concatenate = concatenate; + function selectIndex(_6, i7) { + return i7; + } + function indicesOf(array) { + return array.map(selectIndex); + } + ts2.indicesOf = indicesOf; + function deduplicateRelational(array, equalityComparer, comparer) { + var indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + var last3 = array[indices[0]]; + var deduplicated = [indices[0]]; + for (var i7 = 1; i7 < indices.length; i7++) { + var index4 = indices[i7]; + var item = array[index4]; + if (!equalityComparer(last3, item)) { + deduplicated.push(index4); + last3 = item; + } + } + deduplicated.sort(); + return deduplicated.map(function(i8) { + return array[i8]; + }); + } + function deduplicateEquality(array, equalityComparer) { + var result2 = []; + for (var _i = 0, array_4 = array; _i < array_4.length; _i++) { + var item = array_4[_i]; + pushIfUnique(result2, item, equalityComparer); + } + return result2; + } + function deduplicate(array, equalityComparer, comparer) { + return array.length === 0 ? [] : array.length === 1 ? array.slice() : comparer ? deduplicateRelational(array, equalityComparer, comparer) : deduplicateEquality(array, equalityComparer); + } + ts2.deduplicate = deduplicate; + function deduplicateSorted(array, comparer) { + if (array.length === 0) + return ts2.emptyArray; + var last3 = array[0]; + var deduplicated = [last3]; + for (var i7 = 1; i7 < array.length; i7++) { + var next = array[i7]; + switch (comparer(next, last3)) { + case true: + case 0: + continue; + case -1: + return ts2.Debug.fail("Array is unsorted."); + } + deduplicated.push(last3 = next); + } + return deduplicated; + } + function createSortedArray() { + return []; + } + ts2.createSortedArray = createSortedArray; + function insertSorted(array, insert, compare, allowDuplicates) { + if (array.length === 0) { + array.push(insert); + return true; + } + var insertIndex = binarySearch(array, insert, identity2, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + return true; + } + if (allowDuplicates) { + array.splice(insertIndex, 0, insert); + return true; + } + return false; + } + ts2.insertSorted = insertSorted; + function sortAndDeduplicate(array, comparer, equalityComparer) { + return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive); + } + ts2.sortAndDeduplicate = sortAndDeduplicate; + function arrayIsSorted(array, comparer) { + if (array.length < 2) + return true; + var prevElement = array[0]; + for (var _i = 0, _a2 = array.slice(1); _i < _a2.length; _i++) { + var element = _a2[_i]; + if (comparer(prevElement, element) === 1) { + return false; + } + prevElement = element; + } + return true; + } + ts2.arrayIsSorted = arrayIsSorted; + function arrayIsEqualTo(array1, array2, equalityComparer) { + if (equalityComparer === void 0) { + equalityComparer = equateValues; + } + if (!array1 || !array2) { + return array1 === array2; + } + if (array1.length !== array2.length) { + return false; + } + for (var i7 = 0; i7 < array1.length; i7++) { + if (!equalityComparer(array1[i7], array2[i7], i7)) { + return false; + } + } + return true; + } + ts2.arrayIsEqualTo = arrayIsEqualTo; + function compact2(array) { + var result2; + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + var v8 = array[i7]; + if (result2 || !v8) { + if (!result2) { + result2 = array.slice(0, i7); + } + if (v8) { + result2.push(v8); + } + } + } + } + return result2 || array; + } + ts2.compact = compact2; + function relativeComplement(arrayA, arrayB, comparer) { + if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0) + return arrayB; + var result2 = []; + loopB: + for (var offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) { + if (offsetB > 0) { + ts2.Debug.assertGreaterThanOrEqual( + comparer(arrayB[offsetB], arrayB[offsetB - 1]), + 0 + /* Comparison.EqualTo */ + ); + } + loopA: + for (var startA = offsetA; offsetA < arrayA.length; offsetA++) { + if (offsetA > startA) { + ts2.Debug.assertGreaterThanOrEqual( + comparer(arrayA[offsetA], arrayA[offsetA - 1]), + 0 + /* Comparison.EqualTo */ + ); + } + switch (comparer(arrayB[offsetB], arrayA[offsetA])) { + case -1: + result2.push(arrayB[offsetB]); + continue loopB; + case 0: + continue loopB; + case 1: + continue loopA; + } + } + } + return result2; + } + ts2.relativeComplement = relativeComplement; + function sum2(array, prop) { + var result2 = 0; + for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { + var v8 = array_5[_i]; + result2 += v8[prop]; + } + return result2; + } + ts2.sum = sum2; + function append(to, value2) { + if (value2 === void 0) + return to; + if (to === void 0) + return [value2]; + to.push(value2); + return to; + } + ts2.append = append; + function combine(xs, ys) { + if (xs === void 0) + return ys; + if (ys === void 0) + return xs; + if (isArray3(xs)) + return isArray3(ys) ? concatenate(xs, ys) : append(xs, ys); + if (isArray3(ys)) + return append(ys, xs); + return [xs, ys]; + } + ts2.combine = combine; + function toOffset(array, offset) { + return offset < 0 ? array.length + offset : offset; + } + function addRange(to, from, start, end) { + if (from === void 0 || from.length === 0) + return to; + if (to === void 0) + return from.slice(start, end); + start = start === void 0 ? 0 : toOffset(from, start); + end = end === void 0 ? from.length : toOffset(from, end); + for (var i7 = start; i7 < end && i7 < from.length; i7++) { + if (from[i7] !== void 0) { + to.push(from[i7]); + } + } + return to; + } + ts2.addRange = addRange; + function pushIfUnique(array, toAdd, equalityComparer) { + if (contains2(array, toAdd, equalityComparer)) { + return false; + } else { + array.push(toAdd); + return true; + } + } + ts2.pushIfUnique = pushIfUnique; + function appendIfUnique(array, toAdd, equalityComparer) { + if (array) { + pushIfUnique(array, toAdd, equalityComparer); + return array; + } else { + return [toAdd]; + } + } + ts2.appendIfUnique = appendIfUnique; + function stableSortIndices(array, indices, comparer) { + indices.sort(function(x7, y7) { + return comparer(array[x7], array[y7]) || compareValues(x7, y7); + }); + } + function sort(array, comparer) { + return array.length === 0 ? array : array.slice().sort(comparer); + } + ts2.sort = sort; + function arrayIterator(array) { + var i7 = 0; + return { next: function() { + if (i7 === array.length) { + return { value: void 0, done: true }; + } else { + i7++; + return { value: array[i7 - 1], done: false }; + } + } }; + } + ts2.arrayIterator = arrayIterator; + function arrayReverseIterator(array) { + var i7 = array.length; + return { + next: function() { + if (i7 === 0) { + return { value: void 0, done: true }; + } else { + i7--; + return { value: array[i7], done: false }; + } + } + }; + } + ts2.arrayReverseIterator = arrayReverseIterator; + function stableSort(array, comparer) { + var indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + return indices.map(function(i7) { + return array[i7]; + }); + } + ts2.stableSort = stableSort; + function rangeEquals(array1, array2, pos, end) { + while (pos < end) { + if (array1[pos] !== array2[pos]) { + return false; + } + pos++; + } + return true; + } + ts2.rangeEquals = rangeEquals; + function elementAt(array, offset) { + if (array) { + offset = toOffset(array, offset); + if (offset < array.length) { + return array[offset]; + } + } + return void 0; + } + ts2.elementAt = elementAt; + function firstOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[0]; + } + ts2.firstOrUndefined = firstOrUndefined; + function first(array) { + ts2.Debug.assert(array.length !== 0); + return array[0]; + } + ts2.first = first; + function lastOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; + } + ts2.lastOrUndefined = lastOrUndefined; + function last2(array) { + ts2.Debug.assert(array.length !== 0); + return array[array.length - 1]; + } + ts2.last = last2; + function singleOrUndefined(array) { + return array && array.length === 1 ? array[0] : void 0; + } + ts2.singleOrUndefined = singleOrUndefined; + function single(array) { + return ts2.Debug.checkDefined(singleOrUndefined(array)); + } + ts2.single = single; + function singleOrMany(array) { + return array && array.length === 1 ? array[0] : array; + } + ts2.singleOrMany = singleOrMany; + function replaceElement(array, index4, value2) { + var result2 = array.slice(0); + result2[index4] = value2; + return result2; + } + ts2.replaceElement = replaceElement; + function binarySearch(array, value2, keySelector, keyComparer, offset) { + return binarySearchKey(array, keySelector(value2), keySelector, keyComparer, offset); + } + ts2.binarySearch = binarySearch; + function binarySearchKey(array, key, keySelector, keyComparer, offset) { + if (!some2(array)) { + return -1; + } + var low = offset || 0; + var high = array.length - 1; + while (low <= high) { + var middle = low + (high - low >> 1); + var midKey = keySelector(array[middle], middle); + switch (keyComparer(midKey, key)) { + case -1: + low = middle + 1; + break; + case 0: + return middle; + case 1: + high = middle - 1; + break; + } + } + return ~low; + } + ts2.binarySearchKey = binarySearchKey; + function reduceLeft(array, f8, initial2, start, count2) { + if (array && array.length > 0) { + var size2 = array.length; + if (size2 > 0) { + var pos = start === void 0 || start < 0 ? 0 : start; + var end = count2 === void 0 || pos + count2 > size2 - 1 ? size2 - 1 : pos + count2; + var result2 = void 0; + if (arguments.length <= 2) { + result2 = array[pos]; + pos++; + } else { + result2 = initial2; + } + while (pos <= end) { + result2 = f8(result2, array[pos], pos); + pos++; + } + return result2; + } + } + return initial2; + } + ts2.reduceLeft = reduceLeft; + var hasOwnProperty27 = Object.prototype.hasOwnProperty; + function hasProperty(map5, key) { + return hasOwnProperty27.call(map5, key); + } + ts2.hasProperty = hasProperty; + function getProperty(map5, key) { + return hasOwnProperty27.call(map5, key) ? map5[key] : void 0; + } + ts2.getProperty = getProperty; + function getOwnKeys(map5) { + var keys2 = []; + for (var key in map5) { + if (hasOwnProperty27.call(map5, key)) { + keys2.push(key); + } + } + return keys2; + } + ts2.getOwnKeys = getOwnKeys; + function getAllKeys2(obj) { + var result2 = []; + do { + var names = Object.getOwnPropertyNames(obj); + for (var _i = 0, names_1 = names; _i < names_1.length; _i++) { + var name2 = names_1[_i]; + pushIfUnique(result2, name2); + } + } while (obj = Object.getPrototypeOf(obj)); + return result2; + } + ts2.getAllKeys = getAllKeys2; + function getOwnValues(collection) { + var values2 = []; + for (var key in collection) { + if (hasOwnProperty27.call(collection, key)) { + values2.push(collection[key]); + } + } + return values2; + } + ts2.getOwnValues = getOwnValues; + var _entries = Object.entries || function(obj) { + var keys2 = getOwnKeys(obj); + var result2 = Array(keys2.length); + for (var i7 = 0; i7 < keys2.length; i7++) { + result2[i7] = [keys2[i7], obj[keys2[i7]]]; + } + return result2; + }; + function getEntries(obj) { + return obj ? _entries(obj) : []; + } + ts2.getEntries = getEntries; + function arrayOf(count2, f8) { + var result2 = new Array(count2); + for (var i7 = 0; i7 < count2; i7++) { + result2[i7] = f8(i7); + } + return result2; + } + ts2.arrayOf = arrayOf; + function arrayFrom(iterator, map5) { + var result2 = []; + for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + result2.push(map5 ? map5(iterResult.value) : iterResult.value); + } + return result2; + } + ts2.arrayFrom = arrayFrom; + function assign3(t8) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + for (var _a2 = 0, args_1 = args; _a2 < args_1.length; _a2++) { + var arg = args_1[_a2]; + if (arg === void 0) + continue; + for (var p7 in arg) { + if (hasProperty(arg, p7)) { + t8[p7] = arg[p7]; + } + } + } + return t8; + } + ts2.assign = assign3; + function equalOwnProperties(left, right, equalityComparer) { + if (equalityComparer === void 0) { + equalityComparer = equateValues; + } + if (left === right) + return true; + if (!left || !right) + return false; + for (var key in left) { + if (hasOwnProperty27.call(left, key)) { + if (!hasOwnProperty27.call(right, key)) + return false; + if (!equalityComparer(left[key], right[key])) + return false; + } + } + for (var key in right) { + if (hasOwnProperty27.call(right, key)) { + if (!hasOwnProperty27.call(left, key)) + return false; + } + } + return true; + } + ts2.equalOwnProperties = equalOwnProperties; + function arrayToMap(array, makeKey, makeValue) { + if (makeValue === void 0) { + makeValue = identity2; + } + var result2 = new ts2.Map(); + for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { + var value2 = array_6[_i]; + var key = makeKey(value2); + if (key !== void 0) + result2.set(key, makeValue(value2)); + } + return result2; + } + ts2.arrayToMap = arrayToMap; + function arrayToNumericMap(array, makeKey, makeValue) { + if (makeValue === void 0) { + makeValue = identity2; + } + var result2 = []; + for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { + var value2 = array_7[_i]; + result2[makeKey(value2)] = makeValue(value2); + } + return result2; + } + ts2.arrayToNumericMap = arrayToNumericMap; + function arrayToMultiMap(values2, makeKey, makeValue) { + if (makeValue === void 0) { + makeValue = identity2; + } + var result2 = createMultiMap(); + for (var _i = 0, values_1 = values2; _i < values_1.length; _i++) { + var value2 = values_1[_i]; + result2.add(makeKey(value2), makeValue(value2)); + } + return result2; + } + ts2.arrayToMultiMap = arrayToMultiMap; + function group2(values2, getGroupId, resultSelector) { + if (resultSelector === void 0) { + resultSelector = identity2; + } + return arrayFrom(arrayToMultiMap(values2, getGroupId).values(), resultSelector); + } + ts2.group = group2; + function clone2(object) { + var result2 = {}; + for (var id in object) { + if (hasOwnProperty27.call(object, id)) { + result2[id] = object[id]; + } + } + return result2; + } + ts2.clone = clone2; + function extend3(first2, second) { + var result2 = {}; + for (var id in second) { + if (hasOwnProperty27.call(second, id)) { + result2[id] = second[id]; + } + } + for (var id in first2) { + if (hasOwnProperty27.call(first2, id)) { + result2[id] = first2[id]; + } + } + return result2; + } + ts2.extend = extend3; + function copyProperties(first2, second) { + for (var id in second) { + if (hasOwnProperty27.call(second, id)) { + first2[id] = second[id]; + } + } + } + ts2.copyProperties = copyProperties; + function maybeBind(obj, fn) { + return fn ? fn.bind(obj) : void 0; + } + ts2.maybeBind = maybeBind; + function createMultiMap() { + var map5 = new ts2.Map(); + map5.add = multiMapAdd; + map5.remove = multiMapRemove; + return map5; + } + ts2.createMultiMap = createMultiMap; + function multiMapAdd(key, value2) { + var values2 = this.get(key); + if (values2) { + values2.push(value2); + } else { + this.set(key, values2 = [value2]); + } + return values2; + } + function multiMapRemove(key, value2) { + var values2 = this.get(key); + if (values2) { + unorderedRemoveItem(values2, value2); + if (!values2.length) { + this.delete(key); + } + } + } + function createUnderscoreEscapedMultiMap() { + return createMultiMap(); + } + ts2.createUnderscoreEscapedMultiMap = createUnderscoreEscapedMultiMap; + function createQueue(items) { + var elements = (items === null || items === void 0 ? void 0 : items.slice()) || []; + var headIndex = 0; + function isEmpty4() { + return headIndex === elements.length; + } + function enqueue() { + var items2 = []; + for (var _i = 0; _i < arguments.length; _i++) { + items2[_i] = arguments[_i]; + } + elements.push.apply(elements, items2); + } + function dequeue() { + if (isEmpty4()) { + throw new Error("Queue is empty"); + } + var result2 = elements[headIndex]; + elements[headIndex] = void 0; + headIndex++; + if (headIndex > 100 && headIndex > elements.length >> 1) { + var newLength = elements.length - headIndex; + elements.copyWithin( + /*target*/ + 0, + /*start*/ + headIndex + ); + elements.length = newLength; + headIndex = 0; + } + return result2; + } + return { + enqueue, + dequeue, + isEmpty: isEmpty4 + }; + } + ts2.createQueue = createQueue; + function createSet2(getHashCode, equals) { + var multiMap = new ts2.Map(); + var size2 = 0; + function getElementIterator() { + var valueIt = multiMap.values(); + var arrayIt; + return { + next: function() { + while (true) { + if (arrayIt) { + var n7 = arrayIt.next(); + if (!n7.done) { + return { value: n7.value }; + } + arrayIt = void 0; + } else { + var n7 = valueIt.next(); + if (n7.done) { + return { value: void 0, done: true }; + } + if (!isArray3(n7.value)) { + return { value: n7.value }; + } + arrayIt = arrayIterator(n7.value); + } + } + } + }; + } + var set4 = { + has: function(element) { + var hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + var candidates = multiMap.get(hash); + if (!isArray3(candidates)) + return equals(candidates, element); + for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { + var candidate = candidates_1[_i]; + if (equals(candidate, element)) { + return true; + } + } + return false; + }, + add: function(element) { + var hash = getHashCode(element); + if (multiMap.has(hash)) { + var values2 = multiMap.get(hash); + if (isArray3(values2)) { + if (!contains2(values2, element, equals)) { + values2.push(element); + size2++; + } + } else { + var value2 = values2; + if (!equals(value2, element)) { + multiMap.set(hash, [value2, element]); + size2++; + } + } + } else { + multiMap.set(hash, element); + size2++; + } + return this; + }, + delete: function(element) { + var hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + var candidates = multiMap.get(hash); + if (isArray3(candidates)) { + for (var i7 = 0; i7 < candidates.length; i7++) { + if (equals(candidates[i7], element)) { + if (candidates.length === 1) { + multiMap.delete(hash); + } else if (candidates.length === 2) { + multiMap.set(hash, candidates[1 - i7]); + } else { + unorderedRemoveItemAt(candidates, i7); + } + size2--; + return true; + } + } + } else { + var candidate = candidates; + if (equals(candidate, element)) { + multiMap.delete(hash); + size2--; + return true; + } + } + return false; + }, + clear: function() { + multiMap.clear(); + size2 = 0; + }, + get size() { + return size2; + }, + forEach: function(action) { + for (var _i = 0, _a2 = arrayFrom(multiMap.values()); _i < _a2.length; _i++) { + var elements = _a2[_i]; + if (isArray3(elements)) { + for (var _b = 0, elements_1 = elements; _b < elements_1.length; _b++) { + var element = elements_1[_b]; + action(element, element); + } + } else { + var element = elements; + action(element, element); + } + } + }, + keys: function() { + return getElementIterator(); + }, + values: function() { + return getElementIterator(); + }, + entries: function() { + var it2 = getElementIterator(); + return { + next: function() { + var n7 = it2.next(); + return n7.done ? n7 : { value: [n7.value, n7.value] }; + } + }; + } + }; + return set4; + } + ts2.createSet = createSet2; + function isArray3(value2) { + return Array.isArray ? Array.isArray(value2) : value2 instanceof Array; + } + ts2.isArray = isArray3; + function toArray3(value2) { + return isArray3(value2) ? value2 : [value2]; + } + ts2.toArray = toArray3; + function isString4(text) { + return typeof text === "string"; + } + ts2.isString = isString4; + function isNumber3(x7) { + return typeof x7 === "number"; + } + ts2.isNumber = isNumber3; + function tryCast(value2, test) { + return value2 !== void 0 && test(value2) ? value2 : void 0; + } + ts2.tryCast = tryCast; + function cast(value2, test) { + if (value2 !== void 0 && test(value2)) + return value2; + return ts2.Debug.fail("Invalid cast. The supplied value ".concat(value2, " did not pass the test '").concat(ts2.Debug.getFunctionName(test), "'.")); + } + ts2.cast = cast; + function noop4(_6) { + } + ts2.noop = noop4; + ts2.noopPush = { + push: noop4, + length: 0 + }; + function returnFalse() { + return false; + } + ts2.returnFalse = returnFalse; + function returnTrue() { + return true; + } + ts2.returnTrue = returnTrue; + function returnUndefined() { + return void 0; + } + ts2.returnUndefined = returnUndefined; + function identity2(x7) { + return x7; + } + ts2.identity = identity2; + function toLowerCase(x7) { + return x7.toLowerCase(); + } + ts2.toLowerCase = toLowerCase; + var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g; + function toFileNameLowerCase(x7) { + return fileNameLowerCaseRegExp.test(x7) ? x7.replace(fileNameLowerCaseRegExp, toLowerCase) : x7; + } + ts2.toFileNameLowerCase = toFileNameLowerCase; + function notImplemented() { + throw new Error("Not implemented"); + } + ts2.notImplemented = notImplemented; + function memoize2(callback) { + var value2; + return function() { + if (callback) { + value2 = callback(); + callback = void 0; + } + return value2; + }; + } + ts2.memoize = memoize2; + function memoizeOne(callback) { + var map5 = new ts2.Map(); + return function(arg) { + var key = "".concat(typeof arg, ":").concat(arg); + var value2 = map5.get(key); + if (value2 === void 0 && !map5.has(key)) { + value2 = callback(arg); + map5.set(key, value2); + } + return value2; + }; + } + ts2.memoizeOne = memoizeOne; + function compose(a7, b8, c7, d7, e10) { + if (!!e10) { + var args_2 = []; + for (var i7 = 0; i7 < arguments.length; i7++) { + args_2[i7] = arguments[i7]; + } + return function(t8) { + return reduceLeft(args_2, function(u7, f8) { + return f8(u7); + }, t8); + }; + } else if (d7) { + return function(t8) { + return d7(c7(b8(a7(t8)))); + }; + } else if (c7) { + return function(t8) { + return c7(b8(a7(t8))); + }; + } else if (b8) { + return function(t8) { + return b8(a7(t8)); + }; + } else if (a7) { + return function(t8) { + return a7(t8); + }; + } else { + return function(t8) { + return t8; + }; + } + } + ts2.compose = compose; + var AssertionLevel; + (function(AssertionLevel2) { + AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; + AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; + AssertionLevel2[AssertionLevel2["Aggressive"] = 2] = "Aggressive"; + AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive"; + })(AssertionLevel = ts2.AssertionLevel || (ts2.AssertionLevel = {})); + function equateValues(a7, b8) { + return a7 === b8; + } + ts2.equateValues = equateValues; + function equateStringsCaseInsensitive(a7, b8) { + return a7 === b8 || a7 !== void 0 && b8 !== void 0 && a7.toUpperCase() === b8.toUpperCase(); + } + ts2.equateStringsCaseInsensitive = equateStringsCaseInsensitive; + function equateStringsCaseSensitive(a7, b8) { + return equateValues(a7, b8); + } + ts2.equateStringsCaseSensitive = equateStringsCaseSensitive; + function compareComparableValues(a7, b8) { + return a7 === b8 ? 0 : a7 === void 0 ? -1 : b8 === void 0 ? 1 : a7 < b8 ? -1 : 1; + } + function compareValues(a7, b8) { + return compareComparableValues(a7, b8); + } + ts2.compareValues = compareValues; + function compareTextSpans(a7, b8) { + return compareValues(a7 === null || a7 === void 0 ? void 0 : a7.start, b8 === null || b8 === void 0 ? void 0 : b8.start) || compareValues(a7 === null || a7 === void 0 ? void 0 : a7.length, b8 === null || b8 === void 0 ? void 0 : b8.length); + } + ts2.compareTextSpans = compareTextSpans; + function min2(items, compare) { + return reduceLeft(items, function(x7, y7) { + return compare(x7, y7) === -1 ? x7 : y7; + }); + } + ts2.min = min2; + function compareStringsCaseInsensitive(a7, b8) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + a7 = a7.toUpperCase(); + b8 = b8.toUpperCase(); + return a7 < b8 ? -1 : a7 > b8 ? 1 : 0; + } + ts2.compareStringsCaseInsensitive = compareStringsCaseInsensitive; + function compareStringsCaseSensitive(a7, b8) { + return compareComparableValues(a7, b8); + } + ts2.compareStringsCaseSensitive = compareStringsCaseSensitive; + function getStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive; + } + ts2.getStringComparer = getStringComparer; + var createUIStringComparer = function() { + var defaultComparer; + var enUSComparer; + var stringComparerFactory = getStringComparerFactory(); + return createStringComparer; + function compareWithCallback(a7, b8, comparer) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + var value2 = comparer(a7, b8); + return value2 < 0 ? -1 : value2 > 0 ? 1 : 0; + } + function createIntlCollatorStringComparer(locale) { + var comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare; + return function(a7, b8) { + return compareWithCallback(a7, b8, comparer); + }; + } + function createLocaleCompareStringComparer(locale) { + if (locale !== void 0) + return createFallbackStringComparer(); + return function(a7, b8) { + return compareWithCallback(a7, b8, compareStrings); + }; + function compareStrings(a7, b8) { + return a7.localeCompare(b8); + } + } + function createFallbackStringComparer() { + return function(a7, b8) { + return compareWithCallback(a7, b8, compareDictionaryOrder); + }; + function compareDictionaryOrder(a7, b8) { + return compareStrings(a7.toUpperCase(), b8.toUpperCase()) || compareStrings(a7, b8); + } + function compareStrings(a7, b8) { + return a7 < b8 ? -1 : a7 > b8 ? 1 : 0; + } + } + function getStringComparerFactory() { + if (typeof Intl === "object" && typeof Intl.Collator === "function") { + return createIntlCollatorStringComparer; + } + if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) { + return createLocaleCompareStringComparer; + } + return createFallbackStringComparer; + } + function createStringComparer(locale) { + if (locale === void 0) { + return defaultComparer || (defaultComparer = stringComparerFactory(locale)); + } else if (locale === "en-US") { + return enUSComparer || (enUSComparer = stringComparerFactory(locale)); + } else { + return stringComparerFactory(locale); + } + } + }(); + var uiComparerCaseSensitive; + var uiLocale; + function getUILocale() { + return uiLocale; + } + ts2.getUILocale = getUILocale; + function setUILocale(value2) { + if (uiLocale !== value2) { + uiLocale = value2; + uiComparerCaseSensitive = void 0; + } + } + ts2.setUILocale = setUILocale; + function compareStringsCaseSensitiveUI(a7, b8) { + var comparer = uiComparerCaseSensitive || (uiComparerCaseSensitive = createUIStringComparer(uiLocale)); + return comparer(a7, b8); + } + ts2.compareStringsCaseSensitiveUI = compareStringsCaseSensitiveUI; + function compareProperties(a7, b8, key, comparer) { + return a7 === b8 ? 0 : a7 === void 0 ? -1 : b8 === void 0 ? 1 : comparer(a7[key], b8[key]); + } + ts2.compareProperties = compareProperties; + function compareBooleans(a7, b8) { + return compareValues(a7 ? 1 : 0, b8 ? 1 : 0); + } + ts2.compareBooleans = compareBooleans; + function getSpellingSuggestion(name2, candidates, getName) { + var maximumLengthDifference = Math.max(2, Math.floor(name2.length * 0.34)); + var bestDistance = Math.floor(name2.length * 0.4) + 1; + var bestCandidate; + for (var _i = 0, candidates_2 = candidates; _i < candidates_2.length; _i++) { + var candidate = candidates_2[_i]; + var candidateName = getName(candidate); + if (candidateName !== void 0 && Math.abs(candidateName.length - name2.length) <= maximumLengthDifference) { + if (candidateName === name2) { + continue; + } + if (candidateName.length < 3 && candidateName.toLowerCase() !== name2.toLowerCase()) { + continue; + } + var distance = levenshteinWithMax(name2, candidateName, bestDistance - 0.1); + if (distance === void 0) { + continue; + } + ts2.Debug.assert(distance < bestDistance); + bestDistance = distance; + bestCandidate = candidate; + } + } + return bestCandidate; + } + ts2.getSpellingSuggestion = getSpellingSuggestion; + function levenshteinWithMax(s1, s22, max2) { + var previous = new Array(s22.length + 1); + var current = new Array(s22.length + 1); + var big = max2 + 0.01; + for (var i7 = 0; i7 <= s22.length; i7++) { + previous[i7] = i7; + } + for (var i7 = 1; i7 <= s1.length; i7++) { + var c1 = s1.charCodeAt(i7 - 1); + var minJ = Math.ceil(i7 > max2 ? i7 - max2 : 1); + var maxJ = Math.floor(s22.length > max2 + i7 ? max2 + i7 : s22.length); + current[0] = i7; + var colMin = i7; + for (var j6 = 1; j6 < minJ; j6++) { + current[j6] = big; + } + for (var j6 = minJ; j6 <= maxJ; j6++) { + var substitutionDistance = s1[i7 - 1].toLowerCase() === s22[j6 - 1].toLowerCase() ? previous[j6 - 1] + 0.1 : previous[j6 - 1] + 2; + var dist = c1 === s22.charCodeAt(j6 - 1) ? previous[j6 - 1] : Math.min( + /*delete*/ + previous[j6] + 1, + /*insert*/ + current[j6 - 1] + 1, + /*substitute*/ + substitutionDistance + ); + current[j6] = dist; + colMin = Math.min(colMin, dist); + } + for (var j6 = maxJ + 1; j6 <= s22.length; j6++) { + current[j6] = big; + } + if (colMin > max2) { + return void 0; + } + var temp = previous; + previous = current; + current = temp; + } + var res = previous[s22.length]; + return res > max2 ? void 0 : res; + } + function endsWith2(str2, suffix) { + var expectedPos = str2.length - suffix.length; + return expectedPos >= 0 && str2.indexOf(suffix, expectedPos) === expectedPos; + } + ts2.endsWith = endsWith2; + function removeSuffix(str2, suffix) { + return endsWith2(str2, suffix) ? str2.slice(0, str2.length - suffix.length) : str2; + } + ts2.removeSuffix = removeSuffix; + function tryRemoveSuffix(str2, suffix) { + return endsWith2(str2, suffix) ? str2.slice(0, str2.length - suffix.length) : void 0; + } + ts2.tryRemoveSuffix = tryRemoveSuffix; + function stringContains(str2, substring) { + return str2.indexOf(substring) !== -1; + } + ts2.stringContains = stringContains; + function removeMinAndVersionNumbers(fileName) { + var end = fileName.length; + for (var pos = end - 1; pos > 0; pos--) { + var ch = fileName.charCodeAt(pos); + if (ch >= 48 && ch <= 57) { + do { + --pos; + ch = fileName.charCodeAt(pos); + } while (pos > 0 && ch >= 48 && ch <= 57); + } else if (pos > 4 && (ch === 110 || ch === 78)) { + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 105 && ch !== 73) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 109 && ch !== 77) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + } else { + break; + } + if (ch !== 45 && ch !== 46) { + break; + } + end = pos; + } + return end === fileName.length ? fileName : fileName.slice(0, end); + } + ts2.removeMinAndVersionNumbers = removeMinAndVersionNumbers; + function orderedRemoveItem(array, item) { + for (var i7 = 0; i7 < array.length; i7++) { + if (array[i7] === item) { + orderedRemoveItemAt(array, i7); + return true; + } + } + return false; + } + ts2.orderedRemoveItem = orderedRemoveItem; + function orderedRemoveItemAt(array, index4) { + for (var i7 = index4; i7 < array.length - 1; i7++) { + array[i7] = array[i7 + 1]; + } + array.pop(); + } + ts2.orderedRemoveItemAt = orderedRemoveItemAt; + function unorderedRemoveItemAt(array, index4) { + array[index4] = array[array.length - 1]; + array.pop(); + } + ts2.unorderedRemoveItemAt = unorderedRemoveItemAt; + function unorderedRemoveItem(array, item) { + return unorderedRemoveFirstItemWhere(array, function(element) { + return element === item; + }); + } + ts2.unorderedRemoveItem = unorderedRemoveItem; + function unorderedRemoveFirstItemWhere(array, predicate) { + for (var i7 = 0; i7 < array.length; i7++) { + if (predicate(array[i7])) { + unorderedRemoveItemAt(array, i7); + return true; + } + } + return false; + } + function createGetCanonicalFileName(useCaseSensitiveFileNames) { + return useCaseSensitiveFileNames ? identity2 : toFileNameLowerCase; + } + ts2.createGetCanonicalFileName = createGetCanonicalFileName; + function patternText(_a2) { + var prefix = _a2.prefix, suffix = _a2.suffix; + return "".concat(prefix, "*").concat(suffix); + } + ts2.patternText = patternText; + function matchedText(pattern5, candidate) { + ts2.Debug.assert(isPatternMatch(pattern5, candidate)); + return candidate.substring(pattern5.prefix.length, candidate.length - pattern5.suffix.length); + } + ts2.matchedText = matchedText; + function findBestPatternMatch(values2, getPattern, candidate) { + var matchedValue; + var longestMatchPrefixLength = -1; + for (var _i = 0, values_2 = values2; _i < values_2.length; _i++) { + var v8 = values_2[_i]; + var pattern5 = getPattern(v8); + if (isPatternMatch(pattern5, candidate) && pattern5.prefix.length > longestMatchPrefixLength) { + longestMatchPrefixLength = pattern5.prefix.length; + matchedValue = v8; + } + } + return matchedValue; + } + ts2.findBestPatternMatch = findBestPatternMatch; + function startsWith2(str2, prefix) { + return str2.lastIndexOf(prefix, 0) === 0; + } + ts2.startsWith = startsWith2; + function removePrefix(str2, prefix) { + return startsWith2(str2, prefix) ? str2.substr(prefix.length) : str2; + } + ts2.removePrefix = removePrefix; + function tryRemovePrefix(str2, prefix, getCanonicalFileName) { + if (getCanonicalFileName === void 0) { + getCanonicalFileName = identity2; + } + return startsWith2(getCanonicalFileName(str2), getCanonicalFileName(prefix)) ? str2.substring(prefix.length) : void 0; + } + ts2.tryRemovePrefix = tryRemovePrefix; + function isPatternMatch(_a2, candidate) { + var prefix = _a2.prefix, suffix = _a2.suffix; + return candidate.length >= prefix.length + suffix.length && startsWith2(candidate, prefix) && endsWith2(candidate, suffix); + } + ts2.isPatternMatch = isPatternMatch; + function and(f8, g7) { + return function(arg) { + return f8(arg) && g7(arg); + }; + } + ts2.and = and; + function or() { + var fs = []; + for (var _i = 0; _i < arguments.length; _i++) { + fs[_i] = arguments[_i]; + } + return function() { + var args = []; + for (var _i2 = 0; _i2 < arguments.length; _i2++) { + args[_i2] = arguments[_i2]; + } + var lastResult; + for (var _a2 = 0, fs_1 = fs; _a2 < fs_1.length; _a2++) { + var f8 = fs_1[_a2]; + lastResult = f8.apply(void 0, args); + if (lastResult) { + return lastResult; + } + } + return lastResult; + }; + } + ts2.or = or; + function not(fn) { + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !fn.apply(void 0, args); + }; + } + ts2.not = not; + function assertType(_6) { + } + ts2.assertType = assertType; + function singleElementArray(t8) { + return t8 === void 0 ? void 0 : [t8]; + } + ts2.singleElementArray = singleElementArray; + function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { + unchanged = unchanged || noop4; + var newIndex = 0; + var oldIndex = 0; + var newLen = newItems.length; + var oldLen = oldItems.length; + var hasChanges = false; + while (newIndex < newLen && oldIndex < oldLen) { + var newItem = newItems[newIndex]; + var oldItem = oldItems[oldIndex]; + var compareResult = comparer(newItem, oldItem); + if (compareResult === -1) { + inserted(newItem); + newIndex++; + hasChanges = true; + } else if (compareResult === 1) { + deleted(oldItem); + oldIndex++; + hasChanges = true; + } else { + unchanged(oldItem, newItem); + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + hasChanges = true; + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + hasChanges = true; + } + return hasChanges; + } + ts2.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; + function fill2(length2, cb) { + var result2 = Array(length2); + for (var i7 = 0; i7 < length2; i7++) { + result2[i7] = cb(i7); + } + return result2; + } + ts2.fill = fill2; + function cartesianProduct(arrays) { + var result2 = []; + cartesianProductWorker( + arrays, + result2, + /*outer*/ + void 0, + 0 + ); + return result2; + } + ts2.cartesianProduct = cartesianProduct; + function cartesianProductWorker(arrays, result2, outer, index4) { + for (var _i = 0, _a2 = arrays[index4]; _i < _a2.length; _i++) { + var element = _a2[_i]; + var inner = void 0; + if (outer) { + inner = outer.slice(); + inner.push(element); + } else { + inner = [element]; + } + if (index4 === arrays.length - 1) { + result2.push(inner); + } else { + cartesianProductWorker(arrays, result2, inner, index4 + 1); + } + } + } + function padLeft(s7, length2, padString) { + if (padString === void 0) { + padString = " "; + } + return length2 <= s7.length ? s7 : padString.repeat(length2 - s7.length) + s7; + } + ts2.padLeft = padLeft; + function padRight(s7, length2, padString) { + if (padString === void 0) { + padString = " "; + } + return length2 <= s7.length ? s7 : s7 + padString.repeat(length2 - s7.length); + } + ts2.padRight = padRight; + function takeWhile2(array, predicate) { + var len = array.length; + var index4 = 0; + while (index4 < len && predicate(array[index4])) { + index4++; + } + return array.slice(0, index4); + } + ts2.takeWhile = takeWhile2; + ts2.trimString = !!String.prototype.trim ? function(s7) { + return s7.trim(); + } : function(s7) { + return ts2.trimStringEnd(ts2.trimStringStart(s7)); + }; + ts2.trimStringEnd = !!String.prototype.trimEnd ? function(s7) { + return s7.trimEnd(); + } : trimEndImpl; + ts2.trimStringStart = !!String.prototype.trimStart ? function(s7) { + return s7.trimStart(); + } : function(s7) { + return s7.replace(/^\s+/g, ""); + }; + function trimEndImpl(s7) { + var end = s7.length - 1; + while (end >= 0) { + if (!ts2.isWhiteSpaceLike(s7.charCodeAt(end))) + break; + end--; + } + return s7.slice(0, end + 1); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var LogLevel; + (function(LogLevel2) { + LogLevel2[LogLevel2["Off"] = 0] = "Off"; + LogLevel2[LogLevel2["Error"] = 1] = "Error"; + LogLevel2[LogLevel2["Warning"] = 2] = "Warning"; + LogLevel2[LogLevel2["Info"] = 3] = "Info"; + LogLevel2[LogLevel2["Verbose"] = 4] = "Verbose"; + })(LogLevel = ts2.LogLevel || (ts2.LogLevel = {})); + var Debug; + (function(Debug2) { + var typeScriptVersion; + var currentAssertionLevel = 0; + Debug2.currentLogLevel = LogLevel.Warning; + Debug2.isDebugging = false; + Debug2.enableDeprecationWarnings = true; + function getTypeScriptVersion() { + return typeScriptVersion !== null && typeScriptVersion !== void 0 ? typeScriptVersion : typeScriptVersion = new ts2.Version(ts2.version); + } + Debug2.getTypeScriptVersion = getTypeScriptVersion; + function shouldLog(level) { + return Debug2.currentLogLevel <= level; + } + Debug2.shouldLog = shouldLog; + function logMessage(level, s7) { + if (Debug2.loggingHost && shouldLog(level)) { + Debug2.loggingHost.log(level, s7); + } + } + function log3(s7) { + logMessage(LogLevel.Info, s7); + } + Debug2.log = log3; + (function(log_1) { + function error2(s7) { + logMessage(LogLevel.Error, s7); + } + log_1.error = error2; + function warn3(s7) { + logMessage(LogLevel.Warning, s7); + } + log_1.warn = warn3; + function log4(s7) { + logMessage(LogLevel.Info, s7); + } + log_1.log = log4; + function trace2(s7) { + logMessage(LogLevel.Verbose, s7); + } + log_1.trace = trace2; + })(log3 = Debug2.log || (Debug2.log = {})); + var assertionCache = {}; + function getAssertionLevel() { + return currentAssertionLevel; + } + Debug2.getAssertionLevel = getAssertionLevel; + function setAssertionLevel(level) { + var prevAssertionLevel = currentAssertionLevel; + currentAssertionLevel = level; + if (level > prevAssertionLevel) { + for (var _i = 0, _a2 = ts2.getOwnKeys(assertionCache); _i < _a2.length; _i++) { + var key = _a2[_i]; + var cachedFunc = assertionCache[key]; + if (cachedFunc !== void 0 && Debug2[key] !== cachedFunc.assertion && level >= cachedFunc.level) { + Debug2[key] = cachedFunc; + assertionCache[key] = void 0; + } + } + } + } + Debug2.setAssertionLevel = setAssertionLevel; + function shouldAssert(level) { + return currentAssertionLevel >= level; + } + Debug2.shouldAssert = shouldAssert; + function shouldAssertFunction(level, name2) { + if (!shouldAssert(level)) { + assertionCache[name2] = { level, assertion: Debug2[name2] }; + Debug2[name2] = ts2.noop; + return false; + } + return true; + } + function fail2(message, stackCrawlMark) { + debugger; + var e10 = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure."); + if (Error.captureStackTrace) { + Error.captureStackTrace(e10, stackCrawlMark || fail2); + } + throw e10; + } + Debug2.fail = fail2; + function failBadSyntaxKind(node, message, stackCrawlMark) { + return fail2("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind); + } + Debug2.failBadSyntaxKind = failBadSyntaxKind; + function assert4(expression, message, verboseDebugInfo, stackCrawlMark) { + if (!expression) { + message = message ? "False expression: ".concat(message) : "False expression."; + if (verboseDebugInfo) { + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); + } + fail2(message, stackCrawlMark || assert4); + } + } + Debug2.assert = assert4; + function assertEqual(a7, b8, msg, msg2, stackCrawlMark) { + if (a7 !== b8) { + var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : ""; + fail2("Expected ".concat(a7, " === ").concat(b8, ". ").concat(message), stackCrawlMark || assertEqual); + } + } + Debug2.assertEqual = assertEqual; + function assertLessThan(a7, b8, msg, stackCrawlMark) { + if (a7 >= b8) { + fail2("Expected ".concat(a7, " < ").concat(b8, ". ").concat(msg || ""), stackCrawlMark || assertLessThan); + } + } + Debug2.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a7, b8, stackCrawlMark) { + if (a7 > b8) { + fail2("Expected ".concat(a7, " <= ").concat(b8), stackCrawlMark || assertLessThanOrEqual); + } + } + Debug2.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a7, b8, stackCrawlMark) { + if (a7 < b8) { + fail2("Expected ".concat(a7, " >= ").concat(b8), stackCrawlMark || assertGreaterThanOrEqual); + } + } + Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual; + function assertIsDefined(value2, message, stackCrawlMark) { + if (value2 === void 0 || value2 === null) { + fail2(message, stackCrawlMark || assertIsDefined); + } + } + Debug2.assertIsDefined = assertIsDefined; + function checkDefined(value2, message, stackCrawlMark) { + assertIsDefined(value2, message, stackCrawlMark || checkDefined); + return value2; + } + Debug2.checkDefined = checkDefined; + function assertEachIsDefined(value2, message, stackCrawlMark) { + for (var _i = 0, value_1 = value2; _i < value_1.length; _i++) { + var v8 = value_1[_i]; + assertIsDefined(v8, message, stackCrawlMark || assertEachIsDefined); + } + } + Debug2.assertEachIsDefined = assertEachIsDefined; + function checkEachDefined(value2, message, stackCrawlMark) { + assertEachIsDefined(value2, message, stackCrawlMark || checkEachDefined); + return value2; + } + Debug2.checkEachDefined = checkEachDefined; + function assertNever(member, message, stackCrawlMark) { + if (message === void 0) { + message = "Illegal value:"; + } + var detail = typeof member === "object" && ts2.hasProperty(member, "kind") && ts2.hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); + return fail2("".concat(message, " ").concat(detail), stackCrawlMark || assertNever); + } + Debug2.assertNever = assertNever; + function assertEachNode(nodes, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertEachNode")) { + assert4(test === void 0 || ts2.every(nodes, test), message || "Unexpected node.", function() { + return "Node array did not pass test '".concat(getFunctionName(test), "'."); + }, stackCrawlMark || assertEachNode); + } + } + Debug2.assertEachNode = assertEachNode; + function assertNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertNode")) { + assert4(node !== void 0 && (test === void 0 || test(node)), message || "Unexpected node.", function() { + return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); + }, stackCrawlMark || assertNode); + } + } + Debug2.assertNode = assertNode; + function assertNotNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertNotNode")) { + assert4(node === void 0 || test === void 0 || !test(node), message || "Unexpected node.", function() { + return "Node ".concat(formatSyntaxKind(node.kind), " should not have passed test '").concat(getFunctionName(test), "'."); + }, stackCrawlMark || assertNotNode); + } + } + Debug2.assertNotNode = assertNotNode; + function assertOptionalNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertOptionalNode")) { + assert4(test === void 0 || node === void 0 || test(node), message || "Unexpected node.", function() { + return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); + }, stackCrawlMark || assertOptionalNode); + } + } + Debug2.assertOptionalNode = assertOptionalNode; + function assertOptionalToken(node, kind, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertOptionalToken")) { + assert4(kind === void 0 || node === void 0 || node.kind === kind, message || "Unexpected node.", function() { + return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " was not a '").concat(formatSyntaxKind(kind), "' token."); + }, stackCrawlMark || assertOptionalToken); + } + } + Debug2.assertOptionalToken = assertOptionalToken; + function assertMissingNode(node, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertMissingNode")) { + assert4(node === void 0, message || "Unexpected node.", function() { + return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); + }, stackCrawlMark || assertMissingNode); + } + } + Debug2.assertMissingNode = assertMissingNode; + function type3(_value) { + } + Debug2.type = type3; + function getFunctionName(func) { + if (typeof func !== "function") { + return ""; + } else if (ts2.hasProperty(func, "name")) { + return func.name; + } else { + var text = Function.prototype.toString.call(func); + var match = /^function\s+([\w\$]+)\s*\(/.exec(text); + return match ? match[1] : ""; + } + } + Debug2.getFunctionName = getFunctionName; + function formatSymbol(symbol) { + return "{ name: ".concat(ts2.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts2.map(symbol.declarations, function(node) { + return formatSyntaxKind(node.kind); + }), " }"); + } + Debug2.formatSymbol = formatSymbol; + function formatEnum(value2, enumObject, isFlags) { + if (value2 === void 0) { + value2 = 0; + } + var members = getEnumMembers(enumObject); + if (value2 === 0) { + return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; + } + if (isFlags) { + var result2 = []; + var remainingFlags = value2; + for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { + var _a2 = members_1[_i], enumValue = _a2[0], enumName = _a2[1]; + if (enumValue > value2) { + break; + } + if (enumValue !== 0 && enumValue & value2) { + result2.push(enumName); + remainingFlags &= ~enumValue; + } + } + if (remainingFlags === 0) { + return result2.join("|"); + } + } else { + for (var _b = 0, members_2 = members; _b < members_2.length; _b++) { + var _c = members_2[_b], enumValue = _c[0], enumName = _c[1]; + if (enumValue === value2) { + return enumName; + } + } + } + return value2.toString(); + } + Debug2.formatEnum = formatEnum; + var enumMemberCache = new ts2.Map(); + function getEnumMembers(enumObject) { + var existing = enumMemberCache.get(enumObject); + if (existing) { + return existing; + } + var result2 = []; + for (var name2 in enumObject) { + var value2 = enumObject[name2]; + if (typeof value2 === "number") { + result2.push([value2, name2]); + } + } + var sorted = ts2.stableSort(result2, function(x7, y7) { + return ts2.compareValues(x7[0], y7[0]); + }); + enumMemberCache.set(enumObject, sorted); + return sorted; + } + function formatSyntaxKind(kind) { + return formatEnum( + kind, + ts2.SyntaxKind, + /*isFlags*/ + false + ); + } + Debug2.formatSyntaxKind = formatSyntaxKind; + function formatSnippetKind(kind) { + return formatEnum( + kind, + ts2.SnippetKind, + /*isFlags*/ + false + ); + } + Debug2.formatSnippetKind = formatSnippetKind; + function formatNodeFlags(flags) { + return formatEnum( + flags, + ts2.NodeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatNodeFlags = formatNodeFlags; + function formatModifierFlags(flags) { + return formatEnum( + flags, + ts2.ModifierFlags, + /*isFlags*/ + true + ); + } + Debug2.formatModifierFlags = formatModifierFlags; + function formatTransformFlags(flags) { + return formatEnum( + flags, + ts2.TransformFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTransformFlags = formatTransformFlags; + function formatEmitFlags(flags) { + return formatEnum( + flags, + ts2.EmitFlags, + /*isFlags*/ + true + ); + } + Debug2.formatEmitFlags = formatEmitFlags; + function formatSymbolFlags(flags) { + return formatEnum( + flags, + ts2.SymbolFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSymbolFlags = formatSymbolFlags; + function formatTypeFlags(flags) { + return formatEnum( + flags, + ts2.TypeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFlags = formatTypeFlags; + function formatSignatureFlags(flags) { + return formatEnum( + flags, + ts2.SignatureFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureFlags = formatSignatureFlags; + function formatObjectFlags(flags) { + return formatEnum( + flags, + ts2.ObjectFlags, + /*isFlags*/ + true + ); + } + Debug2.formatObjectFlags = formatObjectFlags; + function formatFlowFlags(flags) { + return formatEnum( + flags, + ts2.FlowFlags, + /*isFlags*/ + true + ); + } + Debug2.formatFlowFlags = formatFlowFlags; + function formatRelationComparisonResult(result2) { + return formatEnum( + result2, + ts2.RelationComparisonResult, + /*isFlags*/ + true + ); + } + Debug2.formatRelationComparisonResult = formatRelationComparisonResult; + function formatCheckMode(mode) { + return formatEnum( + mode, + ts2.CheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatCheckMode = formatCheckMode; + function formatSignatureCheckMode(mode) { + return formatEnum( + mode, + ts2.SignatureCheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureCheckMode = formatSignatureCheckMode; + function formatTypeFacts(facts) { + return formatEnum( + facts, + ts2.TypeFacts, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFacts = formatTypeFacts; + var isDebugInfoEnabled = false; + var extendedDebugModule; + function extendedDebug() { + enableDebugInfo(); + if (!extendedDebugModule) { + throw new Error("Debugging helpers could not be loaded."); + } + return extendedDebugModule; + } + function printControlFlowGraph(flowNode) { + return console.log(formatControlFlowGraph(flowNode)); + } + Debug2.printControlFlowGraph = printControlFlowGraph; + function formatControlFlowGraph(flowNode) { + return extendedDebug().formatControlFlowGraph(flowNode); + } + Debug2.formatControlFlowGraph = formatControlFlowGraph; + var flowNodeProto; + function attachFlowNodeDebugInfoWorker(flowNode) { + if (!("__debugFlowFlags" in flowNode)) { + Object.defineProperties(flowNode, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value: function() { + var flowHeader = this.flags & 2 ? "FlowStart" : this.flags & 4 ? "FlowBranchLabel" : this.flags & 8 ? "FlowLoopLabel" : this.flags & 16 ? "FlowAssignment" : this.flags & 32 ? "FlowTrueCondition" : this.flags & 64 ? "FlowFalseCondition" : this.flags & 128 ? "FlowSwitchClause" : this.flags & 256 ? "FlowArrayMutation" : this.flags & 512 ? "FlowCall" : this.flags & 1024 ? "FlowReduceLabel" : this.flags & 1 ? "FlowUnreachable" : "UnknownFlow"; + var remainingFlags = this.flags & ~(2048 - 1); + return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : ""); + } + }, + __debugFlowFlags: { get: function() { + return formatEnum( + this.flags, + ts2.FlowFlags, + /*isFlags*/ + true + ); + } }, + __debugToString: { value: function() { + return formatControlFlowGraph(this); + } } + }); + } + } + function attachFlowNodeDebugInfo(flowNode) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!flowNodeProto) { + flowNodeProto = Object.create(Object.prototype); + attachFlowNodeDebugInfoWorker(flowNodeProto); + } + Object.setPrototypeOf(flowNode, flowNodeProto); + } else { + attachFlowNodeDebugInfoWorker(flowNode); + } + } + } + Debug2.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; + var nodeArrayProto; + function attachNodeArrayDebugInfoWorker(array) { + if (!("__tsDebuggerDisplay" in array)) { + Object.defineProperties(array, { + __tsDebuggerDisplay: { + value: function(defaultValue) { + defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); + return "NodeArray ".concat(defaultValue); + } + } + }); + } + } + function attachNodeArrayDebugInfo(array) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!nodeArrayProto) { + nodeArrayProto = Object.create(Array.prototype); + attachNodeArrayDebugInfoWorker(nodeArrayProto); + } + Object.setPrototypeOf(array, nodeArrayProto); + } else { + attachNodeArrayDebugInfoWorker(array); + } + } + } + Debug2.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; + function enableDebugInfo() { + if (isDebugInfoEnabled) + return; + var weakTypeTextMap; + var weakNodeTextMap; + function getWeakTypeTextMap() { + if (weakTypeTextMap === void 0) { + if (typeof WeakMap === "function") + weakTypeTextMap = /* @__PURE__ */ new WeakMap(); + } + return weakTypeTextMap; + } + function getWeakNodeTextMap() { + if (weakNodeTextMap === void 0) { + if (typeof WeakMap === "function") + weakNodeTextMap = /* @__PURE__ */ new WeakMap(); + } + return weakNodeTextMap; + } + Object.defineProperties(ts2.objectAllocator.getSymbolConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value: function() { + var symbolHeader = this.flags & 33554432 ? "TransientSymbol" : "Symbol"; + var remainingSymbolFlags = this.flags & ~33554432; + return "".concat(symbolHeader, " '").concat(ts2.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : ""); + } + }, + __debugFlags: { get: function() { + return formatSymbolFlags(this.flags); + } } + }); + Object.defineProperties(ts2.objectAllocator.getTypeConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value: function() { + var typeHeader = this.flags & 98304 ? "NullableType" : this.flags & 384 ? "LiteralType ".concat(JSON.stringify(this.value)) : this.flags & 2048 ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") : this.flags & 8192 ? "UniqueESSymbolType" : this.flags & 32 ? "EnumType" : this.flags & 67359327 ? "IntrinsicType ".concat(this.intrinsicName) : this.flags & 1048576 ? "UnionType" : this.flags & 2097152 ? "IntersectionType" : this.flags & 4194304 ? "IndexType" : this.flags & 8388608 ? "IndexedAccessType" : this.flags & 16777216 ? "ConditionalType" : this.flags & 33554432 ? "SubstitutionType" : this.flags & 262144 ? "TypeParameter" : this.flags & 524288 ? this.objectFlags & 3 ? "InterfaceType" : this.objectFlags & 4 ? "TypeReference" : this.objectFlags & 8 ? "TupleType" : this.objectFlags & 16 ? "AnonymousType" : this.objectFlags & 32 ? "MappedType" : this.objectFlags & 1024 ? "ReverseMappedType" : this.objectFlags & 256 ? "EvolvingArrayType" : "ObjectType" : "Type"; + var remainingObjectFlags = this.flags & 524288 ? this.objectFlags & ~1343 : 0; + return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts2.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : ""); + } + }, + __debugFlags: { get: function() { + return formatTypeFlags(this.flags); + } }, + __debugObjectFlags: { get: function() { + return this.flags & 524288 ? formatObjectFlags(this.objectFlags) : ""; + } }, + __debugTypeToString: { + value: function() { + var map4 = getWeakTypeTextMap(); + var text = map4 === null || map4 === void 0 ? void 0 : map4.get(this); + if (text === void 0) { + text = this.checker.typeToString(this); + map4 === null || map4 === void 0 ? void 0 : map4.set(this, text); + } + return text; + } + } + }); + Object.defineProperties(ts2.objectAllocator.getSignatureConstructor().prototype, { + __debugFlags: { get: function() { + return formatSignatureFlags(this.flags); + } }, + __debugSignatureToString: { value: function() { + var _a2; + return (_a2 = this.checker) === null || _a2 === void 0 ? void 0 : _a2.signatureToString(this); + } } + }); + var nodeConstructors = [ + ts2.objectAllocator.getNodeConstructor(), + ts2.objectAllocator.getIdentifierConstructor(), + ts2.objectAllocator.getTokenConstructor(), + ts2.objectAllocator.getSourceFileConstructor() + ]; + for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) { + var ctor = nodeConstructors_1[_i]; + if (!ts2.hasProperty(ctor.prototype, "__debugKind")) { + Object.defineProperties(ctor.prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value: function() { + var nodeHeader = ts2.isGeneratedIdentifier(this) ? "GeneratedIdentifier" : ts2.isIdentifier(this) ? "Identifier '".concat(ts2.idText(this), "'") : ts2.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts2.idText(this), "'") : ts2.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) : ts2.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) : ts2.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") : ts2.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : ts2.isParameter(this) ? "ParameterDeclaration" : ts2.isConstructorDeclaration(this) ? "ConstructorDeclaration" : ts2.isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : ts2.isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : ts2.isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : ts2.isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : ts2.isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : ts2.isTypePredicateNode(this) ? "TypePredicateNode" : ts2.isTypeReferenceNode(this) ? "TypeReferenceNode" : ts2.isFunctionTypeNode(this) ? "FunctionTypeNode" : ts2.isConstructorTypeNode(this) ? "ConstructorTypeNode" : ts2.isTypeQueryNode(this) ? "TypeQueryNode" : ts2.isTypeLiteralNode(this) ? "TypeLiteralNode" : ts2.isArrayTypeNode(this) ? "ArrayTypeNode" : ts2.isTupleTypeNode(this) ? "TupleTypeNode" : ts2.isOptionalTypeNode(this) ? "OptionalTypeNode" : ts2.isRestTypeNode(this) ? "RestTypeNode" : ts2.isUnionTypeNode(this) ? "UnionTypeNode" : ts2.isIntersectionTypeNode(this) ? "IntersectionTypeNode" : ts2.isConditionalTypeNode(this) ? "ConditionalTypeNode" : ts2.isInferTypeNode(this) ? "InferTypeNode" : ts2.isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : ts2.isThisTypeNode(this) ? "ThisTypeNode" : ts2.isTypeOperatorNode(this) ? "TypeOperatorNode" : ts2.isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : ts2.isMappedTypeNode(this) ? "MappedTypeNode" : ts2.isLiteralTypeNode(this) ? "LiteralTypeNode" : ts2.isNamedTupleMember(this) ? "NamedTupleMember" : ts2.isImportTypeNode(this) ? "ImportTypeNode" : formatSyntaxKind(this.kind); + return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : ""); + } + }, + __debugKind: { get: function() { + return formatSyntaxKind(this.kind); + } }, + __debugNodeFlags: { get: function() { + return formatNodeFlags(this.flags); + } }, + __debugModifierFlags: { get: function() { + return formatModifierFlags(ts2.getEffectiveModifierFlagsNoCache(this)); + } }, + __debugTransformFlags: { get: function() { + return formatTransformFlags(this.transformFlags); + } }, + __debugIsParseTreeNode: { get: function() { + return ts2.isParseTreeNode(this); + } }, + __debugEmitFlags: { get: function() { + return formatEmitFlags(ts2.getEmitFlags(this)); + } }, + __debugGetText: { + value: function(includeTrivia) { + if (ts2.nodeIsSynthesized(this)) + return ""; + var map4 = getWeakNodeTextMap(); + var text = map4 === null || map4 === void 0 ? void 0 : map4.get(this); + if (text === void 0) { + var parseNode = ts2.getParseTreeNode(this); + var sourceFile = parseNode && ts2.getSourceFileOfNode(parseNode); + text = sourceFile ? ts2.getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; + map4 === null || map4 === void 0 ? void 0 : map4.set(this, text); + } + return text; + } + } + }); + } + } + try { + if (ts2.sys && ts2.sys.require) { + var basePath = ts2.getDirectoryPath(ts2.resolvePath(ts2.sys.getExecutingFilePath())); + var result2 = ts2.sys.require(basePath, "./compiler-debug"); + if (!result2.error) { + result2.module.init(ts2); + extendedDebugModule = result2.module; + } + } + } catch (_a2) { + } + isDebugInfoEnabled = true; + } + Debug2.enableDebugInfo = enableDebugInfo; + function formatDeprecationMessage(name2, error2, errorAfter, since, message) { + var deprecationMessage = error2 ? "DeprecationError: " : "DeprecationWarning: "; + deprecationMessage += "'".concat(name2, "' "); + deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated"; + deprecationMessage += error2 ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : "."; + deprecationMessage += message ? " ".concat(ts2.formatStringFromArgs(message, [name2], 0)) : ""; + return deprecationMessage; + } + function createErrorDeprecation(name2, errorAfter, since, message) { + var deprecationMessage = formatDeprecationMessage( + name2, + /*error*/ + true, + errorAfter, + since, + message + ); + return function() { + throw new TypeError(deprecationMessage); + }; + } + function createWarningDeprecation(name2, errorAfter, since, message) { + var hasWrittenDeprecation = false; + return function() { + if (Debug2.enableDeprecationWarnings && !hasWrittenDeprecation) { + log3.warn(formatDeprecationMessage( + name2, + /*error*/ + false, + errorAfter, + since, + message + )); + hasWrittenDeprecation = true; + } + }; + } + function createDeprecation(name2, options) { + var _a2, _b; + if (options === void 0) { + options = {}; + } + var version5 = typeof options.typeScriptVersion === "string" ? new ts2.Version(options.typeScriptVersion) : (_a2 = options.typeScriptVersion) !== null && _a2 !== void 0 ? _a2 : getTypeScriptVersion(); + var errorAfter = typeof options.errorAfter === "string" ? new ts2.Version(options.errorAfter) : options.errorAfter; + var warnAfter = typeof options.warnAfter === "string" ? new ts2.Version(options.warnAfter) : options.warnAfter; + var since = typeof options.since === "string" ? new ts2.Version(options.since) : (_b = options.since) !== null && _b !== void 0 ? _b : warnAfter; + var error2 = options.error || errorAfter && version5.compareTo(errorAfter) <= 0; + var warn3 = !warnAfter || version5.compareTo(warnAfter) >= 0; + return error2 ? createErrorDeprecation(name2, errorAfter, since, options.message) : warn3 ? createWarningDeprecation(name2, errorAfter, since, options.message) : ts2.noop; + } + Debug2.createDeprecation = createDeprecation; + function wrapFunction(deprecation, func) { + return function() { + deprecation(); + return func.apply(this, arguments); + }; + } + function deprecate2(func, options) { + var _a2; + var deprecation = createDeprecation((_a2 = options === null || options === void 0 ? void 0 : options.name) !== null && _a2 !== void 0 ? _a2 : getFunctionName(func), options); + return wrapFunction(deprecation, func); + } + Debug2.deprecate = deprecate2; + function formatVariance(varianceFlags) { + var variance = varianceFlags & 7; + var result2 = variance === 0 ? "in out" : variance === 3 ? "[bivariant]" : variance === 2 ? "in" : variance === 1 ? "out" : variance === 4 ? "[independent]" : ""; + if (varianceFlags & 8) { + result2 += " (unmeasurable)"; + } else if (varianceFlags & 16) { + result2 += " (unreliable)"; + } + return result2; + } + Debug2.formatVariance = formatVariance; + var DebugTypeMapper = ( + /** @class */ + function() { + function DebugTypeMapper2() { + } + DebugTypeMapper2.prototype.__debugToString = function() { + var _a2; + type3(this); + switch (this.kind) { + case 3: + return ((_a2 = this.debugInfo) === null || _a2 === void 0 ? void 0 : _a2.call(this)) || "(function mapper)"; + case 0: + return "".concat(this.source.__debugTypeToString(), " -> ").concat(this.target.__debugTypeToString()); + case 1: + return ts2.zipWith(this.sources, this.targets || ts2.map(this.sources, function() { + return "any"; + }), function(s7, t8) { + return "".concat(s7.__debugTypeToString(), " -> ").concat(typeof t8 === "string" ? t8 : t8.__debugTypeToString()); + }).join(", "); + case 2: + return ts2.zipWith(this.sources, this.targets, function(s7, t8) { + return "".concat(s7.__debugTypeToString(), " -> ").concat(t8().__debugTypeToString()); + }).join(", "); + case 5: + case 4: + return "m1: ".concat(this.mapper1.__debugToString().split("\n").join("\n "), "\nm2: ").concat(this.mapper2.__debugToString().split("\n").join("\n ")); + default: + return assertNever(this); + } + }; + return DebugTypeMapper2; + }() + ); + Debug2.DebugTypeMapper = DebugTypeMapper; + function attachDebugPrototypeIfDebug(mapper) { + if (Debug2.isDebugging) { + return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype); + } + return mapper; + } + Debug2.attachDebugPrototypeIfDebug = attachDebugPrototypeIfDebug; + })(Debug = ts2.Debug || (ts2.Debug = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; + var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i; + var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i; + var buildPartRegExp = /^[a-z0-9-]+$/i; + var numericIdentifierRegExp = /^(0|[1-9]\d*)$/; + var Version = ( + /** @class */ + function() { + function Version2(major, minor, patch, prerelease, build) { + if (minor === void 0) { + minor = 0; + } + if (patch === void 0) { + patch = 0; + } + if (prerelease === void 0) { + prerelease = ""; + } + if (build === void 0) { + build = ""; + } + if (typeof major === "string") { + var result2 = ts2.Debug.checkDefined(tryParseComponents(major), "Invalid version"); + major = result2.major, minor = result2.minor, patch = result2.patch, prerelease = result2.prerelease, build = result2.build; + } + ts2.Debug.assert(major >= 0, "Invalid argument: major"); + ts2.Debug.assert(minor >= 0, "Invalid argument: minor"); + ts2.Debug.assert(patch >= 0, "Invalid argument: patch"); + var prereleaseArray = prerelease ? ts2.isArray(prerelease) ? prerelease : prerelease.split(".") : ts2.emptyArray; + var buildArray = build ? ts2.isArray(build) ? build : build.split(".") : ts2.emptyArray; + ts2.Debug.assert(ts2.every(prereleaseArray, function(s7) { + return prereleasePartRegExp.test(s7); + }), "Invalid argument: prerelease"); + ts2.Debug.assert(ts2.every(buildArray, function(s7) { + return buildPartRegExp.test(s7); + }), "Invalid argument: build"); + this.major = major; + this.minor = minor; + this.patch = patch; + this.prerelease = prereleaseArray; + this.build = buildArray; + } + Version2.tryParse = function(text) { + var result2 = tryParseComponents(text); + if (!result2) + return void 0; + var major = result2.major, minor = result2.minor, patch = result2.patch, prerelease = result2.prerelease, build = result2.build; + return new Version2(major, minor, patch, prerelease, build); + }; + Version2.prototype.compareTo = function(other) { + if (this === other) + return 0; + if (other === void 0) + return 1; + return ts2.compareValues(this.major, other.major) || ts2.compareValues(this.minor, other.minor) || ts2.compareValues(this.patch, other.patch) || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + }; + Version2.prototype.increment = function(field) { + switch (field) { + case "major": + return new Version2(this.major + 1, 0, 0); + case "minor": + return new Version2(this.major, this.minor + 1, 0); + case "patch": + return new Version2(this.major, this.minor, this.patch + 1); + default: + return ts2.Debug.assertNever(field); + } + }; + Version2.prototype.with = function(fields) { + var _a2 = fields.major, major = _a2 === void 0 ? this.major : _a2, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e2 = fields.build, build = _e2 === void 0 ? this.build : _e2; + return new Version2(major, minor, patch, prerelease, build); + }; + Version2.prototype.toString = function() { + var result2 = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch); + if (ts2.some(this.prerelease)) + result2 += "-".concat(this.prerelease.join(".")); + if (ts2.some(this.build)) + result2 += "+".concat(this.build.join(".")); + return result2; + }; + Version2.zero = new Version2(0, 0, 0, ["0"]); + return Version2; + }() + ); + ts2.Version = Version; + function tryParseComponents(text) { + var match = versionRegExp.exec(text); + if (!match) + return void 0; + var major = match[1], _a2 = match[2], minor = _a2 === void 0 ? "0" : _a2, _b = match[3], patch = _b === void 0 ? "0" : _b, _c = match[4], prerelease = _c === void 0 ? "" : _c, _d = match[5], build = _d === void 0 ? "" : _d; + if (prerelease && !prereleaseRegExp.test(prerelease)) + return void 0; + if (build && !buildRegExp.test(build)) + return void 0; + return { + major: parseInt(major, 10), + minor: parseInt(minor, 10), + patch: parseInt(patch, 10), + prerelease, + build + }; + } + function comparePrereleaseIdentifiers(left, right) { + if (left === right) + return 0; + if (left.length === 0) + return right.length === 0 ? 0 : 1; + if (right.length === 0) + return -1; + var length = Math.min(left.length, right.length); + for (var i7 = 0; i7 < length; i7++) { + var leftIdentifier = left[i7]; + var rightIdentifier = right[i7]; + if (leftIdentifier === rightIdentifier) + continue; + var leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier); + var rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier); + if (leftIsNumeric || rightIsNumeric) { + if (leftIsNumeric !== rightIsNumeric) + return leftIsNumeric ? -1 : 1; + var result2 = ts2.compareValues(+leftIdentifier, +rightIdentifier); + if (result2) + return result2; + } else { + var result2 = ts2.compareStringsCaseSensitive(leftIdentifier, rightIdentifier); + if (result2) + return result2; + } + } + return ts2.compareValues(left.length, right.length); + } + var VersionRange = ( + /** @class */ + function() { + function VersionRange2(spec) { + this._alternatives = spec ? ts2.Debug.checkDefined(parseRange(spec), "Invalid range spec.") : ts2.emptyArray; + } + VersionRange2.tryParse = function(text) { + var sets = parseRange(text); + if (sets) { + var range2 = new VersionRange2(""); + range2._alternatives = sets; + return range2; + } + return void 0; + }; + VersionRange2.prototype.test = function(version5) { + if (typeof version5 === "string") + version5 = new Version(version5); + return testDisjunction(version5, this._alternatives); + }; + VersionRange2.prototype.toString = function() { + return formatDisjunction(this._alternatives); + }; + return VersionRange2; + }() + ); + ts2.VersionRange = VersionRange; + var logicalOrRegExp = /\|\|/g; + var whitespaceRegExp = /\s+/g; + var partialRegExp = /^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i; + var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i; + function parseRange(text) { + var alternatives = []; + for (var _i = 0, _a2 = ts2.trimString(text).split(logicalOrRegExp); _i < _a2.length; _i++) { + var range2 = _a2[_i]; + if (!range2) + continue; + var comparators = []; + range2 = ts2.trimString(range2); + var match = hyphenRegExp.exec(range2); + if (match) { + if (!parseHyphen(match[1], match[2], comparators)) + return void 0; + } else { + for (var _b = 0, _c = range2.split(whitespaceRegExp); _b < _c.length; _b++) { + var simple = _c[_b]; + var match_1 = rangeRegExp.exec(ts2.trimString(simple)); + if (!match_1 || !parseComparator(match_1[1], match_1[2], comparators)) + return void 0; + } + } + alternatives.push(comparators); + } + return alternatives; + } + function parsePartial(text) { + var match = partialRegExp.exec(text); + if (!match) + return void 0; + var major = match[1], _a2 = match[2], minor = _a2 === void 0 ? "*" : _a2, _b = match[3], patch = _b === void 0 ? "*" : _b, prerelease = match[4], build = match[5]; + var version5 = new Version(isWildcard(major) ? 0 : parseInt(major, 10), isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), prerelease, build); + return { version: version5, major, minor, patch }; + } + function parseHyphen(left, right, comparators) { + var leftResult = parsePartial(left); + if (!leftResult) + return false; + var rightResult = parsePartial(right); + if (!rightResult) + return false; + if (!isWildcard(leftResult.major)) { + comparators.push(createComparator(">=", leftResult.version)); + } + if (!isWildcard(rightResult.major)) { + comparators.push(isWildcard(rightResult.minor) ? createComparator("<", rightResult.version.increment("major")) : isWildcard(rightResult.patch) ? createComparator("<", rightResult.version.increment("minor")) : createComparator("<=", rightResult.version)); + } + return true; + } + function parseComparator(operator, text, comparators) { + var result2 = parsePartial(text); + if (!result2) + return false; + var version5 = result2.version, major = result2.major, minor = result2.minor, patch = result2.patch; + if (!isWildcard(major)) { + switch (operator) { + case "~": + comparators.push(createComparator(">=", version5)); + comparators.push(createComparator("<", version5.increment(isWildcard(minor) ? "major" : "minor"))); + break; + case "^": + comparators.push(createComparator(">=", version5)); + comparators.push(createComparator("<", version5.increment(version5.major > 0 || isWildcard(minor) ? "major" : version5.minor > 0 || isWildcard(patch) ? "minor" : "patch"))); + break; + case "<": + case ">=": + comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version5.with({ prerelease: "0" })) : createComparator(operator, version5)); + break; + case "<=": + case ">": + comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version5.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version5.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version5)); + break; + case "=": + case void 0: + if (isWildcard(minor) || isWildcard(patch)) { + comparators.push(createComparator(">=", version5.with({ prerelease: "0" }))); + comparators.push(createComparator("<", version5.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" }))); + } else { + comparators.push(createComparator("=", version5)); + } + break; + default: + return false; + } + } else if (operator === "<" || operator === ">") { + comparators.push(createComparator("<", Version.zero)); + } + return true; + } + function isWildcard(part) { + return part === "*" || part === "x" || part === "X"; + } + function createComparator(operator, operand) { + return { operator, operand }; + } + function testDisjunction(version5, alternatives) { + if (alternatives.length === 0) + return true; + for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) { + var alternative = alternatives_1[_i]; + if (testAlternative(version5, alternative)) + return true; + } + return false; + } + function testAlternative(version5, comparators) { + for (var _i = 0, comparators_1 = comparators; _i < comparators_1.length; _i++) { + var comparator = comparators_1[_i]; + if (!testComparator(version5, comparator.operator, comparator.operand)) + return false; + } + return true; + } + function testComparator(version5, operator, operand) { + var cmp = version5.compareTo(operand); + switch (operator) { + case "<": + return cmp < 0; + case "<=": + return cmp <= 0; + case ">": + return cmp > 0; + case ">=": + return cmp >= 0; + case "=": + return cmp === 0; + default: + return ts2.Debug.assertNever(operator); + } + } + function formatDisjunction(alternatives) { + return ts2.map(alternatives, formatAlternative).join(" || ") || "*"; + } + function formatAlternative(comparators) { + return ts2.map(comparators, formatComparator).join(" "); + } + function formatComparator(comparator) { + return "".concat(comparator.operator).concat(comparator.operand); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function hasRequiredAPI(performance3, PerformanceObserver3) { + return typeof performance3 === "object" && typeof performance3.timeOrigin === "number" && typeof performance3.mark === "function" && typeof performance3.measure === "function" && typeof performance3.now === "function" && typeof performance3.clearMarks === "function" && typeof performance3.clearMeasures === "function" && typeof PerformanceObserver3 === "function"; + } + function tryGetWebPerformanceHooks() { + if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) { + return { + // For now we always write native performance events when running in the browser. We may + // make this conditional in the future if we find that native web performance hooks + // in the browser also slow down compilation. + shouldWriteNativeEvents: true, + performance, + PerformanceObserver + }; + } + } + function tryGetNodePerformanceHooks() { + if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof module5 === "object" && typeof __require === "function") { + try { + var performance_1; + var _a2 = (init_perf_hooks(), __toCommonJS(perf_hooks_exports)), nodePerformance_1 = _a2.performance, PerformanceObserver_1 = _a2.PerformanceObserver; + if (hasRequiredAPI(nodePerformance_1, PerformanceObserver_1)) { + performance_1 = nodePerformance_1; + var version_1 = new ts2.Version(process.versions.node); + var range2 = new ts2.VersionRange("<12.16.3 || 13 <13.13"); + if (range2.test(version_1)) { + performance_1 = { + get timeOrigin() { + return nodePerformance_1.timeOrigin; + }, + now: function() { + return nodePerformance_1.now(); + }, + mark: function(name2) { + return nodePerformance_1.mark(name2); + }, + measure: function(name2, start, end) { + if (start === void 0) { + start = "nodeStart"; + } + if (end === void 0) { + end = "__performance.measure-fix__"; + nodePerformance_1.mark(end); + } + nodePerformance_1.measure(name2, start, end); + if (end === "__performance.measure-fix__") { + nodePerformance_1.clearMarks("__performance.measure-fix__"); + } + }, + clearMarks: function(name2) { + return nodePerformance_1.clearMarks(name2); + }, + clearMeasures: function(name2) { + return nodePerformance_1.clearMeasures(name2); + } + }; + } + return { + // By default, only write native events when generating a cpu profile or using the v8 profiler. + shouldWriteNativeEvents: false, + performance: performance_1, + PerformanceObserver: PerformanceObserver_1 + }; + } + } catch (_b) { + } + } + } + var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); + var nativePerformance = nativePerformanceHooks === null || nativePerformanceHooks === void 0 ? void 0 : nativePerformanceHooks.performance; + function tryGetNativePerformanceHooks() { + return nativePerformanceHooks; + } + ts2.tryGetNativePerformanceHooks = tryGetNativePerformanceHooks; + ts2.timestamp = nativePerformance ? function() { + return nativePerformance.now(); + } : Date.now ? Date.now : function() { + return +/* @__PURE__ */ new Date(); + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var performance3; + (function(performance4) { + var perfHooks; + var performanceImpl; + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : performance4.nullTimer; + } + performance4.createTimerIf = createTimerIf; + function createTimer(measureName, startMarkName, endMarkName) { + var enterCount = 0; + return { + enter, + exit: exit3 + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit3() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } else if (enterCount < 0) { + ts2.Debug.fail("enter/exit count does not match."); + } + } + } + performance4.createTimer = createTimer; + performance4.nullTimer = { enter: ts2.noop, exit: ts2.noop }; + var enabled = false; + var timeorigin = ts2.timestamp(); + var marks = new ts2.Map(); + var counts = new ts2.Map(); + var durations = new ts2.Map(); + function mark(markName) { + var _a2; + if (enabled) { + var count2 = (_a2 = counts.get(markName)) !== null && _a2 !== void 0 ? _a2 : 0; + counts.set(markName, count2 + 1); + marks.set(markName, ts2.timestamp()); + performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName); + } + } + performance4.mark = mark; + function measure(measureName, startMarkName, endMarkName) { + var _a2, _b; + if (enabled) { + var end = (_a2 = endMarkName !== void 0 ? marks.get(endMarkName) : void 0) !== null && _a2 !== void 0 ? _a2 : ts2.timestamp(); + var start = (_b = startMarkName !== void 0 ? marks.get(startMarkName) : void 0) !== null && _b !== void 0 ? _b : timeorigin; + var previousDuration = durations.get(measureName) || 0; + durations.set(measureName, previousDuration + (end - start)); + performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); + } + } + performance4.measure = measure; + function getCount(markName) { + return counts.get(markName) || 0; + } + performance4.getCount = getCount; + function getDuration(measureName) { + return durations.get(measureName) || 0; + } + performance4.getDuration = getDuration; + function forEachMeasure(cb) { + durations.forEach(function(duration, measureName) { + return cb(measureName, duration); + }); + } + performance4.forEachMeasure = forEachMeasure; + function forEachMark(cb) { + marks.forEach(function(_time, markName) { + return cb(markName); + }); + } + performance4.forEachMark = forEachMark; + function clearMeasures(name2) { + if (name2 !== void 0) + durations.delete(name2); + else + durations.clear(); + performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMeasures(name2); + } + performance4.clearMeasures = clearMeasures; + function clearMarks(name2) { + if (name2 !== void 0) { + counts.delete(name2); + marks.delete(name2); + } else { + counts.clear(); + marks.clear(); + } + performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMarks(name2); + } + performance4.clearMarks = clearMarks; + function isEnabled() { + return enabled; + } + performance4.isEnabled = isEnabled; + function enable(system) { + var _a2; + if (system === void 0) { + system = ts2.sys; + } + if (!enabled) { + enabled = true; + perfHooks || (perfHooks = ts2.tryGetNativePerformanceHooks()); + if (perfHooks) { + timeorigin = perfHooks.performance.timeOrigin; + if (perfHooks.shouldWriteNativeEvents || ((_a2 = system === null || system === void 0 ? void 0 : system.cpuProfilingEnabled) === null || _a2 === void 0 ? void 0 : _a2.call(system)) || (system === null || system === void 0 ? void 0 : system.debugMode)) { + performanceImpl = perfHooks.performance; + } + } + } + return true; + } + performance4.enable = enable; + function disable() { + if (enabled) { + marks.clear(); + counts.clear(); + durations.clear(); + performanceImpl = void 0; + enabled = false; + } + } + performance4.disable = disable; + })(performance3 = ts2.performance || (ts2.performance = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var _a2; + var nullLogger = { + logEvent: ts2.noop, + logErrEvent: ts2.noop, + logPerfEvent: ts2.noop, + logInfoEvent: ts2.noop, + logStartCommand: ts2.noop, + logStopCommand: ts2.noop, + logStartUpdateProgram: ts2.noop, + logStopUpdateProgram: ts2.noop, + logStartUpdateGraph: ts2.noop, + logStopUpdateGraph: ts2.noop, + logStartResolveModule: ts2.noop, + logStopResolveModule: ts2.noop, + logStartParseSourceFile: ts2.noop, + logStopParseSourceFile: ts2.noop, + logStartReadFile: ts2.noop, + logStopReadFile: ts2.noop, + logStartBindFile: ts2.noop, + logStopBindFile: ts2.noop, + logStartScheduledOperation: ts2.noop, + logStopScheduledOperation: ts2.noop + }; + var etwModule; + try { + var etwModulePath = (_a2 = process.env.TS_ETW_MODULE_PATH) !== null && _a2 !== void 0 ? _a2 : "./node_modules/@microsoft/typescript-etw"; + etwModule = __require(etwModulePath); + } catch (e10) { + etwModule = void 0; + } + ts2.perfLogger = etwModule && etwModule.logEvent ? etwModule : nullLogger; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var tracingEnabled; + (function(tracingEnabled2) { + var fs; + var traceCount = 0; + var traceFd = 0; + var mode; + var typeCatalog = []; + var legendPath; + var legend = []; + function startTracing(tracingMode, traceDir, configFilePath) { + ts2.Debug.assert(!ts2.tracing, "Tracing already started"); + if (fs === void 0) { + try { + fs = (init_fs(), __toCommonJS(fs_exports)); + } catch (e10) { + throw new Error("tracing requires having fs\n(original error: ".concat(e10.message || e10, ")")); + } + } + mode = tracingMode; + typeCatalog.length = 0; + if (legendPath === void 0) { + legendPath = ts2.combinePaths(traceDir, "legend.json"); + } + if (!fs.existsSync(traceDir)) { + fs.mkdirSync(traceDir, { recursive: true }); + } + var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount) : mode === "server" ? ".".concat(process.pid) : ""; + var tracePath = ts2.combinePaths(traceDir, "trace".concat(countPart, ".json")); + var typesPath = ts2.combinePaths(traceDir, "types".concat(countPart, ".json")); + legend.push({ + configFilePath, + tracePath, + typesPath + }); + traceFd = fs.openSync(tracePath, "w"); + ts2.tracing = tracingEnabled2; + var meta = { cat: "__metadata", ph: "M", ts: 1e3 * ts2.timestamp(), pid: 1, tid: 1 }; + fs.writeSync(traceFd, "[\n" + [__assign16({ name: "process_name", args: { name: "tsc" } }, meta), __assign16({ name: "thread_name", args: { name: "Main" } }, meta), __assign16(__assign16({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })].map(function(v8) { + return JSON.stringify(v8); + }).join(",\n")); + } + tracingEnabled2.startTracing = startTracing; + function stopTracing() { + ts2.Debug.assert(ts2.tracing, "Tracing is not in progress"); + ts2.Debug.assert(!!typeCatalog.length === (mode !== "server")); + fs.writeSync(traceFd, "\n]\n"); + fs.closeSync(traceFd); + ts2.tracing = void 0; + if (typeCatalog.length) { + dumpTypes(typeCatalog); + } else { + legend[legend.length - 1].typesPath = void 0; + } + } + tracingEnabled2.stopTracing = stopTracing; + function recordType2(type3) { + if (mode !== "server") { + typeCatalog.push(type3); + } + } + tracingEnabled2.recordType = recordType2; + var Phase; + (function(Phase2) { + Phase2["Parse"] = "parse"; + Phase2["Program"] = "program"; + Phase2["Bind"] = "bind"; + Phase2["Check"] = "check"; + Phase2["CheckTypes"] = "checkTypes"; + Phase2["Emit"] = "emit"; + Phase2["Session"] = "session"; + })(Phase = tracingEnabled2.Phase || (tracingEnabled2.Phase = {})); + function instant(phase, name2, args) { + writeEvent("I", phase, name2, args, '"s":"g"'); + } + tracingEnabled2.instant = instant; + var eventStack = []; + function push4(phase, name2, args, separateBeginAndEnd) { + if (separateBeginAndEnd === void 0) { + separateBeginAndEnd = false; + } + if (separateBeginAndEnd) { + writeEvent("B", phase, name2, args); + } + eventStack.push({ phase, name: name2, args, time: 1e3 * ts2.timestamp(), separateBeginAndEnd }); + } + tracingEnabled2.push = push4; + function pop(results) { + ts2.Debug.assert(eventStack.length > 0); + writeStackEvent(eventStack.length - 1, 1e3 * ts2.timestamp(), results); + eventStack.length--; + } + tracingEnabled2.pop = pop; + function popAll() { + var endTime = 1e3 * ts2.timestamp(); + for (var i7 = eventStack.length - 1; i7 >= 0; i7--) { + writeStackEvent(i7, endTime); + } + eventStack.length = 0; + } + tracingEnabled2.popAll = popAll; + var sampleInterval = 1e3 * 10; + function writeStackEvent(index4, endTime, results) { + var _a2 = eventStack[index4], phase = _a2.phase, name2 = _a2.name, args = _a2.args, time2 = _a2.time, separateBeginAndEnd = _a2.separateBeginAndEnd; + if (separateBeginAndEnd) { + ts2.Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`"); + writeEvent( + "E", + phase, + name2, + args, + /*extras*/ + void 0, + endTime + ); + } else if (sampleInterval - time2 % sampleInterval <= endTime - time2) { + writeEvent("X", phase, name2, __assign16(__assign16({}, args), { results }), '"dur":'.concat(endTime - time2), time2); + } + } + function writeEvent(eventType, phase, name2, args, extras, time2) { + if (time2 === void 0) { + time2 = 1e3 * ts2.timestamp(); + } + if (mode === "server" && phase === "checkTypes") + return; + ts2.performance.mark("beginTracing"); + fs.writeSync(traceFd, ',\n{"pid":1,"tid":1,"ph":"'.concat(eventType, '","cat":"').concat(phase, '","ts":').concat(time2, ',"name":"').concat(name2, '"')); + if (extras) + fs.writeSync(traceFd, ",".concat(extras)); + if (args) + fs.writeSync(traceFd, ',"args":'.concat(JSON.stringify(args))); + fs.writeSync(traceFd, "}"); + ts2.performance.mark("endTracing"); + ts2.performance.measure("Tracing", "beginTracing", "endTracing"); + } + function getLocation2(node) { + var file = ts2.getSourceFileOfNode(node); + return !file ? void 0 : { + path: file.path, + start: indexFromOne(ts2.getLineAndCharacterOfPosition(file, node.pos)), + end: indexFromOne(ts2.getLineAndCharacterOfPosition(file, node.end)) + }; + function indexFromOne(lc) { + return { + line: lc.line + 1, + character: lc.character + 1 + }; + } + } + function dumpTypes(types3) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x; + ts2.performance.mark("beginDumpTypes"); + var typesPath = legend[legend.length - 1].typesPath; + var typesFd = fs.openSync(typesPath, "w"); + var recursionIdentityMap = new ts2.Map(); + fs.writeSync(typesFd, "["); + var numTypes = types3.length; + for (var i7 = 0; i7 < numTypes; i7++) { + var type3 = types3[i7]; + var objectFlags = type3.objectFlags; + var symbol = (_a2 = type3.aliasSymbol) !== null && _a2 !== void 0 ? _a2 : type3.symbol; + var display = void 0; + if (objectFlags & 16 | type3.flags & 2944) { + try { + display = (_b = type3.checker) === null || _b === void 0 ? void 0 : _b.typeToString(type3); + } catch (_y) { + display = void 0; + } + } + var indexedAccessProperties = {}; + if (type3.flags & 8388608) { + var indexedAccessType = type3; + indexedAccessProperties = { + indexedAccessObjectType: (_c = indexedAccessType.objectType) === null || _c === void 0 ? void 0 : _c.id, + indexedAccessIndexType: (_d = indexedAccessType.indexType) === null || _d === void 0 ? void 0 : _d.id + }; + } + var referenceProperties = {}; + if (objectFlags & 4) { + var referenceType = type3; + referenceProperties = { + instantiatedType: (_e2 = referenceType.target) === null || _e2 === void 0 ? void 0 : _e2.id, + typeArguments: (_f = referenceType.resolvedTypeArguments) === null || _f === void 0 ? void 0 : _f.map(function(t8) { + return t8.id; + }), + referenceLocation: getLocation2(referenceType.node) + }; + } + var conditionalProperties = {}; + if (type3.flags & 16777216) { + var conditionalType = type3; + conditionalProperties = { + conditionalCheckType: (_g = conditionalType.checkType) === null || _g === void 0 ? void 0 : _g.id, + conditionalExtendsType: (_h = conditionalType.extendsType) === null || _h === void 0 ? void 0 : _h.id, + conditionalTrueType: (_k = (_j = conditionalType.resolvedTrueType) === null || _j === void 0 ? void 0 : _j.id) !== null && _k !== void 0 ? _k : -1, + conditionalFalseType: (_m = (_l = conditionalType.resolvedFalseType) === null || _l === void 0 ? void 0 : _l.id) !== null && _m !== void 0 ? _m : -1 + }; + } + var substitutionProperties = {}; + if (type3.flags & 33554432) { + var substitutionType = type3; + substitutionProperties = { + substitutionBaseType: (_o = substitutionType.baseType) === null || _o === void 0 ? void 0 : _o.id, + constraintType: (_p = substitutionType.constraint) === null || _p === void 0 ? void 0 : _p.id + }; + } + var reverseMappedProperties = {}; + if (objectFlags & 1024) { + var reverseMappedType = type3; + reverseMappedProperties = { + reverseMappedSourceType: (_q = reverseMappedType.source) === null || _q === void 0 ? void 0 : _q.id, + reverseMappedMappedType: (_r = reverseMappedType.mappedType) === null || _r === void 0 ? void 0 : _r.id, + reverseMappedConstraintType: (_s = reverseMappedType.constraintType) === null || _s === void 0 ? void 0 : _s.id + }; + } + var evolvingArrayProperties = {}; + if (objectFlags & 256) { + var evolvingArrayType = type3; + evolvingArrayProperties = { + evolvingArrayElementType: evolvingArrayType.elementType.id, + evolvingArrayFinalType: (_t2 = evolvingArrayType.finalArrayType) === null || _t2 === void 0 ? void 0 : _t2.id + }; + } + var recursionToken = void 0; + var recursionIdentity = type3.checker.getRecursionIdentity(type3); + if (recursionIdentity) { + recursionToken = recursionIdentityMap.get(recursionIdentity); + if (!recursionToken) { + recursionToken = recursionIdentityMap.size; + recursionIdentityMap.set(recursionIdentity, recursionToken); + } + } + var descriptor = __assign16(__assign16(__assign16(__assign16(__assign16(__assign16(__assign16({ id: type3.id, intrinsicName: type3.intrinsicName, symbolName: (symbol === null || symbol === void 0 ? void 0 : symbol.escapedName) && ts2.unescapeLeadingUnderscores(symbol.escapedName), recursionId: recursionToken, isTuple: objectFlags & 8 ? true : void 0, unionTypes: type3.flags & 1048576 ? (_u = type3.types) === null || _u === void 0 ? void 0 : _u.map(function(t8) { + return t8.id; + }) : void 0, intersectionTypes: type3.flags & 2097152 ? type3.types.map(function(t8) { + return t8.id; + }) : void 0, aliasTypeArguments: (_v = type3.aliasTypeArguments) === null || _v === void 0 ? void 0 : _v.map(function(t8) { + return t8.id; + }), keyofType: type3.flags & 4194304 ? (_w = type3.type) === null || _w === void 0 ? void 0 : _w.id : void 0 }, indexedAccessProperties), referenceProperties), conditionalProperties), substitutionProperties), reverseMappedProperties), evolvingArrayProperties), { destructuringPattern: getLocation2(type3.pattern), firstDeclaration: getLocation2((_x = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _x === void 0 ? void 0 : _x[0]), flags: ts2.Debug.formatTypeFlags(type3.flags).split("|"), display }); + fs.writeSync(typesFd, JSON.stringify(descriptor)); + if (i7 < numTypes - 1) { + fs.writeSync(typesFd, ",\n"); + } + } + fs.writeSync(typesFd, "]\n"); + fs.closeSync(typesFd); + ts2.performance.mark("endDumpTypes"); + ts2.performance.measure("Dump types", "beginDumpTypes", "endDumpTypes"); + } + function dumpLegend() { + if (!legendPath) { + return; + } + fs.writeFileSync(legendPath, JSON.stringify(legend)); + } + tracingEnabled2.dumpLegend = dumpLegend; + })(tracingEnabled || (tracingEnabled = {})); + ts2.startTracing = tracingEnabled.startTracing; + ts2.dumpTracingLegend = tracingEnabled.dumpLegend; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var SyntaxKind; + (function(SyntaxKind2) { + SyntaxKind2[SyntaxKind2["Unknown"] = 0] = "Unknown"; + SyntaxKind2[SyntaxKind2["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind2[SyntaxKind2["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind2[SyntaxKind2["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind2[SyntaxKind2["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind2[SyntaxKind2["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind2[SyntaxKind2["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind2[SyntaxKind2["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind2[SyntaxKind2["NumericLiteral"] = 8] = "NumericLiteral"; + SyntaxKind2[SyntaxKind2["BigIntLiteral"] = 9] = "BigIntLiteral"; + SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral"; + SyntaxKind2[SyntaxKind2["JsxText"] = 11] = "JsxText"; + SyntaxKind2[SyntaxKind2["JsxTextAllWhiteSpaces"] = 12] = "JsxTextAllWhiteSpaces"; + SyntaxKind2[SyntaxKind2["RegularExpressionLiteral"] = 13] = "RegularExpressionLiteral"; + SyntaxKind2[SyntaxKind2["NoSubstitutionTemplateLiteral"] = 14] = "NoSubstitutionTemplateLiteral"; + SyntaxKind2[SyntaxKind2["TemplateHead"] = 15] = "TemplateHead"; + SyntaxKind2[SyntaxKind2["TemplateMiddle"] = 16] = "TemplateMiddle"; + SyntaxKind2[SyntaxKind2["TemplateTail"] = 17] = "TemplateTail"; + SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 18] = "OpenBraceToken"; + SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 19] = "CloseBraceToken"; + SyntaxKind2[SyntaxKind2["OpenParenToken"] = 20] = "OpenParenToken"; + SyntaxKind2[SyntaxKind2["CloseParenToken"] = 21] = "CloseParenToken"; + SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 22] = "OpenBracketToken"; + SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 23] = "CloseBracketToken"; + SyntaxKind2[SyntaxKind2["DotToken"] = 24] = "DotToken"; + SyntaxKind2[SyntaxKind2["DotDotDotToken"] = 25] = "DotDotDotToken"; + SyntaxKind2[SyntaxKind2["SemicolonToken"] = 26] = "SemicolonToken"; + SyntaxKind2[SyntaxKind2["CommaToken"] = 27] = "CommaToken"; + SyntaxKind2[SyntaxKind2["QuestionDotToken"] = 28] = "QuestionDotToken"; + SyntaxKind2[SyntaxKind2["LessThanToken"] = 29] = "LessThanToken"; + SyntaxKind2[SyntaxKind2["LessThanSlashToken"] = 30] = "LessThanSlashToken"; + SyntaxKind2[SyntaxKind2["GreaterThanToken"] = 31] = "GreaterThanToken"; + SyntaxKind2[SyntaxKind2["LessThanEqualsToken"] = 32] = "LessThanEqualsToken"; + SyntaxKind2[SyntaxKind2["GreaterThanEqualsToken"] = 33] = "GreaterThanEqualsToken"; + SyntaxKind2[SyntaxKind2["EqualsEqualsToken"] = 34] = "EqualsEqualsToken"; + SyntaxKind2[SyntaxKind2["ExclamationEqualsToken"] = 35] = "ExclamationEqualsToken"; + SyntaxKind2[SyntaxKind2["EqualsEqualsEqualsToken"] = 36] = "EqualsEqualsEqualsToken"; + SyntaxKind2[SyntaxKind2["ExclamationEqualsEqualsToken"] = 37] = "ExclamationEqualsEqualsToken"; + SyntaxKind2[SyntaxKind2["EqualsGreaterThanToken"] = 38] = "EqualsGreaterThanToken"; + SyntaxKind2[SyntaxKind2["PlusToken"] = 39] = "PlusToken"; + SyntaxKind2[SyntaxKind2["MinusToken"] = 40] = "MinusToken"; + SyntaxKind2[SyntaxKind2["AsteriskToken"] = 41] = "AsteriskToken"; + SyntaxKind2[SyntaxKind2["AsteriskAsteriskToken"] = 42] = "AsteriskAsteriskToken"; + SyntaxKind2[SyntaxKind2["SlashToken"] = 43] = "SlashToken"; + SyntaxKind2[SyntaxKind2["PercentToken"] = 44] = "PercentToken"; + SyntaxKind2[SyntaxKind2["PlusPlusToken"] = 45] = "PlusPlusToken"; + SyntaxKind2[SyntaxKind2["MinusMinusToken"] = 46] = "MinusMinusToken"; + SyntaxKind2[SyntaxKind2["LessThanLessThanToken"] = 47] = "LessThanLessThanToken"; + SyntaxKind2[SyntaxKind2["GreaterThanGreaterThanToken"] = 48] = "GreaterThanGreaterThanToken"; + SyntaxKind2[SyntaxKind2["GreaterThanGreaterThanGreaterThanToken"] = 49] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind2[SyntaxKind2["AmpersandToken"] = 50] = "AmpersandToken"; + SyntaxKind2[SyntaxKind2["BarToken"] = 51] = "BarToken"; + SyntaxKind2[SyntaxKind2["CaretToken"] = 52] = "CaretToken"; + SyntaxKind2[SyntaxKind2["ExclamationToken"] = 53] = "ExclamationToken"; + SyntaxKind2[SyntaxKind2["TildeToken"] = 54] = "TildeToken"; + SyntaxKind2[SyntaxKind2["AmpersandAmpersandToken"] = 55] = "AmpersandAmpersandToken"; + SyntaxKind2[SyntaxKind2["BarBarToken"] = 56] = "BarBarToken"; + SyntaxKind2[SyntaxKind2["QuestionToken"] = 57] = "QuestionToken"; + SyntaxKind2[SyntaxKind2["ColonToken"] = 58] = "ColonToken"; + SyntaxKind2[SyntaxKind2["AtToken"] = 59] = "AtToken"; + SyntaxKind2[SyntaxKind2["QuestionQuestionToken"] = 60] = "QuestionQuestionToken"; + SyntaxKind2[SyntaxKind2["BacktickToken"] = 61] = "BacktickToken"; + SyntaxKind2[SyntaxKind2["HashToken"] = 62] = "HashToken"; + SyntaxKind2[SyntaxKind2["EqualsToken"] = 63] = "EqualsToken"; + SyntaxKind2[SyntaxKind2["PlusEqualsToken"] = 64] = "PlusEqualsToken"; + SyntaxKind2[SyntaxKind2["MinusEqualsToken"] = 65] = "MinusEqualsToken"; + SyntaxKind2[SyntaxKind2["AsteriskEqualsToken"] = 66] = "AsteriskEqualsToken"; + SyntaxKind2[SyntaxKind2["AsteriskAsteriskEqualsToken"] = 67] = "AsteriskAsteriskEqualsToken"; + SyntaxKind2[SyntaxKind2["SlashEqualsToken"] = 68] = "SlashEqualsToken"; + SyntaxKind2[SyntaxKind2["PercentEqualsToken"] = 69] = "PercentEqualsToken"; + SyntaxKind2[SyntaxKind2["LessThanLessThanEqualsToken"] = 70] = "LessThanLessThanEqualsToken"; + SyntaxKind2[SyntaxKind2["GreaterThanGreaterThanEqualsToken"] = 71] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind2[SyntaxKind2["GreaterThanGreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind2[SyntaxKind2["AmpersandEqualsToken"] = 73] = "AmpersandEqualsToken"; + SyntaxKind2[SyntaxKind2["BarEqualsToken"] = 74] = "BarEqualsToken"; + SyntaxKind2[SyntaxKind2["BarBarEqualsToken"] = 75] = "BarBarEqualsToken"; + SyntaxKind2[SyntaxKind2["AmpersandAmpersandEqualsToken"] = 76] = "AmpersandAmpersandEqualsToken"; + SyntaxKind2[SyntaxKind2["QuestionQuestionEqualsToken"] = 77] = "QuestionQuestionEqualsToken"; + SyntaxKind2[SyntaxKind2["CaretEqualsToken"] = 78] = "CaretEqualsToken"; + SyntaxKind2[SyntaxKind2["Identifier"] = 79] = "Identifier"; + SyntaxKind2[SyntaxKind2["PrivateIdentifier"] = 80] = "PrivateIdentifier"; + SyntaxKind2[SyntaxKind2["BreakKeyword"] = 81] = "BreakKeyword"; + SyntaxKind2[SyntaxKind2["CaseKeyword"] = 82] = "CaseKeyword"; + SyntaxKind2[SyntaxKind2["CatchKeyword"] = 83] = "CatchKeyword"; + SyntaxKind2[SyntaxKind2["ClassKeyword"] = 84] = "ClassKeyword"; + SyntaxKind2[SyntaxKind2["ConstKeyword"] = 85] = "ConstKeyword"; + SyntaxKind2[SyntaxKind2["ContinueKeyword"] = 86] = "ContinueKeyword"; + SyntaxKind2[SyntaxKind2["DebuggerKeyword"] = 87] = "DebuggerKeyword"; + SyntaxKind2[SyntaxKind2["DefaultKeyword"] = 88] = "DefaultKeyword"; + SyntaxKind2[SyntaxKind2["DeleteKeyword"] = 89] = "DeleteKeyword"; + SyntaxKind2[SyntaxKind2["DoKeyword"] = 90] = "DoKeyword"; + SyntaxKind2[SyntaxKind2["ElseKeyword"] = 91] = "ElseKeyword"; + SyntaxKind2[SyntaxKind2["EnumKeyword"] = 92] = "EnumKeyword"; + SyntaxKind2[SyntaxKind2["ExportKeyword"] = 93] = "ExportKeyword"; + SyntaxKind2[SyntaxKind2["ExtendsKeyword"] = 94] = "ExtendsKeyword"; + SyntaxKind2[SyntaxKind2["FalseKeyword"] = 95] = "FalseKeyword"; + SyntaxKind2[SyntaxKind2["FinallyKeyword"] = 96] = "FinallyKeyword"; + SyntaxKind2[SyntaxKind2["ForKeyword"] = 97] = "ForKeyword"; + SyntaxKind2[SyntaxKind2["FunctionKeyword"] = 98] = "FunctionKeyword"; + SyntaxKind2[SyntaxKind2["IfKeyword"] = 99] = "IfKeyword"; + SyntaxKind2[SyntaxKind2["ImportKeyword"] = 100] = "ImportKeyword"; + SyntaxKind2[SyntaxKind2["InKeyword"] = 101] = "InKeyword"; + SyntaxKind2[SyntaxKind2["InstanceOfKeyword"] = 102] = "InstanceOfKeyword"; + SyntaxKind2[SyntaxKind2["NewKeyword"] = 103] = "NewKeyword"; + SyntaxKind2[SyntaxKind2["NullKeyword"] = 104] = "NullKeyword"; + SyntaxKind2[SyntaxKind2["ReturnKeyword"] = 105] = "ReturnKeyword"; + SyntaxKind2[SyntaxKind2["SuperKeyword"] = 106] = "SuperKeyword"; + SyntaxKind2[SyntaxKind2["SwitchKeyword"] = 107] = "SwitchKeyword"; + SyntaxKind2[SyntaxKind2["ThisKeyword"] = 108] = "ThisKeyword"; + SyntaxKind2[SyntaxKind2["ThrowKeyword"] = 109] = "ThrowKeyword"; + SyntaxKind2[SyntaxKind2["TrueKeyword"] = 110] = "TrueKeyword"; + SyntaxKind2[SyntaxKind2["TryKeyword"] = 111] = "TryKeyword"; + SyntaxKind2[SyntaxKind2["TypeOfKeyword"] = 112] = "TypeOfKeyword"; + SyntaxKind2[SyntaxKind2["VarKeyword"] = 113] = "VarKeyword"; + SyntaxKind2[SyntaxKind2["VoidKeyword"] = 114] = "VoidKeyword"; + SyntaxKind2[SyntaxKind2["WhileKeyword"] = 115] = "WhileKeyword"; + SyntaxKind2[SyntaxKind2["WithKeyword"] = 116] = "WithKeyword"; + SyntaxKind2[SyntaxKind2["ImplementsKeyword"] = 117] = "ImplementsKeyword"; + SyntaxKind2[SyntaxKind2["InterfaceKeyword"] = 118] = "InterfaceKeyword"; + SyntaxKind2[SyntaxKind2["LetKeyword"] = 119] = "LetKeyword"; + SyntaxKind2[SyntaxKind2["PackageKeyword"] = 120] = "PackageKeyword"; + SyntaxKind2[SyntaxKind2["PrivateKeyword"] = 121] = "PrivateKeyword"; + SyntaxKind2[SyntaxKind2["ProtectedKeyword"] = 122] = "ProtectedKeyword"; + SyntaxKind2[SyntaxKind2["PublicKeyword"] = 123] = "PublicKeyword"; + SyntaxKind2[SyntaxKind2["StaticKeyword"] = 124] = "StaticKeyword"; + SyntaxKind2[SyntaxKind2["YieldKeyword"] = 125] = "YieldKeyword"; + SyntaxKind2[SyntaxKind2["AbstractKeyword"] = 126] = "AbstractKeyword"; + SyntaxKind2[SyntaxKind2["AccessorKeyword"] = 127] = "AccessorKeyword"; + SyntaxKind2[SyntaxKind2["AsKeyword"] = 128] = "AsKeyword"; + SyntaxKind2[SyntaxKind2["AssertsKeyword"] = 129] = "AssertsKeyword"; + SyntaxKind2[SyntaxKind2["AssertKeyword"] = 130] = "AssertKeyword"; + SyntaxKind2[SyntaxKind2["AnyKeyword"] = 131] = "AnyKeyword"; + SyntaxKind2[SyntaxKind2["AsyncKeyword"] = 132] = "AsyncKeyword"; + SyntaxKind2[SyntaxKind2["AwaitKeyword"] = 133] = "AwaitKeyword"; + SyntaxKind2[SyntaxKind2["BooleanKeyword"] = 134] = "BooleanKeyword"; + SyntaxKind2[SyntaxKind2["ConstructorKeyword"] = 135] = "ConstructorKeyword"; + SyntaxKind2[SyntaxKind2["DeclareKeyword"] = 136] = "DeclareKeyword"; + SyntaxKind2[SyntaxKind2["GetKeyword"] = 137] = "GetKeyword"; + SyntaxKind2[SyntaxKind2["InferKeyword"] = 138] = "InferKeyword"; + SyntaxKind2[SyntaxKind2["IntrinsicKeyword"] = 139] = "IntrinsicKeyword"; + SyntaxKind2[SyntaxKind2["IsKeyword"] = 140] = "IsKeyword"; + SyntaxKind2[SyntaxKind2["KeyOfKeyword"] = 141] = "KeyOfKeyword"; + SyntaxKind2[SyntaxKind2["ModuleKeyword"] = 142] = "ModuleKeyword"; + SyntaxKind2[SyntaxKind2["NamespaceKeyword"] = 143] = "NamespaceKeyword"; + SyntaxKind2[SyntaxKind2["NeverKeyword"] = 144] = "NeverKeyword"; + SyntaxKind2[SyntaxKind2["OutKeyword"] = 145] = "OutKeyword"; + SyntaxKind2[SyntaxKind2["ReadonlyKeyword"] = 146] = "ReadonlyKeyword"; + SyntaxKind2[SyntaxKind2["RequireKeyword"] = 147] = "RequireKeyword"; + SyntaxKind2[SyntaxKind2["NumberKeyword"] = 148] = "NumberKeyword"; + SyntaxKind2[SyntaxKind2["ObjectKeyword"] = 149] = "ObjectKeyword"; + SyntaxKind2[SyntaxKind2["SatisfiesKeyword"] = 150] = "SatisfiesKeyword"; + SyntaxKind2[SyntaxKind2["SetKeyword"] = 151] = "SetKeyword"; + SyntaxKind2[SyntaxKind2["StringKeyword"] = 152] = "StringKeyword"; + SyntaxKind2[SyntaxKind2["SymbolKeyword"] = 153] = "SymbolKeyword"; + SyntaxKind2[SyntaxKind2["TypeKeyword"] = 154] = "TypeKeyword"; + SyntaxKind2[SyntaxKind2["UndefinedKeyword"] = 155] = "UndefinedKeyword"; + SyntaxKind2[SyntaxKind2["UniqueKeyword"] = 156] = "UniqueKeyword"; + SyntaxKind2[SyntaxKind2["UnknownKeyword"] = 157] = "UnknownKeyword"; + SyntaxKind2[SyntaxKind2["FromKeyword"] = 158] = "FromKeyword"; + SyntaxKind2[SyntaxKind2["GlobalKeyword"] = 159] = "GlobalKeyword"; + SyntaxKind2[SyntaxKind2["BigIntKeyword"] = 160] = "BigIntKeyword"; + SyntaxKind2[SyntaxKind2["OverrideKeyword"] = 161] = "OverrideKeyword"; + SyntaxKind2[SyntaxKind2["OfKeyword"] = 162] = "OfKeyword"; + SyntaxKind2[SyntaxKind2["QualifiedName"] = 163] = "QualifiedName"; + SyntaxKind2[SyntaxKind2["ComputedPropertyName"] = 164] = "ComputedPropertyName"; + SyntaxKind2[SyntaxKind2["TypeParameter"] = 165] = "TypeParameter"; + SyntaxKind2[SyntaxKind2["Parameter"] = 166] = "Parameter"; + SyntaxKind2[SyntaxKind2["Decorator"] = 167] = "Decorator"; + SyntaxKind2[SyntaxKind2["PropertySignature"] = 168] = "PropertySignature"; + SyntaxKind2[SyntaxKind2["PropertyDeclaration"] = 169] = "PropertyDeclaration"; + SyntaxKind2[SyntaxKind2["MethodSignature"] = 170] = "MethodSignature"; + SyntaxKind2[SyntaxKind2["MethodDeclaration"] = 171] = "MethodDeclaration"; + SyntaxKind2[SyntaxKind2["ClassStaticBlockDeclaration"] = 172] = "ClassStaticBlockDeclaration"; + SyntaxKind2[SyntaxKind2["Constructor"] = 173] = "Constructor"; + SyntaxKind2[SyntaxKind2["GetAccessor"] = 174] = "GetAccessor"; + SyntaxKind2[SyntaxKind2["SetAccessor"] = 175] = "SetAccessor"; + SyntaxKind2[SyntaxKind2["CallSignature"] = 176] = "CallSignature"; + SyntaxKind2[SyntaxKind2["ConstructSignature"] = 177] = "ConstructSignature"; + SyntaxKind2[SyntaxKind2["IndexSignature"] = 178] = "IndexSignature"; + SyntaxKind2[SyntaxKind2["TypePredicate"] = 179] = "TypePredicate"; + SyntaxKind2[SyntaxKind2["TypeReference"] = 180] = "TypeReference"; + SyntaxKind2[SyntaxKind2["FunctionType"] = 181] = "FunctionType"; + SyntaxKind2[SyntaxKind2["ConstructorType"] = 182] = "ConstructorType"; + SyntaxKind2[SyntaxKind2["TypeQuery"] = 183] = "TypeQuery"; + SyntaxKind2[SyntaxKind2["TypeLiteral"] = 184] = "TypeLiteral"; + SyntaxKind2[SyntaxKind2["ArrayType"] = 185] = "ArrayType"; + SyntaxKind2[SyntaxKind2["TupleType"] = 186] = "TupleType"; + SyntaxKind2[SyntaxKind2["OptionalType"] = 187] = "OptionalType"; + SyntaxKind2[SyntaxKind2["RestType"] = 188] = "RestType"; + SyntaxKind2[SyntaxKind2["UnionType"] = 189] = "UnionType"; + SyntaxKind2[SyntaxKind2["IntersectionType"] = 190] = "IntersectionType"; + SyntaxKind2[SyntaxKind2["ConditionalType"] = 191] = "ConditionalType"; + SyntaxKind2[SyntaxKind2["InferType"] = 192] = "InferType"; + SyntaxKind2[SyntaxKind2["ParenthesizedType"] = 193] = "ParenthesizedType"; + SyntaxKind2[SyntaxKind2["ThisType"] = 194] = "ThisType"; + SyntaxKind2[SyntaxKind2["TypeOperator"] = 195] = "TypeOperator"; + SyntaxKind2[SyntaxKind2["IndexedAccessType"] = 196] = "IndexedAccessType"; + SyntaxKind2[SyntaxKind2["MappedType"] = 197] = "MappedType"; + SyntaxKind2[SyntaxKind2["LiteralType"] = 198] = "LiteralType"; + SyntaxKind2[SyntaxKind2["NamedTupleMember"] = 199] = "NamedTupleMember"; + SyntaxKind2[SyntaxKind2["TemplateLiteralType"] = 200] = "TemplateLiteralType"; + SyntaxKind2[SyntaxKind2["TemplateLiteralTypeSpan"] = 201] = "TemplateLiteralTypeSpan"; + SyntaxKind2[SyntaxKind2["ImportType"] = 202] = "ImportType"; + SyntaxKind2[SyntaxKind2["ObjectBindingPattern"] = 203] = "ObjectBindingPattern"; + SyntaxKind2[SyntaxKind2["ArrayBindingPattern"] = 204] = "ArrayBindingPattern"; + SyntaxKind2[SyntaxKind2["BindingElement"] = 205] = "BindingElement"; + SyntaxKind2[SyntaxKind2["ArrayLiteralExpression"] = 206] = "ArrayLiteralExpression"; + SyntaxKind2[SyntaxKind2["ObjectLiteralExpression"] = 207] = "ObjectLiteralExpression"; + SyntaxKind2[SyntaxKind2["PropertyAccessExpression"] = 208] = "PropertyAccessExpression"; + SyntaxKind2[SyntaxKind2["ElementAccessExpression"] = 209] = "ElementAccessExpression"; + SyntaxKind2[SyntaxKind2["CallExpression"] = 210] = "CallExpression"; + SyntaxKind2[SyntaxKind2["NewExpression"] = 211] = "NewExpression"; + SyntaxKind2[SyntaxKind2["TaggedTemplateExpression"] = 212] = "TaggedTemplateExpression"; + SyntaxKind2[SyntaxKind2["TypeAssertionExpression"] = 213] = "TypeAssertionExpression"; + SyntaxKind2[SyntaxKind2["ParenthesizedExpression"] = 214] = "ParenthesizedExpression"; + SyntaxKind2[SyntaxKind2["FunctionExpression"] = 215] = "FunctionExpression"; + SyntaxKind2[SyntaxKind2["ArrowFunction"] = 216] = "ArrowFunction"; + SyntaxKind2[SyntaxKind2["DeleteExpression"] = 217] = "DeleteExpression"; + SyntaxKind2[SyntaxKind2["TypeOfExpression"] = 218] = "TypeOfExpression"; + SyntaxKind2[SyntaxKind2["VoidExpression"] = 219] = "VoidExpression"; + SyntaxKind2[SyntaxKind2["AwaitExpression"] = 220] = "AwaitExpression"; + SyntaxKind2[SyntaxKind2["PrefixUnaryExpression"] = 221] = "PrefixUnaryExpression"; + SyntaxKind2[SyntaxKind2["PostfixUnaryExpression"] = 222] = "PostfixUnaryExpression"; + SyntaxKind2[SyntaxKind2["BinaryExpression"] = 223] = "BinaryExpression"; + SyntaxKind2[SyntaxKind2["ConditionalExpression"] = 224] = "ConditionalExpression"; + SyntaxKind2[SyntaxKind2["TemplateExpression"] = 225] = "TemplateExpression"; + SyntaxKind2[SyntaxKind2["YieldExpression"] = 226] = "YieldExpression"; + SyntaxKind2[SyntaxKind2["SpreadElement"] = 227] = "SpreadElement"; + SyntaxKind2[SyntaxKind2["ClassExpression"] = 228] = "ClassExpression"; + SyntaxKind2[SyntaxKind2["OmittedExpression"] = 229] = "OmittedExpression"; + SyntaxKind2[SyntaxKind2["ExpressionWithTypeArguments"] = 230] = "ExpressionWithTypeArguments"; + SyntaxKind2[SyntaxKind2["AsExpression"] = 231] = "AsExpression"; + SyntaxKind2[SyntaxKind2["NonNullExpression"] = 232] = "NonNullExpression"; + SyntaxKind2[SyntaxKind2["MetaProperty"] = 233] = "MetaProperty"; + SyntaxKind2[SyntaxKind2["SyntheticExpression"] = 234] = "SyntheticExpression"; + SyntaxKind2[SyntaxKind2["SatisfiesExpression"] = 235] = "SatisfiesExpression"; + SyntaxKind2[SyntaxKind2["TemplateSpan"] = 236] = "TemplateSpan"; + SyntaxKind2[SyntaxKind2["SemicolonClassElement"] = 237] = "SemicolonClassElement"; + SyntaxKind2[SyntaxKind2["Block"] = 238] = "Block"; + SyntaxKind2[SyntaxKind2["EmptyStatement"] = 239] = "EmptyStatement"; + SyntaxKind2[SyntaxKind2["VariableStatement"] = 240] = "VariableStatement"; + SyntaxKind2[SyntaxKind2["ExpressionStatement"] = 241] = "ExpressionStatement"; + SyntaxKind2[SyntaxKind2["IfStatement"] = 242] = "IfStatement"; + SyntaxKind2[SyntaxKind2["DoStatement"] = 243] = "DoStatement"; + SyntaxKind2[SyntaxKind2["WhileStatement"] = 244] = "WhileStatement"; + SyntaxKind2[SyntaxKind2["ForStatement"] = 245] = "ForStatement"; + SyntaxKind2[SyntaxKind2["ForInStatement"] = 246] = "ForInStatement"; + SyntaxKind2[SyntaxKind2["ForOfStatement"] = 247] = "ForOfStatement"; + SyntaxKind2[SyntaxKind2["ContinueStatement"] = 248] = "ContinueStatement"; + SyntaxKind2[SyntaxKind2["BreakStatement"] = 249] = "BreakStatement"; + SyntaxKind2[SyntaxKind2["ReturnStatement"] = 250] = "ReturnStatement"; + SyntaxKind2[SyntaxKind2["WithStatement"] = 251] = "WithStatement"; + SyntaxKind2[SyntaxKind2["SwitchStatement"] = 252] = "SwitchStatement"; + SyntaxKind2[SyntaxKind2["LabeledStatement"] = 253] = "LabeledStatement"; + SyntaxKind2[SyntaxKind2["ThrowStatement"] = 254] = "ThrowStatement"; + SyntaxKind2[SyntaxKind2["TryStatement"] = 255] = "TryStatement"; + SyntaxKind2[SyntaxKind2["DebuggerStatement"] = 256] = "DebuggerStatement"; + SyntaxKind2[SyntaxKind2["VariableDeclaration"] = 257] = "VariableDeclaration"; + SyntaxKind2[SyntaxKind2["VariableDeclarationList"] = 258] = "VariableDeclarationList"; + SyntaxKind2[SyntaxKind2["FunctionDeclaration"] = 259] = "FunctionDeclaration"; + SyntaxKind2[SyntaxKind2["ClassDeclaration"] = 260] = "ClassDeclaration"; + SyntaxKind2[SyntaxKind2["InterfaceDeclaration"] = 261] = "InterfaceDeclaration"; + SyntaxKind2[SyntaxKind2["TypeAliasDeclaration"] = 262] = "TypeAliasDeclaration"; + SyntaxKind2[SyntaxKind2["EnumDeclaration"] = 263] = "EnumDeclaration"; + SyntaxKind2[SyntaxKind2["ModuleDeclaration"] = 264] = "ModuleDeclaration"; + SyntaxKind2[SyntaxKind2["ModuleBlock"] = 265] = "ModuleBlock"; + SyntaxKind2[SyntaxKind2["CaseBlock"] = 266] = "CaseBlock"; + SyntaxKind2[SyntaxKind2["NamespaceExportDeclaration"] = 267] = "NamespaceExportDeclaration"; + SyntaxKind2[SyntaxKind2["ImportEqualsDeclaration"] = 268] = "ImportEqualsDeclaration"; + SyntaxKind2[SyntaxKind2["ImportDeclaration"] = 269] = "ImportDeclaration"; + SyntaxKind2[SyntaxKind2["ImportClause"] = 270] = "ImportClause"; + SyntaxKind2[SyntaxKind2["NamespaceImport"] = 271] = "NamespaceImport"; + SyntaxKind2[SyntaxKind2["NamedImports"] = 272] = "NamedImports"; + SyntaxKind2[SyntaxKind2["ImportSpecifier"] = 273] = "ImportSpecifier"; + SyntaxKind2[SyntaxKind2["ExportAssignment"] = 274] = "ExportAssignment"; + SyntaxKind2[SyntaxKind2["ExportDeclaration"] = 275] = "ExportDeclaration"; + SyntaxKind2[SyntaxKind2["NamedExports"] = 276] = "NamedExports"; + SyntaxKind2[SyntaxKind2["NamespaceExport"] = 277] = "NamespaceExport"; + SyntaxKind2[SyntaxKind2["ExportSpecifier"] = 278] = "ExportSpecifier"; + SyntaxKind2[SyntaxKind2["MissingDeclaration"] = 279] = "MissingDeclaration"; + SyntaxKind2[SyntaxKind2["ExternalModuleReference"] = 280] = "ExternalModuleReference"; + SyntaxKind2[SyntaxKind2["JsxElement"] = 281] = "JsxElement"; + SyntaxKind2[SyntaxKind2["JsxSelfClosingElement"] = 282] = "JsxSelfClosingElement"; + SyntaxKind2[SyntaxKind2["JsxOpeningElement"] = 283] = "JsxOpeningElement"; + SyntaxKind2[SyntaxKind2["JsxClosingElement"] = 284] = "JsxClosingElement"; + SyntaxKind2[SyntaxKind2["JsxFragment"] = 285] = "JsxFragment"; + SyntaxKind2[SyntaxKind2["JsxOpeningFragment"] = 286] = "JsxOpeningFragment"; + SyntaxKind2[SyntaxKind2["JsxClosingFragment"] = 287] = "JsxClosingFragment"; + SyntaxKind2[SyntaxKind2["JsxAttribute"] = 288] = "JsxAttribute"; + SyntaxKind2[SyntaxKind2["JsxAttributes"] = 289] = "JsxAttributes"; + SyntaxKind2[SyntaxKind2["JsxSpreadAttribute"] = 290] = "JsxSpreadAttribute"; + SyntaxKind2[SyntaxKind2["JsxExpression"] = 291] = "JsxExpression"; + SyntaxKind2[SyntaxKind2["CaseClause"] = 292] = "CaseClause"; + SyntaxKind2[SyntaxKind2["DefaultClause"] = 293] = "DefaultClause"; + SyntaxKind2[SyntaxKind2["HeritageClause"] = 294] = "HeritageClause"; + SyntaxKind2[SyntaxKind2["CatchClause"] = 295] = "CatchClause"; + SyntaxKind2[SyntaxKind2["AssertClause"] = 296] = "AssertClause"; + SyntaxKind2[SyntaxKind2["AssertEntry"] = 297] = "AssertEntry"; + SyntaxKind2[SyntaxKind2["ImportTypeAssertionContainer"] = 298] = "ImportTypeAssertionContainer"; + SyntaxKind2[SyntaxKind2["PropertyAssignment"] = 299] = "PropertyAssignment"; + SyntaxKind2[SyntaxKind2["ShorthandPropertyAssignment"] = 300] = "ShorthandPropertyAssignment"; + SyntaxKind2[SyntaxKind2["SpreadAssignment"] = 301] = "SpreadAssignment"; + SyntaxKind2[SyntaxKind2["EnumMember"] = 302] = "EnumMember"; + SyntaxKind2[SyntaxKind2["UnparsedPrologue"] = 303] = "UnparsedPrologue"; + SyntaxKind2[SyntaxKind2["UnparsedPrepend"] = 304] = "UnparsedPrepend"; + SyntaxKind2[SyntaxKind2["UnparsedText"] = 305] = "UnparsedText"; + SyntaxKind2[SyntaxKind2["UnparsedInternalText"] = 306] = "UnparsedInternalText"; + SyntaxKind2[SyntaxKind2["UnparsedSyntheticReference"] = 307] = "UnparsedSyntheticReference"; + SyntaxKind2[SyntaxKind2["SourceFile"] = 308] = "SourceFile"; + SyntaxKind2[SyntaxKind2["Bundle"] = 309] = "Bundle"; + SyntaxKind2[SyntaxKind2["UnparsedSource"] = 310] = "UnparsedSource"; + SyntaxKind2[SyntaxKind2["InputFiles"] = 311] = "InputFiles"; + SyntaxKind2[SyntaxKind2["JSDocTypeExpression"] = 312] = "JSDocTypeExpression"; + SyntaxKind2[SyntaxKind2["JSDocNameReference"] = 313] = "JSDocNameReference"; + SyntaxKind2[SyntaxKind2["JSDocMemberName"] = 314] = "JSDocMemberName"; + SyntaxKind2[SyntaxKind2["JSDocAllType"] = 315] = "JSDocAllType"; + SyntaxKind2[SyntaxKind2["JSDocUnknownType"] = 316] = "JSDocUnknownType"; + SyntaxKind2[SyntaxKind2["JSDocNullableType"] = 317] = "JSDocNullableType"; + SyntaxKind2[SyntaxKind2["JSDocNonNullableType"] = 318] = "JSDocNonNullableType"; + SyntaxKind2[SyntaxKind2["JSDocOptionalType"] = 319] = "JSDocOptionalType"; + SyntaxKind2[SyntaxKind2["JSDocFunctionType"] = 320] = "JSDocFunctionType"; + SyntaxKind2[SyntaxKind2["JSDocVariadicType"] = 321] = "JSDocVariadicType"; + SyntaxKind2[SyntaxKind2["JSDocNamepathType"] = 322] = "JSDocNamepathType"; + SyntaxKind2[SyntaxKind2["JSDoc"] = 323] = "JSDoc"; + SyntaxKind2[SyntaxKind2["JSDocComment"] = 323] = "JSDocComment"; + SyntaxKind2[SyntaxKind2["JSDocText"] = 324] = "JSDocText"; + SyntaxKind2[SyntaxKind2["JSDocTypeLiteral"] = 325] = "JSDocTypeLiteral"; + SyntaxKind2[SyntaxKind2["JSDocSignature"] = 326] = "JSDocSignature"; + SyntaxKind2[SyntaxKind2["JSDocLink"] = 327] = "JSDocLink"; + SyntaxKind2[SyntaxKind2["JSDocLinkCode"] = 328] = "JSDocLinkCode"; + SyntaxKind2[SyntaxKind2["JSDocLinkPlain"] = 329] = "JSDocLinkPlain"; + SyntaxKind2[SyntaxKind2["JSDocTag"] = 330] = "JSDocTag"; + SyntaxKind2[SyntaxKind2["JSDocAugmentsTag"] = 331] = "JSDocAugmentsTag"; + SyntaxKind2[SyntaxKind2["JSDocImplementsTag"] = 332] = "JSDocImplementsTag"; + SyntaxKind2[SyntaxKind2["JSDocAuthorTag"] = 333] = "JSDocAuthorTag"; + SyntaxKind2[SyntaxKind2["JSDocDeprecatedTag"] = 334] = "JSDocDeprecatedTag"; + SyntaxKind2[SyntaxKind2["JSDocClassTag"] = 335] = "JSDocClassTag"; + SyntaxKind2[SyntaxKind2["JSDocPublicTag"] = 336] = "JSDocPublicTag"; + SyntaxKind2[SyntaxKind2["JSDocPrivateTag"] = 337] = "JSDocPrivateTag"; + SyntaxKind2[SyntaxKind2["JSDocProtectedTag"] = 338] = "JSDocProtectedTag"; + SyntaxKind2[SyntaxKind2["JSDocReadonlyTag"] = 339] = "JSDocReadonlyTag"; + SyntaxKind2[SyntaxKind2["JSDocOverrideTag"] = 340] = "JSDocOverrideTag"; + SyntaxKind2[SyntaxKind2["JSDocCallbackTag"] = 341] = "JSDocCallbackTag"; + SyntaxKind2[SyntaxKind2["JSDocEnumTag"] = 342] = "JSDocEnumTag"; + SyntaxKind2[SyntaxKind2["JSDocParameterTag"] = 343] = "JSDocParameterTag"; + SyntaxKind2[SyntaxKind2["JSDocReturnTag"] = 344] = "JSDocReturnTag"; + SyntaxKind2[SyntaxKind2["JSDocThisTag"] = 345] = "JSDocThisTag"; + SyntaxKind2[SyntaxKind2["JSDocTypeTag"] = 346] = "JSDocTypeTag"; + SyntaxKind2[SyntaxKind2["JSDocTemplateTag"] = 347] = "JSDocTemplateTag"; + SyntaxKind2[SyntaxKind2["JSDocTypedefTag"] = 348] = "JSDocTypedefTag"; + SyntaxKind2[SyntaxKind2["JSDocSeeTag"] = 349] = "JSDocSeeTag"; + SyntaxKind2[SyntaxKind2["JSDocPropertyTag"] = 350] = "JSDocPropertyTag"; + SyntaxKind2[SyntaxKind2["SyntaxList"] = 351] = "SyntaxList"; + SyntaxKind2[SyntaxKind2["NotEmittedStatement"] = 352] = "NotEmittedStatement"; + SyntaxKind2[SyntaxKind2["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression"; + SyntaxKind2[SyntaxKind2["CommaListExpression"] = 354] = "CommaListExpression"; + SyntaxKind2[SyntaxKind2["MergeDeclarationMarker"] = 355] = "MergeDeclarationMarker"; + SyntaxKind2[SyntaxKind2["EndOfDeclarationMarker"] = 356] = "EndOfDeclarationMarker"; + SyntaxKind2[SyntaxKind2["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression"; + SyntaxKind2[SyntaxKind2["Count"] = 358] = "Count"; + SyntaxKind2[SyntaxKind2["FirstAssignment"] = 63] = "FirstAssignment"; + SyntaxKind2[SyntaxKind2["LastAssignment"] = 78] = "LastAssignment"; + SyntaxKind2[SyntaxKind2["FirstCompoundAssignment"] = 64] = "FirstCompoundAssignment"; + SyntaxKind2[SyntaxKind2["LastCompoundAssignment"] = 78] = "LastCompoundAssignment"; + SyntaxKind2[SyntaxKind2["FirstReservedWord"] = 81] = "FirstReservedWord"; + SyntaxKind2[SyntaxKind2["LastReservedWord"] = 116] = "LastReservedWord"; + SyntaxKind2[SyntaxKind2["FirstKeyword"] = 81] = "FirstKeyword"; + SyntaxKind2[SyntaxKind2["LastKeyword"] = 162] = "LastKeyword"; + SyntaxKind2[SyntaxKind2["FirstFutureReservedWord"] = 117] = "FirstFutureReservedWord"; + SyntaxKind2[SyntaxKind2["LastFutureReservedWord"] = 125] = "LastFutureReservedWord"; + SyntaxKind2[SyntaxKind2["FirstTypeNode"] = 179] = "FirstTypeNode"; + SyntaxKind2[SyntaxKind2["LastTypeNode"] = 202] = "LastTypeNode"; + SyntaxKind2[SyntaxKind2["FirstPunctuation"] = 18] = "FirstPunctuation"; + SyntaxKind2[SyntaxKind2["LastPunctuation"] = 78] = "LastPunctuation"; + SyntaxKind2[SyntaxKind2["FirstToken"] = 0] = "FirstToken"; + SyntaxKind2[SyntaxKind2["LastToken"] = 162] = "LastToken"; + SyntaxKind2[SyntaxKind2["FirstTriviaToken"] = 2] = "FirstTriviaToken"; + SyntaxKind2[SyntaxKind2["LastTriviaToken"] = 7] = "LastTriviaToken"; + SyntaxKind2[SyntaxKind2["FirstLiteralToken"] = 8] = "FirstLiteralToken"; + SyntaxKind2[SyntaxKind2["LastLiteralToken"] = 14] = "LastLiteralToken"; + SyntaxKind2[SyntaxKind2["FirstTemplateToken"] = 14] = "FirstTemplateToken"; + SyntaxKind2[SyntaxKind2["LastTemplateToken"] = 17] = "LastTemplateToken"; + SyntaxKind2[SyntaxKind2["FirstBinaryOperator"] = 29] = "FirstBinaryOperator"; + SyntaxKind2[SyntaxKind2["LastBinaryOperator"] = 78] = "LastBinaryOperator"; + SyntaxKind2[SyntaxKind2["FirstStatement"] = 240] = "FirstStatement"; + SyntaxKind2[SyntaxKind2["LastStatement"] = 256] = "LastStatement"; + SyntaxKind2[SyntaxKind2["FirstNode"] = 163] = "FirstNode"; + SyntaxKind2[SyntaxKind2["FirstJSDocNode"] = 312] = "FirstJSDocNode"; + SyntaxKind2[SyntaxKind2["LastJSDocNode"] = 350] = "LastJSDocNode"; + SyntaxKind2[SyntaxKind2["FirstJSDocTagNode"] = 330] = "FirstJSDocTagNode"; + SyntaxKind2[SyntaxKind2["LastJSDocTagNode"] = 350] = "LastJSDocTagNode"; + SyntaxKind2[SyntaxKind2["FirstContextualKeyword"] = 126] = "FirstContextualKeyword"; + SyntaxKind2[SyntaxKind2["LastContextualKeyword"] = 162] = "LastContextualKeyword"; + })(SyntaxKind = ts2.SyntaxKind || (ts2.SyntaxKind = {})); + var NodeFlags; + (function(NodeFlags2) { + NodeFlags2[NodeFlags2["None"] = 0] = "None"; + NodeFlags2[NodeFlags2["Let"] = 1] = "Let"; + NodeFlags2[NodeFlags2["Const"] = 2] = "Const"; + NodeFlags2[NodeFlags2["NestedNamespace"] = 4] = "NestedNamespace"; + NodeFlags2[NodeFlags2["Synthesized"] = 8] = "Synthesized"; + NodeFlags2[NodeFlags2["Namespace"] = 16] = "Namespace"; + NodeFlags2[NodeFlags2["OptionalChain"] = 32] = "OptionalChain"; + NodeFlags2[NodeFlags2["ExportContext"] = 64] = "ExportContext"; + NodeFlags2[NodeFlags2["ContainsThis"] = 128] = "ContainsThis"; + NodeFlags2[NodeFlags2["HasImplicitReturn"] = 256] = "HasImplicitReturn"; + NodeFlags2[NodeFlags2["HasExplicitReturn"] = 512] = "HasExplicitReturn"; + NodeFlags2[NodeFlags2["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; + NodeFlags2[NodeFlags2["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; + NodeFlags2[NodeFlags2["DisallowInContext"] = 4096] = "DisallowInContext"; + NodeFlags2[NodeFlags2["YieldContext"] = 8192] = "YieldContext"; + NodeFlags2[NodeFlags2["DecoratorContext"] = 16384] = "DecoratorContext"; + NodeFlags2[NodeFlags2["AwaitContext"] = 32768] = "AwaitContext"; + NodeFlags2[NodeFlags2["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; + NodeFlags2[NodeFlags2["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; + NodeFlags2[NodeFlags2["JavaScriptFile"] = 262144] = "JavaScriptFile"; + NodeFlags2[NodeFlags2["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags2[NodeFlags2["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; + NodeFlags2[NodeFlags2["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; + NodeFlags2[NodeFlags2["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; + NodeFlags2[NodeFlags2["JSDoc"] = 8388608] = "JSDoc"; + NodeFlags2[NodeFlags2["Ambient"] = 16777216] = "Ambient"; + NodeFlags2[NodeFlags2["InWithStatement"] = 33554432] = "InWithStatement"; + NodeFlags2[NodeFlags2["JsonFile"] = 67108864] = "JsonFile"; + NodeFlags2[NodeFlags2["TypeCached"] = 134217728] = "TypeCached"; + NodeFlags2[NodeFlags2["Deprecated"] = 268435456] = "Deprecated"; + NodeFlags2[NodeFlags2["BlockScoped"] = 3] = "BlockScoped"; + NodeFlags2[NodeFlags2["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; + NodeFlags2[NodeFlags2["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; + NodeFlags2[NodeFlags2["ContextFlags"] = 50720768] = "ContextFlags"; + NodeFlags2[NodeFlags2["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; + NodeFlags2[NodeFlags2["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; + })(NodeFlags = ts2.NodeFlags || (ts2.NodeFlags = {})); + var ModifierFlags; + (function(ModifierFlags2) { + ModifierFlags2[ModifierFlags2["None"] = 0] = "None"; + ModifierFlags2[ModifierFlags2["Export"] = 1] = "Export"; + ModifierFlags2[ModifierFlags2["Ambient"] = 2] = "Ambient"; + ModifierFlags2[ModifierFlags2["Public"] = 4] = "Public"; + ModifierFlags2[ModifierFlags2["Private"] = 8] = "Private"; + ModifierFlags2[ModifierFlags2["Protected"] = 16] = "Protected"; + ModifierFlags2[ModifierFlags2["Static"] = 32] = "Static"; + ModifierFlags2[ModifierFlags2["Readonly"] = 64] = "Readonly"; + ModifierFlags2[ModifierFlags2["Accessor"] = 128] = "Accessor"; + ModifierFlags2[ModifierFlags2["Abstract"] = 256] = "Abstract"; + ModifierFlags2[ModifierFlags2["Async"] = 512] = "Async"; + ModifierFlags2[ModifierFlags2["Default"] = 1024] = "Default"; + ModifierFlags2[ModifierFlags2["Const"] = 2048] = "Const"; + ModifierFlags2[ModifierFlags2["HasComputedJSDocModifiers"] = 4096] = "HasComputedJSDocModifiers"; + ModifierFlags2[ModifierFlags2["Deprecated"] = 8192] = "Deprecated"; + ModifierFlags2[ModifierFlags2["Override"] = 16384] = "Override"; + ModifierFlags2[ModifierFlags2["In"] = 32768] = "In"; + ModifierFlags2[ModifierFlags2["Out"] = 65536] = "Out"; + ModifierFlags2[ModifierFlags2["Decorator"] = 131072] = "Decorator"; + ModifierFlags2[ModifierFlags2["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags2[ModifierFlags2["AccessibilityModifier"] = 28] = "AccessibilityModifier"; + ModifierFlags2[ModifierFlags2["ParameterPropertyModifier"] = 16476] = "ParameterPropertyModifier"; + ModifierFlags2[ModifierFlags2["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; + ModifierFlags2[ModifierFlags2["TypeScriptModifier"] = 117086] = "TypeScriptModifier"; + ModifierFlags2[ModifierFlags2["ExportDefault"] = 1025] = "ExportDefault"; + ModifierFlags2[ModifierFlags2["All"] = 258047] = "All"; + ModifierFlags2[ModifierFlags2["Modifier"] = 126975] = "Modifier"; + })(ModifierFlags = ts2.ModifierFlags || (ts2.ModifierFlags = {})); + var JsxFlags; + (function(JsxFlags2) { + JsxFlags2[JsxFlags2["None"] = 0] = "None"; + JsxFlags2[JsxFlags2["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags2[JsxFlags2["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags2[JsxFlags2["IntrinsicElement"] = 3] = "IntrinsicElement"; + })(JsxFlags = ts2.JsxFlags || (ts2.JsxFlags = {})); + var RelationComparisonResult; + (function(RelationComparisonResult2) { + RelationComparisonResult2[RelationComparisonResult2["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult2[RelationComparisonResult2["Failed"] = 2] = "Failed"; + RelationComparisonResult2[RelationComparisonResult2["Reported"] = 4] = "Reported"; + RelationComparisonResult2[RelationComparisonResult2["ReportsUnmeasurable"] = 8] = "ReportsUnmeasurable"; + RelationComparisonResult2[RelationComparisonResult2["ReportsUnreliable"] = 16] = "ReportsUnreliable"; + RelationComparisonResult2[RelationComparisonResult2["ReportsMask"] = 24] = "ReportsMask"; + })(RelationComparisonResult = ts2.RelationComparisonResult || (ts2.RelationComparisonResult = {})); + var GeneratedIdentifierFlags; + (function(GeneratedIdentifierFlags2) { + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; + })(GeneratedIdentifierFlags = ts2.GeneratedIdentifierFlags || (ts2.GeneratedIdentifierFlags = {})); + var TokenFlags; + (function(TokenFlags2) { + TokenFlags2[TokenFlags2["None"] = 0] = "None"; + TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; + TokenFlags2[TokenFlags2["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; + TokenFlags2[TokenFlags2["Unterminated"] = 4] = "Unterminated"; + TokenFlags2[TokenFlags2["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; + TokenFlags2[TokenFlags2["Scientific"] = 16] = "Scientific"; + TokenFlags2[TokenFlags2["Octal"] = 32] = "Octal"; + TokenFlags2[TokenFlags2["HexSpecifier"] = 64] = "HexSpecifier"; + TokenFlags2[TokenFlags2["BinarySpecifier"] = 128] = "BinarySpecifier"; + TokenFlags2[TokenFlags2["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags2[TokenFlags2["ContainsSeparator"] = 512] = "ContainsSeparator"; + TokenFlags2[TokenFlags2["UnicodeEscape"] = 1024] = "UnicodeEscape"; + TokenFlags2[TokenFlags2["ContainsInvalidEscape"] = 2048] = "ContainsInvalidEscape"; + TokenFlags2[TokenFlags2["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; + TokenFlags2[TokenFlags2["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; + TokenFlags2[TokenFlags2["TemplateLiteralLikeFlags"] = 2048] = "TemplateLiteralLikeFlags"; + })(TokenFlags = ts2.TokenFlags || (ts2.TokenFlags = {})); + var FlowFlags; + (function(FlowFlags2) { + FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; + FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; + FlowFlags2[FlowFlags2["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags2[FlowFlags2["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags2[FlowFlags2["Assignment"] = 16] = "Assignment"; + FlowFlags2[FlowFlags2["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags2[FlowFlags2["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags2[FlowFlags2["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags2[FlowFlags2["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags2[FlowFlags2["Call"] = 512] = "Call"; + FlowFlags2[FlowFlags2["ReduceLabel"] = 1024] = "ReduceLabel"; + FlowFlags2[FlowFlags2["Referenced"] = 2048] = "Referenced"; + FlowFlags2[FlowFlags2["Shared"] = 4096] = "Shared"; + FlowFlags2[FlowFlags2["Label"] = 12] = "Label"; + FlowFlags2[FlowFlags2["Condition"] = 96] = "Condition"; + })(FlowFlags = ts2.FlowFlags || (ts2.FlowFlags = {})); + var CommentDirectiveType; + (function(CommentDirectiveType2) { + CommentDirectiveType2[CommentDirectiveType2["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType2[CommentDirectiveType2["Ignore"] = 1] = "Ignore"; + })(CommentDirectiveType = ts2.CommentDirectiveType || (ts2.CommentDirectiveType = {})); + var OperationCanceledException = ( + /** @class */ + /* @__PURE__ */ function() { + function OperationCanceledException2() { + } + return OperationCanceledException2; + }() + ); + ts2.OperationCanceledException = OperationCanceledException; + var FileIncludeKind; + (function(FileIncludeKind2) { + FileIncludeKind2[FileIncludeKind2["RootFile"] = 0] = "RootFile"; + FileIncludeKind2[FileIncludeKind2["SourceFromProjectReference"] = 1] = "SourceFromProjectReference"; + FileIncludeKind2[FileIncludeKind2["OutputFromProjectReference"] = 2] = "OutputFromProjectReference"; + FileIncludeKind2[FileIncludeKind2["Import"] = 3] = "Import"; + FileIncludeKind2[FileIncludeKind2["ReferenceFile"] = 4] = "ReferenceFile"; + FileIncludeKind2[FileIncludeKind2["TypeReferenceDirective"] = 5] = "TypeReferenceDirective"; + FileIncludeKind2[FileIncludeKind2["LibFile"] = 6] = "LibFile"; + FileIncludeKind2[FileIncludeKind2["LibReferenceDirective"] = 7] = "LibReferenceDirective"; + FileIncludeKind2[FileIncludeKind2["AutomaticTypeDirectiveFile"] = 8] = "AutomaticTypeDirectiveFile"; + })(FileIncludeKind = ts2.FileIncludeKind || (ts2.FileIncludeKind = {})); + var FilePreprocessingDiagnosticsKind; + (function(FilePreprocessingDiagnosticsKind2) { + FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingReferencedDiagnostic"] = 0] = "FilePreprocessingReferencedDiagnostic"; + FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingFileExplainingDiagnostic"] = 1] = "FilePreprocessingFileExplainingDiagnostic"; + })(FilePreprocessingDiagnosticsKind = ts2.FilePreprocessingDiagnosticsKind || (ts2.FilePreprocessingDiagnosticsKind = {})); + var StructureIsReused; + (function(StructureIsReused2) { + StructureIsReused2[StructureIsReused2["Not"] = 0] = "Not"; + StructureIsReused2[StructureIsReused2["SafeModules"] = 1] = "SafeModules"; + StructureIsReused2[StructureIsReused2["Completely"] = 2] = "Completely"; + })(StructureIsReused = ts2.StructureIsReused || (ts2.StructureIsReused = {})); + var ExitStatus; + (function(ExitStatus2) { + ExitStatus2[ExitStatus2["Success"] = 0] = "Success"; + ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; + ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; + ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; + ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; + ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkupped"] = 4] = "ProjectReferenceCycle_OutputsSkupped"; + })(ExitStatus = ts2.ExitStatus || (ts2.ExitStatus = {})); + var MemberOverrideStatus; + (function(MemberOverrideStatus2) { + MemberOverrideStatus2[MemberOverrideStatus2["Ok"] = 0] = "Ok"; + MemberOverrideStatus2[MemberOverrideStatus2["NeedsOverride"] = 1] = "NeedsOverride"; + MemberOverrideStatus2[MemberOverrideStatus2["HasInvalidOverride"] = 2] = "HasInvalidOverride"; + })(MemberOverrideStatus = ts2.MemberOverrideStatus || (ts2.MemberOverrideStatus = {})); + var UnionReduction; + (function(UnionReduction2) { + UnionReduction2[UnionReduction2["None"] = 0] = "None"; + UnionReduction2[UnionReduction2["Literal"] = 1] = "Literal"; + UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype"; + })(UnionReduction = ts2.UnionReduction || (ts2.UnionReduction = {})); + var ContextFlags; + (function(ContextFlags2) { + ContextFlags2[ContextFlags2["None"] = 0] = "None"; + ContextFlags2[ContextFlags2["Signature"] = 1] = "Signature"; + ContextFlags2[ContextFlags2["NoConstraints"] = 2] = "NoConstraints"; + ContextFlags2[ContextFlags2["Completions"] = 4] = "Completions"; + ContextFlags2[ContextFlags2["SkipBindingPatterns"] = 8] = "SkipBindingPatterns"; + })(ContextFlags = ts2.ContextFlags || (ts2.ContextFlags = {})); + var NodeBuilderFlags; + (function(NodeBuilderFlags2) { + NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None"; + NodeBuilderFlags2[NodeBuilderFlags2["NoTruncation"] = 1] = "NoTruncation"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + NodeBuilderFlags2[NodeBuilderFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams"; + NodeBuilderFlags2[NodeBuilderFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + NodeBuilderFlags2[NodeBuilderFlags2["ForbidIndexedAccessSymbolReferences"] = 16] = "ForbidIndexedAccessSymbolReferences"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + NodeBuilderFlags2[NodeBuilderFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags2[NodeBuilderFlags2["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; + NodeBuilderFlags2[NodeBuilderFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; + NodeBuilderFlags2[NodeBuilderFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags2[NodeBuilderFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags2[NodeBuilderFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + NodeBuilderFlags2[NodeBuilderFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; + NodeBuilderFlags2[NodeBuilderFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; + NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteComputedProps"] = 1073741824] = "WriteComputedProps"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + NodeBuilderFlags2[NodeBuilderFlags2["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags2[NodeBuilderFlags2["IgnoreErrors"] = 70221824] = "IgnoreErrors"; + NodeBuilderFlags2[NodeBuilderFlags2["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags2[NodeBuilderFlags2["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + })(NodeBuilderFlags = ts2.NodeBuilderFlags || (ts2.NodeBuilderFlags = {})); + var TypeFormatFlags; + (function(TypeFormatFlags2) { + TypeFormatFlags2[TypeFormatFlags2["None"] = 0] = "None"; + TypeFormatFlags2[TypeFormatFlags2["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags2[TypeFormatFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + TypeFormatFlags2[TypeFormatFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + TypeFormatFlags2[TypeFormatFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags2[TypeFormatFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + TypeFormatFlags2[TypeFormatFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + TypeFormatFlags2[TypeFormatFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags2[TypeFormatFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags2[TypeFormatFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags2[TypeFormatFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags2[TypeFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags2[TypeFormatFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; + TypeFormatFlags2[TypeFormatFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; + TypeFormatFlags2[TypeFormatFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; + TypeFormatFlags2[TypeFormatFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + TypeFormatFlags2[TypeFormatFlags2["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags2[TypeFormatFlags2["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + TypeFormatFlags2[TypeFormatFlags2["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; + TypeFormatFlags2[TypeFormatFlags2["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; + TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330091] = "NodeBuilderFlagsMask"; + })(TypeFormatFlags = ts2.TypeFormatFlags || (ts2.TypeFormatFlags = {})); + var SymbolFormatFlags; + (function(SymbolFormatFlags2) { + SymbolFormatFlags2[SymbolFormatFlags2["None"] = 0] = "None"; + SymbolFormatFlags2[SymbolFormatFlags2["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags2[SymbolFormatFlags2["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + SymbolFormatFlags2[SymbolFormatFlags2["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + SymbolFormatFlags2[SymbolFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; + SymbolFormatFlags2[SymbolFormatFlags2["WriteComputedProps"] = 16] = "WriteComputedProps"; + SymbolFormatFlags2[SymbolFormatFlags2["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain"; + })(SymbolFormatFlags = ts2.SymbolFormatFlags || (ts2.SymbolFormatFlags = {})); + var SymbolAccessibility; + (function(SymbolAccessibility2) { + SymbolAccessibility2[SymbolAccessibility2["Accessible"] = 0] = "Accessible"; + SymbolAccessibility2[SymbolAccessibility2["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility2[SymbolAccessibility2["CannotBeNamed"] = 2] = "CannotBeNamed"; + })(SymbolAccessibility = ts2.SymbolAccessibility || (ts2.SymbolAccessibility = {})); + var SyntheticSymbolKind; + (function(SyntheticSymbolKind2) { + SyntheticSymbolKind2[SyntheticSymbolKind2["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind2[SyntheticSymbolKind2["Spread"] = 1] = "Spread"; + })(SyntheticSymbolKind = ts2.SyntheticSymbolKind || (ts2.SyntheticSymbolKind = {})); + var TypePredicateKind; + (function(TypePredicateKind2) { + TypePredicateKind2[TypePredicateKind2["This"] = 0] = "This"; + TypePredicateKind2[TypePredicateKind2["Identifier"] = 1] = "Identifier"; + TypePredicateKind2[TypePredicateKind2["AssertsThis"] = 2] = "AssertsThis"; + TypePredicateKind2[TypePredicateKind2["AssertsIdentifier"] = 3] = "AssertsIdentifier"; + })(TypePredicateKind = ts2.TypePredicateKind || (ts2.TypePredicateKind = {})); + var TypeReferenceSerializationKind; + (function(TypeReferenceSerializationKind2) { + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Unknown"] = 0] = "Unknown"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["VoidNullableOrNeverType"] = 2] = "VoidNullableOrNeverType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["NumberLikeType"] = 3] = "NumberLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BigIntLikeType"] = 4] = "BigIntLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["StringLikeType"] = 5] = "StringLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BooleanType"] = 6] = "BooleanType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ArrayLikeType"] = 7] = "ArrayLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ESSymbolType"] = 8] = "ESSymbolType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Promise"] = 9] = "Promise"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithCallSignature"] = 10] = "TypeWithCallSignature"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ObjectType"] = 11] = "ObjectType"; + })(TypeReferenceSerializationKind = ts2.TypeReferenceSerializationKind || (ts2.TypeReferenceSerializationKind = {})); + var SymbolFlags; + (function(SymbolFlags2) { + SymbolFlags2[SymbolFlags2["None"] = 0] = "None"; + SymbolFlags2[SymbolFlags2["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags2[SymbolFlags2["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags2[SymbolFlags2["Property"] = 4] = "Property"; + SymbolFlags2[SymbolFlags2["EnumMember"] = 8] = "EnumMember"; + SymbolFlags2[SymbolFlags2["Function"] = 16] = "Function"; + SymbolFlags2[SymbolFlags2["Class"] = 32] = "Class"; + SymbolFlags2[SymbolFlags2["Interface"] = 64] = "Interface"; + SymbolFlags2[SymbolFlags2["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags2[SymbolFlags2["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags2[SymbolFlags2["ValueModule"] = 512] = "ValueModule"; + SymbolFlags2[SymbolFlags2["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags2[SymbolFlags2["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags2[SymbolFlags2["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags2[SymbolFlags2["Method"] = 8192] = "Method"; + SymbolFlags2[SymbolFlags2["Constructor"] = 16384] = "Constructor"; + SymbolFlags2[SymbolFlags2["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags2[SymbolFlags2["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags2[SymbolFlags2["Signature"] = 131072] = "Signature"; + SymbolFlags2[SymbolFlags2["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags2[SymbolFlags2["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags2[SymbolFlags2["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags2[SymbolFlags2["Alias"] = 2097152] = "Alias"; + SymbolFlags2[SymbolFlags2["Prototype"] = 4194304] = "Prototype"; + SymbolFlags2[SymbolFlags2["ExportStar"] = 8388608] = "ExportStar"; + SymbolFlags2[SymbolFlags2["Optional"] = 16777216] = "Optional"; + SymbolFlags2[SymbolFlags2["Transient"] = 33554432] = "Transient"; + SymbolFlags2[SymbolFlags2["Assignment"] = 67108864] = "Assignment"; + SymbolFlags2[SymbolFlags2["ModuleExports"] = 134217728] = "ModuleExports"; + SymbolFlags2[SymbolFlags2["All"] = 67108863] = "All"; + SymbolFlags2[SymbolFlags2["Enum"] = 384] = "Enum"; + SymbolFlags2[SymbolFlags2["Variable"] = 3] = "Variable"; + SymbolFlags2[SymbolFlags2["Value"] = 111551] = "Value"; + SymbolFlags2[SymbolFlags2["Type"] = 788968] = "Type"; + SymbolFlags2[SymbolFlags2["Namespace"] = 1920] = "Namespace"; + SymbolFlags2[SymbolFlags2["Module"] = 1536] = "Module"; + SymbolFlags2[SymbolFlags2["Accessor"] = 98304] = "Accessor"; + SymbolFlags2[SymbolFlags2["FunctionScopedVariableExcludes"] = 111550] = "FunctionScopedVariableExcludes"; + SymbolFlags2[SymbolFlags2["BlockScopedVariableExcludes"] = 111551] = "BlockScopedVariableExcludes"; + SymbolFlags2[SymbolFlags2["ParameterExcludes"] = 111551] = "ParameterExcludes"; + SymbolFlags2[SymbolFlags2["PropertyExcludes"] = 0] = "PropertyExcludes"; + SymbolFlags2[SymbolFlags2["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags2[SymbolFlags2["FunctionExcludes"] = 110991] = "FunctionExcludes"; + SymbolFlags2[SymbolFlags2["ClassExcludes"] = 899503] = "ClassExcludes"; + SymbolFlags2[SymbolFlags2["InterfaceExcludes"] = 788872] = "InterfaceExcludes"; + SymbolFlags2[SymbolFlags2["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags2[SymbolFlags2["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags2[SymbolFlags2["ValueModuleExcludes"] = 110735] = "ValueModuleExcludes"; + SymbolFlags2[SymbolFlags2["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags2[SymbolFlags2["MethodExcludes"] = 103359] = "MethodExcludes"; + SymbolFlags2[SymbolFlags2["GetAccessorExcludes"] = 46015] = "GetAccessorExcludes"; + SymbolFlags2[SymbolFlags2["SetAccessorExcludes"] = 78783] = "SetAccessorExcludes"; + SymbolFlags2[SymbolFlags2["AccessorExcludes"] = 13247] = "AccessorExcludes"; + SymbolFlags2[SymbolFlags2["TypeParameterExcludes"] = 526824] = "TypeParameterExcludes"; + SymbolFlags2[SymbolFlags2["TypeAliasExcludes"] = 788968] = "TypeAliasExcludes"; + SymbolFlags2[SymbolFlags2["AliasExcludes"] = 2097152] = "AliasExcludes"; + SymbolFlags2[SymbolFlags2["ModuleMember"] = 2623475] = "ModuleMember"; + SymbolFlags2[SymbolFlags2["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags2[SymbolFlags2["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags2[SymbolFlags2["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags2[SymbolFlags2["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags2[SymbolFlags2["ExportSupportsDefaultModifier"] = 112] = "ExportSupportsDefaultModifier"; + SymbolFlags2[SymbolFlags2["ExportDoesNotSupportDefaultModifier"] = -113] = "ExportDoesNotSupportDefaultModifier"; + SymbolFlags2[SymbolFlags2["Classifiable"] = 2885600] = "Classifiable"; + SymbolFlags2[SymbolFlags2["LateBindingContainer"] = 6256] = "LateBindingContainer"; + })(SymbolFlags = ts2.SymbolFlags || (ts2.SymbolFlags = {})); + var EnumKind; + (function(EnumKind2) { + EnumKind2[EnumKind2["Numeric"] = 0] = "Numeric"; + EnumKind2[EnumKind2["Literal"] = 1] = "Literal"; + })(EnumKind = ts2.EnumKind || (ts2.EnumKind = {})); + var CheckFlags; + (function(CheckFlags2) { + CheckFlags2[CheckFlags2["Instantiated"] = 1] = "Instantiated"; + CheckFlags2[CheckFlags2["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags2[CheckFlags2["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags2[CheckFlags2["Readonly"] = 8] = "Readonly"; + CheckFlags2[CheckFlags2["ReadPartial"] = 16] = "ReadPartial"; + CheckFlags2[CheckFlags2["WritePartial"] = 32] = "WritePartial"; + CheckFlags2[CheckFlags2["HasNonUniformType"] = 64] = "HasNonUniformType"; + CheckFlags2[CheckFlags2["HasLiteralType"] = 128] = "HasLiteralType"; + CheckFlags2[CheckFlags2["ContainsPublic"] = 256] = "ContainsPublic"; + CheckFlags2[CheckFlags2["ContainsProtected"] = 512] = "ContainsProtected"; + CheckFlags2[CheckFlags2["ContainsPrivate"] = 1024] = "ContainsPrivate"; + CheckFlags2[CheckFlags2["ContainsStatic"] = 2048] = "ContainsStatic"; + CheckFlags2[CheckFlags2["Late"] = 4096] = "Late"; + CheckFlags2[CheckFlags2["ReverseMapped"] = 8192] = "ReverseMapped"; + CheckFlags2[CheckFlags2["OptionalParameter"] = 16384] = "OptionalParameter"; + CheckFlags2[CheckFlags2["RestParameter"] = 32768] = "RestParameter"; + CheckFlags2[CheckFlags2["DeferredType"] = 65536] = "DeferredType"; + CheckFlags2[CheckFlags2["HasNeverType"] = 131072] = "HasNeverType"; + CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped"; + CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional"; + CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved"; + CheckFlags2[CheckFlags2["Synthetic"] = 6] = "Synthetic"; + CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant"; + CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial"; + })(CheckFlags = ts2.CheckFlags || (ts2.CheckFlags = {})); + var InternalSymbolName; + (function(InternalSymbolName2) { + InternalSymbolName2["Call"] = "__call"; + InternalSymbolName2["Constructor"] = "__constructor"; + InternalSymbolName2["New"] = "__new"; + InternalSymbolName2["Index"] = "__index"; + InternalSymbolName2["ExportStar"] = "__export"; + InternalSymbolName2["Global"] = "__global"; + InternalSymbolName2["Missing"] = "__missing"; + InternalSymbolName2["Type"] = "__type"; + InternalSymbolName2["Object"] = "__object"; + InternalSymbolName2["JSXAttributes"] = "__jsxAttributes"; + InternalSymbolName2["Class"] = "__class"; + InternalSymbolName2["Function"] = "__function"; + InternalSymbolName2["Computed"] = "__computed"; + InternalSymbolName2["Resolving"] = "__resolving__"; + InternalSymbolName2["ExportEquals"] = "export="; + InternalSymbolName2["Default"] = "default"; + InternalSymbolName2["This"] = "this"; + })(InternalSymbolName = ts2.InternalSymbolName || (ts2.InternalSymbolName = {})); + var NodeCheckFlags; + (function(NodeCheckFlags2) { + NodeCheckFlags2[NodeCheckFlags2["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags2[NodeCheckFlags2["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags2[NodeCheckFlags2["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags2[NodeCheckFlags2["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags2[NodeCheckFlags2["SuperInstance"] = 256] = "SuperInstance"; + NodeCheckFlags2[NodeCheckFlags2["SuperStatic"] = 512] = "SuperStatic"; + NodeCheckFlags2[NodeCheckFlags2["ContextChecked"] = 1024] = "ContextChecked"; + NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAccessInAsync"] = 2048] = "MethodWithSuperPropertyAccessInAsync"; + NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAssignmentInAsync"] = 4096] = "MethodWithSuperPropertyAssignmentInAsync"; + NodeCheckFlags2[NodeCheckFlags2["CaptureArguments"] = 8192] = "CaptureArguments"; + NodeCheckFlags2[NodeCheckFlags2["EnumValuesComputed"] = 16384] = "EnumValuesComputed"; + NodeCheckFlags2[NodeCheckFlags2["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass"; + NodeCheckFlags2[NodeCheckFlags2["LoopWithCapturedBlockScopedBinding"] = 65536] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 131072] = "ContainsCapturedBlockScopeBinding"; + NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 262144] = "CapturedBlockScopedBinding"; + NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 524288] = "BlockScopedBindingInLoop"; + NodeCheckFlags2[NodeCheckFlags2["ClassWithBodyScopedClassBinding"] = 1048576] = "ClassWithBodyScopedClassBinding"; + NodeCheckFlags2[NodeCheckFlags2["BodyScopedClassBinding"] = 2097152] = "BodyScopedClassBinding"; + NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 4194304] = "NeedsLoopOutParameter"; + NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 8388608] = "AssignmentsMarked"; + NodeCheckFlags2[NodeCheckFlags2["ClassWithConstructorReference"] = 16777216] = "ClassWithConstructorReference"; + NodeCheckFlags2[NodeCheckFlags2["ConstructorReferenceInClass"] = 33554432] = "ConstructorReferenceInClass"; + NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 67108864] = "ContainsClassWithPrivateIdentifiers"; + NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 134217728] = "ContainsSuperPropertyInStaticInitializer"; + NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 268435456] = "InCheckIdentifier"; + })(NodeCheckFlags = ts2.NodeCheckFlags || (ts2.NodeCheckFlags = {})); + var TypeFlags; + (function(TypeFlags2) { + TypeFlags2[TypeFlags2["Any"] = 1] = "Any"; + TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown"; + TypeFlags2[TypeFlags2["String"] = 4] = "String"; + TypeFlags2[TypeFlags2["Number"] = 8] = "Number"; + TypeFlags2[TypeFlags2["Boolean"] = 16] = "Boolean"; + TypeFlags2[TypeFlags2["Enum"] = 32] = "Enum"; + TypeFlags2[TypeFlags2["BigInt"] = 64] = "BigInt"; + TypeFlags2[TypeFlags2["StringLiteral"] = 128] = "StringLiteral"; + TypeFlags2[TypeFlags2["NumberLiteral"] = 256] = "NumberLiteral"; + TypeFlags2[TypeFlags2["BooleanLiteral"] = 512] = "BooleanLiteral"; + TypeFlags2[TypeFlags2["EnumLiteral"] = 1024] = "EnumLiteral"; + TypeFlags2[TypeFlags2["BigIntLiteral"] = 2048] = "BigIntLiteral"; + TypeFlags2[TypeFlags2["ESSymbol"] = 4096] = "ESSymbol"; + TypeFlags2[TypeFlags2["UniqueESSymbol"] = 8192] = "UniqueESSymbol"; + TypeFlags2[TypeFlags2["Void"] = 16384] = "Void"; + TypeFlags2[TypeFlags2["Undefined"] = 32768] = "Undefined"; + TypeFlags2[TypeFlags2["Null"] = 65536] = "Null"; + TypeFlags2[TypeFlags2["Never"] = 131072] = "Never"; + TypeFlags2[TypeFlags2["TypeParameter"] = 262144] = "TypeParameter"; + TypeFlags2[TypeFlags2["Object"] = 524288] = "Object"; + TypeFlags2[TypeFlags2["Union"] = 1048576] = "Union"; + TypeFlags2[TypeFlags2["Intersection"] = 2097152] = "Intersection"; + TypeFlags2[TypeFlags2["Index"] = 4194304] = "Index"; + TypeFlags2[TypeFlags2["IndexedAccess"] = 8388608] = "IndexedAccess"; + TypeFlags2[TypeFlags2["Conditional"] = 16777216] = "Conditional"; + TypeFlags2[TypeFlags2["Substitution"] = 33554432] = "Substitution"; + TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral"; + TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping"; + TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; + TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; + TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; + TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; + TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; + TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; + TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; + TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; + TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; + TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; + TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; + TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; + TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; + TypeFlags2[TypeFlags2["BooleanLike"] = 528] = "BooleanLike"; + TypeFlags2[TypeFlags2["EnumLike"] = 1056] = "EnumLike"; + TypeFlags2[TypeFlags2["ESSymbolLike"] = 12288] = "ESSymbolLike"; + TypeFlags2[TypeFlags2["VoidLike"] = 49152] = "VoidLike"; + TypeFlags2[TypeFlags2["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable"; + TypeFlags2[TypeFlags2["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags2[TypeFlags2["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; + TypeFlags2[TypeFlags2["StructuredType"] = 3670016] = "StructuredType"; + TypeFlags2[TypeFlags2["TypeVariable"] = 8650752] = "TypeVariable"; + TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; + TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable"; + TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; + TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable"; + TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton"; + TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags2[TypeFlags2["IncludesMask"] = 205258751] = "IncludesMask"; + TypeFlags2[TypeFlags2["IncludesMissingType"] = 262144] = "IncludesMissingType"; + TypeFlags2[TypeFlags2["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType"; + TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608] = "IncludesWildcard"; + TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216] = "IncludesEmptyObject"; + TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432] = "IncludesInstantiable"; + TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion"; + })(TypeFlags = ts2.TypeFlags || (ts2.TypeFlags = {})); + var ObjectFlags; + (function(ObjectFlags2) { + ObjectFlags2[ObjectFlags2["Class"] = 1] = "Class"; + ObjectFlags2[ObjectFlags2["Interface"] = 2] = "Interface"; + ObjectFlags2[ObjectFlags2["Reference"] = 4] = "Reference"; + ObjectFlags2[ObjectFlags2["Tuple"] = 8] = "Tuple"; + ObjectFlags2[ObjectFlags2["Anonymous"] = 16] = "Anonymous"; + ObjectFlags2[ObjectFlags2["Mapped"] = 32] = "Mapped"; + ObjectFlags2[ObjectFlags2["Instantiated"] = 64] = "Instantiated"; + ObjectFlags2[ObjectFlags2["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags2[ObjectFlags2["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags2[ObjectFlags2["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags2[ObjectFlags2["ReverseMapped"] = 1024] = "ReverseMapped"; + ObjectFlags2[ObjectFlags2["JsxAttributes"] = 2048] = "JsxAttributes"; + ObjectFlags2[ObjectFlags2["JSLiteral"] = 4096] = "JSLiteral"; + ObjectFlags2[ObjectFlags2["FreshLiteral"] = 8192] = "FreshLiteral"; + ObjectFlags2[ObjectFlags2["ArrayLiteral"] = 16384] = "ArrayLiteral"; + ObjectFlags2[ObjectFlags2["PrimitiveUnion"] = 32768] = "PrimitiveUnion"; + ObjectFlags2[ObjectFlags2["ContainsWideningType"] = 65536] = "ContainsWideningType"; + ObjectFlags2[ObjectFlags2["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral"; + ObjectFlags2[ObjectFlags2["NonInferrableType"] = 262144] = "NonInferrableType"; + ObjectFlags2[ObjectFlags2["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; + ObjectFlags2[ObjectFlags2["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; + ObjectFlags2[ObjectFlags2["ClassOrInterface"] = 3] = "ClassOrInterface"; + ObjectFlags2[ObjectFlags2["RequiresWidening"] = 196608] = "RequiresWidening"; + ObjectFlags2[ObjectFlags2["PropagatingFlags"] = 458752] = "PropagatingFlags"; + ObjectFlags2[ObjectFlags2["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask"; + ObjectFlags2[ObjectFlags2["ContainsSpread"] = 2097152] = "ContainsSpread"; + ObjectFlags2[ObjectFlags2["ObjectRestType"] = 4194304] = "ObjectRestType"; + ObjectFlags2[ObjectFlags2["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; + ObjectFlags2[ObjectFlags2["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; + ObjectFlags2[ObjectFlags2["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; + ObjectFlags2[ObjectFlags2["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; + ObjectFlags2[ObjectFlags2["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed"; + ObjectFlags2[ObjectFlags2["IsGenericObjectType"] = 4194304] = "IsGenericObjectType"; + ObjectFlags2[ObjectFlags2["IsGenericIndexType"] = 8388608] = "IsGenericIndexType"; + ObjectFlags2[ObjectFlags2["IsGenericType"] = 12582912] = "IsGenericType"; + ObjectFlags2[ObjectFlags2["ContainsIntersections"] = 16777216] = "ContainsIntersections"; + ObjectFlags2[ObjectFlags2["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed"; + ObjectFlags2[ObjectFlags2["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion"; + ObjectFlags2[ObjectFlags2["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed"; + ObjectFlags2[ObjectFlags2["IsNeverIntersection"] = 33554432] = "IsNeverIntersection"; + })(ObjectFlags = ts2.ObjectFlags || (ts2.ObjectFlags = {})); + var VarianceFlags; + (function(VarianceFlags2) { + VarianceFlags2[VarianceFlags2["Invariant"] = 0] = "Invariant"; + VarianceFlags2[VarianceFlags2["Covariant"] = 1] = "Covariant"; + VarianceFlags2[VarianceFlags2["Contravariant"] = 2] = "Contravariant"; + VarianceFlags2[VarianceFlags2["Bivariant"] = 3] = "Bivariant"; + VarianceFlags2[VarianceFlags2["Independent"] = 4] = "Independent"; + VarianceFlags2[VarianceFlags2["VarianceMask"] = 7] = "VarianceMask"; + VarianceFlags2[VarianceFlags2["Unmeasurable"] = 8] = "Unmeasurable"; + VarianceFlags2[VarianceFlags2["Unreliable"] = 16] = "Unreliable"; + VarianceFlags2[VarianceFlags2["AllowsStructuralFallback"] = 24] = "AllowsStructuralFallback"; + })(VarianceFlags = ts2.VarianceFlags || (ts2.VarianceFlags = {})); + var ElementFlags; + (function(ElementFlags2) { + ElementFlags2[ElementFlags2["Required"] = 1] = "Required"; + ElementFlags2[ElementFlags2["Optional"] = 2] = "Optional"; + ElementFlags2[ElementFlags2["Rest"] = 4] = "Rest"; + ElementFlags2[ElementFlags2["Variadic"] = 8] = "Variadic"; + ElementFlags2[ElementFlags2["Fixed"] = 3] = "Fixed"; + ElementFlags2[ElementFlags2["Variable"] = 12] = "Variable"; + ElementFlags2[ElementFlags2["NonRequired"] = 14] = "NonRequired"; + ElementFlags2[ElementFlags2["NonRest"] = 11] = "NonRest"; + })(ElementFlags = ts2.ElementFlags || (ts2.ElementFlags = {})); + var AccessFlags; + (function(AccessFlags2) { + AccessFlags2[AccessFlags2["None"] = 0] = "None"; + AccessFlags2[AccessFlags2["IncludeUndefined"] = 1] = "IncludeUndefined"; + AccessFlags2[AccessFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures"; + AccessFlags2[AccessFlags2["Writing"] = 4] = "Writing"; + AccessFlags2[AccessFlags2["CacheSymbol"] = 8] = "CacheSymbol"; + AccessFlags2[AccessFlags2["NoTupleBoundsCheck"] = 16] = "NoTupleBoundsCheck"; + AccessFlags2[AccessFlags2["ExpressionPosition"] = 32] = "ExpressionPosition"; + AccessFlags2[AccessFlags2["ReportDeprecated"] = 64] = "ReportDeprecated"; + AccessFlags2[AccessFlags2["SuppressNoImplicitAnyError"] = 128] = "SuppressNoImplicitAnyError"; + AccessFlags2[AccessFlags2["Contextual"] = 256] = "Contextual"; + AccessFlags2[AccessFlags2["Persistent"] = 1] = "Persistent"; + })(AccessFlags = ts2.AccessFlags || (ts2.AccessFlags = {})); + var JsxReferenceKind; + (function(JsxReferenceKind2) { + JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component"; + JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function"; + JsxReferenceKind2[JsxReferenceKind2["Mixed"] = 2] = "Mixed"; + })(JsxReferenceKind = ts2.JsxReferenceKind || (ts2.JsxReferenceKind = {})); + var SignatureKind; + (function(SignatureKind2) { + SignatureKind2[SignatureKind2["Call"] = 0] = "Call"; + SignatureKind2[SignatureKind2["Construct"] = 1] = "Construct"; + })(SignatureKind = ts2.SignatureKind || (ts2.SignatureKind = {})); + var SignatureFlags; + (function(SignatureFlags2) { + SignatureFlags2[SignatureFlags2["None"] = 0] = "None"; + SignatureFlags2[SignatureFlags2["HasRestParameter"] = 1] = "HasRestParameter"; + SignatureFlags2[SignatureFlags2["HasLiteralTypes"] = 2] = "HasLiteralTypes"; + SignatureFlags2[SignatureFlags2["Abstract"] = 4] = "Abstract"; + SignatureFlags2[SignatureFlags2["IsInnerCallChain"] = 8] = "IsInnerCallChain"; + SignatureFlags2[SignatureFlags2["IsOuterCallChain"] = 16] = "IsOuterCallChain"; + SignatureFlags2[SignatureFlags2["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile"; + SignatureFlags2[SignatureFlags2["PropagatingFlags"] = 39] = "PropagatingFlags"; + SignatureFlags2[SignatureFlags2["CallChainFlags"] = 24] = "CallChainFlags"; + })(SignatureFlags = ts2.SignatureFlags || (ts2.SignatureFlags = {})); + var IndexKind; + (function(IndexKind2) { + IndexKind2[IndexKind2["String"] = 0] = "String"; + IndexKind2[IndexKind2["Number"] = 1] = "Number"; + })(IndexKind = ts2.IndexKind || (ts2.IndexKind = {})); + var TypeMapKind; + (function(TypeMapKind2) { + TypeMapKind2[TypeMapKind2["Simple"] = 0] = "Simple"; + TypeMapKind2[TypeMapKind2["Array"] = 1] = "Array"; + TypeMapKind2[TypeMapKind2["Deferred"] = 2] = "Deferred"; + TypeMapKind2[TypeMapKind2["Function"] = 3] = "Function"; + TypeMapKind2[TypeMapKind2["Composite"] = 4] = "Composite"; + TypeMapKind2[TypeMapKind2["Merged"] = 5] = "Merged"; + })(TypeMapKind = ts2.TypeMapKind || (ts2.TypeMapKind = {})); + var InferencePriority; + (function(InferencePriority2) { + InferencePriority2[InferencePriority2["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority2[InferencePriority2["SpeculativeTuple"] = 2] = "SpeculativeTuple"; + InferencePriority2[InferencePriority2["SubstituteSource"] = 4] = "SubstituteSource"; + InferencePriority2[InferencePriority2["HomomorphicMappedType"] = 8] = "HomomorphicMappedType"; + InferencePriority2[InferencePriority2["PartialHomomorphicMappedType"] = 16] = "PartialHomomorphicMappedType"; + InferencePriority2[InferencePriority2["MappedTypeConstraint"] = 32] = "MappedTypeConstraint"; + InferencePriority2[InferencePriority2["ContravariantConditional"] = 64] = "ContravariantConditional"; + InferencePriority2[InferencePriority2["ReturnType"] = 128] = "ReturnType"; + InferencePriority2[InferencePriority2["LiteralKeyof"] = 256] = "LiteralKeyof"; + InferencePriority2[InferencePriority2["NoConstraints"] = 512] = "NoConstraints"; + InferencePriority2[InferencePriority2["AlwaysStrict"] = 1024] = "AlwaysStrict"; + InferencePriority2[InferencePriority2["MaxValue"] = 2048] = "MaxValue"; + InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 416] = "PriorityImpliesCombination"; + InferencePriority2[InferencePriority2["Circularity"] = -1] = "Circularity"; + })(InferencePriority = ts2.InferencePriority || (ts2.InferencePriority = {})); + var InferenceFlags; + (function(InferenceFlags2) { + InferenceFlags2[InferenceFlags2["None"] = 0] = "None"; + InferenceFlags2[InferenceFlags2["NoDefault"] = 1] = "NoDefault"; + InferenceFlags2[InferenceFlags2["AnyDefault"] = 2] = "AnyDefault"; + InferenceFlags2[InferenceFlags2["SkippedGenericFunction"] = 4] = "SkippedGenericFunction"; + })(InferenceFlags = ts2.InferenceFlags || (ts2.InferenceFlags = {})); + var Ternary; + (function(Ternary2) { + Ternary2[Ternary2["False"] = 0] = "False"; + Ternary2[Ternary2["Unknown"] = 1] = "Unknown"; + Ternary2[Ternary2["Maybe"] = 3] = "Maybe"; + Ternary2[Ternary2["True"] = -1] = "True"; + })(Ternary = ts2.Ternary || (ts2.Ternary = {})); + var AssignmentDeclarationKind; + (function(AssignmentDeclarationKind2) { + AssignmentDeclarationKind2[AssignmentDeclarationKind2["None"] = 0] = "None"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ExportsProperty"] = 1] = "ExportsProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ModuleExports"] = 2] = "ModuleExports"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["PrototypeProperty"] = 3] = "PrototypeProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ThisProperty"] = 4] = "ThisProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["Property"] = 5] = "Property"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["Prototype"] = 6] = "Prototype"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyValue"] = 7] = "ObjectDefinePropertyValue"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyExports"] = 8] = "ObjectDefinePropertyExports"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePrototypeProperty"] = 9] = "ObjectDefinePrototypeProperty"; + })(AssignmentDeclarationKind = ts2.AssignmentDeclarationKind || (ts2.AssignmentDeclarationKind = {})); + var DiagnosticCategory; + (function(DiagnosticCategory2) { + DiagnosticCategory2[DiagnosticCategory2["Warning"] = 0] = "Warning"; + DiagnosticCategory2[DiagnosticCategory2["Error"] = 1] = "Error"; + DiagnosticCategory2[DiagnosticCategory2["Suggestion"] = 2] = "Suggestion"; + DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message"; + })(DiagnosticCategory = ts2.DiagnosticCategory || (ts2.DiagnosticCategory = {})); + function diagnosticCategoryName(d7, lowerCase3) { + if (lowerCase3 === void 0) { + lowerCase3 = true; + } + var name2 = DiagnosticCategory[d7.category]; + return lowerCase3 ? name2.toLowerCase() : name2; + } + ts2.diagnosticCategoryName = diagnosticCategoryName; + var ModuleResolutionKind; + (function(ModuleResolutionKind2) { + ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; + ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; + ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; + ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; + })(ModuleResolutionKind = ts2.ModuleResolutionKind || (ts2.ModuleResolutionKind = {})); + var ModuleDetectionKind; + (function(ModuleDetectionKind2) { + ModuleDetectionKind2[ModuleDetectionKind2["Legacy"] = 1] = "Legacy"; + ModuleDetectionKind2[ModuleDetectionKind2["Auto"] = 2] = "Auto"; + ModuleDetectionKind2[ModuleDetectionKind2["Force"] = 3] = "Force"; + })(ModuleDetectionKind = ts2.ModuleDetectionKind || (ts2.ModuleDetectionKind = {})); + var WatchFileKind; + (function(WatchFileKind2) { + WatchFileKind2[WatchFileKind2["FixedPollingInterval"] = 0] = "FixedPollingInterval"; + WatchFileKind2[WatchFileKind2["PriorityPollingInterval"] = 1] = "PriorityPollingInterval"; + WatchFileKind2[WatchFileKind2["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchFileKind2[WatchFileKind2["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + WatchFileKind2[WatchFileKind2["UseFsEvents"] = 4] = "UseFsEvents"; + WatchFileKind2[WatchFileKind2["UseFsEventsOnParentDirectory"] = 5] = "UseFsEventsOnParentDirectory"; + })(WatchFileKind = ts2.WatchFileKind || (ts2.WatchFileKind = {})); + var WatchDirectoryKind; + (function(WatchDirectoryKind2) { + WatchDirectoryKind2[WatchDirectoryKind2["UseFsEvents"] = 0] = "UseFsEvents"; + WatchDirectoryKind2[WatchDirectoryKind2["FixedPollingInterval"] = 1] = "FixedPollingInterval"; + WatchDirectoryKind2[WatchDirectoryKind2["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchDirectoryKind2[WatchDirectoryKind2["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + })(WatchDirectoryKind = ts2.WatchDirectoryKind || (ts2.WatchDirectoryKind = {})); + var PollingWatchKind; + (function(PollingWatchKind2) { + PollingWatchKind2[PollingWatchKind2["FixedInterval"] = 0] = "FixedInterval"; + PollingWatchKind2[PollingWatchKind2["PriorityInterval"] = 1] = "PriorityInterval"; + PollingWatchKind2[PollingWatchKind2["DynamicPriority"] = 2] = "DynamicPriority"; + PollingWatchKind2[PollingWatchKind2["FixedChunkSize"] = 3] = "FixedChunkSize"; + })(PollingWatchKind = ts2.PollingWatchKind || (ts2.PollingWatchKind = {})); + var ModuleKind; + (function(ModuleKind2) { + ModuleKind2[ModuleKind2["None"] = 0] = "None"; + ModuleKind2[ModuleKind2["CommonJS"] = 1] = "CommonJS"; + ModuleKind2[ModuleKind2["AMD"] = 2] = "AMD"; + ModuleKind2[ModuleKind2["UMD"] = 3] = "UMD"; + ModuleKind2[ModuleKind2["System"] = 4] = "System"; + ModuleKind2[ModuleKind2["ES2015"] = 5] = "ES2015"; + ModuleKind2[ModuleKind2["ES2020"] = 6] = "ES2020"; + ModuleKind2[ModuleKind2["ES2022"] = 7] = "ES2022"; + ModuleKind2[ModuleKind2["ESNext"] = 99] = "ESNext"; + ModuleKind2[ModuleKind2["Node16"] = 100] = "Node16"; + ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext"; + })(ModuleKind = ts2.ModuleKind || (ts2.ModuleKind = {})); + var JsxEmit; + (function(JsxEmit2) { + JsxEmit2[JsxEmit2["None"] = 0] = "None"; + JsxEmit2[JsxEmit2["Preserve"] = 1] = "Preserve"; + JsxEmit2[JsxEmit2["React"] = 2] = "React"; + JsxEmit2[JsxEmit2["ReactNative"] = 3] = "ReactNative"; + JsxEmit2[JsxEmit2["ReactJSX"] = 4] = "ReactJSX"; + JsxEmit2[JsxEmit2["ReactJSXDev"] = 5] = "ReactJSXDev"; + })(JsxEmit = ts2.JsxEmit || (ts2.JsxEmit = {})); + var ImportsNotUsedAsValues; + (function(ImportsNotUsedAsValues2) { + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Remove"] = 0] = "Remove"; + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Preserve"] = 1] = "Preserve"; + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Error"] = 2] = "Error"; + })(ImportsNotUsedAsValues = ts2.ImportsNotUsedAsValues || (ts2.ImportsNotUsedAsValues = {})); + var NewLineKind; + (function(NewLineKind2) { + NewLineKind2[NewLineKind2["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind2[NewLineKind2["LineFeed"] = 1] = "LineFeed"; + })(NewLineKind = ts2.NewLineKind || (ts2.NewLineKind = {})); + var ScriptKind; + (function(ScriptKind2) { + ScriptKind2[ScriptKind2["Unknown"] = 0] = "Unknown"; + ScriptKind2[ScriptKind2["JS"] = 1] = "JS"; + ScriptKind2[ScriptKind2["JSX"] = 2] = "JSX"; + ScriptKind2[ScriptKind2["TS"] = 3] = "TS"; + ScriptKind2[ScriptKind2["TSX"] = 4] = "TSX"; + ScriptKind2[ScriptKind2["External"] = 5] = "External"; + ScriptKind2[ScriptKind2["JSON"] = 6] = "JSON"; + ScriptKind2[ScriptKind2["Deferred"] = 7] = "Deferred"; + })(ScriptKind = ts2.ScriptKind || (ts2.ScriptKind = {})); + var ScriptTarget; + (function(ScriptTarget2) { + ScriptTarget2[ScriptTarget2["ES3"] = 0] = "ES3"; + ScriptTarget2[ScriptTarget2["ES5"] = 1] = "ES5"; + ScriptTarget2[ScriptTarget2["ES2015"] = 2] = "ES2015"; + ScriptTarget2[ScriptTarget2["ES2016"] = 3] = "ES2016"; + ScriptTarget2[ScriptTarget2["ES2017"] = 4] = "ES2017"; + ScriptTarget2[ScriptTarget2["ES2018"] = 5] = "ES2018"; + ScriptTarget2[ScriptTarget2["ES2019"] = 6] = "ES2019"; + ScriptTarget2[ScriptTarget2["ES2020"] = 7] = "ES2020"; + ScriptTarget2[ScriptTarget2["ES2021"] = 8] = "ES2021"; + ScriptTarget2[ScriptTarget2["ES2022"] = 9] = "ES2022"; + ScriptTarget2[ScriptTarget2["ESNext"] = 99] = "ESNext"; + ScriptTarget2[ScriptTarget2["JSON"] = 100] = "JSON"; + ScriptTarget2[ScriptTarget2["Latest"] = 99] = "Latest"; + })(ScriptTarget = ts2.ScriptTarget || (ts2.ScriptTarget = {})); + var LanguageVariant; + (function(LanguageVariant2) { + LanguageVariant2[LanguageVariant2["Standard"] = 0] = "Standard"; + LanguageVariant2[LanguageVariant2["JSX"] = 1] = "JSX"; + })(LanguageVariant = ts2.LanguageVariant || (ts2.LanguageVariant = {})); + var WatchDirectoryFlags; + (function(WatchDirectoryFlags2) { + WatchDirectoryFlags2[WatchDirectoryFlags2["None"] = 0] = "None"; + WatchDirectoryFlags2[WatchDirectoryFlags2["Recursive"] = 1] = "Recursive"; + })(WatchDirectoryFlags = ts2.WatchDirectoryFlags || (ts2.WatchDirectoryFlags = {})); + var CharacterCodes; + (function(CharacterCodes2) { + CharacterCodes2[CharacterCodes2["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes2[CharacterCodes2["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed"; + CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes2[CharacterCodes2["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes2[CharacterCodes2["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes2[CharacterCodes2["nextLine"] = 133] = "nextLine"; + CharacterCodes2[CharacterCodes2["space"] = 32] = "space"; + CharacterCodes2[CharacterCodes2["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes2[CharacterCodes2["enQuad"] = 8192] = "enQuad"; + CharacterCodes2[CharacterCodes2["emQuad"] = 8193] = "emQuad"; + CharacterCodes2[CharacterCodes2["enSpace"] = 8194] = "enSpace"; + CharacterCodes2[CharacterCodes2["emSpace"] = 8195] = "emSpace"; + CharacterCodes2[CharacterCodes2["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes2[CharacterCodes2["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes2[CharacterCodes2["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes2[CharacterCodes2["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes2[CharacterCodes2["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes2[CharacterCodes2["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes2[CharacterCodes2["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes2[CharacterCodes2["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes2[CharacterCodes2["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham"; + CharacterCodes2[CharacterCodes2["_"] = 95] = "_"; + CharacterCodes2[CharacterCodes2["$"] = 36] = "$"; + CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0"; + CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1"; + CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2"; + CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3"; + CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4"; + CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5"; + CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6"; + CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7"; + CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8"; + CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9"; + CharacterCodes2[CharacterCodes2["a"] = 97] = "a"; + CharacterCodes2[CharacterCodes2["b"] = 98] = "b"; + CharacterCodes2[CharacterCodes2["c"] = 99] = "c"; + CharacterCodes2[CharacterCodes2["d"] = 100] = "d"; + CharacterCodes2[CharacterCodes2["e"] = 101] = "e"; + CharacterCodes2[CharacterCodes2["f"] = 102] = "f"; + CharacterCodes2[CharacterCodes2["g"] = 103] = "g"; + CharacterCodes2[CharacterCodes2["h"] = 104] = "h"; + CharacterCodes2[CharacterCodes2["i"] = 105] = "i"; + CharacterCodes2[CharacterCodes2["j"] = 106] = "j"; + CharacterCodes2[CharacterCodes2["k"] = 107] = "k"; + CharacterCodes2[CharacterCodes2["l"] = 108] = "l"; + CharacterCodes2[CharacterCodes2["m"] = 109] = "m"; + CharacterCodes2[CharacterCodes2["n"] = 110] = "n"; + CharacterCodes2[CharacterCodes2["o"] = 111] = "o"; + CharacterCodes2[CharacterCodes2["p"] = 112] = "p"; + CharacterCodes2[CharacterCodes2["q"] = 113] = "q"; + CharacterCodes2[CharacterCodes2["r"] = 114] = "r"; + CharacterCodes2[CharacterCodes2["s"] = 115] = "s"; + CharacterCodes2[CharacterCodes2["t"] = 116] = "t"; + CharacterCodes2[CharacterCodes2["u"] = 117] = "u"; + CharacterCodes2[CharacterCodes2["v"] = 118] = "v"; + CharacterCodes2[CharacterCodes2["w"] = 119] = "w"; + CharacterCodes2[CharacterCodes2["x"] = 120] = "x"; + CharacterCodes2[CharacterCodes2["y"] = 121] = "y"; + CharacterCodes2[CharacterCodes2["z"] = 122] = "z"; + CharacterCodes2[CharacterCodes2["A"] = 65] = "A"; + CharacterCodes2[CharacterCodes2["B"] = 66] = "B"; + CharacterCodes2[CharacterCodes2["C"] = 67] = "C"; + CharacterCodes2[CharacterCodes2["D"] = 68] = "D"; + CharacterCodes2[CharacterCodes2["E"] = 69] = "E"; + CharacterCodes2[CharacterCodes2["F"] = 70] = "F"; + CharacterCodes2[CharacterCodes2["G"] = 71] = "G"; + CharacterCodes2[CharacterCodes2["H"] = 72] = "H"; + CharacterCodes2[CharacterCodes2["I"] = 73] = "I"; + CharacterCodes2[CharacterCodes2["J"] = 74] = "J"; + CharacterCodes2[CharacterCodes2["K"] = 75] = "K"; + CharacterCodes2[CharacterCodes2["L"] = 76] = "L"; + CharacterCodes2[CharacterCodes2["M"] = 77] = "M"; + CharacterCodes2[CharacterCodes2["N"] = 78] = "N"; + CharacterCodes2[CharacterCodes2["O"] = 79] = "O"; + CharacterCodes2[CharacterCodes2["P"] = 80] = "P"; + CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q"; + CharacterCodes2[CharacterCodes2["R"] = 82] = "R"; + CharacterCodes2[CharacterCodes2["S"] = 83] = "S"; + CharacterCodes2[CharacterCodes2["T"] = 84] = "T"; + CharacterCodes2[CharacterCodes2["U"] = 85] = "U"; + CharacterCodes2[CharacterCodes2["V"] = 86] = "V"; + CharacterCodes2[CharacterCodes2["W"] = 87] = "W"; + CharacterCodes2[CharacterCodes2["X"] = 88] = "X"; + CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y"; + CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z"; + CharacterCodes2[CharacterCodes2["ampersand"] = 38] = "ampersand"; + CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk"; + CharacterCodes2[CharacterCodes2["at"] = 64] = "at"; + CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash"; + CharacterCodes2[CharacterCodes2["backtick"] = 96] = "backtick"; + CharacterCodes2[CharacterCodes2["bar"] = 124] = "bar"; + CharacterCodes2[CharacterCodes2["caret"] = 94] = "caret"; + CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace"; + CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket"; + CharacterCodes2[CharacterCodes2["closeParen"] = 41] = "closeParen"; + CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon"; + CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma"; + CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot"; + CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes2[CharacterCodes2["equals"] = 61] = "equals"; + CharacterCodes2[CharacterCodes2["exclamation"] = 33] = "exclamation"; + CharacterCodes2[CharacterCodes2["greaterThan"] = 62] = "greaterThan"; + CharacterCodes2[CharacterCodes2["hash"] = 35] = "hash"; + CharacterCodes2[CharacterCodes2["lessThan"] = 60] = "lessThan"; + CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus"; + CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace"; + CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket"; + CharacterCodes2[CharacterCodes2["openParen"] = 40] = "openParen"; + CharacterCodes2[CharacterCodes2["percent"] = 37] = "percent"; + CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus"; + CharacterCodes2[CharacterCodes2["question"] = 63] = "question"; + CharacterCodes2[CharacterCodes2["semicolon"] = 59] = "semicolon"; + CharacterCodes2[CharacterCodes2["singleQuote"] = 39] = "singleQuote"; + CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash"; + CharacterCodes2[CharacterCodes2["tilde"] = 126] = "tilde"; + CharacterCodes2[CharacterCodes2["backspace"] = 8] = "backspace"; + CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed"; + CharacterCodes2[CharacterCodes2["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab"; + CharacterCodes2[CharacterCodes2["verticalTab"] = 11] = "verticalTab"; + })(CharacterCodes = ts2.CharacterCodes || (ts2.CharacterCodes = {})); + var Extension6; + (function(Extension7) { + Extension7["Ts"] = ".ts"; + Extension7["Tsx"] = ".tsx"; + Extension7["Dts"] = ".d.ts"; + Extension7["Js"] = ".js"; + Extension7["Jsx"] = ".jsx"; + Extension7["Json"] = ".json"; + Extension7["TsBuildInfo"] = ".tsbuildinfo"; + Extension7["Mjs"] = ".mjs"; + Extension7["Mts"] = ".mts"; + Extension7["Dmts"] = ".d.mts"; + Extension7["Cjs"] = ".cjs"; + Extension7["Cts"] = ".cts"; + Extension7["Dcts"] = ".d.cts"; + })(Extension6 = ts2.Extension || (ts2.Extension = {})); + var TransformFlags; + (function(TransformFlags2) { + TransformFlags2[TransformFlags2["None"] = 0] = "None"; + TransformFlags2[TransformFlags2["ContainsTypeScript"] = 1] = "ContainsTypeScript"; + TransformFlags2[TransformFlags2["ContainsJsx"] = 2] = "ContainsJsx"; + TransformFlags2[TransformFlags2["ContainsESNext"] = 4] = "ContainsESNext"; + TransformFlags2[TransformFlags2["ContainsES2022"] = 8] = "ContainsES2022"; + TransformFlags2[TransformFlags2["ContainsES2021"] = 16] = "ContainsES2021"; + TransformFlags2[TransformFlags2["ContainsES2020"] = 32] = "ContainsES2020"; + TransformFlags2[TransformFlags2["ContainsES2019"] = 64] = "ContainsES2019"; + TransformFlags2[TransformFlags2["ContainsES2018"] = 128] = "ContainsES2018"; + TransformFlags2[TransformFlags2["ContainsES2017"] = 256] = "ContainsES2017"; + TransformFlags2[TransformFlags2["ContainsES2016"] = 512] = "ContainsES2016"; + TransformFlags2[TransformFlags2["ContainsES2015"] = 1024] = "ContainsES2015"; + TransformFlags2[TransformFlags2["ContainsGenerator"] = 2048] = "ContainsGenerator"; + TransformFlags2[TransformFlags2["ContainsDestructuringAssignment"] = 4096] = "ContainsDestructuringAssignment"; + TransformFlags2[TransformFlags2["ContainsTypeScriptClassSyntax"] = 8192] = "ContainsTypeScriptClassSyntax"; + TransformFlags2[TransformFlags2["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags2[TransformFlags2["ContainsRestOrSpread"] = 32768] = "ContainsRestOrSpread"; + TransformFlags2[TransformFlags2["ContainsObjectRestOrSpread"] = 65536] = "ContainsObjectRestOrSpread"; + TransformFlags2[TransformFlags2["ContainsComputedPropertyName"] = 131072] = "ContainsComputedPropertyName"; + TransformFlags2[TransformFlags2["ContainsBlockScopedBinding"] = 262144] = "ContainsBlockScopedBinding"; + TransformFlags2[TransformFlags2["ContainsBindingPattern"] = 524288] = "ContainsBindingPattern"; + TransformFlags2[TransformFlags2["ContainsYield"] = 1048576] = "ContainsYield"; + TransformFlags2[TransformFlags2["ContainsAwait"] = 2097152] = "ContainsAwait"; + TransformFlags2[TransformFlags2["ContainsHoistedDeclarationOrCompletion"] = 4194304] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags2[TransformFlags2["ContainsDynamicImport"] = 8388608] = "ContainsDynamicImport"; + TransformFlags2[TransformFlags2["ContainsClassFields"] = 16777216] = "ContainsClassFields"; + TransformFlags2[TransformFlags2["ContainsDecorators"] = 33554432] = "ContainsDecorators"; + TransformFlags2[TransformFlags2["ContainsPossibleTopLevelAwait"] = 67108864] = "ContainsPossibleTopLevelAwait"; + TransformFlags2[TransformFlags2["ContainsLexicalSuper"] = 134217728] = "ContainsLexicalSuper"; + TransformFlags2[TransformFlags2["ContainsUpdateExpressionForIdentifier"] = 268435456] = "ContainsUpdateExpressionForIdentifier"; + TransformFlags2[TransformFlags2["ContainsPrivateIdentifierInExpression"] = 536870912] = "ContainsPrivateIdentifierInExpression"; + TransformFlags2[TransformFlags2["HasComputedFlags"] = -2147483648] = "HasComputedFlags"; + TransformFlags2[TransformFlags2["AssertTypeScript"] = 1] = "AssertTypeScript"; + TransformFlags2[TransformFlags2["AssertJsx"] = 2] = "AssertJsx"; + TransformFlags2[TransformFlags2["AssertESNext"] = 4] = "AssertESNext"; + TransformFlags2[TransformFlags2["AssertES2022"] = 8] = "AssertES2022"; + TransformFlags2[TransformFlags2["AssertES2021"] = 16] = "AssertES2021"; + TransformFlags2[TransformFlags2["AssertES2020"] = 32] = "AssertES2020"; + TransformFlags2[TransformFlags2["AssertES2019"] = 64] = "AssertES2019"; + TransformFlags2[TransformFlags2["AssertES2018"] = 128] = "AssertES2018"; + TransformFlags2[TransformFlags2["AssertES2017"] = 256] = "AssertES2017"; + TransformFlags2[TransformFlags2["AssertES2016"] = 512] = "AssertES2016"; + TransformFlags2[TransformFlags2["AssertES2015"] = 1024] = "AssertES2015"; + TransformFlags2[TransformFlags2["AssertGenerator"] = 2048] = "AssertGenerator"; + TransformFlags2[TransformFlags2["AssertDestructuringAssignment"] = 4096] = "AssertDestructuringAssignment"; + TransformFlags2[TransformFlags2["OuterExpressionExcludes"] = -2147483648] = "OuterExpressionExcludes"; + TransformFlags2[TransformFlags2["PropertyAccessExcludes"] = -2147483648] = "PropertyAccessExcludes"; + TransformFlags2[TransformFlags2["NodeExcludes"] = -2147483648] = "NodeExcludes"; + TransformFlags2[TransformFlags2["ArrowFunctionExcludes"] = -2072174592] = "ArrowFunctionExcludes"; + TransformFlags2[TransformFlags2["FunctionExcludes"] = -1937940480] = "FunctionExcludes"; + TransformFlags2[TransformFlags2["ConstructorExcludes"] = -1937948672] = "ConstructorExcludes"; + TransformFlags2[TransformFlags2["MethodOrAccessorExcludes"] = -2005057536] = "MethodOrAccessorExcludes"; + TransformFlags2[TransformFlags2["PropertyExcludes"] = -2013249536] = "PropertyExcludes"; + TransformFlags2[TransformFlags2["ClassExcludes"] = -2147344384] = "ClassExcludes"; + TransformFlags2[TransformFlags2["ModuleExcludes"] = -1941676032] = "ModuleExcludes"; + TransformFlags2[TransformFlags2["TypeExcludes"] = -2] = "TypeExcludes"; + TransformFlags2[TransformFlags2["ObjectLiteralExcludes"] = -2147278848] = "ObjectLiteralExcludes"; + TransformFlags2[TransformFlags2["ArrayLiteralOrCallOrNewExcludes"] = -2147450880] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags2[TransformFlags2["VariableDeclarationListExcludes"] = -2146893824] = "VariableDeclarationListExcludes"; + TransformFlags2[TransformFlags2["ParameterExcludes"] = -2147483648] = "ParameterExcludes"; + TransformFlags2[TransformFlags2["CatchClauseExcludes"] = -2147418112] = "CatchClauseExcludes"; + TransformFlags2[TransformFlags2["BindingPatternExcludes"] = -2147450880] = "BindingPatternExcludes"; + TransformFlags2[TransformFlags2["ContainsLexicalThisOrSuper"] = 134234112] = "ContainsLexicalThisOrSuper"; + TransformFlags2[TransformFlags2["PropertyNamePropagatingFlags"] = 134234112] = "PropertyNamePropagatingFlags"; + })(TransformFlags = ts2.TransformFlags || (ts2.TransformFlags = {})); + var SnippetKind; + (function(SnippetKind2) { + SnippetKind2[SnippetKind2["TabStop"] = 0] = "TabStop"; + SnippetKind2[SnippetKind2["Placeholder"] = 1] = "Placeholder"; + SnippetKind2[SnippetKind2["Choice"] = 2] = "Choice"; + SnippetKind2[SnippetKind2["Variable"] = 3] = "Variable"; + })(SnippetKind = ts2.SnippetKind || (ts2.SnippetKind = {})); + var EmitFlags; + (function(EmitFlags2) { + EmitFlags2[EmitFlags2["None"] = 0] = "None"; + EmitFlags2[EmitFlags2["SingleLine"] = 1] = "SingleLine"; + EmitFlags2[EmitFlags2["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; + EmitFlags2[EmitFlags2["NoSubstitution"] = 4] = "NoSubstitution"; + EmitFlags2[EmitFlags2["CapturesThis"] = 8] = "CapturesThis"; + EmitFlags2[EmitFlags2["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; + EmitFlags2[EmitFlags2["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; + EmitFlags2[EmitFlags2["NoSourceMap"] = 48] = "NoSourceMap"; + EmitFlags2[EmitFlags2["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; + EmitFlags2[EmitFlags2["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; + EmitFlags2[EmitFlags2["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; + EmitFlags2[EmitFlags2["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; + EmitFlags2[EmitFlags2["NoLeadingComments"] = 512] = "NoLeadingComments"; + EmitFlags2[EmitFlags2["NoTrailingComments"] = 1024] = "NoTrailingComments"; + EmitFlags2[EmitFlags2["NoComments"] = 1536] = "NoComments"; + EmitFlags2[EmitFlags2["NoNestedComments"] = 2048] = "NoNestedComments"; + EmitFlags2[EmitFlags2["HelperName"] = 4096] = "HelperName"; + EmitFlags2[EmitFlags2["ExportName"] = 8192] = "ExportName"; + EmitFlags2[EmitFlags2["LocalName"] = 16384] = "LocalName"; + EmitFlags2[EmitFlags2["InternalName"] = 32768] = "InternalName"; + EmitFlags2[EmitFlags2["Indented"] = 65536] = "Indented"; + EmitFlags2[EmitFlags2["NoIndentation"] = 131072] = "NoIndentation"; + EmitFlags2[EmitFlags2["AsyncFunctionBody"] = 262144] = "AsyncFunctionBody"; + EmitFlags2[EmitFlags2["ReuseTempVariableScope"] = 524288] = "ReuseTempVariableScope"; + EmitFlags2[EmitFlags2["CustomPrologue"] = 1048576] = "CustomPrologue"; + EmitFlags2[EmitFlags2["NoHoisting"] = 2097152] = "NoHoisting"; + EmitFlags2[EmitFlags2["HasEndOfDeclarationMarker"] = 4194304] = "HasEndOfDeclarationMarker"; + EmitFlags2[EmitFlags2["Iterator"] = 8388608] = "Iterator"; + EmitFlags2[EmitFlags2["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; + EmitFlags2[EmitFlags2["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; + EmitFlags2[EmitFlags2["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; + EmitFlags2[EmitFlags2["IgnoreSourceNewlines"] = 134217728] = "IgnoreSourceNewlines"; + EmitFlags2[EmitFlags2["Immutable"] = 268435456] = "Immutable"; + EmitFlags2[EmitFlags2["IndirectCall"] = 536870912] = "IndirectCall"; + })(EmitFlags = ts2.EmitFlags || (ts2.EmitFlags = {})); + var ExternalEmitHelpers; + (function(ExternalEmitHelpers2) { + ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Generator"] = 128] = "Generator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Values"] = 256] = "Values"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Read"] = 512] = "Read"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadArray"] = 1024] = "SpreadArray"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Await"] = 2048] = "Await"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGenerator"] = 4096] = "AsyncGenerator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegator"] = 8192] = "AsyncDelegator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncValues"] = 16384] = "AsyncValues"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ExportStar"] = 32768] = "ExportStar"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ImportStar"] = 65536] = "ImportStar"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ImportDefault"] = 131072] = "ImportDefault"; + ExternalEmitHelpers2[ExternalEmitHelpers2["MakeTemplateObject"] = 262144] = "MakeTemplateObject"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldGet"] = 524288] = "ClassPrivateFieldGet"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; + ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; + ExternalEmitHelpers2[ExternalEmitHelpers2["FirstEmitHelper"] = 1] = "FirstEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["LastEmitHelper"] = 4194304] = "LastEmitHelper"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ForOfIncludes"] = 256] = "ForOfIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384] = "ForAwaitOfIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadIncludes"] = 1536] = "SpreadIncludes"; + })(ExternalEmitHelpers = ts2.ExternalEmitHelpers || (ts2.ExternalEmitHelpers = {})); + var EmitHint; + (function(EmitHint2) { + EmitHint2[EmitHint2["SourceFile"] = 0] = "SourceFile"; + EmitHint2[EmitHint2["Expression"] = 1] = "Expression"; + EmitHint2[EmitHint2["IdentifierName"] = 2] = "IdentifierName"; + EmitHint2[EmitHint2["MappedTypeParameter"] = 3] = "MappedTypeParameter"; + EmitHint2[EmitHint2["Unspecified"] = 4] = "Unspecified"; + EmitHint2[EmitHint2["EmbeddedStatement"] = 5] = "EmbeddedStatement"; + EmitHint2[EmitHint2["JsxAttributeValue"] = 6] = "JsxAttributeValue"; + })(EmitHint = ts2.EmitHint || (ts2.EmitHint = {})); + var OuterExpressionKinds; + (function(OuterExpressionKinds2) { + OuterExpressionKinds2[OuterExpressionKinds2["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds2[OuterExpressionKinds2["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds2[OuterExpressionKinds2["All"] = 15] = "All"; + OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = 16] = "ExcludeJSDocTypeAssertion"; + })(OuterExpressionKinds = ts2.OuterExpressionKinds || (ts2.OuterExpressionKinds = {})); + var LexicalEnvironmentFlags; + (function(LexicalEnvironmentFlags2) { + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["None"] = 0] = "None"; + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["InParameters"] = 1] = "InParameters"; + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["VariablesHoistedInParameters"] = 2] = "VariablesHoistedInParameters"; + })(LexicalEnvironmentFlags = ts2.LexicalEnvironmentFlags || (ts2.LexicalEnvironmentFlags = {})); + var BundleFileSectionKind; + (function(BundleFileSectionKind2) { + BundleFileSectionKind2["Prologue"] = "prologue"; + BundleFileSectionKind2["EmitHelpers"] = "emitHelpers"; + BundleFileSectionKind2["NoDefaultLib"] = "no-default-lib"; + BundleFileSectionKind2["Reference"] = "reference"; + BundleFileSectionKind2["Type"] = "type"; + BundleFileSectionKind2["TypeResolutionModeRequire"] = "type-require"; + BundleFileSectionKind2["TypeResolutionModeImport"] = "type-import"; + BundleFileSectionKind2["Lib"] = "lib"; + BundleFileSectionKind2["Prepend"] = "prepend"; + BundleFileSectionKind2["Text"] = "text"; + BundleFileSectionKind2["Internal"] = "internal"; + })(BundleFileSectionKind = ts2.BundleFileSectionKind || (ts2.BundleFileSectionKind = {})); + var ListFormat; + (function(ListFormat2) { + ListFormat2[ListFormat2["None"] = 0] = "None"; + ListFormat2[ListFormat2["SingleLine"] = 0] = "SingleLine"; + ListFormat2[ListFormat2["MultiLine"] = 1] = "MultiLine"; + ListFormat2[ListFormat2["PreserveLines"] = 2] = "PreserveLines"; + ListFormat2[ListFormat2["LinesMask"] = 3] = "LinesMask"; + ListFormat2[ListFormat2["NotDelimited"] = 0] = "NotDelimited"; + ListFormat2[ListFormat2["BarDelimited"] = 4] = "BarDelimited"; + ListFormat2[ListFormat2["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat2[ListFormat2["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat2[ListFormat2["AsteriskDelimited"] = 32] = "AsteriskDelimited"; + ListFormat2[ListFormat2["DelimitersMask"] = 60] = "DelimitersMask"; + ListFormat2[ListFormat2["AllowTrailingComma"] = 64] = "AllowTrailingComma"; + ListFormat2[ListFormat2["Indented"] = 128] = "Indented"; + ListFormat2[ListFormat2["SpaceBetweenBraces"] = 256] = "SpaceBetweenBraces"; + ListFormat2[ListFormat2["SpaceBetweenSiblings"] = 512] = "SpaceBetweenSiblings"; + ListFormat2[ListFormat2["Braces"] = 1024] = "Braces"; + ListFormat2[ListFormat2["Parenthesis"] = 2048] = "Parenthesis"; + ListFormat2[ListFormat2["AngleBrackets"] = 4096] = "AngleBrackets"; + ListFormat2[ListFormat2["SquareBrackets"] = 8192] = "SquareBrackets"; + ListFormat2[ListFormat2["BracketsMask"] = 15360] = "BracketsMask"; + ListFormat2[ListFormat2["OptionalIfUndefined"] = 16384] = "OptionalIfUndefined"; + ListFormat2[ListFormat2["OptionalIfEmpty"] = 32768] = "OptionalIfEmpty"; + ListFormat2[ListFormat2["Optional"] = 49152] = "Optional"; + ListFormat2[ListFormat2["PreferNewLine"] = 65536] = "PreferNewLine"; + ListFormat2[ListFormat2["NoTrailingNewLine"] = 131072] = "NoTrailingNewLine"; + ListFormat2[ListFormat2["NoInterveningComments"] = 262144] = "NoInterveningComments"; + ListFormat2[ListFormat2["NoSpaceIfEmpty"] = 524288] = "NoSpaceIfEmpty"; + ListFormat2[ListFormat2["SingleElement"] = 1048576] = "SingleElement"; + ListFormat2[ListFormat2["SpaceAfterList"] = 2097152] = "SpaceAfterList"; + ListFormat2[ListFormat2["Modifiers"] = 2359808] = "Modifiers"; + ListFormat2[ListFormat2["HeritageClauses"] = 512] = "HeritageClauses"; + ListFormat2[ListFormat2["SingleLineTypeLiteralMembers"] = 768] = "SingleLineTypeLiteralMembers"; + ListFormat2[ListFormat2["MultiLineTypeLiteralMembers"] = 32897] = "MultiLineTypeLiteralMembers"; + ListFormat2[ListFormat2["SingleLineTupleTypeElements"] = 528] = "SingleLineTupleTypeElements"; + ListFormat2[ListFormat2["MultiLineTupleTypeElements"] = 657] = "MultiLineTupleTypeElements"; + ListFormat2[ListFormat2["UnionTypeConstituents"] = 516] = "UnionTypeConstituents"; + ListFormat2[ListFormat2["IntersectionTypeConstituents"] = 520] = "IntersectionTypeConstituents"; + ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements"; + ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements"; + ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties"; + ListFormat2[ListFormat2["ImportClauseEntries"] = 526226] = "ImportClauseEntries"; + ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements"; + ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements"; + ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments"; + ListFormat2[ListFormat2["NewExpressionArguments"] = 18960] = "NewExpressionArguments"; + ListFormat2[ListFormat2["TemplateExpressionSpans"] = 262144] = "TemplateExpressionSpans"; + ListFormat2[ListFormat2["SingleLineBlockStatements"] = 768] = "SingleLineBlockStatements"; + ListFormat2[ListFormat2["MultiLineBlockStatements"] = 129] = "MultiLineBlockStatements"; + ListFormat2[ListFormat2["VariableDeclarationList"] = 528] = "VariableDeclarationList"; + ListFormat2[ListFormat2["SingleLineFunctionBodyStatements"] = 768] = "SingleLineFunctionBodyStatements"; + ListFormat2[ListFormat2["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat2[ListFormat2["ClassHeritageClauses"] = 0] = "ClassHeritageClauses"; + ListFormat2[ListFormat2["ClassMembers"] = 129] = "ClassMembers"; + ListFormat2[ListFormat2["InterfaceMembers"] = 129] = "InterfaceMembers"; + ListFormat2[ListFormat2["EnumMembers"] = 145] = "EnumMembers"; + ListFormat2[ListFormat2["CaseBlockClauses"] = 129] = "CaseBlockClauses"; + ListFormat2[ListFormat2["NamedImportsOrExportsElements"] = 525136] = "NamedImportsOrExportsElements"; + ListFormat2[ListFormat2["JsxElementOrFragmentChildren"] = 262144] = "JsxElementOrFragmentChildren"; + ListFormat2[ListFormat2["JsxElementAttributes"] = 262656] = "JsxElementAttributes"; + ListFormat2[ListFormat2["CaseOrDefaultClauseStatements"] = 163969] = "CaseOrDefaultClauseStatements"; + ListFormat2[ListFormat2["HeritageClauseTypes"] = 528] = "HeritageClauseTypes"; + ListFormat2[ListFormat2["SourceFileStatements"] = 131073] = "SourceFileStatements"; + ListFormat2[ListFormat2["Decorators"] = 2146305] = "Decorators"; + ListFormat2[ListFormat2["TypeArguments"] = 53776] = "TypeArguments"; + ListFormat2[ListFormat2["TypeParameters"] = 53776] = "TypeParameters"; + ListFormat2[ListFormat2["Parameters"] = 2576] = "Parameters"; + ListFormat2[ListFormat2["IndexSignatureParameters"] = 8848] = "IndexSignatureParameters"; + ListFormat2[ListFormat2["JSDocComment"] = 33] = "JSDocComment"; + })(ListFormat = ts2.ListFormat || (ts2.ListFormat = {})); + var PragmaKindFlags; + (function(PragmaKindFlags2) { + PragmaKindFlags2[PragmaKindFlags2["None"] = 0] = "None"; + PragmaKindFlags2[PragmaKindFlags2["TripleSlashXML"] = 1] = "TripleSlashXML"; + PragmaKindFlags2[PragmaKindFlags2["SingleLine"] = 2] = "SingleLine"; + PragmaKindFlags2[PragmaKindFlags2["MultiLine"] = 4] = "MultiLine"; + PragmaKindFlags2[PragmaKindFlags2["All"] = 7] = "All"; + PragmaKindFlags2[PragmaKindFlags2["Default"] = 7] = "Default"; + })(PragmaKindFlags = ts2.PragmaKindFlags || (ts2.PragmaKindFlags = {})); + ts2.commentPragmas = { + "reference": { + args: [ + { name: "types", optional: true, captureSpan: true }, + { name: "lib", optional: true, captureSpan: true }, + { name: "path", optional: true, captureSpan: true }, + { name: "no-default-lib", optional: true }, + { name: "resolution-mode", optional: true } + ], + kind: 1 + /* PragmaKindFlags.TripleSlashXML */ + }, + "amd-dependency": { + args: [{ name: "path" }, { name: "name", optional: true }], + kind: 1 + /* PragmaKindFlags.TripleSlashXML */ + }, + "amd-module": { + args: [{ name: "name" }], + kind: 1 + /* PragmaKindFlags.TripleSlashXML */ + }, + "ts-check": { + kind: 2 + /* PragmaKindFlags.SingleLine */ + }, + "ts-nocheck": { + kind: 2 + /* PragmaKindFlags.SingleLine */ + }, + "jsx": { + args: [{ name: "factory" }], + kind: 4 + /* PragmaKindFlags.MultiLine */ + }, + "jsxfrag": { + args: [{ name: "factory" }], + kind: 4 + /* PragmaKindFlags.MultiLine */ + }, + "jsximportsource": { + args: [{ name: "factory" }], + kind: 4 + /* PragmaKindFlags.MultiLine */ + }, + "jsxruntime": { + args: [{ name: "factory" }], + kind: 4 + /* PragmaKindFlags.MultiLine */ + } + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function generateDjb2Hash(data) { + var acc = 5381; + for (var i7 = 0; i7 < data.length; i7++) { + acc = (acc << 5) + acc + data.charCodeAt(i7); + } + return acc.toString(); + } + ts2.generateDjb2Hash = generateDjb2Hash; + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + ts2.setStackTraceLimit = setStackTraceLimit; + var FileWatcherEventKind; + (function(FileWatcherEventKind2) { + FileWatcherEventKind2[FileWatcherEventKind2["Created"] = 0] = "Created"; + FileWatcherEventKind2[FileWatcherEventKind2["Changed"] = 1] = "Changed"; + FileWatcherEventKind2[FileWatcherEventKind2["Deleted"] = 2] = "Deleted"; + })(FileWatcherEventKind = ts2.FileWatcherEventKind || (ts2.FileWatcherEventKind = {})); + var PollingInterval; + (function(PollingInterval2) { + PollingInterval2[PollingInterval2["High"] = 2e3] = "High"; + PollingInterval2[PollingInterval2["Medium"] = 500] = "Medium"; + PollingInterval2[PollingInterval2["Low"] = 250] = "Low"; + })(PollingInterval = ts2.PollingInterval || (ts2.PollingInterval = {})); + ts2.missingFileModifiedTime = /* @__PURE__ */ new Date(0); + function getModifiedTime(host, fileName) { + return host.getModifiedTime(fileName) || ts2.missingFileModifiedTime; + } + ts2.getModifiedTime = getModifiedTime; + function createPollingIntervalBasedLevels(levels) { + var _a2; + return _a2 = {}, _a2[PollingInterval.Low] = levels.Low, _a2[PollingInterval.Medium] = levels.Medium, _a2[PollingInterval.High] = levels.High, _a2; + } + var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; + var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); + ts2.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); + function setCustomPollingValues(system) { + if (!system.getEnvironmentVariable) { + return; + } + var pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); + pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; + ts2.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts2.unchangedPollThresholds; + function getLevel(envVar, level) { + return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase())); + } + function getCustomLevels(baseVariable) { + var customLevels; + setCustomLevel("Low"); + setCustomLevel("Medium"); + setCustomLevel("High"); + return customLevels; + function setCustomLevel(level) { + var customLevel = getLevel(baseVariable, level); + if (customLevel) { + (customLevels || (customLevels = {}))[level] = Number(customLevel); + } + } + } + function setCustomLevels(baseVariable, levels) { + var customLevels = getCustomLevels(baseVariable); + if (customLevels) { + setLevel("Low"); + setLevel("Medium"); + setLevel("High"); + return true; + } + return false; + function setLevel(level) { + levels[level] = customLevels[level] || levels[level]; + } + } + function getCustomPollingBasedLevels(baseVariable, defaultLevels) { + var customLevels = getCustomLevels(baseVariable); + return (pollingIntervalChanged || customLevels) && createPollingIntervalBasedLevels(customLevels ? __assign16(__assign16({}, defaultLevels), customLevels) : defaultLevels); + } + } + function pollWatchedFileQueue(host, queue3, pollIndex, chunkSize, callbackOnWatchFileStat) { + var definedValueCopyToIndex = pollIndex; + for (var canVisit = queue3.length; chunkSize && canVisit; nextPollIndex(), canVisit--) { + var watchedFile = queue3[pollIndex]; + if (!watchedFile) { + continue; + } else if (watchedFile.isClosed) { + queue3[pollIndex] = void 0; + continue; + } + chunkSize--; + var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(host, watchedFile.fileName)); + if (watchedFile.isClosed) { + queue3[pollIndex] = void 0; + continue; + } + callbackOnWatchFileStat === null || callbackOnWatchFileStat === void 0 ? void 0 : callbackOnWatchFileStat(watchedFile, pollIndex, fileChanged); + if (queue3[pollIndex]) { + if (definedValueCopyToIndex < pollIndex) { + queue3[definedValueCopyToIndex] = watchedFile; + queue3[pollIndex] = void 0; + } + definedValueCopyToIndex++; + } + } + return pollIndex; + function nextPollIndex() { + pollIndex++; + if (pollIndex === queue3.length) { + if (definedValueCopyToIndex < pollIndex) { + queue3.length = definedValueCopyToIndex; + } + pollIndex = 0; + definedValueCopyToIndex = 0; + } + } + } + function createDynamicPriorityPollingWatchFile(host) { + var watchedFiles = []; + var changedFilesInLastPoll = []; + var lowPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Low); + var mediumPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Medium); + var highPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.High); + return watchFile; + function watchFile(fileName, callback, defaultPollingInterval) { + var file = { + fileName, + callback, + unchangedPolls: 0, + mtime: getModifiedTime(host, fileName) + }; + watchedFiles.push(file); + addToPollingIntervalQueue(file, defaultPollingInterval); + return { + close: function() { + file.isClosed = true; + ts2.unorderedRemoveItem(watchedFiles, file); + } + }; + } + function createPollingIntervalQueue(pollingInterval) { + var queue3 = []; + queue3.pollingInterval = pollingInterval; + queue3.pollIndex = 0; + queue3.pollScheduled = false; + return queue3; + } + function pollPollingIntervalQueue(queue3) { + queue3.pollIndex = pollQueue(queue3, queue3.pollingInterval, queue3.pollIndex, pollingChunkSize[queue3.pollingInterval]); + if (queue3.length) { + scheduleNextPoll(queue3.pollingInterval); + } else { + ts2.Debug.assert(queue3.pollIndex === 0); + queue3.pollScheduled = false; + } + } + function pollLowPollingIntervalQueue(queue3) { + pollQueue( + changedFilesInLastPoll, + PollingInterval.Low, + /*pollIndex*/ + 0, + changedFilesInLastPoll.length + ); + pollPollingIntervalQueue(queue3); + if (!queue3.pollScheduled && changedFilesInLastPoll.length) { + scheduleNextPoll(PollingInterval.Low); + } + } + function pollQueue(queue3, pollingInterval, pollIndex, chunkSize) { + return pollWatchedFileQueue(host, queue3, pollIndex, chunkSize, onWatchFileStat); + function onWatchFileStat(watchedFile, pollIndex2, fileChanged) { + if (fileChanged) { + watchedFile.unchangedPolls = 0; + if (queue3 !== changedFilesInLastPoll) { + queue3[pollIndex2] = void 0; + addChangedFileToLowPollingIntervalQueue(watchedFile); + } + } else if (watchedFile.unchangedPolls !== ts2.unchangedPollThresholds[pollingInterval]) { + watchedFile.unchangedPolls++; + } else if (queue3 === changedFilesInLastPoll) { + watchedFile.unchangedPolls = 1; + queue3[pollIndex2] = void 0; + addToPollingIntervalQueue(watchedFile, PollingInterval.Low); + } else if (pollingInterval !== PollingInterval.High) { + watchedFile.unchangedPolls++; + queue3[pollIndex2] = void 0; + addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High); + } + } + } + function pollingIntervalQueue(pollingInterval) { + switch (pollingInterval) { + case PollingInterval.Low: + return lowPollingIntervalQueue; + case PollingInterval.Medium: + return mediumPollingIntervalQueue; + case PollingInterval.High: + return highPollingIntervalQueue; + } + } + function addToPollingIntervalQueue(file, pollingInterval) { + pollingIntervalQueue(pollingInterval).push(file); + scheduleNextPollIfNotAlreadyScheduled(pollingInterval); + } + function addChangedFileToLowPollingIntervalQueue(file) { + changedFilesInLastPoll.push(file); + scheduleNextPollIfNotAlreadyScheduled(PollingInterval.Low); + } + function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { + if (!pollingIntervalQueue(pollingInterval).pollScheduled) { + scheduleNextPoll(pollingInterval); + } + } + function scheduleNextPoll(pollingInterval) { + pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval)); + } + } + function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) { + var fileWatcherCallbacks = ts2.createMultiMap(); + var dirWatchers = new ts2.Map(); + var toCanonicalName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + return nonPollingWatchFile; + function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) { + var filePath = toCanonicalName(fileName); + fileWatcherCallbacks.add(filePath, callback); + var dirPath = ts2.getDirectoryPath(filePath) || "."; + var watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(ts2.getDirectoryPath(fileName) || ".", dirPath, fallbackOptions); + watcher.referenceCount++; + return { + close: function() { + if (watcher.referenceCount === 1) { + watcher.close(); + dirWatchers.delete(dirPath); + } else { + watcher.referenceCount--; + } + fileWatcherCallbacks.remove(filePath, callback); + } + }; + } + function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { + var watcher = fsWatch( + dirName, + 1, + function(_eventName, relativeFileName, modifiedTime) { + if (!ts2.isString(relativeFileName)) + return; + var fileName = ts2.getNormalizedAbsolutePath(relativeFileName, dirName); + var callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName)); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName, FileWatcherEventKind.Changed, modifiedTime); + } + } + }, + /*recursive*/ + false, + PollingInterval.Medium, + fallbackOptions + ); + watcher.referenceCount = 0; + dirWatchers.set(dirPath, watcher); + return watcher; + } + } + function createFixedChunkSizePollingWatchFile(host) { + var watchedFiles = []; + var pollIndex = 0; + var pollScheduled; + return watchFile; + function watchFile(fileName, callback) { + var file = { + fileName, + callback, + mtime: getModifiedTime(host, fileName) + }; + watchedFiles.push(file); + scheduleNextPoll(); + return { + close: function() { + file.isClosed = true; + ts2.unorderedRemoveItem(watchedFiles, file); + } + }; + } + function pollQueue() { + pollScheduled = void 0; + pollIndex = pollWatchedFileQueue(host, watchedFiles, pollIndex, pollingChunkSize[PollingInterval.Low]); + scheduleNextPoll(); + } + function scheduleNextPoll() { + if (!watchedFiles.length || pollScheduled) + return; + pollScheduled = host.setTimeout(pollQueue, PollingInterval.High); + } + } + function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name2, callback, createWatcher) { + var toCanonicalFileName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + var path2 = toCanonicalFileName(name2); + var existing = cache.get(path2); + if (existing) { + existing.callbacks.push(callback); + } else { + cache.set(path2, { + watcher: createWatcher( + // Cant infer types correctly so lets satisfy checker + function(param1, param2, param3) { + var _a2; + return (_a2 = cache.get(path2)) === null || _a2 === void 0 ? void 0 : _a2.callbacks.slice().forEach(function(cb) { + return cb(param1, param2, param3); + }); + } + ), + callbacks: [callback] + }); + } + return { + close: function() { + var watcher = cache.get(path2); + if (!watcher) + return; + if (!ts2.orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length) + return; + cache.delete(path2); + ts2.closeFileWatcherOf(watcher); + } + }; + } + function onWatchedFileStat(watchedFile, modifiedTime) { + var oldTime = watchedFile.mtime.getTime(); + var newTime = modifiedTime.getTime(); + if (oldTime !== newTime) { + watchedFile.mtime = modifiedTime; + watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime); + return true; + } + return false; + } + function getFileWatcherEventKind(oldTime, newTime) { + return oldTime === 0 ? FileWatcherEventKind.Created : newTime === 0 ? FileWatcherEventKind.Deleted : FileWatcherEventKind.Changed; + } + ts2.getFileWatcherEventKind = getFileWatcherEventKind; + ts2.ignoredPaths = ["/node_modules/.", "/.git", "/.#"]; + var curSysLog = ts2.noop; + function sysLog(s7) { + return curSysLog(s7); + } + ts2.sysLog = sysLog; + function setSysLog(logger) { + curSysLog = logger; + } + ts2.setSysLog = setSysLog; + function createDirectoryWatcherSupportingRecursive(_a2) { + var watchDirectory = _a2.watchDirectory, useCaseSensitiveFileNames = _a2.useCaseSensitiveFileNames, getCurrentDirectory = _a2.getCurrentDirectory, getAccessibleSortedChildDirectories = _a2.getAccessibleSortedChildDirectories, fileSystemEntryExists = _a2.fileSystemEntryExists, realpath2 = _a2.realpath, setTimeout2 = _a2.setTimeout, clearTimeout2 = _a2.clearTimeout; + var cache = new ts2.Map(); + var callbackCache = ts2.createMultiMap(); + var cacheToUpdateChildWatches = new ts2.Map(); + var timerToUpdateChildWatches; + var filePathComparer = ts2.getStringComparer(!useCaseSensitiveFileNames); + var toCanonicalFilePath = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + return function(dirName, callback, recursive, options) { + return recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options); + }; + function createDirectoryWatcher(dirName, options, callback) { + var dirPath = toCanonicalFilePath(dirName); + var directoryWatcher = cache.get(dirPath); + if (directoryWatcher) { + directoryWatcher.refCount++; + } else { + directoryWatcher = { + watcher: watchDirectory( + dirName, + function(fileName) { + if (isIgnoredPath(fileName, options)) + return; + if (options === null || options === void 0 ? void 0 : options.synchronousWatchDirectory) { + invokeCallbacks(dirPath, fileName); + updateChildWatches(dirName, dirPath, options); + } else { + nonSyncUpdateChildWatches(dirName, dirPath, fileName, options); + } + }, + /*recursive*/ + false, + options + ), + refCount: 1, + childWatches: ts2.emptyArray + }; + cache.set(dirPath, directoryWatcher); + updateChildWatches(dirName, dirPath, options); + } + var callbackToAdd = callback && { dirName, callback }; + if (callbackToAdd) { + callbackCache.add(dirPath, callbackToAdd); + } + return { + dirName, + close: function() { + var directoryWatcher2 = ts2.Debug.checkDefined(cache.get(dirPath)); + if (callbackToAdd) + callbackCache.remove(dirPath, callbackToAdd); + directoryWatcher2.refCount--; + if (directoryWatcher2.refCount) + return; + cache.delete(dirPath); + ts2.closeFileWatcherOf(directoryWatcher2); + directoryWatcher2.childWatches.forEach(ts2.closeFileWatcher); + } + }; + } + function invokeCallbacks(dirPath, fileNameOrInvokeMap, fileNames) { + var fileName; + var invokeMap2; + if (ts2.isString(fileNameOrInvokeMap)) { + fileName = fileNameOrInvokeMap; + } else { + invokeMap2 = fileNameOrInvokeMap; + } + callbackCache.forEach(function(callbacks, rootDirName) { + var _a3; + if (invokeMap2 && invokeMap2.get(rootDirName) === true) + return; + if (rootDirName === dirPath || ts2.startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === ts2.directorySeparator) { + if (invokeMap2) { + if (fileNames) { + var existing = invokeMap2.get(rootDirName); + if (existing) { + (_a3 = existing).push.apply(_a3, fileNames); + } else { + invokeMap2.set(rootDirName, fileNames.slice()); + } + } else { + invokeMap2.set(rootDirName, true); + } + } else { + callbacks.forEach(function(_a4) { + var callback = _a4.callback; + return callback(fileName); + }); + } + } + }); + } + function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { + var parentWatcher = cache.get(dirPath); + if (parentWatcher && fileSystemEntryExists( + dirName, + 1 + /* FileSystemEntryKind.Directory */ + )) { + scheduleUpdateChildWatches(dirName, dirPath, fileName, options); + return; + } + invokeCallbacks(dirPath, fileName); + removeChildWatches(parentWatcher); + } + function scheduleUpdateChildWatches(dirName, dirPath, fileName, options) { + var existing = cacheToUpdateChildWatches.get(dirPath); + if (existing) { + existing.fileNames.push(fileName); + } else { + cacheToUpdateChildWatches.set(dirPath, { dirName, options, fileNames: [fileName] }); + } + if (timerToUpdateChildWatches) { + clearTimeout2(timerToUpdateChildWatches); + timerToUpdateChildWatches = void 0; + } + timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3); + } + function onTimerToUpdateChildWatches() { + timerToUpdateChildWatches = void 0; + sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); + var start = ts2.timestamp(); + var invokeMap2 = new ts2.Map(); + while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { + var result2 = cacheToUpdateChildWatches.entries().next(); + ts2.Debug.assert(!result2.done); + var _a3 = result2.value, dirPath = _a3[0], _b = _a3[1], dirName = _b.dirName, options = _b.options, fileNames = _b.fileNames; + cacheToUpdateChildWatches.delete(dirPath); + var hasChanges = updateChildWatches(dirName, dirPath, options); + invokeCallbacks(dirPath, invokeMap2, hasChanges ? void 0 : fileNames); + } + sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts2.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); + callbackCache.forEach(function(callbacks, rootDirName) { + var existing = invokeMap2.get(rootDirName); + if (existing) { + callbacks.forEach(function(_a4) { + var callback = _a4.callback, dirName2 = _a4.dirName; + if (ts2.isArray(existing)) { + existing.forEach(callback); + } else { + callback(dirName2); + } + }); + } + }); + var elapsed = ts2.timestamp() - start; + sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); + } + function removeChildWatches(parentWatcher) { + if (!parentWatcher) + return; + var existingChildWatches = parentWatcher.childWatches; + parentWatcher.childWatches = ts2.emptyArray; + for (var _i = 0, existingChildWatches_1 = existingChildWatches; _i < existingChildWatches_1.length; _i++) { + var childWatcher = existingChildWatches_1[_i]; + childWatcher.close(); + removeChildWatches(cache.get(toCanonicalFilePath(childWatcher.dirName))); + } + } + function updateChildWatches(parentDir, parentDirPath, options) { + var parentWatcher = cache.get(parentDirPath); + if (!parentWatcher) + return false; + var newChildWatches; + var hasChanges = ts2.enumerateInsertsAndDeletes(fileSystemEntryExists( + parentDir, + 1 + /* FileSystemEntryKind.Directory */ + ) ? ts2.mapDefined(getAccessibleSortedChildDirectories(parentDir), function(child) { + var childFullName = ts2.getNormalizedAbsolutePath(child, parentDir); + return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, ts2.normalizePath(realpath2(childFullName))) === 0 ? childFullName : void 0; + }) : ts2.emptyArray, parentWatcher.childWatches, function(child, childWatcher) { + return filePathComparer(child, childWatcher.dirName); + }, createAndAddChildDirectoryWatcher, ts2.closeFileWatcher, addChildDirectoryWatcher); + parentWatcher.childWatches = newChildWatches || ts2.emptyArray; + return hasChanges; + function createAndAddChildDirectoryWatcher(childName) { + var result2 = createDirectoryWatcher(childName, options); + addChildDirectoryWatcher(result2); + } + function addChildDirectoryWatcher(childWatcher) { + (newChildWatches || (newChildWatches = [])).push(childWatcher); + } + } + function isIgnoredPath(path2, options) { + return ts2.some(ts2.ignoredPaths, function(searchPath) { + return isInPath(path2, searchPath); + }) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames, getCurrentDirectory); + } + function isInPath(path2, searchPath) { + if (ts2.stringContains(path2, searchPath)) + return true; + if (useCaseSensitiveFileNames) + return false; + return ts2.stringContains(toCanonicalFilePath(path2), searchPath); + } + } + var FileSystemEntryKind; + (function(FileSystemEntryKind2) { + FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; + FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind = ts2.FileSystemEntryKind || (ts2.FileSystemEntryKind = {})); + function createFileWatcherCallback(callback) { + return function(_fileName, eventKind, modifiedTime) { + return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", "", modifiedTime); + }; + } + function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime2) { + return function(eventName, _relativeFileName, modifiedTime) { + if (eventName === "rename") { + modifiedTime || (modifiedTime = getModifiedTime2(fileName) || ts2.missingFileModifiedTime); + callback(fileName, modifiedTime !== ts2.missingFileModifiedTime ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted, modifiedTime); + } else { + callback(fileName, FileWatcherEventKind.Changed, modifiedTime); + } + }; + } + function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) { + return ((options === null || options === void 0 ? void 0 : options.excludeDirectories) || (options === null || options === void 0 ? void 0 : options.excludeFiles)) && (ts2.matchesExclude(pathToCheck, options === null || options === void 0 ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || ts2.matchesExclude(pathToCheck, options === null || options === void 0 ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory())); + } + function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) { + return function(eventName, relativeFileName) { + if (eventName === "rename") { + var fileName = !relativeFileName ? directoryName : ts2.normalizePath(ts2.combinePaths(directoryName, relativeFileName)); + if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) { + callback(fileName); + } + } + }; + } + function createSystemWatchFunctions(_a2) { + var pollingWatchFileWorker = _a2.pollingWatchFileWorker, getModifiedTime2 = _a2.getModifiedTime, setTimeout2 = _a2.setTimeout, clearTimeout2 = _a2.clearTimeout, fsWatchWorker = _a2.fsWatchWorker, fileSystemEntryExists = _a2.fileSystemEntryExists, useCaseSensitiveFileNames = _a2.useCaseSensitiveFileNames, getCurrentDirectory = _a2.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a2.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a2.getAccessibleSortedChildDirectories, realpath2 = _a2.realpath, tscWatchFile = _a2.tscWatchFile, useNonPollingWatchers = _a2.useNonPollingWatchers, tscWatchDirectory = _a2.tscWatchDirectory, inodeWatching = _a2.inodeWatching, sysLog2 = _a2.sysLog; + var pollingWatches = new ts2.Map(); + var fsWatches = new ts2.Map(); + var fsWatchesRecursive = new ts2.Map(); + var dynamicPollingWatchFile; + var fixedChunkSizePollingWatchFile; + var nonPollingWatchFile; + var hostRecursiveDirectoryWatcher; + var hitSystemWatcherLimit = false; + return { + watchFile, + watchDirectory + }; + function watchFile(fileName, callback, pollingInterval, options) { + options = updateOptionsForWatchFile(options, useNonPollingWatchers); + var watchFileKind = ts2.Debug.checkDefined(options.watchFile); + switch (watchFileKind) { + case ts2.WatchFileKind.FixedPollingInterval: + return pollingWatchFile( + fileName, + callback, + PollingInterval.Low, + /*options*/ + void 0 + ); + case ts2.WatchFileKind.PriorityPollingInterval: + return pollingWatchFile( + fileName, + callback, + pollingInterval, + /*options*/ + void 0 + ); + case ts2.WatchFileKind.DynamicPriorityPolling: + return ensureDynamicPollingWatchFile()( + fileName, + callback, + pollingInterval, + /*options*/ + void 0 + ); + case ts2.WatchFileKind.FixedChunkSizePolling: + return ensureFixedChunkSizePollingWatchFile()( + fileName, + callback, + /* pollingInterval */ + void 0, + /*options*/ + void 0 + ); + case ts2.WatchFileKind.UseFsEvents: + return fsWatch( + fileName, + 0, + createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime2), + /*recursive*/ + false, + pollingInterval, + ts2.getFallbackOptions(options) + ); + case ts2.WatchFileKind.UseFsEventsOnParentDirectory: + if (!nonPollingWatchFile) { + nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames); + } + return nonPollingWatchFile(fileName, callback, pollingInterval, ts2.getFallbackOptions(options)); + default: + ts2.Debug.assertNever(watchFileKind); + } + } + function ensureDynamicPollingWatchFile() { + return dynamicPollingWatchFile || (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime2, setTimeout: setTimeout2 })); + } + function ensureFixedChunkSizePollingWatchFile() { + return fixedChunkSizePollingWatchFile || (fixedChunkSizePollingWatchFile = createFixedChunkSizePollingWatchFile({ getModifiedTime: getModifiedTime2, setTimeout: setTimeout2 })); + } + function updateOptionsForWatchFile(options, useNonPollingWatchers2) { + if (options && options.watchFile !== void 0) + return options; + switch (tscWatchFile) { + case "PriorityPollingInterval": + return { watchFile: ts2.WatchFileKind.PriorityPollingInterval }; + case "DynamicPriorityPolling": + return { watchFile: ts2.WatchFileKind.DynamicPriorityPolling }; + case "UseFsEvents": + return generateWatchFileOptions(ts2.WatchFileKind.UseFsEvents, ts2.PollingWatchKind.PriorityInterval, options); + case "UseFsEventsWithFallbackDynamicPolling": + return generateWatchFileOptions(ts2.WatchFileKind.UseFsEvents, ts2.PollingWatchKind.DynamicPriority, options); + case "UseFsEventsOnParentDirectory": + useNonPollingWatchers2 = true; + default: + return useNonPollingWatchers2 ? ( + // Use notifications from FS to watch with falling back to fs.watchFile + generateWatchFileOptions(ts2.WatchFileKind.UseFsEventsOnParentDirectory, ts2.PollingWatchKind.PriorityInterval, options) + ) : ( + // Default to using fs events + { watchFile: ts2.WatchFileKind.UseFsEvents } + ); + } + } + function generateWatchFileOptions(watchFile2, fallbackPolling, options) { + var defaultFallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling; + return { + watchFile: watchFile2, + fallbackPolling: defaultFallbackPolling === void 0 ? fallbackPolling : defaultFallbackPolling + }; + } + function watchDirectory(directoryName, callback, recursive, options) { + if (fsSupportsRecursiveFsWatch) { + return fsWatch(directoryName, 1, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), recursive, PollingInterval.Medium, ts2.getFallbackOptions(options)); + } + if (!hostRecursiveDirectoryWatcher) { + hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({ + useCaseSensitiveFileNames, + getCurrentDirectory, + fileSystemEntryExists, + getAccessibleSortedChildDirectories, + watchDirectory: nonRecursiveWatchDirectory, + realpath: realpath2, + setTimeout: setTimeout2, + clearTimeout: clearTimeout2 + }); + } + return hostRecursiveDirectoryWatcher(directoryName, callback, recursive, options); + } + function nonRecursiveWatchDirectory(directoryName, callback, recursive, options) { + ts2.Debug.assert(!recursive); + var watchDirectoryOptions = updateOptionsForWatchDirectory(options); + var watchDirectoryKind = ts2.Debug.checkDefined(watchDirectoryOptions.watchDirectory); + switch (watchDirectoryKind) { + case ts2.WatchDirectoryKind.FixedPollingInterval: + return pollingWatchFile( + directoryName, + function() { + return callback(directoryName); + }, + PollingInterval.Medium, + /*options*/ + void 0 + ); + case ts2.WatchDirectoryKind.DynamicPriorityPolling: + return ensureDynamicPollingWatchFile()( + directoryName, + function() { + return callback(directoryName); + }, + PollingInterval.Medium, + /*options*/ + void 0 + ); + case ts2.WatchDirectoryKind.FixedChunkSizePolling: + return ensureFixedChunkSizePollingWatchFile()( + directoryName, + function() { + return callback(directoryName); + }, + /* pollingInterval */ + void 0, + /*options*/ + void 0 + ); + case ts2.WatchDirectoryKind.UseFsEvents: + return fsWatch(directoryName, 1, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), recursive, PollingInterval.Medium, ts2.getFallbackOptions(watchDirectoryOptions)); + default: + ts2.Debug.assertNever(watchDirectoryKind); + } + } + function updateOptionsForWatchDirectory(options) { + if (options && options.watchDirectory !== void 0) + return options; + switch (tscWatchDirectory) { + case "RecursiveDirectoryUsingFsWatchFile": + return { watchDirectory: ts2.WatchDirectoryKind.FixedPollingInterval }; + case "RecursiveDirectoryUsingDynamicPriorityPolling": + return { watchDirectory: ts2.WatchDirectoryKind.DynamicPriorityPolling }; + default: + var defaultFallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling; + return { + watchDirectory: ts2.WatchDirectoryKind.UseFsEvents, + fallbackPolling: defaultFallbackPolling !== void 0 ? defaultFallbackPolling : void 0 + }; + } + } + function pollingWatchFile(fileName, callback, pollingInterval, options) { + return createSingleWatcherPerName(pollingWatches, useCaseSensitiveFileNames, fileName, callback, function(cb) { + return pollingWatchFileWorker(fileName, cb, pollingInterval, options); + }); + } + function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { + return createSingleWatcherPerName(recursive ? fsWatchesRecursive : fsWatches, useCaseSensitiveFileNames, fileOrDirectory, callback, function(cb) { + return fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions); + }); + } + function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { + var lastDirectoryPartWithDirectorySeparator; + var lastDirectoryPart; + if (inodeWatching) { + lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(ts2.directorySeparator)); + lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(ts2.directorySeparator.length); + } + var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry() : watchPresentFileSystemEntry(); + return { + close: function() { + if (watcher) { + watcher.close(); + watcher = void 0; + } + } + }; + function updateWatcher(createWatcher) { + if (watcher) { + sysLog2("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher")); + watcher.close(); + watcher = createWatcher(); + } + } + function watchPresentFileSystemEntry() { + if (hitSystemWatcherLimit) { + sysLog2("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to watchFile")); + return watchPresentFileSystemEntryWithFsWatchFile(); + } + try { + var presentWatcher = fsWatchWorker(fileOrDirectory, recursive, inodeWatching ? callbackChangingToMissingFileSystemEntry : callback); + presentWatcher.on("error", function() { + callback("rename", ""); + updateWatcher(watchMissingFileSystemEntry); + }); + return presentWatcher; + } catch (e10) { + hitSystemWatcherLimit || (hitSystemWatcherLimit = e10.code === "ENOSPC"); + sysLog2("sysLog:: ".concat(fileOrDirectory, ":: Changing to watchFile")); + return watchPresentFileSystemEntryWithFsWatchFile(); + } + } + function callbackChangingToMissingFileSystemEntry(event, relativeName) { + var originalRelativeName; + if (relativeName && ts2.endsWith(relativeName, "~")) { + originalRelativeName = relativeName; + relativeName = relativeName.slice(0, relativeName.length - 1); + } + if (event === "rename" && (!relativeName || relativeName === lastDirectoryPart || ts2.endsWith(relativeName, lastDirectoryPartWithDirectorySeparator))) { + var modifiedTime = getModifiedTime2(fileOrDirectory) || ts2.missingFileModifiedTime; + if (originalRelativeName) + callback(event, originalRelativeName, modifiedTime); + callback(event, relativeName, modifiedTime); + if (inodeWatching) { + updateWatcher(modifiedTime === ts2.missingFileModifiedTime ? watchMissingFileSystemEntry : watchPresentFileSystemEntry); + } else if (modifiedTime === ts2.missingFileModifiedTime) { + updateWatcher(watchMissingFileSystemEntry); + } + } else { + if (originalRelativeName) + callback(event, originalRelativeName); + callback(event, relativeName); + } + } + function watchPresentFileSystemEntryWithFsWatchFile() { + return watchFile(fileOrDirectory, createFileWatcherCallback(callback), fallbackPollingInterval, fallbackOptions); + } + function watchMissingFileSystemEntry() { + return watchFile(fileOrDirectory, function(_fileName, eventKind, modifiedTime) { + if (eventKind === FileWatcherEventKind.Created) { + modifiedTime || (modifiedTime = getModifiedTime2(fileOrDirectory) || ts2.missingFileModifiedTime); + if (modifiedTime !== ts2.missingFileModifiedTime) { + callback("rename", "", modifiedTime); + updateWatcher(watchPresentFileSystemEntry); + } + } + }, fallbackPollingInterval, fallbackOptions); + } + } + } + ts2.createSystemWatchFunctions = createSystemWatchFunctions; + function patchWriteFileEnsuringDirectory(sys) { + var originalWriteFile = sys.writeFile; + sys.writeFile = function(path2, data, writeBom) { + return ts2.writeFileEnsuringDirectories(path2, data, !!writeBom, function(path3, data2, writeByteOrderMark) { + return originalWriteFile.call(sys, path3, data2, writeByteOrderMark); + }, function(path3) { + return sys.createDirectory(path3); + }, function(path3) { + return sys.directoryExists(path3); + }); + }; + } + ts2.patchWriteFileEnsuringDirectory = patchWriteFileEnsuringDirectory; + function getNodeMajorVersion() { + if (typeof process === "undefined") { + return void 0; + } + var version5 = process.version; + if (!version5) { + return void 0; + } + var dot = version5.indexOf("."); + if (dot === -1) { + return void 0; + } + return parseInt(version5.substring(1, dot)); + } + ts2.getNodeMajorVersion = getNodeMajorVersion; + ts2.sys = function() { + var byteOrderMarkIndicator = "\uFEFF"; + function getNodeSystem() { + var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/; + var _fs = (init_fs(), __toCommonJS(fs_exports)); + var _path = (init_path(), __toCommonJS(path_exports)); + var _os = (init_os(), __toCommonJS(os_exports)); + var _crypto; + try { + _crypto = (init_crypto(), __toCommonJS(crypto_exports)); + } catch (_a2) { + _crypto = void 0; + } + var activeSession; + var profilePath = "./profile.cpuprofile"; + var Buffer4 = (init_buffer(), __toCommonJS(buffer_exports)).Buffer; + var nodeVersion = getNodeMajorVersion(); + var isNode4OrLater = nodeVersion >= 4; + var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; + var platform4 = _os.platform(); + var useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + var fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; + var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + var getCurrentDirectory = ts2.memoize(function() { + return process.cwd(); + }); + var _b = createSystemWatchFunctions({ + pollingWatchFileWorker: fsWatchFileWorker, + getModifiedTime: getModifiedTime2, + setTimeout, + clearTimeout, + fsWatchWorker, + useCaseSensitiveFileNames, + getCurrentDirectory, + fileSystemEntryExists, + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) + fsSupportsRecursiveFsWatch, + getAccessibleSortedChildDirectories: function(path2) { + return getAccessibleFileSystemEntries(path2).directories; + }, + realpath: realpath2, + tscWatchFile: process.env.TSC_WATCHFILE, + useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER, + tscWatchDirectory: process.env.TSC_WATCHDIRECTORY, + inodeWatching: isLinuxOrMacOs, + sysLog + }), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory; + var nodeSystem = { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames, + write: function(s7) { + process.stdout.write(s7); + }, + getWidthOfTerminal: function() { + return process.stdout.columns; + }, + writeOutputIsTTY: function() { + return process.stdout.isTTY; + }, + readFile: readFile2, + writeFile: writeFile2, + watchFile, + watchDirectory, + resolvePath: function(path2) { + return _path.resolve(path2); + }, + fileExists, + directoryExists, + createDirectory: function(directoryName) { + if (!nodeSystem.directoryExists(directoryName)) { + try { + _fs.mkdirSync(directoryName); + } catch (e10) { + if (e10.code !== "EEXIST") { + throw e10; + } + } + } + }, + getExecutingFilePath: function() { + return __filename; + }, + getCurrentDirectory, + getDirectories, + getEnvironmentVariable: function(name2) { + return process.env[name2] || ""; + }, + readDirectory, + getModifiedTime: getModifiedTime2, + setModifiedTime, + deleteFile, + createHash: _crypto ? createSHA256Hash : generateDjb2Hash, + createSHA256Hash: _crypto ? createSHA256Hash : void 0, + getMemoryUsage: function() { + if (globalThis.gc) { + globalThis.gc(); + } + return process.memoryUsage().heapUsed; + }, + getFileSize: function(path2) { + try { + var stat2 = statSync2(path2); + if (stat2 === null || stat2 === void 0 ? void 0 : stat2.isFile()) { + return stat2.size; + } + } catch (_a2) { + } + return 0; + }, + exit: function(exitCode) { + disableCPUProfiler(function() { + return process.exit(exitCode); + }); + }, + enableCPUProfiler, + disableCPUProfiler, + cpuProfilingEnabled: function() { + return !!activeSession || ts2.contains(process.execArgv, "--cpu-prof") || ts2.contains(process.execArgv, "--prof"); + }, + realpath: realpath2, + debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || ts2.some(process.execArgv, function(arg) { + return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); + }), + tryEnableSourceMapsForHost: function() { + try { + require_source_map_support().install(); + } catch (_a2) { + } + }, + setTimeout, + clearTimeout, + clearScreen: function() { + process.stdout.write("\x1Bc"); + }, + setBlocking: function() { + if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) { + process.stdout._handle.setBlocking(true); + } + }, + bufferFrom, + base64decode: function(input) { + return bufferFrom(input, "base64").toString("utf8"); + }, + base64encode: function(input) { + return bufferFrom(input).toString("base64"); + }, + require: function(baseDir, moduleName3) { + try { + var modulePath = ts2.resolveJSModule(moduleName3, baseDir, nodeSystem); + return { module: __require(modulePath), modulePath, error: void 0 }; + } catch (error2) { + return { module: void 0, modulePath: void 0, error: error2 }; + } + } + }; + return nodeSystem; + function statSync2(path2) { + return _fs.statSync(path2, { throwIfNoEntry: false }); + } + function enableCPUProfiler(path2, cb) { + if (activeSession) { + cb(); + return false; + } + var inspector = __require("inspector"); + if (!inspector || !inspector.Session) { + cb(); + return false; + } + var session = new inspector.Session(); + session.connect(); + session.post("Profiler.enable", function() { + session.post("Profiler.start", function() { + activeSession = session; + profilePath = path2; + cb(); + }); + }); + return true; + } + function cleanupPaths(profile2) { + var externalFileCounter = 0; + var remappedPaths = new ts2.Map(); + var normalizedDir = ts2.normalizeSlashes(__dirname); + var fileUrlRoot = "file://".concat(ts2.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir); + for (var _i = 0, _a2 = profile2.nodes; _i < _a2.length; _i++) { + var node = _a2[_i]; + if (node.callFrame.url) { + var url = ts2.normalizeSlashes(node.callFrame.url); + if (ts2.containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) { + node.callFrame.url = ts2.getRelativePathToDirectoryOrUrl( + fileUrlRoot, + url, + fileUrlRoot, + ts2.createGetCanonicalFileName(useCaseSensitiveFileNames), + /*isAbsolutePathAnUrl*/ + true + ); + } else if (!nativePattern.test(url)) { + node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url); + externalFileCounter++; + } + } + } + return profile2; + } + function disableCPUProfiler(cb) { + if (activeSession && activeSession !== "stopping") { + var s_1 = activeSession; + activeSession.post("Profiler.stop", function(err, _a2) { + var _b2; + var profile2 = _a2.profile; + if (!err) { + try { + if ((_b2 = statSync2(profilePath)) === null || _b2 === void 0 ? void 0 : _b2.isDirectory()) { + profilePath = _path.join(profilePath, "".concat((/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile")); + } + } catch (_c) { + } + try { + _fs.mkdirSync(_path.dirname(profilePath), { recursive: true }); + } catch (_d) { + } + _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile2))); + } + activeSession = void 0; + s_1.disconnect(); + cb(); + }); + activeSession = "stopping"; + return true; + } else { + cb(); + return false; + } + } + function bufferFrom(input, encoding) { + return Buffer4.from && Buffer4.from !== Int8Array.from ? Buffer4.from(input, encoding) : new Buffer4(input, encoding); + } + function isFileSystemCaseSensitive() { + if (platform4 === "win32" || platform4 === "win64") { + return false; + } + return !fileExists(swapCase(__filename)); + } + function swapCase(s7) { + return s7.replace(/\w/g, function(ch) { + var up = ch.toUpperCase(); + return ch === up ? ch.toLowerCase() : up; + }); + } + function fsWatchFileWorker(fileName, callback, pollingInterval) { + _fs.watchFile(fileName, { persistent: true, interval: pollingInterval }, fileChanged); + var eventKind; + return { + close: function() { + return _fs.unwatchFile(fileName, fileChanged); + } + }; + function fileChanged(curr, prev) { + var isPreviouslyDeleted = +prev.mtime === 0 || eventKind === FileWatcherEventKind.Deleted; + if (+curr.mtime === 0) { + if (isPreviouslyDeleted) { + return; + } + eventKind = FileWatcherEventKind.Deleted; + } else if (isPreviouslyDeleted) { + eventKind = FileWatcherEventKind.Created; + } else if (+curr.mtime === +prev.mtime) { + return; + } else { + eventKind = FileWatcherEventKind.Changed; + } + callback(fileName, eventKind, curr.mtime); + } + } + function fsWatchWorker(fileOrDirectory, recursive, callback) { + return _fs.watch(fileOrDirectory, fsSupportsRecursiveFsWatch ? { persistent: true, recursive: !!recursive } : { persistent: true }, callback); + } + function readFileWorker(fileName, _encoding) { + var buffer2; + try { + buffer2 = _fs.readFileSync(fileName); + } catch (e10) { + return void 0; + } + var len = buffer2.length; + if (len >= 2 && buffer2[0] === 254 && buffer2[1] === 255) { + len &= ~1; + for (var i7 = 0; i7 < len; i7 += 2) { + var temp = buffer2[i7]; + buffer2[i7] = buffer2[i7 + 1]; + buffer2[i7 + 1] = temp; + } + return buffer2.toString("utf16le", 2); + } + if (len >= 2 && buffer2[0] === 255 && buffer2[1] === 254) { + return buffer2.toString("utf16le", 2); + } + if (len >= 3 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191) { + return buffer2.toString("utf8", 3); + } + return buffer2.toString("utf8"); + } + function readFile2(fileName, _encoding) { + ts2.perfLogger.logStartReadFile(fileName); + var file = readFileWorker(fileName, _encoding); + ts2.perfLogger.logStopReadFile(); + return file; + } + function writeFile2(fileName, data, writeByteOrderMark) { + ts2.perfLogger.logEvent("WriteFile: " + fileName); + if (writeByteOrderMark) { + data = byteOrderMarkIndicator + data; + } + var fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync( + fd, + data, + /*position*/ + void 0, + "utf8" + ); + } finally { + if (fd !== void 0) { + _fs.closeSync(fd); + } + } + } + function getAccessibleFileSystemEntries(path2) { + ts2.perfLogger.logEvent("ReadDir: " + (path2 || ".")); + try { + var entries = _fs.readdirSync(path2 || ".", { withFileTypes: true }); + var files = []; + var directories = []; + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { + var dirent = entries_1[_i]; + var entry = typeof dirent === "string" ? dirent : dirent.name; + if (entry === "." || entry === "..") { + continue; + } + var stat2 = void 0; + if (typeof dirent === "string" || dirent.isSymbolicLink()) { + var name2 = ts2.combinePaths(path2, entry); + try { + stat2 = statSync2(name2); + if (!stat2) { + continue; + } + } catch (e10) { + continue; + } + } else { + stat2 = dirent; + } + if (stat2.isFile()) { + files.push(entry); + } else if (stat2.isDirectory()) { + directories.push(entry); + } + } + files.sort(); + directories.sort(); + return { files, directories }; + } catch (e10) { + return ts2.emptyFileSystemEntries; + } + } + function readDirectory(path2, extensions6, excludes, includes2, depth) { + return ts2.matchFiles(path2, extensions6, excludes, includes2, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath2); + } + function fileSystemEntryExists(path2, entryKind) { + var originalStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + try { + var stat2 = statSync2(path2); + if (!stat2) { + return false; + } + switch (entryKind) { + case 0: + return stat2.isFile(); + case 1: + return stat2.isDirectory(); + default: + return false; + } + } catch (e10) { + return false; + } finally { + Error.stackTraceLimit = originalStackTraceLimit; + } + } + function fileExists(path2) { + return fileSystemEntryExists( + path2, + 0 + /* FileSystemEntryKind.File */ + ); + } + function directoryExists(path2) { + return fileSystemEntryExists( + path2, + 1 + /* FileSystemEntryKind.Directory */ + ); + } + function getDirectories(path2) { + return getAccessibleFileSystemEntries(path2).directories.slice(); + } + function fsRealPathHandlingLongPath(path2) { + return path2.length < 260 ? _fs.realpathSync.native(path2) : _fs.realpathSync(path2); + } + function realpath2(path2) { + try { + return fsRealpath(path2); + } catch (_a2) { + return path2; + } + } + function getModifiedTime2(path2) { + var _a2; + var originalStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + try { + return (_a2 = statSync2(path2)) === null || _a2 === void 0 ? void 0 : _a2.mtime; + } catch (e10) { + return void 0; + } finally { + Error.stackTraceLimit = originalStackTraceLimit; + } + } + function setModifiedTime(path2, time2) { + try { + _fs.utimesSync(path2, time2, time2); + } catch (e10) { + return; + } + } + function deleteFile(path2) { + try { + return _fs.unlinkSync(path2); + } catch (e10) { + return; + } + } + function createSHA256Hash(data) { + var hash = _crypto.createHash("sha256"); + hash.update(data); + return hash.digest("hex"); + } + } + var sys; + if (typeof process !== "undefined" && process.nextTick && !process.browser && typeof __require !== "undefined") { + sys = getNodeSystem(); + } + if (sys) { + patchWriteFileEnsuringDirectory(sys); + } + return sys; + }(); + function setSys(s7) { + ts2.sys = s7; + } + ts2.setSys = setSys; + if (ts2.sys && ts2.sys.getEnvironmentVariable) { + setCustomPollingValues(ts2.sys); + ts2.Debug.setAssertionLevel( + /^development$/i.test(ts2.sys.getEnvironmentVariable("NODE_ENV")) ? 1 : 0 + /* AssertionLevel.None */ + ); + } + if (ts2.sys && ts2.sys.debugMode) { + ts2.Debug.isDebugging = true; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.directorySeparator = "/"; + ts2.altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + var backslashRegExp = /\\/g; + function isAnyDirectorySeparator(charCode) { + return charCode === 47 || charCode === 92; + } + ts2.isAnyDirectorySeparator = isAnyDirectorySeparator; + function isUrl(path2) { + return getEncodedRootLength(path2) < 0; + } + ts2.isUrl = isUrl; + function isRootedDiskPath(path2) { + return getEncodedRootLength(path2) > 0; + } + ts2.isRootedDiskPath = isRootedDiskPath; + function isDiskPathRoot(path2) { + var rootLength = getEncodedRootLength(path2); + return rootLength > 0 && rootLength === path2.length; + } + ts2.isDiskPathRoot = isDiskPathRoot; + function pathIsAbsolute(path2) { + return getEncodedRootLength(path2) !== 0; + } + ts2.pathIsAbsolute = pathIsAbsolute; + function pathIsRelative(path2) { + return /^\.\.?($|[\\/])/.test(path2); + } + ts2.pathIsRelative = pathIsRelative; + function pathIsBareSpecifier(path2) { + return !pathIsAbsolute(path2) && !pathIsRelative(path2); + } + ts2.pathIsBareSpecifier = pathIsBareSpecifier; + function hasExtension(fileName) { + return ts2.stringContains(getBaseFileName(fileName), "."); + } + ts2.hasExtension = hasExtension; + function fileExtensionIs(path2, extension) { + return path2.length > extension.length && ts2.endsWith(path2, extension); + } + ts2.fileExtensionIs = fileExtensionIs; + function fileExtensionIsOneOf(path2, extensions6) { + for (var _i = 0, extensions_1 = extensions6; _i < extensions_1.length; _i++) { + var extension = extensions_1[_i]; + if (fileExtensionIs(path2, extension)) { + return true; + } + } + return false; + } + ts2.fileExtensionIsOneOf = fileExtensionIsOneOf; + function hasTrailingDirectorySeparator(path2) { + return path2.length > 0 && isAnyDirectorySeparator(path2.charCodeAt(path2.length - 1)); + } + ts2.hasTrailingDirectorySeparator = hasTrailingDirectorySeparator; + function isVolumeCharacter(charCode) { + return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90; + } + function getFileUrlVolumeSeparatorEnd(url, start) { + var ch0 = url.charCodeAt(start); + if (ch0 === 58) + return start + 1; + if (ch0 === 37 && url.charCodeAt(start + 1) === 51) { + var ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 || ch2 === 65) + return start + 3; + } + return -1; + } + function getEncodedRootLength(path2) { + if (!path2) + return 0; + var ch0 = path2.charCodeAt(0); + if (ch0 === 47 || ch0 === 92) { + if (path2.charCodeAt(1) !== ch0) + return 1; + var p1 = path2.indexOf(ch0 === 47 ? ts2.directorySeparator : ts2.altDirectorySeparator, 2); + if (p1 < 0) + return path2.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58) { + var ch2 = path2.charCodeAt(2); + if (ch2 === 47 || ch2 === 92) + return 3; + if (path2.length === 2) + return 2; + } + var schemeEnd = path2.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + var authorityStart = schemeEnd + urlSchemeSeparator.length; + var authorityEnd = path2.indexOf(ts2.directorySeparator, authorityStart); + if (authorityEnd !== -1) { + var scheme = path2.slice(0, schemeEnd); + var authority = path2.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) { + var volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path2.charCodeAt(volumeSeparatorEnd) === 47) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path2.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path2.length; + } + return 0; + } + function getRootLength(path2) { + var rootLength = getEncodedRootLength(path2); + return rootLength < 0 ? ~rootLength : rootLength; + } + ts2.getRootLength = getRootLength; + function getDirectoryPath(path2) { + path2 = normalizeSlashes(path2); + var rootLength = getRootLength(path2); + if (rootLength === path2.length) + return path2; + path2 = removeTrailingDirectorySeparator(path2); + return path2.slice(0, Math.max(rootLength, path2.lastIndexOf(ts2.directorySeparator))); + } + ts2.getDirectoryPath = getDirectoryPath; + function getBaseFileName(path2, extensions6, ignoreCase) { + path2 = normalizeSlashes(path2); + var rootLength = getRootLength(path2); + if (rootLength === path2.length) + return ""; + path2 = removeTrailingDirectorySeparator(path2); + var name2 = path2.slice(Math.max(getRootLength(path2), path2.lastIndexOf(ts2.directorySeparator) + 1)); + var extension = extensions6 !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name2, extensions6, ignoreCase) : void 0; + return extension ? name2.slice(0, name2.length - extension.length) : name2; + } + ts2.getBaseFileName = getBaseFileName; + function tryGetExtensionFromPath(path2, extension, stringEqualityComparer) { + if (!ts2.startsWith(extension, ".")) + extension = "." + extension; + if (path2.length >= extension.length && path2.charCodeAt(path2.length - extension.length) === 46) { + var pathExtension = path2.slice(path2.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path2, extensions6, stringEqualityComparer) { + if (typeof extensions6 === "string") { + return tryGetExtensionFromPath(path2, extensions6, stringEqualityComparer) || ""; + } + for (var _i = 0, extensions_2 = extensions6; _i < extensions_2.length; _i++) { + var extension = extensions_2[_i]; + var result2 = tryGetExtensionFromPath(path2, extension, stringEqualityComparer); + if (result2) + return result2; + } + return ""; + } + function getAnyExtensionFromPath(path2, extensions6, ignoreCase) { + if (extensions6) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path2), extensions6, ignoreCase ? ts2.equateStringsCaseInsensitive : ts2.equateStringsCaseSensitive); + } + var baseFileName = getBaseFileName(path2); + var extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + ts2.getAnyExtensionFromPath = getAnyExtensionFromPath; + function pathComponents(path2, rootLength) { + var root2 = path2.substring(0, rootLength); + var rest2 = path2.substring(rootLength).split(ts2.directorySeparator); + if (rest2.length && !ts2.lastOrUndefined(rest2)) + rest2.pop(); + return __spreadArray9([root2], rest2, true); + } + function getPathComponents(path2, currentDirectory) { + if (currentDirectory === void 0) { + currentDirectory = ""; + } + path2 = combinePaths(currentDirectory, path2); + return pathComponents(path2, getRootLength(path2)); + } + ts2.getPathComponents = getPathComponents; + function getPathFromPathComponents(pathComponents2) { + if (pathComponents2.length === 0) + return ""; + var root2 = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]); + return root2 + pathComponents2.slice(1).join(ts2.directorySeparator); + } + ts2.getPathFromPathComponents = getPathFromPathComponents; + function normalizeSlashes(path2) { + return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, ts2.directorySeparator) : path2; + } + ts2.normalizeSlashes = normalizeSlashes; + function reducePathComponents(components) { + if (!ts2.some(components)) + return []; + var reduced = [components[0]]; + for (var i7 = 1; i7 < components.length; i7++) { + var component = components[i7]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + ts2.reducePathComponents = reducePathComponents; + function combinePaths(path2) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + if (path2) + path2 = normalizeSlashes(path2); + for (var _a2 = 0, paths_1 = paths; _a2 < paths_1.length; _a2++) { + var relativePath2 = paths_1[_a2]; + if (!relativePath2) + continue; + relativePath2 = normalizeSlashes(relativePath2); + if (!path2 || getRootLength(relativePath2) !== 0) { + path2 = relativePath2; + } else { + path2 = ensureTrailingDirectorySeparator(path2) + relativePath2; + } + } + return path2; + } + ts2.combinePaths = combinePaths; + function resolvePath(path2) { + var paths = []; + for (var _i = 1; _i < arguments.length; _i++) { + paths[_i - 1] = arguments[_i]; + } + return normalizePath(ts2.some(paths) ? combinePaths.apply(void 0, __spreadArray9([path2], paths, false)) : normalizeSlashes(path2)); + } + ts2.resolvePath = resolvePath; + function getNormalizedPathComponents(path2, currentDirectory) { + return reducePathComponents(getPathComponents(path2, currentDirectory)); + } + ts2.getNormalizedPathComponents = getNormalizedPathComponents; + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts2.getNormalizedAbsolutePath = getNormalizedAbsolutePath; + function normalizePath(path2) { + path2 = normalizeSlashes(path2); + if (!relativePathSegmentRegExp.test(path2)) { + return path2; + } + var simplified = path2.replace(/\/\.\//g, "/").replace(/^\.\//, ""); + if (simplified !== path2) { + path2 = simplified; + if (!relativePathSegmentRegExp.test(path2)) { + return path2; + } + } + var normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path2))); + return normalized && hasTrailingDirectorySeparator(path2) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + ts2.normalizePath = normalizePath; + function getPathWithoutRoot(pathComponents2) { + if (pathComponents2.length === 0) + return ""; + return pathComponents2.slice(1).join(ts2.directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + ts2.getNormalizedAbsolutePathWithoutRoot = getNormalizedAbsolutePathWithoutRoot; + function toPath2(fileName, basePath, getCanonicalFileName) { + var nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + ts2.toPath = toPath2; + function removeTrailingDirectorySeparator(path2) { + if (hasTrailingDirectorySeparator(path2)) { + return path2.substr(0, path2.length - 1); + } + return path2; + } + ts2.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator; + function ensureTrailingDirectorySeparator(path2) { + if (!hasTrailingDirectorySeparator(path2)) { + return path2 + ts2.directorySeparator; + } + return path2; + } + ts2.ensureTrailingDirectorySeparator = ensureTrailingDirectorySeparator; + function ensurePathIsNonModuleName(path2) { + return !pathIsAbsolute(path2) && !pathIsRelative(path2) ? "./" + path2 : path2; + } + ts2.ensurePathIsNonModuleName = ensurePathIsNonModuleName; + function changeAnyExtension(path2, ext, extensions6, ignoreCase) { + var pathext = extensions6 !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path2, extensions6, ignoreCase) : getAnyExtensionFromPath(path2); + return pathext ? path2.slice(0, path2.length - pathext.length) + (ts2.startsWith(ext, ".") ? ext : "." + ext) : path2; + } + ts2.changeAnyExtension = changeAnyExtension; + var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/; + function comparePathsWorker(a7, b8, componentComparer) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + var aRoot = a7.substring(0, getRootLength(a7)); + var bRoot = b8.substring(0, getRootLength(b8)); + var result2 = ts2.compareStringsCaseInsensitive(aRoot, bRoot); + if (result2 !== 0) { + return result2; + } + var aRest = a7.substring(aRoot.length); + var bRest = b8.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + var aComponents = reducePathComponents(getPathComponents(a7)); + var bComponents = reducePathComponents(getPathComponents(b8)); + var sharedLength = Math.min(aComponents.length, bComponents.length); + for (var i7 = 1; i7 < sharedLength; i7++) { + var result_2 = componentComparer(aComponents[i7], bComponents[i7]); + if (result_2 !== 0) { + return result_2; + } + } + return ts2.compareValues(aComponents.length, bComponents.length); + } + function comparePathsCaseSensitive(a7, b8) { + return comparePathsWorker(a7, b8, ts2.compareStringsCaseSensitive); + } + ts2.comparePathsCaseSensitive = comparePathsCaseSensitive; + function comparePathsCaseInsensitive(a7, b8) { + return comparePathsWorker(a7, b8, ts2.compareStringsCaseInsensitive); + } + ts2.comparePathsCaseInsensitive = comparePathsCaseInsensitive; + function comparePaths(a7, b8, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a7 = combinePaths(currentDirectory, a7); + b8 = combinePaths(currentDirectory, b8); + } else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a7, b8, ts2.getStringComparer(ignoreCase)); + } + ts2.comparePaths = comparePaths; + function containsPath(parent2, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent2 = combinePaths(currentDirectory, parent2); + child = combinePaths(currentDirectory, child); + } else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent2 === void 0 || child === void 0) + return false; + if (parent2 === child) + return true; + var parentComponents = reducePathComponents(getPathComponents(parent2)); + var childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + var componentEqualityComparer = ignoreCase ? ts2.equateStringsCaseInsensitive : ts2.equateStringsCaseSensitive; + for (var i7 = 0; i7 < parentComponents.length; i7++) { + var equalityComparer = i7 === 0 ? ts2.equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i7], childComponents[i7])) { + return false; + } + } + return true; + } + ts2.containsPath = containsPath; + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + var canonicalFileName = getCanonicalFileName(fileName); + var canonicalDirectoryName = getCanonicalFileName(directoryName); + return ts2.startsWith(canonicalFileName, canonicalDirectoryName + "/") || ts2.startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + ts2.startsWithDirectory = startsWithDirectory; + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + var fromComponents = reducePathComponents(getPathComponents(from)); + var toComponents = reducePathComponents(getPathComponents(to)); + var start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + var fromComponent = getCanonicalFileName(fromComponents[start]); + var toComponent = getCanonicalFileName(toComponents[start]); + var comparer = start === 0 ? ts2.equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + var components = toComponents.slice(start); + var relative2 = []; + for (; start < fromComponents.length; start++) { + relative2.push(".."); + } + return __spreadArray9(__spreadArray9([""], relative2, true), components, true); + } + ts2.getPathComponentsRelativeTo = getPathComponentsRelativeTo; + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + ts2.Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative"); + var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts2.identity; + var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + var pathComponents2 = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts2.equateStringsCaseInsensitive : ts2.equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents2); + } + ts2.getRelativePathFromDirectory = getRelativePathFromDirectory; + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) ? absoluteOrRelativePath : getRelativePathToDirectoryOrUrl( + basePath, + absoluteOrRelativePath, + basePath, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + } + ts2.convertToRelativePath = convertToRelativePath; + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + ts2.getRelativePathFromFile = getRelativePathFromFile; + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + var pathComponents2 = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts2.equateStringsCaseSensitive, getCanonicalFileName); + var firstComponent = pathComponents2[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + var prefix = firstComponent.charAt(0) === ts2.directorySeparator ? "file://" : "file:///"; + pathComponents2[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents2); + } + ts2.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; + function forEachAncestorDirectory(directory, callback) { + while (true) { + var result2 = callback(directory); + if (result2 !== void 0) { + return result2; + } + var parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return void 0; + } + directory = parentPath; + } + } + ts2.forEachAncestorDirectory = forEachAncestorDirectory; + function isNodeModulesDirectory(dirPath) { + return ts2.endsWith(dirPath, "/node_modules"); + } + ts2.isNodeModulesDirectory = isNodeModulesDirectory; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) { + return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated }; + } + ts2.Diagnostics = { + Unterminated_string_literal: diag(1002, ts2.DiagnosticCategory.Error, "Unterminated_string_literal_1002", "Unterminated string literal."), + Identifier_expected: diag(1003, ts2.DiagnosticCategory.Error, "Identifier_expected_1003", "Identifier expected."), + _0_expected: diag(1005, ts2.DiagnosticCategory.Error, "_0_expected_1005", "'{0}' expected."), + A_file_cannot_have_a_reference_to_itself: diag(1006, ts2.DiagnosticCategory.Error, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."), + The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, ts2.DiagnosticCategory.Error, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."), + Trailing_comma_not_allowed: diag(1009, ts2.DiagnosticCategory.Error, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."), + Asterisk_Slash_expected: diag(1010, ts2.DiagnosticCategory.Error, "Asterisk_Slash_expected_1010", "'*/' expected."), + An_element_access_expression_should_take_an_argument: diag(1011, ts2.DiagnosticCategory.Error, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."), + Unexpected_token: diag(1012, ts2.DiagnosticCategory.Error, "Unexpected_token_1012", "Unexpected token."), + A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: diag(1013, ts2.DiagnosticCategory.Error, "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013", "A rest parameter or binding pattern may not have a trailing comma."), + A_rest_parameter_must_be_last_in_a_parameter_list: diag(1014, ts2.DiagnosticCategory.Error, "A_rest_parameter_must_be_last_in_a_parameter_list_1014", "A rest parameter must be last in a parameter list."), + Parameter_cannot_have_question_mark_and_initializer: diag(1015, ts2.DiagnosticCategory.Error, "Parameter_cannot_have_question_mark_and_initializer_1015", "Parameter cannot have question mark and initializer."), + A_required_parameter_cannot_follow_an_optional_parameter: diag(1016, ts2.DiagnosticCategory.Error, "A_required_parameter_cannot_follow_an_optional_parameter_1016", "A required parameter cannot follow an optional parameter."), + An_index_signature_cannot_have_a_rest_parameter: diag(1017, ts2.DiagnosticCategory.Error, "An_index_signature_cannot_have_a_rest_parameter_1017", "An index signature cannot have a rest parameter."), + An_index_signature_parameter_cannot_have_an_accessibility_modifier: diag(1018, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018", "An index signature parameter cannot have an accessibility modifier."), + An_index_signature_parameter_cannot_have_a_question_mark: diag(1019, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_cannot_have_a_question_mark_1019", "An index signature parameter cannot have a question mark."), + An_index_signature_parameter_cannot_have_an_initializer: diag(1020, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_cannot_have_an_initializer_1020", "An index signature parameter cannot have an initializer."), + An_index_signature_must_have_a_type_annotation: diag(1021, ts2.DiagnosticCategory.Error, "An_index_signature_must_have_a_type_annotation_1021", "An index signature must have a type annotation."), + An_index_signature_parameter_must_have_a_type_annotation: diag(1022, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."), + readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, ts2.DiagnosticCategory.Error, "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024", "'readonly' modifier can only appear on a property declaration or index signature."), + An_index_signature_cannot_have_a_trailing_comma: diag(1025, ts2.DiagnosticCategory.Error, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."), + Accessibility_modifier_already_seen: diag(1028, ts2.DiagnosticCategory.Error, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), + _0_modifier_must_precede_1_modifier: diag(1029, ts2.DiagnosticCategory.Error, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), + _0_modifier_already_seen: diag(1030, ts2.DiagnosticCategory.Error, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), + _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, ts2.DiagnosticCategory.Error, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), + Only_ambient_modules_can_use_quoted_names: diag(1035, ts2.DiagnosticCategory.Error, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), + Statements_are_not_allowed_in_ambient_contexts: diag(1036, ts2.DiagnosticCategory.Error, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, ts2.DiagnosticCategory.Error, "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038", "A 'declare' modifier cannot be used in an already ambient context."), + Initializers_are_not_allowed_in_ambient_contexts: diag(1039, ts2.DiagnosticCategory.Error, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."), + _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."), + _0_modifier_cannot_be_used_here: diag(1042, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."), + _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."), + Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, ts2.DiagnosticCategory.Error, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."), + A_rest_parameter_cannot_be_optional: diag(1047, ts2.DiagnosticCategory.Error, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."), + A_rest_parameter_cannot_have_an_initializer: diag(1048, ts2.DiagnosticCategory.Error, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."), + A_set_accessor_must_have_exactly_one_parameter: diag(1049, ts2.DiagnosticCategory.Error, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."), + A_set_accessor_cannot_have_an_optional_parameter: diag(1051, ts2.DiagnosticCategory.Error, "A_set_accessor_cannot_have_an_optional_parameter_1051", "A 'set' accessor cannot have an optional parameter."), + A_set_accessor_parameter_cannot_have_an_initializer: diag(1052, ts2.DiagnosticCategory.Error, "A_set_accessor_parameter_cannot_have_an_initializer_1052", "A 'set' accessor parameter cannot have an initializer."), + A_set_accessor_cannot_have_rest_parameter: diag(1053, ts2.DiagnosticCategory.Error, "A_set_accessor_cannot_have_rest_parameter_1053", "A 'set' accessor cannot have rest parameter."), + A_get_accessor_cannot_have_parameters: diag(1054, ts2.DiagnosticCategory.Error, "A_get_accessor_cannot_have_parameters_1054", "A 'get' accessor cannot have parameters."), + Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, ts2.DiagnosticCategory.Error, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."), + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, ts2.DiagnosticCategory.Error, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."), + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, ts2.DiagnosticCategory.Error, "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", "The return type of an async function must either be a valid promise or must not contain a callable 'then' member."), + A_promise_must_have_a_then_method: diag(1059, ts2.DiagnosticCategory.Error, "A_promise_must_have_a_then_method_1059", "A promise must have a 'then' method."), + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: diag(1060, ts2.DiagnosticCategory.Error, "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", "The first parameter of the 'then' method of a promise must be a callback."), + Enum_member_must_have_initializer: diag(1061, ts2.DiagnosticCategory.Error, "Enum_member_must_have_initializer_1061", "Enum member must have initializer."), + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, ts2.DiagnosticCategory.Error, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."), + An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, ts2.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."), + The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, ts2.DiagnosticCategory.Error, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"), + In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, ts2.DiagnosticCategory.Error, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."), + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, ts2.DiagnosticCategory.Error, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."), + Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, ts2.DiagnosticCategory.Error, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."), + _0_modifier_cannot_appear_on_a_type_member: diag(1070, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."), + _0_modifier_cannot_appear_on_an_index_signature: diag(1071, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."), + A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, ts2.DiagnosticCategory.Error, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."), + Invalid_reference_directive_syntax: diag(1084, ts2.DiagnosticCategory.Error, "Invalid_reference_directive_syntax_1084", "Invalid 'reference' directive syntax."), + Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: diag(1085, ts2.DiagnosticCategory.Error, "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."), + _0_modifier_cannot_appear_on_a_constructor_declaration: diag(1089, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", "'{0}' modifier cannot appear on a constructor declaration."), + _0_modifier_cannot_appear_on_a_parameter: diag(1090, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_parameter_1090", "'{0}' modifier cannot appear on a parameter."), + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: diag(1091, ts2.DiagnosticCategory.Error, "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091", "Only a single variable declaration is allowed in a 'for...in' statement."), + Type_parameters_cannot_appear_on_a_constructor_declaration: diag(1092, ts2.DiagnosticCategory.Error, "Type_parameters_cannot_appear_on_a_constructor_declaration_1092", "Type parameters cannot appear on a constructor declaration."), + Type_annotation_cannot_appear_on_a_constructor_declaration: diag(1093, ts2.DiagnosticCategory.Error, "Type_annotation_cannot_appear_on_a_constructor_declaration_1093", "Type annotation cannot appear on a constructor declaration."), + An_accessor_cannot_have_type_parameters: diag(1094, ts2.DiagnosticCategory.Error, "An_accessor_cannot_have_type_parameters_1094", "An accessor cannot have type parameters."), + A_set_accessor_cannot_have_a_return_type_annotation: diag(1095, ts2.DiagnosticCategory.Error, "A_set_accessor_cannot_have_a_return_type_annotation_1095", "A 'set' accessor cannot have a return type annotation."), + An_index_signature_must_have_exactly_one_parameter: diag(1096, ts2.DiagnosticCategory.Error, "An_index_signature_must_have_exactly_one_parameter_1096", "An index signature must have exactly one parameter."), + _0_list_cannot_be_empty: diag(1097, ts2.DiagnosticCategory.Error, "_0_list_cannot_be_empty_1097", "'{0}' list cannot be empty."), + Type_parameter_list_cannot_be_empty: diag(1098, ts2.DiagnosticCategory.Error, "Type_parameter_list_cannot_be_empty_1098", "Type parameter list cannot be empty."), + Type_argument_list_cannot_be_empty: diag(1099, ts2.DiagnosticCategory.Error, "Type_argument_list_cannot_be_empty_1099", "Type argument list cannot be empty."), + Invalid_use_of_0_in_strict_mode: diag(1100, ts2.DiagnosticCategory.Error, "Invalid_use_of_0_in_strict_mode_1100", "Invalid use of '{0}' in strict mode."), + with_statements_are_not_allowed_in_strict_mode: diag(1101, ts2.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_strict_mode_1101", "'with' statements are not allowed in strict mode."), + delete_cannot_be_called_on_an_identifier_in_strict_mode: diag(1102, ts2.DiagnosticCategory.Error, "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", "'delete' cannot be called on an identifier in strict mode."), + for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, ts2.DiagnosticCategory.Error, "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103", "'for await' loops are only allowed within async functions and at the top levels of modules."), + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: diag(1104, ts2.DiagnosticCategory.Error, "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", "A 'continue' statement can only be used within an enclosing iteration statement."), + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: diag(1105, ts2.DiagnosticCategory.Error, "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", "A 'break' statement can only be used within an enclosing iteration or switch statement."), + The_left_hand_side_of_a_for_of_statement_may_not_be_async: diag(1106, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106", "The left-hand side of a 'for...of' statement may not be 'async'."), + Jump_target_cannot_cross_function_boundary: diag(1107, ts2.DiagnosticCategory.Error, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."), + A_return_statement_can_only_be_used_within_a_function_body: diag(1108, ts2.DiagnosticCategory.Error, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."), + Expression_expected: diag(1109, ts2.DiagnosticCategory.Error, "Expression_expected_1109", "Expression expected."), + Type_expected: diag(1110, ts2.DiagnosticCategory.Error, "Type_expected_1110", "Type expected."), + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, ts2.DiagnosticCategory.Error, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."), + Duplicate_label_0: diag(1114, ts2.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."), + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts2.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."), + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts2.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."), + An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts2.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."), + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts2.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."), + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts2.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."), + An_export_assignment_cannot_have_modifiers: diag(1120, ts2.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."), + Octal_literals_are_not_allowed_in_strict_mode: diag(1121, ts2.DiagnosticCategory.Error, "Octal_literals_are_not_allowed_in_strict_mode_1121", "Octal literals are not allowed in strict mode."), + Variable_declaration_list_cannot_be_empty: diag(1123, ts2.DiagnosticCategory.Error, "Variable_declaration_list_cannot_be_empty_1123", "Variable declaration list cannot be empty."), + Digit_expected: diag(1124, ts2.DiagnosticCategory.Error, "Digit_expected_1124", "Digit expected."), + Hexadecimal_digit_expected: diag(1125, ts2.DiagnosticCategory.Error, "Hexadecimal_digit_expected_1125", "Hexadecimal digit expected."), + Unexpected_end_of_text: diag(1126, ts2.DiagnosticCategory.Error, "Unexpected_end_of_text_1126", "Unexpected end of text."), + Invalid_character: diag(1127, ts2.DiagnosticCategory.Error, "Invalid_character_1127", "Invalid character."), + Declaration_or_statement_expected: diag(1128, ts2.DiagnosticCategory.Error, "Declaration_or_statement_expected_1128", "Declaration or statement expected."), + Statement_expected: diag(1129, ts2.DiagnosticCategory.Error, "Statement_expected_1129", "Statement expected."), + case_or_default_expected: diag(1130, ts2.DiagnosticCategory.Error, "case_or_default_expected_1130", "'case' or 'default' expected."), + Property_or_signature_expected: diag(1131, ts2.DiagnosticCategory.Error, "Property_or_signature_expected_1131", "Property or signature expected."), + Enum_member_expected: diag(1132, ts2.DiagnosticCategory.Error, "Enum_member_expected_1132", "Enum member expected."), + Variable_declaration_expected: diag(1134, ts2.DiagnosticCategory.Error, "Variable_declaration_expected_1134", "Variable declaration expected."), + Argument_expression_expected: diag(1135, ts2.DiagnosticCategory.Error, "Argument_expression_expected_1135", "Argument expression expected."), + Property_assignment_expected: diag(1136, ts2.DiagnosticCategory.Error, "Property_assignment_expected_1136", "Property assignment expected."), + Expression_or_comma_expected: diag(1137, ts2.DiagnosticCategory.Error, "Expression_or_comma_expected_1137", "Expression or comma expected."), + Parameter_declaration_expected: diag(1138, ts2.DiagnosticCategory.Error, "Parameter_declaration_expected_1138", "Parameter declaration expected."), + Type_parameter_declaration_expected: diag(1139, ts2.DiagnosticCategory.Error, "Type_parameter_declaration_expected_1139", "Type parameter declaration expected."), + Type_argument_expected: diag(1140, ts2.DiagnosticCategory.Error, "Type_argument_expected_1140", "Type argument expected."), + String_literal_expected: diag(1141, ts2.DiagnosticCategory.Error, "String_literal_expected_1141", "String literal expected."), + Line_break_not_permitted_here: diag(1142, ts2.DiagnosticCategory.Error, "Line_break_not_permitted_here_1142", "Line break not permitted here."), + or_expected: diag(1144, ts2.DiagnosticCategory.Error, "or_expected_1144", "'{' or ';' expected."), + or_JSX_element_expected: diag(1145, ts2.DiagnosticCategory.Error, "or_JSX_element_expected_1145", "'{' or JSX element expected."), + Declaration_expected: diag(1146, ts2.DiagnosticCategory.Error, "Declaration_expected_1146", "Declaration expected."), + Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, ts2.DiagnosticCategory.Error, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."), + Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, ts2.DiagnosticCategory.Error, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."), + File_name_0_differs_from_already_included_file_name_1_only_in_casing: diag(1149, ts2.DiagnosticCategory.Error, "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", "File name '{0}' differs from already included file name '{1}' only in casing."), + const_declarations_must_be_initialized: diag(1155, ts2.DiagnosticCategory.Error, "const_declarations_must_be_initialized_1155", "'const' declarations must be initialized."), + const_declarations_can_only_be_declared_inside_a_block: diag(1156, ts2.DiagnosticCategory.Error, "const_declarations_can_only_be_declared_inside_a_block_1156", "'const' declarations can only be declared inside a block."), + let_declarations_can_only_be_declared_inside_a_block: diag(1157, ts2.DiagnosticCategory.Error, "let_declarations_can_only_be_declared_inside_a_block_1157", "'let' declarations can only be declared inside a block."), + Unterminated_template_literal: diag(1160, ts2.DiagnosticCategory.Error, "Unterminated_template_literal_1160", "Unterminated template literal."), + Unterminated_regular_expression_literal: diag(1161, ts2.DiagnosticCategory.Error, "Unterminated_regular_expression_literal_1161", "Unterminated regular expression literal."), + An_object_member_cannot_be_declared_optional: diag(1162, ts2.DiagnosticCategory.Error, "An_object_member_cannot_be_declared_optional_1162", "An object member cannot be declared optional."), + A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, ts2.DiagnosticCategory.Error, "A_yield_expression_is_only_allowed_in_a_generator_body_1163", "A 'yield' expression is only allowed in a generator body."), + Computed_property_names_are_not_allowed_in_enums: diag(1164, ts2.DiagnosticCategory.Error, "Computed_property_names_are_not_allowed_in_enums_1164", "Computed property names are not allowed in enums."), + A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1165, ts2.DiagnosticCategory.Error, "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165", "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type: diag(1166, ts2.DiagnosticCategory.Error, "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166", "A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1168, ts2.DiagnosticCategory.Error, "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168", "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1169, ts2.DiagnosticCategory.Error, "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169", "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1170, ts2.DiagnosticCategory.Error, "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170", "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_comma_expression_is_not_allowed_in_a_computed_property_name: diag(1171, ts2.DiagnosticCategory.Error, "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171", "A comma expression is not allowed in a computed property name."), + extends_clause_already_seen: diag(1172, ts2.DiagnosticCategory.Error, "extends_clause_already_seen_1172", "'extends' clause already seen."), + extends_clause_must_precede_implements_clause: diag(1173, ts2.DiagnosticCategory.Error, "extends_clause_must_precede_implements_clause_1173", "'extends' clause must precede 'implements' clause."), + Classes_can_only_extend_a_single_class: diag(1174, ts2.DiagnosticCategory.Error, "Classes_can_only_extend_a_single_class_1174", "Classes can only extend a single class."), + implements_clause_already_seen: diag(1175, ts2.DiagnosticCategory.Error, "implements_clause_already_seen_1175", "'implements' clause already seen."), + Interface_declaration_cannot_have_implements_clause: diag(1176, ts2.DiagnosticCategory.Error, "Interface_declaration_cannot_have_implements_clause_1176", "Interface declaration cannot have 'implements' clause."), + Binary_digit_expected: diag(1177, ts2.DiagnosticCategory.Error, "Binary_digit_expected_1177", "Binary digit expected."), + Octal_digit_expected: diag(1178, ts2.DiagnosticCategory.Error, "Octal_digit_expected_1178", "Octal digit expected."), + Unexpected_token_expected: diag(1179, ts2.DiagnosticCategory.Error, "Unexpected_token_expected_1179", "Unexpected token. '{' expected."), + Property_destructuring_pattern_expected: diag(1180, ts2.DiagnosticCategory.Error, "Property_destructuring_pattern_expected_1180", "Property destructuring pattern expected."), + Array_element_destructuring_pattern_expected: diag(1181, ts2.DiagnosticCategory.Error, "Array_element_destructuring_pattern_expected_1181", "Array element destructuring pattern expected."), + A_destructuring_declaration_must_have_an_initializer: diag(1182, ts2.DiagnosticCategory.Error, "A_destructuring_declaration_must_have_an_initializer_1182", "A destructuring declaration must have an initializer."), + An_implementation_cannot_be_declared_in_ambient_contexts: diag(1183, ts2.DiagnosticCategory.Error, "An_implementation_cannot_be_declared_in_ambient_contexts_1183", "An implementation cannot be declared in ambient contexts."), + Modifiers_cannot_appear_here: diag(1184, ts2.DiagnosticCategory.Error, "Modifiers_cannot_appear_here_1184", "Modifiers cannot appear here."), + Merge_conflict_marker_encountered: diag(1185, ts2.DiagnosticCategory.Error, "Merge_conflict_marker_encountered_1185", "Merge conflict marker encountered."), + A_rest_element_cannot_have_an_initializer: diag(1186, ts2.DiagnosticCategory.Error, "A_rest_element_cannot_have_an_initializer_1186", "A rest element cannot have an initializer."), + A_parameter_property_may_not_be_declared_using_a_binding_pattern: diag(1187, ts2.DiagnosticCategory.Error, "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187", "A parameter property may not be declared using a binding pattern."), + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: diag(1188, ts2.DiagnosticCategory.Error, "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188", "Only a single variable declaration is allowed in a 'for...of' statement."), + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: diag(1189, ts2.DiagnosticCategory.Error, "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189", "The variable declaration of a 'for...in' statement cannot have an initializer."), + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: diag(1190, ts2.DiagnosticCategory.Error, "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190", "The variable declaration of a 'for...of' statement cannot have an initializer."), + An_import_declaration_cannot_have_modifiers: diag(1191, ts2.DiagnosticCategory.Error, "An_import_declaration_cannot_have_modifiers_1191", "An import declaration cannot have modifiers."), + Module_0_has_no_default_export: diag(1192, ts2.DiagnosticCategory.Error, "Module_0_has_no_default_export_1192", "Module '{0}' has no default export."), + An_export_declaration_cannot_have_modifiers: diag(1193, ts2.DiagnosticCategory.Error, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."), + Export_declarations_are_not_permitted_in_a_namespace: diag(1194, ts2.DiagnosticCategory.Error, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."), + export_Asterisk_does_not_re_export_a_default: diag(1195, ts2.DiagnosticCategory.Error, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."), + Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, ts2.DiagnosticCategory.Error, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."), + Catch_clause_variable_cannot_have_an_initializer: diag(1197, ts2.DiagnosticCategory.Error, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."), + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, ts2.DiagnosticCategory.Error, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."), + Unterminated_Unicode_escape_sequence: diag(1199, ts2.DiagnosticCategory.Error, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."), + Line_terminator_not_permitted_before_arrow: diag(1200, ts2.DiagnosticCategory.Error, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), + Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, ts2.DiagnosticCategory.Error, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), + Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, ts2.DiagnosticCategory.Error, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), + Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, ts2.DiagnosticCategory.Error, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), + Decorators_are_not_valid_here: diag(1206, ts2.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), + Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts2.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), + _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts2.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), + Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, ts2.DiagnosticCategory.Error, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), + Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, ts2.DiagnosticCategory.Error, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), + A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts2.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts2.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, ts2.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: diag(1214, ts2.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."), + Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, ts2.DiagnosticCategory.Error, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, ts2.DiagnosticCategory.Error, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), + Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, ts2.DiagnosticCategory.Error, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), + Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, ts2.DiagnosticCategory.Error, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), + Generators_are_not_allowed_in_an_ambient_context: diag(1221, ts2.DiagnosticCategory.Error, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), + An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, ts2.DiagnosticCategory.Error, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), + _0_tag_already_specified: diag(1223, ts2.DiagnosticCategory.Error, "_0_tag_already_specified_1223", "'{0}' tag already specified."), + Signature_0_must_be_a_type_predicate: diag(1224, ts2.DiagnosticCategory.Error, "Signature_0_must_be_a_type_predicate_1224", "Signature '{0}' must be a type predicate."), + Cannot_find_parameter_0: diag(1225, ts2.DiagnosticCategory.Error, "Cannot_find_parameter_0_1225", "Cannot find parameter '{0}'."), + Type_predicate_0_is_not_assignable_to_1: diag(1226, ts2.DiagnosticCategory.Error, "Type_predicate_0_is_not_assignable_to_1_1226", "Type predicate '{0}' is not assignable to '{1}'."), + Parameter_0_is_not_in_the_same_position_as_parameter_1: diag(1227, ts2.DiagnosticCategory.Error, "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", "Parameter '{0}' is not in the same position as parameter '{1}'."), + A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, ts2.DiagnosticCategory.Error, "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", "A type predicate is only allowed in return type position for functions and methods."), + A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, ts2.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."), + A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, ts2.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."), + An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, ts2.DiagnosticCategory.Error, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."), + An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, ts2.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."), + An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, ts2.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."), + An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts2.DiagnosticCategory.Error, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."), + A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, ts2.DiagnosticCategory.Error, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."), + The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, ts2.DiagnosticCategory.Error, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."), + The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, ts2.DiagnosticCategory.Error, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."), + Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, ts2.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."), + Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: diag(1239, ts2.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239", "Unable to resolve signature of parameter decorator when called as an expression."), + Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: diag(1240, ts2.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240", "Unable to resolve signature of property decorator when called as an expression."), + Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: diag(1241, ts2.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241", "Unable to resolve signature of method decorator when called as an expression."), + abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: diag(1242, ts2.DiagnosticCategory.Error, "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242", "'abstract' modifier can only appear on a class, method, or property declaration."), + _0_modifier_cannot_be_used_with_1_modifier: diag(1243, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_1_modifier_1243", "'{0}' modifier cannot be used with '{1}' modifier."), + Abstract_methods_can_only_appear_within_an_abstract_class: diag(1244, ts2.DiagnosticCategory.Error, "Abstract_methods_can_only_appear_within_an_abstract_class_1244", "Abstract methods can only appear within an abstract class."), + Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: diag(1245, ts2.DiagnosticCategory.Error, "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", "Method '{0}' cannot have an implementation because it is marked abstract."), + An_interface_property_cannot_have_an_initializer: diag(1246, ts2.DiagnosticCategory.Error, "An_interface_property_cannot_have_an_initializer_1246", "An interface property cannot have an initializer."), + A_type_literal_property_cannot_have_an_initializer: diag(1247, ts2.DiagnosticCategory.Error, "A_type_literal_property_cannot_have_an_initializer_1247", "A type literal property cannot have an initializer."), + A_class_member_cannot_have_the_0_keyword: diag(1248, ts2.DiagnosticCategory.Error, "A_class_member_cannot_have_the_0_keyword_1248", "A class member cannot have the '{0}' keyword."), + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: diag(1249, ts2.DiagnosticCategory.Error, "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", "A decorator can only decorate a method implementation, not an overload."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, ts2.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, ts2.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, ts2.DiagnosticCategory.Error, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."), + A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, ts2.DiagnosticCategory.Error, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."), + A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, ts2.DiagnosticCategory.Error, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), + A_required_element_cannot_follow_an_optional_element: diag(1257, ts2.DiagnosticCategory.Error, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1258, ts2.DiagnosticCategory.Error, "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258", "A default export must be at the top level of a file or module declaration."), + Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, ts2.DiagnosticCategory.Error, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), + Keywords_cannot_contain_escape_characters: diag(1260, ts2.DiagnosticCategory.Error, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), + Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, ts2.DiagnosticCategory.Error, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), + Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, ts2.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), + Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, ts2.DiagnosticCategory.Error, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), + Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, ts2.DiagnosticCategory.Error, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), + A_rest_element_cannot_follow_another_rest_element: diag(1265, ts2.DiagnosticCategory.Error, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."), + An_optional_element_cannot_follow_a_rest_element: diag(1266, ts2.DiagnosticCategory.Error, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), + Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts2.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), + An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts2.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), + Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts2.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), + Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts2.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), + A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, ts2.DiagnosticCategory.Error, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), + _0_modifier_cannot_appear_on_a_type_parameter: diag(1273, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"), + _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts2.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"), + accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, ts2.DiagnosticCategory.Error, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), + An_accessor_property_cannot_be_declared_optional: diag(1276, ts2.DiagnosticCategory.Error, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), + with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts2.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), + await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts2.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), + The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts2.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), + Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts2.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), + The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts2.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."), + Global_module_exports_may_only_appear_in_module_files: diag(1314, ts2.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."), + Global_module_exports_may_only_appear_in_declaration_files: diag(1315, ts2.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_declaration_files_1315", "Global module exports may only appear in declaration files."), + Global_module_exports_may_only_appear_at_top_level: diag(1316, ts2.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_at_top_level_1316", "Global module exports may only appear at top level."), + A_parameter_property_cannot_be_declared_using_a_rest_parameter: diag(1317, ts2.DiagnosticCategory.Error, "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", "A parameter property cannot be declared using a rest parameter."), + An_abstract_accessor_cannot_have_an_implementation: diag(1318, ts2.DiagnosticCategory.Error, "An_abstract_accessor_cannot_have_an_implementation_1318", "An abstract accessor cannot have an implementation."), + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: diag(1319, ts2.DiagnosticCategory.Error, "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", "A default export can only be used in an ECMAScript-style module."), + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts2.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts2.DiagnosticCategory.Error, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts2.DiagnosticCategory.Error, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), + Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts2.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."), + Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts2.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."), + Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts2.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), + This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts2.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), + String_literal_with_double_quotes_expected: diag(1327, ts2.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), + Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts2.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), + _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts2.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), + A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: diag(1330, ts2.DiagnosticCategory.Error, "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330", "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."), + A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: diag(1331, ts2.DiagnosticCategory.Error, "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331", "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."), + A_variable_whose_type_is_a_unique_symbol_type_must_be_const: diag(1332, ts2.DiagnosticCategory.Error, "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332", "A variable whose type is a 'unique symbol' type must be 'const'."), + unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts2.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), + unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts2.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), + unique_symbol_types_are_not_allowed_here: diag(1335, ts2.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts2.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts2.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), + Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts2.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), + Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts2.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), + Class_constructor_may_not_be_an_accessor: diag(1341, ts2.DiagnosticCategory.Error, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), + Type_arguments_cannot_be_used_here: diag(1342, ts2.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts2.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), + A_label_is_not_allowed_here: diag(1344, ts2.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts2.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts2.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), + use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, ts2.DiagnosticCategory.Error, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), + Non_simple_parameter_declared_here: diag(1348, ts2.DiagnosticCategory.Error, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), + use_strict_directive_used_here: diag(1349, ts2.DiagnosticCategory.Error, "use_strict_directive_used_here_1349", "'use strict' directive used here."), + Print_the_final_configuration_instead_of_building: diag(1350, ts2.DiagnosticCategory.Message, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), + An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, ts2.DiagnosticCategory.Error, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), + A_bigint_literal_cannot_use_exponential_notation: diag(1352, ts2.DiagnosticCategory.Error, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), + A_bigint_literal_must_be_an_integer: diag(1353, ts2.DiagnosticCategory.Error, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), + readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, ts2.DiagnosticCategory.Error, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."), + A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, ts2.DiagnosticCategory.Error, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."), + Did_you_mean_to_mark_this_function_as_async: diag(1356, ts2.DiagnosticCategory.Error, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"), + An_enum_member_name_must_be_followed_by_a_or: diag(1357, ts2.DiagnosticCategory.Error, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."), + Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, ts2.DiagnosticCategory.Error, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."), + Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, ts2.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."), + Type_0_does_not_satisfy_the_expected_type_1: diag(1360, ts2.DiagnosticCategory.Error, "Type_0_does_not_satisfy_the_expected_type_1_1360", "Type '{0}' does not satisfy the expected type '{1}'."), + _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, ts2.DiagnosticCategory.Error, "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361", "'{0}' cannot be used as a value because it was imported using 'import type'."), + _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: diag(1362, ts2.DiagnosticCategory.Error, "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362", "'{0}' cannot be used as a value because it was exported using 'export type'."), + A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: diag(1363, ts2.DiagnosticCategory.Error, "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363", "A type-only import can specify a default import or named bindings, but not both."), + Convert_to_type_only_export: diag(1364, ts2.DiagnosticCategory.Message, "Convert_to_type_only_export_1364", "Convert to type-only export"), + Convert_all_re_exported_types_to_type_only_exports: diag(1365, ts2.DiagnosticCategory.Message, "Convert_all_re_exported_types_to_type_only_exports_1365", "Convert all re-exported types to type-only exports"), + Split_into_two_separate_import_declarations: diag(1366, ts2.DiagnosticCategory.Message, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"), + Split_all_invalid_type_only_imports: diag(1367, ts2.DiagnosticCategory.Message, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"), + Class_constructor_may_not_be_a_generator: diag(1368, ts2.DiagnosticCategory.Error, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."), + Did_you_mean_0: diag(1369, ts2.DiagnosticCategory.Message, "Did_you_mean_0_1369", "Did you mean '{0}'?"), + This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, ts2.DiagnosticCategory.Error, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."), + Convert_to_type_only_import: diag(1373, ts2.DiagnosticCategory.Message, "Convert_to_type_only_import_1373", "Convert to type-only import"), + Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, ts2.DiagnosticCategory.Message, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"), + await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, ts2.DiagnosticCategory.Error, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), + _0_was_imported_here: diag(1376, ts2.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."), + _0_was_exported_here: diag(1377, ts2.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."), + Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, ts2.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), + An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts2.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."), + An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts2.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), + Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts2.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), + Unexpected_token_Did_you_mean_or_gt: diag(1382, ts2.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), + Only_named_exports_may_use_export_type: diag(1383, ts2.DiagnosticCategory.Error, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), + Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts2.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), + Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts2.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), + Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts2.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), + Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts2.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), + _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts2.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), + _0_is_not_allowed_as_a_parameter_name: diag(1390, ts2.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."), + An_import_alias_cannot_use_import_type: diag(1392, ts2.DiagnosticCategory.Error, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"), + Imported_via_0_from_file_1: diag(1393, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"), + Imported_via_0_from_file_1_with_packageId_2: diag(1394, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"), + Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: diag(1395, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395", "Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"), + Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"), + Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"), + Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, ts2.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"), + File_is_included_via_import_here: diag(1399, ts2.DiagnosticCategory.Message, "File_is_included_via_import_here_1399", "File is included via import here."), + Referenced_via_0_from_file_1: diag(1400, ts2.DiagnosticCategory.Message, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"), + File_is_included_via_reference_here: diag(1401, ts2.DiagnosticCategory.Message, "File_is_included_via_reference_here_1401", "File is included via reference here."), + Type_library_referenced_via_0_from_file_1: diag(1402, ts2.DiagnosticCategory.Message, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"), + Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, ts2.DiagnosticCategory.Message, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"), + File_is_included_via_type_library_reference_here: diag(1404, ts2.DiagnosticCategory.Message, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."), + Library_referenced_via_0_from_file_1: diag(1405, ts2.DiagnosticCategory.Message, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"), + File_is_included_via_library_reference_here: diag(1406, ts2.DiagnosticCategory.Message, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."), + Matched_by_include_pattern_0_in_1: diag(1407, ts2.DiagnosticCategory.Message, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"), + File_is_matched_by_include_pattern_specified_here: diag(1408, ts2.DiagnosticCategory.Message, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."), + Part_of_files_list_in_tsconfig_json: diag(1409, ts2.DiagnosticCategory.Message, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"), + File_is_matched_by_files_list_specified_here: diag(1410, ts2.DiagnosticCategory.Message, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."), + Output_from_referenced_project_0_included_because_1_specified: diag(1411, ts2.DiagnosticCategory.Message, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"), + Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, ts2.DiagnosticCategory.Message, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"), + File_is_output_from_referenced_project_specified_here: diag(1413, ts2.DiagnosticCategory.Message, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."), + Source_from_referenced_project_0_included_because_1_specified: diag(1414, ts2.DiagnosticCategory.Message, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"), + Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, ts2.DiagnosticCategory.Message, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"), + File_is_source_from_referenced_project_specified_here: diag(1416, ts2.DiagnosticCategory.Message, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."), + Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, ts2.DiagnosticCategory.Message, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"), + Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, ts2.DiagnosticCategory.Message, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"), + File_is_entry_point_of_type_library_specified_here: diag(1419, ts2.DiagnosticCategory.Message, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."), + Entry_point_for_implicit_type_library_0: diag(1420, ts2.DiagnosticCategory.Message, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"), + Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, ts2.DiagnosticCategory.Message, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"), + Library_0_specified_in_compilerOptions: diag(1422, ts2.DiagnosticCategory.Message, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"), + File_is_library_specified_here: diag(1423, ts2.DiagnosticCategory.Message, "File_is_library_specified_here_1423", "File is library specified here."), + Default_library: diag(1424, ts2.DiagnosticCategory.Message, "Default_library_1424", "Default library"), + Default_library_for_target_0: diag(1425, ts2.DiagnosticCategory.Message, "Default_library_for_target_0_1425", "Default library for target '{0}'"), + File_is_default_library_for_target_specified_here: diag(1426, ts2.DiagnosticCategory.Message, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."), + Root_file_specified_for_compilation: diag(1427, ts2.DiagnosticCategory.Message, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"), + File_is_output_of_project_reference_source_0: diag(1428, ts2.DiagnosticCategory.Message, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"), + File_redirects_to_file_0: diag(1429, ts2.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"), + The_file_is_in_the_program_because_Colon: diag(1430, ts2.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), + for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, ts2.DiagnosticCategory.Error, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), + Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, ts2.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."), + Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts2.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), + Unexpected_keyword_or_identifier: diag(1434, ts2.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), + Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts2.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), + Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, ts2.DiagnosticCategory.Error, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), + Namespace_must_be_given_a_name: diag(1437, ts2.DiagnosticCategory.Error, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."), + Interface_must_be_given_a_name: diag(1438, ts2.DiagnosticCategory.Error, "Interface_must_be_given_a_name_1438", "Interface must be given a name."), + Type_alias_must_be_given_a_name: diag(1439, ts2.DiagnosticCategory.Error, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."), + Variable_declaration_not_allowed_at_this_location: diag(1440, ts2.DiagnosticCategory.Error, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."), + Cannot_start_a_function_call_in_a_type_annotation: diag(1441, ts2.DiagnosticCategory.Error, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."), + Expected_for_property_initializer: diag(1442, ts2.DiagnosticCategory.Error, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."), + Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, ts2.DiagnosticCategory.Error, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, ts2.DiagnosticCategory.Error, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, ts2.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, ts2.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), + Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts2.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), + Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts2.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), + Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts2.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), + resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts2.DiagnosticCategory.Error, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."), + resolution_mode_should_be_either_require_or_import: diag(1453, ts2.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."), + resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts2.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."), + resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts2.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."), + Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, ts2.DiagnosticCategory.Error, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."), + Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, ts2.DiagnosticCategory.Message, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"), + File_is_ECMAScript_module_because_0_has_field_type_with_value_module: diag(1458, ts2.DiagnosticCategory.Message, "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458", `File is ECMAScript module because '{0}' has field "type" with value "module"`), + File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, ts2.DiagnosticCategory.Message, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`), + File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, ts2.DiagnosticCategory.Message, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`), + File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, ts2.DiagnosticCategory.Message, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"), + The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts2.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."), + Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, ts2.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."), + catch_or_finally_expected: diag(1472, ts2.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."), + An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts2.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."), + An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts2.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."), + Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts2.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."), + auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts2.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", '"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'), + An_instantiation_expression_cannot_be_followed_by_a_property_access: diag(1477, ts2.DiagnosticCategory.Error, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."), + Identifier_or_string_literal_expected: diag(1478, ts2.DiagnosticCategory.Error, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."), + The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead: diag(1479, ts2.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", `The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`), + To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: diag(1480, ts2.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", 'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'), + To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, ts2.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), + To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, ts2.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), + To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, ts2.DiagnosticCategory.Message, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + The_types_of_0_are_incompatible_between_these_types: diag(2200, ts2.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), + The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts2.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), + Call_signature_return_types_0_and_1_are_incompatible: diag( + 2202, + ts2.DiagnosticCategory.Error, + "Call_signature_return_types_0_and_1_are_incompatible_2202", + "Call signature return types '{0}' and '{1}' are incompatible.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Construct_signature_return_types_0_and_1_are_incompatible: diag( + 2203, + ts2.DiagnosticCategory.Error, + "Construct_signature_return_types_0_and_1_are_incompatible_2203", + "Construct signature return types '{0}' and '{1}' are incompatible.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( + 2204, + ts2.DiagnosticCategory.Error, + "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", + "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( + 2205, + ts2.DiagnosticCategory.Error, + "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", + "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts2.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."), + The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts2.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."), + This_type_parameter_might_need_an_extends_0_constraint: diag(2208, ts2.DiagnosticCategory.Error, "This_type_parameter_might_need_an_extends_0_constraint_2208", "This type parameter might need an `extends {0}` constraint."), + The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts2.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), + The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts2.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), + Add_extends_constraint: diag(2211, ts2.DiagnosticCategory.Message, "Add_extends_constraint_2211", "Add `extends` constraint."), + Add_extends_constraint_to_all_type_parameters: diag(2212, ts2.DiagnosticCategory.Message, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"), + Duplicate_identifier_0: diag(2300, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts2.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), + Static_members_cannot_reference_class_type_parameters: diag(2302, ts2.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), + Circular_definition_of_import_alias_0: diag(2303, ts2.DiagnosticCategory.Error, "Circular_definition_of_import_alias_0_2303", "Circular definition of import alias '{0}'."), + Cannot_find_name_0: diag(2304, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), + Module_0_has_no_exported_member_1: diag(2305, ts2.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), + File_0_is_not_a_module: diag(2306, ts2.DiagnosticCategory.Error, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, ts2.DiagnosticCategory.Error, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts2.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts2.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), + Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts2.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), + Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts2.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), + Type_parameter_0_has_a_circular_constraint: diag(2313, ts2.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), + Generic_type_0_requires_1_type_argument_s: diag(2314, ts2.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), + Type_0_is_not_generic: diag(2315, ts2.DiagnosticCategory.Error, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), + Global_type_0_must_be_a_class_or_interface_type: diag(2316, ts2.DiagnosticCategory.Error, "Global_type_0_must_be_a_class_or_interface_type_2316", "Global type '{0}' must be a class or interface type."), + Global_type_0_must_have_1_type_parameter_s: diag(2317, ts2.DiagnosticCategory.Error, "Global_type_0_must_have_1_type_parameter_s_2317", "Global type '{0}' must have {1} type parameter(s)."), + Cannot_find_global_type_0: diag(2318, ts2.DiagnosticCategory.Error, "Cannot_find_global_type_0_2318", "Cannot find global type '{0}'."), + Named_property_0_of_types_1_and_2_are_not_identical: diag(2319, ts2.DiagnosticCategory.Error, "Named_property_0_of_types_1_and_2_are_not_identical_2319", "Named property '{0}' of types '{1}' and '{2}' are not identical."), + Interface_0_cannot_simultaneously_extend_types_1_and_2: diag(2320, ts2.DiagnosticCategory.Error, "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."), + Excessive_stack_depth_comparing_types_0_and_1: diag(2321, ts2.DiagnosticCategory.Error, "Excessive_stack_depth_comparing_types_0_and_1_2321", "Excessive stack depth comparing types '{0}' and '{1}'."), + Type_0_is_not_assignable_to_type_1: diag(2322, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_2322", "Type '{0}' is not assignable to type '{1}'."), + Cannot_redeclare_exported_variable_0: diag(2323, ts2.DiagnosticCategory.Error, "Cannot_redeclare_exported_variable_0_2323", "Cannot redeclare exported variable '{0}'."), + Property_0_is_missing_in_type_1: diag(2324, ts2.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_2324", "Property '{0}' is missing in type '{1}'."), + Property_0_is_private_in_type_1_but_not_in_type_2: diag(2325, ts2.DiagnosticCategory.Error, "Property_0_is_private_in_type_1_but_not_in_type_2_2325", "Property '{0}' is private in type '{1}' but not in type '{2}'."), + Types_of_property_0_are_incompatible: diag(2326, ts2.DiagnosticCategory.Error, "Types_of_property_0_are_incompatible_2326", "Types of property '{0}' are incompatible."), + Property_0_is_optional_in_type_1_but_required_in_type_2: diag(2327, ts2.DiagnosticCategory.Error, "Property_0_is_optional_in_type_1_but_required_in_type_2_2327", "Property '{0}' is optional in type '{1}' but required in type '{2}'."), + Types_of_parameters_0_and_1_are_incompatible: diag(2328, ts2.DiagnosticCategory.Error, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."), + Index_signature_for_type_0_is_missing_in_type_1: diag(2329, ts2.DiagnosticCategory.Error, "Index_signature_for_type_0_is_missing_in_type_1_2329", "Index signature for type '{0}' is missing in type '{1}'."), + _0_and_1_index_signatures_are_incompatible: diag(2330, ts2.DiagnosticCategory.Error, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."), + this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, ts2.DiagnosticCategory.Error, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."), + this_cannot_be_referenced_in_current_location: diag(2332, ts2.DiagnosticCategory.Error, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."), + this_cannot_be_referenced_in_constructor_arguments: diag(2333, ts2.DiagnosticCategory.Error, "this_cannot_be_referenced_in_constructor_arguments_2333", "'this' cannot be referenced in constructor arguments."), + this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, ts2.DiagnosticCategory.Error, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."), + super_can_only_be_referenced_in_a_derived_class: diag(2335, ts2.DiagnosticCategory.Error, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."), + super_cannot_be_referenced_in_constructor_arguments: diag(2336, ts2.DiagnosticCategory.Error, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."), + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: diag(2337, ts2.DiagnosticCategory.Error, "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337", "Super calls are not permitted outside constructors or in nested functions inside constructors."), + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: diag(2338, ts2.DiagnosticCategory.Error, "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338", "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."), + Property_0_does_not_exist_on_type_1: diag(2339, ts2.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_2339", "Property '{0}' does not exist on type '{1}'."), + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: diag(2340, ts2.DiagnosticCategory.Error, "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", "Only public and protected methods of the base class are accessible via the 'super' keyword."), + Property_0_is_private_and_only_accessible_within_class_1: diag(2341, ts2.DiagnosticCategory.Error, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."), + This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, ts2.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), + Type_0_does_not_satisfy_the_constraint_1: diag(2344, ts2.DiagnosticCategory.Error, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, ts2.DiagnosticCategory.Error, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), + Call_target_does_not_contain_any_signatures: diag(2346, ts2.DiagnosticCategory.Error, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."), + Untyped_function_calls_may_not_accept_type_arguments: diag(2347, ts2.DiagnosticCategory.Error, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, ts2.DiagnosticCategory.Error, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), + This_expression_is_not_callable: diag(2349, ts2.DiagnosticCategory.Error, "This_expression_is_not_callable_2349", "This expression is not callable."), + Only_a_void_function_can_be_called_with_the_new_keyword: diag(2350, ts2.DiagnosticCategory.Error, "Only_a_void_function_can_be_called_with_the_new_keyword_2350", "Only a void function can be called with the 'new' keyword."), + This_expression_is_not_constructable: diag(2351, ts2.DiagnosticCategory.Error, "This_expression_is_not_constructable_2351", "This expression is not constructable."), + Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: diag(2352, ts2.DiagnosticCategory.Error, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."), + Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, ts2.DiagnosticCategory.Error, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."), + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, ts2.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."), + A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, ts2.DiagnosticCategory.Error, "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'void' nor 'any' must return a value."), + An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, ts2.DiagnosticCategory.Error, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."), + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts2.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."), + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."), + The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts2.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."), + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts2.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), + The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."), + Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, ts2.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."), + Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, ts2.DiagnosticCategory.Error, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."), + This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap: diag(2367, ts2.DiagnosticCategory.Error, "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367", "This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."), + Type_parameter_name_cannot_be_0: diag(2368, ts2.DiagnosticCategory.Error, "Type_parameter_name_cannot_be_0_2368", "Type parameter name cannot be '{0}'."), + A_parameter_property_is_only_allowed_in_a_constructor_implementation: diag(2369, ts2.DiagnosticCategory.Error, "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", "A parameter property is only allowed in a constructor implementation."), + A_rest_parameter_must_be_of_an_array_type: diag(2370, ts2.DiagnosticCategory.Error, "A_rest_parameter_must_be_of_an_array_type_2370", "A rest parameter must be of an array type."), + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, ts2.DiagnosticCategory.Error, "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", "A parameter initializer is only allowed in a function or constructor implementation."), + Parameter_0_cannot_reference_itself: diag(2372, ts2.DiagnosticCategory.Error, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."), + Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, ts2.DiagnosticCategory.Error, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."), + Duplicate_index_signature_for_type_0: diag(2374, ts2.DiagnosticCategory.Error, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."), + Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), + A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts2.DiagnosticCategory.Error, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."), + Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, ts2.DiagnosticCategory.Error, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."), + A_get_accessor_must_return_a_value: diag(2378, ts2.DiagnosticCategory.Error, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."), + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, ts2.DiagnosticCategory.Error, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), + The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type: diag(2380, ts2.DiagnosticCategory.Error, "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380", "The return type of a 'get' accessor must be assignable to its 'set' accessor type"), + Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, ts2.DiagnosticCategory.Error, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."), + Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, ts2.DiagnosticCategory.Error, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."), + Overload_signatures_must_all_be_public_private_or_protected: diag(2385, ts2.DiagnosticCategory.Error, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."), + Overload_signatures_must_all_be_optional_or_required: diag(2386, ts2.DiagnosticCategory.Error, "Overload_signatures_must_all_be_optional_or_required_2386", "Overload signatures must all be optional or required."), + Function_overload_must_be_static: diag(2387, ts2.DiagnosticCategory.Error, "Function_overload_must_be_static_2387", "Function overload must be static."), + Function_overload_must_not_be_static: diag(2388, ts2.DiagnosticCategory.Error, "Function_overload_must_not_be_static_2388", "Function overload must not be static."), + Function_implementation_name_must_be_0: diag(2389, ts2.DiagnosticCategory.Error, "Function_implementation_name_must_be_0_2389", "Function implementation name must be '{0}'."), + Constructor_implementation_is_missing: diag(2390, ts2.DiagnosticCategory.Error, "Constructor_implementation_is_missing_2390", "Constructor implementation is missing."), + Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, ts2.DiagnosticCategory.Error, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."), + Multiple_constructor_implementations_are_not_allowed: diag(2392, ts2.DiagnosticCategory.Error, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."), + Duplicate_function_implementation: diag(2393, ts2.DiagnosticCategory.Error, "Duplicate_function_implementation_2393", "Duplicate function implementation."), + This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, ts2.DiagnosticCategory.Error, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."), + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, ts2.DiagnosticCategory.Error, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."), + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, ts2.DiagnosticCategory.Error, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."), + Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, ts2.DiagnosticCategory.Error, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."), + constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, ts2.DiagnosticCategory.Error, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."), + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, ts2.DiagnosticCategory.Error, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."), + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, ts2.DiagnosticCategory.Error, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."), + A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2401, ts2.DiagnosticCategory.Error, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."), + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, ts2.DiagnosticCategory.Error, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."), + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, ts2.DiagnosticCategory.Error, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."), + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."), + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: diag(2405, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405", "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."), + The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: diag(2406, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", "The left-hand side of a 'for...in' statement must be a variable or a property access."), + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: diag(2407, ts2.DiagnosticCategory.Error, "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407", "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."), + Setters_cannot_return_a_value: diag(2408, ts2.DiagnosticCategory.Error, "Setters_cannot_return_a_value_2408", "Setters cannot return a value."), + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: diag(2409, ts2.DiagnosticCategory.Error, "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", "Return type of constructor signature must be assignable to the instance type of the class."), + The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: diag(2410, ts2.DiagnosticCategory.Error, "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."), + Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: diag(2412, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."), + Property_0_of_type_1_is_not_assignable_to_2_index_type_3: diag(2411, ts2.DiagnosticCategory.Error, "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411", "Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."), + _0_index_type_1_is_not_assignable_to_2_index_type_3: diag(2413, ts2.DiagnosticCategory.Error, "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413", "'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."), + Class_name_cannot_be_0: diag(2414, ts2.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), + Class_0_incorrectly_extends_base_class_1: diag(2415, ts2.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts2.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), + Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts2.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), + Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, ts2.DiagnosticCategory.Error, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), + Types_of_construct_signatures_are_incompatible: diag(2419, ts2.DiagnosticCategory.Error, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), + Class_0_incorrectly_implements_interface_1: diag(2420, ts2.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, ts2.DiagnosticCategory.Error, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, ts2.DiagnosticCategory.Error, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, ts2.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2426, ts2.DiagnosticCategory.Error, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."), + Interface_name_cannot_be_0: diag(2427, ts2.DiagnosticCategory.Error, "Interface_name_cannot_be_0_2427", "Interface name cannot be '{0}'."), + All_declarations_of_0_must_have_identical_type_parameters: diag(2428, ts2.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_type_parameters_2428", "All declarations of '{0}' must have identical type parameters."), + Interface_0_incorrectly_extends_interface_1: diag(2430, ts2.DiagnosticCategory.Error, "Interface_0_incorrectly_extends_interface_1_2430", "Interface '{0}' incorrectly extends interface '{1}'."), + Enum_name_cannot_be_0: diag(2431, ts2.DiagnosticCategory.Error, "Enum_name_cannot_be_0_2431", "Enum name cannot be '{0}'."), + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: diag(2432, ts2.DiagnosticCategory.Error, "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."), + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: diag(2433, ts2.DiagnosticCategory.Error, "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", "A namespace declaration cannot be in a different file from a class or function with which it is merged."), + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: diag(2434, ts2.DiagnosticCategory.Error, "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", "A namespace declaration cannot be located prior to a class or function with which it is merged."), + Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: diag(2435, ts2.DiagnosticCategory.Error, "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", "Ambient modules cannot be nested in other modules or namespaces."), + Ambient_module_declaration_cannot_specify_relative_module_name: diag(2436, ts2.DiagnosticCategory.Error, "Ambient_module_declaration_cannot_specify_relative_module_name_2436", "Ambient module declaration cannot specify relative module name."), + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: diag(2437, ts2.DiagnosticCategory.Error, "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", "Module '{0}' is hidden by a local declaration with the same name."), + Import_name_cannot_be_0: diag(2438, ts2.DiagnosticCategory.Error, "Import_name_cannot_be_0_2438", "Import name cannot be '{0}'."), + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: diag(2439, ts2.DiagnosticCategory.Error, "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", "Import or export declaration in an ambient module declaration cannot reference module through relative module name."), + Import_declaration_conflicts_with_local_declaration_of_0: diag(2440, ts2.DiagnosticCategory.Error, "Import_declaration_conflicts_with_local_declaration_of_0_2440", "Import declaration conflicts with local declaration of '{0}'."), + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: diag(2441, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."), + Types_have_separate_declarations_of_a_private_property_0: diag(2442, ts2.DiagnosticCategory.Error, "Types_have_separate_declarations_of_a_private_property_0_2442", "Types have separate declarations of a private property '{0}'."), + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, ts2.DiagnosticCategory.Error, "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."), + Property_0_is_protected_in_type_1_but_public_in_type_2: diag(2444, ts2.DiagnosticCategory.Error, "Property_0_is_protected_in_type_1_but_public_in_type_2_2444", "Property '{0}' is protected in type '{1}' but public in type '{2}'."), + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: diag(2445, ts2.DiagnosticCategory.Error, "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."), + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: diag(2446, ts2.DiagnosticCategory.Error, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."), + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: diag(2447, ts2.DiagnosticCategory.Error, "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."), + Block_scoped_variable_0_used_before_its_declaration: diag(2448, ts2.DiagnosticCategory.Error, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."), + Class_0_used_before_its_declaration: diag(2449, ts2.DiagnosticCategory.Error, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."), + Enum_0_used_before_its_declaration: diag(2450, ts2.DiagnosticCategory.Error, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."), + Cannot_redeclare_block_scoped_variable_0: diag(2451, ts2.DiagnosticCategory.Error, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."), + An_enum_member_cannot_have_a_numeric_name: diag(2452, ts2.DiagnosticCategory.Error, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."), + Variable_0_is_used_before_being_assigned: diag(2454, ts2.DiagnosticCategory.Error, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."), + Type_alias_0_circularly_references_itself: diag(2456, ts2.DiagnosticCategory.Error, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), + Type_alias_name_cannot_be_0: diag(2457, ts2.DiagnosticCategory.Error, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), + An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, ts2.DiagnosticCategory.Error, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), + Module_0_declares_1_locally_but_it_is_not_exported: diag(2459, ts2.DiagnosticCategory.Error, "Module_0_declares_1_locally_but_it_is_not_exported_2459", "Module '{0}' declares '{1}' locally, but it is not exported."), + Module_0_declares_1_locally_but_it_is_exported_as_2: diag(2460, ts2.DiagnosticCategory.Error, "Module_0_declares_1_locally_but_it_is_exported_as_2_2460", "Module '{0}' declares '{1}' locally, but it is exported as '{2}'."), + Type_0_is_not_an_array_type: diag(2461, ts2.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), + A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, ts2.DiagnosticCategory.Error, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, ts2.DiagnosticCategory.Error, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: diag(2464, ts2.DiagnosticCategory.Error, "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", "A computed property name must be of type 'string', 'number', 'symbol', or 'any'."), + this_cannot_be_referenced_in_a_computed_property_name: diag(2465, ts2.DiagnosticCategory.Error, "this_cannot_be_referenced_in_a_computed_property_name_2465", "'this' cannot be referenced in a computed property name."), + super_cannot_be_referenced_in_a_computed_property_name: diag(2466, ts2.DiagnosticCategory.Error, "super_cannot_be_referenced_in_a_computed_property_name_2466", "'super' cannot be referenced in a computed property name."), + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, ts2.DiagnosticCategory.Error, "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467", "A computed property name cannot reference a type parameter from its containing type."), + Cannot_find_global_value_0: diag(2468, ts2.DiagnosticCategory.Error, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."), + The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, ts2.DiagnosticCategory.Error, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."), + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts2.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), + Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts2.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), + const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, ts2.DiagnosticCategory.Error, "const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474", "const enum member initializers can only contain literal values and other computed enum values."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts2.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), + A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts2.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts2.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts2.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, ts2.DiagnosticCategory.Error, "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", "'let' is not allowed to be used as a name in 'let' or 'const' declarations."), + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: diag(2481, ts2.DiagnosticCategory.Error, "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."), + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: diag(2483, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", "The left-hand side of a 'for...of' statement cannot use a type annotation."), + Export_declaration_conflicts_with_exported_declaration_of_0: diag(2484, ts2.DiagnosticCategory.Error, "Export_declaration_conflicts_with_exported_declaration_of_0_2484", "Export declaration conflicts with exported declaration of '{0}'."), + The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: diag(2487, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", "The left-hand side of a 'for...of' statement must be a variable or a property access."), + Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2488, ts2.DiagnosticCategory.Error, "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."), + An_iterator_must_have_a_next_method: diag(2489, ts2.DiagnosticCategory.Error, "An_iterator_must_have_a_next_method_2489", "An iterator must have a 'next()' method."), + The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: diag(2490, ts2.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the '{0}()' method of an iterator must have a 'value' property."), + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), + Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, ts2.DiagnosticCategory.Error, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), + Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, ts2.DiagnosticCategory.Error, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, ts2.DiagnosticCategory.Error, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), + Type_0_is_not_an_array_type_or_a_string_type: diag(2495, ts2.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, ts2.DiagnosticCategory.Error, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496", "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."), + This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, ts2.DiagnosticCategory.Error, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, ts2.DiagnosticCategory.Error, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), + An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, ts2.DiagnosticCategory.Error, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), + A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, ts2.DiagnosticCategory.Error, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), + A_rest_element_cannot_contain_a_binding_pattern: diag(2501, ts2.DiagnosticCategory.Error, "A_rest_element_cannot_contain_a_binding_pattern_2501", "A rest element cannot contain a binding pattern."), + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: diag(2502, ts2.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", "'{0}' is referenced directly or indirectly in its own type annotation."), + Cannot_find_namespace_0: diag(2503, ts2.DiagnosticCategory.Error, "Cannot_find_namespace_0_2503", "Cannot find namespace '{0}'."), + Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: diag(2504, ts2.DiagnosticCategory.Error, "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."), + A_generator_cannot_have_a_void_type_annotation: diag(2505, ts2.DiagnosticCategory.Error, "A_generator_cannot_have_a_void_type_annotation_2505", "A generator cannot have a 'void' type annotation."), + _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, ts2.DiagnosticCategory.Error, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), + Type_0_is_not_a_constructor_function_type: diag(2507, ts2.DiagnosticCategory.Error, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), + No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, ts2.DiagnosticCategory.Error, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, ts2.DiagnosticCategory.Error, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), + Base_constructors_must_all_have_the_same_return_type: diag(2510, ts2.DiagnosticCategory.Error, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), + Cannot_create_an_instance_of_an_abstract_class: diag(2511, ts2.DiagnosticCategory.Error, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), + Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, ts2.DiagnosticCategory.Error, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), + Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, ts2.DiagnosticCategory.Error, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."), + A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, ts2.DiagnosticCategory.Error, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."), + Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, ts2.DiagnosticCategory.Error, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."), + All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, ts2.DiagnosticCategory.Error, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."), + Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, ts2.DiagnosticCategory.Error, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."), + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, ts2.DiagnosticCategory.Error, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."), + An_async_iterator_must_have_a_next_method: diag(2519, ts2.DiagnosticCategory.Error, "An_async_iterator_must_have_a_next_method_2519", "An async iterator must have a 'next()' method."), + Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: diag(2520, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."), + The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: diag(2522, ts2.DiagnosticCategory.Error, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."), + yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, ts2.DiagnosticCategory.Error, "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523", "'yield' expressions cannot be used in a parameter initializer."), + await_expressions_cannot_be_used_in_a_parameter_initializer: diag(2524, ts2.DiagnosticCategory.Error, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."), + Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: diag(2525, ts2.DiagnosticCategory.Error, "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525", "Initializer provides no value for this binding element and the binding element has no default value."), + A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: diag(2526, ts2.DiagnosticCategory.Error, "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", "A 'this' type is available only in a non-static member of a class or interface."), + The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: diag(2527, ts2.DiagnosticCategory.Error, "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527", "The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."), + A_module_cannot_have_multiple_default_exports: diag(2528, ts2.DiagnosticCategory.Error, "A_module_cannot_have_multiple_default_exports_2528", "A module cannot have multiple default exports."), + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: diag(2529, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."), + Property_0_is_incompatible_with_index_signature: diag(2530, ts2.DiagnosticCategory.Error, "Property_0_is_incompatible_with_index_signature_2530", "Property '{0}' is incompatible with index signature."), + Object_is_possibly_null: diag(2531, ts2.DiagnosticCategory.Error, "Object_is_possibly_null_2531", "Object is possibly 'null'."), + Object_is_possibly_undefined: diag(2532, ts2.DiagnosticCategory.Error, "Object_is_possibly_undefined_2532", "Object is possibly 'undefined'."), + Object_is_possibly_null_or_undefined: diag(2533, ts2.DiagnosticCategory.Error, "Object_is_possibly_null_or_undefined_2533", "Object is possibly 'null' or 'undefined'."), + A_function_returning_never_cannot_have_a_reachable_end_point: diag(2534, ts2.DiagnosticCategory.Error, "A_function_returning_never_cannot_have_a_reachable_end_point_2534", "A function returning 'never' cannot have a reachable end point."), + Enum_type_0_has_members_with_initializers_that_are_not_literals: diag(2535, ts2.DiagnosticCategory.Error, "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535", "Enum type '{0}' has members with initializers that are not literals."), + Type_0_cannot_be_used_to_index_type_1: diag(2536, ts2.DiagnosticCategory.Error, "Type_0_cannot_be_used_to_index_type_1_2536", "Type '{0}' cannot be used to index type '{1}'."), + Type_0_has_no_matching_index_signature_for_type_1: diag(2537, ts2.DiagnosticCategory.Error, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), + Type_0_cannot_be_used_as_an_index_type: diag(2538, ts2.DiagnosticCategory.Error, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), + Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), + Index_signature_in_type_0_only_permits_reading: diag(2542, ts2.DiagnosticCategory.Error, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, ts2.DiagnosticCategory.Error, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: diag(2544, ts2.DiagnosticCategory.Error, "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."), + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: diag(2545, ts2.DiagnosticCategory.Error, "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", "A mixin class must have a constructor with a single rest parameter of type 'any[]'."), + The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, ts2.DiagnosticCategory.Error, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, ts2.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, ts2.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), + Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, ts2.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."), + Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, ts2.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), + Cannot_find_name_0_Did_you_mean_1: diag(2552, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), + Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, ts2.DiagnosticCategory.Error, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), + Expected_0_arguments_but_got_1: diag(2554, ts2.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."), + Expected_at_least_0_arguments_but_got_1: diag(2555, ts2.DiagnosticCategory.Error, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."), + A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: diag(2556, ts2.DiagnosticCategory.Error, "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556", "A spread argument must either have a tuple type or be passed to a rest parameter."), + Expected_0_type_arguments_but_got_1: diag(2558, ts2.DiagnosticCategory.Error, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), + Type_0_has_no_properties_in_common_with_type_1: diag(2559, ts2.DiagnosticCategory.Error, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, ts2.DiagnosticCategory.Error, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: diag(2561, ts2.DiagnosticCategory.Error, "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561", "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2562, ts2.DiagnosticCategory.Error, "Base_class_expressions_cannot_reference_class_type_parameters_2562", "Base class expressions cannot reference class type parameters."), + The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts2.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), + Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts2.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), + Property_0_is_used_before_being_assigned: diag(2565, ts2.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts2.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts2.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), + Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, ts2.DiagnosticCategory.Error, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"), + Could_not_find_name_0_Did_you_mean_1: diag(2570, ts2.DiagnosticCategory.Error, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"), + Object_is_of_type_unknown: diag(2571, ts2.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), + A_rest_element_type_must_be_an_array_type: diag(2574, ts2.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), + No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, ts2.DiagnosticCategory.Error, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), + Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: diag(2576, ts2.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576", "Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"), + Return_type_annotation_circularly_references_itself: diag(2577, ts2.DiagnosticCategory.Error, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, ts2.DiagnosticCategory.Error, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, ts2.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), + Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, ts2.DiagnosticCategory.Error, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), + Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, ts2.DiagnosticCategory.Error, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."), + This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, ts2.DiagnosticCategory.Error, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."), + _0_can_only_be_imported_by_using_a_default_import: diag(2595, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), + _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), + _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."), + _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2598, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598", "'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."), + JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts2.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), + Property_0_in_type_1_is_not_assignable_to_type_2: diag(2603, ts2.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_type_2_2603", "Property '{0}' in type '{1}' is not assignable to type '{2}'."), + JSX_element_type_0_does_not_have_any_construct_or_call_signatures: diag(2604, ts2.DiagnosticCategory.Error, "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", "JSX element type '{0}' does not have any construct or call signatures."), + Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, ts2.DiagnosticCategory.Error, "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", "Property '{0}' of JSX spread attribute is not assignable to target property."), + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: diag(2607, ts2.DiagnosticCategory.Error, "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", "JSX element class does not support attributes because it does not have a '{0}' property."), + The_global_type_JSX_0_may_not_have_more_than_one_property: diag(2608, ts2.DiagnosticCategory.Error, "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", "The global type 'JSX.{0}' may not have more than one property."), + JSX_spread_child_must_be_an_array_type: diag(2609, ts2.DiagnosticCategory.Error, "JSX_spread_child_must_be_an_array_type_2609", "JSX spread child must be an array type."), + _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: diag(2610, ts2.DiagnosticCategory.Error, "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610", "'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."), + _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: diag(2611, ts2.DiagnosticCategory.Error, "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611", "'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."), + Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts2.DiagnosticCategory.Error, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."), + Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts2.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"), + Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts2.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"), + Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, ts2.DiagnosticCategory.Error, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."), + _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: diag(2616, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616", "'{0}' can only be imported by using 'import {1} = require({2})' or a default import."), + _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2617, ts2.DiagnosticCategory.Error, "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617", "'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."), + Source_has_0_element_s_but_target_requires_1: diag(2618, ts2.DiagnosticCategory.Error, "Source_has_0_element_s_but_target_requires_1_2618", "Source has {0} element(s) but target requires {1}."), + Source_has_0_element_s_but_target_allows_only_1: diag(2619, ts2.DiagnosticCategory.Error, "Source_has_0_element_s_but_target_allows_only_1_2619", "Source has {0} element(s) but target allows only {1}."), + Target_requires_0_element_s_but_source_may_have_fewer: diag(2620, ts2.DiagnosticCategory.Error, "Target_requires_0_element_s_but_source_may_have_fewer_2620", "Target requires {0} element(s) but source may have fewer."), + Target_allows_only_0_element_s_but_source_may_have_more: diag(2621, ts2.DiagnosticCategory.Error, "Target_allows_only_0_element_s_but_source_may_have_more_2621", "Target allows only {0} element(s) but source may have more."), + Source_provides_no_match_for_required_element_at_position_0_in_target: diag(2623, ts2.DiagnosticCategory.Error, "Source_provides_no_match_for_required_element_at_position_0_in_target_2623", "Source provides no match for required element at position {0} in target."), + Source_provides_no_match_for_variadic_element_at_position_0_in_target: diag(2624, ts2.DiagnosticCategory.Error, "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624", "Source provides no match for variadic element at position {0} in target."), + Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, ts2.DiagnosticCategory.Error, "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625", "Variadic element at position {0} in source does not match element at position {1} in target."), + Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: diag(2626, ts2.DiagnosticCategory.Error, "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626", "Type at position {0} in source is not compatible with type at position {1} in target."), + Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: diag(2627, ts2.DiagnosticCategory.Error, "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627", "Type at positions {0} through {1} in source is not compatible with type at position {2} in target."), + Cannot_assign_to_0_because_it_is_an_enum: diag(2628, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_enum_2628", "Cannot assign to '{0}' because it is an enum."), + Cannot_assign_to_0_because_it_is_a_class: diag(2629, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_class_2629", "Cannot assign to '{0}' because it is a class."), + Cannot_assign_to_0_because_it_is_a_function: diag(2630, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_function_2630", "Cannot assign to '{0}' because it is a function."), + Cannot_assign_to_0_because_it_is_a_namespace: diag(2631, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_a_namespace_2631", "Cannot assign to '{0}' because it is a namespace."), + Cannot_assign_to_0_because_it_is_an_import: diag(2632, ts2.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."), + JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, ts2.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"), + _0_index_signatures_are_incompatible: diag(2634, ts2.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."), + Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts2.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."), + Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."), + Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, ts2.DiagnosticCategory.Error, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."), + Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, ts2.DiagnosticCategory.Error, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."), + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts2.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."), + A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts2.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."), + Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts2.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."), + Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, ts2.DiagnosticCategory.Error, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."), + JSX_expressions_must_have_one_parent_element: diag(2657, ts2.DiagnosticCategory.Error, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."), + Type_0_provides_no_match_for_the_signature_1: diag(2658, ts2.DiagnosticCategory.Error, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."), + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, ts2.DiagnosticCategory.Error, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."), + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: diag(2660, ts2.DiagnosticCategory.Error, "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", "'super' can only be referenced in members of derived classes or object literal expressions."), + Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: diag(2661, ts2.DiagnosticCategory.Error, "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", "Cannot export '{0}'. Only local declarations can be exported from a module."), + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: diag(2662, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"), + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: diag(2663, ts2.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"), + Invalid_module_name_in_augmentation_module_0_cannot_be_found: diag(2664, ts2.DiagnosticCategory.Error, "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", "Invalid module name in augmentation, module '{0}' cannot be found."), + Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: diag(2665, ts2.DiagnosticCategory.Error, "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665", "Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."), + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: diag(2666, ts2.DiagnosticCategory.Error, "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", "Exports and export assignments are not permitted in module augmentations."), + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: diag(2667, ts2.DiagnosticCategory.Error, "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."), + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: diag(2668, ts2.DiagnosticCategory.Error, "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."), + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: diag(2669, ts2.DiagnosticCategory.Error, "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."), + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: diag(2670, ts2.DiagnosticCategory.Error, "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."), + Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: diag(2671, ts2.DiagnosticCategory.Error, "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671", "Cannot augment module '{0}' because it resolves to a non-module entity."), + Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: diag(2672, ts2.DiagnosticCategory.Error, "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672", "Cannot assign a '{0}' constructor type to a '{1}' constructor type."), + Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: diag(2673, ts2.DiagnosticCategory.Error, "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673", "Constructor of class '{0}' is private and only accessible within the class declaration."), + Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: diag(2674, ts2.DiagnosticCategory.Error, "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674", "Constructor of class '{0}' is protected and only accessible within the class declaration."), + Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: diag(2675, ts2.DiagnosticCategory.Error, "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675", "Cannot extend a class '{0}'. Class constructor is marked as private."), + Accessors_must_both_be_abstract_or_non_abstract: diag(2676, ts2.DiagnosticCategory.Error, "Accessors_must_both_be_abstract_or_non_abstract_2676", "Accessors must both be abstract or non-abstract."), + A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: diag(2677, ts2.DiagnosticCategory.Error, "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677", "A type predicate's type must be assignable to its parameter's type."), + Type_0_is_not_comparable_to_type_1: diag(2678, ts2.DiagnosticCategory.Error, "Type_0_is_not_comparable_to_type_1_2678", "Type '{0}' is not comparable to type '{1}'."), + A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, ts2.DiagnosticCategory.Error, "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679", "A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."), + A_0_parameter_must_be_the_first_parameter: diag(2680, ts2.DiagnosticCategory.Error, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."), + A_constructor_cannot_have_a_this_parameter: diag(2681, ts2.DiagnosticCategory.Error, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."), + this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, ts2.DiagnosticCategory.Error, "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", "'this' implicitly has type 'any' because it does not have a type annotation."), + The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: diag(2684, ts2.DiagnosticCategory.Error, "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."), + The_this_types_of_each_signature_are_incompatible: diag(2685, ts2.DiagnosticCategory.Error, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."), + _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: diag(2686, ts2.DiagnosticCategory.Error, "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686", "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."), + All_declarations_of_0_must_have_identical_modifiers: diag(2687, ts2.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), + Cannot_find_type_definition_file_for_0: diag(2688, ts2.DiagnosticCategory.Error, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), + Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, ts2.DiagnosticCategory.Error, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, ts2.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), + An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, ts2.DiagnosticCategory.Error, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), + _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, ts2.DiagnosticCategory.Error, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, ts2.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), + Namespace_0_has_no_exported_member_1: diag(2694, ts2.DiagnosticCategory.Error, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), + Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag( + 2695, + ts2.DiagnosticCategory.Error, + "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", + "Left side of comma operator is unused and has no side effects.", + /*reportsUnnecessary*/ + true + ), + The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, ts2.DiagnosticCategory.Error, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"), + An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, ts2.DiagnosticCategory.Error, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), + Spread_types_may_only_be_created_from_object_types: diag(2698, ts2.DiagnosticCategory.Error, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."), + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, ts2.DiagnosticCategory.Error, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."), + Rest_types_may_only_be_created_from_object_types: diag(2700, ts2.DiagnosticCategory.Error, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."), + The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, ts2.DiagnosticCategory.Error, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."), + _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, ts2.DiagnosticCategory.Error, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."), + The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, ts2.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."), + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, ts2.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."), + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, ts2.DiagnosticCategory.Error, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), + Required_type_parameters_may_not_follow_optional_type_parameters: diag(2706, ts2.DiagnosticCategory.Error, "Required_type_parameters_may_not_follow_optional_type_parameters_2706", "Required type parameters may not follow optional type parameters."), + Generic_type_0_requires_between_1_and_2_type_arguments: diag(2707, ts2.DiagnosticCategory.Error, "Generic_type_0_requires_between_1_and_2_type_arguments_2707", "Generic type '{0}' requires between {1} and {2} type arguments."), + Cannot_use_namespace_0_as_a_value: diag(2708, ts2.DiagnosticCategory.Error, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."), + Cannot_use_namespace_0_as_a_type: diag(2709, ts2.DiagnosticCategory.Error, "Cannot_use_namespace_0_as_a_type_2709", "Cannot use namespace '{0}' as a type."), + _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: diag(2710, ts2.DiagnosticCategory.Error, "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", "'{0}' are specified twice. The attribute named '{0}' will be overwritten."), + A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, ts2.DiagnosticCategory.Error, "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711", "A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), + A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, ts2.DiagnosticCategory.Error, "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712", "A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), + Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: diag(2713, ts2.DiagnosticCategory.Error, "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713", `Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`), + The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: diag(2714, ts2.DiagnosticCategory.Error, "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714", "The expression of an export assignment must be an identifier or qualified name in an ambient context."), + Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, ts2.DiagnosticCategory.Error, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), + Type_parameter_0_has_a_circular_default: diag(2716, ts2.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), + Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts2.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), + Duplicate_property_0: diag(2718, ts2.DiagnosticCategory.Error, "Duplicate_property_0_2718", "Duplicate property '{0}'."), + Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts2.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts2.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts2.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts2.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), + _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, ts2.DiagnosticCategory.Error, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts2.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), + Cannot_find_lib_definition_for_0: diag(2726, ts2.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), + Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts2.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), + _0_is_declared_here: diag(2728, ts2.DiagnosticCategory.Message, "_0_is_declared_here_2728", "'{0}' is declared here."), + Property_0_is_used_before_its_initialization: diag(2729, ts2.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), + An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts2.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), + Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts2.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts2.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Property_0_was_also_declared_here: diag(2733, ts2.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), + Are_you_missing_a_semicolon: diag(2734, ts2.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), + Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts2.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), + Operator_0_cannot_be_applied_to_type_1: diag(2736, ts2.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), + BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: diag(2737, ts2.DiagnosticCategory.Error, "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737", "BigInt literals are not available when targeting lower than ES2020."), + An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, ts2.DiagnosticCategory.Message, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."), + Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, ts2.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), + Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, ts2.DiagnosticCategory.Error, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), + Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, ts2.DiagnosticCategory.Error, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, ts2.DiagnosticCategory.Error, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), + No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, ts2.DiagnosticCategory.Error, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), + Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, ts2.DiagnosticCategory.Error, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), + This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, ts2.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), + This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, ts2.DiagnosticCategory.Error, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), + _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, ts2.DiagnosticCategory.Error, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), + Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, ts2.DiagnosticCategory.Error, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, ts2.DiagnosticCategory.Error, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), + The_implementation_signature_is_declared_here: diag(2750, ts2.DiagnosticCategory.Error, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), + Circularity_originates_in_type_at_this_location: diag(2751, ts2.DiagnosticCategory.Error, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), + The_first_export_default_is_here: diag(2752, ts2.DiagnosticCategory.Error, "The_first_export_default_is_here_2752", "The first export default is here."), + Another_export_default_is_here: diag(2753, ts2.DiagnosticCategory.Error, "Another_export_default_is_here_2753", "Another export default is here."), + super_may_not_use_type_arguments: diag(2754, ts2.DiagnosticCategory.Error, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."), + No_constituent_of_type_0_is_callable: diag(2755, ts2.DiagnosticCategory.Error, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."), + Not_all_constituents_of_type_0_are_callable: diag(2756, ts2.DiagnosticCategory.Error, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."), + Type_0_has_no_call_signatures: diag(2757, ts2.DiagnosticCategory.Error, "Type_0_has_no_call_signatures_2757", "Type '{0}' has no call signatures."), + Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2758, ts2.DiagnosticCategory.Error, "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758", "Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."), + No_constituent_of_type_0_is_constructable: diag(2759, ts2.DiagnosticCategory.Error, "No_constituent_of_type_0_is_constructable_2759", "No constituent of type '{0}' is constructable."), + Not_all_constituents_of_type_0_are_constructable: diag(2760, ts2.DiagnosticCategory.Error, "Not_all_constituents_of_type_0_are_constructable_2760", "Not all constituents of type '{0}' are constructable."), + Type_0_has_no_construct_signatures: diag(2761, ts2.DiagnosticCategory.Error, "Type_0_has_no_construct_signatures_2761", "Type '{0}' has no construct signatures."), + Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2762, ts2.DiagnosticCategory.Error, "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762", "Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: diag(2763, ts2.DiagnosticCategory.Error, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: diag(2764, ts2.DiagnosticCategory.Error, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: diag(2765, ts2.DiagnosticCategory.Error, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."), + Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: diag(2766, ts2.DiagnosticCategory.Error, "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766", "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."), + The_0_property_of_an_iterator_must_be_a_method: diag(2767, ts2.DiagnosticCategory.Error, "The_0_property_of_an_iterator_must_be_a_method_2767", "The '{0}' property of an iterator must be a method."), + The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, ts2.DiagnosticCategory.Error, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."), + No_overload_matches_this_call: diag(2769, ts2.DiagnosticCategory.Error, "No_overload_matches_this_call_2769", "No overload matches this call."), + The_last_overload_gave_the_following_error: diag(2770, ts2.DiagnosticCategory.Error, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."), + The_last_overload_is_declared_here: diag(2771, ts2.DiagnosticCategory.Error, "The_last_overload_is_declared_here_2771", "The last overload is declared here."), + Overload_0_of_1_2_gave_the_following_error: diag(2772, ts2.DiagnosticCategory.Error, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."), + Did_you_forget_to_use_await: diag(2773, ts2.DiagnosticCategory.Error, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"), + This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, ts2.DiagnosticCategory.Error, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"), + Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: diag(2775, ts2.DiagnosticCategory.Error, "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775", "Assertions require every name in the call target to be declared with an explicit type annotation."), + Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: diag(2776, ts2.DiagnosticCategory.Error, "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776", "Assertions require the call target to be an identifier or qualified name."), + The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: diag(2777, ts2.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777", "The operand of an increment or decrement operator may not be an optional property access."), + The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: diag(2778, ts2.DiagnosticCategory.Error, "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778", "The target of an object rest assignment may not be an optional property access."), + The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: diag(2779, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779", "The left-hand side of an assignment expression may not be an optional property access."), + The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: diag(2780, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780", "The left-hand side of a 'for...in' statement may not be an optional property access."), + The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, ts2.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), + _0_needs_an_explicit_type_annotation: diag(2782, ts2.DiagnosticCategory.Message, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), + _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, ts2.DiagnosticCategory.Error, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, ts2.DiagnosticCategory.Error, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), + This_spread_always_overwrites_this_property: diag(2785, ts2.DiagnosticCategory.Error, "This_spread_always_overwrites_this_property_2785", "This spread always overwrites this property."), + _0_cannot_be_used_as_a_JSX_component: diag(2786, ts2.DiagnosticCategory.Error, "_0_cannot_be_used_as_a_JSX_component_2786", "'{0}' cannot be used as a JSX component."), + Its_return_type_0_is_not_a_valid_JSX_element: diag(2787, ts2.DiagnosticCategory.Error, "Its_return_type_0_is_not_a_valid_JSX_element_2787", "Its return type '{0}' is not a valid JSX element."), + Its_instance_type_0_is_not_a_valid_JSX_element: diag(2788, ts2.DiagnosticCategory.Error, "Its_instance_type_0_is_not_a_valid_JSX_element_2788", "Its instance type '{0}' is not a valid JSX element."), + Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, ts2.DiagnosticCategory.Error, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."), + The_operand_of_a_delete_operator_must_be_optional: diag(2790, ts2.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), + Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, ts2.DiagnosticCategory.Error, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), + Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, ts2.DiagnosticCategory.Error, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), + The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, ts2.DiagnosticCategory.Error, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), + Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, ts2.DiagnosticCategory.Error, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), + The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, ts2.DiagnosticCategory.Error, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), + It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, ts2.DiagnosticCategory.Error, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), + A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, ts2.DiagnosticCategory.Error, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."), + The_declaration_was_marked_as_deprecated_here: diag(2798, ts2.DiagnosticCategory.Error, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."), + Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, ts2.DiagnosticCategory.Error, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."), + Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, ts2.DiagnosticCategory.Error, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."), + This_condition_will_always_return_true_since_this_0_is_always_defined: diag(2801, ts2.DiagnosticCategory.Error, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."), + Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, ts2.DiagnosticCategory.Error, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."), + Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, ts2.DiagnosticCategory.Error, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."), + Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."), + Private_accessor_was_defined_without_a_getter: diag(2806, ts2.DiagnosticCategory.Error, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), + This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, ts2.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), + A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, ts2.DiagnosticCategory.Error, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, ts2.DiagnosticCategory.Error, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), + Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, ts2.DiagnosticCategory.Error, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), + Initializer_for_property_0: diag(2811, ts2.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), + Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, ts2.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), + Class_declaration_cannot_implement_overload_list_for_0: diag(2813, ts2.DiagnosticCategory.Error, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), + Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, ts2.DiagnosticCategory.Error, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), + arguments_cannot_be_referenced_in_property_initializers: diag(2815, ts2.DiagnosticCategory.Error, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."), + Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, ts2.DiagnosticCategory.Error, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), + Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, ts2.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), + Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, ts2.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."), + Namespace_name_cannot_be_0: diag(2819, ts2.DiagnosticCategory.Error, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."), + Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts2.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"), + Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts2.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."), + Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts2.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."), + Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts2.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"), + Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts2.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."), + Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts2.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"), + Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts2.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."), + Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts2.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."), + All_declarations_of_0_must_have_identical_constraints: diag(2838, ts2.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."), + This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, ts2.DiagnosticCategory.Error, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."), + An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, ts2.DiagnosticCategory.Error, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"), + The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, ts2.DiagnosticCategory.Error, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), + _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, ts2.DiagnosticCategory.Error, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"), + We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, ts2.DiagnosticCategory.Error, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."), + Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, ts2.DiagnosticCategory.Error, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), + This_condition_will_always_return_0: diag(2845, ts2.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."), + Import_declaration_0_is_using_private_name_1: diag(4e3, ts2.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4006, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006", "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4008, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008", "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4010, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010", "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."), + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4012, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012", "Type parameter '{0}' of public method from exported class has or is using private name '{1}'."), + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4014, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", "Type parameter '{0}' of method from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4016, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", "Type parameter '{0}' of exported function has or is using private name '{1}'."), + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4019, ts2.DiagnosticCategory.Error, "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", "Implements clause of exported class '{0}' has or is using private name '{1}'."), + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4020, ts2.DiagnosticCategory.Error, "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", "'extends' clause of exported class '{0}' has or is using private name '{1}'."), + extends_clause_of_exported_class_has_or_is_using_private_name_0: diag(4021, ts2.DiagnosticCategory.Error, "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021", "'extends' clause of exported class has or is using private name '{0}'."), + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: diag(4022, ts2.DiagnosticCategory.Error, "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", "'extends' clause of exported interface '{0}' has or is using private name '{1}'."), + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4023, ts2.DiagnosticCategory.Error, "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."), + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: diag(4024, ts2.DiagnosticCategory.Error, "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", "Exported variable '{0}' has or is using name '{1}' from private module '{2}'."), + Exported_variable_0_has_or_is_using_private_name_1: diag(4025, ts2.DiagnosticCategory.Error, "Exported_variable_0_has_or_is_using_private_name_1_4025", "Exported variable '{0}' has or is using private name '{1}'."), + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4026, ts2.DiagnosticCategory.Error, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026", "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4027, ts2.DiagnosticCategory.Error, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027", "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4028, ts2.DiagnosticCategory.Error, "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028", "Public static property '{0}' of exported class has or is using private name '{1}'."), + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4029, ts2.DiagnosticCategory.Error, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029", "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4030, ts2.DiagnosticCategory.Error, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030", "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4031, ts2.DiagnosticCategory.Error, "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031", "Public property '{0}' of exported class has or is using private name '{1}'."), + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4032, ts2.DiagnosticCategory.Error, "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032", "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), + Property_0_of_exported_interface_has_or_is_using_private_name_1: diag(4033, ts2.DiagnosticCategory.Error, "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033", "Property '{0}' of exported interface has or is using private name '{1}'."), + Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4034, ts2.DiagnosticCategory.Error, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034", "Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4035, ts2.DiagnosticCategory.Error, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035", "Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."), + Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4036, ts2.DiagnosticCategory.Error, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036", "Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4037, ts2.DiagnosticCategory.Error, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037", "Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4038, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4039, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4040, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040", "Return type of public static getter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4041, ts2.DiagnosticCategory.Error, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041", "Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4042, ts2.DiagnosticCategory.Error, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042", "Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4043, ts2.DiagnosticCategory.Error, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043", "Return type of public getter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4044, ts2.DiagnosticCategory.Error, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044", "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4045, ts2.DiagnosticCategory.Error, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045", "Return type of constructor signature from exported interface has or is using private name '{0}'."), + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4046, ts2.DiagnosticCategory.Error, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046", "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4047, ts2.DiagnosticCategory.Error, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047", "Return type of call signature from exported interface has or is using private name '{0}'."), + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4048, ts2.DiagnosticCategory.Error, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048", "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4049, ts2.DiagnosticCategory.Error, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049", "Return type of index signature from exported interface has or is using private name '{0}'."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4050, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050", "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4051, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051", "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: diag(4052, ts2.DiagnosticCategory.Error, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052", "Return type of public static method from exported class has or is using private name '{0}'."), + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4053, ts2.DiagnosticCategory.Error, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053", "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4054, ts2.DiagnosticCategory.Error, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054", "Return type of public method from exported class has or is using name '{0}' from private module '{1}'."), + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: diag(4055, ts2.DiagnosticCategory.Error, "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055", "Return type of public method from exported class has or is using private name '{0}'."), + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4056, ts2.DiagnosticCategory.Error, "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056", "Return type of method from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: diag(4057, ts2.DiagnosticCategory.Error, "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057", "Return type of method from exported interface has or is using private name '{0}'."), + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4058, ts2.DiagnosticCategory.Error, "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058", "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: diag(4059, ts2.DiagnosticCategory.Error, "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059", "Return type of exported function has or is using name '{0}' from private module '{1}'."), + Return_type_of_exported_function_has_or_is_using_private_name_0: diag(4060, ts2.DiagnosticCategory.Error, "Return_type_of_exported_function_has_or_is_using_private_name_0_4060", "Return type of exported function has or is using private name '{0}'."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4061, ts2.DiagnosticCategory.Error, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4062, ts2.DiagnosticCategory.Error, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: diag(4063, ts2.DiagnosticCategory.Error, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063", "Parameter '{0}' of constructor from exported class has or is using private name '{1}'."), + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4064, ts2.DiagnosticCategory.Error, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064", "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4065, ts2.DiagnosticCategory.Error, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065", "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4066, ts2.DiagnosticCategory.Error, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066", "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4067, ts2.DiagnosticCategory.Error, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067", "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4068, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4069, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4070, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070", "Parameter '{0}' of public static method from exported class has or is using private name '{1}'."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4071, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071", "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4072, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072", "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4073, ts2.DiagnosticCategory.Error, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073", "Parameter '{0}' of public method from exported class has or is using private name '{1}'."), + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4074, ts2.DiagnosticCategory.Error, "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074", "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4075, ts2.DiagnosticCategory.Error, "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075", "Parameter '{0}' of method from exported interface has or is using private name '{1}'."), + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4076, ts2.DiagnosticCategory.Error, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076", "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: diag(4077, ts2.DiagnosticCategory.Error, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077", "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4078, ts2.DiagnosticCategory.Error, "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078", "Parameter '{0}' of exported function has or is using private name '{1}'."), + Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, ts2.DiagnosticCategory.Error, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), + Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, ts2.DiagnosticCategory.Error, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), + Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), + Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, ts2.DiagnosticCategory.Error, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."), + Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts2.DiagnosticCategory.Error, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, ts2.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, ts2.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), + Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, ts2.DiagnosticCategory.Error, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."), + Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, ts2.DiagnosticCategory.Error, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, ts2.DiagnosticCategory.Error, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, ts2.DiagnosticCategory.Error, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."), + Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4098, ts2.DiagnosticCategory.Error, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098", "Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4099, ts2.DiagnosticCategory.Error, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099", "Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, ts2.DiagnosticCategory.Error, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."), + Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, ts2.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), + Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, ts2.DiagnosticCategory.Error, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."), + Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, ts2.DiagnosticCategory.Error, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."), + The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, ts2.DiagnosticCategory.Error, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."), + Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: diag(4105, ts2.DiagnosticCategory.Error, "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105", "Private or protected member '{0}' cannot be accessed on a type parameter."), + Parameter_0_of_accessor_has_or_is_using_private_name_1: diag(4106, ts2.DiagnosticCategory.Error, "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106", "Parameter '{0}' of accessor has or is using private name '{1}'."), + Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: diag(4107, ts2.DiagnosticCategory.Error, "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107", "Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4108, ts2.DiagnosticCategory.Error, "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108", "Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."), + Type_arguments_for_0_circularly_reference_themselves: diag(4109, ts2.DiagnosticCategory.Error, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."), + Tuple_type_arguments_circularly_reference_themselves: diag(4110, ts2.DiagnosticCategory.Error, "Tuple_type_arguments_circularly_reference_themselves_4110", "Tuple type arguments circularly reference themselves."), + Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: diag(4111, ts2.DiagnosticCategory.Error, "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111", "Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."), + This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class: diag(4112, ts2.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112", "This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."), + This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0: diag(4113, ts2.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."), + This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0: diag(4114, ts2.DiagnosticCategory.Error, "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114", "This member must have an 'override' modifier because it overrides a member in the base class '{0}'."), + This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0: diag(4115, ts2.DiagnosticCategory.Error, "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115", "This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."), + This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, ts2.DiagnosticCategory.Error, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."), + This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, ts2.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"), + The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, ts2.DiagnosticCategory.Error, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."), + This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, ts2.DiagnosticCategory.Error, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), + This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, ts2.DiagnosticCategory.Error, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts2.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts2.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts2.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"), + Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, ts2.DiagnosticCategory.Error, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), + resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, ts2.DiagnosticCategory.Error, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), + The_current_host_does_not_support_the_0_option: diag(5001, ts2.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), + Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts2.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), + File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts2.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), + Cannot_read_file_0_Colon_1: diag(5012, ts2.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), + Failed_to_parse_file_0_Colon_1: diag(5014, ts2.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), + Unknown_compiler_option_0: diag(5023, ts2.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), + Compiler_option_0_requires_a_value_of_type_1: diag(5024, ts2.DiagnosticCategory.Error, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."), + Unknown_compiler_option_0_Did_you_mean_1: diag(5025, ts2.DiagnosticCategory.Error, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"), + Could_not_write_file_0_Colon_1: diag(5033, ts2.DiagnosticCategory.Error, "Could_not_write_file_0_Colon_1_5033", "Could not write file '{0}': {1}."), + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: diag(5042, ts2.DiagnosticCategory.Error, "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", "Option 'project' cannot be mixed with source files on a command line."), + Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: diag(5047, ts2.DiagnosticCategory.Error, "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."), + Option_0_cannot_be_specified_when_option_target_is_ES3: diag(5048, ts2.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_target_is_ES3_5048", "Option '{0}' cannot be specified when option 'target' is 'ES3'."), + Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: diag(5051, ts2.DiagnosticCategory.Error, "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."), + Option_0_cannot_be_specified_without_specifying_option_1: diag(5052, ts2.DiagnosticCategory.Error, "Option_0_cannot_be_specified_without_specifying_option_1_5052", "Option '{0}' cannot be specified without specifying option '{1}'."), + Option_0_cannot_be_specified_with_option_1: diag(5053, ts2.DiagnosticCategory.Error, "Option_0_cannot_be_specified_with_option_1_5053", "Option '{0}' cannot be specified with option '{1}'."), + A_tsconfig_json_file_is_already_defined_at_Colon_0: diag(5054, ts2.DiagnosticCategory.Error, "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", "A 'tsconfig.json' file is already defined at: '{0}'."), + Cannot_write_file_0_because_it_would_overwrite_input_file: diag(5055, ts2.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", "Cannot write file '{0}' because it would overwrite input file."), + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: diag(5056, ts2.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", "Cannot write file '{0}' because it would be overwritten by multiple input files."), + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, ts2.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), + The_specified_path_does_not_exist_Colon_0: diag(5058, ts2.DiagnosticCategory.Error, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), + Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, ts2.DiagnosticCategory.Error, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, ts2.DiagnosticCategory.Error, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), + Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, ts2.DiagnosticCategory.Error, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), + Substitutions_for_pattern_0_should_be_an_array: diag(5063, ts2.DiagnosticCategory.Error, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), + Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, ts2.DiagnosticCategory.Error, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."), + File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, ts2.DiagnosticCategory.Error, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."), + Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: diag(5066, ts2.DiagnosticCategory.Error, "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066", "Substitutions for pattern '{0}' shouldn't be an empty array."), + Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, ts2.DiagnosticCategory.Error, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."), + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, ts2.DiagnosticCategory.Error, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."), + Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, ts2.DiagnosticCategory.Error, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."), + Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy: diag(5070, ts2.DiagnosticCategory.Error, "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070", "Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."), + Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, ts2.DiagnosticCategory.Error, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."), + Unknown_build_option_0: diag(5072, ts2.DiagnosticCategory.Error, "Unknown_build_option_0_5072", "Unknown build option '{0}'."), + Build_option_0_requires_a_value_of_type_1: diag(5073, ts2.DiagnosticCategory.Error, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."), + Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, ts2.DiagnosticCategory.Error, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."), + _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, ts2.DiagnosticCategory.Error, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."), + _0_and_1_operations_cannot_be_mixed_without_parentheses: diag(5076, ts2.DiagnosticCategory.Error, "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076", "'{0}' and '{1}' operations cannot be mixed without parentheses."), + Unknown_build_option_0_Did_you_mean_1: diag(5077, ts2.DiagnosticCategory.Error, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"), + Unknown_watch_option_0: diag(5078, ts2.DiagnosticCategory.Error, "Unknown_watch_option_0_5078", "Unknown watch option '{0}'."), + Unknown_watch_option_0_Did_you_mean_1: diag(5079, ts2.DiagnosticCategory.Error, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), + Watch_option_0_requires_a_value_of_type_1: diag(5080, ts2.DiagnosticCategory.Error, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), + Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, ts2.DiagnosticCategory.Error, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, ts2.DiagnosticCategory.Error, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), + Cannot_read_file_0: diag(5083, ts2.DiagnosticCategory.Error, "Cannot_read_file_0_5083", "Cannot read file '{0}'."), + Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, ts2.DiagnosticCategory.Error, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."), + A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, ts2.DiagnosticCategory.Error, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."), + A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, ts2.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), + A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, ts2.DiagnosticCategory.Error, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."), + The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, ts2.DiagnosticCategory.Error, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), + Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, ts2.DiagnosticCategory.Error, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), + Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, ts2.DiagnosticCategory.Error, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), + Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, ts2.DiagnosticCategory.Error, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), + The_root_value_of_a_0_file_must_be_an_object: diag(5092, ts2.DiagnosticCategory.Error, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), + Compiler_option_0_may_only_be_used_with_build: diag(5093, ts2.DiagnosticCategory.Error, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), + Compiler_option_0_may_not_be_used_with_build: diag(5094, ts2.DiagnosticCategory.Error, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), + Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, ts2.DiagnosticCategory.Error, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), + Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, ts2.DiagnosticCategory.Message, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), + Concatenate_and_emit_output_to_single_file: diag(6001, ts2.DiagnosticCategory.Message, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), + Generates_corresponding_d_ts_file: diag(6002, ts2.DiagnosticCategory.Message, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), + Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, ts2.DiagnosticCategory.Message, "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004", "Specify the location where debugger should locate TypeScript files instead of source locations."), + Watch_input_files: diag(6005, ts2.DiagnosticCategory.Message, "Watch_input_files_6005", "Watch input files."), + Redirect_output_structure_to_the_directory: diag(6006, ts2.DiagnosticCategory.Message, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."), + Do_not_erase_const_enum_declarations_in_generated_code: diag(6007, ts2.DiagnosticCategory.Message, "Do_not_erase_const_enum_declarations_in_generated_code_6007", "Do not erase const enum declarations in generated code."), + Do_not_emit_outputs_if_any_errors_were_reported: diag(6008, ts2.DiagnosticCategory.Message, "Do_not_emit_outputs_if_any_errors_were_reported_6008", "Do not emit outputs if any errors were reported."), + Do_not_emit_comments_to_output: diag(6009, ts2.DiagnosticCategory.Message, "Do_not_emit_comments_to_output_6009", "Do not emit comments to output."), + Do_not_emit_outputs: diag(6010, ts2.DiagnosticCategory.Message, "Do_not_emit_outputs_6010", "Do not emit outputs."), + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts2.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), + Skip_type_checking_of_declaration_files: diag(6012, ts2.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts2.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts2.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), + Specify_ECMAScript_target_version: diag(6015, ts2.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."), + Specify_module_code_generation: diag(6016, ts2.DiagnosticCategory.Message, "Specify_module_code_generation_6016", "Specify module code generation."), + Print_this_message: diag(6017, ts2.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), + Print_the_compiler_s_version: diag(6019, ts2.DiagnosticCategory.Message, "Print_the_compiler_s_version_6019", "Print the compiler's version."), + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: diag(6020, ts2.DiagnosticCategory.Message, "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."), + Syntax_Colon_0: diag(6023, ts2.DiagnosticCategory.Message, "Syntax_Colon_0_6023", "Syntax: {0}"), + options: diag(6024, ts2.DiagnosticCategory.Message, "options_6024", "options"), + file: diag(6025, ts2.DiagnosticCategory.Message, "file_6025", "file"), + Examples_Colon_0: diag(6026, ts2.DiagnosticCategory.Message, "Examples_Colon_0_6026", "Examples: {0}"), + Options_Colon: diag(6027, ts2.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), + Version_0: diag(6029, ts2.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), + Insert_command_line_options_and_files_from_a_file: diag(6030, ts2.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts2.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), + File_change_detected_Starting_incremental_compilation: diag(6032, ts2.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), + KIND: diag(6034, ts2.DiagnosticCategory.Message, "KIND_6034", "KIND"), + FILE: diag(6035, ts2.DiagnosticCategory.Message, "FILE_6035", "FILE"), + VERSION: diag(6036, ts2.DiagnosticCategory.Message, "VERSION_6036", "VERSION"), + LOCATION: diag(6037, ts2.DiagnosticCategory.Message, "LOCATION_6037", "LOCATION"), + DIRECTORY: diag(6038, ts2.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"), + STRATEGY: diag(6039, ts2.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"), + FILE_OR_DIRECTORY: diag(6040, ts2.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"), + Errors_Files: diag(6041, ts2.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"), + Generates_corresponding_map_file: diag(6043, ts2.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."), + Compiler_option_0_expects_an_argument: diag(6044, ts2.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."), + Unterminated_quoted_string_in_response_file_0: diag(6045, ts2.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."), + Argument_for_0_option_must_be_Colon_1: diag(6046, ts2.DiagnosticCategory.Error, "Argument_for_0_option_must_be_Colon_1_6046", "Argument for '{0}' option must be: {1}."), + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: diag(6048, ts2.DiagnosticCategory.Error, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form or -. For example '{0}' or '{1}'."), + Unable_to_open_file_0: diag(6050, ts2.DiagnosticCategory.Error, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."), + Corrupted_locale_file_0: diag(6051, ts2.DiagnosticCategory.Error, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."), + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, ts2.DiagnosticCategory.Message, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."), + File_0_not_found: diag(6053, ts2.DiagnosticCategory.Error, "File_0_not_found_6053", "File '{0}' not found."), + File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: diag(6054, ts2.DiagnosticCategory.Error, "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054", "File '{0}' has an unsupported extension. The only supported extensions are {1}."), + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: diag(6055, ts2.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055", "Suppress noImplicitAny errors for indexing objects lacking index signatures."), + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: diag(6056, ts2.DiagnosticCategory.Message, "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056", "Do not emit declarations for code that has an '@internal' annotation."), + Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: diag(6058, ts2.DiagnosticCategory.Message, "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058", "Specify the root directory of input files. Use to control the output directory structure with --outDir."), + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: diag(6059, ts2.DiagnosticCategory.Error, "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059", "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."), + Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: diag(6060, ts2.DiagnosticCategory.Message, "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060", "Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."), + NEWLINE: diag(6061, ts2.DiagnosticCategory.Message, "NEWLINE_6061", "NEWLINE"), + Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, ts2.DiagnosticCategory.Error, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."), + Enables_experimental_support_for_ES7_decorators: diag(6065, ts2.DiagnosticCategory.Message, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."), + Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, ts2.DiagnosticCategory.Message, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."), + Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: diag(6069, ts2.DiagnosticCategory.Message, "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069", "Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."), + Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, ts2.DiagnosticCategory.Message, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."), + Successfully_created_a_tsconfig_json_file: diag(6071, ts2.DiagnosticCategory.Message, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."), + Suppress_excess_property_checks_for_object_literals: diag(6072, ts2.DiagnosticCategory.Message, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."), + Stylize_errors_and_messages_using_color_and_context_experimental: diag(6073, ts2.DiagnosticCategory.Message, "Stylize_errors_and_messages_using_color_and_context_experimental_6073", "Stylize errors and messages using color and context (experimental)."), + Do_not_report_errors_on_unused_labels: diag(6074, ts2.DiagnosticCategory.Message, "Do_not_report_errors_on_unused_labels_6074", "Do not report errors on unused labels."), + Report_error_when_not_all_code_paths_in_function_return_a_value: diag(6075, ts2.DiagnosticCategory.Message, "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", "Report error when not all code paths in function return a value."), + Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts2.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), + Do_not_report_errors_on_unreachable_code: diag(6077, ts2.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), + Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts2.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts2.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), + Specify_JSX_code_generation: diag(6080, ts2.DiagnosticCategory.Message, "Specify_JSX_code_generation_6080", "Specify JSX code generation."), + File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts2.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), + Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts2.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), + Base_directory_to_resolve_non_absolute_module_names: diag(6083, ts2.DiagnosticCategory.Message, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."), + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, ts2.DiagnosticCategory.Message, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"), + Enable_tracing_of_the_name_resolution_process: diag(6085, ts2.DiagnosticCategory.Message, "Enable_tracing_of_the_name_resolution_process_6085", "Enable tracing of the name resolution process."), + Resolving_module_0_from_1: diag(6086, ts2.DiagnosticCategory.Message, "Resolving_module_0_from_1_6086", "======== Resolving module '{0}' from '{1}'. ========"), + Explicitly_specified_module_resolution_kind_Colon_0: diag(6087, ts2.DiagnosticCategory.Message, "Explicitly_specified_module_resolution_kind_Colon_0_6087", "Explicitly specified module resolution kind: '{0}'."), + Module_resolution_kind_is_not_specified_using_0: diag(6088, ts2.DiagnosticCategory.Message, "Module_resolution_kind_is_not_specified_using_0_6088", "Module resolution kind is not specified, using '{0}'."), + Module_name_0_was_successfully_resolved_to_1: diag(6089, ts2.DiagnosticCategory.Message, "Module_name_0_was_successfully_resolved_to_1_6089", "======== Module name '{0}' was successfully resolved to '{1}'. ========"), + Module_name_0_was_not_resolved: diag(6090, ts2.DiagnosticCategory.Message, "Module_name_0_was_not_resolved_6090", "======== Module name '{0}' was not resolved. ========"), + paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: diag(6091, ts2.DiagnosticCategory.Message, "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091", "'paths' option is specified, looking for a pattern to match module name '{0}'."), + Module_name_0_matched_pattern_1: diag(6092, ts2.DiagnosticCategory.Message, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."), + Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, ts2.DiagnosticCategory.Message, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."), + Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, ts2.DiagnosticCategory.Message, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: diag(6095, ts2.DiagnosticCategory.Message, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", "Loading module as file / folder, candidate module location '{0}', target file type '{1}'."), + File_0_does_not_exist: diag(6096, ts2.DiagnosticCategory.Message, "File_0_does_not_exist_6096", "File '{0}' does not exist."), + File_0_exist_use_it_as_a_name_resolution_result: diag(6097, ts2.DiagnosticCategory.Message, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), + Loading_module_0_from_node_modules_folder_target_file_type_1: diag(6098, ts2.DiagnosticCategory.Message, "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", "Loading module '{0}' from 'node_modules' folder, target file type '{1}'."), + Found_package_json_at_0: diag(6099, ts2.DiagnosticCategory.Message, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), + package_json_does_not_have_a_0_field: diag(6100, ts2.DiagnosticCategory.Message, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), + package_json_has_0_field_1_that_references_2: diag(6101, ts2.DiagnosticCategory.Message, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."), + Allow_javascript_files_to_be_compiled: diag(6102, ts2.DiagnosticCategory.Message, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."), + Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, ts2.DiagnosticCategory.Message, "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."), + Expected_type_of_0_field_in_package_json_to_be_1_got_2: diag(6105, ts2.DiagnosticCategory.Message, "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105", "Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."), + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: diag(6106, ts2.DiagnosticCategory.Message, "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."), + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: diag(6107, ts2.DiagnosticCategory.Message, "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", "'rootDirs' option is set, using it to resolve relative module name '{0}'."), + Longest_matching_prefix_for_0_is_1: diag(6108, ts2.DiagnosticCategory.Message, "Longest_matching_prefix_for_0_is_1_6108", "Longest matching prefix for '{0}' is '{1}'."), + Loading_0_from_the_root_dir_1_candidate_location_2: diag(6109, ts2.DiagnosticCategory.Message, "Loading_0_from_the_root_dir_1_candidate_location_2_6109", "Loading '{0}' from the root dir '{1}', candidate location '{2}'."), + Trying_other_entries_in_rootDirs: diag(6110, ts2.DiagnosticCategory.Message, "Trying_other_entries_in_rootDirs_6110", "Trying other entries in 'rootDirs'."), + Module_resolution_using_rootDirs_has_failed: diag(6111, ts2.DiagnosticCategory.Message, "Module_resolution_using_rootDirs_has_failed_6111", "Module resolution using 'rootDirs' has failed."), + Do_not_emit_use_strict_directives_in_module_output: diag(6112, ts2.DiagnosticCategory.Message, "Do_not_emit_use_strict_directives_in_module_output_6112", "Do not emit 'use strict' directives in module output."), + Enable_strict_null_checks: diag(6113, ts2.DiagnosticCategory.Message, "Enable_strict_null_checks_6113", "Enable strict null checks."), + Unknown_option_excludes_Did_you_mean_exclude: diag(6114, ts2.DiagnosticCategory.Error, "Unknown_option_excludes_Did_you_mean_exclude_6114", "Unknown option 'excludes'. Did you mean 'exclude'?"), + Raise_error_on_this_expressions_with_an_implied_any_type: diag(6115, ts2.DiagnosticCategory.Message, "Raise_error_on_this_expressions_with_an_implied_any_type_6115", "Raise error on 'this' expressions with an implied 'any' type."), + Resolving_type_reference_directive_0_containing_file_1_root_directory_2: diag(6116, ts2.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"), + Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, ts2.DiagnosticCategory.Message, "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"), + Type_reference_directive_0_was_not_resolved: diag(6120, ts2.DiagnosticCategory.Message, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"), + Resolving_with_primary_search_path_0: diag(6121, ts2.DiagnosticCategory.Message, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."), + Root_directory_cannot_be_determined_skipping_primary_search_paths: diag(6122, ts2.DiagnosticCategory.Message, "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", "Root directory cannot be determined, skipping primary search paths."), + Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: diag(6123, ts2.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"), + Type_declaration_files_to_be_included_in_compilation: diag(6124, ts2.DiagnosticCategory.Message, "Type_declaration_files_to_be_included_in_compilation_6124", "Type declaration files to be included in compilation."), + Looking_up_in_node_modules_folder_initial_location_0: diag(6125, ts2.DiagnosticCategory.Message, "Looking_up_in_node_modules_folder_initial_location_0_6125", "Looking up in 'node_modules' folder, initial location '{0}'."), + Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: diag(6126, ts2.DiagnosticCategory.Message, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."), + Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: diag(6127, ts2.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"), + Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: diag(6128, ts2.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"), + Resolving_real_path_for_0_result_1: diag(6130, ts2.DiagnosticCategory.Message, "Resolving_real_path_for_0_result_1_6130", "Resolving real path for '{0}', result '{1}'."), + Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: diag(6131, ts2.DiagnosticCategory.Error, "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."), + File_name_0_has_a_1_extension_stripping_it: diag(6132, ts2.DiagnosticCategory.Message, "File_name_0_has_a_1_extension_stripping_it_6132", "File name '{0}' has a '{1}' extension - stripping it."), + _0_is_declared_but_its_value_is_never_read: diag( + 6133, + ts2.DiagnosticCategory.Error, + "_0_is_declared_but_its_value_is_never_read_6133", + "'{0}' is declared but its value is never read.", + /*reportsUnnecessary*/ + true + ), + Report_errors_on_unused_locals: diag(6134, ts2.DiagnosticCategory.Message, "Report_errors_on_unused_locals_6134", "Report errors on unused locals."), + Report_errors_on_unused_parameters: diag(6135, ts2.DiagnosticCategory.Message, "Report_errors_on_unused_parameters_6135", "Report errors on unused parameters."), + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: diag(6136, ts2.DiagnosticCategory.Message, "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", "The maximum dependency depth to search under node_modules and load JavaScript files."), + Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: diag(6137, ts2.DiagnosticCategory.Error, "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137", "Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."), + Property_0_is_declared_but_its_value_is_never_read: diag( + 6138, + ts2.DiagnosticCategory.Error, + "Property_0_is_declared_but_its_value_is_never_read_6138", + "Property '{0}' is declared but its value is never read.", + /*reportsUnnecessary*/ + true + ), + Import_emit_helpers_from_tslib: diag(6139, ts2.DiagnosticCategory.Message, "Import_emit_helpers_from_tslib_6139", "Import emit helpers from 'tslib'."), + Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: diag(6140, ts2.DiagnosticCategory.Error, "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."), + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: diag(6141, ts2.DiagnosticCategory.Message, "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", 'Parse in strict mode and emit "use strict" for each source file.'), + Module_0_was_resolved_to_1_but_jsx_is_not_set: diag(6142, ts2.DiagnosticCategory.Error, "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", "Module '{0}' was resolved to '{1}', but '--jsx' is not set."), + Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, ts2.DiagnosticCategory.Message, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), + Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, ts2.DiagnosticCategory.Message, "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."), + Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, ts2.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), + Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, ts2.DiagnosticCategory.Message, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), + Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, ts2.DiagnosticCategory.Message, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), + Show_diagnostic_information: diag(6149, ts2.DiagnosticCategory.Message, "Show_diagnostic_information_6149", "Show diagnostic information."), + Show_verbose_diagnostic_information: diag(6150, ts2.DiagnosticCategory.Message, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: diag(6151, ts2.DiagnosticCategory.Message, "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", "Emit a single file with source maps instead of having a separate file."), + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: diag(6152, ts2.DiagnosticCategory.Message, "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."), + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: diag(6153, ts2.DiagnosticCategory.Message, "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", "Transpile each file as a separate module (similar to 'ts.transpileModule')."), + Print_names_of_generated_files_part_of_the_compilation: diag(6154, ts2.DiagnosticCategory.Message, "Print_names_of_generated_files_part_of_the_compilation_6154", "Print names of generated files part of the compilation."), + Print_names_of_files_part_of_the_compilation: diag(6155, ts2.DiagnosticCategory.Message, "Print_names_of_files_part_of_the_compilation_6155", "Print names of files part of the compilation."), + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: diag(6156, ts2.DiagnosticCategory.Message, "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", "The locale used when displaying messages to the user (e.g. 'en-us')"), + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: diag(6157, ts2.DiagnosticCategory.Message, "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", "Do not generate custom helper functions like '__extends' in compiled output."), + Do_not_include_the_default_library_file_lib_d_ts: diag(6158, ts2.DiagnosticCategory.Message, "Do_not_include_the_default_library_file_lib_d_ts_6158", "Do not include the default library file (lib.d.ts)."), + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: diag(6159, ts2.DiagnosticCategory.Message, "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", "Do not add triple-slash references or imported modules to the list of compiled files."), + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: diag(6160, ts2.DiagnosticCategory.Message, "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."), + List_of_folders_to_include_type_definitions_from: diag(6161, ts2.DiagnosticCategory.Message, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."), + Disable_size_limitations_on_JavaScript_projects: diag(6162, ts2.DiagnosticCategory.Message, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."), + The_character_set_of_the_input_files: diag(6163, ts2.DiagnosticCategory.Message, "The_character_set_of_the_input_files_6163", "The character set of the input files."), + Do_not_truncate_error_messages: diag(6165, ts2.DiagnosticCategory.Message, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."), + Output_directory_for_generated_declaration_files: diag(6166, ts2.DiagnosticCategory.Message, "Output_directory_for_generated_declaration_files_6166", "Output directory for generated declaration files."), + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: diag(6167, ts2.DiagnosticCategory.Message, "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."), + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: diag(6168, ts2.DiagnosticCategory.Message, "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", "List of root folders whose combined content represents the structure of the project at runtime."), + Show_all_compiler_options: diag(6169, ts2.DiagnosticCategory.Message, "Show_all_compiler_options_6169", "Show all compiler options."), + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, ts2.DiagnosticCategory.Message, "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"), + Command_line_Options: diag(6171, ts2.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"), + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, ts2.DiagnosticCategory.Message, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."), + Enable_all_strict_type_checking_options: diag(6180, ts2.DiagnosticCategory.Message, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."), + Scoped_package_detected_looking_in_0: diag(6182, ts2.DiagnosticCategory.Message, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), + Enable_strict_checking_of_function_types: diag(6186, ts2.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), + Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts2.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts2.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts2.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, ts2.DiagnosticCategory.Message, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), + All_imports_in_import_declaration_are_unused: diag( + 6192, + ts2.DiagnosticCategory.Error, + "All_imports_in_import_declaration_are_unused_6192", + "All imports in import declaration are unused.", + /*reportsUnnecessary*/ + true + ), + Found_1_error_Watching_for_file_changes: diag(6193, ts2.DiagnosticCategory.Message, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."), + Found_0_errors_Watching_for_file_changes: diag(6194, ts2.DiagnosticCategory.Message, "Found_0_errors_Watching_for_file_changes_6194", "Found {0} errors. Watching for file changes."), + Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: diag(6195, ts2.DiagnosticCategory.Message, "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195", "Resolve 'keyof' to string valued property names only (no numbers or symbols)."), + _0_is_declared_but_never_used: diag( + 6196, + ts2.DiagnosticCategory.Error, + "_0_is_declared_but_never_used_6196", + "'{0}' is declared but never used.", + /*reportsUnnecessary*/ + true + ), + Include_modules_imported_with_json_extension: diag(6197, ts2.DiagnosticCategory.Message, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"), + All_destructured_elements_are_unused: diag( + 6198, + ts2.DiagnosticCategory.Error, + "All_destructured_elements_are_unused_6198", + "All destructured elements are unused.", + /*reportsUnnecessary*/ + true + ), + All_variables_are_unused: diag( + 6199, + ts2.DiagnosticCategory.Error, + "All_variables_are_unused_6199", + "All variables are unused.", + /*reportsUnnecessary*/ + true + ), + Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, ts2.DiagnosticCategory.Error, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"), + Conflicts_are_in_this_file: diag(6201, ts2.DiagnosticCategory.Message, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."), + Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts2.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), + _0_was_also_declared_here: diag(6203, ts2.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), + and_here: diag(6204, ts2.DiagnosticCategory.Message, "and_here_6204", "and here."), + All_type_parameters_are_unused: diag(6205, ts2.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts2.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), + package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, ts2.DiagnosticCategory.Message, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), + package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, ts2.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), + package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: diag(6209, ts2.DiagnosticCategory.Message, "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209", "'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."), + An_argument_for_0_was_not_provided: diag(6210, ts2.DiagnosticCategory.Message, "An_argument_for_0_was_not_provided_6210", "An argument for '{0}' was not provided."), + An_argument_matching_this_binding_pattern_was_not_provided: diag(6211, ts2.DiagnosticCategory.Message, "An_argument_matching_this_binding_pattern_was_not_provided_6211", "An argument matching this binding pattern was not provided."), + Did_you_mean_to_call_this_expression: diag(6212, ts2.DiagnosticCategory.Message, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"), + Did_you_mean_to_use_new_with_this_expression: diag(6213, ts2.DiagnosticCategory.Message, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"), + Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, ts2.DiagnosticCategory.Message, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."), + Using_compiler_options_of_project_reference_redirect_0: diag(6215, ts2.DiagnosticCategory.Message, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."), + Found_1_error: diag(6216, ts2.DiagnosticCategory.Message, "Found_1_error_6216", "Found 1 error."), + Found_0_errors: diag(6217, ts2.DiagnosticCategory.Message, "Found_0_errors_6217", "Found {0} errors."), + Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, ts2.DiagnosticCategory.Message, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"), + Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, ts2.DiagnosticCategory.Message, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"), + package_json_had_a_falsy_0_field: diag(6220, ts2.DiagnosticCategory.Message, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."), + Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: diag(6221, ts2.DiagnosticCategory.Message, "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221", "Disable use of source files instead of declaration files from referenced projects."), + Emit_class_fields_with_Define_instead_of_Set: diag(6222, ts2.DiagnosticCategory.Message, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."), + Generates_a_CPU_profile: diag(6223, ts2.DiagnosticCategory.Message, "Generates_a_CPU_profile_6223", "Generates a CPU profile."), + Disable_solution_searching_for_this_project: diag(6224, ts2.DiagnosticCategory.Message, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."), + Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, ts2.DiagnosticCategory.Message, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."), + Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling: diag(6226, ts2.DiagnosticCategory.Message, "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226", "Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."), + Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize: diag(6227, ts2.DiagnosticCategory.Message, "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227", "Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."), + Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: diag(6229, ts2.DiagnosticCategory.Error, "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229", "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."), + Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: diag(6230, ts2.DiagnosticCategory.Error, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."), + Could_not_resolve_the_path_0_with_the_extensions_Colon_1: diag(6231, ts2.DiagnosticCategory.Error, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."), + Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: diag(6232, ts2.DiagnosticCategory.Error, "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232", "Declaration augments declaration in another file. This cannot be serialized."), + This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: diag(6233, ts2.DiagnosticCategory.Error, "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233", "This is the declaration being augmented. Consider moving the augmenting declaration into the same file."), + This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, ts2.DiagnosticCategory.Error, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), + Disable_loading_referenced_projects: diag(6235, ts2.DiagnosticCategory.Message, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), + Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, ts2.DiagnosticCategory.Error, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), + Generates_an_event_trace_and_a_list_of_types: diag(6237, ts2.DiagnosticCategory.Message, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), + Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, ts2.DiagnosticCategory.Error, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"), + File_0_exists_according_to_earlier_cached_lookups: diag(6239, ts2.DiagnosticCategory.Message, "File_0_exists_according_to_earlier_cached_lookups_6239", "File '{0}' exists according to earlier cached lookups."), + File_0_does_not_exist_according_to_earlier_cached_lookups: diag(6240, ts2.DiagnosticCategory.Message, "File_0_does_not_exist_according_to_earlier_cached_lookups_6240", "File '{0}' does not exist according to earlier cached lookups."), + Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1: diag(6241, ts2.DiagnosticCategory.Message, "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241", "Resolution for type reference directive '{0}' was found in cache from location '{1}'."), + Resolving_type_reference_directive_0_containing_file_1: diag(6242, ts2.DiagnosticCategory.Message, "Resolving_type_reference_directive_0_containing_file_1_6242", "======== Resolving type reference directive '{0}', containing file '{1}'. ========"), + Interpret_optional_property_types_as_written_rather_than_adding_undefined: diag(6243, ts2.DiagnosticCategory.Message, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."), + Modules: diag(6244, ts2.DiagnosticCategory.Message, "Modules_6244", "Modules"), + File_Management: diag(6245, ts2.DiagnosticCategory.Message, "File_Management_6245", "File Management"), + Emit: diag(6246, ts2.DiagnosticCategory.Message, "Emit_6246", "Emit"), + JavaScript_Support: diag(6247, ts2.DiagnosticCategory.Message, "JavaScript_Support_6247", "JavaScript Support"), + Type_Checking: diag(6248, ts2.DiagnosticCategory.Message, "Type_Checking_6248", "Type Checking"), + Editor_Support: diag(6249, ts2.DiagnosticCategory.Message, "Editor_Support_6249", "Editor Support"), + Watch_and_Build_Modes: diag(6250, ts2.DiagnosticCategory.Message, "Watch_and_Build_Modes_6250", "Watch and Build Modes"), + Compiler_Diagnostics: diag(6251, ts2.DiagnosticCategory.Message, "Compiler_Diagnostics_6251", "Compiler Diagnostics"), + Interop_Constraints: diag(6252, ts2.DiagnosticCategory.Message, "Interop_Constraints_6252", "Interop Constraints"), + Backwards_Compatibility: diag(6253, ts2.DiagnosticCategory.Message, "Backwards_Compatibility_6253", "Backwards Compatibility"), + Language_and_Environment: diag(6254, ts2.DiagnosticCategory.Message, "Language_and_Environment_6254", "Language and Environment"), + Projects: diag(6255, ts2.DiagnosticCategory.Message, "Projects_6255", "Projects"), + Output_Formatting: diag(6256, ts2.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"), + Completeness: diag(6257, ts2.DiagnosticCategory.Message, "Completeness_6257", "Completeness"), + _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts2.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"), + Found_1_error_in_1: diag(6259, ts2.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"), + Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts2.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"), + Found_0_errors_in_1_files: diag(6261, ts2.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."), + Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts2.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."), + Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts2.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."), + Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts2.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."), + package_json_scope_0_has_no_imports_defined: diag(6273, ts2.DiagnosticCategory.Message, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."), + package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, ts2.DiagnosticCategory.Message, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), + package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, ts2.DiagnosticCategory.Message, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), + Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, ts2.DiagnosticCategory.Message, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Enable_project_compilation: diag(6302, ts2.DiagnosticCategory.Message, "Enable_project_compilation_6302", "Enable project compilation"), + Composite_projects_may_not_disable_declaration_emit: diag(6304, ts2.DiagnosticCategory.Error, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), + Output_file_0_has_not_been_built_from_source_file_1: diag(6305, ts2.DiagnosticCategory.Error, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), + Referenced_project_0_must_have_setting_composite_Colon_true: diag(6306, ts2.DiagnosticCategory.Error, "Referenced_project_0_must_have_setting_composite_Colon_true_6306", `Referenced project '{0}' must have setting "composite": true.`), + File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: diag(6307, ts2.DiagnosticCategory.Error, "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307", "File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."), + Cannot_prepend_project_0_because_it_does_not_have_outFile_set: diag(6308, ts2.DiagnosticCategory.Error, "Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308", "Cannot prepend project '{0}' because it does not have 'outFile' set"), + Output_file_0_from_project_1_does_not_exist: diag(6309, ts2.DiagnosticCategory.Error, "Output_file_0_from_project_1_does_not_exist_6309", "Output file '{0}' from project '{1}' does not exist"), + Referenced_project_0_may_not_disable_emit: diag(6310, ts2.DiagnosticCategory.Error, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."), + Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"), + Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, ts2.DiagnosticCategory.Message, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"), + Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"), + Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"), + Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, ts2.DiagnosticCategory.Message, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"), + Projects_in_this_build_Colon_0: diag(6355, ts2.DiagnosticCategory.Message, "Projects_in_this_build_Colon_0_6355", "Projects in this build: {0}"), + A_non_dry_build_would_delete_the_following_files_Colon_0: diag(6356, ts2.DiagnosticCategory.Message, "A_non_dry_build_would_delete_the_following_files_Colon_0_6356", "A non-dry build would delete the following files: {0}"), + A_non_dry_build_would_build_project_0: diag(6357, ts2.DiagnosticCategory.Message, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"), + Building_project_0: diag(6358, ts2.DiagnosticCategory.Message, "Building_project_0_6358", "Building project '{0}'..."), + Updating_output_timestamps_of_project_0: diag(6359, ts2.DiagnosticCategory.Message, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."), + Project_0_is_up_to_date: diag(6361, ts2.DiagnosticCategory.Message, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"), + Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, ts2.DiagnosticCategory.Message, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"), + Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, ts2.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"), + Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, ts2.DiagnosticCategory.Message, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"), + Delete_the_outputs_of_all_projects: diag(6365, ts2.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."), + Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, ts2.DiagnosticCategory.Message, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"), + Option_build_must_be_the_first_command_line_argument: diag(6369, ts2.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), + Options_0_and_1_cannot_be_combined: diag(6370, ts2.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), + Updating_unchanged_output_timestamps_of_project_0: diag(6371, ts2.DiagnosticCategory.Message, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), + Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed: diag(6372, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372", "Project '{0}' is out of date because output of its dependency '{1}' has changed"), + Updating_output_of_project_0: diag(6373, ts2.DiagnosticCategory.Message, "Updating_output_of_project_0_6373", "Updating output of project '{0}'..."), + A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, ts2.DiagnosticCategory.Message, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"), + A_non_dry_build_would_update_output_of_project_0: diag(6375, ts2.DiagnosticCategory.Message, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"), + Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, ts2.DiagnosticCategory.Message, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"), + Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, ts2.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"), + Composite_projects_may_not_disable_incremental_compilation: diag(6379, ts2.DiagnosticCategory.Error, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."), + Specify_file_to_store_incremental_compilation_information: diag(6380, ts2.DiagnosticCategory.Message, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"), + Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"), + Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, ts2.DiagnosticCategory.Message, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"), + Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, ts2.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), + Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, ts2.DiagnosticCategory.Message, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), + _0_is_deprecated: diag( + 6385, + ts2.DiagnosticCategory.Suggestion, + "_0_is_deprecated_6385", + "'{0}' is deprecated.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + void 0, + /*reportsDeprecated*/ + true + ), + Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, ts2.DiagnosticCategory.Message, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), + The_signature_0_of_1_is_deprecated: diag( + 6387, + ts2.DiagnosticCategory.Suggestion, + "The_signature_0_of_1_is_deprecated_6387", + "The signature '{0}' of '{1}' is deprecated.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + void 0, + /*reportsDeprecated*/ + true + ), + Project_0_is_being_forcibly_rebuilt: diag(6388, ts2.DiagnosticCategory.Message, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: diag(6389, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6390, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6391, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved: diag(6392, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6393, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6394, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6395, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6396, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6397, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, ts2.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"), + Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, ts2.DiagnosticCategory.Message, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"), + Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, ts2.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"), + Resolving_in_0_mode_with_conditions_1: diag(6402, ts2.DiagnosticCategory.Message, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."), + Matched_0_condition_1: diag(6403, ts2.DiagnosticCategory.Message, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."), + Using_0_subpath_1_with_target_2: diag(6404, ts2.DiagnosticCategory.Message, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."), + Saw_non_matching_condition_0: diag(6405, ts2.DiagnosticCategory.Message, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."), + The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts2.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), + The_expected_type_comes_from_this_index_signature: diag(6501, ts2.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), + The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts2.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), + Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, ts2.DiagnosticCategory.Message, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), + File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts2.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), + Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, ts2.DiagnosticCategory.Message, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), + Consider_adding_a_declare_modifier_to_this_class: diag(6506, ts2.DiagnosticCategory.Message, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), + Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, ts2.DiagnosticCategory.Message, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."), + Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, ts2.DiagnosticCategory.Message, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), + Allow_accessing_UMD_globals_from_modules: diag(6602, ts2.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), + Disable_error_reporting_for_unreachable_code: diag(6603, ts2.DiagnosticCategory.Message, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), + Disable_error_reporting_for_unused_labels: diag(6604, ts2.DiagnosticCategory.Message, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."), + Ensure_use_strict_is_always_emitted: diag(6605, ts2.DiagnosticCategory.Message, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."), + Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, ts2.DiagnosticCategory.Message, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."), + Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, ts2.DiagnosticCategory.Message, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."), + No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, ts2.DiagnosticCategory.Message, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."), + Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, ts2.DiagnosticCategory.Message, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."), + Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references: diag(6611, ts2.DiagnosticCategory.Message, "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611", "Enable constraints that allow a TypeScript project to be used with project references."), + Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project: diag(6612, ts2.DiagnosticCategory.Message, "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612", "Generate .d.ts files from TypeScript and JavaScript files in your project."), + Specify_the_output_directory_for_generated_declaration_files: diag(6613, ts2.DiagnosticCategory.Message, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."), + Create_sourcemaps_for_d_ts_files: diag(6614, ts2.DiagnosticCategory.Message, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."), + Output_compiler_performance_information_after_building: diag(6615, ts2.DiagnosticCategory.Message, "Output_compiler_performance_information_after_building_6615", "Output compiler performance information after building."), + Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project: diag(6616, ts2.DiagnosticCategory.Message, "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616", "Disables inference for type acquisition by looking at filenames in a project."), + Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, ts2.DiagnosticCategory.Message, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."), + Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, ts2.DiagnosticCategory.Message, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."), + Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, ts2.DiagnosticCategory.Message, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."), + Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, ts2.DiagnosticCategory.Message, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."), + Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, ts2.DiagnosticCategory.Message, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."), + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, ts2.DiagnosticCategory.Message, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."), + Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, ts2.DiagnosticCategory.Message, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."), + Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, ts2.DiagnosticCategory.Message, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."), + Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, ts2.DiagnosticCategory.Message, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"), + Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, ts2.DiagnosticCategory.Message, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."), + Filters_results_from_the_include_option: diag(6627, ts2.DiagnosticCategory.Message, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), + Remove_a_list_of_directories_from_the_watch_process: diag(6628, ts2.DiagnosticCategory.Message, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), + Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, ts2.DiagnosticCategory.Message, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), + Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, ts2.DiagnosticCategory.Message, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), + Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, ts2.DiagnosticCategory.Message, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), + Output_more_detailed_compiler_performance_information_after_building: diag(6632, ts2.DiagnosticCategory.Message, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), + Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, ts2.DiagnosticCategory.Message, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), + Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, ts2.DiagnosticCategory.Message, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."), + Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, ts2.DiagnosticCategory.Message, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."), + Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, ts2.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."), + Ensure_that_casing_is_correct_in_imports: diag(6637, ts2.DiagnosticCategory.Message, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."), + Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, ts2.DiagnosticCategory.Message, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."), + Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, ts2.DiagnosticCategory.Message, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."), + Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: diag(6641, ts2.DiagnosticCategory.Message, "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641", "Specify a list of glob patterns that match files to be included in compilation."), + Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects: diag(6642, ts2.DiagnosticCategory.Message, "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642", "Save .tsbuildinfo files to allow for incremental compilation of projects."), + Include_sourcemap_files_inside_the_emitted_JavaScript: diag(6643, ts2.DiagnosticCategory.Message, "Include_sourcemap_files_inside_the_emitted_JavaScript_6643", "Include sourcemap files inside the emitted JavaScript."), + Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, ts2.DiagnosticCategory.Message, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."), + Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, ts2.DiagnosticCategory.Message, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."), + Specify_what_JSX_code_is_generated: diag(6646, ts2.DiagnosticCategory.Message, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."), + Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, ts2.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."), + Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, ts2.DiagnosticCategory.Message, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."), + Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, ts2.DiagnosticCategory.Message, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."), + Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, ts2.DiagnosticCategory.Message, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."), + Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, ts2.DiagnosticCategory.Message, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."), + Print_the_names_of_emitted_files_after_a_compilation: diag(6652, ts2.DiagnosticCategory.Message, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."), + Print_all_of_the_files_read_during_the_compilation: diag(6653, ts2.DiagnosticCategory.Message, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."), + Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, ts2.DiagnosticCategory.Message, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."), + Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, ts2.DiagnosticCategory.Message, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."), + Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, ts2.DiagnosticCategory.Message, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."), + Specify_what_module_code_is_generated: diag(6657, ts2.DiagnosticCategory.Message, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."), + Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, ts2.DiagnosticCategory.Message, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."), + Set_the_newline_character_for_emitting_files: diag(6659, ts2.DiagnosticCategory.Message, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."), + Disable_emitting_files_from_a_compilation: diag(6660, ts2.DiagnosticCategory.Message, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."), + Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts2.DiagnosticCategory.Message, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."), + Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, ts2.DiagnosticCategory.Message, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."), + Disable_truncating_types_in_error_messages: diag(6663, ts2.DiagnosticCategory.Message, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."), + Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, ts2.DiagnosticCategory.Message, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."), + Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, ts2.DiagnosticCategory.Message, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."), + Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, ts2.DiagnosticCategory.Message, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."), + Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, ts2.DiagnosticCategory.Message, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."), + Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, ts2.DiagnosticCategory.Message, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."), + Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, ts2.DiagnosticCategory.Message, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."), + Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, ts2.DiagnosticCategory.Message, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."), + Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, ts2.DiagnosticCategory.Message, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."), + Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, ts2.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."), + Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, ts2.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."), + Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, ts2.DiagnosticCategory.Message, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."), + Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, ts2.DiagnosticCategory.Message, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."), + Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts2.DiagnosticCategory.Message, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."), + Deprecated_setting_Use_outFile_instead: diag(6677, ts2.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."), + Specify_an_output_folder_for_all_emitted_files: diag(6678, ts2.DiagnosticCategory.Message, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."), + Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, ts2.DiagnosticCategory.Message, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."), + Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, ts2.DiagnosticCategory.Message, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."), + Specify_a_list_of_language_service_plugins_to_include: diag(6681, ts2.DiagnosticCategory.Message, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."), + Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, ts2.DiagnosticCategory.Message, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."), + Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, ts2.DiagnosticCategory.Message, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."), + Disable_wiping_the_console_in_watch_mode: diag(6684, ts2.DiagnosticCategory.Message, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."), + Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, ts2.DiagnosticCategory.Message, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."), + Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, ts2.DiagnosticCategory.Message, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."), + Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, ts2.DiagnosticCategory.Message, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."), + Disable_emitting_comments: diag(6688, ts2.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."), + Enable_importing_json_files: diag(6689, ts2.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files."), + Specify_the_root_folder_within_your_source_files: diag(6690, ts2.DiagnosticCategory.Message, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."), + Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, ts2.DiagnosticCategory.Message, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."), + Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, ts2.DiagnosticCategory.Message, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."), + Skip_type_checking_all_d_ts_files: diag(6693, ts2.DiagnosticCategory.Message, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."), + Create_source_map_files_for_emitted_JavaScript_files: diag(6694, ts2.DiagnosticCategory.Message, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."), + Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, ts2.DiagnosticCategory.Message, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."), + Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, ts2.DiagnosticCategory.Message, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."), + When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, ts2.DiagnosticCategory.Message, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."), + When_type_checking_take_into_account_null_and_undefined: diag(6699, ts2.DiagnosticCategory.Message, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."), + Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, ts2.DiagnosticCategory.Message, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."), + Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, ts2.DiagnosticCategory.Message, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."), + Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, ts2.DiagnosticCategory.Message, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."), + Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, ts2.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."), + Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, ts2.DiagnosticCategory.Message, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."), + Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, ts2.DiagnosticCategory.Message, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."), + Log_paths_used_during_the_moduleResolution_process: diag(6706, ts2.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."), + Specify_the_path_to_tsbuildinfo_incremental_compilation_file: diag(6707, ts2.DiagnosticCategory.Message, "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707", "Specify the path to .tsbuildinfo incremental compilation file."), + Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, ts2.DiagnosticCategory.Message, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."), + Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, ts2.DiagnosticCategory.Message, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."), + Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, ts2.DiagnosticCategory.Message, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."), + Emit_ECMAScript_standard_compliant_class_fields: diag(6712, ts2.DiagnosticCategory.Message, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."), + Enable_verbose_logging: diag(6713, ts2.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging."), + Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, ts2.DiagnosticCategory.Message, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."), + Specify_how_the_TypeScript_watch_mode_works: diag(6715, ts2.DiagnosticCategory.Message, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."), + Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts2.DiagnosticCategory.Message, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), + Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts2.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), + Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts2.DiagnosticCategory.Message, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + one_of_Colon: diag(6900, ts2.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"), + one_or_more_Colon: diag(6901, ts2.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"), + type_Colon: diag(6902, ts2.DiagnosticCategory.Message, "type_Colon_6902", "type:"), + default_Colon: diag(6903, ts2.DiagnosticCategory.Message, "default_Colon_6903", "default:"), + module_system_or_esModuleInterop: diag(6904, ts2.DiagnosticCategory.Message, "module_system_or_esModuleInterop_6904", 'module === "system" or esModuleInterop'), + false_unless_strict_is_set: diag(6905, ts2.DiagnosticCategory.Message, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"), + false_unless_composite_is_set: diag(6906, ts2.DiagnosticCategory.Message, "false_unless_composite_is_set_6906", "`false`, unless `composite` is set"), + node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified: diag(6907, ts2.DiagnosticCategory.Message, "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907", '`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'), + if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk: diag(6908, ts2.DiagnosticCategory.Message, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", '`[]` if `files` is specified, otherwise `["**/*"]`'), + true_if_composite_false_otherwise: diag(6909, ts2.DiagnosticCategory.Message, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"), + module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: diag(69010, ts2.DiagnosticCategory.Message, "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010", "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"), + Computed_from_the_list_of_input_files: diag(6911, ts2.DiagnosticCategory.Message, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"), + Platform_specific: diag(6912, ts2.DiagnosticCategory.Message, "Platform_specific_6912", "Platform specific"), + You_can_learn_about_all_of_the_compiler_options_at_0: diag(6913, ts2.DiagnosticCategory.Message, "You_can_learn_about_all_of_the_compiler_options_at_0_6913", "You can learn about all of the compiler options at {0}"), + Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon: diag(6914, ts2.DiagnosticCategory.Message, "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914", "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"), + Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0: diag(6915, ts2.DiagnosticCategory.Message, "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915", "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"), + COMMON_COMMANDS: diag(6916, ts2.DiagnosticCategory.Message, "COMMON_COMMANDS_6916", "COMMON COMMANDS"), + ALL_COMPILER_OPTIONS: diag(6917, ts2.DiagnosticCategory.Message, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"), + WATCH_OPTIONS: diag(6918, ts2.DiagnosticCategory.Message, "WATCH_OPTIONS_6918", "WATCH OPTIONS"), + BUILD_OPTIONS: diag(6919, ts2.DiagnosticCategory.Message, "BUILD_OPTIONS_6919", "BUILD OPTIONS"), + COMMON_COMPILER_OPTIONS: diag(6920, ts2.DiagnosticCategory.Message, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"), + COMMAND_LINE_FLAGS: diag(6921, ts2.DiagnosticCategory.Message, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"), + tsc_Colon_The_TypeScript_Compiler: diag(6922, ts2.DiagnosticCategory.Message, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"), + Compiles_the_current_project_tsconfig_json_in_the_working_directory: diag(6923, ts2.DiagnosticCategory.Message, "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923", "Compiles the current project (tsconfig.json in the working directory.)"), + Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options: diag(6924, ts2.DiagnosticCategory.Message, "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924", "Ignoring tsconfig.json, compiles the specified files with default compiler options."), + Build_a_composite_project_in_the_working_directory: diag(6925, ts2.DiagnosticCategory.Message, "Build_a_composite_project_in_the_working_directory_6925", "Build a composite project in the working directory."), + Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory: diag(6926, ts2.DiagnosticCategory.Message, "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926", "Creates a tsconfig.json with the recommended settings in the working directory."), + Compiles_the_TypeScript_project_located_at_the_specified_path: diag(6927, ts2.DiagnosticCategory.Message, "Compiles_the_TypeScript_project_located_at_the_specified_path_6927", "Compiles the TypeScript project located at the specified path."), + An_expanded_version_of_this_information_showing_all_possible_compiler_options: diag(6928, ts2.DiagnosticCategory.Message, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"), + Compiles_the_current_project_with_additional_settings: diag(6929, ts2.DiagnosticCategory.Message, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."), + true_for_ES2022_and_above_including_ESNext: diag(6930, ts2.DiagnosticCategory.Message, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."), + List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, ts2.DiagnosticCategory.Error, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."), + Variable_0_implicitly_has_an_1_type: diag(7005, ts2.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), + Parameter_0_implicitly_has_an_1_type: diag(7006, ts2.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), + Member_0_implicitly_has_an_1_type: diag(7008, ts2.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, ts2.DiagnosticCategory.Error, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, ts2.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, ts2.DiagnosticCategory.Error, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, ts2.DiagnosticCategory.Error, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), + Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, ts2.DiagnosticCategory.Error, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, ts2.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), + Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, ts2.DiagnosticCategory.Error, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."), + Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, ts2.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."), + Object_literal_s_property_0_implicitly_has_an_1_type: diag(7018, ts2.DiagnosticCategory.Error, "Object_literal_s_property_0_implicitly_has_an_1_type_7018", "Object literal's property '{0}' implicitly has an '{1}' type."), + Rest_parameter_0_implicitly_has_an_any_type: diag(7019, ts2.DiagnosticCategory.Error, "Rest_parameter_0_implicitly_has_an_any_type_7019", "Rest parameter '{0}' implicitly has an 'any[]' type."), + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7020, ts2.DiagnosticCategory.Error, "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020", "Call signature, which lacks return-type annotation, implicitly has an 'any' return type."), + _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: diag(7022, ts2.DiagnosticCategory.Error, "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022", "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."), + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7023, ts2.DiagnosticCategory.Error, "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7024, ts2.DiagnosticCategory.Error, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), + Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation: diag(7025, ts2.DiagnosticCategory.Error, "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025", "Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."), + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, ts2.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."), + Unreachable_code_detected: diag( + 7027, + ts2.DiagnosticCategory.Error, + "Unreachable_code_detected_7027", + "Unreachable code detected.", + /*reportsUnnecessary*/ + true + ), + Unused_label: diag( + 7028, + ts2.DiagnosticCategory.Error, + "Unused_label_7028", + "Unused label.", + /*reportsUnnecessary*/ + true + ), + Fallthrough_case_in_switch: diag(7029, ts2.DiagnosticCategory.Error, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."), + Not_all_code_paths_return_a_value: diag(7030, ts2.DiagnosticCategory.Error, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."), + Binding_element_0_implicitly_has_an_1_type: diag(7031, ts2.DiagnosticCategory.Error, "Binding_element_0_implicitly_has_an_1_type_7031", "Binding element '{0}' implicitly has an '{1}' type."), + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, ts2.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), + Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, ts2.DiagnosticCategory.Error, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), + Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts2.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), + Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts2.DiagnosticCategory.Error, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts2.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts2.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, ts2.DiagnosticCategory.Message, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts2.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), + If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, ts2.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"), + The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, ts2.DiagnosticCategory.Error, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."), + Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, ts2.DiagnosticCategory.Error, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."), + Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, ts2.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, ts2.DiagnosticCategory.Suggestion, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, ts2.DiagnosticCategory.Suggestion, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, ts2.DiagnosticCategory.Suggestion, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."), + Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, ts2.DiagnosticCategory.Suggestion, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."), + Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, ts2.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), + Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, ts2.DiagnosticCategory.Suggestion, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), + _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, ts2.DiagnosticCategory.Suggestion, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, ts2.DiagnosticCategory.Error, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), + Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, ts2.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"), + Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, ts2.DiagnosticCategory.Error, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), + No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, ts2.DiagnosticCategory.Error, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), + _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, ts2.DiagnosticCategory.Error, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), + The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, ts2.DiagnosticCategory.Error, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), + yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, ts2.DiagnosticCategory.Error, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."), + If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: diag(7058, ts2.DiagnosticCategory.Error, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"), + This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts2.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."), + This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts2.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."), + A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts2.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."), + You_cannot_rename_this_element: diag(8e3, ts2.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts2.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), + import_can_only_be_used_in_TypeScript_files: diag(8002, ts2.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), + export_can_only_be_used_in_TypeScript_files: diag(8003, ts2.DiagnosticCategory.Error, "export_can_only_be_used_in_TypeScript_files_8003", "'export =' can only be used in TypeScript files."), + Type_parameter_declarations_can_only_be_used_in_TypeScript_files: diag(8004, ts2.DiagnosticCategory.Error, "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004", "Type parameter declarations can only be used in TypeScript files."), + implements_clauses_can_only_be_used_in_TypeScript_files: diag(8005, ts2.DiagnosticCategory.Error, "implements_clauses_can_only_be_used_in_TypeScript_files_8005", "'implements' clauses can only be used in TypeScript files."), + _0_declarations_can_only_be_used_in_TypeScript_files: diag(8006, ts2.DiagnosticCategory.Error, "_0_declarations_can_only_be_used_in_TypeScript_files_8006", "'{0}' declarations can only be used in TypeScript files."), + Type_aliases_can_only_be_used_in_TypeScript_files: diag(8008, ts2.DiagnosticCategory.Error, "Type_aliases_can_only_be_used_in_TypeScript_files_8008", "Type aliases can only be used in TypeScript files."), + The_0_modifier_can_only_be_used_in_TypeScript_files: diag(8009, ts2.DiagnosticCategory.Error, "The_0_modifier_can_only_be_used_in_TypeScript_files_8009", "The '{0}' modifier can only be used in TypeScript files."), + Type_annotations_can_only_be_used_in_TypeScript_files: diag(8010, ts2.DiagnosticCategory.Error, "Type_annotations_can_only_be_used_in_TypeScript_files_8010", "Type annotations can only be used in TypeScript files."), + Type_arguments_can_only_be_used_in_TypeScript_files: diag(8011, ts2.DiagnosticCategory.Error, "Type_arguments_can_only_be_used_in_TypeScript_files_8011", "Type arguments can only be used in TypeScript files."), + Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, ts2.DiagnosticCategory.Error, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."), + Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, ts2.DiagnosticCategory.Error, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."), + Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, ts2.DiagnosticCategory.Error, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."), + Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: diag(8017, ts2.DiagnosticCategory.Error, "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", "Octal literal types must use ES2015 syntax. Use the syntax '{0}'."), + Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: diag(8018, ts2.DiagnosticCategory.Error, "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."), + Report_errors_in_js_files: diag(8019, ts2.DiagnosticCategory.Message, "Report_errors_in_js_files_8019", "Report errors in .js files."), + JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, ts2.DiagnosticCategory.Error, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."), + JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, ts2.DiagnosticCategory.Error, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."), + JSDoc_0_is_not_attached_to_a_class: diag(8022, ts2.DiagnosticCategory.Error, "JSDoc_0_is_not_attached_to_a_class_8022", "JSDoc '@{0}' is not attached to a class."), + JSDoc_0_1_does_not_match_the_extends_2_clause: diag(8023, ts2.DiagnosticCategory.Error, "JSDoc_0_1_does_not_match_the_extends_2_clause_8023", "JSDoc '@{0} {1}' does not match the 'extends {2}' clause."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: diag(8024, ts2.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name."), + Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, ts2.DiagnosticCategory.Error, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one '@augments' or '@extends' tag."), + Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, ts2.DiagnosticCategory.Error, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), + Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, ts2.DiagnosticCategory.Error, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), + JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, ts2.DiagnosticCategory.Error, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts2.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), + The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, ts2.DiagnosticCategory.Error, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), + You_cannot_rename_a_module_via_a_global_import: diag(8031, ts2.DiagnosticCategory.Error, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), + Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, ts2.DiagnosticCategory.Error, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), + A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, ts2.DiagnosticCategory.Error, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."), + The_tag_was_first_specified_here: diag(8034, ts2.DiagnosticCategory.Error, "The_tag_was_first_specified_here_8034", "The tag was first specified here."), + You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, ts2.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), + You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, ts2.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), + Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, ts2.DiagnosticCategory.Error, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, ts2.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), + Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, ts2.DiagnosticCategory.Error, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), + JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, ts2.DiagnosticCategory.Error, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), + JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, ts2.DiagnosticCategory.Error, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."), + Expected_corresponding_JSX_closing_tag_for_0: diag(17002, ts2.DiagnosticCategory.Error, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."), + Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, ts2.DiagnosticCategory.Error, "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", "Cannot use JSX unless the '--jsx' flag is provided."), + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: diag(17005, ts2.DiagnosticCategory.Error, "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", "A constructor cannot contain a 'super' call when its class extends 'null'."), + An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17006, ts2.DiagnosticCategory.Error, "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17007, ts2.DiagnosticCategory.Error, "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), + JSX_element_0_has_no_corresponding_closing_tag: diag(17008, ts2.DiagnosticCategory.Error, "JSX_element_0_has_no_corresponding_closing_tag_17008", "JSX element '{0}' has no corresponding closing tag."), + super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: diag(17009, ts2.DiagnosticCategory.Error, "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", "'super' must be called before accessing 'this' in the constructor of a derived class."), + Unknown_type_acquisition_option_0: diag(17010, ts2.DiagnosticCategory.Error, "Unknown_type_acquisition_option_0_17010", "Unknown type acquisition option '{0}'."), + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: diag(17011, ts2.DiagnosticCategory.Error, "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", "'super' must be called before accessing a property of 'super' in the constructor of a derived class."), + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: diag(17012, ts2.DiagnosticCategory.Error, "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"), + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: diag(17013, ts2.DiagnosticCategory.Error, "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."), + JSX_fragment_has_no_corresponding_closing_tag: diag(17014, ts2.DiagnosticCategory.Error, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), + Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, ts2.DiagnosticCategory.Error, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), + The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: diag(17016, ts2.DiagnosticCategory.Error, "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016", "The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."), + An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, ts2.DiagnosticCategory.Error, "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017", "An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."), + Unknown_type_acquisition_option_0_Did_you_mean_1: diag(17018, ts2.DiagnosticCategory.Error, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"), + Circularity_detected_while_resolving_configuration_Colon_0: diag(18e3, ts2.DiagnosticCategory.Error, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), + The_files_list_in_config_file_0_is_empty: diag(18002, ts2.DiagnosticCategory.Error, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), + No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, ts2.DiagnosticCategory.Error, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), + File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, ts2.DiagnosticCategory.Suggestion, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."), + This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, ts2.DiagnosticCategory.Suggestion, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), + Import_may_be_converted_to_a_default_import: diag(80003, ts2.DiagnosticCategory.Suggestion, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), + JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, ts2.DiagnosticCategory.Suggestion, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), + require_call_may_be_converted_to_an_import: diag(80005, ts2.DiagnosticCategory.Suggestion, "require_call_may_be_converted_to_an_import_80005", "'require' call may be converted to an import."), + This_may_be_converted_to_an_async_function: diag(80006, ts2.DiagnosticCategory.Suggestion, "This_may_be_converted_to_an_async_function_80006", "This may be converted to an async function."), + await_has_no_effect_on_the_type_of_this_expression: diag(80007, ts2.DiagnosticCategory.Suggestion, "await_has_no_effect_on_the_type_of_this_expression_80007", "'await' has no effect on the type of this expression."), + Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: diag(80008, ts2.DiagnosticCategory.Suggestion, "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008", "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."), + Add_missing_super_call: diag(90001, ts2.DiagnosticCategory.Message, "Add_missing_super_call_90001", "Add missing 'super()' call"), + Make_super_call_the_first_statement_in_the_constructor: diag(90002, ts2.DiagnosticCategory.Message, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), + Change_extends_to_implements: diag(90003, ts2.DiagnosticCategory.Message, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), + Remove_unused_declaration_for_Colon_0: diag(90004, ts2.DiagnosticCategory.Message, "Remove_unused_declaration_for_Colon_0_90004", "Remove unused declaration for: '{0}'"), + Remove_import_from_0: diag(90005, ts2.DiagnosticCategory.Message, "Remove_import_from_0_90005", "Remove import from '{0}'"), + Implement_interface_0: diag(90006, ts2.DiagnosticCategory.Message, "Implement_interface_0_90006", "Implement interface '{0}'"), + Implement_inherited_abstract_class: diag(90007, ts2.DiagnosticCategory.Message, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), + Add_0_to_unresolved_variable: diag(90008, ts2.DiagnosticCategory.Message, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"), + Remove_variable_statement: diag(90010, ts2.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"), + Remove_template_tag: diag(90011, ts2.DiagnosticCategory.Message, "Remove_template_tag_90011", "Remove template tag"), + Remove_type_parameters: diag(90012, ts2.DiagnosticCategory.Message, "Remove_type_parameters_90012", "Remove type parameters"), + Import_0_from_1: diag(90013, ts2.DiagnosticCategory.Message, "Import_0_from_1_90013", `Import '{0}' from "{1}"`), + Change_0_to_1: diag(90014, ts2.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"), + Declare_property_0: diag(90016, ts2.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'"), + Add_index_signature_for_property_0: diag(90017, ts2.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"), + Disable_checking_for_this_file: diag(90018, ts2.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file"), + Ignore_this_error_message: diag(90019, ts2.DiagnosticCategory.Message, "Ignore_this_error_message_90019", "Ignore this error message"), + Initialize_property_0_in_the_constructor: diag(90020, ts2.DiagnosticCategory.Message, "Initialize_property_0_in_the_constructor_90020", "Initialize property '{0}' in the constructor"), + Initialize_static_property_0: diag(90021, ts2.DiagnosticCategory.Message, "Initialize_static_property_0_90021", "Initialize static property '{0}'"), + Change_spelling_to_0: diag(90022, ts2.DiagnosticCategory.Message, "Change_spelling_to_0_90022", "Change spelling to '{0}'"), + Declare_method_0: diag(90023, ts2.DiagnosticCategory.Message, "Declare_method_0_90023", "Declare method '{0}'"), + Declare_static_method_0: diag(90024, ts2.DiagnosticCategory.Message, "Declare_static_method_0_90024", "Declare static method '{0}'"), + Prefix_0_with_an_underscore: diag(90025, ts2.DiagnosticCategory.Message, "Prefix_0_with_an_underscore_90025", "Prefix '{0}' with an underscore"), + Rewrite_as_the_indexed_access_type_0: diag(90026, ts2.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), + Declare_static_property_0: diag(90027, ts2.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), + Call_decorator_expression: diag(90028, ts2.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts2.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), + Replace_infer_0_with_unknown: diag(90030, ts2.DiagnosticCategory.Message, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"), + Replace_all_unused_infer_with_unknown: diag(90031, ts2.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), + Add_parameter_name: diag(90034, ts2.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, ts2.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"), + Replace_0_with_Promise_1: diag(90036, ts2.DiagnosticCategory.Message, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"), + Fix_all_incorrect_return_type_of_an_async_functions: diag(90037, ts2.DiagnosticCategory.Message, "Fix_all_incorrect_return_type_of_an_async_functions_90037", "Fix all incorrect return type of an async functions"), + Declare_private_method_0: diag(90038, ts2.DiagnosticCategory.Message, "Declare_private_method_0_90038", "Declare private method '{0}'"), + Remove_unused_destructuring_declaration: diag(90039, ts2.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"), + Remove_unused_declarations_for_Colon_0: diag(90041, ts2.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"), + Declare_a_private_field_named_0: diag(90053, ts2.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), + Includes_imports_of_types_referenced_by_0: diag(90054, ts2.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"), + Remove_type_from_import_declaration_from_0: diag(90055, ts2.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", `Remove 'type' from import declaration from "{0}"`), + Remove_type_from_import_of_0_from_1: diag(90056, ts2.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", `Remove 'type' from import of '{0}' from "{1}"`), + Add_import_from_0: diag(90057, ts2.DiagnosticCategory.Message, "Add_import_from_0_90057", 'Add import from "{0}"'), + Update_import_from_0: diag(90058, ts2.DiagnosticCategory.Message, "Update_import_from_0_90058", 'Update import from "{0}"'), + Export_0_from_module_1: diag(90059, ts2.DiagnosticCategory.Message, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"), + Export_all_referenced_locals: diag(90060, ts2.DiagnosticCategory.Message, "Export_all_referenced_locals_90060", "Export all referenced locals"), + Convert_function_to_an_ES2015_class: diag(95001, ts2.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), + Convert_0_to_1_in_0: diag(95003, ts2.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), + Extract_to_0_in_1: diag(95004, ts2.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), + Extract_function: diag(95005, ts2.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), + Extract_constant: diag(95006, ts2.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), + Extract_to_0_in_enclosing_scope: diag(95007, ts2.DiagnosticCategory.Message, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"), + Extract_to_0_in_1_scope: diag(95008, ts2.DiagnosticCategory.Message, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"), + Annotate_with_type_from_JSDoc: diag(95009, ts2.DiagnosticCategory.Message, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"), + Infer_type_of_0_from_usage: diag(95011, ts2.DiagnosticCategory.Message, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"), + Infer_parameter_types_from_usage: diag(95012, ts2.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), + Convert_to_default_import: diag(95013, ts2.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), + Install_0: diag(95014, ts2.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts2.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts2.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES_module: diag(95017, ts2.DiagnosticCategory.Message, "Convert_to_ES_module_95017", "Convert to ES module"), + Add_undefined_type_to_property_0: diag(95018, ts2.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), + Add_initializer_to_property_0: diag(95019, ts2.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), + Add_definite_assignment_assertion_to_property_0: diag(95020, ts2.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), + Convert_all_type_literals_to_mapped_type: diag(95021, ts2.DiagnosticCategory.Message, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), + Add_all_missing_members: diag(95022, ts2.DiagnosticCategory.Message, "Add_all_missing_members_95022", "Add all missing members"), + Infer_all_types_from_usage: diag(95023, ts2.DiagnosticCategory.Message, "Infer_all_types_from_usage_95023", "Infer all types from usage"), + Delete_all_unused_declarations: diag(95024, ts2.DiagnosticCategory.Message, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), + Prefix_all_unused_declarations_with_where_possible: diag(95025, ts2.DiagnosticCategory.Message, "Prefix_all_unused_declarations_with_where_possible_95025", "Prefix all unused declarations with '_' where possible"), + Fix_all_detected_spelling_errors: diag(95026, ts2.DiagnosticCategory.Message, "Fix_all_detected_spelling_errors_95026", "Fix all detected spelling errors"), + Add_initializers_to_all_uninitialized_properties: diag(95027, ts2.DiagnosticCategory.Message, "Add_initializers_to_all_uninitialized_properties_95027", "Add initializers to all uninitialized properties"), + Add_definite_assignment_assertions_to_all_uninitialized_properties: diag(95028, ts2.DiagnosticCategory.Message, "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028", "Add definite assignment assertions to all uninitialized properties"), + Add_undefined_type_to_all_uninitialized_properties: diag(95029, ts2.DiagnosticCategory.Message, "Add_undefined_type_to_all_uninitialized_properties_95029", "Add undefined type to all uninitialized properties"), + Change_all_jsdoc_style_types_to_TypeScript: diag(95030, ts2.DiagnosticCategory.Message, "Change_all_jsdoc_style_types_to_TypeScript_95030", "Change all jsdoc-style types to TypeScript"), + Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: diag(95031, ts2.DiagnosticCategory.Message, "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031", "Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"), + Implement_all_unimplemented_interfaces: diag(95032, ts2.DiagnosticCategory.Message, "Implement_all_unimplemented_interfaces_95032", "Implement all unimplemented interfaces"), + Install_all_missing_types_packages: diag(95033, ts2.DiagnosticCategory.Message, "Install_all_missing_types_packages_95033", "Install all missing types packages"), + Rewrite_all_as_indexed_access_types: diag(95034, ts2.DiagnosticCategory.Message, "Rewrite_all_as_indexed_access_types_95034", "Rewrite all as indexed access types"), + Convert_all_to_default_imports: diag(95035, ts2.DiagnosticCategory.Message, "Convert_all_to_default_imports_95035", "Convert all to default imports"), + Make_all_super_calls_the_first_statement_in_their_constructor: diag(95036, ts2.DiagnosticCategory.Message, "Make_all_super_calls_the_first_statement_in_their_constructor_95036", "Make all 'super()' calls the first statement in their constructor"), + Add_qualifier_to_all_unresolved_variables_matching_a_member_name: diag(95037, ts2.DiagnosticCategory.Message, "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037", "Add qualifier to all unresolved variables matching a member name"), + Change_all_extended_interfaces_to_implements: diag(95038, ts2.DiagnosticCategory.Message, "Change_all_extended_interfaces_to_implements_95038", "Change all extended interfaces to 'implements'"), + Add_all_missing_super_calls: diag(95039, ts2.DiagnosticCategory.Message, "Add_all_missing_super_calls_95039", "Add all missing super calls"), + Implement_all_inherited_abstract_classes: diag(95040, ts2.DiagnosticCategory.Message, "Implement_all_inherited_abstract_classes_95040", "Implement all inherited abstract classes"), + Add_all_missing_async_modifiers: diag(95041, ts2.DiagnosticCategory.Message, "Add_all_missing_async_modifiers_95041", "Add all missing 'async' modifiers"), + Add_ts_ignore_to_all_error_messages: diag(95042, ts2.DiagnosticCategory.Message, "Add_ts_ignore_to_all_error_messages_95042", "Add '@ts-ignore' to all error messages"), + Annotate_everything_with_types_from_JSDoc: diag(95043, ts2.DiagnosticCategory.Message, "Annotate_everything_with_types_from_JSDoc_95043", "Annotate everything with types from JSDoc"), + Add_to_all_uncalled_decorators: diag(95044, ts2.DiagnosticCategory.Message, "Add_to_all_uncalled_decorators_95044", "Add '()' to all uncalled decorators"), + Convert_all_constructor_functions_to_classes: diag(95045, ts2.DiagnosticCategory.Message, "Convert_all_constructor_functions_to_classes_95045", "Convert all constructor functions to classes"), + Generate_get_and_set_accessors: diag(95046, ts2.DiagnosticCategory.Message, "Generate_get_and_set_accessors_95046", "Generate 'get' and 'set' accessors"), + Convert_require_to_import: diag(95047, ts2.DiagnosticCategory.Message, "Convert_require_to_import_95047", "Convert 'require' to 'import'"), + Convert_all_require_to_import: diag(95048, ts2.DiagnosticCategory.Message, "Convert_all_require_to_import_95048", "Convert all 'require' to 'import'"), + Move_to_a_new_file: diag(95049, ts2.DiagnosticCategory.Message, "Move_to_a_new_file_95049", "Move to a new file"), + Remove_unreachable_code: diag(95050, ts2.DiagnosticCategory.Message, "Remove_unreachable_code_95050", "Remove unreachable code"), + Remove_all_unreachable_code: diag(95051, ts2.DiagnosticCategory.Message, "Remove_all_unreachable_code_95051", "Remove all unreachable code"), + Add_missing_typeof: diag(95052, ts2.DiagnosticCategory.Message, "Add_missing_typeof_95052", "Add missing 'typeof'"), + Remove_unused_label: diag(95053, ts2.DiagnosticCategory.Message, "Remove_unused_label_95053", "Remove unused label"), + Remove_all_unused_labels: diag(95054, ts2.DiagnosticCategory.Message, "Remove_all_unused_labels_95054", "Remove all unused labels"), + Convert_0_to_mapped_object_type: diag(95055, ts2.DiagnosticCategory.Message, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"), + Convert_namespace_import_to_named_imports: diag(95056, ts2.DiagnosticCategory.Message, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"), + Convert_named_imports_to_namespace_import: diag(95057, ts2.DiagnosticCategory.Message, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"), + Add_or_remove_braces_in_an_arrow_function: diag(95058, ts2.DiagnosticCategory.Message, "Add_or_remove_braces_in_an_arrow_function_95058", "Add or remove braces in an arrow function"), + Add_braces_to_arrow_function: diag(95059, ts2.DiagnosticCategory.Message, "Add_braces_to_arrow_function_95059", "Add braces to arrow function"), + Remove_braces_from_arrow_function: diag(95060, ts2.DiagnosticCategory.Message, "Remove_braces_from_arrow_function_95060", "Remove braces from arrow function"), + Convert_default_export_to_named_export: diag(95061, ts2.DiagnosticCategory.Message, "Convert_default_export_to_named_export_95061", "Convert default export to named export"), + Convert_named_export_to_default_export: diag(95062, ts2.DiagnosticCategory.Message, "Convert_named_export_to_default_export_95062", "Convert named export to default export"), + Add_missing_enum_member_0: diag(95063, ts2.DiagnosticCategory.Message, "Add_missing_enum_member_0_95063", "Add missing enum member '{0}'"), + Add_all_missing_imports: diag(95064, ts2.DiagnosticCategory.Message, "Add_all_missing_imports_95064", "Add all missing imports"), + Convert_to_async_function: diag(95065, ts2.DiagnosticCategory.Message, "Convert_to_async_function_95065", "Convert to async function"), + Convert_all_to_async_functions: diag(95066, ts2.DiagnosticCategory.Message, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, ts2.DiagnosticCategory.Message, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, ts2.DiagnosticCategory.Message, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), + Add_unknown_conversion_for_non_overlapping_types: diag(95069, ts2.DiagnosticCategory.Message, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), + Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, ts2.DiagnosticCategory.Message, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, ts2.DiagnosticCategory.Message, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, ts2.DiagnosticCategory.Message, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, ts2.DiagnosticCategory.Message, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), + Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, ts2.DiagnosticCategory.Message, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), + Convert_parameters_to_destructured_object: diag(95075, ts2.DiagnosticCategory.Message, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"), + Extract_type: diag(95077, ts2.DiagnosticCategory.Message, "Extract_type_95077", "Extract type"), + Extract_to_type_alias: diag(95078, ts2.DiagnosticCategory.Message, "Extract_to_type_alias_95078", "Extract to type alias"), + Extract_to_typedef: diag(95079, ts2.DiagnosticCategory.Message, "Extract_to_typedef_95079", "Extract to typedef"), + Infer_this_type_of_0_from_usage: diag(95080, ts2.DiagnosticCategory.Message, "Infer_this_type_of_0_from_usage_95080", "Infer 'this' type of '{0}' from usage"), + Add_const_to_unresolved_variable: diag(95081, ts2.DiagnosticCategory.Message, "Add_const_to_unresolved_variable_95081", "Add 'const' to unresolved variable"), + Add_const_to_all_unresolved_variables: diag(95082, ts2.DiagnosticCategory.Message, "Add_const_to_all_unresolved_variables_95082", "Add 'const' to all unresolved variables"), + Add_await: diag(95083, ts2.DiagnosticCategory.Message, "Add_await_95083", "Add 'await'"), + Add_await_to_initializer_for_0: diag(95084, ts2.DiagnosticCategory.Message, "Add_await_to_initializer_for_0_95084", "Add 'await' to initializer for '{0}'"), + Fix_all_expressions_possibly_missing_await: diag(95085, ts2.DiagnosticCategory.Message, "Fix_all_expressions_possibly_missing_await_95085", "Fix all expressions possibly missing 'await'"), + Remove_unnecessary_await: diag(95086, ts2.DiagnosticCategory.Message, "Remove_unnecessary_await_95086", "Remove unnecessary 'await'"), + Remove_all_unnecessary_uses_of_await: diag(95087, ts2.DiagnosticCategory.Message, "Remove_all_unnecessary_uses_of_await_95087", "Remove all unnecessary uses of 'await'"), + Enable_the_jsx_flag_in_your_configuration_file: diag(95088, ts2.DiagnosticCategory.Message, "Enable_the_jsx_flag_in_your_configuration_file_95088", "Enable the '--jsx' flag in your configuration file"), + Add_await_to_initializers: diag(95089, ts2.DiagnosticCategory.Message, "Add_await_to_initializers_95089", "Add 'await' to initializers"), + Extract_to_interface: diag(95090, ts2.DiagnosticCategory.Message, "Extract_to_interface_95090", "Extract to interface"), + Convert_to_a_bigint_numeric_literal: diag(95091, ts2.DiagnosticCategory.Message, "Convert_to_a_bigint_numeric_literal_95091", "Convert to a bigint numeric literal"), + Convert_all_to_bigint_numeric_literals: diag(95092, ts2.DiagnosticCategory.Message, "Convert_all_to_bigint_numeric_literals_95092", "Convert all to bigint numeric literals"), + Convert_const_to_let: diag(95093, ts2.DiagnosticCategory.Message, "Convert_const_to_let_95093", "Convert 'const' to 'let'"), + Prefix_with_declare: diag(95094, ts2.DiagnosticCategory.Message, "Prefix_with_declare_95094", "Prefix with 'declare'"), + Prefix_all_incorrect_property_declarations_with_declare: diag(95095, ts2.DiagnosticCategory.Message, "Prefix_all_incorrect_property_declarations_with_declare_95095", "Prefix all incorrect property declarations with 'declare'"), + Convert_to_template_string: diag(95096, ts2.DiagnosticCategory.Message, "Convert_to_template_string_95096", "Convert to template string"), + Add_export_to_make_this_file_into_a_module: diag(95097, ts2.DiagnosticCategory.Message, "Add_export_to_make_this_file_into_a_module_95097", "Add 'export {}' to make this file into a module"), + Set_the_target_option_in_your_configuration_file_to_0: diag(95098, ts2.DiagnosticCategory.Message, "Set_the_target_option_in_your_configuration_file_to_0_95098", "Set the 'target' option in your configuration file to '{0}'"), + Set_the_module_option_in_your_configuration_file_to_0: diag(95099, ts2.DiagnosticCategory.Message, "Set_the_module_option_in_your_configuration_file_to_0_95099", "Set the 'module' option in your configuration file to '{0}'"), + Convert_invalid_character_to_its_html_entity_code: diag(95100, ts2.DiagnosticCategory.Message, "Convert_invalid_character_to_its_html_entity_code_95100", "Convert invalid character to its html entity code"), + Convert_all_invalid_characters_to_HTML_entity_code: diag(95101, ts2.DiagnosticCategory.Message, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"), + Convert_all_const_to_let: diag(95102, ts2.DiagnosticCategory.Message, "Convert_all_const_to_let_95102", "Convert all 'const' to 'let'"), + Convert_function_expression_0_to_arrow_function: diag(95105, ts2.DiagnosticCategory.Message, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"), + Convert_function_declaration_0_to_arrow_function: diag(95106, ts2.DiagnosticCategory.Message, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"), + Fix_all_implicit_this_errors: diag(95107, ts2.DiagnosticCategory.Message, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"), + Wrap_invalid_character_in_an_expression_container: diag(95108, ts2.DiagnosticCategory.Message, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"), + Wrap_all_invalid_characters_in_an_expression_container: diag(95109, ts2.DiagnosticCategory.Message, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"), + Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: diag(95110, ts2.DiagnosticCategory.Message, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"), + Add_a_return_statement: diag(95111, ts2.DiagnosticCategory.Message, "Add_a_return_statement_95111", "Add a return statement"), + Remove_braces_from_arrow_function_body: diag(95112, ts2.DiagnosticCategory.Message, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"), + Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, ts2.DiagnosticCategory.Message, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"), + Add_all_missing_return_statement: diag(95114, ts2.DiagnosticCategory.Message, "Add_all_missing_return_statement_95114", "Add all missing return statement"), + Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: diag(95115, ts2.DiagnosticCategory.Message, "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115", "Remove braces from all arrow function bodies with relevant issues"), + Wrap_all_object_literal_with_parentheses: diag(95116, ts2.DiagnosticCategory.Message, "Wrap_all_object_literal_with_parentheses_95116", "Wrap all object literal with parentheses"), + Move_labeled_tuple_element_modifiers_to_labels: diag(95117, ts2.DiagnosticCategory.Message, "Move_labeled_tuple_element_modifiers_to_labels_95117", "Move labeled tuple element modifiers to labels"), + Convert_overload_list_to_single_signature: diag(95118, ts2.DiagnosticCategory.Message, "Convert_overload_list_to_single_signature_95118", "Convert overload list to single signature"), + Generate_get_and_set_accessors_for_all_overriding_properties: diag(95119, ts2.DiagnosticCategory.Message, "Generate_get_and_set_accessors_for_all_overriding_properties_95119", "Generate 'get' and 'set' accessors for all overriding properties"), + Wrap_in_JSX_fragment: diag(95120, ts2.DiagnosticCategory.Message, "Wrap_in_JSX_fragment_95120", "Wrap in JSX fragment"), + Wrap_all_unparented_JSX_in_JSX_fragment: diag(95121, ts2.DiagnosticCategory.Message, "Wrap_all_unparented_JSX_in_JSX_fragment_95121", "Wrap all unparented JSX in JSX fragment"), + Convert_arrow_function_or_function_expression: diag(95122, ts2.DiagnosticCategory.Message, "Convert_arrow_function_or_function_expression_95122", "Convert arrow function or function expression"), + Convert_to_anonymous_function: diag(95123, ts2.DiagnosticCategory.Message, "Convert_to_anonymous_function_95123", "Convert to anonymous function"), + Convert_to_named_function: diag(95124, ts2.DiagnosticCategory.Message, "Convert_to_named_function_95124", "Convert to named function"), + Convert_to_arrow_function: diag(95125, ts2.DiagnosticCategory.Message, "Convert_to_arrow_function_95125", "Convert to arrow function"), + Remove_parentheses: diag(95126, ts2.DiagnosticCategory.Message, "Remove_parentheses_95126", "Remove parentheses"), + Could_not_find_a_containing_arrow_function: diag(95127, ts2.DiagnosticCategory.Message, "Could_not_find_a_containing_arrow_function_95127", "Could not find a containing arrow function"), + Containing_function_is_not_an_arrow_function: diag(95128, ts2.DiagnosticCategory.Message, "Containing_function_is_not_an_arrow_function_95128", "Containing function is not an arrow function"), + Could_not_find_export_statement: diag(95129, ts2.DiagnosticCategory.Message, "Could_not_find_export_statement_95129", "Could not find export statement"), + This_file_already_has_a_default_export: diag(95130, ts2.DiagnosticCategory.Message, "This_file_already_has_a_default_export_95130", "This file already has a default export"), + Could_not_find_import_clause: diag(95131, ts2.DiagnosticCategory.Message, "Could_not_find_import_clause_95131", "Could not find import clause"), + Could_not_find_namespace_import_or_named_imports: diag(95132, ts2.DiagnosticCategory.Message, "Could_not_find_namespace_import_or_named_imports_95132", "Could not find namespace import or named imports"), + Selection_is_not_a_valid_type_node: diag(95133, ts2.DiagnosticCategory.Message, "Selection_is_not_a_valid_type_node_95133", "Selection is not a valid type node"), + No_type_could_be_extracted_from_this_type_node: diag(95134, ts2.DiagnosticCategory.Message, "No_type_could_be_extracted_from_this_type_node_95134", "No type could be extracted from this type node"), + Could_not_find_property_for_which_to_generate_accessor: diag(95135, ts2.DiagnosticCategory.Message, "Could_not_find_property_for_which_to_generate_accessor_95135", "Could not find property for which to generate accessor"), + Name_is_not_valid: diag(95136, ts2.DiagnosticCategory.Message, "Name_is_not_valid_95136", "Name is not valid"), + Can_only_convert_property_with_modifier: diag(95137, ts2.DiagnosticCategory.Message, "Can_only_convert_property_with_modifier_95137", "Can only convert property with modifier"), + Switch_each_misused_0_to_1: diag(95138, ts2.DiagnosticCategory.Message, "Switch_each_misused_0_to_1_95138", "Switch each misused '{0}' to '{1}'"), + Convert_to_optional_chain_expression: diag(95139, ts2.DiagnosticCategory.Message, "Convert_to_optional_chain_expression_95139", "Convert to optional chain expression"), + Could_not_find_convertible_access_expression: diag(95140, ts2.DiagnosticCategory.Message, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), + Could_not_find_matching_access_expressions: diag(95141, ts2.DiagnosticCategory.Message, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), + Can_only_convert_logical_AND_access_chains: diag(95142, ts2.DiagnosticCategory.Message, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), + Add_void_to_Promise_resolved_without_a_value: diag(95143, ts2.DiagnosticCategory.Message, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), + Add_void_to_all_Promises_resolved_without_a_value: diag(95144, ts2.DiagnosticCategory.Message, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), + Use_element_access_for_0: diag(95145, ts2.DiagnosticCategory.Message, "Use_element_access_for_0_95145", "Use element access for '{0}'"), + Use_element_access_for_all_undeclared_properties: diag(95146, ts2.DiagnosticCategory.Message, "Use_element_access_for_all_undeclared_properties_95146", "Use element access for all undeclared properties."), + Delete_all_unused_imports: diag(95147, ts2.DiagnosticCategory.Message, "Delete_all_unused_imports_95147", "Delete all unused imports"), + Infer_function_return_type: diag(95148, ts2.DiagnosticCategory.Message, "Infer_function_return_type_95148", "Infer function return type"), + Return_type_must_be_inferred_from_a_function: diag(95149, ts2.DiagnosticCategory.Message, "Return_type_must_be_inferred_from_a_function_95149", "Return type must be inferred from a function"), + Could_not_determine_function_return_type: diag(95150, ts2.DiagnosticCategory.Message, "Could_not_determine_function_return_type_95150", "Could not determine function return type"), + Could_not_convert_to_arrow_function: diag(95151, ts2.DiagnosticCategory.Message, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"), + Could_not_convert_to_named_function: diag(95152, ts2.DiagnosticCategory.Message, "Could_not_convert_to_named_function_95152", "Could not convert to named function"), + Could_not_convert_to_anonymous_function: diag(95153, ts2.DiagnosticCategory.Message, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"), + Can_only_convert_string_concatenation: diag(95154, ts2.DiagnosticCategory.Message, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"), + Selection_is_not_a_valid_statement_or_statements: diag(95155, ts2.DiagnosticCategory.Message, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"), + Add_missing_function_declaration_0: diag(95156, ts2.DiagnosticCategory.Message, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"), + Add_all_missing_function_declarations: diag(95157, ts2.DiagnosticCategory.Message, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"), + Method_not_implemented: diag(95158, ts2.DiagnosticCategory.Message, "Method_not_implemented_95158", "Method not implemented."), + Function_not_implemented: diag(95159, ts2.DiagnosticCategory.Message, "Function_not_implemented_95159", "Function not implemented."), + Add_override_modifier: diag(95160, ts2.DiagnosticCategory.Message, "Add_override_modifier_95160", "Add 'override' modifier"), + Remove_override_modifier: diag(95161, ts2.DiagnosticCategory.Message, "Remove_override_modifier_95161", "Remove 'override' modifier"), + Add_all_missing_override_modifiers: diag(95162, ts2.DiagnosticCategory.Message, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"), + Remove_all_unnecessary_override_modifiers: diag(95163, ts2.DiagnosticCategory.Message, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"), + Can_only_convert_named_export: diag(95164, ts2.DiagnosticCategory.Message, "Can_only_convert_named_export_95164", "Can only convert named export"), + Add_missing_properties: diag(95165, ts2.DiagnosticCategory.Message, "Add_missing_properties_95165", "Add missing properties"), + Add_all_missing_properties: diag(95166, ts2.DiagnosticCategory.Message, "Add_all_missing_properties_95166", "Add all missing properties"), + Add_missing_attributes: diag(95167, ts2.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"), + Add_all_missing_attributes: diag(95168, ts2.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"), + Add_undefined_to_optional_property_type: diag(95169, ts2.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"), + Convert_named_imports_to_default_import: diag(95170, ts2.DiagnosticCategory.Message, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"), + Delete_unused_param_tag_0: diag(95171, ts2.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"), + Delete_all_unused_param_tags: diag(95172, ts2.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"), + Rename_param_tag_name_0_to_1: diag(95173, ts2.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"), + Use_0: diag(95174, ts2.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."), + Use_Number_isNaN_in_all_conditions: diag(95175, ts2.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."), + No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts2.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), + Classes_may_not_have_a_field_named_constructor: diag(18006, ts2.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), + JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts2.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, ts2.DiagnosticCategory.Error, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, ts2.DiagnosticCategory.Error, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), + The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, ts2.DiagnosticCategory.Error, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), + constructor_is_a_reserved_word: diag(18012, ts2.DiagnosticCategory.Error, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), + Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: diag(18013, ts2.DiagnosticCategory.Error, "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013", "Property '{0}' is not accessible outside class '{1}' because it has a private identifier."), + The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: diag(18014, ts2.DiagnosticCategory.Error, "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014", "The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."), + Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: diag(18015, ts2.DiagnosticCategory.Error, "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015", "Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."), + Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, ts2.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), + The_shadowing_declaration_of_0_is_defined_here: diag(18017, ts2.DiagnosticCategory.Error, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), + The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, ts2.DiagnosticCategory.Error, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, ts2.DiagnosticCategory.Error, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, ts2.DiagnosticCategory.Error, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), + can_only_be_used_at_the_start_of_a_file: diag(18026, ts2.DiagnosticCategory.Error, "can_only_be_used_at_the_start_of_a_file_18026", "'#!' can only be used at the start of a file."), + Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: diag(18027, ts2.DiagnosticCategory.Error, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."), + Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18028, ts2.DiagnosticCategory.Error, "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028", "Private identifiers are only available when targeting ECMAScript 2015 and higher."), + Private_identifiers_are_not_allowed_in_variable_declarations: diag(18029, ts2.DiagnosticCategory.Error, "Private_identifiers_are_not_allowed_in_variable_declarations_18029", "Private identifiers are not allowed in variable declarations."), + An_optional_chain_cannot_contain_private_identifiers: diag(18030, ts2.DiagnosticCategory.Error, "An_optional_chain_cannot_contain_private_identifiers_18030", "An optional chain cannot contain private identifiers."), + The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: diag(18031, ts2.DiagnosticCategory.Error, "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031", "The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."), + The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: diag(18032, ts2.DiagnosticCategory.Error, "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032", "The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."), + Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead: diag(18033, ts2.DiagnosticCategory.Error, "Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033", "Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."), + Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, ts2.DiagnosticCategory.Message, "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034", "Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."), + Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(18035, ts2.DiagnosticCategory.Error, "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035", "Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."), + Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator: diag(18036, ts2.DiagnosticCategory.Error, "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036", "Class decorators can't be used with static private identifier. Consider removing the experimental decorator."), + Await_expression_cannot_be_used_inside_a_class_static_block: diag(18037, ts2.DiagnosticCategory.Error, "Await_expression_cannot_be_used_inside_a_class_static_block_18037", "Await expression cannot be used inside a class static block."), + For_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, ts2.DiagnosticCategory.Error, "For_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'For await' loops cannot be used inside a class static block."), + Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, ts2.DiagnosticCategory.Error, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."), + A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, ts2.DiagnosticCategory.Error, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."), + _0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, ts2.DiagnosticCategory.Error, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."), + Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, ts2.DiagnosticCategory.Error, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."), + _0_is_automatically_exported_here: diag(18044, ts2.DiagnosticCategory.Message, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."), + Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18045, ts2.DiagnosticCategory.Error, "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045", "Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."), + _0_is_of_type_unknown: diag(18046, ts2.DiagnosticCategory.Error, "_0_is_of_type_unknown_18046", "'{0}' is of type 'unknown'."), + _0_is_possibly_null: diag(18047, ts2.DiagnosticCategory.Error, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), + _0_is_possibly_undefined: diag(18048, ts2.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), + _0_is_possibly_null_or_undefined: diag(18049, ts2.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), + The_value_0_cannot_be_used_here: diag(18050, ts2.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here.") + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var _a2; + function tokenIsIdentifierOrKeyword(token) { + return token >= 79; + } + ts2.tokenIsIdentifierOrKeyword = tokenIsIdentifierOrKeyword; + function tokenIsIdentifierOrKeywordOrGreaterThan(token) { + return token === 31 || tokenIsIdentifierOrKeyword(token); + } + ts2.tokenIsIdentifierOrKeywordOrGreaterThan = tokenIsIdentifierOrKeywordOrGreaterThan; + ts2.textToKeywordObj = (_a2 = { + abstract: 126, + accessor: 127, + any: 131, + as: 128, + asserts: 129, + assert: 130, + bigint: 160, + boolean: 134, + break: 81, + case: 82, + catch: 83, + class: 84, + continue: 86, + const: 85 + /* SyntaxKind.ConstKeyword */ + }, _a2["constructor"] = 135, _a2.debugger = 87, _a2.declare = 136, _a2.default = 88, _a2.delete = 89, _a2.do = 90, _a2.else = 91, _a2.enum = 92, _a2.export = 93, _a2.extends = 94, _a2.false = 95, _a2.finally = 96, _a2.for = 97, _a2.from = 158, _a2.function = 98, _a2.get = 137, _a2.if = 99, _a2.implements = 117, _a2.import = 100, _a2.in = 101, _a2.infer = 138, _a2.instanceof = 102, _a2.interface = 118, _a2.intrinsic = 139, _a2.is = 140, _a2.keyof = 141, _a2.let = 119, _a2.module = 142, _a2.namespace = 143, _a2.never = 144, _a2.new = 103, _a2.null = 104, _a2.number = 148, _a2.object = 149, _a2.package = 120, _a2.private = 121, _a2.protected = 122, _a2.public = 123, _a2.override = 161, _a2.out = 145, _a2.readonly = 146, _a2.require = 147, _a2.global = 159, _a2.return = 105, _a2.satisfies = 150, _a2.set = 151, _a2.static = 124, _a2.string = 152, _a2.super = 106, _a2.switch = 107, _a2.symbol = 153, _a2.this = 108, _a2.throw = 109, _a2.true = 110, _a2.try = 111, _a2.type = 154, _a2.typeof = 112, _a2.undefined = 155, _a2.unique = 156, _a2.unknown = 157, _a2.var = 113, _a2.void = 114, _a2.while = 115, _a2.with = 116, _a2.yield = 125, _a2.async = 132, _a2.await = 133, _a2.of = 162, _a2); + var textToKeyword = new ts2.Map(ts2.getEntries(ts2.textToKeywordObj)); + var textToToken = new ts2.Map(ts2.getEntries(__assign16(__assign16({}, ts2.textToKeywordObj), { + "{": 18, + "}": 19, + "(": 20, + ")": 21, + "[": 22, + "]": 23, + ".": 24, + "...": 25, + ";": 26, + ",": 27, + "<": 29, + ">": 31, + "<=": 32, + ">=": 33, + "==": 34, + "!=": 35, + "===": 36, + "!==": 37, + "=>": 38, + "+": 39, + "-": 40, + "**": 42, + "*": 41, + "/": 43, + "%": 44, + "++": 45, + "--": 46, + "<<": 47, + ">": 48, + ">>>": 49, + "&": 50, + "|": 51, + "^": 52, + "!": 53, + "~": 54, + "&&": 55, + "||": 56, + "?": 57, + "??": 60, + "?.": 28, + ":": 58, + "=": 63, + "+=": 64, + "-=": 65, + "*=": 66, + "**=": 67, + "/=": 68, + "%=": 69, + "<<=": 70, + ">>=": 71, + ">>>=": 72, + "&=": 73, + "|=": 74, + "^=": 78, + "||=": 75, + "&&=": 76, + "??=": 77, + "@": 59, + "#": 62, + "`": 61 + /* SyntaxKind.BacktickToken */ + }))); + var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; + var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/; + var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/; + function lookupInUnicodeMap(code, map4) { + if (code < map4[0]) { + return false; + } + var lo = 0; + var hi = map4.length; + var mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map4[mid] <= code && code <= map4[mid + 1]) { + return true; + } + if (code < map4[mid]) { + hi = mid; + } else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion >= 2 ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : languageVersion === 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); + } + ts2.isUnicodeIdentifierStart = isUnicodeIdentifierStart; + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion >= 2 ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : languageVersion === 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); + } + function makeReverseMap(source) { + var result2 = []; + source.forEach(function(value2, name2) { + result2[value2] = name2; + }); + return result2; + } + var tokenStrings = makeReverseMap(textToToken); + function tokenToString(t8) { + return tokenStrings[t8]; + } + ts2.tokenToString = tokenToString; + function stringToToken(s7) { + return textToToken.get(s7); + } + ts2.stringToToken = stringToToken; + function computeLineStarts(text) { + var result2 = []; + var pos = 0; + var lineStart = 0; + while (pos < text.length) { + var ch = text.charCodeAt(pos); + pos++; + switch (ch) { + case 13: + if (text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + result2.push(lineStart); + lineStart = pos; + break; + default: + if (ch > 127 && isLineBreak2(ch)) { + result2.push(lineStart); + lineStart = pos; + } + break; + } + } + result2.push(lineStart); + return result2; + } + ts2.computeLineStarts = computeLineStarts; + function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) { + return sourceFile.getPositionOfLineAndCharacter ? sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); + } + ts2.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { + if (line < 0 || line >= lineStarts.length) { + if (allowEdits) { + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } else { + ts2.Debug.fail("Bad line number. Line: ".concat(line, ", lineStarts.length: ").concat(lineStarts.length, " , line map is correct? ").concat(debugText !== void 0 ? ts2.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } + } + var res = lineStarts[line] + character; + if (allowEdits) { + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } + if (line < lineStarts.length - 1) { + ts2.Debug.assert(res < lineStarts[line + 1]); + } else if (debugText !== void 0) { + ts2.Debug.assert(res <= debugText.length); + } + return res; + } + ts2.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter; + function getLineStarts(sourceFile) { + return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); + } + ts2.getLineStarts = getLineStarts; + function computeLineAndCharacterOfPosition(lineStarts, position) { + var lineNumber = computeLineOfPosition(lineStarts, position); + return { + line: lineNumber, + character: position - lineStarts[lineNumber] + }; + } + ts2.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition; + function computeLineOfPosition(lineStarts, position, lowerBound) { + var lineNumber = ts2.binarySearch(lineStarts, position, ts2.identity, ts2.compareValues, lowerBound); + if (lineNumber < 0) { + lineNumber = ~lineNumber - 1; + ts2.Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file"); + } + return lineNumber; + } + ts2.computeLineOfPosition = computeLineOfPosition; + function getLinesBetweenPositions(sourceFile, pos1, pos2) { + if (pos1 === pos2) + return 0; + var lineStarts = getLineStarts(sourceFile); + var lower = Math.min(pos1, pos2); + var isNegative = lower === pos2; + var upper = isNegative ? pos1 : pos2; + var lowerLine = computeLineOfPosition(lineStarts, lower); + var upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); + return isNegative ? lowerLine - upperLine : upperLine - lowerLine; + } + ts2.getLinesBetweenPositions = getLinesBetweenPositions; + function getLineAndCharacterOfPosition(sourceFile, position) { + return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); + } + ts2.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; + function isWhiteSpaceLike(ch) { + return isWhiteSpaceSingleLine(ch) || isLineBreak2(ch); + } + ts2.isWhiteSpaceLike = isWhiteSpaceLike; + function isWhiteSpaceSingleLine(ch) { + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 133 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + } + ts2.isWhiteSpaceSingleLine = isWhiteSpaceSingleLine; + function isLineBreak2(ch) { + return ch === 10 || ch === 13 || ch === 8232 || ch === 8233; + } + ts2.isLineBreak = isLineBreak2; + function isDigit2(ch) { + return ch >= 48 && ch <= 57; + } + function isHexDigit(ch) { + return isDigit2(ch) || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; + } + function isCodePoint(code) { + return code <= 1114111; + } + function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; + } + ts2.isOctalDigit = isOctalDigit; + function couldStartTrivia(text, pos) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13: + case 10: + case 9: + case 11: + case 12: + case 32: + case 47: + case 60: + case 124: + case 61: + case 62: + return true; + case 35: + return pos === 0; + default: + return ch > 127; + } + } + ts2.couldStartTrivia = couldStartTrivia; + function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) { + if (ts2.positionIsSynthesized(pos)) { + return pos; + } + var canConsumeStar = false; + while (true) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13: + if (text.charCodeAt(pos + 1) === 10) { + pos++; + } + case 10: + pos++; + if (stopAfterLineBreak) { + return pos; + } + canConsumeStar = !!inJSDoc; + continue; + case 9: + case 11: + case 12: + case 32: + pos++; + continue; + case 47: + if (stopAtComments) { + break; + } + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + while (pos < text.length) { + if (isLineBreak2(text.charCodeAt(pos))) { + break; + } + pos++; + } + canConsumeStar = false; + continue; + } + if (text.charCodeAt(pos + 1) === 42) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + break; + } + pos++; + } + canConsumeStar = false; + continue; + } + break; + case 60: + case 124: + case 61: + case 62: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos); + canConsumeStar = false; + continue; + } + break; + case 35: + if (pos === 0 && isShebangTrivia(text, pos)) { + pos = scanShebangTrivia(text, pos); + canConsumeStar = false; + continue; + } + break; + case 42: + if (canConsumeStar) { + pos++; + canConsumeStar = false; + continue; + } + break; + default: + if (ch > 127 && isWhiteSpaceLike(ch)) { + pos++; + continue; + } + break; + } + return pos; + } + } + ts2.skipTrivia = skipTrivia; + var mergeConflictMarkerLength = "<<<<<<<".length; + function isConflictMarkerTrivia(text, pos) { + ts2.Debug.assert(pos >= 0); + if (pos === 0 || isLineBreak2(text.charCodeAt(pos - 1))) { + var ch = text.charCodeAt(pos); + if (pos + mergeConflictMarkerLength < text.length) { + for (var i7 = 0; i7 < mergeConflictMarkerLength; i7++) { + if (text.charCodeAt(pos + i7) !== ch) { + return false; + } + } + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + } + } + return false; + } + function scanConflictMarkerTrivia(text, pos, error2) { + if (error2) { + error2(ts2.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); + } + var ch = text.charCodeAt(pos); + var len = text.length; + if (ch === 60 || ch === 62) { + while (pos < len && !isLineBreak2(text.charCodeAt(pos))) { + pos++; + } + } else { + ts2.Debug.assert( + ch === 124 || ch === 61 + /* CharacterCodes.equals */ + ); + while (pos < len) { + var currentChar = text.charCodeAt(pos); + if ((currentChar === 61 || currentChar === 62) && currentChar !== ch && isConflictMarkerTrivia(text, pos)) { + break; + } + pos++; + } + } + return pos; + } + var shebangTriviaRegex = /^#!.*/; + function isShebangTrivia(text, pos) { + ts2.Debug.assert(pos === 0); + return shebangTriviaRegex.test(text); + } + ts2.isShebangTrivia = isShebangTrivia; + function scanShebangTrivia(text, pos) { + var shebang = shebangTriviaRegex.exec(text)[0]; + pos = pos + shebang.length; + return pos; + } + ts2.scanShebangTrivia = scanShebangTrivia; + function iterateCommentRanges(reduce2, text, pos, trailing, cb, state, initial2) { + var pendingPos; + var pendingEnd; + var pendingKind; + var pendingHasTrailingNewLine; + var hasPendingCommentRange = false; + var collecting = trailing; + var accumulator = initial2; + if (pos === 0) { + collecting = true; + var shebang = getShebang(text); + if (shebang) { + pos = shebang.length; + } + } + scan: + while (pos >= 0 && pos < text.length) { + var ch = text.charCodeAt(pos); + switch (ch) { + case 13: + if (text.charCodeAt(pos + 1) === 10) { + pos++; + } + case 10: + pos++; + if (trailing) { + break scan; + } + collecting = true; + if (hasPendingCommentRange) { + pendingHasTrailingNewLine = true; + } + continue; + case 9: + case 11: + case 12: + case 32: + pos++; + continue; + case 47: + var nextChar = text.charCodeAt(pos + 1); + var hasTrailingNewLine = false; + if (nextChar === 47 || nextChar === 42) { + var kind = nextChar === 47 ? 2 : 3; + var startPos = pos; + pos += 2; + if (nextChar === 47) { + while (pos < text.length) { + if (isLineBreak2(text.charCodeAt(pos))) { + hasTrailingNewLine = true; + break; + } + pos++; + } + } else { + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + break; + } + pos++; + } + } + if (collecting) { + if (hasPendingCommentRange) { + accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); + if (!reduce2 && accumulator) { + return accumulator; + } + } + pendingPos = startPos; + pendingEnd = pos; + pendingKind = kind; + pendingHasTrailingNewLine = hasTrailingNewLine; + hasPendingCommentRange = true; + } + continue; + } + break scan; + default: + if (ch > 127 && isWhiteSpaceLike(ch)) { + if (hasPendingCommentRange && isLineBreak2(ch)) { + pendingHasTrailingNewLine = true; + } + pos++; + continue; + } + break scan; + } + } + if (hasPendingCommentRange) { + accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); + } + return accumulator; + } + function forEachLeadingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + false, + cb, + state + ); + } + ts2.forEachLeadingCommentRange = forEachLeadingCommentRange; + function forEachTrailingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + true, + cb, + state + ); + } + ts2.forEachTrailingCommentRange = forEachTrailingCommentRange; + function reduceEachLeadingCommentRange(text, pos, cb, state, initial2) { + return iterateCommentRanges( + /*reduce*/ + true, + text, + pos, + /*trailing*/ + false, + cb, + state, + initial2 + ); + } + ts2.reduceEachLeadingCommentRange = reduceEachLeadingCommentRange; + function reduceEachTrailingCommentRange(text, pos, cb, state, initial2) { + return iterateCommentRanges( + /*reduce*/ + true, + text, + pos, + /*trailing*/ + true, + cb, + state, + initial2 + ); + } + ts2.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange; + function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { + if (!comments) { + comments = []; + } + comments.push({ kind, pos, end, hasTrailingNewLine }); + return comments; + } + function getLeadingCommentRanges(text, pos) { + return reduceEachLeadingCommentRange( + text, + pos, + appendCommentRange, + /*state*/ + void 0, + /*initial*/ + void 0 + ); + } + ts2.getLeadingCommentRanges = getLeadingCommentRanges; + function getTrailingCommentRanges(text, pos) { + return reduceEachTrailingCommentRange( + text, + pos, + appendCommentRange, + /*state*/ + void 0, + /*initial*/ + void 0 + ); + } + ts2.getTrailingCommentRanges = getTrailingCommentRanges; + function getShebang(text) { + var match = shebangTriviaRegex.exec(text); + if (match) { + return match[0]; + } + } + ts2.getShebang = getShebang; + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + } + ts2.isIdentifierStart = isIdentifierStart; + function isIdentifierPart(ch, languageVersion, identifierVariant) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || // "-" and ":" are valid in JSX Identifiers + (identifierVariant === 1 ? ch === 45 || ch === 58 : false) || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + } + ts2.isIdentifierPart = isIdentifierPart; + function isIdentifierText(name2, languageVersion, identifierVariant) { + var ch = codePointAt2(name2, 0); + if (!isIdentifierStart(ch, languageVersion)) { + return false; + } + for (var i7 = charSize(ch); i7 < name2.length; i7 += charSize(ch)) { + if (!isIdentifierPart(ch = codePointAt2(name2, i7), languageVersion, identifierVariant)) { + return false; + } + } + return true; + } + ts2.isIdentifierText = isIdentifierText; + function createScanner3(languageVersion, skipTrivia2, languageVariant, textInitial, onError, start, length) { + if (languageVariant === void 0) { + languageVariant = 0; + } + var text = textInitial; + var pos; + var end; + var startPos; + var tokenPos; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; + setText(text, start, length); + var scanner = { + getStartPos: function() { + return startPos; + }, + getTextPos: function() { + return pos; + }, + getToken: function() { + return token; + }, + getTokenPos: function() { + return tokenPos; + }, + getTokenText: function() { + return text.substring(tokenPos, pos); + }, + getTokenValue: function() { + return tokenValue; + }, + hasUnicodeEscape: function() { + return (tokenFlags & 1024) !== 0; + }, + hasExtendedUnicodeEscape: function() { + return (tokenFlags & 8) !== 0; + }, + hasPrecedingLineBreak: function() { + return (tokenFlags & 1) !== 0; + }, + hasPrecedingJSDocComment: function() { + return (tokenFlags & 2) !== 0; + }, + isIdentifier: function() { + return token === 79 || token > 116; + }, + isReservedWord: function() { + return token >= 81 && token <= 116; + }, + isUnterminated: function() { + return (tokenFlags & 4) !== 0; + }, + getCommentDirectives: function() { + return commentDirectives; + }, + getNumericLiteralFlags: function() { + return tokenFlags & 1008; + }, + getTokenFlags: function() { + return tokenFlags; + }, + reScanGreaterToken, + reScanAsteriskEqualsToken, + reScanSlashToken, + reScanTemplateToken, + reScanTemplateHeadOrNoSubstitutionTemplate, + scanJsxIdentifier, + scanJsxAttributeValue, + reScanJsxAttributeValue, + reScanJsxToken, + reScanLessThanToken, + reScanHashToken, + reScanQuestionToken, + reScanInvalidIdentifier, + scanJsxToken, + scanJsDocToken, + scan, + getText, + clearCommentDirectives, + setText, + setScriptTarget, + setLanguageVariant, + setOnError, + setTextPos, + setInJSDocType, + tryScan, + lookAhead, + scanRange + }; + if (ts2.Debug.isDebugging) { + Object.defineProperty(scanner, "__debugShowCurrentPositionInText", { + get: function() { + var text2 = scanner.getText(); + return text2.slice(0, scanner.getStartPos()) + "\u2551" + text2.slice(scanner.getStartPos()); + } + }); + } + return scanner; + function error2(message, errPos, length2) { + if (errPos === void 0) { + errPos = pos; + } + if (onError) { + var oldPos = pos; + pos = errPos; + onError(message, length2 || 0); + pos = oldPos; + } + } + function scanNumberFragment() { + var start2 = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result2 = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result2 += text.substring(start2, pos); + } else if (isPreviousTokenSeparator) { + error2(ts2.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start2 = pos; + continue; + } + if (isDigit2(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95) { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result2 + text.substring(start2, pos); + } + function scanNumber() { + var start2 = pos; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; + if (text.charCodeAt(pos) === 46) { + pos++; + decimalFragment = scanNumberFragment(); + } + var end2 = pos; + if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { + pos++; + tokenFlags |= 16; + if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) + pos++; + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { + error2(ts2.Diagnostics.Digit_expected); + } else { + scientificFragment = text.substring(end2, preNumericPart) + finalFragment; + end2 = pos; + } + } + var result2; + if (tokenFlags & 512) { + result2 = mainFragment; + if (decimalFragment) { + result2 += "." + decimalFragment; + } + if (scientificFragment) { + result2 += scientificFragment; + } + } else { + result2 = text.substring(start2, end2); + } + if (decimalFragment !== void 0 || tokenFlags & 16) { + checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16)); + return { + type: 8, + value: "" + +result2 + // if value is not an integer, it can be safely coerced to a number + }; + } else { + tokenValue = result2; + var type3 = checkBigIntSuffix(); + checkForIdentifierStartAfterNumericLiteral(start2); + return { type: type3, value: tokenValue }; + } + } + function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { + if (!isIdentifierStart(codePointAt2(text, pos), languageVersion)) { + return; + } + var identifierStart = pos; + var length2 = scanIdentifierParts().length; + if (length2 === 1 && text[identifierStart] === "n") { + if (isScientific) { + error2(ts2.Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); + } else { + error2(ts2.Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); + } + } else { + error2(ts2.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length2); + pos = identifierStart; + } + } + function scanOctalDigits() { + var start2 = pos; + while (isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + return +text.substring(start2, pos); + } + function scanExactNumberOfHexDigits(count2, canHaveSeparators) { + var valueString = scanHexDigits( + /*minCount*/ + count2, + /*scanAsManyAsPossible*/ + false, + canHaveSeparators + ); + return valueString ? parseInt(valueString, 16) : -1; + } + function scanMinimumNumberOfHexDigits(count2, canHaveSeparators) { + return scanHexDigits( + /*minCount*/ + count2, + /*scanAsManyAsPossible*/ + true, + canHaveSeparators + ); + } + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { + var valueChars = []; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + while (valueChars.length < minCount || scanAsManyAsPossible) { + var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } else if (isPreviousTokenSeparator) { + error2(ts2.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; + if (ch >= 65 && ch <= 70) { + ch += 97 - 65; + } else if (!(ch >= 48 && ch <= 57 || ch >= 97 && ch <= 102)) { + break; + } + valueChars.push(ch); + pos++; + isPreviousTokenSeparator = false; + } + if (valueChars.length < minCount) { + valueChars = []; + } + if (text.charCodeAt(pos - 1) === 95) { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return String.fromCharCode.apply(String, valueChars); + } + function scanString(jsxAttributeString) { + if (jsxAttributeString === void 0) { + jsxAttributeString = false; + } + var quote = text.charCodeAt(pos); + pos++; + var result2 = ""; + var start2 = pos; + while (true) { + if (pos >= end) { + result2 += text.substring(start2, pos); + tokenFlags |= 4; + error2(ts2.Diagnostics.Unterminated_string_literal); + break; + } + var ch = text.charCodeAt(pos); + if (ch === quote) { + result2 += text.substring(start2, pos); + pos++; + break; + } + if (ch === 92 && !jsxAttributeString) { + result2 += text.substring(start2, pos); + result2 += scanEscapeSequence(); + start2 = pos; + continue; + } + if (isLineBreak2(ch) && !jsxAttributeString) { + result2 += text.substring(start2, pos); + tokenFlags |= 4; + error2(ts2.Diagnostics.Unterminated_string_literal); + break; + } + pos++; + } + return result2; + } + function scanTemplateAndSetTokenValue(isTaggedTemplate) { + var startedWithBacktick = text.charCodeAt(pos) === 96; + pos++; + var start2 = pos; + var contents = ""; + var resultingToken; + while (true) { + if (pos >= end) { + contents += text.substring(start2, pos); + tokenFlags |= 4; + error2(ts2.Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 14 : 17; + break; + } + var currChar = text.charCodeAt(pos); + if (currChar === 96) { + contents += text.substring(start2, pos); + pos++; + resultingToken = startedWithBacktick ? 14 : 17; + break; + } + if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) { + contents += text.substring(start2, pos); + pos += 2; + resultingToken = startedWithBacktick ? 15 : 16; + break; + } + if (currChar === 92) { + contents += text.substring(start2, pos); + contents += scanEscapeSequence(isTaggedTemplate); + start2 = pos; + continue; + } + if (currChar === 13) { + contents += text.substring(start2, pos); + pos++; + if (pos < end && text.charCodeAt(pos) === 10) { + pos++; + } + contents += "\n"; + start2 = pos; + continue; + } + pos++; + } + ts2.Debug.assert(resultingToken !== void 0); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence(isTaggedTemplate) { + var start2 = pos; + pos++; + if (pos >= end) { + error2(ts2.Diagnostics.Unexpected_end_of_text); + return ""; + } + var ch = text.charCodeAt(pos); + pos++; + switch (ch) { + case 48: + if (isTaggedTemplate && pos < end && isDigit2(text.charCodeAt(pos))) { + pos++; + tokenFlags |= 2048; + return text.substring(start2, pos); + } + return "\0"; + case 98: + return "\b"; + case 116: + return " "; + case 110: + return "\n"; + case 118: + return "\v"; + case 102: + return "\f"; + case 114: + return "\r"; + case 39: + return "'"; + case 34: + return '"'; + case 117: + if (isTaggedTemplate) { + for (var escapePos = pos; escapePos < pos + 4; escapePos++) { + if (escapePos < end && !isHexDigit(text.charCodeAt(escapePos)) && text.charCodeAt(escapePos) !== 123) { + pos = escapePos; + tokenFlags |= 2048; + return text.substring(start2, pos); + } + } + } + if (pos < end && text.charCodeAt(pos) === 123) { + pos++; + if (isTaggedTemplate && !isHexDigit(text.charCodeAt(pos))) { + tokenFlags |= 2048; + return text.substring(start2, pos); + } + if (isTaggedTemplate) { + var savePos = pos; + var escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + if (!isCodePoint(escapedValue) || text.charCodeAt(pos) !== 125) { + tokenFlags |= 2048; + return text.substring(start2, pos); + } else { + pos = savePos; + } + } + tokenFlags |= 8; + return scanExtendedUnicodeEscape(); + } + tokenFlags |= 1024; + return scanHexadecimalEscape( + /*numDigits*/ + 4 + ); + case 120: + if (isTaggedTemplate) { + if (!isHexDigit(text.charCodeAt(pos))) { + tokenFlags |= 2048; + return text.substring(start2, pos); + } else if (!isHexDigit(text.charCodeAt(pos + 1))) { + pos++; + tokenFlags |= 2048; + return text.substring(start2, pos); + } + } + return scanHexadecimalEscape( + /*numDigits*/ + 2 + ); + case 13: + if (pos < end && text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + case 8232: + case 8233: + return ""; + default: + return String.fromCharCode(ch); + } + } + function scanHexadecimalEscape(numDigits) { + var escapedValue = scanExactNumberOfHexDigits( + numDigits, + /*canHaveSeparators*/ + false + ); + if (escapedValue >= 0) { + return String.fromCharCode(escapedValue); + } else { + error2(ts2.Diagnostics.Hexadecimal_digit_expected); + return ""; + } + } + function scanExtendedUnicodeEscape() { + var escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + var isInvalidExtendedEscape = false; + if (escapedValue < 0) { + error2(ts2.Diagnostics.Hexadecimal_digit_expected); + isInvalidExtendedEscape = true; + } else if (escapedValue > 1114111) { + error2(ts2.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); + isInvalidExtendedEscape = true; + } + if (pos >= end) { + error2(ts2.Diagnostics.Unexpected_end_of_text); + isInvalidExtendedEscape = true; + } else if (text.charCodeAt(pos) === 125) { + pos++; + } else { + error2(ts2.Diagnostics.Unterminated_Unicode_escape_sequence); + isInvalidExtendedEscape = true; + } + if (isInvalidExtendedEscape) { + return ""; + } + return utf16EncodeAsString(escapedValue); + } + function peekUnicodeEscape() { + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { + var start_1 = pos; + pos += 2; + var value2 = scanExactNumberOfHexDigits( + 4, + /*canHaveSeparators*/ + false + ); + pos = start_1; + return value2; + } + return -1; + } + function peekExtendedUnicodeEscape() { + if (codePointAt2(text, pos + 1) === 117 && codePointAt2(text, pos + 2) === 123) { + var start_2 = pos; + pos += 3; + var escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + var escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + pos = start_2; + return escapedValue; + } + return -1; + } + function scanIdentifierParts() { + var result2 = ""; + var start2 = pos; + while (pos < end) { + var ch = codePointAt2(text, pos); + if (isIdentifierPart(ch, languageVersion)) { + pos += charSize(ch); + } else if (ch === 92) { + ch = peekExtendedUnicodeEscape(); + if (ch >= 0 && isIdentifierPart(ch, languageVersion)) { + pos += 3; + tokenFlags |= 8; + result2 += scanExtendedUnicodeEscape(); + start2 = pos; + continue; + } + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) { + break; + } + tokenFlags |= 1024; + result2 += text.substring(start2, pos); + result2 += utf16EncodeAsString(ch); + pos += 6; + start2 = pos; + } else { + break; + } + } + result2 += text.substring(start2, pos); + return result2; + } + function getIdentifierToken() { + var len = tokenValue.length; + if (len >= 2 && len <= 12) { + var ch = tokenValue.charCodeAt(0); + if (ch >= 97 && ch <= 122) { + var keyword = textToKeyword.get(tokenValue); + if (keyword !== void 0) { + return token = keyword; + } + } + } + return token = 79; + } + function scanBinaryOrOctalDigits(base) { + var value2 = ""; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } else if (isPreviousTokenSeparator) { + error2(ts2.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; + if (!isDigit2(ch) || ch - 48 >= base) { + break; + } + value2 += text[pos]; + pos++; + isPreviousTokenSeparator = false; + } + if (text.charCodeAt(pos - 1) === 95) { + error2(ts2.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return value2; + } + function checkBigIntSuffix() { + if (text.charCodeAt(pos) === 110) { + tokenValue += "n"; + if (tokenFlags & 384) { + tokenValue = ts2.parsePseudoBigInt(tokenValue) + "n"; + } + pos++; + return 9; + } else { + var numericValue = tokenFlags & 128 ? parseInt(tokenValue.slice(2), 2) : tokenFlags & 256 ? parseInt(tokenValue.slice(2), 8) : +tokenValue; + tokenValue = "" + numericValue; + return 8; + } + } + function scan() { + var _a3; + startPos = pos; + tokenFlags = 0; + var asteriskSeen = false; + while (true) { + tokenPos = pos; + if (pos >= end) { + return token = 1; + } + var ch = codePointAt2(text, pos); + if (ch === 35 && pos === 0 && isShebangTrivia(text, pos)) { + pos = scanShebangTrivia(text, pos); + if (skipTrivia2) { + continue; + } else { + return token = 6; + } + } + switch (ch) { + case 10: + case 13: + tokenFlags |= 1; + if (skipTrivia2) { + pos++; + continue; + } else { + if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) { + pos += 2; + } else { + pos++; + } + return token = 4; + } + case 9: + case 11: + case 12: + case 32: + case 160: + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8203: + case 8239: + case 8287: + case 12288: + case 65279: + if (skipTrivia2) { + pos++; + continue; + } else { + while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { + pos++; + } + return token = 5; + } + case 33: + if (text.charCodeAt(pos + 1) === 61) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 37; + } + return pos += 2, token = 35; + } + pos++; + return token = 53; + case 34: + case 39: + tokenValue = scanString(); + return token = 10; + case 96: + return token = scanTemplateAndSetTokenValue( + /* isTaggedTemplate */ + false + ); + case 37: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 69; + } + pos++; + return token = 44; + case 38: + if (text.charCodeAt(pos + 1) === 38) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 76; + } + return pos += 2, token = 55; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 73; + } + pos++; + return token = 50; + case 40: + pos++; + return token = 20; + case 41: + pos++; + return token = 21; + case 42: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 66; + } + if (text.charCodeAt(pos + 1) === 42) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 67; + } + return pos += 2, token = 42; + } + pos++; + if (inJSDocType && !asteriskSeen && tokenFlags & 1) { + asteriskSeen = true; + continue; + } + return token = 41; + case 43: + if (text.charCodeAt(pos + 1) === 43) { + return pos += 2, token = 45; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 64; + } + pos++; + return token = 39; + case 44: + pos++; + return token = 27; + case 45: + if (text.charCodeAt(pos + 1) === 45) { + return pos += 2, token = 46; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 65; + } + pos++; + return token = 40; + case 46: + if (isDigit2(text.charCodeAt(pos + 1))) { + tokenValue = scanNumber().value; + return token = 8; + } + if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { + return pos += 3, token = 25; + } + pos++; + return token = 24; + case 47: + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + while (pos < end) { + if (isLineBreak2(text.charCodeAt(pos))) { + break; + } + pos++; + } + commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(tokenPos, pos), commentDirectiveRegExSingleLine, tokenPos); + if (skipTrivia2) { + continue; + } else { + return token = 2; + } + } + if (text.charCodeAt(pos + 1) === 42) { + pos += 2; + if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) !== 47) { + tokenFlags |= 2; + } + var commentClosed = false; + var lastLineStart = tokenPos; + while (pos < end) { + var ch_1 = text.charCodeAt(pos); + if (ch_1 === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + commentClosed = true; + break; + } + pos++; + if (isLineBreak2(ch_1)) { + lastLineStart = pos; + tokenFlags |= 1; + } + } + commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart); + if (!commentClosed) { + error2(ts2.Diagnostics.Asterisk_Slash_expected); + } + if (skipTrivia2) { + continue; + } else { + if (!commentClosed) { + tokenFlags |= 4; + } + return token = 3; + } + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 68; + } + pos++; + return token = 43; + case 48: + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + pos += 2; + tokenValue = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + true + ); + if (!tokenValue) { + error2(ts2.Diagnostics.Hexadecimal_digit_expected); + tokenValue = "0"; + } + tokenValue = "0x" + tokenValue; + tokenFlags |= 64; + return token = checkBigIntSuffix(); + } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + pos += 2; + tokenValue = scanBinaryOrOctalDigits( + /* base */ + 2 + ); + if (!tokenValue) { + error2(ts2.Diagnostics.Binary_digit_expected); + tokenValue = "0"; + } + tokenValue = "0b" + tokenValue; + tokenFlags |= 128; + return token = checkBigIntSuffix(); + } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + pos += 2; + tokenValue = scanBinaryOrOctalDigits( + /* base */ + 8 + ); + if (!tokenValue) { + error2(ts2.Diagnostics.Octal_digit_expected); + tokenValue = "0"; + } + tokenValue = "0o" + tokenValue; + tokenFlags |= 256; + return token = checkBigIntSuffix(); + } + if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { + tokenValue = "" + scanOctalDigits(); + tokenFlags |= 32; + return token = 8; + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + _a3 = scanNumber(), token = _a3.type, tokenValue = _a3.value; + return token; + case 58: + pos++; + return token = 58; + case 59: + pos++; + return token = 26; + case 60: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error2); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 60) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 70; + } + return pos += 2, token = 47; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 32; + } + if (languageVariant === 1 && text.charCodeAt(pos + 1) === 47 && text.charCodeAt(pos + 2) !== 42) { + return pos += 2, token = 30; + } + pos++; + return token = 29; + case 61: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error2); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 61) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 36; + } + return pos += 2, token = 34; + } + if (text.charCodeAt(pos + 1) === 62) { + return pos += 2, token = 38; + } + pos++; + return token = 63; + case 62: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error2); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + pos++; + return token = 31; + case 63: + if (text.charCodeAt(pos + 1) === 46 && !isDigit2(text.charCodeAt(pos + 2))) { + return pos += 2, token = 28; + } + if (text.charCodeAt(pos + 1) === 63) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 77; + } + return pos += 2, token = 60; + } + pos++; + return token = 57; + case 91: + pos++; + return token = 22; + case 93: + pos++; + return token = 23; + case 94: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 78; + } + pos++; + return token = 52; + case 123: + pos++; + return token = 18; + case 124: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error2); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 124) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 75; + } + return pos += 2, token = 56; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 74; + } + pos++; + return token = 51; + case 125: + pos++; + return token = 19; + case 126: + pos++; + return token = 54; + case 64: + pos++; + return token = 59; + case 92: + var extendedCookedChar = peekExtendedUnicodeEscape(); + if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = getIdentifierToken(); + } + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error2(ts2.Diagnostics.Invalid_character); + pos++; + return token = 0; + case 35: + if (pos !== 0 && text[pos + 1] === "!") { + error2(ts2.Diagnostics.can_only_be_used_at_the_start_of_a_file); + pos++; + return token = 0; + } + var charAfterHash = codePointAt2(text, pos + 1); + if (charAfterHash === 92) { + pos++; + var extendedCookedChar_1 = peekExtendedUnicodeEscape(); + if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = 80; + } + var cookedChar_1 = peekUnicodeEscape(); + if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts(); + return token = 80; + } + pos--; + } + if (isIdentifierStart(charAfterHash, languageVersion)) { + pos++; + scanIdentifier(charAfterHash, languageVersion); + } else { + tokenValue = "#"; + error2(ts2.Diagnostics.Invalid_character, pos++, charSize(ch)); + } + return token = 80; + default: + var identifierKind = scanIdentifier(ch, languageVersion); + if (identifierKind) { + return token = identifierKind; + } else if (isWhiteSpaceSingleLine(ch)) { + pos += charSize(ch); + continue; + } else if (isLineBreak2(ch)) { + tokenFlags |= 1; + pos += charSize(ch); + continue; + } + var size2 = charSize(ch); + error2(ts2.Diagnostics.Invalid_character, pos, size2); + pos += size2; + return token = 0; + } + } + } + function reScanInvalidIdentifier() { + ts2.Debug.assert(token === 0, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."); + pos = tokenPos = startPos; + tokenFlags = 0; + var ch = codePointAt2(text, pos); + var identifierKind = scanIdentifier( + ch, + 99 + /* ScriptTarget.ESNext */ + ); + if (identifierKind) { + return token = identifierKind; + } + pos += charSize(ch); + return token; + } + function scanIdentifier(startCharacter, languageVersion2) { + var ch = startCharacter; + if (isIdentifierStart(ch, languageVersion2)) { + pos += charSize(ch); + while (pos < end && isIdentifierPart(ch = codePointAt2(text, pos), languageVersion2)) + pos += charSize(ch); + tokenValue = text.substring(tokenPos, pos); + if (ch === 92) { + tokenValue += scanIdentifierParts(); + } + return getIdentifierToken(); + } + } + function reScanGreaterToken() { + if (token === 31) { + if (text.charCodeAt(pos) === 62) { + if (text.charCodeAt(pos + 1) === 62) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 72; + } + return pos += 2, token = 49; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 71; + } + pos++; + return token = 48; + } + if (text.charCodeAt(pos) === 61) { + pos++; + return token = 33; + } + } + return token; + } + function reScanAsteriskEqualsToken() { + ts2.Debug.assert(token === 66, "'reScanAsteriskEqualsToken' should only be called on a '*='"); + pos = tokenPos + 1; + return token = 63; + } + function reScanSlashToken() { + if (token === 43 || token === 68) { + var p7 = tokenPos + 1; + var inEscape = false; + var inCharacterClass = false; + while (true) { + if (p7 >= end) { + tokenFlags |= 4; + error2(ts2.Diagnostics.Unterminated_regular_expression_literal); + break; + } + var ch = text.charCodeAt(p7); + if (isLineBreak2(ch)) { + tokenFlags |= 4; + error2(ts2.Diagnostics.Unterminated_regular_expression_literal); + break; + } + if (inEscape) { + inEscape = false; + } else if (ch === 47 && !inCharacterClass) { + p7++; + break; + } else if (ch === 91) { + inCharacterClass = true; + } else if (ch === 92) { + inEscape = true; + } else if (ch === 93) { + inCharacterClass = false; + } + p7++; + } + while (p7 < end && isIdentifierPart(text.charCodeAt(p7), languageVersion)) { + p7++; + } + pos = p7; + tokenValue = text.substring(tokenPos, pos); + token = 13; + } + return token; + } + function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) { + var type3 = getDirectiveFromComment(ts2.trimStringStart(text2), commentDirectiveRegEx); + if (type3 === void 0) { + return commentDirectives2; + } + return ts2.append(commentDirectives2, { + range: { pos: lineStart, end: pos }, + type: type3 + }); + } + function getDirectiveFromComment(text2, commentDirectiveRegEx) { + var match = commentDirectiveRegEx.exec(text2); + if (!match) { + return void 0; + } + switch (match[1]) { + case "ts-expect-error": + return 0; + case "ts-ignore": + return 1; + } + return void 0; + } + function reScanTemplateToken(isTaggedTemplate) { + ts2.Debug.assert(token === 19, "'reScanTemplateToken' should only be called on a '}'"); + pos = tokenPos; + return token = scanTemplateAndSetTokenValue(isTaggedTemplate); + } + function reScanTemplateHeadOrNoSubstitutionTemplate() { + pos = tokenPos; + return token = scanTemplateAndSetTokenValue( + /* isTaggedTemplate */ + true + ); + } + function reScanJsxToken(allowMultilineJsxText) { + if (allowMultilineJsxText === void 0) { + allowMultilineJsxText = true; + } + pos = tokenPos = startPos; + return token = scanJsxToken(allowMultilineJsxText); + } + function reScanLessThanToken() { + if (token === 47) { + pos = tokenPos + 1; + return token = 29; + } + return token; + } + function reScanHashToken() { + if (token === 80) { + pos = tokenPos + 1; + return token = 62; + } + return token; + } + function reScanQuestionToken() { + ts2.Debug.assert(token === 60, "'reScanQuestionToken' should only be called on a '??'"); + pos = tokenPos + 1; + return token = 57; + } + function scanJsxToken(allowMultilineJsxText) { + if (allowMultilineJsxText === void 0) { + allowMultilineJsxText = true; + } + startPos = tokenPos = pos; + if (pos >= end) { + return token = 1; + } + var char = text.charCodeAt(pos); + if (char === 60) { + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + return token = 30; + } + pos++; + return token = 29; + } + if (char === 123) { + pos++; + return token = 18; + } + var firstNonWhitespace = 0; + while (pos < end) { + char = text.charCodeAt(pos); + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error2); + return token = 7; + } + break; + } + if (char === 62) { + error2(ts2.Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); + } + if (char === 125) { + error2(ts2.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); + } + if (isLineBreak2(char) && firstNonWhitespace === 0) { + firstNonWhitespace = -1; + } else if (!allowMultilineJsxText && isLineBreak2(char) && firstNonWhitespace > 0) { + break; + } else if (!isWhiteSpaceLike(char)) { + firstNonWhitespace = pos; + } + pos++; + } + tokenValue = text.substring(startPos, pos); + return firstNonWhitespace === -1 ? 12 : 11; + } + function scanJsxIdentifier() { + if (tokenIsIdentifierOrKeyword(token)) { + var namespaceSeparator = false; + while (pos < end) { + var ch = text.charCodeAt(pos); + if (ch === 45) { + tokenValue += "-"; + pos++; + continue; + } else if (ch === 58 && !namespaceSeparator) { + tokenValue += ":"; + pos++; + namespaceSeparator = true; + token = 79; + continue; + } + var oldPos = pos; + tokenValue += scanIdentifierParts(); + if (pos === oldPos) { + break; + } + } + if (tokenValue.slice(-1) === ":") { + tokenValue = tokenValue.slice(0, -1); + pos--; + } + return getIdentifierToken(); + } + return token; + } + function scanJsxAttributeValue() { + startPos = pos; + switch (text.charCodeAt(pos)) { + case 34: + case 39: + tokenValue = scanString( + /*jsxAttributeString*/ + true + ); + return token = 10; + default: + return scan(); + } + } + function reScanJsxAttributeValue() { + pos = tokenPos = startPos; + return scanJsxAttributeValue(); + } + function scanJsDocToken() { + startPos = tokenPos = pos; + tokenFlags = 0; + if (pos >= end) { + return token = 1; + } + var ch = codePointAt2(text, pos); + pos += charSize(ch); + switch (ch) { + case 9: + case 11: + case 12: + case 32: + while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { + pos++; + } + return token = 5; + case 64: + return token = 59; + case 13: + if (text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + tokenFlags |= 1; + return token = 4; + case 42: + return token = 41; + case 123: + return token = 18; + case 125: + return token = 19; + case 91: + return token = 22; + case 93: + return token = 23; + case 60: + return token = 29; + case 62: + return token = 31; + case 61: + return token = 63; + case 44: + return token = 27; + case 46: + return token = 24; + case 96: + return token = 61; + case 35: + return token = 62; + case 92: + pos--; + var extendedCookedChar = peekExtendedUnicodeEscape(); + if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = getIdentifierToken(); + } + var cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + pos++; + return token = 0; + } + if (isIdentifierStart(ch, languageVersion)) { + var char = ch; + while (pos < end && isIdentifierPart(char = codePointAt2(text, pos), languageVersion) || text.charCodeAt(pos) === 45) + pos += charSize(char); + tokenValue = text.substring(tokenPos, pos); + if (char === 92) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } else { + return token = 0; + } + } + function speculationHelper(callback, isLookahead) { + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var saveTokenFlags = tokenFlags; + var result2 = callback(); + if (!result2 || isLookahead) { + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + tokenFlags = saveTokenFlags; + } + return result2; + } + function scanRange(start2, length2, callback) { + var saveEnd = end; + var savePos = pos; + var saveStartPos = startPos; + var saveTokenPos = tokenPos; + var saveToken = token; + var saveTokenValue = tokenValue; + var saveTokenFlags = tokenFlags; + var saveErrorExpectations = commentDirectives; + setText(text, start2, length2); + var result2 = callback(); + end = saveEnd; + pos = savePos; + startPos = saveStartPos; + tokenPos = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; + return result2; + } + function lookAhead(callback) { + return speculationHelper( + callback, + /*isLookahead*/ + true + ); + } + function tryScan(callback) { + return speculationHelper( + callback, + /*isLookahead*/ + false + ); + } + function getText() { + return text; + } + function clearCommentDirectives() { + commentDirectives = void 0; + } + function setText(newText, start2, length2) { + text = newText || ""; + end = length2 === void 0 ? text.length : start2 + length2; + setTextPos(start2 || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; + } + function setLanguageVariant(variant) { + languageVariant = variant; + } + function setTextPos(textPos) { + ts2.Debug.assert(textPos >= 0); + pos = textPos; + startPos = textPos; + tokenPos = textPos; + token = 0; + tokenValue = void 0; + tokenFlags = 0; + } + function setInJSDocType(inType) { + inJSDocType += inType ? 1 : -1; + } + } + ts2.createScanner = createScanner3; + var codePointAt2 = String.prototype.codePointAt ? function(s7, i7) { + return s7.codePointAt(i7); + } : function codePointAt3(str2, i7) { + var size2 = str2.length; + if (i7 < 0 || i7 >= size2) { + return void 0; + } + var first = str2.charCodeAt(i7); + if (first >= 55296 && first <= 56319 && size2 > i7 + 1) { + var second = str2.charCodeAt(i7 + 1); + if (second >= 56320 && second <= 57343) { + return (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return first; + }; + function charSize(ch) { + if (ch >= 65536) { + return 2; + } + return 1; + } + function utf16EncodeAsStringFallback(codePoint) { + ts2.Debug.assert(0 <= codePoint && codePoint <= 1114111); + if (codePoint <= 65535) { + return String.fromCharCode(codePoint); + } + var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 55296; + var codeUnit2 = (codePoint - 65536) % 1024 + 56320; + return String.fromCharCode(codeUnit1, codeUnit2); + } + var utf16EncodeAsStringWorker = String.fromCodePoint ? function(codePoint) { + return String.fromCodePoint(codePoint); + } : utf16EncodeAsStringFallback; + function utf16EncodeAsString(codePoint) { + return utf16EncodeAsStringWorker(codePoint); + } + ts2.utf16EncodeAsString = utf16EncodeAsString; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function isExternalModuleNameRelative(moduleName3) { + return ts2.pathIsRelative(moduleName3) || ts2.isRootedDiskPath(moduleName3); + } + ts2.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts2.sortAndDeduplicate(diagnostics, ts2.compareDiagnostics); + } + ts2.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; + function getDefaultLibFileName(options) { + switch (ts2.getEmitScriptTarget(options)) { + case 99: + return "lib.esnext.full.d.ts"; + case 9: + return "lib.es2022.full.d.ts"; + case 8: + return "lib.es2021.full.d.ts"; + case 7: + return "lib.es2020.full.d.ts"; + case 6: + return "lib.es2019.full.d.ts"; + case 5: + return "lib.es2018.full.d.ts"; + case 4: + return "lib.es2017.full.d.ts"; + case 3: + return "lib.es2016.full.d.ts"; + case 2: + return "lib.es6.d.ts"; + default: + return "lib.d.ts"; + } + } + ts2.getDefaultLibFileName = getDefaultLibFileName; + function textSpanEnd(span) { + return span.start + span.length; + } + ts2.textSpanEnd = textSpanEnd; + function textSpanIsEmpty(span) { + return span.length === 0; + } + ts2.textSpanIsEmpty = textSpanIsEmpty; + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + ts2.textSpanContainsPosition = textSpanContainsPosition; + function textRangeContainsPositionInclusive(span, position) { + return position >= span.pos && position <= span.end; + } + ts2.textRangeContainsPositionInclusive = textRangeContainsPositionInclusive; + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + ts2.textSpanContainsTextSpan = textSpanContainsTextSpan; + function textSpanOverlapsWith(span, other) { + return textSpanOverlap(span, other) !== void 0; + } + ts2.textSpanOverlapsWith = textSpanOverlapsWith; + function textSpanOverlap(span1, span2) { + var overlap = textSpanIntersection(span1, span2); + return overlap && overlap.length === 0 ? void 0 : overlap; + } + ts2.textSpanOverlap = textSpanOverlap; + function textSpanIntersectsWithTextSpan(span, other) { + return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); + } + ts2.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; + function textSpanIntersectsWith(span, start, length) { + return decodedTextSpanIntersectsWith(span.start, span.length, start, length); + } + ts2.textSpanIntersectsWith = textSpanIntersectsWith; + function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { + var end1 = start1 + length1; + var end2 = start2 + length2; + return start2 <= end1 && end2 >= start1; + } + ts2.decodedTextSpanIntersectsWith = decodedTextSpanIntersectsWith; + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + ts2.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; + function textSpanIntersection(span1, span2) { + var start = Math.max(span1.start, span2.start); + var end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + return start <= end ? createTextSpanFromBounds(start, end) : void 0; + } + ts2.textSpanIntersection = textSpanIntersection; + function createTextSpan(start, length) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length < 0) { + throw new Error("length < 0"); + } + return { start, length }; + } + ts2.createTextSpan = createTextSpan; + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + ts2.createTextSpanFromBounds = createTextSpanFromBounds; + function textChangeRangeNewSpan(range2) { + return createTextSpan(range2.span.start, range2.newLength); + } + ts2.textChangeRangeNewSpan = textChangeRangeNewSpan; + function textChangeRangeIsUnchanged(range2) { + return textSpanIsEmpty(range2.span) && range2.newLength === 0; + } + ts2.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span, newLength }; + } + ts2.createTextChangeRange = createTextChangeRange; + ts2.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return ts2.unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + var change0 = changes[0]; + var oldStartN = change0.span.start; + var oldEndN = textSpanEnd(change0.span); + var newEndN = oldStartN + change0.newLength; + for (var i7 = 1; i7 < changes.length; i7++) { + var nextChange = changes[i7]; + var oldStart1 = oldStartN; + var oldEnd1 = oldEndN; + var newEnd1 = newEndN; + var oldStart2 = nextChange.span.start; + var oldEnd2 = textSpanEnd(nextChange.span); + var newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange( + createTextSpanFromBounds(oldStartN, oldEndN), + /*newLength*/ + newEndN - oldStartN + ); + } + ts2.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; + function getTypeParameterOwner(d7) { + if (d7 && d7.kind === 165) { + for (var current = d7; current; current = current.parent) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 261) { + return current; + } + } + } + } + ts2.getTypeParameterOwner = getTypeParameterOwner; + function isParameterPropertyDeclaration(node, parent2) { + return ts2.hasSyntacticModifier( + node, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ) && parent2.kind === 173; + } + ts2.isParameterPropertyDeclaration = isParameterPropertyDeclaration; + function isEmptyBindingPattern(node) { + if (isBindingPattern(node)) { + return ts2.every(node.elements, isEmptyBindingElement); + } + return false; + } + ts2.isEmptyBindingPattern = isEmptyBindingPattern; + function isEmptyBindingElement(node) { + if (ts2.isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + ts2.isEmptyBindingElement = isEmptyBindingElement; + function walkUpBindingElementsAndPatterns(binding3) { + var node = binding3.parent; + while (ts2.isBindingElement(node.parent)) { + node = node.parent.parent; + } + return node.parent; + } + ts2.walkUpBindingElementsAndPatterns = walkUpBindingElementsAndPatterns; + function getCombinedFlags(node, getFlags) { + if (ts2.isBindingElement(node)) { + node = walkUpBindingElementsAndPatterns(node); + } + var flags = getFlags(node); + if (node.kind === 257) { + node = node.parent; + } + if (node && node.kind === 258) { + flags |= getFlags(node); + node = node.parent; + } + if (node && node.kind === 240) { + flags |= getFlags(node); + } + return flags; + } + function getCombinedModifierFlags(node) { + return getCombinedFlags(node, ts2.getEffectiveModifierFlags); + } + ts2.getCombinedModifierFlags = getCombinedModifierFlags; + function getCombinedNodeFlagsAlwaysIncludeJSDoc(node) { + return getCombinedFlags(node, ts2.getEffectiveModifierFlagsAlwaysIncludeJSDoc); + } + ts2.getCombinedNodeFlagsAlwaysIncludeJSDoc = getCombinedNodeFlagsAlwaysIncludeJSDoc; + function getCombinedNodeFlags(node) { + return getCombinedFlags(node, function(n7) { + return n7.flags; + }); + } + ts2.getCombinedNodeFlags = getCombinedNodeFlags; + ts2.supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]; + function validateLocaleAndSetLanguage(locale, sys, errors) { + var lowerCaseLocale = locale.toLowerCase(); + var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(lowerCaseLocale); + if (!matchResult) { + if (errors) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp")); + } + return; + } + var language = matchResult[1]; + var territory = matchResult[3]; + if (ts2.contains(ts2.supportedLocaleDirectories, lowerCaseLocale) && !trySetLanguageAndTerritory(language, territory, errors)) { + trySetLanguageAndTerritory( + language, + /*territory*/ + void 0, + errors + ); + } + ts2.setUILocale(locale); + function trySetLanguageAndTerritory(language2, territory2, errors2) { + var compilerFilePath = ts2.normalizePath(sys.getExecutingFilePath()); + var containingDirectoryPath = ts2.getDirectoryPath(compilerFilePath); + var filePath = ts2.combinePaths(containingDirectoryPath, language2); + if (territory2) { + filePath = filePath + "-" + territory2; + } + filePath = sys.resolvePath(ts2.combinePaths(filePath, "diagnosticMessages.generated.json")); + if (!sys.fileExists(filePath)) { + return false; + } + var fileContents = ""; + try { + fileContents = sys.readFile(filePath); + } catch (e10) { + if (errors2) { + errors2.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Unable_to_open_file_0, filePath)); + } + return false; + } + try { + ts2.setLocalizedDiagnosticMessages(JSON.parse(fileContents)); + } catch (_a2) { + if (errors2) { + errors2.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Corrupted_locale_file_0, filePath)); + } + return false; + } + return true; + } + } + ts2.validateLocaleAndSetLanguage = validateLocaleAndSetLanguage; + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== void 0) { + node = node.original; + } + } + return !nodeTest || nodeTest(node) ? node : void 0; + } + ts2.getOriginalNode = getOriginalNode; + function findAncestor(node, callback) { + while (node) { + var result2 = callback(node); + if (result2 === "quit") { + return void 0; + } else if (result2) { + return node; + } + node = node.parent; + } + return void 0; + } + ts2.findAncestor = findAncestor; + function isParseTreeNode(node) { + return (node.flags & 8) === 0; + } + ts2.isParseTreeNode = isParseTreeNode; + function getParseTreeNode(node, nodeTest) { + if (node === void 0 || isParseTreeNode(node)) { + return node; + } + node = node.original; + while (node) { + if (isParseTreeNode(node)) { + return !nodeTest || nodeTest(node) ? node : void 0; + } + node = node.original; + } + } + ts2.getParseTreeNode = getParseTreeNode; + function escapeLeadingUnderscores(identifier) { + return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; + } + ts2.escapeLeadingUnderscores = escapeLeadingUnderscores; + function unescapeLeadingUnderscores(identifier) { + var id = identifier; + return id.length >= 3 && id.charCodeAt(0) === 95 && id.charCodeAt(1) === 95 && id.charCodeAt(2) === 95 ? id.substr(1) : id; + } + ts2.unescapeLeadingUnderscores = unescapeLeadingUnderscores; + function idText(identifierOrPrivateName) { + return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); + } + ts2.idText = idText; + function symbolName(symbol) { + if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { + return idText(symbol.valueDeclaration.name); + } + return unescapeLeadingUnderscores(symbol.escapedName); + } + ts2.symbolName = symbolName; + function nameForNamelessJSDocTypedef(declaration) { + var hostNode = declaration.parent.parent; + if (!hostNode) { + return void 0; + } + if (isDeclaration(hostNode)) { + return getDeclarationIdentifier(hostNode); + } + switch (hostNode.kind) { + case 240: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { + return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); + } + break; + case 241: + var expr = hostNode.expression; + if (expr.kind === 223 && expr.operatorToken.kind === 63) { + expr = expr.left; + } + switch (expr.kind) { + case 208: + return expr.name; + case 209: + var arg = expr.argumentExpression; + if (ts2.isIdentifier(arg)) { + return arg; + } + } + break; + case 214: { + return getDeclarationIdentifier(hostNode.expression); + } + case 253: { + if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { + return getDeclarationIdentifier(hostNode.statement); + } + break; + } + } + } + function getDeclarationIdentifier(node) { + var name2 = getNameOfDeclaration(node); + return name2 && ts2.isIdentifier(name2) ? name2 : void 0; + } + function nodeHasName(statement, name2) { + if (isNamedDeclaration(statement) && ts2.isIdentifier(statement.name) && idText(statement.name) === idText(name2)) { + return true; + } + if (ts2.isVariableStatement(statement) && ts2.some(statement.declarationList.declarations, function(d7) { + return nodeHasName(d7, name2); + })) { + return true; + } + return false; + } + ts2.nodeHasName = nodeHasName; + function getNameOfJSDocTypedef(declaration) { + return declaration.name || nameForNamelessJSDocTypedef(declaration); + } + ts2.getNameOfJSDocTypedef = getNameOfJSDocTypedef; + function isNamedDeclaration(node) { + return !!node.name; + } + ts2.isNamedDeclaration = isNamedDeclaration; + function getNonAssignedNameOfDeclaration(declaration) { + switch (declaration.kind) { + case 79: + return declaration; + case 350: + case 343: { + var name2 = declaration.name; + if (name2.kind === 163) { + return name2.right; + } + break; + } + case 210: + case 223: { + var expr_1 = declaration; + switch (ts2.getAssignmentDeclarationKind(expr_1)) { + case 1: + case 4: + case 5: + case 3: + return ts2.getElementOrPropertyAccessArgumentExpressionOrName(expr_1.left); + case 7: + case 8: + case 9: + return expr_1.arguments[1]; + default: + return void 0; + } + } + case 348: + return getNameOfJSDocTypedef(declaration); + case 342: + return nameForNamelessJSDocTypedef(declaration); + case 274: { + var expression = declaration.expression; + return ts2.isIdentifier(expression) ? expression : void 0; + } + case 209: + var expr = declaration; + if (ts2.isBindableStaticElementAccessExpression(expr)) { + return expr.argumentExpression; + } + } + return declaration.name; + } + ts2.getNonAssignedNameOfDeclaration = getNonAssignedNameOfDeclaration; + function getNameOfDeclaration(declaration) { + if (declaration === void 0) + return void 0; + return getNonAssignedNameOfDeclaration(declaration) || (ts2.isFunctionExpression(declaration) || ts2.isArrowFunction(declaration) || ts2.isClassExpression(declaration) ? getAssignedName(declaration) : void 0); + } + ts2.getNameOfDeclaration = getNameOfDeclaration; + function getAssignedName(node) { + if (!node.parent) { + return void 0; + } else if (ts2.isPropertyAssignment(node.parent) || ts2.isBindingElement(node.parent)) { + return node.parent.name; + } else if (ts2.isBinaryExpression(node.parent) && node === node.parent.right) { + if (ts2.isIdentifier(node.parent.left)) { + return node.parent.left; + } else if (ts2.isAccessExpression(node.parent.left)) { + return ts2.getElementOrPropertyAccessArgumentExpressionOrName(node.parent.left); + } + } else if (ts2.isVariableDeclaration(node.parent) && ts2.isIdentifier(node.parent.name)) { + return node.parent.name; + } + } + ts2.getAssignedName = getAssignedName; + function getDecorators(node) { + if (ts2.hasDecorators(node)) { + return ts2.filter(node.modifiers, ts2.isDecorator); + } + } + ts2.getDecorators = getDecorators; + function getModifiers(node) { + if (ts2.hasSyntacticModifier( + node, + 126975 + /* ModifierFlags.Modifier */ + )) { + return ts2.filter(node.modifiers, isModifier); + } + } + ts2.getModifiers = getModifiers; + function getJSDocParameterTagsWorker(param, noCache) { + if (param.name) { + if (ts2.isIdentifier(param.name)) { + var name_1 = param.name.escapedText; + return getJSDocTagsWorker(param.parent, noCache).filter(function(tag) { + return ts2.isJSDocParameterTag(tag) && ts2.isIdentifier(tag.name) && tag.name.escapedText === name_1; + }); + } else { + var i7 = param.parent.parameters.indexOf(param); + ts2.Debug.assert(i7 > -1, "Parameters should always be in their parents' parameter list"); + var paramTags = getJSDocTagsWorker(param.parent, noCache).filter(ts2.isJSDocParameterTag); + if (i7 < paramTags.length) { + return [paramTags[i7]]; + } + } + } + return ts2.emptyArray; + } + function getJSDocParameterTags(param) { + return getJSDocParameterTagsWorker( + param, + /*noCache*/ + false + ); + } + ts2.getJSDocParameterTags = getJSDocParameterTags; + function getJSDocParameterTagsNoCache(param) { + return getJSDocParameterTagsWorker( + param, + /*noCache*/ + true + ); + } + ts2.getJSDocParameterTagsNoCache = getJSDocParameterTagsNoCache; + function getJSDocTypeParameterTagsWorker(param, noCache) { + var name2 = param.name.escapedText; + return getJSDocTagsWorker(param.parent, noCache).filter(function(tag) { + return ts2.isJSDocTemplateTag(tag) && tag.typeParameters.some(function(tp) { + return tp.name.escapedText === name2; + }); + }); + } + function getJSDocTypeParameterTags(param) { + return getJSDocTypeParameterTagsWorker( + param, + /*noCache*/ + false + ); + } + ts2.getJSDocTypeParameterTags = getJSDocTypeParameterTags; + function getJSDocTypeParameterTagsNoCache(param) { + return getJSDocTypeParameterTagsWorker( + param, + /*noCache*/ + true + ); + } + ts2.getJSDocTypeParameterTagsNoCache = getJSDocTypeParameterTagsNoCache; + function hasJSDocParameterTags(node) { + return !!getFirstJSDocTag(node, ts2.isJSDocParameterTag); + } + ts2.hasJSDocParameterTags = hasJSDocParameterTags; + function getJSDocAugmentsTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocAugmentsTag); + } + ts2.getJSDocAugmentsTag = getJSDocAugmentsTag; + function getJSDocImplementsTags(node) { + return getAllJSDocTags(node, ts2.isJSDocImplementsTag); + } + ts2.getJSDocImplementsTags = getJSDocImplementsTags; + function getJSDocClassTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocClassTag); + } + ts2.getJSDocClassTag = getJSDocClassTag; + function getJSDocPublicTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocPublicTag); + } + ts2.getJSDocPublicTag = getJSDocPublicTag; + function getJSDocPublicTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocPublicTag, + /*noCache*/ + true + ); + } + ts2.getJSDocPublicTagNoCache = getJSDocPublicTagNoCache; + function getJSDocPrivateTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocPrivateTag); + } + ts2.getJSDocPrivateTag = getJSDocPrivateTag; + function getJSDocPrivateTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocPrivateTag, + /*noCache*/ + true + ); + } + ts2.getJSDocPrivateTagNoCache = getJSDocPrivateTagNoCache; + function getJSDocProtectedTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocProtectedTag); + } + ts2.getJSDocProtectedTag = getJSDocProtectedTag; + function getJSDocProtectedTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocProtectedTag, + /*noCache*/ + true + ); + } + ts2.getJSDocProtectedTagNoCache = getJSDocProtectedTagNoCache; + function getJSDocReadonlyTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocReadonlyTag); + } + ts2.getJSDocReadonlyTag = getJSDocReadonlyTag; + function getJSDocReadonlyTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocReadonlyTag, + /*noCache*/ + true + ); + } + ts2.getJSDocReadonlyTagNoCache = getJSDocReadonlyTagNoCache; + function getJSDocOverrideTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocOverrideTag, + /*noCache*/ + true + ); + } + ts2.getJSDocOverrideTagNoCache = getJSDocOverrideTagNoCache; + function getJSDocDeprecatedTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocDeprecatedTag); + } + ts2.getJSDocDeprecatedTag = getJSDocDeprecatedTag; + function getJSDocDeprecatedTagNoCache(node) { + return getFirstJSDocTag( + node, + ts2.isJSDocDeprecatedTag, + /*noCache*/ + true + ); + } + ts2.getJSDocDeprecatedTagNoCache = getJSDocDeprecatedTagNoCache; + function getJSDocEnumTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocEnumTag); + } + ts2.getJSDocEnumTag = getJSDocEnumTag; + function getJSDocThisTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocThisTag); + } + ts2.getJSDocThisTag = getJSDocThisTag; + function getJSDocReturnTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocReturnTag); + } + ts2.getJSDocReturnTag = getJSDocReturnTag; + function getJSDocTemplateTag(node) { + return getFirstJSDocTag(node, ts2.isJSDocTemplateTag); + } + ts2.getJSDocTemplateTag = getJSDocTemplateTag; + function getJSDocTypeTag(node) { + var tag = getFirstJSDocTag(node, ts2.isJSDocTypeTag); + if (tag && tag.typeExpression && tag.typeExpression.type) { + return tag; + } + return void 0; + } + ts2.getJSDocTypeTag = getJSDocTypeTag; + function getJSDocType(node) { + var tag = getFirstJSDocTag(node, ts2.isJSDocTypeTag); + if (!tag && ts2.isParameter(node)) { + tag = ts2.find(getJSDocParameterTags(node), function(tag2) { + return !!tag2.typeExpression; + }); + } + return tag && tag.typeExpression && tag.typeExpression.type; + } + ts2.getJSDocType = getJSDocType; + function getJSDocReturnType(node) { + var returnTag = getJSDocReturnTag(node); + if (returnTag && returnTag.typeExpression) { + return returnTag.typeExpression.type; + } + var typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression) { + var type3 = typeTag.typeExpression.type; + if (ts2.isTypeLiteralNode(type3)) { + var sig = ts2.find(type3.members, ts2.isCallSignatureDeclaration); + return sig && sig.type; + } + if (ts2.isFunctionTypeNode(type3) || ts2.isJSDocFunctionType(type3)) { + return type3.type; + } + } + } + ts2.getJSDocReturnType = getJSDocReturnType; + function getJSDocTagsWorker(node, noCache) { + var tags6 = node.jsDocCache; + if (tags6 === void 0 || noCache) { + var comments = ts2.getJSDocCommentsAndTags(node, noCache); + ts2.Debug.assert(comments.length < 2 || comments[0] !== comments[1]); + tags6 = ts2.flatMap(comments, function(j6) { + return ts2.isJSDoc(j6) ? j6.tags : j6; + }); + if (!noCache) { + node.jsDocCache = tags6; + } + } + return tags6; + } + function getJSDocTags(node) { + return getJSDocTagsWorker( + node, + /*noCache*/ + false + ); + } + ts2.getJSDocTags = getJSDocTags; + function getJSDocTagsNoCache(node) { + return getJSDocTagsWorker( + node, + /*noCache*/ + true + ); + } + ts2.getJSDocTagsNoCache = getJSDocTagsNoCache; + function getFirstJSDocTag(node, predicate, noCache) { + return ts2.find(getJSDocTagsWorker(node, noCache), predicate); + } + function getAllJSDocTags(node, predicate) { + return getJSDocTags(node).filter(predicate); + } + ts2.getAllJSDocTags = getAllJSDocTags; + function getAllJSDocTagsOfKind(node, kind) { + return getJSDocTags(node).filter(function(doc) { + return doc.kind === kind; + }); + } + ts2.getAllJSDocTagsOfKind = getAllJSDocTagsOfKind; + function getTextOfJSDocComment(comment) { + return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function(c7) { + return c7.kind === 324 ? c7.text : formatJSDocLink(c7); + }).join(""); + } + ts2.getTextOfJSDocComment = getTextOfJSDocComment; + function formatJSDocLink(link2) { + var kind = link2.kind === 327 ? "link" : link2.kind === 328 ? "linkcode" : "linkplain"; + var name2 = link2.name ? ts2.entityNameToString(link2.name) : ""; + var space = link2.name && link2.text.startsWith("://") ? "" : " "; + return "{@".concat(kind, " ").concat(name2).concat(space).concat(link2.text, "}"); + } + function getEffectiveTypeParameterDeclarations(node) { + if (ts2.isJSDocSignature(node)) { + return ts2.emptyArray; + } + if (ts2.isJSDocTypeAlias(node)) { + ts2.Debug.assert( + node.parent.kind === 323 + /* SyntaxKind.JSDoc */ + ); + return ts2.flatMap(node.parent.tags, function(tag) { + return ts2.isJSDocTemplateTag(tag) ? tag.typeParameters : void 0; + }); + } + if (node.typeParameters) { + return node.typeParameters; + } + if (ts2.canHaveIllegalTypeParameters(node) && node.typeParameters) { + return node.typeParameters; + } + if (ts2.isInJSFile(node)) { + var decls = ts2.getJSDocTypeParameterDeclarations(node); + if (decls.length) { + return decls; + } + var typeTag = getJSDocType(node); + if (typeTag && ts2.isFunctionTypeNode(typeTag) && typeTag.typeParameters) { + return typeTag.typeParameters; + } + } + return ts2.emptyArray; + } + ts2.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations; + function getEffectiveConstraintOfTypeParameter(node) { + return node.constraint ? node.constraint : ts2.isJSDocTemplateTag(node.parent) && node === node.parent.typeParameters[0] ? node.parent.constraint : void 0; + } + ts2.getEffectiveConstraintOfTypeParameter = getEffectiveConstraintOfTypeParameter; + function isMemberName(node) { + return node.kind === 79 || node.kind === 80; + } + ts2.isMemberName = isMemberName; + function isGetOrSetAccessorDeclaration(node) { + return node.kind === 175 || node.kind === 174; + } + ts2.isGetOrSetAccessorDeclaration = isGetOrSetAccessorDeclaration; + function isPropertyAccessChain(node) { + return ts2.isPropertyAccessExpression(node) && !!(node.flags & 32); + } + ts2.isPropertyAccessChain = isPropertyAccessChain; + function isElementAccessChain(node) { + return ts2.isElementAccessExpression(node) && !!(node.flags & 32); + } + ts2.isElementAccessChain = isElementAccessChain; + function isCallChain(node) { + return ts2.isCallExpression(node) && !!(node.flags & 32); + } + ts2.isCallChain = isCallChain; + function isOptionalChain(node) { + var kind = node.kind; + return !!(node.flags & 32) && (kind === 208 || kind === 209 || kind === 210 || kind === 232); + } + ts2.isOptionalChain = isOptionalChain; + function isOptionalChainRoot(node) { + return isOptionalChain(node) && !ts2.isNonNullExpression(node) && !!node.questionDotToken; + } + ts2.isOptionalChainRoot = isOptionalChainRoot; + function isExpressionOfOptionalChainRoot(node) { + return isOptionalChainRoot(node.parent) && node.parent.expression === node; + } + ts2.isExpressionOfOptionalChainRoot = isExpressionOfOptionalChainRoot; + function isOutermostOptionalChain(node) { + return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; + } + ts2.isOutermostOptionalChain = isOutermostOptionalChain; + function isNullishCoalesce(node) { + return node.kind === 223 && node.operatorToken.kind === 60; + } + ts2.isNullishCoalesce = isNullishCoalesce; + function isConstTypeReference(node) { + return ts2.isTypeReferenceNode(node) && ts2.isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; + } + ts2.isConstTypeReference = isConstTypeReference; + function skipPartiallyEmittedExpressions(node) { + return ts2.skipOuterExpressions( + node, + 8 + /* OuterExpressionKinds.PartiallyEmittedExpressions */ + ); + } + ts2.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; + function isNonNullChain(node) { + return ts2.isNonNullExpression(node) && !!(node.flags & 32); + } + ts2.isNonNullChain = isNonNullChain; + function isBreakOrContinueStatement(node) { + return node.kind === 249 || node.kind === 248; + } + ts2.isBreakOrContinueStatement = isBreakOrContinueStatement; + function isNamedExportBindings(node) { + return node.kind === 277 || node.kind === 276; + } + ts2.isNamedExportBindings = isNamedExportBindings; + function isUnparsedTextLike(node) { + switch (node.kind) { + case 305: + case 306: + return true; + default: + return false; + } + } + ts2.isUnparsedTextLike = isUnparsedTextLike; + function isUnparsedNode(node) { + return isUnparsedTextLike(node) || node.kind === 303 || node.kind === 307; + } + ts2.isUnparsedNode = isUnparsedNode; + function isJSDocPropertyLikeTag(node) { + return node.kind === 350 || node.kind === 343; + } + ts2.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; + function isNode2(node) { + return isNodeKind(node.kind); + } + ts2.isNode = isNode2; + function isNodeKind(kind) { + return kind >= 163; + } + ts2.isNodeKind = isNodeKind; + function isTokenKind(kind) { + return kind >= 0 && kind <= 162; + } + ts2.isTokenKind = isTokenKind; + function isToken(n7) { + return isTokenKind(n7.kind); + } + ts2.isToken = isToken; + function isNodeArray(array) { + return ts2.hasProperty(array, "pos") && ts2.hasProperty(array, "end"); + } + ts2.isNodeArray = isNodeArray; + function isLiteralKind(kind) { + return 8 <= kind && kind <= 14; + } + ts2.isLiteralKind = isLiteralKind; + function isLiteralExpression(node) { + return isLiteralKind(node.kind); + } + ts2.isLiteralExpression = isLiteralExpression; + function isLiteralExpressionOfObject(node) { + switch (node.kind) { + case 207: + case 206: + case 13: + case 215: + case 228: + return true; + } + return false; + } + ts2.isLiteralExpressionOfObject = isLiteralExpressionOfObject; + function isTemplateLiteralKind(kind) { + return 14 <= kind && kind <= 17; + } + ts2.isTemplateLiteralKind = isTemplateLiteralKind; + function isTemplateLiteralToken(node) { + return isTemplateLiteralKind(node.kind); + } + ts2.isTemplateLiteralToken = isTemplateLiteralToken; + function isTemplateMiddleOrTemplateTail(node) { + var kind = node.kind; + return kind === 16 || kind === 17; + } + ts2.isTemplateMiddleOrTemplateTail = isTemplateMiddleOrTemplateTail; + function isImportOrExportSpecifier(node) { + return ts2.isImportSpecifier(node) || ts2.isExportSpecifier(node); + } + ts2.isImportOrExportSpecifier = isImportOrExportSpecifier; + function isTypeOnlyImportOrExportDeclaration(node) { + switch (node.kind) { + case 273: + case 278: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 271: + return node.parent.isTypeOnly; + case 270: + case 268: + return node.isTypeOnly; + default: + return false; + } + } + ts2.isTypeOnlyImportOrExportDeclaration = isTypeOnlyImportOrExportDeclaration; + function isAssertionKey(node) { + return ts2.isStringLiteral(node) || ts2.isIdentifier(node); + } + ts2.isAssertionKey = isAssertionKey; + function isStringTextContainingNode(node) { + return node.kind === 10 || isTemplateLiteralKind(node.kind); + } + ts2.isStringTextContainingNode = isStringTextContainingNode; + function isGeneratedIdentifier(node) { + return ts2.isIdentifier(node) && (node.autoGenerateFlags & 7) > 0; + } + ts2.isGeneratedIdentifier = isGeneratedIdentifier; + function isGeneratedPrivateIdentifier(node) { + return ts2.isPrivateIdentifier(node) && (node.autoGenerateFlags & 7) > 0; + } + ts2.isGeneratedPrivateIdentifier = isGeneratedPrivateIdentifier; + function isPrivateIdentifierClassElementDeclaration(node) { + return (ts2.isPropertyDeclaration(node) || isMethodOrAccessor(node)) && ts2.isPrivateIdentifier(node.name); + } + ts2.isPrivateIdentifierClassElementDeclaration = isPrivateIdentifierClassElementDeclaration; + function isPrivateIdentifierPropertyAccessExpression(node) { + return ts2.isPropertyAccessExpression(node) && ts2.isPrivateIdentifier(node.name); + } + ts2.isPrivateIdentifierPropertyAccessExpression = isPrivateIdentifierPropertyAccessExpression; + function isModifierKind(token) { + switch (token) { + case 126: + case 127: + case 132: + case 85: + case 136: + case 88: + case 93: + case 101: + case 123: + case 121: + case 122: + case 146: + case 124: + case 145: + case 161: + return true; + } + return false; + } + ts2.isModifierKind = isModifierKind; + function isParameterPropertyModifier(kind) { + return !!(ts2.modifierToFlag(kind) & 16476); + } + ts2.isParameterPropertyModifier = isParameterPropertyModifier; + function isClassMemberModifier(idToken) { + return isParameterPropertyModifier(idToken) || idToken === 124 || idToken === 161 || idToken === 127; + } + ts2.isClassMemberModifier = isClassMemberModifier; + function isModifier(node) { + return isModifierKind(node.kind); + } + ts2.isModifier = isModifier; + function isEntityName(node) { + var kind = node.kind; + return kind === 163 || kind === 79; + } + ts2.isEntityName = isEntityName; + function isPropertyName(node) { + var kind = node.kind; + return kind === 79 || kind === 80 || kind === 10 || kind === 8 || kind === 164; + } + ts2.isPropertyName = isPropertyName; + function isBindingName(node) { + var kind = node.kind; + return kind === 79 || kind === 203 || kind === 204; + } + ts2.isBindingName = isBindingName; + function isFunctionLike(node) { + return !!node && isFunctionLikeKind(node.kind); + } + ts2.isFunctionLike = isFunctionLike; + function isFunctionLikeOrClassStaticBlockDeclaration(node) { + return !!node && (isFunctionLikeKind(node.kind) || ts2.isClassStaticBlockDeclaration(node)); + } + ts2.isFunctionLikeOrClassStaticBlockDeclaration = isFunctionLikeOrClassStaticBlockDeclaration; + function isFunctionLikeDeclaration(node) { + return node && isFunctionLikeDeclarationKind(node.kind); + } + ts2.isFunctionLikeDeclaration = isFunctionLikeDeclaration; + function isBooleanLiteral(node) { + return node.kind === 110 || node.kind === 95; + } + ts2.isBooleanLiteral = isBooleanLiteral; + function isFunctionLikeDeclarationKind(kind) { + switch (kind) { + case 259: + case 171: + case 173: + case 174: + case 175: + case 215: + case 216: + return true; + default: + return false; + } + } + function isFunctionLikeKind(kind) { + switch (kind) { + case 170: + case 176: + case 326: + case 177: + case 178: + case 181: + case 320: + case 182: + return true; + default: + return isFunctionLikeDeclarationKind(kind); + } + } + ts2.isFunctionLikeKind = isFunctionLikeKind; + function isFunctionOrModuleBlock(node) { + return ts2.isSourceFile(node) || ts2.isModuleBlock(node) || ts2.isBlock(node) && isFunctionLike(node.parent); + } + ts2.isFunctionOrModuleBlock = isFunctionOrModuleBlock; + function isClassElement(node) { + var kind = node.kind; + return kind === 173 || kind === 169 || kind === 171 || kind === 174 || kind === 175 || kind === 178 || kind === 172 || kind === 237; + } + ts2.isClassElement = isClassElement; + function isClassLike(node) { + return node && (node.kind === 260 || node.kind === 228); + } + ts2.isClassLike = isClassLike; + function isAccessor(node) { + return node && (node.kind === 174 || node.kind === 175); + } + ts2.isAccessor = isAccessor; + function isAutoAccessorPropertyDeclaration(node) { + return ts2.isPropertyDeclaration(node) && ts2.hasAccessorModifier(node); + } + ts2.isAutoAccessorPropertyDeclaration = isAutoAccessorPropertyDeclaration; + function isMethodOrAccessor(node) { + switch (node.kind) { + case 171: + case 174: + case 175: + return true; + default: + return false; + } + } + ts2.isMethodOrAccessor = isMethodOrAccessor; + function isNamedClassElement(node) { + switch (node.kind) { + case 171: + case 174: + case 175: + case 169: + return true; + default: + return false; + } + } + ts2.isNamedClassElement = isNamedClassElement; + function isModifierLike(node) { + return isModifier(node) || ts2.isDecorator(node); + } + ts2.isModifierLike = isModifierLike; + function isTypeElement(node) { + var kind = node.kind; + return kind === 177 || kind === 176 || kind === 168 || kind === 170 || kind === 178 || kind === 174 || kind === 175; + } + ts2.isTypeElement = isTypeElement; + function isClassOrTypeElement(node) { + return isTypeElement(node) || isClassElement(node); + } + ts2.isClassOrTypeElement = isClassOrTypeElement; + function isObjectLiteralElementLike(node) { + var kind = node.kind; + return kind === 299 || kind === 300 || kind === 301 || kind === 171 || kind === 174 || kind === 175; + } + ts2.isObjectLiteralElementLike = isObjectLiteralElementLike; + function isTypeNode(node) { + return ts2.isTypeNodeKind(node.kind); + } + ts2.isTypeNode = isTypeNode; + function isFunctionOrConstructorTypeNode(node) { + switch (node.kind) { + case 181: + case 182: + return true; + } + return false; + } + ts2.isFunctionOrConstructorTypeNode = isFunctionOrConstructorTypeNode; + function isBindingPattern(node) { + if (node) { + var kind = node.kind; + return kind === 204 || kind === 203; + } + return false; + } + ts2.isBindingPattern = isBindingPattern; + function isAssignmentPattern(node) { + var kind = node.kind; + return kind === 206 || kind === 207; + } + ts2.isAssignmentPattern = isAssignmentPattern; + function isArrayBindingElement(node) { + var kind = node.kind; + return kind === 205 || kind === 229; + } + ts2.isArrayBindingElement = isArrayBindingElement; + function isDeclarationBindingElement(bindingElement) { + switch (bindingElement.kind) { + case 257: + case 166: + case 205: + return true; + } + return false; + } + ts2.isDeclarationBindingElement = isDeclarationBindingElement; + function isBindingOrAssignmentPattern(node) { + return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); + } + ts2.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; + function isObjectBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 203: + case 207: + return true; + } + return false; + } + ts2.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; + function isObjectBindingOrAssignmentElement(node) { + switch (node.kind) { + case 205: + case 299: + case 300: + case 301: + return true; + } + return false; + } + ts2.isObjectBindingOrAssignmentElement = isObjectBindingOrAssignmentElement; + function isArrayBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 204: + case 206: + return true; + } + return false; + } + ts2.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; + function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { + var kind = node.kind; + return kind === 208 || kind === 163 || kind === 202; + } + ts2.isPropertyAccessOrQualifiedNameOrImportTypeNode = isPropertyAccessOrQualifiedNameOrImportTypeNode; + function isPropertyAccessOrQualifiedName(node) { + var kind = node.kind; + return kind === 208 || kind === 163; + } + ts2.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; + function isCallLikeExpression(node) { + switch (node.kind) { + case 283: + case 282: + case 210: + case 211: + case 212: + case 167: + return true; + default: + return false; + } + } + ts2.isCallLikeExpression = isCallLikeExpression; + function isCallOrNewExpression(node) { + return node.kind === 210 || node.kind === 211; + } + ts2.isCallOrNewExpression = isCallOrNewExpression; + function isTemplateLiteral(node) { + var kind = node.kind; + return kind === 225 || kind === 14; + } + ts2.isTemplateLiteral = isTemplateLiteral; + function isLeftHandSideExpression(node) { + return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + ts2.isLeftHandSideExpression = isLeftHandSideExpression; + function isLeftHandSideExpressionKind(kind) { + switch (kind) { + case 208: + case 209: + case 211: + case 210: + case 281: + case 282: + case 285: + case 212: + case 206: + case 214: + case 207: + case 228: + case 215: + case 79: + case 80: + case 13: + case 8: + case 9: + case 10: + case 14: + case 225: + case 95: + case 104: + case 108: + case 110: + case 106: + case 232: + case 230: + case 233: + case 100: + return true; + default: + return false; + } + } + function isUnaryExpression(node) { + return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + ts2.isUnaryExpression = isUnaryExpression; + function isUnaryExpressionKind(kind) { + switch (kind) { + case 221: + case 222: + case 217: + case 218: + case 219: + case 220: + case 213: + return true; + default: + return isLeftHandSideExpressionKind(kind); + } + } + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 222: + return true; + case 221: + return expr.operator === 45 || expr.operator === 46; + default: + return false; + } + } + ts2.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite; + function isExpression(node) { + return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + ts2.isExpression = isExpression; + function isExpressionKind(kind) { + switch (kind) { + case 224: + case 226: + case 216: + case 223: + case 227: + case 231: + case 229: + case 354: + case 353: + case 235: + return true; + default: + return isUnaryExpressionKind(kind); + } + } + function isAssertionExpression(node) { + var kind = node.kind; + return kind === 213 || kind === 231; + } + ts2.isAssertionExpression = isAssertionExpression; + function isNotEmittedOrPartiallyEmittedNode(node) { + return ts2.isNotEmittedStatement(node) || ts2.isPartiallyEmittedExpression(node); + } + ts2.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 245: + case 246: + case 247: + case 243: + case 244: + return true; + case 253: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + ts2.isIterationStatement = isIterationStatement; + function isScopeMarker(node) { + return ts2.isExportAssignment(node) || ts2.isExportDeclaration(node); + } + ts2.isScopeMarker = isScopeMarker; + function hasScopeMarker(statements) { + return ts2.some(statements, isScopeMarker); + } + ts2.hasScopeMarker = hasScopeMarker; + function needsScopeMarker(result2) { + return !ts2.isAnyImportOrReExport(result2) && !ts2.isExportAssignment(result2) && !ts2.hasSyntacticModifier( + result2, + 1 + /* ModifierFlags.Export */ + ) && !ts2.isAmbientModule(result2); + } + ts2.needsScopeMarker = needsScopeMarker; + function isExternalModuleIndicator(result2) { + return ts2.isAnyImportOrReExport(result2) || ts2.isExportAssignment(result2) || ts2.hasSyntacticModifier( + result2, + 1 + /* ModifierFlags.Export */ + ); + } + ts2.isExternalModuleIndicator = isExternalModuleIndicator; + function isForInOrOfStatement(node) { + return node.kind === 246 || node.kind === 247; + } + ts2.isForInOrOfStatement = isForInOrOfStatement; + function isConciseBody(node) { + return ts2.isBlock(node) || isExpression(node); + } + ts2.isConciseBody = isConciseBody; + function isFunctionBody(node) { + return ts2.isBlock(node); + } + ts2.isFunctionBody = isFunctionBody; + function isForInitializer(node) { + return ts2.isVariableDeclarationList(node) || isExpression(node); + } + ts2.isForInitializer = isForInitializer; + function isModuleBody(node) { + var kind = node.kind; + return kind === 265 || kind === 264 || kind === 79; + } + ts2.isModuleBody = isModuleBody; + function isNamespaceBody(node) { + var kind = node.kind; + return kind === 265 || kind === 264; + } + ts2.isNamespaceBody = isNamespaceBody; + function isJSDocNamespaceBody(node) { + var kind = node.kind; + return kind === 79 || kind === 264; + } + ts2.isJSDocNamespaceBody = isJSDocNamespaceBody; + function isNamedImportBindings(node) { + var kind = node.kind; + return kind === 272 || kind === 271; + } + ts2.isNamedImportBindings = isNamedImportBindings; + function isModuleOrEnumDeclaration(node) { + return node.kind === 264 || node.kind === 263; + } + ts2.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; + function isDeclarationKind(kind) { + return kind === 216 || kind === 205 || kind === 260 || kind === 228 || kind === 172 || kind === 173 || kind === 263 || kind === 302 || kind === 278 || kind === 259 || kind === 215 || kind === 174 || kind === 270 || kind === 268 || kind === 273 || kind === 261 || kind === 288 || kind === 171 || kind === 170 || kind === 264 || kind === 267 || kind === 271 || kind === 277 || kind === 166 || kind === 299 || kind === 169 || kind === 168 || kind === 175 || kind === 300 || kind === 262 || kind === 165 || kind === 257 || kind === 348 || kind === 341 || kind === 350; + } + function isDeclarationStatementKind(kind) { + return kind === 259 || kind === 279 || kind === 260 || kind === 261 || kind === 262 || kind === 263 || kind === 264 || kind === 269 || kind === 268 || kind === 275 || kind === 274 || kind === 267; + } + function isStatementKindButNotDeclarationKind(kind) { + return kind === 249 || kind === 248 || kind === 256 || kind === 243 || kind === 241 || kind === 239 || kind === 246 || kind === 247 || kind === 245 || kind === 242 || kind === 253 || kind === 250 || kind === 252 || kind === 254 || kind === 255 || kind === 240 || kind === 244 || kind === 251 || kind === 352 || kind === 356 || kind === 355; + } + function isDeclaration(node) { + if (node.kind === 165) { + return node.parent && node.parent.kind !== 347 || ts2.isInJSFile(node); + } + return isDeclarationKind(node.kind); + } + ts2.isDeclaration = isDeclaration; + function isDeclarationStatement(node) { + return isDeclarationStatementKind(node.kind); + } + ts2.isDeclarationStatement = isDeclarationStatement; + function isStatementButNotDeclaration(node) { + return isStatementKindButNotDeclarationKind(node.kind); + } + ts2.isStatementButNotDeclaration = isStatementButNotDeclaration; + function isStatement(node) { + var kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); + } + ts2.isStatement = isStatement; + function isBlockStatement(node) { + if (node.kind !== 238) + return false; + if (node.parent !== void 0) { + if (node.parent.kind === 255 || node.parent.kind === 295) { + return false; + } + } + return !ts2.isFunctionBlock(node); + } + function isStatementOrBlock(node) { + var kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 238; + } + ts2.isStatementOrBlock = isStatementOrBlock; + function isModuleReference(node) { + var kind = node.kind; + return kind === 280 || kind === 163 || kind === 79; + } + ts2.isModuleReference = isModuleReference; + function isJsxTagNameExpression(node) { + var kind = node.kind; + return kind === 108 || kind === 79 || kind === 208; + } + ts2.isJsxTagNameExpression = isJsxTagNameExpression; + function isJsxChild(node) { + var kind = node.kind; + return kind === 281 || kind === 291 || kind === 282 || kind === 11 || kind === 285; + } + ts2.isJsxChild = isJsxChild; + function isJsxAttributeLike(node) { + var kind = node.kind; + return kind === 288 || kind === 290; + } + ts2.isJsxAttributeLike = isJsxAttributeLike; + function isStringLiteralOrJsxExpression(node) { + var kind = node.kind; + return kind === 10 || kind === 291; + } + ts2.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; + function isJsxOpeningLikeElement(node) { + var kind = node.kind; + return kind === 283 || kind === 282; + } + ts2.isJsxOpeningLikeElement = isJsxOpeningLikeElement; + function isCaseOrDefaultClause(node) { + var kind = node.kind; + return kind === 292 || kind === 293; + } + ts2.isCaseOrDefaultClause = isCaseOrDefaultClause; + function isJSDocNode(node) { + return node.kind >= 312 && node.kind <= 350; + } + ts2.isJSDocNode = isJSDocNode; + function isJSDocCommentContainingNode(node) { + return node.kind === 323 || node.kind === 322 || node.kind === 324 || isJSDocLinkLike(node) || isJSDocTag(node) || ts2.isJSDocTypeLiteral(node) || ts2.isJSDocSignature(node); + } + ts2.isJSDocCommentContainingNode = isJSDocCommentContainingNode; + function isJSDocTag(node) { + return node.kind >= 330 && node.kind <= 350; + } + ts2.isJSDocTag = isJSDocTag; + function isSetAccessor(node) { + return node.kind === 175; + } + ts2.isSetAccessor = isSetAccessor; + function isGetAccessor(node) { + return node.kind === 174; + } + ts2.isGetAccessor = isGetAccessor; + function hasJSDocNodes(node) { + var jsDoc = node.jsDoc; + return !!jsDoc && jsDoc.length > 0; + } + ts2.hasJSDocNodes = hasJSDocNodes; + function hasType(node) { + return !!node.type; + } + ts2.hasType = hasType; + function hasInitializer(node) { + return !!node.initializer; + } + ts2.hasInitializer = hasInitializer; + function hasOnlyExpressionInitializer(node) { + switch (node.kind) { + case 257: + case 166: + case 205: + case 169: + case 299: + case 302: + return true; + default: + return false; + } + } + ts2.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + return node.kind === 288 || node.kind === 290 || isObjectLiteralElementLike(node); + } + ts2.isObjectLiteralElement = isObjectLiteralElement; + function isTypeReferenceType(node) { + return node.kind === 180 || node.kind === 230; + } + ts2.isTypeReferenceType = isTypeReferenceType; + var MAX_SMI_X86 = 1073741823; + function guessIndentation(lines) { + var indentation = MAX_SMI_X86; + for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { + var line = lines_1[_i]; + if (!line.length) { + continue; + } + var i7 = 0; + for (; i7 < line.length && i7 < indentation; i7++) { + if (!ts2.isWhiteSpaceLike(line.charCodeAt(i7))) { + break; + } + } + if (i7 < indentation) { + indentation = i7; + } + if (indentation === 0) { + return 0; + } + } + return indentation === MAX_SMI_X86 ? void 0 : indentation; + } + ts2.guessIndentation = guessIndentation; + function isStringLiteralLike(node) { + return node.kind === 10 || node.kind === 14; + } + ts2.isStringLiteralLike = isStringLiteralLike; + function isJSDocLinkLike(node) { + return node.kind === 327 || node.kind === 328 || node.kind === 329; + } + ts2.isJSDocLinkLike = isJSDocLinkLike; + function hasRestParameter(s7) { + var last2 = ts2.lastOrUndefined(s7.parameters); + return !!last2 && isRestParameter(last2); + } + ts2.hasRestParameter = hasRestParameter; + function isRestParameter(node) { + var type3 = ts2.isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; + return node.dotDotDotToken !== void 0 || !!type3 && type3.kind === 321; + } + ts2.isRestParameter = isRestParameter; + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.resolvingEmptyArray = []; + ts2.externalHelpersModuleNameText = "tslib"; + ts2.defaultMaximumTruncationLength = 160; + ts2.noTruncationMaximumTruncationLength = 1e6; + function getDeclarationOfKind(symbol, kind) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) { + var declaration = declarations_1[_i]; + if (declaration.kind === kind) { + return declaration; + } + } + } + return void 0; + } + ts2.getDeclarationOfKind = getDeclarationOfKind; + function getDeclarationsOfKind(symbol, kind) { + return ts2.filter(symbol.declarations || ts2.emptyArray, function(d7) { + return d7.kind === kind; + }); + } + ts2.getDeclarationsOfKind = getDeclarationsOfKind; + function createSymbolTable(symbols) { + var result2 = new ts2.Map(); + if (symbols) { + for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { + var symbol = symbols_1[_i]; + result2.set(symbol.escapedName, symbol); + } + } + return result2; + } + ts2.createSymbolTable = createSymbolTable; + function isTransientSymbol(symbol) { + return (symbol.flags & 33554432) !== 0; + } + ts2.isTransientSymbol = isTransientSymbol; + var stringWriter = createSingleLineStringWriter(); + function createSingleLineStringWriter() { + var str2 = ""; + var writeText = function(text) { + return str2 += text; + }; + return { + getText: function() { + return str2; + }, + write: writeText, + rawWrite: writeText, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: function(s7, _6) { + return writeText(s7); + }, + writeTrailingSemicolon: writeText, + writeComment: writeText, + getTextPos: function() { + return str2.length; + }, + getLine: function() { + return 0; + }, + getColumn: function() { + return 0; + }, + getIndent: function() { + return 0; + }, + isAtStartOfLine: function() { + return false; + }, + hasTrailingComment: function() { + return false; + }, + hasTrailingWhitespace: function() { + return !!str2.length && ts2.isWhiteSpaceLike(str2.charCodeAt(str2.length - 1)); + }, + // Completely ignore indentation for string writers. And map newlines to + // a single space. + writeLine: function() { + return str2 += " "; + }, + increaseIndent: ts2.noop, + decreaseIndent: ts2.noop, + clear: function() { + return str2 = ""; + }, + trackSymbol: function() { + return false; + }, + reportInaccessibleThisError: ts2.noop, + reportInaccessibleUniqueSymbolError: ts2.noop, + reportPrivateInBaseOfClassExpression: ts2.noop + }; + } + function changesAffectModuleResolution(oldOptions, newOptions) { + return oldOptions.configFilePath !== newOptions.configFilePath || optionsHaveModuleResolutionChanges(oldOptions, newOptions); + } + ts2.changesAffectModuleResolution = changesAffectModuleResolution; + function optionsHaveModuleResolutionChanges(oldOptions, newOptions) { + return optionsHaveChanges(oldOptions, newOptions, ts2.moduleResolutionOptionDeclarations); + } + ts2.optionsHaveModuleResolutionChanges = optionsHaveModuleResolutionChanges; + function changesAffectingProgramStructure(oldOptions, newOptions) { + return optionsHaveChanges(oldOptions, newOptions, ts2.optionsAffectingProgramStructure); + } + ts2.changesAffectingProgramStructure = changesAffectingProgramStructure; + function optionsHaveChanges(oldOptions, newOptions, optionDeclarations) { + return oldOptions !== newOptions && optionDeclarations.some(function(o7) { + return !isJsonEqual(getCompilerOptionValue(oldOptions, o7), getCompilerOptionValue(newOptions, o7)); + }); + } + ts2.optionsHaveChanges = optionsHaveChanges; + function forEachAncestor(node, callback) { + while (true) { + var res = callback(node); + if (res === "quit") + return void 0; + if (res !== void 0) + return res; + if (ts2.isSourceFile(node)) + return void 0; + node = node.parent; + } + } + ts2.forEachAncestor = forEachAncestor; + function forEachEntry(map4, callback) { + var iterator = map4.entries(); + for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + var _a2 = iterResult.value, key = _a2[0], value2 = _a2[1]; + var result2 = callback(value2, key); + if (result2) { + return result2; + } + } + return void 0; + } + ts2.forEachEntry = forEachEntry; + function forEachKey(map4, callback) { + var iterator = map4.keys(); + for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + var result2 = callback(iterResult.value); + if (result2) { + return result2; + } + } + return void 0; + } + ts2.forEachKey = forEachKey; + function copyEntries(source, target) { + source.forEach(function(value2, key) { + target.set(key, value2); + }); + } + ts2.copyEntries = copyEntries; + function usingSingleLineStringWriter(action) { + var oldString = stringWriter.getText(); + try { + action(stringWriter); + return stringWriter.getText(); + } finally { + stringWriter.clear(); + stringWriter.writeKeyword(oldString); + } + } + ts2.usingSingleLineStringWriter = usingSingleLineStringWriter; + function getFullWidth(node) { + return node.end - node.pos; + } + ts2.getFullWidth = getFullWidth; + function getResolvedModule(sourceFile, moduleNameText, mode) { + return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText, mode); + } + ts2.getResolvedModule = getResolvedModule; + function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) { + if (!sourceFile.resolvedModules) { + sourceFile.resolvedModules = ts2.createModeAwareCache(); + } + sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule); + } + ts2.setResolvedModule = setResolvedModule; + function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective) { + if (!sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames = ts2.createModeAwareCache(); + } + sourceFile.resolvedTypeReferenceDirectiveNames.set( + typeReferenceDirectiveName, + /*mode*/ + void 0, + resolvedTypeReferenceDirective + ); + } + ts2.setResolvedTypeReferenceDirective = setResolvedTypeReferenceDirective; + function projectReferenceIsEqualTo(oldRef, newRef) { + return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular; + } + ts2.projectReferenceIsEqualTo = projectReferenceIsEqualTo; + function moduleResolutionIsEqualTo(oldResolution, newResolution) { + return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); + } + ts2.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; + function packageIdIsEqual(a7, b8) { + return a7 === b8 || !!a7 && !!b8 && a7.name === b8.name && a7.subModuleName === b8.subModuleName && a7.version === b8.version; + } + function packageIdToPackageName(_a2) { + var name2 = _a2.name, subModuleName = _a2.subModuleName; + return subModuleName ? "".concat(name2, "/").concat(subModuleName) : name2; + } + ts2.packageIdToPackageName = packageIdToPackageName; + function packageIdToString(packageId) { + return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version); + } + ts2.packageIdToString = packageIdToString; + function typeDirectiveIsEqualTo(oldResolution, newResolution) { + return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary && oldResolution.originalPath === newResolution.originalPath; + } + ts2.typeDirectiveIsEqualTo = typeDirectiveIsEqualTo; + function hasChangesInResolutions(names, newResolutions, oldResolutions, oldSourceFile, comparer) { + ts2.Debug.assert(names.length === newResolutions.length); + for (var i7 = 0; i7 < names.length; i7++) { + var newResolution = newResolutions[i7]; + var entry = names[i7]; + var name2 = !ts2.isString(entry) ? entry.fileName.toLowerCase() : entry; + var mode = !ts2.isString(entry) ? ts2.getModeForFileReference(entry, oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.impliedNodeFormat) : oldSourceFile && ts2.getModeForResolutionAtIndex(oldSourceFile, i7); + var oldResolution = oldResolutions && oldResolutions.get(name2, mode); + var changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; + if (changed) { + return true; + } + } + return false; + } + ts2.hasChangesInResolutions = hasChangesInResolutions; + function containsParseError(node) { + aggregateChildData(node); + return (node.flags & 524288) !== 0; + } + ts2.containsParseError = containsParseError; + function aggregateChildData(node) { + if (!(node.flags & 1048576)) { + var thisNodeOrAnySubNodesHasError = (node.flags & 131072) !== 0 || ts2.forEachChild(node, containsParseError); + if (thisNodeOrAnySubNodesHasError) { + node.flags |= 524288; + } + node.flags |= 1048576; + } + } + function getSourceFileOfNode(node) { + while (node && node.kind !== 308) { + node = node.parent; + } + return node; + } + ts2.getSourceFileOfNode = getSourceFileOfNode; + function getSourceFileOfModule(module6) { + return getSourceFileOfNode(module6.valueDeclaration || getNonAugmentationDeclaration(module6)); + } + ts2.getSourceFileOfModule = getSourceFileOfModule; + function isPlainJsFile(file, checkJs) { + return !!file && (file.scriptKind === 1 || file.scriptKind === 2) && !file.checkJsDirective && checkJs === void 0; + } + ts2.isPlainJsFile = isPlainJsFile; + function isStatementWithLocals(node) { + switch (node.kind) { + case 238: + case 266: + case 245: + case 246: + case 247: + return true; + } + return false; + } + ts2.isStatementWithLocals = isStatementWithLocals; + function getStartPositionOfLine(line, sourceFile) { + ts2.Debug.assert(line >= 0); + return ts2.getLineStarts(sourceFile)[line]; + } + ts2.getStartPositionOfLine = getStartPositionOfLine; + function nodePosToString(node) { + var file = getSourceFileOfNode(node); + var loc = ts2.getLineAndCharacterOfPosition(file, node.pos); + return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")"); + } + ts2.nodePosToString = nodePosToString; + function getEndLinePosition(line, sourceFile) { + ts2.Debug.assert(line >= 0); + var lineStarts = ts2.getLineStarts(sourceFile); + var lineIndex = line; + var sourceText = sourceFile.text; + if (lineIndex + 1 === lineStarts.length) { + return sourceText.length - 1; + } else { + var start = lineStarts[lineIndex]; + var pos = lineStarts[lineIndex + 1] - 1; + ts2.Debug.assert(ts2.isLineBreak(sourceText.charCodeAt(pos))); + while (start <= pos && ts2.isLineBreak(sourceText.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + ts2.getEndLinePosition = getEndLinePosition; + function isFileLevelUniqueName(sourceFile, name2, hasGlobalName) { + return !(hasGlobalName && hasGlobalName(name2)) && !sourceFile.identifiers.has(name2); + } + ts2.isFileLevelUniqueName = isFileLevelUniqueName; + function nodeIsMissing(node) { + if (node === void 0) { + return true; + } + return node.pos === node.end && node.pos >= 0 && node.kind !== 1; + } + ts2.nodeIsMissing = nodeIsMissing; + function nodeIsPresent(node) { + return !nodeIsMissing(node); + } + ts2.nodeIsPresent = nodeIsPresent; + function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { + if (from === void 0 || from.length === 0) + return to; + var statementIndex = 0; + for (; statementIndex < to.length; ++statementIndex) { + if (!isPrologueDirective2(to[statementIndex])) { + break; + } + } + to.splice.apply(to, __spreadArray9([statementIndex, 0], from, false)); + return to; + } + function insertStatementAfterPrologue(to, statement, isPrologueDirective2) { + if (statement === void 0) + return to; + var statementIndex = 0; + for (; statementIndex < to.length; ++statementIndex) { + if (!isPrologueDirective2(to[statementIndex])) { + break; + } + } + to.splice(statementIndex, 0, statement); + return to; + } + function isAnyPrologueDirective(node) { + return isPrologueDirective(node) || !!(getEmitFlags(node) & 1048576); + } + function insertStatementsAfterStandardPrologue(to, from) { + return insertStatementsAfterPrologue(to, from, isPrologueDirective); + } + ts2.insertStatementsAfterStandardPrologue = insertStatementsAfterStandardPrologue; + function insertStatementsAfterCustomPrologue(to, from) { + return insertStatementsAfterPrologue(to, from, isAnyPrologueDirective); + } + ts2.insertStatementsAfterCustomPrologue = insertStatementsAfterCustomPrologue; + function insertStatementAfterStandardPrologue(to, statement) { + return insertStatementAfterPrologue(to, statement, isPrologueDirective); + } + ts2.insertStatementAfterStandardPrologue = insertStatementAfterStandardPrologue; + function insertStatementAfterCustomPrologue(to, statement) { + return insertStatementAfterPrologue(to, statement, isAnyPrologueDirective); + } + ts2.insertStatementAfterCustomPrologue = insertStatementAfterCustomPrologue; + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47) { + var textSubStr = text.substring(commentPos, commentEnd); + return ts2.fullTripleSlashReferencePathRegEx.test(textSubStr) || ts2.fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; + } + return false; + } + ts2.isRecognizedTripleSlashComment = isRecognizedTripleSlashComment; + function isPinnedComment(text, start) { + return text.charCodeAt(start + 1) === 42 && text.charCodeAt(start + 2) === 33; + } + ts2.isPinnedComment = isPinnedComment; + function createCommentDirectivesMap(sourceFile, commentDirectives) { + var directivesByLine = new ts2.Map(commentDirectives.map(function(commentDirective) { + return [ + "".concat(ts2.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line), + commentDirective + ]; + })); + var usedLines = new ts2.Map(); + return { getUnusedExpectations, markUsed }; + function getUnusedExpectations() { + return ts2.arrayFrom(directivesByLine.entries()).filter(function(_a2) { + var line = _a2[0], directive = _a2[1]; + return directive.type === 0 && !usedLines.get(line); + }).map(function(_a2) { + var _6 = _a2[0], directive = _a2[1]; + return directive; + }); + } + function markUsed(line) { + if (!directivesByLine.has("".concat(line))) { + return false; + } + usedLines.set("".concat(line), true); + return true; + } + } + ts2.createCommentDirectivesMap = createCommentDirectivesMap; + function getTokenPosOfNode(node, sourceFile, includeJsDoc) { + if (nodeIsMissing(node)) { + return node.pos; + } + if (ts2.isJSDocNode(node) || node.kind === 11) { + return ts2.skipTrivia( + (sourceFile || getSourceFileOfNode(node)).text, + node.pos, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + if (includeJsDoc && ts2.hasJSDocNodes(node)) { + return getTokenPosOfNode(node.jsDoc[0], sourceFile); + } + if (node.kind === 351 && node._children.length > 0) { + return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); + } + return ts2.skipTrivia( + (sourceFile || getSourceFileOfNode(node)).text, + node.pos, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + false, + isInJSDoc(node) + ); + } + ts2.getTokenPosOfNode = getTokenPosOfNode; + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + var lastDecorator = !nodeIsMissing(node) && ts2.canHaveModifiers(node) ? ts2.findLast(node.modifiers, ts2.isDecorator) : void 0; + if (!lastDecorator) { + return getTokenPosOfNode(node, sourceFile); + } + return ts2.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end); + } + ts2.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; + function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) { + if (includeTrivia === void 0) { + includeTrivia = false; + } + return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); + } + ts2.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; + function isJSDocTypeExpressionOrChild(node) { + return !!ts2.findAncestor(node, ts2.isJSDocTypeExpression); + } + function isExportNamespaceAsDefaultDeclaration(node) { + return !!(ts2.isExportDeclaration(node) && node.exportClause && ts2.isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); + } + ts2.isExportNamespaceAsDefaultDeclaration = isExportNamespaceAsDefaultDeclaration; + function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { + if (includeTrivia === void 0) { + includeTrivia = false; + } + if (nodeIsMissing(node)) { + return ""; + } + var text = sourceText.substring(includeTrivia ? node.pos : ts2.skipTrivia(sourceText, node.pos), node.end); + if (isJSDocTypeExpressionOrChild(node)) { + text = text.split(/\r\n|\n|\r/).map(function(line) { + return ts2.trimStringStart(line.replace(/^\s*\*/, "")); + }).join("\n"); + } + return text; + } + ts2.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; + function getTextOfNode(node, includeTrivia) { + if (includeTrivia === void 0) { + includeTrivia = false; + } + return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); + } + ts2.getTextOfNode = getTextOfNode; + function getPos(range2) { + return range2.pos; + } + function indexOfNode(nodeArray, node) { + return ts2.binarySearch(nodeArray, node, getPos, ts2.compareValues); + } + ts2.indexOfNode = indexOfNode; + function getEmitFlags(node) { + var emitNode = node.emitNode; + return emitNode && emitNode.flags || 0; + } + ts2.getEmitFlags = getEmitFlags; + function getScriptTargetFeatures() { + return { + es2015: { + Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"], + RegExp: ["flags", "sticky", "unicode"], + Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"], + ArrayConstructor: ["from", "of"], + ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"], + NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"], + Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"], + Map: ["entries", "keys", "values"], + Set: ["entries", "keys", "values"], + Promise: ts2.emptyArray, + PromiseConstructor: ["all", "race", "reject", "resolve"], + Symbol: ["for", "keyFor"], + WeakMap: ["entries", "keys", "values"], + WeakSet: ["entries", "keys", "values"], + Iterator: ts2.emptyArray, + AsyncIterator: ts2.emptyArray, + String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"], + StringConstructor: ["fromCodePoint", "raw"] + }, + es2016: { + Array: ["includes"] + }, + es2017: { + Atomics: ts2.emptyArray, + SharedArrayBuffer: ts2.emptyArray, + String: ["padStart", "padEnd"], + ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"], + DateTimeFormat: ["formatToParts"] + }, + es2018: { + Promise: ["finally"], + RegExpMatchArray: ["groups"], + RegExpExecArray: ["groups"], + RegExp: ["dotAll"], + Intl: ["PluralRules"], + AsyncIterable: ts2.emptyArray, + AsyncIterableIterator: ts2.emptyArray, + AsyncGenerator: ts2.emptyArray, + AsyncGeneratorFunction: ts2.emptyArray, + NumberFormat: ["formatToParts"] + }, + es2019: { + Array: ["flat", "flatMap"], + ObjectConstructor: ["fromEntries"], + String: ["trimStart", "trimEnd", "trimLeft", "trimRight"], + Symbol: ["description"] + }, + es2020: { + BigInt: ts2.emptyArray, + BigInt64Array: ts2.emptyArray, + BigUint64Array: ts2.emptyArray, + PromiseConstructor: ["allSettled"], + SymbolConstructor: ["matchAll"], + String: ["matchAll"], + DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"], + RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"] + }, + es2021: { + PromiseConstructor: ["any"], + String: ["replaceAll"] + }, + es2022: { + Array: ["at"], + String: ["at"], + Int8Array: ["at"], + Uint8Array: ["at"], + Uint8ClampedArray: ["at"], + Int16Array: ["at"], + Uint16Array: ["at"], + Int32Array: ["at"], + Uint32Array: ["at"], + Float32Array: ["at"], + Float64Array: ["at"], + BigInt64Array: ["at"], + BigUint64Array: ["at"], + ObjectConstructor: ["hasOwn"], + Error: ["cause"] + } + }; + } + ts2.getScriptTargetFeatures = getScriptTargetFeatures; + var GetLiteralTextFlags; + (function(GetLiteralTextFlags2) { + GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None"; + GetLiteralTextFlags2[GetLiteralTextFlags2["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; + GetLiteralTextFlags2[GetLiteralTextFlags2["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; + GetLiteralTextFlags2[GetLiteralTextFlags2["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; + GetLiteralTextFlags2[GetLiteralTextFlags2["AllowNumericSeparator"] = 8] = "AllowNumericSeparator"; + })(GetLiteralTextFlags = ts2.GetLiteralTextFlags || (ts2.GetLiteralTextFlags = {})); + function getLiteralText(node, sourceFile, flags) { + var _a2; + if (sourceFile && canUseOriginalText(node, flags)) { + return getSourceTextOfNodeFromSourceFile(sourceFile, node); + } + switch (node.kind) { + case 10: { + var escapeText = flags & 2 ? escapeJsxAttributeString : flags & 1 || getEmitFlags(node) & 16777216 ? escapeString2 : escapeNonAsciiString; + if (node.singleQuote) { + return "'" + escapeText( + node.text, + 39 + /* CharacterCodes.singleQuote */ + ) + "'"; + } else { + return '"' + escapeText( + node.text, + 34 + /* CharacterCodes.doubleQuote */ + ) + '"'; + } + } + case 14: + case 15: + case 16: + case 17: { + var escapeText = flags & 1 || getEmitFlags(node) & 16777216 ? escapeString2 : escapeNonAsciiString; + var rawText = (_a2 = node.rawText) !== null && _a2 !== void 0 ? _a2 : escapeTemplateSubstitution(escapeText( + node.text, + 96 + /* CharacterCodes.backtick */ + )); + switch (node.kind) { + case 14: + return "`" + rawText + "`"; + case 15: + return "`" + rawText + "${"; + case 16: + return "}" + rawText + "${"; + case 17: + return "}" + rawText + "`"; + } + break; + } + case 8: + case 9: + return node.text; + case 13: + if (flags & 4 && node.isUnterminated) { + return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 ? " /" : "/"); + } + return node.text; + } + return ts2.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for.")); + } + ts2.getLiteralText = getLiteralText; + function canUseOriginalText(node, flags) { + if (nodeIsSynthesized(node) || !node.parent || flags & 4 && node.isUnterminated) { + return false; + } + if (ts2.isNumericLiteral(node) && node.numericLiteralFlags & 512) { + return !!(flags & 8); + } + return !ts2.isBigIntLiteral(node); + } + function getTextOfConstantValue(value2) { + return ts2.isString(value2) ? '"' + escapeNonAsciiString(value2) + '"' : "" + value2; + } + ts2.getTextOfConstantValue = getTextOfConstantValue; + function makeIdentifierFromModuleName(moduleName3) { + return ts2.getBaseFileName(moduleName3).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); + } + ts2.makeIdentifierFromModuleName = makeIdentifierFromModuleName; + function isBlockOrCatchScoped(declaration) { + return (ts2.getCombinedNodeFlags(declaration) & 3) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); + } + ts2.isBlockOrCatchScoped = isBlockOrCatchScoped; + function isCatchClauseVariableDeclarationOrBindingElement(declaration) { + var node = getRootDeclaration(declaration); + return node.kind === 257 && node.parent.kind === 295; + } + ts2.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; + function isAmbientModule(node) { + return ts2.isModuleDeclaration(node) && (node.name.kind === 10 || isGlobalScopeAugmentation(node)); + } + ts2.isAmbientModule = isAmbientModule; + function isModuleWithStringLiteralName(node) { + return ts2.isModuleDeclaration(node) && node.name.kind === 10; + } + ts2.isModuleWithStringLiteralName = isModuleWithStringLiteralName; + function isNonGlobalAmbientModule(node) { + return ts2.isModuleDeclaration(node) && ts2.isStringLiteral(node.name); + } + ts2.isNonGlobalAmbientModule = isNonGlobalAmbientModule; + function isEffectiveModuleDeclaration(node) { + return ts2.isModuleDeclaration(node) || ts2.isIdentifier(node); + } + ts2.isEffectiveModuleDeclaration = isEffectiveModuleDeclaration; + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + ts2.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; + function isShorthandAmbientModule(node) { + return !!node && node.kind === 264 && !node.body; + } + function isBlockScopedContainerTopLevel(node) { + return node.kind === 308 || node.kind === 264 || ts2.isFunctionLikeOrClassStaticBlockDeclaration(node); + } + ts2.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; + function isGlobalScopeAugmentation(module6) { + return !!(module6.flags & 1024); + } + ts2.isGlobalScopeAugmentation = isGlobalScopeAugmentation; + function isExternalModuleAugmentation(node) { + return isAmbientModule(node) && isModuleAugmentationExternal(node); + } + ts2.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isModuleAugmentationExternal(node) { + switch (node.parent.kind) { + case 308: + return ts2.isExternalModule(node.parent); + case 265: + return isAmbientModule(node.parent.parent) && ts2.isSourceFile(node.parent.parent.parent) && !ts2.isExternalModule(node.parent.parent.parent); + } + return false; + } + ts2.isModuleAugmentationExternal = isModuleAugmentationExternal; + function getNonAugmentationDeclaration(symbol) { + var _a2; + return (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(function(d7) { + return !isExternalModuleAugmentation(d7) && !(ts2.isModuleDeclaration(d7) && isGlobalScopeAugmentation(d7)); + }); + } + ts2.getNonAugmentationDeclaration = getNonAugmentationDeclaration; + function isCommonJSContainingModuleKind(kind) { + return kind === ts2.ModuleKind.CommonJS || kind === ts2.ModuleKind.Node16 || kind === ts2.ModuleKind.NodeNext; + } + function isEffectiveExternalModule(node, compilerOptions) { + return ts2.isExternalModule(node) || compilerOptions.isolatedModules || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + } + ts2.isEffectiveExternalModule = isEffectiveExternalModule; + function isEffectiveStrictModeSourceFile(node, compilerOptions) { + switch (node.scriptKind) { + case 1: + case 3: + case 2: + case 4: + break; + default: + return false; + } + if (node.isDeclarationFile) { + return false; + } + if (getStrictOptionValue(compilerOptions, "alwaysStrict")) { + return true; + } + if (ts2.startsWithUseStrict(node.statements)) { + return true; + } + if (ts2.isExternalModule(node) || compilerOptions.isolatedModules) { + if (getEmitModuleKind(compilerOptions) >= ts2.ModuleKind.ES2015) { + return true; + } + return !compilerOptions.noImplicitUseStrict; + } + return false; + } + ts2.isEffectiveStrictModeSourceFile = isEffectiveStrictModeSourceFile; + function isAmbientPropertyDeclaration(node) { + return !!(node.flags & 16777216) || hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + ); + } + ts2.isAmbientPropertyDeclaration = isAmbientPropertyDeclaration; + function isBlockScope(node, parentNode) { + switch (node.kind) { + case 308: + case 266: + case 295: + case 264: + case 245: + case 246: + case 247: + case 173: + case 171: + case 174: + case 175: + case 259: + case 215: + case 216: + case 169: + case 172: + return true; + case 238: + return !ts2.isFunctionLikeOrClassStaticBlockDeclaration(parentNode); + } + return false; + } + ts2.isBlockScope = isBlockScope; + function isDeclarationWithTypeParameters(node) { + switch (node.kind) { + case 341: + case 348: + case 326: + return true; + default: + ts2.assertType(node); + return isDeclarationWithTypeParameterChildren(node); + } + } + ts2.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; + function isDeclarationWithTypeParameterChildren(node) { + switch (node.kind) { + case 176: + case 177: + case 170: + case 178: + case 181: + case 182: + case 320: + case 260: + case 228: + case 261: + case 262: + case 347: + case 259: + case 171: + case 173: + case 174: + case 175: + case 215: + case 216: + return true; + default: + ts2.assertType(node); + return false; + } + } + ts2.isDeclarationWithTypeParameterChildren = isDeclarationWithTypeParameterChildren; + function isAnyImportSyntax(node) { + switch (node.kind) { + case 269: + case 268: + return true; + default: + return false; + } + } + ts2.isAnyImportSyntax = isAnyImportSyntax; + function isAnyImportOrBareOrAccessedRequire(node) { + return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node); + } + ts2.isAnyImportOrBareOrAccessedRequire = isAnyImportOrBareOrAccessedRequire; + function isLateVisibilityPaintedStatement(node) { + switch (node.kind) { + case 269: + case 268: + case 240: + case 260: + case 259: + case 264: + case 262: + case 261: + case 263: + return true; + default: + return false; + } + } + ts2.isLateVisibilityPaintedStatement = isLateVisibilityPaintedStatement; + function hasPossibleExternalModuleReference(node) { + return isAnyImportOrReExport(node) || ts2.isModuleDeclaration(node) || ts2.isImportTypeNode(node) || isImportCall(node); + } + ts2.hasPossibleExternalModuleReference = hasPossibleExternalModuleReference; + function isAnyImportOrReExport(node) { + return isAnyImportSyntax(node) || ts2.isExportDeclaration(node); + } + ts2.isAnyImportOrReExport = isAnyImportOrReExport; + function getEnclosingBlockScopeContainer(node) { + return ts2.findAncestor(node.parent, function(current) { + return isBlockScope(current, current.parent); + }); + } + ts2.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; + function forEachEnclosingBlockScopeContainer(node, cb) { + var container = getEnclosingBlockScopeContainer(node); + while (container) { + cb(container); + container = getEnclosingBlockScopeContainer(container); + } + } + ts2.forEachEnclosingBlockScopeContainer = forEachEnclosingBlockScopeContainer; + function declarationNameToString(name2) { + return !name2 || getFullWidth(name2) === 0 ? "(Missing)" : getTextOfNode(name2); + } + ts2.declarationNameToString = declarationNameToString; + function getNameFromIndexInfo(info2) { + return info2.declaration ? declarationNameToString(info2.declaration.parameters[0].name) : void 0; + } + ts2.getNameFromIndexInfo = getNameFromIndexInfo; + function isComputedNonLiteralName(name2) { + return name2.kind === 164 && !isStringOrNumericLiteralLike(name2.expression); + } + ts2.isComputedNonLiteralName = isComputedNonLiteralName; + function tryGetTextOfPropertyName(name2) { + switch (name2.kind) { + case 79: + case 80: + return name2.autoGenerateFlags ? void 0 : name2.escapedText; + case 10: + case 8: + case 14: + return ts2.escapeLeadingUnderscores(name2.text); + case 164: + if (isStringOrNumericLiteralLike(name2.expression)) + return ts2.escapeLeadingUnderscores(name2.expression.text); + return void 0; + default: + return ts2.Debug.assertNever(name2); + } + } + ts2.tryGetTextOfPropertyName = tryGetTextOfPropertyName; + function getTextOfPropertyName(name2) { + return ts2.Debug.checkDefined(tryGetTextOfPropertyName(name2)); + } + ts2.getTextOfPropertyName = getTextOfPropertyName; + function entityNameToString(name2) { + switch (name2.kind) { + case 108: + return "this"; + case 80: + case 79: + return getFullWidth(name2) === 0 ? ts2.idText(name2) : getTextOfNode(name2); + case 163: + return entityNameToString(name2.left) + "." + entityNameToString(name2.right); + case 208: + if (ts2.isIdentifier(name2.name) || ts2.isPrivateIdentifier(name2.name)) { + return entityNameToString(name2.expression) + "." + entityNameToString(name2.name); + } else { + return ts2.Debug.assertNever(name2.name); + } + case 314: + return entityNameToString(name2.left) + entityNameToString(name2.right); + default: + return ts2.Debug.assertNever(name2); + } + } + ts2.entityNameToString = entityNameToString; + function createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3) { + var sourceFile = getSourceFileOfNode(node); + return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); + } + ts2.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts2.skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts2.createDiagnosticForNodeArray = createDiagnosticForNodeArray; + function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { + var span = getErrorSpanForNode(sourceFile, node); + return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); + } + ts2.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile; + function createDiagnosticForNodeFromMessageChain(node, messageChain, relatedInformation) { + var sourceFile = getSourceFileOfNode(node); + var span = getErrorSpanForNode(sourceFile, node); + return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); + } + ts2.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; + function assertDiagnosticLocation(file, start, length) { + ts2.Debug.assertGreaterThanOrEqual(start, 0); + ts2.Debug.assertGreaterThanOrEqual(length, 0); + if (file) { + ts2.Debug.assertLessThanOrEqual(start, file.text.length); + ts2.Debug.assertLessThanOrEqual(start + length, file.text.length); + } + } + function createFileDiagnosticFromMessageChain(file, start, length, messageChain, relatedInformation) { + assertDiagnosticLocation(file, start, length); + return { + file, + start, + length, + code: messageChain.code, + category: messageChain.category, + messageText: messageChain.next ? messageChain : messageChain.messageText, + relatedInformation + }; + } + ts2.createFileDiagnosticFromMessageChain = createFileDiagnosticFromMessageChain; + function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { + return { + file: sourceFile, + start: 0, + length: 0, + code: messageChain.code, + category: messageChain.category, + messageText: messageChain.next ? messageChain : messageChain.messageText, + relatedInformation + }; + } + ts2.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain; + function createDiagnosticMessageChainFromDiagnostic(diagnostic) { + return typeof diagnostic.messageText === "string" ? { + code: diagnostic.code, + category: diagnostic.category, + messageText: diagnostic.messageText, + next: diagnostic.next + } : diagnostic.messageText; + } + ts2.createDiagnosticMessageChainFromDiagnostic = createDiagnosticMessageChainFromDiagnostic; + function createDiagnosticForRange(sourceFile, range2, message) { + return { + file: sourceFile, + start: range2.pos, + length: range2.end - range2.pos, + code: message.code, + category: message.category, + messageText: message.message + }; + } + ts2.createDiagnosticForRange = createDiagnosticForRange; + function getSpanOfTokenAtPosition(sourceFile, pos) { + var scanner = ts2.createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError:*/ + void 0, + pos + ); + scanner.scan(); + var start = scanner.getTokenPos(); + return ts2.createTextSpanFromBounds(start, scanner.getTextPos()); + } + ts2.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; + function getErrorSpanForArrowFunction(sourceFile, node) { + var pos = ts2.skipTrivia(sourceFile.text, node.pos); + if (node.body && node.body.kind === 238) { + var startLine = ts2.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; + var endLine = ts2.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; + if (startLine < endLine) { + return ts2.createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); + } + } + return ts2.createTextSpanFromBounds(pos, node.end); + } + function getErrorSpanForNode(sourceFile, node) { + var errorNode = node; + switch (node.kind) { + case 308: + var pos_1 = ts2.skipTrivia( + sourceFile.text, + 0, + /*stopAfterLineBreak*/ + false + ); + if (pos_1 === sourceFile.text.length) { + return ts2.createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos_1); + case 257: + case 205: + case 260: + case 228: + case 261: + case 264: + case 263: + case 302: + case 259: + case 215: + case 171: + case 174: + case 175: + case 262: + case 169: + case 168: + case 271: + errorNode = node.name; + break; + case 216: + return getErrorSpanForArrowFunction(sourceFile, node); + case 292: + case 293: + var start = ts2.skipTrivia(sourceFile.text, node.pos); + var end = node.statements.length > 0 ? node.statements[0].pos : node.end; + return ts2.createTextSpanFromBounds(start, end); + } + if (errorNode === void 0) { + return getSpanOfTokenAtPosition(sourceFile, node.pos); + } + ts2.Debug.assert(!ts2.isJSDoc(errorNode)); + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing || ts2.isJsxText(node) ? errorNode.pos : ts2.skipTrivia(sourceFile.text, errorNode.pos); + if (isMissing) { + ts2.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts2.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } else { + ts2.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts2.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + return ts2.createTextSpanFromBounds(pos, errorNode.end); + } + ts2.getErrorSpanForNode = getErrorSpanForNode; + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; + } + ts2.isExternalOrCommonJsModule = isExternalOrCommonJsModule; + function isJsonSourceFile(file) { + return file.scriptKind === 6; + } + ts2.isJsonSourceFile = isJsonSourceFile; + function isEnumConst(node) { + return !!(ts2.getCombinedModifierFlags(node) & 2048); + } + ts2.isEnumConst = isEnumConst; + function isDeclarationReadonly(declaration) { + return !!(ts2.getCombinedModifierFlags(declaration) & 64 && !ts2.isParameterPropertyDeclaration(declaration, declaration.parent)); + } + ts2.isDeclarationReadonly = isDeclarationReadonly; + function isVarConst(node) { + return !!(ts2.getCombinedNodeFlags(node) & 2); + } + ts2.isVarConst = isVarConst; + function isLet(node) { + return !!(ts2.getCombinedNodeFlags(node) & 1); + } + ts2.isLet = isLet; + function isSuperCall(n7) { + return n7.kind === 210 && n7.expression.kind === 106; + } + ts2.isSuperCall = isSuperCall; + function isImportCall(n7) { + return n7.kind === 210 && n7.expression.kind === 100; + } + ts2.isImportCall = isImportCall; + function isImportMeta(n7) { + return ts2.isMetaProperty(n7) && n7.keywordToken === 100 && n7.name.escapedText === "meta"; + } + ts2.isImportMeta = isImportMeta; + function isLiteralImportTypeNode(n7) { + return ts2.isImportTypeNode(n7) && ts2.isLiteralTypeNode(n7.argument) && ts2.isStringLiteral(n7.argument.literal); + } + ts2.isLiteralImportTypeNode = isLiteralImportTypeNode; + function isPrologueDirective(node) { + return node.kind === 241 && node.expression.kind === 10; + } + ts2.isPrologueDirective = isPrologueDirective; + function isCustomPrologue(node) { + return !!(getEmitFlags(node) & 1048576); + } + ts2.isCustomPrologue = isCustomPrologue; + function isHoistedFunction(node) { + return isCustomPrologue(node) && ts2.isFunctionDeclaration(node); + } + ts2.isHoistedFunction = isHoistedFunction; + function isHoistedVariable(node) { + return ts2.isIdentifier(node.name) && !node.initializer; + } + function isHoistedVariableStatement(node) { + return isCustomPrologue(node) && ts2.isVariableStatement(node) && ts2.every(node.declarationList.declarations, isHoistedVariable); + } + ts2.isHoistedVariableStatement = isHoistedVariableStatement; + function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + return node.kind !== 11 ? ts2.getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; + } + ts2.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; + function getJSDocCommentRanges(node, text) { + var commentRanges = node.kind === 166 || node.kind === 165 || node.kind === 215 || node.kind === 216 || node.kind === 214 || node.kind === 257 || node.kind === 278 ? ts2.concatenate(ts2.getTrailingCommentRanges(text, node.pos), ts2.getLeadingCommentRanges(text, node.pos)) : ts2.getLeadingCommentRanges(text, node.pos); + return ts2.filter(commentRanges, function(comment) { + return text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && text.charCodeAt(comment.pos + 3) !== 47; + }); + } + ts2.getJSDocCommentRanges = getJSDocCommentRanges; + ts2.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + ts2.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + var defaultLibReferenceRegEx = /^(\/\/\/\s*/; + function isPartOfTypeNode(node) { + if (179 <= node.kind && node.kind <= 202) { + return true; + } + switch (node.kind) { + case 131: + case 157: + case 148: + case 160: + case 152: + case 134: + case 153: + case 149: + case 155: + case 144: + return true; + case 114: + return node.parent.kind !== 219; + case 230: + return ts2.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 165: + return node.parent.kind === 197 || node.parent.kind === 192; + case 79: + if (node.parent.kind === 163 && node.parent.right === node) { + node = node.parent; + } else if (node.parent.kind === 208 && node.parent.name === node) { + node = node.parent; + } + ts2.Debug.assert(node.kind === 79 || node.kind === 163 || node.kind === 208, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 163: + case 208: + case 108: { + var parent2 = node.parent; + if (parent2.kind === 183) { + return false; + } + if (parent2.kind === 202) { + return !parent2.isTypeOf; + } + if (179 <= parent2.kind && parent2.kind <= 202) { + return true; + } + switch (parent2.kind) { + case 230: + return ts2.isHeritageClause(parent2.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent2); + case 165: + return node === parent2.constraint; + case 347: + return node === parent2.constraint; + case 169: + case 168: + case 166: + case 257: + return node === parent2.type; + case 259: + case 215: + case 216: + case 173: + case 171: + case 170: + case 174: + case 175: + return node === parent2.type; + case 176: + case 177: + case 178: + return node === parent2.type; + case 213: + return node === parent2.type; + case 210: + case 211: + return ts2.contains(parent2.typeArguments, node); + case 212: + return false; + } + } + } + return false; + } + ts2.isPartOfTypeNode = isPartOfTypeNode; + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + ts2.isChildOfNodeWithKind = isChildOfNodeWithKind; + function forEachReturnStatement(body, visitor) { + return traverse4(body); + function traverse4(node) { + switch (node.kind) { + case 250: + return visitor(node); + case 266: + case 238: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 251: + case 252: + case 292: + case 293: + case 253: + case 255: + case 295: + return ts2.forEachChild(node, traverse4); + } + } + } + ts2.forEachReturnStatement = forEachReturnStatement; + function forEachYieldExpression(body, visitor) { + return traverse4(body); + function traverse4(node) { + switch (node.kind) { + case 226: + visitor(node); + var operand = node.expression; + if (operand) { + traverse4(operand); + } + return; + case 263: + case 261: + case 264: + case 262: + return; + default: + if (ts2.isFunctionLike(node)) { + if (node.name && node.name.kind === 164) { + traverse4(node.name.expression); + return; + } + } else if (!isPartOfTypeNode(node)) { + ts2.forEachChild(node, traverse4); + } + } + } + } + ts2.forEachYieldExpression = forEachYieldExpression; + function getRestParameterElementType(node) { + if (node && node.kind === 185) { + return node.elementType; + } else if (node && node.kind === 180) { + return ts2.singleOrUndefined(node.typeArguments); + } else { + return void 0; + } + } + ts2.getRestParameterElementType = getRestParameterElementType; + function getMembersOfDeclaration(node) { + switch (node.kind) { + case 261: + case 260: + case 228: + case 184: + return node.members; + case 207: + return node.properties; + } + } + ts2.getMembersOfDeclaration = getMembersOfDeclaration; + function isVariableLike(node) { + if (node) { + switch (node.kind) { + case 205: + case 302: + case 166: + case 299: + case 169: + case 168: + case 300: + case 257: + return true; + } + } + return false; + } + ts2.isVariableLike = isVariableLike; + function isVariableLikeOrAccessor(node) { + return isVariableLike(node) || ts2.isAccessor(node); + } + ts2.isVariableLikeOrAccessor = isVariableLikeOrAccessor; + function isVariableDeclarationInVariableStatement(node) { + return node.parent.kind === 258 && node.parent.parent.kind === 240; + } + ts2.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; + function isCommonJsExportedExpression(node) { + if (!isInJSFile(node)) + return false; + return ts2.isObjectLiteralExpression(node.parent) && ts2.isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 || isCommonJsExportPropertyAssignment(node.parent); + } + ts2.isCommonJsExportedExpression = isCommonJsExportedExpression; + function isCommonJsExportPropertyAssignment(node) { + if (!isInJSFile(node)) + return false; + return ts2.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1; + } + ts2.isCommonJsExportPropertyAssignment = isCommonJsExportPropertyAssignment; + function isValidESSymbolDeclaration(node) { + return (ts2.isVariableDeclaration(node) ? isVarConst(node) && ts2.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) : ts2.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) : ts2.isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node); + } + ts2.isValidESSymbolDeclaration = isValidESSymbolDeclaration; + function introducesArgumentsExoticObject(node) { + switch (node.kind) { + case 171: + case 170: + case 173: + case 174: + case 175: + case 259: + case 215: + return true; + } + return false; + } + ts2.introducesArgumentsExoticObject = introducesArgumentsExoticObject; + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 253) { + return node.statement; + } + node = node.statement; + } + } + ts2.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; + function isFunctionBlock(node) { + return node && node.kind === 238 && ts2.isFunctionLike(node.parent); + } + ts2.isFunctionBlock = isFunctionBlock; + function isObjectLiteralMethod(node) { + return node && node.kind === 171 && node.parent.kind === 207; + } + ts2.isObjectLiteralMethod = isObjectLiteralMethod; + function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { + return (node.kind === 171 || node.kind === 174 || node.kind === 175) && (node.parent.kind === 207 || node.parent.kind === 228); + } + ts2.isObjectLiteralOrClassExpressionMethodOrAccessor = isObjectLiteralOrClassExpressionMethodOrAccessor; + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1; + } + ts2.isIdentifierTypePredicate = isIdentifierTypePredicate; + function isThisTypePredicate(predicate) { + return predicate && predicate.kind === 0; + } + ts2.isThisTypePredicate = isThisTypePredicate; + function getPropertyAssignment(objectLiteral, key, key2) { + return objectLiteral.properties.filter(function(property2) { + if (property2.kind === 299) { + var propName2 = tryGetTextOfPropertyName(property2.name); + return key === propName2 || !!key2 && key2 === propName2; + } + return false; + }); + } + ts2.getPropertyAssignment = getPropertyAssignment; + function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) { + return ts2.firstDefined(getPropertyAssignment(objectLiteral, propKey), function(property2) { + return ts2.isArrayLiteralExpression(property2.initializer) ? ts2.find(property2.initializer.elements, function(element) { + return ts2.isStringLiteral(element) && element.text === elementValue; + }) : void 0; + }); + } + ts2.getPropertyArrayElementValue = getPropertyArrayElementValue; + function getTsConfigObjectLiteralExpression(tsConfigSourceFile) { + if (tsConfigSourceFile && tsConfigSourceFile.statements.length) { + var expression = tsConfigSourceFile.statements[0].expression; + return ts2.tryCast(expression, ts2.isObjectLiteralExpression); + } + } + ts2.getTsConfigObjectLiteralExpression = getTsConfigObjectLiteralExpression; + function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) { + return ts2.firstDefined(getTsConfigPropArray(tsConfigSourceFile, propKey), function(property2) { + return ts2.isArrayLiteralExpression(property2.initializer) ? ts2.find(property2.initializer.elements, function(element) { + return ts2.isStringLiteral(element) && element.text === elementValue; + }) : void 0; + }); + } + ts2.getTsConfigPropArrayElementValue = getTsConfigPropArrayElementValue; + function getTsConfigPropArray(tsConfigSourceFile, propKey) { + var jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile); + return jsonObjectLiteral ? getPropertyAssignment(jsonObjectLiteral, propKey) : ts2.emptyArray; + } + ts2.getTsConfigPropArray = getTsConfigPropArray; + function getContainingFunction(node) { + return ts2.findAncestor(node.parent, ts2.isFunctionLike); + } + ts2.getContainingFunction = getContainingFunction; + function getContainingFunctionDeclaration(node) { + return ts2.findAncestor(node.parent, ts2.isFunctionLikeDeclaration); + } + ts2.getContainingFunctionDeclaration = getContainingFunctionDeclaration; + function getContainingClass(node) { + return ts2.findAncestor(node.parent, ts2.isClassLike); + } + ts2.getContainingClass = getContainingClass; + function getContainingClassStaticBlock(node) { + return ts2.findAncestor(node.parent, function(n7) { + if (ts2.isClassLike(n7) || ts2.isFunctionLike(n7)) { + return "quit"; + } + return ts2.isClassStaticBlockDeclaration(n7); + }); + } + ts2.getContainingClassStaticBlock = getContainingClassStaticBlock; + function getContainingFunctionOrClassStaticBlock(node) { + return ts2.findAncestor(node.parent, ts2.isFunctionLikeOrClassStaticBlockDeclaration); + } + ts2.getContainingFunctionOrClassStaticBlock = getContainingFunctionOrClassStaticBlock; + function getThisContainer(node, includeArrowFunctions) { + ts2.Debug.assert( + node.kind !== 308 + /* SyntaxKind.SourceFile */ + ); + while (true) { + node = node.parent; + if (!node) { + return ts2.Debug.fail(); + } + switch (node.kind) { + case 164: + if (ts2.isClassLike(node.parent.parent)) { + return node; + } + node = node.parent; + break; + case 167: + if (node.parent.kind === 166 && ts2.isClassElement(node.parent.parent)) { + node = node.parent.parent; + } else if (ts2.isClassElement(node.parent)) { + node = node.parent; + } + break; + case 216: + if (!includeArrowFunctions) { + continue; + } + case 259: + case 215: + case 264: + case 172: + case 169: + case 168: + case 171: + case 170: + case 173: + case 174: + case 175: + case 176: + case 177: + case 178: + case 263: + case 308: + return node; + } + } + } + ts2.getThisContainer = getThisContainer; + function isThisContainerOrFunctionBlock(node) { + switch (node.kind) { + case 216: + case 259: + case 215: + case 169: + return true; + case 238: + switch (node.parent.kind) { + case 173: + case 171: + case 174: + case 175: + return true; + default: + return false; + } + default: + return false; + } + } + ts2.isThisContainerOrFunctionBlock = isThisContainerOrFunctionBlock; + function isInTopLevelContext(node) { + if (ts2.isIdentifier(node) && (ts2.isClassDeclaration(node.parent) || ts2.isFunctionDeclaration(node.parent)) && node.parent.name === node) { + node = node.parent; + } + var container = getThisContainer( + node, + /*includeArrowFunctions*/ + true + ); + return ts2.isSourceFile(container); + } + ts2.isInTopLevelContext = isInTopLevelContext; + function getNewTargetContainer(node) { + var container = getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + if (container) { + switch (container.kind) { + case 173: + case 259: + case 215: + return container; + } + } + return void 0; + } + ts2.getNewTargetContainer = getNewTargetContainer; + function getSuperContainer(node, stopOnFunctions) { + while (true) { + node = node.parent; + if (!node) { + return node; + } + switch (node.kind) { + case 164: + node = node.parent; + break; + case 259: + case 215: + case 216: + if (!stopOnFunctions) { + continue; + } + case 169: + case 168: + case 171: + case 170: + case 173: + case 174: + case 175: + case 172: + return node; + case 167: + if (node.parent.kind === 166 && ts2.isClassElement(node.parent.parent)) { + node = node.parent.parent; + } else if (ts2.isClassElement(node.parent)) { + node = node.parent; + } + break; + } + } + } + ts2.getSuperContainer = getSuperContainer; + function getImmediatelyInvokedFunctionExpression(func) { + if (func.kind === 215 || func.kind === 216) { + var prev = func; + var parent2 = func.parent; + while (parent2.kind === 214) { + prev = parent2; + parent2 = parent2.parent; + } + if (parent2.kind === 210 && parent2.expression === prev) { + return parent2; + } + } + } + ts2.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; + function isSuperOrSuperProperty(node) { + return node.kind === 106 || isSuperProperty(node); + } + ts2.isSuperOrSuperProperty = isSuperOrSuperProperty; + function isSuperProperty(node) { + var kind = node.kind; + return (kind === 208 || kind === 209) && node.expression.kind === 106; + } + ts2.isSuperProperty = isSuperProperty; + function isThisProperty(node) { + var kind = node.kind; + return (kind === 208 || kind === 209) && node.expression.kind === 108; + } + ts2.isThisProperty = isThisProperty; + function isThisInitializedDeclaration(node) { + var _a2; + return !!node && ts2.isVariableDeclaration(node) && ((_a2 = node.initializer) === null || _a2 === void 0 ? void 0 : _a2.kind) === 108; + } + ts2.isThisInitializedDeclaration = isThisInitializedDeclaration; + function isThisInitializedObjectBindingExpression(node) { + return !!node && (ts2.isShorthandPropertyAssignment(node) || ts2.isPropertyAssignment(node)) && ts2.isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 63 && node.parent.parent.right.kind === 108; + } + ts2.isThisInitializedObjectBindingExpression = isThisInitializedObjectBindingExpression; + function getEntityNameFromTypeNode(node) { + switch (node.kind) { + case 180: + return node.typeName; + case 230: + return isEntityNameExpression(node.expression) ? node.expression : void 0; + case 79: + case 163: + return node; + } + return void 0; + } + ts2.getEntityNameFromTypeNode = getEntityNameFromTypeNode; + function getInvokedExpression(node) { + switch (node.kind) { + case 212: + return node.tag; + case 283: + case 282: + return node.tagName; + default: + return node.expression; + } + } + ts2.getInvokedExpression = getInvokedExpression; + function nodeCanBeDecorated(node, parent2, grandparent) { + if (ts2.isNamedDeclaration(node) && ts2.isPrivateIdentifier(node.name)) { + return false; + } + switch (node.kind) { + case 260: + return true; + case 169: + return parent2.kind === 260; + case 174: + case 175: + case 171: + return node.body !== void 0 && parent2.kind === 260; + case 166: + return parent2.body !== void 0 && (parent2.kind === 173 || parent2.kind === 171 || parent2.kind === 175) && grandparent.kind === 260; + } + return false; + } + ts2.nodeCanBeDecorated = nodeCanBeDecorated; + function nodeIsDecorated(node, parent2, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(node, parent2, grandparent); + } + ts2.nodeIsDecorated = nodeIsDecorated; + function nodeOrChildIsDecorated(node, parent2, grandparent) { + return nodeIsDecorated(node, parent2, grandparent) || childIsDecorated(node, parent2); + } + ts2.nodeOrChildIsDecorated = nodeOrChildIsDecorated; + function childIsDecorated(node, parent2) { + switch (node.kind) { + case 260: + return ts2.some(node.members, function(m7) { + return nodeOrChildIsDecorated(m7, node, parent2); + }); + case 171: + case 175: + case 173: + return ts2.some(node.parameters, function(p7) { + return nodeIsDecorated(p7, node, parent2); + }); + default: + return false; + } + } + ts2.childIsDecorated = childIsDecorated; + function classOrConstructorParameterIsDecorated(node) { + if (nodeIsDecorated(node)) + return true; + var constructor = getFirstConstructorWithBody(node); + return !!constructor && childIsDecorated(constructor, node); + } + ts2.classOrConstructorParameterIsDecorated = classOrConstructorParameterIsDecorated; + function isJSXTagName(node) { + var parent2 = node.parent; + if (parent2.kind === 283 || parent2.kind === 282 || parent2.kind === 284) { + return parent2.tagName === node; + } + return false; + } + ts2.isJSXTagName = isJSXTagName; + function isExpressionNode(node) { + switch (node.kind) { + case 106: + case 104: + case 110: + case 95: + case 13: + case 206: + case 207: + case 208: + case 209: + case 210: + case 211: + case 212: + case 231: + case 213: + case 235: + case 232: + case 214: + case 215: + case 228: + case 216: + case 219: + case 217: + case 218: + case 221: + case 222: + case 223: + case 224: + case 227: + case 225: + case 229: + case 281: + case 282: + case 285: + case 226: + case 220: + case 233: + return true; + case 230: + return !ts2.isHeritageClause(node.parent); + case 163: + while (node.parent.kind === 163) { + node = node.parent; + } + return node.parent.kind === 183 || ts2.isJSDocLinkLike(node.parent) || ts2.isJSDocNameReference(node.parent) || ts2.isJSDocMemberName(node.parent) || isJSXTagName(node); + case 314: + while (ts2.isJSDocMemberName(node.parent)) { + node = node.parent; + } + return node.parent.kind === 183 || ts2.isJSDocLinkLike(node.parent) || ts2.isJSDocNameReference(node.parent) || ts2.isJSDocMemberName(node.parent) || isJSXTagName(node); + case 80: + return ts2.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 101; + case 79: + if (node.parent.kind === 183 || ts2.isJSDocLinkLike(node.parent) || ts2.isJSDocNameReference(node.parent) || ts2.isJSDocMemberName(node.parent) || isJSXTagName(node)) { + return true; + } + case 8: + case 9: + case 10: + case 14: + case 108: + return isInExpressionContext(node); + default: + return false; + } + } + ts2.isExpressionNode = isExpressionNode; + function isInExpressionContext(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 257: + case 166: + case 169: + case 168: + case 302: + case 299: + case 205: + return parent2.initializer === node; + case 241: + case 242: + case 243: + case 244: + case 250: + case 251: + case 252: + case 292: + case 254: + return parent2.expression === node; + case 245: + var forStatement = parent2; + return forStatement.initializer === node && forStatement.initializer.kind !== 258 || forStatement.condition === node || forStatement.incrementor === node; + case 246: + case 247: + var forInStatement = parent2; + return forInStatement.initializer === node && forInStatement.initializer.kind !== 258 || forInStatement.expression === node; + case 213: + case 231: + return node === parent2.expression; + case 236: + return node === parent2.expression; + case 164: + return node === parent2.expression; + case 167: + case 291: + case 290: + case 301: + return true; + case 230: + return parent2.expression === node && !isPartOfTypeNode(parent2); + case 300: + return parent2.objectAssignmentInitializer === node; + case 235: + return node === parent2.expression; + default: + return isExpressionNode(parent2); + } + } + ts2.isInExpressionContext = isInExpressionContext; + function isPartOfTypeQuery(node) { + while (node.kind === 163 || node.kind === 79) { + node = node.parent; + } + return node.kind === 183; + } + ts2.isPartOfTypeQuery = isPartOfTypeQuery; + function isNamespaceReexportDeclaration(node) { + return ts2.isNamespaceExport(node) && !!node.parent.moduleSpecifier; + } + ts2.isNamespaceReexportDeclaration = isNamespaceReexportDeclaration; + function isExternalModuleImportEqualsDeclaration(node) { + return node.kind === 268 && node.moduleReference.kind === 280; + } + ts2.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; + function getExternalModuleImportEqualsDeclarationExpression(node) { + ts2.Debug.assert(isExternalModuleImportEqualsDeclaration(node)); + return node.moduleReference.expression; + } + ts2.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; + function getExternalModuleRequireArgument(node) { + return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; + } + ts2.getExternalModuleRequireArgument = getExternalModuleRequireArgument; + function isInternalModuleImportEqualsDeclaration(node) { + return node.kind === 268 && node.moduleReference.kind !== 280; + } + ts2.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; + function isSourceFileJS(file) { + return isInJSFile(file); + } + ts2.isSourceFileJS = isSourceFileJS; + function isSourceFileNotJS(file) { + return !isInJSFile(file); + } + ts2.isSourceFileNotJS = isSourceFileNotJS; + function isInJSFile(node) { + return !!node && !!(node.flags & 262144); + } + ts2.isInJSFile = isInJSFile; + function isInJsonFile(node) { + return !!node && !!(node.flags & 67108864); + } + ts2.isInJsonFile = isInJsonFile; + function isSourceFileNotJson(file) { + return !isJsonSourceFile(file); + } + ts2.isSourceFileNotJson = isSourceFileNotJson; + function isInJSDoc(node) { + return !!node && !!(node.flags & 8388608); + } + ts2.isInJSDoc = isInJSDoc; + function isJSDocIndexSignature(node) { + return ts2.isTypeReferenceNode(node) && ts2.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && (node.typeArguments[0].kind === 152 || node.typeArguments[0].kind === 148); + } + ts2.isJSDocIndexSignature = isJSDocIndexSignature; + function isRequireCall(callExpression, requireStringLiteralLikeArgument) { + if (callExpression.kind !== 210) { + return false; + } + var _a2 = callExpression, expression = _a2.expression, args = _a2.arguments; + if (expression.kind !== 79 || expression.escapedText !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + var arg = args[0]; + return !requireStringLiteralLikeArgument || ts2.isStringLiteralLike(arg); + } + ts2.isRequireCall = isRequireCall; + function isVariableDeclarationInitializedToRequire(node) { + return isVariableDeclarationInitializedWithRequireHelper( + node, + /*allowAccessedRequire*/ + false + ); + } + ts2.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire; + function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { + return isVariableDeclarationInitializedWithRequireHelper( + node, + /*allowAccessedRequire*/ + true + ); + } + ts2.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire; + function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { + return ts2.isVariableDeclaration(node) && !!node.initializer && isRequireCall( + allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, + /*requireStringLiteralLikeArgument*/ + true + ); + } + function isRequireVariableStatement(node) { + return ts2.isVariableStatement(node) && node.declarationList.declarations.length > 0 && ts2.every(node.declarationList.declarations, function(decl) { + return isVariableDeclarationInitializedToRequire(decl); + }); + } + ts2.isRequireVariableStatement = isRequireVariableStatement; + function isSingleOrDoubleQuote(charCode) { + return charCode === 39 || charCode === 34; + } + ts2.isSingleOrDoubleQuote = isSingleOrDoubleQuote; + function isStringDoubleQuoted(str2, sourceFile) { + return getSourceTextOfNodeFromSourceFile(sourceFile, str2).charCodeAt(0) === 34; + } + ts2.isStringDoubleQuoted = isStringDoubleQuoted; + function isAssignmentDeclaration(decl) { + return ts2.isBinaryExpression(decl) || isAccessExpression(decl) || ts2.isIdentifier(decl) || ts2.isCallExpression(decl); + } + ts2.isAssignmentDeclaration = isAssignmentDeclaration; + function getEffectiveInitializer(node) { + if (isInJSFile(node) && node.initializer && ts2.isBinaryExpression(node.initializer) && (node.initializer.operatorToken.kind === 56 || node.initializer.operatorToken.kind === 60) && node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) { + return node.initializer.right; + } + return node.initializer; + } + ts2.getEffectiveInitializer = getEffectiveInitializer; + function getDeclaredExpandoInitializer(node) { + var init2 = getEffectiveInitializer(node); + return init2 && getExpandoInitializer(init2, isPrototypeAccess(node.name)); + } + ts2.getDeclaredExpandoInitializer = getDeclaredExpandoInitializer; + function hasExpandoValueProperty(node, isPrototypeAssignment) { + return ts2.forEach(node.properties, function(p7) { + return ts2.isPropertyAssignment(p7) && ts2.isIdentifier(p7.name) && p7.name.escapedText === "value" && p7.initializer && getExpandoInitializer(p7.initializer, isPrototypeAssignment); + }); + } + function getAssignedExpandoInitializer(node) { + if (node && node.parent && ts2.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63) { + var isPrototypeAssignment = isPrototypeAccess(node.parent.left); + return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); + } + if (node && ts2.isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) { + var result2 = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype"); + if (result2) { + return result2; + } + } + } + ts2.getAssignedExpandoInitializer = getAssignedExpandoInitializer; + function getExpandoInitializer(initializer, isPrototypeAssignment) { + if (ts2.isCallExpression(initializer)) { + var e10 = skipParentheses(initializer.expression); + return e10.kind === 215 || e10.kind === 216 ? initializer : void 0; + } + if (initializer.kind === 215 || initializer.kind === 228 || initializer.kind === 216) { + return initializer; + } + if (ts2.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { + return initializer; + } + } + ts2.getExpandoInitializer = getExpandoInitializer; + function getDefaultedExpandoInitializer(name2, initializer, isPrototypeAssignment) { + var e10 = ts2.isBinaryExpression(initializer) && (initializer.operatorToken.kind === 56 || initializer.operatorToken.kind === 60) && getExpandoInitializer(initializer.right, isPrototypeAssignment); + if (e10 && isSameEntityName(name2, initializer.left)) { + return e10; + } + } + function isDefaultedExpandoInitializer(node) { + var name2 = ts2.isVariableDeclaration(node.parent) ? node.parent.name : ts2.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63 ? node.parent.left : void 0; + return name2 && getExpandoInitializer(node.right, isPrototypeAccess(name2)) && isEntityNameExpression(name2) && isSameEntityName(name2, node.left); + } + ts2.isDefaultedExpandoInitializer = isDefaultedExpandoInitializer; + function getNameOfExpando(node) { + if (ts2.isBinaryExpression(node.parent)) { + var parent2 = (node.parent.operatorToken.kind === 56 || node.parent.operatorToken.kind === 60) && ts2.isBinaryExpression(node.parent.parent) ? node.parent.parent : node.parent; + if (parent2.operatorToken.kind === 63 && ts2.isIdentifier(parent2.left)) { + return parent2.left; + } + } else if (ts2.isVariableDeclaration(node.parent)) { + return node.parent.name; + } + } + ts2.getNameOfExpando = getNameOfExpando; + function isSameEntityName(name2, initializer) { + if (isPropertyNameLiteral(name2) && isPropertyNameLiteral(initializer)) { + return getTextOfIdentifierOrLiteral(name2) === getTextOfIdentifierOrLiteral(initializer); + } + if (ts2.isMemberName(name2) && isLiteralLikeAccess(initializer) && (initializer.expression.kind === 108 || ts2.isIdentifier(initializer.expression) && (initializer.expression.escapedText === "window" || initializer.expression.escapedText === "self" || initializer.expression.escapedText === "global"))) { + return isSameEntityName(name2, getNameOrArgument(initializer)); + } + if (isLiteralLikeAccess(name2) && isLiteralLikeAccess(initializer)) { + return getElementOrPropertyAccessName(name2) === getElementOrPropertyAccessName(initializer) && isSameEntityName(name2.expression, initializer.expression); + } + return false; + } + ts2.isSameEntityName = isSameEntityName; + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression( + node, + /*excludeCompoundAssignments*/ + true + )) { + node = node.right; + } + return node; + } + ts2.getRightMostAssignedExpression = getRightMostAssignedExpression; + function isExportsIdentifier(node) { + return ts2.isIdentifier(node) && node.escapedText === "exports"; + } + ts2.isExportsIdentifier = isExportsIdentifier; + function isModuleIdentifier(node) { + return ts2.isIdentifier(node) && node.escapedText === "module"; + } + ts2.isModuleIdentifier = isModuleIdentifier; + function isModuleExportsAccessExpression(node) { + return (ts2.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node)) && isModuleIdentifier(node.expression) && getElementOrPropertyAccessName(node) === "exports"; + } + ts2.isModuleExportsAccessExpression = isModuleExportsAccessExpression; + function getAssignmentDeclarationKind(expr) { + var special = getAssignmentDeclarationKindWorker(expr); + return special === 5 || isInJSFile(expr) ? special : 0; + } + ts2.getAssignmentDeclarationKind = getAssignmentDeclarationKind; + function isBindableObjectDefinePropertyCall(expr) { + return ts2.length(expr.arguments) === 3 && ts2.isPropertyAccessExpression(expr.expression) && ts2.isIdentifier(expr.expression.expression) && ts2.idText(expr.expression.expression) === "Object" && ts2.idText(expr.expression.name) === "defineProperty" && isStringOrNumericLiteralLike(expr.arguments[1]) && isBindableStaticNameExpression( + expr.arguments[0], + /*excludeThisKeyword*/ + true + ); + } + ts2.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall; + function isLiteralLikeAccess(node) { + return ts2.isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node); + } + ts2.isLiteralLikeAccess = isLiteralLikeAccess; + function isLiteralLikeElementAccess(node) { + return ts2.isElementAccessExpression(node) && isStringOrNumericLiteralLike(node.argumentExpression); + } + ts2.isLiteralLikeElementAccess = isLiteralLikeElementAccess; + function isBindableStaticAccessExpression(node, excludeThisKeyword) { + return ts2.isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 108 || ts2.isIdentifier(node.name) && isBindableStaticNameExpression( + node.expression, + /*excludeThisKeyword*/ + true + )) || isBindableStaticElementAccessExpression(node, excludeThisKeyword); + } + ts2.isBindableStaticAccessExpression = isBindableStaticAccessExpression; + function isBindableStaticElementAccessExpression(node, excludeThisKeyword) { + return isLiteralLikeElementAccess(node) && (!excludeThisKeyword && node.expression.kind === 108 || isEntityNameExpression(node.expression) || isBindableStaticAccessExpression( + node.expression, + /*excludeThisKeyword*/ + true + )); + } + ts2.isBindableStaticElementAccessExpression = isBindableStaticElementAccessExpression; + function isBindableStaticNameExpression(node, excludeThisKeyword) { + return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword); + } + ts2.isBindableStaticNameExpression = isBindableStaticNameExpression; + function getNameOrArgument(expr) { + if (ts2.isPropertyAccessExpression(expr)) { + return expr.name; + } + return expr.argumentExpression; + } + ts2.getNameOrArgument = getNameOrArgument; + function getAssignmentDeclarationKindWorker(expr) { + if (ts2.isCallExpression(expr)) { + if (!isBindableObjectDefinePropertyCall(expr)) { + return 0; + } + var entityName = expr.arguments[0]; + if (isExportsIdentifier(entityName) || isModuleExportsAccessExpression(entityName)) { + return 8; + } + if (isBindableStaticAccessExpression(entityName) && getElementOrPropertyAccessName(entityName) === "prototype") { + return 9; + } + return 7; + } + if (expr.operatorToken.kind !== 63 || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) { + return 0; + } + if (isBindableStaticNameExpression( + expr.left.expression, + /*excludeThisKeyword*/ + true + ) && getElementOrPropertyAccessName(expr.left) === "prototype" && ts2.isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) { + return 6; + } + return getAssignmentDeclarationPropertyAccessKind(expr.left); + } + function isVoidZero(node) { + return ts2.isVoidExpression(node) && ts2.isNumericLiteral(node.expression) && node.expression.text === "0"; + } + function getElementOrPropertyAccessArgumentExpressionOrName(node) { + if (ts2.isPropertyAccessExpression(node)) { + return node.name; + } + var arg = skipParentheses(node.argumentExpression); + if (ts2.isNumericLiteral(arg) || ts2.isStringLiteralLike(arg)) { + return arg; + } + return node; + } + ts2.getElementOrPropertyAccessArgumentExpressionOrName = getElementOrPropertyAccessArgumentExpressionOrName; + function getElementOrPropertyAccessName(node) { + var name2 = getElementOrPropertyAccessArgumentExpressionOrName(node); + if (name2) { + if (ts2.isIdentifier(name2)) { + return name2.escapedText; + } + if (ts2.isStringLiteralLike(name2) || ts2.isNumericLiteral(name2)) { + return ts2.escapeLeadingUnderscores(name2.text); + } + } + return void 0; + } + ts2.getElementOrPropertyAccessName = getElementOrPropertyAccessName; + function getAssignmentDeclarationPropertyAccessKind(lhs) { + if (lhs.expression.kind === 108) { + return 4; + } else if (isModuleExportsAccessExpression(lhs)) { + return 2; + } else if (isBindableStaticNameExpression( + lhs.expression, + /*excludeThisKeyword*/ + true + )) { + if (isPrototypeAccess(lhs.expression)) { + return 3; + } + var nextToLast = lhs; + while (!ts2.isIdentifier(nextToLast.expression)) { + nextToLast = nextToLast.expression; + } + var id = nextToLast.expression; + if ((id.escapedText === "exports" || id.escapedText === "module" && getElementOrPropertyAccessName(nextToLast) === "exports") && // ExportsProperty does not support binding with computed names + isBindableStaticAccessExpression(lhs)) { + return 1; + } + if (isBindableStaticNameExpression( + lhs, + /*excludeThisKeyword*/ + true + ) || ts2.isElementAccessExpression(lhs) && isDynamicName(lhs)) { + return 5; + } + } + return 0; + } + ts2.getAssignmentDeclarationPropertyAccessKind = getAssignmentDeclarationPropertyAccessKind; + function getInitializerOfBinaryExpression(expr) { + while (ts2.isBinaryExpression(expr.right)) { + expr = expr.right; + } + return expr.right; + } + ts2.getInitializerOfBinaryExpression = getInitializerOfBinaryExpression; + function isPrototypePropertyAssignment(node) { + return ts2.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3; + } + ts2.isPrototypePropertyAssignment = isPrototypePropertyAssignment; + function isSpecialPropertyDeclaration(expr) { + return isInJSFile(expr) && expr.parent && expr.parent.kind === 241 && (!ts2.isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!ts2.getJSDocTypeTag(expr.parent); + } + ts2.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; + function setValueDeclaration(symbol, node) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || !(node.flags & 16777216 && !(valueDeclaration.flags & 16777216)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + symbol.valueDeclaration = node; + } + } + ts2.setValueDeclaration = setValueDeclaration; + function isFunctionSymbol(symbol) { + if (!symbol || !symbol.valueDeclaration) { + return false; + } + var decl = symbol.valueDeclaration; + return decl.kind === 259 || ts2.isVariableDeclaration(decl) && decl.initializer && ts2.isFunctionLike(decl.initializer); + } + ts2.isFunctionSymbol = isFunctionSymbol; + function tryGetModuleSpecifierFromDeclaration(node) { + var _a2, _b; + switch (node.kind) { + case 257: + return (_a2 = ts2.findAncestor(node.initializer, function(node2) { + return isRequireCall( + node2, + /*requireStringLiteralLikeArgument*/ + true + ); + })) === null || _a2 === void 0 ? void 0 : _a2.arguments[0]; + case 269: + return ts2.tryCast(node.moduleSpecifier, ts2.isStringLiteralLike); + case 268: + return ts2.tryCast((_b = ts2.tryCast(node.moduleReference, ts2.isExternalModuleReference)) === null || _b === void 0 ? void 0 : _b.expression, ts2.isStringLiteralLike); + default: + ts2.Debug.assertNever(node); + } + } + ts2.tryGetModuleSpecifierFromDeclaration = tryGetModuleSpecifierFromDeclaration; + function importFromModuleSpecifier(node) { + return tryGetImportFromModuleSpecifier(node) || ts2.Debug.failBadSyntaxKind(node.parent); + } + ts2.importFromModuleSpecifier = importFromModuleSpecifier; + function tryGetImportFromModuleSpecifier(node) { + switch (node.parent.kind) { + case 269: + case 275: + return node.parent; + case 280: + return node.parent.parent; + case 210: + return isImportCall(node.parent) || isRequireCall( + node.parent, + /*checkArg*/ + false + ) ? node.parent : void 0; + case 198: + ts2.Debug.assert(ts2.isStringLiteral(node)); + return ts2.tryCast(node.parent.parent, ts2.isImportTypeNode); + default: + return void 0; + } + } + ts2.tryGetImportFromModuleSpecifier = tryGetImportFromModuleSpecifier; + function getExternalModuleName(node) { + switch (node.kind) { + case 269: + case 275: + return node.moduleSpecifier; + case 268: + return node.moduleReference.kind === 280 ? node.moduleReference.expression : void 0; + case 202: + return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; + case 210: + return node.arguments[0]; + case 264: + return node.name.kind === 10 ? node.name : void 0; + default: + return ts2.Debug.assertNever(node); + } + } + ts2.getExternalModuleName = getExternalModuleName; + function getNamespaceDeclarationNode(node) { + switch (node.kind) { + case 269: + return node.importClause && ts2.tryCast(node.importClause.namedBindings, ts2.isNamespaceImport); + case 268: + return node; + case 275: + return node.exportClause && ts2.tryCast(node.exportClause, ts2.isNamespaceExport); + default: + return ts2.Debug.assertNever(node); + } + } + ts2.getNamespaceDeclarationNode = getNamespaceDeclarationNode; + function isDefaultImport(node) { + return node.kind === 269 && !!node.importClause && !!node.importClause.name; + } + ts2.isDefaultImport = isDefaultImport; + function forEachImportClauseDeclaration(node, action) { + if (node.name) { + var result2 = action(node); + if (result2) + return result2; + } + if (node.namedBindings) { + var result2 = ts2.isNamespaceImport(node.namedBindings) ? action(node.namedBindings) : ts2.forEach(node.namedBindings.elements, action); + if (result2) + return result2; + } + } + ts2.forEachImportClauseDeclaration = forEachImportClauseDeclaration; + function hasQuestionToken(node) { + if (node) { + switch (node.kind) { + case 166: + case 171: + case 170: + case 300: + case 299: + case 169: + case 168: + return node.questionToken !== void 0; + } + } + return false; + } + ts2.hasQuestionToken = hasQuestionToken; + function isJSDocConstructSignature(node) { + var param = ts2.isJSDocFunctionType(node) ? ts2.firstOrUndefined(node.parameters) : void 0; + var name2 = ts2.tryCast(param && param.name, ts2.isIdentifier); + return !!name2 && name2.escapedText === "new"; + } + ts2.isJSDocConstructSignature = isJSDocConstructSignature; + function isJSDocTypeAlias(node) { + return node.kind === 348 || node.kind === 341 || node.kind === 342; + } + ts2.isJSDocTypeAlias = isJSDocTypeAlias; + function isTypeAlias(node) { + return isJSDocTypeAlias(node) || ts2.isTypeAliasDeclaration(node); + } + ts2.isTypeAlias = isTypeAlias; + function getSourceOfAssignment(node) { + return ts2.isExpressionStatement(node) && ts2.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 63 ? getRightMostAssignedExpression(node.expression) : void 0; + } + function getSourceOfDefaultedAssignment(node) { + return ts2.isExpressionStatement(node) && ts2.isBinaryExpression(node.expression) && getAssignmentDeclarationKind(node.expression) !== 0 && ts2.isBinaryExpression(node.expression.right) && (node.expression.right.operatorToken.kind === 56 || node.expression.right.operatorToken.kind === 60) ? node.expression.right.right : void 0; + } + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 240: + var v8 = getSingleVariableOfVariableStatement(node); + return v8 && v8.initializer; + case 169: + return node.initializer; + case 299: + return node.initializer; + } + } + ts2.getSingleInitializerOfVariableStatementOrPropertyDeclaration = getSingleInitializerOfVariableStatementOrPropertyDeclaration; + function getSingleVariableOfVariableStatement(node) { + return ts2.isVariableStatement(node) ? ts2.firstOrUndefined(node.declarationList.declarations) : void 0; + } + ts2.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; + function getNestedModuleDeclaration(node) { + return ts2.isModuleDeclaration(node) && node.body && node.body.kind === 264 ? node.body : void 0; + } + function getJSDocCommentsAndTags(hostNode, noCache) { + var result2; + if (isVariableLike(hostNode) && ts2.hasInitializer(hostNode) && ts2.hasJSDocNodes(hostNode.initializer)) { + result2 = ts2.addRange(result2, filterOwnedJSDocTags(hostNode, ts2.last(hostNode.initializer.jsDoc))); + } + var node = hostNode; + while (node && node.parent) { + if (ts2.hasJSDocNodes(node)) { + result2 = ts2.addRange(result2, filterOwnedJSDocTags(hostNode, ts2.last(node.jsDoc))); + } + if (node.kind === 166) { + result2 = ts2.addRange(result2, (noCache ? ts2.getJSDocParameterTagsNoCache : ts2.getJSDocParameterTags)(node)); + break; + } + if (node.kind === 165) { + result2 = ts2.addRange(result2, (noCache ? ts2.getJSDocTypeParameterTagsNoCache : ts2.getJSDocTypeParameterTags)(node)); + break; + } + node = getNextJSDocCommentLocation(node); + } + return result2 || ts2.emptyArray; + } + ts2.getJSDocCommentsAndTags = getJSDocCommentsAndTags; + function filterOwnedJSDocTags(hostNode, jsDoc) { + if (ts2.isJSDoc(jsDoc)) { + var ownedTags = ts2.filter(jsDoc.tags, function(tag) { + return ownsJSDocTag(hostNode, tag); + }); + return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags; + } + return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; + } + function ownsJSDocTag(hostNode, tag) { + return !ts2.isJSDocTypeTag(tag) || !tag.parent || !ts2.isJSDoc(tag.parent) || !ts2.isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + } + function getNextJSDocCommentLocation(node) { + var parent2 = node.parent; + if (parent2.kind === 299 || parent2.kind === 274 || parent2.kind === 169 || parent2.kind === 241 && node.kind === 208 || parent2.kind === 250 || getNestedModuleDeclaration(parent2) || ts2.isBinaryExpression(node) && node.operatorToken.kind === 63) { + return parent2; + } else if (parent2.parent && (getSingleVariableOfVariableStatement(parent2.parent) === node || ts2.isBinaryExpression(parent2) && parent2.operatorToken.kind === 63)) { + return parent2.parent; + } else if (parent2.parent && parent2.parent.parent && (getSingleVariableOfVariableStatement(parent2.parent.parent) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent2.parent.parent) === node || getSourceOfDefaultedAssignment(parent2.parent.parent))) { + return parent2.parent.parent; + } + } + ts2.getNextJSDocCommentLocation = getNextJSDocCommentLocation; + function getParameterSymbolFromJSDoc(node) { + if (node.symbol) { + return node.symbol; + } + if (!ts2.isIdentifier(node.name)) { + return void 0; + } + var name2 = node.name.escapedText; + var decl = getHostSignatureFromJSDoc(node); + if (!decl) { + return void 0; + } + var parameter = ts2.find(decl.parameters, function(p7) { + return p7.name.kind === 79 && p7.name.escapedText === name2; + }); + return parameter && parameter.symbol; + } + ts2.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc; + function getEffectiveContainerForJSDocTemplateTag(node) { + if (ts2.isJSDoc(node.parent) && node.parent.tags) { + var typeAlias = ts2.find(node.parent.tags, isJSDocTypeAlias); + if (typeAlias) { + return typeAlias; + } + } + return getHostSignatureFromJSDoc(node); + } + ts2.getEffectiveContainerForJSDocTemplateTag = getEffectiveContainerForJSDocTemplateTag; + function getHostSignatureFromJSDoc(node) { + var host = getEffectiveJSDocHost(node); + if (host) { + return ts2.isPropertySignature(host) && host.type && ts2.isFunctionLike(host.type) ? host.type : ts2.isFunctionLike(host) ? host : void 0; + } + return void 0; + } + ts2.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; + function getEffectiveJSDocHost(node) { + var host = getJSDocHost(node); + if (host) { + return getSourceOfDefaultedAssignment(host) || getSourceOfAssignment(host) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; + } + } + ts2.getEffectiveJSDocHost = getEffectiveJSDocHost; + function getJSDocHost(node) { + var jsDoc = getJSDocRoot(node); + if (!jsDoc) { + return void 0; + } + var host = jsDoc.parent; + if (host && host.jsDoc && jsDoc === ts2.lastOrUndefined(host.jsDoc)) { + return host; + } + } + ts2.getJSDocHost = getJSDocHost; + function getJSDocRoot(node) { + return ts2.findAncestor(node.parent, ts2.isJSDoc); + } + ts2.getJSDocRoot = getJSDocRoot; + function getTypeParameterFromJsDoc(node) { + var name2 = node.name.escapedText; + var typeParameters = node.parent.parent.parent.typeParameters; + return typeParameters && ts2.find(typeParameters, function(p7) { + return p7.name.escapedText === name2; + }); + } + ts2.getTypeParameterFromJsDoc = getTypeParameterFromJsDoc; + function hasTypeArguments(node) { + return !!node.typeArguments; + } + ts2.hasTypeArguments = hasTypeArguments; + var AssignmentKind; + (function(AssignmentKind2) { + AssignmentKind2[AssignmentKind2["None"] = 0] = "None"; + AssignmentKind2[AssignmentKind2["Definite"] = 1] = "Definite"; + AssignmentKind2[AssignmentKind2["Compound"] = 2] = "Compound"; + })(AssignmentKind = ts2.AssignmentKind || (ts2.AssignmentKind = {})); + function getAssignmentTargetKind(node) { + var parent2 = node.parent; + while (true) { + switch (parent2.kind) { + case 223: + var binaryOperator = parent2.operatorToken.kind; + return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 63 || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 : 2 : 0; + case 221: + case 222: + var unaryOperator = parent2.operator; + return unaryOperator === 45 || unaryOperator === 46 ? 2 : 0; + case 246: + case 247: + return parent2.initializer === node ? 1 : 0; + case 214: + case 206: + case 227: + case 232: + node = parent2; + break; + case 301: + node = parent2.parent; + break; + case 300: + if (parent2.name !== node) { + return 0; + } + node = parent2.parent; + break; + case 299: + if (parent2.name === node) { + return 0; + } + node = parent2.parent; + break; + default: + return 0; + } + parent2 = node.parent; + } + } + ts2.getAssignmentTargetKind = getAssignmentTargetKind; + function isAssignmentTarget(node) { + return getAssignmentTargetKind(node) !== 0; + } + ts2.isAssignmentTarget = isAssignmentTarget; + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 238: + case 240: + case 251: + case 242: + case 252: + case 266: + case 292: + case 293: + case 253: + case 245: + case 246: + case 247: + case 243: + case 244: + case 255: + case 295: + return true; + } + return false; + } + ts2.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; + function isValueSignatureDeclaration(node) { + return ts2.isFunctionExpression(node) || ts2.isArrowFunction(node) || ts2.isMethodOrAccessor(node) || ts2.isFunctionDeclaration(node) || ts2.isConstructorDeclaration(node); + } + ts2.isValueSignatureDeclaration = isValueSignatureDeclaration; + function walkUp(node, kind) { + while (node && node.kind === kind) { + node = node.parent; + } + return node; + } + function walkUpParenthesizedTypes(node) { + return walkUp( + node, + 193 + /* SyntaxKind.ParenthesizedType */ + ); + } + ts2.walkUpParenthesizedTypes = walkUpParenthesizedTypes; + function walkUpParenthesizedExpressions(node) { + return walkUp( + node, + 214 + /* SyntaxKind.ParenthesizedExpression */ + ); + } + ts2.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; + function walkUpParenthesizedTypesAndGetParentAndChild(node) { + var child; + while (node && node.kind === 193) { + child = node; + node = node.parent; + } + return [child, node]; + } + ts2.walkUpParenthesizedTypesAndGetParentAndChild = walkUpParenthesizedTypesAndGetParentAndChild; + function skipTypeParentheses(node) { + while (ts2.isParenthesizedTypeNode(node)) + node = node.type; + return node; + } + ts2.skipTypeParentheses = skipTypeParentheses; + function skipParentheses(node, excludeJSDocTypeAssertions) { + var flags = excludeJSDocTypeAssertions ? 1 | 16 : 1; + return ts2.skipOuterExpressions(node, flags); + } + ts2.skipParentheses = skipParentheses; + function isDeleteTarget(node) { + if (node.kind !== 208 && node.kind !== 209) { + return false; + } + node = walkUpParenthesizedExpressions(node.parent); + return node && node.kind === 217; + } + ts2.isDeleteTarget = isDeleteTarget; + function isNodeDescendantOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + ts2.isNodeDescendantOf = isNodeDescendantOf; + function isDeclarationName(name2) { + return !ts2.isSourceFile(name2) && !ts2.isBindingPattern(name2) && ts2.isDeclaration(name2.parent) && name2.parent.name === name2; + } + ts2.isDeclarationName = isDeclarationName; + function getDeclarationFromName(name2) { + var parent2 = name2.parent; + switch (name2.kind) { + case 10: + case 14: + case 8: + if (ts2.isComputedPropertyName(parent2)) + return parent2.parent; + case 79: + if (ts2.isDeclaration(parent2)) { + return parent2.name === name2 ? parent2 : void 0; + } else if (ts2.isQualifiedName(parent2)) { + var tag = parent2.parent; + return ts2.isJSDocParameterTag(tag) && tag.name === parent2 ? tag : void 0; + } else { + var binExp = parent2.parent; + return ts2.isBinaryExpression(binExp) && getAssignmentDeclarationKind(binExp) !== 0 && (binExp.left.symbol || binExp.symbol) && ts2.getNameOfDeclaration(binExp) === name2 ? binExp : void 0; + } + case 80: + return ts2.isDeclaration(parent2) && parent2.name === name2 ? parent2 : void 0; + default: + return void 0; + } + } + ts2.getDeclarationFromName = getDeclarationFromName; + function isLiteralComputedPropertyDeclarationName(node) { + return isStringOrNumericLiteralLike(node) && node.parent.kind === 164 && ts2.isDeclaration(node.parent.parent); + } + ts2.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; + function isIdentifierName(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 169: + case 168: + case 171: + case 170: + case 174: + case 175: + case 302: + case 299: + case 208: + return parent2.name === node; + case 163: + return parent2.right === node; + case 205: + case 273: + return parent2.propertyName === node; + case 278: + case 288: + case 282: + case 283: + case 284: + return true; + } + return false; + } + ts2.isIdentifierName = isIdentifierName; + function isAliasSymbolDeclaration(node) { + if (node.kind === 268 || node.kind === 267 || node.kind === 270 && !!node.name || node.kind === 271 || node.kind === 277 || node.kind === 273 || node.kind === 278 || node.kind === 274 && exportAssignmentIsAlias(node)) { + return true; + } + return isInJSFile(node) && (ts2.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || ts2.isPropertyAccessExpression(node) && ts2.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 && isAliasableExpression(node.parent.right)); + } + ts2.isAliasSymbolDeclaration = isAliasSymbolDeclaration; + function getAliasDeclarationFromName(node) { + switch (node.parent.kind) { + case 270: + case 273: + case 271: + case 278: + case 274: + case 268: + case 277: + return node.parent; + case 163: + do { + node = node.parent; + } while (node.parent.kind === 163); + return getAliasDeclarationFromName(node); + } + } + ts2.getAliasDeclarationFromName = getAliasDeclarationFromName; + function isAliasableExpression(e10) { + return isEntityNameExpression(e10) || ts2.isClassExpression(e10); + } + ts2.isAliasableExpression = isAliasableExpression; + function exportAssignmentIsAlias(node) { + var e10 = getExportAssignmentExpression(node); + return isAliasableExpression(e10); + } + ts2.exportAssignmentIsAlias = exportAssignmentIsAlias; + function getExportAssignmentExpression(node) { + return ts2.isExportAssignment(node) ? node.expression : node.right; + } + ts2.getExportAssignmentExpression = getExportAssignmentExpression; + function getPropertyAssignmentAliasLikeExpression(node) { + return node.kind === 300 ? node.name : node.kind === 299 ? node.initializer : node.parent.right; + } + ts2.getPropertyAssignmentAliasLikeExpression = getPropertyAssignmentAliasLikeExpression; + function getEffectiveBaseTypeNode(node) { + var baseType = getClassExtendsHeritageElement(node); + if (baseType && isInJSFile(node)) { + var tag = ts2.getJSDocAugmentsTag(node); + if (tag) { + return tag.class; + } + } + return baseType; + } + ts2.getEffectiveBaseTypeNode = getEffectiveBaseTypeNode; + function getClassExtendsHeritageElement(node) { + var heritageClause = getHeritageClause( + node.heritageClauses, + 94 + /* SyntaxKind.ExtendsKeyword */ + ); + return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : void 0; + } + ts2.getClassExtendsHeritageElement = getClassExtendsHeritageElement; + function getEffectiveImplementsTypeNodes(node) { + if (isInJSFile(node)) { + return ts2.getJSDocImplementsTags(node).map(function(n7) { + return n7.class; + }); + } else { + var heritageClause = getHeritageClause( + node.heritageClauses, + 117 + /* SyntaxKind.ImplementsKeyword */ + ); + return heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.types; + } + } + ts2.getEffectiveImplementsTypeNodes = getEffectiveImplementsTypeNodes; + function getAllSuperTypeNodes(node) { + return ts2.isInterfaceDeclaration(node) ? getInterfaceBaseTypeNodes(node) || ts2.emptyArray : ts2.isClassLike(node) ? ts2.concatenate(ts2.singleElementArray(getEffectiveBaseTypeNode(node)), getEffectiveImplementsTypeNodes(node)) || ts2.emptyArray : ts2.emptyArray; + } + ts2.getAllSuperTypeNodes = getAllSuperTypeNodes; + function getInterfaceBaseTypeNodes(node) { + var heritageClause = getHeritageClause( + node.heritageClauses, + 94 + /* SyntaxKind.ExtendsKeyword */ + ); + return heritageClause ? heritageClause.types : void 0; + } + ts2.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; + function getHeritageClause(clauses, kind) { + if (clauses) { + for (var _i = 0, clauses_1 = clauses; _i < clauses_1.length; _i++) { + var clause = clauses_1[_i]; + if (clause.token === kind) { + return clause; + } + } + } + return void 0; + } + ts2.getHeritageClause = getHeritageClause; + function getAncestor(node, kind) { + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + return void 0; + } + ts2.getAncestor = getAncestor; + function isKeyword(token) { + return 81 <= token && token <= 162; + } + ts2.isKeyword = isKeyword; + function isContextualKeyword(token) { + return 126 <= token && token <= 162; + } + ts2.isContextualKeyword = isContextualKeyword; + function isNonContextualKeyword(token) { + return isKeyword(token) && !isContextualKeyword(token); + } + ts2.isNonContextualKeyword = isNonContextualKeyword; + function isFutureReservedKeyword(token) { + return 117 <= token && token <= 125; + } + ts2.isFutureReservedKeyword = isFutureReservedKeyword; + function isStringANonContextualKeyword(name2) { + var token = ts2.stringToToken(name2); + return token !== void 0 && isNonContextualKeyword(token); + } + ts2.isStringANonContextualKeyword = isStringANonContextualKeyword; + function isStringAKeyword(name2) { + var token = ts2.stringToToken(name2); + return token !== void 0 && isKeyword(token); + } + ts2.isStringAKeyword = isStringAKeyword; + function isIdentifierANonContextualKeyword(_a2) { + var originalKeywordKind = _a2.originalKeywordKind; + return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); + } + ts2.isIdentifierANonContextualKeyword = isIdentifierANonContextualKeyword; + function isTrivia(token) { + return 2 <= token && token <= 7; + } + ts2.isTrivia = isTrivia; + var FunctionFlags; + (function(FunctionFlags2) { + FunctionFlags2[FunctionFlags2["Normal"] = 0] = "Normal"; + FunctionFlags2[FunctionFlags2["Generator"] = 1] = "Generator"; + FunctionFlags2[FunctionFlags2["Async"] = 2] = "Async"; + FunctionFlags2[FunctionFlags2["Invalid"] = 4] = "Invalid"; + FunctionFlags2[FunctionFlags2["AsyncGenerator"] = 3] = "AsyncGenerator"; + })(FunctionFlags = ts2.FunctionFlags || (ts2.FunctionFlags = {})); + function getFunctionFlags(node) { + if (!node) { + return 4; + } + var flags = 0; + switch (node.kind) { + case 259: + case 215: + case 171: + if (node.asteriskToken) { + flags |= 1; + } + case 216: + if (hasSyntacticModifier( + node, + 512 + /* ModifierFlags.Async */ + )) { + flags |= 2; + } + break; + } + if (!node.body) { + flags |= 4; + } + return flags; + } + ts2.getFunctionFlags = getFunctionFlags; + function isAsyncFunction(node) { + switch (node.kind) { + case 259: + case 215: + case 216: + case 171: + return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier( + node, + 512 + /* ModifierFlags.Async */ + ); + } + return false; + } + ts2.isAsyncFunction = isAsyncFunction; + function isStringOrNumericLiteralLike(node) { + return ts2.isStringLiteralLike(node) || ts2.isNumericLiteral(node); + } + ts2.isStringOrNumericLiteralLike = isStringOrNumericLiteralLike; + function isSignedNumericLiteral(node) { + return ts2.isPrefixUnaryExpression(node) && (node.operator === 39 || node.operator === 40) && ts2.isNumericLiteral(node.operand); + } + ts2.isSignedNumericLiteral = isSignedNumericLiteral; + function hasDynamicName(declaration) { + var name2 = ts2.getNameOfDeclaration(declaration); + return !!name2 && isDynamicName(name2); + } + ts2.hasDynamicName = hasDynamicName; + function isDynamicName(name2) { + if (!(name2.kind === 164 || name2.kind === 209)) { + return false; + } + var expr = ts2.isElementAccessExpression(name2) ? skipParentheses(name2.argumentExpression) : name2.expression; + return !isStringOrNumericLiteralLike(expr) && !isSignedNumericLiteral(expr); + } + ts2.isDynamicName = isDynamicName; + function getPropertyNameForPropertyNameNode(name2) { + switch (name2.kind) { + case 79: + case 80: + return name2.escapedText; + case 10: + case 8: + return ts2.escapeLeadingUnderscores(name2.text); + case 164: + var nameExpression = name2.expression; + if (isStringOrNumericLiteralLike(nameExpression)) { + return ts2.escapeLeadingUnderscores(nameExpression.text); + } else if (isSignedNumericLiteral(nameExpression)) { + if (nameExpression.operator === 40) { + return ts2.tokenToString(nameExpression.operator) + nameExpression.operand.text; + } + return nameExpression.operand.text; + } + return void 0; + default: + return ts2.Debug.assertNever(name2); + } + } + ts2.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode; + function isPropertyNameLiteral(node) { + switch (node.kind) { + case 79: + case 10: + case 14: + case 8: + return true; + default: + return false; + } + } + ts2.isPropertyNameLiteral = isPropertyNameLiteral; + function getTextOfIdentifierOrLiteral(node) { + return ts2.isMemberName(node) ? ts2.idText(node) : node.text; + } + ts2.getTextOfIdentifierOrLiteral = getTextOfIdentifierOrLiteral; + function getEscapedTextOfIdentifierOrLiteral(node) { + return ts2.isMemberName(node) ? node.escapedText : ts2.escapeLeadingUnderscores(node.text); + } + ts2.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral; + function getPropertyNameForUniqueESSymbol(symbol) { + return "__@".concat(ts2.getSymbolId(symbol), "@").concat(symbol.escapedName); + } + ts2.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol; + function getSymbolNameForPrivateIdentifier(containingClassSymbol, description7) { + return "__#".concat(ts2.getSymbolId(containingClassSymbol), "@").concat(description7); + } + ts2.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier; + function isKnownSymbol(symbol) { + return ts2.startsWith(symbol.escapedName, "__@"); + } + ts2.isKnownSymbol = isKnownSymbol; + function isPrivateIdentifierSymbol(symbol) { + return ts2.startsWith(symbol.escapedName, "__#"); + } + ts2.isPrivateIdentifierSymbol = isPrivateIdentifierSymbol; + function isESSymbolIdentifier(node) { + return node.kind === 79 && node.escapedText === "Symbol"; + } + ts2.isESSymbolIdentifier = isESSymbolIdentifier; + function isPushOrUnshiftIdentifier(node) { + return node.escapedText === "push" || node.escapedText === "unshift"; + } + ts2.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; + function isParameterDeclaration(node) { + var root2 = getRootDeclaration(node); + return root2.kind === 166; + } + ts2.isParameterDeclaration = isParameterDeclaration; + function getRootDeclaration(node) { + while (node.kind === 205) { + node = node.parent.parent; + } + return node; + } + ts2.getRootDeclaration = getRootDeclaration; + function nodeStartsNewLexicalEnvironment(node) { + var kind = node.kind; + return kind === 173 || kind === 215 || kind === 259 || kind === 216 || kind === 171 || kind === 174 || kind === 175 || kind === 264 || kind === 308; + } + ts2.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; + function nodeIsSynthesized(range2) { + return positionIsSynthesized(range2.pos) || positionIsSynthesized(range2.end); + } + ts2.nodeIsSynthesized = nodeIsSynthesized; + function getOriginalSourceFile(sourceFile) { + return ts2.getParseTreeNode(sourceFile, ts2.isSourceFile) || sourceFile; + } + ts2.getOriginalSourceFile = getOriginalSourceFile; + var Associativity; + (function(Associativity2) { + Associativity2[Associativity2["Left"] = 0] = "Left"; + Associativity2[Associativity2["Right"] = 1] = "Right"; + })(Associativity = ts2.Associativity || (ts2.Associativity = {})); + function getExpressionAssociativity(expression) { + var operator = getOperator(expression); + var hasArguments = expression.kind === 211 && expression.arguments !== void 0; + return getOperatorAssociativity(expression.kind, operator, hasArguments); + } + ts2.getExpressionAssociativity = getExpressionAssociativity; + function getOperatorAssociativity(kind, operator, hasArguments) { + switch (kind) { + case 211: + return hasArguments ? 0 : 1; + case 221: + case 218: + case 219: + case 217: + case 220: + case 224: + case 226: + return 1; + case 223: + switch (operator) { + case 42: + case 63: + case 64: + case 65: + case 67: + case 66: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 78: + case 74: + case 75: + case 76: + case 77: + return 1; + } + } + return 0; + } + ts2.getOperatorAssociativity = getOperatorAssociativity; + function getExpressionPrecedence(expression) { + var operator = getOperator(expression); + var hasArguments = expression.kind === 211 && expression.arguments !== void 0; + return getOperatorPrecedence(expression.kind, operator, hasArguments); + } + ts2.getExpressionPrecedence = getExpressionPrecedence; + function getOperator(expression) { + if (expression.kind === 223) { + return expression.operatorToken.kind; + } else if (expression.kind === 221 || expression.kind === 222) { + return expression.operator; + } else { + return expression.kind; + } + } + ts2.getOperator = getOperator; + var OperatorPrecedence; + (function(OperatorPrecedence2) { + OperatorPrecedence2[OperatorPrecedence2["Comma"] = 0] = "Comma"; + OperatorPrecedence2[OperatorPrecedence2["Spread"] = 1] = "Spread"; + OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield"; + OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment"; + OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional"; + OperatorPrecedence2[OperatorPrecedence2["Coalesce"] = 4] = "Coalesce"; + OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR"; + OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseAND"] = 9] = "BitwiseAND"; + OperatorPrecedence2[OperatorPrecedence2["Equality"] = 10] = "Equality"; + OperatorPrecedence2[OperatorPrecedence2["Relational"] = 11] = "Relational"; + OperatorPrecedence2[OperatorPrecedence2["Shift"] = 12] = "Shift"; + OperatorPrecedence2[OperatorPrecedence2["Additive"] = 13] = "Additive"; + OperatorPrecedence2[OperatorPrecedence2["Multiplicative"] = 14] = "Multiplicative"; + OperatorPrecedence2[OperatorPrecedence2["Exponentiation"] = 15] = "Exponentiation"; + OperatorPrecedence2[OperatorPrecedence2["Unary"] = 16] = "Unary"; + OperatorPrecedence2[OperatorPrecedence2["Update"] = 17] = "Update"; + OperatorPrecedence2[OperatorPrecedence2["LeftHandSide"] = 18] = "LeftHandSide"; + OperatorPrecedence2[OperatorPrecedence2["Member"] = 19] = "Member"; + OperatorPrecedence2[OperatorPrecedence2["Primary"] = 20] = "Primary"; + OperatorPrecedence2[OperatorPrecedence2["Highest"] = 20] = "Highest"; + OperatorPrecedence2[OperatorPrecedence2["Lowest"] = 0] = "Lowest"; + OperatorPrecedence2[OperatorPrecedence2["Invalid"] = -1] = "Invalid"; + })(OperatorPrecedence = ts2.OperatorPrecedence || (ts2.OperatorPrecedence = {})); + function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { + switch (nodeKind) { + case 354: + return 0; + case 227: + return 1; + case 226: + return 2; + case 224: + return 4; + case 223: + switch (operatorKind) { + case 27: + return 0; + case 63: + case 64: + case 65: + case 67: + case 66: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 78: + case 74: + case 75: + case 76: + case 77: + return 3; + default: + return getBinaryOperatorPrecedence(operatorKind); + } + case 213: + case 232: + case 221: + case 218: + case 219: + case 217: + case 220: + return 16; + case 222: + return 17; + case 210: + return 18; + case 211: + return hasArguments ? 19 : 18; + case 212: + case 208: + case 209: + case 233: + return 19; + case 231: + case 235: + return 11; + case 108: + case 106: + case 79: + case 80: + case 104: + case 110: + case 95: + case 8: + case 9: + case 10: + case 206: + case 207: + case 215: + case 216: + case 228: + case 13: + case 14: + case 225: + case 214: + case 229: + case 281: + case 282: + case 285: + return 20; + default: + return -1; + } + } + ts2.getOperatorPrecedence = getOperatorPrecedence; + function getBinaryOperatorPrecedence(kind) { + switch (kind) { + case 60: + return 4; + case 56: + return 5; + case 55: + return 6; + case 51: + return 7; + case 52: + return 8; + case 50: + return 9; + case 34: + case 35: + case 36: + case 37: + return 10; + case 29: + case 31: + case 32: + case 33: + case 102: + case 101: + case 128: + case 150: + return 11; + case 47: + case 48: + case 49: + return 12; + case 39: + case 40: + return 13; + case 41: + case 43: + case 44: + return 14; + case 42: + return 15; + } + return -1; + } + ts2.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; + function getSemanticJsxChildren(children) { + return ts2.filter(children, function(i7) { + switch (i7.kind) { + case 291: + return !!i7.expression; + case 11: + return !i7.containsOnlyTriviaWhiteSpaces; + default: + return true; + } + }); + } + ts2.getSemanticJsxChildren = getSemanticJsxChildren; + function createDiagnosticCollection() { + var nonFileDiagnostics = []; + var filesWithDiagnostics = []; + var fileDiagnostics = new ts2.Map(); + var hasReadNonFileDiagnostics = false; + return { + add: add2, + lookup, + getGlobalDiagnostics, + getDiagnostics + }; + function lookup(diagnostic) { + var diagnostics; + if (diagnostic.file) { + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); + } else { + diagnostics = nonFileDiagnostics; + } + if (!diagnostics) { + return void 0; + } + var result2 = ts2.binarySearch(diagnostics, diagnostic, ts2.identity, compareDiagnosticsSkipRelatedInformation); + if (result2 >= 0) { + return diagnostics[result2]; + } + return void 0; + } + function add2(diagnostic) { + var diagnostics; + if (diagnostic.file) { + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); + if (!diagnostics) { + diagnostics = []; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts2.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts2.compareStringsCaseSensitive); + } + } else { + if (hasReadNonFileDiagnostics) { + hasReadNonFileDiagnostics = false; + nonFileDiagnostics = nonFileDiagnostics.slice(); + } + diagnostics = nonFileDiagnostics; + } + ts2.insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation); + } + function getGlobalDiagnostics() { + hasReadNonFileDiagnostics = true; + return nonFileDiagnostics; + } + function getDiagnostics(fileName) { + if (fileName) { + return fileDiagnostics.get(fileName) || []; + } + var fileDiags = ts2.flatMapToMutable(filesWithDiagnostics, function(f8) { + return fileDiagnostics.get(f8); + }); + if (!nonFileDiagnostics.length) { + return fileDiags; + } + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; + } + } + ts2.createDiagnosticCollection = createDiagnosticCollection; + var templateSubstitutionRegExp = /\$\{/g; + function escapeTemplateSubstitution(str2) { + return str2.replace(templateSubstitutionRegExp, "\\${"); + } + function hasInvalidEscape(template2) { + return template2 && !!(ts2.isNoSubstitutionTemplateLiteral(template2) ? template2.templateFlags : template2.head.templateFlags || ts2.some(template2.templateSpans, function(span) { + return !!span.literal.templateFlags; + })); + } + ts2.hasInvalidEscape = hasInvalidEscape; + var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; + var escapedCharsMap = new ts2.Map(ts2.getEntries({ + " ": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\r": "\\r", + "\n": "\\n", + "\\": "\\\\", + '"': '\\"', + "'": "\\'", + "`": "\\`", + "\u2028": "\\u2028", + "\u2029": "\\u2029", + "\x85": "\\u0085", + "\r\n": "\\r\\n" + // special case for CRLFs in backticks + })); + function encodeUtf16EscapeSequence(charCode) { + var hexCharCode = charCode.toString(16).toUpperCase(); + var paddedHexCode = ("0000" + hexCharCode).slice(-4); + return "\\u" + paddedHexCode; + } + function getReplacement(c7, offset, input) { + if (c7.charCodeAt(0) === 0) { + var lookAhead = input.charCodeAt(offset + c7.length); + if (lookAhead >= 48 && lookAhead <= 57) { + return "\\x00"; + } + return "\\0"; + } + return escapedCharsMap.get(c7) || encodeUtf16EscapeSequence(c7.charCodeAt(0)); + } + function escapeString2(s7, quoteChar) { + var escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; + return s7.replace(escapedCharsRegExp, getReplacement); + } + ts2.escapeString = escapeString2; + var nonAsciiCharacters = /[^\u0000-\u007F]/g; + function escapeNonAsciiString(s7, quoteChar) { + s7 = escapeString2(s7, quoteChar); + return nonAsciiCharacters.test(s7) ? s7.replace(nonAsciiCharacters, function(c7) { + return encodeUtf16EscapeSequence(c7.charCodeAt(0)); + }) : s7; + } + ts2.escapeNonAsciiString = escapeNonAsciiString; + var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g; + var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g; + var jsxEscapedCharsMap = new ts2.Map(ts2.getEntries({ + '"': """, + "'": "'" + })); + function encodeJsxCharacterEntity(charCode) { + var hexCharCode = charCode.toString(16).toUpperCase(); + return "&#x" + hexCharCode + ";"; + } + function getJsxAttributeStringReplacement(c7) { + if (c7.charCodeAt(0) === 0) { + return "�"; + } + return jsxEscapedCharsMap.get(c7) || encodeJsxCharacterEntity(c7.charCodeAt(0)); + } + function escapeJsxAttributeString(s7, quoteChar) { + var escapedCharsRegExp = quoteChar === 39 ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; + return s7.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); + } + ts2.escapeJsxAttributeString = escapeJsxAttributeString; + function stripQuotes(name2) { + var length = name2.length; + if (length >= 2 && name2.charCodeAt(0) === name2.charCodeAt(length - 1) && isQuoteOrBacktick(name2.charCodeAt(0))) { + return name2.substring(1, length - 1); + } + return name2; + } + ts2.stripQuotes = stripQuotes; + function isQuoteOrBacktick(charCode) { + return charCode === 39 || charCode === 34 || charCode === 96; + } + function isIntrinsicJsxName(name2) { + var ch = name2.charCodeAt(0); + return ch >= 97 && ch <= 122 || ts2.stringContains(name2, "-") || ts2.stringContains(name2, ":"); + } + ts2.isIntrinsicJsxName = isIntrinsicJsxName; + var indentStrings = ["", " "]; + function getIndentString(level) { + var singleLevel = indentStrings[1]; + for (var current = indentStrings.length; current <= level; current++) { + indentStrings.push(indentStrings[current - 1] + singleLevel); + } + return indentStrings[level]; + } + ts2.getIndentString = getIndentString; + function getIndentSize() { + return indentStrings[1].length; + } + ts2.getIndentSize = getIndentSize; + function isNightly() { + return ts2.stringContains(ts2.version, "-dev") || ts2.stringContains(ts2.version, "-insiders"); + } + ts2.isNightly = isNightly; + function createTextWriter(newLine) { + var output; + var indent; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; + function updateLineCountAndPosFor(s7) { + var lineStartsOfS = ts2.computeLineStarts(s7); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s7.length + ts2.last(lineStartsOfS); + lineStart = linePos - output.length === 0; + } else { + lineStart = false; + } + } + function writeText(s7) { + if (s7 && s7.length) { + if (lineStart) { + s7 = getIndentString(indent) + s7; + lineStart = false; + } + output += s7; + updateLineCountAndPosFor(s7); + } + } + function write(s7) { + if (s7) + hasTrailingComment = false; + writeText(s7); + } + function writeComment(s7) { + if (s7) + hasTrailingComment = true; + writeText(s7); + } + function reset() { + output = ""; + indent = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + hasTrailingComment = false; + } + function rawWrite(s7) { + if (s7 !== void 0) { + output += s7; + updateLineCountAndPosFor(s7); + hasTrailingComment = false; + } + } + function writeLiteral(s7) { + if (s7 && s7.length) { + write(s7); + } + } + function writeLine(force) { + if (!lineStart || force) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + hasTrailingComment = false; + } + } + function getTextPosWithWriteLine() { + return lineStart ? output.length : output.length + newLine.length; + } + reset(); + return { + write, + rawWrite, + writeLiteral, + writeLine, + increaseIndent: function() { + indent++; + }, + decreaseIndent: function() { + indent--; + }, + getIndent: function() { + return indent; + }, + getTextPos: function() { + return output.length; + }, + getLine: function() { + return lineCount; + }, + getColumn: function() { + return lineStart ? indent * getIndentSize() : output.length - linePos; + }, + getText: function() { + return output; + }, + isAtStartOfLine: function() { + return lineStart; + }, + hasTrailingComment: function() { + return hasTrailingComment; + }, + hasTrailingWhitespace: function() { + return !!output.length && ts2.isWhiteSpaceLike(output.charCodeAt(output.length - 1)); + }, + clear: reset, + reportInaccessibleThisError: ts2.noop, + reportPrivateInBaseOfClassExpression: ts2.noop, + reportInaccessibleUniqueSymbolError: ts2.noop, + trackSymbol: function() { + return false; + }, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: function(s7, _6) { + return write(s7); + }, + writeTrailingSemicolon: write, + writeComment, + getTextPosWithWriteLine + }; + } + ts2.createTextWriter = createTextWriter; + function getTrailingSemicolonDeferringWriter(writer) { + var pendingTrailingSemicolon = false; + function commitPendingTrailingSemicolon() { + if (pendingTrailingSemicolon) { + writer.writeTrailingSemicolon(";"); + pendingTrailingSemicolon = false; + } + } + return __assign16(__assign16({}, writer), { writeTrailingSemicolon: function() { + pendingTrailingSemicolon = true; + }, writeLiteral: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeLiteral(s7); + }, writeStringLiteral: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeStringLiteral(s7); + }, writeSymbol: function(s7, sym) { + commitPendingTrailingSemicolon(); + writer.writeSymbol(s7, sym); + }, writePunctuation: function(s7) { + commitPendingTrailingSemicolon(); + writer.writePunctuation(s7); + }, writeKeyword: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeKeyword(s7); + }, writeOperator: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeOperator(s7); + }, writeParameter: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeParameter(s7); + }, writeSpace: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeSpace(s7); + }, writeProperty: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeProperty(s7); + }, writeComment: function(s7) { + commitPendingTrailingSemicolon(); + writer.writeComment(s7); + }, writeLine: function() { + commitPendingTrailingSemicolon(); + writer.writeLine(); + }, increaseIndent: function() { + commitPendingTrailingSemicolon(); + writer.increaseIndent(); + }, decreaseIndent: function() { + commitPendingTrailingSemicolon(); + writer.decreaseIndent(); + } }); + } + ts2.getTrailingSemicolonDeferringWriter = getTrailingSemicolonDeferringWriter; + function hostUsesCaseSensitiveFileNames(host) { + return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; + } + ts2.hostUsesCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames; + function hostGetCanonicalFileName(host) { + return ts2.createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host)); + } + ts2.hostGetCanonicalFileName = hostGetCanonicalFileName; + function getResolvedExternalModuleName(host, file, referenceFile) { + return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName); + } + ts2.getResolvedExternalModuleName = getResolvedExternalModuleName; + function getCanonicalAbsolutePath(host, path2) { + return host.getCanonicalFileName(ts2.getNormalizedAbsolutePath(path2, host.getCurrentDirectory())); + } + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + var file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || file.isDeclarationFile) { + return void 0; + } + var specifier = getExternalModuleName(declaration); + if (specifier && ts2.isStringLiteralLike(specifier) && !ts2.pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).indexOf(getCanonicalAbsolutePath(host, ts2.ensureTrailingDirectorySeparator(host.getCommonSourceDirectory()))) === -1) { + return void 0; + } + return getResolvedExternalModuleName(host, file); + } + ts2.getExternalModuleNameFromDeclaration = getExternalModuleNameFromDeclaration; + function getExternalModuleNameFromPath(host, fileName, referencePath) { + var getCanonicalFileName = function(f8) { + return host.getCanonicalFileName(f8); + }; + var dir2 = ts2.toPath(referencePath ? ts2.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + var filePath = ts2.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + var relativePath2 = ts2.getRelativePathToDirectoryOrUrl( + dir2, + filePath, + dir2, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + var extensionless = removeFileExtension(relativePath2); + return referencePath ? ts2.ensurePathIsNonModuleName(extensionless) : extensionless; + } + ts2.getExternalModuleNameFromPath = getExternalModuleNameFromPath; + function getOwnEmitOutputFilePath(fileName, host, extension) { + var compilerOptions = host.getCompilerOptions(); + var emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(fileName, host, compilerOptions.outDir)); + } else { + emitOutputFilePathWithoutExtension = removeFileExtension(fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + ts2.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; + function getDeclarationEmitOutputFilePath(fileName, host) { + return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), function(f8) { + return host.getCanonicalFileName(f8); + }); + } + ts2.getDeclarationEmitOutputFilePath = getDeclarationEmitOutputFilePath; + function getDeclarationEmitOutputFilePathWorker(fileName, options, currentDirectory, commonSourceDirectory, getCanonicalFileName) { + var outputDir = options.declarationDir || options.outDir; + var path2 = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName) : fileName; + var declarationExtension = getDeclarationEmitExtensionForPath(path2); + return removeFileExtension(path2) + declarationExtension; + } + ts2.getDeclarationEmitOutputFilePathWorker = getDeclarationEmitOutputFilePathWorker; + function getDeclarationEmitExtensionForPath(path2) { + return ts2.fileExtensionIsOneOf(path2, [ + ".mjs", + ".mts" + /* Extension.Mts */ + ]) ? ".d.mts" : ts2.fileExtensionIsOneOf(path2, [ + ".cjs", + ".cts" + /* Extension.Cts */ + ]) ? ".d.cts" : ts2.fileExtensionIsOneOf(path2, [ + ".json" + /* Extension.Json */ + ]) ? ".json.d.ts" : ( + // Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well + ".d.ts" + ); + } + ts2.getDeclarationEmitExtensionForPath = getDeclarationEmitExtensionForPath; + function getPossibleOriginalInputExtensionForExtension(path2) { + return ts2.fileExtensionIsOneOf(path2, [ + ".d.mts", + ".mjs", + ".mts" + /* Extension.Mts */ + ]) ? [ + ".mts", + ".mjs" + /* Extension.Mjs */ + ] : ts2.fileExtensionIsOneOf(path2, [ + ".d.cts", + ".cjs", + ".cts" + /* Extension.Cts */ + ]) ? [ + ".cts", + ".cjs" + /* Extension.Cjs */ + ] : ts2.fileExtensionIsOneOf(path2, [".json.d.ts"]) ? [ + ".json" + /* Extension.Json */ + ] : [ + ".tsx", + ".ts", + ".jsx", + ".js" + /* Extension.Js */ + ]; + } + ts2.getPossibleOriginalInputExtensionForExtension = getPossibleOriginalInputExtensionForExtension; + function outFile(options) { + return options.outFile || options.out; + } + ts2.outFile = outFile; + function getPathsBasePath(options, host) { + var _a2, _b; + if (!options.paths) + return void 0; + return (_a2 = options.baseUrl) !== null && _a2 !== void 0 ? _a2 : ts2.Debug.checkDefined(options.pathsBasePath || ((_b = host.getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); + } + ts2.getPathsBasePath = getPathsBasePath; + function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) { + var options = host.getCompilerOptions(); + if (outFile(options)) { + var moduleKind = getEmitModuleKind(options); + var moduleEmitEnabled_1 = options.emitDeclarationOnly || moduleKind === ts2.ModuleKind.AMD || moduleKind === ts2.ModuleKind.System; + return ts2.filter(host.getSourceFiles(), function(sourceFile) { + return (moduleEmitEnabled_1 || !ts2.isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); + }); + } else { + var sourceFiles = targetSourceFile === void 0 ? host.getSourceFiles() : [targetSourceFile]; + return ts2.filter(sourceFiles, function(sourceFile) { + return sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit); + }); + } + } + ts2.getSourceFilesToEmit = getSourceFilesToEmit; + function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { + var options = host.getCompilerOptions(); + return !(options.noEmitForJsFiles && isSourceFileJS(sourceFile)) && !sourceFile.isDeclarationFile && !host.isSourceFileFromExternalLibrary(sourceFile) && (forceDtsEmit || !(isJsonSourceFile(sourceFile) && host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) && !host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)); + } + ts2.sourceFileMayBeEmitted = sourceFileMayBeEmitted; + function getSourceFilePathInNewDir(fileName, host, newDirPath) { + return getSourceFilePathInNewDirWorker(fileName, newDirPath, host.getCurrentDirectory(), host.getCommonSourceDirectory(), function(f8) { + return host.getCanonicalFileName(f8); + }); + } + ts2.getSourceFilePathInNewDir = getSourceFilePathInNewDir; + function getSourceFilePathInNewDirWorker(fileName, newDirPath, currentDirectory, commonSourceDirectory, getCanonicalFileName) { + var sourceFilePath = ts2.getNormalizedAbsolutePath(fileName, currentDirectory); + var isSourceFileInCommonSourceDirectory = getCanonicalFileName(sourceFilePath).indexOf(getCanonicalFileName(commonSourceDirectory)) === 0; + sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath; + return ts2.combinePaths(newDirPath, sourceFilePath); + } + ts2.getSourceFilePathInNewDirWorker = getSourceFilePathInNewDirWorker; + function writeFile2(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) { + host.writeFile(fileName, text, writeByteOrderMark, function(hostErrorMessage) { + diagnostics.add(createCompilerDiagnostic(ts2.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }, sourceFiles, data); + } + ts2.writeFile = writeFile2; + function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) { + if (directoryPath.length > ts2.getRootLength(directoryPath) && !directoryExists(directoryPath)) { + var parentDirectory = ts2.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory, createDirectory, directoryExists); + createDirectory(directoryPath); + } + } + function writeFileEnsuringDirectories(path2, data, writeByteOrderMark, writeFile3, createDirectory, directoryExists) { + try { + writeFile3(path2, data, writeByteOrderMark); + } catch (_a2) { + ensureDirectoriesExist(ts2.getDirectoryPath(ts2.normalizePath(path2)), createDirectory, directoryExists); + writeFile3(path2, data, writeByteOrderMark); + } + } + ts2.writeFileEnsuringDirectories = writeFileEnsuringDirectories; + function getLineOfLocalPosition(sourceFile, pos) { + var lineStarts = ts2.getLineStarts(sourceFile); + return ts2.computeLineOfPosition(lineStarts, pos); + } + ts2.getLineOfLocalPosition = getLineOfLocalPosition; + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return ts2.computeLineOfPosition(lineMap, pos); + } + ts2.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; + function getFirstConstructorWithBody(node) { + return ts2.find(node.members, function(member) { + return ts2.isConstructorDeclaration(member) && nodeIsPresent(member.body); + }); + } + ts2.getFirstConstructorWithBody = getFirstConstructorWithBody; + function getSetAccessorValueParameter(accessor) { + if (accessor && accessor.parameters.length > 0) { + var hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]); + return accessor.parameters[hasThis ? 1 : 0]; + } + } + ts2.getSetAccessorValueParameter = getSetAccessorValueParameter; + function getSetAccessorTypeAnnotationNode(accessor) { + var parameter = getSetAccessorValueParameter(accessor); + return parameter && parameter.type; + } + ts2.getSetAccessorTypeAnnotationNode = getSetAccessorTypeAnnotationNode; + function getThisParameter(signature) { + if (signature.parameters.length && !ts2.isJSDocSignature(signature)) { + var thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + } + ts2.getThisParameter = getThisParameter; + function parameterIsThisKeyword(parameter) { + return isThisIdentifier(parameter.name); + } + ts2.parameterIsThisKeyword = parameterIsThisKeyword; + function isThisIdentifier(node) { + return !!node && node.kind === 79 && identifierIsThisKeyword(node); + } + ts2.isThisIdentifier = isThisIdentifier; + function isThisInTypeQuery(node) { + if (!isThisIdentifier(node)) { + return false; + } + while (ts2.isQualifiedName(node.parent) && node.parent.left === node) { + node = node.parent; + } + return node.parent.kind === 183; + } + ts2.isThisInTypeQuery = isThisInTypeQuery; + function identifierIsThisKeyword(id) { + return id.originalKeywordKind === 108; + } + ts2.identifierIsThisKeyword = identifierIsThisKeyword; + function getAllAccessorDeclarations(declarations, accessor) { + var firstAccessor; + var secondAccessor; + var getAccessor; + var setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 174) { + getAccessor = accessor; + } else if (accessor.kind === 175) { + setAccessor = accessor; + } else { + ts2.Debug.fail("Accessor has wrong kind"); + } + } else { + ts2.forEach(declarations, function(member) { + if (ts2.isAccessor(member) && isStatic(member) === isStatic(accessor)) { + var memberName = getPropertyNameForPropertyNameNode(member.name); + var accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 174 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 175 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor, + secondAccessor, + getAccessor, + setAccessor + }; + } + ts2.getAllAccessorDeclarations = getAllAccessorDeclarations; + function getEffectiveTypeAnnotationNode(node) { + if (!isInJSFile(node) && ts2.isFunctionDeclaration(node)) + return void 0; + var type3 = node.type; + if (type3 || !isInJSFile(node)) + return type3; + return ts2.isJSDocPropertyLikeTag(node) ? node.typeExpression && node.typeExpression.type : ts2.getJSDocType(node); + } + ts2.getEffectiveTypeAnnotationNode = getEffectiveTypeAnnotationNode; + function getTypeAnnotationNode(node) { + return node.type; + } + ts2.getTypeAnnotationNode = getTypeAnnotationNode; + function getEffectiveReturnTypeNode(node) { + return ts2.isJSDocSignature(node) ? node.type && node.type.typeExpression && node.type.typeExpression.type : node.type || (isInJSFile(node) ? ts2.getJSDocReturnType(node) : void 0); + } + ts2.getEffectiveReturnTypeNode = getEffectiveReturnTypeNode; + function getJSDocTypeParameterDeclarations(node) { + return ts2.flatMap(ts2.getJSDocTags(node), function(tag) { + return isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0; + }); + } + ts2.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; + function isNonTypeAliasTemplate(tag) { + return ts2.isJSDocTemplateTag(tag) && !(tag.parent.kind === 323 && tag.parent.tags.some(isJSDocTypeAlias)); + } + function getEffectiveSetAccessorTypeAnnotationNode(node) { + var parameter = getSetAccessorValueParameter(node); + return parameter && getEffectiveTypeAnnotationNode(parameter); + } + ts2.getEffectiveSetAccessorTypeAnnotationNode = getEffectiveSetAccessorTypeAnnotationNode; + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { + emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); + } + ts2.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; + function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { + if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { + writer.writeLine(); + } + } + ts2.emitNewLineBeforeLeadingCommentsOfPosition = emitNewLineBeforeLeadingCommentsOfPosition; + function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { + if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { + writer.writeLine(); + } + } + ts2.emitNewLineBeforeLeadingCommentOfPosition = emitNewLineBeforeLeadingCommentOfPosition; + function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { + if (comments && comments.length > 0) { + if (leadingSeparator) { + writer.writeSpace(" "); + } + var emitInterveningSeparator = false; + for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) { + var comment = comments_1[_i]; + if (emitInterveningSeparator) { + writer.writeSpace(" "); + emitInterveningSeparator = false; + } + writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } else { + emitInterveningSeparator = true; + } + } + if (emitInterveningSeparator && trailingSeparator) { + writer.writeSpace(" "); + } + } + } + ts2.emitComments = emitComments; + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { + var leadingComments; + var currentDetachedCommentInfo; + if (removeComments) { + if (node.pos === 0) { + leadingComments = ts2.filter(ts2.getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); + } + } else { + leadingComments = ts2.getLeadingCommentRanges(text, node.pos); + } + if (leadingComments) { + var detachedComments = []; + var lastComment = void 0; + for (var _i = 0, leadingComments_1 = leadingComments; _i < leadingComments_1.length; _i++) { + var comment = leadingComments_1[_i]; + if (lastComment) { + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + var commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); + if (commentLine >= lastCommentLine + 2) { + break; + } + } + detachedComments.push(comment); + lastComment = comment; + } + if (detachedComments.length) { + var lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, ts2.last(detachedComments).end); + var nodeLine = getLineOfLocalPositionFromLineMap(lineMap, ts2.skipTrivia(text, node.pos)); + if (nodeLine >= lastCommentLine + 2) { + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments( + text, + lineMap, + writer, + detachedComments, + /*leadingSeparator*/ + false, + /*trailingSeparator*/ + true, + newLine, + writeComment + ); + currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts2.last(detachedComments).end }; + } + } + } + return currentDetachedCommentInfo; + function isPinnedCommentLocal(comment2) { + return isPinnedComment(text, comment2.pos); + } + } + ts2.emitDetachedComments = emitDetachedComments; + function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { + if (text.charCodeAt(commentPos + 1) === 42) { + var firstCommentLineAndCharacter = ts2.computeLineAndCharacterOfPosition(lineMap, commentPos); + var lineCount = lineMap.length; + var firstCommentLineIndent = void 0; + for (var pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { + var nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; + if (pos !== commentPos) { + if (firstCommentLineIndent === void 0) { + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); + } + var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); + if (spacesToEmit > 0) { + var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); + pos = nextLineStart; + } + } else { + writer.writeComment(text.substring(commentPos, commentEnd)); + } + } + ts2.writeCommentRange = writeCommentRange; + function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { + var end = Math.min(commentEnd, nextLineStart - 1); + var currentLineText = ts2.trimString(text.substring(pos, end)); + if (currentLineText) { + writer.writeComment(currentLineText); + if (end !== commentEnd) { + writer.writeLine(); + } + } else { + writer.rawWrite(newLine); + } + } + function calculateIndent(text, pos, end) { + var currentLineIndent = 0; + for (; pos < end && ts2.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); + } else { + currentLineIndent++; + } + } + return currentLineIndent; + } + function hasEffectiveModifiers(node) { + return getEffectiveModifierFlags(node) !== 0; + } + ts2.hasEffectiveModifiers = hasEffectiveModifiers; + function hasSyntacticModifiers(node) { + return getSyntacticModifierFlags(node) !== 0; + } + ts2.hasSyntacticModifiers = hasSyntacticModifiers; + function hasEffectiveModifier(node, flags) { + return !!getSelectedEffectiveModifierFlags(node, flags); + } + ts2.hasEffectiveModifier = hasEffectiveModifier; + function hasSyntacticModifier(node, flags) { + return !!getSelectedSyntacticModifierFlags(node, flags); + } + ts2.hasSyntacticModifier = hasSyntacticModifier; + function isStatic(node) { + return ts2.isClassElement(node) && hasStaticModifier(node) || ts2.isClassStaticBlockDeclaration(node); + } + ts2.isStatic = isStatic; + function hasStaticModifier(node) { + return hasSyntacticModifier( + node, + 32 + /* ModifierFlags.Static */ + ); + } + ts2.hasStaticModifier = hasStaticModifier; + function hasOverrideModifier(node) { + return hasEffectiveModifier( + node, + 16384 + /* ModifierFlags.Override */ + ); + } + ts2.hasOverrideModifier = hasOverrideModifier; + function hasAbstractModifier(node) { + return hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + ); + } + ts2.hasAbstractModifier = hasAbstractModifier; + function hasAmbientModifier(node) { + return hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + ); + } + ts2.hasAmbientModifier = hasAmbientModifier; + function hasAccessorModifier(node) { + return hasSyntacticModifier( + node, + 128 + /* ModifierFlags.Accessor */ + ); + } + ts2.hasAccessorModifier = hasAccessorModifier; + function hasEffectiveReadonlyModifier(node) { + return hasEffectiveModifier( + node, + 64 + /* ModifierFlags.Readonly */ + ); + } + ts2.hasEffectiveReadonlyModifier = hasEffectiveReadonlyModifier; + function hasDecorators(node) { + return hasSyntacticModifier( + node, + 131072 + /* ModifierFlags.Decorator */ + ); + } + ts2.hasDecorators = hasDecorators; + function getSelectedEffectiveModifierFlags(node, flags) { + return getEffectiveModifierFlags(node) & flags; + } + ts2.getSelectedEffectiveModifierFlags = getSelectedEffectiveModifierFlags; + function getSelectedSyntacticModifierFlags(node, flags) { + return getSyntacticModifierFlags(node) & flags; + } + ts2.getSelectedSyntacticModifierFlags = getSelectedSyntacticModifierFlags; + function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { + if (node.kind >= 0 && node.kind <= 162) { + return 0; + } + if (!(node.modifierFlagsCache & 536870912)) { + node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912; + } + if (includeJSDoc && !(node.modifierFlagsCache & 4096) && (alwaysIncludeJSDoc || isInJSFile(node)) && node.parent) { + node.modifierFlagsCache |= getJSDocModifierFlagsNoCache(node) | 4096; + } + return node.modifierFlagsCache & ~(536870912 | 4096); + } + function getEffectiveModifierFlags(node) { + return getModifierFlagsWorker( + node, + /*includeJSDoc*/ + true + ); + } + ts2.getEffectiveModifierFlags = getEffectiveModifierFlags; + function getEffectiveModifierFlagsAlwaysIncludeJSDoc(node) { + return getModifierFlagsWorker( + node, + /*includeJSDOc*/ + true, + /*alwaysIncludeJSDOc*/ + true + ); + } + ts2.getEffectiveModifierFlagsAlwaysIncludeJSDoc = getEffectiveModifierFlagsAlwaysIncludeJSDoc; + function getSyntacticModifierFlags(node) { + return getModifierFlagsWorker( + node, + /*includeJSDoc*/ + false + ); + } + ts2.getSyntacticModifierFlags = getSyntacticModifierFlags; + function getJSDocModifierFlagsNoCache(node) { + var flags = 0; + if (!!node.parent && !ts2.isParameter(node)) { + if (isInJSFile(node)) { + if (ts2.getJSDocPublicTagNoCache(node)) + flags |= 4; + if (ts2.getJSDocPrivateTagNoCache(node)) + flags |= 8; + if (ts2.getJSDocProtectedTagNoCache(node)) + flags |= 16; + if (ts2.getJSDocReadonlyTagNoCache(node)) + flags |= 64; + if (ts2.getJSDocOverrideTagNoCache(node)) + flags |= 16384; + } + if (ts2.getJSDocDeprecatedTagNoCache(node)) + flags |= 8192; + } + return flags; + } + function getEffectiveModifierFlagsNoCache(node) { + return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node); + } + ts2.getEffectiveModifierFlagsNoCache = getEffectiveModifierFlagsNoCache; + function getSyntacticModifierFlagsNoCache(node) { + var flags = ts2.canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0; + if (node.flags & 4 || node.kind === 79 && node.isInJSDocNamespace) { + flags |= 1; + } + return flags; + } + ts2.getSyntacticModifierFlagsNoCache = getSyntacticModifierFlagsNoCache; + function modifiersToFlags(modifiers) { + var flags = 0; + if (modifiers) { + for (var _i = 0, modifiers_1 = modifiers; _i < modifiers_1.length; _i++) { + var modifier = modifiers_1[_i]; + flags |= modifierToFlag(modifier.kind); + } + } + return flags; + } + ts2.modifiersToFlags = modifiersToFlags; + function modifierToFlag(token) { + switch (token) { + case 124: + return 32; + case 123: + return 4; + case 122: + return 16; + case 121: + return 8; + case 126: + return 256; + case 127: + return 128; + case 93: + return 1; + case 136: + return 2; + case 85: + return 2048; + case 88: + return 1024; + case 132: + return 512; + case 146: + return 64; + case 161: + return 16384; + case 101: + return 32768; + case 145: + return 65536; + case 167: + return 131072; + } + return 0; + } + ts2.modifierToFlag = modifierToFlag; + function isLogicalOperator(token) { + return token === 56 || token === 55 || token === 53; + } + ts2.isLogicalOperator = isLogicalOperator; + function isLogicalOrCoalescingAssignmentOperator(token) { + return token === 75 || token === 76 || token === 77; + } + ts2.isLogicalOrCoalescingAssignmentOperator = isLogicalOrCoalescingAssignmentOperator; + function isLogicalOrCoalescingAssignmentExpression(expr) { + return isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + } + ts2.isLogicalOrCoalescingAssignmentExpression = isLogicalOrCoalescingAssignmentExpression; + function isAssignmentOperator(token) { + return token >= 63 && token <= 78; + } + ts2.isAssignmentOperator = isAssignmentOperator; + function tryGetClassExtendingExpressionWithTypeArguments(node) { + var cls = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + return cls && !cls.isImplements ? cls.class : void 0; + } + ts2.tryGetClassExtendingExpressionWithTypeArguments = tryGetClassExtendingExpressionWithTypeArguments; + function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node) { + return ts2.isExpressionWithTypeArguments(node) && ts2.isHeritageClause(node.parent) && ts2.isClassLike(node.parent.parent) ? { + class: node.parent.parent, + isImplements: node.parent.token === 117 + /* SyntaxKind.ImplementsKeyword */ + } : void 0; + } + ts2.tryGetClassImplementingOrExtendingExpressionWithTypeArguments = tryGetClassImplementingOrExtendingExpressionWithTypeArguments; + function isAssignmentExpression(node, excludeCompoundAssignment) { + return ts2.isBinaryExpression(node) && (excludeCompoundAssignment ? node.operatorToken.kind === 63 : isAssignmentOperator(node.operatorToken.kind)) && ts2.isLeftHandSideExpression(node.left); + } + ts2.isAssignmentExpression = isAssignmentExpression; + function isLeftHandSideOfAssignment(node) { + return isAssignmentExpression(node.parent) && node.parent.left === node; + } + ts2.isLeftHandSideOfAssignment = isLeftHandSideOfAssignment; + function isDestructuringAssignment(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + var kind = node.left.kind; + return kind === 207 || kind === 206; + } + return false; + } + ts2.isDestructuringAssignment = isDestructuringAssignment; + function isExpressionWithTypeArgumentsInClassExtendsClause(node) { + return tryGetClassExtendingExpressionWithTypeArguments(node) !== void 0; + } + ts2.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; + function isEntityNameExpression(node) { + return node.kind === 79 || isPropertyAccessEntityNameExpression(node); + } + ts2.isEntityNameExpression = isEntityNameExpression; + function getFirstIdentifier(node) { + switch (node.kind) { + case 79: + return node; + case 163: + do { + node = node.left; + } while (node.kind !== 79); + return node; + case 208: + do { + node = node.expression; + } while (node.kind !== 79); + return node; + } + } + ts2.getFirstIdentifier = getFirstIdentifier; + function isDottedName(node) { + return node.kind === 79 || node.kind === 108 || node.kind === 106 || node.kind === 233 || node.kind === 208 && isDottedName(node.expression) || node.kind === 214 && isDottedName(node.expression); + } + ts2.isDottedName = isDottedName; + function isPropertyAccessEntityNameExpression(node) { + return ts2.isPropertyAccessExpression(node) && ts2.isIdentifier(node.name) && isEntityNameExpression(node.expression); + } + ts2.isPropertyAccessEntityNameExpression = isPropertyAccessEntityNameExpression; + function tryGetPropertyAccessOrIdentifierToString(expr) { + if (ts2.isPropertyAccessExpression(expr)) { + var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (baseStr !== void 0) { + return baseStr + "." + entityNameToString(expr.name); + } + } else if (ts2.isElementAccessExpression(expr)) { + var baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (baseStr !== void 0 && ts2.isPropertyName(expr.argumentExpression)) { + return baseStr + "." + getPropertyNameForPropertyNameNode(expr.argumentExpression); + } + } else if (ts2.isIdentifier(expr)) { + return ts2.unescapeLeadingUnderscores(expr.escapedText); + } + return void 0; + } + ts2.tryGetPropertyAccessOrIdentifierToString = tryGetPropertyAccessOrIdentifierToString; + function isPrototypeAccess(node) { + return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; + } + ts2.isPrototypeAccess = isPrototypeAccess; + function isRightSideOfQualifiedNameOrPropertyAccess(node) { + return node.parent.kind === 163 && node.parent.right === node || node.parent.kind === 208 && node.parent.name === node; + } + ts2.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; + function isRightSideOfAccessExpression(node) { + return ts2.isPropertyAccessExpression(node.parent) && node.parent.name === node || ts2.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node; + } + ts2.isRightSideOfAccessExpression = isRightSideOfAccessExpression; + function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) { + return ts2.isQualifiedName(node.parent) && node.parent.right === node || ts2.isPropertyAccessExpression(node.parent) && node.parent.name === node || ts2.isJSDocMemberName(node.parent) && node.parent.right === node; + } + ts2.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName = isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName; + function isEmptyObjectLiteral(expression) { + return expression.kind === 207 && expression.properties.length === 0; + } + ts2.isEmptyObjectLiteral = isEmptyObjectLiteral; + function isEmptyArrayLiteral(expression) { + return expression.kind === 206 && expression.elements.length === 0; + } + ts2.isEmptyArrayLiteral = isEmptyArrayLiteral; + function getLocalSymbolForExportDefault(symbol) { + if (!isExportDefaultSymbol(symbol) || !symbol.declarations) + return void 0; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (decl.localSymbol) + return decl.localSymbol; + } + return void 0; + } + ts2.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; + function isExportDefaultSymbol(symbol) { + return symbol && ts2.length(symbol.declarations) > 0 && hasSyntacticModifier( + symbol.declarations[0], + 1024 + /* ModifierFlags.Default */ + ); + } + function tryExtractTSExtension(fileName) { + return ts2.find(supportedTSExtensionsForExtractExtension, function(extension) { + return ts2.fileExtensionIs(fileName, extension); + }); + } + ts2.tryExtractTSExtension = tryExtractTSExtension; + function getExpandedCharCodes(input) { + var output = []; + var length = input.length; + for (var i7 = 0; i7 < length; i7++) { + var charCode = input.charCodeAt(i7); + if (charCode < 128) { + output.push(charCode); + } else if (charCode < 2048) { + output.push(charCode >> 6 | 192); + output.push(charCode & 63 | 128); + } else if (charCode < 65536) { + output.push(charCode >> 12 | 224); + output.push(charCode >> 6 & 63 | 128); + output.push(charCode & 63 | 128); + } else if (charCode < 131072) { + output.push(charCode >> 18 | 240); + output.push(charCode >> 12 & 63 | 128); + output.push(charCode >> 6 & 63 | 128); + output.push(charCode & 63 | 128); + } else { + ts2.Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + function convertToBase64(input) { + var result2 = ""; + var charCodes = getExpandedCharCodes(input); + var i7 = 0; + var length = charCodes.length; + var byte1, byte2, byte3, byte4; + while (i7 < length) { + byte1 = charCodes[i7] >> 2; + byte2 = (charCodes[i7] & 3) << 4 | charCodes[i7 + 1] >> 4; + byte3 = (charCodes[i7 + 1] & 15) << 2 | charCodes[i7 + 2] >> 6; + byte4 = charCodes[i7 + 2] & 63; + if (i7 + 1 >= length) { + byte3 = byte4 = 64; + } else if (i7 + 2 >= length) { + byte4 = 64; + } + result2 += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i7 += 3; + } + return result2; + } + ts2.convertToBase64 = convertToBase64; + function getStringFromExpandedCharCodes(codes2) { + var output = ""; + var i7 = 0; + var length = codes2.length; + while (i7 < length) { + var charCode = codes2[i7]; + if (charCode < 128) { + output += String.fromCharCode(charCode); + i7++; + } else if ((charCode & 192) === 192) { + var value2 = charCode & 63; + i7++; + var nextCode = codes2[i7]; + while ((nextCode & 192) === 128) { + value2 = value2 << 6 | nextCode & 63; + i7++; + nextCode = codes2[i7]; + } + output += String.fromCharCode(value2); + } else { + output += String.fromCharCode(charCode); + i7++; + } + } + return output; + } + function base64encode(host, input) { + if (host && host.base64encode) { + return host.base64encode(input); + } + return convertToBase64(input); + } + ts2.base64encode = base64encode; + function base64decode(host, input) { + if (host && host.base64decode) { + return host.base64decode(input); + } + var length = input.length; + var expandedCharCodes = []; + var i7 = 0; + while (i7 < length) { + if (input.charCodeAt(i7) === base64Digits.charCodeAt(64)) { + break; + } + var ch1 = base64Digits.indexOf(input[i7]); + var ch2 = base64Digits.indexOf(input[i7 + 1]); + var ch3 = base64Digits.indexOf(input[i7 + 2]); + var ch4 = base64Digits.indexOf(input[i7 + 3]); + var code1 = (ch1 & 63) << 2 | ch2 >> 4 & 3; + var code2 = (ch2 & 15) << 4 | ch3 >> 2 & 15; + var code3 = (ch3 & 3) << 6 | ch4 & 63; + if (code2 === 0 && ch3 !== 0) { + expandedCharCodes.push(code1); + } else if (code3 === 0 && ch4 !== 0) { + expandedCharCodes.push(code1, code2); + } else { + expandedCharCodes.push(code1, code2, code3); + } + i7 += 4; + } + return getStringFromExpandedCharCodes(expandedCharCodes); + } + ts2.base64decode = base64decode; + function readJsonOrUndefined(path2, hostOrText) { + var jsonText = ts2.isString(hostOrText) ? hostOrText : hostOrText.readFile(path2); + if (!jsonText) + return void 0; + var result2 = ts2.parseConfigFileTextToJson(path2, jsonText); + return !result2.error ? result2.config : void 0; + } + ts2.readJsonOrUndefined = readJsonOrUndefined; + function readJson(path2, host) { + return readJsonOrUndefined(path2, host) || {}; + } + ts2.readJson = readJson; + function directoryProbablyExists(directoryName, host) { + return !host.directoryExists || host.directoryExists(directoryName); + } + ts2.directoryProbablyExists = directoryProbablyExists; + var carriageReturnLineFeed = "\r\n"; + var lineFeed = "\n"; + function getNewLineCharacter(options, getNewLine) { + switch (options.newLine) { + case 0: + return carriageReturnLineFeed; + case 1: + return lineFeed; + } + return getNewLine ? getNewLine() : ts2.sys ? ts2.sys.newLine : carriageReturnLineFeed; + } + ts2.getNewLineCharacter = getNewLineCharacter; + function createRange2(pos, end) { + if (end === void 0) { + end = pos; + } + ts2.Debug.assert(end >= pos || end === -1); + return { pos, end }; + } + ts2.createRange = createRange2; + function moveRangeEnd(range2, end) { + return createRange2(range2.pos, end); + } + ts2.moveRangeEnd = moveRangeEnd; + function moveRangePos(range2, pos) { + return createRange2(pos, range2.end); + } + ts2.moveRangePos = moveRangePos; + function moveRangePastDecorators(node) { + var lastDecorator = ts2.canHaveModifiers(node) ? ts2.findLast(node.modifiers, ts2.isDecorator) : void 0; + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; + } + ts2.moveRangePastDecorators = moveRangePastDecorators; + function moveRangePastModifiers(node) { + var lastModifier = ts2.canHaveModifiers(node) ? ts2.lastOrUndefined(node.modifiers) : void 0; + return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); + } + ts2.moveRangePastModifiers = moveRangePastModifiers; + function isCollapsedRange(range2) { + return range2.pos === range2.end; + } + ts2.isCollapsedRange = isCollapsedRange; + function createTokenRange(pos, token) { + return createRange2(pos, pos + ts2.tokenToString(token).length); + } + ts2.createTokenRange = createTokenRange; + function rangeIsOnSingleLine(range2, sourceFile) { + return rangeStartIsOnSameLineAsRangeEnd(range2, range2, sourceFile); + } + ts2.rangeIsOnSingleLine = rangeIsOnSingleLine; + function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), sourceFile); + } + ts2.rangeStartPositionsAreOnSameLine = rangeStartPositionsAreOnSameLine; + function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, range2.end, sourceFile); + } + ts2.rangeEndPositionsAreOnSameLine = rangeEndPositionsAreOnSameLine; + function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), range2.end, sourceFile); + } + ts2.rangeStartIsOnSameLineAsRangeEnd = rangeStartIsOnSameLineAsRangeEnd; + function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), sourceFile); + } + ts2.rangeEndIsOnSameLineAsRangeStart = rangeEndIsOnSameLineAsRangeStart; + function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { + var range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); + return ts2.getLinesBetweenPositions(sourceFile, range1.end, range2Start); + } + ts2.getLinesBetweenRangeEndAndRangeStart = getLinesBetweenRangeEndAndRangeStart; + function getLinesBetweenRangeEndPositions(range1, range2, sourceFile) { + return ts2.getLinesBetweenPositions(sourceFile, range1.end, range2.end); + } + ts2.getLinesBetweenRangeEndPositions = getLinesBetweenRangeEndPositions; + function isNodeArrayMultiLine(list, sourceFile) { + return !positionsAreOnSameLine(list.pos, list.end, sourceFile); + } + ts2.isNodeArrayMultiLine = isNodeArrayMultiLine; + function positionsAreOnSameLine(pos1, pos2, sourceFile) { + return ts2.getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; + } + ts2.positionsAreOnSameLine = positionsAreOnSameLine; + function getStartPositionOfRange(range2, sourceFile, includeComments) { + return positionIsSynthesized(range2.pos) ? -1 : ts2.skipTrivia( + sourceFile.text, + range2.pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + } + ts2.getStartPositionOfRange = getStartPositionOfRange; + function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + var startPos = ts2.skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + var prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); + return ts2.getLinesBetweenPositions(sourceFile, prevPos !== null && prevPos !== void 0 ? prevPos : stopPos, startPos); + } + ts2.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter = getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter; + function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + var nextPos = ts2.skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + return ts2.getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); + } + ts2.getLinesBetweenPositionAndNextNonWhitespaceCharacter = getLinesBetweenPositionAndNextNonWhitespaceCharacter; + function getPreviousNonWhitespacePosition(pos, stopPos, sourceFile) { + if (stopPos === void 0) { + stopPos = 0; + } + while (pos-- > stopPos) { + if (!ts2.isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { + return pos; + } + } + } + function isDeclarationNameOfEnumOrNamespace(node) { + var parseNode = ts2.getParseTreeNode(node); + if (parseNode) { + switch (parseNode.parent.kind) { + case 263: + case 264: + return parseNode === parseNode.parent.name; + } + } + return false; + } + ts2.isDeclarationNameOfEnumOrNamespace = isDeclarationNameOfEnumOrNamespace; + function getInitializedVariables(node) { + return ts2.filter(node.declarations, isInitializedVariable); + } + ts2.getInitializedVariables = getInitializedVariables; + function isInitializedVariable(node) { + return node.initializer !== void 0; + } + function isWatchSet(options) { + return options.watch && ts2.hasProperty(options, "watch"); + } + ts2.isWatchSet = isWatchSet; + function closeFileWatcher(watcher) { + watcher.close(); + } + ts2.closeFileWatcher = closeFileWatcher; + function getCheckFlags(symbol) { + return symbol.flags & 33554432 ? symbol.checkFlags : 0; + } + ts2.getCheckFlags = getCheckFlags; + function getDeclarationModifierFlagsFromSymbol(s7, isWrite) { + if (isWrite === void 0) { + isWrite = false; + } + if (s7.valueDeclaration) { + var declaration = isWrite && s7.declarations && ts2.find(s7.declarations, ts2.isSetAccessorDeclaration) || s7.flags & 32768 && ts2.find(s7.declarations, ts2.isGetAccessorDeclaration) || s7.valueDeclaration; + var flags = ts2.getCombinedModifierFlags(declaration); + return s7.parent && s7.parent.flags & 32 ? flags : flags & ~28; + } + if (getCheckFlags(s7) & 6) { + var checkFlags = s7.checkFlags; + var accessModifier = checkFlags & 1024 ? 8 : checkFlags & 256 ? 4 : 16; + var staticModifier = checkFlags & 2048 ? 32 : 0; + return accessModifier | staticModifier; + } + if (s7.flags & 4194304) { + return 4 | 32; + } + return 0; + } + ts2.getDeclarationModifierFlagsFromSymbol = getDeclarationModifierFlagsFromSymbol; + function skipAlias(symbol, checker) { + return symbol.flags & 2097152 ? checker.getAliasedSymbol(symbol) : symbol; + } + ts2.skipAlias = skipAlias; + function getCombinedLocalAndExportSymbolFlags(symbol) { + return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; + } + ts2.getCombinedLocalAndExportSymbolFlags = getCombinedLocalAndExportSymbolFlags; + function isWriteOnlyAccess(node) { + return accessKind(node) === 1; + } + ts2.isWriteOnlyAccess = isWriteOnlyAccess; + function isWriteAccess(node) { + return accessKind(node) !== 0; + } + ts2.isWriteAccess = isWriteAccess; + var AccessKind; + (function(AccessKind2) { + AccessKind2[AccessKind2["Read"] = 0] = "Read"; + AccessKind2[AccessKind2["Write"] = 1] = "Write"; + AccessKind2[AccessKind2["ReadWrite"] = 2] = "ReadWrite"; + })(AccessKind || (AccessKind = {})); + function accessKind(node) { + var parent2 = node.parent; + if (!parent2) + return 0; + switch (parent2.kind) { + case 214: + return accessKind(parent2); + case 222: + case 221: + var operator = parent2.operator; + return operator === 45 || operator === 46 ? writeOrReadWrite() : 0; + case 223: + var _a2 = parent2, left = _a2.left, operatorToken = _a2.operatorToken; + return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 ? 1 : writeOrReadWrite() : 0; + case 208: + return parent2.name !== node ? 0 : accessKind(parent2); + case 299: { + var parentAccess = accessKind(parent2.parent); + return node === parent2.name ? reverseAccessKind(parentAccess) : parentAccess; + } + case 300: + return node === parent2.objectAssignmentInitializer ? 0 : accessKind(parent2.parent); + case 206: + return accessKind(parent2); + default: + return 0; + } + function writeOrReadWrite() { + return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 241 ? 1 : 2; + } + } + function reverseAccessKind(a7) { + switch (a7) { + case 0: + return 1; + case 1: + return 0; + case 2: + return 2; + default: + return ts2.Debug.assertNever(a7); + } + } + function compareDataObjects(dst, src) { + if (!dst || !src || Object.keys(dst).length !== Object.keys(src).length) { + return false; + } + for (var e10 in dst) { + if (typeof dst[e10] === "object") { + if (!compareDataObjects(dst[e10], src[e10])) { + return false; + } + } else if (typeof dst[e10] !== "function") { + if (dst[e10] !== src[e10]) { + return false; + } + } + } + return true; + } + ts2.compareDataObjects = compareDataObjects; + function clearMap(map4, onDeleteValue) { + map4.forEach(onDeleteValue); + map4.clear(); + } + ts2.clearMap = clearMap; + function mutateMapSkippingNewValues(map4, newMap, options) { + var onDeleteValue = options.onDeleteValue, onExistingValue = options.onExistingValue; + map4.forEach(function(existingValue, key) { + var valueInNewMap = newMap.get(key); + if (valueInNewMap === void 0) { + map4.delete(key); + onDeleteValue(existingValue, key); + } else if (onExistingValue) { + onExistingValue(existingValue, valueInNewMap, key); + } + }); + } + ts2.mutateMapSkippingNewValues = mutateMapSkippingNewValues; + function mutateMap(map4, newMap, options) { + mutateMapSkippingNewValues(map4, newMap, options); + var createNewValue = options.createNewValue; + newMap.forEach(function(valueInNewMap, key) { + if (!map4.has(key)) { + map4.set(key, createNewValue(key, valueInNewMap)); + } + }); + } + ts2.mutateMap = mutateMap; + function isAbstractConstructorSymbol(symbol) { + if (symbol.flags & 32) { + var declaration = getClassLikeDeclarationOfSymbol(symbol); + return !!declaration && hasSyntacticModifier( + declaration, + 256 + /* ModifierFlags.Abstract */ + ); + } + return false; + } + ts2.isAbstractConstructorSymbol = isAbstractConstructorSymbol; + function getClassLikeDeclarationOfSymbol(symbol) { + var _a2; + return (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isClassLike); + } + ts2.getClassLikeDeclarationOfSymbol = getClassLikeDeclarationOfSymbol; + function getObjectFlags(type3) { + return type3.flags & 3899393 ? type3.objectFlags : 0; + } + ts2.getObjectFlags = getObjectFlags; + function typeHasCallOrConstructSignatures(type3, checker) { + return checker.getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ).length !== 0 || checker.getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ).length !== 0; + } + ts2.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!ts2.forEachAncestorDirectory(directory, function(d7) { + return callback(d7) ? true : void 0; + }); + } + ts2.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && ts2.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts2.isUMDExportSymbol = isUMDExportSymbol; + function showModuleSpecifier(_a2) { + var moduleSpecifier = _a2.moduleSpecifier; + return ts2.isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier); + } + ts2.showModuleSpecifier = showModuleSpecifier; + function getLastChild(node) { + var lastChild; + ts2.forEachChild(node, function(child) { + if (nodeIsPresent(child)) + lastChild = child; + }, function(children) { + for (var i7 = children.length - 1; i7 >= 0; i7--) { + if (nodeIsPresent(children[i7])) { + lastChild = children[i7]; + break; + } + } + }); + return lastChild; + } + ts2.getLastChild = getLastChild; + function addToSeen(seen, key, value2) { + if (value2 === void 0) { + value2 = true; + } + if (seen.has(key)) { + return false; + } + seen.set(key, value2); + return true; + } + ts2.addToSeen = addToSeen; + function isObjectTypeDeclaration(node) { + return ts2.isClassLike(node) || ts2.isInterfaceDeclaration(node) || ts2.isTypeLiteralNode(node); + } + ts2.isObjectTypeDeclaration = isObjectTypeDeclaration; + function isTypeNodeKind(kind) { + return kind >= 179 && kind <= 202 || kind === 131 || kind === 157 || kind === 148 || kind === 160 || kind === 149 || kind === 134 || kind === 152 || kind === 153 || kind === 114 || kind === 155 || kind === 144 || kind === 230 || kind === 315 || kind === 316 || kind === 317 || kind === 318 || kind === 319 || kind === 320 || kind === 321; + } + ts2.isTypeNodeKind = isTypeNodeKind; + function isAccessExpression(node) { + return node.kind === 208 || node.kind === 209; + } + ts2.isAccessExpression = isAccessExpression; + function getNameOfAccessExpression(node) { + if (node.kind === 208) { + return node.name; + } + ts2.Debug.assert( + node.kind === 209 + /* SyntaxKind.ElementAccessExpression */ + ); + return node.argumentExpression; + } + ts2.getNameOfAccessExpression = getNameOfAccessExpression; + function isBundleFileTextLike(section) { + switch (section.kind) { + case "text": + case "internal": + return true; + default: + return false; + } + } + ts2.isBundleFileTextLike = isBundleFileTextLike; + function isNamedImportsOrExports(node) { + return node.kind === 272 || node.kind === 276; + } + ts2.isNamedImportsOrExports = isNamedImportsOrExports; + function getLeftmostAccessExpression(expr) { + while (isAccessExpression(expr)) { + expr = expr.expression; + } + return expr; + } + ts2.getLeftmostAccessExpression = getLeftmostAccessExpression; + function forEachNameInAccessChainWalkingLeft(name2, action) { + if (isAccessExpression(name2.parent) && isRightSideOfAccessExpression(name2)) { + return walkAccessExpression(name2.parent); + } + function walkAccessExpression(access2) { + if (access2.kind === 208) { + var res = action(access2.name); + if (res !== void 0) { + return res; + } + } else if (access2.kind === 209) { + if (ts2.isIdentifier(access2.argumentExpression) || ts2.isStringLiteralLike(access2.argumentExpression)) { + var res = action(access2.argumentExpression); + if (res !== void 0) { + return res; + } + } else { + return void 0; + } + } + if (isAccessExpression(access2.expression)) { + return walkAccessExpression(access2.expression); + } + if (ts2.isIdentifier(access2.expression)) { + return action(access2.expression); + } + return void 0; + } + } + ts2.forEachNameInAccessChainWalkingLeft = forEachNameInAccessChainWalkingLeft; + function getLeftmostExpression(node, stopAtCallExpressions) { + while (true) { + switch (node.kind) { + case 222: + node = node.operand; + continue; + case 223: + node = node.left; + continue; + case 224: + node = node.condition; + continue; + case 212: + node = node.tag; + continue; + case 210: + if (stopAtCallExpressions) { + return node; + } + case 231: + case 209: + case 208: + case 232: + case 353: + case 235: + node = node.expression; + continue; + } + return node; + } + } + ts2.getLeftmostExpression = getLeftmostExpression; + function Symbol3(flags, name2) { + this.flags = flags; + this.escapedName = name2; + this.declarations = void 0; + this.valueDeclaration = void 0; + this.id = void 0; + this.mergeId = void 0; + this.parent = void 0; + } + function Type3(checker, flags) { + this.flags = flags; + if (ts2.Debug.isDebugging || ts2.tracing) { + this.checker = checker; + } + } + function Signature(checker, flags) { + this.flags = flags; + if (ts2.Debug.isDebugging) { + this.checker = checker; + } + } + function Node(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + this.original = void 0; + } + function Token(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.transformFlags = 0; + this.parent = void 0; + } + function Identifier(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.transformFlags = 0; + this.parent = void 0; + this.original = void 0; + this.flowNode = void 0; + } + function SourceMapSource(fileName, text, skipTrivia) { + this.fileName = fileName; + this.text = text; + this.skipTrivia = skipTrivia || function(pos) { + return pos; + }; + } + ts2.objectAllocator = { + getNodeConstructor: function() { + return Node; + }, + getTokenConstructor: function() { + return Token; + }, + getIdentifierConstructor: function() { + return Identifier; + }, + getPrivateIdentifierConstructor: function() { + return Node; + }, + getSourceFileConstructor: function() { + return Node; + }, + getSymbolConstructor: function() { + return Symbol3; + }, + getTypeConstructor: function() { + return Type3; + }, + getSignatureConstructor: function() { + return Signature; + }, + getSourceMapSourceConstructor: function() { + return SourceMapSource; + } + }; + function setObjectAllocator(alloc) { + Object.assign(ts2.objectAllocator, alloc); + } + ts2.setObjectAllocator = setObjectAllocator; + function formatStringFromArgs(text, args, baseIndex) { + if (baseIndex === void 0) { + baseIndex = 0; + } + return text.replace(/{(\d+)}/g, function(_match, index4) { + return "" + ts2.Debug.checkDefined(args[+index4 + baseIndex]); + }); + } + ts2.formatStringFromArgs = formatStringFromArgs; + var localizedDiagnosticMessages; + function setLocalizedDiagnosticMessages(messages) { + localizedDiagnosticMessages = messages; + } + ts2.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages; + function maybeSetLocalizedDiagnosticMessages(getMessages) { + if (!localizedDiagnosticMessages && getMessages) { + localizedDiagnosticMessages = getMessages(); + } + } + ts2.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages; + function getLocaleSpecificMessage(message) { + return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message; + } + ts2.getLocaleSpecificMessage = getLocaleSpecificMessage; + function createDetachedDiagnostic(fileName, start, length, message) { + assertDiagnosticLocation( + /*file*/ + void 0, + start, + length + ); + var text = getLocaleSpecificMessage(message); + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + return { + file: void 0, + start, + length, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + fileName + }; + } + ts2.createDetachedDiagnostic = createDetachedDiagnostic; + function isDiagnosticWithDetachedLocation(diagnostic) { + return diagnostic.file === void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0 && typeof diagnostic.fileName === "string"; + } + function attachFileToDiagnostic(diagnostic, file) { + var fileName = file.fileName || ""; + var length = file.text.length; + ts2.Debug.assertEqual(diagnostic.fileName, fileName); + ts2.Debug.assertLessThanOrEqual(diagnostic.start, length); + ts2.Debug.assertLessThanOrEqual(diagnostic.start + diagnostic.length, length); + var diagnosticWithLocation = { + file, + start: diagnostic.start, + length: diagnostic.length, + messageText: diagnostic.messageText, + category: diagnostic.category, + code: diagnostic.code, + reportsUnnecessary: diagnostic.reportsUnnecessary + }; + if (diagnostic.relatedInformation) { + diagnosticWithLocation.relatedInformation = []; + for (var _i = 0, _a2 = diagnostic.relatedInformation; _i < _a2.length; _i++) { + var related = _a2[_i]; + if (isDiagnosticWithDetachedLocation(related) && related.fileName === fileName) { + ts2.Debug.assertLessThanOrEqual(related.start, length); + ts2.Debug.assertLessThanOrEqual(related.start + related.length, length); + diagnosticWithLocation.relatedInformation.push(attachFileToDiagnostic(related, file)); + } else { + diagnosticWithLocation.relatedInformation.push(related); + } + } + } + return diagnosticWithLocation; + } + function attachFileToDiagnostics(diagnostics, file) { + var diagnosticsWithLocation = []; + for (var _i = 0, diagnostics_1 = diagnostics; _i < diagnostics_1.length; _i++) { + var diagnostic = diagnostics_1[_i]; + diagnosticsWithLocation.push(attachFileToDiagnostic(diagnostic, file)); + } + return diagnosticsWithLocation; + } + ts2.attachFileToDiagnostics = attachFileToDiagnostics; + function createFileDiagnostic(file, start, length, message) { + assertDiagnosticLocation(file, start, length); + var text = getLocaleSpecificMessage(message); + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + return { + file, + start, + length, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + reportsDeprecated: message.reportsDeprecated + }; + } + ts2.createFileDiagnostic = createFileDiagnostic; + function formatMessage(_dummy, message) { + var text = getLocaleSpecificMessage(message); + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + return text; + } + ts2.formatMessage = formatMessage; + function createCompilerDiagnostic(message) { + var text = getLocaleSpecificMessage(message); + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + return { + file: void 0, + start: void 0, + length: void 0, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + reportsDeprecated: message.reportsDeprecated + }; + } + ts2.createCompilerDiagnostic = createCompilerDiagnostic; + function createCompilerDiagnosticFromMessageChain(chain3, relatedInformation) { + return { + file: void 0, + start: void 0, + length: void 0, + code: chain3.code, + category: chain3.category, + messageText: chain3.next ? chain3 : chain3.messageText, + relatedInformation + }; + } + ts2.createCompilerDiagnosticFromMessageChain = createCompilerDiagnosticFromMessageChain; + function chainDiagnosticMessages(details, message) { + var text = getLocaleSpecificMessage(message); + if (arguments.length > 2) { + text = formatStringFromArgs(text, arguments, 2); + } + return { + messageText: text, + category: message.category, + code: message.code, + next: details === void 0 || Array.isArray(details) ? details : [details] + }; + } + ts2.chainDiagnosticMessages = chainDiagnosticMessages; + function concatenateDiagnosticMessageChains(headChain, tailChain) { + var lastChain = headChain; + while (lastChain.next) { + lastChain = lastChain.next[0]; + } + lastChain.next = [tailChain]; + } + ts2.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; + function getDiagnosticFilePath(diagnostic) { + return diagnostic.file ? diagnostic.file.path : void 0; + } + function compareDiagnostics(d1, d22) { + return compareDiagnosticsSkipRelatedInformation(d1, d22) || compareRelatedInformation(d1, d22) || 0; + } + ts2.compareDiagnostics = compareDiagnostics; + function compareDiagnosticsSkipRelatedInformation(d1, d22) { + return ts2.compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d22)) || ts2.compareValues(d1.start, d22.start) || ts2.compareValues(d1.length, d22.length) || ts2.compareValues(d1.code, d22.code) || compareMessageText(d1.messageText, d22.messageText) || 0; + } + ts2.compareDiagnosticsSkipRelatedInformation = compareDiagnosticsSkipRelatedInformation; + function compareRelatedInformation(d1, d22) { + if (!d1.relatedInformation && !d22.relatedInformation) { + return 0; + } + if (d1.relatedInformation && d22.relatedInformation) { + return ts2.compareValues(d1.relatedInformation.length, d22.relatedInformation.length) || ts2.forEach(d1.relatedInformation, function(d1i, index4) { + var d2i = d22.relatedInformation[index4]; + return compareDiagnostics(d1i, d2i); + }) || 0; + } + return d1.relatedInformation ? -1 : 1; + } + function compareMessageText(t1, t22) { + if (typeof t1 === "string" && typeof t22 === "string") { + return ts2.compareStringsCaseSensitive(t1, t22); + } else if (typeof t1 === "string") { + return -1; + } else if (typeof t22 === "string") { + return 1; + } + var res = ts2.compareStringsCaseSensitive(t1.messageText, t22.messageText); + if (res) { + return res; + } + if (!t1.next && !t22.next) { + return 0; + } + if (!t1.next) { + return -1; + } + if (!t22.next) { + return 1; + } + var len = Math.min(t1.next.length, t22.next.length); + for (var i7 = 0; i7 < len; i7++) { + res = compareMessageText(t1.next[i7], t22.next[i7]); + if (res) { + return res; + } + } + if (t1.next.length < t22.next.length) { + return -1; + } else if (t1.next.length > t22.next.length) { + return 1; + } + return 0; + } + function getLanguageVariant(scriptKind) { + return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 || scriptKind === 6 ? 1 : 0; + } + ts2.getLanguageVariant = getLanguageVariant; + function walkTreeForJSXTags(node) { + if (!(node.transformFlags & 2)) + return void 0; + return ts2.isJsxOpeningLikeElement(node) || ts2.isJsxFragment(node) ? node : ts2.forEachChild(node, walkTreeForJSXTags); + } + function isFileModuleFromUsingJSXTag(file) { + return !file.isDeclarationFile ? walkTreeForJSXTags(file) : void 0; + } + function isFileForcedToBeModuleByFormat(file) { + return (file.impliedNodeFormat === ts2.ModuleKind.ESNext || ts2.fileExtensionIsOneOf(file.fileName, [ + ".cjs", + ".cts", + ".mjs", + ".mts" + /* Extension.Mts */ + ])) && !file.isDeclarationFile ? true : void 0; + } + function getSetExternalModuleIndicator(options) { + switch (getEmitModuleDetectionKind(options)) { + case ts2.ModuleDetectionKind.Force: + return function(file) { + file.externalModuleIndicator = ts2.isFileProbablyExternalModule(file) || !file.isDeclarationFile || void 0; + }; + case ts2.ModuleDetectionKind.Legacy: + return function(file) { + file.externalModuleIndicator = ts2.isFileProbablyExternalModule(file); + }; + case ts2.ModuleDetectionKind.Auto: + var checks = [ts2.isFileProbablyExternalModule]; + if (options.jsx === 4 || options.jsx === 5) { + checks.push(isFileModuleFromUsingJSXTag); + } + checks.push(isFileForcedToBeModuleByFormat); + var combined_1 = ts2.or.apply(void 0, checks); + var callback = function(file) { + return void (file.externalModuleIndicator = combined_1(file)); + }; + return callback; + } + } + ts2.getSetExternalModuleIndicator = getSetExternalModuleIndicator; + function getEmitScriptTarget(compilerOptions) { + return compilerOptions.target || compilerOptions.module === ts2.ModuleKind.Node16 && 9 || compilerOptions.module === ts2.ModuleKind.NodeNext && 99 || 0; + } + ts2.getEmitScriptTarget = getEmitScriptTarget; + function getEmitModuleKind(compilerOptions) { + return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 ? ts2.ModuleKind.ES2015 : ts2.ModuleKind.CommonJS; + } + ts2.getEmitModuleKind = getEmitModuleKind; + function getEmitModuleResolutionKind(compilerOptions) { + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === void 0) { + switch (getEmitModuleKind(compilerOptions)) { + case ts2.ModuleKind.CommonJS: + moduleResolution = ts2.ModuleResolutionKind.NodeJs; + break; + case ts2.ModuleKind.Node16: + moduleResolution = ts2.ModuleResolutionKind.Node16; + break; + case ts2.ModuleKind.NodeNext: + moduleResolution = ts2.ModuleResolutionKind.NodeNext; + break; + default: + moduleResolution = ts2.ModuleResolutionKind.Classic; + break; + } + } + return moduleResolution; + } + ts2.getEmitModuleResolutionKind = getEmitModuleResolutionKind; + function getEmitModuleDetectionKind(options) { + return options.moduleDetection || (getEmitModuleKind(options) === ts2.ModuleKind.Node16 || getEmitModuleKind(options) === ts2.ModuleKind.NodeNext ? ts2.ModuleDetectionKind.Force : ts2.ModuleDetectionKind.Auto); + } + ts2.getEmitModuleDetectionKind = getEmitModuleDetectionKind; + function hasJsonModuleEmitEnabled(options) { + switch (getEmitModuleKind(options)) { + case ts2.ModuleKind.CommonJS: + case ts2.ModuleKind.AMD: + case ts2.ModuleKind.ES2015: + case ts2.ModuleKind.ES2020: + case ts2.ModuleKind.ES2022: + case ts2.ModuleKind.ESNext: + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + return true; + default: + return false; + } + } + ts2.hasJsonModuleEmitEnabled = hasJsonModuleEmitEnabled; + function unreachableCodeIsError(options) { + return options.allowUnreachableCode === false; + } + ts2.unreachableCodeIsError = unreachableCodeIsError; + function unusedLabelIsError(options) { + return options.allowUnusedLabels === false; + } + ts2.unusedLabelIsError = unusedLabelIsError; + function getAreDeclarationMapsEnabled(options) { + return !!(getEmitDeclarations(options) && options.declarationMap); + } + ts2.getAreDeclarationMapsEnabled = getAreDeclarationMapsEnabled; + function getESModuleInterop(compilerOptions) { + if (compilerOptions.esModuleInterop !== void 0) { + return compilerOptions.esModuleInterop; + } + switch (getEmitModuleKind(compilerOptions)) { + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + return true; + } + return void 0; + } + ts2.getESModuleInterop = getESModuleInterop; + function getAllowSyntheticDefaultImports(compilerOptions) { + var moduleKind = getEmitModuleKind(compilerOptions); + return compilerOptions.allowSyntheticDefaultImports !== void 0 ? compilerOptions.allowSyntheticDefaultImports : getESModuleInterop(compilerOptions) || moduleKind === ts2.ModuleKind.System; + } + ts2.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; + function getEmitDeclarations(compilerOptions) { + return !!(compilerOptions.declaration || compilerOptions.composite); + } + ts2.getEmitDeclarations = getEmitDeclarations; + function shouldPreserveConstEnums(compilerOptions) { + return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); + } + ts2.shouldPreserveConstEnums = shouldPreserveConstEnums; + function isIncrementalCompilation(options) { + return !!(options.incremental || options.composite); + } + ts2.isIncrementalCompilation = isIncrementalCompilation; + function getStrictOptionValue(compilerOptions, flag) { + return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag]; + } + ts2.getStrictOptionValue = getStrictOptionValue; + function getAllowJSCompilerOption(compilerOptions) { + return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs; + } + ts2.getAllowJSCompilerOption = getAllowJSCompilerOption; + function getUseDefineForClassFields(compilerOptions) { + return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 : compilerOptions.useDefineForClassFields; + } + ts2.getUseDefineForClassFields = getUseDefineForClassFields; + function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, ts2.semanticDiagnosticsOptionDeclarations); + } + ts2.compilerOptionsAffectSemanticDiagnostics = compilerOptionsAffectSemanticDiagnostics; + function compilerOptionsAffectEmit(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, ts2.affectsEmitOptionDeclarations); + } + ts2.compilerOptionsAffectEmit = compilerOptionsAffectEmit; + function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, ts2.affectsDeclarationPathOptionDeclarations); + } + ts2.compilerOptionsAffectDeclarationPath = compilerOptionsAffectDeclarationPath; + function getCompilerOptionValue(options, option) { + return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name]; + } + ts2.getCompilerOptionValue = getCompilerOptionValue; + function getJSXTransformEnabled(options) { + var jsx = options.jsx; + return jsx === 2 || jsx === 4 || jsx === 5; + } + ts2.getJSXTransformEnabled = getJSXTransformEnabled; + function getJSXImplicitImportBase(compilerOptions, file) { + var jsxImportSourcePragmas = file === null || file === void 0 ? void 0 : file.pragmas.get("jsximportsource"); + var jsxImportSourcePragma = ts2.isArray(jsxImportSourcePragmas) ? jsxImportSourcePragmas[jsxImportSourcePragmas.length - 1] : jsxImportSourcePragmas; + return compilerOptions.jsx === 4 || compilerOptions.jsx === 5 || compilerOptions.jsxImportSource || jsxImportSourcePragma ? (jsxImportSourcePragma === null || jsxImportSourcePragma === void 0 ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : void 0; + } + ts2.getJSXImplicitImportBase = getJSXImplicitImportBase; + function getJSXRuntimeImport(base, options) { + return base ? "".concat(base, "/").concat(options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime") : void 0; + } + ts2.getJSXRuntimeImport = getJSXRuntimeImport; + function hasZeroOrOneAsteriskCharacter(str2) { + var seenAsterisk = false; + for (var i7 = 0; i7 < str2.length; i7++) { + if (str2.charCodeAt(i7) === 42) { + if (!seenAsterisk) { + seenAsterisk = true; + } else { + return false; + } + } + } + return true; + } + ts2.hasZeroOrOneAsteriskCharacter = hasZeroOrOneAsteriskCharacter; + function createSymlinkCache(cwd3, getCanonicalFileName) { + var symlinkedDirectories; + var symlinkedDirectoriesByRealpath; + var symlinkedFiles; + var hasProcessedResolutions = false; + return { + getSymlinkedFiles: function() { + return symlinkedFiles; + }, + getSymlinkedDirectories: function() { + return symlinkedDirectories; + }, + getSymlinkedDirectoriesByRealpath: function() { + return symlinkedDirectoriesByRealpath; + }, + setSymlinkedFile: function(path2, real) { + return (symlinkedFiles || (symlinkedFiles = new ts2.Map())).set(path2, real); + }, + setSymlinkedDirectory: function(symlink2, real) { + var symlinkPath = ts2.toPath(symlink2, cwd3, getCanonicalFileName); + if (!containsIgnoredPath(symlinkPath)) { + symlinkPath = ts2.ensureTrailingDirectorySeparator(symlinkPath); + if (real !== false && !(symlinkedDirectories === null || symlinkedDirectories === void 0 ? void 0 : symlinkedDirectories.has(symlinkPath))) { + (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = ts2.createMultiMap())).add(ts2.ensureTrailingDirectorySeparator(real.realPath), symlink2); + } + (symlinkedDirectories || (symlinkedDirectories = new ts2.Map())).set(symlinkPath, real); + } + }, + setSymlinksFromResolutions: function(files, typeReferenceDirectives) { + var _this = this; + var _a2; + ts2.Debug.assert(!hasProcessedResolutions); + hasProcessedResolutions = true; + for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { + var file = files_1[_i]; + (_a2 = file.resolvedModules) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(resolution) { + return processResolution(_this, resolution); + }); + } + typeReferenceDirectives === null || typeReferenceDirectives === void 0 ? void 0 : typeReferenceDirectives.forEach(function(resolution) { + return processResolution(_this, resolution); + }); + }, + hasProcessedResolutions: function() { + return hasProcessedResolutions; + } + }; + function processResolution(cache, resolution) { + if (!resolution || !resolution.originalPath || !resolution.resolvedFileName) + return; + var resolvedFileName = resolution.resolvedFileName, originalPath = resolution.originalPath; + cache.setSymlinkedFile(ts2.toPath(originalPath, cwd3, getCanonicalFileName), resolvedFileName); + var _a2 = guessDirectorySymlink(resolvedFileName, originalPath, cwd3, getCanonicalFileName) || ts2.emptyArray, commonResolved = _a2[0], commonOriginal = _a2[1]; + if (commonResolved && commonOriginal) { + cache.setSymlinkedDirectory(commonOriginal, { real: commonResolved, realPath: ts2.toPath(commonResolved, cwd3, getCanonicalFileName) }); + } + } + } + ts2.createSymlinkCache = createSymlinkCache; + function guessDirectorySymlink(a7, b8, cwd3, getCanonicalFileName) { + var aParts = ts2.getPathComponents(ts2.getNormalizedAbsolutePath(a7, cwd3)); + var bParts = ts2.getPathComponents(ts2.getNormalizedAbsolutePath(b8, cwd3)); + var isDirectory = false; + while (aParts.length >= 2 && bParts.length >= 2 && !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) && !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) && getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) { + aParts.pop(); + bParts.pop(); + isDirectory = true; + } + return isDirectory ? [ts2.getPathFromPathComponents(aParts), ts2.getPathFromPathComponents(bParts)] : void 0; + } + function isNodeModulesOrScopedPackageDirectory(s7, getCanonicalFileName) { + return s7 !== void 0 && (getCanonicalFileName(s7) === "node_modules" || ts2.startsWith(s7, "@")); + } + function stripLeadingDirectorySeparator(s7) { + return ts2.isAnyDirectorySeparator(s7.charCodeAt(0)) ? s7.slice(1) : void 0; + } + function tryRemoveDirectoryPrefix(path2, dirPath, getCanonicalFileName) { + var withoutPrefix = ts2.tryRemovePrefix(path2, dirPath, getCanonicalFileName); + return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix); + } + ts2.tryRemoveDirectoryPrefix = tryRemoveDirectoryPrefix; + var reservedCharacterPattern = /[^\w\s\/]/g; + function regExpEscape(text) { + return text.replace(reservedCharacterPattern, escapeRegExpCharacter); + } + ts2.regExpEscape = regExpEscape; + function escapeRegExpCharacter(match) { + return "\\" + match; + } + var wildcardCharCodes = [ + 42, + 63 + /* CharacterCodes.question */ + ]; + ts2.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + var implicitExcludePathRegexPattern = "(?!(".concat(ts2.commonPackageFolders.join("|"), ")(/|$))"); + var filesMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory separators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"), + replaceWildcardCharacter: function(match) { + return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); + } + }; + var directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"), + replaceWildcardCharacter: function(match) { + return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); + } + }; + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: function(match) { + return replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment); + } + }; + var wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; + function getRegularExpressionForWildcard(specs10, basePath, usage) { + var patterns = getRegularExpressionsForWildcards(specs10, basePath, usage); + if (!patterns || !patterns.length) { + return void 0; + } + var pattern5 = patterns.map(function(pattern6) { + return "(".concat(pattern6, ")"); + }).join("|"); + var terminator = usage === "exclude" ? "($|/)" : "$"; + return "^(".concat(pattern5, ")").concat(terminator); + } + ts2.getRegularExpressionForWildcard = getRegularExpressionForWildcard; + function getRegularExpressionsForWildcards(specs10, basePath, usage) { + if (specs10 === void 0 || specs10.length === 0) { + return void 0; + } + return ts2.flatMap(specs10, function(spec) { + return spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); + }); + } + ts2.getRegularExpressionsForWildcards = getRegularExpressionsForWildcards; + function isImplicitGlob(lastPathComponent) { + return !/[.*?]/.test(lastPathComponent); + } + ts2.isImplicitGlob = isImplicitGlob; + function getPatternFromSpec(spec, basePath, usage) { + var pattern5 = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); + return pattern5 && "^(".concat(pattern5, ")").concat(usage === "exclude" ? "($|/)" : "$"); + } + ts2.getPatternFromSpec = getPatternFromSpec; + function getSubPatternFromSpec(spec, basePath, usage, _a2) { + var singleAsteriskRegexFragment = _a2.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a2.doubleAsteriskRegexFragment, replaceWildcardCharacter2 = _a2.replaceWildcardCharacter; + var subpattern = ""; + var hasWrittenComponent = false; + var components = ts2.getNormalizedPathComponents(spec, basePath); + var lastComponent = ts2.last(components); + if (usage !== "exclude" && lastComponent === "**") { + return void 0; + } + components[0] = ts2.removeTrailingDirectorySeparator(components[0]); + if (isImplicitGlob(lastComponent)) { + components.push("**", "*"); + } + var optionalCount = 0; + for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { + var component = components_1[_i]; + if (component === "**") { + subpattern += doubleAsteriskRegexFragment; + } else { + if (usage === "directories") { + subpattern += "("; + optionalCount++; + } + if (hasWrittenComponent) { + subpattern += ts2.directorySeparator; + } + if (usage !== "exclude") { + var componentPattern = ""; + if (component.charCodeAt(0) === 42) { + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + component = component.substr(1); + } else if (component.charCodeAt(0) === 63) { + componentPattern += "[^./]"; + component = component.substr(1); + } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); + } + } + hasWrittenComponent = true; + } + while (optionalCount > 0) { + subpattern += ")?"; + optionalCount--; + } + return subpattern; + } + function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { + return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; + } + function getFileMatcherPatterns(path2, excludes, includes2, useCaseSensitiveFileNames, currentDirectory) { + path2 = ts2.normalizePath(path2); + currentDirectory = ts2.normalizePath(currentDirectory); + var absolutePath = ts2.combinePaths(currentDirectory, path2); + return { + includeFilePatterns: ts2.map(getRegularExpressionsForWildcards(includes2, absolutePath, "files"), function(pattern5) { + return "^".concat(pattern5, "$"); + }), + includeFilePattern: getRegularExpressionForWildcard(includes2, absolutePath, "files"), + includeDirectoryPattern: getRegularExpressionForWildcard(includes2, absolutePath, "directories"), + excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), + basePaths: getBasePaths(path2, includes2, useCaseSensitiveFileNames) + }; + } + ts2.getFileMatcherPatterns = getFileMatcherPatterns; + function getRegexFromPattern(pattern5, useCaseSensitiveFileNames) { + return new RegExp(pattern5, useCaseSensitiveFileNames ? "" : "i"); + } + ts2.getRegexFromPattern = getRegexFromPattern; + function matchFiles(path2, extensions6, excludes, includes2, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath2) { + path2 = ts2.normalizePath(path2); + currentDirectory = ts2.normalizePath(currentDirectory); + var patterns = getFileMatcherPatterns(path2, excludes, includes2, useCaseSensitiveFileNames, currentDirectory); + var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function(pattern5) { + return getRegexFromPattern(pattern5, useCaseSensitiveFileNames); + }); + var includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames); + var excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames); + var results = includeFileRegexes ? includeFileRegexes.map(function() { + return []; + }) : [[]]; + var visited = new ts2.Map(); + var toCanonical = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + for (var _i = 0, _a2 = patterns.basePaths; _i < _a2.length; _i++) { + var basePath = _a2[_i]; + visitDirectory(basePath, ts2.combinePaths(currentDirectory, basePath), depth); + } + return ts2.flatten(results); + function visitDirectory(path3, absolutePath, depth2) { + var canonicalPath = toCanonical(realpath2(absolutePath)); + if (visited.has(canonicalPath)) + return; + visited.set(canonicalPath, true); + var _a3 = getFileSystemEntries(path3), files = _a3.files, directories = _a3.directories; + var _loop_1 = function(current2) { + var name3 = ts2.combinePaths(path3, current2); + var absoluteName2 = ts2.combinePaths(absolutePath, current2); + if (extensions6 && !ts2.fileExtensionIsOneOf(name3, extensions6)) + return "continue"; + if (excludeRegex && excludeRegex.test(absoluteName2)) + return "continue"; + if (!includeFileRegexes) { + results[0].push(name3); + } else { + var includeIndex = ts2.findIndex(includeFileRegexes, function(re4) { + return re4.test(absoluteName2); + }); + if (includeIndex !== -1) { + results[includeIndex].push(name3); + } + } + }; + for (var _i2 = 0, _b = ts2.sort(files, ts2.compareStringsCaseSensitive); _i2 < _b.length; _i2++) { + var current = _b[_i2]; + _loop_1(current); + } + if (depth2 !== void 0) { + depth2--; + if (depth2 === 0) { + return; + } + } + for (var _c = 0, _d = ts2.sort(directories, ts2.compareStringsCaseSensitive); _c < _d.length; _c++) { + var current = _d[_c]; + var name2 = ts2.combinePaths(path3, current); + var absoluteName = ts2.combinePaths(absolutePath, current); + if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { + visitDirectory(name2, absoluteName, depth2); + } + } + } + } + ts2.matchFiles = matchFiles; + function getBasePaths(path2, includes2, useCaseSensitiveFileNames) { + var basePaths = [path2]; + if (includes2) { + var includeBasePaths = []; + for (var _i = 0, includes_1 = includes2; _i < includes_1.length; _i++) { + var include = includes_1[_i]; + var absolute = ts2.isRootedDiskPath(include) ? include : ts2.normalizePath(ts2.combinePaths(path2, include)); + includeBasePaths.push(getIncludeBasePath(absolute)); + } + includeBasePaths.sort(ts2.getStringComparer(!useCaseSensitiveFileNames)); + var _loop_2 = function(includeBasePath2) { + if (ts2.every(basePaths, function(basePath) { + return !ts2.containsPath(basePath, includeBasePath2, path2, !useCaseSensitiveFileNames); + })) { + basePaths.push(includeBasePath2); + } + }; + for (var _a2 = 0, includeBasePaths_1 = includeBasePaths; _a2 < includeBasePaths_1.length; _a2++) { + var includeBasePath = includeBasePaths_1[_a2]; + _loop_2(includeBasePath); + } + } + return basePaths; + } + function getIncludeBasePath(absolute) { + var wildcardOffset = ts2.indexOfAnyCharCode(absolute, wildcardCharCodes); + if (wildcardOffset < 0) { + return !ts2.hasExtension(absolute) ? absolute : ts2.removeTrailingDirectorySeparator(ts2.getDirectoryPath(absolute)); + } + return absolute.substring(0, absolute.lastIndexOf(ts2.directorySeparator, wildcardOffset)); + } + function ensureScriptKind(fileName, scriptKind) { + return scriptKind || getScriptKindFromFileName(fileName) || 3; + } + ts2.ensureScriptKind = ensureScriptKind; + function getScriptKindFromFileName(fileName) { + var ext = fileName.substr(fileName.lastIndexOf(".")); + switch (ext.toLowerCase()) { + case ".js": + case ".cjs": + case ".mjs": + return 1; + case ".jsx": + return 2; + case ".ts": + case ".cts": + case ".mts": + return 3; + case ".tsx": + return 4; + case ".json": + return 6; + default: + return 0; + } + } + ts2.getScriptKindFromFileName = getScriptKindFromFileName; + ts2.supportedTSExtensions = [[ + ".ts", + ".tsx", + ".d.ts" + /* Extension.Dts */ + ], [ + ".cts", + ".d.cts" + /* Extension.Dcts */ + ], [ + ".mts", + ".d.mts" + /* Extension.Dmts */ + ]]; + ts2.supportedTSExtensionsFlat = ts2.flatten(ts2.supportedTSExtensions); + var supportedTSExtensionsWithJson = __spreadArray9(__spreadArray9([], ts2.supportedTSExtensions, true), [[ + ".json" + /* Extension.Json */ + ]], false); + var supportedTSExtensionsForExtractExtension = [ + ".d.ts", + ".d.cts", + ".d.mts", + ".cts", + ".mts", + ".ts", + ".tsx", + ".cts", + ".mts" + /* Extension.Mts */ + ]; + ts2.supportedJSExtensions = [[ + ".js", + ".jsx" + /* Extension.Jsx */ + ], [ + ".mjs" + /* Extension.Mjs */ + ], [ + ".cjs" + /* Extension.Cjs */ + ]]; + ts2.supportedJSExtensionsFlat = ts2.flatten(ts2.supportedJSExtensions); + var allSupportedExtensions = [[ + ".ts", + ".tsx", + ".d.ts", + ".js", + ".jsx" + /* Extension.Jsx */ + ], [ + ".cts", + ".d.cts", + ".cjs" + /* Extension.Cjs */ + ], [ + ".mts", + ".d.mts", + ".mjs" + /* Extension.Mjs */ + ]]; + var allSupportedExtensionsWithJson = __spreadArray9(__spreadArray9([], allSupportedExtensions, true), [[ + ".json" + /* Extension.Json */ + ]], false); + ts2.supportedDeclarationExtensions = [ + ".d.ts", + ".d.cts", + ".d.mts" + /* Extension.Dmts */ + ]; + function getSupportedExtensions(options, extraFileExtensions) { + var needJsExtensions = options && getAllowJSCompilerOption(options); + if (!extraFileExtensions || extraFileExtensions.length === 0) { + return needJsExtensions ? allSupportedExtensions : ts2.supportedTSExtensions; + } + var builtins = needJsExtensions ? allSupportedExtensions : ts2.supportedTSExtensions; + var flatBuiltins = ts2.flatten(builtins); + var extensions6 = __spreadArray9(__spreadArray9([], builtins, true), ts2.mapDefined(extraFileExtensions, function(x7) { + return x7.scriptKind === 7 || needJsExtensions && isJSLike(x7.scriptKind) && flatBuiltins.indexOf(x7.extension) === -1 ? [x7.extension] : void 0; + }), true); + return extensions6; + } + ts2.getSupportedExtensions = getSupportedExtensions; + function getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) { + if (!options || !options.resolveJsonModule) + return supportedExtensions; + if (supportedExtensions === allSupportedExtensions) + return allSupportedExtensionsWithJson; + if (supportedExtensions === ts2.supportedTSExtensions) + return supportedTSExtensionsWithJson; + return __spreadArray9(__spreadArray9([], supportedExtensions, true), [[ + ".json" + /* Extension.Json */ + ]], false); + } + ts2.getSupportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule; + function isJSLike(scriptKind) { + return scriptKind === 1 || scriptKind === 2; + } + function hasJSFileExtension(fileName) { + return ts2.some(ts2.supportedJSExtensionsFlat, function(extension) { + return ts2.fileExtensionIs(fileName, extension); + }); + } + ts2.hasJSFileExtension = hasJSFileExtension; + function hasTSFileExtension(fileName) { + return ts2.some(ts2.supportedTSExtensionsFlat, function(extension) { + return ts2.fileExtensionIs(fileName, extension); + }); + } + ts2.hasTSFileExtension = hasTSFileExtension; + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { + if (!fileName) + return false; + var supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions); + for (var _i = 0, _a2 = ts2.flatten(getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions)); _i < _a2.length; _i++) { + var extension = _a2[_i]; + if (ts2.fileExtensionIs(fileName, extension)) { + return true; + } + } + return false; + } + ts2.isSupportedSourceFileName = isSupportedSourceFileName; + function numberOfDirectorySeparators(str2) { + var match = str2.match(/\//g); + return match ? match.length : 0; + } + function compareNumberOfDirectorySeparators(path1, path2) { + return ts2.compareValues(numberOfDirectorySeparators(path1), numberOfDirectorySeparators(path2)); + } + ts2.compareNumberOfDirectorySeparators = compareNumberOfDirectorySeparators; + var extensionsToRemove = [ + ".d.ts", + ".d.mts", + ".d.cts", + ".mjs", + ".mts", + ".cjs", + ".cts", + ".ts", + ".js", + ".tsx", + ".jsx", + ".json" + /* Extension.Json */ + ]; + function removeFileExtension(path2) { + for (var _i = 0, extensionsToRemove_1 = extensionsToRemove; _i < extensionsToRemove_1.length; _i++) { + var ext = extensionsToRemove_1[_i]; + var extensionless = tryRemoveExtension(path2, ext); + if (extensionless !== void 0) { + return extensionless; + } + } + return path2; + } + ts2.removeFileExtension = removeFileExtension; + function tryRemoveExtension(path2, extension) { + return ts2.fileExtensionIs(path2, extension) ? removeExtension(path2, extension) : void 0; + } + ts2.tryRemoveExtension = tryRemoveExtension; + function removeExtension(path2, extension) { + return path2.substring(0, path2.length - extension.length); + } + ts2.removeExtension = removeExtension; + function changeExtension(path2, newExtension) { + return ts2.changeAnyExtension( + path2, + newExtension, + extensionsToRemove, + /*ignoreCase*/ + false + ); + } + ts2.changeExtension = changeExtension; + function tryParsePattern(pattern5) { + var indexOfStar = pattern5.indexOf("*"); + if (indexOfStar === -1) { + return pattern5; + } + return pattern5.indexOf("*", indexOfStar + 1) !== -1 ? void 0 : { + prefix: pattern5.substr(0, indexOfStar), + suffix: pattern5.substr(indexOfStar + 1) + }; + } + ts2.tryParsePattern = tryParsePattern; + function tryParsePatterns(paths) { + return ts2.mapDefined(ts2.getOwnKeys(paths), function(path2) { + return tryParsePattern(path2); + }); + } + ts2.tryParsePatterns = tryParsePatterns; + function positionIsSynthesized(pos) { + return !(pos >= 0); + } + ts2.positionIsSynthesized = positionIsSynthesized; + function extensionIsTS(ext) { + return ext === ".ts" || ext === ".tsx" || ext === ".d.ts" || ext === ".cts" || ext === ".mts" || ext === ".d.mts" || ext === ".d.cts"; + } + ts2.extensionIsTS = extensionIsTS; + function resolutionExtensionIsTSOrJson(ext) { + return extensionIsTS(ext) || ext === ".json"; + } + ts2.resolutionExtensionIsTSOrJson = resolutionExtensionIsTSOrJson; + function extensionFromPath(path2) { + var ext = tryGetExtensionFromPath(path2); + return ext !== void 0 ? ext : ts2.Debug.fail("File ".concat(path2, " has unknown extension.")); + } + ts2.extensionFromPath = extensionFromPath; + function isAnySupportedFileExtension(path2) { + return tryGetExtensionFromPath(path2) !== void 0; + } + ts2.isAnySupportedFileExtension = isAnySupportedFileExtension; + function tryGetExtensionFromPath(path2) { + return ts2.find(extensionsToRemove, function(e10) { + return ts2.fileExtensionIs(path2, e10); + }); + } + ts2.tryGetExtensionFromPath = tryGetExtensionFromPath; + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + ts2.isCheckJsEnabledForFile = isCheckJsEnabledForFile; + ts2.emptyFileSystemEntries = { + files: ts2.emptyArray, + directories: ts2.emptyArray + }; + function matchPatternOrExact(patternOrStrings, candidate) { + var patterns = []; + for (var _i = 0, patternOrStrings_1 = patternOrStrings; _i < patternOrStrings_1.length; _i++) { + var patternOrString = patternOrStrings_1[_i]; + if (patternOrString === candidate) { + return candidate; + } + if (!ts2.isString(patternOrString)) { + patterns.push(patternOrString); + } + } + return ts2.findBestPatternMatch(patterns, function(_6) { + return _6; + }, candidate); + } + ts2.matchPatternOrExact = matchPatternOrExact; + function sliceAfter(arr, value2) { + var index4 = arr.indexOf(value2); + ts2.Debug.assert(index4 !== -1); + return arr.slice(index4); + } + ts2.sliceAfter = sliceAfter; + function addRelatedInfo(diagnostic) { + var _a2; + var relatedInformation = []; + for (var _i = 1; _i < arguments.length; _i++) { + relatedInformation[_i - 1] = arguments[_i]; + } + if (!relatedInformation.length) { + return diagnostic; + } + if (!diagnostic.relatedInformation) { + diagnostic.relatedInformation = []; + } + ts2.Debug.assert(diagnostic.relatedInformation !== ts2.emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); + (_a2 = diagnostic.relatedInformation).push.apply(_a2, relatedInformation); + return diagnostic; + } + ts2.addRelatedInfo = addRelatedInfo; + function minAndMax(arr, getValue2) { + ts2.Debug.assert(arr.length !== 0); + var min2 = getValue2(arr[0]); + var max2 = min2; + for (var i7 = 1; i7 < arr.length; i7++) { + var value2 = getValue2(arr[i7]); + if (value2 < min2) { + min2 = value2; + } else if (value2 > max2) { + max2 = value2; + } + } + return { min: min2, max: max2 }; + } + ts2.minAndMax = minAndMax; + function rangeOfNode(node) { + return { pos: getTokenPosOfNode(node), end: node.end }; + } + ts2.rangeOfNode = rangeOfNode; + function rangeOfTypeParameters(sourceFile, typeParameters) { + var pos = typeParameters.pos - 1; + var end = ts2.skipTrivia(sourceFile.text, typeParameters.end) + 1; + return { pos, end }; + } + ts2.rangeOfTypeParameters = rangeOfTypeParameters; + function skipTypeChecking(sourceFile, options, host) { + return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName); + } + ts2.skipTypeChecking = skipTypeChecking; + function isJsonEqual(a7, b8) { + return a7 === b8 || typeof a7 === "object" && a7 !== null && typeof b8 === "object" && b8 !== null && ts2.equalOwnProperties(a7, b8, isJsonEqual); + } + ts2.isJsonEqual = isJsonEqual; + function parsePseudoBigInt(stringValue) { + var log2Base; + switch (stringValue.charCodeAt(1)) { + case 98: + case 66: + log2Base = 1; + break; + case 111: + case 79: + log2Base = 3; + break; + case 120: + case 88: + log2Base = 4; + break; + default: + var nIndex = stringValue.length - 1; + var nonZeroStart = 0; + while (stringValue.charCodeAt(nonZeroStart) === 48) { + nonZeroStart++; + } + return stringValue.slice(nonZeroStart, nIndex) || "0"; + } + var startIndex = 2, endIndex = stringValue.length - 1; + var bitsNeeded = (endIndex - startIndex) * log2Base; + var segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0)); + for (var i7 = endIndex - 1, bitOffset = 0; i7 >= startIndex; i7--, bitOffset += log2Base) { + var segment = bitOffset >>> 4; + var digitChar = stringValue.charCodeAt(i7); + var digit = digitChar <= 57 ? digitChar - 48 : 10 + digitChar - (digitChar <= 70 ? 65 : 97); + var shiftedDigit = digit << (bitOffset & 15); + segments[segment] |= shiftedDigit; + var residual = shiftedDigit >>> 16; + if (residual) + segments[segment + 1] |= residual; + } + var base10Value = ""; + var firstNonzeroSegment = segments.length - 1; + var segmentsRemaining = true; + while (segmentsRemaining) { + var mod10 = 0; + segmentsRemaining = false; + for (var segment = firstNonzeroSegment; segment >= 0; segment--) { + var newSegment = mod10 << 16 | segments[segment]; + var segmentValue = newSegment / 10 | 0; + segments[segment] = segmentValue; + mod10 = newSegment - segmentValue * 10; + if (segmentValue && !segmentsRemaining) { + firstNonzeroSegment = segment; + segmentsRemaining = true; + } + } + base10Value = mod10 + base10Value; + } + return base10Value; + } + ts2.parsePseudoBigInt = parsePseudoBigInt; + function pseudoBigIntToString(_a2) { + var negative = _a2.negative, base10Value = _a2.base10Value; + return (negative && base10Value !== "0" ? "-" : "") + base10Value; + } + ts2.pseudoBigIntToString = pseudoBigIntToString; + function isValidTypeOnlyAliasUseSite(useSite) { + return !!(useSite.flags & 16777216) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite)); + } + ts2.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite; + function isShorthandPropertyNameUseSite(useSite) { + return ts2.isIdentifier(useSite) && ts2.isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite; + } + function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { + while (node.kind === 79 || node.kind === 208) { + node = node.parent; + } + if (node.kind !== 164) { + return false; + } + if (hasSyntacticModifier( + node.parent, + 256 + /* ModifierFlags.Abstract */ + )) { + return true; + } + var containerKind = node.parent.parent.kind; + return containerKind === 261 || containerKind === 184; + } + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 79) + return false; + var heritageClause = ts2.findAncestor(node.parent, function(parent2) { + switch (parent2.kind) { + case 294: + return true; + case 208: + case 230: + return false; + default: + return "quit"; + } + }); + return (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.token) === 117 || (heritageClause === null || heritageClause === void 0 ? void 0 : heritageClause.parent.kind) === 261; + } + function isIdentifierTypeReference(node) { + return ts2.isTypeReferenceNode(node) && ts2.isIdentifier(node.typeName); + } + ts2.isIdentifierTypeReference = isIdentifierTypeReference; + function arrayIsHomogeneous(array, comparer) { + if (comparer === void 0) { + comparer = ts2.equateValues; + } + if (array.length < 2) + return true; + var first = array[0]; + for (var i7 = 1, length_1 = array.length; i7 < length_1; i7++) { + var target = array[i7]; + if (!comparer(first, target)) + return false; + } + return true; + } + ts2.arrayIsHomogeneous = arrayIsHomogeneous; + function setTextRangePos(range2, pos) { + range2.pos = pos; + return range2; + } + ts2.setTextRangePos = setTextRangePos; + function setTextRangeEnd(range2, end) { + range2.end = end; + return range2; + } + ts2.setTextRangeEnd = setTextRangeEnd; + function setTextRangePosEnd(range2, pos, end) { + return setTextRangeEnd(setTextRangePos(range2, pos), end); + } + ts2.setTextRangePosEnd = setTextRangePosEnd; + function setTextRangePosWidth(range2, pos, width) { + return setTextRangePosEnd(range2, pos, pos + width); + } + ts2.setTextRangePosWidth = setTextRangePosWidth; + function setNodeFlags(node, newFlags) { + if (node) { + node.flags = newFlags; + } + return node; + } + ts2.setNodeFlags = setNodeFlags; + function setParent(child, parent2) { + if (child && parent2) { + child.parent = parent2; + } + return child; + } + ts2.setParent = setParent; + function setEachParent(children, parent2) { + if (children) { + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + setParent(child, parent2); + } + } + return children; + } + ts2.setEachParent = setEachParent; + function setParentRecursive(rootNode, incremental) { + if (!rootNode) + return rootNode; + ts2.forEachChildRecursively(rootNode, ts2.isJSDocNode(rootNode) ? bindParentToChildIgnoringJSDoc : bindParentToChild); + return rootNode; + function bindParentToChildIgnoringJSDoc(child, parent2) { + if (incremental && child.parent === parent2) { + return "skip"; + } + setParent(child, parent2); + } + function bindJSDoc(child) { + if (ts2.hasJSDocNodes(child)) { + for (var _i = 0, _a2 = child.jsDoc; _i < _a2.length; _i++) { + var doc = _a2[_i]; + bindParentToChildIgnoringJSDoc(doc, child); + ts2.forEachChildRecursively(doc, bindParentToChildIgnoringJSDoc); + } + } + } + function bindParentToChild(child, parent2) { + return bindParentToChildIgnoringJSDoc(child, parent2) || bindJSDoc(child); + } + } + ts2.setParentRecursive = setParentRecursive; + function isPackedElement(node) { + return !ts2.isOmittedExpression(node); + } + function isPackedArrayLiteral(node) { + return ts2.isArrayLiteralExpression(node) && ts2.every(node.elements, isPackedElement); + } + ts2.isPackedArrayLiteral = isPackedArrayLiteral; + function expressionResultIsUnused(node) { + ts2.Debug.assertIsDefined(node.parent); + while (true) { + var parent2 = node.parent; + if (ts2.isParenthesizedExpression(parent2)) { + node = parent2; + continue; + } + if (ts2.isExpressionStatement(parent2) || ts2.isVoidExpression(parent2) || ts2.isForStatement(parent2) && (parent2.initializer === node || parent2.incrementor === node)) { + return true; + } + if (ts2.isCommaListExpression(parent2)) { + if (node !== ts2.last(parent2.elements)) + return true; + node = parent2; + continue; + } + if (ts2.isBinaryExpression(parent2) && parent2.operatorToken.kind === 27) { + if (node === parent2.left) + return true; + node = parent2; + continue; + } + return false; + } + } + ts2.expressionResultIsUnused = expressionResultIsUnused; + function containsIgnoredPath(path2) { + return ts2.some(ts2.ignoredPaths, function(p7) { + return ts2.stringContains(path2, p7); + }); + } + ts2.containsIgnoredPath = containsIgnoredPath; + function getContainingNodeArray(node) { + if (!node.parent) + return void 0; + switch (node.kind) { + case 165: + var parent_1 = node.parent; + return parent_1.kind === 192 ? void 0 : parent_1.typeParameters; + case 166: + return node.parent.parameters; + case 201: + return node.parent.templateSpans; + case 236: + return node.parent.templateSpans; + case 167: { + var parent_2 = node.parent; + return ts2.canHaveDecorators(parent_2) ? parent_2.modifiers : ts2.canHaveIllegalDecorators(parent_2) ? parent_2.illegalDecorators : void 0; + } + case 294: + return node.parent.heritageClauses; + } + var parent2 = node.parent; + if (ts2.isJSDocTag(node)) { + return ts2.isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; + } + switch (parent2.kind) { + case 184: + case 261: + return ts2.isTypeElement(node) ? parent2.members : void 0; + case 189: + case 190: + return parent2.types; + case 186: + case 206: + case 354: + case 272: + case 276: + return parent2.elements; + case 207: + case 289: + return parent2.properties; + case 210: + case 211: + return ts2.isTypeNode(node) ? parent2.typeArguments : parent2.expression === node ? void 0 : parent2.arguments; + case 281: + case 285: + return ts2.isJsxChild(node) ? parent2.children : void 0; + case 283: + case 282: + return ts2.isTypeNode(node) ? parent2.typeArguments : void 0; + case 238: + case 292: + case 293: + case 265: + return parent2.statements; + case 266: + return parent2.clauses; + case 260: + case 228: + return ts2.isClassElement(node) ? parent2.members : void 0; + case 263: + return ts2.isEnumMember(node) ? parent2.members : void 0; + case 308: + return parent2.statements; + } + } + ts2.getContainingNodeArray = getContainingNodeArray; + function hasContextSensitiveParameters(node) { + if (!node.typeParameters) { + if (ts2.some(node.parameters, function(p7) { + return !getEffectiveTypeAnnotationNode(p7); + })) { + return true; + } + if (node.kind !== 216) { + var parameter = ts2.firstOrUndefined(node.parameters); + if (!(parameter && parameterIsThisKeyword(parameter))) { + return true; + } + } + } + return false; + } + ts2.hasContextSensitiveParameters = hasContextSensitiveParameters; + function isInfinityOrNaNString(name2) { + return name2 === "Infinity" || name2 === "-Infinity" || name2 === "NaN"; + } + ts2.isInfinityOrNaNString = isInfinityOrNaNString; + function isCatchClauseVariableDeclaration(node) { + return node.kind === 257 && node.parent.kind === 295; + } + ts2.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; + function isParameterOrCatchClauseVariable(symbol) { + var declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration); + return !!declaration && (ts2.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration)); + } + ts2.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable; + function isFunctionExpressionOrArrowFunction(node) { + return node.kind === 215 || node.kind === 216; + } + ts2.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction; + function escapeSnippetText(text) { + return text.replace(/\$/gm, function() { + return "\\$"; + }); + } + ts2.escapeSnippetText = escapeSnippetText; + function isNumericLiteralName(name2) { + return (+name2).toString() === name2; + } + ts2.isNumericLiteralName = isNumericLiteralName; + function createPropertyNameNodeForIdentifierOrLiteral(name2, target, singleQuote2, stringNamed) { + return ts2.isIdentifierText(name2, target) ? ts2.factory.createIdentifier(name2) : !stringNamed && isNumericLiteralName(name2) && +name2 >= 0 ? ts2.factory.createNumericLiteral(+name2) : ts2.factory.createStringLiteral(name2, !!singleQuote2); + } + ts2.createPropertyNameNodeForIdentifierOrLiteral = createPropertyNameNodeForIdentifierOrLiteral; + function isThisTypeParameter(type3) { + return !!(type3.flags & 262144 && type3.isThisType); + } + ts2.isThisTypeParameter = isThisTypeParameter; + function getNodeModulePathParts(fullPath) { + var topLevelNodeModulesIndex = 0; + var topLevelPackageNameIndex = 0; + var packageRootIndex = 0; + var fileNameIndex = 0; + var States; + (function(States2) { + States2[States2["BeforeNodeModules"] = 0] = "BeforeNodeModules"; + States2[States2["NodeModules"] = 1] = "NodeModules"; + States2[States2["Scope"] = 2] = "Scope"; + States2[States2["PackageContent"] = 3] = "PackageContent"; + })(States || (States = {})); + var partStart = 0; + var partEnd = 0; + var state = 0; + while (partEnd >= 0) { + partStart = partEnd; + partEnd = fullPath.indexOf("/", partStart + 1); + switch (state) { + case 0: + if (fullPath.indexOf(ts2.nodeModulesPathPart, partStart) === partStart) { + topLevelNodeModulesIndex = partStart; + topLevelPackageNameIndex = partEnd; + state = 1; + } + break; + case 1: + case 2: + if (state === 1 && fullPath.charAt(partStart + 1) === "@") { + state = 2; + } else { + packageRootIndex = partEnd; + state = 3; + } + break; + case 3: + if (fullPath.indexOf(ts2.nodeModulesPathPart, partStart) === partStart) { + state = 1; + } else { + state = 3; + } + break; + } + } + fileNameIndex = partStart; + return state > 1 ? { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex, fileNameIndex } : void 0; + } + ts2.getNodeModulePathParts = getNodeModulePathParts; + function getParameterTypeNode(parameter) { + var _a2; + return parameter.kind === 343 ? (_a2 = parameter.typeExpression) === null || _a2 === void 0 ? void 0 : _a2.type : parameter.type; + } + ts2.getParameterTypeNode = getParameterTypeNode; + function isTypeDeclaration(node) { + switch (node.kind) { + case 165: + case 260: + case 261: + case 262: + case 263: + case 348: + case 341: + case 342: + return true; + case 270: + return node.isTypeOnly; + case 273: + case 278: + return node.parent.parent.isTypeOnly; + default: + return false; + } + } + ts2.isTypeDeclaration = isTypeDeclaration; + function canHaveExportModifier(node) { + return ts2.isEnumDeclaration(node) || ts2.isVariableStatement(node) || ts2.isFunctionDeclaration(node) || ts2.isClassDeclaration(node) || ts2.isInterfaceDeclaration(node) || isTypeDeclaration(node) || ts2.isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node); + } + ts2.canHaveExportModifier = canHaveExportModifier; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createBaseNodeFactory() { + var NodeConstructor; + var TokenConstructor; + var IdentifierConstructor; + var PrivateIdentifierConstructor; + var SourceFileConstructor; + return { + createBaseSourceFileNode, + createBaseIdentifierNode, + createBasePrivateIdentifierNode, + createBaseTokenNode, + createBaseNode + }; + function createBaseSourceFileNode(kind) { + return new (SourceFileConstructor || (SourceFileConstructor = ts2.objectAllocator.getSourceFileConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseIdentifierNode(kind) { + return new (IdentifierConstructor || (IdentifierConstructor = ts2.objectAllocator.getIdentifierConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBasePrivateIdentifierNode(kind) { + return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts2.objectAllocator.getPrivateIdentifierConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseTokenNode(kind) { + return new (TokenConstructor || (TokenConstructor = ts2.objectAllocator.getTokenConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseNode(kind) { + return new (NodeConstructor || (NodeConstructor = ts2.objectAllocator.getNodeConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + } + ts2.createBaseNodeFactory = createBaseNodeFactory; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createParenthesizerRules(factory) { + var binaryLeftOperandParenthesizerCache; + var binaryRightOperandParenthesizerCache; + return { + getParenthesizeLeftSideOfBinaryForOperator, + getParenthesizeRightSideOfBinaryForOperator, + parenthesizeLeftSideOfBinary, + parenthesizeRightSideOfBinary, + parenthesizeExpressionOfComputedPropertyName, + parenthesizeConditionOfConditionalExpression, + parenthesizeBranchOfConditionalExpression, + parenthesizeExpressionOfExportDefault, + parenthesizeExpressionOfNew, + parenthesizeLeftSideOfAccess, + parenthesizeOperandOfPostfixUnary, + parenthesizeOperandOfPrefixUnary, + parenthesizeExpressionsOfCommaDelimitedList, + parenthesizeExpressionForDisallowedComma, + parenthesizeExpressionOfExpressionStatement, + parenthesizeConciseBodyOfArrowFunction, + parenthesizeCheckTypeOfConditionalType, + parenthesizeExtendsTypeOfConditionalType, + parenthesizeConstituentTypesOfUnionType, + parenthesizeConstituentTypeOfUnionType, + parenthesizeConstituentTypesOfIntersectionType, + parenthesizeConstituentTypeOfIntersectionType, + parenthesizeOperandOfTypeOperator, + parenthesizeOperandOfReadonlyTypeOperator, + parenthesizeNonArrayTypeOfPostfixType, + parenthesizeElementTypesOfTupleType, + parenthesizeElementTypeOfTupleType, + parenthesizeTypeOfOptionalType, + parenthesizeTypeArguments, + parenthesizeLeadingTypeArgument + }; + function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) { + binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = new ts2.Map()); + var parenthesizerRule = binaryLeftOperandParenthesizerCache.get(operatorKind); + if (!parenthesizerRule) { + parenthesizerRule = function(node) { + return parenthesizeLeftSideOfBinary(operatorKind, node); + }; + binaryLeftOperandParenthesizerCache.set(operatorKind, parenthesizerRule); + } + return parenthesizerRule; + } + function getParenthesizeRightSideOfBinaryForOperator(operatorKind) { + binaryRightOperandParenthesizerCache || (binaryRightOperandParenthesizerCache = new ts2.Map()); + var parenthesizerRule = binaryRightOperandParenthesizerCache.get(operatorKind); + if (!parenthesizerRule) { + parenthesizerRule = function(node) { + return parenthesizeRightSideOfBinary( + operatorKind, + /*leftSide*/ + void 0, + node + ); + }; + binaryRightOperandParenthesizerCache.set(operatorKind, parenthesizerRule); + } + return parenthesizerRule; + } + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var binaryOperatorPrecedence = ts2.getOperatorPrecedence(223, binaryOperator); + var binaryOperatorAssociativity = ts2.getOperatorAssociativity(223, binaryOperator); + var emittedOperand = ts2.skipPartiallyEmittedExpressions(operand); + if (!isLeftSideOfBinary && operand.kind === 216 && binaryOperatorPrecedence > 3) { + return true; + } + var operandPrecedence = ts2.getExpressionPrecedence(emittedOperand); + switch (ts2.compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1: + if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 && operand.kind === 226) { + return false; + } + return true; + case 1: + return false; + case 0: + if (isLeftSideOfBinary) { + return binaryOperatorAssociativity === 1; + } else { + if (ts2.isBinaryExpression(emittedOperand) && emittedOperand.operatorToken.kind === binaryOperator) { + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + if (binaryOperator === 39) { + var leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; + if (ts2.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + var operandAssociativity = ts2.getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0; + } + } + } + function operatorHasAssociativeProperty(binaryOperator) { + return binaryOperator === 41 || binaryOperator === 51 || binaryOperator === 50 || binaryOperator === 52 || binaryOperator === 27; + } + function getLiteralKindOfBinaryPlusOperand(node) { + node = ts2.skipPartiallyEmittedExpressions(node); + if (ts2.isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 223 && node.operatorToken.kind === 39) { + if (node.cachedLiteralKind !== void 0) { + return node.cachedLiteralKind; + } + var leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + var literalKind = ts2.isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) ? leftKind : 0; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0; + } + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + var skipped = ts2.skipPartiallyEmittedExpressions(operand); + if (skipped.kind === 214) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory.createParenthesizedExpression(operand) : operand; + } + function parenthesizeLeftSideOfBinary(binaryOperator, leftSide) { + return parenthesizeBinaryOperand( + binaryOperator, + leftSide, + /*isLeftSideOfBinary*/ + true + ); + } + function parenthesizeRightSideOfBinary(binaryOperator, leftSide, rightSide) { + return parenthesizeBinaryOperand( + binaryOperator, + rightSide, + /*isLeftSideOfBinary*/ + false, + leftSide + ); + } + function parenthesizeExpressionOfComputedPropertyName(expression) { + return ts2.isCommaSequence(expression) ? factory.createParenthesizedExpression(expression) : expression; + } + function parenthesizeConditionOfConditionalExpression(condition) { + var conditionalPrecedence = ts2.getOperatorPrecedence( + 224, + 57 + /* SyntaxKind.QuestionToken */ + ); + var emittedCondition = ts2.skipPartiallyEmittedExpressions(condition); + var conditionPrecedence = ts2.getExpressionPrecedence(emittedCondition); + if (ts2.compareValues(conditionPrecedence, conditionalPrecedence) !== 1) { + return factory.createParenthesizedExpression(condition); + } + return condition; + } + function parenthesizeBranchOfConditionalExpression(branch) { + var emittedExpression = ts2.skipPartiallyEmittedExpressions(branch); + return ts2.isCommaSequence(emittedExpression) ? factory.createParenthesizedExpression(branch) : branch; + } + function parenthesizeExpressionOfExportDefault(expression) { + var check = ts2.skipPartiallyEmittedExpressions(expression); + var needsParens = ts2.isCommaSequence(check); + if (!needsParens) { + switch (ts2.getLeftmostExpression( + check, + /*stopAtCallExpression*/ + false + ).kind) { + case 228: + case 215: + needsParens = true; + } + } + return needsParens ? factory.createParenthesizedExpression(expression) : expression; + } + function parenthesizeExpressionOfNew(expression) { + var leftmostExpr = ts2.getLeftmostExpression( + expression, + /*stopAtCallExpressions*/ + true + ); + switch (leftmostExpr.kind) { + case 210: + return factory.createParenthesizedExpression(expression); + case 211: + return !leftmostExpr.arguments ? factory.createParenthesizedExpression(expression) : expression; + } + return parenthesizeLeftSideOfAccess(expression); + } + function parenthesizeLeftSideOfAccess(expression, optionalChain) { + var emittedExpression = ts2.skipPartiallyEmittedExpressions(expression); + if (ts2.isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 211 || emittedExpression.arguments) && (optionalChain || !ts2.isOptionalChain(emittedExpression))) { + return expression; + } + return ts2.setTextRange(factory.createParenthesizedExpression(expression), expression); + } + function parenthesizeOperandOfPostfixUnary(operand) { + return ts2.isLeftHandSideExpression(operand) ? operand : ts2.setTextRange(factory.createParenthesizedExpression(operand), operand); + } + function parenthesizeOperandOfPrefixUnary(operand) { + return ts2.isUnaryExpression(operand) ? operand : ts2.setTextRange(factory.createParenthesizedExpression(operand), operand); + } + function parenthesizeExpressionsOfCommaDelimitedList(elements) { + var result2 = ts2.sameMap(elements, parenthesizeExpressionForDisallowedComma); + return ts2.setTextRange(factory.createNodeArray(result2, elements.hasTrailingComma), elements); + } + function parenthesizeExpressionForDisallowedComma(expression) { + var emittedExpression = ts2.skipPartiallyEmittedExpressions(expression); + var expressionPrecedence = ts2.getExpressionPrecedence(emittedExpression); + var commaPrecedence = ts2.getOperatorPrecedence( + 223, + 27 + /* SyntaxKind.CommaToken */ + ); + return expressionPrecedence > commaPrecedence ? expression : ts2.setTextRange(factory.createParenthesizedExpression(expression), expression); + } + function parenthesizeExpressionOfExpressionStatement(expression) { + var emittedExpression = ts2.skipPartiallyEmittedExpressions(expression); + if (ts2.isCallExpression(emittedExpression)) { + var callee = emittedExpression.expression; + var kind = ts2.skipPartiallyEmittedExpressions(callee).kind; + if (kind === 215 || kind === 216) { + var updated = factory.updateCallExpression(emittedExpression, ts2.setTextRange(factory.createParenthesizedExpression(callee), callee), emittedExpression.typeArguments, emittedExpression.arguments); + return factory.restoreOuterExpressions( + expression, + updated, + 8 + /* OuterExpressionKinds.PartiallyEmittedExpressions */ + ); + } + } + var leftmostExpressionKind = ts2.getLeftmostExpression( + emittedExpression, + /*stopAtCallExpressions*/ + false + ).kind; + if (leftmostExpressionKind === 207 || leftmostExpressionKind === 215) { + return ts2.setTextRange(factory.createParenthesizedExpression(expression), expression); + } + return expression; + } + function parenthesizeConciseBodyOfArrowFunction(body) { + if (!ts2.isBlock(body) && (ts2.isCommaSequence(body) || ts2.getLeftmostExpression( + body, + /*stopAtCallExpressions*/ + false + ).kind === 207)) { + return ts2.setTextRange(factory.createParenthesizedExpression(body), body); + } + return body; + } + function parenthesizeCheckTypeOfConditionalType(checkType) { + switch (checkType.kind) { + case 181: + case 182: + case 191: + return factory.createParenthesizedType(checkType); + } + return checkType; + } + function parenthesizeExtendsTypeOfConditionalType(extendsType) { + switch (extendsType.kind) { + case 191: + return factory.createParenthesizedType(extendsType); + } + return extendsType; + } + function parenthesizeConstituentTypeOfUnionType(type3) { + switch (type3.kind) { + case 189: + case 190: + return factory.createParenthesizedType(type3); + } + return parenthesizeCheckTypeOfConditionalType(type3); + } + function parenthesizeConstituentTypesOfUnionType(members) { + return factory.createNodeArray(ts2.sameMap(members, parenthesizeConstituentTypeOfUnionType)); + } + function parenthesizeConstituentTypeOfIntersectionType(type3) { + switch (type3.kind) { + case 189: + case 190: + return factory.createParenthesizedType(type3); + } + return parenthesizeConstituentTypeOfUnionType(type3); + } + function parenthesizeConstituentTypesOfIntersectionType(members) { + return factory.createNodeArray(ts2.sameMap(members, parenthesizeConstituentTypeOfIntersectionType)); + } + function parenthesizeOperandOfTypeOperator(type3) { + switch (type3.kind) { + case 190: + return factory.createParenthesizedType(type3); + } + return parenthesizeConstituentTypeOfIntersectionType(type3); + } + function parenthesizeOperandOfReadonlyTypeOperator(type3) { + switch (type3.kind) { + case 195: + return factory.createParenthesizedType(type3); + } + return parenthesizeOperandOfTypeOperator(type3); + } + function parenthesizeNonArrayTypeOfPostfixType(type3) { + switch (type3.kind) { + case 192: + case 195: + case 183: + return factory.createParenthesizedType(type3); + } + return parenthesizeOperandOfTypeOperator(type3); + } + function parenthesizeElementTypesOfTupleType(types3) { + return factory.createNodeArray(ts2.sameMap(types3, parenthesizeElementTypeOfTupleType)); + } + function parenthesizeElementTypeOfTupleType(type3) { + if (hasJSDocPostfixQuestion(type3)) + return factory.createParenthesizedType(type3); + return type3; + } + function hasJSDocPostfixQuestion(type3) { + if (ts2.isJSDocNullableType(type3)) + return type3.postfix; + if (ts2.isNamedTupleMember(type3)) + return hasJSDocPostfixQuestion(type3.type); + if (ts2.isFunctionTypeNode(type3) || ts2.isConstructorTypeNode(type3) || ts2.isTypeOperatorNode(type3)) + return hasJSDocPostfixQuestion(type3.type); + if (ts2.isConditionalTypeNode(type3)) + return hasJSDocPostfixQuestion(type3.falseType); + if (ts2.isUnionTypeNode(type3)) + return hasJSDocPostfixQuestion(ts2.last(type3.types)); + if (ts2.isIntersectionTypeNode(type3)) + return hasJSDocPostfixQuestion(ts2.last(type3.types)); + if (ts2.isInferTypeNode(type3)) + return !!type3.typeParameter.constraint && hasJSDocPostfixQuestion(type3.typeParameter.constraint); + return false; + } + function parenthesizeTypeOfOptionalType(type3) { + if (hasJSDocPostfixQuestion(type3)) + return factory.createParenthesizedType(type3); + return parenthesizeNonArrayTypeOfPostfixType(type3); + } + function parenthesizeLeadingTypeArgument(node) { + return ts2.isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory.createParenthesizedType(node) : node; + } + function parenthesizeOrdinalTypeArgument(node, i7) { + return i7 === 0 ? parenthesizeLeadingTypeArgument(node) : node; + } + function parenthesizeTypeArguments(typeArguments) { + if (ts2.some(typeArguments)) { + return factory.createNodeArray(ts2.sameMap(typeArguments, parenthesizeOrdinalTypeArgument)); + } + } + } + ts2.createParenthesizerRules = createParenthesizerRules; + ts2.nullParenthesizerRules = { + getParenthesizeLeftSideOfBinaryForOperator: function(_6) { + return ts2.identity; + }, + getParenthesizeRightSideOfBinaryForOperator: function(_6) { + return ts2.identity; + }, + parenthesizeLeftSideOfBinary: function(_binaryOperator, leftSide) { + return leftSide; + }, + parenthesizeRightSideOfBinary: function(_binaryOperator, _leftSide, rightSide) { + return rightSide; + }, + parenthesizeExpressionOfComputedPropertyName: ts2.identity, + parenthesizeConditionOfConditionalExpression: ts2.identity, + parenthesizeBranchOfConditionalExpression: ts2.identity, + parenthesizeExpressionOfExportDefault: ts2.identity, + parenthesizeExpressionOfNew: function(expression) { + return ts2.cast(expression, ts2.isLeftHandSideExpression); + }, + parenthesizeLeftSideOfAccess: function(expression) { + return ts2.cast(expression, ts2.isLeftHandSideExpression); + }, + parenthesizeOperandOfPostfixUnary: function(operand) { + return ts2.cast(operand, ts2.isLeftHandSideExpression); + }, + parenthesizeOperandOfPrefixUnary: function(operand) { + return ts2.cast(operand, ts2.isUnaryExpression); + }, + parenthesizeExpressionsOfCommaDelimitedList: function(nodes) { + return ts2.cast(nodes, ts2.isNodeArray); + }, + parenthesizeExpressionForDisallowedComma: ts2.identity, + parenthesizeExpressionOfExpressionStatement: ts2.identity, + parenthesizeConciseBodyOfArrowFunction: ts2.identity, + parenthesizeCheckTypeOfConditionalType: ts2.identity, + parenthesizeExtendsTypeOfConditionalType: ts2.identity, + parenthesizeConstituentTypesOfUnionType: function(nodes) { + return ts2.cast(nodes, ts2.isNodeArray); + }, + parenthesizeConstituentTypeOfUnionType: ts2.identity, + parenthesizeConstituentTypesOfIntersectionType: function(nodes) { + return ts2.cast(nodes, ts2.isNodeArray); + }, + parenthesizeConstituentTypeOfIntersectionType: ts2.identity, + parenthesizeOperandOfTypeOperator: ts2.identity, + parenthesizeOperandOfReadonlyTypeOperator: ts2.identity, + parenthesizeNonArrayTypeOfPostfixType: ts2.identity, + parenthesizeElementTypesOfTupleType: function(nodes) { + return ts2.cast(nodes, ts2.isNodeArray); + }, + parenthesizeElementTypeOfTupleType: ts2.identity, + parenthesizeTypeOfOptionalType: ts2.identity, + parenthesizeTypeArguments: function(nodes) { + return nodes && ts2.cast(nodes, ts2.isNodeArray); + }, + parenthesizeLeadingTypeArgument: ts2.identity + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createNodeConverters(factory) { + return { + convertToFunctionBlock, + convertToFunctionExpression, + convertToArrayAssignmentElement, + convertToObjectAssignmentElement, + convertToAssignmentPattern, + convertToObjectAssignmentPattern, + convertToArrayAssignmentPattern, + convertToAssignmentElementTarget + }; + function convertToFunctionBlock(node, multiLine) { + if (ts2.isBlock(node)) + return node; + var returnStatement = factory.createReturnStatement(node); + ts2.setTextRange(returnStatement, node); + var body = factory.createBlock([returnStatement], multiLine); + ts2.setTextRange(body, node); + return body; + } + function convertToFunctionExpression(node) { + if (!node.body) + return ts2.Debug.fail("Cannot convert a FunctionDeclaration without a body"); + var updated = factory.createFunctionExpression(node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body); + ts2.setOriginalNode(updated, node); + ts2.setTextRange(updated, node); + if (ts2.getStartsOnNewLine(node)) { + ts2.setStartsOnNewLine( + updated, + /*newLine*/ + true + ); + } + return updated; + } + function convertToArrayAssignmentElement(element) { + if (ts2.isBindingElement(element)) { + if (element.dotDotDotToken) { + ts2.Debug.assertNode(element.name, ts2.isIdentifier); + return ts2.setOriginalNode(ts2.setTextRange(factory.createSpreadElement(element.name), element), element); + } + var expression = convertToAssignmentElementTarget(element.name); + return element.initializer ? ts2.setOriginalNode(ts2.setTextRange(factory.createAssignment(expression, element.initializer), element), element) : expression; + } + return ts2.cast(element, ts2.isExpression); + } + function convertToObjectAssignmentElement(element) { + if (ts2.isBindingElement(element)) { + if (element.dotDotDotToken) { + ts2.Debug.assertNode(element.name, ts2.isIdentifier); + return ts2.setOriginalNode(ts2.setTextRange(factory.createSpreadAssignment(element.name), element), element); + } + if (element.propertyName) { + var expression = convertToAssignmentElementTarget(element.name); + return ts2.setOriginalNode(ts2.setTextRange(factory.createPropertyAssignment(element.propertyName, element.initializer ? factory.createAssignment(expression, element.initializer) : expression), element), element); + } + ts2.Debug.assertNode(element.name, ts2.isIdentifier); + return ts2.setOriginalNode(ts2.setTextRange(factory.createShorthandPropertyAssignment(element.name, element.initializer), element), element); + } + return ts2.cast(element, ts2.isObjectLiteralElementLike); + } + function convertToAssignmentPattern(node) { + switch (node.kind) { + case 204: + case 206: + return convertToArrayAssignmentPattern(node); + case 203: + case 207: + return convertToObjectAssignmentPattern(node); + } + } + function convertToObjectAssignmentPattern(node) { + if (ts2.isObjectBindingPattern(node)) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createObjectLiteralExpression(ts2.map(node.elements, convertToObjectAssignmentElement)), node), node); + } + return ts2.cast(node, ts2.isObjectLiteralExpression); + } + function convertToArrayAssignmentPattern(node) { + if (ts2.isArrayBindingPattern(node)) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createArrayLiteralExpression(ts2.map(node.elements, convertToArrayAssignmentElement)), node), node); + } + return ts2.cast(node, ts2.isArrayLiteralExpression); + } + function convertToAssignmentElementTarget(node) { + if (ts2.isBindingPattern(node)) { + return convertToAssignmentPattern(node); + } + return ts2.cast(node, ts2.isExpression); + } + } + ts2.createNodeConverters = createNodeConverters; + ts2.nullNodeConverters = { + convertToFunctionBlock: ts2.notImplemented, + convertToFunctionExpression: ts2.notImplemented, + convertToArrayAssignmentElement: ts2.notImplemented, + convertToObjectAssignmentElement: ts2.notImplemented, + convertToAssignmentPattern: ts2.notImplemented, + convertToObjectAssignmentPattern: ts2.notImplemented, + convertToArrayAssignmentPattern: ts2.notImplemented, + convertToAssignmentElementTarget: ts2.notImplemented + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var nextAutoGenerateId = 0; + var NodeFactoryFlags; + (function(NodeFactoryFlags2) { + NodeFactoryFlags2[NodeFactoryFlags2["None"] = 0] = "None"; + NodeFactoryFlags2[NodeFactoryFlags2["NoParenthesizerRules"] = 1] = "NoParenthesizerRules"; + NodeFactoryFlags2[NodeFactoryFlags2["NoNodeConverters"] = 2] = "NoNodeConverters"; + NodeFactoryFlags2[NodeFactoryFlags2["NoIndentationOnFreshPropertyAccess"] = 4] = "NoIndentationOnFreshPropertyAccess"; + NodeFactoryFlags2[NodeFactoryFlags2["NoOriginalNode"] = 8] = "NoOriginalNode"; + })(NodeFactoryFlags = ts2.NodeFactoryFlags || (ts2.NodeFactoryFlags = {})); + function createNodeFactory(flags, baseFactory2) { + var update2 = flags & 8 ? updateWithoutOriginal : updateWithOriginal; + var parenthesizerRules = ts2.memoize(function() { + return flags & 1 ? ts2.nullParenthesizerRules : ts2.createParenthesizerRules(factory); + }); + var converters = ts2.memoize(function() { + return flags & 2 ? ts2.nullNodeConverters : ts2.createNodeConverters(factory); + }); + var getBinaryCreateFunction = ts2.memoizeOne(function(operator) { + return function(left, right) { + return createBinaryExpression(left, operator, right); + }; + }); + var getPrefixUnaryCreateFunction = ts2.memoizeOne(function(operator) { + return function(operand) { + return createPrefixUnaryExpression(operator, operand); + }; + }); + var getPostfixUnaryCreateFunction = ts2.memoizeOne(function(operator) { + return function(operand) { + return createPostfixUnaryExpression(operand, operator); + }; + }); + var getJSDocPrimaryTypeCreateFunction = ts2.memoizeOne(function(kind) { + return function() { + return createJSDocPrimaryTypeWorker(kind); + }; + }); + var getJSDocUnaryTypeCreateFunction = ts2.memoizeOne(function(kind) { + return function(type3) { + return createJSDocUnaryTypeWorker(kind, type3); + }; + }); + var getJSDocUnaryTypeUpdateFunction = ts2.memoizeOne(function(kind) { + return function(node, type3) { + return updateJSDocUnaryTypeWorker(kind, node, type3); + }; + }); + var getJSDocPrePostfixUnaryTypeCreateFunction = ts2.memoizeOne(function(kind) { + return function(type3, postfix) { + return createJSDocPrePostfixUnaryTypeWorker(kind, type3, postfix); + }; + }); + var getJSDocPrePostfixUnaryTypeUpdateFunction = ts2.memoizeOne(function(kind) { + return function(node, type3) { + return updateJSDocPrePostfixUnaryTypeWorker(kind, node, type3); + }; + }); + var getJSDocSimpleTagCreateFunction = ts2.memoizeOne(function(kind) { + return function(tagName, comment) { + return createJSDocSimpleTagWorker(kind, tagName, comment); + }; + }); + var getJSDocSimpleTagUpdateFunction = ts2.memoizeOne(function(kind) { + return function(node, tagName, comment) { + return updateJSDocSimpleTagWorker(kind, node, tagName, comment); + }; + }); + var getJSDocTypeLikeTagCreateFunction = ts2.memoizeOne(function(kind) { + return function(tagName, typeExpression, comment) { + return createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment); + }; + }); + var getJSDocTypeLikeTagUpdateFunction = ts2.memoizeOne(function(kind) { + return function(node, tagName, typeExpression, comment) { + return updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment); + }; + }); + var factory = { + get parenthesizer() { + return parenthesizerRules(); + }, + get converters() { + return converters(); + }, + baseFactory: baseFactory2, + flags, + createNodeArray, + createNumericLiteral, + createBigIntLiteral, + createStringLiteral, + createStringLiteralFromNode, + createRegularExpressionLiteral, + createLiteralLikeNode, + createIdentifier, + updateIdentifier, + createTempVariable, + createLoopVariable, + createUniqueName, + getGeneratedNameForNode, + createPrivateIdentifier, + createUniquePrivateName, + getGeneratedPrivateNameForNode, + createToken, + createSuper, + createThis, + createNull, + createTrue, + createFalse, + createModifier, + createModifiersFromModifierFlags, + createQualifiedName, + updateQualifiedName, + createComputedPropertyName, + updateComputedPropertyName, + createTypeParameterDeclaration, + updateTypeParameterDeclaration, + createParameterDeclaration, + updateParameterDeclaration, + createDecorator, + updateDecorator, + createPropertySignature, + updatePropertySignature, + createPropertyDeclaration, + updatePropertyDeclaration, + createMethodSignature, + updateMethodSignature, + createMethodDeclaration, + updateMethodDeclaration, + createConstructorDeclaration, + updateConstructorDeclaration, + createGetAccessorDeclaration, + updateGetAccessorDeclaration, + createSetAccessorDeclaration, + updateSetAccessorDeclaration, + createCallSignature, + updateCallSignature, + createConstructSignature, + updateConstructSignature, + createIndexSignature, + updateIndexSignature, + createClassStaticBlockDeclaration, + updateClassStaticBlockDeclaration, + createTemplateLiteralTypeSpan, + updateTemplateLiteralTypeSpan, + createKeywordTypeNode, + createTypePredicateNode, + updateTypePredicateNode, + createTypeReferenceNode, + updateTypeReferenceNode, + createFunctionTypeNode, + updateFunctionTypeNode, + createConstructorTypeNode, + updateConstructorTypeNode, + createTypeQueryNode, + updateTypeQueryNode, + createTypeLiteralNode, + updateTypeLiteralNode, + createArrayTypeNode, + updateArrayTypeNode, + createTupleTypeNode, + updateTupleTypeNode, + createNamedTupleMember, + updateNamedTupleMember, + createOptionalTypeNode, + updateOptionalTypeNode, + createRestTypeNode, + updateRestTypeNode, + createUnionTypeNode, + updateUnionTypeNode, + createIntersectionTypeNode, + updateIntersectionTypeNode, + createConditionalTypeNode, + updateConditionalTypeNode, + createInferTypeNode, + updateInferTypeNode, + createImportTypeNode, + updateImportTypeNode, + createParenthesizedType, + updateParenthesizedType, + createThisTypeNode, + createTypeOperatorNode, + updateTypeOperatorNode, + createIndexedAccessTypeNode, + updateIndexedAccessTypeNode, + createMappedTypeNode, + updateMappedTypeNode, + createLiteralTypeNode, + updateLiteralTypeNode, + createTemplateLiteralType, + updateTemplateLiteralType, + createObjectBindingPattern, + updateObjectBindingPattern, + createArrayBindingPattern, + updateArrayBindingPattern, + createBindingElement, + updateBindingElement, + createArrayLiteralExpression, + updateArrayLiteralExpression, + createObjectLiteralExpression, + updateObjectLiteralExpression, + createPropertyAccessExpression: flags & 4 ? function(expression, name2) { + return ts2.setEmitFlags( + createPropertyAccessExpression(expression, name2), + 131072 + /* EmitFlags.NoIndentation */ + ); + } : createPropertyAccessExpression, + updatePropertyAccessExpression, + createPropertyAccessChain: flags & 4 ? function(expression, questionDotToken, name2) { + return ts2.setEmitFlags( + createPropertyAccessChain(expression, questionDotToken, name2), + 131072 + /* EmitFlags.NoIndentation */ + ); + } : createPropertyAccessChain, + updatePropertyAccessChain, + createElementAccessExpression, + updateElementAccessExpression, + createElementAccessChain, + updateElementAccessChain, + createCallExpression, + updateCallExpression, + createCallChain, + updateCallChain, + createNewExpression, + updateNewExpression, + createTaggedTemplateExpression, + updateTaggedTemplateExpression, + createTypeAssertion, + updateTypeAssertion, + createParenthesizedExpression, + updateParenthesizedExpression, + createFunctionExpression, + updateFunctionExpression, + createArrowFunction, + updateArrowFunction, + createDeleteExpression, + updateDeleteExpression, + createTypeOfExpression, + updateTypeOfExpression, + createVoidExpression, + updateVoidExpression, + createAwaitExpression, + updateAwaitExpression, + createPrefixUnaryExpression, + updatePrefixUnaryExpression, + createPostfixUnaryExpression, + updatePostfixUnaryExpression, + createBinaryExpression, + updateBinaryExpression, + createConditionalExpression, + updateConditionalExpression, + createTemplateExpression, + updateTemplateExpression, + createTemplateHead, + createTemplateMiddle, + createTemplateTail, + createNoSubstitutionTemplateLiteral, + createTemplateLiteralLikeNode, + createYieldExpression, + updateYieldExpression, + createSpreadElement, + updateSpreadElement, + createClassExpression, + updateClassExpression, + createOmittedExpression, + createExpressionWithTypeArguments, + updateExpressionWithTypeArguments, + createAsExpression, + updateAsExpression, + createNonNullExpression, + updateNonNullExpression, + createSatisfiesExpression, + updateSatisfiesExpression, + createNonNullChain, + updateNonNullChain, + createMetaProperty, + updateMetaProperty, + createTemplateSpan, + updateTemplateSpan, + createSemicolonClassElement, + createBlock, + updateBlock, + createVariableStatement, + updateVariableStatement, + createEmptyStatement, + createExpressionStatement, + updateExpressionStatement, + createIfStatement, + updateIfStatement, + createDoStatement, + updateDoStatement, + createWhileStatement, + updateWhileStatement, + createForStatement, + updateForStatement, + createForInStatement, + updateForInStatement, + createForOfStatement, + updateForOfStatement, + createContinueStatement, + updateContinueStatement, + createBreakStatement, + updateBreakStatement, + createReturnStatement, + updateReturnStatement, + createWithStatement, + updateWithStatement, + createSwitchStatement, + updateSwitchStatement, + createLabeledStatement, + updateLabeledStatement, + createThrowStatement, + updateThrowStatement, + createTryStatement, + updateTryStatement, + createDebuggerStatement, + createVariableDeclaration, + updateVariableDeclaration, + createVariableDeclarationList, + updateVariableDeclarationList, + createFunctionDeclaration, + updateFunctionDeclaration, + createClassDeclaration, + updateClassDeclaration, + createInterfaceDeclaration, + updateInterfaceDeclaration, + createTypeAliasDeclaration, + updateTypeAliasDeclaration, + createEnumDeclaration, + updateEnumDeclaration, + createModuleDeclaration, + updateModuleDeclaration, + createModuleBlock, + updateModuleBlock, + createCaseBlock, + updateCaseBlock, + createNamespaceExportDeclaration, + updateNamespaceExportDeclaration, + createImportEqualsDeclaration, + updateImportEqualsDeclaration, + createImportDeclaration, + updateImportDeclaration, + createImportClause, + updateImportClause, + createAssertClause, + updateAssertClause, + createAssertEntry, + updateAssertEntry, + createImportTypeAssertionContainer, + updateImportTypeAssertionContainer, + createNamespaceImport, + updateNamespaceImport, + createNamespaceExport, + updateNamespaceExport, + createNamedImports, + updateNamedImports, + createImportSpecifier, + updateImportSpecifier, + createExportAssignment, + updateExportAssignment, + createExportDeclaration, + updateExportDeclaration, + createNamedExports, + updateNamedExports, + createExportSpecifier, + updateExportSpecifier, + createMissingDeclaration, + createExternalModuleReference, + updateExternalModuleReference, + // lazily load factory members for JSDoc types with similar structure + get createJSDocAllType() { + return getJSDocPrimaryTypeCreateFunction( + 315 + /* SyntaxKind.JSDocAllType */ + ); + }, + get createJSDocUnknownType() { + return getJSDocPrimaryTypeCreateFunction( + 316 + /* SyntaxKind.JSDocUnknownType */ + ); + }, + get createJSDocNonNullableType() { + return getJSDocPrePostfixUnaryTypeCreateFunction( + 318 + /* SyntaxKind.JSDocNonNullableType */ + ); + }, + get updateJSDocNonNullableType() { + return getJSDocPrePostfixUnaryTypeUpdateFunction( + 318 + /* SyntaxKind.JSDocNonNullableType */ + ); + }, + get createJSDocNullableType() { + return getJSDocPrePostfixUnaryTypeCreateFunction( + 317 + /* SyntaxKind.JSDocNullableType */ + ); + }, + get updateJSDocNullableType() { + return getJSDocPrePostfixUnaryTypeUpdateFunction( + 317 + /* SyntaxKind.JSDocNullableType */ + ); + }, + get createJSDocOptionalType() { + return getJSDocUnaryTypeCreateFunction( + 319 + /* SyntaxKind.JSDocOptionalType */ + ); + }, + get updateJSDocOptionalType() { + return getJSDocUnaryTypeUpdateFunction( + 319 + /* SyntaxKind.JSDocOptionalType */ + ); + }, + get createJSDocVariadicType() { + return getJSDocUnaryTypeCreateFunction( + 321 + /* SyntaxKind.JSDocVariadicType */ + ); + }, + get updateJSDocVariadicType() { + return getJSDocUnaryTypeUpdateFunction( + 321 + /* SyntaxKind.JSDocVariadicType */ + ); + }, + get createJSDocNamepathType() { + return getJSDocUnaryTypeCreateFunction( + 322 + /* SyntaxKind.JSDocNamepathType */ + ); + }, + get updateJSDocNamepathType() { + return getJSDocUnaryTypeUpdateFunction( + 322 + /* SyntaxKind.JSDocNamepathType */ + ); + }, + createJSDocFunctionType, + updateJSDocFunctionType, + createJSDocTypeLiteral, + updateJSDocTypeLiteral, + createJSDocTypeExpression, + updateJSDocTypeExpression, + createJSDocSignature, + updateJSDocSignature, + createJSDocTemplateTag, + updateJSDocTemplateTag, + createJSDocTypedefTag, + updateJSDocTypedefTag, + createJSDocParameterTag, + updateJSDocParameterTag, + createJSDocPropertyTag, + updateJSDocPropertyTag, + createJSDocCallbackTag, + updateJSDocCallbackTag, + createJSDocAugmentsTag, + updateJSDocAugmentsTag, + createJSDocImplementsTag, + updateJSDocImplementsTag, + createJSDocSeeTag, + updateJSDocSeeTag, + createJSDocNameReference, + updateJSDocNameReference, + createJSDocMemberName, + updateJSDocMemberName, + createJSDocLink, + updateJSDocLink, + createJSDocLinkCode, + updateJSDocLinkCode, + createJSDocLinkPlain, + updateJSDocLinkPlain, + // lazily load factory members for JSDoc tags with similar structure + get createJSDocTypeTag() { + return getJSDocTypeLikeTagCreateFunction( + 346 + /* SyntaxKind.JSDocTypeTag */ + ); + }, + get updateJSDocTypeTag() { + return getJSDocTypeLikeTagUpdateFunction( + 346 + /* SyntaxKind.JSDocTypeTag */ + ); + }, + get createJSDocReturnTag() { + return getJSDocTypeLikeTagCreateFunction( + 344 + /* SyntaxKind.JSDocReturnTag */ + ); + }, + get updateJSDocReturnTag() { + return getJSDocTypeLikeTagUpdateFunction( + 344 + /* SyntaxKind.JSDocReturnTag */ + ); + }, + get createJSDocThisTag() { + return getJSDocTypeLikeTagCreateFunction( + 345 + /* SyntaxKind.JSDocThisTag */ + ); + }, + get updateJSDocThisTag() { + return getJSDocTypeLikeTagUpdateFunction( + 345 + /* SyntaxKind.JSDocThisTag */ + ); + }, + get createJSDocEnumTag() { + return getJSDocTypeLikeTagCreateFunction( + 342 + /* SyntaxKind.JSDocEnumTag */ + ); + }, + get updateJSDocEnumTag() { + return getJSDocTypeLikeTagUpdateFunction( + 342 + /* SyntaxKind.JSDocEnumTag */ + ); + }, + get createJSDocAuthorTag() { + return getJSDocSimpleTagCreateFunction( + 333 + /* SyntaxKind.JSDocAuthorTag */ + ); + }, + get updateJSDocAuthorTag() { + return getJSDocSimpleTagUpdateFunction( + 333 + /* SyntaxKind.JSDocAuthorTag */ + ); + }, + get createJSDocClassTag() { + return getJSDocSimpleTagCreateFunction( + 335 + /* SyntaxKind.JSDocClassTag */ + ); + }, + get updateJSDocClassTag() { + return getJSDocSimpleTagUpdateFunction( + 335 + /* SyntaxKind.JSDocClassTag */ + ); + }, + get createJSDocPublicTag() { + return getJSDocSimpleTagCreateFunction( + 336 + /* SyntaxKind.JSDocPublicTag */ + ); + }, + get updateJSDocPublicTag() { + return getJSDocSimpleTagUpdateFunction( + 336 + /* SyntaxKind.JSDocPublicTag */ + ); + }, + get createJSDocPrivateTag() { + return getJSDocSimpleTagCreateFunction( + 337 + /* SyntaxKind.JSDocPrivateTag */ + ); + }, + get updateJSDocPrivateTag() { + return getJSDocSimpleTagUpdateFunction( + 337 + /* SyntaxKind.JSDocPrivateTag */ + ); + }, + get createJSDocProtectedTag() { + return getJSDocSimpleTagCreateFunction( + 338 + /* SyntaxKind.JSDocProtectedTag */ + ); + }, + get updateJSDocProtectedTag() { + return getJSDocSimpleTagUpdateFunction( + 338 + /* SyntaxKind.JSDocProtectedTag */ + ); + }, + get createJSDocReadonlyTag() { + return getJSDocSimpleTagCreateFunction( + 339 + /* SyntaxKind.JSDocReadonlyTag */ + ); + }, + get updateJSDocReadonlyTag() { + return getJSDocSimpleTagUpdateFunction( + 339 + /* SyntaxKind.JSDocReadonlyTag */ + ); + }, + get createJSDocOverrideTag() { + return getJSDocSimpleTagCreateFunction( + 340 + /* SyntaxKind.JSDocOverrideTag */ + ); + }, + get updateJSDocOverrideTag() { + return getJSDocSimpleTagUpdateFunction( + 340 + /* SyntaxKind.JSDocOverrideTag */ + ); + }, + get createJSDocDeprecatedTag() { + return getJSDocSimpleTagCreateFunction( + 334 + /* SyntaxKind.JSDocDeprecatedTag */ + ); + }, + get updateJSDocDeprecatedTag() { + return getJSDocSimpleTagUpdateFunction( + 334 + /* SyntaxKind.JSDocDeprecatedTag */ + ); + }, + createJSDocUnknownTag, + updateJSDocUnknownTag, + createJSDocText, + updateJSDocText, + createJSDocComment, + updateJSDocComment, + createJsxElement, + updateJsxElement, + createJsxSelfClosingElement, + updateJsxSelfClosingElement, + createJsxOpeningElement, + updateJsxOpeningElement, + createJsxClosingElement, + updateJsxClosingElement, + createJsxFragment, + createJsxText, + updateJsxText, + createJsxOpeningFragment, + createJsxJsxClosingFragment, + updateJsxFragment, + createJsxAttribute, + updateJsxAttribute, + createJsxAttributes, + updateJsxAttributes, + createJsxSpreadAttribute, + updateJsxSpreadAttribute, + createJsxExpression, + updateJsxExpression, + createCaseClause, + updateCaseClause, + createDefaultClause, + updateDefaultClause, + createHeritageClause, + updateHeritageClause, + createCatchClause, + updateCatchClause, + createPropertyAssignment, + updatePropertyAssignment, + createShorthandPropertyAssignment, + updateShorthandPropertyAssignment, + createSpreadAssignment, + updateSpreadAssignment, + createEnumMember, + updateEnumMember, + createSourceFile, + updateSourceFile, + createBundle, + updateBundle, + createUnparsedSource, + createUnparsedPrologue, + createUnparsedPrepend, + createUnparsedTextLike, + createUnparsedSyntheticReference, + createInputFiles: createInputFiles2, + createSyntheticExpression, + createSyntaxList, + createNotEmittedStatement, + createPartiallyEmittedExpression, + updatePartiallyEmittedExpression, + createCommaListExpression, + updateCommaListExpression, + createEndOfDeclarationMarker, + createMergeDeclarationMarker, + createSyntheticReferenceExpression, + updateSyntheticReferenceExpression, + cloneNode, + // Lazily load factory methods for common operator factories and utilities + get createComma() { + return getBinaryCreateFunction( + 27 + /* SyntaxKind.CommaToken */ + ); + }, + get createAssignment() { + return getBinaryCreateFunction( + 63 + /* SyntaxKind.EqualsToken */ + ); + }, + get createLogicalOr() { + return getBinaryCreateFunction( + 56 + /* SyntaxKind.BarBarToken */ + ); + }, + get createLogicalAnd() { + return getBinaryCreateFunction( + 55 + /* SyntaxKind.AmpersandAmpersandToken */ + ); + }, + get createBitwiseOr() { + return getBinaryCreateFunction( + 51 + /* SyntaxKind.BarToken */ + ); + }, + get createBitwiseXor() { + return getBinaryCreateFunction( + 52 + /* SyntaxKind.CaretToken */ + ); + }, + get createBitwiseAnd() { + return getBinaryCreateFunction( + 50 + /* SyntaxKind.AmpersandToken */ + ); + }, + get createStrictEquality() { + return getBinaryCreateFunction( + 36 + /* SyntaxKind.EqualsEqualsEqualsToken */ + ); + }, + get createStrictInequality() { + return getBinaryCreateFunction( + 37 + /* SyntaxKind.ExclamationEqualsEqualsToken */ + ); + }, + get createEquality() { + return getBinaryCreateFunction( + 34 + /* SyntaxKind.EqualsEqualsToken */ + ); + }, + get createInequality() { + return getBinaryCreateFunction( + 35 + /* SyntaxKind.ExclamationEqualsToken */ + ); + }, + get createLessThan() { + return getBinaryCreateFunction( + 29 + /* SyntaxKind.LessThanToken */ + ); + }, + get createLessThanEquals() { + return getBinaryCreateFunction( + 32 + /* SyntaxKind.LessThanEqualsToken */ + ); + }, + get createGreaterThan() { + return getBinaryCreateFunction( + 31 + /* SyntaxKind.GreaterThanToken */ + ); + }, + get createGreaterThanEquals() { + return getBinaryCreateFunction( + 33 + /* SyntaxKind.GreaterThanEqualsToken */ + ); + }, + get createLeftShift() { + return getBinaryCreateFunction( + 47 + /* SyntaxKind.LessThanLessThanToken */ + ); + }, + get createRightShift() { + return getBinaryCreateFunction( + 48 + /* SyntaxKind.GreaterThanGreaterThanToken */ + ); + }, + get createUnsignedRightShift() { + return getBinaryCreateFunction( + 49 + /* SyntaxKind.GreaterThanGreaterThanGreaterThanToken */ + ); + }, + get createAdd() { + return getBinaryCreateFunction( + 39 + /* SyntaxKind.PlusToken */ + ); + }, + get createSubtract() { + return getBinaryCreateFunction( + 40 + /* SyntaxKind.MinusToken */ + ); + }, + get createMultiply() { + return getBinaryCreateFunction( + 41 + /* SyntaxKind.AsteriskToken */ + ); + }, + get createDivide() { + return getBinaryCreateFunction( + 43 + /* SyntaxKind.SlashToken */ + ); + }, + get createModulo() { + return getBinaryCreateFunction( + 44 + /* SyntaxKind.PercentToken */ + ); + }, + get createExponent() { + return getBinaryCreateFunction( + 42 + /* SyntaxKind.AsteriskAsteriskToken */ + ); + }, + get createPrefixPlus() { + return getPrefixUnaryCreateFunction( + 39 + /* SyntaxKind.PlusToken */ + ); + }, + get createPrefixMinus() { + return getPrefixUnaryCreateFunction( + 40 + /* SyntaxKind.MinusToken */ + ); + }, + get createPrefixIncrement() { + return getPrefixUnaryCreateFunction( + 45 + /* SyntaxKind.PlusPlusToken */ + ); + }, + get createPrefixDecrement() { + return getPrefixUnaryCreateFunction( + 46 + /* SyntaxKind.MinusMinusToken */ + ); + }, + get createBitwiseNot() { + return getPrefixUnaryCreateFunction( + 54 + /* SyntaxKind.TildeToken */ + ); + }, + get createLogicalNot() { + return getPrefixUnaryCreateFunction( + 53 + /* SyntaxKind.ExclamationToken */ + ); + }, + get createPostfixIncrement() { + return getPostfixUnaryCreateFunction( + 45 + /* SyntaxKind.PlusPlusToken */ + ); + }, + get createPostfixDecrement() { + return getPostfixUnaryCreateFunction( + 46 + /* SyntaxKind.MinusMinusToken */ + ); + }, + // Compound nodes + createImmediatelyInvokedFunctionExpression, + createImmediatelyInvokedArrowFunction, + createVoidZero, + createExportDefault, + createExternalModuleExport, + createTypeCheck, + createMethodCall, + createGlobalMethodCall, + createFunctionBindCall, + createFunctionCallCall, + createFunctionApplyCall, + createArraySliceCall, + createArrayConcatCall, + createObjectDefinePropertyCall, + createReflectGetCall, + createReflectSetCall, + createPropertyDescriptor, + createCallBinding, + createAssignmentTargetWrapper, + // Utilities + inlineExpressions, + getInternalName, + getLocalName, + getExportName, + getDeclarationName, + getNamespaceMemberName, + getExternalModuleOrNamespaceExportName, + restoreOuterExpressions, + restoreEnclosingLabel, + createUseStrictPrologue, + copyPrologue, + copyStandardPrologue, + copyCustomPrologue, + ensureUseStrict, + liftToBlock, + mergeLexicalEnvironment, + updateModifiers + }; + return factory; + function createNodeArray(elements, hasTrailingComma) { + if (elements === void 0 || elements === ts2.emptyArray) { + elements = []; + } else if (ts2.isNodeArray(elements)) { + if (hasTrailingComma === void 0 || elements.hasTrailingComma === hasTrailingComma) { + if (elements.transformFlags === void 0) { + aggregateChildrenFlags(elements); + } + ts2.Debug.attachNodeArrayDebugInfo(elements); + return elements; + } + var array_8 = elements.slice(); + array_8.pos = elements.pos; + array_8.end = elements.end; + array_8.hasTrailingComma = hasTrailingComma; + array_8.transformFlags = elements.transformFlags; + ts2.Debug.attachNodeArrayDebugInfo(array_8); + return array_8; + } + var length = elements.length; + var array = length >= 1 && length <= 4 ? elements.slice() : elements; + ts2.setTextRangePosEnd(array, -1, -1); + array.hasTrailingComma = !!hasTrailingComma; + aggregateChildrenFlags(array); + ts2.Debug.attachNodeArrayDebugInfo(array); + return array; + } + function createBaseNode(kind) { + return baseFactory2.createBaseNode(kind); + } + function createBaseDeclaration(kind) { + var node = createBaseNode(kind); + node.symbol = void 0; + node.localSymbol = void 0; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function createBaseNamedDeclaration(kind, modifiers, name2) { + var node = createBaseDeclaration(kind); + name2 = asName(name2); + node.name = name2; + if (ts2.canHaveModifiers(node)) { + node.modifiers = asNodeArray(modifiers); + node.transformFlags |= propagateChildrenFlags(node.modifiers); + } + if (name2) { + switch (node.kind) { + case 171: + case 174: + case 175: + case 169: + case 299: + if (ts2.isIdentifier(name2)) { + node.transformFlags |= propagateIdentifierNameFlags(name2); + break; + } + default: + node.transformFlags |= propagateChildFlags(name2); + break; + } + } + return node; + } + function createBaseGenericNamedDeclaration(kind, modifiers, name2, typeParameters) { + var node = createBaseNamedDeclaration(kind, modifiers, name2); + node.typeParameters = asNodeArray(typeParameters); + node.transformFlags |= propagateChildrenFlags(node.typeParameters); + if (typeParameters) + node.transformFlags |= 1; + return node; + } + function createBaseSignatureDeclaration(kind, modifiers, name2, typeParameters, parameters, type3) { + var node = createBaseGenericNamedDeclaration(kind, modifiers, name2, typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.transformFlags |= propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type); + if (type3) + node.transformFlags |= 1; + node.typeArguments = void 0; + return node; + } + function finishUpdateBaseSignatureDeclaration(updated, original) { + if (updated !== original) { + updated.typeArguments = original.typeArguments; + } + return update2(updated, original); + } + function createBaseFunctionLikeDeclaration(kind, modifiers, name2, typeParameters, parameters, type3, body) { + var node = createBaseSignatureDeclaration(kind, modifiers, name2, typeParameters, parameters, type3); + node.body = body; + node.transformFlags |= propagateChildFlags(node.body) & ~67108864; + if (!body) + node.transformFlags |= 1; + return node; + } + function createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name2, typeParameters, heritageClauses) { + var node = createBaseGenericNamedDeclaration(kind, modifiers, name2, typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); + node.transformFlags |= propagateChildrenFlags(node.heritageClauses); + return node; + } + function createBaseClassLikeDeclaration(kind, modifiers, name2, typeParameters, heritageClauses, members) { + var node = createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name2, typeParameters, heritageClauses); + node.members = createNodeArray(members); + node.transformFlags |= propagateChildrenFlags(node.members); + return node; + } + function createBaseBindingLikeDeclaration(kind, modifiers, name2, initializer) { + var node = createBaseNamedDeclaration(kind, modifiers, name2); + node.initializer = initializer; + node.transformFlags |= propagateChildFlags(node.initializer); + return node; + } + function createBaseVariableLikeDeclaration(kind, modifiers, name2, type3, initializer) { + var node = createBaseBindingLikeDeclaration(kind, modifiers, name2, initializer); + node.type = type3; + node.transformFlags |= propagateChildFlags(type3); + if (type3) + node.transformFlags |= 1; + return node; + } + function createBaseLiteral(kind, text) { + var node = createBaseToken(kind); + node.text = text; + return node; + } + function createNumericLiteral(value2, numericLiteralFlags) { + if (numericLiteralFlags === void 0) { + numericLiteralFlags = 0; + } + var node = createBaseLiteral(8, typeof value2 === "number" ? value2 + "" : value2); + node.numericLiteralFlags = numericLiteralFlags; + if (numericLiteralFlags & 384) + node.transformFlags |= 1024; + return node; + } + function createBigIntLiteral(value2) { + var node = createBaseLiteral(9, typeof value2 === "string" ? value2 : ts2.pseudoBigIntToString(value2) + "n"); + node.transformFlags |= 4; + return node; + } + function createBaseStringLiteral(text, isSingleQuote) { + var node = createBaseLiteral(10, text); + node.singleQuote = isSingleQuote; + return node; + } + function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { + var node = createBaseStringLiteral(text, isSingleQuote); + node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; + if (hasExtendedUnicodeEscape) + node.transformFlags |= 1024; + return node; + } + function createStringLiteralFromNode(sourceNode) { + var node = createBaseStringLiteral( + ts2.getTextOfIdentifierOrLiteral(sourceNode), + /*isSingleQuote*/ + void 0 + ); + node.textSourceNode = sourceNode; + return node; + } + function createRegularExpressionLiteral(text) { + var node = createBaseLiteral(13, text); + return node; + } + function createLiteralLikeNode(kind, text) { + switch (kind) { + case 8: + return createNumericLiteral( + text, + /*numericLiteralFlags*/ + 0 + ); + case 9: + return createBigIntLiteral(text); + case 10: + return createStringLiteral( + text, + /*isSingleQuote*/ + void 0 + ); + case 11: + return createJsxText( + text, + /*containsOnlyTriviaWhiteSpaces*/ + false + ); + case 12: + return createJsxText( + text, + /*containsOnlyTriviaWhiteSpaces*/ + true + ); + case 13: + return createRegularExpressionLiteral(text); + case 14: + return createTemplateLiteralLikeNode( + kind, + text, + /*rawText*/ + void 0, + /*templateFlags*/ + 0 + ); + } + } + function createBaseIdentifier(text, originalKeywordKind) { + if (originalKeywordKind === void 0 && text) { + originalKeywordKind = ts2.stringToToken(text); + } + if (originalKeywordKind === 79) { + originalKeywordKind = void 0; + } + var node = baseFactory2.createBaseIdentifierNode( + 79 + /* SyntaxKind.Identifier */ + ); + node.originalKeywordKind = originalKeywordKind; + node.escapedText = ts2.escapeLeadingUnderscores(text); + return node; + } + function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { + var node = createBaseIdentifier( + text, + /*originalKeywordKind*/ + void 0 + ); + node.autoGenerateFlags = autoGenerateFlags; + node.autoGenerateId = nextAutoGenerateId; + node.autoGeneratePrefix = prefix; + node.autoGenerateSuffix = suffix; + nextAutoGenerateId++; + return node; + } + function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { + var node = createBaseIdentifier(text, originalKeywordKind); + if (typeArguments) { + node.typeArguments = createNodeArray(typeArguments); + } + if (node.originalKeywordKind === 133) { + node.transformFlags |= 67108864; + } + if (hasExtendedUnicodeEscape) { + node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; + node.transformFlags |= 1024; + } + return node; + } + function updateIdentifier(node, typeArguments) { + return node.typeArguments !== typeArguments ? update2(createIdentifier(ts2.idText(node), typeArguments), node) : node; + } + function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { + var flags2 = 1; + if (reservedInNestedScopes) + flags2 |= 8; + var name2 = createBaseGeneratedIdentifier("", flags2, prefix, suffix); + if (recordTempVariable) { + recordTempVariable(name2); + } + return name2; + } + function createLoopVariable(reservedInNestedScopes) { + var flags2 = 2; + if (reservedInNestedScopes) + flags2 |= 8; + return createBaseGeneratedIdentifier( + "", + flags2, + /*prefix*/ + void 0, + /*suffix*/ + void 0 + ); + } + function createUniqueName(text, flags2, prefix, suffix) { + if (flags2 === void 0) { + flags2 = 0; + } + ts2.Debug.assert(!(flags2 & 7), "Argument out of range: flags"); + ts2.Debug.assert((flags2 & (16 | 32)) !== 32, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); + return createBaseGeneratedIdentifier(text, 3 | flags2, prefix, suffix); + } + function getGeneratedNameForNode(node, flags2, prefix, suffix) { + if (flags2 === void 0) { + flags2 = 0; + } + ts2.Debug.assert(!(flags2 & 7), "Argument out of range: flags"); + var text = !node ? "" : ts2.isMemberName(node) ? ts2.formatGeneratedName( + /*privateName*/ + false, + prefix, + node, + suffix, + ts2.idText + ) : "generated@".concat(ts2.getNodeId(node)); + if (prefix || suffix) + flags2 |= 16; + var name2 = createBaseGeneratedIdentifier(text, 4 | flags2, prefix, suffix); + name2.original = node; + return name2; + } + function createBasePrivateIdentifier(text) { + var node = baseFactory2.createBasePrivateIdentifierNode( + 80 + /* SyntaxKind.PrivateIdentifier */ + ); + node.escapedText = ts2.escapeLeadingUnderscores(text); + node.transformFlags |= 16777216; + return node; + } + function createPrivateIdentifier(text) { + if (!ts2.startsWith(text, "#")) + ts2.Debug.fail("First character of private identifier must be #: " + text); + return createBasePrivateIdentifier(text); + } + function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { + var node = createBasePrivateIdentifier(text); + node.autoGenerateFlags = autoGenerateFlags; + node.autoGenerateId = nextAutoGenerateId; + node.autoGeneratePrefix = prefix; + node.autoGenerateSuffix = suffix; + nextAutoGenerateId++; + return node; + } + function createUniquePrivateName(text, prefix, suffix) { + if (text && !ts2.startsWith(text, "#")) + ts2.Debug.fail("First character of private identifier must be #: " + text); + var autoGenerateFlags = 8 | (text ? 3 : 1); + return createBaseGeneratedPrivateIdentifier(text !== null && text !== void 0 ? text : "", autoGenerateFlags, prefix, suffix); + } + function getGeneratedPrivateNameForNode(node, prefix, suffix) { + var text = ts2.isMemberName(node) ? ts2.formatGeneratedName( + /*privateName*/ + true, + prefix, + node, + suffix, + ts2.idText + ) : "#generated@".concat(ts2.getNodeId(node)); + var flags2 = prefix || suffix ? 16 : 0; + var name2 = createBaseGeneratedPrivateIdentifier(text, 4 | flags2, prefix, suffix); + name2.original = node; + return name2; + } + function createBaseToken(kind) { + return baseFactory2.createBaseTokenNode(kind); + } + function createToken(token) { + ts2.Debug.assert(token >= 0 && token <= 162, "Invalid token"); + ts2.Debug.assert(token <= 14 || token >= 17, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); + ts2.Debug.assert(token <= 8 || token >= 14, "Invalid token. Use 'createLiteralLikeNode' to create literals."); + ts2.Debug.assert(token !== 79, "Invalid token. Use 'createIdentifier' to create identifiers"); + var node = createBaseToken(token); + var transformFlags = 0; + switch (token) { + case 132: + transformFlags = 256 | 128; + break; + case 123: + case 121: + case 122: + case 146: + case 126: + case 136: + case 85: + case 131: + case 148: + case 160: + case 144: + case 149: + case 101: + case 145: + case 161: + case 152: + case 134: + case 153: + case 114: + case 157: + case 155: + transformFlags = 1; + break; + case 106: + transformFlags = 1024 | 134217728; + break; + case 124: + transformFlags = 1024; + break; + case 127: + transformFlags = 16777216; + break; + case 108: + transformFlags = 16384; + break; + } + if (transformFlags) { + node.transformFlags |= transformFlags; + } + return node; + } + function createSuper() { + return createToken( + 106 + /* SyntaxKind.SuperKeyword */ + ); + } + function createThis() { + return createToken( + 108 + /* SyntaxKind.ThisKeyword */ + ); + } + function createNull() { + return createToken( + 104 + /* SyntaxKind.NullKeyword */ + ); + } + function createTrue() { + return createToken( + 110 + /* SyntaxKind.TrueKeyword */ + ); + } + function createFalse() { + return createToken( + 95 + /* SyntaxKind.FalseKeyword */ + ); + } + function createModifier(kind) { + return createToken(kind); + } + function createModifiersFromModifierFlags(flags2) { + var result2 = []; + if (flags2 & 1) + result2.push(createModifier( + 93 + /* SyntaxKind.ExportKeyword */ + )); + if (flags2 & 2) + result2.push(createModifier( + 136 + /* SyntaxKind.DeclareKeyword */ + )); + if (flags2 & 1024) + result2.push(createModifier( + 88 + /* SyntaxKind.DefaultKeyword */ + )); + if (flags2 & 2048) + result2.push(createModifier( + 85 + /* SyntaxKind.ConstKeyword */ + )); + if (flags2 & 4) + result2.push(createModifier( + 123 + /* SyntaxKind.PublicKeyword */ + )); + if (flags2 & 8) + result2.push(createModifier( + 121 + /* SyntaxKind.PrivateKeyword */ + )); + if (flags2 & 16) + result2.push(createModifier( + 122 + /* SyntaxKind.ProtectedKeyword */ + )); + if (flags2 & 256) + result2.push(createModifier( + 126 + /* SyntaxKind.AbstractKeyword */ + )); + if (flags2 & 32) + result2.push(createModifier( + 124 + /* SyntaxKind.StaticKeyword */ + )); + if (flags2 & 16384) + result2.push(createModifier( + 161 + /* SyntaxKind.OverrideKeyword */ + )); + if (flags2 & 64) + result2.push(createModifier( + 146 + /* SyntaxKind.ReadonlyKeyword */ + )); + if (flags2 & 128) + result2.push(createModifier( + 127 + /* SyntaxKind.AccessorKeyword */ + )); + if (flags2 & 512) + result2.push(createModifier( + 132 + /* SyntaxKind.AsyncKeyword */ + )); + if (flags2 & 32768) + result2.push(createModifier( + 101 + /* SyntaxKind.InKeyword */ + )); + if (flags2 & 65536) + result2.push(createModifier( + 145 + /* SyntaxKind.OutKeyword */ + )); + return result2.length ? result2 : void 0; + } + function createQualifiedName(left, right) { + var node = createBaseNode( + 163 + /* SyntaxKind.QualifiedName */ + ); + node.left = left; + node.right = asName(right); + node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); + return node; + } + function updateQualifiedName(node, left, right) { + return node.left !== left || node.right !== right ? update2(createQualifiedName(left, right), node) : node; + } + function createComputedPropertyName(expression) { + var node = createBaseNode( + 164 + /* SyntaxKind.ComputedPropertyName */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 1024 | 131072; + return node; + } + function updateComputedPropertyName(node, expression) { + return node.expression !== expression ? update2(createComputedPropertyName(expression), node) : node; + } + function createTypeParameterDeclaration(modifiers, name2, constraint, defaultType) { + var node = createBaseNamedDeclaration(165, modifiers, name2); + node.constraint = constraint; + node.default = defaultType; + node.transformFlags = 1; + return node; + } + function updateTypeParameterDeclaration(node, modifiers, name2, constraint, defaultType) { + return node.modifiers !== modifiers || node.name !== name2 || node.constraint !== constraint || node.default !== defaultType ? update2(createTypeParameterDeclaration(modifiers, name2, constraint, defaultType), node) : node; + } + function createParameterDeclaration(modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + var node = createBaseVariableLikeDeclaration(166, modifiers, name2, type3, initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)); + node.dotDotDotToken = dotDotDotToken; + node.questionToken = questionToken; + if (ts2.isThisIdentifier(node.name)) { + node.transformFlags = 1; + } else { + node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.questionToken); + if (questionToken) + node.transformFlags |= 1; + if (ts2.modifiersToFlags(node.modifiers) & 16476) + node.transformFlags |= 8192; + if (initializer || dotDotDotToken) + node.transformFlags |= 1024; + } + return node; + } + function updateParameterDeclaration(node, modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 || node.initializer !== initializer ? update2(createParameterDeclaration(modifiers, dotDotDotToken, name2, questionToken, type3, initializer), node) : node; + } + function createDecorator(expression) { + var node = createBaseNode( + 167 + /* SyntaxKind.Decorator */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1 | 8192 | 33554432; + return node; + } + function updateDecorator(node, expression) { + return node.expression !== expression ? update2(createDecorator(expression), node) : node; + } + function createPropertySignature(modifiers, name2, questionToken, type3) { + var node = createBaseNamedDeclaration(168, modifiers, name2); + node.type = type3; + node.questionToken = questionToken; + node.transformFlags = 1; + node.initializer = void 0; + return node; + } + function updatePropertySignature(node, modifiers, name2, questionToken, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 ? finishUpdatePropertySignature(createPropertySignature(modifiers, name2, questionToken, type3), node) : node; + } + function finishUpdatePropertySignature(updated, original) { + if (updated !== original) { + updated.initializer = original.initializer; + } + return update2(updated, original); + } + function createPropertyDeclaration(modifiers, name2, questionOrExclamationToken, type3, initializer) { + var node = createBaseVariableLikeDeclaration(169, modifiers, name2, type3, initializer); + node.questionToken = questionOrExclamationToken && ts2.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; + node.exclamationToken = questionOrExclamationToken && ts2.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; + node.transformFlags |= propagateChildFlags(node.questionToken) | propagateChildFlags(node.exclamationToken) | 16777216; + if (ts2.isComputedPropertyName(node.name) || ts2.hasStaticModifier(node) && node.initializer) { + node.transformFlags |= 8192; + } + if (questionOrExclamationToken || ts2.modifiersToFlags(node.modifiers) & 2) { + node.transformFlags |= 1; + } + return node; + } + function updatePropertyDeclaration(node, modifiers, name2, questionOrExclamationToken, type3, initializer) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== (questionOrExclamationToken !== void 0 && ts2.isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && ts2.isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type3 || node.initializer !== initializer ? update2(createPropertyDeclaration(modifiers, name2, questionOrExclamationToken, type3, initializer), node) : node; + } + function createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3) { + var node = createBaseSignatureDeclaration(170, modifiers, name2, typeParameters, parameters, type3); + node.questionToken = questionToken; + node.transformFlags = 1; + return node; + } + function updateMethodSignature(node, modifiers, name2, questionToken, typeParameters, parameters, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3), node) : node; + } + function createMethodDeclaration(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + var node = createBaseFunctionLikeDeclaration(171, modifiers, name2, typeParameters, parameters, type3, body); + node.asteriskToken = asteriskToken; + node.questionToken = questionToken; + node.transformFlags |= propagateChildFlags(node.asteriskToken) | propagateChildFlags(node.questionToken) | 1024; + if (questionToken) { + node.transformFlags |= 1; + } + if (ts2.modifiersToFlags(node.modifiers) & 512) { + if (asteriskToken) { + node.transformFlags |= 128; + } else { + node.transformFlags |= 256; + } + } else if (asteriskToken) { + node.transformFlags |= 2048; + } + node.exclamationToken = void 0; + return node; + } + function updateMethodDeclaration(node, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name2 || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateMethodDeclaration(createMethodDeclaration(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body), node) : node; + } + function finishUpdateMethodDeclaration(updated, original) { + if (updated !== original) { + updated.exclamationToken = original.exclamationToken; + } + return update2(updated, original); + } + function createClassStaticBlockDeclaration(body) { + var node = createBaseGenericNamedDeclaration( + 172, + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0 + ); + node.body = body; + node.transformFlags = propagateChildFlags(body) | 16777216; + node.illegalDecorators = void 0; + node.modifiers = void 0; + return node; + } + function updateClassStaticBlockDeclaration(node, body) { + return node.body !== body ? finishUpdateClassStaticBlockDeclaration(createClassStaticBlockDeclaration(body), node) : node; + } + function finishUpdateClassStaticBlockDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + updated.modifiers = original.modifiers; + } + return update2(updated, original); + } + function createConstructorDeclaration(modifiers, parameters, body) { + var node = createBaseFunctionLikeDeclaration( + 173, + modifiers, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + node.transformFlags |= 1024; + node.illegalDecorators = void 0; + node.typeParameters = void 0; + node.type = void 0; + return node; + } + function updateConstructorDeclaration(node, modifiers, parameters, body) { + return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node; + } + function finishUpdateConstructorDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + updated.typeParameters = original.typeParameters; + updated.type = original.type; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createGetAccessorDeclaration(modifiers, name2, parameters, type3, body) { + var node = createBaseFunctionLikeDeclaration( + 174, + modifiers, + name2, + /*typeParameters*/ + void 0, + parameters, + type3, + body + ); + node.typeParameters = void 0; + return node; + } + function updateGetAccessorDeclaration(node, modifiers, name2, parameters, type3, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateGetAccessorDeclaration(createGetAccessorDeclaration(modifiers, name2, parameters, type3, body), node) : node; + } + function finishUpdateGetAccessorDeclaration(updated, original) { + if (updated !== original) { + updated.typeParameters = original.typeParameters; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createSetAccessorDeclaration(modifiers, name2, parameters, body) { + var node = createBaseFunctionLikeDeclaration( + 175, + modifiers, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + node.typeParameters = void 0; + node.type = void 0; + return node; + } + function updateSetAccessorDeclaration(node, modifiers, name2, parameters, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.parameters !== parameters || node.body !== body ? finishUpdateSetAccessorDeclaration(createSetAccessorDeclaration(modifiers, name2, parameters, body), node) : node; + } + function finishUpdateSetAccessorDeclaration(updated, original) { + if (updated !== original) { + updated.typeParameters = original.typeParameters; + updated.type = original.type; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createCallSignature(typeParameters, parameters, type3) { + var node = createBaseSignatureDeclaration( + 176, + /*modifiers*/ + void 0, + /*name*/ + void 0, + typeParameters, + parameters, + type3 + ); + node.transformFlags = 1; + return node; + } + function updateCallSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type3), node) : node; + } + function createConstructSignature(typeParameters, parameters, type3) { + var node = createBaseSignatureDeclaration( + 177, + /*modifiers*/ + void 0, + /*name*/ + void 0, + typeParameters, + parameters, + type3 + ); + node.transformFlags = 1; + return node; + } + function updateConstructSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type3), node) : node; + } + function createIndexSignature(modifiers, parameters, type3) { + var node = createBaseSignatureDeclaration( + 178, + modifiers, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + type3 + ); + node.transformFlags = 1; + return node; + } + function updateIndexSignature(node, modifiers, parameters, type3) { + return node.parameters !== parameters || node.type !== type3 || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type3), node) : node; + } + function createTemplateLiteralTypeSpan(type3, literal) { + var node = createBaseNode( + 201 + /* SyntaxKind.TemplateLiteralTypeSpan */ + ); + node.type = type3; + node.literal = literal; + node.transformFlags = 1; + return node; + } + function updateTemplateLiteralTypeSpan(node, type3, literal) { + return node.type !== type3 || node.literal !== literal ? update2(createTemplateLiteralTypeSpan(type3, literal), node) : node; + } + function createKeywordTypeNode(kind) { + return createToken(kind); + } + function createTypePredicateNode(assertsModifier, parameterName, type3) { + var node = createBaseNode( + 179 + /* SyntaxKind.TypePredicate */ + ); + node.assertsModifier = assertsModifier; + node.parameterName = asName(parameterName); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateTypePredicateNode(node, assertsModifier, parameterName, type3) { + return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type3 ? update2(createTypePredicateNode(assertsModifier, parameterName, type3), node) : node; + } + function createTypeReferenceNode(typeName, typeArguments) { + var node = createBaseNode( + 180 + /* SyntaxKind.TypeReference */ + ); + node.typeName = asName(typeName); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); + node.transformFlags = 1; + return node; + } + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName || node.typeArguments !== typeArguments ? update2(createTypeReferenceNode(typeName, typeArguments), node) : node; + } + function createFunctionTypeNode(typeParameters, parameters, type3) { + var node = createBaseSignatureDeclaration( + 181, + /*modifiers*/ + void 0, + /*name*/ + void 0, + typeParameters, + parameters, + type3 + ); + node.transformFlags = 1; + node.modifiers = void 0; + return node; + } + function updateFunctionTypeNode(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type3), node) : node; + } + function finishUpdateFunctionTypeNode(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createConstructorTypeNode() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 4 ? createConstructorTypeNode1.apply(void 0, args) : args.length === 3 ? createConstructorTypeNode2.apply(void 0, args) : ts2.Debug.fail("Incorrect number of arguments specified."); + } + function createConstructorTypeNode1(modifiers, typeParameters, parameters, type3) { + var node = createBaseSignatureDeclaration( + 182, + modifiers, + /*name*/ + void 0, + typeParameters, + parameters, + type3 + ); + node.transformFlags = 1; + return node; + } + function createConstructorTypeNode2(typeParameters, parameters, type3) { + return createConstructorTypeNode1( + /*modifiers*/ + void 0, + typeParameters, + parameters, + type3 + ); + } + function updateConstructorTypeNode() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return args.length === 5 ? updateConstructorTypeNode1.apply(void 0, args) : args.length === 4 ? updateConstructorTypeNode2.apply(void 0, args) : ts2.Debug.fail("Incorrect number of arguments specified."); + } + function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type3) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type3), node) : node; + } + function updateConstructorTypeNode2(node, typeParameters, parameters, type3) { + return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type3); + } + function createTypeQueryNode(exprName, typeArguments) { + var node = createBaseNode( + 183 + /* SyntaxKind.TypeQuery */ + ); + node.exprName = exprName; + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.transformFlags = 1; + return node; + } + function updateTypeQueryNode(node, exprName, typeArguments) { + return node.exprName !== exprName || node.typeArguments !== typeArguments ? update2(createTypeQueryNode(exprName, typeArguments), node) : node; + } + function createTypeLiteralNode(members) { + var node = createBaseNode( + 184 + /* SyntaxKind.TypeLiteral */ + ); + node.members = createNodeArray(members); + node.transformFlags = 1; + return node; + } + function updateTypeLiteralNode(node, members) { + return node.members !== members ? update2(createTypeLiteralNode(members), node) : node; + } + function createArrayTypeNode(elementType) { + var node = createBaseNode( + 185 + /* SyntaxKind.ArrayType */ + ); + node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); + node.transformFlags = 1; + return node; + } + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType ? update2(createArrayTypeNode(elementType), node) : node; + } + function createTupleTypeNode(elements) { + var node = createBaseNode( + 186 + /* SyntaxKind.TupleType */ + ); + node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); + node.transformFlags = 1; + return node; + } + function updateTupleTypeNode(node, elements) { + return node.elements !== elements ? update2(createTupleTypeNode(elements), node) : node; + } + function createNamedTupleMember(dotDotDotToken, name2, questionToken, type3) { + var node = createBaseNode( + 199 + /* SyntaxKind.NamedTupleMember */ + ); + node.dotDotDotToken = dotDotDotToken; + node.name = name2; + node.questionToken = questionToken; + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateNamedTupleMember(node, dotDotDotToken, name2, questionToken, type3) { + return node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 ? update2(createNamedTupleMember(dotDotDotToken, name2, questionToken, type3), node) : node; + } + function createOptionalTypeNode(type3) { + var node = createBaseNode( + 187 + /* SyntaxKind.OptionalType */ + ); + node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type3); + node.transformFlags = 1; + return node; + } + function updateOptionalTypeNode(node, type3) { + return node.type !== type3 ? update2(createOptionalTypeNode(type3), node) : node; + } + function createRestTypeNode(type3) { + var node = createBaseNode( + 188 + /* SyntaxKind.RestType */ + ); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateRestTypeNode(node, type3) { + return node.type !== type3 ? update2(createRestTypeNode(type3), node) : node; + } + function createUnionOrIntersectionTypeNode(kind, types3, parenthesize) { + var node = createBaseNode(kind); + node.types = factory.createNodeArray(parenthesize(types3)); + node.transformFlags = 1; + return node; + } + function updateUnionOrIntersectionTypeNode(node, types3, parenthesize) { + return node.types !== types3 ? update2(createUnionOrIntersectionTypeNode(node.kind, types3, parenthesize), node) : node; + } + function createUnionTypeNode(types3) { + return createUnionOrIntersectionTypeNode(189, types3, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + } + function updateUnionTypeNode(node, types3) { + return updateUnionOrIntersectionTypeNode(node, types3, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + } + function createIntersectionTypeNode(types3) { + return createUnionOrIntersectionTypeNode(190, types3, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + } + function updateIntersectionTypeNode(node, types3) { + return updateUnionOrIntersectionTypeNode(node, types3, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createBaseNode( + 191 + /* SyntaxKind.ConditionalType */ + ); + node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); + node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); + node.trueType = trueType; + node.falseType = falseType; + node.transformFlags = 1; + return node; + } + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update2(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; + } + function createInferTypeNode(typeParameter) { + var node = createBaseNode( + 192 + /* SyntaxKind.InferType */ + ); + node.typeParameter = typeParameter; + node.transformFlags = 1; + return node; + } + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter ? update2(createInferTypeNode(typeParameter), node) : node; + } + function createTemplateLiteralType(head2, templateSpans) { + var node = createBaseNode( + 200 + /* SyntaxKind.TemplateLiteralType */ + ); + node.head = head2; + node.templateSpans = createNodeArray(templateSpans); + node.transformFlags = 1; + return node; + } + function updateTemplateLiteralType(node, head2, templateSpans) { + return node.head !== head2 || node.templateSpans !== templateSpans ? update2(createTemplateLiteralType(head2, templateSpans), node) : node; + } + function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf) { + if (isTypeOf === void 0) { + isTypeOf = false; + } + var node = createBaseNode( + 202 + /* SyntaxKind.ImportType */ + ); + node.argument = argument; + node.assertions = assertions; + node.qualifier = qualifier; + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.isTypeOf = isTypeOf; + node.transformFlags = 1; + return node; + } + function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf) { + if (isTypeOf === void 0) { + isTypeOf = node.isTypeOf; + } + return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update2(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; + } + function createParenthesizedType(type3) { + var node = createBaseNode( + 193 + /* SyntaxKind.ParenthesizedType */ + ); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateParenthesizedType(node, type3) { + return node.type !== type3 ? update2(createParenthesizedType(type3), node) : node; + } + function createThisTypeNode() { + var node = createBaseNode( + 194 + /* SyntaxKind.ThisType */ + ); + node.transformFlags = 1; + return node; + } + function createTypeOperatorNode(operator, type3) { + var node = createBaseNode( + 195 + /* SyntaxKind.TypeOperator */ + ); + node.operator = operator; + node.type = operator === 146 ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type3) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type3); + node.transformFlags = 1; + return node; + } + function updateTypeOperatorNode(node, type3) { + return node.type !== type3 ? update2(createTypeOperatorNode(node.operator, type3), node) : node; + } + function createIndexedAccessTypeNode(objectType2, indexType) { + var node = createBaseNode( + 196 + /* SyntaxKind.IndexedAccessType */ + ); + node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType2); + node.indexType = indexType; + node.transformFlags = 1; + return node; + } + function updateIndexedAccessTypeNode(node, objectType2, indexType) { + return node.objectType !== objectType2 || node.indexType !== indexType ? update2(createIndexedAccessTypeNode(objectType2, indexType), node) : node; + } + function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members) { + var node = createBaseNode( + 197 + /* SyntaxKind.MappedType */ + ); + node.readonlyToken = readonlyToken; + node.typeParameter = typeParameter; + node.nameType = nameType; + node.questionToken = questionToken; + node.type = type3; + node.members = members && createNodeArray(members); + node.transformFlags = 1; + return node; + } + function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type3, members) { + return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type3 || node.members !== members ? update2(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members), node) : node; + } + function createLiteralTypeNode(literal) { + var node = createBaseNode( + 198 + /* SyntaxKind.LiteralType */ + ); + node.literal = literal; + node.transformFlags = 1; + return node; + } + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal ? update2(createLiteralTypeNode(literal), node) : node; + } + function createObjectBindingPattern(elements) { + var node = createBaseNode( + 203 + /* SyntaxKind.ObjectBindingPattern */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 | 524288; + if (node.transformFlags & 32768) { + node.transformFlags |= 128 | 65536; + } + return node; + } + function updateObjectBindingPattern(node, elements) { + return node.elements !== elements ? update2(createObjectBindingPattern(elements), node) : node; + } + function createArrayBindingPattern(elements) { + var node = createBaseNode( + 204 + /* SyntaxKind.ArrayBindingPattern */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 | 524288; + return node; + } + function updateArrayBindingPattern(node, elements) { + return node.elements !== elements ? update2(createArrayBindingPattern(elements), node) : node; + } + function createBindingElement(dotDotDotToken, propertyName, name2, initializer) { + var node = createBaseBindingLikeDeclaration( + 205, + /*modifiers*/ + void 0, + name2, + initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer) + ); + node.propertyName = asName(propertyName); + node.dotDotDotToken = dotDotDotToken; + node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | 1024; + if (node.propertyName) { + node.transformFlags |= ts2.isIdentifier(node.propertyName) ? propagateIdentifierNameFlags(node.propertyName) : propagateChildFlags(node.propertyName); + } + if (dotDotDotToken) + node.transformFlags |= 32768; + return node; + } + function updateBindingElement(node, dotDotDotToken, propertyName, name2, initializer) { + return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.initializer !== initializer ? update2(createBindingElement(dotDotDotToken, propertyName, name2, initializer), node) : node; + } + function createBaseExpression(kind) { + var node = createBaseNode(kind); + return node; + } + function createArrayLiteralExpression(elements, multiLine) { + var node = createBaseExpression( + 206 + /* SyntaxKind.ArrayLiteralExpression */ + ); + var lastElement = elements && ts2.lastOrUndefined(elements); + var elementsArray = createNodeArray(elements, lastElement && ts2.isOmittedExpression(lastElement) ? true : void 0); + node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.elements); + return node; + } + function updateArrayLiteralExpression(node, elements) { + return node.elements !== elements ? update2(createArrayLiteralExpression(elements, node.multiLine), node) : node; + } + function createObjectLiteralExpression(properties, multiLine) { + var node = createBaseExpression( + 207 + /* SyntaxKind.ObjectLiteralExpression */ + ); + node.properties = createNodeArray(properties); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.properties); + return node; + } + function updateObjectLiteralExpression(node, properties) { + return node.properties !== properties ? update2(createObjectLiteralExpression(properties, node.multiLine), node) : node; + } + function createPropertyAccessExpression(expression, name2) { + var node = createBaseExpression( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.name = asName(name2); + node.transformFlags = propagateChildFlags(node.expression) | (ts2.isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912); + if (ts2.isSuperKeyword(expression)) { + node.transformFlags |= 256 | 128; + } + return node; + } + function updatePropertyAccessExpression(node, expression, name2) { + if (ts2.isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, ts2.cast(name2, ts2.isIdentifier)); + } + return node.expression !== expression || node.name !== name2 ? update2(createPropertyAccessExpression(expression, name2), node) : node; + } + function createPropertyAccessChain(expression, questionDotToken, name2) { + var node = createBaseExpression( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + node.flags |= 32; + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ); + node.questionDotToken = questionDotToken; + node.name = asName(name2); + node.transformFlags |= 32 | propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (ts2.isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912); + return node; + } + function updatePropertyAccessChain(node, expression, questionDotToken, name2) { + ts2.Debug.assert(!!(node.flags & 32), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name2 ? update2(createPropertyAccessChain(expression, questionDotToken, name2), node) : node; + } + function createElementAccessExpression(expression, index4) { + var node = createBaseExpression( + 209 + /* SyntaxKind.ElementAccessExpression */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.argumentExpression = asExpression(index4); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression); + if (ts2.isSuperKeyword(expression)) { + node.transformFlags |= 256 | 128; + } + return node; + } + function updateElementAccessExpression(node, expression, argumentExpression) { + if (ts2.isElementAccessChain(node)) { + return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); + } + return node.expression !== expression || node.argumentExpression !== argumentExpression ? update2(createElementAccessExpression(expression, argumentExpression), node) : node; + } + function createElementAccessChain(expression, questionDotToken, index4) { + var node = createBaseExpression( + 209 + /* SyntaxKind.ElementAccessExpression */ + ); + node.flags |= 32; + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ); + node.questionDotToken = questionDotToken; + node.argumentExpression = asExpression(index4); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression) | 32; + return node; + } + function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { + ts2.Debug.assert(!!(node.flags & 32), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update2(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; + } + function createCallExpression(expression, typeArguments, argumentsArray) { + var node = createBaseExpression( + 210 + /* SyntaxKind.CallExpression */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments); + if (node.typeArguments) { + node.transformFlags |= 1; + } + if (ts2.isImportKeyword(node.expression)) { + node.transformFlags |= 8388608; + } else if (ts2.isSuperProperty(node.expression)) { + node.transformFlags |= 16384; + } + return node; + } + function updateCallExpression(node, expression, typeArguments, argumentsArray) { + if (ts2.isCallChain(node)) { + return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); + } + return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createCallExpression(expression, typeArguments, argumentsArray), node) : node; + } + function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { + var node = createBaseExpression( + 210 + /* SyntaxKind.CallExpression */ + ); + node.flags |= 32; + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ); + node.questionDotToken = questionDotToken; + node.typeArguments = asNodeArray(typeArguments); + node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32; + if (node.typeArguments) { + node.transformFlags |= 1; + } + if (ts2.isSuperProperty(node.expression)) { + node.transformFlags |= 16384; + } + return node; + } + function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { + ts2.Debug.assert(!!(node.flags & 32), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; + } + function createNewExpression(expression, typeArguments, argumentsArray) { + var node = createBaseExpression( + 211 + /* SyntaxKind.NewExpression */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32; + if (node.typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateNewExpression(node, expression, typeArguments, argumentsArray) { + return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createNewExpression(expression, typeArguments, argumentsArray), node) : node; + } + function createTaggedTemplateExpression(tag, typeArguments, template2) { + var node = createBaseExpression( + 212 + /* SyntaxKind.TaggedTemplateExpression */ + ); + node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( + tag, + /*optionalChain*/ + false + ); + node.typeArguments = asNodeArray(typeArguments); + node.template = template2; + node.transformFlags |= propagateChildFlags(node.tag) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.template) | 1024; + if (node.typeArguments) { + node.transformFlags |= 1; + } + if (ts2.hasInvalidEscape(node.template)) { + node.transformFlags |= 128; + } + return node; + } + function updateTaggedTemplateExpression(node, tag, typeArguments, template2) { + return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template2 ? update2(createTaggedTemplateExpression(tag, typeArguments, template2), node) : node; + } + function createTypeAssertion(type3, expression) { + var node = createBaseExpression( + 213 + /* SyntaxKind.TypeAssertionExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateTypeAssertion(node, type3, expression) { + return node.type !== type3 || node.expression !== expression ? update2(createTypeAssertion(type3, expression), node) : node; + } + function createParenthesizedExpression(expression) { + var node = createBaseExpression( + 214 + /* SyntaxKind.ParenthesizedExpression */ + ); + node.expression = expression; + node.transformFlags = propagateChildFlags(node.expression); + return node; + } + function updateParenthesizedExpression(node, expression) { + return node.expression !== expression ? update2(createParenthesizedExpression(expression), node) : node; + } + function createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + var node = createBaseFunctionLikeDeclaration(215, modifiers, name2, typeParameters, parameters, type3, body); + node.asteriskToken = asteriskToken; + node.transformFlags |= propagateChildFlags(node.asteriskToken); + if (node.typeParameters) { + node.transformFlags |= 1; + } + if (ts2.modifiersToFlags(node.modifiers) & 512) { + if (node.asteriskToken) { + node.transformFlags |= 128; + } else { + node.transformFlags |= 256; + } + } else if (node.asteriskToken) { + node.transformFlags |= 2048; + } + return node; + } + function updateFunctionExpression(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return node.name !== name2 || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body), node) : node; + } + function createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body) { + var node = createBaseFunctionLikeDeclaration( + 216, + modifiers, + /*name*/ + void 0, + typeParameters, + parameters, + type3, + parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body) + ); + node.equalsGreaterThanToken = equalsGreaterThanToken !== null && equalsGreaterThanToken !== void 0 ? equalsGreaterThanToken : createToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ); + node.transformFlags |= propagateChildFlags(node.equalsGreaterThanToken) | 1024; + if (ts2.modifiersToFlags(node.modifiers) & 512) { + node.transformFlags |= 256 | 16384; + } + return node; + } + function updateArrowFunction(node, modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body), node) : node; + } + function createDeleteExpression(expression) { + var node = createBaseExpression( + 217 + /* SyntaxKind.DeleteExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateDeleteExpression(node, expression) { + return node.expression !== expression ? update2(createDeleteExpression(expression), node) : node; + } + function createTypeOfExpression(expression) { + var node = createBaseExpression( + 218 + /* SyntaxKind.TypeOfExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateTypeOfExpression(node, expression) { + return node.expression !== expression ? update2(createTypeOfExpression(expression), node) : node; + } + function createVoidExpression(expression) { + var node = createBaseExpression( + 219 + /* SyntaxKind.VoidExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateVoidExpression(node, expression) { + return node.expression !== expression ? update2(createVoidExpression(expression), node) : node; + } + function createAwaitExpression(expression) { + var node = createBaseExpression( + 220 + /* SyntaxKind.AwaitExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 256 | 128 | 2097152; + return node; + } + function updateAwaitExpression(node, expression) { + return node.expression !== expression ? update2(createAwaitExpression(expression), node) : node; + } + function createPrefixUnaryExpression(operator, operand) { + var node = createBaseExpression( + 221 + /* SyntaxKind.PrefixUnaryExpression */ + ); + node.operator = operator; + node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); + node.transformFlags |= propagateChildFlags(node.operand); + if ((operator === 45 || operator === 46) && ts2.isIdentifier(node.operand) && !ts2.isGeneratedIdentifier(node.operand) && !ts2.isLocalName(node.operand)) { + node.transformFlags |= 268435456; + } + return node; + } + function updatePrefixUnaryExpression(node, operand) { + return node.operand !== operand ? update2(createPrefixUnaryExpression(node.operator, operand), node) : node; + } + function createPostfixUnaryExpression(operand, operator) { + var node = createBaseExpression( + 222 + /* SyntaxKind.PostfixUnaryExpression */ + ); + node.operator = operator; + node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); + node.transformFlags |= propagateChildFlags(node.operand); + if (ts2.isIdentifier(node.operand) && !ts2.isGeneratedIdentifier(node.operand) && !ts2.isLocalName(node.operand)) { + node.transformFlags |= 268435456; + } + return node; + } + function updatePostfixUnaryExpression(node, operand) { + return node.operand !== operand ? update2(createPostfixUnaryExpression(operand, node.operator), node) : node; + } + function createBinaryExpression(left, operator, right) { + var node = createBaseExpression( + 223 + /* SyntaxKind.BinaryExpression */ + ); + var operatorToken = asToken(operator); + var operatorKind = operatorToken.kind; + node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); + node.operatorToken = operatorToken; + node.right = parenthesizerRules().parenthesizeRightSideOfBinary(operatorKind, node.left, right); + node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.operatorToken) | propagateChildFlags(node.right); + if (operatorKind === 60) { + node.transformFlags |= 32; + } else if (operatorKind === 63) { + if (ts2.isObjectLiteralExpression(node.left)) { + node.transformFlags |= 1024 | 128 | 4096 | propagateAssignmentPatternFlags(node.left); + } else if (ts2.isArrayLiteralExpression(node.left)) { + node.transformFlags |= 1024 | 4096 | propagateAssignmentPatternFlags(node.left); + } + } else if (operatorKind === 42 || operatorKind === 67) { + node.transformFlags |= 512; + } else if (ts2.isLogicalOrCoalescingAssignmentOperator(operatorKind)) { + node.transformFlags |= 16; + } + if (operatorKind === 101 && ts2.isPrivateIdentifier(node.left)) { + node.transformFlags |= 536870912; + } + return node; + } + function propagateAssignmentPatternFlags(node) { + if (node.transformFlags & 65536) + return 65536; + if (node.transformFlags & 128) { + for (var _i = 0, _a2 = ts2.getElementsOfBindingOrAssignmentPattern(node); _i < _a2.length; _i++) { + var element = _a2[_i]; + var target = ts2.getTargetOfBindingOrAssignmentElement(element); + if (target && ts2.isAssignmentPattern(target)) { + if (target.transformFlags & 65536) { + return 65536; + } + if (target.transformFlags & 128) { + var flags_1 = propagateAssignmentPatternFlags(target); + if (flags_1) + return flags_1; + } + } + } + } + return 0; + } + function updateBinaryExpression(node, left, operator, right) { + return node.left !== left || node.operatorToken !== operator || node.right !== right ? update2(createBinaryExpression(left, operator, right), node) : node; + } + function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { + var node = createBaseExpression( + 224 + /* SyntaxKind.ConditionalExpression */ + ); + node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); + node.questionToken = questionToken !== null && questionToken !== void 0 ? questionToken : createToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); + node.colonToken = colonToken !== null && colonToken !== void 0 ? colonToken : createToken( + 58 + /* SyntaxKind.ColonToken */ + ); + node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); + node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); + return node; + } + function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { + return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update2(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; + } + function createTemplateExpression(head2, templateSpans) { + var node = createBaseExpression( + 225 + /* SyntaxKind.TemplateExpression */ + ); + node.head = head2; + node.templateSpans = createNodeArray(templateSpans); + node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024; + return node; + } + function updateTemplateExpression(node, head2, templateSpans) { + return node.head !== head2 || node.templateSpans !== templateSpans ? update2(createTemplateExpression(head2, templateSpans), node) : node; + } + function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags) { + if (templateFlags === void 0) { + templateFlags = 0; + } + ts2.Debug.assert(!(templateFlags & ~2048), "Unsupported template flags."); + var cooked = void 0; + if (rawText !== void 0 && rawText !== text) { + cooked = getCookedText(kind, rawText); + if (typeof cooked === "object") { + return ts2.Debug.fail("Invalid raw text"); + } + } + if (text === void 0) { + if (cooked === void 0) { + return ts2.Debug.fail("Arguments 'text' and 'rawText' may not both be undefined."); + } + text = cooked; + } else if (cooked !== void 0) { + ts2.Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'."); + } + return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags); + } + function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) { + var node = createBaseToken(kind); + node.text = text; + node.rawText = rawText; + node.templateFlags = templateFlags & 2048; + node.transformFlags |= 1024; + if (node.templateFlags) { + node.transformFlags |= 128; + } + return node; + } + function createTemplateHead(text, rawText, templateFlags) { + return createTemplateLiteralLikeNodeChecked(15, text, rawText, templateFlags); + } + function createTemplateMiddle(text, rawText, templateFlags) { + return createTemplateLiteralLikeNodeChecked(16, text, rawText, templateFlags); + } + function createTemplateTail(text, rawText, templateFlags) { + return createTemplateLiteralLikeNodeChecked(17, text, rawText, templateFlags); + } + function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { + return createTemplateLiteralLikeNodeChecked(14, text, rawText, templateFlags); + } + function createYieldExpression(asteriskToken, expression) { + ts2.Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); + var node = createBaseExpression( + 226 + /* SyntaxKind.YieldExpression */ + ); + node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.asteriskToken = asteriskToken; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 | 128 | 1048576; + return node; + } + function updateYieldExpression(node, asteriskToken, expression) { + return node.expression !== expression || node.asteriskToken !== asteriskToken ? update2(createYieldExpression(asteriskToken, expression), node) : node; + } + function createSpreadElement(expression) { + var node = createBaseExpression( + 227 + /* SyntaxKind.SpreadElement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 1024 | 32768; + return node; + } + function updateSpreadElement(node, expression) { + return node.expression !== expression ? update2(createSpreadElement(expression), node) : node; + } + function createClassExpression(modifiers, name2, typeParameters, heritageClauses, members) { + var node = createBaseClassLikeDeclaration(228, modifiers, name2, typeParameters, heritageClauses, members); + node.transformFlags |= 1024; + return node; + } + function updateClassExpression(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update2(createClassExpression(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function createOmittedExpression() { + return createBaseExpression( + 229 + /* SyntaxKind.OmittedExpression */ + ); + } + function createExpressionWithTypeArguments(expression, typeArguments) { + var node = createBaseNode( + 230 + /* SyntaxKind.ExpressionWithTypeArguments */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024; + return node; + } + function updateExpressionWithTypeArguments(node, expression, typeArguments) { + return node.expression !== expression || node.typeArguments !== typeArguments ? update2(createExpressionWithTypeArguments(expression, typeArguments), node) : node; + } + function createAsExpression(expression, type3) { + var node = createBaseExpression( + 231 + /* SyntaxKind.AsExpression */ + ); + node.expression = expression; + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateAsExpression(node, expression, type3) { + return node.expression !== expression || node.type !== type3 ? update2(createAsExpression(expression, type3), node) : node; + } + function createNonNullExpression(expression) { + var node = createBaseExpression( + 232 + /* SyntaxKind.NonNullExpression */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1; + return node; + } + function updateNonNullExpression(node, expression) { + if (ts2.isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } + return node.expression !== expression ? update2(createNonNullExpression(expression), node) : node; + } + function createSatisfiesExpression(expression, type3) { + var node = createBaseExpression( + 235 + /* SyntaxKind.SatisfiesExpression */ + ); + node.expression = expression; + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateSatisfiesExpression(node, expression, type3) { + return node.expression !== expression || node.type !== type3 ? update2(createSatisfiesExpression(expression, type3), node) : node; + } + function createNonNullChain(expression) { + var node = createBaseExpression( + 232 + /* SyntaxKind.NonNullExpression */ + ); + node.flags |= 32; + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1; + return node; + } + function updateNonNullChain(node, expression) { + ts2.Debug.assert(!!(node.flags & 32), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression ? update2(createNonNullChain(expression), node) : node; + } + function createMetaProperty(keywordToken, name2) { + var node = createBaseExpression( + 233 + /* SyntaxKind.MetaProperty */ + ); + node.keywordToken = keywordToken; + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name); + switch (keywordToken) { + case 103: + node.transformFlags |= 1024; + break; + case 100: + node.transformFlags |= 4; + break; + default: + return ts2.Debug.assertNever(keywordToken); + } + return node; + } + function updateMetaProperty(node, name2) { + return node.name !== name2 ? update2(createMetaProperty(node.keywordToken, name2), node) : node; + } + function createTemplateSpan(expression, literal) { + var node = createBaseNode( + 236 + /* SyntaxKind.TemplateSpan */ + ); + node.expression = expression; + node.literal = literal; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024; + return node; + } + function updateTemplateSpan(node, expression, literal) { + return node.expression !== expression || node.literal !== literal ? update2(createTemplateSpan(expression, literal), node) : node; + } + function createSemicolonClassElement() { + var node = createBaseNode( + 237 + /* SyntaxKind.SemicolonClassElement */ + ); + node.transformFlags |= 1024; + return node; + } + function createBlock(statements, multiLine) { + var node = createBaseNode( + 238 + /* SyntaxKind.Block */ + ); + node.statements = createNodeArray(statements); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.statements); + return node; + } + function updateBlock(node, statements) { + return node.statements !== statements ? update2(createBlock(statements, node.multiLine), node) : node; + } + function createVariableStatement(modifiers, declarationList) { + var node = createBaseDeclaration( + 240 + /* SyntaxKind.VariableStatement */ + ); + node.modifiers = asNodeArray(modifiers); + node.declarationList = ts2.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); + if (ts2.modifiersToFlags(node.modifiers) & 2) { + node.transformFlags = 1; + } + return node; + } + function updateVariableStatement(node, modifiers, declarationList) { + return node.modifiers !== modifiers || node.declarationList !== declarationList ? update2(createVariableStatement(modifiers, declarationList), node) : node; + } + function createEmptyStatement() { + return createBaseNode( + 239 + /* SyntaxKind.EmptyStatement */ + ); + } + function createExpressionStatement(expression) { + var node = createBaseNode( + 241 + /* SyntaxKind.ExpressionStatement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateExpressionStatement(node, expression) { + return node.expression !== expression ? update2(createExpressionStatement(expression), node) : node; + } + function createIfStatement(expression, thenStatement, elseStatement) { + var node = createBaseNode( + 242 + /* SyntaxKind.IfStatement */ + ); + node.expression = expression; + node.thenStatement = asEmbeddedStatement(thenStatement); + node.elseStatement = asEmbeddedStatement(elseStatement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); + return node; + } + function updateIfStatement(node, expression, thenStatement, elseStatement) { + return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update2(createIfStatement(expression, thenStatement, elseStatement), node) : node; + } + function createDoStatement(statement, expression) { + var node = createBaseNode( + 243 + /* SyntaxKind.DoStatement */ + ); + node.statement = asEmbeddedStatement(statement); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); + return node; + } + function updateDoStatement(node, statement, expression) { + return node.statement !== statement || node.expression !== expression ? update2(createDoStatement(statement, expression), node) : node; + } + function createWhileStatement(expression, statement) { + var node = createBaseNode( + 244 + /* SyntaxKind.WhileStatement */ + ); + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + return node; + } + function updateWhileStatement(node, expression, statement) { + return node.expression !== expression || node.statement !== statement ? update2(createWhileStatement(expression, statement), node) : node; + } + function createForStatement(initializer, condition, incrementor, statement) { + var node = createBaseNode( + 245 + /* SyntaxKind.ForStatement */ + ); + node.initializer = initializer; + node.condition = condition; + node.incrementor = incrementor; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); + return node; + } + function updateForStatement(node, initializer, condition, incrementor, statement) { + return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update2(createForStatement(initializer, condition, incrementor, statement), node) : node; + } + function createForInStatement(initializer, expression, statement) { + var node = createBaseNode( + 246 + /* SyntaxKind.ForInStatement */ + ); + node.initializer = initializer; + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + return node; + } + function updateForInStatement(node, initializer, expression, statement) { + return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update2(createForInStatement(initializer, expression, statement), node) : node; + } + function createForOfStatement(awaitModifier, initializer, expression, statement) { + var node = createBaseNode( + 247 + /* SyntaxKind.ForOfStatement */ + ); + node.awaitModifier = awaitModifier; + node.initializer = initializer; + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024; + if (awaitModifier) + node.transformFlags |= 128; + return node; + } + function updateForOfStatement(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update2(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; + } + function createContinueStatement(label) { + var node = createBaseNode( + 248 + /* SyntaxKind.ContinueStatement */ + ); + node.label = asName(label); + node.transformFlags |= propagateChildFlags(node.label) | 4194304; + return node; + } + function updateContinueStatement(node, label) { + return node.label !== label ? update2(createContinueStatement(label), node) : node; + } + function createBreakStatement(label) { + var node = createBaseNode( + 249 + /* SyntaxKind.BreakStatement */ + ); + node.label = asName(label); + node.transformFlags |= propagateChildFlags(node.label) | 4194304; + return node; + } + function updateBreakStatement(node, label) { + return node.label !== label ? update2(createBreakStatement(label), node) : node; + } + function createReturnStatement(expression) { + var node = createBaseNode( + 250 + /* SyntaxKind.ReturnStatement */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression) | 128 | 4194304; + return node; + } + function updateReturnStatement(node, expression) { + return node.expression !== expression ? update2(createReturnStatement(expression), node) : node; + } + function createWithStatement(expression, statement) { + var node = createBaseNode( + 251 + /* SyntaxKind.WithStatement */ + ); + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + return node; + } + function updateWithStatement(node, expression, statement) { + return node.expression !== expression || node.statement !== statement ? update2(createWithStatement(expression, statement), node) : node; + } + function createSwitchStatement(expression, caseBlock) { + var node = createBaseNode( + 252 + /* SyntaxKind.SwitchStatement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.caseBlock = caseBlock; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); + return node; + } + function updateSwitchStatement(node, expression, caseBlock) { + return node.expression !== expression || node.caseBlock !== caseBlock ? update2(createSwitchStatement(expression, caseBlock), node) : node; + } + function createLabeledStatement(label, statement) { + var node = createBaseNode( + 253 + /* SyntaxKind.LabeledStatement */ + ); + node.label = asName(label); + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); + return node; + } + function updateLabeledStatement(node, label, statement) { + return node.label !== label || node.statement !== statement ? update2(createLabeledStatement(label, statement), node) : node; + } + function createThrowStatement(expression) { + var node = createBaseNode( + 254 + /* SyntaxKind.ThrowStatement */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateThrowStatement(node, expression) { + return node.expression !== expression ? update2(createThrowStatement(expression), node) : node; + } + function createTryStatement(tryBlock, catchClause, finallyBlock) { + var node = createBaseNode( + 255 + /* SyntaxKind.TryStatement */ + ); + node.tryBlock = tryBlock; + node.catchClause = catchClause; + node.finallyBlock = finallyBlock; + node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); + return node; + } + function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { + return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update2(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; + } + function createDebuggerStatement() { + return createBaseNode( + 256 + /* SyntaxKind.DebuggerStatement */ + ); + } + function createVariableDeclaration(name2, exclamationToken, type3, initializer) { + var node = createBaseVariableLikeDeclaration( + 257, + /*modifiers*/ + void 0, + name2, + type3, + initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer) + ); + node.exclamationToken = exclamationToken; + node.transformFlags |= propagateChildFlags(node.exclamationToken); + if (exclamationToken) { + node.transformFlags |= 1; + } + return node; + } + function updateVariableDeclaration(node, name2, exclamationToken, type3, initializer) { + return node.name !== name2 || node.type !== type3 || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update2(createVariableDeclaration(name2, exclamationToken, type3, initializer), node) : node; + } + function createVariableDeclarationList(declarations, flags2) { + if (flags2 === void 0) { + flags2 = 0; + } + var node = createBaseNode( + 258 + /* SyntaxKind.VariableDeclarationList */ + ); + node.flags |= flags2 & 3; + node.declarations = createNodeArray(declarations); + node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304; + if (flags2 & 3) { + node.transformFlags |= 1024 | 262144; + } + return node; + } + function updateVariableDeclarationList(node, declarations) { + return node.declarations !== declarations ? update2(createVariableDeclarationList(declarations, node.flags), node) : node; + } + function createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + var node = createBaseFunctionLikeDeclaration(259, modifiers, name2, typeParameters, parameters, type3, body); + node.asteriskToken = asteriskToken; + if (!node.body || ts2.modifiersToFlags(node.modifiers) & 2) { + node.transformFlags = 1; + } else { + node.transformFlags |= propagateChildFlags(node.asteriskToken) | 4194304; + if (ts2.modifiersToFlags(node.modifiers) & 512) { + if (node.asteriskToken) { + node.transformFlags |= 128; + } else { + node.transformFlags |= 256; + } + } else if (node.asteriskToken) { + node.transformFlags |= 2048; + } + } + node.illegalDecorators = void 0; + return node; + } + function updateFunctionDeclaration(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name2 || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body), node) : node; + } + function finishUpdateFunctionDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members) { + var node = createBaseClassLikeDeclaration(260, modifiers, name2, typeParameters, heritageClauses, members); + if (ts2.modifiersToFlags(node.modifiers) & 2) { + node.transformFlags = 1; + } else { + node.transformFlags |= 1024; + if (node.transformFlags & 8192) { + node.transformFlags |= 1; + } + } + return node; + } + function updateClassDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update2(createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members) { + var node = createBaseInterfaceOrClassLikeDeclaration(261, modifiers, name2, typeParameters, heritageClauses); + node.members = createNodeArray(members); + node.transformFlags = 1; + node.illegalDecorators = void 0; + return node; + } + function updateInterfaceDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function finishUpdateInterfaceDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createTypeAliasDeclaration(modifiers, name2, typeParameters, type3) { + var node = createBaseGenericNamedDeclaration(262, modifiers, name2, typeParameters); + node.type = type3; + node.transformFlags = 1; + node.illegalDecorators = void 0; + return node; + } + function updateTypeAliasDeclaration(node, modifiers, name2, typeParameters, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.type !== type3 ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration(modifiers, name2, typeParameters, type3), node) : node; + } + function finishUpdateTypeAliasDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createEnumDeclaration(modifiers, name2, members) { + var node = createBaseNamedDeclaration(263, modifiers, name2); + node.members = createNodeArray(members); + node.transformFlags |= propagateChildrenFlags(node.members) | 1; + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateEnumDeclaration(node, modifiers, name2, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration(modifiers, name2, members), node) : node; + } + function finishUpdateEnumDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createModuleDeclaration(modifiers, name2, body, flags2) { + if (flags2 === void 0) { + flags2 = 0; + } + var node = createBaseDeclaration( + 264 + /* SyntaxKind.ModuleDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.flags |= flags2 & (16 | 4 | 1024); + node.name = name2; + node.body = body; + if (ts2.modifiersToFlags(node.modifiers) & 2) { + node.transformFlags = 1; + } else { + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1; + } + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateModuleDeclaration(node, modifiers, name2, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration(modifiers, name2, body, node.flags), node) : node; + } + function finishUpdateModuleDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createModuleBlock(statements) { + var node = createBaseNode( + 265 + /* SyntaxKind.ModuleBlock */ + ); + node.statements = createNodeArray(statements); + node.transformFlags |= propagateChildrenFlags(node.statements); + return node; + } + function updateModuleBlock(node, statements) { + return node.statements !== statements ? update2(createModuleBlock(statements), node) : node; + } + function createCaseBlock(clauses) { + var node = createBaseNode( + 266 + /* SyntaxKind.CaseBlock */ + ); + node.clauses = createNodeArray(clauses); + node.transformFlags |= propagateChildrenFlags(node.clauses); + return node; + } + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses ? update2(createCaseBlock(clauses), node) : node; + } + function createNamespaceExportDeclaration(name2) { + var node = createBaseNamedDeclaration( + 267, + /*modifiers*/ + void 0, + name2 + ); + node.transformFlags = 1; + node.illegalDecorators = void 0; + node.modifiers = void 0; + return node; + } + function updateNamespaceExportDeclaration(node, name2) { + return node.name !== name2 ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name2), node) : node; + } + function finishUpdateNamespaceExportDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + updated.modifiers = original.modifiers; + } + return update2(updated, original); + } + function createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference) { + var node = createBaseNamedDeclaration(268, modifiers, name2); + node.isTypeOnly = isTypeOnly; + node.moduleReference = moduleReference; + node.transformFlags |= propagateChildFlags(node.moduleReference); + if (!ts2.isExternalModuleReference(node.moduleReference)) + node.transformFlags |= 1; + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name2, moduleReference) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name2 || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference), node) : node; + } + function finishUpdateImportEqualsDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { + var node = createBaseDeclaration( + 269 + /* SyntaxKind.ImportDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.importClause = importClause; + node.moduleSpecifier = moduleSpecifier; + node.assertClause = assertClause; + node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; + } + function finishUpdateImportDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createImportClause(isTypeOnly, name2, namedBindings) { + var node = createBaseNode( + 270 + /* SyntaxKind.ImportClause */ + ); + node.isTypeOnly = isTypeOnly; + node.name = name2; + node.namedBindings = namedBindings; + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); + if (isTypeOnly) { + node.transformFlags |= 1; + } + node.transformFlags &= ~67108864; + return node; + } + function updateImportClause(node, isTypeOnly, name2, namedBindings) { + return node.isTypeOnly !== isTypeOnly || node.name !== name2 || node.namedBindings !== namedBindings ? update2(createImportClause(isTypeOnly, name2, namedBindings), node) : node; + } + function createAssertClause(elements, multiLine) { + var node = createBaseNode( + 296 + /* SyntaxKind.AssertClause */ + ); + node.elements = createNodeArray(elements); + node.multiLine = multiLine; + node.transformFlags |= 4; + return node; + } + function updateAssertClause(node, elements, multiLine) { + return node.elements !== elements || node.multiLine !== multiLine ? update2(createAssertClause(elements, multiLine), node) : node; + } + function createAssertEntry(name2, value2) { + var node = createBaseNode( + 297 + /* SyntaxKind.AssertEntry */ + ); + node.name = name2; + node.value = value2; + node.transformFlags |= 4; + return node; + } + function updateAssertEntry(node, name2, value2) { + return node.name !== name2 || node.value !== value2 ? update2(createAssertEntry(name2, value2), node) : node; + } + function createImportTypeAssertionContainer(clause, multiLine) { + var node = createBaseNode( + 298 + /* SyntaxKind.ImportTypeAssertionContainer */ + ); + node.assertClause = clause; + node.multiLine = multiLine; + return node; + } + function updateImportTypeAssertionContainer(node, clause, multiLine) { + return node.assertClause !== clause || node.multiLine !== multiLine ? update2(createImportTypeAssertionContainer(clause, multiLine), node) : node; + } + function createNamespaceImport(name2) { + var node = createBaseNode( + 271 + /* SyntaxKind.NamespaceImport */ + ); + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + return node; + } + function updateNamespaceImport(node, name2) { + return node.name !== name2 ? update2(createNamespaceImport(name2), node) : node; + } + function createNamespaceExport(name2) { + var node = createBaseNode( + 277 + /* SyntaxKind.NamespaceExport */ + ); + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name) | 4; + node.transformFlags &= ~67108864; + return node; + } + function updateNamespaceExport(node, name2) { + return node.name !== name2 ? update2(createNamespaceExport(name2), node) : node; + } + function createNamedImports(elements) { + var node = createBaseNode( + 272 + /* SyntaxKind.NamedImports */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements); + node.transformFlags &= ~67108864; + return node; + } + function updateNamedImports(node, elements) { + return node.elements !== elements ? update2(createNamedImports(elements), node) : node; + } + function createImportSpecifier(isTypeOnly, propertyName, name2) { + var node = createBaseNode( + 273 + /* SyntaxKind.ImportSpecifier */ + ); + node.isTypeOnly = isTypeOnly; + node.propertyName = propertyName; + node.name = name2; + node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + return node; + } + function updateImportSpecifier(node, isTypeOnly, propertyName, name2) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name2 ? update2(createImportSpecifier(isTypeOnly, propertyName, name2), node) : node; + } + function createExportAssignment(modifiers, isExportEquals, expression) { + var node = createBaseDeclaration( + 274 + /* SyntaxKind.ExportAssignment */ + ); + node.modifiers = asNodeArray(modifiers); + node.isExportEquals = isExportEquals; + node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( + 63, + /*leftSide*/ + void 0, + expression + ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateExportAssignment(node, modifiers, expression) { + return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; + } + function finishUpdateExportAssignment(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + var node = createBaseDeclaration( + 275 + /* SyntaxKind.ExportDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.isTypeOnly = isTypeOnly; + node.exportClause = exportClause; + node.moduleSpecifier = moduleSpecifier; + node.assertClause = assertClause; + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); + node.transformFlags &= ~67108864; + node.illegalDecorators = void 0; + return node; + } + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; + } + function finishUpdateExportDeclaration(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + } + return update2(updated, original); + } + function createNamedExports(elements) { + var node = createBaseNode( + 276 + /* SyntaxKind.NamedExports */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements); + node.transformFlags &= ~67108864; + return node; + } + function updateNamedExports(node, elements) { + return node.elements !== elements ? update2(createNamedExports(elements), node) : node; + } + function createExportSpecifier(isTypeOnly, propertyName, name2) { + var node = createBaseNode( + 278 + /* SyntaxKind.ExportSpecifier */ + ); + node.isTypeOnly = isTypeOnly; + node.propertyName = asName(propertyName); + node.name = asName(name2); + node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + return node; + } + function updateExportSpecifier(node, isTypeOnly, propertyName, name2) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name2 ? update2(createExportSpecifier(isTypeOnly, propertyName, name2), node) : node; + } + function createMissingDeclaration() { + var node = createBaseDeclaration( + 279 + /* SyntaxKind.MissingDeclaration */ + ); + return node; + } + function createExternalModuleReference(expression) { + var node = createBaseNode( + 280 + /* SyntaxKind.ExternalModuleReference */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression); + node.transformFlags &= ~67108864; + return node; + } + function updateExternalModuleReference(node, expression) { + return node.expression !== expression ? update2(createExternalModuleReference(expression), node) : node; + } + function createJSDocPrimaryTypeWorker(kind) { + return createBaseNode(kind); + } + function createJSDocPrePostfixUnaryTypeWorker(kind, type3, postfix) { + if (postfix === void 0) { + postfix = false; + } + var node = createJSDocUnaryTypeWorker(kind, postfix ? type3 && parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(type3) : type3); + node.postfix = postfix; + return node; + } + function createJSDocUnaryTypeWorker(kind, type3) { + var node = createBaseNode(kind); + node.type = type3; + return node; + } + function updateJSDocPrePostfixUnaryTypeWorker(kind, node, type3) { + return node.type !== type3 ? update2(createJSDocPrePostfixUnaryTypeWorker(kind, type3, node.postfix), node) : node; + } + function updateJSDocUnaryTypeWorker(kind, node, type3) { + return node.type !== type3 ? update2(createJSDocUnaryTypeWorker(kind, type3), node) : node; + } + function createJSDocFunctionType(parameters, type3) { + var node = createBaseSignatureDeclaration( + 320, + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + type3 + ); + return node; + } + function updateJSDocFunctionType(node, parameters, type3) { + return node.parameters !== parameters || node.type !== type3 ? update2(createJSDocFunctionType(parameters, type3), node) : node; + } + function createJSDocTypeLiteral(propertyTags, isArrayType) { + if (isArrayType === void 0) { + isArrayType = false; + } + var node = createBaseNode( + 325 + /* SyntaxKind.JSDocTypeLiteral */ + ); + node.jsDocPropertyTags = asNodeArray(propertyTags); + node.isArrayType = isArrayType; + return node; + } + function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { + return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update2(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; + } + function createJSDocTypeExpression(type3) { + var node = createBaseNode( + 312 + /* SyntaxKind.JSDocTypeExpression */ + ); + node.type = type3; + return node; + } + function updateJSDocTypeExpression(node, type3) { + return node.type !== type3 ? update2(createJSDocTypeExpression(type3), node) : node; + } + function createJSDocSignature(typeParameters, parameters, type3) { + var node = createBaseNode( + 326 + /* SyntaxKind.JSDocSignature */ + ); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + return node; + } + function updateJSDocSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? update2(createJSDocSignature(typeParameters, parameters, type3), node) : node; + } + function getDefaultTagName(node) { + var defaultTagName = getDefaultTagNameForKind(node.kind); + return node.tagName.escapedText === ts2.escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); + } + function createBaseJSDocTag(kind, tagName, comment) { + var node = createBaseNode(kind); + node.tagName = tagName; + node.comment = comment; + return node; + } + function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { + var node = createBaseJSDocTag(347, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("template"), comment); + node.constraint = constraint; + node.typeParameters = createNodeArray(typeParameters); + return node; + } + function updateJSDocTemplateTag(node, tagName, constraint, typeParameters, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update2(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; + } + function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { + var node = createBaseJSDocTag(348, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("typedef"), comment); + node.typeExpression = typeExpression; + node.fullName = fullName; + node.name = ts2.getJSDocTypeAliasName(fullName); + return node; + } + function updateJSDocTypedefTag(node, tagName, typeExpression, fullName, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update2(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; + } + function createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + var node = createBaseJSDocTag(343, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("param"), comment); + node.typeExpression = typeExpression; + node.name = name2; + node.isNameFirst = !!isNameFirst; + node.isBracketed = isBracketed; + return node; + } + function updateJSDocParameterTag(node, tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.name !== name2 || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update2(createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment), node) : node; + } + function createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + var node = createBaseJSDocTag(350, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("prop"), comment); + node.typeExpression = typeExpression; + node.name = name2; + node.isNameFirst = !!isNameFirst; + node.isBracketed = isBracketed; + return node; + } + function updateJSDocPropertyTag(node, tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.name !== name2 || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update2(createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment), node) : node; + } + function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { + var node = createBaseJSDocTag(341, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("callback"), comment); + node.typeExpression = typeExpression; + node.fullName = fullName; + node.name = ts2.getJSDocTypeAliasName(fullName); + return node; + } + function updateJSDocCallbackTag(node, tagName, typeExpression, fullName, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update2(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; + } + function createJSDocAugmentsTag(tagName, className, comment) { + var node = createBaseJSDocTag(331, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("augments"), comment); + node.class = className; + return node; + } + function updateJSDocAugmentsTag(node, tagName, className, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update2(createJSDocAugmentsTag(tagName, className, comment), node) : node; + } + function createJSDocImplementsTag(tagName, className, comment) { + var node = createBaseJSDocTag(332, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("implements"), comment); + node.class = className; + return node; + } + function createJSDocSeeTag(tagName, name2, comment) { + var node = createBaseJSDocTag(349, tagName !== null && tagName !== void 0 ? tagName : createIdentifier("see"), comment); + node.name = name2; + return node; + } + function updateJSDocSeeTag(node, tagName, name2, comment) { + return node.tagName !== tagName || node.name !== name2 || node.comment !== comment ? update2(createJSDocSeeTag(tagName, name2, comment), node) : node; + } + function createJSDocNameReference(name2) { + var node = createBaseNode( + 313 + /* SyntaxKind.JSDocNameReference */ + ); + node.name = name2; + return node; + } + function updateJSDocNameReference(node, name2) { + return node.name !== name2 ? update2(createJSDocNameReference(name2), node) : node; + } + function createJSDocMemberName(left, right) { + var node = createBaseNode( + 314 + /* SyntaxKind.JSDocMemberName */ + ); + node.left = left; + node.right = right; + node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); + return node; + } + function updateJSDocMemberName(node, left, right) { + return node.left !== left || node.right !== right ? update2(createJSDocMemberName(left, right), node) : node; + } + function createJSDocLink(name2, text) { + var node = createBaseNode( + 327 + /* SyntaxKind.JSDocLink */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLink(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLink(name2, text), node) : node; + } + function createJSDocLinkCode(name2, text) { + var node = createBaseNode( + 328 + /* SyntaxKind.JSDocLinkCode */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLinkCode(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLinkCode(name2, text), node) : node; + } + function createJSDocLinkPlain(name2, text) { + var node = createBaseNode( + 329 + /* SyntaxKind.JSDocLinkPlain */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLinkPlain(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLinkPlain(name2, text), node) : node; + } + function updateJSDocImplementsTag(node, tagName, className, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update2(createJSDocImplementsTag(tagName, className, comment), node) : node; + } + function createJSDocSimpleTagWorker(kind, tagName, comment) { + var node = createBaseJSDocTag(kind, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); + return node; + } + function updateJSDocSimpleTagWorker(kind, node, tagName, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.comment !== comment ? update2(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; + } + function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { + var node = createBaseJSDocTag(kind, tagName !== null && tagName !== void 0 ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); + node.typeExpression = typeExpression; + return node; + } + function updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment) { + if (tagName === void 0) { + tagName = getDefaultTagName(node); + } + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update2(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; + } + function createJSDocUnknownTag(tagName, comment) { + var node = createBaseJSDocTag(330, tagName, comment); + return node; + } + function updateJSDocUnknownTag(node, tagName, comment) { + return node.tagName !== tagName || node.comment !== comment ? update2(createJSDocUnknownTag(tagName, comment), node) : node; + } + function createJSDocText(text) { + var node = createBaseNode( + 324 + /* SyntaxKind.JSDocText */ + ); + node.text = text; + return node; + } + function updateJSDocText(node, text) { + return node.text !== text ? update2(createJSDocText(text), node) : node; + } + function createJSDocComment(comment, tags6) { + var node = createBaseNode( + 323 + /* SyntaxKind.JSDoc */ + ); + node.comment = comment; + node.tags = asNodeArray(tags6); + return node; + } + function updateJSDocComment(node, comment, tags6) { + return node.comment !== comment || node.tags !== tags6 ? update2(createJSDocComment(comment, tags6), node) : node; + } + function createJsxElement(openingElement, children, closingElement) { + var node = createBaseNode( + 281 + /* SyntaxKind.JsxElement */ + ); + node.openingElement = openingElement; + node.children = createNodeArray(children); + node.closingElement = closingElement; + node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2; + return node; + } + function updateJsxElement(node, openingElement, children, closingElement) { + return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update2(createJsxElement(openingElement, children, closingElement), node) : node; + } + function createJsxSelfClosingElement(tagName, typeArguments, attributes) { + var node = createBaseNode( + 282 + /* SyntaxKind.JsxSelfClosingElement */ + ); + node.tagName = tagName; + node.typeArguments = asNodeArray(typeArguments); + node.attributes = attributes; + node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2; + if (node.typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update2(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; + } + function createJsxOpeningElement(tagName, typeArguments, attributes) { + var node = createBaseNode( + 283 + /* SyntaxKind.JsxOpeningElement */ + ); + node.tagName = tagName; + node.typeArguments = asNodeArray(typeArguments); + node.attributes = attributes; + node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2; + if (typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update2(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; + } + function createJsxClosingElement(tagName) { + var node = createBaseNode( + 284 + /* SyntaxKind.JsxClosingElement */ + ); + node.tagName = tagName; + node.transformFlags |= propagateChildFlags(node.tagName) | 2; + return node; + } + function updateJsxClosingElement(node, tagName) { + return node.tagName !== tagName ? update2(createJsxClosingElement(tagName), node) : node; + } + function createJsxFragment(openingFragment, children, closingFragment) { + var node = createBaseNode( + 285 + /* SyntaxKind.JsxFragment */ + ); + node.openingFragment = openingFragment; + node.children = createNodeArray(children); + node.closingFragment = closingFragment; + node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2; + return node; + } + function updateJsxFragment(node, openingFragment, children, closingFragment) { + return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update2(createJsxFragment(openingFragment, children, closingFragment), node) : node; + } + function createJsxText(text, containsOnlyTriviaWhiteSpaces) { + var node = createBaseNode( + 11 + /* SyntaxKind.JsxText */ + ); + node.text = text; + node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; + node.transformFlags |= 2; + return node; + } + function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { + return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update2(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; + } + function createJsxOpeningFragment() { + var node = createBaseNode( + 286 + /* SyntaxKind.JsxOpeningFragment */ + ); + node.transformFlags |= 2; + return node; + } + function createJsxJsxClosingFragment() { + var node = createBaseNode( + 287 + /* SyntaxKind.JsxClosingFragment */ + ); + node.transformFlags |= 2; + return node; + } + function createJsxAttribute(name2, initializer) { + var node = createBaseNode( + 288 + /* SyntaxKind.JsxAttribute */ + ); + node.name = name2; + node.initializer = initializer; + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2; + return node; + } + function updateJsxAttribute(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? update2(createJsxAttribute(name2, initializer), node) : node; + } + function createJsxAttributes(properties) { + var node = createBaseNode( + 289 + /* SyntaxKind.JsxAttributes */ + ); + node.properties = createNodeArray(properties); + node.transformFlags |= propagateChildrenFlags(node.properties) | 2; + return node; + } + function updateJsxAttributes(node, properties) { + return node.properties !== properties ? update2(createJsxAttributes(properties), node) : node; + } + function createJsxSpreadAttribute(expression) { + var node = createBaseNode( + 290 + /* SyntaxKind.JsxSpreadAttribute */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression) | 2; + return node; + } + function updateJsxSpreadAttribute(node, expression) { + return node.expression !== expression ? update2(createJsxSpreadAttribute(expression), node) : node; + } + function createJsxExpression(dotDotDotToken, expression) { + var node = createBaseNode( + 291 + /* SyntaxKind.JsxExpression */ + ); + node.dotDotDotToken = dotDotDotToken; + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2; + return node; + } + function updateJsxExpression(node, expression) { + return node.expression !== expression ? update2(createJsxExpression(node.dotDotDotToken, expression), node) : node; + } + function createCaseClause(expression, statements) { + var node = createBaseNode( + 292 + /* SyntaxKind.CaseClause */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.statements = createNodeArray(statements); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); + return node; + } + function updateCaseClause(node, expression, statements) { + return node.expression !== expression || node.statements !== statements ? update2(createCaseClause(expression, statements), node) : node; + } + function createDefaultClause(statements) { + var node = createBaseNode( + 293 + /* SyntaxKind.DefaultClause */ + ); + node.statements = createNodeArray(statements); + node.transformFlags = propagateChildrenFlags(node.statements); + return node; + } + function updateDefaultClause(node, statements) { + return node.statements !== statements ? update2(createDefaultClause(statements), node) : node; + } + function createHeritageClause(token, types3) { + var node = createBaseNode( + 294 + /* SyntaxKind.HeritageClause */ + ); + node.token = token; + node.types = createNodeArray(types3); + node.transformFlags |= propagateChildrenFlags(node.types); + switch (token) { + case 94: + node.transformFlags |= 1024; + break; + case 117: + node.transformFlags |= 1; + break; + default: + return ts2.Debug.assertNever(token); + } + return node; + } + function updateHeritageClause(node, types3) { + return node.types !== types3 ? update2(createHeritageClause(node.token, types3), node) : node; + } + function createCatchClause(variableDeclaration, block) { + var node = createBaseNode( + 295 + /* SyntaxKind.CatchClause */ + ); + if (typeof variableDeclaration === "string" || variableDeclaration && !ts2.isVariableDeclaration(variableDeclaration)) { + variableDeclaration = createVariableDeclaration( + variableDeclaration, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + node.variableDeclaration = variableDeclaration; + node.block = block; + node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block); + if (!variableDeclaration) + node.transformFlags |= 64; + return node; + } + function updateCatchClause(node, variableDeclaration, block) { + return node.variableDeclaration !== variableDeclaration || node.block !== block ? update2(createCatchClause(variableDeclaration, block), node) : node; + } + function createPropertyAssignment(name2, initializer) { + var node = createBaseNamedDeclaration( + 299, + /*modifiers*/ + void 0, + name2 + ); + node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer); + node.illegalDecorators = void 0; + node.modifiers = void 0; + node.questionToken = void 0; + node.exclamationToken = void 0; + return node; + } + function updatePropertyAssignment(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name2, initializer), node) : node; + } + function finishUpdatePropertyAssignment(updated, original) { + if (updated !== original) { + updated.illegalDecorators = original.illegalDecorators; + updated.modifiers = original.modifiers; + updated.questionToken = original.questionToken; + updated.exclamationToken = original.exclamationToken; + } + return update2(updated, original); + } + function createShorthandPropertyAssignment(name2, objectAssignmentInitializer) { + var node = createBaseNamedDeclaration( + 300, + /*modifiers*/ + void 0, + name2 + ); + node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); + node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | 1024; + node.equalsToken = void 0; + node.illegalDecorators = void 0; + node.modifiers = void 0; + node.questionToken = void 0; + node.exclamationToken = void 0; + return node; + } + function updateShorthandPropertyAssignment(node, name2, objectAssignmentInitializer) { + return node.name !== name2 || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name2, objectAssignmentInitializer), node) : node; + } + function finishUpdateShorthandPropertyAssignment(updated, original) { + if (updated !== original) { + updated.equalsToken = original.equalsToken; + updated.illegalDecorators = original.illegalDecorators; + updated.modifiers = original.modifiers; + updated.questionToken = original.questionToken; + updated.exclamationToken = original.exclamationToken; + } + return update2(updated, original); + } + function createSpreadAssignment(expression) { + var node = createBaseNode( + 301 + /* SyntaxKind.SpreadAssignment */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 128 | 65536; + return node; + } + function updateSpreadAssignment(node, expression) { + return node.expression !== expression ? update2(createSpreadAssignment(expression), node) : node; + } + function createEnumMember(name2, initializer) { + var node = createBaseNode( + 302 + /* SyntaxKind.EnumMember */ + ); + node.name = asName(name2); + node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1; + return node; + } + function updateEnumMember(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? update2(createEnumMember(name2, initializer), node) : node; + } + function createSourceFile(statements, endOfFileToken, flags2) { + var node = baseFactory2.createBaseSourceFileNode( + 308 + /* SyntaxKind.SourceFile */ + ); + node.statements = createNodeArray(statements); + node.endOfFileToken = endOfFileToken; + node.flags |= flags2; + node.fileName = ""; + node.text = ""; + node.languageVersion = 0; + node.languageVariant = 0; + node.scriptKind = 0; + node.isDeclarationFile = false; + node.hasNoDefaultLib = false; + node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); + return node; + } + function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { + var node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode( + 308 + /* SyntaxKind.SourceFile */ + ); + for (var p7 in source) { + if (p7 === "emitNode" || ts2.hasProperty(node, p7) || !ts2.hasProperty(source, p7)) + continue; + node[p7] = source[p7]; + } + node.flags |= source.flags; + node.statements = createNodeArray(statements); + node.endOfFileToken = source.endOfFileToken; + node.isDeclarationFile = isDeclarationFile; + node.referencedFiles = referencedFiles; + node.typeReferenceDirectives = typeReferences; + node.hasNoDefaultLib = hasNoDefaultLib; + node.libReferenceDirectives = libReferences; + node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); + node.impliedNodeFormat = source.impliedNodeFormat; + return node; + } + function updateSourceFile(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives) { + if (isDeclarationFile === void 0) { + isDeclarationFile = node.isDeclarationFile; + } + if (referencedFiles === void 0) { + referencedFiles = node.referencedFiles; + } + if (typeReferenceDirectives === void 0) { + typeReferenceDirectives = node.typeReferenceDirectives; + } + if (hasNoDefaultLib === void 0) { + hasNoDefaultLib = node.hasNoDefaultLib; + } + if (libReferenceDirectives === void 0) { + libReferenceDirectives = node.libReferenceDirectives; + } + return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update2(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; + } + function createBundle(sourceFiles, prepends) { + if (prepends === void 0) { + prepends = ts2.emptyArray; + } + var node = createBaseNode( + 309 + /* SyntaxKind.Bundle */ + ); + node.prepends = prepends; + node.sourceFiles = sourceFiles; + return node; + } + function updateBundle(node, sourceFiles, prepends) { + if (prepends === void 0) { + prepends = ts2.emptyArray; + } + return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update2(createBundle(sourceFiles, prepends), node) : node; + } + function createUnparsedSource(prologues, syntheticReferences, texts) { + var node = createBaseNode( + 310 + /* SyntaxKind.UnparsedSource */ + ); + node.prologues = prologues; + node.syntheticReferences = syntheticReferences; + node.texts = texts; + node.fileName = ""; + node.text = ""; + node.referencedFiles = ts2.emptyArray; + node.libReferenceDirectives = ts2.emptyArray; + node.getLineAndCharacterOfPosition = function(pos) { + return ts2.getLineAndCharacterOfPosition(node, pos); + }; + return node; + } + function createBaseUnparsedNode(kind, data) { + var node = createBaseNode(kind); + node.data = data; + return node; + } + function createUnparsedPrologue(data) { + return createBaseUnparsedNode(303, data); + } + function createUnparsedPrepend(data, texts) { + var node = createBaseUnparsedNode(304, data); + node.texts = texts; + return node; + } + function createUnparsedTextLike(data, internal4) { + return createBaseUnparsedNode(internal4 ? 306 : 305, data); + } + function createUnparsedSyntheticReference(section) { + var node = createBaseNode( + 307 + /* SyntaxKind.UnparsedSyntheticReference */ + ); + node.data = section.data; + node.section = section; + return node; + } + function createInputFiles2() { + var node = createBaseNode( + 311 + /* SyntaxKind.InputFiles */ + ); + node.javascriptText = ""; + node.declarationText = ""; + return node; + } + function createSyntheticExpression(type3, isSpread, tupleNameSource) { + if (isSpread === void 0) { + isSpread = false; + } + var node = createBaseNode( + 234 + /* SyntaxKind.SyntheticExpression */ + ); + node.type = type3; + node.isSpread = isSpread; + node.tupleNameSource = tupleNameSource; + return node; + } + function createSyntaxList(children) { + var node = createBaseNode( + 351 + /* SyntaxKind.SyntaxList */ + ); + node._children = children; + return node; + } + function createNotEmittedStatement(original) { + var node = createBaseNode( + 352 + /* SyntaxKind.NotEmittedStatement */ + ); + node.original = original; + ts2.setTextRange(node, original); + return node; + } + function createPartiallyEmittedExpression(expression, original) { + var node = createBaseNode( + 353 + /* SyntaxKind.PartiallyEmittedExpression */ + ); + node.expression = expression; + node.original = original; + node.transformFlags |= propagateChildFlags(node.expression) | 1; + ts2.setTextRange(node, original); + return node; + } + function updatePartiallyEmittedExpression(node, expression) { + return node.expression !== expression ? update2(createPartiallyEmittedExpression(expression, node.original), node) : node; + } + function flattenCommaElements(node) { + if (ts2.nodeIsSynthesized(node) && !ts2.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { + if (ts2.isCommaListExpression(node)) { + return node.elements; + } + if (ts2.isBinaryExpression(node) && ts2.isCommaToken(node.operatorToken)) { + return [node.left, node.right]; + } + } + return node; + } + function createCommaListExpression(elements) { + var node = createBaseNode( + 354 + /* SyntaxKind.CommaListExpression */ + ); + node.elements = createNodeArray(ts2.sameFlatMap(elements, flattenCommaElements)); + node.transformFlags |= propagateChildrenFlags(node.elements); + return node; + } + function updateCommaListExpression(node, elements) { + return node.elements !== elements ? update2(createCommaListExpression(elements), node) : node; + } + function createEndOfDeclarationMarker(original) { + var node = createBaseNode( + 356 + /* SyntaxKind.EndOfDeclarationMarker */ + ); + node.emitNode = {}; + node.original = original; + return node; + } + function createMergeDeclarationMarker(original) { + var node = createBaseNode( + 355 + /* SyntaxKind.MergeDeclarationMarker */ + ); + node.emitNode = {}; + node.original = original; + return node; + } + function createSyntheticReferenceExpression(expression, thisArg) { + var node = createBaseNode( + 357 + /* SyntaxKind.SyntheticReferenceExpression */ + ); + node.expression = expression; + node.thisArg = thisArg; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); + return node; + } + function updateSyntheticReferenceExpression(node, expression, thisArg) { + return node.expression !== expression || node.thisArg !== thisArg ? update2(createSyntheticReferenceExpression(expression, thisArg), node) : node; + } + function cloneNode(node) { + if (node === void 0) { + return node; + } + var clone2 = ts2.isSourceFile(node) ? baseFactory2.createBaseSourceFileNode( + 308 + /* SyntaxKind.SourceFile */ + ) : ts2.isIdentifier(node) ? baseFactory2.createBaseIdentifierNode( + 79 + /* SyntaxKind.Identifier */ + ) : ts2.isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode( + 80 + /* SyntaxKind.PrivateIdentifier */ + ) : !ts2.isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind); + clone2.flags |= node.flags & ~8; + clone2.transformFlags = node.transformFlags; + setOriginalNode(clone2, node); + for (var key in node) { + if (ts2.hasProperty(clone2, key) || !ts2.hasProperty(node, key)) { + continue; + } + clone2[key] = node[key]; + } + return clone2; + } + function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { + return createCallExpression( + createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + param ? [param] : [], + /*type*/ + void 0, + createBlock( + statements, + /*multiLine*/ + true + ) + ), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + paramValue ? [paramValue] : [] + ); + } + function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { + return createCallExpression( + createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + param ? [param] : [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + createBlock( + statements, + /*multiLine*/ + true + ) + ), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + paramValue ? [paramValue] : [] + ); + } + function createVoidZero() { + return createVoidExpression(createNumericLiteral("0")); + } + function createExportDefault(expression) { + return createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + expression + ); + } + function createExternalModuleExport(exportName) { + return createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + createNamedExports([ + createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + exportName + ) + ]) + ); + } + function createTypeCheck(value2, tag) { + return tag === "undefined" ? factory.createStrictEquality(value2, createVoidZero()) : factory.createStrictEquality(createTypeOfExpression(value2), createStringLiteral(tag)); + } + function createMethodCall(object, methodName, argumentsList) { + if (ts2.isCallChain(object)) { + return createCallChain( + createPropertyAccessChain( + object, + /*questionDotToken*/ + void 0, + methodName + ), + /*questionDotToken*/ + void 0, + /*typeArguments*/ + void 0, + argumentsList + ); + } + return createCallExpression( + createPropertyAccessExpression(object, methodName), + /*typeArguments*/ + void 0, + argumentsList + ); + } + function createFunctionBindCall(target, thisArg, argumentsList) { + return createMethodCall(target, "bind", __spreadArray9([thisArg], argumentsList, true)); + } + function createFunctionCallCall(target, thisArg, argumentsList) { + return createMethodCall(target, "call", __spreadArray9([thisArg], argumentsList, true)); + } + function createFunctionApplyCall(target, thisArg, argumentsExpression) { + return createMethodCall(target, "apply", [thisArg, argumentsExpression]); + } + function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { + return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); + } + function createArraySliceCall(array, start) { + return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); + } + function createArrayConcatCall(array, argumentsList) { + return createMethodCall(array, "concat", argumentsList); + } + function createObjectDefinePropertyCall(target, propertyName, attributes) { + return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); + } + function createReflectGetCall(target, propertyKey, receiver) { + return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); + } + function createReflectSetCall(target, propertyKey, value2, receiver) { + return createGlobalMethodCall("Reflect", "set", receiver ? [target, propertyKey, value2, receiver] : [target, propertyKey, value2]); + } + function tryAddPropertyAssignment(properties, propertyName, expression) { + if (expression) { + properties.push(createPropertyAssignment(propertyName, expression)); + return true; + } + return false; + } + function createPropertyDescriptor(attributes, singleLine) { + var properties = []; + tryAddPropertyAssignment(properties, "enumerable", asExpression(attributes.enumerable)); + tryAddPropertyAssignment(properties, "configurable", asExpression(attributes.configurable)); + var isData = tryAddPropertyAssignment(properties, "writable", asExpression(attributes.writable)); + isData = tryAddPropertyAssignment(properties, "value", attributes.value) || isData; + var isAccessor = tryAddPropertyAssignment(properties, "get", attributes.get); + isAccessor = tryAddPropertyAssignment(properties, "set", attributes.set) || isAccessor; + ts2.Debug.assert(!(isData && isAccessor), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."); + return createObjectLiteralExpression(properties, !singleLine); + } + function updateOuterExpression(outerExpression, expression) { + switch (outerExpression.kind) { + case 214: + return updateParenthesizedExpression(outerExpression, expression); + case 213: + return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 231: + return updateAsExpression(outerExpression, expression, outerExpression.type); + case 235: + return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); + case 232: + return updateNonNullExpression(outerExpression, expression); + case 353: + return updatePartiallyEmittedExpression(outerExpression, expression); + } + } + function isIgnorableParen(node) { + return ts2.isParenthesizedExpression(node) && ts2.nodeIsSynthesized(node) && ts2.nodeIsSynthesized(ts2.getSourceMapRange(node)) && ts2.nodeIsSynthesized(ts2.getCommentRange(node)) && !ts2.some(ts2.getSyntheticLeadingComments(node)) && !ts2.some(ts2.getSyntheticTrailingComments(node)); + } + function restoreOuterExpressions(outerExpression, innerExpression, kinds) { + if (kinds === void 0) { + kinds = 15; + } + if (outerExpression && ts2.isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { + return updateOuterExpression(outerExpression, restoreOuterExpressions(outerExpression.expression, innerExpression)); + } + return innerExpression; + } + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + var updated = updateLabeledStatement(outermostLabeledStatement, outermostLabeledStatement.label, ts2.isLabeledStatement(outermostLabeledStatement.statement) ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + var target = ts2.skipParentheses(node); + switch (target.kind) { + case 79: + return cacheIdentifiers; + case 108: + case 8: + case 9: + case 10: + return false; + case 206: + var elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 207: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers) { + if (cacheIdentifiers === void 0) { + cacheIdentifiers = false; + } + var callee = ts2.skipOuterExpressions( + expression, + 15 + /* OuterExpressionKinds.All */ + ); + var thisArg; + var target; + if (ts2.isSuperProperty(callee)) { + thisArg = createThis(); + target = callee; + } else if (ts2.isSuperKeyword(callee)) { + thisArg = createThis(); + target = languageVersion !== void 0 && languageVersion < 2 ? ts2.setTextRange(createIdentifier("_super"), callee) : callee; + } else if (ts2.getEmitFlags(callee) & 4096) { + thisArg = createVoidZero(); + target = parenthesizerRules().parenthesizeLeftSideOfAccess( + callee, + /*optionalChain*/ + false + ); + } else if (ts2.isPropertyAccessExpression(callee)) { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = createTempVariable(recordTempVariable); + target = createPropertyAccessExpression(ts2.setTextRange(factory.createAssignment(thisArg, callee.expression), callee.expression), callee.name); + ts2.setTextRange(target, callee); + } else { + thisArg = callee.expression; + target = callee; + } + } else if (ts2.isElementAccessExpression(callee)) { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = createTempVariable(recordTempVariable); + target = createElementAccessExpression(ts2.setTextRange(factory.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); + ts2.setTextRange(target, callee); + } else { + thisArg = callee.expression; + target = callee; + } + } else { + thisArg = createVoidZero(); + target = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + } + return { target, thisArg }; + } + function createAssignmentTargetWrapper(paramName, expression) { + return createPropertyAccessExpression( + // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560) + createParenthesizedExpression(createObjectLiteralExpression([ + createSetAccessorDeclaration( + /*modifiers*/ + void 0, + "value", + [createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + paramName, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )], + createBlock([ + createExpressionStatement(expression) + ]) + ) + ])), + "value" + ); + } + function inlineExpressions(expressions) { + return expressions.length > 10 ? createCommaListExpression(expressions) : ts2.reduceLeft(expressions, factory.createComma); + } + function getName(node, allowComments, allowSourceMaps, emitFlags) { + if (emitFlags === void 0) { + emitFlags = 0; + } + var nodeName = ts2.getNameOfDeclaration(node); + if (nodeName && ts2.isIdentifier(nodeName) && !ts2.isGeneratedIdentifier(nodeName)) { + var name2 = ts2.setParent(ts2.setTextRange(cloneNode(nodeName), nodeName), nodeName.parent); + emitFlags |= ts2.getEmitFlags(nodeName); + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts2.setEmitFlags(name2, emitFlags); + return name2; + } + return getGeneratedNameForNode(node); + } + function getInternalName(node, allowComments, allowSourceMaps) { + return getName( + node, + allowComments, + allowSourceMaps, + 16384 | 32768 + /* EmitFlags.InternalName */ + ); + } + function getLocalName(node, allowComments, allowSourceMaps) { + return getName( + node, + allowComments, + allowSourceMaps, + 16384 + /* EmitFlags.LocalName */ + ); + } + function getExportName(node, allowComments, allowSourceMaps) { + return getName( + node, + allowComments, + allowSourceMaps, + 8192 + /* EmitFlags.ExportName */ + ); + } + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + function getNamespaceMemberName(ns, name2, allowComments, allowSourceMaps) { + var qualifiedName = createPropertyAccessExpression(ns, ts2.nodeIsSynthesized(name2) ? name2 : cloneNode(name2)); + ts2.setTextRange(qualifiedName, name2); + var emitFlags = 0; + if (!allowSourceMaps) + emitFlags |= 48; + if (!allowComments) + emitFlags |= 1536; + if (emitFlags) + ts2.setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + function copyPrologue(source, target, ensureUseStrict2, visitor) { + var offset = copyStandardPrologue(source, target, 0, ensureUseStrict2); + return copyCustomPrologue(source, target, offset, visitor); + } + function isUseStrictPrologue(node) { + return ts2.isStringLiteral(node.expression) && node.expression.text === "use strict"; + } + function createUseStrictPrologue() { + return ts2.startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); + } + function copyStandardPrologue(source, target, statementOffset, ensureUseStrict2) { + if (statementOffset === void 0) { + statementOffset = 0; + } + ts2.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + var foundUseStrict = false; + var numStatements = source.length; + while (statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts2.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + foundUseStrict = true; + } + target.push(statement); + } else { + break; + } + statementOffset++; + } + if (ensureUseStrict2 && !foundUseStrict) { + target.push(createUseStrictPrologue()); + } + return statementOffset; + } + function copyCustomPrologue(source, target, statementOffset, visitor, filter2) { + if (filter2 === void 0) { + filter2 = ts2.returnTrue; + } + var numStatements = source.length; + while (statementOffset !== void 0 && statementOffset < numStatements) { + var statement = source[statementOffset]; + if (ts2.getEmitFlags(statement) & 1048576 && filter2(statement)) { + ts2.append(target, visitor ? ts2.visitNode(statement, visitor, ts2.isStatement) : statement); + } else { + break; + } + statementOffset++; + } + return statementOffset; + } + function ensureUseStrict(statements) { + var foundUseStrict = ts2.findUseStrictPrologue(statements); + if (!foundUseStrict) { + return ts2.setTextRange(createNodeArray(__spreadArray9([createUseStrictPrologue()], statements, true)), statements); + } + return statements; + } + function liftToBlock(nodes) { + ts2.Debug.assert(ts2.every(nodes, ts2.isStatementOrBlock), "Cannot lift nodes to a Block."); + return ts2.singleOrUndefined(nodes) || createBlock(nodes); + } + function findSpanEnd(array, test, start) { + var i7 = start; + while (i7 < array.length && test(array[i7])) { + i7++; + } + return i7; + } + function mergeLexicalEnvironment(statements, declarations) { + if (!ts2.some(declarations)) { + return statements; + } + var leftStandardPrologueEnd = findSpanEnd(statements, ts2.isPrologueDirective, 0); + var leftHoistedFunctionsEnd = findSpanEnd(statements, ts2.isHoistedFunction, leftStandardPrologueEnd); + var leftHoistedVariablesEnd = findSpanEnd(statements, ts2.isHoistedVariableStatement, leftHoistedFunctionsEnd); + var rightStandardPrologueEnd = findSpanEnd(declarations, ts2.isPrologueDirective, 0); + var rightHoistedFunctionsEnd = findSpanEnd(declarations, ts2.isHoistedFunction, rightStandardPrologueEnd); + var rightHoistedVariablesEnd = findSpanEnd(declarations, ts2.isHoistedVariableStatement, rightHoistedFunctionsEnd); + var rightCustomPrologueEnd = findSpanEnd(declarations, ts2.isCustomPrologue, rightHoistedVariablesEnd); + ts2.Debug.assert(rightCustomPrologueEnd === declarations.length, "Expected declarations to be valid standard or custom prologues"); + var left = ts2.isNodeArray(statements) ? statements.slice() : statements; + if (rightCustomPrologueEnd > rightHoistedVariablesEnd) { + left.splice.apply(left, __spreadArray9([leftHoistedVariablesEnd, 0], declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd), false)); + } + if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) { + left.splice.apply(left, __spreadArray9([leftHoistedFunctionsEnd, 0], declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd), false)); + } + if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) { + left.splice.apply(left, __spreadArray9([leftStandardPrologueEnd, 0], declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd), false)); + } + if (rightStandardPrologueEnd > 0) { + if (leftStandardPrologueEnd === 0) { + left.splice.apply(left, __spreadArray9([0, 0], declarations.slice(0, rightStandardPrologueEnd), false)); + } else { + var leftPrologues = new ts2.Map(); + for (var i7 = 0; i7 < leftStandardPrologueEnd; i7++) { + var leftPrologue = statements[i7]; + leftPrologues.set(leftPrologue.expression.text, true); + } + for (var i7 = rightStandardPrologueEnd - 1; i7 >= 0; i7--) { + var rightPrologue = declarations[i7]; + if (!leftPrologues.has(rightPrologue.expression.text)) { + left.unshift(rightPrologue); + } + } + } + } + if (ts2.isNodeArray(statements)) { + return ts2.setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); + } + return statements; + } + function updateModifiers(node, modifiers) { + var _a2; + var modifierArray; + if (typeof modifiers === "number") { + modifierArray = createModifiersFromModifierFlags(modifiers); + } else { + modifierArray = modifiers; + } + return ts2.isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : ts2.isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : ts2.isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : ts2.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : ts2.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) !== null && _a2 !== void 0 ? _a2 : node.exclamationToken, node.type, node.initializer) : ts2.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : ts2.isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : ts2.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : ts2.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : ts2.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : ts2.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : ts2.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : ts2.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : ts2.isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : ts2.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : ts2.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : ts2.isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : ts2.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : ts2.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : ts2.isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : ts2.isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : ts2.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : ts2.isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : ts2.isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : ts2.isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : ts2.Debug.assertNever(node); + } + function asNodeArray(array) { + return array ? createNodeArray(array) : void 0; + } + function asName(name2) { + return typeof name2 === "string" ? createIdentifier(name2) : name2; + } + function asExpression(value2) { + return typeof value2 === "string" ? createStringLiteral(value2) : typeof value2 === "number" ? createNumericLiteral(value2) : typeof value2 === "boolean" ? value2 ? createTrue() : createFalse() : value2; + } + function asToken(value2) { + return typeof value2 === "number" ? createToken(value2) : value2; + } + function asEmbeddedStatement(statement) { + return statement && ts2.isNotEmittedStatement(statement) ? ts2.setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; + } + } + ts2.createNodeFactory = createNodeFactory; + function updateWithoutOriginal(updated, original) { + if (updated !== original) { + ts2.setTextRange(updated, original); + } + return updated; + } + function updateWithOriginal(updated, original) { + if (updated !== original) { + setOriginalNode(updated, original); + ts2.setTextRange(updated, original); + } + return updated; + } + function getDefaultTagNameForKind(kind) { + switch (kind) { + case 346: + return "type"; + case 344: + return "returns"; + case 345: + return "this"; + case 342: + return "enum"; + case 333: + return "author"; + case 335: + return "class"; + case 336: + return "public"; + case 337: + return "private"; + case 338: + return "protected"; + case 339: + return "readonly"; + case 340: + return "override"; + case 347: + return "template"; + case 348: + return "typedef"; + case 343: + return "param"; + case 350: + return "prop"; + case 341: + return "callback"; + case 331: + return "augments"; + case 332: + return "implements"; + default: + return ts2.Debug.fail("Unsupported kind: ".concat(ts2.Debug.formatSyntaxKind(kind))); + } + } + var rawTextScanner; + var invalidValueSentinel = {}; + function getCookedText(kind, rawText) { + if (!rawTextScanner) { + rawTextScanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false, + 0 + /* LanguageVariant.Standard */ + ); + } + switch (kind) { + case 14: + rawTextScanner.setText("`" + rawText + "`"); + break; + case 15: + rawTextScanner.setText("`" + rawText + "${"); + break; + case 16: + rawTextScanner.setText("}" + rawText + "${"); + break; + case 17: + rawTextScanner.setText("}" + rawText + "`"); + break; + } + var token = rawTextScanner.scan(); + if (token === 19) { + token = rawTextScanner.reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + } + if (rawTextScanner.isUnterminated()) { + rawTextScanner.setText(void 0); + return invalidValueSentinel; + } + var tokenValue; + switch (token) { + case 14: + case 15: + case 16: + case 17: + tokenValue = rawTextScanner.getTokenValue(); + break; + } + if (tokenValue === void 0 || rawTextScanner.scan() !== 1) { + rawTextScanner.setText(void 0); + return invalidValueSentinel; + } + rawTextScanner.setText(void 0); + return tokenValue; + } + function propagateIdentifierNameFlags(node) { + return propagateChildFlags(node) & ~67108864; + } + function propagatePropertyNameFlagsOfChild(node, transformFlags) { + return transformFlags | node.transformFlags & 134234112; + } + function propagateChildFlags(child) { + if (!child) + return 0; + var childFlags = child.transformFlags & ~getTransformFlagsSubtreeExclusions(child.kind); + return ts2.isNamedDeclaration(child) && ts2.isPropertyName(child.name) ? propagatePropertyNameFlagsOfChild(child.name, childFlags) : childFlags; + } + function propagateChildrenFlags(children) { + return children ? children.transformFlags : 0; + } + function aggregateChildrenFlags(children) { + var subtreeFlags = 0; + for (var _i = 0, children_2 = children; _i < children_2.length; _i++) { + var child = children_2[_i]; + subtreeFlags |= propagateChildFlags(child); + } + children.transformFlags = subtreeFlags; + } + function getTransformFlagsSubtreeExclusions(kind) { + if (kind >= 179 && kind <= 202) { + return -2; + } + switch (kind) { + case 210: + case 211: + case 206: + return -2147450880; + case 264: + return -1941676032; + case 166: + return -2147483648; + case 216: + return -2072174592; + case 215: + case 259: + return -1937940480; + case 258: + return -2146893824; + case 260: + case 228: + return -2147344384; + case 173: + return -1937948672; + case 169: + return -2013249536; + case 171: + case 174: + case 175: + return -2005057536; + case 131: + case 148: + case 160: + case 144: + case 152: + case 149: + case 134: + case 153: + case 114: + case 165: + case 168: + case 170: + case 176: + case 177: + case 178: + case 261: + case 262: + return -2; + case 207: + return -2147278848; + case 295: + return -2147418112; + case 203: + case 204: + return -2147450880; + case 213: + case 235: + case 231: + case 353: + case 214: + case 106: + return -2147483648; + case 208: + case 209: + return -2147483648; + default: + return -2147483648; + } + } + ts2.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; + var baseFactory = ts2.createBaseNodeFactory(); + function makeSynthetic(node) { + node.flags |= 8; + return node; + } + var syntheticFactory = { + createBaseSourceFileNode: function(kind) { + return makeSynthetic(baseFactory.createBaseSourceFileNode(kind)); + }, + createBaseIdentifierNode: function(kind) { + return makeSynthetic(baseFactory.createBaseIdentifierNode(kind)); + }, + createBasePrivateIdentifierNode: function(kind) { + return makeSynthetic(baseFactory.createBasePrivateIdentifierNode(kind)); + }, + createBaseTokenNode: function(kind) { + return makeSynthetic(baseFactory.createBaseTokenNode(kind)); + }, + createBaseNode: function(kind) { + return makeSynthetic(baseFactory.createBaseNode(kind)); + } + }; + ts2.factory = createNodeFactory(4, syntheticFactory); + function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, mapTextOrStripInternal) { + var stripInternal; + var bundleFileInfo; + var fileName; + var text; + var length; + var sourceMapPath; + var sourceMapText; + var getText; + var getSourceMapText; + var oldFileOfCurrentEmit; + if (!ts2.isString(textOrInputFiles)) { + ts2.Debug.assert(mapPathOrType === "js" || mapPathOrType === "dts"); + fileName = (mapPathOrType === "js" ? textOrInputFiles.javascriptPath : textOrInputFiles.declarationPath) || ""; + sourceMapPath = mapPathOrType === "js" ? textOrInputFiles.javascriptMapPath : textOrInputFiles.declarationMapPath; + getText = function() { + return mapPathOrType === "js" ? textOrInputFiles.javascriptText : textOrInputFiles.declarationText; + }; + getSourceMapText = function() { + return mapPathOrType === "js" ? textOrInputFiles.javascriptMapText : textOrInputFiles.declarationMapText; + }; + length = function() { + return getText().length; + }; + if (textOrInputFiles.buildInfo && textOrInputFiles.buildInfo.bundle) { + ts2.Debug.assert(mapTextOrStripInternal === void 0 || typeof mapTextOrStripInternal === "boolean"); + stripInternal = mapTextOrStripInternal; + bundleFileInfo = mapPathOrType === "js" ? textOrInputFiles.buildInfo.bundle.js : textOrInputFiles.buildInfo.bundle.dts; + oldFileOfCurrentEmit = textOrInputFiles.oldFileOfCurrentEmit; + } + } else { + fileName = ""; + text = textOrInputFiles; + length = textOrInputFiles.length; + sourceMapPath = mapPathOrType; + sourceMapText = mapTextOrStripInternal; + } + var node = oldFileOfCurrentEmit ? parseOldFileOfCurrentEmit(ts2.Debug.checkDefined(bundleFileInfo)) : parseUnparsedSourceFile(bundleFileInfo, stripInternal, length); + node.fileName = fileName; + node.sourceMapPath = sourceMapPath; + node.oldFileOfCurrentEmit = oldFileOfCurrentEmit; + if (getText && getSourceMapText) { + Object.defineProperty(node, "text", { get: getText }); + Object.defineProperty(node, "sourceMapText", { get: getSourceMapText }); + } else { + ts2.Debug.assert(!oldFileOfCurrentEmit); + node.text = text !== null && text !== void 0 ? text : ""; + node.sourceMapText = sourceMapText; + } + return node; + } + ts2.createUnparsedSourceFile = createUnparsedSourceFile; + function parseUnparsedSourceFile(bundleFileInfo, stripInternal, length) { + var prologues; + var helpers; + var referencedFiles; + var typeReferenceDirectives; + var libReferenceDirectives; + var prependChildren; + var texts; + var hasNoDefaultLib; + for (var _i = 0, _a2 = bundleFileInfo ? bundleFileInfo.sections : ts2.emptyArray; _i < _a2.length; _i++) { + var section = _a2[_i]; + switch (section.kind) { + case "prologue": + prologues = ts2.append(prologues, ts2.setTextRange(ts2.factory.createUnparsedPrologue(section.data), section)); + break; + case "emitHelpers": + helpers = ts2.append(helpers, ts2.getAllUnscopedEmitHelpers().get(section.data)); + break; + case "no-default-lib": + hasNoDefaultLib = true; + break; + case "reference": + referencedFiles = ts2.append(referencedFiles, { pos: -1, end: -1, fileName: section.data }); + break; + case "type": + typeReferenceDirectives = ts2.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data }); + break; + case "type-import": + typeReferenceDirectives = ts2.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts2.ModuleKind.ESNext }); + break; + case "type-require": + typeReferenceDirectives = ts2.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts2.ModuleKind.CommonJS }); + break; + case "lib": + libReferenceDirectives = ts2.append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data }); + break; + case "prepend": + var prependTexts = void 0; + for (var _b = 0, _c = section.texts; _b < _c.length; _b++) { + var text = _c[_b]; + if (!stripInternal || text.kind !== "internal") { + prependTexts = ts2.append(prependTexts, ts2.setTextRange(ts2.factory.createUnparsedTextLike( + text.data, + text.kind === "internal" + /* BundleFileSectionKind.Internal */ + ), text)); + } + } + prependChildren = ts2.addRange(prependChildren, prependTexts); + texts = ts2.append(texts, ts2.factory.createUnparsedPrepend(section.data, prependTexts !== null && prependTexts !== void 0 ? prependTexts : ts2.emptyArray)); + break; + case "internal": + if (stripInternal) { + if (!texts) + texts = []; + break; + } + case "text": + texts = ts2.append(texts, ts2.setTextRange(ts2.factory.createUnparsedTextLike( + section.data, + section.kind === "internal" + /* BundleFileSectionKind.Internal */ + ), section)); + break; + default: + ts2.Debug.assertNever(section); + } + } + if (!texts) { + var textNode = ts2.factory.createUnparsedTextLike( + /*data*/ + void 0, + /*internal*/ + false + ); + ts2.setTextRangePosWidth(textNode, 0, typeof length === "function" ? length() : length); + texts = [textNode]; + } + var node = ts2.parseNodeFactory.createUnparsedSource( + prologues !== null && prologues !== void 0 ? prologues : ts2.emptyArray, + /*syntheticReferences*/ + void 0, + texts + ); + ts2.setEachParent(prologues, node); + ts2.setEachParent(texts, node); + ts2.setEachParent(prependChildren, node); + node.hasNoDefaultLib = hasNoDefaultLib; + node.helpers = helpers; + node.referencedFiles = referencedFiles || ts2.emptyArray; + node.typeReferenceDirectives = typeReferenceDirectives; + node.libReferenceDirectives = libReferenceDirectives || ts2.emptyArray; + return node; + } + function parseOldFileOfCurrentEmit(bundleFileInfo) { + var texts; + var syntheticReferences; + for (var _i = 0, _a2 = bundleFileInfo.sections; _i < _a2.length; _i++) { + var section = _a2[_i]; + switch (section.kind) { + case "internal": + case "text": + texts = ts2.append(texts, ts2.setTextRange(ts2.factory.createUnparsedTextLike( + section.data, + section.kind === "internal" + /* BundleFileSectionKind.Internal */ + ), section)); + break; + case "no-default-lib": + case "reference": + case "type": + case "type-import": + case "type-require": + case "lib": + syntheticReferences = ts2.append(syntheticReferences, ts2.setTextRange(ts2.factory.createUnparsedSyntheticReference(section), section)); + break; + case "prologue": + case "emitHelpers": + case "prepend": + break; + default: + ts2.Debug.assertNever(section); + } + } + var node = ts2.factory.createUnparsedSource(ts2.emptyArray, syntheticReferences, texts !== null && texts !== void 0 ? texts : ts2.emptyArray); + ts2.setEachParent(syntheticReferences, node); + ts2.setEachParent(texts, node); + node.helpers = ts2.map(bundleFileInfo.sources && bundleFileInfo.sources.helpers, function(name2) { + return ts2.getAllUnscopedEmitHelpers().get(name2); + }); + return node; + } + function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { + var node = ts2.parseNodeFactory.createInputFiles(); + if (!ts2.isString(javascriptTextOrReadFileText)) { + var cache_1 = new ts2.Map(); + var textGetter_1 = function(path2) { + if (path2 === void 0) + return void 0; + var value2 = cache_1.get(path2); + if (value2 === void 0) { + value2 = javascriptTextOrReadFileText(path2); + cache_1.set(path2, value2 !== void 0 ? value2 : false); + } + return value2 !== false ? value2 : void 0; + }; + var definedTextGetter_1 = function(path2) { + var result2 = textGetter_1(path2); + return result2 !== void 0 ? result2 : "/* Input file ".concat(path2, " was missing */\r\n"); + }; + var buildInfo_1; + var getAndCacheBuildInfo_1 = function(getText) { + var _a2; + if (buildInfo_1 === void 0) { + var result2 = getText(); + buildInfo_1 = result2 !== void 0 ? (_a2 = ts2.getBuildInfo(node.buildInfoPath, result2)) !== null && _a2 !== void 0 ? _a2 : false : false; + } + return buildInfo_1 || void 0; + }; + node.javascriptPath = declarationTextOrJavascriptPath; + node.javascriptMapPath = javascriptMapPath; + node.declarationPath = ts2.Debug.checkDefined(javascriptMapTextOrDeclarationPath); + node.declarationMapPath = declarationMapPath; + node.buildInfoPath = declarationMapTextOrBuildInfoPath; + Object.defineProperties(node, { + javascriptText: { get: function() { + return definedTextGetter_1(declarationTextOrJavascriptPath); + } }, + javascriptMapText: { get: function() { + return textGetter_1(javascriptMapPath); + } }, + declarationText: { get: function() { + return definedTextGetter_1(ts2.Debug.checkDefined(javascriptMapTextOrDeclarationPath)); + } }, + declarationMapText: { get: function() { + return textGetter_1(declarationMapPath); + } }, + buildInfo: { get: function() { + return getAndCacheBuildInfo_1(function() { + return textGetter_1(declarationMapTextOrBuildInfoPath); + }); + } } + }); + } else { + node.javascriptText = javascriptTextOrReadFileText; + node.javascriptMapPath = javascriptMapPath; + node.javascriptMapText = javascriptMapTextOrDeclarationPath; + node.declarationText = declarationTextOrJavascriptPath; + node.declarationMapPath = declarationMapPath; + node.declarationMapText = declarationMapTextOrBuildInfoPath; + node.javascriptPath = javascriptPath; + node.declarationPath = declarationPath; + node.buildInfoPath = buildInfoPath; + node.buildInfo = buildInfo; + node.oldFileOfCurrentEmit = oldFileOfCurrentEmit; + } + return node; + } + ts2.createInputFiles = createInputFiles; + var SourceMapSource; + function createSourceMapSource(fileName, text, skipTrivia) { + return new (SourceMapSource || (SourceMapSource = ts2.objectAllocator.getSourceMapSourceConstructor()))(fileName, text, skipTrivia); + } + ts2.createSourceMapSource = createSourceMapSource; + function setOriginalNode(node, original) { + node.original = original; + if (original) { + var emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); + } + return node; + } + ts2.setOriginalNode = setOriginalNode; + function mergeEmitNode(sourceEmitNode, destEmitNode) { + var flags = sourceEmitNode.flags, leadingComments = sourceEmitNode.leadingComments, trailingComments = sourceEmitNode.trailingComments, commentRange = sourceEmitNode.commentRange, sourceMapRange = sourceEmitNode.sourceMapRange, tokenSourceMapRanges = sourceEmitNode.tokenSourceMapRanges, constantValue = sourceEmitNode.constantValue, helpers = sourceEmitNode.helpers, startsOnNewLine = sourceEmitNode.startsOnNewLine, snippetElement = sourceEmitNode.snippetElement; + if (!destEmitNode) + destEmitNode = {}; + if (leadingComments) + destEmitNode.leadingComments = ts2.addRange(leadingComments.slice(), destEmitNode.leadingComments); + if (trailingComments) + destEmitNode.trailingComments = ts2.addRange(trailingComments.slice(), destEmitNode.trailingComments); + if (flags) + destEmitNode.flags = flags & ~268435456; + if (commentRange) + destEmitNode.commentRange = commentRange; + if (sourceMapRange) + destEmitNode.sourceMapRange = sourceMapRange; + if (tokenSourceMapRanges) + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + if (constantValue !== void 0) + destEmitNode.constantValue = constantValue; + if (helpers) { + for (var _i = 0, helpers_1 = helpers; _i < helpers_1.length; _i++) { + var helper = helpers_1[_i]; + destEmitNode.helpers = ts2.appendIfUnique(destEmitNode.helpers, helper); + } + } + if (startsOnNewLine !== void 0) + destEmitNode.startsOnNewLine = startsOnNewLine; + if (snippetElement !== void 0) + destEmitNode.snippetElement = snippetElement; + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (var key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getOrCreateEmitNode(node) { + var _a2; + if (!node.emitNode) { + if (ts2.isParseTreeNode(node)) { + if (node.kind === 308) { + return node.emitNode = { annotatedNodes: [node] }; + } + var sourceFile = (_a2 = ts2.getSourceFileOfNode(ts2.getParseTreeNode(ts2.getSourceFileOfNode(node)))) !== null && _a2 !== void 0 ? _a2 : ts2.Debug.fail("Could not determine parsed source file."); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + node.emitNode = {}; + } else { + ts2.Debug.assert(!(node.emitNode.flags & 268435456), "Invalid attempt to mutate an immutable node."); + } + return node.emitNode; + } + ts2.getOrCreateEmitNode = getOrCreateEmitNode; + function disposeEmitNodes(sourceFile) { + var _a2, _b; + var annotatedNodes = (_b = (_a2 = ts2.getSourceFileOfNode(ts2.getParseTreeNode(sourceFile))) === null || _a2 === void 0 ? void 0 : _a2.emitNode) === null || _b === void 0 ? void 0 : _b.annotatedNodes; + if (annotatedNodes) { + for (var _i = 0, annotatedNodes_1 = annotatedNodes; _i < annotatedNodes_1.length; _i++) { + var node = annotatedNodes_1[_i]; + node.emitNode = void 0; + } + } + } + ts2.disposeEmitNodes = disposeEmitNodes; + function removeAllComments(node) { + var emitNode = getOrCreateEmitNode(node); + emitNode.flags |= 1536; + emitNode.leadingComments = void 0; + emitNode.trailingComments = void 0; + return node; + } + ts2.removeAllComments = removeAllComments; + function setEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + ts2.setEmitFlags = setEmitFlags; + function addEmitFlags(node, emitFlags) { + var emitNode = getOrCreateEmitNode(node); + emitNode.flags = emitNode.flags | emitFlags; + return node; + } + ts2.addEmitFlags = addEmitFlags; + function getSourceMapRange(node) { + var _a2, _b; + return (_b = (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.sourceMapRange) !== null && _b !== void 0 ? _b : node; + } + ts2.getSourceMapRange = getSourceMapRange; + function setSourceMapRange(node, range2) { + getOrCreateEmitNode(node).sourceMapRange = range2; + return node; + } + ts2.setSourceMapRange = setSourceMapRange; + function getTokenSourceMapRange(node, token) { + var _a2, _b; + return (_b = (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.tokenSourceMapRanges) === null || _b === void 0 ? void 0 : _b[token]; + } + ts2.getTokenSourceMapRange = getTokenSourceMapRange; + function setTokenSourceMapRange(node, token, range2) { + var _a2; + var emitNode = getOrCreateEmitNode(node); + var tokenSourceMapRanges = (_a2 = emitNode.tokenSourceMapRanges) !== null && _a2 !== void 0 ? _a2 : emitNode.tokenSourceMapRanges = []; + tokenSourceMapRanges[token] = range2; + return node; + } + ts2.setTokenSourceMapRange = setTokenSourceMapRange; + function getStartsOnNewLine(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.startsOnNewLine; + } + ts2.getStartsOnNewLine = getStartsOnNewLine; + function setStartsOnNewLine(node, newLine) { + getOrCreateEmitNode(node).startsOnNewLine = newLine; + return node; + } + ts2.setStartsOnNewLine = setStartsOnNewLine; + function getCommentRange(node) { + var _a2, _b; + return (_b = (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.commentRange) !== null && _b !== void 0 ? _b : node; + } + ts2.getCommentRange = getCommentRange; + function setCommentRange(node, range2) { + getOrCreateEmitNode(node).commentRange = range2; + return node; + } + ts2.setCommentRange = setCommentRange; + function getSyntheticLeadingComments(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.leadingComments; + } + ts2.getSyntheticLeadingComments = getSyntheticLeadingComments; + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + ts2.setSyntheticLeadingComments = setSyntheticLeadingComments; + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, ts2.append(getSyntheticLeadingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + } + ts2.addSyntheticLeadingComment = addSyntheticLeadingComment; + function getSyntheticTrailingComments(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.trailingComments; + } + ts2.getSyntheticTrailingComments = getSyntheticTrailingComments; + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + ts2.setSyntheticTrailingComments = setSyntheticTrailingComments; + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, ts2.append(getSyntheticTrailingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + } + ts2.addSyntheticTrailingComment = addSyntheticTrailingComment; + function moveSyntheticComments(node, original) { + setSyntheticLeadingComments(node, getSyntheticLeadingComments(original)); + setSyntheticTrailingComments(node, getSyntheticTrailingComments(original)); + var emit3 = getOrCreateEmitNode(original); + emit3.leadingComments = void 0; + emit3.trailingComments = void 0; + return node; + } + ts2.moveSyntheticComments = moveSyntheticComments; + function getConstantValue(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.constantValue; + } + ts2.getConstantValue = getConstantValue; + function setConstantValue(node, value2) { + var emitNode = getOrCreateEmitNode(node); + emitNode.constantValue = value2; + return node; + } + ts2.setConstantValue = setConstantValue; + function addEmitHelper(node, helper) { + var emitNode = getOrCreateEmitNode(node); + emitNode.helpers = ts2.append(emitNode.helpers, helper); + return node; + } + ts2.addEmitHelper = addEmitHelper; + function addEmitHelpers(node, helpers) { + if (ts2.some(helpers)) { + var emitNode = getOrCreateEmitNode(node); + for (var _i = 0, helpers_2 = helpers; _i < helpers_2.length; _i++) { + var helper = helpers_2[_i]; + emitNode.helpers = ts2.appendIfUnique(emitNode.helpers, helper); + } + } + return node; + } + ts2.addEmitHelpers = addEmitHelpers; + function removeEmitHelper(node, helper) { + var _a2; + var helpers = (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.helpers; + if (helpers) { + return ts2.orderedRemoveItem(helpers, helper); + } + return false; + } + ts2.removeEmitHelper = removeEmitHelper; + function getEmitHelpers(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.helpers; + } + ts2.getEmitHelpers = getEmitHelpers; + function moveEmitHelpers(source, target, predicate) { + var sourceEmitNode = source.emitNode; + var sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; + if (!ts2.some(sourceEmitHelpers)) + return; + var targetEmitNode = getOrCreateEmitNode(target); + var helpersRemoved = 0; + for (var i7 = 0; i7 < sourceEmitHelpers.length; i7++) { + var helper = sourceEmitHelpers[i7]; + if (predicate(helper)) { + helpersRemoved++; + targetEmitNode.helpers = ts2.appendIfUnique(targetEmitNode.helpers, helper); + } else if (helpersRemoved > 0) { + sourceEmitHelpers[i7 - helpersRemoved] = helper; + } + } + if (helpersRemoved > 0) { + sourceEmitHelpers.length -= helpersRemoved; + } + } + ts2.moveEmitHelpers = moveEmitHelpers; + function getSnippetElement(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.snippetElement; + } + ts2.getSnippetElement = getSnippetElement; + function setSnippetElement(node, snippet2) { + var emitNode = getOrCreateEmitNode(node); + emitNode.snippetElement = snippet2; + return node; + } + ts2.setSnippetElement = setSnippetElement; + function ignoreSourceNewlines(node) { + getOrCreateEmitNode(node).flags |= 134217728; + return node; + } + ts2.ignoreSourceNewlines = ignoreSourceNewlines; + function setTypeNode(node, type3) { + var emitNode = getOrCreateEmitNode(node); + emitNode.typeNode = type3; + return node; + } + ts2.setTypeNode = setTypeNode; + function getTypeNode(node) { + var _a2; + return (_a2 = node.emitNode) === null || _a2 === void 0 ? void 0 : _a2.typeNode; + } + ts2.getTypeNode = getTypeNode; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createEmitHelperFactory(context2) { + var factory = context2.factory; + var immutableTrue = ts2.memoize(function() { + return ts2.setEmitFlags( + factory.createTrue(), + 268435456 + /* EmitFlags.Immutable */ + ); + }); + var immutableFalse = ts2.memoize(function() { + return ts2.setEmitFlags( + factory.createFalse(), + 268435456 + /* EmitFlags.Immutable */ + ); + }); + return { + getUnscopedHelperName, + // TypeScript Helpers + createDecorateHelper, + createMetadataHelper, + createParamHelper, + // ES2018 Helpers + createAssignHelper, + createAwaitHelper, + createAsyncGeneratorHelper, + createAsyncDelegatorHelper, + createAsyncValuesHelper, + // ES2018 Destructuring Helpers + createRestHelper, + // ES2017 Helpers + createAwaiterHelper, + // ES2015 Helpers + createExtendsHelper, + createTemplateObjectHelper, + createSpreadArrayHelper, + // ES2015 Destructuring Helpers + createValuesHelper, + createReadHelper, + // ES2015 Generator Helpers + createGeneratorHelper, + // ES Module Helpers + createCreateBindingHelper, + createImportStarHelper, + createImportStarCallbackHelper, + createImportDefaultHelper, + createExportStarHelper, + // Class Fields Helpers + createClassPrivateFieldGetHelper, + createClassPrivateFieldSetHelper, + createClassPrivateFieldInHelper + }; + function getUnscopedHelperName(name2) { + return ts2.setEmitFlags( + factory.createIdentifier(name2), + 4096 | 2 + /* EmitFlags.AdviseOnEmitNode */ + ); + } + function createDecorateHelper(decoratorExpressions, target, memberName, descriptor) { + context2.requestEmitHelper(ts2.decorateHelper); + var argumentsArray = []; + argumentsArray.push(factory.createArrayLiteralExpression( + decoratorExpressions, + /*multiLine*/ + true + )); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + return factory.createCallExpression( + getUnscopedHelperName("__decorate"), + /*typeArguments*/ + void 0, + argumentsArray + ); + } + function createMetadataHelper(metadataKey, metadataValue) { + context2.requestEmitHelper(ts2.metadataHelper); + return factory.createCallExpression( + getUnscopedHelperName("__metadata"), + /*typeArguments*/ + void 0, + [ + factory.createStringLiteral(metadataKey), + metadataValue + ] + ); + } + function createParamHelper(expression, parameterOffset, location2) { + context2.requestEmitHelper(ts2.paramHelper); + return ts2.setTextRange(factory.createCallExpression( + getUnscopedHelperName("__param"), + /*typeArguments*/ + void 0, + [ + factory.createNumericLiteral(parameterOffset + ""), + expression + ] + ), location2); + } + function createAssignHelper(attributesSegments) { + if (ts2.getEmitScriptTarget(context2.getCompilerOptions()) >= 2) { + return factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "assign"), + /*typeArguments*/ + void 0, + attributesSegments + ); + } + context2.requestEmitHelper(ts2.assignHelper); + return factory.createCallExpression( + getUnscopedHelperName("__assign"), + /*typeArguments*/ + void 0, + attributesSegments + ); + } + function createAwaitHelper(expression) { + context2.requestEmitHelper(ts2.awaitHelper); + return factory.createCallExpression( + getUnscopedHelperName("__await"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createAsyncGeneratorHelper(generatorFunc, hasLexicalThis) { + context2.requestEmitHelper(ts2.awaitHelper); + context2.requestEmitHelper(ts2.asyncGeneratorHelper); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 | 524288; + return factory.createCallExpression( + getUnscopedHelperName("__asyncGenerator"), + /*typeArguments*/ + void 0, + [ + hasLexicalThis ? factory.createThis() : factory.createVoidZero(), + factory.createIdentifier("arguments"), + generatorFunc + ] + ); + } + function createAsyncDelegatorHelper(expression) { + context2.requestEmitHelper(ts2.awaitHelper); + context2.requestEmitHelper(ts2.asyncDelegator); + return factory.createCallExpression( + getUnscopedHelperName("__asyncDelegator"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createAsyncValuesHelper(expression) { + context2.requestEmitHelper(ts2.asyncValues); + return factory.createCallExpression( + getUnscopedHelperName("__asyncValues"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createRestHelper(value2, elements, computedTempVariables, location2) { + context2.requestEmitHelper(ts2.restHelper); + var propertyNames = []; + var computedTempVariableOffset = 0; + for (var i7 = 0; i7 < elements.length - 1; i7++) { + var propertyName = ts2.getPropertyNameOfBindingOrAssignmentElement(elements[i7]); + if (propertyName) { + if (ts2.isComputedPropertyName(propertyName)) { + ts2.Debug.assertIsDefined(computedTempVariables, "Encountered computed property name but 'computedTempVariables' argument was not provided."); + var temp = computedTempVariables[computedTempVariableOffset]; + computedTempVariableOffset++; + propertyNames.push(factory.createConditionalExpression( + factory.createTypeCheck(temp, "symbol"), + /*questionToken*/ + void 0, + temp, + /*colonToken*/ + void 0, + factory.createAdd(temp, factory.createStringLiteral("")) + )); + } else { + propertyNames.push(factory.createStringLiteralFromNode(propertyName)); + } + } + } + return factory.createCallExpression( + getUnscopedHelperName("__rest"), + /*typeArguments*/ + void 0, + [ + value2, + ts2.setTextRange(factory.createArrayLiteralExpression(propertyNames), location2) + ] + ); + } + function createAwaiterHelper(hasLexicalThis, hasLexicalArguments, promiseConstructor, body) { + context2.requestEmitHelper(ts2.awaiterHelper); + var generatorFunc = factory.createFunctionExpression( + /*modifiers*/ + void 0, + factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + body + ); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 262144 | 524288; + return factory.createCallExpression( + getUnscopedHelperName("__awaiter"), + /*typeArguments*/ + void 0, + [ + hasLexicalThis ? factory.createThis() : factory.createVoidZero(), + hasLexicalArguments ? factory.createIdentifier("arguments") : factory.createVoidZero(), + promiseConstructor ? ts2.createExpressionFromEntityName(factory, promiseConstructor) : factory.createVoidZero(), + generatorFunc + ] + ); + } + function createExtendsHelper(name2) { + context2.requestEmitHelper(ts2.extendsHelper); + return factory.createCallExpression( + getUnscopedHelperName("__extends"), + /*typeArguments*/ + void 0, + [name2, factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + )] + ); + } + function createTemplateObjectHelper(cooked, raw) { + context2.requestEmitHelper(ts2.templateObjectHelper); + return factory.createCallExpression( + getUnscopedHelperName("__makeTemplateObject"), + /*typeArguments*/ + void 0, + [cooked, raw] + ); + } + function createSpreadArrayHelper(to, from, packFrom) { + context2.requestEmitHelper(ts2.spreadArrayHelper); + return factory.createCallExpression( + getUnscopedHelperName("__spreadArray"), + /*typeArguments*/ + void 0, + [to, from, packFrom ? immutableTrue() : immutableFalse()] + ); + } + function createValuesHelper(expression) { + context2.requestEmitHelper(ts2.valuesHelper); + return factory.createCallExpression( + getUnscopedHelperName("__values"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createReadHelper(iteratorRecord, count2) { + context2.requestEmitHelper(ts2.readHelper); + return factory.createCallExpression( + getUnscopedHelperName("__read"), + /*typeArguments*/ + void 0, + count2 !== void 0 ? [iteratorRecord, factory.createNumericLiteral(count2 + "")] : [iteratorRecord] + ); + } + function createGeneratorHelper(body) { + context2.requestEmitHelper(ts2.generatorHelper); + return factory.createCallExpression( + getUnscopedHelperName("__generator"), + /*typeArguments*/ + void 0, + [factory.createThis(), body] + ); + } + function createCreateBindingHelper(module6, inputName, outputName) { + context2.requestEmitHelper(ts2.createBindingHelper); + return factory.createCallExpression( + getUnscopedHelperName("__createBinding"), + /*typeArguments*/ + void 0, + __spreadArray9([factory.createIdentifier("exports"), module6, inputName], outputName ? [outputName] : [], true) + ); + } + function createImportStarHelper(expression) { + context2.requestEmitHelper(ts2.importStarHelper); + return factory.createCallExpression( + getUnscopedHelperName("__importStar"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createImportStarCallbackHelper() { + context2.requestEmitHelper(ts2.importStarHelper); + return getUnscopedHelperName("__importStar"); + } + function createImportDefaultHelper(expression) { + context2.requestEmitHelper(ts2.importDefaultHelper); + return factory.createCallExpression( + getUnscopedHelperName("__importDefault"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createExportStarHelper(moduleExpression, exportsExpression) { + if (exportsExpression === void 0) { + exportsExpression = factory.createIdentifier("exports"); + } + context2.requestEmitHelper(ts2.exportStarHelper); + context2.requestEmitHelper(ts2.createBindingHelper); + return factory.createCallExpression( + getUnscopedHelperName("__exportStar"), + /*typeArguments*/ + void 0, + [moduleExpression, exportsExpression] + ); + } + function createClassPrivateFieldGetHelper(receiver, state, kind, f8) { + context2.requestEmitHelper(ts2.classPrivateFieldGetHelper); + var args; + if (!f8) { + args = [receiver, state, factory.createStringLiteral(kind)]; + } else { + args = [receiver, state, factory.createStringLiteral(kind), f8]; + } + return factory.createCallExpression( + getUnscopedHelperName("__classPrivateFieldGet"), + /*typeArguments*/ + void 0, + args + ); + } + function createClassPrivateFieldSetHelper(receiver, state, value2, kind, f8) { + context2.requestEmitHelper(ts2.classPrivateFieldSetHelper); + var args; + if (!f8) { + args = [receiver, state, value2, factory.createStringLiteral(kind)]; + } else { + args = [receiver, state, value2, factory.createStringLiteral(kind), f8]; + } + return factory.createCallExpression( + getUnscopedHelperName("__classPrivateFieldSet"), + /*typeArguments*/ + void 0, + args + ); + } + function createClassPrivateFieldInHelper(state, receiver) { + context2.requestEmitHelper(ts2.classPrivateFieldInHelper); + return factory.createCallExpression( + getUnscopedHelperName("__classPrivateFieldIn"), + /* typeArguments*/ + void 0, + [state, receiver] + ); + } + } + ts2.createEmitHelperFactory = createEmitHelperFactory; + function compareEmitHelpers(x7, y7) { + if (x7 === y7) + return 0; + if (x7.priority === y7.priority) + return 0; + if (x7.priority === void 0) + return 1; + if (y7.priority === void 0) + return -1; + return ts2.compareValues(x7.priority, y7.priority); + } + ts2.compareEmitHelpers = compareEmitHelpers; + function helperString(input) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return function(uniqueName) { + var result2 = ""; + for (var i7 = 0; i7 < args.length; i7++) { + result2 += input[i7]; + result2 += uniqueName(args[i7]); + } + result2 += input[input.length - 1]; + return result2; + }; + } + ts2.helperString = helperString; + ts2.decorateHelper = { + name: "typescript:decorate", + importName: "__decorate", + scoped: false, + priority: 2, + text: '\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };' + }; + ts2.metadataHelper = { + name: "typescript:metadata", + importName: "__metadata", + scoped: false, + priority: 3, + text: '\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };' + }; + ts2.paramHelper = { + name: "typescript:param", + importName: "__param", + scoped: false, + priority: 4, + text: "\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };" + }; + ts2.assignHelper = { + name: "typescript:assign", + importName: "__assign", + scoped: false, + priority: 1, + text: "\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };" + }; + ts2.awaitHelper = { + name: "typescript:await", + importName: "__await", + scoped: false, + text: "\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }" + }; + ts2.asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + importName: "__asyncGenerator", + scoped: false, + dependencies: [ts2.awaitHelper], + text: '\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };' + }; + ts2.asyncDelegator = { + name: "typescript:asyncDelegator", + importName: "__asyncDelegator", + scoped: false, + dependencies: [ts2.awaitHelper], + text: '\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n };' + }; + ts2.asyncValues = { + name: "typescript:asyncValues", + importName: "__asyncValues", + scoped: false, + text: '\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\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);\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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };' + }; + ts2.restHelper = { + name: "typescript:rest", + importName: "__rest", + scoped: false, + text: '\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };' + }; + ts2.awaiterHelper = { + name: "typescript:awaiter", + importName: "__awaiter", + scoped: false, + priority: 5, + text: '\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };' + }; + ts2.extendsHelper = { + name: "typescript:extends", + importName: "__extends", + scoped: false, + priority: 0, + text: '\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();' + }; + ts2.templateObjectHelper = { + name: "typescript:makeTemplateObject", + importName: "__makeTemplateObject", + scoped: false, + priority: 0, + text: '\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };' + }; + ts2.readHelper = { + name: "typescript:read", + importName: "__read", + scoped: false, + text: '\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };' + }; + ts2.spreadArrayHelper = { + name: "typescript:spreadArray", + importName: "__spreadArray", + scoped: false, + text: "\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };" + }; + ts2.valuesHelper = { + name: "typescript:values", + importName: "__values", + scoped: false, + text: '\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };' + }; + ts2.generatorHelper = { + name: "typescript:generator", + importName: "__generator", + scoped: false, + priority: 6, + text: '\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\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;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };' + }; + ts2.createBindingHelper = { + name: "typescript:commonjscreatebinding", + importName: "__createBinding", + scoped: false, + priority: 1, + text: '\n var __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 }));' + }; + ts2.setModuleDefaultHelper = { + name: "typescript:commonjscreatevalue", + importName: "__setModuleDefault", + scoped: false, + priority: 1, + text: '\n var __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 });' + }; + ts2.importStarHelper = { + name: "typescript:commonjsimportstar", + importName: "__importStar", + scoped: false, + dependencies: [ts2.createBindingHelper, ts2.setModuleDefaultHelper], + priority: 2, + text: '\n var __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 };' + }; + ts2.importDefaultHelper = { + name: "typescript:commonjsimportdefault", + importName: "__importDefault", + scoped: false, + text: '\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };' + }; + ts2.exportStarHelper = { + name: "typescript:export-star", + importName: "__exportStar", + scoped: false, + dependencies: [ts2.createBindingHelper], + priority: 2, + text: '\n var __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 };' + }; + ts2.classPrivateFieldGetHelper = { + name: "typescript:classPrivateFieldGet", + importName: "__classPrivateFieldGet", + scoped: false, + text: '\n var __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 };' + }; + ts2.classPrivateFieldSetHelper = { + name: "typescript:classPrivateFieldSet", + importName: "__classPrivateFieldSet", + scoped: false, + text: '\n var __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 };' + }; + ts2.classPrivateFieldInHelper = { + name: "typescript:classPrivateFieldIn", + importName: "__classPrivateFieldIn", + scoped: false, + text: ` + var __classPrivateFieldIn = (this && this.__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); + };` + }; + var allUnscopedEmitHelpers; + function getAllUnscopedEmitHelpers() { + return allUnscopedEmitHelpers || (allUnscopedEmitHelpers = ts2.arrayToMap([ + ts2.decorateHelper, + ts2.metadataHelper, + ts2.paramHelper, + ts2.assignHelper, + ts2.awaitHelper, + ts2.asyncGeneratorHelper, + ts2.asyncDelegator, + ts2.asyncValues, + ts2.restHelper, + ts2.awaiterHelper, + ts2.extendsHelper, + ts2.templateObjectHelper, + ts2.spreadArrayHelper, + ts2.valuesHelper, + ts2.readHelper, + ts2.generatorHelper, + ts2.importStarHelper, + ts2.importDefaultHelper, + ts2.exportStarHelper, + ts2.classPrivateFieldGetHelper, + ts2.classPrivateFieldSetHelper, + ts2.classPrivateFieldInHelper, + ts2.createBindingHelper, + ts2.setModuleDefaultHelper + ], function(helper) { + return helper.name; + })); + } + ts2.getAllUnscopedEmitHelpers = getAllUnscopedEmitHelpers; + ts2.asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: helperString(__makeTemplateObject10(["\n const ", " = name => super[name];"], ["\n const ", " = name => super[name];"]), "_superIndex") + }; + ts2.advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: helperString(__makeTemplateObject10(["\n const ", " = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"], ["\n const ", " = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"]), "_superIndex") + }; + function isCallToHelper(firstSegment, helperName) { + return ts2.isCallExpression(firstSegment) && ts2.isIdentifier(firstSegment.expression) && (ts2.getEmitFlags(firstSegment.expression) & 4096) !== 0 && firstSegment.expression.escapedText === helperName; + } + ts2.isCallToHelper = isCallToHelper; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function isNumericLiteral(node) { + return node.kind === 8; + } + ts2.isNumericLiteral = isNumericLiteral; + function isBigIntLiteral(node) { + return node.kind === 9; + } + ts2.isBigIntLiteral = isBigIntLiteral; + function isStringLiteral(node) { + return node.kind === 10; + } + ts2.isStringLiteral = isStringLiteral; + function isJsxText(node) { + return node.kind === 11; + } + ts2.isJsxText = isJsxText; + function isRegularExpressionLiteral(node) { + return node.kind === 13; + } + ts2.isRegularExpressionLiteral = isRegularExpressionLiteral; + function isNoSubstitutionTemplateLiteral(node) { + return node.kind === 14; + } + ts2.isNoSubstitutionTemplateLiteral = isNoSubstitutionTemplateLiteral; + function isTemplateHead(node) { + return node.kind === 15; + } + ts2.isTemplateHead = isTemplateHead; + function isTemplateMiddle(node) { + return node.kind === 16; + } + ts2.isTemplateMiddle = isTemplateMiddle; + function isTemplateTail(node) { + return node.kind === 17; + } + ts2.isTemplateTail = isTemplateTail; + function isDotDotDotToken(node) { + return node.kind === 25; + } + ts2.isDotDotDotToken = isDotDotDotToken; + function isCommaToken(node) { + return node.kind === 27; + } + ts2.isCommaToken = isCommaToken; + function isPlusToken(node) { + return node.kind === 39; + } + ts2.isPlusToken = isPlusToken; + function isMinusToken(node) { + return node.kind === 40; + } + ts2.isMinusToken = isMinusToken; + function isAsteriskToken(node) { + return node.kind === 41; + } + ts2.isAsteriskToken = isAsteriskToken; + function isExclamationToken(node) { + return node.kind === 53; + } + ts2.isExclamationToken = isExclamationToken; + function isQuestionToken(node) { + return node.kind === 57; + } + ts2.isQuestionToken = isQuestionToken; + function isColonToken(node) { + return node.kind === 58; + } + ts2.isColonToken = isColonToken; + function isQuestionDotToken(node) { + return node.kind === 28; + } + ts2.isQuestionDotToken = isQuestionDotToken; + function isEqualsGreaterThanToken(node) { + return node.kind === 38; + } + ts2.isEqualsGreaterThanToken = isEqualsGreaterThanToken; + function isIdentifier(node) { + return node.kind === 79; + } + ts2.isIdentifier = isIdentifier; + function isPrivateIdentifier(node) { + return node.kind === 80; + } + ts2.isPrivateIdentifier = isPrivateIdentifier; + function isExportModifier(node) { + return node.kind === 93; + } + ts2.isExportModifier = isExportModifier; + function isAsyncModifier(node) { + return node.kind === 132; + } + ts2.isAsyncModifier = isAsyncModifier; + function isAssertsKeyword(node) { + return node.kind === 129; + } + ts2.isAssertsKeyword = isAssertsKeyword; + function isAwaitKeyword(node) { + return node.kind === 133; + } + ts2.isAwaitKeyword = isAwaitKeyword; + function isReadonlyKeyword(node) { + return node.kind === 146; + } + ts2.isReadonlyKeyword = isReadonlyKeyword; + function isStaticModifier(node) { + return node.kind === 124; + } + ts2.isStaticModifier = isStaticModifier; + function isAbstractModifier(node) { + return node.kind === 126; + } + ts2.isAbstractModifier = isAbstractModifier; + function isOverrideModifier(node) { + return node.kind === 161; + } + ts2.isOverrideModifier = isOverrideModifier; + function isAccessorModifier(node) { + return node.kind === 127; + } + ts2.isAccessorModifier = isAccessorModifier; + function isSuperKeyword(node) { + return node.kind === 106; + } + ts2.isSuperKeyword = isSuperKeyword; + function isImportKeyword(node) { + return node.kind === 100; + } + ts2.isImportKeyword = isImportKeyword; + function isQualifiedName(node) { + return node.kind === 163; + } + ts2.isQualifiedName = isQualifiedName; + function isComputedPropertyName(node) { + return node.kind === 164; + } + ts2.isComputedPropertyName = isComputedPropertyName; + function isTypeParameterDeclaration(node) { + return node.kind === 165; + } + ts2.isTypeParameterDeclaration = isTypeParameterDeclaration; + function isParameter(node) { + return node.kind === 166; + } + ts2.isParameter = isParameter; + function isDecorator(node) { + return node.kind === 167; + } + ts2.isDecorator = isDecorator; + function isPropertySignature(node) { + return node.kind === 168; + } + ts2.isPropertySignature = isPropertySignature; + function isPropertyDeclaration(node) { + return node.kind === 169; + } + ts2.isPropertyDeclaration = isPropertyDeclaration; + function isMethodSignature(node) { + return node.kind === 170; + } + ts2.isMethodSignature = isMethodSignature; + function isMethodDeclaration(node) { + return node.kind === 171; + } + ts2.isMethodDeclaration = isMethodDeclaration; + function isClassStaticBlockDeclaration(node) { + return node.kind === 172; + } + ts2.isClassStaticBlockDeclaration = isClassStaticBlockDeclaration; + function isConstructorDeclaration(node) { + return node.kind === 173; + } + ts2.isConstructorDeclaration = isConstructorDeclaration; + function isGetAccessorDeclaration(node) { + return node.kind === 174; + } + ts2.isGetAccessorDeclaration = isGetAccessorDeclaration; + function isSetAccessorDeclaration(node) { + return node.kind === 175; + } + ts2.isSetAccessorDeclaration = isSetAccessorDeclaration; + function isCallSignatureDeclaration(node) { + return node.kind === 176; + } + ts2.isCallSignatureDeclaration = isCallSignatureDeclaration; + function isConstructSignatureDeclaration(node) { + return node.kind === 177; + } + ts2.isConstructSignatureDeclaration = isConstructSignatureDeclaration; + function isIndexSignatureDeclaration(node) { + return node.kind === 178; + } + ts2.isIndexSignatureDeclaration = isIndexSignatureDeclaration; + function isTypePredicateNode(node) { + return node.kind === 179; + } + ts2.isTypePredicateNode = isTypePredicateNode; + function isTypeReferenceNode(node) { + return node.kind === 180; + } + ts2.isTypeReferenceNode = isTypeReferenceNode; + function isFunctionTypeNode(node) { + return node.kind === 181; + } + ts2.isFunctionTypeNode = isFunctionTypeNode; + function isConstructorTypeNode(node) { + return node.kind === 182; + } + ts2.isConstructorTypeNode = isConstructorTypeNode; + function isTypeQueryNode(node) { + return node.kind === 183; + } + ts2.isTypeQueryNode = isTypeQueryNode; + function isTypeLiteralNode(node) { + return node.kind === 184; + } + ts2.isTypeLiteralNode = isTypeLiteralNode; + function isArrayTypeNode(node) { + return node.kind === 185; + } + ts2.isArrayTypeNode = isArrayTypeNode; + function isTupleTypeNode(node) { + return node.kind === 186; + } + ts2.isTupleTypeNode = isTupleTypeNode; + function isNamedTupleMember(node) { + return node.kind === 199; + } + ts2.isNamedTupleMember = isNamedTupleMember; + function isOptionalTypeNode(node) { + return node.kind === 187; + } + ts2.isOptionalTypeNode = isOptionalTypeNode; + function isRestTypeNode(node) { + return node.kind === 188; + } + ts2.isRestTypeNode = isRestTypeNode; + function isUnionTypeNode(node) { + return node.kind === 189; + } + ts2.isUnionTypeNode = isUnionTypeNode; + function isIntersectionTypeNode(node) { + return node.kind === 190; + } + ts2.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 191; + } + ts2.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 192; + } + ts2.isInferTypeNode = isInferTypeNode; + function isParenthesizedTypeNode(node) { + return node.kind === 193; + } + ts2.isParenthesizedTypeNode = isParenthesizedTypeNode; + function isThisTypeNode(node) { + return node.kind === 194; + } + ts2.isThisTypeNode = isThisTypeNode; + function isTypeOperatorNode(node) { + return node.kind === 195; + } + ts2.isTypeOperatorNode = isTypeOperatorNode; + function isIndexedAccessTypeNode(node) { + return node.kind === 196; + } + ts2.isIndexedAccessTypeNode = isIndexedAccessTypeNode; + function isMappedTypeNode(node) { + return node.kind === 197; + } + ts2.isMappedTypeNode = isMappedTypeNode; + function isLiteralTypeNode(node) { + return node.kind === 198; + } + ts2.isLiteralTypeNode = isLiteralTypeNode; + function isImportTypeNode(node) { + return node.kind === 202; + } + ts2.isImportTypeNode = isImportTypeNode; + function isTemplateLiteralTypeSpan(node) { + return node.kind === 201; + } + ts2.isTemplateLiteralTypeSpan = isTemplateLiteralTypeSpan; + function isTemplateLiteralTypeNode(node) { + return node.kind === 200; + } + ts2.isTemplateLiteralTypeNode = isTemplateLiteralTypeNode; + function isObjectBindingPattern(node) { + return node.kind === 203; + } + ts2.isObjectBindingPattern = isObjectBindingPattern; + function isArrayBindingPattern(node) { + return node.kind === 204; + } + ts2.isArrayBindingPattern = isArrayBindingPattern; + function isBindingElement(node) { + return node.kind === 205; + } + ts2.isBindingElement = isBindingElement; + function isArrayLiteralExpression(node) { + return node.kind === 206; + } + ts2.isArrayLiteralExpression = isArrayLiteralExpression; + function isObjectLiteralExpression(node) { + return node.kind === 207; + } + ts2.isObjectLiteralExpression = isObjectLiteralExpression; + function isPropertyAccessExpression(node) { + return node.kind === 208; + } + ts2.isPropertyAccessExpression = isPropertyAccessExpression; + function isElementAccessExpression(node) { + return node.kind === 209; + } + ts2.isElementAccessExpression = isElementAccessExpression; + function isCallExpression(node) { + return node.kind === 210; + } + ts2.isCallExpression = isCallExpression; + function isNewExpression(node) { + return node.kind === 211; + } + ts2.isNewExpression = isNewExpression; + function isTaggedTemplateExpression(node) { + return node.kind === 212; + } + ts2.isTaggedTemplateExpression = isTaggedTemplateExpression; + function isTypeAssertionExpression(node) { + return node.kind === 213; + } + ts2.isTypeAssertionExpression = isTypeAssertionExpression; + function isParenthesizedExpression(node) { + return node.kind === 214; + } + ts2.isParenthesizedExpression = isParenthesizedExpression; + function isFunctionExpression(node) { + return node.kind === 215; + } + ts2.isFunctionExpression = isFunctionExpression; + function isArrowFunction(node) { + return node.kind === 216; + } + ts2.isArrowFunction = isArrowFunction; + function isDeleteExpression(node) { + return node.kind === 217; + } + ts2.isDeleteExpression = isDeleteExpression; + function isTypeOfExpression(node) { + return node.kind === 218; + } + ts2.isTypeOfExpression = isTypeOfExpression; + function isVoidExpression(node) { + return node.kind === 219; + } + ts2.isVoidExpression = isVoidExpression; + function isAwaitExpression(node) { + return node.kind === 220; + } + ts2.isAwaitExpression = isAwaitExpression; + function isPrefixUnaryExpression(node) { + return node.kind === 221; + } + ts2.isPrefixUnaryExpression = isPrefixUnaryExpression; + function isPostfixUnaryExpression(node) { + return node.kind === 222; + } + ts2.isPostfixUnaryExpression = isPostfixUnaryExpression; + function isBinaryExpression(node) { + return node.kind === 223; + } + ts2.isBinaryExpression = isBinaryExpression; + function isConditionalExpression(node) { + return node.kind === 224; + } + ts2.isConditionalExpression = isConditionalExpression; + function isTemplateExpression(node) { + return node.kind === 225; + } + ts2.isTemplateExpression = isTemplateExpression; + function isYieldExpression(node) { + return node.kind === 226; + } + ts2.isYieldExpression = isYieldExpression; + function isSpreadElement(node) { + return node.kind === 227; + } + ts2.isSpreadElement = isSpreadElement; + function isClassExpression(node) { + return node.kind === 228; + } + ts2.isClassExpression = isClassExpression; + function isOmittedExpression(node) { + return node.kind === 229; + } + ts2.isOmittedExpression = isOmittedExpression; + function isExpressionWithTypeArguments(node) { + return node.kind === 230; + } + ts2.isExpressionWithTypeArguments = isExpressionWithTypeArguments; + function isAsExpression(node) { + return node.kind === 231; + } + ts2.isAsExpression = isAsExpression; + function isSatisfiesExpression(node) { + return node.kind === 235; + } + ts2.isSatisfiesExpression = isSatisfiesExpression; + function isNonNullExpression(node) { + return node.kind === 232; + } + ts2.isNonNullExpression = isNonNullExpression; + function isMetaProperty(node) { + return node.kind === 233; + } + ts2.isMetaProperty = isMetaProperty; + function isSyntheticExpression(node) { + return node.kind === 234; + } + ts2.isSyntheticExpression = isSyntheticExpression; + function isPartiallyEmittedExpression(node) { + return node.kind === 353; + } + ts2.isPartiallyEmittedExpression = isPartiallyEmittedExpression; + function isCommaListExpression(node) { + return node.kind === 354; + } + ts2.isCommaListExpression = isCommaListExpression; + function isTemplateSpan(node) { + return node.kind === 236; + } + ts2.isTemplateSpan = isTemplateSpan; + function isSemicolonClassElement(node) { + return node.kind === 237; + } + ts2.isSemicolonClassElement = isSemicolonClassElement; + function isBlock2(node) { + return node.kind === 238; + } + ts2.isBlock = isBlock2; + function isVariableStatement(node) { + return node.kind === 240; + } + ts2.isVariableStatement = isVariableStatement; + function isEmptyStatement(node) { + return node.kind === 239; + } + ts2.isEmptyStatement = isEmptyStatement; + function isExpressionStatement(node) { + return node.kind === 241; + } + ts2.isExpressionStatement = isExpressionStatement; + function isIfStatement(node) { + return node.kind === 242; + } + ts2.isIfStatement = isIfStatement; + function isDoStatement(node) { + return node.kind === 243; + } + ts2.isDoStatement = isDoStatement; + function isWhileStatement(node) { + return node.kind === 244; + } + ts2.isWhileStatement = isWhileStatement; + function isForStatement(node) { + return node.kind === 245; + } + ts2.isForStatement = isForStatement; + function isForInStatement(node) { + return node.kind === 246; + } + ts2.isForInStatement = isForInStatement; + function isForOfStatement(node) { + return node.kind === 247; + } + ts2.isForOfStatement = isForOfStatement; + function isContinueStatement(node) { + return node.kind === 248; + } + ts2.isContinueStatement = isContinueStatement; + function isBreakStatement(node) { + return node.kind === 249; + } + ts2.isBreakStatement = isBreakStatement; + function isReturnStatement(node) { + return node.kind === 250; + } + ts2.isReturnStatement = isReturnStatement; + function isWithStatement(node) { + return node.kind === 251; + } + ts2.isWithStatement = isWithStatement; + function isSwitchStatement(node) { + return node.kind === 252; + } + ts2.isSwitchStatement = isSwitchStatement; + function isLabeledStatement(node) { + return node.kind === 253; + } + ts2.isLabeledStatement = isLabeledStatement; + function isThrowStatement(node) { + return node.kind === 254; + } + ts2.isThrowStatement = isThrowStatement; + function isTryStatement(node) { + return node.kind === 255; + } + ts2.isTryStatement = isTryStatement; + function isDebuggerStatement(node) { + return node.kind === 256; + } + ts2.isDebuggerStatement = isDebuggerStatement; + function isVariableDeclaration(node) { + return node.kind === 257; + } + ts2.isVariableDeclaration = isVariableDeclaration; + function isVariableDeclarationList(node) { + return node.kind === 258; + } + ts2.isVariableDeclarationList = isVariableDeclarationList; + function isFunctionDeclaration(node) { + return node.kind === 259; + } + ts2.isFunctionDeclaration = isFunctionDeclaration; + function isClassDeclaration(node) { + return node.kind === 260; + } + ts2.isClassDeclaration = isClassDeclaration; + function isInterfaceDeclaration(node) { + return node.kind === 261; + } + ts2.isInterfaceDeclaration = isInterfaceDeclaration; + function isTypeAliasDeclaration(node) { + return node.kind === 262; + } + ts2.isTypeAliasDeclaration = isTypeAliasDeclaration; + function isEnumDeclaration(node) { + return node.kind === 263; + } + ts2.isEnumDeclaration = isEnumDeclaration; + function isModuleDeclaration(node) { + return node.kind === 264; + } + ts2.isModuleDeclaration = isModuleDeclaration; + function isModuleBlock(node) { + return node.kind === 265; + } + ts2.isModuleBlock = isModuleBlock; + function isCaseBlock(node) { + return node.kind === 266; + } + ts2.isCaseBlock = isCaseBlock; + function isNamespaceExportDeclaration(node) { + return node.kind === 267; + } + ts2.isNamespaceExportDeclaration = isNamespaceExportDeclaration; + function isImportEqualsDeclaration(node) { + return node.kind === 268; + } + ts2.isImportEqualsDeclaration = isImportEqualsDeclaration; + function isImportDeclaration(node) { + return node.kind === 269; + } + ts2.isImportDeclaration = isImportDeclaration; + function isImportClause(node) { + return node.kind === 270; + } + ts2.isImportClause = isImportClause; + function isImportTypeAssertionContainer(node) { + return node.kind === 298; + } + ts2.isImportTypeAssertionContainer = isImportTypeAssertionContainer; + function isAssertClause(node) { + return node.kind === 296; + } + ts2.isAssertClause = isAssertClause; + function isAssertEntry(node) { + return node.kind === 297; + } + ts2.isAssertEntry = isAssertEntry; + function isNamespaceImport(node) { + return node.kind === 271; + } + ts2.isNamespaceImport = isNamespaceImport; + function isNamespaceExport(node) { + return node.kind === 277; + } + ts2.isNamespaceExport = isNamespaceExport; + function isNamedImports(node) { + return node.kind === 272; + } + ts2.isNamedImports = isNamedImports; + function isImportSpecifier(node) { + return node.kind === 273; + } + ts2.isImportSpecifier = isImportSpecifier; + function isExportAssignment(node) { + return node.kind === 274; + } + ts2.isExportAssignment = isExportAssignment; + function isExportDeclaration(node) { + return node.kind === 275; + } + ts2.isExportDeclaration = isExportDeclaration; + function isNamedExports(node) { + return node.kind === 276; + } + ts2.isNamedExports = isNamedExports; + function isExportSpecifier(node) { + return node.kind === 278; + } + ts2.isExportSpecifier = isExportSpecifier; + function isMissingDeclaration(node) { + return node.kind === 279; + } + ts2.isMissingDeclaration = isMissingDeclaration; + function isNotEmittedStatement(node) { + return node.kind === 352; + } + ts2.isNotEmittedStatement = isNotEmittedStatement; + function isSyntheticReference(node) { + return node.kind === 357; + } + ts2.isSyntheticReference = isSyntheticReference; + function isMergeDeclarationMarker(node) { + return node.kind === 355; + } + ts2.isMergeDeclarationMarker = isMergeDeclarationMarker; + function isEndOfDeclarationMarker(node) { + return node.kind === 356; + } + ts2.isEndOfDeclarationMarker = isEndOfDeclarationMarker; + function isExternalModuleReference(node) { + return node.kind === 280; + } + ts2.isExternalModuleReference = isExternalModuleReference; + function isJsxElement(node) { + return node.kind === 281; + } + ts2.isJsxElement = isJsxElement; + function isJsxSelfClosingElement(node) { + return node.kind === 282; + } + ts2.isJsxSelfClosingElement = isJsxSelfClosingElement; + function isJsxOpeningElement(node) { + return node.kind === 283; + } + ts2.isJsxOpeningElement = isJsxOpeningElement; + function isJsxClosingElement(node) { + return node.kind === 284; + } + ts2.isJsxClosingElement = isJsxClosingElement; + function isJsxFragment(node) { + return node.kind === 285; + } + ts2.isJsxFragment = isJsxFragment; + function isJsxOpeningFragment(node) { + return node.kind === 286; + } + ts2.isJsxOpeningFragment = isJsxOpeningFragment; + function isJsxClosingFragment(node) { + return node.kind === 287; + } + ts2.isJsxClosingFragment = isJsxClosingFragment; + function isJsxAttribute(node) { + return node.kind === 288; + } + ts2.isJsxAttribute = isJsxAttribute; + function isJsxAttributes(node) { + return node.kind === 289; + } + ts2.isJsxAttributes = isJsxAttributes; + function isJsxSpreadAttribute(node) { + return node.kind === 290; + } + ts2.isJsxSpreadAttribute = isJsxSpreadAttribute; + function isJsxExpression(node) { + return node.kind === 291; + } + ts2.isJsxExpression = isJsxExpression; + function isCaseClause(node) { + return node.kind === 292; + } + ts2.isCaseClause = isCaseClause; + function isDefaultClause(node) { + return node.kind === 293; + } + ts2.isDefaultClause = isDefaultClause; + function isHeritageClause(node) { + return node.kind === 294; + } + ts2.isHeritageClause = isHeritageClause; + function isCatchClause(node) { + return node.kind === 295; + } + ts2.isCatchClause = isCatchClause; + function isPropertyAssignment(node) { + return node.kind === 299; + } + ts2.isPropertyAssignment = isPropertyAssignment; + function isShorthandPropertyAssignment(node) { + return node.kind === 300; + } + ts2.isShorthandPropertyAssignment = isShorthandPropertyAssignment; + function isSpreadAssignment(node) { + return node.kind === 301; + } + ts2.isSpreadAssignment = isSpreadAssignment; + function isEnumMember(node) { + return node.kind === 302; + } + ts2.isEnumMember = isEnumMember; + function isUnparsedPrepend(node) { + return node.kind === 304; + } + ts2.isUnparsedPrepend = isUnparsedPrepend; + function isSourceFile(node) { + return node.kind === 308; + } + ts2.isSourceFile = isSourceFile; + function isBundle(node) { + return node.kind === 309; + } + ts2.isBundle = isBundle; + function isUnparsedSource(node) { + return node.kind === 310; + } + ts2.isUnparsedSource = isUnparsedSource; + function isJSDocTypeExpression(node) { + return node.kind === 312; + } + ts2.isJSDocTypeExpression = isJSDocTypeExpression; + function isJSDocNameReference(node) { + return node.kind === 313; + } + ts2.isJSDocNameReference = isJSDocNameReference; + function isJSDocMemberName(node) { + return node.kind === 314; + } + ts2.isJSDocMemberName = isJSDocMemberName; + function isJSDocLink(node) { + return node.kind === 327; + } + ts2.isJSDocLink = isJSDocLink; + function isJSDocLinkCode(node) { + return node.kind === 328; + } + ts2.isJSDocLinkCode = isJSDocLinkCode; + function isJSDocLinkPlain(node) { + return node.kind === 329; + } + ts2.isJSDocLinkPlain = isJSDocLinkPlain; + function isJSDocAllType(node) { + return node.kind === 315; + } + ts2.isJSDocAllType = isJSDocAllType; + function isJSDocUnknownType(node) { + return node.kind === 316; + } + ts2.isJSDocUnknownType = isJSDocUnknownType; + function isJSDocNullableType(node) { + return node.kind === 317; + } + ts2.isJSDocNullableType = isJSDocNullableType; + function isJSDocNonNullableType(node) { + return node.kind === 318; + } + ts2.isJSDocNonNullableType = isJSDocNonNullableType; + function isJSDocOptionalType(node) { + return node.kind === 319; + } + ts2.isJSDocOptionalType = isJSDocOptionalType; + function isJSDocFunctionType(node) { + return node.kind === 320; + } + ts2.isJSDocFunctionType = isJSDocFunctionType; + function isJSDocVariadicType(node) { + return node.kind === 321; + } + ts2.isJSDocVariadicType = isJSDocVariadicType; + function isJSDocNamepathType(node) { + return node.kind === 322; + } + ts2.isJSDocNamepathType = isJSDocNamepathType; + function isJSDoc(node) { + return node.kind === 323; + } + ts2.isJSDoc = isJSDoc; + function isJSDocTypeLiteral(node) { + return node.kind === 325; + } + ts2.isJSDocTypeLiteral = isJSDocTypeLiteral; + function isJSDocSignature(node) { + return node.kind === 326; + } + ts2.isJSDocSignature = isJSDocSignature; + function isJSDocAugmentsTag(node) { + return node.kind === 331; + } + ts2.isJSDocAugmentsTag = isJSDocAugmentsTag; + function isJSDocAuthorTag(node) { + return node.kind === 333; + } + ts2.isJSDocAuthorTag = isJSDocAuthorTag; + function isJSDocClassTag(node) { + return node.kind === 335; + } + ts2.isJSDocClassTag = isJSDocClassTag; + function isJSDocCallbackTag(node) { + return node.kind === 341; + } + ts2.isJSDocCallbackTag = isJSDocCallbackTag; + function isJSDocPublicTag(node) { + return node.kind === 336; + } + ts2.isJSDocPublicTag = isJSDocPublicTag; + function isJSDocPrivateTag(node) { + return node.kind === 337; + } + ts2.isJSDocPrivateTag = isJSDocPrivateTag; + function isJSDocProtectedTag(node) { + return node.kind === 338; + } + ts2.isJSDocProtectedTag = isJSDocProtectedTag; + function isJSDocReadonlyTag(node) { + return node.kind === 339; + } + ts2.isJSDocReadonlyTag = isJSDocReadonlyTag; + function isJSDocOverrideTag(node) { + return node.kind === 340; + } + ts2.isJSDocOverrideTag = isJSDocOverrideTag; + function isJSDocDeprecatedTag(node) { + return node.kind === 334; + } + ts2.isJSDocDeprecatedTag = isJSDocDeprecatedTag; + function isJSDocSeeTag(node) { + return node.kind === 349; + } + ts2.isJSDocSeeTag = isJSDocSeeTag; + function isJSDocEnumTag(node) { + return node.kind === 342; + } + ts2.isJSDocEnumTag = isJSDocEnumTag; + function isJSDocParameterTag(node) { + return node.kind === 343; + } + ts2.isJSDocParameterTag = isJSDocParameterTag; + function isJSDocReturnTag(node) { + return node.kind === 344; + } + ts2.isJSDocReturnTag = isJSDocReturnTag; + function isJSDocThisTag(node) { + return node.kind === 345; + } + ts2.isJSDocThisTag = isJSDocThisTag; + function isJSDocTypeTag(node) { + return node.kind === 346; + } + ts2.isJSDocTypeTag = isJSDocTypeTag; + function isJSDocTemplateTag(node) { + return node.kind === 347; + } + ts2.isJSDocTemplateTag = isJSDocTemplateTag; + function isJSDocTypedefTag(node) { + return node.kind === 348; + } + ts2.isJSDocTypedefTag = isJSDocTypedefTag; + function isJSDocUnknownTag(node) { + return node.kind === 330; + } + ts2.isJSDocUnknownTag = isJSDocUnknownTag; + function isJSDocPropertyTag(node) { + return node.kind === 350; + } + ts2.isJSDocPropertyTag = isJSDocPropertyTag; + function isJSDocImplementsTag(node) { + return node.kind === 332; + } + ts2.isJSDocImplementsTag = isJSDocImplementsTag; + function isSyntaxList(n7) { + return n7.kind === 351; + } + ts2.isSyntaxList = isSyntaxList; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createEmptyExports(factory) { + return factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([]), + /*moduleSpecifier*/ + void 0 + ); + } + ts2.createEmptyExports = createEmptyExports; + function createMemberAccessForPropertyName(factory, target, memberName, location2) { + if (ts2.isComputedPropertyName(memberName)) { + return ts2.setTextRange(factory.createElementAccessExpression(target, memberName.expression), location2); + } else { + var expression = ts2.setTextRange(ts2.isMemberName(memberName) ? factory.createPropertyAccessExpression(target, memberName) : factory.createElementAccessExpression(target, memberName), memberName); + ts2.getOrCreateEmitNode(expression).flags |= 64; + return expression; + } + } + ts2.createMemberAccessForPropertyName = createMemberAccessForPropertyName; + function createReactNamespace(reactNamespace, parent2) { + var react = ts2.parseNodeFactory.createIdentifier(reactNamespace || "React"); + ts2.setParent(react, ts2.getParseTreeNode(parent2)); + return react; + } + function createJsxFactoryExpressionFromEntityName(factory, jsxFactory, parent2) { + if (ts2.isQualifiedName(jsxFactory)) { + var left = createJsxFactoryExpressionFromEntityName(factory, jsxFactory.left, parent2); + var right = factory.createIdentifier(ts2.idText(jsxFactory.right)); + right.escapedText = jsxFactory.right.escapedText; + return factory.createPropertyAccessExpression(left, right); + } else { + return createReactNamespace(ts2.idText(jsxFactory), parent2); + } + } + function createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parent2) { + return jsxFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFactoryEntity, parent2) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent2), "createElement"); + } + ts2.createJsxFactoryExpression = createJsxFactoryExpression; + function createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parent2) { + return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory, jsxFragmentFactoryEntity, parent2) : factory.createPropertyAccessExpression(createReactNamespace(reactNamespace, parent2), "Fragment"); + } + function createExpressionForJsxElement(factory, callee, tagName, props, children, location2) { + var argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(factory.createNull()); + } + if (children.length > 1) { + for (var _i = 0, children_3 = children; _i < children_3.length; _i++) { + var child = children_3[_i]; + startOnNewLine(child); + argumentsList.push(child); + } + } else { + argumentsList.push(children[0]); + } + } + return ts2.setTextRange(factory.createCallExpression( + callee, + /*typeArguments*/ + void 0, + argumentsList + ), location2); + } + ts2.createExpressionForJsxElement = createExpressionForJsxElement; + function createExpressionForJsxFragment(factory, jsxFactoryEntity, jsxFragmentFactoryEntity, reactNamespace, children, parentElement, location2) { + var tagName = createJsxFragmentFactoryExpression(factory, jsxFragmentFactoryEntity, reactNamespace, parentElement); + var argumentsList = [tagName, factory.createNull()]; + if (children && children.length > 0) { + if (children.length > 1) { + for (var _i = 0, children_4 = children; _i < children_4.length; _i++) { + var child = children_4[_i]; + startOnNewLine(child); + argumentsList.push(child); + } + } else { + argumentsList.push(children[0]); + } + } + return ts2.setTextRange(factory.createCallExpression( + createJsxFactoryExpression(factory, jsxFactoryEntity, reactNamespace, parentElement), + /*typeArguments*/ + void 0, + argumentsList + ), location2); + } + ts2.createExpressionForJsxFragment = createExpressionForJsxFragment; + function createForOfBindingStatement(factory, node, boundValue) { + if (ts2.isVariableDeclarationList(node)) { + var firstDeclaration = ts2.first(node.declarations); + var updatedDeclaration = factory.updateVariableDeclaration( + firstDeclaration, + firstDeclaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + boundValue + ); + return ts2.setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.updateVariableDeclarationList(node, [updatedDeclaration]) + ), + /*location*/ + node + ); + } else { + var updatedExpression = ts2.setTextRange( + factory.createAssignment(node, boundValue), + /*location*/ + node + ); + return ts2.setTextRange( + factory.createExpressionStatement(updatedExpression), + /*location*/ + node + ); + } + } + ts2.createForOfBindingStatement = createForOfBindingStatement; + function insertLeadingStatement(factory, dest, source) { + if (ts2.isBlock(dest)) { + return factory.updateBlock(dest, ts2.setTextRange(factory.createNodeArray(__spreadArray9([source], dest.statements, true)), dest.statements)); + } else { + return factory.createBlock( + factory.createNodeArray([dest, source]), + /*multiLine*/ + true + ); + } + } + ts2.insertLeadingStatement = insertLeadingStatement; + function createExpressionFromEntityName(factory, node) { + if (ts2.isQualifiedName(node)) { + var left = createExpressionFromEntityName(factory, node.left); + var right = ts2.setParent(ts2.setTextRange(factory.cloneNode(node.right), node.right), node.right.parent); + return ts2.setTextRange(factory.createPropertyAccessExpression(left, right), node); + } else { + return ts2.setParent(ts2.setTextRange(factory.cloneNode(node), node), node.parent); + } + } + ts2.createExpressionFromEntityName = createExpressionFromEntityName; + function createExpressionForPropertyName(factory, memberName) { + if (ts2.isIdentifier(memberName)) { + return factory.createStringLiteralFromNode(memberName); + } else if (ts2.isComputedPropertyName(memberName)) { + return ts2.setParent(ts2.setTextRange(factory.cloneNode(memberName.expression), memberName.expression), memberName.expression.parent); + } else { + return ts2.setParent(ts2.setTextRange(factory.cloneNode(memberName), memberName), memberName.parent); + } + } + ts2.createExpressionForPropertyName = createExpressionForPropertyName; + function createExpressionForAccessorDeclaration(factory, properties, property2, receiver, multiLine) { + var _a2 = ts2.getAllAccessorDeclarations(properties, property2), firstAccessor = _a2.firstAccessor, getAccessor = _a2.getAccessor, setAccessor = _a2.setAccessor; + if (property2 === firstAccessor) { + return ts2.setTextRange(factory.createObjectDefinePropertyCall(receiver, createExpressionForPropertyName(factory, property2.name), factory.createPropertyDescriptor({ + enumerable: factory.createFalse(), + configurable: true, + get: getAccessor && ts2.setTextRange(ts2.setOriginalNode(factory.createFunctionExpression( + ts2.getModifiers(getAccessor), + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + getAccessor.parameters, + /*type*/ + void 0, + getAccessor.body + // TODO: GH#18217 + ), getAccessor), getAccessor), + set: setAccessor && ts2.setTextRange(ts2.setOriginalNode(factory.createFunctionExpression( + ts2.getModifiers(setAccessor), + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + setAccessor.parameters, + /*type*/ + void 0, + setAccessor.body + // TODO: GH#18217 + ), setAccessor), setAccessor) + }, !multiLine)), firstAccessor); + } + return void 0; + } + function createExpressionForPropertyAssignment(factory, property2, receiver) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createAssignment(createMemberAccessForPropertyName( + factory, + receiver, + property2.name, + /*location*/ + property2.name + ), property2.initializer), property2), property2); + } + function createExpressionForShorthandPropertyAssignment(factory, property2, receiver) { + return ts2.setOriginalNode( + ts2.setTextRange( + factory.createAssignment(createMemberAccessForPropertyName( + factory, + receiver, + property2.name, + /*location*/ + property2.name + ), factory.cloneNode(property2.name)), + /*location*/ + property2 + ), + /*original*/ + property2 + ); + } + function createExpressionForMethodDeclaration(factory, method2, receiver) { + return ts2.setOriginalNode( + ts2.setTextRange( + factory.createAssignment(createMemberAccessForPropertyName( + factory, + receiver, + method2.name, + /*location*/ + method2.name + ), ts2.setOriginalNode( + ts2.setTextRange( + factory.createFunctionExpression( + ts2.getModifiers(method2), + method2.asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + method2.parameters, + /*type*/ + void 0, + method2.body + // TODO: GH#18217 + ), + /*location*/ + method2 + ), + /*original*/ + method2 + )), + /*location*/ + method2 + ), + /*original*/ + method2 + ); + } + function createExpressionForObjectLiteralElementLike(factory, node, property2, receiver) { + if (property2.name && ts2.isPrivateIdentifier(property2.name)) { + ts2.Debug.failBadSyntaxKind(property2.name, "Private identifiers are not allowed in object literals."); + } + switch (property2.kind) { + case 174: + case 175: + return createExpressionForAccessorDeclaration(factory, node.properties, property2, receiver, !!node.multiLine); + case 299: + return createExpressionForPropertyAssignment(factory, property2, receiver); + case 300: + return createExpressionForShorthandPropertyAssignment(factory, property2, receiver); + case 171: + return createExpressionForMethodDeclaration(factory, property2, receiver); + } + } + ts2.createExpressionForObjectLiteralElementLike = createExpressionForObjectLiteralElementLike; + function expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, recordTempVariable, resultVariable) { + var operator = node.operator; + ts2.Debug.assert(operator === 45 || operator === 46, "Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression"); + var temp = factory.createTempVariable(recordTempVariable); + expression = factory.createAssignment(temp, expression); + ts2.setTextRange(expression, node.operand); + var operation = ts2.isPrefixUnaryExpression(node) ? factory.createPrefixUnaryExpression(operator, temp) : factory.createPostfixUnaryExpression(temp, operator); + ts2.setTextRange(operation, node); + if (resultVariable) { + operation = factory.createAssignment(resultVariable, operation); + ts2.setTextRange(operation, node); + } + expression = factory.createComma(expression, operation); + ts2.setTextRange(expression, node); + if (ts2.isPostfixUnaryExpression(node)) { + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + ts2.expandPreOrPostfixIncrementOrDecrementExpression = expandPreOrPostfixIncrementOrDecrementExpression; + function isInternalName(node) { + return (ts2.getEmitFlags(node) & 32768) !== 0; + } + ts2.isInternalName = isInternalName; + function isLocalName(node) { + return (ts2.getEmitFlags(node) & 16384) !== 0; + } + ts2.isLocalName = isLocalName; + function isExportName(node) { + return (ts2.getEmitFlags(node) & 8192) !== 0; + } + ts2.isExportName = isExportName; + function isUseStrictPrologue(node) { + return ts2.isStringLiteral(node.expression) && node.expression.text === "use strict"; + } + function findUseStrictPrologue(statements) { + for (var _i = 0, statements_1 = statements; _i < statements_1.length; _i++) { + var statement = statements_1[_i]; + if (ts2.isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + return statement; + } + } else { + break; + } + } + return void 0; + } + ts2.findUseStrictPrologue = findUseStrictPrologue; + function startsWithUseStrict(statements) { + var firstStatement = ts2.firstOrUndefined(statements); + return firstStatement !== void 0 && ts2.isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); + } + ts2.startsWithUseStrict = startsWithUseStrict; + function isCommaSequence(node) { + return node.kind === 223 && node.operatorToken.kind === 27 || node.kind === 354; + } + ts2.isCommaSequence = isCommaSequence; + function isJSDocTypeAssertion(node) { + return ts2.isParenthesizedExpression(node) && ts2.isInJSFile(node) && !!ts2.getJSDocTypeTag(node); + } + ts2.isJSDocTypeAssertion = isJSDocTypeAssertion; + function getJSDocTypeAssertionType(node) { + var type3 = ts2.getJSDocType(node); + ts2.Debug.assertIsDefined(type3); + return type3; + } + ts2.getJSDocTypeAssertionType = getJSDocTypeAssertionType; + function isOuterExpression(node, kinds) { + if (kinds === void 0) { + kinds = 15; + } + switch (node.kind) { + case 214: + if (kinds & 16 && isJSDocTypeAssertion(node)) { + return false; + } + return (kinds & 1) !== 0; + case 213: + case 231: + case 235: + return (kinds & 2) !== 0; + case 232: + return (kinds & 4) !== 0; + case 353: + return (kinds & 8) !== 0; + } + return false; + } + ts2.isOuterExpression = isOuterExpression; + function skipOuterExpressions(node, kinds) { + if (kinds === void 0) { + kinds = 15; + } + while (isOuterExpression(node, kinds)) { + node = node.expression; + } + return node; + } + ts2.skipOuterExpressions = skipOuterExpressions; + function skipAssertions(node) { + return skipOuterExpressions( + node, + 6 + /* OuterExpressionKinds.Assertions */ + ); + } + ts2.skipAssertions = skipAssertions; + function startOnNewLine(node) { + return ts2.setStartsOnNewLine( + node, + /*newLine*/ + true + ); + } + ts2.startOnNewLine = startOnNewLine; + function getExternalHelpersModuleName(node) { + var parseNode = ts2.getOriginalNode(node, ts2.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + ts2.getExternalHelpersModuleName = getExternalHelpersModuleName; + function hasRecordedExternalHelpers(sourceFile) { + var parseNode = ts2.getOriginalNode(sourceFile, ts2.isSourceFile); + var emitNode = parseNode && parseNode.emitNode; + return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); + } + ts2.hasRecordedExternalHelpers = hasRecordedExternalHelpers; + function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) { + if (compilerOptions.importHelpers && ts2.isEffectiveExternalModule(sourceFile, compilerOptions)) { + var namedBindings = void 0; + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + if (moduleKind >= ts2.ModuleKind.ES2015 && moduleKind <= ts2.ModuleKind.ESNext || sourceFile.impliedNodeFormat === ts2.ModuleKind.ESNext) { + var helpers = ts2.getEmitHelpers(sourceFile); + if (helpers) { + var helperNames = []; + for (var _i = 0, helpers_3 = helpers; _i < helpers_3.length; _i++) { + var helper = helpers_3[_i]; + if (!helper.scoped) { + var importName = helper.importName; + if (importName) { + ts2.pushIfUnique(helperNames, importName); + } + } + } + if (ts2.some(helperNames)) { + helperNames.sort(ts2.compareStringsCaseSensitive); + namedBindings = nodeFactory.createNamedImports(ts2.map(helperNames, function(name2) { + return ts2.isFileLevelUniqueName(sourceFile, name2) ? nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + nodeFactory.createIdentifier(name2) + ) : nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + nodeFactory.createIdentifier(name2), + helperFactory.getUnscopedHelperName(name2) + ); + })); + var parseNode = ts2.getOriginalNode(sourceFile, ts2.isSourceFile); + var emitNode = ts2.getOrCreateEmitNode(parseNode); + emitNode.externalHelpers = true; + } + } + } else { + var externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault); + if (externalHelpersModuleName) { + namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName); + } + } + if (namedBindings) { + var externalHelpersImportDeclaration = nodeFactory.createImportDeclaration( + /*modifiers*/ + void 0, + nodeFactory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + namedBindings + ), + nodeFactory.createStringLiteral(ts2.externalHelpersModuleNameText), + /*assertClause*/ + void 0 + ); + ts2.addEmitFlags( + externalHelpersImportDeclaration, + 67108864 + /* EmitFlags.NeverApplyImportHelper */ + ); + return externalHelpersImportDeclaration; + } + } + } + ts2.createExternalHelpersImportDeclarationIfNeeded = createExternalHelpersImportDeclarationIfNeeded; + function getOrCreateExternalHelpersModuleNameIfNeeded(factory, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { + if (compilerOptions.importHelpers && ts2.isEffectiveExternalModule(node, compilerOptions)) { + var externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var create2 = (hasExportStarsToExportValues || ts2.getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && moduleKind !== ts2.ModuleKind.System && (moduleKind < ts2.ModuleKind.ES2015 || node.impliedNodeFormat === ts2.ModuleKind.CommonJS); + if (!create2) { + var helpers = ts2.getEmitHelpers(node); + if (helpers) { + for (var _i = 0, helpers_4 = helpers; _i < helpers_4.length; _i++) { + var helper = helpers_4[_i]; + if (!helper.scoped) { + create2 = true; + break; + } + } + } + } + if (create2) { + var parseNode = ts2.getOriginalNode(node, ts2.isSourceFile); + var emitNode = ts2.getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory.createUniqueName(ts2.externalHelpersModuleNameText)); + } + } + } + ts2.getOrCreateExternalHelpersModuleNameIfNeeded = getOrCreateExternalHelpersModuleNameIfNeeded; + function getLocalNameForExternalImport(factory, node, sourceFile) { + var namespaceDeclaration = ts2.getNamespaceDeclarationNode(node); + if (namespaceDeclaration && !ts2.isDefaultImport(node) && !ts2.isExportNamespaceAsDefaultDeclaration(node)) { + var name2 = namespaceDeclaration.name; + return ts2.isGeneratedIdentifier(name2) ? name2 : factory.createIdentifier(ts2.getSourceTextOfNodeFromSourceFile(sourceFile, name2) || ts2.idText(name2)); + } + if (node.kind === 269 && node.importClause) { + return factory.getGeneratedNameForNode(node); + } + if (node.kind === 275 && node.moduleSpecifier) { + return factory.getGeneratedNameForNode(node); + } + return void 0; + } + ts2.getLocalNameForExternalImport = getLocalNameForExternalImport; + function getExternalModuleNameLiteral(factory, importNode, sourceFile, host, resolver, compilerOptions) { + var moduleName3 = ts2.getExternalModuleName(importNode); + if (moduleName3 && ts2.isStringLiteral(moduleName3)) { + return tryGetModuleNameFromDeclaration(importNode, host, factory, resolver, compilerOptions) || tryRenameExternalModule(factory, moduleName3, sourceFile) || factory.cloneNode(moduleName3); + } + return void 0; + } + ts2.getExternalModuleNameLiteral = getExternalModuleNameLiteral; + function tryRenameExternalModule(factory, moduleName3, sourceFile) { + var rename2 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName3.text); + return rename2 ? factory.createStringLiteral(rename2) : void 0; + } + function tryGetModuleNameFromFile(factory, file, host, options) { + if (!file) { + return void 0; + } + if (file.moduleName) { + return factory.createStringLiteral(file.moduleName); + } + if (!file.isDeclarationFile && ts2.outFile(options)) { + return factory.createStringLiteral(ts2.getExternalModuleNameFromPath(host, file.fileName)); + } + return void 0; + } + ts2.tryGetModuleNameFromFile = tryGetModuleNameFromFile; + function tryGetModuleNameFromDeclaration(declaration, host, factory, resolver, compilerOptions) { + return tryGetModuleNameFromFile(factory, resolver.getExternalModuleFileFromDeclaration(declaration), host, compilerOptions); + } + function getInitializerOfBindingOrAssignmentElement(bindingElement) { + if (ts2.isDeclarationBindingElement(bindingElement)) { + return bindingElement.initializer; + } + if (ts2.isPropertyAssignment(bindingElement)) { + var initializer = bindingElement.initializer; + return ts2.isAssignmentExpression( + initializer, + /*excludeCompoundAssignment*/ + true + ) ? initializer.right : void 0; + } + if (ts2.isShorthandPropertyAssignment(bindingElement)) { + return bindingElement.objectAssignmentInitializer; + } + if (ts2.isAssignmentExpression( + bindingElement, + /*excludeCompoundAssignment*/ + true + )) { + return bindingElement.right; + } + if (ts2.isSpreadElement(bindingElement)) { + return getInitializerOfBindingOrAssignmentElement(bindingElement.expression); + } + } + ts2.getInitializerOfBindingOrAssignmentElement = getInitializerOfBindingOrAssignmentElement; + function getTargetOfBindingOrAssignmentElement(bindingElement) { + if (ts2.isDeclarationBindingElement(bindingElement)) { + return bindingElement.name; + } + if (ts2.isObjectLiteralElementLike(bindingElement)) { + switch (bindingElement.kind) { + case 299: + return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); + case 300: + return bindingElement.name; + case 301: + return getTargetOfBindingOrAssignmentElement(bindingElement.expression); + } + return void 0; + } + if (ts2.isAssignmentExpression( + bindingElement, + /*excludeCompoundAssignment*/ + true + )) { + return getTargetOfBindingOrAssignmentElement(bindingElement.left); + } + if (ts2.isSpreadElement(bindingElement)) { + return getTargetOfBindingOrAssignmentElement(bindingElement.expression); + } + return bindingElement; + } + ts2.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; + function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { + switch (bindingElement.kind) { + case 166: + case 205: + return bindingElement.dotDotDotToken; + case 227: + case 301: + return bindingElement; + } + return void 0; + } + ts2.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; + function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { + var propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement); + ts2.Debug.assert(!!propertyName || ts2.isSpreadAssignment(bindingElement), "Invalid property name for binding element."); + return propertyName; + } + ts2.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; + function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { + switch (bindingElement.kind) { + case 205: + if (bindingElement.propertyName) { + var propertyName = bindingElement.propertyName; + if (ts2.isPrivateIdentifier(propertyName)) { + return ts2.Debug.failBadSyntaxKind(propertyName); + } + return ts2.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; + } + break; + case 299: + if (bindingElement.name) { + var propertyName = bindingElement.name; + if (ts2.isPrivateIdentifier(propertyName)) { + return ts2.Debug.failBadSyntaxKind(propertyName); + } + return ts2.isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; + } + break; + case 301: + if (bindingElement.name && ts2.isPrivateIdentifier(bindingElement.name)) { + return ts2.Debug.failBadSyntaxKind(bindingElement.name); + } + return bindingElement.name; + } + var target = getTargetOfBindingOrAssignmentElement(bindingElement); + if (target && ts2.isPropertyName(target)) { + return target; + } + } + ts2.tryGetPropertyNameOfBindingOrAssignmentElement = tryGetPropertyNameOfBindingOrAssignmentElement; + function isStringOrNumericLiteral(node) { + var kind = node.kind; + return kind === 10 || kind === 8; + } + function getElementsOfBindingOrAssignmentPattern(name2) { + switch (name2.kind) { + case 203: + case 204: + case 206: + return name2.elements; + case 207: + return name2.properties; + } + } + ts2.getElementsOfBindingOrAssignmentPattern = getElementsOfBindingOrAssignmentPattern; + function getJSDocTypeAliasName(fullName) { + if (fullName) { + var rightNode = fullName; + while (true) { + if (ts2.isIdentifier(rightNode) || !rightNode.body) { + return ts2.isIdentifier(rightNode) ? rightNode : rightNode.name; + } + rightNode = rightNode.body; + } + } + } + ts2.getJSDocTypeAliasName = getJSDocTypeAliasName; + function canHaveIllegalType(node) { + var kind = node.kind; + return kind === 173 || kind === 175; + } + ts2.canHaveIllegalType = canHaveIllegalType; + function canHaveIllegalTypeParameters(node) { + var kind = node.kind; + return kind === 173 || kind === 174 || kind === 175; + } + ts2.canHaveIllegalTypeParameters = canHaveIllegalTypeParameters; + function canHaveIllegalDecorators(node) { + var kind = node.kind; + return kind === 299 || kind === 300 || kind === 259 || kind === 173 || kind === 178 || kind === 172 || kind === 279 || kind === 240 || kind === 261 || kind === 262 || kind === 263 || kind === 264 || kind === 268 || kind === 269 || kind === 267 || kind === 275 || kind === 274; + } + ts2.canHaveIllegalDecorators = canHaveIllegalDecorators; + function canHaveIllegalModifiers(node) { + var kind = node.kind; + return kind === 172 || kind === 299 || kind === 300 || kind === 181 || kind === 279 || kind === 267; + } + ts2.canHaveIllegalModifiers = canHaveIllegalModifiers; + ts2.isTypeNodeOrTypeParameterDeclaration = ts2.or(ts2.isTypeNode, ts2.isTypeParameterDeclaration); + ts2.isQuestionOrExclamationToken = ts2.or(ts2.isQuestionToken, ts2.isExclamationToken); + ts2.isIdentifierOrThisTypeNode = ts2.or(ts2.isIdentifier, ts2.isThisTypeNode); + ts2.isReadonlyKeywordOrPlusOrMinusToken = ts2.or(ts2.isReadonlyKeyword, ts2.isPlusToken, ts2.isMinusToken); + ts2.isQuestionOrPlusOrMinusToken = ts2.or(ts2.isQuestionToken, ts2.isPlusToken, ts2.isMinusToken); + ts2.isModuleName = ts2.or(ts2.isIdentifier, ts2.isStringLiteral); + function isLiteralTypeLikeExpression(node) { + var kind = node.kind; + return kind === 104 || kind === 110 || kind === 95 || ts2.isLiteralExpression(node) || ts2.isPrefixUnaryExpression(node); + } + ts2.isLiteralTypeLikeExpression = isLiteralTypeLikeExpression; + function isExponentiationOperator(kind) { + return kind === 42; + } + function isMultiplicativeOperator(kind) { + return kind === 41 || kind === 43 || kind === 44; + } + function isMultiplicativeOperatorOrHigher(kind) { + return isExponentiationOperator(kind) || isMultiplicativeOperator(kind); + } + function isAdditiveOperator(kind) { + return kind === 39 || kind === 40; + } + function isAdditiveOperatorOrHigher(kind) { + return isAdditiveOperator(kind) || isMultiplicativeOperatorOrHigher(kind); + } + function isShiftOperator(kind) { + return kind === 47 || kind === 48 || kind === 49; + } + function isShiftOperatorOrHigher(kind) { + return isShiftOperator(kind) || isAdditiveOperatorOrHigher(kind); + } + function isRelationalOperator(kind) { + return kind === 29 || kind === 32 || kind === 31 || kind === 33 || kind === 102 || kind === 101; + } + function isRelationalOperatorOrHigher(kind) { + return isRelationalOperator(kind) || isShiftOperatorOrHigher(kind); + } + function isEqualityOperator(kind) { + return kind === 34 || kind === 36 || kind === 35 || kind === 37; + } + function isEqualityOperatorOrHigher(kind) { + return isEqualityOperator(kind) || isRelationalOperatorOrHigher(kind); + } + function isBitwiseOperator(kind) { + return kind === 50 || kind === 51 || kind === 52; + } + function isBitwiseOperatorOrHigher(kind) { + return isBitwiseOperator(kind) || isEqualityOperatorOrHigher(kind); + } + function isLogicalOperator(kind) { + return kind === 55 || kind === 56; + } + function isLogicalOperatorOrHigher(kind) { + return isLogicalOperator(kind) || isBitwiseOperatorOrHigher(kind); + } + function isAssignmentOperatorOrHigher(kind) { + return kind === 60 || isLogicalOperatorOrHigher(kind) || ts2.isAssignmentOperator(kind); + } + function isBinaryOperator(kind) { + return isAssignmentOperatorOrHigher(kind) || kind === 27; + } + function isBinaryOperatorToken(node) { + return isBinaryOperator(node.kind); + } + ts2.isBinaryOperatorToken = isBinaryOperatorToken; + var BinaryExpressionState; + (function(BinaryExpressionState2) { + function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { + var prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; + ts2.Debug.assertEqual(stateStack[stackIndex], enter); + userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState); + stateStack[stackIndex] = nextState(machine, enter); + return stackIndex; + } + BinaryExpressionState2.enter = enter; + function left(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + ts2.Debug.assertEqual(stateStack[stackIndex], left); + ts2.Debug.assertIsDefined(machine.onLeft); + stateStack[stackIndex] = nextState(machine, left); + var nextNode = machine.onLeft(nodeStack[stackIndex].left, userStateStack[stackIndex], nodeStack[stackIndex]); + if (nextNode) { + checkCircularity(stackIndex, nodeStack, nextNode); + return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); + } + return stackIndex; + } + BinaryExpressionState2.left = left; + function operator(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + ts2.Debug.assertEqual(stateStack[stackIndex], operator); + ts2.Debug.assertIsDefined(machine.onOperator); + stateStack[stackIndex] = nextState(machine, operator); + machine.onOperator(nodeStack[stackIndex].operatorToken, userStateStack[stackIndex], nodeStack[stackIndex]); + return stackIndex; + } + BinaryExpressionState2.operator = operator; + function right(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + ts2.Debug.assertEqual(stateStack[stackIndex], right); + ts2.Debug.assertIsDefined(machine.onRight); + stateStack[stackIndex] = nextState(machine, right); + var nextNode = machine.onRight(nodeStack[stackIndex].right, userStateStack[stackIndex], nodeStack[stackIndex]); + if (nextNode) { + checkCircularity(stackIndex, nodeStack, nextNode); + return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); + } + return stackIndex; + } + BinaryExpressionState2.right = right; + function exit3(machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, _outerState) { + ts2.Debug.assertEqual(stateStack[stackIndex], exit3); + stateStack[stackIndex] = nextState(machine, exit3); + var result2 = machine.onExit(nodeStack[stackIndex], userStateStack[stackIndex]); + if (stackIndex > 0) { + stackIndex--; + if (machine.foldState) { + var side = stateStack[stackIndex] === exit3 ? "right" : "left"; + userStateStack[stackIndex] = machine.foldState(userStateStack[stackIndex], result2, side); + } + } else { + resultHolder.value = result2; + } + return stackIndex; + } + BinaryExpressionState2.exit = exit3; + function done(_machine, stackIndex, stateStack, _nodeStack, _userStateStack, _resultHolder, _outerState) { + ts2.Debug.assertEqual(stateStack[stackIndex], done); + return stackIndex; + } + BinaryExpressionState2.done = done; + function nextState(machine, currentState) { + switch (currentState) { + case enter: + if (machine.onLeft) + return left; + case left: + if (machine.onOperator) + return operator; + case operator: + if (machine.onRight) + return right; + case right: + return exit3; + case exit3: + return done; + case done: + return done; + default: + ts2.Debug.fail("Invalid state"); + } + } + BinaryExpressionState2.nextState = nextState; + function pushStack(stackIndex, stateStack, nodeStack, userStateStack, node) { + stackIndex++; + stateStack[stackIndex] = enter; + nodeStack[stackIndex] = node; + userStateStack[stackIndex] = void 0; + return stackIndex; + } + function checkCircularity(stackIndex, nodeStack, node) { + if (ts2.Debug.shouldAssert( + 2 + /* AssertionLevel.Aggressive */ + )) { + while (stackIndex >= 0) { + ts2.Debug.assert(nodeStack[stackIndex] !== node, "Circular traversal detected."); + stackIndex--; + } + } + } + })(BinaryExpressionState || (BinaryExpressionState = {})); + var BinaryExpressionStateMachine = ( + /** @class */ + /* @__PURE__ */ function() { + function BinaryExpressionStateMachine2(onEnter, onLeft, onOperator, onRight, onExit, foldState) { + this.onEnter = onEnter; + this.onLeft = onLeft; + this.onOperator = onOperator; + this.onRight = onRight; + this.onExit = onExit; + this.foldState = foldState; + } + return BinaryExpressionStateMachine2; + }() + ); + function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState) { + var machine = new BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState); + return trampoline; + function trampoline(node, outerState) { + var resultHolder = { value: void 0 }; + var stateStack = [BinaryExpressionState.enter]; + var nodeStack = [node]; + var userStateStack = [void 0]; + var stackIndex = 0; + while (stateStack[stackIndex] !== BinaryExpressionState.done) { + stackIndex = stateStack[stackIndex](machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, outerState); + } + ts2.Debug.assertEqual(stackIndex, 0); + return resultHolder.value; + } + } + ts2.createBinaryExpressionTrampoline = createBinaryExpressionTrampoline; + function elideNodes(factory, nodes) { + if (nodes === void 0) + return void 0; + if (nodes.length === 0) + return nodes; + return ts2.setTextRange(factory.createNodeArray([], nodes.hasTrailingComma), nodes); + } + ts2.elideNodes = elideNodes; + function getNodeForGeneratedName(name2) { + if (name2.autoGenerateFlags & 4) { + var autoGenerateId = name2.autoGenerateId; + var node = name2; + var original = node.original; + while (original) { + node = original; + if (ts2.isMemberName(node) && !!(node.autoGenerateFlags & 4) && node.autoGenerateId !== autoGenerateId) { + break; + } + original = node.original; + } + return node; + } + return name2; + } + ts2.getNodeForGeneratedName = getNodeForGeneratedName; + function formatGeneratedNamePart(part, generateName) { + return typeof part === "object" ? formatGeneratedName( + /*privateName*/ + false, + part.prefix, + part.node, + part.suffix, + generateName + ) : typeof part === "string" ? part.length > 0 && part.charCodeAt(0) === 35 ? part.slice(1) : part : ""; + } + ts2.formatGeneratedNamePart = formatGeneratedNamePart; + function formatIdentifier(name2, generateName) { + return typeof name2 === "string" ? name2 : formatIdentifierWorker(name2, ts2.Debug.checkDefined(generateName)); + } + function formatIdentifierWorker(node, generateName) { + return ts2.isGeneratedPrivateIdentifier(node) ? generateName(node).slice(1) : ts2.isGeneratedIdentifier(node) ? generateName(node) : ts2.isPrivateIdentifier(node) ? node.escapedText.slice(1) : ts2.idText(node); + } + function formatGeneratedName(privateName, prefix, baseName, suffix, generateName) { + prefix = formatGeneratedNamePart(prefix, generateName); + suffix = formatGeneratedNamePart(suffix, generateName); + baseName = formatIdentifier(baseName, generateName); + return "".concat(privateName ? "#" : "").concat(prefix).concat(baseName).concat(suffix); + } + ts2.formatGeneratedName = formatGeneratedName; + function createAccessorPropertyBackingField(factory, node, modifiers, initializer) { + return factory.updatePropertyDeclaration( + node, + modifiers, + factory.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + ), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + ts2.createAccessorPropertyBackingField = createAccessorPropertyBackingField; + function createAccessorPropertyGetRedirector(factory, node, modifiers, name2) { + return factory.createGetAccessorDeclaration( + modifiers, + name2, + [], + /*type*/ + void 0, + factory.createBlock([ + factory.createReturnStatement(factory.createPropertyAccessExpression(factory.createThis(), factory.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + ))) + ]) + ); + } + ts2.createAccessorPropertyGetRedirector = createAccessorPropertyGetRedirector; + function createAccessorPropertySetRedirector(factory, node, modifiers, name2) { + return factory.createSetAccessorDeclaration(modifiers, name2, [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotdotDotToken*/ + void 0, + "value" + )], factory.createBlock([ + factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createThis(), factory.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + )), factory.createIdentifier("value"))) + ])); + } + ts2.createAccessorPropertySetRedirector = createAccessorPropertySetRedirector; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function setTextRange(range2, location2) { + return location2 ? ts2.setTextRangePosEnd(range2, location2.pos, location2.end) : range2; + } + ts2.setTextRange = setTextRange; + function canHaveModifiers(node) { + var kind = node.kind; + return kind === 165 || kind === 166 || kind === 168 || kind === 169 || kind === 170 || kind === 171 || kind === 173 || kind === 174 || kind === 175 || kind === 178 || kind === 182 || kind === 215 || kind === 216 || kind === 228 || kind === 240 || kind === 259 || kind === 260 || kind === 261 || kind === 262 || kind === 263 || kind === 264 || kind === 268 || kind === 269 || kind === 274 || kind === 275; + } + ts2.canHaveModifiers = canHaveModifiers; + function canHaveDecorators(node) { + var kind = node.kind; + return kind === 166 || kind === 169 || kind === 171 || kind === 174 || kind === 175 || kind === 228 || kind === 260; + } + ts2.canHaveDecorators = canHaveDecorators; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var _a2; + var SignatureFlags; + (function(SignatureFlags2) { + SignatureFlags2[SignatureFlags2["None"] = 0] = "None"; + SignatureFlags2[SignatureFlags2["Yield"] = 1] = "Yield"; + SignatureFlags2[SignatureFlags2["Await"] = 2] = "Await"; + SignatureFlags2[SignatureFlags2["Type"] = 4] = "Type"; + SignatureFlags2[SignatureFlags2["IgnoreMissingOpenBrace"] = 16] = "IgnoreMissingOpenBrace"; + SignatureFlags2[SignatureFlags2["JSDoc"] = 32] = "JSDoc"; + })(SignatureFlags || (SignatureFlags = {})); + var SpeculationKind; + (function(SpeculationKind2) { + SpeculationKind2[SpeculationKind2["TryParse"] = 0] = "TryParse"; + SpeculationKind2[SpeculationKind2["Lookahead"] = 1] = "Lookahead"; + SpeculationKind2[SpeculationKind2["Reparse"] = 2] = "Reparse"; + })(SpeculationKind || (SpeculationKind = {})); + var NodeConstructor; + var TokenConstructor; + var IdentifierConstructor; + var PrivateIdentifierConstructor; + var SourceFileConstructor; + ts2.parseBaseNodeFactory = { + createBaseSourceFileNode: function(kind) { + return new (SourceFileConstructor || (SourceFileConstructor = ts2.objectAllocator.getSourceFileConstructor()))(kind, -1, -1); + }, + createBaseIdentifierNode: function(kind) { + return new (IdentifierConstructor || (IdentifierConstructor = ts2.objectAllocator.getIdentifierConstructor()))(kind, -1, -1); + }, + createBasePrivateIdentifierNode: function(kind) { + return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts2.objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1); + }, + createBaseTokenNode: function(kind) { + return new (TokenConstructor || (TokenConstructor = ts2.objectAllocator.getTokenConstructor()))(kind, -1, -1); + }, + createBaseNode: function(kind) { + return new (NodeConstructor || (NodeConstructor = ts2.objectAllocator.getNodeConstructor()))(kind, -1, -1); + } + }; + ts2.parseNodeFactory = ts2.createNodeFactory(1, ts2.parseBaseNodeFactory); + function visitNode(cbNode, node) { + return node && cbNode(node); + } + function visitNodes(cbNode, cbNodes, nodes) { + if (nodes) { + if (cbNodes) { + return cbNodes(nodes); + } + for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + var node = nodes_1[_i]; + var result2 = cbNode(node); + if (result2) { + return result2; + } + } + } + } + function isJSDocLikeText(text, start) { + return text.charCodeAt(start + 1) === 42 && text.charCodeAt(start + 2) === 42 && text.charCodeAt(start + 3) !== 47; + } + ts2.isJSDocLikeText = isJSDocLikeText; + function isFileProbablyExternalModule(sourceFile) { + return ts2.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) || getImportMetaIfNecessary(sourceFile); + } + ts2.isFileProbablyExternalModule = isFileProbablyExternalModule; + function isAnExternalModuleIndicatorNode(node) { + return ts2.canHaveModifiers(node) && hasModifierOfKind( + node, + 93 + /* SyntaxKind.ExportKeyword */ + ) || ts2.isImportEqualsDeclaration(node) && ts2.isExternalModuleReference(node.moduleReference) || ts2.isImportDeclaration(node) || ts2.isExportAssignment(node) || ts2.isExportDeclaration(node) ? node : void 0; + } + function getImportMetaIfNecessary(sourceFile) { + return sourceFile.flags & 4194304 ? walkTreeForImportMeta(sourceFile) : void 0; + } + function walkTreeForImportMeta(node) { + return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta); + } + function hasModifierOfKind(node, kind) { + return ts2.some(node.modifiers, function(m7) { + return m7.kind === kind; + }); + } + function isImportMeta(node) { + return ts2.isMetaProperty(node) && node.keywordToken === 100 && node.name.escapedText === "meta"; + } + var forEachChildTable = (_a2 = {}, _a2[ + 163 + /* SyntaxKind.QualifiedName */ + ] = function forEachChildInQualifiedName(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); + }, _a2[ + 165 + /* SyntaxKind.TypeParameter */ + ] = function forEachChildInTypeParameter(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); + }, _a2[ + 300 + /* SyntaxKind.ShorthandPropertyAssignment */ + ] = function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); + }, _a2[ + 301 + /* SyntaxKind.SpreadAssignment */ + ] = function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 166 + /* SyntaxKind.Parameter */ + ] = function forEachChildInParameter(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); + }, _a2[ + 169 + /* SyntaxKind.PropertyDeclaration */ + ] = function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); + }, _a2[ + 168 + /* SyntaxKind.PropertySignature */ + ] = function forEachChildInPropertySignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); + }, _a2[ + 299 + /* SyntaxKind.PropertyAssignment */ + ] = function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.initializer); + }, _a2[ + 257 + /* SyntaxKind.VariableDeclaration */ + ] = function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); + }, _a2[ + 205 + /* SyntaxKind.BindingElement */ + ] = function forEachChildInBindingElement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + }, _a2[ + 178 + /* SyntaxKind.IndexSignature */ + ] = function forEachChildInIndexSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + }, _a2[ + 182 + /* SyntaxKind.ConstructorType */ + ] = function forEachChildInConstructorType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + }, _a2[ + 181 + /* SyntaxKind.FunctionType */ + ] = function forEachChildInFunctionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + }, _a2[ + 176 + /* SyntaxKind.CallSignature */ + ] = forEachChildInCallOrConstructSignature, _a2[ + 177 + /* SyntaxKind.ConstructSignature */ + ] = forEachChildInCallOrConstructSignature, _a2[ + 171 + /* SyntaxKind.MethodDeclaration */ + ] = function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 170 + /* SyntaxKind.MethodSignature */ + ] = function forEachChildInMethodSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + }, _a2[ + 173 + /* SyntaxKind.Constructor */ + ] = function forEachChildInConstructor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 174 + /* SyntaxKind.GetAccessor */ + ] = function forEachChildInGetAccessor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 175 + /* SyntaxKind.SetAccessor */ + ] = function forEachChildInSetAccessor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 259 + /* SyntaxKind.FunctionDeclaration */ + ] = function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 215 + /* SyntaxKind.FunctionExpression */ + ] = function forEachChildInFunctionExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.body); + }, _a2[ + 216 + /* SyntaxKind.ArrowFunction */ + ] = function forEachChildInArrowFunction(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); + }, _a2[ + 172 + /* SyntaxKind.ClassStaticBlockDeclaration */ + ] = function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.body); + }, _a2[ + 180 + /* SyntaxKind.TypeReference */ + ] = function forEachChildInTypeReference(node, cbNode, cbNodes) { + return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, _a2[ + 179 + /* SyntaxKind.TypePredicate */ + ] = function forEachChildInTypePredicate(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.assertsModifier) || visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); + }, _a2[ + 183 + /* SyntaxKind.TypeQuery */ + ] = function forEachChildInTypeQuery(node, cbNode, cbNodes) { + return visitNode(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, _a2[ + 184 + /* SyntaxKind.TypeLiteral */ + ] = function forEachChildInTypeLiteral(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.members); + }, _a2[ + 185 + /* SyntaxKind.ArrayType */ + ] = function forEachChildInArrayType(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.elementType); + }, _a2[ + 186 + /* SyntaxKind.TupleType */ + ] = function forEachChildInTupleType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, _a2[ + 189 + /* SyntaxKind.UnionType */ + ] = forEachChildInUnionOrIntersectionType, _a2[ + 190 + /* SyntaxKind.IntersectionType */ + ] = forEachChildInUnionOrIntersectionType, _a2[ + 191 + /* SyntaxKind.ConditionalType */ + ] = function forEachChildInConditionalType(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.checkType) || visitNode(cbNode, node.extendsType) || visitNode(cbNode, node.trueType) || visitNode(cbNode, node.falseType); + }, _a2[ + 192 + /* SyntaxKind.InferType */ + ] = function forEachChildInInferType(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.typeParameter); + }, _a2[ + 202 + /* SyntaxKind.ImportType */ + ] = function forEachChildInImportType(node, cbNode, cbNodes) { + return visitNode(cbNode, node.argument) || visitNode(cbNode, node.assertions) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, _a2[ + 298 + /* SyntaxKind.ImportTypeAssertionContainer */ + ] = function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.assertClause); + }, _a2[ + 193 + /* SyntaxKind.ParenthesizedType */ + ] = forEachChildInParenthesizedTypeOrTypeOperator, _a2[ + 195 + /* SyntaxKind.TypeOperator */ + ] = forEachChildInParenthesizedTypeOrTypeOperator, _a2[ + 196 + /* SyntaxKind.IndexedAccessType */ + ] = function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); + }, _a2[ + 197 + /* SyntaxKind.MappedType */ + ] = function forEachChildInMappedType(node, cbNode, cbNodes) { + return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.nameType) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); + }, _a2[ + 198 + /* SyntaxKind.LiteralType */ + ] = function forEachChildInLiteralType(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.literal); + }, _a2[ + 199 + /* SyntaxKind.NamedTupleMember */ + ] = function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); + }, _a2[ + 203 + /* SyntaxKind.ObjectBindingPattern */ + ] = forEachChildInObjectOrArrayBindingPattern, _a2[ + 204 + /* SyntaxKind.ArrayBindingPattern */ + ] = forEachChildInObjectOrArrayBindingPattern, _a2[ + 206 + /* SyntaxKind.ArrayLiteralExpression */ + ] = function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, _a2[ + 207 + /* SyntaxKind.ObjectLiteralExpression */ + ] = function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.properties); + }, _a2[ + 208 + /* SyntaxKind.PropertyAccessExpression */ + ] = function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.name); + }, _a2[ + 209 + /* SyntaxKind.ElementAccessExpression */ + ] = function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.questionDotToken) || visitNode(cbNode, node.argumentExpression); + }, _a2[ + 210 + /* SyntaxKind.CallExpression */ + ] = forEachChildInCallOrNewExpression, _a2[ + 211 + /* SyntaxKind.NewExpression */ + ] = forEachChildInCallOrNewExpression, _a2[ + 212 + /* SyntaxKind.TaggedTemplateExpression */ + ] = function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tag) || visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.template); + }, _a2[ + 213 + /* SyntaxKind.TypeAssertionExpression */ + ] = function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); + }, _a2[ + 214 + /* SyntaxKind.ParenthesizedExpression */ + ] = function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 217 + /* SyntaxKind.DeleteExpression */ + ] = function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 218 + /* SyntaxKind.TypeOfExpression */ + ] = function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 219 + /* SyntaxKind.VoidExpression */ + ] = function forEachChildInVoidExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 221 + /* SyntaxKind.PrefixUnaryExpression */ + ] = function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.operand); + }, _a2[ + 226 + /* SyntaxKind.YieldExpression */ + ] = function forEachChildInYieldExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); + }, _a2[ + 220 + /* SyntaxKind.AwaitExpression */ + ] = function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 222 + /* SyntaxKind.PostfixUnaryExpression */ + ] = function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.operand); + }, _a2[ + 223 + /* SyntaxKind.BinaryExpression */ + ] = function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); + }, _a2[ + 231 + /* SyntaxKind.AsExpression */ + ] = function forEachChildInAsExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); + }, _a2[ + 232 + /* SyntaxKind.NonNullExpression */ + ] = function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 235 + /* SyntaxKind.SatisfiesExpression */ + ] = function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); + }, _a2[ + 233 + /* SyntaxKind.MetaProperty */ + ] = function forEachChildInMetaProperty(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name); + }, _a2[ + 224 + /* SyntaxKind.ConditionalExpression */ + ] = function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); + }, _a2[ + 227 + /* SyntaxKind.SpreadElement */ + ] = function forEachChildInSpreadElement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 238 + /* SyntaxKind.Block */ + ] = forEachChildInBlock, _a2[ + 265 + /* SyntaxKind.ModuleBlock */ + ] = forEachChildInBlock, _a2[ + 308 + /* SyntaxKind.SourceFile */ + ] = function forEachChildInSourceFile(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); + }, _a2[ + 240 + /* SyntaxKind.VariableStatement */ + ] = function forEachChildInVariableStatement(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); + }, _a2[ + 258 + /* SyntaxKind.VariableDeclarationList */ + ] = function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.declarations); + }, _a2[ + 241 + /* SyntaxKind.ExpressionStatement */ + ] = function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 242 + /* SyntaxKind.IfStatement */ + ] = function forEachChildInIfStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); + }, _a2[ + 243 + /* SyntaxKind.DoStatement */ + ] = function forEachChildInDoStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); + }, _a2[ + 244 + /* SyntaxKind.WhileStatement */ + ] = function forEachChildInWhileStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + }, _a2[ + 245 + /* SyntaxKind.ForStatement */ + ] = function forEachChildInForStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); + }, _a2[ + 246 + /* SyntaxKind.ForInStatement */ + ] = function forEachChildInForInStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + }, _a2[ + 247 + /* SyntaxKind.ForOfStatement */ + ] = function forEachChildInForOfStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + }, _a2[ + 248 + /* SyntaxKind.ContinueStatement */ + ] = forEachChildInContinueOrBreakStatement, _a2[ + 249 + /* SyntaxKind.BreakStatement */ + ] = forEachChildInContinueOrBreakStatement, _a2[ + 250 + /* SyntaxKind.ReturnStatement */ + ] = function forEachChildInReturnStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 251 + /* SyntaxKind.WithStatement */ + ] = function forEachChildInWithStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); + }, _a2[ + 252 + /* SyntaxKind.SwitchStatement */ + ] = function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); + }, _a2[ + 266 + /* SyntaxKind.CaseBlock */ + ] = function forEachChildInCaseBlock(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.clauses); + }, _a2[ + 292 + /* SyntaxKind.CaseClause */ + ] = function forEachChildInCaseClause(node, cbNode, cbNodes) { + return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); + }, _a2[ + 293 + /* SyntaxKind.DefaultClause */ + ] = function forEachChildInDefaultClause(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements); + }, _a2[ + 253 + /* SyntaxKind.LabeledStatement */ + ] = function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); + }, _a2[ + 254 + /* SyntaxKind.ThrowStatement */ + ] = function forEachChildInThrowStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 255 + /* SyntaxKind.TryStatement */ + ] = function forEachChildInTryStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); + }, _a2[ + 295 + /* SyntaxKind.CatchClause */ + ] = function forEachChildInCatchClause(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); + }, _a2[ + 167 + /* SyntaxKind.Decorator */ + ] = function forEachChildInDecorator(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 260 + /* SyntaxKind.ClassDeclaration */ + ] = forEachChildInClassDeclarationOrExpression, _a2[ + 228 + /* SyntaxKind.ClassExpression */ + ] = forEachChildInClassDeclarationOrExpression, _a2[ + 261 + /* SyntaxKind.InterfaceDeclaration */ + ] = function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + }, _a2[ + 262 + /* SyntaxKind.TypeAliasDeclaration */ + ] = function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); + }, _a2[ + 263 + /* SyntaxKind.EnumDeclaration */ + ] = function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + }, _a2[ + 302 + /* SyntaxKind.EnumMember */ + ] = function forEachChildInEnumMember(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + }, _a2[ + 264 + /* SyntaxKind.ModuleDeclaration */ + ] = function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); + }, _a2[ + 268 + /* SyntaxKind.ImportEqualsDeclaration */ + ] = function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); + }, _a2[ + 269 + /* SyntaxKind.ImportDeclaration */ + ] = function forEachChildInImportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier) || visitNode(cbNode, node.assertClause); + }, _a2[ + 270 + /* SyntaxKind.ImportClause */ + ] = function forEachChildInImportClause(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); + }, _a2[ + 296 + /* SyntaxKind.AssertClause */ + ] = function forEachChildInAssertClause(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, _a2[ + 297 + /* SyntaxKind.AssertEntry */ + ] = function forEachChildInAssertEntry(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name) || visitNode(cbNode, node.value); + }, _a2[ + 267 + /* SyntaxKind.NamespaceExportDeclaration */ + ] = function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode(cbNode, node.name); + }, _a2[ + 271 + /* SyntaxKind.NamespaceImport */ + ] = function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name); + }, _a2[ + 277 + /* SyntaxKind.NamespaceExport */ + ] = function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name); + }, _a2[ + 272 + /* SyntaxKind.NamedImports */ + ] = forEachChildInNamedImportsOrExports, _a2[ + 276 + /* SyntaxKind.NamedExports */ + ] = forEachChildInNamedImportsOrExports, _a2[ + 275 + /* SyntaxKind.ExportDeclaration */ + ] = function forEachChildInExportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier) || visitNode(cbNode, node.assertClause); + }, _a2[ + 273 + /* SyntaxKind.ImportSpecifier */ + ] = forEachChildInImportOrExportSpecifier, _a2[ + 278 + /* SyntaxKind.ExportSpecifier */ + ] = forEachChildInImportOrExportSpecifier, _a2[ + 274 + /* SyntaxKind.ExportAssignment */ + ] = function forEachChildInExportAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); + }, _a2[ + 225 + /* SyntaxKind.TemplateExpression */ + ] = function forEachChildInTemplateExpression(node, cbNode, cbNodes) { + return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); + }, _a2[ + 236 + /* SyntaxKind.TemplateSpan */ + ] = function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); + }, _a2[ + 200 + /* SyntaxKind.TemplateLiteralType */ + ] = function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { + return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); + }, _a2[ + 201 + /* SyntaxKind.TemplateLiteralTypeSpan */ + ] = function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.type) || visitNode(cbNode, node.literal); + }, _a2[ + 164 + /* SyntaxKind.ComputedPropertyName */ + ] = function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 294 + /* SyntaxKind.HeritageClause */ + ] = function forEachChildInHeritageClause(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.types); + }, _a2[ + 230 + /* SyntaxKind.ExpressionWithTypeArguments */ + ] = function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { + return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, _a2[ + 280 + /* SyntaxKind.ExternalModuleReference */ + ] = function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 279 + /* SyntaxKind.MissingDeclaration */ + ] = function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); + }, _a2[ + 354 + /* SyntaxKind.CommaListExpression */ + ] = function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, _a2[ + 281 + /* SyntaxKind.JsxElement */ + ] = function forEachChildInJsxElement(node, cbNode, cbNodes) { + return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); + }, _a2[ + 285 + /* SyntaxKind.JsxFragment */ + ] = function forEachChildInJsxFragment(node, cbNode, cbNodes) { + return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); + }, _a2[ + 282 + /* SyntaxKind.JsxSelfClosingElement */ + ] = forEachChildInJsxOpeningOrSelfClosingElement, _a2[ + 283 + /* SyntaxKind.JsxOpeningElement */ + ] = forEachChildInJsxOpeningOrSelfClosingElement, _a2[ + 289 + /* SyntaxKind.JsxAttributes */ + ] = function forEachChildInJsxAttributes(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.properties); + }, _a2[ + 288 + /* SyntaxKind.JsxAttribute */ + ] = function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); + }, _a2[ + 290 + /* SyntaxKind.JsxSpreadAttribute */ + ] = function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + }, _a2[ + 291 + /* SyntaxKind.JsxExpression */ + ] = function forEachChildInJsxExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); + }, _a2[ + 284 + /* SyntaxKind.JsxClosingElement */ + ] = function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.tagName); + }, _a2[ + 187 + /* SyntaxKind.OptionalType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 188 + /* SyntaxKind.RestType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 312 + /* SyntaxKind.JSDocTypeExpression */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 318 + /* SyntaxKind.JSDocNonNullableType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 317 + /* SyntaxKind.JSDocNullableType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 319 + /* SyntaxKind.JSDocOptionalType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 321 + /* SyntaxKind.JSDocVariadicType */ + ] = forEachChildInOptionalRestOrJSDocParameterModifier, _a2[ + 320 + /* SyntaxKind.JSDocFunctionType */ + ] = function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + }, _a2[ + 323 + /* SyntaxKind.JSDoc */ + ] = function forEachChildInJSDoc(node, cbNode, cbNodes) { + return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); + }, _a2[ + 349 + /* SyntaxKind.JSDocSeeTag */ + ] = function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 313 + /* SyntaxKind.JSDocNameReference */ + ] = function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name); + }, _a2[ + 314 + /* SyntaxKind.JSDocMemberName */ + ] = function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); + }, _a2[ + 343 + /* SyntaxKind.JSDocParameterTag */ + ] = forEachChildInJSDocParameterOrPropertyTag, _a2[ + 350 + /* SyntaxKind.JSDocPropertyTag */ + ] = forEachChildInJSDocParameterOrPropertyTag, _a2[ + 333 + /* SyntaxKind.JSDocAuthorTag */ + ] = function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 332 + /* SyntaxKind.JSDocImplementsTag */ + ] = function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 331 + /* SyntaxKind.JSDocAugmentsTag */ + ] = function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 347 + /* SyntaxKind.JSDocTemplateTag */ + ] = function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 348 + /* SyntaxKind.JSDocTypedefTag */ + ] = function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 312 ? visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); + }, _a2[ + 341 + /* SyntaxKind.JSDocCallbackTag */ + ] = function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, _a2[ + 344 + /* SyntaxKind.JSDocReturnTag */ + ] = forEachChildInJSDocReturnTag, _a2[ + 346 + /* SyntaxKind.JSDocTypeTag */ + ] = forEachChildInJSDocReturnTag, _a2[ + 345 + /* SyntaxKind.JSDocThisTag */ + ] = forEachChildInJSDocReturnTag, _a2[ + 342 + /* SyntaxKind.JSDocEnumTag */ + ] = forEachChildInJSDocReturnTag, _a2[ + 326 + /* SyntaxKind.JSDocSignature */ + ] = function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { + return ts2.forEach(node.typeParameters, cbNode) || ts2.forEach(node.parameters, cbNode) || visitNode(cbNode, node.type); + }, _a2[ + 327 + /* SyntaxKind.JSDocLink */ + ] = forEachChildInJSDocLinkCodeOrPlain, _a2[ + 328 + /* SyntaxKind.JSDocLinkCode */ + ] = forEachChildInJSDocLinkCodeOrPlain, _a2[ + 329 + /* SyntaxKind.JSDocLinkPlain */ + ] = forEachChildInJSDocLinkCodeOrPlain, _a2[ + 325 + /* SyntaxKind.JSDocTypeLiteral */ + ] = function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { + return ts2.forEach(node.jsDocPropertyTags, cbNode); + }, _a2[ + 330 + /* SyntaxKind.JSDocTag */ + ] = forEachChildInJSDocTag, _a2[ + 335 + /* SyntaxKind.JSDocClassTag */ + ] = forEachChildInJSDocTag, _a2[ + 336 + /* SyntaxKind.JSDocPublicTag */ + ] = forEachChildInJSDocTag, _a2[ + 337 + /* SyntaxKind.JSDocPrivateTag */ + ] = forEachChildInJSDocTag, _a2[ + 338 + /* SyntaxKind.JSDocProtectedTag */ + ] = forEachChildInJSDocTag, _a2[ + 339 + /* SyntaxKind.JSDocReadonlyTag */ + ] = forEachChildInJSDocTag, _a2[ + 334 + /* SyntaxKind.JSDocDeprecatedTag */ + ] = forEachChildInJSDocTag, _a2[ + 340 + /* SyntaxKind.JSDocOverrideTag */ + ] = forEachChildInJSDocTag, _a2[ + 353 + /* SyntaxKind.PartiallyEmittedExpression */ + ] = forEachChildInPartiallyEmittedExpression, _a2); + function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); + } + function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.types); + } + function forEachChildInParenthesizedTypeOrTypeOperator(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.type); + } + function forEachChildInObjectOrArrayBindingPattern(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + } + function forEachChildInCallOrNewExpression(node, cbNode, cbNodes) { + return visitNode(cbNode, node.expression) || // TODO: should we separate these branches out? + visitNode(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); + } + function forEachChildInBlock(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements); + } + function forEachChildInContinueOrBreakStatement(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.label); + } + function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + } + function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + } + function forEachChildInImportOrExportSpecifier(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); + } + function forEachChildInJsxOpeningOrSelfClosingElement(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode(cbNode, node.attributes); + } + function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.type); + } + function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || (node.isNameFirst ? visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression) : visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInJSDocReturnTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.name); + } + function forEachChildInJSDocTag(node, cbNode, cbNodes) { + return visitNode(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { + return visitNode(cbNode, node.expression); + } + function forEachChild(node, cbNode, cbNodes) { + if (node === void 0 || node.kind <= 162) { + return; + } + var fn = forEachChildTable[node.kind]; + return fn === void 0 ? void 0 : fn(node, cbNode, cbNodes); + } + ts2.forEachChild = forEachChild; + function forEachChildRecursively(rootNode, cbNode, cbNodes) { + var queue3 = gatherPossibleChildren(rootNode); + var parents = []; + while (parents.length < queue3.length) { + parents.push(rootNode); + } + while (queue3.length !== 0) { + var current = queue3.pop(); + var parent2 = parents.pop(); + if (ts2.isArray(current)) { + if (cbNodes) { + var res = cbNodes(current, parent2); + if (res) { + if (res === "skip") + continue; + return res; + } + } + for (var i7 = current.length - 1; i7 >= 0; --i7) { + queue3.push(current[i7]); + parents.push(parent2); + } + } else { + var res = cbNode(current, parent2); + if (res) { + if (res === "skip") + continue; + return res; + } + if (current.kind >= 163) { + for (var _i = 0, _a3 = gatherPossibleChildren(current); _i < _a3.length; _i++) { + var child = _a3[_i]; + queue3.push(child); + parents.push(current); + } + } + } + } + } + ts2.forEachChildRecursively = forEachChildRecursively; + function gatherPossibleChildren(node) { + var children = []; + forEachChild(node, addWorkItem, addWorkItem); + return children; + function addWorkItem(n7) { + children.unshift(n7); + } + } + function setExternalModuleIndicator(sourceFile) { + sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile); + } + function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes, scriptKind) { + if (setParentNodes === void 0) { + setParentNodes = false; + } + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "parse", + "createSourceFile", + { path: fileName }, + /*separateBeginAndEnd*/ + true + ); + ts2.performance.mark("beforeParse"); + var result2; + ts2.perfLogger.logStartParseSourceFile(fileName); + var _a3 = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }, languageVersion = _a3.languageVersion, overrideSetExternalModuleIndicator = _a3.setExternalModuleIndicator, format5 = _a3.impliedNodeFormat; + if (languageVersion === 100) { + result2 = Parser7.parseSourceFile( + fileName, + sourceText, + languageVersion, + /*syntaxCursor*/ + void 0, + setParentNodes, + 6, + ts2.noop + ); + } else { + var setIndicator = format5 === void 0 ? overrideSetExternalModuleIndicator : function(file) { + file.impliedNodeFormat = format5; + return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file); + }; + result2 = Parser7.parseSourceFile( + fileName, + sourceText, + languageVersion, + /*syntaxCursor*/ + void 0, + setParentNodes, + scriptKind, + setIndicator + ); + } + ts2.perfLogger.logStopParseSourceFile(); + ts2.performance.mark("afterParse"); + ts2.performance.measure("Parse", "beforeParse", "afterParse"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return result2; + } + ts2.createSourceFile = createSourceFile; + function parseIsolatedEntityName(text, languageVersion) { + return Parser7.parseIsolatedEntityName(text, languageVersion); + } + ts2.parseIsolatedEntityName = parseIsolatedEntityName; + function parseJsonText(fileName, sourceText) { + return Parser7.parseJsonText(fileName, sourceText); + } + ts2.parseJsonText = parseJsonText; + function isExternalModule(file) { + return file.externalModuleIndicator !== void 0; + } + ts2.isExternalModule = isExternalModule; + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { + if (aggressiveChecks === void 0) { + aggressiveChecks = false; + } + var newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + newSourceFile.flags |= sourceFile.flags & 6291456; + return newSourceFile; + } + ts2.updateSourceFile = updateSourceFile; + function parseIsolatedJSDocComment(content, start, length) { + var result2 = Parser7.JSDocParser.parseIsolatedJSDocComment(content, start, length); + if (result2 && result2.jsDoc) { + Parser7.fixupParentReferences(result2.jsDoc); + } + return result2; + } + ts2.parseIsolatedJSDocComment = parseIsolatedJSDocComment; + function parseJSDocTypeExpressionForTests(content, start, length) { + return Parser7.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length); + } + ts2.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; + var Parser7; + (function(Parser8) { + var scanner = ts2.createScanner( + 99, + /*skipTrivia*/ + true + ); + var disallowInAndDecoratorContext = 4096 | 16384; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; + function countNode(node) { + nodeCount++; + return node; + } + var baseNodeFactory = { + createBaseSourceFileNode: function(kind) { + return countNode(new SourceFileConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )); + }, + createBaseIdentifierNode: function(kind) { + return countNode(new IdentifierConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )); + }, + createBasePrivateIdentifierNode: function(kind) { + return countNode(new PrivateIdentifierConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )); + }, + createBaseTokenNode: function(kind) { + return countNode(new TokenConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )); + }, + createBaseNode: function(kind) { + return countNode(new NodeConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )); + } + }; + var factory = ts2.createNodeFactory(1 | 2 | 8, baseNodeFactory); + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var privateIdentifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; + function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride) { + var _a3; + if (setParentNodes === void 0) { + setParentNodes = false; + } + scriptKind2 = ts2.ensureScriptKind(fileName2, scriptKind2); + if (scriptKind2 === 6) { + var result_3 = parseJsonText2(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes); + ts2.convertToObjectWorker( + result_3, + (_a3 = result_3.statements[0]) === null || _a3 === void 0 ? void 0 : _a3.expression, + result_3.parseDiagnostics, + /*returnValue*/ + false, + /*knownRootOptions*/ + void 0, + /*jsonConversionNotifier*/ + void 0 + ); + result_3.referencedFiles = ts2.emptyArray; + result_3.typeReferenceDirectives = ts2.emptyArray; + result_3.libReferenceDirectives = ts2.emptyArray; + result_3.amdDependencies = ts2.emptyArray; + result_3.hasNoDefaultLib = false; + result_3.pragmas = ts2.emptyMap; + return result_3; + } + initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2); + var result2 = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator); + clearState(); + return result2; + } + Parser8.parseSourceFile = parseSourceFile; + function parseIsolatedEntityName2(content, languageVersion2) { + initializeState( + "", + content, + languageVersion2, + /*syntaxCursor*/ + void 0, + 1 + /* ScriptKind.JS */ + ); + nextToken(); + var entityName = parseEntityName( + /*allowReservedWords*/ + true + ); + var isInvalid = token() === 1 && !parseDiagnostics.length; + clearState(); + return isInvalid ? entityName : void 0; + } + Parser8.parseIsolatedEntityName = parseIsolatedEntityName2; + function parseJsonText2(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes) { + if (languageVersion2 === void 0) { + languageVersion2 = 2; + } + if (setParentNodes === void 0) { + setParentNodes = false; + } + initializeState( + fileName2, + sourceText2, + languageVersion2, + syntaxCursor2, + 6 + /* ScriptKind.JSON */ + ); + sourceFlags = contextFlags; + nextToken(); + var pos = getNodePos(); + var statements, endOfFileToken; + if (token() === 1) { + statements = createNodeArray([], pos, pos); + endOfFileToken = parseTokenNode(); + } else { + var expressions = void 0; + while (token() !== 1) { + var expression_1 = void 0; + switch (token()) { + case 22: + expression_1 = parseArrayLiteralExpression(); + break; + case 110: + case 95: + case 104: + expression_1 = parseTokenNode(); + break; + case 40: + if (lookAhead(function() { + return nextToken() === 8 && nextToken() !== 58; + })) { + expression_1 = parsePrefixUnaryExpression(); + } else { + expression_1 = parseObjectLiteralExpression(); + } + break; + case 8: + case 10: + if (lookAhead(function() { + return nextToken() !== 58; + })) { + expression_1 = parseLiteralNode(); + break; + } + default: + expression_1 = parseObjectLiteralExpression(); + break; + } + if (expressions && ts2.isArray(expressions)) { + expressions.push(expression_1); + } else if (expressions) { + expressions = [expressions, expression_1]; + } else { + expressions = expression_1; + if (token() !== 1) { + parseErrorAtCurrentToken(ts2.Diagnostics.Unexpected_token); + } + } + } + var expression = ts2.isArray(expressions) ? finishNode(factory.createArrayLiteralExpression(expressions), pos) : ts2.Debug.checkDefined(expressions); + var statement = factory.createExpressionStatement(expression); + finishNode(statement, pos); + statements = createNodeArray([statement], pos); + endOfFileToken = parseExpectedToken(1, ts2.Diagnostics.Unexpected_token); + } + var sourceFile = createSourceFile2( + fileName2, + 2, + 6, + /*isDeclaration*/ + false, + statements, + endOfFileToken, + sourceFlags, + ts2.noop + ); + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + sourceFile.parseDiagnostics = ts2.attachFileToDiagnostics(parseDiagnostics, sourceFile); + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = ts2.attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + var result2 = sourceFile; + clearState(); + return result2; + } + Parser8.parseJsonText = parseJsonText2; + function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) { + NodeConstructor2 = ts2.objectAllocator.getNodeConstructor(); + TokenConstructor2 = ts2.objectAllocator.getTokenConstructor(); + IdentifierConstructor2 = ts2.objectAllocator.getIdentifierConstructor(); + PrivateIdentifierConstructor2 = ts2.objectAllocator.getPrivateIdentifierConstructor(); + SourceFileConstructor2 = ts2.objectAllocator.getSourceFileConstructor(); + fileName = ts2.normalizePath(_fileName); + sourceText = _sourceText; + languageVersion = _languageVersion; + syntaxCursor = _syntaxCursor; + scriptKind = _scriptKind; + languageVariant = ts2.getLanguageVariant(_scriptKind); + parseDiagnostics = []; + parsingContext = 0; + identifiers = new ts2.Map(); + privateIdentifiers = new ts2.Map(); + identifierCount = 0; + nodeCount = 0; + sourceFlags = 0; + topLevel = true; + switch (scriptKind) { + case 1: + case 2: + contextFlags = 262144; + break; + case 6: + contextFlags = 262144 | 67108864; + break; + default: + contextFlags = 0; + break; + } + parseErrorBeforeNextFinishedNode = false; + scanner.setText(sourceText); + scanner.setOnError(scanError); + scanner.setScriptTarget(languageVersion); + scanner.setLanguageVariant(languageVariant); + } + function clearState() { + scanner.clearCommentDirectives(); + scanner.setText(""); + scanner.setOnError(void 0); + sourceText = void 0; + languageVersion = void 0; + syntaxCursor = void 0; + scriptKind = void 0; + languageVariant = void 0; + sourceFlags = 0; + parseDiagnostics = void 0; + jsDocDiagnostics = void 0; + parsingContext = 0; + identifiers = void 0; + notParenthesizedArrow = void 0; + topLevel = true; + } + function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2) { + var isDeclarationFile = isDeclarationFileName(fileName); + if (isDeclarationFile) { + contextFlags |= 16777216; + } + sourceFlags = contextFlags; + nextToken(); + var statements = parseList(0, parseStatement); + ts2.Debug.assert( + token() === 1 + /* SyntaxKind.EndOfFileToken */ + ); + var endOfFileToken = addJSDocComment(parseTokenNode()); + var sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); + processCommentPragmas(sourceFile, sourceText); + processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); + sourceFile.commentDirectives = scanner.getCommentDirectives(); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + sourceFile.parseDiagnostics = ts2.attachFileToDiagnostics(parseDiagnostics, sourceFile); + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = ts2.attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + return sourceFile; + function reportPragmaDiagnostic(pos, end, diagnostic) { + parseDiagnostics.push(ts2.createDetachedDiagnostic(fileName, pos, end, diagnostic)); + } + } + function withJSDoc(node, hasJSDoc) { + return hasJSDoc ? addJSDocComment(node) : node; + } + var hasDeprecatedTag = false; + function addJSDocComment(node) { + ts2.Debug.assert(!node.jsDoc); + var jsDoc = ts2.mapDefined(ts2.getJSDocCommentRanges(node, sourceText), function(comment) { + return JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); + }); + if (jsDoc.length) + node.jsDoc = jsDoc; + if (hasDeprecatedTag) { + hasDeprecatedTag = false; + node.flags |= 268435456; + } + return node; + } + function reparseTopLevelAwait(sourceFile) { + var savedSyntaxCursor = syntaxCursor; + var baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile); + syntaxCursor = { currentNode: currentNode2 }; + var statements = []; + var savedParseDiagnostics = parseDiagnostics; + parseDiagnostics = []; + var pos = 0; + var start = findNextStatementWithAwait(sourceFile.statements, 0); + var _loop_3 = function() { + var prevStatement = sourceFile.statements[pos]; + var nextStatement = sourceFile.statements[start]; + ts2.addRange(statements, sourceFile.statements, pos, start); + pos = findNextStatementWithoutAwait(sourceFile.statements, start); + var diagnosticStart2 = ts2.findIndex(savedParseDiagnostics, function(diagnostic) { + return diagnostic.start >= prevStatement.pos; + }); + var diagnosticEnd = diagnosticStart2 >= 0 ? ts2.findIndex(savedParseDiagnostics, function(diagnostic) { + return diagnostic.start >= nextStatement.pos; + }, diagnosticStart2) : -1; + if (diagnosticStart2 >= 0) { + ts2.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart2, diagnosticEnd >= 0 ? diagnosticEnd : void 0); + } + speculationHelper( + function() { + var savedContextFlags = contextFlags; + contextFlags |= 32768; + scanner.setTextPos(nextStatement.pos); + nextToken(); + while (token() !== 1) { + var startPos = scanner.getStartPos(); + var statement = parseListElement(0, parseStatement); + statements.push(statement); + if (startPos === scanner.getStartPos()) { + nextToken(); + } + if (pos >= 0) { + var nonAwaitStatement = sourceFile.statements[pos]; + if (statement.end === nonAwaitStatement.pos) { + break; + } + if (statement.end > nonAwaitStatement.pos) { + pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1); + } + } + } + contextFlags = savedContextFlags; + }, + 2 + /* SpeculationKind.Reparse */ + ); + start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1; + }; + while (start !== -1) { + _loop_3(); + } + if (pos >= 0) { + var prevStatement_1 = sourceFile.statements[pos]; + ts2.addRange(statements, sourceFile.statements, pos); + var diagnosticStart = ts2.findIndex(savedParseDiagnostics, function(diagnostic) { + return diagnostic.start >= prevStatement_1.pos; + }); + if (diagnosticStart >= 0) { + ts2.addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart); + } + } + syntaxCursor = savedSyntaxCursor; + return factory.updateSourceFile(sourceFile, ts2.setTextRange(factory.createNodeArray(statements), sourceFile.statements)); + function containsPossibleTopLevelAwait(node) { + return !(node.flags & 32768) && !!(node.transformFlags & 67108864); + } + function findNextStatementWithAwait(statements2, start2) { + for (var i7 = start2; i7 < statements2.length; i7++) { + if (containsPossibleTopLevelAwait(statements2[i7])) { + return i7; + } + } + return -1; + } + function findNextStatementWithoutAwait(statements2, start2) { + for (var i7 = start2; i7 < statements2.length; i7++) { + if (!containsPossibleTopLevelAwait(statements2[i7])) { + return i7; + } + } + return -1; + } + function currentNode2(position) { + var node = baseSyntaxCursor.currentNode(position); + if (topLevel && node && containsPossibleTopLevelAwait(node)) { + node.intersectsChange = true; + } + return node; + } + } + function fixupParentReferences(rootNode) { + ts2.setParentRecursive( + rootNode, + /*incremental*/ + true + ); + } + Parser8.fixupParentReferences = fixupParentReferences; + function createSourceFile2(fileName2, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator2) { + var sourceFile = factory.createSourceFile(statements, endOfFileToken, flags); + ts2.setTextRangePosWidth(sourceFile, 0, sourceText.length); + setFields(sourceFile); + if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864) { + sourceFile = reparseTopLevelAwait(sourceFile); + setFields(sourceFile); + } + return sourceFile; + function setFields(sourceFile2) { + sourceFile2.text = sourceText; + sourceFile2.bindDiagnostics = []; + sourceFile2.bindSuggestionDiagnostics = void 0; + sourceFile2.languageVersion = languageVersion2; + sourceFile2.fileName = fileName2; + sourceFile2.languageVariant = ts2.getLanguageVariant(scriptKind2); + sourceFile2.isDeclarationFile = isDeclarationFile; + sourceFile2.scriptKind = scriptKind2; + setExternalModuleIndicator2(sourceFile2); + sourceFile2.setExternalModuleIndicator = setExternalModuleIndicator2; + } + } + function setContextFlag(val, flag) { + if (val) { + contextFlags |= flag; + } else { + contextFlags &= ~flag; + } + } + function setDisallowInContext(val) { + setContextFlag( + val, + 4096 + /* NodeFlags.DisallowInContext */ + ); + } + function setYieldContext(val) { + setContextFlag( + val, + 8192 + /* NodeFlags.YieldContext */ + ); + } + function setDecoratorContext(val) { + setContextFlag( + val, + 16384 + /* NodeFlags.DecoratorContext */ + ); + } + function setAwaitContext(val) { + setContextFlag( + val, + 32768 + /* NodeFlags.AwaitContext */ + ); + } + function doOutsideOfContext(context2, func) { + var contextFlagsToClear = context2 & contextFlags; + if (contextFlagsToClear) { + setContextFlag( + /*val*/ + false, + contextFlagsToClear + ); + var result2 = func(); + setContextFlag( + /*val*/ + true, + contextFlagsToClear + ); + return result2; + } + return func(); + } + function doInsideOfContext(context2, func) { + var contextFlagsToSet = context2 & ~contextFlags; + if (contextFlagsToSet) { + setContextFlag( + /*val*/ + true, + contextFlagsToSet + ); + var result2 = func(); + setContextFlag( + /*val*/ + false, + contextFlagsToSet + ); + return result2; + } + return func(); + } + function allowInAnd(func) { + return doOutsideOfContext(4096, func); + } + function disallowInAnd(func) { + return doInsideOfContext(4096, func); + } + function allowConditionalTypesAnd(func) { + return doOutsideOfContext(65536, func); + } + function disallowConditionalTypesAnd(func) { + return doInsideOfContext(65536, func); + } + function doInYieldContext(func) { + return doInsideOfContext(8192, func); + } + function doInDecoratorContext(func) { + return doInsideOfContext(16384, func); + } + function doInAwaitContext(func) { + return doInsideOfContext(32768, func); + } + function doOutsideOfAwaitContext(func) { + return doOutsideOfContext(32768, func); + } + function doInYieldAndAwaitContext(func) { + return doInsideOfContext(8192 | 32768, func); + } + function doOutsideOfYieldAndAwaitContext(func) { + return doOutsideOfContext(8192 | 32768, func); + } + function inContext(flags) { + return (contextFlags & flags) !== 0; + } + function inYieldContext() { + return inContext( + 8192 + /* NodeFlags.YieldContext */ + ); + } + function inDisallowInContext() { + return inContext( + 4096 + /* NodeFlags.DisallowInContext */ + ); + } + function inDisallowConditionalTypesContext() { + return inContext( + 65536 + /* NodeFlags.DisallowConditionalTypesContext */ + ); + } + function inDecoratorContext() { + return inContext( + 16384 + /* NodeFlags.DecoratorContext */ + ); + } + function inAwaitContext() { + return inContext( + 32768 + /* NodeFlags.AwaitContext */ + ); + } + function parseErrorAtCurrentToken(message, arg0) { + return parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0); + } + function parseErrorAtPosition(start, length, message, arg0) { + var lastError = ts2.lastOrUndefined(parseDiagnostics); + var result2; + if (!lastError || start !== lastError.start) { + result2 = ts2.createDetachedDiagnostic(fileName, start, length, message, arg0); + parseDiagnostics.push(result2); + } + parseErrorBeforeNextFinishedNode = true; + return result2; + } + function parseErrorAt(start, end, message, arg0) { + return parseErrorAtPosition(start, end - start, message, arg0); + } + function parseErrorAtRange(range2, message, arg0) { + parseErrorAt(range2.pos, range2.end, message, arg0); + } + function scanError(message, length) { + parseErrorAtPosition(scanner.getTextPos(), length, message); + } + function getNodePos() { + return scanner.getStartPos(); + } + function hasPrecedingJSDocComment() { + return scanner.hasPrecedingJSDocComment(); + } + function token() { + return currentToken; + } + function nextTokenWithoutCheck() { + return currentToken = scanner.scan(); + } + function nextTokenAnd(func) { + nextToken(); + return func(); + } + function nextToken() { + if (ts2.isKeyword(currentToken) && (scanner.hasUnicodeEscape() || scanner.hasExtendedUnicodeEscape())) { + parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), ts2.Diagnostics.Keywords_cannot_contain_escape_characters); + } + return nextTokenWithoutCheck(); + } + function nextTokenJSDoc() { + return currentToken = scanner.scanJsDocToken(); + } + function reScanGreaterToken() { + return currentToken = scanner.reScanGreaterToken(); + } + function reScanSlashToken() { + return currentToken = scanner.reScanSlashToken(); + } + function reScanTemplateToken(isTaggedTemplate) { + return currentToken = scanner.reScanTemplateToken(isTaggedTemplate); + } + function reScanTemplateHeadOrNoSubstitutionTemplate() { + return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate(); + } + function reScanLessThanToken() { + return currentToken = scanner.reScanLessThanToken(); + } + function reScanHashToken() { + return currentToken = scanner.reScanHashToken(); + } + function scanJsxIdentifier() { + return currentToken = scanner.scanJsxIdentifier(); + } + function scanJsxText() { + return currentToken = scanner.scanJsxToken(); + } + function scanJsxAttributeValue() { + return currentToken = scanner.scanJsxAttributeValue(); + } + function speculationHelper(callback, speculationKind) { + var saveToken = currentToken; + var saveParseDiagnosticsLength = parseDiagnostics.length; + var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + var saveContextFlags = contextFlags; + var result2 = speculationKind !== 0 ? scanner.lookAhead(callback) : scanner.tryScan(callback); + ts2.Debug.assert(saveContextFlags === contextFlags); + if (!result2 || speculationKind !== 0) { + currentToken = saveToken; + if (speculationKind !== 2) { + parseDiagnostics.length = saveParseDiagnosticsLength; + } + parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; + } + return result2; + } + function lookAhead(callback) { + return speculationHelper( + callback, + 1 + /* SpeculationKind.Lookahead */ + ); + } + function tryParse(callback) { + return speculationHelper( + callback, + 0 + /* SpeculationKind.TryParse */ + ); + } + function isBindingIdentifier() { + if (token() === 79) { + return true; + } + return token() > 116; + } + function isIdentifier() { + if (token() === 79) { + return true; + } + if (token() === 125 && inYieldContext()) { + return false; + } + if (token() === 133 && inAwaitContext()) { + return false; + } + return token() > 116; + } + function parseExpected(kind, diagnosticMessage, shouldAdvance) { + if (shouldAdvance === void 0) { + shouldAdvance = true; + } + if (token() === kind) { + if (shouldAdvance) { + nextToken(); + } + return true; + } + if (diagnosticMessage) { + parseErrorAtCurrentToken(diagnosticMessage); + } else { + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString(kind)); + } + return false; + } + var viableKeywordSuggestions = Object.keys(ts2.textToKeywordObj).filter(function(keyword) { + return keyword.length > 2; + }); + function parseErrorForMissingSemicolonAfter(node) { + var _a3; + if (ts2.isTaggedTemplateExpression(node)) { + parseErrorAt(ts2.skipTrivia(sourceText, node.template.pos), node.template.end, ts2.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings); + return; + } + var expressionText = ts2.isIdentifier(node) ? ts2.idText(node) : void 0; + if (!expressionText || !ts2.isIdentifierText(expressionText, languageVersion)) { + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString( + 26 + /* SyntaxKind.SemicolonToken */ + )); + return; + } + var pos = ts2.skipTrivia(sourceText, node.pos); + switch (expressionText) { + case "const": + case "let": + case "var": + parseErrorAt(pos, node.end, ts2.Diagnostics.Variable_declaration_not_allowed_at_this_location); + return; + case "declare": + return; + case "interface": + parseErrorForInvalidName( + ts2.Diagnostics.Interface_name_cannot_be_0, + ts2.Diagnostics.Interface_must_be_given_a_name, + 18 + /* SyntaxKind.OpenBraceToken */ + ); + return; + case "is": + parseErrorAt(pos, scanner.getTextPos(), ts2.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + return; + case "module": + case "namespace": + parseErrorForInvalidName( + ts2.Diagnostics.Namespace_name_cannot_be_0, + ts2.Diagnostics.Namespace_must_be_given_a_name, + 18 + /* SyntaxKind.OpenBraceToken */ + ); + return; + case "type": + parseErrorForInvalidName( + ts2.Diagnostics.Type_alias_name_cannot_be_0, + ts2.Diagnostics.Type_alias_must_be_given_a_name, + 63 + /* SyntaxKind.EqualsToken */ + ); + return; + } + var suggestion = (_a3 = ts2.getSpellingSuggestion(expressionText, viableKeywordSuggestions, function(n7) { + return n7; + })) !== null && _a3 !== void 0 ? _a3 : getSpaceSuggestion(expressionText); + if (suggestion) { + parseErrorAt(pos, node.end, ts2.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion); + return; + } + if (token() === 0) { + return; + } + parseErrorAt(pos, node.end, ts2.Diagnostics.Unexpected_keyword_or_identifier); + } + function parseErrorForInvalidName(nameDiagnostic, blankDiagnostic, tokenIfBlankName) { + if (token() === tokenIfBlankName) { + parseErrorAtCurrentToken(blankDiagnostic); + } else { + parseErrorAtCurrentToken(nameDiagnostic, scanner.getTokenValue()); + } + } + function getSpaceSuggestion(expressionText) { + for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) { + var keyword = viableKeywordSuggestions_1[_i]; + if (expressionText.length > keyword.length + 2 && ts2.startsWith(expressionText, keyword)) { + return "".concat(keyword, " ").concat(expressionText.slice(keyword.length)); + } + } + return void 0; + } + function parseSemicolonAfterPropertyName(name2, type3, initializer) { + if (token() === 59 && !scanner.hasPrecedingLineBreak()) { + parseErrorAtCurrentToken(ts2.Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations); + return; + } + if (token() === 20) { + parseErrorAtCurrentToken(ts2.Diagnostics.Cannot_start_a_function_call_in_a_type_annotation); + nextToken(); + return; + } + if (type3 && !canParseSemicolon()) { + if (initializer) { + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString( + 26 + /* SyntaxKind.SemicolonToken */ + )); + } else { + parseErrorAtCurrentToken(ts2.Diagnostics.Expected_for_property_initializer); + } + return; + } + if (tryParseSemicolon()) { + return; + } + if (initializer) { + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString( + 26 + /* SyntaxKind.SemicolonToken */ + )); + return; + } + parseErrorForMissingSemicolonAfter(name2); + } + function parseExpectedJSDoc(kind) { + if (token() === kind) { + nextTokenJSDoc(); + return true; + } + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString(kind)); + return false; + } + function parseExpectedMatchingBrackets(openKind, closeKind, openParsed, openPosition) { + if (token() === closeKind) { + nextToken(); + return; + } + var lastError = parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString(closeKind)); + if (!openParsed) { + return; + } + if (lastError) { + ts2.addRelatedInfo(lastError, ts2.createDetachedDiagnostic(fileName, openPosition, 1, ts2.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, ts2.tokenToString(openKind), ts2.tokenToString(closeKind))); + } + } + function parseOptional(t8) { + if (token() === t8) { + nextToken(); + return true; + } + return false; + } + function parseOptionalToken(t8) { + if (token() === t8) { + return parseTokenNode(); + } + return void 0; + } + function parseOptionalTokenJSDoc(t8) { + if (token() === t8) { + return parseTokenNodeJSDoc(); + } + return void 0; + } + function parseExpectedToken(t8, diagnosticMessage, arg0) { + return parseOptionalToken(t8) || createMissingNode( + t8, + /*reportAtCurrentPosition*/ + false, + diagnosticMessage || ts2.Diagnostics._0_expected, + arg0 || ts2.tokenToString(t8) + ); + } + function parseExpectedTokenJSDoc(t8) { + return parseOptionalTokenJSDoc(t8) || createMissingNode( + t8, + /*reportAtCurrentPosition*/ + false, + ts2.Diagnostics._0_expected, + ts2.tokenToString(t8) + ); + } + function parseTokenNode() { + var pos = getNodePos(); + var kind = token(); + nextToken(); + return finishNode(factory.createToken(kind), pos); + } + function parseTokenNodeJSDoc() { + var pos = getNodePos(); + var kind = token(); + nextTokenJSDoc(); + return finishNode(factory.createToken(kind), pos); + } + function canParseSemicolon() { + if (token() === 26) { + return true; + } + return token() === 19 || token() === 1 || scanner.hasPrecedingLineBreak(); + } + function tryParseSemicolon() { + if (!canParseSemicolon()) { + return false; + } + if (token() === 26) { + nextToken(); + } + return true; + } + function parseSemicolon() { + return tryParseSemicolon() || parseExpected( + 26 + /* SyntaxKind.SemicolonToken */ + ); + } + function createNodeArray(elements, pos, end, hasTrailingComma) { + var array = factory.createNodeArray(elements, hasTrailingComma); + ts2.setTextRangePosEnd(array, pos, end !== null && end !== void 0 ? end : scanner.getStartPos()); + return array; + } + function finishNode(node, pos, end) { + ts2.setTextRangePosEnd(node, pos, end !== null && end !== void 0 ? end : scanner.getStartPos()); + if (contextFlags) { + node.flags |= contextFlags; + } + if (parseErrorBeforeNextFinishedNode) { + parseErrorBeforeNextFinishedNode = false; + node.flags |= 131072; + } + return node; + } + function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) { + if (reportAtCurrentPosition) { + parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0); + } else if (diagnosticMessage) { + parseErrorAtCurrentToken(diagnosticMessage, arg0); + } + var pos = getNodePos(); + var result2 = kind === 79 ? factory.createIdentifier( + "", + /*typeArguments*/ + void 0, + /*originalKeywordKind*/ + void 0 + ) : ts2.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode( + kind, + "", + "", + /*templateFlags*/ + void 0 + ) : kind === 8 ? factory.createNumericLiteral( + "", + /*numericLiteralFlags*/ + void 0 + ) : kind === 10 ? factory.createStringLiteral( + "", + /*isSingleQuote*/ + void 0 + ) : kind === 279 ? factory.createMissingDeclaration() : factory.createToken(kind); + return finishNode(result2, pos); + } + function internIdentifier(text) { + var identifier = identifiers.get(text); + if (identifier === void 0) { + identifiers.set(text, identifier = text); + } + return identifier; + } + function createIdentifier(isIdentifier2, diagnosticMessage, privateIdentifierDiagnosticMessage) { + if (isIdentifier2) { + identifierCount++; + var pos = getNodePos(); + var originalKeywordKind = token(); + var text = internIdentifier(scanner.getTokenValue()); + var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); + nextTokenWithoutCheck(); + return finishNode(factory.createIdentifier( + text, + /*typeArguments*/ + void 0, + originalKeywordKind, + hasExtendedUnicodeEscape + ), pos); + } + if (token() === 80) { + parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + return createIdentifier( + /*isIdentifier*/ + true + ); + } + if (token() === 0 && scanner.tryScan(function() { + return scanner.reScanInvalidIdentifier() === 79; + })) { + return createIdentifier( + /*isIdentifier*/ + true + ); + } + identifierCount++; + var reportAtCurrentPosition = token() === 1; + var isReservedWord = scanner.isReservedWord(); + var msgArg = scanner.getTokenText(); + var defaultMessage = isReservedWord ? ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here : ts2.Diagnostics.Identifier_expected; + return createMissingNode(79, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); + } + function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { + return createIdentifier( + isBindingIdentifier(), + /*diagnosticMessage*/ + void 0, + privateIdentifierDiagnosticMessage + ); + } + function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { + return createIdentifier(isIdentifier(), diagnosticMessage, privateIdentifierDiagnosticMessage); + } + function parseIdentifierName(diagnosticMessage) { + return createIdentifier(ts2.tokenIsIdentifierOrKeyword(token()), diagnosticMessage); + } + function isLiteralPropertyName() { + return ts2.tokenIsIdentifierOrKeyword(token()) || token() === 10 || token() === 8; + } + function isAssertionKey() { + return ts2.tokenIsIdentifierOrKeyword(token()) || token() === 10; + } + function parsePropertyNameWorker(allowComputedPropertyNames) { + if (token() === 10 || token() === 8) { + var node = parseLiteralNode(); + node.text = internIdentifier(node.text); + return node; + } + if (allowComputedPropertyNames && token() === 22) { + return parseComputedPropertyName(); + } + if (token() === 80) { + return parsePrivateIdentifier(); + } + return parseIdentifierName(); + } + function parsePropertyName() { + return parsePropertyNameWorker( + /*allowComputedPropertyNames*/ + true + ); + } + function parseComputedPropertyName() { + var pos = getNodePos(); + parseExpected( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + return finishNode(factory.createComputedPropertyName(expression), pos); + } + function internPrivateIdentifier(text) { + var privateIdentifier = privateIdentifiers.get(text); + if (privateIdentifier === void 0) { + privateIdentifiers.set(text, privateIdentifier = text); + } + return privateIdentifier; + } + function parsePrivateIdentifier() { + var pos = getNodePos(); + var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue())); + nextToken(); + return finishNode(node, pos); + } + function parseContextualModifier(t8) { + return token() === t8 && tryParse(nextTokenCanFollowModifier); + } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } + function nextTokenCanFollowModifier() { + switch (token()) { + case 85: + return nextToken() === 92; + case 93: + nextToken(); + if (token() === 88) { + return lookAhead(nextTokenCanFollowDefaultKeyword); + } + if (token() === 154) { + return lookAhead(nextTokenCanFollowExportModifier); + } + return canFollowExportModifier(); + case 88: + return nextTokenCanFollowDefaultKeyword(); + case 127: + case 124: + case 137: + case 151: + nextToken(); + return canFollowModifier(); + default: + return nextTokenIsOnSameLineAndCanFollowModifier(); + } + } + function canFollowExportModifier() { + return token() !== 41 && token() !== 128 && token() !== 18 && canFollowModifier(); + } + function nextTokenCanFollowExportModifier() { + nextToken(); + return canFollowExportModifier(); + } + function parseAnyContextualModifier() { + return ts2.isModifierKind(token()) && tryParse(nextTokenCanFollowModifier); + } + function canFollowModifier() { + return token() === 22 || token() === 18 || token() === 41 || token() === 25 || isLiteralPropertyName(); + } + function nextTokenCanFollowDefaultKeyword() { + nextToken(); + return token() === 84 || token() === 98 || token() === 118 || token() === 126 && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 132 && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + } + function isListElement(parsingContext2, inErrorRecovery) { + var node = currentNode(parsingContext2); + if (node) { + return true; + } + switch (parsingContext2) { + case 0: + case 1: + case 3: + return !(token() === 26 && inErrorRecovery) && isStartOfStatement(); + case 2: + return token() === 82 || token() === 88; + case 4: + return lookAhead(isTypeMemberStart); + case 5: + return lookAhead(isClassMemberStart) || token() === 26 && !inErrorRecovery; + case 6: + return token() === 22 || isLiteralPropertyName(); + case 12: + switch (token()) { + case 22: + case 41: + case 25: + case 24: + return true; + default: + return isLiteralPropertyName(); + } + case 18: + return isLiteralPropertyName(); + case 9: + return token() === 22 || token() === 25 || isLiteralPropertyName(); + case 24: + return isAssertionKey(); + case 7: + if (token() === 18) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } else { + return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + case 8: + return isBindingIdentifierOrPrivateIdentifierOrPattern(); + case 10: + return token() === 27 || token() === 25 || isBindingIdentifierOrPrivateIdentifierOrPattern(); + case 19: + return token() === 101 || isIdentifier(); + case 15: + switch (token()) { + case 27: + case 24: + return true; + } + case 11: + return token() === 25 || isStartOfExpression(); + case 16: + return isStartOfParameter( + /*isJSDocParameter*/ + false + ); + case 17: + return isStartOfParameter( + /*isJSDocParameter*/ + true + ); + case 20: + case 21: + return token() === 27 || isStartOfType(); + case 22: + return isHeritageClause(); + case 23: + return ts2.tokenIsIdentifierOrKeyword(token()); + case 13: + return ts2.tokenIsIdentifierOrKeyword(token()) || token() === 18; + case 14: + return true; + } + return ts2.Debug.fail("Non-exhaustive case in 'isListElement'."); + } + function isValidHeritageClauseObjectLiteral() { + ts2.Debug.assert( + token() === 18 + /* SyntaxKind.OpenBraceToken */ + ); + if (nextToken() === 19) { + var next = nextToken(); + return next === 27 || next === 18 || next === 94 || next === 117; + } + return true; + } + function nextTokenIsIdentifier() { + nextToken(); + return isIdentifier(); + } + function nextTokenIsIdentifierOrKeyword() { + nextToken(); + return ts2.tokenIsIdentifierOrKeyword(token()); + } + function nextTokenIsIdentifierOrKeywordOrGreaterThan() { + nextToken(); + return ts2.tokenIsIdentifierOrKeywordOrGreaterThan(token()); + } + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token() === 117 || token() === 94) { + return lookAhead(nextTokenIsStartOfExpression); + } + return false; + } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } + function isListTerminator(kind) { + if (token() === 1) { + return true; + } + switch (kind) { + case 1: + case 2: + case 4: + case 5: + case 6: + case 12: + case 9: + case 23: + case 24: + return token() === 19; + case 3: + return token() === 19 || token() === 82 || token() === 88; + case 7: + return token() === 18 || token() === 94 || token() === 117; + case 8: + return isVariableDeclaratorListTerminator(); + case 19: + return token() === 31 || token() === 20 || token() === 18 || token() === 94 || token() === 117; + case 11: + return token() === 21 || token() === 26; + case 15: + case 21: + case 10: + return token() === 23; + case 17: + case 16: + case 18: + return token() === 21 || token() === 23; + case 20: + return token() !== 27; + case 22: + return token() === 18 || token() === 19; + case 13: + return token() === 31 || token() === 43; + case 14: + return token() === 29 && lookAhead(nextTokenIsSlash); + default: + return false; + } + } + function isVariableDeclaratorListTerminator() { + if (canParseSemicolon()) { + return true; + } + if (isInOrOfKeyword(token())) { + return true; + } + if (token() === 38) { + return true; + } + return false; + } + function isInSomeParsingContext() { + for (var kind = 0; kind < 25; kind++) { + if (parsingContext & 1 << kind) { + if (isListElement( + kind, + /*inErrorRecovery*/ + true + ) || isListTerminator(kind)) { + return true; + } + } + } + return false; + } + function parseList(kind, parseElement) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var list = []; + var listPos = getNodePos(); + while (!isListTerminator(kind)) { + if (isListElement( + kind, + /*inErrorRecovery*/ + false + )) { + list.push(parseListElement(kind, parseElement)); + continue; + } + if (abortParsingListOrMoveToNextToken(kind)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray(list, listPos); + } + function parseListElement(parsingContext2, parseElement) { + var node = currentNode(parsingContext2); + if (node) { + return consumeNode(node); + } + return parseElement(); + } + function currentNode(parsingContext2, pos) { + if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { + return void 0; + } + var node = syntaxCursor.currentNode(pos !== null && pos !== void 0 ? pos : scanner.getStartPos()); + if (ts2.nodeIsMissing(node) || node.intersectsChange || ts2.containsParseError(node)) { + return void 0; + } + var nodeContextFlags = node.flags & 50720768; + if (nodeContextFlags !== contextFlags) { + return void 0; + } + if (!canReuseNode(node, parsingContext2)) { + return void 0; + } + if (node.jsDocCache) { + node.jsDocCache = void 0; + } + return node; + } + function consumeNode(node) { + scanner.setTextPos(node.end); + nextToken(); + return node; + } + function isReusableParsingContext(parsingContext2) { + switch (parsingContext2) { + case 5: + case 2: + case 0: + case 1: + case 3: + case 6: + case 4: + case 8: + case 17: + case 16: + return true; + } + return false; + } + function canReuseNode(node, parsingContext2) { + switch (parsingContext2) { + case 5: + return isReusableClassMember(node); + case 2: + return isReusableSwitchClause(node); + case 0: + case 1: + case 3: + return isReusableStatement(node); + case 6: + return isReusableEnumMember(node); + case 4: + return isReusableTypeMember(node); + case 8: + return isReusableVariableDeclaration(node); + case 17: + case 16: + return isReusableParameter(node); + } + return false; + } + function isReusableClassMember(node) { + if (node) { + switch (node.kind) { + case 173: + case 178: + case 174: + case 175: + case 169: + case 237: + return true; + case 171: + var methodDeclaration = node; + var nameIsConstructor = methodDeclaration.name.kind === 79 && methodDeclaration.name.originalKeywordKind === 135; + return !nameIsConstructor; + } + } + return false; + } + function isReusableSwitchClause(node) { + if (node) { + switch (node.kind) { + case 292: + case 293: + return true; + } + } + return false; + } + function isReusableStatement(node) { + if (node) { + switch (node.kind) { + case 259: + case 240: + case 238: + case 242: + case 241: + case 254: + case 250: + case 252: + case 249: + case 248: + case 246: + case 247: + case 245: + case 244: + case 251: + case 239: + case 255: + case 253: + case 243: + case 256: + case 269: + case 268: + case 275: + case 274: + case 264: + case 260: + case 261: + case 263: + case 262: + return true; + } + } + return false; + } + function isReusableEnumMember(node) { + return node.kind === 302; + } + function isReusableTypeMember(node) { + if (node) { + switch (node.kind) { + case 177: + case 170: + case 178: + case 168: + case 176: + return true; + } + } + return false; + } + function isReusableVariableDeclaration(node) { + if (node.kind !== 257) { + return false; + } + var variableDeclarator = node; + return variableDeclarator.initializer === void 0; + } + function isReusableParameter(node) { + if (node.kind !== 166) { + return false; + } + var parameter = node; + return parameter.initializer === void 0; + } + function abortParsingListOrMoveToNextToken(kind) { + parsingContextErrors(kind); + if (isInSomeParsingContext()) { + return true; + } + nextToken(); + return false; + } + function parsingContextErrors(context2) { + switch (context2) { + case 0: + return token() === 88 ? parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString( + 93 + /* SyntaxKind.ExportKeyword */ + )) : parseErrorAtCurrentToken(ts2.Diagnostics.Declaration_or_statement_expected); + case 1: + return parseErrorAtCurrentToken(ts2.Diagnostics.Declaration_or_statement_expected); + case 2: + return parseErrorAtCurrentToken(ts2.Diagnostics.case_or_default_expected); + case 3: + return parseErrorAtCurrentToken(ts2.Diagnostics.Statement_expected); + case 18: + case 4: + return parseErrorAtCurrentToken(ts2.Diagnostics.Property_or_signature_expected); + case 5: + return parseErrorAtCurrentToken(ts2.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); + case 6: + return parseErrorAtCurrentToken(ts2.Diagnostics.Enum_member_expected); + case 7: + return parseErrorAtCurrentToken(ts2.Diagnostics.Expression_expected); + case 8: + return ts2.isKeyword(token()) ? parseErrorAtCurrentToken(ts2.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, ts2.tokenToString(token())) : parseErrorAtCurrentToken(ts2.Diagnostics.Variable_declaration_expected); + case 9: + return parseErrorAtCurrentToken(ts2.Diagnostics.Property_destructuring_pattern_expected); + case 10: + return parseErrorAtCurrentToken(ts2.Diagnostics.Array_element_destructuring_pattern_expected); + case 11: + return parseErrorAtCurrentToken(ts2.Diagnostics.Argument_expression_expected); + case 12: + return parseErrorAtCurrentToken(ts2.Diagnostics.Property_assignment_expected); + case 15: + return parseErrorAtCurrentToken(ts2.Diagnostics.Expression_or_comma_expected); + case 17: + return parseErrorAtCurrentToken(ts2.Diagnostics.Parameter_declaration_expected); + case 16: + return ts2.isKeyword(token()) ? parseErrorAtCurrentToken(ts2.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts2.tokenToString(token())) : parseErrorAtCurrentToken(ts2.Diagnostics.Parameter_declaration_expected); + case 19: + return parseErrorAtCurrentToken(ts2.Diagnostics.Type_parameter_declaration_expected); + case 20: + return parseErrorAtCurrentToken(ts2.Diagnostics.Type_argument_expected); + case 21: + return parseErrorAtCurrentToken(ts2.Diagnostics.Type_expected); + case 22: + return parseErrorAtCurrentToken(ts2.Diagnostics.Unexpected_token_expected); + case 23: + return parseErrorAtCurrentToken(ts2.Diagnostics.Identifier_expected); + case 13: + return parseErrorAtCurrentToken(ts2.Diagnostics.Identifier_expected); + case 14: + return parseErrorAtCurrentToken(ts2.Diagnostics.Identifier_expected); + case 24: + return parseErrorAtCurrentToken(ts2.Diagnostics.Identifier_or_string_literal_expected); + case 25: + return ts2.Debug.fail("ParsingContext.Count used as a context"); + default: + ts2.Debug.assertNever(context2); + } + } + function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { + var saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + var list = []; + var listPos = getNodePos(); + var commaStart = -1; + while (true) { + if (isListElement( + kind, + /*inErrorRecovery*/ + false + )) { + var startPos = scanner.getStartPos(); + var result2 = parseListElement(kind, parseElement); + if (!result2) { + parsingContext = saveParsingContext; + return void 0; + } + list.push(result2); + commaStart = scanner.getTokenPos(); + if (parseOptional( + 27 + /* SyntaxKind.CommaToken */ + )) { + continue; + } + commaStart = -1; + if (isListTerminator(kind)) { + break; + } + parseExpected(27, getExpectedCommaDiagnostic(kind)); + if (considerSemicolonAsDelimiter && token() === 26 && !scanner.hasPrecedingLineBreak()) { + nextToken(); + } + if (startPos === scanner.getStartPos()) { + nextToken(); + } + continue; + } + if (isListTerminator(kind)) { + break; + } + if (abortParsingListOrMoveToNextToken(kind)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray( + list, + listPos, + /*end*/ + void 0, + commaStart >= 0 + ); + } + function getExpectedCommaDiagnostic(kind) { + return kind === 6 ? ts2.Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + } + function createMissingList() { + var list = createNodeArray([], getNodePos()); + list.isMissingList = true; + return list; + } + function isMissingList(arr) { + return !!arr.isMissingList; + } + function parseBracketedList(kind, parseElement, open2, close) { + if (parseExpected(open2)) { + var result2 = parseDelimitedList(kind, parseElement); + parseExpected(close); + return result2; + } + return createMissingList(); + } + function parseEntityName(allowReservedWords, diagnosticMessage) { + var pos = getNodePos(); + var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); + var dotPos = getNodePos(); + while (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + if (token() === 29) { + entity.jsdocDotPos = dotPos; + break; + } + dotPos = getNodePos(); + entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot( + allowReservedWords, + /* allowPrivateIdentifiers */ + false + )), pos); + } + return entity; + } + function createQualifiedName(entity, name2) { + return finishNode(factory.createQualifiedName(entity, name2), entity.pos); + } + function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { + if (scanner.hasPrecedingLineBreak() && ts2.tokenIsIdentifierOrKeyword(token())) { + var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); + if (matchesPattern) { + return createMissingNode( + 79, + /*reportAtCurrentPosition*/ + true, + ts2.Diagnostics.Identifier_expected + ); + } + } + if (token() === 80) { + var node = parsePrivateIdentifier(); + return allowPrivateIdentifiers ? node : createMissingNode( + 79, + /*reportAtCurrentPosition*/ + true, + ts2.Diagnostics.Identifier_expected + ); + } + return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); + } + function parseTemplateSpans(isTaggedTemplate) { + var pos = getNodePos(); + var list = []; + var node; + do { + node = parseTemplateSpan(isTaggedTemplate); + list.push(node); + } while (node.literal.kind === 16); + return createNodeArray(list, pos); + } + function parseTemplateExpression(isTaggedTemplate) { + var pos = getNodePos(); + return finishNode(factory.createTemplateExpression(parseTemplateHead(isTaggedTemplate), parseTemplateSpans(isTaggedTemplate)), pos); + } + function parseTemplateType() { + var pos = getNodePos(); + return finishNode(factory.createTemplateLiteralType(parseTemplateHead( + /*isTaggedTemplate*/ + false + ), parseTemplateTypeSpans()), pos); + } + function parseTemplateTypeSpans() { + var pos = getNodePos(); + var list = []; + var node; + do { + node = parseTemplateTypeSpan(); + list.push(node); + } while (node.literal.kind === 16); + return createNodeArray(list, pos); + } + function parseTemplateTypeSpan() { + var pos = getNodePos(); + return finishNode(factory.createTemplateLiteralTypeSpan(parseType(), parseLiteralOfTemplateSpan( + /*isTaggedTemplate*/ + false + )), pos); + } + function parseLiteralOfTemplateSpan(isTaggedTemplate) { + if (token() === 19) { + reScanTemplateToken(isTaggedTemplate); + return parseTemplateMiddleOrTemplateTail(); + } else { + return parseExpectedToken(17, ts2.Diagnostics._0_expected, ts2.tokenToString( + 19 + /* SyntaxKind.CloseBraceToken */ + )); + } + } + function parseTemplateSpan(isTaggedTemplate) { + var pos = getNodePos(); + return finishNode(factory.createTemplateSpan(allowInAnd(parseExpression), parseLiteralOfTemplateSpan(isTaggedTemplate)), pos); + } + function parseLiteralNode() { + return parseLiteralLikeNode(token()); + } + function parseTemplateHead(isTaggedTemplate) { + if (isTaggedTemplate) { + reScanTemplateHeadOrNoSubstitutionTemplate(); + } + var fragment = parseLiteralLikeNode(token()); + ts2.Debug.assert(fragment.kind === 15, "Template head has wrong token kind"); + return fragment; + } + function parseTemplateMiddleOrTemplateTail() { + var fragment = parseLiteralLikeNode(token()); + ts2.Debug.assert(fragment.kind === 16 || fragment.kind === 17, "Template fragment has wrong token kind"); + return fragment; + } + function getTemplateLiteralRawText(kind) { + var isLast = kind === 14 || kind === 17; + var tokenText = scanner.getTokenText(); + return tokenText.substring(1, tokenText.length - (scanner.isUnterminated() ? 0 : isLast ? 1 : 2)); + } + function parseLiteralLikeNode(kind) { + var pos = getNodePos(); + var node = ts2.isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode( + kind, + scanner.getTokenValue(), + getTemplateLiteralRawText(kind), + scanner.getTokenFlags() & 2048 + /* TokenFlags.TemplateLiteralLikeFlags */ + ) : ( + // Octal literals are not allowed in strict mode or ES5 + // Note that theoretically the following condition would hold true literals like 009, + // which is not octal. But because of how the scanner separates the tokens, we would + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. + // We also do not need to check for negatives because any prefix operator would be part of a + // parent unary expression. + kind === 8 ? factory.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 ? factory.createStringLiteral( + scanner.getTokenValue(), + /*isSingleQuote*/ + void 0, + scanner.hasExtendedUnicodeEscape() + ) : ts2.isLiteralKind(kind) ? factory.createLiteralLikeNode(kind, scanner.getTokenValue()) : ts2.Debug.fail() + ); + if (scanner.hasExtendedUnicodeEscape()) { + node.hasExtendedUnicodeEscape = true; + } + if (scanner.isUnterminated()) { + node.isUnterminated = true; + } + nextToken(); + return finishNode(node, pos); + } + function parseEntityNameOfTypeReference() { + return parseEntityName( + /*allowReservedWords*/ + true, + ts2.Diagnostics.Type_expected + ); + } + function parseTypeArgumentsOfTypeReference() { + if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) { + return parseBracketedList( + 20, + parseType, + 29, + 31 + /* SyntaxKind.GreaterThanToken */ + ); + } + } + function parseTypeReference() { + var pos = getNodePos(); + return finishNode(factory.createTypeReferenceNode(parseEntityNameOfTypeReference(), parseTypeArgumentsOfTypeReference()), pos); + } + function typeHasArrowFunctionBlockingParseError(node) { + switch (node.kind) { + case 180: + return ts2.nodeIsMissing(node.typeName); + case 181: + case 182: { + var _a3 = node, parameters = _a3.parameters, type3 = _a3.type; + return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type3); + } + case 193: + return typeHasArrowFunctionBlockingParseError(node.type); + default: + return false; + } + } + function parseThisTypePredicate(lhs) { + nextToken(); + return finishNode(factory.createTypePredicateNode( + /*assertsModifier*/ + void 0, + lhs, + parseType() + ), lhs.pos); + } + function parseThisTypeNode() { + var pos = getNodePos(); + nextToken(); + return finishNode(factory.createThisTypeNode(), pos); + } + function parseJSDocAllType() { + var pos = getNodePos(); + nextToken(); + return finishNode(factory.createJSDocAllType(), pos); + } + function parseJSDocNonNullableType() { + var pos = getNodePos(); + nextToken(); + return finishNode(factory.createJSDocNonNullableType( + parseNonArrayType(), + /*postfix*/ + false + ), pos); + } + function parseJSDocUnknownOrNullableType() { + var pos = getNodePos(); + nextToken(); + if (token() === 27 || token() === 19 || token() === 21 || token() === 31 || token() === 63 || token() === 51) { + return finishNode(factory.createJSDocUnknownType(), pos); + } else { + return finishNode(factory.createJSDocNullableType( + parseType(), + /*postfix*/ + false + ), pos); + } + } + function parseJSDocFunctionType() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + if (lookAhead(nextTokenIsOpenParen)) { + nextToken(); + var parameters = parseParameters( + 4 | 32 + /* SignatureFlags.JSDoc */ + ); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + return withJSDoc(finishNode(factory.createJSDocFunctionType(parameters, type3), pos), hasJSDoc); + } + return finishNode(factory.createTypeReferenceNode( + parseIdentifierName(), + /*typeArguments*/ + void 0 + ), pos); + } + function parseJSDocParameter() { + var pos = getNodePos(); + var name2; + if (token() === 108 || token() === 103) { + name2 = parseIdentifierName(); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + } + return finishNode(factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + // TODO(rbuckton): JSDoc parameters don't have names (except `this`/`new`), should we manufacture an empty identifier? + name2, + /*questionToken*/ + void 0, + parseJSDocType(), + /*initializer*/ + void 0 + ), pos); + } + function parseJSDocType() { + scanner.setInJSDocType(true); + var pos = getNodePos(); + if (parseOptional( + 142 + /* SyntaxKind.ModuleKeyword */ + )) { + var moduleTag = factory.createJSDocNamepathType( + /*type*/ + void 0 + ); + terminate: + while (true) { + switch (token()) { + case 19: + case 1: + case 27: + case 5: + break terminate; + default: + nextTokenJSDoc(); + } + } + scanner.setInJSDocType(false); + return finishNode(moduleTag, pos); + } + var hasDotDotDot = parseOptional( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var type3 = parseTypeOrTypePredicate(); + scanner.setInJSDocType(false); + if (hasDotDotDot) { + type3 = finishNode(factory.createJSDocVariadicType(type3), pos); + } + if (token() === 63) { + nextToken(); + return finishNode(factory.createJSDocOptionalType(type3), pos); + } + return type3; + } + function parseTypeQuery() { + var pos = getNodePos(); + parseExpected( + 112 + /* SyntaxKind.TypeOfKeyword */ + ); + var entityName = parseEntityName( + /*allowReservedWords*/ + true + ); + var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : void 0; + return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos); + } + function parseTypeParameter() { + var pos = getNodePos(); + var modifiers = parseModifiers(); + var name2 = parseIdentifier(); + var constraint; + var expression; + if (parseOptional( + 94 + /* SyntaxKind.ExtendsKeyword */ + )) { + if (isStartOfType() || !isStartOfExpression()) { + constraint = parseType(); + } else { + expression = parseUnaryExpressionOrHigher(); + } + } + var defaultType = parseOptional( + 63 + /* SyntaxKind.EqualsToken */ + ) ? parseType() : void 0; + var node = factory.createTypeParameterDeclaration(modifiers, name2, constraint, defaultType); + node.expression = expression; + return finishNode(node, pos); + } + function parseTypeParameters() { + if (token() === 29) { + return parseBracketedList( + 19, + parseTypeParameter, + 29, + 31 + /* SyntaxKind.GreaterThanToken */ + ); + } + } + function isStartOfParameter(isJSDocParameter) { + return token() === 25 || isBindingIdentifierOrPrivateIdentifierOrPattern() || ts2.isModifierKind(token()) || token() === 59 || isStartOfType( + /*inStartOfParameter*/ + !isJSDocParameter + ); + } + function parseNameOfParameter(modifiers) { + var name2 = parseIdentifierOrPattern(ts2.Diagnostics.Private_identifiers_cannot_be_used_as_parameters); + if (ts2.getFullWidth(name2) === 0 && !ts2.some(modifiers) && ts2.isModifierKind(token())) { + nextToken(); + } + return name2; + } + function isParameterNameStart() { + return isBindingIdentifier() || token() === 22 || token() === 18; + } + function parseParameter(inOuterAwaitContext) { + return parseParameterWorker(inOuterAwaitContext); + } + function parseParameterForSpeculation(inOuterAwaitContext) { + return parseParameterWorker( + inOuterAwaitContext, + /*allowAmbiguity*/ + false + ); + } + function parseParameterWorker(inOuterAwaitContext, allowAmbiguity) { + if (allowAmbiguity === void 0) { + allowAmbiguity = true; + } + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); + if (token() === 108) { + var node_1 = factory.createParameterDeclaration( + decorators, + /*dotDotDotToken*/ + void 0, + createIdentifier( + /*isIdentifier*/ + true + ), + /*questionToken*/ + void 0, + parseTypeAnnotation(), + /*initializer*/ + void 0 + ); + if (decorators) { + parseErrorAtRange(decorators[0], ts2.Diagnostics.Decorators_may_not_be_applied_to_this_parameters); + } + return withJSDoc(finishNode(node_1, pos), hasJSDoc); + } + var savedTopLevel = topLevel; + topLevel = false; + var modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); + var dotDotDotToken = parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + if (!allowAmbiguity && !isParameterNameStart()) { + return void 0; + } + var node = withJSDoc(finishNode(factory.createParameterDeclaration(modifiers, dotDotDotToken, parseNameOfParameter(modifiers), parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ), parseTypeAnnotation(), parseInitializer()), pos), hasJSDoc); + topLevel = savedTopLevel; + return node; + } + function parseReturnType(returnToken, isType) { + if (shouldParseReturnType(returnToken, isType)) { + return allowConditionalTypesAnd(parseTypeOrTypePredicate); + } + } + function shouldParseReturnType(returnToken, isType) { + if (returnToken === 38) { + parseExpected(returnToken); + return true; + } else if (parseOptional( + 58 + /* SyntaxKind.ColonToken */ + )) { + return true; + } else if (isType && token() === 38) { + parseErrorAtCurrentToken(ts2.Diagnostics._0_expected, ts2.tokenToString( + 58 + /* SyntaxKind.ColonToken */ + )); + nextToken(); + return true; + } + return false; + } + function parseParametersWorker(flags, allowAmbiguity) { + var savedYieldContext = inYieldContext(); + var savedAwaitContext = inAwaitContext(); + setYieldContext(!!(flags & 1)); + setAwaitContext(!!(flags & 2)); + var parameters = flags & 32 ? parseDelimitedList(17, parseJSDocParameter) : parseDelimitedList(16, function() { + return allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext); + }); + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return parameters; + } + function parseParameters(flags) { + if (!parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + )) { + return createMissingList(); + } + var parameters = parseParametersWorker( + flags, + /*allowAmbiguity*/ + true + ); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + return parameters; + } + function parseTypeMemberSemicolon() { + if (parseOptional( + 27 + /* SyntaxKind.CommaToken */ + )) { + return; + } + parseSemicolon(); + } + function parseSignatureMember(kind) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + if (kind === 177) { + parseExpected( + 103 + /* SyntaxKind.NewKeyword */ + ); + } + var typeParameters = parseTypeParameters(); + var parameters = parseParameters( + 4 + /* SignatureFlags.Type */ + ); + var type3 = parseReturnType( + 58, + /*isType*/ + true + ); + parseTypeMemberSemicolon(); + var node = kind === 176 ? factory.createCallSignature(typeParameters, parameters, type3) : factory.createConstructSignature(typeParameters, parameters, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isIndexSignature() { + return token() === 22 && lookAhead(isUnambiguouslyIndexSignature); + } + function isUnambiguouslyIndexSignature() { + nextToken(); + if (token() === 25 || token() === 23) { + return true; + } + if (ts2.isModifierKind(token())) { + nextToken(); + if (isIdentifier()) { + return true; + } + } else if (!isIdentifier()) { + return false; + } else { + nextToken(); + } + if (token() === 58 || token() === 27) { + return true; + } + if (token() !== 57) { + return false; + } + nextToken(); + return token() === 58 || token() === 27 || token() === 23; + } + function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { + var parameters = parseBracketedList( + 16, + function() { + return parseParameter( + /*inOuterAwaitContext*/ + false + ); + }, + 22, + 23 + /* SyntaxKind.CloseBracketToken */ + ); + var type3 = parseTypeAnnotation(); + parseTypeMemberSemicolon(); + var node = factory.createIndexSignature(modifiers, parameters, type3); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { + var name2 = parsePropertyName(); + var questionToken = parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + var node; + if (token() === 20 || token() === 29) { + var typeParameters = parseTypeParameters(); + var parameters = parseParameters( + 4 + /* SignatureFlags.Type */ + ); + var type3 = parseReturnType( + 58, + /*isType*/ + true + ); + node = factory.createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3); + } else { + var type3 = parseTypeAnnotation(); + node = factory.createPropertySignature(modifiers, name2, questionToken, type3); + if (token() === 63) + node.initializer = parseInitializer(); + } + parseTypeMemberSemicolon(); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isTypeMemberStart() { + if (token() === 20 || token() === 29 || token() === 137 || token() === 151) { + return true; + } + var idToken = false; + while (ts2.isModifierKind(token())) { + idToken = true; + nextToken(); + } + if (token() === 22) { + return true; + } + if (isLiteralPropertyName()) { + idToken = true; + nextToken(); + } + if (idToken) { + return token() === 20 || token() === 29 || token() === 57 || token() === 58 || token() === 27 || canParseSemicolon(); + } + return false; + } + function parseTypeMember() { + if (token() === 20 || token() === 29) { + return parseSignatureMember( + 176 + /* SyntaxKind.CallSignature */ + ); + } + if (token() === 103 && lookAhead(nextTokenIsOpenParenOrLessThan)) { + return parseSignatureMember( + 177 + /* SyntaxKind.ConstructSignature */ + ); + } + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var modifiers = parseModifiers(); + if (parseContextualModifier( + 137 + /* SyntaxKind.GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + /*decorators*/ + void 0, + modifiers, + 174, + 4 + /* SignatureFlags.Type */ + ); + } + if (parseContextualModifier( + 151 + /* SyntaxKind.SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + /*decorators*/ + void 0, + modifiers, + 175, + 4 + /* SignatureFlags.Type */ + ); + } + if (isIndexSignature()) { + return parseIndexSignatureDeclaration( + pos, + hasJSDoc, + /*decorators*/ + void 0, + modifiers + ); + } + return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); + } + function nextTokenIsOpenParenOrLessThan() { + nextToken(); + return token() === 20 || token() === 29; + } + function nextTokenIsDot() { + return nextToken() === 24; + } + function nextTokenIsOpenParenOrLessThanOrDot() { + switch (nextToken()) { + case 20: + case 29: + case 24: + return true; + } + return false; + } + function parseTypeLiteral() { + var pos = getNodePos(); + return finishNode(factory.createTypeLiteralNode(parseObjectTypeMembers()), pos); + } + function parseObjectTypeMembers() { + var members; + if (parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + members = parseList(4, parseTypeMember); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + return members; + } + function isStartOfMappedType() { + nextToken(); + if (token() === 39 || token() === 40) { + return nextToken() === 146; + } + if (token() === 146) { + nextToken(); + } + return token() === 22 && nextTokenIsIdentifier() && nextToken() === 101; + } + function parseMappedTypeParameter() { + var pos = getNodePos(); + var name2 = parseIdentifierName(); + parseExpected( + 101 + /* SyntaxKind.InKeyword */ + ); + var type3 = parseType(); + return finishNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + type3, + /*defaultType*/ + void 0 + ), pos); + } + function parseMappedType() { + var pos = getNodePos(); + parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var readonlyToken; + if (token() === 146 || token() === 39 || token() === 40) { + readonlyToken = parseTokenNode(); + if (readonlyToken.kind !== 146) { + parseExpected( + 146 + /* SyntaxKind.ReadonlyKeyword */ + ); + } + } + parseExpected( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + var typeParameter = parseMappedTypeParameter(); + var nameType = parseOptional( + 128 + /* SyntaxKind.AsKeyword */ + ) ? parseType() : void 0; + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + var questionToken; + if (token() === 57 || token() === 39 || token() === 40) { + questionToken = parseTokenNode(); + if (questionToken.kind !== 57) { + parseExpected( + 57 + /* SyntaxKind.QuestionToken */ + ); + } + } + var type3 = parseTypeAnnotation(); + parseSemicolon(); + var members = parseList(4, parseTypeMember); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + return finishNode(factory.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members), pos); + } + function parseTupleElementType() { + var pos = getNodePos(); + if (parseOptional( + 25 + /* SyntaxKind.DotDotDotToken */ + )) { + return finishNode(factory.createRestTypeNode(parseType()), pos); + } + var type3 = parseType(); + if (ts2.isJSDocNullableType(type3) && type3.pos === type3.type.pos) { + var node = factory.createOptionalTypeNode(type3.type); + ts2.setTextRange(node, type3); + node.flags = type3.flags; + return node; + } + return type3; + } + function isNextTokenColonOrQuestionColon() { + return nextToken() === 58 || token() === 57 && nextToken() === 58; + } + function isTupleElementName() { + if (token() === 25) { + return ts2.tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon(); + } + return ts2.tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon(); + } + function parseTupleElementNameOrTupleElementType() { + if (lookAhead(isTupleElementName)) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var dotDotDotToken = parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var name2 = parseIdentifierName(); + var questionToken = parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var type3 = parseTupleElementType(); + var node = factory.createNamedTupleMember(dotDotDotToken, name2, questionToken, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + return parseTupleElementType(); + } + function parseTupleType() { + var pos = getNodePos(); + return finishNode(factory.createTupleTypeNode(parseBracketedList( + 21, + parseTupleElementNameOrTupleElementType, + 22, + 23 + /* SyntaxKind.CloseBracketToken */ + )), pos); + } + function parseParenthesizedType() { + var pos = getNodePos(); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var type3 = parseType(); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + return finishNode(factory.createParenthesizedType(type3), pos); + } + function parseModifiersForConstructorType() { + var modifiers; + if (token() === 126) { + var pos = getNodePos(); + nextToken(); + var modifier = finishNode(factory.createToken( + 126 + /* SyntaxKind.AbstractKeyword */ + ), pos); + modifiers = createNodeArray([modifier], pos); + } + return modifiers; + } + function parseFunctionOrConstructorType() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var modifiers = parseModifiersForConstructorType(); + var isConstructorType = parseOptional( + 103 + /* SyntaxKind.NewKeyword */ + ); + var typeParameters = parseTypeParameters(); + var parameters = parseParameters( + 4 + /* SignatureFlags.Type */ + ); + var type3 = parseReturnType( + 38, + /*isType*/ + false + ); + var node = isConstructorType ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, type3) : factory.createFunctionTypeNode(typeParameters, parameters, type3); + if (!isConstructorType) + node.modifiers = modifiers; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseKeywordAndNoDot() { + var node = parseTokenNode(); + return token() === 24 ? void 0 : node; + } + function parseLiteralTypeNode(negative) { + var pos = getNodePos(); + if (negative) { + nextToken(); + } + var expression = token() === 110 || token() === 95 || token() === 104 ? parseTokenNode() : parseLiteralLikeNode(token()); + if (negative) { + expression = finishNode(factory.createPrefixUnaryExpression(40, expression), pos); + } + return finishNode(factory.createLiteralTypeNode(expression), pos); + } + function isStartOfTypeOfImportType() { + nextToken(); + return token() === 100; + } + function parseImportTypeAssertions() { + var pos = getNodePos(); + var openBracePosition = scanner.getTokenPos(); + parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var multiLine = scanner.hasPrecedingLineBreak(); + parseExpected( + 130 + /* SyntaxKind.AssertKeyword */ + ); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var clause = parseAssertClause( + /*skipAssertKeyword*/ + true + ); + if (!parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + )) { + var lastError = ts2.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts2.Diagnostics._0_expected.code) { + ts2.addRelatedInfo(lastError, ts2.createDetachedDiagnostic(fileName, openBracePosition, 1, ts2.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")); + } + } + return finishNode(factory.createImportTypeAssertionContainer(clause, multiLine), pos); + } + function parseImportType() { + sourceFlags |= 2097152; + var pos = getNodePos(); + var isTypeOf = parseOptional( + 112 + /* SyntaxKind.TypeOfKeyword */ + ); + parseExpected( + 100 + /* SyntaxKind.ImportKeyword */ + ); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var type3 = parseType(); + var assertions; + if (parseOptional( + 27 + /* SyntaxKind.CommaToken */ + )) { + assertions = parseImportTypeAssertions(); + } + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + var qualifier = parseOptional( + 24 + /* SyntaxKind.DotToken */ + ) ? parseEntityNameOfTypeReference() : void 0; + var typeArguments = parseTypeArgumentsOfTypeReference(); + return finishNode(factory.createImportTypeNode(type3, assertions, qualifier, typeArguments, isTypeOf), pos); + } + function nextTokenIsNumericOrBigIntLiteral() { + nextToken(); + return token() === 8 || token() === 9; + } + function parseNonArrayType() { + switch (token()) { + case 131: + case 157: + case 152: + case 148: + case 160: + case 153: + case 134: + case 155: + case 144: + case 149: + return tryParse(parseKeywordAndNoDot) || parseTypeReference(); + case 66: + scanner.reScanAsteriskEqualsToken(); + case 41: + return parseJSDocAllType(); + case 60: + scanner.reScanQuestionToken(); + case 57: + return parseJSDocUnknownOrNullableType(); + case 98: + return parseJSDocFunctionType(); + case 53: + return parseJSDocNonNullableType(); + case 14: + case 10: + case 8: + case 9: + case 110: + case 95: + case 104: + return parseLiteralTypeNode(); + case 40: + return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode( + /*negative*/ + true + ) : parseTypeReference(); + case 114: + return parseTokenNode(); + case 108: { + var thisKeyword = parseThisTypeNode(); + if (token() === 140 && !scanner.hasPrecedingLineBreak()) { + return parseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + case 112: + return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery(); + case 18: + return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); + case 22: + return parseTupleType(); + case 20: + return parseParenthesizedType(); + case 100: + return parseImportType(); + case 129: + return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); + case 15: + return parseTemplateType(); + default: + return parseTypeReference(); + } + } + function isStartOfType(inStartOfParameter) { + switch (token()) { + case 131: + case 157: + case 152: + case 148: + case 160: + case 134: + case 146: + case 153: + case 156: + case 114: + case 155: + case 104: + case 108: + case 112: + case 144: + case 18: + case 22: + case 29: + case 51: + case 50: + case 103: + case 10: + case 8: + case 9: + case 110: + case 95: + case 149: + case 41: + case 57: + case 53: + case 25: + case 138: + case 100: + case 129: + case 14: + case 15: + return true; + case 98: + return !inStartOfParameter; + case 40: + return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral); + case 20: + return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType); + default: + return isIdentifier(); + } + } + function isStartOfParenthesizedOrFunctionType() { + nextToken(); + return token() === 21 || isStartOfParameter( + /*isJSDocParameter*/ + false + ) || isStartOfType(); + } + function parsePostfixTypeOrHigher() { + var pos = getNodePos(); + var type3 = parseNonArrayType(); + while (!scanner.hasPrecedingLineBreak()) { + switch (token()) { + case 53: + nextToken(); + type3 = finishNode(factory.createJSDocNonNullableType( + type3, + /*postfix*/ + true + ), pos); + break; + case 57: + if (lookAhead(nextTokenIsStartOfType)) { + return type3; + } + nextToken(); + type3 = finishNode(factory.createJSDocNullableType( + type3, + /*postfix*/ + true + ), pos); + break; + case 22: + parseExpected( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + if (isStartOfType()) { + var indexType = parseType(); + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + type3 = finishNode(factory.createIndexedAccessTypeNode(type3, indexType), pos); + } else { + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + type3 = finishNode(factory.createArrayTypeNode(type3), pos); + } + break; + default: + return type3; + } + } + return type3; + } + function parseTypeOperator(operator) { + var pos = getNodePos(); + parseExpected(operator); + return finishNode(factory.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos); + } + function tryParseConstraintOfInferType() { + if (parseOptional( + 94 + /* SyntaxKind.ExtendsKeyword */ + )) { + var constraint = disallowConditionalTypesAnd(parseType); + if (inDisallowConditionalTypesContext() || token() !== 57) { + return constraint; + } + } + } + function parseTypeParameterOfInferType() { + var pos = getNodePos(); + var name2 = parseIdentifier(); + var constraint = tryParse(tryParseConstraintOfInferType); + var node = factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + constraint + ); + return finishNode(node, pos); + } + function parseInferType() { + var pos = getNodePos(); + parseExpected( + 138 + /* SyntaxKind.InferKeyword */ + ); + return finishNode(factory.createInferTypeNode(parseTypeParameterOfInferType()), pos); + } + function parseTypeOperatorOrHigher() { + var operator = token(); + switch (operator) { + case 141: + case 156: + case 146: + return parseTypeOperator(operator); + case 138: + return parseInferType(); + } + return allowConditionalTypesAnd(parsePostfixTypeOrHigher); + } + function parseFunctionOrConstructorTypeToError(isInUnionType) { + if (isStartOfFunctionTypeOrConstructorType()) { + var type3 = parseFunctionOrConstructorType(); + var diagnostic = void 0; + if (ts2.isFunctionTypeNode(type3)) { + diagnostic = isInUnionType ? ts2.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type : ts2.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; + } else { + diagnostic = isInUnionType ? ts2.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type : ts2.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; + } + parseErrorAtRange(type3, diagnostic); + return type3; + } + return void 0; + } + function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) { + var pos = getNodePos(); + var isUnionType = operator === 51; + var hasLeadingOperator = parseOptional(operator); + var type3 = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType(); + if (token() === operator || hasLeadingOperator) { + var types3 = [type3]; + while (parseOptional(operator)) { + types3.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); + } + type3 = finishNode(createTypeNode(createNodeArray(types3, pos)), pos); + } + return type3; + } + function parseIntersectionTypeOrHigher() { + return parseUnionOrIntersectionType(50, parseTypeOperatorOrHigher, factory.createIntersectionTypeNode); + } + function parseUnionTypeOrHigher() { + return parseUnionOrIntersectionType(51, parseIntersectionTypeOrHigher, factory.createUnionTypeNode); + } + function nextTokenIsNewKeyword() { + nextToken(); + return token() === 103; + } + function isStartOfFunctionTypeOrConstructorType() { + if (token() === 29) { + return true; + } + if (token() === 20 && lookAhead(isUnambiguouslyStartOfFunctionType)) { + return true; + } + return token() === 103 || token() === 126 && lookAhead(nextTokenIsNewKeyword); + } + function skipParameterStart() { + if (ts2.isModifierKind(token())) { + parseModifiers(); + } + if (isIdentifier() || token() === 108) { + nextToken(); + return true; + } + if (token() === 22 || token() === 18) { + var previousErrorCount = parseDiagnostics.length; + parseIdentifierOrPattern(); + return previousErrorCount === parseDiagnostics.length; + } + return false; + } + function isUnambiguouslyStartOfFunctionType() { + nextToken(); + if (token() === 21 || token() === 25) { + return true; + } + if (skipParameterStart()) { + if (token() === 58 || token() === 27 || token() === 57 || token() === 63) { + return true; + } + if (token() === 21) { + nextToken(); + if (token() === 38) { + return true; + } + } + } + return false; + } + function parseTypeOrTypePredicate() { + var pos = getNodePos(); + var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); + var type3 = parseType(); + if (typePredicateVariable) { + return finishNode(factory.createTypePredicateNode( + /*assertsModifier*/ + void 0, + typePredicateVariable, + type3 + ), pos); + } else { + return type3; + } + } + function parseTypePredicatePrefix() { + var id = parseIdentifier(); + if (token() === 140 && !scanner.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } + function parseAssertsTypePredicate() { + var pos = getNodePos(); + var assertsModifier = parseExpectedToken( + 129 + /* SyntaxKind.AssertsKeyword */ + ); + var parameterName = token() === 108 ? parseThisTypeNode() : parseIdentifier(); + var type3 = parseOptional( + 140 + /* SyntaxKind.IsKeyword */ + ) ? parseType() : void 0; + return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type3), pos); + } + function parseType() { + if (contextFlags & 40960) { + return doOutsideOfContext(40960, parseType); + } + if (isStartOfFunctionTypeOrConstructorType()) { + return parseFunctionOrConstructorType(); + } + var pos = getNodePos(); + var type3 = parseUnionTypeOrHigher(); + if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional( + 94 + /* SyntaxKind.ExtendsKeyword */ + )) { + var extendsType = disallowConditionalTypesAnd(parseType); + parseExpected( + 57 + /* SyntaxKind.QuestionToken */ + ); + var trueType = allowConditionalTypesAnd(parseType); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var falseType = allowConditionalTypesAnd(parseType); + return finishNode(factory.createConditionalTypeNode(type3, extendsType, trueType, falseType), pos); + } + return type3; + } + function parseTypeAnnotation() { + return parseOptional( + 58 + /* SyntaxKind.ColonToken */ + ) ? parseType() : void 0; + } + function isStartOfLeftHandSideExpression() { + switch (token()) { + case 108: + case 106: + case 104: + case 110: + case 95: + case 8: + case 9: + case 10: + case 14: + case 15: + case 20: + case 22: + case 18: + case 98: + case 84: + case 103: + case 43: + case 68: + case 79: + return true; + case 100: + return lookAhead(nextTokenIsOpenParenOrLessThanOrDot); + default: + return isIdentifier(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token()) { + case 39: + case 40: + case 54: + case 53: + case 89: + case 112: + case 114: + case 45: + case 46: + case 29: + case 133: + case 125: + case 80: + return true; + default: + if (isBinaryOperator()) { + return true; + } + return isIdentifier(); + } + } + function isStartOfExpressionStatement() { + return token() !== 18 && token() !== 98 && token() !== 84 && token() !== 59 && isStartOfExpression(); + } + function parseExpression() { + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + false + ); + } + var pos = getNodePos(); + var expr = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + var operatorToken; + while (operatorToken = parseOptionalToken( + 27 + /* SyntaxKind.CommaToken */ + )) { + expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ), pos); + } + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + true + ); + } + return expr; + } + function parseInitializer() { + return parseOptional( + 63 + /* SyntaxKind.EqualsToken */ + ) ? parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ) : void 0; + } + function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) { + if (isYieldExpression()) { + return parseYieldExpression(); + } + var arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction); + if (arrowExpression) { + return arrowExpression; + } + var pos = getNodePos(); + var expr = parseBinaryExpressionOrHigher( + 0 + /* OperatorPrecedence.Lowest */ + ); + if (expr.kind === 79 && token() === 38) { + return parseSimpleArrowFunctionExpression( + pos, + expr, + allowReturnTypeInArrowFunction, + /*asyncModifier*/ + void 0 + ); + } + if (ts2.isLeftHandSideExpression(expr) && ts2.isAssignmentOperator(reScanGreaterToken())) { + return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos); + } + return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction); + } + function isYieldExpression() { + if (token() === 125) { + if (inYieldContext()) { + return true; + } + return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); + } + return false; + } + function nextTokenIsIdentifierOnSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && isIdentifier(); + } + function parseYieldExpression() { + var pos = getNodePos(); + nextToken(); + if (!scanner.hasPrecedingLineBreak() && (token() === 41 || isStartOfExpression())) { + return finishNode(factory.createYieldExpression(parseOptionalToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + )), pos); + } else { + return finishNode(factory.createYieldExpression( + /*asteriskToken*/ + void 0, + /*expression*/ + void 0 + ), pos); + } + } + function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) { + ts2.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + var parameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + identifier, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + finishNode(parameter, identifier.pos); + var parameters = createNodeArray([parameter], parameter.pos, parameter.end); + var equalsGreaterThanToken = parseExpectedToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ); + var body = parseArrowFunctionExpressionBody( + /*isAsync*/ + !!asyncModifier, + allowReturnTypeInArrowFunction + ); + var node = factory.createArrowFunction( + asyncModifier, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + equalsGreaterThanToken, + body + ); + return addJSDocComment(finishNode(node, pos)); + } + function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { + var triState = isParenthesizedArrowFunctionExpression(); + if (triState === 0) { + return void 0; + } + return triState === 1 ? parseParenthesizedArrowFunctionExpression( + /*allowAmbiguity*/ + true, + /*allowReturnTypeInArrowFunction*/ + true + ) : tryParse(function() { + return parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction); + }); + } + function isParenthesizedArrowFunctionExpression() { + if (token() === 20 || token() === 29 || token() === 132) { + return lookAhead(isParenthesizedArrowFunctionExpressionWorker); + } + if (token() === 38) { + return 1; + } + return 0; + } + function isParenthesizedArrowFunctionExpressionWorker() { + if (token() === 132) { + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return 0; + } + if (token() !== 20 && token() !== 29) { + return 0; + } + } + var first = token(); + var second = nextToken(); + if (first === 20) { + if (second === 21) { + var third = nextToken(); + switch (third) { + case 38: + case 58: + case 18: + return 1; + default: + return 0; + } + } + if (second === 22 || second === 18) { + return 2; + } + if (second === 25) { + return 1; + } + if (ts2.isModifierKind(second) && second !== 132 && lookAhead(nextTokenIsIdentifier)) { + if (nextToken() === 128) { + return 0; + } + return 1; + } + if (!isIdentifier() && second !== 108) { + return 0; + } + switch (nextToken()) { + case 58: + return 1; + case 57: + nextToken(); + if (token() === 58 || token() === 27 || token() === 63 || token() === 21) { + return 1; + } + return 0; + case 27: + case 63: + case 21: + return 2; + } + return 0; + } else { + ts2.Debug.assert( + first === 29 + /* SyntaxKind.LessThanToken */ + ); + if (!isIdentifier()) { + return 0; + } + if (languageVariant === 1) { + var isArrowFunctionInJsx = lookAhead(function() { + var third2 = nextToken(); + if (third2 === 94) { + var fourth = nextToken(); + switch (fourth) { + case 63: + case 31: + return false; + default: + return true; + } + } else if (third2 === 27 || third2 === 63) { + return true; + } + return false; + }); + if (isArrowFunctionInJsx) { + return 1; + } + return 0; + } + return 2; + } + } + function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { + var tokenPos = scanner.getTokenPos(); + if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) { + return void 0; + } + var result2 = parseParenthesizedArrowFunctionExpression( + /*allowAmbiguity*/ + false, + allowReturnTypeInArrowFunction + ); + if (!result2) { + (notParenthesizedArrow || (notParenthesizedArrow = new ts2.Set())).add(tokenPos); + } + return result2; + } + function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { + if (token() === 132) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) { + var pos = getNodePos(); + var asyncModifier = parseModifiersForArrowFunction(); + var expr = parseBinaryExpressionOrHigher( + 0 + /* OperatorPrecedence.Lowest */ + ); + return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier); + } + } + return void 0; + } + function isUnParenthesizedAsyncArrowFunctionWorker() { + if (token() === 132) { + nextToken(); + if (scanner.hasPrecedingLineBreak() || token() === 38) { + return 0; + } + var expr = parseBinaryExpressionOrHigher( + 0 + /* OperatorPrecedence.Lowest */ + ); + if (!scanner.hasPrecedingLineBreak() && expr.kind === 79 && token() === 38) { + return 1; + } + } + return 0; + } + function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var modifiers = parseModifiersForArrowFunction(); + var isAsync2 = ts2.some(modifiers, ts2.isAsyncModifier) ? 2 : 0; + var typeParameters = parseTypeParameters(); + var parameters; + if (!parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + )) { + if (!allowAmbiguity) { + return void 0; + } + parameters = createMissingList(); + } else { + if (!allowAmbiguity) { + var maybeParameters = parseParametersWorker(isAsync2, allowAmbiguity); + if (!maybeParameters) { + return void 0; + } + parameters = maybeParameters; + } else { + parameters = parseParametersWorker(isAsync2, allowAmbiguity); + } + if (!parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ) && !allowAmbiguity) { + return void 0; + } + } + var hasReturnColon = token() === 58; + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + if (type3 && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type3)) { + return void 0; + } + var unwrappedType = type3; + while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 193) { + unwrappedType = unwrappedType.type; + } + var hasJSDocFunctionType = unwrappedType && ts2.isJSDocFunctionType(unwrappedType); + if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) { + return void 0; + } + var lastToken = token(); + var equalsGreaterThanToken = parseExpectedToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ); + var body = lastToken === 38 || lastToken === 18 ? parseArrowFunctionExpressionBody(ts2.some(modifiers, ts2.isAsyncModifier), allowReturnTypeInArrowFunction) : parseIdentifier(); + if (!allowReturnTypeInArrowFunction && hasReturnColon) { + if (token() !== 58) { + return void 0; + } + } + var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseArrowFunctionExpressionBody(isAsync2, allowReturnTypeInArrowFunction) { + if (token() === 18) { + return parseFunctionBlock( + isAsync2 ? 2 : 0 + /* SignatureFlags.None */ + ); + } + if (token() !== 26 && token() !== 98 && token() !== 84 && isStartOfStatement() && !isStartOfExpressionStatement()) { + return parseFunctionBlock(16 | (isAsync2 ? 2 : 0)); + } + var savedTopLevel = topLevel; + topLevel = false; + var node = isAsync2 ? doInAwaitContext(function() { + return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); + }) : doOutsideOfAwaitContext(function() { + return parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction); + }); + topLevel = savedTopLevel; + return node; + } + function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { + var questionToken = parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + if (!questionToken) { + return leftOperand; + } + var colonToken; + return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function() { + return parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + false + ); + }), colonToken = parseExpectedToken( + 58 + /* SyntaxKind.ColonToken */ + ), ts2.nodeIsPresent(colonToken) ? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) : createMissingNode( + 79, + /*reportAtCurrentPosition*/ + false, + ts2.Diagnostics._0_expected, + ts2.tokenToString( + 58 + /* SyntaxKind.ColonToken */ + ) + )), pos); + } + function parseBinaryExpressionOrHigher(precedence) { + var pos = getNodePos(); + var leftOperand = parseUnaryExpressionOrHigher(); + return parseBinaryExpressionRest(precedence, leftOperand, pos); + } + function isInOrOfKeyword(t8) { + return t8 === 101 || t8 === 162; + } + function parseBinaryExpressionRest(precedence, leftOperand, pos) { + while (true) { + reScanGreaterToken(); + var newPrecedence = ts2.getBinaryOperatorPrecedence(token()); + var consumeCurrentOperator = token() === 42 ? newPrecedence >= precedence : newPrecedence > precedence; + if (!consumeCurrentOperator) { + break; + } + if (token() === 101 && inDisallowInContext()) { + break; + } + if (token() === 128 || token() === 150) { + if (scanner.hasPrecedingLineBreak()) { + break; + } else { + var keywordKind = token(); + nextToken(); + leftOperand = keywordKind === 150 ? makeSatisfiesExpression(leftOperand, parseType()) : makeAsExpression(leftOperand, parseType()); + } + } else { + leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence), pos); + } + } + return leftOperand; + } + function isBinaryOperator() { + if (inDisallowInContext() && token() === 101) { + return false; + } + return ts2.getBinaryOperatorPrecedence(token()) > 0; + } + function makeSatisfiesExpression(left, right) { + return finishNode(factory.createSatisfiesExpression(left, right), left.pos); + } + function makeBinaryExpression(left, operatorToken, right, pos) { + return finishNode(factory.createBinaryExpression(left, operatorToken, right), pos); + } + function makeAsExpression(left, right) { + return finishNode(factory.createAsExpression(left, right), left.pos); + } + function parsePrefixUnaryExpression() { + var pos = getNodePos(); + return finishNode(factory.createPrefixUnaryExpression(token(), nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseDeleteExpression() { + var pos = getNodePos(); + return finishNode(factory.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseTypeOfExpression() { + var pos = getNodePos(); + return finishNode(factory.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseVoidExpression() { + var pos = getNodePos(); + return finishNode(factory.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function isAwaitExpression() { + if (token() === 133) { + if (inAwaitContext()) { + return true; + } + return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); + } + return false; + } + function parseAwaitExpression() { + var pos = getNodePos(); + return finishNode(factory.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseUnaryExpressionOrHigher() { + if (isUpdateExpression()) { + var pos = getNodePos(); + var updateExpression = parseUpdateExpression(); + return token() === 42 ? parseBinaryExpressionRest(ts2.getBinaryOperatorPrecedence(token()), updateExpression, pos) : updateExpression; + } + var unaryOperator = token(); + var simpleUnaryExpression = parseSimpleUnaryExpression(); + if (token() === 42) { + var pos = ts2.skipTrivia(sourceText, simpleUnaryExpression.pos); + var end = simpleUnaryExpression.end; + if (simpleUnaryExpression.kind === 213) { + parseErrorAt(pos, end, ts2.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); + } else { + parseErrorAt(pos, end, ts2.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, ts2.tokenToString(unaryOperator)); + } + } + return simpleUnaryExpression; + } + function parseSimpleUnaryExpression() { + switch (token()) { + case 39: + case 40: + case 54: + case 53: + return parsePrefixUnaryExpression(); + case 89: + return parseDeleteExpression(); + case 112: + return parseTypeOfExpression(); + case 114: + return parseVoidExpression(); + case 29: + return parseTypeAssertion(); + case 133: + if (isAwaitExpression()) { + return parseAwaitExpression(); + } + default: + return parseUpdateExpression(); + } + } + function isUpdateExpression() { + switch (token()) { + case 39: + case 40: + case 54: + case 53: + case 89: + case 112: + case 114: + case 133: + return false; + case 29: + if (languageVariant !== 1) { + return false; + } + default: + return true; + } + } + function parseUpdateExpression() { + if (token() === 45 || token() === 46) { + var pos = getNodePos(); + return finishNode(factory.createPrefixUnaryExpression(token(), nextTokenAnd(parseLeftHandSideExpressionOrHigher)), pos); + } else if (languageVariant === 1 && token() === 29 && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } + var expression = parseLeftHandSideExpressionOrHigher(); + ts2.Debug.assert(ts2.isLeftHandSideExpression(expression)); + if ((token() === 45 || token() === 46) && !scanner.hasPrecedingLineBreak()) { + var operator = token(); + nextToken(); + return finishNode(factory.createPostfixUnaryExpression(expression, operator), expression.pos); + } + return expression; + } + function parseLeftHandSideExpressionOrHigher() { + var pos = getNodePos(); + var expression; + if (token() === 100) { + if (lookAhead(nextTokenIsOpenParenOrLessThan)) { + sourceFlags |= 2097152; + expression = parseTokenNode(); + } else if (lookAhead(nextTokenIsDot)) { + nextToken(); + nextToken(); + expression = finishNode(factory.createMetaProperty(100, parseIdentifierName()), pos); + sourceFlags |= 4194304; + } else { + expression = parseMemberExpressionOrHigher(); + } + } else { + expression = token() === 106 ? parseSuperExpression() : parseMemberExpressionOrHigher(); + } + return parseCallExpressionRest(pos, expression); + } + function parseMemberExpressionOrHigher() { + var pos = getNodePos(); + var expression = parsePrimaryExpression(); + return parseMemberExpressionRest( + pos, + expression, + /*allowOptionalChain*/ + true + ); + } + function parseSuperExpression() { + var pos = getNodePos(); + var expression = parseTokenNode(); + if (token() === 29) { + var startPos = getNodePos(); + var typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments !== void 0) { + parseErrorAt(startPos, getNodePos(), ts2.Diagnostics.super_may_not_use_type_arguments); + if (!isTemplateStartOfTaggedTemplate()) { + expression = factory.createExpressionWithTypeArguments(expression, typeArguments); + } + } + } + if (token() === 20 || token() === 24 || token() === 22) { + return expression; + } + parseExpectedToken(24, ts2.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + return finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + true + )), pos); + } + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { + var pos = getNodePos(); + var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); + var result2; + if (opening.kind === 283) { + var children = parseJsxChildren(opening); + var closingElement = void 0; + var lastChild = children[children.length - 1]; + if ((lastChild === null || lastChild === void 0 ? void 0 : lastChild.kind) === 281 && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { + var end = lastChild.children.end; + var newLast = finishNode(factory.createJsxElement(lastChild.openingElement, lastChild.children, finishNode(factory.createJsxClosingElement(finishNode(factory.createIdentifier(""), end, end)), end, end)), lastChild.openingElement.pos, end); + children = createNodeArray(__spreadArray9(__spreadArray9([], children.slice(0, children.length - 1), true), [newLast], false), children.pos, end); + closingElement = lastChild.closingElement; + } else { + closingElement = parseJsxClosingElement(opening, inExpressionContext); + if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { + if (openingTag && ts2.isJsxOpeningElement(openingTag) && tagNamesAreEquivalent(closingElement.tagName, openingTag.tagName)) { + parseErrorAtRange(opening.tagName, ts2.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts2.getTextOfNodeFromSourceText(sourceText, opening.tagName)); + } else { + parseErrorAtRange(closingElement.tagName, ts2.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, ts2.getTextOfNodeFromSourceText(sourceText, opening.tagName)); + } + } + } + result2 = finishNode(factory.createJsxElement(opening, children, closingElement), pos); + } else if (opening.kind === 286) { + result2 = finishNode(factory.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); + } else { + ts2.Debug.assert( + opening.kind === 282 + /* SyntaxKind.JsxSelfClosingElement */ + ); + result2 = opening; + } + if (inExpressionContext && token() === 29) { + var topBadPos_1 = typeof topInvalidNodePosition === "undefined" ? result2.pos : topInvalidNodePosition; + var invalidElement = tryParse(function() { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true, + topBadPos_1 + ); + }); + if (invalidElement) { + var operatorToken = createMissingNode( + 27, + /*reportAtCurrentPosition*/ + false + ); + ts2.setTextRangePosWidth(operatorToken, invalidElement.pos, 0); + parseErrorAt(ts2.skipTrivia(sourceText, topBadPos_1), invalidElement.end, ts2.Diagnostics.JSX_expressions_must_have_one_parent_element); + return finishNode(factory.createBinaryExpression(result2, operatorToken, invalidElement), pos); + } + } + return result2; + } + function parseJsxText() { + var pos = getNodePos(); + var node = factory.createJsxText( + scanner.getTokenValue(), + currentToken === 12 + /* SyntaxKind.JsxTextAllWhiteSpaces */ + ); + currentToken = scanner.scanJsxToken(); + return finishNode(node, pos); + } + function parseJsxChild(openingTag, token2) { + switch (token2) { + case 1: + if (ts2.isJsxOpeningFragment(openingTag)) { + parseErrorAtRange(openingTag, ts2.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag); + } else { + var tag = openingTag.tagName; + var start = ts2.skipTrivia(sourceText, tag.pos); + parseErrorAt(start, tag.end, ts2.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, ts2.getTextOfNodeFromSourceText(sourceText, openingTag.tagName)); + } + return void 0; + case 30: + case 7: + return void 0; + case 11: + case 12: + return parseJsxText(); + case 18: + return parseJsxExpression( + /*inExpressionContext*/ + false + ); + case 29: + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + false, + /*topInvalidNodePosition*/ + void 0, + openingTag + ); + default: + return ts2.Debug.assertNever(token2); + } + } + function parseJsxChildren(openingTag) { + var list = []; + var listPos = getNodePos(); + var saveParsingContext = parsingContext; + parsingContext |= 1 << 14; + while (true) { + var child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken()); + if (!child) + break; + list.push(child); + if (ts2.isJsxOpeningElement(openingTag) && (child === null || child === void 0 ? void 0 : child.kind) === 281 && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray(list, listPos); + } + function parseJsxAttributes() { + var pos = getNodePos(); + return finishNode(factory.createJsxAttributes(parseList(13, parseJsxAttribute)), pos); + } + function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { + var pos = getNodePos(); + parseExpected( + 29 + /* SyntaxKind.LessThanToken */ + ); + if (token() === 31) { + scanJsxText(); + return finishNode(factory.createJsxOpeningFragment(), pos); + } + var tagName = parseJsxElementName(); + var typeArguments = (contextFlags & 262144) === 0 ? tryParseTypeArguments() : void 0; + var attributes = parseJsxAttributes(); + var node; + if (token() === 31) { + scanJsxText(); + node = factory.createJsxOpeningElement(tagName, typeArguments, attributes); + } else { + parseExpected( + 43 + /* SyntaxKind.SlashToken */ + ); + if (parseExpected( + 31, + /*diagnostic*/ + void 0, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext) { + nextToken(); + } else { + scanJsxText(); + } + } + node = factory.createJsxSelfClosingElement(tagName, typeArguments, attributes); + } + return finishNode(node, pos); + } + function parseJsxElementName() { + var pos = getNodePos(); + scanJsxIdentifier(); + var expression = token() === 108 ? parseTokenNode() : parseIdentifierName(); + while (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + expression = finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + false + )), pos); + } + return expression; + } + function parseJsxExpression(inExpressionContext) { + var pos = getNodePos(); + if (!parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + return void 0; + } + var dotDotDotToken; + var expression; + if (token() !== 19) { + dotDotDotToken = parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + expression = parseExpression(); + } + if (inExpressionContext) { + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } else { + if (parseExpected( + 19, + /*message*/ + void 0, + /*shouldAdvance*/ + false + )) { + scanJsxText(); + } + } + return finishNode(factory.createJsxExpression(dotDotDotToken, expression), pos); + } + function parseJsxAttribute() { + if (token() === 18) { + return parseJsxSpreadAttribute(); + } + scanJsxIdentifier(); + var pos = getNodePos(); + return finishNode(factory.createJsxAttribute(parseIdentifierName(), parseJsxAttributeValue()), pos); + } + function parseJsxAttributeValue() { + if (token() === 63) { + if (scanJsxAttributeValue() === 10) { + return parseLiteralNode(); + } + if (token() === 18) { + return parseJsxExpression( + /*inExpressionContext*/ + true + ); + } + if (token() === 29) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } + parseErrorAtCurrentToken(ts2.Diagnostics.or_JSX_element_expected); + } + return void 0; + } + function parseJsxSpreadAttribute() { + var pos = getNodePos(); + parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + parseExpected( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var expression = parseExpression(); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + return finishNode(factory.createJsxSpreadAttribute(expression), pos); + } + function parseJsxClosingElement(open2, inExpressionContext) { + var pos = getNodePos(); + parseExpected( + 30 + /* SyntaxKind.LessThanSlashToken */ + ); + var tagName = parseJsxElementName(); + if (parseExpected( + 31, + /*diagnostic*/ + void 0, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext || !tagNamesAreEquivalent(open2.tagName, tagName)) { + nextToken(); + } else { + scanJsxText(); + } + } + return finishNode(factory.createJsxClosingElement(tagName), pos); + } + function parseJsxClosingFragment(inExpressionContext) { + var pos = getNodePos(); + parseExpected( + 30 + /* SyntaxKind.LessThanSlashToken */ + ); + if (ts2.tokenIsIdentifierOrKeyword(token())) { + parseErrorAtRange(parseJsxElementName(), ts2.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); + } + if (parseExpected( + 31, + /*diagnostic*/ + void 0, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext) { + nextToken(); + } else { + scanJsxText(); + } + } + return finishNode(factory.createJsxJsxClosingFragment(), pos); + } + function parseTypeAssertion() { + var pos = getNodePos(); + parseExpected( + 29 + /* SyntaxKind.LessThanToken */ + ); + var type3 = parseType(); + parseExpected( + 31 + /* SyntaxKind.GreaterThanToken */ + ); + var expression = parseSimpleUnaryExpression(); + return finishNode(factory.createTypeAssertion(type3, expression), pos); + } + function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate() { + nextToken(); + return ts2.tokenIsIdentifierOrKeyword(token()) || token() === 22 || isTemplateStartOfTaggedTemplate(); + } + function isStartOfOptionalPropertyOrElementAccessChain() { + return token() === 28 && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); + } + function tryReparseOptionalChain(node) { + if (node.flags & 32) { + return true; + } + if (ts2.isNonNullExpression(node)) { + var expr = node.expression; + while (ts2.isNonNullExpression(expr) && !(expr.flags & 32)) { + expr = expr.expression; + } + if (expr.flags & 32) { + while (ts2.isNonNullExpression(node)) { + node.flags |= 32; + node = node.expression; + } + return true; + } + } + return false; + } + function parsePropertyAccessExpressionRest(pos, expression, questionDotToken) { + var name2 = parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + true + ); + var isOptionalChain = questionDotToken || tryReparseOptionalChain(expression); + var propertyAccess = isOptionalChain ? factory.createPropertyAccessChain(expression, questionDotToken, name2) : factory.createPropertyAccessExpression(expression, name2); + if (isOptionalChain && ts2.isPrivateIdentifier(propertyAccess.name)) { + parseErrorAtRange(propertyAccess.name, ts2.Diagnostics.An_optional_chain_cannot_contain_private_identifiers); + } + if (ts2.isExpressionWithTypeArguments(expression) && expression.typeArguments) { + var pos_2 = expression.typeArguments.pos - 1; + var end = ts2.skipTrivia(sourceText, expression.typeArguments.end) + 1; + parseErrorAt(pos_2, end, ts2.Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access); + } + return finishNode(propertyAccess, pos); + } + function parseElementAccessExpressionRest(pos, expression, questionDotToken) { + var argumentExpression; + if (token() === 23) { + argumentExpression = createMissingNode( + 79, + /*reportAtCurrentPosition*/ + true, + ts2.Diagnostics.An_element_access_expression_should_take_an_argument + ); + } else { + var argument = allowInAnd(parseExpression); + if (ts2.isStringOrNumericLiteralLike(argument)) { + argument.text = internIdentifier(argument.text); + } + argumentExpression = argument; + } + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + var indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory.createElementAccessExpression(expression, argumentExpression); + return finishNode(indexedAccess, pos); + } + function parseMemberExpressionRest(pos, expression, allowOptionalChain) { + while (true) { + var questionDotToken = void 0; + var isPropertyAccess = false; + if (allowOptionalChain && isStartOfOptionalPropertyOrElementAccessChain()) { + questionDotToken = parseExpectedToken( + 28 + /* SyntaxKind.QuestionDotToken */ + ); + isPropertyAccess = ts2.tokenIsIdentifierOrKeyword(token()); + } else { + isPropertyAccess = parseOptional( + 24 + /* SyntaxKind.DotToken */ + ); + } + if (isPropertyAccess) { + expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken); + continue; + } + if ((questionDotToken || !inDecoratorContext()) && parseOptional( + 22 + /* SyntaxKind.OpenBracketToken */ + )) { + expression = parseElementAccessExpressionRest(pos, expression, questionDotToken); + continue; + } + if (isTemplateStartOfTaggedTemplate()) { + expression = !questionDotToken && expression.kind === 230 ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( + pos, + expression, + questionDotToken, + /*typeArguments*/ + void 0 + ); + continue; + } + if (!questionDotToken) { + if (token() === 53 && !scanner.hasPrecedingLineBreak()) { + nextToken(); + expression = finishNode(factory.createNonNullExpression(expression), pos); + continue; + } + var typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments) { + expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos); + continue; + } + } + return expression; + } + } + function isTemplateStartOfTaggedTemplate() { + return token() === 14 || token() === 15; + } + function parseTaggedTemplateRest(pos, tag, questionDotToken, typeArguments) { + var tagExpression = factory.createTaggedTemplateExpression(tag, typeArguments, token() === 14 ? (reScanTemplateHeadOrNoSubstitutionTemplate(), parseLiteralNode()) : parseTemplateExpression( + /*isTaggedTemplate*/ + true + )); + if (questionDotToken || tag.flags & 32) { + tagExpression.flags |= 32; + } + tagExpression.questionDotToken = questionDotToken; + return finishNode(tagExpression, pos); + } + function parseCallExpressionRest(pos, expression) { + while (true) { + expression = parseMemberExpressionRest( + pos, + expression, + /*allowOptionalChain*/ + true + ); + var typeArguments = void 0; + var questionDotToken = parseOptionalToken( + 28 + /* SyntaxKind.QuestionDotToken */ + ); + if (questionDotToken) { + typeArguments = tryParse(parseTypeArgumentsInExpression); + if (isTemplateStartOfTaggedTemplate()) { + expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments); + continue; + } + } + if (typeArguments || token() === 20) { + if (!questionDotToken && expression.kind === 230) { + typeArguments = expression.typeArguments; + expression = expression.expression; + } + var argumentList = parseArgumentList(); + var callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory.createCallExpression(expression, typeArguments, argumentList); + expression = finishNode(callExpr, pos); + continue; + } + if (questionDotToken) { + var name2 = createMissingNode( + 79, + /*reportAtCurrentPosition*/ + false, + ts2.Diagnostics.Identifier_expected + ); + expression = finishNode(factory.createPropertyAccessChain(expression, questionDotToken, name2), pos); + } + break; + } + return expression; + } + function parseArgumentList() { + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var result2 = parseDelimitedList(11, parseArgumentExpression); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + return result2; + } + function parseTypeArgumentsInExpression() { + if ((contextFlags & 262144) !== 0) { + return void 0; + } + if (reScanLessThanToken() !== 29) { + return void 0; + } + nextToken(); + var typeArguments = parseDelimitedList(20, parseType); + if (reScanGreaterToken() !== 31) { + return void 0; + } + nextToken(); + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : void 0; + } + function canFollowTypeArgumentsInExpression() { + switch (token()) { + case 20: + case 14: + case 15: + return true; + case 29: + case 31: + case 39: + case 40: + return false; + } + return scanner.hasPrecedingLineBreak() || isBinaryOperator() || !isStartOfExpression(); + } + function parsePrimaryExpression() { + switch (token()) { + case 8: + case 9: + case 10: + case 14: + return parseLiteralNode(); + case 108: + case 106: + case 104: + case 110: + case 95: + return parseTokenNode(); + case 20: + return parseParenthesizedExpression(); + case 22: + return parseArrayLiteralExpression(); + case 18: + return parseObjectLiteralExpression(); + case 132: + if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) { + break; + } + return parseFunctionExpression(); + case 84: + return parseClassExpression(); + case 98: + return parseFunctionExpression(); + case 103: + return parseNewExpressionOrNewDotTarget(); + case 43: + case 68: + if (reScanSlashToken() === 13) { + return parseLiteralNode(); + } + break; + case 15: + return parseTemplateExpression( + /* isTaggedTemplate */ + false + ); + case 80: + return parsePrivateIdentifier(); + } + return parseIdentifier(ts2.Diagnostics.Expression_expected); + } + function parseParenthesizedExpression() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + return withJSDoc(finishNode(factory.createParenthesizedExpression(expression), pos), hasJSDoc); + } + function parseSpreadElement() { + var pos = getNodePos(); + parseExpected( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return finishNode(factory.createSpreadElement(expression), pos); + } + function parseArgumentOrArrayLiteralElement() { + return token() === 25 ? parseSpreadElement() : token() === 27 ? finishNode(factory.createOmittedExpression(), getNodePos()) : parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + } + function parseArgumentExpression() { + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); + } + function parseArrayLiteralExpression() { + var pos = getNodePos(); + var openBracketPosition = scanner.getTokenPos(); + var openBracketParsed = parseExpected( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + var multiLine = scanner.hasPrecedingLineBreak(); + var elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement); + parseExpectedMatchingBrackets(22, 23, openBracketParsed, openBracketPosition); + return finishNode(factory.createArrayLiteralExpression(elements, multiLine), pos); + } + function parseObjectLiteralElement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + if (parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + )) { + var expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc); + } + var decorators = parseDecorators(); + var modifiers = parseModifiers(); + if (parseContextualModifier( + 137 + /* SyntaxKind.GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + 174, + 0 + /* SignatureFlags.None */ + ); + } + if (parseContextualModifier( + 151 + /* SyntaxKind.SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + 175, + 0 + /* SignatureFlags.None */ + ); + } + var asteriskToken = parseOptionalToken( + 41 + /* SyntaxKind.AsteriskToken */ + ); + var tokenIsIdentifier = isIdentifier(); + var name2 = parsePropertyName(); + var questionToken = parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + var exclamationToken = parseOptionalToken( + 53 + /* SyntaxKind.ExclamationToken */ + ); + if (asteriskToken || token() === 20 || token() === 29) { + return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name2, questionToken, exclamationToken); + } + var node; + var isShorthandPropertyAssignment = tokenIsIdentifier && token() !== 58; + if (isShorthandPropertyAssignment) { + var equalsToken = parseOptionalToken( + 63 + /* SyntaxKind.EqualsToken */ + ); + var objectAssignmentInitializer = equalsToken ? allowInAnd(function() { + return parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + }) : void 0; + node = factory.createShorthandPropertyAssignment(name2, objectAssignmentInitializer); + node.equalsToken = equalsToken; + } else { + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var initializer = allowInAnd(function() { + return parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + }); + node = factory.createPropertyAssignment(name2, initializer); + } + node.illegalDecorators = decorators; + node.modifiers = modifiers; + node.questionToken = questionToken; + node.exclamationToken = exclamationToken; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseObjectLiteralExpression() { + var pos = getNodePos(); + var openBracePosition = scanner.getTokenPos(); + var openBraceParsed = parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var multiLine = scanner.hasPrecedingLineBreak(); + var properties = parseDelimitedList( + 12, + parseObjectLiteralElement, + /*considerSemicolonAsDelimiter*/ + true + ); + parseExpectedMatchingBrackets(18, 19, openBraceParsed, openBracePosition); + return finishNode(factory.createObjectLiteralExpression(properties, multiLine), pos); + } + function parseFunctionExpression() { + var savedDecoratorContext = inDecoratorContext(); + setDecoratorContext( + /*val*/ + false + ); + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var modifiers = parseModifiers(); + parseExpected( + 98 + /* SyntaxKind.FunctionKeyword */ + ); + var asteriskToken = parseOptionalToken( + 41 + /* SyntaxKind.AsteriskToken */ + ); + var isGenerator = asteriskToken ? 1 : 0; + var isAsync2 = ts2.some(modifiers, ts2.isAsyncModifier) ? 2 : 0; + var name2 = isGenerator && isAsync2 ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) : isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) : isAsync2 ? doInAwaitContext(parseOptionalBindingIdentifier) : parseOptionalBindingIdentifier(); + var typeParameters = parseTypeParameters(); + var parameters = parseParameters(isGenerator | isAsync2); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + var body = parseFunctionBlock(isGenerator | isAsync2); + setDecoratorContext(savedDecoratorContext); + var node = factory.createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseOptionalBindingIdentifier() { + return isBindingIdentifier() ? parseBindingIdentifier() : void 0; + } + function parseNewExpressionOrNewDotTarget() { + var pos = getNodePos(); + parseExpected( + 103 + /* SyntaxKind.NewKeyword */ + ); + if (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + var name2 = parseIdentifierName(); + return finishNode(factory.createMetaProperty(103, name2), pos); + } + var expressionPos = getNodePos(); + var expression = parseMemberExpressionRest( + expressionPos, + parsePrimaryExpression(), + /*allowOptionalChain*/ + false + ); + var typeArguments; + if (expression.kind === 230) { + typeArguments = expression.typeArguments; + expression = expression.expression; + } + if (token() === 28) { + parseErrorAtCurrentToken(ts2.Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, ts2.getTextOfNodeFromSourceText(sourceText, expression)); + } + var argumentList = token() === 20 ? parseArgumentList() : void 0; + return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos); + } + function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var openBracePosition = scanner.getTokenPos(); + var openBraceParsed = parseExpected(18, diagnosticMessage); + if (openBraceParsed || ignoreMissingOpenBrace) { + var multiLine = scanner.hasPrecedingLineBreak(); + var statements = parseList(1, parseStatement); + parseExpectedMatchingBrackets(18, 19, openBraceParsed, openBracePosition); + var result2 = withJSDoc(finishNode(factory.createBlock(statements, multiLine), pos), hasJSDoc); + if (token() === 63) { + parseErrorAtCurrentToken(ts2.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); + nextToken(); + } + return result2; + } else { + var statements = createMissingList(); + return withJSDoc(finishNode(factory.createBlock( + statements, + /*multiLine*/ + void 0 + ), pos), hasJSDoc); + } + } + function parseFunctionBlock(flags, diagnosticMessage) { + var savedYieldContext = inYieldContext(); + setYieldContext(!!(flags & 1)); + var savedAwaitContext = inAwaitContext(); + setAwaitContext(!!(flags & 2)); + var savedTopLevel = topLevel; + topLevel = false; + var saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + false + ); + } + var block = parseBlock(!!(flags & 16), diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + true + ); + } + topLevel = savedTopLevel; + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return block; + } + function parseEmptyStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 26 + /* SyntaxKind.SemicolonToken */ + ); + return withJSDoc(finishNode(factory.createEmptyStatement(), pos), hasJSDoc); + } + function parseIfStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 99 + /* SyntaxKind.IfKeyword */ + ); + var openParenPosition = scanner.getTokenPos(); + var openParenParsed = parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(20, 21, openParenParsed, openParenPosition); + var thenStatement = parseStatement(); + var elseStatement = parseOptional( + 91 + /* SyntaxKind.ElseKeyword */ + ) ? parseStatement() : void 0; + return withJSDoc(finishNode(factory.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + } + function parseDoStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 90 + /* SyntaxKind.DoKeyword */ + ); + var statement = parseStatement(); + parseExpected( + 115 + /* SyntaxKind.WhileKeyword */ + ); + var openParenPosition = scanner.getTokenPos(); + var openParenParsed = parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(20, 21, openParenParsed, openParenPosition); + parseOptional( + 26 + /* SyntaxKind.SemicolonToken */ + ); + return withJSDoc(finishNode(factory.createDoStatement(statement, expression), pos), hasJSDoc); + } + function parseWhileStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 115 + /* SyntaxKind.WhileKeyword */ + ); + var openParenPosition = scanner.getTokenPos(); + var openParenParsed = parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(20, 21, openParenParsed, openParenPosition); + var statement = parseStatement(); + return withJSDoc(finishNode(factory.createWhileStatement(expression, statement), pos), hasJSDoc); + } + function parseForOrForInOrForOfStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 97 + /* SyntaxKind.ForKeyword */ + ); + var awaitToken = parseOptionalToken( + 133 + /* SyntaxKind.AwaitKeyword */ + ); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var initializer; + if (token() !== 26) { + if (token() === 113 || token() === 119 || token() === 85) { + initializer = parseVariableDeclarationList( + /*inForStatementInitializer*/ + true + ); + } else { + initializer = disallowInAnd(parseExpression); + } + } + var node; + if (awaitToken ? parseExpected( + 162 + /* SyntaxKind.OfKeyword */ + ) : parseOptional( + 162 + /* SyntaxKind.OfKeyword */ + )) { + var expression = allowInAnd(function() { + return parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + }); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement()); + } else if (parseOptional( + 101 + /* SyntaxKind.InKeyword */ + )) { + var expression = allowInAnd(parseExpression); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + node = factory.createForInStatement(initializer, expression, parseStatement()); + } else { + parseExpected( + 26 + /* SyntaxKind.SemicolonToken */ + ); + var condition = token() !== 26 && token() !== 21 ? allowInAnd(parseExpression) : void 0; + parseExpected( + 26 + /* SyntaxKind.SemicolonToken */ + ); + var incrementor = token() !== 21 ? allowInAnd(parseExpression) : void 0; + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + node = factory.createForStatement(initializer, condition, incrementor, parseStatement()); + } + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseBreakOrContinueStatement(kind) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + kind === 249 ? 81 : 86 + /* SyntaxKind.ContinueKeyword */ + ); + var label = canParseSemicolon() ? void 0 : parseIdentifier(); + parseSemicolon(); + var node = kind === 249 ? factory.createBreakStatement(label) : factory.createContinueStatement(label); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseReturnStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 105 + /* SyntaxKind.ReturnKeyword */ + ); + var expression = canParseSemicolon() ? void 0 : allowInAnd(parseExpression); + parseSemicolon(); + return withJSDoc(finishNode(factory.createReturnStatement(expression), pos), hasJSDoc); + } + function parseWithStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 116 + /* SyntaxKind.WithKeyword */ + ); + var openParenPosition = scanner.getTokenPos(); + var openParenParsed = parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(20, 21, openParenParsed, openParenPosition); + var statement = doInsideOfContext(33554432, parseStatement); + return withJSDoc(finishNode(factory.createWithStatement(expression, statement), pos), hasJSDoc); + } + function parseCaseClause() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 82 + /* SyntaxKind.CaseKeyword */ + ); + var expression = allowInAnd(parseExpression); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var statements = parseList(3, parseStatement); + return withJSDoc(finishNode(factory.createCaseClause(expression, statements), pos), hasJSDoc); + } + function parseDefaultClause() { + var pos = getNodePos(); + parseExpected( + 88 + /* SyntaxKind.DefaultKeyword */ + ); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var statements = parseList(3, parseStatement); + return finishNode(factory.createDefaultClause(statements), pos); + } + function parseCaseOrDefaultClause() { + return token() === 82 ? parseCaseClause() : parseDefaultClause(); + } + function parseCaseBlock() { + var pos = getNodePos(); + parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var clauses = parseList(2, parseCaseOrDefaultClause); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + return finishNode(factory.createCaseBlock(clauses), pos); + } + function parseSwitchStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 107 + /* SyntaxKind.SwitchKeyword */ + ); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = allowInAnd(parseExpression); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + var caseBlock = parseCaseBlock(); + return withJSDoc(finishNode(factory.createSwitchStatement(expression, caseBlock), pos), hasJSDoc); + } + function parseThrowStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 109 + /* SyntaxKind.ThrowKeyword */ + ); + var expression = scanner.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); + if (expression === void 0) { + identifierCount++; + expression = finishNode(factory.createIdentifier(""), getNodePos()); + } + if (!tryParseSemicolon()) { + parseErrorForMissingSemicolonAfter(expression); + } + return withJSDoc(finishNode(factory.createThrowStatement(expression), pos), hasJSDoc); + } + function parseTryStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 111 + /* SyntaxKind.TryKeyword */ + ); + var tryBlock = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + var catchClause = token() === 83 ? parseCatchClause() : void 0; + var finallyBlock; + if (!catchClause || token() === 96) { + parseExpected(96, ts2.Diagnostics.catch_or_finally_expected); + finallyBlock = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + } + return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc); + } + function parseCatchClause() { + var pos = getNodePos(); + parseExpected( + 83 + /* SyntaxKind.CatchKeyword */ + ); + var variableDeclaration; + if (parseOptional( + 20 + /* SyntaxKind.OpenParenToken */ + )) { + variableDeclaration = parseVariableDeclaration(); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + } else { + variableDeclaration = void 0; + } + var block = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + return finishNode(factory.createCatchClause(variableDeclaration, block), pos); + } + function parseDebuggerStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 87 + /* SyntaxKind.DebuggerKeyword */ + ); + parseSemicolon(); + return withJSDoc(finishNode(factory.createDebuggerStatement(), pos), hasJSDoc); + } + function parseExpressionOrLabeledStatement() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var node; + var hasParen = token() === 20; + var expression = allowInAnd(parseExpression); + if (ts2.isIdentifier(expression) && parseOptional( + 58 + /* SyntaxKind.ColonToken */ + )) { + node = factory.createLabeledStatement(expression, parseStatement()); + } else { + if (!tryParseSemicolon()) { + parseErrorForMissingSemicolonAfter(expression); + } + node = factory.createExpressionStatement(expression); + if (hasParen) { + hasJSDoc = false; + } + } + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function nextTokenIsIdentifierOrKeywordOnSameLine() { + nextToken(); + return ts2.tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); + } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 84 && !scanner.hasPrecedingLineBreak(); + } + function nextTokenIsFunctionKeywordOnSameLine() { + nextToken(); + return token() === 98 && !scanner.hasPrecedingLineBreak(); + } + function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() { + nextToken(); + return (ts2.tokenIsIdentifierOrKeyword(token()) || token() === 8 || token() === 9 || token() === 10) && !scanner.hasPrecedingLineBreak(); + } + function isDeclaration() { + while (true) { + switch (token()) { + case 113: + case 119: + case 85: + case 98: + case 84: + case 92: + return true; + case 118: + case 154: + return nextTokenIsIdentifierOnSameLine(); + case 142: + case 143: + return nextTokenIsIdentifierOrStringLiteralOnSameLine(); + case 126: + case 127: + case 132: + case 136: + case 121: + case 122: + case 123: + case 146: + nextToken(); + if (scanner.hasPrecedingLineBreak()) { + return false; + } + continue; + case 159: + nextToken(); + return token() === 18 || token() === 79 || token() === 93; + case 100: + nextToken(); + return token() === 10 || token() === 41 || token() === 18 || ts2.tokenIsIdentifierOrKeyword(token()); + case 93: + var currentToken_1 = nextToken(); + if (currentToken_1 === 154) { + currentToken_1 = lookAhead(nextToken); + } + if (currentToken_1 === 63 || currentToken_1 === 41 || currentToken_1 === 18 || currentToken_1 === 88 || currentToken_1 === 128) { + return true; + } + continue; + case 124: + nextToken(); + continue; + default: + return false; + } + } + } + function isStartOfDeclaration() { + return lookAhead(isDeclaration); + } + function isStartOfStatement() { + switch (token()) { + case 59: + case 26: + case 18: + case 113: + case 119: + case 98: + case 84: + case 92: + case 99: + case 90: + case 115: + case 97: + case 86: + case 81: + case 105: + case 116: + case 107: + case 109: + case 111: + case 87: + case 83: + case 96: + return true; + case 100: + return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot); + case 85: + case 93: + return isStartOfDeclaration(); + case 132: + case 136: + case 118: + case 142: + case 143: + case 154: + case 159: + return true; + case 127: + case 123: + case 121: + case 122: + case 124: + case 146: + return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); + default: + return isStartOfExpression(); + } + } + function nextTokenIsBindingIdentifierOrStartOfDestructuring() { + nextToken(); + return isBindingIdentifier() || token() === 18 || token() === 22; + } + function isLetDeclaration() { + return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring); + } + function parseStatement() { + switch (token()) { + case 26: + return parseEmptyStatement(); + case 18: + return parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + case 113: + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*decorators*/ + void 0, + /*modifiers*/ + void 0 + ); + case 119: + if (isLetDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*decorators*/ + void 0, + /*modifiers*/ + void 0 + ); + } + break; + case 98: + return parseFunctionDeclaration( + getNodePos(), + hasPrecedingJSDocComment(), + /*decorators*/ + void 0, + /*modifiers*/ + void 0 + ); + case 84: + return parseClassDeclaration( + getNodePos(), + hasPrecedingJSDocComment(), + /*decorators*/ + void 0, + /*modifiers*/ + void 0 + ); + case 99: + return parseIfStatement(); + case 90: + return parseDoStatement(); + case 115: + return parseWhileStatement(); + case 97: + return parseForOrForInOrForOfStatement(); + case 86: + return parseBreakOrContinueStatement( + 248 + /* SyntaxKind.ContinueStatement */ + ); + case 81: + return parseBreakOrContinueStatement( + 249 + /* SyntaxKind.BreakStatement */ + ); + case 105: + return parseReturnStatement(); + case 116: + return parseWithStatement(); + case 107: + return parseSwitchStatement(); + case 109: + return parseThrowStatement(); + case 111: + case 83: + case 96: + return parseTryStatement(); + case 87: + return parseDebuggerStatement(); + case 59: + return parseDeclaration(); + case 132: + case 118: + case 154: + case 142: + case 143: + case 136: + case 85: + case 92: + case 93: + case 100: + case 121: + case 122: + case 123: + case 126: + case 127: + case 124: + case 146: + case 159: + if (isStartOfDeclaration()) { + return parseDeclaration(); + } + break; + } + return parseExpressionOrLabeledStatement(); + } + function isDeclareModifier(modifier) { + return modifier.kind === 136; + } + function parseDeclaration() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var decorators = parseDecorators(); + var modifiers = parseModifiers(); + var isAmbient = ts2.some(modifiers, isDeclareModifier); + if (isAmbient) { + var node = tryReuseAmbientDeclaration(pos); + if (node) { + return node; + } + for (var _i = 0, _a3 = modifiers; _i < _a3.length; _i++) { + var m7 = _a3[_i]; + m7.flags |= 16777216; + } + return doInsideOfContext(16777216, function() { + return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + }); + } else { + return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); + } + } + function tryReuseAmbientDeclaration(pos) { + return doInsideOfContext(16777216, function() { + var node = currentNode(parsingContext, pos); + if (node) { + return consumeNode(node); + } + }); + } + function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { + switch (token()) { + case 113: + case 119: + case 85: + return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); + case 98: + return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); + case 84: + return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); + case 118: + return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); + case 154: + return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); + case 92: + return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); + case 159: + case 142: + case 143: + return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + case 100: + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); + case 93: + nextToken(); + switch (token()) { + case 88: + case 63: + return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); + case 128: + return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); + default: + return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); + } + default: + if (decorators || modifiers) { + var missing = createMissingNode( + 279, + /*reportAtCurrentPosition*/ + true, + ts2.Diagnostics.Declaration_expected + ); + ts2.setTextRangePos(missing, pos); + missing.illegalDecorators = decorators; + missing.modifiers = modifiers; + return missing; + } + return void 0; + } + } + function nextTokenIsIdentifierOrStringLiteralOnSameLine() { + nextToken(); + return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token() === 10); + } + function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) { + if (token() !== 18) { + if (flags & 4) { + parseTypeMemberSemicolon(); + return; + } + if (canParseSemicolon()) { + parseSemicolon(); + return; + } + } + return parseFunctionBlock(flags, diagnosticMessage); + } + function parseArrayBindingElement() { + var pos = getNodePos(); + if (token() === 27) { + return finishNode(factory.createOmittedExpression(), pos); + } + var dotDotDotToken = parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var name2 = parseIdentifierOrPattern(); + var initializer = parseInitializer(); + return finishNode(factory.createBindingElement( + dotDotDotToken, + /*propertyName*/ + void 0, + name2, + initializer + ), pos); + } + function parseObjectBindingElement() { + var pos = getNodePos(); + var dotDotDotToken = parseOptionalToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ); + var tokenIsIdentifier = isBindingIdentifier(); + var propertyName = parsePropertyName(); + var name2; + if (tokenIsIdentifier && token() !== 58) { + name2 = propertyName; + propertyName = void 0; + } else { + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + name2 = parseIdentifierOrPattern(); + } + var initializer = parseInitializer(); + return finishNode(factory.createBindingElement(dotDotDotToken, propertyName, name2, initializer), pos); + } + function parseObjectBindingPattern() { + var pos = getNodePos(); + parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var elements = parseDelimitedList(9, parseObjectBindingElement); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + return finishNode(factory.createObjectBindingPattern(elements), pos); + } + function parseArrayBindingPattern() { + var pos = getNodePos(); + parseExpected( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + var elements = parseDelimitedList(10, parseArrayBindingElement); + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + return finishNode(factory.createArrayBindingPattern(elements), pos); + } + function isBindingIdentifierOrPrivateIdentifierOrPattern() { + return token() === 18 || token() === 22 || token() === 80 || isBindingIdentifier(); + } + function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) { + if (token() === 22) { + return parseArrayBindingPattern(); + } + if (token() === 18) { + return parseObjectBindingPattern(); + } + return parseBindingIdentifier(privateIdentifierDiagnosticMessage); + } + function parseVariableDeclarationAllowExclamation() { + return parseVariableDeclaration( + /*allowExclamation*/ + true + ); + } + function parseVariableDeclaration(allowExclamation) { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var name2 = parseIdentifierOrPattern(ts2.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); + var exclamationToken; + if (allowExclamation && name2.kind === 79 && token() === 53 && !scanner.hasPrecedingLineBreak()) { + exclamationToken = parseTokenNode(); + } + var type3 = parseTypeAnnotation(); + var initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); + var node = factory.createVariableDeclaration(name2, exclamationToken, type3, initializer); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseVariableDeclarationList(inForStatementInitializer) { + var pos = getNodePos(); + var flags = 0; + switch (token()) { + case 113: + break; + case 119: + flags |= 1; + break; + case 85: + flags |= 2; + break; + default: + ts2.Debug.fail(); + } + nextToken(); + var declarations; + if (token() === 162 && lookAhead(canFollowContextualOfKeyword)) { + declarations = createMissingList(); + } else { + var savedDisallowIn = inDisallowInContext(); + setDisallowInContext(inForStatementInitializer); + declarations = parseDelimitedList(8, inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation); + setDisallowInContext(savedDisallowIn); + } + return finishNode(factory.createVariableDeclarationList(declarations, flags), pos); + } + function canFollowContextualOfKeyword() { + return nextTokenIsIdentifier() && nextToken() === 21; + } + function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { + var declarationList = parseVariableDeclarationList( + /*inForStatementInitializer*/ + false + ); + parseSemicolon(); + var node = factory.createVariableStatement(modifiers, declarationList); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { + var savedAwaitContext = inAwaitContext(); + var modifierFlags = ts2.modifiersToFlags(modifiers); + parseExpected( + 98 + /* SyntaxKind.FunctionKeyword */ + ); + var asteriskToken = parseOptionalToken( + 41 + /* SyntaxKind.AsteriskToken */ + ); + var name2 = modifierFlags & 1024 ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); + var isGenerator = asteriskToken ? 1 : 0; + var isAsync2 = modifierFlags & 512 ? 2 : 0; + var typeParameters = parseTypeParameters(); + if (modifierFlags & 1) + setAwaitContext( + /*value*/ + true + ); + var parameters = parseParameters(isGenerator | isAsync2); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync2, ts2.Diagnostics.or_expected); + setAwaitContext(savedAwaitContext); + var node = factory.createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseConstructorName() { + if (token() === 135) { + return parseExpected( + 135 + /* SyntaxKind.ConstructorKeyword */ + ); + } + if (token() === 10 && lookAhead(nextToken) === 20) { + return tryParse(function() { + var literalNode = parseLiteralNode(); + return literalNode.text === "constructor" ? literalNode : void 0; + }); + } + } + function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { + return tryParse(function() { + if (parseConstructorName()) { + var typeParameters = parseTypeParameters(); + var parameters = parseParameters( + 0 + /* SignatureFlags.None */ + ); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + var body = parseFunctionBlockOrSemicolon(0, ts2.Diagnostics.or_expected); + var node = factory.createConstructorDeclaration(modifiers, parameters, body); + node.illegalDecorators = decorators; + node.typeParameters = typeParameters; + node.type = type3; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + }); + } + function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name2, questionToken, exclamationToken, diagnosticMessage) { + var isGenerator = asteriskToken ? 1 : 0; + var isAsync2 = ts2.some(modifiers, ts2.isAsyncModifier) ? 2 : 0; + var typeParameters = parseTypeParameters(); + var parameters = parseParameters(isGenerator | isAsync2); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + var body = parseFunctionBlockOrSemicolon(isGenerator | isAsync2, diagnosticMessage); + var node = factory.createMethodDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), asteriskToken, name2, questionToken, typeParameters, parameters, type3, body); + node.exclamationToken = exclamationToken; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name2, questionToken) { + var exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken( + 53 + /* SyntaxKind.ExclamationToken */ + ) : void 0; + var type3 = parseTypeAnnotation(); + var initializer = doOutsideOfContext(8192 | 32768 | 4096, parseInitializer); + parseSemicolonAfterPropertyName(name2, type3, initializer); + var node = factory.createPropertyDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name2, questionToken || exclamationToken, type3, initializer); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { + var asteriskToken = parseOptionalToken( + 41 + /* SyntaxKind.AsteriskToken */ + ); + var name2 = parsePropertyName(); + var questionToken = parseOptionalToken( + 57 + /* SyntaxKind.QuestionToken */ + ); + if (asteriskToken || token() === 20 || token() === 29) { + return parseMethodDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + asteriskToken, + name2, + questionToken, + /*exclamationToken*/ + void 0, + ts2.Diagnostics.or_expected + ); + } + return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name2, questionToken); + } + function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { + var name2 = parsePropertyName(); + var typeParameters = parseTypeParameters(); + var parameters = parseParameters( + 0 + /* SignatureFlags.None */ + ); + var type3 = parseReturnType( + 58, + /*isType*/ + false + ); + var body = parseFunctionBlockOrSemicolon(flags); + var node = kind === 174 ? factory.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name2, parameters, type3, body) : factory.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name2, parameters, body); + node.typeParameters = typeParameters; + if (ts2.isSetAccessorDeclaration(node)) + node.type = type3; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isClassMemberStart() { + var idToken; + if (token() === 59) { + return true; + } + while (ts2.isModifierKind(token())) { + idToken = token(); + if (ts2.isClassMemberModifier(idToken)) { + return true; + } + nextToken(); + } + if (token() === 41) { + return true; + } + if (isLiteralPropertyName()) { + idToken = token(); + nextToken(); + } + if (token() === 22) { + return true; + } + if (idToken !== void 0) { + if (!ts2.isKeyword(idToken) || idToken === 151 || idToken === 137) { + return true; + } + switch (token()) { + case 20: + case 29: + case 53: + case 58: + case 63: + case 57: + return true; + default: + return canParseSemicolon(); + } + } + return false; + } + function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpectedToken( + 124 + /* SyntaxKind.StaticKeyword */ + ); + var body = parseClassStaticBlockBody(); + var node = withJSDoc(finishNode(factory.createClassStaticBlockDeclaration(body), pos), hasJSDoc); + node.illegalDecorators = decorators; + node.modifiers = modifiers; + return node; + } + function parseClassStaticBlockBody() { + var savedYieldContext = inYieldContext(); + var savedAwaitContext = inAwaitContext(); + setYieldContext(false); + setAwaitContext(true); + var body = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return body; + } + function parseDecoratorExpression() { + if (inAwaitContext() && token() === 133) { + var pos = getNodePos(); + var awaitExpression = parseIdentifier(ts2.Diagnostics.Expression_expected); + nextToken(); + var memberExpression = parseMemberExpressionRest( + pos, + awaitExpression, + /*allowOptionalChain*/ + true + ); + return parseCallExpressionRest(pos, memberExpression); + } + return parseLeftHandSideExpressionOrHigher(); + } + function tryParseDecorator() { + var pos = getNodePos(); + if (!parseOptional( + 59 + /* SyntaxKind.AtToken */ + )) { + return void 0; + } + var expression = doInDecoratorContext(parseDecoratorExpression); + return finishNode(factory.createDecorator(expression), pos); + } + function parseDecorators() { + var pos = getNodePos(); + var list, decorator; + while (decorator = tryParseDecorator()) { + list = ts2.append(list, decorator); + } + return list && createNodeArray(list, pos); + } + function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + var pos = getNodePos(); + var kind = token(); + if (token() === 85 && permitInvalidConstAsModifier) { + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + return void 0; + } + } else if (stopOnStartOfClassStaticBlock && token() === 124 && lookAhead(nextTokenIsOpenBrace)) { + return void 0; + } else if (hasSeenStaticModifier && token() === 124) { + return void 0; + } else { + if (!parseAnyContextualModifier()) { + return void 0; + } + } + return finishNode(factory.createToken(kind), pos); + } + function combineDecoratorsAndModifiers(decorators, modifiers) { + if (!decorators) + return modifiers; + if (!modifiers) + return decorators; + var decoratorsAndModifiers = factory.createNodeArray(ts2.concatenate(decorators, modifiers)); + ts2.setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); + return decoratorsAndModifiers; + } + function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) { + var pos = getNodePos(); + var list, modifier, hasSeenStatic = false; + while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { + if (modifier.kind === 124) + hasSeenStatic = true; + list = ts2.append(list, modifier); + } + return list && createNodeArray(list, pos); + } + function parseModifiersForArrowFunction() { + var modifiers; + if (token() === 132) { + var pos = getNodePos(); + nextToken(); + var modifier = finishNode(factory.createToken( + 132 + /* SyntaxKind.AsyncKeyword */ + ), pos); + modifiers = createNodeArray([modifier], pos); + } + return modifiers; + } + function parseClassElement() { + var pos = getNodePos(); + if (token() === 26) { + nextToken(); + return finishNode(factory.createSemicolonClassElement(), pos); + } + var hasJSDoc = hasPrecedingJSDocComment(); + var decorators = parseDecorators(); + var modifiers = parseModifiers( + /*permitInvalidConstAsModifier*/ + true, + /*stopOnStartOfClassStaticBlock*/ + true + ); + if (token() === 124 && lookAhead(nextTokenIsOpenBrace)) { + return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); + } + if (parseContextualModifier( + 137 + /* SyntaxKind.GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + 174, + 0 + /* SignatureFlags.None */ + ); + } + if (parseContextualModifier( + 151 + /* SyntaxKind.SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + 175, + 0 + /* SignatureFlags.None */ + ); + } + if (token() === 135 || token() === 10) { + var constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); + if (constructorDeclaration) { + return constructorDeclaration; + } + } + if (isIndexSignature()) { + return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); + } + if (ts2.tokenIsIdentifierOrKeyword(token()) || token() === 10 || token() === 8 || token() === 41 || token() === 22) { + var isAmbient = ts2.some(modifiers, isDeclareModifier); + if (isAmbient) { + for (var _i = 0, _a3 = modifiers; _i < _a3.length; _i++) { + var m7 = _a3[_i]; + m7.flags |= 16777216; + } + return doInsideOfContext(16777216, function() { + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + }); + } else { + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); + } + } + if (decorators || modifiers) { + var name2 = createMissingNode( + 79, + /*reportAtCurrentPosition*/ + true, + ts2.Diagnostics.Declaration_expected + ); + return parsePropertyDeclaration( + pos, + hasJSDoc, + decorators, + modifiers, + name2, + /*questionToken*/ + void 0 + ); + } + return ts2.Debug.fail("Should not have attempted to parse class member declaration."); + } + function parseClassExpression() { + return parseClassDeclarationOrExpression( + getNodePos(), + hasPrecedingJSDocComment(), + /*decorators*/ + void 0, + /*modifiers*/ + void 0, + 228 + /* SyntaxKind.ClassExpression */ + ); + } + function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { + return parseClassDeclarationOrExpression( + pos, + hasJSDoc, + decorators, + modifiers, + 260 + /* SyntaxKind.ClassDeclaration */ + ); + } + function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { + var savedAwaitContext = inAwaitContext(); + parseExpected( + 84 + /* SyntaxKind.ClassKeyword */ + ); + var name2 = parseNameOfClassDeclarationOrExpression(); + var typeParameters = parseTypeParameters(); + if (ts2.some(modifiers, ts2.isExportModifier)) + setAwaitContext( + /*value*/ + true + ); + var heritageClauses = parseHeritageClauses(); + var members; + if (parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + members = parseClassMembers(); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + setAwaitContext(savedAwaitContext); + var node = kind === 260 ? factory.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name2, typeParameters, heritageClauses, members) : factory.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name2, typeParameters, heritageClauses, members); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseNameOfClassDeclarationOrExpression() { + return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; + } + function isImplementsClause() { + return token() === 117 && lookAhead(nextTokenIsIdentifierOrKeyword); + } + function parseHeritageClauses() { + if (isHeritageClause()) { + return parseList(22, parseHeritageClause); + } + return void 0; + } + function parseHeritageClause() { + var pos = getNodePos(); + var tok = token(); + ts2.Debug.assert( + tok === 94 || tok === 117 + /* SyntaxKind.ImplementsKeyword */ + ); + nextToken(); + var types3 = parseDelimitedList(7, parseExpressionWithTypeArguments); + return finishNode(factory.createHeritageClause(tok, types3), pos); + } + function parseExpressionWithTypeArguments() { + var pos = getNodePos(); + var expression = parseLeftHandSideExpressionOrHigher(); + if (expression.kind === 230) { + return expression; + } + var typeArguments = tryParseTypeArguments(); + return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos); + } + function tryParseTypeArguments() { + return token() === 29 ? parseBracketedList( + 20, + parseType, + 29, + 31 + /* SyntaxKind.GreaterThanToken */ + ) : void 0; + } + function isHeritageClause() { + return token() === 94 || token() === 117; + } + function parseClassMembers() { + return parseList(5, parseClassElement); + } + function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpected( + 118 + /* SyntaxKind.InterfaceKeyword */ + ); + var name2 = parseIdentifier(); + var typeParameters = parseTypeParameters(); + var heritageClauses = parseHeritageClauses(); + var members = parseObjectTypeMembers(); + var node = factory.createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpected( + 154 + /* SyntaxKind.TypeKeyword */ + ); + var name2 = parseIdentifier(); + var typeParameters = parseTypeParameters(); + parseExpected( + 63 + /* SyntaxKind.EqualsToken */ + ); + var type3 = token() === 139 && tryParse(parseKeywordAndNoDot) || parseType(); + parseSemicolon(); + var node = factory.createTypeAliasDeclaration(modifiers, name2, typeParameters, type3); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseEnumMember() { + var pos = getNodePos(); + var hasJSDoc = hasPrecedingJSDocComment(); + var name2 = parsePropertyName(); + var initializer = allowInAnd(parseInitializer); + return withJSDoc(finishNode(factory.createEnumMember(name2, initializer), pos), hasJSDoc); + } + function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpected( + 92 + /* SyntaxKind.EnumKeyword */ + ); + var name2 = parseIdentifier(); + var members; + if (parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + members = doOutsideOfYieldAndAwaitContext(function() { + return parseDelimitedList(6, parseEnumMember); + }); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + var node = factory.createEnumDeclaration(modifiers, name2, members); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseModuleBlock() { + var pos = getNodePos(); + var statements; + if (parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + statements = parseList(1, parseStatement); + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } else { + statements = createMissingList(); + } + return finishNode(factory.createModuleBlock(statements), pos); + } + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { + var namespaceFlag = flags & 16; + var name2 = parseIdentifier(); + var body = parseOptional( + 24 + /* SyntaxKind.DotToken */ + ) ? parseModuleOrNamespaceDeclaration( + getNodePos(), + /*hasJSDoc*/ + false, + /*decorators*/ + void 0, + /*modifiers*/ + void 0, + 4 | namespaceFlag + ) : parseModuleBlock(); + var node = factory.createModuleDeclaration(modifiers, name2, body, flags); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + var flags = 0; + var name2; + if (token() === 159) { + name2 = parseIdentifier(); + flags |= 1024; + } else { + name2 = parseLiteralNode(); + name2.text = internIdentifier(name2.text); + } + var body; + if (token() === 18) { + body = parseModuleBlock(); + } else { + parseSemicolon(); + } + var node = factory.createModuleDeclaration(modifiers, name2, body, flags); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { + var flags = 0; + if (token() === 159) { + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + } else if (parseOptional( + 143 + /* SyntaxKind.NamespaceKeyword */ + )) { + flags |= 16; + } else { + parseExpected( + 142 + /* SyntaxKind.ModuleKeyword */ + ); + if (token() === 10) { + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); + } + } + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); + } + function isExternalModuleReference() { + return token() === 147 && lookAhead(nextTokenIsOpenParen); + } + function nextTokenIsOpenParen() { + return nextToken() === 20; + } + function nextTokenIsOpenBrace() { + return nextToken() === 18; + } + function nextTokenIsSlash() { + return nextToken() === 43; + } + function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpected( + 128 + /* SyntaxKind.AsKeyword */ + ); + parseExpected( + 143 + /* SyntaxKind.NamespaceKeyword */ + ); + var name2 = parseIdentifier(); + parseSemicolon(); + var node = factory.createNamespaceExportDeclaration(name2); + node.illegalDecorators = decorators; + node.modifiers = modifiers; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { + parseExpected( + 100 + /* SyntaxKind.ImportKeyword */ + ); + var afterImportPos = scanner.getStartPos(); + var identifier; + if (isIdentifier()) { + identifier = parseIdentifier(); + } + var isTypeOnly = false; + if (token() !== 158 && (identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) === "type" && (isIdentifier() || tokenAfterImportDefinitelyProducesImportDeclaration())) { + isTypeOnly = true; + identifier = isIdentifier() ? parseIdentifier() : void 0; + } + if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { + return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); + } + var importClause; + if (identifier || // import id + token() === 41 || // import * + token() === 18) { + importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); + parseExpected( + 158 + /* SyntaxKind.FromKeyword */ + ); + } + var moduleSpecifier = parseModuleSpecifier(); + var assertClause; + if (token() === 130 && !scanner.hasPrecedingLineBreak()) { + assertClause = parseAssertClause(); + } + parseSemicolon(); + var node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseAssertEntry() { + var pos = getNodePos(); + var name2 = ts2.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode( + 10 + /* SyntaxKind.StringLiteral */ + ); + parseExpected( + 58 + /* SyntaxKind.ColonToken */ + ); + var value2 = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return finishNode(factory.createAssertEntry(name2, value2), pos); + } + function parseAssertClause(skipAssertKeyword) { + var pos = getNodePos(); + if (!skipAssertKeyword) { + parseExpected( + 130 + /* SyntaxKind.AssertKeyword */ + ); + } + var openBracePosition = scanner.getTokenPos(); + if (parseExpected( + 18 + /* SyntaxKind.OpenBraceToken */ + )) { + var multiLine = scanner.hasPrecedingLineBreak(); + var elements = parseDelimitedList( + 24, + parseAssertEntry, + /*considerSemicolonAsDelimiter*/ + true + ); + if (!parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + )) { + var lastError = ts2.lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === ts2.Diagnostics._0_expected.code) { + ts2.addRelatedInfo(lastError, ts2.createDetachedDiagnostic(fileName, openBracePosition, 1, ts2.Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")); + } + } + return finishNode(factory.createAssertClause(elements, multiLine), pos); + } else { + var elements = createNodeArray( + [], + getNodePos(), + /*end*/ + void 0, + /*hasTrailingComma*/ + false + ); + return finishNode(factory.createAssertClause( + elements, + /*multiLine*/ + false + ), pos); + } + } + function tokenAfterImportDefinitelyProducesImportDeclaration() { + return token() === 41 || token() === 18; + } + function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { + return token() === 27 || token() === 158; + } + function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { + parseExpected( + 63 + /* SyntaxKind.EqualsToken */ + ); + var moduleReference = parseModuleReference(); + parseSemicolon(); + var node = factory.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); + node.illegalDecorators = decorators; + var finished2 = withJSDoc(finishNode(node, pos), hasJSDoc); + return finished2; + } + function parseImportClause(identifier, pos, isTypeOnly) { + var namedBindings; + if (!identifier || parseOptional( + 27 + /* SyntaxKind.CommaToken */ + )) { + namedBindings = token() === 41 ? parseNamespaceImport() : parseNamedImportsOrExports( + 272 + /* SyntaxKind.NamedImports */ + ); + } + return finishNode(factory.createImportClause(isTypeOnly, identifier, namedBindings), pos); + } + function parseModuleReference() { + return isExternalModuleReference() ? parseExternalModuleReference() : parseEntityName( + /*allowReservedWords*/ + false + ); + } + function parseExternalModuleReference() { + var pos = getNodePos(); + parseExpected( + 147 + /* SyntaxKind.RequireKeyword */ + ); + parseExpected( + 20 + /* SyntaxKind.OpenParenToken */ + ); + var expression = parseModuleSpecifier(); + parseExpected( + 21 + /* SyntaxKind.CloseParenToken */ + ); + return finishNode(factory.createExternalModuleReference(expression), pos); + } + function parseModuleSpecifier() { + if (token() === 10) { + var result2 = parseLiteralNode(); + result2.text = internIdentifier(result2.text); + return result2; + } else { + return parseExpression(); + } + } + function parseNamespaceImport() { + var pos = getNodePos(); + parseExpected( + 41 + /* SyntaxKind.AsteriskToken */ + ); + parseExpected( + 128 + /* SyntaxKind.AsKeyword */ + ); + var name2 = parseIdentifier(); + return finishNode(factory.createNamespaceImport(name2), pos); + } + function parseNamedImportsOrExports(kind) { + var pos = getNodePos(); + var node = kind === 272 ? factory.createNamedImports(parseBracketedList( + 23, + parseImportSpecifier, + 18, + 19 + /* SyntaxKind.CloseBraceToken */ + )) : factory.createNamedExports(parseBracketedList( + 23, + parseExportSpecifier, + 18, + 19 + /* SyntaxKind.CloseBraceToken */ + )); + return finishNode(node, pos); + } + function parseExportSpecifier() { + var hasJSDoc = hasPrecedingJSDocComment(); + return withJSDoc(parseImportOrExportSpecifier( + 278 + /* SyntaxKind.ExportSpecifier */ + ), hasJSDoc); + } + function parseImportSpecifier() { + return parseImportOrExportSpecifier( + 273 + /* SyntaxKind.ImportSpecifier */ + ); + } + function parseImportOrExportSpecifier(kind) { + var pos = getNodePos(); + var checkIdentifierIsKeyword = ts2.isKeyword(token()) && !isIdentifier(); + var checkIdentifierStart = scanner.getTokenPos(); + var checkIdentifierEnd = scanner.getTextPos(); + var isTypeOnly = false; + var propertyName; + var canParseAsKeyword = true; + var name2 = parseIdentifierName(); + if (name2.escapedText === "type") { + if (token() === 128) { + var firstAs = parseIdentifierName(); + if (token() === 128) { + var secondAs = parseIdentifierName(); + if (ts2.tokenIsIdentifierOrKeyword(token())) { + isTypeOnly = true; + propertyName = firstAs; + name2 = parseNameWithKeywordCheck(); + canParseAsKeyword = false; + } else { + propertyName = name2; + name2 = secondAs; + canParseAsKeyword = false; + } + } else if (ts2.tokenIsIdentifierOrKeyword(token())) { + propertyName = name2; + canParseAsKeyword = false; + name2 = parseNameWithKeywordCheck(); + } else { + isTypeOnly = true; + name2 = firstAs; + } + } else if (ts2.tokenIsIdentifierOrKeyword(token())) { + isTypeOnly = true; + name2 = parseNameWithKeywordCheck(); + } + } + if (canParseAsKeyword && token() === 128) { + propertyName = name2; + parseExpected( + 128 + /* SyntaxKind.AsKeyword */ + ); + name2 = parseNameWithKeywordCheck(); + } + if (kind === 273 && checkIdentifierIsKeyword) { + parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts2.Diagnostics.Identifier_expected); + } + var node = kind === 273 ? factory.createImportSpecifier(isTypeOnly, propertyName, name2) : factory.createExportSpecifier(isTypeOnly, propertyName, name2); + return finishNode(node, pos); + function parseNameWithKeywordCheck() { + checkIdentifierIsKeyword = ts2.isKeyword(token()) && !isIdentifier(); + checkIdentifierStart = scanner.getTokenPos(); + checkIdentifierEnd = scanner.getTextPos(); + return parseIdentifierName(); + } + } + function parseNamespaceExport(pos) { + return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos); + } + function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { + var savedAwaitContext = inAwaitContext(); + setAwaitContext( + /*value*/ + true + ); + var exportClause; + var moduleSpecifier; + var assertClause; + var isTypeOnly = parseOptional( + 154 + /* SyntaxKind.TypeKeyword */ + ); + var namespaceExportPos = getNodePos(); + if (parseOptional( + 41 + /* SyntaxKind.AsteriskToken */ + )) { + if (parseOptional( + 128 + /* SyntaxKind.AsKeyword */ + )) { + exportClause = parseNamespaceExport(namespaceExportPos); + } + parseExpected( + 158 + /* SyntaxKind.FromKeyword */ + ); + moduleSpecifier = parseModuleSpecifier(); + } else { + exportClause = parseNamedImportsOrExports( + 276 + /* SyntaxKind.NamedExports */ + ); + if (token() === 158 || token() === 10 && !scanner.hasPrecedingLineBreak()) { + parseExpected( + 158 + /* SyntaxKind.FromKeyword */ + ); + moduleSpecifier = parseModuleSpecifier(); + } + } + if (moduleSpecifier && token() === 130 && !scanner.hasPrecedingLineBreak()) { + assertClause = parseAssertClause(); + } + parseSemicolon(); + setAwaitContext(savedAwaitContext); + var node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { + var savedAwaitContext = inAwaitContext(); + setAwaitContext( + /*value*/ + true + ); + var isExportEquals; + if (parseOptional( + 63 + /* SyntaxKind.EqualsToken */ + )) { + isExportEquals = true; + } else { + parseExpected( + 88 + /* SyntaxKind.DefaultKeyword */ + ); + } + var expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + parseSemicolon(); + setAwaitContext(savedAwaitContext); + var node = factory.createExportAssignment(modifiers, isExportEquals, expression); + node.illegalDecorators = decorators; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + var ParsingContext; + (function(ParsingContext2) { + ParsingContext2[ParsingContext2["SourceElements"] = 0] = "SourceElements"; + ParsingContext2[ParsingContext2["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext2[ParsingContext2["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext2[ParsingContext2["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext2[ParsingContext2["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext2[ParsingContext2["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext2[ParsingContext2["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext2[ParsingContext2["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext2[ParsingContext2["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext2[ParsingContext2["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext2[ParsingContext2["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext2[ParsingContext2["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext2[ParsingContext2["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext2[ParsingContext2["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext2[ParsingContext2["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext2[ParsingContext2["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext2[ParsingContext2["Parameters"] = 16] = "Parameters"; + ParsingContext2[ParsingContext2["JSDocParameters"] = 17] = "JSDocParameters"; + ParsingContext2[ParsingContext2["RestProperties"] = 18] = "RestProperties"; + ParsingContext2[ParsingContext2["TypeParameters"] = 19] = "TypeParameters"; + ParsingContext2[ParsingContext2["TypeArguments"] = 20] = "TypeArguments"; + ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes"; + ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses"; + ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers"; + ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries"; + ParsingContext2[ParsingContext2["Count"] = 25] = "Count"; + })(ParsingContext || (ParsingContext = {})); + var Tristate; + (function(Tristate2) { + Tristate2[Tristate2["False"] = 0] = "False"; + Tristate2[Tristate2["True"] = 1] = "True"; + Tristate2[Tristate2["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); + var JSDocParser; + (function(JSDocParser2) { + function parseJSDocTypeExpressionForTests2(content, start, length) { + initializeState( + "file.js", + content, + 99, + /*_syntaxCursor:*/ + void 0, + 1 + /* ScriptKind.JS */ + ); + scanner.setText(content, start, length); + currentToken = scanner.scan(); + var jsDocTypeExpression = parseJSDocTypeExpression(); + var sourceFile = createSourceFile2( + "file.js", + 99, + 1, + /*isDeclarationFile*/ + false, + [], + factory.createToken( + 1 + /* SyntaxKind.EndOfFileToken */ + ), + 0, + ts2.noop + ); + var diagnostics = ts2.attachFileToDiagnostics(parseDiagnostics, sourceFile); + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = ts2.attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + clearState(); + return jsDocTypeExpression ? { jsDocTypeExpression, diagnostics } : void 0; + } + JSDocParser2.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests2; + function parseJSDocTypeExpression(mayOmitBraces) { + var pos = getNodePos(); + var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var type3 = doInsideOfContext(8388608, parseJSDocType); + if (!mayOmitBraces || hasBrace) { + parseExpectedJSDoc( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } + var result2 = factory.createJSDocTypeExpression(type3); + fixupParentReferences(result2); + return finishNode(result2, pos); + } + JSDocParser2.parseJSDocTypeExpression = parseJSDocTypeExpression; + function parseJSDocNameReference() { + var pos = getNodePos(); + var hasBrace = parseOptional( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var p22 = getNodePos(); + var entityName = parseEntityName( + /* allowReservedWords*/ + false + ); + while (token() === 80) { + reScanHashToken(); + nextTokenJSDoc(); + entityName = finishNode(factory.createJSDocMemberName(entityName, parseIdentifier()), p22); + } + if (hasBrace) { + parseExpectedJSDoc( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } + var result2 = factory.createJSDocNameReference(entityName); + fixupParentReferences(result2); + return finishNode(result2, pos); + } + JSDocParser2.parseJSDocNameReference = parseJSDocNameReference; + function parseIsolatedJSDocComment2(content, start, length) { + initializeState( + "", + content, + 99, + /*_syntaxCursor:*/ + void 0, + 1 + /* ScriptKind.JS */ + ); + var jsDoc = doInsideOfContext(8388608, function() { + return parseJSDocCommentWorker(start, length); + }); + var sourceFile = { languageVariant: 0, text: content }; + var diagnostics = ts2.attachFileToDiagnostics(parseDiagnostics, sourceFile); + clearState(); + return jsDoc ? { jsDoc, diagnostics } : void 0; + } + JSDocParser2.parseIsolatedJSDocComment = parseIsolatedJSDocComment2; + function parseJSDocComment(parent2, start, length) { + var saveToken = currentToken; + var saveParseDiagnosticsLength = parseDiagnostics.length; + var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + var comment = doInsideOfContext(8388608, function() { + return parseJSDocCommentWorker(start, length); + }); + ts2.setParent(comment, parent2); + if (contextFlags & 262144) { + if (!jsDocDiagnostics) { + jsDocDiagnostics = []; + } + jsDocDiagnostics.push.apply(jsDocDiagnostics, parseDiagnostics); + } + currentToken = saveToken; + parseDiagnostics.length = saveParseDiagnosticsLength; + parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; + return comment; + } + JSDocParser2.parseJSDocComment = parseJSDocComment; + var JSDocState; + (function(JSDocState2) { + JSDocState2[JSDocState2["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState2[JSDocState2["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState2[JSDocState2["SavingComments"] = 2] = "SavingComments"; + JSDocState2[JSDocState2["SavingBackticks"] = 3] = "SavingBackticks"; + })(JSDocState || (JSDocState = {})); + var PropertyLikeParse; + (function(PropertyLikeParse2) { + PropertyLikeParse2[PropertyLikeParse2["Property"] = 1] = "Property"; + PropertyLikeParse2[PropertyLikeParse2["Parameter"] = 2] = "Parameter"; + PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter"; + })(PropertyLikeParse || (PropertyLikeParse = {})); + function parseJSDocCommentWorker(start, length) { + if (start === void 0) { + start = 0; + } + var content = sourceText; + var end = length === void 0 ? content.length : start + length; + length = end - start; + ts2.Debug.assert(start >= 0); + ts2.Debug.assert(start <= end); + ts2.Debug.assert(end <= content.length); + if (!isJSDocLikeText(content, start)) { + return void 0; + } + var tags6; + var tagsPos; + var tagsEnd; + var linkEnd; + var commentsPos; + var comments = []; + var parts = []; + return scanner.scanRange(start + 3, length - 5, function() { + var state = 1; + var margin; + var indent = start - (content.lastIndexOf("\n", start) + 1) + 4; + function pushComment(text) { + if (!margin) { + margin = indent; + } + comments.push(text); + indent += text.length; + } + nextTokenJSDoc(); + while (parseOptionalJsdoc( + 5 + /* SyntaxKind.WhitespaceTrivia */ + )) + ; + if (parseOptionalJsdoc( + 4 + /* SyntaxKind.NewLineTrivia */ + )) { + state = 0; + indent = 0; + } + loop: + while (true) { + switch (token()) { + case 59: + if (state === 0 || state === 1) { + removeTrailingWhitespace(comments); + if (!commentsPos) + commentsPos = getNodePos(); + addTag(parseTag(indent)); + state = 0; + margin = void 0; + } else { + pushComment(scanner.getTokenText()); + } + break; + case 4: + comments.push(scanner.getTokenText()); + state = 0; + indent = 0; + break; + case 41: + var asterisk = scanner.getTokenText(); + if (state === 1 || state === 2) { + state = 2; + pushComment(asterisk); + } else { + state = 1; + indent += asterisk.length; + } + break; + case 5: + var whitespace = scanner.getTokenText(); + if (state === 2) { + comments.push(whitespace); + } else if (margin !== void 0 && indent + whitespace.length > margin) { + comments.push(whitespace.slice(margin - indent)); + } + indent += whitespace.length; + break; + case 1: + break loop; + case 18: + state = 2; + var commentEnd = scanner.getStartPos(); + var linkStart = scanner.getTextPos() - 1; + var link2 = parseJSDocLink(linkStart); + if (link2) { + if (!linkEnd) { + removeLeadingNewlines(comments); + } + parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : start, commentEnd)); + parts.push(link2); + comments = []; + linkEnd = scanner.getTextPos(); + break; + } + default: + state = 2; + pushComment(scanner.getTokenText()); + break; + } + nextTokenJSDoc(); + } + removeTrailingWhitespace(comments); + if (parts.length && comments.length) { + parts.push(finishNode(factory.createJSDocText(comments.join("")), linkEnd !== null && linkEnd !== void 0 ? linkEnd : start, commentsPos)); + } + if (parts.length && tags6) + ts2.Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); + var tagsArray = tags6 && createNodeArray(tags6, tagsPos, tagsEnd); + return finishNode(factory.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); + }); + function removeLeadingNewlines(comments2) { + while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { + comments2.shift(); + } + } + function removeTrailingWhitespace(comments2) { + while (comments2.length && comments2[comments2.length - 1].trim() === "") { + comments2.pop(); + } + } + function isNextNonwhitespaceTokenEndOfFile() { + while (true) { + nextTokenJSDoc(); + if (token() === 1) { + return true; + } + if (!(token() === 5 || token() === 4)) { + return false; + } + } + } + function skipWhitespace2() { + if (token() === 5 || token() === 4) { + if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { + return; + } + } + while (token() === 5 || token() === 4) { + nextTokenJSDoc(); + } + } + function skipWhitespaceOrAsterisk() { + if (token() === 5 || token() === 4) { + if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { + return ""; + } + } + var precedingLineBreak = scanner.hasPrecedingLineBreak(); + var seenLineBreak = false; + var indentText = ""; + while (precedingLineBreak && token() === 41 || token() === 5 || token() === 4) { + indentText += scanner.getTokenText(); + if (token() === 4) { + precedingLineBreak = true; + seenLineBreak = true; + indentText = ""; + } else if (token() === 41) { + precedingLineBreak = false; + } + nextTokenJSDoc(); + } + return seenLineBreak ? indentText : ""; + } + function parseTag(margin) { + ts2.Debug.assert( + token() === 59 + /* SyntaxKind.AtToken */ + ); + var start2 = scanner.getTokenPos(); + nextTokenJSDoc(); + var tagName = parseJSDocIdentifierName( + /*message*/ + void 0 + ); + var indentText = skipWhitespaceOrAsterisk(); + var tag; + switch (tagName.escapedText) { + case "author": + tag = parseAuthorTag(start2, tagName, margin, indentText); + break; + case "implements": + tag = parseImplementsTag(start2, tagName, margin, indentText); + break; + case "augments": + case "extends": + tag = parseAugmentsTag(start2, tagName, margin, indentText); + break; + case "class": + case "constructor": + tag = parseSimpleTag(start2, factory.createJSDocClassTag, tagName, margin, indentText); + break; + case "public": + tag = parseSimpleTag(start2, factory.createJSDocPublicTag, tagName, margin, indentText); + break; + case "private": + tag = parseSimpleTag(start2, factory.createJSDocPrivateTag, tagName, margin, indentText); + break; + case "protected": + tag = parseSimpleTag(start2, factory.createJSDocProtectedTag, tagName, margin, indentText); + break; + case "readonly": + tag = parseSimpleTag(start2, factory.createJSDocReadonlyTag, tagName, margin, indentText); + break; + case "override": + tag = parseSimpleTag(start2, factory.createJSDocOverrideTag, tagName, margin, indentText); + break; + case "deprecated": + hasDeprecatedTag = true; + tag = parseSimpleTag(start2, factory.createJSDocDeprecatedTag, tagName, margin, indentText); + break; + case "this": + tag = parseThisTag(start2, tagName, margin, indentText); + break; + case "enum": + tag = parseEnumTag(start2, tagName, margin, indentText); + break; + case "arg": + case "argument": + case "param": + return parseParameterOrPropertyTag(start2, tagName, 2, margin); + case "return": + case "returns": + tag = parseReturnTag(start2, tagName, margin, indentText); + break; + case "template": + tag = parseTemplateTag(start2, tagName, margin, indentText); + break; + case "type": + tag = parseTypeTag(start2, tagName, margin, indentText); + break; + case "typedef": + tag = parseTypedefTag(start2, tagName, margin, indentText); + break; + case "callback": + tag = parseCallbackTag(start2, tagName, margin, indentText); + break; + case "see": + tag = parseSeeTag(start2, tagName, margin, indentText); + break; + default: + tag = parseUnknownTag(start2, tagName, margin, indentText); + break; + } + return tag; + } + function parseTrailingTagComments(pos, end2, margin, indentText) { + if (!indentText) { + margin += end2 - pos; + } + return parseTagComments(margin, indentText.slice(margin)); + } + function parseTagComments(indent, initialMargin) { + var commentsPos2 = getNodePos(); + var comments2 = []; + var parts2 = []; + var linkEnd2; + var state = 0; + var previousWhitespace = true; + var margin; + function pushComment(text) { + if (!margin) { + margin = indent; + } + comments2.push(text); + indent += text.length; + } + if (initialMargin !== void 0) { + if (initialMargin !== "") { + pushComment(initialMargin); + } + state = 1; + } + var tok = token(); + loop: + while (true) { + switch (tok) { + case 4: + state = 0; + comments2.push(scanner.getTokenText()); + indent = 0; + break; + case 59: + if (state === 3 || state === 2 && (!previousWhitespace || lookAhead(isNextJSDocTokenWhitespace))) { + comments2.push(scanner.getTokenText()); + break; + } + scanner.setTextPos(scanner.getTextPos() - 1); + case 1: + break loop; + case 5: + if (state === 2 || state === 3) { + pushComment(scanner.getTokenText()); + } else { + var whitespace = scanner.getTokenText(); + if (margin !== void 0 && indent + whitespace.length > margin) { + comments2.push(whitespace.slice(margin - indent)); + } + indent += whitespace.length; + } + break; + case 18: + state = 2; + var commentEnd = scanner.getStartPos(); + var linkStart = scanner.getTextPos() - 1; + var link2 = parseJSDocLink(linkStart); + if (link2) { + parts2.push(finishNode(factory.createJSDocText(comments2.join("")), linkEnd2 !== null && linkEnd2 !== void 0 ? linkEnd2 : commentsPos2, commentEnd)); + parts2.push(link2); + comments2 = []; + linkEnd2 = scanner.getTextPos(); + } else { + pushComment(scanner.getTokenText()); + } + break; + case 61: + if (state === 3) { + state = 2; + } else { + state = 3; + } + pushComment(scanner.getTokenText()); + break; + case 41: + if (state === 0) { + state = 1; + indent += 1; + break; + } + default: + if (state !== 3) { + state = 2; + } + pushComment(scanner.getTokenText()); + break; + } + previousWhitespace = token() === 5; + tok = nextTokenJSDoc(); + } + removeLeadingNewlines(comments2); + removeTrailingWhitespace(comments2); + if (parts2.length) { + if (comments2.length) { + parts2.push(finishNode(factory.createJSDocText(comments2.join("")), linkEnd2 !== null && linkEnd2 !== void 0 ? linkEnd2 : commentsPos2)); + } + return createNodeArray(parts2, commentsPos2, scanner.getTextPos()); + } else if (comments2.length) { + return comments2.join(""); + } + } + function isNextJSDocTokenWhitespace() { + var next = nextTokenJSDoc(); + return next === 5 || next === 4; + } + function parseJSDocLink(start2) { + var linkType = tryParse(parseJSDocLinkPrefix); + if (!linkType) { + return void 0; + } + nextTokenJSDoc(); + skipWhitespace2(); + var p22 = getNodePos(); + var name2 = ts2.tokenIsIdentifierOrKeyword(token()) ? parseEntityName( + /*allowReservedWords*/ + true + ) : void 0; + if (name2) { + while (token() === 80) { + reScanHashToken(); + nextTokenJSDoc(); + name2 = finishNode(factory.createJSDocMemberName(name2, parseIdentifier()), p22); + } + } + var text = []; + while (token() !== 19 && token() !== 4 && token() !== 1) { + text.push(scanner.getTokenText()); + nextTokenJSDoc(); + } + var create2 = linkType === "link" ? factory.createJSDocLink : linkType === "linkcode" ? factory.createJSDocLinkCode : factory.createJSDocLinkPlain; + return finishNode(create2(name2, text.join("")), start2, scanner.getTextPos()); + } + function parseJSDocLinkPrefix() { + skipWhitespaceOrAsterisk(); + if (token() === 18 && nextTokenJSDoc() === 59 && ts2.tokenIsIdentifierOrKeyword(nextTokenJSDoc())) { + var kind = scanner.getTokenValue(); + if (isJSDocLinkTag(kind)) + return kind; + } + } + function isJSDocLinkTag(kind) { + return kind === "link" || kind === "linkcode" || kind === "linkplain"; + } + function parseUnknownTag(start2, tagName, indent, indentText) { + return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2); + } + function addTag(tag) { + if (!tag) { + return; + } + if (!tags6) { + tags6 = [tag]; + tagsPos = tag.pos; + } else { + tags6.push(tag); + } + tagsEnd = tag.end; + } + function tryParseTypeExpression() { + skipWhitespaceOrAsterisk(); + return token() === 18 ? parseJSDocTypeExpression() : void 0; + } + function parseBracketNameInPropertyAndParamTag() { + var isBracketed = parseOptionalJsdoc( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + if (isBracketed) { + skipWhitespace2(); + } + var isBackquoted = parseOptionalJsdoc( + 61 + /* SyntaxKind.BacktickToken */ + ); + var name2 = parseJSDocEntityName(); + if (isBackquoted) { + parseExpectedTokenJSDoc( + 61 + /* SyntaxKind.BacktickToken */ + ); + } + if (isBracketed) { + skipWhitespace2(); + if (parseOptionalToken( + 63 + /* SyntaxKind.EqualsToken */ + )) { + parseExpression(); + } + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + } + return { name: name2, isBracketed }; + } + function isObjectOrObjectArrayTypeReference(node) { + switch (node.kind) { + case 149: + return true; + case 185: + return isObjectOrObjectArrayTypeReference(node.elementType); + default: + return ts2.isTypeReferenceNode(node) && ts2.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; + } + } + function parseParameterOrPropertyTag(start2, tagName, target, indent) { + var typeExpression = tryParseTypeExpression(); + var isNameFirst = !typeExpression; + skipWhitespaceOrAsterisk(); + var _a3 = parseBracketNameInPropertyAndParamTag(), name2 = _a3.name, isBracketed = _a3.isBracketed; + var indentText = skipWhitespaceOrAsterisk(); + if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) { + typeExpression = tryParseTypeExpression(); + } + var comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText); + var nestedTypeLiteral = target !== 4 && parseNestedTypeLiteral(typeExpression, name2, target, indent); + if (nestedTypeLiteral) { + typeExpression = nestedTypeLiteral; + isNameFirst = true; + } + var result2 = target === 1 ? factory.createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) : factory.createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment); + return finishNode(result2, start2); + } + function parseNestedTypeLiteral(typeExpression, name2, target, indent) { + if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { + var pos = getNodePos(); + var child = void 0; + var children = void 0; + while (child = tryParse(function() { + return parseChildParameterOrPropertyTag(target, indent, name2); + })) { + if (child.kind === 343 || child.kind === 350) { + children = ts2.append(children, child); + } + } + if (children) { + var literal = finishNode(factory.createJSDocTypeLiteral( + children, + typeExpression.type.kind === 185 + /* SyntaxKind.ArrayType */ + ), pos); + return finishNode(factory.createJSDocTypeExpression(literal), pos); + } + } + } + function parseReturnTag(start2, tagName, indent, indentText) { + if (ts2.some(tags6, ts2.isJSDocReturnTag)) { + parseErrorAt(tagName.pos, scanner.getTokenPos(), ts2.Diagnostics._0_tag_already_specified, tagName.escapedText); + } + var typeExpression = tryParseTypeExpression(); + return finishNode(factory.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2); + } + function parseTypeTag(start2, tagName, indent, indentText) { + if (ts2.some(tags6, ts2.isJSDocTypeTag)) { + parseErrorAt(tagName.pos, scanner.getTokenPos(), ts2.Diagnostics._0_tag_already_specified, tagName.escapedText); + } + var typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + var comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0; + return finishNode(factory.createJSDocTypeTag(tagName, typeExpression, comments2), start2); + } + function parseSeeTag(start2, tagName, indent, indentText) { + var isMarkdownOrJSDocLink = token() === 22 || lookAhead(function() { + return nextTokenJSDoc() === 59 && ts2.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()); + }); + var nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference(); + var comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0; + return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments2), start2); + } + function parseAuthorTag(start2, tagName, indent, indentText) { + var commentStart = getNodePos(); + var textOnly = parseAuthorNameAndEmail(); + var commentEnd = scanner.getStartPos(); + var comments2 = parseTrailingTagComments(start2, commentEnd, indent, indentText); + if (!comments2) { + commentEnd = scanner.getStartPos(); + } + var allParts = typeof comments2 !== "string" ? createNodeArray(ts2.concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; + return finishNode(factory.createJSDocAuthorTag(tagName, allParts), start2); + } + function parseAuthorNameAndEmail() { + var comments2 = []; + var inEmail = false; + var token2 = scanner.getToken(); + while (token2 !== 1 && token2 !== 4) { + if (token2 === 29) { + inEmail = true; + } else if (token2 === 59 && !inEmail) { + break; + } else if (token2 === 31 && inEmail) { + comments2.push(scanner.getTokenText()); + scanner.setTextPos(scanner.getTokenPos() + 1); + break; + } + comments2.push(scanner.getTokenText()); + token2 = nextTokenJSDoc(); + } + return factory.createJSDocText(comments2.join("")); + } + function parseImplementsTag(start2, tagName, margin, indentText) { + var className = parseExpressionWithTypeArgumentsForAugments(); + return finishNode(factory.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseAugmentsTag(start2, tagName, margin, indentText) { + var className = parseExpressionWithTypeArgumentsForAugments(); + return finishNode(factory.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseExpressionWithTypeArgumentsForAugments() { + var usedBrace = parseOptional( + 18 + /* SyntaxKind.OpenBraceToken */ + ); + var pos = getNodePos(); + var expression = parsePropertyAccessEntityNameExpression(); + var typeArguments = tryParseTypeArguments(); + var node = factory.createExpressionWithTypeArguments(expression, typeArguments); + var res = finishNode(node, pos); + if (usedBrace) { + parseExpected( + 19 + /* SyntaxKind.CloseBraceToken */ + ); + } + return res; + } + function parsePropertyAccessEntityNameExpression() { + var pos = getNodePos(); + var node = parseJSDocIdentifierName(); + while (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + var name2 = parseJSDocIdentifierName(); + node = finishNode(factory.createPropertyAccessExpression(node, name2), pos); + } + return node; + } + function parseSimpleTag(start2, createTag, tagName, margin, indentText) { + return finishNode(createTag(tagName, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseThisTag(start2, tagName, margin, indentText) { + var typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + skipWhitespace2(); + return finishNode(factory.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseEnumTag(start2, tagName, margin, indentText) { + var typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + skipWhitespace2(); + return finishNode(factory.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseTypedefTag(start2, tagName, indent, indentText) { + var _a3; + var typeExpression = tryParseTypeExpression(); + skipWhitespaceOrAsterisk(); + var fullName = parseJSDocTypeNameWithNamespace(); + skipWhitespace2(); + var comment = parseTagComments(indent); + var end2; + if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) { + var child = void 0; + var childTypeTag = void 0; + var jsDocPropertyTags = void 0; + var hasChildren = false; + while (child = tryParse(function() { + return parseChildPropertyTag(indent); + })) { + hasChildren = true; + if (child.kind === 346) { + if (childTypeTag) { + var lastError = parseErrorAtCurrentToken(ts2.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); + if (lastError) { + ts2.addRelatedInfo(lastError, ts2.createDetachedDiagnostic(fileName, 0, 0, ts2.Diagnostics.The_tag_was_first_specified_here)); + } + break; + } else { + childTypeTag = child; + } + } else { + jsDocPropertyTags = ts2.append(jsDocPropertyTags, child); + } + } + if (hasChildren) { + var isArrayType = typeExpression && typeExpression.type.kind === 185; + var jsdocTypeLiteral = factory.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); + typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); + end2 = typeExpression.end; + } + } + end2 = end2 || comment !== void 0 ? getNodePos() : ((_a3 = fullName !== null && fullName !== void 0 ? fullName : typeExpression) !== null && _a3 !== void 0 ? _a3 : tagName).end; + if (!comment) { + comment = parseTrailingTagComments(start2, end2, indent, indentText); + } + var typedefTag = factory.createJSDocTypedefTag(tagName, typeExpression, fullName, comment); + return finishNode(typedefTag, start2, end2); + } + function parseJSDocTypeNameWithNamespace(nested) { + var pos = scanner.getTokenPos(); + if (!ts2.tokenIsIdentifierOrKeyword(token())) { + return void 0; + } + var typeNameOrNamespaceName = parseJSDocIdentifierName(); + if (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + var body = parseJSDocTypeNameWithNamespace( + /*nested*/ + true + ); + var jsDocNamespaceNode = factory.createModuleDeclaration( + /*modifiers*/ + void 0, + typeNameOrNamespaceName, + body, + nested ? 4 : void 0 + ); + return finishNode(jsDocNamespaceNode, pos); + } + if (nested) { + typeNameOrNamespaceName.isInJSDocNamespace = true; + } + return typeNameOrNamespaceName; + } + function parseCallbackTagParameters(indent) { + var pos = getNodePos(); + var child; + var parameters; + while (child = tryParse(function() { + return parseChildParameterOrPropertyTag(4, indent); + })) { + parameters = ts2.append(parameters, child); + } + return createNodeArray(parameters || [], pos); + } + function parseCallbackTag(start2, tagName, indent, indentText) { + var fullName = parseJSDocTypeNameWithNamespace(); + skipWhitespace2(); + var comment = parseTagComments(indent); + var parameters = parseCallbackTagParameters(indent); + var returnTag = tryParse(function() { + if (parseOptionalJsdoc( + 59 + /* SyntaxKind.AtToken */ + )) { + var tag = parseTag(indent); + if (tag && tag.kind === 344) { + return tag; + } + } + }); + var typeExpression = finishNode(factory.createJSDocSignature( + /*typeParameters*/ + void 0, + parameters, + returnTag + ), start2); + if (!comment) { + comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText); + } + var end2 = comment !== void 0 ? getNodePos() : typeExpression.end; + return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2); + } + function escapedTextsEqual(a7, b8) { + while (!ts2.isIdentifier(a7) || !ts2.isIdentifier(b8)) { + if (!ts2.isIdentifier(a7) && !ts2.isIdentifier(b8) && a7.right.escapedText === b8.right.escapedText) { + a7 = a7.left; + b8 = b8.left; + } else { + return false; + } + } + return a7.escapedText === b8.escapedText; + } + function parseChildPropertyTag(indent) { + return parseChildParameterOrPropertyTag(1, indent); + } + function parseChildParameterOrPropertyTag(target, indent, name2) { + var canParseTag = true; + var seenAsterisk = false; + while (true) { + switch (nextTokenJSDoc()) { + case 59: + if (canParseTag) { + var child = tryParseChildTag(target, indent); + if (child && (child.kind === 343 || child.kind === 350) && target !== 4 && name2 && (ts2.isIdentifier(child.name) || !escapedTextsEqual(name2, child.name.left))) { + return false; + } + return child; + } + seenAsterisk = false; + break; + case 4: + canParseTag = true; + seenAsterisk = false; + break; + case 41: + if (seenAsterisk) { + canParseTag = false; + } + seenAsterisk = true; + break; + case 79: + canParseTag = false; + break; + case 1: + return false; + } + } + } + function tryParseChildTag(target, indent) { + ts2.Debug.assert( + token() === 59 + /* SyntaxKind.AtToken */ + ); + var start2 = scanner.getStartPos(); + nextTokenJSDoc(); + var tagName = parseJSDocIdentifierName(); + skipWhitespace2(); + var t8; + switch (tagName.escapedText) { + case "type": + return target === 1 && parseTypeTag(start2, tagName); + case "prop": + case "property": + t8 = 1; + break; + case "arg": + case "argument": + case "param": + t8 = 2 | 4; + break; + default: + return false; + } + if (!(target & t8)) { + return false; + } + return parseParameterOrPropertyTag(start2, tagName, target, indent); + } + function parseTemplateTagTypeParameter() { + var typeParameterPos = getNodePos(); + var isBracketed = parseOptionalJsdoc( + 22 + /* SyntaxKind.OpenBracketToken */ + ); + if (isBracketed) { + skipWhitespace2(); + } + var name2 = parseJSDocIdentifierName(ts2.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); + var defaultType; + if (isBracketed) { + skipWhitespace2(); + parseExpected( + 63 + /* SyntaxKind.EqualsToken */ + ); + defaultType = doInsideOfContext(8388608, parseJSDocType); + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + } + if (ts2.nodeIsMissing(name2)) { + return void 0; + } + return finishNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + /*constraint*/ + void 0, + defaultType + ), typeParameterPos); + } + function parseTemplateTagTypeParameters() { + var pos = getNodePos(); + var typeParameters = []; + do { + skipWhitespace2(); + var node = parseTemplateTagTypeParameter(); + if (node !== void 0) { + typeParameters.push(node); + } + skipWhitespaceOrAsterisk(); + } while (parseOptionalJsdoc( + 27 + /* SyntaxKind.CommaToken */ + )); + return createNodeArray(typeParameters, pos); + } + function parseTemplateTag(start2, tagName, indent, indentText) { + var constraint = token() === 18 ? parseJSDocTypeExpression() : void 0; + var typeParameters = parseTemplateTagTypeParameters(); + return finishNode(factory.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2); + } + function parseOptionalJsdoc(t8) { + if (token() === t8) { + nextTokenJSDoc(); + return true; + } + return false; + } + function parseJSDocEntityName() { + var entity = parseJSDocIdentifierName(); + if (parseOptional( + 22 + /* SyntaxKind.OpenBracketToken */ + )) { + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + } + while (parseOptional( + 24 + /* SyntaxKind.DotToken */ + )) { + var name2 = parseJSDocIdentifierName(); + if (parseOptional( + 22 + /* SyntaxKind.OpenBracketToken */ + )) { + parseExpected( + 23 + /* SyntaxKind.CloseBracketToken */ + ); + } + entity = createQualifiedName(entity, name2); + } + return entity; + } + function parseJSDocIdentifierName(message) { + if (!ts2.tokenIsIdentifierOrKeyword(token())) { + return createMissingNode( + 79, + /*reportAtCurrentPosition*/ + !message, + message || ts2.Diagnostics.Identifier_expected + ); + } + identifierCount++; + var pos = scanner.getTokenPos(); + var end2 = scanner.getTextPos(); + var originalKeywordKind = token(); + var text = internIdentifier(scanner.getTokenValue()); + var result2 = finishNode(factory.createIdentifier( + text, + /*typeArguments*/ + void 0, + originalKeywordKind + ), pos, end2); + nextTokenJSDoc(); + return result2; + } + } + })(JSDocParser = Parser8.JSDocParser || (Parser8.JSDocParser = {})); + })(Parser7 || (Parser7 = {})); + var IncrementalParser; + (function(IncrementalParser2) { + function updateSourceFile2(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || ts2.Debug.shouldAssert( + 2 + /* AssertionLevel.Aggressive */ + ); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (ts2.textChangeRangeIsUnchanged(textChangeRange)) { + return sourceFile; + } + if (sourceFile.statements.length === 0) { + return Parser7.parseSourceFile( + sourceFile.fileName, + newText, + sourceFile.languageVersion, + /*syntaxCursor*/ + void 0, + /*setParentNodes*/ + true, + sourceFile.scriptKind, + sourceFile.setExternalModuleIndicator + ); + } + var incrementalSourceFile = sourceFile; + ts2.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + Parser7.fixupParentReferences(incrementalSourceFile); + var oldText = sourceFile.text; + var syntaxCursor = createSyntaxCursor(sourceFile); + var changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + ts2.Debug.assert(changeRange.span.start <= textChangeRange.span.start); + ts2.Debug.assert(ts2.textSpanEnd(changeRange.span) === ts2.textSpanEnd(textChangeRange.span)); + ts2.Debug.assert(ts2.textSpanEnd(ts2.textChangeRangeNewSpan(changeRange)) === ts2.textSpanEnd(ts2.textChangeRangeNewSpan(textChangeRange))); + var delta = ts2.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts2.textSpanEnd(changeRange.span), ts2.textSpanEnd(ts2.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + var result2 = Parser7.parseSourceFile( + sourceFile.fileName, + newText, + sourceFile.languageVersion, + syntaxCursor, + /*setParentNodes*/ + true, + sourceFile.scriptKind, + sourceFile.setExternalModuleIndicator + ); + result2.commentDirectives = getNewCommentDirectives(sourceFile.commentDirectives, result2.commentDirectives, changeRange.span.start, ts2.textSpanEnd(changeRange.span), delta, oldText, newText, aggressiveChecks); + result2.impliedNodeFormat = sourceFile.impliedNodeFormat; + return result2; + } + IncrementalParser2.updateSourceFile = updateSourceFile2; + function getNewCommentDirectives(oldDirectives, newDirectives, changeStart, changeRangeOldEnd, delta, oldText, newText, aggressiveChecks) { + if (!oldDirectives) + return newDirectives; + var commentDirectives; + var addedNewlyScannedDirectives = false; + for (var _i = 0, oldDirectives_1 = oldDirectives; _i < oldDirectives_1.length; _i++) { + var directive = oldDirectives_1[_i]; + var range2 = directive.range, type3 = directive.type; + if (range2.end < changeStart) { + commentDirectives = ts2.append(commentDirectives, directive); + } else if (range2.pos > changeRangeOldEnd) { + addNewlyScannedDirectives(); + var updatedDirective = { + range: { pos: range2.pos + delta, end: range2.end + delta }, + type: type3 + }; + commentDirectives = ts2.append(commentDirectives, updatedDirective); + if (aggressiveChecks) { + ts2.Debug.assert(oldText.substring(range2.pos, range2.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end)); + } + } + } + addNewlyScannedDirectives(); + return commentDirectives; + function addNewlyScannedDirectives() { + if (addedNewlyScannedDirectives) + return; + addedNewlyScannedDirectives = true; + if (!commentDirectives) { + commentDirectives = newDirectives; + } else if (newDirectives) { + commentDirectives.push.apply(commentDirectives, newDirectives); + } + } + } + function moveElementEntirelyPastChangeRange(element, isArray3, delta, oldText, newText, aggressiveChecks) { + if (isArray3) { + visitArray(element); + } else { + visitNode2(element); + } + return; + function visitNode2(node) { + var text = ""; + if (aggressiveChecks && shouldCheckNode(node)) { + text = oldText.substring(node.pos, node.end); + } + if (node._children) { + node._children = void 0; + } + ts2.setTextRangePosEnd(node, node.pos + delta, node.end + delta); + if (aggressiveChecks && shouldCheckNode(node)) { + ts2.Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode2, visitArray); + if (ts2.hasJSDocNodes(node)) { + for (var _i = 0, _a3 = node.jsDoc; _i < _a3.length; _i++) { + var jsDocComment = _a3[_i]; + visitNode2(jsDocComment); + } + } + checkNodePositions(node, aggressiveChecks); + } + function visitArray(array) { + array._children = void 0; + ts2.setTextRangePosEnd(array, array.pos + delta, array.end + delta); + for (var _i = 0, array_9 = array; _i < array_9.length; _i++) { + var node = array_9[_i]; + visitNode2(node); + } + } + } + function shouldCheckNode(node) { + switch (node.kind) { + case 10: + case 8: + case 79: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + ts2.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + ts2.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + ts2.Debug.assert(element.pos <= element.end); + var pos = Math.min(element.pos, changeRangeNewEnd); + var end = element.end >= changeRangeOldEnd ? ( + // Element ends after the change range. Always adjust the end pos. + element.end + delta + ) : ( + // Element ends in the change range. The element will keep its position if + // possible. Or Move backward to the new-end if it's in the 'Y' range. + Math.min(element.end, changeRangeNewEnd) + ); + ts2.Debug.assert(pos <= end); + if (element.parent) { + ts2.Debug.assertGreaterThanOrEqual(pos, element.parent.pos); + ts2.Debug.assertLessThanOrEqual(end, element.parent.end); + } + ts2.setTextRangePosEnd(element, pos, end); + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + var pos_3 = node.pos; + var visitNode_1 = function(child) { + ts2.Debug.assert(child.pos >= pos_3); + pos_3 = child.end; + }; + if (ts2.hasJSDocNodes(node)) { + for (var _i = 0, _a3 = node.jsDoc; _i < _a3.length; _i++) { + var jsDocComment = _a3[_i]; + visitNode_1(jsDocComment); + } + } + forEachChild(node, visitNode_1); + ts2.Debug.assert(pos_3 <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode2(sourceFile); + return; + function visitNode2(child) { + ts2.Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange( + child, + /*isArray*/ + false, + delta, + oldText, + newText, + aggressiveChecks + ); + return; + } + var fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = void 0; + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode2, visitArray); + if (ts2.hasJSDocNodes(child)) { + for (var _i = 0, _a3 = child.jsDoc; _i < _a3.length; _i++) { + var jsDocComment = _a3[_i]; + visitNode2(jsDocComment); + } + } + checkNodePositions(child, aggressiveChecks); + return; + } + ts2.Debug.assert(fullEnd < changeStart); + } + function visitArray(array) { + ts2.Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange( + array, + /*isArray*/ + true, + delta, + oldText, + newText, + aggressiveChecks + ); + return; + } + var fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = void 0; + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (var _i = 0, array_10 = array; _i < array_10.length; _i++) { + var node = array_10[_i]; + visitNode2(node); + } + return; + } + ts2.Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + var maxLookahead = 1; + var start = changeRange.span.start; + for (var i7 = 0; start > 0 && i7 <= maxLookahead; i7++) { + var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + ts2.Debug.assert(nearestNode.pos <= start); + var position = nearestNode.pos; + start = Math.max(0, position - 1); + } + var finalSpan = ts2.createTextSpanFromBounds(start, ts2.textSpanEnd(changeRange.span)); + var finalLength = changeRange.newLength + (changeRange.span.start - start); + return ts2.createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + var bestResult = sourceFile; + var lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit7); + if (lastNodeEntirelyBeforePosition) { + var lastChildOfLastEntireNodeBeforePosition = getLastDescendant(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastDescendant(node) { + while (true) { + var lastChild = ts2.getLastChild(node); + if (lastChild) { + node = lastChild; + } else { + return node; + } + } + } + function visit7(child) { + if (ts2.nodeIsMissing(child)) { + return; + } + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + bestResult = child; + } + if (position < child.end) { + forEachChild(child, visit7); + return true; + } else { + ts2.Debug.assert(child.end <= position); + lastNodeEntirelyBeforePosition = child; + } + } else { + ts2.Debug.assert(child.pos > position); + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + var oldText = sourceFile.text; + if (textChangeRange) { + ts2.Debug.assert(oldText.length - textChangeRange.span.length + textChangeRange.newLength === newText.length); + if (aggressiveChecks || ts2.Debug.shouldAssert( + 3 + /* AssertionLevel.VeryAggressive */ + )) { + var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + var newTextPrefix = newText.substr(0, textChangeRange.span.start); + ts2.Debug.assert(oldTextPrefix === newTextPrefix); + var oldTextSuffix = oldText.substring(ts2.textSpanEnd(textChangeRange.span), oldText.length); + var newTextSuffix = newText.substring(ts2.textSpanEnd(ts2.textChangeRangeNewSpan(textChangeRange)), newText.length); + ts2.Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + var currentArray = sourceFile.statements; + var currentArrayIndex = 0; + ts2.Debug.assert(currentArrayIndex < currentArray.length); + var current = currentArray[currentArrayIndex]; + var lastQueriedPosition = -1; + return { + currentNode: function(position) { + if (position !== lastQueriedPosition) { + if (current && current.end === position && currentArrayIndex < currentArray.length - 1) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + lastQueriedPosition = position; + ts2.Debug.assert(!current || current.pos === position); + return current; + } + }; + function findHighestListElementThatStartsAtPosition(position) { + currentArray = void 0; + currentArrayIndex = -1; + current = void 0; + forEachChild(sourceFile, visitNode2, visitArray); + return; + function visitNode2(node) { + if (position >= node.pos && position < node.end) { + forEachChild(node, visitNode2, visitArray); + return true; + } + return false; + } + function visitArray(array) { + if (position >= array.pos && position < array.end) { + for (var i7 = 0; i7 < array.length; i7++) { + var child = array[i7]; + if (child) { + if (child.pos === position) { + currentArray = array; + currentArrayIndex = i7; + current = child; + return true; + } else { + if (child.pos < position && position < child.end) { + forEachChild(child, visitNode2, visitArray); + return true; + } + } + } + } + } + return false; + } + } + } + IncrementalParser2.createSyntaxCursor = createSyntaxCursor; + var InvalidPosition; + (function(InvalidPosition2) { + InvalidPosition2[InvalidPosition2["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); + })(IncrementalParser || (IncrementalParser = {})); + function isDeclarationFileName(fileName) { + return ts2.fileExtensionIsOneOf(fileName, ts2.supportedDeclarationExtensions); + } + ts2.isDeclarationFileName = isDeclarationFileName; + function parseResolutionMode(mode, pos, end, reportDiagnostic) { + if (!mode) { + return void 0; + } + if (mode === "import") { + return ts2.ModuleKind.ESNext; + } + if (mode === "require") { + return ts2.ModuleKind.CommonJS; + } + reportDiagnostic(pos, end - pos, ts2.Diagnostics.resolution_mode_should_be_either_require_or_import); + return void 0; + } + function processCommentPragmas(context2, sourceText) { + var pragmas = []; + for (var _i = 0, _a3 = ts2.getLeadingCommentRanges(sourceText, 0) || ts2.emptyArray; _i < _a3.length; _i++) { + var range2 = _a3[_i]; + var comment = sourceText.substring(range2.pos, range2.end); + extractPragmas(pragmas, range2, comment); + } + context2.pragmas = new ts2.Map(); + for (var _b = 0, pragmas_1 = pragmas; _b < pragmas_1.length; _b++) { + var pragma = pragmas_1[_b]; + if (context2.pragmas.has(pragma.name)) { + var currentValue = context2.pragmas.get(pragma.name); + if (currentValue instanceof Array) { + currentValue.push(pragma.args); + } else { + context2.pragmas.set(pragma.name, [currentValue, pragma.args]); + } + continue; + } + context2.pragmas.set(pragma.name, pragma.args); + } + } + ts2.processCommentPragmas = processCommentPragmas; + function processPragmasIntoFields(context2, reportDiagnostic) { + context2.checkJsDirective = void 0; + context2.referencedFiles = []; + context2.typeReferenceDirectives = []; + context2.libReferenceDirectives = []; + context2.amdDependencies = []; + context2.hasNoDefaultLib = false; + context2.pragmas.forEach(function(entryOrList, key) { + switch (key) { + case "reference": { + var referencedFiles_1 = context2.referencedFiles; + var typeReferenceDirectives_1 = context2.typeReferenceDirectives; + var libReferenceDirectives_1 = context2.libReferenceDirectives; + ts2.forEach(ts2.toArray(entryOrList), function(arg) { + var _a3 = arg.arguments, types3 = _a3.types, lib2 = _a3.lib, path2 = _a3.path, res = _a3["resolution-mode"]; + if (arg.arguments["no-default-lib"]) { + context2.hasNoDefaultLib = true; + } else if (types3) { + var parsed = parseResolutionMode(res, types3.pos, types3.end, reportDiagnostic); + typeReferenceDirectives_1.push(__assign16({ pos: types3.pos, end: types3.end, fileName: types3.value }, parsed ? { resolutionMode: parsed } : {})); + } else if (lib2) { + libReferenceDirectives_1.push({ pos: lib2.pos, end: lib2.end, fileName: lib2.value }); + } else if (path2) { + referencedFiles_1.push({ pos: path2.pos, end: path2.end, fileName: path2.value }); + } else { + reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, ts2.Diagnostics.Invalid_reference_directive_syntax); + } + }); + break; + } + case "amd-dependency": { + context2.amdDependencies = ts2.map(ts2.toArray(entryOrList), function(x7) { + return { name: x7.arguments.name, path: x7.arguments.path }; + }); + break; + } + case "amd-module": { + if (entryOrList instanceof Array) { + for (var _i = 0, entryOrList_1 = entryOrList; _i < entryOrList_1.length; _i++) { + var entry = entryOrList_1[_i]; + if (context2.moduleName) { + reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, ts2.Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); + } + context2.moduleName = entry.arguments.name; + } + } else { + context2.moduleName = entryOrList.arguments.name; + } + break; + } + case "ts-nocheck": + case "ts-check": { + ts2.forEach(ts2.toArray(entryOrList), function(entry2) { + if (!context2.checkJsDirective || entry2.range.pos > context2.checkJsDirective.pos) { + context2.checkJsDirective = { + enabled: key === "ts-check", + end: entry2.range.end, + pos: entry2.range.pos + }; + } + }); + break; + } + case "jsx": + case "jsxfrag": + case "jsximportsource": + case "jsxruntime": + return; + default: + ts2.Debug.fail("Unhandled pragma kind"); + } + }); + } + ts2.processPragmasIntoFields = processPragmasIntoFields; + var namedArgRegExCache = new ts2.Map(); + function getNamedArgRegEx(name2) { + if (namedArgRegExCache.has(name2)) { + return namedArgRegExCache.get(name2); + } + var result2 = new RegExp("(\\s".concat(name2, `\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`), "im"); + namedArgRegExCache.set(name2, result2); + return result2; + } + var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; + var singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; + function extractPragmas(pragmas, range2, text) { + var tripleSlash = range2.kind === 2 && tripleSlashXMLCommentStartRegEx.exec(text); + if (tripleSlash) { + var name2 = tripleSlash[1].toLowerCase(); + var pragma = ts2.commentPragmas[name2]; + if (!pragma || !(pragma.kind & 1)) { + return; + } + if (pragma.args) { + var argument = {}; + for (var _i = 0, _a3 = pragma.args; _i < _a3.length; _i++) { + var arg = _a3[_i]; + var matcher = getNamedArgRegEx(arg.name); + var matchResult = matcher.exec(text); + if (!matchResult && !arg.optional) { + return; + } else if (matchResult) { + var value2 = matchResult[2] || matchResult[3]; + if (arg.captureSpan) { + var startPos = range2.pos + matchResult.index + matchResult[1].length + 1; + argument[arg.name] = { + value: value2, + pos: startPos, + end: startPos + value2.length + }; + } else { + argument[arg.name] = value2; + } + } + } + pragmas.push({ name: name2, args: { arguments: argument, range: range2 } }); + } else { + pragmas.push({ name: name2, args: { arguments: {}, range: range2 } }); + } + return; + } + var singleLine = range2.kind === 2 && singleLinePragmaRegEx.exec(text); + if (singleLine) { + return addPragmaForMatch(pragmas, range2, 2, singleLine); + } + if (range2.kind === 3) { + var multiLinePragmaRegEx = /@(\S+)(\s+.*)?$/gim; + var multiLineMatch = void 0; + while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { + addPragmaForMatch(pragmas, range2, 4, multiLineMatch); + } + } + } + function addPragmaForMatch(pragmas, range2, kind, match) { + if (!match) + return; + var name2 = match[1].toLowerCase(); + var pragma = ts2.commentPragmas[name2]; + if (!pragma || !(pragma.kind & kind)) { + return; + } + var args = match[2]; + var argument = getNamedPragmaArguments(pragma, args); + if (argument === "fail") + return; + pragmas.push({ name: name2, args: { arguments: argument, range: range2 } }); + return; + } + function getNamedPragmaArguments(pragma, text) { + if (!text) + return {}; + if (!pragma.args) + return {}; + var args = ts2.trimString(text).split(/\s+/); + var argMap = {}; + for (var i7 = 0; i7 < pragma.args.length; i7++) { + var argument = pragma.args[i7]; + if (!args[i7] && !argument.optional) { + return "fail"; + } + if (argument.captureSpan) { + return ts2.Debug.fail("Capture spans not yet implemented for non-xml pragmas"); + } + argMap[argument.name] = args[i7]; + } + return argMap; + } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 79) { + return lhs.escapedText === rhs.escapedText; + } + if (lhs.kind === 108) { + return true; + } + return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); + } + ts2.tagNamesAreEquivalent = tagNamesAreEquivalent; + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.compileOnSaveCommandLineOption = { + name: "compileOnSave", + type: "boolean", + defaultValueDescription: false + }; + var jsxOptionMap = new ts2.Map(ts2.getEntries({ + "preserve": 1, + "react-native": 3, + "react": 2, + "react-jsx": 4, + "react-jsxdev": 5 + })); + ts2.inverseJsxOptionMap = new ts2.Map(ts2.arrayFrom(ts2.mapIterator(jsxOptionMap.entries(), function(_a2) { + var key = _a2[0], value2 = _a2[1]; + return ["" + value2, key]; + }))); + var libEntries = [ + // JavaScript only + ["es5", "lib.es5.d.ts"], + ["es6", "lib.es2015.d.ts"], + ["es2015", "lib.es2015.d.ts"], + ["es7", "lib.es2016.d.ts"], + ["es2016", "lib.es2016.d.ts"], + ["es2017", "lib.es2017.d.ts"], + ["es2018", "lib.es2018.d.ts"], + ["es2019", "lib.es2019.d.ts"], + ["es2020", "lib.es2020.d.ts"], + ["es2021", "lib.es2021.d.ts"], + ["es2022", "lib.es2022.d.ts"], + ["esnext", "lib.esnext.d.ts"], + // Host only + ["dom", "lib.dom.d.ts"], + ["dom.iterable", "lib.dom.iterable.d.ts"], + ["webworker", "lib.webworker.d.ts"], + ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], + ["webworker.iterable", "lib.webworker.iterable.d.ts"], + ["scripthost", "lib.scripthost.d.ts"], + // ES2015 Or ESNext By-feature options + ["es2015.core", "lib.es2015.core.d.ts"], + ["es2015.collection", "lib.es2015.collection.d.ts"], + ["es2015.generator", "lib.es2015.generator.d.ts"], + ["es2015.iterable", "lib.es2015.iterable.d.ts"], + ["es2015.promise", "lib.es2015.promise.d.ts"], + ["es2015.proxy", "lib.es2015.proxy.d.ts"], + ["es2015.reflect", "lib.es2015.reflect.d.ts"], + ["es2015.symbol", "lib.es2015.symbol.d.ts"], + ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"], + ["es2016.array.include", "lib.es2016.array.include.d.ts"], + ["es2017.object", "lib.es2017.object.d.ts"], + ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"], + ["es2017.string", "lib.es2017.string.d.ts"], + ["es2017.intl", "lib.es2017.intl.d.ts"], + ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], + ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"], + ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"], + ["es2018.intl", "lib.es2018.intl.d.ts"], + ["es2018.promise", "lib.es2018.promise.d.ts"], + ["es2018.regexp", "lib.es2018.regexp.d.ts"], + ["es2019.array", "lib.es2019.array.d.ts"], + ["es2019.object", "lib.es2019.object.d.ts"], + ["es2019.string", "lib.es2019.string.d.ts"], + ["es2019.symbol", "lib.es2019.symbol.d.ts"], + ["es2019.intl", "lib.es2019.intl.d.ts"], + ["es2020.bigint", "lib.es2020.bigint.d.ts"], + ["es2020.date", "lib.es2020.date.d.ts"], + ["es2020.promise", "lib.es2020.promise.d.ts"], + ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], + ["es2020.string", "lib.es2020.string.d.ts"], + ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], + ["es2020.intl", "lib.es2020.intl.d.ts"], + ["es2020.number", "lib.es2020.number.d.ts"], + ["es2021.promise", "lib.es2021.promise.d.ts"], + ["es2021.string", "lib.es2021.string.d.ts"], + ["es2021.weakref", "lib.es2021.weakref.d.ts"], + ["es2021.intl", "lib.es2021.intl.d.ts"], + ["es2022.array", "lib.es2022.array.d.ts"], + ["es2022.error", "lib.es2022.error.d.ts"], + ["es2022.intl", "lib.es2022.intl.d.ts"], + ["es2022.object", "lib.es2022.object.d.ts"], + ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], + ["es2022.string", "lib.es2022.string.d.ts"], + ["esnext.array", "lib.es2022.array.d.ts"], + ["esnext.symbol", "lib.es2019.symbol.d.ts"], + ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], + ["esnext.intl", "lib.esnext.intl.d.ts"], + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.es2022.string.d.ts"], + ["esnext.promise", "lib.es2021.promise.d.ts"], + ["esnext.weakref", "lib.es2021.weakref.d.ts"] + ]; + ts2.libs = libEntries.map(function(entry) { + return entry[0]; + }); + ts2.libMap = new ts2.Map(libEntries); + ts2.optionsForWatch = [ + { + name: "watchFile", + type: new ts2.Map(ts2.getEntries({ + fixedpollinginterval: ts2.WatchFileKind.FixedPollingInterval, + prioritypollinginterval: ts2.WatchFileKind.PriorityPollingInterval, + dynamicprioritypolling: ts2.WatchFileKind.DynamicPriorityPolling, + fixedchunksizepolling: ts2.WatchFileKind.FixedChunkSizePolling, + usefsevents: ts2.WatchFileKind.UseFsEvents, + usefseventsonparentdirectory: ts2.WatchFileKind.UseFsEventsOnParentDirectory + })), + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Specify_how_the_TypeScript_watch_mode_works, + defaultValueDescription: ts2.WatchFileKind.UseFsEvents + }, + { + name: "watchDirectory", + type: new ts2.Map(ts2.getEntries({ + usefsevents: ts2.WatchDirectoryKind.UseFsEvents, + fixedpollinginterval: ts2.WatchDirectoryKind.FixedPollingInterval, + dynamicprioritypolling: ts2.WatchDirectoryKind.DynamicPriorityPolling, + fixedchunksizepolling: ts2.WatchDirectoryKind.FixedChunkSizePolling + })), + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality, + defaultValueDescription: ts2.WatchDirectoryKind.UseFsEvents + }, + { + name: "fallbackPolling", + type: new ts2.Map(ts2.getEntries({ + fixedinterval: ts2.PollingWatchKind.FixedInterval, + priorityinterval: ts2.PollingWatchKind.PriorityInterval, + dynamicpriority: ts2.PollingWatchKind.DynamicPriority, + fixedchunksize: ts2.PollingWatchKind.FixedChunkSize + })), + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers, + defaultValueDescription: ts2.PollingWatchKind.PriorityInterval + }, + { + name: "synchronousWatchDirectory", + type: "boolean", + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, + defaultValueDescription: false + }, + { + name: "excludeDirectories", + type: "list", + element: { + name: "excludeDirectory", + type: "string", + isFilePath: true, + extraValidation: specToDiagnostic + }, + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Remove_a_list_of_directories_from_the_watch_process + }, + { + name: "excludeFiles", + type: "list", + element: { + name: "excludeFile", + type: "string", + isFilePath: true, + extraValidation: specToDiagnostic + }, + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing + } + ]; + ts2.commonOptionsWithBuild = [ + { + name: "help", + shortName: "h", + type: "boolean", + showInSimplifiedHelpView: true, + isCommandLineOnly: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Print_this_message, + defaultValueDescription: false + }, + { + name: "help", + shortName: "?", + type: "boolean", + isCommandLineOnly: true, + category: ts2.Diagnostics.Command_line_Options, + defaultValueDescription: false + }, + { + name: "watch", + shortName: "w", + type: "boolean", + showInSimplifiedHelpView: true, + isCommandLineOnly: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Watch_input_files, + defaultValueDescription: false + }, + { + name: "preserveWatchOutput", + type: "boolean", + showInSimplifiedHelpView: false, + category: ts2.Diagnostics.Output_Formatting, + description: ts2.Diagnostics.Disable_wiping_the_console_in_watch_mode, + defaultValueDescription: false + }, + { + name: "listFiles", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Print_all_of_the_files_read_during_the_compilation, + defaultValueDescription: false + }, + { + name: "explainFiles", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included, + defaultValueDescription: false + }, + { + name: "listEmittedFiles", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation, + defaultValueDescription: false + }, + { + name: "pretty", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Output_Formatting, + description: ts2.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read, + defaultValueDescription: true + }, + { + name: "traceResolution", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Log_paths_used_during_the_moduleResolution_process, + defaultValueDescription: false + }, + { + name: "diagnostics", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Output_compiler_performance_information_after_building, + defaultValueDescription: false + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Output_more_detailed_compiler_performance_information_after_building, + defaultValueDescription: false + }, + { + name: "generateCpuProfile", + type: "string", + isFilePath: true, + paramType: ts2.Diagnostics.FILE_OR_DIRECTORY, + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging, + defaultValueDescription: "profile.cpuprofile" + }, + { + name: "generateTrace", + type: "string", + isFilePath: true, + isCommandLineOnly: true, + paramType: ts2.Diagnostics.DIRECTORY, + category: ts2.Diagnostics.Compiler_Diagnostics, + description: ts2.Diagnostics.Generates_an_event_trace_and_a_list_of_types + }, + { + name: "incremental", + shortName: "i", + type: "boolean", + category: ts2.Diagnostics.Projects, + description: ts2.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects, + transpileOptionValue: void 0, + defaultValueDescription: ts2.Diagnostics.false_unless_composite_is_set + }, + { + name: "assumeChangesOnlyAffectDirectDependencies", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Watch_and_Build_Modes, + description: ts2.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it, + defaultValueDescription: false + }, + { + name: "locale", + type: "string", + category: ts2.Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: ts2.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, + defaultValueDescription: ts2.Diagnostics.Platform_specific + } + ]; + ts2.targetOptionDeclaration = { + name: "target", + shortName: "t", + type: new ts2.Map(ts2.getEntries({ + es3: 0, + es5: 1, + es6: 2, + es2015: 2, + es2016: 3, + es2017: 4, + es2018: 5, + es2019: 6, + es2020: 7, + es2021: 8, + es2022: 9, + esnext: 99 + })), + affectsSourceFile: true, + affectsModuleResolution: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + paramType: ts2.Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations, + defaultValueDescription: 0 + }; + ts2.moduleOptionDeclaration = { + name: "module", + shortName: "m", + type: new ts2.Map(ts2.getEntries({ + none: ts2.ModuleKind.None, + commonjs: ts2.ModuleKind.CommonJS, + amd: ts2.ModuleKind.AMD, + system: ts2.ModuleKind.System, + umd: ts2.ModuleKind.UMD, + es6: ts2.ModuleKind.ES2015, + es2015: ts2.ModuleKind.ES2015, + es2020: ts2.ModuleKind.ES2020, + es2022: ts2.ModuleKind.ES2022, + esnext: ts2.ModuleKind.ESNext, + node16: ts2.ModuleKind.Node16, + nodenext: ts2.ModuleKind.NodeNext + })), + affectsModuleResolution: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + paramType: ts2.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_what_module_code_is_generated, + defaultValueDescription: void 0 + }; + var commandOptionsWithoutBuild = [ + // CommandLine only options + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Show_all_compiler_options, + defaultValueDescription: false + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Print_the_compiler_s_version, + defaultValueDescription: false + }, + { + name: "init", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, + defaultValueDescription: false + }, + { + name: "project", + shortName: "p", + type: "string", + isFilePath: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + paramType: ts2.Diagnostics.FILE_OR_DIRECTORY, + description: ts2.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json + }, + { + name: "build", + type: "boolean", + shortName: "b", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date, + defaultValueDescription: false + }, + { + name: "showConfig", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: ts2.Diagnostics.Print_the_final_configuration_instead_of_building, + defaultValueDescription: false + }, + { + name: "listFilesOnly", + type: "boolean", + category: ts2.Diagnostics.Command_line_Options, + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + isCommandLineOnly: true, + description: ts2.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing, + defaultValueDescription: false + }, + // Basic + ts2.targetOptionDeclaration, + ts2.moduleOptionDeclaration, + { + name: "lib", + type: "list", + element: { + name: "lib", + type: ts2.libMap, + defaultValueDescription: void 0 + }, + affectsProgramStructure: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment, + transpileOptionValue: void 0 + }, + { + name: "allowJs", + type: "boolean", + affectsModuleResolution: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.JavaScript_Support, + description: ts2.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, + defaultValueDescription: false + }, + { + name: "checkJs", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.JavaScript_Support, + description: ts2.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files, + defaultValueDescription: false + }, + { + name: "jsx", + type: jsxOptionMap, + affectsSourceFile: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsModuleResolution: true, + paramType: ts2.Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_what_JSX_code_is_generated, + defaultValueDescription: void 0 + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + transpileOptionValue: void 0, + description: ts2.Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project, + defaultValueDescription: ts2.Diagnostics.false_unless_composite_is_set + }, + { + name: "declarationMap", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + transpileOptionValue: void 0, + defaultValueDescription: false, + description: ts2.Diagnostics.Create_sourcemaps_for_d_ts_files + }, + { + name: "emitDeclarationOnly", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files, + transpileOptionValue: void 0, + defaultValueDescription: false + }, + { + name: "sourceMap", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + defaultValueDescription: false, + description: ts2.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files + }, + { + name: "outFile", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsDeclarationPath: true, + affectsBundleEmitBuildInfo: true, + isFilePath: true, + paramType: ts2.Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output, + transpileOptionValue: void 0 + }, + { + name: "outDir", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: ts2.Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Specify_an_output_folder_for_all_emitted_files + }, + { + name: "rootDir", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: ts2.Diagnostics.LOCATION, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_the_root_folder_within_your_source_files, + defaultValueDescription: ts2.Diagnostics.Computed_from_the_list_of_input_files + }, + { + name: "composite", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsBundleEmitBuildInfo: true, + isTSConfigOnly: true, + category: ts2.Diagnostics.Projects, + transpileOptionValue: void 0, + defaultValueDescription: false, + description: ts2.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references + }, + { + name: "tsBuildInfoFile", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsBundleEmitBuildInfo: true, + isFilePath: true, + paramType: ts2.Diagnostics.FILE, + category: ts2.Diagnostics.Projects, + transpileOptionValue: void 0, + defaultValueDescription: ".tsbuildinfo", + description: ts2.Diagnostics.Specify_the_path_to_tsbuildinfo_incremental_compilation_file + }, + { + name: "removeComments", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + defaultValueDescription: false, + description: ts2.Diagnostics.Disable_emitting_comments + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Disable_emitting_files_from_a_compilation, + transpileOptionValue: void 0, + defaultValueDescription: false + }, + { + name: "importHelpers", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file, + defaultValueDescription: false + }, + { + name: "importsNotUsedAsValues", + type: new ts2.Map(ts2.getEntries({ + remove: 0, + preserve: 1, + error: 2 + })), + affectsEmit: true, + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types, + defaultValueDescription: 0 + }, + { + name: "downlevelIteration", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration, + defaultValueDescription: false + }, + { + name: "isolatedModules", + type: "boolean", + category: ts2.Diagnostics.Interop_Constraints, + description: ts2.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports, + transpileOptionValue: true, + defaultValueDescription: false + }, + // Strict Type Checks + { + name: "strict", + type: "boolean", + // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here + // The value of each strictFlag depends on own strictFlag value or this and never accessed directly. + // But we need to store `strict` in builf info, even though it won't be examined directly, so that the + // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_all_strict_type_checking_options, + defaultValueDescription: false + }, + { + name: "noImplicitAny", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "strictNullChecks", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.When_type_checking_take_into_account_null_and_undefined, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "strictFunctionTypes", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "strictBindCallApply", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "strictPropertyInitialization", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "noImplicitThis", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + { + name: "useUnknownInCatchVariables", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any, + defaultValueDescription: false + }, + { + name: "alwaysStrict", + type: "boolean", + affectsSourceFile: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + strictFlag: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Ensure_use_strict_is_always_emitted, + defaultValueDescription: ts2.Diagnostics.false_unless_strict_is_set + }, + // Additional Checks + { + name: "noUnusedLocals", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read, + defaultValueDescription: false + }, + { + name: "noUnusedParameters", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read, + defaultValueDescription: false + }, + { + name: "exactOptionalPropertyTypes", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined, + defaultValueDescription: false + }, + { + name: "noImplicitReturns", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function, + defaultValueDescription: false + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements, + defaultValueDescription: false + }, + { + name: "noUncheckedIndexedAccess", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index, + defaultValueDescription: false + }, + { + name: "noImplicitOverride", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier, + defaultValueDescription: false + }, + { + name: "noPropertyAccessFromIndexSignature", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: false, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type, + defaultValueDescription: false + }, + // Module Resolution + { + name: "moduleResolution", + type: new ts2.Map(ts2.getEntries({ + node: ts2.ModuleResolutionKind.NodeJs, + classic: ts2.ModuleResolutionKind.Classic, + node16: ts2.ModuleResolutionKind.Node16, + nodenext: ts2.ModuleResolutionKind.NodeNext + })), + affectsModuleResolution: true, + paramType: ts2.Diagnostics.STRATEGY, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier, + defaultValueDescription: ts2.Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node + }, + { + name: "baseUrl", + type: "string", + affectsModuleResolution: true, + isFilePath: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "paths", + type: "object", + affectsModuleResolution: true, + isTSConfigOnly: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations, + transpileOptionValue: void 0 + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + affectsModuleResolution: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, + transpileOptionValue: void 0, + defaultValueDescription: ts2.Diagnostics.Computed_from_the_list_of_input_files + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + affectsModuleResolution: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + affectsProgramStructure: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file, + transpileOptionValue: void 0 + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Interop_Constraints, + description: ts2.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export, + defaultValueDescription: ts2.Diagnostics.module_system_or_esModuleInterop + }, + { + name: "esModuleInterop", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + showInSimplifiedHelpView: true, + category: ts2.Diagnostics.Interop_Constraints, + description: ts2.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility, + defaultValueDescription: false + }, + { + name: "preserveSymlinks", + type: "boolean", + category: ts2.Diagnostics.Interop_Constraints, + description: ts2.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node, + defaultValueDescription: false + }, + { + name: "allowUmdGlobalAccess", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Allow_accessing_UMD_globals_from_modules, + defaultValueDescription: false + }, + { + name: "moduleSuffixes", + type: "list", + element: { + name: "suffix", + type: "string" + }, + listPreserveFalsyValues: true, + affectsModuleResolution: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module + }, + // Source Maps + { + name: "sourceRoot", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + paramType: ts2.Diagnostics.LOCATION, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code + }, + { + name: "mapRoot", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + paramType: ts2.Diagnostics.LOCATION, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations + }, + { + name: "inlineSourceMap", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript, + defaultValueDescription: false + }, + { + name: "inlineSources", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript, + defaultValueDescription: false + }, + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, + defaultValueDescription: false + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files, + defaultValueDescription: false + }, + // Advanced + { + name: "jsxFactory", + type: "string", + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h, + defaultValueDescription: "`React.createElement`" + }, + { + name: "jsxFragmentFactory", + type: "string", + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment, + defaultValueDescription: "React.Fragment" + }, + { + name: "jsxImportSource", + type: "string", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsModuleResolution: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk, + defaultValueDescription: "react" + }, + { + name: "resolveJsonModule", + type: "boolean", + affectsModuleResolution: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Enable_importing_json_files, + defaultValueDescription: false + }, + { + name: "out", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsDeclarationPath: true, + affectsBundleEmitBuildInfo: true, + isFilePath: false, + // for correct behaviour, please use outFile + category: ts2.Diagnostics.Backwards_Compatibility, + paramType: ts2.Diagnostics.FILE, + transpileOptionValue: void 0, + description: ts2.Diagnostics.Deprecated_setting_Use_outFile_instead + }, + { + name: "reactNamespace", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit, + defaultValueDescription: "`React`" + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + // We need to store these to determine whether `lib` files need to be rechecked + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Completeness, + description: ts2.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript, + defaultValueDescription: false + }, + { + name: "charset", + type: "string", + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files, + defaultValueDescription: "utf8" + }, + { + name: "emitBOM", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files, + defaultValueDescription: false + }, + { + name: "newLine", + type: new ts2.Map(ts2.getEntries({ + crlf: 0, + lf: 1 + /* NewLineKind.LineFeed */ + })), + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + paramType: ts2.Diagnostics.NEWLINE, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Set_the_newline_character_for_emitting_files, + defaultValueDescription: ts2.Diagnostics.Platform_specific + }, + { + name: "noErrorTruncation", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Output_Formatting, + description: ts2.Diagnostics.Disable_truncating_types_in_error_messages, + defaultValueDescription: false + }, + { + name: "noLib", + type: "boolean", + category: ts2.Diagnostics.Language_and_Environment, + affectsProgramStructure: true, + description: ts2.Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts, + // We are not returning a sourceFile for lib file when asked by the program, + // so pass --noLib to avoid reporting a file not found error. + transpileOptionValue: true, + defaultValueDescription: false + }, + { + name: "noResolve", + type: "boolean", + affectsModuleResolution: true, + category: ts2.Diagnostics.Modules, + description: ts2.Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project, + // We are not doing a full typecheck, we are not resolving the whole context, + // so pass --noResolve to avoid reporting missing file errors. + transpileOptionValue: true, + defaultValueDescription: false + }, + { + name: "stripInternal", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments, + defaultValueDescription: false + }, + { + name: "disableSizeLimit", + type: "boolean", + affectsProgramStructure: true, + category: ts2.Diagnostics.Editor_Support, + description: ts2.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server, + defaultValueDescription: false + }, + { + name: "disableSourceOfProjectReferenceRedirect", + type: "boolean", + isTSConfigOnly: true, + category: ts2.Diagnostics.Projects, + description: ts2.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects, + defaultValueDescription: false + }, + { + name: "disableSolutionSearching", + type: "boolean", + isTSConfigOnly: true, + category: ts2.Diagnostics.Projects, + description: ts2.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing, + defaultValueDescription: false + }, + { + name: "disableReferencedProjectLoad", + type: "boolean", + isTSConfigOnly: true, + category: ts2.Diagnostics.Projects, + description: ts2.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript, + defaultValueDescription: false + }, + { + name: "noImplicitUseStrict", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files, + defaultValueDescription: false + }, + { + name: "noEmitHelpers", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output, + defaultValueDescription: false + }, + { + name: "noEmitOnError", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + transpileOptionValue: void 0, + description: ts2.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported, + defaultValueDescription: false + }, + { + name: "preserveConstEnums", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code, + defaultValueDescription: false + }, + { + name: "declarationDir", + type: "string", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: ts2.Diagnostics.DIRECTORY, + category: ts2.Diagnostics.Emit, + transpileOptionValue: void 0, + description: ts2.Diagnostics.Specify_the_output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + // We need to store these to determine whether `lib` files need to be rechecked + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Completeness, + description: ts2.Diagnostics.Skip_type_checking_all_d_ts_files, + defaultValueDescription: false + }, + { + name: "allowUnusedLabels", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Disable_error_reporting_for_unused_labels, + defaultValueDescription: void 0 + }, + { + name: "allowUnreachableCode", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Type_Checking, + description: ts2.Diagnostics.Disable_error_reporting_for_unreachable_code, + defaultValueDescription: void 0 + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals, + defaultValueDescription: false + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures, + defaultValueDescription: false + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + affectsModuleResolution: true, + category: ts2.Diagnostics.Interop_Constraints, + description: ts2.Diagnostics.Ensure_that_casing_is_correct_in_imports, + defaultValueDescription: false + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + affectsModuleResolution: true, + category: ts2.Diagnostics.JavaScript_Support, + description: ts2.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs, + defaultValueDescription: 0 + }, + { + name: "noStrictGenericChecks", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types, + defaultValueDescription: false + }, + { + name: "useDefineForClassFields", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Language_and_Environment, + description: ts2.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields, + defaultValueDescription: ts2.Diagnostics.true_for_ES2022_and_above_including_ESNext + }, + { + name: "preserveValueImports", + type: "boolean", + affectsEmit: true, + affectsMultiFileEmitBuildInfo: true, + category: ts2.Diagnostics.Emit, + description: ts2.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed, + defaultValueDescription: false + }, + { + name: "keyofStringsOnly", + type: "boolean", + category: ts2.Diagnostics.Backwards_Compatibility, + description: ts2.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option, + defaultValueDescription: false + }, + { + // A list of plugins to load in the language service + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: ts2.Diagnostics.Specify_a_list_of_language_service_plugins_to_include, + category: ts2.Diagnostics.Editor_Support + }, + { + name: "moduleDetection", + type: new ts2.Map(ts2.getEntries({ + auto: ts2.ModuleDetectionKind.Auto, + legacy: ts2.ModuleDetectionKind.Legacy, + force: ts2.ModuleDetectionKind.Force + })), + affectsModuleResolution: true, + description: ts2.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files, + category: ts2.Diagnostics.Language_and_Environment, + defaultValueDescription: ts2.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules + }, + { + name: "ignoreDeprecations", + type: "string", + defaultValueDescription: void 0 + } + ]; + ts2.optionDeclarations = __spreadArray9(__spreadArray9([], ts2.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true); + ts2.semanticDiagnosticsOptionDeclarations = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsSemanticDiagnostics; + }); + ts2.affectsEmitOptionDeclarations = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsEmit; + }); + ts2.affectsDeclarationPathOptionDeclarations = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsDeclarationPath; + }); + ts2.moduleResolutionOptionDeclarations = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsModuleResolution; + }); + ts2.sourceFileAffectingCompilerOptions = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics; + }); + ts2.optionsAffectingProgramStructure = ts2.optionDeclarations.filter(function(option) { + return !!option.affectsProgramStructure; + }); + ts2.transpileOptionValueCompilerOptions = ts2.optionDeclarations.filter(function(option) { + return ts2.hasProperty(option, "transpileOptionValue"); + }); + ts2.optionsForBuild = [ + { + name: "verbose", + shortName: "v", + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Enable_verbose_logging, + type: "boolean", + defaultValueDescription: false + }, + { + name: "dry", + shortName: "d", + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean, + type: "boolean", + defaultValueDescription: false + }, + { + name: "force", + shortName: "f", + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date, + type: "boolean", + defaultValueDescription: false + }, + { + name: "clean", + category: ts2.Diagnostics.Command_line_Options, + description: ts2.Diagnostics.Delete_the_outputs_of_all_projects, + type: "boolean", + defaultValueDescription: false + } + ]; + ts2.buildOpts = __spreadArray9(__spreadArray9([], ts2.commonOptionsWithBuild, true), ts2.optionsForBuild, true); + ts2.typeAcquisitionDeclarations = [ + { + /* @deprecated typingOptions.enableAutoDiscovery + * Use typeAcquisition.enable instead. + */ + name: "enableAutoDiscovery", + type: "boolean", + defaultValueDescription: false + }, + { + name: "enable", + type: "boolean", + defaultValueDescription: false + }, + { + name: "include", + type: "list", + element: { + name: "include", + type: "string" + } + }, + { + name: "exclude", + type: "list", + element: { + name: "exclude", + type: "string" + } + }, + { + name: "disableFilenameBasedTypeAcquisition", + type: "boolean", + defaultValueDescription: false + } + ]; + function createOptionNameMap(optionDeclarations) { + var optionsNameMap = new ts2.Map(); + var shortOptionNames = new ts2.Map(); + ts2.forEach(optionDeclarations, function(option) { + optionsNameMap.set(option.name.toLowerCase(), option); + if (option.shortName) { + shortOptionNames.set(option.shortName, option.name); + } + }); + return { optionsNameMap, shortOptionNames }; + } + ts2.createOptionNameMap = createOptionNameMap; + var optionsNameMapCache; + function getOptionsNameMap() { + return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(ts2.optionDeclarations)); + } + ts2.getOptionsNameMap = getOptionsNameMap; + var compilerOptionsAlternateMode = { + diagnostic: ts2.Diagnostics.Compiler_option_0_may_only_be_used_with_build, + getOptionsNameMap: getBuildOptionsNameMap + }; + ts2.defaultInitCompilerOptions = { + module: ts2.ModuleKind.CommonJS, + target: 3, + strict: true, + esModuleInterop: true, + forceConsistentCasingInFileNames: true, + skipLibCheck: true + }; + function convertEnableAutoDiscoveryToEnable(typeAcquisition) { + if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== void 0 && typeAcquisition.enable === void 0) { + return { + enable: typeAcquisition.enableAutoDiscovery, + include: typeAcquisition.include || [], + exclude: typeAcquisition.exclude || [] + }; + } + return typeAcquisition; + } + ts2.convertEnableAutoDiscoveryToEnable = convertEnableAutoDiscoveryToEnable; + function createCompilerDiagnosticForInvalidCustomType(opt) { + return createDiagnosticForInvalidCustomType(opt, ts2.createCompilerDiagnostic); + } + ts2.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType; + function createDiagnosticForInvalidCustomType(opt, createDiagnostic) { + var namesOfType = ts2.arrayFrom(opt.type.keys()).map(function(key) { + return "'".concat(key, "'"); + }).join(", "); + return createDiagnostic(ts2.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType); + } + function parseCustomTypeOption(opt, value2, errors) { + return convertJsonOptionOfCustomType(opt, ts2.trimString(value2 || ""), errors); + } + ts2.parseCustomTypeOption = parseCustomTypeOption; + function parseListTypeOption(opt, value2, errors) { + if (value2 === void 0) { + value2 = ""; + } + value2 = ts2.trimString(value2); + if (ts2.startsWith(value2, "-")) { + return void 0; + } + if (value2 === "") { + return []; + } + var values2 = value2.split(","); + switch (opt.element.type) { + case "number": + return ts2.mapDefined(values2, function(v8) { + return validateJsonOptionValue(opt.element, parseInt(v8), errors); + }); + case "string": + return ts2.mapDefined(values2, function(v8) { + return validateJsonOptionValue(opt.element, v8 || "", errors); + }); + default: + return ts2.mapDefined(values2, function(v8) { + return parseCustomTypeOption(opt.element, v8, errors); + }); + } + } + ts2.parseListTypeOption = parseListTypeOption; + function getOptionName(option) { + return option.name; + } + function createUnknownOptionError(unknownOption, diagnostics, createDiagnostics, unknownOptionErrorText) { + var _a2; + if ((_a2 = diagnostics.alternateMode) === null || _a2 === void 0 ? void 0 : _a2.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) { + return createDiagnostics(diagnostics.alternateMode.diagnostic, unknownOption); + } + var possibleOption = ts2.getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName); + return possibleOption ? createDiagnostics(diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnostics(diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption); + } + function parseCommandLineWorker(diagnostics, commandLine, readFile2) { + var options = {}; + var watchOptions; + var fileNames = []; + var errors = []; + parseStrings(commandLine); + return { + options, + watchOptions, + fileNames, + errors + }; + function parseStrings(args) { + var i7 = 0; + while (i7 < args.length) { + var s7 = args[i7]; + i7++; + if (s7.charCodeAt(0) === 64) { + parseResponseFile(s7.slice(1)); + } else if (s7.charCodeAt(0) === 45) { + var inputOptionName = s7.slice(s7.charCodeAt(1) === 45 ? 2 : 1); + var opt = getOptionDeclarationFromName( + diagnostics.getOptionsNameMap, + inputOptionName, + /*allowShort*/ + true + ); + if (opt) { + i7 = parseOptionValue(args, i7, diagnostics, opt, options, errors); + } else { + var watchOpt = getOptionDeclarationFromName( + watchOptionsDidYouMeanDiagnostics.getOptionsNameMap, + inputOptionName, + /*allowShort*/ + true + ); + if (watchOpt) { + i7 = parseOptionValue(args, i7, watchOptionsDidYouMeanDiagnostics, watchOpt, watchOptions || (watchOptions = {}), errors); + } else { + errors.push(createUnknownOptionError(inputOptionName, diagnostics, ts2.createCompilerDiagnostic, s7)); + } + } + } else { + fileNames.push(s7); + } + } + } + function parseResponseFile(fileName) { + var text = tryReadFile(fileName, readFile2 || function(fileName2) { + return ts2.sys.readFile(fileName2); + }); + if (!ts2.isString(text)) { + errors.push(text); + return; + } + var args = []; + var pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= 32) + pos++; + if (pos >= text.length) + break; + var start = pos; + if (text.charCodeAt(start) === 34) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== 34) + pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } else { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); + } + } else { + while (text.charCodeAt(pos) > 32) + pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } + ts2.parseCommandLineWorker = parseCommandLineWorker; + function parseOptionValue(args, i7, diagnostics, opt, options, errors) { + if (opt.isTSConfigOnly) { + var optValue = args[i7]; + if (optValue === "null") { + options[opt.name] = void 0; + i7++; + } else if (opt.type === "boolean") { + if (optValue === "false") { + options[opt.name] = validateJsonOptionValue( + opt, + /*value*/ + false, + errors + ); + i7++; + } else { + if (optValue === "true") + i7++; + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, opt.name)); + } + } else { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, opt.name)); + if (optValue && !ts2.startsWith(optValue, "-")) + i7++; + } + } else { + if (!args[i7] && opt.type !== "boolean") { + errors.push(ts2.createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt))); + } + if (args[i7] !== "null") { + switch (opt.type) { + case "number": + options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i7]), errors); + i7++; + break; + case "boolean": + var optValue = args[i7]; + options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors); + if (optValue === "false" || optValue === "true") { + i7++; + } + break; + case "string": + options[opt.name] = validateJsonOptionValue(opt, args[i7] || "", errors); + i7++; + break; + case "list": + var result2 = parseListTypeOption(opt, args[i7], errors); + options[opt.name] = result2 || []; + if (result2) { + i7++; + } + break; + default: + options[opt.name] = parseCustomTypeOption(opt, args[i7], errors); + i7++; + break; + } + } else { + options[opt.name] = void 0; + i7++; + } + } + return i7; + } + ts2.compilerOptionsDidYouMeanDiagnostics = { + alternateMode: compilerOptionsAlternateMode, + getOptionsNameMap, + optionDeclarations: ts2.optionDeclarations, + unknownOptionDiagnostic: ts2.Diagnostics.Unknown_compiler_option_0, + unknownDidYouMeanDiagnostic: ts2.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: ts2.Diagnostics.Compiler_option_0_expects_an_argument + }; + function parseCommandLine(commandLine, readFile2) { + return parseCommandLineWorker(ts2.compilerOptionsDidYouMeanDiagnostics, commandLine, readFile2); + } + ts2.parseCommandLine = parseCommandLine; + function getOptionFromName(optionName, allowShort) { + return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort); + } + ts2.getOptionFromName = getOptionFromName; + function getOptionDeclarationFromName(getOptionNameMap, optionName, allowShort) { + if (allowShort === void 0) { + allowShort = false; + } + optionName = optionName.toLowerCase(); + var _a2 = getOptionNameMap(), optionsNameMap = _a2.optionsNameMap, shortOptionNames = _a2.shortOptionNames; + if (allowShort) { + var short = shortOptionNames.get(optionName); + if (short !== void 0) { + optionName = short; + } + } + return optionsNameMap.get(optionName); + } + var buildOptionsNameMapCache; + function getBuildOptionsNameMap() { + return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(ts2.buildOpts)); + } + var buildOptionsAlternateMode = { + diagnostic: ts2.Diagnostics.Compiler_option_0_may_not_be_used_with_build, + getOptionsNameMap + }; + var buildOptionsDidYouMeanDiagnostics = { + alternateMode: buildOptionsAlternateMode, + getOptionsNameMap: getBuildOptionsNameMap, + optionDeclarations: ts2.buildOpts, + unknownOptionDiagnostic: ts2.Diagnostics.Unknown_build_option_0, + unknownDidYouMeanDiagnostic: ts2.Diagnostics.Unknown_build_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: ts2.Diagnostics.Build_option_0_requires_a_value_of_type_1 + }; + function parseBuildCommand(args) { + var _a2 = parseCommandLineWorker(buildOptionsDidYouMeanDiagnostics, args), options = _a2.options, watchOptions = _a2.watchOptions, projects = _a2.fileNames, errors = _a2.errors; + var buildOptions2 = options; + if (projects.length === 0) { + projects.push("."); + } + if (buildOptions2.clean && buildOptions2.force) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force")); + } + if (buildOptions2.clean && buildOptions2.verbose) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose")); + } + if (buildOptions2.clean && buildOptions2.watch) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch")); + } + if (buildOptions2.watch && buildOptions2.dry) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry")); + } + return { buildOptions: buildOptions2, watchOptions, projects, errors }; + } + ts2.parseBuildCommand = parseBuildCommand; + function getDiagnosticText(_message) { + var _args = []; + for (var _i = 1; _i < arguments.length; _i++) { + _args[_i - 1] = arguments[_i]; + } + var diagnostic = ts2.createCompilerDiagnostic.apply(void 0, arguments); + return diagnostic.messageText; + } + ts2.getDiagnosticText = getDiagnosticText; + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, extraFileExtensions) { + var configFileText = tryReadFile(configFileName, function(fileName) { + return host.readFile(fileName); + }); + if (!ts2.isString(configFileText)) { + host.onUnRecoverableConfigFileDiagnostic(configFileText); + return void 0; + } + var result2 = ts2.parseJsonText(configFileName, configFileText); + var cwd3 = host.getCurrentDirectory(); + result2.path = ts2.toPath(configFileName, cwd3, ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames)); + result2.resolvedPath = result2.path; + result2.originalFileName = result2.fileName; + return parseJsonSourceFileConfigFileContent( + result2, + host, + ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(configFileName), cwd3), + optionsToExtend, + ts2.getNormalizedAbsolutePath(configFileName, cwd3), + /*resolutionStack*/ + void 0, + extraFileExtensions, + extendedConfigCache, + watchOptionsToExtend + ); + } + ts2.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile; + function readConfigFile(fileName, readFile2) { + var textOrDiagnostic = tryReadFile(fileName, readFile2); + return ts2.isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic }; + } + ts2.readConfigFile = readConfigFile; + function parseConfigFileTextToJson(fileName, jsonText) { + var jsonSourceFile = ts2.parseJsonText(fileName, jsonText); + return { + config: convertConfigFileToObject( + jsonSourceFile, + jsonSourceFile.parseDiagnostics, + /*reportOptionsErrors*/ + false, + /*optionsIterator*/ + void 0 + ), + error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0 + }; + } + ts2.parseConfigFileTextToJson = parseConfigFileTextToJson; + function readJsonConfigFile(fileName, readFile2) { + var textOrDiagnostic = tryReadFile(fileName, readFile2); + return ts2.isString(textOrDiagnostic) ? ts2.parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] }; + } + ts2.readJsonConfigFile = readJsonConfigFile; + function tryReadFile(fileName, readFile2) { + var text; + try { + text = readFile2(fileName); + } catch (e10) { + return ts2.createCompilerDiagnostic(ts2.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e10.message); + } + return text === void 0 ? ts2.createCompilerDiagnostic(ts2.Diagnostics.Cannot_read_file_0, fileName) : text; + } + ts2.tryReadFile = tryReadFile; + function commandLineOptionsToMap(options) { + return ts2.arrayToMap(options, getOptionName); + } + var typeAcquisitionDidYouMeanDiagnostics = { + optionDeclarations: ts2.typeAcquisitionDeclarations, + unknownOptionDiagnostic: ts2.Diagnostics.Unknown_type_acquisition_option_0, + unknownDidYouMeanDiagnostic: ts2.Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1 + }; + var watchOptionsNameMapCache; + function getWatchOptionsNameMap() { + return watchOptionsNameMapCache || (watchOptionsNameMapCache = createOptionNameMap(ts2.optionsForWatch)); + } + var watchOptionsDidYouMeanDiagnostics = { + getOptionsNameMap: getWatchOptionsNameMap, + optionDeclarations: ts2.optionsForWatch, + unknownOptionDiagnostic: ts2.Diagnostics.Unknown_watch_option_0, + unknownDidYouMeanDiagnostic: ts2.Diagnostics.Unknown_watch_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: ts2.Diagnostics.Watch_option_0_requires_a_value_of_type_1 + }; + var commandLineCompilerOptionsMapCache; + function getCommandLineCompilerOptionsMap() { + return commandLineCompilerOptionsMapCache || (commandLineCompilerOptionsMapCache = commandLineOptionsToMap(ts2.optionDeclarations)); + } + var commandLineWatchOptionsMapCache; + function getCommandLineWatchOptionsMap() { + return commandLineWatchOptionsMapCache || (commandLineWatchOptionsMapCache = commandLineOptionsToMap(ts2.optionsForWatch)); + } + var commandLineTypeAcquisitionMapCache; + function getCommandLineTypeAcquisitionMap() { + return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(ts2.typeAcquisitionDeclarations)); + } + var _tsconfigRootOptions; + function getTsconfigRootOptionsMap() { + if (_tsconfigRootOptions === void 0) { + _tsconfigRootOptions = { + name: void 0, + type: "object", + elementOptions: commandLineOptionsToMap([ + { + name: "compilerOptions", + type: "object", + elementOptions: getCommandLineCompilerOptionsMap(), + extraKeyDiagnostics: ts2.compilerOptionsDidYouMeanDiagnostics + }, + { + name: "watchOptions", + type: "object", + elementOptions: getCommandLineWatchOptionsMap(), + extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics + }, + { + name: "typingOptions", + type: "object", + elementOptions: getCommandLineTypeAcquisitionMap(), + extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics + }, + { + name: "typeAcquisition", + type: "object", + elementOptions: getCommandLineTypeAcquisitionMap(), + extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics + }, + { + name: "extends", + type: "string", + category: ts2.Diagnostics.File_Management + }, + { + name: "references", + type: "list", + element: { + name: "references", + type: "object" + }, + category: ts2.Diagnostics.Projects + }, + { + name: "files", + type: "list", + element: { + name: "files", + type: "string" + }, + category: ts2.Diagnostics.File_Management + }, + { + name: "include", + type: "list", + element: { + name: "include", + type: "string" + }, + category: ts2.Diagnostics.File_Management, + defaultValueDescription: ts2.Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk + }, + { + name: "exclude", + type: "list", + element: { + name: "exclude", + type: "string" + }, + category: ts2.Diagnostics.File_Management, + defaultValueDescription: ts2.Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified + }, + ts2.compileOnSaveCommandLineOption + ]) + }; + } + return _tsconfigRootOptions; + } + function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, optionsIterator) { + var _a2; + var rootExpression = (_a2 = sourceFile.statements[0]) === null || _a2 === void 0 ? void 0 : _a2.expression; + var knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0; + if (rootExpression && rootExpression.kind !== 207) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, rootExpression, ts2.Diagnostics.The_root_value_of_a_0_file_must_be_an_object, ts2.getBaseFileName(sourceFile.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json")); + if (ts2.isArrayLiteralExpression(rootExpression)) { + var firstObject = ts2.find(rootExpression.elements, ts2.isObjectLiteralExpression); + if (firstObject) { + return convertToObjectWorker( + sourceFile, + firstObject, + errors, + /*returnValue*/ + true, + knownRootOptions, + optionsIterator + ); + } + } + return {}; + } + return convertToObjectWorker( + sourceFile, + rootExpression, + errors, + /*returnValue*/ + true, + knownRootOptions, + optionsIterator + ); + } + function convertToObject(sourceFile, errors) { + var _a2; + return convertToObjectWorker( + sourceFile, + (_a2 = sourceFile.statements[0]) === null || _a2 === void 0 ? void 0 : _a2.expression, + errors, + /*returnValue*/ + true, + /*knownRootOptions*/ + void 0, + /*jsonConversionNotifier*/ + void 0 + ); + } + ts2.convertToObject = convertToObject; + function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue, knownRootOptions, jsonConversionNotifier) { + if (!rootExpression) { + return returnValue ? {} : void 0; + } + return convertPropertyValueToJson(rootExpression, knownRootOptions); + function isRootOptionMap(knownOptions) { + return knownRootOptions && knownRootOptions.elementOptions === knownOptions; + } + function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { + var result2 = returnValue ? {} : void 0; + var _loop_4 = function(element2) { + if (element2.kind !== 299) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, element2, ts2.Diagnostics.Property_assignment_expected)); + return "continue"; + } + if (element2.questionToken) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, element2.questionToken, ts2.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); + } + if (!isDoubleQuotedString(element2.name)) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, element2.name, ts2.Diagnostics.String_literal_with_double_quotes_expected)); + } + var textOfKey = ts2.isComputedNonLiteralName(element2.name) ? void 0 : ts2.getTextOfPropertyName(element2.name); + var keyText = textOfKey && ts2.unescapeLeadingUnderscores(textOfKey); + var option = keyText && knownOptions ? knownOptions.get(keyText) : void 0; + if (keyText && extraKeyDiagnostics && !option) { + if (knownOptions) { + errors.push(createUnknownOptionError(keyText, extraKeyDiagnostics, function(message, arg0, arg1) { + return ts2.createDiagnosticForNodeInSourceFile(sourceFile, element2.name, message, arg0, arg1); + })); + } else { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, element2.name, extraKeyDiagnostics.unknownOptionDiagnostic, keyText)); + } + } + var value2 = convertPropertyValueToJson(element2.initializer, option); + if (typeof keyText !== "undefined") { + if (returnValue) { + result2[keyText] = value2; + } + if (jsonConversionNotifier && // Current callbacks are only on known parent option or if we are setting values in the root + (parentOption || isRootOptionMap(knownOptions))) { + var isValidOptionValue = isCompilerOptionsValue(option, value2); + if (parentOption) { + if (isValidOptionValue) { + jsonConversionNotifier.onSetValidOptionKeyValueInParent(parentOption, option, value2); + } + } else if (isRootOptionMap(knownOptions)) { + if (isValidOptionValue) { + jsonConversionNotifier.onSetValidOptionKeyValueInRoot(keyText, element2.name, value2, element2.initializer); + } else if (!option) { + jsonConversionNotifier.onSetUnknownOptionKeyValueInRoot(keyText, element2.name, value2, element2.initializer); + } + } + } + } + }; + for (var _i = 0, _a2 = node.properties; _i < _a2.length; _i++) { + var element = _a2[_i]; + _loop_4(element); + } + return result2; + } + function convertArrayLiteralExpressionToJson(elements, elementOption) { + if (!returnValue) { + elements.forEach(function(element) { + return convertPropertyValueToJson(element, elementOption); + }); + return void 0; + } + return ts2.filter(elements.map(function(element) { + return convertPropertyValueToJson(element, elementOption); + }), function(v8) { + return v8 !== void 0; + }); + } + function convertPropertyValueToJson(valueExpression, option) { + var invalidReported; + switch (valueExpression.kind) { + case 110: + reportInvalidOptionValue(option && option.type !== "boolean"); + return validateValue( + /*value*/ + true + ); + case 95: + reportInvalidOptionValue(option && option.type !== "boolean"); + return validateValue( + /*value*/ + false + ); + case 104: + reportInvalidOptionValue(option && option.name === "extends"); + return validateValue( + /*value*/ + null + ); + case 10: + if (!isDoubleQuotedString(valueExpression)) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts2.Diagnostics.String_literal_with_double_quotes_expected)); + } + reportInvalidOptionValue(option && (ts2.isString(option.type) && option.type !== "string")); + var text = valueExpression.text; + if (option && !ts2.isString(option.type)) { + var customOption = option; + if (!customOption.type.has(text.toLowerCase())) { + errors.push(createDiagnosticForInvalidCustomType(customOption, function(message, arg0, arg1) { + return ts2.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1); + })); + invalidReported = true; + } + } + return validateValue(text); + case 8: + reportInvalidOptionValue(option && option.type !== "number"); + return validateValue(Number(valueExpression.text)); + case 221: + if (valueExpression.operator !== 40 || valueExpression.operand.kind !== 8) { + break; + } + reportInvalidOptionValue(option && option.type !== "number"); + return validateValue(-Number(valueExpression.operand.text)); + case 207: + reportInvalidOptionValue(option && option.type !== "object"); + var objectLiteralExpression = valueExpression; + if (option) { + var _a2 = option, elementOptions = _a2.elementOptions, extraKeyDiagnostics = _a2.extraKeyDiagnostics, optionName = _a2.name; + return validateValue(convertObjectLiteralExpressionToJson(objectLiteralExpression, elementOptions, extraKeyDiagnostics, optionName)); + } else { + return validateValue(convertObjectLiteralExpressionToJson( + objectLiteralExpression, + /* knownOptions*/ + void 0, + /*extraKeyDiagnosticMessage */ + void 0, + /*parentOption*/ + void 0 + )); + } + case 206: + reportInvalidOptionValue(option && option.type !== "list"); + return validateValue(convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element)); + } + if (option) { + reportInvalidOptionValue( + /*isError*/ + true + ); + } else { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts2.Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)); + } + return void 0; + function validateValue(value2) { + var _a3; + if (!invalidReported) { + var diagnostic = (_a3 = option === null || option === void 0 ? void 0 : option.extraValidation) === null || _a3 === void 0 ? void 0 : _a3.call(option, value2); + if (diagnostic) { + errors.push(ts2.createDiagnosticForNodeInSourceFile.apply(void 0, __spreadArray9([sourceFile, valueExpression], diagnostic, false))); + return void 0; + } + } + return value2; + } + function reportInvalidOptionValue(isError3) { + if (isError3) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, option.name, getCompilerOptionValueTypeString(option))); + invalidReported = true; + } + } + } + function isDoubleQuotedString(node) { + return ts2.isStringLiteral(node) && ts2.isStringDoubleQuoted(node, sourceFile); + } + } + ts2.convertToObjectWorker = convertToObjectWorker; + function getCompilerOptionValueTypeString(option) { + return option.type === "list" ? "Array" : ts2.isString(option.type) ? option.type : "string"; + } + function isCompilerOptionsValue(option, value2) { + if (option) { + if (isNullOrUndefined2(value2)) + return true; + if (option.type === "list") { + return ts2.isArray(value2); + } + var expectedType = ts2.isString(option.type) ? option.type : "string"; + return typeof value2 === expectedType; + } + return false; + } + function convertToTSConfig(configParseResult, configFileName, host) { + var _a2, _b, _c; + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames); + var files = ts2.map(ts2.filter(configParseResult.fileNames, !((_b = (_a2 = configParseResult.options.configFile) === null || _a2 === void 0 ? void 0 : _a2.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs) ? ts2.returnTrue : matchesSpecs(configFileName, configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs, configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs, host)), function(f8) { + return ts2.getRelativePathFromFile(ts2.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), ts2.getNormalizedAbsolutePath(f8, host.getCurrentDirectory()), getCanonicalFileName); + }); + var optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: ts2.getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames }); + var watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions); + var config3 = __assign16(__assign16({ compilerOptions: __assign16(__assign16({}, optionMapToObject(optionMap)), { showConfig: void 0, configFile: void 0, configFilePath: void 0, help: void 0, init: void 0, listFiles: void 0, listEmittedFiles: void 0, project: void 0, build: void 0, version: void 0 }), watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), references: ts2.map(configParseResult.projectReferences, function(r8) { + return __assign16(__assign16({}, r8), { path: r8.originalPath ? r8.originalPath : "", originalPath: void 0 }); + }), files: ts2.length(files) ? files : void 0 }, ((_c = configParseResult.options.configFile) === null || _c === void 0 ? void 0 : _c.configFileSpecs) ? { + include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs), + exclude: configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs + } : {}), { compileOnSave: !!configParseResult.compileOnSave ? true : void 0 }); + return config3; + } + ts2.convertToTSConfig = convertToTSConfig; + function optionMapToObject(optionMap) { + return __assign16({}, ts2.arrayFrom(optionMap.entries()).reduce(function(prev, cur) { + var _a2; + return __assign16(__assign16({}, prev), (_a2 = {}, _a2[cur[0]] = cur[1], _a2)); + }, {})); + } + function filterSameAsDefaultInclude(specs10) { + if (!ts2.length(specs10)) + return void 0; + if (ts2.length(specs10) !== 1) + return specs10; + if (specs10[0] === ts2.defaultIncludeSpec) + return void 0; + return specs10; + } + function matchesSpecs(path2, includeSpecs, excludeSpecs, host) { + if (!includeSpecs) + return ts2.returnTrue; + var patterns = ts2.getFileMatcherPatterns(path2, excludeSpecs, includeSpecs, host.useCaseSensitiveFileNames, host.getCurrentDirectory()); + var excludeRe = patterns.excludePattern && ts2.getRegexFromPattern(patterns.excludePattern, host.useCaseSensitiveFileNames); + var includeRe = patterns.includeFilePattern && ts2.getRegexFromPattern(patterns.includeFilePattern, host.useCaseSensitiveFileNames); + if (includeRe) { + if (excludeRe) { + return function(path3) { + return !(includeRe.test(path3) && !excludeRe.test(path3)); + }; + } + return function(path3) { + return !includeRe.test(path3); + }; + } + if (excludeRe) { + return function(path3) { + return excludeRe.test(path3); + }; + } + return ts2.returnTrue; + } + function getCustomTypeMapOfCommandLineOption(optionDefinition) { + if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean" || optionDefinition.type === "object") { + return void 0; + } else if (optionDefinition.type === "list") { + return getCustomTypeMapOfCommandLineOption(optionDefinition.element); + } else { + return optionDefinition.type; + } + } + function getNameOfCompilerOptionValue(value2, customTypeMap) { + return ts2.forEachEntry(customTypeMap, function(mapValue, key) { + if (mapValue === value2) { + return key; + } + }); + } + ts2.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue; + function serializeCompilerOptions(options, pathOptions) { + return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions); + } + function serializeWatchOptions(options) { + return serializeOptionBaseObject(options, getWatchOptionsNameMap()); + } + function serializeOptionBaseObject(options, _a2, pathOptions) { + var optionsNameMap = _a2.optionsNameMap; + var result2 = new ts2.Map(); + var getCanonicalFileName = pathOptions && ts2.createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames); + var _loop_5 = function(name3) { + if (ts2.hasProperty(options, name3)) { + if (optionsNameMap.has(name3) && (optionsNameMap.get(name3).category === ts2.Diagnostics.Command_line_Options || optionsNameMap.get(name3).category === ts2.Diagnostics.Output_Formatting)) { + return "continue"; + } + var value2 = options[name3]; + var optionDefinition = optionsNameMap.get(name3.toLowerCase()); + if (optionDefinition) { + var customTypeMap_1 = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap_1) { + if (pathOptions && optionDefinition.isFilePath) { + result2.set(name3, ts2.getRelativePathFromFile(pathOptions.configFilePath, ts2.getNormalizedAbsolutePath(value2, ts2.getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName)); + } else { + result2.set(name3, value2); + } + } else { + if (optionDefinition.type === "list") { + result2.set(name3, value2.map(function(element) { + return getNameOfCompilerOptionValue(element, customTypeMap_1); + })); + } else { + result2.set(name3, getNameOfCompilerOptionValue(value2, customTypeMap_1)); + } + } + } + } + }; + for (var name2 in options) { + _loop_5(name2); + } + return result2; + } + function getCompilerOptionsDiffValue(options, newLine) { + var compilerOptionsMap = getSerializedCompilerOption(options); + return getOverwrittenDefaultOptions(); + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function getOverwrittenDefaultOptions() { + var result2 = []; + var tab = makePadding(2); + commandOptionsWithoutBuild.forEach(function(cmd) { + if (!compilerOptionsMap.has(cmd.name)) { + return; + } + var newValue = compilerOptionsMap.get(cmd.name); + var defaultValue = getDefaultValueForOption(cmd); + if (newValue !== defaultValue) { + result2.push("".concat(tab).concat(cmd.name, ": ").concat(newValue)); + } else if (ts2.hasProperty(ts2.defaultInitCompilerOptions, cmd.name)) { + result2.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue)); + } + }); + return result2.join(newLine) + newLine; + } + } + ts2.getCompilerOptionsDiffValue = getCompilerOptionsDiffValue; + function getSerializedCompilerOption(options) { + var compilerOptions = ts2.extend(options, ts2.defaultInitCompilerOptions); + return serializeCompilerOptions(compilerOptions); + } + function generateTSConfig(options, fileNames, newLine) { + var compilerOptionsMap = getSerializedCompilerOption(options); + return writeConfigurations(); + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function isAllowedOptionForOutput(_a2) { + var category = _a2.category, name2 = _a2.name, isCommandLineOnly = _a2.isCommandLineOnly; + var categoriesToSkip = [ts2.Diagnostics.Command_line_Options, ts2.Diagnostics.Editor_Support, ts2.Diagnostics.Compiler_Diagnostics, ts2.Diagnostics.Backwards_Compatibility, ts2.Diagnostics.Watch_and_Build_Modes, ts2.Diagnostics.Output_Formatting]; + return !isCommandLineOnly && category !== void 0 && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name2)); + } + function writeConfigurations() { + var categorizedOptions = new ts2.Map(); + categorizedOptions.set(ts2.Diagnostics.Projects, []); + categorizedOptions.set(ts2.Diagnostics.Language_and_Environment, []); + categorizedOptions.set(ts2.Diagnostics.Modules, []); + categorizedOptions.set(ts2.Diagnostics.JavaScript_Support, []); + categorizedOptions.set(ts2.Diagnostics.Emit, []); + categorizedOptions.set(ts2.Diagnostics.Interop_Constraints, []); + categorizedOptions.set(ts2.Diagnostics.Type_Checking, []); + categorizedOptions.set(ts2.Diagnostics.Completeness, []); + for (var _i = 0, optionDeclarations_1 = ts2.optionDeclarations; _i < optionDeclarations_1.length; _i++) { + var option = optionDeclarations_1[_i]; + if (isAllowedOptionForOutput(option)) { + var listForCategory = categorizedOptions.get(option.category); + if (!listForCategory) + categorizedOptions.set(option.category, listForCategory = []); + listForCategory.push(option); + } + } + var marginLength = 0; + var seenKnownKeys = 0; + var entries = []; + categorizedOptions.forEach(function(options2, category) { + if (entries.length !== 0) { + entries.push({ value: "" }); + } + entries.push({ value: "/* ".concat(ts2.getLocaleSpecificMessage(category), " */") }); + for (var _i2 = 0, options_1 = options2; _i2 < options_1.length; _i2++) { + var option2 = options_1[_i2]; + var optionName = void 0; + if (compilerOptionsMap.has(option2.name)) { + optionName = '"'.concat(option2.name, '": ').concat(JSON.stringify(compilerOptionsMap.get(option2.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ","); + } else { + optionName = '// "'.concat(option2.name, '": ').concat(JSON.stringify(getDefaultValueForOption(option2)), ","); + } + entries.push({ + value: optionName, + description: "/* ".concat(option2.description && ts2.getLocaleSpecificMessage(option2.description) || option2.name, " */") + }); + marginLength = Math.max(optionName.length, marginLength); + } + }); + var tab = makePadding(2); + var result2 = []; + result2.push("{"); + result2.push("".concat(tab, '"compilerOptions": {')); + result2.push("".concat(tab).concat(tab, "/* ").concat(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file), " */")); + result2.push(""); + for (var _a2 = 0, entries_2 = entries; _a2 < entries_2.length; _a2++) { + var entry = entries_2[_a2]; + var value2 = entry.value, _b = entry.description, description7 = _b === void 0 ? "" : _b; + result2.push(value2 && "".concat(tab).concat(tab).concat(value2).concat(description7 && makePadding(marginLength - value2.length + 2) + description7)); + } + if (fileNames.length) { + result2.push("".concat(tab, "},")); + result2.push("".concat(tab, '"files": [')); + for (var i7 = 0; i7 < fileNames.length; i7++) { + result2.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i7])).concat(i7 === fileNames.length - 1 ? "" : ",")); + } + result2.push("".concat(tab, "]")); + } else { + result2.push("".concat(tab, "}")); + } + result2.push("}"); + return result2.join(newLine) + newLine; + } + } + ts2.generateTSConfig = generateTSConfig; + function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) { + var result2 = {}; + var optionsNameMap = getOptionsNameMap().optionsNameMap; + for (var name2 in options) { + if (ts2.hasProperty(options, name2)) { + result2[name2] = convertToOptionValueWithAbsolutePaths(optionsNameMap.get(name2.toLowerCase()), options[name2], toAbsolutePath); + } + } + if (result2.configFilePath) { + result2.configFilePath = toAbsolutePath(result2.configFilePath); + } + return result2; + } + ts2.convertToOptionsWithAbsolutePaths = convertToOptionsWithAbsolutePaths; + function convertToOptionValueWithAbsolutePaths(option, value2, toAbsolutePath) { + if (option && !isNullOrUndefined2(value2)) { + if (option.type === "list") { + var values2 = value2; + if (option.element.isFilePath && values2.length) { + return values2.map(toAbsolutePath); + } + } else if (option.isFilePath) { + return toAbsolutePath(value2); + } + } + return value2; + } + function parseJsonConfigFileContent(json2, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { + return parseJsonConfigFileContentWorker( + json2, + /*sourceFile*/ + void 0, + host, + basePath, + existingOptions, + existingWatchOptions, + configFileName, + resolutionStack, + extraFileExtensions, + extendedConfigCache + ); + } + ts2.parseJsonConfigFileContent = parseJsonConfigFileContent; + function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("parse", "parseJsonSourceFileConfigFileContent", { path: sourceFile.fileName }); + var result2 = parseJsonConfigFileContentWorker( + /*json*/ + void 0, + sourceFile, + host, + basePath, + existingOptions, + existingWatchOptions, + configFileName, + resolutionStack, + extraFileExtensions, + extendedConfigCache + ); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return result2; + } + ts2.parseJsonSourceFileConfigFileContent = parseJsonSourceFileConfigFileContent; + function setConfigFileInOptions(options, configFile) { + if (configFile) { + Object.defineProperty(options, "configFile", { enumerable: false, writable: false, value: configFile }); + } + } + ts2.setConfigFileInOptions = setConfigFileInOptions; + function isNullOrUndefined2(x7) { + return x7 === void 0 || x7 === null; + } + function directoryOfCombinedPath(fileName, basePath) { + return ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(fileName, basePath)); + } + ts2.defaultIncludeSpec = "**/*"; + function parseJsonConfigFileContentWorker(json2, sourceFile, host, basePath, existingOptions, existingWatchOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache) { + if (existingOptions === void 0) { + existingOptions = {}; + } + if (resolutionStack === void 0) { + resolutionStack = []; + } + if (extraFileExtensions === void 0) { + extraFileExtensions = []; + } + ts2.Debug.assert(json2 === void 0 && sourceFile !== void 0 || json2 !== void 0 && sourceFile === void 0); + var errors = []; + var parsedConfig = parseConfig2(json2, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); + var raw = parsedConfig.raw; + var options = ts2.extend(existingOptions, parsedConfig.options || {}); + var watchOptions = existingWatchOptions && parsedConfig.watchOptions ? ts2.extend(existingWatchOptions, parsedConfig.watchOptions) : parsedConfig.watchOptions || existingWatchOptions; + options.configFilePath = configFileName && ts2.normalizeSlashes(configFileName); + var configFileSpecs = getConfigFileSpecs(); + if (sourceFile) + sourceFile.configFileSpecs = configFileSpecs; + setConfigFileInOptions(options, sourceFile); + var basePathForFileNames = ts2.normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); + return { + options, + watchOptions, + fileNames: getFileNames(basePathForFileNames), + projectReferences: getProjectReferences(basePathForFileNames), + typeAcquisition: parsedConfig.typeAcquisition || getDefaultTypeAcquisition(), + raw, + errors, + // Wildcard directories (provided as part of a wildcard path) are stored in a + // file map that marks whether it was a regular wildcard match (with a `*` or `?` token), + // or a recursive directory. This information is used by filesystem watchers to monitor for + // new entries in these paths. + wildcardDirectories: getWildcardDirectories(configFileSpecs, basePathForFileNames, host.useCaseSensitiveFileNames), + compileOnSave: !!raw.compileOnSave + }; + function getConfigFileSpecs() { + var referencesOfRaw = getPropFromRaw("references", function(element) { + return typeof element === "object"; + }, "object"); + var filesSpecs = toPropValue(getSpecsFromRaw("files")); + if (filesSpecs) { + var hasZeroOrNoReferences = referencesOfRaw === "no-prop" || ts2.isArray(referencesOfRaw) && referencesOfRaw.length === 0; + var hasExtends = ts2.hasProperty(raw, "extends"); + if (filesSpecs.length === 0 && hasZeroOrNoReferences && !hasExtends) { + if (sourceFile) { + var fileName = configFileName || "tsconfig.json"; + var diagnosticMessage = ts2.Diagnostics.The_files_list_in_config_file_0_is_empty; + var nodeValue = ts2.firstDefined(ts2.getTsConfigPropArray(sourceFile, "files"), function(property2) { + return property2.initializer; + }); + var error2 = nodeValue ? ts2.createDiagnosticForNodeInSourceFile(sourceFile, nodeValue, diagnosticMessage, fileName) : ts2.createCompilerDiagnostic(diagnosticMessage, fileName); + errors.push(error2); + } else { + createCompilerDiagnosticOnlyIfJson(ts2.Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"); + } + } + } + var includeSpecs = toPropValue(getSpecsFromRaw("include")); + var excludeOfRaw = getSpecsFromRaw("exclude"); + var isDefaultIncludeSpec = false; + var excludeSpecs = toPropValue(excludeOfRaw); + if (excludeOfRaw === "no-prop" && raw.compilerOptions) { + var outDir = raw.compilerOptions.outDir; + var declarationDir = raw.compilerOptions.declarationDir; + if (outDir || declarationDir) { + excludeSpecs = [outDir, declarationDir].filter(function(d7) { + return !!d7; + }); + } + } + if (filesSpecs === void 0 && includeSpecs === void 0) { + includeSpecs = [ts2.defaultIncludeSpec]; + isDefaultIncludeSpec = true; + } + var validatedIncludeSpecs, validatedExcludeSpecs; + if (includeSpecs) { + validatedIncludeSpecs = validateSpecs( + includeSpecs, + errors, + /*disallowTrailingRecursion*/ + true, + sourceFile, + "include" + ); + } + if (excludeSpecs) { + validatedExcludeSpecs = validateSpecs( + excludeSpecs, + errors, + /*disallowTrailingRecursion*/ + false, + sourceFile, + "exclude" + ); + } + return { + filesSpecs, + includeSpecs, + excludeSpecs, + validatedFilesSpec: ts2.filter(filesSpecs, ts2.isString), + validatedIncludeSpecs, + validatedExcludeSpecs, + pathPatterns: void 0, + isDefaultIncludeSpec + }; + } + function getFileNames(basePath2) { + var fileNames = getFileNamesFromConfigSpecs(configFileSpecs, basePath2, options, host, extraFileExtensions); + if (shouldReportNoInputFiles(fileNames, canJsonReportNoInputFiles(raw), resolutionStack)) { + errors.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); + } + return fileNames; + } + function getProjectReferences(basePath2) { + var projectReferences; + var referencesOfRaw = getPropFromRaw("references", function(element) { + return typeof element === "object"; + }, "object"); + if (ts2.isArray(referencesOfRaw)) { + for (var _i = 0, referencesOfRaw_1 = referencesOfRaw; _i < referencesOfRaw_1.length; _i++) { + var ref = referencesOfRaw_1[_i]; + if (typeof ref.path !== "string") { + createCompilerDiagnosticOnlyIfJson(ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "reference.path", "string"); + } else { + (projectReferences || (projectReferences = [])).push({ + path: ts2.getNormalizedAbsolutePath(ref.path, basePath2), + originalPath: ref.path, + prepend: ref.prepend, + circular: ref.circular + }); + } + } + } + return projectReferences; + } + function toPropValue(specResult) { + return ts2.isArray(specResult) ? specResult : void 0; + } + function getSpecsFromRaw(prop) { + return getPropFromRaw(prop, ts2.isString, "string"); + } + function getPropFromRaw(prop, validateElement, elementTypeName) { + if (ts2.hasProperty(raw, prop) && !isNullOrUndefined2(raw[prop])) { + if (ts2.isArray(raw[prop])) { + var result2 = raw[prop]; + if (!sourceFile && !ts2.every(result2, validateElement)) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, elementTypeName)); + } + return result2; + } else { + createCompilerDiagnosticOnlyIfJson(ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, "Array"); + return "not-array"; + } + } + return "no-prop"; + } + function createCompilerDiagnosticOnlyIfJson(message, arg0, arg1) { + if (!sourceFile) { + errors.push(ts2.createCompilerDiagnostic(message, arg0, arg1)); + } + } + } + function isErrorNoInputFiles(error2) { + return error2.code === ts2.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; + } + function getErrorForNoInputFiles(_a2, configFileName) { + var includeSpecs = _a2.includeSpecs, excludeSpecs = _a2.excludeSpecs; + return ts2.createCompilerDiagnostic(ts2.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || [])); + } + function shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles, resolutionStack) { + return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0); + } + function canJsonReportNoInputFiles(raw) { + return !ts2.hasProperty(raw, "files") && !ts2.hasProperty(raw, "references"); + } + ts2.canJsonReportNoInputFiles = canJsonReportNoInputFiles; + function updateErrorForNoInputFiles(fileNames, configFileName, configFileSpecs, configParseDiagnostics, canJsonReportNoInutFiles) { + var existingErrors = configParseDiagnostics.length; + if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) { + configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); + } else { + ts2.filterMutate(configParseDiagnostics, function(error2) { + return !isErrorNoInputFiles(error2); + }); + } + return existingErrors !== configParseDiagnostics.length; + } + ts2.updateErrorForNoInputFiles = updateErrorForNoInputFiles; + function isSuccessfulParsedTsconfig(value2) { + return !!value2.options; + } + function parseConfig2(json2, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { + var _a2; + basePath = ts2.normalizeSlashes(basePath); + var resolvedPath = ts2.getNormalizedAbsolutePath(configFileName || "", basePath); + if (resolutionStack.indexOf(resolvedPath) >= 0) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, __spreadArray9(__spreadArray9([], resolutionStack, true), [resolvedPath], false).join(" -> "))); + return { raw: json2 || convertToObject(sourceFile, errors) }; + } + var ownConfig = json2 ? parseOwnConfigOfJson(json2, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); + if ((_a2 = ownConfig.options) === null || _a2 === void 0 ? void 0 : _a2.paths) { + ownConfig.options.pathsBasePath = basePath; + } + if (ownConfig.extendedConfigPath) { + resolutionStack = resolutionStack.concat([resolvedPath]); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, resolutionStack, errors, extendedConfigCache); + if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { + var baseRaw_1 = extendedConfig.raw; + var raw_1 = ownConfig.raw; + var relativeDifference_1; + var setPropertyInRawIfNotUndefined = function(propertyName) { + if (!raw_1[propertyName] && baseRaw_1[propertyName]) { + raw_1[propertyName] = ts2.map(baseRaw_1[propertyName], function(path2) { + return ts2.isRootedDiskPath(path2) ? path2 : ts2.combinePaths(relativeDifference_1 || (relativeDifference_1 = ts2.convertToRelativePath(ts2.getDirectoryPath(ownConfig.extendedConfigPath), basePath, ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames))), path2); + }); + } + }; + setPropertyInRawIfNotUndefined("include"); + setPropertyInRawIfNotUndefined("exclude"); + setPropertyInRawIfNotUndefined("files"); + if (raw_1.compileOnSave === void 0) { + raw_1.compileOnSave = baseRaw_1.compileOnSave; + } + ownConfig.options = ts2.assign({}, extendedConfig.options, ownConfig.options); + ownConfig.watchOptions = ownConfig.watchOptions && extendedConfig.watchOptions ? ts2.assign({}, extendedConfig.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || extendedConfig.watchOptions; + } + } + return ownConfig; + } + function parseOwnConfigOfJson(json2, host, basePath, configFileName, errors) { + if (ts2.hasProperty(json2, "excludes")) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); + } + var options = convertCompilerOptionsFromJsonWorker(json2.compilerOptions, basePath, errors, configFileName); + var typeAcquisition = convertTypeAcquisitionFromJsonWorker(json2.typeAcquisition || json2.typingOptions, basePath, errors, configFileName); + var watchOptions = convertWatchOptionsFromJsonWorker(json2.watchOptions, basePath, errors); + json2.compileOnSave = convertCompileOnSaveOptionFromJson(json2, basePath, errors); + var extendedConfigPath; + if (json2.extends) { + if (!ts2.isString(json2.extends)) { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", "string")); + } else { + var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; + extendedConfigPath = getExtendsConfigPath(json2.extends, host, newBase, errors, ts2.createCompilerDiagnostic); + } + } + return { raw: json2, options, watchOptions, typeAcquisition, extendedConfigPath }; + } + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { + var options = getDefaultCompilerOptions(configFileName); + var typeAcquisition, typingOptionstypeAcquisition; + var watchOptions; + var extendedConfigPath; + var rootCompilerOptions; + var optionsIterator = { + onSetValidOptionKeyValueInParent: function(parentOption, option, value2) { + var currentOption; + switch (parentOption) { + case "compilerOptions": + currentOption = options; + break; + case "watchOptions": + currentOption = watchOptions || (watchOptions = {}); + break; + case "typeAcquisition": + currentOption = typeAcquisition || (typeAcquisition = getDefaultTypeAcquisition(configFileName)); + break; + case "typingOptions": + currentOption = typingOptionstypeAcquisition || (typingOptionstypeAcquisition = getDefaultTypeAcquisition(configFileName)); + break; + default: + ts2.Debug.fail("Unknown option"); + } + currentOption[option.name] = normalizeOptionValue(option, basePath, value2); + }, + onSetValidOptionKeyValueInRoot: function(key, _keyNode, value2, valueNode) { + switch (key) { + case "extends": + var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; + extendedConfigPath = getExtendsConfigPath(value2, host, newBase, errors, function(message, arg0) { + return ts2.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); + }); + return; + } + }, + onSetUnknownOptionKeyValueInRoot: function(key, keyNode, _value, _valueNode) { + if (key === "excludes") { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, keyNode, ts2.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); + } + if (ts2.find(commandOptionsWithoutBuild, function(opt) { + return opt.name === key; + })) { + rootCompilerOptions = ts2.append(rootCompilerOptions, keyNode); + } + } + }; + var json2 = convertConfigFileToObject( + sourceFile, + errors, + /*reportOptionsErrors*/ + true, + optionsIterator + ); + if (!typeAcquisition) { + if (typingOptionstypeAcquisition) { + typeAcquisition = typingOptionstypeAcquisition.enableAutoDiscovery !== void 0 ? { + enable: typingOptionstypeAcquisition.enableAutoDiscovery, + include: typingOptionstypeAcquisition.include, + exclude: typingOptionstypeAcquisition.exclude + } : typingOptionstypeAcquisition; + } else { + typeAcquisition = getDefaultTypeAcquisition(configFileName); + } + } + if (rootCompilerOptions && json2 && json2.compilerOptions === void 0) { + errors.push(ts2.createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], ts2.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, ts2.getTextOfPropertyName(rootCompilerOptions[0]))); + } + return { raw: json2, options, watchOptions, typeAcquisition, extendedConfigPath }; + } + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { + extendedConfig = ts2.normalizeSlashes(extendedConfig); + if (ts2.isRootedDiskPath(extendedConfig) || ts2.startsWith(extendedConfig, "./") || ts2.startsWith(extendedConfig, "../")) { + var extendedConfigPath = ts2.getNormalizedAbsolutePath(extendedConfig, basePath); + if (!host.fileExists(extendedConfigPath) && !ts2.endsWith( + extendedConfigPath, + ".json" + /* Extension.Json */ + )) { + extendedConfigPath = "".concat(extendedConfigPath, ".json"); + if (!host.fileExists(extendedConfigPath)) { + errors.push(createDiagnostic(ts2.Diagnostics.File_0_not_found, extendedConfig)); + return void 0; + } + } + return extendedConfigPath; + } + var resolved = ts2.nodeModuleNameResolver( + extendedConfig, + ts2.combinePaths(basePath, "tsconfig.json"), + { moduleResolution: ts2.ModuleResolutionKind.NodeJs }, + host, + /*cache*/ + void 0, + /*projectRefs*/ + void 0, + /*lookupConfig*/ + true + ); + if (resolved.resolvedModule) { + return resolved.resolvedModule.resolvedFileName; + } + errors.push(createDiagnostic(ts2.Diagnostics.File_0_not_found, extendedConfig)); + return void 0; + } + function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache) { + var _a2; + var path2 = host.useCaseSensitiveFileNames ? extendedConfigPath : ts2.toFileNameLowerCase(extendedConfigPath); + var value2; + var extendedResult; + var extendedConfig; + if (extendedConfigCache && (value2 = extendedConfigCache.get(path2))) { + extendedResult = value2.extendedResult, extendedConfig = value2.extendedConfig; + } else { + extendedResult = readJsonConfigFile(extendedConfigPath, function(path3) { + return host.readFile(path3); + }); + if (!extendedResult.parseDiagnostics.length) { + extendedConfig = parseConfig2( + /*json*/ + void 0, + extendedResult, + host, + ts2.getDirectoryPath(extendedConfigPath), + ts2.getBaseFileName(extendedConfigPath), + resolutionStack, + errors, + extendedConfigCache + ); + } + if (extendedConfigCache) { + extendedConfigCache.set(path2, { extendedResult, extendedConfig }); + } + } + if (sourceFile) { + sourceFile.extendedSourceFiles = [extendedResult.fileName]; + if (extendedResult.extendedSourceFiles) { + (_a2 = sourceFile.extendedSourceFiles).push.apply(_a2, extendedResult.extendedSourceFiles); + } + } + if (extendedResult.parseDiagnostics.length) { + errors.push.apply(errors, extendedResult.parseDiagnostics); + return void 0; + } + return extendedConfig; + } + function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { + if (!ts2.hasProperty(jsonOption, ts2.compileOnSaveCommandLineOption.name)) { + return false; + } + var result2 = convertJsonOption(ts2.compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors); + return typeof result2 === "boolean" && result2; + } + function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) { + var errors = []; + var options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options, errors }; + } + ts2.convertCompilerOptionsFromJson = convertCompilerOptionsFromJson; + function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) { + var errors = []; + var options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options, errors }; + } + ts2.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; + function getDefaultCompilerOptions(configFileName) { + var options = configFileName && ts2.getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; + return options; + } + function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + var options = getDefaultCompilerOptions(configFileName); + convertOptionsFromJson(getCommandLineCompilerOptionsMap(), jsonOptions, basePath, options, ts2.compilerOptionsDidYouMeanDiagnostics, errors); + if (configFileName) { + options.configFilePath = ts2.normalizeSlashes(configFileName); + } + return options; + } + function getDefaultTypeAcquisition(configFileName) { + return { enable: !!configFileName && ts2.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; + } + function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + var options = getDefaultTypeAcquisition(configFileName); + var typeAcquisition = convertEnableAutoDiscoveryToEnable(jsonOptions); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), typeAcquisition, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + return options; + } + function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { + return convertOptionsFromJson( + getCommandLineWatchOptionsMap(), + jsonOptions, + basePath, + /*defaultOptions*/ + void 0, + watchOptionsDidYouMeanDiagnostics, + errors + ); + } + function convertOptionsFromJson(optionsNameMap, jsonOptions, basePath, defaultOptions9, diagnostics, errors) { + if (!jsonOptions) { + return; + } + for (var id in jsonOptions) { + var opt = optionsNameMap.get(id); + if (opt) { + (defaultOptions9 || (defaultOptions9 = {}))[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); + } else { + errors.push(createUnknownOptionError(id, diagnostics, ts2.createCompilerDiagnostic)); + } + } + return defaultOptions9; + } + function convertJsonOption(opt, value2, basePath, errors) { + if (isCompilerOptionsValue(opt, value2)) { + var optType = opt.type; + if (optType === "list" && ts2.isArray(value2)) { + return convertJsonOptionOfListType(opt, value2, basePath, errors); + } else if (!ts2.isString(optType)) { + return convertJsonOptionOfCustomType(opt, value2, errors); + } + var validatedValue = validateJsonOptionValue(opt, value2, errors); + return isNullOrUndefined2(validatedValue) ? validatedValue : normalizeNonListOptionValue(opt, basePath, validatedValue); + } else { + errors.push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, getCompilerOptionValueTypeString(opt))); + } + } + ts2.convertJsonOption = convertJsonOption; + function normalizeOptionValue(option, basePath, value2) { + if (isNullOrUndefined2(value2)) + return void 0; + if (option.type === "list") { + var listOption_1 = option; + if (listOption_1.element.isFilePath || !ts2.isString(listOption_1.element.type)) { + return ts2.filter(ts2.map(value2, function(v8) { + return normalizeOptionValue(listOption_1.element, basePath, v8); + }), function(v8) { + return listOption_1.listPreserveFalsyValues ? true : !!v8; + }); + } + return value2; + } else if (!ts2.isString(option.type)) { + return option.type.get(ts2.isString(value2) ? value2.toLowerCase() : value2); + } + return normalizeNonListOptionValue(option, basePath, value2); + } + function normalizeNonListOptionValue(option, basePath, value2) { + if (option.isFilePath) { + value2 = ts2.getNormalizedAbsolutePath(value2, basePath); + if (value2 === "") { + value2 = "."; + } + } + return value2; + } + function validateJsonOptionValue(opt, value2, errors) { + var _a2; + if (isNullOrUndefined2(value2)) + return void 0; + var d7 = (_a2 = opt.extraValidation) === null || _a2 === void 0 ? void 0 : _a2.call(opt, value2); + if (!d7) + return value2; + errors.push(ts2.createCompilerDiagnostic.apply(void 0, d7)); + return void 0; + } + function convertJsonOptionOfCustomType(opt, value2, errors) { + if (isNullOrUndefined2(value2)) + return void 0; + var key = value2.toLowerCase(); + var val = opt.type.get(key); + if (val !== void 0) { + return validateJsonOptionValue(opt, val, errors); + } else { + errors.push(createCompilerDiagnosticForInvalidCustomType(opt)); + } + } + function convertJsonOptionOfListType(option, values2, basePath, errors) { + return ts2.filter(ts2.map(values2, function(v8) { + return convertJsonOption(option.element, v8, basePath, errors); + }), function(v8) { + return option.listPreserveFalsyValues ? true : !!v8; + }); + } + var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; + var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; + function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions) { + if (extraFileExtensions === void 0) { + extraFileExtensions = ts2.emptyArray; + } + basePath = ts2.normalizePath(basePath); + var keyMapper = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames); + var literalFileMap = new ts2.Map(); + var wildcardFileMap = new ts2.Map(); + var wildCardJsonFileMap = new ts2.Map(); + var validatedFilesSpec = configFileSpecs.validatedFilesSpec, validatedIncludeSpecs = configFileSpecs.validatedIncludeSpecs, validatedExcludeSpecs = configFileSpecs.validatedExcludeSpecs; + var supportedExtensions = ts2.getSupportedExtensions(options, extraFileExtensions); + var supportedExtensionsWithJsonIfResolveJsonModule = ts2.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); + if (validatedFilesSpec) { + for (var _i = 0, validatedFilesSpec_1 = validatedFilesSpec; _i < validatedFilesSpec_1.length; _i++) { + var fileName = validatedFilesSpec_1[_i]; + var file = ts2.getNormalizedAbsolutePath(fileName, basePath); + literalFileMap.set(keyMapper(file), file); + } + } + var jsonOnlyIncludeRegexes; + if (validatedIncludeSpecs && validatedIncludeSpecs.length > 0) { + var _loop_6 = function(file2) { + if (ts2.fileExtensionIs( + file2, + ".json" + /* Extension.Json */ + )) { + if (!jsonOnlyIncludeRegexes) { + var includes2 = validatedIncludeSpecs.filter(function(s7) { + return ts2.endsWith( + s7, + ".json" + /* Extension.Json */ + ); + }); + var includeFilePatterns = ts2.map(ts2.getRegularExpressionsForWildcards(includes2, basePath, "files"), function(pattern5) { + return "^".concat(pattern5, "$"); + }); + jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function(pattern5) { + return ts2.getRegexFromPattern(pattern5, host.useCaseSensitiveFileNames); + }) : ts2.emptyArray; + } + var includeIndex = ts2.findIndex(jsonOnlyIncludeRegexes, function(re4) { + return re4.test(file2); + }); + if (includeIndex !== -1) { + var key_1 = keyMapper(file2); + if (!literalFileMap.has(key_1) && !wildCardJsonFileMap.has(key_1)) { + wildCardJsonFileMap.set(key_1, file2); + } + } + return "continue"; + } + if (hasFileWithHigherPriorityExtension(file2, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { + return "continue"; + } + removeWildcardFilesWithLowerPriorityExtension(file2, wildcardFileMap, supportedExtensions, keyMapper); + var key = keyMapper(file2); + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file2); + } + }; + for (var _a2 = 0, _b = host.readDirectory( + basePath, + ts2.flatten(supportedExtensionsWithJsonIfResolveJsonModule), + validatedExcludeSpecs, + validatedIncludeSpecs, + /*depth*/ + void 0 + ); _a2 < _b.length; _a2++) { + var file = _b[_a2]; + _loop_6(file); + } + } + var literalFiles = ts2.arrayFrom(literalFileMap.values()); + var wildcardFiles = ts2.arrayFrom(wildcardFileMap.values()); + return literalFiles.concat(wildcardFiles, ts2.arrayFrom(wildCardJsonFileMap.values())); + } + ts2.getFileNamesFromConfigSpecs = getFileNamesFromConfigSpecs; + function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames, currentDirectory) { + var validatedFilesSpec = spec.validatedFilesSpec, validatedIncludeSpecs = spec.validatedIncludeSpecs, validatedExcludeSpecs = spec.validatedExcludeSpecs; + if (!ts2.length(validatedIncludeSpecs) || !ts2.length(validatedExcludeSpecs)) + return false; + basePath = ts2.normalizePath(basePath); + var keyMapper = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + if (validatedFilesSpec) { + for (var _i = 0, validatedFilesSpec_2 = validatedFilesSpec; _i < validatedFilesSpec_2.length; _i++) { + var fileName = validatedFilesSpec_2[_i]; + if (keyMapper(ts2.getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck) + return false; + } + } + return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath); + } + ts2.isExcludedFile = isExcludedFile; + function invalidDotDotAfterRecursiveWildcard(s7) { + var wildcardIndex = ts2.startsWith(s7, "**/") ? 0 : s7.indexOf("/**/"); + if (wildcardIndex === -1) { + return false; + } + var lastDotIndex = ts2.endsWith(s7, "/..") ? s7.length : s7.lastIndexOf("/../"); + return lastDotIndex > wildcardIndex; + } + function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) { + return matchesExcludeWorker(pathToCheck, ts2.filter(excludeSpecs, function(spec) { + return !invalidDotDotAfterRecursiveWildcard(spec); + }), useCaseSensitiveFileNames, currentDirectory); + } + ts2.matchesExclude = matchesExclude; + function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) { + var excludePattern = ts2.getRegularExpressionForWildcard(excludeSpecs, ts2.combinePaths(ts2.normalizePath(currentDirectory), basePath), "exclude"); + var excludeRegex = excludePattern && ts2.getRegexFromPattern(excludePattern, useCaseSensitiveFileNames); + if (!excludeRegex) + return false; + if (excludeRegex.test(pathToCheck)) + return true; + return !ts2.hasExtension(pathToCheck) && excludeRegex.test(ts2.ensureTrailingDirectorySeparator(pathToCheck)); + } + function validateSpecs(specs10, errors, disallowTrailingRecursion, jsonSourceFile, specKey) { + return specs10.filter(function(spec) { + if (!ts2.isString(spec)) + return false; + var diag = specToDiagnostic(spec, disallowTrailingRecursion); + if (diag !== void 0) { + errors.push(createDiagnostic.apply(void 0, diag)); + } + return diag === void 0; + }); + function createDiagnostic(message, spec) { + var element = ts2.getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec); + return element ? ts2.createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec) : ts2.createCompilerDiagnostic(message, spec); + } + } + function specToDiagnostic(spec, disallowTrailingRecursion) { + if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return [ts2.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; + } else if (invalidDotDotAfterRecursiveWildcard(spec)) { + return [ts2.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; + } + } + function getWildcardDirectories(_a2, path2, useCaseSensitiveFileNames) { + var include = _a2.validatedIncludeSpecs, exclude = _a2.validatedExcludeSpecs; + var rawExcludeRegex = ts2.getRegularExpressionForWildcard(exclude, path2, "exclude"); + var excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); + var wildcardDirectories = {}; + if (include !== void 0) { + var recursiveKeys = []; + for (var _i = 0, include_1 = include; _i < include_1.length; _i++) { + var file = include_1[_i]; + var spec = ts2.normalizePath(ts2.combinePaths(path2, file)); + if (excludeRegex && excludeRegex.test(spec)) { + continue; + } + var match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames); + if (match) { + var key = match.key, flags = match.flags; + var existingFlags = wildcardDirectories[key]; + if (existingFlags === void 0 || existingFlags < flags) { + wildcardDirectories[key] = flags; + if (flags === 1) { + recursiveKeys.push(key); + } + } + } + } + for (var key in wildcardDirectories) { + if (ts2.hasProperty(wildcardDirectories, key)) { + for (var _b = 0, recursiveKeys_1 = recursiveKeys; _b < recursiveKeys_1.length; _b++) { + var recursiveKey = recursiveKeys_1[_b]; + if (key !== recursiveKey && ts2.containsPath(recursiveKey, key, path2, !useCaseSensitiveFileNames)) { + delete wildcardDirectories[key]; + } + } + } + } + } + return wildcardDirectories; + } + function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames) { + var match = wildcardDirectoryPattern.exec(spec); + if (match) { + var questionWildcardIndex = spec.indexOf("?"); + var starWildcardIndex = spec.indexOf("*"); + var lastDirectorySeperatorIndex = spec.lastIndexOf(ts2.directorySeparator); + return { + key: useCaseSensitiveFileNames ? match[0] : ts2.toFileNameLowerCase(match[0]), + flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 : 0 + /* WatchDirectoryFlags.None */ + }; + } + if (ts2.isImplicitGlob(spec.substring(spec.lastIndexOf(ts2.directorySeparator) + 1))) { + return { + key: ts2.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts2.toFileNameLowerCase(spec)), + flags: 1 + /* WatchDirectoryFlags.Recursive */ + }; + } + return void 0; + } + function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions6, keyMapper) { + var extensionGroup = ts2.forEach(extensions6, function(group2) { + return ts2.fileExtensionIsOneOf(file, group2) ? group2 : void 0; + }); + if (!extensionGroup) { + return false; + } + for (var _i = 0, extensionGroup_1 = extensionGroup; _i < extensionGroup_1.length; _i++) { + var ext = extensionGroup_1[_i]; + if (ts2.fileExtensionIs(file, ext)) { + return false; + } + var higherPriorityPath = keyMapper(ts2.changeExtension(file, ext)); + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { + if (ext === ".d.ts" && (ts2.fileExtensionIs( + file, + ".js" + /* Extension.Js */ + ) || ts2.fileExtensionIs( + file, + ".jsx" + /* Extension.Jsx */ + ))) { + continue; + } + return true; + } + } + return false; + } + function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions6, keyMapper) { + var extensionGroup = ts2.forEach(extensions6, function(group2) { + return ts2.fileExtensionIsOneOf(file, group2) ? group2 : void 0; + }); + if (!extensionGroup) { + return; + } + for (var i7 = extensionGroup.length - 1; i7 >= 0; i7--) { + var ext = extensionGroup[i7]; + if (ts2.fileExtensionIs(file, ext)) { + return; + } + var lowerPriorityPath = keyMapper(ts2.changeExtension(file, ext)); + wildcardFiles.delete(lowerPriorityPath); + } + } + function convertCompilerOptionsForTelemetry(opts) { + var out = {}; + for (var key in opts) { + if (ts2.hasProperty(opts, key)) { + var type3 = getOptionFromName(key); + if (type3 !== void 0) { + out[key] = getOptionValueWithEmptyStrings(opts[key], type3); + } + } + } + return out; + } + ts2.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry; + function getOptionValueWithEmptyStrings(value2, option) { + switch (option.type) { + case "object": + return ""; + case "string": + return ""; + case "number": + return typeof value2 === "number" ? value2 : ""; + case "boolean": + return typeof value2 === "boolean" ? value2 : ""; + case "list": + var elementType_1 = option.element; + return ts2.isArray(value2) ? value2.map(function(v8) { + return getOptionValueWithEmptyStrings(v8, elementType_1); + }) : ""; + default: + return ts2.forEachEntry(option.type, function(optionEnumValue, optionStringValue) { + if (optionEnumValue === value2) { + return optionStringValue; + } + }); + } + } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + var defaultValue = option.defaultValueDescription; + return option.isFilePath ? "./".concat(defaultValue && typeof defaultValue === "string" ? defaultValue : "") : ""; + case "list": + return []; + case "object": + return {}; + default: + var iterResult = option.type.keys().next(); + if (!iterResult.done) + return iterResult.value; + return ts2.Debug.fail("Expected 'option.type' to have entries."); + } + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function trace2(host) { + host.trace(ts2.formatMessage.apply(void 0, arguments)); + } + ts2.trace = trace2; + function isTraceEnabled(compilerOptions, host) { + return !!compilerOptions.traceResolution && host.trace !== void 0; + } + ts2.isTraceEnabled = isTraceEnabled; + function withPackageId(packageInfo, r8) { + var packageId; + if (r8 && packageInfo) { + var packageJsonContent = packageInfo.contents.packageJsonContent; + if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") { + packageId = { + name: packageJsonContent.name, + subModuleName: r8.path.slice(packageInfo.packageDirectory.length + ts2.directorySeparator.length), + version: packageJsonContent.version + }; + } + } + return r8 && { path: r8.path, extension: r8.ext, packageId }; + } + function noPackageId(r8) { + return withPackageId( + /*packageInfo*/ + void 0, + r8 + ); + } + function removeIgnoredPackageId(r8) { + if (r8) { + ts2.Debug.assert(r8.packageId === void 0); + return { path: r8.path, ext: r8.extension }; + } + } + var Extensions6; + (function(Extensions7) { + Extensions7[Extensions7["TypeScript"] = 0] = "TypeScript"; + Extensions7[Extensions7["JavaScript"] = 1] = "JavaScript"; + Extensions7[Extensions7["Json"] = 2] = "Json"; + Extensions7[Extensions7["TSConfig"] = 3] = "TSConfig"; + Extensions7[Extensions7["DtsOnly"] = 4] = "DtsOnly"; + Extensions7[Extensions7["TsOnly"] = 5] = "TsOnly"; + })(Extensions6 || (Extensions6 = {})); + function resolvedTypeScriptOnly(resolved) { + if (!resolved) { + return void 0; + } + ts2.Debug.assert(ts2.extensionIsTS(resolved.extension)); + return { fileName: resolved.path, packageId: resolved.packageId }; + } + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { + var _a2, _b; + if (resultFromCache) { + (_a2 = resultFromCache.failedLookupLocations).push.apply(_a2, failedLookupLocations); + (_b = resultFromCache.affectingLocations).push.apply(_b, affectingLocations); + return resultFromCache; + } + return { + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId }, + failedLookupLocations, + affectingLocations, + resolutionDiagnostics: diagnostics + }; + } + function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) { + if (!ts2.hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_does_not_have_a_0_field, fieldName); + } + return; + } + var value2 = jsonContent[fieldName]; + if (typeof value2 !== typeOfTag || value2 === null) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, typeOfTag, value2 === null ? "null" : typeof value2); + } + return; + } + return value2; + } + function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { + var fileName = readPackageJsonField(jsonContent, fieldName, "string", state); + if (fileName === void 0) { + return; + } + if (!fileName) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_had_a_falsy_0_field, fieldName); + } + return; + } + var path2 = ts2.normalizePath(ts2.combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path2); + } + return path2; + } + function readPackageJsonTypesFields(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) || readPackageJsonPathField(jsonContent, "types", baseDirectory, state); + } + function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "tsconfig", baseDirectory, state); + } + function readPackageJsonMainField(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "main", baseDirectory, state); + } + function readPackageJsonTypesVersionsField(jsonContent, state) { + var typesVersions = readPackageJsonField(jsonContent, "typesVersions", "object", state); + if (typesVersions === void 0) + return; + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings); + } + return typesVersions; + } + function readPackageJsonTypesVersionPaths(jsonContent, state) { + var typesVersions = readPackageJsonTypesVersionsField(jsonContent, state); + if (typesVersions === void 0) + return; + if (state.traceEnabled) { + for (var key in typesVersions) { + if (ts2.hasProperty(typesVersions, key) && !ts2.VersionRange.tryParse(key)) { + trace2(state.host, ts2.Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, key); + } + } + } + var result2 = getPackageJsonTypesVersionsPaths(typesVersions); + if (!result2) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, ts2.versionMajorMinor); + } + return; + } + var bestVersionKey = result2.version, bestVersionPaths = result2.paths; + if (typeof bestVersionPaths !== "object") { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths); + } + return; + } + return result2; + } + var typeScriptVersion; + function getPackageJsonTypesVersionsPaths(typesVersions) { + if (!typeScriptVersion) + typeScriptVersion = new ts2.Version(ts2.version); + for (var key in typesVersions) { + if (!ts2.hasProperty(typesVersions, key)) + continue; + var keyRange = ts2.VersionRange.tryParse(key); + if (keyRange === void 0) { + continue; + } + if (keyRange.test(typeScriptVersion)) { + return { version: key, paths: typesVersions[key] }; + } + } + } + ts2.getPackageJsonTypesVersionsPaths = getPackageJsonTypesVersionsPaths; + function getEffectiveTypeRoots(options, host) { + if (options.typeRoots) { + return options.typeRoots; + } + var currentDirectory; + if (options.configFilePath) { + currentDirectory = ts2.getDirectoryPath(options.configFilePath); + } else if (host.getCurrentDirectory) { + currentDirectory = host.getCurrentDirectory(); + } + if (currentDirectory !== void 0) { + return getDefaultTypeRoots(currentDirectory, host); + } + } + ts2.getEffectiveTypeRoots = getEffectiveTypeRoots; + function getDefaultTypeRoots(currentDirectory, host) { + if (!host.directoryExists) { + return [ts2.combinePaths(currentDirectory, nodeModulesAtTypes)]; + } + var typeRoots; + ts2.forEachAncestorDirectory(ts2.normalizePath(currentDirectory), function(directory) { + var atTypes = ts2.combinePaths(directory, nodeModulesAtTypes); + if (host.directoryExists(atTypes)) { + (typeRoots || (typeRoots = [])).push(atTypes); + } + return void 0; + }); + return typeRoots; + } + var nodeModulesAtTypes = ts2.combinePaths("node_modules", "@types"); + function arePathsEqual(path1, path2, host) { + var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; + return ts2.comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0; + } + function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { + ts2.Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); + var traceEnabled = isTraceEnabled(options, host); + if (redirectedReference) { + options = redirectedReference.commandLine.options; + } + var containingDirectory = containingFile ? ts2.getDirectoryPath(containingFile) : void 0; + var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : void 0; + var result2 = perFolderCache && perFolderCache.get( + typeReferenceDirectiveName, + /*mode*/ + resolutionMode + ); + if (result2) { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile); + if (redirectedReference) + trace2(host, ts2.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + trace2(host, ts2.Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, containingDirectory); + traceResult(result2); + } + return result2; + } + var typeRoots = getEffectiveTypeRoots(options, host); + if (traceEnabled) { + if (containingFile === void 0) { + if (typeRoots === void 0) { + trace2(host, ts2.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName); + } else { + trace2(host, ts2.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots); + } + } else { + if (typeRoots === void 0) { + trace2(host, ts2.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile); + } else { + trace2(host, ts2.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots); + } + } + if (redirectedReference) { + trace2(host, ts2.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + } + } + var failedLookupLocations = []; + var affectingLocations = []; + var features3 = getDefaultNodeResolutionFeatures(options); + if (resolutionMode === ts2.ModuleKind.ESNext && (ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.NodeNext)) { + features3 |= NodeResolutionFeatures.EsmMode; + } + var conditions = features3 & NodeResolutionFeatures.Exports ? features3 & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : []; + var diagnostics = []; + var moduleResolutionState = { + compilerOptions: options, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: features3, + conditions, + requestContainingDirectory: containingDirectory, + reportDiagnostic: function(diag) { + return void diagnostics.push(diag); + } + }; + var resolved = primaryLookup(); + var primary = true; + if (!resolved) { + resolved = secondaryLookup(); + primary = false; + } + var resolvedTypeReferenceDirective; + if (resolved) { + var fileName = resolved.fileName, packageId = resolved.packageId; + var resolvedFileName = options.preserveSymlinks ? fileName : realPath(fileName, host, traceEnabled); + var pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + resolvedTypeReferenceDirective = { + primary, + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName, + packageId, + isExternalLibraryImport: pathContainsNodeModules(fileName) + }; + } + result2 = { resolvedTypeReferenceDirective, failedLookupLocations, affectingLocations, resolutionDiagnostics: diagnostics }; + perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set( + typeReferenceDirectiveName, + /*mode*/ + resolutionMode, + result2 + ); + if (traceEnabled) + traceResult(result2); + return result2; + function traceResult(result3) { + var _a2; + if (!((_a2 = result3.resolvedTypeReferenceDirective) === null || _a2 === void 0 ? void 0 : _a2.resolvedFileName)) { + trace2(host, ts2.Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); + } else if (result3.resolvedTypeReferenceDirective.packageId) { + trace2(host, ts2.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result3.resolvedTypeReferenceDirective.resolvedFileName, ts2.packageIdToString(result3.resolvedTypeReferenceDirective.packageId), result3.resolvedTypeReferenceDirective.primary); + } else { + trace2(host, ts2.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result3.resolvedTypeReferenceDirective.resolvedFileName, result3.resolvedTypeReferenceDirective.primary); + } + } + function primaryLookup() { + if (typeRoots && typeRoots.length) { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); + } + return ts2.firstDefined(typeRoots, function(typeRoot) { + var candidate = ts2.combinePaths(typeRoot, typeReferenceDirectiveName); + var candidateDirectory = ts2.getDirectoryPath(candidate); + var directoryExists = ts2.directoryProbablyExists(candidateDirectory, host); + if (!directoryExists && traceEnabled) { + trace2(host, ts2.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidateDirectory); + } + return resolvedTypeScriptOnly(loadNodeModuleFromDirectory(Extensions6.DtsOnly, candidate, !directoryExists, moduleResolutionState)); + }); + } else { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths); + } + } + } + function secondaryLookup() { + var initialLocationForSecondaryLookup = containingFile && ts2.getDirectoryPath(containingFile); + if (initialLocationForSecondaryLookup !== void 0) { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); + } + var result_4; + if (!ts2.isExternalModuleNameRelative(typeReferenceDirectiveName)) { + var searchResult = loadModuleFromNearestNodeModulesDirectory( + Extensions6.DtsOnly, + typeReferenceDirectiveName, + initialLocationForSecondaryLookup, + moduleResolutionState, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + result_4 = searchResult && searchResult.value; + } else { + var candidate = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName).path; + result_4 = nodeLoadModuleByRelativeName( + Extensions6.DtsOnly, + candidate, + /*onlyRecordFailures*/ + false, + moduleResolutionState, + /*considerPackageJson*/ + true + ); + } + return resolvedTypeScriptOnly(result_4); + } else { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder); + } + } + } + } + ts2.resolveTypeReferenceDirective = resolveTypeReferenceDirective; + function getDefaultNodeResolutionFeatures(options) { + return ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default : ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : NodeResolutionFeatures.None; + } + function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { + var moduleResolutionState = getTemporaryModuleResolutionState(cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(), host, options); + return ts2.forEachAncestorDirectory(containingDirectory, function(ancestorDirectory) { + if (ts2.getBaseFileName(ancestorDirectory) !== "node_modules") { + var nodeModulesFolder = ts2.combinePaths(ancestorDirectory, "node_modules"); + var candidate = ts2.combinePaths(nodeModulesFolder, packageName); + return getPackageJsonInfo( + candidate, + /*onlyRecordFailures*/ + false, + moduleResolutionState + ); + } + }); + } + ts2.resolvePackageNameToPackageJson = resolvePackageNameToPackageJson; + function getAutomaticTypeDirectiveNames(options, host) { + if (options.types) { + return options.types; + } + var result2 = []; + if (host.directoryExists && host.getDirectories) { + var typeRoots = getEffectiveTypeRoots(options, host); + if (typeRoots) { + for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) { + var root2 = typeRoots_1[_i]; + if (host.directoryExists(root2)) { + for (var _a2 = 0, _b = host.getDirectories(root2); _a2 < _b.length; _a2++) { + var typeDirectivePath = _b[_a2]; + var normalized = ts2.normalizePath(typeDirectivePath); + var packageJsonPath = ts2.combinePaths(root2, normalized, "package.json"); + var isNotNeededPackage = host.fileExists(packageJsonPath) && ts2.readJson(packageJsonPath, host).typings === null; + if (!isNotNeededPackage) { + var baseFileName = ts2.getBaseFileName(normalized); + if (baseFileName.charCodeAt(0) !== 46) { + result2.push(baseFileName); + } + } + } + } + } + } + } + return result2; + } + ts2.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; + function createCacheWithRedirects(options) { + var ownMap = new ts2.Map(); + var redirectsMap = new ts2.Map(); + return { + getOwnMap, + redirectsMap, + getOrCreateMapOfCacheRedirects, + clear: clear2, + setOwnOptions, + setOwnMap + }; + function getOwnMap() { + return ownMap; + } + function setOwnOptions(newOptions) { + options = newOptions; + } + function setOwnMap(newOwnMap) { + ownMap = newOwnMap; + } + function getOrCreateMapOfCacheRedirects(redirectedReference) { + if (!redirectedReference) { + return ownMap; + } + var path2 = redirectedReference.sourceFile.path; + var redirects = redirectsMap.get(path2); + if (!redirects) { + redirects = !options || ts2.optionsHaveModuleResolutionChanges(options, redirectedReference.commandLine.options) ? new ts2.Map() : ownMap; + redirectsMap.set(path2, redirects); + } + return redirects; + } + function clear2() { + ownMap.clear(); + redirectsMap.clear(); + } + } + ts2.createCacheWithRedirects = createCacheWithRedirects; + function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) { + var cache; + return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear2, entries, getInternalMap }; + function getPackageJsonInfo2(packageJsonPath) { + return cache === null || cache === void 0 ? void 0 : cache.get(ts2.toPath(packageJsonPath, currentDirectory, getCanonicalFileName)); + } + function setPackageJsonInfo(packageJsonPath, info2) { + (cache || (cache = new ts2.Map())).set(ts2.toPath(packageJsonPath, currentDirectory, getCanonicalFileName), info2); + } + function clear2() { + cache = void 0; + } + function entries() { + var iter = cache === null || cache === void 0 ? void 0 : cache.entries(); + return iter ? ts2.arrayFrom(iter) : []; + } + function getInternalMap() { + return cache; + } + } + function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create2) { + var cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference); + var result2 = cache.get(key); + if (!result2) { + result2 = create2(); + cache.set(key, result2); + } + return result2; + } + function updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap) { + if (!options.configFile) + return; + if (directoryToModuleNameMap.redirectsMap.size === 0) { + ts2.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size === 0); + ts2.Debug.assert(directoryToModuleNameMap.getOwnMap().size === 0); + ts2.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.getOwnMap().size === 0); + directoryToModuleNameMap.redirectsMap.set(options.configFile.path, directoryToModuleNameMap.getOwnMap()); + moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.redirectsMap.set(options.configFile.path, moduleNameToDirectoryMap.getOwnMap()); + } else { + ts2.Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size > 0); + var ref = { + sourceFile: options.configFile, + commandLine: { options } + }; + directoryToModuleNameMap.setOwnMap(directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref)); + moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.setOwnMap(moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref)); + } + directoryToModuleNameMap.setOwnOptions(options); + moduleNameToDirectoryMap === null || moduleNameToDirectoryMap === void 0 ? void 0 : moduleNameToDirectoryMap.setOwnOptions(options); + } + function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap) { + return { + getOrCreateCacheForDirectory, + clear: clear2, + update: update2 + }; + function clear2() { + directoryToModuleNameMap.clear(); + } + function update2(options) { + updateRedirectsMap(options, directoryToModuleNameMap); + } + function getOrCreateCacheForDirectory(directoryName, redirectedReference) { + var path2 = ts2.toPath(directoryName, currentDirectory, getCanonicalFileName); + return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path2, function() { + return createModeAwareCache(); + }); + } + } + function createModeAwareCache() { + var underlying = new ts2.Map(); + var memoizedReverseKeys = new ts2.Map(); + var cache = { + get: function(specifier, mode) { + return underlying.get(getUnderlyingCacheKey(specifier, mode)); + }, + set: function(specifier, mode, value2) { + underlying.set(getUnderlyingCacheKey(specifier, mode), value2); + return cache; + }, + delete: function(specifier, mode) { + underlying.delete(getUnderlyingCacheKey(specifier, mode)); + return cache; + }, + has: function(specifier, mode) { + return underlying.has(getUnderlyingCacheKey(specifier, mode)); + }, + forEach: function(cb) { + return underlying.forEach(function(elem, key) { + var _a2 = memoizedReverseKeys.get(key), specifier = _a2[0], mode = _a2[1]; + return cb(elem, specifier, mode); + }); + }, + size: function() { + return underlying.size; + } + }; + return cache; + function getUnderlyingCacheKey(specifier, mode) { + var result2 = mode === void 0 ? specifier : "".concat(mode, "|").concat(specifier); + memoizedReverseKeys.set(result2, [specifier, mode]); + return result2; + } + } + ts2.createModeAwareCache = createModeAwareCache; + function zipToModeAwareCache(file, keys2, values2) { + ts2.Debug.assert(keys2.length === values2.length); + var map4 = createModeAwareCache(); + for (var i7 = 0; i7 < keys2.length; ++i7) { + var entry = keys2[i7]; + var name2 = !ts2.isString(entry) ? entry.fileName.toLowerCase() : entry; + var mode = !ts2.isString(entry) ? entry.resolutionMode || file.impliedNodeFormat : ts2.getModeForResolutionAtIndex(file, i7); + map4.set(name2, mode, values2[i7]); + } + return map4; + } + ts2.zipToModeAwareCache = zipToModeAwareCache; + function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, directoryToModuleNameMap, moduleNameToDirectoryMap) { + var perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); + moduleNameToDirectoryMap || (moduleNameToDirectoryMap = createCacheWithRedirects(options)); + var packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName); + return __assign16(__assign16(__assign16({}, packageJsonInfoCache), perDirectoryResolutionCache), { getOrCreateCacheForModuleName, clear: clear2, update: update2, getPackageJsonInfoCache: function() { + return packageJsonInfoCache; + }, clearAllExceptPackageJsonInfoCache }); + function clear2() { + clearAllExceptPackageJsonInfoCache(); + packageJsonInfoCache.clear(); + } + function clearAllExceptPackageJsonInfoCache() { + perDirectoryResolutionCache.clear(); + moduleNameToDirectoryMap.clear(); + } + function update2(options2) { + updateRedirectsMap(options2, directoryToModuleNameMap, moduleNameToDirectoryMap); + } + function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) { + ts2.Debug.assert(!ts2.isExternalModuleNameRelative(nonRelativeModuleName)); + return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === void 0 ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache); + } + function createPerModuleNameCache() { + var directoryPathMap = new ts2.Map(); + return { get: get4, set: set4 }; + function get4(directory) { + return directoryPathMap.get(ts2.toPath(directory, currentDirectory, getCanonicalFileName)); + } + function set4(directory, result2) { + var path2 = ts2.toPath(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.has(path2)) { + return; + } + directoryPathMap.set(path2, result2); + var resolvedFileName = result2.resolvedModule && (result2.resolvedModule.originalPath || result2.resolvedModule.resolvedFileName); + var commonPrefix = resolvedFileName && getCommonPrefix(path2, resolvedFileName); + var current = path2; + while (current !== commonPrefix) { + var parent2 = ts2.getDirectoryPath(current); + if (parent2 === current || directoryPathMap.has(parent2)) { + break; + } + directoryPathMap.set(parent2, result2); + current = parent2; + } + } + function getCommonPrefix(directory, resolution) { + var resolutionDirectory = ts2.toPath(ts2.getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + var i7 = 0; + var limit = Math.min(directory.length, resolutionDirectory.length); + while (i7 < limit && directory.charCodeAt(i7) === resolutionDirectory.charCodeAt(i7)) { + i7++; + } + if (i7 === directory.length && (resolutionDirectory.length === i7 || resolutionDirectory[i7] === ts2.directorySeparator)) { + return directory; + } + var rootLength = ts2.getRootLength(directory); + if (i7 < rootLength) { + return void 0; + } + var sep2 = directory.lastIndexOf(ts2.directorySeparator, i7 - 1); + if (sep2 === -1) { + return void 0; + } + return directory.substr(0, Math.max(sep2, rootLength)); + } + } + } + ts2.createModuleResolutionCache = createModuleResolutionCache; + function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, directoryToModuleNameMap) { + var perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap || (directoryToModuleNameMap = createCacheWithRedirects(options))); + packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName)); + return __assign16(__assign16(__assign16({}, packageJsonInfoCache), perDirectoryResolutionCache), { clear: clear2, clearAllExceptPackageJsonInfoCache }); + function clear2() { + clearAllExceptPackageJsonInfoCache(); + packageJsonInfoCache.clear(); + } + function clearAllExceptPackageJsonInfoCache() { + perDirectoryResolutionCache.clear(); + } + } + ts2.createTypeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache; + function resolveModuleNameFromCache(moduleName3, containingFile, cache, mode) { + var containingDirectory = ts2.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory); + if (!perFolderCache) + return void 0; + return perFolderCache.get(moduleName3, mode); + } + ts2.resolveModuleNameFromCache = resolveModuleNameFromCache; + function resolveModuleName(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + if (redirectedReference) { + compilerOptions = redirectedReference.commandLine.options; + } + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Resolving_module_0_from_1, moduleName3, containingFile); + if (redirectedReference) { + trace2(host, ts2.Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + } + } + var containingDirectory = ts2.getDirectoryPath(containingFile); + var perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference); + var result2 = perFolderCache && perFolderCache.get(moduleName3, resolutionMode); + if (result2) { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName3, containingDirectory); + } + } else { + var moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === void 0) { + switch (ts2.getEmitModuleKind(compilerOptions)) { + case ts2.ModuleKind.CommonJS: + moduleResolution = ts2.ModuleResolutionKind.NodeJs; + break; + case ts2.ModuleKind.Node16: + moduleResolution = ts2.ModuleResolutionKind.Node16; + break; + case ts2.ModuleKind.NodeNext: + moduleResolution = ts2.ModuleResolutionKind.NodeNext; + break; + default: + moduleResolution = ts2.ModuleResolutionKind.Classic; + break; + } + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Module_resolution_kind_is_not_specified_using_0, ts2.ModuleResolutionKind[moduleResolution]); + } + } else { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ts2.ModuleResolutionKind[moduleResolution]); + } + } + ts2.perfLogger.logStartResolveModule( + moduleName3 + /* , containingFile, ModuleResolutionKind[moduleResolution]*/ + ); + switch (moduleResolution) { + case ts2.ModuleResolutionKind.Node16: + result2 = node16ModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + break; + case ts2.ModuleResolutionKind.NodeNext: + result2 = nodeNextModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + break; + case ts2.ModuleResolutionKind.NodeJs: + result2 = nodeModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference); + break; + case ts2.ModuleResolutionKind.Classic: + result2 = classicNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference); + break; + default: + return ts2.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution)); + } + if (result2 && result2.resolvedModule) + ts2.perfLogger.logInfoEvent('Module "'.concat(moduleName3, '" resolved to "').concat(result2.resolvedModule.resolvedFileName, '"')); + ts2.perfLogger.logStopResolveModule(result2 && result2.resolvedModule ? "" + result2.resolvedModule.resolvedFileName : "null"); + if (perFolderCache) { + perFolderCache.set(moduleName3, resolutionMode, result2); + if (!ts2.isExternalModuleNameRelative(moduleName3)) { + cache.getOrCreateCacheForModuleName(moduleName3, resolutionMode, redirectedReference).set(containingDirectory, result2); + } + } + } + if (traceEnabled) { + if (result2.resolvedModule) { + if (result2.resolvedModule.packageId) { + trace2(host, ts2.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName3, result2.resolvedModule.resolvedFileName, ts2.packageIdToString(result2.resolvedModule.packageId)); + } else { + trace2(host, ts2.Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName3, result2.resolvedModule.resolvedFileName); + } + } else { + trace2(host, ts2.Diagnostics.Module_name_0_was_not_resolved, moduleName3); + } + } + return result2; + } + ts2.resolveModuleName = resolveModuleName; + function tryLoadModuleUsingOptionalResolutionSettings(extensions6, moduleName3, containingDirectory, loader2, state) { + var resolved = tryLoadModuleUsingPathsIfEligible(extensions6, moduleName3, loader2, state); + if (resolved) + return resolved.value; + if (!ts2.isExternalModuleNameRelative(moduleName3)) { + return tryLoadModuleUsingBaseUrl(extensions6, moduleName3, loader2, state); + } else { + return tryLoadModuleUsingRootDirs(extensions6, moduleName3, containingDirectory, loader2, state); + } + } + function tryLoadModuleUsingPathsIfEligible(extensions6, moduleName3, loader2, state) { + var _a2; + var _b = state.compilerOptions, baseUrl = _b.baseUrl, paths = _b.paths, configFile = _b.configFile; + if (paths && !ts2.pathIsRelative(moduleName3)) { + if (state.traceEnabled) { + if (baseUrl) { + trace2(state.host, ts2.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName3); + } + trace2(state.host, ts2.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName3); + } + var baseDirectory = ts2.getPathsBasePath(state.compilerOptions, state.host); + var pathPatterns = (configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) ? (_a2 = configFile.configFileSpecs).pathPatterns || (_a2.pathPatterns = ts2.tryParsePatterns(paths)) : void 0; + return tryLoadModuleUsingPaths( + extensions6, + moduleName3, + baseDirectory, + paths, + pathPatterns, + loader2, + /*onlyRecordFailures*/ + false, + state + ); + } + } + function tryLoadModuleUsingRootDirs(extensions6, moduleName3, containingDirectory, loader2, state) { + if (!state.compilerOptions.rootDirs) { + return void 0; + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName3); + } + var candidate = ts2.normalizePath(ts2.combinePaths(containingDirectory, moduleName3)); + var matchedRootDir; + var matchedNormalizedPrefix; + for (var _i = 0, _a2 = state.compilerOptions.rootDirs; _i < _a2.length; _i++) { + var rootDir = _a2[_i]; + var normalizedRoot = ts2.normalizePath(rootDir); + if (!ts2.endsWith(normalizedRoot, ts2.directorySeparator)) { + normalizedRoot += ts2.directorySeparator; + } + var isLongestMatchingPrefix = ts2.startsWith(candidate, normalizedRoot) && (matchedNormalizedPrefix === void 0 || matchedNormalizedPrefix.length < normalizedRoot.length); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); + } + if (isLongestMatchingPrefix) { + matchedNormalizedPrefix = normalizedRoot; + matchedRootDir = rootDir; + } + } + if (matchedNormalizedPrefix) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); + } + var suffix = candidate.substr(matchedNormalizedPrefix.length); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); + } + var resolvedFileName = loader2(extensions6, candidate, !ts2.directoryProbablyExists(containingDirectory, state.host), state); + if (resolvedFileName) { + return resolvedFileName; + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Trying_other_entries_in_rootDirs); + } + for (var _b = 0, _c = state.compilerOptions.rootDirs; _b < _c.length; _b++) { + var rootDir = _c[_b]; + if (rootDir === matchedRootDir) { + continue; + } + var candidate_1 = ts2.combinePaths(ts2.normalizePath(rootDir), suffix); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate_1); + } + var baseDirectory = ts2.getDirectoryPath(candidate_1); + var resolvedFileName_1 = loader2(extensions6, candidate_1, !ts2.directoryProbablyExists(baseDirectory, state.host), state); + if (resolvedFileName_1) { + return resolvedFileName_1; + } + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Module_resolution_using_rootDirs_has_failed); + } + } + return void 0; + } + function tryLoadModuleUsingBaseUrl(extensions6, moduleName3, loader2, state) { + var baseUrl = state.compilerOptions.baseUrl; + if (!baseUrl) { + return void 0; + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName3); + } + var candidate = ts2.normalizePath(ts2.combinePaths(baseUrl, moduleName3)); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName3, baseUrl, candidate); + } + return loader2(extensions6, candidate, !ts2.directoryProbablyExists(ts2.getDirectoryPath(candidate), state.host), state); + } + function resolveJSModule(moduleName3, initialDir, host) { + var _a2 = tryResolveJSModuleWorker(moduleName3, initialDir, host), resolvedModule = _a2.resolvedModule, failedLookupLocations = _a2.failedLookupLocations; + if (!resolvedModule) { + throw new Error("Could not resolve JS module '".concat(moduleName3, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", "))); + } + return resolvedModule.resolvedFileName; + } + ts2.resolveJSModule = resolveJSModule; + var NodeResolutionFeatures; + (function(NodeResolutionFeatures2) { + NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports"; + NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports"; + NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; + NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default"; + NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30] = "NodeNextDefault"; + NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode"; + })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); + function node16ModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + } + function nodeNextModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + } + var jsOnlyExtensions = [Extensions6.JavaScript]; + var tsExtensions = [Extensions6.TypeScript, Extensions6.JavaScript]; + var tsPlusJsonExtensions = __spreadArray9(__spreadArray9([], tsExtensions, true), [Extensions6.Json], false); + var tsconfigExtensions = [Extensions6.TSConfig]; + function nodeNextModuleNameResolverWorker(features3, moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + var containingDirectory = ts2.getDirectoryPath(containingFile); + var esmMode = resolutionMode === ts2.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0; + var extensions6 = compilerOptions.noDtsResolution ? [Extensions6.TsOnly, Extensions6.JavaScript] : tsExtensions; + if (compilerOptions.resolveJsonModule) { + extensions6 = __spreadArray9(__spreadArray9([], extensions6, true), [Extensions6.Json], false); + } + return nodeModuleNameResolverWorker(features3 | esmMode, moduleName3, containingDirectory, compilerOptions, host, cache, extensions6, redirectedReference); + } + function tryResolveJSModuleWorker(moduleName3, initialDir, host) { + return nodeModuleNameResolverWorker( + NodeResolutionFeatures.None, + moduleName3, + initialDir, + { moduleResolution: ts2.ModuleResolutionKind.NodeJs, allowJs: true }, + host, + /*cache*/ + void 0, + jsOnlyExtensions, + /*redirectedReferences*/ + void 0 + ); + } + function nodeModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) { + var extensions6; + if (lookupConfig) { + extensions6 = tsconfigExtensions; + } else if (compilerOptions.noDtsResolution) { + extensions6 = [Extensions6.TsOnly]; + if (compilerOptions.allowJs) + extensions6.push(Extensions6.JavaScript); + if (compilerOptions.resolveJsonModule) + extensions6.push(Extensions6.Json); + } else { + extensions6 = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions; + } + return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName3, ts2.getDirectoryPath(containingFile), compilerOptions, host, cache, extensions6, redirectedReference); + } + ts2.nodeModuleNameResolver = nodeModuleNameResolver; + function nodeModuleNameResolverWorker(features3, moduleName3, containingDirectory, compilerOptions, host, cache, extensions6, redirectedReference) { + var _a2, _b; + var traceEnabled = isTraceEnabled(compilerOptions, host); + var failedLookupLocations = []; + var affectingLocations = []; + var conditions = features3 & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]; + if (compilerOptions.noDtsResolution) { + conditions.pop(); + } + var diagnostics = []; + var state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: features3, + conditions, + requestContainingDirectory: containingDirectory, + reportDiagnostic: function(diag) { + return void diagnostics.push(diag); + } + }; + if (traceEnabled && ts2.getEmitModuleResolutionKind(compilerOptions) >= ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(compilerOptions) <= ts2.ModuleResolutionKind.NodeNext) { + trace2(host, ts2.Diagnostics.Resolving_in_0_mode_with_conditions_1, features3 & NodeResolutionFeatures.EsmMode ? "ESM" : "CJS", conditions.map(function(c7) { + return "'".concat(c7, "'"); + }).join(", ")); + } + var result2 = ts2.forEach(extensions6, function(ext) { + return tryResolve(ext); + }); + return createResolvedModuleWithFailedLookupLocations((_a2 = result2 === null || result2 === void 0 ? void 0 : result2.value) === null || _a2 === void 0 ? void 0 : _a2.resolved, (_b = result2 === null || result2 === void 0 ? void 0 : result2.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state.resultFromCache); + function tryResolve(extensions7) { + var loader2 = function(extensions8, candidate2, onlyRecordFailures, state2) { + return nodeLoadModuleByRelativeName( + extensions8, + candidate2, + onlyRecordFailures, + state2, + /*considerPackageJson*/ + true + ); + }; + var resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions7, moduleName3, containingDirectory, loader2, state); + if (resolved) { + return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); + } + if (!ts2.isExternalModuleNameRelative(moduleName3)) { + var resolved_1; + if (features3 & NodeResolutionFeatures.Imports && ts2.startsWith(moduleName3, "#")) { + resolved_1 = loadModuleFromImports(extensions7, moduleName3, containingDirectory, state, cache, redirectedReference); + } + if (!resolved_1 && features3 & NodeResolutionFeatures.SelfName) { + resolved_1 = loadModuleFromSelfNameReference(extensions7, moduleName3, containingDirectory, state, cache, redirectedReference); + } + if (!resolved_1) { + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1, moduleName3, Extensions6[extensions7]); + } + resolved_1 = loadModuleFromNearestNodeModulesDirectory(extensions7, moduleName3, containingDirectory, state, cache, redirectedReference); + } + if (!resolved_1) + return void 0; + var resolvedValue = resolved_1.value; + if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { + var path2 = realPath(resolvedValue.path, host, traceEnabled); + var pathsAreEqual = arePathsEqual(path2, resolvedValue.path, host); + var originalPath = pathsAreEqual ? void 0 : resolvedValue.path; + resolvedValue = __assign16(__assign16({}, resolvedValue), { path: pathsAreEqual ? resolvedValue.path : path2, originalPath }); + } + return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + } else { + var _a3 = normalizePathForCJSResolution(containingDirectory, moduleName3), candidate = _a3.path, parts = _a3.parts; + var resolved_2 = nodeLoadModuleByRelativeName( + extensions7, + candidate, + /*onlyRecordFailures*/ + false, + state, + /*considerPackageJson*/ + true + ); + return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts2.contains(parts, "node_modules") }); + } + } + } + function normalizePathForCJSResolution(containingDirectory, moduleName3) { + var combined = ts2.combinePaths(containingDirectory, moduleName3); + var parts = ts2.getPathComponents(combined); + var lastPart = ts2.lastOrUndefined(parts); + var path2 = lastPart === "." || lastPart === ".." ? ts2.ensureTrailingDirectorySeparator(ts2.normalizePath(combined)) : ts2.normalizePath(combined); + return { path: path2, parts }; + } + function realPath(path2, host, traceEnabled) { + if (!host.realpath) { + return path2; + } + var real = ts2.normalizePath(host.realpath(path2)); + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Resolving_real_path_for_0_result_1, path2, real); + } + ts2.Debug.assert(host.fileExists(real), "".concat(path2, " linked to nonexistent file ").concat(real)); + return real; + } + function nodeLoadModuleByRelativeName(extensions6, candidate, onlyRecordFailures, state, considerPackageJson) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions6[extensions6]); + } + if (!ts2.hasTrailingDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + var parentOfCandidate = ts2.getDirectoryPath(candidate); + if (!ts2.directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + var resolvedFromFile = loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state); + if (resolvedFromFile) { + var packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : void 0; + var packageInfo = packageDirectory ? getPackageJsonInfo( + packageDirectory, + /*onlyRecordFailures*/ + false, + state + ) : void 0; + return withPackageId(packageInfo, resolvedFromFile); + } + } + if (!onlyRecordFailures) { + var candidateExists = ts2.directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + if (!(state.features & NodeResolutionFeatures.EsmMode)) { + return loadNodeModuleFromDirectory(extensions6, candidate, onlyRecordFailures, state, considerPackageJson); + } + return void 0; + } + ts2.nodeModulesPathPart = "/node_modules/"; + function pathContainsNodeModules(path2) { + return ts2.stringContains(path2, ts2.nodeModulesPathPart); + } + ts2.pathContainsNodeModules = pathContainsNodeModules; + function parseNodeModuleFromPath(resolved) { + var path2 = ts2.normalizePath(resolved); + var idx = path2.lastIndexOf(ts2.nodeModulesPathPart); + if (idx === -1) { + return void 0; + } + var indexAfterNodeModules = idx + ts2.nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterNodeModules); + if (path2.charCodeAt(indexAfterNodeModules) === 64) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterPackageName); + } + return path2.slice(0, indexAfterPackageName); + } + ts2.parseNodeModuleFromPath = parseNodeModuleFromPath; + function moveToNextDirectorySeparatorIfAvailable(path2, prevSeparatorIndex) { + var nextSeparatorIndex = path2.indexOf(ts2.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function loadModuleFromFileNoPackageId(extensions6, candidate, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state)); + } + function loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state) { + if (extensions6 === Extensions6.Json || extensions6 === Extensions6.TSConfig) { + var extensionLess = ts2.tryRemoveExtension( + candidate, + ".json" + /* Extension.Json */ + ); + var extension = extensionLess ? candidate.substring(extensionLess.length) : ""; + return extensionLess === void 0 && extensions6 === Extensions6.Json ? void 0 : tryAddingExtensions(extensionLess || candidate, extensions6, extension, onlyRecordFailures, state); + } + if (!(state.features & NodeResolutionFeatures.EsmMode)) { + var resolvedByAddingExtension = tryAddingExtensions(candidate, extensions6, "", onlyRecordFailures, state); + if (resolvedByAddingExtension) { + return resolvedByAddingExtension; + } + } + return loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state); + } + function loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state) { + if (ts2.hasJSFileExtension(candidate) || ts2.fileExtensionIs( + candidate, + ".json" + /* Extension.Json */ + ) && state.compilerOptions.resolveJsonModule) { + var extensionless = ts2.removeFileExtension(candidate); + var extension = candidate.substring(extensionless.length); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); + } + return tryAddingExtensions(extensionless, extensions6, extension, onlyRecordFailures, state); + } + } + function loadJSOrExactTSFileName(extensions6, candidate, onlyRecordFailures, state) { + if ((extensions6 === Extensions6.TypeScript || extensions6 === Extensions6.DtsOnly) && ts2.fileExtensionIsOneOf(candidate, ts2.supportedTSExtensionsFlat)) { + var result2 = tryFile(candidate, onlyRecordFailures, state); + return result2 !== void 0 ? { path: candidate, ext: ts2.tryExtractTSExtension(candidate) } : void 0; + } + return loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state); + } + function tryAddingExtensions(candidate, extensions6, originalExtension, onlyRecordFailures, state) { + if (!onlyRecordFailures) { + var directory = ts2.getDirectoryPath(candidate); + if (directory) { + onlyRecordFailures = !ts2.directoryProbablyExists(directory, state.host); + } + } + switch (extensions6) { + case Extensions6.DtsOnly: + switch (originalExtension) { + case ".mjs": + case ".mts": + case ".d.mts": + return tryExtension( + ".d.mts" + /* Extension.Dmts */ + ); + case ".cjs": + case ".cts": + case ".d.cts": + return tryExtension( + ".d.cts" + /* Extension.Dcts */ + ); + case ".json": + candidate += ".json"; + return tryExtension( + ".d.ts" + /* Extension.Dts */ + ); + default: + return tryExtension( + ".d.ts" + /* Extension.Dts */ + ); + } + case Extensions6.TypeScript: + case Extensions6.TsOnly: + var useDts = extensions6 === Extensions6.TypeScript; + switch (originalExtension) { + case ".mjs": + case ".mts": + case ".d.mts": + return tryExtension( + ".mts" + /* Extension.Mts */ + ) || (useDts ? tryExtension( + ".d.mts" + /* Extension.Dmts */ + ) : void 0); + case ".cjs": + case ".cts": + case ".d.cts": + return tryExtension( + ".cts" + /* Extension.Cts */ + ) || (useDts ? tryExtension( + ".d.cts" + /* Extension.Dcts */ + ) : void 0); + case ".json": + candidate += ".json"; + return useDts ? tryExtension( + ".d.ts" + /* Extension.Dts */ + ) : void 0; + default: + return tryExtension( + ".ts" + /* Extension.Ts */ + ) || tryExtension( + ".tsx" + /* Extension.Tsx */ + ) || (useDts ? tryExtension( + ".d.ts" + /* Extension.Dts */ + ) : void 0); + } + case Extensions6.JavaScript: + switch (originalExtension) { + case ".mjs": + case ".mts": + case ".d.mts": + return tryExtension( + ".mjs" + /* Extension.Mjs */ + ); + case ".cjs": + case ".cts": + case ".d.cts": + return tryExtension( + ".cjs" + /* Extension.Cjs */ + ); + case ".json": + return tryExtension( + ".json" + /* Extension.Json */ + ); + default: + return tryExtension( + ".js" + /* Extension.Js */ + ) || tryExtension( + ".jsx" + /* Extension.Jsx */ + ); + } + case Extensions6.TSConfig: + case Extensions6.Json: + return tryExtension( + ".json" + /* Extension.Json */ + ); + } + function tryExtension(ext) { + var path2 = tryFile(candidate + ext, onlyRecordFailures, state); + return path2 === void 0 ? void 0 : { path: path2, ext }; + } + } + function tryFile(fileName, onlyRecordFailures, state) { + var _a2, _b; + if (!((_a2 = state.compilerOptions.moduleSuffixes) === null || _a2 === void 0 ? void 0 : _a2.length)) { + return tryFileLookup(fileName, onlyRecordFailures, state); + } + var ext = (_b = ts2.tryGetExtensionFromPath(fileName)) !== null && _b !== void 0 ? _b : ""; + var fileNameNoExtension = ext ? ts2.removeExtension(fileName, ext) : fileName; + return ts2.forEach(state.compilerOptions.moduleSuffixes, function(suffix) { + return tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state); + }); + } + function tryFileLookup(fileName, onlyRecordFailures, state) { + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); + } + return fileName; + } else { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.File_0_does_not_exist, fileName); + } + } + } + state.failedLookupLocations.push(fileName); + return void 0; + } + function loadNodeModuleFromDirectory(extensions6, candidate, onlyRecordFailures, state, considerPackageJson) { + if (considerPackageJson === void 0) { + considerPackageJson = true; + } + var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0; + var packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent; + var versionPaths = packageInfo && packageInfo.contents.versionPaths; + return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions6, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)); + } + function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) { + if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) { + return packageJsonInfo.contents.resolvedEntrypoints; + } + var entrypoints; + var extensions6 = resolveJs ? Extensions6.JavaScript : Extensions6.TypeScript; + var features3 = getDefaultNodeResolutionFeatures(options); + var requireState = getTemporaryModuleResolutionState(cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(), host, options); + requireState.conditions = ["node", "require", "types"]; + requireState.requestContainingDirectory = packageJsonInfo.packageDirectory; + var requireResolution = loadNodeModuleFromDirectoryWorker( + extensions6, + packageJsonInfo.packageDirectory, + /*onlyRecordFailures*/ + false, + requireState, + packageJsonInfo.contents.packageJsonContent, + packageJsonInfo.contents.versionPaths + ); + entrypoints = ts2.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path); + if (features3 & NodeResolutionFeatures.Exports && packageJsonInfo.contents.packageJsonContent.exports) { + for (var _i = 0, _a2 = [["node", "import", "types"], ["node", "require", "types"]]; _i < _a2.length; _i++) { + var conditions = _a2[_i]; + var exportState = __assign16(__assign16({}, requireState), { failedLookupLocations: [], conditions }); + var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.contents.packageJsonContent.exports, exportState, extensions6); + if (exportResolutions) { + for (var _b = 0, exportResolutions_1 = exportResolutions; _b < exportResolutions_1.length; _b++) { + var resolution = exportResolutions_1[_b]; + entrypoints = ts2.appendIfUnique(entrypoints, resolution.path); + } + } + } + } + return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false; + } + ts2.getEntrypointsFromPackageJsonInfo = getEntrypointsFromPackageJsonInfo; + function loadEntrypointsFromExportMap(scope, exports29, state, extensions6) { + var entrypoints; + if (ts2.isArray(exports29)) { + for (var _i = 0, exports_1 = exports29; _i < exports_1.length; _i++) { + var target = exports_1[_i]; + loadEntrypointsFromTargetExports(target); + } + } else if (typeof exports29 === "object" && exports29 !== null && allKeysStartWithDot(exports29)) { + for (var key in exports29) { + loadEntrypointsFromTargetExports(exports29[key]); + } + } else { + loadEntrypointsFromTargetExports(exports29); + } + return entrypoints; + function loadEntrypointsFromTargetExports(target2) { + var _a2, _b; + if (typeof target2 === "string" && ts2.startsWith(target2, "./") && target2.indexOf("*") === -1) { + var partsAfterFirst = ts2.getPathComponents(target2).slice(2); + if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) { + return false; + } + var resolvedTarget = ts2.combinePaths(scope.packageDirectory, target2); + var finalPath = ts2.getNormalizedAbsolutePath(resolvedTarget, (_b = (_a2 = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a2)); + var result2 = loadJSOrExactTSFileName( + extensions6, + finalPath, + /*recordOnlyFailures*/ + false, + state + ); + if (result2) { + entrypoints = ts2.appendIfUnique(entrypoints, result2, function(a7, b8) { + return a7.path === b8.path; + }); + return true; + } + } else if (Array.isArray(target2)) { + for (var _i2 = 0, target_1 = target2; _i2 < target_1.length; _i2++) { + var t8 = target_1[_i2]; + var success = loadEntrypointsFromTargetExports(t8); + if (success) { + return true; + } + } + } else if (typeof target2 === "object" && target2 !== null) { + return ts2.forEach(ts2.getOwnKeys(target2), function(key2) { + if (key2 === "default" || ts2.contains(state.conditions, key2) || isApplicableVersionedTypesKey(state.conditions, key2)) { + loadEntrypointsFromTargetExports(target2[key2]); + return true; + } + }); + } + } + } + function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) { + return { + host, + compilerOptions: options, + traceEnabled: isTraceEnabled(options, host), + failedLookupLocations: ts2.noopPush, + affectingLocations: ts2.noopPush, + packageJsonInfoCache, + features: NodeResolutionFeatures.None, + conditions: ts2.emptyArray, + requestContainingDirectory: void 0, + reportDiagnostic: ts2.noop + }; + } + ts2.getTemporaryModuleResolutionState = getTemporaryModuleResolutionState; + function getPackageScopeForPath(fileName, state) { + var parts = ts2.getPathComponents(fileName); + parts.pop(); + while (parts.length > 0) { + var pkg = getPackageJsonInfo( + ts2.getPathFromPathComponents(parts), + /*onlyRecordFailures*/ + false, + state + ); + if (pkg) { + return pkg; + } + parts.pop(); + } + return void 0; + } + ts2.getPackageScopeForPath = getPackageScopeForPath; + function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { + var _a2, _b, _c; + var host = state.host, traceEnabled = state.traceEnabled; + var packageJsonPath = ts2.combinePaths(packageDirectory, "package.json"); + if (onlyRecordFailures) { + state.failedLookupLocations.push(packageJsonPath); + return void 0; + } + var existing = (_a2 = state.packageJsonInfoCache) === null || _a2 === void 0 ? void 0 : _a2.getPackageJsonInfo(packageJsonPath); + if (existing !== void 0) { + if (typeof existing !== "boolean") { + if (traceEnabled) + trace2(host, ts2.Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath); + state.affectingLocations.push(packageJsonPath); + return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents }; + } else { + if (existing && traceEnabled) + trace2(host, ts2.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath); + state.failedLookupLocations.push(packageJsonPath); + return void 0; + } + } + var directoryExists = ts2.directoryProbablyExists(packageDirectory, host); + if (directoryExists && host.fileExists(packageJsonPath)) { + var packageJsonContent = ts2.readJson(packageJsonPath, host); + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state); + var result2 = { packageDirectory, contents: { packageJsonContent, versionPaths, resolvedEntrypoints: void 0 } }; + (_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result2); + state.affectingLocations.push(packageJsonPath); + return result2; + } else { + if (directoryExists && traceEnabled) { + trace2(host, ts2.Diagnostics.File_0_does_not_exist, packageJsonPath); + } + (_c = state.packageJsonInfoCache) === null || _c === void 0 ? void 0 : _c.setPackageJsonInfo(packageJsonPath, directoryExists); + state.failedLookupLocations.push(packageJsonPath); + } + } + ts2.getPackageJsonInfo = getPackageJsonInfo; + function loadNodeModuleFromDirectoryWorker(extensions6, candidate, onlyRecordFailures, state, jsonContent, versionPaths) { + var packageFile; + if (jsonContent) { + switch (extensions6) { + case Extensions6.JavaScript: + case Extensions6.Json: + case Extensions6.TsOnly: + packageFile = readPackageJsonMainField(jsonContent, candidate, state); + break; + case Extensions6.TypeScript: + packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state); + break; + case Extensions6.DtsOnly: + packageFile = readPackageJsonTypesFields(jsonContent, candidate, state); + break; + case Extensions6.TSConfig: + packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); + break; + default: + return ts2.Debug.assertNever(extensions6); + } + } + var loader2 = function(extensions7, candidate2, onlyRecordFailures2, state2) { + var fromFile2 = tryFile(candidate2, onlyRecordFailures2, state2); + if (fromFile2) { + var resolved = resolvedIfExtensionMatches(extensions7, fromFile2); + if (resolved) { + return noPackageId(resolved); + } + if (state2.traceEnabled) { + trace2(state2.host, ts2.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile2); + } + } + var nextExtensions = extensions7 === Extensions6.DtsOnly ? Extensions6.TypeScript : extensions7; + var features3 = state2.features; + if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") { + state2.features &= ~NodeResolutionFeatures.EsmMode; + } + var result3 = nodeLoadModuleByRelativeName( + nextExtensions, + candidate2, + onlyRecordFailures2, + state2, + /*considerPackageJson*/ + false + ); + state2.features = features3; + return result3; + }; + var onlyRecordFailuresForPackageFile = packageFile ? !ts2.directoryProbablyExists(ts2.getDirectoryPath(packageFile), state.host) : void 0; + var onlyRecordFailuresForIndex = onlyRecordFailures || !ts2.directoryProbablyExists(candidate, state.host); + var indexPath = ts2.combinePaths(candidate, extensions6 === Extensions6.TSConfig ? "tsconfig" : "index"); + if (versionPaths && (!packageFile || ts2.containsPath(candidate, packageFile))) { + var moduleName3 = ts2.getRelativePathFromDirectory( + candidate, + packageFile || indexPath, + /*ignoreCase*/ + false + ); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, ts2.version, moduleName3); + } + var result2 = tryLoadModuleUsingPaths( + extensions6, + moduleName3, + candidate, + versionPaths.paths, + /*pathPatterns*/ + void 0, + loader2, + onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, + state + ); + if (result2) { + return removeIgnoredPackageId(result2.value); + } + } + var packageFileResult = packageFile && removeIgnoredPackageId(loader2(extensions6, packageFile, onlyRecordFailuresForPackageFile, state)); + if (packageFileResult) + return packageFileResult; + if (!(state.features & NodeResolutionFeatures.EsmMode)) { + return loadModuleFromFile(extensions6, indexPath, onlyRecordFailuresForIndex, state); + } + } + function resolvedIfExtensionMatches(extensions6, path2) { + var ext = ts2.tryGetExtensionFromPath(path2); + return ext !== void 0 && extensionIsOk(extensions6, ext) ? { path: path2, ext } : void 0; + } + function extensionIsOk(extensions6, extension) { + switch (extensions6) { + case Extensions6.JavaScript: + return extension === ".js" || extension === ".jsx" || extension === ".mjs" || extension === ".cjs"; + case Extensions6.TSConfig: + case Extensions6.Json: + return extension === ".json"; + case Extensions6.TypeScript: + return extension === ".ts" || extension === ".tsx" || extension === ".mts" || extension === ".cts" || extension === ".d.ts" || extension === ".d.mts" || extension === ".d.cts"; + case Extensions6.TsOnly: + return extension === ".ts" || extension === ".tsx" || extension === ".mts" || extension === ".cts"; + case Extensions6.DtsOnly: + return extension === ".d.ts" || extension === ".d.mts" || extension === ".d.cts"; + } + } + function parsePackageName(moduleName3) { + var idx = moduleName3.indexOf(ts2.directorySeparator); + if (moduleName3[0] === "@") { + idx = moduleName3.indexOf(ts2.directorySeparator, idx + 1); + } + return idx === -1 ? { packageName: moduleName3, rest: "" } : { packageName: moduleName3.slice(0, idx), rest: moduleName3.slice(idx + 1) }; + } + ts2.parsePackageName = parsePackageName; + function allKeysStartWithDot(obj) { + return ts2.every(ts2.getOwnKeys(obj), function(k6) { + return ts2.startsWith(k6, "."); + }); + } + ts2.allKeysStartWithDot = allKeysStartWithDot; + function noKeyStartsWithDot(obj) { + return !ts2.some(ts2.getOwnKeys(obj), function(k6) { + return ts2.startsWith(k6, "."); + }); + } + function loadModuleFromSelfNameReference(extensions6, moduleName3, directory, state, cache, redirectedReference) { + var _a2, _b; + var directoryPath = ts2.getNormalizedAbsolutePath(ts2.combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a2)); + var scope = getPackageScopeForPath(directoryPath, state); + if (!scope || !scope.contents.packageJsonContent.exports) { + return void 0; + } + if (typeof scope.contents.packageJsonContent.name !== "string") { + return void 0; + } + var parts = ts2.getPathComponents(moduleName3); + var nameParts = ts2.getPathComponents(scope.contents.packageJsonContent.name); + if (!ts2.every(nameParts, function(p7, i7) { + return parts[i7] === p7; + })) { + return void 0; + } + var trailingParts = parts.slice(nameParts.length); + return loadModuleFromExports(scope, extensions6, !ts2.length(trailingParts) ? "." : ".".concat(ts2.directorySeparator).concat(trailingParts.join(ts2.directorySeparator)), state, cache, redirectedReference); + } + function loadModuleFromExports(scope, extensions6, subpath, state, cache, redirectedReference) { + if (!scope.contents.packageJsonContent.exports) { + return void 0; + } + if (subpath === ".") { + var mainExport = void 0; + if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports)) { + mainExport = scope.contents.packageJsonContent.exports; + } else if (ts2.hasProperty(scope.contents.packageJsonContent.exports, ".")) { + mainExport = scope.contents.packageJsonContent.exports["."]; + } + if (mainExport) { + var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport( + extensions6, + state, + cache, + redirectedReference, + subpath, + scope, + /*isImports*/ + false + ); + return loadModuleFromTargetImportOrExport( + mainExport, + "", + /*pattern*/ + false, + "." + ); + } + } else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) { + if (typeof scope.contents.packageJsonContent.exports !== "object") { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + var result2 = loadModuleFromImportsOrExports( + extensions6, + state, + cache, + redirectedReference, + subpath, + scope.contents.packageJsonContent.exports, + scope, + /*isImports*/ + false + ); + if (result2) { + return result2; + } + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + function loadModuleFromImports(extensions6, moduleName3, directory, state, cache, redirectedReference) { + var _a2, _b; + if (moduleName3 === "#" || ts2.startsWith(moduleName3, "#/")) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + var directoryPath = ts2.getNormalizedAbsolutePath(ts2.combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a2)); + var scope = getPackageScopeForPath(directoryPath, state); + if (!scope) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (!scope.contents.packageJsonContent.imports) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + var result2 = loadModuleFromImportsOrExports( + extensions6, + state, + cache, + redirectedReference, + moduleName3, + scope.contents.packageJsonContent.imports, + scope, + /*isImports*/ + true + ); + if (result2) { + return result2; + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName3, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + function comparePatternKeys(a7, b8) { + var aPatternIndex = a7.indexOf("*"); + var bPatternIndex = b8.indexOf("*"); + var baseLenA = aPatternIndex === -1 ? a7.length : aPatternIndex + 1; + var baseLenB = bPatternIndex === -1 ? b8.length : bPatternIndex + 1; + if (baseLenA > baseLenB) + return -1; + if (baseLenB > baseLenA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a7.length > b8.length) + return -1; + if (b8.length > a7.length) + return 1; + return 0; + } + ts2.comparePatternKeys = comparePatternKeys; + function loadModuleFromImportsOrExports(extensions6, state, cache, redirectedReference, moduleName3, lookupTable, scope, isImports) { + var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions6, state, cache, redirectedReference, moduleName3, scope, isImports); + if (!ts2.endsWith(moduleName3, ts2.directorySeparator) && moduleName3.indexOf("*") === -1 && ts2.hasProperty(lookupTable, moduleName3)) { + var target = lookupTable[moduleName3]; + return loadModuleFromTargetImportOrExport( + target, + /*subpath*/ + "", + /*pattern*/ + false, + moduleName3 + ); + } + var expandingKeys = ts2.sort(ts2.filter(ts2.getOwnKeys(lookupTable), function(k6) { + return k6.indexOf("*") !== -1 || ts2.endsWith(k6, "/"); + }), comparePatternKeys); + for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) { + var potentialTarget = expandingKeys_1[_i]; + if (state.features & NodeResolutionFeatures.ExportsPatternTrailers && matchesPatternWithTrailer(potentialTarget, moduleName3)) { + var target = lookupTable[potentialTarget]; + var starPos = potentialTarget.indexOf("*"); + var subpath = moduleName3.substring(potentialTarget.substring(0, starPos).length, moduleName3.length - (potentialTarget.length - 1 - starPos)); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + true, + potentialTarget + ); + } else if (ts2.endsWith(potentialTarget, "*") && ts2.startsWith(moduleName3, potentialTarget.substring(0, potentialTarget.length - 1))) { + var target = lookupTable[potentialTarget]; + var subpath = moduleName3.substring(potentialTarget.length - 1); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + true, + potentialTarget + ); + } else if (ts2.startsWith(moduleName3, potentialTarget)) { + var target = lookupTable[potentialTarget]; + var subpath = moduleName3.substring(potentialTarget.length); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + false, + potentialTarget + ); + } + } + function matchesPatternWithTrailer(target2, name2) { + if (ts2.endsWith(target2, "*")) + return false; + var starPos2 = target2.indexOf("*"); + if (starPos2 === -1) + return false; + return ts2.startsWith(name2, target2.substring(0, starPos2)) && ts2.endsWith(name2, target2.substring(starPos2 + 1)); + } + } + function getLoadModuleFromTargetImportOrExport(extensions6, state, cache, redirectedReference, moduleName3, scope, isImports) { + return loadModuleFromTargetImportOrExport; + function loadModuleFromTargetImportOrExport(target, subpath, pattern5, key) { + if (typeof target === "string") { + if (!pattern5 && subpath.length > 0 && !ts2.endsWith(target, "/")) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (!ts2.startsWith(target, "./")) { + if (isImports && !ts2.startsWith(target, "../") && !ts2.startsWith(target, "/") && !ts2.isRootedDiskPath(target)) { + var combinedLookup = pattern5 ? target.replace(/\*/g, subpath) : target + subpath; + traceIfEnabled(state, ts2.Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup); + traceIfEnabled(state, ts2.Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/"); + var result2 = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions6], redirectedReference); + return toSearchResult(result2.resolvedModule ? { path: result2.resolvedModule.resolvedFileName, extension: result2.resolvedModule.extension, packageId: result2.resolvedModule.packageId, originalPath: result2.resolvedModule.originalPath } : void 0); + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + var parts = ts2.pathIsRelative(target) ? ts2.getPathComponents(target).slice(1) : ts2.getPathComponents(target); + var partsAfterFirst = parts.slice(1); + if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + var resolvedTarget = ts2.combinePaths(scope.packageDirectory, target); + var subpathParts = ts2.getPathComponents(subpath); + if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern5 ? target.replace(/\*/g, subpath) : target + subpath); + } + var finalPath = toAbsolutePath(pattern5 ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); + var inputLink = tryLoadInputFileForPath(finalPath, subpath, ts2.combinePaths(scope.packageDirectory, "package.json"), isImports); + if (inputLink) + return inputLink; + return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName( + extensions6, + finalPath, + /*onlyRecordFailures*/ + false, + state + ))); + } else if (typeof target === "object" && target !== null) { + if (!Array.isArray(target)) { + for (var _i = 0, _a2 = ts2.getOwnKeys(target); _i < _a2.length; _i++) { + var condition = _a2[_i]; + if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { + traceIfEnabled(state, ts2.Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); + var subTarget = target[condition]; + var result2 = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern5, key); + if (result2) { + return result2; + } + } else { + traceIfEnabled(state, ts2.Diagnostics.Saw_non_matching_condition_0, condition); + } + } + return void 0; + } else { + if (!ts2.length(target)) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + for (var _b = 0, target_2 = target; _b < target_2.length; _b++) { + var elem = target_2[_b]; + var result2 = loadModuleFromTargetImportOrExport(elem, subpath, pattern5, key); + if (result2) { + return result2; + } + } + } + } else if (target === null) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + function toAbsolutePath(path2) { + var _a3, _b2; + if (path2 === void 0) + return path2; + return ts2.getNormalizedAbsolutePath(path2, (_b2 = (_a3 = state.host).getCurrentDirectory) === null || _b2 === void 0 ? void 0 : _b2.call(_a3)); + } + function combineDirectoryPath(root2, dir2) { + return ts2.ensureTrailingDirectorySeparator(ts2.combinePaths(root2, dir2)); + } + function useCaseSensitiveFileNames() { + return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); + } + function tryLoadInputFileForPath(finalPath2, entry, packagePath, isImports2) { + var _a3, _b2, _c, _d; + if ((extensions6 === Extensions6.TypeScript || extensions6 === Extensions6.JavaScript || extensions6 === Extensions6.Json) && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath2.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? ts2.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) { + var getCanonicalFileName = ts2.hostGetCanonicalFileName({ useCaseSensitiveFileNames }); + var commonSourceDirGuesses = []; + if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) { + var commonDir = toAbsolutePath(ts2.getCommonSourceDirectory(state.compilerOptions, function() { + return []; + }, ((_b2 = (_a3 = state.host).getCurrentDirectory) === null || _b2 === void 0 ? void 0 : _b2.call(_a3)) || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + } else if (state.requestContainingDirectory) { + var requestingFile_1 = toAbsolutePath(ts2.combinePaths(state.requestContainingDirectory, "index.ts")); + var commonDir = toAbsolutePath(ts2.getCommonSourceDirectory(state.compilerOptions, function() { + return [requestingFile_1, toAbsolutePath(packagePath)]; + }, ((_d = (_c = state.host).getCurrentDirectory) === null || _d === void 0 ? void 0 : _d.call(_c)) || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + var fragment = ts2.ensureTrailingDirectorySeparator(commonDir); + while (fragment && fragment.length > 1) { + var parts2 = ts2.getPathComponents(fragment); + parts2.pop(); + var commonDir_1 = ts2.getPathFromPathComponents(parts2); + commonSourceDirGuesses.unshift(commonDir_1); + fragment = ts2.ensureTrailingDirectorySeparator(commonDir_1); + } + } + if (commonSourceDirGuesses.length > 1) { + state.reportDiagnostic(ts2.createCompilerDiagnostic( + isImports2 ? ts2.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate : ts2.Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, + entry === "" ? "." : entry, + // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird + packagePath + )); + } + for (var _i2 = 0, commonSourceDirGuesses_1 = commonSourceDirGuesses; _i2 < commonSourceDirGuesses_1.length; _i2++) { + var commonSourceDirGuess = commonSourceDirGuesses_1[_i2]; + var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); + for (var _e2 = 0, candidateDirectories_1 = candidateDirectories; _e2 < candidateDirectories_1.length; _e2++) { + var candidateDir = candidateDirectories_1[_e2]; + if (ts2.containsPath(candidateDir, finalPath2, !useCaseSensitiveFileNames())) { + var pathFragment = finalPath2.slice(candidateDir.length + 1); + var possibleInputBase = ts2.combinePaths(commonSourceDirGuess, pathFragment); + var jsAndDtsExtensions = [ + ".mjs", + ".cjs", + ".js", + ".json", + ".d.mts", + ".d.cts", + ".d.ts" + /* Extension.Dts */ + ]; + for (var _f = 0, jsAndDtsExtensions_1 = jsAndDtsExtensions; _f < jsAndDtsExtensions_1.length; _f++) { + var ext = jsAndDtsExtensions_1[_f]; + if (ts2.fileExtensionIs(possibleInputBase, ext)) { + var inputExts = ts2.getPossibleOriginalInputExtensionForExtension(possibleInputBase); + for (var _g = 0, inputExts_1 = inputExts; _g < inputExts_1.length; _g++) { + var possibleExt = inputExts_1[_g]; + var possibleInputWithInputExtension = ts2.changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames()); + if (extensions6 === Extensions6.TypeScript && ts2.hasJSFileExtension(possibleInputWithInputExtension) || extensions6 === Extensions6.JavaScript && ts2.hasTSFileExtension(possibleInputWithInputExtension)) { + continue; + } + if (state.host.fileExists(possibleInputWithInputExtension)) { + return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName( + extensions6, + possibleInputWithInputExtension, + /*onlyRecordFailures*/ + false, + state + ))); + } + } + } + } + } + } + } + } + return void 0; + function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess2) { + var _a4, _b3; + var currentDir = state.compilerOptions.configFile ? ((_b3 = (_a4 = state.host).getCurrentDirectory) === null || _b3 === void 0 ? void 0 : _b3.call(_a4)) || "" : commonSourceDirGuess2; + var candidateDirectories2 = []; + if (state.compilerOptions.declarationDir) { + candidateDirectories2.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir))); + } + if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) { + candidateDirectories2.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir))); + } + return candidateDirectories2; + } + } + } + } + function isApplicableVersionedTypesKey(conditions, key) { + if (conditions.indexOf("types") === -1) + return false; + if (!ts2.startsWith(key, "types@")) + return false; + var range2 = ts2.VersionRange.tryParse(key.substring("types@".length)); + if (!range2) + return false; + return range2.test(ts2.version); + } + ts2.isApplicableVersionedTypesKey = isApplicableVersionedTypesKey; + function loadModuleFromNearestNodeModulesDirectory(extensions6, moduleName3, directory, state, cache, redirectedReference) { + return loadModuleFromNearestNodeModulesDirectoryWorker( + extensions6, + moduleName3, + directory, + state, + /*typesScopeOnly*/ + false, + cache, + redirectedReference + ); + } + function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName3, directory, state) { + return loadModuleFromNearestNodeModulesDirectoryWorker( + Extensions6.DtsOnly, + moduleName3, + directory, + state, + /*typesScopeOnly*/ + true, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + } + function loadModuleFromNearestNodeModulesDirectoryWorker(extensions6, moduleName3, directory, state, typesScopeOnly, cache, redirectedReference) { + var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName3, state.features === 0 ? void 0 : state.features & NodeResolutionFeatures.EsmMode ? ts2.ModuleKind.ESNext : ts2.ModuleKind.CommonJS, redirectedReference); + return ts2.forEachAncestorDirectory(ts2.normalizeSlashes(directory), function(ancestorDirectory) { + if (ts2.getBaseFileName(ancestorDirectory) !== "node_modules") { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName3, ancestorDirectory, state); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions6, moduleName3, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); + } + }); + } + function loadModuleFromImmediateNodeModulesDirectory(extensions6, moduleName3, directory, state, typesScopeOnly, cache, redirectedReference) { + var nodeModulesFolder = ts2.combinePaths(directory, "node_modules"); + var nodeModulesFolderExists = ts2.directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + var packageResult = typesScopeOnly ? void 0 : loadModuleFromSpecificNodeModulesDirectory(extensions6, moduleName3, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); + if (packageResult) { + return packageResult; + } + if (extensions6 === Extensions6.TypeScript || extensions6 === Extensions6.DtsOnly) { + var nodeModulesAtTypes_1 = ts2.combinePaths(nodeModulesFolder, "@types"); + var nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !ts2.directoryProbablyExists(nodeModulesAtTypes_1, state.host)) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes_1); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromSpecificNodeModulesDirectory(Extensions6.DtsOnly, mangleScopedPackageNameWithTrace(moduleName3, state), nodeModulesAtTypes_1, nodeModulesAtTypesExists, state, cache, redirectedReference); + } + } + function loadModuleFromSpecificNodeModulesDirectory(extensions6, moduleName3, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) { + var _a2; + var candidate = ts2.normalizePath(ts2.combinePaths(nodeModulesDirectory, moduleName3)); + var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state); + if (!(state.features & NodeResolutionFeatures.Exports)) { + if (packageInfo) { + var fromFile2 = loadModuleFromFile(extensions6, candidate, !nodeModulesDirectoryExists, state); + if (fromFile2) { + return noPackageId(fromFile2); + } + var fromDirectory = loadNodeModuleFromDirectoryWorker(extensions6, candidate, !nodeModulesDirectoryExists, state, packageInfo.contents.packageJsonContent, packageInfo.contents.versionPaths); + return withPackageId(packageInfo, fromDirectory); + } + } + var loader2 = function(extensions7, candidate2, onlyRecordFailures, state2) { + var pathAndExtension = loadModuleFromFile(extensions7, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker(extensions7, candidate2, onlyRecordFailures, state2, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths); + if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & NodeResolutionFeatures.EsmMode) { + pathAndExtension = loadModuleFromFile(extensions7, ts2.combinePaths(candidate2, "index.js"), onlyRecordFailures, state2); + } + return withPackageId(packageInfo, pathAndExtension); + }; + var _b = parsePackageName(moduleName3), packageName = _b.packageName, rest2 = _b.rest; + var packageDirectory = ts2.combinePaths(nodeModulesDirectory, packageName); + if (rest2 !== "") { + packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state); + } + if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) { + return (_a2 = loadModuleFromExports(packageInfo, extensions6, ts2.combinePaths(".", rest2), state, cache, redirectedReference)) === null || _a2 === void 0 ? void 0 : _a2.value; + } + if (rest2 !== "" && packageInfo && packageInfo.contents.versionPaths) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts2.version, rest2); + } + var packageDirectoryExists = nodeModulesDirectoryExists && ts2.directoryProbablyExists(packageDirectory, state.host); + var fromPaths = tryLoadModuleUsingPaths( + extensions6, + rest2, + packageDirectory, + packageInfo.contents.versionPaths.paths, + /*pathPatterns*/ + void 0, + loader2, + !packageDirectoryExists, + state + ); + if (fromPaths) { + return fromPaths.value; + } + } + return loader2(extensions6, candidate, !nodeModulesDirectoryExists, state); + } + function tryLoadModuleUsingPaths(extensions6, moduleName3, baseDirectory, paths, pathPatterns, loader2, onlyRecordFailures, state) { + pathPatterns || (pathPatterns = ts2.tryParsePatterns(paths)); + var matchedPattern = ts2.matchPatternOrExact(pathPatterns, moduleName3); + if (matchedPattern) { + var matchedStar_1 = ts2.isString(matchedPattern) ? void 0 : ts2.matchedText(matchedPattern, moduleName3); + var matchedPatternText = ts2.isString(matchedPattern) ? matchedPattern : ts2.patternText(matchedPattern); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Module_name_0_matched_pattern_1, moduleName3, matchedPatternText); + } + var resolved = ts2.forEach(paths[matchedPatternText], function(subst) { + var path2 = matchedStar_1 ? subst.replace("*", matchedStar_1) : subst; + var candidate = ts2.normalizePath(ts2.combinePaths(baseDirectory, path2)); + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path2); + } + var extension = ts2.tryGetExtensionFromPath(subst); + if (extension !== void 0) { + var path_1 = tryFile(candidate, onlyRecordFailures, state); + if (path_1 !== void 0) { + return noPackageId({ path: path_1, ext: extension }); + } + } + return loader2(extensions6, candidate, onlyRecordFailures || !ts2.directoryProbablyExists(ts2.getDirectoryPath(candidate), state.host), state); + }); + return { value: resolved }; + } + } + var mangledScopedPackageSeparator = "__"; + function mangleScopedPackageNameWithTrace(packageName, state) { + var mangled = mangleScopedPackageName(packageName); + if (state.traceEnabled && mangled !== packageName) { + trace2(state.host, ts2.Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + function getTypesPackageName(packageName) { + return "@types/".concat(mangleScopedPackageName(packageName)); + } + ts2.getTypesPackageName = getTypesPackageName; + function mangleScopedPackageName(packageName) { + if (ts2.startsWith(packageName, "@")) { + var replaceSlash = packageName.replace(ts2.directorySeparator, mangledScopedPackageSeparator); + if (replaceSlash !== packageName) { + return replaceSlash.slice(1); + } + } + return packageName; + } + ts2.mangleScopedPackageName = mangleScopedPackageName; + function getPackageNameFromTypesPackageName(mangledName) { + var withoutAtTypePrefix = ts2.removePrefix(mangledName, "@types/"); + if (withoutAtTypePrefix !== mangledName) { + return unmangleScopedPackageName(withoutAtTypePrefix); + } + return mangledName; + } + ts2.getPackageNameFromTypesPackageName = getPackageNameFromTypesPackageName; + function unmangleScopedPackageName(typesPackageName) { + return ts2.stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts2.directorySeparator) : typesPackageName; + } + ts2.unmangleScopedPackageName = unmangleScopedPackageName; + function tryFindNonRelativeModuleNameInCache(cache, moduleName3, containingDirectory, state) { + var result2 = cache && cache.get(containingDirectory); + if (result2) { + if (state.traceEnabled) { + trace2(state.host, ts2.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName3, containingDirectory); + } + state.resultFromCache = result2; + return { value: result2.resolvedModule && { path: result2.resolvedModule.resolvedFileName, originalPath: result2.resolvedModule.originalPath || true, extension: result2.resolvedModule.extension, packageId: result2.resolvedModule.packageId } }; + } + } + function classicNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + var failedLookupLocations = []; + var affectingLocations = []; + var containingDirectory = ts2.getDirectoryPath(containingFile); + var diagnostics = []; + var state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: NodeResolutionFeatures.None, + conditions: [], + requestContainingDirectory: containingDirectory, + reportDiagnostic: function(diag) { + return void diagnostics.push(diag); + } + }; + var resolved = tryResolve(Extensions6.TypeScript) || tryResolve(Extensions6.JavaScript); + return createResolvedModuleWithFailedLookupLocations( + resolved && resolved.value, + /*isExternalLibraryImport*/ + false, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache + ); + function tryResolve(extensions6) { + var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions6, moduleName3, containingDirectory, loadModuleFromFileNoPackageId, state); + if (resolvedUsingSettings) { + return { value: resolvedUsingSettings }; + } + if (!ts2.isExternalModuleNameRelative(moduleName3)) { + var perModuleNameCache_1 = cache && cache.getOrCreateCacheForModuleName( + moduleName3, + /*mode*/ + void 0, + redirectedReference + ); + var resolved_3 = ts2.forEachAncestorDirectory(containingDirectory, function(directory) { + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache_1, moduleName3, directory, state); + if (resolutionFromCache) { + return resolutionFromCache; + } + var searchName = ts2.normalizePath(ts2.combinePaths(directory, moduleName3)); + return toSearchResult(loadModuleFromFileNoPackageId( + extensions6, + searchName, + /*onlyRecordFailures*/ + false, + state + )); + }); + if (resolved_3) { + return resolved_3; + } + if (extensions6 === Extensions6.TypeScript) { + return loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName3, containingDirectory, state); + } + } else { + var candidate = ts2.normalizePath(ts2.combinePaths(containingDirectory, moduleName3)); + return toSearchResult(loadModuleFromFileNoPackageId( + extensions6, + candidate, + /*onlyRecordFailures*/ + false, + state + )); + } + } + } + ts2.classicNameResolver = classicNameResolver; + function loadModuleFromGlobalCache(moduleName3, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { + var traceEnabled = isTraceEnabled(compilerOptions, host); + if (traceEnabled) { + trace2(host, ts2.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName3, globalCache); + } + var failedLookupLocations = []; + var affectingLocations = []; + var diagnostics = []; + var state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache, + features: NodeResolutionFeatures.None, + conditions: [], + requestContainingDirectory: void 0, + reportDiagnostic: function(diag) { + return void diagnostics.push(diag); + } + }; + var resolved = loadModuleFromImmediateNodeModulesDirectory( + Extensions6.DtsOnly, + moduleName3, + globalCache, + state, + /*typesScopeOnly*/ + false, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + return createResolvedModuleWithFailedLookupLocations( + resolved, + /*isExternalLibraryImport*/ + true, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache + ); + } + ts2.loadModuleFromGlobalCache = loadModuleFromGlobalCache; + function toSearchResult(value2) { + return value2 !== void 0 ? { value: value2 } : void 0; + } + function traceIfEnabled(state, diagnostic) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + if (state.traceEnabled) { + trace2.apply(void 0, __spreadArray9([state.host, diagnostic], args, false)); + } + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ModuleInstanceState; + (function(ModuleInstanceState2) { + ModuleInstanceState2[ModuleInstanceState2["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState2[ModuleInstanceState2["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + })(ModuleInstanceState = ts2.ModuleInstanceState || (ts2.ModuleInstanceState = {})); + function getModuleInstanceState(node, visited) { + if (node.body && !node.body.parent) { + ts2.setParent(node.body, node); + ts2.setParentRecursive( + node.body, + /*incremental*/ + false + ); + } + return node.body ? getModuleInstanceStateCached(node.body, visited) : 1; + } + ts2.getModuleInstanceState = getModuleInstanceState; + function getModuleInstanceStateCached(node, visited) { + if (visited === void 0) { + visited = new ts2.Map(); + } + var nodeId = ts2.getNodeId(node); + if (visited.has(nodeId)) { + return visited.get(nodeId) || 0; + } + visited.set(nodeId, void 0); + var result2 = getModuleInstanceStateWorker(node, visited); + visited.set(nodeId, result2); + return result2; + } + function getModuleInstanceStateWorker(node, visited) { + switch (node.kind) { + case 261: + case 262: + return 0; + case 263: + if (ts2.isEnumConst(node)) { + return 2; + } + break; + case 269: + case 268: + if (!ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + return 0; + } + break; + case 275: + var exportDeclaration = node; + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 276) { + var state = 0; + for (var _i = 0, _a2 = exportDeclaration.exportClause.elements; _i < _a2.length; _i++) { + var specifier = _a2[_i]; + var specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); + if (specifierState > state) { + state = specifierState; + } + if (state === 1) { + return state; + } + } + return state; + } + break; + case 265: { + var state_1 = 0; + ts2.forEachChild(node, function(n7) { + var childState = getModuleInstanceStateCached(n7, visited); + switch (childState) { + case 0: + return; + case 2: + state_1 = 2; + return; + case 1: + state_1 = 1; + return true; + default: + ts2.Debug.assertNever(childState); + } + }); + return state_1; + } + case 264: + return getModuleInstanceState(node, visited); + case 79: + if (node.isInJSDocNamespace) { + return 0; + } + } + return 1; + } + function getModuleInstanceStateForAliasTarget(specifier, visited) { + var name2 = specifier.propertyName || specifier.name; + var p7 = specifier.parent; + while (p7) { + if (ts2.isBlock(p7) || ts2.isModuleBlock(p7) || ts2.isSourceFile(p7)) { + var statements = p7.statements; + var found = void 0; + for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { + var statement = statements_2[_i]; + if (ts2.nodeHasName(statement, name2)) { + if (!statement.parent) { + ts2.setParent(statement, p7); + ts2.setParentRecursive( + statement, + /*incremental*/ + false + ); + } + var state = getModuleInstanceStateCached(statement, visited); + if (found === void 0 || state > found) { + found = state; + } + if (found === 1) { + return found; + } + } + } + if (found !== void 0) { + return found; + } + } + p7 = p7.parent; + } + return 1; + } + var ContainerFlags; + (function(ContainerFlags2) { + ContainerFlags2[ContainerFlags2["None"] = 0] = "None"; + ContainerFlags2[ContainerFlags2["IsContainer"] = 1] = "IsContainer"; + ContainerFlags2[ContainerFlags2["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags2[ContainerFlags2["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags2[ContainerFlags2["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags2[ContainerFlags2["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags2[ContainerFlags2["HasLocals"] = 32] = "HasLocals"; + ContainerFlags2[ContainerFlags2["IsInterface"] = 64] = "IsInterface"; + ContainerFlags2[ContainerFlags2["IsObjectLiteralOrClassExpressionMethodOrAccessor"] = 128] = "IsObjectLiteralOrClassExpressionMethodOrAccessor"; + })(ContainerFlags || (ContainerFlags = {})); + function initFlowNode(node) { + ts2.Debug.attachFlowNodeDebugInfo(node); + return node; + } + var binder = createBinder(); + function bindSourceFile(file, options) { + ts2.performance.mark("beforeBind"); + ts2.perfLogger.logStartBindFile("" + file.fileName); + binder(file, options); + ts2.perfLogger.logStopBindFile(); + ts2.performance.mark("afterBind"); + ts2.performance.measure("Bind", "beforeBind", "afterBind"); + } + ts2.bindSourceFile = bindSourceFile; + function createBinder() { + var file; + var options; + var languageVersion; + var parent2; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol3; + var classifiableNames; + var unreachableFlow = { + flags: 1 + /* FlowFlags.Unreachable */ + }; + var reportedUnreachableFlow = { + flags: 1 + /* FlowFlags.Unreachable */ + }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + function createDiagnosticForNode(node, message, arg0, arg1, arg2) { + return ts2.createDiagnosticForNodeInSourceFile(ts2.getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); + } + function bindSourceFile2(f8, opts) { + file = f8; + options = opts; + languageVersion = ts2.getEmitScriptTarget(options); + inStrictMode = bindInStrictMode(file, opts); + classifiableNames = new ts2.Set(); + symbolCount = 0; + Symbol3 = ts2.objectAllocator.getSymbolConstructor(); + ts2.Debug.attachFlowNodeDebugInfo(unreachableFlow); + ts2.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow); + if (!file.locals) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "bind", + "bindSourceFile", + { path: file.path }, + /*separateBeginAndEnd*/ + true + ); + bind2(file); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + delayedBindJSDocTypedefTag(); + } + file = void 0; + options = void 0; + languageVersion = void 0; + parent2 = void 0; + container = void 0; + thisParentContainer = void 0; + blockScopeContainer = void 0; + lastContainer = void 0; + delayedTypeAliases = void 0; + seenThisKeyword = false; + currentFlow = void 0; + currentBreakTarget = void 0; + currentContinueTarget = void 0; + currentReturnTarget = void 0; + currentTrueTarget = void 0; + currentFalseTarget = void 0; + currentExceptionTarget = void 0; + activeLabelList = void 0; + hasExplicitReturn = false; + inAssignmentPattern = false; + emitFlags = 0; + } + return bindSourceFile2; + function bindInStrictMode(file2, opts) { + if (ts2.getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { + return true; + } else { + return !!file2.externalModuleIndicator; + } + } + function createSymbol(flags, name2) { + symbolCount++; + return new Symbol3(flags, name2); + } + function addDeclarationToSymbol(symbol, node, symbolFlags) { + symbol.flags |= symbolFlags; + node.symbol = symbol; + symbol.declarations = ts2.appendIfUnique(symbol.declarations, node); + if (symbolFlags & (32 | 384 | 1536 | 3) && !symbol.exports) { + symbol.exports = ts2.createSymbolTable(); + } + if (symbolFlags & (32 | 64 | 2048 | 4096) && !symbol.members) { + symbol.members = ts2.createSymbolTable(); + } + if (symbol.constEnumOnlyModule && symbol.flags & (16 | 32 | 256)) { + symbol.constEnumOnlyModule = false; + } + if (symbolFlags & 111551) { + ts2.setValueDeclaration(symbol, node); + } + } + function getDeclarationName(node) { + if (node.kind === 274) { + return node.isExportEquals ? "export=" : "default"; + } + var name2 = ts2.getNameOfDeclaration(node); + if (name2) { + if (ts2.isAmbientModule(node)) { + var moduleName3 = ts2.getTextOfIdentifierOrLiteral(name2); + return ts2.isGlobalScopeAugmentation(node) ? "__global" : '"'.concat(moduleName3, '"'); + } + if (name2.kind === 164) { + var nameExpression = name2.expression; + if (ts2.isStringOrNumericLiteralLike(nameExpression)) { + return ts2.escapeLeadingUnderscores(nameExpression.text); + } + if (ts2.isSignedNumericLiteral(nameExpression)) { + return ts2.tokenToString(nameExpression.operator) + nameExpression.operand.text; + } else { + ts2.Debug.fail("Only computed properties with literal names have declaration names"); + } + } + if (ts2.isPrivateIdentifier(name2)) { + var containingClass = ts2.getContainingClass(node); + if (!containingClass) { + return void 0; + } + var containingClassSymbol = containingClass.symbol; + return ts2.getSymbolNameForPrivateIdentifier(containingClassSymbol, name2.escapedText); + } + return ts2.isPropertyNameLiteral(name2) ? ts2.getEscapedTextOfIdentifierOrLiteral(name2) : void 0; + } + switch (node.kind) { + case 173: + return "__constructor"; + case 181: + case 176: + case 326: + return "__call"; + case 182: + case 177: + return "__new"; + case 178: + return "__index"; + case 275: + return "__export"; + case 308: + return "export="; + case 223: + if (ts2.getAssignmentDeclarationKind(node) === 2) { + return "export="; + } + ts2.Debug.fail("Unknown binary declaration kind"); + break; + case 320: + return ts2.isJSDocConstructSignature(node) ? "__new" : "__call"; + case 166: + ts2.Debug.assert(node.parent.kind === 320, "Impossible parameter parent kind", function() { + return "parent is: ".concat(ts2.Debug.formatSyntaxKind(node.parent.kind), ", expected JSDocFunctionType"); + }); + var functionType2 = node.parent; + var index4 = functionType2.parameters.indexOf(node); + return "arg" + index4; + } + } + function getDisplayName(node) { + return ts2.isNamedDeclaration(node) ? ts2.declarationNameToString(node.name) : ts2.unescapeLeadingUnderscores(ts2.Debug.checkDefined(getDeclarationName(node))); + } + function declareSymbol(symbolTable, parent3, node, includes2, excludes, isReplaceableByMethod, isComputedName) { + ts2.Debug.assert(isComputedName || !ts2.hasDynamicName(node)); + var isDefaultExport = ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ) || ts2.isExportSpecifier(node) && node.name.escapedText === "default"; + var name2 = isComputedName ? "__computed" : isDefaultExport && parent3 ? "default" : getDeclarationName(node); + var symbol; + if (name2 === void 0) { + symbol = createSymbol( + 0, + "__missing" + /* InternalSymbolName.Missing */ + ); + } else { + symbol = symbolTable.get(name2); + if (includes2 & 2885600) { + classifiableNames.add(name2); + } + if (!symbol) { + symbolTable.set(name2, symbol = createSymbol(0, name2)); + if (isReplaceableByMethod) + symbol.isReplaceableByMethod = true; + } else if (isReplaceableByMethod && !symbol.isReplaceableByMethod) { + return symbol; + } else if (symbol.flags & excludes) { + if (symbol.isReplaceableByMethod) { + symbolTable.set(name2, symbol = createSymbol(0, name2)); + } else if (!(includes2 & 3 && symbol.flags & 67108864)) { + if (ts2.isNamedDeclaration(node)) { + ts2.setParent(node.name, node); + } + var message_1 = symbol.flags & 2 ? ts2.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts2.Diagnostics.Duplicate_identifier_0; + var messageNeedsName_1 = true; + if (symbol.flags & 384 || includes2 & 384) { + message_1 = ts2.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + messageNeedsName_1 = false; + } + var multipleDefaultExports_1 = false; + if (ts2.length(symbol.declarations)) { + if (isDefaultExport) { + message_1 = ts2.Diagnostics.A_module_cannot_have_multiple_default_exports; + messageNeedsName_1 = false; + multipleDefaultExports_1 = true; + } else { + if (symbol.declarations && symbol.declarations.length && (node.kind === 274 && !node.isExportEquals)) { + message_1 = ts2.Diagnostics.A_module_cannot_have_multiple_default_exports; + messageNeedsName_1 = false; + multipleDefaultExports_1 = true; + } + } + } + var relatedInformation_1 = []; + if (ts2.isTypeAliasDeclaration(node) && ts2.nodeIsMissing(node.type) && ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ) && symbol.flags & (2097152 | 788968 | 1920)) { + relatedInformation_1.push(createDiagnosticForNode(node, ts2.Diagnostics.Did_you_mean_0, "export type { ".concat(ts2.unescapeLeadingUnderscores(node.name.escapedText), " }"))); + } + var declarationName_1 = ts2.getNameOfDeclaration(node) || node; + ts2.forEach(symbol.declarations, function(declaration, index4) { + var decl = ts2.getNameOfDeclaration(declaration) || declaration; + var diag2 = createDiagnosticForNode(decl, message_1, messageNeedsName_1 ? getDisplayName(declaration) : void 0); + file.bindDiagnostics.push(multipleDefaultExports_1 ? ts2.addRelatedInfo(diag2, createDiagnosticForNode(declarationName_1, index4 === 0 ? ts2.Diagnostics.Another_export_default_is_here : ts2.Diagnostics.and_here)) : diag2); + if (multipleDefaultExports_1) { + relatedInformation_1.push(createDiagnosticForNode(decl, ts2.Diagnostics.The_first_export_default_is_here)); + } + }); + var diag = createDiagnosticForNode(declarationName_1, message_1, messageNeedsName_1 ? getDisplayName(node) : void 0); + file.bindDiagnostics.push(ts2.addRelatedInfo.apply(void 0, __spreadArray9([diag], relatedInformation_1, false))); + symbol = createSymbol(0, name2); + } + } + } + addDeclarationToSymbol(symbol, node, includes2); + if (symbol.parent) { + ts2.Debug.assert(symbol.parent === parent3, "Existing symbol parent should match new one"); + } else { + symbol.parent = parent3; + } + return symbol; + } + function declareModuleMember(node, symbolFlags, symbolExcludes) { + var hasExportModifier = !!(ts2.getCombinedModifierFlags(node) & 1) || jsdocTreatAsExported(node); + if (symbolFlags & 2097152) { + if (node.kind === 278 || node.kind === 268 && hasExportModifier) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } else { + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } else { + if (ts2.isJSDocTypeAlias(node)) + ts2.Debug.assert(ts2.isInJSFile(node)); + if (!ts2.isAmbientModule(node) && (hasExportModifier || container.flags & 64)) { + if (!container.locals || ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ) && !getDeclarationName(node)) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } + var exportKind = symbolFlags & 111551 ? 1048576 : 0; + var local = declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + exportKind, + symbolExcludes + ); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + node.localSymbol = local; + return local; + } else { + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + } + function jsdocTreatAsExported(node) { + if (node.parent && ts2.isModuleDeclaration(node)) { + node = node.parent; + } + if (!ts2.isJSDocTypeAlias(node)) + return false; + if (!ts2.isJSDocEnumTag(node) && !!node.fullName) + return true; + var declName = ts2.getNameOfDeclaration(node); + if (!declName) + return false; + if (ts2.isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) + return true; + if (ts2.isDeclaration(declName.parent) && ts2.getCombinedModifierFlags(declName.parent) & 1) + return true; + return false; + } + function bindContainer(node, containerFlags) { + var saveContainer = container; + var saveThisParentContainer = thisParentContainer; + var savedBlockScopeContainer = blockScopeContainer; + if (containerFlags & 1) { + if (node.kind !== 216) { + thisParentContainer = container; + } + container = blockScopeContainer = node; + if (containerFlags & 32) { + container.locals = ts2.createSymbolTable(); + } + addToContainerChain(container); + } else if (containerFlags & 2) { + blockScopeContainer = node; + blockScopeContainer.locals = void 0; + } + if (containerFlags & 4) { + var saveCurrentFlow = currentFlow; + var saveBreakTarget = currentBreakTarget; + var saveContinueTarget = currentContinueTarget; + var saveReturnTarget = currentReturnTarget; + var saveExceptionTarget = currentExceptionTarget; + var saveActiveLabelList = activeLabelList; + var saveHasExplicitReturn = hasExplicitReturn; + var isImmediatelyInvoked = containerFlags & 16 && !ts2.hasSyntacticModifier( + node, + 512 + /* ModifierFlags.Async */ + ) && !node.asteriskToken && !!ts2.getImmediatelyInvokedFunctionExpression(node) || node.kind === 172; + if (!isImmediatelyInvoked) { + currentFlow = initFlowNode({ + flags: 2 + /* FlowFlags.Start */ + }); + if (containerFlags & (16 | 128)) { + currentFlow.node = node; + } + } + currentReturnTarget = isImmediatelyInvoked || node.kind === 173 || ts2.isInJSFile(node) && (node.kind === 259 || node.kind === 215) ? createBranchLabel() : void 0; + currentExceptionTarget = void 0; + currentBreakTarget = void 0; + currentContinueTarget = void 0; + activeLabelList = void 0; + hasExplicitReturn = false; + bindChildren(node); + node.flags &= ~2816; + if (!(currentFlow.flags & 1) && containerFlags & 8 && ts2.nodeIsPresent(node.body)) { + node.flags |= 256; + if (hasExplicitReturn) + node.flags |= 512; + node.endFlowNode = currentFlow; + } + if (node.kind === 308) { + node.flags |= emitFlags; + node.endFlowNode = currentFlow; + } + if (currentReturnTarget) { + addAntecedent(currentReturnTarget, currentFlow); + currentFlow = finishFlowLabel(currentReturnTarget); + if (node.kind === 173 || node.kind === 172 || ts2.isInJSFile(node) && (node.kind === 259 || node.kind === 215)) { + node.returnFlowNode = currentFlow; + } + } + if (!isImmediatelyInvoked) { + currentFlow = saveCurrentFlow; + } + currentBreakTarget = saveBreakTarget; + currentContinueTarget = saveContinueTarget; + currentReturnTarget = saveReturnTarget; + currentExceptionTarget = saveExceptionTarget; + activeLabelList = saveActiveLabelList; + hasExplicitReturn = saveHasExplicitReturn; + } else if (containerFlags & 64) { + seenThisKeyword = false; + bindChildren(node); + node.flags = seenThisKeyword ? node.flags | 128 : node.flags & ~128; + } else { + bindChildren(node); + } + container = saveContainer; + thisParentContainer = saveThisParentContainer; + blockScopeContainer = savedBlockScopeContainer; + } + function bindEachFunctionsFirst(nodes) { + bindEach(nodes, function(n7) { + return n7.kind === 259 ? bind2(n7) : void 0; + }); + bindEach(nodes, function(n7) { + return n7.kind !== 259 ? bind2(n7) : void 0; + }); + } + function bindEach(nodes, bindFunction) { + if (bindFunction === void 0) { + bindFunction = bind2; + } + if (nodes === void 0) { + return; + } + ts2.forEach(nodes, bindFunction); + } + function bindEachChild(node) { + ts2.forEachChild(node, bind2, bindEach); + } + function bindChildren(node) { + var saveInAssignmentPattern = inAssignmentPattern; + inAssignmentPattern = false; + if (checkUnreachable(node)) { + bindEachChild(node); + bindJSDoc(node); + inAssignmentPattern = saveInAssignmentPattern; + return; + } + if (node.kind >= 240 && node.kind <= 256 && !options.allowUnreachableCode) { + node.flowNode = currentFlow; + } + switch (node.kind) { + case 244: + bindWhileStatement(node); + break; + case 243: + bindDoStatement(node); + break; + case 245: + bindForStatement(node); + break; + case 246: + case 247: + bindForInOrForOfStatement(node); + break; + case 242: + bindIfStatement(node); + break; + case 250: + case 254: + bindReturnOrThrow(node); + break; + case 249: + case 248: + bindBreakOrContinueStatement(node); + break; + case 255: + bindTryStatement(node); + break; + case 252: + bindSwitchStatement(node); + break; + case 266: + bindCaseBlock(node); + break; + case 292: + bindCaseClause(node); + break; + case 241: + bindExpressionStatement(node); + break; + case 253: + bindLabeledStatement(node); + break; + case 221: + bindPrefixUnaryExpressionFlow(node); + break; + case 222: + bindPostfixUnaryExpressionFlow(node); + break; + case 223: + if (ts2.isDestructuringAssignment(node)) { + inAssignmentPattern = saveInAssignmentPattern; + bindDestructuringAssignmentFlow(node); + return; + } + bindBinaryExpressionFlow(node); + break; + case 217: + bindDeleteExpressionFlow(node); + break; + case 224: + bindConditionalExpressionFlow(node); + break; + case 257: + bindVariableDeclarationFlow(node); + break; + case 208: + case 209: + bindAccessExpressionFlow(node); + break; + case 210: + bindCallExpressionFlow(node); + break; + case 232: + bindNonNullExpressionFlow(node); + break; + case 348: + case 341: + case 342: + bindJSDocTypeAlias(node); + break; + case 308: { + bindEachFunctionsFirst(node.statements); + bind2(node.endOfFileToken); + break; + } + case 238: + case 265: + bindEachFunctionsFirst(node.statements); + break; + case 205: + bindBindingElementFlow(node); + break; + case 166: + bindParameterFlow(node); + break; + case 207: + case 206: + case 299: + case 227: + inAssignmentPattern = saveInAssignmentPattern; + default: + bindEachChild(node); + break; + } + bindJSDoc(node); + inAssignmentPattern = saveInAssignmentPattern; + } + function isNarrowingExpression(expr) { + switch (expr.kind) { + case 79: + case 80: + case 108: + case 208: + case 209: + return containsNarrowableReference(expr); + case 210: + return hasNarrowableArgument(expr); + case 214: + case 232: + return isNarrowingExpression(expr.expression); + case 223: + return isNarrowingBinaryExpression(expr); + case 221: + return expr.operator === 53 && isNarrowingExpression(expr.operand); + case 218: + return isNarrowingExpression(expr.expression); + } + return false; + } + function isNarrowableReference(expr) { + return ts2.isDottedName(expr) || (ts2.isPropertyAccessExpression(expr) || ts2.isNonNullExpression(expr) || ts2.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || ts2.isBinaryExpression(expr) && expr.operatorToken.kind === 27 && isNarrowableReference(expr.right) || ts2.isElementAccessExpression(expr) && (ts2.isStringOrNumericLiteralLike(expr.argumentExpression) || ts2.isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression) || ts2.isAssignmentExpression(expr) && isNarrowableReference(expr.left); + } + function containsNarrowableReference(expr) { + return isNarrowableReference(expr) || ts2.isOptionalChain(expr) && containsNarrowableReference(expr.expression); + } + function hasNarrowableArgument(expr) { + if (expr.arguments) { + for (var _i = 0, _a2 = expr.arguments; _i < _a2.length; _i++) { + var argument = _a2[_i]; + if (containsNarrowableReference(argument)) { + return true; + } + } + } + if (expr.expression.kind === 208 && containsNarrowableReference(expr.expression.expression)) { + return true; + } + return false; + } + function isNarrowingTypeofOperands(expr1, expr2) { + return ts2.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts2.isStringLiteralLike(expr2); + } + function isNarrowingBinaryExpression(expr) { + switch (expr.operatorToken.kind) { + case 63: + case 75: + case 76: + case 77: + return containsNarrowableReference(expr.left); + case 34: + case 35: + case 36: + case 37: + return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); + case 102: + return isNarrowableOperand(expr.left); + case 101: + return isNarrowingExpression(expr.right); + case 27: + return isNarrowingExpression(expr.right); + } + return false; + } + function isNarrowableOperand(expr) { + switch (expr.kind) { + case 214: + return isNarrowableOperand(expr.expression); + case 223: + switch (expr.operatorToken.kind) { + case 63: + return isNarrowableOperand(expr.left); + case 27: + return isNarrowableOperand(expr.right); + } + } + return containsNarrowableReference(expr); + } + function createBranchLabel() { + return initFlowNode({ flags: 4, antecedents: void 0 }); + } + function createLoopLabel() { + return initFlowNode({ flags: 8, antecedents: void 0 }); + } + function createReduceLabel(target, antecedents, antecedent) { + return initFlowNode({ flags: 1024, target, antecedents, antecedent }); + } + function setFlowNodeReferenced(flow2) { + flow2.flags |= flow2.flags & 2048 ? 4096 : 2048; + } + function addAntecedent(label, antecedent) { + if (!(antecedent.flags & 1) && !ts2.contains(label.antecedents, antecedent)) { + (label.antecedents || (label.antecedents = [])).push(antecedent); + setFlowNodeReferenced(antecedent); + } + } + function createFlowCondition(flags, antecedent, expression) { + if (antecedent.flags & 1) { + return antecedent; + } + if (!expression) { + return flags & 32 ? antecedent : unreachableFlow; + } + if ((expression.kind === 110 && flags & 64 || expression.kind === 95 && flags & 32) && !ts2.isExpressionOfOptionalChainRoot(expression) && !ts2.isNullishCoalesce(expression.parent)) { + return unreachableFlow; + } + if (!isNarrowingExpression(expression)) { + return antecedent; + } + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags, antecedent, node: expression }); + } + function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags: 128, antecedent, switchStatement, clauseStart, clauseEnd }); + } + function createFlowMutation(flags, antecedent, node) { + setFlowNodeReferenced(antecedent); + var result2 = initFlowNode({ flags, antecedent, node }); + if (currentExceptionTarget) { + addAntecedent(currentExceptionTarget, result2); + } + return result2; + } + function createFlowCall(antecedent, node) { + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags: 512, antecedent, node }); + } + function finishFlowLabel(flow2) { + var antecedents = flow2.antecedents; + if (!antecedents) { + return unreachableFlow; + } + if (antecedents.length === 1) { + return antecedents[0]; + } + return flow2; + } + function isStatementCondition(node) { + var parent3 = node.parent; + switch (parent3.kind) { + case 242: + case 244: + case 243: + return parent3.expression === node; + case 245: + case 224: + return parent3.condition === node; + } + return false; + } + function isLogicalExpression(node) { + while (true) { + if (node.kind === 214) { + node = node.expression; + } else if (node.kind === 221 && node.operator === 53) { + node = node.operand; + } else { + return node.kind === 223 && (node.operatorToken.kind === 55 || node.operatorToken.kind === 56 || node.operatorToken.kind === 60); + } + } + } + function isLogicalAssignmentExpression(node) { + node = ts2.skipParentheses(node); + return ts2.isBinaryExpression(node) && ts2.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); + } + function isTopLevelLogicalExpression(node) { + while (ts2.isParenthesizedExpression(node.parent) || ts2.isPrefixUnaryExpression(node.parent) && node.parent.operator === 53) { + node = node.parent; + } + return !isStatementCondition(node) && !isLogicalExpression(node.parent) && !(ts2.isOptionalChain(node.parent) && node.parent.expression === node); + } + function doWithConditionalBranches(action, value2, trueTarget, falseTarget) { + var savedTrueTarget = currentTrueTarget; + var savedFalseTarget = currentFalseTarget; + currentTrueTarget = trueTarget; + currentFalseTarget = falseTarget; + action(value2); + currentTrueTarget = savedTrueTarget; + currentFalseTarget = savedFalseTarget; + } + function bindCondition(node, trueTarget, falseTarget) { + doWithConditionalBranches(bind2, node, trueTarget, falseTarget); + if (!node || !isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(ts2.isOptionalChain(node) && ts2.isOutermostOptionalChain(node))) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindIterativeStatement(node, breakTarget, continueTarget) { + var saveBreakTarget = currentBreakTarget; + var saveContinueTarget = currentContinueTarget; + currentBreakTarget = breakTarget; + currentContinueTarget = continueTarget; + bind2(node); + currentBreakTarget = saveBreakTarget; + currentContinueTarget = saveContinueTarget; + } + function setContinueTarget(node, target) { + var label = activeLabelList; + while (label && node.parent.kind === 253) { + label.continueTarget = target; + label = label.next; + node = node.parent; + } + return target; + } + function bindWhileStatement(node) { + var preWhileLabel = setContinueTarget(node, createLoopLabel()); + var preBodyLabel = createBranchLabel(); + var postWhileLabel = createBranchLabel(); + addAntecedent(preWhileLabel, currentFlow); + currentFlow = preWhileLabel; + bindCondition(node.expression, preBodyLabel, postWhileLabel); + currentFlow = finishFlowLabel(preBodyLabel); + bindIterativeStatement(node.statement, postWhileLabel, preWhileLabel); + addAntecedent(preWhileLabel, currentFlow); + currentFlow = finishFlowLabel(postWhileLabel); + } + function bindDoStatement(node) { + var preDoLabel = createLoopLabel(); + var preConditionLabel = setContinueTarget(node, createBranchLabel()); + var postDoLabel = createBranchLabel(); + addAntecedent(preDoLabel, currentFlow); + currentFlow = preDoLabel; + bindIterativeStatement(node.statement, postDoLabel, preConditionLabel); + addAntecedent(preConditionLabel, currentFlow); + currentFlow = finishFlowLabel(preConditionLabel); + bindCondition(node.expression, preDoLabel, postDoLabel); + currentFlow = finishFlowLabel(postDoLabel); + } + function bindForStatement(node) { + var preLoopLabel = setContinueTarget(node, createLoopLabel()); + var preBodyLabel = createBranchLabel(); + var postLoopLabel = createBranchLabel(); + bind2(node.initializer); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = preLoopLabel; + bindCondition(node.condition, preBodyLabel, postLoopLabel); + currentFlow = finishFlowLabel(preBodyLabel); + bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); + bind2(node.incrementor); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = finishFlowLabel(postLoopLabel); + } + function bindForInOrForOfStatement(node) { + var preLoopLabel = setContinueTarget(node, createLoopLabel()); + var postLoopLabel = createBranchLabel(); + bind2(node.expression); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = preLoopLabel; + if (node.kind === 247) { + bind2(node.awaitModifier); + } + addAntecedent(postLoopLabel, currentFlow); + bind2(node.initializer); + if (node.initializer.kind !== 258) { + bindAssignmentTargetFlow(node.initializer); + } + bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = finishFlowLabel(postLoopLabel); + } + function bindIfStatement(node) { + var thenLabel = createBranchLabel(); + var elseLabel = createBranchLabel(); + var postIfLabel = createBranchLabel(); + bindCondition(node.expression, thenLabel, elseLabel); + currentFlow = finishFlowLabel(thenLabel); + bind2(node.thenStatement); + addAntecedent(postIfLabel, currentFlow); + currentFlow = finishFlowLabel(elseLabel); + bind2(node.elseStatement); + addAntecedent(postIfLabel, currentFlow); + currentFlow = finishFlowLabel(postIfLabel); + } + function bindReturnOrThrow(node) { + bind2(node.expression); + if (node.kind === 250) { + hasExplicitReturn = true; + if (currentReturnTarget) { + addAntecedent(currentReturnTarget, currentFlow); + } + } + currentFlow = unreachableFlow; + } + function findActiveLabel(name2) { + for (var label = activeLabelList; label; label = label.next) { + if (label.name === name2) { + return label; + } + } + return void 0; + } + function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { + var flowLabel = node.kind === 249 ? breakTarget : continueTarget; + if (flowLabel) { + addAntecedent(flowLabel, currentFlow); + currentFlow = unreachableFlow; + } + } + function bindBreakOrContinueStatement(node) { + bind2(node.label); + if (node.label) { + var activeLabel = findActiveLabel(node.label.escapedText); + if (activeLabel) { + activeLabel.referenced = true; + bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget); + } + } else { + bindBreakOrContinueFlow(node, currentBreakTarget, currentContinueTarget); + } + } + function bindTryStatement(node) { + var saveReturnTarget = currentReturnTarget; + var saveExceptionTarget = currentExceptionTarget; + var normalExitLabel = createBranchLabel(); + var returnLabel = createBranchLabel(); + var exceptionLabel = createBranchLabel(); + if (node.finallyBlock) { + currentReturnTarget = returnLabel; + } + addAntecedent(exceptionLabel, currentFlow); + currentExceptionTarget = exceptionLabel; + bind2(node.tryBlock); + addAntecedent(normalExitLabel, currentFlow); + if (node.catchClause) { + currentFlow = finishFlowLabel(exceptionLabel); + exceptionLabel = createBranchLabel(); + addAntecedent(exceptionLabel, currentFlow); + currentExceptionTarget = exceptionLabel; + bind2(node.catchClause); + addAntecedent(normalExitLabel, currentFlow); + } + currentReturnTarget = saveReturnTarget; + currentExceptionTarget = saveExceptionTarget; + if (node.finallyBlock) { + var finallyLabel = createBranchLabel(); + finallyLabel.antecedents = ts2.concatenate(ts2.concatenate(normalExitLabel.antecedents, exceptionLabel.antecedents), returnLabel.antecedents); + currentFlow = finallyLabel; + bind2(node.finallyBlock); + if (currentFlow.flags & 1) { + currentFlow = unreachableFlow; + } else { + if (currentReturnTarget && returnLabel.antecedents) { + addAntecedent(currentReturnTarget, createReduceLabel(finallyLabel, returnLabel.antecedents, currentFlow)); + } + if (currentExceptionTarget && exceptionLabel.antecedents) { + addAntecedent(currentExceptionTarget, createReduceLabel(finallyLabel, exceptionLabel.antecedents, currentFlow)); + } + currentFlow = normalExitLabel.antecedents ? createReduceLabel(finallyLabel, normalExitLabel.antecedents, currentFlow) : unreachableFlow; + } + } else { + currentFlow = finishFlowLabel(normalExitLabel); + } + } + function bindSwitchStatement(node) { + var postSwitchLabel = createBranchLabel(); + bind2(node.expression); + var saveBreakTarget = currentBreakTarget; + var savePreSwitchCaseFlow = preSwitchCaseFlow; + currentBreakTarget = postSwitchLabel; + preSwitchCaseFlow = currentFlow; + bind2(node.caseBlock); + addAntecedent(postSwitchLabel, currentFlow); + var hasDefault = ts2.forEach(node.caseBlock.clauses, function(c7) { + return c7.kind === 293; + }); + node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; + if (!hasDefault) { + addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); + } + currentBreakTarget = saveBreakTarget; + preSwitchCaseFlow = savePreSwitchCaseFlow; + currentFlow = finishFlowLabel(postSwitchLabel); + } + function bindCaseBlock(node) { + var clauses = node.clauses; + var isNarrowingSwitch = isNarrowingExpression(node.parent.expression); + var fallthroughFlow = unreachableFlow; + for (var i7 = 0; i7 < clauses.length; i7++) { + var clauseStart = i7; + while (!clauses[i7].statements.length && i7 + 1 < clauses.length) { + bind2(clauses[i7]); + i7++; + } + var preCaseLabel = createBranchLabel(); + addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i7 + 1) : preSwitchCaseFlow); + addAntecedent(preCaseLabel, fallthroughFlow); + currentFlow = finishFlowLabel(preCaseLabel); + var clause = clauses[i7]; + bind2(clause); + fallthroughFlow = currentFlow; + if (!(currentFlow.flags & 1) && i7 !== clauses.length - 1 && options.noFallthroughCasesInSwitch) { + clause.fallthroughFlowNode = currentFlow; + } + } + } + function bindCaseClause(node) { + var saveCurrentFlow = currentFlow; + currentFlow = preSwitchCaseFlow; + bind2(node.expression); + currentFlow = saveCurrentFlow; + bindEach(node.statements); + } + function bindExpressionStatement(node) { + bind2(node.expression); + maybeBindExpressionFlowIfCall(node.expression); + } + function maybeBindExpressionFlowIfCall(node) { + if (node.kind === 210) { + var call = node; + if (call.expression.kind !== 106 && ts2.isDottedName(call.expression)) { + currentFlow = createFlowCall(currentFlow, call); + } + } + } + function bindLabeledStatement(node) { + var postStatementLabel = createBranchLabel(); + activeLabelList = { + next: activeLabelList, + name: node.label.escapedText, + breakTarget: postStatementLabel, + continueTarget: void 0, + referenced: false + }; + bind2(node.label); + bind2(node.statement); + if (!activeLabelList.referenced && !options.allowUnusedLabels) { + errorOrSuggestionOnNode(ts2.unusedLabelIsError(options), node.label, ts2.Diagnostics.Unused_label); + } + activeLabelList = activeLabelList.next; + addAntecedent(postStatementLabel, currentFlow); + currentFlow = finishFlowLabel(postStatementLabel); + } + function bindDestructuringTargetFlow(node) { + if (node.kind === 223 && node.operatorToken.kind === 63) { + bindAssignmentTargetFlow(node.left); + } else { + bindAssignmentTargetFlow(node); + } + } + function bindAssignmentTargetFlow(node) { + if (isNarrowableReference(node)) { + currentFlow = createFlowMutation(16, currentFlow, node); + } else if (node.kind === 206) { + for (var _i = 0, _a2 = node.elements; _i < _a2.length; _i++) { + var e10 = _a2[_i]; + if (e10.kind === 227) { + bindAssignmentTargetFlow(e10.expression); + } else { + bindDestructuringTargetFlow(e10); + } + } + } else if (node.kind === 207) { + for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { + var p7 = _c[_b]; + if (p7.kind === 299) { + bindDestructuringTargetFlow(p7.initializer); + } else if (p7.kind === 300) { + bindAssignmentTargetFlow(p7.name); + } else if (p7.kind === 301) { + bindAssignmentTargetFlow(p7.expression); + } + } + } + } + function bindLogicalLikeExpression(node, trueTarget, falseTarget) { + var preRightLabel = createBranchLabel(); + if (node.operatorToken.kind === 55 || node.operatorToken.kind === 76) { + bindCondition(node.left, preRightLabel, falseTarget); + } else { + bindCondition(node.left, trueTarget, preRightLabel); + } + currentFlow = finishFlowLabel(preRightLabel); + bind2(node.operatorToken); + if (ts2.isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) { + doWithConditionalBranches(bind2, node.right, trueTarget, falseTarget); + bindAssignmentTargetFlow(node.left); + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } else { + bindCondition(node.right, trueTarget, falseTarget); + } + } + function bindPrefixUnaryExpressionFlow(node) { + if (node.operator === 53) { + var saveTrueTarget = currentTrueTarget; + currentTrueTarget = currentFalseTarget; + currentFalseTarget = saveTrueTarget; + bindEachChild(node); + currentFalseTarget = currentTrueTarget; + currentTrueTarget = saveTrueTarget; + } else { + bindEachChild(node); + if (node.operator === 45 || node.operator === 46) { + bindAssignmentTargetFlow(node.operand); + } + } + } + function bindPostfixUnaryExpressionFlow(node) { + bindEachChild(node); + if (node.operator === 45 || node.operator === 46) { + bindAssignmentTargetFlow(node.operand); + } + } + function bindDestructuringAssignmentFlow(node) { + if (inAssignmentPattern) { + inAssignmentPattern = false; + bind2(node.operatorToken); + bind2(node.right); + inAssignmentPattern = true; + bind2(node.left); + } else { + inAssignmentPattern = true; + bind2(node.left); + inAssignmentPattern = false; + bind2(node.operatorToken); + bind2(node.right); + } + bindAssignmentTargetFlow(node.left); + } + function createBindBinaryExpressionFlow() { + return ts2.createBinaryExpressionTrampoline( + onEnter, + onLeft, + onOperator, + onRight, + onExit, + /*foldState*/ + void 0 + ); + function onEnter(node, state) { + if (state) { + state.stackIndex++; + ts2.setParent(node, parent2); + var saveInStrictMode = inStrictMode; + bindWorker(node); + var saveParent = parent2; + parent2 = node; + state.skip = false; + state.inStrictModeStack[state.stackIndex] = saveInStrictMode; + state.parentStack[state.stackIndex] = saveParent; + } else { + state = { + stackIndex: 0, + skip: false, + inStrictModeStack: [void 0], + parentStack: [void 0] + }; + } + var operator = node.operatorToken.kind; + if (operator === 55 || operator === 56 || operator === 60 || ts2.isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isTopLevelLogicalExpression(node)) { + var postExpressionLabel = createBranchLabel(); + bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); + currentFlow = finishFlowLabel(postExpressionLabel); + } else { + bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget); + } + state.skip = true; + } + return state; + } + function onLeft(left, state, node) { + if (!state.skip) { + var maybeBound = maybeBind(left); + if (node.operatorToken.kind === 27) { + maybeBindExpressionFlowIfCall(left); + } + return maybeBound; + } + } + function onOperator(operatorToken, state, _node) { + if (!state.skip) { + bind2(operatorToken); + } + } + function onRight(right, state, node) { + if (!state.skip) { + var maybeBound = maybeBind(right); + if (node.operatorToken.kind === 27) { + maybeBindExpressionFlowIfCall(right); + } + return maybeBound; + } + } + function onExit(node, state) { + if (!state.skip) { + var operator = node.operatorToken.kind; + if (ts2.isAssignmentOperator(operator) && !ts2.isAssignmentTarget(node)) { + bindAssignmentTargetFlow(node.left); + if (operator === 63 && node.left.kind === 209) { + var elementAccess = node.left; + if (isNarrowableOperand(elementAccess.expression)) { + currentFlow = createFlowMutation(256, currentFlow, node); + } + } + } + } + var savedInStrictMode = state.inStrictModeStack[state.stackIndex]; + var savedParent = state.parentStack[state.stackIndex]; + if (savedInStrictMode !== void 0) { + inStrictMode = savedInStrictMode; + } + if (savedParent !== void 0) { + parent2 = savedParent; + } + state.skip = false; + state.stackIndex--; + } + function maybeBind(node) { + if (node && ts2.isBinaryExpression(node) && !ts2.isDestructuringAssignment(node)) { + return node; + } + bind2(node); + } + } + function bindDeleteExpressionFlow(node) { + bindEachChild(node); + if (node.expression.kind === 208) { + bindAssignmentTargetFlow(node.expression); + } + } + function bindConditionalExpressionFlow(node) { + var trueLabel = createBranchLabel(); + var falseLabel = createBranchLabel(); + var postExpressionLabel = createBranchLabel(); + bindCondition(node.condition, trueLabel, falseLabel); + currentFlow = finishFlowLabel(trueLabel); + bind2(node.questionToken); + bind2(node.whenTrue); + addAntecedent(postExpressionLabel, currentFlow); + currentFlow = finishFlowLabel(falseLabel); + bind2(node.colonToken); + bind2(node.whenFalse); + addAntecedent(postExpressionLabel, currentFlow); + currentFlow = finishFlowLabel(postExpressionLabel); + } + function bindInitializedVariableFlow(node) { + var name2 = !ts2.isOmittedExpression(node) ? node.name : void 0; + if (ts2.isBindingPattern(name2)) { + for (var _i = 0, _a2 = name2.elements; _i < _a2.length; _i++) { + var child = _a2[_i]; + bindInitializedVariableFlow(child); + } + } else { + currentFlow = createFlowMutation(16, currentFlow, node); + } + } + function bindVariableDeclarationFlow(node) { + bindEachChild(node); + if (node.initializer || ts2.isForInOrOfStatement(node.parent.parent)) { + bindInitializedVariableFlow(node); + } + } + function bindBindingElementFlow(node) { + bind2(node.dotDotDotToken); + bind2(node.propertyName); + bindInitializer(node.initializer); + bind2(node.name); + } + function bindParameterFlow(node) { + bindEach(node.modifiers); + bind2(node.dotDotDotToken); + bind2(node.questionToken); + bind2(node.type); + bindInitializer(node.initializer); + bind2(node.name); + } + function bindInitializer(node) { + if (!node) { + return; + } + var entryFlow = currentFlow; + bind2(node); + if (entryFlow === unreachableFlow || entryFlow === currentFlow) { + return; + } + var exitFlow = createBranchLabel(); + addAntecedent(exitFlow, entryFlow); + addAntecedent(exitFlow, currentFlow); + currentFlow = finishFlowLabel(exitFlow); + } + function bindJSDocTypeAlias(node) { + bind2(node.tagName); + if (node.kind !== 342 && node.fullName) { + ts2.setParent(node.fullName, node); + ts2.setParentRecursive( + node.fullName, + /*incremental*/ + false + ); + } + if (typeof node.comment !== "string") { + bindEach(node.comment); + } + } + function bindJSDocClassTag(node) { + bindEachChild(node); + var host = ts2.getHostSignatureFromJSDoc(node); + if (host && host.kind !== 171) { + addDeclarationToSymbol( + host.symbol, + host, + 32 + /* SymbolFlags.Class */ + ); + } + } + function bindOptionalExpression(node, trueTarget, falseTarget) { + doWithConditionalBranches(bind2, node, trueTarget, falseTarget); + if (!ts2.isOptionalChain(node) || ts2.isOutermostOptionalChain(node)) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindOptionalChainRest(node) { + switch (node.kind) { + case 208: + bind2(node.questionDotToken); + bind2(node.name); + break; + case 209: + bind2(node.questionDotToken); + bind2(node.argumentExpression); + break; + case 210: + bind2(node.questionDotToken); + bindEach(node.typeArguments); + bindEach(node.arguments); + break; + } + } + function bindOptionalChain(node, trueTarget, falseTarget) { + var preChainLabel = ts2.isOptionalChainRoot(node) ? createBranchLabel() : void 0; + bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); + if (preChainLabel) { + currentFlow = finishFlowLabel(preChainLabel); + } + doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget); + if (ts2.isOutermostOptionalChain(node)) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindOptionalChainFlow(node) { + if (isTopLevelLogicalExpression(node)) { + var postExpressionLabel = createBranchLabel(); + bindOptionalChain(node, postExpressionLabel, postExpressionLabel); + currentFlow = finishFlowLabel(postExpressionLabel); + } else { + bindOptionalChain(node, currentTrueTarget, currentFalseTarget); + } + } + function bindNonNullExpressionFlow(node) { + if (ts2.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + bindEachChild(node); + } + } + function bindAccessExpressionFlow(node) { + if (ts2.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + bindEachChild(node); + } + } + function bindCallExpressionFlow(node) { + if (ts2.isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + var expr = ts2.skipParentheses(node.expression); + if (expr.kind === 215 || expr.kind === 216) { + bindEach(node.typeArguments); + bindEach(node.arguments); + bind2(node.expression); + } else { + bindEachChild(node); + if (node.expression.kind === 106) { + currentFlow = createFlowCall(currentFlow, node); + } + } + } + if (node.expression.kind === 208) { + var propertyAccess = node.expression; + if (ts2.isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && ts2.isPushOrUnshiftIdentifier(propertyAccess.name)) { + currentFlow = createFlowMutation(256, currentFlow, node); + } + } + } + function getContainerFlags(node) { + switch (node.kind) { + case 228: + case 260: + case 263: + case 207: + case 184: + case 325: + case 289: + return 1; + case 261: + return 1 | 64; + case 264: + case 262: + case 197: + case 178: + return 1 | 32; + case 308: + return 1 | 4 | 32; + case 174: + case 175: + case 171: + if (ts2.isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { + return 1 | 4 | 32 | 8 | 128; + } + case 173: + case 259: + case 170: + case 176: + case 326: + case 320: + case 181: + case 177: + case 182: + case 172: + return 1 | 4 | 32 | 8; + case 215: + case 216: + return 1 | 4 | 32 | 8 | 16; + case 265: + return 4; + case 169: + return node.initializer ? 4 : 0; + case 295: + case 245: + case 246: + case 247: + case 266: + return 2; + case 238: + return ts2.isFunctionLike(node.parent) || ts2.isClassStaticBlockDeclaration(node.parent) ? 0 : 2; + } + return 0; + } + function addToContainerChain(next) { + if (lastContainer) { + lastContainer.nextContainer = next; + } + lastContainer = next; + } + function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { + switch (container.kind) { + case 264: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 308: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 228: + case 260: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 263: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 184: + case 325: + case 207: + case 261: + case 289: + return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 181: + case 182: + case 176: + case 177: + case 326: + case 178: + case 171: + case 170: + case 173: + case 174: + case 175: + case 259: + case 215: + case 216: + case 320: + case 348: + case 341: + case 172: + case 262: + case 197: + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + function declareClassMember(node, symbolFlags, symbolExcludes) { + return ts2.isStatic(node) ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + } + function declareSourceFileMember(node, symbolFlags, symbolExcludes) { + return ts2.isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) : declareSymbol( + file.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + function hasExportDeclarations(node) { + var body = ts2.isSourceFile(node) ? node : ts2.tryCast(node.body, ts2.isModuleBlock); + return !!body && body.statements.some(function(s7) { + return ts2.isExportDeclaration(s7) || ts2.isExportAssignment(s7); + }); + } + function setExportContextFlag(node) { + if (node.flags & 16777216 && !hasExportDeclarations(node)) { + node.flags |= 64; + } else { + node.flags &= ~64; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (ts2.isAmbientModule(node)) { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + errorOnFirstToken(node, ts2.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } + if (ts2.isModuleAugmentationExternal(node)) { + declareModuleSymbol(node); + } else { + var pattern5 = void 0; + if (node.name.kind === 10) { + var text = node.name.text; + pattern5 = ts2.tryParsePattern(text); + if (pattern5 === void 0) { + errorOnFirstToken(node.name, ts2.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); + } + } + var symbol = declareSymbolAndAddToSymbolTable( + node, + 512, + 110735 + /* SymbolFlags.ValueModuleExcludes */ + ); + file.patternAmbientModules = ts2.append(file.patternAmbientModules, pattern5 && !ts2.isString(pattern5) ? { pattern: pattern5, symbol } : void 0); + } + } else { + var state = declareModuleSymbol(node); + if (state !== 0) { + var symbol = node.symbol; + symbol.constEnumOnlyModule = !(symbol.flags & (16 | 32 | 256)) && state === 2 && symbol.constEnumOnlyModule !== false; + } + } + } + function declareModuleSymbol(node) { + var state = getModuleInstanceState(node); + var instantiated = state !== 0; + declareSymbolAndAddToSymbolTable( + node, + instantiated ? 512 : 1024, + instantiated ? 110735 : 0 + /* SymbolFlags.NamespaceModuleExcludes */ + ); + return state; + } + function bindFunctionOrConstructorType(node) { + var symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol( + symbol, + node, + 131072 + /* SymbolFlags.Signature */ + ); + var typeLiteralSymbol = createSymbol( + 2048, + "__type" + /* InternalSymbolName.Type */ + ); + addDeclarationToSymbol( + typeLiteralSymbol, + node, + 2048 + /* SymbolFlags.TypeLiteral */ + ); + typeLiteralSymbol.members = ts2.createSymbolTable(); + typeLiteralSymbol.members.set(symbol.escapedName, symbol); + } + function bindObjectLiteralExpression(node) { + return bindAnonymousDeclaration( + node, + 4096, + "__object" + /* InternalSymbolName.Object */ + ); + } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration( + node, + 4096, + "__jsxAttributes" + /* InternalSymbolName.JSXAttributes */ + ); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + function bindAnonymousDeclaration(node, symbolFlags, name2) { + var symbol = createSymbol(symbolFlags, name2); + if (symbolFlags & (8 | 106500)) { + symbol.parent = container.symbol; + } + addDeclarationToSymbol(symbol, node, symbolFlags); + return symbol; + } + function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { + switch (blockScopeContainer.kind) { + case 264: + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + case 308: + if (ts2.isExternalOrCommonJsModule(container)) { + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + } + default: + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = ts2.createSymbolTable(); + addToContainerChain(blockScopeContainer); + } + declareSymbol( + blockScopeContainer.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + function delayedBindJSDocTypedefTag() { + if (!delayedTypeAliases) { + return; + } + var saveContainer = container; + var saveLastContainer = lastContainer; + var saveBlockScopeContainer = blockScopeContainer; + var saveParent = parent2; + var saveCurrentFlow = currentFlow; + for (var _i = 0, delayedTypeAliases_1 = delayedTypeAliases; _i < delayedTypeAliases_1.length; _i++) { + var typeAlias = delayedTypeAliases_1[_i]; + var host = typeAlias.parent.parent; + container = ts2.findAncestor(host.parent, function(n7) { + return !!(getContainerFlags(n7) & 1); + }) || file; + blockScopeContainer = ts2.getEnclosingBlockScopeContainer(host) || file; + currentFlow = initFlowNode({ + flags: 2 + /* FlowFlags.Start */ + }); + parent2 = typeAlias; + bind2(typeAlias.typeExpression); + var declName = ts2.getNameOfDeclaration(typeAlias); + if ((ts2.isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && ts2.isPropertyAccessEntityNameExpression(declName.parent)) { + var isTopLevel = isTopLevelNamespaceAssignment(declName.parent); + if (isTopLevel) { + bindPotentiallyMissingNamespaces( + file.symbol, + declName.parent, + isTopLevel, + !!ts2.findAncestor(declName, function(d7) { + return ts2.isPropertyAccessExpression(d7) && d7.name.escapedText === "prototype"; + }), + /*containerIsClass*/ + false + ); + var oldContainer = container; + switch (ts2.getAssignmentDeclarationPropertyAccessKind(declName.parent)) { + case 1: + case 2: + if (!ts2.isExternalOrCommonJsModule(file)) { + container = void 0; + } else { + container = file; + } + break; + case 4: + container = declName.parent.expression; + break; + case 3: + container = declName.parent.expression.name; + break; + case 5: + container = isExportsOrModuleExportsOrAlias(file, declName.parent.expression) ? file : ts2.isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; + break; + case 0: + return ts2.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration"); + } + if (container) { + declareModuleMember( + typeAlias, + 524288, + 788968 + /* SymbolFlags.TypeAliasExcludes */ + ); + } + container = oldContainer; + } + } else if (ts2.isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 79) { + parent2 = typeAlias.parent; + bindBlockScopedDeclaration( + typeAlias, + 524288, + 788968 + /* SymbolFlags.TypeAliasExcludes */ + ); + } else { + bind2(typeAlias.fullName); + } + } + container = saveContainer; + lastContainer = saveLastContainer; + blockScopeContainer = saveBlockScopeContainer; + parent2 = saveParent; + currentFlow = saveCurrentFlow; + } + function checkContextualIdentifier(node) { + if (!file.parseDiagnostics.length && !(node.flags & 16777216) && !(node.flags & 8388608) && !ts2.isIdentifierName(node)) { + if (inStrictMode && node.originalKeywordKind >= 117 && node.originalKeywordKind <= 125) { + file.bindDiagnostics.push(createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts2.declarationNameToString(node))); + } else if (node.originalKeywordKind === 133) { + if (ts2.isExternalModule(file) && ts2.isInTopLevelContext(node)) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, ts2.declarationNameToString(node))); + } else if (node.flags & 32768) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts2.declarationNameToString(node))); + } + } else if (node.originalKeywordKind === 125 && node.flags & 8192) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, ts2.declarationNameToString(node))); + } + } + } + function getStrictModeIdentifierMessage(node) { + if (ts2.getContainingClass(node)) { + return ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; + } + return ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; + } + function checkPrivateIdentifier(node) { + if (node.escapedText === "#constructor") { + if (!file.parseDiagnostics.length) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.constructor_is_a_reserved_word, ts2.declarationNameToString(node))); + } + } + } + function checkStrictModeBinaryExpression(node) { + if (inStrictMode && ts2.isLeftHandSideExpression(node.left) && ts2.isAssignmentOperator(node.operatorToken.kind)) { + checkStrictModeEvalOrArguments(node, node.left); + } + } + function checkStrictModeCatchClause(node) { + if (inStrictMode && node.variableDeclaration) { + checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); + } + } + function checkStrictModeDeleteExpression(node) { + if (inStrictMode && node.expression.kind === 79) { + var span = ts2.getErrorSpanForNode(file, node.expression); + file.bindDiagnostics.push(ts2.createFileDiagnostic(file, span.start, span.length, ts2.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); + } + } + function isEvalOrArgumentsIdentifier(node) { + return ts2.isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments"); + } + function checkStrictModeEvalOrArguments(contextNode, name2) { + if (name2 && name2.kind === 79) { + var identifier = name2; + if (isEvalOrArgumentsIdentifier(identifier)) { + var span = ts2.getErrorSpanForNode(file, name2); + file.bindDiagnostics.push(ts2.createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), ts2.idText(identifier))); + } + } + } + function getStrictModeEvalOrArgumentsMessage(node) { + if (ts2.getContainingClass(node)) { + return ts2.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode; + } + if (file.externalModuleIndicator) { + return ts2.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; + } + return ts2.Diagnostics.Invalid_use_of_0_in_strict_mode; + } + function checkStrictModeFunctionName(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + } + function getStrictModeBlockScopeFunctionDeclarationMessage(node) { + if (ts2.getContainingClass(node)) { + return ts2.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return ts2.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode; + } + return ts2.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5; + } + function checkStrictModeFunctionDeclaration(node) { + if (languageVersion < 2) { + if (blockScopeContainer.kind !== 308 && blockScopeContainer.kind !== 264 && !ts2.isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { + var errorSpan = ts2.getErrorSpanForNode(file, node); + file.bindDiagnostics.push(ts2.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); + } + } + } + function checkStrictModeNumericLiteral(node) { + if (languageVersion < 1 && inStrictMode && node.numericLiteralFlags & 32) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); + } + } + function checkStrictModePostfixUnaryExpression(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + function checkStrictModePrefixUnaryExpression(node) { + if (inStrictMode) { + if (node.operator === 45 || node.operator === 46) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + } + function checkStrictModeWithStatement(node) { + if (inStrictMode) { + errorOnFirstToken(node, ts2.Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + function checkStrictModeLabeledStatement(node) { + if (inStrictMode && ts2.getEmitScriptTarget(options) >= 2) { + if (ts2.isDeclarationStatement(node.statement) || ts2.isVariableStatement(node.statement)) { + errorOnFirstToken(node.label, ts2.Diagnostics.A_label_is_not_allowed_here); + } + } + } + function errorOnFirstToken(node, message, arg0, arg1, arg2) { + var span = ts2.getSpanOfTokenAtPosition(file, node.pos); + file.bindDiagnostics.push(ts2.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); + } + function errorOrSuggestionOnNode(isError3, node, message) { + errorOrSuggestionOnRange(isError3, node, node, message); + } + function errorOrSuggestionOnRange(isError3, startNode, endNode, message) { + addErrorOrSuggestionDiagnostic(isError3, { pos: ts2.getTokenPosOfNode(startNode, file), end: endNode.end }, message); + } + function addErrorOrSuggestionDiagnostic(isError3, range2, message) { + var diag = ts2.createFileDiagnostic(file, range2.pos, range2.end - range2.pos, message); + if (isError3) { + file.bindDiagnostics.push(diag); + } else { + file.bindSuggestionDiagnostics = ts2.append(file.bindSuggestionDiagnostics, __assign16(__assign16({}, diag), { category: ts2.DiagnosticCategory.Suggestion })); + } + } + function bind2(node) { + if (!node) { + return; + } + ts2.setParent(node, parent2); + if (ts2.tracing) + node.tracingPath = file.path; + var saveInStrictMode = inStrictMode; + bindWorker(node); + if (node.kind > 162) { + var saveParent = parent2; + parent2 = node; + var containerFlags = getContainerFlags(node); + if (containerFlags === 0) { + bindChildren(node); + } else { + bindContainer(node, containerFlags); + } + parent2 = saveParent; + } else { + var saveParent = parent2; + if (node.kind === 1) + parent2 = node; + bindJSDoc(node); + parent2 = saveParent; + } + inStrictMode = saveInStrictMode; + } + function bindJSDoc(node) { + if (ts2.hasJSDocNodes(node)) { + if (ts2.isInJSFile(node)) { + for (var _i = 0, _a2 = node.jsDoc; _i < _a2.length; _i++) { + var j6 = _a2[_i]; + bind2(j6); + } + } else { + for (var _b = 0, _c = node.jsDoc; _b < _c.length; _b++) { + var j6 = _c[_b]; + ts2.setParent(j6, node); + ts2.setParentRecursive( + j6, + /*incremental*/ + false + ); + } + } + } + } + function updateStrictModeStatementList(statements) { + if (!inStrictMode) { + for (var _i = 0, statements_3 = statements; _i < statements_3.length; _i++) { + var statement = statements_3[_i]; + if (!ts2.isPrologueDirective(statement)) { + return; + } + if (isUseStrictPrologueDirective(statement)) { + inStrictMode = true; + return; + } + } + } + } + function isUseStrictPrologueDirective(node) { + var nodeText = ts2.getSourceTextOfNodeFromSourceFile(file, node.expression); + return nodeText === '"use strict"' || nodeText === "'use strict'"; + } + function bindWorker(node) { + switch (node.kind) { + case 79: + if (node.isInJSDocNamespace) { + var parentNode = node.parent; + while (parentNode && !ts2.isJSDocTypeAlias(parentNode)) { + parentNode = parentNode.parent; + } + bindBlockScopedDeclaration( + parentNode, + 524288, + 788968 + /* SymbolFlags.TypeAliasExcludes */ + ); + break; + } + case 108: + if (currentFlow && (ts2.isExpression(node) || parent2.kind === 300)) { + node.flowNode = currentFlow; + } + return checkContextualIdentifier(node); + case 163: + if (currentFlow && ts2.isPartOfTypeQuery(node)) { + node.flowNode = currentFlow; + } + break; + case 233: + case 106: + node.flowNode = currentFlow; + break; + case 80: + return checkPrivateIdentifier(node); + case 208: + case 209: + var expr = node; + if (currentFlow && isNarrowableReference(expr)) { + expr.flowNode = currentFlow; + } + if (ts2.isSpecialPropertyDeclaration(expr)) { + bindSpecialPropertyDeclaration(expr); + } + if (ts2.isInJSFile(expr) && file.commonJsModuleIndicator && ts2.isModuleExportsAccessExpression(expr) && !lookupSymbolForName(blockScopeContainer, "module")) { + declareSymbol( + file.locals, + /*parent*/ + void 0, + expr.expression, + 1 | 134217728, + 111550 + /* SymbolFlags.FunctionScopedVariableExcludes */ + ); + } + break; + case 223: + var specialKind = ts2.getAssignmentDeclarationKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node.left, node); + break; + case 6: + bindPrototypeAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 5: + var expression = node.left.expression; + if (ts2.isInJSFile(node) && ts2.isIdentifier(expression)) { + var symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); + if (ts2.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration)) { + bindThisPropertyAssignment(node); + break; + } + } + bindSpecialPropertyAssignment(node); + break; + case 0: + break; + default: + ts2.Debug.fail("Unknown binary expression special property assignment kind"); + } + return checkStrictModeBinaryExpression(node); + case 295: + return checkStrictModeCatchClause(node); + case 217: + return checkStrictModeDeleteExpression(node); + case 8: + return checkStrictModeNumericLiteral(node); + case 222: + return checkStrictModePostfixUnaryExpression(node); + case 221: + return checkStrictModePrefixUnaryExpression(node); + case 251: + return checkStrictModeWithStatement(node); + case 253: + return checkStrictModeLabeledStatement(node); + case 194: + seenThisKeyword = true; + return; + case 179: + break; + case 165: + return bindTypeParameter(node); + case 166: + return bindParameter(node); + case 257: + return bindVariableDeclarationOrBindingElement(node); + case 205: + node.flowNode = currentFlow; + return bindVariableDeclarationOrBindingElement(node); + case 169: + case 168: + return bindPropertyWorker(node); + case 299: + case 300: + return bindPropertyOrMethodOrAccessor( + node, + 4, + 0 + /* SymbolFlags.PropertyExcludes */ + ); + case 302: + return bindPropertyOrMethodOrAccessor( + node, + 8, + 900095 + /* SymbolFlags.EnumMemberExcludes */ + ); + case 176: + case 177: + case 178: + return declareSymbolAndAddToSymbolTable( + node, + 131072, + 0 + /* SymbolFlags.None */ + ); + case 171: + case 170: + return bindPropertyOrMethodOrAccessor( + node, + 8192 | (node.questionToken ? 16777216 : 0), + ts2.isObjectLiteralMethod(node) ? 0 : 103359 + /* SymbolFlags.MethodExcludes */ + ); + case 259: + return bindFunctionDeclaration(node); + case 173: + return declareSymbolAndAddToSymbolTable( + node, + 16384, + /*symbolExcludes:*/ + 0 + /* SymbolFlags.None */ + ); + case 174: + return bindPropertyOrMethodOrAccessor( + node, + 32768, + 46015 + /* SymbolFlags.GetAccessorExcludes */ + ); + case 175: + return bindPropertyOrMethodOrAccessor( + node, + 65536, + 78783 + /* SymbolFlags.SetAccessorExcludes */ + ); + case 181: + case 320: + case 326: + case 182: + return bindFunctionOrConstructorType(node); + case 184: + case 325: + case 197: + return bindAnonymousTypeWorker(node); + case 335: + return bindJSDocClassTag(node); + case 207: + return bindObjectLiteralExpression(node); + case 215: + case 216: + return bindFunctionExpression(node); + case 210: + var assignmentKind = ts2.getAssignmentDeclarationKind(node); + switch (assignmentKind) { + case 7: + return bindObjectDefinePropertyAssignment(node); + case 8: + return bindObjectDefinePropertyExport(node); + case 9: + return bindObjectDefinePrototypeProperty(node); + case 0: + break; + default: + return ts2.Debug.fail("Unknown call expression assignment declaration kind"); + } + if (ts2.isInJSFile(node)) { + bindCallExpression(node); + } + break; + case 228: + case 260: + inStrictMode = true; + return bindClassLikeDeclaration(node); + case 261: + return bindBlockScopedDeclaration( + node, + 64, + 788872 + /* SymbolFlags.InterfaceExcludes */ + ); + case 262: + return bindBlockScopedDeclaration( + node, + 524288, + 788968 + /* SymbolFlags.TypeAliasExcludes */ + ); + case 263: + return bindEnumDeclaration(node); + case 264: + return bindModuleDeclaration(node); + case 289: + return bindJsxAttributes(node); + case 288: + return bindJsxAttribute( + node, + 4, + 0 + /* SymbolFlags.PropertyExcludes */ + ); + case 268: + case 271: + case 273: + case 278: + return declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* SymbolFlags.AliasExcludes */ + ); + case 267: + return bindNamespaceExportDeclaration(node); + case 270: + return bindImportClause(node); + case 275: + return bindExportDeclaration(node); + case 274: + return bindExportAssignment(node); + case 308: + updateStrictModeStatementList(node.statements); + return bindSourceFileIfExternalModule(); + case 238: + if (!ts2.isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { + return; + } + case 265: + return updateStrictModeStatementList(node.statements); + case 343: + if (node.parent.kind === 326) { + return bindParameter(node); + } + if (node.parent.kind !== 325) { + break; + } + case 350: + var propTag = node; + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 319 ? 4 | 16777216 : 4; + return declareSymbolAndAddToSymbolTable( + propTag, + flags, + 0 + /* SymbolFlags.PropertyExcludes */ + ); + case 348: + case 341: + case 342: + return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); + } + } + function bindPropertyWorker(node) { + var isAutoAccessor = ts2.isAutoAccessorPropertyDeclaration(node); + var includes2 = isAutoAccessor ? 98304 : 4; + var excludes = isAutoAccessor ? 13247 : 0; + return bindPropertyOrMethodOrAccessor(node, includes2 | (node.questionToken ? 16777216 : 0), excludes); + } + function bindAnonymousTypeWorker(node) { + return bindAnonymousDeclaration( + node, + 2048, + "__type" + /* InternalSymbolName.Type */ + ); + } + function bindSourceFileIfExternalModule() { + setExportContextFlag(file); + if (ts2.isExternalModule(file)) { + bindSourceFileAsExternalModule(); + } else if (ts2.isJsonSourceFile(file)) { + bindSourceFileAsExternalModule(); + var originalSymbol = file.symbol; + declareSymbol( + file.symbol.exports, + file.symbol, + file, + 4, + 67108863 + /* SymbolFlags.All */ + ); + file.symbol = originalSymbol; + } + } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512, '"'.concat(ts2.removeFileExtension(file.fileName), '"')); + } + function bindExportAssignment(node) { + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 111551, getDeclarationName(node)); + } else { + var flags = ts2.exportAssignmentIsAlias(node) ? 2097152 : 4; + var symbol = declareSymbol( + container.symbol.exports, + container.symbol, + node, + flags, + 67108863 + /* SymbolFlags.All */ + ); + if (node.isExportEquals) { + ts2.setValueDeclaration(symbol, node); + } + } + } + function bindNamespaceExportDeclaration(node) { + if (ts2.some(node.modifiers)) { + file.bindDiagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Modifiers_cannot_appear_here)); + } + var diag = !ts2.isSourceFile(node.parent) ? ts2.Diagnostics.Global_module_exports_may_only_appear_at_top_level : !ts2.isExternalModule(node.parent) ? ts2.Diagnostics.Global_module_exports_may_only_appear_in_module_files : !node.parent.isDeclarationFile ? ts2.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files : void 0; + if (diag) { + file.bindDiagnostics.push(createDiagnosticForNode(node, diag)); + } else { + file.symbol.globalExports = file.symbol.globalExports || ts2.createSymbolTable(); + declareSymbol( + file.symbol.globalExports, + file.symbol, + node, + 2097152, + 2097152 + /* SymbolFlags.AliasExcludes */ + ); + } + } + function bindExportDeclaration(node) { + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); + } else if (!node.exportClause) { + declareSymbol( + container.symbol.exports, + container.symbol, + node, + 8388608, + 0 + /* SymbolFlags.None */ + ); + } else if (ts2.isNamespaceExport(node.exportClause)) { + ts2.setParent(node.exportClause, node); + declareSymbol( + container.symbol.exports, + container.symbol, + node.exportClause, + 2097152, + 2097152 + /* SymbolFlags.AliasExcludes */ + ); + } + } + function bindImportClause(node) { + if (node.name) { + declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* SymbolFlags.AliasExcludes */ + ); + } + } + function setCommonJsModuleIndicator(node) { + if (file.externalModuleIndicator && file.externalModuleIndicator !== true) { + return false; + } + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + if (!file.externalModuleIndicator) { + bindSourceFileAsExternalModule(); + } + } + return true; + } + function bindObjectDefinePropertyExport(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + var symbol = forEachIdentifierInEntityName( + node.arguments[0], + /*parent*/ + void 0, + function(id, symbol2) { + if (symbol2) { + addDeclarationToSymbol( + symbol2, + id, + 1536 | 67108864 + /* SymbolFlags.Assignment */ + ); + } + return symbol2; + } + ); + if (symbol) { + var flags = 4 | 1048576; + declareSymbol( + symbol.exports, + symbol, + node, + flags, + 0 + /* SymbolFlags.None */ + ); + } + } + function bindExportsPropertyAssignment(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + var symbol = forEachIdentifierInEntityName( + node.left.expression, + /*parent*/ + void 0, + function(id, symbol2) { + if (symbol2) { + addDeclarationToSymbol( + symbol2, + id, + 1536 | 67108864 + /* SymbolFlags.Assignment */ + ); + } + return symbol2; + } + ); + if (symbol) { + var isAlias2 = ts2.isAliasableExpression(node.right) && (ts2.isExportsIdentifier(node.left.expression) || ts2.isModuleExportsAccessExpression(node.left.expression)); + var flags = isAlias2 ? 2097152 : 4 | 1048576; + ts2.setParent(node.left, node); + declareSymbol( + symbol.exports, + symbol, + node.left, + flags, + 0 + /* SymbolFlags.None */ + ); + } + } + function bindModuleExportsAssignment(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + var assignedExpression = ts2.getRightMostAssignedExpression(node.right); + if (ts2.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { + return; + } + if (ts2.isObjectLiteralExpression(assignedExpression) && ts2.every(assignedExpression.properties, ts2.isShorthandPropertyAssignment)) { + ts2.forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); + return; + } + var flags = ts2.exportAssignmentIsAlias(node) ? 2097152 : 4 | 1048576 | 512; + var symbol = declareSymbol( + file.symbol.exports, + file.symbol, + node, + flags | 67108864, + 0 + /* SymbolFlags.None */ + ); + ts2.setValueDeclaration(symbol, node); + } + function bindExportAssignedObjectMemberAlias(node) { + declareSymbol( + file.symbol.exports, + file.symbol, + node, + 2097152 | 67108864, + 0 + /* SymbolFlags.None */ + ); + } + function bindThisPropertyAssignment(node) { + ts2.Debug.assert(ts2.isInJSFile(node)); + var hasPrivateIdentifier = ts2.isBinaryExpression(node) && ts2.isPropertyAccessExpression(node.left) && ts2.isPrivateIdentifier(node.left.name) || ts2.isPropertyAccessExpression(node) && ts2.isPrivateIdentifier(node.name); + if (hasPrivateIdentifier) { + return; + } + var thisContainer = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + switch (thisContainer.kind) { + case 259: + case 215: + var constructorSymbol = thisContainer.symbol; + if (ts2.isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63) { + var l7 = thisContainer.parent.left; + if (ts2.isBindableStaticAccessExpression(l7) && ts2.isPrototypeAccess(l7.expression)) { + constructorSymbol = lookupSymbolForPropertyAccess(l7.expression.expression, thisParentContainer); + } + } + if (constructorSymbol && constructorSymbol.valueDeclaration) { + constructorSymbol.members = constructorSymbol.members || ts2.createSymbolTable(); + if (ts2.hasDynamicName(node)) { + bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol, constructorSymbol.members); + } else { + declareSymbol( + constructorSymbol.members, + constructorSymbol, + node, + 4 | 67108864, + 0 & ~4 + /* SymbolFlags.Property */ + ); + } + addDeclarationToSymbol( + constructorSymbol, + constructorSymbol.valueDeclaration, + 32 + /* SymbolFlags.Class */ + ); + } + break; + case 173: + case 169: + case 171: + case 174: + case 175: + case 172: + var containingClass = thisContainer.parent; + var symbolTable = ts2.isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; + if (ts2.hasDynamicName(node)) { + bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol, symbolTable); + } else { + declareSymbol( + symbolTable, + containingClass.symbol, + node, + 4 | 67108864, + 0, + /*isReplaceableByMethod*/ + true + ); + } + break; + case 308: + if (ts2.hasDynamicName(node)) { + break; + } else if (thisContainer.commonJsModuleIndicator) { + declareSymbol( + thisContainer.symbol.exports, + thisContainer.symbol, + node, + 4 | 1048576, + 0 + /* SymbolFlags.None */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111550 + /* SymbolFlags.FunctionScopedVariableExcludes */ + ); + } + break; + default: + ts2.Debug.failBadSyntaxKind(thisContainer); + } + } + function bindDynamicallyNamedThisPropertyAssignment(node, symbol, symbolTable) { + declareSymbol( + symbolTable, + symbol, + node, + 4, + 0, + /*isReplaceableByMethod*/ + true, + /*isComputedName*/ + true + ); + addLateBoundAssignmentDeclarationToSymbol(node, symbol); + } + function addLateBoundAssignmentDeclarationToSymbol(node, symbol) { + if (symbol) { + (symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = new ts2.Map())).set(ts2.getNodeId(node), node); + } + } + function bindSpecialPropertyDeclaration(node) { + if (node.expression.kind === 108) { + bindThisPropertyAssignment(node); + } else if (ts2.isBindableStaticAccessExpression(node) && node.parent.parent.kind === 308) { + if (ts2.isPrototypeAccess(node.expression)) { + bindPrototypePropertyAssignment(node, node.parent); + } else { + bindStaticPropertyAssignment(node); + } + } + } + function bindPrototypeAssignment(node) { + ts2.setParent(node.left, node); + ts2.setParent(node.right, node); + bindPropertyAssignment( + node.left.expression, + node.left, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + true + ); + } + function bindObjectDefinePrototypeProperty(node) { + var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression); + if (namespaceSymbol && namespaceSymbol.valueDeclaration) { + addDeclarationToSymbol( + namespaceSymbol, + namespaceSymbol.valueDeclaration, + 32 + /* SymbolFlags.Class */ + ); + } + bindPotentiallyNewExpandoMemberToNamespace( + node, + namespaceSymbol, + /*isPrototypeProperty*/ + true + ); + } + function bindPrototypePropertyAssignment(lhs, parent3) { + var classPrototype = lhs.expression; + var constructorFunction = classPrototype.expression; + ts2.setParent(constructorFunction, classPrototype); + ts2.setParent(classPrototype, lhs); + ts2.setParent(lhs, parent3); + bindPropertyAssignment( + constructorFunction, + lhs, + /*isPrototypeProperty*/ + true, + /*containerIsClass*/ + true + ); + } + function bindObjectDefinePropertyAssignment(node) { + var namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); + var isToplevel = node.parent.parent.kind === 308; + namespaceSymbol = bindPotentiallyMissingNamespaces( + namespaceSymbol, + node.arguments[0], + isToplevel, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + false + ); + bindPotentiallyNewExpandoMemberToNamespace( + node, + namespaceSymbol, + /*isPrototypeProperty*/ + false + ); + } + function bindSpecialPropertyAssignment(node) { + var _a2; + var parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); + if (!ts2.isInJSFile(node) && !ts2.isFunctionSymbol(parentSymbol)) { + return; + } + var rootExpr = ts2.getLeftmostAccessExpression(node.left); + if (ts2.isIdentifier(rootExpr) && ((_a2 = lookupSymbolForName(container, rootExpr.escapedText)) === null || _a2 === void 0 ? void 0 : _a2.flags) & 2097152) { + return; + } + ts2.setParent(node.left, node); + ts2.setParent(node.right, node); + if (ts2.isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) { + bindExportsPropertyAssignment(node); + } else if (ts2.hasDynamicName(node)) { + bindAnonymousDeclaration( + node, + 4 | 67108864, + "__computed" + /* InternalSymbolName.Computed */ + ); + var sym = bindPotentiallyMissingNamespaces( + parentSymbol, + node.left.expression, + isTopLevelNamespaceAssignment(node.left), + /*isPrototype*/ + false, + /*containerIsClass*/ + false + ); + addLateBoundAssignmentDeclarationToSymbol(node, sym); + } else { + bindStaticPropertyAssignment(ts2.cast(node.left, ts2.isBindableStaticNameExpression)); + } + } + function bindStaticPropertyAssignment(node) { + ts2.Debug.assert(!ts2.isIdentifier(node)); + ts2.setParent(node.expression, node); + bindPropertyAssignment( + node.expression, + node, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + false + ); + } + function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty, containerIsClass) { + if ((namespaceSymbol === null || namespaceSymbol === void 0 ? void 0 : namespaceSymbol.flags) & 2097152) { + return namespaceSymbol; + } + if (isToplevel && !isPrototypeProperty) { + var flags_2 = 1536 | 67108864; + var excludeFlags_1 = 110735 & ~67108864; + namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, function(id, symbol, parent3) { + if (symbol) { + addDeclarationToSymbol(symbol, id, flags_2); + return symbol; + } else { + var table2 = parent3 ? parent3.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = ts2.createSymbolTable()); + return declareSymbol(table2, parent3, id, flags_2, excludeFlags_1); + } + }); + } + if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) { + addDeclarationToSymbol( + namespaceSymbol, + namespaceSymbol.valueDeclaration, + 32 + /* SymbolFlags.Class */ + ); + } + return namespaceSymbol; + } + function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) { + if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) { + return; + } + var symbolTable = isPrototypeProperty ? namespaceSymbol.members || (namespaceSymbol.members = ts2.createSymbolTable()) : namespaceSymbol.exports || (namespaceSymbol.exports = ts2.createSymbolTable()); + var includes2 = 0; + var excludes = 0; + if (ts2.isFunctionLikeDeclaration(ts2.getAssignedExpandoInitializer(declaration))) { + includes2 = 8192; + excludes = 103359; + } else if (ts2.isCallExpression(declaration) && ts2.isBindableObjectDefinePropertyCall(declaration)) { + if (ts2.some(declaration.arguments[2].properties, function(p7) { + var id = ts2.getNameOfDeclaration(p7); + return !!id && ts2.isIdentifier(id) && ts2.idText(id) === "set"; + })) { + includes2 |= 65536 | 4; + excludes |= 78783; + } + if (ts2.some(declaration.arguments[2].properties, function(p7) { + var id = ts2.getNameOfDeclaration(p7); + return !!id && ts2.isIdentifier(id) && ts2.idText(id) === "get"; + })) { + includes2 |= 32768 | 4; + excludes |= 46015; + } + } + if (includes2 === 0) { + includes2 = 4; + excludes = 0; + } + declareSymbol( + symbolTable, + namespaceSymbol, + declaration, + includes2 | 67108864, + excludes & ~67108864 + /* SymbolFlags.Assignment */ + ); + } + function isTopLevelNamespaceAssignment(propertyAccess) { + return ts2.isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 308 : propertyAccess.parent.parent.kind === 308; + } + function bindPropertyAssignment(name2, propertyAccess, isPrototypeProperty, containerIsClass) { + var namespaceSymbol = lookupSymbolForPropertyAccess(name2, container) || lookupSymbolForPropertyAccess(name2, blockScopeContainer); + var isToplevel = isTopLevelNamespaceAssignment(propertyAccess); + namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass); + bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty); + } + function isExpandoSymbol(symbol) { + if (symbol.flags & (16 | 32 | 1024)) { + return true; + } + var node = symbol.valueDeclaration; + if (node && ts2.isCallExpression(node)) { + return !!ts2.getAssignedExpandoInitializer(node); + } + var init2 = !node ? void 0 : ts2.isVariableDeclaration(node) ? node.initializer : ts2.isBinaryExpression(node) ? node.right : ts2.isPropertyAccessExpression(node) && ts2.isBinaryExpression(node.parent) ? node.parent.right : void 0; + init2 = init2 && ts2.getRightMostAssignedExpression(init2); + if (init2) { + var isPrototypeAssignment = ts2.isPrototypeAccess(ts2.isVariableDeclaration(node) ? node.name : ts2.isBinaryExpression(node) ? node.left : node); + return !!ts2.getExpandoInitializer(ts2.isBinaryExpression(init2) && (init2.operatorToken.kind === 56 || init2.operatorToken.kind === 60) ? init2.right : init2, isPrototypeAssignment); + } + return false; + } + function getParentOfBinaryExpression(expr) { + while (ts2.isBinaryExpression(expr.parent)) { + expr = expr.parent; + } + return expr.parent; + } + function lookupSymbolForPropertyAccess(node, lookupContainer) { + if (lookupContainer === void 0) { + lookupContainer = container; + } + if (ts2.isIdentifier(node)) { + return lookupSymbolForName(lookupContainer, node.escapedText); + } else { + var symbol = lookupSymbolForPropertyAccess(node.expression); + return symbol && symbol.exports && symbol.exports.get(ts2.getElementOrPropertyAccessName(node)); + } + } + function forEachIdentifierInEntityName(e10, parent3, action) { + if (isExportsOrModuleExportsOrAlias(file, e10)) { + return file.symbol; + } else if (ts2.isIdentifier(e10)) { + return action(e10, lookupSymbolForPropertyAccess(e10), parent3); + } else { + var s7 = forEachIdentifierInEntityName(e10.expression, parent3, action); + var name2 = ts2.getNameOrArgument(e10); + if (ts2.isPrivateIdentifier(name2)) { + ts2.Debug.fail("unexpected PrivateIdentifier"); + } + return action(name2, s7 && s7.exports && s7.exports.get(ts2.getElementOrPropertyAccessName(e10)), s7); + } + } + function bindCallExpression(node) { + if (!file.commonJsModuleIndicator && ts2.isRequireCall( + node, + /*checkArgumentIsStringLiteralLike*/ + false + )) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node) { + if (node.kind === 260) { + bindBlockScopedDeclaration( + node, + 32, + 899503 + /* SymbolFlags.ClassExcludes */ + ); + } else { + var bindingName = node.name ? node.name.escapedText : "__class"; + bindAnonymousDeclaration(node, 32, bindingName); + if (node.name) { + classifiableNames.add(node.name.escapedText); + } + } + var symbol = node.symbol; + var prototypeSymbol = createSymbol(4 | 4194304, "prototype"); + var symbolExport = symbol.exports.get(prototypeSymbol.escapedName); + if (symbolExport) { + if (node.name) { + ts2.setParent(node.name, node); + } + file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations[0], ts2.Diagnostics.Duplicate_identifier_0, ts2.symbolName(prototypeSymbol))); + } + symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol); + prototypeSymbol.parent = symbol; + } + function bindEnumDeclaration(node) { + return ts2.isEnumConst(node) ? bindBlockScopedDeclaration( + node, + 128, + 899967 + /* SymbolFlags.ConstEnumExcludes */ + ) : bindBlockScopedDeclaration( + node, + 256, + 899327 + /* SymbolFlags.RegularEnumExcludes */ + ); + } + function bindVariableDeclarationOrBindingElement(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (!ts2.isBindingPattern(node.name)) { + var possibleVariableDecl = node.kind === 257 ? node : node.parent.parent; + if (ts2.isInJSFile(node) && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !ts2.getJSDocTypeTag(node) && !(ts2.getCombinedModifierFlags(node) & 1)) { + declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* SymbolFlags.AliasExcludes */ + ); + } else if (ts2.isBlockOrCatchScoped(node)) { + bindBlockScopedDeclaration( + node, + 2, + 111551 + /* SymbolFlags.BlockScopedVariableExcludes */ + ); + } else if (ts2.isParameterDeclaration(node)) { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111551 + /* SymbolFlags.ParameterExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111550 + /* SymbolFlags.FunctionScopedVariableExcludes */ + ); + } + } + } + function bindParameter(node) { + if (node.kind === 343 && container.kind !== 326) { + return; + } + if (inStrictMode && !(node.flags & 16777216)) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (ts2.isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, "__" + node.parent.parameters.indexOf(node)); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111551 + /* SymbolFlags.ParameterExcludes */ + ); + } + if (ts2.isParameterPropertyDeclaration(node, node.parent)) { + var classDeclaration = node.parent.parent; + declareSymbol( + classDeclaration.symbol.members, + classDeclaration.symbol, + node, + 4 | (node.questionToken ? 16777216 : 0), + 0 + /* SymbolFlags.PropertyExcludes */ + ); + } + } + function bindFunctionDeclaration(node) { + if (!file.isDeclarationFile && !(node.flags & 16777216)) { + if (ts2.isAsyncFunction(node)) { + emitFlags |= 2048; + } + } + checkStrictModeFunctionName(node); + if (inStrictMode) { + checkStrictModeFunctionDeclaration(node); + bindBlockScopedDeclaration( + node, + 16, + 110991 + /* SymbolFlags.FunctionExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 16, + 110991 + /* SymbolFlags.FunctionExcludes */ + ); + } + } + function bindFunctionExpression(node) { + if (!file.isDeclarationFile && !(node.flags & 16777216)) { + if (ts2.isAsyncFunction(node)) { + emitFlags |= 2048; + } + } + if (currentFlow) { + node.flowNode = currentFlow; + } + checkStrictModeFunctionName(node); + var bindingName = node.name ? node.name.escapedText : "__function"; + return bindAnonymousDeclaration(node, 16, bindingName); + } + function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!file.isDeclarationFile && !(node.flags & 16777216) && ts2.isAsyncFunction(node)) { + emitFlags |= 2048; + } + if (currentFlow && ts2.isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { + node.flowNode = currentFlow; + } + return ts2.hasDynamicName(node) ? bindAnonymousDeclaration( + node, + symbolFlags, + "__computed" + /* InternalSymbolName.Computed */ + ) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + function getInferTypeContainer(node) { + var extendsType = ts2.findAncestor(node, function(n7) { + return n7.parent && ts2.isConditionalTypeNode(n7.parent) && n7.parent.extendsType === n7; + }); + return extendsType && extendsType.parent; + } + function bindTypeParameter(node) { + if (ts2.isJSDocTemplateTag(node.parent)) { + var container_1 = ts2.getEffectiveContainerForJSDocTemplateTag(node.parent); + if (container_1) { + if (!container_1.locals) { + container_1.locals = ts2.createSymbolTable(); + } + declareSymbol( + container_1.locals, + /*parent*/ + void 0, + node, + 262144, + 526824 + /* SymbolFlags.TypeParameterExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 262144, + 526824 + /* SymbolFlags.TypeParameterExcludes */ + ); + } + } else if (node.parent.kind === 192) { + var container_2 = getInferTypeContainer(node.parent); + if (container_2) { + if (!container_2.locals) { + container_2.locals = ts2.createSymbolTable(); + } + declareSymbol( + container_2.locals, + /*parent*/ + void 0, + node, + 262144, + 526824 + /* SymbolFlags.TypeParameterExcludes */ + ); + } else { + bindAnonymousDeclaration(node, 262144, getDeclarationName(node)); + } + } else { + declareSymbolAndAddToSymbolTable( + node, + 262144, + 526824 + /* SymbolFlags.TypeParameterExcludes */ + ); + } + } + function shouldReportErrorOnModuleDeclaration(node) { + var instanceState = getModuleInstanceState(node); + return instanceState === 1 || instanceState === 2 && ts2.shouldPreserveConstEnums(options); + } + function checkUnreachable(node) { + if (!(currentFlow.flags & 1)) { + return false; + } + if (currentFlow === unreachableFlow) { + var reportError = ( + // report error on all statements except empty ones + ts2.isStatementButNotDeclaration(node) && node.kind !== 239 || // report error on class declarations + node.kind === 260 || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + node.kind === 264 && shouldReportErrorOnModuleDeclaration(node) + ); + if (reportError) { + currentFlow = reportedUnreachableFlow; + if (!options.allowUnreachableCode) { + var isError_1 = ts2.unreachableCodeIsError(options) && !(node.flags & 16777216) && (!ts2.isVariableStatement(node) || !!(ts2.getCombinedNodeFlags(node.declarationList) & 3) || node.declarationList.declarations.some(function(d7) { + return !!d7.initializer; + })); + eachUnreachableRange(node, function(start, end) { + return errorOrSuggestionOnRange(isError_1, start, end, ts2.Diagnostics.Unreachable_code_detected); + }); + } + } + } + return true; + } + } + function eachUnreachableRange(node, cb) { + if (ts2.isStatement(node) && isExecutableStatement(node) && ts2.isBlock(node.parent)) { + var statements = node.parent.statements; + var slice_1 = ts2.sliceAfter(statements, node); + ts2.getRangesWhere(slice_1, isExecutableStatement, function(start, afterEnd) { + return cb(slice_1[start], slice_1[afterEnd - 1]); + }); + } else { + cb(node, node); + } + } + function isExecutableStatement(s7) { + return !ts2.isFunctionDeclaration(s7) && !isPurelyTypeDeclaration(s7) && !ts2.isEnumDeclaration(s7) && // `var x;` may declare a variable used above + !(ts2.isVariableStatement(s7) && !(ts2.getCombinedNodeFlags(s7) & (1 | 2)) && s7.declarationList.declarations.some(function(d7) { + return !d7.initializer; + })); + } + function isPurelyTypeDeclaration(s7) { + switch (s7.kind) { + case 261: + case 262: + return true; + case 264: + return getModuleInstanceState(s7) !== 1; + case 263: + return ts2.hasSyntacticModifier( + s7, + 2048 + /* ModifierFlags.Const */ + ); + default: + return false; + } + } + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + var i7 = 0; + var q5 = ts2.createQueue(); + q5.enqueue(node); + while (!q5.isEmpty() && i7 < 100) { + i7++; + node = q5.dequeue(); + if (ts2.isExportsIdentifier(node) || ts2.isModuleExportsAccessExpression(node)) { + return true; + } else if (ts2.isIdentifier(node)) { + var symbol = lookupSymbolForName(sourceFile, node.escapedText); + if (!!symbol && !!symbol.valueDeclaration && ts2.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { + var init2 = symbol.valueDeclaration.initializer; + q5.enqueue(init2); + if (ts2.isAssignmentExpression( + init2, + /*excludeCompoundAssignment*/ + true + )) { + q5.enqueue(init2.left); + q5.enqueue(init2.right); + } + } + } + } + return false; + } + ts2.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function lookupSymbolForName(container, name2) { + var local = container.locals && container.locals.get(name2); + if (local) { + return local.exportSymbol || local; + } + if (ts2.isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name2)) { + return container.jsGlobalAugmentations.get(name2); + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name2); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, getFirstIdentifier, getTypeArguments) { + return getSymbolWalker; + function getSymbolWalker(accept) { + if (accept === void 0) { + accept = function() { + return true; + }; + } + var visitedTypes = []; + var visitedSymbols = []; + return { + walkType: function(type3) { + try { + visitType(type3); + return { visitedTypes: ts2.getOwnValues(visitedTypes), visitedSymbols: ts2.getOwnValues(visitedSymbols) }; + } finally { + ts2.clear(visitedTypes); + ts2.clear(visitedSymbols); + } + }, + walkSymbol: function(symbol) { + try { + visitSymbol(symbol); + return { visitedTypes: ts2.getOwnValues(visitedTypes), visitedSymbols: ts2.getOwnValues(visitedSymbols) }; + } finally { + ts2.clear(visitedTypes); + ts2.clear(visitedSymbols); + } + } + }; + function visitType(type3) { + if (!type3) { + return; + } + if (visitedTypes[type3.id]) { + return; + } + visitedTypes[type3.id] = type3; + var shouldBail = visitSymbol(type3.symbol); + if (shouldBail) + return; + if (type3.flags & 524288) { + var objectType2 = type3; + var objectFlags = objectType2.objectFlags; + if (objectFlags & 4) { + visitTypeReference(type3); + } + if (objectFlags & 32) { + visitMappedType(type3); + } + if (objectFlags & (1 | 2)) { + visitInterfaceType(type3); + } + if (objectFlags & (8 | 16)) { + visitObjectType(objectType2); + } + } + if (type3.flags & 262144) { + visitTypeParameter(type3); + } + if (type3.flags & 3145728) { + visitUnionOrIntersectionType(type3); + } + if (type3.flags & 4194304) { + visitIndexType(type3); + } + if (type3.flags & 8388608) { + visitIndexedAccessType(type3); + } + } + function visitTypeReference(type3) { + visitType(type3.target); + ts2.forEach(getTypeArguments(type3), visitType); + } + function visitTypeParameter(type3) { + visitType(getConstraintOfTypeParameter(type3)); + } + function visitUnionOrIntersectionType(type3) { + ts2.forEach(type3.types, visitType); + } + function visitIndexType(type3) { + visitType(type3.type); + } + function visitIndexedAccessType(type3) { + visitType(type3.objectType); + visitType(type3.indexType); + visitType(type3.constraint); + } + function visitMappedType(type3) { + visitType(type3.typeParameter); + visitType(type3.constraintType); + visitType(type3.templateType); + visitType(type3.modifiersType); + } + function visitSignature(signature) { + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); + } + ts2.forEach(signature.typeParameters, visitType); + for (var _i = 0, _a2 = signature.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + ts2.forEach(interfaceT.typeParameters, visitType); + ts2.forEach(getBaseTypes(interfaceT), visitType); + visitType(interfaceT.thisType); + } + function visitObjectType(type3) { + var resolved = resolveStructuredTypeMembers(type3); + for (var _i = 0, _a2 = resolved.indexInfos; _i < _a2.length; _i++) { + var info2 = _a2[_i]; + visitType(info2.keyType); + visitType(info2.type); + } + for (var _b = 0, _c = resolved.callSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + visitSignature(signature); + } + for (var _d = 0, _e2 = resolved.constructSignatures; _d < _e2.length; _d++) { + var signature = _e2[_d]; + visitSignature(signature); + } + for (var _f = 0, _g = resolved.properties; _f < _g.length; _f++) { + var p7 = _g[_f]; + visitSymbol(p7); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return false; + } + var symbolId = ts2.getSymbolId(symbol); + if (visitedSymbols[symbolId]) { + return false; + } + visitedSymbols[symbolId] = symbol; + if (!accept(symbol)) { + return true; + } + var t8 = getTypeOfSymbol(symbol); + visitType(t8); + if (symbol.exports) { + symbol.exports.forEach(visitSymbol); + } + ts2.forEach(symbol.declarations, function(d7) { + if (d7.type && d7.type.kind === 183) { + var query = d7.type; + var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); + visitSymbol(entity); + } + }); + return false; + } + } + } + ts2.createGetSymbolWalker = createGetSymbolWalker; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ambientModuleSymbolRegex = /^".+"$/; + var anon = "(anonymous)"; + var nextSymbolId = 1; + var nextNodeId = 1; + var nextMergeId = 1; + var nextFlowId = 1; + var IterationUse; + (function(IterationUse2) { + IterationUse2[IterationUse2["AllowsSyncIterablesFlag"] = 1] = "AllowsSyncIterablesFlag"; + IterationUse2[IterationUse2["AllowsAsyncIterablesFlag"] = 2] = "AllowsAsyncIterablesFlag"; + IterationUse2[IterationUse2["AllowsStringInputFlag"] = 4] = "AllowsStringInputFlag"; + IterationUse2[IterationUse2["ForOfFlag"] = 8] = "ForOfFlag"; + IterationUse2[IterationUse2["YieldStarFlag"] = 16] = "YieldStarFlag"; + IterationUse2[IterationUse2["SpreadFlag"] = 32] = "SpreadFlag"; + IterationUse2[IterationUse2["DestructuringFlag"] = 64] = "DestructuringFlag"; + IterationUse2[IterationUse2["PossiblyOutOfBounds"] = 128] = "PossiblyOutOfBounds"; + IterationUse2[IterationUse2["Element"] = 1] = "Element"; + IterationUse2[IterationUse2["Spread"] = 33] = "Spread"; + IterationUse2[IterationUse2["Destructuring"] = 65] = "Destructuring"; + IterationUse2[IterationUse2["ForOf"] = 13] = "ForOf"; + IterationUse2[IterationUse2["ForAwaitOf"] = 15] = "ForAwaitOf"; + IterationUse2[IterationUse2["YieldStar"] = 17] = "YieldStar"; + IterationUse2[IterationUse2["AsyncYieldStar"] = 19] = "AsyncYieldStar"; + IterationUse2[IterationUse2["GeneratorReturnType"] = 1] = "GeneratorReturnType"; + IterationUse2[IterationUse2["AsyncGeneratorReturnType"] = 2] = "AsyncGeneratorReturnType"; + })(IterationUse || (IterationUse = {})); + var IterationTypeKind; + (function(IterationTypeKind2) { + IterationTypeKind2[IterationTypeKind2["Yield"] = 0] = "Yield"; + IterationTypeKind2[IterationTypeKind2["Return"] = 1] = "Return"; + IterationTypeKind2[IterationTypeKind2["Next"] = 2] = "Next"; + })(IterationTypeKind || (IterationTypeKind = {})); + var WideningKind; + (function(WideningKind2) { + WideningKind2[WideningKind2["Normal"] = 0] = "Normal"; + WideningKind2[WideningKind2["FunctionReturn"] = 1] = "FunctionReturn"; + WideningKind2[WideningKind2["GeneratorNext"] = 2] = "GeneratorNext"; + WideningKind2[WideningKind2["GeneratorYield"] = 3] = "GeneratorYield"; + })(WideningKind || (WideningKind = {})); + var TypeFacts; + (function(TypeFacts2) { + TypeFacts2[TypeFacts2["None"] = 0] = "None"; + TypeFacts2[TypeFacts2["TypeofEQString"] = 1] = "TypeofEQString"; + TypeFacts2[TypeFacts2["TypeofEQNumber"] = 2] = "TypeofEQNumber"; + TypeFacts2[TypeFacts2["TypeofEQBigInt"] = 4] = "TypeofEQBigInt"; + TypeFacts2[TypeFacts2["TypeofEQBoolean"] = 8] = "TypeofEQBoolean"; + TypeFacts2[TypeFacts2["TypeofEQSymbol"] = 16] = "TypeofEQSymbol"; + TypeFacts2[TypeFacts2["TypeofEQObject"] = 32] = "TypeofEQObject"; + TypeFacts2[TypeFacts2["TypeofEQFunction"] = 64] = "TypeofEQFunction"; + TypeFacts2[TypeFacts2["TypeofEQHostObject"] = 128] = "TypeofEQHostObject"; + TypeFacts2[TypeFacts2["TypeofNEString"] = 256] = "TypeofNEString"; + TypeFacts2[TypeFacts2["TypeofNENumber"] = 512] = "TypeofNENumber"; + TypeFacts2[TypeFacts2["TypeofNEBigInt"] = 1024] = "TypeofNEBigInt"; + TypeFacts2[TypeFacts2["TypeofNEBoolean"] = 2048] = "TypeofNEBoolean"; + TypeFacts2[TypeFacts2["TypeofNESymbol"] = 4096] = "TypeofNESymbol"; + TypeFacts2[TypeFacts2["TypeofNEObject"] = 8192] = "TypeofNEObject"; + TypeFacts2[TypeFacts2["TypeofNEFunction"] = 16384] = "TypeofNEFunction"; + TypeFacts2[TypeFacts2["TypeofNEHostObject"] = 32768] = "TypeofNEHostObject"; + TypeFacts2[TypeFacts2["EQUndefined"] = 65536] = "EQUndefined"; + TypeFacts2[TypeFacts2["EQNull"] = 131072] = "EQNull"; + TypeFacts2[TypeFacts2["EQUndefinedOrNull"] = 262144] = "EQUndefinedOrNull"; + TypeFacts2[TypeFacts2["NEUndefined"] = 524288] = "NEUndefined"; + TypeFacts2[TypeFacts2["NENull"] = 1048576] = "NENull"; + TypeFacts2[TypeFacts2["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull"; + TypeFacts2[TypeFacts2["Truthy"] = 4194304] = "Truthy"; + TypeFacts2[TypeFacts2["Falsy"] = 8388608] = "Falsy"; + TypeFacts2[TypeFacts2["IsUndefined"] = 16777216] = "IsUndefined"; + TypeFacts2[TypeFacts2["IsNull"] = 33554432] = "IsNull"; + TypeFacts2[TypeFacts2["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull"; + TypeFacts2[TypeFacts2["All"] = 134217727] = "All"; + TypeFacts2[TypeFacts2["BaseStringStrictFacts"] = 3735041] = "BaseStringStrictFacts"; + TypeFacts2[TypeFacts2["BaseStringFacts"] = 12582401] = "BaseStringFacts"; + TypeFacts2[TypeFacts2["StringStrictFacts"] = 16317953] = "StringStrictFacts"; + TypeFacts2[TypeFacts2["StringFacts"] = 16776705] = "StringFacts"; + TypeFacts2[TypeFacts2["EmptyStringStrictFacts"] = 12123649] = "EmptyStringStrictFacts"; + TypeFacts2[TypeFacts2["EmptyStringFacts"] = 12582401] = "EmptyStringFacts"; + TypeFacts2[TypeFacts2["NonEmptyStringStrictFacts"] = 7929345] = "NonEmptyStringStrictFacts"; + TypeFacts2[TypeFacts2["NonEmptyStringFacts"] = 16776705] = "NonEmptyStringFacts"; + TypeFacts2[TypeFacts2["BaseNumberStrictFacts"] = 3734786] = "BaseNumberStrictFacts"; + TypeFacts2[TypeFacts2["BaseNumberFacts"] = 12582146] = "BaseNumberFacts"; + TypeFacts2[TypeFacts2["NumberStrictFacts"] = 16317698] = "NumberStrictFacts"; + TypeFacts2[TypeFacts2["NumberFacts"] = 16776450] = "NumberFacts"; + TypeFacts2[TypeFacts2["ZeroNumberStrictFacts"] = 12123394] = "ZeroNumberStrictFacts"; + TypeFacts2[TypeFacts2["ZeroNumberFacts"] = 12582146] = "ZeroNumberFacts"; + TypeFacts2[TypeFacts2["NonZeroNumberStrictFacts"] = 7929090] = "NonZeroNumberStrictFacts"; + TypeFacts2[TypeFacts2["NonZeroNumberFacts"] = 16776450] = "NonZeroNumberFacts"; + TypeFacts2[TypeFacts2["BaseBigIntStrictFacts"] = 3734276] = "BaseBigIntStrictFacts"; + TypeFacts2[TypeFacts2["BaseBigIntFacts"] = 12581636] = "BaseBigIntFacts"; + TypeFacts2[TypeFacts2["BigIntStrictFacts"] = 16317188] = "BigIntStrictFacts"; + TypeFacts2[TypeFacts2["BigIntFacts"] = 16775940] = "BigIntFacts"; + TypeFacts2[TypeFacts2["ZeroBigIntStrictFacts"] = 12122884] = "ZeroBigIntStrictFacts"; + TypeFacts2[TypeFacts2["ZeroBigIntFacts"] = 12581636] = "ZeroBigIntFacts"; + TypeFacts2[TypeFacts2["NonZeroBigIntStrictFacts"] = 7928580] = "NonZeroBigIntStrictFacts"; + TypeFacts2[TypeFacts2["NonZeroBigIntFacts"] = 16775940] = "NonZeroBigIntFacts"; + TypeFacts2[TypeFacts2["BaseBooleanStrictFacts"] = 3733256] = "BaseBooleanStrictFacts"; + TypeFacts2[TypeFacts2["BaseBooleanFacts"] = 12580616] = "BaseBooleanFacts"; + TypeFacts2[TypeFacts2["BooleanStrictFacts"] = 16316168] = "BooleanStrictFacts"; + TypeFacts2[TypeFacts2["BooleanFacts"] = 16774920] = "BooleanFacts"; + TypeFacts2[TypeFacts2["FalseStrictFacts"] = 12121864] = "FalseStrictFacts"; + TypeFacts2[TypeFacts2["FalseFacts"] = 12580616] = "FalseFacts"; + TypeFacts2[TypeFacts2["TrueStrictFacts"] = 7927560] = "TrueStrictFacts"; + TypeFacts2[TypeFacts2["TrueFacts"] = 16774920] = "TrueFacts"; + TypeFacts2[TypeFacts2["SymbolStrictFacts"] = 7925520] = "SymbolStrictFacts"; + TypeFacts2[TypeFacts2["SymbolFacts"] = 16772880] = "SymbolFacts"; + TypeFacts2[TypeFacts2["ObjectStrictFacts"] = 7888800] = "ObjectStrictFacts"; + TypeFacts2[TypeFacts2["ObjectFacts"] = 16736160] = "ObjectFacts"; + TypeFacts2[TypeFacts2["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts"; + TypeFacts2[TypeFacts2["FunctionFacts"] = 16728e3] = "FunctionFacts"; + TypeFacts2[TypeFacts2["VoidFacts"] = 9830144] = "VoidFacts"; + TypeFacts2[TypeFacts2["UndefinedFacts"] = 26607360] = "UndefinedFacts"; + TypeFacts2[TypeFacts2["NullFacts"] = 42917664] = "NullFacts"; + TypeFacts2[TypeFacts2["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts"; + TypeFacts2[TypeFacts2["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts"; + TypeFacts2[TypeFacts2["UnknownFacts"] = 83886079] = "UnknownFacts"; + TypeFacts2[TypeFacts2["AllTypeofNE"] = 556800] = "AllTypeofNE"; + TypeFacts2[TypeFacts2["OrFactsMask"] = 8256] = "OrFactsMask"; + TypeFacts2[TypeFacts2["AndFactsMask"] = 134209471] = "AndFactsMask"; + })(TypeFacts = ts2.TypeFacts || (ts2.TypeFacts = {})); + var typeofNEFacts = new ts2.Map(ts2.getEntries({ + string: 256, + number: 512, + bigint: 1024, + boolean: 2048, + symbol: 4096, + undefined: 524288, + object: 8192, + function: 16384 + /* TypeFacts.TypeofNEFunction */ + })); + var TypeSystemPropertyName; + (function(TypeSystemPropertyName2) { + TypeSystemPropertyName2[TypeSystemPropertyName2["Type"] = 0] = "Type"; + TypeSystemPropertyName2[TypeSystemPropertyName2["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; + TypeSystemPropertyName2[TypeSystemPropertyName2["DeclaredType"] = 2] = "DeclaredType"; + TypeSystemPropertyName2[TypeSystemPropertyName2["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + TypeSystemPropertyName2[TypeSystemPropertyName2["ImmediateBaseConstraint"] = 4] = "ImmediateBaseConstraint"; + TypeSystemPropertyName2[TypeSystemPropertyName2["EnumTagType"] = 5] = "EnumTagType"; + TypeSystemPropertyName2[TypeSystemPropertyName2["ResolvedTypeArguments"] = 6] = "ResolvedTypeArguments"; + TypeSystemPropertyName2[TypeSystemPropertyName2["ResolvedBaseTypes"] = 7] = "ResolvedBaseTypes"; + TypeSystemPropertyName2[TypeSystemPropertyName2["WriteType"] = 8] = "WriteType"; + })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); + var CheckMode; + (function(CheckMode2) { + CheckMode2[CheckMode2["Normal"] = 0] = "Normal"; + CheckMode2[CheckMode2["Contextual"] = 1] = "Contextual"; + CheckMode2[CheckMode2["Inferential"] = 2] = "Inferential"; + CheckMode2[CheckMode2["SkipContextSensitive"] = 4] = "SkipContextSensitive"; + CheckMode2[CheckMode2["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; + CheckMode2[CheckMode2["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; + CheckMode2[CheckMode2["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions"; + CheckMode2[CheckMode2["RestBindingElement"] = 64] = "RestBindingElement"; + })(CheckMode = ts2.CheckMode || (ts2.CheckMode = {})); + var SignatureCheckMode; + (function(SignatureCheckMode2) { + SignatureCheckMode2[SignatureCheckMode2["BivariantCallback"] = 1] = "BivariantCallback"; + SignatureCheckMode2[SignatureCheckMode2["StrictCallback"] = 2] = "StrictCallback"; + SignatureCheckMode2[SignatureCheckMode2["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; + SignatureCheckMode2[SignatureCheckMode2["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode2[SignatureCheckMode2["Callback"] = 3] = "Callback"; + })(SignatureCheckMode = ts2.SignatureCheckMode || (ts2.SignatureCheckMode = {})); + var IntersectionState; + (function(IntersectionState2) { + IntersectionState2[IntersectionState2["None"] = 0] = "None"; + IntersectionState2[IntersectionState2["Source"] = 1] = "Source"; + IntersectionState2[IntersectionState2["Target"] = 2] = "Target"; + })(IntersectionState || (IntersectionState = {})); + var RecursionFlags; + (function(RecursionFlags2) { + RecursionFlags2[RecursionFlags2["None"] = 0] = "None"; + RecursionFlags2[RecursionFlags2["Source"] = 1] = "Source"; + RecursionFlags2[RecursionFlags2["Target"] = 2] = "Target"; + RecursionFlags2[RecursionFlags2["Both"] = 3] = "Both"; + })(RecursionFlags || (RecursionFlags = {})); + var MappedTypeModifiers; + (function(MappedTypeModifiers2) { + MappedTypeModifiers2[MappedTypeModifiers2["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers2[MappedTypeModifiers2["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers2[MappedTypeModifiers2["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers2[MappedTypeModifiers2["ExcludeOptional"] = 8] = "ExcludeOptional"; + })(MappedTypeModifiers || (MappedTypeModifiers = {})); + var ExpandingFlags; + (function(ExpandingFlags2) { + ExpandingFlags2[ExpandingFlags2["None"] = 0] = "None"; + ExpandingFlags2[ExpandingFlags2["Source"] = 1] = "Source"; + ExpandingFlags2[ExpandingFlags2["Target"] = 2] = "Target"; + ExpandingFlags2[ExpandingFlags2["Both"] = 3] = "Both"; + })(ExpandingFlags || (ExpandingFlags = {})); + var MembersOrExportsResolutionKind; + (function(MembersOrExportsResolutionKind2) { + MembersOrExportsResolutionKind2["resolvedExports"] = "resolvedExports"; + MembersOrExportsResolutionKind2["resolvedMembers"] = "resolvedMembers"; + })(MembersOrExportsResolutionKind || (MembersOrExportsResolutionKind = {})); + var UnusedKind; + (function(UnusedKind2) { + UnusedKind2[UnusedKind2["Local"] = 0] = "Local"; + UnusedKind2[UnusedKind2["Parameter"] = 1] = "Parameter"; + })(UnusedKind || (UnusedKind = {})); + var isNotOverloadAndNotAccessor = ts2.and(isNotOverload, isNotAccessor); + var DeclarationMeaning; + (function(DeclarationMeaning2) { + DeclarationMeaning2[DeclarationMeaning2["GetAccessor"] = 1] = "GetAccessor"; + DeclarationMeaning2[DeclarationMeaning2["SetAccessor"] = 2] = "SetAccessor"; + DeclarationMeaning2[DeclarationMeaning2["PropertyAssignment"] = 4] = "PropertyAssignment"; + DeclarationMeaning2[DeclarationMeaning2["Method"] = 8] = "Method"; + DeclarationMeaning2[DeclarationMeaning2["PrivateStatic"] = 16] = "PrivateStatic"; + DeclarationMeaning2[DeclarationMeaning2["GetOrSetAccessor"] = 3] = "GetOrSetAccessor"; + DeclarationMeaning2[DeclarationMeaning2["PropertyAssignmentOrMethod"] = 12] = "PropertyAssignmentOrMethod"; + })(DeclarationMeaning || (DeclarationMeaning = {})); + var DeclarationSpaces; + (function(DeclarationSpaces2) { + DeclarationSpaces2[DeclarationSpaces2["None"] = 0] = "None"; + DeclarationSpaces2[DeclarationSpaces2["ExportValue"] = 1] = "ExportValue"; + DeclarationSpaces2[DeclarationSpaces2["ExportType"] = 2] = "ExportType"; + DeclarationSpaces2[DeclarationSpaces2["ExportNamespace"] = 4] = "ExportNamespace"; + })(DeclarationSpaces || (DeclarationSpaces = {})); + var MinArgumentCountFlags; + (function(MinArgumentCountFlags2) { + MinArgumentCountFlags2[MinArgumentCountFlags2["None"] = 0] = "None"; + MinArgumentCountFlags2[MinArgumentCountFlags2["StrongArityForUntypedJS"] = 1] = "StrongArityForUntypedJS"; + MinArgumentCountFlags2[MinArgumentCountFlags2["VoidIsNonOptional"] = 2] = "VoidIsNonOptional"; + })(MinArgumentCountFlags || (MinArgumentCountFlags = {})); + var IntrinsicTypeKind; + (function(IntrinsicTypeKind2) { + IntrinsicTypeKind2[IntrinsicTypeKind2["Uppercase"] = 0] = "Uppercase"; + IntrinsicTypeKind2[IntrinsicTypeKind2["Lowercase"] = 1] = "Lowercase"; + IntrinsicTypeKind2[IntrinsicTypeKind2["Capitalize"] = 2] = "Capitalize"; + IntrinsicTypeKind2[IntrinsicTypeKind2["Uncapitalize"] = 3] = "Uncapitalize"; + })(IntrinsicTypeKind || (IntrinsicTypeKind = {})); + var intrinsicTypeKinds = new ts2.Map(ts2.getEntries({ + Uppercase: 0, + Lowercase: 1, + Capitalize: 2, + Uncapitalize: 3 + /* IntrinsicTypeKind.Uncapitalize */ + })); + function SymbolLinks() { + } + function NodeLinks() { + this.flags = 0; + } + function getNodeId(node) { + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } + return node.id; + } + ts2.getNodeId = getNodeId; + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId; + nextSymbolId++; + } + return symbol.id; + } + ts2.getSymbolId = getSymbolId; + function isInstantiatedModule(node, preserveConstEnums) { + var moduleState = ts2.getModuleInstanceState(node); + return moduleState === 1 || preserveConstEnums && moduleState === 2; + } + ts2.isInstantiatedModule = isInstantiatedModule; + function createTypeChecker(host) { + var getPackagesMap = ts2.memoize(function() { + var map4 = new ts2.Map(); + host.getSourceFiles().forEach(function(sf) { + if (!sf.resolvedModules) + return; + sf.resolvedModules.forEach(function(r8) { + if (r8 && r8.packageId) + map4.set(r8.packageId.name, r8.extension === ".d.ts" || !!map4.get(r8.packageId.name)); + }); + }); + return map4; + }); + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = function(arg) { + deferredDiagnosticsCallbacks.push(arg); + }; + var cancellationToken; + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol3 = ts2.objectAllocator.getSymbolConstructor(); + var Type3 = ts2.objectAllocator.getTypeConstructor(); + var Signature = ts2.objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var enumCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var emptySymbols = ts2.createSymbolTable(); + var arrayVariances = [ + 1 + /* VarianceFlags.Covariant */ + ]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var useDefineForClassFields = ts2.getUseDefineForClassFields(compilerOptions); + var allowSyntheticDefaultImports = ts2.getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = ts2.getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = ts2.getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = ts2.getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = ts2.getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = ts2.getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = ts2.getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = ts2.getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver4(); + var nodeBuilder = createNodeBuilder(); + var globals3 = ts2.createSymbolTable(); + var undefinedSymbol = createSymbol(4, "undefined"); + undefinedSymbol.declarations = []; + var globalThisSymbol = createSymbol( + 1536, + "globalThis", + 8 + /* CheckFlags.Readonly */ + ); + globalThisSymbol.exports = globals3; + globalThisSymbol.declarations = []; + globals3.set(globalThisSymbol.escapedName, globalThisSymbol); + var argumentsSymbol = createSymbol(4, "arguments"); + var requireSymbol = createSymbol(4, "require"); + var apparentArgumentCount; + var checker = { + getNodeCount: function() { + return ts2.sum(host.getSourceFiles(), "nodeCount"); + }, + getIdentifierCount: function() { + return ts2.sum(host.getSourceFiles(), "identifierCount"); + }, + getSymbolCount: function() { + return ts2.sum(host.getSourceFiles(), "symbolCount") + symbolCount; + }, + getTypeCount: function() { + return typeCount; + }, + getInstantiationCount: function() { + return totalInstantiationCount; + }, + getRelationCacheSizes: function() { + return { + assignable: assignableRelation.size, + identity: identityRelation.size, + subtype: subtypeRelation.size, + strictSubtype: strictSubtypeRelation.size + }; + }, + isUndefinedSymbol: function(symbol) { + return symbol === undefinedSymbol; + }, + isArgumentsSymbol: function(symbol) { + return symbol === argumentsSymbol; + }, + isUnknownSymbol: function(symbol) { + return symbol === unknownSymbol; + }, + getMergedSymbol, + getDiagnostics, + getGlobalDiagnostics, + getRecursionIdentity, + getUnmatchedProperties, + getTypeOfSymbolAtLocation: function(symbol, locationIn) { + var location2 = ts2.getParseTreeNode(locationIn); + return location2 ? getTypeOfSymbolAtLocation(symbol, location2) : errorType; + }, + getTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: function(parameterIn, parameterName) { + var parameter = ts2.getParseTreeNode(parameterIn, ts2.isParameter); + if (parameter === void 0) + return ts2.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + return getSymbolsOfParameterPropertyDeclaration(parameter, ts2.escapeLeadingUnderscores(parameterName)); + }, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType: function(type3, name2) { + return getPropertyOfType(type3, ts2.escapeLeadingUnderscores(name2)); + }, + getPrivateIdentifierPropertyOfType: function(leftType, name2, location2) { + var node = ts2.getParseTreeNode(location2); + if (!node) { + return void 0; + } + var propName2 = ts2.escapeLeadingUnderscores(name2); + var lexicallyScopedIdentifier = lookupSymbolForPrivateIdentifierDeclaration(propName2, node); + return lexicallyScopedIdentifier ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) : void 0; + }, + getTypeOfPropertyOfType: function(type3, name2) { + return getTypeOfPropertyOfType(type3, ts2.escapeLeadingUnderscores(name2)); + }, + getIndexInfoOfType: function(type3, kind) { + return getIndexInfoOfType(type3, kind === 0 ? stringType2 : numberType2); + }, + getIndexInfosOfType, + getIndexInfosOfIndexSymbol, + getSignaturesOfType, + getIndexTypeOfType: function(type3, kind) { + return getIndexTypeOfType(type3, kind === 0 ? stringType2 : numberType2); + }, + getIndexType: function(type3) { + return getIndexType(type3); + }, + getBaseTypes, + getBaseTypeOfLiteralType, + getWidenedType, + getTypeFromTypeNode: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isTypeNode); + return node ? getTypeFromTypeNode(node) : errorType; + }, + getParameterType: getTypeAtPosition, + getParameterIdentifierNameAtPosition, + getPromisedTypeOfPromise, + getAwaitedType: function(type3) { + return getAwaitedType(type3); + }, + getReturnTypeOfSignature, + isNullableType, + getNullableType, + getNonNullableType, + getNonOptionalType: removeOptionalTypeMarker, + getTypeArguments, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToNode: nodeBuilder.symbolToNode, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, + getSymbolsInScope: function(locationIn, meaning) { + var location2 = ts2.getParseTreeNode(locationIn); + return location2 ? getSymbolsInScope(location2, meaning) : []; + }, + getSymbolAtLocation: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? getSymbolAtLocation( + node, + /*ignoreErrors*/ + true + ) : void 0; + }, + getIndexInfosAtLocation: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? getIndexInfosAtLocation(node) : void 0; + }, + getShorthandAssignmentValueSymbol: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? getShorthandAssignmentValueSymbol(node) : void 0; + }, + getExportSpecifierLocalTargetSymbol: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : void 0; + }, + getExportSymbolOfSymbol: function(symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, + getTypeAtLocation: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? getTypeOfNode(node) : errorType; + }, + getTypeOfAssignmentPattern: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isAssignmentPattern); + return node && getTypeOfAssignmentPattern(node) || errorType; + }, + getPropertySymbolOfDestructuringAssignment: function(locationIn) { + var location2 = ts2.getParseTreeNode(locationIn, ts2.isIdentifier); + return location2 ? getPropertySymbolOfDestructuringAssignment(location2) : void 0; + }, + signatureToString: function(signature, enclosingDeclaration, flags, kind) { + return signatureToString(signature, ts2.getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: function(type3, enclosingDeclaration, flags) { + return typeToString(type3, ts2.getParseTreeNode(enclosingDeclaration), flags); + }, + symbolToString: function(symbol, enclosingDeclaration, meaning, flags) { + return symbolToString2(symbol, ts2.getParseTreeNode(enclosingDeclaration), meaning, flags); + }, + typePredicateToString: function(predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts2.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function(signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts2.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function(type3, enclosingDeclaration, flags, writer) { + return typeToString(type3, ts2.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function(symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString2(symbol, ts2.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function(predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts2.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getAugmentedPropertiesOfType, + getRootSymbols, + getSymbolOfExpando, + getContextualType: function(nodeIn, contextFlags) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isExpression); + if (!node) { + return void 0; + } + if (contextFlags & 4) { + return runWithInferenceBlockedFromSourceNode(node, function() { + return getContextualType(node, contextFlags); + }); + } + return getContextualType(node, contextFlags); + }, + getContextualTypeForObjectLiteralElement: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isObjectLiteralElementLike); + return node ? getContextualTypeForObjectLiteralElement( + node, + /*contextFlags*/ + void 0 + ) : void 0; + }, + getContextualTypeForArgumentAtIndex: function(nodeIn, argIndex) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute( + node, + /*contextFlags*/ + void 0 + ); + }, + isContextSensitive, + getTypeOfPropertyOfContextualType, + getFullyQualifiedName: getFullyQualifiedName2, + getResolvedSignature: function(node, candidatesOutArray, argumentCount) { + return getResolvedSignatureWorker( + node, + candidatesOutArray, + argumentCount, + 0 + /* CheckMode.Normal */ + ); + }, + getResolvedSignatureForStringLiteralCompletions: function(call, editingArgument, candidatesOutArray) { + return getResolvedSignatureWorker( + call, + candidatesOutArray, + /*argumentCount*/ + void 0, + 32, + editingArgument + ); + }, + getResolvedSignatureForSignatureHelp: function(node, candidatesOutArray, argumentCount) { + return getResolvedSignatureWorker( + node, + candidatesOutArray, + argumentCount, + 16 + /* CheckMode.IsForSignatureHelp */ + ); + }, + getExpandedParameters, + hasEffectiveRestParameter, + containsArgumentsReference, + getConstantValue: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, canHaveConstantValue); + return node ? getConstantValue(node) : void 0; + }, + isValidPropertyAccess: function(nodeIn, propertyName) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isPropertyAccessOrQualifiedNameOrImportTypeNode); + return !!node && isValidPropertyAccess(node, ts2.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function(nodeIn, type3, property2) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type3, property2); + }, + getSignatureFromDeclaration: function(declarationIn) { + var declaration = ts2.getParseTreeNode(declarationIn, ts2.isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : void 0; + }, + isImplementationOfOverload: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isFunctionLike); + return node ? isImplementationOfOverload(node) : void 0; + }, + getImmediateAliasedSymbol, + getAliasedSymbol: resolveAlias, + getEmitResolver, + getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule, + forEachExportAndPropertyOfModule, + getSymbolWalker: ts2.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, ts2.getFirstIdentifier, getTypeArguments), + getAmbientModules, + getJsxIntrinsicTagNamesAt, + isOptionalParameter: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isParameter); + return node ? isOptionalParameter(node) : false; + }, + tryGetMemberInModuleExports: function(name2, symbol) { + return tryGetMemberInModuleExports(ts2.escapeLeadingUnderscores(name2), symbol); + }, + tryGetMemberInModuleExportsAndProperties: function(name2, symbol) { + return tryGetMemberInModuleExportsAndProperties(ts2.escapeLeadingUnderscores(name2), symbol); + }, + tryFindAmbientModule: function(moduleName3) { + return tryFindAmbientModule( + moduleName3, + /*withAugmentations*/ + true + ); + }, + tryFindAmbientModuleWithoutAugmentations: function(moduleName3) { + return tryFindAmbientModule( + moduleName3, + /*withAugmentations*/ + false + ); + }, + getApparentType, + getUnionType, + isTypeAssignableTo, + createAnonymousType, + createSignature, + createSymbol, + createIndexInfo, + getAnyType: function() { + return anyType2; + }, + getStringType: function() { + return stringType2; + }, + getNumberType: function() { + return numberType2; + }, + createPromiseType, + createArrayType, + getElementTypeOfArrayType, + getBooleanType: function() { + return booleanType2; + }, + getFalseType: function(fresh) { + return fresh ? falseType : regularFalseType; + }, + getTrueType: function(fresh) { + return fresh ? trueType : regularTrueType; + }, + getVoidType: function() { + return voidType2; + }, + getUndefinedType: function() { + return undefinedType2; + }, + getNullType: function() { + return nullType2; + }, + getESSymbolType: function() { + return esSymbolType; + }, + getNeverType: function() { + return neverType2; + }, + getOptionalType: function() { + return optionalType2; + }, + getPromiseType: function() { + return getGlobalPromiseType( + /*reportErrors*/ + false + ); + }, + getPromiseLikeType: function() { + return getGlobalPromiseLikeType( + /*reportErrors*/ + false + ); + }, + getAsyncIterableType: function() { + var type3 = getGlobalAsyncIterableType( + /*reportErrors*/ + false + ); + if (type3 === emptyGenericType) + return void 0; + return type3; + }, + isSymbolAccessible, + isArrayType, + isTupleType, + isArrayLikeType, + isTypeInvalidDueToUnionDiscriminant, + getExactOptionalProperties, + getAllPossiblePropertiesOfTypes, + getSuggestedSymbolForNonexistentProperty, + getSuggestionForNonexistentProperty, + getSuggestedSymbolForNonexistentJSXAttribute, + getSuggestedSymbolForNonexistentSymbol: function(location2, name2, meaning) { + return getSuggestedSymbolForNonexistentSymbol(location2, ts2.escapeLeadingUnderscores(name2), meaning); + }, + getSuggestionForNonexistentSymbol: function(location2, name2, meaning) { + return getSuggestionForNonexistentSymbol(location2, ts2.escapeLeadingUnderscores(name2), meaning); + }, + getSuggestedSymbolForNonexistentModule, + getSuggestionForNonexistentExport, + getSuggestedSymbolForNonexistentClassMember, + getBaseConstraintOfType, + getDefaultFromTypeParameter: function(type3) { + return type3 && type3.flags & 262144 ? getDefaultFromTypeParameter(type3) : void 0; + }, + resolveName: function(name2, location2, meaning, excludeGlobals) { + return resolveName( + location2, + ts2.escapeLeadingUnderscores(name2), + meaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false, + excludeGlobals + ); + }, + getJsxNamespace: function(n7) { + return ts2.unescapeLeadingUnderscores(getJsxNamespace(n7)); + }, + getJsxFragmentFactory: function(n7) { + var jsxFragmentFactory = getJsxFragmentFactoryEntity(n7); + return jsxFragmentFactory && ts2.unescapeLeadingUnderscores(ts2.getFirstIdentifier(jsxFragmentFactory).escapedText); + }, + getAccessibleSymbolChain, + getTypePredicateOfSignature, + resolveExternalModuleName: function(moduleSpecifierIn) { + var moduleSpecifier = ts2.getParseTreeNode(moduleSpecifierIn, ts2.isExpression); + return moduleSpecifier && resolveExternalModuleName( + moduleSpecifier, + moduleSpecifier, + /*ignoreErrors*/ + true + ); + }, + resolveExternalModuleSymbol, + tryGetThisTypeAt: function(nodeIn, includeGlobalThis, container) { + var node = ts2.getParseTreeNode(nodeIn); + return node && tryGetThisTypeAt(node, includeGlobalThis, container); + }, + getTypeArgumentConstraint: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, + getSuggestionDiagnostics: function(fileIn, ct) { + var file = ts2.getParseTreeNode(fileIn, ts2.isSourceFile) || ts2.Debug.fail("Could not determine parsed source file."); + if (ts2.skipTypeChecking(file, compilerOptions, host)) { + return ts2.emptyArray; + } + var diagnostics2; + try { + cancellationToken = ct; + checkSourceFileWithEagerDiagnostics(file); + ts2.Debug.assert(!!(getNodeLinks(file).flags & 1)); + diagnostics2 = ts2.addRange(diagnostics2, suggestionDiagnostics.getDiagnostics(file.fileName)); + checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), function(containingNode, kind, diag) { + if (!ts2.containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 16777216))) { + (diagnostics2 || (diagnostics2 = [])).push(__assign16(__assign16({}, diag), { category: ts2.DiagnosticCategory.Suggestion })); + } + }); + return diagnostics2 || ts2.emptyArray; + } finally { + cancellationToken = void 0; + } + }, + runWithCancellationToken: function(token, callback) { + try { + cancellationToken = token; + return callback(checker); + } finally { + cancellationToken = void 0; + } + }, + getLocalTypeParametersOfClassOrInterfaceOrTypeAlias, + isDeclarationVisible, + isPropertyAccessible, + getTypeOnlyAliasDeclaration, + getMemberOverrideModifierStatus, + isTypeParameterPossiblyReferenced + }; + function runWithInferenceBlockedFromSourceNode(node, fn) { + var containingCall = ts2.findAncestor(node, ts2.isCallLikeExpression); + var containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature; + if (containingCall) { + var toMarkSkip = node; + do { + getNodeLinks(toMarkSkip).skipDirectInference = true; + toMarkSkip = toMarkSkip.parent; + } while (toMarkSkip && toMarkSkip !== containingCall); + getNodeLinks(containingCall).resolvedSignature = void 0; + } + var result2 = fn(); + if (containingCall) { + var toMarkSkip = node; + do { + getNodeLinks(toMarkSkip).skipDirectInference = void 0; + toMarkSkip = toMarkSkip.parent; + } while (toMarkSkip && toMarkSkip !== containingCall); + getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature; + } + return result2; + } + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isCallLikeExpression); + apparentArgumentCount = argumentCount; + var res = !node ? void 0 : editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, function() { + return getResolvedSignature(node, candidatesOutArray, checkMode); + }) : getResolvedSignature(node, candidatesOutArray, checkMode); + apparentArgumentCount = void 0; + return res; + } + var tupleTypes = new ts2.Map(); + var unionTypes = new ts2.Map(); + var intersectionTypes = new ts2.Map(); + var stringLiteralTypes = new ts2.Map(); + var numberLiteralTypes = new ts2.Map(); + var bigIntLiteralTypes = new ts2.Map(); + var enumLiteralTypes = new ts2.Map(); + var indexedAccessTypes = new ts2.Map(); + var templateLiteralTypes = new ts2.Map(); + var stringMappingTypes = new ts2.Map(); + var substitutionTypes = new ts2.Map(); + var subtypeReductionCache = new ts2.Map(); + var cachedTypes = new ts2.Map(); + var evolvingArrayTypes = []; + var undefinedProperties = new ts2.Map(); + var markerTypes = new ts2.Set(); + var unknownSymbol = createSymbol(4, "unknown"); + var resolvingSymbol = createSymbol( + 0, + "__resolving__" + /* InternalSymbolName.Resolving */ + ); + var unresolvedSymbols = new ts2.Map(); + var errorTypes = new ts2.Map(); + var anyType2 = createIntrinsicType(1, "any"); + var autoType = createIntrinsicType( + 1, + "any", + 262144 + /* ObjectFlags.NonInferrableType */ + ); + var wildcardType = createIntrinsicType(1, "any"); + var errorType = createIntrinsicType(1, "error"); + var unresolvedType = createIntrinsicType(1, "unresolved"); + var nonInferrableAnyType = createIntrinsicType( + 1, + "any", + 65536 + /* ObjectFlags.ContainsWideningType */ + ); + var intrinsicMarkerType = createIntrinsicType(1, "intrinsic"); + var unknownType2 = createIntrinsicType(2, "unknown"); + var nonNullUnknownType = createIntrinsicType(2, "unknown"); + var undefinedType2 = createIntrinsicType(32768, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType2 : createIntrinsicType( + 32768, + "undefined", + 65536 + /* ObjectFlags.ContainsWideningType */ + ); + var optionalType2 = createIntrinsicType(32768, "undefined"); + var missingType = exactOptionalPropertyTypes ? createIntrinsicType(32768, "undefined") : undefinedType2; + var nullType2 = createIntrinsicType(65536, "null"); + var nullWideningType = strictNullChecks ? nullType2 : createIntrinsicType( + 65536, + "null", + 65536 + /* ObjectFlags.ContainsWideningType */ + ); + var stringType2 = createIntrinsicType(4, "string"); + var numberType2 = createIntrinsicType(8, "number"); + var bigintType = createIntrinsicType(64, "bigint"); + var falseType = createIntrinsicType(512, "false"); + var regularFalseType = createIntrinsicType(512, "false"); + var trueType = createIntrinsicType(512, "true"); + var regularTrueType = createIntrinsicType(512, "true"); + trueType.regularType = regularTrueType; + trueType.freshType = trueType; + regularTrueType.regularType = regularTrueType; + regularTrueType.freshType = trueType; + falseType.regularType = regularFalseType; + falseType.freshType = falseType; + regularFalseType.regularType = regularFalseType; + regularFalseType.freshType = falseType; + var booleanType2 = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096, "symbol"); + var voidType2 = createIntrinsicType(16384, "void"); + var neverType2 = createIntrinsicType(131072, "never"); + var silentNeverType = createIntrinsicType( + 131072, + "never", + 262144 + /* ObjectFlags.NonInferrableType */ + ); + var implicitNeverType = createIntrinsicType(131072, "never"); + var unreachableNeverType = createIntrinsicType(131072, "never"); + var nonPrimitiveType = createIntrinsicType(67108864, "object"); + var stringOrNumberType = getUnionType([stringType2, numberType2]); + var stringNumberSymbolType = getUnionType([stringType2, numberType2, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType2 : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType2, bigintType]); + var templateConstraintType = getUnionType([stringType2, numberType2, booleanType2, bigintType, nullType2, undefinedType2]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType2]); + var restrictiveMapper = makeFunctionTypeMapper(function(t8) { + return t8.flags & 262144 ? getRestrictiveTypeParameter(t8) : t8; + }, function() { + return "(restrictive mapper)"; + }); + var permissiveMapper = makeFunctionTypeMapper(function(t8) { + return t8.flags & 262144 ? wildcardType : t8; + }, function() { + return "(permissive mapper)"; + }); + var uniqueLiteralType = createIntrinsicType(131072, "never"); + var uniqueLiteralMapper = makeFunctionTypeMapper(function(t8) { + return t8.flags & 262144 ? uniqueLiteralType : t8; + }, function() { + return "(unique literal mapper)"; + }); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper(function(t8) { + if (outofbandVarianceMarkerHandler && (t8 === markerSuperType || t8 === markerSubType || t8 === markerOtherType)) { + outofbandVarianceMarkerHandler( + /*onlyUnreliable*/ + true + ); + } + return t8; + }, function() { + return "(unmeasurable reporter)"; + }); + var reportUnmeasurableMapper = makeFunctionTypeMapper(function(t8) { + if (outofbandVarianceMarkerHandler && (t8 === markerSuperType || t8 === markerSubType || t8 === markerOtherType)) { + outofbandVarianceMarkerHandler( + /*onlyUnreliable*/ + false + ); + } + return t8; + }, function() { + return "(unreliable reporter)"; + }); + var emptyObjectType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var emptyJsxObjectType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + emptyJsxObjectType.objectFlags |= 2048; + var emptyTypeLiteralSymbol = createSymbol( + 2048, + "__type" + /* InternalSymbolName.Type */ + ); + emptyTypeLiteralSymbol.members = ts2.createSymbolTable(); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var unknownEmptyObjectType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType2, nullType2, unknownEmptyObjectType]) : unknownType2; + var emptyGenericType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + emptyGenericType.instantiations = new ts2.Map(); + var anyFunctionType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + anyFunctionType.objectFlags |= 262144; + var noConstraintType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var circularConstraintType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var resolvingDefaultType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); + markerSubType.constraint = markerSuperType; + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); + markerSubTypeForCheck.constraint = markerSuperTypeForCheck; + var noTypePredicate = createTypePredicate(1, "<>", 0, anyType2); + var anySignature = createSignature( + void 0, + void 0, + void 0, + ts2.emptyArray, + anyType2, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* SignatureFlags.None */ + ); + var unknownSignature = createSignature( + void 0, + void 0, + void 0, + ts2.emptyArray, + errorType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* SignatureFlags.None */ + ); + var resolvingSignature = createSignature( + void 0, + void 0, + void 0, + ts2.emptyArray, + anyType2, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* SignatureFlags.None */ + ); + var silentNeverSignature = createSignature( + void 0, + void 0, + void 0, + ts2.emptyArray, + silentNeverType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* SignatureFlags.None */ + ); + var enumNumberIndexInfo = createIndexInfo( + numberType2, + stringType2, + /*isReadonly*/ + true + ); + var iterationTypesCache = new ts2.Map(); + var noIterationTypes = { + get yieldType() { + return ts2.Debug.fail("Not supported"); + }, + get returnType() { + return ts2.Debug.fail("Not supported"); + }, + get nextType() { + return ts2.Debug.fail("Not supported"); + } + }; + var anyIterationTypes = createIterationTypes(anyType2, anyType2, anyType2); + var anyIterationTypesExceptNext = createIterationTypes(anyType2, anyType2, unknownType2); + var defaultIterationTypes = createIterationTypes(neverType2, anyType2, undefinedType2); + var asyncIterationTypesResolver = { + iterableCacheKey: "iterationTypesOfAsyncIterable", + iteratorCacheKey: "iterationTypesOfAsyncIterator", + iteratorSymbolName: "asyncIterator", + getGlobalIteratorType: getGlobalAsyncIteratorType, + getGlobalIterableType: getGlobalAsyncIterableType, + getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType, + getGlobalGeneratorType: getGlobalAsyncGeneratorType, + resolveIterationType: getAwaitedType, + mustHaveANextMethodDiagnostic: ts2.Diagnostics.An_async_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: ts2.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, + mustHaveAValueDiagnostic: ts2.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + }; + var syncIterationTypesResolver = { + iterableCacheKey: "iterationTypesOfIterable", + iteratorCacheKey: "iterationTypesOfIterator", + iteratorSymbolName: "iterator", + getGlobalIteratorType, + getGlobalIterableType, + getGlobalIterableIteratorType, + getGlobalGeneratorType, + resolveIterationType: function(type3, _errorNode) { + return type3; + }, + mustHaveANextMethodDiagnostic: ts2.Diagnostics.An_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: ts2.Diagnostics.The_0_property_of_an_iterator_must_be_a_method, + mustHaveAValueDiagnostic: ts2.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property + }; + var amalgamatedDuplicates; + var reverseMappedCache = new ts2.Map(); + var inInferTypeForHomomorphicMappedType = false; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var allPotentiallyUnusedIdentifiers = new ts2.Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = ts2.createDiagnosticCollection(); + var suggestionDiagnostics = ts2.createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = new ts2.Map(); + var strictSubtypeRelation = new ts2.Map(); + var assignableRelation = new ts2.Map(); + var comparableRelation = new ts2.Map(); + var identityRelation = new ts2.Map(); + var enumRelation = new ts2.Map(); + var builtinGlobals = ts2.createSymbolTable(); + builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); + var suggestedExtensions = [ + [".mts", ".mjs"], + [".ts", ".js"], + [".cts", ".cjs"], + [".mjs", ".mjs"], + [".js", ".js"], + [".cjs", ".cjs"], + [".tsx", compilerOptions.jsx === 1 ? ".jsx" : ".js"], + [".jsx", ".jsx"], + [".json", ".json"] + ]; + initializeTypeChecker(); + return checker; + function getCachedType(key) { + return key ? cachedTypes.get(key) : void 0; + } + function setCachedType(key, type3) { + if (key) + cachedTypes.set(key, type3); + return type3; + } + function getJsxNamespace(location2) { + if (location2) { + var file = ts2.getSourceFileOfNode(location2); + if (file) { + if (ts2.isJsxOpeningFragment(location2)) { + if (file.localJsxFragmentNamespace) { + return file.localJsxFragmentNamespace; + } + var jsxFragmentPragma = file.pragmas.get("jsxfrag"); + if (jsxFragmentPragma) { + var chosenPragma = ts2.isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; + file.localJsxFragmentFactory = ts2.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); + ts2.visitNode(file.localJsxFragmentFactory, markAsSynthetic); + if (file.localJsxFragmentFactory) { + return file.localJsxFragmentNamespace = ts2.getFirstIdentifier(file.localJsxFragmentFactory).escapedText; + } + } + var entity = getJsxFragmentFactoryEntity(location2); + if (entity) { + file.localJsxFragmentFactory = entity; + return file.localJsxFragmentNamespace = ts2.getFirstIdentifier(entity).escapedText; + } + } else { + var localJsxNamespace = getLocalJsxNamespace(file); + if (localJsxNamespace) { + return file.localJsxNamespace = localJsxNamespace; + } + } + } + } + if (!_jsxNamespace) { + _jsxNamespace = "React"; + if (compilerOptions.jsxFactory) { + _jsxFactoryEntity = ts2.parseIsolatedEntityName(compilerOptions.jsxFactory, languageVersion); + ts2.visitNode(_jsxFactoryEntity, markAsSynthetic); + if (_jsxFactoryEntity) { + _jsxNamespace = ts2.getFirstIdentifier(_jsxFactoryEntity).escapedText; + } + } else if (compilerOptions.reactNamespace) { + _jsxNamespace = ts2.escapeLeadingUnderscores(compilerOptions.reactNamespace); + } + } + if (!_jsxFactoryEntity) { + _jsxFactoryEntity = ts2.factory.createQualifiedName(ts2.factory.createIdentifier(ts2.unescapeLeadingUnderscores(_jsxNamespace)), "createElement"); + } + return _jsxNamespace; + } + function getLocalJsxNamespace(file) { + if (file.localJsxNamespace) { + return file.localJsxNamespace; + } + var jsxPragma = file.pragmas.get("jsx"); + if (jsxPragma) { + var chosenPragma = ts2.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; + file.localJsxFactory = ts2.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); + ts2.visitNode(file.localJsxFactory, markAsSynthetic); + if (file.localJsxFactory) { + return file.localJsxNamespace = ts2.getFirstIdentifier(file.localJsxFactory).escapedText; + } + } + } + function markAsSynthetic(node) { + ts2.setTextRangePosEnd(node, -1, -1); + return ts2.visitEachChild(node, markAsSynthetic, ts2.nullTransformationContext); + } + function getEmitResolver(sourceFile, cancellationToken2) { + getDiagnostics(sourceFile, cancellationToken2); + return emitResolver; + } + function lookupOrIssueError(location2, message, arg0, arg1, arg2, arg3) { + var diagnostic = location2 ? ts2.createDiagnosticForNode(location2, message, arg0, arg1, arg2, arg3) : ts2.createCompilerDiagnostic(message, arg0, arg1, arg2, arg3); + var existing = diagnostics.lookup(diagnostic); + if (existing) { + return existing; + } else { + diagnostics.add(diagnostic); + return diagnostic; + } + } + function errorSkippedOn(key, location2, message, arg0, arg1, arg2, arg3) { + var diagnostic = error2(location2, message, arg0, arg1, arg2, arg3); + diagnostic.skippedOn = key; + return diagnostic; + } + function createError(location2, message, arg0, arg1, arg2, arg3) { + return location2 ? ts2.createDiagnosticForNode(location2, message, arg0, arg1, arg2, arg3) : ts2.createCompilerDiagnostic(message, arg0, arg1, arg2, arg3); + } + function error2(location2, message, arg0, arg1, arg2, arg3) { + var diagnostic = createError(location2, message, arg0, arg1, arg2, arg3); + diagnostics.add(diagnostic); + return diagnostic; + } + function addErrorOrSuggestion(isError3, diagnostic) { + if (isError3) { + diagnostics.add(diagnostic); + } else { + suggestionDiagnostics.add(__assign16(__assign16({}, diagnostic), { category: ts2.DiagnosticCategory.Suggestion })); + } + } + function errorOrSuggestion(isError3, location2, message, arg0, arg1, arg2, arg3) { + if (location2.pos < 0 || location2.end < 0) { + if (!isError3) { + return; + } + var file = ts2.getSourceFileOfNode(location2); + addErrorOrSuggestion(isError3, "message" in message ? ts2.createFileDiagnostic(file, 0, 0, message, arg0, arg1, arg2, arg3) : ts2.createDiagnosticForFileFromMessageChain(file, message)); + return; + } + addErrorOrSuggestion(isError3, "message" in message ? ts2.createDiagnosticForNode(location2, message, arg0, arg1, arg2, arg3) : ts2.createDiagnosticForNodeFromMessageChain(location2, message)); + } + function errorAndMaybeSuggestAwait(location2, maybeMissingAwait, message, arg0, arg1, arg2, arg3) { + var diagnostic = error2(location2, message, arg0, arg1, arg2, arg3); + if (maybeMissingAwait) { + var related = ts2.createDiagnosticForNode(location2, ts2.Diagnostics.Did_you_forget_to_use_await); + ts2.addRelatedInfo(diagnostic, related); + } + return diagnostic; + } + function addDeprecatedSuggestionWorker(declarations, diagnostic) { + var deprecatedTag = Array.isArray(declarations) ? ts2.forEach(declarations, ts2.getJSDocDeprecatedTag) : ts2.getJSDocDeprecatedTag(declarations); + if (deprecatedTag) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(deprecatedTag, ts2.Diagnostics.The_declaration_was_marked_as_deprecated_here)); + } + suggestionDiagnostics.add(diagnostic); + return diagnostic; + } + function isDeprecatedSymbol(symbol) { + return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 268435456); + } + function addDeprecatedSuggestion(location2, declarations, deprecatedEntity) { + var diagnostic = ts2.createDiagnosticForNode(location2, ts2.Diagnostics._0_is_deprecated, deprecatedEntity); + return addDeprecatedSuggestionWorker(declarations, diagnostic); + } + function addDeprecatedSuggestionWithSignature(location2, declaration, deprecatedEntity, signatureString) { + var diagnostic = deprecatedEntity ? ts2.createDiagnosticForNode(location2, ts2.Diagnostics.The_signature_0_of_1_is_deprecated, signatureString, deprecatedEntity) : ts2.createDiagnosticForNode(location2, ts2.Diagnostics._0_is_deprecated, signatureString); + return addDeprecatedSuggestionWorker(declaration, diagnostic); + } + function createSymbol(flags, name2, checkFlags) { + symbolCount++; + var symbol = new Symbol3(flags | 33554432, name2); + symbol.checkFlags = checkFlags || 0; + return symbol; + } + function getExcludedSymbolFlags(flags) { + var result2 = 0; + if (flags & 2) + result2 |= 111551; + if (flags & 1) + result2 |= 111550; + if (flags & 4) + result2 |= 0; + if (flags & 8) + result2 |= 900095; + if (flags & 16) + result2 |= 110991; + if (flags & 32) + result2 |= 899503; + if (flags & 64) + result2 |= 788872; + if (flags & 256) + result2 |= 899327; + if (flags & 128) + result2 |= 899967; + if (flags & 512) + result2 |= 110735; + if (flags & 8192) + result2 |= 103359; + if (flags & 32768) + result2 |= 46015; + if (flags & 65536) + result2 |= 78783; + if (flags & 262144) + result2 |= 526824; + if (flags & 524288) + result2 |= 788968; + if (flags & 2097152) + result2 |= 2097152; + return result2; + } + function recordMergedSymbol(target, source) { + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } + mergedSymbols[source.mergeId] = target; + } + function cloneSymbol2(symbol) { + var result2 = createSymbol(symbol.flags, symbol.escapedName); + result2.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result2.parent = symbol.parent; + if (symbol.valueDeclaration) + result2.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result2.constEnumOnlyModule = true; + if (symbol.members) + result2.members = new ts2.Map(symbol.members); + if (symbol.exports) + result2.exports = new ts2.Map(symbol.exports); + recordMergedSymbol(result2, symbol); + return result2; + } + function mergeSymbol(target, source, unidirectional) { + if (unidirectional === void 0) { + unidirectional = false; + } + if (!(target.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | target.flags) & 67108864) { + if (source === target) { + return target; + } + if (!(target.flags & 33554432)) { + var resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol2(resolvedTarget); + } + if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } + target.flags |= source.flags; + if (source.valueDeclaration) { + ts2.setValueDeclaration(target, source.valueDeclaration); + } + ts2.addRange(target.declarations, source.declarations); + if (source.members) { + if (!target.members) + target.members = ts2.createSymbolTable(); + mergeSymbolTable(target.members, source.members, unidirectional); + } + if (source.exports) { + if (!target.exports) + target.exports = ts2.createSymbolTable(); + mergeSymbolTable(target.exports, source.exports, unidirectional); + } + if (!unidirectional) { + recordMergedSymbol(target, source); + } + } else if (target.flags & 1024) { + if (target !== globalThisSymbol) { + error2(source.declarations && ts2.getNameOfDeclaration(source.declarations[0]), ts2.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString2(target)); + } + } else { + var isEitherEnum = !!(target.flags & 384 || source.flags & 384); + var isEitherBlockScoped_1 = !!(target.flags & 2 || source.flags & 2); + var message = isEitherEnum ? ts2.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : isEitherBlockScoped_1 ? ts2.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts2.Diagnostics.Duplicate_identifier_0; + var sourceSymbolFile = source.declarations && ts2.getSourceFileOfNode(source.declarations[0]); + var targetSymbolFile = target.declarations && ts2.getSourceFileOfNode(target.declarations[0]); + var isSourcePlainJs = ts2.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs); + var isTargetPlainJs = ts2.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs); + var symbolName_1 = symbolToString2(source); + if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) { + var firstFile_1 = ts2.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 ? sourceSymbolFile : targetSymbolFile; + var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile; + var filesDuplicates = ts2.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function() { + return { firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts2.Map() }; + }); + var conflictingSymbolInfo = ts2.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function() { + return { isBlockScoped: isEitherBlockScoped_1, firstFileLocations: [], secondFileLocations: [] }; + }); + if (!isSourcePlainJs) + addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source); + if (!isTargetPlainJs) + addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target); + } else { + if (!isSourcePlainJs) + addDuplicateDeclarationErrorsForSymbols(source, message, symbolName_1, target); + if (!isTargetPlainJs) + addDuplicateDeclarationErrorsForSymbols(target, message, symbolName_1, source); + } + } + return target; + function addDuplicateLocations(locs, symbol) { + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + ts2.pushIfUnique(locs, decl); + } + } + } + } + function addDuplicateDeclarationErrorsForSymbols(target, message, symbolName, source) { + ts2.forEach(target.declarations, function(node) { + addDuplicateDeclarationError(node, message, symbolName, source.declarations); + }); + } + function addDuplicateDeclarationError(node, message, symbolName, relatedNodes) { + var errorNode = (ts2.getExpandoInitializer( + node, + /*isPrototypeAssignment*/ + false + ) ? ts2.getNameOfExpando(node) : ts2.getNameOfDeclaration(node)) || node; + var err = lookupOrIssueError(errorNode, message, symbolName); + var _loop_7 = function(relatedNode2) { + var adjustedNode = (ts2.getExpandoInitializer( + relatedNode2, + /*isPrototypeAssignment*/ + false + ) ? ts2.getNameOfExpando(relatedNode2) : ts2.getNameOfDeclaration(relatedNode2)) || relatedNode2; + if (adjustedNode === errorNode) + return "continue"; + err.relatedInformation = err.relatedInformation || []; + var leadingMessage = ts2.createDiagnosticForNode(adjustedNode, ts2.Diagnostics._0_was_also_declared_here, symbolName); + var followOnMessage = ts2.createDiagnosticForNode(adjustedNode, ts2.Diagnostics.and_here); + if (ts2.length(err.relatedInformation) >= 5 || ts2.some(err.relatedInformation, function(r8) { + return ts2.compareDiagnostics(r8, followOnMessage) === 0 || ts2.compareDiagnostics(r8, leadingMessage) === 0; + })) + return "continue"; + ts2.addRelatedInfo(err, !ts2.length(err.relatedInformation) ? leadingMessage : followOnMessage); + }; + for (var _i = 0, _a2 = relatedNodes || ts2.emptyArray; _i < _a2.length; _i++) { + var relatedNode = _a2[_i]; + _loop_7(relatedNode); + } + } + function combineSymbolTables(first, second) { + if (!(first === null || first === void 0 ? void 0 : first.size)) + return second; + if (!(second === null || second === void 0 ? void 0 : second.size)) + return first; + var combined = ts2.createSymbolTable(); + mergeSymbolTable(combined, first); + mergeSymbolTable(combined, second); + return combined; + } + function mergeSymbolTable(target, source, unidirectional) { + if (unidirectional === void 0) { + unidirectional = false; + } + source.forEach(function(sourceSymbol, id) { + var targetSymbol = target.get(id); + target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol)); + }); + } + function mergeModuleAugmentation(moduleName3) { + var _a2, _b, _c; + var moduleAugmentation = moduleName3.parent; + if (((_a2 = moduleAugmentation.symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]) !== moduleAugmentation) { + ts2.Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (ts2.isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals3, moduleAugmentation.symbol.exports); + } else { + var moduleNotFoundError = !(moduleName3.parent.parent.flags & 16777216) ? ts2.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found : void 0; + var mainModule_1 = resolveExternalModuleNameWorker( + moduleName3, + moduleName3, + moduleNotFoundError, + /*isForAugmentation*/ + true + ); + if (!mainModule_1) { + return; + } + mainModule_1 = resolveExternalModuleSymbol(mainModule_1); + if (mainModule_1.flags & 1920) { + if (ts2.some(patternAmbientModules, function(module6) { + return mainModule_1 === module6.symbol; + })) { + var merged = mergeSymbol( + moduleAugmentation.symbol, + mainModule_1, + /*unidirectional*/ + true + ); + if (!patternAmbientModuleAugmentations) { + patternAmbientModuleAugmentations = new ts2.Map(); + } + patternAmbientModuleAugmentations.set(moduleName3.text, merged); + } else { + if (((_b = mainModule_1.exports) === null || _b === void 0 ? void 0 : _b.get( + "__export" + /* InternalSymbolName.ExportStar */ + )) && ((_c = moduleAugmentation.symbol.exports) === null || _c === void 0 ? void 0 : _c.size)) { + var resolvedExports = getResolvedMembersOrExportsOfSymbol( + mainModule_1, + "resolvedExports" + /* MembersOrExportsResolutionKind.resolvedExports */ + ); + for (var _i = 0, _d = ts2.arrayFrom(moduleAugmentation.symbol.exports.entries()); _i < _d.length; _i++) { + var _e2 = _d[_i], key = _e2[0], value2 = _e2[1]; + if (resolvedExports.has(key) && !mainModule_1.exports.has(key)) { + mergeSymbol(resolvedExports.get(key), value2); + } + } + } + mergeSymbol(mainModule_1, moduleAugmentation.symbol); + } + } else { + error2(moduleName3, ts2.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName3.text); + } + } + } + function addToSymbolTable(target, source, message) { + source.forEach(function(sourceSymbol, id) { + var targetSymbol = target.get(id); + if (targetSymbol) { + ts2.forEach(targetSymbol.declarations, addDeclarationDiagnostic(ts2.unescapeLeadingUnderscores(id), message)); + } else { + target.set(id, sourceSymbol); + } + }); + function addDeclarationDiagnostic(id, message2) { + return function(declaration) { + return diagnostics.add(ts2.createDiagnosticForNode(declaration, message2, id)); + }; + } + } + function getSymbolLinks(symbol) { + if (symbol.flags & 33554432) + return symbol; + var id = getSymbolId(symbol); + return symbolLinks[id] || (symbolLinks[id] = new SymbolLinks()); + } + function getNodeLinks(node) { + var nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); + } + function isGlobalSourceFile(node) { + return node.kind === 308 && !ts2.isExternalOrCommonJsModule(node); + } + function getSymbol(symbols, name2, meaning) { + if (meaning) { + var symbol = getMergedSymbol(symbols.get(name2)); + if (symbol) { + ts2.Debug.assert((ts2.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); + if (symbol.flags & meaning) { + return symbol; + } + if (symbol.flags & 2097152) { + var targetFlags = getAllSymbolFlags(symbol); + if (targetFlags & meaning) { + return symbol; + } + } + } + } + } + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + var constructorDeclaration = parameter.parent; + var classDeclaration = parameter.parent.parent; + var parameterSymbol = getSymbol( + constructorDeclaration.locals, + parameterName, + 111551 + /* SymbolFlags.Value */ + ); + var propertySymbol = getSymbol( + getMembersOfSymbol(classDeclaration.symbol), + parameterName, + 111551 + /* SymbolFlags.Value */ + ); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + return ts2.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } + function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { + var declarationFile = ts2.getSourceFileOfNode(declaration); + var useFile = ts2.getSourceFileOfNode(usage); + var declContainer = ts2.getEnclosingBlockScopeContainer(declaration); + if (declarationFile !== useFile) { + if (moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator) || !ts2.outFile(compilerOptions) || isInTypeQuery(usage) || declaration.flags & 16777216) { + return true; + } + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { + return true; + } + var sourceFiles = host.getSourceFiles(); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); + } + if (declaration.pos <= usage.pos && !(ts2.isPropertyDeclaration(declaration) && ts2.isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { + if (declaration.kind === 205) { + var errorBindingElement = ts2.getAncestor( + usage, + 205 + /* SyntaxKind.BindingElement */ + ); + if (errorBindingElement) { + return ts2.findAncestor(errorBindingElement, ts2.isBindingElement) !== ts2.findAncestor(declaration, ts2.isBindingElement) || declaration.pos < errorBindingElement.pos; + } + return isBlockScopedNameDeclaredBeforeUse(ts2.getAncestor( + declaration, + 257 + /* SyntaxKind.VariableDeclaration */ + ), usage); + } else if (declaration.kind === 257) { + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } else if (ts2.isClassDeclaration(declaration)) { + return !ts2.findAncestor(usage, function(n7) { + return ts2.isComputedPropertyName(n7) && n7.parent.parent === declaration; + }); + } else if (ts2.isPropertyDeclaration(declaration)) { + return !isPropertyImmediatelyReferencedWithinDeclaration( + declaration, + usage, + /*stopAtAnyPropertyDeclaration*/ + false + ); + } else if (ts2.isParameterPropertyDeclaration(declaration, declaration.parent)) { + return !(ts2.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields && ts2.getContainingClass(declaration) === ts2.getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration)); + } + return true; + } + if (usage.parent.kind === 278 || usage.parent.kind === 274 && usage.parent.isExportEquals) { + return true; + } + if (usage.kind === 274 && usage.isExportEquals) { + return true; + } + if (!!(usage.flags & 8388608) || isInTypeQuery(usage) || usageInTypeDeclaration()) { + return true; + } + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { + if (ts2.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields && ts2.getContainingClass(declaration) && (ts2.isPropertyDeclaration(declaration) || ts2.isParameterPropertyDeclaration(declaration, declaration.parent))) { + return !isPropertyImmediatelyReferencedWithinDeclaration( + declaration, + usage, + /*stopAtAnyPropertyDeclaration*/ + true + ); + } else { + return true; + } + } + return false; + function usageInTypeDeclaration() { + return !!ts2.findAncestor(usage, function(node) { + return ts2.isInterfaceDeclaration(node) || ts2.isTypeAliasDeclaration(node); + }); + } + function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { + switch (declaration2.parent.parent.kind) { + case 240: + case 245: + case 247: + if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { + return true; + } + break; + } + var grandparent = declaration2.parent.parent; + return ts2.isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer); + } + function isUsedInFunctionOrInstanceProperty(usage2, declaration2) { + return !!ts2.findAncestor(usage2, function(current) { + if (current === declContainer) { + return "quit"; + } + if (ts2.isFunctionLike(current)) { + return true; + } + if (ts2.isClassStaticBlockDeclaration(current)) { + return declaration2.pos < usage2.pos; + } + var propertyDeclaration = ts2.tryCast(current.parent, ts2.isPropertyDeclaration); + if (propertyDeclaration) { + var initializerOfProperty = propertyDeclaration.initializer === current; + if (initializerOfProperty) { + if (ts2.isStatic(current.parent)) { + if (declaration2.kind === 171) { + return true; + } + if (ts2.isPropertyDeclaration(declaration2) && ts2.getContainingClass(usage2) === ts2.getContainingClass(declaration2)) { + var propName2 = declaration2.name; + if (ts2.isIdentifier(propName2) || ts2.isPrivateIdentifier(propName2)) { + var type3 = getTypeOfSymbol(getSymbolOfNode(declaration2)); + var staticBlocks = ts2.filter(declaration2.parent.members, ts2.isClassStaticBlockDeclaration); + if (isPropertyInitializedInStaticBlocks(propName2, type3, staticBlocks, declaration2.parent.pos, current.pos)) { + return true; + } + } + } + } else { + var isDeclarationInstanceProperty = declaration2.kind === 169 && !ts2.isStatic(declaration2); + if (!isDeclarationInstanceProperty || ts2.getContainingClass(usage2) !== ts2.getContainingClass(declaration2)) { + return true; + } + } + } + } + return false; + }); + } + function isPropertyImmediatelyReferencedWithinDeclaration(declaration2, usage2, stopAtAnyPropertyDeclaration) { + if (usage2.end > declaration2.end) { + return false; + } + var ancestorChangingReferenceScope = ts2.findAncestor(usage2, function(node) { + if (node === declaration2) { + return "quit"; + } + switch (node.kind) { + case 216: + return true; + case 169: + return stopAtAnyPropertyDeclaration && (ts2.isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || ts2.isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; + case 238: + switch (node.parent.kind) { + case 174: + case 171: + case 175: + return true; + default: + return false; + } + default: + return false; + } + }); + return ancestorChangingReferenceScope === void 0; + } + } + function useOuterVariableScopeInParameter(result2, location2, lastLocation) { + var target = ts2.getEmitScriptTarget(compilerOptions); + var functionLocation = location2; + if (ts2.isParameter(lastLocation) && functionLocation.body && result2.valueDeclaration && result2.valueDeclaration.pos >= functionLocation.body.pos && result2.valueDeclaration.end <= functionLocation.body.end) { + if (target >= 2) { + var links = getNodeLinks(functionLocation); + if (links.declarationRequiresScopeChange === void 0) { + links.declarationRequiresScopeChange = ts2.forEach(functionLocation.parameters, requiresScopeChange) || false; + } + return !links.declarationRequiresScopeChange; + } + } + return false; + function requiresScopeChange(node) { + return requiresScopeChangeWorker(node.name) || !!node.initializer && requiresScopeChangeWorker(node.initializer); + } + function requiresScopeChangeWorker(node) { + switch (node.kind) { + case 216: + case 215: + case 259: + case 173: + return false; + case 171: + case 174: + case 175: + case 299: + return requiresScopeChangeWorker(node.name); + case 169: + if (ts2.hasStaticModifier(node)) { + return target < 99 || !useDefineForClassFields; + } + return requiresScopeChangeWorker(node.name); + default: + if (ts2.isNullishCoalesce(node) || ts2.isOptionalChain(node)) { + return target < 7; + } + if (ts2.isBindingElement(node) && node.dotDotDotToken && ts2.isObjectBindingPattern(node.parent)) { + return target < 4; + } + if (ts2.isTypeNode(node)) + return false; + return ts2.forEachChild(node, requiresScopeChangeWorker) || false; + } + } + } + function isConstAssertion(location2) { + return ts2.isAssertionExpression(location2) && ts2.isConstTypeReference(location2.type) || ts2.isJSDocTypeTag(location2) && ts2.isConstTypeReference(location2.typeExpression); + } + function resolveName(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions) { + if (excludeGlobals === void 0) { + excludeGlobals = false; + } + if (getSpellingSuggestions === void 0) { + getSpellingSuggestions = true; + } + return resolveNameHelper(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol); + } + function resolveNameHelper(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { + var _a2, _b, _c; + var originalLocation = location2; + var result2; + var lastLocation; + var lastSelfReferenceLocation; + var propertyWithInvalidInitializer; + var associatedDeclarationForContainingInitializerOrBindingName; + var withinDeferredContext = false; + var errorLocation = location2; + var grandparent; + var isInExternalModule = false; + loop: + while (location2) { + if (name2 === "const" && isConstAssertion(location2)) { + return void 0; + } + if (location2.locals && !isGlobalSourceFile(location2)) { + if (result2 = lookup(location2.locals, name2, meaning)) { + var useResult = true; + if (ts2.isFunctionLike(location2) && lastLocation && lastLocation !== location2.body) { + if (meaning & result2.flags & 788968 && lastLocation.kind !== 323) { + useResult = result2.flags & 262144 ? lastLocation === location2.type || lastLocation.kind === 166 || lastLocation.kind === 343 || lastLocation.kind === 344 || lastLocation.kind === 165 : false; + } + if (meaning & result2.flags & 3) { + if (useOuterVariableScopeInParameter(result2, location2, lastLocation)) { + useResult = false; + } else if (result2.flags & 1) { + useResult = lastLocation.kind === 166 || lastLocation === location2.type && !!ts2.findAncestor(result2.valueDeclaration, ts2.isParameter); + } + } + } else if (location2.kind === 191) { + useResult = lastLocation === location2.trueType; + } + if (useResult) { + break loop; + } else { + result2 = void 0; + } + } + } + withinDeferredContext = withinDeferredContext || getIsDeferredContext(location2, lastLocation); + switch (location2.kind) { + case 308: + if (!ts2.isExternalOrCommonJsModule(location2)) + break; + isInExternalModule = true; + case 264: + var moduleExports4 = ((_a2 = getSymbolOfNode(location2)) === null || _a2 === void 0 ? void 0 : _a2.exports) || emptySymbols; + if (location2.kind === 308 || ts2.isModuleDeclaration(location2) && location2.flags & 16777216 && !ts2.isGlobalScopeAugmentation(location2)) { + if (result2 = moduleExports4.get( + "default" + /* InternalSymbolName.Default */ + )) { + var localSymbol = ts2.getLocalSymbolForExportDefault(result2); + if (localSymbol && result2.flags & meaning && localSymbol.escapedName === name2) { + break loop; + } + result2 = void 0; + } + var moduleExport = moduleExports4.get(name2); + if (moduleExport && moduleExport.flags === 2097152 && (ts2.getDeclarationOfKind( + moduleExport, + 278 + /* SyntaxKind.ExportSpecifier */ + ) || ts2.getDeclarationOfKind( + moduleExport, + 277 + /* SyntaxKind.NamespaceExport */ + ))) { + break; + } + } + if (name2 !== "default" && (result2 = lookup( + moduleExports4, + name2, + meaning & 2623475 + /* SymbolFlags.ModuleMember */ + ))) { + if (ts2.isSourceFile(location2) && location2.commonJsModuleIndicator && !((_b = result2.declarations) === null || _b === void 0 ? void 0 : _b.some(ts2.isJSDocTypeAlias))) { + result2 = void 0; + } else { + break loop; + } + } + break; + case 263: + if (result2 = lookup( + ((_c = getSymbolOfNode(location2)) === null || _c === void 0 ? void 0 : _c.exports) || emptySymbols, + name2, + meaning & 8 + /* SymbolFlags.EnumMember */ + )) { + break loop; + } + break; + case 169: + if (!ts2.isStatic(location2)) { + var ctor = findConstructorDeclaration(location2.parent); + if (ctor && ctor.locals) { + if (lookup( + ctor.locals, + name2, + meaning & 111551 + /* SymbolFlags.Value */ + )) { + ts2.Debug.assertNode(location2, ts2.isPropertyDeclaration); + propertyWithInvalidInitializer = location2; + } + } + } + break; + case 260: + case 228: + case 261: + if (result2 = lookup( + getSymbolOfNode(location2).members || emptySymbols, + name2, + meaning & 788968 + /* SymbolFlags.Type */ + )) { + if (!isTypeParameterSymbolDeclaredInContainer(result2, location2)) { + result2 = void 0; + break; + } + if (lastLocation && ts2.isStatic(lastLocation)) { + if (nameNotFoundMessage) { + error2(errorLocation, ts2.Diagnostics.Static_members_cannot_reference_class_type_parameters); + } + return void 0; + } + break loop; + } + if (location2.kind === 228 && meaning & 32) { + var className = location2.name; + if (className && name2 === className.escapedText) { + result2 = location2.symbol; + break loop; + } + } + break; + case 230: + if (lastLocation === location2.expression && location2.parent.token === 94) { + var container = location2.parent.parent; + if (ts2.isClassLike(container) && (result2 = lookup( + getSymbolOfNode(container).members, + name2, + meaning & 788968 + /* SymbolFlags.Type */ + ))) { + if (nameNotFoundMessage) { + error2(errorLocation, ts2.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return void 0; + } + } + break; + case 164: + grandparent = location2.parent.parent; + if (ts2.isClassLike(grandparent) || grandparent.kind === 261) { + if (result2 = lookup( + getSymbolOfNode(grandparent).members, + name2, + meaning & 788968 + /* SymbolFlags.Type */ + )) { + if (nameNotFoundMessage) { + error2(errorLocation, ts2.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); + } + return void 0; + } + } + break; + case 216: + if (ts2.getEmitScriptTarget(compilerOptions) >= 2) { + break; + } + case 171: + case 173: + case 174: + case 175: + case 259: + if (meaning & 3 && name2 === "arguments") { + result2 = argumentsSymbol; + break loop; + } + break; + case 215: + if (meaning & 3 && name2 === "arguments") { + result2 = argumentsSymbol; + break loop; + } + if (meaning & 16) { + var functionName = location2.name; + if (functionName && name2 === functionName.escapedText) { + result2 = location2.symbol; + break loop; + } + } + break; + case 167: + if (location2.parent && location2.parent.kind === 166) { + location2 = location2.parent; + } + if (location2.parent && (ts2.isClassElement(location2.parent) || location2.parent.kind === 260)) { + location2 = location2.parent; + } + break; + case 348: + case 341: + case 342: + var root2 = ts2.getJSDocRoot(location2); + if (root2) { + location2 = root2.parent; + } + break; + case 166: + if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && ts2.isBindingPattern(lastLocation))) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location2; + } + } + break; + case 205: + if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && ts2.isBindingPattern(lastLocation))) { + if (ts2.isParameterDeclaration(location2) && !associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location2; + } + } + break; + case 192: + if (meaning & 262144) { + var parameterName = location2.typeParameter.name; + if (parameterName && name2 === parameterName.escapedText) { + result2 = location2.typeParameter.symbol; + break loop; + } + } + break; + } + if (isSelfReferenceLocation(location2)) { + lastSelfReferenceLocation = location2; + } + lastLocation = location2; + location2 = ts2.isJSDocTemplateTag(location2) ? ts2.getEffectiveContainerForJSDocTemplateTag(location2) || location2.parent : ts2.isJSDocParameterTag(location2) || ts2.isJSDocReturnTag(location2) ? ts2.getHostSignatureFromJSDoc(location2) || location2.parent : location2.parent; + } + if (isUse && result2 && (!lastSelfReferenceLocation || result2 !== lastSelfReferenceLocation.symbol)) { + result2.isReferenced |= meaning; + } + if (!result2) { + if (lastLocation) { + ts2.Debug.assert( + lastLocation.kind === 308 + /* SyntaxKind.SourceFile */ + ); + if (lastLocation.commonJsModuleIndicator && name2 === "exports" && meaning & lastLocation.symbol.flags) { + return lastLocation.symbol; + } + } + if (!excludeGlobals) { + result2 = lookup(globals3, name2, meaning); + } + } + if (!result2) { + if (originalLocation && ts2.isInJSFile(originalLocation) && originalLocation.parent) { + if (ts2.isRequireCall( + originalLocation.parent, + /*checkArgumentIsStringLiteralLike*/ + false + )) { + return requireSymbol; + } + } + } + function checkAndReportErrorForInvalidInitializer() { + if (propertyWithInvalidInitializer && !(useDefineForClassFields && ts2.getEmitScriptTarget(compilerOptions) >= 9)) { + error2(errorLocation, errorLocation && propertyWithInvalidInitializer.type && ts2.textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? ts2.Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : ts2.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts2.declarationNameToString(propertyWithInvalidInitializer.name), diagnosticName(nameArg)); + return true; + } + return false; + } + if (!result2) { + if (nameNotFoundMessage) { + addLazyDiagnostic(function() { + if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name2, nameArg) && // TODO: GH#18217 + !checkAndReportErrorForInvalidInitializer() && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name2, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name2) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name2, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name2, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name2, meaning)) { + var suggestion = void 0; + var suggestedLib = void 0; + if (nameArg) { + suggestedLib = getSuggestedLibForNonExistentName(nameArg); + if (suggestedLib) { + error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), suggestedLib); + } + } + if (!suggestedLib && getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { + suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name2, meaning); + var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts2.isAmbientModule(suggestion.valueDeclaration) && ts2.isGlobalScopeAugmentation(suggestion.valueDeclaration); + if (isGlobalScopeAugmentationDeclaration) { + suggestion = void 0; + } + if (suggestion) { + var suggestionName = symbolToString2(suggestion); + var isUncheckedJS = isUncheckedJSSuggestion( + originalLocation, + suggestion, + /*excludeClasses*/ + false + ); + var message = meaning === 1920 || nameArg && typeof nameArg !== "string" && ts2.nodeIsSynthesized(nameArg) ? ts2.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1 : isUncheckedJS ? ts2.Diagnostics.Could_not_find_name_0_Did_you_mean_1 : ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_1; + var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName); + addErrorOrSuggestion(!isUncheckedJS, diagnostic); + if (suggestion.valueDeclaration) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(suggestion.valueDeclaration, ts2.Diagnostics._0_is_declared_here, suggestionName)); + } + } + } + if (!suggestion && !suggestedLib && nameArg) { + error2(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); + } + suggestionCount++; + } + }); + } + return void 0; + } else if (nameNotFoundMessage && checkAndReportErrorForInvalidInitializer()) { + return void 0; + } + if (nameNotFoundMessage) { + addLazyDiagnostic(function() { + if (errorLocation && (meaning & 2 || (meaning & 32 || meaning & 384) && (meaning & 111551) === 111551)) { + var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result2); + if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { + checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); + } + } + if (result2 && isInExternalModule && (meaning & 111551) === 111551 && !(originalLocation.flags & 8388608)) { + var merged = getMergedSymbol(result2); + if (ts2.length(merged.declarations) && ts2.every(merged.declarations, function(d7) { + return ts2.isNamespaceExportDeclaration(d7) || ts2.isSourceFile(d7) && !!d7.symbol.globalExports; + })) { + errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, ts2.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts2.unescapeLeadingUnderscores(name2)); + } + } + if (result2 && associatedDeclarationForContainingInitializerOrBindingName && !withinDeferredContext && (meaning & 111551) === 111551) { + var candidate = getMergedSymbol(getLateBoundSymbol(result2)); + var root3 = ts2.getRootDeclaration(associatedDeclarationForContainingInitializerOrBindingName); + if (candidate === getSymbolOfNode(associatedDeclarationForContainingInitializerOrBindingName)) { + error2(errorLocation, ts2.Diagnostics.Parameter_0_cannot_reference_itself, ts2.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name)); + } else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializerOrBindingName.pos && root3.parent.locals && lookup(root3.parent.locals, candidate.escapedName, meaning) === candidate) { + error2(errorLocation, ts2.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, ts2.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), ts2.declarationNameToString(errorLocation)); + } + } + if (result2 && errorLocation && meaning & 111551 && result2.flags & 2097152 && !(result2.flags & 111551) && !ts2.isValidTypeOnlyAliasUseSite(errorLocation)) { + var typeOnlyDeclaration = getTypeOnlyAliasDeclaration( + result2, + 111551 + /* SymbolFlags.Value */ + ); + if (typeOnlyDeclaration) { + var message = typeOnlyDeclaration.kind === 278 ? ts2.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : ts2.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + var unescapedName = ts2.unescapeLeadingUnderscores(name2); + addTypeOnlyDeclarationRelatedInfo(error2(errorLocation, message, unescapedName), typeOnlyDeclaration, unescapedName); + } + } + }); + } + return result2; + } + function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) { + if (!typeOnlyDeclaration) + return diagnostic; + return ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 278 ? ts2.Diagnostics._0_was_exported_here : ts2.Diagnostics._0_was_imported_here, unescapedName)); + } + function getIsDeferredContext(location2, lastLocation) { + if (location2.kind !== 216 && location2.kind !== 215) { + return ts2.isTypeQueryNode(location2) || (ts2.isFunctionLikeDeclaration(location2) || location2.kind === 169 && !ts2.isStatic(location2)) && (!lastLocation || lastLocation !== location2.name); + } + if (lastLocation && lastLocation === location2.name) { + return false; + } + if (location2.asteriskToken || ts2.hasSyntacticModifier( + location2, + 512 + /* ModifierFlags.Async */ + )) { + return true; + } + return !ts2.getImmediatelyInvokedFunctionExpression(location2); + } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 259: + case 260: + case 261: + case 263: + case 262: + case 264: + return true; + default: + return false; + } + } + function diagnosticName(nameArg) { + return ts2.isString(nameArg) ? ts2.unescapeLeadingUnderscores(nameArg) : ts2.declarationNameToString(nameArg); + } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (decl.kind === 165) { + var parent2 = ts2.isJSDocTemplateTag(decl.parent) ? ts2.getJSDocHost(decl.parent) : decl.parent; + if (parent2 === container) { + return !(ts2.isJSDocTemplateTag(decl.parent) && ts2.find(decl.parent.parent.tags, ts2.isJSDocTypeAlias)); + } + } + } + } + return false; + } + function checkAndReportErrorForMissingPrefix(errorLocation, name2, nameArg) { + if (!ts2.isIdentifier(errorLocation) || errorLocation.escapedText !== name2 || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { + return false; + } + var container = ts2.getThisContainer( + errorLocation, + /*includeArrowFunctions*/ + false + ); + var location2 = container; + while (location2) { + if (ts2.isClassLike(location2.parent)) { + var classSymbol = getSymbolOfNode(location2.parent); + if (!classSymbol) { + break; + } + var constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name2)) { + error2(errorLocation, ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString2(classSymbol)); + return true; + } + if (location2 === container && !ts2.isStatic(location2)) { + var instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name2)) { + error2(errorLocation, ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); + return true; + } + } + } + location2 = location2.parent; + } + return false; + } + function checkAndReportErrorForExtendingInterface(errorLocation) { + var expression = getEntityNameForExtendingInterface(errorLocation); + if (expression && resolveEntityName( + expression, + 64, + /*ignoreErrors*/ + true + )) { + error2(errorLocation, ts2.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, ts2.getTextOfNode(expression)); + return true; + } + return false; + } + function getEntityNameForExtendingInterface(node) { + switch (node.kind) { + case 79: + case 208: + return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; + case 230: + if (ts2.isEntityNameExpression(node.expression)) { + return node.expression; + } + default: + return void 0; + } + } + function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name2, meaning) { + var namespaceMeaning = 1920 | (ts2.isInJSFile(errorLocation) ? 111551 : 0); + if (meaning === namespaceMeaning) { + var symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 788968 & ~namespaceMeaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + var parent2 = errorLocation.parent; + if (symbol) { + if (ts2.isQualifiedName(parent2)) { + ts2.Debug.assert(parent2.left === errorLocation, "Should only be resolving left side of qualified name as a namespace"); + var propName2 = parent2.right.escapedText; + var propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName2); + if (propType) { + error2(parent2, ts2.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, ts2.unescapeLeadingUnderscores(name2), ts2.unescapeLeadingUnderscores(propName2)); + return true; + } + } + error2(errorLocation, ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, ts2.unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function checkAndReportErrorForUsingValueAsType(errorLocation, name2, meaning) { + if (meaning & (788968 & ~1920)) { + var symbol = resolveSymbol(resolveName( + errorLocation, + name2, + ~788968 & 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol && !(symbol.flags & 1920)) { + error2(errorLocation, ts2.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts2.unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function isPrimitiveTypeName(name2) { + return name2 === "any" || name2 === "string" || name2 === "number" || name2 === "boolean" || name2 === "never" || name2 === "unknown"; + } + function checkAndReportErrorForExportingPrimitiveType(errorLocation, name2) { + if (isPrimitiveTypeName(name2) && errorLocation.parent.kind === 278) { + error2(errorLocation, ts2.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name2); + return true; + } + return false; + } + function checkAndReportErrorForUsingTypeAsValue(errorLocation, name2, meaning) { + if (meaning & 111551) { + if (isPrimitiveTypeName(name2)) { + if (isExtendedByInterface(errorLocation)) { + error2(errorLocation, ts2.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts2.unescapeLeadingUnderscores(name2)); + } else { + error2(errorLocation, ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts2.unescapeLeadingUnderscores(name2)); + } + return true; + } + var symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 788968 & ~111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + var allFlags = symbol && getAllSymbolFlags(symbol); + if (symbol && allFlags !== void 0 && !(allFlags & 111551)) { + var rawName = ts2.unescapeLeadingUnderscores(name2); + if (isES2015OrLaterConstructorName(name2)) { + error2(errorLocation, ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); + } else if (maybeMappedType(errorLocation, symbol)) { + error2(errorLocation, ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); + } else { + error2(errorLocation, ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); + } + return true; + } + } + return false; + } + function isExtendedByInterface(node) { + var grandparent = node.parent.parent; + var parentOfGrandparent = grandparent.parent; + if (grandparent && parentOfGrandparent) { + var isExtending = ts2.isHeritageClause(grandparent) && grandparent.token === 94; + var isInterface = ts2.isInterfaceDeclaration(parentOfGrandparent); + return isExtending && isInterface; + } + return false; + } + function maybeMappedType(node, symbol) { + var container = ts2.findAncestor(node.parent, function(n7) { + return ts2.isComputedPropertyName(n7) || ts2.isPropertySignature(n7) ? false : ts2.isTypeLiteralNode(n7) || "quit"; + }); + if (container && container.members.length === 1) { + var type3 = getDeclaredTypeOfSymbol(symbol); + return !!(type3.flags & 1048576) && allTypesAssignableToKind( + type3, + 384, + /*strict*/ + true + ); + } + return false; + } + function isES2015OrLaterConstructorName(n7) { + switch (n7) { + case "Promise": + case "Symbol": + case "Map": + case "WeakMap": + case "Set": + case "WeakSet": + return true; + } + return false; + } + function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name2, meaning) { + if (meaning & (111551 & ~788968)) { + var symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 1024, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol) { + error2(errorLocation, ts2.Diagnostics.Cannot_use_namespace_0_as_a_value, ts2.unescapeLeadingUnderscores(name2)); + return true; + } + } else if (meaning & (788968 & ~111551)) { + var symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 1536, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol) { + error2(errorLocation, ts2.Diagnostics.Cannot_use_namespace_0_as_a_type, ts2.unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function checkResolvedBlockScopedVariable(result2, errorLocation) { + var _a2; + ts2.Debug.assert(!!(result2.flags & 2 || result2.flags & 32 || result2.flags & 384)); + if (result2.flags & (16 | 1 | 67108864) && result2.flags & 32) { + return; + } + var declaration = (_a2 = result2.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(function(d7) { + return ts2.isBlockOrCatchScoped(d7) || ts2.isClassLike(d7) || d7.kind === 263; + }); + if (declaration === void 0) + return ts2.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); + if (!(declaration.flags & 16777216) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + var diagnosticMessage = void 0; + var declarationName = ts2.declarationNameToString(ts2.getNameOfDeclaration(declaration)); + if (result2.flags & 2) { + diagnosticMessage = error2(errorLocation, ts2.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName); + } else if (result2.flags & 32) { + diagnosticMessage = error2(errorLocation, ts2.Diagnostics.Class_0_used_before_its_declaration, declarationName); + } else if (result2.flags & 256) { + diagnosticMessage = error2(errorLocation, ts2.Diagnostics.Enum_0_used_before_its_declaration, declarationName); + } else { + ts2.Debug.assert(!!(result2.flags & 128)); + if (ts2.shouldPreserveConstEnums(compilerOptions)) { + diagnosticMessage = error2(errorLocation, ts2.Diagnostics.Enum_0_used_before_its_declaration, declarationName); + } + } + if (diagnosticMessage) { + ts2.addRelatedInfo(diagnosticMessage, ts2.createDiagnosticForNode(declaration, ts2.Diagnostics._0_is_declared_here, declarationName)); + } + } + } + function isSameScopeDescendentOf(initial2, parent2, stopAt) { + return !!parent2 && !!ts2.findAncestor(initial2, function(n7) { + return n7 === parent2 || (n7 === stopAt || ts2.isFunctionLike(n7) && !ts2.getImmediatelyInvokedFunctionExpression(n7) ? "quit" : false); + }); + } + function getAnyImportSyntax(node) { + switch (node.kind) { + case 268: + return node; + case 270: + return node.parent; + case 271: + return node.parent.parent; + case 273: + return node.parent.parent.parent; + default: + return void 0; + } + } + function getDeclarationOfAliasSymbol(symbol) { + return symbol.declarations && ts2.findLast(symbol.declarations, isAliasSymbolDeclaration); + } + function isAliasSymbolDeclaration(node) { + return node.kind === 268 || node.kind === 267 || node.kind === 270 && !!node.name || node.kind === 271 || node.kind === 277 || node.kind === 273 || node.kind === 278 || node.kind === 274 && ts2.exportAssignmentIsAlias(node) || ts2.isBinaryExpression(node) && ts2.getAssignmentDeclarationKind(node) === 2 && ts2.exportAssignmentIsAlias(node) || ts2.isAccessExpression(node) && ts2.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63 && isAliasableOrJsExpression(node.parent.right) || node.kind === 300 || node.kind === 299 && isAliasableOrJsExpression(node.initializer) || node.kind === 257 && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 205 && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + } + function isAliasableOrJsExpression(e10) { + return ts2.isAliasableExpression(e10) || ts2.isFunctionExpression(e10) && isJSConstructor(e10); + } + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + var commonJSPropertyAccess = getCommonJSPropertyAccess(node); + if (commonJSPropertyAccess) { + var name2 = ts2.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; + return ts2.isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name2), commonJSPropertyAccess.name.escapedText)) : void 0; + } + if (ts2.isVariableDeclaration(node) || node.moduleReference.kind === 280) { + var immediate = resolveExternalModuleName(node, ts2.getExternalModuleRequireArgument(node) || ts2.getExternalModuleImportEqualsDeclarationExpression(node)); + var resolved_4 = resolveExternalModuleSymbol(immediate); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved_4, + /*overwriteEmpty*/ + false + ); + return resolved_4; + } + var resolved = getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); + checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved); + return resolved; + } + function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) { + if (markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ) && !node.isTypeOnly) { + var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node)); + var isExport = typeOnlyDeclaration.kind === 278; + var message = isExport ? ts2.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : ts2.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; + var relatedMessage = isExport ? ts2.Diagnostics._0_was_exported_here : ts2.Diagnostics._0_was_imported_here; + var name2 = ts2.unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + ts2.addRelatedInfo(error2(node.moduleReference, message), ts2.createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name2)); + } + } + function resolveExportByName(moduleSymbol, name2, sourceNode, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + var exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name2) : moduleSymbol.exports.get(name2); + var resolved = resolveSymbol(exportSymbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + sourceNode, + exportSymbol, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function isSyntacticDefault(node) { + return ts2.isExportAssignment(node) && !node.isExportEquals || ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ) || ts2.isExportSpecifier(node); + } + function getUsageModeForExpression(usage) { + return ts2.isStringLiteralLike(usage) ? ts2.getModeForUsageLocation(ts2.getSourceFileOfNode(usage), usage) : void 0; + } + function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) { + return usageMode === ts2.ModuleKind.ESNext && targetMode === ts2.ModuleKind.CommonJS; + } + function isOnlyImportedAsDefault(usage) { + var usageMode = getUsageModeForExpression(usage); + return usageMode === ts2.ModuleKind.ESNext && ts2.endsWith( + usage.text, + ".json" + /* Extension.Json */ + ); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) { + var usageMode = file && getUsageModeForExpression(usage); + if (file && usageMode !== void 0) { + var result2 = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat); + if (usageMode === ts2.ModuleKind.ESNext || result2) { + return result2; + } + } + if (!allowSyntheticDefaultImports) { + return false; + } + if (!file || file.isDeclarationFile) { + var defaultExportSymbol = resolveExportByName( + moduleSymbol, + "default", + /*sourceNode*/ + void 0, + /*dontResolveAlias*/ + true + ); + if (defaultExportSymbol && ts2.some(defaultExportSymbol.declarations, isSyntacticDefault)) { + return false; + } + if (resolveExportByName( + moduleSymbol, + ts2.escapeLeadingUnderscores("__esModule"), + /*sourceNode*/ + void 0, + dontResolveAlias + )) { + return false; + } + return true; + } + if (!ts2.isSourceFileJS(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + return typeof file.externalModuleIndicator !== "object" && !resolveExportByName( + moduleSymbol, + ts2.escapeLeadingUnderscores("__esModule"), + /*sourceNode*/ + void 0, + dontResolveAlias + ); + } + function getTargetOfImportClause(node, dontResolveAlias) { + var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); + } + } + function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) { + var _a2; + var exportDefaultSymbol; + if (ts2.isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } else { + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias); + } + var file = (_a2 = moduleSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isSourceFile); + var specifier = getModuleSpecifierForImportOrExport(node); + if (!specifier) { + return exportDefaultSymbol; + } + var hasDefaultOnly = isOnlyImportedAsDefault(specifier); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); + if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { + if (hasExportAssignmentSymbol(moduleSymbol)) { + var compilerOptionName = moduleKind >= ts2.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; + var exportEqualsSymbol = moduleSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + var exportAssignment = exportEqualsSymbol.valueDeclaration; + var err = error2(node.name, ts2.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString2(moduleSymbol), compilerOptionName); + if (exportAssignment) { + ts2.addRelatedInfo(err, ts2.createDiagnosticForNode(exportAssignment, ts2.Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, compilerOptionName)); + } + } else if (ts2.isImportClause(node)) { + reportNonDefaultExport(moduleSymbol, node); + } else { + errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, ts2.isImportOrExportSpecifier(node) && node.propertyName || node.name); + } + } else if (hasSyntheticDefault || hasDefaultOnly) { + var resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + moduleSymbol, + resolved, + /*overwriteTypeOnly*/ + false + ); + return resolved; + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + exportDefaultSymbol, + /*finalTarget*/ + void 0, + /*overwriteTypeOnly*/ + false + ); + return exportDefaultSymbol; + } + function getModuleSpecifierForImportOrExport(node) { + switch (node.kind) { + case 270: + return node.parent.moduleSpecifier; + case 268: + return ts2.isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; + case 271: + return node.parent.parent.moduleSpecifier; + case 273: + return node.parent.parent.parent.moduleSpecifier; + case 278: + return node.parent.parent.moduleSpecifier; + default: + return ts2.Debug.assertNever(node); + } + } + function reportNonDefaultExport(moduleSymbol, node) { + var _a2, _b, _c; + if ((_a2 = moduleSymbol.exports) === null || _a2 === void 0 ? void 0 : _a2.has(node.symbol.escapedName)) { + error2(node.name, ts2.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead, symbolToString2(moduleSymbol), symbolToString2(node.symbol)); + } else { + var diagnostic = error2(node.name, ts2.Diagnostics.Module_0_has_no_default_export, symbolToString2(moduleSymbol)); + var exportStar = (_b = moduleSymbol.exports) === null || _b === void 0 ? void 0 : _b.get( + "__export" + /* InternalSymbolName.ExportStar */ + ); + if (exportStar) { + var defaultExport = (_c = exportStar.declarations) === null || _c === void 0 ? void 0 : _c.find(function(decl) { + var _a3, _b2; + return !!(ts2.isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a3 = resolveExternalModuleName(decl, decl.moduleSpecifier)) === null || _a3 === void 0 ? void 0 : _a3.exports) === null || _b2 === void 0 ? void 0 : _b2.has( + "default" + /* InternalSymbolName.Default */ + ))); + }); + if (defaultExport) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(defaultExport, ts2.Diagnostics.export_Asterisk_does_not_re_export_a_default)); + } + } + } + } + function getTargetOfNamespaceImport(node, dontResolveAlias) { + var moduleSpecifier = node.parent.parent.moduleSpecifier; + var immediate = resolveExternalModuleName(node, moduleSpecifier); + var resolved = resolveESModuleSymbol( + immediate, + moduleSpecifier, + dontResolveAlias, + /*suppressUsageError*/ + false + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfNamespaceExport(node, dontResolveAlias) { + var moduleSpecifier = node.parent.moduleSpecifier; + var immediate = moduleSpecifier && resolveExternalModuleName(node, moduleSpecifier); + var resolved = moduleSpecifier && resolveESModuleSymbol( + immediate, + moduleSpecifier, + dontResolveAlias, + /*suppressUsageError*/ + false + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) { + return unknownSymbol; + } + if (valueSymbol.flags & (788968 | 1920)) { + return valueSymbol; + } + var result2 = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + result2.declarations = ts2.deduplicate(ts2.concatenate(valueSymbol.declarations, typeSymbol.declarations), ts2.equateValues); + result2.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result2.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result2.members = new ts2.Map(typeSymbol.members); + if (valueSymbol.exports) + result2.exports = new ts2.Map(valueSymbol.exports); + return result2; + } + function getExportOfModule(symbol, name2, specifier, dontResolveAlias) { + if (symbol.flags & 1536) { + var exportSymbol = getExportsOfSymbol(symbol).get(name2.escapedText); + var resolved = resolveSymbol(exportSymbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + specifier, + exportSymbol, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + } + function getPropertyOfVariable(symbol, name2) { + if (symbol.flags & 3) { + var typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name2)); + } + } + } + function getExternalModuleMember(node, specifier, dontResolveAlias) { + var _a2; + if (dontResolveAlias === void 0) { + dontResolveAlias = false; + } + var moduleSpecifier = ts2.getExternalModuleRequireArgument(node) || node.moduleSpecifier; + var moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); + var name2 = !ts2.isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; + if (!ts2.isIdentifier(name2)) { + return void 0; + } + var suppressInteropError = name2.escapedText === "default" && !!(compilerOptions.allowSyntheticDefaultImports || ts2.getESModuleInterop(compilerOptions)); + var targetSymbol = resolveESModuleSymbol( + moduleSymbol, + moduleSpecifier, + /*dontResolveAlias*/ + false, + suppressInteropError + ); + if (targetSymbol) { + if (name2.escapedText) { + if (ts2.isShorthandAmbientModuleSymbol(moduleSymbol)) { + return moduleSymbol; + } + var symbolFromVariable = void 0; + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + )) { + symbolFromVariable = getPropertyOfType( + getTypeOfSymbol(targetSymbol), + name2.escapedText, + /*skipObjectFunctionPropertyAugment*/ + true + ); + } else { + symbolFromVariable = getPropertyOfVariable(targetSymbol, name2.escapedText); + } + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + var symbolFromModule = getExportOfModule(targetSymbol, name2, specifier, dontResolveAlias); + if (symbolFromModule === void 0 && name2.escapedText === "default") { + var file = (_a2 = moduleSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isSourceFile); + if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); + } + } + var symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; + if (!symbol) { + errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name2); + } + return symbol; + } + } + } + function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name2) { + var _a2; + var moduleName3 = getFullyQualifiedName2(moduleSymbol, node); + var declarationName = ts2.declarationNameToString(name2); + var suggestion = getSuggestedSymbolForNonexistentModule(name2, targetSymbol); + if (suggestion !== void 0) { + var suggestionName = symbolToString2(suggestion); + var diagnostic = error2(name2, ts2.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName3, declarationName, suggestionName); + if (suggestion.valueDeclaration) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(suggestion.valueDeclaration, ts2.Diagnostics._0_is_declared_here, suggestionName)); + } + } else { + if ((_a2 = moduleSymbol.exports) === null || _a2 === void 0 ? void 0 : _a2.has( + "default" + /* InternalSymbolName.Default */ + )) { + error2(name2, ts2.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, moduleName3, declarationName); + } else { + reportNonExportedMember(node, name2, declarationName, moduleSymbol, moduleName3); + } + } + } + function reportNonExportedMember(node, name2, declarationName, moduleSymbol, moduleName3) { + var _a2, _b; + var localSymbol = (_b = (_a2 = moduleSymbol.valueDeclaration) === null || _a2 === void 0 ? void 0 : _a2.locals) === null || _b === void 0 ? void 0 : _b.get(name2.escapedText); + var exports29 = moduleSymbol.exports; + if (localSymbol) { + var exportedEqualsSymbol = exports29 === null || exports29 === void 0 ? void 0 : exports29.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + if (exportedEqualsSymbol) { + getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name2, declarationName, moduleName3) : error2(name2, ts2.Diagnostics.Module_0_has_no_exported_member_1, moduleName3, declarationName); + } else { + var exportedSymbol = exports29 ? ts2.find(symbolsToArray(exports29), function(symbol) { + return !!getSymbolIfSameReference(symbol, localSymbol); + }) : void 0; + var diagnostic = exportedSymbol ? error2(name2, ts2.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName3, declarationName, symbolToString2(exportedSymbol)) : error2(name2, ts2.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName3, declarationName); + if (localSymbol.declarations) { + ts2.addRelatedInfo.apply(void 0, __spreadArray9([diagnostic], ts2.map(localSymbol.declarations, function(decl, index4) { + return ts2.createDiagnosticForNode(decl, index4 === 0 ? ts2.Diagnostics._0_is_declared_here : ts2.Diagnostics.and_here, declarationName); + }), false)); + } + } + } else { + error2(name2, ts2.Diagnostics.Module_0_has_no_exported_member_1, moduleName3, declarationName); + } + } + function reportInvalidImportEqualsExportMember(node, name2, declarationName, moduleName3) { + if (moduleKind >= ts2.ModuleKind.ES2015) { + var message = ts2.getESModuleInterop(compilerOptions) ? ts2.Diagnostics._0_can_only_be_imported_by_using_a_default_import : ts2.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error2(name2, message, declarationName); + } else { + if (ts2.isInJSFile(node)) { + var message = ts2.getESModuleInterop(compilerOptions) ? ts2.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import : ts2.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error2(name2, message, declarationName); + } else { + var message = ts2.getESModuleInterop(compilerOptions) ? ts2.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import : ts2.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error2(name2, message, declarationName, declarationName, moduleName3); + } + } + } + function getTargetOfImportSpecifier(node, dontResolveAlias) { + if (ts2.isImportSpecifier(node) && ts2.idText(node.propertyName || node.name) === "default") { + var specifier = getModuleSpecifierForImportOrExport(node); + var moduleSymbol = specifier && resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); + } + } + var root2 = ts2.isBindingElement(node) ? ts2.getRootDeclaration(node) : node.parent.parent.parent; + var commonJSPropertyAccess = getCommonJSPropertyAccess(root2); + var resolved = getExternalModuleMember(root2, commonJSPropertyAccess || node, dontResolveAlias); + var name2 = node.propertyName || node.name; + if (commonJSPropertyAccess && resolved && ts2.isIdentifier(name2)) { + return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name2.escapedText), dontResolveAlias); + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getCommonJSPropertyAccess(node) { + if (ts2.isVariableDeclaration(node) && node.initializer && ts2.isPropertyAccessExpression(node.initializer)) { + return node.initializer; + } + } + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + var resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) { + if (ts2.idText(node.propertyName || node.name) === "default") { + var specifier = getModuleSpecifierForImportOrExport(node); + var moduleSymbol = specifier && resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias); + } + } + var resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : resolveEntityName( + node.propertyName || node.name, + meaning, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfExportAssignment(node, dontResolveAlias) { + var expression = ts2.isExportAssignment(node) ? node.expression : node.right; + var resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfAliasLikeExpression(expression, dontResolveAlias) { + if (ts2.isClassExpression(expression)) { + return checkExpressionCached(expression).symbol; + } + if (!ts2.isEntityName(expression) && !ts2.isEntityNameExpression(expression)) { + return void 0; + } + var aliasLike = resolveEntityName( + expression, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + true, + dontResolveAlias + ); + if (aliasLike) { + return aliasLike; + } + checkExpressionCached(expression); + return getNodeLinks(expression).resolvedSymbol; + } + function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + if (!(ts2.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 63)) { + return void 0; + } + return getTargetOfAliasLikeExpression(node.parent.right, dontRecursivelyResolve); + } + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { + if (dontRecursivelyResolve === void 0) { + dontRecursivelyResolve = false; + } + switch (node.kind) { + case 268: + case 257: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 270: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 271: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 277: + return getTargetOfNamespaceExport(node, dontRecursivelyResolve); + case 273: + case 205: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 278: + return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); + case 274: + case 223: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 267: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); + case 300: + return resolveEntityName( + node.name, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + true, + dontRecursivelyResolve + ); + case 299: + return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); + case 209: + case 208: + return getTargetOfAccessExpression(node, dontRecursivelyResolve); + default: + return ts2.Debug.fail(); + } + } + function isNonLocalAlias(symbol, excludes) { + if (excludes === void 0) { + excludes = 111551 | 788968 | 1920; + } + if (!symbol) + return false; + return (symbol.flags & (2097152 | excludes)) === 2097152 || !!(symbol.flags & 2097152 && symbol.flags & 67108864); + } + function resolveSymbol(symbol, dontResolveAlias) { + return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol; + } + function resolveAlias(symbol) { + ts2.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.aliasTarget) { + links.aliasTarget = resolvingSymbol; + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts2.Debug.fail(); + var target = getTargetOfAliasDeclaration(node); + if (links.aliasTarget === resolvingSymbol) { + links.aliasTarget = target || unknownSymbol; + } else { + error2(node, ts2.Diagnostics.Circular_definition_of_import_alias_0, symbolToString2(symbol)); + } + } else if (links.aliasTarget === resolvingSymbol) { + links.aliasTarget = unknownSymbol; + } + return links.aliasTarget; + } + function tryResolveAlias(symbol) { + var links = getSymbolLinks(symbol); + if (links.aliasTarget !== resolvingSymbol) { + return resolveAlias(symbol); + } + return void 0; + } + function getAllSymbolFlags(symbol) { + var flags = symbol.flags; + var seenSymbols; + while (symbol.flags & 2097152) { + var target = resolveAlias(symbol); + if (target === unknownSymbol) { + return 67108863; + } + if (target === symbol || (seenSymbols === null || seenSymbols === void 0 ? void 0 : seenSymbols.has(target))) { + break; + } + if (target.flags & 2097152) { + if (seenSymbols) { + seenSymbols.add(target); + } else { + seenSymbols = new ts2.Set([symbol, target]); + } + } + flags |= target.flags; + symbol = target; + } + return flags; + } + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) { + if (!aliasDeclaration || ts2.isPropertyAccessExpression(aliasDeclaration)) + return false; + var sourceSymbol = getSymbolOfNode(aliasDeclaration); + if (ts2.isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) { + var links_1 = getSymbolLinks(sourceSymbol); + links_1.typeOnlyDeclaration = aliasDeclaration; + return true; + } + var links = getSymbolLinks(sourceSymbol); + return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); + } + function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) { + var _a2, _b, _c; + if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) { + var exportSymbol = (_b = (_a2 = target.exports) === null || _a2 === void 0 ? void 0 : _a2.get( + "export=" + /* InternalSymbolName.ExportEquals */ + )) !== null && _b !== void 0 ? _b : target; + var typeOnly = exportSymbol.declarations && ts2.find(exportSymbol.declarations, ts2.isTypeOnlyImportOrExportDeclaration); + aliasDeclarationLinks.typeOnlyDeclaration = (_c = typeOnly !== null && typeOnly !== void 0 ? typeOnly : getSymbolLinks(exportSymbol).typeOnlyDeclaration) !== null && _c !== void 0 ? _c : false; + } + return !!aliasDeclarationLinks.typeOnlyDeclaration; + } + function getTypeOnlyAliasDeclaration(symbol, include) { + if (!(symbol.flags & 2097152)) { + return void 0; + } + var links = getSymbolLinks(symbol); + if (include === void 0) { + return links.typeOnlyDeclaration || void 0; + } + if (links.typeOnlyDeclaration) { + return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0; + } + return void 0; + } + function markExportAsReferenced(node) { + var symbol = getSymbolOfNode(node); + var target = resolveAlias(symbol); + if (target) { + var markAlias = target === unknownSymbol || getAllSymbolFlags(target) & 111551 && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration( + symbol, + 111551 + /* SymbolFlags.Value */ + ); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } + } + } + function markAliasSymbolAsReferenced(symbol) { + var links = getSymbolLinks(symbol); + if (!links.referenced) { + links.referenced = true; + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts2.Debug.fail(); + if (ts2.isInternalModuleImportEqualsDeclaration(node)) { + if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551) { + checkExpressionCached(node.moduleReference); + } + } + } + } + function markConstEnumAliasAsReferenced(symbol) { + var links = getSymbolLinks(symbol); + if (!links.constEnumReferenced) { + links.constEnumReferenced = true; + } + } + function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) { + if (entityName.kind === 79 && ts2.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + entityName = entityName.parent; + } + if (entityName.kind === 79 || entityName.parent.kind === 163) { + return resolveEntityName( + entityName, + 1920, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + } else { + ts2.Debug.assert( + entityName.parent.kind === 268 + /* SyntaxKind.ImportEqualsDeclaration */ + ); + return resolveEntityName( + entityName, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + } + } + function getFullyQualifiedName2(symbol, containingLocation) { + return symbol.parent ? getFullyQualifiedName2(symbol.parent, containingLocation) + "." + symbolToString2(symbol) : symbolToString2( + symbol, + containingLocation, + /*meaning*/ + void 0, + 32 | 4 + /* SymbolFormatFlags.AllowAnyNodeKind */ + ); + } + function getContainingQualifiedNameNode(node) { + while (ts2.isQualifiedName(node.parent)) { + node = node.parent; + } + return node; + } + function tryGetQualifiedNameAsValue(node) { + var left = ts2.getFirstIdentifier(node); + var symbol = resolveName( + left, + left.escapedText, + 111551, + void 0, + left, + /*isUse*/ + true + ); + if (!symbol) { + return void 0; + } + while (ts2.isQualifiedName(left.parent)) { + var type3 = getTypeOfSymbol(symbol); + symbol = getPropertyOfType(type3, left.parent.right.escapedText); + if (!symbol) { + return void 0; + } + left = left.parent; + } + return symbol; + } + function resolveEntityName(name2, meaning, ignoreErrors, dontResolveAlias, location2) { + if (ts2.nodeIsMissing(name2)) { + return void 0; + } + var namespaceMeaning = 1920 | (ts2.isInJSFile(name2) ? meaning & 111551 : 0); + var symbol; + if (name2.kind === 79) { + var message = meaning === namespaceMeaning || ts2.nodeIsSynthesized(name2) ? ts2.Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(ts2.getFirstIdentifier(name2)); + var symbolFromJSPrototype = ts2.isInJSFile(name2) && !ts2.nodeIsSynthesized(name2) ? resolveEntityNameFromAssignmentDeclaration(name2, meaning) : void 0; + symbol = getMergedSymbol(resolveName( + location2 || name2, + name2.escapedText, + meaning, + ignoreErrors || symbolFromJSPrototype ? void 0 : message, + name2, + /*isUse*/ + true, + false + )); + if (!symbol) { + return getMergedSymbol(symbolFromJSPrototype); + } + } else if (name2.kind === 163 || name2.kind === 208) { + var left = name2.kind === 163 ? name2.left : name2.expression; + var right = name2.kind === 163 ? name2.right : name2.name; + var namespace = resolveEntityName( + left, + namespaceMeaning, + ignoreErrors, + /*dontResolveAlias*/ + false, + location2 + ); + if (!namespace || ts2.nodeIsMissing(right)) { + return void 0; + } else if (namespace === unknownSymbol) { + return namespace; + } + if (namespace.valueDeclaration && ts2.isInJSFile(namespace.valueDeclaration) && ts2.isVariableDeclaration(namespace.valueDeclaration) && namespace.valueDeclaration.initializer && isCommonJsRequire(namespace.valueDeclaration.initializer)) { + var moduleName3 = namespace.valueDeclaration.initializer.arguments[0]; + var moduleSym = resolveExternalModuleName(moduleName3, moduleName3); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + namespace = resolvedModuleSymbol; + } + } + } + symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning)); + if (!symbol) { + if (!ignoreErrors) { + var namespaceName = getFullyQualifiedName2(namespace); + var declarationName = ts2.declarationNameToString(right); + var suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace); + if (suggestionForNonexistentModule) { + error2(right, ts2.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString2(suggestionForNonexistentModule)); + return void 0; + } + var containingQualifiedName = ts2.isQualifiedName(name2) && getContainingQualifiedNameNode(name2); + var canSuggestTypeof = globalObjectType && meaning & 788968 && containingQualifiedName && !ts2.isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName); + if (canSuggestTypeof) { + error2(containingQualifiedName, ts2.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts2.entityNameToString(containingQualifiedName)); + return void 0; + } + if (meaning & 1920 && ts2.isQualifiedName(name2.parent)) { + var exportedTypeSymbol = getMergedSymbol(getSymbol( + getExportsOfSymbol(namespace), + right.escapedText, + 788968 + /* SymbolFlags.Type */ + )); + if (exportedTypeSymbol) { + error2(name2.parent.right, ts2.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString2(exportedTypeSymbol), ts2.unescapeLeadingUnderscores(name2.parent.right.escapedText)); + return void 0; + } + } + error2(right, ts2.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + } + return void 0; + } + } else { + throw ts2.Debug.assertNever(name2, "Unknown entity name kind."); + } + ts2.Debug.assert((ts2.getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); + if (!ts2.nodeIsSynthesized(name2) && ts2.isEntityName(name2) && (symbol.flags & 2097152 || name2.parent.kind === 274)) { + markSymbolOfAliasDeclarationIfTypeOnly( + ts2.getAliasDeclarationFromName(name2), + symbol, + /*finalTarget*/ + void 0, + /*overwriteEmpty*/ + true + ); + } + return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol); + } + function resolveEntityNameFromAssignmentDeclaration(name2, meaning) { + if (isJSDocTypeReference(name2.parent)) { + var secondaryLocation = getAssignmentDeclarationLocation(name2.parent); + if (secondaryLocation) { + return resolveName( + secondaryLocation, + name2.escapedText, + meaning, + /*nameNotFoundMessage*/ + void 0, + name2, + /*isUse*/ + true + ); + } + } + } + function getAssignmentDeclarationLocation(node) { + var typeAlias = ts2.findAncestor(node, function(node2) { + return !(ts2.isJSDocNode(node2) || node2.flags & 8388608) ? "quit" : ts2.isJSDocTypeAlias(node2); + }); + if (typeAlias) { + return; + } + var host2 = ts2.getJSDocHost(node); + if (host2 && ts2.isExpressionStatement(host2) && ts2.isPrototypePropertyAssignment(host2.expression)) { + var symbol = getSymbolOfNode(host2.expression.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + if (host2 && ts2.isFunctionExpression(host2) && ts2.isPrototypePropertyAssignment(host2.parent) && ts2.isExpressionStatement(host2.parent.parent)) { + var symbol = getSymbolOfNode(host2.parent.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + if (host2 && (ts2.isObjectLiteralMethod(host2) || ts2.isPropertyAssignment(host2)) && ts2.isBinaryExpression(host2.parent.parent) && ts2.getAssignmentDeclarationKind(host2.parent.parent) === 6) { + var symbol = getSymbolOfNode(host2.parent.parent.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + var sig = ts2.getEffectiveJSDocHost(node); + if (sig && ts2.isFunctionLike(sig)) { + var symbol = getSymbolOfNode(sig); + return symbol && symbol.valueDeclaration; + } + } + function getDeclarationOfJSPrototypeContainer(symbol) { + var decl = symbol.parent.valueDeclaration; + if (!decl) { + return void 0; + } + var initializer = ts2.isAssignmentDeclaration(decl) ? ts2.getAssignedExpandoInitializer(decl) : ts2.hasOnlyExpressionInitializer(decl) ? ts2.getDeclaredExpandoInitializer(decl) : void 0; + return initializer || decl; + } + function getExpandoSymbol(symbol) { + var decl = symbol.valueDeclaration; + if (!decl || !ts2.isInJSFile(decl) || symbol.flags & 524288 || ts2.getExpandoInitializer( + decl, + /*isPrototypeAssignment*/ + false + )) { + return void 0; + } + var init2 = ts2.isVariableDeclaration(decl) ? ts2.getDeclaredExpandoInitializer(decl) : ts2.getAssignedExpandoInitializer(decl); + if (init2) { + var initSymbol = getSymbolOfNode(init2); + if (initSymbol) { + return mergeJSSymbols(initSymbol, symbol); + } + } + } + function resolveExternalModuleName(location2, moduleReferenceExpression, ignoreErrors) { + var isClassic = ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Classic; + var errorMessage = isClassic ? ts2.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option : ts2.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; + return resolveExternalModuleNameWorker(location2, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage); + } + function resolveExternalModuleNameWorker(location2, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { + if (isForAugmentation === void 0) { + isForAugmentation = false; + } + return ts2.isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location2, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0; + } + function resolveExternalModule(location2, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { + var _a2, _b, _c, _d, _e2, _f, _g, _h; + if (isForAugmentation === void 0) { + isForAugmentation = false; + } + if (ts2.startsWith(moduleReference, "@types/")) { + var diag = ts2.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1; + var withoutAtTypePrefix = ts2.removePrefix(moduleReference, "@types/"); + error2(errorNode, diag, withoutAtTypePrefix, moduleReference); + } + var ambientModule = tryFindAmbientModule( + moduleReference, + /*withAugmentations*/ + true + ); + if (ambientModule) { + return ambientModule; + } + var currentSourceFile = ts2.getSourceFileOfNode(location2); + var contextSpecifier = ts2.isStringLiteralLike(location2) ? location2 : ((_a2 = ts2.findAncestor(location2, ts2.isImportCall)) === null || _a2 === void 0 ? void 0 : _a2.arguments[0]) || ((_b = ts2.findAncestor(location2, ts2.isImportDeclaration)) === null || _b === void 0 ? void 0 : _b.moduleSpecifier) || ((_c = ts2.findAncestor(location2, ts2.isExternalModuleImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.moduleReference.expression) || ((_d = ts2.findAncestor(location2, ts2.isExportDeclaration)) === null || _d === void 0 ? void 0 : _d.moduleSpecifier) || ((_e2 = ts2.isModuleDeclaration(location2) ? location2 : location2.parent && ts2.isModuleDeclaration(location2.parent) && location2.parent.name === location2 ? location2.parent : void 0) === null || _e2 === void 0 ? void 0 : _e2.name) || ((_f = ts2.isLiteralImportTypeNode(location2) ? location2 : void 0) === null || _f === void 0 ? void 0 : _f.argument.literal); + var mode = contextSpecifier && ts2.isStringLiteralLike(contextSpecifier) ? ts2.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; + var resolvedModule = ts2.getResolvedModule(currentSourceFile, moduleReference, mode); + var resolutionDiagnostic = resolvedModule && ts2.getResolutionDiagnostic(compilerOptions, resolvedModule); + var sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === ts2.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName); + if (sourceFile) { + if (resolutionDiagnostic) { + error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + } + if (sourceFile.symbol) { + if (resolvedModule.isExternalLibraryImport && !ts2.resolutionExtensionIsTSOrJson(resolvedModule.extension)) { + errorOnImplicitAnyModule( + /*isError*/ + false, + errorNode, + resolvedModule, + moduleReference + ); + } + if (ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeNext) { + var isSyncImport = currentSourceFile.impliedNodeFormat === ts2.ModuleKind.CommonJS && !ts2.findAncestor(location2, ts2.isImportCall) || !!ts2.findAncestor(location2, ts2.isImportEqualsDeclaration); + var overrideClauseHost = ts2.findAncestor(location2, function(l7) { + return ts2.isImportTypeNode(l7) || ts2.isExportDeclaration(l7) || ts2.isImportDeclaration(l7); + }); + var overrideClause = overrideClauseHost && ts2.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause; + if (isSyncImport && sourceFile.impliedNodeFormat === ts2.ModuleKind.ESNext && !ts2.getResolutionModeOverrideForClause(overrideClause)) { + if (ts2.findAncestor(location2, ts2.isImportEqualsDeclaration)) { + error2(errorNode, ts2.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference); + } else { + var diagnosticDetails = void 0; + var ext = ts2.tryGetExtensionFromPath(currentSourceFile.fileName); + if (ext === ".ts" || ext === ".js" || ext === ".tsx" || ext === ".jsx") { + var scope = currentSourceFile.packageJsonScope; + var targetExt = ext === ".ts" ? ".mts" : ext === ".js" ? ".mjs" : void 0; + if (scope && !scope.contents.packageJsonContent.type) { + if (targetExt) { + diagnosticDetails = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, + targetExt, + ts2.combinePaths(scope.packageDirectory, "package.json") + ); + } else { + diagnosticDetails = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0, + ts2.combinePaths(scope.packageDirectory, "package.json") + ); + } + } else { + if (targetExt) { + diagnosticDetails = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module, + targetExt + ); + } else { + diagnosticDetails = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module + ); + } + } + } + diagnostics.add(ts2.createDiagnosticForNodeFromMessageChain(errorNode, ts2.chainDiagnosticMessages(diagnosticDetails, ts2.Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, moduleReference))); + } + } + } + return getMergedSymbol(sourceFile.symbol); + } + if (moduleNotFoundError) { + error2(errorNode, ts2.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return void 0; + } + if (patternAmbientModules) { + var pattern5 = ts2.findBestPatternMatch(patternAmbientModules, function(_6) { + return _6.pattern; + }, moduleReference); + if (pattern5) { + var augmentation = patternAmbientModuleAugmentations && patternAmbientModuleAugmentations.get(moduleReference); + if (augmentation) { + return getMergedSymbol(augmentation); + } + return getMergedSymbol(pattern5.symbol); + } + } + if (resolvedModule && !ts2.resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === ts2.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) { + if (isForAugmentation) { + var diag = ts2.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; + error2(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); + } else { + errorOnImplicitAnyModule( + /*isError*/ + noImplicitAny && !!moduleNotFoundError, + errorNode, + resolvedModule, + moduleReference + ); + } + return void 0; + } + if (moduleNotFoundError) { + if (resolvedModule) { + var redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName); + if (redirect) { + error2(errorNode, ts2.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); + return void 0; + } + } + if (resolutionDiagnostic) { + error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + } else { + var tsExtension = ts2.tryExtractTSExtension(moduleReference); + var isExtensionlessRelativePathImport = ts2.pathIsRelative(moduleReference) && !ts2.hasExtension(moduleReference); + var moduleResolutionKind = ts2.getEmitModuleResolutionKind(compilerOptions); + var resolutionIsNode16OrNext = moduleResolutionKind === ts2.ModuleResolutionKind.Node16 || moduleResolutionKind === ts2.ModuleResolutionKind.NodeNext; + if (tsExtension) { + var diag = ts2.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead; + var importSourceWithoutExtension = ts2.removeExtension(moduleReference, tsExtension); + var replacedImportSource = importSourceWithoutExtension; + if (moduleKind >= ts2.ModuleKind.ES2015) { + replacedImportSource += tsExtension === ".mts" ? ".mjs" : tsExtension === ".cts" ? ".cjs" : ".js"; + } + error2(errorNode, diag, tsExtension, replacedImportSource); + } else if (!compilerOptions.resolveJsonModule && ts2.fileExtensionIs( + moduleReference, + ".json" + /* Extension.Json */ + ) && ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.Classic && ts2.hasJsonModuleEmitEnabled(compilerOptions)) { + error2(errorNode, ts2.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); + } else if (mode === ts2.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { + var absoluteRef_1 = ts2.getNormalizedAbsolutePath(moduleReference, ts2.getDirectoryPath(currentSourceFile.path)); + var suggestedExt = (_h = suggestedExtensions.find(function(_a3) { + var actualExt = _a3[0], _importExt = _a3[1]; + return host.fileExists(absoluteRef_1 + actualExt); + })) === null || _h === void 0 ? void 0 : _h[1]; + if (suggestedExt) { + error2(errorNode, ts2.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); + } else { + error2(errorNode, ts2.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path); + } + } else { + error2(errorNode, moduleNotFoundError, moduleReference); + } + } + } + return void 0; + } + function errorOnImplicitAnyModule(isError3, errorNode, _a2, moduleReference) { + var packageId = _a2.packageId, resolvedFileName = _a2.resolvedFileName; + var errorInfo = !ts2.isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageId.name, + ts2.mangleScopedPackageName(packageId.name) + ) : packageBundlesTypes(packageId.name) ? ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageId.name, + moduleReference + ) : ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + ts2.mangleScopedPackageName(packageId.name) + ) : void 0; + errorOrSuggestion(isError3, errorNode, ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); + } + function typesPackageExists(packageName) { + return getPackagesMap().has(ts2.getTypesPackageName(packageName)); + } + function packageBundlesTypes(packageName) { + return !!getPackagesMap().get(packageName); + } + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + if (moduleSymbol === null || moduleSymbol === void 0 ? void 0 : moduleSymbol.exports) { + var exportEquals = resolveSymbol(moduleSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ), dontResolveAlias); + var exported = getCommonJsExportEquals(getMergedSymbol(exportEquals), getMergedSymbol(moduleSymbol)); + return getMergedSymbol(exported) || moduleSymbol; + } + return void 0; + } + function getCommonJsExportEquals(exported, moduleSymbol) { + if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152) { + return exported; + } + var links = getSymbolLinks(exported); + if (links.cjsExportMerged) { + return links.cjsExportMerged; + } + var merged = exported.flags & 33554432 ? exported : cloneSymbol2(exported); + merged.flags = merged.flags | 512; + if (merged.exports === void 0) { + merged.exports = ts2.createSymbolTable(); + } + moduleSymbol.exports.forEach(function(s7, name2) { + if (name2 === "export=") + return; + merged.exports.set(name2, merged.exports.has(name2) ? mergeSymbol(merged.exports.get(name2), s7) : s7); + }); + getSymbolLinks(merged).cjsExportMerged = merged; + return links.cjsExportMerged = merged; + } + function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { + var _a2; + var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol) { + if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !ts2.getDeclarationOfKind( + symbol, + 308 + /* SyntaxKind.SourceFile */ + )) { + var compilerOptionName = moduleKind >= ts2.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop"; + error2(referencingLocation, ts2.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); + return symbol; + } + var referenceParent = referencingLocation.parent; + if (ts2.isImportDeclaration(referenceParent) && ts2.getNamespaceDeclarationNode(referenceParent) || ts2.isImportCall(referenceParent)) { + var reference = ts2.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; + var type3 = getTypeOfSymbol(symbol); + var defaultOnlyType = getTypeWithSyntheticDefaultOnly(type3, symbol, moduleSymbol, reference); + if (defaultOnlyType) { + return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent); + } + var targetFile = (_a2 = moduleSymbol === null || moduleSymbol === void 0 ? void 0 : moduleSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isSourceFile); + var isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getUsageModeForExpression(reference), targetFile.impliedNodeFormat); + if (ts2.getESModuleInterop(compilerOptions) || isEsmCjsRef) { + var sigs = getSignaturesOfStructuredType( + type3, + 0 + /* SignatureKind.Call */ + ); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType( + type3, + 1 + /* SignatureKind.Construct */ + ); + } + if (sigs && sigs.length || getPropertyOfType( + type3, + "default", + /*skipObjectFunctionPropertyAugment*/ + true + ) || isEsmCjsRef) { + var moduleType = getTypeWithSyntheticDefaultImportType(type3, symbol, moduleSymbol, reference); + return cloneTypeAsModuleType(symbol, moduleType, referenceParent); + } + } + } + } + return symbol; + } + function cloneTypeAsModuleType(symbol, moduleType, referenceParent) { + var result2 = createSymbol(symbol.flags, symbol.escapedName); + result2.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result2.parent = symbol.parent; + result2.target = symbol; + result2.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result2.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result2.constEnumOnlyModule = true; + if (symbol.members) + result2.members = new ts2.Map(symbol.members); + if (symbol.exports) + result2.exports = new ts2.Map(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); + result2.type = createAnonymousType(result2, resolvedModuleType.members, ts2.emptyArray, ts2.emptyArray, resolvedModuleType.indexInfos); + return result2; + } + function hasExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ) !== void 0; + } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } + function getExportsAndPropertiesOfModule(moduleSymbol) { + var exports29 = getExportsOfModuleAsArray(moduleSymbol); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + var type3 = getTypeOfSymbol(exportEquals); + if (shouldTreatPropertiesOfExternalModuleAsExports(type3)) { + ts2.addRange(exports29, getPropertiesOfType(type3)); + } + } + return exports29; + } + function forEachExportAndPropertyOfModule(moduleSymbol, cb) { + var exports29 = getExportsOfModule(moduleSymbol); + exports29.forEach(function(symbol, key) { + if (!isReservedMemberName(key)) { + cb(symbol, key); + } + }); + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + var type3 = getTypeOfSymbol(exportEquals); + if (shouldTreatPropertiesOfExternalModuleAsExports(type3)) { + forEachPropertyOfType(type3, function(symbol, escapedName) { + cb(symbol, escapedName); + }); + } + } + } + function tryGetMemberInModuleExports(memberName, moduleSymbol) { + var symbolTable = getExportsOfModule(moduleSymbol); + if (symbolTable) { + return symbolTable.get(memberName); + } + } + function tryGetMemberInModuleExportsAndProperties(memberName, moduleSymbol) { + var symbol = tryGetMemberInModuleExports(memberName, moduleSymbol); + if (symbol) { + return symbol; + } + var exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals === moduleSymbol) { + return void 0; + } + var type3 = getTypeOfSymbol(exportEquals); + return shouldTreatPropertiesOfExternalModuleAsExports(type3) ? getPropertyOfType(type3, memberName) : void 0; + } + function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { + return !(resolvedExternalModuleType.flags & 131068 || ts2.getObjectFlags(resolvedExternalModuleType) & 1 || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); + } + function getExportsOfSymbol(symbol) { + return symbol.flags & 6256 ? getResolvedMembersOrExportsOfSymbol( + symbol, + "resolvedExports" + /* MembersOrExportsResolutionKind.resolvedExports */ + ) : symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; + } + function getExportsOfModule(moduleSymbol) { + var links = getSymbolLinks(moduleSymbol); + return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol)); + } + function extendExportSymbols(target, source, lookupTable, exportNode) { + if (!source) + return; + source.forEach(function(sourceSymbol, id) { + if (id === "default") + return; + var targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); + if (lookupTable && exportNode) { + lookupTable.set(id, { + specifierText: ts2.getTextOfNode(exportNode.moduleSpecifier) + }); + } + } else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + var collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; + } else { + collisionTracker.exportsWithDuplicate.push(exportNode); + } + } + }); + } + function getExportsOfModuleWorker(moduleSymbol) { + var visitedSymbols = []; + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + return visit7(moduleSymbol) || emptySymbols; + function visit7(symbol) { + if (!(symbol && symbol.exports && ts2.pushIfUnique(visitedSymbols, symbol))) { + return; + } + var symbols = new ts2.Map(symbol.exports); + var exportStars = symbol.exports.get( + "__export" + /* InternalSymbolName.ExportStar */ + ); + if (exportStars) { + var nestedSymbols = ts2.createSymbolTable(); + var lookupTable_1 = new ts2.Map(); + if (exportStars.declarations) { + for (var _i = 0, _a2 = exportStars.declarations; _i < _a2.length; _i++) { + var node = _a2[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + var exportedSymbols = visit7(resolvedModule); + extendExportSymbols(nestedSymbols, exportedSymbols, lookupTable_1, node); + } + } + lookupTable_1.forEach(function(_a3, id) { + var exportsWithDuplicate = _a3.exportsWithDuplicate; + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; + } + for (var _i2 = 0, exportsWithDuplicate_1 = exportsWithDuplicate; _i2 < exportsWithDuplicate_1.length; _i2++) { + var node2 = exportsWithDuplicate_1[_i2]; + diagnostics.add(ts2.createDiagnosticForNode(node2, ts2.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, lookupTable_1.get(id).specifierText, ts2.unescapeLeadingUnderscores(id))); + } + }); + extendExportSymbols(symbols, nestedSymbols); + } + return symbols; + } + } + function getMergedSymbol(symbol) { + var merged; + return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; + } + function getSymbolOfNode(node) { + return getMergedSymbol(node.symbol && getLateBoundSymbol(node.symbol)); + } + function getParentOfSymbol(symbol) { + return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); + } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + var containingFile = ts2.getSourceFileOfNode(enclosingDeclaration); + var id = getNodeId(containingFile); + var links = getSymbolLinks(symbol); + var results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + for (var _i = 0, _a2 = containingFile.imports; _i < _a2.length; _i++) { + var importRef = _a2[_i]; + if (ts2.nodeIsSynthesized(importRef)) + continue; + var resolvedModule = resolveExternalModuleName( + enclosingDeclaration, + importRef, + /*ignoreErrors*/ + true + ); + if (!resolvedModule) + continue; + var ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = ts2.append(results, resolvedModule); + } + if (ts2.length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = new ts2.Map())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + var otherFiles = host.getSourceFiles(); + for (var _b = 0, otherFiles_1 = otherFiles; _b < otherFiles_1.length; _b++) { + var file = otherFiles_1[_b]; + if (!ts2.isExternalModule(file)) + continue; + var sym = getSymbolOfNode(file); + var ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = ts2.append(results, sym); + } + return links.extendedContainers = results || ts2.emptyArray; + } + function getContainersOfSymbol(symbol, enclosingDeclaration, meaning) { + var container = getParentOfSymbol(symbol); + if (container && !(symbol.flags & 262144)) { + var additionalContainers = ts2.mapDefined(container.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + var reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); + var objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container, meaning); + if (enclosingDeclaration && container.flags & getQualifiedLeftMeaning(meaning) && getAccessibleSymbolChain( + container, + enclosingDeclaration, + 1920, + /*externalOnly*/ + false + )) { + return ts2.append(ts2.concatenate(ts2.concatenate([container], additionalContainers), reexportContainers), objectLiteralContainer); + } + var firstVariableMatch = !(container.flags & getQualifiedLeftMeaning(meaning)) && container.flags & 788968 && getDeclaredTypeOfSymbol(container).flags & 524288 && meaning === 111551 ? forEachSymbolTableInScope(enclosingDeclaration, function(t8) { + return ts2.forEachEntry(t8, function(s7) { + if (s7.flags & getQualifiedLeftMeaning(meaning) && getTypeOfSymbol(s7) === getDeclaredTypeOfSymbol(container)) { + return s7; + } + }); + }) : void 0; + var res = firstVariableMatch ? __spreadArray9(__spreadArray9([firstVariableMatch], additionalContainers, true), [container], false) : __spreadArray9(__spreadArray9([], additionalContainers, true), [container], false); + res = ts2.append(res, objectLiteralContainer); + res = ts2.addRange(res, reexportContainers); + return res; + } + var candidates = ts2.mapDefined(symbol.declarations, function(d7) { + if (!ts2.isAmbientModule(d7) && d7.parent) { + if (hasNonGlobalAugmentationExternalModuleSymbol(d7.parent)) { + return getSymbolOfNode(d7.parent); + } + if (ts2.isModuleBlock(d7.parent) && d7.parent.parent && resolveExternalModuleSymbol(getSymbolOfNode(d7.parent.parent)) === symbol) { + return getSymbolOfNode(d7.parent.parent); + } + } + if (ts2.isClassExpression(d7) && ts2.isBinaryExpression(d7.parent) && d7.parent.operatorToken.kind === 63 && ts2.isAccessExpression(d7.parent.left) && ts2.isEntityNameExpression(d7.parent.left.expression)) { + if (ts2.isModuleExportsAccessExpression(d7.parent.left) || ts2.isExportsIdentifier(d7.parent.left.expression)) { + return getSymbolOfNode(ts2.getSourceFileOfNode(d7)); + } + checkExpressionCached(d7.parent.left.expression); + return getNodeLinks(d7.parent.left.expression).resolvedSymbol; + } + }); + if (!ts2.length(candidates)) { + return void 0; + } + return ts2.mapDefined(candidates, function(candidate) { + return getAliasForSymbolInContainer(candidate, symbol) ? candidate : void 0; + }); + function fileSymbolIfFileSymbolExportEqualsContainer(d7) { + return container && getFileSymbolIfFileSymbolExportEqualsContainer(d7, container); + } + } + function getVariableDeclarationOfObjectLiteral(symbol, meaning) { + var firstDecl = !!ts2.length(symbol.declarations) && ts2.first(symbol.declarations); + if (meaning & 111551 && firstDecl && firstDecl.parent && ts2.isVariableDeclaration(firstDecl.parent)) { + if (ts2.isObjectLiteralExpression(firstDecl) && firstDecl === firstDecl.parent.initializer || ts2.isTypeLiteralNode(firstDecl) && firstDecl === firstDecl.parent.type) { + return getSymbolOfNode(firstDecl.parent); + } + } + } + function getFileSymbolIfFileSymbolExportEqualsContainer(d7, container) { + var fileSymbol = getExternalModuleContainer(d7); + var exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + return exported && getSymbolIfSameReference(exported, container) ? fileSymbol : void 0; + } + function getAliasForSymbolInContainer(container, symbol) { + if (container === getParentOfSymbol(symbol)) { + return symbol; + } + var exportEquals = container.exports && container.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) { + return container; + } + var exports29 = getExportsOfSymbol(container); + var quick = exports29.get(symbol.escapedName); + if (quick && getSymbolIfSameReference(quick, symbol)) { + return quick; + } + return ts2.forEachEntry(exports29, function(exported) { + if (getSymbolIfSameReference(exported, symbol)) { + return exported; + } + }); + } + function getSymbolIfSameReference(s1, s22) { + if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s22)))) { + return s1; + } + } + function getExportSymbolOfValueSymbolIfExported(symbol) { + return getMergedSymbol(symbol && (symbol.flags & 1048576) !== 0 && symbol.exportSymbol || symbol); + } + function symbolIsValue(symbol, includeTypeOnlyMembers) { + return !!(symbol.flags & 111551 || symbol.flags & 2097152 && getAllSymbolFlags(symbol) & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol))); + } + function findConstructorDeclaration(node) { + var members = node.members; + for (var _i = 0, members_3 = members; _i < members_3.length; _i++) { + var member = members_3[_i]; + if (member.kind === 173 && ts2.nodeIsPresent(member.body)) { + return member; + } + } + } + function createType(flags) { + var result2 = new Type3(checker, flags); + typeCount++; + result2.id = typeCount; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.recordType(result2); + return result2; + } + function createOriginType(flags) { + return new Type3(checker, flags); + } + function createIntrinsicType(kind, intrinsicName, objectFlags) { + if (objectFlags === void 0) { + objectFlags = 0; + } + var type3 = createType(kind); + type3.intrinsicName = intrinsicName; + type3.objectFlags = objectFlags; + return type3; + } + function createObjectType(objectFlags, symbol) { + var type3 = createType( + 524288 + /* TypeFlags.Object */ + ); + type3.objectFlags = objectFlags; + type3.symbol = symbol; + type3.members = void 0; + type3.properties = void 0; + type3.callSignatures = void 0; + type3.constructSignatures = void 0; + type3.indexInfos = void 0; + return type3; + } + function createTypeofType() { + return getUnionType(ts2.arrayFrom(typeofNEFacts.keys(), getStringLiteralType)); + } + function createTypeParameter(symbol) { + var type3 = createType( + 262144 + /* TypeFlags.TypeParameter */ + ); + if (symbol) + type3.symbol = symbol; + return type3; + } + function isReservedMemberName(name2) { + return name2.charCodeAt(0) === 95 && name2.charCodeAt(1) === 95 && name2.charCodeAt(2) !== 95 && name2.charCodeAt(2) !== 64 && name2.charCodeAt(2) !== 35; + } + function getNamedMembers(members) { + var result2; + members.forEach(function(symbol, id) { + if (isNamedMember(symbol, id)) { + (result2 || (result2 = [])).push(symbol); + } + }); + return result2 || ts2.emptyArray; + } + function isNamedMember(member, escapedName) { + return !isReservedMemberName(escapedName) && symbolIsValue(member); + } + function getNamedOrIndexSignatureMembers(members) { + var result2 = getNamedMembers(members); + var index4 = getIndexSymbolFromSymbolTable(members); + return index4 ? ts2.concatenate(result2, [index4]) : result2; + } + function setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos) { + var resolved = type3; + resolved.members = members; + resolved.properties = ts2.emptyArray; + resolved.callSignatures = callSignatures; + resolved.constructSignatures = constructSignatures; + resolved.indexInfos = indexInfos; + if (members !== emptySymbols) + resolved.properties = getNamedMembers(members); + return resolved; + } + function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) { + return setStructuredTypeMembers(createObjectType(16, symbol), members, callSignatures, constructSignatures, indexInfos); + } + function getResolvedTypeWithoutAbstractConstructSignatures(type3) { + if (type3.constructSignatures.length === 0) + return type3; + if (type3.objectTypeWithoutAbstractConstructSignatures) + return type3.objectTypeWithoutAbstractConstructSignatures; + var constructSignatures = ts2.filter(type3.constructSignatures, function(signature) { + return !(signature.flags & 4); + }); + if (type3.constructSignatures === constructSignatures) + return type3; + var typeCopy = createAnonymousType(type3.symbol, type3.members, type3.callSignatures, ts2.some(constructSignatures) ? constructSignatures : ts2.emptyArray, type3.indexInfos); + type3.objectTypeWithoutAbstractConstructSignatures = typeCopy; + typeCopy.objectTypeWithoutAbstractConstructSignatures = typeCopy; + return typeCopy; + } + function forEachSymbolTableInScope(enclosingDeclaration, callback) { + var result2; + var _loop_8 = function(location3) { + if (location3.locals && !isGlobalSourceFile(location3)) { + if (result2 = callback( + location3.locals, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true, + location3 + )) { + return { value: result2 }; + } + } + switch (location3.kind) { + case 308: + if (!ts2.isExternalOrCommonJsModule(location3)) { + break; + } + case 264: + var sym = getSymbolOfNode(location3); + if (result2 = callback( + (sym === null || sym === void 0 ? void 0 : sym.exports) || emptySymbols, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true, + location3 + )) { + return { value: result2 }; + } + break; + case 260: + case 228: + case 261: + var table_1; + (getSymbolOfNode(location3).members || emptySymbols).forEach(function(memberSymbol, key) { + if (memberSymbol.flags & (788968 & ~67108864)) { + (table_1 || (table_1 = ts2.createSymbolTable())).set(key, memberSymbol); + } + }); + if (table_1 && (result2 = callback( + table_1, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + false, + location3 + ))) { + return { value: result2 }; + } + break; + } + }; + for (var location2 = enclosingDeclaration; location2; location2 = location2.parent) { + var state_2 = _loop_8(location2); + if (typeof state_2 === "object") + return state_2.value; + } + return callback( + globals3, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true + ); + } + function getQualifiedLeftMeaning(rightMeaning) { + return rightMeaning === 111551 ? 111551 : 1920; + } + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap) { + if (visitedSymbolTablesMap === void 0) { + visitedSymbolTablesMap = new ts2.Map(); + } + if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { + return void 0; + } + var links = getSymbolLinks(symbol); + var cache = links.accessibleChainCache || (links.accessibleChainCache = new ts2.Map()); + var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function(_6, __, ___, node) { + return node; + }); + var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning); + if (cache.has(key)) { + return cache.get(key); + } + var id = getSymbolId(symbol); + var visitedSymbolTables = visitedSymbolTablesMap.get(id); + if (!visitedSymbolTables) { + visitedSymbolTablesMap.set(id, visitedSymbolTables = []); + } + var result2 = forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); + cache.set(key, result2); + return result2; + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification, isLocalNameLookup) { + if (!ts2.pushIfUnique(visitedSymbolTables, symbols)) { + return void 0; + } + var result3 = trySymbolTable(symbols, ignoreQualification, isLocalNameLookup); + visitedSymbolTables.pop(); + return result3; + } + function canQualifySymbol(symbolFromSymbolTable, meaning2) { + return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning2) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too + !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning2), useOnlyExternalAliasing, visitedSymbolTablesMap); + } + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { + return (symbol === (resolvedAliasSymbol || symbolFromSymbolTable) || getMergedSymbol(symbol) === getMergedSymbol(resolvedAliasSymbol || symbolFromSymbolTable)) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) + // and if symbolFromSymbolTable or alias resolution matches the symbol, + // check the symbol can be qualified, it is only then this symbol is accessible + !ts2.some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) && (ignoreQualification || canQualifySymbol(getMergedSymbol(symbolFromSymbolTable), meaning)); + } + function trySymbolTable(symbols, ignoreQualification, isLocalNameLookup) { + if (isAccessible( + symbols.get(symbol.escapedName), + /*resolvedAliasSymbol*/ + void 0, + ignoreQualification + )) { + return [symbol]; + } + var result3 = ts2.forEachEntry(symbols, function(symbolFromSymbolTable) { + if (symbolFromSymbolTable.flags & 2097152 && symbolFromSymbolTable.escapedName !== "export=" && symbolFromSymbolTable.escapedName !== "default" && !(ts2.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts2.isExternalModule(ts2.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts2.some(symbolFromSymbolTable.declarations, ts2.isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !ts2.some(symbolFromSymbolTable.declarations, ts2.isNamespaceReexportDeclaration) : true) && (ignoreQualification || !ts2.getDeclarationOfKind( + symbolFromSymbolTable, + 278 + /* SyntaxKind.ExportSpecifier */ + ))) { + var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + var candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); + if (candidate) { + return candidate; + } + } + if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) { + if (isAccessible( + getMergedSymbol(symbolFromSymbolTable.exportSymbol), + /*aliasSymbol*/ + void 0, + ignoreQualification + )) { + return [symbol]; + } + } + }); + return result3 || (symbols === globals3 ? getCandidateListForSymbol(globalThisSymbol, globalThisSymbol, ignoreQualification) : void 0); + } + function getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { + return [symbolFromSymbolTable]; + } + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable( + candidateTable, + /*ignoreQualification*/ + true + ); + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } + } + } + function needsQualification(symbol, enclosingDeclaration, meaning) { + var qualify = false; + forEachSymbolTableInScope(enclosingDeclaration, function(symbolTable) { + var symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName)); + if (!symbolFromSymbolTable) { + return false; + } + if (symbolFromSymbolTable === symbol) { + return true; + } + var shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 && !ts2.getDeclarationOfKind( + symbolFromSymbolTable, + 278 + /* SyntaxKind.ExportSpecifier */ + ); + symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + var flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; + if (flags & meaning) { + qualify = true; + return true; + } + return false; + }); + return qualify; + } + function isPropertyOrMethodDeclarationSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + switch (declaration.kind) { + case 169: + case 171: + case 174: + case 175: + continue; + default: + return false; + } + } + return true; + } + return false; + } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + 788968, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + true + ); + return access2.accessibility === 0; + } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + 111551, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + true + ); + return access2.accessibility === 0; + } + function isSymbolAccessibleByFlags(typeSymbol, enclosingDeclaration, flags) { + var access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + flags, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + false + ); + return access2.accessibility === 0; + } + function isAnySymbolAccessible(symbols, enclosingDeclaration, initialSymbol, meaning, shouldComputeAliasesToMakeVisible, allowModules) { + if (!ts2.length(symbols)) + return; + var hadAccessibleChain; + var earlyModuleBail = false; + for (var _i = 0, _a2 = symbols; _i < _a2.length; _i++) { + var symbol = _a2[_i]; + var accessibleSymbolChain = getAccessibleSymbolChain( + symbol, + enclosingDeclaration, + meaning, + /*useOnlyExternalAliasing*/ + false + ); + if (accessibleSymbolChain) { + hadAccessibleChain = symbol; + var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible); + if (hasAccessibleDeclarations) { + return hasAccessibleDeclarations; + } + } + if (allowModules) { + if (ts2.some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + if (shouldComputeAliasesToMakeVisible) { + earlyModuleBail = true; + continue; + } + return { + accessibility: 0 + /* SymbolAccessibility.Accessible */ + }; + } + } + var containers = getContainersOfSymbol(symbol, enclosingDeclaration, meaning); + var parentResult = isAnySymbolAccessible(containers, enclosingDeclaration, initialSymbol, initialSymbol === symbol ? getQualifiedLeftMeaning(meaning) : meaning, shouldComputeAliasesToMakeVisible, allowModules); + if (parentResult) { + return parentResult; + } + } + if (earlyModuleBail) { + return { + accessibility: 0 + /* SymbolAccessibility.Accessible */ + }; + } + if (hadAccessibleChain) { + return { + accessibility: 1, + errorSymbolName: symbolToString2(initialSymbol, enclosingDeclaration, meaning), + errorModuleName: hadAccessibleChain !== initialSymbol ? symbolToString2( + hadAccessibleChain, + enclosingDeclaration, + 1920 + /* SymbolFlags.Namespace */ + ) : void 0 + }; + } + } + function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { + return isSymbolAccessibleWorker( + symbol, + enclosingDeclaration, + meaning, + shouldComputeAliasesToMakeVisible, + /*allowModules*/ + true + ); + } + function isSymbolAccessibleWorker(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible, allowModules) { + if (symbol && enclosingDeclaration) { + var result2 = isAnySymbolAccessible([symbol], enclosingDeclaration, symbol, meaning, shouldComputeAliasesToMakeVisible, allowModules); + if (result2) { + return result2; + } + var symbolExternalModule = ts2.forEach(symbol.declarations, getExternalModuleContainer); + if (symbolExternalModule) { + var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); + if (symbolExternalModule !== enclosingExternalModule) { + return { + accessibility: 2, + errorSymbolName: symbolToString2(symbol, enclosingDeclaration, meaning), + errorModuleName: symbolToString2(symbolExternalModule), + errorNode: ts2.isInJSFile(enclosingDeclaration) ? enclosingDeclaration : void 0 + }; + } + } + return { + accessibility: 1, + errorSymbolName: symbolToString2(symbol, enclosingDeclaration, meaning) + }; + } + return { + accessibility: 0 + /* SymbolAccessibility.Accessible */ + }; + } + function getExternalModuleContainer(declaration) { + var node = ts2.findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfNode(node); + } + function hasExternalModuleSymbol(declaration) { + return ts2.isAmbientModule(declaration) || declaration.kind === 308 && ts2.isExternalOrCommonJsModule(declaration); + } + function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { + return ts2.isModuleWithStringLiteralName(declaration) || declaration.kind === 308 && ts2.isExternalOrCommonJsModule(declaration); + } + function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { + var aliasesToMakeVisible; + if (!ts2.every(ts2.filter(symbol.declarations, function(d7) { + return d7.kind !== 79; + }), getIsDeclarationVisible)) { + return void 0; + } + return { accessibility: 0, aliasesToMakeVisible }; + function getIsDeclarationVisible(declaration) { + var _a2, _b; + if (!isDeclarationVisible(declaration)) { + var anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && !ts2.hasSyntacticModifier( + anyImportSyntax, + 1 + /* ModifierFlags.Export */ + ) && // import clause without export + isDeclarationVisible(anyImportSyntax.parent)) { + return addVisibleAlias(declaration, anyImportSyntax); + } else if (ts2.isVariableDeclaration(declaration) && ts2.isVariableStatement(declaration.parent.parent) && !ts2.hasSyntacticModifier( + declaration.parent.parent, + 1 + /* ModifierFlags.Export */ + ) && // unexported variable statement + isDeclarationVisible(declaration.parent.parent.parent)) { + return addVisibleAlias(declaration, declaration.parent.parent); + } else if (ts2.isLateVisibilityPaintedStatement(declaration) && !ts2.hasSyntacticModifier( + declaration, + 1 + /* ModifierFlags.Export */ + ) && isDeclarationVisible(declaration.parent)) { + return addVisibleAlias(declaration, declaration); + } else if (ts2.isBindingElement(declaration)) { + if (symbol.flags & 2097152 && ts2.isInJSFile(declaration) && ((_a2 = declaration.parent) === null || _a2 === void 0 ? void 0 : _a2.parent) && ts2.isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) === null || _b === void 0 ? void 0 : _b.parent) && ts2.isVariableStatement(declaration.parent.parent.parent.parent) && !ts2.hasSyntacticModifier( + declaration.parent.parent.parent.parent, + 1 + /* ModifierFlags.Export */ + ) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { + return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); + } else if (symbol.flags & 2) { + var variableStatement = ts2.findAncestor(declaration, ts2.isVariableStatement); + if (ts2.hasSyntacticModifier( + variableStatement, + 1 + /* ModifierFlags.Export */ + )) { + return true; + } + if (!isDeclarationVisible(variableStatement.parent)) { + return false; + } + return addVisibleAlias(declaration, variableStatement); + } + } + return false; + } + return true; + } + function addVisibleAlias(declaration, aliasingStatement) { + if (shouldComputeAliasToMakeVisible) { + getNodeLinks(declaration).isVisible = true; + aliasesToMakeVisible = ts2.appendIfUnique(aliasesToMakeVisible, aliasingStatement); + } + return true; + } + } + function isEntityNameVisible(entityName, enclosingDeclaration) { + var meaning; + if (entityName.parent.kind === 183 || entityName.parent.kind === 230 && !ts2.isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 164) { + meaning = 111551 | 1048576; + } else if (entityName.kind === 163 || entityName.kind === 208 || entityName.parent.kind === 268) { + meaning = 1920; + } else { + meaning = 788968; + } + var firstIdentifier = ts2.getFirstIdentifier(entityName); + var symbol = resolveName( + enclosingDeclaration, + firstIdentifier.escapedText, + meaning, + /*nodeNotFoundErrorMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + if (symbol && symbol.flags & 262144 && meaning & 788968) { + return { + accessibility: 0 + /* SymbolAccessibility.Accessible */ + }; + } + if (!symbol && ts2.isThisIdentifier(firstIdentifier) && isSymbolAccessible( + getSymbolOfNode(ts2.getThisContainer( + firstIdentifier, + /*includeArrowFunctions*/ + false + )), + firstIdentifier, + meaning, + /*computeAliases*/ + false + ).accessibility === 0) { + return { + accessibility: 0 + /* SymbolAccessibility.Accessible */ + }; + } + return symbol && hasVisibleDeclarations( + symbol, + /*shouldComputeAliasToMakeVisible*/ + true + ) || { + accessibility: 1, + errorSymbolName: ts2.getTextOfNode(firstIdentifier), + errorNode: firstIdentifier + }; + } + function symbolToString2(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { + flags = 4; + } + var nodeFlags = 70221824; + if (flags & 2) { + nodeFlags |= 128; + } + if (flags & 1) { + nodeFlags |= 512; + } + if (flags & 8) { + nodeFlags |= 16384; + } + if (flags & 32) { + nodeFlags |= 134217728; + } + if (flags & 16) { + nodeFlags |= 1073741824; + } + var builder = flags & 4 ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts2.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer2) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = (enclosingDeclaration === null || enclosingDeclaration === void 0 ? void 0 : enclosingDeclaration.kind) === 308 ? ts2.createPrinter({ removeComments: true, neverAsciiEscape: true }) : ts2.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts2.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + entity, + /*sourceFile*/ + sourceFile, + writer2 + ); + return writer2; + } + } + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + if (flags === void 0) { + flags = 0; + } + return writer ? signatureToStringWorker(writer).getText() : ts2.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer2) { + var sigOutput; + if (flags & 262144) { + sigOutput = kind === 1 ? 182 : 181; + } else { + sigOutput = kind === 1 ? 177 : 176; + } + var sig = nodeBuilder.signatureToSignatureDeclaration( + signature, + sigOutput, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 | 512 + /* NodeBuilderFlags.WriteTypeParametersInQualifiedName */ + ); + var printer = ts2.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts2.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + sig, + /*sourceFile*/ + sourceFile, + ts2.getTrailingSemicolonDeferringWriter(writer2) + ); + return writer2; + } + } + function typeToString(type3, enclosingDeclaration, flags, writer) { + if (flags === void 0) { + flags = 1048576 | 16384; + } + if (writer === void 0) { + writer = ts2.createTextWriter(""); + } + var noTruncation = compilerOptions.noErrorTruncation || flags & 1; + var typeNode = nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | (noTruncation ? 1 : 0), writer); + if (typeNode === void 0) + return ts2.Debug.fail("should always get typenode"); + var options = { removeComments: type3 !== unresolvedType }; + var printer = ts2.createPrinter(options); + var sourceFile = enclosingDeclaration && ts2.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + typeNode, + /*sourceFile*/ + sourceFile, + writer + ); + var result2 = writer.getText(); + var maxLength = noTruncation ? ts2.noTruncationMaximumTruncationLength * 2 : ts2.defaultMaximumTruncationLength * 2; + if (maxLength && result2 && result2.length >= maxLength) { + return result2.substr(0, maxLength - "...".length) + "..."; + } + return result2; + } + function getTypeNamesForErrorDisplay(left, right) { + var leftStr = symbolValueDeclarationIsContextSensitive(left.symbol) ? typeToString(left, left.symbol.valueDeclaration) : typeToString(left); + var rightStr = symbolValueDeclarationIsContextSensitive(right.symbol) ? typeToString(right, right.symbol.valueDeclaration) : typeToString(right); + if (leftStr === rightStr) { + leftStr = getTypeNameForErrorDisplay(left); + rightStr = getTypeNameForErrorDisplay(right); + } + return [leftStr, rightStr]; + } + function getTypeNameForErrorDisplay(type3) { + return typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 64 + /* TypeFormatFlags.UseFullyQualifiedType */ + ); + } + function symbolValueDeclarationIsContextSensitive(symbol) { + return symbol && !!symbol.valueDeclaration && ts2.isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration); + } + function toNodeBuilderFlags(flags) { + if (flags === void 0) { + flags = 0; + } + return flags & 848330091; + } + function isClassInstanceSide(type3) { + return !!type3.symbol && !!(type3.symbol.flags & 32) && (type3 === getDeclaredTypeOfClassOrInterface(type3.symbol) || !!(type3.flags & 524288) && !!(ts2.getObjectFlags(type3) & 16777216)); + } + function createNodeBuilder() { + return { + typeToTypeNode: function(type3, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return typeToTypeNodeHelper(type3, context2); + }); + }, + indexInfoToIndexSignatureDeclaration: function(indexInfo, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return indexInfoToIndexSignatureDeclarationHelper( + indexInfo, + context2, + /*typeNode*/ + void 0 + ); + }); + }, + signatureToSignatureDeclaration: function(signature, kind, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return signatureToSignatureDeclarationHelper(signature, kind, context2); + }); + }, + symbolToEntityName: function(symbol, meaning, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return symbolToName( + symbol, + context2, + meaning, + /*expectsIdentifier*/ + false + ); + }); + }, + symbolToExpression: function(symbol, meaning, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return symbolToExpression(symbol, context2, meaning); + }); + }, + symbolToTypeParameterDeclarations: function(symbol, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return typeParametersToTypeParameterDeclarations(symbol, context2); + }); + }, + symbolToParameterDeclaration: function(symbol, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return symbolToParameterDeclaration(symbol, context2); + }); + }, + typeParameterToDeclaration: function(parameter, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return typeParameterToDeclaration(parameter, context2); + }); + }, + symbolTableToDeclarationStatements: function(symbolTable, enclosingDeclaration, flags, tracker, bundled) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return symbolTableToDeclarationStatements(symbolTable, context2, bundled); + }); + }, + symbolToNode: function(symbol, meaning, enclosingDeclaration, flags, tracker) { + return withContext(enclosingDeclaration, flags, tracker, function(context2) { + return symbolToNode(symbol, context2, meaning); + }); + } + }; + function symbolToNode(symbol, context2, meaning) { + if (context2.flags & 1073741824) { + if (symbol.valueDeclaration) { + var name2 = ts2.getNameOfDeclaration(symbol.valueDeclaration); + if (name2 && ts2.isComputedPropertyName(name2)) + return name2; + } + var nameType = getSymbolLinks(symbol).nameType; + if (nameType && nameType.flags & (1024 | 8192)) { + context2.enclosingDeclaration = nameType.symbol.valueDeclaration; + return ts2.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context2, meaning)); + } + } + return symbolToExpression(symbol, context2, meaning); + } + function withContext(enclosingDeclaration, flags, tracker, cb) { + var _a2, _b; + ts2.Debug.assert(enclosingDeclaration === void 0 || (enclosingDeclaration.flags & 8) === 0); + var context2 = { + enclosingDeclaration, + flags: flags || 0, + // If no full tracker is provided, fake up a dummy one with a basic limited-functionality moduleResolverHost + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: function() { + return false; + }, moduleResolverHost: flags & 134217728 ? { + getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function() { + return host.getCommonSourceDirectory(); + } : function() { + return ""; + }, + getCurrentDirectory: function() { + return host.getCurrentDirectory(); + }, + getSymlinkCache: ts2.maybeBind(host, host.getSymlinkCache), + getPackageJsonInfoCache: function() { + var _a3; + return (_a3 = host.getPackageJsonInfoCache) === null || _a3 === void 0 ? void 0 : _a3.call(host); + }, + useCaseSensitiveFileNames: ts2.maybeBind(host, host.useCaseSensitiveFileNames), + redirectTargetsMap: host.redirectTargetsMap, + getProjectReferenceRedirect: function(fileName) { + return host.getProjectReferenceRedirect(fileName); + }, + isSourceOfProjectReferenceRedirect: function(fileName) { + return host.isSourceOfProjectReferenceRedirect(fileName); + }, + fileExists: function(fileName) { + return host.fileExists(fileName); + }, + getFileIncludeReasons: function() { + return host.getFileIncludeReasons(); + }, + readFile: host.readFile ? function(fileName) { + return host.readFile(fileName); + } : void 0 + } : void 0 }, + encounteredError: false, + reportedDiagnostic: false, + visitedTypes: void 0, + symbolDepth: void 0, + inferTypeParameters: void 0, + approximateLength: 0 + }; + context2.tracker = wrapSymbolTrackerToReportForContext(context2, context2.tracker); + var resultingNode = cb(context2); + if (context2.truncating && context2.flags & 1) { + (_b = (_a2 = context2.tracker) === null || _a2 === void 0 ? void 0 : _a2.reportTruncationError) === null || _b === void 0 ? void 0 : _b.call(_a2); + } + return context2.encounteredError ? void 0 : resultingNode; + } + function wrapSymbolTrackerToReportForContext(context2, tracker) { + var oldTrackSymbol = tracker.trackSymbol; + return __assign16(__assign16({}, tracker), { reportCyclicStructureError: wrapReportedDiagnostic(tracker.reportCyclicStructureError), reportInaccessibleThisError: wrapReportedDiagnostic(tracker.reportInaccessibleThisError), reportInaccessibleUniqueSymbolError: wrapReportedDiagnostic(tracker.reportInaccessibleUniqueSymbolError), reportLikelyUnsafeImportRequiredError: wrapReportedDiagnostic(tracker.reportLikelyUnsafeImportRequiredError), reportNonlocalAugmentation: wrapReportedDiagnostic(tracker.reportNonlocalAugmentation), reportPrivateInBaseOfClassExpression: wrapReportedDiagnostic(tracker.reportPrivateInBaseOfClassExpression), reportNonSerializableProperty: wrapReportedDiagnostic(tracker.reportNonSerializableProperty), trackSymbol: oldTrackSymbol && function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var result2 = oldTrackSymbol.apply(void 0, args); + if (result2) { + context2.reportedDiagnostic = true; + } + return result2; + } }); + function wrapReportedDiagnostic(method2) { + if (!method2) { + return method2; + } + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + context2.reportedDiagnostic = true; + return method2.apply(void 0, args); + }; + } + } + function checkTruncationLength(context2) { + if (context2.truncating) + return context2.truncating; + return context2.truncating = context2.approximateLength > (context2.flags & 1 ? ts2.noTruncationMaximumTruncationLength : ts2.defaultMaximumTruncationLength); + } + function typeToTypeNodeHelper(type3, context2) { + var savedFlags = context2.flags; + var typeNode = typeToTypeNodeWorker(type3, context2); + context2.flags = savedFlags; + return typeNode; + } + function typeToTypeNodeWorker(type3, context2) { + if (cancellationToken && cancellationToken.throwIfCancellationRequested) { + cancellationToken.throwIfCancellationRequested(); + } + var inTypeAlias = context2.flags & 8388608; + context2.flags &= ~8388608; + if (!type3) { + if (!(context2.flags & 262144)) { + context2.encounteredError = true; + return void 0; + } + context2.approximateLength += 3; + return ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + if (!(context2.flags & 536870912)) { + type3 = getReducedType(type3); + } + if (type3.flags & 1) { + if (type3.aliasSymbol) { + return ts2.factory.createTypeReferenceNode(symbolToEntityNameNode(type3.aliasSymbol), mapToTypeNodes(type3.aliasTypeArguments, context2)); + } + if (type3 === unresolvedType) { + return ts2.addSyntheticLeadingComment(ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ), 3, "unresolved"); + } + context2.approximateLength += 3; + return ts2.factory.createKeywordTypeNode( + type3 === intrinsicMarkerType ? 139 : 131 + /* SyntaxKind.AnyKeyword */ + ); + } + if (type3.flags & 2) { + return ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + ); + } + if (type3.flags & 4) { + context2.approximateLength += 6; + return ts2.factory.createKeywordTypeNode( + 152 + /* SyntaxKind.StringKeyword */ + ); + } + if (type3.flags & 8) { + context2.approximateLength += 6; + return ts2.factory.createKeywordTypeNode( + 148 + /* SyntaxKind.NumberKeyword */ + ); + } + if (type3.flags & 64) { + context2.approximateLength += 6; + return ts2.factory.createKeywordTypeNode( + 160 + /* SyntaxKind.BigIntKeyword */ + ); + } + if (type3.flags & 16 && !type3.aliasSymbol) { + context2.approximateLength += 7; + return ts2.factory.createKeywordTypeNode( + 134 + /* SyntaxKind.BooleanKeyword */ + ); + } + if (type3.flags & 1024 && !(type3.flags & 1048576)) { + var parentSymbol = getParentOfSymbol(type3.symbol); + var parentName = symbolToTypeNode( + parentSymbol, + context2, + 788968 + /* SymbolFlags.Type */ + ); + if (getDeclaredTypeOfSymbol(parentSymbol) === type3) { + return parentName; + } + var memberName = ts2.symbolName(type3.symbol); + if (ts2.isIdentifierText( + memberName, + 0 + /* ScriptTarget.ES3 */ + )) { + return appendReferenceToType(parentName, ts2.factory.createTypeReferenceNode( + memberName, + /*typeArguments*/ + void 0 + )); + } + if (ts2.isImportTypeNode(parentName)) { + parentName.isTypeOf = true; + return ts2.factory.createIndexedAccessTypeNode(parentName, ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(memberName))); + } else if (ts2.isTypeReferenceNode(parentName)) { + return ts2.factory.createIndexedAccessTypeNode(ts2.factory.createTypeQueryNode(parentName.typeName), ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(memberName))); + } else { + return ts2.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); + } + } + if (type3.flags & 1056) { + return symbolToTypeNode( + type3.symbol, + context2, + 788968 + /* SymbolFlags.Type */ + ); + } + if (type3.flags & 128) { + context2.approximateLength += type3.value.length + 2; + return ts2.factory.createLiteralTypeNode(ts2.setEmitFlags( + ts2.factory.createStringLiteral(type3.value, !!(context2.flags & 268435456)), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + )); + } + if (type3.flags & 256) { + var value2 = type3.value; + context2.approximateLength += ("" + value2).length; + return ts2.factory.createLiteralTypeNode(value2 < 0 ? ts2.factory.createPrefixUnaryExpression(40, ts2.factory.createNumericLiteral(-value2)) : ts2.factory.createNumericLiteral(value2)); + } + if (type3.flags & 2048) { + context2.approximateLength += ts2.pseudoBigIntToString(type3.value).length + 1; + return ts2.factory.createLiteralTypeNode(ts2.factory.createBigIntLiteral(type3.value)); + } + if (type3.flags & 512) { + context2.approximateLength += type3.intrinsicName.length; + return ts2.factory.createLiteralTypeNode(type3.intrinsicName === "true" ? ts2.factory.createTrue() : ts2.factory.createFalse()); + } + if (type3.flags & 8192) { + if (!(context2.flags & 1048576)) { + if (isValueSymbolAccessible(type3.symbol, context2.enclosingDeclaration)) { + context2.approximateLength += 6; + return symbolToTypeNode( + type3.symbol, + context2, + 111551 + /* SymbolFlags.Value */ + ); + } + if (context2.tracker.reportInaccessibleUniqueSymbolError) { + context2.tracker.reportInaccessibleUniqueSymbolError(); + } + } + context2.approximateLength += 13; + return ts2.factory.createTypeOperatorNode(156, ts2.factory.createKeywordTypeNode( + 153 + /* SyntaxKind.SymbolKeyword */ + )); + } + if (type3.flags & 16384) { + context2.approximateLength += 4; + return ts2.factory.createKeywordTypeNode( + 114 + /* SyntaxKind.VoidKeyword */ + ); + } + if (type3.flags & 32768) { + context2.approximateLength += 9; + return ts2.factory.createKeywordTypeNode( + 155 + /* SyntaxKind.UndefinedKeyword */ + ); + } + if (type3.flags & 65536) { + context2.approximateLength += 4; + return ts2.factory.createLiteralTypeNode(ts2.factory.createNull()); + } + if (type3.flags & 131072) { + context2.approximateLength += 5; + return ts2.factory.createKeywordTypeNode( + 144 + /* SyntaxKind.NeverKeyword */ + ); + } + if (type3.flags & 4096) { + context2.approximateLength += 6; + return ts2.factory.createKeywordTypeNode( + 153 + /* SyntaxKind.SymbolKeyword */ + ); + } + if (type3.flags & 67108864) { + context2.approximateLength += 6; + return ts2.factory.createKeywordTypeNode( + 149 + /* SyntaxKind.ObjectKeyword */ + ); + } + if (ts2.isThisTypeParameter(type3)) { + if (context2.flags & 4194304) { + if (!context2.encounteredError && !(context2.flags & 32768)) { + context2.encounteredError = true; + } + if (context2.tracker.reportInaccessibleThisError) { + context2.tracker.reportInaccessibleThisError(); + } + } + context2.approximateLength += 4; + return ts2.factory.createThisTypeNode(); + } + if (!inTypeAlias && type3.aliasSymbol && (context2.flags & 16384 || isTypeSymbolAccessible(type3.aliasSymbol, context2.enclosingDeclaration))) { + var typeArgumentNodes = mapToTypeNodes(type3.aliasTypeArguments, context2); + if (isReservedMemberName(type3.aliasSymbol.escapedName) && !(type3.aliasSymbol.flags & 32)) + return ts2.factory.createTypeReferenceNode(ts2.factory.createIdentifier(""), typeArgumentNodes); + if (ts2.length(typeArgumentNodes) === 1 && type3.aliasSymbol === globalArrayType.symbol) { + return ts2.factory.createArrayTypeNode(typeArgumentNodes[0]); + } + return symbolToTypeNode(type3.aliasSymbol, context2, 788968, typeArgumentNodes); + } + var objectFlags = ts2.getObjectFlags(type3); + if (objectFlags & 4) { + ts2.Debug.assert(!!(type3.flags & 524288)); + return type3.node ? visitAndTransformType(type3, typeReferenceToTypeNode) : typeReferenceToTypeNode(type3); + } + if (type3.flags & 262144 || objectFlags & 3) { + if (type3.flags & 262144 && ts2.contains(context2.inferTypeParameters, type3)) { + context2.approximateLength += ts2.symbolName(type3.symbol).length + 6; + var constraintNode = void 0; + var constraint = getConstraintOfTypeParameter(type3); + if (constraint) { + var inferredConstraint = getInferredTypeParameterConstraint( + type3, + /*omitTypeReferences*/ + true + ); + if (!(inferredConstraint && isTypeIdenticalTo(constraint, inferredConstraint))) { + context2.approximateLength += 9; + constraintNode = constraint && typeToTypeNodeHelper(constraint, context2); + } + } + return ts2.factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type3, context2, constraintNode)); + } + if (context2.flags & 4 && type3.flags & 262144 && !isTypeSymbolAccessible(type3.symbol, context2.enclosingDeclaration)) { + var name_2 = typeParameterToName(type3, context2); + context2.approximateLength += ts2.idText(name_2).length; + return ts2.factory.createTypeReferenceNode( + ts2.factory.createIdentifier(ts2.idText(name_2)), + /*typeArguments*/ + void 0 + ); + } + if (type3.symbol) { + return symbolToTypeNode( + type3.symbol, + context2, + 788968 + /* SymbolFlags.Type */ + ); + } + var name2 = (type3 === markerSuperTypeForCheck || type3 === markerSubTypeForCheck) && varianceTypeParameter && varianceTypeParameter.symbol ? (type3 === markerSubTypeForCheck ? "sub-" : "super-") + ts2.symbolName(varianceTypeParameter.symbol) : "?"; + return ts2.factory.createTypeReferenceNode( + ts2.factory.createIdentifier(name2), + /*typeArguments*/ + void 0 + ); + } + if (type3.flags & 1048576 && type3.origin) { + type3 = type3.origin; + } + if (type3.flags & (1048576 | 2097152)) { + var types3 = type3.flags & 1048576 ? formatUnionTypes(type3.types) : type3.types; + if (ts2.length(types3) === 1) { + return typeToTypeNodeHelper(types3[0], context2); + } + var typeNodes = mapToTypeNodes( + types3, + context2, + /*isBareList*/ + true + ); + if (typeNodes && typeNodes.length > 0) { + return type3.flags & 1048576 ? ts2.factory.createUnionTypeNode(typeNodes) : ts2.factory.createIntersectionTypeNode(typeNodes); + } else { + if (!context2.encounteredError && !(context2.flags & 262144)) { + context2.encounteredError = true; + } + return void 0; + } + } + if (objectFlags & (16 | 32)) { + ts2.Debug.assert(!!(type3.flags & 524288)); + return createAnonymousTypeNode(type3); + } + if (type3.flags & 4194304) { + var indexedType = type3.type; + context2.approximateLength += 6; + var indexTypeNode = typeToTypeNodeHelper(indexedType, context2); + return ts2.factory.createTypeOperatorNode(141, indexTypeNode); + } + if (type3.flags & 134217728) { + var texts_1 = type3.texts; + var types_1 = type3.types; + var templateHead = ts2.factory.createTemplateHead(texts_1[0]); + var templateSpans = ts2.factory.createNodeArray(ts2.map(types_1, function(t8, i7) { + return ts2.factory.createTemplateLiteralTypeSpan(typeToTypeNodeHelper(t8, context2), (i7 < types_1.length - 1 ? ts2.factory.createTemplateMiddle : ts2.factory.createTemplateTail)(texts_1[i7 + 1])); + })); + context2.approximateLength += 2; + return ts2.factory.createTemplateLiteralType(templateHead, templateSpans); + } + if (type3.flags & 268435456) { + var typeNode = typeToTypeNodeHelper(type3.type, context2); + return symbolToTypeNode(type3.symbol, context2, 788968, [typeNode]); + } + if (type3.flags & 8388608) { + var objectTypeNode = typeToTypeNodeHelper(type3.objectType, context2); + var indexTypeNode = typeToTypeNodeHelper(type3.indexType, context2); + context2.approximateLength += 2; + return ts2.factory.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + if (type3.flags & 16777216) { + return visitAndTransformType(type3, function(type4) { + return conditionalTypeToTypeNode(type4); + }); + } + if (type3.flags & 33554432) { + return typeToTypeNodeHelper(type3.baseType, context2); + } + return ts2.Debug.fail("Should be unreachable."); + function conditionalTypeToTypeNode(type4) { + var checkTypeNode = typeToTypeNodeHelper(type4.checkType, context2); + context2.approximateLength += 15; + if (context2.flags & 4 && type4.root.isDistributive && !(type4.checkType.flags & 262144)) { + var newParam = createTypeParameter(createSymbol(262144, "T")); + var name3 = typeParameterToName(newParam, context2); + var newTypeVariable = ts2.factory.createTypeReferenceNode(name3); + context2.approximateLength += 37; + var newMapper = prependTypeMapping(type4.root.checkType, newParam, type4.mapper); + var saveInferTypeParameters_1 = context2.inferTypeParameters; + context2.inferTypeParameters = type4.root.inferTypeParameters; + var extendsTypeNode_1 = typeToTypeNodeHelper(instantiateType(type4.root.extendsType, newMapper), context2); + context2.inferTypeParameters = saveInferTypeParameters_1; + var trueTypeNode_1 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type4.root.node.trueType), newMapper)); + var falseTypeNode_1 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type4.root.node.falseType), newMapper)); + return ts2.factory.createConditionalTypeNode(checkTypeNode, ts2.factory.createInferTypeNode(ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + ts2.factory.cloneNode(newTypeVariable.typeName) + )), ts2.factory.createConditionalTypeNode(ts2.factory.createTypeReferenceNode(ts2.factory.cloneNode(name3)), typeToTypeNodeHelper(type4.checkType, context2), ts2.factory.createConditionalTypeNode(newTypeVariable, extendsTypeNode_1, trueTypeNode_1, falseTypeNode_1), ts2.factory.createKeywordTypeNode( + 144 + /* SyntaxKind.NeverKeyword */ + )), ts2.factory.createKeywordTypeNode( + 144 + /* SyntaxKind.NeverKeyword */ + )); + } + var saveInferTypeParameters = context2.inferTypeParameters; + context2.inferTypeParameters = type4.root.inferTypeParameters; + var extendsTypeNode = typeToTypeNodeHelper(type4.extendsType, context2); + context2.inferTypeParameters = saveInferTypeParameters; + var trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type4)); + var falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type4)); + return ts2.factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + function typeToTypeNodeOrCircularityElision(type4) { + var _a2, _b, _c; + if (type4.flags & 1048576) { + if ((_a2 = context2.visitedTypes) === null || _a2 === void 0 ? void 0 : _a2.has(getTypeId(type4))) { + if (!(context2.flags & 131072)) { + context2.encounteredError = true; + (_c = (_b = context2.tracker) === null || _b === void 0 ? void 0 : _b.reportCyclicStructureError) === null || _c === void 0 ? void 0 : _c.call(_b); + } + return createElidedInformationPlaceholder(context2); + } + return visitAndTransformType(type4, function(type5) { + return typeToTypeNodeHelper(type5, context2); + }); + } + return typeToTypeNodeHelper(type4, context2); + } + function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type4) { + return isMappedTypeWithKeyofConstraintDeclaration(type4) && !(getModifiersTypeFromMappedType(type4).flags & 262144); + } + function createMappedTypeNodeFromType(type4) { + ts2.Debug.assert(!!(type4.flags & 524288)); + var readonlyToken = type4.declaration.readonlyToken ? ts2.factory.createToken(type4.declaration.readonlyToken.kind) : void 0; + var questionToken = type4.declaration.questionToken ? ts2.factory.createToken(type4.declaration.questionToken.kind) : void 0; + var appropriateConstraintTypeNode; + var newTypeVariable; + if (isMappedTypeWithKeyofConstraintDeclaration(type4)) { + if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type4) && context2.flags & 4) { + var newParam = createTypeParameter(createSymbol(262144, "T")); + var name3 = typeParameterToName(newParam, context2); + newTypeVariable = ts2.factory.createTypeReferenceNode(name3); + } + appropriateConstraintTypeNode = ts2.factory.createTypeOperatorNode(141, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type4), context2)); + } else { + appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type4), context2); + } + var typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type4), context2, appropriateConstraintTypeNode); + var nameTypeNode = type4.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type4), context2) : void 0; + var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type4), !!(getMappedTypeModifiers(type4) & 4)), context2); + var mappedTypeNode = ts2.factory.createMappedTypeNode( + readonlyToken, + typeParameterNode, + nameTypeNode, + questionToken, + templateTypeNode, + /*members*/ + void 0 + ); + context2.approximateLength += 10; + var result2 = ts2.setEmitFlags( + mappedTypeNode, + 1 + /* EmitFlags.SingleLine */ + ); + if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type4) && context2.flags & 4) { + var originalConstraint = instantiateType(getConstraintOfTypeParameter(getTypeFromTypeNode(type4.declaration.typeParameter.constraint.type)) || unknownType2, type4.mapper); + return ts2.factory.createConditionalTypeNode(typeToTypeNodeHelper(getModifiersTypeFromMappedType(type4), context2), ts2.factory.createInferTypeNode(ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + ts2.factory.cloneNode(newTypeVariable.typeName), + originalConstraint.flags & 2 ? void 0 : typeToTypeNodeHelper(originalConstraint, context2) + )), result2, ts2.factory.createKeywordTypeNode( + 144 + /* SyntaxKind.NeverKeyword */ + )); + } + return result2; + } + function createAnonymousTypeNode(type4) { + var _a2; + var typeId = type4.id; + var symbol = type4.symbol; + if (symbol) { + var isInstanceType = isClassInstanceSide(type4) ? 788968 : 111551; + if (isJSConstructor(symbol.valueDeclaration)) { + return symbolToTypeNode(symbol, context2, isInstanceType); + } else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && ts2.isClassLike(symbol.valueDeclaration) && context2.flags & 2048 && (!ts2.isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( + symbol, + context2.enclosingDeclaration, + isInstanceType, + /*computeAliases*/ + false + ).accessibility !== 0)) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { + return symbolToTypeNode(symbol, context2, isInstanceType); + } else if ((_a2 = context2.visitedTypes) === null || _a2 === void 0 ? void 0 : _a2.has(typeId)) { + var typeAlias = getTypeAliasForTypeLiteral(type4); + if (typeAlias) { + return symbolToTypeNode( + typeAlias, + context2, + 788968 + /* SymbolFlags.Type */ + ); + } else { + return createElidedInformationPlaceholder(context2); + } + } else { + return visitAndTransformType(type4, createTypeNodeFromObjectType); + } + } else { + return createTypeNodeFromObjectType(type4); + } + function shouldWriteTypeOfFunctionSymbol() { + var _a3; + var isStaticMethodSymbol = !!(symbol.flags & 8192) && // typeof static method + ts2.some(symbol.declarations, function(declaration) { + return ts2.isStatic(declaration); + }); + var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || // is exported function symbol + ts2.forEach(symbol.declarations, function(declaration) { + return declaration.parent.kind === 308 || declaration.parent.kind === 265; + })); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return (!!(context2.flags & 4096) || ((_a3 = context2.visitedTypes) === null || _a3 === void 0 ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively + (!(context2.flags & 8) || isValueSymbolAccessible(symbol, context2.enclosingDeclaration)); + } + } + } + function visitAndTransformType(type4, transform2) { + var _a2, _b; + var typeId = type4.id; + var isConstructorObject = ts2.getObjectFlags(type4) & 16 && type4.symbol && type4.symbol.flags & 32; + var id = ts2.getObjectFlags(type4) & 4 && type4.node ? "N" + getNodeId(type4.node) : type4.flags & 16777216 ? "N" + getNodeId(type4.root.node) : type4.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type4.symbol) : void 0; + if (!context2.visitedTypes) { + context2.visitedTypes = new ts2.Set(); + } + if (id && !context2.symbolDepth) { + context2.symbolDepth = new ts2.Map(); + } + var links = context2.enclosingDeclaration && getNodeLinks(context2.enclosingDeclaration); + var key = "".concat(getTypeId(type4), "|").concat(context2.flags); + if (links) { + links.serializedTypes || (links.serializedTypes = new ts2.Map()); + } + var cachedResult = (_a2 = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _a2 === void 0 ? void 0 : _a2.get(key); + if (cachedResult) { + if (cachedResult.truncating) { + context2.truncating = true; + } + context2.approximateLength += cachedResult.addedLength; + return deepCloneOrReuseNode(cachedResult); + } + var depth; + if (id) { + depth = context2.symbolDepth.get(id) || 0; + if (depth > 10) { + return createElidedInformationPlaceholder(context2); + } + context2.symbolDepth.set(id, depth + 1); + } + context2.visitedTypes.add(typeId); + var startLength = context2.approximateLength; + var result2 = transform2(type4); + var addedLength = context2.approximateLength - startLength; + if (!context2.reportedDiagnostic && !context2.encounteredError) { + if (context2.truncating) { + result2.truncating = true; + } + result2.addedLength = addedLength; + (_b = links === null || links === void 0 ? void 0 : links.serializedTypes) === null || _b === void 0 ? void 0 : _b.set(key, result2); + } + context2.visitedTypes.delete(typeId); + if (id) { + context2.symbolDepth.set(id, depth); + } + return result2; + function deepCloneOrReuseNode(node) { + if (!ts2.nodeIsSynthesized(node) && ts2.getParseTreeNode(node) === node) { + return node; + } + return ts2.setTextRange(ts2.factory.cloneNode(ts2.visitEachChild(node, deepCloneOrReuseNode, ts2.nullTransformationContext, deepCloneOrReuseNodes)), node); + } + function deepCloneOrReuseNodes(nodes, visitor, test, start, count2) { + if (nodes && nodes.length === 0) { + return ts2.setTextRange(ts2.factory.createNodeArray( + /*nodes*/ + void 0, + nodes.hasTrailingComma + ), nodes); + } + return ts2.visitNodes(nodes, visitor, test, start, count2); + } + } + function createTypeNodeFromObjectType(type4) { + if (isGenericMappedType(type4) || type4.containsError) { + return createMappedTypeNodeFromType(type4); + } + var resolved = resolveStructuredTypeMembers(type4); + if (!resolved.properties.length && !resolved.indexInfos.length) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + context2.approximateLength += 2; + return ts2.setEmitFlags( + ts2.factory.createTypeLiteralNode( + /*members*/ + void 0 + ), + 1 + /* EmitFlags.SingleLine */ + ); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + var signature = resolved.callSignatures[0]; + var signatureNode = signatureToSignatureDeclarationHelper(signature, 181, context2); + return signatureNode; + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + var signature = resolved.constructSignatures[0]; + var signatureNode = signatureToSignatureDeclarationHelper(signature, 182, context2); + return signatureNode; + } + } + var abstractSignatures = ts2.filter(resolved.constructSignatures, function(signature2) { + return !!(signature2.flags & 4); + }); + if (ts2.some(abstractSignatures)) { + var types4 = ts2.map(abstractSignatures, getOrCreateTypeFromSignature); + var typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per + // the logic in `createTypeNodesFromResolvedType`. + (context2.flags & 2048 ? ts2.countWhere(resolved.properties, function(p7) { + return !(p7.flags & 4194304); + }) : ts2.length(resolved.properties)); + if (typeElementCount) { + types4.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved)); + } + return typeToTypeNodeHelper(getIntersectionType(types4), context2); + } + var savedFlags = context2.flags; + context2.flags |= 4194304; + var members = createTypeNodesFromResolvedType(resolved); + context2.flags = savedFlags; + var typeLiteralNode = ts2.factory.createTypeLiteralNode(members); + context2.approximateLength += 2; + ts2.setEmitFlags( + typeLiteralNode, + context2.flags & 1024 ? 0 : 1 + /* EmitFlags.SingleLine */ + ); + return typeLiteralNode; + } + function typeReferenceToTypeNode(type4) { + var typeArguments = getTypeArguments(type4); + if (type4.target === globalArrayType || type4.target === globalReadonlyArrayType) { + if (context2.flags & 2) { + var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context2); + return ts2.factory.createTypeReferenceNode(type4.target === globalArrayType ? "Array" : "ReadonlyArray", [typeArgumentNode]); + } + var elementType = typeToTypeNodeHelper(typeArguments[0], context2); + var arrayType2 = ts2.factory.createArrayTypeNode(elementType); + return type4.target === globalArrayType ? arrayType2 : ts2.factory.createTypeOperatorNode(146, arrayType2); + } else if (type4.target.objectFlags & 8) { + typeArguments = ts2.sameMap(typeArguments, function(t8, i8) { + return removeMissingType(t8, !!(type4.target.elementFlags[i8] & 2)); + }); + if (typeArguments.length > 0) { + var arity = getTypeReferenceArity(type4); + var tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context2); + if (tupleConstituentNodes) { + if (type4.target.labeledElementDeclarations) { + for (var i7 = 0; i7 < tupleConstituentNodes.length; i7++) { + var flags = type4.target.elementFlags[i7]; + tupleConstituentNodes[i7] = ts2.factory.createNamedTupleMember(flags & 12 ? ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ) : void 0, ts2.factory.createIdentifier(ts2.unescapeLeadingUnderscores(getTupleElementLabel(type4.target.labeledElementDeclarations[i7]))), flags & 2 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, flags & 4 ? ts2.factory.createArrayTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7]); + } + } else { + for (var i7 = 0; i7 < Math.min(arity, tupleConstituentNodes.length); i7++) { + var flags = type4.target.elementFlags[i7]; + tupleConstituentNodes[i7] = flags & 12 ? ts2.factory.createRestTypeNode(flags & 4 ? ts2.factory.createArrayTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7]) : flags & 2 ? ts2.factory.createOptionalTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7]; + } + } + var tupleTypeNode = ts2.setEmitFlags( + ts2.factory.createTupleTypeNode(tupleConstituentNodes), + 1 + /* EmitFlags.SingleLine */ + ); + return type4.target.readonly ? ts2.factory.createTypeOperatorNode(146, tupleTypeNode) : tupleTypeNode; + } + } + if (context2.encounteredError || context2.flags & 524288) { + var tupleTypeNode = ts2.setEmitFlags( + ts2.factory.createTupleTypeNode([]), + 1 + /* EmitFlags.SingleLine */ + ); + return type4.target.readonly ? ts2.factory.createTypeOperatorNode(146, tupleTypeNode) : tupleTypeNode; + } + context2.encounteredError = true; + return void 0; + } else if (context2.flags & 2048 && type4.symbol.valueDeclaration && ts2.isClassLike(type4.symbol.valueDeclaration) && !isValueSymbolAccessible(type4.symbol, context2.enclosingDeclaration)) { + return createAnonymousTypeNode(type4); + } else { + var outerTypeParameters = type4.target.outerTypeParameters; + var i7 = 0; + var resultType = void 0; + if (outerTypeParameters) { + var length_2 = outerTypeParameters.length; + while (i7 < length_2) { + var start = i7; + var parent2 = getParentSymbolOfTypeParameter(outerTypeParameters[i7]); + do { + i7++; + } while (i7 < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i7]) === parent2); + if (!ts2.rangeEquals(outerTypeParameters, typeArguments, start, i7)) { + var typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i7), context2); + var flags_3 = context2.flags; + context2.flags |= 16; + var ref = symbolToTypeNode(parent2, context2, 788968, typeArgumentSlice); + context2.flags = flags_3; + resultType = !resultType ? ref : appendReferenceToType(resultType, ref); + } + } + } + var typeArgumentNodes2 = void 0; + if (typeArguments.length > 0) { + var typeParameterCount = (type4.target.typeParameters || ts2.emptyArray).length; + typeArgumentNodes2 = mapToTypeNodes(typeArguments.slice(i7, typeParameterCount), context2); + } + var flags = context2.flags; + context2.flags |= 16; + var finalRef = symbolToTypeNode(type4.symbol, context2, 788968, typeArgumentNodes2); + context2.flags = flags; + return !resultType ? finalRef : appendReferenceToType(resultType, finalRef); + } + } + function appendReferenceToType(root2, ref) { + if (ts2.isImportTypeNode(root2)) { + var typeArguments = root2.typeArguments; + var qualifier = root2.qualifier; + if (qualifier) { + if (ts2.isIdentifier(qualifier)) { + qualifier = ts2.factory.updateIdentifier(qualifier, typeArguments); + } else { + qualifier = ts2.factory.updateQualifiedName(qualifier, qualifier.left, ts2.factory.updateIdentifier(qualifier.right, typeArguments)); + } + } + typeArguments = ref.typeArguments; + var ids = getAccessStack(ref); + for (var _i = 0, ids_1 = ids; _i < ids_1.length; _i++) { + var id = ids_1[_i]; + qualifier = qualifier ? ts2.factory.createQualifiedName(qualifier, id) : id; + } + return ts2.factory.updateImportTypeNode(root2, root2.argument, root2.assertions, qualifier, typeArguments, root2.isTypeOf); + } else { + var typeArguments = root2.typeArguments; + var typeName = root2.typeName; + if (ts2.isIdentifier(typeName)) { + typeName = ts2.factory.updateIdentifier(typeName, typeArguments); + } else { + typeName = ts2.factory.updateQualifiedName(typeName, typeName.left, ts2.factory.updateIdentifier(typeName.right, typeArguments)); + } + typeArguments = ref.typeArguments; + var ids = getAccessStack(ref); + for (var _a2 = 0, ids_2 = ids; _a2 < ids_2.length; _a2++) { + var id = ids_2[_a2]; + typeName = ts2.factory.createQualifiedName(typeName, id); + } + return ts2.factory.updateTypeReferenceNode(root2, typeName, typeArguments); + } + } + function getAccessStack(ref) { + var state = ref.typeName; + var ids = []; + while (!ts2.isIdentifier(state)) { + ids.unshift(state.right); + state = state.left; + } + ids.unshift(state); + return ids; + } + function createTypeNodesFromResolvedType(resolvedType) { + if (checkTruncationLength(context2)) { + return [ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + "...", + /*questionToken*/ + void 0, + /*type*/ + void 0 + )]; + } + var typeElements = []; + for (var _i = 0, _a2 = resolvedType.callSignatures; _i < _a2.length; _i++) { + var signature = _a2[_i]; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 176, context2)); + } + for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { + var signature = _c[_b]; + if (signature.flags & 4) + continue; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 177, context2)); + } + for (var _d = 0, _e2 = resolvedType.indexInfos; _d < _e2.length; _d++) { + var info2 = _e2[_d]; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info2, context2, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context2) : void 0)); + } + var properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + var i7 = 0; + for (var _f = 0, properties_1 = properties; _f < properties_1.length; _f++) { + var propertySymbol = properties_1[_f]; + i7++; + if (context2.flags & 2048) { + if (propertySymbol.flags & 4194304) { + continue; + } + if (ts2.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 | 16) && context2.tracker.reportPrivateInBaseOfClassExpression) { + context2.tracker.reportPrivateInBaseOfClassExpression(ts2.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + if (checkTruncationLength(context2) && i7 + 2 < properties.length - 1) { + typeElements.push(ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + "... ".concat(properties.length - i7, " more ..."), + /*questionToken*/ + void 0, + /*type*/ + void 0 + )); + addPropertyToElementList(properties[properties.length - 1], context2, typeElements); + break; + } + addPropertyToElementList(propertySymbol, context2, typeElements); + } + return typeElements.length ? typeElements : void 0; + } + } + function createElidedInformationPlaceholder(context2) { + context2.approximateLength += 3; + if (!(context2.flags & 1)) { + return ts2.factory.createTypeReferenceNode( + ts2.factory.createIdentifier("..."), + /*typeArguments*/ + void 0 + ); + } + return ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + function shouldUsePlaceholderForProperty(propertySymbol, context2) { + var _a2; + return !!(ts2.getCheckFlags(propertySymbol) & 8192) && (ts2.contains(context2.reverseMappedStack, propertySymbol) || ((_a2 = context2.reverseMappedStack) === null || _a2 === void 0 ? void 0 : _a2[0]) && !(ts2.getObjectFlags(ts2.last(context2.reverseMappedStack).propertyType) & 16)); + } + function addPropertyToElementList(propertySymbol, context2, typeElements) { + var _a2, _b; + var propertyIsReverseMapped = !!(ts2.getCheckFlags(propertySymbol) & 8192); + var propertyType = shouldUsePlaceholderForProperty(propertySymbol, context2) ? anyType2 : getNonMissingTypeOfSymbol(propertySymbol); + var saveEnclosingDeclaration = context2.enclosingDeclaration; + context2.enclosingDeclaration = void 0; + if (context2.tracker.trackSymbol && isLateBoundName(propertySymbol.escapedName)) { + if (propertySymbol.declarations) { + var decl = ts2.first(propertySymbol.declarations); + if (hasLateBindableName(decl)) { + if (ts2.isBinaryExpression(decl)) { + var name2 = ts2.getNameOfDeclaration(decl); + if (name2 && ts2.isElementAccessExpression(name2) && ts2.isPropertyAccessEntityNameExpression(name2.argumentExpression)) { + trackComputedName(name2.argumentExpression, saveEnclosingDeclaration, context2); + } + } else { + trackComputedName(decl.name.expression, saveEnclosingDeclaration, context2); + } + } + } else if ((_a2 = context2.tracker) === null || _a2 === void 0 ? void 0 : _a2.reportNonSerializableProperty) { + context2.tracker.reportNonSerializableProperty(symbolToString2(propertySymbol)); + } + } + context2.enclosingDeclaration = propertySymbol.valueDeclaration || ((_b = propertySymbol.declarations) === null || _b === void 0 ? void 0 : _b[0]) || saveEnclosingDeclaration; + var propertyName = getPropertyNameNodeForSymbol(propertySymbol, context2); + context2.enclosingDeclaration = saveEnclosingDeclaration; + context2.approximateLength += ts2.symbolName(propertySymbol).length + 1; + var optionalToken = propertySymbol.flags & 16777216 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0; + if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) { + var signatures = getSignaturesOfType( + filterType(propertyType, function(t8) { + return !(t8.flags & 32768); + }), + 0 + /* SignatureKind.Call */ + ); + for (var _i = 0, signatures_1 = signatures; _i < signatures_1.length; _i++) { + var signature = signatures_1[_i]; + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 170, context2, { name: propertyName, questionToken: optionalToken }); + typeElements.push(preserveCommentsOn(methodDeclaration)); + } + } else { + var propertyTypeNode = void 0; + if (shouldUsePlaceholderForProperty(propertySymbol, context2)) { + propertyTypeNode = createElidedInformationPlaceholder(context2); + } else { + if (propertyIsReverseMapped) { + context2.reverseMappedStack || (context2.reverseMappedStack = []); + context2.reverseMappedStack.push(propertySymbol); + } + propertyTypeNode = propertyType ? serializeTypeForDeclaration(context2, propertyType, propertySymbol, saveEnclosingDeclaration) : ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + if (propertyIsReverseMapped) { + context2.reverseMappedStack.pop(); + } + } + var modifiers = isReadonlySymbol(propertySymbol) ? [ts2.factory.createToken( + 146 + /* SyntaxKind.ReadonlyKeyword */ + )] : void 0; + if (modifiers) { + context2.approximateLength += 9; + } + var propertySignature = ts2.factory.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode); + typeElements.push(preserveCommentsOn(propertySignature)); + } + function preserveCommentsOn(node) { + var _a3; + if (ts2.some(propertySymbol.declarations, function(d8) { + return d8.kind === 350; + })) { + var d7 = (_a3 = propertySymbol.declarations) === null || _a3 === void 0 ? void 0 : _a3.find(function(d8) { + return d8.kind === 350; + }); + var commentText = ts2.getTextOfJSDocComment(d7.comment); + if (commentText) { + ts2.setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); + } + } else if (propertySymbol.valueDeclaration) { + ts2.setCommentRange(node, propertySymbol.valueDeclaration); + } + return node; + } + } + function mapToTypeNodes(types3, context2, isBareList) { + if (ts2.some(types3)) { + if (checkTruncationLength(context2)) { + if (!isBareList) { + return [ts2.factory.createTypeReferenceNode( + "...", + /*typeArguments*/ + void 0 + )]; + } else if (types3.length > 2) { + return [ + typeToTypeNodeHelper(types3[0], context2), + ts2.factory.createTypeReferenceNode( + "... ".concat(types3.length - 2, " more ..."), + /*typeArguments*/ + void 0 + ), + typeToTypeNodeHelper(types3[types3.length - 1], context2) + ]; + } + } + var mayHaveNameCollisions = !(context2.flags & 64); + var seenNames = mayHaveNameCollisions ? ts2.createUnderscoreEscapedMultiMap() : void 0; + var result_5 = []; + var i7 = 0; + for (var _i = 0, types_2 = types3; _i < types_2.length; _i++) { + var type3 = types_2[_i]; + i7++; + if (checkTruncationLength(context2) && i7 + 2 < types3.length - 1) { + result_5.push(ts2.factory.createTypeReferenceNode( + "... ".concat(types3.length - i7, " more ..."), + /*typeArguments*/ + void 0 + )); + var typeNode_1 = typeToTypeNodeHelper(types3[types3.length - 1], context2); + if (typeNode_1) { + result_5.push(typeNode_1); + } + break; + } + context2.approximateLength += 2; + var typeNode = typeToTypeNodeHelper(type3, context2); + if (typeNode) { + result_5.push(typeNode); + if (seenNames && ts2.isIdentifierTypeReference(typeNode)) { + seenNames.add(typeNode.typeName.escapedText, [type3, result_5.length - 1]); + } + } + } + if (seenNames) { + var saveContextFlags = context2.flags; + context2.flags |= 64; + seenNames.forEach(function(types4) { + if (!ts2.arrayIsHomogeneous(types4, function(_a3, _b) { + var a7 = _a3[0]; + var b8 = _b[0]; + return typesAreSameReference(a7, b8); + })) { + for (var _i2 = 0, types_3 = types4; _i2 < types_3.length; _i2++) { + var _a2 = types_3[_i2], type4 = _a2[0], resultIndex = _a2[1]; + result_5[resultIndex] = typeToTypeNodeHelper(type4, context2); + } + } + }); + context2.flags = saveContextFlags; + } + return result_5; + } + } + function typesAreSameReference(a7, b8) { + return a7 === b8 || !!a7.symbol && a7.symbol === b8.symbol || !!a7.aliasSymbol && a7.aliasSymbol === b8.aliasSymbol; + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode) { + var name2 = ts2.getNameFromIndexInfo(indexInfo) || "x"; + var indexerTypeNode = typeToTypeNodeHelper(indexInfo.keyType, context2); + var indexingParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + indexerTypeNode, + /*initializer*/ + void 0 + ); + if (!typeNode) { + typeNode = typeToTypeNodeHelper(indexInfo.type || anyType2, context2); + } + if (!indexInfo.type && !(context2.flags & 2097152)) { + context2.encounteredError = true; + } + context2.approximateLength += name2.length + 4; + return ts2.factory.createIndexSignature(indexInfo.isReadonly ? [ts2.factory.createToken( + 146 + /* SyntaxKind.ReadonlyKeyword */ + )] : void 0, [indexingParameter], typeNode); + } + function signatureToSignatureDeclarationHelper(signature, kind, context2, options) { + var _a2, _b, _c, _d; + var suppressAny = context2.flags & 256; + if (suppressAny) + context2.flags &= ~256; + context2.approximateLength += 3; + var typeParameters; + var typeArguments; + if (context2.flags & 32 && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function(parameter) { + return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context2); + }); + } else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function(parameter) { + return typeParameterToDeclaration(parameter, context2); + }); + } + var expandedParams = getExpandedParameters( + signature, + /*skipUnionExpanding*/ + true + )[0]; + var parameters = (ts2.some(expandedParams, function(p7) { + return p7 !== expandedParams[expandedParams.length - 1] && !!(ts2.getCheckFlags(p7) & 32768); + }) ? signature.parameters : expandedParams).map(function(parameter) { + return symbolToParameterDeclaration(parameter, context2, kind === 173, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); + }); + var thisParameter = context2.flags & 33554432 ? void 0 : tryGetThisParameterDeclaration(signature, context2); + if (thisParameter) { + parameters.unshift(thisParameter); + } + var returnTypeNode; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + var assertsModifier = typePredicate.kind === 2 || typePredicate.kind === 3 ? ts2.factory.createToken( + 129 + /* SyntaxKind.AssertsKeyword */ + ) : void 0; + var parameterName = typePredicate.kind === 1 || typePredicate.kind === 3 ? ts2.setEmitFlags( + ts2.factory.createIdentifier(typePredicate.parameterName), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ) : ts2.factory.createThisTypeNode(); + var typeNode = typePredicate.type && typeToTypeNodeHelper(typePredicate.type, context2); + returnTypeNode = ts2.factory.createTypePredicateNode(assertsModifier, parameterName, typeNode); + } else { + var returnType = getReturnTypeOfSignature(signature); + if (returnType && !(suppressAny && isTypeAny(returnType))) { + returnTypeNode = serializeReturnTypeForSignature(context2, returnType, signature, options === null || options === void 0 ? void 0 : options.privateSymbolVisitor, options === null || options === void 0 ? void 0 : options.bundledImports); + } else if (!suppressAny) { + returnTypeNode = ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + } + var modifiers = options === null || options === void 0 ? void 0 : options.modifiers; + if (kind === 182 && signature.flags & 4) { + var flags = ts2.modifiersToFlags(modifiers); + modifiers = ts2.factory.createModifiersFromModifierFlags( + flags | 256 + /* ModifierFlags.Abstract */ + ); + } + var node = kind === 176 ? ts2.factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 ? ts2.factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 ? ts2.factory.createMethodSignature(modifiers, (_a2 = options === null || options === void 0 ? void 0 : options.name) !== null && _a2 !== void 0 ? _a2 : ts2.factory.createIdentifier(""), options === null || options === void 0 ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 ? ts2.factory.createMethodDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + (_b = options === null || options === void 0 ? void 0 : options.name) !== null && _b !== void 0 ? _b : ts2.factory.createIdentifier(""), + /*questionToken*/ + void 0, + typeParameters, + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 173 ? ts2.factory.createConstructorDeclaration( + modifiers, + parameters, + /*body*/ + void 0 + ) : kind === 174 ? ts2.factory.createGetAccessorDeclaration( + modifiers, + (_c = options === null || options === void 0 ? void 0 : options.name) !== null && _c !== void 0 ? _c : ts2.factory.createIdentifier(""), + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 175 ? ts2.factory.createSetAccessorDeclaration( + modifiers, + (_d = options === null || options === void 0 ? void 0 : options.name) !== null && _d !== void 0 ? _d : ts2.factory.createIdentifier(""), + parameters, + /*body*/ + void 0 + ) : kind === 178 ? ts2.factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 320 ? ts2.factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 181 ? ts2.factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts2.factory.createTypeReferenceNode(ts2.factory.createIdentifier(""))) : kind === 182 ? ts2.factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode !== null && returnTypeNode !== void 0 ? returnTypeNode : ts2.factory.createTypeReferenceNode(ts2.factory.createIdentifier(""))) : kind === 259 ? ts2.factory.createFunctionDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + (options === null || options === void 0 ? void 0 : options.name) ? ts2.cast(options.name, ts2.isIdentifier) : ts2.factory.createIdentifier(""), + typeParameters, + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 215 ? ts2.factory.createFunctionExpression( + modifiers, + /*asteriskToken*/ + void 0, + (options === null || options === void 0 ? void 0 : options.name) ? ts2.cast(options.name, ts2.isIdentifier) : ts2.factory.createIdentifier(""), + typeParameters, + parameters, + returnTypeNode, + ts2.factory.createBlock([]) + ) : kind === 216 ? ts2.factory.createArrowFunction( + modifiers, + typeParameters, + parameters, + returnTypeNode, + /*equalsGreaterThanToken*/ + void 0, + ts2.factory.createBlock([]) + ) : ts2.Debug.assertNever(kind); + if (typeArguments) { + node.typeArguments = ts2.factory.createNodeArray(typeArguments); + } + return node; + } + function tryGetThisParameterDeclaration(signature, context2) { + if (signature.thisParameter) { + return symbolToParameterDeclaration(signature.thisParameter, context2); + } + if (signature.declaration) { + var thisTag = ts2.getJSDocThisTag(signature.declaration); + if (thisTag && thisTag.typeExpression) { + return ts2.factory.createParameterDeclaration( + /* modifiers */ + void 0, + /* dotDotDotToken */ + void 0, + "this", + /* questionToken */ + void 0, + typeToTypeNodeHelper(getTypeFromTypeNode(thisTag.typeExpression), context2) + ); + } + } + } + function typeParameterToDeclarationWithConstraint(type3, context2, constraintNode) { + var savedContextFlags = context2.flags; + context2.flags &= ~512; + var modifiers = ts2.factory.createModifiersFromModifierFlags(getVarianceModifiers(type3)); + var name2 = typeParameterToName(type3, context2); + var defaultParameter = getDefaultFromTypeParameter(type3); + var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context2); + context2.flags = savedContextFlags; + return ts2.factory.createTypeParameterDeclaration(modifiers, name2, constraintNode, defaultParameterNode); + } + function typeParameterToDeclaration(type3, context2, constraint) { + if (constraint === void 0) { + constraint = getConstraintOfTypeParameter(type3); + } + var constraintNode = constraint && typeToTypeNodeHelper(constraint, context2); + return typeParameterToDeclarationWithConstraint(type3, context2, constraintNode); + } + function symbolToParameterDeclaration(parameterSymbol, context2, preserveModifierFlags, privateSymbolVisitor, bundledImports) { + var parameterDeclaration = ts2.getDeclarationOfKind( + parameterSymbol, + 166 + /* SyntaxKind.Parameter */ + ); + if (!parameterDeclaration && !ts2.isTransientSymbol(parameterSymbol)) { + parameterDeclaration = ts2.getDeclarationOfKind( + parameterSymbol, + 343 + /* SyntaxKind.JSDocParameterTag */ + ); + } + var parameterType = getTypeOfSymbol(parameterSymbol); + if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { + parameterType = getOptionalType(parameterType); + } + var parameterTypeNode = serializeTypeForDeclaration(context2, parameterType, parameterSymbol, context2.enclosingDeclaration, privateSymbolVisitor, bundledImports); + var modifiers = !(context2.flags & 8192) && preserveModifierFlags && parameterDeclaration && ts2.canHaveModifiers(parameterDeclaration) ? ts2.map(ts2.getModifiers(parameterDeclaration), ts2.factory.cloneNode) : void 0; + var isRest = parameterDeclaration && ts2.isRestParameter(parameterDeclaration) || ts2.getCheckFlags(parameterSymbol) & 32768; + var dotDotDotToken = isRest ? ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ) : void 0; + var name2 = parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 79 ? ts2.setEmitFlags( + ts2.factory.cloneNode(parameterDeclaration.name), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ) : parameterDeclaration.name.kind === 163 ? ts2.setEmitFlags( + ts2.factory.cloneNode(parameterDeclaration.name.right), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ) : cloneBindingName(parameterDeclaration.name) : ts2.symbolName(parameterSymbol) : ts2.symbolName(parameterSymbol); + var isOptional2 = parameterDeclaration && isOptionalParameter(parameterDeclaration) || ts2.getCheckFlags(parameterSymbol) & 16384; + var questionToken = isOptional2 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0; + var parameterNode = ts2.factory.createParameterDeclaration( + modifiers, + dotDotDotToken, + name2, + questionToken, + parameterTypeNode, + /*initializer*/ + void 0 + ); + context2.approximateLength += ts2.symbolName(parameterSymbol).length + 3; + return parameterNode; + function cloneBindingName(node) { + return elideInitializerAndSetEmitFlags(node); + function elideInitializerAndSetEmitFlags(node2) { + if (context2.tracker.trackSymbol && ts2.isComputedPropertyName(node2) && isLateBindableName(node2)) { + trackComputedName(node2.expression, context2.enclosingDeclaration, context2); + } + var visited = ts2.visitEachChild( + node2, + elideInitializerAndSetEmitFlags, + ts2.nullTransformationContext, + /*nodesVisitor*/ + void 0, + elideInitializerAndSetEmitFlags + ); + if (ts2.isBindingElement(visited)) { + visited = ts2.factory.updateBindingElement( + visited, + visited.dotDotDotToken, + visited.propertyName, + visited.name, + /*initializer*/ + void 0 + ); + } + if (!ts2.nodeIsSynthesized(visited)) { + visited = ts2.factory.cloneNode(visited); + } + return ts2.setEmitFlags( + visited, + 1 | 16777216 + /* EmitFlags.NoAsciiEscaping */ + ); + } + } + } + function trackComputedName(accessExpression, enclosingDeclaration, context2) { + if (!context2.tracker.trackSymbol) + return; + var firstIdentifier = ts2.getFirstIdentifier(accessExpression); + var name2 = resolveName( + firstIdentifier, + firstIdentifier.escapedText, + 111551 | 1048576, + /*nodeNotFoundErrorMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (name2) { + context2.tracker.trackSymbol( + name2, + enclosingDeclaration, + 111551 + /* SymbolFlags.Value */ + ); + } + } + function lookupSymbolChain(symbol, context2, meaning, yieldModuleSymbol) { + context2.tracker.trackSymbol(symbol, context2.enclosingDeclaration, meaning); + return lookupSymbolChainWorker(symbol, context2, meaning, yieldModuleSymbol); + } + function lookupSymbolChainWorker(symbol, context2, meaning, yieldModuleSymbol) { + var chain3; + var isTypeParameter = symbol.flags & 262144; + if (!isTypeParameter && (context2.enclosingDeclaration || context2.flags & 64) && !(context2.flags & 134217728)) { + chain3 = ts2.Debug.checkDefined(getSymbolChain( + symbol, + meaning, + /*endOfChain*/ + true + )); + ts2.Debug.assert(chain3 && chain3.length > 0); + } else { + chain3 = [symbol]; + } + return chain3; + function getSymbolChain(symbol2, meaning2, endOfChain) { + var accessibleSymbolChain = getAccessibleSymbolChain(symbol2, context2.enclosingDeclaration, meaning2, !!(context2.flags & 128)); + var parentSpecifiers; + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context2.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning2 : getQualifiedLeftMeaning(meaning2))) { + var parents_1 = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol2, context2.enclosingDeclaration, meaning2); + if (ts2.length(parents_1)) { + parentSpecifiers = parents_1.map(function(symbol3) { + return ts2.some(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context2) : void 0; + }); + var indices = parents_1.map(function(_6, i7) { + return i7; + }); + indices.sort(sortByBestName); + var sortedParents = indices.map(function(i7) { + return parents_1[i7]; + }); + for (var _i = 0, sortedParents_1 = sortedParents; _i < sortedParents_1.length; _i++) { + var parent2 = sortedParents_1[_i]; + var parentChain = getSymbolChain( + parent2, + getQualifiedLeftMeaning(meaning2), + /*endOfChain*/ + false + ); + if (parentChain) { + if (parent2.exports && parent2.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ) && getSymbolIfSameReference(parent2.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ), symbol2)) { + accessibleSymbolChain = parentChain; + break; + } + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent2, symbol2) || symbol2]); + break; + } + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || // If a parent symbol is an anonymous type, don't write it. + !(symbol2.flags & (2048 | 4096)) + ) { + if (!endOfChain && !yieldModuleSymbol && !!ts2.forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + return; + } + return [symbol2]; + } + function sortByBestName(a7, b8) { + var specifierA = parentSpecifiers[a7]; + var specifierB = parentSpecifiers[b8]; + if (specifierA && specifierB) { + var isBRelative = ts2.pathIsRelative(specifierB); + if (ts2.pathIsRelative(specifierA) === isBRelative) { + return ts2.moduleSpecifiers.countPathComponents(specifierA) - ts2.moduleSpecifiers.countPathComponents(specifierB); + } + if (isBRelative) { + return -1; + } + return 1; + } + return 0; + } + } + } + function typeParametersToTypeParameterDeclarations(symbol, context2) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameterNodes = ts2.factory.createNodeArray(ts2.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function(tp) { + return typeParameterToDeclaration(tp, context2); + })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain3, index4, context2) { + var _a2; + ts2.Debug.assert(chain3 && 0 <= index4 && index4 < chain3.length); + var symbol = chain3[index4]; + var symbolId = getSymbolId(symbol); + if ((_a2 = context2.typeParameterSymbolList) === null || _a2 === void 0 ? void 0 : _a2.has(symbolId)) { + return void 0; + } + (context2.typeParameterSymbolList || (context2.typeParameterSymbolList = new ts2.Set())).add(symbolId); + var typeParameterNodes; + if (context2.flags & 512 && index4 < chain3.length - 1) { + var parentSymbol = symbol; + var nextSymbol_1 = chain3[index4 + 1]; + if (ts2.getCheckFlags(nextSymbol_1) & 1) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts2.map(params, function(t8) { + return getMappedType(t8, nextSymbol_1.mapper); + }), context2); + } else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context2); + } + } + return typeParameterNodes; + } + function getTopmostIndexedAccessType(top) { + if (ts2.isIndexedAccessTypeNode(top.objectType)) { + return getTopmostIndexedAccessType(top.objectType); + } + return top; + } + function getSpecifierForModuleSymbol(symbol, context2, overrideImportMode) { + var _a2; + var file = ts2.getDeclarationOfKind( + symbol, + 308 + /* SyntaxKind.SourceFile */ + ); + if (!file) { + var equivalentFileSymbol = ts2.firstDefined(symbol.declarations, function(d7) { + return getFileSymbolIfFileSymbolExportEqualsContainer(d7, symbol); + }); + if (equivalentFileSymbol) { + file = ts2.getDeclarationOfKind( + equivalentFileSymbol, + 308 + /* SyntaxKind.SourceFile */ + ); + } + } + if (file && file.moduleName !== void 0) { + return file.moduleName; + } + if (!file) { + if (context2.tracker.trackReferencedAmbientModule) { + var ambientDecls = ts2.filter(symbol.declarations, ts2.isAmbientModule); + if (ts2.length(ambientDecls)) { + for (var _i = 0, _b = ambientDecls; _i < _b.length; _i++) { + var decl = _b[_i]; + context2.tracker.trackReferencedAmbientModule(decl, symbol); + } + } + } + if (ambientModuleSymbolRegex.test(symbol.escapedName)) { + return symbol.escapedName.substring(1, symbol.escapedName.length - 1); + } + } + if (!context2.enclosingDeclaration || !context2.tracker.moduleResolverHost) { + if (ambientModuleSymbolRegex.test(symbol.escapedName)) { + return symbol.escapedName.substring(1, symbol.escapedName.length - 1); + } + return ts2.getSourceFileOfNode(ts2.getNonAugmentationDeclaration(symbol)).fileName; + } + var contextFile = ts2.getSourceFileOfNode(ts2.getOriginalNode(context2.enclosingDeclaration)); + var resolutionMode = overrideImportMode || (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat); + var cacheKey = getSpecifierCacheKey(contextFile.path, resolutionMode); + var links = getSymbolLinks(symbol); + var specifier = links.specifierCache && links.specifierCache.get(cacheKey); + if (!specifier) { + var isBundle_1 = !!ts2.outFile(compilerOptions); + var moduleResolverHost = context2.tracker.moduleResolverHost; + var specifierCompilerOptions = isBundle_1 ? __assign16(__assign16({}, compilerOptions), { baseUrl: moduleResolverHost.getCommonSourceDirectory() }) : compilerOptions; + specifier = ts2.first(ts2.moduleSpecifiers.getModuleSpecifiers(symbol, checker, specifierCompilerOptions, contextFile, moduleResolverHost, { + importModuleSpecifierPreference: isBundle_1 ? "non-relative" : "project-relative", + importModuleSpecifierEnding: isBundle_1 ? "minimal" : resolutionMode === ts2.ModuleKind.ESNext ? "js" : void 0 + }, { overrideImportMode })); + (_a2 = links.specifierCache) !== null && _a2 !== void 0 ? _a2 : links.specifierCache = new ts2.Map(); + links.specifierCache.set(cacheKey, specifier); + } + return specifier; + function getSpecifierCacheKey(path2, mode) { + return mode === void 0 ? path2 : "".concat(mode, "|").concat(path2); + } + } + function symbolToEntityNameNode(symbol) { + var identifier = ts2.factory.createIdentifier(ts2.unescapeLeadingUnderscores(symbol.escapedName)); + return symbol.parent ? ts2.factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier; + } + function symbolToTypeNode(symbol, context2, meaning, overrideTypeArguments) { + var _a2, _b, _c, _d; + var chain3 = lookupSymbolChain(symbol, context2, meaning, !(context2.flags & 16384)); + var isTypeOf = meaning === 111551; + if (ts2.some(chain3[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + var nonRootParts = chain3.length > 1 ? createAccessFromSymbolChain(chain3, chain3.length - 1, 1) : void 0; + var typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain3, 0, context2); + var contextFile = ts2.getSourceFileOfNode(ts2.getOriginalNode(context2.enclosingDeclaration)); + var targetFile = ts2.getSourceFileOfModule(chain3[0]); + var specifier = void 0; + var assertion = void 0; + if (ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeNext) { + if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts2.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) { + specifier = getSpecifierForModuleSymbol(chain3[0], context2, ts2.ModuleKind.ESNext); + assertion = ts2.factory.createImportTypeAssertionContainer(ts2.factory.createAssertClause(ts2.factory.createNodeArray([ + ts2.factory.createAssertEntry(ts2.factory.createStringLiteral("resolution-mode"), ts2.factory.createStringLiteral("import")) + ]))); + (_b = (_a2 = context2.tracker).reportImportTypeNodeResolutionModeOverride) === null || _b === void 0 ? void 0 : _b.call(_a2); + } + } + if (!specifier) { + specifier = getSpecifierForModuleSymbol(chain3[0], context2); + } + if (!(context2.flags & 67108864) && ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) { + var oldSpecifier = specifier; + if (ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeNext) { + var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts2.ModuleKind.ESNext ? ts2.ModuleKind.CommonJS : ts2.ModuleKind.ESNext; + specifier = getSpecifierForModuleSymbol(chain3[0], context2, swappedMode); + if (specifier.indexOf("/node_modules/") >= 0) { + specifier = oldSpecifier; + } else { + assertion = ts2.factory.createImportTypeAssertionContainer(ts2.factory.createAssertClause(ts2.factory.createNodeArray([ + ts2.factory.createAssertEntry(ts2.factory.createStringLiteral("resolution-mode"), ts2.factory.createStringLiteral(swappedMode === ts2.ModuleKind.ESNext ? "import" : "require")) + ]))); + (_d = (_c = context2.tracker).reportImportTypeNodeResolutionModeOverride) === null || _d === void 0 ? void 0 : _d.call(_c); + } + } + if (!assertion) { + context2.encounteredError = true; + if (context2.tracker.reportLikelyUnsafeImportRequiredError) { + context2.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier); + } + } + } + var lit = ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(specifier)); + if (context2.tracker.trackExternalModuleSymbolOfImportTypeNode) + context2.tracker.trackExternalModuleSymbolOfImportTypeNode(chain3[0]); + context2.approximateLength += specifier.length + 10; + if (!nonRootParts || ts2.isEntityName(nonRootParts)) { + if (nonRootParts) { + var lastId = ts2.isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; + lastId.typeArguments = void 0; + } + return ts2.factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf); + } else { + var splitNode = getTopmostIndexedAccessType(nonRootParts); + var qualifier = splitNode.objectType.typeName; + return ts2.factory.createIndexedAccessTypeNode(ts2.factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType); + } + } + var entityName = createAccessFromSymbolChain(chain3, chain3.length - 1, 0); + if (ts2.isIndexedAccessTypeNode(entityName)) { + return entityName; + } + if (isTypeOf) { + return ts2.factory.createTypeQueryNode(entityName); + } else { + var lastId = ts2.isIdentifier(entityName) ? entityName : entityName.right; + var lastTypeArgs = lastId.typeArguments; + lastId.typeArguments = void 0; + return ts2.factory.createTypeReferenceNode(entityName, lastTypeArgs); + } + function createAccessFromSymbolChain(chain4, index4, stopper) { + var typeParameterNodes2 = index4 === chain4.length - 1 ? overrideTypeArguments : lookupTypeParameterNodes(chain4, index4, context2); + var symbol2 = chain4[index4]; + var parent2 = chain4[index4 - 1]; + var symbolName; + if (index4 === 0) { + context2.flags |= 16777216; + symbolName = getNameOfSymbolAsWritten(symbol2, context2); + context2.approximateLength += (symbolName ? symbolName.length : 0) + 1; + context2.flags ^= 16777216; + } else { + if (parent2 && getExportsOfSymbol(parent2)) { + var exports_2 = getExportsOfSymbol(parent2); + ts2.forEachEntry(exports_2, function(ex, name3) { + if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name3) && name3 !== "export=") { + symbolName = ts2.unescapeLeadingUnderscores(name3); + return true; + } + }); + } + } + if (symbolName === void 0) { + var name2 = ts2.firstDefined(symbol2.declarations, ts2.getNameOfDeclaration); + if (name2 && ts2.isComputedPropertyName(name2) && ts2.isEntityName(name2.expression)) { + var LHS = createAccessFromSymbolChain(chain4, index4 - 1, stopper); + if (ts2.isEntityName(LHS)) { + return ts2.factory.createIndexedAccessTypeNode(ts2.factory.createParenthesizedType(ts2.factory.createTypeQueryNode(LHS)), ts2.factory.createTypeQueryNode(name2.expression)); + } + return LHS; + } + symbolName = getNameOfSymbolAsWritten(symbol2, context2); + } + context2.approximateLength += symbolName.length + 1; + if (!(context2.flags & 16) && parent2 && getMembersOfSymbol(parent2) && getMembersOfSymbol(parent2).get(symbol2.escapedName) && getSymbolIfSameReference(getMembersOfSymbol(parent2).get(symbol2.escapedName), symbol2)) { + var LHS = createAccessFromSymbolChain(chain4, index4 - 1, stopper); + if (ts2.isIndexedAccessTypeNode(LHS)) { + return ts2.factory.createIndexedAccessTypeNode(LHS, ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(symbolName))); + } else { + return ts2.factory.createIndexedAccessTypeNode(ts2.factory.createTypeReferenceNode(LHS, typeParameterNodes2), ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(symbolName))); + } + } + var identifier = ts2.setEmitFlags( + ts2.factory.createIdentifier(symbolName, typeParameterNodes2), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ); + identifier.symbol = symbol2; + if (index4 > stopper) { + var LHS = createAccessFromSymbolChain(chain4, index4 - 1, stopper); + if (!ts2.isEntityName(LHS)) { + return ts2.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable"); + } + return ts2.factory.createQualifiedName(LHS, identifier); + } + return identifier; + } + } + function typeParameterShadowsNameInScope(escapedName, context2, type3) { + var result2 = resolveName( + context2.enclosingDeclaration, + escapedName, + 788968, + /*nameNotFoundArg*/ + void 0, + escapedName, + /*isUse*/ + false + ); + if (result2) { + if (result2.flags & 262144 && result2 === type3.symbol) { + return false; + } + return true; + } + return false; + } + function typeParameterToName(type3, context2) { + var _a2, _b; + if (context2.flags & 4 && context2.typeParameterNames) { + var cached = context2.typeParameterNames.get(getTypeId(type3)); + if (cached) { + return cached; + } + } + var result2 = symbolToName( + type3.symbol, + context2, + 788968, + /*expectsIdentifier*/ + true + ); + if (!(result2.kind & 79)) { + return ts2.factory.createIdentifier("(Missing type parameter)"); + } + if (context2.flags & 4) { + var rawtext = result2.escapedText; + var i7 = ((_a2 = context2.typeParameterNamesByTextNextNameCount) === null || _a2 === void 0 ? void 0 : _a2.get(rawtext)) || 0; + var text = rawtext; + while (((_b = context2.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context2, type3)) { + i7++; + text = "".concat(rawtext, "_").concat(i7); + } + if (text !== rawtext) { + result2 = ts2.factory.createIdentifier(text, result2.typeArguments); + } + (context2.typeParameterNamesByTextNextNameCount || (context2.typeParameterNamesByTextNextNameCount = new ts2.Map())).set(rawtext, i7); + (context2.typeParameterNames || (context2.typeParameterNames = new ts2.Map())).set(getTypeId(type3), result2); + (context2.typeParameterNamesByText || (context2.typeParameterNamesByText = new ts2.Set())).add(rawtext); + } + return result2; + } + function symbolToName(symbol, context2, meaning, expectsIdentifier) { + var chain3 = lookupSymbolChain(symbol, context2, meaning); + if (expectsIdentifier && chain3.length !== 1 && !context2.encounteredError && !(context2.flags & 65536)) { + context2.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain3, chain3.length - 1); + function createEntityNameFromSymbolChain(chain4, index4) { + var typeParameterNodes = lookupTypeParameterNodes(chain4, index4, context2); + var symbol2 = chain4[index4]; + if (index4 === 0) { + context2.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol2, context2); + if (index4 === 0) { + context2.flags ^= 16777216; + } + var identifier = ts2.setEmitFlags( + ts2.factory.createIdentifier(symbolName, typeParameterNodes), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ); + identifier.symbol = symbol2; + return index4 > 0 ? ts2.factory.createQualifiedName(createEntityNameFromSymbolChain(chain4, index4 - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context2, meaning) { + var chain3 = lookupSymbolChain(symbol, context2, meaning); + return createExpressionFromSymbolChain(chain3, chain3.length - 1); + function createExpressionFromSymbolChain(chain4, index4) { + var typeParameterNodes = lookupTypeParameterNodes(chain4, index4, context2); + var symbol2 = chain4[index4]; + if (index4 === 0) { + context2.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol2, context2); + if (index4 === 0) { + context2.flags ^= 16777216; + } + var firstChar = symbolName.charCodeAt(0); + if (ts2.isSingleOrDoubleQuote(firstChar) && ts2.some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + return ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context2)); + } + var canUsePropertyAccess = firstChar === 35 ? symbolName.length > 1 && ts2.isIdentifierStart(symbolName.charCodeAt(1), languageVersion) : ts2.isIdentifierStart(firstChar, languageVersion); + if (index4 === 0 || canUsePropertyAccess) { + var identifier = ts2.setEmitFlags( + ts2.factory.createIdentifier(symbolName, typeParameterNodes), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ); + identifier.symbol = symbol2; + return index4 > 0 ? ts2.factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain4, index4 - 1), identifier) : identifier; + } else { + if (firstChar === 91) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts2.isSingleOrDoubleQuote(firstChar) && !(symbol2.flags & 8)) { + expression = ts2.factory.createStringLiteral( + ts2.stripQuotes(symbolName).replace(/\\./g, function(s7) { + return s7.substring(1); + }), + firstChar === 39 + /* CharacterCodes.singleQuote */ + ); + } else if ("" + +symbolName === symbolName) { + expression = ts2.factory.createNumericLiteral(+symbolName); + } + if (!expression) { + expression = ts2.setEmitFlags( + ts2.factory.createIdentifier(symbolName, typeParameterNodes), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ); + expression.symbol = symbol2; + } + return ts2.factory.createElementAccessExpression(createExpressionFromSymbolChain(chain4, index4 - 1), expression); + } + } + } + function isStringNamed(d7) { + var name2 = ts2.getNameOfDeclaration(d7); + return !!name2 && ts2.isStringLiteral(name2); + } + function isSingleQuotedStringNamed(d7) { + var name2 = ts2.getNameOfDeclaration(d7); + return !!(name2 && ts2.isStringLiteral(name2) && (name2.singleQuote || !ts2.nodeIsSynthesized(name2) && ts2.startsWith(ts2.getTextOfNode( + name2, + /*includeTrivia*/ + false + ), "'"))); + } + function getPropertyNameNodeForSymbol(symbol, context2) { + var singleQuote2 = !!ts2.length(symbol.declarations) && ts2.every(symbol.declarations, isSingleQuotedStringNamed); + var fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context2, singleQuote2); + if (fromNameType) { + return fromNameType; + } + var rawName = ts2.unescapeLeadingUnderscores(symbol.escapedName); + var stringNamed = !!ts2.length(symbol.declarations) && ts2.every(symbol.declarations, isStringNamed); + return ts2.createPropertyNameNodeForIdentifierOrLiteral(rawName, ts2.getEmitScriptTarget(compilerOptions), singleQuote2, stringNamed); + } + function getPropertyNameNodeForSymbolFromNameType(symbol, context2, singleQuote2) { + var nameType = getSymbolLinks(symbol).nameType; + if (nameType) { + if (nameType.flags & 384) { + var name2 = "" + nameType.value; + if (!ts2.isIdentifierText(name2, ts2.getEmitScriptTarget(compilerOptions)) && !ts2.isNumericLiteralName(name2)) { + return ts2.factory.createStringLiteral(name2, !!singleQuote2); + } + if (ts2.isNumericLiteralName(name2) && ts2.startsWith(name2, "-")) { + return ts2.factory.createComputedPropertyName(ts2.factory.createNumericLiteral(+name2)); + } + return ts2.createPropertyNameNodeForIdentifierOrLiteral(name2, ts2.getEmitScriptTarget(compilerOptions)); + } + if (nameType.flags & 8192) { + return ts2.factory.createComputedPropertyName(symbolToExpression( + nameType.symbol, + context2, + 111551 + /* SymbolFlags.Value */ + )); + } + } + } + function cloneNodeBuilderContext(context2) { + var initial2 = __assign16({}, context2); + if (initial2.typeParameterNames) { + initial2.typeParameterNames = new ts2.Map(initial2.typeParameterNames); + } + if (initial2.typeParameterNamesByText) { + initial2.typeParameterNamesByText = new ts2.Set(initial2.typeParameterNamesByText); + } + if (initial2.typeParameterSymbolList) { + initial2.typeParameterSymbolList = new ts2.Set(initial2.typeParameterSymbolList); + } + initial2.tracker = wrapSymbolTrackerToReportForContext(initial2, initial2.tracker); + return initial2; + } + function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) { + return symbol.declarations && ts2.find(symbol.declarations, function(s7) { + return !!ts2.getEffectiveTypeAnnotationNode(s7) && (!enclosingDeclaration || !!ts2.findAncestor(s7, function(n7) { + return n7 === enclosingDeclaration; + })); + }); + } + function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type3) { + return !(ts2.getObjectFlags(type3) & 4) || !ts2.isTypeReferenceNode(existing) || ts2.length(existing.typeArguments) >= getMinTypeArgumentCount(type3.target.typeParameters); + } + function serializeTypeForDeclaration(context2, type3, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { + if (!isErrorType(type3) && enclosingDeclaration) { + var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration); + if (declWithExistingAnnotation && !ts2.isFunctionLikeDeclaration(declWithExistingAnnotation) && !ts2.isGetAccessorDeclaration(declWithExistingAnnotation)) { + var existing = ts2.getEffectiveTypeAnnotationNode(declWithExistingAnnotation); + if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type3) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type3)) { + var result_6 = serializeExistingTypeNode(context2, existing, includePrivateSymbol, bundled); + if (result_6) { + return result_6; + } + } + } + } + var oldFlags = context2.flags; + if (type3.flags & 8192 && type3.symbol === symbol && (!context2.enclosingDeclaration || ts2.some(symbol.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) === ts2.getSourceFileOfNode(context2.enclosingDeclaration); + }))) { + context2.flags |= 1048576; + } + var result2 = typeToTypeNodeHelper(type3, context2); + context2.flags = oldFlags; + return result2; + } + function typeNodeIsEquivalentToType(typeNode, annotatedDeclaration, type3) { + var typeFromTypeNode = getTypeFromTypeNode(typeNode); + if (typeFromTypeNode === type3) { + return true; + } + if (ts2.isParameter(annotatedDeclaration) && annotatedDeclaration.questionToken) { + return getTypeWithFacts( + type3, + 524288 + /* TypeFacts.NEUndefined */ + ) === typeFromTypeNode; + } + return false; + } + function serializeReturnTypeForSignature(context2, type3, signature, includePrivateSymbol, bundled) { + if (!isErrorType(type3) && context2.enclosingDeclaration) { + var annotation = signature.declaration && ts2.getEffectiveReturnTypeNode(signature.declaration); + if (!!ts2.findAncestor(annotation, function(n7) { + return n7 === context2.enclosingDeclaration; + }) && annotation) { + var annotated = getTypeFromTypeNode(annotation); + var thisInstantiated = annotated.flags & 262144 && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; + if (thisInstantiated === type3 && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type3)) { + var result2 = serializeExistingTypeNode(context2, annotation, includePrivateSymbol, bundled); + if (result2) { + return result2; + } + } + } + } + return typeToTypeNodeHelper(type3, context2); + } + function trackExistingEntityName(node, context2, includePrivateSymbol) { + var _a2, _b; + var introducesError = false; + var leftmost = ts2.getFirstIdentifier(node); + if (ts2.isInJSFile(node) && (ts2.isExportsIdentifier(leftmost) || ts2.isModuleExportsAccessExpression(leftmost.parent) || ts2.isQualifiedName(leftmost.parent) && ts2.isModuleIdentifier(leftmost.parent.left) && ts2.isExportsIdentifier(leftmost.parent.right))) { + introducesError = true; + return { introducesError, node }; + } + var sym = resolveEntityName( + leftmost, + 67108863, + /*ignoreErrors*/ + true, + /*dontResolveALias*/ + true + ); + if (sym) { + if (isSymbolAccessible( + sym, + context2.enclosingDeclaration, + 67108863, + /*shouldComputeAliasesToMakeVisible*/ + false + ).accessibility !== 0) { + introducesError = true; + } else { + (_b = (_a2 = context2.tracker) === null || _a2 === void 0 ? void 0 : _a2.trackSymbol) === null || _b === void 0 ? void 0 : _b.call( + _a2, + sym, + context2.enclosingDeclaration, + 67108863 + /* SymbolFlags.All */ + ); + includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym); + } + if (ts2.isIdentifier(node)) { + var type3 = getDeclaredTypeOfSymbol(sym); + var name2 = sym.flags & 262144 && !isTypeSymbolAccessible(type3.symbol, context2.enclosingDeclaration) ? typeParameterToName(type3, context2) : ts2.factory.cloneNode(node); + name2.symbol = sym; + return { introducesError, node: ts2.setEmitFlags( + ts2.setOriginalNode(name2, node), + 16777216 + /* EmitFlags.NoAsciiEscaping */ + ) }; + } + } + return { introducesError, node }; + } + function serializeExistingTypeNode(context2, existing, includePrivateSymbol, bundled) { + if (cancellationToken && cancellationToken.throwIfCancellationRequested) { + cancellationToken.throwIfCancellationRequested(); + } + var hadError = false; + var file = ts2.getSourceFileOfNode(existing); + var transformed = ts2.visitNode(existing, visitExistingNodeTreeSymbols); + if (hadError) { + return void 0; + } + return transformed === existing ? ts2.setTextRange(ts2.factory.cloneNode(existing), existing) : transformed; + function visitExistingNodeTreeSymbols(node) { + if (ts2.isJSDocAllType(node) || node.kind === 322) { + return ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + if (ts2.isJSDocUnknownType(node)) { + return ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + ); + } + if (ts2.isJSDocNullableType(node)) { + return ts2.factory.createUnionTypeNode([ts2.visitNode(node.type, visitExistingNodeTreeSymbols), ts2.factory.createLiteralTypeNode(ts2.factory.createNull())]); + } + if (ts2.isJSDocOptionalType(node)) { + return ts2.factory.createUnionTypeNode([ts2.visitNode(node.type, visitExistingNodeTreeSymbols), ts2.factory.createKeywordTypeNode( + 155 + /* SyntaxKind.UndefinedKeyword */ + )]); + } + if (ts2.isJSDocNonNullableType(node)) { + return ts2.visitNode(node.type, visitExistingNodeTreeSymbols); + } + if (ts2.isJSDocVariadicType(node)) { + return ts2.factory.createArrayTypeNode(ts2.visitNode(node.type, visitExistingNodeTreeSymbols)); + } + if (ts2.isJSDocTypeLiteral(node)) { + return ts2.factory.createTypeLiteralNode(ts2.map(node.jsDocPropertyTags, function(t8) { + var name2 = ts2.isIdentifier(t8.name) ? t8.name : t8.name.right; + var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name2.escapedText); + var overrideTypeNode = typeViaParent && t8.typeExpression && getTypeFromTypeNode(t8.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context2) : void 0; + return ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + name2, + t8.isBracketed || t8.typeExpression && ts2.isJSDocOptionalType(t8.typeExpression.type) ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + overrideTypeNode || t8.typeExpression && ts2.visitNode(t8.typeExpression.type, visitExistingNodeTreeSymbols) || ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ) + ); + })); + } + if (ts2.isTypeReferenceNode(node) && ts2.isIdentifier(node.typeName) && node.typeName.escapedText === "") { + return ts2.setOriginalNode(ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ), node); + } + if ((ts2.isExpressionWithTypeArguments(node) || ts2.isTypeReferenceNode(node)) && ts2.isJSDocIndexSignature(node)) { + return ts2.factory.createTypeLiteralNode([ts2.factory.createIndexSignature( + /*modifiers*/ + void 0, + [ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotdotdotToken*/ + void 0, + "x", + /*questionToken*/ + void 0, + ts2.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols) + )], + ts2.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols) + )]); + } + if (ts2.isJSDocFunctionType(node)) { + if (ts2.isJSDocConstructSignature(node)) { + var newTypeNode_1; + return ts2.factory.createConstructorTypeNode( + /*modifiers*/ + void 0, + ts2.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), + ts2.mapDefined(node.parameters, function(p7, i7) { + return p7.name && ts2.isIdentifier(p7.name) && p7.name.escapedText === "new" ? (newTypeNode_1 = p7.type, void 0) : ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + getEffectiveDotDotDotForParameter(p7), + getNameForJSDocFunctionParameter(p7, i7), + p7.questionToken, + ts2.visitNode(p7.type, visitExistingNodeTreeSymbols), + /*initializer*/ + void 0 + ); + }), + ts2.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ) + ); + } else { + return ts2.factory.createFunctionTypeNode(ts2.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts2.map(node.parameters, function(p7, i7) { + return ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + getEffectiveDotDotDotForParameter(p7), + getNameForJSDocFunctionParameter(p7, i7), + p7.questionToken, + ts2.visitNode(p7.type, visitExistingNodeTreeSymbols), + /*initializer*/ + void 0 + ); + }), ts2.visitNode(node.type, visitExistingNodeTreeSymbols) || ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + )); + } + } + if (ts2.isTypeReferenceNode(node) && ts2.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName( + node, + 788968, + /*ignoreErrors*/ + true + ))) { + return ts2.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context2), node); + } + if (ts2.isLiteralImportTypeNode(node)) { + var nodeSymbol = getNodeLinks(node).resolvedSymbol; + if (ts2.isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic + (!node.isTypeOf && !(nodeSymbol.flags & 788968) || // The import type had type arguments autofilled by js fallback logic + !(ts2.length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) { + return ts2.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context2), node); + } + return ts2.factory.updateImportTypeNode(node, ts2.factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), node.assertions, node.qualifier, ts2.visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, ts2.isTypeNode), node.isTypeOf); + } + if (ts2.isEntityName(node) || ts2.isEntityNameExpression(node)) { + var _a2 = trackExistingEntityName(node, context2, includePrivateSymbol), introducesError = _a2.introducesError, result2 = _a2.node; + hadError = hadError || introducesError; + if (result2 !== node) { + return result2; + } + } + if (file && ts2.isTupleTypeNode(node) && ts2.getLineAndCharacterOfPosition(file, node.pos).line === ts2.getLineAndCharacterOfPosition(file, node.end).line) { + ts2.setEmitFlags( + node, + 1 + /* EmitFlags.SingleLine */ + ); + } + return ts2.visitEachChild(node, visitExistingNodeTreeSymbols, ts2.nullTransformationContext); + function getEffectiveDotDotDotForParameter(p7) { + return p7.dotDotDotToken || (p7.type && ts2.isJSDocVariadicType(p7.type) ? ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ) : void 0); + } + function getNameForJSDocFunctionParameter(p7, index4) { + return p7.name && ts2.isIdentifier(p7.name) && p7.name.escapedText === "this" ? "this" : getEffectiveDotDotDotForParameter(p7) ? "args" : "arg".concat(index4); + } + function rewriteModuleSpecifier(parent2, lit) { + if (bundled) { + if (context2.tracker && context2.tracker.moduleResolverHost) { + var targetFile = getExternalModuleFileFromDeclaration(parent2); + if (targetFile) { + var getCanonicalFileName = ts2.createGetCanonicalFileName(!!host.useCaseSensitiveFileNames); + var resolverHost = { + getCanonicalFileName, + getCurrentDirectory: function() { + return context2.tracker.moduleResolverHost.getCurrentDirectory(); + }, + getCommonSourceDirectory: function() { + return context2.tracker.moduleResolverHost.getCommonSourceDirectory(); + } + }; + var newName = ts2.getResolvedExternalModuleName(resolverHost, targetFile); + return ts2.factory.createStringLiteral(newName); + } + } + } else { + if (context2.tracker && context2.tracker.trackExternalModuleSymbolOfImportTypeNode) { + var moduleSym = resolveExternalModuleNameWorker( + lit, + lit, + /*moduleNotFoundError*/ + void 0 + ); + if (moduleSym) { + context2.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym); + } + } + } + return lit; + } + } + } + function symbolTableToDeclarationStatements(symbolTable, context2, bundled) { + var serializePropertySymbolForClass = makeSerializePropertySymbol( + ts2.factory.createPropertyDeclaration, + 171, + /*useAcessors*/ + true + ); + var serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( + function(mods, name2, question, type3) { + return ts2.factory.createPropertySignature(mods, name2, question, type3); + }, + 170, + /*useAcessors*/ + false + ); + var enclosingDeclaration = context2.enclosingDeclaration; + var results = []; + var visitedSymbols = new ts2.Set(); + var deferredPrivatesStack = []; + var oldcontext = context2; + context2 = __assign16(__assign16({}, oldcontext), { usedSymbolNames: new ts2.Set(oldcontext.usedSymbolNames), remappedSymbolNames: new ts2.Map(), tracker: __assign16(__assign16({}, oldcontext.tracker), { trackSymbol: function(sym, decl, meaning) { + var accessibleResult = isSymbolAccessible( + sym, + decl, + meaning, + /*computeAliases*/ + false + ); + if (accessibleResult.accessibility === 0) { + var chain3 = lookupSymbolChainWorker(sym, context2, meaning); + if (!(sym.flags & 4)) { + includePrivateSymbol(chain3[0]); + } + } else if (oldcontext.tracker && oldcontext.tracker.trackSymbol) { + return oldcontext.tracker.trackSymbol(sym, decl, meaning); + } + return false; + } }) }); + context2.tracker = wrapSymbolTrackerToReportForContext(context2, context2.tracker); + ts2.forEachEntry(symbolTable, function(symbol, name2) { + var baseName = ts2.unescapeLeadingUnderscores(name2); + void getInternalSymbolName(symbol, baseName); + }); + var addingDeclare = !bundled; + var exportEquals = symbolTable.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152) { + symbolTable = ts2.createSymbolTable(); + symbolTable.set("export=", exportEquals); + } + visitSymbolTable(symbolTable); + return mergeRedundantStatements(results); + function isIdentifierAndNotUndefined(node) { + return !!node && node.kind === 79; + } + function getNamesOfDeclaration(statement) { + if (ts2.isVariableStatement(statement)) { + return ts2.filter(ts2.map(statement.declarationList.declarations, ts2.getNameOfDeclaration), isIdentifierAndNotUndefined); + } + return ts2.filter([ts2.getNameOfDeclaration(statement)], isIdentifierAndNotUndefined); + } + function flattenExportAssignedNamespace(statements) { + var exportAssignment = ts2.find(statements, ts2.isExportAssignment); + var nsIndex = ts2.findIndex(statements, ts2.isModuleDeclaration); + var ns = nsIndex !== -1 ? statements[nsIndex] : void 0; + if (ns && exportAssignment && exportAssignment.isExportEquals && ts2.isIdentifier(exportAssignment.expression) && ts2.isIdentifier(ns.name) && ts2.idText(ns.name) === ts2.idText(exportAssignment.expression) && ns.body && ts2.isModuleBlock(ns.body)) { + var excessExports = ts2.filter(statements, function(s7) { + return !!(ts2.getEffectiveModifierFlags(s7) & 1); + }); + var name_3 = ns.name; + var body = ns.body; + if (ts2.length(excessExports)) { + ns = ts2.factory.updateModuleDeclaration(ns, ns.modifiers, ns.name, body = ts2.factory.updateModuleBlock(body, ts2.factory.createNodeArray(__spreadArray9(__spreadArray9([], ns.body.statements, true), [ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports(ts2.map(ts2.flatMap(excessExports, function(e10) { + return getNamesOfDeclaration(e10); + }), function(id) { + return ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*alias*/ + void 0, + id + ); + })), + /*moduleSpecifier*/ + void 0 + )], false)))); + statements = __spreadArray9(__spreadArray9(__spreadArray9([], statements.slice(0, nsIndex), true), [ns], false), statements.slice(nsIndex + 1), true); + } + if (!ts2.find(statements, function(s7) { + return s7 !== ns && ts2.nodeHasName(s7, name_3); + })) { + results = []; + var mixinExportFlag_1 = !ts2.some(body.statements, function(s7) { + return ts2.hasSyntacticModifier( + s7, + 1 + /* ModifierFlags.Export */ + ) || ts2.isExportAssignment(s7) || ts2.isExportDeclaration(s7); + }); + ts2.forEach(body.statements, function(s7) { + addResult( + s7, + mixinExportFlag_1 ? 1 : 0 + /* ModifierFlags.None */ + ); + }); + statements = __spreadArray9(__spreadArray9([], ts2.filter(statements, function(s7) { + return s7 !== ns && s7 !== exportAssignment; + }), true), results, true); + } + } + return statements; + } + function mergeExportDeclarations(statements) { + var exports29 = ts2.filter(statements, function(d7) { + return ts2.isExportDeclaration(d7) && !d7.moduleSpecifier && !!d7.exportClause && ts2.isNamedExports(d7.exportClause); + }); + if (ts2.length(exports29) > 1) { + var nonExports = ts2.filter(statements, function(d7) { + return !ts2.isExportDeclaration(d7) || !!d7.moduleSpecifier || !d7.exportClause; + }); + statements = __spreadArray9(__spreadArray9([], nonExports, true), [ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports(ts2.flatMap(exports29, function(e10) { + return ts2.cast(e10.exportClause, ts2.isNamedExports).elements; + })), + /*moduleSpecifier*/ + void 0 + )], false); + } + var reexports = ts2.filter(statements, function(d7) { + return ts2.isExportDeclaration(d7) && !!d7.moduleSpecifier && !!d7.exportClause && ts2.isNamedExports(d7.exportClause); + }); + if (ts2.length(reexports) > 1) { + var groups = ts2.group(reexports, function(decl) { + return ts2.isStringLiteral(decl.moduleSpecifier) ? ">" + decl.moduleSpecifier.text : ">"; + }); + if (groups.length !== reexports.length) { + var _loop_9 = function(group_12) { + if (group_12.length > 1) { + statements = __spreadArray9(__spreadArray9([], ts2.filter(statements, function(s7) { + return group_12.indexOf(s7) === -1; + }), true), [ + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports(ts2.flatMap(group_12, function(e10) { + return ts2.cast(e10.exportClause, ts2.isNamedExports).elements; + })), + group_12[0].moduleSpecifier + ) + ], false); + } + }; + for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) { + var group_1 = groups_1[_i]; + _loop_9(group_1); + } + } + } + return statements; + } + function inlineExportModifiers(statements) { + var index4 = ts2.findIndex(statements, function(d7) { + return ts2.isExportDeclaration(d7) && !d7.moduleSpecifier && !d7.assertClause && !!d7.exportClause && ts2.isNamedExports(d7.exportClause); + }); + if (index4 >= 0) { + var exportDecl = statements[index4]; + var replacements = ts2.mapDefined(exportDecl.exportClause.elements, function(e10) { + if (!e10.propertyName) { + var indices = ts2.indicesOf(statements); + var associatedIndices = ts2.filter(indices, function(i7) { + return ts2.nodeHasName(statements[i7], e10.name); + }); + if (ts2.length(associatedIndices) && ts2.every(associatedIndices, function(i7) { + return ts2.canHaveExportModifier(statements[i7]); + })) { + for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) { + var index_1 = associatedIndices_1[_i]; + statements[index_1] = addExportModifier(statements[index_1]); + } + return void 0; + } + } + return e10; + }); + if (!ts2.length(replacements)) { + ts2.orderedRemoveItemAt(statements, index4); + } else { + statements[index4] = ts2.factory.updateExportDeclaration(exportDecl, exportDecl.modifiers, exportDecl.isTypeOnly, ts2.factory.updateNamedExports(exportDecl.exportClause, replacements), exportDecl.moduleSpecifier, exportDecl.assertClause); + } + } + return statements; + } + function mergeRedundantStatements(statements) { + statements = flattenExportAssignedNamespace(statements); + statements = mergeExportDeclarations(statements); + statements = inlineExportModifiers(statements); + if (enclosingDeclaration && (ts2.isSourceFile(enclosingDeclaration) && ts2.isExternalOrCommonJsModule(enclosingDeclaration) || ts2.isModuleDeclaration(enclosingDeclaration)) && (!ts2.some(statements, ts2.isExternalModuleIndicator) || !ts2.hasScopeMarker(statements) && ts2.some(statements, ts2.needsScopeMarker))) { + statements.push(ts2.createEmptyExports(ts2.factory)); + } + return statements; + } + function addExportModifier(node) { + var flags = (ts2.getEffectiveModifierFlags(node) | 1) & ~2; + return ts2.factory.updateModifiers(node, flags); + } + function removeExportModifier(node) { + var flags = ts2.getEffectiveModifierFlags(node) & ~1; + return ts2.factory.updateModifiers(node, flags); + } + function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) { + if (!suppressNewPrivateContext) { + deferredPrivatesStack.push(new ts2.Map()); + } + symbolTable2.forEach(function(symbol) { + serializeSymbol( + symbol, + /*isPrivate*/ + false, + !!propertyAsAlias + ); + }); + if (!suppressNewPrivateContext) { + deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach(function(symbol) { + serializeSymbol( + symbol, + /*isPrivate*/ + true, + !!propertyAsAlias + ); + }); + deferredPrivatesStack.pop(); + } + } + function serializeSymbol(symbol, isPrivate, propertyAsAlias) { + var visitedSym = getMergedSymbol(symbol); + if (visitedSymbols.has(getSymbolId(visitedSym))) { + return; + } + visitedSymbols.add(getSymbolId(visitedSym)); + var skipMembershipCheck = !isPrivate; + if (skipMembershipCheck || !!ts2.length(symbol.declarations) && ts2.some(symbol.declarations, function(d7) { + return !!ts2.findAncestor(d7, function(n7) { + return n7 === enclosingDeclaration; + }); + })) { + var oldContext = context2; + context2 = cloneNodeBuilderContext(context2); + serializeSymbolWorker(symbol, isPrivate, propertyAsAlias); + if (context2.reportedDiagnostic) { + oldcontext.reportedDiagnostic = context2.reportedDiagnostic; + } + context2 = oldContext; + } + } + function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) { + var _a2, _b, _c, _d; + var symbolName = ts2.unescapeLeadingUnderscores(symbol.escapedName); + var isDefault = symbol.escapedName === "default"; + if (isPrivate && !(context2.flags & 131072) && ts2.isStringANonContextualKeyword(symbolName) && !isDefault) { + context2.encounteredError = true; + return; + } + var needsPostExportDefault = isDefault && !!(symbol.flags & -113 || symbol.flags & 16 && ts2.length(getPropertiesOfType(getTypeOfSymbol(symbol)))) && !(symbol.flags & 2097152); + var needsExportDeclaration = !needsPostExportDefault && !isPrivate && ts2.isStringANonContextualKeyword(symbolName) && !isDefault; + if (needsPostExportDefault || needsExportDeclaration) { + isPrivate = true; + } + var modifierFlags = (!isPrivate ? 1 : 0) | (isDefault && !needsPostExportDefault ? 1024 : 0); + var isConstMergedWithNS = symbol.flags & 1536 && symbol.flags & (2 | 1 | 4) && symbol.escapedName !== "export="; + var isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol); + if (symbol.flags & (16 | 8192) || isConstMergedWithNSPrintableAsSignatureMerge) { + serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName), modifierFlags); + } + if (symbol.flags & 524288) { + serializeTypeAlias(symbol, symbolName, modifierFlags); + } + if (symbol.flags & (2 | 1 | 4) && symbol.escapedName !== "export=" && !(symbol.flags & 4194304) && !(symbol.flags & 32) && !(symbol.flags & 8192) && !isConstMergedWithNSPrintableAsSignatureMerge) { + if (propertyAsAlias) { + var createdExport = serializeMaybeAliasAssignment(symbol); + if (createdExport) { + needsExportDeclaration = false; + needsPostExportDefault = false; + } + } else { + var type3 = getTypeOfSymbol(symbol); + var localName = getInternalSymbolName(symbol, symbolName); + if (!(symbol.flags & 16) && isTypeRepresentableAsFunctionNamespaceMerge(type3, symbol)) { + serializeAsFunctionNamespaceMerge(type3, symbol, localName, modifierFlags); + } else { + var flags = !(symbol.flags & 2) ? ((_a2 = symbol.parent) === null || _a2 === void 0 ? void 0 : _a2.valueDeclaration) && ts2.isSourceFile((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration) ? 2 : void 0 : isConstVariable(symbol) ? 2 : 1; + var name2 = needsPostExportDefault || !(symbol.flags & 4) ? localName : getUnusedName(localName, symbol); + var textRange = symbol.declarations && ts2.find(symbol.declarations, function(d7) { + return ts2.isVariableDeclaration(d7); + }); + if (textRange && ts2.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { + textRange = textRange.parent.parent; + } + var propertyAccessRequire = (_c = symbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts2.isPropertyAccessExpression); + if (propertyAccessRequire && ts2.isBinaryExpression(propertyAccessRequire.parent) && ts2.isIdentifier(propertyAccessRequire.parent.right) && ((_d = type3.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration) && ts2.isSourceFile(type3.symbol.valueDeclaration)) { + var alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right; + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + alias, + localName + )]) + ), + 0 + /* ModifierFlags.None */ + ); + context2.tracker.trackSymbol( + type3.symbol, + context2.enclosingDeclaration, + 111551 + /* SymbolFlags.Value */ + ); + } else { + var statement = ts2.setTextRange(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList([ + ts2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + serializeTypeForDeclaration(context2, type3, symbol, enclosingDeclaration, includePrivateSymbol, bundled) + ) + ], flags) + ), textRange); + addResult(statement, name2 !== localName ? modifierFlags & ~1 : modifierFlags); + if (name2 !== localName && !isPrivate) { + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + name2, + localName + )]) + ), + 0 + /* ModifierFlags.None */ + ); + needsExportDeclaration = false; + needsPostExportDefault = false; + } + } + } + } + } + if (symbol.flags & 384) { + serializeEnum(symbol, symbolName, modifierFlags); + } + if (symbol.flags & 32) { + if (symbol.flags & 4 && symbol.valueDeclaration && ts2.isBinaryExpression(symbol.valueDeclaration.parent) && ts2.isClassExpression(symbol.valueDeclaration.parent.right)) { + serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags); + } else { + serializeAsClass(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags); + } + } + if (symbol.flags & (512 | 1024) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol)) || isConstMergedWithNSPrintableAsSignatureMerge) { + serializeModule(symbol, symbolName, modifierFlags); + } + if (symbol.flags & 64 && !(symbol.flags & 32)) { + serializeInterface(symbol, symbolName, modifierFlags); + } + if (symbol.flags & 2097152) { + serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName), modifierFlags); + } + if (symbol.flags & 4 && symbol.escapedName === "export=") { + serializeMaybeAliasAssignment(symbol); + } + if (symbol.flags & 8388608) { + if (symbol.declarations) { + for (var _i = 0, _e2 = symbol.declarations; _i < _e2.length; _i++) { + var node = _e2[_i]; + var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + if (!resolvedModule) + continue; + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + /*exportClause*/ + void 0, + ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context2)) + ), + 0 + /* ModifierFlags.None */ + ); + } + } + } + if (needsPostExportDefault) { + addResult( + ts2.factory.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportAssignment*/ + false, + ts2.factory.createIdentifier(getInternalSymbolName(symbol, symbolName)) + ), + 0 + /* ModifierFlags.None */ + ); + } else if (needsExportDeclaration) { + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + getInternalSymbolName(symbol, symbolName), + symbolName + )]) + ), + 0 + /* ModifierFlags.None */ + ); + } + } + function includePrivateSymbol(symbol) { + if (ts2.some(symbol.declarations, ts2.isParameterDeclaration)) + return; + ts2.Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]); + getUnusedName(ts2.unescapeLeadingUnderscores(symbol.escapedName), symbol); + var isExternalImportAlias = !!(symbol.flags & 2097152) && !ts2.some(symbol.declarations, function(d7) { + return !!ts2.findAncestor(d7, ts2.isExportDeclaration) || ts2.isNamespaceExport(d7) || ts2.isImportEqualsDeclaration(d7) && !ts2.isExternalModuleReference(d7.moduleReference); + }); + deferredPrivatesStack[isExternalImportAlias ? 0 : deferredPrivatesStack.length - 1].set(getSymbolId(symbol), symbol); + } + function isExportingScope(enclosingDeclaration2) { + return ts2.isSourceFile(enclosingDeclaration2) && (ts2.isExternalOrCommonJsModule(enclosingDeclaration2) || ts2.isJsonSourceFile(enclosingDeclaration2)) || ts2.isAmbientModule(enclosingDeclaration2) && !ts2.isGlobalScopeAugmentation(enclosingDeclaration2); + } + function addResult(node, additionalModifierFlags) { + if (ts2.canHaveModifiers(node)) { + var newModifierFlags = 0; + var enclosingDeclaration_1 = context2.enclosingDeclaration && (ts2.isJSDocTypeAlias(context2.enclosingDeclaration) ? ts2.getSourceFileOfNode(context2.enclosingDeclaration) : context2.enclosingDeclaration); + if (additionalModifierFlags & 1 && enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts2.isModuleDeclaration(enclosingDeclaration_1)) && ts2.canHaveExportModifier(node)) { + newModifierFlags |= 1; + } + if (addingDeclare && !(newModifierFlags & 1) && (!enclosingDeclaration_1 || !(enclosingDeclaration_1.flags & 16777216)) && (ts2.isEnumDeclaration(node) || ts2.isVariableStatement(node) || ts2.isFunctionDeclaration(node) || ts2.isClassDeclaration(node) || ts2.isModuleDeclaration(node))) { + newModifierFlags |= 2; + } + if (additionalModifierFlags & 1024 && (ts2.isClassDeclaration(node) || ts2.isInterfaceDeclaration(node) || ts2.isFunctionDeclaration(node))) { + newModifierFlags |= 1024; + } + if (newModifierFlags) { + node = ts2.factory.updateModifiers(node, newModifierFlags | ts2.getEffectiveModifierFlags(node)); + } + } + results.push(node); + } + function serializeTypeAlias(symbol, symbolName, modifierFlags) { + var _a2; + var aliasType = getDeclaredTypeOfTypeAlias(symbol); + var typeParams = getSymbolLinks(symbol).typeParameters; + var typeParamDecls = ts2.map(typeParams, function(p7) { + return typeParameterToDeclaration(p7, context2); + }); + var jsdocAliasDecl = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isJSDocTypeAlias); + var commentText = ts2.getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0); + var oldFlags = context2.flags; + context2.flags |= 8388608; + var oldEnclosingDecl = context2.enclosingDeclaration; + context2.enclosingDeclaration = jsdocAliasDecl; + var typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && ts2.isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && serializeExistingTypeNode(context2, jsdocAliasDecl.typeExpression.type, includePrivateSymbol, bundled) || typeToTypeNodeHelper(aliasType, context2); + addResult(ts2.setSyntheticLeadingComments(ts2.factory.createTypeAliasDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName), + typeParamDecls, + typeNode + ), !commentText ? [] : [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]), modifierFlags); + context2.flags = oldFlags; + context2.enclosingDeclaration = oldEnclosingDecl; + } + function serializeInterface(symbol, symbolName, modifierFlags) { + var interfaceType = getDeclaredTypeOfClassOrInterface(symbol); + var localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + var typeParamDecls = ts2.map(localParams, function(p7) { + return typeParameterToDeclaration(p7, context2); + }); + var baseTypes = getBaseTypes(interfaceType); + var baseType = ts2.length(baseTypes) ? getIntersectionType(baseTypes) : void 0; + var members = ts2.flatMap(getPropertiesOfType(interfaceType), function(p7) { + return serializePropertySymbolForInterface(p7, baseType); + }); + var callSignatures = serializeSignatures( + 0, + interfaceType, + baseType, + 176 + /* SyntaxKind.CallSignature */ + ); + var constructSignatures = serializeSignatures( + 1, + interfaceType, + baseType, + 177 + /* SyntaxKind.ConstructSignature */ + ); + var indexSignatures = serializeIndexSignatures(interfaceType, baseType); + var heritageClauses = !ts2.length(baseTypes) ? void 0 : [ts2.factory.createHeritageClause(94, ts2.mapDefined(baseTypes, function(b8) { + return trySerializeAsTypeReference( + b8, + 111551 + /* SymbolFlags.Value */ + ); + }))]; + addResult(ts2.factory.createInterfaceDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName), + typeParamDecls, + heritageClauses, + __spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], indexSignatures, true), constructSignatures, true), callSignatures, true), members, true) + ), modifierFlags); + } + function getNamespaceMembersForSerialization(symbol) { + return !symbol.exports ? [] : ts2.filter(ts2.arrayFrom(symbol.exports.values()), isNamespaceMember); + } + function isTypeOnlyNamespace(symbol) { + return ts2.every(getNamespaceMembersForSerialization(symbol), function(m7) { + return !(getAllSymbolFlags(resolveSymbol(m7)) & 111551); + }); + } + function serializeModule(symbol, symbolName, modifierFlags) { + var members = getNamespaceMembersForSerialization(symbol); + var locationMap = ts2.arrayToMultiMap(members, function(m7) { + return m7.parent && m7.parent === symbol ? "real" : "merged"; + }); + var realMembers = locationMap.get("real") || ts2.emptyArray; + var mergedMembers = locationMap.get("merged") || ts2.emptyArray; + if (ts2.length(realMembers)) { + var localName = getInternalSymbolName(symbol, symbolName); + serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 | 67108864))); + } + if (ts2.length(mergedMembers)) { + var containingFile_1 = ts2.getSourceFileOfNode(context2.enclosingDeclaration); + var localName = getInternalSymbolName(symbol, symbolName); + var nsBody = ts2.factory.createModuleBlock([ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports(ts2.mapDefined(ts2.filter(mergedMembers, function(n7) { + return n7.escapedName !== "export="; + }), function(s7) { + var _a2, _b; + var name2 = ts2.unescapeLeadingUnderscores(s7.escapedName); + var localName2 = getInternalSymbolName(s7, name2); + var aliasDecl = s7.declarations && getDeclarationOfAliasSymbol(s7); + if (containingFile_1 && (aliasDecl ? containingFile_1 !== ts2.getSourceFileOfNode(aliasDecl) : !ts2.some(s7.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) === containingFile_1; + }))) { + (_b = (_a2 = context2.tracker) === null || _a2 === void 0 ? void 0 : _a2.reportNonlocalAugmentation) === null || _b === void 0 ? void 0 : _b.call(_a2, containingFile_1, symbol, s7); + return void 0; + } + var target = aliasDecl && getTargetOfAliasDeclaration( + aliasDecl, + /*dontRecursivelyResolve*/ + true + ); + includePrivateSymbol(target || s7); + var targetName = target ? getInternalSymbolName(target, ts2.unescapeLeadingUnderscores(target.escapedName)) : localName2; + return ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + name2 === targetName ? void 0 : targetName, + name2 + ); + })) + )]); + addResult( + ts2.factory.createModuleDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createIdentifier(localName), + nsBody, + 16 + /* NodeFlags.Namespace */ + ), + 0 + /* ModifierFlags.None */ + ); + } + } + function serializeEnum(symbol, symbolName, modifierFlags) { + addResult(ts2.factory.createEnumDeclaration(ts2.factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 2048 : 0), getInternalSymbolName(symbol, symbolName), ts2.map(ts2.filter(getPropertiesOfType(getTypeOfSymbol(symbol)), function(p7) { + return !!(p7.flags & 8); + }), function(p7) { + var initializedValue = p7.declarations && p7.declarations[0] && ts2.isEnumMember(p7.declarations[0]) ? getConstantValue(p7.declarations[0]) : void 0; + return ts2.factory.createEnumMember(ts2.unescapeLeadingUnderscores(p7.escapedName), initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? ts2.factory.createStringLiteral(initializedValue) : ts2.factory.createNumericLiteral(initializedValue)); + })), modifierFlags); + } + function serializeAsFunctionNamespaceMerge(type3, symbol, localName, modifierFlags) { + var signatures = getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var decl = signatureToSignatureDeclarationHelper(sig, 259, context2, { name: ts2.factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + addResult(ts2.setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags); + } + if (!(symbol.flags & (512 | 1024) && !!symbol.exports && !!symbol.exports.size)) { + var props = ts2.filter(getPropertiesOfType(type3), isNamespaceMember); + serializeAsNamespaceDeclaration( + props, + localName, + modifierFlags, + /*suppressNewPrivateContext*/ + true + ); + } + } + function getSignatureTextRangeLocation(signature) { + if (signature.declaration && signature.declaration.parent) { + if (ts2.isBinaryExpression(signature.declaration.parent) && ts2.getAssignmentDeclarationKind(signature.declaration.parent) === 5) { + return signature.declaration.parent; + } + if (ts2.isVariableDeclaration(signature.declaration.parent) && signature.declaration.parent.parent) { + return signature.declaration.parent.parent; + } + } + return signature.declaration; + } + function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { + if (ts2.length(props)) { + var localVsRemoteMap = ts2.arrayToMultiMap(props, function(p7) { + return !ts2.length(p7.declarations) || ts2.some(p7.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) === ts2.getSourceFileOfNode(context2.enclosingDeclaration); + }) ? "local" : "remote"; + }); + var localProps = localVsRemoteMap.get("local") || ts2.emptyArray; + var fakespace = ts2.parseNodeFactory.createModuleDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createIdentifier(localName), + ts2.factory.createModuleBlock([]), + 16 + /* NodeFlags.Namespace */ + ); + ts2.setParent(fakespace, enclosingDeclaration); + fakespace.locals = ts2.createSymbolTable(props); + fakespace.symbol = props[0].parent; + var oldResults = results; + results = []; + var oldAddingDeclare = addingDeclare; + addingDeclare = false; + var subcontext = __assign16(__assign16({}, context2), { enclosingDeclaration: fakespace }); + var oldContext = context2; + context2 = subcontext; + visitSymbolTable( + ts2.createSymbolTable(localProps), + suppressNewPrivateContext, + /*propertyAsAlias*/ + true + ); + context2 = oldContext; + addingDeclare = oldAddingDeclare; + var declarations = results; + results = oldResults; + var defaultReplaced = ts2.map(declarations, function(d7) { + return ts2.isExportAssignment(d7) && !d7.isExportEquals && ts2.isIdentifier(d7.expression) ? ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + d7.expression, + ts2.factory.createIdentifier( + "default" + /* InternalSymbolName.Default */ + ) + )]) + ) : d7; + }); + var exportModifierStripped = ts2.every(defaultReplaced, function(d7) { + return ts2.hasSyntacticModifier( + d7, + 1 + /* ModifierFlags.Export */ + ); + }) ? ts2.map(defaultReplaced, removeExportModifier) : defaultReplaced; + fakespace = ts2.factory.updateModuleDeclaration(fakespace, fakespace.modifiers, fakespace.name, ts2.factory.createModuleBlock(exportModifierStripped)); + addResult(fakespace, modifierFlags); + } + } + function isNamespaceMember(p7) { + return !!(p7.flags & (788968 | 1920 | 2097152)) || !(p7.flags & 4194304 || p7.escapedName === "prototype" || p7.valueDeclaration && ts2.isStatic(p7.valueDeclaration) && ts2.isClassLike(p7.valueDeclaration.parent)); + } + function sanitizeJSDocImplements(clauses) { + var result2 = ts2.mapDefined(clauses, function(e10) { + var _a2; + var oldEnclosing = context2.enclosingDeclaration; + context2.enclosingDeclaration = e10; + var expr = e10.expression; + if (ts2.isEntityNameExpression(expr)) { + if (ts2.isIdentifier(expr) && ts2.idText(expr) === "") { + return cleanup( + /*result*/ + void 0 + ); + } + var introducesError = void 0; + _a2 = trackExistingEntityName(expr, context2, includePrivateSymbol), introducesError = _a2.introducesError, expr = _a2.node; + if (introducesError) { + return cleanup( + /*result*/ + void 0 + ); + } + } + return cleanup(ts2.factory.createExpressionWithTypeArguments(expr, ts2.map(e10.typeArguments, function(a7) { + return serializeExistingTypeNode(context2, a7, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a7), context2); + }))); + function cleanup(result3) { + context2.enclosingDeclaration = oldEnclosing; + return result3; + } + }); + if (result2.length === clauses.length) { + return result2; + } + return void 0; + } + function serializeAsClass(symbol, localName, modifierFlags) { + var _a2, _b; + var originalDecl = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isClassLike); + var oldEnclosing = context2.enclosingDeclaration; + context2.enclosingDeclaration = originalDecl || oldEnclosing; + var localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + var typeParamDecls = ts2.map(localParams, function(p7) { + return typeParameterToDeclaration(p7, context2); + }); + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var baseTypes = getBaseTypes(classType); + var originalImplements = originalDecl && ts2.getEffectiveImplementsTypeNodes(originalDecl); + var implementsExpressions = originalImplements && sanitizeJSDocImplements(originalImplements) || ts2.mapDefined(getImplementsTypes(classType), serializeImplementedType); + var staticType = getTypeOfSymbol(symbol); + var isClass3 = !!((_b = staticType.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts2.isClassLike(staticType.symbol.valueDeclaration); + var staticBaseType = isClass3 ? getBaseConstructorTypeOfClass(staticType) : anyType2; + var heritageClauses = __spreadArray9(__spreadArray9([], !ts2.length(baseTypes) ? [] : [ts2.factory.createHeritageClause(94, ts2.map(baseTypes, function(b8) { + return serializeBaseType(b8, staticBaseType, localName); + }))], true), !ts2.length(implementsExpressions) ? [] : [ts2.factory.createHeritageClause(117, implementsExpressions)], true); + var symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType)); + var publicSymbolProps = ts2.filter(symbolProps, function(s7) { + var valueDecl = s7.valueDeclaration; + return !!valueDecl && !(ts2.isNamedDeclaration(valueDecl) && ts2.isPrivateIdentifier(valueDecl.name)); + }); + var hasPrivateIdentifier = ts2.some(symbolProps, function(s7) { + var valueDecl = s7.valueDeclaration; + return !!valueDecl && ts2.isNamedDeclaration(valueDecl) && ts2.isPrivateIdentifier(valueDecl.name); + }); + var privateProperties = hasPrivateIdentifier ? [ts2.factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createPrivateIdentifier("#private"), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )] : ts2.emptyArray; + var publicProperties = ts2.flatMap(publicSymbolProps, function(p7) { + return serializePropertySymbolForClass( + p7, + /*isStatic*/ + false, + baseTypes[0] + ); + }); + var staticMembers = ts2.flatMap(ts2.filter(getPropertiesOfType(staticType), function(p7) { + return !(p7.flags & 4194304) && p7.escapedName !== "prototype" && !isNamespaceMember(p7); + }), function(p7) { + return serializePropertySymbolForClass( + p7, + /*isStatic*/ + true, + staticBaseType + ); + }); + var isNonConstructableClassLikeInJsFile = !isClass3 && !!symbol.valueDeclaration && ts2.isInJSFile(symbol.valueDeclaration) && !ts2.some(getSignaturesOfType( + staticType, + 1 + /* SignatureKind.Construct */ + )); + var constructors = isNonConstructableClassLikeInJsFile ? [ts2.factory.createConstructorDeclaration( + ts2.factory.createModifiersFromModifierFlags( + 8 + /* ModifierFlags.Private */ + ), + [], + /*body*/ + void 0 + )] : serializeSignatures( + 1, + staticType, + staticBaseType, + 173 + /* SyntaxKind.Constructor */ + ); + var indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); + context2.enclosingDeclaration = oldEnclosing; + addResult(ts2.setTextRange(ts2.factory.createClassDeclaration( + /*modifiers*/ + void 0, + localName, + typeParamDecls, + heritageClauses, + __spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], indexSignatures, true), staticMembers, true), constructors, true), publicProperties, true), privateProperties, true) + ), symbol.declarations && ts2.filter(symbol.declarations, function(d7) { + return ts2.isClassDeclaration(d7) || ts2.isClassExpression(d7); + })[0]), modifierFlags); + } + function getSomeTargetNameFromDeclarations(declarations) { + return ts2.firstDefined(declarations, function(d7) { + if (ts2.isImportSpecifier(d7) || ts2.isExportSpecifier(d7)) { + return ts2.idText(d7.propertyName || d7.name); + } + if (ts2.isBinaryExpression(d7) || ts2.isExportAssignment(d7)) { + var expression = ts2.isExportAssignment(d7) ? d7.expression : d7.right; + if (ts2.isPropertyAccessExpression(expression)) { + return ts2.idText(expression.name); + } + } + if (isAliasSymbolDeclaration(d7)) { + var name2 = ts2.getNameOfDeclaration(d7); + if (name2 && ts2.isIdentifier(name2)) { + return ts2.idText(name2); + } + } + return void 0; + }); + } + function serializeAsAlias(symbol, localName, modifierFlags) { + var _a2, _b, _c, _d, _e2; + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts2.Debug.fail(); + var target = getMergedSymbol(getTargetOfAliasDeclaration( + node, + /*dontRecursivelyResolve*/ + true + )); + if (!target) { + return; + } + var verbatimTargetName = ts2.isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || ts2.unescapeLeadingUnderscores(target.escapedName); + if (verbatimTargetName === "export=" && (ts2.getESModuleInterop(compilerOptions) || compilerOptions.allowSyntheticDefaultImports)) { + verbatimTargetName = "default"; + } + var targetName = getInternalSymbolName(target, verbatimTargetName); + includePrivateSymbol(target); + switch (node.kind) { + case 205: + if (((_b = (_a2 = node.parent) === null || _a2 === void 0 ? void 0 : _a2.parent) === null || _b === void 0 ? void 0 : _b.kind) === 257) { + var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context2); + var propertyName = node.propertyName; + addResult( + ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + ts2.factory.createNamedImports([ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName && ts2.isIdentifier(propertyName) ? ts2.factory.createIdentifier(ts2.idText(propertyName)) : void 0, + ts2.factory.createIdentifier(localName) + )]) + ), + ts2.factory.createStringLiteral(specifier_1), + /*importClause*/ + void 0 + ), + 0 + /* ModifierFlags.None */ + ); + break; + } + ts2.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); + break; + case 300: + if (((_e2 = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e2 === void 0 ? void 0 : _e2.kind) === 223) { + serializeExportSpecifier(ts2.unescapeLeadingUnderscores(symbol.escapedName), targetName); + } + break; + case 257: + if (ts2.isPropertyAccessExpression(node.initializer)) { + var initializer = node.initializer; + var uniqueName = ts2.factory.createUniqueName(localName); + var specifier_2 = getSpecifierForModuleSymbol(target.parent || target, context2); + addResult( + ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + uniqueName, + ts2.factory.createExternalModuleReference(ts2.factory.createStringLiteral(specifier_2)) + ), + 0 + /* ModifierFlags.None */ + ); + addResult(ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createIdentifier(localName), + ts2.factory.createQualifiedName(uniqueName, initializer.name) + ), modifierFlags); + break; + } + case 268: + if (target.escapedName === "export=" && ts2.some(target.declarations, ts2.isJsonSourceFile)) { + serializeMaybeAliasAssignment(symbol); + break; + } + var isLocalImport = !(target.flags & 512) && !ts2.isVariableDeclaration(node); + addResult( + ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createIdentifier(localName), + isLocalImport ? symbolToName( + target, + context2, + 67108863, + /*expectsIdentifier*/ + false + ) : ts2.factory.createExternalModuleReference(ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context2))) + ), + isLocalImport ? modifierFlags : 0 + /* ModifierFlags.None */ + ); + break; + case 267: + addResult( + ts2.factory.createNamespaceExportDeclaration(ts2.idText(node.name)), + 0 + /* ModifierFlags.None */ + ); + break; + case 270: + addResult( + ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + ts2.factory.createIdentifier(localName), + /*namedBindings*/ + void 0 + ), + // We use `target.parent || target` below as `target.parent` is unset when the target is a module which has been export assigned + // And then made into a default by the `esModuleInterop` or `allowSyntheticDefaultImports` flag + // In such cases, the `target` refers to the module itself already + ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context2)), + /*assertClause*/ + void 0 + ), + 0 + /* ModifierFlags.None */ + ); + break; + case 271: + addResult( + ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + /*importClause*/ + void 0, + ts2.factory.createNamespaceImport(ts2.factory.createIdentifier(localName)) + ), + ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context2)), + /*assertClause*/ + void 0 + ), + 0 + /* ModifierFlags.None */ + ); + break; + case 277: + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamespaceExport(ts2.factory.createIdentifier(localName)), + ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(target, context2)) + ), + 0 + /* ModifierFlags.None */ + ); + break; + case 273: + addResult( + ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + /*importClause*/ + void 0, + ts2.factory.createNamedImports([ + ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + localName !== verbatimTargetName ? ts2.factory.createIdentifier(verbatimTargetName) : void 0, + ts2.factory.createIdentifier(localName) + ) + ]) + ), + ts2.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context2)), + /*assertClause*/ + void 0 + ), + 0 + /* ModifierFlags.None */ + ); + break; + case 278: + var specifier = node.parent.parent.moduleSpecifier; + serializeExportSpecifier(ts2.unescapeLeadingUnderscores(symbol.escapedName), specifier ? verbatimTargetName : targetName, specifier && ts2.isStringLiteralLike(specifier) ? ts2.factory.createStringLiteral(specifier.text) : void 0); + break; + case 274: + serializeMaybeAliasAssignment(symbol); + break; + case 223: + case 208: + case 209: + if (symbol.escapedName === "default" || symbol.escapedName === "export=") { + serializeMaybeAliasAssignment(symbol); + } else { + serializeExportSpecifier(localName, targetName); + } + break; + default: + return ts2.Debug.failBadSyntaxKind(node, "Unhandled alias declaration kind in symbol serializer!"); + } + } + function serializeExportSpecifier(localName, targetName, specifier) { + addResult( + ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + localName !== targetName ? targetName : void 0, + localName + )]), + specifier + ), + 0 + /* ModifierFlags.None */ + ); + } + function serializeMaybeAliasAssignment(symbol) { + if (symbol.flags & 4194304) { + return false; + } + var name2 = ts2.unescapeLeadingUnderscores(symbol.escapedName); + var isExportEquals = name2 === "export="; + var isDefault = name2 === "default"; + var isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + var aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol); + var target = aliasDecl && getTargetOfAliasDeclaration( + aliasDecl, + /*dontRecursivelyResolve*/ + true + ); + if (target && ts2.length(target.declarations) && ts2.some(target.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) === ts2.getSourceFileOfNode(enclosingDeclaration); + })) { + var expr = aliasDecl && (ts2.isExportAssignment(aliasDecl) || ts2.isBinaryExpression(aliasDecl) ? ts2.getExportAssignmentExpression(aliasDecl) : ts2.getPropertyAssignmentAliasLikeExpression(aliasDecl)); + var first_1 = expr && ts2.isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : void 0; + var referenced = first_1 && resolveEntityName( + first_1, + 67108863, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + enclosingDeclaration + ); + if (referenced || target) { + includePrivateSymbol(referenced || target); + } + var oldTrack = context2.tracker.trackSymbol; + context2.tracker.trackSymbol = function() { + return false; + }; + if (isExportAssignmentCompatibleSymbolName) { + results.push(ts2.factory.createExportAssignment( + /*modifiers*/ + void 0, + isExportEquals, + symbolToExpression( + target, + context2, + 67108863 + /* SymbolFlags.All */ + ) + )); + } else { + if (first_1 === expr && first_1) { + serializeExportSpecifier(name2, ts2.idText(first_1)); + } else if (expr && ts2.isClassExpression(expr)) { + serializeExportSpecifier(name2, getInternalSymbolName(target, ts2.symbolName(target))); + } else { + var varName = getUnusedName(name2, symbol); + addResult( + ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createIdentifier(varName), + symbolToName( + target, + context2, + 67108863, + /*expectsIdentifier*/ + false + ) + ), + 0 + /* ModifierFlags.None */ + ); + serializeExportSpecifier(name2, varName); + } + } + context2.tracker.trackSymbol = oldTrack; + return true; + } else { + var varName = getUnusedName(name2, symbol); + var typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); + if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { + serializeAsFunctionNamespaceMerge( + typeToSerialize, + symbol, + varName, + isExportAssignmentCompatibleSymbolName ? 0 : 1 + /* ModifierFlags.Export */ + ); + } else { + var statement = ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ + ts2.factory.createVariableDeclaration( + varName, + /*exclamationToken*/ + void 0, + serializeTypeForDeclaration(context2, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled) + ) + ], + 2 + /* NodeFlags.Const */ + ) + ); + addResult( + statement, + target && target.flags & 4 && target.escapedName === "export=" ? 2 : name2 === varName ? 1 : 0 + /* ModifierFlags.None */ + ); + } + if (isExportAssignmentCompatibleSymbolName) { + results.push(ts2.factory.createExportAssignment( + /*modifiers*/ + void 0, + isExportEquals, + ts2.factory.createIdentifier(varName) + )); + return true; + } else if (name2 !== varName) { + serializeExportSpecifier(name2, varName); + return true; + } + return false; + } + } + function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) { + var ctxSrc = ts2.getSourceFileOfNode(context2.enclosingDeclaration); + return ts2.getObjectFlags(typeToSerialize) & (16 | 32) && !ts2.length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class + !!(ts2.length(ts2.filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || ts2.length(getSignaturesOfType( + typeToSerialize, + 0 + /* SignatureKind.Call */ + ))) && !ts2.length(getSignaturesOfType( + typeToSerialize, + 1 + /* SignatureKind.Construct */ + )) && // TODO: could probably serialize as function + ns + class, now that that's OK + !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && ts2.some(typeToSerialize.symbol.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) !== ctxSrc; + })) && !ts2.some(getPropertiesOfType(typeToSerialize), function(p7) { + return isLateBoundName(p7.escapedName); + }) && !ts2.some(getPropertiesOfType(typeToSerialize), function(p7) { + return ts2.some(p7.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) !== ctxSrc; + }); + }) && ts2.every(getPropertiesOfType(typeToSerialize), function(p7) { + return ts2.isIdentifierText(ts2.symbolName(p7), languageVersion); + }); + } + function makeSerializePropertySymbol(createProperty, methodKind, useAccessors) { + return function serializePropertySymbol(p7, isStatic, baseType) { + var _a2, _b, _c, _d, _e2; + var modifierFlags = ts2.getDeclarationModifierFlagsFromSymbol(p7); + var isPrivate = !!(modifierFlags & 8); + if (isStatic && p7.flags & (788968 | 1920 | 2097152)) { + return []; + } + if (p7.flags & 4194304 || baseType && getPropertyOfType(baseType, p7.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p7.escapedName)) === isReadonlySymbol(p7) && (p7.flags & 16777216) === (getPropertyOfType(baseType, p7.escapedName).flags & 16777216) && isTypeIdenticalTo(getTypeOfSymbol(p7), getTypeOfPropertyOfType(baseType, p7.escapedName))) { + return []; + } + var flag = modifierFlags & ~512 | (isStatic ? 32 : 0); + var name2 = getPropertyNameNodeForSymbol(p7, context2); + var firstPropertyLikeDecl = (_a2 = p7.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.or(ts2.isPropertyDeclaration, ts2.isAccessor, ts2.isVariableDeclaration, ts2.isPropertySignature, ts2.isBinaryExpression, ts2.isPropertyAccessExpression)); + if (p7.flags & 98304 && useAccessors) { + var result2 = []; + if (p7.flags & 65536) { + result2.push(ts2.setTextRange(ts2.factory.createSetAccessorDeclaration( + ts2.factory.createModifiersFromModifierFlags(flag), + name2, + [ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "arg", + /*questionToken*/ + void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context2, getTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled) + )], + /*body*/ + void 0 + ), ((_b = p7.declarations) === null || _b === void 0 ? void 0 : _b.find(ts2.isSetAccessor)) || firstPropertyLikeDecl)); + } + if (p7.flags & 32768) { + var isPrivate_1 = modifierFlags & 8; + result2.push(ts2.setTextRange(ts2.factory.createGetAccessorDeclaration( + ts2.factory.createModifiersFromModifierFlags(flag), + name2, + [], + isPrivate_1 ? void 0 : serializeTypeForDeclaration(context2, getTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled), + /*body*/ + void 0 + ), ((_c = p7.declarations) === null || _c === void 0 ? void 0 : _c.find(ts2.isGetAccessor)) || firstPropertyLikeDecl)); + } + return result2; + } else if (p7.flags & (4 | 3 | 98304)) { + return ts2.setTextRange(createProperty( + ts2.factory.createModifiersFromModifierFlags((isReadonlySymbol(p7) ? 64 : 0) | flag), + name2, + p7.flags & 16777216 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context2, getWriteTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled), + // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 + // interface members can't have initializers, however class members _can_ + /*initializer*/ + void 0 + ), ((_d = p7.declarations) === null || _d === void 0 ? void 0 : _d.find(ts2.or(ts2.isPropertyDeclaration, ts2.isVariableDeclaration))) || firstPropertyLikeDecl); + } + if (p7.flags & (8192 | 16)) { + var type3 = getTypeOfSymbol(p7); + var signatures = getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + if (flag & 8) { + return ts2.setTextRange(createProperty( + ts2.factory.createModifiersFromModifierFlags((isReadonlySymbol(p7) ? 64 : 0) | flag), + name2, + p7.flags & 16777216 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), ((_e2 = p7.declarations) === null || _e2 === void 0 ? void 0 : _e2.find(ts2.isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p7.declarations && p7.declarations[0]); + } + var results_1 = []; + for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { + var sig = signatures_3[_i]; + var decl = signatureToSignatureDeclarationHelper(sig, methodKind, context2, { + name: name2, + questionToken: p7.flags & 16777216 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + modifiers: flag ? ts2.factory.createModifiersFromModifierFlags(flag) : void 0 + }); + var location2 = sig.declaration && ts2.isPrototypePropertyAssignment(sig.declaration.parent) ? sig.declaration.parent : sig.declaration; + results_1.push(ts2.setTextRange(decl, location2)); + } + return results_1; + } + return ts2.Debug.fail("Unhandled class member kind! ".concat(p7.__debugFlags || p7.flags)); + }; + } + function serializePropertySymbolForInterface(p7, baseType) { + return serializePropertySymbolForInterfaceWorker( + p7, + /*isStatic*/ + false, + baseType + ); + } + function serializeSignatures(kind, input, baseType, outputKind) { + var signatures = getSignaturesOfType(input, kind); + if (kind === 1) { + if (!baseType && ts2.every(signatures, function(s8) { + return ts2.length(s8.parameters) === 0; + })) { + return []; + } + if (baseType) { + var baseSigs = getSignaturesOfType( + baseType, + 1 + /* SignatureKind.Construct */ + ); + if (!ts2.length(baseSigs) && ts2.every(signatures, function(s8) { + return ts2.length(s8.parameters) === 0; + })) { + return []; + } + if (baseSigs.length === signatures.length) { + var failed = false; + for (var i7 = 0; i7 < baseSigs.length; i7++) { + if (!compareSignaturesIdentical( + signatures[i7], + baseSigs[i7], + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true, + compareTypesIdentical + )) { + failed = true; + break; + } + } + if (!failed) { + return []; + } + } + } + var privateProtected = 0; + for (var _i = 0, signatures_4 = signatures; _i < signatures_4.length; _i++) { + var s7 = signatures_4[_i]; + if (s7.declaration) { + privateProtected |= ts2.getSelectedEffectiveModifierFlags( + s7.declaration, + 8 | 16 + /* ModifierFlags.Protected */ + ); + } + } + if (privateProtected) { + return [ts2.setTextRange(ts2.factory.createConstructorDeclaration( + ts2.factory.createModifiersFromModifierFlags(privateProtected), + /*parameters*/ + [], + /*body*/ + void 0 + ), signatures[0].declaration)]; + } + } + var results2 = []; + for (var _a2 = 0, signatures_5 = signatures; _a2 < signatures_5.length; _a2++) { + var sig = signatures_5[_a2]; + var decl = signatureToSignatureDeclarationHelper(sig, outputKind, context2); + results2.push(ts2.setTextRange(decl, sig.declaration)); + } + return results2; + } + function serializeIndexSignatures(input, baseType) { + var results2 = []; + for (var _i = 0, _a2 = getIndexInfosOfType(input); _i < _a2.length; _i++) { + var info2 = _a2[_i]; + if (baseType) { + var baseInfo = getIndexInfoOfType(baseType, info2.keyType); + if (baseInfo) { + if (isTypeIdenticalTo(info2.type, baseInfo.type)) { + continue; + } + } + } + results2.push(indexInfoToIndexSignatureDeclarationHelper( + info2, + context2, + /*typeNode*/ + void 0 + )); + } + return results2; + } + function serializeBaseType(t8, staticType, rootName) { + var ref = trySerializeAsTypeReference( + t8, + 111551 + /* SymbolFlags.Value */ + ); + if (ref) { + return ref; + } + var tempName = getUnusedName("".concat(rootName, "_base")); + var statement = ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ + ts2.factory.createVariableDeclaration( + tempName, + /*exclamationToken*/ + void 0, + typeToTypeNodeHelper(staticType, context2) + ) + ], + 2 + /* NodeFlags.Const */ + ) + ); + addResult( + statement, + 0 + /* ModifierFlags.None */ + ); + return ts2.factory.createExpressionWithTypeArguments( + ts2.factory.createIdentifier(tempName), + /*typeArgs*/ + void 0 + ); + } + function trySerializeAsTypeReference(t8, flags) { + var typeArgs; + var reference; + if (t8.target && isSymbolAccessibleByFlags(t8.target.symbol, enclosingDeclaration, flags)) { + typeArgs = ts2.map(getTypeArguments(t8), function(t9) { + return typeToTypeNodeHelper(t9, context2); + }); + reference = symbolToExpression( + t8.target.symbol, + context2, + 788968 + /* SymbolFlags.Type */ + ); + } else if (t8.symbol && isSymbolAccessibleByFlags(t8.symbol, enclosingDeclaration, flags)) { + reference = symbolToExpression( + t8.symbol, + context2, + 788968 + /* SymbolFlags.Type */ + ); + } + if (reference) { + return ts2.factory.createExpressionWithTypeArguments(reference, typeArgs); + } + } + function serializeImplementedType(t8) { + var ref = trySerializeAsTypeReference( + t8, + 788968 + /* SymbolFlags.Type */ + ); + if (ref) { + return ref; + } + if (t8.symbol) { + return ts2.factory.createExpressionWithTypeArguments( + symbolToExpression( + t8.symbol, + context2, + 788968 + /* SymbolFlags.Type */ + ), + /*typeArgs*/ + void 0 + ); + } + } + function getUnusedName(input, symbol) { + var _a2, _b; + var id = symbol ? getSymbolId(symbol) : void 0; + if (id) { + if (context2.remappedSymbolNames.has(id)) { + return context2.remappedSymbolNames.get(id); + } + } + if (symbol) { + input = getNameCandidateWorker(symbol, input); + } + var i7 = 0; + var original = input; + while ((_a2 = context2.usedSymbolNames) === null || _a2 === void 0 ? void 0 : _a2.has(input)) { + i7++; + input = "".concat(original, "_").concat(i7); + } + (_b = context2.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input); + if (id) { + context2.remappedSymbolNames.set(id, input); + } + return input; + } + function getNameCandidateWorker(symbol, localName) { + if (localName === "default" || localName === "__class" || localName === "__function") { + var flags = context2.flags; + context2.flags |= 16777216; + var nameCandidate = getNameOfSymbolAsWritten(symbol, context2); + context2.flags = flags; + localName = nameCandidate.length > 0 && ts2.isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? ts2.stripQuotes(nameCandidate) : nameCandidate; + } + if (localName === "default") { + localName = "_default"; + } else if (localName === "export=") { + localName = "_exports"; + } + localName = ts2.isIdentifierText(localName, languageVersion) && !ts2.isStringANonContextualKeyword(localName) ? localName : "_" + localName.replace(/[^a-zA-Z0-9]/g, "_"); + return localName; + } + function getInternalSymbolName(symbol, localName) { + var id = getSymbolId(symbol); + if (context2.remappedSymbolNames.has(id)) { + return context2.remappedSymbolNames.get(id); + } + localName = getNameCandidateWorker(symbol, localName); + context2.remappedSymbolNames.set(id, localName); + return localName; + } + } + } + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + if (flags === void 0) { + flags = 16384; + } + return writer ? typePredicateToStringWorker(writer).getText() : ts2.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer2) { + var predicate = ts2.factory.createTypePredicateNode( + typePredicate.kind === 2 || typePredicate.kind === 3 ? ts2.factory.createToken( + 129 + /* SyntaxKind.AssertsKeyword */ + ) : void 0, + typePredicate.kind === 1 || typePredicate.kind === 3 ? ts2.factory.createIdentifier(typePredicate.parameterName) : ts2.factory.createThisTypeNode(), + typePredicate.type && nodeBuilder.typeToTypeNode( + typePredicate.type, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 | 512 + /* NodeBuilderFlags.WriteTypeParametersInQualifiedName */ + ) + // TODO: GH#18217 + ); + var printer = ts2.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts2.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + predicate, + /*sourceFile*/ + sourceFile, + writer2 + ); + return writer2; + } + } + function formatUnionTypes(types3) { + var result2 = []; + var flags = 0; + for (var i7 = 0; i7 < types3.length; i7++) { + var t8 = types3[i7]; + flags |= t8.flags; + if (!(t8.flags & 98304)) { + if (t8.flags & (512 | 1024)) { + var baseType = t8.flags & 512 ? booleanType2 : getBaseTypeOfEnumLiteralType(t8); + if (baseType.flags & 1048576) { + var count2 = baseType.types.length; + if (i7 + count2 <= types3.length && getRegularTypeOfLiteralType(types3[i7 + count2 - 1]) === getRegularTypeOfLiteralType(baseType.types[count2 - 1])) { + result2.push(baseType); + i7 += count2 - 1; + continue; + } + } + } + result2.push(t8); + } + } + if (flags & 65536) + result2.push(nullType2); + if (flags & 32768) + result2.push(undefinedType2); + return result2 || types3; + } + function visibilityToString(flags) { + if (flags === 8) { + return "private"; + } + if (flags === 16) { + return "protected"; + } + return "public"; + } + function getTypeAliasForTypeLiteral(type3) { + if (type3.symbol && type3.symbol.flags & 2048 && type3.symbol.declarations) { + var node = ts2.walkUpParenthesizedTypes(type3.symbol.declarations[0].parent); + if (node.kind === 262) { + return getSymbolOfNode(node); + } + } + return void 0; + } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && node.parent.kind === 265 && ts2.isExternalModuleAugmentation(node.parent.parent); + } + function isDefaultBindingContext(location2) { + return location2.kind === 308 || ts2.isAmbientModule(location2); + } + function getNameOfSymbolFromNameType(symbol, context2) { + var nameType = getSymbolLinks(symbol).nameType; + if (nameType) { + if (nameType.flags & 384) { + var name2 = "" + nameType.value; + if (!ts2.isIdentifierText(name2, ts2.getEmitScriptTarget(compilerOptions)) && !ts2.isNumericLiteralName(name2)) { + return '"'.concat(ts2.escapeString( + name2, + 34 + /* CharacterCodes.doubleQuote */ + ), '"'); + } + if (ts2.isNumericLiteralName(name2) && ts2.startsWith(name2, "-")) { + return "[".concat(name2, "]"); + } + return name2; + } + if (nameType.flags & 8192) { + return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context2), "]"); + } + } + } + function getNameOfSymbolAsWritten(symbol, context2) { + if (context2 && symbol.escapedName === "default" && !(context2.flags & 16384) && // If it's not the first part of an entity name, it must print as `default` + (!(context2.flags & 16777216) || // if the symbol is synthesized, it will only be referenced externally it must print as `default` + !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default` + context2.enclosingDeclaration && ts2.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts2.findAncestor(context2.enclosingDeclaration, isDefaultBindingContext))) { + return "default"; + } + if (symbol.declarations && symbol.declarations.length) { + var declaration = ts2.firstDefined(symbol.declarations, function(d7) { + return ts2.getNameOfDeclaration(d7) ? d7 : void 0; + }); + var name_4 = declaration && ts2.getNameOfDeclaration(declaration); + if (declaration && name_4) { + if (ts2.isCallExpression(declaration) && ts2.isBindableObjectDefinePropertyCall(declaration)) { + return ts2.symbolName(symbol); + } + if (ts2.isComputedPropertyName(name_4) && !(ts2.getCheckFlags(symbol) & 4096)) { + var nameType = getSymbolLinks(symbol).nameType; + if (nameType && nameType.flags & 384) { + var result2 = getNameOfSymbolFromNameType(symbol, context2); + if (result2 !== void 0) { + return result2; + } + } + } + return ts2.declarationNameToString(name_4); + } + if (!declaration) { + declaration = symbol.declarations[0]; + } + if (declaration.parent && declaration.parent.kind === 257) { + return ts2.declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 228: + case 215: + case 216: + if (context2 && !context2.encounteredError && !(context2.flags & 131072)) { + context2.encounteredError = true; + } + return declaration.kind === 228 ? "(Anonymous class)" : "(Anonymous function)"; + } + } + var name2 = getNameOfSymbolFromNameType(symbol, context2); + return name2 !== void 0 ? name2 : ts2.symbolName(symbol); + } + function isDeclarationVisible(node) { + if (node) { + var links = getNodeLinks(node); + if (links.isVisible === void 0) { + links.isVisible = !!determineIfDeclarationIsVisible(); + } + return links.isVisible; + } + return false; + function determineIfDeclarationIsVisible() { + switch (node.kind) { + case 341: + case 348: + case 342: + return !!(node.parent && node.parent.parent && node.parent.parent.parent && ts2.isSourceFile(node.parent.parent.parent)); + case 205: + return isDeclarationVisible(node.parent.parent); + case 257: + if (ts2.isBindingPattern(node.name) && !node.name.elements.length) { + return false; + } + case 264: + case 260: + case 261: + case 262: + case 259: + case 263: + case 268: + if (ts2.isExternalModuleAugmentation(node)) { + return true; + } + var parent2 = getDeclarationContainer(node); + if (!(ts2.getCombinedModifierFlags(node) & 1) && !(node.kind !== 268 && parent2.kind !== 308 && parent2.flags & 16777216)) { + return isGlobalSourceFile(parent2); + } + return isDeclarationVisible(parent2); + case 169: + case 168: + case 174: + case 175: + case 171: + case 170: + if (ts2.hasEffectiveModifier( + node, + 8 | 16 + /* ModifierFlags.Protected */ + )) { + return false; + } + case 173: + case 177: + case 176: + case 178: + case 166: + case 265: + case 181: + case 182: + case 184: + case 180: + case 185: + case 186: + case 189: + case 190: + case 193: + case 199: + return isDeclarationVisible(node.parent); + case 270: + case 271: + case 273: + return false; + case 165: + case 308: + case 267: + return true; + case 274: + return false; + default: + return false; + } + } + } + function collectLinkedAliases(node, setVisibility) { + var exportSymbol; + if (node.parent && node.parent.kind === 274) { + exportSymbol = resolveName( + node, + node.escapedText, + 111551 | 788968 | 1920 | 2097152, + /*nameNotFoundMessage*/ + void 0, + node, + /*isUse*/ + false + ); + } else if (node.parent.kind === 278) { + exportSymbol = getTargetOfExportSpecifier( + node.parent, + 111551 | 788968 | 1920 | 2097152 + /* SymbolFlags.Alias */ + ); + } + var result2; + var visited; + if (exportSymbol) { + visited = new ts2.Set(); + visited.add(getSymbolId(exportSymbol)); + buildVisibleNodeList(exportSymbol.declarations); + } + return result2; + function buildVisibleNodeList(declarations) { + ts2.forEach(declarations, function(declaration) { + var resultNode = getAnyImportSyntax(declaration) || declaration; + if (setVisibility) { + getNodeLinks(declaration).isVisible = true; + } else { + result2 = result2 || []; + ts2.pushIfUnique(result2, resultNode); + } + if (ts2.isInternalModuleImportEqualsDeclaration(declaration)) { + var internalModuleReference = declaration.moduleReference; + var firstIdentifier = ts2.getFirstIdentifier(internalModuleReference); + var importSymbol = resolveName( + declaration, + firstIdentifier.escapedText, + 111551 | 788968 | 1920, + void 0, + void 0, + /*isUse*/ + false + ); + if (importSymbol && visited) { + if (ts2.tryAddToSet(visited, getSymbolId(importSymbol))) { + buildVisibleNodeList(importSymbol.declarations); + } + } + } + }); + } + } + function pushTypeResolution(target, propertyName) { + var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); + if (resolutionCycleStartIndex >= 0) { + var length_3 = resolutionTargets.length; + for (var i7 = resolutionCycleStartIndex; i7 < length_3; i7++) { + resolutionResults[i7] = false; + } + return false; + } + resolutionTargets.push(target); + resolutionResults.push( + /*items*/ + true + ); + resolutionPropertyNames.push(propertyName); + return true; + } + function findResolutionCycleStartIndex(target, propertyName) { + for (var i7 = resolutionTargets.length - 1; i7 >= 0; i7--) { + if (hasType(resolutionTargets[i7], resolutionPropertyNames[i7])) { + return -1; + } + if (resolutionTargets[i7] === target && resolutionPropertyNames[i7] === propertyName) { + return i7; + } + } + return -1; + } + function hasType(target, propertyName) { + switch (propertyName) { + case 0: + return !!getSymbolLinks(target).type; + case 5: + return !!getNodeLinks(target).resolvedEnumType; + case 2: + return !!getSymbolLinks(target).declaredType; + case 1: + return !!target.resolvedBaseConstructorType; + case 3: + return !!target.resolvedReturnType; + case 4: + return !!target.immediateBaseConstraint; + case 6: + return !!target.resolvedTypeArguments; + case 7: + return !!target.baseTypesResolved; + case 8: + return !!getSymbolLinks(target).writeType; + } + return ts2.Debug.assertNever(propertyName); + } + function popTypeResolution() { + resolutionTargets.pop(); + resolutionPropertyNames.pop(); + return resolutionResults.pop(); + } + function getDeclarationContainer(node) { + return ts2.findAncestor(ts2.getRootDeclaration(node), function(node2) { + switch (node2.kind) { + case 257: + case 258: + case 273: + case 272: + case 271: + case 270: + return false; + default: + return true; + } + }).parent; + } + function getTypeOfPrototypeProperty(prototype) { + var classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); + return classType.typeParameters ? createTypeReference(classType, ts2.map(classType.typeParameters, function(_6) { + return anyType2; + })) : classType; + } + function getTypeOfPropertyOfType(type3, name2) { + var prop = getPropertyOfType(type3, name2); + return prop ? getTypeOfSymbol(prop) : void 0; + } + function getTypeOfPropertyOrIndexSignature(type3, name2) { + var _a2; + return getTypeOfPropertyOfType(type3, name2) || ((_a2 = getApplicableIndexInfoForName(type3, name2)) === null || _a2 === void 0 ? void 0 : _a2.type) || unknownType2; + } + function isTypeAny(type3) { + return type3 && (type3.flags & 1) !== 0; + } + function isErrorType(type3) { + return type3 === errorType || !!(type3.flags & 1 && type3.aliasSymbol); + } + function getTypeForBindingElementParent(node, checkMode) { + if (checkMode !== 0) { + return getTypeForVariableLikeDeclaration( + node, + /*includeOptionality*/ + false, + checkMode + ); + } + var symbol = getSymbolOfNode(node); + return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration( + node, + /*includeOptionality*/ + false, + checkMode + ); + } + function getRestType(source, properties, symbol) { + source = filterType(source, function(t8) { + return !(t8.flags & 98304); + }); + if (source.flags & 131072) { + return emptyObjectType; + } + if (source.flags & 1048576) { + return mapType2(source, function(t8) { + return getRestType(t8, properties, symbol); + }); + } + var omitKeyType = getUnionType(ts2.map(properties, getLiteralTypeFromPropertyName)); + var spreadableProperties = []; + var unspreadableToRestKeys = []; + for (var _i = 0, _a2 = getPropertiesOfType(source); _i < _a2.length; _i++) { + var prop = _a2[_i]; + var literalTypeFromProperty = getLiteralTypeFromProperty( + prop, + 8576 + /* TypeFlags.StringOrNumberLiteralOrUnique */ + ); + if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(ts2.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16)) && isSpreadableProperty(prop)) { + spreadableProperties.push(prop); + } else { + unspreadableToRestKeys.push(literalTypeFromProperty); + } + } + if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) { + if (unspreadableToRestKeys.length) { + omitKeyType = getUnionType(__spreadArray9([omitKeyType], unspreadableToRestKeys, true)); + } + if (omitKeyType.flags & 131072) { + return source; + } + var omitTypeAlias = getGlobalOmitSymbol(); + if (!omitTypeAlias) { + return errorType; + } + return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]); + } + var members = ts2.createSymbolTable(); + for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) { + var prop = spreadableProperties_1[_b]; + members.set(prop.escapedName, getSpreadSymbol( + prop, + /*readonly*/ + false + )); + } + var result2 = createAnonymousType(symbol, members, ts2.emptyArray, ts2.emptyArray, getIndexInfosOfType(source)); + result2.objectFlags |= 4194304; + return result2; + } + function isGenericTypeWithUndefinedConstraint(type3) { + return !!(type3.flags & 465829888) && maybeTypeOfKind( + getBaseConstraintOfType(type3) || unknownType2, + 32768 + /* TypeFlags.Undefined */ + ); + } + function getNonUndefinedType(type3) { + var typeOrConstraint = someType(type3, isGenericTypeWithUndefinedConstraint) ? mapType2(type3, function(t8) { + return t8.flags & 465829888 ? getBaseConstraintOrType(t8) : t8; + }) : type3; + return getTypeWithFacts( + typeOrConstraint, + 524288 + /* TypeFacts.NEUndefined */ + ); + } + function getFlowTypeOfDestructuring(node, declaredType) { + var reference = getSyntheticElementAccess(node); + return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; + } + function getSyntheticElementAccess(node) { + var parentAccess = getParentElementAccess(node); + if (parentAccess && parentAccess.flowNode) { + var propName2 = getDestructuringPropertyName(node); + if (propName2) { + var literal = ts2.setTextRange(ts2.parseNodeFactory.createStringLiteral(propName2), node); + var lhsExpr = ts2.isLeftHandSideExpression(parentAccess) ? parentAccess : ts2.parseNodeFactory.createParenthesizedExpression(parentAccess); + var result2 = ts2.setTextRange(ts2.parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + ts2.setParent(literal, result2); + ts2.setParent(result2, node); + if (lhsExpr !== parentAccess) { + ts2.setParent(lhsExpr, result2); + } + result2.flowNode = parentAccess.flowNode; + return result2; + } + } + } + function getParentElementAccess(node) { + var ancestor = node.parent.parent; + switch (ancestor.kind) { + case 205: + case 299: + return getSyntheticElementAccess(ancestor); + case 206: + return getSyntheticElementAccess(node.parent); + case 257: + return ancestor.initializer; + case 223: + return ancestor.right; + } + } + function getDestructuringPropertyName(node) { + var parent2 = node.parent; + if (node.kind === 205 && parent2.kind === 203) { + return getLiteralPropertyNameText(node.propertyName || node.name); + } + if (node.kind === 299 || node.kind === 300) { + return getLiteralPropertyNameText(node.name); + } + return "" + parent2.elements.indexOf(node); + } + function getLiteralPropertyNameText(name2) { + var type3 = getLiteralTypeFromPropertyName(name2); + return type3.flags & (128 | 256) ? "" + type3.value : void 0; + } + function getTypeForBindingElement(declaration) { + var checkMode = declaration.dotDotDotToken ? 64 : 0; + var parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode); + return parentType && getBindingElementTypeFromParentType(declaration, parentType); + } + function getBindingElementTypeFromParentType(declaration, parentType) { + if (isTypeAny(parentType)) { + return parentType; + } + var pattern5 = declaration.parent; + if (strictNullChecks && declaration.flags & 16777216 && ts2.isParameterDeclaration(declaration)) { + parentType = getNonNullableType(parentType); + } else if (strictNullChecks && pattern5.parent.initializer && !(getTypeFacts(getTypeOfInitializer(pattern5.parent.initializer)) & 65536)) { + parentType = getTypeWithFacts( + parentType, + 524288 + /* TypeFacts.NEUndefined */ + ); + } + var type3; + if (pattern5.kind === 203) { + if (declaration.dotDotDotToken) { + parentType = getReducedType(parentType); + if (parentType.flags & 2 || !isValidSpreadType(parentType)) { + error2(declaration, ts2.Diagnostics.Rest_types_may_only_be_created_from_object_types); + return errorType; + } + var literalMembers = []; + for (var _i = 0, _a2 = pattern5.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!element.dotDotDotToken) { + literalMembers.push(element.propertyName || element.name); + } + } + type3 = getRestType(parentType, literalMembers, declaration.symbol); + } else { + var name2 = declaration.propertyName || declaration.name; + var indexType = getLiteralTypeFromPropertyName(name2); + var declaredType = getIndexedAccessType(parentType, indexType, 32, name2); + type3 = getFlowTypeOfDestructuring(declaration, declaredType); + } + } else { + var elementType = checkIteratedTypeOrElementType(65 | (declaration.dotDotDotToken ? 0 : 128), parentType, undefinedType2, pattern5); + var index_2 = pattern5.elements.indexOf(declaration); + if (declaration.dotDotDotToken) { + type3 = everyType(parentType, isTupleType) ? mapType2(parentType, function(t8) { + return sliceTupleType(t8, index_2); + }) : createArrayType(elementType); + } else if (isArrayLikeType(parentType)) { + var indexType = getNumberLiteralType(index_2); + var accessFlags = 32 | (hasDefaultValue(declaration) ? 16 : 0); + var declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType; + type3 = getFlowTypeOfDestructuring(declaration, declaredType); + } else { + type3 = elementType; + } + } + if (!declaration.initializer) { + return type3; + } + if (ts2.getEffectiveTypeAnnotationNode(ts2.walkUpBindingElementsAndPatterns(declaration))) { + return strictNullChecks && !(getTypeFacts(checkDeclarationInitializer( + declaration, + 0 + /* CheckMode.Normal */ + )) & 16777216) ? getNonUndefinedType(type3) : type3; + } + return widenTypeInferredFromInitializer(declaration, getUnionType( + [getNonUndefinedType(type3), checkDeclarationInitializer( + declaration, + 0 + /* CheckMode.Normal */ + )], + 2 + /* UnionReduction.Subtype */ + )); + } + function getTypeForDeclarationFromJSDocComment(declaration) { + var jsdocType = ts2.getJSDocType(declaration); + if (jsdocType) { + return getTypeFromTypeNode(jsdocType); + } + return void 0; + } + function isNullOrUndefined2(node) { + var expr = ts2.skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return expr.kind === 104 || expr.kind === 79 && getResolvedSymbol(expr) === undefinedSymbol; + } + function isEmptyArrayLiteral(node) { + var expr = ts2.skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return expr.kind === 206 && expr.elements.length === 0; + } + function addOptionality(type3, isProperty, isOptional2) { + if (isProperty === void 0) { + isProperty = false; + } + if (isOptional2 === void 0) { + isOptional2 = true; + } + return strictNullChecks && isOptional2 ? getOptionalType(type3, isProperty) : type3; + } + function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) { + if (ts2.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 246) { + var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( + declaration.parent.parent.expression, + /*checkMode*/ + checkMode + ))); + return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType2; + } + if (ts2.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 247) { + var forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement) || anyType2; + } + if (ts2.isBindingPattern(declaration.parent)) { + return getTypeForBindingElement(declaration); + } + var isProperty = ts2.isPropertyDeclaration(declaration) && !ts2.hasAccessorModifier(declaration) || ts2.isPropertySignature(declaration); + var isOptional2 = includeOptionality && (isProperty && !!declaration.questionToken || ts2.isParameter(declaration) && (!!declaration.questionToken || isJSDocOptionalParameter(declaration)) || isOptionalJSDocPropertyLikeTag(declaration)); + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isProperty, isOptional2); + } + if ((noImplicitAny || ts2.isInJSFile(declaration)) && ts2.isVariableDeclaration(declaration) && !ts2.isBindingPattern(declaration.name) && !(ts2.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 16777216)) { + if (!(ts2.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined2(declaration.initializer))) { + return autoType; + } + if (declaration.initializer && isEmptyArrayLiteral(declaration.initializer)) { + return autoArrayType; + } + } + if (ts2.isParameter(declaration)) { + var func = declaration.parent; + if (func.kind === 175 && hasBindableName(func)) { + var getter = ts2.getDeclarationOfKind( + getSymbolOfNode(declaration.parent), + 174 + /* SyntaxKind.GetAccessor */ + ); + if (getter) { + var getterSignature = getSignatureFromDeclaration(getter); + var thisParameter = getAccessorThisParameter(func); + if (thisParameter && declaration === thisParameter) { + ts2.Debug.assert(!thisParameter.type); + return getTypeOfSymbol(getterSignature.thisParameter); + } + return getReturnTypeOfSignature(getterSignature); + } + } + var parameterTypeOfTypeTag = getParameterTypeOfTypeTag(func, declaration); + if (parameterTypeOfTypeTag) + return parameterTypeOfTypeTag; + var type3 = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration); + if (type3) { + return addOptionality( + type3, + /*isProperty*/ + false, + isOptional2 + ); + } + } + if (ts2.hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) { + if (ts2.isInJSFile(declaration) && !ts2.isParameter(declaration)) { + var containerObjectType = getJSContainerObjectType(declaration, getSymbolOfNode(declaration), ts2.getDeclaredExpandoInitializer(declaration)); + if (containerObjectType) { + return containerObjectType; + } + } + var type3 = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode)); + return addOptionality(type3, isProperty, isOptional2); + } + if (ts2.isPropertyDeclaration(declaration) && (noImplicitAny || ts2.isInJSFile(declaration))) { + if (!ts2.hasStaticModifier(declaration)) { + var constructor = findConstructorDeclaration(declaration.parent); + var type3 = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : ts2.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + return type3 && addOptionality( + type3, + /*isProperty*/ + true, + isOptional2 + ); + } else { + var staticBlocks = ts2.filter(declaration.parent.members, ts2.isClassStaticBlockDeclaration); + var type3 = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : ts2.getEffectiveModifierFlags(declaration) & 2 ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + return type3 && addOptionality( + type3, + /*isProperty*/ + true, + isOptional2 + ); + } + } + if (ts2.isJsxAttribute(declaration)) { + return trueType; + } + if (ts2.isBindingPattern(declaration.name)) { + return getTypeFromBindingPattern( + declaration.name, + /*includePatternInType*/ + false, + /*reportErrors*/ + true + ); + } + return void 0; + } + function isConstructorDeclaredProperty(symbol) { + if (symbol.valueDeclaration && ts2.isBinaryExpression(symbol.valueDeclaration)) { + var links = getSymbolLinks(symbol); + if (links.isConstructorDeclaredProperty === void 0) { + links.isConstructorDeclaredProperty = false; + links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && ts2.every(symbol.declarations, function(declaration) { + return ts2.isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 209 || ts2.isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( + /*declaredType*/ + void 0, + declaration, + symbol, + declaration + ); + }); + } + return links.isConstructorDeclaredProperty; + } + return false; + } + function isAutoTypedProperty(symbol) { + var declaration = symbol.valueDeclaration; + return declaration && ts2.isPropertyDeclaration(declaration) && !ts2.getEffectiveTypeAnnotationNode(declaration) && !declaration.initializer && (noImplicitAny || ts2.isInJSFile(declaration)); + } + function getDeclaringConstructor(symbol) { + if (!symbol.declarations) { + return; + } + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + var container = ts2.getThisContainer( + declaration, + /*includeArrowFunctions*/ + false + ); + if (container && (container.kind === 173 || isJSConstructor(container))) { + return container; + } + } + } + function getFlowTypeFromCommonJSExport(symbol) { + var file = ts2.getSourceFileOfNode(symbol.declarations[0]); + var accessName = ts2.unescapeLeadingUnderscores(symbol.escapedName); + var areAllModuleExports = symbol.declarations.every(function(d7) { + return ts2.isInJSFile(d7) && ts2.isAccessExpression(d7) && ts2.isModuleExportsAccessExpression(d7.expression); + }); + var reference = areAllModuleExports ? ts2.factory.createPropertyAccessExpression(ts2.factory.createPropertyAccessExpression(ts2.factory.createIdentifier("module"), ts2.factory.createIdentifier("exports")), accessName) : ts2.factory.createPropertyAccessExpression(ts2.factory.createIdentifier("exports"), accessName); + if (areAllModuleExports) { + ts2.setParent(reference.expression.expression, reference.expression); + } + ts2.setParent(reference.expression, reference); + ts2.setParent(reference, file); + reference.flowNode = file.endFlowNode; + return getFlowTypeOfReference(reference, autoType, undefinedType2); + } + function getFlowTypeInStaticBlocks(symbol, staticBlocks) { + var accessName = ts2.startsWith(symbol.escapedName, "__#") ? ts2.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : ts2.unescapeLeadingUnderscores(symbol.escapedName); + for (var _i = 0, staticBlocks_1 = staticBlocks; _i < staticBlocks_1.length; _i++) { + var staticBlock = staticBlocks_1[_i]; + var reference = ts2.factory.createPropertyAccessExpression(ts2.factory.createThis(), accessName); + ts2.setParent(reference.expression, reference); + ts2.setParent(reference, staticBlock); + reference.flowNode = staticBlock.returnFlowNode; + var flowType = getFlowTypeOfProperty(reference, symbol); + if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { + error2(symbol.valueDeclaration, ts2.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + if (everyType(flowType, isNullableType)) { + continue; + } + return convertAutoToAny(flowType); + } + } + function getFlowTypeInConstructor(symbol, constructor) { + var accessName = ts2.startsWith(symbol.escapedName, "__#") ? ts2.factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : ts2.unescapeLeadingUnderscores(symbol.escapedName); + var reference = ts2.factory.createPropertyAccessExpression(ts2.factory.createThis(), accessName); + ts2.setParent(reference.expression, reference); + ts2.setParent(reference, constructor); + reference.flowNode = constructor.returnFlowNode; + var flowType = getFlowTypeOfProperty(reference, symbol); + if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { + error2(symbol.valueDeclaration, ts2.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType); + } + function getFlowTypeOfProperty(reference, prop) { + var initialType = (prop === null || prop === void 0 ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || ts2.getEffectiveModifierFlags(prop.valueDeclaration) & 2) && getTypeOfPropertyInBaseClass(prop) || undefinedType2; + return getFlowTypeOfReference(reference, autoType, initialType); + } + function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { + var container = ts2.getAssignedExpandoInitializer(symbol.valueDeclaration); + if (container) { + var tag = ts2.getJSDocTypeTag(container); + if (tag && tag.typeExpression) { + return getTypeFromTypeNode(tag.typeExpression); + } + var containerObjectType = symbol.valueDeclaration && getJSContainerObjectType(symbol.valueDeclaration, symbol, container); + return containerObjectType || getWidenedLiteralType(checkExpressionCached(container)); + } + var type3; + var definedInConstructor = false; + var definedInMethod = false; + if (isConstructorDeclaredProperty(symbol)) { + type3 = getFlowTypeInConstructor(symbol, getDeclaringConstructor(symbol)); + } + if (!type3) { + var types3 = void 0; + if (symbol.declarations) { + var jsdocType = void 0; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + var expression = ts2.isBinaryExpression(declaration) || ts2.isCallExpression(declaration) ? declaration : ts2.isAccessExpression(declaration) ? ts2.isBinaryExpression(declaration.parent) ? declaration.parent : declaration : void 0; + if (!expression) { + continue; + } + var kind = ts2.isAccessExpression(expression) ? ts2.getAssignmentDeclarationPropertyAccessKind(expression) : ts2.getAssignmentDeclarationKind(expression); + if (kind === 4 || ts2.isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (isDeclarationInConstructor(expression)) { + definedInConstructor = true; + } else { + definedInMethod = true; + } + } + if (!ts2.isCallExpression(expression)) { + jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration); + } + if (!jsdocType) { + (types3 || (types3 = [])).push(ts2.isBinaryExpression(expression) || ts2.isCallExpression(expression) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType2); + } + } + type3 = jsdocType; + } + if (!type3) { + if (!ts2.length(types3)) { + return errorType; + } + var constructorTypes = definedInConstructor && symbol.declarations ? getConstructorDefinedThisAssignmentTypes(types3, symbol.declarations) : void 0; + if (definedInMethod) { + var propType = getTypeOfPropertyInBaseClass(symbol); + if (propType) { + (constructorTypes || (constructorTypes = [])).push(propType); + definedInConstructor = true; + } + } + var sourceTypes = ts2.some(constructorTypes, function(t8) { + return !!(t8.flags & ~98304); + }) ? constructorTypes : types3; + type3 = getUnionType(sourceTypes); + } + } + var widened = getWidenedType(addOptionality( + type3, + /*isProperty*/ + false, + definedInMethod && !definedInConstructor + )); + if (symbol.valueDeclaration && filterType(widened, function(t8) { + return !!(t8.flags & ~98304); + }) === neverType2) { + reportImplicitAny(symbol.valueDeclaration, anyType2); + return anyType2; + } + return widened; + } + function getJSContainerObjectType(decl, symbol, init2) { + var _a2, _b; + if (!ts2.isInJSFile(decl) || !init2 || !ts2.isObjectLiteralExpression(init2) || init2.properties.length) { + return void 0; + } + var exports29 = ts2.createSymbolTable(); + while (ts2.isBinaryExpression(decl) || ts2.isPropertyAccessExpression(decl)) { + var s_2 = getSymbolOfNode(decl); + if ((_a2 = s_2 === null || s_2 === void 0 ? void 0 : s_2.exports) === null || _a2 === void 0 ? void 0 : _a2.size) { + mergeSymbolTable(exports29, s_2.exports); + } + decl = ts2.isBinaryExpression(decl) ? decl.parent : decl.parent.parent; + } + var s7 = getSymbolOfNode(decl); + if ((_b = s7 === null || s7 === void 0 ? void 0 : s7.exports) === null || _b === void 0 ? void 0 : _b.size) { + mergeSymbolTable(exports29, s7.exports); + } + var type3 = createAnonymousType(symbol, exports29, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + type3.objectFlags |= 4096; + return type3; + } + function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) { + var _a2; + var typeNode = ts2.getEffectiveTypeAnnotationNode(expression.parent); + if (typeNode) { + var type3 = getWidenedType(getTypeFromTypeNode(typeNode)); + if (!declaredType) { + return type3; + } else if (!isErrorType(declaredType) && !isErrorType(type3) && !isTypeIdenticalTo(declaredType, type3)) { + errorNextVariableOrPropertyDeclarationMustHaveSameType( + /*firstDeclaration*/ + void 0, + declaredType, + declaration, + type3 + ); + } + } + if ((_a2 = symbol.parent) === null || _a2 === void 0 ? void 0 : _a2.valueDeclaration) { + var typeNode_2 = ts2.getEffectiveTypeAnnotationNode(symbol.parent.valueDeclaration); + if (typeNode_2) { + var annotationSymbol = getPropertyOfType(getTypeFromTypeNode(typeNode_2), symbol.escapedName); + if (annotationSymbol) { + return getNonMissingTypeOfSymbol(annotationSymbol); + } + } + } + return declaredType; + } + function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) { + if (ts2.isCallExpression(expression)) { + if (resolvedSymbol) { + return getTypeOfSymbol(resolvedSymbol); + } + var objectLitType = checkExpressionCached(expression.arguments[2]); + var valueType = getTypeOfPropertyOfType(objectLitType, "value"); + if (valueType) { + return valueType; + } + var getFunc = getTypeOfPropertyOfType(objectLitType, "get"); + if (getFunc) { + var getSig = getSingleCallSignature(getFunc); + if (getSig) { + return getReturnTypeOfSignature(getSig); + } + } + var setFunc = getTypeOfPropertyOfType(objectLitType, "set"); + if (setFunc) { + var setSig = getSingleCallSignature(setFunc); + if (setSig) { + return getTypeOfFirstParameterOfSignature(setSig); + } + } + return anyType2; + } + if (containsSameNamedThisProperty(expression.left, expression.right)) { + return anyType2; + } + var isDirectExport = kind === 1 && (ts2.isPropertyAccessExpression(expression.left) || ts2.isElementAccessExpression(expression.left)) && (ts2.isModuleExportsAccessExpression(expression.left.expression) || ts2.isIdentifier(expression.left.expression) && ts2.isExportsIdentifier(expression.left.expression)); + var type3 = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right)) : getWidenedLiteralType(checkExpressionCached(expression.right)); + if (type3.flags & 524288 && kind === 2 && symbol.escapedName === "export=") { + var exportedType = resolveStructuredTypeMembers(type3); + var members_4 = ts2.createSymbolTable(); + ts2.copyEntries(exportedType.members, members_4); + var initialSize = members_4.size; + if (resolvedSymbol && !resolvedSymbol.exports) { + resolvedSymbol.exports = ts2.createSymbolTable(); + } + (resolvedSymbol || symbol).exports.forEach(function(s7, name2) { + var _a2; + var exportedMember = members_4.get(name2); + if (exportedMember && exportedMember !== s7 && !(s7.flags & 2097152)) { + if (s7.flags & 111551 && exportedMember.flags & 111551) { + if (s7.valueDeclaration && exportedMember.valueDeclaration && ts2.getSourceFileOfNode(s7.valueDeclaration) !== ts2.getSourceFileOfNode(exportedMember.valueDeclaration)) { + var unescapedName = ts2.unescapeLeadingUnderscores(s7.escapedName); + var exportedMemberName = ((_a2 = ts2.tryCast(exportedMember.valueDeclaration, ts2.isNamedDeclaration)) === null || _a2 === void 0 ? void 0 : _a2.name) || exportedMember.valueDeclaration; + ts2.addRelatedInfo(error2(s7.valueDeclaration, ts2.Diagnostics.Duplicate_identifier_0, unescapedName), ts2.createDiagnosticForNode(exportedMemberName, ts2.Diagnostics._0_was_also_declared_here, unescapedName)); + ts2.addRelatedInfo(error2(exportedMemberName, ts2.Diagnostics.Duplicate_identifier_0, unescapedName), ts2.createDiagnosticForNode(s7.valueDeclaration, ts2.Diagnostics._0_was_also_declared_here, unescapedName)); + } + var union2 = createSymbol(s7.flags | exportedMember.flags, name2); + union2.type = getUnionType([getTypeOfSymbol(s7), getTypeOfSymbol(exportedMember)]); + union2.valueDeclaration = exportedMember.valueDeclaration; + union2.declarations = ts2.concatenate(exportedMember.declarations, s7.declarations); + members_4.set(name2, union2); + } else { + members_4.set(name2, mergeSymbol(s7, exportedMember)); + } + } else { + members_4.set(name2, s7); + } + }); + var result2 = createAnonymousType( + initialSize !== members_4.size ? void 0 : exportedType.symbol, + // Only set the type's symbol if it looks to be the same as the original type + members_4, + exportedType.callSignatures, + exportedType.constructSignatures, + exportedType.indexInfos + ); + if (initialSize === members_4.size) { + if (type3.aliasSymbol) { + result2.aliasSymbol = type3.aliasSymbol; + result2.aliasTypeArguments = type3.aliasTypeArguments; + } + if (ts2.getObjectFlags(type3) & 4) { + result2.aliasSymbol = type3.symbol; + var args = getTypeArguments(type3); + result2.aliasTypeArguments = ts2.length(args) ? args : void 0; + } + } + result2.objectFlags |= ts2.getObjectFlags(type3) & 4096; + if (result2.symbol && result2.symbol.flags & 32 && type3 === getDeclaredTypeOfClassOrInterface(result2.symbol)) { + result2.objectFlags |= 16777216; + } + return result2; + } + if (isEmptyArrayLiteralType(type3)) { + reportImplicitAny(expression, anyArrayType); + return anyArrayType; + } + return type3; + } + function containsSameNamedThisProperty(thisProperty, expression) { + return ts2.isPropertyAccessExpression(thisProperty) && thisProperty.expression.kind === 108 && ts2.forEachChildRecursively(expression, function(n7) { + return isMatchingReference(thisProperty, n7); + }); + } + function isDeclarationInConstructor(expression) { + var thisContainer = ts2.getThisContainer( + expression, + /*includeArrowFunctions*/ + false + ); + return thisContainer.kind === 173 || thisContainer.kind === 259 || thisContainer.kind === 215 && !ts2.isPrototypePropertyAssignment(thisContainer.parent); + } + function getConstructorDefinedThisAssignmentTypes(types3, declarations) { + ts2.Debug.assert(types3.length === declarations.length); + return types3.filter(function(_6, i7) { + var declaration = declarations[i7]; + var expression = ts2.isBinaryExpression(declaration) ? declaration : ts2.isBinaryExpression(declaration.parent) ? declaration.parent : void 0; + return expression && isDeclarationInConstructor(expression); + }); + } + function getTypeFromBindingElement(element, includePatternInType, reportErrors) { + if (element.initializer) { + var contextualType = ts2.isBindingPattern(element.name) ? getTypeFromBindingPattern( + element.name, + /*includePatternInType*/ + true, + /*reportErrors*/ + false + ) : unknownType2; + return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0, contextualType))); + } + if (ts2.isBindingPattern(element.name)) { + return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); + } + if (reportErrors && !declarationBelongsToPrivateAmbientMember(element)) { + reportImplicitAny(element, anyType2); + } + return includePatternInType ? nonInferrableAnyType : anyType2; + } + function getTypeFromObjectBindingPattern(pattern5, includePatternInType, reportErrors) { + var members = ts2.createSymbolTable(); + var stringIndexInfo; + var objectFlags = 128 | 131072; + ts2.forEach(pattern5.elements, function(e10) { + var name2 = e10.propertyName || e10.name; + if (e10.dotDotDotToken) { + stringIndexInfo = createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + ); + return; + } + var exprType = getLiteralTypeFromPropertyName(name2); + if (!isTypeUsableAsPropertyName(exprType)) { + objectFlags |= 512; + return; + } + var text = getPropertyNameFromType(exprType); + var flags = 4 | (e10.initializer ? 16777216 : 0); + var symbol = createSymbol(flags, text); + symbol.type = getTypeFromBindingElement(e10, includePatternInType, reportErrors); + symbol.bindingElement = e10; + members.set(symbol.escapedName, symbol); + }); + var result2 = createAnonymousType(void 0, members, ts2.emptyArray, ts2.emptyArray, stringIndexInfo ? [stringIndexInfo] : ts2.emptyArray); + result2.objectFlags |= objectFlags; + if (includePatternInType) { + result2.pattern = pattern5; + result2.objectFlags |= 131072; + } + return result2; + } + function getTypeFromArrayBindingPattern(pattern5, includePatternInType, reportErrors) { + var elements = pattern5.elements; + var lastElement = ts2.lastOrUndefined(elements); + var restElement = lastElement && lastElement.kind === 205 && lastElement.dotDotDotToken ? lastElement : void 0; + if (elements.length === 0 || elements.length === 1 && restElement) { + return languageVersion >= 2 ? createIterableType(anyType2) : anyArrayType; + } + var elementTypes = ts2.map(elements, function(e10) { + return ts2.isOmittedExpression(e10) ? anyType2 : getTypeFromBindingElement(e10, includePatternInType, reportErrors); + }); + var minLength = ts2.findLastIndex(elements, function(e10) { + return !(e10 === restElement || ts2.isOmittedExpression(e10) || hasDefaultValue(e10)); + }, elements.length - 1) + 1; + var elementFlags = ts2.map(elements, function(e10, i7) { + return e10 === restElement ? 4 : i7 >= minLength ? 2 : 1; + }); + var result2 = createTupleType(elementTypes, elementFlags); + if (includePatternInType) { + result2 = cloneTypeReference(result2); + result2.pattern = pattern5; + result2.objectFlags |= 131072; + } + return result2; + } + function getTypeFromBindingPattern(pattern5, includePatternInType, reportErrors) { + if (includePatternInType === void 0) { + includePatternInType = false; + } + if (reportErrors === void 0) { + reportErrors = false; + } + return pattern5.kind === 203 ? getTypeFromObjectBindingPattern(pattern5, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern5, includePatternInType, reportErrors); + } + function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { + return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration( + declaration, + /*includeOptionality*/ + true, + 0 + /* CheckMode.Normal */ + ), declaration, reportErrors); + } + function isGlobalSymbolConstructor(node) { + var symbol = getSymbolOfNode(node); + var globalSymbol = getGlobalESSymbolConstructorTypeSymbol( + /*reportErrors*/ + false + ); + return globalSymbol && symbol && symbol === globalSymbol; + } + function widenTypeForVariableLikeDeclaration(type3, declaration, reportErrors) { + if (type3) { + if (type3.flags & 4096 && isGlobalSymbolConstructor(declaration.parent)) { + type3 = getESSymbolLikeTypeForNode(declaration); + } + if (reportErrors) { + reportErrorsFromWidening(declaration, type3); + } + if (type3.flags & 8192 && (ts2.isBindingElement(declaration) || !declaration.type) && type3.symbol !== getSymbolOfNode(declaration)) { + type3 = esSymbolType; + } + return getWidenedType(type3); + } + type3 = ts2.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType2; + if (reportErrors) { + if (!declarationBelongsToPrivateAmbientMember(declaration)) { + reportImplicitAny(declaration, type3); + } + } + return type3; + } + function declarationBelongsToPrivateAmbientMember(declaration) { + var root2 = ts2.getRootDeclaration(declaration); + var memberDeclaration = root2.kind === 166 ? root2.parent : root2; + return isPrivateWithinAmbient(memberDeclaration); + } + function tryGetTypeFromEffectiveTypeNode(node) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(node); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } + function getTypeOfVariableOrParameterOrProperty(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + var type3 = getTypeOfVariableOrParameterOrPropertyWorker(symbol); + if (!links.type) { + links.type = type3; + } + } + return links.type; + } + function getTypeOfVariableOrParameterOrPropertyWorker(symbol) { + if (symbol.flags & 4194304) { + return getTypeOfPrototypeProperty(symbol); + } + if (symbol === requireSymbol) { + return anyType2; + } + if (symbol.flags & 134217728 && symbol.valueDeclaration) { + var fileSymbol = getSymbolOfNode(ts2.getSourceFileOfNode(symbol.valueDeclaration)); + var result2 = createSymbol(fileSymbol.flags, "exports"); + result2.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : []; + result2.parent = symbol; + result2.target = fileSymbol; + if (fileSymbol.valueDeclaration) + result2.valueDeclaration = fileSymbol.valueDeclaration; + if (fileSymbol.members) + result2.members = new ts2.Map(fileSymbol.members); + if (fileSymbol.exports) + result2.exports = new ts2.Map(fileSymbol.exports); + var members = ts2.createSymbolTable(); + members.set("exports", result2); + return createAnonymousType(symbol, members, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + } + ts2.Debug.assertIsDefined(symbol.valueDeclaration); + var declaration = symbol.valueDeclaration; + if (ts2.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(declaration); + if (typeNode === void 0) { + return useUnknownInCatchVariables ? unknownType2 : anyType2; + } + var type_1 = getTypeOfNode(typeNode); + return isTypeAny(type_1) || type_1 === unknownType2 ? type_1 : errorType; + } + if (ts2.isSourceFile(declaration) && ts2.isJsonSourceFile(declaration)) { + if (!declaration.statements.length) { + return emptyObjectType; + } + return getWidenedType(getWidenedLiteralType(checkExpression(declaration.statements[0].expression))); + } + if (ts2.isAccessor(declaration)) { + return getTypeOfAccessors(symbol); + } + if (!pushTypeResolution( + symbol, + 0 + /* TypeSystemPropertyName.Type */ + )) { + if (symbol.flags & 512 && !(symbol.flags & 67108864)) { + return getTypeOfFuncClassEnumModule(symbol); + } + return reportCircularityError(symbol); + } + var type3; + if (declaration.kind === 274) { + type3 = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration); + } else if (ts2.isBinaryExpression(declaration) || ts2.isInJSFile(declaration) && (ts2.isCallExpression(declaration) || (ts2.isPropertyAccessExpression(declaration) || ts2.isBindableStaticElementAccessExpression(declaration)) && ts2.isBinaryExpression(declaration.parent))) { + type3 = getWidenedTypeForAssignmentDeclaration(symbol); + } else if (ts2.isPropertyAccessExpression(declaration) || ts2.isElementAccessExpression(declaration) || ts2.isIdentifier(declaration) || ts2.isStringLiteralLike(declaration) || ts2.isNumericLiteral(declaration) || ts2.isClassDeclaration(declaration) || ts2.isFunctionDeclaration(declaration) || ts2.isMethodDeclaration(declaration) && !ts2.isObjectLiteralMethod(declaration) || ts2.isMethodSignature(declaration) || ts2.isSourceFile(declaration)) { + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type3 = ts2.isBinaryExpression(declaration.parent) ? getWidenedTypeForAssignmentDeclaration(symbol) : tryGetTypeFromEffectiveTypeNode(declaration) || anyType2; + } else if (ts2.isPropertyAssignment(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } else if (ts2.isJsxAttribute(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } else if (ts2.isShorthandPropertyAssignment(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation( + declaration.name, + 0 + /* CheckMode.Normal */ + ); + } else if (ts2.isObjectLiteralMethod(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod( + declaration, + 0 + /* CheckMode.Normal */ + ); + } else if (ts2.isParameter(declaration) || ts2.isPropertyDeclaration(declaration) || ts2.isPropertySignature(declaration) || ts2.isVariableDeclaration(declaration) || ts2.isBindingElement(declaration) || ts2.isJSDocPropertyLikeTag(declaration)) { + type3 = getWidenedTypeForVariableLikeDeclaration( + declaration, + /*includeOptionality*/ + true + ); + } else if (ts2.isEnumDeclaration(declaration)) { + type3 = getTypeOfFuncClassEnumModule(symbol); + } else if (ts2.isEnumMember(declaration)) { + type3 = getTypeOfEnumMember(symbol); + } else { + return ts2.Debug.fail("Unhandled declaration kind! " + ts2.Debug.formatSyntaxKind(declaration.kind) + " for " + ts2.Debug.formatSymbol(symbol)); + } + if (!popTypeResolution()) { + if (symbol.flags & 512 && !(symbol.flags & 67108864)) { + return getTypeOfFuncClassEnumModule(symbol); + } + return reportCircularityError(symbol); + } + return type3; + } + function getAnnotatedAccessorTypeNode(accessor) { + if (accessor) { + switch (accessor.kind) { + case 174: + var getterTypeAnnotation = ts2.getEffectiveReturnTypeNode(accessor); + return getterTypeAnnotation; + case 175: + var setterTypeAnnotation = ts2.getEffectiveSetAccessorTypeAnnotationNode(accessor); + return setterTypeAnnotation; + case 169: + ts2.Debug.assert(ts2.hasAccessorModifier(accessor)); + var accessorTypeAnnotation = ts2.getEffectiveTypeAnnotationNode(accessor); + return accessorTypeAnnotation; + } + } + return void 0; + } + function getAnnotatedAccessorType(accessor) { + var node = getAnnotatedAccessorTypeNode(accessor); + return node && getTypeFromTypeNode(node); + } + function getAnnotatedAccessorThisParameter(accessor) { + var parameter = getAccessorThisParameter(accessor); + return parameter && parameter.symbol; + } + function getThisTypeOfDeclaration(declaration) { + return getThisTypeOfSignature(getSignatureFromDeclaration(declaration)); + } + function getTypeOfAccessors(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + if (!pushTypeResolution( + symbol, + 0 + /* TypeSystemPropertyName.Type */ + )) { + return errorType; + } + var getter = ts2.getDeclarationOfKind( + symbol, + 174 + /* SyntaxKind.GetAccessor */ + ); + var setter = ts2.getDeclarationOfKind( + symbol, + 175 + /* SyntaxKind.SetAccessor */ + ); + var accessor = ts2.tryCast(ts2.getDeclarationOfKind( + symbol, + 169 + /* SyntaxKind.PropertyDeclaration */ + ), ts2.isAutoAccessorPropertyDeclaration); + var type3 = getter && ts2.isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration( + accessor, + /*includeOptionality*/ + true + ); + if (!type3) { + if (setter && !isPrivateWithinAmbient(setter)) { + errorOrSuggestion(noImplicitAny, setter, ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString2(symbol)); + } else if (getter && !isPrivateWithinAmbient(getter)) { + errorOrSuggestion(noImplicitAny, getter, ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString2(symbol)); + } else if (accessor && !isPrivateWithinAmbient(accessor)) { + errorOrSuggestion(noImplicitAny, accessor, ts2.Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), "any"); + } + type3 = anyType2; + } + if (!popTypeResolution()) { + if (getAnnotatedAccessorTypeNode(getter)) { + error2(getter, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getAnnotatedAccessorTypeNode(setter)) { + error2(setter, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getAnnotatedAccessorTypeNode(accessor)) { + error2(setter, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getter && noImplicitAny) { + error2(getter, ts2.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString2(symbol)); + } + type3 = anyType2; + } + links.type = type3; + } + return links.type; + } + function getWriteTypeOfAccessors(symbol) { + var _a2; + var links = getSymbolLinks(symbol); + if (!links.writeType) { + if (!pushTypeResolution( + symbol, + 8 + /* TypeSystemPropertyName.WriteType */ + )) { + return errorType; + } + var setter = (_a2 = ts2.getDeclarationOfKind( + symbol, + 175 + /* SyntaxKind.SetAccessor */ + )) !== null && _a2 !== void 0 ? _a2 : ts2.tryCast(ts2.getDeclarationOfKind( + symbol, + 169 + /* SyntaxKind.PropertyDeclaration */ + ), ts2.isAutoAccessorPropertyDeclaration); + var writeType = getAnnotatedAccessorType(setter); + if (!popTypeResolution()) { + if (getAnnotatedAccessorTypeNode(setter)) { + error2(setter, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } + writeType = anyType2; + } + links.writeType = writeType || getTypeOfAccessors(symbol); + } + return links.writeType; + } + function getBaseTypeVariableOfClass(symbol) { + var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 8650752 ? baseConstructorType : baseConstructorType.flags & 2097152 ? ts2.find(baseConstructorType.types, function(t8) { + return !!(t8.flags & 8650752); + }) : void 0; + } + function getTypeOfFuncClassEnumModule(symbol) { + var links = getSymbolLinks(symbol); + var originalLinks = links; + if (!links.type) { + var expando = symbol.valueDeclaration && getSymbolOfExpando( + symbol.valueDeclaration, + /*allowDeclaration*/ + false + ); + if (expando) { + var merged = mergeJSSymbols(symbol, expando); + if (merged) { + symbol = links = merged; + } + } + originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol); + } + return links.type; + } + function getTypeOfFuncClassEnumModuleWorker(symbol) { + var declaration = symbol.valueDeclaration; + if (symbol.flags & 1536 && ts2.isShorthandAmbientModuleSymbol(symbol)) { + return anyType2; + } else if (declaration && (declaration.kind === 223 || ts2.isAccessExpression(declaration) && declaration.parent.kind === 223)) { + return getWidenedTypeForAssignmentDeclaration(symbol); + } else if (symbol.flags & 512 && declaration && ts2.isSourceFile(declaration) && declaration.commonJsModuleIndicator) { + var resolvedModule = resolveExternalModuleSymbol(symbol); + if (resolvedModule !== symbol) { + if (!pushTypeResolution( + symbol, + 0 + /* TypeSystemPropertyName.Type */ + )) { + return errorType; + } + var exportEquals = getMergedSymbol(symbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + )); + var type_2 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? void 0 : resolvedModule); + if (!popTypeResolution()) { + return reportCircularityError(symbol); + } + return type_2; + } + } + var type3 = createObjectType(16, symbol); + if (symbol.flags & 32) { + var baseTypeVariable = getBaseTypeVariableOfClass(symbol); + return baseTypeVariable ? getIntersectionType([type3, baseTypeVariable]) : type3; + } else { + return strictNullChecks && symbol.flags & 16777216 ? getOptionalType(type3) : type3; + } + } + function getTypeOfEnumMember(symbol) { + var links = getSymbolLinks(symbol); + return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol)); + } + function getTypeOfAlias(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + var targetSymbol = resolveAlias(symbol); + var exportSymbol = symbol.declarations && getTargetOfAliasDeclaration( + getDeclarationOfAliasSymbol(symbol), + /*dontResolveAlias*/ + true + ); + var declaredType = ts2.firstDefined(exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations, function(d7) { + return ts2.isExportAssignment(d7) ? tryGetTypeFromEffectiveTypeNode(d7) : void 0; + }); + links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getAllSymbolFlags(targetSymbol) & 111551 ? getTypeOfSymbol(targetSymbol) : errorType; + } + return links.type; + } + function getTypeOfInstantiatedSymbol(symbol) { + var links = getSymbolLinks(symbol); + return links.type || (links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper)); + } + function getWriteTypeOfInstantiatedSymbol(symbol) { + var links = getSymbolLinks(symbol); + return links.writeType || (links.writeType = instantiateType(getWriteTypeOfSymbol(links.target), links.mapper)); + } + function reportCircularityError(symbol) { + var declaration = symbol.valueDeclaration; + if (ts2.getEffectiveTypeAnnotationNode(declaration)) { + error2(symbol.valueDeclaration, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + return errorType; + } + if (noImplicitAny && (declaration.kind !== 166 || declaration.initializer)) { + error2(symbol.valueDeclaration, ts2.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString2(symbol)); + } + return anyType2; + } + function getTypeOfSymbolWithDeferredType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + ts2.Debug.assertIsDefined(links.deferralParent); + ts2.Debug.assertIsDefined(links.deferralConstituents); + links.type = links.deferralParent.flags & 1048576 ? getUnionType(links.deferralConstituents) : getIntersectionType(links.deferralConstituents); + } + return links.type; + } + function getWriteTypeOfSymbolWithDeferredType(symbol) { + var links = getSymbolLinks(symbol); + if (!links.writeType && links.deferralWriteConstituents) { + ts2.Debug.assertIsDefined(links.deferralParent); + ts2.Debug.assertIsDefined(links.deferralConstituents); + links.writeType = links.deferralParent.flags & 1048576 ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents); + } + return links.writeType; + } + function getWriteTypeOfSymbol(symbol) { + var checkFlags = ts2.getCheckFlags(symbol); + if (symbol.flags & 4) { + return checkFlags & 2 ? checkFlags & 65536 ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.writeType || symbol.type : getTypeOfSymbol(symbol); + } + if (symbol.flags & 98304) { + return checkFlags & 1 ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol); + } + return getTypeOfSymbol(symbol); + } + function getTypeOfSymbol(symbol) { + var checkFlags = ts2.getCheckFlags(symbol); + if (checkFlags & 65536) { + return getTypeOfSymbolWithDeferredType(symbol); + } + if (checkFlags & 1) { + return getTypeOfInstantiatedSymbol(symbol); + } + if (checkFlags & 262144) { + return getTypeOfMappedSymbol(symbol); + } + if (checkFlags & 8192) { + return getTypeOfReverseMappedSymbol(symbol); + } + if (symbol.flags & (3 | 4)) { + return getTypeOfVariableOrParameterOrProperty(symbol); + } + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (symbol.flags & 8) { + return getTypeOfEnumMember(symbol); + } + if (symbol.flags & 98304) { + return getTypeOfAccessors(symbol); + } + if (symbol.flags & 2097152) { + return getTypeOfAlias(symbol); + } + return errorType; + } + function getNonMissingTypeOfSymbol(symbol) { + return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216)); + } + function isReferenceToType(type3, target) { + return type3 !== void 0 && target !== void 0 && (ts2.getObjectFlags(type3) & 4) !== 0 && type3.target === target; + } + function getTargetType(type3) { + return ts2.getObjectFlags(type3) & 4 ? type3.target : type3; + } + function hasBaseType(type3, checkBase) { + return check(type3); + function check(type4) { + if (ts2.getObjectFlags(type4) & (3 | 4)) { + var target = getTargetType(type4); + return target === checkBase || ts2.some(getBaseTypes(target), check); + } else if (type4.flags & 2097152) { + return ts2.some(type4.types, check); + } + return false; + } + } + function appendTypeParameters(typeParameters, declarations) { + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + typeParameters = ts2.appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration))); + } + return typeParameters; + } + function getOuterTypeParameters(node, includeThisTypes) { + while (true) { + node = node.parent; + if (node && ts2.isBinaryExpression(node)) { + var assignmentKind = ts2.getAssignmentDeclarationKind(node); + if (assignmentKind === 6 || assignmentKind === 3) { + var symbol = getSymbolOfNode(node.left); + if (symbol && symbol.parent && !ts2.findAncestor(symbol.parent.valueDeclaration, function(d7) { + return node === d7; + })) { + node = symbol.parent.valueDeclaration; + } + } + } + if (!node) { + return void 0; + } + switch (node.kind) { + case 260: + case 228: + case 261: + case 176: + case 177: + case 170: + case 181: + case 182: + case 320: + case 259: + case 171: + case 215: + case 216: + case 262: + case 347: + case 348: + case 342: + case 341: + case 197: + case 191: { + var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); + if (node.kind === 197) { + return ts2.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); + } else if (node.kind === 191) { + return ts2.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } + var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts2.getEffectiveTypeParameterDeclarations(node)); + var thisType = includeThisTypes && (node.kind === 260 || node.kind === 228 || node.kind === 261 || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; + return thisType ? ts2.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; + } + case 343: + var paramSymbol = ts2.getParameterSymbolFromJSDoc(node); + if (paramSymbol) { + node = paramSymbol.valueDeclaration; + } + break; + case 323: { + var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); + return node.tags ? appendTypeParameters(outerTypeParameters, ts2.flatMap(node.tags, function(t8) { + return ts2.isJSDocTemplateTag(t8) ? t8.typeParameters : void 0; + })) : outerTypeParameters; + } + } + } + } + function getOuterTypeParametersOfClassOrInterface(symbol) { + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts2.getDeclarationOfKind( + symbol, + 261 + /* SyntaxKind.InterfaceDeclaration */ + ); + ts2.Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); + return getOuterTypeParameters(declaration); + } + function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { + if (!symbol.declarations) { + return; + } + var result2; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var node = _a2[_i]; + if (node.kind === 261 || node.kind === 260 || node.kind === 228 || isJSConstructor(node) || ts2.isTypeAlias(node)) { + var declaration = node; + result2 = appendTypeParameters(result2, ts2.getEffectiveTypeParameterDeclarations(declaration)); + } + } + return result2; + } + function getTypeParametersOfClassOrInterface(symbol) { + return ts2.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); + } + function isMixinConstructorType(type3) { + var signatures = getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ); + if (signatures.length === 1) { + var s7 = signatures[0]; + if (!s7.typeParameters && s7.parameters.length === 1 && signatureHasRestParameter(s7)) { + var paramType = getTypeOfParameter(s7.parameters[0]); + return isTypeAny(paramType) || getElementTypeOfArrayType(paramType) === anyType2; + } + } + return false; + } + function isConstructorType(type3) { + if (getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ).length > 0) { + return true; + } + if (type3.flags & 8650752) { + var constraint = getBaseConstraintOfType(type3); + return !!constraint && isMixinConstructorType(constraint); + } + return false; + } + function getBaseTypeNodeOfClass(type3) { + var decl = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + return decl && ts2.getEffectiveBaseTypeNode(decl); + } + function getConstructorsForTypeArguments(type3, typeArgumentNodes, location2) { + var typeArgCount = ts2.length(typeArgumentNodes); + var isJavascript = ts2.isInJSFile(location2); + return ts2.filter(getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ), function(sig) { + return (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= ts2.length(sig.typeParameters); + }); + } + function getInstantiatedConstructorsForTypeArguments(type3, typeArgumentNodes, location2) { + var signatures = getConstructorsForTypeArguments(type3, typeArgumentNodes, location2); + var typeArguments = ts2.map(typeArgumentNodes, getTypeFromTypeNode); + return ts2.sameMap(signatures, function(sig) { + return ts2.some(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, ts2.isInJSFile(location2)) : sig; + }); + } + function getBaseConstructorTypeOfClass(type3) { + if (!type3.resolvedBaseConstructorType) { + var decl = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + var extended = decl && ts2.getEffectiveBaseTypeNode(decl); + var baseTypeNode = getBaseTypeNodeOfClass(type3); + if (!baseTypeNode) { + return type3.resolvedBaseConstructorType = undefinedType2; + } + if (!pushTypeResolution( + type3, + 1 + /* TypeSystemPropertyName.ResolvedBaseConstructorType */ + )) { + return errorType; + } + var baseConstructorType = checkExpression(baseTypeNode.expression); + if (extended && baseTypeNode !== extended) { + ts2.Debug.assert(!extended.typeArguments); + checkExpression(extended.expression); + } + if (baseConstructorType.flags & (524288 | 2097152)) { + resolveStructuredTypeMembers(baseConstructorType); + } + if (!popTypeResolution()) { + error2(type3.symbol.valueDeclaration, ts2.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString2(type3.symbol)); + return type3.resolvedBaseConstructorType = errorType; + } + if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + var err = error2(baseTypeNode.expression, ts2.Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); + if (baseConstructorType.flags & 262144) { + var constraint = getConstraintFromTypeParameter(baseConstructorType); + var ctorReturn = unknownType2; + if (constraint) { + var ctorSig = getSignaturesOfType( + constraint, + 1 + /* SignatureKind.Construct */ + ); + if (ctorSig[0]) { + ctorReturn = getReturnTypeOfSignature(ctorSig[0]); + } + } + if (baseConstructorType.symbol.declarations) { + ts2.addRelatedInfo(err, ts2.createDiagnosticForNode(baseConstructorType.symbol.declarations[0], ts2.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString2(baseConstructorType.symbol), typeToString(ctorReturn))); + } + } + return type3.resolvedBaseConstructorType = errorType; + } + type3.resolvedBaseConstructorType = baseConstructorType; + } + return type3.resolvedBaseConstructorType; + } + function getImplementsTypes(type3) { + var resolvedImplementsTypes = ts2.emptyArray; + if (type3.symbol.declarations) { + for (var _i = 0, _a2 = type3.symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + var implementsTypeNodes = ts2.getEffectiveImplementsTypeNodes(declaration); + if (!implementsTypeNodes) + continue; + for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) { + var node = implementsTypeNodes_1[_b]; + var implementsType = getTypeFromTypeNode(node); + if (!isErrorType(implementsType)) { + if (resolvedImplementsTypes === ts2.emptyArray) { + resolvedImplementsTypes = [implementsType]; + } else { + resolvedImplementsTypes.push(implementsType); + } + } + } + } + } + return resolvedImplementsTypes; + } + function reportCircularBaseType(node, type3) { + error2(node, ts2.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* TypeFormatFlags.WriteArrayAsGenericType */ + )); + } + function getBaseTypes(type3) { + if (!type3.baseTypesResolved) { + if (pushTypeResolution( + type3, + 7 + /* TypeSystemPropertyName.ResolvedBaseTypes */ + )) { + if (type3.objectFlags & 8) { + type3.resolvedBaseTypes = [getTupleBaseType(type3)]; + } else if (type3.symbol.flags & (32 | 64)) { + if (type3.symbol.flags & 32) { + resolveBaseTypesOfClass(type3); + } + if (type3.symbol.flags & 64) { + resolveBaseTypesOfInterface(type3); + } + } else { + ts2.Debug.fail("type must be class or interface"); + } + if (!popTypeResolution() && type3.symbol.declarations) { + for (var _i = 0, _a2 = type3.symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (declaration.kind === 260 || declaration.kind === 261) { + reportCircularBaseType(declaration, type3); + } + } + } + } + type3.baseTypesResolved = true; + } + return type3.resolvedBaseTypes; + } + function getTupleBaseType(type3) { + var elementTypes = ts2.sameMap(type3.typeParameters, function(t8, i7) { + return type3.elementFlags[i7] & 8 ? getIndexedAccessType(t8, numberType2) : t8; + }); + return createArrayType(getUnionType(elementTypes || ts2.emptyArray), type3.readonly); + } + function resolveBaseTypesOfClass(type3) { + type3.resolvedBaseTypes = ts2.resolvingEmptyArray; + var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type3)); + if (!(baseConstructorType.flags & (524288 | 2097152 | 1))) { + return type3.resolvedBaseTypes = ts2.emptyArray; + } + var baseTypeNode = getBaseTypeNodeOfClass(type3); + var baseType; + var originalBaseType = baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : void 0; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 && areAllOuterTypeParametersApplied(originalBaseType)) { + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); + } else if (baseConstructorType.flags & 1) { + baseType = baseConstructorType; + } else { + var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); + if (!constructors.length) { + error2(baseTypeNode.expression, ts2.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); + return type3.resolvedBaseTypes = ts2.emptyArray; + } + baseType = getReturnTypeOfSignature(constructors[0]); + } + if (isErrorType(baseType)) { + return type3.resolvedBaseTypes = ts2.emptyArray; + } + var reducedBaseType = getReducedType(baseType); + if (!isValidBaseType(reducedBaseType)) { + var elaboration = elaborateNeverIntersection( + /*errorInfo*/ + void 0, + baseType + ); + var diagnostic = ts2.chainDiagnosticMessages(elaboration, ts2.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); + diagnostics.add(ts2.createDiagnosticForNodeFromMessageChain(baseTypeNode.expression, diagnostic)); + return type3.resolvedBaseTypes = ts2.emptyArray; + } + if (type3 === reducedBaseType || hasBaseType(reducedBaseType, type3)) { + error2(type3.symbol.valueDeclaration, ts2.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* TypeFormatFlags.WriteArrayAsGenericType */ + )); + return type3.resolvedBaseTypes = ts2.emptyArray; + } + if (type3.resolvedBaseTypes === ts2.resolvingEmptyArray) { + type3.members = void 0; + } + return type3.resolvedBaseTypes = [reducedBaseType]; + } + function areAllOuterTypeParametersApplied(type3) { + var outerTypeParameters = type3.outerTypeParameters; + if (outerTypeParameters) { + var last_1 = outerTypeParameters.length - 1; + var typeArguments = getTypeArguments(type3); + return outerTypeParameters[last_1].symbol !== typeArguments[last_1].symbol; + } + return true; + } + function isValidBaseType(type3) { + if (type3.flags & 262144) { + var constraint = getBaseConstraintOfType(type3); + if (constraint) { + return isValidBaseType(constraint); + } + } + return !!(type3.flags & (524288 | 67108864 | 1) && !isGenericMappedType(type3) || type3.flags & 2097152 && ts2.every(type3.types, isValidBaseType)); + } + function resolveBaseTypesOfInterface(type3) { + type3.resolvedBaseTypes = type3.resolvedBaseTypes || ts2.emptyArray; + if (type3.symbol.declarations) { + for (var _i = 0, _a2 = type3.symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (declaration.kind === 261 && ts2.getInterfaceBaseTypeNodes(declaration)) { + for (var _b = 0, _c = ts2.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { + var node = _c[_b]; + var baseType = getReducedType(getTypeFromTypeNode(node)); + if (!isErrorType(baseType)) { + if (isValidBaseType(baseType)) { + if (type3 !== baseType && !hasBaseType(baseType, type3)) { + if (type3.resolvedBaseTypes === ts2.emptyArray) { + type3.resolvedBaseTypes = [baseType]; + } else { + type3.resolvedBaseTypes.push(baseType); + } + } else { + reportCircularBaseType(declaration, type3); + } + } else { + error2(node, ts2.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); + } + } + } + } + } + } + } + function isThislessInterface(symbol) { + if (!symbol.declarations) { + return true; + } + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (declaration.kind === 261) { + if (declaration.flags & 128) { + return false; + } + var baseTypeNodes = ts2.getInterfaceBaseTypeNodes(declaration); + if (baseTypeNodes) { + for (var _b = 0, baseTypeNodes_1 = baseTypeNodes; _b < baseTypeNodes_1.length; _b++) { + var node = baseTypeNodes_1[_b]; + if (ts2.isEntityNameExpression(node.expression)) { + var baseSymbol = resolveEntityName( + node.expression, + 788968, + /*ignoreErrors*/ + true + ); + if (!baseSymbol || !(baseSymbol.flags & 64) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) { + return false; + } + } + } + } + } + } + return true; + } + function getDeclaredTypeOfClassOrInterface(symbol) { + var links = getSymbolLinks(symbol); + var originalLinks = links; + if (!links.declaredType) { + var kind = symbol.flags & 32 ? 1 : 2; + var merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration)); + if (merged) { + symbol = links = merged; + } + var type3 = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol); + var outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol); + var localTypeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (outerTypeParameters || localTypeParameters || kind === 1 || !isThislessInterface(symbol)) { + type3.objectFlags |= 4; + type3.typeParameters = ts2.concatenate(outerTypeParameters, localTypeParameters); + type3.outerTypeParameters = outerTypeParameters; + type3.localTypeParameters = localTypeParameters; + type3.instantiations = new ts2.Map(); + type3.instantiations.set(getTypeListId(type3.typeParameters), type3); + type3.target = type3; + type3.resolvedTypeArguments = type3.typeParameters; + type3.thisType = createTypeParameter(symbol); + type3.thisType.isThisType = true; + type3.thisType.constraint = type3; + } + } + return links.declaredType; + } + function getDeclaredTypeOfTypeAlias(symbol) { + var _a2; + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + if (!pushTypeResolution( + symbol, + 2 + /* TypeSystemPropertyName.DeclaredType */ + )) { + return errorType; + } + var declaration = ts2.Debug.checkDefined((_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isTypeAlias), "Type alias symbol with no valid declaration found"); + var typeNode = ts2.isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type; + var type3 = typeNode ? getTypeFromTypeNode(typeNode) : errorType; + if (popTypeResolution()) { + var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (typeParameters) { + links.typeParameters = typeParameters; + links.instantiations = new ts2.Map(); + links.instantiations.set(getTypeListId(typeParameters), type3); + } + } else { + type3 = errorType; + if (declaration.kind === 342) { + error2(declaration.typeExpression.type, ts2.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString2(symbol)); + } else { + error2(ts2.isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, ts2.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString2(symbol)); + } + } + links.declaredType = type3; + } + return links.declaredType; + } + function isStringConcatExpression(expr) { + if (ts2.isStringLiteralLike(expr)) { + return true; + } else if (expr.kind === 223) { + return isStringConcatExpression(expr.left) && isStringConcatExpression(expr.right); + } + return false; + } + function isLiteralEnumMember(member) { + var expr = member.initializer; + if (!expr) { + return !(member.flags & 16777216); + } + switch (expr.kind) { + case 10: + case 8: + case 14: + return true; + case 221: + return expr.operator === 40 && expr.operand.kind === 8; + case 79: + return ts2.nodeIsMissing(expr) || !!getSymbolOfNode(member.parent).exports.get(expr.escapedText); + case 223: + return isStringConcatExpression(expr); + default: + return false; + } + } + function getEnumKind(symbol) { + var links = getSymbolLinks(symbol); + if (links.enumKind !== void 0) { + return links.enumKind; + } + var hasNonLiteralMember = false; + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (declaration.kind === 263) { + for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { + var member = _c[_b]; + if (member.initializer && ts2.isStringLiteralLike(member.initializer)) { + return links.enumKind = 1; + } + if (!isLiteralEnumMember(member)) { + hasNonLiteralMember = true; + } + } + } + } + } + return links.enumKind = hasNonLiteralMember ? 0 : 1; + } + function getBaseTypeOfEnumLiteralType(type3) { + return type3.flags & 1024 && !(type3.flags & 1048576) ? getDeclaredTypeOfSymbol(getParentOfSymbol(type3.symbol)) : type3; + } + function getDeclaredTypeOfEnum(symbol) { + var links = getSymbolLinks(symbol); + if (links.declaredType) { + return links.declaredType; + } + if (getEnumKind(symbol) === 1) { + enumCount++; + var memberTypeList = []; + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (declaration.kind === 263) { + for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { + var member = _c[_b]; + var value2 = getEnumMemberValue(member); + var memberType = getFreshTypeOfLiteralType(getEnumLiteralType(value2 !== void 0 ? value2 : 0, enumCount, getSymbolOfNode(member))); + getSymbolLinks(getSymbolOfNode(member)).declaredType = memberType; + memberTypeList.push(getRegularTypeOfLiteralType(memberType)); + } + } + } + } + if (memberTypeList.length) { + var enumType_1 = getUnionType( + memberTypeList, + 1, + symbol, + /*aliasTypeArguments*/ + void 0 + ); + if (enumType_1.flags & 1048576) { + enumType_1.flags |= 1024; + enumType_1.symbol = symbol; + } + return links.declaredType = enumType_1; + } + } + var enumType2 = createType( + 32 + /* TypeFlags.Enum */ + ); + enumType2.symbol = symbol; + return links.declaredType = enumType2; + } + function getDeclaredTypeOfEnumMember(symbol) { + var links = getSymbolLinks(symbol); + if (!links.declaredType) { + var enumType2 = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + if (!links.declaredType) { + links.declaredType = enumType2; + } + } + return links.declaredType; + } + function getDeclaredTypeOfTypeParameter(symbol) { + var links = getSymbolLinks(symbol); + return links.declaredType || (links.declaredType = createTypeParameter(symbol)); + } + function getDeclaredTypeOfAlias(symbol) { + var links = getSymbolLinks(symbol); + return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol))); + } + function getDeclaredTypeOfSymbol(symbol) { + return tryGetDeclaredTypeOfSymbol(symbol) || errorType; + } + function tryGetDeclaredTypeOfSymbol(symbol) { + if (symbol.flags & (32 | 64)) { + return getDeclaredTypeOfClassOrInterface(symbol); + } + if (symbol.flags & 524288) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 262144) { + return getDeclaredTypeOfTypeParameter(symbol); + } + if (symbol.flags & 384) { + return getDeclaredTypeOfEnum(symbol); + } + if (symbol.flags & 8) { + return getDeclaredTypeOfEnumMember(symbol); + } + if (symbol.flags & 2097152) { + return getDeclaredTypeOfAlias(symbol); + } + return void 0; + } + function isThislessType(node) { + switch (node.kind) { + case 131: + case 157: + case 152: + case 148: + case 160: + case 134: + case 153: + case 149: + case 114: + case 155: + case 144: + case 198: + return true; + case 185: + return isThislessType(node.elementType); + case 180: + return !node.typeArguments || node.typeArguments.every(isThislessType); + } + return false; + } + function isThislessTypeParameter(node) { + var constraint = ts2.getEffectiveConstraintOfTypeParameter(node); + return !constraint || isThislessType(constraint); + } + function isThislessVariableLikeDeclaration(node) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(node); + return typeNode ? isThislessType(typeNode) : !ts2.hasInitializer(node); + } + function isThislessFunctionLikeDeclaration(node) { + var returnType = ts2.getEffectiveReturnTypeNode(node); + var typeParameters = ts2.getEffectiveTypeParameterDeclarations(node); + return (node.kind === 173 || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); + } + function isThisless(symbol) { + if (symbol.declarations && symbol.declarations.length === 1) { + var declaration = symbol.declarations[0]; + if (declaration) { + switch (declaration.kind) { + case 169: + case 168: + return isThislessVariableLikeDeclaration(declaration); + case 171: + case 170: + case 173: + case 174: + case 175: + return isThislessFunctionLikeDeclaration(declaration); + } + } + } + return false; + } + function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) { + var result2 = ts2.createSymbolTable(); + for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { + var symbol = symbols_2[_i]; + result2.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper)); + } + return result2; + } + function addInheritedMembers(symbols, baseSymbols) { + for (var _i = 0, baseSymbols_1 = baseSymbols; _i < baseSymbols_1.length; _i++) { + var s7 = baseSymbols_1[_i]; + if (!symbols.has(s7.escapedName) && !isStaticPrivateIdentifierProperty(s7)) { + symbols.set(s7.escapedName, s7); + } + } + } + function isStaticPrivateIdentifierProperty(s7) { + return !!s7.valueDeclaration && ts2.isPrivateIdentifierClassElementDeclaration(s7.valueDeclaration) && ts2.isStatic(s7.valueDeclaration); + } + function resolveDeclaredMembers(type3) { + if (!type3.declaredProperties) { + var symbol = type3.symbol; + var members = getMembersOfSymbol(symbol); + type3.declaredProperties = getNamedMembers(members); + type3.declaredCallSignatures = ts2.emptyArray; + type3.declaredConstructSignatures = ts2.emptyArray; + type3.declaredIndexInfos = ts2.emptyArray; + type3.declaredCallSignatures = getSignaturesOfSymbol(members.get( + "__call" + /* InternalSymbolName.Call */ + )); + type3.declaredConstructSignatures = getSignaturesOfSymbol(members.get( + "__new" + /* InternalSymbolName.New */ + )); + type3.declaredIndexInfos = getIndexInfosOfSymbol(symbol); + } + return type3; + } + function isTypeUsableAsPropertyName(type3) { + return !!(type3.flags & 8576); + } + function isLateBindableName(node) { + if (!ts2.isComputedPropertyName(node) && !ts2.isElementAccessExpression(node)) { + return false; + } + var expr = ts2.isComputedPropertyName(node) ? node.expression : node.argumentExpression; + return ts2.isEntityNameExpression(expr) && isTypeUsableAsPropertyName(ts2.isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr)); + } + function isLateBoundName(name2) { + return name2.charCodeAt(0) === 95 && name2.charCodeAt(1) === 95 && name2.charCodeAt(2) === 64; + } + function hasLateBindableName(node) { + var name2 = ts2.getNameOfDeclaration(node); + return !!name2 && isLateBindableName(name2); + } + function hasBindableName(node) { + return !ts2.hasDynamicName(node) || hasLateBindableName(node); + } + function isNonBindableDynamicName(node) { + return ts2.isDynamicName(node) && !isLateBindableName(node); + } + function getPropertyNameFromType(type3) { + if (type3.flags & 8192) { + return type3.escapedName; + } + if (type3.flags & (128 | 256)) { + return ts2.escapeLeadingUnderscores("" + type3.value); + } + return ts2.Debug.fail(); + } + function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { + ts2.Debug.assert(!!(ts2.getCheckFlags(symbol) & 4096), "Expected a late-bound symbol."); + symbol.flags |= symbolFlags; + getSymbolLinks(member.symbol).lateSymbol = symbol; + if (!symbol.declarations) { + symbol.declarations = [member]; + } else if (!member.symbol.isReplaceableByMethod) { + symbol.declarations.push(member); + } + if (symbolFlags & 111551) { + if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) { + symbol.valueDeclaration = member; + } + } + } + function lateBindMember(parent2, earlySymbols, lateSymbols, decl) { + ts2.Debug.assert(!!decl.symbol, "The member is expected to have a symbol."); + var links = getNodeLinks(decl); + if (!links.resolvedSymbol) { + links.resolvedSymbol = decl.symbol; + var declName = ts2.isBinaryExpression(decl) ? decl.left : decl.name; + var type3 = ts2.isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName); + if (isTypeUsableAsPropertyName(type3)) { + var memberName = getPropertyNameFromType(type3); + var symbolFlags = decl.symbol.flags; + var lateSymbol = lateSymbols.get(memberName); + if (!lateSymbol) + lateSymbols.set(memberName, lateSymbol = createSymbol( + 0, + memberName, + 4096 + /* CheckFlags.Late */ + )); + var earlySymbol = earlySymbols && earlySymbols.get(memberName); + if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) { + var declarations = earlySymbol ? ts2.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; + var name_5 = !(type3.flags & 8192) && ts2.unescapeLeadingUnderscores(memberName) || ts2.declarationNameToString(declName); + ts2.forEach(declarations, function(declaration) { + return error2(ts2.getNameOfDeclaration(declaration) || declaration, ts2.Diagnostics.Property_0_was_also_declared_here, name_5); + }); + error2(declName || decl, ts2.Diagnostics.Duplicate_property_0, name_5); + lateSymbol = createSymbol( + 0, + memberName, + 4096 + /* CheckFlags.Late */ + ); + } + lateSymbol.nameType = type3; + addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); + if (lateSymbol.parent) { + ts2.Debug.assert(lateSymbol.parent === parent2, "Existing symbol parent should match new one"); + } else { + lateSymbol.parent = parent2; + } + return links.resolvedSymbol = lateSymbol; + } + } + return links.resolvedSymbol; + } + function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) { + var links = getSymbolLinks(symbol); + if (!links[resolutionKind]) { + var isStatic_1 = resolutionKind === "resolvedExports"; + var earlySymbols = !isStatic_1 ? symbol.members : symbol.flags & 1536 ? getExportsOfModuleWorker(symbol) : symbol.exports; + links[resolutionKind] = earlySymbols || emptySymbols; + var lateSymbols = ts2.createSymbolTable(); + for (var _i = 0, _a2 = symbol.declarations || ts2.emptyArray; _i < _a2.length; _i++) { + var decl = _a2[_i]; + var members = ts2.getMembersOfDeclaration(decl); + if (members) { + for (var _b = 0, members_5 = members; _b < members_5.length; _b++) { + var member = members_5[_b]; + if (isStatic_1 === ts2.hasStaticModifier(member)) { + if (hasLateBindableName(member)) { + lateBindMember(symbol, earlySymbols, lateSymbols, member); + } + } + } + } + } + var assignments = symbol.assignmentDeclarationMembers; + if (assignments) { + var decls = ts2.arrayFrom(assignments.values()); + for (var _c = 0, decls_1 = decls; _c < decls_1.length; _c++) { + var member = decls_1[_c]; + var assignmentKind = ts2.getAssignmentDeclarationKind(member); + var isInstanceMember = assignmentKind === 3 || ts2.isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) || assignmentKind === 9 || assignmentKind === 6; + if (isStatic_1 === !isInstanceMember) { + if (hasLateBindableName(member)) { + lateBindMember(symbol, earlySymbols, lateSymbols, member); + } + } + } + } + links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols; + } + return links[resolutionKind]; + } + function getMembersOfSymbol(symbol) { + return symbol.flags & 6256 ? getResolvedMembersOrExportsOfSymbol( + symbol, + "resolvedMembers" + /* MembersOrExportsResolutionKind.resolvedMembers */ + ) : symbol.members || emptySymbols; + } + function getLateBoundSymbol(symbol) { + if (symbol.flags & 106500 && symbol.escapedName === "__computed") { + var links = getSymbolLinks(symbol); + if (!links.lateSymbol && ts2.some(symbol.declarations, hasLateBindableName)) { + var parent2 = getMergedSymbol(symbol.parent); + if (ts2.some(symbol.declarations, ts2.hasStaticModifier)) { + getExportsOfSymbol(parent2); + } else { + getMembersOfSymbol(parent2); + } + } + return links.lateSymbol || (links.lateSymbol = symbol); + } + return symbol; + } + function getTypeWithThisArgument(type3, thisArgument, needApparentType) { + if (ts2.getObjectFlags(type3) & 4) { + var target = type3.target; + var typeArguments = getTypeArguments(type3); + if (ts2.length(target.typeParameters) === ts2.length(typeArguments)) { + var ref = createTypeReference(target, ts2.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; + } + } else if (type3.flags & 2097152) { + var types3 = ts2.sameMap(type3.types, function(t8) { + return getTypeWithThisArgument(t8, thisArgument, needApparentType); + }); + return types3 !== type3.types ? getIntersectionType(types3) : type3; + } + return needApparentType ? getApparentType(type3) : type3; + } + function resolveObjectTypeMembers(type3, source, typeParameters, typeArguments) { + var mapper; + var members; + var callSignatures; + var constructSignatures; + var indexInfos; + if (ts2.rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { + members = source.symbol ? getMembersOfSymbol(source.symbol) : ts2.createSymbolTable(source.declaredProperties); + callSignatures = source.declaredCallSignatures; + constructSignatures = source.declaredConstructSignatures; + indexInfos = source.declaredIndexInfos; + } else { + mapper = createTypeMapper(typeParameters, typeArguments); + members = createInstantiatedSymbolTable( + source.declaredProperties, + mapper, + /*mappingThisOnly*/ + typeParameters.length === 1 + ); + callSignatures = instantiateSignatures(source.declaredCallSignatures, mapper); + constructSignatures = instantiateSignatures(source.declaredConstructSignatures, mapper); + indexInfos = instantiateIndexInfos(source.declaredIndexInfos, mapper); + } + var baseTypes = getBaseTypes(source); + if (baseTypes.length) { + if (source.symbol && members === getMembersOfSymbol(source.symbol)) { + members = ts2.createSymbolTable(source.declaredProperties); + } + setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos); + var thisArgument = ts2.lastOrUndefined(typeArguments); + for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { + var baseType = baseTypes_1[_i]; + var instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + callSignatures = ts2.concatenate(callSignatures, getSignaturesOfType( + instantiatedBaseType, + 0 + /* SignatureKind.Call */ + )); + constructSignatures = ts2.concatenate(constructSignatures, getSignaturesOfType( + instantiatedBaseType, + 1 + /* SignatureKind.Construct */ + )); + var inheritedIndexInfos = instantiatedBaseType !== anyType2 ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + )]; + indexInfos = ts2.concatenate(indexInfos, ts2.filter(inheritedIndexInfos, function(info2) { + return !findIndexInfo(indexInfos, info2.keyType); + })); + } + } + setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos); + } + function resolveClassOrInterfaceMembers(type3) { + resolveObjectTypeMembers(type3, resolveDeclaredMembers(type3), ts2.emptyArray, ts2.emptyArray); + } + function resolveTypeReferenceMembers(type3) { + var source = resolveDeclaredMembers(type3.target); + var typeParameters = ts2.concatenate(source.typeParameters, [source.thisType]); + var typeArguments = getTypeArguments(type3); + var paddedTypeArguments = typeArguments.length === typeParameters.length ? typeArguments : ts2.concatenate(typeArguments, [type3]); + resolveObjectTypeMembers(type3, source, typeParameters, paddedTypeArguments); + } + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) { + var sig = new Signature(checker, flags); + sig.declaration = declaration; + sig.typeParameters = typeParameters; + sig.parameters = parameters; + sig.thisParameter = thisParameter; + sig.resolvedReturnType = resolvedReturnType; + sig.resolvedTypePredicate = resolvedTypePredicate; + sig.minArgumentCount = minArgumentCount; + sig.resolvedMinArgumentCount = void 0; + sig.target = void 0; + sig.mapper = void 0; + sig.compositeSignatures = void 0; + sig.compositeKind = void 0; + return sig; + } + function cloneSignature(sig) { + var result2 = createSignature( + sig.declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags & 39 + /* SignatureFlags.PropagatingFlags */ + ); + result2.target = sig.target; + result2.mapper = sig.mapper; + result2.compositeSignatures = sig.compositeSignatures; + result2.compositeKind = sig.compositeKind; + return result2; + } + function createUnionSignature(signature, unionSignatures) { + var result2 = cloneSignature(signature); + result2.compositeSignatures = unionSignatures; + result2.compositeKind = 1048576; + result2.target = void 0; + result2.mapper = void 0; + return result2; + } + function getOptionalCallSignature(signature, callChainFlags) { + if ((signature.flags & 24) === callChainFlags) { + return signature; + } + if (!signature.optionalCallSignatureCache) { + signature.optionalCallSignatureCache = {}; + } + var key = callChainFlags === 8 ? "inner" : "outer"; + return signature.optionalCallSignatureCache[key] || (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags)); + } + function createOptionalCallSignature(signature, callChainFlags) { + ts2.Debug.assert(callChainFlags === 8 || callChainFlags === 16, "An optional call signature can either be for an inner call chain or an outer call chain, but not both."); + var result2 = cloneSignature(signature); + result2.flags |= callChainFlags; + return result2; + } + function getExpandedParameters(sig, skipUnionExpanding) { + if (signatureHasRestParameter(sig)) { + var restIndex_1 = sig.parameters.length - 1; + var restType = getTypeOfSymbol(sig.parameters[restIndex_1]); + if (isTupleType(restType)) { + return [expandSignatureParametersWithTupleMembers(restType, restIndex_1)]; + } else if (!skipUnionExpanding && restType.flags & 1048576 && ts2.every(restType.types, isTupleType)) { + return ts2.map(restType.types, function(t8) { + return expandSignatureParametersWithTupleMembers(t8, restIndex_1); + }); + } + } + return [sig.parameters]; + function expandSignatureParametersWithTupleMembers(restType2, restIndex) { + var elementTypes = getTypeArguments(restType2); + var associatedNames = restType2.target.labeledElementDeclarations; + var restParams = ts2.map(elementTypes, function(t8, i7) { + var tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i7]); + var name2 = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i7, restType2); + var flags = restType2.target.elementFlags[i7]; + var checkFlags = flags & 12 ? 32768 : flags & 2 ? 16384 : 0; + var symbol = createSymbol(1, name2, checkFlags); + symbol.type = flags & 4 ? createArrayType(t8) : t8; + return symbol; + }); + return ts2.concatenate(sig.parameters.slice(0, restIndex), restParams); + } + } + function getDefaultConstructSignatures(classType) { + var baseConstructorType = getBaseConstructorTypeOfClass(classType); + var baseSignatures = getSignaturesOfType( + baseConstructorType, + 1 + /* SignatureKind.Construct */ + ); + var declaration = ts2.getClassLikeDeclarationOfSymbol(classType.symbol); + var isAbstract = !!declaration && ts2.hasSyntacticModifier( + declaration, + 256 + /* ModifierFlags.Abstract */ + ); + if (baseSignatures.length === 0) { + return [createSignature( + void 0, + classType.localTypeParameters, + void 0, + ts2.emptyArray, + classType, + /*resolvedTypePredicate*/ + void 0, + 0, + isAbstract ? 4 : 0 + /* SignatureFlags.None */ + )]; + } + var baseTypeNode = getBaseTypeNodeOfClass(classType); + var isJavaScript = ts2.isInJSFile(baseTypeNode); + var typeArguments = typeArgumentsFromTypeReferenceNode(baseTypeNode); + var typeArgCount = ts2.length(typeArguments); + var result2 = []; + for (var _i = 0, baseSignatures_1 = baseSignatures; _i < baseSignatures_1.length; _i++) { + var baseSig = baseSignatures_1[_i]; + var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + var typeParamCount = ts2.length(baseSig.typeParameters); + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { + var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); + sig.typeParameters = classType.localTypeParameters; + sig.resolvedReturnType = classType; + sig.flags = isAbstract ? sig.flags | 4 : sig.flags & ~4; + result2.push(sig); + } + } + return result2; + } + function findMatchingSignature(signatureList, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes) { + for (var _i = 0, signatureList_1 = signatureList; _i < signatureList_1.length; _i++) { + var s7 = signatureList_1[_i]; + if (compareSignaturesIdentical(s7, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, partialMatch ? compareTypesSubtypeOf : compareTypesIdentical)) { + return s7; + } + } + } + function findMatchingSignatures(signatureLists, signature, listIndex) { + if (signature.typeParameters) { + if (listIndex > 0) { + return void 0; + } + for (var i7 = 1; i7 < signatureLists.length; i7++) { + if (!findMatchingSignature( + signatureLists[i7], + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false + )) { + return void 0; + } + } + return [signature]; + } + var result2; + for (var i7 = 0; i7 < signatureLists.length; i7++) { + var match = i7 === listIndex ? signature : findMatchingSignature( + signatureLists[i7], + signature, + /*partialMatch*/ + true, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true + ); + if (!match) { + return void 0; + } + result2 = ts2.appendIfUnique(result2, match); + } + return result2; + } + function getUnionSignatures(signatureLists) { + var result2; + var indexWithLengthOverOne; + for (var i7 = 0; i7 < signatureLists.length; i7++) { + if (signatureLists[i7].length === 0) + return ts2.emptyArray; + if (signatureLists[i7].length > 1) { + indexWithLengthOverOne = indexWithLengthOverOne === void 0 ? i7 : -1; + } + for (var _i = 0, _a2 = signatureLists[i7]; _i < _a2.length; _i++) { + var signature = _a2[_i]; + if (!result2 || !findMatchingSignature( + result2, + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true + )) { + var unionSignatures = findMatchingSignatures(signatureLists, signature, i7); + if (unionSignatures) { + var s7 = signature; + if (unionSignatures.length > 1) { + var thisParameter = signature.thisParameter; + var firstThisParameterOfUnionSignatures = ts2.forEach(unionSignatures, function(sig) { + return sig.thisParameter; + }); + if (firstThisParameterOfUnionSignatures) { + var thisType = getIntersectionType(ts2.mapDefined(unionSignatures, function(sig) { + return sig.thisParameter && getTypeOfSymbol(sig.thisParameter); + })); + thisParameter = createSymbolWithType(firstThisParameterOfUnionSignatures, thisType); + } + s7 = createUnionSignature(signature, unionSignatures); + s7.thisParameter = thisParameter; + } + (result2 || (result2 = [])).push(s7); + } + } + } + } + if (!ts2.length(result2) && indexWithLengthOverOne !== -1) { + var masterList = signatureLists[indexWithLengthOverOne !== void 0 ? indexWithLengthOverOne : 0]; + var results = masterList.slice(); + var _loop_10 = function(signatures2) { + if (signatures2 !== masterList) { + var signature_1 = signatures2[0]; + ts2.Debug.assert(!!signature_1, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); + results = !!signature_1.typeParameters && ts2.some(results, function(s8) { + return !!s8.typeParameters && !compareTypeParametersIdentical(signature_1.typeParameters, s8.typeParameters); + }) ? void 0 : ts2.map(results, function(sig) { + return combineSignaturesOfUnionMembers(sig, signature_1); + }); + if (!results) { + return "break"; + } + } + }; + for (var _b = 0, signatureLists_1 = signatureLists; _b < signatureLists_1.length; _b++) { + var signatures = signatureLists_1[_b]; + var state_3 = _loop_10(signatures); + if (state_3 === "break") + break; + } + result2 = results; + } + return result2 || ts2.emptyArray; + } + function compareTypeParametersIdentical(sourceParams, targetParams) { + if (ts2.length(sourceParams) !== ts2.length(targetParams)) { + return false; + } + if (!sourceParams || !targetParams) { + return true; + } + var mapper = createTypeMapper(targetParams, sourceParams); + for (var i7 = 0; i7 < sourceParams.length; i7++) { + var source = sourceParams[i7]; + var target = targetParams[i7]; + if (source === target) + continue; + if (!isTypeIdenticalTo(getConstraintFromTypeParameter(source) || unknownType2, instantiateType(getConstraintFromTypeParameter(target) || unknownType2, mapper))) + return false; + } + return true; + } + function combineUnionThisParam(left, right, mapper) { + if (!left || !right) { + return left || right; + } + var thisType = getIntersectionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); + return createSymbolWithType(left, thisType); + } + function combineUnionParameters(left, right, mapper) { + var leftCount = getParameterCount(left); + var rightCount = getParameterCount(right); + var longest = leftCount >= rightCount ? left : right; + var shorter = longest === left ? right : left; + var longestCount = longest === left ? leftCount : rightCount; + var eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); + var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (var i7 = 0; i7 < longestCount; i7++) { + var longestParamType = tryGetTypeAtPosition(longest, i7); + if (longest === right) { + longestParamType = instantiateType(longestParamType, mapper); + } + var shorterParamType = tryGetTypeAtPosition(shorter, i7) || unknownType2; + if (shorter === right) { + shorterParamType = instantiateType(shorterParamType, mapper); + } + var unionParamType = getIntersectionType([longestParamType, shorterParamType]); + var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i7 === longestCount - 1; + var isOptional2 = i7 >= getMinArgumentCount(longest) && i7 >= getMinArgumentCount(shorter); + var leftName = i7 >= leftCount ? void 0 : getParameterNameAtPosition(left, i7); + var rightName = i7 >= rightCount ? void 0 : getParameterNameAtPosition(right, i7); + var paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; + var paramSymbol = createSymbol(1 | (isOptional2 && !isRestParam ? 16777216 : 0), paramName || "arg".concat(i7)); + paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i7] = paramSymbol; + } + if (needsExtraRestElement) { + var restParamSymbol = createSymbol(1, "args"); + restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + if (shorter === right) { + restParamSymbol.type = instantiateType(restParamSymbol.type, mapper); + } + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfUnionMembers(left, right) { + var typeParams = left.typeParameters || right.typeParameters; + var paramMapper; + if (left.typeParameters && right.typeParameters) { + paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); + } + var declaration = left.declaration; + var params = combineUnionParameters(left, right, paramMapper); + var thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper); + var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + var result2 = createSignature( + declaration, + typeParams, + thisParam, + params, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgCount, + (left.flags | right.flags) & 39 + /* SignatureFlags.PropagatingFlags */ + ); + result2.compositeKind = 1048576; + result2.compositeSignatures = ts2.concatenate(left.compositeKind !== 2097152 && left.compositeSignatures || [left], [right]); + if (paramMapper) { + result2.mapper = left.compositeKind !== 2097152 && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper; + } + return result2; + } + function getUnionIndexInfos(types3) { + var sourceInfos = getIndexInfosOfType(types3[0]); + if (sourceInfos) { + var result2 = []; + var _loop_11 = function(info3) { + var indexType = info3.keyType; + if (ts2.every(types3, function(t8) { + return !!getIndexInfoOfType(t8, indexType); + })) { + result2.push(createIndexInfo(indexType, getUnionType(ts2.map(types3, function(t8) { + return getIndexTypeOfType(t8, indexType); + })), ts2.some(types3, function(t8) { + return getIndexInfoOfType(t8, indexType).isReadonly; + }))); + } + }; + for (var _i = 0, sourceInfos_1 = sourceInfos; _i < sourceInfos_1.length; _i++) { + var info2 = sourceInfos_1[_i]; + _loop_11(info2); + } + return result2; + } + return ts2.emptyArray; + } + function resolveUnionTypeMembers(type3) { + var callSignatures = getUnionSignatures(ts2.map(type3.types, function(t8) { + return t8 === globalFunctionType ? [unknownSignature] : getSignaturesOfType( + t8, + 0 + /* SignatureKind.Call */ + ); + })); + var constructSignatures = getUnionSignatures(ts2.map(type3.types, function(t8) { + return getSignaturesOfType( + t8, + 1 + /* SignatureKind.Construct */ + ); + })); + var indexInfos = getUnionIndexInfos(type3.types); + setStructuredTypeMembers(type3, emptySymbols, callSignatures, constructSignatures, indexInfos); + } + function intersectTypes(type1, type22) { + return !type1 ? type22 : !type22 ? type1 : getIntersectionType([type1, type22]); + } + function findMixins(types3) { + var constructorTypeCount = ts2.countWhere(types3, function(t8) { + return getSignaturesOfType( + t8, + 1 + /* SignatureKind.Construct */ + ).length > 0; + }); + var mixinFlags = ts2.map(types3, isMixinConstructorType); + if (constructorTypeCount > 0 && constructorTypeCount === ts2.countWhere(mixinFlags, function(b8) { + return b8; + })) { + var firstMixinIndex = mixinFlags.indexOf( + /*searchElement*/ + true + ); + mixinFlags[firstMixinIndex] = false; + } + return mixinFlags; + } + function includeMixinType(type3, types3, mixinFlags, index4) { + var mixedTypes = []; + for (var i7 = 0; i7 < types3.length; i7++) { + if (i7 === index4) { + mixedTypes.push(type3); + } else if (mixinFlags[i7]) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType( + types3[i7], + 1 + /* SignatureKind.Construct */ + )[0])); + } + } + return getIntersectionType(mixedTypes); + } + function resolveIntersectionTypeMembers(type3) { + var callSignatures; + var constructSignatures; + var indexInfos; + var types3 = type3.types; + var mixinFlags = findMixins(types3); + var mixinCount = ts2.countWhere(mixinFlags, function(b8) { + return b8; + }); + var _loop_12 = function(i8) { + var t8 = type3.types[i8]; + if (!mixinFlags[i8]) { + var signatures = getSignaturesOfType( + t8, + 1 + /* SignatureKind.Construct */ + ); + if (signatures.length && mixinCount > 0) { + signatures = ts2.map(signatures, function(s7) { + var clone2 = cloneSignature(s7); + clone2.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s7), types3, mixinFlags, i8); + return clone2; + }); + } + constructSignatures = appendSignatures(constructSignatures, signatures); + } + callSignatures = appendSignatures(callSignatures, getSignaturesOfType( + t8, + 0 + /* SignatureKind.Call */ + )); + indexInfos = ts2.reduceLeft(getIndexInfosOfType(t8), function(infos, newInfo) { + return appendIndexInfo( + infos, + newInfo, + /*union*/ + false + ); + }, indexInfos); + }; + for (var i7 = 0; i7 < types3.length; i7++) { + _loop_12(i7); + } + setStructuredTypeMembers(type3, emptySymbols, callSignatures || ts2.emptyArray, constructSignatures || ts2.emptyArray, indexInfos || ts2.emptyArray); + } + function appendSignatures(signatures, newSignatures) { + var _loop_13 = function(sig2) { + if (!signatures || ts2.every(signatures, function(s7) { + return !compareSignaturesIdentical( + s7, + sig2, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false, + compareTypesIdentical + ); + })) { + signatures = ts2.append(signatures, sig2); + } + }; + for (var _i = 0, newSignatures_1 = newSignatures; _i < newSignatures_1.length; _i++) { + var sig = newSignatures_1[_i]; + _loop_13(sig); + } + return signatures; + } + function appendIndexInfo(indexInfos, newInfo, union2) { + if (indexInfos) { + for (var i7 = 0; i7 < indexInfos.length; i7++) { + var info2 = indexInfos[i7]; + if (info2.keyType === newInfo.keyType) { + indexInfos[i7] = createIndexInfo(info2.keyType, union2 ? getUnionType([info2.type, newInfo.type]) : getIntersectionType([info2.type, newInfo.type]), union2 ? info2.isReadonly || newInfo.isReadonly : info2.isReadonly && newInfo.isReadonly); + return indexInfos; + } + } + } + return ts2.append(indexInfos, newInfo); + } + function resolveAnonymousTypeMembers(type3) { + if (type3.target) { + setStructuredTypeMembers(type3, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var members_6 = createInstantiatedSymbolTable( + getPropertiesOfObjectType(type3.target), + type3.mapper, + /*mappingThisOnly*/ + false + ); + var callSignatures = instantiateSignatures(getSignaturesOfType( + type3.target, + 0 + /* SignatureKind.Call */ + ), type3.mapper); + var constructSignatures = instantiateSignatures(getSignaturesOfType( + type3.target, + 1 + /* SignatureKind.Construct */ + ), type3.mapper); + var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type3.target), type3.mapper); + setStructuredTypeMembers(type3, members_6, callSignatures, constructSignatures, indexInfos_1); + return; + } + var symbol = getMergedSymbol(type3.symbol); + if (symbol.flags & 2048) { + setStructuredTypeMembers(type3, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var members_7 = getMembersOfSymbol(symbol); + var callSignatures = getSignaturesOfSymbol(members_7.get( + "__call" + /* InternalSymbolName.Call */ + )); + var constructSignatures = getSignaturesOfSymbol(members_7.get( + "__new" + /* InternalSymbolName.New */ + )); + var indexInfos_2 = getIndexInfosOfSymbol(symbol); + setStructuredTypeMembers(type3, members_7, callSignatures, constructSignatures, indexInfos_2); + return; + } + var members = emptySymbols; + var indexInfos; + if (symbol.exports) { + members = getExportsOfSymbol(symbol); + if (symbol === globalThisSymbol) { + var varsOnly_1 = new ts2.Map(); + members.forEach(function(p7) { + var _a2; + if (!(p7.flags & 418) && !(p7.flags & 512 && ((_a2 = p7.declarations) === null || _a2 === void 0 ? void 0 : _a2.length) && ts2.every(p7.declarations, ts2.isAmbientModule))) { + varsOnly_1.set(p7.escapedName, p7); + } + }); + members = varsOnly_1; + } + } + var baseConstructorIndexInfo; + setStructuredTypeMembers(type3, members, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + if (symbol.flags & 32) { + var classType = getDeclaredTypeOfClassOrInterface(symbol); + var baseConstructorType = getBaseConstructorTypeOfClass(classType); + if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) { + members = ts2.createSymbolTable(getNamedOrIndexSignatureMembers(members)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } else if (baseConstructorType === anyType2) { + baseConstructorIndexInfo = createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + ); + } + } + var indexSymbol = getIndexSymbolFromSymbolTable(members); + if (indexSymbol) { + indexInfos = getIndexInfosOfIndexSymbol(indexSymbol); + } else { + if (baseConstructorIndexInfo) { + indexInfos = ts2.append(indexInfos, baseConstructorIndexInfo); + } + if (symbol.flags & 384 && (getDeclaredTypeOfSymbol(symbol).flags & 32 || ts2.some(type3.properties, function(prop) { + return !!(getTypeOfSymbol(prop).flags & 296); + }))) { + indexInfos = ts2.append(indexInfos, enumNumberIndexInfo); + } + } + setStructuredTypeMembers(type3, members, ts2.emptyArray, ts2.emptyArray, indexInfos || ts2.emptyArray); + if (symbol.flags & (16 | 8192)) { + type3.callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 32) { + var classType_1 = getDeclaredTypeOfClassOrInterface(symbol); + var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get( + "__constructor" + /* InternalSymbolName.Constructor */ + )) : ts2.emptyArray; + if (symbol.flags & 16) { + constructSignatures = ts2.addRange(constructSignatures.slice(), ts2.mapDefined(type3.callSignatures, function(sig) { + return isJSConstructor(sig.declaration) ? createSignature( + sig.declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + classType_1, + /*resolvedTypePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags & 39 + /* SignatureFlags.PropagatingFlags */ + ) : void 0; + })); + } + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType_1); + } + type3.constructSignatures = constructSignatures; + } + } + function replaceIndexedAccess(instantiable, type3, replacement) { + return instantiateType(instantiable, createTypeMapper([type3.indexType, type3.objectType], [getNumberLiteralType(0), createTupleType([replacement])])); + } + function resolveReverseMappedTypeMembers(type3) { + var indexInfo = getIndexInfoOfType(type3.source, stringType2); + var modifiers = getMappedTypeModifiers(type3.mappedType); + var readonlyMask = modifiers & 1 ? false : true; + var optionalMask = modifiers & 4 ? 0 : 16777216; + var indexInfos = indexInfo ? [createIndexInfo(stringType2, inferReverseMappedType(indexInfo.type, type3.mappedType, type3.constraintType), readonlyMask && indexInfo.isReadonly)] : ts2.emptyArray; + var members = ts2.createSymbolTable(); + for (var _i = 0, _a2 = getPropertiesOfType(type3.source); _i < _a2.length; _i++) { + var prop = _a2[_i]; + var checkFlags = 8192 | (readonlyMask && isReadonlySymbol(prop) ? 8 : 0); + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.nameType = getSymbolLinks(prop).nameType; + inferredProp.propertyType = getTypeOfSymbol(prop); + if (type3.constraintType.type.flags & 8388608 && type3.constraintType.type.objectType.flags & 262144 && type3.constraintType.type.indexType.flags & 262144) { + var newTypeParam = type3.constraintType.type.objectType; + var newMappedType = replaceIndexedAccess(type3.mappedType, type3.constraintType.type, newTypeParam); + inferredProp.mappedType = newMappedType; + inferredProp.constraintType = getIndexType(newTypeParam); + } else { + inferredProp.mappedType = type3.mappedType; + inferredProp.constraintType = type3.constraintType; + } + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type3, members, ts2.emptyArray, ts2.emptyArray, indexInfos); + } + function getLowerBoundOfKeyType(type3) { + if (type3.flags & 4194304) { + var t8 = getApparentType(type3.type); + return isGenericTupleType(t8) ? getKnownKeysOfTupleType(t8) : getIndexType(t8); + } + if (type3.flags & 16777216) { + if (type3.root.isDistributive) { + var checkType = type3.checkType; + var constraint = getLowerBoundOfKeyType(checkType); + if (constraint !== checkType) { + return getConditionalTypeInstantiation(type3, prependTypeMapping(type3.root.checkType, constraint, type3.mapper)); + } + } + return type3; + } + if (type3.flags & 1048576) { + return mapType2(type3, getLowerBoundOfKeyType); + } + if (type3.flags & 2097152) { + var types3 = type3.types; + if (types3.length === 2 && !!(types3[0].flags & (4 | 8 | 64)) && types3[1] === emptyTypeLiteralType) { + return type3; + } + return getIntersectionType(ts2.sameMap(type3.types, getLowerBoundOfKeyType)); + } + return type3; + } + function getIsLateCheckFlag(s7) { + return ts2.getCheckFlags(s7) & 4096; + } + function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type3, include, stringsOnly, cb) { + for (var _i = 0, _a2 = getPropertiesOfType(type3); _i < _a2.length; _i++) { + var prop = _a2[_i]; + cb(getLiteralTypeFromProperty(prop, include)); + } + if (type3.flags & 1) { + cb(stringType2); + } else { + for (var _b = 0, _c = getIndexInfosOfType(type3); _b < _c.length; _b++) { + var info2 = _c[_b]; + if (!stringsOnly || info2.keyType.flags & (4 | 134217728)) { + cb(info2.keyType); + } + } + } + } + function resolveMappedTypeMembers(type3) { + var members = ts2.createSymbolTable(); + var indexInfos; + setStructuredTypeMembers(type3, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + var typeParameter = getTypeParameterFromMappedType(type3); + var constraintType = getConstraintTypeFromMappedType(type3); + var nameType = getNameTypeFromMappedType(type3.target || type3); + var templateType = getTemplateTypeFromMappedType(type3.target || type3); + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type3)); + var templateModifiers = getMappedTypeModifiers(type3); + var include = keyofStringsOnly ? 128 : 8576; + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType); + } else { + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); + } + setStructuredTypeMembers(type3, members, ts2.emptyArray, ts2.emptyArray, indexInfos || ts2.emptyArray); + function addMemberForKeyType(keyType) { + var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type3.mapper, typeParameter, keyType)) : keyType; + forEachType(propNameType, function(t8) { + return addMemberForKeyTypeWorker(keyType, t8); + }); + } + function addMemberForKeyTypeWorker(keyType, propNameType) { + if (isTypeUsableAsPropertyName(propNameType)) { + var propName2 = getPropertyNameFromType(propNameType); + var existingProp = members.get(propName2); + if (existingProp) { + existingProp.nameType = getUnionType([existingProp.nameType, propNameType]); + existingProp.keyType = getUnionType([existingProp.keyType, keyType]); + } else { + var modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0; + var isOptional2 = !!(templateModifiers & 4 || !(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216); + var isReadonly = !!(templateModifiers & 1 || !(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp)); + var stripOptional = strictNullChecks && !isOptional2 && modifiersProp && modifiersProp.flags & 16777216; + var lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0; + var prop = createSymbol(4 | (isOptional2 ? 16777216 : 0), propName2, lateFlag | 262144 | (isReadonly ? 8 : 0) | (stripOptional ? 524288 : 0)); + prop.mappedType = type3; + prop.nameType = propNameType; + prop.keyType = keyType; + if (modifiersProp) { + prop.syntheticOrigin = modifiersProp; + prop.declarations = nameType ? void 0 : modifiersProp.declarations; + } + members.set(propName2, prop); + } + } else if (isValidIndexKeyType(propNameType) || propNameType.flags & (1 | 32)) { + var indexKeyType = propNameType.flags & (1 | 4) ? stringType2 : propNameType.flags & (8 | 32) ? numberType2 : propNameType; + var propType = instantiateType(templateType, appendTypeMapping(type3.mapper, typeParameter, keyType)); + var indexInfo = createIndexInfo(indexKeyType, propType, !!(templateModifiers & 1)); + indexInfos = appendIndexInfo( + indexInfos, + indexInfo, + /*union*/ + true + ); + } + } + } + function getTypeOfMappedSymbol(symbol) { + if (!symbol.type) { + var mappedType = symbol.mappedType; + if (!pushTypeResolution( + symbol, + 0 + /* TypeSystemPropertyName.Type */ + )) { + mappedType.containsError = true; + return errorType; + } + var templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); + var mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType); + var propType = instantiateType(templateType, mapper); + var type3 = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind( + propType, + 32768 | 16384 + /* TypeFlags.Void */ + ) ? getOptionalType( + propType, + /*isProperty*/ + true + ) : symbol.checkFlags & 524288 ? removeMissingOrUndefinedType(propType) : propType; + if (!popTypeResolution()) { + error2(currentNode, ts2.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString2(symbol), typeToString(mappedType)); + type3 = errorType; + } + symbol.type = type3; + } + return symbol.type; + } + function getTypeParameterFromMappedType(type3) { + return type3.typeParameter || (type3.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(type3.declaration.typeParameter))); + } + function getConstraintTypeFromMappedType(type3) { + return type3.constraintType || (type3.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type3)) || errorType); + } + function getNameTypeFromMappedType(type3) { + return type3.declaration.nameType ? type3.nameType || (type3.nameType = instantiateType(getTypeFromTypeNode(type3.declaration.nameType), type3.mapper)) : void 0; + } + function getTemplateTypeFromMappedType(type3) { + return type3.templateType || (type3.templateType = type3.declaration.type ? instantiateType(addOptionality( + getTypeFromTypeNode(type3.declaration.type), + /*isProperty*/ + true, + !!(getMappedTypeModifiers(type3) & 4) + ), type3.mapper) : errorType); + } + function getConstraintDeclarationForMappedType(type3) { + return ts2.getEffectiveConstraintOfTypeParameter(type3.declaration.typeParameter); + } + function isMappedTypeWithKeyofConstraintDeclaration(type3) { + var constraintDeclaration = getConstraintDeclarationForMappedType(type3); + return constraintDeclaration.kind === 195 && constraintDeclaration.operator === 141; + } + function getModifiersTypeFromMappedType(type3) { + if (!type3.modifiersType) { + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + type3.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type3).type), type3.mapper); + } else { + var declaredType = getTypeFromMappedTypeNode(type3.declaration); + var constraint = getConstraintTypeFromMappedType(declaredType); + var extendedConstraint = constraint && constraint.flags & 262144 ? getConstraintOfTypeParameter(constraint) : constraint; + type3.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 ? instantiateType(extendedConstraint.type, type3.mapper) : unknownType2; + } + } + return type3.modifiersType; + } + function getMappedTypeModifiers(type3) { + var declaration = type3.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 40 ? 2 : 1 : 0) | (declaration.questionToken ? declaration.questionToken.kind === 40 ? 8 : 4 : 0); + } + function getMappedTypeOptionality(type3) { + var modifiers = getMappedTypeModifiers(type3); + return modifiers & 8 ? -1 : modifiers & 4 ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type3) { + var optionality = getMappedTypeOptionality(type3); + var modifiersType = getModifiersTypeFromMappedType(type3); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); + } + function isPartialMappedType(type3) { + return !!(ts2.getObjectFlags(type3) & 32 && getMappedTypeModifiers(type3) & 4); + } + function isGenericMappedType(type3) { + if (ts2.getObjectFlags(type3) & 32) { + var constraint = getConstraintTypeFromMappedType(type3); + if (isGenericIndexType(constraint)) { + return true; + } + var nameType = getNameTypeFromMappedType(type3); + if (nameType && isGenericIndexType(instantiateType(nameType, makeUnaryTypeMapper(getTypeParameterFromMappedType(type3), constraint)))) { + return true; + } + } + return false; + } + function resolveStructuredTypeMembers(type3) { + if (!type3.members) { + if (type3.flags & 524288) { + if (type3.objectFlags & 4) { + resolveTypeReferenceMembers(type3); + } else if (type3.objectFlags & 3) { + resolveClassOrInterfaceMembers(type3); + } else if (type3.objectFlags & 1024) { + resolveReverseMappedTypeMembers(type3); + } else if (type3.objectFlags & 16) { + resolveAnonymousTypeMembers(type3); + } else if (type3.objectFlags & 32) { + resolveMappedTypeMembers(type3); + } else { + ts2.Debug.fail("Unhandled object type " + ts2.Debug.formatObjectFlags(type3.objectFlags)); + } + } else if (type3.flags & 1048576) { + resolveUnionTypeMembers(type3); + } else if (type3.flags & 2097152) { + resolveIntersectionTypeMembers(type3); + } else { + ts2.Debug.fail("Unhandled type " + ts2.Debug.formatTypeFlags(type3.flags)); + } + } + return type3; + } + function getPropertiesOfObjectType(type3) { + if (type3.flags & 524288) { + return resolveStructuredTypeMembers(type3).properties; + } + return ts2.emptyArray; + } + function getPropertyOfObjectType(type3, name2) { + if (type3.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type3); + var symbol = resolved.members.get(name2); + if (symbol && symbolIsValue(symbol)) { + return symbol; + } + } + } + function getPropertiesOfUnionOrIntersectionType(type3) { + if (!type3.resolvedProperties) { + var members = ts2.createSymbolTable(); + for (var _i = 0, _a2 = type3.types; _i < _a2.length; _i++) { + var current = _a2[_i]; + for (var _b = 0, _c = getPropertiesOfType(current); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.escapedName)) { + var combinedProp = getPropertyOfUnionOrIntersectionType(type3, prop.escapedName); + if (combinedProp) { + members.set(prop.escapedName, combinedProp); + } + } + } + if (type3.flags & 1048576 && getIndexInfosOfType(current).length === 0) { + break; + } + } + type3.resolvedProperties = getNamedMembers(members); + } + return type3.resolvedProperties; + } + function getPropertiesOfType(type3) { + type3 = getReducedApparentType(type3); + return type3.flags & 3145728 ? getPropertiesOfUnionOrIntersectionType(type3) : getPropertiesOfObjectType(type3); + } + function forEachPropertyOfType(type3, action) { + type3 = getReducedApparentType(type3); + if (type3.flags & 3670016) { + resolveStructuredTypeMembers(type3).members.forEach(function(symbol, escapedName) { + if (isNamedMember(symbol, escapedName)) { + action(symbol, escapedName); + } + }); + } + } + function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) { + var list = obj.properties; + return list.some(function(property2) { + var nameType = property2.name && getLiteralTypeFromPropertyName(property2.name); + var name2 = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; + var expected = name2 === void 0 ? void 0 : getTypeOfPropertyOfType(contextualType, name2); + return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property2), expected); + }); + } + function getAllPossiblePropertiesOfTypes(types3) { + var unionType2 = getUnionType(types3); + if (!(unionType2.flags & 1048576)) { + return getAugmentedPropertiesOfType(unionType2); + } + var props = ts2.createSymbolTable(); + for (var _i = 0, types_4 = types3; _i < types_4.length; _i++) { + var memberType = types_4[_i]; + for (var _a2 = 0, _b = getAugmentedPropertiesOfType(memberType); _a2 < _b.length; _a2++) { + var escapedName = _b[_a2].escapedName; + if (!props.has(escapedName)) { + var prop = createUnionOrIntersectionProperty(unionType2, escapedName); + if (prop) + props.set(escapedName, prop); + } + } + } + return ts2.arrayFrom(props.values()); + } + function getConstraintOfType(type3) { + return type3.flags & 262144 ? getConstraintOfTypeParameter(type3) : type3.flags & 8388608 ? getConstraintOfIndexedAccess(type3) : type3.flags & 16777216 ? getConstraintOfConditionalType(type3) : getBaseConstraintOfType(type3); + } + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0; + } + function getConstraintOfIndexedAccess(type3) { + return hasNonCircularBaseConstraint(type3) ? getConstraintFromIndexedAccess(type3) : void 0; + } + function getSimplifiedTypeOrConstraint(type3) { + var simplified = getSimplifiedType( + type3, + /*writing*/ + false + ); + return simplified !== type3 ? simplified : getConstraintOfType(type3); + } + function getConstraintFromIndexedAccess(type3) { + if (isMappedTypeGenericIndexedAccess(type3)) { + return substituteIndexedMappedType(type3.objectType, type3.indexType); + } + var indexConstraint = getSimplifiedTypeOrConstraint(type3.indexType); + if (indexConstraint && indexConstraint !== type3.indexType) { + var indexedAccess = getIndexedAccessTypeOrUndefined(type3.objectType, indexConstraint, type3.accessFlags); + if (indexedAccess) { + return indexedAccess; + } + } + var objectConstraint = getSimplifiedTypeOrConstraint(type3.objectType); + if (objectConstraint && objectConstraint !== type3.objectType) { + return getIndexedAccessTypeOrUndefined(objectConstraint, type3.indexType, type3.accessFlags); + } + return void 0; + } + function getDefaultConstraintOfConditionalType(type3) { + if (!type3.resolvedDefaultConstraint) { + var trueConstraint = getInferredTrueTypeFromConditionalType(type3); + var falseConstraint = getFalseTypeFromConditionalType(type3); + type3.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]); + } + return type3.resolvedDefaultConstraint; + } + function getConstraintOfDistributiveConditionalType(type3) { + if (type3.root.isDistributive && type3.restrictiveInstantiation !== type3) { + var simplified = getSimplifiedType( + type3.checkType, + /*writing*/ + false + ); + var constraint = simplified === type3.checkType ? getConstraintOfType(simplified) : simplified; + if (constraint && constraint !== type3.checkType) { + var instantiated = getConditionalTypeInstantiation(type3, prependTypeMapping(type3.root.checkType, constraint, type3.mapper)); + if (!(instantiated.flags & 131072)) { + return instantiated; + } + } + } + return void 0; + } + function getConstraintFromConditionalType(type3) { + return getConstraintOfDistributiveConditionalType(type3) || getDefaultConstraintOfConditionalType(type3); + } + function getConstraintOfConditionalType(type3) { + return hasNonCircularBaseConstraint(type3) ? getConstraintFromConditionalType(type3) : void 0; + } + function getEffectiveConstraintOfIntersection(types3, targetIsUnion) { + var constraints; + var hasDisjointDomainType = false; + for (var _i = 0, types_5 = types3; _i < types_5.length; _i++) { + var t8 = types_5[_i]; + if (t8.flags & 465829888) { + var constraint = getConstraintOfType(t8); + while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) { + constraint = getConstraintOfType(constraint); + } + if (constraint) { + constraints = ts2.append(constraints, constraint); + if (targetIsUnion) { + constraints = ts2.append(constraints, t8); + } + } + } else if (t8.flags & 469892092 || isEmptyAnonymousObjectType(t8)) { + hasDisjointDomainType = true; + } + } + if (constraints && (targetIsUnion || hasDisjointDomainType)) { + if (hasDisjointDomainType) { + for (var _a2 = 0, types_6 = types3; _a2 < types_6.length; _a2++) { + var t8 = types_6[_a2]; + if (t8.flags & 469892092 || isEmptyAnonymousObjectType(t8)) { + constraints = ts2.append(constraints, t8); + } + } + } + return getNormalizedType( + getIntersectionType(constraints), + /*writing*/ + false + ); + } + return void 0; + } + function getBaseConstraintOfType(type3) { + if (type3.flags & (58982400 | 3145728 | 134217728 | 268435456)) { + var constraint = getResolvedBaseConstraint(type3); + return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : void 0; + } + return type3.flags & 4194304 ? keyofConstraintType : void 0; + } + function getBaseConstraintOrType(type3) { + return getBaseConstraintOfType(type3) || type3; + } + function hasNonCircularBaseConstraint(type3) { + return getResolvedBaseConstraint(type3) !== circularConstraintType; + } + function getResolvedBaseConstraint(type3) { + if (type3.resolvedBaseConstraint) { + return type3.resolvedBaseConstraint; + } + var stack = []; + return type3.resolvedBaseConstraint = getTypeWithThisArgument(getImmediateBaseConstraint(type3), type3); + function getImmediateBaseConstraint(t8) { + if (!t8.immediateBaseConstraint) { + if (!pushTypeResolution( + t8, + 4 + /* TypeSystemPropertyName.ImmediateBaseConstraint */ + )) { + return circularConstraintType; + } + var result2 = void 0; + var identity_1 = getRecursionIdentity(t8); + if (stack.length < 10 || stack.length < 50 && !ts2.contains(stack, identity_1)) { + stack.push(identity_1); + result2 = computeBaseConstraint(getSimplifiedType( + t8, + /*writing*/ + false + )); + stack.pop(); + } + if (!popTypeResolution()) { + if (t8.flags & 262144) { + var errorNode = getConstraintDeclaration(t8); + if (errorNode) { + var diagnostic = error2(errorNode, ts2.Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t8)); + if (currentNode && !ts2.isNodeDescendantOf(errorNode, currentNode) && !ts2.isNodeDescendantOf(currentNode, errorNode)) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(currentNode, ts2.Diagnostics.Circularity_originates_in_type_at_this_location)); + } + } + } + result2 = circularConstraintType; + } + t8.immediateBaseConstraint = result2 || noConstraintType; + } + return t8.immediateBaseConstraint; + } + function getBaseConstraint(t8) { + var c7 = getImmediateBaseConstraint(t8); + return c7 !== noConstraintType && c7 !== circularConstraintType ? c7 : void 0; + } + function computeBaseConstraint(t8) { + if (t8.flags & 262144) { + var constraint = getConstraintFromTypeParameter(t8); + return t8.isThisType || !constraint ? constraint : getBaseConstraint(constraint); + } + if (t8.flags & 3145728) { + var types3 = t8.types; + var baseTypes = []; + var different = false; + for (var _i = 0, types_7 = types3; _i < types_7.length; _i++) { + var type_3 = types_7[_i]; + var baseType = getBaseConstraint(type_3); + if (baseType) { + if (baseType !== type_3) { + different = true; + } + baseTypes.push(baseType); + } else { + different = true; + } + } + if (!different) { + return t8; + } + return t8.flags & 1048576 && baseTypes.length === types3.length ? getUnionType(baseTypes) : t8.flags & 2097152 && baseTypes.length ? getIntersectionType(baseTypes) : void 0; + } + if (t8.flags & 4194304) { + return keyofConstraintType; + } + if (t8.flags & 134217728) { + var types3 = t8.types; + var constraints = ts2.mapDefined(types3, getBaseConstraint); + return constraints.length === types3.length ? getTemplateLiteralType(t8.texts, constraints) : stringType2; + } + if (t8.flags & 268435456) { + var constraint = getBaseConstraint(t8.type); + return constraint && constraint !== t8.type ? getStringMappingType(t8.symbol, constraint) : stringType2; + } + if (t8.flags & 8388608) { + if (isMappedTypeGenericIndexedAccess(t8)) { + return getBaseConstraint(substituteIndexedMappedType(t8.objectType, t8.indexType)); + } + var baseObjectType = getBaseConstraint(t8.objectType); + var baseIndexType = getBaseConstraint(t8.indexType); + var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t8.accessFlags); + return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); + } + if (t8.flags & 16777216) { + var constraint = getConstraintFromConditionalType(t8); + return constraint && getBaseConstraint(constraint); + } + if (t8.flags & 33554432) { + return getBaseConstraint(getSubstitutionIntersection(t8)); + } + return t8; + } + } + function getApparentTypeOfIntersectionType(type3) { + return type3.resolvedApparentType || (type3.resolvedApparentType = getTypeWithThisArgument( + type3, + type3, + /*apparentType*/ + true + )); + } + function getResolvedTypeParameterDefault(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + var targetDefault = getResolvedTypeParameterDefault(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } else { + typeParameter.default = resolvingDefaultType; + var defaultDeclaration = typeParameter.symbol && ts2.forEach(typeParameter.symbol.declarations, function(decl) { + return ts2.isTypeParameterDeclaration(decl) && decl.default; + }); + var defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + if (typeParameter.default === resolvingDefaultType) { + typeParameter.default = defaultType; + } + } + } else if (typeParameter.default === resolvingDefaultType) { + typeParameter.default = circularConstraintType; + } + return typeParameter.default; + } + function getDefaultFromTypeParameter(typeParameter) { + var defaultType = getResolvedTypeParameterDefault(typeParameter); + return defaultType !== noConstraintType && defaultType !== circularConstraintType ? defaultType : void 0; + } + function hasNonCircularTypeParameterDefault(typeParameter) { + return getResolvedTypeParameterDefault(typeParameter) !== circularConstraintType; + } + function hasTypeParameterDefault(typeParameter) { + return !!(typeParameter.symbol && ts2.forEach(typeParameter.symbol.declarations, function(decl) { + return ts2.isTypeParameterDeclaration(decl) && decl.default; + })); + } + function getApparentTypeOfMappedType(type3) { + return type3.resolvedApparentType || (type3.resolvedApparentType = getResolvedApparentTypeOfMappedType(type3)); + } + function getResolvedApparentTypeOfMappedType(type3) { + var typeVariable = getHomomorphicTypeVariable(type3); + if (typeVariable && !type3.declaration.nameType) { + var constraint = getConstraintOfTypeParameter(typeVariable); + if (constraint && isArrayOrTupleType(constraint)) { + return instantiateType(type3, prependTypeMapping(typeVariable, constraint, type3.mapper)); + } + } + return type3; + } + function isMappedTypeGenericIndexedAccess(type3) { + var objectType2; + return !!(type3.flags & 8388608 && ts2.getObjectFlags(objectType2 = type3.objectType) & 32 && !isGenericMappedType(objectType2) && isGenericIndexType(type3.indexType) && !(getMappedTypeModifiers(objectType2) & 8) && !objectType2.declaration.nameType); + } + function getApparentType(type3) { + var t8 = !(type3.flags & 465829888) ? type3 : getBaseConstraintOfType(type3) || unknownType2; + return ts2.getObjectFlags(t8) & 32 ? getApparentTypeOfMappedType(t8) : t8.flags & 2097152 ? getApparentTypeOfIntersectionType(t8) : t8.flags & 402653316 ? globalStringType : t8.flags & 296 ? globalNumberType : t8.flags & 2112 ? getGlobalBigIntType() : t8.flags & 528 ? globalBooleanType : t8.flags & 12288 ? getGlobalESSymbolType() : t8.flags & 67108864 ? emptyObjectType : t8.flags & 4194304 ? keyofConstraintType : t8.flags & 2 && !strictNullChecks ? emptyObjectType : t8; + } + function getReducedApparentType(type3) { + return getReducedType(getApparentType(getReducedType(type3))); + } + function createUnionOrIntersectionProperty(containingType, name2, skipObjectFunctionPropertyAugment) { + var _a2, _b; + var singleProp; + var propSet; + var indexTypes; + var isUnion = containingType.flags & 1048576; + var optionalFlag; + var syntheticFlag = 4; + var checkFlags = isUnion ? 0 : 8; + var mergedInstantiations = false; + for (var _i = 0, _c = containingType.types; _i < _c.length; _i++) { + var current = _c[_i]; + var type3 = getApparentType(current); + if (!(isErrorType(type3) || type3.flags & 131072)) { + var prop = getPropertyOfType(type3, name2, skipObjectFunctionPropertyAugment); + var modifiers = prop ? ts2.getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop) { + if (prop.flags & 106500) { + optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : optionalFlag = isUnion ? 0 : 16777216; + if (isUnion) { + optionalFlag |= prop.flags & 16777216; + } else { + optionalFlag &= prop.flags; + } + } + if (!singleProp) { + singleProp = prop; + } else if (prop !== singleProp) { + var isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp); + if (isInstantiation && compareProperties(singleProp, prop, function(a7, b8) { + return a7 === b8 ? -1 : 0; + }) === -1) { + mergedInstantiations = !!singleProp.parent && !!ts2.length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(singleProp.parent)); + } else { + if (!propSet) { + propSet = new ts2.Map(); + propSet.set(getSymbolId(singleProp), singleProp); + } + var id = getSymbolId(prop); + if (!propSet.has(id)) { + propSet.set(id, prop); + } + } + } + if (isUnion && isReadonlySymbol(prop)) { + checkFlags |= 8; + } else if (!isUnion && !isReadonlySymbol(prop)) { + checkFlags &= ~8; + } + checkFlags |= (!(modifiers & 24) ? 256 : 0) | (modifiers & 16 ? 512 : 0) | (modifiers & 8 ? 1024 : 0) | (modifiers & 32 ? 2048 : 0); + if (!isPrototypeProperty(prop)) { + syntheticFlag = 2; + } + } else if (isUnion) { + var indexInfo = !isLateBoundName(name2) && getApplicableIndexInfoForName(type3, name2); + if (indexInfo) { + checkFlags |= 32 | (indexInfo.isReadonly ? 8 : 0); + indexTypes = ts2.append(indexTypes, isTupleType(type3) ? getRestTypeOfTupleType(type3) || undefinedType2 : indexInfo.type); + } else if (isObjectLiteralType(type3) && !(ts2.getObjectFlags(type3) & 2097152)) { + checkFlags |= 32; + indexTypes = ts2.append(indexTypes, undefinedType2); + } else { + checkFlags |= 16; + } + } + } + } + if (!singleProp || isUnion && (propSet || checkFlags & 48) && checkFlags & (1024 | 512) && !(propSet && getCommonDeclarationsOfSymbols(ts2.arrayFrom(propSet.values())))) { + return void 0; + } + if (!propSet && !(checkFlags & 16) && !indexTypes) { + if (mergedInstantiations) { + var clone_1 = createSymbolWithType(singleProp, singleProp.type); + clone_1.parent = (_b = (_a2 = singleProp.valueDeclaration) === null || _a2 === void 0 ? void 0 : _a2.symbol) === null || _b === void 0 ? void 0 : _b.parent; + clone_1.containingType = containingType; + clone_1.mapper = singleProp.mapper; + return clone_1; + } else { + return singleProp; + } + } + var props = propSet ? ts2.arrayFrom(propSet.values()) : [singleProp]; + var declarations; + var firstType; + var nameType; + var propTypes = []; + var writeTypes; + var firstValueDeclaration; + var hasNonUniformValueDeclaration = false; + for (var _d = 0, props_1 = props; _d < props_1.length; _d++) { + var prop = props_1[_d]; + if (!firstValueDeclaration) { + firstValueDeclaration = prop.valueDeclaration; + } else if (prop.valueDeclaration && prop.valueDeclaration !== firstValueDeclaration) { + hasNonUniformValueDeclaration = true; + } + declarations = ts2.addRange(declarations, prop.declarations); + var type3 = getTypeOfSymbol(prop); + if (!firstType) { + firstType = type3; + nameType = getSymbolLinks(prop).nameType; + } + var writeType = getWriteTypeOfSymbol(prop); + if (writeTypes || writeType !== type3) { + writeTypes = ts2.append(!writeTypes ? propTypes.slice() : writeTypes, writeType); + } else if (type3 !== firstType) { + checkFlags |= 64; + } + if (isLiteralType(type3) || isPatternLiteralType(type3) || type3 === uniqueLiteralType) { + checkFlags |= 128; + } + if (type3.flags & 131072 && type3 !== uniqueLiteralType) { + checkFlags |= 131072; + } + propTypes.push(type3); + } + ts2.addRange(propTypes, indexTypes); + var result2 = createSymbol(4 | (optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : 0), name2, syntheticFlag | checkFlags); + result2.containingType = containingType; + if (!hasNonUniformValueDeclaration && firstValueDeclaration) { + result2.valueDeclaration = firstValueDeclaration; + if (firstValueDeclaration.symbol.parent) { + result2.parent = firstValueDeclaration.symbol.parent; + } + } + result2.declarations = declarations; + result2.nameType = nameType; + if (propTypes.length > 2) { + result2.checkFlags |= 65536; + result2.deferralParent = containingType; + result2.deferralConstituents = propTypes; + result2.deferralWriteConstituents = writeTypes; + } else { + result2.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); + if (writeTypes) { + result2.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes); + } + } + return result2; + } + function getUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment) { + var _a2, _b; + var property2 = ((_a2 = type3.propertyCacheWithoutObjectFunctionPropertyAugment) === null || _a2 === void 0 ? void 0 : _a2.get(name2)) || !skipObjectFunctionPropertyAugment ? (_b = type3.propertyCache) === null || _b === void 0 ? void 0 : _b.get(name2) : void 0; + if (!property2) { + property2 = createUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment); + if (property2) { + var properties = skipObjectFunctionPropertyAugment ? type3.propertyCacheWithoutObjectFunctionPropertyAugment || (type3.propertyCacheWithoutObjectFunctionPropertyAugment = ts2.createSymbolTable()) : type3.propertyCache || (type3.propertyCache = ts2.createSymbolTable()); + properties.set(name2, property2); + } + } + return property2; + } + function getCommonDeclarationsOfSymbols(symbols) { + var commonDeclarations; + var _loop_14 = function(symbol2) { + if (!symbol2.declarations) { + return { value: void 0 }; + } + if (!commonDeclarations) { + commonDeclarations = new ts2.Set(symbol2.declarations); + return "continue"; + } + commonDeclarations.forEach(function(declaration) { + if (!ts2.contains(symbol2.declarations, declaration)) { + commonDeclarations.delete(declaration); + } + }); + if (commonDeclarations.size === 0) { + return { value: void 0 }; + } + }; + for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) { + var symbol = symbols_3[_i]; + var state_4 = _loop_14(symbol); + if (typeof state_4 === "object") + return state_4.value; + } + return commonDeclarations; + } + function getPropertyOfUnionOrIntersectionType(type3, name2, skipObjectFunctionPropertyAugment) { + var property2 = getUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment); + return property2 && !(ts2.getCheckFlags(property2) & 16) ? property2 : void 0; + } + function getReducedType(type3) { + if (type3.flags & 1048576 && type3.objectFlags & 16777216) { + return type3.resolvedReducedType || (type3.resolvedReducedType = getReducedUnionType(type3)); + } else if (type3.flags & 2097152) { + if (!(type3.objectFlags & 16777216)) { + type3.objectFlags |= 16777216 | (ts2.some(getPropertiesOfUnionOrIntersectionType(type3), isNeverReducedProperty) ? 33554432 : 0); + } + return type3.objectFlags & 33554432 ? neverType2 : type3; + } + return type3; + } + function getReducedUnionType(unionType2) { + var reducedTypes = ts2.sameMap(unionType2.types, getReducedType); + if (reducedTypes === unionType2.types) { + return unionType2; + } + var reduced = getUnionType(reducedTypes); + if (reduced.flags & 1048576) { + reduced.resolvedReducedType = reduced; + } + return reduced; + } + function isNeverReducedProperty(prop) { + return isDiscriminantWithNeverType(prop) || isConflictingPrivateProperty(prop); + } + function isDiscriminantWithNeverType(prop) { + return !(prop.flags & 16777216) && (ts2.getCheckFlags(prop) & (192 | 131072)) === 192 && !!(getTypeOfSymbol(prop).flags & 131072); + } + function isConflictingPrivateProperty(prop) { + return !prop.valueDeclaration && !!(ts2.getCheckFlags(prop) & 1024); + } + function elaborateNeverIntersection(errorInfo, type3) { + if (type3.flags & 2097152 && ts2.getObjectFlags(type3) & 33554432) { + var neverProp = ts2.find(getPropertiesOfUnionOrIntersectionType(type3), isDiscriminantWithNeverType); + if (neverProp) { + return ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 536870912 + /* TypeFormatFlags.NoTypeReduction */ + ), symbolToString2(neverProp)); + } + var privateProp = ts2.find(getPropertiesOfUnionOrIntersectionType(type3), isConflictingPrivateProperty); + if (privateProp) { + return ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 536870912 + /* TypeFormatFlags.NoTypeReduction */ + ), symbolToString2(privateProp)); + } + } + return errorInfo; + } + function getPropertyOfType(type3, name2, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) { + type3 = getReducedApparentType(type3); + if (type3.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type3); + var symbol = resolved.members.get(name2); + if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) { + return symbol; + } + if (skipObjectFunctionPropertyAugment) + return void 0; + var functionType2 = resolved === anyFunctionType ? globalFunctionType : resolved.callSignatures.length ? globalCallableFunctionType : resolved.constructSignatures.length ? globalNewableFunctionType : void 0; + if (functionType2) { + var symbol_1 = getPropertyOfObjectType(functionType2, name2); + if (symbol_1) { + return symbol_1; + } + } + return getPropertyOfObjectType(globalObjectType, name2); + } + if (type3.flags & 3145728) { + return getPropertyOfUnionOrIntersectionType(type3, name2, skipObjectFunctionPropertyAugment); + } + return void 0; + } + function getSignaturesOfStructuredType(type3, kind) { + if (type3.flags & 3670016) { + var resolved = resolveStructuredTypeMembers(type3); + return kind === 0 ? resolved.callSignatures : resolved.constructSignatures; + } + return ts2.emptyArray; + } + function getSignaturesOfType(type3, kind) { + return getSignaturesOfStructuredType(getReducedApparentType(type3), kind); + } + function findIndexInfo(indexInfos, keyType) { + return ts2.find(indexInfos, function(info2) { + return info2.keyType === keyType; + }); + } + function findApplicableIndexInfo(indexInfos, keyType) { + var stringIndexInfo; + var applicableInfo; + var applicableInfos; + for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) { + var info2 = indexInfos_3[_i]; + if (info2.keyType === stringType2) { + stringIndexInfo = info2; + } else if (isApplicableIndexType(keyType, info2.keyType)) { + if (!applicableInfo) { + applicableInfo = info2; + } else { + (applicableInfos || (applicableInfos = [applicableInfo])).push(info2); + } + } + } + return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(ts2.map(applicableInfos, function(info3) { + return info3.type; + })), ts2.reduceLeft( + applicableInfos, + function(isReadonly, info3) { + return isReadonly && info3.isReadonly; + }, + /*initial*/ + true + )) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType2) ? stringIndexInfo : void 0; + } + function isApplicableIndexType(source, target) { + return isTypeAssignableTo(source, target) || target === stringType2 && isTypeAssignableTo(source, numberType2) || target === numberType2 && (source === numericStringType || !!(source.flags & 128) && ts2.isNumericLiteralName(source.value)); + } + function getIndexInfosOfStructuredType(type3) { + if (type3.flags & 3670016) { + var resolved = resolveStructuredTypeMembers(type3); + return resolved.indexInfos; + } + return ts2.emptyArray; + } + function getIndexInfosOfType(type3) { + return getIndexInfosOfStructuredType(getReducedApparentType(type3)); + } + function getIndexInfoOfType(type3, keyType) { + return findIndexInfo(getIndexInfosOfType(type3), keyType); + } + function getIndexTypeOfType(type3, keyType) { + var _a2; + return (_a2 = getIndexInfoOfType(type3, keyType)) === null || _a2 === void 0 ? void 0 : _a2.type; + } + function getApplicableIndexInfos(type3, keyType) { + return getIndexInfosOfType(type3).filter(function(info2) { + return isApplicableIndexType(keyType, info2.keyType); + }); + } + function getApplicableIndexInfo(type3, keyType) { + return findApplicableIndexInfo(getIndexInfosOfType(type3), keyType); + } + function getApplicableIndexInfoForName(type3, name2) { + return getApplicableIndexInfo(type3, isLateBoundName(name2) ? esSymbolType : getStringLiteralType(ts2.unescapeLeadingUnderscores(name2))); + } + function getTypeParametersFromDeclaration(declaration) { + var _a2; + var result2; + for (var _i = 0, _b = ts2.getEffectiveTypeParameterDeclarations(declaration); _i < _b.length; _i++) { + var node = _b[_i]; + result2 = ts2.appendIfUnique(result2, getDeclaredTypeOfTypeParameter(node.symbol)); + } + return (result2 === null || result2 === void 0 ? void 0 : result2.length) ? result2 : ts2.isFunctionDeclaration(declaration) ? (_a2 = getSignatureOfTypeTag(declaration)) === null || _a2 === void 0 ? void 0 : _a2.typeParameters : void 0; + } + function symbolsToArray(symbols) { + var result2 = []; + symbols.forEach(function(symbol, id) { + if (!isReservedMemberName(id)) { + result2.push(symbol); + } + }); + return result2; + } + function isJSDocOptionalParameter(node) { + return ts2.isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType + (node.type && node.type.kind === 319 || ts2.getJSDocParameterTags(node).some(function(_a2) { + var isBracketed = _a2.isBracketed, typeExpression = _a2.typeExpression; + return isBracketed || !!typeExpression && typeExpression.type.kind === 319; + })); + } + function tryFindAmbientModule(moduleName3, withAugmentations) { + if (ts2.isExternalModuleNameRelative(moduleName3)) { + return void 0; + } + var symbol = getSymbol( + globals3, + '"' + moduleName3 + '"', + 512 + /* SymbolFlags.ValueModule */ + ); + return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol; + } + function isOptionalParameter(node) { + if (ts2.hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isJSDocOptionalParameter(node)) { + return true; + } + if (node.initializer) { + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); + ts2.Debug.assert(parameterIndex >= 0); + return parameterIndex >= getMinArgumentCount( + signature, + 1 | 2 + /* MinArgumentCountFlags.VoidIsNonOptional */ + ); + } + var iife = ts2.getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= iife.arguments.length; + } + return false; + } + function isOptionalPropertyDeclaration(node) { + return ts2.isPropertyDeclaration(node) && !ts2.hasAccessorModifier(node) && node.questionToken; + } + function isOptionalJSDocPropertyLikeTag(node) { + if (!ts2.isJSDocPropertyLikeTag(node)) { + return false; + } + var isBracketed = node.isBracketed, typeExpression = node.typeExpression; + return isBracketed || !!typeExpression && typeExpression.type.kind === 319; + } + function createTypePredicate(kind, parameterName, parameterIndex, type3) { + return { kind, parameterName, parameterIndex, type: type3 }; + } + function getMinTypeArgumentCount(typeParameters) { + var minTypeArgumentCount = 0; + if (typeParameters) { + for (var i7 = 0; i7 < typeParameters.length; i7++) { + if (!hasTypeParameterDefault(typeParameters[i7])) { + minTypeArgumentCount = i7 + 1; + } + } + } + return minTypeArgumentCount; + } + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, isJavaScriptImplicitAny) { + var numTypeParameters = ts2.length(typeParameters); + if (!numTypeParameters) { + return []; + } + var numTypeArguments = ts2.length(typeArguments); + if (isJavaScriptImplicitAny || numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters) { + var result2 = typeArguments ? typeArguments.slice() : []; + for (var i7 = numTypeArguments; i7 < numTypeParameters; i7++) { + result2[i7] = errorType; + } + var baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); + for (var i7 = numTypeArguments; i7 < numTypeParameters; i7++) { + var defaultType = getDefaultFromTypeParameter(typeParameters[i7]); + if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType2) || isTypeIdenticalTo(defaultType, emptyObjectType))) { + defaultType = anyType2; + } + result2[i7] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result2)) : baseDefaultType; + } + result2.length = typeParameters.length; + return result2; + } + return typeArguments && typeArguments.slice(); + } + function getSignatureFromDeclaration(declaration) { + var links = getNodeLinks(declaration); + if (!links.resolvedSignature) { + var parameters = []; + var flags = 0; + var minArgumentCount = 0; + var thisParameter = void 0; + var hasThisParameter = false; + var iife = ts2.getImmediatelyInvokedFunctionExpression(declaration); + var isJSConstructSignature = ts2.isJSDocConstructSignature(declaration); + var isUntypedSignatureInJSFile = !iife && ts2.isInJSFile(declaration) && ts2.isValueSignatureDeclaration(declaration) && !ts2.hasJSDocParameterTags(declaration) && !ts2.getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 32; + } + for (var i7 = isJSConstructSignature ? 1 : 0; i7 < declaration.parameters.length; i7++) { + var param = declaration.parameters[i7]; + var paramSymbol = param.symbol; + var type3 = ts2.isJSDocParameterTag(param) ? param.typeExpression && param.typeExpression.type : param.type; + if (paramSymbol && !!(paramSymbol.flags & 4) && !ts2.isBindingPattern(param.name)) { + var resolvedSymbol = resolveName( + param, + paramSymbol.escapedName, + 111551, + void 0, + void 0, + /*isUse*/ + false + ); + paramSymbol = resolvedSymbol; + } + if (i7 === 0 && paramSymbol.escapedName === "this") { + hasThisParameter = true; + thisParameter = param.symbol; + } else { + parameters.push(paramSymbol); + } + if (type3 && type3.kind === 198) { + flags |= 2; + } + var isOptionalParameter_1 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || ts2.isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type3 || isJSDocOptionalParameter(param); + if (!isOptionalParameter_1) { + minArgumentCount = parameters.length; + } + } + if ((declaration.kind === 174 || declaration.kind === 175) && hasBindableName(declaration) && (!hasThisParameter || !thisParameter)) { + var otherKind = declaration.kind === 174 ? 175 : 174; + var other = ts2.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); + if (other) { + thisParameter = getAnnotatedAccessorThisParameter(other); + } + } + var classType = declaration.kind === 173 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : void 0; + var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); + if (ts2.hasRestParameter(declaration) || ts2.isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { + flags |= 1; + } + if (ts2.isConstructorTypeNode(declaration) && ts2.hasSyntacticModifier( + declaration, + 256 + /* ModifierFlags.Abstract */ + ) || ts2.isConstructorDeclaration(declaration) && ts2.hasSyntacticModifier( + declaration.parent, + 256 + /* ModifierFlags.Abstract */ + )) { + flags |= 4; + } + links.resolvedSignature = createSignature( + declaration, + typeParameters, + thisParameter, + parameters, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgumentCount, + flags + ); + } + return links.resolvedSignature; + } + function maybeAddJsSyntheticRestParameter(declaration, parameters) { + if (ts2.isJSDocSignature(declaration) || !containsArgumentsReference(declaration)) { + return false; + } + var lastParam = ts2.lastOrUndefined(declaration.parameters); + var lastParamTags = lastParam ? ts2.getJSDocParameterTags(lastParam) : ts2.getJSDocTags(declaration).filter(ts2.isJSDocParameterTag); + var lastParamVariadicType = ts2.firstDefined(lastParamTags, function(p7) { + return p7.typeExpression && ts2.isJSDocVariadicType(p7.typeExpression.type) ? p7.typeExpression.type : void 0; + }); + var syntheticArgsSymbol = createSymbol( + 3, + "args", + 32768 + /* CheckFlags.RestParameter */ + ); + if (lastParamVariadicType) { + syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)); + } else { + syntheticArgsSymbol.checkFlags |= 65536; + syntheticArgsSymbol.deferralParent = neverType2; + syntheticArgsSymbol.deferralConstituents = [anyArrayType]; + syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType]; + } + if (lastParamVariadicType) { + parameters.pop(); + } + parameters.push(syntheticArgsSymbol); + return true; + } + function getSignatureOfTypeTag(node) { + if (!(ts2.isInJSFile(node) && ts2.isFunctionLikeDeclaration(node))) + return void 0; + var typeTag = ts2.getJSDocTypeTag(node); + return (typeTag === null || typeTag === void 0 ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression)); + } + function getParameterTypeOfTypeTag(func, parameter) { + var signature = getSignatureOfTypeTag(func); + if (!signature) + return void 0; + var pos = func.parameters.indexOf(parameter); + return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos); + } + function getReturnTypeOfTypeTag(node) { + var signature = getSignatureOfTypeTag(node); + return signature && getReturnTypeOfSignature(signature); + } + function containsArgumentsReference(declaration) { + var links = getNodeLinks(declaration); + if (links.containsArgumentsReference === void 0) { + if (links.flags & 8192) { + links.containsArgumentsReference = true; + } else { + links.containsArgumentsReference = traverse4(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse4(node) { + if (!node) + return false; + switch (node.kind) { + case 79: + return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; + case 169: + case 171: + case 174: + case 175: + return node.name.kind === 164 && traverse4(node.name); + case 208: + case 209: + return traverse4(node.expression); + case 299: + return traverse4(node.initializer); + default: + return !ts2.nodeStartsNewLexicalEnvironment(node) && !ts2.isPartOfTypeNode(node) && !!ts2.forEachChild(node, traverse4); + } + } + } + function getSignaturesOfSymbol(symbol) { + if (!symbol || !symbol.declarations) + return ts2.emptyArray; + var result2 = []; + for (var i7 = 0; i7 < symbol.declarations.length; i7++) { + var decl = symbol.declarations[i7]; + if (!ts2.isFunctionLike(decl)) + continue; + if (i7 > 0 && decl.body) { + var previous = symbol.declarations[i7 - 1]; + if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) { + continue; + } + } + result2.push(!ts2.isFunctionExpressionOrArrowFunction(decl) && !ts2.isObjectLiteralMethod(decl) && getSignatureOfTypeTag(decl) || getSignatureFromDeclaration(decl)); + } + return result2; + } + function resolveExternalModuleTypeByLiteral(name2) { + var moduleSym = resolveExternalModuleName(name2, name2); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType2; + } + function getThisTypeOfSignature(signature) { + if (signature.thisParameter) { + return getTypeOfSymbol(signature.thisParameter); + } + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } else if (signature.compositeSignatures) { + signature.resolvedTypePredicate = getUnionOrIntersectionTypePredicate(signature.compositeSignatures, signature.compositeKind) || noTypePredicate; + } else { + var type3 = signature.declaration && ts2.getEffectiveReturnTypeNode(signature.declaration); + var jsdocPredicate = void 0; + if (!type3) { + var jsdocSignature = getSignatureOfTypeTag(signature.declaration); + if (jsdocSignature && signature !== jsdocSignature) { + jsdocPredicate = getTypePredicateOfSignature(jsdocSignature); + } + } + signature.resolvedTypePredicate = type3 && ts2.isTypePredicateNode(type3) ? createTypePredicateFromTypePredicateNode(type3, signature) : jsdocPredicate || noTypePredicate; + } + ts2.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? void 0 : signature.resolvedTypePredicate; + } + function createTypePredicateFromTypePredicateNode(node, signature) { + var parameterName = node.parameterName; + var type3 = node.type && getTypeFromTypeNode(node.type); + return parameterName.kind === 194 ? createTypePredicate( + node.assertsModifier ? 2 : 0, + /*parameterName*/ + void 0, + /*parameterIndex*/ + void 0, + type3 + ) : createTypePredicate(node.assertsModifier ? 3 : 1, parameterName.escapedText, ts2.findIndex(signature.parameters, function(p7) { + return p7.escapedName === parameterName.escapedText; + }), type3); + } + function getUnionOrIntersectionType(types3, kind, unionReduction) { + return kind !== 2097152 ? getUnionType(types3, unionReduction) : getIntersectionType(types3); + } + function getReturnTypeOfSignature(signature) { + if (!signature.resolvedReturnType) { + if (!pushTypeResolution( + signature, + 3 + /* TypeSystemPropertyName.ResolvedReturnType */ + )) { + return errorType; + } + var type3 = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) : signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType( + ts2.map(signature.compositeSignatures, getReturnTypeOfSignature), + signature.compositeKind, + 2 + /* UnionReduction.Subtype */ + ), signature.mapper) : getReturnTypeFromAnnotation(signature.declaration) || (ts2.nodeIsMissing(signature.declaration.body) ? anyType2 : getReturnTypeFromBody(signature.declaration)); + if (signature.flags & 8) { + type3 = addOptionalTypeMarker(type3); + } else if (signature.flags & 16) { + type3 = getOptionalType(type3); + } + if (!popTypeResolution()) { + if (signature.declaration) { + var typeNode = ts2.getEffectiveReturnTypeNode(signature.declaration); + if (typeNode) { + error2(typeNode, ts2.Diagnostics.Return_type_annotation_circularly_references_itself); + } else if (noImplicitAny) { + var declaration = signature.declaration; + var name2 = ts2.getNameOfDeclaration(declaration); + if (name2) { + error2(name2, ts2.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts2.declarationNameToString(name2)); + } else { + error2(declaration, ts2.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + } + } + } + type3 = anyType2; + } + signature.resolvedReturnType = type3; + } + return signature.resolvedReturnType; + } + function getReturnTypeFromAnnotation(declaration) { + if (declaration.kind === 173) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); + } + if (ts2.isJSDocConstructSignature(declaration)) { + return getTypeFromTypeNode(declaration.parameters[0].type); + } + var typeNode = ts2.getEffectiveReturnTypeNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + if (declaration.kind === 174 && hasBindableName(declaration)) { + var jsDocType = ts2.isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); + if (jsDocType) { + return jsDocType; + } + var setter = ts2.getDeclarationOfKind( + getSymbolOfNode(declaration), + 175 + /* SyntaxKind.SetAccessor */ + ); + var setterType = getAnnotatedAccessorType(setter); + if (setterType) { + return setterType; + } + } + return getReturnTypeOfTypeTag(declaration); + } + function isResolvingReturnTypeOfSignature(signature) { + return !signature.resolvedReturnType && findResolutionCycleStartIndex( + signature, + 3 + /* TypeSystemPropertyName.ResolvedReturnType */ + ) >= 0; + } + function getRestTypeOfSignature(signature) { + return tryGetRestTypeOfSignature(signature) || anyType2; + } + function tryGetRestTypeOfSignature(signature) { + if (signatureHasRestParameter(signature)) { + var sigRestType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + var restType = isTupleType(sigRestType) ? getRestTypeOfTupleType(sigRestType) : sigRestType; + return restType && getIndexTypeOfType(restType, numberType2); + } + return void 0; + } + function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) { + var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript)); + if (inferredTypeParameters) { + var returnSignature = getSingleCallOrConstructSignature(getReturnTypeOfSignature(instantiatedSignature)); + if (returnSignature) { + var newReturnSignature = cloneSignature(returnSignature); + newReturnSignature.typeParameters = inferredTypeParameters; + var newInstantiatedSignature = cloneSignature(instantiatedSignature); + newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature); + return newInstantiatedSignature; + } + } + return instantiatedSignature; + } + function getSignatureInstantiationWithoutFillingInTypeArguments(signature, typeArguments) { + var instantiations = signature.instantiations || (signature.instantiations = new ts2.Map()); + var id = getTypeListId(typeArguments); + var instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; + } + function createSignatureInstantiation(signature, typeArguments) { + return instantiateSignature( + signature, + createSignatureTypeMapper(signature, typeArguments), + /*eraseTypeParameters*/ + true + ); + } + function createSignatureTypeMapper(signature, typeArguments) { + return createTypeMapper(signature.typeParameters, typeArguments); + } + function getErasedSignature(signature) { + return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature; + } + function createErasedSignature(signature) { + return instantiateSignature( + signature, + createTypeEraser(signature.typeParameters), + /*eraseTypeParameters*/ + true + ); + } + function getCanonicalSignature(signature) { + return signature.typeParameters ? signature.canonicalSignatureCache || (signature.canonicalSignatureCache = createCanonicalSignature(signature)) : signature; + } + function createCanonicalSignature(signature) { + return getSignatureInstantiation(signature, ts2.map(signature.typeParameters, function(tp) { + return tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp; + }), ts2.isInJSFile(signature.declaration)); + } + function getBaseSignature(signature) { + var typeParameters = signature.typeParameters; + if (typeParameters) { + if (signature.baseSignatureCache) { + return signature.baseSignatureCache; + } + var typeEraser = createTypeEraser(typeParameters); + var baseConstraintMapper_1 = createTypeMapper(typeParameters, ts2.map(typeParameters, function(tp) { + return getConstraintOfTypeParameter(tp) || unknownType2; + })); + var baseConstraints = ts2.map(typeParameters, function(tp) { + return instantiateType(tp, baseConstraintMapper_1) || unknownType2; + }); + for (var i7 = 0; i7 < typeParameters.length - 1; i7++) { + baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper_1); + } + baseConstraints = instantiateTypes(baseConstraints, typeEraser); + return signature.baseSignatureCache = instantiateSignature( + signature, + createTypeMapper(typeParameters, baseConstraints), + /*eraseTypeParameters*/ + true + ); + } + return signature; + } + function getOrCreateTypeFromSignature(signature) { + var _a2; + if (!signature.isolatedSignatureType) { + var kind = (_a2 = signature.declaration) === null || _a2 === void 0 ? void 0 : _a2.kind; + var isConstructor = kind === void 0 || kind === 173 || kind === 177 || kind === 182; + var type3 = createObjectType( + 16 + /* ObjectFlags.Anonymous */ + ); + type3.members = emptySymbols; + type3.properties = ts2.emptyArray; + type3.callSignatures = !isConstructor ? [signature] : ts2.emptyArray; + type3.constructSignatures = isConstructor ? [signature] : ts2.emptyArray; + type3.indexInfos = ts2.emptyArray; + signature.isolatedSignatureType = type3; + } + return signature.isolatedSignatureType; + } + function getIndexSymbol(symbol) { + return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0; + } + function getIndexSymbolFromSymbolTable(symbolTable) { + return symbolTable.get( + "__index" + /* InternalSymbolName.Index */ + ); + } + function createIndexInfo(keyType, type3, isReadonly, declaration) { + return { keyType, type: type3, isReadonly, declaration }; + } + function getIndexInfosOfSymbol(symbol) { + var indexSymbol = getIndexSymbol(symbol); + return indexSymbol ? getIndexInfosOfIndexSymbol(indexSymbol) : ts2.emptyArray; + } + function getIndexInfosOfIndexSymbol(indexSymbol) { + if (indexSymbol.declarations) { + var indexInfos_4 = []; + var _loop_15 = function(declaration2) { + if (declaration2.parameters.length === 1) { + var parameter = declaration2.parameters[0]; + if (parameter.type) { + forEachType(getTypeFromTypeNode(parameter.type), function(keyType) { + if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_4, keyType)) { + indexInfos_4.push(createIndexInfo(keyType, declaration2.type ? getTypeFromTypeNode(declaration2.type) : anyType2, ts2.hasEffectiveModifier( + declaration2, + 64 + /* ModifierFlags.Readonly */ + ), declaration2)); + } + }); + } + } + }; + for (var _i = 0, _a2 = indexSymbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + _loop_15(declaration); + } + return indexInfos_4; + } + return ts2.emptyArray; + } + function isValidIndexKeyType(type3) { + return !!(type3.flags & (4 | 8 | 4096)) || isPatternLiteralType(type3) || !!(type3.flags & 2097152) && !isGenericType(type3) && ts2.some(type3.types, isValidIndexKeyType); + } + function getConstraintDeclaration(type3) { + return ts2.mapDefined(ts2.filter(type3.symbol && type3.symbol.declarations, ts2.isTypeParameterDeclaration), ts2.getEffectiveConstraintOfTypeParameter)[0]; + } + function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) { + var _a2; + var inferences; + if ((_a2 = typeParameter.symbol) === null || _a2 === void 0 ? void 0 : _a2.declarations) { + var _loop_16 = function(declaration2) { + if (declaration2.parent.kind === 192) { + var _c = ts2.walkUpParenthesizedTypesAndGetParentAndChild(declaration2.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration2.parent : _d, grandParent = _c[1]; + if (grandParent.kind === 180 && !omitTypeReferences) { + var typeReference_1 = grandParent; + var typeParameters_1 = getTypeParametersForTypeReference(typeReference_1); + if (typeParameters_1) { + var index4 = typeReference_1.typeArguments.indexOf(childTypeParameter); + if (index4 < typeParameters_1.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters_1[index4]); + if (declaredConstraint) { + var mapper = makeDeferredTypeMapper(typeParameters_1, typeParameters_1.map(function(_6, index5) { + return function() { + return getEffectiveTypeArgumentAtIndex(typeReference_1, typeParameters_1, index5); + }; + })); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts2.append(inferences, constraint); + } + } + } + } + } else if (grandParent.kind === 166 && grandParent.dotDotDotToken || grandParent.kind === 188 || grandParent.kind === 199 && grandParent.dotDotDotToken) { + inferences = ts2.append(inferences, createArrayType(unknownType2)); + } else if (grandParent.kind === 201) { + inferences = ts2.append(inferences, stringType2); + } else if (grandParent.kind === 165 && grandParent.parent.kind === 197) { + inferences = ts2.append(inferences, keyofConstraintType); + } else if (grandParent.kind === 197 && grandParent.type && ts2.skipParentheses(grandParent.type) === declaration2.parent && grandParent.parent.kind === 191 && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 197 && grandParent.parent.checkType.type) { + var checkMappedType_1 = grandParent.parent.checkType; + var nodeType = getTypeFromTypeNode(checkMappedType_1.type); + inferences = ts2.append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfNode(checkMappedType_1.typeParameter)), checkMappedType_1.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType_1.typeParameter.constraint) : keyofConstraintType))); + } + } + }; + for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) { + var declaration = _b[_i]; + _loop_16(declaration); + } + } + return inferences && getIntersectionType(inferences); + } + function getConstraintFromTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + var targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; + } else { + var constraintDeclaration = getConstraintDeclaration(typeParameter); + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } else { + var type3 = getTypeFromTypeNode(constraintDeclaration); + if (type3.flags & 1 && !isErrorType(type3)) { + type3 = constraintDeclaration.parent.parent.kind === 197 ? keyofConstraintType : unknownType2; + } + typeParameter.constraint = type3; + } + } + } + return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; + } + function getParentSymbolOfTypeParameter(typeParameter) { + var tp = ts2.getDeclarationOfKind( + typeParameter.symbol, + 165 + /* SyntaxKind.TypeParameter */ + ); + var host2 = ts2.isJSDocTemplateTag(tp.parent) ? ts2.getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; + return host2 && getSymbolOfNode(host2); + } + function getTypeListId(types3) { + var result2 = ""; + if (types3) { + var length_4 = types3.length; + var i7 = 0; + while (i7 < length_4) { + var startId = types3[i7].id; + var count2 = 1; + while (i7 + count2 < length_4 && types3[i7 + count2].id === startId + count2) { + count2++; + } + if (result2.length) { + result2 += ","; + } + result2 += startId; + if (count2 > 1) { + result2 += ":" + count2; + } + i7 += count2; + } + } + return result2; + } + function getAliasId(aliasSymbol, aliasTypeArguments) { + return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : ""; + } + function getPropagatingFlagsOfTypes(types3, excludeKinds) { + var result2 = 0; + for (var _i = 0, types_8 = types3; _i < types_8.length; _i++) { + var type3 = types_8[_i]; + if (excludeKinds === void 0 || !(type3.flags & excludeKinds)) { + result2 |= ts2.getObjectFlags(type3); + } + } + return result2 & 458752; + } + function createTypeReference(target, typeArguments) { + var id = getTypeListId(typeArguments); + var type3 = target.instantiations.get(id); + if (!type3) { + type3 = createObjectType(4, target.symbol); + target.instantiations.set(id, type3); + type3.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments) : 0; + type3.target = target; + type3.resolvedTypeArguments = typeArguments; + } + return type3; + } + function cloneTypeReference(source) { + var type3 = createType(source.flags); + type3.symbol = source.symbol; + type3.objectFlags = source.objectFlags; + type3.target = source.target; + type3.resolvedTypeArguments = source.resolvedTypeArguments; + return type3; + } + function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments) { + if (!aliasSymbol) { + aliasSymbol = getAliasSymbolForTypeNode(node); + var localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + aliasTypeArguments = mapper ? instantiateTypes(localAliasTypeArguments, mapper) : localAliasTypeArguments; + } + var type3 = createObjectType(4, target.symbol); + type3.target = target; + type3.node = node; + type3.mapper = mapper; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + return type3; + } + function getTypeArguments(type3) { + var _a2, _b; + if (!type3.resolvedTypeArguments) { + if (!pushTypeResolution( + type3, + 6 + /* TypeSystemPropertyName.ResolvedTypeArguments */ + )) { + return ((_a2 = type3.target.localTypeParameters) === null || _a2 === void 0 ? void 0 : _a2.map(function() { + return errorType; + })) || ts2.emptyArray; + } + var node = type3.node; + var typeArguments = !node ? ts2.emptyArray : node.kind === 180 ? ts2.concatenate(type3.target.outerTypeParameters, getEffectiveTypeArguments(node, type3.target.localTypeParameters)) : node.kind === 185 ? [getTypeFromTypeNode(node.elementType)] : ts2.map(node.elements, getTypeFromTypeNode); + if (popTypeResolution()) { + type3.resolvedTypeArguments = type3.mapper ? instantiateTypes(typeArguments, type3.mapper) : typeArguments; + } else { + type3.resolvedTypeArguments = ((_b = type3.target.localTypeParameters) === null || _b === void 0 ? void 0 : _b.map(function() { + return errorType; + })) || ts2.emptyArray; + error2(type3.node || currentNode, type3.target.symbol ? ts2.Diagnostics.Type_arguments_for_0_circularly_reference_themselves : ts2.Diagnostics.Tuple_type_arguments_circularly_reference_themselves, type3.target.symbol && symbolToString2(type3.target.symbol)); + } + } + return type3.resolvedTypeArguments; + } + function getTypeReferenceArity(type3) { + return ts2.length(type3.target.typeParameters); + } + function getTypeFromClassOrInterfaceReference(node, symbol) { + var type3 = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); + var typeParameters = type3.localTypeParameters; + if (typeParameters) { + var numTypeArguments = ts2.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + var isJs = ts2.isInJSFile(node); + var isJsImplicitAny = !noImplicitAny && isJs; + if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + var missingAugmentsTag = isJs && ts2.isExpressionWithTypeArguments(node) && !ts2.isJSDocAugmentsTag(node.parent); + var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts2.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag : ts2.Diagnostics.Generic_type_0_requires_1_type_argument_s : missingAugmentsTag ? ts2.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts2.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; + var typeStr = typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* TypeFormatFlags.WriteArrayAsGenericType */ + ); + error2(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); + if (!isJs) { + return errorType; + } + } + if (node.kind === 180 && isDeferredTypeReferenceNode(node, ts2.length(node.typeArguments) !== typeParameters.length)) { + return createDeferredTypeReference( + type3, + node, + /*mapper*/ + void 0 + ); + } + var typeArguments = ts2.concatenate(type3.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); + return createTypeReference(type3, typeArguments); + } + return checkNoTypeArguments(node, symbol) ? type3 : errorType; + } + function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) { + var type3 = getDeclaredTypeOfSymbol(symbol); + if (type3 === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) { + return getStringMappingType(symbol, typeArguments[0]); + } + var links = getSymbolLinks(symbol); + var typeParameters = links.typeParameters; + var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments); + var instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type3, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), ts2.isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments)); + } + return instantiation; + } + function getTypeFromTypeAliasReference(node, symbol) { + if (ts2.getCheckFlags(symbol) & 1048576) { + var typeArguments = typeArgumentsFromTypeReferenceNode(node); + var id = getAliasId(symbol, typeArguments); + var errorType_1 = errorTypes.get(id); + if (!errorType_1) { + errorType_1 = createIntrinsicType(1, "error"); + errorType_1.aliasSymbol = symbol; + errorType_1.aliasTypeArguments = typeArguments; + errorTypes.set(id, errorType_1); + } + return errorType_1; + } + var type3 = getDeclaredTypeOfSymbol(symbol); + var typeParameters = getSymbolLinks(symbol).typeParameters; + if (typeParameters) { + var numTypeArguments = ts2.length(node.typeArguments); + var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error2(node, minTypeArgumentCount === typeParameters.length ? ts2.Diagnostics.Generic_type_0_requires_1_type_argument_s : ts2.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, symbolToString2(symbol), minTypeArgumentCount, typeParameters.length); + return errorType; + } + var aliasSymbol = getAliasSymbolForTypeNode(node); + var newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : void 0; + return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, getTypeArgumentsForAliasSymbol(newAliasSymbol)); + } + return checkNoTypeArguments(node, symbol) ? type3 : errorType; + } + function isLocalTypeAlias(symbol) { + var _a2; + var declaration = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isTypeAlias); + return !!(declaration && ts2.getContainingFunction(declaration)); + } + function getTypeReferenceName(node) { + switch (node.kind) { + case 180: + return node.typeName; + case 230: + var expr = node.expression; + if (ts2.isEntityNameExpression(expr)) { + return expr; + } + } + return void 0; + } + function getSymbolPath(symbol) { + return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName; + } + function getUnresolvedSymbolForEntityName(name2) { + var identifier = name2.kind === 163 ? name2.right : name2.kind === 208 ? name2.name : name2; + var text = identifier.escapedText; + if (text) { + var parentSymbol = name2.kind === 163 ? getUnresolvedSymbolForEntityName(name2.left) : name2.kind === 208 ? getUnresolvedSymbolForEntityName(name2.expression) : void 0; + var path2 = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text; + var result2 = unresolvedSymbols.get(path2); + if (!result2) { + unresolvedSymbols.set(path2, result2 = createSymbol( + 524288, + text, + 1048576 + /* CheckFlags.Unresolved */ + )); + result2.parent = parentSymbol; + result2.declaredType = unresolvedType; + } + return result2; + } + return unknownSymbol; + } + function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) { + var name2 = getTypeReferenceName(typeReference); + if (!name2) { + return unknownSymbol; + } + var symbol = resolveEntityName(name2, meaning, ignoreErrors); + return symbol && symbol !== unknownSymbol ? symbol : ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name2); + } + function getTypeReferenceType(node, symbol) { + if (symbol === unknownSymbol) { + return errorType; + } + symbol = getExpandoSymbol(symbol) || symbol; + if (symbol.flags & (32 | 64)) { + return getTypeFromClassOrInterfaceReference(node, symbol); + } + if (symbol.flags & 524288) { + return getTypeFromTypeAliasReference(node, symbol); + } + var res = tryGetDeclaredTypeOfSymbol(symbol); + if (res) { + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; + } + if (symbol.flags & 111551 && isJSDocTypeReference(node)) { + var jsdocType = getTypeFromJSDocValueReference(node, symbol); + if (jsdocType) { + return jsdocType; + } else { + resolveTypeReferenceName( + node, + 788968 + /* SymbolFlags.Type */ + ); + return getTypeOfSymbol(symbol); + } + } + return errorType; + } + function getTypeFromJSDocValueReference(node, symbol) { + var links = getNodeLinks(node); + if (!links.resolvedJSDocType) { + var valueType = getTypeOfSymbol(symbol); + var typeType = valueType; + if (symbol.valueDeclaration) { + var isImportTypeWithQualifier = node.kind === 202 && node.qualifier; + if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + typeType = getTypeReferenceType(node, valueType.symbol); + } + } + links.resolvedJSDocType = typeType; + } + return links.resolvedJSDocType; + } + function getSubstitutionType(baseType, constraint) { + if (constraint.flags & 3 || constraint === baseType || !isGenericType(baseType) && !isGenericType(constraint)) { + return baseType; + } + var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(constraint)); + var cached = substitutionTypes.get(id); + if (cached) { + return cached; + } + var result2 = createType( + 33554432 + /* TypeFlags.Substitution */ + ); + result2.baseType = baseType; + result2.constraint = constraint; + substitutionTypes.set(id, result2); + return result2; + } + function getSubstitutionIntersection(substitutionType) { + return getIntersectionType([substitutionType.constraint, substitutionType.baseType]); + } + function isUnaryTupleTypeNode(node) { + return node.kind === 186 && node.elements.length === 1; + } + function getImpliedConstraint(type3, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type3, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type3) ? getTypeFromTypeNode(extendsNode) : void 0; + } + function getConditionalFlowTypeOfType(type3, node) { + var constraints; + var covariant = true; + while (node && !ts2.isStatement(node) && node.kind !== 323) { + var parent2 = node.parent; + if (parent2.kind === 166) { + covariant = !covariant; + } + if ((covariant || type3.flags & 8650752) && parent2.kind === 191 && node === parent2.trueType) { + var constraint = getImpliedConstraint(type3, parent2.checkType, parent2.extendsType); + if (constraint) { + constraints = ts2.append(constraints, constraint); + } + } else if (type3.flags & 262144 && parent2.kind === 197 && node === parent2.type) { + var mappedType = getTypeFromTypeNode(parent2); + if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type3)) { + var typeParameter = getHomomorphicTypeVariable(mappedType); + if (typeParameter) { + var constraint = getConstraintOfTypeParameter(typeParameter); + if (constraint && everyType(constraint, isArrayOrTupleType)) { + constraints = ts2.append(constraints, getUnionType([numberType2, numericStringType])); + } + } + } + } + node = parent2; + } + return constraints ? getSubstitutionType(type3, getIntersectionType(constraints)) : type3; + } + function isJSDocTypeReference(node) { + return !!(node.flags & 8388608) && (node.kind === 180 || node.kind === 202); + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error2(node, ts2.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString2(symbol) : node.typeName ? ts2.declarationNameToString(node.typeName) : anon); + return false; + } + return true; + } + function getIntendedTypeFromJSDocTypeReference(node) { + if (ts2.isIdentifier(node.typeName)) { + var typeArgs = node.typeArguments; + switch (node.typeName.escapedText) { + case "String": + checkNoTypeArguments(node); + return stringType2; + case "Number": + checkNoTypeArguments(node); + return numberType2; + case "Boolean": + checkNoTypeArguments(node); + return booleanType2; + case "Void": + checkNoTypeArguments(node); + return voidType2; + case "Undefined": + checkNoTypeArguments(node); + return undefinedType2; + case "Null": + checkNoTypeArguments(node); + return nullType2; + case "Function": + case "function": + checkNoTypeArguments(node); + return globalFunctionType; + case "array": + return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : void 0; + case "promise": + return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType2) : void 0; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts2.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var indexInfo = indexed === stringType2 || indexed === numberType2 ? [createIndexInfo( + indexed, + target, + /*isReadonly*/ + false + )] : ts2.emptyArray; + return createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, indexInfo); + } + return anyType2; + } + checkNoTypeArguments(node); + return !noImplicitAny ? anyType2 : void 0; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + var type3 = getTypeFromTypeNode(node.type); + return strictNullChecks ? getNullableType( + type3, + 65536 + /* TypeFlags.Null */ + ) : type3; + } + function getTypeFromTypeReference(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + if (ts2.isConstTypeReference(node) && ts2.isAssertionExpression(node.parent)) { + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = checkExpressionCached(node.parent.expression); + } + var symbol = void 0; + var type3 = void 0; + var meaning = 788968; + if (isJSDocTypeReference(node)) { + type3 = getIntendedTypeFromJSDocTypeReference(node); + if (!type3) { + symbol = resolveTypeReferenceName( + node, + meaning, + /*ignoreErrors*/ + true + ); + if (symbol === unknownSymbol) { + symbol = resolveTypeReferenceName( + node, + meaning | 111551 + /* SymbolFlags.Value */ + ); + } else { + resolveTypeReferenceName(node, meaning); + } + type3 = getTypeReferenceType(node, symbol); + } + } + if (!type3) { + symbol = resolveTypeReferenceName(node, meaning); + type3 = getTypeReferenceType(node, symbol); + } + links.resolvedSymbol = symbol; + links.resolvedType = type3; + } + return links.resolvedType; + } + function typeArgumentsFromTypeReferenceNode(node) { + return ts2.map(node.typeArguments, getTypeFromTypeNode); + } + function getTypeFromTypeQueryNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var type3 = checkExpressionWithTypeArguments(node); + links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type3)); + } + return links.resolvedType; + } + function getTypeOfGlobalSymbol(symbol, arity) { + function getTypeDeclaration(symbol2) { + var declarations = symbol2.declarations; + if (declarations) { + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; + switch (declaration.kind) { + case 260: + case 261: + case 263: + return declaration; + } + } + } + } + if (!symbol) { + return arity ? emptyGenericType : emptyObjectType; + } + var type3 = getDeclaredTypeOfSymbol(symbol); + if (!(type3.flags & 524288)) { + error2(getTypeDeclaration(symbol), ts2.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, ts2.symbolName(symbol)); + return arity ? emptyGenericType : emptyObjectType; + } + if (ts2.length(type3.typeParameters) !== arity) { + error2(getTypeDeclaration(symbol), ts2.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts2.symbolName(symbol), arity); + return arity ? emptyGenericType : emptyObjectType; + } + return type3; + } + function getGlobalValueSymbol(name2, reportErrors) { + return getGlobalSymbol(name2, 111551, reportErrors ? ts2.Diagnostics.Cannot_find_global_value_0 : void 0); + } + function getGlobalTypeSymbol(name2, reportErrors) { + return getGlobalSymbol(name2, 788968, reportErrors ? ts2.Diagnostics.Cannot_find_global_type_0 : void 0); + } + function getGlobalTypeAliasSymbol(name2, arity, reportErrors) { + var symbol = getGlobalSymbol(name2, 788968, reportErrors ? ts2.Diagnostics.Cannot_find_global_type_0 : void 0); + if (symbol) { + getDeclaredTypeOfSymbol(symbol); + if (ts2.length(getSymbolLinks(symbol).typeParameters) !== arity) { + var decl = symbol.declarations && ts2.find(symbol.declarations, ts2.isTypeAliasDeclaration); + error2(decl, ts2.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts2.symbolName(symbol), arity); + return void 0; + } + } + return symbol; + } + function getGlobalSymbol(name2, meaning, diagnostic) { + return resolveName( + void 0, + name2, + meaning, + diagnostic, + name2, + /*isUse*/ + false, + /*excludeGlobals*/ + false, + /*getSpellingSuggestions*/ + false + ); + } + function getGlobalType(name2, arity, reportErrors) { + var symbol = getGlobalTypeSymbol(name2, reportErrors); + return symbol || reportErrors ? getTypeOfGlobalSymbol(symbol, arity) : void 0; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType( + "TypedPropertyDescriptor", + /*arity*/ + 1, + /*reportErrors*/ + true + ) || emptyGenericType); + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType( + "TemplateStringsArray", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || emptyObjectType); + } + function getGlobalImportMetaType() { + return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType( + "ImportMeta", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || emptyObjectType); + } + function getGlobalImportMetaExpressionType() { + if (!deferredGlobalImportMetaExpressionType) { + var symbol = createSymbol(0, "ImportMetaExpression"); + var importMetaType = getGlobalImportMetaType(); + var metaPropertySymbol = createSymbol( + 4, + "meta", + 8 + /* CheckFlags.Readonly */ + ); + metaPropertySymbol.parent = symbol; + metaPropertySymbol.type = importMetaType; + var members = ts2.createSymbolTable([metaPropertySymbol]); + symbol.members = members; + deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + } + return deferredGlobalImportMetaExpressionType; + } + function getGlobalImportCallOptionsType(reportErrors) { + return deferredGlobalImportCallOptionsType || (deferredGlobalImportCallOptionsType = getGlobalType( + "ImportCallOptions", + /*arity*/ + 0, + reportErrors + )) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors)); + } + function getGlobalESSymbolConstructorTypeSymbol(reportErrors) { + return deferredGlobalESSymbolConstructorTypeSymbol || (deferredGlobalESSymbolConstructorTypeSymbol = getGlobalTypeSymbol("SymbolConstructor", reportErrors)); + } + function getGlobalESSymbolType() { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType( + "Symbol", + /*arity*/ + 0, + /*reportErrors*/ + false + )) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType( + "Promise", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalPromiseLikeType(reportErrors) { + return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType( + "PromiseLike", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors)); + } + function getGlobalPromiseConstructorLikeType(reportErrors) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType( + "PromiseConstructorLike", + /*arity*/ + 0, + reportErrors + )) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType( + "AsyncIterable", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType( + "AsyncIterator", + /*arity*/ + 3, + reportErrors + )) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType( + "AsyncIterableIterator", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalAsyncGeneratorType(reportErrors) { + return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType( + "AsyncGenerator", + /*arity*/ + 3, + reportErrors + )) || emptyGenericType; + } + function getGlobalIterableType(reportErrors) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType( + "Iterable", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType( + "Iterator", + /*arity*/ + 3, + reportErrors + )) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType( + "IterableIterator", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalGeneratorType(reportErrors) { + return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType( + "Generator", + /*arity*/ + 3, + reportErrors + )) || emptyGenericType; + } + function getGlobalIteratorYieldResultType(reportErrors) { + return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType( + "IteratorYieldResult", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalIteratorReturnResultType(reportErrors) { + return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType( + "IteratorReturnResult", + /*arity*/ + 1, + reportErrors + )) || emptyGenericType; + } + function getGlobalTypeOrUndefined(name2, arity) { + if (arity === void 0) { + arity = 0; + } + var symbol = getGlobalSymbol( + name2, + 788968, + /*diagnostic*/ + void 0 + ); + return symbol && getTypeOfGlobalSymbol(symbol, arity); + } + function getGlobalExtractSymbol() { + deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalTypeAliasSymbol( + "Extract", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalExtractSymbol === unknownSymbol ? void 0 : deferredGlobalExtractSymbol; + } + function getGlobalOmitSymbol() { + deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol( + "Omit", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalOmitSymbol === unknownSymbol ? void 0 : deferredGlobalOmitSymbol; + } + function getGlobalAwaitedSymbol(reportErrors) { + deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeAliasSymbol( + "Awaited", + /*arity*/ + 1, + reportErrors + ) || (reportErrors ? unknownSymbol : void 0)); + return deferredGlobalAwaitedSymbol === unknownSymbol ? void 0 : deferredGlobalAwaitedSymbol; + } + function getGlobalBigIntType() { + return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType( + "BigInt", + /*arity*/ + 0, + /*reportErrors*/ + false + )) || emptyObjectType; + } + function getGlobalNaNSymbol() { + return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( + "NaN", + /*reportErrors*/ + false + )); + } + function getGlobalRecordSymbol() { + deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol( + "Record", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalRecordSymbol === unknownSymbol ? void 0 : deferredGlobalRecordSymbol; + } + function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { + return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; + } + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType( + /*reportErrors*/ + true + ), [iteratedType]); + } + function createArrayType(elementType, readonly) { + return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]); + } + function getTupleElementFlags(node) { + switch (node.kind) { + case 187: + return 2; + case 188: + return getRestTypeElementFlags(node); + case 199: + return node.questionToken ? 2 : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1; + default: + return 1; + } + } + function getRestTypeElementFlags(node) { + return getArrayElementTypeNode(node.type) ? 4 : 8; + } + function getArrayOrTupleTargetType(node) { + var readonly = isReadonlyTypeOperator(node.parent); + var elementType = getArrayElementTypeNode(node); + if (elementType) { + return readonly ? globalReadonlyArrayType : globalArrayType; + } + var elementFlags = ts2.map(node.elements, getTupleElementFlags); + var missingName = ts2.some(node.elements, function(e10) { + return e10.kind !== 199; + }); + return getTupleTargetType( + elementFlags, + readonly, + /*associatedNames*/ + missingName ? void 0 : node.elements + ); + } + function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 185 ? mayResolveTypeAlias(node.elementType) : node.kind === 186 ? ts2.some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || ts2.some(node.typeArguments, mayResolveTypeAlias)); + } + function isResolvedByTypeAlias(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 193: + case 199: + case 180: + case 189: + case 190: + case 196: + case 191: + case 195: + case 185: + case 186: + return isResolvedByTypeAlias(parent2); + case 262: + return true; + } + return false; + } + function mayResolveTypeAlias(node) { + switch (node.kind) { + case 180: + return isJSDocTypeReference(node) || !!(resolveTypeReferenceName( + node, + 788968 + /* SymbolFlags.Type */ + ).flags & 524288); + case 183: + return true; + case 195: + return node.operator !== 156 && mayResolveTypeAlias(node.type); + case 193: + case 187: + case 199: + case 319: + case 317: + case 318: + case 312: + return mayResolveTypeAlias(node.type); + case 188: + return node.type.kind !== 185 || mayResolveTypeAlias(node.type.elementType); + case 189: + case 190: + return ts2.some(node.types, mayResolveTypeAlias); + case 196: + return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); + case 191: + return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); + } + return false; + } + function getTypeFromArrayOrTupleTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var target = getArrayOrTupleTargetType(node); + if (target === emptyGenericType) { + links.resolvedType = emptyObjectType; + } else if (!(node.kind === 186 && ts2.some(node.elements, function(e10) { + return !!(getTupleElementFlags(e10) & 8); + })) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 186 && node.elements.length === 0 ? target : createDeferredTypeReference( + target, + node, + /*mapper*/ + void 0 + ); + } else { + var elementTypes = node.kind === 185 ? [getTypeFromTypeNode(node.elementType)] : ts2.map(node.elements, getTypeFromTypeNode); + links.resolvedType = createNormalizedTypeReference(target, elementTypes); + } + } + return links.resolvedType; + } + function isReadonlyTypeOperator(node) { + return ts2.isTypeOperatorNode(node) && node.operator === 146; + } + function createTupleType(elementTypes, elementFlags, readonly, namedMemberDeclarations) { + if (readonly === void 0) { + readonly = false; + } + var tupleTarget = getTupleTargetType(elementFlags || ts2.map(elementTypes, function(_6) { + return 1; + }), readonly, namedMemberDeclarations); + return tupleTarget === emptyGenericType ? emptyObjectType : elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) : tupleTarget; + } + function getTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { + if (elementFlags.length === 1 && elementFlags[0] & 4) { + return readonly ? globalReadonlyArrayType : globalArrayType; + } + var key = ts2.map(elementFlags, function(f8) { + return f8 & 1 ? "#" : f8 & 2 ? "?" : f8 & 4 ? "." : "*"; + }).join() + (readonly ? "R" : "") + (namedMemberDeclarations && namedMemberDeclarations.length ? "," + ts2.map(namedMemberDeclarations, getNodeId).join(",") : ""); + var type3 = tupleTypes.get(key); + if (!type3) { + tupleTypes.set(key, type3 = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations)); + } + return type3; + } + function createTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { + var arity = elementFlags.length; + var minLength = ts2.countWhere(elementFlags, function(f8) { + return !!(f8 & (1 | 8)); + }); + var typeParameters; + var properties = []; + var combinedFlags = 0; + if (arity) { + typeParameters = new Array(arity); + for (var i7 = 0; i7 < arity; i7++) { + var typeParameter = typeParameters[i7] = createTypeParameter(); + var flags = elementFlags[i7]; + combinedFlags |= flags; + if (!(combinedFlags & 12)) { + var property2 = createSymbol(4 | (flags & 2 ? 16777216 : 0), "" + i7, readonly ? 8 : 0); + property2.tupleLabelDeclaration = namedMemberDeclarations === null || namedMemberDeclarations === void 0 ? void 0 : namedMemberDeclarations[i7]; + property2.type = typeParameter; + properties.push(property2); + } + } + } + var fixedLength = properties.length; + var lengthSymbol = createSymbol(4, "length", readonly ? 8 : 0); + if (combinedFlags & 12) { + lengthSymbol.type = numberType2; + } else { + var literalTypes = []; + for (var i7 = minLength; i7 <= arity; i7++) + literalTypes.push(getNumberLiteralType(i7)); + lengthSymbol.type = getUnionType(literalTypes); + } + properties.push(lengthSymbol); + var type3 = createObjectType( + 8 | 4 + /* ObjectFlags.Reference */ + ); + type3.typeParameters = typeParameters; + type3.outerTypeParameters = void 0; + type3.localTypeParameters = typeParameters; + type3.instantiations = new ts2.Map(); + type3.instantiations.set(getTypeListId(type3.typeParameters), type3); + type3.target = type3; + type3.resolvedTypeArguments = type3.typeParameters; + type3.thisType = createTypeParameter(); + type3.thisType.isThisType = true; + type3.thisType.constraint = type3; + type3.declaredProperties = properties; + type3.declaredCallSignatures = ts2.emptyArray; + type3.declaredConstructSignatures = ts2.emptyArray; + type3.declaredIndexInfos = ts2.emptyArray; + type3.elementFlags = elementFlags; + type3.minLength = minLength; + type3.fixedLength = fixedLength; + type3.hasRestElement = !!(combinedFlags & 12); + type3.combinedFlags = combinedFlags; + type3.readonly = readonly; + type3.labeledElementDeclarations = namedMemberDeclarations; + return type3; + } + function createNormalizedTypeReference(target, typeArguments) { + return target.objectFlags & 8 ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments); + } + function createNormalizedTupleType(target, elementTypes) { + var _a2, _b, _c; + if (!(target.combinedFlags & 14)) { + return createTypeReference(target, elementTypes); + } + if (target.combinedFlags & 8) { + var unionIndex_1 = ts2.findIndex(elementTypes, function(t8, i8) { + return !!(target.elementFlags[i8] & 8 && t8.flags & (131072 | 1048576)); + }); + if (unionIndex_1 >= 0) { + return checkCrossProductUnion(ts2.map(elementTypes, function(t8, i8) { + return target.elementFlags[i8] & 8 ? t8 : unknownType2; + })) ? mapType2(elementTypes[unionIndex_1], function(t8) { + return createNormalizedTupleType(target, ts2.replaceElement(elementTypes, unionIndex_1, t8)); + }) : errorType; + } + } + var expandedTypes = []; + var expandedFlags = []; + var expandedDeclarations = []; + var lastRequiredIndex = -1; + var firstRestIndex = -1; + var lastOptionalOrRestIndex = -1; + var _loop_17 = function(i8) { + var type3 = elementTypes[i8]; + var flags = target.elementFlags[i8]; + if (flags & 8) { + if (type3.flags & 58982400 || isGenericMappedType(type3)) { + addElement(type3, 8, (_a2 = target.labeledElementDeclarations) === null || _a2 === void 0 ? void 0 : _a2[i8]); + } else if (isTupleType(type3)) { + var elements = getTypeArguments(type3); + if (elements.length + expandedTypes.length >= 1e4) { + error2(currentNode, ts2.isPartOfTypeNode(currentNode) ? ts2.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : ts2.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent); + return { value: errorType }; + } + ts2.forEach(elements, function(t8, n7) { + var _a3; + return addElement(t8, type3.target.elementFlags[n7], (_a3 = type3.target.labeledElementDeclarations) === null || _a3 === void 0 ? void 0 : _a3[n7]); + }); + } else { + addElement(isArrayLikeType(type3) && getIndexTypeOfType(type3, numberType2) || errorType, 4, (_b = target.labeledElementDeclarations) === null || _b === void 0 ? void 0 : _b[i8]); + } + } else { + addElement(type3, flags, (_c = target.labeledElementDeclarations) === null || _c === void 0 ? void 0 : _c[i8]); + } + }; + for (var i7 = 0; i7 < elementTypes.length; i7++) { + var state_5 = _loop_17(i7); + if (typeof state_5 === "object") + return state_5.value; + } + for (var i7 = 0; i7 < lastRequiredIndex; i7++) { + if (expandedFlags[i7] & 2) + expandedFlags[i7] = 1; + } + if (firstRestIndex >= 0 && firstRestIndex < lastOptionalOrRestIndex) { + expandedTypes[firstRestIndex] = getUnionType(ts2.sameMap(expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), function(t8, i8) { + return expandedFlags[firstRestIndex + i8] & 8 ? getIndexedAccessType(t8, numberType2) : t8; + })); + expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + expandedDeclarations === null || expandedDeclarations === void 0 ? void 0 : expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + } + var tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations); + return tupleTarget === emptyGenericType ? emptyObjectType : expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) : tupleTarget; + function addElement(type3, flags, declaration) { + if (flags & 1) { + lastRequiredIndex = expandedFlags.length; + } + if (flags & 4 && firstRestIndex < 0) { + firstRestIndex = expandedFlags.length; + } + if (flags & (2 | 4)) { + lastOptionalOrRestIndex = expandedFlags.length; + } + expandedTypes.push(flags & 2 ? addOptionality( + type3, + /*isProperty*/ + true + ) : type3); + expandedFlags.push(flags); + if (expandedDeclarations && declaration) { + expandedDeclarations.push(declaration); + } else { + expandedDeclarations = void 0; + } + } + } + function sliceTupleType(type3, index4, endSkipCount) { + if (endSkipCount === void 0) { + endSkipCount = 0; + } + var target = type3.target; + var endIndex = getTypeReferenceArity(type3) - endSkipCount; + return index4 > target.fixedLength ? getRestArrayTypeOfTupleType(type3) || createTupleType(ts2.emptyArray) : createTupleType( + getTypeArguments(type3).slice(index4, endIndex), + target.elementFlags.slice(index4, endIndex), + /*readonly*/ + false, + target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index4, endIndex) + ); + } + function getKnownKeysOfTupleType(type3) { + return getUnionType(ts2.append(ts2.arrayOf(type3.target.fixedLength, function(i7) { + return getStringLiteralType("" + i7); + }), getIndexType(type3.target.readonly ? globalReadonlyArrayType : globalArrayType))); + } + function getStartElementCount(type3, flags) { + var index4 = ts2.findIndex(type3.elementFlags, function(f8) { + return !(f8 & flags); + }); + return index4 >= 0 ? index4 : type3.elementFlags.length; + } + function getEndElementCount(type3, flags) { + return type3.elementFlags.length - ts2.findLastIndex(type3.elementFlags, function(f8) { + return !(f8 & flags); + }) - 1; + } + function getTypeFromOptionalTypeNode(node) { + return addOptionality( + getTypeFromTypeNode(node.type), + /*isProperty*/ + true + ); + } + function getTypeId(type3) { + return type3.id; + } + function containsType(types3, type3) { + return ts2.binarySearch(types3, type3, getTypeId, ts2.compareValues) >= 0; + } + function insertType(types3, type3) { + var index4 = ts2.binarySearch(types3, type3, getTypeId, ts2.compareValues); + if (index4 < 0) { + types3.splice(~index4, 0, type3); + return true; + } + return false; + } + function addTypeToUnion(typeSet, includes2, type3) { + var flags = type3.flags; + if (flags & 1048576) { + return addTypesToUnion(typeSet, includes2 | (isNamedUnionType(type3) ? 1048576 : 0), type3.types); + } + if (!(flags & 131072)) { + includes2 |= flags & 205258751; + if (flags & 465829888) + includes2 |= 33554432; + if (type3 === wildcardType) + includes2 |= 8388608; + if (!strictNullChecks && flags & 98304) { + if (!(ts2.getObjectFlags(type3) & 65536)) + includes2 |= 4194304; + } else { + var len = typeSet.length; + var index4 = len && type3.id > typeSet[len - 1].id ? ~len : ts2.binarySearch(typeSet, type3, getTypeId, ts2.compareValues); + if (index4 < 0) { + typeSet.splice(~index4, 0, type3); + } + } + } + return includes2; + } + function addTypesToUnion(typeSet, includes2, types3) { + for (var _i = 0, types_9 = types3; _i < types_9.length; _i++) { + var type3 = types_9[_i]; + includes2 = addTypeToUnion(typeSet, includes2, type3); + } + return includes2; + } + function removeSubtypes(types3, hasObjectTypes) { + if (types3.length < 2) { + return types3; + } + var id = getTypeListId(types3); + var match = subtypeReductionCache.get(id); + if (match) { + return match; + } + var hasEmptyObject = hasObjectTypes && ts2.some(types3, function(t9) { + return !!(t9.flags & 524288) && !isGenericMappedType(t9) && isEmptyResolvedType(resolveStructuredTypeMembers(t9)); + }); + var len = types3.length; + var i7 = len; + var count2 = 0; + while (i7 > 0) { + i7--; + var source = types3[i7]; + if (hasEmptyObject || source.flags & 469499904) { + var keyProperty = source.flags & (524288 | 2097152 | 58982400) ? ts2.find(getPropertiesOfType(source), function(p7) { + return isUnitType(getTypeOfSymbol(p7)); + }) : void 0; + var keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); + for (var _i = 0, types_10 = types3; _i < types_10.length; _i++) { + var target = types_10[_i]; + if (source !== target) { + if (count2 === 1e5) { + var estimatedCount = count2 / (len - i7) * len; + if (estimatedCount > 1e6) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "removeSubtypes_DepthLimit", { typeIds: types3.map(function(t9) { + return t9.id; + }) }); + error2(currentNode, ts2.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + return void 0; + } + } + count2++; + if (keyProperty && target.flags & (524288 | 2097152 | 58982400)) { + var t8 = getTypeOfPropertyOfType(target, keyProperty.escapedName); + if (t8 && isUnitType(t8) && getRegularTypeOfLiteralType(t8) !== keyPropertyType) { + continue; + } + } + if (isTypeRelatedTo(source, target, strictSubtypeRelation) && (!(ts2.getObjectFlags(getTargetType(source)) & 1) || !(ts2.getObjectFlags(getTargetType(target)) & 1) || isTypeDerivedFrom(source, target))) { + ts2.orderedRemoveItemAt(types3, i7); + break; + } + } + } + } + } + subtypeReductionCache.set(id, types3); + return types3; + } + function removeRedundantLiteralTypes(types3, includes2, reduceVoidUndefined) { + var i7 = types3.length; + while (i7 > 0) { + i7--; + var t8 = types3[i7]; + var flags = t8.flags; + var remove2 = flags & (128 | 134217728 | 268435456) && includes2 & 4 || flags & 256 && includes2 & 8 || flags & 2048 && includes2 & 64 || flags & 8192 && includes2 & 4096 || reduceVoidUndefined && flags & 32768 && includes2 & 16384 || isFreshLiteralType(t8) && containsType(types3, t8.regularType); + if (remove2) { + ts2.orderedRemoveItemAt(types3, i7); + } + } + } + function removeStringLiteralsMatchedByTemplateLiterals(types3) { + var templates = ts2.filter(types3, isPatternLiteralType); + if (templates.length) { + var i7 = types3.length; + var _loop_18 = function() { + i7--; + var t8 = types3[i7]; + if (t8.flags & 128 && ts2.some(templates, function(template2) { + return isTypeMatchedByTemplateLiteralType(t8, template2); + })) { + ts2.orderedRemoveItemAt(types3, i7); + } + }; + while (i7 > 0) { + _loop_18(); + } + } + } + function isNamedUnionType(type3) { + return !!(type3.flags & 1048576 && (type3.aliasSymbol || type3.origin)); + } + function addNamedUnions(namedUnions, types3) { + for (var _i = 0, types_11 = types3; _i < types_11.length; _i++) { + var t8 = types_11[_i]; + if (t8.flags & 1048576) { + var origin = t8.origin; + if (t8.aliasSymbol || origin && !(origin.flags & 1048576)) { + ts2.pushIfUnique(namedUnions, t8); + } else if (origin && origin.flags & 1048576) { + addNamedUnions(namedUnions, origin.types); + } + } + } + } + function createOriginUnionOrIntersectionType(flags, types3) { + var result2 = createOriginType(flags); + result2.types = types3; + return result2; + } + function getUnionType(types3, unionReduction, aliasSymbol, aliasTypeArguments, origin) { + if (unionReduction === void 0) { + unionReduction = 1; + } + if (types3.length === 0) { + return neverType2; + } + if (types3.length === 1) { + return types3[0]; + } + var typeSet = []; + var includes2 = addTypesToUnion(typeSet, 0, types3); + if (unionReduction !== 0) { + if (includes2 & 3) { + return includes2 & 1 ? includes2 & 8388608 ? wildcardType : anyType2 : includes2 & 65536 || containsType(typeSet, unknownType2) ? unknownType2 : nonNullUnknownType; + } + if (exactOptionalPropertyTypes && includes2 & 32768) { + var missingIndex = ts2.binarySearch(typeSet, missingType, getTypeId, ts2.compareValues); + if (missingIndex >= 0 && containsType(typeSet, undefinedType2)) { + ts2.orderedRemoveItemAt(typeSet, missingIndex); + } + } + if (includes2 & (2944 | 8192 | 134217728 | 268435456) || includes2 & 16384 && includes2 & 32768) { + removeRedundantLiteralTypes(typeSet, includes2, !!(unionReduction & 2)); + } + if (includes2 & 128 && includes2 & 134217728) { + removeStringLiteralsMatchedByTemplateLiterals(typeSet); + } + if (unionReduction === 2) { + typeSet = removeSubtypes(typeSet, !!(includes2 & 524288)); + if (!typeSet) { + return errorType; + } + } + if (typeSet.length === 0) { + return includes2 & 65536 ? includes2 & 4194304 ? nullType2 : nullWideningType : includes2 & 32768 ? includes2 & 4194304 ? undefinedType2 : undefinedWideningType : neverType2; + } + } + if (!origin && includes2 & 1048576) { + var namedUnions = []; + addNamedUnions(namedUnions, types3); + var reducedTypes = []; + var _loop_19 = function(t9) { + if (!ts2.some(namedUnions, function(union2) { + return containsType(union2.types, t9); + })) { + reducedTypes.push(t9); + } + }; + for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) { + var t8 = typeSet_1[_i]; + _loop_19(t8); + } + if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) { + return namedUnions[0]; + } + var namedTypesCount = ts2.reduceLeft(namedUnions, function(sum2, union2) { + return sum2 + union2.types.length; + }, 0); + if (namedTypesCount + reducedTypes.length === typeSet.length) { + for (var _a2 = 0, namedUnions_1 = namedUnions; _a2 < namedUnions_1.length; _a2++) { + var t8 = namedUnions_1[_a2]; + insertType(reducedTypes, t8); + } + origin = createOriginUnionOrIntersectionType(1048576, reducedTypes); + } + } + var objectFlags = (includes2 & 36323363 ? 0 : 32768) | (includes2 & 2097152 ? 16777216 : 0); + return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin); + } + function getUnionOrIntersectionTypePredicate(signatures, kind) { + var first; + var types3 = []; + for (var _i = 0, signatures_6 = signatures; _i < signatures_6.length; _i++) { + var sig = signatures_6[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred || pred.kind === 2 || pred.kind === 3) { + if (kind !== 2097152) { + continue; + } else { + return; + } + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + return void 0; + } + } else { + first = pred; + } + types3.push(pred.type); + } + if (!first) { + return void 0; + } + var compositeType = getUnionOrIntersectionType(types3, kind); + return createTypePredicate(first.kind, first.parameterName, first.parameterIndex, compositeType); + } + function typePredicateKindsMatch(a7, b8) { + return a7.kind === b8.kind && a7.parameterIndex === b8.parameterIndex; + } + function getUnionTypeFromSortedList(types3, objectFlags, aliasSymbol, aliasTypeArguments, origin) { + if (types3.length === 0) { + return neverType2; + } + if (types3.length === 1) { + return types3[0]; + } + var typeKey = !origin ? getTypeListId(types3) : origin.flags & 1048576 ? "|".concat(getTypeListId(origin.types)) : origin.flags & 2097152 ? "&".concat(getTypeListId(origin.types)) : "#".concat(origin.type.id, "|").concat(getTypeListId(types3)); + var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments); + var type3 = unionTypes.get(id); + if (!type3) { + type3 = createType( + 1048576 + /* TypeFlags.Union */ + ); + type3.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + types3, + /*excludeKinds*/ + 98304 + /* TypeFlags.Nullable */ + ); + type3.types = types3; + type3.origin = origin; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + if (types3.length === 2 && types3[0].flags & 512 && types3[1].flags & 512) { + type3.flags |= 16; + type3.intrinsicName = "boolean"; + } + unionTypes.set(id, type3); + } + return type3; + } + function getTypeFromUnionTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var aliasSymbol = getAliasSymbolForTypeNode(node); + links.resolvedType = getUnionType(ts2.map(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)); + } + return links.resolvedType; + } + function addTypeToIntersection(typeSet, includes2, type3) { + var flags = type3.flags; + if (flags & 2097152) { + return addTypesToIntersection(typeSet, includes2, type3.types); + } + if (isEmptyAnonymousObjectType(type3)) { + if (!(includes2 & 16777216)) { + includes2 |= 16777216; + typeSet.set(type3.id.toString(), type3); + } + } else { + if (flags & 3) { + if (type3 === wildcardType) + includes2 |= 8388608; + } else if (strictNullChecks || !(flags & 98304)) { + if (exactOptionalPropertyTypes && type3 === missingType) { + includes2 |= 262144; + type3 = undefinedType2; + } + if (!typeSet.has(type3.id.toString())) { + if (type3.flags & 109440 && includes2 & 109440) { + includes2 |= 67108864; + } + typeSet.set(type3.id.toString(), type3); + } + } + includes2 |= flags & 205258751; + } + return includes2; + } + function addTypesToIntersection(typeSet, includes2, types3) { + for (var _i = 0, types_12 = types3; _i < types_12.length; _i++) { + var type3 = types_12[_i]; + includes2 = addTypeToIntersection(typeSet, includes2, getRegularTypeOfLiteralType(type3)); + } + return includes2; + } + function removeRedundantSupertypes(types3, includes2) { + var i7 = types3.length; + while (i7 > 0) { + i7--; + var t8 = types3[i7]; + var remove2 = t8.flags & 4 && includes2 & (128 | 134217728 | 268435456) || t8.flags & 8 && includes2 & 256 || t8.flags & 64 && includes2 & 2048 || t8.flags & 4096 && includes2 & 8192 || t8.flags & 16384 && includes2 & 32768 || isEmptyAnonymousObjectType(t8) && includes2 & 470302716; + if (remove2) { + ts2.orderedRemoveItemAt(types3, i7); + } + } + } + function eachUnionContains(unionTypes2, type3) { + for (var _i = 0, unionTypes_1 = unionTypes2; _i < unionTypes_1.length; _i++) { + var u7 = unionTypes_1[_i]; + if (!containsType(u7.types, type3)) { + var primitive = type3.flags & 128 ? stringType2 : type3.flags & 256 ? numberType2 : type3.flags & 2048 ? bigintType : type3.flags & 8192 ? esSymbolType : void 0; + if (!primitive || !containsType(u7.types, primitive)) { + return false; + } + } + } + return true; + } + function extractRedundantTemplateLiterals(types3) { + var i7 = types3.length; + var literals = ts2.filter(types3, function(t9) { + return !!(t9.flags & 128); + }); + while (i7 > 0) { + i7--; + var t8 = types3[i7]; + if (!(t8.flags & 134217728)) + continue; + for (var _i = 0, literals_1 = literals; _i < literals_1.length; _i++) { + var t22 = literals_1[_i]; + if (isTypeSubtypeOf(t22, t8)) { + ts2.orderedRemoveItemAt(types3, i7); + break; + } else if (isPatternLiteralType(t8)) { + return true; + } + } + } + return false; + } + function eachIsUnionContaining(types3, flag) { + return ts2.every(types3, function(t8) { + return !!(t8.flags & 1048576) && ts2.some(t8.types, function(tt3) { + return !!(tt3.flags & flag); + }); + }); + } + function removeFromEach(types3, flag) { + for (var i7 = 0; i7 < types3.length; i7++) { + types3[i7] = filterType(types3[i7], function(t8) { + return !(t8.flags & flag); + }); + } + } + function intersectUnionsOfPrimitiveTypes(types3) { + var unionTypes2; + var index4 = ts2.findIndex(types3, function(t9) { + return !!(ts2.getObjectFlags(t9) & 32768); + }); + if (index4 < 0) { + return false; + } + var i7 = index4 + 1; + while (i7 < types3.length) { + var t8 = types3[i7]; + if (ts2.getObjectFlags(t8) & 32768) { + (unionTypes2 || (unionTypes2 = [types3[index4]])).push(t8); + ts2.orderedRemoveItemAt(types3, i7); + } else { + i7++; + } + } + if (!unionTypes2) { + return false; + } + var checked = []; + var result2 = []; + for (var _i = 0, unionTypes_2 = unionTypes2; _i < unionTypes_2.length; _i++) { + var u7 = unionTypes_2[_i]; + for (var _a2 = 0, _b = u7.types; _a2 < _b.length; _a2++) { + var t8 = _b[_a2]; + if (insertType(checked, t8)) { + if (eachUnionContains(unionTypes2, t8)) { + insertType(result2, t8); + } + } + } + } + types3[index4] = getUnionTypeFromSortedList( + result2, + 32768 + /* ObjectFlags.PrimitiveUnion */ + ); + return true; + } + function createIntersectionType(types3, aliasSymbol, aliasTypeArguments) { + var result2 = createType( + 2097152 + /* TypeFlags.Intersection */ + ); + result2.objectFlags = getPropagatingFlagsOfTypes( + types3, + /*excludeKinds*/ + 98304 + /* TypeFlags.Nullable */ + ); + result2.types = types3; + result2.aliasSymbol = aliasSymbol; + result2.aliasTypeArguments = aliasTypeArguments; + return result2; + } + function getIntersectionType(types3, aliasSymbol, aliasTypeArguments, noSupertypeReduction) { + var typeMembershipMap = new ts2.Map(); + var includes2 = addTypesToIntersection(typeMembershipMap, 0, types3); + var typeSet = ts2.arrayFrom(typeMembershipMap.values()); + if (includes2 & 131072) { + return ts2.contains(typeSet, silentNeverType) ? silentNeverType : neverType2; + } + if (strictNullChecks && includes2 & 98304 && includes2 & (524288 | 67108864 | 16777216) || includes2 & 67108864 && includes2 & (469892092 & ~67108864) || includes2 & 402653316 && includes2 & (469892092 & ~402653316) || includes2 & 296 && includes2 & (469892092 & ~296) || includes2 & 2112 && includes2 & (469892092 & ~2112) || includes2 & 12288 && includes2 & (469892092 & ~12288) || includes2 & 49152 && includes2 & (469892092 & ~49152)) { + return neverType2; + } + if (includes2 & 134217728 && includes2 & 128 && extractRedundantTemplateLiterals(typeSet)) { + return neverType2; + } + if (includes2 & 1) { + return includes2 & 8388608 ? wildcardType : anyType2; + } + if (!strictNullChecks && includes2 & 98304) { + return includes2 & 16777216 ? neverType2 : includes2 & 32768 ? undefinedType2 : nullType2; + } + if (includes2 & 4 && includes2 & (128 | 134217728 | 268435456) || includes2 & 8 && includes2 & 256 || includes2 & 64 && includes2 & 2048 || includes2 & 4096 && includes2 & 8192 || includes2 & 16384 && includes2 & 32768 || includes2 & 16777216 && includes2 & 470302716) { + if (!noSupertypeReduction) + removeRedundantSupertypes(typeSet, includes2); + } + if (includes2 & 262144) { + typeSet[typeSet.indexOf(undefinedType2)] = missingType; + } + if (typeSet.length === 0) { + return unknownType2; + } + if (typeSet.length === 1) { + return typeSet[0]; + } + var id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments); + var result2 = intersectionTypes.get(id); + if (!result2) { + if (includes2 & 1048576) { + if (intersectUnionsOfPrimitiveTypes(typeSet)) { + result2 = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } else if (eachIsUnionContaining( + typeSet, + 32768 + /* TypeFlags.Undefined */ + )) { + var undefinedOrMissingType = exactOptionalPropertyTypes && ts2.some(typeSet, function(t8) { + return containsType(t8.types, missingType); + }) ? missingType : undefinedType2; + removeFromEach( + typeSet, + 32768 + /* TypeFlags.Undefined */ + ); + result2 = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments); + } else if (eachIsUnionContaining( + typeSet, + 65536 + /* TypeFlags.Null */ + )) { + removeFromEach( + typeSet, + 65536 + /* TypeFlags.Null */ + ); + result2 = getUnionType([getIntersectionType(typeSet), nullType2], 1, aliasSymbol, aliasTypeArguments); + } else { + if (!checkCrossProductUnion(typeSet)) { + return errorType; + } + var constituents = getCrossProductIntersections(typeSet); + var origin = ts2.some(constituents, function(t8) { + return !!(t8.flags & 2097152); + }) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152, typeSet) : void 0; + result2 = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin); + } + } else { + result2 = createIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } + intersectionTypes.set(id, result2); + } + return result2; + } + function getCrossProductUnionSize(types3) { + return ts2.reduceLeft(types3, function(n7, t8) { + return t8.flags & 1048576 ? n7 * t8.types.length : t8.flags & 131072 ? 0 : n7; + }, 1); + } + function checkCrossProductUnion(types3) { + var size2 = getCrossProductUnionSize(types3); + if (size2 >= 1e5) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "checkCrossProductUnion_DepthLimit", { typeIds: types3.map(function(t8) { + return t8.id; + }), size: size2 }); + error2(currentNode, ts2.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + return false; + } + return true; + } + function getCrossProductIntersections(types3) { + var count2 = getCrossProductUnionSize(types3); + var intersections = []; + for (var i7 = 0; i7 < count2; i7++) { + var constituents = types3.slice(); + var n7 = i7; + for (var j6 = types3.length - 1; j6 >= 0; j6--) { + if (types3[j6].flags & 1048576) { + var sourceTypes = types3[j6].types; + var length_5 = sourceTypes.length; + constituents[j6] = sourceTypes[n7 % length_5]; + n7 = Math.floor(n7 / length_5); + } + } + var t8 = getIntersectionType(constituents); + if (!(t8.flags & 131072)) + intersections.push(t8); + } + return intersections; + } + function getConstituentCount(type3) { + return !(type3.flags & 3145728) || type3.aliasSymbol ? 1 : type3.flags & 1048576 && type3.origin ? getConstituentCount(type3.origin) : getConstituentCountOfTypes(type3.types); + } + function getConstituentCountOfTypes(types3) { + return ts2.reduceLeft(types3, function(n7, t8) { + return n7 + getConstituentCount(t8); + }, 0); + } + function getTypeFromIntersectionTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var aliasSymbol = getAliasSymbolForTypeNode(node); + var types3 = ts2.map(node.types, getTypeFromTypeNode); + var noSupertypeReduction = types3.length === 2 && !!(types3[0].flags & (4 | 8 | 64)) && types3[1] === emptyTypeLiteralType; + links.resolvedType = getIntersectionType(types3, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction); + } + return links.resolvedType; + } + function createIndexType(type3, stringsOnly) { + var result2 = createType( + 4194304 + /* TypeFlags.Index */ + ); + result2.type = type3; + result2.stringsOnly = stringsOnly; + return result2; + } + function createOriginIndexType(type3) { + var result2 = createOriginType( + 4194304 + /* TypeFlags.Index */ + ); + result2.type = type3; + return result2; + } + function getIndexTypeForGenericType(type3, stringsOnly) { + return stringsOnly ? type3.resolvedStringIndexType || (type3.resolvedStringIndexType = createIndexType( + type3, + /*stringsOnly*/ + true + )) : type3.resolvedIndexType || (type3.resolvedIndexType = createIndexType( + type3, + /*stringsOnly*/ + false + )); + } + function getIndexTypeForMappedType(type3, stringsOnly, noIndexSignatures) { + var typeParameter = getTypeParameterFromMappedType(type3); + var constraintType = getConstraintTypeFromMappedType(type3); + var nameType = getNameTypeFromMappedType(type3.target || type3); + if (!nameType && !noIndexSignatures) { + return constraintType; + } + var keyTypes = []; + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + if (!isGenericIndexType(constraintType)) { + var modifiersType = getApparentType(getModifiersTypeFromMappedType(type3)); + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, stringsOnly, addMemberForKeyType); + } else { + return getIndexTypeForGenericType(type3, stringsOnly); + } + } else { + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); + } + if (isGenericIndexType(constraintType)) { + forEachType(constraintType, addMemberForKeyType); + } + var result2 = noIndexSignatures ? filterType(getUnionType(keyTypes), function(t8) { + return !(t8.flags & (1 | 4)); + }) : getUnionType(keyTypes); + if (result2.flags & 1048576 && constraintType.flags & 1048576 && getTypeListId(result2.types) === getTypeListId(constraintType.types)) { + return constraintType; + } + return result2; + function addMemberForKeyType(keyType) { + var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type3.mapper, typeParameter, keyType)) : keyType; + keyTypes.push(propNameType === stringType2 ? stringOrNumberType : propNameType); + } + } + function hasDistributiveNameType(mappedType) { + var typeVariable = getTypeParameterFromMappedType(mappedType); + return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); + function isDistributive(type3) { + return type3.flags & (3 | 131068 | 131072 | 262144 | 524288 | 67108864) ? true : type3.flags & 16777216 ? type3.root.isDistributive && type3.checkType === typeVariable : type3.flags & (3145728 | 134217728) ? ts2.every(type3.types, isDistributive) : type3.flags & 8388608 ? isDistributive(type3.objectType) && isDistributive(type3.indexType) : type3.flags & 33554432 ? isDistributive(type3.baseType) && isDistributive(type3.constraint) : type3.flags & 268435456 ? isDistributive(type3.type) : false; + } + } + function getLiteralTypeFromPropertyName(name2) { + if (ts2.isPrivateIdentifier(name2)) { + return neverType2; + } + return ts2.isIdentifier(name2) ? getStringLiteralType(ts2.unescapeLeadingUnderscores(name2.escapedText)) : getRegularTypeOfLiteralType(ts2.isComputedPropertyName(name2) ? checkComputedPropertyName(name2) : checkExpression(name2)); + } + function getLiteralTypeFromProperty(prop, include, includeNonPublic) { + if (includeNonPublic || !(ts2.getDeclarationModifierFlagsFromSymbol(prop) & 24)) { + var type3 = getSymbolLinks(getLateBoundSymbol(prop)).nameType; + if (!type3) { + var name2 = ts2.getNameOfDeclaration(prop.valueDeclaration); + type3 = prop.escapedName === "default" ? getStringLiteralType("default") : name2 && getLiteralTypeFromPropertyName(name2) || (!ts2.isKnownSymbol(prop) ? getStringLiteralType(ts2.symbolName(prop)) : void 0); + } + if (type3 && type3.flags & include) { + return type3; + } + } + return neverType2; + } + function isKeyTypeIncluded(keyType, include) { + return !!(keyType.flags & include || keyType.flags & 2097152 && ts2.some(keyType.types, function(t8) { + return isKeyTypeIncluded(t8, include); + })); + } + function getLiteralTypeFromProperties(type3, include, includeOrigin) { + var origin = includeOrigin && (ts2.getObjectFlags(type3) & (3 | 4) || type3.aliasSymbol) ? createOriginIndexType(type3) : void 0; + var propertyTypes = ts2.map(getPropertiesOfType(type3), function(prop) { + return getLiteralTypeFromProperty(prop, include); + }); + var indexKeyTypes = ts2.map(getIndexInfosOfType(type3), function(info2) { + return info2 !== enumNumberIndexInfo && isKeyTypeIncluded(info2.keyType, include) ? info2.keyType === stringType2 && include & 8 ? stringOrNumberType : info2.keyType : neverType2; + }); + return getUnionType( + ts2.concatenate(propertyTypes, indexKeyTypes), + 1, + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0, + origin + ); + } + function isPossiblyReducibleByInstantiation(type3) { + var uniqueFilled = getUniqueLiteralFilledInstantiation(type3); + return getReducedType(uniqueFilled) !== uniqueFilled; + } + function shouldDeferIndexType(type3) { + return !!(type3.flags & 58982400 || isGenericTupleType(type3) || isGenericMappedType(type3) && !hasDistributiveNameType(type3) || type3.flags & 1048576 && ts2.some(type3.types, isPossiblyReducibleByInstantiation) || type3.flags & 2097152 && maybeTypeOfKind( + type3, + 465829888 + /* TypeFlags.Instantiable */ + ) && ts2.some(type3.types, isEmptyAnonymousObjectType)); + } + function getIndexType(type3, stringsOnly, noIndexSignatures) { + if (stringsOnly === void 0) { + stringsOnly = keyofStringsOnly; + } + type3 = getReducedType(type3); + return shouldDeferIndexType(type3) ? getIndexTypeForGenericType(type3, stringsOnly) : type3.flags & 1048576 ? getIntersectionType(ts2.map(type3.types, function(t8) { + return getIndexType(t8, stringsOnly, noIndexSignatures); + })) : type3.flags & 2097152 ? getUnionType(ts2.map(type3.types, function(t8) { + return getIndexType(t8, stringsOnly, noIndexSignatures); + })) : ts2.getObjectFlags(type3) & 32 ? getIndexTypeForMappedType(type3, stringsOnly, noIndexSignatures) : type3 === wildcardType ? wildcardType : type3.flags & 2 ? neverType2 : type3.flags & (1 | 131072) ? keyofConstraintType : getLiteralTypeFromProperties(type3, (noIndexSignatures ? 128 : 402653316) | (stringsOnly ? 0 : 296 | 12288), stringsOnly === keyofStringsOnly && !noIndexSignatures); + } + function getExtractStringType(type3) { + if (keyofStringsOnly) { + return type3; + } + var extractTypeAlias = getGlobalExtractSymbol(); + return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type3, stringType2]) : stringType2; + } + function getIndexTypeOrString(type3) { + var indexType = getExtractStringType(getIndexType(type3)); + return indexType.flags & 131072 ? stringType2 : indexType; + } + function getTypeFromTypeOperatorNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + switch (node.operator) { + case 141: + links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); + break; + case 156: + links.resolvedType = node.type.kind === 153 ? getESSymbolLikeTypeForNode(ts2.walkUpParenthesizedTypes(node.parent)) : errorType; + break; + case 146: + links.resolvedType = getTypeFromTypeNode(node.type); + break; + default: + throw ts2.Debug.assertNever(node.operator); + } + } + return links.resolvedType; + } + function getTypeFromTemplateTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getTemplateLiteralType(__spreadArray9([node.head.text], ts2.map(node.templateSpans, function(span) { + return span.literal.text; + }), true), ts2.map(node.templateSpans, function(span) { + return getTypeFromTypeNode(span.type); + })); + } + return links.resolvedType; + } + function getTemplateLiteralType(texts, types3) { + var unionIndex = ts2.findIndex(types3, function(t8) { + return !!(t8.flags & (131072 | 1048576)); + }); + if (unionIndex >= 0) { + return checkCrossProductUnion(types3) ? mapType2(types3[unionIndex], function(t8) { + return getTemplateLiteralType(texts, ts2.replaceElement(types3, unionIndex, t8)); + }) : errorType; + } + if (ts2.contains(types3, wildcardType)) { + return wildcardType; + } + var newTypes = []; + var newTexts = []; + var text = texts[0]; + if (!addSpans(texts, types3)) { + return stringType2; + } + if (newTypes.length === 0) { + return getStringLiteralType(text); + } + newTexts.push(text); + if (ts2.every(newTexts, function(t8) { + return t8 === ""; + })) { + if (ts2.every(newTypes, function(t8) { + return !!(t8.flags & 4); + })) { + return stringType2; + } + if (newTypes.length === 1 && isPatternLiteralType(newTypes[0])) { + return newTypes[0]; + } + } + var id = "".concat(getTypeListId(newTypes), "|").concat(ts2.map(newTexts, function(t8) { + return t8.length; + }).join(","), "|").concat(newTexts.join("")); + var type3 = templateLiteralTypes.get(id); + if (!type3) { + templateLiteralTypes.set(id, type3 = createTemplateLiteralType(newTexts, newTypes)); + } + return type3; + function addSpans(texts2, types4) { + var isTextsArray = ts2.isArray(texts2); + for (var i7 = 0; i7 < types4.length; i7++) { + var t8 = types4[i7]; + var addText = isTextsArray ? texts2[i7 + 1] : texts2; + if (t8.flags & (2944 | 65536 | 32768)) { + text += getTemplateStringForType(t8) || ""; + text += addText; + if (!isTextsArray) + return true; + } else if (t8.flags & 134217728) { + text += t8.texts[0]; + if (!addSpans(t8.texts, t8.types)) + return false; + text += addText; + if (!isTextsArray) + return true; + } else if (isGenericIndexType(t8) || isPatternLiteralPlaceholderType(t8)) { + newTypes.push(t8); + newTexts.push(text); + text = addText; + } else if (t8.flags & 2097152) { + var added = addSpans(texts2[i7 + 1], t8.types); + if (!added) + return false; + } else if (isTextsArray) { + return false; + } + } + return true; + } + } + function getTemplateStringForType(type3) { + return type3.flags & 128 ? type3.value : type3.flags & 256 ? "" + type3.value : type3.flags & 2048 ? ts2.pseudoBigIntToString(type3.value) : type3.flags & (512 | 98304) ? type3.intrinsicName : void 0; + } + function createTemplateLiteralType(texts, types3) { + var type3 = createType( + 134217728 + /* TypeFlags.TemplateLiteral */ + ); + type3.texts = texts; + type3.types = types3; + return type3; + } + function getStringMappingType(symbol, type3) { + return type3.flags & (1048576 | 131072) ? mapType2(type3, function(t8) { + return getStringMappingType(symbol, t8); + }) : type3.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type3.value)) : type3.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type3.texts, type3.types)) : ( + // Mapping> === Mapping + type3.flags & 268435456 && symbol === type3.symbol ? type3 : type3.flags & (1 | 4 | 268435456) || isGenericIndexType(type3) ? getStringMappingTypeForGenericType(symbol, type3) : ( + // This handles Mapping<`${number}`> and Mapping<`${bigint}`> + isPatternLiteralPlaceholderType(type3) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type3])) : type3 + ) + ); + } + function applyStringMapping(symbol, str2) { + switch (intrinsicTypeKinds.get(symbol.escapedName)) { + case 0: + return str2.toUpperCase(); + case 1: + return str2.toLowerCase(); + case 2: + return str2.charAt(0).toUpperCase() + str2.slice(1); + case 3: + return str2.charAt(0).toLowerCase() + str2.slice(1); + } + return str2; + } + function applyTemplateStringMapping(symbol, texts, types3) { + switch (intrinsicTypeKinds.get(symbol.escapedName)) { + case 0: + return [texts.map(function(t8) { + return t8.toUpperCase(); + }), types3.map(function(t8) { + return getStringMappingType(symbol, t8); + })]; + case 1: + return [texts.map(function(t8) { + return t8.toLowerCase(); + }), types3.map(function(t8) { + return getStringMappingType(symbol, t8); + })]; + case 2: + return [texts[0] === "" ? texts : __spreadArray9([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray9([getStringMappingType(symbol, types3[0])], types3.slice(1), true) : types3]; + case 3: + return [texts[0] === "" ? texts : __spreadArray9([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray9([getStringMappingType(symbol, types3[0])], types3.slice(1), true) : types3]; + } + return [texts, types3]; + } + function getStringMappingTypeForGenericType(symbol, type3) { + var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type3)); + var result2 = stringMappingTypes.get(id); + if (!result2) { + stringMappingTypes.set(id, result2 = createStringMappingType(symbol, type3)); + } + return result2; + } + function createStringMappingType(symbol, type3) { + var result2 = createType( + 268435456 + /* TypeFlags.StringMapping */ + ); + result2.symbol = symbol; + result2.type = type3; + return result2; + } + function createIndexedAccessType(objectType2, indexType, accessFlags, aliasSymbol, aliasTypeArguments) { + var type3 = createType( + 8388608 + /* TypeFlags.IndexedAccess */ + ); + type3.objectType = objectType2; + type3.indexType = indexType; + type3.accessFlags = accessFlags; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + return type3; + } + function isJSLiteralType(type3) { + if (noImplicitAny) { + return false; + } + if (ts2.getObjectFlags(type3) & 4096) { + return true; + } + if (type3.flags & 1048576) { + return ts2.every(type3.types, isJSLiteralType); + } + if (type3.flags & 2097152) { + return ts2.some(type3.types, isJSLiteralType); + } + if (type3.flags & 465829888) { + var constraint = getResolvedBaseConstraint(type3); + return constraint !== type3 && isJSLiteralType(constraint); + } + return false; + } + function getPropertyNameFromIndex(indexType, accessNode) { + return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessNode && ts2.isPropertyName(accessNode) ? ( + // late bound names are handled in the first branch, so here we only need to handle normal names + ts2.getPropertyNameForPropertyNameNode(accessNode) + ) : void 0; + } + function isUncalledFunctionReference(node, symbol) { + if (symbol.flags & (16 | 8192)) { + var parent2 = ts2.findAncestor(node.parent, function(n7) { + return !ts2.isAccessExpression(n7); + }) || node.parent; + if (ts2.isCallLikeExpression(parent2)) { + return ts2.isCallOrNewExpression(parent2) && ts2.isIdentifier(node) && hasMatchingArgument(parent2, node); + } + return ts2.every(symbol.declarations, function(d7) { + return !ts2.isFunctionLike(d7) || !!(ts2.getCombinedNodeFlags(d7) & 268435456); + }); + } + return true; + } + function getPropertyTypeForIndexType(originalObjectType, objectType2, indexType, fullIndexType, accessNode, accessFlags) { + var _a2; + var accessExpression = accessNode && accessNode.kind === 209 ? accessNode : void 0; + var propName2 = accessNode && ts2.isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); + if (propName2 !== void 0) { + if (accessFlags & 256) { + return getTypeOfPropertyOfContextualType(objectType2, propName2) || anyType2; + } + var prop = getPropertyOfType(objectType2, propName2); + if (prop) { + if (accessFlags & 64 && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) { + var deprecatedNode = (_a2 = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a2 !== void 0 ? _a2 : ts2.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode; + addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName2); + } + if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, isSelfTypeAccess(accessExpression.expression, objectType2.symbol)); + if (isAssignmentToReadonlyEntity(accessExpression, prop, ts2.getAssignmentTargetKind(accessExpression))) { + error2(accessExpression.argumentExpression, ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString2(prop)); + return void 0; + } + if (accessFlags & 8) { + getNodeLinks(accessNode).resolvedSymbol = prop; + } + if (isThisPropertyAccessInConstructor(accessExpression, prop)) { + return autoType; + } + } + var propType = getTypeOfSymbol(prop); + return accessExpression && ts2.getAssignmentTargetKind(accessExpression) !== 1 ? getFlowTypeOfReference(accessExpression, propType) : propType; + } + if (everyType(objectType2, isTupleType) && ts2.isNumericLiteralName(propName2)) { + var index4 = +propName2; + if (accessNode && everyType(objectType2, function(t8) { + return !t8.target.hasRestElement; + }) && !(accessFlags & 16)) { + var indexNode = getIndexNodeForAccessExpression(accessNode); + if (isTupleType(objectType2)) { + if (index4 < 0) { + error2(indexNode, ts2.Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value); + return undefinedType2; + } + error2(indexNode, ts2.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType2), getTypeReferenceArity(objectType2), ts2.unescapeLeadingUnderscores(propName2)); + } else { + error2(indexNode, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.unescapeLeadingUnderscores(propName2), typeToString(objectType2)); + } + } + if (index4 >= 0) { + errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType2, numberType2)); + return mapType2(objectType2, function(t8) { + var restType = getRestTypeOfTupleType(t8) || undefinedType2; + return accessFlags & 1 ? getUnionType([restType, undefinedType2]) : restType; + }); + } + } + } + if (!(indexType.flags & 98304) && isTypeAssignableToKind( + indexType, + 402653316 | 296 | 12288 + /* TypeFlags.ESSymbolLike */ + )) { + if (objectType2.flags & (1 | 131072)) { + return objectType2; + } + var indexInfo = getApplicableIndexInfo(objectType2, indexType) || getIndexInfoOfType(objectType2, stringType2); + if (indexInfo) { + if (accessFlags & 2 && indexInfo.keyType !== numberType2) { + if (accessExpression) { + error2(accessExpression, ts2.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + } + return void 0; + } + if (accessNode && indexInfo.keyType === stringType2 && !isTypeAssignableToKind( + indexType, + 4 | 8 + /* TypeFlags.Number */ + )) { + var indexNode = getIndexNodeForAccessExpression(accessNode); + error2(indexNode, ts2.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType2]) : indexInfo.type; + } + errorIfWritingToReadonlyIndex(indexInfo); + if (accessFlags & 1 && !(objectType2.symbol && objectType2.symbol.flags & (256 | 128) && (indexType.symbol && indexType.flags & 1024 && getParentOfSymbol(indexType.symbol) === objectType2.symbol))) { + return getUnionType([indexInfo.type, undefinedType2]); + } + return indexInfo.type; + } + if (indexType.flags & 131072) { + return neverType2; + } + if (isJSLiteralType(objectType2)) { + return anyType2; + } + if (accessExpression && !isConstEnumObjectType(objectType2)) { + if (isObjectLiteralType(objectType2)) { + if (noImplicitAny && indexType.flags & (128 | 256)) { + diagnostics.add(ts2.createDiagnosticForNode(accessExpression, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType2))); + return undefinedType2; + } else if (indexType.flags & (8 | 4)) { + var types3 = ts2.map(objectType2.properties, function(property2) { + return getTypeOfSymbol(property2); + }); + return getUnionType(ts2.append(types3, undefinedType2)); + } + } + if (objectType2.symbol === globalThisSymbol && propName2 !== void 0 && globalThisSymbol.exports.has(propName2) && globalThisSymbol.exports.get(propName2).flags & 418) { + error2(accessExpression, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.unescapeLeadingUnderscores(propName2), typeToString(objectType2)); + } else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128)) { + if (propName2 !== void 0 && typeHasStaticProperty(propName2, objectType2)) { + var typeName = typeToString(objectType2); + error2(accessExpression, ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName2, typeName, typeName + "[" + ts2.getTextOfNode(accessExpression.argumentExpression) + "]"); + } else if (getIndexTypeOfType(objectType2, numberType2)) { + error2(accessExpression.argumentExpression, ts2.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); + } else { + var suggestion = void 0; + if (propName2 !== void 0 && (suggestion = getSuggestionForNonexistentProperty(propName2, objectType2))) { + if (suggestion !== void 0) { + error2(accessExpression.argumentExpression, ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName2, typeToString(objectType2), suggestion); + } + } else { + var suggestion_1 = getSuggestionForNonexistentIndexSignature(objectType2, accessExpression, indexType); + if (suggestion_1 !== void 0) { + error2(accessExpression, ts2.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType2), suggestion_1); + } else { + var errorInfo = void 0; + if (indexType.flags & 1024) { + errorInfo = ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics.Property_0_does_not_exist_on_type_1, + "[" + typeToString(indexType) + "]", + typeToString(objectType2) + ); + } else if (indexType.flags & 8192) { + var symbolName_2 = getFullyQualifiedName2(indexType.symbol, accessExpression); + errorInfo = ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics.Property_0_does_not_exist_on_type_1, + "[" + symbolName_2 + "]", + typeToString(objectType2) + ); + } else if (indexType.flags & 128) { + errorInfo = ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics.Property_0_does_not_exist_on_type_1, + indexType.value, + typeToString(objectType2) + ); + } else if (indexType.flags & 256) { + errorInfo = ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics.Property_0_does_not_exist_on_type_1, + indexType.value, + typeToString(objectType2) + ); + } else if (indexType.flags & (8 | 4)) { + errorInfo = ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1, + typeToString(indexType), + typeToString(objectType2) + ); + } + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1, typeToString(fullIndexType), typeToString(objectType2)); + diagnostics.add(ts2.createDiagnosticForNodeFromMessageChain(accessExpression, errorInfo)); + } + } + } + } + return void 0; + } + } + if (isJSLiteralType(objectType2)) { + return anyType2; + } + if (accessNode) { + var indexNode = getIndexNodeForAccessExpression(accessNode); + if (indexType.flags & (128 | 256)) { + error2(indexNode, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType2)); + } else if (indexType.flags & (4 | 8)) { + error2(indexNode, ts2.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType2), typeToString(indexType)); + } else { + error2(indexNode, ts2.Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + } + } + if (isTypeAny(indexType)) { + return indexType; + } + return void 0; + function errorIfWritingToReadonlyIndex(indexInfo2) { + if (indexInfo2 && indexInfo2.isReadonly && accessExpression && (ts2.isAssignmentTarget(accessExpression) || ts2.isDeleteTarget(accessExpression))) { + error2(accessExpression, ts2.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType2)); + } + } + } + function getIndexNodeForAccessExpression(accessNode) { + return accessNode.kind === 209 ? accessNode.argumentExpression : accessNode.kind === 196 ? accessNode.indexType : accessNode.kind === 164 ? accessNode.expression : accessNode; + } + function isPatternLiteralPlaceholderType(type3) { + return !!(type3.flags & (1 | 4 | 8 | 64)) || isPatternLiteralType(type3); + } + function isPatternLiteralType(type3) { + return !!(type3.flags & 134217728) && ts2.every(type3.types, isPatternLiteralPlaceholderType) || !!(type3.flags & 268435456) && isPatternLiteralPlaceholderType(type3.type); + } + function isGenericType(type3) { + return !!getGenericObjectFlags(type3); + } + function isGenericObjectType(type3) { + return !!(getGenericObjectFlags(type3) & 4194304); + } + function isGenericIndexType(type3) { + return !!(getGenericObjectFlags(type3) & 8388608); + } + function getGenericObjectFlags(type3) { + if (type3.flags & 3145728) { + if (!(type3.objectFlags & 2097152)) { + type3.objectFlags |= 2097152 | ts2.reduceLeft(type3.types, function(flags, t8) { + return flags | getGenericObjectFlags(t8); + }, 0); + } + return type3.objectFlags & 12582912; + } + if (type3.flags & 33554432) { + if (!(type3.objectFlags & 2097152)) { + type3.objectFlags |= 2097152 | getGenericObjectFlags(type3.baseType) | getGenericObjectFlags(type3.constraint); + } + return type3.objectFlags & 12582912; + } + return (type3.flags & 58982400 || isGenericMappedType(type3) || isGenericTupleType(type3) ? 4194304 : 0) | (type3.flags & (58982400 | 4194304 | 134217728 | 268435456) && !isPatternLiteralType(type3) ? 8388608 : 0); + } + function getSimplifiedType(type3, writing) { + return type3.flags & 8388608 ? getSimplifiedIndexedAccessType(type3, writing) : type3.flags & 16777216 ? getSimplifiedConditionalType(type3, writing) : type3; + } + function distributeIndexOverObjectType(objectType2, indexType, writing) { + if (objectType2.flags & 1048576 || objectType2.flags & 2097152 && !shouldDeferIndexType(objectType2)) { + var types3 = ts2.map(objectType2.types, function(t8) { + return getSimplifiedType(getIndexedAccessType(t8, indexType), writing); + }); + return objectType2.flags & 2097152 || writing ? getIntersectionType(types3) : getUnionType(types3); + } + } + function distributeObjectOverIndexType(objectType2, indexType, writing) { + if (indexType.flags & 1048576) { + var types3 = ts2.map(indexType.types, function(t8) { + return getSimplifiedType(getIndexedAccessType(objectType2, t8), writing); + }); + return writing ? getIntersectionType(types3) : getUnionType(types3); + } + } + function getSimplifiedIndexedAccessType(type3, writing) { + var cache = writing ? "simplifiedForWriting" : "simplifiedForReading"; + if (type3[cache]) { + return type3[cache] === circularConstraintType ? type3 : type3[cache]; + } + type3[cache] = circularConstraintType; + var objectType2 = getSimplifiedType(type3.objectType, writing); + var indexType = getSimplifiedType(type3.indexType, writing); + var distributedOverIndex = distributeObjectOverIndexType(objectType2, indexType, writing); + if (distributedOverIndex) { + return type3[cache] = distributedOverIndex; + } + if (!(indexType.flags & 465829888)) { + var distributedOverObject = distributeIndexOverObjectType(objectType2, indexType, writing); + if (distributedOverObject) { + return type3[cache] = distributedOverObject; + } + } + if (isGenericTupleType(objectType2) && indexType.flags & 296) { + var elementType = getElementTypeOfSliceOfTupleType( + objectType2, + indexType.flags & 8 ? 0 : objectType2.target.fixedLength, + /*endSkipCount*/ + 0, + writing + ); + if (elementType) { + return type3[cache] = elementType; + } + } + if (isGenericMappedType(objectType2)) { + var nameType = getNameTypeFromMappedType(objectType2); + if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType2))) { + return type3[cache] = mapType2(substituteIndexedMappedType(objectType2, type3.indexType), function(t8) { + return getSimplifiedType(t8, writing); + }); + } + } + return type3[cache] = type3; + } + function getSimplifiedConditionalType(type3, writing) { + var checkType = type3.checkType; + var extendsType = type3.extendsType; + var trueType2 = getTrueTypeFromConditionalType(type3); + var falseType2 = getFalseTypeFromConditionalType(type3); + if (falseType2.flags & 131072 && getActualTypeVariable(trueType2) === getActualTypeVariable(checkType)) { + if (checkType.flags & 1 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { + return getSimplifiedType(trueType2, writing); + } else if (isIntersectionEmpty(checkType, extendsType)) { + return neverType2; + } + } else if (trueType2.flags & 131072 && getActualTypeVariable(falseType2) === getActualTypeVariable(checkType)) { + if (!(checkType.flags & 1) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { + return neverType2; + } else if (checkType.flags & 1 || isIntersectionEmpty(checkType, extendsType)) { + return getSimplifiedType(falseType2, writing); + } + } + return type3; + } + function isIntersectionEmpty(type1, type22) { + return !!(getUnionType([intersectTypes(type1, type22), neverType2]).flags & 131072); + } + function substituteIndexedMappedType(objectType2, index4) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType2)], [index4]); + var templateMapper = combineTypeMappers(objectType2.mapper, mapper); + return instantiateType(getTemplateTypeFromMappedType(objectType2.target || objectType2), templateMapper); + } + function getIndexedAccessType(objectType2, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) { + if (accessFlags === void 0) { + accessFlags = 0; + } + return getIndexedAccessTypeOrUndefined(objectType2, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType2); + } + function indexTypeLessThan(indexType, limit) { + return everyType(indexType, function(t8) { + if (t8.flags & 384) { + var propName2 = getPropertyNameFromType(t8); + if (ts2.isNumericLiteralName(propName2)) { + var index4 = +propName2; + return index4 >= 0 && index4 < limit; + } + } + return false; + }); + } + function getIndexedAccessTypeOrUndefined(objectType2, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) { + if (accessFlags === void 0) { + accessFlags = 0; + } + if (objectType2 === wildcardType || indexType === wildcardType) { + return wildcardType; + } + if (isStringIndexSignatureOnlyType(objectType2) && !(indexType.flags & 98304) && isTypeAssignableToKind( + indexType, + 4 | 8 + /* TypeFlags.Number */ + )) { + indexType = stringType2; + } + if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32) + accessFlags |= 1; + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 196 ? isGenericTupleType(objectType2) && !indexTypeLessThan(indexType, objectType2.target.fixedLength) : isGenericObjectType(objectType2) && !(isTupleType(objectType2) && indexTypeLessThan(indexType, objectType2.target.fixedLength)))) { + if (objectType2.flags & 3) { + return objectType2; + } + var persistentAccessFlags = accessFlags & 1; + var id = objectType2.id + "," + indexType.id + "," + persistentAccessFlags + getAliasId(aliasSymbol, aliasTypeArguments); + var type3 = indexedAccessTypes.get(id); + if (!type3) { + indexedAccessTypes.set(id, type3 = createIndexedAccessType(objectType2, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments)); + } + return type3; + } + var apparentObjectType = getReducedApparentType(objectType2); + if (indexType.flags & 1048576 && !(indexType.flags & 16)) { + var propTypes = []; + var wasMissingProp = false; + for (var _i = 0, _a2 = indexType.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + var propType = getPropertyTypeForIndexType(objectType2, apparentObjectType, t8, indexType, accessNode, accessFlags | (wasMissingProp ? 128 : 0)); + if (propType) { + propTypes.push(propType); + } else if (!accessNode) { + return void 0; + } else { + wasMissingProp = true; + } + } + if (wasMissingProp) { + return void 0; + } + return accessFlags & 4 ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments); + } + return getPropertyTypeForIndexType( + objectType2, + apparentObjectType, + indexType, + indexType, + accessNode, + accessFlags | 8 | 64 + /* AccessFlags.ReportDeprecated */ + ); + } + function getTypeFromIndexedAccessTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var objectType2 = getTypeFromTypeNode(node.objectType); + var indexType = getTypeFromTypeNode(node.indexType); + var potentialAlias = getAliasSymbolForTypeNode(node); + links.resolvedType = getIndexedAccessType(objectType2, indexType, 0, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + } + return links.resolvedType; + } + function getTypeFromMappedTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var type3 = createObjectType(32, node.symbol); + type3.declaration = node; + type3.aliasSymbol = getAliasSymbolForTypeNode(node); + type3.aliasTypeArguments = getTypeArgumentsForAliasSymbol(type3.aliasSymbol); + links.resolvedType = type3; + getConstraintTypeFromMappedType(type3); + } + return links.resolvedType; + } + function getActualTypeVariable(type3) { + if (type3.flags & 33554432) { + return type3.baseType; + } + if (type3.flags & 8388608 && (type3.objectType.flags & 33554432 || type3.indexType.flags & 33554432)) { + return getIndexedAccessType(getActualTypeVariable(type3.objectType), getActualTypeVariable(type3.indexType)); + } + return type3; + } + function maybeCloneTypeParameter(p7) { + var constraint = getConstraintOfTypeParameter(p7); + return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p7) : p7; + } + function isTypicalNondistributiveConditional(root2) { + return !root2.isDistributive && isSingletonTupleType(root2.node.checkType) && isSingletonTupleType(root2.node.extendsType); + } + function isSingletonTupleType(node) { + return ts2.isTupleTypeNode(node) && ts2.length(node.elements) === 1 && !ts2.isOptionalTypeNode(node.elements[0]) && !ts2.isRestTypeNode(node.elements[0]) && !(ts2.isNamedTupleMember(node.elements[0]) && (node.elements[0].questionToken || node.elements[0].dotDotDotToken)); + } + function unwrapNondistributiveConditionalTuple(root2, type3) { + return isTypicalNondistributiveConditional(root2) && isTupleType(type3) ? getTypeArguments(type3)[0] : type3; + } + function getConditionalType(root2, mapper, aliasSymbol, aliasTypeArguments) { + var result2; + var extraTypes; + var tailCount = 0; + while (true) { + if (tailCount === 1e3) { + error2(currentNode, ts2.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + result2 = errorType; + break; + } + var isUnwrapped = isTypicalNondistributiveConditional(root2); + var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root2, getActualTypeVariable(root2.checkType)), mapper); + var checkTypeInstantiable = isGenericType(checkType); + var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root2, root2.extendsType), mapper); + if (checkType === wildcardType || extendsType === wildcardType) { + return wildcardType; + } + var combinedMapper = void 0; + if (root2.inferTypeParameters) { + var freshParams = ts2.sameMap(root2.inferTypeParameters, maybeCloneTypeParameter); + var freshMapper = freshParams !== root2.inferTypeParameters ? createTypeMapper(root2.inferTypeParameters, freshParams) : void 0; + var context2 = createInferenceContext( + freshParams, + /*signature*/ + void 0, + 0 + /* InferenceFlags.None */ + ); + if (freshMapper) { + var freshCombinedMapper = combineTypeMappers(mapper, freshMapper); + for (var _i = 0, freshParams_1 = freshParams; _i < freshParams_1.length; _i++) { + var p7 = freshParams_1[_i]; + if (root2.inferTypeParameters.indexOf(p7) === -1) { + p7.mapper = freshCombinedMapper; + } + } + } + if (!checkTypeInstantiable) { + inferTypes( + context2.inferences, + checkType, + instantiateType(extendsType, freshMapper), + 512 | 1024 + /* InferencePriority.AlwaysStrict */ + ); + } + var innerMapper = combineTypeMappers(freshMapper, context2.mapper); + combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper; + } + var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root2, root2.extendsType), combinedMapper) : extendsType; + if (!checkTypeInstantiable && !isGenericType(inferredExtendsType)) { + if (!(inferredExtendsType.flags & 3) && (checkType.flags & 1 && !isUnwrapped || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { + if (checkType.flags & 1 && !isUnwrapped) { + (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root2.node.trueType), combinedMapper || mapper)); + } + var falseType_1 = getTypeFromTypeNode(root2.node.falseType); + if (falseType_1.flags & 16777216) { + var newRoot = falseType_1.root; + if (newRoot.node.parent === root2.node && (!newRoot.isDistributive || newRoot.checkType === root2.checkType)) { + root2 = newRoot; + continue; + } + if (canTailRecurse(falseType_1, mapper)) { + continue; + } + } + result2 = instantiateType(falseType_1, mapper); + break; + } + if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { + var trueType_1 = getTypeFromTypeNode(root2.node.trueType); + var trueMapper = combinedMapper || mapper; + if (canTailRecurse(trueType_1, trueMapper)) { + continue; + } + result2 = instantiateType(trueType_1, trueMapper); + break; + } + } + result2 = createType( + 16777216 + /* TypeFlags.Conditional */ + ); + result2.root = root2; + result2.checkType = instantiateType(root2.checkType, mapper); + result2.extendsType = instantiateType(root2.extendsType, mapper); + result2.mapper = mapper; + result2.combinedMapper = combinedMapper; + result2.aliasSymbol = aliasSymbol || root2.aliasSymbol; + result2.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root2.aliasTypeArguments, mapper); + break; + } + return extraTypes ? getUnionType(ts2.append(extraTypes, result2)) : result2; + function canTailRecurse(newType, newMapper) { + if (newType.flags & 16777216 && newMapper) { + var newRoot2 = newType.root; + if (newRoot2.outerTypeParameters) { + var typeParamMapper_1 = combineTypeMappers(newType.mapper, newMapper); + var typeArguments = ts2.map(newRoot2.outerTypeParameters, function(t8) { + return getMappedType(t8, typeParamMapper_1); + }); + var newRootMapper = createTypeMapper(newRoot2.outerTypeParameters, typeArguments); + var newCheckType = newRoot2.isDistributive ? getMappedType(newRoot2.checkType, newRootMapper) : void 0; + if (!newCheckType || newCheckType === newRoot2.checkType || !(newCheckType.flags & (1048576 | 131072))) { + root2 = newRoot2; + mapper = newRootMapper; + aliasSymbol = void 0; + aliasTypeArguments = void 0; + if (newRoot2.aliasSymbol) { + tailCount++; + } + return true; + } + } + } + return false; + } + } + function getTrueTypeFromConditionalType(type3) { + return type3.resolvedTrueType || (type3.resolvedTrueType = instantiateType(getTypeFromTypeNode(type3.root.node.trueType), type3.mapper)); + } + function getFalseTypeFromConditionalType(type3) { + return type3.resolvedFalseType || (type3.resolvedFalseType = instantiateType(getTypeFromTypeNode(type3.root.node.falseType), type3.mapper)); + } + function getInferredTrueTypeFromConditionalType(type3) { + return type3.resolvedInferredTrueType || (type3.resolvedInferredTrueType = type3.combinedMapper ? instantiateType(getTypeFromTypeNode(type3.root.node.trueType), type3.combinedMapper) : getTrueTypeFromConditionalType(type3)); + } + function getInferTypeParameters(node) { + var result2; + if (node.locals) { + node.locals.forEach(function(symbol) { + if (symbol.flags & 262144) { + result2 = ts2.append(result2, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result2; + } + function isDistributionDependent(root2) { + return root2.isDistributive && (isTypeParameterPossiblyReferenced(root2.checkType, root2.node.trueType) || isTypeParameterPossiblyReferenced(root2.checkType, root2.node.falseType)); + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var checkType = getTypeFromTypeNode(node.checkType); + var aliasSymbol = getAliasSymbolForTypeNode(node); + var aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + var allOuterTypeParameters = getOuterTypeParameters( + node, + /*includeThisTypes*/ + true + ); + var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts2.filter(allOuterTypeParameters, function(tp) { + return isTypeParameterPossiblyReferenced(tp, node); + }); + var root2 = { + node, + checkType, + extendsType: getTypeFromTypeNode(node.extendsType), + isDistributive: !!(checkType.flags & 262144), + inferTypeParameters: getInferTypeParameters(node), + outerTypeParameters, + instantiations: void 0, + aliasSymbol, + aliasTypeArguments + }; + links.resolvedType = getConditionalType( + root2, + /*mapper*/ + void 0 + ); + if (outerTypeParameters) { + root2.instantiations = new ts2.Map(); + root2.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); + } + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } + function getIdentifierChain(node) { + if (ts2.isIdentifier(node)) { + return [node]; + } else { + return ts2.append(getIdentifierChain(node.left), node.right); + } + } + function getTypeFromImportTypeNode(node) { + var _a2; + var links = getNodeLinks(node); + if (!links.resolvedType) { + if (node.isTypeOf && node.typeArguments) { + error2(node, ts2.Diagnostics.Type_arguments_cannot_be_used_here); + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = errorType; + } + if (!ts2.isLiteralImportTypeNode(node)) { + error2(node.argument, ts2.Diagnostics.String_literal_expected); + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = errorType; + } + var targetMeaning = node.isTypeOf ? 111551 : node.flags & 8388608 ? 111551 | 788968 : 788968; + var innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal); + if (!innerModuleSymbol) { + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = errorType; + } + var isExportEquals = !!((_a2 = innerModuleSymbol.exports) === null || _a2 === void 0 ? void 0 : _a2.get( + "export=" + /* InternalSymbolName.ExportEquals */ + )); + var moduleSymbol = resolveExternalModuleSymbol( + innerModuleSymbol, + /*dontResolveAlias*/ + false + ); + if (!ts2.nodeIsMissing(node.qualifier)) { + var nameStack = getIdentifierChain(node.qualifier); + var currentNamespace = moduleSymbol; + var current = void 0; + while (current = nameStack.shift()) { + var meaning = nameStack.length ? 1920 : targetMeaning; + var mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); + var symbolFromVariable = node.isTypeOf || ts2.isInJSFile(node) && isExportEquals ? getPropertyOfType( + getTypeOfSymbol(mergedResolvedSymbol), + current.escapedText, + /*skipObjectFunctionPropertyAugment*/ + false, + /*includeTypeOnlyMembers*/ + true + ) : void 0; + var symbolFromModule = node.isTypeOf ? void 0 : getSymbol(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + var next = symbolFromModule !== null && symbolFromModule !== void 0 ? symbolFromModule : symbolFromVariable; + if (!next) { + error2(current, ts2.Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName2(currentNamespace), ts2.declarationNameToString(current)); + return links.resolvedType = errorType; + } + getNodeLinks(current).resolvedSymbol = next; + getNodeLinks(current.parent).resolvedSymbol = next; + currentNamespace = next; + } + links.resolvedType = resolveImportSymbolType(node, links, currentNamespace, targetMeaning); + } else { + if (moduleSymbol.flags & targetMeaning) { + links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning); + } else { + var errorMessage = targetMeaning === 111551 ? ts2.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : ts2.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0; + error2(node, errorMessage, node.argument.literal.text); + links.resolvedSymbol = unknownSymbol; + links.resolvedType = errorType; + } + } + } + return links.resolvedType; + } + function resolveImportSymbolType(node, links, symbol, meaning) { + var resolvedSymbol = resolveSymbol(symbol); + links.resolvedSymbol = resolvedSymbol; + if (meaning === 111551) { + return getTypeOfSymbol(symbol); + } else { + return getTypeReferenceType(node, resolvedSymbol); + } + } + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var aliasSymbol = getAliasSymbolForTypeNode(node); + if (getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { + links.resolvedType = emptyTypeLiteralType; + } else { + var type3 = createObjectType(16, node.symbol); + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + if (ts2.isJSDocTypeLiteral(node) && node.isArrayType) { + type3 = createArrayType(type3); + } + links.resolvedType = type3; + } + } + return links.resolvedType; + } + function getAliasSymbolForTypeNode(node) { + var host2 = node.parent; + while (ts2.isParenthesizedTypeNode(host2) || ts2.isJSDocTypeExpression(host2) || ts2.isTypeOperatorNode(host2) && host2.operator === 146) { + host2 = host2.parent; + } + return ts2.isTypeAlias(host2) ? getSymbolOfNode(host2) : void 0; + } + function getTypeArgumentsForAliasSymbol(symbol) { + return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : void 0; + } + function isNonGenericObjectType(type3) { + return !!(type3.flags & 524288) && !isGenericMappedType(type3); + } + function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type3) { + return isEmptyObjectType(type3) || !!(type3.flags & (65536 | 32768 | 528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)); + } + function tryMergeUnionOfObjectTypeAndEmptyObject(type3, readonly) { + if (!(type3.flags & 1048576)) { + return type3; + } + if (ts2.every(type3.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { + return ts2.find(type3.types, isEmptyObjectType) || emptyObjectType; + } + var firstType = ts2.find(type3.types, function(t8) { + return !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t8); + }); + if (!firstType) { + return type3; + } + var secondType = ts2.find(type3.types, function(t8) { + return t8 !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t8); + }); + if (secondType) { + return type3; + } + return getAnonymousPartialType(firstType); + function getAnonymousPartialType(type4) { + var members = ts2.createSymbolTable(); + for (var _i = 0, _a2 = getPropertiesOfType(type4); _i < _a2.length; _i++) { + var prop = _a2[_i]; + if (ts2.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16)) { + } else if (isSpreadableProperty(prop)) { + var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); + var flags = 4 | 16777216; + var result2 = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0)); + result2.type = isSetonlyAccessor ? undefinedType2 : addOptionality( + getTypeOfSymbol(prop), + /*isProperty*/ + true + ); + result2.declarations = prop.declarations; + result2.nameType = getSymbolLinks(prop).nameType; + result2.syntheticOrigin = prop; + members.set(prop.escapedName, result2); + } + } + var spread2 = createAnonymousType(type4.symbol, members, ts2.emptyArray, ts2.emptyArray, getIndexInfosOfType(type4)); + spread2.objectFlags |= 128 | 131072; + return spread2; + } + } + function getSpreadType(left, right, symbol, objectFlags, readonly) { + if (left.flags & 1 || right.flags & 1) { + return anyType2; + } + if (left.flags & 2 || right.flags & 2) { + return unknownType2; + } + if (left.flags & 131072) { + return right; + } + if (right.flags & 131072) { + return left; + } + left = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); + if (left.flags & 1048576) { + return checkCrossProductUnion([left, right]) ? mapType2(left, function(t8) { + return getSpreadType(t8, right, symbol, objectFlags, readonly); + }) : errorType; + } + right = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); + if (right.flags & 1048576) { + return checkCrossProductUnion([left, right]) ? mapType2(right, function(t8) { + return getSpreadType(left, t8, symbol, objectFlags, readonly); + }) : errorType; + } + if (right.flags & (528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)) { + return left; + } + if (isGenericObjectType(left) || isGenericObjectType(right)) { + if (isEmptyObjectType(left)) { + return right; + } + if (left.flags & 2097152) { + var types3 = left.types; + var lastLeft = types3[types3.length - 1]; + if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) { + return getIntersectionType(ts2.concatenate(types3.slice(0, types3.length - 1), [getSpreadType(lastLeft, right, symbol, objectFlags, readonly)])); + } + } + return getIntersectionType([left, right]); + } + var members = ts2.createSymbolTable(); + var skippedPrivateMembers = new ts2.Set(); + var indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]); + for (var _i = 0, _a2 = getPropertiesOfType(right); _i < _a2.length; _i++) { + var rightProp = _a2[_i]; + if (ts2.getDeclarationModifierFlagsFromSymbol(rightProp) & (8 | 16)) { + skippedPrivateMembers.add(rightProp.escapedName); + } else if (isSpreadableProperty(rightProp)) { + members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly)); + } + } + for (var _b = 0, _c = getPropertiesOfType(left); _b < _c.length; _b++) { + var leftProp = _c[_b]; + if (skippedPrivateMembers.has(leftProp.escapedName) || !isSpreadableProperty(leftProp)) { + continue; + } + if (members.has(leftProp.escapedName)) { + var rightProp = members.get(leftProp.escapedName); + var rightType = getTypeOfSymbol(rightProp); + if (rightProp.flags & 16777216) { + var declarations = ts2.concatenate(leftProp.declarations, rightProp.declarations); + var flags = 4 | leftProp.flags & 16777216; + var result2 = createSymbol(flags, leftProp.escapedName); + result2.type = getUnionType( + [getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], + 2 + /* UnionReduction.Subtype */ + ); + result2.leftSpread = leftProp; + result2.rightSpread = rightProp; + result2.declarations = declarations; + result2.nameType = getSymbolLinks(leftProp).nameType; + members.set(leftProp.escapedName, result2); + } + } else { + members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); + } + } + var spread2 = createAnonymousType(symbol, members, ts2.emptyArray, ts2.emptyArray, ts2.sameMap(indexInfos, function(info2) { + return getIndexInfoWithReadonly(info2, readonly); + })); + spread2.objectFlags |= 128 | 131072 | 2097152 | objectFlags; + return spread2; + } + function isSpreadableProperty(prop) { + var _a2; + return !ts2.some(prop.declarations, ts2.isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 | 32768 | 65536)) || !((_a2 = prop.declarations) === null || _a2 === void 0 ? void 0 : _a2.some(function(decl) { + return ts2.isClassLike(decl.parent); + }))); + } + function getSpreadSymbol(prop, readonly) { + var isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); + if (!isSetonlyAccessor && readonly === isReadonlySymbol(prop)) { + return prop; + } + var flags = 4 | prop.flags & 16777216; + var result2 = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0)); + result2.type = isSetonlyAccessor ? undefinedType2 : getTypeOfSymbol(prop); + result2.declarations = prop.declarations; + result2.nameType = getSymbolLinks(prop).nameType; + result2.syntheticOrigin = prop; + return result2; + } + function getIndexInfoWithReadonly(info2, readonly) { + return info2.isReadonly !== readonly ? createIndexInfo(info2.keyType, info2.type, readonly, info2.declaration) : info2; + } + function createLiteralType(flags, value2, symbol, regularType) { + var type3 = createType(flags); + type3.symbol = symbol; + type3.value = value2; + type3.regularType = regularType || type3; + return type3; + } + function getFreshTypeOfLiteralType(type3) { + if (type3.flags & 2944) { + if (!type3.freshType) { + var freshType = createLiteralType(type3.flags, type3.value, type3.symbol, type3); + freshType.freshType = freshType; + type3.freshType = freshType; + } + return type3.freshType; + } + return type3; + } + function getRegularTypeOfLiteralType(type3) { + return type3.flags & 2944 ? type3.regularType : type3.flags & 1048576 ? type3.regularType || (type3.regularType = mapType2(type3, getRegularTypeOfLiteralType)) : type3; + } + function isFreshLiteralType(type3) { + return !!(type3.flags & 2944) && type3.freshType === type3; + } + function getStringLiteralType(value2) { + var type3; + return stringLiteralTypes.get(value2) || (stringLiteralTypes.set(value2, type3 = createLiteralType(128, value2)), type3); + } + function getNumberLiteralType(value2) { + var type3; + return numberLiteralTypes.get(value2) || (numberLiteralTypes.set(value2, type3 = createLiteralType(256, value2)), type3); + } + function getBigIntLiteralType(value2) { + var type3; + var key = ts2.pseudoBigIntToString(value2); + return bigIntLiteralTypes.get(key) || (bigIntLiteralTypes.set(key, type3 = createLiteralType(2048, value2)), type3); + } + function getEnumLiteralType(value2, enumId, symbol) { + var type3; + var qualifier = typeof value2 === "string" ? "@" : "#"; + var key = enumId + qualifier + value2; + var flags = 1024 | (typeof value2 === "string" ? 128 : 256); + return enumLiteralTypes.get(key) || (enumLiteralTypes.set(key, type3 = createLiteralType(flags, value2, symbol)), type3); + } + function getTypeFromLiteralTypeNode(node) { + if (node.literal.kind === 104) { + return nullType2; + } + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getRegularTypeOfLiteralType(checkExpression(node.literal)); + } + return links.resolvedType; + } + function createUniqueESSymbolType(symbol) { + var type3 = createType( + 8192 + /* TypeFlags.UniqueESSymbol */ + ); + type3.symbol = symbol; + type3.escapedName = "__@".concat(type3.symbol.escapedName, "@").concat(getSymbolId(type3.symbol)); + return type3; + } + function getESSymbolLikeTypeForNode(node) { + if (ts2.isValidESSymbolDeclaration(node)) { + var symbol = ts2.isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node); + if (symbol) { + var links = getSymbolLinks(symbol); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); + } + } + return esSymbolType; + } + function getThisType(node) { + var container = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + var parent2 = container && container.parent; + if (parent2 && (ts2.isClassLike(parent2) || parent2.kind === 261)) { + if (!ts2.isStatic(container) && (!ts2.isConstructorDeclaration(container) || ts2.isNodeDescendantOf(node, container.body))) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2)).thisType; + } + } + if (parent2 && ts2.isObjectLiteralExpression(parent2) && ts2.isBinaryExpression(parent2.parent) && ts2.getAssignmentDeclarationKind(parent2.parent) === 6) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent2.parent.left).parent).thisType; + } + var host2 = node.flags & 8388608 ? ts2.getHostSignatureFromJSDoc(node) : void 0; + if (host2 && ts2.isFunctionExpression(host2) && ts2.isBinaryExpression(host2.parent) && ts2.getAssignmentDeclarationKind(host2.parent) === 3) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host2.parent.left).parent).thisType; + } + if (isJSConstructor(container) && ts2.isNodeDescendantOf(node, container.body)) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(container)).thisType; + } + error2(node, ts2.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface); + return errorType; + } + function getTypeFromThisTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getThisType(node); + } + return links.resolvedType; + } + function getTypeFromRestTypeNode(node) { + return getTypeFromTypeNode(getArrayElementTypeNode(node.type) || node.type); + } + function getArrayElementTypeNode(node) { + switch (node.kind) { + case 193: + return getArrayElementTypeNode(node.type); + case 186: + if (node.elements.length === 1) { + node = node.elements[0]; + if (node.kind === 188 || node.kind === 199 && node.dotDotDotToken) { + return getArrayElementTypeNode(node.type); + } + } + break; + case 185: + return node.elementType; + } + return void 0; + } + function getTypeFromNamedTupleTypeNode(node) { + var links = getNodeLinks(node); + return links.resolvedType || (links.resolvedType = node.dotDotDotToken ? getTypeFromRestTypeNode(node) : addOptionality( + getTypeFromTypeNode(node.type), + /*isProperty*/ + true, + !!node.questionToken + )); + } + function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { + switch (node.kind) { + case 131: + case 315: + case 316: + return anyType2; + case 157: + return unknownType2; + case 152: + return stringType2; + case 148: + return numberType2; + case 160: + return bigintType; + case 134: + return booleanType2; + case 153: + return esSymbolType; + case 114: + return voidType2; + case 155: + return undefinedType2; + case 104: + return nullType2; + case 144: + return neverType2; + case 149: + return node.flags & 262144 && !noImplicitAny ? anyType2 : nonPrimitiveType; + case 139: + return intrinsicMarkerType; + case 194: + case 108: + return getTypeFromThisTypeNode(node); + case 198: + return getTypeFromLiteralTypeNode(node); + case 180: + return getTypeFromTypeReference(node); + case 179: + return node.assertsModifier ? voidType2 : booleanType2; + case 230: + return getTypeFromTypeReference(node); + case 183: + return getTypeFromTypeQueryNode(node); + case 185: + case 186: + return getTypeFromArrayOrTupleTypeNode(node); + case 187: + return getTypeFromOptionalTypeNode(node); + case 189: + return getTypeFromUnionTypeNode(node); + case 190: + return getTypeFromIntersectionTypeNode(node); + case 317: + return getTypeFromJSDocNullableTypeNode(node); + case 319: + return addOptionality(getTypeFromTypeNode(node.type)); + case 199: + return getTypeFromNamedTupleTypeNode(node); + case 193: + case 318: + case 312: + return getTypeFromTypeNode(node.type); + case 188: + return getTypeFromRestTypeNode(node); + case 321: + return getTypeFromJSDocVariadicType(node); + case 181: + case 182: + case 184: + case 325: + case 320: + case 326: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 195: + return getTypeFromTypeOperatorNode(node); + case 196: + return getTypeFromIndexedAccessTypeNode(node); + case 197: + return getTypeFromMappedTypeNode(node); + case 191: + return getTypeFromConditionalTypeNode(node); + case 192: + return getTypeFromInferTypeNode(node); + case 200: + return getTypeFromTemplateTypeNode(node); + case 202: + return getTypeFromImportTypeNode(node); + case 79: + case 163: + case 208: + var symbol = getSymbolAtLocation(node); + return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; + default: + return errorType; + } + } + function instantiateList(items, mapper, instantiator) { + if (items && items.length) { + for (var i7 = 0; i7 < items.length; i7++) { + var item = items[i7]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result2 = i7 === 0 ? [] : items.slice(0, i7); + result2.push(mapped); + for (i7++; i7 < items.length; i7++) { + result2.push(instantiator(items[i7], mapper)); + } + return result2; + } + } + } + return items; + } + function instantiateTypes(types3, mapper) { + return instantiateList(types3, mapper, instantiateType); + } + function instantiateSignatures(signatures, mapper) { + return instantiateList(signatures, mapper, instantiateSignature); + } + function instantiateIndexInfos(indexInfos, mapper) { + return instantiateList(indexInfos, mapper, instantiateIndexInfo); + } + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType2) : makeArrayTypeMapper(sources, targets); + } + function getMappedType(type3, mapper) { + switch (mapper.kind) { + case 0: + return type3 === mapper.source ? mapper.target : type3; + case 1: { + var sources = mapper.sources; + var targets = mapper.targets; + for (var i7 = 0; i7 < sources.length; i7++) { + if (type3 === sources[i7]) { + return targets ? targets[i7] : anyType2; + } + } + return type3; + } + case 2: { + var sources = mapper.sources; + var targets = mapper.targets; + for (var i7 = 0; i7 < sources.length; i7++) { + if (type3 === sources[i7]) { + return targets[i7](); + } + } + return type3; + } + case 3: + return mapper.func(type3); + case 4: + case 5: + var t1 = getMappedType(type3, mapper.mapper1); + return t1 !== type3 && mapper.kind === 4 ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return ts2.Debug.attachDebugPrototypeIfDebug({ kind: 0, source, target }); + } + function makeArrayTypeMapper(sources, targets) { + return ts2.Debug.attachDebugPrototypeIfDebug({ kind: 1, sources, targets }); + } + function makeFunctionTypeMapper(func, debugInfo) { + return ts2.Debug.attachDebugPrototypeIfDebug({ kind: 3, func, debugInfo: ts2.Debug.isDebugging ? debugInfo : void 0 }); + } + function makeDeferredTypeMapper(sources, targets) { + return ts2.Debug.attachDebugPrototypeIfDebug({ kind: 2, sources, targets }); + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return ts2.Debug.attachDebugPrototypeIfDebug({ kind, mapper1, mapper2 }); + } + function createTypeEraser(sources) { + return createTypeMapper( + sources, + /*targets*/ + void 0 + ); + } + function createBackreferenceMapper(context2, index4) { + var forwardInferences = context2.inferences.slice(index4); + return createTypeMapper(ts2.map(forwardInferences, function(i7) { + return i7.typeParameter; + }), ts2.map(forwardInferences, function() { + return unknownType2; + })); + } + function combineTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4, mapper1, mapper2) : mapper2; + } + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(5, mapper1, mapper2) : mapper2; + } + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, makeUnaryTypeMapper(source, target), mapper); + } + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, mapper, makeUnaryTypeMapper(source, target)); + } + function getRestrictiveTypeParameter(tp) { + return !tp.constraint && !getConstraintDeclaration(tp) || tp.constraint === noConstraintType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = noConstraintType, tp.restrictiveInstantiation); + } + function cloneTypeParameter(typeParameter) { + var result2 = createTypeParameter(typeParameter.symbol); + result2.target = typeParameter; + return result2; + } + function instantiateTypePredicate(predicate, mapper) { + return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper)); + } + function instantiateSignature(signature, mapper, eraseTypeParameters) { + var freshTypeParameters; + if (signature.typeParameters && !eraseTypeParameters) { + freshTypeParameters = ts2.map(signature.typeParameters, cloneTypeParameter); + mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (var _i = 0, freshTypeParameters_1 = freshTypeParameters; _i < freshTypeParameters_1.length; _i++) { + var tp = freshTypeParameters_1[_i]; + tp.mapper = mapper; + } + } + var result2 = createSignature( + signature.declaration, + freshTypeParameters, + signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), + instantiateList(signature.parameters, mapper, instantiateSymbol), + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + signature.minArgumentCount, + signature.flags & 39 + /* SignatureFlags.PropagatingFlags */ + ); + result2.target = signature; + result2.mapper = mapper; + return result2; + } + function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !couldContainTypeVariables(links.type)) { + return symbol; + } + if (ts2.getCheckFlags(symbol) & 1) { + symbol = links.target; + mapper = combineTypeMappers(links.mapper, mapper); + } + var result2 = createSymbol(symbol.flags, symbol.escapedName, 1 | ts2.getCheckFlags(symbol) & (8 | 4096 | 16384 | 32768)); + result2.declarations = symbol.declarations; + result2.parent = symbol.parent; + result2.target = symbol; + result2.mapper = mapper; + if (symbol.valueDeclaration) { + result2.valueDeclaration = symbol.valueDeclaration; + } + if (links.nameType) { + result2.nameType = links.nameType; + } + return result2; + } + function getObjectTypeInstantiation(type3, mapper, aliasSymbol, aliasTypeArguments) { + var declaration = type3.objectFlags & 4 ? type3.node : type3.objectFlags & 8388608 ? type3.node : type3.symbol.declarations[0]; + var links = getNodeLinks(declaration); + var target = type3.objectFlags & 4 ? links.resolvedType : type3.objectFlags & 64 ? type3.target : type3; + var typeParameters = links.outerTypeParameters; + if (!typeParameters) { + var outerTypeParameters = getOuterTypeParameters( + declaration, + /*includeThisTypes*/ + true + ); + if (isJSConstructor(declaration)) { + var templateTagParameters = getTypeParametersFromDeclaration(declaration); + outerTypeParameters = ts2.addRange(outerTypeParameters, templateTagParameters); + } + typeParameters = outerTypeParameters || ts2.emptyArray; + var allDeclarations_1 = type3.objectFlags & (4 | 8388608) ? [declaration] : type3.symbol.declarations; + typeParameters = (target.objectFlags & (4 | 8388608) || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ? ts2.filter(typeParameters, function(tp) { + return ts2.some(allDeclarations_1, function(d7) { + return isTypeParameterPossiblyReferenced(tp, d7); + }); + }) : typeParameters; + links.outerTypeParameters = typeParameters; + } + if (typeParameters.length) { + var combinedMapper_1 = combineTypeMappers(type3.mapper, mapper); + var typeArguments = ts2.map(typeParameters, function(t8) { + return getMappedType(t8, combinedMapper_1); + }); + var newAliasSymbol = aliasSymbol || type3.aliasSymbol; + var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + var id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); + if (!target.instantiations) { + target.instantiations = new ts2.Map(); + target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target); + } + var result2 = target.instantiations.get(id); + if (!result2) { + var newMapper = createTypeMapper(typeParameters, typeArguments); + result2 = target.objectFlags & 4 ? createDeferredTypeReference(type3.target, type3.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments); + target.instantiations.set(id, result2); + } + return result2; + } + return type3; + } + function maybeTypeParameterReference(node) { + return !(node.parent.kind === 180 && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 202 && node.parent.typeArguments && node === node.parent.qualifier); + } + function isTypeParameterPossiblyReferenced(tp, node) { + if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { + var container = tp.symbol.declarations[0].parent; + for (var n7 = node; n7 !== container; n7 = n7.parent) { + if (!n7 || n7.kind === 238 || n7.kind === 191 && ts2.forEachChild(n7.extendsType, containsReference)) { + return true; + } + } + return containsReference(node); + } + return true; + function containsReference(node2) { + switch (node2.kind) { + case 194: + return !!tp.isThisType; + case 79: + return !tp.isThisType && ts2.isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; + case 183: + var entityName = node2.exprName; + var firstIdentifier = ts2.getFirstIdentifier(entityName); + var firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); + var tpDeclaration = tp.symbol.declarations[0]; + var tpScope_1; + if (tpDeclaration.kind === 165) { + tpScope_1 = tpDeclaration.parent; + } else if (tp.isThisType) { + tpScope_1 = tpDeclaration; + } else { + return true; + } + if (firstIdentifierSymbol.declarations) { + return ts2.some(firstIdentifierSymbol.declarations, function(idDecl) { + return ts2.isNodeDescendantOf(idDecl, tpScope_1); + }) || ts2.some(node2.typeArguments, containsReference); + } + return true; + case 171: + case 170: + return !node2.type && !!node2.body || ts2.some(node2.typeParameters, containsReference) || ts2.some(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); + } + return !!ts2.forEachChild(node2, containsReference); + } + } + function getHomomorphicTypeVariable(type3) { + var constraintType = getConstraintTypeFromMappedType(type3); + if (constraintType.flags & 4194304) { + var typeVariable = getActualTypeVariable(constraintType.type); + if (typeVariable.flags & 262144) { + return typeVariable; + } + } + return void 0; + } + function instantiateMappedType(type3, mapper, aliasSymbol, aliasTypeArguments) { + var typeVariable = getHomomorphicTypeVariable(type3); + if (typeVariable) { + var mappedTypeVariable = instantiateType(typeVariable, mapper); + if (typeVariable !== mappedTypeVariable) { + return mapTypeWithAlias(getReducedType(mappedTypeVariable), function(t8) { + if (t8.flags & (3 | 58982400 | 524288 | 2097152) && t8 !== wildcardType && !isErrorType(t8)) { + if (!type3.declaration.nameType) { + var constraint = void 0; + if (isArrayType(t8) || t8.flags & 1 && findResolutionCycleStartIndex( + typeVariable, + 4 + /* TypeSystemPropertyName.ImmediateBaseConstraint */ + ) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) { + return instantiateMappedArrayType(t8, type3, prependTypeMapping(typeVariable, t8, mapper)); + } + if (isGenericTupleType(t8)) { + return instantiateMappedGenericTupleType(t8, type3, typeVariable, mapper); + } + if (isTupleType(t8)) { + return instantiateMappedTupleType(t8, type3, prependTypeMapping(typeVariable, t8, mapper)); + } + } + return instantiateAnonymousType(type3, prependTypeMapping(typeVariable, t8, mapper)); + } + return t8; + }, aliasSymbol, aliasTypeArguments); + } + } + return instantiateType(getConstraintTypeFromMappedType(type3), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type3, mapper, aliasSymbol, aliasTypeArguments); + } + function getModifiedReadonlyState(state, modifiers) { + return modifiers & 1 ? true : modifiers & 2 ? false : state; + } + function instantiateMappedGenericTupleType(tupleType2, mappedType, typeVariable, mapper) { + var elementFlags = tupleType2.target.elementFlags; + var elementTypes = ts2.map(getTypeArguments(tupleType2), function(t8, i7) { + var singleton = elementFlags[i7] & 8 ? t8 : elementFlags[i7] & 4 ? createArrayType(t8) : createTupleType([t8], [elementFlags[i7]]); + return instantiateMappedType(mappedType, prependTypeMapping(typeVariable, singleton, mapper)); + }); + var newReadonly = getModifiedReadonlyState(tupleType2.target.readonly, getMappedTypeModifiers(mappedType)); + return createTupleType(elementTypes, ts2.map(elementTypes, function(_6) { + return 8; + }), newReadonly); + } + function instantiateMappedArrayType(arrayType2, mappedType, mapper) { + var elementType = instantiateMappedTypeTemplate( + mappedType, + numberType2, + /*isOptional*/ + true, + mapper + ); + return isErrorType(elementType) ? errorType : createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType2), getMappedTypeModifiers(mappedType))); + } + function instantiateMappedTupleType(tupleType2, mappedType, mapper) { + var elementFlags = tupleType2.target.elementFlags; + var elementTypes = ts2.map(getTypeArguments(tupleType2), function(_6, i7) { + return instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i7), !!(elementFlags[i7] & 2), mapper); + }); + var modifiers = getMappedTypeModifiers(mappedType); + var newTupleModifiers = modifiers & 4 ? ts2.map(elementFlags, function(f8) { + return f8 & 1 ? 2 : f8; + }) : modifiers & 8 ? ts2.map(elementFlags, function(f8) { + return f8 & 2 ? 1 : f8; + }) : elementFlags; + var newReadonly = getModifiedReadonlyState(tupleType2.target.readonly, modifiers); + return ts2.contains(elementTypes, errorType) ? errorType : createTupleType(elementTypes, newTupleModifiers, newReadonly, tupleType2.target.labeledElementDeclarations); + } + function instantiateMappedTypeTemplate(type3, key, isOptional2, mapper) { + var templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type3), key); + var propType = instantiateType(getTemplateTypeFromMappedType(type3.target || type3), templateMapper); + var modifiers = getMappedTypeModifiers(type3); + return strictNullChecks && modifiers & 4 && !maybeTypeOfKind( + propType, + 32768 | 16384 + /* TypeFlags.Void */ + ) ? getOptionalType( + propType, + /*isProperty*/ + true + ) : strictNullChecks && modifiers & 8 && isOptional2 ? getTypeWithFacts( + propType, + 524288 + /* TypeFacts.NEUndefined */ + ) : propType; + } + function instantiateAnonymousType(type3, mapper, aliasSymbol, aliasTypeArguments) { + var result2 = createObjectType(type3.objectFlags | 64, type3.symbol); + if (type3.objectFlags & 32) { + result2.declaration = type3.declaration; + var origTypeParameter = getTypeParameterFromMappedType(type3); + var freshTypeParameter = cloneTypeParameter(origTypeParameter); + result2.typeParameter = freshTypeParameter; + mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper); + freshTypeParameter.mapper = mapper; + } + if (type3.objectFlags & 8388608) { + result2.node = type3.node; + } + result2.target = type3; + result2.mapper = mapper; + result2.aliasSymbol = aliasSymbol || type3.aliasSymbol; + result2.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + result2.objectFlags |= result2.aliasTypeArguments ? getPropagatingFlagsOfTypes(result2.aliasTypeArguments) : 0; + return result2; + } + function getConditionalTypeInstantiation(type3, mapper, aliasSymbol, aliasTypeArguments) { + var root2 = type3.root; + if (root2.outerTypeParameters) { + var typeArguments = ts2.map(root2.outerTypeParameters, function(t8) { + return getMappedType(t8, mapper); + }); + var id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments); + var result2 = root2.instantiations.get(id); + if (!result2) { + var newMapper_1 = createTypeMapper(root2.outerTypeParameters, typeArguments); + var checkType_1 = root2.checkType; + var distributionType = root2.isDistributive ? getMappedType(checkType_1, newMapper_1) : void 0; + result2 = distributionType && checkType_1 !== distributionType && distributionType.flags & (1048576 | 131072) ? mapTypeWithAlias(getReducedType(distributionType), function(t8) { + return getConditionalType(root2, prependTypeMapping(checkType_1, t8, newMapper_1)); + }, aliasSymbol, aliasTypeArguments) : getConditionalType(root2, newMapper_1, aliasSymbol, aliasTypeArguments); + root2.instantiations.set(id, result2); + } + return result2; + } + return type3; + } + function instantiateType(type3, mapper) { + return type3 && mapper ? instantiateTypeWithAlias( + type3, + mapper, + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0 + ) : type3; + } + function instantiateTypeWithAlias(type3, mapper, aliasSymbol, aliasTypeArguments) { + if (!couldContainTypeVariables(type3)) { + return type3; + } + if (instantiationDepth === 100 || instantiationCount >= 5e6) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "instantiateType_DepthLimit", { typeId: type3.id, instantiationDepth, instantiationCount }); + error2(currentNode, ts2.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + return errorType; + } + totalInstantiationCount++; + instantiationCount++; + instantiationDepth++; + var result2 = instantiateTypeWorker(type3, mapper, aliasSymbol, aliasTypeArguments); + instantiationDepth--; + return result2; + } + function instantiateTypeWorker(type3, mapper, aliasSymbol, aliasTypeArguments) { + var flags = type3.flags; + if (flags & 262144) { + return getMappedType(type3, mapper); + } + if (flags & 524288) { + var objectFlags = type3.objectFlags; + if (objectFlags & (4 | 16 | 32)) { + if (objectFlags & 4 && !type3.node) { + var resolvedTypeArguments = type3.resolvedTypeArguments; + var newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper); + return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type3.target, newTypeArguments) : type3; + } + if (objectFlags & 1024) { + return instantiateReverseMappedType(type3, mapper); + } + return getObjectTypeInstantiation(type3, mapper, aliasSymbol, aliasTypeArguments); + } + return type3; + } + if (flags & 3145728) { + var origin = type3.flags & 1048576 ? type3.origin : void 0; + var types3 = origin && origin.flags & 3145728 ? origin.types : type3.types; + var newTypes = instantiateTypes(types3, mapper); + if (newTypes === types3 && aliasSymbol === type3.aliasSymbol) { + return type3; + } + var newAliasSymbol = aliasSymbol || type3.aliasSymbol; + var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + return flags & 2097152 || origin && origin.flags & 2097152 ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1, newAliasSymbol, newAliasTypeArguments); + } + if (flags & 4194304) { + return getIndexType(instantiateType(type3.type, mapper)); + } + if (flags & 134217728) { + return getTemplateLiteralType(type3.texts, instantiateTypes(type3.types, mapper)); + } + if (flags & 268435456) { + return getStringMappingType(type3.symbol, instantiateType(type3.type, mapper)); + } + if (flags & 8388608) { + var newAliasSymbol = aliasSymbol || type3.aliasSymbol; + var newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + return getIndexedAccessType( + instantiateType(type3.objectType, mapper), + instantiateType(type3.indexType, mapper), + type3.accessFlags, + /*accessNode*/ + void 0, + newAliasSymbol, + newAliasTypeArguments + ); + } + if (flags & 16777216) { + return getConditionalTypeInstantiation(type3, combineTypeMappers(type3.mapper, mapper), aliasSymbol, aliasTypeArguments); + } + if (flags & 33554432) { + var newBaseType = instantiateType(type3.baseType, mapper); + var newConstraint = instantiateType(type3.constraint, mapper); + if (newBaseType.flags & 8650752 && isGenericType(newConstraint)) { + return getSubstitutionType(newBaseType, newConstraint); + } + if (newConstraint.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) { + return newBaseType; + } + return newBaseType.flags & 8650752 ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]); + } + return type3; + } + function instantiateReverseMappedType(type3, mapper) { + var innerMappedType = instantiateType(type3.mappedType, mapper); + if (!(ts2.getObjectFlags(innerMappedType) & 32)) { + return type3; + } + var innerIndexType = instantiateType(type3.constraintType, mapper); + if (!(innerIndexType.flags & 4194304)) { + return type3; + } + var instantiated = inferTypeForHomomorphicMappedType(instantiateType(type3.source, mapper), innerMappedType, innerIndexType); + if (instantiated) { + return instantiated; + } + return type3; + } + function getUniqueLiteralFilledInstantiation(type3) { + return type3.flags & (131068 | 3 | 131072) ? type3 : type3.uniqueLiteralFilledInstantiation || (type3.uniqueLiteralFilledInstantiation = instantiateType(type3, uniqueLiteralMapper)); + } + function getPermissiveInstantiation(type3) { + return type3.flags & (131068 | 3 | 131072) ? type3 : type3.permissiveInstantiation || (type3.permissiveInstantiation = instantiateType(type3, permissiveMapper)); + } + function getRestrictiveInstantiation(type3) { + if (type3.flags & (131068 | 3 | 131072)) { + return type3; + } + if (type3.restrictiveInstantiation) { + return type3.restrictiveInstantiation; + } + type3.restrictiveInstantiation = instantiateType(type3, restrictiveMapper); + type3.restrictiveInstantiation.restrictiveInstantiation = type3.restrictiveInstantiation; + return type3.restrictiveInstantiation; + } + function instantiateIndexInfo(info2, mapper) { + return createIndexInfo(info2.keyType, instantiateType(info2.type, mapper), info2.isReadonly, info2.declaration); + } + function isContextSensitive(node) { + ts2.Debug.assert(node.kind !== 171 || ts2.isObjectLiteralMethod(node)); + switch (node.kind) { + case 215: + case 216: + case 171: + case 259: + return isContextSensitiveFunctionLikeDeclaration(node); + case 207: + return ts2.some(node.properties, isContextSensitive); + case 206: + return ts2.some(node.elements, isContextSensitive); + case 224: + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); + case 223: + return (node.operatorToken.kind === 56 || node.operatorToken.kind === 60) && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 299: + return isContextSensitive(node.initializer); + case 214: + return isContextSensitive(node.expression); + case 289: + return ts2.some(node.properties, isContextSensitive) || ts2.isJsxOpeningElement(node.parent) && ts2.some(node.parent.parent.children, isContextSensitive); + case 288: { + var initializer = node.initializer; + return !!initializer && isContextSensitive(initializer); + } + case 291: { + var expression = node.expression; + return !!expression && isContextSensitive(expression); + } + } + return false; + } + function isContextSensitiveFunctionLikeDeclaration(node) { + return ts2.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node); + } + function hasContextSensitiveReturnExpression(node) { + return !node.typeParameters && !ts2.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 238 && isContextSensitive(node.body); + } + function isContextSensitiveFunctionOrObjectLiteralMethod(func) { + return (ts2.isFunctionExpressionOrArrowFunction(func) || ts2.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); + } + function getTypeWithoutSignatures(type3) { + if (type3.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type3); + if (resolved.constructSignatures.length || resolved.callSignatures.length) { + var result2 = createObjectType(16, type3.symbol); + result2.members = resolved.members; + result2.properties = resolved.properties; + result2.callSignatures = ts2.emptyArray; + result2.constructSignatures = ts2.emptyArray; + result2.indexInfos = ts2.emptyArray; + return result2; + } + } else if (type3.flags & 2097152) { + return getIntersectionType(ts2.map(type3.types, getTypeWithoutSignatures)); + } + return type3; + } + function isTypeIdenticalTo(source, target) { + return isTypeRelatedTo(source, target, identityRelation); + } + function compareTypesIdentical(source, target) { + return isTypeRelatedTo(source, target, identityRelation) ? -1 : 0; + } + function compareTypesAssignable(source, target) { + return isTypeRelatedTo(source, target, assignableRelation) ? -1 : 0; + } + function compareTypesSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, subtypeRelation) ? -1 : 0; + } + function isTypeSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, subtypeRelation); + } + function isTypeAssignableTo(source, target) { + return isTypeRelatedTo(source, target, assignableRelation); + } + function isTypeDerivedFrom(source, target) { + return source.flags & 1048576 ? ts2.every(source.types, function(t8) { + return isTypeDerivedFrom(t8, target); + }) : target.flags & 1048576 ? ts2.some(target.types, function(t8) { + return isTypeDerivedFrom(source, t8); + }) : source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType2, target) : target === globalObjectType ? !!(source.flags & (524288 | 67108864)) : target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType); + } + function isTypeComparableTo(source, target) { + return isTypeRelatedTo(source, target, comparableRelation); + } + function areTypesComparable(type1, type22) { + return isTypeComparableTo(type1, type22) || isTypeComparableTo(type22, type1); + } + function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain, errorOutputObject) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); + } + function checkTypeAssignableToAndOptionallyElaborate(source, target, errorNode, expr, headMessage, containingMessageChain) { + return checkTypeRelatedToAndOptionallyElaborate( + source, + target, + assignableRelation, + errorNode, + expr, + headMessage, + containingMessageChain, + /*errorOutputContainer*/ + void 0 + ); + } + function checkTypeRelatedToAndOptionallyElaborate(source, target, relation, errorNode, expr, headMessage, containingMessageChain, errorOutputContainer) { + if (isTypeRelatedTo(source, target, relation)) + return true; + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); + } + return false; + } + function isOrHasGenericConditional(type3) { + return !!(type3.flags & 16777216 || type3.flags & 2097152 && ts2.some(type3.types, isOrHasGenericConditional)); + } + function elaborateError(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { + if (!node || isOrHasGenericConditional(target)) + return false; + if (!checkTypeRelatedTo( + source, + target, + relation, + /*errorNode*/ + void 0 + ) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { + return true; + } + switch (node.kind) { + case 291: + case 214: + return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); + case 223: + switch (node.operatorToken.kind) { + case 63: + case 27: + return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); + } + break; + case 207: + return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 206: + return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 289: + return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 216: + return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); + } + return false; + } + function elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { + var callSignatures = getSignaturesOfType( + source, + 0 + /* SignatureKind.Call */ + ); + var constructSignatures = getSignaturesOfType( + source, + 1 + /* SignatureKind.Construct */ + ); + for (var _i = 0, _a2 = [constructSignatures, callSignatures]; _i < _a2.length; _i++) { + var signatures = _a2[_i]; + if (ts2.some(signatures, function(s7) { + var returnType = getReturnTypeOfSignature(s7); + return !(returnType.flags & (1 | 131072)) && checkTypeRelatedTo( + returnType, + target, + relation, + /*errorNode*/ + void 0 + ); + })) { + var resultObj = errorOutputContainer || {}; + checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj); + var diagnostic = resultObj.errors[resultObj.errors.length - 1]; + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(node, signatures === constructSignatures ? ts2.Diagnostics.Did_you_mean_to_use_new_with_this_expression : ts2.Diagnostics.Did_you_mean_to_call_this_expression)); + return true; + } + } + return false; + } + function elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (ts2.isBlock(node.body)) { + return false; + } + if (ts2.some(node.parameters, ts2.hasType)) { + return false; + } + var sourceSig = getSingleCallSignature(source); + if (!sourceSig) { + return false; + } + var targetSignatures = getSignaturesOfType( + target, + 0 + /* SignatureKind.Call */ + ); + if (!ts2.length(targetSignatures)) { + return false; + } + var returnExpression = node.body; + var sourceReturn = getReturnTypeOfSignature(sourceSig); + var targetReturn = getUnionType(ts2.map(targetSignatures, getReturnTypeOfSignature)); + if (!checkTypeRelatedTo( + sourceReturn, + targetReturn, + relation, + /*errorNode*/ + void 0 + )) { + var elaborated = returnExpression && elaborateError( + returnExpression, + sourceReturn, + targetReturn, + relation, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + if (elaborated) { + return elaborated; + } + var resultObj = errorOutputContainer || {}; + checkTypeRelatedTo( + sourceReturn, + targetReturn, + relation, + returnExpression, + /*message*/ + void 0, + containingMessageChain, + resultObj + ); + if (resultObj.errors) { + if (target.symbol && ts2.length(target.symbol.declarations)) { + ts2.addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], ts2.createDiagnosticForNode(target.symbol.declarations[0], ts2.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature)); + } + if ((ts2.getFunctionFlags(node) & 2) === 0 && !getTypeOfPropertyOfType(sourceReturn, "then") && checkTypeRelatedTo( + createPromiseType(sourceReturn), + targetReturn, + relation, + /*errorNode*/ + void 0 + )) { + ts2.addRelatedInfo(resultObj.errors[resultObj.errors.length - 1], ts2.createDiagnosticForNode(node, ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async)); + } + return true; + } + } + return false; + } + function getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType) { + var idx = getIndexedAccessTypeOrUndefined(target, nameType); + if (idx) { + return idx; + } + if (target.flags & 1048576) { + var best = getBestMatchingType(source, target); + if (best) { + return getIndexedAccessTypeOrUndefined(best, nameType); + } + } + } + function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { + next.contextualType = sourcePropType; + try { + return checkExpressionForMutableLocation(next, 1, sourcePropType); + } finally { + next.contextualType = void 0; + } + } + function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) { + var reportedError = false; + for (var status = iterator.next(); !status.done; status = iterator.next()) { + var _a2 = status.value, prop = _a2.errorNode, next = _a2.innerExpression, nameType = _a2.nameType, errorMessage = _a2.errorMessage; + var targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType); + if (!targetPropType || targetPropType.flags & 8388608) + continue; + var sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); + if (!sourcePropType) + continue; + var propName2 = getPropertyNameFromIndex( + nameType, + /*accessNode*/ + void 0 + ); + if (!checkTypeRelatedTo( + sourcePropType, + targetPropType, + relation, + /*errorNode*/ + void 0 + )) { + var elaborated = next && elaborateError( + next, + sourcePropType, + targetPropType, + relation, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + reportedError = true; + if (!elaborated) { + var resultObj = errorOutputContainer || {}; + var specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType; + if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) { + var diag = ts2.createDiagnosticForNode(prop, ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType)); + diagnostics.add(diag); + resultObj.errors = [diag]; + } else { + var targetIsOptional = !!(propName2 && (getPropertyOfType(target, propName2) || unknownSymbol).flags & 16777216); + var sourceIsOptional = !!(propName2 && (getPropertyOfType(source, propName2) || unknownSymbol).flags & 16777216); + targetPropType = removeMissingType(targetPropType, targetIsOptional); + sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional); + var result2 = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + if (result2 && specificSource !== sourcePropType) { + checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + } + } + if (resultObj.errors) { + var reportedDiag = resultObj.errors[resultObj.errors.length - 1]; + var propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; + var targetProp = propertyName !== void 0 ? getPropertyOfType(target, propertyName) : void 0; + var issuedElaboration = false; + if (!targetProp) { + var indexInfo = getApplicableIndexInfo(target, nameType); + if (indexInfo && indexInfo.declaration && !ts2.getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) { + issuedElaboration = true; + ts2.addRelatedInfo(reportedDiag, ts2.createDiagnosticForNode(indexInfo.declaration, ts2.Diagnostics.The_expected_type_comes_from_this_index_signature)); + } + } + if (!issuedElaboration && (targetProp && ts2.length(targetProp.declarations) || target.symbol && ts2.length(target.symbol.declarations))) { + var targetNode = targetProp && ts2.length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0]; + if (!ts2.getSourceFileOfNode(targetNode).hasNoDefaultLib) { + ts2.addRelatedInfo(reportedDiag, ts2.createDiagnosticForNode(targetNode, ts2.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & 8192) ? ts2.unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target))); + } + } + } + } + } + } + return reportedError; + } + function generateJsxAttributes(node) { + var _i, _a2, prop; + return __generator10(this, function(_b) { + switch (_b.label) { + case 0: + if (!ts2.length(node.properties)) + return [ + 2 + /*return*/ + ]; + _i = 0, _a2 = node.properties; + _b.label = 1; + case 1: + if (!(_i < _a2.length)) + return [3, 4]; + prop = _a2[_i]; + if (ts2.isJsxSpreadAttribute(prop) || isHyphenatedJsxName(ts2.idText(prop.name))) + return [3, 3]; + return [4, { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(ts2.idText(prop.name)) }]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: + return [ + 2 + /*return*/ + ]; + } + }); + } + function generateJsxChildren(node, getInvalidTextDiagnostic) { + var memberOffset, i7, child, nameType, elem; + return __generator10(this, function(_a2) { + switch (_a2.label) { + case 0: + if (!ts2.length(node.children)) + return [ + 2 + /*return*/ + ]; + memberOffset = 0; + i7 = 0; + _a2.label = 1; + case 1: + if (!(i7 < node.children.length)) + return [3, 5]; + child = node.children[i7]; + nameType = getNumberLiteralType(i7 - memberOffset); + elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic); + if (!elem) + return [3, 3]; + return [4, elem]; + case 2: + _a2.sent(); + return [3, 4]; + case 3: + memberOffset++; + _a2.label = 4; + case 4: + i7++; + return [3, 1]; + case 5: + return [ + 2 + /*return*/ + ]; + } + }); + } + function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { + switch (child.kind) { + case 291: + return { errorNode: child, innerExpression: child.expression, nameType }; + case 11: + if (child.containsOnlyTriviaWhiteSpaces) { + break; + } + return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() }; + case 281: + case 282: + case 285: + return { errorNode: child, innerExpression: child, nameType }; + default: + return ts2.Debug.assertNever(child, "Found invalid jsx child"); + } + } + function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { + var result2 = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); + var invalidTextDiagnostic; + if (ts2.isJsxOpeningElement(node.parent) && ts2.isJsxElement(node.parent.parent)) { + var containingElement = node.parent.parent; + var childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName = childPropName === void 0 ? "children" : ts2.unescapeLeadingUnderscores(childPropName); + var childrenNameType = getStringLiteralType(childrenPropName); + var childrenTargetType = getIndexedAccessType(target, childrenNameType); + var validChildren = ts2.getSemanticJsxChildren(containingElement.children); + if (!ts2.length(validChildren)) { + return result2; + } + var moreThanOneRealChildren = ts2.length(validChildren) > 1; + var arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType); + var nonArrayLikeTargetParts = filterType(childrenTargetType, function(t8) { + return !isArrayOrTupleLikeType(t8); + }); + if (moreThanOneRealChildren) { + if (arrayLikeTargetParts !== neverType2) { + var realSource = createTupleType(checkJsxChildren( + containingElement, + 0 + /* CheckMode.Normal */ + )); + var children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic); + result2 = elaborateElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result2; + } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + result2 = true; + var diag = error2(containingElement.openingElement.tagName, ts2.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, childrenPropName, typeToString(childrenTargetType)); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); + } + } + } else { + if (nonArrayLikeTargetParts !== neverType2) { + var child = validChildren[0]; + var elem_1 = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic); + if (elem_1) { + result2 = elaborateElementwise(function() { + return __generator10(this, function(_a2) { + switch (_a2.label) { + case 0: + return [4, elem_1]; + case 1: + _a2.sent(); + return [ + 2 + /*return*/ + ]; + } + }); + }(), source, target, relation, containingMessageChain, errorOutputContainer) || result2; + } + } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + result2 = true; + var diag = error2(containingElement.openingElement.tagName, ts2.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, childrenPropName, typeToString(childrenTargetType)); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); + } + } + } + } + return result2; + function getInvalidTextualChildDiagnostic() { + if (!invalidTextDiagnostic) { + var tagNameText = ts2.getTextOfNode(node.parent.tagName); + var childPropName2 = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + var childrenPropName2 = childPropName2 === void 0 ? "children" : ts2.unescapeLeadingUnderscores(childPropName2); + var childrenTargetType2 = getIndexedAccessType(target, getStringLiteralType(childrenPropName2)); + var diagnostic = ts2.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2; + invalidTextDiagnostic = __assign16(__assign16({}, diagnostic), { key: "!!ALREADY FORMATTED!!", message: ts2.formatMessage( + /*_dummy*/ + void 0, + diagnostic, + tagNameText, + childrenPropName2, + typeToString(childrenTargetType2) + ) }); + } + return invalidTextDiagnostic; + } + } + function generateLimitedTupleElements(node, target) { + var len, i7, elem, nameType; + return __generator10(this, function(_a2) { + switch (_a2.label) { + case 0: + len = ts2.length(node.elements); + if (!len) + return [ + 2 + /*return*/ + ]; + i7 = 0; + _a2.label = 1; + case 1: + if (!(i7 < len)) + return [3, 4]; + if (isTupleLikeType(target) && !getPropertyOfType(target, "" + i7)) + return [3, 3]; + elem = node.elements[i7]; + if (ts2.isOmittedExpression(elem)) + return [3, 3]; + nameType = getNumberLiteralType(i7); + return [4, { errorNode: elem, innerExpression: elem, nameType }]; + case 2: + _a2.sent(); + _a2.label = 3; + case 3: + i7++; + return [3, 1]; + case 4: + return [ + 2 + /*return*/ + ]; + } + }); + } + function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (target.flags & (131068 | 131072)) + return false; + if (isTupleLikeType(source)) { + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); + } + var oldContext = node.contextualType; + node.contextualType = target; + try { + var tupleizedType = checkArrayLiteral( + node, + 1, + /*forceTuple*/ + true + ); + node.contextualType = oldContext; + if (isTupleLikeType(tupleizedType)) { + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer); + } + return false; + } finally { + node.contextualType = oldContext; + } + } + function generateObjectLiteralElements(node) { + var _i, _a2, prop, type3, _b; + return __generator10(this, function(_c) { + switch (_c.label) { + case 0: + if (!ts2.length(node.properties)) + return [ + 2 + /*return*/ + ]; + _i = 0, _a2 = node.properties; + _c.label = 1; + case 1: + if (!(_i < _a2.length)) + return [3, 8]; + prop = _a2[_i]; + if (ts2.isSpreadAssignment(prop)) + return [3, 7]; + type3 = getLiteralTypeFromProperty( + getSymbolOfNode(prop), + 8576 + /* TypeFlags.StringOrNumberLiteralOrUnique */ + ); + if (!type3 || type3.flags & 131072) { + return [3, 7]; + } + _b = prop.kind; + switch (_b) { + case 175: + return [3, 2]; + case 174: + return [3, 2]; + case 171: + return [3, 2]; + case 300: + return [3, 2]; + case 299: + return [3, 4]; + } + return [3, 6]; + case 2: + return [4, { errorNode: prop.name, innerExpression: void 0, nameType: type3 }]; + case 3: + _c.sent(); + return [3, 7]; + case 4: + return [4, { errorNode: prop.name, innerExpression: prop.initializer, nameType: type3, errorMessage: ts2.isComputedNonLiteralName(prop.name) ? ts2.Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 }]; + case 5: + _c.sent(); + return [3, 7]; + case 6: + ts2.Debug.assertNever(prop); + _c.label = 7; + case 7: + _i++; + return [3, 1]; + case 8: + return [ + 2 + /*return*/ + ]; + } + }); + } + function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (target.flags & (131068 | 131072)) + return false; + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); + } + function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); + } + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated( + source, + target, + ignoreReturnTypes ? 4 : 0, + /*reportErrors*/ + false, + /*errorReporter*/ + void 0, + /*errorReporter*/ + void 0, + compareTypesAssignable, + /*reportUnreliableMarkers*/ + void 0 + ) !== 0; + } + function isAnySignature(s7) { + return !s7.typeParameters && (!s7.thisParameter || isTypeAny(getTypeOfParameter(s7.thisParameter))) && s7.parameters.length === 1 && signatureHasRestParameter(s7) && (getTypeOfParameter(s7.parameters[0]) === anyArrayType || isTypeAny(getTypeOfParameter(s7.parameters[0]))) && isTypeAny(getReturnTypeOfSignature(s7)); + } + function compareSignaturesRelated(source, target, checkMode, reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { + if (source === target) { + return -1; + } + if (isAnySignature(target)) { + return -1; + } + var targetCount = getParameterCount(target); + var sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); + if (sourceHasMoreParameters) { + return 0; + } + if (source.typeParameters && source.typeParameters !== target.typeParameters) { + target = getCanonicalSignature(target); + source = instantiateSignatureInContextOf( + source, + target, + /*inferenceContext*/ + void 0, + compareTypes + ); + } + var sourceCount = getParameterCount(source); + var sourceRestType = getNonArrayRestType(source); + var targetRestType = getNonArrayRestType(target); + if (sourceRestType || targetRestType) { + void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); + } + var kind = target.declaration ? target.declaration.kind : 0; + var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 171 && kind !== 170 && kind !== 173; + var result2 = -1; + var sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType && sourceThisType !== voidType2) { + var targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + var related = !strictVariance && compareTypes( + sourceThisType, + targetThisType, + /*reportErrors*/ + false + ) || compareTypes(targetThisType, sourceThisType, reportErrors); + if (!related) { + if (reportErrors) { + errorReporter(ts2.Diagnostics.The_this_types_of_each_signature_are_incompatible); + } + return 0; + } + result2 &= related; + } + } + var paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); + var restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; + for (var i7 = 0; i7 < paramCount; i7++) { + var sourceType = i7 === restIndex ? getRestTypeAtPosition(source, i7) : tryGetTypeAtPosition(source, i7); + var targetType = i7 === restIndex ? getRestTypeAtPosition(target, i7) : tryGetTypeAtPosition(target, i7); + if (sourceType && targetType) { + var sourceSig = checkMode & 3 ? void 0 : getSingleCallSignature(getNonNullableType(sourceType)); + var targetSig = checkMode & 3 ? void 0 : getSingleCallSignature(getNonNullableType(targetType)); + var callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && (getTypeFacts(sourceType) & 50331648) === (getTypeFacts(targetType) & 50331648); + var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 | (strictVariance ? 2 : 1), reportErrors, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3) && !strictVariance && compareTypes( + sourceType, + targetType, + /*reportErrors*/ + false + ) || compareTypes(targetType, sourceType, reportErrors); + if (related && checkMode & 8 && i7 >= getMinArgumentCount(source) && i7 < getMinArgumentCount(target) && compareTypes( + sourceType, + targetType, + /*reportErrors*/ + false + )) { + related = 0; + } + if (!related) { + if (reportErrors) { + errorReporter(ts2.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, ts2.unescapeLeadingUnderscores(getParameterNameAtPosition(source, i7)), ts2.unescapeLeadingUnderscores(getParameterNameAtPosition(target, i7))); + } + return 0; + } + result2 &= related; + } + } + if (!(checkMode & 4)) { + var targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType2 : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol)) : getReturnTypeOfSignature(target); + if (targetReturnType === voidType2 || targetReturnType === anyType2) { + return result2; + } + var sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType2 : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(source.declaration.symbol)) : getReturnTypeOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result2 &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, reportErrors, errorReporter, compareTypes); + } else if (ts2.isIdentifierTypePredicate(targetTypePredicate)) { + if (reportErrors) { + errorReporter(ts2.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); + } + return 0; + } + } else { + result2 &= checkMode & 1 && compareTypes( + targetReturnType, + sourceReturnType, + /*reportErrors*/ + false + ) || compareTypes(sourceReturnType, targetReturnType, reportErrors); + if (!result2 && reportErrors && incompatibleErrorReporter) { + incompatibleErrorReporter(sourceReturnType, targetReturnType); + } + } + } + return result2; + } + function compareTypePredicateRelatedTo(source, target, reportErrors, errorReporter, compareTypes) { + if (source.kind !== target.kind) { + if (reportErrors) { + errorReporter(ts2.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + errorReporter(ts2.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return 0; + } + if (source.kind === 1 || source.kind === 3) { + if (source.parameterIndex !== target.parameterIndex) { + if (reportErrors) { + errorReporter(ts2.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, target.parameterName); + errorReporter(ts2.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return 0; + } + } + var related = source.type === target.type ? -1 : source.type && target.type ? compareTypes(source.type, target.type, reportErrors) : 0; + if (related === 0 && reportErrors) { + errorReporter(ts2.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return related; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + var erasedSource = getErasedSignature(implementation); + var erasedTarget = getErasedSignature(overload); + var sourceReturnType = getReturnTypeOfSignature(erasedSource); + var targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType2 || isTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation) || isTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation)) { + return isSignatureAssignableTo( + erasedSource, + erasedTarget, + /*ignoreReturnTypes*/ + true + ); + } + return false; + } + function isEmptyResolvedType(t8) { + return t8 !== anyFunctionType && t8.properties.length === 0 && t8.callSignatures.length === 0 && t8.constructSignatures.length === 0 && t8.indexInfos.length === 0; + } + function isEmptyObjectType(type3) { + return type3.flags & 524288 ? !isGenericMappedType(type3) && isEmptyResolvedType(resolveStructuredTypeMembers(type3)) : type3.flags & 67108864 ? true : type3.flags & 1048576 ? ts2.some(type3.types, isEmptyObjectType) : type3.flags & 2097152 ? ts2.every(type3.types, isEmptyObjectType) : false; + } + function isEmptyAnonymousObjectType(type3) { + return !!(ts2.getObjectFlags(type3) & 16 && (type3.members && isEmptyResolvedType(type3) || type3.symbol && type3.symbol.flags & 2048 && getMembersOfSymbol(type3.symbol).size === 0)); + } + function isUnknownLikeUnionType(type3) { + if (strictNullChecks && type3.flags & 1048576) { + if (!(type3.objectFlags & 33554432)) { + var types3 = type3.types; + type3.objectFlags |= 33554432 | (types3.length >= 3 && types3[0].flags & 32768 && types3[1].flags & 65536 && ts2.some(types3, isEmptyAnonymousObjectType) ? 67108864 : 0); + } + return !!(type3.objectFlags & 67108864); + } + return false; + } + function containsUndefinedType(type3) { + return !!((type3.flags & 1048576 ? type3.types[0] : type3).flags & 32768); + } + function isStringIndexSignatureOnlyType(type3) { + return type3.flags & 524288 && !isGenericMappedType(type3) && getPropertiesOfType(type3).length === 0 && getIndexInfosOfType(type3).length === 1 && !!getIndexInfoOfType(type3, stringType2) || type3.flags & 3145728 && ts2.every(type3.types, isStringIndexSignatureOnlyType) || false; + } + function isEnumTypeRelatedTo(sourceSymbol, targetSymbol, errorReporter) { + if (sourceSymbol === targetSymbol) { + return true; + } + var id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol); + var entry = enumRelation.get(id); + if (entry !== void 0 && !(!(entry & 4) && entry & 2 && errorReporter)) { + return !!(entry & 1); + } + if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & 256) || !(targetSymbol.flags & 256)) { + enumRelation.set( + id, + 2 | 4 + /* RelationComparisonResult.Reported */ + ); + return false; + } + var targetEnumType = getTypeOfSymbol(targetSymbol); + for (var _i = 0, _a2 = getPropertiesOfType(getTypeOfSymbol(sourceSymbol)); _i < _a2.length; _i++) { + var property2 = _a2[_i]; + if (property2.flags & 8) { + var targetProperty = getPropertyOfType(targetEnumType, property2.escapedName); + if (!targetProperty || !(targetProperty.flags & 8)) { + if (errorReporter) { + errorReporter(ts2.Diagnostics.Property_0_is_missing_in_type_1, ts2.symbolName(property2), typeToString( + getDeclaredTypeOfSymbol(targetSymbol), + /*enclosingDeclaration*/ + void 0, + 64 + /* TypeFormatFlags.UseFullyQualifiedType */ + )); + enumRelation.set( + id, + 2 | 4 + /* RelationComparisonResult.Reported */ + ); + } else { + enumRelation.set( + id, + 2 + /* RelationComparisonResult.Failed */ + ); + } + return false; + } + } + } + enumRelation.set( + id, + 1 + /* RelationComparisonResult.Succeeded */ + ); + return true; + } + function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { + var s7 = source.flags; + var t8 = target.flags; + if (t8 & 3 || s7 & 131072 || source === wildcardType) + return true; + if (t8 & 131072) + return false; + if (s7 & 402653316 && t8 & 4) + return true; + if (s7 & 128 && s7 & 1024 && t8 & 128 && !(t8 & 1024) && source.value === target.value) + return true; + if (s7 & 296 && t8 & 8) + return true; + if (s7 & 256 && s7 & 1024 && t8 & 256 && !(t8 & 1024) && source.value === target.value) + return true; + if (s7 & 2112 && t8 & 64) + return true; + if (s7 & 528 && t8 & 16) + return true; + if (s7 & 12288 && t8 & 4096) + return true; + if (s7 & 32 && t8 & 32 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) + return true; + if (s7 & 1024 && t8 & 1024) { + if (s7 & 1048576 && t8 & 1048576 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) + return true; + if (s7 & 2944 && t8 & 2944 && source.value === target.value && isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter)) + return true; + } + if (s7 & 32768 && (!strictNullChecks && !(t8 & 3145728) || t8 & (32768 | 16384))) + return true; + if (s7 & 65536 && (!strictNullChecks && !(t8 & 3145728) || t8 & 65536)) + return true; + if (s7 & 524288 && t8 & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(ts2.getObjectFlags(source) & 8192))) + return true; + if (relation === assignableRelation || relation === comparableRelation) { + if (s7 & 1) + return true; + if (s7 & (8 | 256) && !(s7 & 1024) && (t8 & 32 || relation === assignableRelation && t8 & 256 && t8 & 1024)) + return true; + if (isUnknownLikeUnionType(target)) + return true; + } + return false; + } + function isTypeRelatedTo(source, target, relation) { + if (isFreshLiteralType(source)) { + source = source.regularType; + } + if (isFreshLiteralType(target)) { + target = target.regularType; + } + if (source === target) { + return true; + } + if (relation !== identityRelation) { + if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation)) { + return true; + } + } else if (!((source.flags | target.flags) & (3145728 | 8388608 | 16777216 | 33554432))) { + if (source.flags !== target.flags) + return false; + if (source.flags & 67358815) + return true; + } + if (source.flags & 524288 && target.flags & 524288) { + var related = relation.get(getRelationKey( + source, + target, + 0, + relation, + /*ignoreConstraints*/ + false + )); + if (related !== void 0) { + return !!(related & 1); + } + } + if (source.flags & 469499904 || target.flags & 469499904) { + return checkTypeRelatedTo( + source, + target, + relation, + /*errorNode*/ + void 0 + ); + } + return false; + } + function isIgnoredJsxProperty(source, sourceProp) { + return ts2.getObjectFlags(source) & 2048 && isHyphenatedJsxName(sourceProp.escapedName); + } + function getNormalizedType(type3, writing) { + while (true) { + var t8 = isFreshLiteralType(type3) ? type3.regularType : ts2.getObjectFlags(type3) & 4 ? type3.node ? createTypeReference(type3.target, getTypeArguments(type3)) : getSingleBaseForNonAugmentingSubtype(type3) || type3 : type3.flags & 3145728 ? getNormalizedUnionOrIntersectionType(type3, writing) : type3.flags & 33554432 ? writing ? type3.baseType : getSubstitutionIntersection(type3) : type3.flags & 25165824 ? getSimplifiedType(type3, writing) : type3; + if (t8 === type3) + return t8; + type3 = t8; + } + } + function getNormalizedUnionOrIntersectionType(type3, writing) { + var reduced = getReducedType(type3); + if (reduced !== type3) { + return reduced; + } + if (type3.flags & 2097152 && ts2.some(type3.types, isEmptyAnonymousObjectType)) { + var normalizedTypes = ts2.sameMap(type3.types, function(t8) { + return getNormalizedType(t8, writing); + }); + if (normalizedTypes !== type3.types) { + return getIntersectionType(normalizedTypes); + } + } + return type3; + } + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) { + var errorInfo; + var relatedInfo; + var maybeKeys; + var sourceStack; + var targetStack; + var maybeCount = 0; + var sourceDepth = 0; + var targetDepth = 0; + var expandingFlags = 0; + var overflow = false; + var overrideNextErrorInfo = 0; + var lastSkippedInfo; + var incompatibleStack; + var inPropertyCheck = false; + ts2.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); + var result2 = isRelatedTo( + source, + target, + 3, + /*reportErrors*/ + !!errorNode, + headMessage + ); + if (incompatibleStack) { + reportIncompatibleStack(); + } + if (overflow) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth }); + var diag = error2(errorNode || currentNode, ts2.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); + if (errorOutputContainer) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); + } + } else if (errorInfo) { + if (containingMessageChain) { + var chain3 = containingMessageChain(); + if (chain3) { + ts2.concatenateDiagnosticMessageChains(chain3, errorInfo); + errorInfo = chain3; + } + } + var relatedInformation = void 0; + if (headMessage && errorNode && !result2 && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts2.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo( + getTypeOfSymbol(links.target), + target, + relation, + /*errorNode*/ + void 0 + ); + if (helpfulRetry) { + var diag_1 = ts2.createDiagnosticForNode(links.originatingImport, ts2.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead); + relatedInformation = ts2.append(relatedInformation, diag_1); + } + } + } + var diag = ts2.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, relatedInformation); + if (relatedInfo) { + ts2.addRelatedInfo.apply(void 0, __spreadArray9([diag], relatedInfo, false)); + } + if (errorOutputContainer) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); + } + if (!errorOutputContainer || !errorOutputContainer.skipLogging) { + diagnostics.add(diag); + } + } + if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result2 === 0) { + ts2.Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error."); + } + return result2 !== 0; + function resetErrorInfo(saved) { + errorInfo = saved.errorInfo; + lastSkippedInfo = saved.lastSkippedInfo; + incompatibleStack = saved.incompatibleStack; + overrideNextErrorInfo = saved.overrideNextErrorInfo; + relatedInfo = saved.relatedInfo; + } + function captureErrorCalculationState() { + return { + errorInfo, + lastSkippedInfo, + incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(), + overrideNextErrorInfo, + relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice() + }; + } + function reportIncompatibleError(message, arg0, arg1, arg2, arg3) { + overrideNextErrorInfo++; + lastSkippedInfo = void 0; + (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]); + } + function reportIncompatibleStack() { + var stack = incompatibleStack || []; + incompatibleStack = void 0; + var info2 = lastSkippedInfo; + lastSkippedInfo = void 0; + if (stack.length === 1) { + reportError.apply(void 0, stack[0]); + if (info2) { + reportRelationError.apply(void 0, __spreadArray9([ + /*headMessage*/ + void 0 + ], info2, false)); + } + return; + } + var path2 = ""; + var secondaryRootErrors = []; + while (stack.length) { + var _a2 = stack.pop(), msg = _a2[0], args = _a2.slice(1); + switch (msg.code) { + case ts2.Diagnostics.Types_of_property_0_are_incompatible.code: { + if (path2.indexOf("new ") === 0) { + path2 = "(".concat(path2, ")"); + } + var str2 = "" + args[0]; + if (path2.length === 0) { + path2 = "".concat(str2); + } else if (ts2.isIdentifierText(str2, ts2.getEmitScriptTarget(compilerOptions))) { + path2 = "".concat(path2, ".").concat(str2); + } else if (str2[0] === "[" && str2[str2.length - 1] === "]") { + path2 = "".concat(path2).concat(str2); + } else { + path2 = "".concat(path2, "[").concat(str2, "]"); + } + break; + } + case ts2.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code: + case ts2.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code: + case ts2.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: + case ts2.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: { + if (path2.length === 0) { + var mappedMsg = msg; + if (msg.code === ts2.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { + mappedMsg = ts2.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible; + } else if (msg.code === ts2.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { + mappedMsg = ts2.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible; + } + secondaryRootErrors.unshift([mappedMsg, args[0], args[1]]); + } else { + var prefix = msg.code === ts2.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code || msg.code === ts2.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "new " : ""; + var params = msg.code === ts2.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code || msg.code === ts2.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "" : "..."; + path2 = "".concat(prefix).concat(path2, "(").concat(params, ")"); + } + break; + } + case ts2.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code: { + secondaryRootErrors.unshift([ts2.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, args[0], args[1]]); + break; + } + case ts2.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code: { + secondaryRootErrors.unshift([ts2.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, args[0], args[1], args[2]]); + break; + } + default: + return ts2.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); + } + } + if (path2) { + reportError(path2[path2.length - 1] === ")" ? ts2.Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types : ts2.Diagnostics.The_types_of_0_are_incompatible_between_these_types, path2); + } else { + secondaryRootErrors.shift(); + } + for (var _i = 0, secondaryRootErrors_1 = secondaryRootErrors; _i < secondaryRootErrors_1.length; _i++) { + var _b = secondaryRootErrors_1[_i], msg = _b[0], args = _b.slice(1); + var originalValue = msg.elidedInCompatabilityPyramid; + msg.elidedInCompatabilityPyramid = false; + reportError.apply(void 0, __spreadArray9([msg], args, false)); + msg.elidedInCompatabilityPyramid = originalValue; + } + if (info2) { + reportRelationError.apply(void 0, __spreadArray9([ + /*headMessage*/ + void 0 + ], info2, false)); + } + } + function reportError(message, arg0, arg1, arg2, arg3) { + ts2.Debug.assert(!!errorNode); + if (incompatibleStack) + reportIncompatibleStack(); + if (message.elidedInCompatabilityPyramid) + return; + errorInfo = ts2.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2, arg3); + } + function associateRelatedInfo(info2) { + ts2.Debug.assert(!!errorInfo); + if (!relatedInfo) { + relatedInfo = [info2]; + } else { + relatedInfo.push(info2); + } + } + function reportRelationError(message, source2, target2) { + if (incompatibleStack) + reportIncompatibleStack(); + var _a2 = getTypeNamesForErrorDisplay(source2, target2), sourceType = _a2[0], targetType = _a2[1]; + var generalizedSource = source2; + var generalizedSourceType = sourceType; + if (isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) { + generalizedSource = getBaseTypeOfLiteralType(source2); + ts2.Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); + generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); + } + if (target2.flags & 262144 && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + var constraint = getBaseConstraintOfType(target2); + var needsOriginalSource = void 0; + if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { + reportError(ts2.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, needsOriginalSource ? sourceType : generalizedSourceType, targetType, typeToString(constraint)); + } else { + errorInfo = void 0; + reportError(ts2.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, targetType, generalizedSourceType); + } + } + if (!message) { + if (relation === comparableRelation) { + message = ts2.Diagnostics.Type_0_is_not_comparable_to_type_1; + } else if (sourceType === targetType) { + message = ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated; + } else if (exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { + message = ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; + } else { + if (source2.flags & 128 && target2.flags & 1048576) { + var suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source2, target2); + if (suggestedType) { + reportError(ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType)); + return; + } + } + message = ts2.Diagnostics.Type_0_is_not_assignable_to_type_1; + } + } else if (message === ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1 && exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { + message = ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; + } + reportError(message, generalizedSourceType, targetType); + } + function tryElaborateErrorsForPrimitivesAndObjects(source2, target2) { + var sourceType = symbolValueDeclarationIsContextSensitive(source2.symbol) ? typeToString(source2, source2.symbol.valueDeclaration) : typeToString(source2); + var targetType = symbolValueDeclarationIsContextSensitive(target2.symbol) ? typeToString(target2, target2.symbol.valueDeclaration) : typeToString(target2); + if (globalStringType === source2 && stringType2 === target2 || globalNumberType === source2 && numberType2 === target2 || globalBooleanType === source2 && booleanType2 === target2 || getGlobalESSymbolType() === source2 && esSymbolType === target2) { + reportError(ts2.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); + } + } + function tryElaborateArrayLikeErrors(source2, target2, reportErrors) { + if (isTupleType(source2)) { + if (source2.target.readonly && isMutableArrayOrTuple(target2)) { + if (reportErrors) { + reportError(ts2.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); + } + return false; + } + return isArrayOrTupleType(target2); + } + if (isReadonlyArrayType(source2) && isMutableArrayOrTuple(target2)) { + if (reportErrors) { + reportError(ts2.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); + } + return false; + } + if (isTupleType(target2)) { + return isArrayType(source2); + } + return true; + } + function isRelatedToWorker(source2, target2, reportErrors) { + return isRelatedTo(source2, target2, 3, reportErrors); + } + function isRelatedTo(originalSource, originalTarget, recursionFlags, reportErrors, headMessage2, intersectionState) { + if (recursionFlags === void 0) { + recursionFlags = 3; + } + if (reportErrors === void 0) { + reportErrors = false; + } + if (intersectionState === void 0) { + intersectionState = 0; + } + if (originalSource.flags & 524288 && originalTarget.flags & 131068) { + if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : void 0)) { + return -1; + } + if (reportErrors) { + reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage2); + } + return 0; + } + var source2 = getNormalizedType( + originalSource, + /*writing*/ + false + ); + var target2 = getNormalizedType( + originalTarget, + /*writing*/ + true + ); + if (source2 === target2) + return -1; + if (relation === identityRelation) { + if (source2.flags !== target2.flags) + return 0; + if (source2.flags & 67358815) + return -1; + traceUnionsOrIntersectionsTooLarge(source2, target2); + return recursiveTypeRelatedTo( + source2, + target2, + /*reportErrors*/ + false, + 0, + recursionFlags + ); + } + if (source2.flags & 262144 && getConstraintOfType(source2) === target2) { + return -1; + } + if (source2.flags & 470302716 && target2.flags & 1048576) { + var types3 = target2.types; + var candidate = types3.length === 2 && types3[0].flags & 98304 ? types3[1] : types3.length === 3 && types3[0].flags & 98304 && types3[1].flags & 98304 ? types3[2] : void 0; + if (candidate && !(candidate.flags & 98304)) { + target2 = getNormalizedType( + candidate, + /*writing*/ + true + ); + if (source2 === target2) + return -1; + } + } + if (relation === comparableRelation && !(target2.flags & 131072) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors ? reportError : void 0)) + return -1; + if (source2.flags & 469499904 || target2.flags & 469499904) { + var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source2) && ts2.getObjectFlags(source2) & 8192); + if (isPerformingExcessPropertyChecks) { + if (hasExcessProperties(source2, target2, reportErrors)) { + if (reportErrors) { + reportRelationError(headMessage2, source2, originalTarget.aliasSymbol ? originalTarget : target2); + } + return 0; + } + } + var isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2) && source2.flags & (131068 | 524288 | 2097152) && source2 !== globalObjectType && target2.flags & (524288 | 2097152) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); + var isComparingJsxAttributes = !!(ts2.getObjectFlags(source2) & 2048); + if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { + if (reportErrors) { + var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2); + var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target2); + var calls = getSignaturesOfType( + source2, + 0 + /* SignatureKind.Call */ + ); + var constructs = getSignaturesOfType( + source2, + 1 + /* SignatureKind.Construct */ + ); + if (calls.length > 0 && isRelatedTo( + getReturnTypeOfSignature(calls[0]), + target2, + 1, + /*reportErrors*/ + false + ) || constructs.length > 0 && isRelatedTo( + getReturnTypeOfSignature(constructs[0]), + target2, + 1, + /*reportErrors*/ + false + )) { + reportError(ts2.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString); + } else { + reportError(ts2.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString); + } + } + return 0; + } + traceUnionsOrIntersectionsTooLarge(source2, target2); + var skipCaching = source2.flags & 1048576 && source2.types.length < 4 && !(target2.flags & 1048576) || target2.flags & 1048576 && target2.types.length < 4 && !(source2.flags & 469499904); + var result_7 = skipCaching ? unionOrIntersectionRelatedTo(source2, target2, reportErrors, intersectionState) : recursiveTypeRelatedTo(source2, target2, reportErrors, intersectionState, recursionFlags); + if (result_7) { + return result_7; + } + } + if (reportErrors) { + reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2); + } + return 0; + } + function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) { + var _a2, _b; + var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource); + var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget); + source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2; + target2 = originalTarget.aliasSymbol || targetHasBase ? originalTarget : target2; + var maybeSuppress = overrideNextErrorInfo > 0; + if (maybeSuppress) { + overrideNextErrorInfo--; + } + if (source2.flags & 524288 && target2.flags & 524288) { + var currentError = errorInfo; + tryElaborateArrayLikeErrors( + source2, + target2, + /*reportErrors*/ + true + ); + if (errorInfo !== currentError) { + maybeSuppress = !!errorInfo; + } + } + if (source2.flags & 524288 && target2.flags & 131068) { + tryElaborateErrorsForPrimitivesAndObjects(source2, target2); + } else if (source2.symbol && source2.flags & 524288 && globalObjectType === source2) { + reportError(ts2.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); + } else if (ts2.getObjectFlags(source2) & 2048 && target2.flags & 2097152) { + var targetTypes = target2.types; + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode); + var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode); + if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) && (ts2.contains(targetTypes, intrinsicAttributes) || ts2.contains(targetTypes, intrinsicClassAttributes))) { + return; + } + } else { + errorInfo = elaborateNeverIntersection(errorInfo, originalTarget); + } + if (!headMessage2 && maybeSuppress) { + lastSkippedInfo = [source2, target2]; + return; + } + reportRelationError(headMessage2, source2, target2); + if (source2.flags & 262144 && ((_b = (_a2 = source2.symbol) === null || _a2 === void 0 ? void 0 : _a2.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source2)) { + var syntheticParam = cloneTypeParameter(source2); + syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam)); + if (hasNonCircularBaseConstraint(syntheticParam)) { + var targetConstraintString = typeToString(target2, source2.symbol.declarations[0]); + associateRelatedInfo(ts2.createDiagnosticForNode(source2.symbol.declarations[0], ts2.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint, targetConstraintString)); + } + } + } + function traceUnionsOrIntersectionsTooLarge(source2, target2) { + if (!ts2.tracing) { + return; + } + if (source2.flags & 3145728 && target2.flags & 3145728) { + var sourceUnionOrIntersection = source2; + var targetUnionOrIntersection = target2; + if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768) { + return; + } + var sourceSize = sourceUnionOrIntersection.types.length; + var targetSize = targetUnionOrIntersection.types.length; + if (sourceSize * targetSize > 1e6) { + ts2.tracing.instant("checkTypes", "traceUnionsOrIntersectionsTooLarge_DepthLimit", { + sourceId: source2.id, + sourceSize, + targetId: target2.id, + targetSize, + pos: errorNode === null || errorNode === void 0 ? void 0 : errorNode.pos, + end: errorNode === null || errorNode === void 0 ? void 0 : errorNode.end + }); + } + } + } + function getTypeOfPropertyInTypes(types3, name2) { + var appendPropType = function(propTypes, type3) { + var _a2; + type3 = getApparentType(type3); + var prop = type3.flags & 3145728 ? getPropertyOfUnionOrIntersectionType(type3, name2) : getPropertyOfObjectType(type3, name2); + var propType = prop && getTypeOfSymbol(prop) || ((_a2 = getApplicableIndexInfoForName(type3, name2)) === null || _a2 === void 0 ? void 0 : _a2.type) || undefinedType2; + return ts2.append(propTypes, propType); + }; + return getUnionType(ts2.reduceLeft( + types3, + appendPropType, + /*initial*/ + void 0 + ) || ts2.emptyArray); + } + function hasExcessProperties(source2, target2, reportErrors) { + var _a2; + if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && ts2.getObjectFlags(target2) & 4096) { + return false; + } + var isComparingJsxAttributes = !!(ts2.getObjectFlags(source2) & 2048); + if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) { + return false; + } + var reducedTarget = target2; + var checkTypes; + if (target2.flags & 1048576) { + reducedTarget = findMatchingDiscriminantType(source2, target2, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target2); + checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget]; + } + var _loop_20 = function(prop2) { + if (shouldCheckAsExcessProperty(prop2, source2.symbol) && !isIgnoredJsxProperty(source2, prop2)) { + if (!isKnownProperty(reducedTarget, prop2.escapedName, isComparingJsxAttributes)) { + if (reportErrors) { + var errorTarget = filterType(reducedTarget, isExcessPropertyCheckTarget); + if (!errorNode) + return { value: ts2.Debug.fail() }; + if (ts2.isJsxAttributes(errorNode) || ts2.isJsxOpeningLikeElement(errorNode) || ts2.isJsxOpeningLikeElement(errorNode.parent)) { + if (prop2.valueDeclaration && ts2.isJsxAttribute(prop2.valueDeclaration) && ts2.getSourceFileOfNode(errorNode) === ts2.getSourceFileOfNode(prop2.valueDeclaration.name)) { + errorNode = prop2.valueDeclaration.name; + } + var propName2 = symbolToString2(prop2); + var suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName2, errorTarget); + var suggestion = suggestionSymbol ? symbolToString2(suggestionSymbol) : void 0; + if (suggestion) { + reportError(ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName2, typeToString(errorTarget), suggestion); + } else { + reportError(ts2.Diagnostics.Property_0_does_not_exist_on_type_1, propName2, typeToString(errorTarget)); + } + } else { + var objectLiteralDeclaration_1 = ((_a2 = source2.symbol) === null || _a2 === void 0 ? void 0 : _a2.declarations) && ts2.firstOrUndefined(source2.symbol.declarations); + var suggestion = void 0; + if (prop2.valueDeclaration && ts2.findAncestor(prop2.valueDeclaration, function(d7) { + return d7 === objectLiteralDeclaration_1; + }) && ts2.getSourceFileOfNode(objectLiteralDeclaration_1) === ts2.getSourceFileOfNode(errorNode)) { + var propDeclaration = prop2.valueDeclaration; + ts2.Debug.assertNode(propDeclaration, ts2.isObjectLiteralElementLike); + errorNode = propDeclaration; + var name2 = propDeclaration.name; + if (ts2.isIdentifier(name2)) { + suggestion = getSuggestionForNonexistentProperty(name2, errorTarget); + } + } + if (suggestion !== void 0) { + reportError(ts2.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString2(prop2), typeToString(errorTarget), suggestion); + } else { + reportError(ts2.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString2(prop2), typeToString(errorTarget)); + } + } + } + return { value: true }; + } + if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop2), getTypeOfPropertyInTypes(checkTypes, prop2.escapedName), 3, reportErrors)) { + if (reportErrors) { + reportIncompatibleError(ts2.Diagnostics.Types_of_property_0_are_incompatible, symbolToString2(prop2)); + } + return { value: true }; + } + } + }; + for (var _i = 0, _b = getPropertiesOfType(source2); _i < _b.length; _i++) { + var prop = _b[_i]; + var state_6 = _loop_20(prop); + if (typeof state_6 === "object") + return state_6.value; + } + return false; + } + function shouldCheckAsExcessProperty(prop, container) { + return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration; + } + function unionOrIntersectionRelatedTo(source2, target2, reportErrors, intersectionState) { + if (source2.flags & 1048576) { + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors && !(source2.flags & 131068), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors && !(source2.flags & 131068), intersectionState); + } + if (target2.flags & 1048576) { + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors && !(source2.flags & 131068) && !(target2.flags & 131068)); + } + if (target2.flags & 2097152) { + return typeRelatedToEachType( + source2, + target2, + reportErrors, + 2 + /* IntersectionState.Target */ + ); + } + if (relation === comparableRelation && target2.flags & 131068) { + var constraints = ts2.sameMap(source2.types, function(t8) { + return t8.flags & 465829888 ? getBaseConstraintOfType(t8) || unknownType2 : t8; + }); + if (constraints !== source2.types) { + source2 = getIntersectionType(constraints); + if (source2.flags & 131072) { + return 0; + } + if (!(source2.flags & 2097152)) { + return isRelatedTo( + source2, + target2, + 1, + /*reportErrors*/ + false + ) || isRelatedTo( + target2, + source2, + 1, + /*reportErrors*/ + false + ); + } + } + } + return someTypeRelatedToType( + source2, + target2, + /*reportErrors*/ + false, + 1 + /* IntersectionState.Source */ + ); + } + function eachTypeRelatedToSomeType(source2, target2) { + var result3 = -1; + var sourceTypes = source2.types; + for (var _i = 0, sourceTypes_1 = sourceTypes; _i < sourceTypes_1.length; _i++) { + var sourceType = sourceTypes_1[_i]; + var related = typeRelatedToSomeType( + sourceType, + target2, + /*reportErrors*/ + false + ); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function typeRelatedToSomeType(source2, target2, reportErrors) { + var targetTypes = target2.types; + if (target2.flags & 1048576) { + if (containsType(targetTypes, source2)) { + return -1; + } + var match = getMatchingUnionConstituentForType(target2, source2); + if (match) { + var related = isRelatedTo( + source2, + match, + 2, + /*reportErrors*/ + false + ); + if (related) { + return related; + } + } + } + for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { + var type3 = targetTypes_1[_i]; + var related = isRelatedTo( + source2, + type3, + 2, + /*reportErrors*/ + false + ); + if (related) { + return related; + } + } + if (reportErrors) { + var bestMatchingType = getBestMatchingType(source2, target2, isRelatedTo); + if (bestMatchingType) { + isRelatedTo( + source2, + bestMatchingType, + 2, + /*reportErrors*/ + true + ); + } + } + return 0; + } + function typeRelatedToEachType(source2, target2, reportErrors, intersectionState) { + var result3 = -1; + var targetTypes = target2.types; + for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) { + var targetType = targetTypes_2[_i]; + var related = isRelatedTo( + source2, + targetType, + 2, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function someTypeRelatedToType(source2, target2, reportErrors, intersectionState) { + var sourceTypes = source2.types; + if (source2.flags & 1048576 && containsType(sourceTypes, target2)) { + return -1; + } + var len = sourceTypes.length; + for (var i7 = 0; i7 < len; i7++) { + var related = isRelatedTo( + sourceTypes[i7], + target2, + 1, + reportErrors && i7 === len - 1, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + return related; + } + } + return 0; + } + function getUndefinedStrippedTargetIfNeeded(source2, target2) { + if (source2.flags & 1048576 && target2.flags & 1048576 && !(source2.types[0].flags & 32768) && target2.types[0].flags & 32768) { + return extractTypesOfKind( + target2, + ~32768 + /* TypeFlags.Undefined */ + ); + } + return target2; + } + function eachTypeRelatedToType(source2, target2, reportErrors, intersectionState) { + var result3 = -1; + var sourceTypes = source2.types; + var undefinedStrippedTarget = getUndefinedStrippedTargetIfNeeded(source2, target2); + for (var i7 = 0; i7 < sourceTypes.length; i7++) { + var sourceType = sourceTypes[i7]; + if (undefinedStrippedTarget.flags & 1048576 && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) { + var related_1 = isRelatedTo( + sourceType, + undefinedStrippedTarget.types[i7 % undefinedStrippedTarget.types.length], + 3, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (related_1) { + result3 &= related_1; + continue; + } + } + var related = isRelatedTo( + sourceType, + target2, + 1, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function typeArgumentsRelatedTo(sources, targets, variances, reportErrors, intersectionState) { + if (sources === void 0) { + sources = ts2.emptyArray; + } + if (targets === void 0) { + targets = ts2.emptyArray; + } + if (variances === void 0) { + variances = ts2.emptyArray; + } + if (sources.length !== targets.length && relation === identityRelation) { + return 0; + } + var length = sources.length <= targets.length ? sources.length : targets.length; + var result3 = -1; + for (var i7 = 0; i7 < length; i7++) { + var varianceFlags = i7 < variances.length ? variances[i7] : 1; + var variance = varianceFlags & 7; + if (variance !== 4) { + var s7 = sources[i7]; + var t8 = targets[i7]; + var related = -1; + if (varianceFlags & 8) { + related = relation === identityRelation ? isRelatedTo( + s7, + t8, + 3, + /*reportErrors*/ + false + ) : compareTypesIdentical(s7, t8); + } else if (variance === 1) { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + } else if (variance === 2) { + related = isRelatedTo( + t8, + s7, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + } else if (variance === 3) { + related = isRelatedTo( + t8, + s7, + 3, + /*reportErrors*/ + false + ); + if (!related) { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + } + } else { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + related &= isRelatedTo( + t8, + s7, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + if (!related) { + return 0; + } + result3 &= related; + } + } + return result3; + } + function recursiveTypeRelatedTo(source2, target2, reportErrors, intersectionState, recursionFlags) { + if (overflow) { + return 0; + } + var id = getRelationKey( + source2, + target2, + intersectionState, + relation, + /*ingnoreConstraints*/ + false + ); + var entry = relation.get(id); + if (entry !== void 0) { + if (reportErrors && entry & 2 && !(entry & 4)) { + } else { + if (outofbandVarianceMarkerHandler) { + var saved = entry & 24; + if (saved & 8) { + instantiateType(source2, reportUnmeasurableMapper); + } + if (saved & 16) { + instantiateType(source2, reportUnreliableMapper); + } + } + return entry & 1 ? -1 : 0; + } + } + if (!maybeKeys) { + maybeKeys = []; + sourceStack = []; + targetStack = []; + } else { + var broadestEquivalentId = id.startsWith("*") ? getRelationKey( + source2, + target2, + intersectionState, + relation, + /*ignoreConstraints*/ + true + ) : void 0; + for (var i7 = 0; i7 < maybeCount; i7++) { + if (id === maybeKeys[i7] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i7]) { + return 3; + } + } + if (sourceDepth === 100 || targetDepth === 100) { + overflow = true; + return 0; + } + } + var maybeStart = maybeCount; + maybeKeys[maybeCount] = id; + maybeCount++; + var saveExpandingFlags = expandingFlags; + if (recursionFlags & 1) { + sourceStack[sourceDepth] = source2; + sourceDepth++; + if (!(expandingFlags & 1) && isDeeplyNestedType(source2, sourceStack, sourceDepth)) + expandingFlags |= 1; + } + if (recursionFlags & 2) { + targetStack[targetDepth] = target2; + targetDepth++; + if (!(expandingFlags & 2) && isDeeplyNestedType(target2, targetStack, targetDepth)) + expandingFlags |= 2; + } + var originalHandler; + var propagatingVarianceFlags = 0; + if (outofbandVarianceMarkerHandler) { + originalHandler = outofbandVarianceMarkerHandler; + outofbandVarianceMarkerHandler = function(onlyUnreliable) { + propagatingVarianceFlags |= onlyUnreliable ? 16 : 8; + return originalHandler(onlyUnreliable); + }; + } + var result3; + if (expandingFlags === 3) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", { + sourceId: source2.id, + sourceIdStack: sourceStack.map(function(t8) { + return t8.id; + }), + targetId: target2.id, + targetIdStack: targetStack.map(function(t8) { + return t8.id; + }), + depth: sourceDepth, + targetDepth + }); + result3 = 3; + } else { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source2.id, targetId: target2.id }); + result3 = structuredTypeRelatedTo(source2, target2, reportErrors, intersectionState); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + if (outofbandVarianceMarkerHandler) { + outofbandVarianceMarkerHandler = originalHandler; + } + if (recursionFlags & 1) { + sourceDepth--; + } + if (recursionFlags & 2) { + targetDepth--; + } + expandingFlags = saveExpandingFlags; + if (result3) { + if (result3 === -1 || sourceDepth === 0 && targetDepth === 0) { + if (result3 === -1 || result3 === 3) { + for (var i7 = maybeStart; i7 < maybeCount; i7++) { + relation.set(maybeKeys[i7], 1 | propagatingVarianceFlags); + } + } + maybeCount = maybeStart; + } + } else { + relation.set(id, (reportErrors ? 4 : 0) | 2 | propagatingVarianceFlags); + maybeCount = maybeStart; + } + return result3; + } + function structuredTypeRelatedTo(source2, target2, reportErrors, intersectionState) { + var saveErrorInfo = captureErrorCalculationState(); + var result3 = structuredTypeRelatedToWorker(source2, target2, reportErrors, intersectionState, saveErrorInfo); + if (relation !== identityRelation) { + if (!result3 && (source2.flags & 2097152 || source2.flags & 262144 && target2.flags & 1048576)) { + var constraint = getEffectiveConstraintOfIntersection(source2.flags & 2097152 ? source2.types : [source2], !!(target2.flags & 1048576)); + if (constraint && everyType(constraint, function(c7) { + return c7 !== source2; + })) { + result3 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + if (result3 && !inPropertyCheck && (target2.flags & 2097152 && !isGenericObjectType(target2) && source2.flags & (524288 | 2097152) || isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 && getApparentType(source2).flags & 3670016 && !ts2.some(source2.types, function(t8) { + return !!(ts2.getObjectFlags(t8) & 262144); + }))) { + inPropertyCheck = true; + result3 &= propertiesRelatedTo( + source2, + target2, + reportErrors, + /*excludedProperties*/ + void 0, + 0 + /* IntersectionState.None */ + ); + inPropertyCheck = false; + } + } + if (result3) { + resetErrorInfo(saveErrorInfo); + } + return result3; + } + function structuredTypeRelatedToWorker(source2, target2, reportErrors, intersectionState, saveErrorInfo) { + var result3; + var originalErrorInfo; + var varianceCheckFailed = false; + var sourceFlags = source2.flags; + var targetFlags = target2.flags; + if (relation === identityRelation) { + if (sourceFlags & 3145728) { + var result_8 = eachTypeRelatedToSomeType(source2, target2); + if (result_8) { + result_8 &= eachTypeRelatedToSomeType(target2, source2); + } + return result_8; + } + if (sourceFlags & 4194304) { + return isRelatedTo( + source2.type, + target2.type, + 3, + /*reportErrors*/ + false + ); + } + if (sourceFlags & 8388608) { + if (result3 = isRelatedTo( + source2.objectType, + target2.objectType, + 3, + /*reportErrors*/ + false + )) { + if (result3 &= isRelatedTo( + source2.indexType, + target2.indexType, + 3, + /*reportErrors*/ + false + )) { + return result3; + } + } + } + if (sourceFlags & 16777216) { + if (source2.root.isDistributive === target2.root.isDistributive) { + if (result3 = isRelatedTo( + source2.checkType, + target2.checkType, + 3, + /*reportErrors*/ + false + )) { + if (result3 &= isRelatedTo( + source2.extendsType, + target2.extendsType, + 3, + /*reportErrors*/ + false + )) { + if (result3 &= isRelatedTo( + getTrueTypeFromConditionalType(source2), + getTrueTypeFromConditionalType(target2), + 3, + /*reportErrors*/ + false + )) { + if (result3 &= isRelatedTo( + getFalseTypeFromConditionalType(source2), + getFalseTypeFromConditionalType(target2), + 3, + /*reportErrors*/ + false + )) { + return result3; + } + } + } + } + } + } + if (sourceFlags & 33554432) { + if (result3 = isRelatedTo( + source2.baseType, + target2.baseType, + 3, + /*reportErrors*/ + false + )) { + if (result3 &= isRelatedTo( + source2.constraint, + target2.constraint, + 3, + /*reportErrors*/ + false + )) { + return result3; + } + } + } + if (!(sourceFlags & 524288)) { + return 0; + } + } else if (sourceFlags & 3145728 || targetFlags & 3145728) { + if (result3 = unionOrIntersectionRelatedTo(source2, target2, reportErrors, intersectionState)) { + return result3; + } + if (!(sourceFlags & 465829888 || sourceFlags & 524288 && targetFlags & 1048576 || sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) { + return 0; + } + } + if (sourceFlags & (524288 | 16777216) && source2.aliasSymbol && source2.aliasTypeArguments && source2.aliasSymbol === target2.aliasSymbol && !(isMarkerType(source2) || isMarkerType(target2))) { + var variances = getAliasVariances(source2.aliasSymbol); + if (variances === ts2.emptyArray) { + return 1; + } + var varianceResult = relateVariances(source2.aliasTypeArguments, target2.aliasTypeArguments, variances, intersectionState); + if (varianceResult !== void 0) { + return varianceResult; + } + } + if (isSingleElementGenericTupleType(source2) && !source2.target.readonly && (result3 = isRelatedTo( + getTypeArguments(source2)[0], + target2, + 1 + /* RecursionFlags.Source */ + )) || isSingleElementGenericTupleType(target2) && (target2.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source2) || source2)) && (result3 = isRelatedTo( + source2, + getTypeArguments(target2)[0], + 2 + /* RecursionFlags.Target */ + ))) { + return result3; + } + if (targetFlags & 262144) { + if (ts2.getObjectFlags(source2) & 32 && !source2.declaration.nameType && isRelatedTo( + getIndexType(target2), + getConstraintTypeFromMappedType(source2), + 3 + /* RecursionFlags.Both */ + )) { + if (!(getMappedTypeModifiers(source2) & 4)) { + var templateType = getTemplateTypeFromMappedType(source2); + var indexedAccessType = getIndexedAccessType(target2, getTypeParameterFromMappedType(source2)); + if (result3 = isRelatedTo(templateType, indexedAccessType, 3, reportErrors)) { + return result3; + } + } + } + if (relation === comparableRelation && sourceFlags & 262144) { + var constraint = getConstraintOfTypeParameter(source2); + if (constraint && hasNonCircularBaseConstraint(source2)) { + while (constraint && someType(constraint, function(c8) { + return !!(c8.flags & 262144); + })) { + if (result3 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false + )) { + return result3; + } + constraint = getConstraintOfTypeParameter(constraint); + } + } + return 0; + } + } else if (targetFlags & 4194304) { + var targetType_1 = target2.type; + if (sourceFlags & 4194304) { + if (result3 = isRelatedTo( + targetType_1, + source2.type, + 3, + /*reportErrors*/ + false + )) { + return result3; + } + } + if (isTupleType(targetType_1)) { + if (result3 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType_1), 2, reportErrors)) { + return result3; + } + } else { + var constraint = getSimplifiedTypeOrConstraint(targetType_1); + if (constraint) { + if (isRelatedTo(source2, getIndexType(constraint, target2.stringsOnly), 2, reportErrors) === -1) { + return -1; + } + } else if (isGenericMappedType(targetType_1)) { + var nameType_1 = getNameTypeFromMappedType(targetType_1); + var constraintType = getConstraintTypeFromMappedType(targetType_1); + var targetKeys = void 0; + if (nameType_1 && isMappedTypeWithKeyofConstraintDeclaration(targetType_1)) { + var modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType_1)); + var mappedKeys_1 = []; + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType( + modifiersType, + 8576, + /*stringsOnly*/ + false, + function(t8) { + return void mappedKeys_1.push(instantiateType(nameType_1, appendTypeMapping(targetType_1.mapper, getTypeParameterFromMappedType(targetType_1), t8))); + } + ); + targetKeys = getUnionType(__spreadArray9(__spreadArray9([], mappedKeys_1, true), [nameType_1], false)); + } else { + targetKeys = nameType_1 || constraintType; + } + if (isRelatedTo(source2, targetKeys, 2, reportErrors) === -1) { + return -1; + } + } + } + } else if (targetFlags & 8388608) { + if (sourceFlags & 8388608) { + if (result3 = isRelatedTo(source2.objectType, target2.objectType, 3, reportErrors)) { + result3 &= isRelatedTo(source2.indexType, target2.indexType, 3, reportErrors); + } + if (result3) { + return result3; + } + if (reportErrors) { + originalErrorInfo = errorInfo; + } + } + if (relation === assignableRelation || relation === comparableRelation) { + var objectType2 = target2.objectType; + var indexType = target2.indexType; + var baseObjectType = getBaseConstraintOfType(objectType2) || objectType2; + var baseIndexType = getBaseConstraintOfType(indexType) || indexType; + if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { + var accessFlags = 4 | (baseObjectType !== objectType2 ? 2 : 0); + var constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, accessFlags); + if (constraint) { + if (reportErrors && originalErrorInfo) { + resetErrorInfo(saveErrorInfo); + } + if (result3 = isRelatedTo( + source2, + constraint, + 2, + reportErrors, + /* headMessage */ + void 0, + intersectionState + )) { + return result3; + } + if (reportErrors && originalErrorInfo && errorInfo) { + errorInfo = countMessageChainBreadth([originalErrorInfo]) <= countMessageChainBreadth([errorInfo]) ? originalErrorInfo : errorInfo; + } + } + } + } + if (reportErrors) { + originalErrorInfo = void 0; + } + } else if (isGenericMappedType(target2) && relation !== identityRelation) { + var keysRemapped = !!target2.declaration.nameType; + var templateType = getTemplateTypeFromMappedType(target2); + var modifiers = getMappedTypeModifiers(target2); + if (!(modifiers & 8)) { + if (!keysRemapped && templateType.flags & 8388608 && templateType.objectType === source2 && templateType.indexType === getTypeParameterFromMappedType(target2)) { + return -1; + } + if (!isGenericMappedType(source2)) { + var targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2); + var sourceKeys = getIndexType( + source2, + /*stringsOnly*/ + void 0, + /*noIndexSignatures*/ + true + ); + var includeOptional = modifiers & 4; + var filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0; + if (includeOptional ? !(filteredByApplicability.flags & 131072) : isRelatedTo( + targetKeys, + sourceKeys, + 3 + /* RecursionFlags.Both */ + )) { + var templateType_1 = getTemplateTypeFromMappedType(target2); + var typeParameter = getTypeParameterFromMappedType(target2); + var nonNullComponent = extractTypesOfKind( + templateType_1, + ~98304 + /* TypeFlags.Nullable */ + ); + if (!keysRemapped && nonNullComponent.flags & 8388608 && nonNullComponent.indexType === typeParameter) { + if (result3 = isRelatedTo(source2, nonNullComponent.objectType, 2, reportErrors)) { + return result3; + } + } else { + var indexingType = keysRemapped ? filteredByApplicability || targetKeys : filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter; + var indexedAccessType = getIndexedAccessType(source2, indexingType); + if (result3 = isRelatedTo(indexedAccessType, templateType_1, 3, reportErrors)) { + return result3; + } + } + } + originalErrorInfo = errorInfo; + resetErrorInfo(saveErrorInfo); + } + } + } else if (targetFlags & 16777216) { + if (isDeeplyNestedType(target2, targetStack, targetDepth, 10)) { + return 3; + } + var c7 = target2; + if (!c7.root.inferTypeParameters && !isDistributionDependent(c7.root)) { + var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c7.checkType), getPermissiveInstantiation(c7.extendsType)); + var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c7.checkType), getRestrictiveInstantiation(c7.extendsType)); + if (result3 = skipTrue ? -1 : isRelatedTo( + source2, + getTrueTypeFromConditionalType(c7), + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + )) { + result3 &= skipFalse ? -1 : isRelatedTo( + source2, + getFalseTypeFromConditionalType(c7), + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (result3) { + return result3; + } + } + } + } else if (targetFlags & 134217728) { + if (sourceFlags & 134217728) { + if (relation === comparableRelation) { + return templateLiteralTypesDefinitelyUnrelated(source2, target2) ? 0 : -1; + } + instantiateType(source2, reportUnreliableMapper); + } + if (isTypeMatchedByTemplateLiteralType(source2, target2)) { + return -1; + } + } else if (target2.flags & 268435456) { + if (!(source2.flags & 268435456)) { + if (isMemberOfStringMapping(source2, target2)) { + return -1; + } + } + } + if (sourceFlags & 8650752) { + if (!(sourceFlags & 8388608 && targetFlags & 8388608)) { + var constraint = getConstraintOfType(source2) || unknownType2; + if (result3 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + )) { + return result3; + } else if (result3 = isRelatedTo( + getTypeWithThisArgument(constraint, source2), + target2, + 1, + reportErrors && constraint !== unknownType2 && !(targetFlags & sourceFlags & 262144), + /*headMessage*/ + void 0, + intersectionState + )) { + return result3; + } + if (isMappedTypeGenericIndexedAccess(source2)) { + var indexConstraint = getConstraintOfType(source2.indexType); + if (indexConstraint) { + if (result3 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, 1, reportErrors)) { + return result3; + } + } + } + } + } else if (sourceFlags & 4194304) { + if (result3 = isRelatedTo(keyofConstraintType, target2, 1, reportErrors)) { + return result3; + } + } else if (sourceFlags & 134217728 && !(targetFlags & 524288)) { + if (!(targetFlags & 134217728)) { + var constraint = getBaseConstraintOfType(source2); + if (constraint && constraint !== source2 && (result3 = isRelatedTo(constraint, target2, 1, reportErrors))) { + return result3; + } + } + } else if (sourceFlags & 268435456) { + if (targetFlags & 268435456) { + if (source2.symbol !== target2.symbol) { + return 0; + } + if (result3 = isRelatedTo(source2.type, target2.type, 3, reportErrors)) { + return result3; + } + } else { + var constraint = getBaseConstraintOfType(source2); + if (constraint && (result3 = isRelatedTo(constraint, target2, 1, reportErrors))) { + return result3; + } + } + } else if (sourceFlags & 16777216) { + if (isDeeplyNestedType(source2, sourceStack, sourceDepth, 10)) { + return 3; + } + if (targetFlags & 16777216) { + var sourceParams = source2.root.inferTypeParameters; + var sourceExtends = source2.extendsType; + var mapper = void 0; + if (sourceParams) { + var ctx = createInferenceContext( + sourceParams, + /*signature*/ + void 0, + 0, + isRelatedToWorker + ); + inferTypes( + ctx.inferences, + target2.extendsType, + sourceExtends, + 512 | 1024 + /* InferencePriority.AlwaysStrict */ + ); + sourceExtends = instantiateType(sourceExtends, ctx.mapper); + mapper = ctx.mapper; + } + if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo( + source2.checkType, + target2.checkType, + 3 + /* RecursionFlags.Both */ + ) || isRelatedTo( + target2.checkType, + source2.checkType, + 3 + /* RecursionFlags.Both */ + ))) { + if (result3 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), 3, reportErrors)) { + result3 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), 3, reportErrors); + } + if (result3) { + return result3; + } + } + } else { + var distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0; + if (distributiveConstraint) { + if (result3 = isRelatedTo(distributiveConstraint, target2, 1, reportErrors)) { + return result3; + } + } + } + var defaultConstraint = getDefaultConstraintOfConditionalType(source2); + if (defaultConstraint) { + if (result3 = isRelatedTo(defaultConstraint, target2, 1, reportErrors)) { + return result3; + } + } + } else { + if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) { + return -1; + } + if (isGenericMappedType(target2)) { + if (isGenericMappedType(source2)) { + if (result3 = mappedTypeRelatedTo(source2, target2, reportErrors)) { + return result3; + } + } + return 0; + } + var sourceIsPrimitive = !!(sourceFlags & 131068); + if (relation !== identityRelation) { + source2 = getApparentType(source2); + sourceFlags = source2.flags; + } else if (isGenericMappedType(source2)) { + return 0; + } + if (ts2.getObjectFlags(source2) & 4 && ts2.getObjectFlags(target2) & 4 && source2.target === target2.target && !isTupleType(source2) && !(isMarkerType(source2) || isMarkerType(target2))) { + if (isEmptyArrayLiteralType(source2)) { + return -1; + } + var variances = getVariances(source2.target); + if (variances === ts2.emptyArray) { + return 1; + } + var varianceResult = relateVariances(getTypeArguments(source2), getTypeArguments(target2), variances, intersectionState); + if (varianceResult !== void 0) { + return varianceResult; + } + } else if (isReadonlyArrayType(target2) ? isArrayOrTupleType(source2) : isArrayType(target2) && isTupleType(source2) && !source2.target.readonly) { + if (relation !== identityRelation) { + return isRelatedTo(getIndexTypeOfType(source2, numberType2) || anyType2, getIndexTypeOfType(target2, numberType2) || anyType2, 3, reportErrors); + } else { + return 0; + } + } else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && ts2.getObjectFlags(target2) & 8192 && !isEmptyObjectType(source2)) { + return 0; + } + if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) { + var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive; + result3 = propertiesRelatedTo( + source2, + target2, + reportStructuralErrors, + /*excludedProperties*/ + void 0, + intersectionState + ); + if (result3) { + result3 &= signaturesRelatedTo(source2, target2, 0, reportStructuralErrors); + if (result3) { + result3 &= signaturesRelatedTo(source2, target2, 1, reportStructuralErrors); + if (result3) { + result3 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); + } + } + } + if (varianceCheckFailed && result3) { + errorInfo = originalErrorInfo || errorInfo || saveErrorInfo.errorInfo; + } else if (result3) { + return result3; + } + } + if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) { + var objectOnlyTarget = extractTypesOfKind( + target2, + 524288 | 2097152 | 33554432 + /* TypeFlags.Substitution */ + ); + if (objectOnlyTarget.flags & 1048576) { + var result_9 = typeRelatedToDiscriminatedType(source2, objectOnlyTarget); + if (result_9) { + return result_9; + } + } + } + } + return 0; + function countMessageChainBreadth(info2) { + if (!info2) + return 0; + return ts2.reduceLeft(info2, function(value2, chain4) { + return value2 + 1 + countMessageChainBreadth(chain4.next); + }, 0); + } + function relateVariances(sourceTypeArguments, targetTypeArguments, variances2, intersectionState2) { + if (result3 = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances2, reportErrors, intersectionState2)) { + return result3; + } + if (ts2.some(variances2, function(v8) { + return !!(v8 & 24); + })) { + originalErrorInfo = void 0; + resetErrorInfo(saveErrorInfo); + return void 0; + } + var allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances2); + varianceCheckFailed = !allowStructuralFallback; + if (variances2 !== ts2.emptyArray && !allowStructuralFallback) { + if (varianceCheckFailed && !(reportErrors && ts2.some(variances2, function(v8) { + return (v8 & 7) === 0; + }))) { + return 0; + } + originalErrorInfo = errorInfo; + resetErrorInfo(saveErrorInfo); + } + } + } + function mappedTypeRelatedTo(source2, target2, reportErrors) { + var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source2) === getMappedTypeModifiers(target2) : getCombinedMappedTypeOptionality(source2) <= getCombinedMappedTypeOptionality(target2)); + if (modifiersRelated) { + var result_10; + var targetConstraint = getConstraintTypeFromMappedType(target2); + var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source2), getCombinedMappedTypeOptionality(source2) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper); + if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(source2)], [getTypeParameterFromMappedType(target2)]); + if (instantiateType(getNameTypeFromMappedType(source2), mapper) === instantiateType(getNameTypeFromMappedType(target2), mapper)) { + return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), 3, reportErrors); + } + } + } + return 0; + } + function typeRelatedToDiscriminatedType(source2, target2) { + var sourceProperties = getPropertiesOfType(source2); + var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2); + if (!sourcePropertiesFiltered) + return 0; + var numCombinations = 1; + for (var _i = 0, sourcePropertiesFiltered_1 = sourcePropertiesFiltered; _i < sourcePropertiesFiltered_1.length; _i++) { + var sourceProperty = sourcePropertiesFiltered_1[_i]; + numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty)); + if (numCombinations > 25) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations }); + return 0; + } + } + var sourceDiscriminantTypes = new Array(sourcePropertiesFiltered.length); + var excludedProperties = new ts2.Set(); + for (var i7 = 0; i7 < sourcePropertiesFiltered.length; i7++) { + var sourceProperty = sourcePropertiesFiltered[i7]; + var sourcePropertyType = getNonMissingTypeOfSymbol(sourceProperty); + sourceDiscriminantTypes[i7] = sourcePropertyType.flags & 1048576 ? sourcePropertyType.types : [sourcePropertyType]; + excludedProperties.add(sourceProperty.escapedName); + } + var discriminantCombinations = ts2.cartesianProduct(sourceDiscriminantTypes); + var matchingTypes = []; + var _loop_21 = function(combination2) { + var hasMatch = false; + outer: + for (var _c = 0, _d = target2.types; _c < _d.length; _c++) { + var type4 = _d[_c]; + var _loop_22 = function(i9) { + var sourceProperty2 = sourcePropertiesFiltered[i9]; + var targetProperty = getPropertyOfType(type4, sourceProperty2.escapedName); + if (!targetProperty) + return "continue-outer"; + if (sourceProperty2 === targetProperty) + return "continue"; + var related = propertyRelatedTo( + source2, + target2, + sourceProperty2, + targetProperty, + function(_6) { + return combination2[i9]; + }, + /*reportErrors*/ + false, + 0, + /*skipOptional*/ + strictNullChecks || relation === comparableRelation + ); + if (!related) { + return "continue-outer"; + } + }; + for (var i8 = 0; i8 < sourcePropertiesFiltered.length; i8++) { + var state_8 = _loop_22(i8); + switch (state_8) { + case "continue-outer": + continue outer; + } + } + ts2.pushIfUnique(matchingTypes, type4, ts2.equateValues); + hasMatch = true; + } + if (!hasMatch) { + return { + value: 0 + /* Ternary.False */ + }; + } + }; + for (var _a2 = 0, discriminantCombinations_1 = discriminantCombinations; _a2 < discriminantCombinations_1.length; _a2++) { + var combination = discriminantCombinations_1[_a2]; + var state_7 = _loop_21(combination); + if (typeof state_7 === "object") + return state_7.value; + } + var result3 = -1; + for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) { + var type3 = matchingTypes_1[_b]; + result3 &= propertiesRelatedTo( + source2, + type3, + /*reportErrors*/ + false, + excludedProperties, + 0 + /* IntersectionState.None */ + ); + if (result3) { + result3 &= signaturesRelatedTo( + source2, + type3, + 0, + /*reportStructuralErrors*/ + false + ); + if (result3) { + result3 &= signaturesRelatedTo( + source2, + type3, + 1, + /*reportStructuralErrors*/ + false + ); + if (result3 && !(isTupleType(source2) && isTupleType(type3))) { + result3 &= indexSignaturesRelatedTo( + source2, + type3, + /*sourceIsPrimitive*/ + false, + /*reportStructuralErrors*/ + false, + 0 + /* IntersectionState.None */ + ); + } + } + } + if (!result3) { + return result3; + } + } + return result3; + } + function excludeProperties(properties, excludedProperties) { + if (!excludedProperties || properties.length === 0) + return properties; + var result3; + for (var i7 = 0; i7 < properties.length; i7++) { + if (!excludedProperties.has(properties[i7].escapedName)) { + if (result3) { + result3.push(properties[i7]); + } + } else if (!result3) { + result3 = properties.slice(0, i7); + } + } + return result3 || properties; + } + function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState) { + var targetIsOptional = strictNullChecks && !!(ts2.getCheckFlags(targetProp) & 48); + var effectiveTarget = addOptionality( + getNonMissingTypeOfSymbol(targetProp), + /*isProperty*/ + false, + targetIsOptional + ); + var effectiveSource = getTypeOfSourceProperty(sourceProp); + return isRelatedTo( + effectiveSource, + effectiveTarget, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + } + function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional) { + var sourcePropFlags = ts2.getDeclarationModifierFlagsFromSymbol(sourceProp); + var targetPropFlags = ts2.getDeclarationModifierFlagsFromSymbol(targetProp); + if (sourcePropFlags & 8 || targetPropFlags & 8) { + if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { + if (reportErrors) { + if (sourcePropFlags & 8 && targetPropFlags & 8) { + reportError(ts2.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString2(targetProp)); + } else { + reportError(ts2.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString2(targetProp), typeToString(sourcePropFlags & 8 ? source2 : target2), typeToString(sourcePropFlags & 8 ? target2 : source2)); + } + } + return 0; + } + } else if (targetPropFlags & 16) { + if (!isValidOverrideOf(sourceProp, targetProp)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString2(targetProp), typeToString(getDeclaringClass(sourceProp) || source2), typeToString(getDeclaringClass(targetProp) || target2)); + } + return 0; + } + } else if (sourcePropFlags & 16) { + if (reportErrors) { + reportError(ts2.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString2(targetProp), typeToString(source2), typeToString(target2)); + } + return 0; + } + if (relation === strictSubtypeRelation && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) { + return 0; + } + var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState); + if (!related) { + if (reportErrors) { + reportIncompatibleError(ts2.Diagnostics.Types_of_property_0_are_incompatible, symbolToString2(targetProp)); + } + return 0; + } + if (!skipOptional && sourceProp.flags & 16777216 && targetProp.flags & 106500 && !(targetProp.flags & 16777216)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString2(targetProp), typeToString(source2), typeToString(target2)); + } + return 0; + } + return related; + } + function reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties) { + var shouldSkipElaboration = false; + if (unmatchedProperty.valueDeclaration && ts2.isNamedDeclaration(unmatchedProperty.valueDeclaration) && ts2.isPrivateIdentifier(unmatchedProperty.valueDeclaration.name) && source2.symbol && source2.symbol.flags & 32) { + var privateIdentifierDescription = unmatchedProperty.valueDeclaration.name.escapedText; + var symbolTableKey = ts2.getSymbolNameForPrivateIdentifier(source2.symbol, privateIdentifierDescription); + if (symbolTableKey && getPropertyOfType(source2, symbolTableKey)) { + var sourceName = ts2.factory.getDeclarationName(source2.symbol.valueDeclaration); + var targetName = ts2.factory.getDeclarationName(target2.symbol.valueDeclaration); + reportError(ts2.Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2, diagnosticName(privateIdentifierDescription), diagnosticName(sourceName.escapedText === "" ? anon : sourceName), diagnosticName(targetName.escapedText === "" ? anon : targetName)); + return; + } + } + var props = ts2.arrayFrom(getUnmatchedProperties( + source2, + target2, + requireOptionalProperties, + /*matchDiscriminantProperties*/ + false + )); + if (!headMessage || headMessage.code !== ts2.Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== ts2.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code) { + shouldSkipElaboration = true; + } + if (props.length === 1) { + var propName2 = symbolToString2( + unmatchedProperty, + /*enclosingDeclaration*/ + void 0, + 0, + 4 | 16 + /* SymbolFormatFlags.WriteComputedProps */ + ); + reportError.apply(void 0, __spreadArray9([ts2.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName2], getTypeNamesForErrorDisplay(source2, target2), false)); + if (ts2.length(unmatchedProperty.declarations)) { + associateRelatedInfo(ts2.createDiagnosticForNode(unmatchedProperty.declarations[0], ts2.Diagnostics._0_is_declared_here, propName2)); + } + if (shouldSkipElaboration && errorInfo) { + overrideNextErrorInfo++; + } + } else if (tryElaborateArrayLikeErrors( + source2, + target2, + /*reportErrors*/ + false + )) { + if (props.length > 5) { + reportError(ts2.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2), ts2.map(props.slice(0, 4), function(p7) { + return symbolToString2(p7); + }).join(", "), props.length - 4); + } else { + reportError(ts2.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2), ts2.map(props, function(p7) { + return symbolToString2(p7); + }).join(", ")); + } + if (shouldSkipElaboration && errorInfo) { + overrideNextErrorInfo++; + } + } + } + function propertiesRelatedTo(source2, target2, reportErrors, excludedProperties, intersectionState) { + if (relation === identityRelation) { + return propertiesIdenticalTo(source2, target2, excludedProperties); + } + var result3 = -1; + if (isTupleType(target2)) { + if (isArrayOrTupleType(source2)) { + if (!target2.target.readonly && (isReadonlyArrayType(source2) || isTupleType(source2) && source2.target.readonly)) { + return 0; + } + var sourceArity = getTypeReferenceArity(source2); + var targetArity = getTypeReferenceArity(target2); + var sourceRestFlag = isTupleType(source2) ? source2.target.combinedFlags & 4 : 4; + var targetRestFlag = target2.target.combinedFlags & 4; + var sourceMinLength = isTupleType(source2) ? source2.target.minLength : 0; + var targetMinLength = target2.target.minLength; + if (!sourceRestFlag && sourceArity < targetMinLength) { + if (reportErrors) { + reportError(ts2.Diagnostics.Source_has_0_element_s_but_target_requires_1, sourceArity, targetMinLength); + } + return 0; + } + if (!targetRestFlag && targetArity < sourceMinLength) { + if (reportErrors) { + reportError(ts2.Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity); + } + return 0; + } + if (!targetRestFlag && (sourceRestFlag || targetArity < sourceArity)) { + if (reportErrors) { + if (sourceMinLength < targetMinLength) { + reportError(ts2.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength); + } else { + reportError(ts2.Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more, targetArity); + } + } + return 0; + } + var sourceTypeArguments = getTypeArguments(source2); + var targetTypeArguments = getTypeArguments(target2); + var startCount = Math.min(isTupleType(source2) ? getStartElementCount( + source2.target, + 11 + /* ElementFlags.NonRest */ + ) : 0, getStartElementCount( + target2.target, + 11 + /* ElementFlags.NonRest */ + )); + var endCount = Math.min(isTupleType(source2) ? getEndElementCount( + source2.target, + 11 + /* ElementFlags.NonRest */ + ) : 0, targetRestFlag ? getEndElementCount( + target2.target, + 11 + /* ElementFlags.NonRest */ + ) : 0); + var canExcludeDiscriminants = !!excludedProperties; + for (var i7 = 0; i7 < targetArity; i7++) { + var sourceIndex = i7 < targetArity - endCount ? i7 : i7 + sourceArity - targetArity; + var sourceFlags = isTupleType(source2) && (i7 < startCount || i7 >= targetArity - endCount) ? source2.target.elementFlags[sourceIndex] : 4; + var targetFlags = target2.target.elementFlags[i7]; + if (targetFlags & 8 && !(sourceFlags & 8)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, i7); + } + return 0; + } + if (sourceFlags & 8 && !(targetFlags & 12)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourceIndex, i7); + } + return 0; + } + if (targetFlags & 1 && !(sourceFlags & 1)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, i7); + } + return 0; + } + if (canExcludeDiscriminants) { + if (sourceFlags & 12 || targetFlags & 12) { + canExcludeDiscriminants = false; + } + if (canExcludeDiscriminants && (excludedProperties === null || excludedProperties === void 0 ? void 0 : excludedProperties.has("" + i7))) { + continue; + } + } + var sourceType = !isTupleType(source2) ? sourceTypeArguments[0] : i7 < startCount || i7 >= targetArity - endCount ? removeMissingType(sourceTypeArguments[sourceIndex], !!(sourceFlags & targetFlags & 2)) : getElementTypeOfSliceOfTupleType(source2, startCount, endCount) || neverType2; + var targetType = targetTypeArguments[i7]; + var targetCheckType = sourceFlags & 8 && targetFlags & 4 ? createArrayType(targetType) : removeMissingType(targetType, !!(targetFlags & 2)); + var related = isRelatedTo( + sourceType, + targetCheckType, + 3, + reportErrors, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + if (reportErrors && (targetArity > 1 || sourceArity > 1)) { + if (i7 < startCount || i7 >= targetArity - endCount || sourceArity - startCount - endCount === 1) { + reportIncompatibleError(ts2.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourceIndex, i7); + } else { + reportIncompatibleError(ts2.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, startCount, sourceArity - endCount - 1, i7); + } + } + return 0; + } + result3 &= related; + } + return result3; + } + if (target2.target.combinedFlags & 12) { + return 0; + } + } + var requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType(source2) && !isEmptyArrayLiteralType(source2) && !isTupleType(source2); + var unmatchedProperty = getUnmatchedProperty( + source2, + target2, + requireOptionalProperties, + /*matchDiscriminantProperties*/ + false + ); + if (unmatchedProperty) { + if (reportErrors && shouldReportUnmatchedPropertyError(source2, target2)) { + reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties); + } + return 0; + } + if (isObjectLiteralType(target2)) { + for (var _i = 0, _a2 = excludeProperties(getPropertiesOfType(source2), excludedProperties); _i < _a2.length; _i++) { + var sourceProp = _a2[_i]; + if (!getPropertyOfObjectType(target2, sourceProp.escapedName)) { + var sourceType = getTypeOfSymbol(sourceProp); + if (!(sourceType.flags & 32768)) { + if (reportErrors) { + reportError(ts2.Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString2(sourceProp), typeToString(target2)); + } + return 0; + } + } + } + } + var properties = getPropertiesOfType(target2); + var numericNamesOnly = isTupleType(source2) && isTupleType(target2); + for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) { + var targetProp = _c[_b]; + var name2 = targetProp.escapedName; + if (!(targetProp.flags & 4194304) && (!numericNamesOnly || ts2.isNumericLiteralName(name2) || name2 === "length")) { + var sourceProp = getPropertyOfType(source2, name2); + if (sourceProp && sourceProp !== targetProp) { + var related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation); + if (!related) { + return 0; + } + result3 &= related; + } + } + } + return result3; + } + function propertiesIdenticalTo(source2, target2, excludedProperties) { + if (!(source2.flags & 524288 && target2.flags & 524288)) { + return 0; + } + var sourceProperties = excludeProperties(getPropertiesOfObjectType(source2), excludedProperties); + var targetProperties = excludeProperties(getPropertiesOfObjectType(target2), excludedProperties); + if (sourceProperties.length !== targetProperties.length) { + return 0; + } + var result3 = -1; + for (var _i = 0, sourceProperties_1 = sourceProperties; _i < sourceProperties_1.length; _i++) { + var sourceProp = sourceProperties_1[_i]; + var targetProp = getPropertyOfObjectType(target2, sourceProp.escapedName); + if (!targetProp) { + return 0; + } + var related = compareProperties(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function signaturesRelatedTo(source2, target2, kind, reportErrors) { + var _a2, _b; + if (relation === identityRelation) { + return signaturesIdenticalTo(source2, target2, kind); + } + if (target2 === anyFunctionType || source2 === anyFunctionType) { + return -1; + } + var sourceIsJSConstructor = source2.symbol && isJSConstructor(source2.symbol.valueDeclaration); + var targetIsJSConstructor = target2.symbol && isJSConstructor(target2.symbol.valueDeclaration); + var sourceSignatures = getSignaturesOfType(source2, sourceIsJSConstructor && kind === 1 ? 0 : kind); + var targetSignatures = getSignaturesOfType(target2, targetIsJSConstructor && kind === 1 ? 0 : kind); + if (kind === 1 && sourceSignatures.length && targetSignatures.length) { + var sourceIsAbstract = !!(sourceSignatures[0].flags & 4); + var targetIsAbstract = !!(targetSignatures[0].flags & 4); + if (sourceIsAbstract && !targetIsAbstract) { + if (reportErrors) { + reportError(ts2.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0; + } + if (!constructorVisibilitiesAreCompatible(sourceSignatures[0], targetSignatures[0], reportErrors)) { + return 0; + } + } + var result3 = -1; + var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; + var sourceObjectFlags = ts2.getObjectFlags(source2); + var targetObjectFlags = ts2.getObjectFlags(target2); + if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source2.symbol === target2.symbol || sourceObjectFlags & 4 && targetObjectFlags & 4 && source2.target === target2.target) { + for (var i7 = 0; i7 < targetSignatures.length; i7++) { + var related = signatureRelatedTo( + sourceSignatures[i7], + targetSignatures[i7], + /*erase*/ + true, + reportErrors, + incompatibleReporter(sourceSignatures[i7], targetSignatures[i7]) + ); + if (!related) { + return 0; + } + result3 &= related; + } + } else if (sourceSignatures.length === 1 && targetSignatures.length === 1) { + var eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; + var sourceSignature = ts2.first(sourceSignatures); + var targetSignature = ts2.first(targetSignatures); + result3 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors, incompatibleReporter(sourceSignature, targetSignature)); + if (!result3 && reportErrors && kind === 1 && sourceObjectFlags & targetObjectFlags && (((_a2 = targetSignature.declaration) === null || _a2 === void 0 ? void 0 : _a2.kind) === 173 || ((_b = sourceSignature.declaration) === null || _b === void 0 ? void 0 : _b.kind) === 173)) { + var constructSignatureToString = function(signature) { + return signatureToString( + signature, + /*enclosingDeclaration*/ + void 0, + 262144, + kind + ); + }; + reportError(ts2.Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); + reportError(ts2.Diagnostics.Types_of_construct_signatures_are_incompatible); + return result3; + } + } else { + outer: + for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) { + var t8 = targetSignatures_1[_i]; + var saveErrorInfo = captureErrorCalculationState(); + var shouldElaborateErrors = reportErrors; + for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) { + var s7 = sourceSignatures_1[_c]; + var related = signatureRelatedTo( + s7, + t8, + /*erase*/ + true, + shouldElaborateErrors, + incompatibleReporter(s7, t8) + ); + if (related) { + result3 &= related; + resetErrorInfo(saveErrorInfo); + continue outer; + } + shouldElaborateErrors = false; + } + if (shouldElaborateErrors) { + reportError(ts2.Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source2), signatureToString( + t8, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0, + kind + )); + } + return 0; + } + } + return result3; + } + function shouldReportUnmatchedPropertyError(source2, target2) { + var typeCallSignatures = getSignaturesOfStructuredType( + source2, + 0 + /* SignatureKind.Call */ + ); + var typeConstructSignatures = getSignaturesOfStructuredType( + source2, + 1 + /* SignatureKind.Construct */ + ); + var typeProperties = getPropertiesOfObjectType(source2); + if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) { + if (getSignaturesOfType( + target2, + 0 + /* SignatureKind.Call */ + ).length && typeCallSignatures.length || getSignaturesOfType( + target2, + 1 + /* SignatureKind.Construct */ + ).length && typeConstructSignatures.length) { + return true; + } + return false; + } + return true; + } + function reportIncompatibleCallSignatureReturn(siga, sigb) { + if (siga.parameters.length === 0 && sigb.parameters.length === 0) { + return function(source2, target2) { + return reportIncompatibleError(ts2.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); + }; + } + return function(source2, target2) { + return reportIncompatibleError(ts2.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); + }; + } + function reportIncompatibleConstructSignatureReturn(siga, sigb) { + if (siga.parameters.length === 0 && sigb.parameters.length === 0) { + return function(source2, target2) { + return reportIncompatibleError(ts2.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); + }; + } + return function(source2, target2) { + return reportIncompatibleError(ts2.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); + }; + } + function signatureRelatedTo(source2, target2, erase, reportErrors, incompatibleReporter) { + return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, reportUnreliableMapper); + } + function signaturesIdenticalTo(source2, target2, kind) { + var sourceSignatures = getSignaturesOfType(source2, kind); + var targetSignatures = getSignaturesOfType(target2, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return 0; + } + var result3 = -1; + for (var i7 = 0; i7 < sourceSignatures.length; i7++) { + var related = compareSignaturesIdentical( + sourceSignatures[i7], + targetSignatures[i7], + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false, + isRelatedTo + ); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function membersRelatedToIndexInfo(source2, targetInfo, reportErrors) { + var result3 = -1; + var keyType = targetInfo.keyType; + var props = source2.flags & 2097152 ? getPropertiesOfUnionOrIntersectionType(source2) : getPropertiesOfObjectType(source2); + for (var _i = 0, props_2 = props; _i < props_2.length; _i++) { + var prop = props_2[_i]; + if (isIgnoredJsxProperty(source2, prop)) { + continue; + } + if (isApplicableIndexType(getLiteralTypeFromProperty( + prop, + 8576 + /* TypeFlags.StringOrNumberLiteralOrUnique */ + ), keyType)) { + var propType = getNonMissingTypeOfSymbol(prop); + var type3 = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType2 || !(prop.flags & 16777216) ? propType : getTypeWithFacts( + propType, + 524288 + /* TypeFacts.NEUndefined */ + ); + var related = isRelatedTo(type3, targetInfo.type, 3, reportErrors); + if (!related) { + if (reportErrors) { + reportError(ts2.Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString2(prop)); + } + return 0; + } + result3 &= related; + } + } + for (var _a2 = 0, _b = getIndexInfosOfType(source2); _a2 < _b.length; _a2++) { + var info2 = _b[_a2]; + if (isApplicableIndexType(info2.keyType, keyType)) { + var related = indexInfoRelatedTo(info2, targetInfo, reportErrors); + if (!related) { + return 0; + } + result3 &= related; + } + } + return result3; + } + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors) { + var related = isRelatedTo(sourceInfo.type, targetInfo.type, 3, reportErrors); + if (!related && reportErrors) { + if (sourceInfo.keyType === targetInfo.keyType) { + reportError(ts2.Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); + } else { + reportError(ts2.Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType)); + } + } + return related; + } + function indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportErrors, intersectionState) { + if (relation === identityRelation) { + return indexSignaturesIdenticalTo(source2, target2); + } + var indexInfos = getIndexInfosOfType(target2); + var targetHasStringIndex = ts2.some(indexInfos, function(info2) { + return info2.keyType === stringType2; + }); + var result3 = -1; + for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) { + var targetInfo = indexInfos_5[_i]; + var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3, reportErrors) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors, intersectionState); + if (!related) { + return 0; + } + result3 &= related; + } + return result3; + } + function typeRelatedToIndexInfo(source2, targetInfo, reportErrors, intersectionState) { + var sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); + if (sourceInfo) { + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors); + } + if (!(intersectionState & 1) && isObjectTypeWithInferableIndex(source2)) { + return membersRelatedToIndexInfo(source2, targetInfo, reportErrors); + } + if (reportErrors) { + reportError(ts2.Diagnostics.Index_signature_for_type_0_is_missing_in_type_1, typeToString(targetInfo.keyType), typeToString(source2)); + } + return 0; + } + function indexSignaturesIdenticalTo(source2, target2) { + var sourceInfos = getIndexInfosOfType(source2); + var targetInfos = getIndexInfosOfType(target2); + if (sourceInfos.length !== targetInfos.length) { + return 0; + } + for (var _i = 0, targetInfos_1 = targetInfos; _i < targetInfos_1.length; _i++) { + var targetInfo = targetInfos_1[_i]; + var sourceInfo = getIndexInfoOfType(source2, targetInfo.keyType); + if (!(sourceInfo && isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 + /* RecursionFlags.Both */ + ) && sourceInfo.isReadonly === targetInfo.isReadonly)) { + return 0; + } + } + return -1; + } + function constructorVisibilitiesAreCompatible(sourceSignature, targetSignature, reportErrors) { + if (!sourceSignature.declaration || !targetSignature.declaration) { + return true; + } + var sourceAccessibility = ts2.getSelectedEffectiveModifierFlags( + sourceSignature.declaration, + 24 + /* ModifierFlags.NonPublicAccessibilityModifier */ + ); + var targetAccessibility = ts2.getSelectedEffectiveModifierFlags( + targetSignature.declaration, + 24 + /* ModifierFlags.NonPublicAccessibilityModifier */ + ); + if (targetAccessibility === 8) { + return true; + } + if (targetAccessibility === 16 && sourceAccessibility !== 8) { + return true; + } + if (targetAccessibility !== 16 && !sourceAccessibility) { + return true; + } + if (reportErrors) { + reportError(ts2.Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type, visibilityToString(sourceAccessibility), visibilityToString(targetAccessibility)); + } + return false; + } + } + function typeCouldHaveTopLevelSingletonTypes(type3) { + if (type3.flags & 16) { + return false; + } + if (type3.flags & 3145728) { + return !!ts2.forEach(type3.types, typeCouldHaveTopLevelSingletonTypes); + } + if (type3.flags & 465829888) { + var constraint = getConstraintOfType(type3); + if (constraint && constraint !== type3) { + return typeCouldHaveTopLevelSingletonTypes(constraint); + } + } + return isUnitType(type3) || !!(type3.flags & 134217728) || !!(type3.flags & 268435456); + } + function getExactOptionalUnassignableProperties(source, target) { + if (isTupleType(source) && isTupleType(target)) + return ts2.emptyArray; + return getPropertiesOfType(target).filter(function(targetProp) { + return isExactOptionalPropertyMismatch(getTypeOfPropertyOfType(source, targetProp.escapedName), getTypeOfSymbol(targetProp)); + }); + } + function isExactOptionalPropertyMismatch(source, target) { + return !!source && !!target && maybeTypeOfKind( + source, + 32768 + /* TypeFlags.Undefined */ + ) && !!containsMissingType(target); + } + function getExactOptionalProperties(type3) { + return getPropertiesOfType(type3).filter(function(targetProp) { + return containsMissingType(getTypeOfSymbol(targetProp)); + }); + } + function getBestMatchingType(source, target, isRelatedTo) { + if (isRelatedTo === void 0) { + isRelatedTo = compareTypesAssignable; + } + return findMatchingDiscriminantType( + source, + target, + isRelatedTo, + /*skipPartial*/ + true + ) || findMatchingTypeReferenceOrTypeAliasReference(source, target) || findBestTypeForObjectLiteral(source, target) || findBestTypeForInvokable(source, target) || findMostOverlappyType(source, target); + } + function discriminateTypeByDiscriminableItems(target, discriminators, related, defaultValue, skipPartial) { + var discriminable = target.types.map(function(_6) { + return void 0; + }); + for (var _i = 0, discriminators_1 = discriminators; _i < discriminators_1.length; _i++) { + var _a2 = discriminators_1[_i], getDiscriminatingType = _a2[0], propertyName = _a2[1]; + var targetProp = getUnionOrIntersectionProperty(target, propertyName); + if (skipPartial && targetProp && ts2.getCheckFlags(targetProp) & 16) { + continue; + } + var i7 = 0; + for (var _b = 0, _c = target.types; _b < _c.length; _b++) { + var type3 = _c[_b]; + var targetType = getTypeOfPropertyOfType(type3, propertyName); + if (targetType && related(getDiscriminatingType(), targetType)) { + discriminable[i7] = discriminable[i7] === void 0 ? true : discriminable[i7]; + } else { + discriminable[i7] = false; + } + i7++; + } + } + var match = discriminable.indexOf( + /*searchElement*/ + true + ); + if (match === -1) { + return defaultValue; + } + var nextMatch = discriminable.indexOf( + /*searchElement*/ + true, + match + 1 + ); + while (nextMatch !== -1) { + if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) { + return defaultValue; + } + nextMatch = discriminable.indexOf( + /*searchElement*/ + true, + nextMatch + 1 + ); + } + return target.types[match]; + } + function isWeakType(type3) { + if (type3.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type3); + return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 && resolved.indexInfos.length === 0 && resolved.properties.length > 0 && ts2.every(resolved.properties, function(p7) { + return !!(p7.flags & 16777216); + }); + } + if (type3.flags & 2097152) { + return ts2.every(type3.types, isWeakType); + } + return false; + } + function hasCommonProperties(source, target, isComparingJsxAttributes) { + for (var _i = 0, _a2 = getPropertiesOfType(source); _i < _a2.length; _i++) { + var prop = _a2[_i]; + if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { + return true; + } + } + return false; + } + function getVariances(type3) { + return type3 === globalArrayType || type3 === globalReadonlyArrayType || type3.objectFlags & 8 ? arrayVariances : getVariancesWorker(type3.symbol, type3.typeParameters); + } + function getAliasVariances(symbol) { + return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters); + } + function getVariancesWorker(symbol, typeParameters) { + if (typeParameters === void 0) { + typeParameters = ts2.emptyArray; + } + var links = getSymbolLinks(symbol); + if (!links.variances) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) }); + links.variances = ts2.emptyArray; + var variances = []; + var _loop_23 = function(tp2) { + var modifiers = getVarianceModifiers(tp2); + var variance = modifiers & 65536 ? modifiers & 32768 ? 0 : 1 : modifiers & 32768 ? 2 : void 0; + if (variance === void 0) { + var unmeasurable_1 = false; + var unreliable_1 = false; + var oldHandler = outofbandVarianceMarkerHandler; + outofbandVarianceMarkerHandler = function(onlyUnreliable) { + return onlyUnreliable ? unreliable_1 = true : unmeasurable_1 = true; + }; + var typeWithSuper = createMarkerType(symbol, tp2, markerSuperType); + var typeWithSub = createMarkerType(symbol, tp2, markerSubType); + variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 : 0) | (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 : 0); + if (variance === 3 && isTypeAssignableTo(createMarkerType(symbol, tp2, markerOtherType), typeWithSuper)) { + variance = 4; + } + outofbandVarianceMarkerHandler = oldHandler; + if (unmeasurable_1 || unreliable_1) { + if (unmeasurable_1) { + variance |= 8; + } + if (unreliable_1) { + variance |= 16; + } + } + } + variances.push(variance); + }; + for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) { + var tp = typeParameters_2[_i]; + _loop_23(tp); + } + links.variances = variances; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop({ variances: variances.map(ts2.Debug.formatVariance) }); + } + return links.variances; + } + function createMarkerType(symbol, source, target) { + var mapper = makeUnaryTypeMapper(source, target); + var type3 = getDeclaredTypeOfSymbol(symbol); + if (isErrorType(type3)) { + return type3; + } + var result2 = symbol.flags & 524288 ? getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper)) : createTypeReference(type3, instantiateTypes(type3.typeParameters, mapper)); + markerTypes.add(getTypeId(result2)); + return result2; + } + function isMarkerType(type3) { + return markerTypes.has(getTypeId(type3)); + } + function getVarianceModifiers(tp) { + var _a2, _b; + return (ts2.some((_a2 = tp.symbol) === null || _a2 === void 0 ? void 0 : _a2.declarations, function(d7) { + return ts2.hasSyntacticModifier( + d7, + 32768 + /* ModifierFlags.In */ + ); + }) ? 32768 : 0) | (ts2.some((_b = tp.symbol) === null || _b === void 0 ? void 0 : _b.declarations, function(d7) { + return ts2.hasSyntacticModifier( + d7, + 65536 + /* ModifierFlags.Out */ + ); + }) ? 65536 : 0); + } + function hasCovariantVoidArgument(typeArguments, variances) { + for (var i7 = 0; i7 < variances.length; i7++) { + if ((variances[i7] & 7) === 1 && typeArguments[i7].flags & 16384) { + return true; + } + } + return false; + } + function isUnconstrainedTypeParameter(type3) { + return type3.flags & 262144 && !getConstraintOfTypeParameter(type3); + } + function isNonDeferredTypeReference(type3) { + return !!(ts2.getObjectFlags(type3) & 4) && !type3.node; + } + function isTypeReferenceWithGenericArguments(type3) { + return isNonDeferredTypeReference(type3) && ts2.some(getTypeArguments(type3), function(t8) { + return !!(t8.flags & 262144) || isTypeReferenceWithGenericArguments(t8); + }); + } + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix); + function getTypeReferenceId(type3, depth) { + if (depth === void 0) { + depth = 0; + } + var result2 = "" + type3.target.id; + for (var _i = 0, _a2 = getTypeArguments(type3); _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (t8.flags & 262144) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t8)) { + var index4 = typeParameters.indexOf(t8); + if (index4 < 0) { + index4 = typeParameters.length; + typeParameters.push(t8); + } + result2 += "=" + index4; + continue; + } + constraintMarker = "*"; + } else if (depth < 4 && isTypeReferenceWithGenericArguments(t8)) { + result2 += "<" + getTypeReferenceId(t8, depth + 1) + ">"; + continue; + } + result2 += "-" + t8.id; + } + return result2; + } + } + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { + if (relation === identityRelation && source.id > target.id) { + var temp = source; + source = target; + target = temp; + } + var postFix = intersectionState ? ":" + intersectionState : ""; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : "".concat(source.id, ",").concat(target.id).concat(postFix); + } + function forEachProperty(prop, callback) { + if (ts2.getCheckFlags(prop) & 6) { + for (var _i = 0, _a2 = prop.containingType.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + var p7 = getPropertyOfType(t8, prop.escapedName); + var result2 = p7 && forEachProperty(p7, callback); + if (result2) { + return result2; + } + } + return void 0; + } + return callback(prop); + } + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : void 0; + } + function getTypeOfPropertyInBaseClass(property2) { + var classType = getDeclaringClass(property2); + var baseClassType = classType && getBaseTypes(classType)[0]; + return baseClassType && getTypeOfPropertyOfType(baseClassType, property2.escapedName); + } + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty(prop, function(sp) { + var sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty(targetProp, function(tp) { + return ts2.getDeclarationModifierFlagsFromSymbol(tp) & 16 ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false; + }); + } + function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) { + return forEachProperty(prop, function(p7) { + return ts2.getDeclarationModifierFlagsFromSymbol(p7, writing) & 16 ? !hasBaseType(checkClass, getDeclaringClass(p7)) : false; + }) ? void 0 : checkClass; + } + function isDeeplyNestedType(type3, stack, depth, maxDepth) { + if (maxDepth === void 0) { + maxDepth = 3; + } + if (depth >= maxDepth) { + var identity_2 = getRecursionIdentity(type3); + var count2 = 0; + var lastTypeId = 0; + for (var i7 = 0; i7 < depth; i7++) { + var t8 = stack[i7]; + if (getRecursionIdentity(t8) === identity_2) { + if (t8.id >= lastTypeId) { + count2++; + if (count2 >= maxDepth) { + return true; + } + } + lastTypeId = t8.id; + } + } + } + return false; + } + function getRecursionIdentity(type3) { + if (type3.flags & 524288 && !isObjectOrArrayLiteralType(type3)) { + if (ts2.getObjectFlags(type3) && 4 && type3.node) { + return type3.node; + } + if (type3.symbol && !(ts2.getObjectFlags(type3) & 16 && type3.symbol.flags & 32)) { + return type3.symbol; + } + if (isTupleType(type3)) { + return type3.target; + } + } + if (type3.flags & 262144) { + return type3.symbol; + } + if (type3.flags & 8388608) { + do { + type3 = type3.objectType; + } while (type3.flags & 8388608); + return type3; + } + if (type3.flags & 16777216) { + return type3.root; + } + return type3; + } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties(sourceProp, targetProp, compareTypesIdentical) !== 0; + } + function compareProperties(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1; + } + var sourcePropAccessibility = ts2.getDeclarationModifierFlagsFromSymbol(sourceProp) & 24; + var targetPropAccessibility = ts2.getDeclarationModifierFlagsFromSymbol(targetProp) & 24; + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0; + } + } else { + if ((sourceProp.flags & 16777216) !== (targetProp.flags & 16777216)) { + return 0; + } + } + if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) { + return 0; + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + function isMatchingSignature(source, target, partialMatch) { + var sourceParameterCount = getParameterCount(source); + var targetParameterCount = getParameterCount(target); + var sourceMinArgumentCount = getMinArgumentCount(source); + var targetMinArgumentCount = getMinArgumentCount(target); + var sourceHasRestParameter = hasEffectiveRestParameter(source); + var targetHasRestParameter = hasEffectiveRestParameter(target); + if (sourceParameterCount === targetParameterCount && sourceMinArgumentCount === targetMinArgumentCount && sourceHasRestParameter === targetHasRestParameter) { + return true; + } + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { + return true; + } + return false; + } + function compareSignaturesIdentical(source, target, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypes) { + if (source === target) { + return -1; + } + if (!isMatchingSignature(source, target, partialMatch)) { + return 0; + } + if (ts2.length(source.typeParameters) !== ts2.length(target.typeParameters)) { + return 0; + } + if (target.typeParameters) { + var mapper = createTypeMapper(source.typeParameters, target.typeParameters); + for (var i7 = 0; i7 < target.typeParameters.length; i7++) { + var s7 = source.typeParameters[i7]; + var t8 = target.typeParameters[i7]; + if (!(s7 === t8 || compareTypes(instantiateType(getConstraintFromTypeParameter(s7), mapper) || unknownType2, getConstraintFromTypeParameter(t8) || unknownType2) && compareTypes(instantiateType(getDefaultFromTypeParameter(s7), mapper) || unknownType2, getDefaultFromTypeParameter(t8) || unknownType2))) { + return 0; + } + } + source = instantiateSignature( + source, + mapper, + /*eraseTypeParameters*/ + true + ); + } + var result2 = -1; + if (!ignoreThisTypes) { + var sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType) { + var targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + var related = compareTypes(sourceThisType, targetThisType); + if (!related) { + return 0; + } + result2 &= related; + } + } + } + var targetLen = getParameterCount(target); + for (var i7 = 0; i7 < targetLen; i7++) { + var s7 = getTypeAtPosition(source, i7); + var t8 = getTypeAtPosition(target, i7); + var related = compareTypes(t8, s7); + if (!related) { + return 0; + } + result2 &= related; + } + if (!ignoreReturnTypes) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result2 &= sourceTypePredicate || targetTypePredicate ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result2; + } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return !(source && target && typePredicateKindsMatch(source, target)) ? 0 : source.type === target.type ? -1 : source.type && target.type ? compareTypes(source.type, target.type) : 0; + } + function literalTypesWithSameBaseType(types3) { + var commonBaseType; + for (var _i = 0, types_13 = types3; _i < types_13.length; _i++) { + var t8 = types_13[_i]; + if (!(t8.flags & 131072)) { + var baseType = getBaseTypeOfLiteralType(t8); + commonBaseType !== null && commonBaseType !== void 0 ? commonBaseType : commonBaseType = baseType; + if (baseType === t8 || baseType !== commonBaseType) { + return false; + } + } + } + return true; + } + function getCombinedTypeFlags(types3) { + return ts2.reduceLeft(types3, function(flags, t8) { + return flags | (t8.flags & 1048576 ? getCombinedTypeFlags(t8.types) : t8.flags); + }, 0); + } + function getCommonSupertype(types3) { + if (types3.length === 1) { + return types3[0]; + } + var primaryTypes = strictNullChecks ? ts2.sameMap(types3, function(t8) { + return filterType(t8, function(u7) { + return !(u7.flags & 98304); + }); + }) : types3; + var superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : ts2.reduceLeft(primaryTypes, function(s7, t8) { + return isTypeSubtypeOf(s7, t8) ? t8 : s7; + }); + return primaryTypes === types3 ? superTypeOrUnion : getNullableType( + superTypeOrUnion, + getCombinedTypeFlags(types3) & 98304 + /* TypeFlags.Nullable */ + ); + } + function getCommonSubtype(types3) { + return ts2.reduceLeft(types3, function(s7, t8) { + return isTypeSubtypeOf(t8, s7) ? t8 : s7; + }); + } + function isArrayType(type3) { + return !!(ts2.getObjectFlags(type3) & 4) && (type3.target === globalArrayType || type3.target === globalReadonlyArrayType); + } + function isReadonlyArrayType(type3) { + return !!(ts2.getObjectFlags(type3) & 4) && type3.target === globalReadonlyArrayType; + } + function isArrayOrTupleType(type3) { + return isArrayType(type3) || isTupleType(type3); + } + function isMutableArrayOrTuple(type3) { + return isArrayType(type3) && !isReadonlyArrayType(type3) || isTupleType(type3) && !type3.target.readonly; + } + function getElementTypeOfArrayType(type3) { + return isArrayType(type3) ? getTypeArguments(type3)[0] : void 0; + } + function isArrayLikeType(type3) { + return isArrayType(type3) || !(type3.flags & 98304) && isTypeAssignableTo(type3, anyReadonlyArrayType); + } + function getSingleBaseForNonAugmentingSubtype(type3) { + if (!(ts2.getObjectFlags(type3) & 4) || !(ts2.getObjectFlags(type3.target) & 3)) { + return void 0; + } + if (ts2.getObjectFlags(type3) & 33554432) { + return ts2.getObjectFlags(type3) & 67108864 ? type3.cachedEquivalentBaseType : void 0; + } + type3.objectFlags |= 33554432; + var target = type3.target; + if (ts2.getObjectFlags(target) & 1) { + var baseTypeNode = getBaseTypeNodeOfClass(target); + if (baseTypeNode && baseTypeNode.expression.kind !== 79 && baseTypeNode.expression.kind !== 208) { + return void 0; + } + } + var bases = getBaseTypes(target); + if (bases.length !== 1) { + return void 0; + } + if (getMembersOfSymbol(type3.symbol).size) { + return void 0; + } + var instantiatedBase = !ts2.length(target.typeParameters) ? bases[0] : instantiateType(bases[0], createTypeMapper(target.typeParameters, getTypeArguments(type3).slice(0, target.typeParameters.length))); + if (ts2.length(getTypeArguments(type3)) > ts2.length(target.typeParameters)) { + instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts2.last(getTypeArguments(type3))); + } + type3.objectFlags |= 67108864; + return type3.cachedEquivalentBaseType = instantiatedBase; + } + function isEmptyLiteralType(type3) { + return strictNullChecks ? type3 === implicitNeverType : type3 === undefinedWideningType; + } + function isEmptyArrayLiteralType(type3) { + var elementType = getElementTypeOfArrayType(type3); + return !!elementType && isEmptyLiteralType(elementType); + } + function isTupleLikeType(type3) { + return isTupleType(type3) || !!getPropertyOfType(type3, "0"); + } + function isArrayOrTupleLikeType(type3) { + return isArrayLikeType(type3) || isTupleLikeType(type3); + } + function getTupleElementType(type3, index4) { + var propType = getTypeOfPropertyOfType(type3, "" + index4); + if (propType) { + return propType; + } + if (everyType(type3, isTupleType)) { + return mapType2(type3, function(t8) { + return getRestTypeOfTupleType(t8) || undefinedType2; + }); + } + return void 0; + } + function isNeitherUnitTypeNorNever(type3) { + return !(type3.flags & (109440 | 131072)); + } + function isUnitType(type3) { + return !!(type3.flags & 109440); + } + function isUnitLikeType(type3) { + var t8 = getBaseConstraintOrType(type3); + return t8.flags & 2097152 ? ts2.some(t8.types, isUnitType) : isUnitType(t8); + } + function extractUnitType(type3) { + return type3.flags & 2097152 ? ts2.find(type3.types, isUnitType) || type3 : type3; + } + function isLiteralType(type3) { + return type3.flags & 16 ? true : type3.flags & 1048576 ? type3.flags & 1024 ? true : ts2.every(type3.types, isUnitType) : isUnitType(type3); + } + function getBaseTypeOfLiteralType(type3) { + return type3.flags & 1024 ? getBaseTypeOfEnumLiteralType(type3) : type3.flags & (128 | 134217728 | 268435456) ? stringType2 : type3.flags & 256 ? numberType2 : type3.flags & 2048 ? bigintType : type3.flags & 512 ? booleanType2 : type3.flags & 1048576 ? getBaseTypeOfLiteralTypeUnion(type3) : type3; + } + function getBaseTypeOfLiteralTypeUnion(type3) { + var _a2; + var key = "B".concat(getTypeId(type3)); + return (_a2 = getCachedType(key)) !== null && _a2 !== void 0 ? _a2 : setCachedType(key, mapType2(type3, getBaseTypeOfLiteralType)); + } + function getWidenedLiteralType(type3) { + return type3.flags & 1024 && isFreshLiteralType(type3) ? getBaseTypeOfEnumLiteralType(type3) : type3.flags & 128 && isFreshLiteralType(type3) ? stringType2 : type3.flags & 256 && isFreshLiteralType(type3) ? numberType2 : type3.flags & 2048 && isFreshLiteralType(type3) ? bigintType : type3.flags & 512 && isFreshLiteralType(type3) ? booleanType2 : type3.flags & 1048576 ? mapType2(type3, getWidenedLiteralType) : type3; + } + function getWidenedUniqueESSymbolType(type3) { + return type3.flags & 8192 ? esSymbolType : type3.flags & 1048576 ? mapType2(type3, getWidenedUniqueESSymbolType) : type3; + } + function getWidenedLiteralLikeTypeForContextualType(type3, contextualType) { + if (!isLiteralOfContextualType(type3, contextualType)) { + type3 = getWidenedUniqueESSymbolType(getWidenedLiteralType(type3)); + } + return getRegularTypeOfLiteralType(type3); + } + function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type3, contextualSignatureReturnType, isAsync2) { + if (type3 && isUnitType(type3)) { + var contextualType = !contextualSignatureReturnType ? void 0 : isAsync2 ? getPromisedTypeOfPromise(contextualSignatureReturnType) : contextualSignatureReturnType; + type3 = getWidenedLiteralLikeTypeForContextualType(type3, contextualType); + } + return type3; + } + function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(type3, contextualSignatureReturnType, kind, isAsyncGenerator) { + if (type3 && isUnitType(type3)) { + var contextualType = !contextualSignatureReturnType ? void 0 : getIterationTypeOfGeneratorFunctionReturnType(kind, contextualSignatureReturnType, isAsyncGenerator); + type3 = getWidenedLiteralLikeTypeForContextualType(type3, contextualType); + } + return type3; + } + function isTupleType(type3) { + return !!(ts2.getObjectFlags(type3) & 4 && type3.target.objectFlags & 8); + } + function isGenericTupleType(type3) { + return isTupleType(type3) && !!(type3.target.combinedFlags & 8); + } + function isSingleElementGenericTupleType(type3) { + return isGenericTupleType(type3) && type3.target.elementFlags.length === 1; + } + function getRestTypeOfTupleType(type3) { + return getElementTypeOfSliceOfTupleType(type3, type3.target.fixedLength); + } + function getRestArrayTypeOfTupleType(type3) { + var restType = getRestTypeOfTupleType(type3); + return restType && createArrayType(restType); + } + function getElementTypeOfSliceOfTupleType(type3, index4, endSkipCount, writing) { + if (endSkipCount === void 0) { + endSkipCount = 0; + } + if (writing === void 0) { + writing = false; + } + var length = getTypeReferenceArity(type3) - endSkipCount; + if (index4 < length) { + var typeArguments = getTypeArguments(type3); + var elementTypes = []; + for (var i7 = index4; i7 < length; i7++) { + var t8 = typeArguments[i7]; + elementTypes.push(type3.target.elementFlags[i7] & 8 ? getIndexedAccessType(t8, numberType2) : t8); + } + return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes); + } + return void 0; + } + function isTupleTypeStructureMatching(t1, t22) { + return getTypeReferenceArity(t1) === getTypeReferenceArity(t22) && ts2.every(t1.target.elementFlags, function(f8, i7) { + return (f8 & 12) === (t22.target.elementFlags[i7] & 12); + }); + } + function isZeroBigInt(_a2) { + var value2 = _a2.value; + return value2.base10Value === "0"; + } + function removeDefinitelyFalsyTypes(type3) { + return filterType(type3, function(t8) { + return !!(getTypeFacts(t8) & 4194304); + }); + } + function extractDefinitelyFalsyTypes(type3) { + return mapType2(type3, getDefinitelyFalsyPartOfType); + } + function getDefinitelyFalsyPartOfType(type3) { + return type3.flags & 4 ? emptyStringType : type3.flags & 8 ? zeroType : type3.flags & 64 ? zeroBigIntType : type3 === regularFalseType || type3 === falseType || type3.flags & (16384 | 32768 | 65536 | 3) || type3.flags & 128 && type3.value === "" || type3.flags & 256 && type3.value === 0 || type3.flags & 2048 && isZeroBigInt(type3) ? type3 : neverType2; + } + function getNullableType(type3, flags) { + var missing = flags & ~type3.flags & (32768 | 65536); + return missing === 0 ? type3 : missing === 32768 ? getUnionType([type3, undefinedType2]) : missing === 65536 ? getUnionType([type3, nullType2]) : getUnionType([type3, undefinedType2, nullType2]); + } + function getOptionalType(type3, isProperty) { + if (isProperty === void 0) { + isProperty = false; + } + ts2.Debug.assert(strictNullChecks); + var missingOrUndefined = isProperty ? missingType : undefinedType2; + return type3.flags & 32768 || type3.flags & 1048576 && type3.types[0] === missingOrUndefined ? type3 : getUnionType([type3, missingOrUndefined]); + } + function getGlobalNonNullableTypeInstantiation(type3) { + if (!deferredGlobalNonNullableTypeAlias) { + deferredGlobalNonNullableTypeAlias = getGlobalSymbol( + "NonNullable", + 524288, + /*diagnostic*/ + void 0 + ) || unknownSymbol; + } + return deferredGlobalNonNullableTypeAlias !== unknownSymbol ? getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type3]) : getIntersectionType([type3, emptyObjectType]); + } + function getNonNullableType(type3) { + return strictNullChecks ? getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ) : type3; + } + function addOptionalTypeMarker(type3) { + return strictNullChecks ? getUnionType([type3, optionalType2]) : type3; + } + function removeOptionalTypeMarker(type3) { + return strictNullChecks ? removeType(type3, optionalType2) : type3; + } + function propagateOptionalTypeMarker(type3, node, wasOptional) { + return wasOptional ? ts2.isOutermostOptionalChain(node) ? getOptionalType(type3) : addOptionalTypeMarker(type3) : type3; + } + function getOptionalExpressionType(exprType, expression) { + return ts2.isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) : ts2.isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) : exprType; + } + function removeMissingType(type3, isOptional2) { + return exactOptionalPropertyTypes && isOptional2 ? removeType(type3, missingType) : type3; + } + function containsMissingType(type3) { + return exactOptionalPropertyTypes && (type3 === missingType || type3.flags & 1048576 && containsType(type3.types, missingType)); + } + function removeMissingOrUndefinedType(type3) { + return exactOptionalPropertyTypes ? removeType(type3, missingType) : getTypeWithFacts( + type3, + 524288 + /* TypeFacts.NEUndefined */ + ); + } + function isCoercibleUnderDoubleEquals(source, target) { + return (source.flags & (8 | 4 | 512)) !== 0 && (target.flags & (8 | 4 | 16)) !== 0; + } + function isObjectTypeWithInferableIndex(type3) { + var objectFlags = ts2.getObjectFlags(type3); + return type3.flags & 2097152 ? ts2.every(type3.types, isObjectTypeWithInferableIndex) : !!(type3.symbol && (type3.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0 && !(type3.symbol.flags & 32) && !typeHasCallOrConstructSignatures(type3)) || !!(objectFlags & 4194304) || !!(objectFlags & 1024 && isObjectTypeWithInferableIndex(type3.source)); + } + function createSymbolWithType(source, type3) { + var symbol = createSymbol( + source.flags, + source.escapedName, + ts2.getCheckFlags(source) & 8 + /* CheckFlags.Readonly */ + ); + symbol.declarations = source.declarations; + symbol.parent = source.parent; + symbol.type = type3; + symbol.target = source; + if (source.valueDeclaration) { + symbol.valueDeclaration = source.valueDeclaration; + } + var nameType = getSymbolLinks(source).nameType; + if (nameType) { + symbol.nameType = nameType; + } + return symbol; + } + function transformTypeOfMembers(type3, f8) { + var members = ts2.createSymbolTable(); + for (var _i = 0, _a2 = getPropertiesOfObjectType(type3); _i < _a2.length; _i++) { + var property2 = _a2[_i]; + var original = getTypeOfSymbol(property2); + var updated = f8(original); + members.set(property2.escapedName, updated === original ? property2 : createSymbolWithType(property2, updated)); + } + return members; + } + function getRegularTypeOfObjectLiteral(type3) { + if (!(isObjectLiteralType(type3) && ts2.getObjectFlags(type3) & 8192)) { + return type3; + } + var regularType = type3.regularType; + if (regularType) { + return regularType; + } + var resolved = type3; + var members = transformTypeOfMembers(type3, getRegularTypeOfObjectLiteral); + var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos); + regularNew.flags = resolved.flags; + regularNew.objectFlags |= resolved.objectFlags & ~8192; + type3.regularType = regularNew; + return regularNew; + } + function createWideningContext(parent2, propertyName, siblings) { + return { parent: parent2, propertyName, siblings, resolvedProperties: void 0 }; + } + function getSiblingsOfContext(context2) { + if (!context2.siblings) { + var siblings_1 = []; + for (var _i = 0, _a2 = getSiblingsOfContext(context2.parent); _i < _a2.length; _i++) { + var type3 = _a2[_i]; + if (isObjectLiteralType(type3)) { + var prop = getPropertyOfObjectType(type3, context2.propertyName); + if (prop) { + forEachType(getTypeOfSymbol(prop), function(t8) { + siblings_1.push(t8); + }); + } + } + } + context2.siblings = siblings_1; + } + return context2.siblings; + } + function getPropertiesOfContext(context2) { + if (!context2.resolvedProperties) { + var names = new ts2.Map(); + for (var _i = 0, _a2 = getSiblingsOfContext(context2); _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (isObjectLiteralType(t8) && !(ts2.getObjectFlags(t8) & 2097152)) { + for (var _b = 0, _c = getPropertiesOfType(t8); _b < _c.length; _b++) { + var prop = _c[_b]; + names.set(prop.escapedName, prop); + } + } + } + context2.resolvedProperties = ts2.arrayFrom(names.values()); + } + return context2.resolvedProperties; + } + function getWidenedProperty(prop, context2) { + if (!(prop.flags & 4)) { + return prop; + } + var original = getTypeOfSymbol(prop); + var propContext = context2 && createWideningContext( + context2, + prop.escapedName, + /*siblings*/ + void 0 + ); + var widened = getWidenedTypeWithContext(original, propContext); + return widened === original ? prop : createSymbolWithType(prop, widened); + } + function getUndefinedProperty(prop) { + var cached = undefinedProperties.get(prop.escapedName); + if (cached) { + return cached; + } + var result2 = createSymbolWithType(prop, missingType); + result2.flags |= 16777216; + undefinedProperties.set(prop.escapedName, result2); + return result2; + } + function getWidenedTypeOfObjectLiteral(type3, context2) { + var members = ts2.createSymbolTable(); + for (var _i = 0, _a2 = getPropertiesOfObjectType(type3); _i < _a2.length; _i++) { + var prop = _a2[_i]; + members.set(prop.escapedName, getWidenedProperty(prop, context2)); + } + if (context2) { + for (var _b = 0, _c = getPropertiesOfContext(context2); _b < _c.length; _b++) { + var prop = _c[_b]; + if (!members.has(prop.escapedName)) { + members.set(prop.escapedName, getUndefinedProperty(prop)); + } + } + } + var result2 = createAnonymousType(type3.symbol, members, ts2.emptyArray, ts2.emptyArray, ts2.sameMap(getIndexInfosOfType(type3), function(info2) { + return createIndexInfo(info2.keyType, getWidenedType(info2.type), info2.isReadonly); + })); + result2.objectFlags |= ts2.getObjectFlags(type3) & (4096 | 262144); + return result2; + } + function getWidenedType(type3) { + return getWidenedTypeWithContext( + type3, + /*context*/ + void 0 + ); + } + function getWidenedTypeWithContext(type3, context2) { + if (ts2.getObjectFlags(type3) & 196608) { + if (context2 === void 0 && type3.widened) { + return type3.widened; + } + var result2 = void 0; + if (type3.flags & (1 | 98304)) { + result2 = anyType2; + } else if (isObjectLiteralType(type3)) { + result2 = getWidenedTypeOfObjectLiteral(type3, context2); + } else if (type3.flags & 1048576) { + var unionContext_1 = context2 || createWideningContext( + /*parent*/ + void 0, + /*propertyName*/ + void 0, + type3.types + ); + var widenedTypes = ts2.sameMap(type3.types, function(t8) { + return t8.flags & 98304 ? t8 : getWidenedTypeWithContext(t8, unionContext_1); + }); + result2 = getUnionType( + widenedTypes, + ts2.some(widenedTypes, isEmptyObjectType) ? 2 : 1 + /* UnionReduction.Literal */ + ); + } else if (type3.flags & 2097152) { + result2 = getIntersectionType(ts2.sameMap(type3.types, getWidenedType)); + } else if (isArrayOrTupleType(type3)) { + result2 = createTypeReference(type3.target, ts2.sameMap(getTypeArguments(type3), getWidenedType)); + } + if (result2 && context2 === void 0) { + type3.widened = result2; + } + return result2 || type3; + } + return type3; + } + function reportWideningErrorsInType(type3) { + var errorReported = false; + if (ts2.getObjectFlags(type3) & 65536) { + if (type3.flags & 1048576) { + if (ts2.some(type3.types, isEmptyObjectType)) { + errorReported = true; + } else { + for (var _i = 0, _a2 = type3.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (reportWideningErrorsInType(t8)) { + errorReported = true; + } + } + } + } + if (isArrayOrTupleType(type3)) { + for (var _b = 0, _c = getTypeArguments(type3); _b < _c.length; _b++) { + var t8 = _c[_b]; + if (reportWideningErrorsInType(t8)) { + errorReported = true; + } + } + } + if (isObjectLiteralType(type3)) { + for (var _d = 0, _e2 = getPropertiesOfObjectType(type3); _d < _e2.length; _d++) { + var p7 = _e2[_d]; + var t8 = getTypeOfSymbol(p7); + if (ts2.getObjectFlags(t8) & 65536) { + if (!reportWideningErrorsInType(t8)) { + error2(p7.valueDeclaration, ts2.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString2(p7), typeToString(getWidenedType(t8))); + } + errorReported = true; + } + } + } + } + return errorReported; + } + function reportImplicitAny(declaration, type3, wideningKind) { + var typeAsString = typeToString(getWidenedType(type3)); + if (ts2.isInJSFile(declaration) && !ts2.isCheckJsEnabledForFile(ts2.getSourceFileOfNode(declaration), compilerOptions)) { + return; + } + var diagnostic; + switch (declaration.kind) { + case 223: + case 169: + case 168: + diagnostic = noImplicitAny ? ts2.Diagnostics.Member_0_implicitly_has_an_1_type : ts2.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + break; + case 166: + var param = declaration; + if (ts2.isIdentifier(param.name) && (ts2.isCallSignatureDeclaration(param.parent) || ts2.isMethodSignature(param.parent) || ts2.isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName( + param, + param.name.escapedText, + 788968, + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || param.name.originalKeywordKind && ts2.isTypeNodeKind(param.name.originalKeywordKind))) { + var newName = "arg" + param.parent.parameters.indexOf(param); + var typeName = ts2.declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, ts2.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } + diagnostic = declaration.dotDotDotToken ? noImplicitAny ? ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type : ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + break; + case 205: + diagnostic = ts2.Diagnostics.Binding_element_0_implicitly_has_an_1_type; + if (!noImplicitAny) { + return; + } + break; + case 320: + error2(declaration, ts2.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + return; + case 259: + case 171: + case 170: + case 174: + case 175: + case 215: + case 216: + if (noImplicitAny && !declaration.name) { + if (wideningKind === 3) { + error2(declaration, ts2.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); + } else { + error2(declaration, ts2.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + } + return; + } + diagnostic = !noImplicitAny ? ts2.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 ? ts2.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : ts2.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + break; + case 197: + if (noImplicitAny) { + error2(declaration, ts2.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + } + return; + default: + diagnostic = noImplicitAny ? ts2.Diagnostics.Variable_0_implicitly_has_an_1_type : ts2.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + } + errorOrSuggestion(noImplicitAny, declaration, diagnostic, ts2.declarationNameToString(ts2.getNameOfDeclaration(declaration)), typeAsString); + } + function reportErrorsFromWidening(declaration, type3, wideningKind) { + addLazyDiagnostic(function() { + if (noImplicitAny && ts2.getObjectFlags(type3) & 65536 && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) { + if (!reportWideningErrorsInType(type3)) { + reportImplicitAny(declaration, type3, wideningKind); + } + } + }); + } + function applyToParameterTypes(source, target, callback) { + var sourceCount = getParameterCount(source); + var targetCount = getParameterCount(target); + var sourceRestType = getEffectiveRestType(source); + var targetRestType = getEffectiveRestType(target); + var targetNonRestCount = targetRestType ? targetCount - 1 : targetCount; + var paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount); + var sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType) { + var targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + callback(sourceThisType, targetThisType); + } + } + for (var i7 = 0; i7 < paramCount; i7++) { + callback(getTypeAtPosition(source, i7), getTypeAtPosition(target, i7)); + } + if (targetRestType) { + callback(getRestTypeAtPosition(source, paramCount), targetRestType); + } + } + function applyToReturnTypes(source, target, callback) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) { + callback(sourceTypePredicate.type, targetTypePredicate.type); + } else { + callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + } + function createInferenceContext(typeParameters, signature, flags, compareTypes) { + return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable); + } + function cloneInferenceContext(context2, extraFlags) { + if (extraFlags === void 0) { + extraFlags = 0; + } + return context2 && createInferenceContextWorker(ts2.map(context2.inferences, cloneInferenceInfo), context2.signature, context2.flags | extraFlags, context2.compareTypes); + } + function createInferenceContextWorker(inferences, signature, flags, compareTypes) { + var context2 = { + inferences, + signature, + flags, + compareTypes, + mapper: reportUnmeasurableMapper, + nonFixingMapper: reportUnmeasurableMapper + }; + context2.mapper = makeFixingMapperForContext(context2); + context2.nonFixingMapper = makeNonFixingMapperForContext(context2); + return context2; + } + function makeFixingMapperForContext(context2) { + return makeDeferredTypeMapper(ts2.map(context2.inferences, function(i7) { + return i7.typeParameter; + }), ts2.map(context2.inferences, function(inference, i7) { + return function() { + if (!inference.isFixed) { + inferFromIntraExpressionSites(context2); + clearCachedInferences(context2.inferences); + inference.isFixed = true; + } + return getInferredType(context2, i7); + }; + })); + } + function makeNonFixingMapperForContext(context2) { + return makeDeferredTypeMapper(ts2.map(context2.inferences, function(i7) { + return i7.typeParameter; + }), ts2.map(context2.inferences, function(_6, i7) { + return function() { + return getInferredType(context2, i7); + }; + })); + } + function clearCachedInferences(inferences) { + for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) { + var inference = inferences_1[_i]; + if (!inference.isFixed) { + inference.inferredType = void 0; + } + } + } + function addIntraExpressionInferenceSite(context2, node, type3) { + var _a2; + ((_a2 = context2.intraExpressionInferenceSites) !== null && _a2 !== void 0 ? _a2 : context2.intraExpressionInferenceSites = []).push({ node, type: type3 }); + } + function inferFromIntraExpressionSites(context2) { + if (context2.intraExpressionInferenceSites) { + for (var _i = 0, _a2 = context2.intraExpressionInferenceSites; _i < _a2.length; _i++) { + var _b = _a2[_i], node = _b.node, type3 = _b.type; + var contextualType = node.kind === 171 ? getContextualTypeForObjectLiteralMethod( + node, + 2 + /* ContextFlags.NoConstraints */ + ) : getContextualType( + node, + 2 + /* ContextFlags.NoConstraints */ + ); + if (contextualType) { + inferTypes(context2.inferences, type3, contextualType); + } + } + context2.intraExpressionInferenceSites = void 0; + } + } + function createInferenceInfo(typeParameter) { + return { + typeParameter, + candidates: void 0, + contraCandidates: void 0, + inferredType: void 0, + priority: void 0, + topLevel: true, + isFixed: false, + impliedArity: void 0 + }; + } + function cloneInferenceInfo(inference) { + return { + typeParameter: inference.typeParameter, + candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), + inferredType: inference.inferredType, + priority: inference.priority, + topLevel: inference.topLevel, + isFixed: inference.isFixed, + impliedArity: inference.impliedArity + }; + } + function cloneInferredPartOfContext(context2) { + var inferences = ts2.filter(context2.inferences, hasInferenceCandidates); + return inferences.length ? createInferenceContextWorker(ts2.map(inferences, cloneInferenceInfo), context2.signature, context2.flags, context2.compareTypes) : void 0; + } + function getMapperFromContext(context2) { + return context2 && context2.mapper; + } + function couldContainTypeVariables(type3) { + var objectFlags = ts2.getObjectFlags(type3); + if (objectFlags & 524288) { + return !!(objectFlags & 1048576); + } + var result2 = !!(type3.flags & 465829888 || type3.flags & 524288 && !isNonGenericTopLevelType(type3) && (objectFlags & 4 && (type3.node || ts2.forEach(getTypeArguments(type3), couldContainTypeVariables)) || objectFlags & 16 && type3.symbol && type3.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type3.symbol.declarations || objectFlags & (32 | 1024 | 4194304 | 8388608)) || type3.flags & 3145728 && !(type3.flags & 1024) && !isNonGenericTopLevelType(type3) && ts2.some(type3.types, couldContainTypeVariables)); + if (type3.flags & 3899393) { + type3.objectFlags |= 524288 | (result2 ? 1048576 : 0); + } + return result2; + } + function isNonGenericTopLevelType(type3) { + if (type3.aliasSymbol && !type3.aliasTypeArguments) { + var declaration = ts2.getDeclarationOfKind( + type3.aliasSymbol, + 262 + /* SyntaxKind.TypeAliasDeclaration */ + ); + return !!(declaration && ts2.findAncestor(declaration.parent, function(n7) { + return n7.kind === 308 ? true : n7.kind === 264 ? false : "quit"; + })); + } + return false; + } + function isTypeParameterAtTopLevel(type3, typeParameter) { + return !!(type3 === typeParameter || type3.flags & 3145728 && ts2.some(type3.types, function(t8) { + return isTypeParameterAtTopLevel(t8, typeParameter); + }) || type3.flags & 16777216 && (getTrueTypeFromConditionalType(type3) === typeParameter || getFalseTypeFromConditionalType(type3) === typeParameter)); + } + function createEmptyObjectTypeFromStringLiteral(type3) { + var members = ts2.createSymbolTable(); + forEachType(type3, function(t8) { + if (!(t8.flags & 128)) { + return; + } + var name2 = ts2.escapeLeadingUnderscores(t8.value); + var literalProp = createSymbol(4, name2); + literalProp.type = anyType2; + if (t8.symbol) { + literalProp.declarations = t8.symbol.declarations; + literalProp.valueDeclaration = t8.symbol.valueDeclaration; + } + members.set(name2, literalProp); + }); + var indexInfos = type3.flags & 4 ? [createIndexInfo( + stringType2, + emptyObjectType, + /*isReadonly*/ + false + )] : ts2.emptyArray; + return createAnonymousType(void 0, members, ts2.emptyArray, ts2.emptyArray, indexInfos); + } + function inferTypeForHomomorphicMappedType(source, target, constraint) { + if (inInferTypeForHomomorphicMappedType) { + return void 0; + } + var key = source.id + "," + target.id + "," + constraint.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + inInferTypeForHomomorphicMappedType = true; + var type3 = createReverseMappedType(source, target, constraint); + inInferTypeForHomomorphicMappedType = false; + reverseMappedCache.set(key, type3); + return type3; + } + function isPartiallyInferableType(type3) { + return !(ts2.getObjectFlags(type3) & 262144) || isObjectLiteralType(type3) && ts2.some(getPropertiesOfType(type3), function(prop) { + return isPartiallyInferableType(getTypeOfSymbol(prop)); + }) || isTupleType(type3) && ts2.some(getTypeArguments(type3), isPartiallyInferableType); + } + function createReverseMappedType(source, target, constraint) { + if (!(getIndexInfoOfType(source, stringType2) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) { + return void 0; + } + if (isArrayType(source)) { + return createArrayType(inferReverseMappedType(getTypeArguments(source)[0], target, constraint), isReadonlyArrayType(source)); + } + if (isTupleType(source)) { + var elementTypes = ts2.map(getTypeArguments(source), function(t8) { + return inferReverseMappedType(t8, target, constraint); + }); + var elementFlags = getMappedTypeModifiers(target) & 4 ? ts2.sameMap(source.target.elementFlags, function(f8) { + return f8 & 2 ? 1 : f8; + }) : source.target.elementFlags; + return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations); + } + var reversed = createObjectType( + 1024 | 16, + /*symbol*/ + void 0 + ); + reversed.source = source; + reversed.mappedType = target; + reversed.constraintType = constraint; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + var links = getSymbolLinks(symbol); + if (!links.type) { + links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType); + } + return links.type; + } + function inferReverseMappedType(sourceType, target, constraint) { + var typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || unknownType2; + } + function getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { + var properties, _i, properties_2, targetProp, sourceProp, targetType, sourceType; + return __generator10(this, function(_a2) { + switch (_a2.label) { + case 0: + properties = getPropertiesOfType(target); + _i = 0, properties_2 = properties; + _a2.label = 1; + case 1: + if (!(_i < properties_2.length)) + return [3, 6]; + targetProp = properties_2[_i]; + if (isStaticPrivateIdentifierProperty(targetProp)) { + return [3, 5]; + } + if (!(requireOptionalProperties || !(targetProp.flags & 16777216 || ts2.getCheckFlags(targetProp) & 48))) + return [3, 5]; + sourceProp = getPropertyOfType(source, targetProp.escapedName); + if (!!sourceProp) + return [3, 3]; + return [4, targetProp]; + case 2: + _a2.sent(); + return [3, 5]; + case 3: + if (!matchDiscriminantProperties) + return [3, 5]; + targetType = getTypeOfSymbol(targetProp); + if (!(targetType.flags & 109440)) + return [3, 5]; + sourceType = getTypeOfSymbol(sourceProp); + if (!!(sourceType.flags & 1 || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) + return [3, 5]; + return [4, targetProp]; + case 4: + _a2.sent(); + _a2.label = 5; + case 5: + _i++; + return [3, 1]; + case 6: + return [ + 2 + /*return*/ + ]; + } + }); + } + function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { + var result2 = getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties).next(); + if (!result2.done) + return result2.value; + } + function tupleTypesDefinitelyUnrelated(source, target) { + return !(target.target.combinedFlags & 8) && target.target.minLength > source.target.minLength || !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength); + } + function typesDefinitelyUnrelated(source, target) { + return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty( + source, + target, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + true + ) && !!getUnmatchedProperty( + target, + source, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + false + ); + } + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType( + inference.candidates, + 2 + /* UnionReduction.Subtype */ + ) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : void 0; + } + function hasSkipDirectInferenceFlag(node) { + return !!getNodeLinks(node).skipDirectInference; + } + function isFromInferenceBlockedSource(type3) { + return !!(type3.symbol && ts2.some(type3.symbol.declarations, hasSkipDirectInferenceFlag)); + } + function templateLiteralTypesDefinitelyUnrelated(source, target) { + var sourceStart = source.texts[0]; + var targetStart = target.texts[0]; + var sourceEnd = source.texts[source.texts.length - 1]; + var targetEnd = target.texts[target.texts.length - 1]; + var startLen = Math.min(sourceStart.length, targetStart.length); + var endLen = Math.min(sourceEnd.length, targetEnd.length); + return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) || sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen); + } + function isValidNumberString(s7, roundTripOnly) { + if (s7 === "") + return false; + var n7 = +s7; + return isFinite(n7) && (!roundTripOnly || "" + n7 === s7); + } + function parseBigIntLiteralType(text) { + var negative = text.startsWith("-"); + var base10Value = ts2.parsePseudoBigInt("".concat(negative ? text.slice(1) : text, "n")); + return getBigIntLiteralType({ negative, base10Value }); + } + function isValidBigIntString(s7, roundTripOnly) { + if (s7 === "") + return false; + var scanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false + ); + var success = true; + scanner.setOnError(function() { + return success = false; + }); + scanner.setText(s7 + "n"); + var result2 = scanner.scan(); + var negative = result2 === 40; + if (negative) { + result2 = scanner.scan(); + } + var flags = scanner.getTokenFlags(); + return success && result2 === 9 && scanner.getTextPos() === s7.length + 1 && !(flags & 512) && (!roundTripOnly || s7 === ts2.pseudoBigIntToString({ negative, base10Value: ts2.parsePseudoBigInt(scanner.getTokenValue()) })); + } + function isMemberOfStringMapping(source, target) { + if (target.flags & (4 | 1)) { + return true; + } + if (target.flags & 134217728) { + return isTypeAssignableTo(source, target); + } + if (target.flags & 268435456) { + var mappingStack = []; + while (target.flags & 268435456) { + mappingStack.unshift(target.symbol); + target = target.type; + } + var mappedSource = ts2.reduceLeft(mappingStack, function(memo, value2) { + return getStringMappingType(value2, memo); + }, source); + return mappedSource === source && isMemberOfStringMapping(source, target); + } + return false; + } + function isValidTypeForTemplateLiteralPlaceholder(source, target) { + if (source === target || target.flags & (1 | 4)) { + return true; + } + if (source.flags & 128) { + var value2 = source.value; + return !!(target.flags & 8 && isValidNumberString( + value2, + /*roundTripOnly*/ + false + ) || target.flags & 64 && isValidBigIntString( + value2, + /*roundTripOnly*/ + false + ) || target.flags & (512 | 98304) && value2 === target.intrinsicName || target.flags & 268435456 && isMemberOfStringMapping(getStringLiteralType(value2), target)); + } + if (source.flags & 134217728) { + var texts = source.texts; + return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target); + } + return isTypeAssignableTo(source, target); + } + function inferTypesFromTemplateLiteralType(source, target) { + return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], ts2.emptyArray, target) : source.flags & 134217728 ? ts2.arraysEqual(source.texts, target.texts) ? ts2.map(source.types, getStringLikeTypeForType) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0; + } + function isTypeMatchedByTemplateLiteralType(source, target) { + var inferences = inferTypesFromTemplateLiteralType(source, target); + return !!inferences && ts2.every(inferences, function(r8, i7) { + return isValidTypeForTemplateLiteralPlaceholder(r8, target.types[i7]); + }); + } + function getStringLikeTypeForType(type3) { + return type3.flags & (1 | 402653316) ? type3 : getTemplateLiteralType(["", ""], [type3]); + } + function inferFromLiteralPartsToTemplateLiteral(sourceTexts, sourceTypes, target) { + var lastSourceIndex = sourceTexts.length - 1; + var sourceStartText = sourceTexts[0]; + var sourceEndText = sourceTexts[lastSourceIndex]; + var targetTexts = target.texts; + var lastTargetIndex = targetTexts.length - 1; + var targetStartText = targetTexts[0]; + var targetEndText = targetTexts[lastTargetIndex]; + if (lastSourceIndex === 0 && sourceStartText.length < targetStartText.length + targetEndText.length || !sourceStartText.startsWith(targetStartText) || !sourceEndText.endsWith(targetEndText)) + return void 0; + var remainingEndText = sourceEndText.slice(0, sourceEndText.length - targetEndText.length); + var matches2 = []; + var seg = 0; + var pos = targetStartText.length; + for (var i7 = 1; i7 < lastTargetIndex; i7++) { + var delim = targetTexts[i7]; + if (delim.length > 0) { + var s7 = seg; + var p7 = pos; + while (true) { + p7 = getSourceText(s7).indexOf(delim, p7); + if (p7 >= 0) + break; + s7++; + if (s7 === sourceTexts.length) + return void 0; + p7 = 0; + } + addMatch(s7, p7); + pos += delim.length; + } else if (pos < getSourceText(seg).length) { + addMatch(seg, pos + 1); + } else if (seg < lastSourceIndex) { + addMatch(seg + 1, 0); + } else { + return void 0; + } + } + addMatch(lastSourceIndex, getSourceText(lastSourceIndex).length); + return matches2; + function getSourceText(index4) { + return index4 < lastSourceIndex ? sourceTexts[index4] : remainingEndText; + } + function addMatch(s8, p8) { + var matchType = s8 === seg ? getStringLiteralType(getSourceText(s8).slice(pos, p8)) : getTemplateLiteralType(__spreadArray9(__spreadArray9([sourceTexts[seg].slice(pos)], sourceTexts.slice(seg + 1, s8), true), [getSourceText(s8).slice(0, p8)], false), sourceTypes.slice(seg, s8)); + matches2.push(matchType); + seg = s8; + pos = p8; + } + } + function inferTypes(inferences, originalSource, originalTarget, priority, contravariant) { + if (priority === void 0) { + priority = 0; + } + if (contravariant === void 0) { + contravariant = false; + } + var bivariant = false; + var propagationType; + var inferencePriority = 2048; + var allowComplexConstraintInference = true; + var visited; + var sourceStack; + var targetStack; + var expandingFlags = 0; + inferFromTypes(originalSource, originalTarget); + function inferFromTypes(source, target) { + if (!couldContainTypeVariables(target)) { + return; + } + if (source === wildcardType) { + var savePropagationType = propagationType; + propagationType = source; + inferFromTypes(target, target); + propagationType = savePropagationType; + return; + } + if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) { + if (source.aliasTypeArguments) { + inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol)); + } + return; + } + if (source === target && source.flags & 3145728) { + for (var _i = 0, _a2 = source.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + inferFromTypes(t8, t8); + } + return; + } + if (target.flags & 1048576) { + var _b = inferFromMatchingTypes(source.flags & 1048576 ? source.types : [source], target.types, isTypeOrBaseIdenticalTo), tempSources = _b[0], tempTargets = _b[1]; + var _c = inferFromMatchingTypes(tempSources, tempTargets, isTypeCloselyMatchedBy), sources = _c[0], targets = _c[1]; + if (targets.length === 0) { + return; + } + target = getUnionType(targets); + if (sources.length === 0) { + inferWithPriority( + source, + target, + 1 + /* InferencePriority.NakedTypeVariable */ + ); + return; + } + source = getUnionType(sources); + } else if (target.flags & 2097152 && ts2.some(target.types, function(t9) { + return !!getInferenceInfoForType(t9) || isGenericMappedType(t9) && !!getInferenceInfoForType(getHomomorphicTypeVariable(t9) || neverType2); + })) { + if (!(source.flags & 1048576)) { + var _d = inferFromMatchingTypes(source.flags & 2097152 ? source.types : [source], target.types, isTypeIdenticalTo), sources = _d[0], targets = _d[1]; + if (sources.length === 0 || targets.length === 0) { + return; + } + source = getIntersectionType(sources); + target = getIntersectionType(targets); + } + } else if (target.flags & (8388608 | 33554432)) { + target = getActualTypeVariable(target); + } + if (target.flags & 8650752) { + if (isFromInferenceBlockedSource(source)) { + return; + } + var inference = getInferenceInfoForType(target); + if (inference) { + if (ts2.getObjectFlags(source) & 262144 || source === nonInferrableAnyType) { + return; + } + if (!inference.isFixed) { + if (inference.priority === void 0 || priority < inference.priority) { + inference.candidates = void 0; + inference.contraCandidates = void 0; + inference.topLevel = true; + inference.priority = priority; + } + if (priority === inference.priority) { + var candidate = propagationType || source; + if (contravariant && !bivariant) { + if (!ts2.contains(inference.contraCandidates, candidate)) { + inference.contraCandidates = ts2.append(inference.contraCandidates, candidate); + clearCachedInferences(inferences); + } + } else if (!ts2.contains(inference.candidates, candidate)) { + inference.candidates = ts2.append(inference.candidates, candidate); + clearCachedInferences(inferences); + } + } + if (!(priority & 128) && target.flags & 262144 && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) { + inference.topLevel = false; + clearCachedInferences(inferences); + } + } + inferencePriority = Math.min(inferencePriority, priority); + return; + } + var simplified = getSimplifiedType( + target, + /*writing*/ + false + ); + if (simplified !== target) { + inferFromTypes(source, simplified); + } else if (target.flags & 8388608) { + var indexType = getSimplifiedType( + target.indexType, + /*writing*/ + false + ); + if (indexType.flags & 465829888) { + var simplified_1 = distributeIndexOverObjectType( + getSimplifiedType( + target.objectType, + /*writing*/ + false + ), + indexType, + /*writing*/ + false + ); + if (simplified_1 && simplified_1 !== target) { + inferFromTypes(source, simplified_1); + } + } + } + } + if (ts2.getObjectFlags(source) & 4 && ts2.getObjectFlags(target) & 4 && (source.target === target.target || isArrayType(source) && isArrayType(target)) && !(source.node && target.node)) { + inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); + } else if (source.flags & 4194304 && target.flags & 4194304) { + inferFromContravariantTypes(source.type, target.type); + } else if ((isLiteralType(source) || source.flags & 4) && target.flags & 4194304) { + var empty2 = createEmptyObjectTypeFromStringLiteral(source); + inferFromContravariantTypesWithPriority( + empty2, + target.type, + 256 + /* InferencePriority.LiteralKeyof */ + ); + } else if (source.flags & 8388608 && target.flags & 8388608) { + inferFromTypes(source.objectType, target.objectType); + inferFromTypes(source.indexType, target.indexType); + } else if (source.flags & 268435456 && target.flags & 268435456) { + if (source.symbol === target.symbol) { + inferFromTypes(source.type, target.type); + } + } else if (source.flags & 33554432) { + inferFromTypes(source.baseType, target); + inferWithPriority( + getSubstitutionIntersection(source), + target, + 4 + /* InferencePriority.SubstituteSource */ + ); + } else if (target.flags & 16777216) { + invokeOnce(source, target, inferToConditionalType); + } else if (target.flags & 3145728) { + inferToMultipleTypes(source, target.types, target.flags); + } else if (source.flags & 1048576) { + var sourceTypes = source.types; + for (var _e2 = 0, sourceTypes_2 = sourceTypes; _e2 < sourceTypes_2.length; _e2++) { + var sourceType = sourceTypes_2[_e2]; + inferFromTypes(sourceType, target); + } + } else if (target.flags & 134217728) { + inferToTemplateLiteralType(source, target); + } else { + source = getReducedType(source); + if (!(priority & 512 && source.flags & (2097152 | 465829888))) { + var apparentSource = getApparentType(source); + if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 | 2097152))) { + allowComplexConstraintInference = false; + return inferFromTypes(apparentSource, target); + } + source = apparentSource; + } + if (source.flags & (524288 | 2097152)) { + invokeOnce(source, target, inferFromObjectTypes); + } + } + } + function inferWithPriority(source, target, newPriority) { + var savePriority = priority; + priority |= newPriority; + inferFromTypes(source, target); + priority = savePriority; + } + function inferFromContravariantTypesWithPriority(source, target, newPriority) { + var savePriority = priority; + priority |= newPriority; + inferFromContravariantTypes(source, target); + priority = savePriority; + } + function inferToMultipleTypesWithPriority(source, targets, targetFlags, newPriority) { + var savePriority = priority; + priority |= newPriority; + inferToMultipleTypes(source, targets, targetFlags); + priority = savePriority; + } + function invokeOnce(source, target, action) { + var key = source.id + "," + target.id; + var status = visited && visited.get(key); + if (status !== void 0) { + inferencePriority = Math.min(inferencePriority, status); + return; + } + (visited || (visited = new ts2.Map())).set( + key, + -1 + /* InferencePriority.Circularity */ + ); + var saveInferencePriority = inferencePriority; + inferencePriority = 2048; + var saveExpandingFlags = expandingFlags; + var sourceIdentity = getRecursionIdentity(source); + var targetIdentity = getRecursionIdentity(target); + if (ts2.contains(sourceStack, sourceIdentity)) + expandingFlags |= 1; + if (ts2.contains(targetStack, targetIdentity)) + expandingFlags |= 2; + if (expandingFlags !== 3) { + (sourceStack || (sourceStack = [])).push(sourceIdentity); + (targetStack || (targetStack = [])).push(targetIdentity); + action(source, target); + targetStack.pop(); + sourceStack.pop(); + } else { + inferencePriority = -1; + } + expandingFlags = saveExpandingFlags; + visited.set(key, inferencePriority); + inferencePriority = Math.min(inferencePriority, saveInferencePriority); + } + function inferFromMatchingTypes(sources, targets, matches2) { + var matchedSources; + var matchedTargets; + for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) { + var t8 = targets_1[_i]; + for (var _a2 = 0, sources_1 = sources; _a2 < sources_1.length; _a2++) { + var s7 = sources_1[_a2]; + if (matches2(s7, t8)) { + inferFromTypes(s7, t8); + matchedSources = ts2.appendIfUnique(matchedSources, s7); + matchedTargets = ts2.appendIfUnique(matchedTargets, t8); + } + } + } + return [ + matchedSources ? ts2.filter(sources, function(t9) { + return !ts2.contains(matchedSources, t9); + }) : sources, + matchedTargets ? ts2.filter(targets, function(t9) { + return !ts2.contains(matchedTargets, t9); + }) : targets + ]; + } + function inferFromTypeArguments(sourceTypes, targetTypes, variances) { + var count2 = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; + for (var i7 = 0; i7 < count2; i7++) { + if (i7 < variances.length && (variances[i7] & 7) === 2) { + inferFromContravariantTypes(sourceTypes[i7], targetTypes[i7]); + } else { + inferFromTypes(sourceTypes[i7], targetTypes[i7]); + } + } + } + function inferFromContravariantTypes(source, target) { + contravariant = !contravariant; + inferFromTypes(source, target); + contravariant = !contravariant; + } + function inferFromContravariantTypesIfStrictFunctionTypes(source, target) { + if (strictFunctionTypes || priority & 1024) { + inferFromContravariantTypes(source, target); + } else { + inferFromTypes(source, target); + } + } + function getInferenceInfoForType(type3) { + if (type3.flags & 8650752) { + for (var _i = 0, inferences_2 = inferences; _i < inferences_2.length; _i++) { + var inference = inferences_2[_i]; + if (type3 === inference.typeParameter) { + return inference; + } + } + } + return void 0; + } + function getSingleTypeVariableFromIntersectionTypes(types3) { + var typeVariable; + for (var _i = 0, types_14 = types3; _i < types_14.length; _i++) { + var type3 = types_14[_i]; + var t8 = type3.flags & 2097152 && ts2.find(type3.types, function(t9) { + return !!getInferenceInfoForType(t9); + }); + if (!t8 || typeVariable && t8 !== typeVariable) { + return void 0; + } + typeVariable = t8; + } + return typeVariable; + } + function inferToMultipleTypes(source, targets, targetFlags) { + var typeVariableCount = 0; + if (targetFlags & 1048576) { + var nakedTypeVariable = void 0; + var sources = source.flags & 1048576 ? source.types : [source]; + var matched_1 = new Array(sources.length); + var inferenceCircularity = false; + for (var _i = 0, targets_2 = targets; _i < targets_2.length; _i++) { + var t8 = targets_2[_i]; + if (getInferenceInfoForType(t8)) { + nakedTypeVariable = t8; + typeVariableCount++; + } else { + for (var i7 = 0; i7 < sources.length; i7++) { + var saveInferencePriority = inferencePriority; + inferencePriority = 2048; + inferFromTypes(sources[i7], t8); + if (inferencePriority === priority) + matched_1[i7] = true; + inferenceCircularity = inferenceCircularity || inferencePriority === -1; + inferencePriority = Math.min(inferencePriority, saveInferencePriority); + } + } + } + if (typeVariableCount === 0) { + var intersectionTypeVariable = getSingleTypeVariableFromIntersectionTypes(targets); + if (intersectionTypeVariable) { + inferWithPriority( + source, + intersectionTypeVariable, + 1 + /* InferencePriority.NakedTypeVariable */ + ); + } + return; + } + if (typeVariableCount === 1 && !inferenceCircularity) { + var unmatched = ts2.flatMap(sources, function(s7, i8) { + return matched_1[i8] ? void 0 : s7; + }); + if (unmatched.length) { + inferFromTypes(getUnionType(unmatched), nakedTypeVariable); + return; + } + } + } else { + for (var _a2 = 0, targets_3 = targets; _a2 < targets_3.length; _a2++) { + var t8 = targets_3[_a2]; + if (getInferenceInfoForType(t8)) { + typeVariableCount++; + } else { + inferFromTypes(source, t8); + } + } + } + if (targetFlags & 2097152 ? typeVariableCount === 1 : typeVariableCount > 0) { + for (var _b = 0, targets_4 = targets; _b < targets_4.length; _b++) { + var t8 = targets_4[_b]; + if (getInferenceInfoForType(t8)) { + inferWithPriority( + source, + t8, + 1 + /* InferencePriority.NakedTypeVariable */ + ); + } + } + } + } + function inferToMappedType(source, target, constraintType) { + if (constraintType.flags & 1048576) { + var result2 = false; + for (var _i = 0, _a2 = constraintType.types; _i < _a2.length; _i++) { + var type3 = _a2[_i]; + result2 = inferToMappedType(source, target, type3) || result2; + } + return result2; + } + if (constraintType.flags & 4194304) { + var inference = getInferenceInfoForType(constraintType.type); + if (inference && !inference.isFixed && !isFromInferenceBlockedSource(source)) { + var inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType); + if (inferredType) { + inferWithPriority( + inferredType, + inference.typeParameter, + ts2.getObjectFlags(source) & 262144 ? 16 : 8 + /* InferencePriority.HomomorphicMappedType */ + ); + } + } + return true; + } + if (constraintType.flags & 262144) { + inferWithPriority( + getIndexType(source), + constraintType, + 32 + /* InferencePriority.MappedTypeConstraint */ + ); + var extendedConstraint = getConstraintOfType(constraintType); + if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) { + return true; + } + var propTypes = ts2.map(getPropertiesOfType(source), getTypeOfSymbol); + var indexTypes = ts2.map(getIndexInfosOfType(source), function(info2) { + return info2 !== enumNumberIndexInfo ? info2.type : neverType2; + }); + inferFromTypes(getUnionType(ts2.concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target)); + return true; + } + return false; + } + function inferToConditionalType(source, target) { + if (source.flags & 16777216) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + } else { + var targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 : 0); + } + } + function inferToTemplateLiteralType(source, target) { + var matches2 = inferTypesFromTemplateLiteralType(source, target); + var types3 = target.types; + if (matches2 || ts2.every(target.texts, function(s7) { + return s7.length === 0; + })) { + var _loop_24 = function(i8) { + var source_1 = matches2 ? matches2[i8] : neverType2; + var target_3 = types3[i8]; + if (source_1.flags & 128 && target_3.flags & 8650752) { + var inferenceContext = getInferenceInfoForType(target_3); + var constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : void 0; + if (constraint && !isTypeAny(constraint)) { + var constraintTypes = constraint.flags & 1048576 ? constraint.types : [constraint]; + var allTypeFlags_1 = ts2.reduceLeft(constraintTypes, function(flags, t8) { + return flags | t8.flags; + }, 0); + if (!(allTypeFlags_1 & 4)) { + var str_1 = source_1.value; + if (allTypeFlags_1 & 296 && !isValidNumberString( + str_1, + /*roundTripOnly*/ + true + )) { + allTypeFlags_1 &= ~296; + } + if (allTypeFlags_1 & 2112 && !isValidBigIntString( + str_1, + /*roundTripOnly*/ + true + )) { + allTypeFlags_1 &= ~2112; + } + var matchingType = ts2.reduceLeft(constraintTypes, function(left, right) { + return !(right.flags & allTypeFlags_1) ? left : left.flags & 4 ? left : right.flags & 4 ? source_1 : left.flags & 134217728 ? left : right.flags & 134217728 && isTypeMatchedByTemplateLiteralType(source_1, right) ? source_1 : left.flags & 268435456 ? left : right.flags & 268435456 && str_1 === applyStringMapping(right.symbol, str_1) ? source_1 : left.flags & 128 ? left : right.flags & 128 && right.value === str_1 ? right : left.flags & 8 ? left : right.flags & 8 ? getNumberLiteralType(+str_1) : left.flags & 32 ? left : right.flags & 32 ? getNumberLiteralType(+str_1) : left.flags & 256 ? left : right.flags & 256 && right.value === +str_1 ? right : left.flags & 64 ? left : right.flags & 64 ? parseBigIntLiteralType(str_1) : left.flags & 2048 ? left : right.flags & 2048 && ts2.pseudoBigIntToString(right.value) === str_1 ? right : left.flags & 16 ? left : right.flags & 16 ? str_1 === "true" ? trueType : str_1 === "false" ? falseType : booleanType2 : left.flags & 512 ? left : right.flags & 512 && right.intrinsicName === str_1 ? right : left.flags & 32768 ? left : right.flags & 32768 && right.intrinsicName === str_1 ? right : left.flags & 65536 ? left : right.flags & 65536 && right.intrinsicName === str_1 ? right : left; + }, neverType2); + if (!(matchingType.flags & 131072)) { + inferFromTypes(matchingType, target_3); + return "continue"; + } + } + } + } + inferFromTypes(source_1, target_3); + }; + for (var i7 = 0; i7 < types3.length; i7++) { + _loop_24(i7); + } + } + } + function inferFromObjectTypes(source, target) { + if (ts2.getObjectFlags(source) & 4 && ts2.getObjectFlags(target) & 4 && (source.target === target.target || isArrayType(source) && isArrayType(target))) { + inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); + return; + } + if (isGenericMappedType(source) && isGenericMappedType(target)) { + inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); + inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + var sourceNameType = getNameTypeFromMappedType(source); + var targetNameType = getNameTypeFromMappedType(target); + if (sourceNameType && targetNameType) + inferFromTypes(sourceNameType, targetNameType); + } + if (ts2.getObjectFlags(target) & 32 && !target.declaration.nameType) { + var constraintType = getConstraintTypeFromMappedType(target); + if (inferToMappedType(source, target, constraintType)) { + return; + } + } + if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayOrTupleType(source)) { + if (isTupleType(target)) { + var sourceArity = getTypeReferenceArity(source); + var targetArity = getTypeReferenceArity(target); + var elementTypes = getTypeArguments(target); + var elementFlags = target.target.elementFlags; + if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) { + for (var i7 = 0; i7 < targetArity; i7++) { + inferFromTypes(getTypeArguments(source)[i7], elementTypes[i7]); + } + return; + } + var startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0; + var endLength = Math.min(isTupleType(source) ? getEndElementCount( + source.target, + 3 + /* ElementFlags.Fixed */ + ) : 0, target.target.hasRestElement ? getEndElementCount( + target.target, + 3 + /* ElementFlags.Fixed */ + ) : 0); + for (var i7 = 0; i7 < startLength; i7++) { + inferFromTypes(getTypeArguments(source)[i7], elementTypes[i7]); + } + if (!isTupleType(source) || sourceArity - startLength - endLength === 1 && source.target.elementFlags[startLength] & 4) { + var restType = getTypeArguments(source)[startLength]; + for (var i7 = startLength; i7 < targetArity - endLength; i7++) { + inferFromTypes(elementFlags[i7] & 8 ? createArrayType(restType) : restType, elementTypes[i7]); + } + } else { + var middleLength = targetArity - startLength - endLength; + if (middleLength === 2 && elementFlags[startLength] & elementFlags[startLength + 1] & 8 && isTupleType(source)) { + var targetInfo = getInferenceInfoForType(elementTypes[startLength]); + if (targetInfo && targetInfo.impliedArity !== void 0) { + inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); + inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]); + } + } else if (middleLength === 1 && elementFlags[startLength] & 8) { + var endsInOptional = target.target.elementFlags[targetArity - 1] & 2; + var sourceSlice = isTupleType(source) ? sliceTupleType(source, startLength, endLength) : createArrayType(getTypeArguments(source)[0]); + inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 : 0); + } else if (middleLength === 1 && elementFlags[startLength] & 4) { + var restType = isTupleType(source) ? getElementTypeOfSliceOfTupleType(source, startLength, endLength) : getTypeArguments(source)[0]; + if (restType) { + inferFromTypes(restType, elementTypes[startLength]); + } + } + } + for (var i7 = 0; i7 < endLength; i7++) { + inferFromTypes(getTypeArguments(source)[sourceArity - i7 - 1], elementTypes[targetArity - i7 - 1]); + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } + inferFromProperties(source, target); + inferFromSignatures( + source, + target, + 0 + /* SignatureKind.Call */ + ); + inferFromSignatures( + source, + target, + 1 + /* SignatureKind.Construct */ + ); + inferFromIndexTypes(source, target); + } + } + function inferFromProperties(source, target) { + var properties = getPropertiesOfObjectType(target); + for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) { + var targetProp = properties_3[_i]; + var sourceProp = getPropertyOfType(source, targetProp.escapedName); + if (sourceProp && !ts2.some(sourceProp.declarations, hasSkipDirectInferenceFlag)) { + inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + } + } + function inferFromSignatures(source, target, kind) { + var sourceSignatures = getSignaturesOfType(source, kind); + var targetSignatures = getSignaturesOfType(target, kind); + var sourceLen = sourceSignatures.length; + var targetLen = targetSignatures.length; + var len = sourceLen < targetLen ? sourceLen : targetLen; + for (var i7 = 0; i7 < len; i7++) { + inferFromSignature(getBaseSignature(sourceSignatures[sourceLen - len + i7]), getErasedSignature(targetSignatures[targetLen - len + i7])); + } + } + function inferFromSignature(source, target) { + var saveBivariant = bivariant; + var kind = target.declaration ? target.declaration.kind : 0; + bivariant = bivariant || kind === 171 || kind === 170 || kind === 173; + applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); + bivariant = saveBivariant; + applyToReturnTypes(source, target, inferFromTypes); + } + function inferFromIndexTypes(source, target) { + var priority2 = ts2.getObjectFlags(source) & ts2.getObjectFlags(target) & 32 ? 8 : 0; + var indexInfos = getIndexInfosOfType(target); + if (isObjectTypeWithInferableIndex(source)) { + for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) { + var targetInfo = indexInfos_6[_i]; + var propTypes = []; + for (var _a2 = 0, _b = getPropertiesOfType(source); _a2 < _b.length; _a2++) { + var prop = _b[_a2]; + if (isApplicableIndexType(getLiteralTypeFromProperty( + prop, + 8576 + /* TypeFlags.StringOrNumberLiteralOrUnique */ + ), targetInfo.keyType)) { + var propType = getTypeOfSymbol(prop); + propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType) : propType); + } + } + for (var _c = 0, _d = getIndexInfosOfType(source); _c < _d.length; _c++) { + var info2 = _d[_c]; + if (isApplicableIndexType(info2.keyType, targetInfo.keyType)) { + propTypes.push(info2.type); + } + } + if (propTypes.length) { + inferWithPriority(getUnionType(propTypes), targetInfo.type, priority2); + } + } + } + for (var _e2 = 0, indexInfos_7 = indexInfos; _e2 < indexInfos_7.length; _e2++) { + var targetInfo = indexInfos_7[_e2]; + var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType); + if (sourceInfo) { + inferWithPriority(sourceInfo.type, targetInfo.type, priority2); + } + } + } + } + function isTypeOrBaseIdenticalTo(s7, t8) { + return exactOptionalPropertyTypes && t8 === missingType ? s7 === t8 : isTypeIdenticalTo(s7, t8) || !!(t8.flags & 4 && s7.flags & 128 || t8.flags & 8 && s7.flags & 256); + } + function isTypeCloselyMatchedBy(s7, t8) { + return !!(s7.flags & 524288 && t8.flags & 524288 && s7.symbol && s7.symbol === t8.symbol || s7.aliasSymbol && s7.aliasTypeArguments && s7.aliasSymbol === t8.aliasSymbol); + } + function hasPrimitiveConstraint(type3) { + var constraint = getConstraintOfTypeParameter(type3); + return !!constraint && maybeTypeOfKind( + constraint.flags & 16777216 ? getDefaultConstraintOfConditionalType(constraint) : constraint, + 131068 | 4194304 | 134217728 | 268435456 + /* TypeFlags.StringMapping */ + ); + } + function isObjectLiteralType(type3) { + return !!(ts2.getObjectFlags(type3) & 128); + } + function isObjectOrArrayLiteralType(type3) { + return !!(ts2.getObjectFlags(type3) & (128 | 16384)); + } + function unionObjectAndArrayLiteralCandidates(candidates) { + if (candidates.length > 1) { + var objectLiterals = ts2.filter(candidates, isObjectOrArrayLiteralType); + if (objectLiterals.length) { + var literalsType = getUnionType( + objectLiterals, + 2 + /* UnionReduction.Subtype */ + ); + return ts2.concatenate(ts2.filter(candidates, function(t8) { + return !isObjectOrArrayLiteralType(t8); + }), [literalsType]); + } + } + return candidates; + } + function getContravariantInference(inference) { + return inference.priority & 416 ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); + } + function getCovariantInference(inference, signature) { + var candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); + var primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter); + var widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + var baseCandidates = primitiveConstraint ? ts2.sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? ts2.sameMap(candidates, getWidenedLiteralType) : candidates; + var unwidenedType = inference.priority & 416 ? getUnionType( + baseCandidates, + 2 + /* UnionReduction.Subtype */ + ) : getCommonSupertype(baseCandidates); + return getWidenedType(unwidenedType); + } + function getInferredType(context2, index4) { + var inference = context2.inferences[index4]; + if (!inference.inferredType) { + var inferredType = void 0; + var signature = context2.signature; + if (signature) { + var inferredCovariantType_1 = inference.candidates ? getCovariantInference(inference, signature) : void 0; + if (inference.contraCandidates) { + inferredType = inferredCovariantType_1 && !(inferredCovariantType_1.flags & 131072) && ts2.some(inference.contraCandidates, function(t8) { + return isTypeSubtypeOf(inferredCovariantType_1, t8); + }) ? inferredCovariantType_1 : getContravariantInference(inference); + } else if (inferredCovariantType_1) { + inferredType = inferredCovariantType_1; + } else if (context2.flags & 1) { + inferredType = silentNeverType; + } else { + var defaultType = getDefaultFromTypeParameter(inference.typeParameter); + if (defaultType) { + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context2, index4), context2.nonFixingMapper)); + } + } + } else { + inferredType = getTypeFromInference(inference); + } + inference.inferredType = inferredType || getDefaultTypeArgumentType(!!(context2.flags & 2)); + var constraint = getConstraintOfTypeParameter(inference.typeParameter); + if (constraint) { + var instantiatedConstraint = instantiateType(constraint, context2.nonFixingMapper); + if (!inferredType || !context2.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + inference.inferredType = inferredType = instantiatedConstraint; + } + } + } + return inference.inferredType; + } + function getDefaultTypeArgumentType(isInJavaScriptFile) { + return isInJavaScriptFile ? anyType2 : unknownType2; + } + function getInferredTypes(context2) { + var result2 = []; + for (var i7 = 0; i7 < context2.inferences.length; i7++) { + result2.push(getInferredType(context2, i7)); + } + return result2; + } + function getCannotFindNameDiagnosticForName(node) { + switch (node.escapedText) { + case "document": + case "console": + return ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; + case "$": + return compilerOptions.types ? ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig : ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + case "describe": + case "suite": + case "it": + case "test": + return compilerOptions.types ? ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig : ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + case "process": + case "require": + case "Buffer": + case "module": + return compilerOptions.types ? ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + case "Map": + case "Set": + case "Promise": + case "Symbol": + case "WeakMap": + case "WeakSet": + case "Iterator": + case "AsyncIterator": + case "SharedArrayBuffer": + case "Atomics": + case "AsyncIterable": + case "AsyncIterableIterator": + case "AsyncGenerator": + case "AsyncGeneratorFunction": + case "BigInt": + case "Reflect": + case "BigInt64Array": + case "BigUint64Array": + return ts2.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + case "await": + if (ts2.isCallExpression(node.parent)) { + return ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function; + } + default: + if (node.parent.kind === 300) { + return ts2.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; + } else { + return ts2.Diagnostics.Cannot_find_name_0; + } + } + } + function getResolvedSymbol(node) { + var links = getNodeLinks(node); + if (!links.resolvedSymbol) { + links.resolvedSymbol = !ts2.nodeIsMissing(node) && resolveName( + node, + node.escapedText, + 111551 | 1048576, + getCannotFindNameDiagnosticForName(node), + node, + !ts2.isWriteOnlyAccess(node), + /*excludeGlobals*/ + false + ) || unknownSymbol; + } + return links.resolvedSymbol; + } + function isInTypeQuery(node) { + return !!ts2.findAncestor(node, function(n7) { + return n7.kind === 183 ? true : n7.kind === 79 || n7.kind === 163 ? false : "quit"; + }); + } + function getFlowCacheKey(node, declaredType, initialType, flowContainer) { + switch (node.kind) { + case 79: + if (!ts2.isThisInTypeQuery(node)) { + var symbol = getResolvedSymbol(node); + return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : void 0; + } + case 108: + return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType)); + case 232: + case 214: + return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + case 163: + var left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); + return left && left + "." + node.right.escapedText; + case 208: + case 209: + var propName2 = getAccessedPropertyName(node); + if (propName2 !== void 0) { + var key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + return key && key + "." + propName2; + } + break; + case 203: + case 204: + case 259: + case 215: + case 216: + case 171: + return "".concat(getNodeId(node), "#").concat(getTypeId(declaredType)); + } + return void 0; + } + function isMatchingReference(source, target) { + switch (target.kind) { + case 214: + case 232: + return isMatchingReference(source, target.expression); + case 223: + return ts2.isAssignmentExpression(target) && isMatchingReference(source, target.left) || ts2.isBinaryExpression(target) && target.operatorToken.kind === 27 && isMatchingReference(source, target.right); + } + switch (source.kind) { + case 233: + return target.kind === 233 && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; + case 79: + case 80: + return ts2.isThisInTypeQuery(source) ? target.kind === 108 : target.kind === 79 && getResolvedSymbol(source) === getResolvedSymbol(target) || (target.kind === 257 || target.kind === 205) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); + case 108: + return target.kind === 108; + case 106: + return target.kind === 106; + case 232: + case 214: + return isMatchingReference(source.expression, target); + case 208: + case 209: + var sourcePropertyName = getAccessedPropertyName(source); + var targetPropertyName = ts2.isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; + return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression); + case 163: + return ts2.isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); + case 223: + return ts2.isBinaryExpression(source) && source.operatorToken.kind === 27 && isMatchingReference(source.right, target); + } + return false; + } + function getAccessedPropertyName(access2) { + if (ts2.isPropertyAccessExpression(access2)) { + return access2.name.escapedText; + } + if (ts2.isElementAccessExpression(access2)) { + return tryGetElementAccessExpressionName(access2); + } + if (ts2.isBindingElement(access2)) { + var name2 = getDestructuringPropertyName(access2); + return name2 ? ts2.escapeLeadingUnderscores(name2) : void 0; + } + if (ts2.isParameter(access2)) { + return "" + access2.parent.parameters.indexOf(access2); + } + return void 0; + } + function tryGetNameFromType(type3) { + return type3.flags & 8192 ? type3.escapedName : type3.flags & 384 ? ts2.escapeLeadingUnderscores("" + type3.value) : void 0; + } + function tryGetElementAccessExpressionName(node) { + if (ts2.isStringOrNumericLiteralLike(node.argumentExpression)) { + return ts2.escapeLeadingUnderscores(node.argumentExpression.text); + } + if (ts2.isEntityNameExpression(node.argumentExpression)) { + var symbol = resolveEntityName( + node.argumentExpression, + 111551, + /*ignoreErrors*/ + true + ); + if (!symbol || !(isConstVariable(symbol) || symbol.flags & 8)) + return void 0; + var declaration = symbol.valueDeclaration; + if (declaration === void 0) + return void 0; + var type3 = tryGetTypeFromEffectiveTypeNode(declaration); + if (type3) { + var name2 = tryGetNameFromType(type3); + if (name2 !== void 0) { + return name2; + } + } + if (ts2.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) { + var initializer = ts2.getEffectiveInitializer(declaration); + if (initializer) { + return tryGetNameFromType(getTypeOfExpression(initializer)); + } + if (ts2.isEnumMember(declaration)) { + return ts2.getTextOfPropertyName(declaration.name); + } + } + } + return void 0; + } + function containsMatchingReference(source, target) { + while (ts2.isAccessExpression(source)) { + source = source.expression; + if (isMatchingReference(source, target)) { + return true; + } + } + return false; + } + function optionalChainContainsReference(source, target) { + while (ts2.isOptionalChain(source)) { + source = source.expression; + if (isMatchingReference(source, target)) { + return true; + } + } + return false; + } + function isDiscriminantProperty(type3, name2) { + if (type3 && type3.flags & 1048576) { + var prop = getUnionOrIntersectionProperty(type3, name2); + if (prop && ts2.getCheckFlags(prop) & 2) { + if (prop.isDiscriminantProperty === void 0) { + prop.isDiscriminantProperty = (prop.checkFlags & 192) === 192 && !isGenericType(getTypeOfSymbol(prop)); + } + return !!prop.isDiscriminantProperty; + } + } + return false; + } + function findDiscriminantProperties(sourceProperties, target) { + var result2; + for (var _i = 0, sourceProperties_2 = sourceProperties; _i < sourceProperties_2.length; _i++) { + var sourceProperty = sourceProperties_2[_i]; + if (isDiscriminantProperty(target, sourceProperty.escapedName)) { + if (result2) { + result2.push(sourceProperty); + continue; + } + result2 = [sourceProperty]; + } + } + return result2; + } + function mapTypesByKeyProperty(types3, name2) { + var map4 = new ts2.Map(); + var count2 = 0; + var _loop_25 = function(type4) { + if (type4.flags & (524288 | 2097152 | 58982400)) { + var discriminant = getTypeOfPropertyOfType(type4, name2); + if (discriminant) { + if (!isLiteralType(discriminant)) { + return { value: void 0 }; + } + var duplicate_1 = false; + forEachType(discriminant, function(t8) { + var id = getTypeId(getRegularTypeOfLiteralType(t8)); + var existing = map4.get(id); + if (!existing) { + map4.set(id, type4); + } else if (existing !== unknownType2) { + map4.set(id, unknownType2); + duplicate_1 = true; + } + }); + if (!duplicate_1) + count2++; + } + } + }; + for (var _i = 0, types_15 = types3; _i < types_15.length; _i++) { + var type3 = types_15[_i]; + var state_9 = _loop_25(type3); + if (typeof state_9 === "object") + return state_9.value; + } + return count2 >= 10 && count2 * 2 >= types3.length ? map4 : void 0; + } + function getKeyPropertyName(unionType2) { + var types3 = unionType2.types; + if (types3.length < 10 || ts2.getObjectFlags(unionType2) & 32768 || ts2.countWhere(types3, function(t8) { + return !!(t8.flags & (524288 | 58982400)); + }) < 10) { + return void 0; + } + if (unionType2.keyPropertyName === void 0) { + var keyPropertyName = ts2.forEach(types3, function(t8) { + return t8.flags & (524288 | 58982400) ? ts2.forEach(getPropertiesOfType(t8), function(p7) { + return isUnitType(getTypeOfSymbol(p7)) ? p7.escapedName : void 0; + }) : void 0; + }); + var mapByKeyProperty = keyPropertyName && mapTypesByKeyProperty(types3, keyPropertyName); + unionType2.keyPropertyName = mapByKeyProperty ? keyPropertyName : ""; + unionType2.constituentMap = mapByKeyProperty; + } + return unionType2.keyPropertyName.length ? unionType2.keyPropertyName : void 0; + } + function getConstituentTypeForKeyType(unionType2, keyType) { + var _a2; + var result2 = (_a2 = unionType2.constituentMap) === null || _a2 === void 0 ? void 0 : _a2.get(getTypeId(getRegularTypeOfLiteralType(keyType))); + return result2 !== unknownType2 ? result2 : void 0; + } + function getMatchingUnionConstituentForType(unionType2, type3) { + var keyPropertyName = getKeyPropertyName(unionType2); + var propType = keyPropertyName && getTypeOfPropertyOfType(type3, keyPropertyName); + return propType && getConstituentTypeForKeyType(unionType2, propType); + } + function getMatchingUnionConstituentForObjectLiteral(unionType2, node) { + var keyPropertyName = getKeyPropertyName(unionType2); + var propNode = keyPropertyName && ts2.find(node.properties, function(p7) { + return p7.symbol && p7.kind === 299 && p7.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p7.initializer); + }); + var propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); + return propType && getConstituentTypeForKeyType(unionType2, propType); + } + function isOrContainsMatchingReference(source, target) { + return isMatchingReference(source, target) || containsMatchingReference(source, target); + } + function hasMatchingArgument(expression, reference) { + if (expression.arguments) { + for (var _i = 0, _a2 = expression.arguments; _i < _a2.length; _i++) { + var argument = _a2[_i]; + if (isOrContainsMatchingReference(reference, argument)) { + return true; + } + } + } + if (expression.expression.kind === 208 && isOrContainsMatchingReference(reference, expression.expression.expression)) { + return true; + } + return false; + } + function getFlowNodeId(flow2) { + if (!flow2.id || flow2.id < 0) { + flow2.id = nextFlowId; + nextFlowId++; + } + return flow2.id; + } + function typeMaybeAssignableTo(source, target) { + if (!(source.flags & 1048576)) { + return isTypeAssignableTo(source, target); + } + for (var _i = 0, _a2 = source.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (isTypeAssignableTo(t8, target)) { + return true; + } + } + return false; + } + function getAssignmentReducedType(declaredType, assignedType) { + var _a2; + if (declaredType === assignedType) { + return declaredType; + } + if (assignedType.flags & 131072) { + return assignedType; + } + var key = "A".concat(getTypeId(declaredType), ",").concat(getTypeId(assignedType)); + return (_a2 = getCachedType(key)) !== null && _a2 !== void 0 ? _a2 : setCachedType(key, getAssignmentReducedTypeWorker(declaredType, assignedType)); + } + function getAssignmentReducedTypeWorker(declaredType, assignedType) { + var filteredType = filterType(declaredType, function(t8) { + return typeMaybeAssignableTo(assignedType, t8); + }); + var reducedType = assignedType.flags & 512 && isFreshLiteralType(assignedType) ? mapType2(filteredType, getFreshTypeOfLiteralType) : filteredType; + return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType; + } + function isFunctionObjectType(type3) { + var resolved = resolveStructuredTypeMembers(type3); + return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type3, globalFunctionType)); + } + function getTypeFacts(type3) { + if (type3.flags & (2097152 | 465829888)) { + type3 = getBaseConstraintOfType(type3) || unknownType2; + } + var flags = type3.flags; + if (flags & (4 | 268435456)) { + return strictNullChecks ? 16317953 : 16776705; + } + if (flags & (128 | 134217728)) { + var isEmpty4 = flags & 128 && type3.value === ""; + return strictNullChecks ? isEmpty4 ? 12123649 : 7929345 : isEmpty4 ? 12582401 : 16776705; + } + if (flags & (8 | 32)) { + return strictNullChecks ? 16317698 : 16776450; + } + if (flags & 256) { + var isZero = type3.value === 0; + return strictNullChecks ? isZero ? 12123394 : 7929090 : isZero ? 12582146 : 16776450; + } + if (flags & 64) { + return strictNullChecks ? 16317188 : 16775940; + } + if (flags & 2048) { + var isZero = isZeroBigInt(type3); + return strictNullChecks ? isZero ? 12122884 : 7928580 : isZero ? 12581636 : 16775940; + } + if (flags & 16) { + return strictNullChecks ? 16316168 : 16774920; + } + if (flags & 528) { + return strictNullChecks ? type3 === falseType || type3 === regularFalseType ? 12121864 : 7927560 : type3 === falseType || type3 === regularFalseType ? 12580616 : 16774920; + } + if (flags & 524288) { + return ts2.getObjectFlags(type3) & 16 && isEmptyObjectType(type3) ? strictNullChecks ? 83427327 : 83886079 : isFunctionObjectType(type3) ? strictNullChecks ? 7880640 : 16728e3 : strictNullChecks ? 7888800 : 16736160; + } + if (flags & 16384) { + return 9830144; + } + if (flags & 32768) { + return 26607360; + } + if (flags & 65536) { + return 42917664; + } + if (flags & 12288) { + return strictNullChecks ? 7925520 : 16772880; + } + if (flags & 67108864) { + return strictNullChecks ? 7888800 : 16736160; + } + if (flags & 131072) { + return 0; + } + if (flags & 1048576) { + return ts2.reduceLeft( + type3.types, + function(facts, t8) { + return facts | getTypeFacts(t8); + }, + 0 + /* TypeFacts.None */ + ); + } + if (flags & 2097152) { + return getIntersectionTypeFacts(type3); + } + return 83886079; + } + function getIntersectionTypeFacts(type3) { + var ignoreObjects = maybeTypeOfKind( + type3, + 131068 + /* TypeFlags.Primitive */ + ); + var oredFacts = 0; + var andedFacts = 134217727; + for (var _i = 0, _a2 = type3.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (!(ignoreObjects && t8.flags & 524288)) { + var f8 = getTypeFacts(t8); + oredFacts |= f8; + andedFacts &= f8; + } + } + return oredFacts & 8256 | andedFacts & 134209471; + } + function getTypeWithFacts(type3, include) { + return filterType(type3, function(t8) { + return (getTypeFacts(t8) & include) !== 0; + }); + } + function getAdjustedTypeWithFacts(type3, facts) { + var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type3.flags & 2 ? unknownUnionType : type3, facts)); + if (strictNullChecks) { + switch (facts) { + case 524288: + return mapType2(reduced, function(t8) { + return getTypeFacts(t8) & 65536 ? getIntersectionType([t8, getTypeFacts(t8) & 131072 && !maybeTypeOfKind( + reduced, + 65536 + /* TypeFlags.Null */ + ) ? getUnionType([emptyObjectType, nullType2]) : emptyObjectType]) : t8; + }); + case 1048576: + return mapType2(reduced, function(t8) { + return getTypeFacts(t8) & 131072 ? getIntersectionType([t8, getTypeFacts(t8) & 65536 && !maybeTypeOfKind( + reduced, + 32768 + /* TypeFlags.Undefined */ + ) ? getUnionType([emptyObjectType, undefinedType2]) : emptyObjectType]) : t8; + }); + case 2097152: + case 4194304: + return mapType2(reduced, function(t8) { + return getTypeFacts(t8) & 262144 ? getGlobalNonNullableTypeInstantiation(t8) : t8; + }); + } + } + return reduced; + } + function recombineUnknownType(type3) { + return type3 === unknownUnionType ? unknownType2 : type3; + } + function getTypeWithDefault(type3, defaultExpression) { + return defaultExpression ? getUnionType([getNonUndefinedType(type3), getTypeOfExpression(defaultExpression)]) : type3; + } + function getTypeOfDestructuredProperty(type3, name2) { + var _a2; + var nameType = getLiteralTypeFromPropertyName(name2); + if (!isTypeUsableAsPropertyName(nameType)) + return errorType; + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(type3, text) || includeUndefinedInIndexSignature((_a2 = getApplicableIndexInfoForName(type3, text)) === null || _a2 === void 0 ? void 0 : _a2.type) || errorType; + } + function getTypeOfDestructuredArrayElement(type3, index4) { + return everyType(type3, isTupleLikeType) && getTupleElementType(type3, index4) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType( + 65, + type3, + undefinedType2, + /*errorNode*/ + void 0 + )) || errorType; + } + function includeUndefinedInIndexSignature(type3) { + if (!type3) + return type3; + return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type3, undefinedType2]) : type3; + } + function getTypeOfDestructuredSpreadExpression(type3) { + return createArrayType(checkIteratedTypeOrElementType( + 65, + type3, + undefinedType2, + /*errorNode*/ + void 0 + ) || errorType); + } + function getAssignedTypeOfBinaryExpression(node) { + var isDestructuringDefaultAssignment = node.parent.kind === 206 && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 299 && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); + } + function isDestructuringAssignmentTarget(parent2) { + return parent2.parent.kind === 223 && parent2.parent.left === parent2 || parent2.parent.kind === 247 && parent2.parent.initializer === parent2; + } + function getAssignedTypeOfArrayLiteralElement(node, element) { + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); + } + function getAssignedTypeOfSpreadExpression(node) { + return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); + } + function getAssignedTypeOfPropertyAssignment(node) { + return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name); + } + function getAssignedTypeOfShorthandPropertyAssignment(node) { + return getTypeWithDefault(getAssignedTypeOfPropertyAssignment(node), node.objectAssignmentInitializer); + } + function getAssignedType(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 246: + return stringType2; + case 247: + return checkRightHandSideOfForOf(parent2) || errorType; + case 223: + return getAssignedTypeOfBinaryExpression(parent2); + case 217: + return undefinedType2; + case 206: + return getAssignedTypeOfArrayLiteralElement(parent2, node); + case 227: + return getAssignedTypeOfSpreadExpression(parent2); + case 299: + return getAssignedTypeOfPropertyAssignment(parent2); + case 300: + return getAssignedTypeOfShorthandPropertyAssignment(parent2); + } + return errorType; + } + function getInitialTypeOfBindingElement(node) { + var pattern5 = node.parent; + var parentType = getInitialType(pattern5.parent); + var type3 = pattern5.kind === 203 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern5.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); + return getTypeWithDefault(type3, node.initializer); + } + function getTypeOfInitializer(node) { + var links = getNodeLinks(node); + return links.resolvedType || getTypeOfExpression(node); + } + function getInitialTypeOfVariableDeclaration(node) { + if (node.initializer) { + return getTypeOfInitializer(node.initializer); + } + if (node.parent.parent.kind === 246) { + return stringType2; + } + if (node.parent.parent.kind === 247) { + return checkRightHandSideOfForOf(node.parent.parent) || errorType; + } + return errorType; + } + function getInitialType(node) { + return node.kind === 257 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); + } + function isEmptyArrayAssignment(node) { + return node.kind === 257 && node.initializer && isEmptyArrayLiteral(node.initializer) || node.kind !== 205 && node.parent.kind === 223 && isEmptyArrayLiteral(node.parent.right); + } + function getReferenceCandidate(node) { + switch (node.kind) { + case 214: + return getReferenceCandidate(node.expression); + case 223: + switch (node.operatorToken.kind) { + case 63: + case 75: + case 76: + case 77: + return getReferenceCandidate(node.left); + case 27: + return getReferenceCandidate(node.right); + } + } + return node; + } + function getReferenceRoot(node) { + var parent2 = node.parent; + return parent2.kind === 214 || parent2.kind === 223 && parent2.operatorToken.kind === 63 && parent2.left === node || parent2.kind === 223 && parent2.operatorToken.kind === 27 && parent2.right === node ? getReferenceRoot(parent2) : node; + } + function getTypeOfSwitchClause(clause) { + if (clause.kind === 292) { + return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); + } + return neverType2; + } + function getSwitchClauseTypes(switchStatement) { + var links = getNodeLinks(switchStatement); + if (!links.switchTypes) { + links.switchTypes = []; + for (var _i = 0, _a2 = switchStatement.caseBlock.clauses; _i < _a2.length; _i++) { + var clause = _a2[_i]; + links.switchTypes.push(getTypeOfSwitchClause(clause)); + } + } + return links.switchTypes; + } + function getSwitchClauseTypeOfWitnesses(switchStatement) { + if (ts2.some(switchStatement.caseBlock.clauses, function(clause2) { + return clause2.kind === 292 && !ts2.isStringLiteralLike(clause2.expression); + })) { + return void 0; + } + var witnesses = []; + for (var _i = 0, _a2 = switchStatement.caseBlock.clauses; _i < _a2.length; _i++) { + var clause = _a2[_i]; + var text = clause.kind === 292 ? clause.expression.text : void 0; + witnesses.push(text && !ts2.contains(witnesses, text) ? text : void 0); + } + return witnesses; + } + function eachTypeContainedIn(source, types3) { + return source.flags & 1048576 ? !ts2.forEach(source.types, function(t8) { + return !ts2.contains(types3, t8); + }) : ts2.contains(types3, source); + } + function isTypeSubsetOf(source, target) { + return source === target || target.flags & 1048576 && isTypeSubsetOfUnion(source, target); + } + function isTypeSubsetOfUnion(source, target) { + if (source.flags & 1048576) { + for (var _i = 0, _a2 = source.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (!containsType(target.types, t8)) { + return false; + } + } + return true; + } + if (source.flags & 1024 && getBaseTypeOfEnumLiteralType(source) === target) { + return true; + } + return containsType(target.types, source); + } + function forEachType(type3, f8) { + return type3.flags & 1048576 ? ts2.forEach(type3.types, f8) : f8(type3); + } + function someType(type3, f8) { + return type3.flags & 1048576 ? ts2.some(type3.types, f8) : f8(type3); + } + function everyType(type3, f8) { + return type3.flags & 1048576 ? ts2.every(type3.types, f8) : f8(type3); + } + function everyContainedType(type3, f8) { + return type3.flags & 3145728 ? ts2.every(type3.types, f8) : f8(type3); + } + function filterType(type3, f8) { + if (type3.flags & 1048576) { + var types3 = type3.types; + var filtered = ts2.filter(types3, f8); + if (filtered === types3) { + return type3; + } + var origin = type3.origin; + var newOrigin = void 0; + if (origin && origin.flags & 1048576) { + var originTypes = origin.types; + var originFiltered = ts2.filter(originTypes, function(t8) { + return !!(t8.flags & 1048576) || f8(t8); + }); + if (originTypes.length - originFiltered.length === types3.length - filtered.length) { + if (originFiltered.length === 1) { + return originFiltered[0]; + } + newOrigin = createOriginUnionOrIntersectionType(1048576, originFiltered); + } + } + return getUnionTypeFromSortedList( + filtered, + type3.objectFlags, + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0, + newOrigin + ); + } + return type3.flags & 131072 || f8(type3) ? type3 : neverType2; + } + function removeType(type3, targetType) { + return filterType(type3, function(t8) { + return t8 !== targetType; + }); + } + function countTypes(type3) { + return type3.flags & 1048576 ? type3.types.length : 1; + } + function mapType2(type3, mapper, noReductions) { + if (type3.flags & 131072) { + return type3; + } + if (!(type3.flags & 1048576)) { + return mapper(type3); + } + var origin = type3.origin; + var types3 = origin && origin.flags & 1048576 ? origin.types : type3.types; + var mappedTypes; + var changed = false; + for (var _i = 0, types_16 = types3; _i < types_16.length; _i++) { + var t8 = types_16[_i]; + var mapped = t8.flags & 1048576 ? mapType2(t8, mapper, noReductions) : mapper(t8); + changed || (changed = t8 !== mapped); + if (mapped) { + if (!mappedTypes) { + mappedTypes = [mapped]; + } else { + mappedTypes.push(mapped); + } + } + } + return changed ? mappedTypes && getUnionType( + mappedTypes, + noReductions ? 0 : 1 + /* UnionReduction.Literal */ + ) : type3; + } + function mapTypeWithAlias(type3, mapper, aliasSymbol, aliasTypeArguments) { + return type3.flags & 1048576 && aliasSymbol ? getUnionType(ts2.map(type3.types, mapper), 1, aliasSymbol, aliasTypeArguments) : mapType2(type3, mapper); + } + function extractTypesOfKind(type3, kind) { + return filterType(type3, function(t8) { + return (t8.flags & kind) !== 0; + }); + } + function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) { + if (maybeTypeOfKind( + typeWithPrimitives, + 4 | 134217728 | 8 | 64 + /* TypeFlags.BigInt */ + ) && maybeTypeOfKind( + typeWithLiterals, + 128 | 134217728 | 268435456 | 256 | 2048 + /* TypeFlags.BigIntLiteral */ + )) { + return mapType2(typeWithPrimitives, function(t8) { + return t8.flags & 4 ? extractTypesOfKind( + typeWithLiterals, + 4 | 128 | 134217728 | 268435456 + /* TypeFlags.StringMapping */ + ) : isPatternLiteralType(t8) && !maybeTypeOfKind( + typeWithLiterals, + 4 | 134217728 | 268435456 + /* TypeFlags.StringMapping */ + ) ? extractTypesOfKind( + typeWithLiterals, + 128 + /* TypeFlags.StringLiteral */ + ) : t8.flags & 8 ? extractTypesOfKind( + typeWithLiterals, + 8 | 256 + /* TypeFlags.NumberLiteral */ + ) : t8.flags & 64 ? extractTypesOfKind( + typeWithLiterals, + 64 | 2048 + /* TypeFlags.BigIntLiteral */ + ) : t8; + }); + } + return typeWithPrimitives; + } + function isIncomplete(flowType) { + return flowType.flags === 0; + } + function getTypeFromFlowType(flowType) { + return flowType.flags === 0 ? flowType.type : flowType; + } + function createFlowType(type3, incomplete) { + return incomplete ? { flags: 0, type: type3.flags & 131072 ? silentNeverType : type3 } : type3; + } + function createEvolvingArrayType(elementType) { + var result2 = createObjectType( + 256 + /* ObjectFlags.EvolvingArray */ + ); + result2.elementType = elementType; + return result2; + } + function getEvolvingArrayType(elementType) { + return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); + } + function addEvolvingArrayElementType(evolvingArrayType, node) { + var elementType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node))); + return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); + } + function createFinalArrayType(elementType) { + return elementType.flags & 131072 ? autoArrayType : createArrayType(elementType.flags & 1048576 ? getUnionType( + elementType.types, + 2 + /* UnionReduction.Subtype */ + ) : elementType); + } + function getFinalArrayType(evolvingArrayType) { + return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType)); + } + function finalizeEvolvingArrayType(type3) { + return ts2.getObjectFlags(type3) & 256 ? getFinalArrayType(type3) : type3; + } + function getElementTypeOfEvolvingArrayType(type3) { + return ts2.getObjectFlags(type3) & 256 ? type3.elementType : neverType2; + } + function isEvolvingArrayTypeList(types3) { + var hasEvolvingArrayType = false; + for (var _i = 0, types_17 = types3; _i < types_17.length; _i++) { + var t8 = types_17[_i]; + if (!(t8.flags & 131072)) { + if (!(ts2.getObjectFlags(t8) & 256)) { + return false; + } + hasEvolvingArrayType = true; + } + } + return hasEvolvingArrayType; + } + function isEvolvingArrayOperationTarget(node) { + var root2 = getReferenceRoot(node); + var parent2 = root2.parent; + var isLengthPushOrUnshift = ts2.isPropertyAccessExpression(parent2) && (parent2.name.escapedText === "length" || parent2.parent.kind === 210 && ts2.isIdentifier(parent2.name) && ts2.isPushOrUnshiftIdentifier(parent2.name)); + var isElementAssignment = parent2.kind === 209 && parent2.expression === root2 && parent2.parent.kind === 223 && parent2.parent.operatorToken.kind === 63 && parent2.parent.left === parent2 && !ts2.isAssignmentTarget(parent2.parent) && isTypeAssignableToKind( + getTypeOfExpression(parent2.argumentExpression), + 296 + /* TypeFlags.NumberLike */ + ); + return isLengthPushOrUnshift || isElementAssignment; + } + function isDeclarationWithExplicitTypeAnnotation(node) { + return (ts2.isVariableDeclaration(node) || ts2.isPropertyDeclaration(node) || ts2.isPropertySignature(node) || ts2.isParameter(node)) && !!(ts2.getEffectiveTypeAnnotationNode(node) || ts2.isInJSFile(node) && ts2.hasInitializer(node) && node.initializer && ts2.isFunctionExpressionOrArrowFunction(node.initializer) && ts2.getEffectiveReturnTypeNode(node.initializer)); + } + function getExplicitTypeOfSymbol(symbol, diagnostic) { + symbol = resolveSymbol(symbol); + if (symbol.flags & (16 | 8192 | 32 | 512)) { + return getTypeOfSymbol(symbol); + } + if (symbol.flags & (3 | 4)) { + if (ts2.getCheckFlags(symbol) & 262144) { + var origin = symbol.syntheticOrigin; + if (origin && getExplicitTypeOfSymbol(origin)) { + return getTypeOfSymbol(symbol); + } + } + var declaration = symbol.valueDeclaration; + if (declaration) { + if (isDeclarationWithExplicitTypeAnnotation(declaration)) { + return getTypeOfSymbol(symbol); + } + if (ts2.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 247) { + var statement = declaration.parent.parent; + var expressionType = getTypeOfDottedName( + statement.expression, + /*diagnostic*/ + void 0 + ); + if (expressionType) { + var use = statement.awaitModifier ? 15 : 13; + return checkIteratedTypeOrElementType( + use, + expressionType, + undefinedType2, + /*errorNode*/ + void 0 + ); + } + } + if (diagnostic) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(declaration, ts2.Diagnostics._0_needs_an_explicit_type_annotation, symbolToString2(symbol))); + } + } + } + } + function getTypeOfDottedName(node, diagnostic) { + if (!(node.flags & 33554432)) { + switch (node.kind) { + case 79: + var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node)); + return getExplicitTypeOfSymbol(symbol, diagnostic); + case 108: + return getExplicitThisType(node); + case 106: + return checkSuperExpression(node); + case 208: { + var type3 = getTypeOfDottedName(node.expression, diagnostic); + if (type3) { + var name2 = node.name; + var prop = void 0; + if (ts2.isPrivateIdentifier(name2)) { + if (!type3.symbol) { + return void 0; + } + prop = getPropertyOfType(type3, ts2.getSymbolNameForPrivateIdentifier(type3.symbol, name2.escapedText)); + } else { + prop = getPropertyOfType(type3, name2.escapedText); + } + return prop && getExplicitTypeOfSymbol(prop, diagnostic); + } + return void 0; + } + case 214: + return getTypeOfDottedName(node.expression, diagnostic); + } + } + } + function getEffectsSignature(node) { + var links = getNodeLinks(node); + var signature = links.effectsSignature; + if (signature === void 0) { + var funcType = void 0; + if (node.parent.kind === 241) { + funcType = getTypeOfDottedName( + node.expression, + /*diagnostic*/ + void 0 + ); + } else if (node.expression.kind !== 106) { + if (ts2.isOptionalChain(node)) { + funcType = checkNonNullType(getOptionalExpressionType(checkExpression(node.expression), node.expression), node.expression); + } else { + funcType = checkNonNullExpression(node.expression); + } + } + var signatures = getSignaturesOfType( + funcType && getApparentType(funcType) || unknownType2, + 0 + /* SignatureKind.Call */ + ); + var candidate = signatures.length === 1 && !signatures[0].typeParameters ? signatures[0] : ts2.some(signatures, hasTypePredicateOrNeverReturnType) ? getResolvedSignature(node) : void 0; + signature = links.effectsSignature = candidate && hasTypePredicateOrNeverReturnType(candidate) ? candidate : unknownSignature; + } + return signature === unknownSignature ? void 0 : signature; + } + function hasTypePredicateOrNeverReturnType(signature) { + return !!(getTypePredicateOfSignature(signature) || signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType2).flags & 131072); + } + function getTypePredicateArgument(predicate, callExpression) { + if (predicate.kind === 1 || predicate.kind === 3) { + return callExpression.arguments[predicate.parameterIndex]; + } + var invokedExpression = ts2.skipParentheses(callExpression.expression); + return ts2.isAccessExpression(invokedExpression) ? ts2.skipParentheses(invokedExpression.expression) : void 0; + } + function reportFlowControlError(node) { + var block = ts2.findAncestor(node, ts2.isFunctionOrModuleBlock); + var sourceFile = ts2.getSourceFileOfNode(node); + var span = ts2.getSpanOfTokenAtPosition(sourceFile, block.statements.pos); + diagnostics.add(ts2.createFileDiagnostic(sourceFile, span.start, span.length, ts2.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)); + } + function isReachableFlowNode(flow2) { + var result2 = isReachableFlowNodeWorker( + flow2, + /*noCacheCheck*/ + false + ); + lastFlowNode = flow2; + lastFlowNodeReachable = result2; + return result2; + } + function isFalseExpression(expr) { + var node = ts2.skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + return node.kind === 95 || node.kind === 223 && (node.operatorToken.kind === 55 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 56 && isFalseExpression(node.left) && isFalseExpression(node.right)); + } + function isReachableFlowNodeWorker(flow2, noCacheCheck) { + while (true) { + if (flow2 === lastFlowNode) { + return lastFlowNodeReachable; + } + var flags = flow2.flags; + if (flags & 4096) { + if (!noCacheCheck) { + var id = getFlowNodeId(flow2); + var reachable = flowNodeReachable[id]; + return reachable !== void 0 ? reachable : flowNodeReachable[id] = isReachableFlowNodeWorker( + flow2, + /*noCacheCheck*/ + true + ); + } + noCacheCheck = false; + } + if (flags & (16 | 96 | 256)) { + flow2 = flow2.antecedent; + } else if (flags & 512) { + var signature = getEffectsSignature(flow2.node); + if (signature) { + var predicate = getTypePredicateOfSignature(signature); + if (predicate && predicate.kind === 3 && !predicate.type) { + var predicateArgument = flow2.node.arguments[predicate.parameterIndex]; + if (predicateArgument && isFalseExpression(predicateArgument)) { + return false; + } + } + if (getReturnTypeOfSignature(signature).flags & 131072) { + return false; + } + } + flow2 = flow2.antecedent; + } else if (flags & 4) { + return ts2.some(flow2.antecedents, function(f8) { + return isReachableFlowNodeWorker( + f8, + /*noCacheCheck*/ + false + ); + }); + } else if (flags & 8) { + var antecedents = flow2.antecedents; + if (antecedents === void 0 || antecedents.length === 0) { + return false; + } + flow2 = antecedents[0]; + } else if (flags & 128) { + if (flow2.clauseStart === flow2.clauseEnd && isExhaustiveSwitchStatement(flow2.switchStatement)) { + return false; + } + flow2 = flow2.antecedent; + } else if (flags & 1024) { + lastFlowNode = void 0; + var target = flow2.target; + var saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + var result2 = isReachableFlowNodeWorker( + flow2.antecedent, + /*noCacheCheck*/ + false + ); + target.antecedents = saveAntecedents; + return result2; + } else { + return !(flags & 1); + } + } + } + function isPostSuperFlowNode(flow2, noCacheCheck) { + while (true) { + var flags = flow2.flags; + if (flags & 4096) { + if (!noCacheCheck) { + var id = getFlowNodeId(flow2); + var postSuper = flowNodePostSuper[id]; + return postSuper !== void 0 ? postSuper : flowNodePostSuper[id] = isPostSuperFlowNode( + flow2, + /*noCacheCheck*/ + true + ); + } + noCacheCheck = false; + } + if (flags & (16 | 96 | 256 | 128)) { + flow2 = flow2.antecedent; + } else if (flags & 512) { + if (flow2.node.expression.kind === 106) { + return true; + } + flow2 = flow2.antecedent; + } else if (flags & 4) { + return ts2.every(flow2.antecedents, function(f8) { + return isPostSuperFlowNode( + f8, + /*noCacheCheck*/ + false + ); + }); + } else if (flags & 8) { + flow2 = flow2.antecedents[0]; + } else if (flags & 1024) { + var target = flow2.target; + var saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + var result2 = isPostSuperFlowNode( + flow2.antecedent, + /*noCacheCheck*/ + false + ); + target.antecedents = saveAntecedents; + return result2; + } else { + return !!(flags & 1); + } + } + } + function isConstantReference(node) { + switch (node.kind) { + case 79: { + var symbol = getResolvedSymbol(node); + return isConstVariable(symbol) || ts2.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol); + } + case 208: + case 209: + return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); + } + return false; + } + function getFlowTypeOfReference(reference, declaredType, initialType, flowContainer, flowNode) { + if (initialType === void 0) { + initialType = declaredType; + } + if (flowNode === void 0) { + flowNode = reference.flowNode; + } + var key; + var isKeySet = false; + var flowDepth = 0; + if (flowAnalysisDisabled) { + return errorType; + } + if (!flowNode) { + return declaredType; + } + flowInvocationCount++; + var sharedFlowStart = sharedFlowCount; + var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode)); + sharedFlowCount = sharedFlowStart; + var resultType = ts2.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 232 && !(resultType.flags & 131072) && getTypeWithFacts( + resultType, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ).flags & 131072) { + return declaredType; + } + return resultType === nonNullUnknownType ? unknownType2 : resultType; + function getOrSetCacheKey() { + if (isKeySet) { + return key; + } + isKeySet = true; + return key = getFlowCacheKey(reference, declaredType, initialType, flowContainer); + } + function getTypeAtFlowNode(flow2) { + if (flowDepth === 2e3) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("checkTypes", "getTypeAtFlowNode_DepthLimit", { flowId: flow2.id }); + flowAnalysisDisabled = true; + reportFlowControlError(reference); + return errorType; + } + flowDepth++; + var sharedFlow; + while (true) { + var flags = flow2.flags; + if (flags & 4096) { + for (var i7 = sharedFlowStart; i7 < sharedFlowCount; i7++) { + if (sharedFlowNodes[i7] === flow2) { + flowDepth--; + return sharedFlowTypes[i7]; + } + } + sharedFlow = flow2; + } + var type3 = void 0; + if (flags & 16) { + type3 = getTypeAtFlowAssignment(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 512) { + type3 = getTypeAtFlowCall(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 96) { + type3 = getTypeAtFlowCondition(flow2); + } else if (flags & 128) { + type3 = getTypeAtSwitchClause(flow2); + } else if (flags & 12) { + if (flow2.antecedents.length === 1) { + flow2 = flow2.antecedents[0]; + continue; + } + type3 = flags & 4 ? getTypeAtFlowBranchLabel(flow2) : getTypeAtFlowLoopLabel(flow2); + } else if (flags & 256) { + type3 = getTypeAtFlowArrayMutation(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 1024) { + var target = flow2.target; + var saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + type3 = getTypeAtFlowNode(flow2.antecedent); + target.antecedents = saveAntecedents; + } else if (flags & 2) { + var container = flow2.node; + if (container && container !== flowContainer && reference.kind !== 208 && reference.kind !== 209 && reference.kind !== 108) { + flow2 = container.flowNode; + continue; + } + type3 = initialType; + } else { + type3 = convertAutoToAny(declaredType); + } + if (sharedFlow) { + sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowTypes[sharedFlowCount] = type3; + sharedFlowCount++; + } + flowDepth--; + return type3; + } + } + function getInitialOrAssignedType(flow2) { + var node = flow2.node; + return getNarrowableTypeForReference(node.kind === 257 || node.kind === 205 ? getInitialType(node) : getAssignedType(node), reference); + } + function getTypeAtFlowAssignment(flow2) { + var node = flow2.node; + if (isMatchingReference(reference, node)) { + if (!isReachableFlowNode(flow2)) { + return unreachableNeverType; + } + if (ts2.getAssignmentTargetKind(node) === 2) { + var flowType = getTypeAtFlowNode(flow2.antecedent); + return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType)); + } + if (declaredType === autoType || declaredType === autoArrayType) { + if (isEmptyArrayAssignment(node)) { + return getEvolvingArrayType(neverType2); + } + var assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow2)); + return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType; + } + if (declaredType.flags & 1048576) { + return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow2)); + } + return declaredType; + } + if (containsMatchingReference(reference, node)) { + if (!isReachableFlowNode(flow2)) { + return unreachableNeverType; + } + if (ts2.isVariableDeclaration(node) && (ts2.isInJSFile(node) || ts2.isVarConst(node))) { + var init2 = ts2.getDeclaredExpandoInitializer(node); + if (init2 && (init2.kind === 215 || init2.kind === 216)) { + return getTypeAtFlowNode(flow2.antecedent); + } + } + return declaredType; + } + if (ts2.isVariableDeclaration(node) && node.parent.parent.kind === 246 && isMatchingReference(reference, node.parent.parent.expression)) { + return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow2.antecedent)))); + } + return void 0; + } + function narrowTypeByAssertion(type3, expr) { + var node = ts2.skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + if (node.kind === 95) { + return unreachableNeverType; + } + if (node.kind === 223) { + if (node.operatorToken.kind === 55) { + return narrowTypeByAssertion(narrowTypeByAssertion(type3, node.left), node.right); + } + if (node.operatorToken.kind === 56) { + return getUnionType([narrowTypeByAssertion(type3, node.left), narrowTypeByAssertion(type3, node.right)]); + } + } + return narrowType( + type3, + node, + /*assumeTrue*/ + true + ); + } + function getTypeAtFlowCall(flow2) { + var signature = getEffectsSignature(flow2.node); + if (signature) { + var predicate = getTypePredicateOfSignature(signature); + if (predicate && (predicate.kind === 2 || predicate.kind === 3)) { + var flowType = getTypeAtFlowNode(flow2.antecedent); + var type3 = finalizeEvolvingArrayType(getTypeFromFlowType(flowType)); + var narrowedType = predicate.type ? narrowTypeByTypePredicate( + type3, + predicate, + flow2.node, + /*assumeTrue*/ + true + ) : predicate.kind === 3 && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow2.node.arguments.length ? narrowTypeByAssertion(type3, flow2.node.arguments[predicate.parameterIndex]) : type3; + return narrowedType === type3 ? flowType : createFlowType(narrowedType, isIncomplete(flowType)); + } + if (getReturnTypeOfSignature(signature).flags & 131072) { + return unreachableNeverType; + } + } + return void 0; + } + function getTypeAtFlowArrayMutation(flow2) { + if (declaredType === autoType || declaredType === autoArrayType) { + var node = flow2.node; + var expr = node.kind === 210 ? node.expression.expression : node.left.expression; + if (isMatchingReference(reference, getReferenceCandidate(expr))) { + var flowType = getTypeAtFlowNode(flow2.antecedent); + var type3 = getTypeFromFlowType(flowType); + if (ts2.getObjectFlags(type3) & 256) { + var evolvedType_1 = type3; + if (node.kind === 210) { + for (var _i = 0, _a2 = node.arguments; _i < _a2.length; _i++) { + var arg = _a2[_i]; + evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); + } + } else { + var indexType = getContextFreeTypeOfExpression(node.left.argumentExpression); + if (isTypeAssignableToKind( + indexType, + 296 + /* TypeFlags.NumberLike */ + )) { + evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, node.right); + } + } + return evolvedType_1 === type3 ? flowType : createFlowType(evolvedType_1, isIncomplete(flowType)); + } + return flowType; + } + } + return void 0; + } + function getTypeAtFlowCondition(flow2) { + var flowType = getTypeAtFlowNode(flow2.antecedent); + var type3 = getTypeFromFlowType(flowType); + if (type3.flags & 131072) { + return flowType; + } + var assumeTrue = (flow2.flags & 32) !== 0; + var nonEvolvingType = finalizeEvolvingArrayType(type3); + var narrowedType = narrowType(nonEvolvingType, flow2.node, assumeTrue); + if (narrowedType === nonEvolvingType) { + return flowType; + } + return createFlowType(narrowedType, isIncomplete(flowType)); + } + function getTypeAtSwitchClause(flow2) { + var expr = flow2.switchStatement.expression; + var flowType = getTypeAtFlowNode(flow2.antecedent); + var type3 = getTypeFromFlowType(flowType); + if (isMatchingReference(reference, expr)) { + type3 = narrowTypeBySwitchOnDiscriminant(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } else if (expr.kind === 218 && isMatchingReference(reference, expr.expression)) { + type3 = narrowTypeBySwitchOnTypeOf(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } else { + if (strictNullChecks) { + if (optionalChainContainsReference(expr, reference)) { + type3 = narrowTypeBySwitchOptionalChainContainment(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd, function(t8) { + return !(t8.flags & (32768 | 131072)); + }); + } else if (expr.kind === 218 && optionalChainContainsReference(expr.expression, reference)) { + type3 = narrowTypeBySwitchOptionalChainContainment(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd, function(t8) { + return !(t8.flags & 131072 || t8.flags & 128 && t8.value === "undefined"); + }); + } + } + var access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + type3 = narrowTypeBySwitchOnDiscriminantProperty(type3, access2, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } + } + return createFlowType(type3, isIncomplete(flowType)); + } + function getTypeAtFlowBranchLabel(flow2) { + var antecedentTypes = []; + var subtypeReduction = false; + var seenIncomplete = false; + var bypassFlow; + for (var _i = 0, _a2 = flow2.antecedents; _i < _a2.length; _i++) { + var antecedent = _a2[_i]; + if (!bypassFlow && antecedent.flags & 128 && antecedent.clauseStart === antecedent.clauseEnd) { + bypassFlow = antecedent; + continue; + } + var flowType = getTypeAtFlowNode(antecedent); + var type3 = getTypeFromFlowType(flowType); + if (type3 === declaredType && declaredType === initialType) { + return type3; + } + ts2.pushIfUnique(antecedentTypes, type3); + if (!isTypeSubsetOf(type3, declaredType)) { + subtypeReduction = true; + } + if (isIncomplete(flowType)) { + seenIncomplete = true; + } + } + if (bypassFlow) { + var flowType = getTypeAtFlowNode(bypassFlow); + var type3 = getTypeFromFlowType(flowType); + if (!ts2.contains(antecedentTypes, type3) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) { + if (type3 === declaredType && declaredType === initialType) { + return type3; + } + antecedentTypes.push(type3); + if (!isTypeSubsetOf(type3, declaredType)) { + subtypeReduction = true; + } + if (isIncomplete(flowType)) { + seenIncomplete = true; + } + } + } + return createFlowType(getUnionOrEvolvingArrayType( + antecedentTypes, + subtypeReduction ? 2 : 1 + /* UnionReduction.Literal */ + ), seenIncomplete); + } + function getTypeAtFlowLoopLabel(flow2) { + var id = getFlowNodeId(flow2); + var cache = flowLoopCaches[id] || (flowLoopCaches[id] = new ts2.Map()); + var key2 = getOrSetCacheKey(); + if (!key2) { + return declaredType; + } + var cached = cache.get(key2); + if (cached) { + return cached; + } + for (var i7 = flowLoopStart; i7 < flowLoopCount; i7++) { + if (flowLoopNodes[i7] === flow2 && flowLoopKeys[i7] === key2 && flowLoopTypes[i7].length) { + return createFlowType( + getUnionOrEvolvingArrayType( + flowLoopTypes[i7], + 1 + /* UnionReduction.Literal */ + ), + /*incomplete*/ + true + ); + } + } + var antecedentTypes = []; + var subtypeReduction = false; + var firstAntecedentType; + for (var _i = 0, _a2 = flow2.antecedents; _i < _a2.length; _i++) { + var antecedent = _a2[_i]; + var flowType = void 0; + if (!firstAntecedentType) { + flowType = firstAntecedentType = getTypeAtFlowNode(antecedent); + } else { + flowLoopNodes[flowLoopCount] = flow2; + flowLoopKeys[flowLoopCount] = key2; + flowLoopTypes[flowLoopCount] = antecedentTypes; + flowLoopCount++; + var saveFlowTypeCache = flowTypeCache; + flowTypeCache = void 0; + flowType = getTypeAtFlowNode(antecedent); + flowTypeCache = saveFlowTypeCache; + flowLoopCount--; + var cached_1 = cache.get(key2); + if (cached_1) { + return cached_1; + } + } + var type3 = getTypeFromFlowType(flowType); + ts2.pushIfUnique(antecedentTypes, type3); + if (!isTypeSubsetOf(type3, declaredType)) { + subtypeReduction = true; + } + if (type3 === declaredType) { + break; + } + } + var result2 = getUnionOrEvolvingArrayType( + antecedentTypes, + subtypeReduction ? 2 : 1 + /* UnionReduction.Literal */ + ); + if (isIncomplete(firstAntecedentType)) { + return createFlowType( + result2, + /*incomplete*/ + true + ); + } + cache.set(key2, result2); + return result2; + } + function getUnionOrEvolvingArrayType(types3, subtypeReduction) { + if (isEvolvingArrayTypeList(types3)) { + return getEvolvingArrayType(getUnionType(ts2.map(types3, getElementTypeOfEvolvingArrayType))); + } + var result2 = recombineUnknownType(getUnionType(ts2.sameMap(types3, finalizeEvolvingArrayType), subtypeReduction)); + if (result2 !== declaredType && result2.flags & declaredType.flags & 1048576 && ts2.arraysEqual(result2.types, declaredType.types)) { + return declaredType; + } + return result2; + } + function getCandidateDiscriminantPropertyAccess(expr) { + if (ts2.isBindingPattern(reference) || ts2.isFunctionExpressionOrArrowFunction(reference) || ts2.isObjectLiteralMethod(reference)) { + if (ts2.isIdentifier(expr)) { + var symbol = getResolvedSymbol(expr); + var declaration = symbol.valueDeclaration; + if (declaration && (ts2.isBindingElement(declaration) || ts2.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { + return declaration; + } + } + } else if (ts2.isAccessExpression(expr)) { + if (isMatchingReference(reference, expr.expression)) { + return expr; + } + } else if (ts2.isIdentifier(expr)) { + var symbol = getResolvedSymbol(expr); + if (isConstVariable(symbol)) { + var declaration = symbol.valueDeclaration; + if (ts2.isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && ts2.isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) { + return declaration.initializer; + } + if (ts2.isBindingElement(declaration) && !declaration.initializer) { + var parent2 = declaration.parent.parent; + if (ts2.isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (ts2.isIdentifier(parent2.initializer) || ts2.isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) { + return declaration; + } + } + } + } + return void 0; + } + function getDiscriminantPropertyAccess(expr, computedType) { + var type3 = declaredType.flags & 1048576 ? declaredType : computedType; + if (type3.flags & 1048576) { + var access2 = getCandidateDiscriminantPropertyAccess(expr); + if (access2) { + var name2 = getAccessedPropertyName(access2); + if (name2 && isDiscriminantProperty(type3, name2)) { + return access2; + } + } + } + return void 0; + } + function narrowTypeByDiscriminant(type3, access2, narrowType2) { + var propName2 = getAccessedPropertyName(access2); + if (propName2 === void 0) { + return type3; + } + var removeNullable = strictNullChecks && ts2.isOptionalChain(access2) && maybeTypeOfKind( + type3, + 98304 + /* TypeFlags.Nullable */ + ); + var propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ) : type3, propName2); + if (!propType) { + return type3; + } + propType = removeNullable ? getOptionalType(propType) : propType; + var narrowedPropType = narrowType2(propType); + return filterType(type3, function(t8) { + var discriminantType = getTypeOfPropertyOrIndexSignature(t8, propName2); + return !(discriminantType.flags & 131072) && !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType); + }); + } + function narrowTypeByDiscriminantProperty(type3, access2, operator, value2, assumeTrue) { + if ((operator === 36 || operator === 37) && type3.flags & 1048576) { + var keyPropertyName = getKeyPropertyName(type3); + if (keyPropertyName && keyPropertyName === getAccessedPropertyName(access2)) { + var candidate = getConstituentTypeForKeyType(type3, getTypeOfExpression(value2)); + if (candidate) { + return operator === (assumeTrue ? 36 : 37) ? candidate : isUnitType(getTypeOfPropertyOfType(candidate, keyPropertyName) || unknownType2) ? removeType(type3, candidate) : type3; + } + } + } + return narrowTypeByDiscriminant(type3, access2, function(t8) { + return narrowTypeByEquality(t8, operator, value2, assumeTrue); + }); + } + function narrowTypeBySwitchOnDiscriminantProperty(type3, access2, switchStatement, clauseStart, clauseEnd) { + if (clauseStart < clauseEnd && type3.flags & 1048576 && getKeyPropertyName(type3) === getAccessedPropertyName(access2)) { + var clauseTypes = getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd); + var candidate = getUnionType(ts2.map(clauseTypes, function(t8) { + return getConstituentTypeForKeyType(type3, t8) || unknownType2; + })); + if (candidate !== unknownType2) { + return candidate; + } + } + return narrowTypeByDiscriminant(type3, access2, function(t8) { + return narrowTypeBySwitchOnDiscriminant(t8, switchStatement, clauseStart, clauseEnd); + }); + } + function narrowTypeByTruthiness(type3, expr, assumeTrue) { + if (isMatchingReference(reference, expr)) { + return getAdjustedTypeWithFacts( + type3, + assumeTrue ? 4194304 : 8388608 + /* TypeFacts.Falsy */ + ); + } + if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) { + type3 = getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ); + } + var access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, function(t8) { + return getTypeWithFacts( + t8, + assumeTrue ? 4194304 : 8388608 + /* TypeFacts.Falsy */ + ); + }); + } + return type3; + } + function isTypePresencePossible(type3, propName2, assumeTrue) { + var prop = getPropertyOfType(type3, propName2); + return prop ? !!(prop.flags & 16777216) || assumeTrue : !!getApplicableIndexInfoForName(type3, propName2) || !assumeTrue; + } + function narrowTypeByInKeyword(type3, nameType, assumeTrue) { + var name2 = getPropertyNameFromType(nameType); + var isKnownProperty2 = someType(type3, function(t8) { + return isTypePresencePossible( + t8, + name2, + /*assumeTrue*/ + true + ); + }); + if (isKnownProperty2) { + return filterType(type3, function(t8) { + return isTypePresencePossible(t8, name2, assumeTrue); + }); + } + if (assumeTrue) { + var recordSymbol = getGlobalRecordSymbol(); + if (recordSymbol) { + return getIntersectionType([type3, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType2])]); + } + } + return type3; + } + function narrowTypeByBinaryExpression(type3, expr, assumeTrue) { + switch (expr.operatorToken.kind) { + case 63: + case 75: + case 76: + case 77: + return narrowTypeByTruthiness(narrowType(type3, expr.right, assumeTrue), expr.left, assumeTrue); + case 34: + case 35: + case 36: + case 37: + var operator = expr.operatorToken.kind; + var left = getReferenceCandidate(expr.left); + var right = getReferenceCandidate(expr.right); + if (left.kind === 218 && ts2.isStringLiteralLike(right)) { + return narrowTypeByTypeof(type3, left, operator, right, assumeTrue); + } + if (right.kind === 218 && ts2.isStringLiteralLike(left)) { + return narrowTypeByTypeof(type3, right, operator, left, assumeTrue); + } + if (isMatchingReference(reference, left)) { + return narrowTypeByEquality(type3, operator, right, assumeTrue); + } + if (isMatchingReference(reference, right)) { + return narrowTypeByEquality(type3, operator, left, assumeTrue); + } + if (strictNullChecks) { + if (optionalChainContainsReference(left, reference)) { + type3 = narrowTypeByOptionalChainContainment(type3, operator, right, assumeTrue); + } else if (optionalChainContainsReference(right, reference)) { + type3 = narrowTypeByOptionalChainContainment(type3, operator, left, assumeTrue); + } + } + var leftAccess = getDiscriminantPropertyAccess(left, type3); + if (leftAccess) { + return narrowTypeByDiscriminantProperty(type3, leftAccess, operator, right, assumeTrue); + } + var rightAccess = getDiscriminantPropertyAccess(right, type3); + if (rightAccess) { + return narrowTypeByDiscriminantProperty(type3, rightAccess, operator, left, assumeTrue); + } + if (isMatchingConstructorReference(left)) { + return narrowTypeByConstructor(type3, operator, right, assumeTrue); + } + if (isMatchingConstructorReference(right)) { + return narrowTypeByConstructor(type3, operator, left, assumeTrue); + } + break; + case 102: + return narrowTypeByInstanceof(type3, expr, assumeTrue); + case 101: + if (ts2.isPrivateIdentifier(expr.left)) { + return narrowTypeByPrivateIdentifierInInExpression(type3, expr, assumeTrue); + } + var target = getReferenceCandidate(expr.right); + var leftType = getTypeOfExpression(expr.left); + if (leftType.flags & 8576) { + if (containsMissingType(type3) && ts2.isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) { + return getTypeWithFacts( + type3, + assumeTrue ? 524288 : 65536 + /* TypeFacts.EQUndefined */ + ); + } + if (isMatchingReference(reference, target)) { + return narrowTypeByInKeyword(type3, leftType, assumeTrue); + } + } + break; + case 27: + return narrowType(type3, expr.right, assumeTrue); + case 55: + return assumeTrue ? narrowType( + narrowType( + type3, + expr.left, + /*assumeTrue*/ + true + ), + expr.right, + /*assumeTrue*/ + true + ) : getUnionType([narrowType( + type3, + expr.left, + /*assumeTrue*/ + false + ), narrowType( + type3, + expr.right, + /*assumeTrue*/ + false + )]); + case 56: + return assumeTrue ? getUnionType([narrowType( + type3, + expr.left, + /*assumeTrue*/ + true + ), narrowType( + type3, + expr.right, + /*assumeTrue*/ + true + )]) : narrowType( + narrowType( + type3, + expr.left, + /*assumeTrue*/ + false + ), + expr.right, + /*assumeTrue*/ + false + ); + } + return type3; + } + function narrowTypeByPrivateIdentifierInInExpression(type3, expr, assumeTrue) { + var target = getReferenceCandidate(expr.right); + if (!isMatchingReference(reference, target)) { + return type3; + } + ts2.Debug.assertNode(expr.left, ts2.isPrivateIdentifier); + var symbol = getSymbolForPrivateIdentifierExpression(expr.left); + if (symbol === void 0) { + return type3; + } + var classSymbol = symbol.parent; + var targetType = ts2.hasStaticModifier(ts2.Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); + return getNarrowedType( + type3, + targetType, + assumeTrue, + /*checkDerived*/ + true + ); + } + function narrowTypeByOptionalChainContainment(type3, operator, value2, assumeTrue) { + var equalsOperator = operator === 34 || operator === 36; + var nullableFlags = operator === 34 || operator === 35 ? 98304 : 32768; + var valueType = getTypeOfExpression(value2); + var removeNullable = equalsOperator !== assumeTrue && everyType(valueType, function(t8) { + return !!(t8.flags & nullableFlags); + }) || equalsOperator === assumeTrue && everyType(valueType, function(t8) { + return !(t8.flags & (3 | nullableFlags)); + }); + return removeNullable ? getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ) : type3; + } + function narrowTypeByEquality(type3, operator, value2, assumeTrue) { + if (type3.flags & 1) { + return type3; + } + if (operator === 35 || operator === 37) { + assumeTrue = !assumeTrue; + } + var valueType = getTypeOfExpression(value2); + var doubleEquals = operator === 34 || operator === 35; + if (valueType.flags & 98304) { + if (!strictNullChecks) { + return type3; + } + var facts = doubleEquals ? assumeTrue ? 262144 : 2097152 : valueType.flags & 65536 ? assumeTrue ? 131072 : 1048576 : assumeTrue ? 65536 : 524288; + return getAdjustedTypeWithFacts(type3, facts); + } + if (assumeTrue) { + if (!doubleEquals && (type3.flags & 2 || someType(type3, isEmptyAnonymousObjectType))) { + if (valueType.flags & (131068 | 67108864) || isEmptyAnonymousObjectType(valueType)) { + return valueType; + } + if (valueType.flags & 524288) { + return nonPrimitiveType; + } + } + var filteredType = filterType(type3, function(t8) { + return areTypesComparable(t8, valueType) || doubleEquals && isCoercibleUnderDoubleEquals(t8, valueType); + }); + return replacePrimitivesWithLiterals(filteredType, valueType); + } + if (isUnitType(valueType)) { + return filterType(type3, function(t8) { + return !(isUnitLikeType(t8) && areTypesComparable(t8, valueType)); + }); + } + return type3; + } + function narrowTypeByTypeof(type3, typeOfExpr, operator, literal, assumeTrue) { + if (operator === 35 || operator === 37) { + assumeTrue = !assumeTrue; + } + var target = getReferenceCandidate(typeOfExpr.expression); + if (!isMatchingReference(reference, target)) { + var propertyAccess = getDiscriminantPropertyAccess(typeOfExpr.expression, type3); + if (propertyAccess) { + return narrowTypeByDiscriminant(type3, propertyAccess, function(t8) { + return narrowTypeByLiteralExpression(t8, literal, assumeTrue); + }); + } + if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) { + return getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ); + } + return type3; + } + return narrowTypeByLiteralExpression(type3, literal, assumeTrue); + } + function narrowTypeByLiteralExpression(type3, literal, assumeTrue) { + return assumeTrue ? narrowTypeByTypeName(type3, literal.text) : getTypeWithFacts( + type3, + typeofNEFacts.get(literal.text) || 32768 + /* TypeFacts.TypeofNEHostObject */ + ); + } + function narrowTypeBySwitchOptionalChainContainment(type3, switchStatement, clauseStart, clauseEnd, clauseCheck) { + var everyClauseChecks = clauseStart !== clauseEnd && ts2.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); + return everyClauseChecks ? getTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ) : type3; + } + function narrowTypeBySwitchOnDiscriminant(type3, switchStatement, clauseStart, clauseEnd) { + var switchTypes = getSwitchClauseTypes(switchStatement); + if (!switchTypes.length) { + return type3; + } + var clauseTypes = switchTypes.slice(clauseStart, clauseEnd); + var hasDefaultClause = clauseStart === clauseEnd || ts2.contains(clauseTypes, neverType2); + if (type3.flags & 2 && !hasDefaultClause) { + var groundClauseTypes = void 0; + for (var i7 = 0; i7 < clauseTypes.length; i7 += 1) { + var t8 = clauseTypes[i7]; + if (t8.flags & (131068 | 67108864)) { + if (groundClauseTypes !== void 0) { + groundClauseTypes.push(t8); + } + } else if (t8.flags & 524288) { + if (groundClauseTypes === void 0) { + groundClauseTypes = clauseTypes.slice(0, i7); + } + groundClauseTypes.push(nonPrimitiveType); + } else { + return type3; + } + } + return getUnionType(groundClauseTypes === void 0 ? clauseTypes : groundClauseTypes); + } + var discriminantType = getUnionType(clauseTypes); + var caseType = discriminantType.flags & 131072 ? neverType2 : replacePrimitivesWithLiterals(filterType(type3, function(t9) { + return areTypesComparable(discriminantType, t9); + }), discriminantType); + if (!hasDefaultClause) { + return caseType; + } + var defaultType = filterType(type3, function(t9) { + return !(isUnitLikeType(t9) && ts2.contains(switchTypes, getRegularTypeOfLiteralType(extractUnitType(t9)))); + }); + return caseType.flags & 131072 ? defaultType : getUnionType([caseType, defaultType]); + } + function narrowTypeByTypeName(type3, typeName) { + switch (typeName) { + case "string": + return narrowTypeByTypeFacts( + type3, + stringType2, + 1 + /* TypeFacts.TypeofEQString */ + ); + case "number": + return narrowTypeByTypeFacts( + type3, + numberType2, + 2 + /* TypeFacts.TypeofEQNumber */ + ); + case "bigint": + return narrowTypeByTypeFacts( + type3, + bigintType, + 4 + /* TypeFacts.TypeofEQBigInt */ + ); + case "boolean": + return narrowTypeByTypeFacts( + type3, + booleanType2, + 8 + /* TypeFacts.TypeofEQBoolean */ + ); + case "symbol": + return narrowTypeByTypeFacts( + type3, + esSymbolType, + 16 + /* TypeFacts.TypeofEQSymbol */ + ); + case "object": + return type3.flags & 1 ? type3 : getUnionType([narrowTypeByTypeFacts( + type3, + nonPrimitiveType, + 32 + /* TypeFacts.TypeofEQObject */ + ), narrowTypeByTypeFacts( + type3, + nullType2, + 131072 + /* TypeFacts.EQNull */ + )]); + case "function": + return type3.flags & 1 ? type3 : narrowTypeByTypeFacts( + type3, + globalFunctionType, + 64 + /* TypeFacts.TypeofEQFunction */ + ); + case "undefined": + return narrowTypeByTypeFacts( + type3, + undefinedType2, + 65536 + /* TypeFacts.EQUndefined */ + ); + } + return narrowTypeByTypeFacts( + type3, + nonPrimitiveType, + 128 + /* TypeFacts.TypeofEQHostObject */ + ); + } + function narrowTypeByTypeFacts(type3, impliedType, facts) { + return mapType2(type3, function(t8) { + return isTypeRelatedTo(t8, impliedType, strictSubtypeRelation) ? getTypeFacts(t8) & facts ? t8 : neverType2 : ( + // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied + // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`. + isTypeSubtypeOf(impliedType, t8) ? impliedType : ( + // Neither the constituent nor the implied type is a subtype of the other, however their domains may still + // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate + // possible overlap, we form an intersection. Otherwise, we eliminate the constituent. + getTypeFacts(t8) & facts ? getIntersectionType([t8, impliedType]) : neverType2 + ) + ); + }); + } + function narrowTypeBySwitchOnTypeOf(type3, switchStatement, clauseStart, clauseEnd) { + var witnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + if (!witnesses) { + return type3; + } + var defaultIndex = ts2.findIndex(switchStatement.caseBlock.clauses, function(clause) { + return clause.kind === 293; + }); + var hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; + if (hasDefaultClause) { + var notEqualFacts_1 = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses); + return filterType(type3, function(t8) { + return (getTypeFacts(t8) & notEqualFacts_1) === notEqualFacts_1; + }); + } + var clauseWitnesses = witnesses.slice(clauseStart, clauseEnd); + return getUnionType(ts2.map(clauseWitnesses, function(text) { + return text ? narrowTypeByTypeName(type3, text) : neverType2; + })); + } + function isMatchingConstructorReference(expr) { + return (ts2.isPropertyAccessExpression(expr) && ts2.idText(expr.name) === "constructor" || ts2.isElementAccessExpression(expr) && ts2.isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression); + } + function narrowTypeByConstructor(type3, operator, identifier, assumeTrue) { + if (assumeTrue ? operator !== 34 && operator !== 36 : operator !== 35 && operator !== 37) { + return type3; + } + var identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type3; + } + var prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type3; + } + var prototypeType = getTypeOfSymbol(prototypeProperty); + var candidate = !isTypeAny(prototypeType) ? prototypeType : void 0; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type3; + } + if (isTypeAny(type3)) { + return candidate; + } + return filterType(type3, function(t8) { + return isConstructedBy(t8, candidate); + }); + function isConstructedBy(source, target) { + if (source.flags & 524288 && ts2.getObjectFlags(source) & 1 || target.flags & 524288 && ts2.getObjectFlags(target) & 1) { + return source.symbol === target.symbol; + } + return isTypeSubtypeOf(source, target); + } + } + function narrowTypeByInstanceof(type3, expr, assumeTrue) { + var left = getReferenceCandidate(expr.left); + if (!isMatchingReference(reference, left)) { + if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) { + return getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ); + } + return type3; + } + var rightType = getTypeOfExpression(expr.right); + if (!isTypeDerivedFrom(rightType, globalFunctionType)) { + return type3; + } + var targetType; + var prototypeProperty = getPropertyOfType(rightType, "prototype"); + if (prototypeProperty) { + var prototypePropertyType = getTypeOfSymbol(prototypeProperty); + if (!isTypeAny(prototypePropertyType)) { + targetType = prototypePropertyType; + } + } + if (isTypeAny(type3) && (targetType === globalObjectType || targetType === globalFunctionType)) { + return type3; + } + if (!targetType) { + var constructSignatures = getSignaturesOfType( + rightType, + 1 + /* SignatureKind.Construct */ + ); + targetType = constructSignatures.length ? getUnionType(ts2.map(constructSignatures, function(signature) { + return getReturnTypeOfSignature(getErasedSignature(signature)); + })) : emptyObjectType; + } + if (!assumeTrue && rightType.flags & 1048576) { + var nonConstructorTypeInUnion = ts2.find(rightType.types, function(t8) { + return !isConstructorType(t8); + }); + if (!nonConstructorTypeInUnion) + return type3; + } + return getNarrowedType( + type3, + targetType, + assumeTrue, + /*checkDerived*/ + true + ); + } + function getNarrowedType(type3, candidate, assumeTrue, checkDerived) { + var _a2; + var key2 = type3.flags & 1048576 ? "N".concat(getTypeId(type3), ",").concat(getTypeId(candidate), ",").concat((assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)) : void 0; + return (_a2 = getCachedType(key2)) !== null && _a2 !== void 0 ? _a2 : setCachedType(key2, getNarrowedTypeWorker(type3, candidate, assumeTrue, checkDerived)); + } + function getNarrowedTypeWorker(type3, candidate, assumeTrue, checkDerived) { + var isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; + if (!assumeTrue) { + return filterType(type3, function(t8) { + return !isRelated(t8, candidate); + }); + } + if (type3.flags & 3) { + return candidate; + } + var keyPropertyName = type3.flags & 1048576 ? getKeyPropertyName(type3) : void 0; + var narrowedType = mapType2(candidate, function(c7) { + var discriminant = keyPropertyName && getTypeOfPropertyOfType(c7, keyPropertyName); + var matching = discriminant && getConstituentTypeForKeyType(type3, discriminant); + var directlyRelated = mapType2(matching || type3, checkDerived ? function(t8) { + return isTypeDerivedFrom(t8, c7) ? t8 : isTypeDerivedFrom(c7, t8) ? c7 : neverType2; + } : function(t8) { + return isTypeSubtypeOf(c7, t8) ? c7 : isTypeSubtypeOf(t8, c7) ? t8 : neverType2; + }); + return directlyRelated.flags & 131072 ? mapType2(type3, function(t8) { + return maybeTypeOfKind( + t8, + 465829888 + /* TypeFlags.Instantiable */ + ) && isRelated(c7, getBaseConstraintOfType(t8) || unknownType2) ? getIntersectionType([t8, c7]) : neverType2; + }) : directlyRelated; + }); + return !(narrowedType.flags & 131072) ? narrowedType : isTypeSubtypeOf(candidate, type3) ? candidate : isTypeAssignableTo(type3, candidate) ? type3 : isTypeAssignableTo(candidate, type3) ? candidate : getIntersectionType([type3, candidate]); + } + function narrowTypeByCallExpression(type3, callExpression, assumeTrue) { + if (hasMatchingArgument(callExpression, reference)) { + var signature = assumeTrue || !ts2.isCallChain(callExpression) ? getEffectsSignature(callExpression) : void 0; + var predicate = signature && getTypePredicateOfSignature(signature); + if (predicate && (predicate.kind === 0 || predicate.kind === 1)) { + return narrowTypeByTypePredicate(type3, predicate, callExpression, assumeTrue); + } + } + if (containsMissingType(type3) && ts2.isAccessExpression(reference) && ts2.isPropertyAccessExpression(callExpression.expression)) { + var callAccess = callExpression.expression; + if (isMatchingReference(reference.expression, getReferenceCandidate(callAccess.expression)) && ts2.isIdentifier(callAccess.name) && callAccess.name.escapedText === "hasOwnProperty" && callExpression.arguments.length === 1) { + var argument = callExpression.arguments[0]; + if (ts2.isStringLiteralLike(argument) && getAccessedPropertyName(reference) === ts2.escapeLeadingUnderscores(argument.text)) { + return getTypeWithFacts( + type3, + assumeTrue ? 524288 : 65536 + /* TypeFacts.EQUndefined */ + ); + } + } + } + return type3; + } + function narrowTypeByTypePredicate(type3, predicate, callExpression, assumeTrue) { + if (predicate.type && !(isTypeAny(type3) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) { + var predicateArgument = getTypePredicateArgument(predicate, callExpression); + if (predicateArgument) { + if (isMatchingReference(reference, predicateArgument)) { + return getNarrowedType( + type3, + predicate.type, + assumeTrue, + /*checkDerived*/ + false + ); + } + if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !(getTypeFacts(predicate.type) & 65536)) { + type3 = getAdjustedTypeWithFacts( + type3, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ); + } + var access2 = getDiscriminantPropertyAccess(predicateArgument, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, function(t8) { + return getNarrowedType( + t8, + predicate.type, + assumeTrue, + /*checkDerived*/ + false + ); + }); + } + } + } + return type3; + } + function narrowType(type3, expr, assumeTrue) { + if (ts2.isExpressionOfOptionalChainRoot(expr) || ts2.isBinaryExpression(expr.parent) && expr.parent.operatorToken.kind === 60 && expr.parent.left === expr) { + return narrowTypeByOptionality(type3, expr, assumeTrue); + } + switch (expr.kind) { + case 79: + if (!isMatchingReference(reference, expr) && inlineLevel < 5) { + var symbol = getResolvedSymbol(expr); + if (isConstVariable(symbol)) { + var declaration = symbol.valueDeclaration; + if (declaration && ts2.isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isConstantReference(reference)) { + inlineLevel++; + var result2 = narrowType(type3, declaration.initializer, assumeTrue); + inlineLevel--; + return result2; + } + } + } + case 108: + case 106: + case 208: + case 209: + return narrowTypeByTruthiness(type3, expr, assumeTrue); + case 210: + return narrowTypeByCallExpression(type3, expr, assumeTrue); + case 214: + case 232: + return narrowType(type3, expr.expression, assumeTrue); + case 223: + return narrowTypeByBinaryExpression(type3, expr, assumeTrue); + case 221: + if (expr.operator === 53) { + return narrowType(type3, expr.operand, !assumeTrue); + } + break; + } + return type3; + } + function narrowTypeByOptionality(type3, expr, assumePresent) { + if (isMatchingReference(reference, expr)) { + return getAdjustedTypeWithFacts( + type3, + assumePresent ? 2097152 : 262144 + /* TypeFacts.EQUndefinedOrNull */ + ); + } + var access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, function(t8) { + return getTypeWithFacts( + t8, + assumePresent ? 2097152 : 262144 + /* TypeFacts.EQUndefinedOrNull */ + ); + }); + } + return type3; + } + } + function getTypeOfSymbolAtLocation(symbol, location2) { + symbol = symbol.exportSymbol || symbol; + if (location2.kind === 79 || location2.kind === 80) { + if (ts2.isRightSideOfQualifiedNameOrPropertyAccess(location2)) { + location2 = location2.parent; + } + if (ts2.isExpressionNode(location2) && (!ts2.isAssignmentTarget(location2) || ts2.isWriteAccess(location2))) { + var type3 = getTypeOfExpression(location2); + if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location2).resolvedSymbol) === symbol) { + return type3; + } + } + } + if (ts2.isDeclarationName(location2) && ts2.isSetAccessor(location2.parent) && getAnnotatedAccessorTypeNode(location2.parent)) { + return getWriteTypeOfAccessors(location2.parent.symbol); + } + return getNonMissingTypeOfSymbol(symbol); + } + function getControlFlowContainer(node) { + return ts2.findAncestor(node.parent, function(node2) { + return ts2.isFunctionLike(node2) && !ts2.getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 265 || node2.kind === 308 || node2.kind === 169; + }); + } + function isSymbolAssigned(symbol) { + if (!symbol.valueDeclaration) { + return false; + } + var parent2 = ts2.getRootDeclaration(symbol.valueDeclaration).parent; + var links = getNodeLinks(parent2); + if (!(links.flags & 8388608)) { + links.flags |= 8388608; + if (!hasParentWithAssignmentsMarked(parent2)) { + markNodeAssignments(parent2); + } + } + return symbol.isAssigned || false; + } + function hasParentWithAssignmentsMarked(node) { + return !!ts2.findAncestor(node.parent, function(node2) { + return (ts2.isFunctionLike(node2) || ts2.isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 8388608); + }); + } + function markNodeAssignments(node) { + if (node.kind === 79) { + if (ts2.isAssignmentTarget(node)) { + var symbol = getResolvedSymbol(node); + if (ts2.isParameterOrCatchClauseVariable(symbol)) { + symbol.isAssigned = true; + } + } + } else { + ts2.forEachChild(node, markNodeAssignments); + } + } + function isConstVariable(symbol) { + return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 2) !== 0; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + if (pushTypeResolution( + declaration.symbol, + 2 + /* TypeSystemPropertyName.DeclaredType */ + )) { + var annotationIncludesUndefined = strictNullChecks && declaration.kind === 166 && declaration.initializer && getTypeFacts(declaredType) & 16777216 && !(getTypeFacts(checkExpression(declaration.initializer)) & 16777216); + popTypeResolution(); + return annotationIncludesUndefined ? getTypeWithFacts( + declaredType, + 524288 + /* TypeFacts.NEUndefined */ + ) : declaredType; + } else { + reportCircularityError(declaration.symbol); + return declaredType; + } + } + function isConstraintPosition(type3, node) { + var parent2 = node.parent; + return parent2.kind === 208 || parent2.kind === 163 || parent2.kind === 210 && parent2.expression === node || parent2.kind === 209 && parent2.expression === node && !(someType(type3, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression))); + } + function isGenericTypeWithUnionConstraint(type3) { + return type3.flags & 2097152 ? ts2.some(type3.types, isGenericTypeWithUnionConstraint) : !!(type3.flags & 465829888 && getBaseConstraintOrType(type3).flags & (98304 | 1048576)); + } + function isGenericTypeWithoutNullableConstraint(type3) { + return type3.flags & 2097152 ? ts2.some(type3.types, isGenericTypeWithoutNullableConstraint) : !!(type3.flags & 465829888 && !maybeTypeOfKind( + getBaseConstraintOrType(type3), + 98304 + /* TypeFlags.Nullable */ + )); + } + function hasContextualTypeWithNoGenericTypes(node, checkMode) { + var contextualType = (ts2.isIdentifier(node) || ts2.isPropertyAccessExpression(node) || ts2.isElementAccessExpression(node)) && !((ts2.isJsxOpeningElement(node.parent) || ts2.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 ? getContextualType( + node, + 8 + /* ContextFlags.SkipBindingPatterns */ + ) : getContextualType( + node, + /*contextFlags*/ + void 0 + )); + return contextualType && !isGenericType(contextualType); + } + function getNarrowableTypeForReference(type3, reference, checkMode) { + var substituteConstraints = !(checkMode && checkMode & 2) && someType(type3, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type3, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode)); + return substituteConstraints ? mapType2(type3, getBaseConstraintOrType) : type3; + } + function isExportOrExportExpression(location2) { + return !!ts2.findAncestor(location2, function(n7) { + var parent2 = n7.parent; + if (parent2 === void 0) { + return "quit"; + } + if (ts2.isExportAssignment(parent2)) { + return parent2.expression === n7 && ts2.isEntityNameExpression(n7); + } + if (ts2.isExportSpecifier(parent2)) { + return parent2.name === n7 || parent2.propertyName === n7; + } + return false; + }); + } + function markAliasReferenced(symbol, location2) { + if (isNonLocalAlias( + symbol, + /*excludes*/ + 111551 + /* SymbolFlags.Value */ + ) && !isInTypeQuery(location2) && !getTypeOnlyAliasDeclaration( + symbol, + 111551 + /* SymbolFlags.Value */ + )) { + var target = resolveAlias(symbol); + if (getAllSymbolFlags(target) & (111551 | 1048576)) { + if (compilerOptions.isolatedModules || ts2.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location2) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + markAliasSymbolAsReferenced(symbol); + } else { + markConstEnumAliasAsReferenced(symbol); + } + } + } + } + function getNarrowedTypeOfSymbol(symbol, location2) { + var declaration = symbol.valueDeclaration; + if (declaration) { + if (ts2.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { + var parent2 = declaration.parent.parent; + if (parent2.kind === 257 && ts2.getCombinedNodeFlags(declaration) & 2 || parent2.kind === 166) { + var links = getNodeLinks(parent2); + if (!(links.flags & 268435456)) { + links.flags |= 268435456; + var parentType = getTypeForBindingElementParent( + parent2, + 0 + /* CheckMode.Normal */ + ); + var parentTypeConstraint = parentType && mapType2(parentType, getBaseConstraintOrType); + links.flags &= ~268435456; + if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 && !(parent2.kind === 166 && isSymbolAssigned(symbol))) { + var pattern5 = declaration.parent; + var narrowedType = getFlowTypeOfReference( + pattern5, + parentTypeConstraint, + parentTypeConstraint, + /*flowContainer*/ + void 0, + location2.flowNode + ); + if (narrowedType.flags & 131072) { + return neverType2; + } + return getBindingElementTypeFromParentType(declaration, narrowedType); + } + } + } + } + if (ts2.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) { + var func = declaration.parent; + if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + var contextualSignature = getContextualSignature(func); + if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { + var restType = getReducedApparentType(getTypeOfSymbol(contextualSignature.parameters[0])); + if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) { + var narrowedType = getFlowTypeOfReference( + func, + restType, + restType, + /*flowContainer*/ + void 0, + location2.flowNode + ); + var index4 = func.parameters.indexOf(declaration) - (ts2.getThisParameter(func) ? 1 : 0); + return getIndexedAccessType(narrowedType, getNumberLiteralType(index4)); + } + } + } + } + } + return getTypeOfSymbol(symbol); + } + function checkIdentifier(node, checkMode) { + if (ts2.isThisInTypeQuery(node)) { + return checkThisExpression(node); + } + var symbol = getResolvedSymbol(node); + if (symbol === unknownSymbol) { + return errorType; + } + if (symbol === argumentsSymbol) { + if (isInPropertyInitializerOrClassStaticBlock(node)) { + error2(node, ts2.Diagnostics.arguments_cannot_be_referenced_in_property_initializers); + return errorType; + } + var container = ts2.getContainingFunction(node); + if (languageVersion < 2) { + if (container.kind === 216) { + error2(node, ts2.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); + } else if (ts2.hasSyntacticModifier( + container, + 512 + /* ModifierFlags.Async */ + )) { + error2(node, ts2.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); + } + } + getNodeLinks(container).flags |= 8192; + return getTypeOfSymbol(symbol); + } + if (shouldMarkIdentifierAliasReferenced(node)) { + markAliasReferenced(symbol, node); + } + var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); + var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node); + if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) { + addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText); + } + var declaration = localOrExportSymbol.valueDeclaration; + if (declaration && localOrExportSymbol.flags & 32) { + if (declaration.kind === 260 && ts2.nodeIsDecorated(declaration)) { + var container = ts2.getContainingClass(node); + while (container !== void 0) { + if (container === declaration && container.name !== node) { + getNodeLinks(declaration).flags |= 16777216; + getNodeLinks(node).flags |= 33554432; + break; + } + container = ts2.getContainingClass(container); + } + } else if (declaration.kind === 228) { + var container = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + while (container.kind !== 308) { + if (container.parent === declaration) { + if (ts2.isPropertyDeclaration(container) && ts2.isStatic(container) || ts2.isClassStaticBlockDeclaration(container)) { + getNodeLinks(declaration).flags |= 16777216; + getNodeLinks(node).flags |= 33554432; + } + break; + } + container = ts2.getThisContainer( + container, + /*includeArrowFunctions*/ + false + ); + } + } + } + checkNestedBlockScopedBinding(node, symbol); + var type3 = getNarrowedTypeOfSymbol(localOrExportSymbol, node); + var assignmentKind = ts2.getAssignmentTargetKind(node); + if (assignmentKind) { + if (!(localOrExportSymbol.flags & 3) && !(ts2.isInJSFile(node) && localOrExportSymbol.flags & 512)) { + var assignmentError = localOrExportSymbol.flags & 384 ? ts2.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum : localOrExportSymbol.flags & 32 ? ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_class : localOrExportSymbol.flags & 1536 ? ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace : localOrExportSymbol.flags & 16 ? ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_function : localOrExportSymbol.flags & 2097152 ? ts2.Diagnostics.Cannot_assign_to_0_because_it_is_an_import : ts2.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable; + error2(node, assignmentError, symbolToString2(symbol)); + return errorType; + } + if (isReadonlySymbol(localOrExportSymbol)) { + if (localOrExportSymbol.flags & 3) { + error2(node, ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString2(symbol)); + } else { + error2(node, ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString2(symbol)); + } + return errorType; + } + } + var isAlias2 = localOrExportSymbol.flags & 2097152; + if (localOrExportSymbol.flags & 3) { + if (assignmentKind === 1) { + return type3; + } + } else if (isAlias2) { + declaration = getDeclarationOfAliasSymbol(symbol); + } else { + return type3; + } + if (!declaration) { + return type3; + } + type3 = getNarrowableTypeForReference(type3, node, checkMode); + var isParameter = ts2.getRootDeclaration(declaration).kind === 166; + var declarationContainer = getControlFlowContainer(declaration); + var flowContainer = getControlFlowContainer(node); + var isOuterVariable = flowContainer !== declarationContainer; + var isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && ts2.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); + var isModuleExports = symbol.flags & 134217728; + while (flowContainer !== declarationContainer && (flowContainer.kind === 215 || flowContainer.kind === 216 || ts2.isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstVariable(localOrExportSymbol) && type3 !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) { + flowContainer = getControlFlowContainer(flowContainer); + } + var assumeInitialized = isParameter || isAlias2 || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type3 !== autoType && type3 !== autoArrayType && (!strictNullChecks || (type3.flags & (3 | 16384)) !== 0 || isInTypeQuery(node) || node.parent.kind === 278) || node.parent.kind === 232 || declaration.kind === 257 && declaration.exclamationToken || declaration.flags & 16777216; + var initialType = assumeInitialized ? isParameter ? removeOptionalityFromDeclaredType(type3, declaration) : type3 : type3 === autoType || type3 === autoArrayType ? undefinedType2 : getOptionalType(type3); + var flowType = getFlowTypeOfReference(node, type3, initialType, flowContainer); + if (!isEvolvingArrayOperationTarget(node) && (type3 === autoType || type3 === autoArrayType)) { + if (flowType === autoType || flowType === autoArrayType) { + if (noImplicitAny) { + error2(ts2.getNameOfDeclaration(declaration), ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString2(symbol), typeToString(flowType)); + error2(node, ts2.Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + return convertAutoToAny(flowType); + } + } else if (!assumeInitialized && !containsUndefinedType(type3) && containsUndefinedType(flowType)) { + error2(node, ts2.Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString2(symbol)); + return type3; + } + return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; + } + function isSameScopedBindingElement(node, declaration) { + if (ts2.isBindingElement(declaration)) { + var bindingElement = ts2.findAncestor(node, ts2.isBindingElement); + return bindingElement && ts2.getRootDeclaration(bindingElement) === ts2.getRootDeclaration(declaration); + } + } + function shouldMarkIdentifierAliasReferenced(node) { + var _a2; + var parent2 = node.parent; + if (parent2) { + if (ts2.isPropertyAccessExpression(parent2) && parent2.expression === node) { + return false; + } + if (ts2.isExportSpecifier(parent2) && parent2.isTypeOnly) { + return false; + } + var greatGrandparent = (_a2 = parent2.parent) === null || _a2 === void 0 ? void 0 : _a2.parent; + if (greatGrandparent && ts2.isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) { + return false; + } + } + return true; + } + function isInsideFunctionOrInstancePropertyInitializer(node, threshold) { + return !!ts2.findAncestor(node, function(n7) { + return n7 === threshold ? "quit" : ts2.isFunctionLike(n7) || n7.parent && ts2.isPropertyDeclaration(n7.parent) && !ts2.hasStaticModifier(n7.parent) && n7.parent.initializer === n7; + }); + } + function getPartOfForStatementContainingNode(node, container) { + return ts2.findAncestor(node, function(n7) { + return n7 === container ? "quit" : n7 === container.initializer || n7 === container.condition || n7 === container.incrementor || n7 === container.statement; + }); + } + function getEnclosingIterationStatement(node) { + return ts2.findAncestor(node, function(n7) { + return !n7 || ts2.nodeStartsNewLexicalEnvironment(n7) ? "quit" : ts2.isIterationStatement( + n7, + /*lookInLabeledStatements*/ + false + ); + }); + } + function checkNestedBlockScopedBinding(node, symbol) { + if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || !symbol.valueDeclaration || ts2.isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 295) { + return; + } + var container = ts2.getEnclosingBlockScopeContainer(symbol.valueDeclaration); + var isCaptured = isInsideFunctionOrInstancePropertyInitializer(node, container); + var enclosingIterationStatement = getEnclosingIterationStatement(container); + if (enclosingIterationStatement) { + if (isCaptured) { + var capturesBlockScopeBindingInLoopBody = true; + if (ts2.isForStatement(container)) { + var varDeclList = ts2.getAncestor( + symbol.valueDeclaration, + 258 + /* SyntaxKind.VariableDeclarationList */ + ); + if (varDeclList && varDeclList.parent === container) { + var part = getPartOfForStatementContainingNode(node.parent, container); + if (part) { + var links = getNodeLinks(part); + links.flags |= 131072; + var capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []); + ts2.pushIfUnique(capturedBindings, symbol); + if (part === container.initializer) { + capturesBlockScopeBindingInLoopBody = false; + } + } + } + } + if (capturesBlockScopeBindingInLoopBody) { + getNodeLinks(enclosingIterationStatement).flags |= 65536; + } + } + if (ts2.isForStatement(container)) { + var varDeclList = ts2.getAncestor( + symbol.valueDeclaration, + 258 + /* SyntaxKind.VariableDeclarationList */ + ); + if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { + getNodeLinks(symbol.valueDeclaration).flags |= 4194304; + } + } + getNodeLinks(symbol.valueDeclaration).flags |= 524288; + } + if (isCaptured) { + getNodeLinks(symbol.valueDeclaration).flags |= 262144; + } + } + function isBindingCapturedByNode(node, decl) { + var links = getNodeLinks(node); + return !!links && ts2.contains(links.capturedBlockScopeBindings, getSymbolOfNode(decl)); + } + function isAssignedInBodyOfForStatement(node, container) { + var current = node; + while (current.parent.kind === 214) { + current = current.parent; + } + var isAssigned = false; + if (ts2.isAssignmentTarget(current)) { + isAssigned = true; + } else if (current.parent.kind === 221 || current.parent.kind === 222) { + var expr = current.parent; + isAssigned = expr.operator === 45 || expr.operator === 46; + } + if (!isAssigned) { + return false; + } + return !!ts2.findAncestor(current, function(n7) { + return n7 === container ? "quit" : n7 === container.statement; + }); + } + function captureLexicalThis(node, container) { + getNodeLinks(node).flags |= 2; + if (container.kind === 169 || container.kind === 173) { + var classNode = container.parent; + getNodeLinks(classNode).flags |= 4; + } else { + getNodeLinks(container).flags |= 4; + } + } + function findFirstSuperCall(node) { + return ts2.isSuperCall(node) ? node : ts2.isFunctionLike(node) ? void 0 : ts2.forEachChild(node, findFirstSuperCall); + } + function classDeclarationExtendsNull(classDecl) { + var classSymbol = getSymbolOfNode(classDecl); + var classInstanceType = getDeclaredTypeOfSymbol(classSymbol); + var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); + return baseConstructorType === nullWideningType; + } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + var containingClassDecl = container.parent; + var baseTypeNode = ts2.getClassExtendsHeritageElement(containingClassDecl); + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + if (node.flowNode && !isPostSuperFlowNode( + node.flowNode, + /*noCacheCheck*/ + false + )) { + error2(node, diagnosticMessage); + } + } + } + function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { + if (ts2.isPropertyDeclaration(container) && ts2.hasStaticModifier(container) && container.initializer && ts2.textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && ts2.hasDecorators(container.parent)) { + error2(thisExpression, ts2.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); + } + } + function checkThisExpression(node) { + var isNodeInTypeQuery = isInTypeQuery(node); + var container = ts2.getThisContainer( + node, + /* includeArrowFunctions */ + true + ); + var capturedByArrowFunction = false; + if (container.kind === 173) { + checkThisBeforeSuper(node, container, ts2.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); + } + if (container.kind === 216) { + container = ts2.getThisContainer( + container, + /* includeArrowFunctions */ + false + ); + capturedByArrowFunction = true; + } + checkThisInStaticClassFieldInitializerInDecoratedClass(node, container); + switch (container.kind) { + case 264: + error2(node, ts2.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); + break; + case 263: + error2(node, ts2.Diagnostics.this_cannot_be_referenced_in_current_location); + break; + case 173: + if (isInConstructorArgumentInitializer(node, container)) { + error2(node, ts2.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + } + break; + case 164: + error2(node, ts2.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); + break; + } + if (!isNodeInTypeQuery && capturedByArrowFunction && languageVersion < 2) { + captureLexicalThis(node, container); + } + var type3 = tryGetThisTypeAt( + node, + /*includeGlobalThis*/ + true, + container + ); + if (noImplicitThis) { + var globalThisType_1 = getTypeOfSymbol(globalThisSymbol); + if (type3 === globalThisType_1 && capturedByArrowFunction) { + error2(node, ts2.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this); + } else if (!type3) { + var diag = error2(node, ts2.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + if (!ts2.isSourceFile(container)) { + var outsideThis = tryGetThisTypeAt(container); + if (outsideThis && outsideThis !== globalThisType_1) { + ts2.addRelatedInfo(diag, ts2.createDiagnosticForNode(container, ts2.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container)); + } + } + } + } + return type3 || anyType2; + } + function tryGetThisTypeAt(node, includeGlobalThis, container) { + if (includeGlobalThis === void 0) { + includeGlobalThis = true; + } + if (container === void 0) { + container = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + } + var isInJS = ts2.isInJSFile(node); + if (ts2.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts2.getThisParameter(container))) { + var thisType = getThisTypeOfDeclaration(container) || isInJS && getTypeForThisExpressionFromJSDoc(container); + if (!thisType) { + var className = getClassNameFromPrototypeMethod(container); + if (isInJS && className) { + var classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && classSymbol.flags & 16) { + thisType = getDeclaredTypeOfSymbol(classSymbol).thisType; + } + } else if (isJSConstructor(container)) { + thisType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; + } + thisType || (thisType = getContextualThisParameterType(container)); + } + if (thisType) { + return getFlowTypeOfReference(node, thisType); + } + } + if (ts2.isClassLike(container.parent)) { + var symbol = getSymbolOfNode(container.parent); + var type3 = ts2.isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; + return getFlowTypeOfReference(node, type3); + } + if (ts2.isSourceFile(container)) { + if (container.commonJsModuleIndicator) { + var fileSymbol = getSymbolOfNode(container); + return fileSymbol && getTypeOfSymbol(fileSymbol); + } else if (container.externalModuleIndicator) { + return undefinedType2; + } else if (includeGlobalThis) { + return getTypeOfSymbol(globalThisSymbol); + } + } + } + function getExplicitThisType(node) { + var container = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + if (ts2.isFunctionLike(container)) { + var signature = getSignatureFromDeclaration(container); + if (signature.thisParameter) { + return getExplicitTypeOfSymbol(signature.thisParameter); + } + } + if (ts2.isClassLike(container.parent)) { + var symbol = getSymbolOfNode(container.parent); + return ts2.isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; + } + } + function getClassNameFromPrototypeMethod(container) { + if (container.kind === 215 && ts2.isBinaryExpression(container.parent) && ts2.getAssignmentDeclarationKind(container.parent) === 3) { + return container.parent.left.expression.expression; + } else if (container.kind === 171 && container.parent.kind === 207 && ts2.isBinaryExpression(container.parent.parent) && ts2.getAssignmentDeclarationKind(container.parent.parent) === 6) { + return container.parent.parent.left.expression; + } else if (container.kind === 215 && container.parent.kind === 299 && container.parent.parent.kind === 207 && ts2.isBinaryExpression(container.parent.parent.parent) && ts2.getAssignmentDeclarationKind(container.parent.parent.parent) === 6) { + return container.parent.parent.parent.left.expression; + } else if (container.kind === 215 && ts2.isPropertyAssignment(container.parent) && ts2.isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && ts2.isObjectLiteralExpression(container.parent.parent) && ts2.isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && ts2.getAssignmentDeclarationKind(container.parent.parent.parent) === 9) { + return container.parent.parent.parent.arguments[0].expression; + } else if (ts2.isMethodDeclaration(container) && ts2.isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && ts2.isObjectLiteralExpression(container.parent) && ts2.isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && ts2.getAssignmentDeclarationKind(container.parent.parent) === 9) { + return container.parent.parent.arguments[0].expression; + } + } + function getTypeForThisExpressionFromJSDoc(node) { + var jsdocType = ts2.getJSDocType(node); + if (jsdocType && jsdocType.kind === 320) { + var jsDocFunctionType = jsdocType; + if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && jsDocFunctionType.parameters[0].name.escapedText === "this") { + return getTypeFromTypeNode(jsDocFunctionType.parameters[0].type); + } + } + var thisTag = ts2.getJSDocThisTag(node); + if (thisTag && thisTag.typeExpression) { + return getTypeFromTypeNode(thisTag.typeExpression); + } + } + function isInConstructorArgumentInitializer(node, constructorDecl) { + return !!ts2.findAncestor(node, function(n7) { + return ts2.isFunctionLikeDeclaration(n7) ? "quit" : n7.kind === 166 && n7.parent === constructorDecl; + }); + } + function checkSuperExpression(node) { + var isCallExpression = node.parent.kind === 210 && node.parent.expression === node; + var immediateContainer = ts2.getSuperContainer( + node, + /*stopOnFunctions*/ + true + ); + var container = immediateContainer; + var needToCaptureLexicalThis = false; + var inAsyncFunction = false; + if (!isCallExpression) { + while (container && container.kind === 216) { + if (ts2.hasSyntacticModifier( + container, + 512 + /* ModifierFlags.Async */ + )) + inAsyncFunction = true; + container = ts2.getSuperContainer( + container, + /*stopOnFunctions*/ + true + ); + needToCaptureLexicalThis = languageVersion < 2; + } + if (container && ts2.hasSyntacticModifier( + container, + 512 + /* ModifierFlags.Async */ + )) + inAsyncFunction = true; + } + var canUseSuperExpression = isLegalUsageOfSuperExpression(container); + var nodeCheckFlag = 0; + if (!canUseSuperExpression) { + var current = ts2.findAncestor(node, function(n7) { + return n7 === container ? "quit" : n7.kind === 164; + }); + if (current && current.kind === 164) { + error2(node, ts2.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); + } else if (isCallExpression) { + error2(node, ts2.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } else if (!container || !container.parent || !(ts2.isClassLike(container.parent) || container.parent.kind === 207)) { + error2(node, ts2.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { + error2(node, ts2.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + } + return errorType; + } + if (!isCallExpression && immediateContainer.kind === 173) { + checkThisBeforeSuper(node, container, ts2.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } + if (ts2.isStatic(container) || isCallExpression) { + nodeCheckFlag = 512; + if (!isCallExpression && languageVersion >= 2 && languageVersion <= 8 && (ts2.isPropertyDeclaration(container) || ts2.isClassStaticBlockDeclaration(container))) { + ts2.forEachEnclosingBlockScopeContainer(node.parent, function(current2) { + if (!ts2.isSourceFile(current2) || ts2.isExternalOrCommonJsModule(current2)) { + getNodeLinks(current2).flags |= 134217728; + } + }); + } + } else { + nodeCheckFlag = 256; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (container.kind === 171 && inAsyncFunction) { + if (ts2.isSuperProperty(node.parent) && ts2.isAssignmentTarget(node.parent)) { + getNodeLinks(container).flags |= 4096; + } else { + getNodeLinks(container).flags |= 2048; + } + } + if (needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 207) { + if (languageVersion < 2) { + error2(node, ts2.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return errorType; + } else { + return anyType2; + } + } + var classLikeDeclaration = container.parent; + if (!ts2.getClassExtendsHeritageElement(classLikeDeclaration)) { + error2(node, ts2.Diagnostics.super_can_only_be_referenced_in_a_derived_class); + return errorType; + } + var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classLikeDeclaration)); + var baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + return errorType; + } + if (container.kind === 173 && isInConstructorArgumentInitializer(node, container)) { + error2(node, ts2.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + return errorType; + } + return nodeCheckFlag === 512 ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType); + function isLegalUsageOfSuperExpression(container2) { + if (!container2) { + return false; + } + if (isCallExpression) { + return container2.kind === 173; + } else { + if (ts2.isClassLike(container2.parent) || container2.parent.kind === 207) { + if (ts2.isStatic(container2)) { + return container2.kind === 171 || container2.kind === 170 || container2.kind === 174 || container2.kind === 175 || container2.kind === 169 || container2.kind === 172; + } else { + return container2.kind === 171 || container2.kind === 170 || container2.kind === 174 || container2.kind === 175 || container2.kind === 169 || container2.kind === 168 || container2.kind === 173; + } + } + } + return false; + } + } + function getContainingObjectLiteral(func) { + return (func.kind === 171 || func.kind === 174 || func.kind === 175) && func.parent.kind === 207 ? func.parent : func.kind === 215 && func.parent.kind === 299 ? func.parent.parent : void 0; + } + function getThisTypeArgument(type3) { + return ts2.getObjectFlags(type3) & 4 && type3.target === globalThisType ? getTypeArguments(type3)[0] : void 0; + } + function getThisTypeFromContextualType(type3) { + return mapType2(type3, function(t8) { + return t8.flags & 2097152 ? ts2.forEach(t8.types, getThisTypeArgument) : getThisTypeArgument(t8); + }); + } + function getContextualThisParameterType(func) { + if (func.kind === 216) { + return void 0; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + var contextualSignature = getContextualSignature(func); + if (contextualSignature) { + var thisParameter = contextualSignature.thisParameter; + if (thisParameter) { + return getTypeOfSymbol(thisParameter); + } + } + } + var inJs = ts2.isInJSFile(func); + if (noImplicitThis || inJs) { + var containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + var contextualType = getApparentTypeOfContextualType( + containingLiteral, + /*contextFlags*/ + void 0 + ); + var literal = containingLiteral; + var type3 = contextualType; + while (type3) { + var thisType = getThisTypeFromContextualType(type3); + if (thisType) { + return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); + } + if (literal.parent.kind !== 299) { + break; + } + literal = literal.parent.parent; + type3 = getApparentTypeOfContextualType( + literal, + /*contextFlags*/ + void 0 + ); + } + return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); + } + var parent2 = ts2.walkUpParenthesizedExpressions(func.parent); + if (parent2.kind === 223 && parent2.operatorToken.kind === 63) { + var target = parent2.left; + if (ts2.isAccessExpression(target)) { + var expression = target.expression; + if (inJs && ts2.isIdentifier(expression)) { + var sourceFile = ts2.getSourceFileOfNode(parent2); + if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) { + return void 0; + } + } + return getWidenedType(checkExpressionCached(expression)); + } + } + } + return void 0; + } + function getContextuallyTypedParameterType(parameter) { + var func = parameter.parent; + if (!isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + return void 0; + } + var iife = ts2.getImmediatelyInvokedFunctionExpression(func); + if (iife && iife.arguments) { + var args = getEffectiveCallArguments(iife); + var indexOfParameter = func.parameters.indexOf(parameter); + if (parameter.dotDotDotToken) { + return getSpreadArgumentType( + args, + indexOfParameter, + args.length, + anyType2, + /*context*/ + void 0, + 0 + /* CheckMode.Normal */ + ); + } + var links = getNodeLinks(iife); + var cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + var type3 = indexOfParameter < args.length ? getWidenedLiteralType(checkExpression(args[indexOfParameter])) : parameter.initializer ? void 0 : undefinedWideningType; + links.resolvedSignature = cached; + return type3; + } + var contextualSignature = getContextualSignature(func); + if (contextualSignature) { + var index4 = func.parameters.indexOf(parameter) - (ts2.getThisParameter(func) ? 1 : 0); + return parameter.dotDotDotToken && ts2.lastOrUndefined(func.parameters) === parameter ? getRestTypeAtPosition(contextualSignature, index4) : tryGetTypeAtPosition(contextualSignature, index4); + } + } + function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + switch (declaration.kind) { + case 166: + return getContextuallyTypedParameterType(declaration); + case 205: + return getContextualTypeForBindingElement(declaration, contextFlags); + case 169: + if (ts2.isStatic(declaration)) { + return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); + } + } + } + function getContextualTypeForBindingElement(declaration, contextFlags) { + var parent2 = declaration.parent.parent; + var name2 = declaration.propertyName || declaration.name; + var parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 205 && parent2.initializer && checkDeclarationInitializer( + parent2, + declaration.dotDotDotToken ? 64 : 0 + /* CheckMode.Normal */ + ); + if (!parentType || ts2.isBindingPattern(name2) || ts2.isComputedNonLiteralName(name2)) + return void 0; + if (parent2.name.kind === 204) { + var index4 = ts2.indexOfNode(declaration.parent.elements, declaration); + if (index4 < 0) + return void 0; + return getContextualTypeForElementExpression(parentType, index4); + } + var nameType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(nameType)) { + var text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } + } + function getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags) { + var parentType = ts2.isExpression(declaration.parent) && getContextualType(declaration.parent, contextFlags); + if (!parentType) + return void 0; + return getTypeOfPropertyOfContextualType(parentType, getSymbolOfNode(declaration).escapedName); + } + function getContextualTypeForInitializerExpression(node, contextFlags) { + var declaration = node.parent; + if (ts2.hasInitializer(declaration) && node === declaration.initializer) { + var result2 = getContextualTypeForVariableLikeDeclaration(declaration, contextFlags); + if (result2) { + return result2; + } + if (!(contextFlags & 8) && ts2.isBindingPattern(declaration.name) && declaration.name.elements.length > 0) { + return getTypeFromBindingPattern( + declaration.name, + /*includePatternInType*/ + true, + /*reportErrors*/ + false + ); + } + } + return void 0; + } + function getContextualTypeForReturnExpression(node, contextFlags) { + var func = ts2.getContainingFunction(node); + if (func) { + var contextualReturnType = getContextualReturnType(func, contextFlags); + if (contextualReturnType) { + var functionFlags = ts2.getFunctionFlags(func); + if (functionFlags & 1) { + var isAsyncGenerator_1 = (functionFlags & 2) !== 0; + if (contextualReturnType.flags & 1048576) { + contextualReturnType = filterType(contextualReturnType, function(type3) { + return !!getIterationTypeOfGeneratorFunctionReturnType(1, type3, isAsyncGenerator_1); + }); + } + var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, contextualReturnType, (functionFlags & 2) !== 0); + if (!iterationReturnType) { + return void 0; + } + contextualReturnType = iterationReturnType; + } + if (functionFlags & 2) { + var contextualAwaitedType = mapType2(contextualReturnType, getAwaitedTypeNoAlias); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return contextualReturnType; + } + } + return void 0; + } + function getContextualTypeForAwaitOperand(node, contextFlags) { + var contextualType = getContextualType(node, contextFlags); + if (contextualType) { + var contextualAwaitedType = getAwaitedTypeNoAlias(contextualType); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return void 0; + } + function getContextualTypeForYieldOperand(node, contextFlags) { + var func = ts2.getContainingFunction(node); + if (func) { + var functionFlags = ts2.getFunctionFlags(func); + var contextualReturnType = getContextualReturnType(func, contextFlags); + if (contextualReturnType) { + var isAsyncGenerator_2 = (functionFlags & 2) !== 0; + if (!node.asteriskToken && contextualReturnType.flags & 1048576) { + contextualReturnType = filterType(contextualReturnType, function(type3) { + return !!getIterationTypeOfGeneratorFunctionReturnType(1, type3, isAsyncGenerator_2); + }); + } + return node.asteriskToken ? contextualReturnType : getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType, isAsyncGenerator_2); + } + } + return void 0; + } + function isInParameterInitializerBeforeContainingFunction(node) { + var inBindingInitializer = false; + while (node.parent && !ts2.isFunctionLike(node.parent)) { + if (ts2.isParameter(node.parent) && (inBindingInitializer || node.parent.initializer === node)) { + return true; + } + if (ts2.isBindingElement(node.parent) && node.parent.initializer === node) { + inBindingInitializer = true; + } + node = node.parent; + } + return false; + } + function getContextualIterationType(kind, functionDecl) { + var isAsync2 = !!(ts2.getFunctionFlags(functionDecl) & 2); + var contextualReturnType = getContextualReturnType( + functionDecl, + /*contextFlags*/ + void 0 + ); + if (contextualReturnType) { + return getIterationTypeOfGeneratorFunctionReturnType(kind, contextualReturnType, isAsync2) || void 0; + } + return void 0; + } + function getContextualReturnType(functionDecl, contextFlags) { + var returnType = getReturnTypeFromAnnotation(functionDecl); + if (returnType) { + return returnType; + } + var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); + if (signature && !isResolvingReturnTypeOfSignature(signature)) { + return getReturnTypeOfSignature(signature); + } + var iife = ts2.getImmediatelyInvokedFunctionExpression(functionDecl); + if (iife) { + return getContextualType(iife, contextFlags); + } + return void 0; + } + function getContextualTypeForArgument(callTarget, arg) { + var args = getEffectiveCallArguments(callTarget); + var argIndex = args.indexOf(arg); + return argIndex === -1 ? void 0 : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + if (ts2.isImportCall(callTarget)) { + return argIndex === 0 ? stringType2 : argIndex === 1 ? getGlobalImportCallOptionsType( + /*reportErrors*/ + false + ) : anyType2; + } + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + if (ts2.isJsxOpeningLikeElement(callTarget) && argIndex === 0) { + return getEffectiveFirstArgumentForJsxSignature(signature, callTarget); + } + var restIndex = signature.parameters.length - 1; + return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType( + getTypeOfSymbol(signature.parameters[restIndex]), + getNumberLiteralType(argIndex - restIndex), + 256 + /* AccessFlags.Contextual */ + ) : getTypeAtPosition(signature, argIndex); + } + function getContextualTypeForSubstitutionExpression(template2, substitutionExpression) { + if (template2.parent.kind === 212) { + return getContextualTypeForArgument(template2.parent, substitutionExpression); + } + return void 0; + } + function getContextualTypeForBinaryOperand(node, contextFlags) { + var binaryExpression = node.parent; + var left = binaryExpression.left, operatorToken = binaryExpression.operatorToken, right = binaryExpression.right; + switch (operatorToken.kind) { + case 63: + case 76: + case 75: + case 77: + return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : void 0; + case 56: + case 60: + var type3 = getContextualType(binaryExpression, contextFlags); + return node === right && (type3 && type3.pattern || !type3 && !ts2.isDefaultedExpandoInitializer(binaryExpression)) ? getTypeOfExpression(left) : type3; + case 55: + case 27: + return node === right ? getContextualType(binaryExpression, contextFlags) : void 0; + default: + return void 0; + } + } + function getSymbolForExpression(e10) { + if (e10.symbol) { + return e10.symbol; + } + if (ts2.isIdentifier(e10)) { + return getResolvedSymbol(e10); + } + if (ts2.isPropertyAccessExpression(e10)) { + var lhsType = getTypeOfExpression(e10.expression); + return ts2.isPrivateIdentifier(e10.name) ? tryGetPrivateIdentifierPropertyOfType(lhsType, e10.name) : getPropertyOfType(lhsType, e10.name.escapedText); + } + if (ts2.isElementAccessExpression(e10)) { + var propType = checkExpressionCached(e10.argumentExpression); + if (!isTypeUsableAsPropertyName(propType)) { + return void 0; + } + var lhsType = getTypeOfExpression(e10.expression); + return getPropertyOfType(lhsType, getPropertyNameFromType(propType)); + } + return void 0; + function tryGetPrivateIdentifierPropertyOfType(type3, id) { + var lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(id.escapedText, id); + return lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(type3, lexicallyScopedSymbol); + } + } + function getContextualTypeForAssignmentDeclaration(binaryExpression) { + var _a2, _b; + var kind = ts2.getAssignmentDeclarationKind(binaryExpression); + switch (kind) { + case 0: + case 4: + var lhsSymbol = getSymbolForExpression(binaryExpression.left); + var decl = lhsSymbol && lhsSymbol.valueDeclaration; + if (decl && (ts2.isPropertyDeclaration(decl) || ts2.isPropertySignature(decl))) { + var overallAnnotation = ts2.getEffectiveTypeAnnotationNode(decl); + return overallAnnotation && instantiateType(getTypeFromTypeNode(overallAnnotation), getSymbolLinks(lhsSymbol).mapper) || (ts2.isPropertyDeclaration(decl) ? decl.initializer && getTypeOfExpression(binaryExpression.left) : void 0); + } + if (kind === 0) { + return getTypeOfExpression(binaryExpression.left); + } + return getContextualTypeForThisPropertyAssignment(binaryExpression); + case 5: + if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { + return getContextualTypeForThisPropertyAssignment(binaryExpression); + } else if (!binaryExpression.left.symbol) { + return getTypeOfExpression(binaryExpression.left); + } else { + var decl_1 = binaryExpression.left.symbol.valueDeclaration; + if (!decl_1) { + return void 0; + } + var lhs = ts2.cast(binaryExpression.left, ts2.isAccessExpression); + var overallAnnotation = ts2.getEffectiveTypeAnnotationNode(decl_1); + if (overallAnnotation) { + return getTypeFromTypeNode(overallAnnotation); + } else if (ts2.isIdentifier(lhs.expression)) { + var id = lhs.expression; + var parentSymbol = resolveName( + id, + id.escapedText, + 111551, + void 0, + id.escapedText, + /*isUse*/ + true + ); + if (parentSymbol) { + var annotated_1 = parentSymbol.valueDeclaration && ts2.getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); + if (annotated_1) { + var nameStr = ts2.getElementOrPropertyAccessName(lhs); + if (nameStr !== void 0) { + return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated_1), nameStr); + } + } + return void 0; + } + } + return ts2.isInJSFile(decl_1) ? void 0 : getTypeOfExpression(binaryExpression.left); + } + case 1: + case 6: + case 3: + case 2: + var valueDeclaration = void 0; + if (kind !== 2) { + valueDeclaration = (_a2 = binaryExpression.left.symbol) === null || _a2 === void 0 ? void 0 : _a2.valueDeclaration; + } + valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration); + var annotated = valueDeclaration && ts2.getEffectiveTypeAnnotationNode(valueDeclaration); + return annotated ? getTypeFromTypeNode(annotated) : void 0; + case 7: + case 8: + case 9: + return ts2.Debug.fail("Does not apply"); + default: + return ts2.Debug.assertNever(kind); + } + } + function isPossiblyAliasedThisProperty(declaration, kind) { + if (kind === void 0) { + kind = ts2.getAssignmentDeclarationKind(declaration); + } + if (kind === 4) { + return true; + } + if (!ts2.isInJSFile(declaration) || kind !== 5 || !ts2.isIdentifier(declaration.left.expression)) { + return false; + } + var name2 = declaration.left.expression.escapedText; + var symbol = resolveName( + declaration.left, + name2, + 111551, + void 0, + void 0, + /*isUse*/ + true, + /*excludeGlobals*/ + true + ); + return ts2.isThisInitializedDeclaration(symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration); + } + function getContextualTypeForThisPropertyAssignment(binaryExpression) { + if (!binaryExpression.symbol) + return getTypeOfExpression(binaryExpression.left); + if (binaryExpression.symbol.valueDeclaration) { + var annotated = ts2.getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + var type3 = getTypeFromTypeNode(annotated); + if (type3) { + return type3; + } + } + } + var thisAccess = ts2.cast(binaryExpression.left, ts2.isAccessExpression); + if (!ts2.isObjectLiteralMethod(ts2.getThisContainer( + thisAccess.expression, + /*includeArrowFunctions*/ + false + ))) { + return void 0; + } + var thisType = checkThisExpression(thisAccess.expression); + var nameStr = ts2.getElementOrPropertyAccessName(thisAccess); + return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0; + } + function isCircularMappedProperty(symbol) { + return !!(ts2.getCheckFlags(symbol) & 262144 && !symbol.type && findResolutionCycleStartIndex( + symbol, + 0 + /* TypeSystemPropertyName.Type */ + ) >= 0); + } + function getTypeOfPropertyOfContextualType(type3, name2, nameType) { + return mapType2( + type3, + function(t8) { + var _a2; + if (isGenericMappedType(t8) && !t8.declaration.nameType) { + var constraint = getConstraintTypeFromMappedType(t8); + var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint; + var propertyNameType = nameType || getStringLiteralType(ts2.unescapeLeadingUnderscores(name2)); + if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) { + return substituteIndexedMappedType(t8, propertyNameType); + } + } else if (t8.flags & 3670016) { + var prop = getPropertyOfType(t8, name2); + if (prop) { + return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop); + } + if (isTupleType(t8)) { + var restType = getRestTypeOfTupleType(t8); + if (restType && ts2.isNumericLiteralName(name2) && +name2 >= 0) { + return restType; + } + } + return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t8), nameType || getStringLiteralType(ts2.unescapeLeadingUnderscores(name2)))) === null || _a2 === void 0 ? void 0 : _a2.type; + } + return void 0; + }, + /*noReductions*/ + true + ); + } + function getContextualTypeForObjectLiteralMethod(node, contextFlags) { + ts2.Debug.assert(ts2.isObjectLiteralMethod(node)); + if (node.flags & 33554432) { + return void 0; + } + return getContextualTypeForObjectLiteralElement(node, contextFlags); + } + function getContextualTypeForObjectLiteralElement(element, contextFlags) { + var objectLiteral = element.parent; + var propertyAssignmentType = ts2.isPropertyAssignment(element) && getContextualTypeForVariableLikeDeclaration(element, contextFlags); + if (propertyAssignmentType) { + return propertyAssignmentType; + } + var type3 = getApparentTypeOfContextualType(objectLiteral, contextFlags); + if (type3) { + if (hasBindableName(element)) { + var symbol = getSymbolOfNode(element); + return getTypeOfPropertyOfContextualType(type3, symbol.escapedName, getSymbolLinks(symbol).nameType); + } + if (element.name) { + var nameType_2 = getLiteralTypeFromPropertyName(element.name); + return mapType2( + type3, + function(t8) { + var _a2; + return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t8), nameType_2)) === null || _a2 === void 0 ? void 0 : _a2.type; + }, + /*noReductions*/ + true + ); + } + } + return void 0; + } + function getContextualTypeForElementExpression(arrayContextualType, index4) { + return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index4) || mapType2( + arrayContextualType, + function(t8) { + return getIteratedTypeOrElementType( + 1, + t8, + undefinedType2, + /*errorNode*/ + void 0, + /*checkAssignability*/ + false + ); + }, + /*noReductions*/ + true + )); + } + function getContextualTypeForConditionalOperand(node, contextFlags) { + var conditional = node.parent; + return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : void 0; + } + function getContextualTypeForChildJsxExpression(node, child, contextFlags) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { + return void 0; + } + var realChildren = ts2.getSemanticJsxChildren(node.children); + var childIndex = realChildren.indexOf(child); + var childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); + return childFieldType && (realChildren.length === 1 ? childFieldType : mapType2( + childFieldType, + function(t8) { + if (isArrayLikeType(t8)) { + return getIndexedAccessType(t8, getNumberLiteralType(childIndex)); + } else { + return t8; + } + }, + /*noReductions*/ + true + )); + } + function getContextualTypeForJsxExpression(node, contextFlags) { + var exprParent = node.parent; + return ts2.isJsxAttributeLike(exprParent) ? getContextualType(node, contextFlags) : ts2.isJsxElement(exprParent) ? getContextualTypeForChildJsxExpression(exprParent, node, contextFlags) : void 0; + } + function getContextualTypeForJsxAttribute(attribute, contextFlags) { + if (ts2.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent, contextFlags); + if (!attributesType || isTypeAny(attributesType)) { + return void 0; + } + return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); + } else { + return getContextualType(attribute.parent, contextFlags); + } + } + function isPossiblyDiscriminantValue(node) { + switch (node.kind) { + case 10: + case 8: + case 9: + case 14: + case 110: + case 95: + case 104: + case 79: + case 155: + return true; + case 208: + case 214: + return isPossiblyDiscriminantValue(node.expression); + case 291: + return !node.expression || isPossiblyDiscriminantValue(node.expression); + } + return false; + } + function discriminateContextualTypeByObjectMembers(node, contextualType) { + return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts2.concatenate(ts2.map(ts2.filter(node.properties, function(p7) { + return !!p7.symbol && p7.kind === 299 && isPossiblyDiscriminantValue(p7.initializer) && isDiscriminantProperty(contextualType, p7.symbol.escapedName); + }), function(prop) { + return [function() { + return getContextFreeTypeOfExpression(prop.initializer); + }, prop.symbol.escapedName]; + }), ts2.map(ts2.filter(getPropertiesOfType(contextualType), function(s7) { + var _a2; + return !!(s7.flags & 16777216) && !!((_a2 = node === null || node === void 0 ? void 0 : node.symbol) === null || _a2 === void 0 ? void 0 : _a2.members) && !node.symbol.members.has(s7.escapedName) && isDiscriminantProperty(contextualType, s7.escapedName); + }), function(s7) { + return [function() { + return undefinedType2; + }, s7.escapedName]; + })), isTypeAssignableTo, contextualType); + } + function discriminateContextualTypeByJSXAttributes(node, contextualType) { + return discriminateTypeByDiscriminableItems(contextualType, ts2.concatenate(ts2.map(ts2.filter(node.properties, function(p7) { + return !!p7.symbol && p7.kind === 288 && isDiscriminantProperty(contextualType, p7.symbol.escapedName) && (!p7.initializer || isPossiblyDiscriminantValue(p7.initializer)); + }), function(prop) { + return [!prop.initializer ? function() { + return trueType; + } : function() { + return getContextFreeTypeOfExpression(prop.initializer); + }, prop.symbol.escapedName]; + }), ts2.map(ts2.filter(getPropertiesOfType(contextualType), function(s7) { + var _a2; + return !!(s7.flags & 16777216) && !!((_a2 = node === null || node === void 0 ? void 0 : node.symbol) === null || _a2 === void 0 ? void 0 : _a2.members) && !node.symbol.members.has(s7.escapedName) && isDiscriminantProperty(contextualType, s7.escapedName); + }), function(s7) { + return [function() { + return undefinedType2; + }, s7.escapedName]; + })), isTypeAssignableTo, contextualType); + } + function getApparentTypeOfContextualType(node, contextFlags) { + var contextualType = ts2.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType(node, contextFlags); + var instantiatedType = instantiateContextualType(contextualType, node, contextFlags); + if (instantiatedType && !(contextFlags && contextFlags & 2 && instantiatedType.flags & 8650752)) { + var apparentType = mapType2( + instantiatedType, + getApparentType, + /*noReductions*/ + true + ); + return apparentType.flags & 1048576 && ts2.isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) : apparentType.flags & 1048576 && ts2.isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) : apparentType; + } + } + function instantiateContextualType(contextualType, node, contextFlags) { + if (contextualType && maybeTypeOfKind( + contextualType, + 465829888 + /* TypeFlags.Instantiable */ + )) { + var inferenceContext = getInferenceContext(node); + if (inferenceContext && contextFlags & 1 && ts2.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) { + return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); + } + if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) { + var type3 = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); + return type3.flags & 1048576 && containsType(type3.types, regularFalseType) && containsType(type3.types, regularTrueType) ? filterType(type3, function(t8) { + return t8 !== regularFalseType && t8 !== regularTrueType; + }) : type3; + } + } + return contextualType; + } + function instantiateInstantiableTypes(type3, mapper) { + if (type3.flags & 465829888) { + return instantiateType(type3, mapper); + } + if (type3.flags & 1048576) { + return getUnionType( + ts2.map(type3.types, function(t8) { + return instantiateInstantiableTypes(t8, mapper); + }), + 0 + /* UnionReduction.None */ + ); + } + if (type3.flags & 2097152) { + return getIntersectionType(ts2.map(type3.types, function(t8) { + return instantiateInstantiableTypes(t8, mapper); + })); + } + return type3; + } + function getContextualType(node, contextFlags) { + if (node.flags & 33554432) { + return void 0; + } + if (node.contextualType) { + return node.contextualType; + } + var parent2 = node.parent; + switch (parent2.kind) { + case 257: + case 166: + case 169: + case 168: + case 205: + return getContextualTypeForInitializerExpression(node, contextFlags); + case 216: + case 250: + return getContextualTypeForReturnExpression(node, contextFlags); + case 226: + return getContextualTypeForYieldOperand(parent2, contextFlags); + case 220: + return getContextualTypeForAwaitOperand(parent2, contextFlags); + case 210: + case 211: + return getContextualTypeForArgument(parent2, node); + case 213: + case 231: + return ts2.isConstTypeReference(parent2.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(parent2.type); + case 223: + return getContextualTypeForBinaryOperand(node, contextFlags); + case 299: + case 300: + return getContextualTypeForObjectLiteralElement(parent2, contextFlags); + case 301: + return getContextualType(parent2.parent, contextFlags); + case 206: { + var arrayLiteral = parent2; + var type3 = getApparentTypeOfContextualType(arrayLiteral, contextFlags); + return getContextualTypeForElementExpression(type3, ts2.indexOfNode(arrayLiteral.elements, node)); + } + case 224: + return getContextualTypeForConditionalOperand(node, contextFlags); + case 236: + ts2.Debug.assert( + parent2.parent.kind === 225 + /* SyntaxKind.TemplateExpression */ + ); + return getContextualTypeForSubstitutionExpression(parent2.parent, node); + case 214: { + var tag = ts2.isInJSFile(parent2) ? ts2.getJSDocTypeTag(parent2) : void 0; + return !tag ? getContextualType(parent2, contextFlags) : ts2.isJSDocTypeTag(tag) && ts2.isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent2) : getTypeFromTypeNode(tag.typeExpression.type); + } + case 232: + return getContextualType(parent2, contextFlags); + case 235: + return getTypeFromTypeNode(parent2.type); + case 274: + return tryGetTypeFromEffectiveTypeNode(parent2); + case 291: + return getContextualTypeForJsxExpression(parent2, contextFlags); + case 288: + case 290: + return getContextualTypeForJsxAttribute(parent2, contextFlags); + case 283: + case 282: + return getContextualJsxElementAttributesType(parent2, contextFlags); + } + return void 0; + function tryFindWhenConstTypeReference(node2) { + return getContextualType(node2, contextFlags); + } + } + function getInferenceContext(node) { + var ancestor = ts2.findAncestor(node, function(n7) { + return !!n7.inferenceContext; + }); + return ancestor && ancestor.inferenceContext; + } + function getContextualJsxElementAttributesType(node, contextFlags) { + if (ts2.isJsxOpeningElement(node) && node.parent.contextualType && contextFlags !== 4) { + return node.parent.contextualType; + } + return getContextualTypeForArgumentAtIndex(node, 0); + } + function getEffectiveFirstArgumentForJsxSignature(signature, node) { + return getJsxReferenceKind(node) !== 0 ? getJsxPropsTypeFromCallSignature(signature, node) : getJsxPropsTypeFromClassType(signature, node); + } + function getJsxPropsTypeFromCallSignature(sig, context2) { + var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType2); + propsType = getJsxManagedAttributesFromLocatedAttributes(context2, getJsxNamespaceAt(context2), propsType); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context2); + if (!isErrorType(intrinsicAttribs)) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) { + if (sig.compositeSignatures) { + var results = []; + for (var _i = 0, _a2 = sig.compositeSignatures; _i < _a2.length; _i++) { + var signature = _a2[_i]; + var instance = getReturnTypeOfSignature(signature); + if (isTypeAny(instance)) { + return instance; + } + var propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); + if (!propType) { + return; + } + results.push(propType); + } + return getIntersectionType(results); + } + var instanceType = getReturnTypeOfSignature(sig); + return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); + } + function getStaticTypeOfReferencedJsxConstructor(context2) { + if (isJsxIntrinsicIdentifier(context2.tagName)) { + var result2 = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(context2); + var fakeSignature = createSignatureForJSXIntrinsic(context2, result2); + return getOrCreateTypeFromSignature(fakeSignature); + } + var tagType = checkExpressionCached(context2.tagName); + if (tagType.flags & 128) { + var result2 = getIntrinsicAttributesTypeFromStringLiteralType(tagType, context2); + if (!result2) { + return errorType; + } + var fakeSignature = createSignatureForJSXIntrinsic(context2, result2); + return getOrCreateTypeFromSignature(fakeSignature); + } + return tagType; + } + function getJsxManagedAttributesFromLocatedAttributes(context2, ns, attributesType) { + var managedSym = getJsxLibraryManagedAttributes(ns); + if (managedSym) { + var declaredManagedType = getDeclaredTypeOfSymbol(managedSym); + var ctorType = getStaticTypeOfReferencedJsxConstructor(context2); + if (managedSym.flags & 524288) { + var params = getSymbolLinks(managedSym).typeParameters; + if (ts2.length(params) >= 2) { + var args = fillMissingTypeArguments([ctorType, attributesType], params, 2, ts2.isInJSFile(context2)); + return getTypeAliasInstantiation(managedSym, args); + } + } + if (ts2.length(declaredManagedType.typeParameters) >= 2) { + var args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, ts2.isInJSFile(context2)); + return createTypeReference(declaredManagedType, args); + } + } + return attributesType; + } + function getJsxPropsTypeFromClassType(sig, context2) { + var ns = getJsxNamespaceAt(context2); + var forcedLookupLocation = getJsxElementPropertiesName(ns); + var attributesType = forcedLookupLocation === void 0 ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType2) : forcedLookupLocation === "" ? getReturnTypeOfSignature(sig) : getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation); + if (!attributesType) { + if (!!forcedLookupLocation && !!ts2.length(context2.attributes.properties)) { + error2(context2, ts2.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts2.unescapeLeadingUnderscores(forcedLookupLocation)); + } + return unknownType2; + } + attributesType = getJsxManagedAttributesFromLocatedAttributes(context2, ns, attributesType); + if (isTypeAny(attributesType)) { + return attributesType; + } else { + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context2); + if (!isErrorType(intrinsicClassAttribs)) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + var hostClassType = getReturnTypeOfSignature(sig); + var libraryManagedAttributeType = void 0; + if (typeParams) { + var inferredArgs = fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts2.isInJSFile(context2)); + libraryManagedAttributeType = instantiateType(intrinsicClassAttribs, createTypeMapper(typeParams, inferredArgs)); + } else + libraryManagedAttributeType = intrinsicClassAttribs; + apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context2); + if (!isErrorType(intrinsicAttribs)) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + function getIntersectedSignatures(signatures) { + return ts2.getStrictOptionValue(compilerOptions, "noImplicitAny") ? ts2.reduceLeft(signatures, function(left, right) { + return left === right || !left ? left : compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right) : void 0; + }) : void 0; + } + function combineIntersectionThisParam(left, right, mapper) { + if (!left || !right) { + return left || right; + } + var thisType = getUnionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); + return createSymbolWithType(left, thisType); + } + function combineIntersectionParameters(left, right, mapper) { + var leftCount = getParameterCount(left); + var rightCount = getParameterCount(right); + var longest = leftCount >= rightCount ? left : right; + var shorter = longest === left ? right : left; + var longestCount = longest === left ? leftCount : rightCount; + var eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); + var needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + var params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (var i7 = 0; i7 < longestCount; i7++) { + var longestParamType = tryGetTypeAtPosition(longest, i7); + if (longest === right) { + longestParamType = instantiateType(longestParamType, mapper); + } + var shorterParamType = tryGetTypeAtPosition(shorter, i7) || unknownType2; + if (shorter === right) { + shorterParamType = instantiateType(shorterParamType, mapper); + } + var unionParamType = getUnionType([longestParamType, shorterParamType]); + var isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i7 === longestCount - 1; + var isOptional2 = i7 >= getMinArgumentCount(longest) && i7 >= getMinArgumentCount(shorter); + var leftName = i7 >= leftCount ? void 0 : getParameterNameAtPosition(left, i7); + var rightName = i7 >= rightCount ? void 0 : getParameterNameAtPosition(right, i7); + var paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; + var paramSymbol = createSymbol(1 | (isOptional2 && !isRestParam ? 16777216 : 0), paramName || "arg".concat(i7)); + paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i7] = paramSymbol; + } + if (needsExtraRestElement) { + var restParamSymbol = createSymbol(1, "args"); + restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + if (shorter === right) { + restParamSymbol.type = instantiateType(restParamSymbol.type, mapper); + } + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfIntersectionMembers(left, right) { + var typeParams = left.typeParameters || right.typeParameters; + var paramMapper; + if (left.typeParameters && right.typeParameters) { + paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); + } + var declaration = left.declaration; + var params = combineIntersectionParameters(left, right, paramMapper); + var thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper); + var minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + var result2 = createSignature( + declaration, + typeParams, + thisParam, + params, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgCount, + (left.flags | right.flags) & 39 + /* SignatureFlags.PropagatingFlags */ + ); + result2.compositeKind = 2097152; + result2.compositeSignatures = ts2.concatenate(left.compositeKind === 2097152 && left.compositeSignatures || [left], [right]); + if (paramMapper) { + result2.mapper = left.compositeKind === 2097152 && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper; + } + return result2; + } + function getContextualCallSignature(type3, node) { + var signatures = getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + var applicableByArity = ts2.filter(signatures, function(s7) { + return !isAritySmaller(s7, node); + }); + return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity); + } + function isAritySmaller(signature, target) { + var targetParameterCount = 0; + for (; targetParameterCount < target.parameters.length; targetParameterCount++) { + var param = target.parameters[targetParameterCount]; + if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { + break; + } + } + if (target.parameters.length && ts2.parameterIsThisKeyword(target.parameters[0])) { + targetParameterCount--; + } + return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; + } + function getContextualSignatureForFunctionLikeDeclaration(node) { + return ts2.isFunctionExpressionOrArrowFunction(node) || ts2.isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; + } + function getContextualSignature(node) { + ts2.Debug.assert(node.kind !== 171 || ts2.isObjectLiteralMethod(node)); + var typeTagSignature = getSignatureOfTypeTag(node); + if (typeTagSignature) { + return typeTagSignature; + } + var type3 = getApparentTypeOfContextualType( + node, + 1 + /* ContextFlags.Signature */ + ); + if (!type3) { + return void 0; + } + if (!(type3.flags & 1048576)) { + return getContextualCallSignature(type3, node); + } + var signatureList; + var types3 = type3.types; + for (var _i = 0, types_18 = types3; _i < types_18.length; _i++) { + var current = types_18[_i]; + var signature = getContextualCallSignature(current, node); + if (signature) { + if (!signatureList) { + signatureList = [signature]; + } else if (!compareSignaturesIdentical( + signatureList[0], + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + true, + /*ignoreReturnTypes*/ + true, + compareTypesIdentical + )) { + return void 0; + } else { + signatureList.push(signature); + } + } + } + if (signatureList) { + return signatureList.length === 1 ? signatureList[0] : createUnionSignature(signatureList[0], signatureList); + } + } + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + node, + compilerOptions.downlevelIteration ? 1536 : 1024 + /* ExternalEmitHelpers.SpreadArray */ + ); + } + var arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(33, arrayOrIterableType, undefinedType2, node.expression); + } + function checkSyntheticExpression(node) { + return node.isSpread ? getIndexedAccessType(node.type, numberType2) : node.type; + } + function hasDefaultValue(node) { + return node.kind === 205 && !!node.initializer || node.kind === 223 && node.operatorToken.kind === 63; + } + function checkArrayLiteral(node, checkMode, forceTuple) { + var elements = node.elements; + var elementCount = elements.length; + var elementTypes = []; + var elementFlags = []; + var contextualType = getApparentTypeOfContextualType( + node, + /*contextFlags*/ + void 0 + ); + var inDestructuringPattern = ts2.isAssignmentTarget(node); + var inConstContext = isConstContext(node); + var hasOmittedExpression = false; + for (var i7 = 0; i7 < elementCount; i7++) { + var e10 = elements[i7]; + if (e10.kind === 227) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + e10, + compilerOptions.downlevelIteration ? 1536 : 1024 + /* ExternalEmitHelpers.SpreadArray */ + ); + } + var spreadType = checkExpression(e10.expression, checkMode, forceTuple); + if (isArrayLikeType(spreadType)) { + elementTypes.push(spreadType); + elementFlags.push( + 8 + /* ElementFlags.Variadic */ + ); + } else if (inDestructuringPattern) { + var restElementType = getIndexTypeOfType(spreadType, numberType2) || getIteratedTypeOrElementType( + 65, + spreadType, + undefinedType2, + /*errorNode*/ + void 0, + /*checkAssignability*/ + false + ) || unknownType2; + elementTypes.push(restElementType); + elementFlags.push( + 4 + /* ElementFlags.Rest */ + ); + } else { + elementTypes.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType2, e10.expression)); + elementFlags.push( + 4 + /* ElementFlags.Rest */ + ); + } + } else if (exactOptionalPropertyTypes && e10.kind === 229) { + hasOmittedExpression = true; + elementTypes.push(missingType); + elementFlags.push( + 2 + /* ElementFlags.Optional */ + ); + } else { + var elementContextualType = getContextualTypeForElementExpression(contextualType, elementTypes.length); + var type3 = checkExpressionForMutableLocation(e10, checkMode, elementContextualType, forceTuple); + elementTypes.push(addOptionality( + type3, + /*isProperty*/ + true, + hasOmittedExpression + )); + elementFlags.push( + hasOmittedExpression ? 2 : 1 + /* ElementFlags.Required */ + ); + if (contextualType && someType(contextualType, isTupleLikeType) && checkMode && checkMode & 2 && !(checkMode & 4) && isContextSensitive(e10)) { + var inferenceContext = getInferenceContext(node); + ts2.Debug.assert(inferenceContext); + addIntraExpressionInferenceSite(inferenceContext, e10, type3); + } + } + } + if (inDestructuringPattern) { + return createTupleType(elementTypes, elementFlags); + } + if (forceTuple || inConstContext || contextualType && someType(contextualType, isTupleLikeType)) { + return createArrayLiteralType(createTupleType( + elementTypes, + elementFlags, + /*readonly*/ + inConstContext + )); + } + return createArrayLiteralType(createArrayType(elementTypes.length ? getUnionType( + ts2.sameMap(elementTypes, function(t8, i8) { + return elementFlags[i8] & 8 ? getIndexedAccessTypeOrUndefined(t8, numberType2) || anyType2 : t8; + }), + 2 + /* UnionReduction.Subtype */ + ) : strictNullChecks ? implicitNeverType : undefinedWideningType, inConstContext)); + } + function createArrayLiteralType(type3) { + if (!(ts2.getObjectFlags(type3) & 4)) { + return type3; + } + var literalType2 = type3.literalType; + if (!literalType2) { + literalType2 = type3.literalType = cloneTypeReference(type3); + literalType2.objectFlags |= 16384 | 131072; + } + return literalType2; + } + function isNumericName(name2) { + switch (name2.kind) { + case 164: + return isNumericComputedName(name2); + case 79: + return ts2.isNumericLiteralName(name2.escapedText); + case 8: + case 10: + return ts2.isNumericLiteralName(name2.text); + default: + return false; + } + } + function isNumericComputedName(name2) { + return isTypeAssignableToKind( + checkComputedPropertyName(name2), + 296 + /* TypeFlags.NumberLike */ + ); + } + function checkComputedPropertyName(node) { + var links = getNodeLinks(node.expression); + if (!links.resolvedType) { + if ((ts2.isTypeLiteralNode(node.parent.parent) || ts2.isClassLike(node.parent.parent) || ts2.isInterfaceDeclaration(node.parent.parent)) && ts2.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 101 && node.parent.kind !== 174 && node.parent.kind !== 175) { + return links.resolvedType = errorType; + } + links.resolvedType = checkExpression(node.expression); + if (ts2.isPropertyDeclaration(node.parent) && !ts2.hasStaticModifier(node.parent) && ts2.isClassExpression(node.parent.parent)) { + var container = ts2.getEnclosingBlockScopeContainer(node.parent.parent); + var enclosingIterationStatement = getEnclosingIterationStatement(container); + if (enclosingIterationStatement) { + getNodeLinks(enclosingIterationStatement).flags |= 65536; + getNodeLinks(node).flags |= 524288; + getNodeLinks(node.parent.parent).flags |= 524288; + } + } + if (links.resolvedType.flags & 98304 || !isTypeAssignableToKind( + links.resolvedType, + 402653316 | 296 | 12288 + /* TypeFlags.ESSymbolLike */ + ) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { + error2(node, ts2.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); + } + } + return links.resolvedType; + } + function isSymbolWithNumericName(symbol) { + var _a2; + var firstDecl = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]; + return ts2.isNumericLiteralName(symbol.escapedName) || firstDecl && ts2.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name); + } + function isSymbolWithSymbolName(symbol) { + var _a2; + var firstDecl = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]; + return ts2.isKnownSymbol(symbol) || firstDecl && ts2.isNamedDeclaration(firstDecl) && ts2.isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind( + checkComputedPropertyName(firstDecl.name), + 4096 + /* TypeFlags.ESSymbol */ + ); + } + function getObjectLiteralIndexInfo(node, offset, properties, keyType) { + var propTypes = []; + for (var i7 = offset; i7 < properties.length; i7++) { + var prop = properties[i7]; + if (keyType === stringType2 && !isSymbolWithSymbolName(prop) || keyType === numberType2 && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) { + propTypes.push(getTypeOfSymbol(properties[i7])); + } + } + var unionType2 = propTypes.length ? getUnionType( + propTypes, + 2 + /* UnionReduction.Subtype */ + ) : undefinedType2; + return createIndexInfo(keyType, unionType2, isConstContext(node)); + } + function getImmediateAliasedSymbol(symbol) { + ts2.Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); + var links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + var node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return ts2.Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration( + node, + /*dontRecursivelyResolve*/ + true + ); + } + return links.immediateTarget; + } + function checkObjectLiteral(node, checkMode) { + var inDestructuringPattern = ts2.isAssignmentTarget(node); + checkGrammarObjectLiteralExpression(node, inDestructuringPattern); + var allPropertiesTable = strictNullChecks ? ts2.createSymbolTable() : void 0; + var propertiesTable = ts2.createSymbolTable(); + var propertiesArray = []; + var spread2 = emptyObjectType; + var contextualType = getApparentTypeOfContextualType( + node, + /*contextFlags*/ + void 0 + ); + var contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 203 || contextualType.pattern.kind === 207); + var inConstContext = isConstContext(node); + var checkFlags = inConstContext ? 8 : 0; + var isInJavascript = ts2.isInJSFile(node) && !ts2.isInJsonFile(node); + var enumTag = ts2.getJSDocEnumTag(node); + var isJSObjectLiteral = !contextualType && isInJavascript && !enumTag; + var objectFlags = freshObjectLiteralFlag; + var patternWithComputedProperties = false; + var hasComputedStringProperty = false; + var hasComputedNumberProperty = false; + var hasComputedSymbolProperty = false; + for (var _i = 0, _a2 = node.properties; _i < _a2.length; _i++) { + var elem = _a2[_i]; + if (elem.name && ts2.isComputedPropertyName(elem.name)) { + checkComputedPropertyName(elem.name); + } + } + var offset = 0; + for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { + var memberDecl = _c[_b]; + var member = getSymbolOfNode(memberDecl); + var computedNameType = memberDecl.name && memberDecl.name.kind === 164 ? checkComputedPropertyName(memberDecl.name) : void 0; + if (memberDecl.kind === 299 || memberDecl.kind === 300 || ts2.isObjectLiteralMethod(memberDecl)) { + var type3 = memberDecl.kind === 299 ? checkPropertyAssignment(memberDecl, checkMode) : ( + // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring + // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. + // we don't want to say "could not find 'a'". + memberDecl.kind === 300 ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) + ); + if (isInJavascript) { + var jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); + if (jsDocType) { + checkTypeAssignableTo(type3, jsDocType, memberDecl); + type3 = jsDocType; + } else if (enumTag && enumTag.typeExpression) { + checkTypeAssignableTo(type3, getTypeFromTypeNode(enumTag.typeExpression), memberDecl); + } + } + objectFlags |= ts2.getObjectFlags(type3) & 458752; + var nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0; + var prop = nameType ? createSymbol( + 4 | member.flags, + getPropertyNameFromType(nameType), + checkFlags | 4096 + /* CheckFlags.Late */ + ) : createSymbol(4 | member.flags, member.escapedName, checkFlags); + if (nameType) { + prop.nameType = nameType; + } + if (inDestructuringPattern) { + var isOptional2 = memberDecl.kind === 299 && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 300 && memberDecl.objectAssignmentInitializer; + if (isOptional2) { + prop.flags |= 16777216; + } + } else if (contextualTypeHasPattern && !(ts2.getObjectFlags(contextualType) & 512)) { + var impliedProp = getPropertyOfType(contextualType, member.escapedName); + if (impliedProp) { + prop.flags |= impliedProp.flags & 16777216; + } else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, stringType2)) { + error2(memberDecl.name, ts2.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString2(member), typeToString(contextualType)); + } + } + prop.declarations = member.declarations; + prop.parent = member.parent; + if (member.valueDeclaration) { + prop.valueDeclaration = member.valueDeclaration; + } + prop.type = type3; + prop.target = member; + member = prop; + allPropertiesTable === null || allPropertiesTable === void 0 ? void 0 : allPropertiesTable.set(prop.escapedName, prop); + if (contextualType && checkMode && checkMode & 2 && !(checkMode & 4) && (memberDecl.kind === 299 || memberDecl.kind === 171) && isContextSensitive(memberDecl)) { + var inferenceContext = getInferenceContext(node); + ts2.Debug.assert(inferenceContext); + var inferenceNode = memberDecl.kind === 299 ? memberDecl.initializer : memberDecl; + addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type3); + } + } else if (memberDecl.kind === 301) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + memberDecl, + 2 + /* ExternalEmitHelpers.Assign */ + ); + } + if (propertiesArray.length > 0) { + spread2 = getSpreadType(spread2, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); + propertiesArray = []; + propertiesTable = ts2.createSymbolTable(); + hasComputedStringProperty = false; + hasComputedNumberProperty = false; + hasComputedSymbolProperty = false; + } + var type3 = getReducedType(checkExpression(memberDecl.expression)); + if (isValidSpreadType(type3)) { + var mergedType = tryMergeUnionOfObjectTypeAndEmptyObject(type3, inConstContext); + if (allPropertiesTable) { + checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl); + } + offset = propertiesArray.length; + if (isErrorType(spread2)) { + continue; + } + spread2 = getSpreadType(spread2, mergedType, node.symbol, objectFlags, inConstContext); + } else { + error2(memberDecl, ts2.Diagnostics.Spread_types_may_only_be_created_from_object_types); + spread2 = errorType; + } + continue; + } else { + ts2.Debug.assert( + memberDecl.kind === 174 || memberDecl.kind === 175 + /* SyntaxKind.SetAccessor */ + ); + checkNodeDeferred(memberDecl); + } + if (computedNameType && !(computedNameType.flags & 8576)) { + if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) { + if (isTypeAssignableTo(computedNameType, numberType2)) { + hasComputedNumberProperty = true; + } else if (isTypeAssignableTo(computedNameType, esSymbolType)) { + hasComputedSymbolProperty = true; + } else { + hasComputedStringProperty = true; + } + if (inDestructuringPattern) { + patternWithComputedProperties = true; + } + } + } else { + propertiesTable.set(member.escapedName, member); + } + propertiesArray.push(member); + } + if (contextualTypeHasPattern) { + var rootPatternParent_1 = ts2.findAncestor(contextualType.pattern.parent, function(n7) { + return n7.kind === 257 || n7.kind === 223 || n7.kind === 166; + }); + var spreadOrOutsideRootObject = ts2.findAncestor(node, function(n7) { + return n7 === rootPatternParent_1 || n7.kind === 301; + }); + if (spreadOrOutsideRootObject.kind !== 301) { + for (var _d = 0, _e2 = getPropertiesOfType(contextualType); _d < _e2.length; _d++) { + var prop = _e2[_d]; + if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread2, prop.escapedName)) { + if (!(prop.flags & 16777216)) { + error2(prop.valueDeclaration || prop.bindingElement, ts2.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); + } + propertiesTable.set(prop.escapedName, prop); + propertiesArray.push(prop); + } + } + } + } + if (isErrorType(spread2)) { + return errorType; + } + if (spread2 !== emptyObjectType) { + if (propertiesArray.length > 0) { + spread2 = getSpreadType(spread2, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); + propertiesArray = []; + propertiesTable = ts2.createSymbolTable(); + hasComputedStringProperty = false; + hasComputedNumberProperty = false; + } + return mapType2(spread2, function(t8) { + return t8 === emptyObjectType ? createObjectLiteralType() : t8; + }); + } + return createObjectLiteralType(); + function createObjectLiteralType() { + var indexInfos = []; + if (hasComputedStringProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, stringType2)); + if (hasComputedNumberProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, numberType2)); + if (hasComputedSymbolProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType)); + var result2 = createAnonymousType(node.symbol, propertiesTable, ts2.emptyArray, ts2.emptyArray, indexInfos); + result2.objectFlags |= objectFlags | 128 | 131072; + if (isJSObjectLiteral) { + result2.objectFlags |= 4096; + } + if (patternWithComputedProperties) { + result2.objectFlags |= 512; + } + if (inDestructuringPattern) { + result2.pattern = node; + } + return result2; + } + } + function isValidSpreadType(type3) { + var t8 = removeDefinitelyFalsyTypes(mapType2(type3, getBaseConstraintOrType)); + return !!(t8.flags & (1 | 67108864 | 524288 | 58982400) || t8.flags & 3145728 && ts2.every(t8.types, isValidSpreadType)); + } + function checkJsxSelfClosingElementDeferred(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node); + } + function checkJsxSelfClosingElement(node, _checkMode) { + checkNodeDeferred(node); + return getJsxElementTypeAt(node) || anyType2; + } + function checkJsxElementDeferred(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { + getIntrinsicTagSymbol(node.closingElement); + } else { + checkExpression(node.closingElement.tagName); + } + checkJsxChildren(node); + } + function checkJsxElement(node, _checkMode) { + checkNodeDeferred(node); + return getJsxElementTypeAt(node) || anyType2; + } + function checkJsxFragment(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + var nodeSourceFile = ts2.getSourceFileOfNode(node); + if (ts2.getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { + error2(node, compilerOptions.jsxFactory ? ts2.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : ts2.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments); + } + checkJsxChildren(node); + return getJsxElementTypeAt(node) || anyType2; + } + function isHyphenatedJsxName(name2) { + return ts2.stringContains(name2, "-"); + } + function isJsxIntrinsicIdentifier(tagName) { + return tagName.kind === 79 && ts2.isIntrinsicJsxName(tagName.escapedText); + } + function checkJsxAttribute(node, checkMode) { + return node.initializer ? checkExpressionForMutableLocation(node.initializer, checkMode) : trueType; + } + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { + var attributes = openingLikeElement.attributes; + var attributesType = getContextualType( + attributes, + 0 + /* ContextFlags.None */ + ); + var allAttributesTable = strictNullChecks ? ts2.createSymbolTable() : void 0; + var attributesTable = ts2.createSymbolTable(); + var spread2 = emptyJsxObjectType; + var hasSpreadAnyType = false; + var typeToIntersect; + var explicitlySpecifyChildrenAttribute = false; + var objectFlags = 2048; + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); + for (var _i = 0, _a2 = attributes.properties; _i < _a2.length; _i++) { + var attributeDecl = _a2[_i]; + var member = attributeDecl.symbol; + if (ts2.isJsxAttribute(attributeDecl)) { + var exprType = checkJsxAttribute(attributeDecl, checkMode); + objectFlags |= ts2.getObjectFlags(exprType) & 458752; + var attributeSymbol = createSymbol(4 | member.flags, member.escapedName); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; + } + attributeSymbol.type = exprType; + attributeSymbol.target = member; + attributesTable.set(attributeSymbol.escapedName, attributeSymbol); + allAttributesTable === null || allAttributesTable === void 0 ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol); + if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { + explicitlySpecifyChildrenAttribute = true; + } + if (attributesType) { + var prop = getPropertyOfType(attributesType, member.escapedName); + if (prop && prop.declarations && isDeprecatedSymbol(prop)) { + addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText); + } + } + } else { + ts2.Debug.assert( + attributeDecl.kind === 290 + /* SyntaxKind.JsxSpreadAttribute */ + ); + if (attributesTable.size > 0) { + spread2 = getSpreadType( + spread2, + createJsxAttributesType(), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + attributesTable = ts2.createSymbolTable(); + } + var exprType = getReducedType(checkExpressionCached(attributeDecl.expression, checkMode)); + if (isTypeAny(exprType)) { + hasSpreadAnyType = true; + } + if (isValidSpreadType(exprType)) { + spread2 = getSpreadType( + spread2, + exprType, + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + if (allAttributesTable) { + checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl); + } + } else { + error2(attributeDecl.expression, ts2.Diagnostics.Spread_types_may_only_be_created_from_object_types); + typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; + } + } + } + if (!hasSpreadAnyType) { + if (attributesTable.size > 0) { + spread2 = getSpreadType( + spread2, + createJsxAttributesType(), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + } + } + var parent2 = openingLikeElement.parent.kind === 281 ? openingLikeElement.parent : void 0; + if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) { + var childrenTypes = checkJsxChildren(parent2, checkMode); + if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { + if (explicitlySpecifyChildrenAttribute) { + error2(attributes, ts2.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, ts2.unescapeLeadingUnderscores(jsxChildrenPropertyName)); + } + var contextualType = getApparentTypeOfContextualType( + openingLikeElement.attributes, + /*contextFlags*/ + void 0 + ); + var childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName); + var childrenPropSymbol = createSymbol(4, jsxChildrenPropertyName); + childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); + childrenPropSymbol.valueDeclaration = ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + ts2.unescapeLeadingUnderscores(jsxChildrenPropertyName), + /*questionToken*/ + void 0, + /*type*/ + void 0 + ); + ts2.setParent(childrenPropSymbol.valueDeclaration, attributes); + childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol; + var childPropMap = ts2.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread2 = getSpreadType( + spread2, + createAnonymousType(attributes.symbol, childPropMap, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + } + } + if (hasSpreadAnyType) { + return anyType2; + } + if (typeToIntersect && spread2 !== emptyJsxObjectType) { + return getIntersectionType([typeToIntersect, spread2]); + } + return typeToIntersect || (spread2 === emptyJsxObjectType ? createJsxAttributesType() : spread2); + function createJsxAttributesType() { + objectFlags |= freshObjectLiteralFlag; + var result2 = createAnonymousType(attributes.symbol, attributesTable, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + result2.objectFlags |= objectFlags | 128 | 131072; + return result2; + } + } + function checkJsxChildren(node, checkMode) { + var childrenTypes = []; + for (var _i = 0, _a2 = node.children; _i < _a2.length; _i++) { + var child = _a2[_i]; + if (child.kind === 11) { + if (!child.containsOnlyTriviaWhiteSpaces) { + childrenTypes.push(stringType2); + } + } else if (child.kind === 291 && !child.expression) { + continue; + } else { + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); + } + } + return childrenTypes; + } + function checkSpreadPropOverrides(type3, props, spread2) { + for (var _i = 0, _a2 = getPropertiesOfType(type3); _i < _a2.length; _i++) { + var right = _a2[_i]; + if (!(right.flags & 16777216)) { + var left = props.get(right.escapedName); + if (left) { + var diagnostic = error2(left.valueDeclaration, ts2.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, ts2.unescapeLeadingUnderscores(left.escapedName)); + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(spread2, ts2.Diagnostics.This_spread_always_overwrites_this_property)); + } + } + } + } + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); + } + function getJsxType(name2, location2) { + var namespace = getJsxNamespaceAt(location2); + var exports29 = namespace && getExportsOfSymbol(namespace); + var typeSymbol = exports29 && getSymbol( + exports29, + name2, + 788968 + /* SymbolFlags.Type */ + ); + return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType; + } + function getIntrinsicTagSymbol(node) { + var links = getNodeLinks(node); + if (!links.resolvedSymbol) { + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); + if (!isErrorType(intrinsicElementsType)) { + if (!ts2.isIdentifier(node.tagName)) + return ts2.Debug.fail(); + var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText); + if (intrinsicProp) { + links.jsxFlags |= 1; + return links.resolvedSymbol = intrinsicProp; + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType2); + if (indexSignatureType) { + links.jsxFlags |= 2; + return links.resolvedSymbol = intrinsicElementsType.symbol; + } + error2(node, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.idText(node.tagName), "JSX." + JsxNames.IntrinsicElements); + return links.resolvedSymbol = unknownSymbol; + } else { + if (noImplicitAny) { + error2(node, ts2.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, ts2.unescapeLeadingUnderscores(JsxNames.IntrinsicElements)); + } + return links.resolvedSymbol = unknownSymbol; + } + } + return links.resolvedSymbol; + } + function getJsxNamespaceContainerForImplicitImport(location2) { + var file = location2 && ts2.getSourceFileOfNode(location2); + var links = file && getNodeLinks(file); + if (links && links.jsxImplicitImportContainer === false) { + return void 0; + } + if (links && links.jsxImplicitImportContainer) { + return links.jsxImplicitImportContainer; + } + var runtimeImportSpecifier = ts2.getJSXRuntimeImport(ts2.getJSXImplicitImportBase(compilerOptions, file), compilerOptions); + if (!runtimeImportSpecifier) { + return void 0; + } + var isClassic = ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Classic; + var errorMessage = isClassic ? ts2.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option : ts2.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; + var mod2 = resolveExternalModule(location2, runtimeImportSpecifier, errorMessage, location2); + var result2 = mod2 && mod2 !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod2)) : void 0; + if (links) { + links.jsxImplicitImportContainer = result2 || false; + } + return result2; + } + function getJsxNamespaceAt(location2) { + var links = location2 && getNodeLinks(location2); + if (links && links.jsxNamespace) { + return links.jsxNamespace; + } + if (!links || links.jsxNamespace !== false) { + var resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location2); + if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { + var namespaceName = getJsxNamespace(location2); + resolvedNamespace = resolveName( + location2, + namespaceName, + 1920, + /*diagnosticMessage*/ + void 0, + namespaceName, + /*isUse*/ + false + ); + } + if (resolvedNamespace) { + var candidate = resolveSymbol(getSymbol( + getExportsOfSymbol(resolveSymbol(resolvedNamespace)), + JsxNames.JSX, + 1920 + /* SymbolFlags.Namespace */ + )); + if (candidate && candidate !== unknownSymbol) { + if (links) { + links.jsxNamespace = candidate; + } + return candidate; + } + } + if (links) { + links.jsxNamespace = false; + } + } + var s7 = resolveSymbol(getGlobalSymbol( + JsxNames.JSX, + 1920, + /*diagnosticMessage*/ + void 0 + )); + if (s7 === unknownSymbol) { + return void 0; + } + return s7; + } + function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { + var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol( + jsxNamespace.exports, + nameOfAttribPropContainer, + 788968 + /* SymbolFlags.Type */ + ); + var jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); + var propertiesOfJsxElementAttribPropInterface = jsxElementAttribPropInterfaceType && getPropertiesOfType(jsxElementAttribPropInterfaceType); + if (propertiesOfJsxElementAttribPropInterface) { + if (propertiesOfJsxElementAttribPropInterface.length === 0) { + return ""; + } else if (propertiesOfJsxElementAttribPropInterface.length === 1) { + return propertiesOfJsxElementAttribPropInterface[0].escapedName; + } else if (propertiesOfJsxElementAttribPropInterface.length > 1 && jsxElementAttribPropInterfaceSym.declarations) { + error2(jsxElementAttribPropInterfaceSym.declarations[0], ts2.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, ts2.unescapeLeadingUnderscores(nameOfAttribPropContainer)); + } + } + return void 0; + } + function getJsxLibraryManagedAttributes(jsxNamespace) { + return jsxNamespace && getSymbol( + jsxNamespace.exports, + JsxNames.LibraryManagedAttributes, + 788968 + /* SymbolFlags.Type */ + ); + } + function getJsxElementPropertiesName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); + } + function getJsxElementChildrenPropertyName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); + } + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4) { + return [anySignature]; + } else if (elementType.flags & 128) { + var intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error2(caller, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return ts2.emptyArray; + } else { + var fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + var apparentElemType = getApparentType(elementType); + var signatures = getSignaturesOfType( + apparentElemType, + 1 + /* SignatureKind.Construct */ + ); + if (signatures.length === 0) { + signatures = getSignaturesOfType( + apparentElemType, + 0 + /* SignatureKind.Call */ + ); + } + if (signatures.length === 0 && apparentElemType.flags & 1048576) { + signatures = getUnionSignatures(ts2.map(apparentElemType.types, function(t8) { + return getUninstantiatedJsxSignaturesOfType(t8, caller); + })); + } + return signatures; + } + function getIntrinsicAttributesTypeFromStringLiteralType(type3, location2) { + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location2); + if (!isErrorType(intrinsicElementsType)) { + var stringLiteralTypeName = type3.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts2.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType2); + if (indexSignatureType) { + return indexSignatureType; + } + return void 0; + } + return anyType2; + } + function checkJsxReturnAssignableToAppropriateBound(refKind, elemInstanceType, openingLikeElement) { + if (refKind === 1) { + var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); + if (sfcReturnConstraint) { + checkTypeRelatedTo(elemInstanceType, sfcReturnConstraint, assignableRelation, openingLikeElement.tagName, ts2.Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + } else if (refKind === 0) { + var classConstraint = getJsxElementClassTypeAt(openingLikeElement); + if (classConstraint) { + checkTypeRelatedTo(elemInstanceType, classConstraint, assignableRelation, openingLikeElement.tagName, ts2.Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + } else { + var sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); + var classConstraint = getJsxElementClassTypeAt(openingLikeElement); + if (!sfcReturnConstraint || !classConstraint) { + return; + } + var combined = getUnionType([sfcReturnConstraint, classConstraint]); + checkTypeRelatedTo(elemInstanceType, combined, assignableRelation, openingLikeElement.tagName, ts2.Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + function generateInitialErrorChain() { + var componentName = ts2.getTextOfNode(openingLikeElement.tagName); + return ts2.chainDiagnosticMessages( + /* details */ + void 0, + ts2.Diagnostics._0_cannot_be_used_as_a_JSX_component, + componentName + ); + } + } + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + ts2.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); + var links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + var symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType; + } else if (links.jsxFlags & 2) { + return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType2) || errorType; + } else { + return links.resolvedJsxElementAttributesType = errorType; + } + } + return links.resolvedJsxElementAttributesType; + } + function getJsxElementClassTypeAt(location2) { + var type3 = getJsxType(JsxNames.ElementClass, location2); + if (isErrorType(type3)) + return void 0; + return type3; + } + function getJsxElementTypeAt(location2) { + return getJsxType(JsxNames.Element, location2); + } + function getJsxStatelessElementTypeAt(location2) { + var jsxElementType = getJsxElementTypeAt(location2); + if (jsxElementType) { + return getUnionType([jsxElementType, nullType2]); + } + } + function getJsxIntrinsicTagNamesAt(location2) { + var intrinsics = getJsxType(JsxNames.IntrinsicElements, location2); + return intrinsics ? getPropertiesOfType(intrinsics) : ts2.emptyArray; + } + function checkJsxPreconditions(errorNode) { + if ((compilerOptions.jsx || 0) === 0) { + error2(errorNode, ts2.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); + } + if (getJsxElementTypeAt(errorNode) === void 0) { + if (noImplicitAny) { + error2(errorNode, ts2.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); + } + } + } + function checkJsxOpeningLikeElementOrOpeningFragment(node) { + var isNodeOpeningLikeElement = ts2.isJsxOpeningLikeElement(node); + if (isNodeOpeningLikeElement) { + checkGrammarJsxElement(node); + } + checkJsxPreconditions(node); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + var jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? ts2.Diagnostics.Cannot_find_name_0 : void 0; + var jsxFactoryNamespace = getJsxNamespace(node); + var jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + var jsxFactorySym = void 0; + if (!(ts2.isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName( + jsxFactoryLocation, + jsxFactoryNamespace, + 111551, + jsxFactoryRefErr, + jsxFactoryNamespace, + /*isUse*/ + true + ); + } + if (jsxFactorySym) { + jsxFactorySym.isReferenced = 67108863; + if (jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } + } + if (ts2.isJsxOpeningFragment(node)) { + var file = ts2.getSourceFileOfNode(node); + var localJsxNamespace = getLocalJsxNamespace(file); + if (localJsxNamespace) { + resolveName( + jsxFactoryLocation, + localJsxNamespace, + 111551, + jsxFactoryRefErr, + localJsxNamespace, + /*isUse*/ + true + ); + } + } + } + if (isNodeOpeningLikeElement) { + var jsxOpeningLikeNode = node; + var sig = getResolvedSignature(jsxOpeningLikeNode); + checkDeprecatedSignature(sig, node); + checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode); + } + } + function isKnownProperty(targetType, name2, isComparingJsxAttributes) { + if (targetType.flags & 524288) { + if (getPropertyOfObjectType(targetType, name2) || getApplicableIndexInfoForName(targetType, name2) || isLateBoundName(name2) && getIndexInfoOfType(targetType, stringType2) || isComparingJsxAttributes && isHyphenatedJsxName(name2)) { + return true; + } + } else if (targetType.flags & 3145728 && isExcessPropertyCheckTarget(targetType)) { + for (var _i = 0, _a2 = targetType.types; _i < _a2.length; _i++) { + var t8 = _a2[_i]; + if (isKnownProperty(t8, name2, isComparingJsxAttributes)) { + return true; + } + } + } + return false; + } + function isExcessPropertyCheckTarget(type3) { + return !!(type3.flags & 524288 && !(ts2.getObjectFlags(type3) & 512) || type3.flags & 67108864 || type3.flags & 1048576 && ts2.some(type3.types, isExcessPropertyCheckTarget) || type3.flags & 2097152 && ts2.every(type3.types, isExcessPropertyCheckTarget)); + } + function checkJsxExpression(node, checkMode) { + checkGrammarJsxExpression(node); + if (node.expression) { + var type3 = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type3 !== anyType2 && !isArrayType(type3)) { + error2(node, ts2.Diagnostics.JSX_spread_child_must_be_an_array_type); + } + return type3; + } else { + return errorType; + } + } + function getDeclarationNodeFlagsFromSymbol(s7) { + return s7.valueDeclaration ? ts2.getCombinedNodeFlags(s7.valueDeclaration) : 0; + } + function isPrototypeProperty(symbol) { + if (symbol.flags & 8192 || ts2.getCheckFlags(symbol) & 4) { + return true; + } + if (ts2.isInJSFile(symbol.valueDeclaration)) { + var parent2 = symbol.valueDeclaration.parent; + return parent2 && ts2.isBinaryExpression(parent2) && ts2.getAssignmentDeclarationKind(parent2) === 3; + } + } + function checkPropertyAccessibility(node, isSuper, writing, type3, prop, reportError) { + if (reportError === void 0) { + reportError = true; + } + var errorNode = !reportError ? void 0 : node.kind === 163 ? node.right : node.kind === 202 ? node : node.kind === 205 && node.propertyName ? node.propertyName : node.name; + return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type3, prop, errorNode); + } + function checkPropertyAccessibilityAtLocation(location2, isSuper, writing, containingType, prop, errorNode) { + var flags = ts2.getDeclarationModifierFlagsFromSymbol(prop, writing); + if (isSuper) { + if (languageVersion < 2) { + if (symbolHasNonMethodDeclaration(prop)) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + } + return false; + } + } + if (flags & 256) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString2(prop), typeToString(getDeclaringClass(prop))); + } + return false; + } + } + if (flags & 256 && symbolHasNonMethodDeclaration(prop) && (ts2.isThisProperty(location2) || ts2.isThisInitializedObjectBindingExpression(location2) || ts2.isObjectBindingPattern(location2.parent) && ts2.isThisInitializedDeclaration(location2.parent.parent))) { + var declaringClassDeclaration = ts2.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location2)) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString2(prop), ts2.getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); + } + return false; + } + } + if (!(flags & 24)) { + return true; + } + if (flags & 8) { + var declaringClassDeclaration = ts2.getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + if (!isNodeWithinClass(location2, declaringClassDeclaration)) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString2(prop), typeToString(getDeclaringClass(prop))); + } + return false; + } + return true; + } + if (isSuper) { + return true; + } + var enclosingClass = forEachEnclosingClass(location2, function(enclosingDeclaration) { + var enclosingClass2 = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration)); + return isClassDerivedFromDeclaringClasses(enclosingClass2, prop, writing); + }); + if (!enclosingClass) { + enclosingClass = getEnclosingClassFromThisParameter(location2); + enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing); + if (flags & 32 || !enclosingClass) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString2(prop), typeToString(getDeclaringClass(prop) || containingType)); + } + return false; + } + } + if (flags & 32) { + return true; + } + if (containingType.flags & 262144) { + containingType = containingType.isThisType ? getConstraintOfTypeParameter(containingType) : getBaseConstraintOfType(containingType); + } + if (!containingType || !hasBaseType(containingType, enclosingClass)) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, symbolToString2(prop), typeToString(enclosingClass), typeToString(containingType)); + } + return false; + } + return true; + } + function getEnclosingClassFromThisParameter(node) { + var thisParameter = getThisParameterFromNodeContext(node); + var thisType = (thisParameter === null || thisParameter === void 0 ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type); + if (thisType && thisType.flags & 262144) { + thisType = getConstraintOfTypeParameter(thisType); + } + if (thisType && ts2.getObjectFlags(thisType) & (3 | 4)) { + return getTargetType(thisType); + } + return void 0; + } + function getThisParameterFromNodeContext(node) { + var thisContainer = ts2.getThisContainer( + node, + /* includeArrowFunctions */ + false + ); + return thisContainer && ts2.isFunctionLike(thisContainer) ? ts2.getThisParameter(thisContainer) : void 0; + } + function symbolHasNonMethodDeclaration(symbol) { + return !!forEachProperty(symbol, function(prop) { + return !(prop.flags & 8192); + }); + } + function checkNonNullExpression(node) { + return checkNonNullType(checkExpression(node), node); + } + function isNullableType(type3) { + return !!(getTypeFacts(type3) & 50331648); + } + function getNonNullableTypeIfNeeded(type3) { + return isNullableType(type3) ? getNonNullableType(type3) : type3; + } + function reportObjectPossiblyNullOrUndefinedError(node, facts) { + var nodeText = ts2.isEntityNameExpression(node) ? ts2.entityNameToString(node) : void 0; + if (node.kind === 104) { + error2(node, ts2.Diagnostics.The_value_0_cannot_be_used_here, "null"); + return; + } + if (nodeText !== void 0 && nodeText.length < 100) { + if (ts2.isIdentifier(node) && nodeText === "undefined") { + error2(node, ts2.Diagnostics.The_value_0_cannot_be_used_here, "undefined"); + return; + } + error2(node, facts & 16777216 ? facts & 33554432 ? ts2.Diagnostics._0_is_possibly_null_or_undefined : ts2.Diagnostics._0_is_possibly_undefined : ts2.Diagnostics._0_is_possibly_null, nodeText); + } else { + error2(node, facts & 16777216 ? facts & 33554432 ? ts2.Diagnostics.Object_is_possibly_null_or_undefined : ts2.Diagnostics.Object_is_possibly_undefined : ts2.Diagnostics.Object_is_possibly_null); + } + } + function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) { + error2(node, facts & 16777216 ? facts & 33554432 ? ts2.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined : ts2.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined : ts2.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null); + } + function checkNonNullTypeWithReporter(type3, node, reportError) { + if (strictNullChecks && type3.flags & 2) { + if (ts2.isEntityNameExpression(node)) { + var nodeText = ts2.entityNameToString(node); + if (nodeText.length < 100) { + error2(node, ts2.Diagnostics._0_is_of_type_unknown, nodeText); + return errorType; + } + } + error2(node, ts2.Diagnostics.Object_is_of_type_unknown); + return errorType; + } + var facts = getTypeFacts(type3); + if (facts & 50331648) { + reportError(node, facts); + var t8 = getNonNullableType(type3); + return t8.flags & (98304 | 131072) ? errorType : t8; + } + return type3; + } + function checkNonNullType(type3, node) { + return checkNonNullTypeWithReporter(type3, node, reportObjectPossiblyNullOrUndefinedError); + } + function checkNonNullNonVoidType(type3, node) { + var nonNullType = checkNonNullType(type3, node); + if (nonNullType.flags & 16384) { + if (ts2.isEntityNameExpression(node)) { + var nodeText = ts2.entityNameToString(node); + if (ts2.isIdentifier(node) && nodeText === "undefined") { + error2(node, ts2.Diagnostics.The_value_0_cannot_be_used_here, nodeText); + return nonNullType; + } + if (nodeText.length < 100) { + error2(node, ts2.Diagnostics._0_is_possibly_undefined, nodeText); + return nonNullType; + } + } + error2(node, ts2.Diagnostics.Object_is_possibly_undefined); + } + return nonNullType; + } + function checkPropertyAccessExpression(node, checkMode) { + return node.flags & 32 ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode); + } + function checkPropertyAccessChain(node, checkMode) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name, checkMode), node, nonOptionalType !== leftType); + } + function checkQualifiedName(node, checkMode) { + var leftType = ts2.isPartOfTypeQuery(node) && ts2.isThisIdentifier(node.left) ? checkNonNullType(checkThisExpression(node.left), node.left) : checkNonNullExpression(node.left); + return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); + } + function isMethodAccessForCall(node) { + while (node.parent.kind === 214) { + node = node.parent; + } + return ts2.isCallOrNewExpression(node.parent) && node.parent.expression === node; + } + function lookupSymbolForPrivateIdentifierDeclaration(propName2, location2) { + for (var containingClass = ts2.getContainingClass(location2); !!containingClass; containingClass = ts2.getContainingClass(containingClass)) { + var symbol = containingClass.symbol; + var name2 = ts2.getSymbolNameForPrivateIdentifier(symbol, propName2); + var prop = symbol.members && symbol.members.get(name2) || symbol.exports && symbol.exports.get(name2); + if (prop) { + return prop; + } + } + } + function checkGrammarPrivateIdentifierExpression(privId) { + if (!ts2.getContainingClass(privId)) { + return grammarErrorOnNode(privId, ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + if (!ts2.isForInStatement(privId.parent)) { + if (!ts2.isExpressionNode(privId)) { + return grammarErrorOnNode(privId, ts2.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression); + } + var isInOperation = ts2.isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 101; + if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) { + return grammarErrorOnNode(privId, ts2.Diagnostics.Cannot_find_name_0, ts2.idText(privId)); + } + } + return false; + } + function checkPrivateIdentifierExpression(privId) { + checkGrammarPrivateIdentifierExpression(privId); + var symbol = getSymbolForPrivateIdentifierExpression(privId); + if (symbol) { + markPropertyAsReferenced( + symbol, + /* nodeForCheckWriteOnly: */ + void 0, + /* isThisAccess: */ + false + ); + } + return anyType2; + } + function getSymbolForPrivateIdentifierExpression(privId) { + if (!ts2.isExpressionNode(privId)) { + return void 0; + } + var links = getNodeLinks(privId); + if (links.resolvedSymbol === void 0) { + links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId); + } + return links.resolvedSymbol; + } + function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) { + return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName); + } + function checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedIdentifier) { + var propertyOnType; + var properties = getPropertiesOfType(leftType); + if (properties) { + ts2.forEach(properties, function(symbol) { + var decl = symbol.valueDeclaration; + if (decl && ts2.isNamedDeclaration(decl) && ts2.isPrivateIdentifier(decl.name) && decl.name.escapedText === right.escapedText) { + propertyOnType = symbol; + return true; + } + }); + } + var diagName = diagnosticName(right); + if (propertyOnType) { + var typeValueDecl = ts2.Debug.checkDefined(propertyOnType.valueDeclaration); + var typeClass_1 = ts2.Debug.checkDefined(ts2.getContainingClass(typeValueDecl)); + if (lexicallyScopedIdentifier === null || lexicallyScopedIdentifier === void 0 ? void 0 : lexicallyScopedIdentifier.valueDeclaration) { + var lexicalValueDecl = lexicallyScopedIdentifier.valueDeclaration; + var lexicalClass = ts2.getContainingClass(lexicalValueDecl); + ts2.Debug.assert(!!lexicalClass); + if (ts2.findAncestor(lexicalClass, function(n7) { + return typeClass_1 === n7; + })) { + var diagnostic = error2(right, ts2.Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling, diagName, typeToString(leftType)); + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(lexicalValueDecl, ts2.Diagnostics.The_shadowing_declaration_of_0_is_defined_here, diagName), ts2.createDiagnosticForNode(typeValueDecl, ts2.Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here, diagName)); + return true; + } + } + error2(right, ts2.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier, diagName, diagnosticName(typeClass_1.name || anon)); + return true; + } + return false; + } + function isThisPropertyAccessInConstructor(node, prop) { + return (isConstructorDeclaredProperty(prop) || ts2.isThisProperty(node) && isAutoTypedProperty(prop)) && ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + true + ) === getDeclaringConstructor(prop); + } + function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode) { + var parentSymbol = getNodeLinks(left).resolvedSymbol; + var assignmentKind = ts2.getAssignmentTargetKind(node); + var apparentType = getApparentType(assignmentKind !== 0 || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); + var isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType; + var prop; + if (ts2.isPrivateIdentifier(right)) { + if (languageVersion < 99) { + if (assignmentKind !== 0) { + checkExternalEmitHelpers( + node, + 1048576 + /* ExternalEmitHelpers.ClassPrivateFieldSet */ + ); + } + if (assignmentKind !== 1) { + checkExternalEmitHelpers( + node, + 524288 + /* ExternalEmitHelpers.ClassPrivateFieldGet */ + ); + } + } + var lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right); + if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts2.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) { + grammarErrorOnNode(right, ts2.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts2.idText(right)); + } + if (isAnyLike) { + if (lexicallyScopedSymbol) { + return isErrorType(apparentType) ? errorType : apparentType; + } + if (!ts2.getContainingClass(right)) { + grammarErrorOnNode(right, ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + return anyType2; + } + } + prop = lexicallyScopedSymbol ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol) : void 0; + if (!prop && checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) { + return errorType; + } else { + var isSetonlyAccessor = prop && prop.flags & 65536 && !(prop.flags & 32768); + if (isSetonlyAccessor && assignmentKind !== 1) { + error2(node, ts2.Diagnostics.Private_accessor_was_defined_without_a_getter); + } + } + } else { + if (isAnyLike) { + if (ts2.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } + return isErrorType(apparentType) ? errorType : apparentType; + } + prop = getPropertyOfType( + apparentType, + right.escapedText, + /*skipObjectFunctionPropertyAugment*/ + false, + /*includeTypeOnlyMembers*/ + node.kind === 163 + /* SyntaxKind.QualifiedName */ + ); + } + if (ts2.isIdentifier(left) && parentSymbol && (compilerOptions.isolatedModules || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 && node.parent.kind === 302)) || ts2.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + markAliasReferenced(parentSymbol, node); + } + var propType; + if (!prop) { + var indexInfo = !ts2.isPrivateIdentifier(right) && (assignmentKind === 0 || !isGenericObjectType(leftType) || ts2.isThisTypeParameter(leftType)) ? getApplicableIndexInfoForName(apparentType, right.escapedText) : void 0; + if (!(indexInfo && indexInfo.type)) { + var isUncheckedJS = isUncheckedJSSuggestion( + node, + leftType.symbol, + /*excludeClasses*/ + true + ); + if (!isUncheckedJS && isJSLiteralType(leftType)) { + return anyType2; + } + if (leftType.symbol === globalThisSymbol) { + if (globalThisSymbol.exports.has(right.escapedText) && globalThisSymbol.exports.get(right.escapedText).flags & 418) { + error2(right, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.unescapeLeadingUnderscores(right.escapedText), typeToString(leftType)); + } else if (noImplicitAny) { + error2(right, ts2.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType)); + } + return anyType2; + } + if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { + reportNonexistentProperty(right, ts2.isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS); + } + return errorType; + } + if (indexInfo.isReadonly && (ts2.isAssignmentTarget(node) || ts2.isDeleteTarget(node))) { + error2(node, ts2.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + propType = compilerOptions.noUncheckedIndexedAccess && !ts2.isAssignmentTarget(node) ? getUnionType([indexInfo.type, undefinedType2]) : indexInfo.type; + if (compilerOptions.noPropertyAccessFromIndexSignature && ts2.isPropertyAccessExpression(node)) { + error2(right, ts2.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts2.unescapeLeadingUnderscores(right.escapedText)); + } + if (indexInfo.declaration && ts2.getCombinedNodeFlags(indexInfo.declaration) & 268435456) { + addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText); + } + } else { + if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) { + addDeprecatedSuggestion(right, prop.declarations, right.escapedText); + } + checkPropertyNotUsedBeforeDeclaration(prop, node, right); + markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol)); + getNodeLinks(node).resolvedSymbol = prop; + var writing = ts2.isWriteAccess(node); + checkPropertyAccessibility(node, left.kind === 106, writing, apparentType, prop); + if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) { + error2(right, ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts2.idText(right)); + return errorType; + } + propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop); + } + return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode); + } + function isUncheckedJSSuggestion(node, suggestion, excludeClasses) { + var file = ts2.getSourceFileOfNode(node); + if (file) { + if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 || file.scriptKind === 2)) { + var declarationFile = ts2.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, ts2.getSourceFileOfNode); + return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32) && !(!!node && excludeClasses && ts2.isPropertyAccessExpression(node) && node.expression.kind === 108); + } + } + return false; + } + function getFlowTypeOfAccessExpression(node, prop, propType, errorNode, checkMode) { + var assignmentKind = ts2.getAssignmentTargetKind(node); + if (assignmentKind === 1) { + return removeMissingType(propType, !!(prop && prop.flags & 16777216)); + } + if (prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 1048576) && !isDuplicatedCommonJSExport(prop.declarations)) { + return propType; + } + if (propType === autoType) { + return getFlowTypeOfProperty(node, prop); + } + propType = getNarrowableTypeForReference(propType, node, checkMode); + var assumeUninitialized = false; + if (strictNullChecks && strictPropertyInitialization && ts2.isAccessExpression(node) && node.expression.kind === 108) { + var declaration = prop && prop.valueDeclaration; + if (declaration && isPropertyWithoutInitializer(declaration)) { + if (!ts2.isStatic(declaration)) { + var flowContainer = getControlFlowContainer(node); + if (flowContainer.kind === 173 && flowContainer.parent === declaration.parent && !(declaration.flags & 16777216)) { + assumeUninitialized = true; + } + } + } + } else if (strictNullChecks && prop && prop.valueDeclaration && ts2.isPropertyAccessExpression(prop.valueDeclaration) && ts2.getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) && getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) { + assumeUninitialized = true; + } + var flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType); + if (assumeUninitialized && !containsUndefinedType(propType) && containsUndefinedType(flowType)) { + error2(errorNode, ts2.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString2(prop)); + return propType; + } + return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; + } + function checkPropertyNotUsedBeforeDeclaration(prop, node, right) { + var valueDeclaration = prop.valueDeclaration; + if (!valueDeclaration || ts2.getSourceFileOfNode(node).isDeclarationFile) { + return; + } + var diagnosticMessage; + var declarationName = ts2.idText(right); + if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(ts2.isAccessExpression(node) && ts2.isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(ts2.isMethodDeclaration(valueDeclaration) && ts2.getCombinedModifierFlags(valueDeclaration) & 32) && (compilerOptions.useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { + diagnosticMessage = error2(right, ts2.Diagnostics.Property_0_is_used_before_its_initialization, declarationName); + } else if (valueDeclaration.kind === 260 && node.parent.kind !== 180 && !(valueDeclaration.flags & 16777216) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { + diagnosticMessage = error2(right, ts2.Diagnostics.Class_0_used_before_its_declaration, declarationName); + } + if (diagnosticMessage) { + ts2.addRelatedInfo(diagnosticMessage, ts2.createDiagnosticForNode(valueDeclaration, ts2.Diagnostics._0_is_declared_here, declarationName)); + } + } + function isInPropertyInitializerOrClassStaticBlock(node) { + return !!ts2.findAncestor(node, function(node2) { + switch (node2.kind) { + case 169: + return true; + case 299: + case 171: + case 174: + case 175: + case 301: + case 164: + case 236: + case 291: + case 288: + case 289: + case 290: + case 283: + case 230: + case 294: + return false; + case 216: + case 241: + return ts2.isBlock(node2.parent) && ts2.isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit"; + default: + return ts2.isExpressionNode(node2) ? false : "quit"; + } + }); + } + function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32)) { + return false; + } + var classType = getTypeOfSymbol(prop.parent); + while (true) { + classType = classType.symbol && getSuperClass(classType); + if (!classType) { + return false; + } + var superProperty = getPropertyOfType(classType, prop.escapedName); + if (superProperty && superProperty.valueDeclaration) { + return true; + } + } + } + function getSuperClass(classType) { + var x7 = getBaseTypes(classType); + if (x7.length === 0) { + return void 0; + } + return getIntersectionType(x7); + } + function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { + var errorInfo; + var relatedInfo; + if (!ts2.isPrivateIdentifier(propNode) && containingType.flags & 1048576 && !(containingType.flags & 131068)) { + for (var _i = 0, _a2 = containingType.types; _i < _a2.length; _i++) { + var subtype = _a2[_i]; + if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.declarationNameToString(propNode), typeToString(subtype)); + break; + } + } + } + if (typeHasStaticProperty(propNode.escapedText, containingType)) { + var propName2 = ts2.declarationNameToString(propNode); + var typeName = typeToString(containingType); + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName2, typeName, typeName + "." + propName2); + } else { + var promisedType = getPromisedTypeOfPromise(containingType); + if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Property_0_does_not_exist_on_type_1, ts2.declarationNameToString(propNode), typeToString(containingType)); + relatedInfo = ts2.createDiagnosticForNode(propNode, ts2.Diagnostics.Did_you_forget_to_use_await); + } else { + var missingProperty = ts2.declarationNameToString(propNode); + var container = typeToString(containingType); + var libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); + if (libSuggestion !== void 0) { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + } else { + var suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== void 0) { + var suggestedName = ts2.symbolName(suggestion); + var message = isUncheckedJS ? ts2.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2; + errorInfo = ts2.chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName); + relatedInfo = suggestion.valueDeclaration && ts2.createDiagnosticForNode(suggestion.valueDeclaration, ts2.Diagnostics._0_is_declared_here, suggestedName); + } else { + var diagnostic = containerSeemsToBeEmptyDomElement(containingType) ? ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom : ts2.Diagnostics.Property_0_does_not_exist_on_type_1; + errorInfo = ts2.chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container); + } + } + } + } + var resultDiagnostic = ts2.createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + if (relatedInfo) { + ts2.addRelatedInfo(resultDiagnostic, relatedInfo); + } + addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== ts2.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic); + } + function containerSeemsToBeEmptyDomElement(containingType) { + return compilerOptions.lib && !compilerOptions.lib.includes("dom") && everyContainedType(containingType, function(type3) { + return type3.symbol && /^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(ts2.unescapeLeadingUnderscores(type3.symbol.escapedName)); + }) && isEmptyObjectType(containingType); + } + function typeHasStaticProperty(propName2, containingType) { + var prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName2); + return prop !== void 0 && !!prop.valueDeclaration && ts2.isStatic(prop.valueDeclaration); + } + function getSuggestedLibForNonExistentName(name2) { + var missingName = diagnosticName(name2); + var allFeatures = ts2.getScriptTargetFeatures(); + var libTargets = ts2.getOwnKeys(allFeatures); + for (var _i = 0, libTargets_1 = libTargets; _i < libTargets_1.length; _i++) { + var libTarget = libTargets_1[_i]; + var containingTypes = ts2.getOwnKeys(allFeatures[libTarget]); + if (containingTypes !== void 0 && ts2.contains(containingTypes, missingName)) { + return libTarget; + } + } + } + function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { + var container = getApparentType(containingType).symbol; + if (!container) { + return void 0; + } + var allFeatures = ts2.getScriptTargetFeatures(); + var libTargets = ts2.getOwnKeys(allFeatures); + for (var _i = 0, libTargets_2 = libTargets; _i < libTargets_2.length; _i++) { + var libTarget = libTargets_2[_i]; + var featuresOfLib = allFeatures[libTarget]; + var featuresOfContainingType = featuresOfLib[ts2.symbolName(container)]; + if (featuresOfContainingType !== void 0 && ts2.contains(featuresOfContainingType, missingProperty)) { + return libTarget; + } + } + } + function getSuggestedSymbolForNonexistentClassMember(name2, baseType) { + return getSpellingSuggestionForName( + name2, + getPropertiesOfType(baseType), + 106500 + /* SymbolFlags.ClassMember */ + ); + } + function getSuggestedSymbolForNonexistentProperty(name2, containingType) { + var props = getPropertiesOfType(containingType); + if (typeof name2 !== "string") { + var parent_3 = name2.parent; + if (ts2.isPropertyAccessExpression(parent_3)) { + props = ts2.filter(props, function(prop) { + return isValidPropertyAccessForCompletions(parent_3, containingType, prop); + }); + } + name2 = ts2.idText(name2); + } + return getSpellingSuggestionForName( + name2, + props, + 111551 + /* SymbolFlags.Value */ + ); + } + function getSuggestedSymbolForNonexistentJSXAttribute(name2, containingType) { + var strName = ts2.isString(name2) ? name2 : ts2.idText(name2); + var properties = getPropertiesOfType(containingType); + var jsxSpecific = strName === "for" ? ts2.find(properties, function(x7) { + return ts2.symbolName(x7) === "htmlFor"; + }) : strName === "class" ? ts2.find(properties, function(x7) { + return ts2.symbolName(x7) === "className"; + }) : void 0; + return jsxSpecific !== null && jsxSpecific !== void 0 ? jsxSpecific : getSpellingSuggestionForName( + strName, + properties, + 111551 + /* SymbolFlags.Value */ + ); + } + function getSuggestionForNonexistentProperty(name2, containingType) { + var suggestion = getSuggestedSymbolForNonexistentProperty(name2, containingType); + return suggestion && ts2.symbolName(suggestion); + } + function getSuggestedSymbolForNonexistentSymbol(location2, outerName, meaning) { + ts2.Debug.assert(outerName !== void 0, "outername should always be defined"); + var result2 = resolveNameHelper( + location2, + outerName, + meaning, + /*nameNotFoundMessage*/ + void 0, + outerName, + /*isUse*/ + false, + /*excludeGlobals*/ + false, + /*getSpellingSuggestions*/ + true, + function(symbols, name2, meaning2) { + ts2.Debug.assertEqual(outerName, name2, "name should equal outerName"); + var symbol = getSymbol(symbols, name2, meaning2); + if (symbol) + return symbol; + var candidates; + if (symbols === globals3) { + var primitives = ts2.mapDefined(["string", "number", "boolean", "object", "bigint", "symbol"], function(s7) { + return symbols.has(s7.charAt(0).toUpperCase() + s7.slice(1)) ? createSymbol(524288, s7) : void 0; + }); + candidates = primitives.concat(ts2.arrayFrom(symbols.values())); + } else { + candidates = ts2.arrayFrom(symbols.values()); + } + return getSpellingSuggestionForName(ts2.unescapeLeadingUnderscores(name2), candidates, meaning2); + } + ); + return result2; + } + function getSuggestionForNonexistentSymbol(location2, outerName, meaning) { + var symbolResult = getSuggestedSymbolForNonexistentSymbol(location2, outerName, meaning); + return symbolResult && ts2.symbolName(symbolResult); + } + function getSuggestedSymbolForNonexistentModule(name2, targetModule) { + return targetModule.exports && getSpellingSuggestionForName( + ts2.idText(name2), + getExportsOfModuleAsArray(targetModule), + 2623475 + /* SymbolFlags.ModuleMember */ + ); + } + function getSuggestionForNonexistentExport(name2, targetModule) { + var suggestion = getSuggestedSymbolForNonexistentModule(name2, targetModule); + return suggestion && ts2.symbolName(suggestion); + } + function getSuggestionForNonexistentIndexSignature(objectType2, expr, keyedType) { + function hasProp(name2) { + var prop = getPropertyOfObjectType(objectType2, name2); + if (prop) { + var s7 = getSingleCallSignature(getTypeOfSymbol(prop)); + return !!s7 && getMinArgumentCount(s7) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s7, 0)); + } + return false; + } + var suggestedMethod = ts2.isAssignmentTarget(expr) ? "set" : "get"; + if (!hasProp(suggestedMethod)) { + return void 0; + } + var suggestion = ts2.tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (suggestion === void 0) { + suggestion = suggestedMethod; + } else { + suggestion += "." + suggestedMethod; + } + return suggestion; + } + function getSuggestedTypeForNonexistentStringLiteralType(source, target) { + var candidates = target.types.filter(function(type3) { + return !!(type3.flags & 128); + }); + return ts2.getSpellingSuggestion(source.value, candidates, function(type3) { + return type3.value; + }); + } + function getSpellingSuggestionForName(name2, symbols, meaning) { + return ts2.getSpellingSuggestion(name2, symbols, getCandidateName); + function getCandidateName(candidate) { + var candidateName = ts2.symbolName(candidate); + if (ts2.startsWith(candidateName, '"')) { + return void 0; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152) { + var alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return void 0; + } + } + function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isSelfTypeAccess2) { + var valueDeclaration = prop && prop.flags & 106500 && prop.valueDeclaration; + if (!valueDeclaration) { + return; + } + var hasPrivateModifier = ts2.hasEffectiveModifier( + valueDeclaration, + 8 + /* ModifierFlags.Private */ + ); + var hasPrivateIdentifier = prop.valueDeclaration && ts2.isNamedDeclaration(prop.valueDeclaration) && ts2.isPrivateIdentifier(prop.valueDeclaration.name); + if (!hasPrivateModifier && !hasPrivateIdentifier) { + return; + } + if (nodeForCheckWriteOnly && ts2.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536)) { + return; + } + if (isSelfTypeAccess2) { + var containingMethod = ts2.findAncestor(nodeForCheckWriteOnly, ts2.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; + } + } + (ts2.getCheckFlags(prop) & 1 ? getSymbolLinks(prop).target : prop).isReferenced = 67108863; + } + function isSelfTypeAccess(name2, parent2) { + return name2.kind === 108 || !!parent2 && ts2.isEntityNameExpression(name2) && parent2 === getResolvedSymbol(ts2.getFirstIdentifier(name2)); + } + function isValidPropertyAccess(node, propertyName) { + switch (node.kind) { + case 208: + return isValidPropertyAccessWithType(node, node.expression.kind === 106, propertyName, getWidenedType(checkExpression(node.expression))); + case 163: + return isValidPropertyAccessWithType( + node, + /*isSuper*/ + false, + propertyName, + getWidenedType(checkExpression(node.left)) + ); + case 202: + return isValidPropertyAccessWithType( + node, + /*isSuper*/ + false, + propertyName, + getTypeFromTypeNode(node) + ); + } + } + function isValidPropertyAccessForCompletions(node, type3, property2) { + return isPropertyAccessible( + node, + node.kind === 208 && node.expression.kind === 106, + /* isWrite */ + false, + type3, + property2 + ); + } + function isValidPropertyAccessWithType(node, isSuper, propertyName, type3) { + if (isTypeAny(type3)) { + return true; + } + var prop = getPropertyOfType(type3, propertyName); + return !!prop && isPropertyAccessible( + node, + isSuper, + /* isWrite */ + false, + type3, + prop + ); + } + function isPropertyAccessible(node, isSuper, isWrite, containingType, property2) { + if (isTypeAny(containingType)) { + return true; + } + if (property2.valueDeclaration && ts2.isPrivateIdentifierClassElementDeclaration(property2.valueDeclaration)) { + var declClass_1 = ts2.getContainingClass(property2.valueDeclaration); + return !ts2.isOptionalChain(node) && !!ts2.findAncestor(node, function(parent2) { + return parent2 === declClass_1; + }); + } + return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType, property2); + } + function getForInVariableSymbol(node) { + var initializer = node.initializer; + if (initializer.kind === 258) { + var variable = initializer.declarations[0]; + if (variable && !ts2.isBindingPattern(variable.name)) { + return getSymbolOfNode(variable); + } + } else if (initializer.kind === 79) { + return getResolvedSymbol(initializer); + } + return void 0; + } + function hasNumericPropertyNames(type3) { + return getIndexInfosOfType(type3).length === 1 && !!getIndexInfoOfType(type3, numberType2); + } + function isForInVariableForNumericPropertyNames(expr) { + var e10 = ts2.skipParentheses(expr); + if (e10.kind === 79) { + var symbol = getResolvedSymbol(e10); + if (symbol.flags & 3) { + var child = expr; + var node = expr.parent; + while (node) { + if (node.kind === 246 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } + function checkIndexedAccess(node, checkMode) { + return node.flags & 32 ? checkElementAccessChain(node, checkMode) : checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode); + } + function checkElementAccessChain(node, checkMode) { + var exprType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(exprType, node.expression); + return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression), checkMode), node, nonOptionalType !== exprType); + } + function checkElementAccessExpression(node, exprType, checkMode) { + var objectType2 = ts2.getAssignmentTargetKind(node) !== 0 || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType; + var indexExpression = node.argumentExpression; + var indexType = checkExpression(indexExpression); + if (isErrorType(objectType2) || objectType2 === silentNeverType) { + return objectType2; + } + if (isConstEnumObjectType(objectType2) && !ts2.isStringLiteralLike(indexExpression)) { + error2(indexExpression, ts2.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); + return errorType; + } + var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType2 : indexType; + var accessFlags = ts2.isAssignmentTarget(node) ? 4 | (isGenericObjectType(objectType2) && !ts2.isThisTypeParameter(objectType2) ? 2 : 0) : 32; + var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType2, effectiveIndexType, accessFlags, node) || errorType; + return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node); + } + function callLikeExpressionMayHaveTypeArguments(node) { + return ts2.isCallOrNewExpression(node) || ts2.isTaggedTemplateExpression(node) || ts2.isJsxOpeningLikeElement(node); + } + function resolveUntypedCall(node) { + if (callLikeExpressionMayHaveTypeArguments(node)) { + ts2.forEach(node.typeArguments, checkSourceElement); + } + if (node.kind === 212) { + checkExpression(node.template); + } else if (ts2.isJsxOpeningLikeElement(node)) { + checkExpression(node.attributes); + } else if (node.kind !== 167) { + ts2.forEach(node.arguments, function(argument) { + checkExpression(argument); + }); + } + return anySignature; + } + function resolveErrorCall(node) { + resolveUntypedCall(node); + return unknownSignature; + } + function reorderCandidates(signatures, result2, callChainFlags) { + var lastParent; + var lastSymbol; + var cutoffIndex = 0; + var index4; + var specializedIndex = -1; + var spliceIndex; + ts2.Debug.assert(!result2.length); + for (var _i = 0, signatures_7 = signatures; _i < signatures_7.length; _i++) { + var signature = signatures_7[_i]; + var symbol = signature.declaration && getSymbolOfNode(signature.declaration); + var parent2 = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent2 === lastParent) { + index4 = index4 + 1; + } else { + lastParent = parent2; + index4 = cutoffIndex; + } + } else { + index4 = cutoffIndex = result2.length; + lastParent = parent2; + } + lastSymbol = symbol; + if (signatureHasLiteralTypes(signature)) { + specializedIndex++; + spliceIndex = specializedIndex; + cutoffIndex++; + } else { + spliceIndex = index4; + } + result2.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature); + } + } + function isSpreadArgument(arg) { + return !!arg && (arg.kind === 227 || arg.kind === 234 && arg.isSpread); + } + function getSpreadArgumentIndex(args) { + return ts2.findIndex(args, isSpreadArgument); + } + function acceptsVoid(t8) { + return !!(t8.flags & 16384); + } + function acceptsVoidUndefinedUnknownOrAny(t8) { + return !!(t8.flags & (16384 | 32768 | 2 | 1)); + } + function hasCorrectArity(node, args, signature, signatureHelpTrailingComma) { + if (signatureHelpTrailingComma === void 0) { + signatureHelpTrailingComma = false; + } + var argCount; + var callIsIncomplete = false; + var effectiveParameterCount = getParameterCount(signature); + var effectiveMinimumArguments = getMinArgumentCount(signature); + if (node.kind === 212) { + argCount = args.length; + if (node.template.kind === 225) { + var lastSpan = ts2.last(node.template.templateSpans); + callIsIncomplete = ts2.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; + } else { + var templateLiteral = node.template; + ts2.Debug.assert( + templateLiteral.kind === 14 + /* SyntaxKind.NoSubstitutionTemplateLiteral */ + ); + callIsIncomplete = !!templateLiteral.isUnterminated; + } + } else if (node.kind === 167) { + argCount = getDecoratorArgumentCount(node, signature); + } else if (ts2.isJsxOpeningLikeElement(node)) { + callIsIncomplete = node.attributes.end === node.end; + if (callIsIncomplete) { + return true; + } + argCount = effectiveMinimumArguments === 0 ? args.length : 1; + effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; + effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); + } else if (!node.arguments) { + ts2.Debug.assert( + node.kind === 211 + /* SyntaxKind.NewExpression */ + ); + return getMinArgumentCount(signature) === 0; + } else { + argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = node.arguments.end === node.end; + var spreadArgIndex = getSpreadArgumentIndex(args); + if (spreadArgIndex >= 0) { + return spreadArgIndex >= getMinArgumentCount(signature) && (hasEffectiveRestParameter(signature) || spreadArgIndex < getParameterCount(signature)); + } + } + if (!hasEffectiveRestParameter(signature) && argCount > effectiveParameterCount) { + return false; + } + if (callIsIncomplete || argCount >= effectiveMinimumArguments) { + return true; + } + for (var i7 = argCount; i7 < effectiveMinimumArguments; i7++) { + var type3 = getTypeAtPosition(signature, i7); + if (filterType(type3, ts2.isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072) { + return false; + } + } + return true; + } + function hasCorrectTypeArgumentArity(signature, typeArguments) { + var numTypeParameters = ts2.length(signature.typeParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); + return !ts2.some(typeArguments) || typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters; + } + function getSingleCallSignature(type3) { + return getSingleSignature( + type3, + 0, + /*allowMembers*/ + false + ); + } + function getSingleCallOrConstructSignature(type3) { + return getSingleSignature( + type3, + 0, + /*allowMembers*/ + false + ) || getSingleSignature( + type3, + 1, + /*allowMembers*/ + false + ); + } + function getSingleSignature(type3, kind, allowMembers) { + if (type3.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type3); + if (allowMembers || resolved.properties.length === 0 && resolved.indexInfos.length === 0) { + if (kind === 0 && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) { + return resolved.callSignatures[0]; + } + if (kind === 1 && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) { + return resolved.constructSignatures[0]; + } + } + } + return void 0; + } + function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) { + var context2 = createInferenceContext(signature.typeParameters, signature, 0, compareTypes); + var restType = getEffectiveRestType(contextualSignature); + var mapper = inferenceContext && (restType && restType.flags & 262144 ? inferenceContext.nonFixingMapper : inferenceContext.mapper); + var sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature; + applyToParameterTypes(sourceSignature, signature, function(source, target) { + inferTypes(context2.inferences, source, target); + }); + if (!inferenceContext) { + applyToReturnTypes(contextualSignature, signature, function(source, target) { + inferTypes( + context2.inferences, + source, + target, + 128 + /* InferencePriority.ReturnType */ + ); + }); + } + return getSignatureInstantiation(signature, getInferredTypes(context2), ts2.isInJSFile(contextualSignature.declaration)); + } + function inferJsxTypeArguments(node, signature, checkMode, context2) { + var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context2, checkMode); + inferTypes(context2.inferences, checkAttrType, paramType); + return getInferredTypes(context2); + } + function getThisArgumentType(thisArgumentNode) { + if (!thisArgumentNode) { + return voidType2; + } + var thisArgumentType = checkExpression(thisArgumentNode); + return ts2.isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : ts2.isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType; + } + function inferTypeArguments(node, signature, args, checkMode, context2) { + if (ts2.isJsxOpeningLikeElement(node)) { + return inferJsxTypeArguments(node, signature, checkMode, context2); + } + if (node.kind !== 167) { + var skipBindingPatterns = ts2.every(signature.typeParameters, function(p7) { + return !!getDefaultFromTypeParameter(p7); + }); + var contextualType = getContextualType( + node, + skipBindingPatterns ? 8 : 0 + /* ContextFlags.None */ + ); + if (contextualType) { + var inferenceTargetType = getReturnTypeOfSignature(signature); + if (couldContainTypeVariables(inferenceTargetType)) { + var outerContext = getInferenceContext(node); + var isFromBindingPattern = !skipBindingPatterns && getContextualType( + node, + 8 + /* ContextFlags.SkipBindingPatterns */ + ) !== contextualType; + if (!isFromBindingPattern) { + var outerMapper = getMapperFromContext(cloneInferenceContext( + outerContext, + 1 + /* InferenceFlags.NoDefault */ + )); + var instantiatedType = instantiateType(contextualType, outerMapper); + var contextualSignature = getSingleCallSignature(instantiatedType); + var inferenceSourceType = contextualSignature && contextualSignature.typeParameters ? getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) : instantiatedType; + inferTypes( + context2.inferences, + inferenceSourceType, + inferenceTargetType, + 128 + /* InferencePriority.ReturnType */ + ); + } + var returnContext = createInferenceContext(signature.typeParameters, signature, context2.flags); + var returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper); + inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType); + context2.returnMapper = ts2.some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0; + } + } + } + var restType = getNonArrayRestType(signature); + var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; + if (restType && restType.flags & 262144) { + var info2 = ts2.find(context2.inferences, function(info3) { + return info3.typeParameter === restType; + }); + if (info2) { + info2.impliedArity = ts2.findIndex(args, isSpreadArgument, argCount) < 0 ? args.length - argCount : void 0; + } + } + var thisType = getThisTypeOfSignature(signature); + if (thisType && couldContainTypeVariables(thisType)) { + var thisArgumentNode = getThisArgumentOfCall(node); + inferTypes(context2.inferences, getThisArgumentType(thisArgumentNode), thisType); + } + for (var i7 = 0; i7 < argCount; i7++) { + var arg = args[i7]; + if (arg.kind !== 229 && !(checkMode & 32 && hasSkipDirectInferenceFlag(arg))) { + var paramType = getTypeAtPosition(signature, i7); + if (couldContainTypeVariables(paramType)) { + var argType = checkExpressionWithContextualType(arg, paramType, context2, checkMode); + inferTypes(context2.inferences, argType, paramType); + } + } + } + if (restType && couldContainTypeVariables(restType)) { + var spreadType = getSpreadArgumentType(args, argCount, args.length, restType, context2, checkMode); + inferTypes(context2.inferences, spreadType, restType); + } + return getInferredTypes(context2); + } + function getMutableArrayOrTupleType(type3) { + return type3.flags & 1048576 ? mapType2(type3, getMutableArrayOrTupleType) : type3.flags & 1 || isMutableArrayOrTuple(getBaseConstraintOfType(type3) || type3) ? type3 : isTupleType(type3) ? createTupleType( + getTypeArguments(type3), + type3.target.elementFlags, + /*readonly*/ + false, + type3.target.labeledElementDeclarations + ) : createTupleType([type3], [ + 8 + /* ElementFlags.Variadic */ + ]); + } + function getSpreadArgumentType(args, index4, argCount, restType, context2, checkMode) { + if (index4 >= argCount - 1) { + var arg = args[argCount - 1]; + if (isSpreadArgument(arg)) { + return getMutableArrayOrTupleType(arg.kind === 234 ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context2, checkMode)); + } + } + var types3 = []; + var flags = []; + var names = []; + for (var i7 = index4; i7 < argCount; i7++) { + var arg = args[i7]; + if (isSpreadArgument(arg)) { + var spreadType = arg.kind === 234 ? arg.type : checkExpression(arg.expression); + if (isArrayLikeType(spreadType)) { + types3.push(spreadType); + flags.push( + 8 + /* ElementFlags.Variadic */ + ); + } else { + types3.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType2, arg.kind === 227 ? arg.expression : arg)); + flags.push( + 4 + /* ElementFlags.Rest */ + ); + } + } else { + var contextualType = getIndexedAccessType( + restType, + getNumberLiteralType(i7 - index4), + 256 + /* AccessFlags.Contextual */ + ); + var argType = checkExpressionWithContextualType(arg, contextualType, context2, checkMode); + var hasPrimitiveContextualType = maybeTypeOfKind( + contextualType, + 131068 | 4194304 | 134217728 | 268435456 + /* TypeFlags.StringMapping */ + ); + types3.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); + flags.push( + 1 + /* ElementFlags.Required */ + ); + } + if (arg.kind === 234 && arg.tupleNameSource) { + names.push(arg.tupleNameSource); + } + } + return createTupleType( + types3, + flags, + /*readonly*/ + false, + ts2.length(names) === ts2.length(types3) ? names : void 0 + ); + } + function checkTypeArguments(signature, typeArgumentNodes, reportErrors, headMessage) { + var isJavascript = ts2.isInJSFile(signature.declaration); + var typeParameters = signature.typeParameters; + var typeArgumentTypes = fillMissingTypeArguments(ts2.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); + var mapper; + for (var i7 = 0; i7 < typeArgumentNodes.length; i7++) { + ts2.Debug.assert(typeParameters[i7] !== void 0, "Should not call checkTypeArguments with too many type arguments"); + var constraint = getConstraintOfTypeParameter(typeParameters[i7]); + if (constraint) { + var errorInfo = reportErrors && headMessage ? function() { + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1 + ); + } : void 0; + var typeArgumentHeadMessage = headMessage || ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + var typeArgument = typeArgumentTypes[i7]; + if (!checkTypeAssignableTo(typeArgument, getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), reportErrors ? typeArgumentNodes[i7] : void 0, typeArgumentHeadMessage, errorInfo)) { + return void 0; + } + } + } + return typeArgumentTypes; + } + function getJsxReferenceKind(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return 2; + } + var tagType = getApparentType(checkExpression(node.tagName)); + if (ts2.length(getSignaturesOfType( + tagType, + 1 + /* SignatureKind.Construct */ + ))) { + return 0; + } + if (ts2.length(getSignaturesOfType( + tagType, + 0 + /* SignatureKind.Call */ + ))) { + return 1; + } + return 2; + } + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer) { + var paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); + var attributesType = checkExpressionWithContextualType( + node.attributes, + paramType, + /*inferenceContext*/ + void 0, + checkMode + ); + return checkTagNameDoesNotExpectTooManyArguments() && checkTypeRelatedToAndOptionallyElaborate( + attributesType, + paramType, + relation, + reportErrors ? node.tagName : void 0, + node.attributes, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + function checkTagNameDoesNotExpectTooManyArguments() { + var _a2; + if (getJsxNamespaceContainerForImplicitImport(node)) { + return true; + } + var tagType = ts2.isJsxOpeningElement(node) || ts2.isJsxSelfClosingElement(node) && !isJsxIntrinsicIdentifier(node.tagName) ? checkExpression(node.tagName) : void 0; + if (!tagType) { + return true; + } + var tagCallSignatures = getSignaturesOfType( + tagType, + 0 + /* SignatureKind.Call */ + ); + if (!ts2.length(tagCallSignatures)) { + return true; + } + var factory = getJsxFactoryEntity(node); + if (!factory) { + return true; + } + var factorySymbol = resolveEntityName( + factory, + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + false, + node + ); + if (!factorySymbol) { + return true; + } + var factoryType = getTypeOfSymbol(factorySymbol); + var callSignatures = getSignaturesOfType( + factoryType, + 0 + /* SignatureKind.Call */ + ); + if (!ts2.length(callSignatures)) { + return true; + } + var hasFirstParamSignatures = false; + var maxParamCount = 0; + for (var _i = 0, callSignatures_1 = callSignatures; _i < callSignatures_1.length; _i++) { + var sig = callSignatures_1[_i]; + var firstparam = getTypeAtPosition(sig, 0); + var signaturesOfParam = getSignaturesOfType( + firstparam, + 0 + /* SignatureKind.Call */ + ); + if (!ts2.length(signaturesOfParam)) + continue; + for (var _b = 0, signaturesOfParam_1 = signaturesOfParam; _b < signaturesOfParam_1.length; _b++) { + var paramSig = signaturesOfParam_1[_b]; + hasFirstParamSignatures = true; + if (hasEffectiveRestParameter(paramSig)) { + return true; + } + var paramCount = getParameterCount(paramSig); + if (paramCount > maxParamCount) { + maxParamCount = paramCount; + } + } + } + if (!hasFirstParamSignatures) { + return true; + } + var absoluteMinArgCount = Infinity; + for (var _c = 0, tagCallSignatures_1 = tagCallSignatures; _c < tagCallSignatures_1.length; _c++) { + var tagSig = tagCallSignatures_1[_c]; + var tagRequiredArgCount = getMinArgumentCount(tagSig); + if (tagRequiredArgCount < absoluteMinArgCount) { + absoluteMinArgCount = tagRequiredArgCount; + } + } + if (absoluteMinArgCount <= maxParamCount) { + return true; + } + if (reportErrors) { + var diag = ts2.createDiagnosticForNode(node.tagName, ts2.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, ts2.entityNameToString(node.tagName), absoluteMinArgCount, ts2.entityNameToString(factory), maxParamCount); + var tagNameDeclaration = (_a2 = getSymbolAtLocation(node.tagName)) === null || _a2 === void 0 ? void 0 : _a2.valueDeclaration; + if (tagNameDeclaration) { + ts2.addRelatedInfo(diag, ts2.createDiagnosticForNode(tagNameDeclaration, ts2.Diagnostics._0_is_declared_here, ts2.entityNameToString(node.tagName))); + } + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag); + } + if (!errorOutputContainer.skipLogging) { + diagnostics.add(diag); + } + } + return false; + } + } + function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors, containingMessageChain) { + var errorOutputContainer = { errors: void 0, skipLogging: true }; + if (ts2.isJsxOpeningLikeElement(node)) { + if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors, containingMessageChain, errorOutputContainer)) { + ts2.Debug.assert(!reportErrors || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); + return errorOutputContainer.errors || ts2.emptyArray; + } + return void 0; + } + var thisType = getThisTypeOfSignature(signature); + if (thisType && thisType !== voidType2 && node.kind !== 211) { + var thisArgumentNode = getThisArgumentOfCall(node); + var thisArgumentType = getThisArgumentType(thisArgumentNode); + var errorNode = reportErrors ? thisArgumentNode || node : void 0; + var headMessage_1 = ts2.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; + if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage_1, containingMessageChain, errorOutputContainer)) { + ts2.Debug.assert(!reportErrors || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); + return errorOutputContainer.errors || ts2.emptyArray; + } + } + var headMessage = ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + var restType = getNonArrayRestType(signature); + var argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; + for (var i7 = 0; i7 < argCount; i7++) { + var arg = args[i7]; + if (arg.kind !== 229) { + var paramType = getTypeAtPosition(signature, i7); + var argType = checkExpressionWithContextualType( + arg, + paramType, + /*inferenceContext*/ + void 0, + checkMode + ); + var checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType; + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors ? arg : void 0, arg, headMessage, containingMessageChain, errorOutputContainer)) { + ts2.Debug.assert(!reportErrors || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(arg, checkArgType, paramType); + return errorOutputContainer.errors || ts2.emptyArray; + } + } + } + if (restType) { + var spreadType = getSpreadArgumentType( + args, + argCount, + args.length, + restType, + /*context*/ + void 0, + checkMode + ); + var restArgCount = args.length - argCount; + var errorNode = !reportErrors ? void 0 : restArgCount === 0 ? node : restArgCount === 1 ? args[argCount] : ts2.setTextRangePosEnd(createSyntheticExpression(node, spreadType), args[argCount].pos, args[args.length - 1].end); + if (!checkTypeRelatedTo( + spreadType, + restType, + relation, + errorNode, + headMessage, + /*containingMessageChain*/ + void 0, + errorOutputContainer + )) { + ts2.Debug.assert(!reportErrors || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(errorNode, spreadType, restType); + return errorOutputContainer.errors || ts2.emptyArray; + } + } + return void 0; + function maybeAddMissingAwaitInfo(errorNode2, source, target) { + if (errorNode2 && reportErrors && errorOutputContainer.errors && errorOutputContainer.errors.length) { + if (getAwaitedTypeOfPromise(target)) { + return; + } + var awaitedTypeOfSource = getAwaitedTypeOfPromise(source); + if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) { + ts2.addRelatedInfo(errorOutputContainer.errors[0], ts2.createDiagnosticForNode(errorNode2, ts2.Diagnostics.Did_you_forget_to_use_await)); + } + } + } + } + function getThisArgumentOfCall(node) { + var expression = node.kind === 210 ? node.expression : node.kind === 212 ? node.tag : void 0; + if (expression) { + var callee = ts2.skipOuterExpressions(expression); + if (ts2.isAccessExpression(callee)) { + return callee.expression; + } + } + } + function createSyntheticExpression(parent2, type3, isSpread, tupleNameSource) { + var result2 = ts2.parseNodeFactory.createSyntheticExpression(type3, isSpread, tupleNameSource); + ts2.setTextRange(result2, parent2); + ts2.setParent(result2, parent2); + return result2; + } + function getEffectiveCallArguments(node) { + if (node.kind === 212) { + var template2 = node.template; + var args_3 = [createSyntheticExpression(template2, getGlobalTemplateStringsArrayType())]; + if (template2.kind === 225) { + ts2.forEach(template2.templateSpans, function(span) { + args_3.push(span.expression); + }); + } + return args_3; + } + if (node.kind === 167) { + return getEffectiveDecoratorArguments(node); + } + if (ts2.isJsxOpeningLikeElement(node)) { + return node.attributes.properties.length > 0 || ts2.isJsxOpeningElement(node) && node.parent.children.length > 0 ? [node.attributes] : ts2.emptyArray; + } + var args = node.arguments || ts2.emptyArray; + var spreadIndex = getSpreadArgumentIndex(args); + if (spreadIndex >= 0) { + var effectiveArgs_1 = args.slice(0, spreadIndex); + var _loop_26 = function(i8) { + var arg = args[i8]; + var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + if (spreadType && isTupleType(spreadType)) { + ts2.forEach(getTypeArguments(spreadType), function(t8, i9) { + var _a2; + var flags = spreadType.target.elementFlags[i9]; + var syntheticArg = createSyntheticExpression(arg, flags & 4 ? createArrayType(t8) : t8, !!(flags & 12), (_a2 = spreadType.target.labeledElementDeclarations) === null || _a2 === void 0 ? void 0 : _a2[i9]); + effectiveArgs_1.push(syntheticArg); + }); + } else { + effectiveArgs_1.push(arg); + } + }; + for (var i7 = spreadIndex; i7 < args.length; i7++) { + _loop_26(i7); + } + return effectiveArgs_1; + } + return args; + } + function getEffectiveDecoratorArguments(node) { + var parent2 = node.parent; + var expr = node.expression; + switch (parent2.kind) { + case 260: + case 228: + return [ + createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(parent2))) + ]; + case 166: + var func = parent2.parent; + return [ + createSyntheticExpression(expr, parent2.parent.kind === 173 ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), + createSyntheticExpression(expr, anyType2), + createSyntheticExpression(expr, numberType2) + ]; + case 169: + case 171: + case 174: + case 175: + var hasPropDesc = languageVersion !== 0 && (!ts2.isPropertyDeclaration(parent2) || ts2.hasAccessorModifier(parent2)); + return [ + createSyntheticExpression(expr, getParentTypeOfClassElement(parent2)), + createSyntheticExpression(expr, getClassElementPropertyKeyType(parent2)), + createSyntheticExpression(expr, hasPropDesc ? createTypedPropertyDescriptorType(getTypeOfNode(parent2)) : anyType2) + ]; + } + return ts2.Debug.fail(); + } + function getDecoratorArgumentCount(node, signature) { + switch (node.parent.kind) { + case 260: + case 228: + return 1; + case 169: + return ts2.hasAccessorModifier(node.parent) ? 3 : 2; + case 171: + case 174: + case 175: + return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3; + case 166: + return 3; + default: + return ts2.Debug.fail(); + } + } + function getDiagnosticSpanForCallNode(node, doNotIncludeArguments) { + var start; + var length; + var sourceFile = ts2.getSourceFileOfNode(node); + if (ts2.isPropertyAccessExpression(node.expression)) { + var nameSpan = ts2.getErrorSpanForNode(sourceFile, node.expression.name); + start = nameSpan.start; + length = doNotIncludeArguments ? nameSpan.length : node.end - start; + } else { + var expressionSpan = ts2.getErrorSpanForNode(sourceFile, node.expression); + start = expressionSpan.start; + length = doNotIncludeArguments ? expressionSpan.length : node.end - start; + } + return { start, length, sourceFile }; + } + function getDiagnosticForCallNode(node, message, arg0, arg1, arg2, arg3) { + if (ts2.isCallExpression(node)) { + var _a2 = getDiagnosticSpanForCallNode(node), sourceFile = _a2.sourceFile, start = _a2.start, length_6 = _a2.length; + return ts2.createFileDiagnostic(sourceFile, start, length_6, message, arg0, arg1, arg2, arg3); + } else { + return ts2.createDiagnosticForNode(node, message, arg0, arg1, arg2, arg3); + } + } + function isPromiseResolveArityError(node) { + if (!ts2.isCallExpression(node) || !ts2.isIdentifier(node.expression)) + return false; + var symbol = resolveName(node.expression, node.expression.escapedText, 111551, void 0, void 0, false); + var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; + if (!decl || !ts2.isParameter(decl) || !ts2.isFunctionExpressionOrArrowFunction(decl.parent) || !ts2.isNewExpression(decl.parent.parent) || !ts2.isIdentifier(decl.parent.parent.expression)) { + return false; + } + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + false + ); + if (!globalPromiseSymbol) + return false; + var constructorSymbol = getSymbolAtLocation( + decl.parent.parent.expression, + /*ignoreErrors*/ + true + ); + return constructorSymbol === globalPromiseSymbol; + } + function getArgumentArityError(node, signatures, args) { + var _a2; + var spreadIndex = getSpreadArgumentIndex(args); + if (spreadIndex > -1) { + return ts2.createDiagnosticForNode(args[spreadIndex], ts2.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter); + } + var min2 = Number.POSITIVE_INFINITY; + var max2 = Number.NEGATIVE_INFINITY; + var maxBelow = Number.NEGATIVE_INFINITY; + var minAbove = Number.POSITIVE_INFINITY; + var closestSignature; + for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) { + var sig = signatures_8[_i]; + var minParameter = getMinArgumentCount(sig); + var maxParameter = getParameterCount(sig); + if (minParameter < min2) { + min2 = minParameter; + closestSignature = sig; + } + max2 = Math.max(max2, maxParameter); + if (minParameter < args.length && minParameter > maxBelow) + maxBelow = minParameter; + if (args.length < maxParameter && maxParameter < minAbove) + minAbove = maxParameter; + } + var hasRestParameter = ts2.some(signatures, hasEffectiveRestParameter); + var parameterRange = hasRestParameter ? min2 : min2 < max2 ? min2 + "-" + max2 : min2; + var isVoidPromiseError = !hasRestParameter && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node); + if (isVoidPromiseError && ts2.isInJSFile(node)) { + return getDiagnosticForCallNode(node, ts2.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); + } + var error3 = hasRestParameter ? ts2.Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? ts2.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : ts2.Diagnostics.Expected_0_arguments_but_got_1; + if (min2 < args.length && args.length < max2) { + return getDiagnosticForCallNode(node, ts2.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); + } else if (args.length < min2) { + var diagnostic = getDiagnosticForCallNode(node, error3, parameterRange, args.length); + var parameter = (_a2 = closestSignature === null || closestSignature === void 0 ? void 0 : closestSignature.declaration) === null || _a2 === void 0 ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; + if (parameter) { + var parameterError = ts2.createDiagnosticForNode(parameter, ts2.isBindingPattern(parameter.name) ? ts2.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided : ts2.isRestParameter(parameter) ? ts2.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided : ts2.Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : !ts2.isBindingPattern(parameter.name) ? ts2.idText(ts2.getFirstIdentifier(parameter.name)) : void 0); + return ts2.addRelatedInfo(diagnostic, parameterError); + } + return diagnostic; + } else { + var errorSpan = ts2.factory.createNodeArray(args.slice(max2)); + var pos = ts2.first(errorSpan).pos; + var end = ts2.last(errorSpan).end; + if (end === pos) { + end++; + } + ts2.setTextRangePosEnd(errorSpan, pos, end); + return ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), errorSpan, error3, parameterRange, args.length); + } + } + function getTypeArgumentArityError(node, signatures, typeArguments) { + var argCount = typeArguments.length; + if (signatures.length === 1) { + var sig = signatures[0]; + var min_1 = getMinTypeArgumentCount(sig.typeParameters); + var max2 = ts2.length(sig.typeParameters); + return ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), typeArguments, ts2.Diagnostics.Expected_0_type_arguments_but_got_1, min_1 < max2 ? min_1 + "-" + max2 : min_1, argCount); + } + var belowArgCount = -Infinity; + var aboveArgCount = Infinity; + for (var _i = 0, signatures_9 = signatures; _i < signatures_9.length; _i++) { + var sig = signatures_9[_i]; + var min_2 = getMinTypeArgumentCount(sig.typeParameters); + var max2 = ts2.length(sig.typeParameters); + if (min_2 > argCount) { + aboveArgCount = Math.min(aboveArgCount, min_2); + } else if (max2 < argCount) { + belowArgCount = Math.max(belowArgCount, max2); + } + } + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + return ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), typeArguments, ts2.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + } + return ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), typeArguments, ts2.Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); + } + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, fallbackError) { + var isTaggedTemplate = node.kind === 212; + var isDecorator = node.kind === 167; + var isJsxOpeningOrSelfClosingElement = ts2.isJsxOpeningLikeElement(node); + var reportErrors = !candidatesOutArray; + var typeArguments; + if (!isDecorator && !ts2.isSuperCall(node)) { + typeArguments = node.typeArguments; + if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 106) { + ts2.forEach(typeArguments, checkSourceElement); + } + } + var candidates = candidatesOutArray || []; + reorderCandidates(signatures, candidates, callChainFlags); + if (!candidates.length) { + if (reportErrors) { + diagnostics.add(getDiagnosticForCallNode(node, ts2.Diagnostics.Call_target_does_not_contain_any_signatures)); + } + return resolveErrorCall(node); + } + var args = getEffectiveCallArguments(node); + var isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; + var argCheckMode = !isDecorator && !isSingleNonGenericCandidate && ts2.some(args, isContextSensitive) ? 4 : 0; + argCheckMode |= checkMode & 32; + var candidatesForArgumentError; + var candidateForArgumentArityError; + var candidateForTypeArgumentError; + var result2; + var signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 210 && node.arguments.hasTrailingComma; + if (candidates.length > 1) { + result2 = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + } + if (!result2) { + result2 = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + } + if (result2) { + return result2; + } + result2 = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode); + getNodeLinks(node).resolvedSignature = result2; + if (reportErrors) { + if (candidatesForArgumentError) { + if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { + var last_2 = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + var chain_1; + if (candidatesForArgumentError.length > 3) { + chain_1 = ts2.chainDiagnosticMessages(chain_1, ts2.Diagnostics.The_last_overload_gave_the_following_error); + chain_1 = ts2.chainDiagnosticMessages(chain_1, ts2.Diagnostics.No_overload_matches_this_call); + } + var diags = getSignatureApplicabilityError( + node, + args, + last_2, + assignableRelation, + 0, + /*reportErrors*/ + true, + function() { + return chain_1; + } + ); + if (diags) { + for (var _i = 0, diags_1 = diags; _i < diags_1.length; _i++) { + var d7 = diags_1[_i]; + if (last_2.declaration && candidatesForArgumentError.length > 3) { + ts2.addRelatedInfo(d7, ts2.createDiagnosticForNode(last_2.declaration, ts2.Diagnostics.The_last_overload_is_declared_here)); + } + addImplementationSuccessElaboration(last_2, d7); + diagnostics.add(d7); + } + } else { + ts2.Debug.fail("No error for last overload signature"); + } + } else { + var allDiagnostics = []; + var max2 = 0; + var min_3 = Number.MAX_VALUE; + var minIndex = 0; + var i_1 = 0; + var _loop_27 = function(c8) { + var chain_2 = function() { + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Overload_0_of_1_2_gave_the_following_error, + i_1 + 1, + candidates.length, + signatureToString(c8) + ); + }; + var diags_2 = getSignatureApplicabilityError( + node, + args, + c8, + assignableRelation, + 0, + /*reportErrors*/ + true, + chain_2 + ); + if (diags_2) { + if (diags_2.length <= min_3) { + min_3 = diags_2.length; + minIndex = i_1; + } + max2 = Math.max(max2, diags_2.length); + allDiagnostics.push(diags_2); + } else { + ts2.Debug.fail("No error for 3 or fewer overload signatures"); + } + i_1++; + }; + for (var _a2 = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a2 < candidatesForArgumentError_1.length; _a2++) { + var c7 = candidatesForArgumentError_1[_a2]; + _loop_27(c7); + } + var diags_3 = max2 > 1 ? allDiagnostics[minIndex] : ts2.flatten(allDiagnostics); + ts2.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures"); + var chain3 = ts2.chainDiagnosticMessages(ts2.map(diags_3, ts2.createDiagnosticMessageChainFromDiagnostic), ts2.Diagnostics.No_overload_matches_this_call); + var related = __spreadArray9([], ts2.flatMap(diags_3, function(d8) { + return d8.relatedInformation; + }), true); + var diag = void 0; + if (ts2.every(diags_3, function(d8) { + return d8.start === diags_3[0].start && d8.length === diags_3[0].length && d8.file === diags_3[0].file; + })) { + var _b = diags_3[0], file = _b.file, start = _b.start, length_7 = _b.length; + diag = { file, start, length: length_7, code: chain3.code, category: chain3.category, messageText: chain3, relatedInformation: related }; + } else { + diag = ts2.createDiagnosticForNodeFromMessageChain(node, chain3, related); + } + addImplementationSuccessElaboration(candidatesForArgumentError[0], diag); + diagnostics.add(diag); + } + } else if (candidateForArgumentArityError) { + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args)); + } else if (candidateForTypeArgumentError) { + checkTypeArguments( + candidateForTypeArgumentError, + node.typeArguments, + /*reportErrors*/ + true, + fallbackError + ); + } else { + var signaturesWithCorrectTypeArgumentArity = ts2.filter(signatures, function(s7) { + return hasCorrectTypeArgumentArity(s7, typeArguments); + }); + if (signaturesWithCorrectTypeArgumentArity.length === 0) { + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments)); + } else if (!isDecorator) { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args)); + } else if (fallbackError) { + diagnostics.add(getDiagnosticForCallNode(node, fallbackError)); + } + } + } + return result2; + function addImplementationSuccessElaboration(failed, diagnostic) { + var _a3, _b2; + var oldCandidatesForArgumentError = candidatesForArgumentError; + var oldCandidateForArgumentArityError = candidateForArgumentArityError; + var oldCandidateForTypeArgumentError = candidateForTypeArgumentError; + var failedSignatureDeclarations = ((_b2 = (_a3 = failed.declaration) === null || _a3 === void 0 ? void 0 : _a3.symbol) === null || _b2 === void 0 ? void 0 : _b2.declarations) || ts2.emptyArray; + var isOverload = failedSignatureDeclarations.length > 1; + var implDecl = isOverload ? ts2.find(failedSignatureDeclarations, function(d8) { + return ts2.isFunctionLikeDeclaration(d8) && ts2.nodeIsPresent(d8.body); + }) : void 0; + if (implDecl) { + var candidate = getSignatureFromDeclaration(implDecl); + var isSingleNonGenericCandidate_1 = !candidate.typeParameters; + if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate_1)) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(implDecl, ts2.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); + } + } + candidatesForArgumentError = oldCandidatesForArgumentError; + candidateForArgumentArityError = oldCandidateForArgumentArityError; + candidateForTypeArgumentError = oldCandidateForTypeArgumentError; + } + function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2) { + if (signatureHelpTrailingComma2 === void 0) { + signatureHelpTrailingComma2 = false; + } + candidatesForArgumentError = void 0; + candidateForArgumentArityError = void 0; + candidateForTypeArgumentError = void 0; + if (isSingleNonGenericCandidate2) { + var candidate = candidates2[0]; + if (ts2.some(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { + return void 0; + } + if (getSignatureApplicabilityError( + node, + args, + candidate, + relation, + 0, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + candidatesForArgumentError = [candidate]; + return void 0; + } + return candidate; + } + for (var candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) { + var candidate = candidates2[candidateIndex]; + if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { + continue; + } + var checkCandidate = void 0; + var inferenceContext = void 0; + if (candidate.typeParameters) { + var typeArgumentTypes = void 0; + if (ts2.some(typeArguments)) { + typeArgumentTypes = checkTypeArguments( + candidate, + typeArguments, + /*reportErrors*/ + false + ); + if (!typeArgumentTypes) { + candidateForTypeArgumentError = candidate; + continue; + } + } else { + inferenceContext = createInferenceContext( + candidate.typeParameters, + candidate, + /*flags*/ + ts2.isInJSFile(node) ? 2 : 0 + /* InferenceFlags.None */ + ); + typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8, inferenceContext); + argCheckMode |= inferenceContext.flags & 4 ? 8 : 0; + } + checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts2.isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { + candidateForArgumentArityError = checkCandidate; + continue; + } + } else { + checkCandidate = candidate; + } + if (getSignatureApplicabilityError( + node, + args, + checkCandidate, + relation, + argCheckMode, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); + continue; + } + if (argCheckMode) { + argCheckMode = checkMode & 32; + if (inferenceContext) { + var typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); + checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, ts2.isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { + candidateForArgumentArityError = checkCandidate; + continue; + } + } + if (getSignatureApplicabilityError( + node, + args, + checkCandidate, + relation, + argCheckMode, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); + continue; + } + } + candidates2[candidateIndex] = checkCandidate; + return checkCandidate; + } + return void 0; + } + } + function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray, checkMode) { + ts2.Debug.assert(candidates.length > 0); + checkNodeDeferred(node); + return hasCandidatesOutArray || candidates.length === 1 || candidates.some(function(c7) { + return !!c7.typeParameters; + }) ? pickLongestCandidateSignature(node, candidates, args, checkMode) : createUnionOfSignaturesForOverloadFailure(candidates); + } + function createUnionOfSignaturesForOverloadFailure(candidates) { + var thisParameters = ts2.mapDefined(candidates, function(c7) { + return c7.thisParameter; + }); + var thisParameter; + if (thisParameters.length) { + thisParameter = createCombinedSymbolFromTypes(thisParameters, thisParameters.map(getTypeOfParameter)); + } + var _a2 = ts2.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a2.min, maxNonRestParam = _a2.max; + var parameters = []; + var _loop_28 = function(i8) { + var symbols = ts2.mapDefined(candidates, function(s7) { + return signatureHasRestParameter(s7) ? i8 < s7.parameters.length - 1 ? s7.parameters[i8] : ts2.last(s7.parameters) : i8 < s7.parameters.length ? s7.parameters[i8] : void 0; + }); + ts2.Debug.assert(symbols.length !== 0); + parameters.push(createCombinedSymbolFromTypes(symbols, ts2.mapDefined(candidates, function(candidate) { + return tryGetTypeAtPosition(candidate, i8); + }))); + }; + for (var i7 = 0; i7 < maxNonRestParam; i7++) { + _loop_28(i7); + } + var restParameterSymbols = ts2.mapDefined(candidates, function(c7) { + return signatureHasRestParameter(c7) ? ts2.last(c7.parameters) : void 0; + }); + var flags = 0; + if (restParameterSymbols.length !== 0) { + var type3 = createArrayType(getUnionType( + ts2.mapDefined(candidates, tryGetRestTypeOfSignature), + 2 + /* UnionReduction.Subtype */ + )); + parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type3)); + flags |= 1; + } + if (candidates.some(signatureHasLiteralTypes)) { + flags |= 2; + } + return createSignature( + candidates[0].declaration, + /*typeParameters*/ + void 0, + // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`. + thisParameter, + parameters, + /*resolvedReturnType*/ + getIntersectionType(candidates.map(getReturnTypeOfSignature)), + /*typePredicate*/ + void 0, + minArgumentCount, + flags + ); + } + function getNumNonRestParameters(signature) { + var numParams = signature.parameters.length; + return signatureHasRestParameter(signature) ? numParams - 1 : numParams; + } + function createCombinedSymbolFromTypes(sources, types3) { + return createCombinedSymbolForOverloadFailure(sources, getUnionType( + types3, + 2 + /* UnionReduction.Subtype */ + )); + } + function createCombinedSymbolForOverloadFailure(sources, type3) { + return createSymbolWithType(ts2.first(sources), type3); + } + function pickLongestCandidateSignature(node, candidates, args, checkMode) { + var bestIndex = getLongestCandidateIndex(candidates, apparentArgumentCount === void 0 ? args.length : apparentArgumentCount); + var candidate = candidates[bestIndex]; + var typeParameters = candidate.typeParameters; + if (!typeParameters) { + return candidate; + } + var typeArgumentNodes = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : void 0; + var instantiated = typeArgumentNodes ? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, ts2.isInJSFile(node))) : inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode); + candidates[bestIndex] = instantiated; + return instantiated; + } + function getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isJs) { + var typeArguments = typeArgumentNodes.map(getTypeOfNode); + while (typeArguments.length > typeParameters.length) { + typeArguments.pop(); + } + while (typeArguments.length < typeParameters.length) { + typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs)); + } + return typeArguments; + } + function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode) { + var inferenceContext = createInferenceContext( + typeParameters, + candidate, + /*flags*/ + ts2.isInJSFile(node) ? 2 : 0 + /* InferenceFlags.None */ + ); + var typeArgumentTypes = inferTypeArguments(node, candidate, args, checkMode | 4 | 8, inferenceContext); + return createSignatureInstantiation(candidate, typeArgumentTypes); + } + function getLongestCandidateIndex(candidates, argsCount) { + var maxParamsIndex = -1; + var maxParams = -1; + for (var i7 = 0; i7 < candidates.length; i7++) { + var candidate = candidates[i7]; + var paramCount = getParameterCount(candidate); + if (hasEffectiveRestParameter(candidate) || paramCount >= argsCount) { + return i7; + } + if (paramCount > maxParams) { + maxParams = paramCount; + maxParamsIndex = i7; + } + } + return maxParamsIndex; + } + function resolveCallExpression(node, candidatesOutArray, checkMode) { + if (node.expression.kind === 106) { + var superType = checkSuperExpression(node.expression); + if (isTypeAny(superType)) { + for (var _i = 0, _a2 = node.arguments; _i < _a2.length; _i++) { + var arg = _a2[_i]; + checkExpression(arg); + } + return anySignature; + } + if (!isErrorType(superType)) { + var baseTypeNode = ts2.getEffectiveBaseTypeNode(ts2.getContainingClass(node)); + if (baseTypeNode) { + var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); + return resolveCall( + node, + baseConstructors, + candidatesOutArray, + checkMode, + 0 + /* SignatureFlags.None */ + ); + } + } + return resolveUntypedCall(node); + } + var callChainFlags; + var funcType = checkExpression(node.expression); + if (ts2.isCallChain(node)) { + var nonOptionalType = getOptionalExpressionType(funcType, node.expression); + callChainFlags = nonOptionalType === funcType ? 0 : ts2.isOutermostOptionalChain(node) ? 16 : 8; + funcType = nonOptionalType; + } else { + callChainFlags = 0; + } + funcType = checkNonNullTypeWithReporter(funcType, node.expression, reportCannotInvokePossiblyNullOrUndefinedError); + if (funcType === silentNeverType) { + return silentNeverSignature; + } + var apparentType = getApparentType(funcType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType( + apparentType, + 0 + /* SignatureKind.Call */ + ); + var numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* SignatureKind.Construct */ + ).length; + if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { + if (!isErrorType(funcType) && node.typeArguments) { + error2(node, ts2.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + if (numConstructSignatures) { + error2(node, ts2.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + } else { + var relatedInformation = void 0; + if (node.arguments.length === 1) { + var text = ts2.getSourceFileOfNode(node).text; + if (ts2.isLineBreak(text.charCodeAt(ts2.skipTrivia( + text, + node.expression.end, + /* stopAfterLineBreak */ + true + ) - 1))) { + relatedInformation = ts2.createDiagnosticForNode(node.expression, ts2.Diagnostics.Are_you_missing_a_semicolon); + } + } + invocationError(node.expression, apparentType, 0, relatedInformation); + } + return resolveErrorCall(node); + } + if (checkMode & 8 && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { + skippedGenericFunction(node, checkMode); + return resolvingSignature; + } + if (callSignatures.some(function(sig) { + return ts2.isInJSFile(sig.declaration) && !!ts2.getJSDocClassTag(sig.declaration); + })) { + error2(node, ts2.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags); + } + function isGenericFunctionReturningFunction(signature) { + return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature))); + } + function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) { + return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576) && !(getReducedType(apparentFuncType).flags & 131072) && isTypeAssignableTo(funcType, globalFunctionType); + } + function resolveNewExpression(node, candidatesOutArray, checkMode) { + if (node.arguments && languageVersion < 1) { + var spreadIndex = getSpreadArgumentIndex(node.arguments); + if (spreadIndex >= 0) { + error2(node.arguments[spreadIndex], ts2.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher); + } + } + var expressionType = checkNonNullExpression(node.expression); + if (expressionType === silentNeverType) { + return silentNeverSignature; + } + expressionType = getApparentType(expressionType); + if (isErrorType(expressionType)) { + return resolveErrorCall(node); + } + if (isTypeAny(expressionType)) { + if (node.typeArguments) { + error2(node, ts2.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return resolveUntypedCall(node); + } + var constructSignatures = getSignaturesOfType( + expressionType, + 1 + /* SignatureKind.Construct */ + ); + if (constructSignatures.length) { + if (!isConstructorAccessible(node, constructSignatures[0])) { + return resolveErrorCall(node); + } + if (someSignature(constructSignatures, function(signature2) { + return !!(signature2.flags & 4); + })) { + error2(node, ts2.Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + return resolveErrorCall(node); + } + var valueDecl = expressionType.symbol && ts2.getClassLikeDeclarationOfSymbol(expressionType.symbol); + if (valueDecl && ts2.hasSyntacticModifier( + valueDecl, + 256 + /* ModifierFlags.Abstract */ + )) { + error2(node, ts2.Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + return resolveErrorCall(node); + } + return resolveCall( + node, + constructSignatures, + candidatesOutArray, + checkMode, + 0 + /* SignatureFlags.None */ + ); + } + var callSignatures = getSignaturesOfType( + expressionType, + 0 + /* SignatureKind.Call */ + ); + if (callSignatures.length) { + var signature = resolveCall( + node, + callSignatures, + candidatesOutArray, + checkMode, + 0 + /* SignatureFlags.None */ + ); + if (!noImplicitAny) { + if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType2) { + error2(node, ts2.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + } + if (getThisTypeOfSignature(signature) === voidType2) { + error2(node, ts2.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void); + } + } + return signature; + } + invocationError( + node.expression, + expressionType, + 1 + /* SignatureKind.Construct */ + ); + return resolveErrorCall(node); + } + function someSignature(signatures, f8) { + if (ts2.isArray(signatures)) { + return ts2.some(signatures, function(signature) { + return someSignature(signature, f8); + }); + } + return signatures.compositeKind === 1048576 ? ts2.some(signatures.compositeSignatures, f8) : f8(signatures); + } + function typeHasProtectedAccessibleBase(target, type3) { + var baseTypes = getBaseTypes(type3); + if (!ts2.length(baseTypes)) { + return false; + } + var firstBase = baseTypes[0]; + if (firstBase.flags & 2097152) { + var types3 = firstBase.types; + var mixinFlags = findMixins(types3); + var i7 = 0; + for (var _i = 0, _a2 = firstBase.types; _i < _a2.length; _i++) { + var intersectionMember = _a2[_i]; + if (!mixinFlags[i7]) { + if (ts2.getObjectFlags(intersectionMember) & (1 | 2)) { + if (intersectionMember.symbol === target) { + return true; + } + if (typeHasProtectedAccessibleBase(target, intersectionMember)) { + return true; + } + } + } + i7++; + } + return false; + } + if (firstBase.symbol === target) { + return true; + } + return typeHasProtectedAccessibleBase(target, firstBase); + } + function isConstructorAccessible(node, signature) { + if (!signature || !signature.declaration) { + return true; + } + var declaration = signature.declaration; + var modifiers = ts2.getSelectedEffectiveModifierFlags( + declaration, + 24 + /* ModifierFlags.NonPublicAccessibilityModifier */ + ); + if (!modifiers || declaration.kind !== 173) { + return true; + } + var declaringClassDeclaration = ts2.getClassLikeDeclarationOfSymbol(declaration.parent.symbol); + var declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol); + if (!isNodeWithinClass(node, declaringClassDeclaration)) { + var containingClass = ts2.getContainingClass(node); + if (containingClass && modifiers & 16) { + var containingType = getTypeOfNode(containingClass); + if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) { + return true; + } + } + if (modifiers & 8) { + error2(node, ts2.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + } + if (modifiers & 16) { + error2(node, ts2.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + } + return false; + } + return true; + } + function invocationErrorDetails(errorTarget, apparentType, kind) { + var errorInfo; + var isCall = kind === 0; + var awaitedType = getAwaitedType(apparentType); + var maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; + if (apparentType.flags & 1048576) { + var types3 = apparentType.types; + var hasSignatures = false; + for (var _i = 0, types_19 = types3; _i < types_19.length; _i++) { + var constituent = types_19[_i]; + var signatures = getSignaturesOfType(constituent, kind); + if (signatures.length !== 0) { + hasSignatures = true; + if (errorInfo) { + break; + } + } else { + if (!errorInfo) { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, isCall ? ts2.Diagnostics.Type_0_has_no_call_signatures : ts2.Diagnostics.Type_0_has_no_construct_signatures, typeToString(constituent)); + errorInfo = ts2.chainDiagnosticMessages(errorInfo, isCall ? ts2.Diagnostics.Not_all_constituents_of_type_0_are_callable : ts2.Diagnostics.Not_all_constituents_of_type_0_are_constructable, typeToString(apparentType)); + } + if (hasSignatures) { + break; + } + } + } + if (!hasSignatures) { + errorInfo = ts2.chainDiagnosticMessages( + /* detials */ + void 0, + isCall ? ts2.Diagnostics.No_constituent_of_type_0_is_callable : ts2.Diagnostics.No_constituent_of_type_0_is_constructable, + typeToString(apparentType) + ); + } + if (!errorInfo) { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, isCall ? ts2.Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other : ts2.Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other, typeToString(apparentType)); + } + } else { + errorInfo = ts2.chainDiagnosticMessages(errorInfo, isCall ? ts2.Diagnostics.Type_0_has_no_call_signatures : ts2.Diagnostics.Type_0_has_no_construct_signatures, typeToString(apparentType)); + } + var headMessage = isCall ? ts2.Diagnostics.This_expression_is_not_callable : ts2.Diagnostics.This_expression_is_not_constructable; + if (ts2.isCallExpression(errorTarget.parent) && errorTarget.parent.arguments.length === 0) { + var resolvedSymbol = getNodeLinks(errorTarget).resolvedSymbol; + if (resolvedSymbol && resolvedSymbol.flags & 32768) { + headMessage = ts2.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without; + } + } + return { + messageChain: ts2.chainDiagnosticMessages(errorInfo, headMessage), + relatedMessage: maybeMissingAwait ? ts2.Diagnostics.Did_you_forget_to_use_await : void 0 + }; + } + function invocationError(errorTarget, apparentType, kind, relatedInformation) { + var _a2 = invocationErrorDetails(errorTarget, apparentType, kind), messageChain = _a2.messageChain, relatedInfo = _a2.relatedMessage; + var diagnostic = ts2.createDiagnosticForNodeFromMessageChain(errorTarget, messageChain); + if (relatedInfo) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(errorTarget, relatedInfo)); + } + if (ts2.isCallExpression(errorTarget.parent)) { + var _b = getDiagnosticSpanForCallNode( + errorTarget.parent, + /* doNotIncludeArguments */ + true + ), start = _b.start, length_8 = _b.length; + diagnostic.start = start; + diagnostic.length = length_8; + } + diagnostics.add(diagnostic); + invocationErrorRecovery(apparentType, kind, relatedInformation ? ts2.addRelatedInfo(diagnostic, relatedInformation) : diagnostic); + } + function invocationErrorRecovery(apparentType, kind, diagnostic) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + if (importNode && !ts2.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(importNode, ts2.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead)); + } + } + function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) { + var tagType = checkExpression(node.tag); + var apparentType = getApparentType(tagType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType( + apparentType, + 0 + /* SignatureKind.Call */ + ); + var numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* SignatureKind.Construct */ + ).length; + if (isUntypedFunctionCall(tagType, apparentType, callSignatures.length, numConstructSignatures)) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + if (ts2.isArrayLiteralExpression(node.parent)) { + var diagnostic = ts2.createDiagnosticForNode(node.tag, ts2.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); + diagnostics.add(diagnostic); + return resolveErrorCall(node); + } + invocationError( + node.tag, + apparentType, + 0 + /* SignatureKind.Call */ + ); + return resolveErrorCall(node); + } + return resolveCall( + node, + callSignatures, + candidatesOutArray, + checkMode, + 0 + /* SignatureFlags.None */ + ); + } + function getDiagnosticHeadMessageForDecoratorResolution(node) { + switch (node.parent.kind) { + case 260: + case 228: + return ts2.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; + case 166: + return ts2.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; + case 169: + return ts2.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; + case 171: + case 174: + case 175: + return ts2.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; + default: + return ts2.Debug.fail(); + } + } + function resolveDecorator(node, candidatesOutArray, checkMode) { + var funcType = checkExpression(node.expression); + var apparentType = getApparentType(funcType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + var callSignatures = getSignaturesOfType( + apparentType, + 0 + /* SignatureKind.Call */ + ); + var numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* SignatureKind.Construct */ + ).length; + if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { + return resolveUntypedCall(node); + } + if (isPotentiallyUncalledDecorator(node, callSignatures)) { + var nodeStr = ts2.getTextOfNode( + node.expression, + /*includeTrivia*/ + false + ); + error2(node, ts2.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); + return resolveErrorCall(node); + } + var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); + if (!callSignatures.length) { + var errorDetails = invocationErrorDetails( + node.expression, + apparentType, + 0 + /* SignatureKind.Call */ + ); + var messageChain = ts2.chainDiagnosticMessages(errorDetails.messageChain, headMessage); + var diag = ts2.createDiagnosticForNodeFromMessageChain(node.expression, messageChain); + if (errorDetails.relatedMessage) { + ts2.addRelatedInfo(diag, ts2.createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); + } + diagnostics.add(diag); + invocationErrorRecovery(apparentType, 0, diag); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0, headMessage); + } + function createSignatureForJSXIntrinsic(node, result2) { + var namespace = getJsxNamespaceAt(node); + var exports29 = namespace && getExportsOfSymbol(namespace); + var typeSymbol = exports29 && getSymbol( + exports29, + JsxNames.Element, + 788968 + /* SymbolFlags.Type */ + ); + var returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968, node); + var declaration = ts2.factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + [ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotdotdot*/ + void 0, + "props", + /*questionMark*/ + void 0, + nodeBuilder.typeToTypeNode(result2, node) + )], + returnNode ? ts2.factory.createTypeReferenceNode( + returnNode, + /*typeArguments*/ + void 0 + ) : ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ) + ); + var parameterSymbol = createSymbol(1, "props"); + parameterSymbol.type = result2; + return createSignature( + declaration, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [parameterSymbol], + typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, + /*returnTypePredicate*/ + void 0, + 1, + 0 + /* SignatureFlags.None */ + ); + } + function resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + var result2 = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + var fakeSignature = createSignatureForJSXIntrinsic(node, result2); + checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType( + node.attributes, + getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), + /*mapper*/ + void 0, + 0 + /* CheckMode.Normal */ + ), result2, node.tagName, node.attributes); + if (ts2.length(node.typeArguments)) { + ts2.forEach(node.typeArguments, checkSourceElement); + diagnostics.add(ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), node.typeArguments, ts2.Diagnostics.Expected_0_type_arguments_but_got_1, 0, ts2.length(node.typeArguments))); + } + return fakeSignature; + } + var exprTypes = checkExpression(node.tagName); + var apparentType = getApparentType(exprTypes); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall( + exprTypes, + apparentType, + signatures.length, + /*constructSignatures*/ + 0 + )) { + return resolveUntypedCall(node); + } + if (signatures.length === 0) { + error2(node.tagName, ts2.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, ts2.getTextOfNode(node.tagName)); + return resolveErrorCall(node); + } + return resolveCall( + node, + signatures, + candidatesOutArray, + checkMode, + 0 + /* SignatureFlags.None */ + ); + } + function isPotentiallyUncalledDecorator(decorator, signatures) { + return signatures.length && ts2.every(signatures, function(signature) { + return signature.minArgumentCount === 0 && !signatureHasRestParameter(signature) && signature.parameters.length < getDecoratorArgumentCount(decorator, signature); + }); + } + function resolveSignature(node, candidatesOutArray, checkMode) { + switch (node.kind) { + case 210: + return resolveCallExpression(node, candidatesOutArray, checkMode); + case 211: + return resolveNewExpression(node, candidatesOutArray, checkMode); + case 212: + return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); + case 167: + return resolveDecorator(node, candidatesOutArray, checkMode); + case 283: + case 282: + return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); + } + throw ts2.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); + } + function getResolvedSignature(node, candidatesOutArray, checkMode) { + var links = getNodeLinks(node); + var cached = links.resolvedSignature; + if (cached && cached !== resolvingSignature && !candidatesOutArray) { + return cached; + } + links.resolvedSignature = resolvingSignature; + var result2 = resolveSignature( + node, + candidatesOutArray, + checkMode || 0 + /* CheckMode.Normal */ + ); + if (result2 !== resolvingSignature) { + links.resolvedSignature = flowLoopStart === flowLoopCount ? result2 : cached; + } + return result2; + } + function isJSConstructor(node) { + var _a2; + if (!node || !ts2.isInJSFile(node)) { + return false; + } + var func = ts2.isFunctionDeclaration(node) || ts2.isFunctionExpression(node) ? node : (ts2.isVariableDeclaration(node) || ts2.isPropertyAssignment(node)) && node.initializer && ts2.isFunctionExpression(node.initializer) ? node.initializer : void 0; + if (func) { + if (ts2.getJSDocClassTag(node)) + return true; + if (ts2.isPropertyAssignment(ts2.walkUpParenthesizedExpressions(func.parent))) + return false; + var symbol = getSymbolOfNode(func); + return !!((_a2 = symbol === null || symbol === void 0 ? void 0 : symbol.members) === null || _a2 === void 0 ? void 0 : _a2.size); + } + return false; + } + function mergeJSSymbols(target, source) { + var _a2, _b; + if (source) { + var links = getSymbolLinks(source); + if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) { + var inferred = ts2.isTransientSymbol(target) ? target : cloneSymbol2(target); + inferred.exports = inferred.exports || ts2.createSymbolTable(); + inferred.members = inferred.members || ts2.createSymbolTable(); + inferred.flags |= source.flags & 32; + if ((_a2 = source.exports) === null || _a2 === void 0 ? void 0 : _a2.size) { + mergeSymbolTable(inferred.exports, source.exports); + } + if ((_b = source.members) === null || _b === void 0 ? void 0 : _b.size) { + mergeSymbolTable(inferred.members, source.members); + } + (links.inferredClassSymbol || (links.inferredClassSymbol = new ts2.Map())).set(getSymbolId(inferred), inferred); + return inferred; + } + return links.inferredClassSymbol.get(getSymbolId(target)); + } + } + function getAssignedClassSymbol(decl) { + var _a2; + var assignmentSymbol = decl && getSymbolOfExpando( + decl, + /*allowDeclaration*/ + true + ); + var prototype = (_a2 = assignmentSymbol === null || assignmentSymbol === void 0 ? void 0 : assignmentSymbol.exports) === null || _a2 === void 0 ? void 0 : _a2.get("prototype"); + var init2 = (prototype === null || prototype === void 0 ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + return init2 ? getSymbolOfNode(init2) : void 0; + } + function getSymbolOfExpando(node, allowDeclaration) { + if (!node.parent) { + return void 0; + } + var name2; + var decl; + if (ts2.isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!ts2.isInJSFile(node) && !(ts2.isVarConst(node.parent) && ts2.isFunctionLikeDeclaration(node))) { + return void 0; + } + name2 = node.parent.name; + decl = node.parent; + } else if (ts2.isBinaryExpression(node.parent)) { + var parentNode = node.parent; + var parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 63 && (allowDeclaration || parentNode.right === node)) { + name2 = parentNode.left; + decl = name2; + } else if (parentNodeOperator === 56 || parentNodeOperator === 60) { + if (ts2.isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name2 = parentNode.parent.name; + decl = parentNode.parent; + } else if (ts2.isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 63 && (allowDeclaration || parentNode.parent.right === parentNode)) { + name2 = parentNode.parent.left; + decl = name2; + } + if (!name2 || !ts2.isBindableStaticNameExpression(name2) || !ts2.isSameEntityName(name2, parentNode.left)) { + return void 0; + } + } + } else if (allowDeclaration && ts2.isFunctionDeclaration(node)) { + name2 = node.name; + decl = node; + } + if (!decl || !name2 || !allowDeclaration && !ts2.getExpandoInitializer(node, ts2.isPrototypeAccess(name2))) { + return void 0; + } + return getSymbolOfNode(decl); + } + function getAssignedJSPrototype(node) { + if (!node.parent) { + return false; + } + var parent2 = node.parent; + while (parent2 && parent2.kind === 208) { + parent2 = parent2.parent; + } + if (parent2 && ts2.isBinaryExpression(parent2) && ts2.isPrototypeAccess(parent2.left) && parent2.operatorToken.kind === 63) { + var right = ts2.getInitializerOfBinaryExpression(parent2); + return ts2.isObjectLiteralExpression(right) && right; + } + } + function checkCallExpression(node, checkMode) { + var _a2; + checkGrammarTypeArguments(node, node.typeArguments); + var signature = getResolvedSignature( + node, + /*candidatesOutArray*/ + void 0, + checkMode + ); + if (signature === resolvingSignature) { + return silentNeverType; + } + checkDeprecatedSignature(signature, node); + if (node.expression.kind === 106) { + return voidType2; + } + if (node.kind === 211) { + var declaration = signature.declaration; + if (declaration && declaration.kind !== 173 && declaration.kind !== 177 && declaration.kind !== 182 && !ts2.isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (noImplicitAny) { + error2(node, ts2.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + } + return anyType2; + } + } + if (ts2.isInJSFile(node) && isCommonJsRequire(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } + var returnType = getReturnTypeOfSignature(signature); + if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) { + return getESSymbolLikeTypeForNode(ts2.walkUpParenthesizedExpressions(node.parent)); + } + if (node.kind === 210 && !node.questionDotToken && node.parent.kind === 241 && returnType.flags & 16384 && getTypePredicateOfSignature(signature)) { + if (!ts2.isDottedName(node.expression)) { + error2(node.expression, ts2.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); + } else if (!getEffectsSignature(node)) { + var diagnostic = error2(node.expression, ts2.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation); + getTypeOfDottedName(node.expression, diagnostic); + } + } + if (ts2.isInJSFile(node)) { + var jsSymbol = getSymbolOfExpando( + node, + /*allowDeclaration*/ + false + ); + if ((_a2 = jsSymbol === null || jsSymbol === void 0 ? void 0 : jsSymbol.exports) === null || _a2 === void 0 ? void 0 : _a2.size) { + var jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + jsAssignmentType.objectFlags |= 4096; + return getIntersectionType([returnType, jsAssignmentType]); + } + } + return returnType; + } + function checkDeprecatedSignature(signature, node) { + if (signature.declaration && signature.declaration.flags & 268435456) { + var suggestionNode = getDeprecatedSuggestionNode(node); + var name2 = ts2.tryGetPropertyAccessOrIdentifierToString(ts2.getInvokedExpression(node)); + addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name2, signatureToString(signature)); + } + } + function getDeprecatedSuggestionNode(node) { + node = ts2.skipParentheses(node); + switch (node.kind) { + case 210: + case 167: + case 211: + return getDeprecatedSuggestionNode(node.expression); + case 212: + return getDeprecatedSuggestionNode(node.tag); + case 283: + case 282: + return getDeprecatedSuggestionNode(node.tagName); + case 209: + return node.argumentExpression; + case 208: + return node.name; + case 180: + var typeReference = node; + return ts2.isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; + default: + return node; + } + } + function isSymbolOrSymbolForCall(node) { + if (!ts2.isCallExpression(node)) + return false; + var left = node.expression; + if (ts2.isPropertyAccessExpression(left) && left.name.escapedText === "for") { + left = left.expression; + } + if (!ts2.isIdentifier(left) || left.escapedText !== "Symbol") { + return false; + } + var globalESSymbol = getGlobalESSymbolConstructorSymbol( + /*reportErrors*/ + false + ); + if (!globalESSymbol) { + return false; + } + return globalESSymbol === resolveName( + left, + "Symbol", + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + } + function checkImportCallExpression(node) { + checkGrammarImportCallExpression(node); + if (node.arguments.length === 0) { + return createPromiseReturnType(node, anyType2); + } + var specifier = node.arguments[0]; + var specifierType = checkExpressionCached(specifier); + var optionsType = node.arguments.length > 1 ? checkExpressionCached(node.arguments[1]) : void 0; + for (var i7 = 2; i7 < node.arguments.length; ++i7) { + checkExpressionCached(node.arguments[i7]); + } + if (specifierType.flags & 32768 || specifierType.flags & 65536 || !isTypeAssignableTo(specifierType, stringType2)) { + error2(specifier, ts2.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType)); + } + if (optionsType) { + var importCallOptionsType = getGlobalImportCallOptionsType( + /*reportErrors*/ + true + ); + if (importCallOptionsType !== emptyObjectType) { + checkTypeAssignableTo(optionsType, getNullableType( + importCallOptionsType, + 32768 + /* TypeFlags.Undefined */ + ), node.arguments[1]); + } + } + var moduleSymbol = resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + var esModuleSymbol = resolveESModuleSymbol( + moduleSymbol, + specifier, + /*dontRecursivelyResolve*/ + true, + /*suppressUsageError*/ + false + ); + if (esModuleSymbol) { + return createPromiseReturnType(node, getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) || getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier)); + } + } + return createPromiseReturnType(node, anyType2); + } + function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) { + var memberTable = ts2.createSymbolTable(); + var newSymbol = createSymbol( + 2097152, + "default" + /* InternalSymbolName.Default */ + ); + newSymbol.parent = originalSymbol; + newSymbol.nameType = getStringLiteralType("default"); + newSymbol.aliasTarget = resolveSymbol(symbol); + memberTable.set("default", newSymbol); + return createAnonymousType(anonymousSymbol, memberTable, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + } + function getTypeWithSyntheticDefaultOnly(type3, symbol, originalSymbol, moduleSpecifier) { + var hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier); + if (hasDefaultOnly && type3 && !isErrorType(type3)) { + var synthType = type3; + if (!synthType.defaultOnlyType) { + var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol); + synthType.defaultOnlyType = type_4; + } + return synthType.defaultOnlyType; + } + return void 0; + } + function getTypeWithSyntheticDefaultImportType(type3, symbol, originalSymbol, moduleSpecifier) { + var _a2; + if (allowSyntheticDefaultImports && type3 && !isErrorType(type3)) { + var synthType = type3; + if (!synthType.syntheticType) { + var file = (_a2 = originalSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(ts2.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault( + file, + originalSymbol, + /*dontResolveAlias*/ + false, + moduleSpecifier + ); + if (hasSyntheticDefault) { + var anonymousSymbol = createSymbol( + 2048, + "__type" + /* InternalSymbolName.Type */ + ); + var defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol); + anonymousSymbol.type = defaultContainingObject; + synthType.syntheticType = isValidSpreadType(type3) ? getSpreadType( + type3, + defaultContainingObject, + anonymousSymbol, + /*objectFlags*/ + 0, + /*readonly*/ + false + ) : defaultContainingObject; + } else { + synthType.syntheticType = type3; + } + } + return synthType.syntheticType; + } + return type3; + } + function isCommonJsRequire(node) { + if (!ts2.isRequireCall( + node, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + return false; + } + if (!ts2.isIdentifier(node.expression)) + return ts2.Debug.fail(); + var resolvedRequire = resolveName( + node.expression, + node.expression.escapedText, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (resolvedRequire === requireSymbol) { + return true; + } + if (resolvedRequire.flags & 2097152) { + return false; + } + var targetDeclarationKind = resolvedRequire.flags & 16 ? 259 : resolvedRequire.flags & 3 ? 257 : 0; + if (targetDeclarationKind !== 0) { + var decl = ts2.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); + return !!decl && !!(decl.flags & 16777216); + } + return false; + } + function checkTaggedTemplateExpression(node) { + if (!checkGrammarTaggedTemplateChain(node)) + checkGrammarTypeArguments(node, node.typeArguments); + if (languageVersion < 2) { + checkExternalEmitHelpers( + node, + 262144 + /* ExternalEmitHelpers.MakeTemplateObject */ + ); + } + var signature = getResolvedSignature(node); + checkDeprecatedSignature(signature, node); + return getReturnTypeOfSignature(signature); + } + function checkAssertion(node) { + if (node.kind === 213) { + var file = ts2.getSourceFileOfNode(node); + if (file && ts2.fileExtensionIsOneOf(file.fileName, [ + ".cts", + ".mts" + /* Extension.Mts */ + ])) { + grammarErrorOnNode(node, ts2.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead); + } + } + return checkAssertionWorker(node, node.type, node.expression); + } + function isValidConstAssertionArgument(node) { + switch (node.kind) { + case 10: + case 14: + case 8: + case 9: + case 110: + case 95: + case 206: + case 207: + case 225: + return true; + case 214: + return isValidConstAssertionArgument(node.expression); + case 221: + var op = node.operator; + var arg = node.operand; + return op === 40 && (arg.kind === 8 || arg.kind === 9) || op === 39 && arg.kind === 8; + case 208: + case 209: + var expr = node.expression; + var symbol = getTypeOfNode(expr).symbol; + if (symbol && symbol.flags & 2097152) { + symbol = resolveAlias(symbol); + } + return !!(symbol && getAllSymbolFlags(symbol) & 384 && getEnumKind(symbol) === 1); + } + return false; + } + function checkAssertionWorker(errNode, type3, expression, checkMode) { + var exprType = checkExpression(expression, checkMode); + if (ts2.isConstTypeReference(type3)) { + if (!isValidConstAssertionArgument(expression)) { + error2(expression, ts2.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals); + } + return getRegularTypeOfLiteralType(exprType); + } + checkSourceElement(type3); + exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType)); + var targetType = getTypeFromTypeNode(type3); + if (!isErrorType(targetType)) { + addLazyDiagnostic(function() { + var widenedType = getWidenedType(exprType); + if (!isTypeComparableTo(targetType, widenedType)) { + checkTypeComparableTo(exprType, targetType, errNode, ts2.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first); + } + }); + } + return targetType; + } + function checkNonNullChain(node) { + var leftType = checkExpression(node.expression); + var nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } + function checkNonNullAssertion(node) { + return node.flags & 32 ? checkNonNullChain(node) : getNonNullableType(checkExpression(node.expression)); + } + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArguments(node); + var exprType = node.kind === 230 ? checkExpression(node.expression) : ts2.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + var typeArguments = node.typeArguments; + if (exprType === silentNeverType || isErrorType(exprType) || !ts2.some(typeArguments)) { + return exprType; + } + var hasSomeApplicableSignature = false; + var nonApplicableType; + var result2 = getInstantiatedType(exprType); + var errorType2 = hasSomeApplicableSignature ? nonApplicableType : exprType; + if (errorType2) { + diagnostics.add(ts2.createDiagnosticForNodeArray(ts2.getSourceFileOfNode(node), typeArguments, ts2.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType2))); + } + return result2; + function getInstantiatedType(type3) { + var hasSignatures = false; + var hasApplicableSignature = false; + var result3 = getInstantiatedTypePart(type3); + hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); + if (hasSignatures && !hasApplicableSignature) { + nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : nonApplicableType = type3; + } + return result3; + function getInstantiatedTypePart(type4) { + if (type4.flags & 524288) { + var resolved = resolveStructuredTypeMembers(type4); + var callSignatures = getInstantiatedSignatures(resolved.callSignatures); + var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); + hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); + hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0); + if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) { + var result_11 = createAnonymousType(void 0, resolved.members, callSignatures, constructSignatures, resolved.indexInfos); + result_11.objectFlags |= 8388608; + result_11.node = node; + return result_11; + } + } else if (type4.flags & 58982400) { + var constraint = getBaseConstraintOfType(type4); + if (constraint) { + var instantiated = getInstantiatedTypePart(constraint); + if (instantiated !== constraint) { + return instantiated; + } + } + } else if (type4.flags & 1048576) { + return mapType2(type4, getInstantiatedType); + } else if (type4.flags & 2097152) { + return getIntersectionType(ts2.sameMap(type4.types, getInstantiatedTypePart)); + } + return type4; + } + } + function getInstantiatedSignatures(signatures) { + var applicableSignatures = ts2.filter(signatures, function(sig) { + return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); + }); + return ts2.sameMap(applicableSignatures, function(sig) { + var typeArgumentTypes = checkTypeArguments( + sig, + typeArguments, + /*reportErrors*/ + true + ); + return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts2.isInJSFile(sig.declaration)) : sig; + }); + } + } + function checkSatisfiesExpression(node) { + checkSourceElement(node.type); + var exprType = checkExpression(node.expression); + var targetType = getTypeFromTypeNode(node.type); + if (isErrorType(targetType)) { + return targetType; + } + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, ts2.Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + return exprType; + } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + if (node.keywordToken === 103) { + return checkNewTargetMetaProperty(node); + } + if (node.keywordToken === 100) { + return checkImportMetaProperty(node); + } + return ts2.Debug.assertNever(node.keywordToken); + } + function checkMetaPropertyKeyword(node) { + switch (node.keywordToken) { + case 100: + return getGlobalImportMetaExpressionType(); + case 103: + var type3 = checkNewTargetMetaProperty(node); + return isErrorType(type3) ? errorType : createNewTargetExpressionType(type3); + default: + ts2.Debug.assertNever(node.keywordToken); + } + } + function checkNewTargetMetaProperty(node) { + var container = ts2.getNewTargetContainer(node); + if (!container) { + error2(node, ts2.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return errorType; + } else if (container.kind === 173) { + var symbol = getSymbolOfNode(container.parent); + return getTypeOfSymbol(symbol); + } else { + var symbol = getSymbolOfNode(container); + return getTypeOfSymbol(symbol); + } + } + function checkImportMetaProperty(node) { + if (moduleKind === ts2.ModuleKind.Node16 || moduleKind === ts2.ModuleKind.NodeNext) { + if (ts2.getSourceFileOfNode(node).impliedNodeFormat !== ts2.ModuleKind.ESNext) { + error2(node, ts2.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); + } + } else if (moduleKind < ts2.ModuleKind.ES2020 && moduleKind !== ts2.ModuleKind.System) { + error2(node, ts2.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext); + } + var file = ts2.getSourceFileOfNode(node); + ts2.Debug.assert(!!(file.flags & 4194304), "Containing file is missing import meta node flag."); + return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType; + } + function getTypeOfParameter(symbol) { + var type3 = getTypeOfSymbol(symbol); + if (strictNullChecks) { + var declaration = symbol.valueDeclaration; + if (declaration && ts2.hasInitializer(declaration)) { + return getOptionalType(type3); + } + } + return type3; + } + function getTupleElementLabel(d7) { + ts2.Debug.assert(ts2.isIdentifier(d7.name)); + return d7.name.escapedText; + } + function getParameterNameAtPosition(signature, pos, overrideRestType) { + var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + return signature.parameters[pos].escapedName; + } + var restParameter = signature.parameters[paramCount] || unknownSymbol; + var restType = overrideRestType || getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + var associatedNames = restType.target.labeledElementDeclarations; + var index4 = pos - paramCount; + return associatedNames && getTupleElementLabel(associatedNames[index4]) || restParameter.escapedName + "_" + index4; + } + return restParameter.escapedName; + } + function getParameterIdentifierNameAtPosition(signature, pos) { + var _a2; + if (((_a2 = signature.declaration) === null || _a2 === void 0 ? void 0 : _a2.kind) === 320) { + return void 0; + } + var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + var param = signature.parameters[pos]; + return isParameterDeclarationWithIdentifierName(param) ? [param.escapedName, false] : void 0; + } + var restParameter = signature.parameters[paramCount] || unknownSymbol; + if (!isParameterDeclarationWithIdentifierName(restParameter)) { + return void 0; + } + var restType = getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + var associatedNames = restType.target.labeledElementDeclarations; + var index4 = pos - paramCount; + var associatedName = associatedNames === null || associatedNames === void 0 ? void 0 : associatedNames[index4]; + var isRestTupleElement = !!(associatedName === null || associatedName === void 0 ? void 0 : associatedName.dotDotDotToken); + return associatedName ? [ + getTupleElementLabel(associatedName), + isRestTupleElement + ] : void 0; + } + if (pos === paramCount) { + return [restParameter.escapedName, true]; + } + return void 0; + } + function isParameterDeclarationWithIdentifierName(symbol) { + return symbol.valueDeclaration && ts2.isParameter(symbol.valueDeclaration) && ts2.isIdentifier(symbol.valueDeclaration.name); + } + function isValidDeclarationForTupleLabel(d7) { + return d7.kind === 199 || ts2.isParameter(d7) && d7.name && ts2.isIdentifier(d7.name); + } + function getNameableDeclarationAtPosition(signature, pos) { + var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + var decl = signature.parameters[pos].valueDeclaration; + return decl && isValidDeclarationForTupleLabel(decl) ? decl : void 0; + } + var restParameter = signature.parameters[paramCount] || unknownSymbol; + var restType = getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + var associatedNames = restType.target.labeledElementDeclarations; + var index4 = pos - paramCount; + return associatedNames && associatedNames[index4]; + } + return restParameter.valueDeclaration && isValidDeclarationForTupleLabel(restParameter.valueDeclaration) ? restParameter.valueDeclaration : void 0; + } + function getTypeAtPosition(signature, pos) { + return tryGetTypeAtPosition(signature, pos) || anyType2; + } + function tryGetTypeAtPosition(signature, pos) { + var paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + return getTypeOfParameter(signature.parameters[pos]); + } + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[paramCount]); + var index4 = pos - paramCount; + if (!isTupleType(restType) || restType.target.hasRestElement || index4 < restType.target.fixedLength) { + return getIndexedAccessType(restType, getNumberLiteralType(index4)); + } + } + return void 0; + } + function getRestTypeAtPosition(source, pos) { + var parameterCount = getParameterCount(source); + var minArgumentCount = getMinArgumentCount(source); + var restType = getEffectiveRestType(source); + if (restType && pos >= parameterCount - 1) { + return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType2)); + } + var types3 = []; + var flags = []; + var names = []; + for (var i7 = pos; i7 < parameterCount; i7++) { + if (!restType || i7 < parameterCount - 1) { + types3.push(getTypeAtPosition(source, i7)); + flags.push( + i7 < minArgumentCount ? 1 : 2 + /* ElementFlags.Optional */ + ); + } else { + types3.push(restType); + flags.push( + 8 + /* ElementFlags.Variadic */ + ); + } + var name2 = getNameableDeclarationAtPosition(source, i7); + if (name2) { + names.push(name2); + } + } + return createTupleType( + types3, + flags, + /*readonly*/ + false, + ts2.length(names) === ts2.length(types3) ? names : void 0 + ); + } + function getParameterCount(signature) { + var length = signature.parameters.length; + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[length - 1]); + if (isTupleType(restType)) { + return length + restType.target.fixedLength - (restType.target.hasRestElement ? 0 : 1); + } + } + return length; + } + function getMinArgumentCount(signature, flags) { + var strongArityForUntypedJS = flags & 1; + var voidIsNonOptional = flags & 2; + if (voidIsNonOptional || signature.resolvedMinArgumentCount === void 0) { + var minArgumentCount = void 0; + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + var firstOptionalIndex = ts2.findIndex(restType.target.elementFlags, function(f8) { + return !(f8 & 1); + }); + var requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + minArgumentCount = signature.parameters.length - 1 + requiredCount; + } + } + } + if (minArgumentCount === void 0) { + if (!strongArityForUntypedJS && signature.flags & 32) { + return 0; + } + minArgumentCount = signature.minArgumentCount; + } + if (voidIsNonOptional) { + return minArgumentCount; + } + for (var i7 = minArgumentCount - 1; i7 >= 0; i7--) { + var type3 = getTypeAtPosition(signature, i7); + if (filterType(type3, acceptsVoid).flags & 131072) { + break; + } + minArgumentCount = i7; + } + signature.resolvedMinArgumentCount = minArgumentCount; + } + return signature.resolvedMinArgumentCount; + } + function hasEffectiveRestParameter(signature) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + return !isTupleType(restType) || restType.target.hasRestElement; + } + return false; + } + function getEffectiveRestType(signature) { + if (signatureHasRestParameter(signature)) { + var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (!isTupleType(restType)) { + return restType; + } + if (restType.target.hasRestElement) { + return sliceTupleType(restType, restType.target.fixedLength); + } + } + return void 0; + } + function getNonArrayRestType(signature) { + var restType = getEffectiveRestType(signature); + return restType && !isArrayType(restType) && !isTypeAny(restType) && (getReducedType(restType).flags & 131072) === 0 ? restType : void 0; + } + function getTypeOfFirstParameterOfSignature(signature) { + return getTypeOfFirstParameterOfSignatureWithFallback(signature, neverType2); + } + function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType; + } + function inferFromAnnotatedParameters(signature, context2, inferenceContext) { + var len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + for (var i7 = 0; i7 < len; i7++) { + var declaration = signature.parameters[i7].valueDeclaration; + if (declaration.type) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + inferTypes(inferenceContext.inferences, getTypeFromTypeNode(typeNode), getTypeAtPosition(context2, i7)); + } + } + } + } + function assignContextualParameterTypes(signature, context2) { + if (context2.typeParameters) { + if (!signature.typeParameters) { + signature.typeParameters = context2.typeParameters; + } else { + return; + } + } + if (context2.thisParameter) { + var parameter = signature.thisParameter; + if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { + if (!parameter) { + signature.thisParameter = createSymbolWithType( + context2.thisParameter, + /*type*/ + void 0 + ); + } + assignParameterType(signature.thisParameter, getTypeOfSymbol(context2.thisParameter)); + } + } + var len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + for (var i7 = 0; i7 < len; i7++) { + var parameter = signature.parameters[i7]; + if (!ts2.getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) { + var contextualParameterType = tryGetTypeAtPosition(context2, i7); + assignParameterType(parameter, contextualParameterType); + } + } + if (signatureHasRestParameter(signature)) { + var parameter = ts2.last(signature.parameters); + if (parameter.valueDeclaration ? !ts2.getEffectiveTypeAnnotationNode(parameter.valueDeclaration) : !!(ts2.getCheckFlags(parameter) & 65536)) { + var contextualParameterType = getRestTypeAtPosition(context2, len); + assignParameterType(parameter, contextualParameterType); + } + } + } + function assignNonContextualParameterTypes(signature) { + if (signature.thisParameter) { + assignParameterType(signature.thisParameter); + } + for (var _i = 0, _a2 = signature.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + assignParameterType(parameter); + } + } + function assignParameterType(parameter, type3) { + var links = getSymbolLinks(parameter); + if (!links.type) { + var declaration = parameter.valueDeclaration; + links.type = type3 || (declaration ? getWidenedTypeForVariableLikeDeclaration( + declaration, + /*reportErrors*/ + true + ) : getTypeOfSymbol(parameter)); + if (declaration && declaration.name.kind !== 79) { + if (links.type === unknownType2) { + links.type = getTypeFromBindingPattern(declaration.name); + } + assignBindingElementTypes(declaration.name, links.type); + } + } else if (type3) { + ts2.Debug.assertEqual(links.type, type3, "Parameter symbol already has a cached type which differs from newly assigned type"); + } + } + function assignBindingElementTypes(pattern5, parentType) { + for (var _i = 0, _a2 = pattern5.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + var type3 = getBindingElementTypeFromParentType(element, parentType); + if (element.name.kind === 79) { + getSymbolLinks(getSymbolOfNode(element)).type = type3; + } else { + assignBindingElementTypes(element.name, type3); + } + } + } + } + function createPromiseType(promisedType) { + var globalPromiseType = getGlobalPromiseType( + /*reportErrors*/ + true + ); + if (globalPromiseType !== emptyGenericType) { + promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType2; + return createTypeReference(globalPromiseType, [promisedType]); + } + return unknownType2; + } + function createPromiseLikeType(promisedType) { + var globalPromiseLikeType = getGlobalPromiseLikeType( + /*reportErrors*/ + true + ); + if (globalPromiseLikeType !== emptyGenericType) { + promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType2; + return createTypeReference(globalPromiseLikeType, [promisedType]); + } + return unknownType2; + } + function createPromiseReturnType(func, promisedType) { + var promiseType2 = createPromiseType(promisedType); + if (promiseType2 === unknownType2) { + error2(func, ts2.isImportCall(func) ? ts2.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : ts2.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option); + return errorType; + } else if (!getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + true + )) { + error2(func, ts2.isImportCall(func) ? ts2.Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : ts2.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } + return promiseType2; + } + function createNewTargetExpressionType(targetType) { + var symbol = createSymbol(0, "NewTargetExpression"); + var targetPropertySymbol = createSymbol( + 4, + "target", + 8 + /* CheckFlags.Readonly */ + ); + targetPropertySymbol.parent = symbol; + targetPropertySymbol.type = targetType; + var members = ts2.createSymbolTable([targetPropertySymbol]); + symbol.members = members; + return createAnonymousType(symbol, members, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + } + function getReturnTypeFromBody(func, checkMode) { + if (!func.body) { + return errorType; + } + var functionFlags = ts2.getFunctionFlags(func); + var isAsync2 = (functionFlags & 2) !== 0; + var isGenerator = (functionFlags & 1) !== 0; + var returnType; + var yieldType; + var nextType; + var fallbackReturnType = voidType2; + if (func.body.kind !== 238) { + returnType = checkExpressionCached( + func.body, + checkMode && checkMode & ~8 + /* CheckMode.SkipGenericFunctions */ + ); + if (isAsync2) { + returnType = unwrapAwaitedType(checkAwaitedType( + returnType, + /*withAlias*/ + false, + /*errorNode*/ + func, + ts2.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + )); + } + } else if (isGenerator) { + var returnTypes = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!returnTypes) { + fallbackReturnType = neverType2; + } else if (returnTypes.length > 0) { + returnType = getUnionType( + returnTypes, + 2 + /* UnionReduction.Subtype */ + ); + } + var _a2 = checkAndAggregateYieldOperandTypes(func, checkMode), yieldTypes = _a2.yieldTypes, nextTypes = _a2.nextTypes; + yieldType = ts2.some(yieldTypes) ? getUnionType( + yieldTypes, + 2 + /* UnionReduction.Subtype */ + ) : void 0; + nextType = ts2.some(nextTypes) ? getIntersectionType(nextTypes) : void 0; + } else { + var types3 = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!types3) { + return functionFlags & 2 ? createPromiseReturnType(func, neverType2) : neverType2; + } + if (types3.length === 0) { + return functionFlags & 2 ? createPromiseReturnType(func, voidType2) : voidType2; + } + returnType = getUnionType( + types3, + 2 + /* UnionReduction.Subtype */ + ); + } + if (returnType || yieldType || nextType) { + if (yieldType) + reportErrorsFromWidening( + func, + yieldType, + 3 + /* WideningKind.GeneratorYield */ + ); + if (returnType) + reportErrorsFromWidening( + func, + returnType, + 1 + /* WideningKind.FunctionReturn */ + ); + if (nextType) + reportErrorsFromWidening( + func, + nextType, + 2 + /* WideningKind.GeneratorNext */ + ); + if (returnType && isUnitType(returnType) || yieldType && isUnitType(yieldType) || nextType && isUnitType(nextType)) { + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); + var contextualType = !contextualSignature ? void 0 : contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? void 0 : returnType : instantiateContextualType( + getReturnTypeOfSignature(contextualSignature), + func, + /*contextFlags*/ + void 0 + ); + if (isGenerator) { + yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, 0, isAsync2); + returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, 1, isAsync2); + nextType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(nextType, contextualType, 2, isAsync2); + } else { + returnType = getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(returnType, contextualType, isAsync2); + } + } + if (yieldType) + yieldType = getWidenedType(yieldType); + if (returnType) + returnType = getWidenedType(returnType); + if (nextType) + nextType = getWidenedType(nextType); + } + if (isGenerator) { + return createGeneratorReturnType(yieldType || neverType2, returnType || fallbackReturnType, nextType || getContextualIterationType(2, func) || unknownType2, isAsync2); + } else { + return isAsync2 ? createPromiseType(returnType || fallbackReturnType) : returnType || fallbackReturnType; + } + } + function createGeneratorReturnType(yieldType, returnType, nextType, isAsyncGenerator) { + var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; + var globalGeneratorType = resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ); + yieldType = resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || unknownType2; + returnType = resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || unknownType2; + nextType = resolver.resolveIterationType( + nextType, + /*errorNode*/ + void 0 + ) || unknownType2; + if (globalGeneratorType === emptyGenericType) { + var globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ); + var iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : void 0; + var iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType2; + var iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType2; + if (isTypeAssignableTo(returnType, iterableIteratorReturnType) && isTypeAssignableTo(iterableIteratorNextType, nextType)) { + if (globalType !== emptyGenericType) { + return createTypeFromGenericGlobalType(globalType, [yieldType]); + } + resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + true + ); + return emptyObjectType; + } + resolver.getGlobalGeneratorType( + /*reportErrors*/ + true + ); + return emptyObjectType; + } + return createTypeFromGenericGlobalType(globalGeneratorType, [yieldType, returnType, nextType]); + } + function checkAndAggregateYieldOperandTypes(func, checkMode) { + var yieldTypes = []; + var nextTypes = []; + var isAsync2 = (ts2.getFunctionFlags(func) & 2) !== 0; + ts2.forEachYieldExpression(func.body, function(yieldExpression) { + var yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType; + ts2.pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType2, isAsync2)); + var nextType; + if (yieldExpression.asteriskToken) { + var iterationTypes = getIterationTypesOfIterable(yieldExpressionType, isAsync2 ? 19 : 17, yieldExpression.expression); + nextType = iterationTypes && iterationTypes.nextType; + } else { + nextType = getContextualType( + yieldExpression, + /*contextFlags*/ + void 0 + ); + } + if (nextType) + ts2.pushIfUnique(nextTypes, nextType); + }); + return { yieldTypes, nextTypes }; + } + function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync2) { + var errorNode = node.expression || node; + var yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync2 ? 19 : 17, expressionType, sentType, errorNode) : expressionType; + return !isAsync2 ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken ? ts2.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : ts2.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + } + function getNotEqualFactsFromTypeofSwitch(start, end, witnesses) { + var facts = 0; + for (var i7 = 0; i7 < witnesses.length; i7++) { + var witness = i7 < start || i7 >= end ? witnesses[i7] : void 0; + facts |= witness !== void 0 ? typeofNEFacts.get(witness) || 32768 : 0; + } + return facts; + } + function isExhaustiveSwitchStatement(node) { + var links = getNodeLinks(node); + if (links.isExhaustive === void 0) { + links.isExhaustive = 0; + var exhaustive = computeExhaustiveSwitchStatement(node); + if (links.isExhaustive === 0) { + links.isExhaustive = exhaustive; + } + } else if (links.isExhaustive === 0) { + links.isExhaustive = false; + } + return links.isExhaustive; + } + function computeExhaustiveSwitchStatement(node) { + if (node.expression.kind === 218) { + var witnesses = getSwitchClauseTypeOfWitnesses(node); + if (!witnesses) { + return false; + } + var operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression)); + var notEqualFacts_2 = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses); + if (operandConstraint.flags & 3) { + return (556800 & notEqualFacts_2) === 556800; + } + return !someType(operandConstraint, function(t8) { + return (getTypeFacts(t8) & notEqualFacts_2) === notEqualFacts_2; + }); + } + var type3 = checkExpressionCached(node.expression); + if (!isLiteralType(type3)) { + return false; + } + var switchTypes = getSwitchClauseTypes(node); + if (!switchTypes.length || ts2.some(switchTypes, isNeitherUnitTypeNorNever)) { + return false; + } + return eachTypeContainedIn(mapType2(type3, getRegularTypeOfLiteralType), switchTypes); + } + function functionHasImplicitReturn(func) { + return func.endFlowNode && isReachableFlowNode(func.endFlowNode); + } + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + var functionFlags = ts2.getFunctionFlags(func); + var aggregatedTypes = []; + var hasReturnWithNoExpression = functionHasImplicitReturn(func); + var hasReturnOfTypeNever = false; + ts2.forEachReturnStatement(func.body, function(returnStatement) { + var expr = returnStatement.expression; + if (expr) { + var type3 = checkExpressionCached( + expr, + checkMode && checkMode & ~8 + /* CheckMode.SkipGenericFunctions */ + ); + if (functionFlags & 2) { + type3 = unwrapAwaitedType(checkAwaitedType( + type3, + /*withAlias*/ + false, + func, + ts2.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + )); + } + if (type3.flags & 131072) { + hasReturnOfTypeNever = true; + } + ts2.pushIfUnique(aggregatedTypes, type3); + } else { + hasReturnWithNoExpression = true; + } + }); + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { + return void 0; + } + if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression && !(isJSConstructor(func) && aggregatedTypes.some(function(t8) { + return t8.symbol === func.symbol; + }))) { + ts2.pushIfUnique(aggregatedTypes, undefinedType2); + } + return aggregatedTypes; + } + function mayReturnNever(func) { + switch (func.kind) { + case 215: + case 216: + return true; + case 171: + return func.parent.kind === 207; + default: + return false; + } + } + function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { + addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics); + return; + function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() { + var functionFlags = ts2.getFunctionFlags(func); + var type3 = returnType && unwrapReturnType(returnType, functionFlags); + if (type3 && maybeTypeOfKind( + type3, + 1 | 16384 + /* TypeFlags.Void */ + )) { + return; + } + if (func.kind === 170 || ts2.nodeIsMissing(func.body) || func.body.kind !== 238 || !functionHasImplicitReturn(func)) { + return; + } + var hasExplicitReturn = func.flags & 512; + var errorNode = ts2.getEffectiveReturnTypeNode(func) || func; + if (type3 && type3.flags & 131072) { + error2(errorNode, ts2.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); + } else if (type3 && !hasExplicitReturn) { + error2(errorNode, ts2.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); + } else if (type3 && strictNullChecks && !isTypeAssignableTo(undefinedType2, type3)) { + error2(errorNode, ts2.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); + } else if (compilerOptions.noImplicitReturns) { + if (!type3) { + if (!hasExplicitReturn) { + return; + } + var inferredReturnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); + if (isUnwrappedReturnTypeVoidOrAny(func, inferredReturnType)) { + return; + } + } + error2(errorNode, ts2.Diagnostics.Not_all_code_paths_return_a_value); + } + } + } + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + ts2.Debug.assert(node.kind !== 171 || ts2.isObjectLiteralMethod(node)); + checkNodeDeferred(node); + if (ts2.isFunctionExpression(node)) { + checkCollisionsForDeclarationName(node, node.name); + } + if (checkMode && checkMode & 4 && isContextSensitive(node)) { + if (!ts2.getEffectiveReturnTypeNode(node) && !ts2.hasContextSensitiveParameters(node)) { + var contextualSignature = getContextualSignature(node); + if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) { + var links = getNodeLinks(node); + if (links.contextFreeType) { + return links.contextFreeType; + } + var returnType = getReturnTypeFromBody(node, checkMode); + var returnOnlySignature = createSignature( + void 0, + void 0, + void 0, + ts2.emptyArray, + returnType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* SignatureFlags.None */ + ); + var returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], ts2.emptyArray, ts2.emptyArray); + returnOnlyType.objectFlags |= 262144; + return links.contextFreeType = returnOnlyType; + } + } + return anyFunctionType; + } + var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 215) { + checkGrammarForGenerator(node); + } + contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return getTypeOfSymbol(getSymbolOfNode(node)); + } + function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + var links = getNodeLinks(node); + if (!(links.flags & 1024)) { + var contextualSignature = getContextualSignature(node); + if (!(links.flags & 1024)) { + links.flags |= 1024; + var signature = ts2.firstOrUndefined(getSignaturesOfType( + getTypeOfSymbol(getSymbolOfNode(node)), + 0 + /* SignatureKind.Call */ + )); + if (!signature) { + return; + } + if (isContextSensitive(node)) { + if (contextualSignature) { + var inferenceContext = getInferenceContext(node); + var instantiatedContextualSignature = void 0; + if (checkMode && checkMode & 2) { + inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + var restType = getEffectiveRestType(contextualSignature); + if (restType && restType.flags & 262144) { + instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper); + } + } + instantiatedContextualSignature || (instantiatedContextualSignature = inferenceContext ? instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature); + assignContextualParameterTypes(signature, instantiatedContextualSignature); + } else { + assignNonContextualParameterTypes(signature); + } + } + if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) { + var returnType = getReturnTypeFromBody(node, checkMode); + if (!signature.resolvedReturnType) { + signature.resolvedReturnType = returnType; + } + } + checkSignatureDeclaration(node); + } + } + } + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { + ts2.Debug.assert(node.kind !== 171 || ts2.isObjectLiteralMethod(node)); + var functionFlags = ts2.getFunctionFlags(node); + var returnType = getReturnTypeFromAnnotation(node); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); + if (node.body) { + if (!ts2.getEffectiveReturnTypeNode(node)) { + getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + } + if (node.body.kind === 238) { + checkSourceElement(node.body); + } else { + var exprType = checkExpression(node.body); + var returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags); + if (returnOrPromisedType) { + if ((functionFlags & 3) === 2) { + var awaitedType = checkAwaitedType( + exprType, + /*withAlias*/ + false, + node.body, + ts2.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body); + } else { + checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, node.body, node.body); + } + } + } + } + } + function checkArithmeticOperandType(operand, type3, diagnostic, isAwaitValid) { + if (isAwaitValid === void 0) { + isAwaitValid = false; + } + if (!isTypeAssignableTo(type3, numberOrBigIntType)) { + var awaitedType = isAwaitValid && getAwaitedTypeOfPromise(type3); + errorAndMaybeSuggestAwait(operand, !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), diagnostic); + return false; + } + return true; + } + function isReadonlyAssignmentDeclaration(d7) { + if (!ts2.isCallExpression(d7)) { + return false; + } + if (!ts2.isBindableObjectDefinePropertyCall(d7)) { + return false; + } + var objectLitType = checkExpressionCached(d7.arguments[2]); + var valueType = getTypeOfPropertyOfType(objectLitType, "value"); + if (valueType) { + var writableProp = getPropertyOfType(objectLitType, "writable"); + var writableType = writableProp && getTypeOfSymbol(writableProp); + if (!writableType || writableType === falseType || writableType === regularFalseType) { + return true; + } + if (writableProp && writableProp.valueDeclaration && ts2.isPropertyAssignment(writableProp.valueDeclaration)) { + var initializer = writableProp.valueDeclaration.initializer; + var rawOriginalType = checkExpression(initializer); + if (rawOriginalType === falseType || rawOriginalType === regularFalseType) { + return true; + } + } + return false; + } + var setProp = getPropertyOfType(objectLitType, "set"); + return !setProp; + } + function isReadonlySymbol(symbol) { + return !!(ts2.getCheckFlags(symbol) & 8 || symbol.flags & 4 && ts2.getDeclarationModifierFlagsFromSymbol(symbol) & 64 || symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 2 || symbol.flags & 98304 && !(symbol.flags & 65536) || symbol.flags & 8 || ts2.some(symbol.declarations, isReadonlyAssignmentDeclaration)); + } + function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) { + var _a2, _b; + if (assignmentKind === 0) { + return false; + } + if (isReadonlySymbol(symbol)) { + if (symbol.flags & 4 && ts2.isAccessExpression(expr) && expr.expression.kind === 108) { + var ctor = ts2.getContainingFunction(expr); + if (!(ctor && (ctor.kind === 173 || isJSConstructor(ctor)))) { + return true; + } + if (symbol.valueDeclaration) { + var isAssignmentDeclaration_1 = ts2.isBinaryExpression(symbol.valueDeclaration); + var isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent; + var isLocalParameterProperty = ctor === symbol.valueDeclaration.parent; + var isLocalThisPropertyAssignment = isAssignmentDeclaration_1 && ((_a2 = symbol.parent) === null || _a2 === void 0 ? void 0 : _a2.valueDeclaration) === ctor.parent; + var isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration_1 && ((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration) === ctor; + var isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction; + return !isWriteableSymbol; + } + } + return true; + } + if (ts2.isAccessExpression(expr)) { + var node = ts2.skipParentheses(expr.expression); + if (node.kind === 79) { + var symbol_2 = getNodeLinks(node).resolvedSymbol; + if (symbol_2.flags & 2097152) { + var declaration = getDeclarationOfAliasSymbol(symbol_2); + return !!declaration && declaration.kind === 271; + } + } + } + return false; + } + function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { + var node = ts2.skipOuterExpressions( + expr, + 6 | 1 + /* OuterExpressionKinds.Parentheses */ + ); + if (node.kind !== 79 && !ts2.isAccessExpression(node)) { + error2(expr, invalidReferenceMessage); + return false; + } + if (node.flags & 32) { + error2(expr, invalidOptionalChainMessage); + return false; + } + return true; + } + function checkDeleteExpression(node) { + checkExpression(node.expression); + var expr = ts2.skipParentheses(node.expression); + if (!ts2.isAccessExpression(expr)) { + error2(expr, ts2.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType2; + } + if (ts2.isPropertyAccessExpression(expr) && ts2.isPrivateIdentifier(expr.name)) { + error2(expr, ts2.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); + } + var links = getNodeLinks(expr); + var symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol) { + if (isReadonlySymbol(symbol)) { + error2(expr, ts2.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } + checkDeleteExpressionMustBeOptional(expr, symbol); + } + return booleanType2; + } + function checkDeleteExpressionMustBeOptional(expr, symbol) { + var type3 = getTypeOfSymbol(symbol); + if (strictNullChecks && !(type3.flags & (3 | 131072)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : getTypeFacts(type3) & 16777216)) { + error2(expr, ts2.Diagnostics.The_operand_of_a_delete_operator_must_be_optional); + } + } + function checkTypeOfExpression(node) { + checkExpression(node.expression); + return typeofType; + } + function checkVoidExpression(node) { + checkExpression(node.expression); + return undefinedWideningType; + } + function checkAwaitExpressionGrammar(node) { + var container = ts2.getContainingFunctionOrClassStaticBlock(node); + if (container && ts2.isClassStaticBlockDeclaration(container)) { + error2(node, ts2.Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block); + } else if (!(node.flags & 32768)) { + if (ts2.isInTopLevelContext(node)) { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = void 0; + if (!ts2.isEffectiveExternalModule(sourceFile, compilerOptions)) { + span !== null && span !== void 0 ? span : span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + var diagnostic = ts2.createFileDiagnostic(sourceFile, span.start, span.length, ts2.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module); + diagnostics.add(diagnostic); + } + switch (moduleKind) { + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + if (sourceFile.impliedNodeFormat === ts2.ModuleKind.CommonJS) { + span !== null && span !== void 0 ? span : span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(ts2.createFileDiagnostic(sourceFile, span.start, span.length, ts2.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)); + break; + } + case ts2.ModuleKind.ES2022: + case ts2.ModuleKind.ESNext: + case ts2.ModuleKind.System: + if (languageVersion >= 4) { + break; + } + default: + span !== null && span !== void 0 ? span : span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(ts2.createFileDiagnostic(sourceFile, span.start, span.length, ts2.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)); + break; + } + } + } else { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + var diagnostic = ts2.createFileDiagnostic(sourceFile, span.start, span.length, ts2.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); + if (container && container.kind !== 173 && (ts2.getFunctionFlags(container) & 2) === 0) { + var relatedInfo = ts2.createDiagnosticForNode(container, ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async); + ts2.addRelatedInfo(diagnostic, relatedInfo); + } + diagnostics.add(diagnostic); + } + } + } + if (isInParameterInitializerBeforeContainingFunction(node)) { + error2(node, ts2.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); + } + } + function checkAwaitExpression(node) { + addLazyDiagnostic(function() { + return checkAwaitExpressionGrammar(node); + }); + var operandType = checkExpression(node.expression); + var awaitedType = checkAwaitedType( + operandType, + /*withAlias*/ + true, + node, + ts2.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3)) { + addErrorOrSuggestion( + /*isError*/ + false, + ts2.createDiagnosticForNode(node, ts2.Diagnostics.await_has_no_effect_on_the_type_of_this_expression) + ); + } + return awaitedType; + } + function checkPrefixUnaryExpression(node) { + var operandType = checkExpression(node.operand); + if (operandType === silentNeverType) { + return silentNeverType; + } + switch (node.operand.kind) { + case 8: + switch (node.operator) { + case 40: + return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text)); + case 39: + return getFreshTypeOfLiteralType(getNumberLiteralType(+node.operand.text)); + } + break; + case 9: + if (node.operator === 40) { + return getFreshTypeOfLiteralType(getBigIntLiteralType({ + negative: true, + base10Value: ts2.parsePseudoBigInt(node.operand.text) + })); + } + } + switch (node.operator) { + case 39: + case 40: + case 54: + checkNonNullType(operandType, node.operand); + if (maybeTypeOfKindConsideringBaseConstraint( + operandType, + 12288 + /* TypeFlags.ESSymbolLike */ + )) { + error2(node.operand, ts2.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts2.tokenToString(node.operator)); + } + if (node.operator === 39) { + if (maybeTypeOfKindConsideringBaseConstraint( + operandType, + 2112 + /* TypeFlags.BigIntLike */ + )) { + error2(node.operand, ts2.Diagnostics.Operator_0_cannot_be_applied_to_type_1, ts2.tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType))); + } + return numberType2; + } + return getUnaryResultType(operandType); + case 53: + checkTruthinessExpression(node.operand); + var facts = getTypeFacts(operandType) & (4194304 | 8388608); + return facts === 4194304 ? falseType : facts === 8388608 ? trueType : booleanType2; + case 45: + case 46: + var ok2 = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts2.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); + if (ok2) { + checkReferenceExpression(node.operand, ts2.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, ts2.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access); + } + return getUnaryResultType(operandType); + } + return errorType; + } + function checkPostfixUnaryExpression(node) { + var operandType = checkExpression(node.operand); + if (operandType === silentNeverType) { + return silentNeverType; + } + var ok2 = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts2.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); + if (ok2) { + checkReferenceExpression(node.operand, ts2.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, ts2.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access); + } + return getUnaryResultType(operandType); + } + function getUnaryResultType(operandType) { + if (maybeTypeOfKind( + operandType, + 2112 + /* TypeFlags.BigIntLike */ + )) { + return isTypeAssignableToKind( + operandType, + 3 + /* TypeFlags.AnyOrUnknown */ + ) || maybeTypeOfKind( + operandType, + 296 + /* TypeFlags.NumberLike */ + ) ? numberOrBigIntType : bigintType; + } + return numberType2; + } + function maybeTypeOfKindConsideringBaseConstraint(type3, kind) { + if (maybeTypeOfKind(type3, kind)) { + return true; + } + var baseConstraint = getBaseConstraintOrType(type3); + return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind); + } + function maybeTypeOfKind(type3, kind) { + if (type3.flags & kind) { + return true; + } + if (type3.flags & 3145728) { + var types3 = type3.types; + for (var _i = 0, types_20 = types3; _i < types_20.length; _i++) { + var t8 = types_20[_i]; + if (maybeTypeOfKind(t8, kind)) { + return true; + } + } + } + return false; + } + function isTypeAssignableToKind(source, kind, strict2) { + if (source.flags & kind) { + return true; + } + if (strict2 && source.flags & (3 | 16384 | 32768 | 65536)) { + return false; + } + return !!(kind & 296) && isTypeAssignableTo(source, numberType2) || !!(kind & 2112) && isTypeAssignableTo(source, bigintType) || !!(kind & 402653316) && isTypeAssignableTo(source, stringType2) || !!(kind & 528) && isTypeAssignableTo(source, booleanType2) || !!(kind & 16384) && isTypeAssignableTo(source, voidType2) || !!(kind & 131072) && isTypeAssignableTo(source, neverType2) || !!(kind & 65536) && isTypeAssignableTo(source, nullType2) || !!(kind & 32768) && isTypeAssignableTo(source, undefinedType2) || !!(kind & 4096) && isTypeAssignableTo(source, esSymbolType) || !!(kind & 67108864) && isTypeAssignableTo(source, nonPrimitiveType); + } + function allTypesAssignableToKind(source, kind, strict2) { + return source.flags & 1048576 ? ts2.every(source.types, function(subType) { + return allTypesAssignableToKind(subType, kind, strict2); + }) : isTypeAssignableToKind(source, kind, strict2); + } + function isConstEnumObjectType(type3) { + return !!(ts2.getObjectFlags(type3) & 16) && !!type3.symbol && isConstEnumSymbol(type3.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128) !== 0; + } + function checkInstanceOfExpression(left, right, leftType, rightType) { + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (!isTypeAny(leftType) && allTypesAssignableToKind( + leftType, + 131068 + /* TypeFlags.Primitive */ + )) { + error2(left, ts2.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + error2(right, ts2.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); + } + return booleanType2; + } + function hasEmptyObjectIntersection(type3) { + return someType(type3, function(t8) { + return t8 === unknownEmptyObjectType || !!(t8.flags & 2097152) && ts2.some(t8.types, isEmptyAnonymousObjectType); + }); + } + function checkInExpression(left, right, leftType, rightType) { + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (ts2.isPrivateIdentifier(left)) { + if (languageVersion < 99) { + checkExternalEmitHelpers( + left, + 2097152 + /* ExternalEmitHelpers.ClassPrivateFieldIn */ + ); + } + if (!getNodeLinks(left).resolvedSymbol && ts2.getContainingClass(left)) { + var isUncheckedJS = isUncheckedJSSuggestion( + left, + rightType.symbol, + /*excludeClasses*/ + true + ); + reportNonexistentProperty(left, rightType, isUncheckedJS); + } + } else { + checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left); + } + if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) { + if (hasEmptyObjectIntersection(rightType)) { + error2(right, ts2.Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType)); + } + } + return booleanType2; + } + function checkObjectLiteralAssignment(node, sourceType, rightIsThis) { + var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } + for (var i7 = 0; i7 < properties.length; i7++) { + checkObjectLiteralDestructuringPropertyAssignment(node, sourceType, i7, properties, rightIsThis); + } + return sourceType; + } + function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis) { + if (rightIsThis === void 0) { + rightIsThis = false; + } + var properties = node.properties; + var property2 = properties[propertyIndex]; + if (property2.kind === 299 || property2.kind === 300) { + var name2 = property2.name; + var exprType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(exprType)) { + var text = getPropertyNameFromType(exprType); + var prop = getPropertyOfType(objectLiteralType, text); + if (prop) { + markPropertyAsReferenced(prop, property2, rightIsThis); + checkPropertyAccessibility( + property2, + /*isSuper*/ + false, + /*writing*/ + true, + objectLiteralType, + prop + ); + } + } + var elementType = getIndexedAccessType(objectLiteralType, exprType, 32, name2); + var type3 = getFlowTypeOfDestructuring(property2, elementType); + return checkDestructuringAssignment(property2.kind === 300 ? property2 : property2.initializer, type3); + } else if (property2.kind === 301) { + if (propertyIndex < properties.length - 1) { + error2(property2, ts2.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } else { + if (languageVersion < 99) { + checkExternalEmitHelpers( + property2, + 4 + /* ExternalEmitHelpers.Rest */ + ); + } + var nonRestNames = []; + if (allProperties) { + for (var _i = 0, allProperties_1 = allProperties; _i < allProperties_1.length; _i++) { + var otherProperty = allProperties_1[_i]; + if (!ts2.isSpreadAssignment(otherProperty)) { + nonRestNames.push(otherProperty.name); + } + } + } + var type3 = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol); + checkGrammarForDisallowedTrailingComma(allProperties, ts2.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + return checkDestructuringAssignment(property2.expression, type3); + } + } else { + error2(property2, ts2.Diagnostics.Property_assignment_expected); + } + } + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + var elements = node.elements; + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 512 + /* ExternalEmitHelpers.Read */ + ); + } + var possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 | 128, sourceType, undefinedType2, node) || errorType; + var inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; + for (var i7 = 0; i7 < elements.length; i7++) { + var type3 = possiblyOutOfBoundsType; + if (node.elements[i7].kind === 227) { + type3 = inBoundsType = inBoundsType !== null && inBoundsType !== void 0 ? inBoundsType : checkIteratedTypeOrElementType(65, sourceType, undefinedType2, node) || errorType; + } + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i7, type3, checkMode); + } + return sourceType; + } + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { + var elements = node.elements; + var element = elements[elementIndex]; + if (element.kind !== 229) { + if (element.kind !== 227) { + var indexType = getNumberLiteralType(elementIndex); + if (isArrayLikeType(sourceType)) { + var accessFlags = 32 | (hasDefaultValue(element) ? 16 : 0); + var elementType_2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, accessFlags, createSyntheticExpression(element, indexType)) || errorType; + var assignedType = hasDefaultValue(element) ? getTypeWithFacts( + elementType_2, + 524288 + /* TypeFacts.NEUndefined */ + ) : elementType_2; + var type3 = getFlowTypeOfDestructuring(element, assignedType); + return checkDestructuringAssignment(element, type3, checkMode); + } + return checkDestructuringAssignment(element, elementType, checkMode); + } + if (elementIndex < elements.length - 1) { + error2(element, ts2.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } else { + var restExpression = element.expression; + if (restExpression.kind === 223 && restExpression.operatorToken.kind === 63) { + error2(restExpression.operatorToken, ts2.Diagnostics.A_rest_element_cannot_have_an_initializer); + } else { + checkGrammarForDisallowedTrailingComma(node.elements, ts2.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + var type3 = everyType(sourceType, isTupleType) ? mapType2(sourceType, function(t8) { + return sliceTupleType(t8, elementIndex); + }) : createArrayType(elementType); + return checkDestructuringAssignment(restExpression, type3, checkMode); + } + } + } + return void 0; + } + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { + var target; + if (exprOrAssignment.kind === 300) { + var prop = exprOrAssignment; + if (prop.objectAssignmentInitializer) { + if (strictNullChecks && !(getTypeFacts(checkExpression(prop.objectAssignmentInitializer)) & 16777216)) { + sourceType = getTypeWithFacts( + sourceType, + 524288 + /* TypeFacts.NEUndefined */ + ); + } + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); + } + target = exprOrAssignment.name; + } else { + target = exprOrAssignment; + } + if (target.kind === 223 && target.operatorToken.kind === 63) { + checkBinaryExpression(target, checkMode); + target = target.left; + if (strictNullChecks) { + sourceType = getTypeWithFacts( + sourceType, + 524288 + /* TypeFacts.NEUndefined */ + ); + } + } + if (target.kind === 207) { + return checkObjectLiteralAssignment(target, sourceType, rightIsThis); + } + if (target.kind === 206) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); + } + return checkReferenceAssignment(target, sourceType, checkMode); + } + function checkReferenceAssignment(target, sourceType, checkMode) { + var targetType = checkExpression(target, checkMode); + var error3 = target.parent.kind === 301 ? ts2.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts2.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; + var optionalError = target.parent.kind === 301 ? ts2.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : ts2.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; + if (checkReferenceExpression(target, error3, optionalError)) { + checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); + } + if (ts2.isPrivateIdentifierPropertyAccessExpression(target)) { + checkExternalEmitHelpers( + target.parent, + 1048576 + /* ExternalEmitHelpers.ClassPrivateFieldSet */ + ); + } + return sourceType; + } + function isSideEffectFree(node) { + node = ts2.skipParentheses(node); + switch (node.kind) { + case 79: + case 10: + case 13: + case 212: + case 225: + case 14: + case 8: + case 9: + case 110: + case 95: + case 104: + case 155: + case 215: + case 228: + case 216: + case 206: + case 207: + case 218: + case 232: + case 282: + case 281: + return true; + case 224: + return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); + case 223: + if (ts2.isAssignmentOperator(node.operatorToken.kind)) { + return false; + } + return isSideEffectFree(node.left) && isSideEffectFree(node.right); + case 221: + case 222: + switch (node.operator) { + case 53: + case 39: + case 40: + case 54: + return true; + } + return false; + case 219: + case 213: + case 231: + default: + return false; + } + } + function isTypeEqualityComparableTo(source, target) { + return (target.flags & 98304) !== 0 || isTypeComparableTo(source, target); + } + function createCheckBinaryExpression() { + var trampoline = ts2.createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState); + return function(node, checkMode) { + var result2 = trampoline(node, checkMode); + ts2.Debug.assertIsDefined(result2); + return result2; + }; + function onEnter(node, state, checkMode) { + if (state) { + state.stackIndex++; + state.skip = false; + setLeftType( + state, + /*type*/ + void 0 + ); + setLastResult( + state, + /*type*/ + void 0 + ); + } else { + state = { + checkMode, + skip: false, + stackIndex: 0, + typeStack: [void 0, void 0] + }; + } + if (ts2.isInJSFile(node) && ts2.getAssignedExpandoInitializer(node)) { + state.skip = true; + setLastResult(state, checkExpression(node.right, checkMode)); + return state; + } + checkGrammarNullishCoalesceWithLogicalExpression(node); + var operator = node.operatorToken.kind; + if (operator === 63 && (node.left.kind === 207 || node.left.kind === 206)) { + state.skip = true; + setLastResult(state, checkDestructuringAssignment( + node.left, + checkExpression(node.right, checkMode), + checkMode, + node.right.kind === 108 + /* SyntaxKind.ThisKeyword */ + )); + return state; + } + return state; + } + function onLeft(left, state, _node) { + if (!state.skip) { + return maybeCheckExpression(state, left); + } + } + function onOperator(operatorToken, state, node) { + if (!state.skip) { + var leftType = getLastResult(state); + ts2.Debug.assertIsDefined(leftType); + setLeftType(state, leftType); + setLastResult( + state, + /*type*/ + void 0 + ); + var operator = operatorToken.kind; + if (operator === 55 || operator === 56 || operator === 60) { + if (operator === 55) { + var parent2 = node.parent; + while (parent2.kind === 214 || ts2.isBinaryExpression(parent2) && (parent2.operatorToken.kind === 55 || parent2.operatorToken.kind === 56)) { + parent2 = parent2.parent; + } + checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, ts2.isIfStatement(parent2) ? parent2.thenStatement : void 0); + } + checkTruthinessOfType(leftType, node.left); + } + } + } + function onRight(right, state, _node) { + if (!state.skip) { + return maybeCheckExpression(state, right); + } + } + function onExit(node, state) { + var result2; + if (state.skip) { + result2 = getLastResult(state); + } else { + var leftType = getLeftType(state); + ts2.Debug.assertIsDefined(leftType); + var rightType = getLastResult(state); + ts2.Debug.assertIsDefined(rightType); + result2 = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node); + } + state.skip = false; + setLeftType( + state, + /*type*/ + void 0 + ); + setLastResult( + state, + /*type*/ + void 0 + ); + state.stackIndex--; + return result2; + } + function foldState(state, result2, _side) { + setLastResult(state, result2); + return state; + } + function maybeCheckExpression(state, node) { + if (ts2.isBinaryExpression(node)) { + return node; + } + setLastResult(state, checkExpression(node, state.checkMode)); + } + function getLeftType(state) { + return state.typeStack[state.stackIndex]; + } + function setLeftType(state, type3) { + state.typeStack[state.stackIndex] = type3; + } + function getLastResult(state) { + return state.typeStack[state.stackIndex + 1]; + } + function setLastResult(state, type3) { + state.typeStack[state.stackIndex + 1] = type3; + } + } + function checkGrammarNullishCoalesceWithLogicalExpression(node) { + var left = node.left, operatorToken = node.operatorToken, right = node.right; + if (operatorToken.kind === 60) { + if (ts2.isBinaryExpression(left) && (left.operatorToken.kind === 56 || left.operatorToken.kind === 55)) { + grammarErrorOnNode(left, ts2.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, ts2.tokenToString(left.operatorToken.kind), ts2.tokenToString(operatorToken.kind)); + } + if (ts2.isBinaryExpression(right) && (right.operatorToken.kind === 56 || right.operatorToken.kind === 55)) { + grammarErrorOnNode(right, ts2.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, ts2.tokenToString(right.operatorToken.kind), ts2.tokenToString(operatorToken.kind)); + } + } + } + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { + var operator = operatorToken.kind; + if (operator === 63 && (left.kind === 207 || left.kind === 206)) { + return checkDestructuringAssignment( + left, + checkExpression(right, checkMode), + checkMode, + right.kind === 108 + /* SyntaxKind.ThisKeyword */ + ); + } + var leftType; + if (operator === 55 || operator === 56 || operator === 60) { + leftType = checkTruthinessExpression(left, checkMode); + } else { + leftType = checkExpression(left, checkMode); + } + var rightType = checkExpression(right, checkMode); + return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode); + } + function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) { + var operator = operatorToken.kind; + switch (operator) { + case 41: + case 42: + case 66: + case 67: + case 43: + case 68: + case 44: + case 69: + case 40: + case 65: + case 47: + case 70: + case 48: + case 71: + case 49: + case 72: + case 51: + case 74: + case 52: + case 78: + case 50: + case 73: + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + var suggestedOperator = void 0; + if (leftType.flags & 528 && rightType.flags & 528 && (suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== void 0) { + error2(errorNode || operatorToken, ts2.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts2.tokenToString(operatorToken.kind), ts2.tokenToString(suggestedOperator)); + return numberType2; + } else { + var leftOk = checkArithmeticOperandType( + left, + leftType, + ts2.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, + /*isAwaitValid*/ + true + ); + var rightOk = checkArithmeticOperandType( + right, + rightType, + ts2.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, + /*isAwaitValid*/ + true + ); + var resultType_1; + if (isTypeAssignableToKind( + leftType, + 3 + /* TypeFlags.AnyOrUnknown */ + ) && isTypeAssignableToKind( + rightType, + 3 + /* TypeFlags.AnyOrUnknown */ + ) || // Or, if neither could be bigint, implicit coercion results in a number result + !(maybeTypeOfKind( + leftType, + 2112 + /* TypeFlags.BigIntLike */ + ) || maybeTypeOfKind( + rightType, + 2112 + /* TypeFlags.BigIntLike */ + ))) { + resultType_1 = numberType2; + } else if (bothAreBigIntLike(leftType, rightType)) { + switch (operator) { + case 49: + case 72: + reportOperatorError(); + break; + case 42: + case 67: + if (languageVersion < 3) { + error2(errorNode, ts2.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later); + } + } + resultType_1 = bigintType; + } else { + reportOperatorError(bothAreBigIntLike); + resultType_1 = errorType; + } + if (leftOk && rightOk) { + checkAssignmentOperator(resultType_1); + } + return resultType_1; + } + case 39: + case 64: + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (!isTypeAssignableToKind( + leftType, + 402653316 + /* TypeFlags.StringLike */ + ) && !isTypeAssignableToKind( + rightType, + 402653316 + /* TypeFlags.StringLike */ + )) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } + var resultType = void 0; + if (isTypeAssignableToKind( + leftType, + 296, + /*strict*/ + true + ) && isTypeAssignableToKind( + rightType, + 296, + /*strict*/ + true + )) { + resultType = numberType2; + } else if (isTypeAssignableToKind( + leftType, + 2112, + /*strict*/ + true + ) && isTypeAssignableToKind( + rightType, + 2112, + /*strict*/ + true + )) { + resultType = bigintType; + } else if (isTypeAssignableToKind( + leftType, + 402653316, + /*strict*/ + true + ) || isTypeAssignableToKind( + rightType, + 402653316, + /*strict*/ + true + )) { + resultType = stringType2; + } else if (isTypeAny(leftType) || isTypeAny(rightType)) { + resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType2; + } + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; + } + if (!resultType) { + var closeEnoughKind_1 = 296 | 2112 | 402653316 | 3; + reportOperatorError(function(left2, right2) { + return isTypeAssignableToKind(left2, closeEnoughKind_1) && isTypeAssignableToKind(right2, closeEnoughKind_1); + }); + return anyType2; + } + if (operator === 64) { + checkAssignmentOperator(resultType); + } + return resultType; + case 29: + case 31: + case 32: + case 33: + if (checkForDisallowedESSymbolOperand(operator)) { + leftType = getBaseTypeOfLiteralType(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralType(checkNonNullType(rightType, right)); + reportOperatorErrorUnless(function(left2, right2) { + return isTypeComparableTo(left2, right2) || isTypeComparableTo(right2, left2) || isTypeAssignableTo(left2, numberOrBigIntType) && isTypeAssignableTo(right2, numberOrBigIntType); + }); + } + return booleanType2; + case 34: + case 35: + case 36: + case 37: + if (ts2.isLiteralExpressionOfObject(left) || ts2.isLiteralExpressionOfObject(right)) { + var eqType = operator === 34 || operator === 36; + error2(errorNode, ts2.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true"); + } + checkNaNEquality(errorNode, operator, left, right); + reportOperatorErrorUnless(function(left2, right2) { + return isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2); + }); + return booleanType2; + case 102: + return checkInstanceOfExpression(left, right, leftType, rightType); + case 101: + return checkInExpression(left, right, leftType, rightType); + case 55: + case 76: { + var resultType_2 = getTypeFacts(leftType) & 4194304 ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType; + if (operator === 76) { + checkAssignmentOperator(rightType); + } + return resultType_2; + } + case 56: + case 75: { + var resultType_3 = getTypeFacts(leftType) & 8388608 ? getUnionType( + [getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], + 2 + /* UnionReduction.Subtype */ + ) : leftType; + if (operator === 75) { + checkAssignmentOperator(rightType); + } + return resultType_3; + } + case 60: + case 77: { + var resultType_4 = getTypeFacts(leftType) & 262144 ? getUnionType( + [getNonNullableType(leftType), rightType], + 2 + /* UnionReduction.Subtype */ + ) : leftType; + if (operator === 77) { + checkAssignmentOperator(rightType); + } + return resultType_4; + } + case 63: + var declKind = ts2.isBinaryExpression(left.parent) ? ts2.getAssignmentDeclarationKind(left.parent) : 0; + checkAssignmentDeclaration(declKind, rightType); + if (isAssignmentDeclaration(declKind)) { + if (!(rightType.flags & 524288) || declKind !== 2 && declKind !== 6 && !isEmptyObjectType(rightType) && !isFunctionObjectType(rightType) && !(ts2.getObjectFlags(rightType) & 1)) { + checkAssignmentOperator(rightType); + } + return leftType; + } else { + checkAssignmentOperator(rightType); + return getRegularTypeOfObjectLiteral(rightType); + } + case 27: + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isEvalNode(right)) { + var sf = ts2.getSourceFileOfNode(left); + var sourceText = sf.text; + var start_3 = ts2.skipTrivia(sourceText, left.pos); + var isInDiag2657 = sf.parseDiagnostics.some(function(diag) { + if (diag.code !== ts2.Diagnostics.JSX_expressions_must_have_one_parent_element.code) + return false; + return ts2.textSpanContainsPosition(diag, start_3); + }); + if (!isInDiag2657) + error2(left, ts2.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); + } + return rightType; + default: + return ts2.Debug.fail(); + } + function bothAreBigIntLike(left2, right2) { + return isTypeAssignableToKind( + left2, + 2112 + /* TypeFlags.BigIntLike */ + ) && isTypeAssignableToKind( + right2, + 2112 + /* TypeFlags.BigIntLike */ + ); + } + function checkAssignmentDeclaration(kind, rightType2) { + if (kind === 2) { + for (var _i = 0, _a2 = getPropertiesOfObjectType(rightType2); _i < _a2.length; _i++) { + var prop = _a2[_i]; + var propType = getTypeOfSymbol(prop); + if (propType.symbol && propType.symbol.flags & 32) { + var name2 = prop.escapedName; + var symbol = resolveName( + prop.valueDeclaration, + name2, + 788968, + void 0, + name2, + /*isUse*/ + false + ); + if ((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) && symbol.declarations.some(ts2.isJSDocTypedefTag)) { + addDuplicateDeclarationErrorsForSymbols(symbol, ts2.Diagnostics.Duplicate_identifier_0, ts2.unescapeLeadingUnderscores(name2), prop); + addDuplicateDeclarationErrorsForSymbols(prop, ts2.Diagnostics.Duplicate_identifier_0, ts2.unescapeLeadingUnderscores(name2), symbol); + } + } + } + } + } + function isEvalNode(node) { + return node.kind === 79 && node.escapedText === "eval"; + } + function checkForDisallowedESSymbolOperand(operator2) { + var offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint( + leftType, + 12288 + /* TypeFlags.ESSymbolLike */ + ) ? left : maybeTypeOfKindConsideringBaseConstraint( + rightType, + 12288 + /* TypeFlags.ESSymbolLike */ + ) ? right : void 0; + if (offendingSymbolOperand) { + error2(offendingSymbolOperand, ts2.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts2.tokenToString(operator2)); + return false; + } + return true; + } + function getSuggestedBooleanOperator(operator2) { + switch (operator2) { + case 51: + case 74: + return 56; + case 52: + case 78: + return 37; + case 50: + case 73: + return 55; + default: + return void 0; + } + } + function checkAssignmentOperator(valueType) { + if (ts2.isAssignmentOperator(operator)) { + addLazyDiagnostic(checkAssignmentOperatorWorker); + } + function checkAssignmentOperatorWorker() { + if (checkReferenceExpression(left, ts2.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, ts2.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access) && (!ts2.isIdentifier(left) || ts2.unescapeLeadingUnderscores(left.escapedText) !== "exports")) { + var headMessage = void 0; + if (exactOptionalPropertyTypes && ts2.isPropertyAccessExpression(left) && maybeTypeOfKind( + valueType, + 32768 + /* TypeFlags.Undefined */ + )) { + var target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); + if (isExactOptionalPropertyMismatch(valueType, target)) { + headMessage = ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target; + } + } + checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right, headMessage); + } + } + } + function isAssignmentDeclaration(kind) { + var _a2; + switch (kind) { + case 2: + return true; + case 1: + case 5: + case 6: + case 3: + case 4: + var symbol = getSymbolOfNode(left); + var init2 = ts2.getAssignedExpandoInitializer(right); + return !!init2 && ts2.isObjectLiteralExpression(init2) && !!((_a2 = symbol === null || symbol === void 0 ? void 0 : symbol.exports) === null || _a2 === void 0 ? void 0 : _a2.size); + default: + return false; + } + } + function reportOperatorErrorUnless(typesAreCompatible) { + if (!typesAreCompatible(leftType, rightType)) { + reportOperatorError(typesAreCompatible); + return true; + } + return false; + } + function reportOperatorError(isRelated) { + var _a2; + var wouldWorkWithAwait = false; + var errNode = errorNode || operatorToken; + if (isRelated) { + var awaitedLeftType = getAwaitedTypeNoAlias(leftType); + var awaitedRightType = getAwaitedTypeNoAlias(rightType); + wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType) && !!(awaitedLeftType && awaitedRightType) && isRelated(awaitedLeftType, awaitedRightType); + } + var effectiveLeft = leftType; + var effectiveRight = rightType; + if (!wouldWorkWithAwait && isRelated) { + _a2 = getBaseTypesIfUnrelated(leftType, rightType, isRelated), effectiveLeft = _a2[0], effectiveRight = _a2[1]; + } + var _b = getTypeNamesForErrorDisplay(effectiveLeft, effectiveRight), leftStr = _b[0], rightStr = _b[1]; + if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) { + errorAndMaybeSuggestAwait(errNode, wouldWorkWithAwait, ts2.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts2.tokenToString(operatorToken.kind), leftStr, rightStr); + } + } + function tryGiveBetterPrimaryError(errNode, maybeMissingAwait, leftStr, rightStr) { + switch (operatorToken.kind) { + case 36: + case 34: + case 37: + case 35: + return errorAndMaybeSuggestAwait(errNode, maybeMissingAwait, ts2.Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap, leftStr, rightStr); + default: + return void 0; + } + } + function checkNaNEquality(errorNode2, operator2, left2, right2) { + var isLeftNaN = isGlobalNaN(ts2.skipParentheses(left2)); + var isRightNaN = isGlobalNaN(ts2.skipParentheses(right2)); + if (isLeftNaN || isRightNaN) { + var err = error2(errorNode2, ts2.Diagnostics.This_condition_will_always_return_0, ts2.tokenToString( + operator2 === 36 || operator2 === 34 ? 95 : 110 + /* SyntaxKind.TrueKeyword */ + )); + if (isLeftNaN && isRightNaN) + return; + var operatorString = operator2 === 37 || operator2 === 35 ? ts2.tokenToString( + 53 + /* SyntaxKind.ExclamationToken */ + ) : ""; + var location2 = isLeftNaN ? right2 : left2; + var expression = ts2.skipParentheses(location2); + ts2.addRelatedInfo(err, ts2.createDiagnosticForNode(location2, ts2.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts2.isEntityNameExpression(expression) ? ts2.entityNameToString(expression) : "...", ")"))); + } + } + function isGlobalNaN(expr) { + if (ts2.isIdentifier(expr) && expr.escapedText === "NaN") { + var globalNaNSymbol = getGlobalNaNSymbol(); + return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr); + } + return false; + } + } + function getBaseTypesIfUnrelated(leftType, rightType, isRelated) { + var effectiveLeft = leftType; + var effectiveRight = rightType; + var leftBase = getBaseTypeOfLiteralType(leftType); + var rightBase = getBaseTypeOfLiteralType(rightType); + if (!isRelated(leftBase, rightBase)) { + effectiveLeft = leftBase; + effectiveRight = rightBase; + } + return [effectiveLeft, effectiveRight]; + } + function checkYieldExpression(node) { + addLazyDiagnostic(checkYieldExpressionGrammar); + var func = ts2.getContainingFunction(node); + if (!func) + return anyType2; + var functionFlags = ts2.getFunctionFlags(func); + if (!(functionFlags & 1)) { + return anyType2; + } + var isAsync2 = (functionFlags & 2) !== 0; + if (node.asteriskToken) { + if (isAsync2 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 26624 + /* ExternalEmitHelpers.AsyncDelegatorIncludes */ + ); + } + if (!isAsync2 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 256 + /* ExternalEmitHelpers.Values */ + ); + } + } + var returnType = getReturnTypeFromAnnotation(func); + var iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync2); + var signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType2; + var signatureNextType = iterationTypes && iterationTypes.nextType || anyType2; + var resolvedSignatureNextType = isAsync2 ? getAwaitedType(signatureNextType) || anyType2 : signatureNextType; + var yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType; + var yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, resolvedSignatureNextType, isAsync2); + if (returnType && yieldedType) { + checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression); + } + if (node.asteriskToken) { + var use = isAsync2 ? 19 : 17; + return getIterationTypeOfIterable(use, 1, yieldExpressionType, node.expression) || anyType2; + } else if (returnType) { + return getIterationTypeOfGeneratorFunctionReturnType(2, returnType, isAsync2) || anyType2; + } + var type3 = getContextualIterationType(2, func); + if (!type3) { + type3 = anyType2; + addLazyDiagnostic(function() { + if (noImplicitAny && !ts2.expressionResultIsUnused(node)) { + var contextualType = getContextualType( + node, + /*contextFlags*/ + void 0 + ); + if (!contextualType || isTypeAny(contextualType)) { + error2(node, ts2.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation); + } + } + }); + } + return type3; + function checkYieldExpressionGrammar() { + if (!(node.flags & 8192)) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); + } + if (isInParameterInitializerBeforeContainingFunction(node)) { + error2(node, ts2.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); + } + } + } + function checkConditionalExpression(node, checkMode) { + var type3 = checkTruthinessExpression(node.condition); + checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type3, node.whenTrue); + var type1 = checkExpression(node.whenTrue, checkMode); + var type22 = checkExpression(node.whenFalse, checkMode); + return getUnionType( + [type1, type22], + 2 + /* UnionReduction.Subtype */ + ); + } + function isTemplateLiteralContext(node) { + var parent2 = node.parent; + return ts2.isParenthesizedExpression(parent2) && isTemplateLiteralContext(parent2) || ts2.isElementAccessExpression(parent2) && parent2.argumentExpression === node; + } + function checkTemplateExpression(node) { + var texts = [node.head.text]; + var types3 = []; + for (var _i = 0, _a2 = node.templateSpans; _i < _a2.length; _i++) { + var span = _a2[_i]; + var type3 = checkExpression(span.expression); + if (maybeTypeOfKindConsideringBaseConstraint( + type3, + 12288 + /* TypeFlags.ESSymbolLike */ + )) { + error2(span.expression, ts2.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + } + texts.push(span.literal.text); + types3.push(isTypeAssignableTo(type3, templateConstraintType) ? type3 : stringType2); + } + return isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType( + node, + /*contextFlags*/ + void 0 + ) || unknownType2, isTemplateLiteralContextualType) ? getTemplateLiteralType(texts, types3) : stringType2; + } + function isTemplateLiteralContextualType(type3) { + return !!(type3.flags & (128 | 134217728) || type3.flags & 58982400 && maybeTypeOfKind( + getBaseConstraintOfType(type3) || unknownType2, + 402653316 + /* TypeFlags.StringLike */ + )); + } + function getContextNode(node) { + if (node.kind === 289 && !ts2.isJsxSelfClosingElement(node.parent)) { + return node.parent.parent; + } + return node; + } + function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { + var context2 = getContextNode(node); + var saveContextualType = context2.contextualType; + var saveInferenceContext = context2.inferenceContext; + try { + context2.contextualType = contextualType; + context2.inferenceContext = inferenceContext; + var type3 = checkExpression(node, checkMode | 1 | (inferenceContext ? 2 : 0)); + if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { + inferenceContext.intraExpressionInferenceSites = void 0; + } + var result2 = maybeTypeOfKind( + type3, + 2944 + /* TypeFlags.Literal */ + ) && isLiteralOfContextualType(type3, instantiateContextualType( + contextualType, + node, + /*contextFlags*/ + void 0 + )) ? getRegularTypeOfLiteralType(type3) : type3; + return result2; + } finally { + context2.contextualType = saveContextualType; + context2.inferenceContext = saveInferenceContext; + } + } + function checkExpressionCached(node, checkMode) { + if (checkMode && checkMode !== 0) { + return checkExpression(node, checkMode); + } + var links = getNodeLinks(node); + if (!links.resolvedType) { + var saveFlowLoopStart = flowLoopStart; + var saveFlowTypeCache = flowTypeCache; + flowLoopStart = flowLoopCount; + flowTypeCache = void 0; + links.resolvedType = checkExpression(node, checkMode); + flowTypeCache = saveFlowTypeCache; + flowLoopStart = saveFlowLoopStart; + } + return links.resolvedType; + } + function isTypeAssertion(node) { + node = ts2.skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return node.kind === 213 || node.kind === 231 || ts2.isJSDocTypeAssertion(node); + } + function checkDeclarationInitializer(declaration, checkMode, contextualType) { + var initializer = ts2.getEffectiveInitializer(declaration); + var type3 = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( + initializer, + contextualType, + /*inferenceContext*/ + void 0, + checkMode || 0 + /* CheckMode.Normal */ + ) : checkExpressionCached(initializer, checkMode)); + return ts2.isParameter(declaration) && declaration.name.kind === 204 && isTupleType(type3) && !type3.target.hasRestElement && getTypeReferenceArity(type3) < declaration.name.elements.length ? padTupleType(type3, declaration.name) : type3; + } + function padTupleType(type3, pattern5) { + var patternElements = pattern5.elements; + var elementTypes = getTypeArguments(type3).slice(); + var elementFlags = type3.target.elementFlags.slice(); + for (var i7 = getTypeReferenceArity(type3); i7 < patternElements.length; i7++) { + var e10 = patternElements[i7]; + if (i7 < patternElements.length - 1 || !(e10.kind === 205 && e10.dotDotDotToken)) { + elementTypes.push(!ts2.isOmittedExpression(e10) && hasDefaultValue(e10) ? getTypeFromBindingElement( + e10, + /*includePatternInType*/ + false, + /*reportErrors*/ + false + ) : anyType2); + elementFlags.push( + 2 + /* ElementFlags.Optional */ + ); + if (!ts2.isOmittedExpression(e10) && !hasDefaultValue(e10)) { + reportImplicitAny(e10, anyType2); + } + } + } + return createTupleType(elementTypes, elementFlags, type3.target.readonly); + } + function widenTypeInferredFromInitializer(declaration, type3) { + var widened = ts2.getCombinedNodeFlags(declaration) & 2 || ts2.isDeclarationReadonly(declaration) ? type3 : getWidenedLiteralType(type3); + if (ts2.isInJSFile(declaration)) { + if (isEmptyLiteralType(widened)) { + reportImplicitAny(declaration, anyType2); + return anyType2; + } else if (isEmptyArrayLiteralType(widened)) { + reportImplicitAny(declaration, anyArrayType); + return anyArrayType; + } + } + return widened; + } + function isLiteralOfContextualType(candidateType, contextualType) { + if (contextualType) { + if (contextualType.flags & 3145728) { + var types3 = contextualType.types; + return ts2.some(types3, function(t8) { + return isLiteralOfContextualType(candidateType, t8); + }); + } + if (contextualType.flags & 58982400) { + var constraint = getBaseConstraintOfType(contextualType) || unknownType2; + return maybeTypeOfKind( + constraint, + 4 + /* TypeFlags.String */ + ) && maybeTypeOfKind( + candidateType, + 128 + /* TypeFlags.StringLiteral */ + ) || maybeTypeOfKind( + constraint, + 8 + /* TypeFlags.Number */ + ) && maybeTypeOfKind( + candidateType, + 256 + /* TypeFlags.NumberLiteral */ + ) || maybeTypeOfKind( + constraint, + 64 + /* TypeFlags.BigInt */ + ) && maybeTypeOfKind( + candidateType, + 2048 + /* TypeFlags.BigIntLiteral */ + ) || maybeTypeOfKind( + constraint, + 4096 + /* TypeFlags.ESSymbol */ + ) && maybeTypeOfKind( + candidateType, + 8192 + /* TypeFlags.UniqueESSymbol */ + ) || isLiteralOfContextualType(candidateType, constraint); + } + return !!(contextualType.flags & (128 | 4194304 | 134217728 | 268435456) && maybeTypeOfKind( + candidateType, + 128 + /* TypeFlags.StringLiteral */ + ) || contextualType.flags & 256 && maybeTypeOfKind( + candidateType, + 256 + /* TypeFlags.NumberLiteral */ + ) || contextualType.flags & 2048 && maybeTypeOfKind( + candidateType, + 2048 + /* TypeFlags.BigIntLiteral */ + ) || contextualType.flags & 512 && maybeTypeOfKind( + candidateType, + 512 + /* TypeFlags.BooleanLiteral */ + ) || contextualType.flags & 8192 && maybeTypeOfKind( + candidateType, + 8192 + /* TypeFlags.UniqueESSymbol */ + )); + } + return false; + } + function isConstContext(node) { + var parent2 = node.parent; + return ts2.isAssertionExpression(parent2) && ts2.isConstTypeReference(parent2.type) || ts2.isJSDocTypeAssertion(parent2) && ts2.isConstTypeReference(ts2.getJSDocTypeAssertionType(parent2)) || (ts2.isParenthesizedExpression(parent2) || ts2.isArrayLiteralExpression(parent2) || ts2.isSpreadElement(parent2)) && isConstContext(parent2) || (ts2.isPropertyAssignment(parent2) || ts2.isShorthandPropertyAssignment(parent2) || ts2.isTemplateSpan(parent2)) && isConstContext(parent2.parent); + } + function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) { + var type3 = checkExpression(node, checkMode, forceTuple); + return isConstContext(node) || ts2.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type3) : isTypeAssertion(node) ? type3 : getWidenedLiteralLikeTypeForContextualType(type3, instantiateContextualType( + arguments.length === 2 ? getContextualType( + node, + /*contextFlags*/ + void 0 + ) : contextualType, + node, + /*contextFlags*/ + void 0 + )); + } + function checkPropertyAssignment(node, checkMode) { + if (node.name.kind === 164) { + checkComputedPropertyName(node.name); + } + return checkExpressionForMutableLocation(node.initializer, checkMode); + } + function checkObjectLiteralMethod(node, checkMode) { + checkGrammarMethod(node); + if (node.name.kind === 164) { + checkComputedPropertyName(node.name); + } + var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); + } + function instantiateTypeWithSingleGenericCallSignature(node, type3, checkMode) { + if (checkMode && checkMode & (2 | 8)) { + var callSignature = getSingleSignature( + type3, + 0, + /*allowMembers*/ + true + ); + var constructSignature = getSingleSignature( + type3, + 1, + /*allowMembers*/ + true + ); + var signature = callSignature || constructSignature; + if (signature && signature.typeParameters) { + var contextualType = getApparentTypeOfContextualType( + node, + 2 + /* ContextFlags.NoConstraints */ + ); + if (contextualType) { + var contextualSignature = getSingleSignature( + getNonNullableType(contextualType), + callSignature ? 0 : 1, + /*allowMembers*/ + false + ); + if (contextualSignature && !contextualSignature.typeParameters) { + if (checkMode & 8) { + skippedGenericFunction(node, checkMode); + return anyFunctionType; + } + var context2 = getInferenceContext(node); + var returnType = context2.signature && getReturnTypeOfSignature(context2.signature); + var returnSignature = returnType && getSingleCallOrConstructSignature(returnType); + if (returnSignature && !returnSignature.typeParameters && !ts2.every(context2.inferences, hasInferenceCandidates)) { + var uniqueTypeParameters = getUniqueTypeParameters(context2, signature.typeParameters); + var instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters); + var inferences_3 = ts2.map(context2.inferences, function(info2) { + return createInferenceInfo(info2.typeParameter); + }); + applyToParameterTypes(instantiatedSignature, contextualSignature, function(source, target) { + inferTypes( + inferences_3, + source, + target, + /*priority*/ + 0, + /*contravariant*/ + true + ); + }); + if (ts2.some(inferences_3, hasInferenceCandidates)) { + applyToReturnTypes(instantiatedSignature, contextualSignature, function(source, target) { + inferTypes(inferences_3, source, target); + }); + if (!hasOverlappingInferences(context2.inferences, inferences_3)) { + mergeInferences(context2.inferences, inferences_3); + context2.inferredTypeParameters = ts2.concatenate(context2.inferredTypeParameters, uniqueTypeParameters); + return getOrCreateTypeFromSignature(instantiatedSignature); + } + } + } + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context2)); + } + } + } + } + return type3; + } + function skippedGenericFunction(node, checkMode) { + if (checkMode & 2) { + var context2 = getInferenceContext(node); + context2.flags |= 4; + } + } + function hasInferenceCandidates(info2) { + return !!(info2.candidates || info2.contraCandidates); + } + function hasInferenceCandidatesOrDefault(info2) { + return !!(info2.candidates || info2.contraCandidates || hasTypeParameterDefault(info2.typeParameter)); + } + function hasOverlappingInferences(a7, b8) { + for (var i7 = 0; i7 < a7.length; i7++) { + if (hasInferenceCandidates(a7[i7]) && hasInferenceCandidates(b8[i7])) { + return true; + } + } + return false; + } + function mergeInferences(target, source) { + for (var i7 = 0; i7 < target.length; i7++) { + if (!hasInferenceCandidates(target[i7]) && hasInferenceCandidates(source[i7])) { + target[i7] = source[i7]; + } + } + } + function getUniqueTypeParameters(context2, typeParameters) { + var result2 = []; + var oldTypeParameters; + var newTypeParameters; + for (var _i = 0, typeParameters_3 = typeParameters; _i < typeParameters_3.length; _i++) { + var tp = typeParameters_3[_i]; + var name2 = tp.symbol.escapedName; + if (hasTypeParameterByName(context2.inferredTypeParameters, name2) || hasTypeParameterByName(result2, name2)) { + var newName = getUniqueTypeParameterName(ts2.concatenate(context2.inferredTypeParameters, result2), name2); + var symbol = createSymbol(262144, newName); + var newTypeParameter = createTypeParameter(symbol); + newTypeParameter.target = tp; + oldTypeParameters = ts2.append(oldTypeParameters, tp); + newTypeParameters = ts2.append(newTypeParameters, newTypeParameter); + result2.push(newTypeParameter); + } else { + result2.push(tp); + } + } + if (newTypeParameters) { + var mapper = createTypeMapper(oldTypeParameters, newTypeParameters); + for (var _a2 = 0, newTypeParameters_1 = newTypeParameters; _a2 < newTypeParameters_1.length; _a2++) { + var tp = newTypeParameters_1[_a2]; + tp.mapper = mapper; + } + } + return result2; + } + function hasTypeParameterByName(typeParameters, name2) { + return ts2.some(typeParameters, function(tp) { + return tp.symbol.escapedName === name2; + }); + } + function getUniqueTypeParameterName(typeParameters, baseName) { + var len = baseName.length; + while (len > 1 && baseName.charCodeAt(len - 1) >= 48 && baseName.charCodeAt(len - 1) <= 57) + len--; + var s7 = baseName.slice(0, len); + for (var index4 = 1; true; index4++) { + var augmentedName = s7 + index4; + if (!hasTypeParameterByName(typeParameters, augmentedName)) { + return augmentedName; + } + } + } + function getReturnTypeOfSingleNonGenericCallSignature(funcType) { + var signature = getSingleCallSignature(funcType); + if (signature && !signature.typeParameters) { + return getReturnTypeOfSignature(signature); + } + } + function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) { + var funcType = checkExpression(expr.expression); + var nonOptionalType = getOptionalExpressionType(funcType, expr.expression); + var returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType); + return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType); + } + function getTypeOfExpression(node) { + var quickType = getQuickTypeOfExpression(node); + if (quickType) { + return quickType; + } + if (node.flags & 134217728 && flowTypeCache) { + var cachedType = flowTypeCache[getNodeId(node)]; + if (cachedType) { + return cachedType; + } + } + var startInvocationCount = flowInvocationCount; + var type3 = checkExpression(node); + if (flowInvocationCount !== startInvocationCount) { + var cache = flowTypeCache || (flowTypeCache = []); + cache[getNodeId(node)] = type3; + ts2.setNodeFlags( + node, + node.flags | 134217728 + /* NodeFlags.TypeCached */ + ); + } + return type3; + } + function getQuickTypeOfExpression(node) { + var expr = ts2.skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + if (ts2.isJSDocTypeAssertion(expr)) { + var type3 = ts2.getJSDocTypeAssertionType(expr); + if (!ts2.isConstTypeReference(type3)) { + return getTypeFromTypeNode(type3); + } + } + expr = ts2.skipParentheses(node); + if (ts2.isCallExpression(expr) && expr.expression.kind !== 106 && !ts2.isRequireCall( + expr, + /*checkArgumentIsStringLiteralLike*/ + true + ) && !isSymbolOrSymbolForCall(expr)) { + var type3 = ts2.isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); + if (type3) { + return type3; + } + } else if (ts2.isAssertionExpression(expr) && !ts2.isConstTypeReference(expr.type)) { + return getTypeFromTypeNode(expr.type); + } else if (node.kind === 8 || node.kind === 10 || node.kind === 110 || node.kind === 95) { + return checkExpression(node); + } + return void 0; + } + function getContextFreeTypeOfExpression(node) { + var links = getNodeLinks(node); + if (links.contextFreeType) { + return links.contextFreeType; + } + var saveContextualType = node.contextualType; + node.contextualType = anyType2; + try { + var type3 = links.contextFreeType = checkExpression( + node, + 4 + /* CheckMode.SkipContextSensitive */ + ); + return type3; + } finally { + node.contextualType = saveContextualType; + } + } + function checkExpression(node, checkMode, forceTuple) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + var saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + var uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple); + var type3 = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); + if (isConstEnumObjectType(type3)) { + checkConstEnumAccess(node, type3); + } + currentNode = saveCurrentNode; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return type3; + } + function checkConstEnumAccess(node, type3) { + var ok2 = node.parent.kind === 208 && node.parent.expression === node || node.parent.kind === 209 && node.parent.expression === node || ((node.kind === 79 || node.kind === 163) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 183 && node.parent.exprName === node) || node.parent.kind === 278; + if (!ok2) { + error2(node, ts2.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); + } + if (compilerOptions.isolatedModules) { + ts2.Debug.assert(!!(type3.symbol.flags & 128)); + var constEnumDeclaration = type3.symbol.valueDeclaration; + if (constEnumDeclaration.flags & 16777216) { + error2(node, ts2.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided); + } + } + } + function checkParenthesizedExpression(node, checkMode) { + if (ts2.hasJSDocNodes(node) && ts2.isJSDocTypeAssertion(node)) { + var type3 = ts2.getJSDocTypeAssertionType(node); + return checkAssertionWorker(type3, type3, node.expression, checkMode); + } + return checkExpression(node.expression, checkMode); + } + function checkExpressionWorker(node, checkMode, forceTuple) { + var kind = node.kind; + if (cancellationToken) { + switch (kind) { + case 228: + case 215: + case 216: + cancellationToken.throwIfCancellationRequested(); + } + } + switch (kind) { + case 79: + return checkIdentifier(node, checkMode); + case 80: + return checkPrivateIdentifierExpression(node); + case 108: + return checkThisExpression(node); + case 106: + return checkSuperExpression(node); + case 104: + return nullWideningType; + case 14: + case 10: + return getFreshTypeOfLiteralType(getStringLiteralType(node.text)); + case 8: + checkGrammarNumericLiteral(node); + return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text)); + case 9: + checkGrammarBigIntLiteral(node); + return getFreshTypeOfLiteralType(getBigIntLiteralType({ + negative: false, + base10Value: ts2.parsePseudoBigInt(node.text) + })); + case 110: + return trueType; + case 95: + return falseType; + case 225: + return checkTemplateExpression(node); + case 13: + return globalRegExpType; + case 206: + return checkArrayLiteral(node, checkMode, forceTuple); + case 207: + return checkObjectLiteral(node, checkMode); + case 208: + return checkPropertyAccessExpression(node, checkMode); + case 163: + return checkQualifiedName(node, checkMode); + case 209: + return checkIndexedAccess(node, checkMode); + case 210: + if (node.expression.kind === 100) { + return checkImportCallExpression(node); + } + case 211: + return checkCallExpression(node, checkMode); + case 212: + return checkTaggedTemplateExpression(node); + case 214: + return checkParenthesizedExpression(node, checkMode); + case 228: + return checkClassExpression(node); + case 215: + case 216: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 218: + return checkTypeOfExpression(node); + case 213: + case 231: + return checkAssertion(node); + case 232: + return checkNonNullAssertion(node); + case 230: + return checkExpressionWithTypeArguments(node); + case 235: + return checkSatisfiesExpression(node); + case 233: + return checkMetaProperty(node); + case 217: + return checkDeleteExpression(node); + case 219: + return checkVoidExpression(node); + case 220: + return checkAwaitExpression(node); + case 221: + return checkPrefixUnaryExpression(node); + case 222: + return checkPostfixUnaryExpression(node); + case 223: + return checkBinaryExpression(node, checkMode); + case 224: + return checkConditionalExpression(node, checkMode); + case 227: + return checkSpreadExpression(node, checkMode); + case 229: + return undefinedWideningType; + case 226: + return checkYieldExpression(node); + case 234: + return checkSyntheticExpression(node); + case 291: + return checkJsxExpression(node, checkMode); + case 281: + return checkJsxElement(node, checkMode); + case 282: + return checkJsxSelfClosingElement(node, checkMode); + case 285: + return checkJsxFragment(node); + case 289: + return checkJsxAttributes(node, checkMode); + case 283: + ts2.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); + } + return errorType; + } + function checkTypeParameter(node) { + checkGrammarModifiers(node); + if (node.expression) { + grammarErrorOnFirstToken(node.expression, ts2.Diagnostics.Type_expected); + } + checkSourceElement(node.constraint); + checkSourceElement(node.default); + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + getBaseConstraintOfType(typeParameter); + if (!hasNonCircularTypeParameterDefault(typeParameter)) { + error2(node.default, ts2.Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); + } + var constraintType = getConstraintOfTypeParameter(typeParameter); + var defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + checkNodeDeferred(node); + addLazyDiagnostic(function() { + return checkTypeNameIsReserved(node.name, ts2.Diagnostics.Type_parameter_name_cannot_be_0); + }); + } + function checkTypeParameterDeferred(node) { + if (ts2.isInterfaceDeclaration(node.parent) || ts2.isClassLike(node.parent) || ts2.isTypeAliasDeclaration(node.parent)) { + var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); + var modifiers = getVarianceModifiers(typeParameter); + if (modifiers) { + var symbol = getSymbolOfNode(node.parent); + if (ts2.isTypeAliasDeclaration(node.parent) && !(ts2.getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 | 32))) { + error2(node, ts2.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types); + } else if (modifiers === 32768 || modifiers === 65536) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("checkTypes", "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) }); + var source = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSubTypeForCheck : markerSuperTypeForCheck); + var target = createMarkerType(symbol, typeParameter, modifiers === 65536 ? markerSuperTypeForCheck : markerSubTypeForCheck); + var saveVarianceTypeParameter = typeParameter; + varianceTypeParameter = typeParameter; + checkTypeAssignableTo(source, target, node, ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation); + varianceTypeParameter = saveVarianceTypeParameter; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + } + } + } + function checkParameter(node) { + checkGrammarDecoratorsAndModifiers(node); + checkVariableLikeDeclaration(node); + var func = ts2.getContainingFunction(node); + if (ts2.hasSyntacticModifier( + node, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + )) { + if (!(func.kind === 173 && ts2.nodeIsPresent(func.body))) { + error2(node, ts2.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + if (func.kind === 173 && ts2.isIdentifier(node.name) && node.name.escapedText === "constructor") { + error2(node.name, ts2.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); + } + } + if ((node.questionToken || isJSDocOptionalParameter(node)) && ts2.isBindingPattern(node.name) && func.body) { + error2(node, ts2.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); + } + if (node.name && ts2.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { + if (func.parameters.indexOf(node) !== 0) { + error2(node, ts2.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); + } + if (func.kind === 173 || func.kind === 177 || func.kind === 182) { + error2(node, ts2.Diagnostics.A_constructor_cannot_have_a_this_parameter); + } + if (func.kind === 216) { + error2(node, ts2.Diagnostics.An_arrow_function_cannot_have_a_this_parameter); + } + if (func.kind === 174 || func.kind === 175) { + error2(node, ts2.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } + } + if (node.dotDotDotToken && !ts2.isBindingPattern(node.name) && !isTypeAssignableTo(getReducedType(getTypeOfSymbol(node.symbol)), anyReadonlyArrayType)) { + error2(node, ts2.Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + function checkTypePredicate(node) { + var parent2 = getTypePredicateParent(node); + if (!parent2) { + error2(node, ts2.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + return; + } + var signature = getSignatureFromDeclaration(parent2); + var typePredicate = getTypePredicateOfSignature(signature); + if (!typePredicate) { + return; + } + checkSourceElement(node.type); + var parameterName = node.parameterName; + if (typePredicate.kind === 0 || typePredicate.kind === 2) { + getTypeFromThisTypeNode(parameterName); + } else { + if (typePredicate.parameterIndex >= 0) { + if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) { + error2(parameterName, ts2.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } else { + if (typePredicate.type) { + var leadingError = function() { + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type + ); + }; + checkTypeAssignableTo( + typePredicate.type, + getTypeOfSymbol(signature.parameters[typePredicate.parameterIndex]), + node.type, + /*headMessage*/ + void 0, + leadingError + ); + } + } + } else if (parameterName) { + var hasReportedError = false; + for (var _i = 0, _a2 = parent2.parameters; _i < _a2.length; _i++) { + var name2 = _a2[_i].name; + if (ts2.isBindingPattern(name2) && checkIfTypePredicateVariableIsDeclaredInBindingPattern(name2, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error2(node.parameterName, ts2.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } + } + } + function getTypePredicateParent(node) { + switch (node.parent.kind) { + case 216: + case 176: + case 259: + case 215: + case 181: + case 171: + case 170: + var parent2 = node.parent; + if (node === parent2.type) { + return parent2; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern5, predicateVariableNode, predicateVariableName) { + for (var _i = 0, _a2 = pattern5.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (ts2.isOmittedExpression(element)) { + continue; + } + var name2 = element.name; + if (name2.kind === 79 && name2.escapedText === predicateVariableName) { + error2(predicateVariableNode, ts2.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } else if (name2.kind === 204 || name2.kind === 203) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name2, predicateVariableNode, predicateVariableName)) { + return true; + } + } + } + } + function checkSignatureDeclaration(node) { + if (node.kind === 178) { + checkGrammarIndexSignature(node); + } else if (node.kind === 181 || node.kind === 259 || node.kind === 182 || node.kind === 176 || node.kind === 173 || node.kind === 177) { + checkGrammarFunctionLikeDeclaration(node); + } + var functionFlags = ts2.getFunctionFlags(node); + if (!(functionFlags & 4)) { + if ((functionFlags & 3) === 3 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 6144 + /* ExternalEmitHelpers.AsyncGeneratorIncludes */ + ); + } + if ((functionFlags & 3) === 2 && languageVersion < 4) { + checkExternalEmitHelpers( + node, + 64 + /* ExternalEmitHelpers.Awaiter */ + ); + } + if ((functionFlags & 3) !== 0 && languageVersion < 2) { + checkExternalEmitHelpers( + node, + 128 + /* ExternalEmitHelpers.Generator */ + ); + } + } + checkTypeParameters(ts2.getEffectiveTypeParameterDeclarations(node)); + checkUnmatchedJSDocParameters(node); + ts2.forEach(node.parameters, checkParameter); + if (node.type) { + checkSourceElement(node.type); + } + addLazyDiagnostic(checkSignatureDeclarationDiagnostics); + function checkSignatureDeclarationDiagnostics() { + checkCollisionWithArgumentsInGeneratedCode(node); + var returnTypeNode = ts2.getEffectiveReturnTypeNode(node); + if (noImplicitAny && !returnTypeNode) { + switch (node.kind) { + case 177: + error2(node, ts2.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 176: + error2(node, ts2.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } + } + if (returnTypeNode) { + var functionFlags_1 = ts2.getFunctionFlags(node); + if ((functionFlags_1 & (4 | 1)) === 1) { + var returnType = getTypeFromTypeNode(returnTypeNode); + if (returnType === voidType2) { + error2(returnTypeNode, ts2.Diagnostics.A_generator_cannot_have_a_void_type_annotation); + } else { + var generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0, returnType, (functionFlags_1 & 2) !== 0) || anyType2; + var generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, returnType, (functionFlags_1 & 2) !== 0) || generatorYieldType; + var generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2, returnType, (functionFlags_1 & 2) !== 0) || unknownType2; + var generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags_1 & 2)); + checkTypeAssignableTo(generatorInstantiation, returnType, returnTypeNode); + } + } else if ((functionFlags_1 & 3) === 2) { + checkAsyncFunctionReturnType(node, returnTypeNode); + } + } + if (node.kind !== 178 && node.kind !== 320) { + registerForUnusedIdentifiersCheck(node); + } + } + } + function checkClassForDuplicateDeclarations(node) { + var instanceNames = new ts2.Map(); + var staticNames = new ts2.Map(); + var privateIdentifiers = new ts2.Map(); + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (member.kind === 173) { + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var param = _c[_b]; + if (ts2.isParameterPropertyDeclaration(param, member) && !ts2.isBindingPattern(param.name)) { + addName( + instanceNames, + param.name, + param.name.escapedText, + 3 + /* DeclarationMeaning.GetOrSetAccessor */ + ); + } + } + } else { + var isStaticMember = ts2.isStatic(member); + var name2 = member.name; + if (!name2) { + continue; + } + var isPrivate = ts2.isPrivateIdentifier(name2); + var privateStaticFlags = isPrivate && isStaticMember ? 16 : 0; + var names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames; + var memberName = name2 && ts2.getPropertyNameForPropertyNameNode(name2); + if (memberName) { + switch (member.kind) { + case 174: + addName(names, name2, memberName, 1 | privateStaticFlags); + break; + case 175: + addName(names, name2, memberName, 2 | privateStaticFlags); + break; + case 169: + addName(names, name2, memberName, 3 | privateStaticFlags); + break; + case 171: + addName(names, name2, memberName, 8 | privateStaticFlags); + break; + } + } + } + } + function addName(names2, location2, name3, meaning) { + var prev = names2.get(name3); + if (prev) { + if ((prev & 16) !== (meaning & 16)) { + error2(location2, ts2.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, ts2.getTextOfNode(location2)); + } else { + var prevIsMethod = !!(prev & 8); + var isMethod = !!(meaning & 8); + if (prevIsMethod || isMethod) { + if (prevIsMethod !== isMethod) { + error2(location2, ts2.Diagnostics.Duplicate_identifier_0, ts2.getTextOfNode(location2)); + } + } else if (prev & meaning & ~16) { + error2(location2, ts2.Diagnostics.Duplicate_identifier_0, ts2.getTextOfNode(location2)); + } else { + names2.set(name3, prev | meaning); + } + } + } else { + names2.set(name3, meaning); + } + } + } + function checkClassForStaticPropertyNameConflicts(node) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + var memberNameNode = member.name; + var isStaticMember = ts2.isStatic(member); + if (isStaticMember && memberNameNode) { + var memberName = ts2.getPropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + case "prototype": + var message = ts2.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + var className = getNameOfSymbolAsWritten(getSymbolOfNode(node)); + error2(memberNameNode, message, memberName, className); + break; + } + } + } + } + function checkObjectTypeForDuplicateDeclarations(node) { + var names = new ts2.Map(); + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (member.kind === 168) { + var memberName = void 0; + var name2 = member.name; + switch (name2.kind) { + case 10: + case 8: + memberName = name2.text; + break; + case 79: + memberName = ts2.idText(name2); + break; + default: + continue; + } + if (names.get(memberName)) { + error2(ts2.getNameOfDeclaration(member.symbol.valueDeclaration), ts2.Diagnostics.Duplicate_identifier_0, memberName); + error2(member.name, ts2.Diagnostics.Duplicate_identifier_0, memberName); + } else { + names.set(memberName, true); + } + } + } + } + function checkTypeForDuplicateIndexSignatures(node) { + if (node.kind === 261) { + var nodeSymbol = getSymbolOfNode(node); + if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { + return; + } + } + var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); + if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) { + var indexSignatureMap_1 = new ts2.Map(); + var _loop_29 = function(declaration2) { + if (declaration2.parameters.length === 1 && declaration2.parameters[0].type) { + forEachType(getTypeFromTypeNode(declaration2.parameters[0].type), function(type3) { + var entry = indexSignatureMap_1.get(getTypeId(type3)); + if (entry) { + entry.declarations.push(declaration2); + } else { + indexSignatureMap_1.set(getTypeId(type3), { type: type3, declarations: [declaration2] }); + } + }); + } + }; + for (var _i = 0, _a2 = indexSymbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + _loop_29(declaration); + } + indexSignatureMap_1.forEach(function(entry) { + if (entry.declarations.length > 1) { + for (var _i2 = 0, _a3 = entry.declarations; _i2 < _a3.length; _i2++) { + var declaration2 = _a3[_i2]; + error2(declaration2, ts2.Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type)); + } + } + }); + } + } + function checkPropertyDeclaration(node) { + if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarProperty(node)) + checkGrammarComputedPropertyName(node.name); + checkVariableLikeDeclaration(node); + setNodeLinksForPrivateIdentifierScope(node); + if (ts2.hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + ) && node.kind === 169 && node.initializer) { + error2(node, ts2.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, ts2.declarationNameToString(node.name)); + } + } + function checkPropertySignature(node) { + if (ts2.isPrivateIdentifier(node.name)) { + error2(node, ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + return checkPropertyDeclaration(node); + } + function checkMethodDeclaration(node) { + if (!checkGrammarMethod(node)) + checkGrammarComputedPropertyName(node.name); + if (ts2.isMethodDeclaration(node) && node.asteriskToken && ts2.isIdentifier(node.name) && ts2.idText(node.name) === "constructor") { + error2(node.name, ts2.Diagnostics.Class_constructor_may_not_be_a_generator); + } + checkFunctionOrMethodDeclaration(node); + if (ts2.hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + ) && node.kind === 171 && node.body) { + error2(node, ts2.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts2.declarationNameToString(node.name)); + } + if (ts2.isPrivateIdentifier(node.name) && !ts2.getContainingClass(node)) { + error2(node, ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + setNodeLinksForPrivateIdentifierScope(node); + } + function setNodeLinksForPrivateIdentifierScope(node) { + if (ts2.isPrivateIdentifier(node.name) && languageVersion < 99) { + for (var lexicalScope = ts2.getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = ts2.getEnclosingBlockScopeContainer(lexicalScope)) { + getNodeLinks(lexicalScope).flags |= 67108864; + } + if (ts2.isClassExpression(node.parent)) { + var enclosingIterationStatement = getEnclosingIterationStatement(node.parent); + if (enclosingIterationStatement) { + getNodeLinks(node.name).flags |= 524288; + getNodeLinks(enclosingIterationStatement).flags |= 65536; + } + } + } + } + function checkClassStaticBlockDeclaration(node) { + checkGrammarDecoratorsAndModifiers(node); + ts2.forEachChild(node, checkSourceElement); + } + function checkConstructorDeclaration(node) { + checkSignatureDeclaration(node); + if (!checkGrammarConstructorTypeParameters(node)) + checkGrammarConstructorTypeAnnotation(node); + checkSourceElement(node.body); + var symbol = getSymbolOfNode(node); + var firstDeclaration = ts2.getDeclarationOfKind(symbol, node.kind); + if (node === firstDeclaration) { + checkFunctionOrConstructorSymbol(symbol); + } + if (ts2.nodeIsMissing(node.body)) { + return; + } + addLazyDiagnostic(checkConstructorDeclarationDiagnostics); + return; + function isInstancePropertyWithInitializerOrPrivateIdentifierProperty(n7) { + if (ts2.isPrivateIdentifierClassElementDeclaration(n7)) { + return true; + } + return n7.kind === 169 && !ts2.isStatic(n7) && !!n7.initializer; + } + function checkConstructorDeclarationDiagnostics() { + var containingClassDecl = node.parent; + if (ts2.getClassExtendsHeritageElement(containingClassDecl)) { + captureLexicalThis(node.parent, containingClassDecl); + var classExtendsNull = classDeclarationExtendsNull(containingClassDecl); + var superCall = findFirstSuperCall(node.body); + if (superCall) { + if (classExtendsNull) { + error2(superCall, ts2.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); + } + var superCallShouldBeRootLevel = (ts2.getEmitScriptTarget(compilerOptions) !== 99 || !useDefineForClassFields) && (ts2.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || ts2.some(node.parameters, function(p7) { + return ts2.hasSyntacticModifier( + p7, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ); + })); + if (superCallShouldBeRootLevel) { + if (!superCallIsRootLevelInConstructor(superCall, node.body)) { + error2(superCall, ts2.Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers); + } else { + var superCallStatement = void 0; + for (var _i = 0, _a2 = node.body.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (ts2.isExpressionStatement(statement) && ts2.isSuperCall(ts2.skipOuterExpressions(statement.expression))) { + superCallStatement = statement; + break; + } + if (nodeImmediatelyReferencesSuperOrThis(statement)) { + break; + } + } + if (superCallStatement === void 0) { + error2(node, ts2.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers); + } + } + } + } else if (!classExtendsNull) { + error2(node, ts2.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + } + } + } + } + function superCallIsRootLevelInConstructor(superCall, body) { + var superCallParent = ts2.walkUpParenthesizedExpressions(superCall.parent); + return ts2.isExpressionStatement(superCallParent) && superCallParent.parent === body; + } + function nodeImmediatelyReferencesSuperOrThis(node) { + if (node.kind === 106 || node.kind === 108) { + return true; + } + if (ts2.isThisContainerOrFunctionBlock(node)) { + return false; + } + return !!ts2.forEachChild(node, nodeImmediatelyReferencesSuperOrThis); + } + function checkAccessorDeclaration(node) { + if (ts2.isIdentifier(node.name) && ts2.idText(node.name) === "constructor") { + error2(node.name, ts2.Diagnostics.Class_constructor_may_not_be_an_accessor); + } + addLazyDiagnostic(checkAccessorDeclarationDiagnostics); + checkSourceElement(node.body); + setNodeLinksForPrivateIdentifierScope(node); + function checkAccessorDeclarationDiagnostics() { + if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node)) + checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); + if (node.kind === 174) { + if (!(node.flags & 16777216) && ts2.nodeIsPresent(node.body) && node.flags & 256) { + if (!(node.flags & 512)) { + error2(node.name, ts2.Diagnostics.A_get_accessor_must_return_a_value); + } + } + } + if (node.name.kind === 164) { + checkComputedPropertyName(node.name); + } + if (hasBindableName(node)) { + var symbol = getSymbolOfNode(node); + var getter = ts2.getDeclarationOfKind( + symbol, + 174 + /* SyntaxKind.GetAccessor */ + ); + var setter = ts2.getDeclarationOfKind( + symbol, + 175 + /* SyntaxKind.SetAccessor */ + ); + if (getter && setter && !(getNodeCheckFlags(getter) & 1)) { + getNodeLinks(getter).flags |= 1; + var getterFlags = ts2.getEffectiveModifierFlags(getter); + var setterFlags = ts2.getEffectiveModifierFlags(setter); + if ((getterFlags & 256) !== (setterFlags & 256)) { + error2(getter.name, ts2.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + error2(setter.name, ts2.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + } + if (getterFlags & 16 && !(setterFlags & (16 | 8)) || getterFlags & 8 && !(setterFlags & 8)) { + error2(getter.name, ts2.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + error2(setter.name, ts2.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + } + var getterType = getAnnotatedAccessorType(getter); + var setterType = getAnnotatedAccessorType(setter); + if (getterType && setterType) { + checkTypeAssignableTo(getterType, setterType, getter, ts2.Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type); + } + } + } + var returnType = getTypeOfAccessors(getSymbolOfNode(node)); + if (node.kind === 174) { + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); + } + } + } + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function getEffectiveTypeArgumentAtIndex(node, typeParameters, index4) { + if (node.typeArguments && index4 < node.typeArguments.length) { + return getTypeFromTypeNode(node.typeArguments[index4]); + } + return getEffectiveTypeArguments(node, typeParameters)[index4]; + } + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts2.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts2.isInJSFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { + var typeArguments; + var mapper; + var result2 = true; + for (var i7 = 0; i7 < typeParameters.length; i7++) { + var constraint = getConstraintOfTypeParameter(typeParameters[i7]); + if (constraint) { + if (!typeArguments) { + typeArguments = getEffectiveTypeArguments(node, typeParameters); + mapper = createTypeMapper(typeParameters, typeArguments); + } + result2 = result2 && checkTypeAssignableTo(typeArguments[i7], instantiateType(constraint, mapper), node.typeArguments[i7], ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + } + return result2; + } + function getTypeParametersForTypeReference(node) { + var type3 = getTypeFromTypeReference(node); + if (!isErrorType(type3)) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters || (ts2.getObjectFlags(type3) & 4 ? type3.target.localTypeParameters : void 0); + } + } + return void 0; + } + function checkTypeReferenceNode(node) { + checkGrammarTypeArguments(node, node.typeArguments); + if (node.kind === 180 && node.typeName.jsdocDotPos !== void 0 && !ts2.isInJSFile(node) && !ts2.isInJSDoc(node)) { + grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts2.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } + ts2.forEach(node.typeArguments, checkSourceElement); + var type3 = getTypeFromTypeReference(node); + if (!isErrorType(type3)) { + if (node.typeArguments) { + addLazyDiagnostic(function() { + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); + } + }); + } + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + if (ts2.some(symbol.declarations, function(d7) { + return ts2.isTypeDeclaration(d7) && !!(d7.flags & 268435456); + })) { + addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName); + } + if (type3.flags & 32 && symbol.flags & 8) { + error2(node, ts2.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals, typeToString(type3)); + } + } + } + } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts2.tryCast(node.parent, ts2.isTypeReferenceType); + if (!typeReferenceNode) + return void 0; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + if (!typeParameters) + return void 0; + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } + function checkTypeQuery(node) { + getTypeFromTypeQueryNode(node); + } + function checkTypeLiteral(node) { + ts2.forEach(node.members, checkSourceElement); + addLazyDiagnostic(checkTypeLiteralDiagnostics); + function checkTypeLiteralDiagnostics() { + var type3 = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + checkIndexConstraints(type3, type3.symbol); + checkTypeForDuplicateIndexSignatures(node); + checkObjectTypeForDuplicateDeclarations(node); + } + } + function checkArrayType(node) { + checkSourceElement(node.elementType); + } + function checkTupleType(node) { + var elementTypes = node.elements; + var seenOptionalElement = false; + var seenRestElement = false; + var hasNamedElement = ts2.some(elementTypes, ts2.isNamedTupleMember); + for (var _i = 0, elementTypes_1 = elementTypes; _i < elementTypes_1.length; _i++) { + var e10 = elementTypes_1[_i]; + if (e10.kind !== 199 && hasNamedElement) { + grammarErrorOnNode(e10, ts2.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names); + break; + } + var flags = getTupleElementFlags(e10); + if (flags & 8) { + var type3 = getTypeFromTypeNode(e10.type); + if (!isArrayLikeType(type3)) { + error2(e10, ts2.Diagnostics.A_rest_element_type_must_be_an_array_type); + break; + } + if (isArrayType(type3) || isTupleType(type3) && type3.target.combinedFlags & 4) { + seenRestElement = true; + } + } else if (flags & 4) { + if (seenRestElement) { + grammarErrorOnNode(e10, ts2.Diagnostics.A_rest_element_cannot_follow_another_rest_element); + break; + } + seenRestElement = true; + } else if (flags & 2) { + if (seenRestElement) { + grammarErrorOnNode(e10, ts2.Diagnostics.An_optional_element_cannot_follow_a_rest_element); + break; + } + seenOptionalElement = true; + } else if (seenOptionalElement) { + grammarErrorOnNode(e10, ts2.Diagnostics.A_required_element_cannot_follow_an_optional_element); + break; + } + } + ts2.forEach(node.elements, checkSourceElement); + getTypeFromTypeNode(node); + } + function checkUnionOrIntersectionType(node) { + ts2.forEach(node.types, checkSourceElement); + getTypeFromTypeNode(node); + } + function checkIndexedAccessIndexType(type3, accessNode) { + if (!(type3.flags & 8388608)) { + return type3; + } + var objectType2 = type3.objectType; + var indexType = type3.indexType; + if (isTypeAssignableTo(indexType, getIndexType( + objectType2, + /*stringsOnly*/ + false + ))) { + if (accessNode.kind === 209 && ts2.isAssignmentTarget(accessNode) && ts2.getObjectFlags(objectType2) & 32 && getMappedTypeModifiers(objectType2) & 1) { + error2(accessNode, ts2.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType2)); + } + return type3; + } + var apparentObjectType = getApparentType(objectType2); + if (getIndexInfoOfType(apparentObjectType, numberType2) && isTypeAssignableToKind( + indexType, + 296 + /* TypeFlags.NumberLike */ + )) { + return type3; + } + if (isGenericObjectType(objectType2)) { + var propertyName_1 = getPropertyNameFromIndex(indexType, accessNode); + if (propertyName_1) { + var propertySymbol = forEachType(apparentObjectType, function(t8) { + return getPropertyOfType(t8, propertyName_1); + }); + if (propertySymbol && ts2.getDeclarationModifierFlagsFromSymbol(propertySymbol) & 24) { + error2(accessNode, ts2.Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, ts2.unescapeLeadingUnderscores(propertyName_1)); + return errorType; + } + } + } + error2(accessNode, ts2.Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType2)); + return errorType; + } + function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); + } + function checkMappedType(node) { + checkGrammarMappedType(node); + checkSourceElement(node.typeParameter); + checkSourceElement(node.nameType); + checkSourceElement(node.type); + if (!node.type) { + reportImplicitAny(node, anyType2); + } + var type3 = getTypeFromMappedTypeNode(node); + var nameType = getNameTypeFromMappedType(type3); + if (nameType) { + checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); + } else { + var constraintType = getConstraintTypeFromMappedType(type3); + checkTypeAssignableTo(constraintType, keyofConstraintType, ts2.getEffectiveConstraintOfTypeParameter(node.typeParameter)); + } + } + function checkGrammarMappedType(node) { + var _a2; + if ((_a2 = node.members) === null || _a2 === void 0 ? void 0 : _a2.length) { + return grammarErrorOnNode(node.members[0], ts2.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); + } + } + function checkThisType(node) { + getTypeFromThisTypeNode(node); + } + function checkTypeOperator(node) { + checkGrammarTypeOperatorNode(node); + checkSourceElement(node.type); + } + function checkConditionalType(node) { + ts2.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts2.findAncestor(node, function(n7) { + return n7.parent && n7.parent.kind === 191 && n7.parent.extendsType === n7; + })) { + grammarErrorOnNode(node, ts2.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + var symbol = getSymbolOfNode(node.typeParameter); + if (symbol.declarations && symbol.declarations.length > 1) { + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var typeParameter = getDeclaredTypeOfTypeParameter(symbol); + var declarations = ts2.getDeclarationsOfKind( + symbol, + 165 + /* SyntaxKind.TypeParameter */ + ); + if (!areTypeParametersIdentical(declarations, [typeParameter], function(decl) { + return [decl]; + })) { + var name2 = symbolToString2(symbol); + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; + error2(declaration.name, ts2.Diagnostics.All_declarations_of_0_must_have_identical_constraints, name2); + } + } + } + } + registerForUnusedIdentifiersCheck(node); + } + function checkTemplateLiteralType(node) { + for (var _i = 0, _a2 = node.templateSpans; _i < _a2.length; _i++) { + var span = _a2[_i]; + checkSourceElement(span.type); + var type3 = getTypeFromTypeNode(span.type); + checkTypeAssignableTo(type3, templateConstraintType, span.type); + } + getTypeFromTypeNode(node); + } + function checkImportType(node) { + checkSourceElement(node.argument); + if (node.assertions) { + var override = ts2.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode); + if (override) { + if (!ts2.isNightly()) { + grammarErrorOnNode(node.assertions.assertClause, ts2.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); + } + if (ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.NodeNext) { + grammarErrorOnNode(node.assertions.assertClause, ts2.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); + } + } + } + getTypeFromTypeNode(node); + } + function checkNamedTupleMember(node) { + if (node.dotDotDotToken && node.questionToken) { + grammarErrorOnNode(node, ts2.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); + } + if (node.type.kind === 187) { + grammarErrorOnNode(node.type, ts2.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); + } + if (node.type.kind === 188) { + grammarErrorOnNode(node.type, ts2.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); + } + checkSourceElement(node.type); + getTypeFromTypeNode(node); + } + function isPrivateWithinAmbient(node) { + return (ts2.hasEffectiveModifier( + node, + 8 + /* ModifierFlags.Private */ + ) || ts2.isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 16777216); + } + function getEffectiveDeclarationFlags(n7, flagsToCheck) { + var flags = ts2.getCombinedModifierFlags(n7); + if (n7.parent.kind !== 261 && n7.parent.kind !== 260 && n7.parent.kind !== 228 && n7.flags & 16777216) { + if (!(flags & 2) && !(ts2.isModuleBlock(n7.parent) && ts2.isModuleDeclaration(n7.parent.parent) && ts2.isGlobalScopeAugmentation(n7.parent.parent))) { + flags |= 1; + } + flags |= 2; + } + return flags & flagsToCheck; + } + function checkFunctionOrConstructorSymbol(symbol) { + addLazyDiagnostic(function() { + return checkFunctionOrConstructorSymbolWorker(symbol); + }); + } + function checkFunctionOrConstructorSymbolWorker(symbol) { + function getCanonicalOverload(overloads, implementation) { + var implementationSharesContainerWithFirstOverload = implementation !== void 0 && implementation.parent === overloads[0].parent; + return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; + } + function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck2, someOverloadFlags, allOverloadFlags) { + var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; + if (someButNotAllOverloadFlags !== 0) { + var canonicalFlags_1 = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2); + ts2.forEach(overloads, function(o7) { + var deviation = getEffectiveDeclarationFlags(o7, flagsToCheck2) ^ canonicalFlags_1; + if (deviation & 1) { + error2(ts2.getNameOfDeclaration(o7), ts2.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); + } else if (deviation & 2) { + error2(ts2.getNameOfDeclaration(o7), ts2.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } else if (deviation & (8 | 16)) { + error2(ts2.getNameOfDeclaration(o7) || o7, ts2.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); + } else if (deviation & 256) { + error2(ts2.getNameOfDeclaration(o7), ts2.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); + } + }); + } + } + function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken2, allHaveQuestionToken2) { + if (someHaveQuestionToken2 !== allHaveQuestionToken2) { + var canonicalHasQuestionToken_1 = ts2.hasQuestionToken(getCanonicalOverload(overloads, implementation)); + ts2.forEach(overloads, function(o7) { + var deviation = ts2.hasQuestionToken(o7) !== canonicalHasQuestionToken_1; + if (deviation) { + error2(ts2.getNameOfDeclaration(o7), ts2.Diagnostics.Overload_signatures_must_all_be_optional_or_required); + } + }); + } + } + var flagsToCheck = 1 | 2 | 8 | 16 | 256; + var someNodeFlags = 0; + var allNodeFlags = flagsToCheck; + var someHaveQuestionToken = false; + var allHaveQuestionToken = true; + var hasOverloads = false; + var bodyDeclaration; + var lastSeenNonAmbientDeclaration; + var previousDeclaration; + var declarations = symbol.declarations; + var isConstructor = (symbol.flags & 16384) !== 0; + function reportImplementationExpectedError(node2) { + if (node2.name && ts2.nodeIsMissing(node2.name)) { + return; + } + var seen = false; + var subsequentNode = ts2.forEachChild(node2.parent, function(c7) { + if (seen) { + return c7; + } else { + seen = c7 === node2; + } + }); + if (subsequentNode && subsequentNode.pos === node2.end) { + if (subsequentNode.kind === node2.kind) { + var errorNode_1 = subsequentNode.name || subsequentNode; + var subsequentName = subsequentNode.name; + if (node2.name && subsequentName && // both are private identifiers + (ts2.isPrivateIdentifier(node2.name) && ts2.isPrivateIdentifier(subsequentName) && node2.name.escapedText === subsequentName.escapedText || // Both are computed property names + // TODO: GH#17345: These are methods, so handle computed name case. (`Always allowing computed property names is *not* the correct behavior!) + ts2.isComputedPropertyName(node2.name) && ts2.isComputedPropertyName(subsequentName) || // Both are literal property names that are the same. + ts2.isPropertyNameLiteral(node2.name) && ts2.isPropertyNameLiteral(subsequentName) && ts2.getEscapedTextOfIdentifierOrLiteral(node2.name) === ts2.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { + var reportError = (node2.kind === 171 || node2.kind === 170) && ts2.isStatic(node2) !== ts2.isStatic(subsequentNode); + if (reportError) { + var diagnostic = ts2.isStatic(node2) ? ts2.Diagnostics.Function_overload_must_be_static : ts2.Diagnostics.Function_overload_must_not_be_static; + error2(errorNode_1, diagnostic); + } + return; + } + if (ts2.nodeIsPresent(subsequentNode.body)) { + error2(errorNode_1, ts2.Diagnostics.Function_implementation_name_must_be_0, ts2.declarationNameToString(node2.name)); + return; + } + } + } + var errorNode = node2.name || node2; + if (isConstructor) { + error2(errorNode, ts2.Diagnostics.Constructor_implementation_is_missing); + } else { + if (ts2.hasSyntacticModifier( + node2, + 256 + /* ModifierFlags.Abstract */ + )) { + error2(errorNode, ts2.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); + } else { + error2(errorNode, ts2.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); + } + } + } + var duplicateFunctionDeclaration = false; + var multipleConstructorImplementation = false; + var hasNonAmbientClass = false; + var functionDeclarations = []; + if (declarations) { + for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) { + var current = declarations_5[_i]; + var node = current; + var inAmbientContext = node.flags & 16777216; + var inAmbientContextOrInterface = node.parent && (node.parent.kind === 261 || node.parent.kind === 184) || inAmbientContext; + if (inAmbientContextOrInterface) { + previousDeclaration = void 0; + } + if ((node.kind === 260 || node.kind === 228) && !inAmbientContext) { + hasNonAmbientClass = true; + } + if (node.kind === 259 || node.kind === 171 || node.kind === 170 || node.kind === 173) { + functionDeclarations.push(node); + var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); + someNodeFlags |= currentNodeFlags; + allNodeFlags &= currentNodeFlags; + someHaveQuestionToken = someHaveQuestionToken || ts2.hasQuestionToken(node); + allHaveQuestionToken = allHaveQuestionToken && ts2.hasQuestionToken(node); + var bodyIsPresent = ts2.nodeIsPresent(node.body); + if (bodyIsPresent && bodyDeclaration) { + if (isConstructor) { + multipleConstructorImplementation = true; + } else { + duplicateFunctionDeclaration = true; + } + } else if ((previousDeclaration === null || previousDeclaration === void 0 ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) { + reportImplementationExpectedError(previousDeclaration); + } + if (bodyIsPresent) { + if (!bodyDeclaration) { + bodyDeclaration = node; + } + } else { + hasOverloads = true; + } + previousDeclaration = node; + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } + } + } + } + if (multipleConstructorImplementation) { + ts2.forEach(functionDeclarations, function(declaration) { + error2(declaration, ts2.Diagnostics.Multiple_constructor_implementations_are_not_allowed); + }); + } + if (duplicateFunctionDeclaration) { + ts2.forEach(functionDeclarations, function(declaration) { + error2(ts2.getNameOfDeclaration(declaration) || declaration, ts2.Diagnostics.Duplicate_function_implementation); + }); + } + if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 && declarations) { + var relatedDiagnostics_1 = ts2.filter(declarations, function(d7) { + return d7.kind === 260; + }).map(function(d7) { + return ts2.createDiagnosticForNode(d7, ts2.Diagnostics.Consider_adding_a_declare_modifier_to_this_class); + }); + ts2.forEach(declarations, function(declaration) { + var diagnostic = declaration.kind === 260 ? ts2.Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 259 ? ts2.Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; + if (diagnostic) { + ts2.addRelatedInfo.apply(void 0, __spreadArray9([error2(ts2.getNameOfDeclaration(declaration) || declaration, diagnostic, ts2.symbolName(symbol))], relatedDiagnostics_1, false)); + } + }); + } + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !ts2.hasSyntacticModifier( + lastSeenNonAmbientDeclaration, + 256 + /* ModifierFlags.Abstract */ + ) && !lastSeenNonAmbientDeclaration.questionToken) { + reportImplementationExpectedError(lastSeenNonAmbientDeclaration); + } + if (hasOverloads) { + if (declarations) { + checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); + checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken); + } + if (bodyDeclaration) { + var signatures = getSignaturesOfSymbol(symbol); + var bodySignature = getSignatureFromDeclaration(bodyDeclaration); + for (var _a2 = 0, signatures_10 = signatures; _a2 < signatures_10.length; _a2++) { + var signature = signatures_10[_a2]; + if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + ts2.addRelatedInfo(error2(signature.declaration, ts2.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), ts2.createDiagnosticForNode(bodyDeclaration, ts2.Diagnostics.The_implementation_signature_is_declared_here)); + break; + } + } + } + } + } + function checkExportsOnMergedDeclarations(node) { + addLazyDiagnostic(function() { + return checkExportsOnMergedDeclarationsWorker(node); + }); + } + function checkExportsOnMergedDeclarationsWorker(node) { + var symbol = node.localSymbol; + if (!symbol) { + symbol = getSymbolOfNode(node); + if (!symbol.exportSymbol) { + return; + } + } + if (ts2.getDeclarationOfKind(symbol, node.kind) !== node) { + return; + } + var exportedDeclarationSpaces = 0; + var nonExportedDeclarationSpaces = 0; + var defaultExportedDeclarationSpaces = 0; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var d7 = _a2[_i]; + var declarationSpaces = getDeclarationSpaces(d7); + var effectiveDeclarationFlags = getEffectiveDeclarationFlags( + d7, + 1 | 1024 + /* ModifierFlags.Default */ + ); + if (effectiveDeclarationFlags & 1) { + if (effectiveDeclarationFlags & 1024) { + defaultExportedDeclarationSpaces |= declarationSpaces; + } else { + exportedDeclarationSpaces |= declarationSpaces; + } + } else { + nonExportedDeclarationSpaces |= declarationSpaces; + } + } + var nonDefaultExportedDeclarationSpaces = exportedDeclarationSpaces | nonExportedDeclarationSpaces; + var commonDeclarationSpacesForExportsAndLocals = exportedDeclarationSpaces & nonExportedDeclarationSpaces; + var commonDeclarationSpacesForDefaultAndNonDefault = defaultExportedDeclarationSpaces & nonDefaultExportedDeclarationSpaces; + if (commonDeclarationSpacesForExportsAndLocals || commonDeclarationSpacesForDefaultAndNonDefault) { + for (var _b = 0, _c = symbol.declarations; _b < _c.length; _b++) { + var d7 = _c[_b]; + var declarationSpaces = getDeclarationSpaces(d7); + var name2 = ts2.getNameOfDeclaration(d7); + if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { + error2(name2, ts2.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, ts2.declarationNameToString(name2)); + } else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) { + error2(name2, ts2.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts2.declarationNameToString(name2)); + } + } + } + function getDeclarationSpaces(decl) { + var d8 = decl; + switch (d8.kind) { + case 261: + case 262: + case 348: + case 341: + case 342: + return 2; + case 264: + return ts2.isAmbientModule(d8) || ts2.getModuleInstanceState(d8) !== 0 ? 4 | 1 : 4; + case 260: + case 263: + case 302: + return 2 | 1; + case 308: + return 2 | 1 | 4; + case 274: + case 223: + var node_2 = d8; + var expression = ts2.isExportAssignment(node_2) ? node_2.expression : node_2.right; + if (!ts2.isEntityNameExpression(expression)) { + return 1; + } + d8 = expression; + case 268: + case 271: + case 270: + var result_12 = 0; + var target = resolveAlias(getSymbolOfNode(d8)); + ts2.forEach(target.declarations, function(d9) { + result_12 |= getDeclarationSpaces(d9); + }); + return result_12; + case 257: + case 205: + case 259: + case 273: + case 79: + return 1; + default: + return ts2.Debug.failBadSyntaxKind(d8); + } + } + } + function getAwaitedTypeOfPromise(type3, errorNode, diagnosticMessage, arg0) { + var promisedType = getPromisedTypeOfPromise(type3, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, arg0); + } + function getPromisedTypeOfPromise(type3, errorNode, thisTypeForErrorOut) { + if (isTypeAny(type3)) { + return void 0; + } + var typeAsPromise = type3; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; + } + if (isReferenceToType(type3, getGlobalPromiseType( + /*reportErrors*/ + false + ))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type3)[0]; + } + if (allTypesAssignableToKind( + getBaseConstraintOrType(type3), + 131068 | 131072 + /* TypeFlags.Never */ + )) { + return void 0; + } + var thenFunction = getTypeOfPropertyOfType(type3, "then"); + if (isTypeAny(thenFunction)) { + return void 0; + } + var thenSignatures = thenFunction ? getSignaturesOfType( + thenFunction, + 0 + /* SignatureKind.Call */ + ) : ts2.emptyArray; + if (thenSignatures.length === 0) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.A_promise_must_have_a_then_method); + } + return void 0; + } + var thisTypeForError; + var candidates; + for (var _i = 0, thenSignatures_1 = thenSignatures; _i < thenSignatures_1.length; _i++) { + var thenSignature = thenSignatures_1[_i]; + var thisType = getThisTypeOfSignature(thenSignature); + if (thisType && thisType !== voidType2 && !isTypeRelatedTo(type3, thisType, subtypeRelation)) { + thisTypeForError = thisType; + } else { + candidates = ts2.append(candidates, thenSignature); + } + } + if (!candidates) { + ts2.Debug.assertIsDefined(thisTypeForError); + if (thisTypeForErrorOut) { + thisTypeForErrorOut.value = thisTypeForError; + } + if (errorNode) { + error2(errorNode, ts2.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type3), typeToString(thisTypeForError)); + } + return void 0; + } + var onfulfilledParameterType = getTypeWithFacts( + getUnionType(ts2.map(candidates, getTypeOfFirstParameterOfSignature)), + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ); + if (isTypeAny(onfulfilledParameterType)) { + return void 0; + } + var onfulfilledParameterSignatures = getSignaturesOfType( + onfulfilledParameterType, + 0 + /* SignatureKind.Call */ + ); + if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } + return void 0; + } + return typeAsPromise.promisedTypeOfPromise = getUnionType( + ts2.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), + 2 + /* UnionReduction.Subtype */ + ); + } + function checkAwaitedType(type3, withAlias, errorNode, diagnosticMessage, arg0) { + var awaitedType = withAlias ? getAwaitedType(type3, errorNode, diagnosticMessage, arg0) : getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, arg0); + return awaitedType || errorType; + } + function isThenableType(type3) { + if (allTypesAssignableToKind( + getBaseConstraintOrType(type3), + 131068 | 131072 + /* TypeFlags.Never */ + )) { + return false; + } + var thenFunction = getTypeOfPropertyOfType(type3, "then"); + return !!thenFunction && getSignaturesOfType( + getTypeWithFacts( + thenFunction, + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ), + 0 + /* SignatureKind.Call */ + ).length > 0; + } + function isAwaitedTypeInstantiation(type3) { + var _a2; + if (type3.flags & 16777216) { + var awaitedSymbol = getGlobalAwaitedSymbol( + /*reportErrors*/ + false + ); + return !!awaitedSymbol && type3.aliasSymbol === awaitedSymbol && ((_a2 = type3.aliasTypeArguments) === null || _a2 === void 0 ? void 0 : _a2.length) === 1; + } + return false; + } + function unwrapAwaitedType(type3) { + return type3.flags & 1048576 ? mapType2(type3, unwrapAwaitedType) : isAwaitedTypeInstantiation(type3) ? type3.aliasTypeArguments[0] : type3; + } + function isAwaitedTypeNeeded(type3) { + if (isTypeAny(type3) || isAwaitedTypeInstantiation(type3)) { + return false; + } + if (isGenericObjectType(type3)) { + var baseConstraint = getBaseConstraintOfType(type3); + if (baseConstraint ? baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) : maybeTypeOfKind( + type3, + 8650752 + /* TypeFlags.TypeVariable */ + )) { + return true; + } + } + return false; + } + function tryCreateAwaitedType(type3) { + var awaitedSymbol = getGlobalAwaitedSymbol( + /*reportErrors*/ + true + ); + if (awaitedSymbol) { + return getTypeAliasInstantiation(awaitedSymbol, [unwrapAwaitedType(type3)]); + } + return void 0; + } + function createAwaitedTypeIfNeeded(type3) { + if (isAwaitedTypeNeeded(type3)) { + var awaitedType = tryCreateAwaitedType(type3); + if (awaitedType) { + return awaitedType; + } + } + ts2.Debug.assert(getPromisedTypeOfPromise(type3) === void 0, "type provided should not be a non-generic 'promise'-like."); + return type3; + } + function getAwaitedType(type3, errorNode, diagnosticMessage, arg0) { + var awaitedType = getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, arg0); + return awaitedType && createAwaitedTypeIfNeeded(awaitedType); + } + function getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, arg0) { + if (isTypeAny(type3)) { + return type3; + } + if (isAwaitedTypeInstantiation(type3)) { + return type3; + } + var typeAsAwaitable = type3; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; + } + if (type3.flags & 1048576) { + if (awaitedTypeStack.lastIndexOf(type3.id) >= 0) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return void 0; + } + var mapper = errorNode ? function(constituentType) { + return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); + } : getAwaitedTypeNoAlias; + awaitedTypeStack.push(type3.id); + var mapped = mapType2(type3, mapper); + awaitedTypeStack.pop(); + return typeAsAwaitable.awaitedTypeOfType = mapped; + } + if (isAwaitedTypeNeeded(type3)) { + return typeAsAwaitable.awaitedTypeOfType = type3; + } + var thisTypeForErrorOut = { value: void 0 }; + var promisedType = getPromisedTypeOfPromise( + type3, + /*errorNode*/ + void 0, + thisTypeForErrorOut + ); + if (promisedType) { + if (type3.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return void 0; + } + awaitedTypeStack.push(type3.id); + var awaitedType = getAwaitedTypeNoAlias(promisedType, errorNode, diagnosticMessage, arg0); + awaitedTypeStack.pop(); + if (!awaitedType) { + return void 0; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + if (isThenableType(type3)) { + if (errorNode) { + ts2.Debug.assertIsDefined(diagnosticMessage); + var chain3 = void 0; + if (thisTypeForErrorOut.value) { + chain3 = ts2.chainDiagnosticMessages(chain3, ts2.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type3), typeToString(thisTypeForErrorOut.value)); + } + chain3 = ts2.chainDiagnosticMessages(chain3, diagnosticMessage, arg0); + diagnostics.add(ts2.createDiagnosticForNodeFromMessageChain(errorNode, chain3)); + } + return void 0; + } + return typeAsAwaitable.awaitedTypeOfType = type3; + } + function checkAsyncFunctionReturnType(node, returnTypeNode) { + var returnType = getTypeFromTypeNode(returnTypeNode); + if (languageVersion >= 2) { + if (isErrorType(returnType)) { + return; + } + var globalPromiseType = getGlobalPromiseType( + /*reportErrors*/ + true + ); + if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) { + error2(returnTypeNode, ts2.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedTypeNoAlias(returnType) || voidType2)); + return; + } + } else { + markTypeNodeAsReferenced(returnTypeNode); + if (isErrorType(returnType)) { + return; + } + var promiseConstructorName = ts2.getEntityNameFromTypeNode(returnTypeNode); + if (promiseConstructorName === void 0) { + error2(returnTypeNode, ts2.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType)); + return; + } + var promiseConstructorSymbol = resolveEntityName( + promiseConstructorName, + 111551, + /*ignoreErrors*/ + true + ); + var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType; + if (isErrorType(promiseConstructorType)) { + if (promiseConstructorName.kind === 79 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType( + /*reportErrors*/ + false + )) { + error2(returnTypeNode, ts2.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } else { + error2(returnTypeNode, ts2.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts2.entityNameToString(promiseConstructorName)); + } + return; + } + var globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType( + /*reportErrors*/ + true + ); + if (globalPromiseConstructorLikeType === emptyObjectType) { + error2(returnTypeNode, ts2.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, ts2.entityNameToString(promiseConstructorName)); + return; + } + if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeNode, ts2.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value)) { + return; + } + var rootName = promiseConstructorName && ts2.getFirstIdentifier(promiseConstructorName); + var collidingSymbol = getSymbol( + node.locals, + rootName.escapedText, + 111551 + /* SymbolFlags.Value */ + ); + if (collidingSymbol) { + error2(collidingSymbol.valueDeclaration, ts2.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts2.idText(rootName), ts2.entityNameToString(promiseConstructorName)); + return; + } + } + checkAwaitedType( + returnType, + /*withAlias*/ + false, + node, + ts2.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + } + function checkDecorator(node) { + var signature = getResolvedSignature(node); + checkDeprecatedSignature(signature, node); + var returnType = getReturnTypeOfSignature(signature); + if (returnType.flags & 1) { + return; + } + var headMessage; + var expectedReturnType; + switch (node.parent.kind) { + case 260: + headMessage = ts2.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + var classSymbol = getSymbolOfNode(node.parent); + var classConstructorType = getTypeOfSymbol(classSymbol); + expectedReturnType = getUnionType([classConstructorType, voidType2]); + break; + case 169: + case 166: + headMessage = ts2.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; + expectedReturnType = voidType2; + break; + case 171: + case 174: + case 175: + headMessage = ts2.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + var methodType = getTypeOfNode(node.parent); + var descriptorType = createTypedPropertyDescriptorType(methodType); + expectedReturnType = getUnionType([descriptorType, voidType2]); + break; + default: + return ts2.Debug.fail(); + } + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage); + } + function markTypeNodeAsReferenced(node) { + markEntityNameOrEntityExpressionAsReference( + node && ts2.getEntityNameFromTypeNode(node), + /*forDecoratorMetadata*/ + false + ); + } + function markEntityNameOrEntityExpressionAsReference(typeName, forDecoratorMetadata) { + if (!typeName) + return; + var rootName = ts2.getFirstIdentifier(typeName); + var meaning = (typeName.kind === 79 ? 788968 : 1920) | 2097152; + var rootSymbol = resolveName( + rootName, + rootName.escapedText, + meaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isReference*/ + true + ); + if (rootSymbol && rootSymbol.flags & 2097152) { + if (symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + markAliasSymbolAsReferenced(rootSymbol); + } else if (forDecoratorMetadata && compilerOptions.isolatedModules && ts2.getEmitModuleKind(compilerOptions) >= ts2.ModuleKind.ES2015 && !symbolIsValue(rootSymbol) && !ts2.some(rootSymbol.declarations, ts2.isTypeOnlyImportOrExportDeclaration)) { + var diag = error2(typeName, ts2.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); + var aliasDeclaration = ts2.find(rootSymbol.declarations || ts2.emptyArray, isAliasSymbolDeclaration); + if (aliasDeclaration) { + ts2.addRelatedInfo(diag, ts2.createDiagnosticForNode(aliasDeclaration, ts2.Diagnostics._0_was_imported_here, ts2.idText(rootName))); + } + } + } + } + function markDecoratorMedataDataTypeNodeAsReferenced(node) { + var entityName = getEntityNameForDecoratorMetadata(node); + if (entityName && ts2.isEntityName(entityName)) { + markEntityNameOrEntityExpressionAsReference( + entityName, + /*forDecoratorMetadata*/ + true + ); + } + } + function getEntityNameForDecoratorMetadata(node) { + if (node) { + switch (node.kind) { + case 190: + case 189: + return getEntityNameForDecoratorMetadataFromTypeList(node.types); + case 191: + return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); + case 193: + case 199: + return getEntityNameForDecoratorMetadata(node.type); + case 180: + return node.typeName; + } + } + } + function getEntityNameForDecoratorMetadataFromTypeList(types3) { + var commonEntityName; + for (var _i = 0, types_21 = types3; _i < types_21.length; _i++) { + var typeNode = types_21[_i]; + while (typeNode.kind === 193 || typeNode.kind === 199) { + typeNode = typeNode.type; + } + if (typeNode.kind === 144) { + continue; + } + if (!strictNullChecks && (typeNode.kind === 198 && typeNode.literal.kind === 104 || typeNode.kind === 155)) { + continue; + } + var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); + if (!individualEntityName) { + return void 0; + } + if (commonEntityName) { + if (!ts2.isIdentifier(commonEntityName) || !ts2.isIdentifier(individualEntityName) || commonEntityName.escapedText !== individualEntityName.escapedText) { + return void 0; + } + } else { + commonEntityName = individualEntityName; + } + } + return commonEntityName; + } + function getParameterTypeNodeForDecoratorCheck(node) { + var typeNode = ts2.getEffectiveTypeAnnotationNode(node); + return ts2.isRestParameter(node) ? ts2.getRestParameterElementType(typeNode) : typeNode; + } + function checkDecorators(node) { + if (!ts2.canHaveDecorators(node) || !ts2.hasDecorators(node) || !node.modifiers || !ts2.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + return; + } + if (!compilerOptions.experimentalDecorators) { + error2(node, ts2.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning); + } + var firstDecorator = ts2.find(node.modifiers, ts2.isDecorator); + if (!firstDecorator) { + return; + } + checkExternalEmitHelpers( + firstDecorator, + 8 + /* ExternalEmitHelpers.Decorate */ + ); + if (node.kind === 166) { + checkExternalEmitHelpers( + firstDecorator, + 32 + /* ExternalEmitHelpers.Param */ + ); + } + if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers( + firstDecorator, + 16 + /* ExternalEmitHelpers.Metadata */ + ); + switch (node.kind) { + case 260: + var constructor = ts2.getFirstConstructorWithBody(node); + if (constructor) { + for (var _i = 0, _a2 = constructor.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + } + break; + case 174: + case 175: + var otherKind = node.kind === 174 ? 175 : 174; + var otherAccessor = ts2.getDeclarationOfKind(getSymbolOfNode(node), otherKind); + markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); + break; + case 171: + for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + markDecoratorMedataDataTypeNodeAsReferenced(ts2.getEffectiveReturnTypeNode(node)); + break; + case 169: + markDecoratorMedataDataTypeNodeAsReferenced(ts2.getEffectiveTypeAnnotationNode(node)); + break; + case 166: + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + var containingSignature = node.parent; + for (var _d = 0, _e2 = containingSignature.parameters; _d < _e2.length; _d++) { + var parameter = _e2[_d]; + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + break; + } + } + for (var _f = 0, _g = node.modifiers; _f < _g.length; _f++) { + var modifier = _g[_f]; + if (ts2.isDecorator(modifier)) { + checkDecorator(modifier); + } + } + } + function checkFunctionDeclaration(node) { + addLazyDiagnostic(checkFunctionDeclarationDiagnostics); + function checkFunctionDeclarationDiagnostics() { + checkFunctionOrMethodDeclaration(node); + checkGrammarForGenerator(node); + checkCollisionsForDeclarationName(node, node.name); + } + } + function checkJSDocTypeAliasTag(node) { + if (!node.typeExpression) { + error2(node.name, ts2.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags); + } + if (node.name) { + checkTypeNameIsReserved(node.name, ts2.Diagnostics.Type_alias_name_cannot_be_0); + } + checkSourceElement(node.typeExpression); + checkTypeParameters(ts2.getEffectiveTypeParameterDeclarations(node)); + } + function checkJSDocTemplateTag(node) { + checkSourceElement(node.constraint); + for (var _i = 0, _a2 = node.typeParameters; _i < _a2.length; _i++) { + var tp = _a2[_i]; + checkSourceElement(tp); + } + } + function checkJSDocTypeTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocLinkLikeTag(node) { + if (node.name) { + resolveJSDocMemberName( + node.name, + /*ignoreErrors*/ + true + ); + } + } + function checkJSDocParameterTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocPropertyTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocFunctionType(node) { + addLazyDiagnostic(checkJSDocFunctionTypeImplicitAny); + checkSignatureDeclaration(node); + function checkJSDocFunctionTypeImplicitAny() { + if (!node.type && !ts2.isJSDocConstructSignature(node)) { + reportImplicitAny(node, anyType2); + } + } + } + function checkJSDocImplementsTag(node) { + var classLike = ts2.getEffectiveJSDocHost(node); + if (!classLike || !ts2.isClassDeclaration(classLike) && !ts2.isClassExpression(classLike)) { + error2(classLike, ts2.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts2.idText(node.tagName)); + } + } + function checkJSDocAugmentsTag(node) { + var classLike = ts2.getEffectiveJSDocHost(node); + if (!classLike || !ts2.isClassDeclaration(classLike) && !ts2.isClassExpression(classLike)) { + error2(classLike, ts2.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts2.idText(node.tagName)); + return; + } + var augmentsTags = ts2.getJSDocTags(classLike).filter(ts2.isJSDocAugmentsTag); + ts2.Debug.assert(augmentsTags.length > 0); + if (augmentsTags.length > 1) { + error2(augmentsTags[1], ts2.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); + } + var name2 = getIdentifierFromEntityNameExpression(node.class.expression); + var extend3 = ts2.getClassExtendsHeritageElement(classLike); + if (extend3) { + var className = getIdentifierFromEntityNameExpression(extend3.expression); + if (className && name2.escapedText !== className.escapedText) { + error2(name2, ts2.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, ts2.idText(node.tagName), ts2.idText(name2), ts2.idText(className)); + } + } + } + function checkJSDocAccessibilityModifiers(node) { + var host2 = ts2.getJSDocHost(node); + if (host2 && ts2.isPrivateIdentifierClassElementDeclaration(host2)) { + error2(node, ts2.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + } + } + function getIdentifierFromEntityNameExpression(node) { + switch (node.kind) { + case 79: + return node; + case 208: + return node.name; + default: + return void 0; + } + } + function checkFunctionOrMethodDeclaration(node) { + var _a2; + checkDecorators(node); + checkSignatureDeclaration(node); + var functionFlags = ts2.getFunctionFlags(node); + if (node.name && node.name.kind === 164) { + checkComputedPropertyName(node.name); + } + if (hasBindableName(node)) { + var symbol = getSymbolOfNode(node); + var localSymbol = node.localSymbol || symbol; + var firstDeclaration = (_a2 = localSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find( + // Get first non javascript function declaration + function(declaration) { + return declaration.kind === node.kind && !(declaration.flags & 262144); + } + ); + if (node === firstDeclaration) { + checkFunctionOrConstructorSymbol(localSymbol); + } + if (symbol.parent) { + checkFunctionOrConstructorSymbol(symbol); + } + } + var body = node.kind === 170 ? void 0 : node.body; + checkSourceElement(body); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); + addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics); + if (ts2.isInJSFile(node)) { + var typeTag = ts2.getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression && !getContextualCallSignature(getTypeFromTypeNode(typeTag.typeExpression), node)) { + error2(typeTag.typeExpression.type, ts2.Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature); + } + } + function checkFunctionOrMethodDeclarationDiagnostics() { + if (!ts2.getEffectiveReturnTypeNode(node)) { + if (ts2.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { + reportImplicitAny(node, anyType2); + } + if (functionFlags & 1 && ts2.nodeIsPresent(body)) { + getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + } + } + } + } + function registerForUnusedIdentifiersCheck(node) { + addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics); + function registerForUnusedIdentifiersCheckDiagnostics() { + var sourceFile = ts2.getSourceFileOfNode(node); + var potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); + if (!potentiallyUnusedIdentifiers) { + potentiallyUnusedIdentifiers = []; + allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers); + } + potentiallyUnusedIdentifiers.push(node); + } + } + function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { + for (var _i = 0, potentiallyUnusedIdentifiers_1 = potentiallyUnusedIdentifiers; _i < potentiallyUnusedIdentifiers_1.length; _i++) { + var node = potentiallyUnusedIdentifiers_1[_i]; + switch (node.kind) { + case 260: + case 228: + checkUnusedClassMembers(node, addDiagnostic); + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 308: + case 264: + case 238: + case 266: + case 245: + case 246: + case 247: + checkUnusedLocalsAndParameters(node, addDiagnostic); + break; + case 173: + case 215: + case 259: + case 216: + case 171: + case 174: + case 175: + if (node.body) { + checkUnusedLocalsAndParameters(node, addDiagnostic); + } + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 170: + case 176: + case 177: + case 181: + case 182: + case 262: + case 261: + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 192: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; + default: + ts2.Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); + } + } + } + function errorUnusedLocal(declaration, name2, addDiagnostic) { + var node = ts2.getNameOfDeclaration(declaration) || declaration; + var message = ts2.isTypeDeclaration(declaration) ? ts2.Diagnostics._0_is_declared_but_never_used : ts2.Diagnostics._0_is_declared_but_its_value_is_never_read; + addDiagnostic(declaration, 0, ts2.createDiagnosticForNode(node, message, name2)); + } + function isIdentifierThatStartsWithUnderscore(node) { + return ts2.isIdentifier(node) && ts2.idText(node).charCodeAt(0) === 95; + } + function checkUnusedClassMembers(node, addDiagnostic) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + switch (member.kind) { + case 171: + case 169: + case 174: + case 175: + if (member.kind === 175 && member.symbol.flags & 32768) { + break; + } + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && (ts2.hasEffectiveModifier( + member, + 8 + /* ModifierFlags.Private */ + ) || ts2.isNamedDeclaration(member) && ts2.isPrivateIdentifier(member.name)) && !(member.flags & 16777216)) { + addDiagnostic(member, 0, ts2.createDiagnosticForNode(member.name, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString2(symbol))); + } + break; + case 173: + for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { + var parameter = _c[_b]; + if (!parameter.symbol.isReferenced && ts2.hasSyntacticModifier( + parameter, + 8 + /* ModifierFlags.Private */ + )) { + addDiagnostic(parameter, 0, ts2.createDiagnosticForNode(parameter.name, ts2.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts2.symbolName(parameter.symbol))); + } + } + break; + case 178: + case 237: + case 172: + break; + default: + ts2.Debug.fail("Unexpected class member"); + } + } + } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + var typeParameter = node.typeParameter; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1, ts2.createDiagnosticForNode(node, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, ts2.idText(typeParameter.name))); + } + } + function checkUnusedTypeParameters(node, addDiagnostic) { + var declarations = getSymbolOfNode(node).declarations; + if (!declarations || ts2.last(declarations) !== node) + return; + var typeParameters = ts2.getEffectiveTypeParameterDeclarations(node); + var seenParentsWithEveryUnused = new ts2.Set(); + for (var _i = 0, typeParameters_4 = typeParameters; _i < typeParameters_4.length; _i++) { + var typeParameter = typeParameters_4[_i]; + if (!isTypeParameterUnused(typeParameter)) + continue; + var name2 = ts2.idText(typeParameter.name); + var parent2 = typeParameter.parent; + if (parent2.kind !== 192 && parent2.typeParameters.every(isTypeParameterUnused)) { + if (ts2.tryAddToSet(seenParentsWithEveryUnused, parent2)) { + var sourceFile = ts2.getSourceFileOfNode(parent2); + var range2 = ts2.isJSDocTemplateTag(parent2) ? ts2.rangeOfNode(parent2) : ts2.rangeOfTypeParameters(sourceFile, parent2.typeParameters); + var only = parent2.typeParameters.length === 1; + var message = only ? ts2.Diagnostics._0_is_declared_but_its_value_is_never_read : ts2.Diagnostics.All_type_parameters_are_unused; + var arg0 = only ? name2 : void 0; + addDiagnostic(typeParameter, 1, ts2.createFileDiagnostic(sourceFile, range2.pos, range2.end - range2.pos, message, arg0)); + } + } else { + addDiagnostic(typeParameter, 1, ts2.createDiagnosticForNode(typeParameter, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, name2)); + } + } + } + function isTypeParameterUnused(typeParameter) { + return !(getMergedSymbol(typeParameter.symbol).isReferenced & 262144) && !isIdentifierThatStartsWithUnderscore(typeParameter.name); + } + function addToGroup(map4, key, value2, getKey) { + var keyString = String(getKey(key)); + var group2 = map4.get(keyString); + if (group2) { + group2[1].push(value2); + } else { + map4.set(keyString, [key, [value2]]); + } + } + function tryGetRootParameterDeclaration(node) { + return ts2.tryCast(ts2.getRootDeclaration(node), ts2.isParameter); + } + function isValidUnusedLocalDeclaration(declaration) { + if (ts2.isBindingElement(declaration)) { + if (ts2.isObjectBindingPattern(declaration.parent)) { + return !!(declaration.propertyName && isIdentifierThatStartsWithUnderscore(declaration.name)); + } + return isIdentifierThatStartsWithUnderscore(declaration.name); + } + return ts2.isAmbientModule(declaration) || (ts2.isVariableDeclaration(declaration) && ts2.isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderscore(declaration.name); + } + function checkUnusedLocalsAndParameters(nodeWithLocals, addDiagnostic) { + var unusedImports = new ts2.Map(); + var unusedDestructures = new ts2.Map(); + var unusedVariables = new ts2.Map(); + nodeWithLocals.locals.forEach(function(local) { + if (local.flags & 262144 ? !(local.flags & 3 && !(local.isReferenced & 3)) : local.isReferenced || local.exportSymbol) { + return; + } + if (local.declarations) { + for (var _i = 0, _a2 = local.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (isValidUnusedLocalDeclaration(declaration)) { + continue; + } + if (isImportedDeclaration(declaration)) { + addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId); + } else if (ts2.isBindingElement(declaration) && ts2.isObjectBindingPattern(declaration.parent)) { + var lastElement = ts2.last(declaration.parent.elements); + if (declaration === lastElement || !ts2.last(declaration.parent.elements).dotDotDotToken) { + addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); + } + } else if (ts2.isVariableDeclaration(declaration)) { + addToGroup(unusedVariables, declaration.parent, declaration, getNodeId); + } else { + var parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration); + var name2 = local.valueDeclaration && ts2.getNameOfDeclaration(local.valueDeclaration); + if (parameter && name2) { + if (!ts2.isParameterPropertyDeclaration(parameter, parameter.parent) && !ts2.parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name2)) { + if (ts2.isBindingElement(declaration) && ts2.isArrayBindingPattern(declaration.parent)) { + addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); + } else { + addDiagnostic(parameter, 1, ts2.createDiagnosticForNode(name2, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, ts2.symbolName(local))); + } + } + } else { + errorUnusedLocal(declaration, ts2.symbolName(local), addDiagnostic); + } + } + } + } + }); + unusedImports.forEach(function(_a2) { + var importClause = _a2[0], unuseds = _a2[1]; + var importDecl = importClause.parent; + var nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 271 ? 1 : importClause.namedBindings.elements.length : 0); + if (nDeclarations === unuseds.length) { + addDiagnostic(importDecl, 0, unuseds.length === 1 ? ts2.createDiagnosticForNode(importDecl, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, ts2.idText(ts2.first(unuseds).name)) : ts2.createDiagnosticForNode(importDecl, ts2.Diagnostics.All_imports_in_import_declaration_are_unused)); + } else { + for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) { + var unused = unuseds_1[_i]; + errorUnusedLocal(unused, ts2.idText(unused.name), addDiagnostic); + } + } + }); + unusedDestructures.forEach(function(_a2) { + var bindingPattern = _a2[0], bindingElements = _a2[1]; + var kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0; + if (bindingPattern.elements.length === bindingElements.length) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 257 && bindingPattern.parent.parent.kind === 258) { + addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); + } else { + addDiagnostic(bindingPattern, kind, bindingElements.length === 1 ? ts2.createDiagnosticForNode(bindingPattern, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts2.first(bindingElements).name)) : ts2.createDiagnosticForNode(bindingPattern, ts2.Diagnostics.All_destructured_elements_are_unused)); + } + } else { + for (var _i = 0, bindingElements_1 = bindingElements; _i < bindingElements_1.length; _i++) { + var e10 = bindingElements_1[_i]; + addDiagnostic(e10, kind, ts2.createDiagnosticForNode(e10, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(e10.name))); + } + } + }); + unusedVariables.forEach(function(_a2) { + var declarationList = _a2[0], declarations = _a2[1]; + if (declarationList.declarations.length === declarations.length) { + addDiagnostic(declarationList, 0, declarations.length === 1 ? ts2.createDiagnosticForNode(ts2.first(declarations).name, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(ts2.first(declarations).name)) : ts2.createDiagnosticForNode(declarationList.parent.kind === 240 ? declarationList.parent : declarationList, ts2.Diagnostics.All_variables_are_unused)); + } else { + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var decl = declarations_6[_i]; + addDiagnostic(decl, 0, ts2.createDiagnosticForNode(decl, ts2.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name))); + } + } + }); + } + function checkPotentialUncheckedRenamedBindingElementsInTypes() { + var _a2; + for (var _i = 0, potentialUnusedRenamedBindingElementsInTypes_1 = potentialUnusedRenamedBindingElementsInTypes; _i < potentialUnusedRenamedBindingElementsInTypes_1.length; _i++) { + var node = potentialUnusedRenamedBindingElementsInTypes_1[_i]; + if (!((_a2 = getSymbolOfNode(node)) === null || _a2 === void 0 ? void 0 : _a2.isReferenced)) { + var wrappingDeclaration = ts2.walkUpBindingElementsAndPatterns(node); + ts2.Debug.assert(ts2.isParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here"); + var diagnostic = ts2.createDiagnosticForNode(node.name, ts2.Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, ts2.declarationNameToString(node.name), ts2.declarationNameToString(node.propertyName)); + if (!wrappingDeclaration.type) { + ts2.addRelatedInfo(diagnostic, ts2.createFileDiagnostic(ts2.getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, ts2.Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, ts2.declarationNameToString(node.propertyName))); + } + diagnostics.add(diagnostic); + } + } + } + function bindingNameText(name2) { + switch (name2.kind) { + case 79: + return ts2.idText(name2); + case 204: + case 203: + return bindingNameText(ts2.cast(ts2.first(name2.elements), ts2.isBindingElement).name); + default: + return ts2.Debug.assertNever(name2); + } + } + function isImportedDeclaration(node) { + return node.kind === 270 || node.kind === 273 || node.kind === 271; + } + function importClauseFromImported(decl) { + return decl.kind === 270 ? decl : decl.kind === 271 ? decl.parent : decl.parent.parent; + } + function checkBlock(node) { + if (node.kind === 238) { + checkGrammarStatementInAmbientContext(node); + } + if (ts2.isFunctionOrModuleBlock(node)) { + var saveFlowAnalysisDisabled = flowAnalysisDisabled; + ts2.forEach(node.statements, checkSourceElement); + flowAnalysisDisabled = saveFlowAnalysisDisabled; + } else { + ts2.forEach(node.statements, checkSourceElement); + } + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkCollisionWithArgumentsInGeneratedCode(node) { + if (languageVersion >= 2 || !ts2.hasRestParameter(node) || node.flags & 16777216 || ts2.nodeIsMissing(node.body)) { + return; + } + ts2.forEach(node.parameters, function(p7) { + if (p7.name && !ts2.isBindingPattern(p7.name) && p7.name.escapedText === argumentsSymbol.escapedName) { + errorSkippedOn("noEmit", p7, ts2.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + } + }); + } + function needCollisionCheckForIdentifier(node, identifier, name2) { + if ((identifier === null || identifier === void 0 ? void 0 : identifier.escapedText) !== name2) { + return false; + } + if (node.kind === 169 || node.kind === 168 || node.kind === 171 || node.kind === 170 || node.kind === 174 || node.kind === 175 || node.kind === 299) { + return false; + } + if (node.flags & 16777216) { + return false; + } + if (ts2.isImportClause(node) || ts2.isImportEqualsDeclaration(node) || ts2.isImportSpecifier(node)) { + if (ts2.isTypeOnlyImportOrExportDeclaration(node)) { + return false; + } + } + var root2 = ts2.getRootDeclaration(node); + if (ts2.isParameter(root2) && ts2.nodeIsMissing(root2.parent.body)) { + return false; + } + return true; + } + function checkIfThisIsCapturedInEnclosingScope(node) { + ts2.findAncestor(node, function(current) { + if (getNodeCheckFlags(current) & 4) { + var isDeclaration_1 = node.kind !== 79; + if (isDeclaration_1) { + error2(ts2.getNameOfDeclaration(node), ts2.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); + } else { + error2(node, ts2.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); + } + return true; + } + return false; + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + ts2.findAncestor(node, function(current) { + if (getNodeCheckFlags(current) & 8) { + var isDeclaration_2 = node.kind !== 79; + if (isDeclaration_2) { + error2(ts2.getNameOfDeclaration(node), ts2.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } else { + error2(node, ts2.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + return false; + }); + } + function checkCollisionWithRequireExportsInGeneratedCode(node, name2) { + if (moduleKind >= ts2.ModuleKind.ES2015 && !(moduleKind >= ts2.ModuleKind.Node16 && ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS)) { + return; + } + if (!name2 || !needCollisionCheckForIdentifier(node, name2, "require") && !needCollisionCheckForIdentifier(node, name2, "exports")) { + return; + } + if (ts2.isModuleDeclaration(node) && ts2.getModuleInstanceState(node) !== 1) { + return; + } + var parent2 = getDeclarationContainer(node); + if (parent2.kind === 308 && ts2.isExternalOrCommonJsModule(parent2)) { + errorSkippedOn("noEmit", name2, ts2.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts2.declarationNameToString(name2), ts2.declarationNameToString(name2)); + } + } + function checkCollisionWithGlobalPromiseInGeneratedCode(node, name2) { + if (!name2 || languageVersion >= 4 || !needCollisionCheckForIdentifier(node, name2, "Promise")) { + return; + } + if (ts2.isModuleDeclaration(node) && ts2.getModuleInstanceState(node) !== 1) { + return; + } + var parent2 = getDeclarationContainer(node); + if (parent2.kind === 308 && ts2.isExternalOrCommonJsModule(parent2) && parent2.flags & 2048) { + errorSkippedOn("noEmit", name2, ts2.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts2.declarationNameToString(name2), ts2.declarationNameToString(name2)); + } + } + function recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name2) { + if (languageVersion <= 8 && (needCollisionCheckForIdentifier(node, name2, "WeakMap") || needCollisionCheckForIdentifier(node, name2, "WeakSet"))) { + potentialWeakMapSetCollisions.push(node); + } + } + function checkWeakMapSetCollision(node) { + var enclosingBlockScope = ts2.getEnclosingBlockScopeContainer(node); + if (getNodeCheckFlags(enclosingBlockScope) & 67108864) { + ts2.Debug.assert(ts2.isNamedDeclaration(node) && ts2.isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier"); + errorSkippedOn("noEmit", node, ts2.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText); + } + } + function recordPotentialCollisionWithReflectInGeneratedCode(node, name2) { + if (name2 && languageVersion >= 2 && languageVersion <= 8 && needCollisionCheckForIdentifier(node, name2, "Reflect")) { + potentialReflectCollisions.push(node); + } + } + function checkReflectCollision(node) { + var hasCollision = false; + if (ts2.isClassExpression(node)) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (getNodeCheckFlags(member) & 134217728) { + hasCollision = true; + break; + } + } + } else if (ts2.isFunctionExpression(node)) { + if (getNodeCheckFlags(node) & 134217728) { + hasCollision = true; + } + } else { + var container = ts2.getEnclosingBlockScopeContainer(node); + if (container && getNodeCheckFlags(container) & 134217728) { + hasCollision = true; + } + } + if (hasCollision) { + ts2.Debug.assert(ts2.isNamedDeclaration(node) && ts2.isIdentifier(node.name), "The target of a Reflect collision check should be an identifier"); + errorSkippedOn("noEmit", node, ts2.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, ts2.declarationNameToString(node.name), "Reflect"); + } + } + function checkCollisionsForDeclarationName(node, name2) { + if (!name2) + return; + checkCollisionWithRequireExportsInGeneratedCode(node, name2); + checkCollisionWithGlobalPromiseInGeneratedCode(node, name2); + recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name2); + recordPotentialCollisionWithReflectInGeneratedCode(node, name2); + if (ts2.isClassLike(node)) { + checkTypeNameIsReserved(name2, ts2.Diagnostics.Class_name_cannot_be_0); + if (!(node.flags & 16777216)) { + checkClassNameCollisionWithObject(name2); + } + } else if (ts2.isEnumDeclaration(node)) { + checkTypeNameIsReserved(name2, ts2.Diagnostics.Enum_name_cannot_be_0); + } + } + function checkVarDeclaredNamesNotShadowed(node) { + if ((ts2.getCombinedNodeFlags(node) & 3) !== 0 || ts2.isParameterDeclaration(node)) { + return; + } + if (node.kind === 257 && !node.initializer) { + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 1) { + if (!ts2.isIdentifier(node.name)) + return ts2.Debug.fail(); + var localDeclarationSymbol = resolveName( + node, + node.name.escapedText, + 3, + /*nodeNotFoundErrorMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { + if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { + var varDeclList = ts2.getAncestor( + localDeclarationSymbol.valueDeclaration, + 258 + /* SyntaxKind.VariableDeclarationList */ + ); + var container = varDeclList.parent.kind === 240 && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; + var namesShareScope = container && (container.kind === 238 && ts2.isFunctionLike(container.parent) || container.kind === 265 || container.kind === 264 || container.kind === 308); + if (!namesShareScope) { + var name2 = symbolToString2(localDeclarationSymbol); + error2(node, ts2.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name2, name2); + } + } + } + } + } + function convertAutoToAny(type3) { + return type3 === autoType ? anyType2 : type3 === autoArrayType ? anyArrayType : type3; + } + function checkVariableLikeDeclaration(node) { + var _a2; + checkDecorators(node); + if (!ts2.isBindingElement(node)) { + checkSourceElement(node.type); + } + if (!node.name) { + return; + } + if (node.name.kind === 164) { + checkComputedPropertyName(node.name); + if (ts2.hasOnlyExpressionInitializer(node) && node.initializer) { + checkExpressionCached(node.initializer); + } + } + if (ts2.isBindingElement(node)) { + if (node.propertyName && ts2.isIdentifier(node.name) && ts2.isParameterDeclaration(node) && ts2.nodeIsMissing(ts2.getContainingFunction(node).body)) { + potentialUnusedRenamedBindingElementsInTypes.push(node); + return; + } + if (ts2.isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5) { + checkExternalEmitHelpers( + node, + 4 + /* ExternalEmitHelpers.Rest */ + ); + } + if (node.propertyName && node.propertyName.kind === 164) { + checkComputedPropertyName(node.propertyName); + } + var parent2 = node.parent.parent; + var parentCheckMode = node.dotDotDotToken ? 64 : 0; + var parentType = getTypeForBindingElementParent(parent2, parentCheckMode); + var name2 = node.propertyName || node.name; + if (parentType && !ts2.isBindingPattern(name2)) { + var exprType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(exprType)) { + var nameText = getPropertyNameFromType(exprType); + var property2 = getPropertyOfType(parentType, nameText); + if (property2) { + markPropertyAsReferenced( + property2, + /*nodeForCheckWriteOnly*/ + void 0, + /*isSelfTypeAccess*/ + false + ); + checkPropertyAccessibility( + node, + !!parent2.initializer && parent2.initializer.kind === 106, + /*writing*/ + false, + parentType, + property2 + ); + } + } + } + } + if (ts2.isBindingPattern(node.name)) { + if (node.name.kind === 204 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 512 + /* ExternalEmitHelpers.Read */ + ); + } + ts2.forEach(node.name.elements, checkSourceElement); + } + if (ts2.isParameter(node) && node.initializer && ts2.nodeIsMissing(ts2.getContainingFunction(node).body)) { + error2(node, ts2.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + return; + } + if (ts2.isBindingPattern(node.name)) { + var needCheckInitializer = ts2.hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 246; + var needCheckWidenedType = !ts2.some(node.name.elements, ts2.not(ts2.isOmittedExpression)); + if (needCheckInitializer || needCheckWidenedType) { + var widenedType = getWidenedTypeForVariableLikeDeclaration(node); + if (needCheckInitializer) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && needCheckWidenedType) { + checkNonNullNonVoidType(initializerType, node); + } else { + checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); + } + } + if (needCheckWidenedType) { + if (ts2.isArrayBindingPattern(node.name)) { + checkIteratedTypeOrElementType(65, widenedType, undefinedType2, node); + } else if (strictNullChecks) { + checkNonNullNonVoidType(widenedType, node); + } + } + } + return; + } + var symbol = getSymbolOfNode(node); + if (symbol.flags & 2097152 && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 205 ? node.parent.parent : node)) { + checkAliasSymbol(node); + return; + } + var type3 = convertAutoToAny(getTypeOfSymbol(symbol)); + if (node === symbol.valueDeclaration) { + var initializer = ts2.hasOnlyExpressionInitializer(node) && ts2.getEffectiveInitializer(node); + if (initializer) { + var isJSObjectLiteralInitializer = ts2.isInJSFile(node) && ts2.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || ts2.isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) === null || _a2 === void 0 ? void 0 : _a2.size); + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 246) { + checkTypeAssignableToAndOptionallyElaborate( + checkExpressionCached(initializer), + type3, + node, + initializer, + /*headMessage*/ + void 0 + ); + } + } + if (symbol.declarations && symbol.declarations.length > 1) { + if (ts2.some(symbol.declarations, function(d7) { + return d7 !== node && ts2.isVariableLike(d7) && !areDeclarationFlagsIdentical(d7, node); + })) { + error2(node.name, ts2.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts2.declarationNameToString(node.name)); + } + } + } else { + var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node)); + if (!isErrorType(type3) && !isErrorType(declarationType) && !isTypeIdenticalTo(type3, declarationType) && !(symbol.flags & 67108864)) { + errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type3, node, declarationType); + } + if (ts2.hasOnlyExpressionInitializer(node) && node.initializer) { + checkTypeAssignableToAndOptionallyElaborate( + checkExpressionCached(node.initializer), + declarationType, + node, + node.initializer, + /*headMessage*/ + void 0 + ); + } + if (symbol.valueDeclaration && !areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { + error2(node.name, ts2.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts2.declarationNameToString(node.name)); + } + } + if (node.kind !== 169 && node.kind !== 168) { + checkExportsOnMergedDeclarations(node); + if (node.kind === 257 || node.kind === 205) { + checkVarDeclaredNamesNotShadowed(node); + } + checkCollisionsForDeclarationName(node, node.name); + } + } + function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { + var nextDeclarationName = ts2.getNameOfDeclaration(nextDeclaration); + var message = nextDeclaration.kind === 169 || nextDeclaration.kind === 168 ? ts2.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts2.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; + var declName = ts2.declarationNameToString(nextDeclarationName); + var err = error2(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType)); + if (firstDeclaration) { + ts2.addRelatedInfo(err, ts2.createDiagnosticForNode(firstDeclaration, ts2.Diagnostics._0_was_also_declared_here, declName)); + } + } + function areDeclarationFlagsIdentical(left, right) { + if (left.kind === 166 && right.kind === 257 || left.kind === 257 && right.kind === 166) { + return true; + } + if (ts2.hasQuestionToken(left) !== ts2.hasQuestionToken(right)) { + return false; + } + var interestingFlags = 8 | 16 | 512 | 256 | 64 | 32; + return ts2.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts2.getSelectedEffectiveModifierFlags(right, interestingFlags); + } + function checkVariableDeclaration(node) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + checkGrammarVariableDeclaration(node); + checkVariableLikeDeclaration(node); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + function checkBindingElement(node) { + checkGrammarBindingElement(node); + return checkVariableLikeDeclaration(node); + } + function checkVariableStatement(node) { + if (!checkGrammarDecoratorsAndModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + checkGrammarForDisallowedLetOrConstStatement(node); + ts2.forEach(node.declarationList.declarations, checkSourceElement); + } + function checkExpressionStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkExpression(node.expression); + } + function checkIfStatement(node) { + checkGrammarStatementInAmbientContext(node); + var type3 = checkTruthinessExpression(node.expression); + checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type3, node.thenStatement); + checkSourceElement(node.thenStatement); + if (node.thenStatement.kind === 239) { + error2(node.thenStatement, ts2.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); + } + checkSourceElement(node.elseStatement); + } + function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { + if (!strictNullChecks) + return; + helper(condExpr, body); + while (ts2.isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56) { + condExpr = condExpr.left; + helper(condExpr, body); + } + function helper(condExpr2, body2) { + var location2 = ts2.isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 56 || condExpr2.operatorToken.kind === 55) ? condExpr2.right : condExpr2; + if (ts2.isModuleExportsAccessExpression(location2)) + return; + var type3 = location2 === condExpr2 ? condType : checkTruthinessExpression(location2); + var isPropertyExpressionCast = ts2.isPropertyAccessExpression(location2) && isTypeAssertion(location2.expression); + if (!(getTypeFacts(type3) & 4194304) || isPropertyExpressionCast) + return; + var callSignatures = getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + var isPromise = !!getAwaitedTypeOfPromise(type3); + if (callSignatures.length === 0 && !isPromise) { + return; + } + var testedNode = ts2.isIdentifier(location2) ? location2 : ts2.isPropertyAccessExpression(location2) ? location2.name : ts2.isBinaryExpression(location2) && ts2.isIdentifier(location2.right) ? location2.right : void 0; + var testedSymbol = testedNode && getSymbolAtLocation(testedNode); + if (!testedSymbol && !isPromise) { + return; + } + var isUsed = testedSymbol && ts2.isBinaryExpression(condExpr2.parent) && isSymbolUsedInBinaryExpressionChain(condExpr2.parent, testedSymbol) || testedSymbol && body2 && isSymbolUsedInConditionBody(condExpr2, body2, testedNode, testedSymbol); + if (!isUsed) { + if (isPromise) { + errorAndMaybeSuggestAwait( + location2, + /*maybeMissingAwait*/ + true, + ts2.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, + getTypeNameForErrorDisplay(type3) + ); + } else { + error2(location2, ts2.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead); + } + } + } + } + function isSymbolUsedInConditionBody(expr, body, testedNode, testedSymbol) { + return !!ts2.forEachChild(body, function check(childNode) { + if (ts2.isIdentifier(childNode)) { + var childSymbol = getSymbolAtLocation(childNode); + if (childSymbol && childSymbol === testedSymbol) { + if (ts2.isIdentifier(expr) || ts2.isIdentifier(testedNode) && ts2.isBinaryExpression(testedNode.parent)) { + return true; + } + var testedExpression = testedNode.parent; + var childExpression = childNode.parent; + while (testedExpression && childExpression) { + if (ts2.isIdentifier(testedExpression) && ts2.isIdentifier(childExpression) || testedExpression.kind === 108 && childExpression.kind === 108) { + return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression); + } else if (ts2.isPropertyAccessExpression(testedExpression) && ts2.isPropertyAccessExpression(childExpression)) { + if (getSymbolAtLocation(testedExpression.name) !== getSymbolAtLocation(childExpression.name)) { + return false; + } + childExpression = childExpression.expression; + testedExpression = testedExpression.expression; + } else if (ts2.isCallExpression(testedExpression) && ts2.isCallExpression(childExpression)) { + childExpression = childExpression.expression; + testedExpression = testedExpression.expression; + } else { + return false; + } + } + } + } + return ts2.forEachChild(childNode, check); + }); + } + function isSymbolUsedInBinaryExpressionChain(node, testedSymbol) { + while (ts2.isBinaryExpression(node) && node.operatorToken.kind === 55) { + var isUsed = ts2.forEachChild(node.right, function visit7(child) { + if (ts2.isIdentifier(child)) { + var symbol = getSymbolAtLocation(child); + if (symbol && symbol === testedSymbol) { + return true; + } + } + return ts2.forEachChild(child, visit7); + }); + if (isUsed) { + return true; + } + node = node.parent; + } + return false; + } + function checkDoStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkSourceElement(node.statement); + checkTruthinessExpression(node.expression); + } + function checkWhileStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkTruthinessExpression(node.expression); + checkSourceElement(node.statement); + } + function checkTruthinessOfType(type3, node) { + if (type3.flags & 16384) { + error2(node, ts2.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness); + } + return type3; + } + function checkTruthinessExpression(node, checkMode) { + return checkTruthinessOfType(checkExpression(node, checkMode), node); + } + function checkForStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (node.initializer && node.initializer.kind === 258) { + checkGrammarVariableDeclarationList(node.initializer); + } + } + if (node.initializer) { + if (node.initializer.kind === 258) { + ts2.forEach(node.initializer.declarations, checkVariableDeclaration); + } else { + checkExpression(node.initializer); + } + } + if (node.condition) + checkTruthinessExpression(node.condition); + if (node.incrementor) + checkExpression(node.incrementor); + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkForOfStatement(node) { + checkGrammarForInOrForOfStatement(node); + var container = ts2.getContainingFunctionOrClassStaticBlock(node); + if (node.awaitModifier) { + if (container && ts2.isClassStaticBlockDeclaration(container)) { + grammarErrorOnNode(node.awaitModifier, ts2.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block); + } else { + var functionFlags = ts2.getFunctionFlags(container); + if ((functionFlags & (4 | 2)) === 2 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 16384 + /* ExternalEmitHelpers.ForAwaitOfIncludes */ + ); + } + } + } else if (compilerOptions.downlevelIteration && languageVersion < 2) { + checkExternalEmitHelpers( + node, + 256 + /* ExternalEmitHelpers.ForOfIncludes */ + ); + } + if (node.initializer.kind === 258) { + checkForInOrForOfVariableDeclaration(node); + } else { + var varExpr = node.initializer; + var iteratedType = checkRightHandSideOfForOf(node); + if (varExpr.kind === 206 || varExpr.kind === 207) { + checkDestructuringAssignment(varExpr, iteratedType || errorType); + } else { + var leftType = checkExpression(varExpr); + checkReferenceExpression(varExpr, ts2.Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access, ts2.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access); + if (iteratedType) { + checkTypeAssignableToAndOptionallyElaborate(iteratedType, leftType, varExpr, node.expression); + } + } + } + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkForInStatement(node) { + checkGrammarForInOrForOfStatement(node); + var rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); + if (node.initializer.kind === 258) { + var variable = node.initializer.declarations[0]; + if (variable && ts2.isBindingPattern(variable.name)) { + error2(variable.name, ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + } + checkForInOrForOfVariableDeclaration(node); + } else { + var varExpr = node.initializer; + var leftType = checkExpression(varExpr); + if (varExpr.kind === 206 || varExpr.kind === 207) { + error2(varExpr, ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { + error2(varExpr, ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); + } else { + checkReferenceExpression(varExpr, ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access); + } + } + if (rightType === neverType2 || !isTypeAssignableToKind( + rightType, + 67108864 | 58982400 + /* TypeFlags.InstantiableNonPrimitive */ + )) { + error2(node.expression, ts2.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); + } + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkForInOrForOfVariableDeclaration(iterationStatement) { + var variableDeclarationList = iterationStatement.initializer; + if (variableDeclarationList.declarations.length >= 1) { + var decl = variableDeclarationList.declarations[0]; + checkVariableDeclaration(decl); + } + } + function checkRightHandSideOfForOf(statement) { + var use = statement.awaitModifier ? 15 : 13; + return checkIteratedTypeOrElementType(use, checkNonNullExpression(statement.expression), undefinedType2, statement.expression); + } + function checkIteratedTypeOrElementType(use, inputType, sentType, errorNode) { + if (isTypeAny(inputType)) { + return inputType; + } + return getIteratedTypeOrElementType( + use, + inputType, + sentType, + errorNode, + /*checkAssignability*/ + true + ) || anyType2; + } + function getIteratedTypeOrElementType(use, inputType, sentType, errorNode, checkAssignability) { + var allowAsyncIterables = (use & 2) !== 0; + if (inputType === neverType2) { + reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables); + return void 0; + } + var uplevelIteration = languageVersion >= 2; + var downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + var possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128); + if (uplevelIteration || downlevelIteration || allowAsyncIterables) { + var iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0); + if (checkAssignability) { + if (iterationTypes) { + var diagnostic = use & 8 ? ts2.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 : use & 32 ? ts2.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 : use & 64 ? ts2.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 : use & 16 ? ts2.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 : void 0; + if (diagnostic) { + checkTypeAssignableTo(sentType, iterationTypes.nextType, errorNode, diagnostic); + } + } + } + if (iterationTypes || uplevelIteration) { + return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : iterationTypes && iterationTypes.yieldType; + } + } + var arrayType2 = inputType; + var reportedError = false; + var hasStringConstituent = false; + if (use & 4) { + if (arrayType2.flags & 1048576) { + var arrayTypes = inputType.types; + var filteredTypes = ts2.filter(arrayTypes, function(t8) { + return !(t8.flags & 402653316); + }); + if (filteredTypes !== arrayTypes) { + arrayType2 = getUnionType( + filteredTypes, + 2 + /* UnionReduction.Subtype */ + ); + } + } else if (arrayType2.flags & 402653316) { + arrayType2 = neverType2; + } + hasStringConstituent = arrayType2 !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + if (arrayType2.flags & 131072) { + return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType2) : stringType2; + } + } + } + if (!isArrayLikeType(arrayType2)) { + if (errorNode && !reportedError) { + var allowsStrings = !!(use & 4) && !hasStringConstituent; + var _a2 = getIterationDiagnosticDetails(allowsStrings, downlevelIteration), defaultDiagnostic = _a2[0], maybeMissingAwait = _a2[1]; + errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType2), defaultDiagnostic, typeToString(arrayType2)); + } + return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType2) : stringType2 : void 0; + } + var arrayElementType = getIndexTypeOfType(arrayType2, numberType2); + if (hasStringConstituent && arrayElementType) { + if (arrayElementType.flags & 402653316 && !compilerOptions.noUncheckedIndexedAccess) { + return stringType2; + } + return getUnionType( + possibleOutOfBounds ? [arrayElementType, stringType2, undefinedType2] : [arrayElementType, stringType2], + 2 + /* UnionReduction.Subtype */ + ); + } + return use & 128 ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + function getIterationDiagnosticDetails(allowsStrings2, downlevelIteration2) { + var _a3; + if (downlevelIteration2) { + return allowsStrings2 ? [ts2.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : [ts2.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]; + } + var yieldType = getIterationTypeOfIterable( + use, + 0, + inputType, + /*errorNode*/ + void 0 + ); + if (yieldType) { + return [ts2.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false]; + } + if (isES2015OrLaterIterable((_a3 = inputType.symbol) === null || _a3 === void 0 ? void 0 : _a3.escapedName)) { + return [ts2.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true]; + } + return allowsStrings2 ? [ts2.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [ts2.Diagnostics.Type_0_is_not_an_array_type, true]; + } + } + function isES2015OrLaterIterable(n7) { + switch (n7) { + case "Float32Array": + case "Float64Array": + case "Int16Array": + case "Int32Array": + case "Int8Array": + case "NodeList": + case "Uint16Array": + case "Uint32Array": + case "Uint8Array": + case "Uint8ClampedArray": + return true; + } + return false; + } + function getIterationTypeOfIterable(use, typeKind, inputType, errorNode) { + if (isTypeAny(inputType)) { + return void 0; + } + var iterationTypes = getIterationTypesOfIterable(inputType, use, errorNode); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(typeKind)]; + } + function createIterationTypes(yieldType, returnType, nextType) { + if (yieldType === void 0) { + yieldType = neverType2; + } + if (returnType === void 0) { + returnType = neverType2; + } + if (nextType === void 0) { + nextType = unknownType2; + } + if (yieldType.flags & 67359327 && returnType.flags & (1 | 131072 | 2 | 16384 | 32768) && nextType.flags & (1 | 131072 | 2 | 16384 | 32768)) { + var id = getTypeListId([yieldType, returnType, nextType]); + var iterationTypes = iterationTypesCache.get(id); + if (!iterationTypes) { + iterationTypes = { yieldType, returnType, nextType }; + iterationTypesCache.set(id, iterationTypes); + } + return iterationTypes; + } + return { yieldType, returnType, nextType }; + } + function combineIterationTypes(array) { + var yieldTypes; + var returnTypes; + var nextTypes; + for (var _i = 0, array_11 = array; _i < array_11.length; _i++) { + var iterationTypes = array_11[_i]; + if (iterationTypes === void 0 || iterationTypes === noIterationTypes) { + continue; + } + if (iterationTypes === anyIterationTypes) { + return anyIterationTypes; + } + yieldTypes = ts2.append(yieldTypes, iterationTypes.yieldType); + returnTypes = ts2.append(returnTypes, iterationTypes.returnType); + nextTypes = ts2.append(nextTypes, iterationTypes.nextType); + } + if (yieldTypes || returnTypes || nextTypes) { + return createIterationTypes(yieldTypes && getUnionType(yieldTypes), returnTypes && getUnionType(returnTypes), nextTypes && getIntersectionType(nextTypes)); + } + return noIterationTypes; + } + function getCachedIterationTypes(type3, cacheKey) { + return type3[cacheKey]; + } + function setCachedIterationTypes(type3, cacheKey, cachedTypes2) { + return type3[cacheKey] = cachedTypes2; + } + function getIterationTypesOfIterable(type3, use, errorNode) { + var _a2, _b; + if (isTypeAny(type3)) { + return anyIterationTypes; + } + if (!(type3.flags & 1048576)) { + var errorOutputContainer = errorNode ? { errors: void 0 } : void 0; + var iterationTypes_1 = getIterationTypesOfIterableWorker(type3, use, errorNode, errorOutputContainer); + if (iterationTypes_1 === noIterationTypes) { + if (errorNode) { + var rootDiag = reportTypeNotIterableError(errorNode, type3, !!(use & 2)); + if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) { + ts2.addRelatedInfo.apply(void 0, __spreadArray9([rootDiag], errorOutputContainer.errors, false)); + } + } + return void 0; + } else if ((_a2 = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _a2 === void 0 ? void 0 : _a2.length) { + for (var _i = 0, _c = errorOutputContainer.errors; _i < _c.length; _i++) { + var diag = _c[_i]; + diagnostics.add(diag); + } + } + return iterationTypes_1; + } + var cacheKey = use & 2 ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable"; + var cachedTypes2 = getCachedIterationTypes(type3, cacheKey); + if (cachedTypes2) + return cachedTypes2 === noIterationTypes ? void 0 : cachedTypes2; + var allIterationTypes; + for (var _d = 0, _e2 = type3.types; _d < _e2.length; _d++) { + var constituent = _e2[_d]; + var errorOutputContainer = errorNode ? { errors: void 0 } : void 0; + var iterationTypes_2 = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer); + if (iterationTypes_2 === noIterationTypes) { + if (errorNode) { + var rootDiag = reportTypeNotIterableError(errorNode, type3, !!(use & 2)); + if (errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) { + ts2.addRelatedInfo.apply(void 0, __spreadArray9([rootDiag], errorOutputContainer.errors, false)); + } + } + setCachedIterationTypes(type3, cacheKey, noIterationTypes); + return void 0; + } else if ((_b = errorOutputContainer === null || errorOutputContainer === void 0 ? void 0 : errorOutputContainer.errors) === null || _b === void 0 ? void 0 : _b.length) { + for (var _f = 0, _g = errorOutputContainer.errors; _f < _g.length; _f++) { + var diag = _g[_f]; + diagnostics.add(diag); + } + } + allIterationTypes = ts2.append(allIterationTypes, iterationTypes_2); + } + var iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes; + setCachedIterationTypes(type3, cacheKey, iterationTypes); + return iterationTypes === noIterationTypes ? void 0 : iterationTypes; + } + function getAsyncFromSyncIterationTypes(iterationTypes, errorNode) { + if (iterationTypes === noIterationTypes) + return noIterationTypes; + if (iterationTypes === anyIterationTypes) + return anyIterationTypes; + var yieldType = iterationTypes.yieldType, returnType = iterationTypes.returnType, nextType = iterationTypes.nextType; + if (errorNode) { + getGlobalAwaitedSymbol( + /*reportErrors*/ + true + ); + } + return createIterationTypes(getAwaitedType(yieldType, errorNode) || anyType2, getAwaitedType(returnType, errorNode) || anyType2, nextType); + } + function getIterationTypesOfIterableWorker(type3, use, errorNode, errorOutputContainer) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + var noCache = false; + if (use & 2) { + var iterationTypes = getIterationTypesOfIterableCached(type3, asyncIterationTypesResolver) || getIterationTypesOfIterableFast(type3, asyncIterationTypesResolver); + if (iterationTypes) { + if (iterationTypes === noIterationTypes && errorNode) { + noCache = true; + } else { + return use & 8 ? getAsyncFromSyncIterationTypes(iterationTypes, errorNode) : iterationTypes; + } + } + } + if (use & 1) { + var iterationTypes = getIterationTypesOfIterableCached(type3, syncIterationTypesResolver) || getIterationTypesOfIterableFast(type3, syncIterationTypesResolver); + if (iterationTypes) { + if (iterationTypes === noIterationTypes && errorNode) { + noCache = true; + } else { + if (use & 2) { + if (iterationTypes !== noIterationTypes) { + iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); + return noCache ? iterationTypes : setCachedIterationTypes(type3, "iterationTypesOfAsyncIterable", iterationTypes); + } + } else { + return iterationTypes; + } + } + } + } + if (use & 2) { + var iterationTypes = getIterationTypesOfIterableSlow(type3, asyncIterationTypesResolver, errorNode, errorOutputContainer, noCache); + if (iterationTypes !== noIterationTypes) { + return iterationTypes; + } + } + if (use & 1) { + var iterationTypes = getIterationTypesOfIterableSlow(type3, syncIterationTypesResolver, errorNode, errorOutputContainer, noCache); + if (iterationTypes !== noIterationTypes) { + if (use & 2) { + iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); + return noCache ? iterationTypes : setCachedIterationTypes(type3, "iterationTypesOfAsyncIterable", iterationTypes); + } else { + return iterationTypes; + } + } + } + return noIterationTypes; + } + function getIterationTypesOfIterableCached(type3, resolver) { + return getCachedIterationTypes(type3, resolver.iterableCacheKey); + } + function getIterationTypesOfGlobalIterableType(globalType, resolver) { + var globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) || getIterationTypesOfIterableSlow( + globalType, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0, + /*noCache*/ + false + ); + return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes; + } + function getIterationTypesOfIterableFast(type3, resolver) { + var globalType; + if (isReferenceToType(type3, globalType = resolver.getGlobalIterableType( + /*reportErrors*/ + false + )) || isReferenceToType(type3, globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ))) { + var yieldType = getTypeArguments(type3)[0]; + var _a2 = getIterationTypesOfGlobalIterableType(globalType, resolver), returnType = _a2.returnType, nextType = _a2.nextType; + return setCachedIterationTypes(type3, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || yieldType, resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || returnType, nextType)); + } + if (isReferenceToType(type3, resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ))) { + var _b = getTypeArguments(type3), yieldType = _b[0], returnType = _b[1], nextType = _b[2]; + return setCachedIterationTypes(type3, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || yieldType, resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || returnType, nextType)); + } + } + function getPropertyNameForKnownSymbolName(symbolName) { + var ctorType = getGlobalESSymbolConstructorSymbol( + /*reportErrors*/ + false + ); + var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts2.escapeLeadingUnderscores(symbolName)); + return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName); + } + function getIterationTypesOfIterableSlow(type3, resolver, errorNode, errorOutputContainer, noCache) { + var _a2; + var method2 = getPropertyOfType(type3, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName)); + var methodType = method2 && !(method2.flags & 16777216) ? getTypeOfSymbol(method2) : void 0; + if (isTypeAny(methodType)) { + return noCache ? anyIterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, anyIterationTypes); + } + var signatures = methodType ? getSignaturesOfType( + methodType, + 0 + /* SignatureKind.Call */ + ) : void 0; + if (!ts2.some(signatures)) { + return noCache ? noIterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, noIterationTypes); + } + var iteratorType = getIntersectionType(ts2.map(signatures, getReturnTypeOfSignature)); + var iterationTypes = (_a2 = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache)) !== null && _a2 !== void 0 ? _a2 : noIterationTypes; + return noCache ? iterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, iterationTypes); + } + function reportTypeNotIterableError(errorNode, type3, allowAsyncIterables) { + var message = allowAsyncIterables ? ts2.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator : ts2.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator; + var suggestAwait = ( + // for (const x of Promise<...>) or [...Promise<...>] + !!getAwaitedTypeOfPromise(type3) || !allowAsyncIterables && ts2.isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType( + /** reportErrors */ + false + ) !== emptyGenericType && isTypeAssignableTo(type3, getGlobalAsyncIterableType( + /** reportErrors */ + false + )) + ); + return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type3)); + } + function getIterationTypesOfIterator(type3, resolver, errorNode, errorOutputContainer) { + return getIterationTypesOfIteratorWorker( + type3, + resolver, + errorNode, + errorOutputContainer, + /*noCache*/ + false + ); + } + function getIterationTypesOfIteratorWorker(type3, resolver, errorNode, errorOutputContainer, noCache) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + var iterationTypes = getIterationTypesOfIteratorCached(type3, resolver) || getIterationTypesOfIteratorFast(type3, resolver); + if (iterationTypes === noIterationTypes && errorNode) { + iterationTypes = void 0; + noCache = true; + } + iterationTypes !== null && iterationTypes !== void 0 ? iterationTypes : iterationTypes = getIterationTypesOfIteratorSlow(type3, resolver, errorNode, errorOutputContainer, noCache); + return iterationTypes === noIterationTypes ? void 0 : iterationTypes; + } + function getIterationTypesOfIteratorCached(type3, resolver) { + return getCachedIterationTypes(type3, resolver.iteratorCacheKey); + } + function getIterationTypesOfIteratorFast(type3, resolver) { + var globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ); + if (isReferenceToType(type3, globalType)) { + var yieldType = getTypeArguments(type3)[0]; + var globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) || getIterationTypesOfIteratorSlow( + globalType, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0, + /*noCache*/ + false + ); + var _a2 = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes, returnType = _a2.returnType, nextType = _a2.nextType; + return setCachedIterationTypes(type3, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); + } + if (isReferenceToType(type3, resolver.getGlobalIteratorType( + /*reportErrors*/ + false + )) || isReferenceToType(type3, resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ))) { + var _b = getTypeArguments(type3), yieldType = _b[0], returnType = _b[1], nextType = _b[2]; + return setCachedIterationTypes(type3, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); + } + } + function isIteratorResult(type3, kind) { + var doneType = getTypeOfPropertyOfType(type3, "done") || falseType; + return isTypeAssignableTo(kind === 0 ? falseType : trueType, doneType); + } + function isYieldIteratorResult(type3) { + return isIteratorResult( + type3, + 0 + /* IterationTypeKind.Yield */ + ); + } + function isReturnIteratorResult(type3) { + return isIteratorResult( + type3, + 1 + /* IterationTypeKind.Return */ + ); + } + function getIterationTypesOfIteratorResult(type3) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + var cachedTypes2 = getCachedIterationTypes(type3, "iterationTypesOfIteratorResult"); + if (cachedTypes2) { + return cachedTypes2; + } + if (isReferenceToType(type3, getGlobalIteratorYieldResultType( + /*reportErrors*/ + false + ))) { + var yieldType_1 = getTypeArguments(type3)[0]; + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + yieldType_1, + /*returnType*/ + void 0, + /*nextType*/ + void 0 + )); + } + if (isReferenceToType(type3, getGlobalIteratorReturnResultType( + /*reportErrors*/ + false + ))) { + var returnType_1 = getTypeArguments(type3)[0]; + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + /*yieldType*/ + void 0, + returnType_1, + /*nextType*/ + void 0 + )); + } + var yieldIteratorResult = filterType(type3, isYieldIteratorResult); + var yieldType = yieldIteratorResult !== neverType2 ? getTypeOfPropertyOfType(yieldIteratorResult, "value") : void 0; + var returnIteratorResult = filterType(type3, isReturnIteratorResult); + var returnType = returnIteratorResult !== neverType2 ? getTypeOfPropertyOfType(returnIteratorResult, "value") : void 0; + if (!yieldType && !returnType) { + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", noIterationTypes); + } + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + yieldType, + returnType || voidType2, + /*nextType*/ + void 0 + )); + } + function getIterationTypesOfMethod(type3, resolver, methodName, errorNode, errorOutputContainer) { + var _a2, _b, _c, _d, _e2, _f; + var method2 = getPropertyOfType(type3, methodName); + if (!method2 && methodName !== "next") { + return void 0; + } + var methodType = method2 && !(methodName === "next" && method2.flags & 16777216) ? methodName === "next" ? getTypeOfSymbol(method2) : getTypeWithFacts( + getTypeOfSymbol(method2), + 2097152 + /* TypeFacts.NEUndefinedOrNull */ + ) : void 0; + if (isTypeAny(methodType)) { + return methodName === "next" ? anyIterationTypes : anyIterationTypesExceptNext; + } + var methodSignatures = methodType ? getSignaturesOfType( + methodType, + 0 + /* SignatureKind.Call */ + ) : ts2.emptyArray; + if (methodSignatures.length === 0) { + if (errorNode) { + var diagnostic = methodName === "next" ? resolver.mustHaveANextMethodDiagnostic : resolver.mustBeAMethodDiagnostic; + if (errorOutputContainer) { + (_a2 = errorOutputContainer.errors) !== null && _a2 !== void 0 ? _a2 : errorOutputContainer.errors = []; + errorOutputContainer.errors.push(ts2.createDiagnosticForNode(errorNode, diagnostic, methodName)); + } else { + error2(errorNode, diagnostic, methodName); + } + } + return methodName === "next" ? noIterationTypes : void 0; + } + if ((methodType === null || methodType === void 0 ? void 0 : methodType.symbol) && methodSignatures.length === 1) { + var globalGeneratorType = resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ); + var globalIteratorType = resolver.getGlobalIteratorType( + /*reportErrors*/ + false + ); + var isGeneratorMethod = ((_c = (_b = globalGeneratorType.symbol) === null || _b === void 0 ? void 0 : _b.members) === null || _c === void 0 ? void 0 : _c.get(methodName)) === methodType.symbol; + var isIteratorMethod = !isGeneratorMethod && ((_e2 = (_d = globalIteratorType.symbol) === null || _d === void 0 ? void 0 : _d.members) === null || _e2 === void 0 ? void 0 : _e2.get(methodName)) === methodType.symbol; + if (isGeneratorMethod || isIteratorMethod) { + var globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; + var mapper = methodType.mapper; + return createIterationTypes(getMappedType(globalType.typeParameters[0], mapper), getMappedType(globalType.typeParameters[1], mapper), methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : void 0); + } + } + var methodParameterTypes; + var methodReturnTypes; + for (var _i = 0, methodSignatures_1 = methodSignatures; _i < methodSignatures_1.length; _i++) { + var signature = methodSignatures_1[_i]; + if (methodName !== "throw" && ts2.some(signature.parameters)) { + methodParameterTypes = ts2.append(methodParameterTypes, getTypeAtPosition(signature, 0)); + } + methodReturnTypes = ts2.append(methodReturnTypes, getReturnTypeOfSignature(signature)); + } + var returnTypes; + var nextType; + if (methodName !== "throw") { + var methodParameterType = methodParameterTypes ? getUnionType(methodParameterTypes) : unknownType2; + if (methodName === "next") { + nextType = methodParameterType; + } else if (methodName === "return") { + var resolvedMethodParameterType = resolver.resolveIterationType(methodParameterType, errorNode) || anyType2; + returnTypes = ts2.append(returnTypes, resolvedMethodParameterType); + } + } + var yieldType; + var methodReturnType = methodReturnTypes ? getIntersectionType(methodReturnTypes) : neverType2; + var resolvedMethodReturnType = resolver.resolveIterationType(methodReturnType, errorNode) || anyType2; + var iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType); + if (iterationTypes === noIterationTypes) { + if (errorNode) { + if (errorOutputContainer) { + (_f = errorOutputContainer.errors) !== null && _f !== void 0 ? _f : errorOutputContainer.errors = []; + errorOutputContainer.errors.push(ts2.createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName)); + } else { + error2(errorNode, resolver.mustHaveAValueDiagnostic, methodName); + } + } + yieldType = anyType2; + returnTypes = ts2.append(returnTypes, anyType2); + } else { + yieldType = iterationTypes.yieldType; + returnTypes = ts2.append(returnTypes, iterationTypes.returnType); + } + return createIterationTypes(yieldType, getUnionType(returnTypes), nextType); + } + function getIterationTypesOfIteratorSlow(type3, resolver, errorNode, errorOutputContainer, noCache) { + var iterationTypes = combineIterationTypes([ + getIterationTypesOfMethod(type3, resolver, "next", errorNode, errorOutputContainer), + getIterationTypesOfMethod(type3, resolver, "return", errorNode, errorOutputContainer), + getIterationTypesOfMethod(type3, resolver, "throw", errorNode, errorOutputContainer) + ]); + return noCache ? iterationTypes : setCachedIterationTypes(type3, resolver.iteratorCacheKey, iterationTypes); + } + function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return void 0; + } + var iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsyncGenerator); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(kind)]; + } + function getIterationTypesOfGeneratorFunctionReturnType(type3, isAsyncGenerator) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + var use = isAsyncGenerator ? 2 : 1; + var resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; + return getIterationTypesOfIterable( + type3, + use, + /*errorNode*/ + void 0 + ) || getIterationTypesOfIterator( + type3, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0 + ); + } + function checkBreakOrContinueStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) + checkGrammarBreakOrContinueStatement(node); + } + function unwrapReturnType(returnType, functionFlags) { + var isGenerator = !!(functionFlags & 1); + var isAsync2 = !!(functionFlags & 2); + if (isGenerator) { + var returnIterationType = getIterationTypeOfGeneratorFunctionReturnType(1, returnType, isAsync2); + if (!returnIterationType) { + return errorType; + } + return isAsync2 ? getAwaitedTypeNoAlias(unwrapAwaitedType(returnIterationType)) : returnIterationType; + } + return isAsync2 ? getAwaitedTypeNoAlias(returnType) || errorType : returnType; + } + function isUnwrappedReturnTypeVoidOrAny(func, returnType) { + var unwrappedReturnType = unwrapReturnType(returnType, ts2.getFunctionFlags(func)); + return !!unwrappedReturnType && maybeTypeOfKind( + unwrappedReturnType, + 16384 | 3 + /* TypeFlags.AnyOrUnknown */ + ); + } + function checkReturnStatement(node) { + var _a2; + if (checkGrammarStatementInAmbientContext(node)) { + return; + } + var container = ts2.getContainingFunctionOrClassStaticBlock(node); + if (container && ts2.isClassStaticBlockDeclaration(container)) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block); + return; + } + if (!container) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(container); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts2.getFunctionFlags(container); + if (strictNullChecks || node.expression || returnType.flags & 131072) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType2; + if (container.kind === 175) { + if (node.expression) { + error2(node, ts2.Diagnostics.Setters_cannot_return_a_value); + } + } else if (container.kind === 173) { + if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { + error2(node, ts2.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } + } else if (getReturnTypeFromAnnotation(container)) { + var unwrappedReturnType = (_a2 = unwrapReturnType(returnType, functionFlags)) !== null && _a2 !== void 0 ? _a2 : returnType; + var unwrappedExprType = functionFlags & 2 ? checkAwaitedType( + exprType, + /*withAlias*/ + false, + node, + ts2.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ) : exprType; + if (unwrappedReturnType) { + checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); + } + } + } else if (container.kind !== 173 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(container, returnType)) { + error2(node, ts2.Diagnostics.Not_all_code_paths_return_a_value); + } + } + function checkWithStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (node.flags & 32768) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); + } + } + checkExpression(node.expression); + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var start = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos).start; + var end = node.statement.pos; + grammarErrorAtPos(sourceFile, start, end - start, ts2.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any); + } + } + function checkSwitchStatement(node) { + checkGrammarStatementInAmbientContext(node); + var firstDefaultClause; + var hasDuplicateDefaultClause = false; + var expressionType = checkExpression(node.expression); + var expressionIsLiteral = isLiteralType(expressionType); + ts2.forEach(node.caseBlock.clauses, function(clause) { + if (clause.kind === 293 && !hasDuplicateDefaultClause) { + if (firstDefaultClause === void 0) { + firstDefaultClause = clause; + } else { + grammarErrorOnNode(clause, ts2.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + hasDuplicateDefaultClause = true; + } + } + if (clause.kind === 292) { + addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); + } + ts2.forEach(clause.statements, checkSourceElement); + if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) { + error2(clause, ts2.Diagnostics.Fallthrough_case_in_switch); + } + function createLazyCaseClauseDiagnostics(clause2) { + return function() { + var caseType = checkExpression(clause2.expression); + var caseIsLiteral = isLiteralType(caseType); + var comparedExpressionType = expressionType; + if (!caseIsLiteral || !expressionIsLiteral) { + caseType = caseIsLiteral ? getBaseTypeOfLiteralType(caseType) : caseType; + comparedExpressionType = getBaseTypeOfLiteralType(expressionType); + } + if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { + checkTypeComparableTo( + caseType, + comparedExpressionType, + clause2.expression, + /*headMessage*/ + void 0 + ); + } + }; + } + }); + if (node.caseBlock.locals) { + registerForUnusedIdentifiersCheck(node.caseBlock); + } + } + function checkLabeledStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + ts2.findAncestor(node.parent, function(current) { + if (ts2.isFunctionLike(current)) { + return "quit"; + } + if (current.kind === 253 && current.label.escapedText === node.label.escapedText) { + grammarErrorOnNode(node.label, ts2.Diagnostics.Duplicate_label_0, ts2.getTextOfNode(node.label)); + return true; + } + return false; + }); + } + checkSourceElement(node.statement); + } + function checkThrowStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (ts2.isIdentifier(node.expression) && !node.expression.escapedText) { + grammarErrorAfterFirstToken(node, ts2.Diagnostics.Line_break_not_permitted_here); + } + } + if (node.expression) { + checkExpression(node.expression); + } + } + function checkTryStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkBlock(node.tryBlock); + var catchClause = node.catchClause; + if (catchClause) { + if (catchClause.variableDeclaration) { + var declaration = catchClause.variableDeclaration; + var typeNode = ts2.getEffectiveTypeAnnotationNode(ts2.getRootDeclaration(declaration)); + if (typeNode) { + var type3 = getTypeForVariableLikeDeclaration( + declaration, + /*includeOptionality*/ + false, + 0 + /* CheckMode.Normal */ + ); + if (type3 && !(type3.flags & 3)) { + grammarErrorOnFirstToken(typeNode, ts2.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); + } + } else if (declaration.initializer) { + grammarErrorOnFirstToken(declaration.initializer, ts2.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + } else { + var blockLocals_1 = catchClause.block.locals; + if (blockLocals_1) { + ts2.forEachKey(catchClause.locals, function(caughtName) { + var blockLocal = blockLocals_1.get(caughtName); + if ((blockLocal === null || blockLocal === void 0 ? void 0 : blockLocal.valueDeclaration) && (blockLocal.flags & 2) !== 0) { + grammarErrorOnNode(blockLocal.valueDeclaration, ts2.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, caughtName); + } + }); + } + } + } + checkBlock(catchClause.block); + } + if (node.finallyBlock) { + checkBlock(node.finallyBlock); + } + } + function checkIndexConstraints(type3, symbol, isStaticIndex) { + var indexInfos = getIndexInfosOfType(type3); + if (indexInfos.length === 0) { + return; + } + for (var _i = 0, _a2 = getPropertiesOfObjectType(type3); _i < _a2.length; _i++) { + var prop = _a2[_i]; + if (!(isStaticIndex && prop.flags & 4194304)) { + checkIndexConstraintForProperty(type3, prop, getLiteralTypeFromProperty( + prop, + 8576, + /*includeNonPublic*/ + true + ), getNonMissingTypeOfSymbol(prop)); + } + } + var typeDeclaration = symbol.valueDeclaration; + if (typeDeclaration && ts2.isClassLike(typeDeclaration)) { + for (var _b = 0, _c = typeDeclaration.members; _b < _c.length; _b++) { + var member = _c[_b]; + if (!ts2.isStatic(member) && !hasBindableName(member)) { + var symbol_3 = getSymbolOfNode(member); + checkIndexConstraintForProperty(type3, symbol_3, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol_3)); + } + } + } + if (indexInfos.length > 1) { + for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) { + var info2 = indexInfos_8[_d]; + checkIndexConstraintForIndexSignature(type3, info2); + } + } + } + function checkIndexConstraintForProperty(type3, prop, propNameType, propType) { + var declaration = prop.valueDeclaration; + var name2 = ts2.getNameOfDeclaration(declaration); + if (name2 && ts2.isPrivateIdentifier(name2)) { + return; + } + var indexInfos = getApplicableIndexInfos(type3, propNameType); + var interfaceDeclaration = ts2.getObjectFlags(type3) & 2 ? ts2.getDeclarationOfKind( + type3.symbol, + 261 + /* SyntaxKind.InterfaceDeclaration */ + ) : void 0; + var propDeclaration = declaration && declaration.kind === 223 || name2 && name2.kind === 164 ? declaration : void 0; + var localPropDeclaration = getParentOfSymbol(prop) === type3.symbol ? declaration : void 0; + var _loop_30 = function(info3) { + var localIndexDeclaration = info3.declaration && getParentOfSymbol(getSymbolOfNode(info3.declaration)) === type3.symbol ? info3.declaration : void 0; + var errorNode = localPropDeclaration || localIndexDeclaration || (interfaceDeclaration && !ts2.some(getBaseTypes(type3), function(base) { + return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info3.keyType); + }) ? interfaceDeclaration : void 0); + if (errorNode && !isTypeAssignableTo(propType, info3.type)) { + var diagnostic = createError(errorNode, ts2.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString2(prop), typeToString(propType), typeToString(info3.keyType), typeToString(info3.type)); + if (propDeclaration && errorNode !== propDeclaration) { + ts2.addRelatedInfo(diagnostic, ts2.createDiagnosticForNode(propDeclaration, ts2.Diagnostics._0_is_declared_here, symbolToString2(prop))); + } + diagnostics.add(diagnostic); + } + }; + for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) { + var info2 = indexInfos_9[_i]; + _loop_30(info2); + } + } + function checkIndexConstraintForIndexSignature(type3, checkInfo) { + var declaration = checkInfo.declaration; + var indexInfos = getApplicableIndexInfos(type3, checkInfo.keyType); + var interfaceDeclaration = ts2.getObjectFlags(type3) & 2 ? ts2.getDeclarationOfKind( + type3.symbol, + 261 + /* SyntaxKind.InterfaceDeclaration */ + ) : void 0; + var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type3.symbol ? declaration : void 0; + var _loop_31 = function(info3) { + if (info3 === checkInfo) + return "continue"; + var localIndexDeclaration = info3.declaration && getParentOfSymbol(getSymbolOfNode(info3.declaration)) === type3.symbol ? info3.declaration : void 0; + var errorNode = localCheckDeclaration || localIndexDeclaration || (interfaceDeclaration && !ts2.some(getBaseTypes(type3), function(base) { + return !!getIndexInfoOfType(base, checkInfo.keyType) && !!getIndexTypeOfType(base, info3.keyType); + }) ? interfaceDeclaration : void 0); + if (errorNode && !isTypeAssignableTo(checkInfo.type, info3.type)) { + error2(errorNode, ts2.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info3.keyType), typeToString(info3.type)); + } + }; + for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) { + var info2 = indexInfos_10[_i]; + _loop_31(info2); + } + } + function checkTypeNameIsReserved(name2, message) { + switch (name2.escapedText) { + case "any": + case "unknown": + case "never": + case "number": + case "bigint": + case "boolean": + case "string": + case "symbol": + case "void": + case "object": + error2(name2, message, name2.escapedText); + } + } + function checkClassNameCollisionWithObject(name2) { + if (languageVersion >= 1 && name2.escapedText === "Object" && (moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(name2).impliedNodeFormat === ts2.ModuleKind.CommonJS)) { + error2(name2, ts2.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts2.ModuleKind[moduleKind]); + } + } + function checkUnmatchedJSDocParameters(node) { + var jsdocParameters = ts2.filter(ts2.getJSDocTags(node), ts2.isJSDocParameterTag); + if (!ts2.length(jsdocParameters)) + return; + var isJs = ts2.isInJSFile(node); + var parameters = new ts2.Set(); + var excludedParameters = new ts2.Set(); + ts2.forEach(node.parameters, function(_a2, index4) { + var name2 = _a2.name; + if (ts2.isIdentifier(name2)) { + parameters.add(name2.escapedText); + } + if (ts2.isBindingPattern(name2)) { + excludedParameters.add(index4); + } + }); + var containsArguments = containsArgumentsReference(node); + if (containsArguments) { + var lastJSDocParam = ts2.lastOrUndefined(jsdocParameters); + if (isJs && lastJSDocParam && ts2.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) { + error2(lastJSDocParam.name, ts2.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts2.idText(lastJSDocParam.name)); + } + } else { + ts2.forEach(jsdocParameters, function(_a2, index4) { + var name2 = _a2.name, isNameFirst = _a2.isNameFirst; + if (excludedParameters.has(index4) || ts2.isIdentifier(name2) && parameters.has(name2.escapedText)) { + return; + } + if (ts2.isQualifiedName(name2)) { + if (isJs) { + error2(name2, ts2.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts2.entityNameToString(name2), ts2.entityNameToString(name2.left)); + } + } else { + if (!isNameFirst) { + errorOrSuggestion(isJs, name2, ts2.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts2.idText(name2)); + } + } + }); + } + } + function checkTypeParameters(typeParameterDeclarations) { + var seenDefault = false; + if (typeParameterDeclarations) { + for (var i7 = 0; i7 < typeParameterDeclarations.length; i7++) { + var node = typeParameterDeclarations[i7]; + checkTypeParameter(node); + addLazyDiagnostic(createCheckTypeParameterDiagnostic(node, i7)); + } + } + function createCheckTypeParameterDiagnostic(node2, i8) { + return function() { + if (node2.default) { + seenDefault = true; + checkTypeParametersNotReferenced(node2.default, typeParameterDeclarations, i8); + } else if (seenDefault) { + error2(node2, ts2.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } + for (var j6 = 0; j6 < i8; j6++) { + if (typeParameterDeclarations[j6].symbol === node2.symbol) { + error2(node2.name, ts2.Diagnostics.Duplicate_identifier_0, ts2.declarationNameToString(node2.name)); + } + } + }; + } + } + function checkTypeParametersNotReferenced(root2, typeParameters, index4) { + visit7(root2); + function visit7(node) { + if (node.kind === 180) { + var type3 = getTypeFromTypeReference(node); + if (type3.flags & 262144) { + for (var i7 = index4; i7 < typeParameters.length; i7++) { + if (type3.symbol === getSymbolOfNode(typeParameters[i7])) { + error2(node, ts2.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); + } + } + } + } + ts2.forEachChild(node, visit7); + } + } + function checkTypeParameterListsIdentical(symbol) { + if (symbol.declarations && symbol.declarations.length === 1) { + return; + } + var links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + var declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (!declarations || declarations.length <= 1) { + return; + } + var type3 = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type3.localTypeParameters, ts2.getEffectiveTypeParameterDeclarations)) { + var name2 = symbolToString2(symbol); + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + error2(declaration.name, ts2.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name2); + } + } + } + } + function areTypeParametersIdentical(declarations, targetParameters, getTypeParameterDeclarations) { + var maxTypeArgumentCount = ts2.length(targetParameters); + var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters); + for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) { + var declaration = declarations_8[_i]; + var sourceParameters = getTypeParameterDeclarations(declaration); + var numTypeParameters = sourceParameters.length; + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (var i7 = 0; i7 < numTypeParameters; i7++) { + var source = sourceParameters[i7]; + var target = targetParameters[i7]; + if (source.name.escapedText !== target.symbol.escapedName) { + return false; + } + var constraint = ts2.getEffectiveConstraintOfTypeParameter(source); + var sourceConstraint = constraint && getTypeFromTypeNode(constraint); + var targetConstraint = getConstraintOfTypeParameter(target); + if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } + var sourceDefault = source.default && getTypeFromTypeNode(source.default); + var targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } + function checkClassExpression(node) { + checkClassLikeDeclaration(node); + checkNodeDeferred(node); + return getTypeOfSymbol(getSymbolOfNode(node)); + } + function checkClassExpressionDeferred(node) { + ts2.forEach(node.members, checkSourceElement); + registerForUnusedIdentifiersCheck(node); + } + function checkClassDeclaration(node) { + var firstDecorator = ts2.find(node.modifiers, ts2.isDecorator); + if (firstDecorator && ts2.some(node.members, function(p7) { + return ts2.hasStaticModifier(p7) && ts2.isPrivateIdentifierClassElementDeclaration(p7); + })) { + grammarErrorOnNode(firstDecorator, ts2.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); + } + if (!node.name && !ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + )) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } + checkClassLikeDeclaration(node); + ts2.forEach(node.members, checkSourceElement); + registerForUnusedIdentifiersCheck(node); + } + function checkClassLikeDeclaration(node) { + checkGrammarClassLikeDeclaration(node); + checkDecorators(node); + checkCollisionsForDeclarationName(node, node.name); + checkTypeParameters(ts2.getEffectiveTypeParameterDeclarations(node)); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + var type3 = getDeclaredTypeOfSymbol(symbol); + var typeWithThis = getTypeWithThisArgument(type3); + var staticType = getTypeOfSymbol(symbol); + checkTypeParameterListsIdentical(symbol); + checkFunctionOrConstructorSymbol(symbol); + checkClassForDuplicateDeclarations(node); + var nodeInAmbientContext = !!(node.flags & 16777216); + if (!nodeInAmbientContext) { + checkClassForStaticPropertyNameConflicts(node); + } + var baseTypeNode = ts2.getEffectiveBaseTypeNode(node); + if (baseTypeNode) { + ts2.forEach(baseTypeNode.typeArguments, checkSourceElement); + if (languageVersion < 2) { + checkExternalEmitHelpers( + baseTypeNode.parent, + 1 + /* ExternalEmitHelpers.Extends */ + ); + } + var extendsNode = ts2.getClassExtendsHeritageElement(node); + if (extendsNode && extendsNode !== baseTypeNode) { + checkExpression(extendsNode.expression); + } + var baseTypes_2 = getBaseTypes(type3); + if (baseTypes_2.length) { + addLazyDiagnostic(function() { + var baseType = baseTypes_2[0]; + var baseConstructorType = getBaseConstructorTypeOfClass(type3); + var staticBaseType = getApparentType(baseConstructorType); + checkBaseTypeAccessibility(staticBaseType, baseTypeNode); + checkSourceElement(baseTypeNode.expression); + if (ts2.some(baseTypeNode.typeArguments)) { + ts2.forEach(baseTypeNode.typeArguments, checkSourceElement); + for (var _i2 = 0, _a2 = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i2 < _a2.length; _i2++) { + var constructor = _a2[_i2]; + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { + break; + } + } + } + var baseWithThis = getTypeWithThisArgument(baseType, type3.thisType); + if (!checkTypeAssignableTo( + typeWithThis, + baseWithThis, + /*errorNode*/ + void 0 + )) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts2.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } else { + checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts2.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + } + if (baseConstructorType.flags & 8650752) { + if (!isMixinConstructorType(staticType)) { + error2(node.name || node, ts2.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); + } else { + var constructSignatures = getSignaturesOfType( + baseConstructorType, + 1 + /* SignatureKind.Construct */ + ); + if (constructSignatures.some(function(signature) { + return signature.flags & 4; + }) && !ts2.hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + )) { + error2(node.name || node, ts2.Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract); + } + } + } + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 8650752)) { + var constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); + if (ts2.forEach(constructors, function(sig) { + return !isJSConstructor(sig.declaration) && !isTypeIdenticalTo(getReturnTypeOfSignature(sig), baseType); + })) { + error2(baseTypeNode.expression, ts2.Diagnostics.Base_constructors_must_all_have_the_same_return_type); + } + } + checkKindsOfPropertyMemberOverrides(type3, baseType); + }); + } + } + checkMembersForOverrideModifier(node, type3, typeWithThis, staticType); + var implementedTypeNodes = ts2.getEffectiveImplementsTypeNodes(node); + if (implementedTypeNodes) { + for (var _i = 0, implementedTypeNodes_1 = implementedTypeNodes; _i < implementedTypeNodes_1.length; _i++) { + var typeRefNode = implementedTypeNodes_1[_i]; + if (!ts2.isEntityNameExpression(typeRefNode.expression) || ts2.isOptionalChain(typeRefNode.expression)) { + error2(typeRefNode.expression, ts2.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkTypeReferenceNode(typeRefNode); + addLazyDiagnostic(createImplementsDiagnostics(typeRefNode)); + } + } + addLazyDiagnostic(function() { + checkIndexConstraints(type3, symbol); + checkIndexConstraints( + staticType, + symbol, + /*isStaticIndex*/ + true + ); + checkTypeForDuplicateIndexSignatures(node); + checkPropertyInitialization(node); + }); + function createImplementsDiagnostics(typeRefNode2) { + return function() { + var t8 = getReducedType(getTypeFromTypeNode(typeRefNode2)); + if (!isErrorType(t8)) { + if (isValidBaseType(t8)) { + var genericDiag = t8.symbol && t8.symbol.flags & 32 ? ts2.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : ts2.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t8, type3.thisType); + if (!checkTypeAssignableTo( + typeWithThis, + baseWithThis, + /*errorNode*/ + void 0 + )) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } + } else { + error2(typeRefNode2, ts2.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); + } + } + }; + } + } + function checkMembersForOverrideModifier(node, type3, typeWithThis, staticType) { + var baseTypeNode = ts2.getEffectiveBaseTypeNode(node); + var baseTypes = baseTypeNode && getBaseTypes(type3); + var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts2.first(baseTypes), type3.thisType) : void 0; + var baseStaticType = getBaseConstructorTypeOfClass(type3); + var _loop_32 = function(member2) { + if (ts2.hasAmbientModifier(member2)) { + return "continue"; + } + if (ts2.isConstructorDeclaration(member2)) { + ts2.forEach(member2.parameters, function(param) { + if (ts2.isParameterPropertyDeclaration(param, member2)) { + checkExistingMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + param, + /* memberIsParameterProperty */ + true + ); + } + }); + } + checkExistingMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + member2, + /* memberIsParameterProperty */ + false + ); + }; + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + _loop_32(member); + } + } + function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type3, typeWithThis, member, memberIsParameterProperty, reportErrors) { + if (reportErrors === void 0) { + reportErrors = true; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (!declaredProp) { + return 0; + } + return checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type3, typeWithThis, ts2.hasOverrideModifier(member), ts2.hasAbstractModifier(member), ts2.isStatic(member), memberIsParameterProperty, ts2.symbolName(declaredProp), reportErrors ? member : void 0); + } + function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type3, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) { + var isJs = ts2.isInJSFile(node); + var nodeInAmbientContext = !!(node.flags & 16777216); + if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) { + var memberEscapedName = ts2.escapeLeadingUnderscores(memberName); + var thisType = memberIsStatic ? staticType : typeWithThis; + var baseType = memberIsStatic ? baseStaticType : baseWithThis; + var prop = getPropertyOfType(thisType, memberEscapedName); + var baseProp = getPropertyOfType(baseType, memberEscapedName); + var baseClassName = typeToString(baseWithThis); + if (prop && !baseProp && memberHasOverrideModifier) { + if (errorNode) { + var suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType); + suggestion ? error2(errorNode, isJs ? ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 : ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString2(suggestion)) : error2(errorNode, isJs ? ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 : ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName); + } + return 2; + } else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) { + var baseHasAbstract = ts2.some(baseProp.declarations, ts2.hasAbstractModifier); + if (memberHasOverrideModifier) { + return 0; + } + if (!baseHasAbstract) { + if (errorNode) { + var diag = memberIsParameterProperty ? isJs ? ts2.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : ts2.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 : isJs ? ts2.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0; + error2(errorNode, diag, baseClassName); + } + return 1; + } else if (memberHasAbstractModifier && baseHasAbstract) { + if (errorNode) { + error2(errorNode, ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName); + } + return 1; + } + } + } else if (memberHasOverrideModifier) { + if (errorNode) { + var className = typeToString(type3); + error2(errorNode, isJs ? ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class : ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className); + } + return 2; + } + return 0; + } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + var issuedMemberError = false; + var _loop_33 = function(member2) { + if (ts2.isStatic(member2)) { + return "continue"; + } + var declaredProp = member2.name && getSymbolAtLocation(member2.name) || getSymbolAtLocation(member2); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function() { + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, + symbolToString2(declaredProp), + typeToString(typeWithThis), + typeToString(baseWithThis) + ); + }; + if (!checkTypeAssignableTo( + getTypeOfSymbol(prop), + getTypeOfSymbol(baseProp), + member2.name || member2, + /*message*/ + void 0, + rootChain + )) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + _loop_33(member); + } + if (!issuedMemberError) { + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } + function checkBaseTypeAccessibility(type3, node) { + var signatures = getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ); + if (signatures.length) { + var declaration = signatures[0].declaration; + if (declaration && ts2.hasEffectiveModifier( + declaration, + 8 + /* ModifierFlags.Private */ + )) { + var typeClassDeclaration = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + if (!isNodeWithinClass(node, typeClassDeclaration)) { + error2(node, ts2.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName2(type3.symbol)); + } + } + } + } + function getMemberOverrideModifierStatus(node, member) { + if (!member.name) { + return 0; + } + var symbol = getSymbolOfNode(node); + var type3 = getDeclaredTypeOfSymbol(symbol); + var typeWithThis = getTypeWithThisArgument(type3); + var staticType = getTypeOfSymbol(symbol); + var baseTypeNode = ts2.getEffectiveBaseTypeNode(node); + var baseTypes = baseTypeNode && getBaseTypes(type3); + var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts2.first(baseTypes), type3.thisType) : void 0; + var baseStaticType = getBaseConstructorTypeOfClass(type3); + var memberHasOverrideModifier = member.parent ? ts2.hasOverrideModifier(member) : ts2.hasSyntacticModifier( + member, + 16384 + /* ModifierFlags.Override */ + ); + var memberName = ts2.unescapeLeadingUnderscores(ts2.getTextOfPropertyName(member.name)); + return checkMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + memberHasOverrideModifier, + ts2.hasAbstractModifier(member), + ts2.isStatic(member), + /* memberIsParameterProperty */ + false, + memberName + ); + } + function getTargetSymbol(s7) { + return ts2.getCheckFlags(s7) & 1 ? s7.target : s7; + } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return ts2.filter(symbol.declarations, function(d7) { + return d7.kind === 260 || d7.kind === 261; + }); + } + function checkKindsOfPropertyMemberOverrides(type3, baseType) { + var _a2, _b, _c, _d; + var baseProperties = getPropertiesOfType(baseType); + var _loop_34 = function(baseProperty3) { + var base = getTargetSymbol(baseProperty3); + if (base.flags & 4194304) { + return "continue"; + } + var baseSymbol = getPropertyOfObjectType(type3, base.escapedName); + if (!baseSymbol) { + return "continue"; + } + var derived = getTargetSymbol(baseSymbol); + var baseDeclarationFlags = ts2.getDeclarationModifierFlagsFromSymbol(base); + ts2.Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration."); + if (derived === base) { + var derivedClassDecl = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + if (baseDeclarationFlags & 256 && (!derivedClassDecl || !ts2.hasSyntacticModifier( + derivedClassDecl, + 256 + /* ModifierFlags.Abstract */ + ))) { + for (var _e2 = 0, _f = getBaseTypes(type3); _e2 < _f.length; _e2++) { + var otherBaseType = _f[_e2]; + if (otherBaseType === baseType) + continue; + var baseSymbol_1 = getPropertyOfObjectType(otherBaseType, base.escapedName); + var derivedElsewhere = baseSymbol_1 && getTargetSymbol(baseSymbol_1); + if (derivedElsewhere && derivedElsewhere !== base) { + return "continue-basePropertyCheck"; + } + } + if (derivedClassDecl.kind === 228) { + error2(derivedClassDecl, ts2.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString2(baseProperty3), typeToString(baseType)); + } else { + error2(derivedClassDecl, ts2.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, typeToString(type3), symbolToString2(baseProperty3), typeToString(baseType)); + } + } + } else { + var derivedDeclarationFlags = ts2.getDeclarationModifierFlagsFromSymbol(derived); + if (baseDeclarationFlags & 8 || derivedDeclarationFlags & 8) { + return "continue"; + } + var errorMessage = void 0; + var basePropertyFlags = base.flags & 98308; + var derivedPropertyFlags = derived.flags & 98308; + if (basePropertyFlags && derivedPropertyFlags) { + if ((ts2.getCheckFlags(base) & 6 ? (_a2 = base.declarations) === null || _a2 === void 0 ? void 0 : _a2.some(function(d7) { + return isPropertyAbstractOrInterface(d7, baseDeclarationFlags); + }) : (_b = base.declarations) === null || _b === void 0 ? void 0 : _b.every(function(d7) { + return isPropertyAbstractOrInterface(d7, baseDeclarationFlags); + })) || ts2.getCheckFlags(base) & 262144 || derived.valueDeclaration && ts2.isBinaryExpression(derived.valueDeclaration)) { + return "continue"; + } + var overriddenInstanceProperty = basePropertyFlags !== 4 && derivedPropertyFlags === 4; + var overriddenInstanceAccessor = basePropertyFlags === 4 && derivedPropertyFlags !== 4; + if (overriddenInstanceProperty || overriddenInstanceAccessor) { + var errorMessage_1 = overriddenInstanceProperty ? ts2.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : ts2.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor; + error2(ts2.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_1, symbolToString2(base), typeToString(baseType), typeToString(type3)); + } else if (useDefineForClassFields) { + var uninitialized = (_c = derived.declarations) === null || _c === void 0 ? void 0 : _c.find(function(d7) { + return d7.kind === 169 && !d7.initializer; + }); + if (uninitialized && !(derived.flags & 33554432) && !(baseDeclarationFlags & 256) && !(derivedDeclarationFlags & 256) && !((_d = derived.declarations) === null || _d === void 0 ? void 0 : _d.some(function(d7) { + return !!(d7.flags & 16777216); + }))) { + var constructor = findConstructorDeclaration(ts2.getClassLikeDeclarationOfSymbol(type3.symbol)); + var propName2 = uninitialized.name; + if (uninitialized.exclamationToken || !constructor || !ts2.isIdentifier(propName2) || !strictNullChecks || !isPropertyInitializedInConstructor(propName2, type3, constructor)) { + var errorMessage_2 = ts2.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration; + error2(ts2.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage_2, symbolToString2(base), typeToString(baseType)); + } + } + } + return "continue"; + } else if (isPrototypeProperty(base)) { + if (isPrototypeProperty(derived) || derived.flags & 4) { + return "continue"; + } else { + ts2.Debug.assert(!!(derived.flags & 98304)); + errorMessage = ts2.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; + } + } else if (base.flags & 98304) { + errorMessage = ts2.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; + } else { + errorMessage = ts2.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; + } + error2(ts2.getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString2(base), typeToString(type3)); + } + }; + basePropertyCheck: + for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) { + var baseProperty2 = baseProperties_1[_i]; + var state_10 = _loop_34(baseProperty2); + switch (state_10) { + case "continue-basePropertyCheck": + continue basePropertyCheck; + } + } + } + function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) { + return baseDeclarationFlags & 256 && (!ts2.isPropertyDeclaration(declaration) || !declaration.initializer) || ts2.isInterfaceDeclaration(declaration.parent); + } + function getNonInheritedProperties(type3, baseTypes, properties) { + if (!ts2.length(baseTypes)) { + return properties; + } + var seen = new ts2.Map(); + ts2.forEach(properties, function(p7) { + seen.set(p7.escapedName, p7); + }); + for (var _i = 0, baseTypes_3 = baseTypes; _i < baseTypes_3.length; _i++) { + var base = baseTypes_3[_i]; + var properties_5 = getPropertiesOfType(getTypeWithThisArgument(base, type3.thisType)); + for (var _a2 = 0, properties_4 = properties_5; _a2 < properties_4.length; _a2++) { + var prop = properties_4[_a2]; + var existing = seen.get(prop.escapedName); + if (existing && prop.parent === existing.parent) { + seen.delete(prop.escapedName); + } + } + } + return ts2.arrayFrom(seen.values()); + } + function checkInheritedPropertiesAreIdentical(type3, typeNode) { + var baseTypes = getBaseTypes(type3); + if (baseTypes.length < 2) { + return true; + } + var seen = new ts2.Map(); + ts2.forEach(resolveDeclaredMembers(type3).declaredProperties, function(p7) { + seen.set(p7.escapedName, { prop: p7, containingType: type3 }); + }); + var ok2 = true; + for (var _i = 0, baseTypes_4 = baseTypes; _i < baseTypes_4.length; _i++) { + var base = baseTypes_4[_i]; + var properties = getPropertiesOfType(getTypeWithThisArgument(base, type3.thisType)); + for (var _a2 = 0, properties_6 = properties; _a2 < properties_6.length; _a2++) { + var prop = properties_6[_a2]; + var existing = seen.get(prop.escapedName); + if (!existing) { + seen.set(prop.escapedName, { prop, containingType: base }); + } else { + var isInheritedProperty = existing.containingType !== type3; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok2 = false; + var typeName1 = typeToString(existing.containingType); + var typeName2 = typeToString(base); + var errorInfo = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, + symbolToString2(prop), + typeName1, + typeName2 + ); + errorInfo = ts2.chainDiagnosticMessages(errorInfo, ts2.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type3), typeName1, typeName2); + diagnostics.add(ts2.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); + } + } + } + } + return ok2; + } + function checkPropertyInitialization(node) { + if (!strictNullChecks || !strictPropertyInitialization || node.flags & 16777216) { + return; + } + var constructor = findConstructorDeclaration(node); + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (ts2.getEffectiveModifierFlags(member) & 2) { + continue; + } + if (!ts2.isStatic(member) && isPropertyWithoutInitializer(member)) { + var propName2 = member.name; + if (ts2.isIdentifier(propName2) || ts2.isPrivateIdentifier(propName2) || ts2.isComputedPropertyName(propName2)) { + var type3 = getTypeOfSymbol(getSymbolOfNode(member)); + if (!(type3.flags & 3 || containsUndefinedType(type3))) { + if (!constructor || !isPropertyInitializedInConstructor(propName2, type3, constructor)) { + error2(member.name, ts2.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, ts2.declarationNameToString(propName2)); + } + } + } + } + } + } + function isPropertyWithoutInitializer(node) { + return node.kind === 169 && !ts2.hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; + } + function isPropertyInitializedInStaticBlocks(propName2, propType, staticBlocks, startPos, endPos) { + for (var _i = 0, staticBlocks_2 = staticBlocks; _i < staticBlocks_2.length; _i++) { + var staticBlock = staticBlocks_2[_i]; + if (staticBlock.pos >= startPos && staticBlock.pos <= endPos) { + var reference = ts2.factory.createPropertyAccessExpression(ts2.factory.createThis(), propName2); + ts2.setParent(reference.expression, reference); + ts2.setParent(reference, staticBlock); + reference.flowNode = staticBlock.returnFlowNode; + var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); + if (!containsUndefinedType(flowType)) { + return true; + } + } + } + return false; + } + function isPropertyInitializedInConstructor(propName2, propType, constructor) { + var reference = ts2.isComputedPropertyName(propName2) ? ts2.factory.createElementAccessExpression(ts2.factory.createThis(), propName2.expression) : ts2.factory.createPropertyAccessExpression(ts2.factory.createThis(), propName2); + ts2.setParent(reference.expression, reference); + ts2.setParent(reference, constructor); + reference.flowNode = constructor.returnFlowNode; + var flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); + return !containsUndefinedType(flowType); + } + function checkInterfaceDeclaration(node) { + if (!checkGrammarDecoratorsAndModifiers(node)) + checkGrammarInterfaceDeclaration(node); + checkTypeParameters(node.typeParameters); + addLazyDiagnostic(function() { + checkTypeNameIsReserved(node.name, ts2.Diagnostics.Interface_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + checkTypeParameterListsIdentical(symbol); + var firstInterfaceDecl = ts2.getDeclarationOfKind( + symbol, + 261 + /* SyntaxKind.InterfaceDeclaration */ + ); + if (node === firstInterfaceDecl) { + var type3 = getDeclaredTypeOfSymbol(symbol); + var typeWithThis = getTypeWithThisArgument(type3); + if (checkInheritedPropertiesAreIdentical(type3, node.name)) { + for (var _i = 0, _a2 = getBaseTypes(type3); _i < _a2.length; _i++) { + var baseType = _a2[_i]; + checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType, type3.thisType), node.name, ts2.Diagnostics.Interface_0_incorrectly_extends_interface_1); + } + checkIndexConstraints(type3, symbol); + } + } + checkObjectTypeForDuplicateDeclarations(node); + }); + ts2.forEach(ts2.getInterfaceBaseTypeNodes(node), function(heritageElement) { + if (!ts2.isEntityNameExpression(heritageElement.expression) || ts2.isOptionalChain(heritageElement.expression)) { + error2(heritageElement.expression, ts2.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkTypeReferenceNode(heritageElement); + }); + ts2.forEach(node.members, checkSourceElement); + addLazyDiagnostic(function() { + checkTypeForDuplicateIndexSignatures(node); + registerForUnusedIdentifiersCheck(node); + }); + } + function checkTypeAliasDeclaration(node) { + checkGrammarDecoratorsAndModifiers(node); + checkTypeNameIsReserved(node.name, ts2.Diagnostics.Type_alias_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + checkTypeParameters(node.typeParameters); + if (node.type.kind === 139) { + if (!intrinsicTypeKinds.has(node.name.escapedText) || ts2.length(node.typeParameters) !== 1) { + error2(node.type, ts2.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); + } + } else { + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); + } + } + function computeEnumMemberValues(node) { + var nodeLinks2 = getNodeLinks(node); + if (!(nodeLinks2.flags & 16384)) { + nodeLinks2.flags |= 16384; + var autoValue = 0; + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + var value2 = computeMemberValue(member, autoValue); + getNodeLinks(member).enumMemberValue = value2; + autoValue = typeof value2 === "number" ? value2 + 1 : void 0; + } + } + } + function computeMemberValue(member, autoValue) { + if (ts2.isComputedNonLiteralName(member.name)) { + error2(member.name, ts2.Diagnostics.Computed_property_names_are_not_allowed_in_enums); + } else { + var text = ts2.getTextOfPropertyName(member.name); + if (ts2.isNumericLiteralName(text) && !ts2.isInfinityOrNaNString(text)) { + error2(member.name, ts2.Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } + } + if (member.initializer) { + return computeConstantValue(member); + } + if (member.parent.flags & 16777216 && !ts2.isEnumConst(member.parent) && getEnumKind(getSymbolOfNode(member.parent)) === 0) { + return void 0; + } + if (autoValue !== void 0) { + return autoValue; + } + error2(member.name, ts2.Diagnostics.Enum_member_must_have_initializer); + return void 0; + } + function computeConstantValue(member) { + var enumKind = getEnumKind(getSymbolOfNode(member.parent)); + var isConstEnum = ts2.isEnumConst(member.parent); + var initializer = member.initializer; + var value2 = enumKind === 1 && !isLiteralEnumMember(member) ? void 0 : evaluate(initializer); + if (value2 !== void 0) { + if (isConstEnum && typeof value2 === "number" && !isFinite(value2)) { + error2(initializer, isNaN(value2) ? ts2.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : ts2.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); + } + } else if (enumKind === 1) { + error2(initializer, ts2.Diagnostics.Computed_values_are_not_permitted_in_an_enum_with_string_valued_members); + return 0; + } else if (isConstEnum) { + error2(initializer, ts2.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values); + } else if (member.parent.flags & 16777216) { + error2(initializer, ts2.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); + } else { + var source = checkExpression(initializer); + if (!isTypeAssignableToKind( + source, + 296 + /* TypeFlags.NumberLike */ + )) { + error2(initializer, ts2.Diagnostics.Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead, typeToString(source)); + } else { + checkTypeAssignableTo( + source, + getDeclaredTypeOfSymbol(getSymbolOfNode(member.parent)), + initializer, + /*headMessage*/ + void 0 + ); + } + } + return value2; + function evaluate(expr) { + switch (expr.kind) { + case 221: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { + switch (expr.operator) { + case 39: + return value_2; + case 40: + return -value_2; + case 54: + return ~value_2; + } + } + break; + case 223: + var left = evaluate(expr.left); + var right = evaluate(expr.right); + if (typeof left === "number" && typeof right === "number") { + switch (expr.operatorToken.kind) { + case 51: + return left | right; + case 50: + return left & right; + case 48: + return left >> right; + case 49: + return left >>> right; + case 47: + return left << right; + case 52: + return left ^ right; + case 41: + return left * right; + case 43: + return left / right; + case 39: + return left + right; + case 40: + return left - right; + case 44: + return left % right; + case 42: + return Math.pow(left, right); + } + } else if (typeof left === "string" && typeof right === "string" && expr.operatorToken.kind === 39) { + return left + right; + } + break; + case 10: + case 14: + return expr.text; + case 8: + checkGrammarNumericLiteral(expr); + return +expr.text; + case 214: + return evaluate(expr.expression); + case 79: + var identifier = expr; + if (ts2.isInfinityOrNaNString(identifier.escapedText)) { + return +identifier.escapedText; + } + return ts2.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText); + case 209: + case 208: + if (isConstantMemberAccess(expr)) { + var type3 = getTypeOfExpression(expr.expression); + if (type3.symbol && type3.symbol.flags & 384) { + var name2 = void 0; + if (expr.kind === 208) { + name2 = expr.name.escapedText; + } else { + name2 = ts2.escapeLeadingUnderscores(ts2.cast(expr.argumentExpression, ts2.isLiteralExpression).text); + } + return evaluateEnumMember(expr, type3.symbol, name2); + } + } + break; + } + return void 0; + } + function evaluateEnumMember(expr, enumSymbol, name2) { + var memberSymbol = enumSymbol.exports.get(name2); + if (memberSymbol) { + var declaration = memberSymbol.valueDeclaration; + if (declaration !== member) { + if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts2.isEnumDeclaration(declaration.parent)) { + return getEnumMemberValue(declaration); + } + error2(expr, ts2.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums); + return 0; + } else { + error2(expr, ts2.Diagnostics.Property_0_is_used_before_being_assigned, symbolToString2(memberSymbol)); + } + } + return void 0; + } + } + function isConstantMemberAccess(node) { + var type3 = getTypeOfExpression(node); + if (type3 === errorType) { + return false; + } + return node.kind === 79 || node.kind === 208 && isConstantMemberAccess(node.expression) || node.kind === 209 && isConstantMemberAccess(node.expression) && ts2.isStringLiteralLike(node.argumentExpression); + } + function checkEnumDeclaration(node) { + addLazyDiagnostic(function() { + return checkEnumDeclarationWorker(node); + }); + } + function checkEnumDeclarationWorker(node) { + checkGrammarDecoratorsAndModifiers(node); + checkCollisionsForDeclarationName(node, node.name); + checkExportsOnMergedDeclarations(node); + node.members.forEach(checkEnumMember); + computeEnumMemberValues(node); + var enumSymbol = getSymbolOfNode(node); + var firstDeclaration = ts2.getDeclarationOfKind(enumSymbol, node.kind); + if (node === firstDeclaration) { + if (enumSymbol.declarations && enumSymbol.declarations.length > 1) { + var enumIsConst_1 = ts2.isEnumConst(node); + ts2.forEach(enumSymbol.declarations, function(decl) { + if (ts2.isEnumDeclaration(decl) && ts2.isEnumConst(decl) !== enumIsConst_1) { + error2(ts2.getNameOfDeclaration(decl), ts2.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } + var seenEnumMissingInitialInitializer_1 = false; + ts2.forEach(enumSymbol.declarations, function(declaration) { + if (declaration.kind !== 263) { + return false; + } + var enumDeclaration = declaration; + if (!enumDeclaration.members.length) { + return false; + } + var firstEnumMember = enumDeclaration.members[0]; + if (!firstEnumMember.initializer) { + if (seenEnumMissingInitialInitializer_1) { + error2(firstEnumMember.name, ts2.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); + } else { + seenEnumMissingInitialInitializer_1 = true; + } + } + }); + } + } + function checkEnumMember(node) { + if (ts2.isPrivateIdentifier(node.name)) { + error2(node, ts2.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier); + } + } + function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { + var declarations = symbol.declarations; + if (declarations) { + for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) { + var declaration = declarations_9[_i]; + if ((declaration.kind === 260 || declaration.kind === 259 && ts2.nodeIsPresent(declaration.body)) && !(declaration.flags & 16777216)) { + return declaration; + } + } + } + return void 0; + } + function inSameLexicalScope(node1, node2) { + var container1 = ts2.getEnclosingBlockScopeContainer(node1); + var container2 = ts2.getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } else if (isGlobalSourceFile(container2)) { + return false; + } else { + return container1 === container2; + } + } + function checkModuleDeclaration(node) { + if (node.body) { + checkSourceElement(node.body); + if (!ts2.isGlobalScopeAugmentation(node)) { + registerForUnusedIdentifiersCheck(node); + } + } + addLazyDiagnostic(checkModuleDeclarationDiagnostics); + function checkModuleDeclarationDiagnostics() { + var isGlobalAugmentation = ts2.isGlobalScopeAugmentation(node); + var inAmbientContext = node.flags & 16777216; + if (isGlobalAugmentation && !inAmbientContext) { + error2(node.name, ts2.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + var isAmbientExternalModule = ts2.isAmbientModule(node); + var contextErrorMessage = isAmbientExternalModule ? ts2.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : ts2.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module; + if (checkGrammarModuleElementContext(node, contextErrorMessage)) { + return; + } + if (!checkGrammarDecoratorsAndModifiers(node)) { + if (!inAmbientContext && node.name.kind === 10) { + grammarErrorOnNode(node.name, ts2.Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + if (ts2.isIdentifier(node.name)) { + checkCollisionsForDeclarationName(node, node.name); + } + checkExportsOnMergedDeclarations(node); + var symbol = getSymbolOfNode(node); + if (symbol.flags & 512 && !inAmbientContext && symbol.declarations && symbol.declarations.length > 1 && isInstantiatedModule(node, ts2.shouldPreserveConstEnums(compilerOptions))) { + var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (ts2.getSourceFileOfNode(node) !== ts2.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error2(node.name, ts2.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error2(node.name, ts2.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + var mergedClass = ts2.getDeclarationOfKind( + symbol, + 260 + /* SyntaxKind.ClassDeclaration */ + ); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 32768; + } + } + if (isAmbientExternalModule) { + if (ts2.isExternalModuleAugmentation(node)) { + var checkBody = isGlobalAugmentation || getSymbolOfNode(node).flags & 33554432; + if (checkBody && node.body) { + for (var _i = 0, _a2 = node.body.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } + } else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error2(node.name, ts2.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } else if (ts2.isExternalModuleNameRelative(ts2.getTextOfIdentifierOrLiteral(node.name))) { + error2(node.name, ts2.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } else { + if (isGlobalAugmentation) { + error2(node.name, ts2.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } else { + error2(node.name, ts2.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } + } + } + } + } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 240: + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 274: + case 275: + grammarErrorOnFirstToken(node, ts2.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 268: + case 269: + grammarErrorOnFirstToken(node, ts2.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 205: + case 257: + var name2 = node.name; + if (ts2.isBindingPattern(name2)) { + for (var _b = 0, _c = name2.elements; _b < _c.length; _b++) { + var el = _c[_b]; + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + case 260: + case 263: + case 259: + case 261: + case 264: + case 262: + if (isGlobalAugmentation) { + return; + } + break; + } + } + function getFirstNonModuleExportsIdentifier(node) { + switch (node.kind) { + case 79: + return node; + case 163: + do { + node = node.left; + } while (node.kind !== 79); + return node; + case 208: + do { + if (ts2.isModuleExportsAccessExpression(node.expression) && !ts2.isPrivateIdentifier(node.name)) { + return node.name; + } + node = node.expression; + } while (node.kind !== 79); + return node; + } + } + function checkExternalImportOrExportDeclaration(node) { + var moduleName3 = ts2.getExternalModuleName(node); + if (!moduleName3 || ts2.nodeIsMissing(moduleName3)) { + return false; + } + if (!ts2.isStringLiteral(moduleName3)) { + error2(moduleName3, ts2.Diagnostics.String_literal_expected); + return false; + } + var inAmbientExternalModule = node.parent.kind === 265 && ts2.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 308 && !inAmbientExternalModule) { + error2(moduleName3, node.kind === 275 ? ts2.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts2.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); + return false; + } + if (inAmbientExternalModule && ts2.isExternalModuleNameRelative(moduleName3.text)) { + if (!isTopLevelInExternalModuleAugmentation(node)) { + error2(node, ts2.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } + } + if (!ts2.isImportEqualsDeclaration(node) && node.assertClause) { + var hasError = false; + for (var _i = 0, _a2 = node.assertClause.elements; _i < _a2.length; _i++) { + var clause = _a2[_i]; + if (!ts2.isStringLiteral(clause.value)) { + hasError = true; + error2(clause.value, ts2.Diagnostics.Import_assertion_values_must_be_string_literal_expressions); + } + } + return !hasError; + } + return true; + } + function checkAliasSymbol(node) { + var _a2, _b, _c, _d, _e2; + var symbol = getSymbolOfNode(node); + var target = resolveAlias(symbol); + if (target !== unknownSymbol) { + symbol = getMergedSymbol(symbol.exportSymbol || symbol); + if (ts2.isInJSFile(node) && !(target.flags & 111551) && !ts2.isTypeOnlyImportOrExportDeclaration(node)) { + var errorNode = ts2.isImportOrExportSpecifier(node) ? node.propertyName || node.name : ts2.isNamedDeclaration(node) ? node.name : node; + ts2.Debug.assert( + node.kind !== 277 + /* SyntaxKind.NamespaceExport */ + ); + if (node.kind === 278) { + var diag = error2(errorNode, ts2.Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); + var alreadyExportedSymbol = (_b = (_a2 = ts2.getSourceFileOfNode(node).symbol) === null || _a2 === void 0 ? void 0 : _a2.exports) === null || _b === void 0 ? void 0 : _b.get((node.propertyName || node.name).escapedText); + if (alreadyExportedSymbol === target) { + var exportingDeclaration = (_c = alreadyExportedSymbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts2.isJSDocNode); + if (exportingDeclaration) { + ts2.addRelatedInfo(diag, ts2.createDiagnosticForNode(exportingDeclaration, ts2.Diagnostics._0_is_automatically_exported_here, ts2.unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName))); + } + } + } else { + ts2.Debug.assert( + node.kind !== 257 + /* SyntaxKind.VariableDeclaration */ + ); + var importDeclaration = ts2.findAncestor(node, ts2.or(ts2.isImportDeclaration, ts2.isImportEqualsDeclaration)); + var moduleSpecifier = (_e2 = importDeclaration && ((_d = ts2.tryGetModuleSpecifierFromDeclaration(importDeclaration)) === null || _d === void 0 ? void 0 : _d.text)) !== null && _e2 !== void 0 ? _e2 : "..."; + var importedIdentifier = ts2.unescapeLeadingUnderscores(ts2.isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName); + error2(errorNode, ts2.Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, importedIdentifier, 'import("'.concat(moduleSpecifier, '").').concat(importedIdentifier)); + } + return; + } + var targetFlags = getAllSymbolFlags(target); + var excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) | (symbol.flags & 788968 ? 788968 : 0) | (symbol.flags & 1920 ? 1920 : 0); + if (targetFlags & excludedMeanings) { + var message = node.kind === 278 ? ts2.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts2.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + error2(node, message, symbolToString2(symbol)); + } + if (compilerOptions.isolatedModules && !ts2.isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 16777216)) { + var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); + var isType = !(targetFlags & 111551); + if (isType || typeOnlyAlias) { + switch (node.kind) { + case 270: + case 273: + case 268: { + if (compilerOptions.preserveValueImports) { + ts2.Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); + var message = isType ? ts2.Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : ts2.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + var name2 = ts2.idText(node.kind === 273 ? node.propertyName || node.name : node.name); + addTypeOnlyDeclarationRelatedInfo(error2(node, message, name2), isType ? void 0 : typeOnlyAlias, name2); + } + if (isType && node.kind === 268 && ts2.hasEffectiveModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + error2(node, ts2.Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided); + } + break; + } + case 278: { + if (ts2.getSourceFileOfNode(typeOnlyAlias) !== ts2.getSourceFileOfNode(node)) { + var message = isType ? ts2.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type : ts2.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled; + var name2 = ts2.idText(node.propertyName || node.name); + addTypeOnlyDeclarationRelatedInfo(error2(node, message, name2), isType ? void 0 : typeOnlyAlias, name2); + return; + } + } + } + } + } + if (ts2.isImportSpecifier(node)) { + var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node); + if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) { + addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName); + } + } + } + } + function isDeprecatedAliasedSymbol(symbol) { + return !!symbol.declarations && ts2.every(symbol.declarations, function(d7) { + return !!(ts2.getCombinedNodeFlags(d7) & 268435456); + }); + } + function checkDeprecatedAliasedSymbol(symbol, location2) { + if (!(symbol.flags & 2097152)) + return symbol; + var targetSymbol = resolveAlias(symbol); + if (targetSymbol === unknownSymbol) + return targetSymbol; + while (symbol.flags & 2097152) { + var target = getImmediateAliasedSymbol(symbol); + if (target) { + if (target === targetSymbol) + break; + if (target.declarations && ts2.length(target.declarations)) { + if (isDeprecatedAliasedSymbol(target)) { + addDeprecatedSuggestion(location2, target.declarations, target.escapedName); + break; + } else { + if (symbol === targetSymbol) + break; + symbol = target; + } + } + } else { + break; + } + } + return targetSymbol; + } + function checkImportBinding(node) { + checkCollisionsForDeclarationName(node, node.name); + checkAliasSymbol(node); + if (node.kind === 273 && ts2.idText(node.propertyName || node.name) === "default" && ts2.getESModuleInterop(compilerOptions) && moduleKind !== ts2.ModuleKind.System && (moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS)) { + checkExternalEmitHelpers( + node, + 131072 + /* ExternalEmitHelpers.ImportDefault */ + ); + } + } + function checkAssertClause(declaration) { + var _a2; + if (declaration.assertClause) { + var validForTypeAssertions = ts2.isExclusivelyTypeOnlyImportOrExport(declaration); + var override = ts2.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : void 0); + if (validForTypeAssertions && override) { + if (!ts2.isNightly()) { + grammarErrorOnNode(declaration.assertClause, ts2.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); + } + if (ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.NodeNext) { + return grammarErrorOnNode(declaration.assertClause, ts2.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); + } + return; + } + var mode = moduleKind === ts2.ModuleKind.NodeNext && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier); + if (mode !== ts2.ModuleKind.ESNext && moduleKind !== ts2.ModuleKind.ESNext) { + return grammarErrorOnNode(declaration.assertClause, moduleKind === ts2.ModuleKind.NodeNext ? ts2.Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls : ts2.Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext); + } + if (ts2.isImportDeclaration(declaration) ? (_a2 = declaration.importClause) === null || _a2 === void 0 ? void 0 : _a2.isTypeOnly : declaration.isTypeOnly) { + return grammarErrorOnNode(declaration.assertClause, ts2.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); + } + if (override) { + return grammarErrorOnNode(declaration.assertClause, ts2.Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); + } + } + } + function checkImportDeclaration(node) { + if (checkGrammarModuleElementContext(node, ts2.isInJSFile(node) ? ts2.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts2.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + if (!checkGrammarDecoratorsAndModifiers(node) && ts2.hasEffectiveModifiers(node)) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.An_import_declaration_cannot_have_modifiers); + } + if (checkExternalImportOrExportDeclaration(node)) { + var importClause = node.importClause; + if (importClause && !checkGrammarImportClause(importClause)) { + if (importClause.name) { + checkImportBinding(importClause); + } + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === 271) { + checkImportBinding(importClause.namedBindings); + if (moduleKind !== ts2.ModuleKind.System && (moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS) && ts2.getESModuleInterop(compilerOptions)) { + checkExternalEmitHelpers( + node, + 65536 + /* ExternalEmitHelpers.ImportStar */ + ); + } + } else { + var moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier); + if (moduleExisted) { + ts2.forEach(importClause.namedBindings.elements, checkImportBinding); + } + } + } + } + } + checkAssertClause(node); + } + function checkImportEqualsDeclaration(node) { + if (checkGrammarModuleElementContext(node, ts2.isInJSFile(node) ? ts2.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts2.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + checkGrammarDecoratorsAndModifiers(node); + if (ts2.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { + checkImportBinding(node); + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + markExportAsReferenced(node); + } + if (node.moduleReference.kind !== 280) { + var target = resolveAlias(getSymbolOfNode(node)); + if (target !== unknownSymbol) { + var targetFlags = getAllSymbolFlags(target); + if (targetFlags & 111551) { + var moduleName3 = ts2.getFirstIdentifier(node.moduleReference); + if (!(resolveEntityName( + moduleName3, + 111551 | 1920 + /* SymbolFlags.Namespace */ + ).flags & 1920)) { + error2(moduleName3, ts2.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts2.declarationNameToString(moduleName3)); + } + } + if (targetFlags & 788968) { + checkTypeNameIsReserved(node.name, ts2.Diagnostics.Import_name_cannot_be_0); + } + } + if (node.isTypeOnly) { + grammarErrorOnNode(node, ts2.Diagnostics.An_import_alias_cannot_use_import_type); + } + } else { + if (moduleKind >= ts2.ModuleKind.ES2015 && ts2.getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 16777216)) { + grammarErrorOnNode(node, ts2.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); + } + } + } + } + function checkExportDeclaration(node) { + if (checkGrammarModuleElementContext(node, ts2.isInJSFile(node) ? ts2.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : ts2.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + if (!checkGrammarDecoratorsAndModifiers(node) && ts2.hasSyntacticModifiers(node)) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.An_export_declaration_cannot_have_modifiers); + } + if (node.moduleSpecifier && node.exportClause && ts2.isNamedExports(node.exportClause) && ts2.length(node.exportClause.elements) && languageVersion === 0) { + checkExternalEmitHelpers( + node, + 4194304 + /* ExternalEmitHelpers.CreateBinding */ + ); + } + checkGrammarExportDeclaration(node); + if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { + if (node.exportClause && !ts2.isNamespaceExport(node.exportClause)) { + ts2.forEach(node.exportClause.elements, checkExportSpecifier); + var inAmbientExternalModule = node.parent.kind === 265 && ts2.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 265 && !node.moduleSpecifier && node.flags & 16777216; + if (node.parent.kind !== 308 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + error2(node, ts2.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); + } + } else { + var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + if (moduleSymbol && hasExportAssignmentSymbol(moduleSymbol)) { + error2(node.moduleSpecifier, ts2.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString2(moduleSymbol)); + } else if (node.exportClause) { + checkAliasSymbol(node.exportClause); + } + if (moduleKind !== ts2.ModuleKind.System && (moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS)) { + if (node.exportClause) { + if (ts2.getESModuleInterop(compilerOptions)) { + checkExternalEmitHelpers( + node, + 65536 + /* ExternalEmitHelpers.ImportStar */ + ); + } + } else { + checkExternalEmitHelpers( + node, + 32768 + /* ExternalEmitHelpers.ExportStar */ + ); + } + } + } + } + checkAssertClause(node); + } + function checkGrammarExportDeclaration(node) { + var _a2; + if (node.isTypeOnly) { + if (((_a2 = node.exportClause) === null || _a2 === void 0 ? void 0 : _a2.kind) === 276) { + return checkGrammarNamedImportsOrExports(node.exportClause); + } else { + return grammarErrorOnNode(node, ts2.Diagnostics.Only_named_exports_may_use_export_type); + } + } + return false; + } + function checkGrammarModuleElementContext(node, errorMessage) { + var isInAppropriateContext = node.parent.kind === 308 || node.parent.kind === 265 || node.parent.kind === 264; + if (!isInAppropriateContext) { + grammarErrorOnFirstToken(node, errorMessage); + } + return !isInAppropriateContext; + } + function importClauseContainsReferencedImport(importClause) { + return ts2.forEachImportClauseDeclaration(importClause, function(declaration) { + return !!getSymbolOfNode(declaration).isReferenced; + }); + } + function importClauseContainsConstEnumUsedAsValue(importClause) { + return ts2.forEachImportClauseDeclaration(importClause, function(declaration) { + return !!getSymbolLinks(getSymbolOfNode(declaration)).constEnumReferenced; + }); + } + function canConvertImportDeclarationToTypeOnly(statement) { + return ts2.isImportDeclaration(statement) && statement.importClause && !statement.importClause.isTypeOnly && importClauseContainsReferencedImport(statement.importClause) && !isReferencedAliasDeclaration( + statement.importClause, + /*checkChildren*/ + true + ) && !importClauseContainsConstEnumUsedAsValue(statement.importClause); + } + function canConvertImportEqualsDeclarationToTypeOnly(statement) { + return ts2.isImportEqualsDeclaration(statement) && ts2.isExternalModuleReference(statement.moduleReference) && !statement.isTypeOnly && getSymbolOfNode(statement).isReferenced && !isReferencedAliasDeclaration( + statement, + /*checkChildren*/ + false + ) && !getSymbolLinks(getSymbolOfNode(statement)).constEnumReferenced; + } + function checkImportsForTypeOnlyConversion(sourceFile) { + for (var _i = 0, _a2 = sourceFile.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (canConvertImportDeclarationToTypeOnly(statement) || canConvertImportEqualsDeclarationToTypeOnly(statement)) { + error2(statement, ts2.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error); + } + } + } + function checkExportSpecifier(node) { + checkAliasSymbol(node); + if (ts2.getEmitDeclarations(compilerOptions)) { + collectLinkedAliases( + node.propertyName || node.name, + /*setVisibility*/ + true + ); + } + if (!node.parent.parent.moduleSpecifier) { + var exportedName = node.propertyName || node.name; + var symbol = resolveName( + exportedName, + exportedName.escapedText, + 111551 | 788968 | 1920 | 2097152, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { + error2(exportedName, ts2.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, ts2.idText(exportedName)); + } else { + if (!node.isTypeOnly && !node.parent.parent.isTypeOnly) { + markExportAsReferenced(node); + } + var target = symbol && (symbol.flags & 2097152 ? resolveAlias(symbol) : symbol); + if (!target || getAllSymbolFlags(target) & 111551) { + checkExpressionCached(node.propertyName || node.name); + } + } + } else { + if (ts2.getESModuleInterop(compilerOptions) && moduleKind !== ts2.ModuleKind.System && (moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS) && ts2.idText(node.propertyName || node.name) === "default") { + checkExternalEmitHelpers( + node, + 131072 + /* ExternalEmitHelpers.ImportDefault */ + ); + } + } + } + function checkExportAssignment(node) { + var illegalContextMessage = node.isExportEquals ? ts2.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration : ts2.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration; + if (checkGrammarModuleElementContext(node, illegalContextMessage)) { + return; + } + var container = node.parent.kind === 308 ? node.parent : node.parent.parent; + if (container.kind === 264 && !ts2.isAmbientModule(container)) { + if (node.isExportEquals) { + error2(node, ts2.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } else { + error2(node, ts2.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } + return; + } + if (!checkGrammarDecoratorsAndModifiers(node) && ts2.hasEffectiveModifiers(node)) { + grammarErrorOnFirstToken(node, ts2.Diagnostics.An_export_assignment_cannot_have_modifiers); + } + var typeAnnotationNode = ts2.getEffectiveTypeAnnotationNode(node); + if (typeAnnotationNode) { + checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); + } + if (node.expression.kind === 79) { + var id = node.expression; + var sym = resolveEntityName( + id, + 67108863, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + node + ); + if (sym) { + markAliasReferenced(sym, id); + var target = sym.flags & 2097152 ? resolveAlias(sym) : sym; + if (getAllSymbolFlags(target) & 111551) { + checkExpressionCached(node.expression); + } + } else { + checkExpressionCached(node.expression); + } + if (ts2.getEmitDeclarations(compilerOptions)) { + collectLinkedAliases( + node.expression, + /*setVisibility*/ + true + ); + } + } else { + checkExpressionCached(node.expression); + } + checkExternalModuleExports(container); + if (node.flags & 16777216 && !ts2.isEntityNameExpression(node.expression)) { + grammarErrorOnNode(node.expression, ts2.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); + } + if (node.isExportEquals && !(node.flags & 16777216)) { + if (moduleKind >= ts2.ModuleKind.ES2015 && ts2.getSourceFileOfNode(node).impliedNodeFormat !== ts2.ModuleKind.CommonJS) { + grammarErrorOnNode(node, ts2.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); + } else if (moduleKind === ts2.ModuleKind.System) { + grammarErrorOnNode(node, ts2.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } + } + } + function hasExportedMembers(moduleSymbol) { + return ts2.forEachEntry(moduleSymbol.exports, function(_6, id) { + return id !== "export="; + }); + } + function checkExternalModuleExports(node) { + var moduleSymbol = getSymbolOfNode(node); + var links = getSymbolLinks(moduleSymbol); + if (!links.exportsChecked) { + var exportEqualsSymbol = moduleSymbol.exports.get("export="); + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + if (declaration && !isTopLevelInExternalModuleAugmentation(declaration) && !ts2.isInJSFile(declaration)) { + error2(declaration, ts2.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } + } + var exports_3 = getExportsOfModule(moduleSymbol); + if (exports_3) { + exports_3.forEach(function(_a2, id) { + var declarations = _a2.declarations, flags = _a2.flags; + if (id === "__export") { + return; + } + if (flags & (1920 | 384)) { + return; + } + var exportedDeclarationsCount = ts2.countWhere(declarations, ts2.and(isNotOverloadAndNotAccessor, ts2.not(ts2.isInterfaceDeclaration))); + if (flags & 524288 && exportedDeclarationsCount <= 2) { + return; + } + if (exportedDeclarationsCount > 1) { + if (!isDuplicatedCommonJSExport(declarations)) { + for (var _i = 0, _b = declarations; _i < _b.length; _i++) { + var declaration2 = _b[_i]; + if (isNotOverload(declaration2)) { + diagnostics.add(ts2.createDiagnosticForNode(declaration2, ts2.Diagnostics.Cannot_redeclare_exported_variable_0, ts2.unescapeLeadingUnderscores(id))); + } + } + } + } + }); + } + links.exportsChecked = true; + } + } + function isDuplicatedCommonJSExport(declarations) { + return declarations && declarations.length > 1 && declarations.every(function(d7) { + return ts2.isInJSFile(d7) && ts2.isAccessExpression(d7) && (ts2.isExportsIdentifier(d7.expression) || ts2.isModuleExportsAccessExpression(d7.expression)); + }); + } + function checkSourceElement(node) { + if (node) { + var saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + checkSourceElementWorker(node); + currentNode = saveCurrentNode; + } + } + function checkSourceElementWorker(node) { + ts2.forEach(node.jsDoc, function(_a2) { + var comment = _a2.comment, tags6 = _a2.tags; + checkJSDocCommentWorker(comment); + ts2.forEach(tags6, function(tag) { + checkJSDocCommentWorker(tag.comment); + if (ts2.isInJSFile(node)) { + checkSourceElement(tag); + } + }); + }); + var kind = node.kind; + if (cancellationToken) { + switch (kind) { + case 264: + case 260: + case 261: + case 259: + cancellationToken.throwIfCancellationRequested(); + } + } + if (kind >= 240 && kind <= 256 && node.flowNode && !isReachableFlowNode(node.flowNode)) { + errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, ts2.Diagnostics.Unreachable_code_detected); + } + switch (kind) { + case 165: + return checkTypeParameter(node); + case 166: + return checkParameter(node); + case 169: + return checkPropertyDeclaration(node); + case 168: + return checkPropertySignature(node); + case 182: + case 181: + case 176: + case 177: + case 178: + return checkSignatureDeclaration(node); + case 171: + case 170: + return checkMethodDeclaration(node); + case 172: + return checkClassStaticBlockDeclaration(node); + case 173: + return checkConstructorDeclaration(node); + case 174: + case 175: + return checkAccessorDeclaration(node); + case 180: + return checkTypeReferenceNode(node); + case 179: + return checkTypePredicate(node); + case 183: + return checkTypeQuery(node); + case 184: + return checkTypeLiteral(node); + case 185: + return checkArrayType(node); + case 186: + return checkTupleType(node); + case 189: + case 190: + return checkUnionOrIntersectionType(node); + case 193: + case 187: + case 188: + return checkSourceElement(node.type); + case 194: + return checkThisType(node); + case 195: + return checkTypeOperator(node); + case 191: + return checkConditionalType(node); + case 192: + return checkInferType(node); + case 200: + return checkTemplateLiteralType(node); + case 202: + return checkImportType(node); + case 199: + return checkNamedTupleMember(node); + case 331: + return checkJSDocAugmentsTag(node); + case 332: + return checkJSDocImplementsTag(node); + case 348: + case 341: + case 342: + return checkJSDocTypeAliasTag(node); + case 347: + return checkJSDocTemplateTag(node); + case 346: + return checkJSDocTypeTag(node); + case 327: + case 328: + case 329: + return checkJSDocLinkLikeTag(node); + case 343: + return checkJSDocParameterTag(node); + case 350: + return checkJSDocPropertyTag(node); + case 320: + checkJSDocFunctionType(node); + case 318: + case 317: + case 315: + case 316: + case 325: + checkJSDocTypeIsInJsFile(node); + ts2.forEachChild(node, checkSourceElement); + return; + case 321: + checkJSDocVariadicType(node); + return; + case 312: + return checkSourceElement(node.type); + case 336: + case 338: + case 337: + return checkJSDocAccessibilityModifiers(node); + case 196: + return checkIndexedAccessType(node); + case 197: + return checkMappedType(node); + case 259: + return checkFunctionDeclaration(node); + case 238: + case 265: + return checkBlock(node); + case 240: + return checkVariableStatement(node); + case 241: + return checkExpressionStatement(node); + case 242: + return checkIfStatement(node); + case 243: + return checkDoStatement(node); + case 244: + return checkWhileStatement(node); + case 245: + return checkForStatement(node); + case 246: + return checkForInStatement(node); + case 247: + return checkForOfStatement(node); + case 248: + case 249: + return checkBreakOrContinueStatement(node); + case 250: + return checkReturnStatement(node); + case 251: + return checkWithStatement(node); + case 252: + return checkSwitchStatement(node); + case 253: + return checkLabeledStatement(node); + case 254: + return checkThrowStatement(node); + case 255: + return checkTryStatement(node); + case 257: + return checkVariableDeclaration(node); + case 205: + return checkBindingElement(node); + case 260: + return checkClassDeclaration(node); + case 261: + return checkInterfaceDeclaration(node); + case 262: + return checkTypeAliasDeclaration(node); + case 263: + return checkEnumDeclaration(node); + case 264: + return checkModuleDeclaration(node); + case 269: + return checkImportDeclaration(node); + case 268: + return checkImportEqualsDeclaration(node); + case 275: + return checkExportDeclaration(node); + case 274: + return checkExportAssignment(node); + case 239: + case 256: + checkGrammarStatementInAmbientContext(node); + return; + case 279: + return checkMissingDeclaration(node); + } + } + function checkJSDocCommentWorker(node) { + if (ts2.isArray(node)) { + ts2.forEach(node, function(tag) { + if (ts2.isJSDocLinkLike(tag)) { + checkSourceElement(tag); + } + }); + } + } + function checkJSDocTypeIsInJsFile(node) { + if (!ts2.isInJSFile(node)) { + grammarErrorOnNode(node, ts2.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } + } + function checkJSDocVariadicType(node) { + checkJSDocTypeIsInJsFile(node); + checkSourceElement(node.type); + var parent2 = node.parent; + if (ts2.isParameter(parent2) && ts2.isJSDocFunctionType(parent2.parent)) { + if (ts2.last(parent2.parent.parameters) !== parent2) { + error2(node, ts2.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + return; + } + if (!ts2.isJSDocTypeExpression(parent2)) { + error2(node, ts2.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + } + var paramTag = node.parent.parent; + if (!ts2.isJSDocParameterTag(paramTag)) { + error2(node, ts2.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + return; + } + var param = ts2.getParameterSymbolFromJSDoc(paramTag); + if (!param) { + return; + } + var host2 = ts2.getHostSignatureFromJSDoc(paramTag); + if (!host2 || ts2.last(host2.parameters).symbol !== param) { + error2(node, ts2.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + } + function getTypeFromJSDocVariadicType(node) { + var type3 = getTypeFromTypeNode(node.type); + var parent2 = node.parent; + var paramTag = node.parent.parent; + if (ts2.isJSDocTypeExpression(node.parent) && ts2.isJSDocParameterTag(paramTag)) { + var host_1 = ts2.getHostSignatureFromJSDoc(paramTag); + var isCallbackTag = ts2.isJSDocCallbackTag(paramTag.parent.parent); + if (host_1 || isCallbackTag) { + var lastParamDeclaration = isCallbackTag ? ts2.lastOrUndefined(paramTag.parent.parent.typeExpression.parameters) : ts2.lastOrUndefined(host_1.parameters); + var symbol = ts2.getParameterSymbolFromJSDoc(paramTag); + if (!lastParamDeclaration || symbol && lastParamDeclaration.symbol === symbol && ts2.isRestParameter(lastParamDeclaration)) { + return createArrayType(type3); + } + } + } + if (ts2.isParameter(parent2) && ts2.isJSDocFunctionType(parent2.parent)) { + return createArrayType(type3); + } + return addOptionality(type3); + } + function checkNodeDeferred(node) { + var enclosingFile = ts2.getSourceFileOfNode(node); + var links = getNodeLinks(enclosingFile); + if (!(links.flags & 1)) { + links.deferredNodes || (links.deferredNodes = new ts2.Set()); + links.deferredNodes.add(node); + } + } + function checkDeferredNodes(context2) { + var links = getNodeLinks(context2); + if (links.deferredNodes) { + links.deferredNodes.forEach(checkDeferredNode); + } + } + function checkDeferredNode(node) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + var saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + switch (node.kind) { + case 210: + case 211: + case 212: + case 167: + case 283: + resolveUntypedCall(node); + break; + case 215: + case 216: + case 171: + case 170: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 174: + case 175: + checkAccessorDeclaration(node); + break; + case 228: + checkClassExpressionDeferred(node); + break; + case 165: + checkTypeParameterDeferred(node); + break; + case 282: + checkJsxSelfClosingElementDeferred(node); + break; + case 281: + checkJsxElementDeferred(node); + break; + } + currentNode = saveCurrentNode; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + function checkSourceFile(node) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "check", + "checkSourceFile", + { path: node.path }, + /*separateBeginAndEnd*/ + true + ); + ts2.performance.mark("beforeCheck"); + checkSourceFileWorker(node); + ts2.performance.mark("afterCheck"); + ts2.performance.measure("Check", "beforeCheck", "afterCheck"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + function unusedIsError(kind, isAmbient) { + if (isAmbient) { + return false; + } + switch (kind) { + case 0: + return !!compilerOptions.noUnusedLocals; + case 1: + return !!compilerOptions.noUnusedParameters; + default: + return ts2.Debug.assertNever(kind); + } + } + function getPotentiallyUnusedIdentifiers(sourceFile) { + return allPotentiallyUnusedIdentifiers.get(sourceFile.path) || ts2.emptyArray; + } + function checkSourceFileWorker(node) { + var links = getNodeLinks(node); + if (!(links.flags & 1)) { + if (ts2.skipTypeChecking(node, compilerOptions, host)) { + return; + } + checkGrammarSourceFile(node); + ts2.clear(potentialThisCollisions); + ts2.clear(potentialNewTargetCollisions); + ts2.clear(potentialWeakMapSetCollisions); + ts2.clear(potentialReflectCollisions); + ts2.clear(potentialUnusedRenamedBindingElementsInTypes); + ts2.forEach(node.statements, checkSourceElement); + checkSourceElement(node.endOfFileToken); + checkDeferredNodes(node); + if (ts2.isExternalOrCommonJsModule(node)) { + registerForUnusedIdentifiersCheck(node); + } + addLazyDiagnostic(function() { + if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) { + checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), function(containingNode, kind, diag) { + if (!ts2.containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 16777216))) { + diagnostics.add(diag); + } + }); + } + if (!node.isDeclarationFile) { + checkPotentialUncheckedRenamedBindingElementsInTypes(); + } + }); + if (compilerOptions.importsNotUsedAsValues === 2 && !node.isDeclarationFile && ts2.isExternalModule(node)) { + checkImportsForTypeOnlyConversion(node); + } + if (ts2.isExternalOrCommonJsModule(node)) { + checkExternalModuleExports(node); + } + if (potentialThisCollisions.length) { + ts2.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); + ts2.clear(potentialThisCollisions); + } + if (potentialNewTargetCollisions.length) { + ts2.forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + ts2.clear(potentialNewTargetCollisions); + } + if (potentialWeakMapSetCollisions.length) { + ts2.forEach(potentialWeakMapSetCollisions, checkWeakMapSetCollision); + ts2.clear(potentialWeakMapSetCollisions); + } + if (potentialReflectCollisions.length) { + ts2.forEach(potentialReflectCollisions, checkReflectCollision); + ts2.clear(potentialReflectCollisions); + } + links.flags |= 1; + } + } + function getDiagnostics(sourceFile, ct) { + try { + cancellationToken = ct; + return getDiagnosticsWorker(sourceFile); + } finally { + cancellationToken = void 0; + } + } + function ensurePendingDiagnosticWorkComplete() { + for (var _i = 0, deferredDiagnosticsCallbacks_1 = deferredDiagnosticsCallbacks; _i < deferredDiagnosticsCallbacks_1.length; _i++) { + var cb = deferredDiagnosticsCallbacks_1[_i]; + cb(); + } + deferredDiagnosticsCallbacks = []; + } + function checkSourceFileWithEagerDiagnostics(sourceFile) { + ensurePendingDiagnosticWorkComplete(); + var oldAddLazyDiagnostics = addLazyDiagnostic; + addLazyDiagnostic = function(cb) { + return cb(); + }; + checkSourceFile(sourceFile); + addLazyDiagnostic = oldAddLazyDiagnostics; + } + function getDiagnosticsWorker(sourceFile) { + if (sourceFile) { + ensurePendingDiagnosticWorkComplete(); + var previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); + var previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length; + checkSourceFileWithEagerDiagnostics(sourceFile); + var semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); + var currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); + if (currentGlobalDiagnostics !== previousGlobalDiagnostics) { + var deferredGlobalDiagnostics = ts2.relativeComplement(previousGlobalDiagnostics, currentGlobalDiagnostics, ts2.compareDiagnostics); + return ts2.concatenate(deferredGlobalDiagnostics, semanticDiagnostics); + } else if (previousGlobalDiagnosticsSize === 0 && currentGlobalDiagnostics.length > 0) { + return ts2.concatenate(currentGlobalDiagnostics, semanticDiagnostics); + } + return semanticDiagnostics; + } + ts2.forEach(host.getSourceFiles(), checkSourceFileWithEagerDiagnostics); + return diagnostics.getDiagnostics(); + } + function getGlobalDiagnostics() { + ensurePendingDiagnosticWorkComplete(); + return diagnostics.getGlobalDiagnostics(); + } + function getSymbolsInScope(location2, meaning) { + if (location2.flags & 33554432) { + return []; + } + var symbols = ts2.createSymbolTable(); + var isStaticSymbol = false; + populateSymbols(); + symbols.delete( + "this" + /* InternalSymbolName.This */ + ); + return symbolsToArray(symbols); + function populateSymbols() { + while (location2) { + if (location2.locals && !isGlobalSourceFile(location2)) { + copySymbols2(location2.locals, meaning); + } + switch (location2.kind) { + case 308: + if (!ts2.isExternalModule(location2)) + break; + case 264: + copyLocallyVisibleExportSymbols( + getSymbolOfNode(location2).exports, + meaning & 2623475 + /* SymbolFlags.ModuleMember */ + ); + break; + case 263: + copySymbols2( + getSymbolOfNode(location2).exports, + meaning & 8 + /* SymbolFlags.EnumMember */ + ); + break; + case 228: + var className = location2.name; + if (className) { + copySymbol(location2.symbol, meaning); + } + case 260: + case 261: + if (!isStaticSymbol) { + copySymbols2( + getMembersOfSymbol(getSymbolOfNode(location2)), + meaning & 788968 + /* SymbolFlags.Type */ + ); + } + break; + case 215: + var funcName = location2.name; + if (funcName) { + copySymbol(location2.symbol, meaning); + } + break; + } + if (ts2.introducesArgumentsExoticObject(location2)) { + copySymbol(argumentsSymbol, meaning); + } + isStaticSymbol = ts2.isStatic(location2); + location2 = location2.parent; + } + copySymbols2(globals3, meaning); + } + function copySymbol(symbol, meaning2) { + if (ts2.getCombinedLocalAndExportSymbolFlags(symbol) & meaning2) { + var id = symbol.escapedName; + if (!symbols.has(id)) { + symbols.set(id, symbol); + } + } + } + function copySymbols2(source, meaning2) { + if (meaning2) { + source.forEach(function(symbol) { + copySymbol(symbol, meaning2); + }); + } + } + function copyLocallyVisibleExportSymbols(source, meaning2) { + if (meaning2) { + source.forEach(function(symbol) { + if (!ts2.getDeclarationOfKind( + symbol, + 278 + /* SyntaxKind.ExportSpecifier */ + ) && !ts2.getDeclarationOfKind( + symbol, + 277 + /* SyntaxKind.NamespaceExport */ + )) { + copySymbol(symbol, meaning2); + } + }); + } + } + } + function isTypeDeclarationName(name2) { + return name2.kind === 79 && ts2.isTypeDeclaration(name2.parent) && ts2.getNameOfDeclaration(name2.parent) === name2; + } + function isTypeReferenceIdentifier(node) { + while (node.parent.kind === 163) { + node = node.parent; + } + return node.parent.kind === 180; + } + function isHeritageClauseElementIdentifier(node) { + while (node.parent.kind === 208) { + node = node.parent; + } + return node.parent.kind === 230; + } + function forEachEnclosingClass(node, callback) { + var result2; + while (true) { + node = ts2.getContainingClass(node); + if (!node) + break; + if (result2 = callback(node)) + break; + } + return result2; + } + function isNodeUsedDuringClassInitialization(node) { + return !!ts2.findAncestor(node, function(element) { + if (ts2.isConstructorDeclaration(element) && ts2.nodeIsPresent(element.body) || ts2.isPropertyDeclaration(element)) { + return true; + } else if (ts2.isClassLike(element) || ts2.isFunctionLikeDeclaration(element)) { + return "quit"; + } + return false; + }); + } + function isNodeWithinClass(node, classDeclaration) { + return !!forEachEnclosingClass(node, function(n7) { + return n7 === classDeclaration; + }); + } + function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { + while (nodeOnRightSide.parent.kind === 163) { + nodeOnRightSide = nodeOnRightSide.parent; + } + if (nodeOnRightSide.parent.kind === 268) { + return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; + } + if (nodeOnRightSide.parent.kind === 274) { + return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; + } + return void 0; + } + function isInRightSideOfImportOrExportAssignment(node) { + return getLeftSideOfImportEqualsOrExportAssignment(node) !== void 0; + } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + var specialPropertyAssignmentKind = ts2.getAssignmentDeclarationKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1: + case 3: + return getSymbolOfNode(entityName.parent); + case 4: + case 2: + case 5: + return getSymbolOfNode(entityName.parent.parent); + } + } + function isImportTypeQualifierPart(node) { + var parent2 = node.parent; + while (ts2.isQualifiedName(parent2)) { + node = parent2; + parent2 = parent2.parent; + } + if (parent2 && parent2.kind === 202 && parent2.qualifier === node) { + return parent2; + } + return void 0; + } + function getSymbolOfNameOrPropertyAccessExpression(name2) { + if (ts2.isDeclarationName(name2)) { + return getSymbolOfNode(name2.parent); + } + if (ts2.isInJSFile(name2) && name2.parent.kind === 208 && name2.parent === name2.parent.parent.left) { + if (!ts2.isPrivateIdentifier(name2) && !ts2.isJSDocMemberName(name2)) { + var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name2); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; + } + } + } + if (name2.parent.kind === 274 && ts2.isEntityNameExpression(name2)) { + var success = resolveEntityName( + name2, + /*all meanings*/ + 111551 | 788968 | 1920 | 2097152, + /*ignoreErrors*/ + true + ); + if (success && success !== unknownSymbol) { + return success; + } + } else if (ts2.isEntityName(name2) && isInRightSideOfImportOrExportAssignment(name2)) { + var importEqualsDeclaration = ts2.getAncestor( + name2, + 268 + /* SyntaxKind.ImportEqualsDeclaration */ + ); + ts2.Debug.assert(importEqualsDeclaration !== void 0); + return getSymbolOfPartOfRightHandSideOfImportEquals( + name2, + /*dontResolveAlias*/ + true + ); + } + if (ts2.isEntityName(name2)) { + var possibleImportNode = isImportTypeQualifierPart(name2); + if (possibleImportNode) { + getTypeFromTypeNode(possibleImportNode); + var sym = getNodeLinks(name2).resolvedSymbol; + return sym === unknownSymbol ? void 0 : sym; + } + } + while (ts2.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name2)) { + name2 = name2.parent; + } + if (isHeritageClauseElementIdentifier(name2)) { + var meaning = 0; + if (name2.parent.kind === 230) { + meaning = 788968; + if (ts2.isExpressionWithTypeArgumentsInClassExtendsClause(name2.parent)) { + meaning |= 111551; + } + } else { + meaning = 1920; + } + meaning |= 2097152; + var entityNameSymbol = ts2.isEntityNameExpression(name2) ? resolveEntityName(name2, meaning) : void 0; + if (entityNameSymbol) { + return entityNameSymbol; + } + } + if (name2.parent.kind === 343) { + return ts2.getParameterSymbolFromJSDoc(name2.parent); + } + if (name2.parent.kind === 165 && name2.parent.parent.kind === 347) { + ts2.Debug.assert(!ts2.isInJSFile(name2)); + var typeParameter = ts2.getTypeParameterFromJsDoc(name2.parent); + return typeParameter && typeParameter.symbol; + } + if (ts2.isExpressionNode(name2)) { + if (ts2.nodeIsMissing(name2)) { + return void 0; + } + var isJSDoc_1 = ts2.findAncestor(name2, ts2.or(ts2.isJSDocLinkLike, ts2.isJSDocNameReference, ts2.isJSDocMemberName)); + var meaning = isJSDoc_1 ? 788968 | 1920 | 111551 : 111551; + if (name2.kind === 79) { + if (ts2.isJSXTagName(name2) && isJsxIntrinsicIdentifier(name2)) { + var symbol = getIntrinsicTagSymbol(name2.parent); + return symbol === unknownSymbol ? void 0 : symbol; + } + var result2 = resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + false, + /* dontResolveAlias */ + true, + ts2.getHostSignatureFromJSDoc(name2) + ); + if (!result2 && isJSDoc_1) { + var container = ts2.findAncestor(name2, ts2.or(ts2.isClassLike, ts2.isInterfaceDeclaration)); + if (container) { + return resolveJSDocMemberName( + name2, + /*ignoreErrors*/ + false, + getSymbolOfNode(container) + ); + } + } + if (result2 && isJSDoc_1) { + var container = ts2.getJSDocHost(name2); + if (container && ts2.isEnumMember(container) && container === result2.valueDeclaration) { + return resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + true, + /* dontResolveAlias */ + true, + ts2.getSourceFileOfNode(container) + ) || result2; + } + } + return result2; + } else if (ts2.isPrivateIdentifier(name2)) { + return getSymbolForPrivateIdentifierExpression(name2); + } else if (name2.kind === 208 || name2.kind === 163) { + var links = getNodeLinks(name2); + if (links.resolvedSymbol) { + return links.resolvedSymbol; + } + if (name2.kind === 208) { + checkPropertyAccessExpression( + name2, + 0 + /* CheckMode.Normal */ + ); + if (!links.resolvedSymbol) { + var expressionType = checkExpressionCached(name2.expression); + var infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name2.name)); + if (infos.length && expressionType.members) { + var resolved = resolveStructuredTypeMembers(expressionType); + var symbol = resolved.members.get( + "__index" + /* InternalSymbolName.Index */ + ); + if (infos === getIndexInfosOfType(expressionType)) { + links.resolvedSymbol = symbol; + } else if (symbol) { + var symbolLinks_1 = getSymbolLinks(symbol); + var declarationList = ts2.mapDefined(infos, function(i7) { + return i7.declaration; + }); + var nodeListId = ts2.map(declarationList, getNodeId).join(","); + if (!symbolLinks_1.filteredIndexSymbolCache) { + symbolLinks_1.filteredIndexSymbolCache = new ts2.Map(); + } + if (symbolLinks_1.filteredIndexSymbolCache.has(nodeListId)) { + links.resolvedSymbol = symbolLinks_1.filteredIndexSymbolCache.get(nodeListId); + } else { + var copy4 = createSymbol( + 131072, + "__index" + /* InternalSymbolName.Index */ + ); + copy4.declarations = ts2.mapDefined(infos, function(i7) { + return i7.declaration; + }); + copy4.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy4.declarations[0].parent); + symbolLinks_1.filteredIndexSymbolCache.set(nodeListId, copy4); + links.resolvedSymbol = symbolLinks_1.filteredIndexSymbolCache.get(nodeListId); + } + } + } + } + } else { + checkQualifiedName( + name2, + 0 + /* CheckMode.Normal */ + ); + } + if (!links.resolvedSymbol && isJSDoc_1 && ts2.isQualifiedName(name2)) { + return resolveJSDocMemberName(name2); + } + return links.resolvedSymbol; + } else if (ts2.isJSDocMemberName(name2)) { + return resolveJSDocMemberName(name2); + } + } else if (isTypeReferenceIdentifier(name2)) { + var meaning = name2.parent.kind === 180 ? 788968 : 1920; + var symbol = resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + false, + /*dontResolveAlias*/ + true + ); + return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name2); + } + if (name2.parent.kind === 179) { + return resolveEntityName( + name2, + /*meaning*/ + 1 + /* SymbolFlags.FunctionScopedVariable */ + ); + } + return void 0; + } + function resolveJSDocMemberName(name2, ignoreErrors, container) { + if (ts2.isEntityName(name2)) { + var meaning = 788968 | 1920 | 111551; + var symbol = resolveEntityName( + name2, + meaning, + ignoreErrors, + /*dontResolveAlias*/ + true, + ts2.getHostSignatureFromJSDoc(name2) + ); + if (!symbol && ts2.isIdentifier(name2) && container) { + symbol = getMergedSymbol(getSymbol(getExportsOfSymbol(container), name2.escapedText, meaning)); + } + if (symbol) { + return symbol; + } + } + var left = ts2.isIdentifier(name2) ? container : resolveJSDocMemberName(name2.left, ignoreErrors, container); + var right = ts2.isIdentifier(name2) ? name2.escapedText : name2.right.escapedText; + if (left) { + var proto = left.flags & 111551 && getPropertyOfType(getTypeOfSymbol(left), "prototype"); + var t8 = proto ? getTypeOfSymbol(proto) : getDeclaredTypeOfSymbol(left); + return getPropertyOfType(t8, right); + } + } + function getSymbolAtLocation(node, ignoreErrors) { + if (node.kind === 308) { + return ts2.isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0; + } + var parent2 = node.parent; + var grandParent = parent2.parent; + if (node.flags & 33554432) { + return void 0; + } + if (isDeclarationNameOrImportPropertyName(node)) { + var parentSymbol = getSymbolOfNode(parent2); + return ts2.isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node ? getImmediateAliasedSymbol(parentSymbol) : parentSymbol; + } else if (ts2.isLiteralComputedPropertyDeclarationName(node)) { + return getSymbolOfNode(parent2.parent); + } + if (node.kind === 79) { + if (isInRightSideOfImportOrExportAssignment(node)) { + return getSymbolOfNameOrPropertyAccessExpression(node); + } else if (parent2.kind === 205 && grandParent.kind === 203 && node === parent2.propertyName) { + var typeOfPattern = getTypeOfNode(grandParent); + var propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); + if (propertyDeclaration) { + return propertyDeclaration; + } + } else if (ts2.isMetaProperty(parent2) && parent2.name === node) { + if (parent2.keywordToken === 103 && ts2.idText(node) === "target") { + return checkNewTargetMetaProperty(parent2).symbol; + } + if (parent2.keywordToken === 100 && ts2.idText(node) === "meta") { + return getGlobalImportMetaExpressionType().members.get("meta"); + } + return void 0; + } + } + switch (node.kind) { + case 79: + case 80: + case 208: + case 163: + if (!ts2.isThisInTypeQuery(node)) { + return getSymbolOfNameOrPropertyAccessExpression(node); + } + case 108: + var container = ts2.getThisContainer( + node, + /*includeArrowFunctions*/ + false + ); + if (ts2.isFunctionLike(container)) { + var sig = getSignatureFromDeclaration(container); + if (sig.thisParameter) { + return sig.thisParameter; + } + } + if (ts2.isInExpressionContext(node)) { + return checkExpression(node).symbol; + } + case 194: + return getTypeFromThisTypeNode(node).symbol; + case 106: + return checkExpression(node).symbol; + case 135: + var constructorDeclaration = node.parent; + if (constructorDeclaration && constructorDeclaration.kind === 173) { + return constructorDeclaration.parent.symbol; + } + return void 0; + case 10: + case 14: + if (ts2.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts2.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 269 || node.parent.kind === 275) && node.parent.moduleSpecifier === node || (ts2.isInJSFile(node) && ts2.isRequireCall( + node.parent, + /*checkArgumentIsStringLiteralLike*/ + false + ) || ts2.isImportCall(node.parent)) || ts2.isLiteralTypeNode(node.parent) && ts2.isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) { + return resolveExternalModuleName(node, node, ignoreErrors); + } + if (ts2.isCallExpression(parent2) && ts2.isBindableObjectDefinePropertyCall(parent2) && parent2.arguments[1] === node) { + return getSymbolOfNode(parent2); + } + case 8: + var objectType2 = ts2.isElementAccessExpression(parent2) ? parent2.argumentExpression === node ? getTypeOfExpression(parent2.expression) : void 0 : ts2.isLiteralTypeNode(parent2) && ts2.isIndexedAccessTypeNode(grandParent) ? getTypeFromTypeNode(grandParent.objectType) : void 0; + return objectType2 && getPropertyOfType(objectType2, ts2.escapeLeadingUnderscores(node.text)); + case 88: + case 98: + case 38: + case 84: + return getSymbolOfNode(node.parent); + case 202: + return ts2.isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0; + case 93: + return ts2.isExportAssignment(node.parent) ? ts2.Debug.checkDefined(node.parent.symbol) : void 0; + case 100: + case 103: + return ts2.isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; + case 233: + return checkExpression(node).symbol; + default: + return void 0; + } + } + function getIndexInfosAtLocation(node) { + if (ts2.isIdentifier(node) && ts2.isPropertyAccessExpression(node.parent) && node.parent.name === node) { + var keyType_1 = getLiteralTypeFromPropertyName(node); + var objectType2 = getTypeOfExpression(node.parent.expression); + var objectTypes = objectType2.flags & 1048576 ? objectType2.types : [objectType2]; + return ts2.flatMap(objectTypes, function(t8) { + return ts2.filter(getIndexInfosOfType(t8), function(info2) { + return isApplicableIndexType(keyType_1, info2.keyType); + }); + }); + } + return void 0; + } + function getShorthandAssignmentValueSymbol(location2) { + if (location2 && location2.kind === 300) { + return resolveEntityName( + location2.name, + 111551 | 2097152 + /* SymbolFlags.Alias */ + ); + } + return void 0; + } + function getExportSpecifierLocalTargetSymbol(node) { + if (ts2.isExportSpecifier(node)) { + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName( + node.propertyName || node.name, + 111551 | 788968 | 1920 | 2097152 + /* SymbolFlags.Alias */ + ); + } else { + return resolveEntityName( + node, + 111551 | 788968 | 1920 | 2097152 + /* SymbolFlags.Alias */ + ); + } + } + function getTypeOfNode(node) { + if (ts2.isSourceFile(node) && !ts2.isExternalModule(node)) { + return errorType; + } + if (node.flags & 33554432) { + return errorType; + } + var classDecl = ts2.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + var classType = classDecl && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(classDecl.class)); + if (ts2.isPartOfTypeNode(node)) { + var typeFromTypeNode = getTypeFromTypeNode(node); + return classType ? getTypeWithThisArgument(typeFromTypeNode, classType.thisType) : typeFromTypeNode; + } + if (ts2.isExpressionNode(node)) { + return getRegularTypeOfExpression(node); + } + if (classType && !classDecl.isImplements) { + var baseType = ts2.firstOrUndefined(getBaseTypes(classType)); + return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType; + } + if (ts2.isTypeDeclaration(node)) { + var symbol = getSymbolOfNode(node); + return getDeclaredTypeOfSymbol(symbol); + } + if (isTypeDeclarationName(node)) { + var symbol = getSymbolAtLocation(node); + return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; + } + if (ts2.isDeclaration(node)) { + var symbol = getSymbolOfNode(node); + return symbol ? getTypeOfSymbol(symbol) : errorType; + } + if (isDeclarationNameOrImportPropertyName(node)) { + var symbol = getSymbolAtLocation(node); + if (symbol) { + return getTypeOfSymbol(symbol); + } + return errorType; + } + if (ts2.isBindingPattern(node)) { + return getTypeForVariableLikeDeclaration( + node.parent, + /*includeOptionality*/ + true, + 0 + /* CheckMode.Normal */ + ) || errorType; + } + if (isInRightSideOfImportOrExportAssignment(node)) { + var symbol = getSymbolAtLocation(node); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol); + } + } + if (ts2.isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) { + return checkMetaPropertyKeyword(node.parent); + } + return errorType; + } + function getTypeOfAssignmentPattern(expr) { + ts2.Debug.assert( + expr.kind === 207 || expr.kind === 206 + /* SyntaxKind.ArrayLiteralExpression */ + ); + if (expr.parent.kind === 247) { + var iteratedType = checkRightHandSideOfForOf(expr.parent); + return checkDestructuringAssignment(expr, iteratedType || errorType); + } + if (expr.parent.kind === 223) { + var iteratedType = getTypeOfExpression(expr.parent.right); + return checkDestructuringAssignment(expr, iteratedType || errorType); + } + if (expr.parent.kind === 299) { + var node_3 = ts2.cast(expr.parent.parent, ts2.isObjectLiteralExpression); + var typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node_3) || errorType; + var propertyIndex = ts2.indexOfNode(node_3.properties, expr.parent); + return checkObjectLiteralDestructuringPropertyAssignment(node_3, typeOfParentObjectLiteral, propertyIndex); + } + var node = ts2.cast(expr.parent, ts2.isArrayLiteralExpression); + var typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType; + var elementType = checkIteratedTypeOrElementType(65, typeOfArrayLiteral, undefinedType2, expr.parent) || errorType; + return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType); + } + function getPropertySymbolOfDestructuringAssignment(location2) { + var typeOfObjectLiteral = getTypeOfAssignmentPattern(ts2.cast(location2.parent.parent, ts2.isAssignmentPattern)); + return typeOfObjectLiteral && getPropertyOfType(typeOfObjectLiteral, location2.escapedText); + } + function getRegularTypeOfExpression(expr) { + if (ts2.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + expr = expr.parent; + } + return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); + } + function getParentTypeOfClassElement(node) { + var classSymbol = getSymbolOfNode(node.parent); + return ts2.isStatic(node) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); + } + function getClassElementPropertyKeyType(element) { + var name2 = element.name; + switch (name2.kind) { + case 79: + return getStringLiteralType(ts2.idText(name2)); + case 8: + case 10: + return getStringLiteralType(name2.text); + case 164: + var nameType = checkComputedPropertyName(name2); + return isTypeAssignableToKind( + nameType, + 12288 + /* TypeFlags.ESSymbolLike */ + ) ? nameType : stringType2; + default: + return ts2.Debug.fail("Unsupported property name."); + } + } + function getAugmentedPropertiesOfType(type3) { + type3 = getApparentType(type3); + var propsByName = ts2.createSymbolTable(getPropertiesOfType(type3)); + var functionType2 = getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ).length ? globalCallableFunctionType : getSignaturesOfType( + type3, + 1 + /* SignatureKind.Construct */ + ).length ? globalNewableFunctionType : void 0; + if (functionType2) { + ts2.forEach(getPropertiesOfType(functionType2), function(p7) { + if (!propsByName.has(p7.escapedName)) { + propsByName.set(p7.escapedName, p7); + } + }); + } + return getNamedMembers(propsByName); + } + function typeHasCallOrConstructSignatures(type3) { + return ts2.typeHasCallOrConstructSignatures(type3, checker); + } + function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts2.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { + if (ts2.getCheckFlags(symbol) & 6) { + return ts2.mapDefined(getSymbolLinks(symbol).containingType.types, function(type3) { + return getPropertyOfType(type3, symbol.escapedName); + }); + } else if (symbol.flags & 33554432) { + var _a2 = symbol, leftSpread = _a2.leftSpread, rightSpread = _a2.rightSpread, syntheticOrigin = _a2.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : ts2.singleElementArray(tryGetTarget(symbol)); + } + return void 0; + } + function tryGetTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; + } + function isArgumentsLocalBinding(nodeIn) { + if (ts2.isGeneratedIdentifier(nodeIn)) + return false; + var node = ts2.getParseTreeNode(nodeIn, ts2.isIdentifier); + if (!node) + return false; + var parent2 = node.parent; + if (!parent2) + return false; + var isPropertyName = (ts2.isPropertyAccessExpression(parent2) || ts2.isPropertyAssignment(parent2)) && parent2.name === node; + return !isPropertyName && getReferencedValueSymbol(node) === argumentsSymbol; + } + function moduleExportsSomeValue(moduleReferenceExpression) { + var moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol || ts2.isShorthandAmbientModuleSymbol(moduleSymbol)) { + return true; + } + var hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + var symbolLinks2 = getSymbolLinks(moduleSymbol); + if (symbolLinks2.exportsSomeValue === void 0) { + symbolLinks2.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 111551) : ts2.forEachEntry(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks2.exportsSomeValue; + function isValue(s7) { + s7 = resolveSymbol(s7); + return s7 && !!(getAllSymbolFlags(s7) & 111551); + } + } + function isNameOfModuleOrEnumDeclaration(node) { + return ts2.isModuleOrEnumDeclaration(node.parent) && node === node.parent.name; + } + function getReferencedExportContainer(nodeIn, prefixLocals) { + var _a2; + var node = ts2.getParseTreeNode(nodeIn, ts2.isIdentifier); + if (node) { + var symbol = getReferencedValueSymbol( + node, + /*startInDeclarationContainer*/ + isNameOfModuleOrEnumDeclaration(node) + ); + if (symbol) { + if (symbol.flags & 1048576) { + var exportSymbol = getMergedSymbol(symbol.exportSymbol); + if (!prefixLocals && exportSymbol.flags & 944 && !(exportSymbol.flags & 3)) { + return void 0; + } + symbol = exportSymbol; + } + var parentSymbol_1 = getParentOfSymbol(symbol); + if (parentSymbol_1) { + if (parentSymbol_1.flags & 512 && ((_a2 = parentSymbol_1.valueDeclaration) === null || _a2 === void 0 ? void 0 : _a2.kind) === 308) { + var symbolFile = parentSymbol_1.valueDeclaration; + var referenceFile = ts2.getSourceFileOfNode(node); + var symbolIsUmdExport = symbolFile !== referenceFile; + return symbolIsUmdExport ? void 0 : symbolFile; + } + return ts2.findAncestor(node.parent, function(n7) { + return ts2.isModuleOrEnumDeclaration(n7) && getSymbolOfNode(n7) === parentSymbol_1; + }); + } + } + } + } + function getReferencedImportDeclaration(nodeIn) { + if (nodeIn.generatedImportReference) { + return nodeIn.generatedImportReference; + } + var node = ts2.getParseTreeNode(nodeIn, ts2.isIdentifier); + if (node) { + var symbol = getReferencedValueOrAliasSymbol(node); + if (isNonLocalAlias( + symbol, + /*excludes*/ + 111551 + /* SymbolFlags.Value */ + ) && !getTypeOnlyAliasDeclaration( + symbol, + 111551 + /* SymbolFlags.Value */ + )) { + return getDeclarationOfAliasSymbol(symbol); + } + } + return void 0; + } + function isSymbolOfDestructuredElementOfCatchBinding(symbol) { + return symbol.valueDeclaration && ts2.isBindingElement(symbol.valueDeclaration) && ts2.walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 295; + } + function isSymbolOfDeclarationWithCollidingName(symbol) { + if (symbol.flags & 418 && symbol.valueDeclaration && !ts2.isSourceFile(symbol.valueDeclaration)) { + var links = getSymbolLinks(symbol); + if (links.isDeclarationWithCollidingName === void 0) { + var container = ts2.getEnclosingBlockScopeContainer(symbol.valueDeclaration); + if (ts2.isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) { + var nodeLinks_1 = getNodeLinks(symbol.valueDeclaration); + if (resolveName( + container.parent, + symbol.escapedName, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )) { + links.isDeclarationWithCollidingName = true; + } else if (nodeLinks_1.flags & 262144) { + var isDeclaredInLoop = nodeLinks_1.flags & 524288; + var inLoopInitializer = ts2.isIterationStatement( + container, + /*lookInLabeledStatements*/ + false + ); + var inLoopBodyBlock = container.kind === 238 && ts2.isIterationStatement( + container.parent, + /*lookInLabeledStatements*/ + false + ); + links.isDeclarationWithCollidingName = !ts2.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock); + } else { + links.isDeclarationWithCollidingName = false; + } + } + } + return links.isDeclarationWithCollidingName; + } + return false; + } + function getReferencedDeclarationWithCollidingName(nodeIn) { + if (!ts2.isGeneratedIdentifier(nodeIn)) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isIdentifier); + if (node) { + var symbol = getReferencedValueSymbol(node); + if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) { + return symbol.valueDeclaration; + } + } + } + return void 0; + } + function isDeclarationWithCollidingName(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isDeclaration); + if (node) { + var symbol = getSymbolOfNode(node); + if (symbol) { + return isSymbolOfDeclarationWithCollidingName(symbol); + } + } + return false; + } + function isValueAliasDeclaration(node) { + switch (node.kind) { + case 268: + return isAliasResolvedToValue(getSymbolOfNode(node)); + case 270: + case 271: + case 273: + case 278: + var symbol = getSymbolOfNode(node); + return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration( + symbol, + 111551 + /* SymbolFlags.Value */ + ); + case 275: + var exportClause = node.exportClause; + return !!exportClause && (ts2.isNamespaceExport(exportClause) || ts2.some(exportClause.elements, isValueAliasDeclaration)); + case 274: + return node.expression && node.expression.kind === 79 ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; + } + return false; + } + function isTopLevelValueImportEqualsWithEntityName(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isImportEqualsDeclaration); + if (node === void 0 || node.parent.kind !== 308 || !ts2.isInternalModuleImportEqualsDeclaration(node)) { + return false; + } + var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); + return isValue && node.moduleReference && !ts2.nodeIsMissing(node.moduleReference); + } + function isAliasResolvedToValue(symbol) { + var _a2; + if (!symbol) { + return false; + } + var target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); + if (target === unknownSymbol) { + return true; + } + return !!(((_a2 = getAllSymbolFlags(target)) !== null && _a2 !== void 0 ? _a2 : -1) & 111551) && (ts2.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target)); + } + function isConstEnumOrConstEnumOnlyModule(s7) { + return isConstEnumSymbol(s7) || !!s7.constEnumOnlyModule; + } + function isReferencedAliasDeclaration(node, checkChildren) { + if (isAliasSymbolDeclaration(node)) { + var symbol = getSymbolOfNode(node); + var links = symbol && getSymbolLinks(symbol); + if (links === null || links === void 0 ? void 0 : links.referenced) { + return true; + } + var target = getSymbolLinks(symbol).aliasTarget; + if (target && ts2.getEffectiveModifierFlags(node) & 1 && getAllSymbolFlags(target) & 111551 && (ts2.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) { + return true; + } + } + if (checkChildren) { + return !!ts2.forEachChild(node, function(node2) { + return isReferencedAliasDeclaration(node2, checkChildren); + }); + } + return false; + } + function isImplementationOfOverload(node) { + if (ts2.nodeIsPresent(node.body)) { + if (ts2.isGetAccessor(node) || ts2.isSetAccessor(node)) + return false; + var symbol = getSymbolOfNode(node); + var signaturesOfSymbol = getSignaturesOfSymbol(symbol); + return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node + // e.g.: function foo(a: string): string; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } + signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node; + } + return false; + } + function isRequiredInitializedParameter(parameter) { + return !!strictNullChecks && !isOptionalParameter(parameter) && !ts2.isJSDocParameterTag(parameter) && !!parameter.initializer && !ts2.hasSyntacticModifier( + parameter, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ); + } + function isOptionalUninitializedParameterProperty(parameter) { + return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && ts2.hasSyntacticModifier( + parameter, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ); + } + function isExpandoFunctionDeclaration(node) { + var declaration = ts2.getParseTreeNode(node, ts2.isFunctionDeclaration); + if (!declaration) { + return false; + } + var symbol = getSymbolOfNode(declaration); + if (!symbol || !(symbol.flags & 16)) { + return false; + } + return !!ts2.forEachEntry(getExportsOfSymbol(symbol), function(p7) { + return p7.flags & 111551 && p7.valueDeclaration && ts2.isPropertyAccessExpression(p7.valueDeclaration); + }); + } + function getPropertiesOfContainerFunction(node) { + var declaration = ts2.getParseTreeNode(node, ts2.isFunctionDeclaration); + if (!declaration) { + return ts2.emptyArray; + } + var symbol = getSymbolOfNode(declaration); + return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || ts2.emptyArray; + } + function getNodeCheckFlags(node) { + var _a2; + var nodeId = node.id || 0; + if (nodeId < 0 || nodeId >= nodeLinks.length) + return 0; + return ((_a2 = nodeLinks[nodeId]) === null || _a2 === void 0 ? void 0 : _a2.flags) || 0; + } + function getEnumMemberValue(node) { + computeEnumMemberValues(node.parent); + return getNodeLinks(node).enumMemberValue; + } + function canHaveConstantValue(node) { + switch (node.kind) { + case 302: + case 208: + case 209: + return true; + } + return false; + } + function getConstantValue(node) { + if (node.kind === 302) { + return getEnumMemberValue(node); + } + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && symbol.flags & 8) { + var member = symbol.valueDeclaration; + if (ts2.isEnumConst(member.parent)) { + return getEnumMemberValue(member); + } + } + return void 0; + } + function isFunctionType(type3) { + return !!(type3.flags & 524288) && getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ).length > 0; + } + function getTypeReferenceSerializationKind(typeNameIn, location2) { + var _a2, _b; + var typeName = ts2.getParseTreeNode(typeNameIn, ts2.isEntityName); + if (!typeName) + return ts2.TypeReferenceSerializationKind.Unknown; + if (location2) { + location2 = ts2.getParseTreeNode(location2); + if (!location2) + return ts2.TypeReferenceSerializationKind.Unknown; + } + var isTypeOnly = false; + if (ts2.isQualifiedName(typeName)) { + var rootValueSymbol = resolveEntityName( + ts2.getFirstIdentifier(typeName), + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + location2 + ); + isTypeOnly = !!((_a2 = rootValueSymbol === null || rootValueSymbol === void 0 ? void 0 : rootValueSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.every(ts2.isTypeOnlyImportOrExportDeclaration)); + } + var valueSymbol = resolveEntityName( + typeName, + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + location2 + ); + var resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 ? resolveAlias(valueSymbol) : valueSymbol; + isTypeOnly || (isTypeOnly = !!((_b = valueSymbol === null || valueSymbol === void 0 ? void 0 : valueSymbol.declarations) === null || _b === void 0 ? void 0 : _b.every(ts2.isTypeOnlyImportOrExportDeclaration))); + var typeSymbol = resolveEntityName( + typeName, + 788968, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + false, + location2 + ); + if (resolvedSymbol && resolvedSymbol === typeSymbol) { + var globalPromiseSymbol = getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + false + ); + if (globalPromiseSymbol && resolvedSymbol === globalPromiseSymbol) { + return ts2.TypeReferenceSerializationKind.Promise; + } + var constructorType = getTypeOfSymbol(resolvedSymbol); + if (constructorType && isConstructorType(constructorType)) { + return isTypeOnly ? ts2.TypeReferenceSerializationKind.TypeWithCallSignature : ts2.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue; + } + } + if (!typeSymbol) { + return isTypeOnly ? ts2.TypeReferenceSerializationKind.ObjectType : ts2.TypeReferenceSerializationKind.Unknown; + } + var type3 = getDeclaredTypeOfSymbol(typeSymbol); + if (isErrorType(type3)) { + return isTypeOnly ? ts2.TypeReferenceSerializationKind.ObjectType : ts2.TypeReferenceSerializationKind.Unknown; + } else if (type3.flags & 3) { + return ts2.TypeReferenceSerializationKind.ObjectType; + } else if (isTypeAssignableToKind( + type3, + 16384 | 98304 | 131072 + /* TypeFlags.Never */ + )) { + return ts2.TypeReferenceSerializationKind.VoidNullableOrNeverType; + } else if (isTypeAssignableToKind( + type3, + 528 + /* TypeFlags.BooleanLike */ + )) { + return ts2.TypeReferenceSerializationKind.BooleanType; + } else if (isTypeAssignableToKind( + type3, + 296 + /* TypeFlags.NumberLike */ + )) { + return ts2.TypeReferenceSerializationKind.NumberLikeType; + } else if (isTypeAssignableToKind( + type3, + 2112 + /* TypeFlags.BigIntLike */ + )) { + return ts2.TypeReferenceSerializationKind.BigIntLikeType; + } else if (isTypeAssignableToKind( + type3, + 402653316 + /* TypeFlags.StringLike */ + )) { + return ts2.TypeReferenceSerializationKind.StringLikeType; + } else if (isTupleType(type3)) { + return ts2.TypeReferenceSerializationKind.ArrayLikeType; + } else if (isTypeAssignableToKind( + type3, + 12288 + /* TypeFlags.ESSymbolLike */ + )) { + return ts2.TypeReferenceSerializationKind.ESSymbolType; + } else if (isFunctionType(type3)) { + return ts2.TypeReferenceSerializationKind.TypeWithCallSignature; + } else if (isArrayType(type3)) { + return ts2.TypeReferenceSerializationKind.ArrayLikeType; + } else { + return ts2.TypeReferenceSerializationKind.ObjectType; + } + } + function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) { + var declaration = ts2.getParseTreeNode(declarationIn, ts2.isVariableLikeOrAccessor); + if (!declaration) { + return ts2.factory.createToken( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + var symbol = getSymbolOfNode(declaration); + var type3 = symbol && !(symbol.flags & (2048 | 131072)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : errorType; + if (type3.flags & 8192 && type3.symbol === symbol) { + flags |= 1048576; + } + if (addUndefined) { + type3 = getOptionalType(type3); + } + return nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, flags | 1024, tracker); + } + function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) { + var signatureDeclaration = ts2.getParseTreeNode(signatureDeclarationIn, ts2.isFunctionLike); + if (!signatureDeclaration) { + return ts2.factory.createToken( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + var signature = getSignatureFromDeclaration(signatureDeclaration); + return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, tracker); + } + function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) { + var expr = ts2.getParseTreeNode(exprIn, ts2.isExpression); + if (!expr) { + return ts2.factory.createToken( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + var type3 = getWidenedType(getRegularTypeOfExpression(expr)); + return nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, flags | 1024, tracker); + } + function hasGlobalName(name2) { + return globals3.has(ts2.escapeLeadingUnderscores(name2)); + } + function getReferencedValueSymbol(reference, startInDeclarationContainer) { + var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; + if (resolvedSymbol) { + return resolvedSymbol; + } + var location2 = reference; + if (startInDeclarationContainer) { + var parent2 = reference.parent; + if (ts2.isDeclaration(parent2) && reference === parent2.name) { + location2 = getDeclarationContainer(parent2); + } + } + return resolveName( + location2, + reference.escapedText, + 111551 | 1048576 | 2097152, + /*nodeNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + } + function getReferencedValueOrAliasSymbol(reference) { + var resolvedSymbol = getNodeLinks(reference).resolvedSymbol; + if (resolvedSymbol && resolvedSymbol !== unknownSymbol) { + return resolvedSymbol; + } + return resolveName( + reference, + reference.escapedText, + 111551 | 1048576 | 2097152, + /*nodeNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true, + /*excludeGlobals*/ + void 0, + /*getSpellingSuggestions*/ + void 0 + ); + } + function getReferencedValueDeclaration(referenceIn) { + if (!ts2.isGeneratedIdentifier(referenceIn)) { + var reference = ts2.getParseTreeNode(referenceIn, ts2.isIdentifier); + if (reference) { + var symbol = getReferencedValueSymbol(reference); + if (symbol) { + return getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } + } + } + return void 0; + } + function isLiteralConstDeclaration(node) { + if (ts2.isDeclarationReadonly(node) || ts2.isVariableDeclaration(node) && ts2.isVarConst(node)) { + return isFreshLiteralType(getTypeOfSymbol(getSymbolOfNode(node))); + } + return false; + } + function literalTypeToNode(type3, enclosing, tracker) { + var enumResult = type3.flags & 1024 ? nodeBuilder.symbolToExpression( + type3.symbol, + 111551, + enclosing, + /*flags*/ + void 0, + tracker + ) : type3 === trueType ? ts2.factory.createTrue() : type3 === falseType && ts2.factory.createFalse(); + if (enumResult) + return enumResult; + var literalValue = type3.value; + return typeof literalValue === "object" ? ts2.factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? ts2.factory.createNumericLiteral(literalValue) : ts2.factory.createStringLiteral(literalValue); + } + function createLiteralConstValue(node, tracker) { + var type3 = getTypeOfSymbol(getSymbolOfNode(node)); + return literalTypeToNode(type3, node, tracker); + } + function getJsxFactoryEntity(location2) { + return location2 ? (getJsxNamespace(location2), ts2.getSourceFileOfNode(location2).localJsxFactory || _jsxFactoryEntity) : _jsxFactoryEntity; + } + function getJsxFragmentFactoryEntity(location2) { + if (location2) { + var file = ts2.getSourceFileOfNode(location2); + if (file) { + if (file.localJsxFragmentFactory) { + return file.localJsxFragmentFactory; + } + var jsxFragPragmas = file.pragmas.get("jsxfrag"); + var jsxFragPragma = ts2.isArray(jsxFragPragmas) ? jsxFragPragmas[0] : jsxFragPragmas; + if (jsxFragPragma) { + file.localJsxFragmentFactory = ts2.parseIsolatedEntityName(jsxFragPragma.arguments.factory, languageVersion); + return file.localJsxFragmentFactory; + } + } + } + if (compilerOptions.jsxFragmentFactory) { + return ts2.parseIsolatedEntityName(compilerOptions.jsxFragmentFactory, languageVersion); + } + } + function createResolver4() { + var resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives(); + var fileToDirective; + if (resolvedTypeReferenceDirectives) { + fileToDirective = new ts2.Map(); + resolvedTypeReferenceDirectives.forEach(function(resolvedDirective, key, mode) { + if (!resolvedDirective || !resolvedDirective.resolvedFileName) { + return; + } + var file = host.getSourceFile(resolvedDirective.resolvedFileName); + if (file) { + addReferencedFilesToTypeDirective(file, key, mode); + } + }); + } + return { + getReferencedExportContainer, + getReferencedImportDeclaration, + getReferencedDeclarationWithCollidingName, + isDeclarationWithCollidingName, + isValueAliasDeclaration: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? isValueAliasDeclaration(node) : true; + }, + hasGlobalName, + isReferencedAliasDeclaration: function(nodeIn, checkChildren) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn); + return node ? getNodeCheckFlags(node) : 0; + }, + isTopLevelValueImportEqualsWithEntityName, + isDeclarationVisible, + isImplementationOfOverload, + isRequiredInitializedParameter, + isOptionalUninitializedParameterProperty, + isExpandoFunctionDeclaration, + getPropertiesOfContainerFunction, + createTypeOfDeclaration, + createReturnTypeOfSignatureDeclaration, + createTypeOfExpression, + createLiteralConstValue, + isSymbolAccessible, + isEntityNameVisible, + getConstantValue: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, canHaveConstantValue); + return node ? getConstantValue(node) : void 0; + }, + collectLinkedAliases, + getReferencedValueDeclaration, + getTypeReferenceSerializationKind, + isOptionalParameter, + moduleExportsSomeValue, + isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.hasPossibleExternalModuleReference); + return node && getExternalModuleFileFromDeclaration(node); + }, + getTypeReferenceDirectivesForEntityName, + getTypeReferenceDirectivesForSymbol, + isLiteralConstDeclaration, + isLateBound: function(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isDeclaration); + var symbol = node && getSymbolOfNode(node); + return !!(symbol && ts2.getCheckFlags(symbol) & 4096); + }, + getJsxFactoryEntity, + getJsxFragmentFactoryEntity, + getAllAccessorDeclarations: function(accessor) { + accessor = ts2.getParseTreeNode(accessor, ts2.isGetOrSetAccessorDeclaration); + var otherKind = accessor.kind === 175 ? 174 : 175; + var otherAccessor = ts2.getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); + var firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor; + var secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor; + var setAccessor = accessor.kind === 175 ? accessor : otherAccessor; + var getAccessor = accessor.kind === 174 ? accessor : otherAccessor; + return { + firstAccessor, + secondAccessor, + setAccessor, + getAccessor + }; + }, + getSymbolOfExternalModuleSpecifier: function(moduleName3) { + return resolveExternalModuleNameWorker( + moduleName3, + moduleName3, + /*moduleNotFoundError*/ + void 0 + ); + }, + isBindingCapturedByNode: function(node, decl) { + var parseNode = ts2.getParseTreeNode(node); + var parseDecl = ts2.getParseTreeNode(decl); + return !!parseNode && !!parseDecl && (ts2.isVariableDeclaration(parseDecl) || ts2.isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl); + }, + getDeclarationStatementsForSourceFile: function(node, flags, tracker, bundled) { + var n7 = ts2.getParseTreeNode(node); + ts2.Debug.assert(n7 && n7.kind === 308, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + var sym = getSymbolOfNode(node); + if (!sym) { + return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); + } + return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled); + }, + isImportRequiredByAugmentation + }; + function isImportRequiredByAugmentation(node) { + var file = ts2.getSourceFileOfNode(node); + if (!file.symbol) + return false; + var importTarget = getExternalModuleFileFromDeclaration(node); + if (!importTarget) + return false; + if (importTarget === file) + return false; + var exports29 = getExportsOfModule(file.symbol); + for (var _i = 0, _a2 = ts2.arrayFrom(exports29.values()); _i < _a2.length; _i++) { + var s7 = _a2[_i]; + if (s7.mergeId) { + var merged = getMergedSymbol(s7); + if (merged.declarations) { + for (var _b = 0, _c = merged.declarations; _b < _c.length; _b++) { + var d7 = _c[_b]; + var declFile = ts2.getSourceFileOfNode(d7); + if (declFile === importTarget) { + return true; + } + } + } + } + } + return false; + } + function isInHeritageClause(node) { + return node.parent && node.parent.kind === 230 && node.parent.parent && node.parent.parent.kind === 294; + } + function getTypeReferenceDirectivesForEntityName(node) { + if (!fileToDirective) { + return void 0; + } + var meaning; + if (node.parent.kind === 164) { + meaning = 111551 | 1048576; + } else { + meaning = 788968 | 1920; + if (node.kind === 79 && isInTypeQuery(node) || node.kind === 208 && !isInHeritageClause(node)) { + meaning = 111551 | 1048576; + } + } + var symbol = resolveEntityName( + node, + meaning, + /*ignoreErrors*/ + true + ); + return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : void 0; + } + function getTypeReferenceDirectivesForSymbol(symbol, meaning) { + if (!fileToDirective || !isSymbolFromTypeDeclarationFile(symbol)) { + return void 0; + } + var typeReferenceDirectives; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (decl.symbol && decl.symbol.flags & meaning) { + var file = ts2.getSourceFileOfNode(decl); + var typeReferenceDirective = fileToDirective.get(file.path); + if (typeReferenceDirective) { + (typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective); + } else { + return void 0; + } + } + } + return typeReferenceDirectives; + } + function isSymbolFromTypeDeclarationFile(symbol) { + if (!symbol.declarations) { + return false; + } + var current = symbol; + while (true) { + var parent2 = getParentOfSymbol(current); + if (parent2) { + current = parent2; + } else { + break; + } + } + if (current.valueDeclaration && current.valueDeclaration.kind === 308 && current.flags & 512) { + return false; + } + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + var file = ts2.getSourceFileOfNode(decl); + if (fileToDirective.has(file.path)) { + return true; + } + } + return false; + } + function addReferencedFilesToTypeDirective(file, key, mode) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, [key, mode]); + for (var _i = 0, _a2 = file.referencedFiles; _i < _a2.length; _i++) { + var _b = _a2[_i], fileName = _b.fileName, resolutionMode = _b.resolutionMode; + var resolvedFile = ts2.resolveTripleslashReference(fileName, file.fileName); + var referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat); + } + } + } + } + function getExternalModuleFileFromDeclaration(declaration) { + var specifier = declaration.kind === 264 ? ts2.tryCast(declaration.name, ts2.isStringLiteral) : ts2.getExternalModuleName(declaration); + var moduleSymbol = resolveExternalModuleNameWorker( + specifier, + specifier, + /*moduleNotFoundError*/ + void 0 + ); + if (!moduleSymbol) { + return void 0; + } + return ts2.getDeclarationOfKind( + moduleSymbol, + 308 + /* SyntaxKind.SourceFile */ + ); + } + function initializeTypeChecker() { + for (var _i = 0, _a2 = host.getSourceFiles(); _i < _a2.length; _i++) { + var file = _a2[_i]; + ts2.bindSourceFile(file, compilerOptions); + } + amalgamatedDuplicates = new ts2.Map(); + var augmentations; + for (var _b = 0, _c = host.getSourceFiles(); _b < _c.length; _b++) { + var file = _c[_b]; + if (file.redirectInfo) { + continue; + } + if (!ts2.isExternalOrCommonJsModule(file)) { + var fileGlobalThisSymbol = file.locals.get("globalThis"); + if (fileGlobalThisSymbol === null || fileGlobalThisSymbol === void 0 ? void 0 : fileGlobalThisSymbol.declarations) { + for (var _d = 0, _e2 = fileGlobalThisSymbol.declarations; _d < _e2.length; _d++) { + var declaration = _e2[_d]; + diagnostics.add(ts2.createDiagnosticForNode(declaration, ts2.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis")); + } + } + mergeSymbolTable(globals3, file.locals); + } + if (file.jsGlobalAugmentations) { + mergeSymbolTable(globals3, file.jsGlobalAugmentations); + } + if (file.patternAmbientModules && file.patternAmbientModules.length) { + patternAmbientModules = ts2.concatenate(patternAmbientModules, file.patternAmbientModules); + } + if (file.moduleAugmentations.length) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } + if (file.symbol && file.symbol.globalExports) { + var source = file.symbol.globalExports; + source.forEach(function(sourceSymbol, id) { + if (!globals3.has(id)) { + globals3.set(id, sourceSymbol); + } + }); + } + } + if (augmentations) { + for (var _f = 0, augmentations_1 = augmentations; _f < augmentations_1.length; _f++) { + var list = augmentations_1[_f]; + for (var _g = 0, list_1 = list; _g < list_1.length; _g++) { + var augmentation = list_1[_g]; + if (!ts2.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } + addToSymbolTable(globals3, builtinGlobals, ts2.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); + getSymbolLinks(undefinedSymbol).type = undefinedWideningType; + getSymbolLinks(argumentsSymbol).type = getGlobalType( + "IArguments", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + getSymbolLinks(unknownSymbol).type = errorType; + getSymbolLinks(globalThisSymbol).type = createObjectType(16, globalThisSymbol); + globalArrayType = getGlobalType( + "Array", + /*arity*/ + 1, + /*reportErrors*/ + true + ); + globalObjectType = getGlobalType( + "Object", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalFunctionType = getGlobalType( + "Function", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalCallableFunctionType = strictBindCallApply && getGlobalType( + "CallableFunction", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || globalFunctionType; + globalNewableFunctionType = strictBindCallApply && getGlobalType( + "NewableFunction", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || globalFunctionType; + globalStringType = getGlobalType( + "String", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalNumberType = getGlobalType( + "Number", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalBooleanType = getGlobalType( + "Boolean", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalRegExpType = getGlobalType( + "RegExp", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + anyArrayType = createArrayType(anyType2); + autoArrayType = createArrayType(autoType); + if (autoArrayType === emptyObjectType) { + autoArrayType = createAnonymousType(void 0, emptySymbols, ts2.emptyArray, ts2.emptyArray, ts2.emptyArray); + } + globalReadonlyArrayType = getGlobalTypeOrUndefined( + "ReadonlyArray", + /*arity*/ + 1 + ) || globalArrayType; + anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType2]) : anyArrayType; + globalThisType = getGlobalTypeOrUndefined( + "ThisType", + /*arity*/ + 1 + ); + if (augmentations) { + for (var _h = 0, augmentations_2 = augmentations; _h < augmentations_2.length; _h++) { + var list = augmentations_2[_h]; + for (var _j = 0, list_2 = list; _j < list_2.length; _j++) { + var augmentation = list_2[_j]; + if (ts2.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } + amalgamatedDuplicates.forEach(function(_a3) { + var firstFile = _a3.firstFile, secondFile = _a3.secondFile, conflictingSymbols = _a3.conflictingSymbols; + if (conflictingSymbols.size < 8) { + conflictingSymbols.forEach(function(_a4, symbolName) { + var isBlockScoped = _a4.isBlockScoped, firstFileLocations = _a4.firstFileLocations, secondFileLocations = _a4.secondFileLocations; + var message = isBlockScoped ? ts2.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts2.Diagnostics.Duplicate_identifier_0; + for (var _i2 = 0, firstFileLocations_1 = firstFileLocations; _i2 < firstFileLocations_1.length; _i2++) { + var node = firstFileLocations_1[_i2]; + addDuplicateDeclarationError(node, message, symbolName, secondFileLocations); + } + for (var _b2 = 0, secondFileLocations_1 = secondFileLocations; _b2 < secondFileLocations_1.length; _b2++) { + var node = secondFileLocations_1[_b2]; + addDuplicateDeclarationError(node, message, symbolName, firstFileLocations); + } + }); + } else { + var list2 = ts2.arrayFrom(conflictingSymbols.keys()).join(", "); + diagnostics.add(ts2.addRelatedInfo(ts2.createDiagnosticForNode(firstFile, ts2.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list2), ts2.createDiagnosticForNode(secondFile, ts2.Diagnostics.Conflicts_are_in_this_file))); + diagnostics.add(ts2.addRelatedInfo(ts2.createDiagnosticForNode(secondFile, ts2.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list2), ts2.createDiagnosticForNode(firstFile, ts2.Diagnostics.Conflicts_are_in_this_file))); + } + }); + amalgamatedDuplicates = void 0; + } + function checkExternalEmitHelpers(location2, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + var sourceFile = ts2.getSourceFileOfNode(location2); + if (ts2.isEffectiveExternalModule(sourceFile, compilerOptions) && !(location2.flags & 16777216)) { + var helpersModule = resolveHelpersModule(sourceFile, location2); + if (helpersModule !== unknownSymbol) { + var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (var helper = 1; helper <= 4194304; helper <<= 1) { + if (uncheckedHelpers & helper) { + var name2 = getHelperName(helper); + var symbol = getSymbol( + helpersModule.exports, + ts2.escapeLeadingUnderscores(name2), + 111551 + /* SymbolFlags.Value */ + ); + if (!symbol) { + error2(location2, ts2.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, ts2.externalHelpersModuleNameText, name2); + } else if (helper & 524288) { + if (!ts2.some(getSignaturesOfSymbol(symbol), function(signature) { + return getParameterCount(signature) > 3; + })) { + error2(location2, ts2.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, ts2.externalHelpersModuleNameText, name2, 4); + } + } else if (helper & 1048576) { + if (!ts2.some(getSignaturesOfSymbol(symbol), function(signature) { + return getParameterCount(signature) > 4; + })) { + error2(location2, ts2.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, ts2.externalHelpersModuleNameText, name2, 5); + } + } else if (helper & 1024) { + if (!ts2.some(getSignaturesOfSymbol(symbol), function(signature) { + return getParameterCount(signature) > 2; + })) { + error2(location2, ts2.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, ts2.externalHelpersModuleNameText, name2, 3); + } + } + } + } + } + requestedExternalEmitHelpers |= helpers; + } + } + } + function getHelperName(helper) { + switch (helper) { + case 1: + return "__extends"; + case 2: + return "__assign"; + case 4: + return "__rest"; + case 8: + return "__decorate"; + case 16: + return "__metadata"; + case 32: + return "__param"; + case 64: + return "__awaiter"; + case 128: + return "__generator"; + case 256: + return "__values"; + case 512: + return "__read"; + case 1024: + return "__spreadArray"; + case 2048: + return "__await"; + case 4096: + return "__asyncGenerator"; + case 8192: + return "__asyncDelegator"; + case 16384: + return "__asyncValues"; + case 32768: + return "__exportStar"; + case 65536: + return "__importStar"; + case 131072: + return "__importDefault"; + case 262144: + return "__makeTemplateObject"; + case 524288: + return "__classPrivateFieldGet"; + case 1048576: + return "__classPrivateFieldSet"; + case 2097152: + return "__classPrivateFieldIn"; + case 4194304: + return "__createBinding"; + default: + return ts2.Debug.fail("Unrecognized helper"); + } + } + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, ts2.externalHelpersModuleNameText, ts2.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; + } + return externalHelpersModule; + } + function checkGrammarDecoratorsAndModifiers(node) { + return checkGrammarDecorators(node) || checkGrammarModifiers(node); + } + function checkGrammarDecorators(node) { + if (ts2.canHaveIllegalDecorators(node) && ts2.some(node.illegalDecorators)) { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.Decorators_are_not_valid_here); + } + if (!ts2.canHaveDecorators(node) || !ts2.hasDecorators(node)) { + return false; + } + if (!ts2.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { + if (node.kind === 171 && !ts2.nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.Decorators_are_not_valid_here); + } + } else if (node.kind === 174 || node.kind === 175) { + var accessors = ts2.getAllAccessorDeclarations(node.parent.members, node); + if (ts2.hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + return false; + } + function checkGrammarModifiers(node) { + var quickResult = reportObviousModifierErrors(node); + if (quickResult !== void 0) { + return quickResult; + } + var lastStatic, lastDeclare, lastAsync, lastOverride; + var flags = 0; + for (var _i = 0, _a2 = node.modifiers; _i < _a2.length; _i++) { + var modifier = _a2[_i]; + if (ts2.isDecorator(modifier)) + continue; + if (modifier.kind !== 146) { + if (node.kind === 168 || node.kind === 170) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts2.tokenToString(modifier.kind)); + } + if (node.kind === 178 && (modifier.kind !== 124 || !ts2.isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts2.tokenToString(modifier.kind)); + } + } + if (modifier.kind !== 101 && modifier.kind !== 145) { + if (node.kind === 165) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, ts2.tokenToString(modifier.kind)); + } + } + switch (modifier.kind) { + case 85: + if (node.kind !== 263) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts2.tokenToString( + 85 + /* SyntaxKind.ConstKeyword */ + )); + } + break; + case 161: + if (flags & 16384) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 2) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); + } + flags |= 16384; + lastOverride = modifier; + break; + case 123: + case 122: + case 121: + var text = visibilityToString(ts2.modifierToFlag(modifier.kind)); + if (flags & 28) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16384) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 32) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 265 || node.parent.kind === 308) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 256) { + if (modifier.kind === 121) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (ts2.isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + } + flags |= ts2.modifierToFlag(modifier.kind); + break; + case 124: + if (flags & 32) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 265 || node.parent.kind === 308) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 166) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 256) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16384) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); + } + flags |= 32; + lastStatic = modifier; + break; + case 127: + if (flags & 128) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 2) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 169) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); + } + flags |= 128; + break; + case 146: + if (flags & 64) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 169 && node.kind !== 168 && node.kind !== 178 && node.kind !== 166) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } + flags |= 64; + break; + case 93: + if (flags & 1) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 2) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 256) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (ts2.isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 166) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } + flags |= 1; + break; + case 88: + var container = node.parent.kind === 308 ? node.parent : node.parent.parent; + if (container.kind === 264 && !ts2.isAmbientModule(container)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (!(flags & 1)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } + flags |= 1024; + break; + case 136: + if (flags & 2) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16384) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (ts2.isClassLike(node.parent) && !ts2.isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 166) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (node.parent.flags & 16777216 && node.parent.kind === 265) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (ts2.isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } + flags |= 2; + lastDeclare = modifier; + break; + case 126: + if (flags & 256) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "abstract"); + } + if (node.kind !== 260 && node.kind !== 182) { + if (node.kind !== 171 && node.kind !== 169 && node.kind !== 174 && node.kind !== 175) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 260 && ts2.hasSyntacticModifier( + node.parent, + 256 + /* ModifierFlags.Abstract */ + ))) { + return grammarErrorOnNode(modifier, ts2.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); + } + if (flags & 32) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 8) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 512 && lastAsync) { + return grammarErrorOnNode(lastAsync, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16384) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 128) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } + } + if (ts2.isNamedDeclaration(node) && node.name.kind === 80) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); + } + flags |= 256; + break; + case 132: + if (flags & 512) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 2 || node.parent.flags & 16777216) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 166) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 256) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 512; + lastAsync = modifier; + break; + case 101: + case 145: + var inOutFlag = modifier.kind === 101 ? 32768 : 65536; + var inOutText = modifier.kind === 101 ? "in" : "out"; + if (node.kind !== 165 || !(ts2.isInterfaceDeclaration(node.parent) || ts2.isClassLike(node.parent) || ts2.isTypeAliasDeclaration(node.parent))) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); + } + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 32768 && flags & 65536) { + return grammarErrorOnNode(modifier, ts2.Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } + } + if (node.kind === 173) { + if (flags & 32) { + return grammarErrorOnNode(lastStatic, ts2.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + if (flags & 16384) { + return grammarErrorOnNode(lastOverride, ts2.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override"); + } + if (flags & 512) { + return grammarErrorOnNode(lastAsync, ts2.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); + } + return false; + } else if ((node.kind === 269 || node.kind === 268) && flags & 2) { + return grammarErrorOnNode(lastDeclare, ts2.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } else if (node.kind === 166 && flags & 16476 && ts2.isBindingPattern(node.name)) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); + } else if (node.kind === 166 && flags & 16476 && node.dotDotDotToken) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); + } + if (flags & 512) { + return checkGrammarAsyncModifier(node, lastAsync); + } + return false; + } + function reportObviousModifierErrors(node) { + return !node.modifiers ? false : shouldReportBadModifier(node) ? grammarErrorOnFirstToken(node, ts2.Diagnostics.Modifiers_cannot_appear_here) : void 0; + } + function shouldReportBadModifier(node) { + switch (node.kind) { + case 174: + case 175: + case 173: + case 169: + case 168: + case 171: + case 170: + case 178: + case 264: + case 269: + case 268: + case 275: + case 274: + case 215: + case 216: + case 166: + case 165: + return false; + case 172: + case 299: + case 300: + case 267: + case 181: + case 279: + return true; + default: + if (node.parent.kind === 265 || node.parent.kind === 308) { + return false; + } + switch (node.kind) { + case 259: + return nodeHasAnyModifiersExcept( + node, + 132 + /* SyntaxKind.AsyncKeyword */ + ); + case 260: + case 182: + return nodeHasAnyModifiersExcept( + node, + 126 + /* SyntaxKind.AbstractKeyword */ + ); + case 228: + case 261: + case 240: + case 262: + return true; + case 263: + return nodeHasAnyModifiersExcept( + node, + 85 + /* SyntaxKind.ConstKeyword */ + ); + default: + ts2.Debug.assertNever(node); + } + } + } + function nodeHasAnyModifiersExcept(node, allowedModifier) { + for (var _i = 0, _a2 = node.modifiers; _i < _a2.length; _i++) { + var modifier = _a2[_i]; + if (ts2.isDecorator(modifier)) + continue; + return modifier.kind !== allowedModifier; + } + return false; + } + function checkGrammarAsyncModifier(node, asyncModifier) { + switch (node.kind) { + case 171: + case 259: + case 215: + case 216: + return false; + } + return grammarErrorOnNode(asyncModifier, ts2.Diagnostics._0_modifier_cannot_be_used_here, "async"); + } + function checkGrammarForDisallowedTrailingComma(list, diag) { + if (diag === void 0) { + diag = ts2.Diagnostics.Trailing_comma_not_allowed; + } + if (list && list.hasTrailingComma) { + return grammarErrorAtPos(list[0], list.end - ",".length, ",".length, diag); + } + return false; + } + function checkGrammarTypeParameterList(typeParameters, file) { + if (typeParameters && typeParameters.length === 0) { + var start = typeParameters.pos - "<".length; + var end = ts2.skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, ts2.Diagnostics.Type_parameter_list_cannot_be_empty); + } + return false; + } + function checkGrammarParameterList(parameters) { + var seenOptionalParameter = false; + var parameterCount = parameters.length; + for (var i7 = 0; i7 < parameterCount; i7++) { + var parameter = parameters[i7]; + if (parameter.dotDotDotToken) { + if (i7 !== parameterCount - 1) { + return grammarErrorOnNode(parameter.dotDotDotToken, ts2.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (!(parameter.flags & 16777216)) { + checkGrammarForDisallowedTrailingComma(parameters, ts2.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, ts2.Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } else if (isOptionalParameter(parameter)) { + seenOptionalParameter = true; + if (parameter.questionToken && parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } else if (seenOptionalParameter && !parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + function getNonSimpleParameters(parameters) { + return ts2.filter(parameters, function(parameter) { + return !!parameter.initializer || ts2.isBindingPattern(parameter.name) || ts2.isRestParameter(parameter); + }); + } + function checkGrammarForUseStrictSimpleParameterList(node) { + if (languageVersion >= 3) { + var useStrictDirective_1 = node.body && ts2.isBlock(node.body) && ts2.findUseStrictPrologue(node.body.statements); + if (useStrictDirective_1) { + var nonSimpleParameters = getNonSimpleParameters(node.parameters); + if (ts2.length(nonSimpleParameters)) { + ts2.forEach(nonSimpleParameters, function(parameter) { + ts2.addRelatedInfo(error2(parameter, ts2.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), ts2.createDiagnosticForNode(useStrictDirective_1, ts2.Diagnostics.use_strict_directive_used_here)); + }); + var diagnostics_2 = nonSimpleParameters.map(function(parameter, index4) { + return index4 === 0 ? ts2.createDiagnosticForNode(parameter, ts2.Diagnostics.Non_simple_parameter_declared_here) : ts2.createDiagnosticForNode(parameter, ts2.Diagnostics.and_here); + }); + ts2.addRelatedInfo.apply(void 0, __spreadArray9([error2(useStrictDirective_1, ts2.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)], diagnostics_2, false)); + return true; + } + } + } + return false; + } + function checkGrammarFunctionLikeDeclaration(node) { + var file = ts2.getSourceFileOfNode(node); + return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || ts2.isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + } + function checkGrammarClassLikeDeclaration(node) { + var file = ts2.getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } + function checkGrammarArrowFunction(node, file) { + if (!ts2.isArrowFunction(node)) { + return false; + } + if (node.typeParameters && !(ts2.length(node.typeParameters) > 1 || node.typeParameters.hasTrailingComma || node.typeParameters[0].constraint)) { + if (file && ts2.fileExtensionIsOneOf(file.fileName, [ + ".mts", + ".cts" + /* Extension.Cts */ + ])) { + grammarErrorOnNode(node.typeParameters[0], ts2.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint); + } + } + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts2.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts2.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts2.Diagnostics.Line_terminator_not_permitted_before_arrow); + } + function checkGrammarIndexSignatureParameters(node) { + var parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } else { + return grammarErrorOnNode(node, ts2.Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + checkGrammarForDisallowedTrailingComma(node.parameters, ts2.Diagnostics.An_index_signature_cannot_have_a_trailing_comma); + if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, ts2.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + if (ts2.hasEffectiveModifiers(parameter)) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, ts2.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + if (!parameter.type) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + var type3 = getTypeFromTypeNode(parameter.type); + if (someType(type3, function(t8) { + return !!(t8.flags & 8576); + }) || isGenericType(type3)) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead); + } + if (!everyType(type3, isValidIndexKeyType)) { + return grammarErrorOnNode(parameter.name, ts2.Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type); + } + if (!node.type) { + return grammarErrorOnNode(node, ts2.Diagnostics.An_index_signature_must_have_a_type_annotation); + } + return false; + } + function checkGrammarIndexSignature(node) { + return checkGrammarDecoratorsAndModifiers(node) || checkGrammarIndexSignatureParameters(node); + } + function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { + if (typeArguments && typeArguments.length === 0) { + var sourceFile = ts2.getSourceFileOfNode(node); + var start = typeArguments.pos - "<".length; + var end = ts2.skipTrivia(sourceFile.text, typeArguments.end) + ">".length; + return grammarErrorAtPos(sourceFile, start, end - start, ts2.Diagnostics.Type_argument_list_cannot_be_empty); + } + return false; + } + function checkGrammarTypeArguments(node, typeArguments) { + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + } + function checkGrammarTaggedTemplateChain(node) { + if (node.questionDotToken || node.flags & 32) { + return grammarErrorOnNode(node.template, ts2.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain); + } + return false; + } + function checkGrammarHeritageClause(node) { + var types3 = node.types; + if (checkGrammarForDisallowedTrailingComma(types3)) { + return true; + } + if (types3 && types3.length === 0) { + var listType = ts2.tokenToString(node.token); + return grammarErrorAtPos(node, types3.pos, 0, ts2.Diagnostics._0_list_cannot_be_empty, listType); + } + return ts2.some(types3, checkGrammarExpressionWithTypeArguments); + } + function checkGrammarExpressionWithTypeArguments(node) { + if (ts2.isExpressionWithTypeArguments(node) && ts2.isImportKeyword(node.expression) && node.typeArguments) { + return grammarErrorOnNode(node, ts2.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); + } + return checkGrammarTypeArguments(node, node.typeArguments); + } + function checkGrammarClassDeclarationHeritageClauses(node) { + var seenExtendsClause = false; + var seenImplementsClause = false; + if (!checkGrammarDecoratorsAndModifiers(node) && node.heritageClauses) { + for (var _i = 0, _a2 = node.heritageClauses; _i < _a2.length; _i++) { + var heritageClause = _a2[_i]; + if (heritageClause.token === 94) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, ts2.Diagnostics.extends_clause_already_seen); + } + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, ts2.Diagnostics.extends_clause_must_precede_implements_clause); + } + if (heritageClause.types.length > 1) { + return grammarErrorOnFirstToken(heritageClause.types[1], ts2.Diagnostics.Classes_can_only_extend_a_single_class); + } + seenExtendsClause = true; + } else { + ts2.Debug.assert( + heritageClause.token === 117 + /* SyntaxKind.ImplementsKeyword */ + ); + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, ts2.Diagnostics.implements_clause_already_seen); + } + seenImplementsClause = true; + } + checkGrammarHeritageClause(heritageClause); + } + } + } + function checkGrammarInterfaceDeclaration(node) { + var seenExtendsClause = false; + if (node.heritageClauses) { + for (var _i = 0, _a2 = node.heritageClauses; _i < _a2.length; _i++) { + var heritageClause = _a2[_i]; + if (heritageClause.token === 94) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, ts2.Diagnostics.extends_clause_already_seen); + } + seenExtendsClause = true; + } else { + ts2.Debug.assert( + heritageClause.token === 117 + /* SyntaxKind.ImplementsKeyword */ + ); + return grammarErrorOnFirstToken(heritageClause, ts2.Diagnostics.Interface_declaration_cannot_have_implements_clause); + } + checkGrammarHeritageClause(heritageClause); + } + } + return false; + } + function checkGrammarComputedPropertyName(node) { + if (node.kind !== 164) { + return false; + } + var computedPropertyName = node; + if (computedPropertyName.expression.kind === 223 && computedPropertyName.expression.operatorToken.kind === 27) { + return grammarErrorOnNode(computedPropertyName.expression, ts2.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); + } + return false; + } + function checkGrammarForGenerator(node) { + if (node.asteriskToken) { + ts2.Debug.assert( + node.kind === 259 || node.kind === 215 || node.kind === 171 + /* SyntaxKind.MethodDeclaration */ + ); + if (node.flags & 16777216) { + return grammarErrorOnNode(node.asteriskToken, ts2.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); + } + if (!node.body) { + return grammarErrorOnNode(node.asteriskToken, ts2.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); + } + } + } + function checkGrammarForInvalidQuestionMark(questionToken, message) { + return !!questionToken && grammarErrorOnNode(questionToken, message); + } + function checkGrammarForInvalidExclamationToken(exclamationToken, message) { + return !!exclamationToken && grammarErrorOnNode(exclamationToken, message); + } + function checkGrammarObjectLiteralExpression(node, inDestructuring) { + var seen = new ts2.Map(); + for (var _i = 0, _a2 = node.properties; _i < _a2.length; _i++) { + var prop = _a2[_i]; + if (prop.kind === 301) { + if (inDestructuring) { + var expression = ts2.skipParentheses(prop.expression); + if (ts2.isArrayLiteralExpression(expression) || ts2.isObjectLiteralExpression(expression)) { + return grammarErrorOnNode(prop.expression, ts2.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } + } + continue; + } + var name2 = prop.name; + if (name2.kind === 164) { + checkGrammarComputedPropertyName(name2); + } + if (prop.kind === 300 && !inDestructuring && prop.objectAssignmentInitializer) { + grammarErrorOnNode(prop.equalsToken, ts2.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); + } + if (name2.kind === 80) { + grammarErrorOnNode(name2, ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + if (ts2.canHaveModifiers(prop) && prop.modifiers) { + for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { + var mod2 = _c[_b]; + if (ts2.isModifier(mod2) && (mod2.kind !== 132 || prop.kind !== 171)) { + grammarErrorOnNode(mod2, ts2.Diagnostics._0_modifier_cannot_be_used_here, ts2.getTextOfNode(mod2)); + } + } + } else if (ts2.canHaveIllegalModifiers(prop) && prop.modifiers) { + for (var _d = 0, _e2 = prop.modifiers; _d < _e2.length; _d++) { + var mod2 = _e2[_d]; + grammarErrorOnNode(mod2, ts2.Diagnostics._0_modifier_cannot_be_used_here, ts2.getTextOfNode(mod2)); + } + } + var currentKind = void 0; + switch (prop.kind) { + case 300: + case 299: + checkGrammarForInvalidExclamationToken(prop.exclamationToken, ts2.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); + checkGrammarForInvalidQuestionMark(prop.questionToken, ts2.Diagnostics.An_object_member_cannot_be_declared_optional); + if (name2.kind === 8) { + checkGrammarNumericLiteral(name2); + } + currentKind = 4; + break; + case 171: + currentKind = 8; + break; + case 174: + currentKind = 1; + break; + case 175: + currentKind = 2; + break; + default: + throw ts2.Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind); + } + if (!inDestructuring) { + var effectiveName = ts2.getPropertyNameForPropertyNameNode(name2); + if (effectiveName === void 0) { + continue; + } + var existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); + } else { + if (currentKind & 8 && existingKind & 8) { + grammarErrorOnNode(name2, ts2.Diagnostics.Duplicate_identifier_0, ts2.getTextOfNode(name2)); + } else if (currentKind & 4 && existingKind & 4) { + grammarErrorOnNode(name2, ts2.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts2.getTextOfNode(name2)); + } else if (currentKind & 3 && existingKind & 3) { + if (existingKind !== 3 && currentKind !== existingKind) { + seen.set(effectiveName, currentKind | existingKind); + } else { + return grammarErrorOnNode(name2, ts2.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } else { + return grammarErrorOnNode(name2, ts2.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + } + function checkGrammarJsxElement(node) { + checkGrammarJsxName(node.tagName); + checkGrammarTypeArguments(node, node.typeArguments); + var seen = new ts2.Map(); + for (var _i = 0, _a2 = node.attributes.properties; _i < _a2.length; _i++) { + var attr = _a2[_i]; + if (attr.kind === 290) { + continue; + } + var name2 = attr.name, initializer = attr.initializer; + if (!seen.get(name2.escapedText)) { + seen.set(name2.escapedText, true); + } else { + return grammarErrorOnNode(name2, ts2.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + } + if (initializer && initializer.kind === 291 && !initializer.expression) { + return grammarErrorOnNode(initializer, ts2.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + } + } + } + function checkGrammarJsxName(node) { + if (ts2.isPropertyAccessExpression(node)) { + var propName2 = node; + do { + var check_1 = checkGrammarJsxNestedIdentifier(propName2.name); + if (check_1) { + return check_1; + } + propName2 = propName2.expression; + } while (ts2.isPropertyAccessExpression(propName2)); + var check = checkGrammarJsxNestedIdentifier(propName2); + if (check) { + return check; + } + } + function checkGrammarJsxNestedIdentifier(name2) { + if (ts2.isIdentifier(name2) && ts2.idText(name2).indexOf(":") !== -1) { + return grammarErrorOnNode(name2, ts2.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names); + } + } + } + function checkGrammarJsxExpression(node) { + if (node.expression && ts2.isCommaSequence(node.expression)) { + return grammarErrorOnNode(node.expression, ts2.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array); + } + } + function checkGrammarForInOrForOfStatement(forInOrOfStatement) { + if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { + return true; + } + if (forInOrOfStatement.kind === 247 && forInOrOfStatement.awaitModifier) { + if (!(forInOrOfStatement.flags & 32768)) { + var sourceFile = ts2.getSourceFileOfNode(forInOrOfStatement); + if (ts2.isInTopLevelContext(forInOrOfStatement)) { + if (!hasParseDiagnostics(sourceFile)) { + if (!ts2.isEffectiveExternalModule(sourceFile, compilerOptions)) { + diagnostics.add(ts2.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts2.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)); + } + switch (moduleKind) { + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + if (sourceFile.impliedNodeFormat === ts2.ModuleKind.CommonJS) { + diagnostics.add(ts2.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts2.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level)); + break; + } + case ts2.ModuleKind.ES2022: + case ts2.ModuleKind.ESNext: + case ts2.ModuleKind.System: + if (languageVersion >= 4) { + break; + } + default: + diagnostics.add(ts2.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts2.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)); + break; + } + } + } else { + if (!hasParseDiagnostics(sourceFile)) { + var diagnostic = ts2.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts2.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); + var func = ts2.getContainingFunction(forInOrOfStatement); + if (func && func.kind !== 173) { + ts2.Debug.assert((ts2.getFunctionFlags(func) & 2) === 0, "Enclosing function should never be an async function."); + var relatedInfo = ts2.createDiagnosticForNode(func, ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async); + ts2.addRelatedInfo(diagnostic, relatedInfo); + } + diagnostics.add(diagnostic); + return true; + } + } + return false; + } + } + if (ts2.isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 32768) && ts2.isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") { + grammarErrorOnNode(forInOrOfStatement.initializer, ts2.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async); + return false; + } + if (forInOrOfStatement.initializer.kind === 258) { + var variableList = forInOrOfStatement.initializer; + if (!checkGrammarVariableDeclarationList(variableList)) { + var declarations = variableList.declarations; + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + var diagnostic = forInOrOfStatement.kind === 246 ? ts2.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts2.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); + } + var firstDeclaration = declarations[0]; + if (firstDeclaration.initializer) { + var diagnostic = forInOrOfStatement.kind === 246 ? ts2.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts2.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + return grammarErrorOnNode(firstDeclaration.name, diagnostic); + } + if (firstDeclaration.type) { + var diagnostic = forInOrOfStatement.kind === 246 ? ts2.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts2.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + return grammarErrorOnNode(firstDeclaration, diagnostic); + } + } + } + return false; + } + function checkGrammarAccessor(accessor) { + if (!(accessor.flags & 16777216) && accessor.parent.kind !== 184 && accessor.parent.kind !== 261) { + if (languageVersion < 1) { + return grammarErrorOnNode(accessor.name, ts2.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + if (languageVersion < 2 && ts2.isPrivateIdentifier(accessor.name)) { + return grammarErrorOnNode(accessor.name, ts2.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (accessor.body === void 0 && !ts2.hasSyntacticModifier( + accessor, + 256 + /* ModifierFlags.Abstract */ + )) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, ts2.Diagnostics._0_expected, "{"); + } + } + if (accessor.body) { + if (ts2.hasSyntacticModifier( + accessor, + 256 + /* ModifierFlags.Abstract */ + )) { + return grammarErrorOnNode(accessor, ts2.Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } + if (accessor.parent.kind === 184 || accessor.parent.kind === 261) { + return grammarErrorOnNode(accessor.body, ts2.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); + } + } + if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, ts2.Diagnostics.An_accessor_cannot_have_type_parameters); + } + if (!doesAccessorHaveCorrectParameterCount(accessor)) { + return grammarErrorOnNode(accessor.name, accessor.kind === 174 ? ts2.Diagnostics.A_get_accessor_cannot_have_parameters : ts2.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); + } + if (accessor.kind === 175) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, ts2.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + var parameter = ts2.Debug.checkDefined(ts2.getSetAccessorValueParameter(accessor), "Return value does not match parameter count assertion."); + if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, ts2.Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, ts2.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, ts2.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + return false; + } + function doesAccessorHaveCorrectParameterCount(accessor) { + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 174 ? 0 : 1); + } + function getAccessorThisParameter(accessor) { + if (accessor.parameters.length === (accessor.kind === 174 ? 1 : 2)) { + return ts2.getThisParameter(accessor); + } + } + function checkGrammarTypeOperatorNode(node) { + if (node.operator === 156) { + if (node.type.kind !== 153) { + return grammarErrorOnNode(node.type, ts2.Diagnostics._0_expected, ts2.tokenToString( + 153 + /* SyntaxKind.SymbolKeyword */ + )); + } + var parent2 = ts2.walkUpParenthesizedTypes(node.parent); + if (ts2.isInJSFile(parent2) && ts2.isJSDocTypeExpression(parent2)) { + var host_2 = ts2.getJSDocHost(parent2); + if (host_2) { + parent2 = ts2.getSingleVariableOfVariableStatement(host_2) || host_2; + } + } + switch (parent2.kind) { + case 257: + var decl = parent2; + if (decl.name.kind !== 79) { + return grammarErrorOnNode(node, ts2.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); + } + if (!ts2.isVariableDeclarationInVariableStatement(decl)) { + return grammarErrorOnNode(node, ts2.Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement); + } + if (!(decl.parent.flags & 2)) { + return grammarErrorOnNode(parent2.name, ts2.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); + } + break; + case 169: + if (!ts2.isStatic(parent2) || !ts2.hasEffectiveReadonlyModifier(parent2)) { + return grammarErrorOnNode(parent2.name, ts2.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); + } + break; + case 168: + if (!ts2.hasSyntacticModifier( + parent2, + 64 + /* ModifierFlags.Readonly */ + )) { + return grammarErrorOnNode(parent2.name, ts2.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); + } + break; + default: + return grammarErrorOnNode(node, ts2.Diagnostics.unique_symbol_types_are_not_allowed_here); + } + } else if (node.operator === 146) { + if (node.type.kind !== 185 && node.type.kind !== 186) { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, ts2.tokenToString( + 153 + /* SyntaxKind.SymbolKeyword */ + )); + } + } + } + function checkGrammarForInvalidDynamicName(node, message) { + if (isNonBindableDynamicName(node)) { + return grammarErrorOnNode(node, message); + } + } + function checkGrammarMethod(node) { + if (checkGrammarFunctionLikeDeclaration(node)) { + return true; + } + if (node.kind === 171) { + if (node.parent.kind === 207) { + if (node.modifiers && !(node.modifiers.length === 1 && ts2.first(node.modifiers).kind === 132)) { + return grammarErrorOnFirstToken(node, ts2.Diagnostics.Modifiers_cannot_appear_here); + } else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts2.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } else if (checkGrammarForInvalidExclamationToken(node.exclamationToken, ts2.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context)) { + return true; + } else if (node.body === void 0) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts2.Diagnostics._0_expected, "{"); + } + } + if (checkGrammarForGenerator(node)) { + return true; + } + } + if (ts2.isClassLike(node.parent)) { + if (languageVersion < 2 && ts2.isPrivateIdentifier(node.name)) { + return grammarErrorOnNode(node.name, ts2.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (node.flags & 16777216) { + return checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } else if (node.kind === 171 && !node.body) { + return checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } + } else if (node.parent.kind === 261) { + return checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } else if (node.parent.kind === 184) { + return checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } + } + function checkGrammarBreakOrContinueStatement(node) { + var current = node; + while (current) { + if (ts2.isFunctionLikeOrClassStaticBlockDeclaration(current)) { + return grammarErrorOnNode(node, ts2.Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 253: + if (node.label && current.label.escapedText === node.label.escapedText) { + var isMisplacedContinueLabel = node.kind === 248 && !ts2.isIterationStatement( + current.statement, + /*lookInLabeledStatement*/ + true + ); + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + return false; + } + break; + case 252: + if (node.kind === 249 && !node.label) { + return false; + } + break; + default: + if (ts2.isIterationStatement( + current, + /*lookInLabeledStatement*/ + false + ) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + var message = node.kind === 249 ? ts2.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts2.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } else { + var message = node.kind === 249 ? ts2.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts2.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkGrammarBindingElement(node) { + if (node.dotDotDotToken) { + var elements = node.parent.elements; + if (node !== ts2.last(elements)) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } + checkGrammarForDisallowedTrailingComma(elements, ts2.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts2.Diagnostics.A_rest_element_cannot_have_a_property_name); + } + } + if (node.dotDotDotToken && node.initializer) { + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts2.Diagnostics.A_rest_element_cannot_have_an_initializer); + } + } + function isStringOrNumberLiteralExpression(expr) { + return ts2.isStringOrNumericLiteralLike(expr) || expr.kind === 221 && expr.operator === 40 && expr.operand.kind === 8; + } + function isBigIntLiteralExpression(expr) { + return expr.kind === 9 || expr.kind === 221 && expr.operator === 40 && expr.operand.kind === 9; + } + function isSimpleLiteralEnumReference(expr) { + if ((ts2.isPropertyAccessExpression(expr) || ts2.isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && ts2.isEntityNameExpression(expr.expression)) { + return !!(checkExpressionCached(expr).flags & 1024); + } + } + function checkAmbientInitializer(node) { + var initializer = node.initializer; + if (initializer) { + var isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) || isSimpleLiteralEnumReference(initializer) || initializer.kind === 110 || initializer.kind === 95 || isBigIntLiteralExpression(initializer)); + var isConstOrReadonly = ts2.isDeclarationReadonly(node) || ts2.isVariableDeclaration(node) && ts2.isVarConst(node); + if (isConstOrReadonly && !node.type) { + if (isInvalidInitializer) { + return grammarErrorOnNode(initializer, ts2.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference); + } + } else { + return grammarErrorOnNode(initializer, ts2.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + } + function checkGrammarVariableDeclaration(node) { + if (node.parent.parent.kind !== 246 && node.parent.parent.kind !== 247) { + if (node.flags & 16777216) { + checkAmbientInitializer(node); + } else if (!node.initializer) { + if (ts2.isBindingPattern(node.name) && !ts2.isBindingPattern(node.parent)) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_destructuring_declaration_must_have_an_initializer); + } + if (ts2.isVarConst(node)) { + return grammarErrorOnNode(node, ts2.Diagnostics.const_declarations_must_be_initialized); + } + } + } + if (node.exclamationToken && (node.parent.parent.kind !== 240 || !node.type || node.initializer || node.flags & 16777216)) { + var message = node.initializer ? ts2.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? ts2.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : ts2.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; + return grammarErrorOnNode(node.exclamationToken, message); + } + if ((moduleKind < ts2.ModuleKind.ES2015 || ts2.getSourceFileOfNode(node).impliedNodeFormat === ts2.ModuleKind.CommonJS) && moduleKind !== ts2.ModuleKind.System && !(node.parent.parent.flags & 16777216) && ts2.hasSyntacticModifier( + node.parent.parent, + 1 + /* ModifierFlags.Export */ + )) { + checkESModuleMarker(node.name); + } + var checkLetConstNames = ts2.isLet(node) || ts2.isVarConst(node); + return checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name); + } + function checkESModuleMarker(name2) { + if (name2.kind === 79) { + if (ts2.idText(name2) === "__esModule") { + return grammarErrorOnNodeSkippedOn("noEmit", name2, ts2.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } else { + var elements = name2.elements; + for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) { + var element = elements_2[_i]; + if (!ts2.isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + return false; + } + function checkGrammarNameInLetOrConstDeclarations(name2) { + if (name2.kind === 79) { + if (name2.originalKeywordKind === 119) { + return grammarErrorOnNode(name2, ts2.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); + } + } else { + var elements = name2.elements; + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (!ts2.isOmittedExpression(element)) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } + } + } + return false; + } + function checkGrammarVariableDeclarationList(declarationList) { + var declarations = declarationList.declarations; + if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) { + return true; + } + if (!declarationList.declarations.length) { + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, ts2.Diagnostics.Variable_declaration_list_cannot_be_empty); + } + return false; + } + function allowLetAndConstDeclarations(parent2) { + switch (parent2.kind) { + case 242: + case 243: + case 244: + case 251: + case 245: + case 246: + case 247: + return false; + case 253: + return allowLetAndConstDeclarations(parent2.parent); + } + return true; + } + function checkGrammarForDisallowedLetOrConstStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + if (ts2.isLet(node.declarationList)) { + return grammarErrorOnNode(node, ts2.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); + } else if (ts2.isVarConst(node.declarationList)) { + return grammarErrorOnNode(node, ts2.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); + } + } + } + function checkGrammarMetaProperty(node) { + var escapedText = node.name.escapedText; + switch (node.keywordToken) { + case 103: + if (escapedText !== "target") { + return grammarErrorOnNode(node.name, ts2.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts2.tokenToString(node.keywordToken), "target"); + } + break; + case 100: + if (escapedText !== "meta") { + return grammarErrorOnNode(node.name, ts2.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, ts2.tokenToString(node.keywordToken), "meta"); + } + break; + } + } + function hasParseDiagnostics(sourceFile) { + return sourceFile.parseDiagnostics.length > 0; + } + function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(ts2.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2)); + return true; + } + return false; + } + function grammarErrorAtPos(nodeForSourceFile, start, length, message, arg0, arg1, arg2) { + var sourceFile = ts2.getSourceFileOfNode(nodeForSourceFile); + if (!hasParseDiagnostics(sourceFile)) { + diagnostics.add(ts2.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); + return true; + } + return false; + } + function grammarErrorOnNodeSkippedOn(key, node, message, arg0, arg1, arg2) { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + errorSkippedOn(key, node, message, arg0, arg1, arg2); + return true; + } + return false; + } + function grammarErrorOnNode(node, message, arg0, arg1, arg2) { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + diagnostics.add(ts2.createDiagnosticForNode(node, message, arg0, arg1, arg2)); + return true; + } + return false; + } + function checkGrammarConstructorTypeParameters(node) { + var jsdocTypeParameters = ts2.isInJSFile(node) ? ts2.getJSDocTypeParameterDeclarations(node) : void 0; + var range2 = node.typeParameters || jsdocTypeParameters && ts2.firstOrUndefined(jsdocTypeParameters); + if (range2) { + var pos = range2.pos === range2.end ? range2.pos : ts2.skipTrivia(ts2.getSourceFileOfNode(node).text, range2.pos); + return grammarErrorAtPos(node, pos, range2.end - pos, ts2.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkGrammarConstructorTypeAnnotation(node) { + var type3 = node.type || ts2.getEffectiveReturnTypeNode(node); + if (type3) { + return grammarErrorOnNode(type3, ts2.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkGrammarProperty(node) { + if (ts2.isComputedPropertyName(node.name) && ts2.isBinaryExpression(node.name.expression) && node.name.expression.operatorToken.kind === 101) { + return grammarErrorOnNode(node.parent.members[0], ts2.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); + } + if (ts2.isClassLike(node.parent)) { + if (ts2.isStringLiteral(node.name) && node.name.text === "constructor") { + return grammarErrorOnNode(node.name, ts2.Diagnostics.Classes_may_not_have_a_field_named_constructor); + } + if (checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)) { + return true; + } + if (languageVersion < 2 && ts2.isPrivateIdentifier(node.name)) { + return grammarErrorOnNode(node.name, ts2.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (languageVersion < 2 && ts2.isAutoAccessorPropertyDeclaration(node)) { + return grammarErrorOnNode(node.name, ts2.Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (ts2.isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, ts2.Diagnostics.An_accessor_property_cannot_be_declared_optional)) { + return true; + } + } else if (node.parent.kind === 261) { + if (checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { + return true; + } + ts2.Debug.assertNode(node, ts2.isPropertySignature); + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts2.Diagnostics.An_interface_property_cannot_have_an_initializer); + } + } else if (ts2.isTypeLiteralNode(node.parent)) { + if (checkGrammarForInvalidDynamicName(node.name, ts2.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { + return true; + } + ts2.Debug.assertNode(node, ts2.isPropertySignature); + if (node.initializer) { + return grammarErrorOnNode(node.initializer, ts2.Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } + } + if (node.flags & 16777216) { + checkAmbientInitializer(node); + } + if (ts2.isPropertyDeclaration(node) && node.exclamationToken && (!ts2.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 16777216 || ts2.isStatic(node) || ts2.hasAbstractModifier(node))) { + var message = node.initializer ? ts2.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? ts2.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : ts2.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; + return grammarErrorOnNode(node.exclamationToken, message); + } + } + function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 261 || node.kind === 262 || node.kind === 269 || node.kind === 268 || node.kind === 275 || node.kind === 274 || node.kind === 267 || ts2.hasSyntacticModifier( + node, + 2 | 1 | 1024 + /* ModifierFlags.Default */ + )) { + return false; + } + return grammarErrorOnFirstToken(node, ts2.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); + } + function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { + for (var _i = 0, _a2 = file.statements; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (ts2.isDeclaration(decl) || decl.kind === 240) { + if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + return false; + } + function checkGrammarSourceFile(node) { + return !!(node.flags & 16777216) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); + } + function checkGrammarStatementInAmbientContext(node) { + if (node.flags & 16777216) { + var links = getNodeLinks(node); + if (!links.hasReportedStatementInAmbientContext && (ts2.isFunctionLike(node.parent) || ts2.isAccessor(node.parent))) { + return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts2.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); + } + if (node.parent.kind === 238 || node.parent.kind === 265 || node.parent.kind === 308) { + var links_2 = getNodeLinks(node.parent); + if (!links_2.hasReportedStatementInAmbientContext) { + return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts2.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } else { + } + } + return false; + } + function checkGrammarNumericLiteral(node) { + if (node.numericLiteralFlags & 32) { + var diagnosticMessage = void 0; + if (languageVersion >= 1) { + diagnosticMessage = ts2.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; + } else if (ts2.isChildOfNodeWithKind( + node, + 198 + /* SyntaxKind.LiteralType */ + )) { + diagnosticMessage = ts2.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; + } else if (ts2.isChildOfNodeWithKind( + node, + 302 + /* SyntaxKind.EnumMember */ + )) { + diagnosticMessage = ts2.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; + } + if (diagnosticMessage) { + var withMinus = ts2.isPrefixUnaryExpression(node.parent) && node.parent.operator === 40; + var literal = (withMinus ? "-" : "") + "0o" + node.text; + return grammarErrorOnNode(withMinus ? node.parent : node, diagnosticMessage, literal); + } + } + checkNumericLiteralValueSize(node); + return false; + } + function checkNumericLiteralValueSize(node) { + var isFractional = ts2.getTextOfNode(node).indexOf(".") !== -1; + var isScientific = node.numericLiteralFlags & 16; + if (isFractional || isScientific) { + return; + } + var value2 = +node.text; + if (value2 <= Math.pow(2, 53) - 1) { + return; + } + addErrorOrSuggestion( + /*isError*/ + false, + ts2.createDiagnosticForNode(node, ts2.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers) + ); + } + function checkGrammarBigIntLiteral(node) { + var literalType2 = ts2.isLiteralTypeNode(node.parent) || ts2.isPrefixUnaryExpression(node.parent) && ts2.isLiteralTypeNode(node.parent.parent); + if (!literalType2) { + if (languageVersion < 7) { + if (grammarErrorOnNode(node, ts2.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) { + return true; + } + } + } + return false; + } + function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { + var sourceFile = ts2.getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + var span = ts2.getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(ts2.createFileDiagnostic( + sourceFile, + ts2.textSpanEnd(span), + /*length*/ + 0, + message, + arg0, + arg1, + arg2 + )); + return true; + } + return false; + } + function getAmbientModules() { + if (!ambientModulesCache) { + ambientModulesCache = []; + globals3.forEach(function(global2, sym) { + if (ambientModuleSymbolRegex.test(sym)) { + ambientModulesCache.push(global2); + } + }); + } + return ambientModulesCache; + } + function checkGrammarImportClause(node) { + var _a2; + if (node.isTypeOnly && node.name && node.namedBindings) { + return grammarErrorOnNode(node, ts2.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); + } + if (node.isTypeOnly && ((_a2 = node.namedBindings) === null || _a2 === void 0 ? void 0 : _a2.kind) === 272) { + return checkGrammarNamedImportsOrExports(node.namedBindings); + } + return false; + } + function checkGrammarNamedImportsOrExports(namedBindings) { + return !!ts2.forEach(namedBindings.elements, function(specifier) { + if (specifier.isTypeOnly) { + return grammarErrorOnFirstToken(specifier, specifier.kind === 273 ? ts2.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : ts2.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement); + } + }); + } + function checkGrammarImportCallExpression(node) { + if (moduleKind === ts2.ModuleKind.ES2015) { + return grammarErrorOnNode(node, ts2.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); + } + if (node.typeArguments) { + return grammarErrorOnNode(node, ts2.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); + } + var nodeArguments = node.arguments; + if (moduleKind !== ts2.ModuleKind.ESNext && moduleKind !== ts2.ModuleKind.NodeNext && moduleKind !== ts2.ModuleKind.Node16) { + checkGrammarForDisallowedTrailingComma(nodeArguments); + if (nodeArguments.length > 1) { + var assertionArgument = nodeArguments[1]; + return grammarErrorOnNode(assertionArgument, ts2.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); + } + } + if (nodeArguments.length === 0 || nodeArguments.length > 2) { + return grammarErrorOnNode(node, ts2.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments); + } + var spreadElement = ts2.find(nodeArguments, ts2.isSpreadElement); + if (spreadElement) { + return grammarErrorOnNode(spreadElement, ts2.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element); + } + return false; + } + function findMatchingTypeReferenceOrTypeAliasReference(source, unionTarget) { + var sourceObjectFlags = ts2.getObjectFlags(source); + if (sourceObjectFlags & (4 | 16) && unionTarget.flags & 1048576) { + return ts2.find(unionTarget.types, function(target) { + if (target.flags & 524288) { + var overlapObjFlags = sourceObjectFlags & ts2.getObjectFlags(target); + if (overlapObjFlags & 4) { + return source.target === target.target; + } + if (overlapObjFlags & 16) { + return !!source.aliasSymbol && source.aliasSymbol === target.aliasSymbol; + } + } + return false; + }); + } + } + function findBestTypeForObjectLiteral(source, unionTarget) { + if (ts2.getObjectFlags(source) & 128 && someType(unionTarget, isArrayLikeType)) { + return ts2.find(unionTarget.types, function(t8) { + return !isArrayLikeType(t8); + }); + } + } + function findBestTypeForInvokable(source, unionTarget) { + var signatureKind = 0; + var hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1, getSignaturesOfType(source, signatureKind).length > 0); + if (hasSignatures) { + return ts2.find(unionTarget.types, function(t8) { + return getSignaturesOfType(t8, signatureKind).length > 0; + }); + } + } + function findMostOverlappyType(source, unionTarget) { + var bestMatch; + if (!(source.flags & (131068 | 406847488))) { + var matchingCount = 0; + for (var _i = 0, _a2 = unionTarget.types; _i < _a2.length; _i++) { + var target = _a2[_i]; + if (!(target.flags & (131068 | 406847488))) { + var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); + if (overlap.flags & 4194304) { + return target; + } else if (isUnitType(overlap) || overlap.flags & 1048576) { + var len = overlap.flags & 1048576 ? ts2.countWhere(overlap.types, isUnitType) : 1; + if (len >= matchingCount) { + bestMatch = target; + matchingCount = len; + } + } + } + } + } + return bestMatch; + } + function filterPrimitivesIfContainsNonPrimitive(type3) { + if (maybeTypeOfKind( + type3, + 67108864 + /* TypeFlags.NonPrimitive */ + )) { + var result2 = filterType(type3, function(t8) { + return !(t8.flags & 131068); + }); + if (!(result2.flags & 131072)) { + return result2; + } + } + return type3; + } + function findMatchingDiscriminantType(source, target, isRelatedTo, skipPartial) { + if (target.flags & 1048576 && source.flags & (2097152 | 524288)) { + var match = getMatchingUnionConstituentForType(target, source); + if (match) { + return match; + } + var sourceProperties = getPropertiesOfType(source); + if (sourceProperties) { + var sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); + if (sourcePropertiesFiltered) { + return discriminateTypeByDiscriminableItems( + target, + ts2.map(sourcePropertiesFiltered, function(p7) { + return [function() { + return getTypeOfSymbol(p7); + }, p7.escapedName]; + }), + isRelatedTo, + /*defaultValue*/ + void 0, + skipPartial + ); + } + } + } + return void 0; + } + } + ts2.createTypeChecker = createTypeChecker; + function isNotAccessor(declaration) { + return !ts2.isAccessor(declaration); + } + function isNotOverload(declaration) { + return declaration.kind !== 259 && declaration.kind !== 171 || !!declaration.body; + } + function isDeclarationNameOrImportPropertyName(name2) { + switch (name2.parent.kind) { + case 273: + case 278: + return ts2.isIdentifier(name2); + default: + return ts2.isDeclarationName(name2); + } + } + var JsxNames; + (function(JsxNames2) { + JsxNames2.JSX = "JSX"; + JsxNames2.IntrinsicElements = "IntrinsicElements"; + JsxNames2.ElementClass = "ElementClass"; + JsxNames2.ElementAttributesPropertyNameContainer = "ElementAttributesProperty"; + JsxNames2.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute"; + JsxNames2.Element = "Element"; + JsxNames2.IntrinsicAttributes = "IntrinsicAttributes"; + JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes"; + JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes"; + })(JsxNames || (JsxNames = {})); + function getIterationTypesKeyFromIterationTypeKind(typeKind) { + switch (typeKind) { + case 0: + return "yieldType"; + case 1: + return "returnType"; + case 2: + return "nextType"; + } + } + function signatureHasRestParameter(s7) { + return !!(s7.flags & 1); + } + ts2.signatureHasRestParameter = signatureHasRestParameter; + function signatureHasLiteralTypes(s7) { + return !!(s7.flags & 2); + } + ts2.signatureHasLiteralTypes = signatureHasLiteralTypes; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var _a2; + function visitNode(node, visitor, test, lift) { + if (node === void 0 || visitor === void 0) { + return node; + } + var visited = visitor(node); + if (visited === node) { + return node; + } + var visitedNode; + if (visited === void 0) { + return void 0; + } else if (ts2.isArray(visited)) { + visitedNode = (lift || extractSingleNode)(visited); + } else { + visitedNode = visited; + } + ts2.Debug.assertNode(visitedNode, test); + return visitedNode; + } + ts2.visitNode = visitNode; + function visitNodes(nodes, visitor, test, start, count2) { + if (nodes === void 0 || visitor === void 0) { + return nodes; + } + var length = nodes.length; + if (start === void 0 || start < 0) { + start = 0; + } + if (count2 === void 0 || count2 > length - start) { + count2 = length - start; + } + var hasTrailingComma; + var pos = -1; + var end = -1; + if (start > 0 || count2 < length) { + hasTrailingComma = nodes.hasTrailingComma && start + count2 === length; + } else { + pos = nodes.pos; + end = nodes.end; + hasTrailingComma = nodes.hasTrailingComma; + } + var updated = visitArrayWorker(nodes, visitor, test, start, count2); + if (updated !== nodes) { + var updatedArray = ts2.factory.createNodeArray(updated, hasTrailingComma); + ts2.setTextRangePosEnd(updatedArray, pos, end); + return updatedArray; + } + return nodes; + } + ts2.visitNodes = visitNodes; + function visitArray(nodes, visitor, test, start, count2) { + if (nodes === void 0) { + return nodes; + } + var length = nodes.length; + if (start === void 0 || start < 0) { + start = 0; + } + if (count2 === void 0 || count2 > length - start) { + count2 = length - start; + } + return visitArrayWorker(nodes, visitor, test, start, count2); + } + ts2.visitArray = visitArray; + function visitArrayWorker(nodes, visitor, test, start, count2) { + var updated; + var length = nodes.length; + if (start > 0 || count2 < length) { + updated = []; + } + for (var i7 = 0; i7 < count2; i7++) { + var node = nodes[i7 + start]; + var visited = node !== void 0 ? visitor(node) : void 0; + if (updated !== void 0 || visited === void 0 || visited !== node) { + if (updated === void 0) { + updated = nodes.slice(0, i7); + } + if (visited) { + if (ts2.isArray(visited)) { + for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) { + var visitedNode = visited_1[_i]; + void ts2.Debug.assertNode(visitedNode, test); + updated.push(visitedNode); + } + } else { + void ts2.Debug.assertNode(visited, test); + updated.push(visited); + } + } + } + } + return updated !== null && updated !== void 0 ? updated : nodes; + } + function visitLexicalEnvironment(statements, visitor, context2, start, ensureUseStrict, nodesVisitor) { + if (nodesVisitor === void 0) { + nodesVisitor = visitNodes; + } + context2.startLexicalEnvironment(); + statements = nodesVisitor(statements, visitor, ts2.isStatement, start); + if (ensureUseStrict) + statements = context2.factory.ensureUseStrict(statements); + return ts2.factory.mergeLexicalEnvironment(statements, context2.endLexicalEnvironment()); + } + ts2.visitLexicalEnvironment = visitLexicalEnvironment; + function visitParameterList(nodes, visitor, context2, nodesVisitor) { + if (nodesVisitor === void 0) { + nodesVisitor = visitNodes; + } + var updated; + context2.startLexicalEnvironment(); + if (nodes) { + context2.setLexicalEnvironmentFlags(1, true); + updated = nodesVisitor(nodes, visitor, ts2.isParameterDeclaration); + if (context2.getLexicalEnvironmentFlags() & 2 && ts2.getEmitScriptTarget(context2.getCompilerOptions()) >= 2) { + updated = addDefaultValueAssignmentsIfNeeded(updated, context2); + } + context2.setLexicalEnvironmentFlags(1, false); + } + context2.suspendLexicalEnvironment(); + return updated; + } + ts2.visitParameterList = visitParameterList; + function addDefaultValueAssignmentsIfNeeded(parameters, context2) { + var result2; + for (var i7 = 0; i7 < parameters.length; i7++) { + var parameter = parameters[i7]; + var updated = addDefaultValueAssignmentIfNeeded(parameter, context2); + if (result2 || updated !== parameter) { + if (!result2) + result2 = parameters.slice(0, i7); + result2[i7] = updated; + } + } + if (result2) { + return ts2.setTextRange(context2.factory.createNodeArray(result2, parameters.hasTrailingComma), parameters); + } + return parameters; + } + function addDefaultValueAssignmentIfNeeded(parameter, context2) { + return parameter.dotDotDotToken ? parameter : ts2.isBindingPattern(parameter.name) ? addDefaultValueAssignmentForBindingPattern(parameter, context2) : parameter.initializer ? addDefaultValueAssignmentForInitializer(parameter, parameter.name, parameter.initializer, context2) : parameter; + } + function addDefaultValueAssignmentForBindingPattern(parameter, context2) { + var factory = context2.factory; + context2.addInitializationStatement(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + parameter.name, + /*exclamationToken*/ + void 0, + parameter.type, + parameter.initializer ? factory.createConditionalExpression( + factory.createStrictEquality(factory.getGeneratedNameForNode(parameter), factory.createVoidZero()), + /*questionToken*/ + void 0, + parameter.initializer, + /*colonToken*/ + void 0, + factory.getGeneratedNameForNode(parameter) + ) : factory.getGeneratedNameForNode(parameter) + ) + ]) + )); + return factory.updateParameterDeclaration( + parameter, + parameter.modifiers, + parameter.dotDotDotToken, + factory.getGeneratedNameForNode(parameter), + parameter.questionToken, + parameter.type, + /*initializer*/ + void 0 + ); + } + function addDefaultValueAssignmentForInitializer(parameter, name2, initializer, context2) { + var factory = context2.factory; + context2.addInitializationStatement(factory.createIfStatement(factory.createTypeCheck(factory.cloneNode(name2), "undefined"), ts2.setEmitFlags( + ts2.setTextRange(factory.createBlock([ + factory.createExpressionStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createAssignment(ts2.setEmitFlags( + factory.cloneNode(name2), + 48 + /* EmitFlags.NoSourceMap */ + ), ts2.setEmitFlags( + initializer, + 48 | ts2.getEmitFlags(initializer) | 1536 + /* EmitFlags.NoComments */ + )), parameter), + 1536 + /* EmitFlags.NoComments */ + )) + ]), parameter), + 1 | 32 | 384 | 1536 + /* EmitFlags.NoComments */ + ))); + return factory.updateParameterDeclaration( + parameter, + parameter.modifiers, + parameter.dotDotDotToken, + parameter.name, + parameter.questionToken, + parameter.type, + /*initializer*/ + void 0 + ); + } + function visitFunctionBody(node, visitor, context2, nodeVisitor) { + if (nodeVisitor === void 0) { + nodeVisitor = visitNode; + } + context2.resumeLexicalEnvironment(); + var updated = nodeVisitor(node, visitor, ts2.isConciseBody); + var declarations = context2.endLexicalEnvironment(); + if (ts2.some(declarations)) { + if (!updated) { + return context2.factory.createBlock(declarations); + } + var block = context2.factory.converters.convertToFunctionBlock(updated); + var statements = ts2.factory.mergeLexicalEnvironment(block.statements, declarations); + return context2.factory.updateBlock(block, statements); + } + return updated; + } + ts2.visitFunctionBody = visitFunctionBody; + function visitIterationBody(body, visitor, context2, nodeVisitor) { + if (nodeVisitor === void 0) { + nodeVisitor = visitNode; + } + context2.startBlockScope(); + var updated = nodeVisitor(body, visitor, ts2.isStatement, context2.factory.liftToBlock); + var declarations = context2.endBlockScope(); + if (ts2.some(declarations)) { + if (ts2.isBlock(updated)) { + declarations.push.apply(declarations, updated.statements); + return context2.factory.updateBlock(updated, declarations); + } + declarations.push(updated); + return context2.factory.createBlock(declarations); + } + return updated; + } + ts2.visitIterationBody = visitIterationBody; + function visitEachChild(node, visitor, context2, nodesVisitor, tokenVisitor, nodeVisitor) { + if (nodesVisitor === void 0) { + nodesVisitor = visitNodes; + } + if (nodeVisitor === void 0) { + nodeVisitor = visitNode; + } + if (node === void 0) { + return void 0; + } + var fn = visitEachChildTable[node.kind]; + return fn === void 0 ? node : fn(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor); + } + ts2.visitEachChild = visitEachChild; + var visitEachChildTable = (_a2 = {}, _a2[ + 79 + /* SyntaxKind.Identifier */ + ] = function visitEachChildOfIdentifier(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts2.isTypeNodeOrTypeParameterDeclaration)); + }, _a2[ + 163 + /* SyntaxKind.QualifiedName */ + ] = function visitEachChildOfQualifiedName(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateQualifiedName(node, nodeVisitor(node.left, visitor, ts2.isEntityName), nodeVisitor(node.right, visitor, ts2.isIdentifier)); + }, _a2[ + 164 + /* SyntaxKind.ComputedPropertyName */ + ] = function visitEachChildOfComputedPropertyName(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateComputedPropertyName(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, // Signature elements + _a2[ + 165 + /* SyntaxKind.TypeParameter */ + ] = function visitEachChildOfTypeParameterDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.constraint, visitor, ts2.isTypeNode), nodeVisitor(node.default, visitor, ts2.isTypeNode)); + }, _a2[ + 166 + /* SyntaxKind.Parameter */ + ] = function visitEachChildOfParameterDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts2.isDotDotDotToken), nodeVisitor(node.name, visitor, ts2.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionToken), nodeVisitor(node.type, visitor, ts2.isTypeNode), nodeVisitor(node.initializer, visitor, ts2.isExpression)); + }, _a2[ + 167 + /* SyntaxKind.Decorator */ + ] = function visitEachChildOfDecorator(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, // Type elements + _a2[ + 168 + /* SyntaxKind.PropertySignature */ + ] = function visitEachChildOfPropertySignature(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts2.isToken), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 169 + /* SyntaxKind.PropertyDeclaration */ + ] = function visitEachChildOfPropertyDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + var _a3; + return context2.factory.updatePropertyDeclaration( + node, + nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), + nodeVisitor(node.name, visitor, ts2.isPropertyName), + // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration + nodeVisitor((_a3 = node.questionToken) !== null && _a3 !== void 0 ? _a3 : node.exclamationToken, tokenVisitor, ts2.isQuestionOrExclamationToken), + nodeVisitor(node.type, visitor, ts2.isTypeNode), + nodeVisitor(node.initializer, visitor, ts2.isExpression) + ); + }, _a2[ + 170 + /* SyntaxKind.MethodSignature */ + ] = function visitEachChildOfMethodSignature(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 171 + /* SyntaxKind.MethodDeclaration */ + ] = function visitEachChildOfMethodDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMethodDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.asteriskToken, tokenVisitor, ts2.isAsteriskToken), nodeVisitor(node.name, visitor, ts2.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context2, nodesVisitor), nodeVisitor(node.type, visitor, ts2.isTypeNode), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 173 + /* SyntaxKind.Constructor */ + ] = function visitEachChildOfConstructorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructorDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), visitParameterList(node.parameters, visitor, context2, nodesVisitor), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 174 + /* SyntaxKind.GetAccessor */ + ] = function visitEachChildOfGetAccessorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateGetAccessorDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.name, visitor, ts2.isPropertyName), visitParameterList(node.parameters, visitor, context2, nodesVisitor), nodeVisitor(node.type, visitor, ts2.isTypeNode), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 175 + /* SyntaxKind.SetAccessor */ + ] = function visitEachChildOfSetAccessorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSetAccessorDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.name, visitor, ts2.isPropertyName), visitParameterList(node.parameters, visitor, context2, nodesVisitor), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 172 + /* SyntaxKind.ClassStaticBlockDeclaration */ + ] = function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + context2.startLexicalEnvironment(); + context2.suspendLexicalEnvironment(); + return context2.factory.updateClassStaticBlockDeclaration(node, visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 176 + /* SyntaxKind.CallSignature */ + ] = function visitEachChildOfCallSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 177 + /* SyntaxKind.ConstructSignature */ + ] = function visitEachChildOfConstructSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 178 + /* SyntaxKind.IndexSignature */ + ] = function visitEachChildOfIndexSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, // Types + _a2[ + 179 + /* SyntaxKind.TypePredicate */ + ] = function visitEachChildOfTypePredicateNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypePredicateNode(node, nodeVisitor(node.assertsModifier, visitor, ts2.isAssertsKeyword), nodeVisitor(node.parameterName, visitor, ts2.isIdentifierOrThisTypeNode), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 180 + /* SyntaxKind.TypeReference */ + ] = function visitEachChildOfTypeReferenceNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts2.isEntityName), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode)); + }, _a2[ + 181 + /* SyntaxKind.FunctionType */ + ] = function visitEachChildOfFunctionTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 182 + /* SyntaxKind.ConstructorType */ + ] = function visitEachChildOfConstructorTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts2.isParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 183 + /* SyntaxKind.TypeQuery */ + ] = function visitEachChildOfTypeQueryNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts2.isEntityName), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode)); + }, _a2[ + 184 + /* SyntaxKind.TypeLiteral */ + ] = function visitEachChildOfTypeLiteralNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts2.isTypeElement)); + }, _a2[ + 185 + /* SyntaxKind.ArrayType */ + ] = function visitEachChildOfArrayTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayTypeNode(node, nodeVisitor(node.elementType, visitor, ts2.isTypeNode)); + }, _a2[ + 186 + /* SyntaxKind.TupleType */ + ] = function visitEachChildOfTupleTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateTupleTypeNode(node, nodesVisitor(node.elements, visitor, ts2.isTypeNode)); + }, _a2[ + 187 + /* SyntaxKind.OptionalType */ + ] = function visitEachChildOfOptionalTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateOptionalTypeNode(node, nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 188 + /* SyntaxKind.RestType */ + ] = function visitEachChildOfRestTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateRestTypeNode(node, nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 189 + /* SyntaxKind.UnionType */ + ] = function visitEachChildOfUnionTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts2.isTypeNode)); + }, _a2[ + 190 + /* SyntaxKind.IntersectionType */ + ] = function visitEachChildOfIntersectionTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts2.isTypeNode)); + }, _a2[ + 191 + /* SyntaxKind.ConditionalType */ + ] = function visitEachChildOfConditionalTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConditionalTypeNode(node, nodeVisitor(node.checkType, visitor, ts2.isTypeNode), nodeVisitor(node.extendsType, visitor, ts2.isTypeNode), nodeVisitor(node.trueType, visitor, ts2.isTypeNode), nodeVisitor(node.falseType, visitor, ts2.isTypeNode)); + }, _a2[ + 192 + /* SyntaxKind.InferType */ + ] = function visitEachChildOfInferTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateInferTypeNode(node, nodeVisitor(node.typeParameter, visitor, ts2.isTypeParameterDeclaration)); + }, _a2[ + 202 + /* SyntaxKind.ImportType */ + ] = function visitEachChildOfImportTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportTypeNode(node, nodeVisitor(node.argument, visitor, ts2.isTypeNode), nodeVisitor(node.assertions, visitor, ts2.isImportTypeAssertionContainer), nodeVisitor(node.qualifier, visitor, ts2.isEntityName), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), node.isTypeOf); + }, _a2[ + 298 + /* SyntaxKind.ImportTypeAssertionContainer */ + ] = function visitEachChildOfImportTypeAssertionContainer(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportTypeAssertionContainer(node, nodeVisitor(node.assertClause, visitor, ts2.isAssertClause), node.multiLine); + }, _a2[ + 199 + /* SyntaxKind.NamedTupleMember */ + ] = function visitEachChildOfNamedTupleMember(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateNamedTupleMember(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts2.isDotDotDotToken), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionToken), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 193 + /* SyntaxKind.ParenthesizedType */ + ] = function visitEachChildOfParenthesizedType(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateParenthesizedType(node, nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 195 + /* SyntaxKind.TypeOperator */ + ] = function visitEachChildOfTypeOperatorNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeOperatorNode(node, nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 196 + /* SyntaxKind.IndexedAccessType */ + ] = function visitEachChildOfIndexedAccessType(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIndexedAccessTypeNode(node, nodeVisitor(node.objectType, visitor, ts2.isTypeNode), nodeVisitor(node.indexType, visitor, ts2.isTypeNode)); + }, _a2[ + 197 + /* SyntaxKind.MappedType */ + ] = function visitEachChildOfMappedType(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts2.isReadonlyKeywordOrPlusOrMinusToken), nodeVisitor(node.typeParameter, visitor, ts2.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts2.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionOrPlusOrMinusToken), nodeVisitor(node.type, visitor, ts2.isTypeNode), nodesVisitor(node.members, visitor, ts2.isTypeElement)); + }, _a2[ + 198 + /* SyntaxKind.LiteralType */ + ] = function visitEachChildOfLiteralTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts2.isExpression)); + }, _a2[ + 200 + /* SyntaxKind.TemplateLiteralType */ + ] = function visitEachChildOfTemplateLiteralType(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts2.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts2.isTemplateLiteralTypeSpan)); + }, _a2[ + 201 + /* SyntaxKind.TemplateLiteralTypeSpan */ + ] = function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateLiteralTypeSpan(node, nodeVisitor(node.type, visitor, ts2.isTypeNode), nodeVisitor(node.literal, visitor, ts2.isTemplateMiddleOrTemplateTail)); + }, // Binding patterns + _a2[ + 203 + /* SyntaxKind.ObjectBindingPattern */ + ] = function visitEachChildOfObjectBindingPattern(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts2.isBindingElement)); + }, _a2[ + 204 + /* SyntaxKind.ArrayBindingPattern */ + ] = function visitEachChildOfArrayBindingPattern(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts2.isArrayBindingElement)); + }, _a2[ + 205 + /* SyntaxKind.BindingElement */ + ] = function visitEachChildOfBindingElement(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateBindingElement(node, nodeVisitor(node.dotDotDotToken, tokenVisitor, ts2.isDotDotDotToken), nodeVisitor(node.propertyName, visitor, ts2.isPropertyName), nodeVisitor(node.name, visitor, ts2.isBindingName), nodeVisitor(node.initializer, visitor, ts2.isExpression)); + }, // Expression + _a2[ + 206 + /* SyntaxKind.ArrayLiteralExpression */ + ] = function visitEachChildOfArrayLiteralExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayLiteralExpression(node, nodesVisitor(node.elements, visitor, ts2.isExpression)); + }, _a2[ + 207 + /* SyntaxKind.ObjectLiteralExpression */ + ] = function visitEachChildOfObjectLiteralExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateObjectLiteralExpression(node, nodesVisitor(node.properties, visitor, ts2.isObjectLiteralElementLike)); + }, _a2[ + 208 + /* SyntaxKind.PropertyAccessExpression */ + ] = function visitEachChildOfPropertyAccessExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return ts2.isPropertyAccessChain(node) ? context2.factory.updatePropertyAccessChain(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts2.isQuestionDotToken), nodeVisitor(node.name, visitor, ts2.isMemberName)) : context2.factory.updatePropertyAccessExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.name, visitor, ts2.isMemberName)); + }, _a2[ + 209 + /* SyntaxKind.ElementAccessExpression */ + ] = function visitEachChildOfElementAccessExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return ts2.isElementAccessChain(node) ? context2.factory.updateElementAccessChain(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts2.isQuestionDotToken), nodeVisitor(node.argumentExpression, visitor, ts2.isExpression)) : context2.factory.updateElementAccessExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.argumentExpression, visitor, ts2.isExpression)); + }, _a2[ + 210 + /* SyntaxKind.CallExpression */ + ] = function visitEachChildOfCallExpression(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return ts2.isCallChain(node) ? context2.factory.updateCallChain(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.questionDotToken, tokenVisitor, ts2.isQuestionDotToken), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodesVisitor(node.arguments, visitor, ts2.isExpression)) : context2.factory.updateCallExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodesVisitor(node.arguments, visitor, ts2.isExpression)); + }, _a2[ + 211 + /* SyntaxKind.NewExpression */ + ] = function visitEachChildOfNewExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNewExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodesVisitor(node.arguments, visitor, ts2.isExpression)); + }, _a2[ + 212 + /* SyntaxKind.TaggedTemplateExpression */ + ] = function visitEachChildOfTaggedTemplateExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTaggedTemplateExpression(node, nodeVisitor(node.tag, visitor, ts2.isExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodeVisitor(node.template, visitor, ts2.isTemplateLiteral)); + }, _a2[ + 213 + /* SyntaxKind.TypeAssertionExpression */ + ] = function visitEachChildOfTypeAssertionExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeAssertion(node, nodeVisitor(node.type, visitor, ts2.isTypeNode), nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 214 + /* SyntaxKind.ParenthesizedExpression */ + ] = function visitEachChildOfParenthesizedExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateParenthesizedExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 215 + /* SyntaxKind.FunctionExpression */ + ] = function visitEachChildOfFunctionExpression(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts2.isAsteriskToken), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context2, nodesVisitor), nodeVisitor(node.type, visitor, ts2.isTypeNode), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 216 + /* SyntaxKind.ArrowFunction */ + ] = function visitEachChildOfArrowFunction(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context2, nodesVisitor), nodeVisitor(node.type, visitor, ts2.isTypeNode), nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, ts2.isEqualsGreaterThanToken), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 217 + /* SyntaxKind.DeleteExpression */ + ] = function visitEachChildOfDeleteExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDeleteExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 218 + /* SyntaxKind.TypeOfExpression */ + ] = function visitEachChildOfTypeOfExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeOfExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 219 + /* SyntaxKind.VoidExpression */ + ] = function visitEachChildOfVoidExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateVoidExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 220 + /* SyntaxKind.AwaitExpression */ + ] = function visitEachChildOfAwaitExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateAwaitExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 221 + /* SyntaxKind.PrefixUnaryExpression */ + ] = function visitEachChildOfPrefixUnaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePrefixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts2.isExpression)); + }, _a2[ + 222 + /* SyntaxKind.PostfixUnaryExpression */ + ] = function visitEachChildOfPostfixUnaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePostfixUnaryExpression(node, nodeVisitor(node.operand, visitor, ts2.isExpression)); + }, _a2[ + 223 + /* SyntaxKind.BinaryExpression */ + ] = function visitEachChildOfBinaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateBinaryExpression(node, nodeVisitor(node.left, visitor, ts2.isExpression), nodeVisitor(node.operatorToken, tokenVisitor, ts2.isBinaryOperatorToken), nodeVisitor(node.right, visitor, ts2.isExpression)); + }, _a2[ + 224 + /* SyntaxKind.ConditionalExpression */ + ] = function visitEachChildOfConditionalExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateConditionalExpression(node, nodeVisitor(node.condition, visitor, ts2.isExpression), nodeVisitor(node.questionToken, tokenVisitor, ts2.isQuestionToken), nodeVisitor(node.whenTrue, visitor, ts2.isExpression), nodeVisitor(node.colonToken, tokenVisitor, ts2.isColonToken), nodeVisitor(node.whenFalse, visitor, ts2.isExpression)); + }, _a2[ + 225 + /* SyntaxKind.TemplateExpression */ + ] = function visitEachChildOfTemplateExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateExpression(node, nodeVisitor(node.head, visitor, ts2.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts2.isTemplateSpan)); + }, _a2[ + 226 + /* SyntaxKind.YieldExpression */ + ] = function visitEachChildOfYieldExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateYieldExpression(node, nodeVisitor(node.asteriskToken, tokenVisitor, ts2.isAsteriskToken), nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 227 + /* SyntaxKind.SpreadElement */ + ] = function visitEachChildOfSpreadElement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSpreadElement(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 228 + /* SyntaxKind.ClassExpression */ + ] = function visitEachChildOfClassExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts2.isHeritageClause), nodesVisitor(node.members, visitor, ts2.isClassElement)); + }, _a2[ + 230 + /* SyntaxKind.ExpressionWithTypeArguments */ + ] = function visitEachChildOfExpressionWithTypeArguments(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExpressionWithTypeArguments(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode)); + }, _a2[ + 231 + /* SyntaxKind.AsExpression */ + ] = function visitEachChildOfAsExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateAsExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 235 + /* SyntaxKind.SatisfiesExpression */ + ] = function visitEachChildOfSatisfiesExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSatisfiesExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 232 + /* SyntaxKind.NonNullExpression */ + ] = function visitEachChildOfNonNullExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return ts2.isOptionalChain(node) ? context2.factory.updateNonNullChain(node, nodeVisitor(node.expression, visitor, ts2.isExpression)) : context2.factory.updateNonNullExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 233 + /* SyntaxKind.MetaProperty */ + ] = function visitEachChildOfMetaProperty(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateMetaProperty(node, nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, // Misc + _a2[ + 236 + /* SyntaxKind.TemplateSpan */ + ] = function visitEachChildOfTemplateSpan(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateSpan(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.literal, visitor, ts2.isTemplateMiddleOrTemplateTail)); + }, // Element + _a2[ + 238 + /* SyntaxKind.Block */ + ] = function visitEachChildOfBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateBlock(node, nodesVisitor(node.statements, visitor, ts2.isStatement)); + }, _a2[ + 240 + /* SyntaxKind.VariableStatement */ + ] = function visitEachChildOfVariableStatement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.declarationList, visitor, ts2.isVariableDeclarationList)); + }, _a2[ + 241 + /* SyntaxKind.ExpressionStatement */ + ] = function visitEachChildOfExpressionStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExpressionStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 242 + /* SyntaxKind.IfStatement */ + ] = function visitEachChildOfIfStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIfStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.thenStatement, visitor, ts2.isStatement, context2.factory.liftToBlock), nodeVisitor(node.elseStatement, visitor, ts2.isStatement, context2.factory.liftToBlock)); + }, _a2[ + 243 + /* SyntaxKind.DoStatement */ + ] = function visitEachChildOfDoStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDoStatement(node, visitIterationBody(node.statement, visitor, context2, nodeVisitor), nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 244 + /* SyntaxKind.WhileStatement */ + ] = function visitEachChildOfWhileStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateWhileStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression), visitIterationBody(node.statement, visitor, context2, nodeVisitor)); + }, _a2[ + 245 + /* SyntaxKind.ForStatement */ + ] = function visitEachChildOfForStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateForStatement(node, nodeVisitor(node.initializer, visitor, ts2.isForInitializer), nodeVisitor(node.condition, visitor, ts2.isExpression), nodeVisitor(node.incrementor, visitor, ts2.isExpression), visitIterationBody(node.statement, visitor, context2, nodeVisitor)); + }, _a2[ + 246 + /* SyntaxKind.ForInStatement */ + ] = function visitEachChildOfForInStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateForInStatement(node, nodeVisitor(node.initializer, visitor, ts2.isForInitializer), nodeVisitor(node.expression, visitor, ts2.isExpression), visitIterationBody(node.statement, visitor, context2, nodeVisitor)); + }, _a2[ + 247 + /* SyntaxKind.ForOfStatement */ + ] = function visitEachChildOfForOfStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateForOfStatement(node, nodeVisitor(node.awaitModifier, tokenVisitor, ts2.isAwaitKeyword), nodeVisitor(node.initializer, visitor, ts2.isForInitializer), nodeVisitor(node.expression, visitor, ts2.isExpression), visitIterationBody(node.statement, visitor, context2, nodeVisitor)); + }, _a2[ + 248 + /* SyntaxKind.ContinueStatement */ + ] = function visitEachChildOfContinueStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateContinueStatement(node, nodeVisitor(node.label, visitor, ts2.isIdentifier)); + }, _a2[ + 249 + /* SyntaxKind.BreakStatement */ + ] = function visitEachChildOfBreakStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateBreakStatement(node, nodeVisitor(node.label, visitor, ts2.isIdentifier)); + }, _a2[ + 250 + /* SyntaxKind.ReturnStatement */ + ] = function visitEachChildOfReturnStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateReturnStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 251 + /* SyntaxKind.WithStatement */ + ] = function visitEachChildOfWithStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateWithStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.statement, visitor, ts2.isStatement, context2.factory.liftToBlock)); + }, _a2[ + 252 + /* SyntaxKind.SwitchStatement */ + ] = function visitEachChildOfSwitchStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSwitchStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodeVisitor(node.caseBlock, visitor, ts2.isCaseBlock)); + }, _a2[ + 253 + /* SyntaxKind.LabeledStatement */ + ] = function visitEachChildOfLabeledStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateLabeledStatement(node, nodeVisitor(node.label, visitor, ts2.isIdentifier), nodeVisitor(node.statement, visitor, ts2.isStatement, context2.factory.liftToBlock)); + }, _a2[ + 254 + /* SyntaxKind.ThrowStatement */ + ] = function visitEachChildOfThrowStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateThrowStatement(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 255 + /* SyntaxKind.TryStatement */ + ] = function visitEachChildOfTryStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTryStatement(node, nodeVisitor(node.tryBlock, visitor, ts2.isBlock), nodeVisitor(node.catchClause, visitor, ts2.isCatchClause), nodeVisitor(node.finallyBlock, visitor, ts2.isBlock)); + }, _a2[ + 257 + /* SyntaxKind.VariableDeclaration */ + ] = function visitEachChildOfVariableDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateVariableDeclaration(node, nodeVisitor(node.name, visitor, ts2.isBindingName), nodeVisitor(node.exclamationToken, tokenVisitor, ts2.isExclamationToken), nodeVisitor(node.type, visitor, ts2.isTypeNode), nodeVisitor(node.initializer, visitor, ts2.isExpression)); + }, _a2[ + 258 + /* SyntaxKind.VariableDeclarationList */ + ] = function visitEachChildOfVariableDeclarationList(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts2.isVariableDeclaration)); + }, _a2[ + 259 + /* SyntaxKind.FunctionDeclaration */ + ] = function visitEachChildOfFunctionDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateFunctionDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.asteriskToken, tokenVisitor, ts2.isAsteriskToken), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context2, nodesVisitor), nodeVisitor(node.type, visitor, ts2.isTypeNode), visitFunctionBody(node.body, visitor, context2, nodeVisitor)); + }, _a2[ + 260 + /* SyntaxKind.ClassDeclaration */ + ] = function visitEachChildOfClassDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateClassDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifierLike), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts2.isHeritageClause), nodesVisitor(node.members, visitor, ts2.isClassElement)); + }, _a2[ + 261 + /* SyntaxKind.InterfaceDeclaration */ + ] = function visitEachChildOfInterfaceDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateInterfaceDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts2.isHeritageClause), nodesVisitor(node.members, visitor, ts2.isTypeElement)); + }, _a2[ + 262 + /* SyntaxKind.TypeAliasDeclaration */ + ] = function visitEachChildOfTypeAliasDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeAliasDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts2.isTypeParameterDeclaration), nodeVisitor(node.type, visitor, ts2.isTypeNode)); + }, _a2[ + 263 + /* SyntaxKind.EnumDeclaration */ + ] = function visitEachChildOfEnumDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateEnumDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isIdentifier), nodesVisitor(node.members, visitor, ts2.isEnumMember)); + }, _a2[ + 264 + /* SyntaxKind.ModuleDeclaration */ + ] = function visitEachChildOfModuleDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateModuleDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.name, visitor, ts2.isModuleName), nodeVisitor(node.body, visitor, ts2.isModuleBody)); + }, _a2[ + 265 + /* SyntaxKind.ModuleBlock */ + ] = function visitEachChildOfModuleBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts2.isStatement)); + }, _a2[ + 266 + /* SyntaxKind.CaseBlock */ + ] = function visitEachChildOfCaseBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts2.isCaseOrDefaultClause)); + }, _a2[ + 267 + /* SyntaxKind.NamespaceExportDeclaration */ + ] = function visitEachChildOfNamespaceExportDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceExportDeclaration(node, nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, _a2[ + 268 + /* SyntaxKind.ImportEqualsDeclaration */ + ] = function visitEachChildOfImportEqualsDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportEqualsDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), node.isTypeOnly, nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.moduleReference, visitor, ts2.isModuleReference)); + }, _a2[ + 269 + /* SyntaxKind.ImportDeclaration */ + ] = function visitEachChildOfImportDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.importClause, visitor, ts2.isImportClause), nodeVisitor(node.moduleSpecifier, visitor, ts2.isExpression), nodeVisitor(node.assertClause, visitor, ts2.isAssertClause)); + }, _a2[ + 296 + /* SyntaxKind.AssertClause */ + ] = function visitEachChildOfAssertClause(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts2.isAssertEntry), node.multiLine); + }, _a2[ + 297 + /* SyntaxKind.AssertEntry */ + ] = function visitEachChildOfAssertEntry(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts2.isAssertionKey), nodeVisitor(node.value, visitor, ts2.isExpression)); + }, _a2[ + 270 + /* SyntaxKind.ImportClause */ + ] = function visitEachChildOfImportClause(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts2.isNamedImportBindings)); + }, _a2[ + 271 + /* SyntaxKind.NamespaceImport */ + ] = function visitEachChildOfNamespaceImport(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceImport(node, nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, _a2[ + 277 + /* SyntaxKind.NamespaceExport */ + ] = function visitEachChildOfNamespaceExport(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceExport(node, nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, _a2[ + 272 + /* SyntaxKind.NamedImports */ + ] = function visitEachChildOfNamedImports(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts2.isImportSpecifier)); + }, _a2[ + 273 + /* SyntaxKind.ImportSpecifier */ + ] = function visitEachChildOfImportSpecifier(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts2.isIdentifier), nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, _a2[ + 274 + /* SyntaxKind.ExportAssignment */ + ] = function visitEachChildOfExportAssignment(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportAssignment(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 275 + /* SyntaxKind.ExportDeclaration */ + ] = function visitEachChildOfExportDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportDeclaration(node, nodesVisitor(node.modifiers, visitor, ts2.isModifier), node.isTypeOnly, nodeVisitor(node.exportClause, visitor, ts2.isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, ts2.isExpression), nodeVisitor(node.assertClause, visitor, ts2.isAssertClause)); + }, _a2[ + 276 + /* SyntaxKind.NamedExports */ + ] = function visitEachChildOfNamedExports(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts2.isExportSpecifier)); + }, _a2[ + 278 + /* SyntaxKind.ExportSpecifier */ + ] = function visitEachChildOfExportSpecifier(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts2.isIdentifier), nodeVisitor(node.name, visitor, ts2.isIdentifier)); + }, // Module references + _a2[ + 280 + /* SyntaxKind.ExternalModuleReference */ + ] = function visitEachChildOfExternalModuleReference(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, // JSX + _a2[ + 281 + /* SyntaxKind.JsxElement */ + ] = function visitEachChildOfJsxElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxElement(node, nodeVisitor(node.openingElement, visitor, ts2.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts2.isJsxChild), nodeVisitor(node.closingElement, visitor, ts2.isJsxClosingElement)); + }, _a2[ + 282 + /* SyntaxKind.JsxSelfClosingElement */ + ] = function visitEachChildOfJsxSelfClosingElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxSelfClosingElement(node, nodeVisitor(node.tagName, visitor, ts2.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodeVisitor(node.attributes, visitor, ts2.isJsxAttributes)); + }, _a2[ + 283 + /* SyntaxKind.JsxOpeningElement */ + ] = function visitEachChildOfJsxOpeningElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxOpeningElement(node, nodeVisitor(node.tagName, visitor, ts2.isJsxTagNameExpression), nodesVisitor(node.typeArguments, visitor, ts2.isTypeNode), nodeVisitor(node.attributes, visitor, ts2.isJsxAttributes)); + }, _a2[ + 284 + /* SyntaxKind.JsxClosingElement */ + ] = function visitEachChildOfJsxClosingElement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxClosingElement(node, nodeVisitor(node.tagName, visitor, ts2.isJsxTagNameExpression)); + }, _a2[ + 285 + /* SyntaxKind.JsxFragment */ + ] = function visitEachChildOfJsxFragment(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts2.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts2.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts2.isJsxClosingFragment)); + }, _a2[ + 288 + /* SyntaxKind.JsxAttribute */ + ] = function visitEachChildOfJsxAttribute(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.initializer, visitor, ts2.isStringLiteralOrJsxExpression)); + }, _a2[ + 289 + /* SyntaxKind.JsxAttributes */ + ] = function visitEachChildOfJsxAttributes(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts2.isJsxAttributeLike)); + }, _a2[ + 290 + /* SyntaxKind.JsxSpreadAttribute */ + ] = function visitEachChildOfJsxSpreadAttribute(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxSpreadAttribute(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 291 + /* SyntaxKind.JsxExpression */ + ] = function visitEachChildOfJsxExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, // Clauses + _a2[ + 292 + /* SyntaxKind.CaseClause */ + ] = function visitEachChildOfCaseClause(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCaseClause(node, nodeVisitor(node.expression, visitor, ts2.isExpression), nodesVisitor(node.statements, visitor, ts2.isStatement)); + }, _a2[ + 293 + /* SyntaxKind.DefaultClause */ + ] = function visitEachChildOfDefaultClause(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts2.isStatement)); + }, _a2[ + 294 + /* SyntaxKind.HeritageClause */ + ] = function visitEachChildOfHeritageClause(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts2.isExpressionWithTypeArguments)); + }, _a2[ + 295 + /* SyntaxKind.CatchClause */ + ] = function visitEachChildOfCatchClause(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCatchClause(node, nodeVisitor(node.variableDeclaration, visitor, ts2.isVariableDeclaration), nodeVisitor(node.block, visitor, ts2.isBlock)); + }, // Property assignments + _a2[ + 299 + /* SyntaxKind.PropertyAssignment */ + ] = function visitEachChildOfPropertyAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePropertyAssignment(node, nodeVisitor(node.name, visitor, ts2.isPropertyName), nodeVisitor(node.initializer, visitor, ts2.isExpression)); + }, _a2[ + 300 + /* SyntaxKind.ShorthandPropertyAssignment */ + ] = function visitEachChildOfShorthandPropertyAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateShorthandPropertyAssignment(node, nodeVisitor(node.name, visitor, ts2.isIdentifier), nodeVisitor(node.objectAssignmentInitializer, visitor, ts2.isExpression)); + }, _a2[ + 301 + /* SyntaxKind.SpreadAssignment */ + ] = function visitEachChildOfSpreadAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSpreadAssignment(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, // Enum + _a2[ + 302 + /* SyntaxKind.EnumMember */ + ] = function visitEachChildOfEnumMember(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateEnumMember(node, nodeVisitor(node.name, visitor, ts2.isPropertyName), nodeVisitor(node.initializer, visitor, ts2.isExpression)); + }, // Top-level nodes + _a2[ + 308 + /* SyntaxKind.SourceFile */ + ] = function visitEachChildOfSourceFile(node, visitor, context2, _nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateSourceFile(node, visitLexicalEnvironment(node.statements, visitor, context2)); + }, // Transformation nodes + _a2[ + 353 + /* SyntaxKind.PartiallyEmittedExpression */ + ] = function visitEachChildOfPartiallyEmittedExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePartiallyEmittedExpression(node, nodeVisitor(node.expression, visitor, ts2.isExpression)); + }, _a2[ + 354 + /* SyntaxKind.CommaListExpression */ + ] = function visitEachChildOfCommaListExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateCommaListExpression(node, nodesVisitor(node.elements, visitor, ts2.isExpression)); + }, _a2); + function extractSingleNode(nodes) { + ts2.Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return ts2.singleOrUndefined(nodes); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { + var _a2 = generatorOptions.extendedDiagnostics ? ts2.performance.createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : ts2.performance.nullTimer, enter = _a2.enter, exit3 = _a2.exit; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = new ts2.Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; + return { + getSources: function() { + return rawSources; + }, + addSource, + setSourceContent, + addName, + addMapping, + appendSourceMap, + toJSON, + toString: function() { + return JSON.stringify(toJSON()); + } + }; + function addSource(fileName) { + enter(); + var source = ts2.getRelativePathToDirectoryOrUrl( + sourcesDirectoryPath, + fileName, + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + true + ); + var sourceIndex = sourceToSourceIndexMap.get(source); + if (sourceIndex === void 0) { + sourceIndex = sources.length; + sources.push(source); + rawSources.push(fileName); + sourceToSourceIndexMap.set(source, sourceIndex); + } + exit3(); + return sourceIndex; + } + function setSourceContent(sourceIndex, content) { + enter(); + if (content !== null) { + if (!sourcesContent) + sourcesContent = []; + while (sourcesContent.length < sourceIndex) { + sourcesContent.push(null); + } + sourcesContent[sourceIndex] = content; + } + exit3(); + } + function addName(name2) { + enter(); + if (!nameToNameIndexMap) + nameToNameIndexMap = new ts2.Map(); + var nameIndex = nameToNameIndexMap.get(name2); + if (nameIndex === void 0) { + nameIndex = names.length; + names.push(name2); + nameToNameIndexMap.set(name2, nameIndex); + } + exit3(); + return nameIndex; + } + function isNewGeneratedPosition(generatedLine, generatedCharacter) { + return !hasPending || pendingGeneratedLine !== generatedLine || pendingGeneratedCharacter !== generatedCharacter; + } + function isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter) { + return sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0 && pendingSourceIndex === sourceIndex && (pendingSourceLine > sourceLine || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter); + } + function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) { + ts2.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); + ts2.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); + ts2.Debug.assert(sourceIndex === void 0 || sourceIndex >= 0, "sourceIndex cannot be negative"); + ts2.Debug.assert(sourceLine === void 0 || sourceLine >= 0, "sourceLine cannot be negative"); + ts2.Debug.assert(sourceCharacter === void 0 || sourceCharacter >= 0, "sourceCharacter cannot be negative"); + enter(); + if (isNewGeneratedPosition(generatedLine, generatedCharacter) || isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) { + commitPendingMapping(); + pendingGeneratedLine = generatedLine; + pendingGeneratedCharacter = generatedCharacter; + hasPendingSource = false; + hasPendingName = false; + hasPending = true; + } + if (sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0) { + pendingSourceIndex = sourceIndex; + pendingSourceLine = sourceLine; + pendingSourceCharacter = sourceCharacter; + hasPendingSource = true; + if (nameIndex !== void 0) { + pendingNameIndex = nameIndex; + hasPendingName = true; + } + } + exit3(); + } + function appendSourceMap(generatedLine, generatedCharacter, map4, sourceMapPath, start, end) { + ts2.Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); + ts2.Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); + enter(); + var sourceIndexToNewSourceIndexMap = []; + var nameIndexToNewNameIndexMap; + var mappingIterator = decodeMappings(map4.mappings); + for (var iterResult = mappingIterator.next(); !iterResult.done; iterResult = mappingIterator.next()) { + var raw = iterResult.value; + if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) { + break; + } + if (start && (raw.generatedLine < start.line || start.line === raw.generatedLine && raw.generatedCharacter < start.character)) { + continue; + } + var newSourceIndex = void 0; + var newSourceLine = void 0; + var newSourceCharacter = void 0; + var newNameIndex = void 0; + if (raw.sourceIndex !== void 0) { + newSourceIndex = sourceIndexToNewSourceIndexMap[raw.sourceIndex]; + if (newSourceIndex === void 0) { + var rawPath = map4.sources[raw.sourceIndex]; + var relativePath2 = map4.sourceRoot ? ts2.combinePaths(map4.sourceRoot, rawPath) : rawPath; + var combinedPath = ts2.combinePaths(ts2.getDirectoryPath(sourceMapPath), relativePath2); + sourceIndexToNewSourceIndexMap[raw.sourceIndex] = newSourceIndex = addSource(combinedPath); + if (map4.sourcesContent && typeof map4.sourcesContent[raw.sourceIndex] === "string") { + setSourceContent(newSourceIndex, map4.sourcesContent[raw.sourceIndex]); + } + } + newSourceLine = raw.sourceLine; + newSourceCharacter = raw.sourceCharacter; + if (map4.names && raw.nameIndex !== void 0) { + if (!nameIndexToNewNameIndexMap) + nameIndexToNewNameIndexMap = []; + newNameIndex = nameIndexToNewNameIndexMap[raw.nameIndex]; + if (newNameIndex === void 0) { + nameIndexToNewNameIndexMap[raw.nameIndex] = newNameIndex = addName(map4.names[raw.nameIndex]); + } + } + } + var rawGeneratedLine = raw.generatedLine - (start ? start.line : 0); + var newGeneratedLine = rawGeneratedLine + generatedLine; + var rawGeneratedCharacter = start && start.line === raw.generatedLine ? raw.generatedCharacter - start.character : raw.generatedCharacter; + var newGeneratedCharacter = rawGeneratedLine === 0 ? rawGeneratedCharacter + generatedCharacter : rawGeneratedCharacter; + addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex); + } + exit3(); + } + function shouldCommitMapping() { + return !hasLast || lastGeneratedLine !== pendingGeneratedLine || lastGeneratedCharacter !== pendingGeneratedCharacter || lastSourceIndex !== pendingSourceIndex || lastSourceLine !== pendingSourceLine || lastSourceCharacter !== pendingSourceCharacter || lastNameIndex !== pendingNameIndex; + } + function appendMappingCharCode(charCode) { + mappingCharCodes.push(charCode); + if (mappingCharCodes.length >= 1024) { + flushMappingBuffer(); + } + } + function commitPendingMapping() { + if (!hasPending || !shouldCommitMapping()) { + return; + } + enter(); + if (lastGeneratedLine < pendingGeneratedLine) { + do { + appendMappingCharCode( + 59 + /* CharacterCodes.semicolon */ + ); + lastGeneratedLine++; + } while (lastGeneratedLine < pendingGeneratedLine); + lastGeneratedCharacter = 0; + } else { + ts2.Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, "generatedLine cannot backtrack"); + if (hasLast) { + appendMappingCharCode( + 44 + /* CharacterCodes.comma */ + ); + } + } + appendBase64VLQ(pendingGeneratedCharacter - lastGeneratedCharacter); + lastGeneratedCharacter = pendingGeneratedCharacter; + if (hasPendingSource) { + appendBase64VLQ(pendingSourceIndex - lastSourceIndex); + lastSourceIndex = pendingSourceIndex; + appendBase64VLQ(pendingSourceLine - lastSourceLine); + lastSourceLine = pendingSourceLine; + appendBase64VLQ(pendingSourceCharacter - lastSourceCharacter); + lastSourceCharacter = pendingSourceCharacter; + if (hasPendingName) { + appendBase64VLQ(pendingNameIndex - lastNameIndex); + lastNameIndex = pendingNameIndex; + } + } + hasLast = true; + exit3(); + } + function flushMappingBuffer() { + if (mappingCharCodes.length > 0) { + mappings += String.fromCharCode.apply(void 0, mappingCharCodes); + mappingCharCodes.length = 0; + } + } + function toJSON() { + commitPendingMapping(); + flushMappingBuffer(); + return { + version: 3, + file, + sourceRoot, + sources, + names, + mappings, + sourcesContent + }; + } + function appendBase64VLQ(inValue) { + if (inValue < 0) { + inValue = (-inValue << 1) + 1; + } else { + inValue = inValue << 1; + } + do { + var currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + appendMappingCharCode(base64FormatEncode(currentDigit)); + } while (inValue > 0); + } + } + ts2.createSourceMapGenerator = createSourceMapGenerator; + var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/; + var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; + function getLineInfo(text, lineStarts) { + return { + getLineCount: function() { + return lineStarts.length; + }, + getLineText: function(line) { + return text.substring(lineStarts[line], lineStarts[line + 1]); + } + }; + } + ts2.getLineInfo = getLineInfo; + function tryGetSourceMappingURL(lineInfo) { + for (var index4 = lineInfo.getLineCount() - 1; index4 >= 0; index4--) { + var line = lineInfo.getLineText(index4); + var comment = sourceMapCommentRegExp.exec(line); + if (comment) { + return ts2.trimStringEnd(comment[1]); + } else if (!line.match(whitespaceOrMapCommentRegExp)) { + break; + } + } + } + ts2.tryGetSourceMappingURL = tryGetSourceMappingURL; + function isStringOrNull(x7) { + return typeof x7 === "string" || x7 === null; + } + function isRawSourceMap(x7) { + return x7 !== null && typeof x7 === "object" && x7.version === 3 && typeof x7.file === "string" && typeof x7.mappings === "string" && ts2.isArray(x7.sources) && ts2.every(x7.sources, ts2.isString) && (x7.sourceRoot === void 0 || x7.sourceRoot === null || typeof x7.sourceRoot === "string") && (x7.sourcesContent === void 0 || x7.sourcesContent === null || ts2.isArray(x7.sourcesContent) && ts2.every(x7.sourcesContent, isStringOrNull)) && (x7.names === void 0 || x7.names === null || ts2.isArray(x7.names) && ts2.every(x7.names, ts2.isString)); + } + ts2.isRawSourceMap = isRawSourceMap; + function tryParseRawSourceMap(text) { + try { + var parsed = JSON.parse(text); + if (isRawSourceMap(parsed)) { + return parsed; + } + } catch (_a2) { + } + return void 0; + } + ts2.tryParseRawSourceMap = tryParseRawSourceMap; + function decodeMappings(mappings) { + var done = false; + var pos = 0; + var generatedLine = 0; + var generatedCharacter = 0; + var sourceIndex = 0; + var sourceLine = 0; + var sourceCharacter = 0; + var nameIndex = 0; + var error2; + return { + get pos() { + return pos; + }, + get error() { + return error2; + }, + get state() { + return captureMapping( + /*hasSource*/ + true, + /*hasName*/ + true + ); + }, + next: function() { + while (!done && pos < mappings.length) { + var ch = mappings.charCodeAt(pos); + if (ch === 59) { + generatedLine++; + generatedCharacter = 0; + pos++; + continue; + } + if (ch === 44) { + pos++; + continue; + } + var hasSource = false; + var hasName = false; + generatedCharacter += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (generatedCharacter < 0) + return setErrorAndStopIterating("Invalid generatedCharacter found"); + if (!isSourceMappingSegmentEnd()) { + hasSource = true; + sourceIndex += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceIndex < 0) + return setErrorAndStopIterating("Invalid sourceIndex found"); + if (isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Format: No entries after sourceIndex"); + sourceLine += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceLine < 0) + return setErrorAndStopIterating("Invalid sourceLine found"); + if (isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Format: No entries after sourceLine"); + sourceCharacter += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceCharacter < 0) + return setErrorAndStopIterating("Invalid sourceCharacter found"); + if (!isSourceMappingSegmentEnd()) { + hasName = true; + nameIndex += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (nameIndex < 0) + return setErrorAndStopIterating("Invalid nameIndex found"); + if (!isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Error Format: Entries after nameIndex"); + } + } + return { value: captureMapping(hasSource, hasName), done }; + } + return stopIterating(); + } + }; + function captureMapping(hasSource, hasName) { + return { + generatedLine, + generatedCharacter, + sourceIndex: hasSource ? sourceIndex : void 0, + sourceLine: hasSource ? sourceLine : void 0, + sourceCharacter: hasSource ? sourceCharacter : void 0, + nameIndex: hasName ? nameIndex : void 0 + }; + } + function stopIterating() { + done = true; + return { value: void 0, done: true }; + } + function setError(message) { + if (error2 === void 0) { + error2 = message; + } + } + function setErrorAndStopIterating(message) { + setError(message); + return stopIterating(); + } + function hasReportedError() { + return error2 !== void 0; + } + function isSourceMappingSegmentEnd() { + return pos === mappings.length || mappings.charCodeAt(pos) === 44 || mappings.charCodeAt(pos) === 59; + } + function base64VLQFormatDecode() { + var moreDigits = true; + var shiftCount = 0; + var value2 = 0; + for (; moreDigits; pos++) { + if (pos >= mappings.length) + return setError("Error in decoding base64VLQFormatDecode, past the mapping string"), -1; + var currentByte = base64FormatDecode(mappings.charCodeAt(pos)); + if (currentByte === -1) + return setError("Invalid character in VLQ"), -1; + moreDigits = (currentByte & 32) !== 0; + value2 = value2 | (currentByte & 31) << shiftCount; + shiftCount += 5; + } + if ((value2 & 1) === 0) { + value2 = value2 >> 1; + } else { + value2 = value2 >> 1; + value2 = -value2; + } + return value2; + } + } + ts2.decodeMappings = decodeMappings; + function sameMapping(left, right) { + return left === right || left.generatedLine === right.generatedLine && left.generatedCharacter === right.generatedCharacter && left.sourceIndex === right.sourceIndex && left.sourceLine === right.sourceLine && left.sourceCharacter === right.sourceCharacter && left.nameIndex === right.nameIndex; + } + ts2.sameMapping = sameMapping; + function isSourceMapping(mapping) { + return mapping.sourceIndex !== void 0 && mapping.sourceLine !== void 0 && mapping.sourceCharacter !== void 0; + } + ts2.isSourceMapping = isSourceMapping; + function base64FormatEncode(value2) { + return value2 >= 0 && value2 < 26 ? 65 + value2 : value2 >= 26 && value2 < 52 ? 97 + value2 - 26 : value2 >= 52 && value2 < 62 ? 48 + value2 - 52 : value2 === 62 ? 43 : value2 === 63 ? 47 : ts2.Debug.fail("".concat(value2, ": not a base64 value")); + } + function base64FormatDecode(ch) { + return ch >= 65 && ch <= 90 ? ch - 65 : ch >= 97 && ch <= 122 ? ch - 97 + 26 : ch >= 48 && ch <= 57 ? ch - 48 + 52 : ch === 43 ? 62 : ch === 47 ? 63 : -1; + } + function isSourceMappedPosition(value2) { + return value2.sourceIndex !== void 0 && value2.sourcePosition !== void 0; + } + function sameMappedPosition(left, right) { + return left.generatedPosition === right.generatedPosition && left.sourceIndex === right.sourceIndex && left.sourcePosition === right.sourcePosition; + } + function compareSourcePositions(left, right) { + ts2.Debug.assert(left.sourceIndex === right.sourceIndex); + return ts2.compareValues(left.sourcePosition, right.sourcePosition); + } + function compareGeneratedPositions(left, right) { + return ts2.compareValues(left.generatedPosition, right.generatedPosition); + } + function getSourcePositionOfMapping(value2) { + return value2.sourcePosition; + } + function getGeneratedPositionOfMapping(value2) { + return value2.generatedPosition; + } + function createDocumentPositionMapper(host, map4, mapPath) { + var mapDirectory = ts2.getDirectoryPath(mapPath); + var sourceRoot = map4.sourceRoot ? ts2.getNormalizedAbsolutePath(map4.sourceRoot, mapDirectory) : mapDirectory; + var generatedAbsoluteFilePath = ts2.getNormalizedAbsolutePath(map4.file, mapDirectory); + var generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); + var sourceFileAbsolutePaths = map4.sources.map(function(source) { + return ts2.getNormalizedAbsolutePath(source, sourceRoot); + }); + var sourceToSourceIndexMap = new ts2.Map(sourceFileAbsolutePaths.map(function(source, i7) { + return [host.getCanonicalFileName(source), i7]; + })); + var decodedMappings; + var generatedMappings; + var sourceMappings; + return { + getSourcePosition, + getGeneratedPosition + }; + function processMapping(mapping) { + var generatedPosition = generatedFile !== void 0 ? ts2.getPositionOfLineAndCharacter( + generatedFile, + mapping.generatedLine, + mapping.generatedCharacter, + /*allowEdits*/ + true + ) : -1; + var source; + var sourcePosition; + if (isSourceMapping(mapping)) { + var sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); + source = map4.sources[mapping.sourceIndex]; + sourcePosition = sourceFile !== void 0 ? ts2.getPositionOfLineAndCharacter( + sourceFile, + mapping.sourceLine, + mapping.sourceCharacter, + /*allowEdits*/ + true + ) : -1; + } + return { + generatedPosition, + source, + sourceIndex: mapping.sourceIndex, + sourcePosition, + nameIndex: mapping.nameIndex + }; + } + function getDecodedMappings() { + if (decodedMappings === void 0) { + var decoder = decodeMappings(map4.mappings); + var mappings = ts2.arrayFrom(decoder, processMapping); + if (decoder.error !== void 0) { + if (host.log) { + host.log("Encountered error while decoding sourcemap: ".concat(decoder.error)); + } + decodedMappings = ts2.emptyArray; + } else { + decodedMappings = mappings; + } + } + return decodedMappings; + } + function getSourceMappings(sourceIndex) { + if (sourceMappings === void 0) { + var lists = []; + for (var _i = 0, _a2 = getDecodedMappings(); _i < _a2.length; _i++) { + var mapping = _a2[_i]; + if (!isSourceMappedPosition(mapping)) + continue; + var list = lists[mapping.sourceIndex]; + if (!list) + lists[mapping.sourceIndex] = list = []; + list.push(mapping); + } + sourceMappings = lists.map(function(list2) { + return ts2.sortAndDeduplicate(list2, compareSourcePositions, sameMappedPosition); + }); + } + return sourceMappings[sourceIndex]; + } + function getGeneratedMappings() { + if (generatedMappings === void 0) { + var list = []; + for (var _i = 0, _a2 = getDecodedMappings(); _i < _a2.length; _i++) { + var mapping = _a2[_i]; + list.push(mapping); + } + generatedMappings = ts2.sortAndDeduplicate(list, compareGeneratedPositions, sameMappedPosition); + } + return generatedMappings; + } + function getGeneratedPosition(loc) { + var sourceIndex = sourceToSourceIndexMap.get(host.getCanonicalFileName(loc.fileName)); + if (sourceIndex === void 0) + return loc; + var sourceMappings2 = getSourceMappings(sourceIndex); + if (!ts2.some(sourceMappings2)) + return loc; + var targetIndex = ts2.binarySearchKey(sourceMappings2, loc.pos, getSourcePositionOfMapping, ts2.compareValues); + if (targetIndex < 0) { + targetIndex = ~targetIndex; + } + var mapping = sourceMappings2[targetIndex]; + if (mapping === void 0 || mapping.sourceIndex !== sourceIndex) { + return loc; + } + return { fileName: generatedAbsoluteFilePath, pos: mapping.generatedPosition }; + } + function getSourcePosition(loc) { + var generatedMappings2 = getGeneratedMappings(); + if (!ts2.some(generatedMappings2)) + return loc; + var targetIndex = ts2.binarySearchKey(generatedMappings2, loc.pos, getGeneratedPositionOfMapping, ts2.compareValues); + if (targetIndex < 0) { + targetIndex = ~targetIndex; + } + var mapping = generatedMappings2[targetIndex]; + if (mapping === void 0 || !isSourceMappedPosition(mapping)) { + return loc; + } + return { fileName: sourceFileAbsolutePaths[mapping.sourceIndex], pos: mapping.sourcePosition }; + } + } + ts2.createDocumentPositionMapper = createDocumentPositionMapper; + ts2.identitySourceMapConsumer = { + getSourcePosition: ts2.identity, + getGeneratedPosition: ts2.identity + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getOriginalNodeId(node) { + node = ts2.getOriginalNode(node); + return node ? ts2.getNodeId(node) : 0; + } + ts2.getOriginalNodeId = getOriginalNodeId; + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts2.isNamedImports(node)) + return false; + return ts2.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e10) { + return e10.propertyName !== void 0 && e10.propertyName.escapedText === "default"; + } + function chainBundle(context2, transformSourceFile) { + return transformSourceFileOrBundle; + function transformSourceFileOrBundle(node) { + return node.kind === 308 ? transformSourceFile(node) : transformBundle(node); + } + function transformBundle(node) { + return context2.factory.createBundle(ts2.map(node.sourceFiles, transformSourceFile), node.prepends); + } + } + ts2.chainBundle = chainBundle; + function getExportNeedsImportStarHelper(node) { + return !!ts2.getNamespaceDeclarationNode(node); + } + ts2.getExportNeedsImportStarHelper = getExportNeedsImportStarHelper; + function getImportNeedsImportStarHelper(node) { + if (!!ts2.getNamespaceDeclarationNode(node)) { + return true; + } + var bindings6 = node.importClause && node.importClause.namedBindings; + if (!bindings6) { + return false; + } + if (!ts2.isNamedImports(bindings6)) + return false; + var defaultRefCount = 0; + for (var _i = 0, _a2 = bindings6.elements; _i < _a2.length; _i++) { + var binding3 = _a2[_i]; + if (isNamedDefaultReference(binding3)) { + defaultRefCount++; + } + } + return defaultRefCount > 0 && defaultRefCount !== bindings6.elements.length || !!(bindings6.elements.length - defaultRefCount) && ts2.isDefaultImport(node); + } + ts2.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return !getImportNeedsImportStarHelper(node) && (ts2.isDefaultImport(node) || !!node.importClause && ts2.isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)); + } + ts2.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; + function collectExternalModuleInfo(context2, sourceFile, resolver, compilerOptions) { + var externalImports = []; + var exportSpecifiers = ts2.createMultiMap(); + var exportedBindings = []; + var uniqueExports = new ts2.Map(); + var exportedNames; + var hasExportDefault = false; + var exportEquals; + var hasExportStarsToExportValues = false; + var hasImportStar = false; + var hasImportDefault = false; + for (var _i = 0, _a2 = sourceFile.statements; _i < _a2.length; _i++) { + var node = _a2[_i]; + switch (node.kind) { + case 269: + externalImports.push(node); + if (!hasImportStar && getImportNeedsImportStarHelper(node)) { + hasImportStar = true; + } + if (!hasImportDefault && getImportNeedsImportDefaultHelper(node)) { + hasImportDefault = true; + } + break; + case 268: + if (node.moduleReference.kind === 280) { + externalImports.push(node); + } + break; + case 275: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } else { + externalImports.push(node); + if (ts2.isNamedExports(node.exportClause)) { + addExportedNamesForExportDeclaration(node); + } else { + var name2 = node.exportClause.name; + if (!uniqueExports.get(ts2.idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(ts2.idText(name2), true); + exportedNames = ts2.append(exportedNames, name2); + } + hasImportStar = true; + } + } + } else { + addExportedNamesForExportDeclaration(node); + } + break; + case 274: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; + case 240: + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + for (var _b = 0, _c = node.declarationList.declarations; _b < _c.length; _b++) { + var decl = _c[_b]; + exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames); + } + } + break; + case 259: + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + if (ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + )) { + if (!hasExportDefault) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context2.factory.getDeclarationName(node)); + hasExportDefault = true; + } + } else { + var name2 = node.name; + if (!uniqueExports.get(ts2.idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(ts2.idText(name2), true); + exportedNames = ts2.append(exportedNames, name2); + } + } + } + break; + case 260: + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + if (ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + )) { + if (!hasExportDefault) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context2.factory.getDeclarationName(node)); + hasExportDefault = true; + } + } else { + var name2 = node.name; + if (name2 && !uniqueExports.get(ts2.idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(ts2.idText(name2), true); + exportedNames = ts2.append(exportedNames, name2); + } + } + } + break; + } + } + var externalHelpersImportDeclaration = ts2.createExternalHelpersImportDeclarationIfNeeded(context2.factory, context2.getEmitHelperFactory(), sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault); + if (externalHelpersImportDeclaration) { + externalImports.unshift(externalHelpersImportDeclaration); + } + return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration }; + function addExportedNamesForExportDeclaration(node2) { + for (var _i2 = 0, _a3 = ts2.cast(node2.exportClause, ts2.isNamedExports).elements; _i2 < _a3.length; _i2++) { + var specifier = _a3[_i2]; + if (!uniqueExports.get(ts2.idText(specifier.name))) { + var name3 = specifier.propertyName || specifier.name; + if (!node2.moduleSpecifier) { + exportSpecifiers.add(ts2.idText(name3), specifier); + } + var decl2 = resolver.getReferencedImportDeclaration(name3) || resolver.getReferencedValueDeclaration(name3); + if (decl2) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl2), specifier.name); + } + uniqueExports.set(ts2.idText(specifier.name), true); + exportedNames = ts2.append(exportedNames, specifier.name); + } + } + } + } + ts2.collectExternalModuleInfo = collectExternalModuleInfo; + function collectExportedVariableInfo(decl, uniqueExports, exportedNames) { + if (ts2.isBindingPattern(decl.name)) { + for (var _i = 0, _a2 = decl.name.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + exportedNames = collectExportedVariableInfo(element, uniqueExports, exportedNames); + } + } + } else if (!ts2.isGeneratedIdentifier(decl.name)) { + var text = ts2.idText(decl.name); + if (!uniqueExports.get(text)) { + uniqueExports.set(text, true); + exportedNames = ts2.append(exportedNames, decl.name); + } + } + return exportedNames; + } + function multiMapSparseArrayAdd(map4, key, value2) { + var values2 = map4[key]; + if (values2) { + values2.push(value2); + } else { + map4[key] = values2 = [value2]; + } + return values2; + } + function isSimpleCopiableExpression(expression) { + return ts2.isStringLiteralLike(expression) || expression.kind === 8 || ts2.isKeyword(expression.kind) || ts2.isIdentifier(expression); + } + ts2.isSimpleCopiableExpression = isSimpleCopiableExpression; + function isSimpleInlineableExpression(expression) { + return !ts2.isIdentifier(expression) && isSimpleCopiableExpression(expression); + } + ts2.isSimpleInlineableExpression = isSimpleInlineableExpression; + function isCompoundAssignment(kind) { + return kind >= 64 && kind <= 78; + } + ts2.isCompoundAssignment = isCompoundAssignment; + function getNonAssignmentOperatorForCompoundAssignment(kind) { + switch (kind) { + case 64: + return 39; + case 65: + return 40; + case 66: + return 41; + case 67: + return 42; + case 68: + return 43; + case 69: + return 44; + case 70: + return 47; + case 71: + return 48; + case 72: + return 49; + case 73: + return 50; + case 74: + return 51; + case 78: + return 52; + case 75: + return 56; + case 76: + return 55; + case 77: + return 60; + } + } + ts2.getNonAssignmentOperatorForCompoundAssignment = getNonAssignmentOperatorForCompoundAssignment; + function getSuperCallFromStatement(statement) { + if (!ts2.isExpressionStatement(statement)) { + return void 0; + } + var expression = ts2.skipParentheses(statement.expression); + return ts2.isSuperCall(expression) ? expression : void 0; + } + ts2.getSuperCallFromStatement = getSuperCallFromStatement; + function findSuperStatementIndex(statements, indexAfterLastPrologueStatement) { + for (var i7 = indexAfterLastPrologueStatement; i7 < statements.length; i7 += 1) { + var statement = statements[i7]; + if (getSuperCallFromStatement(statement)) { + return i7; + } + } + return -1; + } + ts2.findSuperStatementIndex = findSuperStatementIndex; + function getProperties(node, requireInitializer, isStatic) { + return ts2.filter(node.members, function(m7) { + return isInitializedOrStaticProperty(m7, requireInitializer, isStatic); + }); + } + ts2.getProperties = getProperties; + function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(element) { + return isStaticPropertyDeclaration(element) || ts2.isClassStaticBlockDeclaration(element); + } + function getStaticPropertiesAndClassStaticBlock(node) { + return ts2.filter(node.members, isStaticPropertyDeclarationOrClassStaticBlockDeclaration); + } + ts2.getStaticPropertiesAndClassStaticBlock = getStaticPropertiesAndClassStaticBlock; + function isInitializedOrStaticProperty(member, requireInitializer, isStatic) { + return ts2.isPropertyDeclaration(member) && (!!member.initializer || !requireInitializer) && ts2.hasStaticModifier(member) === isStatic; + } + function isStaticPropertyDeclaration(member) { + return ts2.isPropertyDeclaration(member) && ts2.hasStaticModifier(member); + } + function isInitializedProperty(member) { + return member.kind === 169 && member.initializer !== void 0; + } + ts2.isInitializedProperty = isInitializedProperty; + function isNonStaticMethodOrAccessorWithPrivateName(member) { + return !ts2.isStatic(member) && (ts2.isMethodOrAccessor(member) || ts2.isAutoAccessorPropertyDeclaration(member)) && ts2.isPrivateIdentifier(member.name); + } + ts2.isNonStaticMethodOrAccessorWithPrivateName = isNonStaticMethodOrAccessorWithPrivateName; + function getDecoratorsOfParameters(node) { + var decorators; + if (node) { + var parameters = node.parameters; + var firstParameterIsThis = parameters.length > 0 && ts2.parameterIsThisKeyword(parameters[0]); + var firstParameterOffset = firstParameterIsThis ? 1 : 0; + var numParameters = firstParameterIsThis ? parameters.length - 1 : parameters.length; + for (var i7 = 0; i7 < numParameters; i7++) { + var parameter = parameters[i7 + firstParameterOffset]; + if (decorators || ts2.hasDecorators(parameter)) { + if (!decorators) { + decorators = new Array(numParameters); + } + decorators[i7] = ts2.getDecorators(parameter); + } + } + } + return decorators; + } + function getAllDecoratorsOfClass(node) { + var decorators = ts2.getDecorators(node); + var parameters = getDecoratorsOfParameters(ts2.getFirstConstructorWithBody(node)); + if (!ts2.some(decorators) && !ts2.some(parameters)) { + return void 0; + } + return { + decorators, + parameters + }; + } + ts2.getAllDecoratorsOfClass = getAllDecoratorsOfClass; + function getAllDecoratorsOfClassElement(member, parent2) { + switch (member.kind) { + case 174: + case 175: + return getAllDecoratorsOfAccessors(member, parent2); + case 171: + return getAllDecoratorsOfMethod(member); + case 169: + return getAllDecoratorsOfProperty(member); + default: + return void 0; + } + } + ts2.getAllDecoratorsOfClassElement = getAllDecoratorsOfClassElement; + function getAllDecoratorsOfAccessors(accessor, parent2) { + if (!accessor.body) { + return void 0; + } + var _a2 = ts2.getAllAccessorDeclarations(parent2.members, accessor), firstAccessor = _a2.firstAccessor, secondAccessor = _a2.secondAccessor, getAccessor = _a2.getAccessor, setAccessor = _a2.setAccessor; + var firstAccessorWithDecorators = ts2.hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && ts2.hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { + return void 0; + } + var decorators = ts2.getDecorators(firstAccessorWithDecorators); + var parameters = getDecoratorsOfParameters(setAccessor); + if (!ts2.some(decorators) && !ts2.some(parameters)) { + return void 0; + } + return { + decorators, + parameters, + getDecorators: getAccessor && ts2.getDecorators(getAccessor), + setDecorators: setAccessor && ts2.getDecorators(setAccessor) + }; + } + function getAllDecoratorsOfMethod(method2) { + if (!method2.body) { + return void 0; + } + var decorators = ts2.getDecorators(method2); + var parameters = getDecoratorsOfParameters(method2); + if (!ts2.some(decorators) && !ts2.some(parameters)) { + return void 0; + } + return { decorators, parameters }; + } + function getAllDecoratorsOfProperty(property2) { + var decorators = ts2.getDecorators(property2); + if (!ts2.some(decorators)) { + return void 0; + } + return { decorators }; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var FlattenLevel; + (function(FlattenLevel2) { + FlattenLevel2[FlattenLevel2["All"] = 0] = "All"; + FlattenLevel2[FlattenLevel2["ObjectRest"] = 1] = "ObjectRest"; + })(FlattenLevel = ts2.FlattenLevel || (ts2.FlattenLevel = {})); + function flattenDestructuringAssignment(node, visitor, context2, level, needsValue, createAssignmentCallback) { + var location2 = node; + var value2; + if (ts2.isDestructuringAssignment(node)) { + value2 = node.right; + while (ts2.isEmptyArrayLiteral(node.left) || ts2.isEmptyObjectLiteral(node.left)) { + if (ts2.isDestructuringAssignment(value2)) { + location2 = node = value2; + value2 = node.right; + } else { + return ts2.visitNode(value2, visitor, ts2.isExpression); + } + } + } + var expressions; + var flattenContext = { + context: context2, + level, + downlevelIteration: !!context2.getCompilerOptions().downlevelIteration, + hoistTempVariables: true, + emitExpression, + emitBindingOrAssignment, + createArrayBindingOrAssignmentPattern: function(elements) { + return makeArrayAssignmentPattern(context2.factory, elements); + }, + createObjectBindingOrAssignmentPattern: function(elements) { + return makeObjectAssignmentPattern(context2.factory, elements); + }, + createArrayBindingOrAssignmentElement: makeAssignmentElement, + visitor + }; + if (value2) { + value2 = ts2.visitNode(value2, visitor, ts2.isExpression); + if (ts2.isIdentifier(value2) && bindingOrAssignmentElementAssignsToName(node, value2.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + false, + location2 + ); + } else if (needsValue) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + } else if (ts2.nodeIsSynthesized(node)) { + location2 = value2; + } + } + flattenBindingOrAssignmentElement( + flattenContext, + node, + value2, + location2, + /*skipInitializer*/ + ts2.isDestructuringAssignment(node) + ); + if (value2 && needsValue) { + if (!ts2.some(expressions)) { + return value2; + } + expressions.push(value2); + } + return context2.factory.inlineExpressions(expressions) || context2.factory.createOmittedExpression(); + function emitExpression(expression) { + expressions = ts2.append(expressions, expression); + } + function emitBindingOrAssignment(target, value3, location3, original) { + ts2.Debug.assertNode(target, createAssignmentCallback ? ts2.isIdentifier : ts2.isExpression); + var expression = createAssignmentCallback ? createAssignmentCallback(target, value3, location3) : ts2.setTextRange(context2.factory.createAssignment(ts2.visitNode(target, visitor, ts2.isExpression), value3), location3); + expression.original = original; + emitExpression(expression); + } + } + ts2.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts2.getTargetOfBindingOrAssignmentElement(element); + if (ts2.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } else if (ts2.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern5, escapedName) { + var elements = ts2.getElementsOfBindingOrAssignmentPattern(pattern5); + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var element = elements_4[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } + function bindingOrAssignmentElementContainsNonLiteralComputedName(element) { + var propertyName = ts2.tryGetPropertyNameOfBindingOrAssignmentElement(element); + if (propertyName && ts2.isComputedPropertyName(propertyName) && !ts2.isLiteralExpression(propertyName.expression)) { + return true; + } + var target = ts2.getTargetOfBindingOrAssignmentElement(element); + return !!target && ts2.isBindingOrAssignmentPattern(target) && bindingOrAssignmentPatternContainsNonLiteralComputedName(target); + } + function bindingOrAssignmentPatternContainsNonLiteralComputedName(pattern5) { + return !!ts2.forEach(ts2.getElementsOfBindingOrAssignmentPattern(pattern5), bindingOrAssignmentElementContainsNonLiteralComputedName); + } + function flattenDestructuringBinding(node, visitor, context2, level, rval, hoistTempVariables, skipInitializer) { + if (hoistTempVariables === void 0) { + hoistTempVariables = false; + } + var pendingExpressions; + var pendingDeclarations = []; + var declarations = []; + var flattenContext = { + context: context2, + level, + downlevelIteration: !!context2.getCompilerOptions().downlevelIteration, + hoistTempVariables, + emitExpression, + emitBindingOrAssignment, + createArrayBindingOrAssignmentPattern: function(elements) { + return makeArrayBindingPattern(context2.factory, elements); + }, + createObjectBindingOrAssignmentPattern: function(elements) { + return makeObjectBindingPattern(context2.factory, elements); + }, + createArrayBindingOrAssignmentElement: function(name3) { + return makeBindingElement(context2.factory, name3); + }, + visitor + }; + if (ts2.isVariableDeclaration(node)) { + var initializer = ts2.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && (ts2.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { + initializer = ensureIdentifier( + flattenContext, + ts2.visitNode(initializer, flattenContext.visitor), + /*reuseIdentifierExpressions*/ + false, + initializer + ); + node = context2.factory.updateVariableDeclaration( + node, + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + } + flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); + if (pendingExpressions) { + var temp = context2.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (hoistTempVariables) { + var value2 = context2.factory.inlineExpressions(pendingExpressions); + pendingExpressions = void 0; + emitBindingOrAssignment( + temp, + value2, + /*location*/ + void 0, + /*original*/ + void 0 + ); + } else { + context2.hoistVariableDeclaration(temp); + var pendingDeclaration = ts2.last(pendingDeclarations); + pendingDeclaration.pendingExpressions = ts2.append(pendingDeclaration.pendingExpressions, context2.factory.createAssignment(temp, pendingDeclaration.value)); + ts2.addRange(pendingDeclaration.pendingExpressions, pendingExpressions); + pendingDeclaration.value = temp; + } + } + for (var _i = 0, pendingDeclarations_1 = pendingDeclarations; _i < pendingDeclarations_1.length; _i++) { + var _a2 = pendingDeclarations_1[_i], pendingExpressions_1 = _a2.pendingExpressions, name2 = _a2.name, value2 = _a2.value, location2 = _a2.location, original = _a2.original; + var variable = context2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + pendingExpressions_1 ? context2.factory.inlineExpressions(ts2.append(pendingExpressions_1, value2)) : value2 + ); + variable.original = original; + ts2.setTextRange(variable, location2); + declarations.push(variable); + } + return declarations; + function emitExpression(value3) { + pendingExpressions = ts2.append(pendingExpressions, value3); + } + function emitBindingOrAssignment(target, value3, location3, original2) { + ts2.Debug.assertNode(target, ts2.isBindingName); + if (pendingExpressions) { + value3 = context2.factory.inlineExpressions(ts2.append(pendingExpressions, value3)); + pendingExpressions = void 0; + } + pendingDeclarations.push({ pendingExpressions, name: target, value: value3, location: location3, original: original2 }); + } + } + ts2.flattenDestructuringBinding = flattenDestructuringBinding; + function flattenBindingOrAssignmentElement(flattenContext, element, value2, location2, skipInitializer) { + var bindingTarget = ts2.getTargetOfBindingOrAssignmentElement(element); + if (!skipInitializer) { + var initializer = ts2.visitNode(ts2.getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, ts2.isExpression); + if (initializer) { + if (value2) { + value2 = createDefaultValueCheck(flattenContext, value2, initializer, location2); + if (!ts2.isSimpleInlineableExpression(initializer) && ts2.isBindingOrAssignmentPattern(bindingTarget)) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + } + } else { + value2 = initializer; + } + } else if (!value2) { + value2 = flattenContext.context.factory.createVoidZero(); + } + } + if (ts2.isObjectBindingOrAssignmentPattern(bindingTarget)) { + flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value2, location2); + } else if (ts2.isArrayBindingOrAssignmentPattern(bindingTarget)) { + flattenArrayBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value2, location2); + } else { + flattenContext.emitBindingOrAssignment( + bindingTarget, + value2, + location2, + /*original*/ + element + ); + } + } + function flattenObjectBindingOrAssignmentPattern(flattenContext, parent2, pattern5, value2, location2) { + var elements = ts2.getElementsOfBindingOrAssignmentPattern(pattern5); + var numElements = elements.length; + if (numElements !== 1) { + var reuseIdentifierExpressions = !ts2.isDeclarationBindingElement(parent2) || numElements !== 0; + value2 = ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2); + } + var bindingElements; + var computedTempVariables; + for (var i7 = 0; i7 < numElements; i7++) { + var element = elements[i7]; + if (!ts2.getRestIndicatorOfBindingOrAssignmentElement(element)) { + var propertyName = ts2.getPropertyNameOfBindingOrAssignmentElement(element); + if (flattenContext.level >= 1 && !(element.transformFlags & (32768 | 65536)) && !(ts2.getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 | 65536)) && !ts2.isComputedPropertyName(propertyName)) { + bindingElements = ts2.append(bindingElements, ts2.visitNode(element, flattenContext.visitor)); + } else { + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + bindingElements = void 0; + } + var rhsValue = createDestructuringPropertyAccess(flattenContext, value2, propertyName); + if (ts2.isComputedPropertyName(propertyName)) { + computedTempVariables = ts2.append(computedTempVariables, rhsValue.argumentExpression); + } + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } + } else if (i7 === numElements - 1) { + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + bindingElements = void 0; + } + var rhsValue = flattenContext.context.getEmitHelperFactory().createRestHelper(value2, elements, computedTempVariables, pattern5); + flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, element); + } + } + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + } + } + function flattenArrayBindingOrAssignmentPattern(flattenContext, parent2, pattern5, value2, location2) { + var elements = ts2.getElementsOfBindingOrAssignmentPattern(pattern5); + var numElements = elements.length; + if (flattenContext.level < 1 && flattenContext.downlevelIteration) { + value2 = ensureIdentifier( + flattenContext, + ts2.setTextRange(flattenContext.context.getEmitHelperFactory().createReadHelper(value2, numElements > 0 && ts2.getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) ? void 0 : numElements), location2), + /*reuseIdentifierExpressions*/ + false, + location2 + ); + } else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0) || ts2.every(elements, ts2.isOmittedExpression)) { + var reuseIdentifierExpressions = !ts2.isDeclarationBindingElement(parent2) || numElements !== 0; + value2 = ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2); + } + var bindingElements; + var restContainingElements; + for (var i7 = 0; i7 < numElements; i7++) { + var element = elements[i7]; + if (flattenContext.level >= 1) { + if (element.transformFlags & 65536 || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { + flattenContext.hasTransformedPriorElement = true; + var temp = flattenContext.context.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (flattenContext.hoistTempVariables) { + flattenContext.context.hoistVariableDeclaration(temp); + } + restContainingElements = ts2.append(restContainingElements, [temp, element]); + bindingElements = ts2.append(bindingElements, flattenContext.createArrayBindingOrAssignmentElement(temp)); + } else { + bindingElements = ts2.append(bindingElements, element); + } + } else if (ts2.isOmittedExpression(element)) { + continue; + } else if (!ts2.getRestIndicatorOfBindingOrAssignmentElement(element)) { + var rhsValue = flattenContext.context.factory.createElementAccessExpression(value2, i7); + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } else if (i7 === numElements - 1) { + var rhsValue = flattenContext.context.factory.createArraySliceCall(value2, i7); + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } + } + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createArrayBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + } + if (restContainingElements) { + for (var _i = 0, restContainingElements_1 = restContainingElements; _i < restContainingElements_1.length; _i++) { + var _a2 = restContainingElements_1[_i], id = _a2[0], element = _a2[1]; + flattenBindingOrAssignmentElement(flattenContext, element, id, element); + } + } + } + function isSimpleBindingOrAssignmentElement(element) { + var target = ts2.getTargetOfBindingOrAssignmentElement(element); + if (!target || ts2.isOmittedExpression(target)) + return true; + var propertyName = ts2.tryGetPropertyNameOfBindingOrAssignmentElement(element); + if (propertyName && !ts2.isPropertyNameLiteral(propertyName)) + return false; + var initializer = ts2.getInitializerOfBindingOrAssignmentElement(element); + if (initializer && !ts2.isSimpleInlineableExpression(initializer)) + return false; + if (ts2.isBindingOrAssignmentPattern(target)) + return ts2.every(ts2.getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); + return ts2.isIdentifier(target); + } + function createDefaultValueCheck(flattenContext, value2, defaultValue, location2) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + return flattenContext.context.factory.createConditionalExpression( + flattenContext.context.factory.createTypeCheck(value2, "undefined"), + /*questionToken*/ + void 0, + defaultValue, + /*colonToken*/ + void 0, + value2 + ); + } + function createDestructuringPropertyAccess(flattenContext, value2, propertyName) { + if (ts2.isComputedPropertyName(propertyName)) { + var argumentExpression = ensureIdentifier( + flattenContext, + ts2.visitNode(propertyName.expression, flattenContext.visitor), + /*reuseIdentifierExpressions*/ + false, + /*location*/ + propertyName + ); + return flattenContext.context.factory.createElementAccessExpression(value2, argumentExpression); + } else if (ts2.isStringOrNumericLiteralLike(propertyName)) { + var argumentExpression = ts2.factory.cloneNode(propertyName); + return flattenContext.context.factory.createElementAccessExpression(value2, argumentExpression); + } else { + var name2 = flattenContext.context.factory.createIdentifier(ts2.idText(propertyName)); + return flattenContext.context.factory.createPropertyAccessExpression(value2, name2); + } + } + function ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2) { + if (ts2.isIdentifier(value2) && reuseIdentifierExpressions) { + return value2; + } else { + var temp = flattenContext.context.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (flattenContext.hoistTempVariables) { + flattenContext.context.hoistVariableDeclaration(temp); + flattenContext.emitExpression(ts2.setTextRange(flattenContext.context.factory.createAssignment(temp, value2), location2)); + } else { + flattenContext.emitBindingOrAssignment( + temp, + value2, + location2, + /*original*/ + void 0 + ); + } + return temp; + } + } + function makeArrayBindingPattern(factory, elements) { + ts2.Debug.assertEachNode(elements, ts2.isArrayBindingElement); + return factory.createArrayBindingPattern(elements); + } + function makeArrayAssignmentPattern(factory, elements) { + return factory.createArrayLiteralExpression(ts2.map(elements, factory.converters.convertToArrayAssignmentElement)); + } + function makeObjectBindingPattern(factory, elements) { + ts2.Debug.assertEachNode(elements, ts2.isBindingElement); + return factory.createObjectBindingPattern(elements); + } + function makeObjectAssignmentPattern(factory, elements) { + return factory.createObjectLiteralExpression(ts2.map(elements, factory.converters.convertToObjectAssignmentElement)); + } + function makeBindingElement(factory, name2) { + return factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + name2 + ); + } + function makeAssignmentElement(name2) { + return name2; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ProcessLevel; + (function(ProcessLevel2) { + ProcessLevel2[ProcessLevel2["LiftRestriction"] = 0] = "LiftRestriction"; + ProcessLevel2[ProcessLevel2["All"] = 1] = "All"; + })(ProcessLevel = ts2.ProcessLevel || (ts2.ProcessLevel = {})); + function processTaggedTemplateExpression(context2, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { + var tag = ts2.visitNode(node.tag, visitor, ts2.isExpression); + var templateArguments = [void 0]; + var cookedStrings = []; + var rawStrings = []; + var template2 = node.template; + if (level === ProcessLevel.LiftRestriction && !ts2.hasInvalidEscape(template2)) { + return ts2.visitEachChild(node, visitor, context2); + } + if (ts2.isNoSubstitutionTemplateLiteral(template2)) { + cookedStrings.push(createTemplateCooked(template2)); + rawStrings.push(getRawLiteral(template2, currentSourceFile)); + } else { + cookedStrings.push(createTemplateCooked(template2.head)); + rawStrings.push(getRawLiteral(template2.head, currentSourceFile)); + for (var _i = 0, _a2 = template2.templateSpans; _i < _a2.length; _i++) { + var templateSpan = _a2[_i]; + cookedStrings.push(createTemplateCooked(templateSpan.literal)); + rawStrings.push(getRawLiteral(templateSpan.literal, currentSourceFile)); + templateArguments.push(ts2.visitNode(templateSpan.expression, visitor, ts2.isExpression)); + } + } + var helperCall = context2.getEmitHelperFactory().createTemplateObjectHelper(ts2.factory.createArrayLiteralExpression(cookedStrings), ts2.factory.createArrayLiteralExpression(rawStrings)); + if (ts2.isExternalModule(currentSourceFile)) { + var tempVar = ts2.factory.createUniqueName("templateObject"); + recordTaggedTemplateString(tempVar); + templateArguments[0] = ts2.factory.createLogicalOr(tempVar, ts2.factory.createAssignment(tempVar, helperCall)); + } else { + templateArguments[0] = helperCall; + } + return ts2.factory.createCallExpression( + tag, + /*typeArguments*/ + void 0, + templateArguments + ); + } + ts2.processTaggedTemplateExpression = processTaggedTemplateExpression; + function createTemplateCooked(template2) { + return template2.templateFlags ? ts2.factory.createVoidZero() : ts2.factory.createStringLiteral(template2.text); + } + function getRawLiteral(node, currentSourceFile) { + var text = node.rawText; + if (text === void 0) { + ts2.Debug.assertIsDefined(currentSourceFile, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."); + text = ts2.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + var isLast = node.kind === 14 || node.kind === 17; + text = text.substring(1, text.length - (isLast ? 1 : 2)); + } + text = text.replace(/\r\n?/g, "\n"); + return ts2.setTextRange(ts2.factory.createStringLiteral(text), node); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var USE_NEW_TYPE_METADATA_FORMAT = false; + var TypeScriptSubstitutionFlags; + (function(TypeScriptSubstitutionFlags2) { + TypeScriptSubstitutionFlags2[TypeScriptSubstitutionFlags2["NamespaceExports"] = 2] = "NamespaceExports"; + TypeScriptSubstitutionFlags2[TypeScriptSubstitutionFlags2["NonQualifiedEnumMembers"] = 8] = "NonQualifiedEnumMembers"; + })(TypeScriptSubstitutionFlags || (TypeScriptSubstitutionFlags = {})); + var ClassFacts; + (function(ClassFacts2) { + ClassFacts2[ClassFacts2["None"] = 0] = "None"; + ClassFacts2[ClassFacts2["HasStaticInitializedProperties"] = 1] = "HasStaticInitializedProperties"; + ClassFacts2[ClassFacts2["HasConstructorDecorators"] = 2] = "HasConstructorDecorators"; + ClassFacts2[ClassFacts2["HasMemberDecorators"] = 4] = "HasMemberDecorators"; + ClassFacts2[ClassFacts2["IsExportOfNamespace"] = 8] = "IsExportOfNamespace"; + ClassFacts2[ClassFacts2["IsNamedExternalExport"] = 16] = "IsNamedExternalExport"; + ClassFacts2[ClassFacts2["IsDefaultExternalExport"] = 32] = "IsDefaultExternalExport"; + ClassFacts2[ClassFacts2["IsDerivedClass"] = 64] = "IsDerivedClass"; + ClassFacts2[ClassFacts2["UseImmediatelyInvokedFunctionExpression"] = 128] = "UseImmediatelyInvokedFunctionExpression"; + ClassFacts2[ClassFacts2["HasAnyDecorators"] = 6] = "HasAnyDecorators"; + ClassFacts2[ClassFacts2["NeedsName"] = 5] = "NeedsName"; + ClassFacts2[ClassFacts2["MayNeedImmediatelyInvokedFunctionExpression"] = 7] = "MayNeedImmediatelyInvokedFunctionExpression"; + ClassFacts2[ClassFacts2["IsExported"] = 56] = "IsExported"; + })(ClassFacts || (ClassFacts = {})); + function transformTypeScript(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, startLexicalEnvironment = context2.startLexicalEnvironment, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var typeSerializer = compilerOptions.emitDecoratorMetadata ? ts2.createRuntimeTypeSerializer(context2) : void 0; + var previousOnEmitNode = context2.onEmitNode; + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableSubstitution( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + context2.enableSubstitution( + 209 + /* SyntaxKind.ElementAccessExpression */ + ); + var currentSourceFile; + var currentNamespace; + var currentNamespaceContainerName; + var currentLexicalScope; + var currentScopeFirstDeclarationsOfName; + var currentClassHasParameterProperties; + var enabledSubstitutions; + var applicableSubstitutions; + return transformSourceFileOrBundle; + function transformSourceFileOrBundle(node) { + if (node.kind === 309) { + return transformBundle(node); + } + return transformSourceFile(node); + } + function transformBundle(node) { + return factory.createBundle(node.sourceFiles.map(transformSourceFile), ts2.mapDefined(node.prepends, function(prepend) { + if (prepend.kind === 311) { + return ts2.createUnparsedSourceFile(prepend, "js"); + } + return prepend; + })); + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + var visited = saveStateAndInvoke(node, visitSourceFile); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + return visited; + } + function saveStateAndInvoke(node, f8) { + var savedCurrentScope = currentLexicalScope; + var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; + var savedCurrentClassHasParameterProperties = currentClassHasParameterProperties; + onBeforeVisitNode(node); + var visited = f8(node); + if (currentLexicalScope !== savedCurrentScope) { + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + } + currentLexicalScope = savedCurrentScope; + currentClassHasParameterProperties = savedCurrentClassHasParameterProperties; + return visited; + } + function onBeforeVisitNode(node) { + switch (node.kind) { + case 308: + case 266: + case 265: + case 238: + currentLexicalScope = node; + currentScopeFirstDeclarationsOfName = void 0; + break; + case 260: + case 259: + if (ts2.hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + )) { + break; + } + if (node.name) { + recordEmittedDeclarationInScope(node); + } else { + ts2.Debug.assert(node.kind === 260 || ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + )); + } + break; + } + } + function visitor(node) { + return saveStateAndInvoke(node, visitorWorker); + } + function visitorWorker(node) { + if (node.transformFlags & 1) { + return visitTypeScript(node); + } + return node; + } + function sourceElementVisitor(node) { + return saveStateAndInvoke(node, sourceElementVisitorWorker); + } + function sourceElementVisitorWorker(node) { + switch (node.kind) { + case 269: + case 268: + case 274: + case 275: + return visitElidableStatement(node); + default: + return visitorWorker(node); + } + } + function visitElidableStatement(node) { + var parsed = ts2.getParseTreeNode(node); + if (parsed !== node) { + if (node.transformFlags & 1) { + return ts2.visitEachChild(node, visitor, context2); + } + return node; + } + switch (node.kind) { + case 269: + return visitImportDeclaration(node); + case 268: + return visitImportEqualsDeclaration(node); + case 274: + return visitExportAssignment(node); + case 275: + return visitExportDeclaration(node); + default: + ts2.Debug.fail("Unhandled ellided statement"); + } + } + function namespaceElementVisitor(node) { + return saveStateAndInvoke(node, namespaceElementVisitorWorker); + } + function namespaceElementVisitorWorker(node) { + if (node.kind === 275 || node.kind === 269 || node.kind === 270 || node.kind === 268 && node.moduleReference.kind === 280) { + return void 0; + } else if (node.transformFlags & 1 || ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + return visitTypeScript(node); + } + return node; + } + function getClassElementVisitor(parent2) { + return function(node) { + return saveStateAndInvoke(node, function(n7) { + return classElementVisitorWorker(n7, parent2); + }); + }; + } + function classElementVisitorWorker(node, parent2) { + switch (node.kind) { + case 173: + return visitConstructor(node); + case 169: + return visitPropertyDeclaration(node, parent2); + case 174: + return visitGetAccessor(node, parent2); + case 175: + return visitSetAccessor(node, parent2); + case 171: + return visitMethodDeclaration(node, parent2); + case 172: + return ts2.visitEachChild(node, visitor, context2); + case 237: + return node; + case 178: + return; + default: + return ts2.Debug.failBadSyntaxKind(node); + } + } + function getObjectLiteralElementVisitor(parent2) { + return function(node) { + return saveStateAndInvoke(node, function(n7) { + return objectLiteralElementVisitorWorker(n7, parent2); + }); + }; + } + function objectLiteralElementVisitorWorker(node, parent2) { + switch (node.kind) { + case 299: + case 300: + case 301: + return visitor(node); + case 174: + return visitGetAccessor(node, parent2); + case 175: + return visitSetAccessor(node, parent2); + case 171: + return visitMethodDeclaration(node, parent2); + default: + return ts2.Debug.failBadSyntaxKind(node); + } + } + function modifierVisitor(node) { + if (ts2.isDecorator(node)) + return void 0; + if (ts2.modifierToFlag(node.kind) & 117086) { + return void 0; + } else if (currentNamespace && node.kind === 93) { + return void 0; + } + return node; + } + function visitTypeScript(node) { + if (ts2.isStatement(node) && ts2.hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + )) { + return factory.createNotEmittedStatement(node); + } + switch (node.kind) { + case 93: + case 88: + return currentNamespace ? void 0 : node; + case 123: + case 121: + case 122: + case 126: + case 161: + case 85: + case 136: + case 146: + case 101: + case 145: + case 185: + case 186: + case 187: + case 188: + case 184: + case 179: + case 165: + case 131: + case 157: + case 134: + case 152: + case 148: + case 144: + case 114: + case 153: + case 182: + case 181: + case 183: + case 180: + case 189: + case 190: + case 191: + case 193: + case 194: + case 195: + case 196: + case 197: + case 198: + case 178: + return void 0; + case 262: + return factory.createNotEmittedStatement(node); + case 267: + return void 0; + case 261: + return factory.createNotEmittedStatement(node); + case 260: + return visitClassDeclaration(node); + case 228: + return visitClassExpression(node); + case 294: + return visitHeritageClause(node); + case 230: + return visitExpressionWithTypeArguments(node); + case 207: + return visitObjectLiteralExpression(node); + case 173: + case 169: + case 171: + case 174: + case 175: + case 172: + return ts2.Debug.fail("Class and object literal elements must be visited with their respective visitors"); + case 259: + return visitFunctionDeclaration(node); + case 215: + return visitFunctionExpression(node); + case 216: + return visitArrowFunction(node); + case 166: + return visitParameter(node); + case 214: + return visitParenthesizedExpression(node); + case 213: + case 231: + return visitAssertionExpression(node); + case 235: + return visitSatisfiesExpression(node); + case 210: + return visitCallExpression(node); + case 211: + return visitNewExpression(node); + case 212: + return visitTaggedTemplateExpression(node); + case 232: + return visitNonNullExpression(node); + case 263: + return visitEnumDeclaration(node); + case 240: + return visitVariableStatement(node); + case 257: + return visitVariableDeclaration(node); + case 264: + return visitModuleDeclaration(node); + case 268: + return visitImportEqualsDeclaration(node); + case 282: + return visitJsxSelfClosingElement(node); + case 283: + return visitJsxJsxOpeningElement(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitSourceFile(node) { + var alwaysStrict = ts2.getStrictOptionValue(compilerOptions, "alwaysStrict") && !(ts2.isExternalModule(node) && moduleKind >= ts2.ModuleKind.ES2015) && !ts2.isJsonSourceFile(node); + return factory.updateSourceFile(node, ts2.visitLexicalEnvironment( + node.statements, + sourceElementVisitor, + context2, + /*start*/ + 0, + alwaysStrict + )); + } + function visitObjectLiteralExpression(node) { + return factory.updateObjectLiteralExpression(node, ts2.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts2.isObjectLiteralElement)); + } + function getClassFacts(node, staticProperties) { + var facts = 0; + if (ts2.some(staticProperties)) + facts |= 1; + var extendsClauseElement = ts2.getEffectiveBaseTypeNode(node); + if (extendsClauseElement && ts2.skipOuterExpressions(extendsClauseElement.expression).kind !== 104) + facts |= 64; + if (ts2.classOrConstructorParameterIsDecorated(node)) + facts |= 2; + if (ts2.childIsDecorated(node)) + facts |= 4; + if (isExportOfNamespace(node)) + facts |= 8; + else if (isDefaultExternalModuleExport(node)) + facts |= 32; + else if (isNamedExternalModuleExport(node)) + facts |= 16; + if (languageVersion <= 1 && facts & 7) + facts |= 128; + return facts; + } + function hasTypeScriptClassSyntax(node) { + return !!(node.transformFlags & 8192); + } + function isClassLikeDeclarationWithTypeScriptSyntax(node) { + return ts2.hasDecorators(node) || ts2.some(node.typeParameters) || ts2.some(node.heritageClauses, hasTypeScriptClassSyntax) || ts2.some(node.members, hasTypeScriptClassSyntax); + } + function visitClassDeclaration(node) { + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !(currentNamespace && ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ))) { + return factory.updateClassDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.name, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause), + ts2.visitNodes(node.members, getClassElementVisitor(node), ts2.isClassElement) + ); + } + var staticProperties = ts2.getProperties( + node, + /*requireInitializer*/ + true, + /*isStatic*/ + true + ); + var facts = getClassFacts(node, staticProperties); + if (facts & 128) { + context2.startLexicalEnvironment(); + } + var name2 = node.name || (facts & 5 ? factory.getGeneratedNameForNode(node) : void 0); + var allDecorators = ts2.getAllDecoratorsOfClass(node); + var decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + var modifiers = !(facts & 128) ? ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier) : ts2.elideNodes(factory, node.modifiers); + var classStatement = factory.updateClassDeclaration( + node, + ts2.concatenate(decorators, modifiers), + name2, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause), + transformClassMembers(node) + ); + var emitFlags = ts2.getEmitFlags(node); + if (facts & 1) { + emitFlags |= 32; + } + ts2.setEmitFlags(classStatement, emitFlags); + var statements = [classStatement]; + if (facts & 128) { + var closingBraceLocation = ts2.createTokenRange( + ts2.skipTrivia(currentSourceFile.text, node.members.end), + 19 + /* SyntaxKind.CloseBraceToken */ + ); + var localName = factory.getInternalName(node); + var outer = factory.createPartiallyEmittedExpression(localName); + ts2.setTextRangeEnd(outer, closingBraceLocation.end); + ts2.setEmitFlags( + outer, + 1536 + /* EmitFlags.NoComments */ + ); + var statement = factory.createReturnStatement(outer); + ts2.setTextRangePos(statement, closingBraceLocation.pos); + ts2.setEmitFlags( + statement, + 1536 | 384 + /* EmitFlags.NoTokenSourceMaps */ + ); + statements.push(statement); + ts2.insertStatementsAfterStandardPrologue(statements, context2.endLexicalEnvironment()); + var iife = factory.createImmediatelyInvokedArrowFunction(statements); + ts2.setEmitFlags( + iife, + 33554432 + /* EmitFlags.TypeScriptClassWrapper */ + ); + var varStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + false + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ) + ]) + ); + ts2.setOriginalNode(varStatement, node); + ts2.setCommentRange(varStatement, node); + ts2.setSourceMapRange(varStatement, ts2.moveRangePastDecorators(node)); + ts2.startOnNewLine(varStatement); + statements = [varStatement]; + } + if (facts & 8) { + addExportMemberAssignment(statements, node); + } else if (facts & 128 || facts & 2) { + if (facts & 32) { + statements.push(factory.createExportDefault(factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ))); + } else if (facts & 16) { + statements.push(factory.createExternalModuleExport(factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ))); + } + } + if (statements.length > 1) { + statements.push(factory.createEndOfDeclarationMarker(node)); + ts2.setEmitFlags( + classStatement, + ts2.getEmitFlags(classStatement) | 4194304 + /* EmitFlags.HasEndOfDeclarationMarker */ + ); + } + return ts2.singleOrMany(statements); + } + function visitClassExpression(node) { + var allDecorators = ts2.getAllDecoratorsOfClass(node); + var decorators = transformAllDecoratorsOfDeclaration(node, node, allDecorators); + return factory.updateClassExpression( + node, + decorators, + node.name, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause), + isClassLikeDeclarationWithTypeScriptSyntax(node) ? transformClassMembers(node) : ts2.visitNodes(node.members, getClassElementVisitor(node), ts2.isClassElement) + ); + } + function transformClassMembers(node) { + var members = []; + var constructor = ts2.getFirstConstructorWithBody(node); + var parametersWithPropertyAssignments = constructor && ts2.filter(constructor.parameters, function(p7) { + return ts2.isParameterPropertyDeclaration(p7, constructor); + }); + if (parametersWithPropertyAssignments) { + for (var _i = 0, parametersWithPropertyAssignments_1 = parametersWithPropertyAssignments; _i < parametersWithPropertyAssignments_1.length; _i++) { + var parameter = parametersWithPropertyAssignments_1[_i]; + if (ts2.isIdentifier(parameter.name)) { + members.push(ts2.setOriginalNode(factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), parameter)); + } + } + } + ts2.addRange(members, ts2.visitNodes(node.members, getClassElementVisitor(node), ts2.isClassElement)); + return ts2.setTextRange( + factory.createNodeArray(members), + /*location*/ + node.members + ); + } + function transformAllDecoratorsOfDeclaration(node, container, allDecorators) { + var _a2, _b, _c, _d; + if (!allDecorators) { + return void 0; + } + var decorators = ts2.visitArray(allDecorators.decorators, visitor, ts2.isDecorator); + var parameterDecorators = ts2.flatMap(allDecorators.parameters, transformDecoratorsOfParameter); + var metadataDecorators = ts2.some(decorators) || ts2.some(parameterDecorators) ? getTypeMetadata(node, container) : void 0; + var result2 = factory.createNodeArray(ts2.concatenate(ts2.concatenate(decorators, parameterDecorators), metadataDecorators)); + var pos = (_b = (_a2 = ts2.firstOrUndefined(allDecorators.decorators)) === null || _a2 === void 0 ? void 0 : _a2.pos) !== null && _b !== void 0 ? _b : -1; + var end = (_d = (_c = ts2.lastOrUndefined(allDecorators.decorators)) === null || _c === void 0 ? void 0 : _c.end) !== null && _d !== void 0 ? _d : -1; + ts2.setTextRangePosEnd(result2, pos, end); + return result2; + } + function transformDecoratorsOfParameter(parameterDecorators, parameterOffset) { + if (parameterDecorators) { + var decorators = []; + for (var _i = 0, parameterDecorators_1 = parameterDecorators; _i < parameterDecorators_1.length; _i++) { + var parameterDecorator = parameterDecorators_1[_i]; + var expression = ts2.visitNode(parameterDecorator.expression, visitor, ts2.isExpression); + var helper = emitHelpers().createParamHelper(expression, parameterOffset); + ts2.setTextRange(helper, parameterDecorator.expression); + ts2.setEmitFlags( + helper, + 1536 + /* EmitFlags.NoComments */ + ); + var decorator = factory.createDecorator(helper); + ts2.setSourceMapRange(decorator, parameterDecorator.expression); + ts2.setCommentRange(decorator, parameterDecorator.expression); + ts2.setEmitFlags( + decorator, + 1536 + /* EmitFlags.NoComments */ + ); + decorators.push(decorator); + } + return decorators; + } + } + function getTypeMetadata(node, container) { + return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); + } + function getOldTypeMetadata(node, container) { + if (typeSerializer) { + var decorators = void 0; + if (shouldAddTypeMetadata(node)) { + var typeMetadata = emitHelpers().createMetadataHelper("design:type", typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node)); + decorators = ts2.append(decorators, factory.createDecorator(typeMetadata)); + } + if (shouldAddParamTypesMetadata(node)) { + var paramTypesMetadata = emitHelpers().createMetadataHelper("design:paramtypes", typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container)); + decorators = ts2.append(decorators, factory.createDecorator(paramTypesMetadata)); + } + if (shouldAddReturnTypeMetadata(node)) { + var returnTypeMetadata = emitHelpers().createMetadataHelper("design:returntype", typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node)); + decorators = ts2.append(decorators, factory.createDecorator(returnTypeMetadata)); + } + return decorators; + } + } + function getNewTypeMetadata(node, container) { + if (typeSerializer) { + var properties = void 0; + if (shouldAddTypeMetadata(node)) { + var typeProperty = factory.createPropertyAssignment("type", factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory.createToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ), + typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node) + )); + properties = ts2.append(properties, typeProperty); + } + if (shouldAddParamTypesMetadata(node)) { + var paramTypeProperty = factory.createPropertyAssignment("paramTypes", factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory.createToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ), + typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container) + )); + properties = ts2.append(properties, paramTypeProperty); + } + if (shouldAddReturnTypeMetadata(node)) { + var returnTypeProperty = factory.createPropertyAssignment("returnType", factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory.createToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ), + typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node) + )); + properties = ts2.append(properties, returnTypeProperty); + } + if (properties) { + var typeInfoMetadata = emitHelpers().createMetadataHelper("design:typeinfo", factory.createObjectLiteralExpression( + properties, + /*multiLine*/ + true + )); + return [factory.createDecorator(typeInfoMetadata)]; + } + } + } + function shouldAddTypeMetadata(node) { + var kind = node.kind; + return kind === 171 || kind === 174 || kind === 175 || kind === 169; + } + function shouldAddReturnTypeMetadata(node) { + return node.kind === 171; + } + function shouldAddParamTypesMetadata(node) { + switch (node.kind) { + case 260: + case 228: + return ts2.getFirstConstructorWithBody(node) !== void 0; + case 171: + case 174: + case 175: + return true; + } + return false; + } + function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { + var name2 = member.name; + if (ts2.isPrivateIdentifier(name2)) { + return factory.createIdentifier(""); + } else if (ts2.isComputedPropertyName(name2)) { + return generateNameForComputedPropertyName && !ts2.isSimpleInlineableExpression(name2.expression) ? factory.getGeneratedNameForNode(name2) : name2.expression; + } else if (ts2.isIdentifier(name2)) { + return factory.createStringLiteral(ts2.idText(name2)); + } else { + return factory.cloneNode(name2); + } + } + function visitPropertyNameOfClassElement(member) { + var name2 = member.name; + if (ts2.isComputedPropertyName(name2) && (!ts2.hasStaticModifier(member) && currentClassHasParameterProperties || ts2.hasDecorators(member))) { + var expression = ts2.visitNode(name2.expression, visitor, ts2.isExpression); + var innerExpression = ts2.skipPartiallyEmittedExpressions(expression); + if (!ts2.isSimpleInlineableExpression(innerExpression)) { + var generatedName = factory.getGeneratedNameForNode(name2); + hoistVariableDeclaration(generatedName); + return factory.updateComputedPropertyName(name2, factory.createAssignment(generatedName, expression)); + } + } + return ts2.visitNode(name2, visitor, ts2.isPropertyName); + } + function visitHeritageClause(node) { + if (node.token === 117) { + return void 0; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitExpressionWithTypeArguments(node) { + return factory.updateExpressionWithTypeArguments( + node, + ts2.visitNode(node.expression, visitor, ts2.isLeftHandSideExpression), + /*typeArguments*/ + void 0 + ); + } + function shouldEmitFunctionLikeDeclaration(node) { + return !ts2.nodeIsMissing(node.body); + } + function visitPropertyDeclaration(node, parent2) { + var isAmbient = node.flags & 16777216 || ts2.hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + ); + if (isAmbient && !ts2.hasDecorators(node)) { + return void 0; + } + var allDecorators = ts2.getAllDecoratorsOfClassElement(node, parent2); + var decorators = transformAllDecoratorsOfDeclaration(node, parent2, allDecorators); + if (isAmbient) { + return factory.updatePropertyDeclaration( + node, + ts2.concatenate(decorators, factory.createModifiersFromModifierFlags( + 2 + /* ModifierFlags.Ambient */ + )), + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + return factory.updatePropertyDeclaration( + node, + ts2.concatenate(decorators, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike)), + visitPropertyNameOfClassElement(node), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor) + ); + } + function visitConstructor(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return void 0; + } + return factory.updateConstructorDeclaration( + node, + /*modifiers*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + transformConstructorBody(node.body, node) + ); + } + function transformConstructorBody(body, constructor) { + var parametersWithPropertyAssignments = constructor && ts2.filter(constructor.parameters, function(p7) { + return ts2.isParameterPropertyDeclaration(p7, constructor); + }); + if (!ts2.some(parametersWithPropertyAssignments)) { + return ts2.visitFunctionBody(body, visitor, context2); + } + var statements = []; + resumeLexicalEnvironment(); + var prologueStatementCount = factory.copyPrologue( + body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + var superStatementIndex = ts2.findSuperStatementIndex(body.statements, prologueStatementCount); + if (superStatementIndex >= 0) { + ts2.addRange(statements, ts2.visitNodes(body.statements, visitor, ts2.isStatement, prologueStatementCount, superStatementIndex + 1 - prologueStatementCount)); + } + var parameterPropertyAssignments = ts2.mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment); + if (superStatementIndex >= 0) { + ts2.addRange(statements, parameterPropertyAssignments); + } else { + statements = __spreadArray9(__spreadArray9(__spreadArray9([], statements.slice(0, prologueStatementCount), true), parameterPropertyAssignments, true), statements.slice(prologueStatementCount), true); + } + var start = superStatementIndex >= 0 ? superStatementIndex + 1 : prologueStatementCount; + ts2.addRange(statements, ts2.visitNodes(body.statements, visitor, ts2.isStatement, start)); + statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + var block = factory.createBlock( + ts2.setTextRange(factory.createNodeArray(statements), body.statements), + /*multiLine*/ + true + ); + ts2.setTextRange( + block, + /*location*/ + body + ); + ts2.setOriginalNode(block, body); + return block; + } + function transformParameterWithPropertyAssignment(node) { + var name2 = node.name; + if (!ts2.isIdentifier(name2)) { + return void 0; + } + var propertyName = ts2.setParent(ts2.setTextRange(factory.cloneNode(name2), name2), name2.parent); + ts2.setEmitFlags( + propertyName, + 1536 | 48 + /* EmitFlags.NoSourceMap */ + ); + var localName = ts2.setParent(ts2.setTextRange(factory.cloneNode(name2), name2), name2.parent); + ts2.setEmitFlags( + localName, + 1536 + /* EmitFlags.NoComments */ + ); + return ts2.startOnNewLine(ts2.removeAllComments(ts2.setTextRange(ts2.setOriginalNode(factory.createExpressionStatement(factory.createAssignment(ts2.setTextRange(factory.createPropertyAccessExpression(factory.createThis(), propertyName), node.name), localName)), node), ts2.moveRangePos(node, -1)))); + } + function visitMethodDeclaration(node, parent2) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitFunctionLikeDeclaration(node)) { + return void 0; + } + var allDecorators = ts2.isClassLike(parent2) ? ts2.getAllDecoratorsOfClassElement(node, parent2) : void 0; + var decorators = ts2.isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, allDecorators) : void 0; + return factory.updateMethodDeclaration( + node, + ts2.concatenate(decorators, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike)), + node.asteriskToken, + visitPropertyNameOfClassElement(node), + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.visitFunctionBody(node.body, visitor, context2) + ); + } + function shouldEmitAccessorDeclaration(node) { + return !(ts2.nodeIsMissing(node.body) && ts2.hasSyntacticModifier( + node, + 256 + /* ModifierFlags.Abstract */ + )); + } + function visitGetAccessor(node, parent2) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitAccessorDeclaration(node)) { + return void 0; + } + var decorators = ts2.isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, ts2.getAllDecoratorsOfClassElement(node, parent2)) : void 0; + return factory.updateGetAccessorDeclaration( + node, + ts2.concatenate(decorators, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike)), + visitPropertyNameOfClassElement(node), + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.visitFunctionBody(node.body, visitor, context2) || factory.createBlock([]) + ); + } + function visitSetAccessor(node, parent2) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitAccessorDeclaration(node)) { + return void 0; + } + var decorators = ts2.isClassLike(parent2) ? transformAllDecoratorsOfDeclaration(node, parent2, ts2.getAllDecoratorsOfClassElement(node, parent2)) : void 0; + return factory.updateSetAccessorDeclaration(node, ts2.concatenate(decorators, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike)), visitPropertyNameOfClassElement(node), ts2.visitParameterList(node.parameters, visitor, context2), ts2.visitFunctionBody(node.body, visitor, context2) || factory.createBlock([])); + } + function visitFunctionDeclaration(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return factory.createNotEmittedStatement(node); + } + var updated = factory.updateFunctionDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.visitFunctionBody(node.body, visitor, context2) || factory.createBlock([]) + ); + if (isExportOfNamespace(node)) { + var statements = [updated]; + addExportMemberAssignment(statements, node); + return statements; + } + return updated; + } + function visitFunctionExpression(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return factory.createOmittedExpression(); + } + var updated = factory.updateFunctionExpression( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.visitFunctionBody(node.body, visitor, context2) || factory.createBlock([]) + ); + return updated; + } + function visitArrowFunction(node) { + var updated = factory.updateArrowFunction( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + ts2.visitFunctionBody(node.body, visitor, context2) + ); + return updated; + } + function visitParameter(node) { + if (ts2.parameterIsThisKeyword(node)) { + return void 0; + } + var updated = factory.updateParameterDeclaration( + node, + ts2.elideNodes(factory, node.modifiers), + // preserve positions, if available + node.dotDotDotToken, + ts2.visitNode(node.name, visitor, ts2.isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isExpression) + ); + if (updated !== node) { + ts2.setCommentRange(updated, node); + ts2.setTextRange(updated, ts2.moveRangePastModifiers(node)); + ts2.setSourceMapRange(updated, ts2.moveRangePastModifiers(node)); + ts2.setEmitFlags( + updated.name, + 32 + /* EmitFlags.NoTrailingSourceMap */ + ); + } + return updated; + } + function visitVariableStatement(node) { + if (isExportOfNamespace(node)) { + var variables = ts2.getInitializedVariables(node.declarationList); + if (variables.length === 0) { + return void 0; + } + return ts2.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(ts2.map(variables, transformInitializedVariable))), node); + } else { + return ts2.visitEachChild(node, visitor, context2); + } + } + function transformInitializedVariable(node) { + var name2 = node.name; + if (ts2.isBindingPattern(name2)) { + return ts2.flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + /*needsValue*/ + false, + createNamespaceExportExpression + ); + } else { + return ts2.setTextRange( + factory.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(name2), ts2.visitNode(node.initializer, visitor, ts2.isExpression)), + /*location*/ + node + ); + } + } + function visitVariableDeclaration(node) { + var updated = factory.updateVariableDeclaration( + node, + ts2.visitNode(node.name, visitor, ts2.isBindingName), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isExpression) + ); + if (node.type) { + ts2.setTypeNode(updated.name, node.type); + } + return updated; + } + function visitParenthesizedExpression(node) { + var innerExpression = ts2.skipOuterExpressions( + node.expression, + ~6 + /* OuterExpressionKinds.Assertions */ + ); + if (ts2.isAssertionExpression(innerExpression)) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + return factory.createPartiallyEmittedExpression(expression, node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitAssertionExpression(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + return factory.createPartiallyEmittedExpression(expression, node); + } + function visitNonNullExpression(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isLeftHandSideExpression); + return factory.createPartiallyEmittedExpression(expression, node); + } + function visitSatisfiesExpression(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + return factory.createPartiallyEmittedExpression(expression, node); + } + function visitCallExpression(node) { + return factory.updateCallExpression( + node, + ts2.visitNode(node.expression, visitor, ts2.isExpression), + /*typeArguments*/ + void 0, + ts2.visitNodes(node.arguments, visitor, ts2.isExpression) + ); + } + function visitNewExpression(node) { + return factory.updateNewExpression( + node, + ts2.visitNode(node.expression, visitor, ts2.isExpression), + /*typeArguments*/ + void 0, + ts2.visitNodes(node.arguments, visitor, ts2.isExpression) + ); + } + function visitTaggedTemplateExpression(node) { + return factory.updateTaggedTemplateExpression( + node, + ts2.visitNode(node.tag, visitor, ts2.isExpression), + /*typeArguments*/ + void 0, + ts2.visitNode(node.template, visitor, ts2.isExpression) + ); + } + function visitJsxSelfClosingElement(node) { + return factory.updateJsxSelfClosingElement( + node, + ts2.visitNode(node.tagName, visitor, ts2.isJsxTagNameExpression), + /*typeArguments*/ + void 0, + ts2.visitNode(node.attributes, visitor, ts2.isJsxAttributes) + ); + } + function visitJsxJsxOpeningElement(node) { + return factory.updateJsxOpeningElement( + node, + ts2.visitNode(node.tagName, visitor, ts2.isJsxTagNameExpression), + /*typeArguments*/ + void 0, + ts2.visitNode(node.attributes, visitor, ts2.isJsxAttributes) + ); + } + function shouldEmitEnumDeclaration(node) { + return !ts2.isEnumConst(node) || ts2.shouldPreserveConstEnums(compilerOptions); + } + function visitEnumDeclaration(node) { + if (!shouldEmitEnumDeclaration(node)) { + return factory.createNotEmittedStatement(node); + } + var statements = []; + var emitFlags = 2; + var varAdded = addVarForEnumOrModuleDeclaration(statements, node); + if (varAdded) { + if (moduleKind !== ts2.ModuleKind.System || currentLexicalScope !== currentSourceFile) { + emitFlags |= 512; + } + } + var parameterName = getNamespaceParameterName(node); + var containerName = getNamespaceContainerName(node); + var exportName = ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ) ? factory.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + var moduleArg = factory.createLogicalOr(exportName, factory.createAssignment(exportName, factory.createObjectLiteralExpression())); + if (hasNamespaceQualifiedExportName(node)) { + var localName = factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + moduleArg = factory.createAssignment(localName, moduleArg); + } + var enumStatement = factory.createExpressionStatement(factory.createCallExpression( + factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + transformEnumBody(node, containerName) + ), + /*typeArguments*/ + void 0, + [moduleArg] + )); + ts2.setOriginalNode(enumStatement, node); + if (varAdded) { + ts2.setSyntheticLeadingComments(enumStatement, void 0); + ts2.setSyntheticTrailingComments(enumStatement, void 0); + } + ts2.setTextRange(enumStatement, node); + ts2.addEmitFlags(enumStatement, emitFlags); + statements.push(enumStatement); + statements.push(factory.createEndOfDeclarationMarker(node)); + return statements; + } + function transformEnumBody(node, localName) { + var savedCurrentNamespaceLocalName = currentNamespaceContainerName; + currentNamespaceContainerName = localName; + var statements = []; + startLexicalEnvironment(); + var members = ts2.map(node.members, transformEnumMember); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + ts2.addRange(statements, members); + currentNamespaceContainerName = savedCurrentNamespaceLocalName; + return factory.createBlock( + ts2.setTextRange( + factory.createNodeArray(statements), + /*location*/ + node.members + ), + /*multiLine*/ + true + ); + } + function transformEnumMember(member) { + var name2 = getExpressionForPropertyName( + member, + /*generateNameForComputedPropertyName*/ + false + ); + var valueExpression = transformEnumMemberDeclarationValue(member); + var innerAssignment = factory.createAssignment(factory.createElementAccessExpression(currentNamespaceContainerName, name2), valueExpression); + var outerAssignment = valueExpression.kind === 10 ? innerAssignment : factory.createAssignment(factory.createElementAccessExpression(currentNamespaceContainerName, innerAssignment), name2); + return ts2.setTextRange(factory.createExpressionStatement(ts2.setTextRange(outerAssignment, member)), member); + } + function transformEnumMemberDeclarationValue(member) { + var value2 = resolver.getConstantValue(member); + if (value2 !== void 0) { + return typeof value2 === "string" ? factory.createStringLiteral(value2) : factory.createNumericLiteral(value2); + } else { + enableSubstitutionForNonQualifiedEnumMembers(); + if (member.initializer) { + return ts2.visitNode(member.initializer, visitor, ts2.isExpression); + } else { + return factory.createVoidZero(); + } + } + } + function shouldEmitModuleDeclaration(nodeIn) { + var node = ts2.getParseTreeNode(nodeIn, ts2.isModuleDeclaration); + if (!node) { + return true; + } + return ts2.isInstantiatedModule(node, ts2.shouldPreserveConstEnums(compilerOptions)); + } + function hasNamespaceQualifiedExportName(node) { + return isExportOfNamespace(node) || isExternalModuleExport(node) && moduleKind !== ts2.ModuleKind.ES2015 && moduleKind !== ts2.ModuleKind.ES2020 && moduleKind !== ts2.ModuleKind.ES2022 && moduleKind !== ts2.ModuleKind.ESNext && moduleKind !== ts2.ModuleKind.System; + } + function recordEmittedDeclarationInScope(node) { + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = new ts2.Map(); + } + var name2 = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name2)) { + currentScopeFirstDeclarationsOfName.set(name2, node); + } + } + function isFirstEmittedDeclarationInScope(node) { + if (currentScopeFirstDeclarationsOfName) { + var name2 = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name2) === node; + } + return true; + } + function declaredNameInScope(node) { + ts2.Debug.assertNode(node.name, ts2.isIdentifier); + return node.name.escapedText; + } + function addVarForEnumOrModuleDeclaration(statements, node) { + var statement = factory.createVariableStatement(ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration(factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ], + currentLexicalScope.kind === 308 ? 0 : 1 + /* NodeFlags.Let */ + )); + ts2.setOriginalNode(statement, node); + recordEmittedDeclarationInScope(node); + if (isFirstEmittedDeclarationInScope(node)) { + if (node.kind === 263) { + ts2.setSourceMapRange(statement.declarationList, node); + } else { + ts2.setSourceMapRange(statement, node); + } + ts2.setCommentRange(statement, node); + ts2.addEmitFlags( + statement, + 1024 | 4194304 + /* EmitFlags.HasEndOfDeclarationMarker */ + ); + statements.push(statement); + return true; + } else { + var mergeMarker = factory.createMergeDeclarationMarker(statement); + ts2.setEmitFlags( + mergeMarker, + 1536 | 4194304 + /* EmitFlags.HasEndOfDeclarationMarker */ + ); + statements.push(mergeMarker); + return false; + } + } + function visitModuleDeclaration(node) { + if (!shouldEmitModuleDeclaration(node)) { + return factory.createNotEmittedStatement(node); + } + ts2.Debug.assertNode(node.name, ts2.isIdentifier, "A TypeScript namespace should have an Identifier name."); + enableSubstitutionForNamespaceExports(); + var statements = []; + var emitFlags = 2; + var varAdded = addVarForEnumOrModuleDeclaration(statements, node); + if (varAdded) { + if (moduleKind !== ts2.ModuleKind.System || currentLexicalScope !== currentSourceFile) { + emitFlags |= 512; + } + } + var parameterName = getNamespaceParameterName(node); + var containerName = getNamespaceContainerName(node); + var exportName = ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ) ? factory.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + var moduleArg = factory.createLogicalOr(exportName, factory.createAssignment(exportName, factory.createObjectLiteralExpression())); + if (hasNamespaceQualifiedExportName(node)) { + var localName = factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + moduleArg = factory.createAssignment(localName, moduleArg); + } + var moduleStatement = factory.createExpressionStatement(factory.createCallExpression( + factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + transformModuleBody(node, containerName) + ), + /*typeArguments*/ + void 0, + [moduleArg] + )); + ts2.setOriginalNode(moduleStatement, node); + if (varAdded) { + ts2.setSyntheticLeadingComments(moduleStatement, void 0); + ts2.setSyntheticTrailingComments(moduleStatement, void 0); + } + ts2.setTextRange(moduleStatement, node); + ts2.addEmitFlags(moduleStatement, emitFlags); + statements.push(moduleStatement); + statements.push(factory.createEndOfDeclarationMarker(node)); + return statements; + } + function transformModuleBody(node, namespaceLocalName) { + var savedCurrentNamespaceContainerName = currentNamespaceContainerName; + var savedCurrentNamespace = currentNamespace; + var savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; + currentNamespaceContainerName = namespaceLocalName; + currentNamespace = node; + currentScopeFirstDeclarationsOfName = void 0; + var statements = []; + startLexicalEnvironment(); + var statementsLocation; + var blockLocation; + if (node.body) { + if (node.body.kind === 265) { + saveStateAndInvoke(node.body, function(body) { + return ts2.addRange(statements, ts2.visitNodes(body.statements, namespaceElementVisitor, ts2.isStatement)); + }); + statementsLocation = node.body.statements; + blockLocation = node.body; + } else { + var result2 = visitModuleDeclaration(node.body); + if (result2) { + if (ts2.isArray(result2)) { + ts2.addRange(statements, result2); + } else { + statements.push(result2); + } + } + var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; + statementsLocation = ts2.moveRangePos(moduleBlock.statements, -1); + } + } + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + currentNamespaceContainerName = savedCurrentNamespaceContainerName; + currentNamespace = savedCurrentNamespace; + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + var block = factory.createBlock( + ts2.setTextRange( + factory.createNodeArray(statements), + /*location*/ + statementsLocation + ), + /*multiLine*/ + true + ); + ts2.setTextRange(block, blockLocation); + if (!node.body || node.body.kind !== 265) { + ts2.setEmitFlags( + block, + ts2.getEmitFlags(block) | 1536 + /* EmitFlags.NoComments */ + ); + } + return block; + } + function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { + if (moduleDeclaration.body.kind === 264) { + var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); + return recursiveInnerModule || moduleDeclaration.body; + } + } + function visitImportDeclaration(node) { + if (!node.importClause) { + return node; + } + if (node.importClause.isTypeOnly) { + return void 0; + } + var importClause = ts2.visitNode(node.importClause, visitImportClause, ts2.isImportClause); + return importClause || compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2 ? factory.updateImportDeclaration( + node, + /*modifiers*/ + void 0, + importClause, + node.moduleSpecifier, + node.assertClause + ) : void 0; + } + function visitImportClause(node) { + ts2.Debug.assert(!node.isTypeOnly); + var name2 = shouldEmitAliasDeclaration(node) ? node.name : void 0; + var namedBindings = ts2.visitNode(node.namedBindings, visitNamedImportBindings, ts2.isNamedImportBindings); + return name2 || namedBindings ? factory.updateImportClause( + node, + /*isTypeOnly*/ + false, + name2, + namedBindings + ) : void 0; + } + function visitNamedImportBindings(node) { + if (node.kind === 271) { + return shouldEmitAliasDeclaration(node) ? node : void 0; + } else { + var allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2); + var elements = ts2.visitNodes(node.elements, visitImportSpecifier, ts2.isImportSpecifier); + return allowEmpty || ts2.some(elements) ? factory.updateNamedImports(node, elements) : void 0; + } + } + function visitImportSpecifier(node) { + return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; + } + function visitExportAssignment(node) { + return resolver.isValueAliasDeclaration(node) ? ts2.visitEachChild(node, visitor, context2) : void 0; + } + function visitExportDeclaration(node) { + if (node.isTypeOnly) { + return void 0; + } + if (!node.exportClause || ts2.isNamespaceExport(node.exportClause)) { + return node; + } + var allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2); + var exportClause = ts2.visitNode(node.exportClause, function(bindings6) { + return visitNamedExportBindings(bindings6, allowEmpty); + }, ts2.isNamedExportBindings); + return exportClause ? factory.updateExportDeclaration( + node, + /*modifiers*/ + void 0, + node.isTypeOnly, + exportClause, + node.moduleSpecifier, + node.assertClause + ) : void 0; + } + function visitNamedExports(node, allowEmpty) { + var elements = ts2.visitNodes(node.elements, visitExportSpecifier, ts2.isExportSpecifier); + return allowEmpty || ts2.some(elements) ? factory.updateNamedExports(node, elements) : void 0; + } + function visitNamespaceExports(node) { + return factory.updateNamespaceExport(node, ts2.visitNode(node.name, visitor, ts2.isIdentifier)); + } + function visitNamedExportBindings(node, allowEmpty) { + return ts2.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); + } + function visitExportSpecifier(node) { + return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : void 0; + } + function shouldEmitImportEqualsDeclaration(node) { + return shouldEmitAliasDeclaration(node) || !ts2.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); + } + function visitImportEqualsDeclaration(node) { + if (node.isTypeOnly) { + return void 0; + } + if (ts2.isExternalModuleImportEqualsDeclaration(node)) { + var isReferenced = shouldEmitAliasDeclaration(node); + if (!isReferenced && compilerOptions.importsNotUsedAsValues === 1) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createImportDeclaration( + /*modifiers*/ + void 0, + /*importClause*/ + void 0, + node.moduleReference.expression, + /*assertClause*/ + void 0 + ), node), node); + } + return isReferenced ? ts2.visitEachChild(node, visitor, context2) : void 0; + } + if (!shouldEmitImportEqualsDeclaration(node)) { + return void 0; + } + var moduleReference = ts2.createExpressionFromEntityName(factory, node.moduleReference); + ts2.setEmitFlags( + moduleReference, + 1536 | 2048 + /* EmitFlags.NoNestedComments */ + ); + if (isNamedExternalModuleExport(node) || !isExportOfNamespace(node)) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createVariableStatement(ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), factory.createVariableDeclarationList([ + ts2.setOriginalNode(factory.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + moduleReference + ), node) + ])), node), node); + } else { + return ts2.setOriginalNode(createNamespaceExport(node.name, moduleReference, node), node); + } + } + function isExportOfNamespace(node) { + return currentNamespace !== void 0 && ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ); + } + function isExternalModuleExport(node) { + return currentNamespace === void 0 && ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ); + } + function isNamedExternalModuleExport(node) { + return isExternalModuleExport(node) && !ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ); + } + function isDefaultExternalModuleExport(node) { + return isExternalModuleExport(node) && ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ); + } + function addExportMemberAssignment(statements, node) { + var expression = factory.createAssignment(factory.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ), factory.getLocalName(node)); + ts2.setSourceMapRange(expression, ts2.createRange(node.name ? node.name.pos : node.pos, node.end)); + var statement = factory.createExpressionStatement(expression); + ts2.setSourceMapRange(statement, ts2.createRange(-1, node.end)); + statements.push(statement); + } + function createNamespaceExport(exportName, exportValue, location2) { + return ts2.setTextRange(factory.createExpressionStatement(factory.createAssignment(factory.getNamespaceMemberName( + currentNamespaceContainerName, + exportName, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ), exportValue)), location2); + } + function createNamespaceExportExpression(exportName, exportValue, location2) { + return ts2.setTextRange(factory.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location2); + } + function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name2) { + return factory.getNamespaceMemberName( + currentNamespaceContainerName, + name2, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + } + function getNamespaceParameterName(node) { + var name2 = factory.getGeneratedNameForNode(node); + ts2.setSourceMapRange(name2, node.name); + return name2; + } + function getNamespaceContainerName(node) { + return factory.getGeneratedNameForNode(node); + } + function enableSubstitutionForNonQualifiedEnumMembers() { + if ((enabledSubstitutions & 8) === 0) { + enabledSubstitutions |= 8; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + } + } + function enableSubstitutionForNamespaceExports() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + context2.enableSubstitution( + 300 + /* SyntaxKind.ShorthandPropertyAssignment */ + ); + context2.enableEmitNotification( + 264 + /* SyntaxKind.ModuleDeclaration */ + ); + } + } + function isTransformedModuleDeclaration(node) { + return ts2.getOriginalNode(node).kind === 264; + } + function isTransformedEnumDeclaration(node) { + return ts2.getOriginalNode(node).kind === 263; + } + function onEmitNode(hint, node, emitCallback) { + var savedApplicableSubstitutions = applicableSubstitutions; + var savedCurrentSourceFile = currentSourceFile; + if (ts2.isSourceFile(node)) { + currentSourceFile = node; + } + if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) { + applicableSubstitutions |= 2; + } + if (enabledSubstitutions & 8 && isTransformedEnumDeclaration(node)) { + applicableSubstitutions |= 8; + } + previousOnEmitNode(hint, node, emitCallback); + applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } else if (ts2.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + if (enabledSubstitutions & 2) { + var name2 = node.name; + var exportedName = trySubstituteNamespaceExportedName(name2); + if (exportedName) { + if (node.objectAssignmentInitializer) { + var initializer = factory.createAssignment(exportedName, node.objectAssignmentInitializer); + return ts2.setTextRange(factory.createPropertyAssignment(name2, initializer), node); + } + return ts2.setTextRange(factory.createPropertyAssignment(name2, exportedName), node); + } + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + case 208: + return substitutePropertyAccessExpression(node); + case 209: + return substituteElementAccessExpression(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + return trySubstituteNamespaceExportedName(node) || node; + } + function trySubstituteNamespaceExportedName(node) { + if (enabledSubstitutions & applicableSubstitutions && !ts2.isGeneratedIdentifier(node) && !ts2.isLocalName(node)) { + var container = resolver.getReferencedExportContainer( + node, + /*prefixLocals*/ + false + ); + if (container && container.kind !== 308) { + var substitute = applicableSubstitutions & 2 && container.kind === 264 || applicableSubstitutions & 8 && container.kind === 263; + if (substitute) { + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(container), node), + /*location*/ + node + ); + } + } + } + return void 0; + } + function substitutePropertyAccessExpression(node) { + return substituteConstantValue(node); + } + function substituteElementAccessExpression(node) { + return substituteConstantValue(node); + } + function safeMultiLineComment(value2) { + return value2.replace(/\*\//g, "*_/"); + } + function substituteConstantValue(node) { + var constantValue = tryGetConstEnumValue(node); + if (constantValue !== void 0) { + ts2.setConstantValue(node, constantValue); + var substitute = typeof constantValue === "string" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue); + if (!compilerOptions.removeComments) { + var originalNode = ts2.getOriginalNode(node, ts2.isAccessExpression); + ts2.addSyntheticTrailingComment(substitute, 3, " ".concat(safeMultiLineComment(ts2.getTextOfNode(originalNode)), " ")); + } + return substitute; + } + return node; + } + function tryGetConstEnumValue(node) { + if (compilerOptions.isolatedModules) { + return void 0; + } + return ts2.isPropertyAccessExpression(node) || ts2.isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; + } + function shouldEmitAliasDeclaration(node) { + return ts2.isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + } + } + ts2.transformTypeScript = transformTypeScript; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ClassPropertySubstitutionFlags; + (function(ClassPropertySubstitutionFlags2) { + ClassPropertySubstitutionFlags2[ClassPropertySubstitutionFlags2["ClassAliases"] = 1] = "ClassAliases"; + ClassPropertySubstitutionFlags2[ClassPropertySubstitutionFlags2["ClassStaticThisOrSuperReference"] = 2] = "ClassStaticThisOrSuperReference"; + })(ClassPropertySubstitutionFlags || (ClassPropertySubstitutionFlags = {})); + var PrivateIdentifierKind; + (function(PrivateIdentifierKind2) { + PrivateIdentifierKind2["Field"] = "f"; + PrivateIdentifierKind2["Method"] = "m"; + PrivateIdentifierKind2["Accessor"] = "a"; + })(PrivateIdentifierKind = ts2.PrivateIdentifierKind || (ts2.PrivateIdentifierKind = {})); + var ClassFacts; + (function(ClassFacts2) { + ClassFacts2[ClassFacts2["None"] = 0] = "None"; + ClassFacts2[ClassFacts2["ClassWasDecorated"] = 1] = "ClassWasDecorated"; + ClassFacts2[ClassFacts2["NeedsClassConstructorReference"] = 2] = "NeedsClassConstructorReference"; + ClassFacts2[ClassFacts2["NeedsClassSuperReference"] = 4] = "NeedsClassSuperReference"; + ClassFacts2[ClassFacts2["NeedsSubstitutionForThisInClassStaticField"] = 8] = "NeedsSubstitutionForThisInClassStaticField"; + })(ClassFacts || (ClassFacts = {})); + function transformClassFields(context2) { + var factory = context2.factory, hoistVariableDeclaration = context2.hoistVariableDeclaration, endLexicalEnvironment = context2.endLexicalEnvironment, startLexicalEnvironment = context2.startLexicalEnvironment, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, addBlockScopedVariable = context2.addBlockScopedVariable; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var useDefineForClassFields = ts2.getUseDefineForClassFields(compilerOptions); + var shouldTransformInitializersUsingSet = !useDefineForClassFields; + var shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9; + var shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; + var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9; + var shouldTransformAutoAccessors = languageVersion < 99; + var shouldTransformThisInStaticInitializers = languageVersion < 9; + var shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2; + var shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors; + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + var previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + var enabledSubstitutions; + var classAliases; + var pendingExpressions; + var pendingStatements; + var classLexicalEnvironmentStack = []; + var classLexicalEnvironmentMap = new ts2.Map(); + var currentClassLexicalEnvironment; + var currentClassContainer; + var currentComputedPropertyNameClassLexicalEnvironment; + var currentStaticPropertyDeclarationOrStaticBlock; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || !shouldTransformAnything) { + return node; + } + var visited = ts2.visitEachChild(node, visitor, context2); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function visitor(node) { + if (!(node.transformFlags & 16777216) && !(node.transformFlags & 134234112)) { + return node; + } + switch (node.kind) { + case 127: + return shouldTransformAutoAccessors ? void 0 : node; + case 260: + return visitClassDeclaration(node); + case 228: + return visitClassExpression(node); + case 172: + return visitClassStaticBlockDeclaration(node); + case 169: + return visitPropertyDeclaration(node); + case 240: + return visitVariableStatement(node); + case 80: + return visitPrivateIdentifier(node); + case 208: + return visitPropertyAccessExpression(node); + case 209: + return visitElementAccessExpression(node); + case 221: + case 222: + return visitPreOrPostfixUnaryExpression( + node, + /*valueIsDiscarded*/ + false + ); + case 223: + return visitBinaryExpression( + node, + /*valueIsDiscarded*/ + false + ); + case 210: + return visitCallExpression(node); + case 241: + return visitExpressionStatement(node); + case 212: + return visitTaggedTemplateExpression(node); + case 245: + return visitForStatement(node); + case 259: + case 215: + case 173: + case 171: + case 174: + case 175: { + return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( + /*current*/ + void 0, + fallbackVisitor, + node + ); + } + default: + return fallbackVisitor(node); + } + } + function fallbackVisitor(node) { + return ts2.visitEachChild(node, visitor, context2); + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 221: + case 222: + return visitPreOrPostfixUnaryExpression( + node, + /*valueIsDiscarded*/ + true + ); + case 223: + return visitBinaryExpression( + node, + /*valueIsDiscarded*/ + true + ); + default: + return visitor(node); + } + } + function heritageClauseVisitor(node) { + switch (node.kind) { + case 294: + return ts2.visitEachChild(node, heritageClauseVisitor, context2); + case 230: + return visitExpressionWithTypeArgumentsInHeritageClause(node); + default: + return visitor(node); + } + } + function assignmentTargetVisitor(node) { + switch (node.kind) { + case 207: + case 206: + return visitAssignmentPattern(node); + default: + return visitor(node); + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 173: + return visitConstructorDeclaration(node); + case 174: + case 175: + case 171: + return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( + /*current*/ + void 0, + visitMethodOrAccessorDeclaration, + node + ); + case 169: + return setCurrentStaticPropertyDeclarationOrStaticBlockAnd( + /*current*/ + void 0, + visitPropertyDeclaration, + node + ); + case 164: + return visitComputedPropertyName(node); + case 237: + return node; + default: + return visitor(node); + } + } + function accessorFieldResultVisitor(node) { + switch (node.kind) { + case 169: + return transformFieldInitializer(node); + case 174: + case 175: + return classElementVisitor(node); + default: + ts2.Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); + break; + } + } + function visitPrivateIdentifier(node) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks) { + return node; + } + if (ts2.isStatement(node.parent)) { + return node; + } + return ts2.setOriginalNode(factory.createIdentifier(""), node); + } + function isPrivateIdentifierInExpression(node) { + return ts2.isPrivateIdentifier(node.left) && node.operatorToken.kind === 101; + } + function transformPrivateIdentifierInInExpression(node) { + var info2 = accessPrivateIdentifier(node.left); + if (info2) { + var receiver = ts2.visitNode(node.right, visitor, ts2.isExpression); + return ts2.setOriginalNode(context2.getEmitHelperFactory().createClassPrivateFieldInHelper(info2.brandCheckIdentifier, receiver), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitVariableStatement(node) { + var savedPendingStatements = pendingStatements; + pendingStatements = []; + var visitedNode = ts2.visitEachChild(node, visitor, context2); + var statement = ts2.some(pendingStatements) ? __spreadArray9([visitedNode], pendingStatements, true) : visitedNode; + pendingStatements = savedPendingStatements; + return statement; + } + function visitComputedPropertyName(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + if (ts2.some(pendingExpressions)) { + if (ts2.isParenthesizedExpression(expression)) { + expression = factory.updateParenthesizedExpression(expression, factory.inlineExpressions(__spreadArray9(__spreadArray9([], pendingExpressions, true), [expression.expression], false))); + } else { + expression = factory.inlineExpressions(__spreadArray9(__spreadArray9([], pendingExpressions, true), [expression], false)); + } + pendingExpressions = void 0; + } + return factory.updateComputedPropertyName(node, expression); + } + function visitConstructorDeclaration(node) { + if (currentClassContainer) { + return transformConstructor(node, currentClassContainer); + } + return fallbackVisitor(node); + } + function visitMethodOrAccessorDeclaration(node) { + ts2.Debug.assert(!ts2.hasDecorators(node)); + if (!shouldTransformPrivateElementsOrClassStaticBlocks || !ts2.isPrivateIdentifier(node.name)) { + return ts2.visitEachChild(node, classElementVisitor, context2); + } + var info2 = accessPrivateIdentifier(node.name); + ts2.Debug.assert(info2, "Undeclared private name for property declaration."); + if (!info2.isValid) { + return node; + } + var functionName = getHoistedFunctionName(node); + if (functionName) { + getPendingExpressions().push(factory.createAssignment(functionName, factory.createFunctionExpression( + ts2.filter(node.modifiers, function(m7) { + return ts2.isModifier(m7) && !ts2.isStaticModifier(m7) && !ts2.isAccessorModifier(m7); + }), + node.asteriskToken, + functionName, + /* typeParameters */ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /* type */ + void 0, + ts2.visitFunctionBody(node.body, visitor, context2) + ))); + } + return void 0; + } + function setCurrentStaticPropertyDeclarationOrStaticBlockAnd(current, visitor2, arg) { + var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; + currentStaticPropertyDeclarationOrStaticBlock = current; + var result2 = visitor2(arg); + currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; + return result2; + } + function getHoistedFunctionName(node) { + ts2.Debug.assert(ts2.isPrivateIdentifier(node.name)); + var info2 = accessPrivateIdentifier(node.name); + ts2.Debug.assert(info2, "Undeclared private name for property declaration."); + if (info2.kind === "m") { + return info2.methodName; + } + if (info2.kind === "a") { + if (ts2.isGetAccessor(node)) { + return info2.getterName; + } + if (ts2.isSetAccessor(node)) { + return info2.setterName; + } + } + } + function transformAutoAccessor(node) { + ts2.Debug.assertEachNode(node.modifiers, ts2.isModifier); + var commentRange = ts2.getCommentRange(node); + var sourceMapRange = ts2.getSourceMapRange(node); + var name2 = node.name; + var getterName = name2; + var setterName = name2; + if (ts2.isComputedPropertyName(name2) && !ts2.isSimpleInlineableExpression(name2.expression)) { + var temp = factory.createTempVariable(hoistVariableDeclaration); + ts2.setSourceMapRange(temp, name2.expression); + var expression = ts2.visitNode(name2.expression, visitor, ts2.isExpression); + var assignment = factory.createAssignment(temp, expression); + ts2.setSourceMapRange(assignment, name2.expression); + getterName = factory.updateComputedPropertyName(name2, factory.inlineExpressions([assignment, temp])); + setterName = factory.updateComputedPropertyName(name2, temp); + } + var backingField = ts2.createAccessorPropertyBackingField(factory, node, node.modifiers, node.initializer); + ts2.setOriginalNode(backingField, node); + ts2.setEmitFlags( + backingField, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(backingField, sourceMapRange); + var getter = ts2.createAccessorPropertyGetRedirector(factory, node, node.modifiers, getterName); + ts2.setOriginalNode(getter, node); + ts2.setCommentRange(getter, commentRange); + ts2.setSourceMapRange(getter, sourceMapRange); + var setter = ts2.createAccessorPropertySetRedirector(factory, node, node.modifiers, setterName); + ts2.setOriginalNode(setter, node); + ts2.setEmitFlags( + setter, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(setter, sourceMapRange); + return ts2.visitArray([backingField, getter, setter], accessorFieldResultVisitor, ts2.isClassElement); + } + function transformPrivateFieldInitializer(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + var info2 = accessPrivateIdentifier(node.name); + ts2.Debug.assert(info2, "Undeclared private name for property declaration."); + return info2.isValid ? void 0 : node; + } + if (shouldTransformInitializersUsingSet && !ts2.isStatic(node)) { + return factory.updatePropertyDeclaration( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + node.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformPublicFieldInitializer(node) { + if (shouldTransformInitializers) { + var expr = getPropertyNameExpressionIfNeeded( + node.name, + /*shouldHoist*/ + !!node.initializer || useDefineForClassFields + ); + if (expr) { + getPendingExpressions().push(expr); + } + if (ts2.isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { + var initializerStatement = transformPropertyOrClassStaticBlock(node, factory.createThis()); + if (initializerStatement) { + var staticBlock = factory.createClassStaticBlockDeclaration(factory.createBlock([initializerStatement])); + ts2.setOriginalNode(staticBlock, node); + ts2.setCommentRange(staticBlock, node); + ts2.setCommentRange(initializerStatement, { pos: -1, end: -1 }); + ts2.setSyntheticLeadingComments(initializerStatement, void 0); + ts2.setSyntheticTrailingComments(initializerStatement, void 0); + return staticBlock; + } + } + return void 0; + } + return ts2.visitEachChild(node, classElementVisitor, context2); + } + function transformFieldInitializer(node) { + ts2.Debug.assert(!ts2.hasDecorators(node), "Decorators should already have been transformed and elided."); + return ts2.isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); + } + function visitPropertyDeclaration(node) { + if (shouldTransformAutoAccessors && ts2.isAutoAccessorPropertyDeclaration(node)) { + return transformAutoAccessor(node); + } + return transformFieldInitializer(node); + } + function createPrivateIdentifierAccess(info2, receiver) { + return createPrivateIdentifierAccessHelper(info2, ts2.visitNode(receiver, visitor, ts2.isExpression)); + } + function createPrivateIdentifierAccessHelper(info2, receiver) { + ts2.setCommentRange(receiver, ts2.moveRangePos(receiver, -1)); + switch (info2.kind) { + case "a": + return context2.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info2.brandCheckIdentifier, info2.kind, info2.getterName); + case "m": + return context2.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info2.brandCheckIdentifier, info2.kind, info2.methodName); + case "f": + return context2.getEmitHelperFactory().createClassPrivateFieldGetHelper(receiver, info2.brandCheckIdentifier, info2.kind, info2.variableName); + default: + ts2.Debug.assertNever(info2, "Unknown private element type"); + } + } + function visitPropertyAccessExpression(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifier(node.name)) { + var privateIdentifierInfo = accessPrivateIdentifier(node.name); + if (privateIdentifierInfo) { + return ts2.setTextRange(ts2.setOriginalNode(createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), node), node); + } + } + if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(node) && ts2.isIdentifier(node.name) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + return visitInvalidSuperProperty(node); + } + if (classConstructor && superClassReference) { + var superProperty = factory.createReflectGetCall(superClassReference, factory.createStringLiteralFromNode(node.name), classConstructor); + ts2.setOriginalNode(superProperty, node.expression); + ts2.setTextRange(superProperty, node.expression); + return superProperty; + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitElementAccessExpression(node) { + if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(node) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + return visitInvalidSuperProperty(node); + } + if (classConstructor && superClassReference) { + var superProperty = factory.createReflectGetCall(superClassReference, ts2.visitNode(node.argumentExpression, visitor, ts2.isExpression), classConstructor); + ts2.setOriginalNode(superProperty, node.expression); + ts2.setTextRange(superProperty, node.expression); + return superProperty; + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + if (node.operator === 45 || node.operator === 46) { + var operand = ts2.skipParentheses(node.operand); + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifierPropertyAccessExpression(operand)) { + var info2 = void 0; + if (info2 = accessPrivateIdentifier(operand.name)) { + var receiver = ts2.visitNode(operand.expression, visitor, ts2.isExpression); + var _a2 = createCopiableReceiverExpr(receiver), readExpression = _a2.readExpression, initializeExpression = _a2.initializeExpression; + var expression = createPrivateIdentifierAccess(info2, readExpression); + var temp = ts2.isPrefixUnaryExpression(node) || valueIsDiscarded ? void 0 : factory.createTempVariable(hoistVariableDeclaration); + expression = ts2.expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp); + expression = createPrivateIdentifierAssignment( + info2, + initializeExpression || readExpression, + expression, + 63 + /* SyntaxKind.EqualsToken */ + ); + ts2.setOriginalNode(expression, node); + ts2.setTextRange(expression, node); + if (temp) { + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + } else if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(operand) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + var expression = visitInvalidSuperProperty(operand); + return ts2.isPrefixUnaryExpression(node) ? factory.updatePrefixUnaryExpression(node, expression) : factory.updatePostfixUnaryExpression(node, expression); + } + if (classConstructor && superClassReference) { + var setterName = void 0; + var getterName = void 0; + if (ts2.isPropertyAccessExpression(operand)) { + if (ts2.isIdentifier(operand.name)) { + getterName = setterName = factory.createStringLiteralFromNode(operand.name); + } + } else { + if (ts2.isSimpleInlineableExpression(operand.argumentExpression)) { + getterName = setterName = operand.argumentExpression; + } else { + getterName = factory.createTempVariable(hoistVariableDeclaration); + setterName = factory.createAssignment(getterName, ts2.visitNode(operand.argumentExpression, visitor, ts2.isExpression)); + } + } + if (setterName && getterName) { + var expression = factory.createReflectGetCall(superClassReference, getterName, classConstructor); + ts2.setTextRange(expression, operand); + var temp = valueIsDiscarded ? void 0 : factory.createTempVariable(hoistVariableDeclaration); + expression = ts2.expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp); + expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor); + ts2.setOriginalNode(expression, node); + ts2.setTextRange(expression, node); + if (temp) { + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + } + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + return factory.updateForStatement(node, ts2.visitNode(node.initializer, discardedValueVisitor, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, discardedValueVisitor, ts2.isExpression), ts2.visitIterationBody(node.statement, visitor, context2)); + } + function visitExpressionStatement(node) { + return factory.updateExpressionStatement(node, ts2.visitNode(node.expression, discardedValueVisitor, ts2.isExpression)); + } + function createCopiableReceiverExpr(receiver) { + var clone2 = ts2.nodeIsSynthesized(receiver) ? receiver : factory.cloneNode(receiver); + if (ts2.isSimpleInlineableExpression(receiver)) { + return { readExpression: clone2, initializeExpression: void 0 }; + } + var readExpression = factory.createTempVariable(hoistVariableDeclaration); + var initializeExpression = factory.createAssignment(readExpression, clone2); + return { readExpression, initializeExpression }; + } + function visitCallExpression(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifierPropertyAccessExpression(node.expression)) { + var _a2 = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion), thisArg = _a2.thisArg, target = _a2.target; + if (ts2.isCallChain(node)) { + return factory.updateCallChain( + node, + factory.createPropertyAccessChain(ts2.visitNode(target, visitor), node.questionDotToken, "call"), + /*questionDotToken*/ + void 0, + /*typeArguments*/ + void 0, + __spreadArray9([ts2.visitNode(thisArg, visitor, ts2.isExpression)], ts2.visitNodes(node.arguments, visitor, ts2.isExpression), true) + ); + } + return factory.updateCallExpression( + node, + factory.createPropertyAccessExpression(ts2.visitNode(target, visitor), "call"), + /*typeArguments*/ + void 0, + __spreadArray9([ts2.visitNode(thisArg, visitor, ts2.isExpression)], ts2.visitNodes(node.arguments, visitor, ts2.isExpression), true) + ); + } + if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(node.expression) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + var invocation = factory.createFunctionCallCall(ts2.visitNode(node.expression, visitor, ts2.isExpression), currentClassLexicalEnvironment.classConstructor, ts2.visitNodes(node.arguments, visitor, ts2.isExpression)); + ts2.setOriginalNode(invocation, node); + ts2.setTextRange(invocation, node); + return invocation; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitTaggedTemplateExpression(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifierPropertyAccessExpression(node.tag)) { + var _a2 = factory.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion), thisArg = _a2.thisArg, target = _a2.target; + return factory.updateTaggedTemplateExpression( + node, + factory.createCallExpression( + factory.createPropertyAccessExpression(ts2.visitNode(target, visitor), "bind"), + /*typeArguments*/ + void 0, + [ts2.visitNode(thisArg, visitor, ts2.isExpression)] + ), + /*typeArguments*/ + void 0, + ts2.visitNode(node.template, visitor, ts2.isTemplateLiteral) + ); + } + if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(node.tag) && currentStaticPropertyDeclarationOrStaticBlock && (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.classConstructor)) { + var invocation = factory.createFunctionBindCall(ts2.visitNode(node.tag, visitor, ts2.isExpression), currentClassLexicalEnvironment.classConstructor, []); + ts2.setOriginalNode(invocation, node); + ts2.setTextRange(invocation, node); + return factory.updateTaggedTemplateExpression( + node, + invocation, + /*typeArguments*/ + void 0, + ts2.visitNode(node.template, visitor, ts2.isTemplateLiteral) + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformClassStaticBlockDeclaration(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (currentClassLexicalEnvironment) { + classLexicalEnvironmentMap.set(ts2.getOriginalNodeId(node), currentClassLexicalEnvironment); + } + startLexicalEnvironment(); + var statements = setCurrentStaticPropertyDeclarationOrStaticBlockAnd(node, function(statements2) { + return ts2.visitNodes(statements2, visitor, ts2.isStatement); + }, node.body.statements); + statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + var iife = factory.createImmediatelyInvokedArrowFunction(statements); + ts2.setOriginalNode(iife, node); + ts2.setTextRange(iife, node); + ts2.addEmitFlags( + iife, + 2 + /* EmitFlags.AdviseOnEmitNode */ + ); + return iife; + } + } + function visitBinaryExpression(node, valueIsDiscarded) { + if (ts2.isDestructuringAssignment(node)) { + var savedPendingExpressions = pendingExpressions; + pendingExpressions = void 0; + node = factory.updateBinaryExpression(node, ts2.visitNode(node.left, assignmentTargetVisitor), node.operatorToken, ts2.visitNode(node.right, visitor)); + var expr = ts2.some(pendingExpressions) ? factory.inlineExpressions(ts2.compact(__spreadArray9(__spreadArray9([], pendingExpressions, true), [node], false))) : node; + pendingExpressions = savedPendingExpressions; + return expr; + } + if (ts2.isAssignmentExpression(node)) { + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifierPropertyAccessExpression(node.left)) { + var info2 = accessPrivateIdentifier(node.left.name); + if (info2) { + return ts2.setTextRange(ts2.setOriginalNode(createPrivateIdentifierAssignment(info2, node.left.expression, node.right, node.operatorToken.kind), node), node); + } + } else if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(node.left) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + return factory.updateBinaryExpression(node, visitInvalidSuperProperty(node.left), node.operatorToken, ts2.visitNode(node.right, visitor, ts2.isExpression)); + } + if (classConstructor && superClassReference) { + var setterName = ts2.isElementAccessExpression(node.left) ? ts2.visitNode(node.left.argumentExpression, visitor, ts2.isExpression) : ts2.isIdentifier(node.left.name) ? factory.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + var expression = ts2.visitNode(node.right, visitor, ts2.isExpression); + if (ts2.isCompoundAssignment(node.operatorToken.kind)) { + var getterName = setterName; + if (!ts2.isSimpleInlineableExpression(setterName)) { + getterName = factory.createTempVariable(hoistVariableDeclaration); + setterName = factory.createAssignment(getterName, setterName); + } + var superPropertyGet = factory.createReflectGetCall(superClassReference, getterName, classConstructor); + ts2.setOriginalNode(superPropertyGet, node.left); + ts2.setTextRange(superPropertyGet, node.left); + expression = factory.createBinaryExpression(superPropertyGet, ts2.getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), expression); + ts2.setTextRange(expression, node); + } + var temp = valueIsDiscarded ? void 0 : factory.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory.createAssignment(temp, expression); + ts2.setTextRange(temp, node); + } + expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor); + ts2.setOriginalNode(expression, node); + ts2.setTextRange(expression, node); + if (temp) { + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + } + } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierInExpression(node)) { + return transformPrivateIdentifierInInExpression(node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function createPrivateIdentifierAssignment(info2, receiver, right, operator) { + receiver = ts2.visitNode(receiver, visitor, ts2.isExpression); + right = ts2.visitNode(right, visitor, ts2.isExpression); + if (ts2.isCompoundAssignment(operator)) { + var _a2 = createCopiableReceiverExpr(receiver), readExpression = _a2.readExpression, initializeExpression = _a2.initializeExpression; + receiver = initializeExpression || readExpression; + right = factory.createBinaryExpression(createPrivateIdentifierAccessHelper(info2, readExpression), ts2.getNonAssignmentOperatorForCompoundAssignment(operator), right); + } + ts2.setCommentRange(receiver, ts2.moveRangePos(receiver, -1)); + switch (info2.kind) { + case "a": + return context2.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info2.brandCheckIdentifier, right, info2.kind, info2.setterName); + case "m": + return context2.getEmitHelperFactory().createClassPrivateFieldSetHelper( + receiver, + info2.brandCheckIdentifier, + right, + info2.kind, + /* f */ + void 0 + ); + case "f": + return context2.getEmitHelperFactory().createClassPrivateFieldSetHelper(receiver, info2.brandCheckIdentifier, right, info2.kind, info2.variableName); + default: + ts2.Debug.assertNever(info2, "Unknown private element type"); + } + } + function getPrivateInstanceMethodsAndAccessors(node) { + return ts2.filter(node.members, ts2.isNonStaticMethodOrAccessorWithPrivateName); + } + function getClassFacts(node) { + var facts = 0; + var original = ts2.getOriginalNode(node); + if (ts2.isClassDeclaration(original) && ts2.classOrConstructorParameterIsDecorated(original)) { + facts |= 1; + } + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (!ts2.isStatic(member)) + continue; + if (member.name && (ts2.isPrivateIdentifier(member.name) || ts2.isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) { + facts |= 2; + } + if (ts2.isPropertyDeclaration(member) || ts2.isClassStaticBlockDeclaration(member)) { + if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384) { + facts |= 8; + if (!(facts & 1)) { + facts |= 2; + } + } + if (shouldTransformSuperInStaticInitializers && member.transformFlags & 134217728) { + if (!(facts & 1)) { + facts |= 2 | 4; + } + } + } + } + return facts; + } + function visitExpressionWithTypeArgumentsInHeritageClause(node) { + var facts = (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.facts) || 0; + if (facts & 4) { + var temp = factory.createTempVariable( + hoistVariableDeclaration, + /*reserveInNestedScopes*/ + true + ); + getClassLexicalEnvironment().superClassReference = temp; + return factory.updateExpressionWithTypeArguments( + node, + factory.createAssignment(temp, ts2.visitNode(node.expression, visitor, ts2.isExpression)), + /*typeArguments*/ + void 0 + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitInNewClassLexicalEnvironment(node, visitor2) { + var savedCurrentClassContainer = currentClassContainer; + var savedPendingExpressions = pendingExpressions; + currentClassContainer = node; + pendingExpressions = void 0; + startClassLexicalEnvironment(); + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + var name2 = ts2.getNameOfDeclaration(node); + if (name2 && ts2.isIdentifier(name2)) { + getPrivateIdentifierEnvironment().className = name2; + } + var privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); + if (ts2.some(privateInstanceMethodsAndAccessors)) { + getPrivateIdentifierEnvironment().weakSetName = createHoistedVariableForClass("instances", privateInstanceMethodsAndAccessors[0].name); + } + } + var facts = getClassFacts(node); + if (facts) { + getClassLexicalEnvironment().facts = facts; + } + if (facts & 8) { + enableSubstitutionForClassStaticThisOrSuperReference(); + } + var result2 = visitor2(node, facts); + endClassLexicalEnvironment(); + currentClassContainer = savedCurrentClassContainer; + pendingExpressions = savedPendingExpressions; + return result2; + } + function visitClassDeclaration(node) { + return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + } + function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var pendingClassReferenceAssignment; + if (facts & 2) { + var temp = factory.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp); + pendingClassReferenceAssignment = factory.createAssignment(temp, factory.getInternalName(node)); + } + var modifiers = ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike); + var heritageClauses = ts2.visitNodes(node.heritageClauses, heritageClauseVisitor, ts2.isHeritageClause); + var _a2 = transformClassMembers(node), members = _a2.members, prologue = _a2.prologue; + var classDecl = factory.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + var statements = []; + if (prologue) { + statements.push(factory.createExpressionStatement(prologue)); + } + statements.push(classDecl); + if (pendingClassReferenceAssignment) { + getPendingExpressions().unshift(pendingClassReferenceAssignment); + } + if (ts2.some(pendingExpressions)) { + statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))); + } + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks) { + var staticProperties = ts2.getStaticPropertiesAndClassStaticBlock(node); + if (ts2.some(staticProperties)) { + addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node)); + } + } + return statements; + } + function visitClassExpression(node) { + return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + } + function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + var isDecoratedClassDeclaration = !!(facts & 1); + var staticPropertiesOrClassStaticBlocks = ts2.getStaticPropertiesAndClassStaticBlock(node); + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 16777216; + var temp; + function createClassTempVar() { + var classCheckFlags = resolver.getNodeCheckFlags(node); + var isClassWithConstructorReference2 = classCheckFlags & 16777216; + var requiresBlockScopedVar = classCheckFlags & 524288; + return factory.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2); + } + if (facts & 2) { + temp = createClassTempVar(); + getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp); + } + var modifiers = ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike); + var heritageClauses = ts2.visitNodes(node.heritageClauses, heritageClauseVisitor, ts2.isHeritageClause); + var _a2 = transformClassMembers(node), members = _a2.members, prologue = _a2.prologue; + var classExpression = factory.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + var expressions = []; + if (prologue) { + expressions.push(prologue); + } + var hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && ts2.some(staticPropertiesOrClassStaticBlocks, function(node2) { + return ts2.isClassStaticBlockDeclaration(node2) || ts2.isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && ts2.isInitializedProperty(node2); + }); + if (hasTransformableStatics || ts2.some(pendingExpressions)) { + if (isDecoratedClassDeclaration) { + ts2.Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); + if (pendingStatements && pendingExpressions && ts2.some(pendingExpressions)) { + pendingStatements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))); + } + if (pendingStatements && ts2.some(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, factory.getInternalName(node)); + } + if (temp) { + expressions.push(ts2.startOnNewLine(factory.createAssignment(temp, classExpression)), ts2.startOnNewLine(temp)); + } else { + expressions.push(classExpression); + if (prologue) { + ts2.startOnNewLine(classExpression); + } + } + } else { + temp || (temp = createClassTempVar()); + if (isClassWithConstructorReference) { + enableSubstitutionForClassAliases(); + var alias = factory.cloneNode(temp); + alias.autoGenerateFlags &= ~8; + classAliases[ts2.getOriginalNodeId(node)] = alias; + } + ts2.setEmitFlags(classExpression, 65536 | ts2.getEmitFlags(classExpression)); + expressions.push(ts2.startOnNewLine(factory.createAssignment(temp, classExpression))); + ts2.addRange(expressions, ts2.map(pendingExpressions, ts2.startOnNewLine)); + ts2.addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); + expressions.push(ts2.startOnNewLine(temp)); + } + } else { + expressions.push(classExpression); + if (prologue) { + ts2.startOnNewLine(classExpression); + } + } + return factory.inlineExpressions(expressions); + } + function visitClassStaticBlockDeclaration(node) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks) { + return ts2.visitEachChild(node, visitor, context2); + } + return void 0; + } + function transformClassMembers(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (ts2.isPrivateIdentifierClassElementDeclaration(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } + } + if (ts2.some(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } + if (shouldTransformAutoAccessors) { + for (var _b = 0, _c = node.members; _b < _c.length; _b++) { + var member = _c[_b]; + if (ts2.isAutoAccessorPropertyDeclaration(member)) { + var storageName = factory.getGeneratedPrivateNameForNode( + member.name, + /*prefix*/ + void 0, + "_accessor_storage" + ); + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } + } + } + } + var members = ts2.visitNodes(node.members, classElementVisitor, ts2.isClassElement); + var syntheticConstructor; + if (!ts2.some(members, ts2.isConstructorDeclaration)) { + syntheticConstructor = transformConstructor( + /*constructor*/ + void 0, + node + ); + } + var prologue; + var syntheticStaticBlock; + if (!shouldTransformPrivateElementsOrClassStaticBlocks && ts2.some(pendingExpressions)) { + var statement = factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)); + if (statement.transformFlags & 134234112) { + var temp = factory.createTempVariable(hoistVariableDeclaration); + var arrow = factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory.createBlock([statement]) + ); + prologue = factory.createAssignment(temp, arrow); + statement = factory.createExpressionStatement(factory.createCallExpression( + temp, + /*typeArguments*/ + void 0, + [] + )); + } + var block = factory.createBlock([statement]); + syntheticStaticBlock = factory.createClassStaticBlockDeclaration(block); + pendingExpressions = void 0; + } + if (syntheticConstructor || syntheticStaticBlock) { + var membersArray = void 0; + membersArray = ts2.append(membersArray, syntheticConstructor); + membersArray = ts2.append(membersArray, syntheticStaticBlock); + membersArray = ts2.addRange(membersArray, members); + members = ts2.setTextRange( + factory.createNodeArray(membersArray), + /*location*/ + node.members + ); + } + return { members, prologue }; + } + function createBrandCheckWeakSetForPrivateMethods() { + var weakSetName = getPrivateIdentifierEnvironment().weakSetName; + ts2.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); + getPendingExpressions().push(factory.createAssignment(weakSetName, factory.createNewExpression( + factory.createIdentifier("WeakSet"), + /*typeArguments*/ + void 0, + [] + ))); + } + function isClassElementThatRequiresConstructorStatement(member) { + if (ts2.isStatic(member) || ts2.hasAbstractModifier(ts2.getOriginalNode(member))) { + return false; + } + return shouldTransformInitializersUsingDefine && ts2.isPropertyDeclaration(member) || shouldTransformInitializersUsingSet && ts2.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifierClassElementDeclaration(member) || shouldTransformPrivateElementsOrClassStaticBlocks && shouldTransformAutoAccessors && ts2.isAutoAccessorPropertyDeclaration(member); + } + function transformConstructor(constructor, container) { + constructor = ts2.visitNode(constructor, visitor, ts2.isConstructorDeclaration); + if (!ts2.some(container.members, isClassElementThatRequiresConstructorStatement)) { + return constructor; + } + var extendsClauseElement = ts2.getEffectiveBaseTypeNode(container); + var isDerivedClass = !!(extendsClauseElement && ts2.skipOuterExpressions(extendsClauseElement.expression).kind !== 104); + var parameters = ts2.visitParameterList(constructor ? constructor.parameters : void 0, visitor, context2); + var body = transformConstructorBody(container, constructor, isDerivedClass); + if (!body) { + return constructor; + } + if (constructor) { + ts2.Debug.assert(parameters); + return factory.updateConstructorDeclaration( + constructor, + /*modifiers*/ + void 0, + parameters, + body + ); + } + return ts2.startOnNewLine(ts2.setOriginalNode(ts2.setTextRange(factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + parameters !== null && parameters !== void 0 ? parameters : [], + body + ), constructor || container), constructor)); + } + function transformConstructorBody(node, constructor, isDerivedClass) { + var _a2, _b; + var properties = ts2.getProperties( + node, + /*requireInitializer*/ + false, + /*isStatic*/ + false + ); + if (!useDefineForClassFields) { + properties = ts2.filter(properties, function(property2) { + return !!property2.initializer || ts2.isPrivateIdentifier(property2.name) || ts2.hasAccessorModifier(property2); + }); + } + var privateMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); + var needsConstructorBody = ts2.some(properties) || ts2.some(privateMethodsAndAccessors); + if (!constructor && !needsConstructorBody) { + return ts2.visitFunctionBody( + /*node*/ + void 0, + visitor, + context2 + ); + } + resumeLexicalEnvironment(); + var needsSyntheticConstructor = !constructor && isDerivedClass; + var indexOfFirstStatementAfterSuperAndPrologue = 0; + var prologueStatementCount = 0; + var superStatementIndex = -1; + var statements = []; + if ((_a2 = constructor === null || constructor === void 0 ? void 0 : constructor.body) === null || _a2 === void 0 ? void 0 : _a2.statements) { + prologueStatementCount = factory.copyPrologue( + constructor.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + superStatementIndex = ts2.findSuperStatementIndex(constructor.body.statements, prologueStatementCount); + if (superStatementIndex >= 0) { + indexOfFirstStatementAfterSuperAndPrologue = superStatementIndex + 1; + statements = __spreadArray9(__spreadArray9(__spreadArray9([], statements.slice(0, prologueStatementCount), true), ts2.visitNodes(constructor.body.statements, visitor, ts2.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuperAndPrologue - prologueStatementCount), true), statements.slice(prologueStatementCount), true); + } else if (prologueStatementCount >= 0) { + indexOfFirstStatementAfterSuperAndPrologue = prologueStatementCount; + } + } + if (needsSyntheticConstructor) { + statements.push(factory.createExpressionStatement(factory.createCallExpression( + factory.createSuper(), + /*typeArguments*/ + void 0, + [factory.createSpreadElement(factory.createIdentifier("arguments"))] + ))); + } + var parameterPropertyDeclarationCount = 0; + if (constructor === null || constructor === void 0 ? void 0 : constructor.body) { + if (useDefineForClassFields) { + statements = statements.filter(function(statement2) { + return !ts2.isParameterPropertyDeclaration(ts2.getOriginalNode(statement2), constructor); + }); + } else { + for (var _i = 0, _c = constructor.body.statements; _i < _c.length; _i++) { + var statement = _c[_i]; + if (ts2.isParameterPropertyDeclaration(ts2.getOriginalNode(statement), constructor)) { + parameterPropertyDeclarationCount++; + } + } + if (parameterPropertyDeclarationCount > 0) { + var parameterProperties = ts2.visitNodes(constructor.body.statements, visitor, ts2.isStatement, indexOfFirstStatementAfterSuperAndPrologue, parameterPropertyDeclarationCount); + if (superStatementIndex >= 0) { + ts2.addRange(statements, parameterProperties); + } else { + var superAndPrologueStatementCount = prologueStatementCount; + if (needsSyntheticConstructor) + superAndPrologueStatementCount++; + statements = __spreadArray9(__spreadArray9(__spreadArray9([], statements.slice(0, superAndPrologueStatementCount), true), parameterProperties, true), statements.slice(superAndPrologueStatementCount), true); + } + indexOfFirstStatementAfterSuperAndPrologue += parameterPropertyDeclarationCount; + } + } + } + var receiver = factory.createThis(); + addMethodStatements(statements, privateMethodsAndAccessors, receiver); + addPropertyOrClassStaticBlockStatements(statements, properties, receiver); + if (constructor) { + ts2.addRange(statements, ts2.visitNodes(constructor.body.statements, visitBodyStatement, ts2.isStatement, indexOfFirstStatementAfterSuperAndPrologue)); + } + statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + if (statements.length === 0 && !constructor) { + return void 0; + } + var multiLine = (constructor === null || constructor === void 0 ? void 0 : constructor.body) && constructor.body.statements.length >= statements.length ? (_b = constructor.body.multiLine) !== null && _b !== void 0 ? _b : statements.length > 0 : statements.length > 0; + return ts2.setTextRange( + factory.createBlock(ts2.setTextRange( + factory.createNodeArray(statements), + /*location*/ + constructor ? constructor.body.statements : node.members + ), multiLine), + /*location*/ + constructor ? constructor.body : void 0 + ); + function visitBodyStatement(statement2) { + if (useDefineForClassFields && ts2.isParameterPropertyDeclaration(ts2.getOriginalNode(statement2), constructor)) { + return void 0; + } + return visitor(statement2); + } + } + function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { + for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { + var property2 = properties_7[_i]; + if (ts2.isStatic(property2) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) { + continue; + } + var statement = transformPropertyOrClassStaticBlock(property2, receiver); + if (!statement) { + continue; + } + statements.push(statement); + } + } + function transformPropertyOrClassStaticBlock(property2, receiver) { + var expression = ts2.isClassStaticBlockDeclaration(property2) ? transformClassStaticBlockDeclaration(property2) : transformProperty(property2, receiver); + if (!expression) { + return void 0; + } + var statement = factory.createExpressionStatement(expression); + ts2.setOriginalNode(statement, property2); + ts2.addEmitFlags( + statement, + ts2.getEmitFlags(property2) & 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(statement, ts2.moveRangePastModifiers(property2)); + ts2.setCommentRange(statement, property2); + ts2.setSyntheticLeadingComments(expression, void 0); + ts2.setSyntheticTrailingComments(expression, void 0); + return statement; + } + function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { + var expressions = []; + for (var _i = 0, propertiesOrClassStaticBlocks_1 = propertiesOrClassStaticBlocks; _i < propertiesOrClassStaticBlocks_1.length; _i++) { + var property2 = propertiesOrClassStaticBlocks_1[_i]; + var expression = ts2.isClassStaticBlockDeclaration(property2) ? transformClassStaticBlockDeclaration(property2) : transformProperty(property2, receiver); + if (!expression) { + continue; + } + ts2.startOnNewLine(expression); + ts2.setOriginalNode(expression, property2); + ts2.addEmitFlags( + expression, + ts2.getEmitFlags(property2) & 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(expression, ts2.moveRangePastModifiers(property2)); + ts2.setCommentRange(expression, property2); + expressions.push(expression); + } + return expressions; + } + function transformProperty(property2, receiver) { + var savedCurrentStaticPropertyDeclarationOrStaticBlock = currentStaticPropertyDeclarationOrStaticBlock; + var transformed = transformPropertyWorker(property2, receiver); + if (transformed && ts2.hasStaticModifier(property2) && (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.facts)) { + ts2.setOriginalNode(transformed, property2); + ts2.addEmitFlags( + transformed, + 2 + /* EmitFlags.AdviseOnEmitNode */ + ); + classLexicalEnvironmentMap.set(ts2.getOriginalNodeId(transformed), currentClassLexicalEnvironment); + } + currentStaticPropertyDeclarationOrStaticBlock = savedCurrentStaticPropertyDeclarationOrStaticBlock; + return transformed; + } + function transformPropertyWorker(property2, receiver) { + var _a2; + var emitAssignment = !useDefineForClassFields; + var propertyName = ts2.hasAccessorModifier(property2) ? factory.getGeneratedPrivateNameForNode(property2.name) : ts2.isComputedPropertyName(property2.name) && !ts2.isSimpleInlineableExpression(property2.name.expression) ? factory.updateComputedPropertyName(property2.name, factory.getGeneratedNameForNode(property2.name)) : property2.name; + if (ts2.hasStaticModifier(property2)) { + currentStaticPropertyDeclarationOrStaticBlock = property2; + } + if (shouldTransformPrivateElementsOrClassStaticBlocks && ts2.isPrivateIdentifier(propertyName)) { + var privateIdentifierInfo = accessPrivateIdentifier(propertyName); + if (privateIdentifierInfo) { + if (privateIdentifierInfo.kind === "f") { + if (!privateIdentifierInfo.isStatic) { + return createPrivateInstanceFieldInitializer(receiver, ts2.visitNode(property2.initializer, visitor, ts2.isExpression), privateIdentifierInfo.brandCheckIdentifier); + } else { + return createPrivateStaticFieldInitializer(privateIdentifierInfo.variableName, ts2.visitNode(property2.initializer, visitor, ts2.isExpression)); + } + } else { + return void 0; + } + } else { + ts2.Debug.fail("Undeclared private name for property declaration."); + } + } + if ((ts2.isPrivateIdentifier(propertyName) || ts2.hasStaticModifier(property2)) && !property2.initializer) { + return void 0; + } + var propertyOriginalNode = ts2.getOriginalNode(property2); + if (ts2.hasSyntacticModifier( + propertyOriginalNode, + 256 + /* ModifierFlags.Abstract */ + )) { + return void 0; + } + var initializer = property2.initializer || emitAssignment ? (_a2 = ts2.visitNode(property2.initializer, visitor, ts2.isExpression)) !== null && _a2 !== void 0 ? _a2 : factory.createVoidZero() : ts2.isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && ts2.isIdentifier(propertyName) ? propertyName : factory.createVoidZero(); + if (emitAssignment || ts2.isPrivateIdentifier(propertyName)) { + var memberAccess = ts2.createMemberAccessForPropertyName( + factory, + receiver, + propertyName, + /*location*/ + propertyName + ); + return factory.createAssignment(memberAccess, initializer); + } else { + var name2 = ts2.isComputedPropertyName(propertyName) ? propertyName.expression : ts2.isIdentifier(propertyName) ? factory.createStringLiteral(ts2.unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; + var descriptor = factory.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); + return factory.createObjectDefinePropertyCall(receiver, name2, descriptor); + } + } + function enableSubstitutionForClassAliases() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + classAliases = []; + } + } + function enableSubstitutionForClassStaticThisOrSuperReference() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 108 + /* SyntaxKind.ThisKeyword */ + ); + context2.enableEmitNotification( + 259 + /* SyntaxKind.FunctionDeclaration */ + ); + context2.enableEmitNotification( + 215 + /* SyntaxKind.FunctionExpression */ + ); + context2.enableEmitNotification( + 173 + /* SyntaxKind.Constructor */ + ); + context2.enableEmitNotification( + 174 + /* SyntaxKind.GetAccessor */ + ); + context2.enableEmitNotification( + 175 + /* SyntaxKind.SetAccessor */ + ); + context2.enableEmitNotification( + 171 + /* SyntaxKind.MethodDeclaration */ + ); + context2.enableEmitNotification( + 169 + /* SyntaxKind.PropertyDeclaration */ + ); + context2.enableEmitNotification( + 164 + /* SyntaxKind.ComputedPropertyName */ + ); + } + } + function addMethodStatements(statements, methods, receiver) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks || !ts2.some(methods)) { + return; + } + var weakSetName = getPrivateIdentifierEnvironment().weakSetName; + ts2.Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); + statements.push(factory.createExpressionStatement(createPrivateInstanceMethodInitializer(receiver, weakSetName))); + } + function visitInvalidSuperProperty(node) { + return ts2.isPropertyAccessExpression(node) ? factory.updatePropertyAccessExpression(node, factory.createVoidZero(), node.name) : factory.updateElementAccessExpression(node, factory.createVoidZero(), ts2.visitNode(node.argumentExpression, visitor, ts2.isExpression)); + } + function onEmitNode(hint, node, emitCallback) { + var original = ts2.getOriginalNode(node); + if (original.id) { + var classLexicalEnvironment = classLexicalEnvironmentMap.get(original.id); + if (classLexicalEnvironment) { + var savedClassLexicalEnvironment = currentClassLexicalEnvironment; + var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; + currentClassLexicalEnvironment = classLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = classLexicalEnvironment; + previousOnEmitNode(hint, node, emitCallback); + currentClassLexicalEnvironment = savedClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + return; + } + } + switch (node.kind) { + case 215: + if (ts2.isArrowFunction(original) || ts2.getEmitFlags(node) & 262144) { + break; + } + case 259: + case 173: { + var savedClassLexicalEnvironment = currentClassLexicalEnvironment; + var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; + currentClassLexicalEnvironment = void 0; + currentComputedPropertyNameClassLexicalEnvironment = void 0; + previousOnEmitNode(hint, node, emitCallback); + currentClassLexicalEnvironment = savedClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + return; + } + case 174: + case 175: + case 171: + case 169: { + var savedClassLexicalEnvironment = currentClassLexicalEnvironment; + var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = currentClassLexicalEnvironment; + currentClassLexicalEnvironment = void 0; + previousOnEmitNode(hint, node, emitCallback); + currentClassLexicalEnvironment = savedClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + return; + } + case 164: { + var savedClassLexicalEnvironment = currentClassLexicalEnvironment; + var savedCurrentComputedPropertyNameClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; + currentClassLexicalEnvironment = currentComputedPropertyNameClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = void 0; + previousOnEmitNode(hint, node, emitCallback); + currentClassLexicalEnvironment = savedClassLexicalEnvironment; + currentComputedPropertyNameClassLexicalEnvironment = savedCurrentComputedPropertyNameClassLexicalEnvironment; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + case 108: + return substituteThisExpression(node); + } + return node; + } + function substituteThisExpression(node) { + if (enabledSubstitutions & 2 && currentClassLexicalEnvironment) { + var facts = currentClassLexicalEnvironment.facts, classConstructor = currentClassLexicalEnvironment.classConstructor; + if (facts & 1) { + return factory.createParenthesizedExpression(factory.createVoidZero()); + } + if (classConstructor) { + return ts2.setTextRange(ts2.setOriginalNode(factory.cloneNode(classConstructor), node), node); + } + } + return node; + } + function substituteExpressionIdentifier(node) { + return trySubstituteClassAlias(node) || node; + } + function trySubstituteClassAlias(node) { + if (enabledSubstitutions & 1) { + if (resolver.getNodeCheckFlags(node) & 33554432) { + var declaration = resolver.getReferencedValueDeclaration(node); + if (declaration) { + var classAlias = classAliases[declaration.id]; + if (classAlias) { + var clone_2 = factory.cloneNode(classAlias); + ts2.setSourceMapRange(clone_2, node); + ts2.setCommentRange(clone_2, node); + return clone_2; + } + } + } + } + return void 0; + } + function getPropertyNameExpressionIfNeeded(name2, shouldHoist) { + if (ts2.isComputedPropertyName(name2)) { + var expression = ts2.visitNode(name2.expression, visitor, ts2.isExpression); + var innerExpression = ts2.skipPartiallyEmittedExpressions(expression); + var inlinable = ts2.isSimpleInlineableExpression(innerExpression); + var alreadyTransformed = ts2.isAssignmentExpression(innerExpression) && ts2.isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + var generatedName = factory.getGeneratedNameForNode(name2); + if (resolver.getNodeCheckFlags(name2) & 524288) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + return factory.createAssignment(generatedName, expression); + } + return inlinable || ts2.isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + classLexicalEnvironmentStack.push(currentClassLexicalEnvironment); + currentClassLexicalEnvironment = void 0; + } + function endClassLexicalEnvironment() { + currentClassLexicalEnvironment = classLexicalEnvironmentStack.pop(); + } + function getClassLexicalEnvironment() { + return currentClassLexicalEnvironment || (currentClassLexicalEnvironment = { + facts: 0, + classConstructor: void 0, + superClassReference: void 0, + privateIdentifierEnvironment: void 0 + }); + } + function getPrivateIdentifierEnvironment() { + var lex = getClassLexicalEnvironment(); + lex.privateIdentifierEnvironment || (lex.privateIdentifierEnvironment = { + className: void 0, + weakSetName: void 0, + identifiers: void 0, + generatedIdentifiers: void 0 + }); + return lex.privateIdentifierEnvironment; + } + function getPendingExpressions() { + return pendingExpressions !== null && pendingExpressions !== void 0 ? pendingExpressions : pendingExpressions = []; + } + function addPrivateIdentifierClassElementToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo) { + if (ts2.isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } else if (ts2.isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } else if (ts2.isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } else if (ts2.isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } else if (ts2.isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic, isValid2, _previousInfo) { + if (isStatic) { + ts2.Debug.assert(lex.classConstructor, "classConstructor should be set in private identifier environment"); + var variableName = createHoistedVariableForPrivateName(name2); + setPrivateIdentifier(privateEnv, name2, { + kind: "f", + brandCheckIdentifier: lex.classConstructor, + variableName, + isStatic: true, + isValid: isValid2 + }); + } else { + var weakMapName = createHoistedVariableForPrivateName(name2); + setPrivateIdentifier(privateEnv, name2, { + kind: "f", + brandCheckIdentifier: weakMapName, + variableName: void 0, + isStatic: false, + isValid: isValid2 + }); + getPendingExpressions().push(factory.createAssignment(weakMapName, factory.createNewExpression( + factory.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ))); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic, isValid2, _previousInfo) { + var methodName = createHoistedVariableForPrivateName(name2); + var brandCheckIdentifier = isStatic ? ts2.Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : ts2.Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name2, { + kind: "m", + methodName, + brandCheckIdentifier, + isStatic, + isValid: isValid2 + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic, isValid2, previousInfo) { + var getterName = createHoistedVariableForPrivateName(name2, "_get"); + var brandCheckIdentifier = isStatic ? ts2.Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : ts2.Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" && previousInfo.isStatic === isStatic && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic, + isValid: isValid2 + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic, isValid2, previousInfo) { + var setterName = createHoistedVariableForPrivateName(name2, "_set"); + var brandCheckIdentifier = isStatic ? ts2.Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : ts2.Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo === null || previousInfo === void 0 ? void 0 : previousInfo.kind) === "a" && previousInfo.isStatic === isStatic && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic, + isValid: isValid2 + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic, isValid2, _previousInfo) { + var getterName = createHoistedVariableForPrivateName(name2, "_get"); + var setterName = createHoistedVariableForPrivateName(name2, "_set"); + var brandCheckIdentifier = isStatic ? ts2.Debug.checkDefined(lex.classConstructor, "classConstructor should be set in private identifier environment") : ts2.Debug.checkDefined(privateEnv.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName, + setterName, + brandCheckIdentifier, + isStatic, + isValid: isValid2 + }); + } + function addPrivateIdentifierToEnvironment(node, name2, addDeclaration) { + var lex = getClassLexicalEnvironment(); + var privateEnv = getPrivateIdentifierEnvironment(); + var previousInfo = getPrivateIdentifier(privateEnv, name2); + var isStatic = ts2.hasStaticModifier(node); + var isValid2 = !isReservedPrivateName(name2) && previousInfo === void 0; + addDeclaration(node, name2, lex, privateEnv, isStatic, isValid2, previousInfo); + } + function createHoistedVariableForClass(name2, node, suffix) { + var className = getPrivateIdentifierEnvironment().className; + var prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + var identifier = typeof name2 === "object" ? factory.getGeneratedNameForNode(name2, 16 | 8, prefix, suffix) : typeof name2 === "string" ? factory.createUniqueName(name2, 16, prefix, suffix) : factory.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reserveInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 524288) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name2, suffix) { + var _a2; + var text = ts2.tryGetTextOfPropertyName(name2); + return createHoistedVariableForClass((_a2 = text === null || text === void 0 ? void 0 : text.substring(1)) !== null && _a2 !== void 0 ? _a2 : name2, name2, suffix); + } + function accessPrivateIdentifier(name2) { + if (ts2.isGeneratedPrivateIdentifier(name2)) { + return accessGeneratedPrivateIdentifier(name2); + } else { + return accessPrivateIdentifierByText(name2.escapedText); + } + } + function accessPrivateIdentifierByText(text) { + return accessPrivateIdentifierWorker(getPrivateIdentifierInfo, text); + } + function accessGeneratedPrivateIdentifier(name2) { + return accessPrivateIdentifierWorker(getGeneratedPrivateIdentifierInfo, ts2.getNodeForGeneratedName(name2)); + } + function accessPrivateIdentifierWorker(getPrivateIdentifierInfo2, privateIdentifierKey) { + if (currentClassLexicalEnvironment === null || currentClassLexicalEnvironment === void 0 ? void 0 : currentClassLexicalEnvironment.privateIdentifierEnvironment) { + var info2 = getPrivateIdentifierInfo2(currentClassLexicalEnvironment.privateIdentifierEnvironment, privateIdentifierKey); + if (info2) { + return info2; + } + } + for (var i7 = classLexicalEnvironmentStack.length - 1; i7 >= 0; --i7) { + var env3 = classLexicalEnvironmentStack[i7]; + if (!env3) { + continue; + } + if (env3.privateIdentifierEnvironment) { + var info2 = getPrivateIdentifierInfo2(env3.privateIdentifierEnvironment, privateIdentifierKey); + if (info2) { + return info2; + } + } + } + return void 0; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + var parameter = factory.getGeneratedNameForNode(node); + var info2 = accessPrivateIdentifier(node.name); + if (!info2) { + return ts2.visitEachChild(node, visitor, context2); + } + var receiver = node.expression; + if (ts2.isThisProperty(node) || ts2.isSuperProperty(node) || !ts2.isSimpleCopiableExpression(node.expression)) { + receiver = factory.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory.createBinaryExpression(receiver, 63, ts2.visitNode(node.expression, visitor, ts2.isExpression))); + } + return factory.createAssignmentTargetWrapper(parameter, createPrivateIdentifierAssignment( + info2, + receiver, + parameter, + 63 + /* SyntaxKind.EqualsToken */ + )); + } + function visitArrayAssignmentTarget(node) { + var target = ts2.getTargetOfBindingOrAssignmentElement(node); + if (target) { + var wrapped = void 0; + if (ts2.isPrivateIdentifierPropertyAccessExpression(target)) { + wrapped = wrapPrivateIdentifierForDestructuringTarget(target); + } else if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + wrapped = visitInvalidSuperProperty(target); + } else if (classConstructor && superClassReference) { + var name2 = ts2.isElementAccessExpression(target) ? ts2.visitNode(target.argumentExpression, visitor, ts2.isExpression) : ts2.isIdentifier(target.name) ? factory.createStringLiteralFromNode(target.name) : void 0; + if (name2) { + var temp = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + wrapped = factory.createAssignmentTargetWrapper(temp, factory.createReflectSetCall(superClassReference, name2, temp, classConstructor)); + } + } + } + if (wrapped) { + if (ts2.isAssignmentExpression(node)) { + return factory.updateBinaryExpression(node, wrapped, node.operatorToken, ts2.visitNode(node.right, visitor, ts2.isExpression)); + } else if (ts2.isSpreadElement(node)) { + return factory.updateSpreadElement(node, wrapped); + } else { + return wrapped; + } + } + } + return ts2.visitNode(node, assignmentTargetVisitor); + } + function visitObjectAssignmentTarget(node) { + if (ts2.isObjectBindingOrAssignmentElement(node) && !ts2.isShorthandPropertyAssignment(node)) { + var target = ts2.getTargetOfBindingOrAssignmentElement(node); + var wrapped = void 0; + if (target) { + if (ts2.isPrivateIdentifierPropertyAccessExpression(target)) { + wrapped = wrapPrivateIdentifierForDestructuringTarget(target); + } else if (shouldTransformSuperInStaticInitializers && ts2.isSuperProperty(target) && currentStaticPropertyDeclarationOrStaticBlock && currentClassLexicalEnvironment) { + var classConstructor = currentClassLexicalEnvironment.classConstructor, superClassReference = currentClassLexicalEnvironment.superClassReference, facts = currentClassLexicalEnvironment.facts; + if (facts & 1) { + wrapped = visitInvalidSuperProperty(target); + } else if (classConstructor && superClassReference) { + var name2 = ts2.isElementAccessExpression(target) ? ts2.visitNode(target.argumentExpression, visitor, ts2.isExpression) : ts2.isIdentifier(target.name) ? factory.createStringLiteralFromNode(target.name) : void 0; + if (name2) { + var temp = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + wrapped = factory.createAssignmentTargetWrapper(temp, factory.createReflectSetCall(superClassReference, name2, temp, classConstructor)); + } + } + } + } + if (ts2.isPropertyAssignment(node)) { + var initializer = ts2.getInitializerOfBindingOrAssignmentElement(node); + return factory.updatePropertyAssignment(node, ts2.visitNode(node.name, visitor, ts2.isPropertyName), wrapped ? initializer ? factory.createAssignment(wrapped, ts2.visitNode(initializer, visitor)) : wrapped : ts2.visitNode(node.initializer, assignmentTargetVisitor, ts2.isExpression)); + } + if (ts2.isSpreadAssignment(node)) { + return factory.updateSpreadAssignment(node, wrapped || ts2.visitNode(node.expression, assignmentTargetVisitor, ts2.isExpression)); + } + ts2.Debug.assert(wrapped === void 0, "Should not have generated a wrapped target"); + } + return ts2.visitNode(node, visitor); + } + function visitAssignmentPattern(node) { + if (ts2.isArrayLiteralExpression(node)) { + return factory.updateArrayLiteralExpression(node, ts2.visitNodes(node.elements, visitArrayAssignmentTarget, ts2.isExpression)); + } else { + return factory.updateObjectLiteralExpression(node, ts2.visitNodes(node.properties, visitObjectAssignmentTarget, ts2.isObjectLiteralElementLike)); + } + } + } + ts2.transformClassFields = transformClassFields; + function createPrivateStaticFieldInitializer(variableName, initializer) { + return ts2.factory.createAssignment(variableName, ts2.factory.createObjectLiteralExpression([ + ts2.factory.createPropertyAssignment("value", initializer || ts2.factory.createVoidZero()) + ])); + } + function createPrivateInstanceFieldInitializer(receiver, initializer, weakMapName) { + return ts2.factory.createCallExpression( + ts2.factory.createPropertyAccessExpression(weakMapName, "set"), + /*typeArguments*/ + void 0, + [receiver, initializer || ts2.factory.createVoidZero()] + ); + } + function createPrivateInstanceMethodInitializer(receiver, weakSetName) { + return ts2.factory.createCallExpression( + ts2.factory.createPropertyAccessExpression(weakSetName, "add"), + /*typeArguments*/ + void 0, + [receiver] + ); + } + function isReservedPrivateName(node) { + return !ts2.isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; + } + function getPrivateIdentifier(privateEnv, name2) { + return ts2.isGeneratedPrivateIdentifier(name2) ? getGeneratedPrivateIdentifierInfo(privateEnv, ts2.getNodeForGeneratedName(name2)) : getPrivateIdentifierInfo(privateEnv, name2.escapedText); + } + function setPrivateIdentifier(privateEnv, name2, info2) { + var _a2, _b; + if (ts2.isGeneratedPrivateIdentifier(name2)) { + (_a2 = privateEnv.generatedIdentifiers) !== null && _a2 !== void 0 ? _a2 : privateEnv.generatedIdentifiers = new ts2.Map(); + privateEnv.generatedIdentifiers.set(ts2.getNodeForGeneratedName(name2), info2); + } else { + (_b = privateEnv.identifiers) !== null && _b !== void 0 ? _b : privateEnv.identifiers = new ts2.Map(); + privateEnv.identifiers.set(name2.escapedText, info2); + } + } + function getPrivateIdentifierInfo(privateEnv, key) { + var _a2; + return (_a2 = privateEnv.identifiers) === null || _a2 === void 0 ? void 0 : _a2.get(key); + } + function getGeneratedPrivateIdentifierInfo(privateEnv, key) { + var _a2; + return (_a2 = privateEnv.generatedIdentifiers) === null || _a2 === void 0 ? void 0 : _a2.get(key); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createRuntimeTypeSerializer(context2) { + var hoistVariableDeclaration = context2.hoistVariableDeclaration; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var strictNullChecks = ts2.getStrictOptionValue(compilerOptions, "strictNullChecks"); + var currentLexicalScope; + var currentNameScope; + return { + serializeTypeNode: function(serializerContext, node) { + return setSerializerContextAnd(serializerContext, serializeTypeNode, node); + }, + serializeTypeOfNode: function(serializerContext, node) { + return setSerializerContextAnd(serializerContext, serializeTypeOfNode, node); + }, + serializeParameterTypesOfNode: function(serializerContext, node, container) { + return setSerializerContextAnd(serializerContext, serializeParameterTypesOfNode, node, container); + }, + serializeReturnTypeOfNode: function(serializerContext, node) { + return setSerializerContextAnd(serializerContext, serializeReturnTypeOfNode, node); + } + }; + function setSerializerContextAnd(serializerContext, cb, node, arg) { + var savedCurrentLexicalScope = currentLexicalScope; + var savedCurrentNameScope = currentNameScope; + currentLexicalScope = serializerContext.currentLexicalScope; + currentNameScope = serializerContext.currentNameScope; + var result2 = arg === void 0 ? cb(node) : cb(node, arg); + currentLexicalScope = savedCurrentLexicalScope; + currentNameScope = savedCurrentNameScope; + return result2; + } + function getAccessorTypeNode(node) { + var accessors = resolver.getAllAccessorDeclarations(node); + return accessors.setAccessor && ts2.getSetAccessorTypeAnnotationNode(accessors.setAccessor) || accessors.getAccessor && ts2.getEffectiveReturnTypeNode(accessors.getAccessor); + } + function serializeTypeOfNode(node) { + switch (node.kind) { + case 169: + case 166: + return serializeTypeNode(node.type); + case 175: + case 174: + return serializeTypeNode(getAccessorTypeNode(node)); + case 260: + case 228: + case 171: + return ts2.factory.createIdentifier("Function"); + default: + return ts2.factory.createVoidZero(); + } + } + function serializeParameterTypesOfNode(node, container) { + var valueDeclaration = ts2.isClassLike(node) ? ts2.getFirstConstructorWithBody(node) : ts2.isFunctionLike(node) && ts2.nodeIsPresent(node.body) ? node : void 0; + var expressions = []; + if (valueDeclaration) { + var parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); + var numParameters = parameters.length; + for (var i7 = 0; i7 < numParameters; i7++) { + var parameter = parameters[i7]; + if (i7 === 0 && ts2.isIdentifier(parameter.name) && parameter.name.escapedText === "this") { + continue; + } + if (parameter.dotDotDotToken) { + expressions.push(serializeTypeNode(ts2.getRestParameterElementType(parameter.type))); + } else { + expressions.push(serializeTypeOfNode(parameter)); + } + } + } + return ts2.factory.createArrayLiteralExpression(expressions); + } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 174) { + var setAccessor = ts2.getAllAccessorDeclarations(container.members, node).setAccessor; + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } + function serializeReturnTypeOfNode(node) { + if (ts2.isFunctionLike(node) && node.type) { + return serializeTypeNode(node.type); + } else if (ts2.isAsyncFunction(node)) { + return ts2.factory.createIdentifier("Promise"); + } + return ts2.factory.createVoidZero(); + } + function serializeTypeNode(node) { + if (node === void 0) { + return ts2.factory.createIdentifier("Object"); + } + node = ts2.skipTypeParentheses(node); + switch (node.kind) { + case 114: + case 155: + case 144: + return ts2.factory.createVoidZero(); + case 181: + case 182: + return ts2.factory.createIdentifier("Function"); + case 185: + case 186: + return ts2.factory.createIdentifier("Array"); + case 179: + return node.assertsModifier ? ts2.factory.createVoidZero() : ts2.factory.createIdentifier("Boolean"); + case 134: + return ts2.factory.createIdentifier("Boolean"); + case 200: + case 152: + return ts2.factory.createIdentifier("String"); + case 149: + return ts2.factory.createIdentifier("Object"); + case 198: + return serializeLiteralOfLiteralTypeNode(node.literal); + case 148: + return ts2.factory.createIdentifier("Number"); + case 160: + return getGlobalConstructor( + "BigInt", + 7 + /* ScriptTarget.ES2020 */ + ); + case 153: + return getGlobalConstructor( + "Symbol", + 2 + /* ScriptTarget.ES2015 */ + ); + case 180: + return serializeTypeReferenceNode(node); + case 190: + return serializeUnionOrIntersectionConstituents( + node.types, + /*isIntersection*/ + true + ); + case 189: + return serializeUnionOrIntersectionConstituents( + node.types, + /*isIntersection*/ + false + ); + case 191: + return serializeUnionOrIntersectionConstituents( + [node.trueType, node.falseType], + /*isIntersection*/ + false + ); + case 195: + if (node.operator === 146) { + return serializeTypeNode(node.type); + } + break; + case 183: + case 196: + case 197: + case 184: + case 131: + case 157: + case 194: + case 202: + break; + case 315: + case 316: + case 320: + case 321: + case 322: + break; + case 317: + case 318: + case 319: + return serializeTypeNode(node.type); + default: + return ts2.Debug.failBadSyntaxKind(node); + } + return ts2.factory.createIdentifier("Object"); + } + function serializeLiteralOfLiteralTypeNode(node) { + switch (node.kind) { + case 10: + case 14: + return ts2.factory.createIdentifier("String"); + case 221: { + var operand = node.operand; + switch (operand.kind) { + case 8: + case 9: + return serializeLiteralOfLiteralTypeNode(operand); + default: + return ts2.Debug.failBadSyntaxKind(operand); + } + } + case 8: + return ts2.factory.createIdentifier("Number"); + case 9: + return getGlobalConstructor( + "BigInt", + 7 + /* ScriptTarget.ES2020 */ + ); + case 110: + case 95: + return ts2.factory.createIdentifier("Boolean"); + case 104: + return ts2.factory.createVoidZero(); + default: + return ts2.Debug.failBadSyntaxKind(node); + } + } + function serializeUnionOrIntersectionConstituents(types3, isIntersection) { + var serializedType; + for (var _i = 0, types_22 = types3; _i < types_22.length; _i++) { + var typeNode = types_22[_i]; + typeNode = ts2.skipTypeParentheses(typeNode); + if (typeNode.kind === 144) { + if (isIntersection) + return ts2.factory.createVoidZero(); + continue; + } + if (typeNode.kind === 157) { + if (!isIntersection) + return ts2.factory.createIdentifier("Object"); + continue; + } + if (typeNode.kind === 131) { + return ts2.factory.createIdentifier("Object"); + } + if (!strictNullChecks && (ts2.isLiteralTypeNode(typeNode) && typeNode.literal.kind === 104 || typeNode.kind === 155)) { + continue; + } + var serializedConstituent = serializeTypeNode(typeNode); + if (ts2.isIdentifier(serializedConstituent) && serializedConstituent.escapedText === "Object") { + return serializedConstituent; + } + if (serializedType) { + if (!equateSerializedTypeNodes(serializedType, serializedConstituent)) { + return ts2.factory.createIdentifier("Object"); + } + } else { + serializedType = serializedConstituent; + } + } + return serializedType !== null && serializedType !== void 0 ? serializedType : ts2.factory.createVoidZero(); + } + function equateSerializedTypeNodes(left, right) { + return ( + // temp vars used in fallback + ts2.isGeneratedIdentifier(left) ? ts2.isGeneratedIdentifier(right) : ( + // entity names + ts2.isIdentifier(left) ? ts2.isIdentifier(right) && left.escapedText === right.escapedText : ts2.isPropertyAccessExpression(left) ? ts2.isPropertyAccessExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) && equateSerializedTypeNodes(left.name, right.name) : ( + // `void 0` + ts2.isVoidExpression(left) ? ts2.isVoidExpression(right) && ts2.isNumericLiteral(left.expression) && left.expression.text === "0" && ts2.isNumericLiteral(right.expression) && right.expression.text === "0" : ( + // `"undefined"` or `"function"` in `typeof` checks + ts2.isStringLiteral(left) ? ts2.isStringLiteral(right) && left.text === right.text : ( + // used in `typeof` checks for fallback + ts2.isTypeOfExpression(left) ? ts2.isTypeOfExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( + // parens in `typeof` checks with temps + ts2.isParenthesizedExpression(left) ? ts2.isParenthesizedExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( + // conditionals used in fallback + ts2.isConditionalExpression(left) ? ts2.isConditionalExpression(right) && equateSerializedTypeNodes(left.condition, right.condition) && equateSerializedTypeNodes(left.whenTrue, right.whenTrue) && equateSerializedTypeNodes(left.whenFalse, right.whenFalse) : ( + // logical binary and assignments used in fallback + ts2.isBinaryExpression(left) ? ts2.isBinaryExpression(right) && left.operatorToken.kind === right.operatorToken.kind && equateSerializedTypeNodes(left.left, right.left) && equateSerializedTypeNodes(left.right, right.right) : false + ) + ) + ) + ) + ) + ) + ) + ); + } + function serializeTypeReferenceNode(node) { + var kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope !== null && currentNameScope !== void 0 ? currentNameScope : currentLexicalScope); + switch (kind) { + case ts2.TypeReferenceSerializationKind.Unknown: + if (ts2.findAncestor(node, function(n7) { + return n7.parent && ts2.isConditionalTypeNode(n7.parent) && (n7.parent.trueType === n7 || n7.parent.falseType === n7); + })) { + return ts2.factory.createIdentifier("Object"); + } + var serialized = serializeEntityNameAsExpressionFallback(node.typeName); + var temp = ts2.factory.createTempVariable(hoistVariableDeclaration); + return ts2.factory.createConditionalExpression( + ts2.factory.createTypeCheck(ts2.factory.createAssignment(temp, serialized), "function"), + /*questionToken*/ + void 0, + temp, + /*colonToken*/ + void 0, + ts2.factory.createIdentifier("Object") + ); + case ts2.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue: + return serializeEntityNameAsExpression(node.typeName); + case ts2.TypeReferenceSerializationKind.VoidNullableOrNeverType: + return ts2.factory.createVoidZero(); + case ts2.TypeReferenceSerializationKind.BigIntLikeType: + return getGlobalConstructor( + "BigInt", + 7 + /* ScriptTarget.ES2020 */ + ); + case ts2.TypeReferenceSerializationKind.BooleanType: + return ts2.factory.createIdentifier("Boolean"); + case ts2.TypeReferenceSerializationKind.NumberLikeType: + return ts2.factory.createIdentifier("Number"); + case ts2.TypeReferenceSerializationKind.StringLikeType: + return ts2.factory.createIdentifier("String"); + case ts2.TypeReferenceSerializationKind.ArrayLikeType: + return ts2.factory.createIdentifier("Array"); + case ts2.TypeReferenceSerializationKind.ESSymbolType: + return getGlobalConstructor( + "Symbol", + 2 + /* ScriptTarget.ES2015 */ + ); + case ts2.TypeReferenceSerializationKind.TypeWithCallSignature: + return ts2.factory.createIdentifier("Function"); + case ts2.TypeReferenceSerializationKind.Promise: + return ts2.factory.createIdentifier("Promise"); + case ts2.TypeReferenceSerializationKind.ObjectType: + return ts2.factory.createIdentifier("Object"); + default: + return ts2.Debug.assertNever(kind); + } + } + function createCheckedValue(left, right) { + return ts2.factory.createLogicalAnd(ts2.factory.createStrictInequality(ts2.factory.createTypeOfExpression(left), ts2.factory.createStringLiteral("undefined")), right); + } + function serializeEntityNameAsExpressionFallback(node) { + if (node.kind === 79) { + var copied = serializeEntityNameAsExpression(node); + return createCheckedValue(copied, copied); + } + if (node.left.kind === 79) { + return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node)); + } + var left = serializeEntityNameAsExpressionFallback(node.left); + var temp = ts2.factory.createTempVariable(hoistVariableDeclaration); + return ts2.factory.createLogicalAnd(ts2.factory.createLogicalAnd(left.left, ts2.factory.createStrictInequality(ts2.factory.createAssignment(temp, left.right), ts2.factory.createVoidZero())), ts2.factory.createPropertyAccessExpression(temp, node.right)); + } + function serializeEntityNameAsExpression(node) { + switch (node.kind) { + case 79: + var name2 = ts2.setParent(ts2.setTextRange(ts2.parseNodeFactory.cloneNode(node), node), node.parent); + name2.original = void 0; + ts2.setParent(name2, ts2.getParseTreeNode(currentLexicalScope)); + return name2; + case 163: + return serializeQualifiedNameAsExpression(node); + } + } + function serializeQualifiedNameAsExpression(node) { + return ts2.factory.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left), node.right); + } + function getGlobalConstructorWithFallback(name2) { + return ts2.factory.createConditionalExpression( + ts2.factory.createTypeCheck(ts2.factory.createIdentifier(name2), "function"), + /*questionToken*/ + void 0, + ts2.factory.createIdentifier(name2), + /*colonToken*/ + void 0, + ts2.factory.createIdentifier("Object") + ); + } + function getGlobalConstructor(name2, minLanguageVersion) { + return languageVersion < minLanguageVersion ? getGlobalConstructorWithFallback(name2) : ts2.factory.createIdentifier(name2); + } + } + ts2.createRuntimeTypeSerializer = createRuntimeTypeSerializer; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformLegacyDecorators(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + var classAliases; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + var visited = ts2.visitEachChild(node, visitor, context2); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function modifierVisitor(node) { + return ts2.isDecorator(node) ? void 0 : node; + } + function visitor(node) { + if (!(node.transformFlags & 33554432)) { + return node; + } + switch (node.kind) { + case 167: + return void 0; + case 260: + return visitClassDeclaration(node); + case 228: + return visitClassExpression(node); + case 173: + return visitConstructorDeclaration(node); + case 171: + return visitMethodDeclaration(node); + case 175: + return visitSetAccessorDeclaration(node); + case 174: + return visitGetAccessorDeclaration(node); + case 169: + return visitPropertyDeclaration(node); + case 166: + return visitParameterDeclaration(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitClassDeclaration(node) { + if (!(ts2.classOrConstructorParameterIsDecorated(node) || ts2.childIsDecorated(node))) + return ts2.visitEachChild(node, visitor, context2); + var statements = ts2.hasDecorators(node) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + if (statements.length > 1) { + statements.push(factory.createEndOfDeclarationMarker(node)); + ts2.setEmitFlags( + statements[0], + ts2.getEmitFlags(statements[0]) | 4194304 + /* EmitFlags.HasEndOfDeclarationMarker */ + ); + } + return ts2.singleOrMany(statements); + } + function decoratorContainsPrivateIdentifierInExpression(decorator) { + return !!(decorator.transformFlags & 536870912); + } + function parameterDecoratorsContainPrivateIdentifierInExpression(parameterDecorators) { + return ts2.some(parameterDecorators, decoratorContainsPrivateIdentifierInExpression); + } + function hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (!ts2.canHaveDecorators(member)) + continue; + var allDecorators = ts2.getAllDecoratorsOfClassElement(member, node); + if (ts2.some(allDecorators === null || allDecorators === void 0 ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) + return true; + if (ts2.some(allDecorators === null || allDecorators === void 0 ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) + return true; + } + return false; + } + function transformDecoratorsOfClassElements(node, members) { + var decorationStatements = []; + addClassElementDecorationStatements( + decorationStatements, + node, + /*isStatic*/ + false + ); + addClassElementDecorationStatements( + decorationStatements, + node, + /*isStatic*/ + true + ); + if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) { + members = ts2.setTextRange(factory.createNodeArray(__spreadArray9(__spreadArray9([], members, true), [ + factory.createClassStaticBlockDeclaration(factory.createBlock( + decorationStatements, + /*multiLine*/ + true + )) + ], false)), members); + decorationStatements = void 0; + } + return { decorationStatements, members }; + } + function transformClassDeclarationWithoutClassDecorators(node, name2) { + var _a2; + var modifiers = ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier); + var heritageClauses = ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause); + var members = ts2.visitNodes(node.members, visitor, ts2.isClassElement); + var decorationStatements = []; + _a2 = transformDecoratorsOfClassElements(node, members), members = _a2.members, decorationStatements = _a2.decorationStatements; + var updated = factory.updateClassDeclaration( + node, + modifiers, + name2, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + return ts2.addRange([updated], decorationStatements); + } + function transformClassDeclarationWithClassDecorators(node, name2) { + var _a2; + var location2 = ts2.moveRangePastModifiers(node); + var classAlias = getClassAliasIfNeeded(node); + var declName = languageVersion <= 2 ? factory.getInternalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + var heritageClauses = ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause); + var members = ts2.visitNodes(node.members, visitor, ts2.isClassElement); + var decorationStatements = []; + _a2 = transformDecoratorsOfClassElements(node, members), members = _a2.members, decorationStatements = _a2.decorationStatements; + var classExpression = factory.createClassExpression( + /*modifiers*/ + void 0, + name2, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + ts2.setOriginalNode(classExpression, node); + ts2.setTextRange(classExpression, location2); + var statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + declName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classAlias ? factory.createAssignment(classAlias, classExpression) : classExpression + ) + ], + 1 + /* NodeFlags.Let */ + ) + ); + ts2.setOriginalNode(statement, node); + ts2.setTextRange(statement, location2); + ts2.setCommentRange(statement, node); + var statements = [statement]; + ts2.addRange(statements, decorationStatements); + addConstructorDecorationStatement(statements, node); + return statements; + } + function visitClassExpression(node) { + return factory.updateClassExpression( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.name, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause), + ts2.visitNodes(node.members, visitor, ts2.isClassElement) + ); + } + function visitConstructorDeclaration(node) { + return factory.updateConstructorDeclaration(node, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), ts2.visitNodes(node.parameters, visitor, ts2.isParameterDeclaration), ts2.visitNode(node.body, visitor, ts2.isBlock)); + } + function finishClassElement(updated, original) { + if (updated !== original) { + ts2.setCommentRange(updated, original); + ts2.setSourceMapRange(updated, ts2.moveRangePastModifiers(original)); + } + return updated; + } + function visitMethodDeclaration(node) { + return finishClassElement(factory.updateMethodDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.asteriskToken, + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.parameters, visitor, ts2.isParameterDeclaration), + /*type*/ + void 0, + ts2.visitNode(node.body, visitor, ts2.isBlock) + ), node); + } + function visitGetAccessorDeclaration(node) { + return finishClassElement(factory.updateGetAccessorDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + ts2.visitNodes(node.parameters, visitor, ts2.isParameterDeclaration), + /*type*/ + void 0, + ts2.visitNode(node.body, visitor, ts2.isBlock) + ), node); + } + function visitSetAccessorDeclaration(node) { + return finishClassElement(factory.updateSetAccessorDeclaration(node, ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), ts2.visitNode(node.name, visitor, ts2.isPropertyName), ts2.visitNodes(node.parameters, visitor, ts2.isParameterDeclaration), ts2.visitNode(node.body, visitor, ts2.isBlock)), node); + } + function visitPropertyDeclaration(node) { + if (node.flags & 16777216 || ts2.hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + )) { + return void 0; + } + return finishClassElement(factory.updatePropertyDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isExpression) + ), node); + } + function visitParameterDeclaration(node) { + var updated = factory.updateParameterDeclaration( + node, + ts2.elideNodes(factory, node.modifiers), + node.dotDotDotToken, + ts2.visitNode(node.name, visitor, ts2.isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isExpression) + ); + if (updated !== node) { + ts2.setCommentRange(updated, node); + ts2.setTextRange(updated, ts2.moveRangePastModifiers(node)); + ts2.setSourceMapRange(updated, ts2.moveRangePastModifiers(node)); + ts2.setEmitFlags( + updated.name, + 32 + /* EmitFlags.NoTrailingSourceMap */ + ); + } + return updated; + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + var decoratorExpressions = []; + ts2.addRange(decoratorExpressions, ts2.map(allDecorators.decorators, transformDecorator)); + ts2.addRange(decoratorExpressions, ts2.flatMap(allDecorators.parameters, transformDecoratorsOfParameter)); + return decoratorExpressions; + } + function addClassElementDecorationStatements(statements, node, isStatic) { + ts2.addRange(statements, ts2.map(generateClassElementDecorationExpressions(node, isStatic), function(expr) { + return factory.createExpressionStatement(expr); + })); + } + function isDecoratedClassElement(member, isStaticElement, parent2) { + return ts2.nodeOrChildIsDecorated(member, parent2) && isStaticElement === ts2.isStatic(member); + } + function getDecoratedClassElements(node, isStatic) { + return ts2.filter(node.members, function(m7) { + return isDecoratedClassElement(m7, isStatic, node); + }); + } + function generateClassElementDecorationExpressions(node, isStatic) { + var members = getDecoratedClassElements(node, isStatic); + var expressions; + for (var _i = 0, members_8 = members; _i < members_8.length; _i++) { + var member = members_8[_i]; + expressions = ts2.append(expressions, generateClassElementDecorationExpression(node, member)); + } + return expressions; + } + function generateClassElementDecorationExpression(node, member) { + var allDecorators = ts2.getAllDecoratorsOfClassElement(member, node); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + var prefix = getClassMemberPrefix(node, member); + var memberName = getExpressionForPropertyName( + member, + /*generateNameForComputedPropertyName*/ + !ts2.hasSyntacticModifier( + member, + 2 + /* ModifierFlags.Ambient */ + ) + ); + var descriptor = languageVersion > 0 ? ts2.isPropertyDeclaration(member) && !ts2.hasAccessorModifier(member) ? factory.createVoidZero() : factory.createNull() : void 0; + var helper = emitHelpers().createDecorateHelper(decoratorExpressions, prefix, memberName, descriptor); + ts2.setEmitFlags( + helper, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(helper, ts2.moveRangePastModifiers(member)); + return helper; + } + function addConstructorDecorationStatement(statements, node) { + var expression = generateConstructorDecorationExpression(node); + if (expression) { + statements.push(ts2.setOriginalNode(factory.createExpressionStatement(expression), node)); + } + } + function generateConstructorDecorationExpression(node) { + var allDecorators = ts2.getAllDecoratorsOfClass(node); + var decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + var classAlias = classAliases && classAliases[ts2.getOriginalNodeId(node)]; + var localName = languageVersion <= 2 ? factory.getInternalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + var decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName); + var expression = factory.createAssignment(localName, classAlias ? factory.createAssignment(classAlias, decorate) : decorate); + ts2.setEmitFlags( + expression, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(expression, ts2.moveRangePastModifiers(node)); + return expression; + } + function transformDecorator(decorator) { + return ts2.visitNode(decorator.expression, visitor, ts2.isExpression); + } + function transformDecoratorsOfParameter(decorators, parameterOffset) { + var expressions; + if (decorators) { + expressions = []; + for (var _i = 0, decorators_1 = decorators; _i < decorators_1.length; _i++) { + var decorator = decorators_1[_i]; + var helper = emitHelpers().createParamHelper(transformDecorator(decorator), parameterOffset); + ts2.setTextRange(helper, decorator.expression); + ts2.setEmitFlags( + helper, + 1536 + /* EmitFlags.NoComments */ + ); + expressions.push(helper); + } + } + return expressions; + } + function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { + var name2 = member.name; + if (ts2.isPrivateIdentifier(name2)) { + return factory.createIdentifier(""); + } else if (ts2.isComputedPropertyName(name2)) { + return generateNameForComputedPropertyName && !ts2.isSimpleInlineableExpression(name2.expression) ? factory.getGeneratedNameForNode(name2) : name2.expression; + } else if (ts2.isIdentifier(name2)) { + return factory.createStringLiteral(ts2.idText(name2)); + } else { + return factory.cloneNode(name2); + } + } + function enableSubstitutionForClassAliases() { + if (!classAliases) { + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + classAliases = []; + } + } + function getClassAliasIfNeeded(node) { + if (resolver.getNodeCheckFlags(node) & 16777216) { + enableSubstitutionForClassAliases(); + var classAlias = factory.createUniqueName(node.name && !ts2.isGeneratedIdentifier(node.name) ? ts2.idText(node.name) : "default"); + classAliases[ts2.getOriginalNodeId(node)] = classAlias; + hoistVariableDeclaration(classAlias); + return classAlias; + } + } + function getClassPrototype(node) { + return factory.createPropertyAccessExpression(factory.getDeclarationName(node), "prototype"); + } + function getClassMemberPrefix(node, member) { + return ts2.isStatic(member) ? factory.getDeclarationName(node) : getClassPrototype(node); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2; + return (_a2 = trySubstituteClassAlias(node)) !== null && _a2 !== void 0 ? _a2 : node; + } + function trySubstituteClassAlias(node) { + if (classAliases) { + if (resolver.getNodeCheckFlags(node) & 33554432) { + var declaration = resolver.getReferencedValueDeclaration(node); + if (declaration) { + var classAlias = classAliases[declaration.id]; + if (classAlias) { + var clone_3 = factory.cloneNode(classAlias); + ts2.setSourceMapRange(clone_3, node); + ts2.setCommentRange(clone_3, node); + return clone_3; + } + } + } + } + return void 0; + } + } + ts2.transformLegacyDecorators = transformLegacyDecorators; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ES2017SubstitutionFlags; + (function(ES2017SubstitutionFlags2) { + ES2017SubstitutionFlags2[ES2017SubstitutionFlags2["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); + var ContextFlags; + (function(ContextFlags2) { + ContextFlags2[ContextFlags2["NonTopLevel"] = 1] = "NonTopLevel"; + ContextFlags2[ContextFlags2["HasLexicalThis"] = 2] = "HasLexicalThis"; + })(ContextFlags || (ContextFlags = {})); + function transformES2017(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var enabledSubstitutions; + var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; + var capturedSuperProperties; + var hasSuperElementAccess; + var substitutedSuperAccessors = []; + var contextFlags = 0; + var previousOnEmitNode = context2.onEmitNode; + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + setContextFlag(1, false); + setContextFlag(2, !ts2.isEffectiveStrictModeSourceFile(node, compilerOptions)); + var visited = ts2.visitEachChild(node, visitor, context2); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function setContextFlag(flag, val) { + contextFlags = val ? contextFlags | flag : contextFlags & ~flag; + } + function inContext(flags) { + return (contextFlags & flags) !== 0; + } + function inTopLevelContext() { + return !inContext( + 1 + /* ContextFlags.NonTopLevel */ + ); + } + function inHasLexicalThisContext() { + return inContext( + 2 + /* ContextFlags.HasLexicalThis */ + ); + } + function doWithContext(flags, cb, value2) { + var contextFlagsToSet = flags & ~contextFlags; + if (contextFlagsToSet) { + setContextFlag( + contextFlagsToSet, + /*val*/ + true + ); + var result2 = cb(value2); + setContextFlag( + contextFlagsToSet, + /*val*/ + false + ); + return result2; + } + return cb(value2); + } + function visitDefault(node) { + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 256) === 0) { + return node; + } + switch (node.kind) { + case 132: + return void 0; + case 220: + return visitAwaitExpression(node); + case 171: + return doWithContext(1 | 2, visitMethodDeclaration, node); + case 259: + return doWithContext(1 | 2, visitFunctionDeclaration, node); + case 215: + return doWithContext(1 | 2, visitFunctionExpression, node); + case 216: + return doWithContext(1, visitArrowFunction, node); + case 208: + if (capturedSuperProperties && ts2.isPropertyAccessExpression(node) && node.expression.kind === 106) { + capturedSuperProperties.add(node.name.escapedText); + } + return ts2.visitEachChild(node, visitor, context2); + case 209: + if (capturedSuperProperties && node.expression.kind === 106) { + hasSuperElementAccess = true; + } + return ts2.visitEachChild(node, visitor, context2); + case 174: + return doWithContext(1 | 2, visitGetAccessorDeclaration, node); + case 175: + return doWithContext(1 | 2, visitSetAccessorDeclaration, node); + case 173: + return doWithContext(1 | 2, visitConstructorDeclaration, node); + case 260: + case 228: + return doWithContext(1 | 2, visitDefault, node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function asyncBodyVisitor(node) { + if (ts2.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 240: + return visitVariableStatementInAsyncBody(node); + case 245: + return visitForStatementInAsyncBody(node); + case 246: + return visitForInStatementInAsyncBody(node); + case 247: + return visitForOfStatementInAsyncBody(node); + case 295: + return visitCatchClauseInAsyncBody(node); + case 238: + case 252: + case 266: + case 292: + case 293: + case 255: + case 243: + case 244: + case 242: + case 251: + case 253: + return ts2.visitEachChild(node, asyncBodyVisitor, context2); + default: + return ts2.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = new ts2.Set(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function(_6, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = new ts2.Set(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result2 = ts2.visitEachChild(node, asyncBodyVisitor, context2); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result2; + } else { + return ts2.visitEachChild(node, asyncBodyVisitor, context2); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames( + node.declarationList, + /*hasReceiver*/ + false + ); + return expression ? factory.createExpressionStatement(expression) : void 0; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitForInStatementInAsyncBody(node) { + return factory.updateForInStatement(node, isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( + node.initializer, + /*hasReceiver*/ + true + ) : ts2.visitNode(node.initializer, visitor, ts2.isForInitializer), ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, asyncBodyVisitor, context2)); + } + function visitForOfStatementInAsyncBody(node) { + return factory.updateForOfStatement(node, ts2.visitNode(node.awaitModifier, visitor, ts2.isToken), isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( + node.initializer, + /*hasReceiver*/ + true + ) : ts2.visitNode(node.initializer, visitor, ts2.isForInitializer), ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, asyncBodyVisitor, context2)); + } + function visitForStatementInAsyncBody(node) { + var initializer = node.initializer; + return factory.updateForStatement(node, isVariableDeclarationListWithCollidingName(initializer) ? visitVariableDeclarationListWithCollidingNames( + initializer, + /*hasReceiver*/ + false + ) : ts2.visitNode(node.initializer, visitor, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, asyncBodyVisitor, context2)); + } + function visitAwaitExpression(node) { + if (inTopLevelContext()) { + return ts2.visitEachChild(node, visitor, context2); + } + return ts2.setOriginalNode(ts2.setTextRange(factory.createYieldExpression( + /*asteriskToken*/ + void 0, + ts2.visitNode(node.expression, visitor, ts2.isExpression) + ), node), node); + } + function visitConstructorDeclaration(node) { + return factory.updateConstructorDeclaration(node, ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), ts2.visitParameterList(node.parameters, visitor, context2), transformMethodBody(node)); + } + function visitMethodDeclaration(node) { + return factory.updateMethodDeclaration( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + node.asteriskToken, + node.name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.getFunctionFlags(node) & 2 ? transformAsyncFunctionBody(node) : transformMethodBody(node) + ); + } + function visitGetAccessorDeclaration(node) { + return factory.updateGetAccessorDeclaration( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + node.name, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformMethodBody(node) + ); + } + function visitSetAccessorDeclaration(node) { + return factory.updateSetAccessorDeclaration(node, ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), node.name, ts2.visitParameterList(node.parameters, visitor, context2), transformMethodBody(node)); + } + function visitFunctionDeclaration(node) { + return factory.updateFunctionDeclaration( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.getFunctionFlags(node) & 2 ? transformAsyncFunctionBody(node) : ts2.visitFunctionBody(node.body, visitor, context2) + ); + } + function visitFunctionExpression(node) { + return factory.updateFunctionExpression( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + ts2.getFunctionFlags(node) & 2 ? transformAsyncFunctionBody(node) : ts2.visitFunctionBody(node.body, visitor, context2) + ); + } + function visitArrowFunction(node) { + return factory.updateArrowFunction( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifierLike), + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + ts2.getFunctionFlags(node) & 2 ? transformAsyncFunctionBody(node) : ts2.visitFunctionBody(node.body, visitor, context2) + ); + } + function recordDeclarationName(_a2, names) { + var name2 = _a2.name; + if (ts2.isIdentifier(name2)) { + names.add(name2.escapedText); + } else { + for (var _i = 0, _b = name2.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts2.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return !!node && ts2.isVariableDeclarationList(node) && !(node.flags & 3) && node.declarations.some(collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts2.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts2.visitNode(factory.converters.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts2.isExpression); + } + return void 0; + } + return factory.inlineExpressions(ts2.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts2.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a2) { + var name2 = _a2.name; + if (ts2.isIdentifier(name2)) { + hoistVariableDeclaration(name2); + } else { + for (var _i = 0, _b = name2.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts2.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts2.setSourceMapRange(factory.createAssignment(factory.converters.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts2.visitNode(converted, visitor, ts2.isExpression); + } + function collidesWithParameterName(_a2) { + var name2 = _a2.name; + if (ts2.isIdentifier(name2)) { + return enclosingFunctionParameterNames.has(name2.escapedText); + } else { + for (var _i = 0, _b = name2.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts2.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } + function transformMethodBody(node) { + ts2.Debug.assertIsDefined(node.body); + var savedCapturedSuperProperties = capturedSuperProperties; + var savedHasSuperElementAccess = hasSuperElementAccess; + capturedSuperProperties = new ts2.Set(); + hasSuperElementAccess = false; + var updated = ts2.visitFunctionBody(node.body, visitor, context2); + var originalMethod = ts2.getOriginalNode(node, ts2.isFunctionLikeDeclaration); + var emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (4096 | 2048) && (ts2.getFunctionFlags(originalMethod) & 3) !== 3; + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + if (capturedSuperProperties.size) { + var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[ts2.getNodeId(variableStatement)] = true; + var statements = updated.statements.slice(); + ts2.insertStatementsAfterStandardPrologue(statements, [variableStatement]); + updated = factory.updateBlock(updated, statements); + } + if (hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 4096) { + ts2.addEmitHelper(updated, ts2.advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 2048) { + ts2.addEmitHelper(updated, ts2.asyncSuperHelper); + } + } + } + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + return updated; + } + function transformAsyncFunctionBody(node) { + resumeLexicalEnvironment(); + var original = ts2.getOriginalNode(node, ts2.isFunctionLike); + var nodeType = original.type; + var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : void 0; + var isArrowFunction = node.kind === 216; + var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = new ts2.Set(); + for (var _i = 0, _a2 = node.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var savedCapturedSuperProperties = capturedSuperProperties; + var savedHasSuperElementAccess = hasSuperElementAccess; + if (!isArrowFunction) { + capturedSuperProperties = new ts2.Set(); + hasSuperElementAccess = false; + } + var result2; + if (!isArrowFunction) { + var statements = []; + var statementOffset = factory.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + statements.push(factory.createReturnStatement(emitHelpers().createAwaiterHelper(inHasLexicalThisContext(), hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (4096 | 2048); + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + if (capturedSuperProperties.size) { + var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[ts2.getNodeId(variableStatement)] = true; + ts2.insertStatementsAfterStandardPrologue(statements, [variableStatement]); + } + } + var block = factory.createBlock( + statements, + /*multiLine*/ + true + ); + ts2.setTextRange(block, node.body); + if (emitSuperHelpers && hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 4096) { + ts2.addEmitHelper(block, ts2.advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 2048) { + ts2.addEmitHelper(block, ts2.asyncSuperHelper); + } + } + result2 = block; + } else { + var expression = emitHelpers().createAwaiterHelper(inHasLexicalThisContext(), hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); + var declarations = endLexicalEnvironment(); + if (ts2.some(declarations)) { + var block = factory.converters.convertToFunctionBlock(expression); + result2 = factory.updateBlock(block, ts2.setTextRange(factory.createNodeArray(ts2.concatenate(declarations, block.statements)), block.statements)); + } else { + result2 = expression; + } + } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + if (!isArrowFunction) { + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + } + return result2; + } + function transformAsyncFunctionBodyWorker(body, start) { + if (ts2.isBlock(body)) { + return factory.updateBlock(body, ts2.visitNodes(body.statements, asyncBodyVisitor, ts2.isStatement, start)); + } else { + return factory.converters.convertToFunctionBlock(ts2.visitNode(body, asyncBodyVisitor, ts2.isConciseBody)); + } + } + function getPromiseConstructor(type3) { + var typeName = type3 && ts2.getEntityNameFromTypeNode(type3); + if (typeName && ts2.isEntityName(typeName)) { + var serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === ts2.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue || serializationKind === ts2.TypeReferenceSerializationKind.Unknown) { + return typeName; + } + } + return void 0; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 210 + /* SyntaxKind.CallExpression */ + ); + context2.enableSubstitution( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + context2.enableSubstitution( + 209 + /* SyntaxKind.ElementAccessExpression */ + ); + context2.enableEmitNotification( + 260 + /* SyntaxKind.ClassDeclaration */ + ); + context2.enableEmitNotification( + 171 + /* SyntaxKind.MethodDeclaration */ + ); + context2.enableEmitNotification( + 174 + /* SyntaxKind.GetAccessor */ + ); + context2.enableEmitNotification( + 175 + /* SyntaxKind.SetAccessor */ + ); + context2.enableEmitNotification( + 173 + /* SyntaxKind.Constructor */ + ); + context2.enableEmitNotification( + 240 + /* SyntaxKind.VariableStatement */ + ); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } else if (enabledSubstitutions && substitutedSuperAccessors[ts2.getNodeId(node)]) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = 0; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 208: + return substitutePropertyAccessExpression(node); + case 209: + return substituteElementAccessExpression(node); + case 210: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 106) { + return ts2.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), node.name), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 106) { + return createSuperElementAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts2.isSuperProperty(expression)) { + var argumentExpression = ts2.isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); + return factory.createCallExpression( + factory.createPropertyAccessExpression(argumentExpression, "call"), + /*typeArguments*/ + void 0, + __spreadArray9([ + factory.createThis() + ], node.arguments, true) + ); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 260 || kind === 173 || kind === 171 || kind === 174 || kind === 175; + } + function createSuperElementAccessInAsyncMethod(argumentExpression, location2) { + if (enclosingSuperContainerFlags & 4096) { + return ts2.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression( + factory.createUniqueName( + "_superIndex", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*typeArguments*/ + void 0, + [argumentExpression] + ), "value"), location2); + } else { + return ts2.setTextRange(factory.createCallExpression( + factory.createUniqueName( + "_superIndex", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*typeArguments*/ + void 0, + [argumentExpression] + ), location2); + } + } + } + ts2.transformES2017 = transformES2017; + function createSuperAccessVariableStatement(factory, resolver, node, names) { + var hasBinding = (resolver.getNodeCheckFlags(node) & 4096) !== 0; + var accessors = []; + names.forEach(function(_6, key) { + var name2 = ts2.unescapeLeadingUnderscores(key); + var getterAndSetter = []; + getterAndSetter.push(factory.createPropertyAssignment("get", factory.createArrowFunction( + /* modifiers */ + void 0, + /* typeParameters */ + void 0, + /* parameters */ + [], + /* type */ + void 0, + /* equalsGreaterThanToken */ + void 0, + ts2.setEmitFlags( + factory.createPropertyAccessExpression(ts2.setEmitFlags( + factory.createSuper(), + 4 + /* EmitFlags.NoSubstitution */ + ), name2), + 4 + /* EmitFlags.NoSubstitution */ + ) + ))); + if (hasBinding) { + getterAndSetter.push(factory.createPropertyAssignment("set", factory.createArrowFunction( + /* modifiers */ + void 0, + /* typeParameters */ + void 0, + /* parameters */ + [ + factory.createParameterDeclaration( + /* modifiers */ + void 0, + /* dotDotDotToken */ + void 0, + "v", + /* questionToken */ + void 0, + /* type */ + void 0, + /* initializer */ + void 0 + ) + ], + /* type */ + void 0, + /* equalsGreaterThanToken */ + void 0, + factory.createAssignment(ts2.setEmitFlags( + factory.createPropertyAccessExpression(ts2.setEmitFlags( + factory.createSuper(), + 4 + /* EmitFlags.NoSubstitution */ + ), name2), + 4 + /* EmitFlags.NoSubstitution */ + ), factory.createIdentifier("v")) + ))); + } + accessors.push(factory.createPropertyAssignment(name2, factory.createObjectLiteralExpression(getterAndSetter))); + }); + return factory.createVariableStatement( + /* modifiers */ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*exclamationToken*/ + void 0, + /* type */ + void 0, + factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "create"), + /* typeArguments */ + void 0, + [ + factory.createNull(), + factory.createObjectLiteralExpression( + accessors, + /* multiline */ + true + ) + ] + ) + ) + ], + 2 + /* NodeFlags.Const */ + ) + ); + } + ts2.createSuperAccessVariableStatement = createSuperAccessVariableStatement; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ESNextSubstitutionFlags; + (function(ESNextSubstitutionFlags2) { + ESNextSubstitutionFlags2[ESNextSubstitutionFlags2["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; + })(ESNextSubstitutionFlags || (ESNextSubstitutionFlags = {})); + var HierarchyFacts; + (function(HierarchyFacts2) { + HierarchyFacts2[HierarchyFacts2["None"] = 0] = "None"; + HierarchyFacts2[HierarchyFacts2["HasLexicalThis"] = 1] = "HasLexicalThis"; + HierarchyFacts2[HierarchyFacts2["IterationContainer"] = 2] = "IterationContainer"; + HierarchyFacts2[HierarchyFacts2["AncestorFactsMask"] = 3] = "AncestorFactsMask"; + HierarchyFacts2[HierarchyFacts2["SourceFileIncludes"] = 1] = "SourceFileIncludes"; + HierarchyFacts2[HierarchyFacts2["SourceFileExcludes"] = 2] = "SourceFileExcludes"; + HierarchyFacts2[HierarchyFacts2["StrictModeSourceFileIncludes"] = 0] = "StrictModeSourceFileIncludes"; + HierarchyFacts2[HierarchyFacts2["ClassOrFunctionIncludes"] = 1] = "ClassOrFunctionIncludes"; + HierarchyFacts2[HierarchyFacts2["ClassOrFunctionExcludes"] = 2] = "ClassOrFunctionExcludes"; + HierarchyFacts2[HierarchyFacts2["ArrowFunctionIncludes"] = 0] = "ArrowFunctionIncludes"; + HierarchyFacts2[HierarchyFacts2["ArrowFunctionExcludes"] = 2] = "ArrowFunctionExcludes"; + HierarchyFacts2[HierarchyFacts2["IterationStatementIncludes"] = 2] = "IterationStatementIncludes"; + HierarchyFacts2[HierarchyFacts2["IterationStatementExcludes"] = 0] = "IterationStatementExcludes"; + })(HierarchyFacts || (HierarchyFacts = {})); + function transformES2018(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + var exportedVariableStatement = false; + var enabledSubstitutions; + var enclosingFunctionFlags; + var parametersWithPrecedingObjectRestOrSpread; + var enclosingSuperContainerFlags = 0; + var hierarchyFacts = 0; + var currentSourceFile; + var taggedTemplateStringDeclarations; + var capturedSuperProperties; + var hasSuperElementAccess; + var substitutedSuperAccessors = []; + return ts2.chainBundle(context2, transformSourceFile); + function affectsSubtree(excludeFacts, includeFacts) { + return hierarchyFacts !== (hierarchyFacts & ~excludeFacts | includeFacts); + } + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 3; + return ancestorFacts; + } + function exitSubtree(ancestorFacts) { + hierarchyFacts = ancestorFacts; + } + function recordTaggedTemplateString(temp) { + taggedTemplateStringDeclarations = ts2.append(taggedTemplateStringDeclarations, factory.createVariableDeclaration(temp)); + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + var visited = visitSourceFile(node); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + taggedTemplateStringDeclarations = void 0; + return visited; + } + function visitor(node) { + return visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + } + function visitorWithUnusedExpressionResult(node) { + return visitorWorker( + node, + /*expressionResultIsUnused*/ + true + ); + } + function visitorNoAsyncModifier(node) { + if (node.kind === 132) { + return void 0; + } + return node; + } + function doWithHierarchyFacts(cb, value2, excludeFacts, includeFacts) { + if (affectsSubtree(excludeFacts, includeFacts)) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var result2 = cb(value2); + exitSubtree(ancestorFacts); + return result2; + } + return cb(value2); + } + function visitDefault(node) { + return ts2.visitEachChild(node, visitor, context2); + } + function visitorWorker(node, expressionResultIsUnused) { + if ((node.transformFlags & 128) === 0) { + return node; + } + switch (node.kind) { + case 220: + return visitAwaitExpression(node); + case 226: + return visitYieldExpression(node); + case 250: + return visitReturnStatement(node); + case 253: + return visitLabeledStatement(node); + case 207: + return visitObjectLiteralExpression(node); + case 223: + return visitBinaryExpression(node, expressionResultIsUnused); + case 354: + return visitCommaListExpression(node, expressionResultIsUnused); + case 295: + return visitCatchClause(node); + case 240: + return visitVariableStatement(node); + case 257: + return visitVariableDeclaration(node); + case 243: + case 244: + case 246: + return doWithHierarchyFacts( + visitDefault, + node, + 0, + 2 + /* HierarchyFacts.IterationStatementIncludes */ + ); + case 247: + return visitForOfStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 245: + return doWithHierarchyFacts( + visitForStatement, + node, + 0, + 2 + /* HierarchyFacts.IterationStatementIncludes */ + ); + case 219: + return visitVoidExpression(node); + case 173: + return doWithHierarchyFacts( + visitConstructorDeclaration, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 171: + return doWithHierarchyFacts( + visitMethodDeclaration, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 174: + return doWithHierarchyFacts( + visitGetAccessorDeclaration, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 175: + return doWithHierarchyFacts( + visitSetAccessorDeclaration, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 259: + return doWithHierarchyFacts( + visitFunctionDeclaration, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 215: + return doWithHierarchyFacts( + visitFunctionExpression, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + case 216: + return doWithHierarchyFacts( + visitArrowFunction, + node, + 2, + 0 + /* HierarchyFacts.ArrowFunctionIncludes */ + ); + case 166: + return visitParameter(node); + case 241: + return visitExpressionStatement(node); + case 214: + return visitParenthesizedExpression(node, expressionResultIsUnused); + case 212: + return visitTaggedTemplateExpression(node); + case 208: + if (capturedSuperProperties && ts2.isPropertyAccessExpression(node) && node.expression.kind === 106) { + capturedSuperProperties.add(node.name.escapedText); + } + return ts2.visitEachChild(node, visitor, context2); + case 209: + if (capturedSuperProperties && node.expression.kind === 106) { + hasSuperElementAccess = true; + } + return ts2.visitEachChild(node, visitor, context2); + case 260: + case 228: + return doWithHierarchyFacts( + visitDefault, + node, + 2, + 1 + /* HierarchyFacts.ClassOrFunctionIncludes */ + ); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + return ts2.setOriginalNode(ts2.setTextRange( + factory.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper(ts2.visitNode(node.expression, visitor, ts2.isExpression)) + ), + /*location*/ + node + ), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + if (node.asteriskToken) { + var expression = ts2.visitNode(ts2.Debug.checkDefined(node.expression), visitor, ts2.isExpression); + return ts2.setOriginalNode(ts2.setTextRange(factory.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper(factory.updateYieldExpression(node, node.asteriskToken, ts2.setTextRange(emitHelpers().createAsyncDelegatorHelper(ts2.setTextRange(emitHelpers().createAsyncValuesHelper(expression), expression)), expression))) + ), node), node); + } + return ts2.setOriginalNode(ts2.setTextRange(factory.createYieldExpression( + /*asteriskToken*/ + void 0, + createDownlevelAwait(node.expression ? ts2.visitNode(node.expression, visitor, ts2.isExpression) : factory.createVoidZero()) + ), node), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitReturnStatement(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + return factory.updateReturnStatement(node, createDownlevelAwait(node.expression ? ts2.visitNode(node.expression, visitor, ts2.isExpression) : factory.createVoidZero())); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2) { + var statement = ts2.unwrapInnermostStatementOfLabel(node); + if (statement.kind === 247 && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return factory.restoreEnclosingLabel(ts2.visitNode(statement, visitor, ts2.isStatement, factory.liftToBlock), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function chunkObjectLiteralElements(elements) { + var chunkObject; + var objects = []; + for (var _i = 0, elements_5 = elements; _i < elements_5.length; _i++) { + var e10 = elements_5[_i]; + if (e10.kind === 301) { + if (chunkObject) { + objects.push(factory.createObjectLiteralExpression(chunkObject)); + chunkObject = void 0; + } + var target = e10.expression; + objects.push(ts2.visitNode(target, visitor, ts2.isExpression)); + } else { + chunkObject = ts2.append(chunkObject, e10.kind === 299 ? factory.createPropertyAssignment(e10.name, ts2.visitNode(e10.initializer, visitor, ts2.isExpression)) : ts2.visitNode(e10, visitor, ts2.isObjectLiteralElementLike)); + } + } + if (chunkObject) { + objects.push(factory.createObjectLiteralExpression(chunkObject)); + } + return objects; + } + function visitObjectLiteralExpression(node) { + if (node.transformFlags & 65536) { + var objects = chunkObjectLiteralElements(node.properties); + if (objects.length && objects[0].kind !== 207) { + objects.unshift(factory.createObjectLiteralExpression()); + } + var expression = objects[0]; + if (objects.length > 1) { + for (var i7 = 1; i7 < objects.length; i7++) { + expression = emitHelpers().createAssignHelper([expression, objects[i7]]); + } + return expression; + } else { + return emitHelpers().createAssignHelper(objects); + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitExpressionStatement(node) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitParenthesizedExpression(node, expressionResultIsUnused) { + return ts2.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context2); + } + function visitSourceFile(node) { + var ancestorFacts = enterSubtree( + 2, + ts2.isEffectiveStrictModeSourceFile(node, compilerOptions) ? 0 : 1 + /* HierarchyFacts.SourceFileIncludes */ + ); + exportedVariableStatement = false; + var visited = ts2.visitEachChild(node, visitor, context2); + var statement = ts2.concatenate(visited.statements, taggedTemplateStringDeclarations && [ + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(taggedTemplateStringDeclarations) + ) + ]); + var result2 = factory.updateSourceFile(visited, ts2.setTextRange(factory.createNodeArray(statement), node.statements)); + exitSubtree(ancestorFacts); + return result2; + } + function visitTaggedTemplateExpression(node) { + return ts2.processTaggedTemplateExpression(context2, node, visitor, currentSourceFile, recordTaggedTemplateString, ts2.ProcessLevel.LiftRestriction); + } + function visitBinaryExpression(node, expressionResultIsUnused) { + if (ts2.isDestructuringAssignment(node) && node.left.transformFlags & 65536) { + return ts2.flattenDestructuringAssignment(node, visitor, context2, 1, !expressionResultIsUnused); + } + if (node.operatorToken.kind === 27) { + return factory.updateBinaryExpression(node, ts2.visitNode(node.left, visitorWithUnusedExpressionResult, ts2.isExpression), node.operatorToken, ts2.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts2.isExpression)); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, expressionResultIsUnused) { + if (expressionResultIsUnused) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + var result2; + for (var i7 = 0; i7 < node.elements.length; i7++) { + var element = node.elements[i7]; + var visited = ts2.visitNode(element, i7 < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts2.isExpression); + if (result2 || visited !== element) { + result2 || (result2 = node.elements.slice(0, i7)); + result2.push(visited); + } + } + var elements = result2 ? ts2.setTextRange(factory.createNodeArray(result2), node.elements) : node.elements; + return factory.updateCommaListExpression(node, elements); + } + function visitCatchClause(node) { + if (node.variableDeclaration && ts2.isBindingPattern(node.variableDeclaration.name) && node.variableDeclaration.name.transformFlags & 65536) { + var name2 = factory.getGeneratedNameForNode(node.variableDeclaration.name); + var updatedDecl = factory.updateVariableDeclaration( + node.variableDeclaration, + node.variableDeclaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + name2 + ); + var visitedBindings = ts2.flattenDestructuringBinding( + updatedDecl, + visitor, + context2, + 1 + /* FlattenLevel.ObjectRest */ + ); + var block = ts2.visitNode(node.block, visitor, ts2.isBlock); + if (ts2.some(visitedBindings)) { + block = factory.updateBlock(block, __spreadArray9([ + factory.createVariableStatement( + /*modifiers*/ + void 0, + visitedBindings + ) + ], block.statements, true)); + } + return factory.updateCatchClause(node, factory.updateVariableDeclaration( + node.variableDeclaration, + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), block); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitVariableStatement(node) { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + var savedExportedVariableStatement = exportedVariableStatement; + exportedVariableStatement = true; + var visited = ts2.visitEachChild(node, visitor, context2); + exportedVariableStatement = savedExportedVariableStatement; + return visited; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitVariableDeclaration(node) { + if (exportedVariableStatement) { + var savedExportedVariableStatement = exportedVariableStatement; + exportedVariableStatement = false; + var visited = visitVariableDeclarationWorker( + node, + /*exportedVariableStatement*/ + true + ); + exportedVariableStatement = savedExportedVariableStatement; + return visited; + } + return visitVariableDeclarationWorker( + node, + /*exportedVariableStatement*/ + false + ); + } + function visitVariableDeclarationWorker(node, exportedVariableStatement2) { + if (ts2.isBindingPattern(node.name) && node.name.transformFlags & 65536) { + return ts2.flattenDestructuringBinding( + node, + visitor, + context2, + 1, + /*rval*/ + void 0, + exportedVariableStatement2 + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + return factory.updateForStatement(node, ts2.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts2.isExpression), ts2.visitIterationBody(node.statement, visitor, context2)); + } + function visitVoidExpression(node) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitForOfStatement(node, outermostLabeledStatement) { + var ancestorFacts = enterSubtree( + 0, + 2 + /* HierarchyFacts.IterationStatementIncludes */ + ); + if (node.initializer.transformFlags & 65536) { + node = transformForOfStatementWithObjectRest(node); + } + var result2 = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory.restoreEnclosingLabel(ts2.visitEachChild(node, visitor, context2), outermostLabeledStatement); + exitSubtree(ancestorFacts); + return result2; + } + function transformForOfStatementWithObjectRest(node) { + var initializerWithoutParens = ts2.skipParentheses(node.initializer); + if (ts2.isVariableDeclarationList(initializerWithoutParens) || ts2.isAssignmentPattern(initializerWithoutParens)) { + var bodyLocation = void 0; + var statementsLocation = void 0; + var temp = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var statements = [ts2.createForOfBindingStatement(factory, initializerWithoutParens, temp)]; + if (ts2.isBlock(node.statement)) { + ts2.addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } else if (node.statement) { + ts2.append(statements, node.statement); + bodyLocation = node.statement; + statementsLocation = node.statement; + } + return factory.updateForOfStatement(node, node.awaitModifier, ts2.setTextRange(factory.createVariableDeclarationList( + [ + ts2.setTextRange(factory.createVariableDeclaration(temp), node.initializer) + ], + 1 + /* NodeFlags.Let */ + ), node.initializer), node.expression, ts2.setTextRange(factory.createBlock( + ts2.setTextRange(factory.createNodeArray(statements), statementsLocation), + /*multiLine*/ + true + ), bodyLocation)); + } + return node; + } + function convertForOfStatementHead(node, boundValue, nonUserCode) { + var value2 = factory.createTempVariable(hoistVariableDeclaration); + var iteratorValueExpression = factory.createAssignment(value2, boundValue); + var iteratorValueStatement = factory.createExpressionStatement(iteratorValueExpression); + ts2.setSourceMapRange(iteratorValueStatement, node.expression); + var exitNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createFalse()); + var exitNonUserCodeStatement = factory.createExpressionStatement(exitNonUserCodeExpression); + ts2.setSourceMapRange(exitNonUserCodeStatement, node.expression); + var enterNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createTrue()); + var enterNonUserCodeStatement = factory.createExpressionStatement(enterNonUserCodeExpression); + ts2.setSourceMapRange(exitNonUserCodeStatement, node.expression); + var statements = []; + var binding3 = ts2.createForOfBindingStatement(factory, node.initializer, value2); + statements.push(ts2.visitNode(binding3, visitor, ts2.isStatement)); + var bodyLocation; + var statementsLocation; + var statement = ts2.visitIterationBody(node.statement, visitor, context2); + if (ts2.isBlock(statement)) { + ts2.addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } else { + statements.push(statement); + } + var body = ts2.setEmitFlags( + ts2.setTextRange(factory.createBlock( + ts2.setTextRange(factory.createNodeArray(statements), statementsLocation), + /*multiLine*/ + true + ), bodyLocation), + 48 | 384 + /* EmitFlags.NoTokenSourceMaps */ + ); + return factory.createBlock([ + iteratorValueStatement, + exitNonUserCodeStatement, + factory.createTryStatement( + body, + /*catchClause*/ + void 0, + factory.createBlock([ + enterNonUserCodeStatement + ]) + ) + ]); + } + function createDownlevelAwait(expression) { + return enclosingFunctionFlags & 1 ? factory.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper(expression) + ) : factory.createAwaitExpression(expression); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + var iterator = ts2.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var result2 = ts2.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var nonUserCode = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var done = factory.createTempVariable(hoistVariableDeclaration); + var errorRecord = factory.createUniqueName("e"); + var catchVariable = factory.getGeneratedNameForNode(errorRecord); + var returnMethod = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var callValues = ts2.setTextRange(emitHelpers().createAsyncValuesHelper(expression), node.expression); + var callNext = factory.createCallExpression( + factory.createPropertyAccessExpression(iterator, "next"), + /*typeArguments*/ + void 0, + [] + ); + var getDone = factory.createPropertyAccessExpression(result2, "done"); + var getValue2 = factory.createPropertyAccessExpression(result2, "value"); + var callReturn = factory.createFunctionCallCall(returnMethod, iterator, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var initializer = ancestorFacts & 2 ? factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), callValues]) : callValues; + var forStatement = ts2.setEmitFlags( + ts2.setTextRange( + factory.createForStatement( + /*initializer*/ + ts2.setEmitFlags( + ts2.setTextRange(factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + nonUserCode, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createTrue() + ), + ts2.setTextRange(factory.createVariableDeclaration( + iterator, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node.expression), + factory.createVariableDeclaration(result2) + ]), node.expression), + 2097152 + /* EmitFlags.NoHoisting */ + ), + /*condition*/ + factory.inlineExpressions([ + factory.createAssignment(result2, createDownlevelAwait(callNext)), + factory.createAssignment(done, getDone), + factory.createLogicalNot(done) + ]), + /*incrementor*/ + void 0, + /*statement*/ + convertForOfStatementHead(node, getValue2, nonUserCode) + ), + /*location*/ + node + ), + 256 + /* EmitFlags.NoTokenTrailingSourceMaps */ + ); + ts2.setOriginalNode(forStatement, node); + return factory.createTryStatement(factory.createBlock([ + factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement) + ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts2.setEmitFlags( + factory.createBlock([ + factory.createExpressionStatement(factory.createAssignment(errorRecord, factory.createObjectLiteralExpression([ + factory.createPropertyAssignment("error", catchVariable) + ]))) + ]), + 1 + /* EmitFlags.SingleLine */ + )), factory.createBlock([ + factory.createTryStatement( + /*tryBlock*/ + factory.createBlock([ + ts2.setEmitFlags( + factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(factory.createLogicalNot(nonUserCode), factory.createLogicalNot(done)), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, "return"))), factory.createExpressionStatement(createDownlevelAwait(callReturn))), + 1 + /* EmitFlags.SingleLine */ + ) + ]), + /*catchClause*/ + void 0, + /*finallyBlock*/ + ts2.setEmitFlags( + factory.createBlock([ + ts2.setEmitFlags( + factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, "error"))), + 1 + /* EmitFlags.SingleLine */ + ) + ]), + 1 + /* EmitFlags.SingleLine */ + ) + ) + ])); + } + function parameterVisitor(node) { + ts2.Debug.assertNode(node, ts2.isParameter); + return visitParameter(node); + } + function visitParameter(node) { + if (parametersWithPrecedingObjectRestOrSpread === null || parametersWithPrecedingObjectRestOrSpread === void 0 ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) { + return factory.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + ts2.isBindingPattern(node.name) ? factory.getGeneratedNameForNode(node) : node.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + if (node.transformFlags & 65536) { + return factory.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + factory.getGeneratedNameForNode(node), + /*questionToken*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isExpression) + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function collectParametersWithPrecedingObjectRestOrSpread(node) { + var parameters; + for (var _i = 0, _a2 = node.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + if (parameters) { + parameters.add(parameter); + } else if (parameter.transformFlags & 65536) { + parameters = new ts2.Set(); + } + } + return parameters; + } + function visitConstructorDeclaration(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateConstructorDeclaration(node, node.modifiers, ts2.visitParameterList(node.parameters, parameterVisitor, context2), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitGetAccessorDeclaration(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateGetAccessorDeclaration( + node, + node.modifiers, + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + ts2.visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + transformFunctionBody(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitSetAccessorDeclaration(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateSetAccessorDeclaration(node, node.modifiers, ts2.visitNode(node.name, visitor, ts2.isPropertyName), ts2.visitParameterList(node.parameters, parameterVisitor, context2), transformFunctionBody(node)); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitMethodDeclaration(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateMethodDeclaration( + node, + enclosingFunctionFlags & 1 ? ts2.visitNodes(node.modifiers, visitorNoAsyncModifier, ts2.isModifierLike) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + ts2.visitNode(node.name, visitor, ts2.isPropertyName), + ts2.visitNode( + /*questionToken*/ + void 0, + visitor, + ts2.isToken + ), + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitFunctionDeclaration(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateFunctionDeclaration( + node, + enclosingFunctionFlags & 1 ? ts2.visitNodes(node.modifiers, visitorNoAsyncModifier, ts2.isModifier) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitArrowFunction(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateArrowFunction( + node, + node.modifiers, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + transformFunctionBody(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitFunctionExpression(node) { + var savedEnclosingFunctionFlags = enclosingFunctionFlags; + var savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = ts2.getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + var updated = factory.updateFunctionExpression( + node, + enclosingFunctionFlags & 1 ? ts2.visitNodes(node.modifiers, visitorNoAsyncModifier, ts2.isModifier) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function transformAsyncGeneratorFunctionBody(node) { + resumeLexicalEnvironment(); + var statements = []; + var statementOffset = factory.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + appendObjectRestAssignmentsIfNeeded(statements, node); + var savedCapturedSuperProperties = capturedSuperProperties; + var savedHasSuperElementAccess = hasSuperElementAccess; + capturedSuperProperties = new ts2.Set(); + hasSuperElementAccess = false; + var returnStatement = factory.createReturnStatement(emitHelpers().createAsyncGeneratorHelper(factory.createFunctionExpression( + /*modifiers*/ + void 0, + factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), + node.name && factory.getGeneratedNameForNode(node.name), + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory.updateBlock(node.body, ts2.visitLexicalEnvironment(node.body.statements, visitor, context2, statementOffset)) + ), !!(hierarchyFacts & 1))); + var emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (4096 | 2048); + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + var variableStatement = ts2.createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[ts2.getNodeId(variableStatement)] = true; + ts2.insertStatementsAfterStandardPrologue(statements, [variableStatement]); + } + statements.push(returnStatement); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var block = factory.updateBlock(node.body, statements); + if (emitSuperHelpers && hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 4096) { + ts2.addEmitHelper(block, ts2.advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 2048) { + ts2.addEmitHelper(block, ts2.asyncSuperHelper); + } + } + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + return block; + } + function transformFunctionBody(node) { + var _a2; + resumeLexicalEnvironment(); + var statementOffset = 0; + var statements = []; + var body = (_a2 = ts2.visitNode(node.body, visitor, ts2.isConciseBody)) !== null && _a2 !== void 0 ? _a2 : factory.createBlock([]); + if (ts2.isBlock(body)) { + statementOffset = factory.copyPrologue( + body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + } + ts2.addRange(statements, appendObjectRestAssignmentsIfNeeded( + /*statements*/ + void 0, + node + )); + var leadingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || ts2.some(statements) || ts2.some(leadingStatements)) { + var block = factory.converters.convertToFunctionBlock( + body, + /*multiLine*/ + true + ); + ts2.insertStatementsAfterStandardPrologue(statements, leadingStatements); + ts2.addRange(statements, block.statements.slice(statementOffset)); + return factory.updateBlock(block, ts2.setTextRange(factory.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { + var containsPrecedingObjectRestOrSpread = false; + for (var _i = 0, _a2 = node.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + if (containsPrecedingObjectRestOrSpread) { + if (ts2.isBindingPattern(parameter.name)) { + if (parameter.name.elements.length > 0) { + var declarations = ts2.flattenDestructuringBinding(parameter, visitor, context2, 0, factory.getGeneratedNameForNode(parameter)); + if (ts2.some(declarations)) { + var declarationList = factory.createVariableDeclarationList(declarations); + var statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + ); + ts2.setEmitFlags( + statement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + statements = ts2.append(statements, statement); + } + } else if (parameter.initializer) { + var name2 = factory.getGeneratedNameForNode(parameter); + var initializer = ts2.visitNode(parameter.initializer, visitor, ts2.isExpression); + var assignment = factory.createAssignment(name2, initializer); + var statement = factory.createExpressionStatement(assignment); + ts2.setEmitFlags( + statement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + statements = ts2.append(statements, statement); + } + } else if (parameter.initializer) { + var name2 = factory.cloneNode(parameter.name); + ts2.setTextRange(name2, parameter.name); + ts2.setEmitFlags( + name2, + 48 + /* EmitFlags.NoSourceMap */ + ); + var initializer = ts2.visitNode(parameter.initializer, visitor, ts2.isExpression); + ts2.addEmitFlags( + initializer, + 48 | 1536 + /* EmitFlags.NoComments */ + ); + var assignment = factory.createAssignment(name2, initializer); + ts2.setTextRange(assignment, parameter); + ts2.setEmitFlags( + assignment, + 1536 + /* EmitFlags.NoComments */ + ); + var block = factory.createBlock([factory.createExpressionStatement(assignment)]); + ts2.setTextRange(block, parameter); + ts2.setEmitFlags( + block, + 1 | 32 | 384 | 1536 + /* EmitFlags.NoComments */ + ); + var typeCheck = factory.createTypeCheck(factory.cloneNode(parameter.name), "undefined"); + var statement = factory.createIfStatement(typeCheck, block); + ts2.startOnNewLine(statement); + ts2.setTextRange(statement, parameter); + ts2.setEmitFlags( + statement, + 384 | 32 | 1048576 | 1536 + /* EmitFlags.NoComments */ + ); + statements = ts2.append(statements, statement); + } + } else if (parameter.transformFlags & 65536) { + containsPrecedingObjectRestOrSpread = true; + var declarations = ts2.flattenDestructuringBinding( + parameter, + visitor, + context2, + 1, + factory.getGeneratedNameForNode(parameter), + /*doNotRecordTempVariablesInLine*/ + false, + /*skipInitializer*/ + true + ); + if (ts2.some(declarations)) { + var declarationList = factory.createVariableDeclarationList(declarations); + var statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + ); + ts2.setEmitFlags( + statement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + statements = ts2.append(statements, statement); + } + } + } + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 210 + /* SyntaxKind.CallExpression */ + ); + context2.enableSubstitution( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + context2.enableSubstitution( + 209 + /* SyntaxKind.ElementAccessExpression */ + ); + context2.enableEmitNotification( + 260 + /* SyntaxKind.ClassDeclaration */ + ); + context2.enableEmitNotification( + 171 + /* SyntaxKind.MethodDeclaration */ + ); + context2.enableEmitNotification( + 174 + /* SyntaxKind.GetAccessor */ + ); + context2.enableEmitNotification( + 175 + /* SyntaxKind.SetAccessor */ + ); + context2.enableEmitNotification( + 173 + /* SyntaxKind.Constructor */ + ); + context2.enableEmitNotification( + 240 + /* SyntaxKind.VariableStatement */ + ); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 | 4096); + if (superContainerFlags !== enclosingSuperContainerFlags) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } else if (enabledSubstitutions && substitutedSuperAccessors[ts2.getNodeId(node)]) { + var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = 0; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 208: + return substitutePropertyAccessExpression(node); + case 209: + return substituteElementAccessExpression(node); + case 210: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 106) { + return ts2.setTextRange(factory.createPropertyAccessExpression(factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), node.name), node); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 106) { + return createSuperElementAccessInAsyncMethod(node.argumentExpression, node); + } + return node; + } + function substituteCallExpression(node) { + var expression = node.expression; + if (ts2.isSuperProperty(expression)) { + var argumentExpression = ts2.isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); + return factory.createCallExpression( + factory.createPropertyAccessExpression(argumentExpression, "call"), + /*typeArguments*/ + void 0, + __spreadArray9([ + factory.createThis() + ], node.arguments, true) + ); + } + return node; + } + function isSuperContainer(node) { + var kind = node.kind; + return kind === 260 || kind === 173 || kind === 171 || kind === 174 || kind === 175; + } + function createSuperElementAccessInAsyncMethod(argumentExpression, location2) { + if (enclosingSuperContainerFlags & 4096) { + return ts2.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression( + factory.createIdentifier("_superIndex"), + /*typeArguments*/ + void 0, + [argumentExpression] + ), "value"), location2); + } else { + return ts2.setTextRange(factory.createCallExpression( + factory.createIdentifier("_superIndex"), + /*typeArguments*/ + void 0, + [argumentExpression] + ), location2); + } + } + } + ts2.transformES2018 = transformES2018; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformES2019(context2) { + var factory = context2.factory; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 64) === 0) { + return node; + } + switch (node.kind) { + case 295: + return visitCatchClause(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return factory.updateCatchClause(node, factory.createVariableDeclaration(factory.createTempVariable( + /*recordTempVariable*/ + void 0 + )), ts2.visitNode(node.block, visitor, ts2.isBlock)); + } + return ts2.visitEachChild(node, visitor, context2); + } + } + ts2.transformES2019 = transformES2019; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformES2020(context2) { + var factory = context2.factory, hoistVariableDeclaration = context2.hoistVariableDeclaration; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 32) === 0) { + return node; + } + switch (node.kind) { + case 210: { + var updated = visitNonOptionalCallExpression( + node, + /*captureThisArg*/ + false + ); + ts2.Debug.assertNotNode(updated, ts2.isSyntheticReference); + return updated; + } + case 208: + case 209: + if (ts2.isOptionalChain(node)) { + var updated = visitOptionalExpression( + node, + /*captureThisArg*/ + false, + /*isDelete*/ + false + ); + ts2.Debug.assertNotNode(updated, ts2.isSyntheticReference); + return updated; + } + return ts2.visitEachChild(node, visitor, context2); + case 223: + if (node.operatorToken.kind === 60) { + return transformNullishCoalescingExpression(node); + } + return ts2.visitEachChild(node, visitor, context2); + case 217: + return visitDeleteExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function flattenChain(chain3) { + ts2.Debug.assertNotNode(chain3, ts2.isNonNullChain); + var links = [chain3]; + while (!chain3.questionDotToken && !ts2.isTaggedTemplateExpression(chain3)) { + chain3 = ts2.cast(ts2.skipPartiallyEmittedExpressions(chain3.expression), ts2.isOptionalChain); + ts2.Debug.assertNotNode(chain3, ts2.isNonNullChain); + links.unshift(chain3); + } + return { expression: chain3.expression, chain: links }; + } + function visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete) { + var expression = visitNonOptionalExpression(node.expression, captureThisArg, isDelete); + if (ts2.isSyntheticReference(expression)) { + return factory.createSyntheticReferenceExpression(factory.updateParenthesizedExpression(node, expression.expression), expression.thisArg); + } + return factory.updateParenthesizedExpression(node, expression); + } + function visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete) { + if (ts2.isOptionalChain(node)) { + return visitOptionalExpression(node, captureThisArg, isDelete); + } + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + ts2.Debug.assertNotNode(expression, ts2.isSyntheticReference); + var thisArg; + if (captureThisArg) { + if (!ts2.isSimpleCopiableExpression(expression)) { + thisArg = factory.createTempVariable(hoistVariableDeclaration); + expression = factory.createAssignment(thisArg, expression); + } else { + thisArg = expression; + } + } + expression = node.kind === 208 ? factory.updatePropertyAccessExpression(node, expression, ts2.visitNode(node.name, visitor, ts2.isIdentifier)) : factory.updateElementAccessExpression(node, expression, ts2.visitNode(node.argumentExpression, visitor, ts2.isExpression)); + return thisArg ? factory.createSyntheticReferenceExpression(expression, thisArg) : expression; + } + function visitNonOptionalCallExpression(node, captureThisArg) { + if (ts2.isOptionalChain(node)) { + return visitOptionalExpression( + node, + captureThisArg, + /*isDelete*/ + false + ); + } + if (ts2.isParenthesizedExpression(node.expression) && ts2.isOptionalChain(ts2.skipParentheses(node.expression))) { + var expression = visitNonOptionalParenthesizedExpression( + node.expression, + /*captureThisArg*/ + true, + /*isDelete*/ + false + ); + var args = ts2.visitNodes(node.arguments, visitor, ts2.isExpression); + if (ts2.isSyntheticReference(expression)) { + return ts2.setTextRange(factory.createFunctionCallCall(expression.expression, expression.thisArg, args), node); + } + return factory.updateCallExpression( + node, + expression, + /*typeArguments*/ + void 0, + args + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitNonOptionalExpression(node, captureThisArg, isDelete) { + switch (node.kind) { + case 214: + return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 208: + case 209: + return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 210: + return visitNonOptionalCallExpression(node, captureThisArg); + default: + return ts2.visitNode(node, visitor, ts2.isExpression); + } + } + function visitOptionalExpression(node, captureThisArg, isDelete) { + var _a2 = flattenChain(node), expression = _a2.expression, chain3 = _a2.chain; + var left = visitNonOptionalExpression( + ts2.skipPartiallyEmittedExpressions(expression), + ts2.isCallChain(chain3[0]), + /*isDelete*/ + false + ); + var leftThisArg = ts2.isSyntheticReference(left) ? left.thisArg : void 0; + var capturedLeft = ts2.isSyntheticReference(left) ? left.expression : left; + var leftExpression = factory.restoreOuterExpressions( + expression, + capturedLeft, + 8 + /* OuterExpressionKinds.PartiallyEmittedExpressions */ + ); + if (!ts2.isSimpleCopiableExpression(capturedLeft)) { + capturedLeft = factory.createTempVariable(hoistVariableDeclaration); + leftExpression = factory.createAssignment(capturedLeft, leftExpression); + } + var rightExpression = capturedLeft; + var thisArg; + for (var i7 = 0; i7 < chain3.length; i7++) { + var segment = chain3[i7]; + switch (segment.kind) { + case 208: + case 209: + if (i7 === chain3.length - 1 && captureThisArg) { + if (!ts2.isSimpleCopiableExpression(rightExpression)) { + thisArg = factory.createTempVariable(hoistVariableDeclaration); + rightExpression = factory.createAssignment(thisArg, rightExpression); + } else { + thisArg = rightExpression; + } + } + rightExpression = segment.kind === 208 ? factory.createPropertyAccessExpression(rightExpression, ts2.visitNode(segment.name, visitor, ts2.isIdentifier)) : factory.createElementAccessExpression(rightExpression, ts2.visitNode(segment.argumentExpression, visitor, ts2.isExpression)); + break; + case 210: + if (i7 === 0 && leftThisArg) { + if (!ts2.isGeneratedIdentifier(leftThisArg)) { + leftThisArg = factory.cloneNode(leftThisArg); + ts2.addEmitFlags( + leftThisArg, + 1536 + /* EmitFlags.NoComments */ + ); + } + rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 106 ? factory.createThis() : leftThisArg, ts2.visitNodes(segment.arguments, visitor, ts2.isExpression)); + } else { + rightExpression = factory.createCallExpression( + rightExpression, + /*typeArguments*/ + void 0, + ts2.visitNodes(segment.arguments, visitor, ts2.isExpression) + ); + } + break; + } + ts2.setOriginalNode(rightExpression, segment); + } + var target = isDelete ? factory.createConditionalExpression( + createNotNullCondition( + leftExpression, + capturedLeft, + /*invert*/ + true + ), + /*questionToken*/ + void 0, + factory.createTrue(), + /*colonToken*/ + void 0, + factory.createDeleteExpression(rightExpression) + ) : factory.createConditionalExpression( + createNotNullCondition( + leftExpression, + capturedLeft, + /*invert*/ + true + ), + /*questionToken*/ + void 0, + factory.createVoidZero(), + /*colonToken*/ + void 0, + rightExpression + ); + ts2.setTextRange(target, node); + return thisArg ? factory.createSyntheticReferenceExpression(target, thisArg) : target; + } + function createNotNullCondition(left, right, invert2) { + return factory.createBinaryExpression(factory.createBinaryExpression(left, factory.createToken( + invert2 ? 36 : 37 + /* SyntaxKind.ExclamationEqualsEqualsToken */ + ), factory.createNull()), factory.createToken( + invert2 ? 56 : 55 + /* SyntaxKind.AmpersandAmpersandToken */ + ), factory.createBinaryExpression(right, factory.createToken( + invert2 ? 36 : 37 + /* SyntaxKind.ExclamationEqualsEqualsToken */ + ), factory.createVoidZero())); + } + function transformNullishCoalescingExpression(node) { + var left = ts2.visitNode(node.left, visitor, ts2.isExpression); + var right = left; + if (!ts2.isSimpleCopiableExpression(left)) { + right = factory.createTempVariable(hoistVariableDeclaration); + left = factory.createAssignment(right, left); + } + return ts2.setTextRange(factory.createConditionalExpression( + createNotNullCondition(left, right), + /*questionToken*/ + void 0, + right, + /*colonToken*/ + void 0, + ts2.visitNode(node.right, visitor, ts2.isExpression) + ), node); + } + function visitDeleteExpression(node) { + return ts2.isOptionalChain(ts2.skipParentheses(node.expression)) ? ts2.setOriginalNode(visitNonOptionalExpression( + node.expression, + /*captureThisArg*/ + false, + /*isDelete*/ + true + ), node) : factory.updateDeleteExpression(node, ts2.visitNode(node.expression, visitor, ts2.isExpression)); + } + } + ts2.transformES2020 = transformES2020; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformES2021(context2) { + var hoistVariableDeclaration = context2.hoistVariableDeclaration, factory = context2.factory; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 16) === 0) { + return node; + } + switch (node.kind) { + case 223: + var binaryExpression = node; + if (ts2.isLogicalOrCoalescingAssignmentExpression(binaryExpression)) { + return transformLogicalAssignment(binaryExpression); + } + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function transformLogicalAssignment(binaryExpression) { + var operator = binaryExpression.operatorToken; + var nonAssignmentOperator = ts2.getNonAssignmentOperatorForCompoundAssignment(operator.kind); + var left = ts2.skipParentheses(ts2.visitNode(binaryExpression.left, visitor, ts2.isLeftHandSideExpression)); + var assignmentTarget = left; + var right = ts2.skipParentheses(ts2.visitNode(binaryExpression.right, visitor, ts2.isExpression)); + if (ts2.isAccessExpression(left)) { + var propertyAccessTargetSimpleCopiable = ts2.isSimpleCopiableExpression(left.expression); + var propertyAccessTarget = propertyAccessTargetSimpleCopiable ? left.expression : factory.createTempVariable(hoistVariableDeclaration); + var propertyAccessTargetAssignment = propertyAccessTargetSimpleCopiable ? left.expression : factory.createAssignment(propertyAccessTarget, left.expression); + if (ts2.isPropertyAccessExpression(left)) { + assignmentTarget = factory.createPropertyAccessExpression(propertyAccessTarget, left.name); + left = factory.createPropertyAccessExpression(propertyAccessTargetAssignment, left.name); + } else { + var elementAccessArgumentSimpleCopiable = ts2.isSimpleCopiableExpression(left.argumentExpression); + var elementAccessArgument = elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory.createTempVariable(hoistVariableDeclaration); + assignmentTarget = factory.createElementAccessExpression(propertyAccessTarget, elementAccessArgument); + left = factory.createElementAccessExpression(propertyAccessTargetAssignment, elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory.createAssignment(elementAccessArgument, left.argumentExpression)); + } + } + return factory.createBinaryExpression(left, nonAssignmentOperator, factory.createParenthesizedExpression(factory.createAssignment(assignmentTarget, right))); + } + } + ts2.transformES2021 = transformES2021; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformESNext(context2) { + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 4) === 0) { + return node; + } + switch (node.kind) { + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + } + ts2.transformESNext = transformESNext; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformJsx(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory; + var compilerOptions = context2.getCompilerOptions(); + var currentSourceFile; + var currentFileState; + return ts2.chainBundle(context2, transformSourceFile); + function getCurrentFileNameExpression() { + if (currentFileState.filenameDeclaration) { + return currentFileState.filenameDeclaration.name; + } + var declaration = factory.createVariableDeclaration( + factory.createUniqueName( + "_jsxFileName", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*exclaimationToken*/ + void 0, + /*type*/ + void 0, + factory.createStringLiteral(currentSourceFile.fileName) + ); + currentFileState.filenameDeclaration = declaration; + return currentFileState.filenameDeclaration.name; + } + function getJsxFactoryCalleePrimitive(isStaticChildren) { + return compilerOptions.jsx === 5 ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx"; + } + function getJsxFactoryCallee(isStaticChildren) { + var type3 = getJsxFactoryCalleePrimitive(isStaticChildren); + return getImplicitImportForName(type3); + } + function getImplicitJsxFragmentReference() { + return getImplicitImportForName("Fragment"); + } + function getImplicitImportForName(name2) { + var _a2, _b; + var importSource = name2 === "createElement" ? currentFileState.importSpecifier : ts2.getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); + var existing = (_b = (_a2 = currentFileState.utilizedImplicitRuntimeImports) === null || _a2 === void 0 ? void 0 : _a2.get(importSource)) === null || _b === void 0 ? void 0 : _b.get(name2); + if (existing) { + return existing.name; + } + if (!currentFileState.utilizedImplicitRuntimeImports) { + currentFileState.utilizedImplicitRuntimeImports = new ts2.Map(); + } + var specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); + if (!specifierSourceImports) { + specifierSourceImports = new ts2.Map(); + currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); + } + var generatedName = factory.createUniqueName( + "_".concat(name2), + 16 | 32 | 64 + /* GeneratedIdentifierFlags.AllowNameSubstitution */ + ); + var specifier = factory.createImportSpecifier( + /*isTypeOnly*/ + false, + factory.createIdentifier(name2), + generatedName + ); + generatedName.generatedImportReference = specifier; + specifierSourceImports.set(name2, specifier); + return generatedName; + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + currentFileState = {}; + currentFileState.importSpecifier = ts2.getJSXImplicitImportBase(compilerOptions, node); + var visited = ts2.visitEachChild(node, visitor, context2); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + var statements = visited.statements; + if (currentFileState.filenameDeclaration) { + statements = ts2.insertStatementAfterCustomPrologue(statements.slice(), factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [currentFileState.filenameDeclaration], + 2 + /* NodeFlags.Const */ + ) + )); + } + if (currentFileState.utilizedImplicitRuntimeImports) { + for (var _i = 0, _a2 = ts2.arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries()); _i < _a2.length; _i++) { + var _b = _a2[_i], importSource = _b[0], importSpecifiersMap = _b[1]; + if (ts2.isExternalModule(node)) { + var importStatement = factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*typeOnly*/ + false, + /*name*/ + void 0, + factory.createNamedImports(ts2.arrayFrom(importSpecifiersMap.values())) + ), + factory.createStringLiteral(importSource), + /*assertClause*/ + void 0 + ); + ts2.setParentRecursive( + importStatement, + /*incremental*/ + false + ); + statements = ts2.insertStatementAfterCustomPrologue(statements.slice(), importStatement); + } else if (ts2.isExternalOrCommonJsModule(node)) { + var requireStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + factory.createObjectBindingPattern(ts2.map(ts2.arrayFrom(importSpecifiersMap.values()), function(s7) { + return factory.createBindingElement( + /*dotdotdot*/ + void 0, + s7.propertyName, + s7.name + ); + })), + /*exclaimationToken*/ + void 0, + /*type*/ + void 0, + factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [factory.createStringLiteral(importSource)] + ) + ) + ], + 2 + /* NodeFlags.Const */ + ) + ); + ts2.setParentRecursive( + requireStatement, + /*incremental*/ + false + ); + statements = ts2.insertStatementAfterCustomPrologue(statements.slice(), requireStatement); + } else { + } + } + } + if (statements !== visited.statements) { + visited = factory.updateSourceFile(visited, statements); + } + currentFileState = void 0; + return visited; + } + function visitor(node) { + if (node.transformFlags & 2) { + return visitorWorker(node); + } else { + return node; + } + } + function visitorWorker(node) { + switch (node.kind) { + case 281: + return visitJsxElement( + node, + /*isChild*/ + false + ); + case 282: + return visitJsxSelfClosingElement( + node, + /*isChild*/ + false + ); + case 285: + return visitJsxFragment( + node, + /*isChild*/ + false + ); + case 291: + return visitJsxExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function transformJsxChildToExpression(node) { + switch (node.kind) { + case 11: + return visitJsxText(node); + case 291: + return visitJsxExpression(node); + case 281: + return visitJsxElement( + node, + /*isChild*/ + true + ); + case 282: + return visitJsxSelfClosingElement( + node, + /*isChild*/ + true + ); + case 285: + return visitJsxFragment( + node, + /*isChild*/ + true + ); + default: + return ts2.Debug.failBadSyntaxKind(node); + } + } + function hasKeyAfterPropsSpread(node) { + var spread2 = false; + for (var _i = 0, _a2 = node.attributes.properties; _i < _a2.length; _i++) { + var elem = _a2[_i]; + if (ts2.isJsxSpreadAttribute(elem)) { + spread2 = true; + } else if (spread2 && ts2.isJsxAttribute(elem) && elem.name.escapedText === "key") { + return true; + } + } + return false; + } + function shouldUseCreateElement(node) { + return currentFileState.importSpecifier === void 0 || hasKeyAfterPropsSpread(node); + } + function visitJsxElement(node, isChild) { + var tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; + return tagTransform( + node.openingElement, + node.children, + isChild, + /*location*/ + node + ); + } + function visitJsxSelfClosingElement(node, isChild) { + var tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; + return tagTransform( + node, + /*children*/ + void 0, + isChild, + /*location*/ + node + ); + } + function visitJsxFragment(node, isChild) { + var tagTransform = currentFileState.importSpecifier === void 0 ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; + return tagTransform( + node.openingFragment, + node.children, + isChild, + /*location*/ + node + ); + } + function convertJsxChildrenToChildrenPropObject(children) { + var prop = convertJsxChildrenToChildrenPropAssignment(children); + return prop && factory.createObjectLiteralExpression([prop]); + } + function convertJsxChildrenToChildrenPropAssignment(children) { + var nonWhitespaceChildren = ts2.getSemanticJsxChildren(children); + if (ts2.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) { + var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]); + return result_13 && factory.createPropertyAssignment("children", result_13); + } + var result2 = ts2.mapDefined(children, transformJsxChildToExpression); + return ts2.length(result2) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result2)) : void 0; + } + function visitJsxOpeningLikeElementJSX(node, children, isChild, location2) { + var tagName = getTagName(node); + var childrenProp = children && children.length ? convertJsxChildrenToChildrenPropAssignment(children) : void 0; + var keyAttr = ts2.find(node.attributes.properties, function(p7) { + return !!p7.name && ts2.isIdentifier(p7.name) && p7.name.escapedText === "key"; + }); + var attrs = keyAttr ? ts2.filter(node.attributes.properties, function(p7) { + return p7 !== keyAttr; + }) : node.attributes.properties; + var objectProperties = ts2.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) : factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts2.emptyArray); + return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts2.emptyArray, isChild, location2); + } + function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location2) { + var _a2; + var nonWhitespaceChildren = ts2.getSemanticJsxChildren(children); + var isStaticChildren = ts2.length(nonWhitespaceChildren) > 1 || !!((_a2 = nonWhitespaceChildren[0]) === null || _a2 === void 0 ? void 0 : _a2.dotDotDotToken); + var args = [tagName, objectProperties]; + if (keyAttr) { + args.push(transformJsxAttributeInitializer(keyAttr.initializer)); + } + if (compilerOptions.jsx === 5) { + var originalFile = ts2.getOriginalNode(currentSourceFile); + if (originalFile && ts2.isSourceFile(originalFile)) { + if (keyAttr === void 0) { + args.push(factory.createVoidZero()); + } + args.push(isStaticChildren ? factory.createTrue() : factory.createFalse()); + var lineCol = ts2.getLineAndCharacterOfPosition(originalFile, location2.pos); + args.push(factory.createObjectLiteralExpression([ + factory.createPropertyAssignment("fileName", getCurrentFileNameExpression()), + factory.createPropertyAssignment("lineNumber", factory.createNumericLiteral(lineCol.line + 1)), + factory.createPropertyAssignment("columnNumber", factory.createNumericLiteral(lineCol.character + 1)) + ])); + args.push(factory.createThis()); + } + } + var element = ts2.setTextRange(factory.createCallExpression( + getJsxFactoryCallee(isStaticChildren), + /*typeArguments*/ + void 0, + args + ), location2); + if (isChild) { + ts2.startOnNewLine(element); + } + return element; + } + function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location2) { + var tagName = getTagName(node); + var attrs = node.attributes.properties; + var objectProperties = ts2.length(attrs) ? transformJsxAttributesToObjectProps(attrs) : factory.createNull(); + var callee = currentFileState.importSpecifier === void 0 ? ts2.createJsxFactoryExpression( + factory, + context2.getEmitResolver().getJsxFactoryEntity(currentSourceFile), + compilerOptions.reactNamespace, + // TODO: GH#18217 + node + ) : getImplicitImportForName("createElement"); + var element = ts2.createExpressionForJsxElement(factory, callee, tagName, objectProperties, ts2.mapDefined(children, transformJsxChildToExpression), location2); + if (isChild) { + ts2.startOnNewLine(element); + } + return element; + } + function visitJsxOpeningFragmentJSX(_node, children, isChild, location2) { + var childrenProps; + if (children && children.length) { + var result2 = convertJsxChildrenToChildrenPropObject(children); + if (result2) { + childrenProps = result2; + } + } + return visitJsxOpeningLikeElementOrFragmentJSX( + getImplicitJsxFragmentReference(), + childrenProps || factory.createObjectLiteralExpression([]), + /*keyAttr*/ + void 0, + children, + isChild, + location2 + ); + } + function visitJsxOpeningFragmentCreateElement(node, children, isChild, location2) { + var element = ts2.createExpressionForJsxFragment( + factory, + context2.getEmitResolver().getJsxFactoryEntity(currentSourceFile), + context2.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), + compilerOptions.reactNamespace, + // TODO: GH#18217 + ts2.mapDefined(children, transformJsxChildToExpression), + node, + location2 + ); + if (isChild) { + ts2.startOnNewLine(element); + } + return element; + } + function transformJsxSpreadAttributeToSpreadAssignment(node) { + return factory.createSpreadAssignment(ts2.visitNode(node.expression, visitor, ts2.isExpression)); + } + function transformJsxAttributesToObjectProps(attrs, children) { + var target = ts2.getEmitScriptTarget(compilerOptions); + return target && target >= 5 ? factory.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children); + } + function transformJsxAttributesToProps(attrs, children) { + var props = ts2.flatten(ts2.spanMap(attrs, ts2.isJsxSpreadAttribute, function(attrs2, isSpread) { + return ts2.map(attrs2, function(attr) { + return isSpread ? transformJsxSpreadAttributeToSpreadAssignment(attr) : transformJsxAttributeToObjectLiteralElement(attr); + }); + })); + if (children) { + props.push(children); + } + return props; + } + function transformJsxAttributesToExpression(attrs, children) { + var expressions = ts2.flatten(ts2.spanMap(attrs, ts2.isJsxSpreadAttribute, function(attrs2, isSpread) { + return isSpread ? ts2.map(attrs2, transformJsxSpreadAttributeToExpression) : factory.createObjectLiteralExpression(ts2.map(attrs2, transformJsxAttributeToObjectLiteralElement)); + })); + if (ts2.isJsxSpreadAttribute(attrs[0])) { + expressions.unshift(factory.createObjectLiteralExpression()); + } + if (children) { + expressions.push(factory.createObjectLiteralExpression([children])); + } + return ts2.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); + } + function transformJsxSpreadAttributeToExpression(node) { + return ts2.visitNode(node.expression, visitor, ts2.isExpression); + } + function transformJsxAttributeToObjectLiteralElement(node) { + var name2 = getAttributeName(node); + var expression = transformJsxAttributeInitializer(node.initializer); + return factory.createPropertyAssignment(name2, expression); + } + function transformJsxAttributeInitializer(node) { + if (node === void 0) { + return factory.createTrue(); + } + if (node.kind === 10) { + var singleQuote2 = node.singleQuote !== void 0 ? node.singleQuote : !ts2.isStringDoubleQuoted(node, currentSourceFile); + var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote2); + return ts2.setTextRange(literal, node); + } + if (node.kind === 291) { + if (node.expression === void 0) { + return factory.createTrue(); + } + return ts2.visitNode(node.expression, visitor, ts2.isExpression); + } + if (ts2.isJsxElement(node)) { + return visitJsxElement( + node, + /*isChild*/ + false + ); + } + if (ts2.isJsxSelfClosingElement(node)) { + return visitJsxSelfClosingElement( + node, + /*isChild*/ + false + ); + } + if (ts2.isJsxFragment(node)) { + return visitJsxFragment( + node, + /*isChild*/ + false + ); + } + return ts2.Debug.failBadSyntaxKind(node); + } + function visitJsxText(node) { + var fixed = fixupWhitespaceAndDecodeEntities(node.text); + return fixed === void 0 ? void 0 : factory.createStringLiteral(fixed); + } + function fixupWhitespaceAndDecodeEntities(text) { + var acc; + var firstNonWhitespace = 0; + var lastNonWhitespace = -1; + for (var i7 = 0; i7 < text.length; i7++) { + var c7 = text.charCodeAt(i7); + if (ts2.isLineBreak(c7)) { + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); + } + firstNonWhitespace = -1; + } else if (!ts2.isWhiteSpaceSingleLine(c7)) { + lastNonWhitespace = i7; + if (firstNonWhitespace === -1) { + firstNonWhitespace = i7; + } + } + } + return firstNonWhitespace !== -1 ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) : acc; + } + function addLineOfJsxText(acc, trimmedLine) { + var decoded = decodeEntities(trimmedLine); + return acc === void 0 ? decoded : acc + " " + decoded; + } + function decodeEntities(text) { + return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, function(match, _all, _number, _digits, decimal, hex, word) { + if (decimal) { + return ts2.utf16EncodeAsString(parseInt(decimal, 10)); + } else if (hex) { + return ts2.utf16EncodeAsString(parseInt(hex, 16)); + } else { + var ch = entities.get(word); + return ch ? ts2.utf16EncodeAsString(ch) : match; + } + }); + } + function tryDecodeEntities(text) { + var decoded = decodeEntities(text); + return decoded === text ? void 0 : decoded; + } + function getTagName(node) { + if (node.kind === 281) { + return getTagName(node.openingElement); + } else { + var name2 = node.tagName; + if (ts2.isIdentifier(name2) && ts2.isIntrinsicJsxName(name2.escapedText)) { + return factory.createStringLiteral(ts2.idText(name2)); + } else { + return ts2.createExpressionFromEntityName(factory, name2); + } + } + } + function getAttributeName(node) { + var name2 = node.name; + var text = ts2.idText(name2); + if (/^[A-Za-z_]\w*$/.test(text)) { + return name2; + } else { + return factory.createStringLiteral(text); + } + } + function visitJsxExpression(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + return node.dotDotDotToken ? factory.createSpreadElement(expression) : expression; + } + } + ts2.transformJsx = transformJsx; + var entities = new ts2.Map(ts2.getEntries({ + quot: 34, + amp: 38, + apos: 39, + lt: 60, + gt: 62, + nbsp: 160, + iexcl: 161, + cent: 162, + pound: 163, + curren: 164, + yen: 165, + brvbar: 166, + sect: 167, + uml: 168, + copy: 169, + ordf: 170, + laquo: 171, + not: 172, + shy: 173, + reg: 174, + macr: 175, + deg: 176, + plusmn: 177, + sup2: 178, + sup3: 179, + acute: 180, + micro: 181, + para: 182, + middot: 183, + cedil: 184, + sup1: 185, + ordm: 186, + raquo: 187, + frac14: 188, + frac12: 189, + frac34: 190, + iquest: 191, + Agrave: 192, + Aacute: 193, + Acirc: 194, + Atilde: 195, + Auml: 196, + Aring: 197, + AElig: 198, + Ccedil: 199, + Egrave: 200, + Eacute: 201, + Ecirc: 202, + Euml: 203, + Igrave: 204, + Iacute: 205, + Icirc: 206, + Iuml: 207, + ETH: 208, + Ntilde: 209, + Ograve: 210, + Oacute: 211, + Ocirc: 212, + Otilde: 213, + Ouml: 214, + times: 215, + Oslash: 216, + Ugrave: 217, + Uacute: 218, + Ucirc: 219, + Uuml: 220, + Yacute: 221, + THORN: 222, + szlig: 223, + agrave: 224, + aacute: 225, + acirc: 226, + atilde: 227, + auml: 228, + aring: 229, + aelig: 230, + ccedil: 231, + egrave: 232, + eacute: 233, + ecirc: 234, + euml: 235, + igrave: 236, + iacute: 237, + icirc: 238, + iuml: 239, + eth: 240, + ntilde: 241, + ograve: 242, + oacute: 243, + ocirc: 244, + otilde: 245, + ouml: 246, + divide: 247, + oslash: 248, + ugrave: 249, + uacute: 250, + ucirc: 251, + uuml: 252, + yacute: 253, + thorn: 254, + yuml: 255, + OElig: 338, + oelig: 339, + Scaron: 352, + scaron: 353, + Yuml: 376, + fnof: 402, + circ: 710, + tilde: 732, + Alpha: 913, + Beta: 914, + Gamma: 915, + Delta: 916, + Epsilon: 917, + Zeta: 918, + Eta: 919, + Theta: 920, + Iota: 921, + Kappa: 922, + Lambda: 923, + Mu: 924, + Nu: 925, + Xi: 926, + Omicron: 927, + Pi: 928, + Rho: 929, + Sigma: 931, + Tau: 932, + Upsilon: 933, + Phi: 934, + Chi: 935, + Psi: 936, + Omega: 937, + alpha: 945, + beta: 946, + gamma: 947, + delta: 948, + epsilon: 949, + zeta: 950, + eta: 951, + theta: 952, + iota: 953, + kappa: 954, + lambda: 955, + mu: 956, + nu: 957, + xi: 958, + omicron: 959, + pi: 960, + rho: 961, + sigmaf: 962, + sigma: 963, + tau: 964, + upsilon: 965, + phi: 966, + chi: 967, + psi: 968, + omega: 969, + thetasym: 977, + upsih: 978, + piv: 982, + ensp: 8194, + emsp: 8195, + thinsp: 8201, + zwnj: 8204, + zwj: 8205, + lrm: 8206, + rlm: 8207, + ndash: 8211, + mdash: 8212, + lsquo: 8216, + rsquo: 8217, + sbquo: 8218, + ldquo: 8220, + rdquo: 8221, + bdquo: 8222, + dagger: 8224, + Dagger: 8225, + bull: 8226, + hellip: 8230, + permil: 8240, + prime: 8242, + Prime: 8243, + lsaquo: 8249, + rsaquo: 8250, + oline: 8254, + frasl: 8260, + euro: 8364, + image: 8465, + weierp: 8472, + real: 8476, + trade: 8482, + alefsym: 8501, + larr: 8592, + uarr: 8593, + rarr: 8594, + darr: 8595, + harr: 8596, + crarr: 8629, + lArr: 8656, + uArr: 8657, + rArr: 8658, + dArr: 8659, + hArr: 8660, + forall: 8704, + part: 8706, + exist: 8707, + empty: 8709, + nabla: 8711, + isin: 8712, + notin: 8713, + ni: 8715, + prod: 8719, + sum: 8721, + minus: 8722, + lowast: 8727, + radic: 8730, + prop: 8733, + infin: 8734, + ang: 8736, + and: 8743, + or: 8744, + cap: 8745, + cup: 8746, + int: 8747, + there4: 8756, + sim: 8764, + cong: 8773, + asymp: 8776, + ne: 8800, + equiv: 8801, + le: 8804, + ge: 8805, + sub: 8834, + sup: 8835, + nsub: 8836, + sube: 8838, + supe: 8839, + oplus: 8853, + otimes: 8855, + perp: 8869, + sdot: 8901, + lceil: 8968, + rceil: 8969, + lfloor: 8970, + rfloor: 8971, + lang: 9001, + rang: 9002, + loz: 9674, + spades: 9824, + clubs: 9827, + hearts: 9829, + diams: 9830 + })); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformES2016(context2) { + var factory = context2.factory, hoistVariableDeclaration = context2.hoistVariableDeclaration; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 512) === 0) { + return node; + } + switch (node.kind) { + case 223: + return visitBinaryExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitBinaryExpression(node) { + switch (node.operatorToken.kind) { + case 67: + return visitExponentiationAssignmentExpression(node); + case 42: + return visitExponentiationExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitExponentiationAssignmentExpression(node) { + var target; + var value2; + var left = ts2.visitNode(node.left, visitor, ts2.isExpression); + var right = ts2.visitNode(node.right, visitor, ts2.isExpression); + if (ts2.isElementAccessExpression(left)) { + var expressionTemp = factory.createTempVariable(hoistVariableDeclaration); + var argumentExpressionTemp = factory.createTempVariable(hoistVariableDeclaration); + target = ts2.setTextRange(factory.createElementAccessExpression(ts2.setTextRange(factory.createAssignment(expressionTemp, left.expression), left.expression), ts2.setTextRange(factory.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression)), left); + value2 = ts2.setTextRange(factory.createElementAccessExpression(expressionTemp, argumentExpressionTemp), left); + } else if (ts2.isPropertyAccessExpression(left)) { + var expressionTemp = factory.createTempVariable(hoistVariableDeclaration); + target = ts2.setTextRange(factory.createPropertyAccessExpression(ts2.setTextRange(factory.createAssignment(expressionTemp, left.expression), left.expression), left.name), left); + value2 = ts2.setTextRange(factory.createPropertyAccessExpression(expressionTemp, left.name), left); + } else { + target = left; + value2 = left; + } + return ts2.setTextRange(factory.createAssignment(target, ts2.setTextRange(factory.createGlobalMethodCall("Math", "pow", [value2, right]), node)), node); + } + function visitExponentiationExpression(node) { + var left = ts2.visitNode(node.left, visitor, ts2.isExpression); + var right = ts2.visitNode(node.right, visitor, ts2.isExpression); + return ts2.setTextRange(factory.createGlobalMethodCall("Math", "pow", [left, right]), node); + } + } + ts2.transformES2016 = transformES2016; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ES2015SubstitutionFlags; + (function(ES2015SubstitutionFlags2) { + ES2015SubstitutionFlags2[ES2015SubstitutionFlags2["CapturedThis"] = 1] = "CapturedThis"; + ES2015SubstitutionFlags2[ES2015SubstitutionFlags2["BlockScopedBindings"] = 2] = "BlockScopedBindings"; + })(ES2015SubstitutionFlags || (ES2015SubstitutionFlags = {})); + var LoopOutParameterFlags; + (function(LoopOutParameterFlags2) { + LoopOutParameterFlags2[LoopOutParameterFlags2["Body"] = 1] = "Body"; + LoopOutParameterFlags2[LoopOutParameterFlags2["Initializer"] = 2] = "Initializer"; + })(LoopOutParameterFlags || (LoopOutParameterFlags = {})); + var CopyDirection; + (function(CopyDirection2) { + CopyDirection2[CopyDirection2["ToOriginal"] = 0] = "ToOriginal"; + CopyDirection2[CopyDirection2["ToOutParameter"] = 1] = "ToOutParameter"; + })(CopyDirection || (CopyDirection = {})); + var Jump; + (function(Jump2) { + Jump2[Jump2["Break"] = 2] = "Break"; + Jump2[Jump2["Continue"] = 4] = "Continue"; + Jump2[Jump2["Return"] = 8] = "Return"; + })(Jump || (Jump = {})); + var HierarchyFacts; + (function(HierarchyFacts2) { + HierarchyFacts2[HierarchyFacts2["None"] = 0] = "None"; + HierarchyFacts2[HierarchyFacts2["Function"] = 1] = "Function"; + HierarchyFacts2[HierarchyFacts2["ArrowFunction"] = 2] = "ArrowFunction"; + HierarchyFacts2[HierarchyFacts2["AsyncFunctionBody"] = 4] = "AsyncFunctionBody"; + HierarchyFacts2[HierarchyFacts2["NonStaticClassElement"] = 8] = "NonStaticClassElement"; + HierarchyFacts2[HierarchyFacts2["CapturesThis"] = 16] = "CapturesThis"; + HierarchyFacts2[HierarchyFacts2["ExportedVariableStatement"] = 32] = "ExportedVariableStatement"; + HierarchyFacts2[HierarchyFacts2["TopLevel"] = 64] = "TopLevel"; + HierarchyFacts2[HierarchyFacts2["Block"] = 128] = "Block"; + HierarchyFacts2[HierarchyFacts2["IterationStatement"] = 256] = "IterationStatement"; + HierarchyFacts2[HierarchyFacts2["IterationStatementBlock"] = 512] = "IterationStatementBlock"; + HierarchyFacts2[HierarchyFacts2["IterationContainer"] = 1024] = "IterationContainer"; + HierarchyFacts2[HierarchyFacts2["ForStatement"] = 2048] = "ForStatement"; + HierarchyFacts2[HierarchyFacts2["ForInOrForOfStatement"] = 4096] = "ForInOrForOfStatement"; + HierarchyFacts2[HierarchyFacts2["ConstructorWithCapturedSuper"] = 8192] = "ConstructorWithCapturedSuper"; + HierarchyFacts2[HierarchyFacts2["StaticInitializer"] = 16384] = "StaticInitializer"; + HierarchyFacts2[HierarchyFacts2["AncestorFactsMask"] = 32767] = "AncestorFactsMask"; + HierarchyFacts2[HierarchyFacts2["BlockScopeIncludes"] = 0] = "BlockScopeIncludes"; + HierarchyFacts2[HierarchyFacts2["BlockScopeExcludes"] = 7104] = "BlockScopeExcludes"; + HierarchyFacts2[HierarchyFacts2["SourceFileIncludes"] = 64] = "SourceFileIncludes"; + HierarchyFacts2[HierarchyFacts2["SourceFileExcludes"] = 8064] = "SourceFileExcludes"; + HierarchyFacts2[HierarchyFacts2["FunctionIncludes"] = 65] = "FunctionIncludes"; + HierarchyFacts2[HierarchyFacts2["FunctionExcludes"] = 32670] = "FunctionExcludes"; + HierarchyFacts2[HierarchyFacts2["AsyncFunctionBodyIncludes"] = 69] = "AsyncFunctionBodyIncludes"; + HierarchyFacts2[HierarchyFacts2["AsyncFunctionBodyExcludes"] = 32662] = "AsyncFunctionBodyExcludes"; + HierarchyFacts2[HierarchyFacts2["ArrowFunctionIncludes"] = 66] = "ArrowFunctionIncludes"; + HierarchyFacts2[HierarchyFacts2["ArrowFunctionExcludes"] = 15232] = "ArrowFunctionExcludes"; + HierarchyFacts2[HierarchyFacts2["ConstructorIncludes"] = 73] = "ConstructorIncludes"; + HierarchyFacts2[HierarchyFacts2["ConstructorExcludes"] = 32662] = "ConstructorExcludes"; + HierarchyFacts2[HierarchyFacts2["DoOrWhileStatementIncludes"] = 1280] = "DoOrWhileStatementIncludes"; + HierarchyFacts2[HierarchyFacts2["DoOrWhileStatementExcludes"] = 0] = "DoOrWhileStatementExcludes"; + HierarchyFacts2[HierarchyFacts2["ForStatementIncludes"] = 3328] = "ForStatementIncludes"; + HierarchyFacts2[HierarchyFacts2["ForStatementExcludes"] = 5056] = "ForStatementExcludes"; + HierarchyFacts2[HierarchyFacts2["ForInOrForOfStatementIncludes"] = 5376] = "ForInOrForOfStatementIncludes"; + HierarchyFacts2[HierarchyFacts2["ForInOrForOfStatementExcludes"] = 3008] = "ForInOrForOfStatementExcludes"; + HierarchyFacts2[HierarchyFacts2["BlockIncludes"] = 128] = "BlockIncludes"; + HierarchyFacts2[HierarchyFacts2["BlockExcludes"] = 6976] = "BlockExcludes"; + HierarchyFacts2[HierarchyFacts2["IterationStatementBlockIncludes"] = 512] = "IterationStatementBlockIncludes"; + HierarchyFacts2[HierarchyFacts2["IterationStatementBlockExcludes"] = 7104] = "IterationStatementBlockExcludes"; + HierarchyFacts2[HierarchyFacts2["StaticInitializerIncludes"] = 16449] = "StaticInitializerIncludes"; + HierarchyFacts2[HierarchyFacts2["StaticInitializerExcludes"] = 32670] = "StaticInitializerExcludes"; + HierarchyFacts2[HierarchyFacts2["NewTarget"] = 32768] = "NewTarget"; + HierarchyFacts2[HierarchyFacts2["CapturedLexicalThis"] = 65536] = "CapturedLexicalThis"; + HierarchyFacts2[HierarchyFacts2["SubtreeFactsMask"] = -32768] = "SubtreeFactsMask"; + HierarchyFacts2[HierarchyFacts2["ArrowFunctionSubtreeExcludes"] = 0] = "ArrowFunctionSubtreeExcludes"; + HierarchyFacts2[HierarchyFacts2["FunctionSubtreeExcludes"] = 98304] = "FunctionSubtreeExcludes"; + })(HierarchyFacts || (HierarchyFacts = {})); + var SpreadSegmentKind; + (function(SpreadSegmentKind2) { + SpreadSegmentKind2[SpreadSegmentKind2["None"] = 0] = "None"; + SpreadSegmentKind2[SpreadSegmentKind2["UnpackedSpread"] = 1] = "UnpackedSpread"; + SpreadSegmentKind2[SpreadSegmentKind2["PackedSpread"] = 2] = "PackedSpread"; + })(SpreadSegmentKind || (SpreadSegmentKind = {})); + function createSpreadSegment(kind, expression) { + return { kind, expression }; + } + function transformES2015(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, startLexicalEnvironment = context2.startLexicalEnvironment, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var compilerOptions = context2.getCompilerOptions(); + var resolver = context2.getEmitResolver(); + var previousOnSubstituteNode = context2.onSubstituteNode; + var previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + var currentSourceFile; + var currentText; + var hierarchyFacts; + var taggedTemplateStringDeclarations; + function recordTaggedTemplateString(temp) { + taggedTemplateStringDeclarations = ts2.append(taggedTemplateStringDeclarations, factory.createVariableDeclaration(temp)); + } + var convertedLoopState; + var enabledSubstitutions; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + currentText = node.text; + var visited = visitSourceFile(node); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + currentText = void 0; + taggedTemplateStringDeclarations = void 0; + hierarchyFacts = 0; + return visited; + } + function enterSubtree(excludeFacts, includeFacts) { + var ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 32767; + return ancestorFacts; + } + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 | ancestorFacts; + } + function isReturnVoidStatementInConstructorWithCapturedSuper(node) { + return (hierarchyFacts & 8192) !== 0 && node.kind === 250 && !node.expression; + } + function isOrMayContainReturnCompletion(node) { + return node.transformFlags & 4194304 && (ts2.isReturnStatement(node) || ts2.isIfStatement(node) || ts2.isWithStatement(node) || ts2.isSwitchStatement(node) || ts2.isCaseBlock(node) || ts2.isCaseClause(node) || ts2.isDefaultClause(node) || ts2.isTryStatement(node) || ts2.isCatchClause(node) || ts2.isLabeledStatement(node) || ts2.isIterationStatement( + node, + /*lookInLabeledStatements*/ + false + ) || ts2.isBlock(node)); + } + function shouldVisitNode(node) { + return (node.transformFlags & 1024) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 && isOrMayContainReturnCompletion(node) || ts2.isIterationStatement( + node, + /*lookInLabeledStatements*/ + false + ) && shouldConvertIterationStatement(node) || (ts2.getEmitFlags(node) & 33554432) !== 0; + } + function visitor(node) { + return shouldVisitNode(node) ? visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ) : node; + } + function visitorWithUnusedExpressionResult(node) { + return shouldVisitNode(node) ? visitorWorker( + node, + /*expressionResultIsUnused*/ + true + ) : node; + } + function classWrapperStatementVisitor(node) { + if (shouldVisitNode(node)) { + var original = ts2.getOriginalNode(node); + if (ts2.isPropertyDeclaration(original) && ts2.hasStaticModifier(original)) { + var ancestorFacts = enterSubtree( + 32670, + 16449 + /* HierarchyFacts.StaticInitializerIncludes */ + ); + var result2 = visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + return result2; + } + return visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + } + return node; + } + function callExpressionVisitor(node) { + if (node.kind === 106) { + return visitSuperKeyword( + /*isExpressionOfCall*/ + true + ); + } + return visitor(node); + } + function visitorWorker(node, expressionResultIsUnused) { + switch (node.kind) { + case 124: + return void 0; + case 260: + return visitClassDeclaration(node); + case 228: + return visitClassExpression(node); + case 166: + return visitParameter(node); + case 259: + return visitFunctionDeclaration(node); + case 216: + return visitArrowFunction(node); + case 215: + return visitFunctionExpression(node); + case 257: + return visitVariableDeclaration(node); + case 79: + return visitIdentifier(node); + case 258: + return visitVariableDeclarationList(node); + case 252: + return visitSwitchStatement(node); + case 266: + return visitCaseBlock(node); + case 238: + return visitBlock( + node, + /*isFunctionBody*/ + false + ); + case 249: + case 248: + return visitBreakOrContinueStatement(node); + case 253: + return visitLabeledStatement(node); + case 243: + case 244: + return visitDoOrWhileStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 245: + return visitForStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 246: + return visitForInStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 247: + return visitForOfStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 241: + return visitExpressionStatement(node); + case 207: + return visitObjectLiteralExpression(node); + case 295: + return visitCatchClause(node); + case 300: + return visitShorthandPropertyAssignment(node); + case 164: + return visitComputedPropertyName(node); + case 206: + return visitArrayLiteralExpression(node); + case 210: + return visitCallExpression(node); + case 211: + return visitNewExpression(node); + case 214: + return visitParenthesizedExpression(node, expressionResultIsUnused); + case 223: + return visitBinaryExpression(node, expressionResultIsUnused); + case 354: + return visitCommaListExpression(node, expressionResultIsUnused); + case 14: + case 15: + case 16: + case 17: + return visitTemplateLiteral(node); + case 10: + return visitStringLiteral(node); + case 8: + return visitNumericLiteral(node); + case 212: + return visitTaggedTemplateExpression(node); + case 225: + return visitTemplateExpression(node); + case 226: + return visitYieldExpression(node); + case 227: + return visitSpreadElement(node); + case 106: + return visitSuperKeyword( + /*isExpressionOfCall*/ + false + ); + case 108: + return visitThisKeyword(node); + case 233: + return visitMetaProperty(node); + case 171: + return visitMethodDeclaration(node); + case 174: + case 175: + return visitAccessorDeclaration(node); + case 240: + return visitVariableStatement(node); + case 250: + return visitReturnStatement(node); + case 219: + return visitVoidExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitSourceFile(node) { + var ancestorFacts = enterSubtree( + 8064, + 64 + /* HierarchyFacts.SourceFileIncludes */ + ); + var prologue = []; + var statements = []; + startLexicalEnvironment(); + var statementOffset = factory.copyPrologue( + node.statements, + prologue, + /*ensureUseStrict*/ + false, + visitor + ); + ts2.addRange(statements, ts2.visitNodes(node.statements, visitor, ts2.isStatement, statementOffset)); + if (taggedTemplateStringDeclarations) { + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(taggedTemplateStringDeclarations) + )); + } + factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + insertCaptureThisForNodeIfNeeded(prologue, node); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return factory.updateSourceFile(node, ts2.setTextRange(factory.createNodeArray(ts2.concatenate(prologue, statements)), node.statements)); + } + function visitSwitchStatement(node) { + if (convertedLoopState !== void 0) { + var savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps |= 2; + var result2 = ts2.visitEachChild(node, visitor, context2); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result2; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCaseBlock(node) { + var ancestorFacts = enterSubtree( + 7104, + 0 + /* HierarchyFacts.BlockScopeIncludes */ + ); + var updated = ts2.visitEachChild(node, visitor, context2); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function returnCapturedThis(node) { + return ts2.setOriginalNode(factory.createReturnStatement(factory.createUniqueName( + "_this", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + )), node); + } + function visitReturnStatement(node) { + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return factory.createReturnStatement(factory.createObjectLiteralExpression([ + factory.createPropertyAssignment(factory.createIdentifier("value"), node.expression ? ts2.visitNode(node.expression, visitor, ts2.isExpression) : factory.createVoidZero()) + ])); + } else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitThisKeyword(node) { + if (hierarchyFacts & 2 && !(hierarchyFacts & 16384)) { + hierarchyFacts |= 65536; + } + if (convertedLoopState) { + if (hierarchyFacts & 2) { + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = factory.createUniqueName("this")); + } + return node; + } + function visitVoidExpression(node) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitIdentifier(node) { + if (convertedLoopState) { + if (resolver.isArgumentsLocalBinding(node)) { + return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments")); + } + } + if (node.hasExtendedUnicodeEscape) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createIdentifier(ts2.unescapeLeadingUnderscores(node.escapedText)), node), node); + } + return node; + } + function visitBreakOrContinueStatement(node) { + if (convertedLoopState) { + var jump = node.kind === 249 ? 2 : 4; + var canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts2.idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump; + if (!canUseBreakOrContinue) { + var labelMarker = void 0; + var label = node.label; + if (!label) { + if (node.kind === 249) { + convertedLoopState.nonLocalJumps |= 2; + labelMarker = "break"; + } else { + convertedLoopState.nonLocalJumps |= 4; + labelMarker = "continue"; + } + } else { + if (node.kind === 249) { + labelMarker = "break-".concat(label.escapedText); + setLabeledJump( + convertedLoopState, + /*isBreak*/ + true, + ts2.idText(label), + labelMarker + ); + } else { + labelMarker = "continue-".concat(label.escapedText); + setLabeledJump( + convertedLoopState, + /*isBreak*/ + false, + ts2.idText(label), + labelMarker + ); + } + } + var returnExpression = factory.createStringLiteral(labelMarker); + if (convertedLoopState.loopOutParameters.length) { + var outParams = convertedLoopState.loopOutParameters; + var expr = void 0; + for (var i7 = 0; i7 < outParams.length; i7++) { + var copyExpr = copyOutParameter( + outParams[i7], + 1 + /* CopyDirection.ToOutParameter */ + ); + if (i7 === 0) { + expr = copyExpr; + } else { + expr = factory.createBinaryExpression(expr, 27, copyExpr); + } + } + returnExpression = factory.createBinaryExpression(expr, 27, returnExpression); + } + return factory.createReturnStatement(returnExpression); + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitClassDeclaration(node) { + var variable = factory.createVariableDeclaration( + factory.getLocalName( + node, + /*allowComments*/ + true + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + transformClassLikeDeclarationToExpression(node) + ); + ts2.setOriginalNode(variable, node); + var statements = []; + var statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([variable]) + ); + ts2.setOriginalNode(statement, node); + ts2.setTextRange(statement, node); + ts2.startOnNewLine(statement); + statements.push(statement); + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + var exportStatement = ts2.hasSyntacticModifier( + node, + 1024 + /* ModifierFlags.Default */ + ) ? factory.createExportDefault(factory.getLocalName(node)) : factory.createExternalModuleExport(factory.getLocalName(node)); + ts2.setOriginalNode(exportStatement, statement); + statements.push(exportStatement); + } + var emitFlags = ts2.getEmitFlags(node); + if ((emitFlags & 4194304) === 0) { + statements.push(factory.createEndOfDeclarationMarker(node)); + ts2.setEmitFlags( + statement, + emitFlags | 4194304 + /* EmitFlags.HasEndOfDeclarationMarker */ + ); + } + return ts2.singleOrMany(statements); + } + function visitClassExpression(node) { + return transformClassLikeDeclarationToExpression(node); + } + function transformClassLikeDeclarationToExpression(node) { + if (node.name) { + enableSubstitutionsForBlockScopedBindings(); + } + var extendsClauseElement = ts2.getClassExtendsHeritageElement(node); + var classFunction = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + extendsClauseElement ? [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ) + )] : [], + /*type*/ + void 0, + transformClassBody(node, extendsClauseElement) + ); + ts2.setEmitFlags( + classFunction, + ts2.getEmitFlags(node) & 65536 | 524288 + /* EmitFlags.ReuseTempVariableScope */ + ); + var inner = factory.createPartiallyEmittedExpression(classFunction); + ts2.setTextRangeEnd(inner, node.end); + ts2.setEmitFlags( + inner, + 1536 + /* EmitFlags.NoComments */ + ); + var outer = factory.createPartiallyEmittedExpression(inner); + ts2.setTextRangeEnd(outer, ts2.skipTrivia(currentText, node.pos)); + ts2.setEmitFlags( + outer, + 1536 + /* EmitFlags.NoComments */ + ); + var result2 = factory.createParenthesizedExpression(factory.createCallExpression( + outer, + /*typeArguments*/ + void 0, + extendsClauseElement ? [ts2.visitNode(extendsClauseElement.expression, visitor, ts2.isExpression)] : [] + )); + ts2.addSyntheticLeadingComment(result2, 3, "* @class "); + return result2; + } + function transformClassBody(node, extendsClauseElement) { + var statements = []; + var name2 = factory.getInternalName(node); + var constructorLikeName = ts2.isIdentifierANonContextualKeyword(name2) ? factory.getGeneratedNameForNode(name2) : name2; + startLexicalEnvironment(); + addExtendsHelperIfNeeded(statements, node, extendsClauseElement); + addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addClassMembers(statements, node); + var closingBraceLocation = ts2.createTokenRange( + ts2.skipTrivia(currentText, node.members.end), + 19 + /* SyntaxKind.CloseBraceToken */ + ); + var outer = factory.createPartiallyEmittedExpression(constructorLikeName); + ts2.setTextRangeEnd(outer, closingBraceLocation.end); + ts2.setEmitFlags( + outer, + 1536 + /* EmitFlags.NoComments */ + ); + var statement = factory.createReturnStatement(outer); + ts2.setTextRangePos(statement, closingBraceLocation.pos); + ts2.setEmitFlags( + statement, + 1536 | 384 + /* EmitFlags.NoTokenSourceMaps */ + ); + statements.push(statement); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var block = factory.createBlock( + ts2.setTextRange( + factory.createNodeArray(statements), + /*location*/ + node.members + ), + /*multiLine*/ + true + ); + ts2.setEmitFlags( + block, + 1536 + /* EmitFlags.NoComments */ + ); + return block; + } + function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { + if (extendsClauseElement) { + statements.push(ts2.setTextRange( + factory.createExpressionStatement(emitHelpers().createExtendsHelper(factory.getInternalName(node))), + /*location*/ + extendsClauseElement + )); + } + } + function addConstructor(statements, node, name2, extendsClauseElement) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var ancestorFacts = enterSubtree( + 32662, + 73 + /* HierarchyFacts.ConstructorIncludes */ + ); + var constructor = ts2.getFirstConstructorWithBody(node); + var hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== void 0); + var constructorFunction = factory.createFunctionDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + name2, + /*typeParameters*/ + void 0, + transformConstructorParameters(constructor, hasSynthesizedSuper), + /*type*/ + void 0, + transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) + ); + ts2.setTextRange(constructorFunction, constructor || node); + if (extendsClauseElement) { + ts2.setEmitFlags( + constructorFunction, + 8 + /* EmitFlags.CapturesThis */ + ); + } + statements.push(constructorFunction); + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + } + function transformConstructorParameters(constructor, hasSynthesizedSuper) { + return ts2.visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : void 0, visitor, context2) || []; + } + function createDefaultConstructorBody(node, isDerivedClass) { + var statements = []; + resumeLexicalEnvironment(); + factory.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + if (isDerivedClass) { + statements.push(factory.createReturnStatement(createDefaultSuperCallOrThis())); + } + var statementsArray = factory.createNodeArray(statements); + ts2.setTextRange(statementsArray, node.members); + var block = factory.createBlock( + statementsArray, + /*multiLine*/ + true + ); + ts2.setTextRange(block, node); + ts2.setEmitFlags( + block, + 1536 + /* EmitFlags.NoComments */ + ); + return block; + } + function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) { + var isDerivedClass = !!extendsClauseElement && ts2.skipOuterExpressions(extendsClauseElement.expression).kind !== 104; + if (!constructor) + return createDefaultConstructorBody(node, isDerivedClass); + var prologue = []; + var statements = []; + resumeLexicalEnvironment(); + var existingPrologue = ts2.takeWhile(constructor.body.statements, ts2.isPrologueDirective); + var _a2 = findSuperCallAndStatementIndex(constructor.body.statements, existingPrologue), superCall = _a2.superCall, superStatementIndex = _a2.superStatementIndex; + var postSuperStatementsStart = superStatementIndex === -1 ? existingPrologue.length : superStatementIndex + 1; + var statementOffset = postSuperStatementsStart; + if (!hasSynthesizedSuper) + statementOffset = factory.copyStandardPrologue( + constructor.body.statements, + prologue, + statementOffset, + /*ensureUseStrict*/ + false + ); + if (!hasSynthesizedSuper) + statementOffset = factory.copyCustomPrologue( + constructor.body.statements, + statements, + statementOffset, + visitor, + /*filter*/ + void 0 + ); + var superCallExpression; + if (hasSynthesizedSuper) { + superCallExpression = createDefaultSuperCallOrThis(); + } else if (superCall) { + superCallExpression = visitSuperCallInBody(superCall); + } + if (superCallExpression) { + hierarchyFacts |= 8192; + } + addDefaultValueAssignmentsIfNeeded(prologue, constructor); + addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper); + ts2.addRange(statements, ts2.visitNodes( + constructor.body.statements, + visitor, + ts2.isStatement, + /*start*/ + statementOffset + )); + factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + insertCaptureNewTargetIfNeeded( + prologue, + constructor, + /*copyOnWrite*/ + false + ); + if (isDerivedClass || superCallExpression) { + if (superCallExpression && postSuperStatementsStart === constructor.body.statements.length && !(constructor.body.transformFlags & 16384)) { + var superCall_1 = ts2.cast(ts2.cast(superCallExpression, ts2.isBinaryExpression).left, ts2.isCallExpression); + var returnStatement = factory.createReturnStatement(superCallExpression); + ts2.setCommentRange(returnStatement, ts2.getCommentRange(superCall_1)); + ts2.setEmitFlags( + superCall_1, + 1536 + /* EmitFlags.NoComments */ + ); + statements.push(returnStatement); + } else { + if (superStatementIndex <= existingPrologue.length) { + insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis()); + } else { + insertCaptureThisForNode(prologue, constructor, createActualThis()); + if (superCallExpression) { + insertSuperThisCaptureThisForNode(statements, superCallExpression); + } + } + if (!isSufficientlyCoveredByReturnStatements(constructor.body)) { + statements.push(factory.createReturnStatement(factory.createUniqueName( + "_this", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ))); + } + } + } else { + insertCaptureThisForNodeIfNeeded(prologue, constructor); + } + var body = factory.createBlock( + ts2.setTextRange( + factory.createNodeArray(__spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], existingPrologue, true), prologue, true), superStatementIndex <= existingPrologue.length ? ts2.emptyArray : ts2.visitNodes(constructor.body.statements, visitor, ts2.isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length), true), statements, true)), + /*location*/ + constructor.body.statements + ), + /*multiLine*/ + true + ); + ts2.setTextRange(body, constructor.body); + return body; + } + function findSuperCallAndStatementIndex(originalBodyStatements, existingPrologue) { + for (var i7 = existingPrologue.length; i7 < originalBodyStatements.length; i7 += 1) { + var superCall = ts2.getSuperCallFromStatement(originalBodyStatements[i7]); + if (superCall) { + return { + superCall, + superStatementIndex: i7 + }; + } + } + return { + superStatementIndex: -1 + }; + } + function isSufficientlyCoveredByReturnStatements(statement) { + if (statement.kind === 250) { + return true; + } else if (statement.kind === 242) { + var ifStatement = statement; + if (ifStatement.elseStatement) { + return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); + } + } else if (statement.kind === 238) { + var lastStatement = ts2.lastOrUndefined(statement.statements); + if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { + return true; + } + } + return false; + } + function createActualThis() { + return ts2.setEmitFlags( + factory.createThis(), + 4 + /* EmitFlags.NoSubstitution */ + ); + } + function createDefaultSuperCallOrThis() { + return factory.createLogicalOr(factory.createLogicalAnd(factory.createStrictInequality(factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), factory.createNull()), factory.createFunctionApplyCall(factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), createActualThis(), factory.createIdentifier("arguments"))), createActualThis()); + } + function visitParameter(node) { + if (node.dotDotDotToken) { + return void 0; + } else if (ts2.isBindingPattern(node.name)) { + return ts2.setOriginalNode( + ts2.setTextRange( + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory.getGeneratedNameForNode(node), + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + /*location*/ + node + ), + /*original*/ + node + ); + } else if (node.initializer) { + return ts2.setOriginalNode( + ts2.setTextRange( + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + node.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + /*location*/ + node + ), + /*original*/ + node + ); + } else { + return node; + } + } + function hasDefaultValueOrBindingPattern(node) { + return node.initializer !== void 0 || ts2.isBindingPattern(node.name); + } + function addDefaultValueAssignmentsIfNeeded(statements, node) { + if (!ts2.some(node.parameters, hasDefaultValueOrBindingPattern)) { + return false; + } + var added = false; + for (var _i = 0, _a2 = node.parameters; _i < _a2.length; _i++) { + var parameter = _a2[_i]; + var name2 = parameter.name, initializer = parameter.initializer, dotDotDotToken = parameter.dotDotDotToken; + if (dotDotDotToken) { + continue; + } + if (ts2.isBindingPattern(name2)) { + added = insertDefaultValueAssignmentForBindingPattern(statements, parameter, name2, initializer) || added; + } else if (initializer) { + insertDefaultValueAssignmentForInitializer(statements, parameter, name2, initializer); + added = true; + } + } + return added; + } + function insertDefaultValueAssignmentForBindingPattern(statements, parameter, name2, initializer) { + if (name2.elements.length > 0) { + ts2.insertStatementAfterCustomPrologue(statements, ts2.setEmitFlags( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(ts2.flattenDestructuringBinding(parameter, visitor, context2, 0, factory.getGeneratedNameForNode(parameter))) + ), + 1048576 + /* EmitFlags.CustomPrologue */ + )); + return true; + } else if (initializer) { + ts2.insertStatementAfterCustomPrologue(statements, ts2.setEmitFlags( + factory.createExpressionStatement(factory.createAssignment(factory.getGeneratedNameForNode(parameter), ts2.visitNode(initializer, visitor, ts2.isExpression))), + 1048576 + /* EmitFlags.CustomPrologue */ + )); + return true; + } + return false; + } + function insertDefaultValueAssignmentForInitializer(statements, parameter, name2, initializer) { + initializer = ts2.visitNode(initializer, visitor, ts2.isExpression); + var statement = factory.createIfStatement(factory.createTypeCheck(factory.cloneNode(name2), "undefined"), ts2.setEmitFlags( + ts2.setTextRange(factory.createBlock([ + factory.createExpressionStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createAssignment( + // TODO(rbuckton): Does this need to be parented? + ts2.setEmitFlags( + ts2.setParent(ts2.setTextRange(factory.cloneNode(name2), name2), name2.parent), + 48 + /* EmitFlags.NoSourceMap */ + ), + ts2.setEmitFlags( + initializer, + 48 | ts2.getEmitFlags(initializer) | 1536 + /* EmitFlags.NoComments */ + ) + ), parameter), + 1536 + /* EmitFlags.NoComments */ + )) + ]), parameter), + 1 | 32 | 384 | 1536 + /* EmitFlags.NoComments */ + )); + ts2.startOnNewLine(statement); + ts2.setTextRange(statement, parameter); + ts2.setEmitFlags( + statement, + 384 | 32 | 1048576 | 1536 + /* EmitFlags.NoComments */ + ); + ts2.insertStatementAfterCustomPrologue(statements, statement); + } + function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { + return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); + } + function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) { + var prologueStatements = []; + var parameter = ts2.lastOrUndefined(node.parameters); + if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) { + return false; + } + var declarationName = parameter.name.kind === 79 ? ts2.setParent(ts2.setTextRange(factory.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + ts2.setEmitFlags( + declarationName, + 48 + /* EmitFlags.NoSourceMap */ + ); + var expressionName = parameter.name.kind === 79 ? factory.cloneNode(parameter.name) : declarationName; + var restIndex = node.parameters.length - 1; + var temp = factory.createLoopVariable(); + prologueStatements.push(ts2.setEmitFlags( + ts2.setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + declarationName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createArrayLiteralExpression([]) + ) + ]) + ), + /*location*/ + parameter + ), + 1048576 + /* EmitFlags.CustomPrologue */ + )); + var forStatement = factory.createForStatement(ts2.setTextRange(factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + temp, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createNumericLiteral(restIndex) + ) + ]), parameter), ts2.setTextRange(factory.createLessThan(temp, factory.createPropertyAccessExpression(factory.createIdentifier("arguments"), "length")), parameter), ts2.setTextRange(factory.createPostfixIncrement(temp), parameter), factory.createBlock([ + ts2.startOnNewLine(ts2.setTextRange( + factory.createExpressionStatement(factory.createAssignment(factory.createElementAccessExpression(expressionName, restIndex === 0 ? temp : factory.createSubtract(temp, factory.createNumericLiteral(restIndex))), factory.createElementAccessExpression(factory.createIdentifier("arguments"), temp))), + /*location*/ + parameter + )) + ])); + ts2.setEmitFlags( + forStatement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + ts2.startOnNewLine(forStatement); + prologueStatements.push(forStatement); + if (parameter.name.kind !== 79) { + prologueStatements.push(ts2.setEmitFlags( + ts2.setTextRange(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(ts2.flattenDestructuringBinding(parameter, visitor, context2, 0, expressionName)) + ), parameter), + 1048576 + /* EmitFlags.CustomPrologue */ + )); + } + ts2.insertStatementsAfterCustomPrologue(statements, prologueStatements); + return true; + } + function insertCaptureThisForNodeIfNeeded(statements, node) { + if (hierarchyFacts & 65536 && node.kind !== 216) { + insertCaptureThisForNode(statements, node, factory.createThis()); + return true; + } + return false; + } + function insertSuperThisCaptureThisForNode(statements, superExpression) { + enableSubstitutionsForCapturedThis(); + var assignSuperExpression = factory.createExpressionStatement(factory.createBinaryExpression(factory.createThis(), 63, superExpression)); + ts2.insertStatementAfterCustomPrologue(statements, assignSuperExpression); + ts2.setCommentRange(assignSuperExpression, ts2.getOriginalNode(superExpression).parent); + } + function insertCaptureThisForNode(statements, node, initializer) { + enableSubstitutionsForCapturedThis(); + var captureThisStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + factory.createUniqueName( + "_this", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ]) + ); + ts2.setEmitFlags( + captureThisStatement, + 1536 | 1048576 + /* EmitFlags.CustomPrologue */ + ); + ts2.setSourceMapRange(captureThisStatement, node); + ts2.insertStatementAfterCustomPrologue(statements, captureThisStatement); + } + function insertCaptureNewTargetIfNeeded(statements, node, copyOnWrite) { + if (hierarchyFacts & 32768) { + var newTarget = void 0; + switch (node.kind) { + case 216: + return statements; + case 171: + case 174: + case 175: + newTarget = factory.createVoidZero(); + break; + case 173: + newTarget = factory.createPropertyAccessExpression(ts2.setEmitFlags( + factory.createThis(), + 4 + /* EmitFlags.NoSubstitution */ + ), "constructor"); + break; + case 259: + case 215: + newTarget = factory.createConditionalExpression( + factory.createLogicalAnd(ts2.setEmitFlags( + factory.createThis(), + 4 + /* EmitFlags.NoSubstitution */ + ), factory.createBinaryExpression(ts2.setEmitFlags( + factory.createThis(), + 4 + /* EmitFlags.NoSubstitution */ + ), 102, factory.getLocalName(node))), + /*questionToken*/ + void 0, + factory.createPropertyAccessExpression(ts2.setEmitFlags( + factory.createThis(), + 4 + /* EmitFlags.NoSubstitution */ + ), "constructor"), + /*colonToken*/ + void 0, + factory.createVoidZero() + ); + break; + default: + return ts2.Debug.failBadSyntaxKind(node); + } + var captureNewTargetStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + factory.createUniqueName( + "_newTarget", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + newTarget + ) + ]) + ); + ts2.setEmitFlags( + captureNewTargetStatement, + 1536 | 1048576 + /* EmitFlags.CustomPrologue */ + ); + if (copyOnWrite) { + statements = statements.slice(); + } + ts2.insertStatementAfterCustomPrologue(statements, captureNewTargetStatement); + } + return statements; + } + function addClassMembers(statements, node) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + switch (member.kind) { + case 237: + statements.push(transformSemicolonClassElementToStatement(member)); + break; + case 171: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); + break; + case 174: + case 175: + var accessors = ts2.getAllAccessorDeclarations(node.members, member); + if (member === accessors.firstAccessor) { + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); + } + break; + case 173: + case 172: + break; + default: + ts2.Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); + break; + } + } + } + function transformSemicolonClassElementToStatement(member) { + return ts2.setTextRange(factory.createEmptyStatement(), member); + } + function transformClassMethodDeclarationToStatement(receiver, member, container) { + var commentRange = ts2.getCommentRange(member); + var sourceMapRange = ts2.getSourceMapRange(member); + var memberFunction = transformFunctionLikeToExpression( + member, + /*location*/ + member, + /*name*/ + void 0, + container + ); + var propertyName = ts2.visitNode(member.name, visitor, ts2.isPropertyName); + var e10; + if (!ts2.isPrivateIdentifier(propertyName) && ts2.getUseDefineForClassFields(context2.getCompilerOptions())) { + var name2 = ts2.isComputedPropertyName(propertyName) ? propertyName.expression : ts2.isIdentifier(propertyName) ? factory.createStringLiteral(ts2.unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; + e10 = factory.createObjectDefinePropertyCall(receiver, name2, factory.createPropertyDescriptor({ value: memberFunction, enumerable: false, writable: true, configurable: true })); + } else { + var memberName = ts2.createMemberAccessForPropertyName( + factory, + receiver, + propertyName, + /*location*/ + member.name + ); + e10 = factory.createAssignment(memberName, memberFunction); + } + ts2.setEmitFlags( + memberFunction, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(memberFunction, sourceMapRange); + var statement = ts2.setTextRange( + factory.createExpressionStatement(e10), + /*location*/ + member + ); + ts2.setOriginalNode(statement, member); + ts2.setCommentRange(statement, commentRange); + ts2.setEmitFlags( + statement, + 48 + /* EmitFlags.NoSourceMap */ + ); + return statement; + } + function transformAccessorsToStatement(receiver, accessors, container) { + var statement = factory.createExpressionStatement(transformAccessorsToExpression( + receiver, + accessors, + container, + /*startsOnNewLine*/ + false + )); + ts2.setEmitFlags( + statement, + 1536 + /* EmitFlags.NoComments */ + ); + ts2.setSourceMapRange(statement, ts2.getSourceMapRange(accessors.firstAccessor)); + return statement; + } + function transformAccessorsToExpression(receiver, _a2, container, startsOnNewLine) { + var firstAccessor = _a2.firstAccessor, getAccessor = _a2.getAccessor, setAccessor = _a2.setAccessor; + var target = ts2.setParent(ts2.setTextRange(factory.cloneNode(receiver), receiver), receiver.parent); + ts2.setEmitFlags( + target, + 1536 | 32 + /* EmitFlags.NoTrailingSourceMap */ + ); + ts2.setSourceMapRange(target, firstAccessor.name); + var visitedAccessorName = ts2.visitNode(firstAccessor.name, visitor, ts2.isPropertyName); + if (ts2.isPrivateIdentifier(visitedAccessorName)) { + return ts2.Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); + } + var propertyName = ts2.createExpressionForPropertyName(factory, visitedAccessorName); + ts2.setEmitFlags( + propertyName, + 1536 | 16 + /* EmitFlags.NoLeadingSourceMap */ + ); + ts2.setSourceMapRange(propertyName, firstAccessor.name); + var properties = []; + if (getAccessor) { + var getterFunction = transformFunctionLikeToExpression( + getAccessor, + /*location*/ + void 0, + /*name*/ + void 0, + container + ); + ts2.setSourceMapRange(getterFunction, ts2.getSourceMapRange(getAccessor)); + ts2.setEmitFlags( + getterFunction, + 512 + /* EmitFlags.NoLeadingComments */ + ); + var getter = factory.createPropertyAssignment("get", getterFunction); + ts2.setCommentRange(getter, ts2.getCommentRange(getAccessor)); + properties.push(getter); + } + if (setAccessor) { + var setterFunction = transformFunctionLikeToExpression( + setAccessor, + /*location*/ + void 0, + /*name*/ + void 0, + container + ); + ts2.setSourceMapRange(setterFunction, ts2.getSourceMapRange(setAccessor)); + ts2.setEmitFlags( + setterFunction, + 512 + /* EmitFlags.NoLeadingComments */ + ); + var setter = factory.createPropertyAssignment("set", setterFunction); + ts2.setCommentRange(setter, ts2.getCommentRange(setAccessor)); + properties.push(setter); + } + properties.push(factory.createPropertyAssignment("enumerable", getAccessor || setAccessor ? factory.createFalse() : factory.createTrue()), factory.createPropertyAssignment("configurable", factory.createTrue())); + var call = factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ + void 0, + [ + target, + propertyName, + factory.createObjectLiteralExpression( + properties, + /*multiLine*/ + true + ) + ] + ); + if (startsOnNewLine) { + ts2.startOnNewLine(call); + } + return call; + } + function visitArrowFunction(node) { + if (node.transformFlags & 16384 && !(hierarchyFacts & 16384)) { + hierarchyFacts |= 65536; + } + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var ancestorFacts = enterSubtree( + 15232, + 66 + /* HierarchyFacts.ArrowFunctionIncludes */ + ); + var func = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformFunctionBody(node) + ); + ts2.setTextRange(func, node); + ts2.setOriginalNode(func, node); + ts2.setEmitFlags( + func, + 8 + /* EmitFlags.CapturesThis */ + ); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + return func; + } + function visitFunctionExpression(node) { + var ancestorFacts = ts2.getEmitFlags(node) & 262144 ? enterSubtree( + 32662, + 69 + /* HierarchyFacts.AsyncFunctionBodyIncludes */ + ) : enterSubtree( + 32670, + 65 + /* HierarchyFacts.FunctionIncludes */ + ); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var parameters = ts2.visitParameterList(node.parameters, visitor, context2); + var body = transformFunctionBody(node); + var name2 = hierarchyFacts & 32768 ? factory.getLocalName(node) : node.name; + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + return factory.updateFunctionExpression( + node, + /*modifiers*/ + void 0, + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + function visitFunctionDeclaration(node) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var ancestorFacts = enterSubtree( + 32670, + 65 + /* HierarchyFacts.FunctionIncludes */ + ); + var parameters = ts2.visitParameterList(node.parameters, visitor, context2); + var body = transformFunctionBody(node); + var name2 = hierarchyFacts & 32768 ? factory.getLocalName(node) : node.name; + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + return factory.updateFunctionDeclaration( + node, + ts2.visitNodes(node.modifiers, visitor, ts2.isModifier), + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + function transformFunctionLikeToExpression(node, location2, name2, container) { + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var ancestorFacts = container && ts2.isClassLike(container) && !ts2.isStatic(node) ? enterSubtree( + 32670, + 65 | 8 + /* HierarchyFacts.NonStaticClassElement */ + ) : enterSubtree( + 32670, + 65 + /* HierarchyFacts.FunctionIncludes */ + ); + var parameters = ts2.visitParameterList(node.parameters, visitor, context2); + var body = transformFunctionBody(node); + if (hierarchyFacts & 32768 && !name2 && (node.kind === 259 || node.kind === 215)) { + name2 = factory.getGeneratedNameForNode(node); + } + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + return ts2.setOriginalNode( + ts2.setTextRange(factory.createFunctionExpression( + /*modifiers*/ + void 0, + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), location2), + /*original*/ + node + ); + } + function transformFunctionBody(node) { + var multiLine = false; + var singleLine = false; + var statementsLocation; + var closeBraceLocation; + var prologue = []; + var statements = []; + var body = node.body; + var statementOffset; + resumeLexicalEnvironment(); + if (ts2.isBlock(body)) { + statementOffset = factory.copyStandardPrologue( + body.statements, + prologue, + 0, + /*ensureUseStrict*/ + false + ); + statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts2.isHoistedFunction); + statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts2.isHoistedVariableStatement); + } + multiLine = addDefaultValueAssignmentsIfNeeded(statements, node) || multiLine; + multiLine = addRestParameterIfNeeded( + statements, + node, + /*inConstructorWithSynthesizedSuper*/ + false + ) || multiLine; + if (ts2.isBlock(body)) { + statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor); + statementsLocation = body.statements; + ts2.addRange(statements, ts2.visitNodes(body.statements, visitor, ts2.isStatement, statementOffset)); + if (!multiLine && body.multiLine) { + multiLine = true; + } + } else { + ts2.Debug.assert( + node.kind === 216 + /* SyntaxKind.ArrowFunction */ + ); + statementsLocation = ts2.moveRangeEnd(body, -1); + var equalsGreaterThanToken = node.equalsGreaterThanToken; + if (!ts2.nodeIsSynthesized(equalsGreaterThanToken) && !ts2.nodeIsSynthesized(body)) { + if (ts2.rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) { + singleLine = true; + } else { + multiLine = true; + } + } + var expression = ts2.visitNode(body, visitor, ts2.isExpression); + var returnStatement = factory.createReturnStatement(expression); + ts2.setTextRange(returnStatement, body); + ts2.moveSyntheticComments(returnStatement, body); + ts2.setEmitFlags( + returnStatement, + 384 | 32 | 1024 + /* EmitFlags.NoTrailingComments */ + ); + statements.push(returnStatement); + closeBraceLocation = body; + } + factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + insertCaptureNewTargetIfNeeded( + prologue, + node, + /*copyOnWrite*/ + false + ); + insertCaptureThisForNodeIfNeeded(prologue, node); + if (ts2.some(prologue)) { + multiLine = true; + } + statements.unshift.apply(statements, prologue); + if (ts2.isBlock(body) && ts2.arrayIsEqualTo(statements, body.statements)) { + return body; + } + var block = factory.createBlock(ts2.setTextRange(factory.createNodeArray(statements), statementsLocation), multiLine); + ts2.setTextRange(block, node.body); + if (!multiLine && singleLine) { + ts2.setEmitFlags( + block, + 1 + /* EmitFlags.SingleLine */ + ); + } + if (closeBraceLocation) { + ts2.setTokenSourceMapRange(block, 19, closeBraceLocation); + } + ts2.setOriginalNode(block, node.body); + return block; + } + function visitBlock(node, isFunctionBody) { + if (isFunctionBody) { + return ts2.visitEachChild(node, visitor, context2); + } + var ancestorFacts = hierarchyFacts & 256 ? enterSubtree( + 7104, + 512 + /* HierarchyFacts.IterationStatementBlockIncludes */ + ) : enterSubtree( + 6976, + 128 + /* HierarchyFacts.BlockIncludes */ + ); + var updated = ts2.visitEachChild(node, visitor, context2); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function visitExpressionStatement(node) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitParenthesizedExpression(node, expressionResultIsUnused) { + return ts2.visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context2); + } + function visitBinaryExpression(node, expressionResultIsUnused) { + if (ts2.isDestructuringAssignment(node)) { + return ts2.flattenDestructuringAssignment(node, visitor, context2, 0, !expressionResultIsUnused); + } + if (node.operatorToken.kind === 27) { + return factory.updateBinaryExpression(node, ts2.visitNode(node.left, visitorWithUnusedExpressionResult, ts2.isExpression), node.operatorToken, ts2.visitNode(node.right, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, ts2.isExpression)); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, expressionResultIsUnused) { + if (expressionResultIsUnused) { + return ts2.visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + var result2; + for (var i7 = 0; i7 < node.elements.length; i7++) { + var element = node.elements[i7]; + var visited = ts2.visitNode(element, i7 < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts2.isExpression); + if (result2 || visited !== element) { + result2 || (result2 = node.elements.slice(0, i7)); + result2.push(visited); + } + } + var elements = result2 ? ts2.setTextRange(factory.createNodeArray(result2), node.elements) : node.elements; + return factory.updateCommaListExpression(node, elements); + } + function isVariableStatementOfTypeScriptClassWrapper(node) { + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(ts2.getEmitFlags(node.declarationList.declarations[0].initializer) & 33554432); + } + function visitVariableStatement(node) { + var ancestorFacts = enterSubtree( + 0, + ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ) ? 32 : 0 + /* HierarchyFacts.None */ + ); + var updated; + if (convertedLoopState && (node.declarationList.flags & 3) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) { + var assignments = void 0; + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl); + if (decl.initializer) { + var assignment = void 0; + if (ts2.isBindingPattern(decl.name)) { + assignment = ts2.flattenDestructuringAssignment( + decl, + visitor, + context2, + 0 + /* FlattenLevel.All */ + ); + } else { + assignment = factory.createBinaryExpression(decl.name, 63, ts2.visitNode(decl.initializer, visitor, ts2.isExpression)); + ts2.setTextRange(assignment, decl); + } + assignments = ts2.append(assignments, assignment); + } + } + if (assignments) { + updated = ts2.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(assignments)), node); + } else { + updated = void 0; + } + } else { + updated = ts2.visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function visitVariableDeclarationList(node) { + if (node.flags & 3 || node.transformFlags & 524288) { + if (node.flags & 3) { + enableSubstitutionsForBlockScopedBindings(); + } + var declarations = ts2.flatMap(node.declarations, node.flags & 1 ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration); + var declarationList = factory.createVariableDeclarationList(declarations); + ts2.setOriginalNode(declarationList, node); + ts2.setTextRange(declarationList, node); + ts2.setCommentRange(declarationList, node); + if (node.transformFlags & 524288 && (ts2.isBindingPattern(node.declarations[0].name) || ts2.isBindingPattern(ts2.last(node.declarations).name))) { + ts2.setSourceMapRange(declarationList, getRangeUnion(declarations)); + } + return declarationList; + } + return ts2.visitEachChild(node, visitor, context2); + } + function getRangeUnion(declarations) { + var pos = -1, end = -1; + for (var _i = 0, declarations_10 = declarations; _i < declarations_10.length; _i++) { + var node = declarations_10[_i]; + pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos); + end = Math.max(end, node.end); + } + return ts2.createRange(pos, end); + } + function shouldEmitExplicitInitializerForLetDeclaration(node) { + var flags = resolver.getNodeCheckFlags(node); + var isCapturedInFunction = flags & 262144; + var isDeclaredInLoop = flags & 524288; + var emittedAsTopLevel = (hierarchyFacts & 64) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512) !== 0; + var emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 | 4096)) === 0); + return emitExplicitInitializer; + } + function visitVariableDeclarationInLetDeclarationList(node) { + var name2 = node.name; + if (ts2.isBindingPattern(name2)) { + return visitVariableDeclaration(node); + } + if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) { + return factory.updateVariableDeclaration( + node, + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createVoidZero() + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitVariableDeclaration(node) { + var ancestorFacts = enterSubtree( + 32, + 0 + /* HierarchyFacts.None */ + ); + var updated; + if (ts2.isBindingPattern(node.name)) { + updated = ts2.flattenDestructuringBinding( + node, + visitor, + context2, + 0, + /*value*/ + void 0, + (ancestorFacts & 32) !== 0 + ); + } else { + updated = ts2.visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(ts2.idText(node.label), true); + } + function resetLabel(node) { + convertedLoopState.labels.set(ts2.idText(node.label), false); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = new ts2.Map(); + } + var statement = ts2.unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return ts2.isIterationStatement( + statement, + /*lookInLabeledStatements*/ + false + ) ? visitIterationStatement( + statement, + /*outermostLabeledStatement*/ + node + ) : factory.restoreEnclosingLabel(ts2.visitNode(statement, visitor, ts2.isStatement, factory.liftToBlock), node, convertedLoopState && resetLabel); + } + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 243: + case 244: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 245: + return visitForStatement(node, outermostLabeledStatement); + case 246: + return visitForInStatement(node, outermostLabeledStatement); + case 247: + return visitForOfStatement(node, outermostLabeledStatement); + } + } + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + var ancestorFacts = enterSubtree(excludeFacts, includeFacts); + var updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(0, 1280, node, outermostLabeledStatement); + } + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(5056, 3328, node, outermostLabeledStatement); + } + function visitEachChildOfForStatement(node) { + return factory.updateForStatement(node, ts2.visitNode(node.initializer, visitorWithUnusedExpressionResult, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, visitorWithUnusedExpressionResult, ts2.isExpression), ts2.visitNode(node.statement, visitor, ts2.isStatement, factory.liftToBlock)); + } + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008, 5376, node, outermostLabeledStatement); + } + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts(3008, 5376, node, outermostLabeledStatement, compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { + var statements = []; + var initializer = node.initializer; + if (ts2.isVariableDeclarationList(initializer)) { + if (node.initializer.flags & 3) { + enableSubstitutionsForBlockScopedBindings(); + } + var firstOriginalDeclaration = ts2.firstOrUndefined(initializer.declarations); + if (firstOriginalDeclaration && ts2.isBindingPattern(firstOriginalDeclaration.name)) { + var declarations = ts2.flattenDestructuringBinding(firstOriginalDeclaration, visitor, context2, 0, boundValue); + var declarationList = ts2.setTextRange(factory.createVariableDeclarationList(declarations), node.initializer); + ts2.setOriginalNode(declarationList, node.initializer); + ts2.setSourceMapRange(declarationList, ts2.createRange(declarations[0].pos, ts2.last(declarations).end)); + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + )); + } else { + statements.push(ts2.setTextRange(factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.setOriginalNode(ts2.setTextRange(factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + firstOriginalDeclaration ? firstOriginalDeclaration.name : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + boundValue + ) + ]), ts2.moveRangePos(initializer, -1)), initializer) + ), ts2.moveRangeEnd(initializer, -1))); + } + } else { + var assignment = factory.createAssignment(initializer, boundValue); + if (ts2.isDestructuringAssignment(assignment)) { + statements.push(factory.createExpressionStatement(visitBinaryExpression( + assignment, + /*expressionResultIsUnused*/ + true + ))); + } else { + ts2.setTextRangeEnd(assignment, initializer.end); + statements.push(ts2.setTextRange(factory.createExpressionStatement(ts2.visitNode(assignment, visitor, ts2.isExpression)), ts2.moveRangeEnd(initializer, -1))); + } + } + if (convertedLoopBodyStatements) { + return createSyntheticBlockForConvertedStatements(ts2.addRange(statements, convertedLoopBodyStatements)); + } else { + var statement = ts2.visitNode(node.statement, visitor, ts2.isStatement, factory.liftToBlock); + if (ts2.isBlock(statement)) { + return factory.updateBlock(statement, ts2.setTextRange(factory.createNodeArray(ts2.concatenate(statements, statement.statements)), statement.statements)); + } else { + statements.push(statement); + return createSyntheticBlockForConvertedStatements(statements); + } + } + } + function createSyntheticBlockForConvertedStatements(statements) { + return ts2.setEmitFlags( + factory.createBlock( + factory.createNodeArray(statements), + /*multiLine*/ + true + ), + 48 | 384 + /* EmitFlags.NoTokenSourceMaps */ + ); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + var counter = factory.createLoopVariable(); + var rhsReference = ts2.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + ts2.setEmitFlags(expression, 48 | ts2.getEmitFlags(expression)); + var forStatement = ts2.setTextRange( + factory.createForStatement( + /*initializer*/ + ts2.setEmitFlags( + ts2.setTextRange(factory.createVariableDeclarationList([ + ts2.setTextRange(factory.createVariableDeclaration( + counter, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createNumericLiteral(0) + ), ts2.moveRangePos(node.expression, -1)), + ts2.setTextRange(factory.createVariableDeclaration( + rhsReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + expression + ), node.expression) + ]), node.expression), + 2097152 + /* EmitFlags.NoHoisting */ + ), + /*condition*/ + ts2.setTextRange(factory.createLessThan(counter, factory.createPropertyAccessExpression(rhsReference, "length")), node.expression), + /*incrementor*/ + ts2.setTextRange(factory.createPostfixIncrement(counter), node.expression), + /*statement*/ + convertForOfStatementHead(node, factory.createElementAccessExpression(rhsReference, counter), convertedLoopBodyStatements) + ), + /*location*/ + node + ); + ts2.setEmitFlags( + forStatement, + 256 + /* EmitFlags.NoTokenTrailingSourceMaps */ + ); + ts2.setTextRange(forStatement, node); + return factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + var iterator = ts2.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var result2 = ts2.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var errorRecord = factory.createUniqueName("e"); + var catchVariable = factory.getGeneratedNameForNode(errorRecord); + var returnMethod = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var values2 = ts2.setTextRange(emitHelpers().createValuesHelper(expression), node.expression); + var next = factory.createCallExpression( + factory.createPropertyAccessExpression(iterator, "next"), + /*typeArguments*/ + void 0, + [] + ); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + var initializer = ancestorFacts & 1024 ? factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), values2]) : values2; + var forStatement = ts2.setEmitFlags( + ts2.setTextRange( + factory.createForStatement( + /*initializer*/ + ts2.setEmitFlags( + ts2.setTextRange(factory.createVariableDeclarationList([ + ts2.setTextRange(factory.createVariableDeclaration( + iterator, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node.expression), + factory.createVariableDeclaration( + result2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + next + ) + ]), node.expression), + 2097152 + /* EmitFlags.NoHoisting */ + ), + /*condition*/ + factory.createLogicalNot(factory.createPropertyAccessExpression(result2, "done")), + /*incrementor*/ + factory.createAssignment(result2, next), + /*statement*/ + convertForOfStatementHead(node, factory.createPropertyAccessExpression(result2, "value"), convertedLoopBodyStatements) + ), + /*location*/ + node + ), + 256 + /* EmitFlags.NoTokenTrailingSourceMaps */ + ); + return factory.createTryStatement(factory.createBlock([ + factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel) + ]), factory.createCatchClause(factory.createVariableDeclaration(catchVariable), ts2.setEmitFlags( + factory.createBlock([ + factory.createExpressionStatement(factory.createAssignment(errorRecord, factory.createObjectLiteralExpression([ + factory.createPropertyAssignment("error", catchVariable) + ]))) + ]), + 1 + /* EmitFlags.SingleLine */ + )), factory.createBlock([ + factory.createTryStatement( + /*tryBlock*/ + factory.createBlock([ + ts2.setEmitFlags( + factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(result2, factory.createLogicalNot(factory.createPropertyAccessExpression(result2, "done"))), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, "return"))), factory.createExpressionStatement(factory.createFunctionCallCall(returnMethod, iterator, []))), + 1 + /* EmitFlags.SingleLine */ + ) + ]), + /*catchClause*/ + void 0, + /*finallyBlock*/ + ts2.setEmitFlags( + factory.createBlock([ + ts2.setEmitFlags( + factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, "error"))), + 1 + /* EmitFlags.SingleLine */ + ) + ]), + 1 + /* EmitFlags.SingleLine */ + ) + ) + ])); + } + function visitObjectLiteralExpression(node) { + var properties = node.properties; + var numInitialProperties = -1, hasComputed = false; + for (var i7 = 0; i7 < properties.length; i7++) { + var property2 = properties[i7]; + if (property2.transformFlags & 1048576 && hierarchyFacts & 4 || (hasComputed = ts2.Debug.checkDefined(property2.name).kind === 164)) { + numInitialProperties = i7; + break; + } + } + if (numInitialProperties < 0) { + return ts2.visitEachChild(node, visitor, context2); + } + var temp = factory.createTempVariable(hoistVariableDeclaration); + var expressions = []; + var assignment = factory.createAssignment(temp, ts2.setEmitFlags(factory.createObjectLiteralExpression(ts2.visitNodes(properties, visitor, ts2.isObjectLiteralElementLike, 0, numInitialProperties), node.multiLine), hasComputed ? 65536 : 0)); + if (node.multiLine) { + ts2.startOnNewLine(assignment); + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + expressions.push(node.multiLine ? ts2.startOnNewLine(ts2.setParent(ts2.setTextRange(factory.cloneNode(temp), temp), temp.parent)) : temp); + return factory.inlineExpressions(expressions); + } + function shouldConvertPartOfIterationStatement(node) { + return (resolver.getNodeCheckFlags(node) & 131072) !== 0; + } + function shouldConvertInitializerOfForStatement(node) { + return ts2.isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer); + } + function shouldConvertConditionOfForStatement(node) { + return ts2.isForStatement(node) && !!node.condition && shouldConvertPartOfIterationStatement(node.condition); + } + function shouldConvertIncrementorOfForStatement(node) { + return ts2.isForStatement(node) && !!node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + } + function shouldConvertIterationStatement(node) { + return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node); + } + function shouldConvertBodyOfIterationStatement(node) { + return (resolver.getNodeCheckFlags(node) & 65536) !== 0; + } + function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) { + if (!state.hoistedLocalVariables) { + state.hoistedLocalVariables = []; + } + visit7(node.name); + function visit7(node2) { + if (node2.kind === 79) { + state.hoistedLocalVariables.push(node2); + } else { + for (var _i = 0, _a2 = node2.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + visit7(element.name); + } + } + } + } + } + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert) { + if (!shouldConvertIterationStatement(node)) { + var saveAllowedNonLabeledJumps = void 0; + if (convertedLoopState) { + saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps = 2 | 4; + } + var result2 = convert ? convert( + node, + outermostLabeledStatement, + /*convertedLoopBodyStatements*/ + void 0, + ancestorFacts + ) : factory.restoreEnclosingLabel(ts2.isForStatement(node) ? visitEachChildOfForStatement(node) : ts2.visitEachChild(node, visitor, context2), outermostLabeledStatement, convertedLoopState && resetLabel); + if (convertedLoopState) { + convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; + } + return result2; + } + var currentState = createConvertedLoopState(node); + var statements = []; + var outerConvertedLoopState = convertedLoopState; + convertedLoopState = currentState; + var initializerFunction = shouldConvertInitializerOfForStatement(node) ? createFunctionForInitializerOfForStatement(node, currentState) : void 0; + var bodyFunction = shouldConvertBodyOfIterationStatement(node) ? createFunctionForBodyOfIterationStatement(node, currentState, outerConvertedLoopState) : void 0; + convertedLoopState = outerConvertedLoopState; + if (initializerFunction) + statements.push(initializerFunction.functionDeclaration); + if (bodyFunction) + statements.push(bodyFunction.functionDeclaration); + addExtraDeclarationsForConvertedLoop(statements, currentState, outerConvertedLoopState); + if (initializerFunction) { + statements.push(generateCallToConvertedLoopInitializer(initializerFunction.functionName, initializerFunction.containsYield)); + } + var loop; + if (bodyFunction) { + if (convert) { + loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts); + } else { + var clone_4 = convertIterationStatementCore(node, initializerFunction, factory.createBlock( + bodyFunction.part, + /*multiLine*/ + true + )); + loop = factory.restoreEnclosingLabel(clone_4, outermostLabeledStatement, convertedLoopState && resetLabel); + } + } else { + var clone_5 = convertIterationStatementCore(node, initializerFunction, ts2.visitNode(node.statement, visitor, ts2.isStatement, factory.liftToBlock)); + loop = factory.restoreEnclosingLabel(clone_5, outermostLabeledStatement, convertedLoopState && resetLabel); + } + statements.push(loop); + return statements; + } + function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { + switch (node.kind) { + case 245: + return convertForStatement(node, initializerFunction, convertedLoopBody); + case 246: + return convertForInStatement(node, convertedLoopBody); + case 247: + return convertForOfStatement(node, convertedLoopBody); + case 243: + return convertDoStatement(node, convertedLoopBody); + case 244: + return convertWhileStatement(node, convertedLoopBody); + default: + return ts2.Debug.failBadSyntaxKind(node, "IterationStatement expected"); + } + } + function convertForStatement(node, initializerFunction, convertedLoopBody) { + var shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); + var shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + return factory.updateForStatement(node, ts2.visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, ts2.isForInitializer), ts2.visitNode(shouldConvertCondition ? void 0 : node.condition, visitor, ts2.isExpression), ts2.visitNode(shouldConvertIncrementor ? void 0 : node.incrementor, visitorWithUnusedExpressionResult, ts2.isExpression), convertedLoopBody); + } + function convertForOfStatement(node, convertedLoopBody) { + return factory.updateForOfStatement( + node, + /*awaitModifier*/ + void 0, + ts2.visitNode(node.initializer, visitor, ts2.isForInitializer), + ts2.visitNode(node.expression, visitor, ts2.isExpression), + convertedLoopBody + ); + } + function convertForInStatement(node, convertedLoopBody) { + return factory.updateForInStatement(node, ts2.visitNode(node.initializer, visitor, ts2.isForInitializer), ts2.visitNode(node.expression, visitor, ts2.isExpression), convertedLoopBody); + } + function convertDoStatement(node, convertedLoopBody) { + return factory.updateDoStatement(node, convertedLoopBody, ts2.visitNode(node.expression, visitor, ts2.isExpression)); + } + function convertWhileStatement(node, convertedLoopBody) { + return factory.updateWhileStatement(node, ts2.visitNode(node.expression, visitor, ts2.isExpression), convertedLoopBody); + } + function createConvertedLoopState(node) { + var loopInitializer; + switch (node.kind) { + case 245: + case 246: + case 247: + var initializer = node.initializer; + if (initializer && initializer.kind === 258) { + loopInitializer = initializer; + } + break; + } + var loopParameters = []; + var loopOutParameters = []; + if (loopInitializer && ts2.getCombinedNodeFlags(loopInitializer) & 3) { + var hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) || shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node); + for (var _i = 0, _a2 = loopInitializer.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); + } + } + var currentState = { loopParameters, loopOutParameters }; + if (convertedLoopState) { + if (convertedLoopState.argumentsName) { + currentState.argumentsName = convertedLoopState.argumentsName; + } + if (convertedLoopState.thisName) { + currentState.thisName = convertedLoopState.thisName; + } + if (convertedLoopState.hoistedLocalVariables) { + currentState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; + } + } + return currentState; + } + function addExtraDeclarationsForConvertedLoop(statements, state, outerState) { + var extraVariableDeclarations; + if (state.argumentsName) { + if (outerState) { + outerState.argumentsName = state.argumentsName; + } else { + (extraVariableDeclarations || (extraVariableDeclarations = [])).push(factory.createVariableDeclaration( + state.argumentsName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createIdentifier("arguments") + )); + } + } + if (state.thisName) { + if (outerState) { + outerState.thisName = state.thisName; + } else { + (extraVariableDeclarations || (extraVariableDeclarations = [])).push(factory.createVariableDeclaration( + state.thisName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createIdentifier("this") + )); + } + } + if (state.hoistedLocalVariables) { + if (outerState) { + outerState.hoistedLocalVariables = state.hoistedLocalVariables; + } else { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + for (var _i = 0, _a2 = state.hoistedLocalVariables; _i < _a2.length; _i++) { + var identifier = _a2[_i]; + extraVariableDeclarations.push(factory.createVariableDeclaration(identifier)); + } + } + } + if (state.loopOutParameters.length) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + for (var _b = 0, _c = state.loopOutParameters; _b < _c.length; _b++) { + var outParam = _c[_b]; + extraVariableDeclarations.push(factory.createVariableDeclaration(outParam.outParamName)); + } + } + if (state.conditionVariable) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + extraVariableDeclarations.push(factory.createVariableDeclaration( + state.conditionVariable, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createFalse() + )); + } + if (extraVariableDeclarations) { + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(extraVariableDeclarations) + )); + } + } + function createOutVariable(p7) { + return factory.createVariableDeclaration( + p7.originalName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + p7.outParamName + ); + } + function createFunctionForInitializerOfForStatement(node, currentState) { + var functionName = factory.createUniqueName("_loop_init"); + var containsYield = (node.initializer.transformFlags & 1048576) !== 0; + var emitFlags = 0; + if (currentState.containsLexicalThis) + emitFlags |= 8; + if (containsYield && hierarchyFacts & 4) + emitFlags |= 262144; + var statements = []; + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + node.initializer + )); + copyOutParameters(currentState.loopOutParameters, 2, 1, statements); + var functionDeclaration = factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.setEmitFlags( + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + functionName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.setEmitFlags(factory.createFunctionExpression( + /*modifiers*/ + void 0, + containsYield ? factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ) : void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + void 0, + /*type*/ + void 0, + ts2.visitNode(factory.createBlock( + statements, + /*multiLine*/ + true + ), visitor, ts2.isBlock) + ), emitFlags) + ) + ]), + 2097152 + /* EmitFlags.NoHoisting */ + ) + ); + var part = factory.createVariableDeclarationList(ts2.map(currentState.loopOutParameters, createOutVariable)); + return { functionName, containsYield, functionDeclaration, part }; + } + function createFunctionForBodyOfIterationStatement(node, currentState, outerState) { + var functionName = factory.createUniqueName("_loop"); + startLexicalEnvironment(); + var statement = ts2.visitNode(node.statement, visitor, ts2.isStatement, factory.liftToBlock); + var lexicalEnvironment = endLexicalEnvironment(); + var statements = []; + if (shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node)) { + currentState.conditionVariable = factory.createUniqueName("inc"); + if (node.incrementor) { + statements.push(factory.createIfStatement(currentState.conditionVariable, factory.createExpressionStatement(ts2.visitNode(node.incrementor, visitor, ts2.isExpression)), factory.createExpressionStatement(factory.createAssignment(currentState.conditionVariable, factory.createTrue())))); + } else { + statements.push(factory.createIfStatement(factory.createLogicalNot(currentState.conditionVariable), factory.createExpressionStatement(factory.createAssignment(currentState.conditionVariable, factory.createTrue())))); + } + if (shouldConvertConditionOfForStatement(node)) { + statements.push(factory.createIfStatement(factory.createPrefixUnaryExpression(53, ts2.visitNode(node.condition, visitor, ts2.isExpression)), ts2.visitNode(factory.createBreakStatement(), visitor, ts2.isStatement))); + } + } + if (ts2.isBlock(statement)) { + ts2.addRange(statements, statement.statements); + } else { + statements.push(statement); + } + copyOutParameters(currentState.loopOutParameters, 1, 1, statements); + ts2.insertStatementsAfterStandardPrologue(statements, lexicalEnvironment); + var loopBody = factory.createBlock( + statements, + /*multiLine*/ + true + ); + if (ts2.isBlock(statement)) + ts2.setOriginalNode(loopBody, statement); + var containsYield = (node.statement.transformFlags & 1048576) !== 0; + var emitFlags = 524288; + if (currentState.containsLexicalThis) + emitFlags |= 8; + if (containsYield && (hierarchyFacts & 4) !== 0) + emitFlags |= 262144; + var functionDeclaration = factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.setEmitFlags( + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + functionName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.setEmitFlags(factory.createFunctionExpression( + /*modifiers*/ + void 0, + containsYield ? factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ) : void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + currentState.loopParameters, + /*type*/ + void 0, + loopBody + ), emitFlags) + ) + ]), + 2097152 + /* EmitFlags.NoHoisting */ + ) + ); + var part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield); + return { functionName, containsYield, functionDeclaration, part }; + } + function copyOutParameter(outParam, copyDirection) { + var source = copyDirection === 0 ? outParam.outParamName : outParam.originalName; + var target = copyDirection === 0 ? outParam.originalName : outParam.outParamName; + return factory.createBinaryExpression(target, 63, source); + } + function copyOutParameters(outParams, partFlags, copyDirection, statements) { + for (var _i = 0, outParams_1 = outParams; _i < outParams_1.length; _i++) { + var outParam = outParams_1[_i]; + if (outParam.flags & partFlags) { + statements.push(factory.createExpressionStatement(copyOutParameter(outParam, copyDirection))); + } + } + } + function generateCallToConvertedLoopInitializer(initFunctionExpressionName, containsYield) { + var call = factory.createCallExpression( + initFunctionExpressionName, + /*typeArguments*/ + void 0, + [] + ); + var callResult = containsYield ? factory.createYieldExpression(factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), ts2.setEmitFlags( + call, + 8388608 + /* EmitFlags.Iterator */ + )) : call; + return factory.createExpressionStatement(callResult); + } + function generateCallToConvertedLoop(loopFunctionExpressionName, state, outerState, containsYield) { + var statements = []; + var isSimpleLoop = !(state.nonLocalJumps & ~4) && !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; + var call = factory.createCallExpression( + loopFunctionExpressionName, + /*typeArguments*/ + void 0, + ts2.map(state.loopParameters, function(p7) { + return p7.name; + }) + ); + var callResult = containsYield ? factory.createYieldExpression(factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), ts2.setEmitFlags( + call, + 8388608 + /* EmitFlags.Iterator */ + )) : call; + if (isSimpleLoop) { + statements.push(factory.createExpressionStatement(callResult)); + copyOutParameters(state.loopOutParameters, 1, 0, statements); + } else { + var loopResultName = factory.createUniqueName("state"); + var stateVariable = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([factory.createVariableDeclaration( + loopResultName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + callResult + )]) + ); + statements.push(stateVariable); + copyOutParameters(state.loopOutParameters, 1, 0, statements); + if (state.nonLocalJumps & 8) { + var returnStatement = void 0; + if (outerState) { + outerState.nonLocalJumps |= 8; + returnStatement = factory.createReturnStatement(loopResultName); + } else { + returnStatement = factory.createReturnStatement(factory.createPropertyAccessExpression(loopResultName, "value")); + } + statements.push(factory.createIfStatement(factory.createTypeCheck(loopResultName, "object"), returnStatement)); + } + if (state.nonLocalJumps & 2) { + statements.push(factory.createIfStatement(factory.createStrictEquality(loopResultName, factory.createStringLiteral("break")), factory.createBreakStatement())); + } + if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) { + var caseClauses = []; + processLabeledJumps( + state.labeledNonLocalBreaks, + /*isBreak*/ + true, + loopResultName, + outerState, + caseClauses + ); + processLabeledJumps( + state.labeledNonLocalContinues, + /*isBreak*/ + false, + loopResultName, + outerState, + caseClauses + ); + statements.push(factory.createSwitchStatement(loopResultName, factory.createCaseBlock(caseClauses))); + } + } + return statements; + } + function setLabeledJump(state, isBreak, labelText, labelMarker) { + if (isBreak) { + if (!state.labeledNonLocalBreaks) { + state.labeledNonLocalBreaks = new ts2.Map(); + } + state.labeledNonLocalBreaks.set(labelText, labelMarker); + } else { + if (!state.labeledNonLocalContinues) { + state.labeledNonLocalContinues = new ts2.Map(); + } + state.labeledNonLocalContinues.set(labelText, labelMarker); + } + } + function processLabeledJumps(table2, isBreak, loopResultName, outerLoop, caseClauses) { + if (!table2) { + return; + } + table2.forEach(function(labelMarker, labelText) { + var statements = []; + if (!outerLoop || outerLoop.labels && outerLoop.labels.get(labelText)) { + var label = factory.createIdentifier(labelText); + statements.push(isBreak ? factory.createBreakStatement(label) : factory.createContinueStatement(label)); + } else { + setLabeledJump(outerLoop, isBreak, labelText, labelMarker); + statements.push(factory.createReturnStatement(loopResultName)); + } + caseClauses.push(factory.createCaseClause(factory.createStringLiteral(labelMarker), statements)); + }); + } + function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) { + var name2 = decl.name; + if (ts2.isBindingPattern(name2)) { + for (var _i = 0, _a2 = name2.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); + } + } + } else { + loopParameters.push(factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name2 + )); + var checkFlags = resolver.getNodeCheckFlags(decl); + if (checkFlags & 4194304 || hasCapturedBindingsInForHead) { + var outParamName = factory.createUniqueName("out_" + ts2.idText(name2)); + var flags = 0; + if (checkFlags & 4194304) { + flags |= 1; + } + if (ts2.isForStatement(container)) { + if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) { + flags |= 2; + } + if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) || container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) { + flags |= 1; + } + } + loopOutParameters.push({ flags, originalName: name2, outParamName }); + } + } + } + function addObjectLiteralMembers(expressions, node, receiver, start) { + var properties = node.properties; + var numProperties = properties.length; + for (var i7 = start; i7 < numProperties; i7++) { + var property2 = properties[i7]; + switch (property2.kind) { + case 174: + case 175: + var accessors = ts2.getAllAccessorDeclarations(node.properties, property2); + if (property2 === accessors.firstAccessor) { + expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); + } + break; + case 171: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property2, receiver, node, node.multiLine)); + break; + case 299: + expressions.push(transformPropertyAssignmentToExpression(property2, receiver, node.multiLine)); + break; + case 300: + expressions.push(transformShorthandPropertyAssignmentToExpression(property2, receiver, node.multiLine)); + break; + default: + ts2.Debug.failBadSyntaxKind(node); + break; + } + } + } + function transformPropertyAssignmentToExpression(property2, receiver, startsOnNewLine) { + var expression = factory.createAssignment(ts2.createMemberAccessForPropertyName(factory, receiver, ts2.visitNode(property2.name, visitor, ts2.isPropertyName)), ts2.visitNode(property2.initializer, visitor, ts2.isExpression)); + ts2.setTextRange(expression, property2); + if (startsOnNewLine) { + ts2.startOnNewLine(expression); + } + return expression; + } + function transformShorthandPropertyAssignmentToExpression(property2, receiver, startsOnNewLine) { + var expression = factory.createAssignment(ts2.createMemberAccessForPropertyName(factory, receiver, ts2.visitNode(property2.name, visitor, ts2.isPropertyName)), factory.cloneNode(property2.name)); + ts2.setTextRange(expression, property2); + if (startsOnNewLine) { + ts2.startOnNewLine(expression); + } + return expression; + } + function transformObjectLiteralMethodDeclarationToExpression(method2, receiver, container, startsOnNewLine) { + var expression = factory.createAssignment(ts2.createMemberAccessForPropertyName(factory, receiver, ts2.visitNode(method2.name, visitor, ts2.isPropertyName)), transformFunctionLikeToExpression( + method2, + /*location*/ + method2, + /*name*/ + void 0, + container + )); + ts2.setTextRange(expression, method2); + if (startsOnNewLine) { + ts2.startOnNewLine(expression); + } + return expression; + } + function visitCatchClause(node) { + var ancestorFacts = enterSubtree( + 7104, + 0 + /* HierarchyFacts.BlockScopeIncludes */ + ); + var updated; + ts2.Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); + if (ts2.isBindingPattern(node.variableDeclaration.name)) { + var temp = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + var newVariableDeclaration = factory.createVariableDeclaration(temp); + ts2.setTextRange(newVariableDeclaration, node.variableDeclaration); + var vars = ts2.flattenDestructuringBinding(node.variableDeclaration, visitor, context2, 0, temp); + var list = factory.createVariableDeclarationList(vars); + ts2.setTextRange(list, node.variableDeclaration); + var destructure = factory.createVariableStatement( + /*modifiers*/ + void 0, + list + ); + updated = factory.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } else { + updated = ts2.visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return updated; + } + function addStatementToStartOfBlock(block, statement) { + var transformedStatements = ts2.visitNodes(block.statements, visitor, ts2.isStatement); + return factory.updateBlock(block, __spreadArray9([statement], transformedStatements, true)); + } + function visitMethodDeclaration(node) { + ts2.Debug.assert(!ts2.isComputedPropertyName(node.name)); + var functionExpression = transformFunctionLikeToExpression( + node, + /*location*/ + ts2.moveRangePos(node, -1), + /*name*/ + void 0, + /*container*/ + void 0 + ); + ts2.setEmitFlags(functionExpression, 512 | ts2.getEmitFlags(functionExpression)); + return ts2.setTextRange( + factory.createPropertyAssignment(node.name, functionExpression), + /*location*/ + node + ); + } + function visitAccessorDeclaration(node) { + ts2.Debug.assert(!ts2.isComputedPropertyName(node.name)); + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var ancestorFacts = enterSubtree( + 32670, + 65 + /* HierarchyFacts.FunctionIncludes */ + ); + var updated; + var parameters = ts2.visitParameterList(node.parameters, visitor, context2); + var body = transformFunctionBody(node); + if (node.kind === 174) { + updated = factory.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body); + } else { + updated = factory.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body); + } + exitSubtree( + ancestorFacts, + 98304, + 0 + /* HierarchyFacts.None */ + ); + convertedLoopState = savedConvertedLoopState; + return updated; + } + function visitShorthandPropertyAssignment(node) { + return ts2.setTextRange( + factory.createPropertyAssignment(node.name, visitIdentifier(factory.cloneNode(node.name))), + /*location*/ + node + ); + } + function visitComputedPropertyName(node) { + return ts2.visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + return ts2.visitEachChild(node, visitor, context2); + } + function visitArrayLiteralExpression(node) { + if (ts2.some(node.elements, ts2.isSpreadElement)) { + return transformAndSpreadElements( + node.elements, + /*isArgumentList*/ + false, + !!node.multiLine, + /*hasTrailingComma*/ + !!node.elements.hasTrailingComma + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCallExpression(node) { + if (ts2.getEmitFlags(node) & 33554432) { + return visitTypeScriptClassWrapper(node); + } + var expression = ts2.skipOuterExpressions(node.expression); + if (expression.kind === 106 || ts2.isSuperProperty(expression) || ts2.some(node.arguments, ts2.isSpreadElement)) { + return visitCallExpressionWithPotentialCapturedThisAssignment( + node, + /*assignToCapturedThis*/ + true + ); + } + return factory.updateCallExpression( + node, + ts2.visitNode(node.expression, callExpressionVisitor, ts2.isExpression), + /*typeArguments*/ + void 0, + ts2.visitNodes(node.arguments, visitor, ts2.isExpression) + ); + } + function visitTypeScriptClassWrapper(node) { + var body = ts2.cast(ts2.cast(ts2.skipOuterExpressions(node.expression), ts2.isArrowFunction).body, ts2.isBlock); + var isVariableStatementWithInitializer = function(stmt) { + return ts2.isVariableStatement(stmt) && !!ts2.first(stmt.declarationList.declarations).initializer; + }; + var savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + var bodyStatements = ts2.visitNodes(body.statements, classWrapperStatementVisitor, ts2.isStatement); + convertedLoopState = savedConvertedLoopState; + var classStatements = ts2.filter(bodyStatements, isVariableStatementWithInitializer); + var remainingStatements = ts2.filter(bodyStatements, function(stmt) { + return !isVariableStatementWithInitializer(stmt); + }); + var varStatement = ts2.cast(ts2.first(classStatements), ts2.isVariableStatement); + var variable = varStatement.declarationList.declarations[0]; + var initializer = ts2.skipOuterExpressions(variable.initializer); + var aliasAssignment = ts2.tryCast(initializer, ts2.isAssignmentExpression); + if (!aliasAssignment && ts2.isBinaryExpression(initializer) && initializer.operatorToken.kind === 27) { + aliasAssignment = ts2.tryCast(initializer.left, ts2.isAssignmentExpression); + } + var call = ts2.cast(aliasAssignment ? ts2.skipOuterExpressions(aliasAssignment.right) : initializer, ts2.isCallExpression); + var func = ts2.cast(ts2.skipOuterExpressions(call.expression), ts2.isFunctionExpression); + var funcStatements = func.body.statements; + var classBodyStart = 0; + var classBodyEnd = -1; + var statements = []; + if (aliasAssignment) { + var extendsCall = ts2.tryCast(funcStatements[classBodyStart], ts2.isExpressionStatement); + if (extendsCall) { + statements.push(extendsCall); + classBodyStart++; + } + statements.push(funcStatements[classBodyStart]); + classBodyStart++; + statements.push(factory.createExpressionStatement(factory.createAssignment(aliasAssignment.left, ts2.cast(variable.name, ts2.isIdentifier)))); + } + while (!ts2.isReturnStatement(ts2.elementAt(funcStatements, classBodyEnd))) { + classBodyEnd--; + } + ts2.addRange(statements, funcStatements, classBodyStart, classBodyEnd); + if (classBodyEnd < -1) { + ts2.addRange(statements, funcStatements, classBodyEnd + 1); + } + ts2.addRange(statements, remainingStatements); + ts2.addRange( + statements, + classStatements, + /*start*/ + 1 + ); + return factory.restoreOuterExpressions(node.expression, factory.restoreOuterExpressions(variable.initializer, factory.restoreOuterExpressions(aliasAssignment && aliasAssignment.right, factory.updateCallExpression( + call, + factory.restoreOuterExpressions(call.expression, factory.updateFunctionExpression( + func, + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + func.parameters, + /*type*/ + void 0, + factory.updateBlock(func.body, statements) + )), + /*typeArguments*/ + void 0, + call.arguments + )))); + } + function visitSuperCallInBody(node) { + return visitCallExpressionWithPotentialCapturedThisAssignment( + node, + /*assignToCapturedThis*/ + false + ); + } + function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { + if (node.transformFlags & 32768 || node.expression.kind === 106 || ts2.isSuperProperty(ts2.skipOuterExpressions(node.expression))) { + var _a2 = factory.createCallBinding(node.expression, hoistVariableDeclaration), target = _a2.target, thisArg = _a2.thisArg; + if (node.expression.kind === 106) { + ts2.setEmitFlags( + thisArg, + 4 + /* EmitFlags.NoSubstitution */ + ); + } + var resultingCall = void 0; + if (node.transformFlags & 32768) { + resultingCall = factory.createFunctionApplyCall(ts2.visitNode(target, callExpressionVisitor, ts2.isExpression), node.expression.kind === 106 ? thisArg : ts2.visitNode(thisArg, visitor, ts2.isExpression), transformAndSpreadElements( + node.arguments, + /*isArgumentList*/ + true, + /*multiLine*/ + false, + /*hasTrailingComma*/ + false + )); + } else { + resultingCall = ts2.setTextRange(factory.createFunctionCallCall(ts2.visitNode(target, callExpressionVisitor, ts2.isExpression), node.expression.kind === 106 ? thisArg : ts2.visitNode(thisArg, visitor, ts2.isExpression), ts2.visitNodes(node.arguments, visitor, ts2.isExpression)), node); + } + if (node.expression.kind === 106) { + var initializer = factory.createLogicalOr(resultingCall, createActualThis()); + resultingCall = assignToCapturedThis ? factory.createAssignment(factory.createUniqueName( + "_this", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), initializer) : initializer; + } + return ts2.setOriginalNode(resultingCall, node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitNewExpression(node) { + if (ts2.some(node.arguments, ts2.isSpreadElement)) { + var _a2 = factory.createCallBinding(factory.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration), target = _a2.target, thisArg = _a2.thisArg; + return factory.createNewExpression( + factory.createFunctionApplyCall(ts2.visitNode(target, visitor, ts2.isExpression), thisArg, transformAndSpreadElements( + factory.createNodeArray(__spreadArray9([factory.createVoidZero()], node.arguments, true)), + /*isArgumentList*/ + true, + /*multiLine*/ + false, + /*hasTrailingComma*/ + false + )), + /*typeArguments*/ + void 0, + [] + ); + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformAndSpreadElements(elements, isArgumentList, multiLine, hasTrailingComma) { + var numElements = elements.length; + var segments = ts2.flatten( + // As we visit each element, we return one of two functions to use as the "key": + // - `visitSpanOfSpreads` for one or more contiguous `...` spread expressions, i.e. `...a, ...b` in `[1, 2, ...a, ...b]` + // - `visitSpanOfNonSpreads` for one or more contiguous non-spread elements, i.e. `1, 2`, in `[1, 2, ...a, ...b]` + ts2.spanMap(elements, partitionSpread, function(partition2, visitPartition, _start, end) { + return visitPartition(partition2, multiLine, hasTrailingComma && end === numElements); + }) + ); + if (segments.length === 1) { + var firstSegment = segments[0]; + if (isArgumentList && !compilerOptions.downlevelIteration || ts2.isPackedArrayLiteral(firstSegment.expression) || ts2.isCallToHelper(firstSegment.expression, "___spreadArray")) { + return firstSegment.expression; + } + } + var helpers = emitHelpers(); + var startsWithSpread = segments[0].kind !== 0; + var expression = startsWithSpread ? factory.createArrayLiteralExpression() : segments[0].expression; + for (var i7 = startsWithSpread ? 0 : 1; i7 < segments.length; i7++) { + var segment = segments[i7]; + expression = helpers.createSpreadArrayHelper(expression, segment.expression, segment.kind === 1 && !isArgumentList); + } + return expression; + } + function partitionSpread(node) { + return ts2.isSpreadElement(node) ? visitSpanOfSpreads : visitSpanOfNonSpreads; + } + function visitSpanOfSpreads(chunk2) { + return ts2.map(chunk2, visitExpressionOfSpread); + } + function visitExpressionOfSpread(node) { + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + var isCallToReadHelper = ts2.isCallToHelper(expression, "___read"); + var kind = isCallToReadHelper || ts2.isPackedArrayLiteral(expression) ? 2 : 1; + if (compilerOptions.downlevelIteration && kind === 1 && !ts2.isArrayLiteralExpression(expression) && !isCallToReadHelper) { + expression = emitHelpers().createReadHelper( + expression, + /*count*/ + void 0 + ); + kind = 2; + } + return createSpreadSegment(kind, expression); + } + function visitSpanOfNonSpreads(chunk2, multiLine, hasTrailingComma) { + var expression = factory.createArrayLiteralExpression(ts2.visitNodes(factory.createNodeArray(chunk2, hasTrailingComma), visitor, ts2.isExpression), multiLine); + return createSpreadSegment(0, expression); + } + function visitSpreadElement(node) { + return ts2.visitNode(node.expression, visitor, ts2.isExpression); + } + function visitTemplateLiteral(node) { + return ts2.setTextRange(factory.createStringLiteral(node.text), node); + } + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return ts2.setTextRange(factory.createStringLiteral(node.text), node); + } + return node; + } + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 384) { + return ts2.setTextRange(factory.createNumericLiteral(node.text), node); + } + return node; + } + function visitTaggedTemplateExpression(node) { + return ts2.processTaggedTemplateExpression(context2, node, visitor, currentSourceFile, recordTaggedTemplateString, ts2.ProcessLevel.All); + } + function visitTemplateExpression(node) { + var expression = factory.createStringLiteral(node.head.text); + for (var _i = 0, _a2 = node.templateSpans; _i < _a2.length; _i++) { + var span = _a2[_i]; + var args = [ts2.visitNode(span.expression, visitor, ts2.isExpression)]; + if (span.literal.text.length > 0) { + args.push(factory.createStringLiteral(span.literal.text)); + } + expression = factory.createCallExpression( + factory.createPropertyAccessExpression(expression, "concat"), + /*typeArguments*/ + void 0, + args + ); + } + return ts2.setTextRange(expression, node); + } + function visitSuperKeyword(isExpressionOfCall) { + return hierarchyFacts & 8 && !isExpressionOfCall ? factory.createPropertyAccessExpression(factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), "prototype") : factory.createUniqueName( + "_super", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ); + } + function visitMetaProperty(node) { + if (node.keywordToken === 103 && node.name.escapedText === "target") { + hierarchyFacts |= 32768; + return factory.createUniqueName( + "_newTarget", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ); + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && ts2.isFunctionLike(node)) { + var ancestorFacts = enterSubtree( + 32670, + ts2.getEmitFlags(node) & 8 ? 65 | 16 : 65 + /* HierarchyFacts.FunctionIncludes */ + ); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree( + ancestorFacts, + 0, + 0 + /* HierarchyFacts.None */ + ); + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function enableSubstitutionsForBlockScopedBindings() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + } + } + function enableSubstitutionsForCapturedThis() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 108 + /* SyntaxKind.ThisKeyword */ + ); + context2.enableEmitNotification( + 173 + /* SyntaxKind.Constructor */ + ); + context2.enableEmitNotification( + 171 + /* SyntaxKind.MethodDeclaration */ + ); + context2.enableEmitNotification( + 174 + /* SyntaxKind.GetAccessor */ + ); + context2.enableEmitNotification( + 175 + /* SyntaxKind.SetAccessor */ + ); + context2.enableEmitNotification( + 216 + /* SyntaxKind.ArrowFunction */ + ); + context2.enableEmitNotification( + 215 + /* SyntaxKind.FunctionExpression */ + ); + context2.enableEmitNotification( + 259 + /* SyntaxKind.FunctionDeclaration */ + ); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + if (ts2.isIdentifier(node)) { + return substituteIdentifier(node); + } + return node; + } + function substituteIdentifier(node) { + if (enabledSubstitutions & 2 && !ts2.isInternalName(node)) { + var original = ts2.getParseTreeNode(node, ts2.isIdentifier); + if (original && isNameOfDeclarationWithCollidingName(original)) { + return ts2.setTextRange(factory.getGeneratedNameForNode(original), node); + } + } + return node; + } + function isNameOfDeclarationWithCollidingName(node) { + switch (node.parent.kind) { + case 205: + case 260: + case 263: + case 257: + return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); + } + return false; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + case 108: + return substituteThisKeyword(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (enabledSubstitutions & 2 && !ts2.isInternalName(node)) { + var declaration = resolver.getReferencedDeclarationWithCollidingName(node); + if (declaration && !(ts2.isClassLike(declaration) && isPartOfClassBody(declaration, node))) { + return ts2.setTextRange(factory.getGeneratedNameForNode(ts2.getNameOfDeclaration(declaration)), node); + } + } + return node; + } + function isPartOfClassBody(declaration, node) { + var currentNode = ts2.getParseTreeNode(node); + if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) { + return false; + } + var blockScope = ts2.getEnclosingBlockScopeContainer(declaration); + while (currentNode) { + if (currentNode === blockScope || currentNode === declaration) { + return false; + } + if (ts2.isClassElement(currentNode) && currentNode.parent === declaration) { + return true; + } + currentNode = currentNode.parent; + } + return false; + } + function substituteThisKeyword(node) { + if (enabledSubstitutions & 1 && hierarchyFacts & 16) { + return ts2.setTextRange(factory.createUniqueName( + "_this", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ), node); + } + return node; + } + function getClassMemberPrefix(node, member) { + return ts2.isStatic(member) ? factory.getInternalName(node) : factory.createPropertyAccessExpression(factory.getInternalName(node), "prototype"); + } + function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) { + if (!constructor || !hasExtendsClause) { + return false; + } + if (ts2.some(constructor.parameters)) { + return false; + } + var statement = ts2.firstOrUndefined(constructor.body.statements); + if (!statement || !ts2.nodeIsSynthesized(statement) || statement.kind !== 241) { + return false; + } + var statementExpression = statement.expression; + if (!ts2.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 210) { + return false; + } + var callTarget = statementExpression.expression; + if (!ts2.nodeIsSynthesized(callTarget) || callTarget.kind !== 106) { + return false; + } + var callArgument = ts2.singleOrUndefined(statementExpression.arguments); + if (!callArgument || !ts2.nodeIsSynthesized(callArgument) || callArgument.kind !== 227) { + return false; + } + var expression = callArgument.expression; + return ts2.isIdentifier(expression) && expression.escapedText === "arguments"; + } + } + ts2.transformES2015 = transformES2015; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformES5(context2) { + var factory = context2.factory; + var compilerOptions = context2.getCompilerOptions(); + var previousOnEmitNode; + var noSubstitution; + if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { + previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + context2.enableEmitNotification( + 283 + /* SyntaxKind.JsxOpeningElement */ + ); + context2.enableEmitNotification( + 284 + /* SyntaxKind.JsxClosingElement */ + ); + context2.enableEmitNotification( + 282 + /* SyntaxKind.JsxSelfClosingElement */ + ); + noSubstitution = []; + } + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableSubstitution( + 208 + /* SyntaxKind.PropertyAccessExpression */ + ); + context2.enableSubstitution( + 299 + /* SyntaxKind.PropertyAssignment */ + ); + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + return node; + } + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 283: + case 284: + case 282: + var tagName = node.tagName; + noSubstitution[ts2.getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (ts2.isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } else if (ts2.isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (ts2.isPrivateIdentifier(node.name)) { + return node; + } + var literalName = trySubstituteReservedName(node.name); + if (literalName) { + return ts2.setTextRange(factory.createElementAccessExpression(node.expression, literalName), node); + } + return node; + } + function substitutePropertyAssignment(node) { + var literalName = ts2.isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return factory.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + function trySubstituteReservedName(name2) { + var token = name2.originalKeywordKind || (ts2.nodeIsSynthesized(name2) ? ts2.stringToToken(ts2.idText(name2)) : void 0); + if (token !== void 0 && token >= 81 && token <= 116) { + return ts2.setTextRange(factory.createStringLiteralFromNode(name2), name2); + } + return void 0; + } + } + ts2.transformES5 = transformES5; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var OpCode; + (function(OpCode2) { + OpCode2[OpCode2["Nop"] = 0] = "Nop"; + OpCode2[OpCode2["Statement"] = 1] = "Statement"; + OpCode2[OpCode2["Assign"] = 2] = "Assign"; + OpCode2[OpCode2["Break"] = 3] = "Break"; + OpCode2[OpCode2["BreakWhenTrue"] = 4] = "BreakWhenTrue"; + OpCode2[OpCode2["BreakWhenFalse"] = 5] = "BreakWhenFalse"; + OpCode2[OpCode2["Yield"] = 6] = "Yield"; + OpCode2[OpCode2["YieldStar"] = 7] = "YieldStar"; + OpCode2[OpCode2["Return"] = 8] = "Return"; + OpCode2[OpCode2["Throw"] = 9] = "Throw"; + OpCode2[OpCode2["Endfinally"] = 10] = "Endfinally"; + })(OpCode || (OpCode = {})); + var BlockAction; + (function(BlockAction2) { + BlockAction2[BlockAction2["Open"] = 0] = "Open"; + BlockAction2[BlockAction2["Close"] = 1] = "Close"; + })(BlockAction || (BlockAction = {})); + var CodeBlockKind; + (function(CodeBlockKind2) { + CodeBlockKind2[CodeBlockKind2["Exception"] = 0] = "Exception"; + CodeBlockKind2[CodeBlockKind2["With"] = 1] = "With"; + CodeBlockKind2[CodeBlockKind2["Switch"] = 2] = "Switch"; + CodeBlockKind2[CodeBlockKind2["Loop"] = 3] = "Loop"; + CodeBlockKind2[CodeBlockKind2["Labeled"] = 4] = "Labeled"; + })(CodeBlockKind || (CodeBlockKind = {})); + var ExceptionBlockState; + (function(ExceptionBlockState2) { + ExceptionBlockState2[ExceptionBlockState2["Try"] = 0] = "Try"; + ExceptionBlockState2[ExceptionBlockState2["Catch"] = 1] = "Catch"; + ExceptionBlockState2[ExceptionBlockState2["Finally"] = 2] = "Finally"; + ExceptionBlockState2[ExceptionBlockState2["Done"] = 3] = "Done"; + })(ExceptionBlockState || (ExceptionBlockState = {})); + var Instruction; + (function(Instruction2) { + Instruction2[Instruction2["Next"] = 0] = "Next"; + Instruction2[Instruction2["Throw"] = 1] = "Throw"; + Instruction2[Instruction2["Return"] = 2] = "Return"; + Instruction2[Instruction2["Break"] = 3] = "Break"; + Instruction2[Instruction2["Yield"] = 4] = "Yield"; + Instruction2[Instruction2["YieldStar"] = 5] = "YieldStar"; + Instruction2[Instruction2["Catch"] = 6] = "Catch"; + Instruction2[Instruction2["Endfinally"] = 7] = "Endfinally"; + })(Instruction || (Instruction = {})); + function getInstructionName(instruction) { + switch (instruction) { + case 2: + return "return"; + case 3: + return "break"; + case 4: + return "yield"; + case 5: + return "yield*"; + case 7: + return "endfinally"; + default: + return void 0; + } + } + function transformGenerators(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, resumeLexicalEnvironment = context2.resumeLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistFunctionDeclaration = context2.hoistFunctionDeclaration, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var resolver = context2.getEmitResolver(); + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + var renamedCatchVariables; + var renamedCatchVariableDeclarations; + var inGeneratorFunctionBody; + var inStatementContainingYield; + var blocks; + var blockOffsets; + var blockActions; + var blockStack; + var labelOffsets; + var labelExpressions; + var nextLabelId = 1; + var operations; + var operationArguments; + var operationLocations; + var state; + var blockIndex = 0; + var labelNumber = 0; + var labelNumbers; + var lastOperationWasAbrupt; + var lastOperationWasCompletion; + var clauses; + var statements; + var exceptionBlockStack; + var currentExceptionBlock; + var withBlockStack; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || (node.transformFlags & 2048) === 0) { + return node; + } + var visited = ts2.visitEachChild(node, visitor, context2); + ts2.addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function visitor(node) { + var transformFlags = node.transformFlags; + if (inStatementContainingYield) { + return visitJavaScriptInStatementContainingYield(node); + } else if (inGeneratorFunctionBody) { + return visitJavaScriptInGeneratorFunctionBody(node); + } else if (ts2.isFunctionLikeDeclaration(node) && node.asteriskToken) { + return visitGenerator(node); + } else if (transformFlags & 2048) { + return ts2.visitEachChild(node, visitor, context2); + } else { + return node; + } + } + function visitJavaScriptInStatementContainingYield(node) { + switch (node.kind) { + case 243: + return visitDoStatement(node); + case 244: + return visitWhileStatement(node); + case 252: + return visitSwitchStatement(node); + case 253: + return visitLabeledStatement(node); + default: + return visitJavaScriptInGeneratorFunctionBody(node); + } + } + function visitJavaScriptInGeneratorFunctionBody(node) { + switch (node.kind) { + case 259: + return visitFunctionDeclaration(node); + case 215: + return visitFunctionExpression(node); + case 174: + case 175: + return visitAccessorDeclaration(node); + case 240: + return visitVariableStatement(node); + case 245: + return visitForStatement(node); + case 246: + return visitForInStatement(node); + case 249: + return visitBreakStatement(node); + case 248: + return visitContinueStatement(node); + case 250: + return visitReturnStatement(node); + default: + if (node.transformFlags & 1048576) { + return visitJavaScriptContainingYield(node); + } else if (node.transformFlags & (2048 | 4194304)) { + return ts2.visitEachChild(node, visitor, context2); + } else { + return node; + } + } + } + function visitJavaScriptContainingYield(node) { + switch (node.kind) { + case 223: + return visitBinaryExpression(node); + case 354: + return visitCommaListExpression(node); + case 224: + return visitConditionalExpression(node); + case 226: + return visitYieldExpression(node); + case 206: + return visitArrayLiteralExpression(node); + case 207: + return visitObjectLiteralExpression(node); + case 209: + return visitElementAccessExpression(node); + case 210: + return visitCallExpression(node); + case 211: + return visitNewExpression(node); + default: + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitGenerator(node) { + switch (node.kind) { + case 259: + return visitFunctionDeclaration(node); + case 215: + return visitFunctionExpression(node); + default: + return ts2.Debug.failBadSyntaxKind(node); + } + } + function visitFunctionDeclaration(node) { + if (node.asteriskToken) { + node = ts2.setOriginalNode(ts2.setTextRange( + factory.createFunctionDeclaration( + node.modifiers, + /*asteriskToken*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformGeneratorFunctionBody(node.body) + ), + /*location*/ + node + ), node); + } else { + var savedInGeneratorFunctionBody = inGeneratorFunctionBody; + var savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = ts2.visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + } + if (inGeneratorFunctionBody) { + hoistFunctionDeclaration(node); + return void 0; + } else { + return node; + } + } + function visitFunctionExpression(node) { + if (node.asteriskToken) { + node = ts2.setOriginalNode(ts2.setTextRange( + factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + ts2.visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformGeneratorFunctionBody(node.body) + ), + /*location*/ + node + ), node); + } else { + var savedInGeneratorFunctionBody = inGeneratorFunctionBody; + var savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = ts2.visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + } + return node; + } + function visitAccessorDeclaration(node) { + var savedInGeneratorFunctionBody = inGeneratorFunctionBody; + var savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = ts2.visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + return node; + } + function transformGeneratorFunctionBody(body) { + var statements2 = []; + var savedInGeneratorFunctionBody = inGeneratorFunctionBody; + var savedInStatementContainingYield = inStatementContainingYield; + var savedBlocks = blocks; + var savedBlockOffsets = blockOffsets; + var savedBlockActions = blockActions; + var savedBlockStack = blockStack; + var savedLabelOffsets = labelOffsets; + var savedLabelExpressions = labelExpressions; + var savedNextLabelId = nextLabelId; + var savedOperations = operations; + var savedOperationArguments = operationArguments; + var savedOperationLocations = operationLocations; + var savedState = state; + inGeneratorFunctionBody = true; + inStatementContainingYield = false; + blocks = void 0; + blockOffsets = void 0; + blockActions = void 0; + blockStack = void 0; + labelOffsets = void 0; + labelExpressions = void 0; + nextLabelId = 1; + operations = void 0; + operationArguments = void 0; + operationLocations = void 0; + state = factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + resumeLexicalEnvironment(); + var statementOffset = factory.copyPrologue( + body.statements, + statements2, + /*ensureUseStrict*/ + false, + visitor + ); + transformAndEmitStatements(body.statements, statementOffset); + var buildResult = build(); + ts2.insertStatementsAfterStandardPrologue(statements2, endLexicalEnvironment()); + statements2.push(factory.createReturnStatement(buildResult)); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + blocks = savedBlocks; + blockOffsets = savedBlockOffsets; + blockActions = savedBlockActions; + blockStack = savedBlockStack; + labelOffsets = savedLabelOffsets; + labelExpressions = savedLabelExpressions; + nextLabelId = savedNextLabelId; + operations = savedOperations; + operationArguments = savedOperationArguments; + operationLocations = savedOperationLocations; + state = savedState; + return ts2.setTextRange(factory.createBlock(statements2, body.multiLine), body); + } + function visitVariableStatement(node) { + if (node.transformFlags & 1048576) { + transformAndEmitVariableDeclarationList(node.declarationList); + return void 0; + } else { + if (ts2.getEmitFlags(node) & 1048576) { + return node; + } + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + hoistVariableDeclaration(variable.name); + } + var variables = ts2.getInitializedVariables(node.declarationList); + if (variables.length === 0) { + return void 0; + } + return ts2.setSourceMapRange(factory.createExpressionStatement(factory.inlineExpressions(ts2.map(variables, transformInitializedVariable))), node); + } + } + function visitBinaryExpression(node) { + var assoc = ts2.getExpressionAssociativity(node); + switch (assoc) { + case 0: + return visitLeftAssociativeBinaryExpression(node); + case 1: + return visitRightAssociativeBinaryExpression(node); + default: + return ts2.Debug.assertNever(assoc); + } + } + function visitRightAssociativeBinaryExpression(node) { + var left = node.left, right = node.right; + if (containsYield(right)) { + var target = void 0; + switch (left.kind) { + case 208: + target = factory.updatePropertyAccessExpression(left, cacheExpression(ts2.visitNode(left.expression, visitor, ts2.isLeftHandSideExpression)), left.name); + break; + case 209: + target = factory.updateElementAccessExpression(left, cacheExpression(ts2.visitNode(left.expression, visitor, ts2.isLeftHandSideExpression)), cacheExpression(ts2.visitNode(left.argumentExpression, visitor, ts2.isExpression))); + break; + default: + target = ts2.visitNode(left, visitor, ts2.isExpression); + break; + } + var operator = node.operatorToken.kind; + if (ts2.isCompoundAssignment(operator)) { + return ts2.setTextRange(factory.createAssignment(target, ts2.setTextRange(factory.createBinaryExpression(cacheExpression(target), ts2.getNonAssignmentOperatorForCompoundAssignment(operator), ts2.visitNode(right, visitor, ts2.isExpression)), node)), node); + } else { + return factory.updateBinaryExpression(node, target, node.operatorToken, ts2.visitNode(right, visitor, ts2.isExpression)); + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitLeftAssociativeBinaryExpression(node) { + if (containsYield(node.right)) { + if (ts2.isLogicalOperator(node.operatorToken.kind)) { + return visitLogicalBinaryExpression(node); + } else if (node.operatorToken.kind === 27) { + return visitCommaExpression(node); + } + return factory.updateBinaryExpression(node, cacheExpression(ts2.visitNode(node.left, visitor, ts2.isExpression)), node.operatorToken, ts2.visitNode(node.right, visitor, ts2.isExpression)); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCommaExpression(node) { + var pendingExpressions = []; + visit7(node.left); + visit7(node.right); + return factory.inlineExpressions(pendingExpressions); + function visit7(node2) { + if (ts2.isBinaryExpression(node2) && node2.operatorToken.kind === 27) { + visit7(node2.left); + visit7(node2.right); + } else { + if (containsYield(node2) && pendingExpressions.length > 0) { + emitWorker(1, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts2.visitNode(node2, visitor, ts2.isExpression)); + } + } + } + function visitCommaListExpression(node) { + var pendingExpressions = []; + for (var _i = 0, _a2 = node.elements; _i < _a2.length; _i++) { + var elem = _a2[_i]; + if (ts2.isBinaryExpression(elem) && elem.operatorToken.kind === 27) { + pendingExpressions.push(visitCommaExpression(elem)); + } else { + if (containsYield(elem) && pendingExpressions.length > 0) { + emitWorker(1, [factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(ts2.visitNode(elem, visitor, ts2.isExpression)); + } + } + return factory.inlineExpressions(pendingExpressions); + } + function visitLogicalBinaryExpression(node) { + var resultLabel = defineLabel(); + var resultLocal = declareLocal(); + emitAssignment( + resultLocal, + ts2.visitNode(node.left, visitor, ts2.isExpression), + /*location*/ + node.left + ); + if (node.operatorToken.kind === 55) { + emitBreakWhenFalse( + resultLabel, + resultLocal, + /*location*/ + node.left + ); + } else { + emitBreakWhenTrue( + resultLabel, + resultLocal, + /*location*/ + node.left + ); + } + emitAssignment( + resultLocal, + ts2.visitNode(node.right, visitor, ts2.isExpression), + /*location*/ + node.right + ); + markLabel(resultLabel); + return resultLocal; + } + function visitConditionalExpression(node) { + if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) { + var whenFalseLabel = defineLabel(); + var resultLabel = defineLabel(); + var resultLocal = declareLocal(); + emitBreakWhenFalse( + whenFalseLabel, + ts2.visitNode(node.condition, visitor, ts2.isExpression), + /*location*/ + node.condition + ); + emitAssignment( + resultLocal, + ts2.visitNode(node.whenTrue, visitor, ts2.isExpression), + /*location*/ + node.whenTrue + ); + emitBreak(resultLabel); + markLabel(whenFalseLabel); + emitAssignment( + resultLocal, + ts2.visitNode(node.whenFalse, visitor, ts2.isExpression), + /*location*/ + node.whenFalse + ); + markLabel(resultLabel); + return resultLocal; + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + var resumeLabel = defineLabel(); + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + if (node.asteriskToken) { + var iterator = (ts2.getEmitFlags(node.expression) & 8388608) === 0 ? ts2.setTextRange(emitHelpers().createValuesHelper(expression), node) : expression; + emitYieldStar( + iterator, + /*location*/ + node + ); + } else { + emitYield( + expression, + /*location*/ + node + ); + } + markLabel(resumeLabel); + return createGeneratorResume( + /*location*/ + node + ); + } + function visitArrayLiteralExpression(node) { + return visitElements( + node.elements, + /*leadingElement*/ + void 0, + /*location*/ + void 0, + node.multiLine + ); + } + function visitElements(elements, leadingElement, location2, multiLine) { + var numInitialElements = countInitialNodesWithoutYield(elements); + var temp; + if (numInitialElements > 0) { + temp = declareLocal(); + var initialElements = ts2.visitNodes(elements, visitor, ts2.isExpression, 0, numInitialElements); + emitAssignment(temp, factory.createArrayLiteralExpression(leadingElement ? __spreadArray9([leadingElement], initialElements, true) : initialElements)); + leadingElement = void 0; + } + var expressions = ts2.reduceLeft(elements, reduceElement, [], numInitialElements); + return temp ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions, multiLine)]) : ts2.setTextRange(factory.createArrayLiteralExpression(leadingElement ? __spreadArray9([leadingElement], expressions, true) : expressions, multiLine), location2); + function reduceElement(expressions2, element) { + if (containsYield(element) && expressions2.length > 0) { + var hasAssignedTemp = temp !== void 0; + if (!temp) { + temp = declareLocal(); + } + emitAssignment(temp, hasAssignedTemp ? factory.createArrayConcatCall(temp, [factory.createArrayLiteralExpression(expressions2, multiLine)]) : factory.createArrayLiteralExpression(leadingElement ? __spreadArray9([leadingElement], expressions2, true) : expressions2, multiLine)); + leadingElement = void 0; + expressions2 = []; + } + expressions2.push(ts2.visitNode(element, visitor, ts2.isExpression)); + return expressions2; + } + } + function visitObjectLiteralExpression(node) { + var properties = node.properties; + var multiLine = node.multiLine; + var numInitialProperties = countInitialNodesWithoutYield(properties); + var temp = declareLocal(); + emitAssignment(temp, factory.createObjectLiteralExpression(ts2.visitNodes(properties, visitor, ts2.isObjectLiteralElementLike, 0, numInitialProperties), multiLine)); + var expressions = ts2.reduceLeft(properties, reduceProperty, [], numInitialProperties); + expressions.push(multiLine ? ts2.startOnNewLine(ts2.setParent(ts2.setTextRange(factory.cloneNode(temp), temp), temp.parent)) : temp); + return factory.inlineExpressions(expressions); + function reduceProperty(expressions2, property2) { + if (containsYield(property2) && expressions2.length > 0) { + emitStatement(factory.createExpressionStatement(factory.inlineExpressions(expressions2))); + expressions2 = []; + } + var expression = ts2.createExpressionForObjectLiteralElementLike(factory, node, property2, temp); + var visited = ts2.visitNode(expression, visitor, ts2.isExpression); + if (visited) { + if (multiLine) { + ts2.startOnNewLine(visited); + } + expressions2.push(visited); + } + return expressions2; + } + } + function visitElementAccessExpression(node) { + if (containsYield(node.argumentExpression)) { + return factory.updateElementAccessExpression(node, cacheExpression(ts2.visitNode(node.expression, visitor, ts2.isLeftHandSideExpression)), ts2.visitNode(node.argumentExpression, visitor, ts2.isExpression)); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitCallExpression(node) { + if (!ts2.isImportCall(node) && ts2.forEach(node.arguments, containsYield)) { + var _a2 = factory.createCallBinding( + node.expression, + hoistVariableDeclaration, + languageVersion, + /*cacheIdentifiers*/ + true + ), target = _a2.target, thisArg = _a2.thisArg; + return ts2.setOriginalNode(ts2.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts2.visitNode(target, visitor, ts2.isLeftHandSideExpression)), thisArg, visitElements(node.arguments)), node), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitNewExpression(node) { + if (ts2.forEach(node.arguments, containsYield)) { + var _a2 = factory.createCallBinding(factory.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration), target = _a2.target, thisArg = _a2.thisArg; + return ts2.setOriginalNode(ts2.setTextRange(factory.createNewExpression( + factory.createFunctionApplyCall(cacheExpression(ts2.visitNode(target, visitor, ts2.isExpression)), thisArg, visitElements( + node.arguments, + /*leadingElement*/ + factory.createVoidZero() + )), + /*typeArguments*/ + void 0, + [] + ), node), node); + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformAndEmitStatements(statements2, start) { + if (start === void 0) { + start = 0; + } + var numStatements = statements2.length; + for (var i7 = start; i7 < numStatements; i7++) { + transformAndEmitStatement(statements2[i7]); + } + } + function transformAndEmitEmbeddedStatement(node) { + if (ts2.isBlock(node)) { + transformAndEmitStatements(node.statements); + } else { + transformAndEmitStatement(node); + } + } + function transformAndEmitStatement(node) { + var savedInStatementContainingYield = inStatementContainingYield; + if (!inStatementContainingYield) { + inStatementContainingYield = containsYield(node); + } + transformAndEmitStatementWorker(node); + inStatementContainingYield = savedInStatementContainingYield; + } + function transformAndEmitStatementWorker(node) { + switch (node.kind) { + case 238: + return transformAndEmitBlock(node); + case 241: + return transformAndEmitExpressionStatement(node); + case 242: + return transformAndEmitIfStatement(node); + case 243: + return transformAndEmitDoStatement(node); + case 244: + return transformAndEmitWhileStatement(node); + case 245: + return transformAndEmitForStatement(node); + case 246: + return transformAndEmitForInStatement(node); + case 248: + return transformAndEmitContinueStatement(node); + case 249: + return transformAndEmitBreakStatement(node); + case 250: + return transformAndEmitReturnStatement(node); + case 251: + return transformAndEmitWithStatement(node); + case 252: + return transformAndEmitSwitchStatement(node); + case 253: + return transformAndEmitLabeledStatement(node); + case 254: + return transformAndEmitThrowStatement(node); + case 255: + return transformAndEmitTryStatement(node); + default: + return emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function transformAndEmitBlock(node) { + if (containsYield(node)) { + transformAndEmitStatements(node.statements); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function transformAndEmitExpressionStatement(node) { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + function transformAndEmitVariableDeclarationList(node) { + for (var _i = 0, _a2 = node.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + var name2 = factory.cloneNode(variable.name); + ts2.setCommentRange(name2, variable.name); + hoistVariableDeclaration(name2); + } + var variables = ts2.getInitializedVariables(node); + var numVariables = variables.length; + var variablesWritten = 0; + var pendingExpressions = []; + while (variablesWritten < numVariables) { + for (var i7 = variablesWritten; i7 < numVariables; i7++) { + var variable = variables[i7]; + if (containsYield(variable.initializer) && pendingExpressions.length > 0) { + break; + } + pendingExpressions.push(transformInitializedVariable(variable)); + } + if (pendingExpressions.length) { + emitStatement(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))); + variablesWritten += pendingExpressions.length; + pendingExpressions = []; + } + } + return void 0; + } + function transformInitializedVariable(node) { + return ts2.setSourceMapRange(factory.createAssignment(ts2.setSourceMapRange(factory.cloneNode(node.name), node.name), ts2.visitNode(node.initializer, visitor, ts2.isExpression)), node); + } + function transformAndEmitIfStatement(node) { + if (containsYield(node)) { + if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { + var endLabel = defineLabel(); + var elseLabel = node.elseStatement ? defineLabel() : void 0; + emitBreakWhenFalse( + node.elseStatement ? elseLabel : endLabel, + ts2.visitNode(node.expression, visitor, ts2.isExpression), + /*location*/ + node.expression + ); + transformAndEmitEmbeddedStatement(node.thenStatement); + if (node.elseStatement) { + emitBreak(endLabel); + markLabel(elseLabel); + transformAndEmitEmbeddedStatement(node.elseStatement); + } + markLabel(endLabel); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function transformAndEmitDoStatement(node) { + if (containsYield(node)) { + var conditionLabel = defineLabel(); + var loopLabel = defineLabel(); + beginLoopBlock( + /*continueLabel*/ + conditionLabel + ); + markLabel(loopLabel); + transformAndEmitEmbeddedStatement(node.statement); + markLabel(conditionLabel); + emitBreakWhenTrue(loopLabel, ts2.visitNode(node.expression, visitor, ts2.isExpression)); + endLoopBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitDoStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + node = ts2.visitEachChild(node, visitor, context2); + endLoopBlock(); + return node; + } else { + return ts2.visitEachChild(node, visitor, context2); + } + } + function transformAndEmitWhileStatement(node) { + if (containsYield(node)) { + var loopLabel = defineLabel(); + var endLabel = beginLoopBlock(loopLabel); + markLabel(loopLabel); + emitBreakWhenFalse(endLabel, ts2.visitNode(node.expression, visitor, ts2.isExpression)); + transformAndEmitEmbeddedStatement(node.statement); + emitBreak(loopLabel); + endLoopBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitWhileStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + node = ts2.visitEachChild(node, visitor, context2); + endLoopBlock(); + return node; + } else { + return ts2.visitEachChild(node, visitor, context2); + } + } + function transformAndEmitForStatement(node) { + if (containsYield(node)) { + var conditionLabel = defineLabel(); + var incrementLabel = defineLabel(); + var endLabel = beginLoopBlock(incrementLabel); + if (node.initializer) { + var initializer = node.initializer; + if (ts2.isVariableDeclarationList(initializer)) { + transformAndEmitVariableDeclarationList(initializer); + } else { + emitStatement(ts2.setTextRange(factory.createExpressionStatement(ts2.visitNode(initializer, visitor, ts2.isExpression)), initializer)); + } + } + markLabel(conditionLabel); + if (node.condition) { + emitBreakWhenFalse(endLabel, ts2.visitNode(node.condition, visitor, ts2.isExpression)); + } + transformAndEmitEmbeddedStatement(node.statement); + markLabel(incrementLabel); + if (node.incrementor) { + emitStatement(ts2.setTextRange(factory.createExpressionStatement(ts2.visitNode(node.incrementor, visitor, ts2.isExpression)), node.incrementor)); + } + emitBreak(conditionLabel); + endLoopBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitForStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + } + var initializer = node.initializer; + if (initializer && ts2.isVariableDeclarationList(initializer)) { + for (var _i = 0, _a2 = initializer.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + hoistVariableDeclaration(variable.name); + } + var variables = ts2.getInitializedVariables(initializer); + node = factory.updateForStatement(node, variables.length > 0 ? factory.inlineExpressions(ts2.map(variables, transformInitializedVariable)) : void 0, ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, visitor, context2)); + } else { + node = ts2.visitEachChild(node, visitor, context2); + } + if (inStatementContainingYield) { + endLoopBlock(); + } + return node; + } + function transformAndEmitForInStatement(node) { + if (containsYield(node)) { + var obj = declareLocal(); + var keysArray = declareLocal(); + var key = declareLocal(); + var keysIndex = factory.createLoopVariable(); + var initializer = node.initializer; + hoistVariableDeclaration(keysIndex); + emitAssignment(obj, ts2.visitNode(node.expression, visitor, ts2.isExpression)); + emitAssignment(keysArray, factory.createArrayLiteralExpression()); + emitStatement(factory.createForInStatement(key, obj, factory.createExpressionStatement(factory.createCallExpression( + factory.createPropertyAccessExpression(keysArray, "push"), + /*typeArguments*/ + void 0, + [key] + )))); + emitAssignment(keysIndex, factory.createNumericLiteral(0)); + var conditionLabel = defineLabel(); + var incrementLabel = defineLabel(); + var endLoopLabel = beginLoopBlock(incrementLabel); + markLabel(conditionLabel); + emitBreakWhenFalse(endLoopLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, "length"))); + emitAssignment(key, factory.createElementAccessExpression(keysArray, keysIndex)); + emitBreakWhenFalse(incrementLabel, factory.createBinaryExpression(key, 101, obj)); + var variable = void 0; + if (ts2.isVariableDeclarationList(initializer)) { + for (var _i = 0, _a2 = initializer.declarations; _i < _a2.length; _i++) { + var variable_1 = _a2[_i]; + hoistVariableDeclaration(variable_1.name); + } + variable = factory.cloneNode(initializer.declarations[0].name); + } else { + variable = ts2.visitNode(initializer, visitor, ts2.isExpression); + ts2.Debug.assert(ts2.isLeftHandSideExpression(variable)); + } + emitAssignment(variable, key); + transformAndEmitEmbeddedStatement(node.statement); + markLabel(incrementLabel); + emitStatement(factory.createExpressionStatement(factory.createPostfixIncrement(keysIndex))); + emitBreak(conditionLabel); + endLoopBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitForInStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + } + var initializer = node.initializer; + if (ts2.isVariableDeclarationList(initializer)) { + for (var _i = 0, _a2 = initializer.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + hoistVariableDeclaration(variable.name); + } + node = factory.updateForInStatement(node, initializer.declarations[0].name, ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitNode(node.statement, visitor, ts2.isStatement, factory.liftToBlock)); + } else { + node = ts2.visitEachChild(node, visitor, context2); + } + if (inStatementContainingYield) { + endLoopBlock(); + } + return node; + } + function transformAndEmitContinueStatement(node) { + var label = findContinueTarget(node.label ? ts2.idText(node.label) : void 0); + if (label > 0) { + emitBreak( + label, + /*location*/ + node + ); + } else { + emitStatement(node); + } + } + function visitContinueStatement(node) { + if (inStatementContainingYield) { + var label = findContinueTarget(node.label && ts2.idText(node.label)); + if (label > 0) { + return createInlineBreak( + label, + /*location*/ + node + ); + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformAndEmitBreakStatement(node) { + var label = findBreakTarget(node.label ? ts2.idText(node.label) : void 0); + if (label > 0) { + emitBreak( + label, + /*location*/ + node + ); + } else { + emitStatement(node); + } + } + function visitBreakStatement(node) { + if (inStatementContainingYield) { + var label = findBreakTarget(node.label && ts2.idText(node.label)); + if (label > 0) { + return createInlineBreak( + label, + /*location*/ + node + ); + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function transformAndEmitReturnStatement(node) { + emitReturn( + ts2.visitNode(node.expression, visitor, ts2.isExpression), + /*location*/ + node + ); + } + function visitReturnStatement(node) { + return createInlineReturn( + ts2.visitNode(node.expression, visitor, ts2.isExpression), + /*location*/ + node + ); + } + function transformAndEmitWithStatement(node) { + if (containsYield(node)) { + beginWithBlock(cacheExpression(ts2.visitNode(node.expression, visitor, ts2.isExpression))); + transformAndEmitEmbeddedStatement(node.statement); + endWithBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function transformAndEmitSwitchStatement(node) { + if (containsYield(node.caseBlock)) { + var caseBlock = node.caseBlock; + var numClauses = caseBlock.clauses.length; + var endLabel = beginSwitchBlock(); + var expression = cacheExpression(ts2.visitNode(node.expression, visitor, ts2.isExpression)); + var clauseLabels = []; + var defaultClauseIndex = -1; + for (var i7 = 0; i7 < numClauses; i7++) { + var clause = caseBlock.clauses[i7]; + clauseLabels.push(defineLabel()); + if (clause.kind === 293 && defaultClauseIndex === -1) { + defaultClauseIndex = i7; + } + } + var clausesWritten = 0; + var pendingClauses = []; + while (clausesWritten < numClauses) { + var defaultClausesSkipped = 0; + for (var i7 = clausesWritten; i7 < numClauses; i7++) { + var clause = caseBlock.clauses[i7]; + if (clause.kind === 292) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { + break; + } + pendingClauses.push(factory.createCaseClause(ts2.visitNode(clause.expression, visitor, ts2.isExpression), [ + createInlineBreak( + clauseLabels[i7], + /*location*/ + clause.expression + ) + ])); + } else { + defaultClausesSkipped++; + } + } + if (pendingClauses.length) { + emitStatement(factory.createSwitchStatement(expression, factory.createCaseBlock(pendingClauses))); + clausesWritten += pendingClauses.length; + pendingClauses = []; + } + if (defaultClausesSkipped > 0) { + clausesWritten += defaultClausesSkipped; + defaultClausesSkipped = 0; + } + } + if (defaultClauseIndex >= 0) { + emitBreak(clauseLabels[defaultClauseIndex]); + } else { + emitBreak(endLabel); + } + for (var i7 = 0; i7 < numClauses; i7++) { + markLabel(clauseLabels[i7]); + transformAndEmitStatements(caseBlock.clauses[i7].statements); + } + endSwitchBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitSwitchStatement(node) { + if (inStatementContainingYield) { + beginScriptSwitchBlock(); + } + node = ts2.visitEachChild(node, visitor, context2); + if (inStatementContainingYield) { + endSwitchBlock(); + } + return node; + } + function transformAndEmitLabeledStatement(node) { + if (containsYield(node)) { + beginLabeledBlock(ts2.idText(node.label)); + transformAndEmitEmbeddedStatement(node.statement); + endLabeledBlock(); + } else { + emitStatement(ts2.visitNode(node, visitor, ts2.isStatement)); + } + } + function visitLabeledStatement(node) { + if (inStatementContainingYield) { + beginScriptLabeledBlock(ts2.idText(node.label)); + } + node = ts2.visitEachChild(node, visitor, context2); + if (inStatementContainingYield) { + endLabeledBlock(); + } + return node; + } + function transformAndEmitThrowStatement(node) { + var _a2; + emitThrow( + ts2.visitNode((_a2 = node.expression) !== null && _a2 !== void 0 ? _a2 : factory.createVoidZero(), visitor, ts2.isExpression), + /*location*/ + node + ); + } + function transformAndEmitTryStatement(node) { + if (containsYield(node)) { + beginExceptionBlock(); + transformAndEmitEmbeddedStatement(node.tryBlock); + if (node.catchClause) { + beginCatchBlock(node.catchClause.variableDeclaration); + transformAndEmitEmbeddedStatement(node.catchClause.block); + } + if (node.finallyBlock) { + beginFinallyBlock(); + transformAndEmitEmbeddedStatement(node.finallyBlock); + } + endExceptionBlock(); + } else { + emitStatement(ts2.visitEachChild(node, visitor, context2)); + } + } + function containsYield(node) { + return !!node && (node.transformFlags & 1048576) !== 0; + } + function countInitialNodesWithoutYield(nodes) { + var numNodes = nodes.length; + for (var i7 = 0; i7 < numNodes; i7++) { + if (containsYield(nodes[i7])) { + return i7; + } + } + return -1; + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + if (ts2.isIdentifier(node)) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (!ts2.isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(ts2.idText(node))) { + var original = ts2.getOriginalNode(node); + if (ts2.isIdentifier(original) && original.parent) { + var declaration = resolver.getReferencedValueDeclaration(original); + if (declaration) { + var name2 = renamedCatchVariableDeclarations[ts2.getOriginalNodeId(declaration)]; + if (name2) { + var clone_6 = ts2.setParent(ts2.setTextRange(factory.cloneNode(name2), name2), name2.parent); + ts2.setSourceMapRange(clone_6, node); + ts2.setCommentRange(clone_6, node); + return clone_6; + } + } + } + } + return node; + } + function cacheExpression(node) { + if (ts2.isGeneratedIdentifier(node) || ts2.getEmitFlags(node) & 4096) { + return node; + } + var temp = factory.createTempVariable(hoistVariableDeclaration); + emitAssignment( + temp, + node, + /*location*/ + node + ); + return temp; + } + function declareLocal(name2) { + var temp = name2 ? factory.createUniqueName(name2) : factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + hoistVariableDeclaration(temp); + return temp; + } + function defineLabel() { + if (!labelOffsets) { + labelOffsets = []; + } + var label = nextLabelId; + nextLabelId++; + labelOffsets[label] = -1; + return label; + } + function markLabel(label) { + ts2.Debug.assert(labelOffsets !== void 0, "No labels were defined."); + labelOffsets[label] = operations ? operations.length : 0; + } + function beginBlock(block) { + if (!blocks) { + blocks = []; + blockActions = []; + blockOffsets = []; + blockStack = []; + } + var index4 = blockActions.length; + blockActions[index4] = 0; + blockOffsets[index4] = operations ? operations.length : 0; + blocks[index4] = block; + blockStack.push(block); + return index4; + } + function endBlock() { + var block = peekBlock(); + if (block === void 0) + return ts2.Debug.fail("beginBlock was never called."); + var index4 = blockActions.length; + blockActions[index4] = 1; + blockOffsets[index4] = operations ? operations.length : 0; + blocks[index4] = block; + blockStack.pop(); + return block; + } + function peekBlock() { + return ts2.lastOrUndefined(blockStack); + } + function peekBlockKind() { + var block = peekBlock(); + return block && block.kind; + } + function beginWithBlock(expression) { + var startLabel = defineLabel(); + var endLabel = defineLabel(); + markLabel(startLabel); + beginBlock({ + kind: 1, + expression, + startLabel, + endLabel + }); + } + function endWithBlock() { + ts2.Debug.assert( + peekBlockKind() === 1 + /* CodeBlockKind.With */ + ); + var block = endBlock(); + markLabel(block.endLabel); + } + function beginExceptionBlock() { + var startLabel = defineLabel(); + var endLabel = defineLabel(); + markLabel(startLabel); + beginBlock({ + kind: 0, + state: 0, + startLabel, + endLabel + }); + emitNop(); + return endLabel; + } + function beginCatchBlock(variable) { + ts2.Debug.assert( + peekBlockKind() === 0 + /* CodeBlockKind.Exception */ + ); + var name2; + if (ts2.isGeneratedIdentifier(variable.name)) { + name2 = variable.name; + hoistVariableDeclaration(variable.name); + } else { + var text = ts2.idText(variable.name); + name2 = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = new ts2.Map(); + renamedCatchVariableDeclarations = []; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[ts2.getOriginalNodeId(variable)] = name2; + } + var exception2 = peekBlock(); + ts2.Debug.assert( + exception2.state < 1 + /* ExceptionBlockState.Catch */ + ); + var endLabel = exception2.endLabel; + emitBreak(endLabel); + var catchLabel = defineLabel(); + markLabel(catchLabel); + exception2.state = 1; + exception2.catchVariable = name2; + exception2.catchLabel = catchLabel; + emitAssignment(name2, factory.createCallExpression( + factory.createPropertyAccessExpression(state, "sent"), + /*typeArguments*/ + void 0, + [] + )); + emitNop(); + } + function beginFinallyBlock() { + ts2.Debug.assert( + peekBlockKind() === 0 + /* CodeBlockKind.Exception */ + ); + var exception2 = peekBlock(); + ts2.Debug.assert( + exception2.state < 2 + /* ExceptionBlockState.Finally */ + ); + var endLabel = exception2.endLabel; + emitBreak(endLabel); + var finallyLabel = defineLabel(); + markLabel(finallyLabel); + exception2.state = 2; + exception2.finallyLabel = finallyLabel; + } + function endExceptionBlock() { + ts2.Debug.assert( + peekBlockKind() === 0 + /* CodeBlockKind.Exception */ + ); + var exception2 = endBlock(); + var state2 = exception2.state; + if (state2 < 2) { + emitBreak(exception2.endLabel); + } else { + emitEndfinally(); + } + markLabel(exception2.endLabel); + emitNop(); + exception2.state = 3; + } + function beginScriptLoopBlock() { + beginBlock({ + kind: 3, + isScript: true, + breakLabel: -1, + continueLabel: -1 + }); + } + function beginLoopBlock(continueLabel) { + var breakLabel = defineLabel(); + beginBlock({ + kind: 3, + isScript: false, + breakLabel, + continueLabel + }); + return breakLabel; + } + function endLoopBlock() { + ts2.Debug.assert( + peekBlockKind() === 3 + /* CodeBlockKind.Loop */ + ); + var block = endBlock(); + var breakLabel = block.breakLabel; + if (!block.isScript) { + markLabel(breakLabel); + } + } + function beginScriptSwitchBlock() { + beginBlock({ + kind: 2, + isScript: true, + breakLabel: -1 + }); + } + function beginSwitchBlock() { + var breakLabel = defineLabel(); + beginBlock({ + kind: 2, + isScript: false, + breakLabel + }); + return breakLabel; + } + function endSwitchBlock() { + ts2.Debug.assert( + peekBlockKind() === 2 + /* CodeBlockKind.Switch */ + ); + var block = endBlock(); + var breakLabel = block.breakLabel; + if (!block.isScript) { + markLabel(breakLabel); + } + } + function beginScriptLabeledBlock(labelText) { + beginBlock({ + kind: 4, + isScript: true, + labelText, + breakLabel: -1 + }); + } + function beginLabeledBlock(labelText) { + var breakLabel = defineLabel(); + beginBlock({ + kind: 4, + isScript: false, + labelText, + breakLabel + }); + } + function endLabeledBlock() { + ts2.Debug.assert( + peekBlockKind() === 4 + /* CodeBlockKind.Labeled */ + ); + var block = endBlock(); + if (!block.isScript) { + markLabel(block.breakLabel); + } + } + function supportsUnlabeledBreak(block) { + return block.kind === 2 || block.kind === 3; + } + function supportsLabeledBreakOrContinue(block) { + return block.kind === 4; + } + function supportsUnlabeledContinue(block) { + return block.kind === 3; + } + function hasImmediateContainingLabeledBlock(labelText, start) { + for (var j6 = start; j6 >= 0; j6--) { + var containingBlock = blockStack[j6]; + if (supportsLabeledBreakOrContinue(containingBlock)) { + if (containingBlock.labelText === labelText) { + return true; + } + } else { + break; + } + } + return false; + } + function findBreakTarget(labelText) { + if (blockStack) { + if (labelText) { + for (var i7 = blockStack.length - 1; i7 >= 0; i7--) { + var block = blockStack[i7]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i7 - 1)) { + return block.breakLabel; + } + } + } else { + for (var i7 = blockStack.length - 1; i7 >= 0; i7--) { + var block = blockStack[i7]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } + } + } + } + return 0; + } + function findContinueTarget(labelText) { + if (blockStack) { + if (labelText) { + for (var i7 = blockStack.length - 1; i7 >= 0; i7--) { + var block = blockStack[i7]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i7 - 1)) { + return block.continueLabel; + } + } + } else { + for (var i7 = blockStack.length - 1; i7 >= 0; i7--) { + var block = blockStack[i7]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } + } + } + } + return 0; + } + function createLabel(label) { + if (label !== void 0 && label > 0) { + if (labelExpressions === void 0) { + labelExpressions = []; + } + var expression = factory.createNumericLiteral(-1); + if (labelExpressions[label] === void 0) { + labelExpressions[label] = [expression]; + } else { + labelExpressions[label].push(expression); + } + return expression; + } + return factory.createOmittedExpression(); + } + function createInstruction(instruction) { + var literal = factory.createNumericLiteral(instruction); + ts2.addSyntheticTrailingComment(literal, 3, getInstructionName(instruction)); + return literal; + } + function createInlineBreak(label, location2) { + ts2.Debug.assertLessThan(0, label, "Invalid label"); + return ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 3 + /* Instruction.Break */ + ), + createLabel(label) + ])), location2); + } + function createInlineReturn(expression, location2) { + return ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression ? [createInstruction( + 2 + /* Instruction.Return */ + ), expression] : [createInstruction( + 2 + /* Instruction.Return */ + )])), location2); + } + function createGeneratorResume(location2) { + return ts2.setTextRange(factory.createCallExpression( + factory.createPropertyAccessExpression(state, "sent"), + /*typeArguments*/ + void 0, + [] + ), location2); + } + function emitNop() { + emitWorker( + 0 + /* OpCode.Nop */ + ); + } + function emitStatement(node) { + if (node) { + emitWorker(1, [node]); + } else { + emitNop(); + } + } + function emitAssignment(left, right, location2) { + emitWorker(2, [left, right], location2); + } + function emitBreak(label, location2) { + emitWorker(3, [label], location2); + } + function emitBreakWhenTrue(label, condition, location2) { + emitWorker(4, [label, condition], location2); + } + function emitBreakWhenFalse(label, condition, location2) { + emitWorker(5, [label, condition], location2); + } + function emitYieldStar(expression, location2) { + emitWorker(7, [expression], location2); + } + function emitYield(expression, location2) { + emitWorker(6, [expression], location2); + } + function emitReturn(expression, location2) { + emitWorker(8, [expression], location2); + } + function emitThrow(expression, location2) { + emitWorker(9, [expression], location2); + } + function emitEndfinally() { + emitWorker( + 10 + /* OpCode.Endfinally */ + ); + } + function emitWorker(code, args, location2) { + if (operations === void 0) { + operations = []; + operationArguments = []; + operationLocations = []; + } + if (labelOffsets === void 0) { + markLabel(defineLabel()); + } + var operationIndex = operations.length; + operations[operationIndex] = code; + operationArguments[operationIndex] = args; + operationLocations[operationIndex] = location2; + } + function build() { + blockIndex = 0; + labelNumber = 0; + labelNumbers = void 0; + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + clauses = void 0; + statements = void 0; + exceptionBlockStack = void 0; + currentExceptionBlock = void 0; + withBlockStack = void 0; + var buildResult = buildStatements(); + return emitHelpers().createGeneratorHelper(ts2.setEmitFlags( + factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + state + )], + /*type*/ + void 0, + factory.createBlock( + buildResult, + /*multiLine*/ + buildResult.length > 0 + ) + ), + 524288 + /* EmitFlags.ReuseTempVariableScope */ + )); + } + function buildStatements() { + if (operations) { + for (var operationIndex = 0; operationIndex < operations.length; operationIndex++) { + writeOperation(operationIndex); + } + flushFinalLabel(operations.length); + } else { + flushFinalLabel(0); + } + if (clauses) { + var labelExpression = factory.createPropertyAccessExpression(state, "label"); + var switchStatement = factory.createSwitchStatement(labelExpression, factory.createCaseBlock(clauses)); + return [ts2.startOnNewLine(switchStatement)]; + } + if (statements) { + return statements; + } + return []; + } + function flushLabel() { + if (!statements) { + return; + } + appendLabel( + /*markLabelEnd*/ + !lastOperationWasAbrupt + ); + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + labelNumber++; + } + function flushFinalLabel(operationIndex) { + if (isFinalLabelReachable(operationIndex)) { + tryEnterLabel(operationIndex); + withBlockStack = void 0; + writeReturn( + /*expression*/ + void 0, + /*operationLocation*/ + void 0 + ); + } + if (statements && clauses) { + appendLabel( + /*markLabelEnd*/ + false + ); + } + updateLabelExpressions(); + } + function isFinalLabelReachable(operationIndex) { + if (!lastOperationWasCompletion) { + return true; + } + if (!labelOffsets || !labelExpressions) { + return false; + } + for (var label = 0; label < labelOffsets.length; label++) { + if (labelOffsets[label] === operationIndex && labelExpressions[label]) { + return true; + } + } + return false; + } + function appendLabel(markLabelEnd) { + if (!clauses) { + clauses = []; + } + if (statements) { + if (withBlockStack) { + for (var i7 = withBlockStack.length - 1; i7 >= 0; i7--) { + var withBlock = withBlockStack[i7]; + statements = [factory.createWithStatement(withBlock.expression, factory.createBlock(statements))]; + } + } + if (currentExceptionBlock) { + var startLabel = currentExceptionBlock.startLabel, catchLabel = currentExceptionBlock.catchLabel, finallyLabel = currentExceptionBlock.finallyLabel, endLabel = currentExceptionBlock.endLabel; + statements.unshift(factory.createExpressionStatement(factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(state, "trys"), "push"), + /*typeArguments*/ + void 0, + [ + factory.createArrayLiteralExpression([ + createLabel(startLabel), + createLabel(catchLabel), + createLabel(finallyLabel), + createLabel(endLabel) + ]) + ] + ))); + currentExceptionBlock = void 0; + } + if (markLabelEnd) { + statements.push(factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(state, "label"), factory.createNumericLiteral(labelNumber + 1)))); + } + } + clauses.push(factory.createCaseClause(factory.createNumericLiteral(labelNumber), statements || [])); + statements = void 0; + } + function tryEnterLabel(operationIndex) { + if (!labelOffsets) { + return; + } + for (var label = 0; label < labelOffsets.length; label++) { + if (labelOffsets[label] === operationIndex) { + flushLabel(); + if (labelNumbers === void 0) { + labelNumbers = []; + } + if (labelNumbers[labelNumber] === void 0) { + labelNumbers[labelNumber] = [label]; + } else { + labelNumbers[labelNumber].push(label); + } + } + } + } + function updateLabelExpressions() { + if (labelExpressions !== void 0 && labelNumbers !== void 0) { + for (var labelNumber_1 = 0; labelNumber_1 < labelNumbers.length; labelNumber_1++) { + var labels = labelNumbers[labelNumber_1]; + if (labels !== void 0) { + for (var _i = 0, labels_1 = labels; _i < labels_1.length; _i++) { + var label = labels_1[_i]; + var expressions = labelExpressions[label]; + if (expressions !== void 0) { + for (var _a2 = 0, expressions_1 = expressions; _a2 < expressions_1.length; _a2++) { + var expression = expressions_1[_a2]; + expression.text = String(labelNumber_1); + } + } + } + } + } + } + } + function tryEnterOrLeaveBlock(operationIndex) { + if (blocks) { + for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { + var block = blocks[blockIndex]; + var blockAction = blockActions[blockIndex]; + switch (block.kind) { + case 0: + if (blockAction === 0) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; + } else if (blockAction === 1) { + currentExceptionBlock = exceptionBlockStack.pop(); + } + break; + case 1: + if (blockAction === 0) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); + } else if (blockAction === 1) { + withBlockStack.pop(); + } + break; + } + } + } + } + function writeOperation(operationIndex) { + tryEnterLabel(operationIndex); + tryEnterOrLeaveBlock(operationIndex); + if (lastOperationWasAbrupt) { + return; + } + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + var opcode = operations[operationIndex]; + if (opcode === 0) { + return; + } else if (opcode === 10) { + return writeEndfinally(); + } + var args = operationArguments[operationIndex]; + if (opcode === 1) { + return writeStatement(args[0]); + } + var location2 = operationLocations[operationIndex]; + switch (opcode) { + case 2: + return writeAssign(args[0], args[1], location2); + case 3: + return writeBreak(args[0], location2); + case 4: + return writeBreakWhenTrue(args[0], args[1], location2); + case 5: + return writeBreakWhenFalse(args[0], args[1], location2); + case 6: + return writeYield(args[0], location2); + case 7: + return writeYieldStar(args[0], location2); + case 8: + return writeReturn(args[0], location2); + case 9: + return writeThrow(args[0], location2); + } + } + function writeStatement(statement) { + if (statement) { + if (!statements) { + statements = [statement]; + } else { + statements.push(statement); + } + } + } + function writeAssign(left, right, operationLocation) { + writeStatement(ts2.setTextRange(factory.createExpressionStatement(factory.createAssignment(left, right)), operationLocation)); + } + function writeThrow(expression, operationLocation) { + lastOperationWasAbrupt = true; + lastOperationWasCompletion = true; + writeStatement(ts2.setTextRange(factory.createThrowStatement(expression), operationLocation)); + } + function writeReturn(expression, operationLocation) { + lastOperationWasAbrupt = true; + lastOperationWasCompletion = true; + writeStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression ? [createInstruction( + 2 + /* Instruction.Return */ + ), expression] : [createInstruction( + 2 + /* Instruction.Return */ + )])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )); + } + function writeBreak(label, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 3 + /* Instruction.Break */ + ), + createLabel(label) + ])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )); + } + function writeBreakWhenTrue(label, condition, operationLocation) { + writeStatement(ts2.setEmitFlags( + factory.createIfStatement(condition, ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 3 + /* Instruction.Break */ + ), + createLabel(label) + ])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )), + 1 + /* EmitFlags.SingleLine */ + )); + } + function writeBreakWhenFalse(label, condition, operationLocation) { + writeStatement(ts2.setEmitFlags( + factory.createIfStatement(factory.createLogicalNot(condition), ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 3 + /* Instruction.Break */ + ), + createLabel(label) + ])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )), + 1 + /* EmitFlags.SingleLine */ + )); + } + function writeYield(expression, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression(expression ? [createInstruction( + 4 + /* Instruction.Yield */ + ), expression] : [createInstruction( + 4 + /* Instruction.Yield */ + )])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )); + } + function writeYieldStar(expression, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement(ts2.setEmitFlags( + ts2.setTextRange(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 5 + /* Instruction.YieldStar */ + ), + expression + ])), operationLocation), + 384 + /* EmitFlags.NoTokenSourceMaps */ + )); + } + function writeEndfinally() { + lastOperationWasAbrupt = true; + writeStatement(factory.createReturnStatement(factory.createArrayLiteralExpression([ + createInstruction( + 7 + /* Instruction.Endfinally */ + ) + ]))); + } + } + ts2.transformGenerators = transformGenerators; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformModule(context2) { + function getTransformModuleDelegate(moduleKind2) { + switch (moduleKind2) { + case ts2.ModuleKind.AMD: + return transformAMDModule; + case ts2.ModuleKind.UMD: + return transformUMDModule; + default: + return transformCommonJSModule; + } + } + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory, startLexicalEnvironment = context2.startLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var compilerOptions = context2.getCompilerOptions(); + var resolver = context2.getEmitResolver(); + var host = context2.getEmitHost(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var previousOnSubstituteNode = context2.onSubstituteNode; + var previousOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 210 + /* SyntaxKind.CallExpression */ + ); + context2.enableSubstitution( + 212 + /* SyntaxKind.TaggedTemplateExpression */ + ); + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + context2.enableSubstitution( + 223 + /* SyntaxKind.BinaryExpression */ + ); + context2.enableSubstitution( + 300 + /* SyntaxKind.ShorthandPropertyAssignment */ + ); + context2.enableEmitNotification( + 308 + /* SyntaxKind.SourceFile */ + ); + var moduleInfoMap = []; + var deferredExports = []; + var currentSourceFile; + var currentModuleInfo; + var noSubstitution = []; + var needUMDDynamicImportHelper; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || !(ts2.isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608 || ts2.isJsonSourceFile(node) && ts2.hasJsonModuleEmitEnabled(compilerOptions) && ts2.outFile(compilerOptions))) { + return node; + } + currentSourceFile = node; + currentModuleInfo = ts2.collectExternalModuleInfo(context2, node, resolver, compilerOptions); + moduleInfoMap[ts2.getOriginalNodeId(node)] = currentModuleInfo; + var transformModule2 = getTransformModuleDelegate(moduleKind); + var updated = transformModule2(node); + currentSourceFile = void 0; + currentModuleInfo = void 0; + needUMDDynamicImportHelper = false; + return updated; + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && ts2.isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + function transformCommonJSModule(node) { + startLexicalEnvironment(); + var statements = []; + var ensureUseStrict = ts2.getStrictOptionValue(compilerOptions, "alwaysStrict") || !compilerOptions.noImplicitUseStrict && ts2.isExternalModule(currentSourceFile); + var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict && !ts2.isJsonSourceFile(node), topLevelVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts2.append(statements, createUnderscoreUnderscoreESModule()); + } + if (ts2.length(currentModuleInfo.exportedNames)) { + var chunkSize = 50; + for (var i7 = 0; i7 < currentModuleInfo.exportedNames.length; i7 += chunkSize) { + ts2.append(statements, factory.createExpressionStatement(ts2.reduceLeft(currentModuleInfo.exportedNames.slice(i7, i7 + chunkSize), function(prev, nextId) { + return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts2.idText(nextId))), prev); + }, factory.createVoidZero()))); + } + } + ts2.append(statements, ts2.visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts2.isStatement)); + ts2.addRange(statements, ts2.visitNodes(node.statements, topLevelVisitor, ts2.isStatement, statementOffset)); + addExportEqualsIfNeeded( + statements, + /*emitAsReturn*/ + false + ); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var updated = factory.updateSourceFile(node, ts2.setTextRange(factory.createNodeArray(statements), node.statements)); + ts2.addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function transformAMDModule(node) { + var define2 = factory.createIdentifier("define"); + var moduleName3 = ts2.tryGetModuleNameFromFile(factory, node, host, compilerOptions); + var jsonSourceFile = ts2.isJsonSourceFile(node) && node; + var _a2 = collectAsynchronousDependencies( + node, + /*includeNonAmdDependencies*/ + true + ), aliasedModuleNames = _a2.aliasedModuleNames, unaliasedModuleNames = _a2.unaliasedModuleNames, importAliasNames = _a2.importAliasNames; + var updated = factory.updateSourceFile(node, ts2.setTextRange( + factory.createNodeArray([ + factory.createExpressionStatement(factory.createCallExpression( + define2, + /*typeArguments*/ + void 0, + __spreadArray9(__spreadArray9([], moduleName3 ? [moduleName3] : [], true), [ + // Add the dependency array argument: + // + // ["require", "exports", module1", "module2", ...] + factory.createArrayLiteralExpression(jsonSourceFile ? ts2.emptyArray : __spreadArray9(__spreadArray9([ + factory.createStringLiteral("require"), + factory.createStringLiteral("exports") + ], aliasedModuleNames, true), unaliasedModuleNames, true)), + // Add the module body function argument: + // + // function (require, exports, module1, module2) ... + jsonSourceFile ? jsonSourceFile.statements.length ? jsonSourceFile.statements[0].expression : factory.createObjectLiteralExpression() : factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + __spreadArray9([ + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "require" + ), + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "exports" + ) + ], importAliasNames, true), + /*type*/ + void 0, + transformAsynchronousModuleBody(node) + ) + ], false) + )) + ]), + /*location*/ + node.statements + )); + ts2.addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function transformUMDModule(node) { + var _a2 = collectAsynchronousDependencies( + node, + /*includeNonAmdDependencies*/ + false + ), aliasedModuleNames = _a2.aliasedModuleNames, unaliasedModuleNames = _a2.unaliasedModuleNames, importAliasNames = _a2.importAliasNames; + var moduleName3 = ts2.tryGetModuleNameFromFile(factory, node, host, compilerOptions); + var umdHeader = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "factory" + )], + /*type*/ + void 0, + ts2.setTextRange( + factory.createBlock( + [ + factory.createIfStatement(factory.createLogicalAnd(factory.createTypeCheck(factory.createIdentifier("module"), "object"), factory.createTypeCheck(factory.createPropertyAccessExpression(factory.createIdentifier("module"), "exports"), "object")), factory.createBlock([ + factory.createVariableStatement( + /*modifiers*/ + void 0, + [ + factory.createVariableDeclaration( + "v", + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createCallExpression( + factory.createIdentifier("factory"), + /*typeArguments*/ + void 0, + [ + factory.createIdentifier("require"), + factory.createIdentifier("exports") + ] + ) + ) + ] + ), + ts2.setEmitFlags( + factory.createIfStatement(factory.createStrictInequality(factory.createIdentifier("v"), factory.createIdentifier("undefined")), factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("module"), "exports"), factory.createIdentifier("v")))), + 1 + /* EmitFlags.SingleLine */ + ) + ]), factory.createIfStatement(factory.createLogicalAnd(factory.createTypeCheck(factory.createIdentifier("define"), "function"), factory.createPropertyAccessExpression(factory.createIdentifier("define"), "amd")), factory.createBlock([ + factory.createExpressionStatement(factory.createCallExpression( + factory.createIdentifier("define"), + /*typeArguments*/ + void 0, + __spreadArray9(__spreadArray9([], moduleName3 ? [moduleName3] : [], true), [ + factory.createArrayLiteralExpression(__spreadArray9(__spreadArray9([ + factory.createStringLiteral("require"), + factory.createStringLiteral("exports") + ], aliasedModuleNames, true), unaliasedModuleNames, true)), + factory.createIdentifier("factory") + ], false) + )) + ]))) + ], + /*multiLine*/ + true + ), + /*location*/ + void 0 + ) + ); + var updated = factory.updateSourceFile(node, ts2.setTextRange( + factory.createNodeArray([ + factory.createExpressionStatement(factory.createCallExpression( + umdHeader, + /*typeArguments*/ + void 0, + [ + // Add the module body function argument: + // + // function (require, exports) ... + factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + __spreadArray9([ + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "require" + ), + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "exports" + ) + ], importAliasNames, true), + /*type*/ + void 0, + transformAsynchronousModuleBody(node) + ) + ] + )) + ]), + /*location*/ + node.statements + )); + ts2.addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + var aliasedModuleNames = []; + var unaliasedModuleNames = []; + var importAliasNames = []; + for (var _i = 0, _a2 = node.amdDependencies; _i < _a2.length; _i++) { + var amdDependency = _a2[_i]; + if (amdDependency.name) { + aliasedModuleNames.push(factory.createStringLiteral(amdDependency.path)); + importAliasNames.push(factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + amdDependency.name + )); + } else { + unaliasedModuleNames.push(factory.createStringLiteral(amdDependency.path)); + } + } + for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) { + var importNode = _c[_b]; + var externalModuleName = ts2.getExternalModuleNameLiteral(factory, importNode, currentSourceFile, host, resolver, compilerOptions); + var importAliasName = ts2.getLocalNameForExternalImport(factory, importNode, currentSourceFile); + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + ts2.setEmitFlags( + importAliasName, + 4 + /* EmitFlags.NoSubstitution */ + ); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + importAliasName + )); + } else { + unaliasedModuleNames.push(externalModuleName); + } + } + } + return { aliasedModuleNames, unaliasedModuleNames, importAliasNames }; + } + function getAMDImportExpressionForImport(node) { + if (ts2.isImportEqualsDeclaration(node) || ts2.isExportDeclaration(node) || !ts2.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions)) { + return void 0; + } + var name2 = ts2.getLocalNameForExternalImport(factory, node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name2); + if (expr === name2) { + return void 0; + } + return factory.createExpressionStatement(factory.createAssignment(name2, expr)); + } + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + var statements = []; + var statementOffset = factory.copyPrologue( + node.statements, + statements, + /*ensureUseStrict*/ + !compilerOptions.noImplicitUseStrict, + topLevelVisitor + ); + if (shouldEmitUnderscoreUnderscoreESModule()) { + ts2.append(statements, createUnderscoreUnderscoreESModule()); + } + if (ts2.length(currentModuleInfo.exportedNames)) { + ts2.append(statements, factory.createExpressionStatement(ts2.reduceLeft(currentModuleInfo.exportedNames, function(prev, nextId) { + return factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(ts2.idText(nextId))), prev); + }, factory.createVoidZero()))); + } + ts2.append(statements, ts2.visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts2.isStatement)); + if (moduleKind === ts2.ModuleKind.AMD) { + ts2.addRange(statements, ts2.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } + ts2.addRange(statements, ts2.visitNodes(node.statements, topLevelVisitor, ts2.isStatement, statementOffset)); + addExportEqualsIfNeeded( + statements, + /*emitAsReturn*/ + true + ); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var body = factory.createBlock( + statements, + /*multiLine*/ + true + ); + if (needUMDDynamicImportHelper) { + ts2.addEmitHelper(body, dynamicImportUMDHelper); + } + return body; + } + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + var expressionResult = ts2.visitNode(currentModuleInfo.exportEquals.expression, visitor); + if (expressionResult) { + if (emitAsReturn) { + var statement = factory.createReturnStatement(expressionResult); + ts2.setTextRange(statement, currentModuleInfo.exportEquals); + ts2.setEmitFlags( + statement, + 384 | 1536 + /* EmitFlags.NoComments */ + ); + statements.push(statement); + } else { + var statement = factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("module"), "exports"), expressionResult)); + ts2.setTextRange(statement, currentModuleInfo.exportEquals); + ts2.setEmitFlags( + statement, + 1536 + /* EmitFlags.NoComments */ + ); + statements.push(statement); + } + } + } + } + function topLevelVisitor(node) { + switch (node.kind) { + case 269: + return visitImportDeclaration(node); + case 268: + return visitImportEqualsDeclaration(node); + case 275: + return visitExportDeclaration(node); + case 274: + return visitExportAssignment(node); + case 240: + return visitVariableStatement(node); + case 259: + return visitFunctionDeclaration(node); + case 260: + return visitClassDeclaration(node); + case 355: + return visitMergeDeclarationMarker(node); + case 356: + return visitEndOfDeclarationMarker(node); + default: + return visitor(node); + } + } + function visitorWorker(node, valueIsDiscarded) { + if (!(node.transformFlags & (8388608 | 4096 | 268435456))) { + return node; + } + switch (node.kind) { + case 245: + return visitForStatement(node); + case 241: + return visitExpressionStatement(node); + case 214: + return visitParenthesizedExpression(node, valueIsDiscarded); + case 353: + return visitPartiallyEmittedExpression(node, valueIsDiscarded); + case 210: + if (ts2.isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { + return visitImportCallExpression(node); + } + break; + case 223: + if (ts2.isDestructuringAssignment(node)) { + return visitDestructuringAssignment(node, valueIsDiscarded); + } + break; + case 221: + case 222: + return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + false + ); + } + function discardedValueVisitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + true + ); + } + function destructuringNeedsFlattening(node) { + if (ts2.isObjectLiteralExpression(node)) { + for (var _i = 0, _a2 = node.properties; _i < _a2.length; _i++) { + var elem = _a2[_i]; + switch (elem.kind) { + case 299: + if (destructuringNeedsFlattening(elem.initializer)) { + return true; + } + break; + case 300: + if (destructuringNeedsFlattening(elem.name)) { + return true; + } + break; + case 301: + if (destructuringNeedsFlattening(elem.expression)) { + return true; + } + break; + case 171: + case 174: + case 175: + return false; + default: + ts2.Debug.assertNever(elem, "Unhandled object member kind"); + } + } + } else if (ts2.isArrayLiteralExpression(node)) { + for (var _b = 0, _c = node.elements; _b < _c.length; _b++) { + var elem = _c[_b]; + if (ts2.isSpreadElement(elem)) { + if (destructuringNeedsFlattening(elem.expression)) { + return true; + } + } else if (destructuringNeedsFlattening(elem)) { + return true; + } + } + } else if (ts2.isIdentifier(node)) { + return ts2.length(getExports(node)) > (ts2.isExportName(node) ? 1 : 0); + } + return false; + } + function visitDestructuringAssignment(node, valueIsDiscarded) { + if (destructuringNeedsFlattening(node.left)) { + return ts2.flattenDestructuringAssignment(node, visitor, context2, 0, !valueIsDiscarded, createAllExportExpressions); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + return factory.updateForStatement(node, ts2.visitNode(node.initializer, discardedValueVisitor, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, discardedValueVisitor, ts2.isExpression), ts2.visitIterationBody(node.statement, visitor, context2)); + } + function visitExpressionStatement(node) { + return factory.updateExpressionStatement(node, ts2.visitNode(node.expression, discardedValueVisitor, ts2.isExpression)); + } + function visitParenthesizedExpression(node, valueIsDiscarded) { + return factory.updateParenthesizedExpression(node, ts2.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts2.isExpression)); + } + function visitPartiallyEmittedExpression(node, valueIsDiscarded) { + return factory.updatePartiallyEmittedExpression(node, ts2.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts2.isExpression)); + } + function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + if ((node.operator === 45 || node.operator === 46) && ts2.isIdentifier(node.operand) && !ts2.isGeneratedIdentifier(node.operand) && !ts2.isLocalName(node.operand) && !ts2.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var temp = void 0; + var expression = ts2.visitNode(node.operand, visitor, ts2.isExpression); + if (ts2.isPrefixUnaryExpression(node)) { + expression = factory.updatePrefixUnaryExpression(node, expression); + } else { + expression = factory.updatePostfixUnaryExpression(node, expression); + if (!valueIsDiscarded) { + temp = factory.createTempVariable(hoistVariableDeclaration); + expression = factory.createAssignment(temp, expression); + ts2.setTextRange(expression, node); + } + expression = factory.createComma(expression, factory.cloneNode(node.operand)); + ts2.setTextRange(expression, node); + } + for (var _i = 0, exportedNames_1 = exportedNames; _i < exportedNames_1.length; _i++) { + var exportName = exportedNames_1[_i]; + noSubstitution[ts2.getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + ts2.setTextRange(expression, node); + } + if (temp) { + noSubstitution[ts2.getNodeId(expression)] = true; + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitImportCallExpression(node) { + var externalModuleName = ts2.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions); + var firstArgument = ts2.visitNode(ts2.firstOrUndefined(node.arguments), visitor); + var argument = externalModuleName && (!firstArgument || !ts2.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; + var containsLexicalThis = !!(node.transformFlags & 16384); + switch (compilerOptions.module) { + case ts2.ModuleKind.AMD: + return createImportCallExpressionAMD(argument, containsLexicalThis); + case ts2.ModuleKind.UMD: + return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis); + case ts2.ModuleKind.CommonJS: + default: + return createImportCallExpressionCommonJS(argument); + } + } + function createImportCallExpressionUMD(arg, containsLexicalThis) { + needUMDDynamicImportHelper = true; + if (ts2.isSimpleCopiableExpression(arg)) { + var argClone = ts2.isGeneratedIdentifier(arg) ? arg : ts2.isStringLiteral(arg) ? factory.createStringLiteralFromNode(arg) : ts2.setEmitFlags( + ts2.setTextRange(factory.cloneNode(arg), arg), + 1536 + /* EmitFlags.NoComments */ + ); + return factory.createConditionalExpression( + /*condition*/ + factory.createIdentifier("__syncRequire"), + /*questionToken*/ + void 0, + /*whenTrue*/ + createImportCallExpressionCommonJS(arg), + /*colonToken*/ + void 0, + /*whenFalse*/ + createImportCallExpressionAMD(argClone, containsLexicalThis) + ); + } else { + var temp = factory.createTempVariable(hoistVariableDeclaration); + return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression( + /*condition*/ + factory.createIdentifier("__syncRequire"), + /*questionToken*/ + void 0, + /*whenTrue*/ + createImportCallExpressionCommonJS( + temp, + /* isInlineable */ + true + ), + /*colonToken*/ + void 0, + /*whenFalse*/ + createImportCallExpressionAMD(temp, containsLexicalThis) + )); + } + } + function createImportCallExpressionAMD(arg, containsLexicalThis) { + var resolve3 = factory.createUniqueName("resolve"); + var reject2 = factory.createUniqueName("reject"); + var parameters = [ + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + resolve3 + ), + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + reject2 + ) + ]; + var body = factory.createBlock([ + factory.createExpressionStatement(factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [factory.createArrayLiteralExpression([arg || factory.createOmittedExpression()]), resolve3, reject2] + )) + ]); + var func; + if (languageVersion >= 2) { + func = factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + body + ); + } else { + func = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + if (containsLexicalThis) { + ts2.setEmitFlags( + func, + 8 + /* EmitFlags.CapturesThis */ + ); + } + } + var promise = factory.createNewExpression( + factory.createIdentifier("Promise"), + /*typeArguments*/ + void 0, + [func] + ); + if (ts2.getESModuleInterop(compilerOptions)) { + return factory.createCallExpression( + factory.createPropertyAccessExpression(promise, factory.createIdentifier("then")), + /*typeArguments*/ + void 0, + [emitHelpers().createImportStarCallbackHelper()] + ); + } + return promise; + } + function createImportCallExpressionCommonJS(arg, isInlineable) { + var temp = arg && !ts2.isSimpleInlineableExpression(arg) && !isInlineable ? factory.createTempVariable(hoistVariableDeclaration) : void 0; + var promiseResolveCall = factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + [] + ); + var requireCall = factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + temp ? [temp] : arg ? [arg] : [] + ); + if (ts2.getESModuleInterop(compilerOptions)) { + requireCall = emitHelpers().createImportStarHelper(requireCall); + } + var func; + if (languageVersion >= 2) { + func = factory.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + requireCall + ); + } else { + func = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory.createBlock([factory.createReturnStatement(requireCall)]) + ); + } + var downleveledImport = factory.createCallExpression( + factory.createPropertyAccessExpression(promiseResolveCall, "then"), + /*typeArguments*/ + void 0, + [func] + ); + return temp === void 0 ? downleveledImport : factory.createCommaListExpression([factory.createAssignment(temp, arg), downleveledImport]); + } + function getHelperExpressionForExport(node, innerExpr) { + if (!ts2.getESModuleInterop(compilerOptions) || ts2.getEmitFlags(node) & 67108864) { + return innerExpr; + } + if (ts2.getExportNeedsImportStarHelper(node)) { + return emitHelpers().createImportStarHelper(innerExpr); + } + return innerExpr; + } + function getHelperExpressionForImport(node, innerExpr) { + if (!ts2.getESModuleInterop(compilerOptions) || ts2.getEmitFlags(node) & 67108864) { + return innerExpr; + } + if (ts2.getImportNeedsImportStarHelper(node)) { + return emitHelpers().createImportStarHelper(innerExpr); + } + if (ts2.getImportNeedsImportDefaultHelper(node)) { + return emitHelpers().createImportDefaultHelper(innerExpr); + } + return innerExpr; + } + function visitImportDeclaration(node) { + var statements; + var namespaceDeclaration = ts2.getNamespaceDeclarationNode(node); + if (moduleKind !== ts2.ModuleKind.AMD) { + if (!node.importClause) { + return ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(createRequireCall(node)), node), node); + } else { + var variables = []; + if (namespaceDeclaration && !ts2.isDefaultImport(node)) { + variables.push(factory.createVariableDeclaration( + factory.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + getHelperExpressionForImport(node, createRequireCall(node)) + )); + } else { + variables.push(factory.createVariableDeclaration( + factory.getGeneratedNameForNode(node), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + getHelperExpressionForImport(node, createRequireCall(node)) + )); + if (namespaceDeclaration && ts2.isDefaultImport(node)) { + variables.push(factory.createVariableDeclaration( + factory.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.getGeneratedNameForNode(node) + )); + } + } + statements = ts2.append(statements, ts2.setOriginalNode( + ts2.setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + variables, + languageVersion >= 2 ? 2 : 0 + /* NodeFlags.None */ + ) + ), + /*location*/ + node + ), + /*original*/ + node + )); + } + } else if (namespaceDeclaration && ts2.isDefaultImport(node)) { + statements = ts2.append(statements, factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + ts2.setOriginalNode( + ts2.setTextRange( + factory.createVariableDeclaration( + factory.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.getGeneratedNameForNode(node) + ), + /*location*/ + node + ), + /*original*/ + node + ) + ], + languageVersion >= 2 ? 2 : 0 + /* NodeFlags.None */ + ) + )); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function createRequireCall(importNode) { + var moduleName3 = ts2.getExternalModuleNameLiteral(factory, importNode, currentSourceFile, host, resolver, compilerOptions); + var args = []; + if (moduleName3) { + args.push(moduleName3); + } + return factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + args + ); + } + function visitImportEqualsDeclaration(node) { + ts2.Debug.assert(ts2.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + if (moduleKind !== ts2.ModuleKind.AMD) { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + statements = ts2.append(statements, ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(createExportExpression(node.name, createRequireCall(node))), node), node)); + } else { + statements = ts2.append(statements, ts2.setOriginalNode(ts2.setTextRange(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + factory.cloneNode(node.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall(node) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* NodeFlags.None */ + ) + ), node), node)); + } + } else { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + statements = ts2.append(statements, ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(createExportExpression(factory.getExportName(node), factory.getLocalName(node))), node), node)); + } + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitExportDeclaration(node) { + if (!node.moduleSpecifier) { + return void 0; + } + var generatedName = factory.getGeneratedNameForNode(node); + if (node.exportClause && ts2.isNamedExports(node.exportClause)) { + var statements = []; + if (moduleKind !== ts2.ModuleKind.AMD) { + statements.push(ts2.setOriginalNode( + ts2.setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + generatedName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall(node) + ) + ]) + ), + /*location*/ + node + ), + /* original */ + node + )); + } + for (var _i = 0, _a2 = node.exportClause.elements; _i < _a2.length; _i++) { + var specifier = _a2[_i]; + if (languageVersion === 0) { + statements.push(ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(emitHelpers().createCreateBindingHelper(generatedName, factory.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory.createStringLiteralFromNode(specifier.name) : void 0)), specifier), specifier)); + } else { + var exportNeedsImportDefault = !!ts2.getESModuleInterop(compilerOptions) && !(ts2.getEmitFlags(node) & 67108864) && ts2.idText(specifier.propertyName || specifier.name) === "default"; + var exportedValue = factory.createPropertyAccessExpression(exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, specifier.propertyName || specifier.name); + statements.push(ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(createExportExpression( + factory.getExportName(specifier), + exportedValue, + /* location */ + void 0, + /* liveBinding */ + true + )), specifier), specifier)); + } + } + return ts2.singleOrMany(statements); + } else if (node.exportClause) { + var statements = []; + statements.push(ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), getHelperExpressionForExport(node, moduleKind !== ts2.ModuleKind.AMD ? createRequireCall(node) : ts2.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory.createIdentifier(ts2.idText(node.exportClause.name))))), node), node)); + return ts2.singleOrMany(statements); + } else { + return ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(emitHelpers().createExportStarHelper(moduleKind !== ts2.ModuleKind.AMD ? createRequireCall(node) : generatedName)), node), node); + } + } + function visitExportAssignment(node) { + if (node.isExportEquals) { + return void 0; + } + var statements; + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement( + deferredExports[id], + factory.createIdentifier("default"), + ts2.visitNode(node.expression, visitor), + /*location*/ + node, + /*allowComments*/ + true + ); + } else { + statements = appendExportStatement( + statements, + factory.createIdentifier("default"), + ts2.visitNode(node.expression, visitor), + /*location*/ + node, + /*allowComments*/ + true + ); + } + return ts2.singleOrMany(statements); + } + function visitFunctionDeclaration(node) { + var statements; + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + statements = ts2.append(statements, ts2.setOriginalNode( + ts2.setTextRange( + factory.createFunctionDeclaration( + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier), + node.asteriskToken, + factory.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + ts2.visitNodes(node.parameters, visitor), + /*type*/ + void 0, + ts2.visitEachChild(node.body, visitor, context2) + ), + /*location*/ + node + ), + /*original*/ + node + )); + } else { + statements = ts2.append(statements, ts2.visitEachChild(node, visitor, context2)); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitClassDeclaration(node) { + var statements; + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + statements = ts2.append(statements, ts2.setOriginalNode(ts2.setTextRange(factory.createClassDeclaration( + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike), + factory.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor), + ts2.visitNodes(node.members, visitor) + ), node), node)); + } else { + statements = ts2.append(statements, ts2.visitEachChild(node, visitor, context2)); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitVariableStatement(node) { + var statements; + var variables; + var expressions; + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + var modifiers = void 0; + var removeCommentsOnExpressions = false; + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + if (ts2.isIdentifier(variable.name) && ts2.isLocalName(variable.name)) { + if (!modifiers) { + modifiers = ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifier); + } + variables = ts2.append(variables, variable); + } else if (variable.initializer) { + if (!ts2.isBindingPattern(variable.name) && (ts2.isArrowFunction(variable.initializer) || ts2.isFunctionExpression(variable.initializer) || ts2.isClassExpression(variable.initializer))) { + var expression = factory.createAssignment(ts2.setTextRange( + factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name), + /*location*/ + variable.name + ), factory.createIdentifier(ts2.getTextOfIdentifierOrLiteral(variable.name))); + var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts2.visitNode(variable.initializer, visitor)); + variables = ts2.append(variables, updatedVariable); + expressions = ts2.append(expressions, expression); + removeCommentsOnExpressions = true; + } else { + expressions = ts2.append(expressions, transformInitializedVariable(variable)); + } + } + } + if (variables) { + statements = ts2.append(statements, factory.updateVariableStatement(node, modifiers, factory.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + var statement = ts2.setOriginalNode(ts2.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node), node); + if (removeCommentsOnExpressions) { + ts2.removeAllComments(statement); + } + statements = ts2.append(statements, statement); + } + } else { + statements = ts2.append(statements, ts2.visitEachChild(node, visitor, context2)); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node); + } else { + statements = appendExportsOfVariableStatement(statements, node); + } + return ts2.singleOrMany(statements); + } + function createAllExportExpressions(name2, value2, location2) { + var exportedNames = getExports(name2); + if (exportedNames) { + var expression = ts2.isExportName(name2) ? value2 : factory.createAssignment(name2, value2); + for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { + var exportName = exportedNames_2[_i]; + ts2.setEmitFlags( + expression, + 4 + /* EmitFlags.NoSubstitution */ + ); + expression = createExportExpression( + exportName, + expression, + /*location*/ + location2 + ); + } + return expression; + } + return factory.createAssignment(name2, value2); + } + function transformInitializedVariable(node) { + if (ts2.isBindingPattern(node.name)) { + return ts2.flattenDestructuringAssignment( + ts2.visitNode(node, visitor), + /*visitor*/ + void 0, + context2, + 0, + /*needsValue*/ + false, + createAllExportExpressions + ); + } else { + return factory.createAssignment(ts2.setTextRange( + factory.createPropertyAccessExpression(factory.createIdentifier("exports"), node.name), + /*location*/ + node.name + ), node.initializer ? ts2.visitNode(node.initializer, visitor) : factory.createVoidZero()); + } + } + function visitMergeDeclarationMarker(node) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 240) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); + } + return node; + } + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts2.getEmitFlags(node) & 4194304) !== 0; + } + function visitEndOfDeclarationMarker(node) { + var id = ts2.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts2.append(statements, node); + } + return node; + } + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 271: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 272: + for (var _i = 0, _a2 = namedBindings.elements; _i < _a2.length; _i++) { + var importBinding = _a2[_i]; + statements = appendExportsOfDeclaration( + statements, + importBinding, + /* liveBinding */ + true + ); + } + break; + } + } + return statements; + } + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + function appendExportsOfVariableStatement(statements, node) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + statements = appendExportsOfBindingElement(statements, decl); + } + return statements; + } + function appendExportsOfBindingElement(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts2.isBindingPattern(decl.name)) { + for (var _i = 0, _a2 = decl.name.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element); + } + } + } else if (!ts2.isGeneratedIdentifier(decl.name)) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (ts2.hasSyntacticModifier( + decl, + 1 + /* ModifierFlags.Export */ + )) { + var exportName = ts2.hasSyntacticModifier( + decl, + 1024 + /* ModifierFlags.Default */ + ) ? factory.createIdentifier("default") : factory.getDeclarationName(decl); + statements = appendExportStatement( + statements, + exportName, + factory.getLocalName(decl), + /*location*/ + decl + ); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl); + } + return statements; + } + function appendExportsOfDeclaration(statements, decl, liveBinding) { + var name2 = factory.getDeclarationName(decl); + var exportSpecifiers = currentModuleInfo.exportSpecifiers.get(ts2.idText(name2)); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_1 = exportSpecifiers; _i < exportSpecifiers_1.length; _i++) { + var exportSpecifier = exportSpecifiers_1[_i]; + statements = appendExportStatement( + statements, + exportSpecifier.name, + name2, + /*location*/ + exportSpecifier.name, + /* allowComments */ + void 0, + liveBinding + ); + } + } + return statements; + } + function appendExportStatement(statements, exportName, expression, location2, allowComments, liveBinding) { + statements = ts2.append(statements, createExportStatement(exportName, expression, location2, allowComments, liveBinding)); + return statements; + } + function createUnderscoreUnderscoreESModule() { + var statement; + if (languageVersion === 0) { + statement = factory.createExpressionStatement(createExportExpression(factory.createIdentifier("__esModule"), factory.createTrue())); + } else { + statement = factory.createExpressionStatement(factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ + void 0, + [ + factory.createIdentifier("exports"), + factory.createStringLiteral("__esModule"), + factory.createObjectLiteralExpression([ + factory.createPropertyAssignment("value", factory.createTrue()) + ]) + ] + )); + } + ts2.setEmitFlags( + statement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + return statement; + } + function createExportStatement(name2, value2, location2, allowComments, liveBinding) { + var statement = ts2.setTextRange(factory.createExpressionStatement(createExportExpression( + name2, + value2, + /* location */ + void 0, + liveBinding + )), location2); + ts2.startOnNewLine(statement); + if (!allowComments) { + ts2.setEmitFlags( + statement, + 1536 + /* EmitFlags.NoComments */ + ); + } + return statement; + } + function createExportExpression(name2, value2, location2, liveBinding) { + return ts2.setTextRange(liveBinding && languageVersion !== 0 ? factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ + void 0, + [ + factory.createIdentifier("exports"), + factory.createStringLiteralFromNode(name2), + factory.createObjectLiteralExpression([ + factory.createPropertyAssignment("enumerable", factory.createTrue()), + factory.createPropertyAssignment("get", factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory.createBlock([factory.createReturnStatement(value2)]) + )) + ]) + ] + ) : factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(name2)), value2), location2); + } + function modifierVisitor(node) { + switch (node.kind) { + case 93: + case 88: + return void 0; + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 308) { + currentSourceFile = node; + currentModuleInfo = moduleInfoMap[ts2.getOriginalNodeId(currentSourceFile)]; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = void 0; + currentModuleInfo = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1) { + return substituteExpression(node); + } else if (ts2.isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var name2 = node.name; + var exportedOrImportedName = substituteExpressionIdentifier(name2); + if (exportedOrImportedName !== name2) { + if (node.objectAssignmentInitializer) { + var initializer = factory.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return ts2.setTextRange(factory.createPropertyAssignment(name2, initializer), node); + } + return ts2.setTextRange(factory.createPropertyAssignment(name2, exportedOrImportedName), node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + case 210: + return substituteCallExpression(node); + case 212: + return substituteTaggedTemplateExpression(node); + case 223: + return substituteBinaryExpression(node); + } + return node; + } + function substituteCallExpression(node) { + if (ts2.isIdentifier(node.expression)) { + var expression = substituteExpressionIdentifier(node.expression); + noSubstitution[ts2.getNodeId(expression)] = true; + if (!ts2.isIdentifier(expression) && !(ts2.getEmitFlags(node.expression) & 4096)) { + return ts2.addEmitFlags( + factory.updateCallExpression( + node, + expression, + /*typeArguments*/ + void 0, + node.arguments + ), + 536870912 + /* EmitFlags.IndirectCall */ + ); + } + } + return node; + } + function substituteTaggedTemplateExpression(node) { + if (ts2.isIdentifier(node.tag)) { + var tag = substituteExpressionIdentifier(node.tag); + noSubstitution[ts2.getNodeId(tag)] = true; + if (!ts2.isIdentifier(tag) && !(ts2.getEmitFlags(node.tag) & 4096)) { + return ts2.addEmitFlags( + factory.updateTaggedTemplateExpression( + node, + tag, + /*typeArguments*/ + void 0, + node.template + ), + 536870912 + /* EmitFlags.IndirectCall */ + ); + } + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2, _b; + if (ts2.getEmitFlags(node) & 4096) { + var externalHelpersModuleName = ts2.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return factory.createPropertyAccessExpression(externalHelpersModuleName, node); + } + return node; + } else if (!(ts2.isGeneratedIdentifier(node) && !(node.autoGenerateFlags & 64)) && !ts2.isLocalName(node)) { + var exportContainer = resolver.getReferencedExportContainer(node, ts2.isExportName(node)); + if (exportContainer && exportContainer.kind === 308) { + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(node)), + /*location*/ + node + ); + } + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts2.isImportClause(importDeclaration)) { + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier("default")), + /*location*/ + node + ); + } else if (ts2.isImportSpecifier(importDeclaration)) { + var name2 = importDeclaration.propertyName || importDeclaration.name; + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) === null || _a2 === void 0 ? void 0 : _a2.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(name2)), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteBinaryExpression(node) { + if (ts2.isAssignmentOperator(node.operatorToken.kind) && ts2.isIdentifier(node.left) && !ts2.isGeneratedIdentifier(node.left) && !ts2.isLocalName(node.left) && !ts2.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + var expression = node; + for (var _i = 0, exportedNames_3 = exportedNames; _i < exportedNames_3.length; _i++) { + var exportName = exportedNames_3[_i]; + noSubstitution[ts2.getNodeId(expression)] = true; + expression = createExportExpression( + exportName, + expression, + /*location*/ + node + ); + } + return expression; + } + } + return node; + } + function getExports(name2) { + if (!ts2.isGeneratedIdentifier(name2)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name2) || resolver.getReferencedValueDeclaration(name2); + if (valueDeclaration) { + return currentModuleInfo && currentModuleInfo.exportedBindings[ts2.getOriginalNodeId(valueDeclaration)]; + } + } + } + } + ts2.transformModule = transformModule; + var dynamicImportUMDHelper = { + name: "typescript:dynamicimport-sync-require", + scoped: true, + text: '\n var __syncRequire = typeof module === "object" && typeof module.exports === "object";' + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformSystemModule(context2) { + var factory = context2.factory, startLexicalEnvironment = context2.startLexicalEnvironment, endLexicalEnvironment = context2.endLexicalEnvironment, hoistVariableDeclaration = context2.hoistVariableDeclaration; + var compilerOptions = context2.getCompilerOptions(); + var resolver = context2.getEmitResolver(); + var host = context2.getEmitHost(); + var previousOnSubstituteNode = context2.onSubstituteNode; + var previousOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + context2.enableSubstitution( + 300 + /* SyntaxKind.ShorthandPropertyAssignment */ + ); + context2.enableSubstitution( + 223 + /* SyntaxKind.BinaryExpression */ + ); + context2.enableSubstitution( + 233 + /* SyntaxKind.MetaProperty */ + ); + context2.enableEmitNotification( + 308 + /* SyntaxKind.SourceFile */ + ); + var moduleInfoMap = []; + var deferredExports = []; + var exportFunctionsMap = []; + var noSubstitutionMap = []; + var contextObjectMap = []; + var currentSourceFile; + var moduleInfo; + var exportFunction; + var contextObject; + var hoistedStatements; + var enclosingBlockScopedContainer; + var noSubstitution; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || !(ts2.isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608)) { + return node; + } + var id = ts2.getOriginalNodeId(node); + currentSourceFile = node; + enclosingBlockScopedContainer = node; + moduleInfo = moduleInfoMap[id] = ts2.collectExternalModuleInfo(context2, node, resolver, compilerOptions); + exportFunction = factory.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; + contextObject = contextObjectMap[id] = factory.createUniqueName("context"); + var dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); + var moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); + var moduleBodyFunction = factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + exportFunction + ), + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + contextObject + ) + ], + /*type*/ + void 0, + moduleBodyBlock + ); + var moduleName3 = ts2.tryGetModuleNameFromFile(factory, node, host, compilerOptions); + var dependencies = factory.createArrayLiteralExpression(ts2.map(dependencyGroups, function(dependencyGroup) { + return dependencyGroup.name; + })); + var updated = ts2.setEmitFlags( + factory.updateSourceFile(node, ts2.setTextRange(factory.createNodeArray([ + factory.createExpressionStatement(factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("System"), "register"), + /*typeArguments*/ + void 0, + moduleName3 ? [moduleName3, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction] + )) + ]), node.statements)), + 1024 + /* EmitFlags.NoTrailingComments */ + ); + if (!ts2.outFile(compilerOptions)) { + ts2.moveEmitHelpers(updated, moduleBodyBlock, function(helper) { + return !helper.scoped; + }); + } + if (noSubstitution) { + noSubstitutionMap[id] = noSubstitution; + noSubstitution = void 0; + } + currentSourceFile = void 0; + moduleInfo = void 0; + exportFunction = void 0; + contextObject = void 0; + hoistedStatements = void 0; + enclosingBlockScopedContainer = void 0; + return updated; + } + function collectDependencyGroups(externalImports) { + var groupIndices = new ts2.Map(); + var dependencyGroups = []; + for (var _i = 0, externalImports_1 = externalImports; _i < externalImports_1.length; _i++) { + var externalImport = externalImports_1[_i]; + var externalModuleName = ts2.getExternalModuleNameLiteral(factory, externalImport, currentSourceFile, host, resolver, compilerOptions); + if (externalModuleName) { + var text = externalModuleName.text; + var groupIndex = groupIndices.get(text); + if (groupIndex !== void 0) { + dependencyGroups[groupIndex].externalImports.push(externalImport); + } else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } + } + } + return dependencyGroups; + } + function createSystemModuleBody(node, dependencyGroups) { + var statements = []; + startLexicalEnvironment(); + var ensureUseStrict = ts2.getStrictOptionValue(compilerOptions, "alwaysStrict") || !compilerOptions.noImplicitUseStrict && ts2.isExternalModule(currentSourceFile); + var statementOffset = factory.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor); + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + "__moduleName", + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createLogicalAnd(contextObject, factory.createPropertyAccessExpression(contextObject, "id")) + ) + ]) + )); + ts2.visitNode(moduleInfo.externalHelpersImportDeclaration, topLevelVisitor, ts2.isStatement); + var executeStatements = ts2.visitNodes(node.statements, topLevelVisitor, ts2.isStatement, statementOffset); + ts2.addRange(statements, hoistedStatements); + ts2.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + var exportStarFunction = addExportStarIfNeeded(statements); + var modifiers = node.transformFlags & 2097152 ? factory.createModifiersFromModifierFlags( + 512 + /* ModifierFlags.Async */ + ) : void 0; + var moduleObject = factory.createObjectLiteralExpression( + [ + factory.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), + factory.createPropertyAssignment("execute", factory.createFunctionExpression( + modifiers, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory.createBlock( + executeStatements, + /*multiLine*/ + true + ) + )) + ], + /*multiLine*/ + true + ); + statements.push(factory.createReturnStatement(moduleObject)); + return factory.createBlock( + statements, + /*multiLine*/ + true + ); + } + function addExportStarIfNeeded(statements) { + if (!moduleInfo.hasExportStarsToExportValues) { + return; + } + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { + var hasExportDeclarationWithExportClause = false; + for (var _i = 0, _a2 = moduleInfo.externalImports; _i < _a2.length; _i++) { + var externalImport = _a2[_i]; + if (externalImport.kind === 275 && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + var exportStarFunction_1 = createExportStarFunction( + /*localNames*/ + void 0 + ); + statements.push(exportStarFunction_1); + return exportStarFunction_1.name; + } + } + var exportedNames = []; + if (moduleInfo.exportedNames) { + for (var _b = 0, _c = moduleInfo.exportedNames; _b < _c.length; _b++) { + var exportedLocalName = _c[_b]; + if (exportedLocalName.escapedText === "default") { + continue; + } + exportedNames.push(factory.createPropertyAssignment(factory.createStringLiteralFromNode(exportedLocalName), factory.createTrue())); + } + } + var exportedNamesStorageRef = factory.createUniqueName("exportedNames"); + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + exportedNamesStorageRef, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createObjectLiteralExpression( + exportedNames, + /*multiline*/ + true + ) + ) + ]) + )); + var exportStarFunction = createExportStarFunction(exportedNamesStorageRef); + statements.push(exportStarFunction); + return exportStarFunction.name; + } + function createExportStarFunction(localNames) { + var exportStarFunction = factory.createUniqueName("exportStar"); + var m7 = factory.createIdentifier("m"); + var n7 = factory.createIdentifier("n"); + var exports29 = factory.createIdentifier("exports"); + var condition = factory.createStrictInequality(n7, factory.createStringLiteral("default")); + if (localNames) { + condition = factory.createLogicalAnd(condition, factory.createLogicalNot(factory.createCallExpression( + factory.createPropertyAccessExpression(localNames, "hasOwnProperty"), + /*typeArguments*/ + void 0, + [n7] + ))); + } + return factory.createFunctionDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + exportStarFunction, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + m7 + )], + /*type*/ + void 0, + factory.createBlock( + [ + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + exports29, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createObjectLiteralExpression([]) + ) + ]) + ), + factory.createForInStatement(factory.createVariableDeclarationList([ + factory.createVariableDeclaration(n7) + ]), m7, factory.createBlock([ + ts2.setEmitFlags( + factory.createIfStatement(condition, factory.createExpressionStatement(factory.createAssignment(factory.createElementAccessExpression(exports29, n7), factory.createElementAccessExpression(m7, n7)))), + 1 + /* EmitFlags.SingleLine */ + ) + ])), + factory.createExpressionStatement(factory.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [exports29] + )) + ], + /*multiline*/ + true + ) + ); + } + function createSettersArray(exportStarFunction, dependencyGroups) { + var setters = []; + for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { + var group_2 = dependencyGroups_1[_i]; + var localName = ts2.forEach(group_2.externalImports, function(i7) { + return ts2.getLocalNameForExternalImport(factory, i7, currentSourceFile); + }); + var parameterName = localName ? factory.getGeneratedNameForNode(localName) : factory.createUniqueName(""); + var statements = []; + for (var _a2 = 0, _b = group_2.externalImports; _a2 < _b.length; _a2++) { + var entry = _b[_a2]; + var importVariableName = ts2.getLocalNameForExternalImport(factory, entry, currentSourceFile); + switch (entry.kind) { + case 269: + if (!entry.importClause) { + break; + } + case 268: + ts2.Debug.assert(importVariableName !== void 0); + statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName))); + if (ts2.hasSyntacticModifier( + entry, + 1 + /* ModifierFlags.Export */ + )) { + statements.push(factory.createExpressionStatement(factory.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [ + factory.createStringLiteral(ts2.idText(importVariableName)), + parameterName + ] + ))); + } + break; + case 275: + ts2.Debug.assert(importVariableName !== void 0); + if (entry.exportClause) { + if (ts2.isNamedExports(entry.exportClause)) { + var properties = []; + for (var _c = 0, _d = entry.exportClause.elements; _c < _d.length; _c++) { + var e10 = _d[_c]; + properties.push(factory.createPropertyAssignment(factory.createStringLiteral(ts2.idText(e10.name)), factory.createElementAccessExpression(parameterName, factory.createStringLiteral(ts2.idText(e10.propertyName || e10.name))))); + } + statements.push(factory.createExpressionStatement(factory.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [factory.createObjectLiteralExpression( + properties, + /*multiline*/ + true + )] + ))); + } else { + statements.push(factory.createExpressionStatement(factory.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [ + factory.createStringLiteral(ts2.idText(entry.exportClause.name)), + parameterName + ] + ))); + } + } else { + statements.push(factory.createExpressionStatement(factory.createCallExpression( + exportStarFunction, + /*typeArguments*/ + void 0, + [parameterName] + ))); + } + break; + } + } + setters.push(factory.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + factory.createBlock( + statements, + /*multiLine*/ + true + ) + )); + } + return factory.createArrayLiteralExpression( + setters, + /*multiLine*/ + true + ); + } + function topLevelVisitor(node) { + switch (node.kind) { + case 269: + return visitImportDeclaration(node); + case 268: + return visitImportEqualsDeclaration(node); + case 275: + return visitExportDeclaration(node); + case 274: + return visitExportAssignment(node); + default: + return topLevelNestedVisitor(node); + } + } + function visitImportDeclaration(node) { + var statements; + if (node.importClause) { + hoistVariableDeclaration(ts2.getLocalNameForExternalImport(factory, node, currentSourceFile)); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfImportDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitExportDeclaration(node) { + ts2.Debug.assertIsDefined(node); + return void 0; + } + function visitImportEqualsDeclaration(node) { + ts2.Debug.assert(ts2.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + hoistVariableDeclaration(ts2.getLocalNameForExternalImport(factory, node, currentSourceFile)); + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfImportEqualsDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfImportEqualsDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitExportAssignment(node) { + if (node.isExportEquals) { + return void 0; + } + var expression = ts2.visitNode(node.expression, visitor, ts2.isExpression); + var original = node.original; + if (original && hasAssociatedEndOfDeclarationMarker(original)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportStatement( + deferredExports[id], + factory.createIdentifier("default"), + expression, + /*allowComments*/ + true + ); + } else { + return createExportStatement( + factory.createIdentifier("default"), + expression, + /*allowComments*/ + true + ); + } + } + function visitFunctionDeclaration(node) { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + hoistedStatements = ts2.append(hoistedStatements, factory.updateFunctionDeclaration( + node, + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike), + node.asteriskToken, + factory.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + ts2.visitNodes(node.parameters, visitor, ts2.isParameterDeclaration), + /*type*/ + void 0, + ts2.visitNode(node.body, visitor, ts2.isBlock) + )); + } else { + hoistedStatements = ts2.append(hoistedStatements, ts2.visitEachChild(node, visitor, context2)); + } + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } else { + hoistedStatements = appendExportsOfHoistedDeclaration(hoistedStatements, node); + } + return void 0; + } + function visitClassDeclaration(node) { + var statements; + var name2 = factory.getLocalName(node); + hoistVariableDeclaration(name2); + statements = ts2.append(statements, ts2.setTextRange(factory.createExpressionStatement(factory.createAssignment(name2, ts2.setTextRange(factory.createClassExpression( + ts2.visitNodes(node.modifiers, modifierVisitor, ts2.isModifierLike), + node.name, + /*typeParameters*/ + void 0, + ts2.visitNodes(node.heritageClauses, visitor, ts2.isHeritageClause), + ts2.visitNodes(node.members, visitor, ts2.isClassElement) + ), node))), node)); + if (hasAssociatedEndOfDeclarationMarker(node)) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfHoistedDeclaration(deferredExports[id], node); + } else { + statements = appendExportsOfHoistedDeclaration(statements, node); + } + return ts2.singleOrMany(statements); + } + function visitVariableStatement(node) { + if (!shouldHoistVariableDeclarationList(node.declarationList)) { + return ts2.visitNode(node, visitor, ts2.isStatement); + } + var expressions; + var isExportedDeclaration = ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ); + var isMarkedDeclaration = hasAssociatedEndOfDeclarationMarker(node); + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + if (variable.initializer) { + expressions = ts2.append(expressions, transformInitializedVariable(variable, isExportedDeclaration && !isMarkedDeclaration)); + } else { + hoistBindingElement(variable); + } + } + var statements; + if (expressions) { + statements = ts2.append(statements, ts2.setTextRange(factory.createExpressionStatement(factory.inlineExpressions(expressions)), node)); + } + if (isMarkedDeclaration) { + var id = ts2.getOriginalNodeId(node); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node, isExportedDeclaration); + } else { + statements = appendExportsOfVariableStatement( + statements, + node, + /*exportSelf*/ + false + ); + } + return ts2.singleOrMany(statements); + } + function hoistBindingElement(node) { + if (ts2.isBindingPattern(node.name)) { + for (var _i = 0, _a2 = node.name.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + hoistBindingElement(element); + } + } + } else { + hoistVariableDeclaration(factory.cloneNode(node.name)); + } + } + function shouldHoistVariableDeclarationList(node) { + return (ts2.getEmitFlags(node) & 2097152) === 0 && (enclosingBlockScopedContainer.kind === 308 || (ts2.getOriginalNode(node).flags & 3) === 0); + } + function transformInitializedVariable(node, isExportedDeclaration) { + var createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; + return ts2.isBindingPattern(node.name) ? ts2.flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + /*needsValue*/ + false, + createAssignment + ) : node.initializer ? createAssignment(node.name, ts2.visitNode(node.initializer, visitor, ts2.isExpression)) : node.name; + } + function createExportedVariableAssignment(name2, value2, location2) { + return createVariableAssignment( + name2, + value2, + location2, + /*isExportedDeclaration*/ + true + ); + } + function createNonExportedVariableAssignment(name2, value2, location2) { + return createVariableAssignment( + name2, + value2, + location2, + /*isExportedDeclaration*/ + false + ); + } + function createVariableAssignment(name2, value2, location2, isExportedDeclaration) { + hoistVariableDeclaration(factory.cloneNode(name2)); + return isExportedDeclaration ? createExportExpression(name2, preventSubstitution(ts2.setTextRange(factory.createAssignment(name2, value2), location2))) : preventSubstitution(ts2.setTextRange(factory.createAssignment(name2, value2), location2)); + } + function visitMergeDeclarationMarker(node) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 240) { + var id = ts2.getOriginalNodeId(node); + var isExportedDeclaration = ts2.hasSyntacticModifier( + node.original, + 1 + /* ModifierFlags.Export */ + ); + deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); + } + return node; + } + function hasAssociatedEndOfDeclarationMarker(node) { + return (ts2.getEmitFlags(node) & 4194304) !== 0; + } + function visitEndOfDeclarationMarker(node) { + var id = ts2.getOriginalNodeId(node); + var statements = deferredExports[id]; + if (statements) { + delete deferredExports[id]; + return ts2.append(statements, node); + } else { + var original = ts2.getOriginalNode(node); + if (ts2.isModuleOrEnumDeclaration(original)) { + return ts2.append(appendExportsOfDeclaration(statements, original), node); + } + } + return node; + } + function appendExportsOfImportDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + var importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 271: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 272: + for (var _i = 0, _a2 = namedBindings.elements; _i < _a2.length; _i++) { + var importBinding = _a2[_i]; + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + function appendExportsOfVariableStatement(statements, node, exportSelf) { + if (moduleInfo.exportEquals) { + return statements; + } + for (var _i = 0, _a2 = node.declarationList.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (decl.initializer || exportSelf) { + statements = appendExportsOfBindingElement(statements, decl, exportSelf); + } + } + return statements; + } + function appendExportsOfBindingElement(statements, decl, exportSelf) { + if (moduleInfo.exportEquals) { + return statements; + } + if (ts2.isBindingPattern(decl.name)) { + for (var _i = 0, _a2 = decl.name.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element, exportSelf); + } + } + } else if (!ts2.isGeneratedIdentifier(decl.name)) { + var excludeName = void 0; + if (exportSelf) { + statements = appendExportStatement(statements, decl.name, factory.getLocalName(decl)); + excludeName = ts2.idText(decl.name); + } + statements = appendExportsOfDeclaration(statements, decl, excludeName); + } + return statements; + } + function appendExportsOfHoistedDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + var excludeName; + if (ts2.hasSyntacticModifier( + decl, + 1 + /* ModifierFlags.Export */ + )) { + var exportName = ts2.hasSyntacticModifier( + decl, + 1024 + /* ModifierFlags.Default */ + ) ? factory.createStringLiteral("default") : decl.name; + statements = appendExportStatement(statements, exportName, factory.getLocalName(decl)); + excludeName = ts2.getTextOfIdentifierOrLiteral(exportName); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl, excludeName); + } + return statements; + } + function appendExportsOfDeclaration(statements, decl, excludeName) { + if (moduleInfo.exportEquals) { + return statements; + } + var name2 = factory.getDeclarationName(decl); + var exportSpecifiers = moduleInfo.exportSpecifiers.get(ts2.idText(name2)); + if (exportSpecifiers) { + for (var _i = 0, exportSpecifiers_2 = exportSpecifiers; _i < exportSpecifiers_2.length; _i++) { + var exportSpecifier = exportSpecifiers_2[_i]; + if (exportSpecifier.name.escapedText !== excludeName) { + statements = appendExportStatement(statements, exportSpecifier.name, name2); + } + } + } + return statements; + } + function appendExportStatement(statements, exportName, expression, allowComments) { + statements = ts2.append(statements, createExportStatement(exportName, expression, allowComments)); + return statements; + } + function createExportStatement(name2, value2, allowComments) { + var statement = factory.createExpressionStatement(createExportExpression(name2, value2)); + ts2.startOnNewLine(statement); + if (!allowComments) { + ts2.setEmitFlags( + statement, + 1536 + /* EmitFlags.NoComments */ + ); + } + return statement; + } + function createExportExpression(name2, value2) { + var exportName = ts2.isIdentifier(name2) ? factory.createStringLiteralFromNode(name2) : name2; + ts2.setEmitFlags( + value2, + ts2.getEmitFlags(value2) | 1536 + /* EmitFlags.NoComments */ + ); + return ts2.setCommentRange(factory.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [exportName, value2] + ), value2); + } + function topLevelNestedVisitor(node) { + switch (node.kind) { + case 240: + return visitVariableStatement(node); + case 259: + return visitFunctionDeclaration(node); + case 260: + return visitClassDeclaration(node); + case 245: + return visitForStatement( + node, + /*isTopLevel*/ + true + ); + case 246: + return visitForInStatement(node); + case 247: + return visitForOfStatement(node); + case 243: + return visitDoStatement(node); + case 244: + return visitWhileStatement(node); + case 253: + return visitLabeledStatement(node); + case 251: + return visitWithStatement(node); + case 252: + return visitSwitchStatement(node); + case 266: + return visitCaseBlock(node); + case 292: + return visitCaseClause(node); + case 293: + return visitDefaultClause(node); + case 255: + return visitTryStatement(node); + case 295: + return visitCatchClause(node); + case 238: + return visitBlock(node); + case 355: + return visitMergeDeclarationMarker(node); + case 356: + return visitEndOfDeclarationMarker(node); + default: + return visitor(node); + } + } + function visitForStatement(node, isTopLevel) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory.updateForStatement(node, ts2.visitNode(node.initializer, isTopLevel ? visitForInitializer : discardedValueVisitor, ts2.isForInitializer), ts2.visitNode(node.condition, visitor, ts2.isExpression), ts2.visitNode(node.incrementor, discardedValueVisitor, ts2.isExpression), ts2.visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context2)); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitForInStatement(node) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory.updateForInStatement(node, visitForInitializer(node.initializer), ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, topLevelNestedVisitor, context2)); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitForOfStatement(node) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory.updateForOfStatement(node, node.awaitModifier, visitForInitializer(node.initializer), ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, topLevelNestedVisitor, context2)); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function shouldHoistForInitializer(node) { + return ts2.isVariableDeclarationList(node) && shouldHoistVariableDeclarationList(node); + } + function visitForInitializer(node) { + if (shouldHoistForInitializer(node)) { + var expressions = void 0; + for (var _i = 0, _a2 = node.declarations; _i < _a2.length; _i++) { + var variable = _a2[_i]; + expressions = ts2.append(expressions, transformInitializedVariable( + variable, + /*isExportedDeclaration*/ + false + )); + if (!variable.initializer) { + hoistBindingElement(variable); + } + } + return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression(); + } else { + return ts2.visitNode(node, discardedValueVisitor, ts2.isExpression); + } + } + function visitDoStatement(node) { + return factory.updateDoStatement(node, ts2.visitIterationBody(node.statement, topLevelNestedVisitor, context2), ts2.visitNode(node.expression, visitor, ts2.isExpression)); + } + function visitWhileStatement(node) { + return factory.updateWhileStatement(node, ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitIterationBody(node.statement, topLevelNestedVisitor, context2)); + } + function visitLabeledStatement(node) { + return factory.updateLabeledStatement(node, node.label, ts2.visitNode(node.statement, topLevelNestedVisitor, ts2.isStatement, factory.liftToBlock)); + } + function visitWithStatement(node) { + return factory.updateWithStatement(node, ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitNode(node.statement, topLevelNestedVisitor, ts2.isStatement, factory.liftToBlock)); + } + function visitSwitchStatement(node) { + return factory.updateSwitchStatement(node, ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitNode(node.caseBlock, topLevelNestedVisitor, ts2.isCaseBlock)); + } + function visitCaseBlock(node) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory.updateCaseBlock(node, ts2.visitNodes(node.clauses, topLevelNestedVisitor, ts2.isCaseOrDefaultClause)); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitCaseClause(node) { + return factory.updateCaseClause(node, ts2.visitNode(node.expression, visitor, ts2.isExpression), ts2.visitNodes(node.statements, topLevelNestedVisitor, ts2.isStatement)); + } + function visitDefaultClause(node) { + return ts2.visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitTryStatement(node) { + return ts2.visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitCatchClause(node) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory.updateCatchClause(node, node.variableDeclaration, ts2.visitNode(node.block, topLevelNestedVisitor, ts2.isBlock)); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitBlock(node) { + var savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = ts2.visitEachChild(node, topLevelNestedVisitor, context2); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitorWorker(node, valueIsDiscarded) { + if (!(node.transformFlags & (4096 | 8388608 | 268435456))) { + return node; + } + switch (node.kind) { + case 245: + return visitForStatement( + node, + /*isTopLevel*/ + false + ); + case 241: + return visitExpressionStatement(node); + case 214: + return visitParenthesizedExpression(node, valueIsDiscarded); + case 353: + return visitPartiallyEmittedExpression(node, valueIsDiscarded); + case 223: + if (ts2.isDestructuringAssignment(node)) { + return visitDestructuringAssignment(node, valueIsDiscarded); + } + break; + case 210: + if (ts2.isImportCall(node)) { + return visitImportCallExpression(node); + } + break; + case 221: + case 222: + return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); + } + return ts2.visitEachChild(node, visitor, context2); + } + function visitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + false + ); + } + function discardedValueVisitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + true + ); + } + function visitExpressionStatement(node) { + return factory.updateExpressionStatement(node, ts2.visitNode(node.expression, discardedValueVisitor, ts2.isExpression)); + } + function visitParenthesizedExpression(node, valueIsDiscarded) { + return factory.updateParenthesizedExpression(node, ts2.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts2.isExpression)); + } + function visitPartiallyEmittedExpression(node, valueIsDiscarded) { + return factory.updatePartiallyEmittedExpression(node, ts2.visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, ts2.isExpression)); + } + function visitImportCallExpression(node) { + var externalModuleName = ts2.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions); + var firstArgument = ts2.visitNode(ts2.firstOrUndefined(node.arguments), visitor); + var argument = externalModuleName && (!firstArgument || !ts2.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; + return factory.createCallExpression( + factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("import")), + /*typeArguments*/ + void 0, + argument ? [argument] : [] + ); + } + function visitDestructuringAssignment(node, valueIsDiscarded) { + if (hasExportedReferenceInDestructuringTarget(node.left)) { + return ts2.flattenDestructuringAssignment(node, visitor, context2, 0, !valueIsDiscarded); + } + return ts2.visitEachChild(node, visitor, context2); + } + function hasExportedReferenceInDestructuringTarget(node) { + if (ts2.isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + return hasExportedReferenceInDestructuringTarget(node.left); + } else if (ts2.isSpreadElement(node)) { + return hasExportedReferenceInDestructuringTarget(node.expression); + } else if (ts2.isObjectLiteralExpression(node)) { + return ts2.some(node.properties, hasExportedReferenceInDestructuringTarget); + } else if (ts2.isArrayLiteralExpression(node)) { + return ts2.some(node.elements, hasExportedReferenceInDestructuringTarget); + } else if (ts2.isShorthandPropertyAssignment(node)) { + return hasExportedReferenceInDestructuringTarget(node.name); + } else if (ts2.isPropertyAssignment(node)) { + return hasExportedReferenceInDestructuringTarget(node.initializer); + } else if (ts2.isIdentifier(node)) { + var container = resolver.getReferencedExportContainer(node); + return container !== void 0 && container.kind === 308; + } else { + return false; + } + } + function visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded) { + if ((node.operator === 45 || node.operator === 46) && ts2.isIdentifier(node.operand) && !ts2.isGeneratedIdentifier(node.operand) && !ts2.isLocalName(node.operand) && !ts2.isDeclarationNameOfEnumOrNamespace(node.operand)) { + var exportedNames = getExports(node.operand); + if (exportedNames) { + var temp = void 0; + var expression = ts2.visitNode(node.operand, visitor, ts2.isExpression); + if (ts2.isPrefixUnaryExpression(node)) { + expression = factory.updatePrefixUnaryExpression(node, expression); + } else { + expression = factory.updatePostfixUnaryExpression(node, expression); + if (!valueIsDiscarded) { + temp = factory.createTempVariable(hoistVariableDeclaration); + expression = factory.createAssignment(temp, expression); + ts2.setTextRange(expression, node); + } + expression = factory.createComma(expression, factory.cloneNode(node.operand)); + ts2.setTextRange(expression, node); + } + for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { + var exportName = exportedNames_4[_i]; + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (temp) { + expression = factory.createComma(expression, temp); + ts2.setTextRange(expression, node); + } + return expression; + } + } + return ts2.visitEachChild(node, visitor, context2); + } + function modifierVisitor(node) { + switch (node.kind) { + case 93: + case 88: + return void 0; + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 308) { + var id = ts2.getOriginalNodeId(node); + currentSourceFile = node; + moduleInfo = moduleInfoMap[id]; + exportFunction = exportFunctionsMap[id]; + noSubstitution = noSubstitutionMap[id]; + contextObject = contextObjectMap[id]; + if (noSubstitution) { + delete noSubstitutionMap[id]; + } + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = void 0; + moduleInfo = void 0; + exportFunction = void 0; + contextObject = void 0; + noSubstitution = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (isSubstitutionPrevented(node)) { + return node; + } + if (hint === 1) { + return substituteExpression(node); + } else if (hint === 4) { + return substituteUnspecified(node); + } + return node; + } + function substituteUnspecified(node) { + switch (node.kind) { + case 300: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var _a2, _b; + var name2 = node.name; + if (!ts2.isGeneratedIdentifier(name2) && !ts2.isLocalName(name2)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name2); + if (importDeclaration) { + if (ts2.isImportClause(importDeclaration)) { + return ts2.setTextRange( + factory.createPropertyAssignment(factory.cloneNode(name2), factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier("default"))), + /*location*/ + node + ); + } else if (ts2.isImportSpecifier(importDeclaration)) { + return ts2.setTextRange( + factory.createPropertyAssignment(factory.cloneNode(name2), factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) === null || _a2 === void 0 ? void 0 : _a2.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(importDeclaration.propertyName || importDeclaration.name))), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 79: + return substituteExpressionIdentifier(node); + case 223: + return substituteBinaryExpression(node); + case 233: + return substituteMetaProperty(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2, _b; + if (ts2.getEmitFlags(node) & 4096) { + var externalHelpersModuleName = ts2.getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return factory.createPropertyAccessExpression(externalHelpersModuleName, node); + } + return node; + } + if (!ts2.isGeneratedIdentifier(node) && !ts2.isLocalName(node)) { + var importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (ts2.isImportClause(importDeclaration)) { + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(importDeclaration.parent), factory.createIdentifier("default")), + /*location*/ + node + ); + } else if (ts2.isImportSpecifier(importDeclaration)) { + return ts2.setTextRange( + factory.createPropertyAccessExpression(factory.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) === null || _a2 === void 0 ? void 0 : _a2.parent) === null || _b === void 0 ? void 0 : _b.parent) || importDeclaration), factory.cloneNode(importDeclaration.propertyName || importDeclaration.name)), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteBinaryExpression(node) { + if (ts2.isAssignmentOperator(node.operatorToken.kind) && ts2.isIdentifier(node.left) && !ts2.isGeneratedIdentifier(node.left) && !ts2.isLocalName(node.left) && !ts2.isDeclarationNameOfEnumOrNamespace(node.left)) { + var exportedNames = getExports(node.left); + if (exportedNames) { + var expression = node; + for (var _i = 0, exportedNames_5 = exportedNames; _i < exportedNames_5.length; _i++) { + var exportName = exportedNames_5[_i]; + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + return expression; + } + } + return node; + } + function substituteMetaProperty(node) { + if (ts2.isImportMeta(node)) { + return factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("meta")); + } + return node; + } + function getExports(name2) { + var exportedNames; + if (!ts2.isGeneratedIdentifier(name2)) { + var valueDeclaration = resolver.getReferencedImportDeclaration(name2) || resolver.getReferencedValueDeclaration(name2); + if (valueDeclaration) { + var exportContainer = resolver.getReferencedExportContainer( + name2, + /*prefixLocals*/ + false + ); + if (exportContainer && exportContainer.kind === 308) { + exportedNames = ts2.append(exportedNames, factory.getDeclarationName(valueDeclaration)); + } + exportedNames = ts2.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts2.getOriginalNodeId(valueDeclaration)]); + } + } + return exportedNames; + } + function preventSubstitution(node) { + if (noSubstitution === void 0) + noSubstitution = []; + noSubstitution[ts2.getNodeId(node)] = true; + return node; + } + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; + } + } + ts2.transformSystemModule = transformSystemModule; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformECMAScriptModule(context2) { + var factory = context2.factory, emitHelpers = context2.getEmitHelperFactory; + var host = context2.getEmitHost(); + var resolver = context2.getEmitResolver(); + var compilerOptions = context2.getCompilerOptions(); + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var previousOnEmitNode = context2.onEmitNode; + var previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableEmitNotification( + 308 + /* SyntaxKind.SourceFile */ + ); + context2.enableSubstitution( + 79 + /* SyntaxKind.Identifier */ + ); + var helperNameSubstitutions; + var currentSourceFile; + var importRequireStatements; + return ts2.chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + if (ts2.isExternalModule(node) || compilerOptions.isolatedModules) { + currentSourceFile = node; + importRequireStatements = void 0; + var result2 = updateExternalModule(node); + currentSourceFile = void 0; + if (importRequireStatements) { + result2 = factory.updateSourceFile(result2, ts2.setTextRange(factory.createNodeArray(ts2.insertStatementsAfterCustomPrologue(result2.statements.slice(), importRequireStatements)), result2.statements)); + } + if (!ts2.isExternalModule(node) || ts2.some(result2.statements, ts2.isExternalModuleIndicator)) { + return result2; + } + return factory.updateSourceFile(result2, ts2.setTextRange(factory.createNodeArray(__spreadArray9(__spreadArray9([], result2.statements, true), [ts2.createEmptyExports(factory)], false)), result2.statements)); + } + return node; + } + function updateExternalModule(node) { + var externalHelpersImportDeclaration = ts2.createExternalHelpersImportDeclarationIfNeeded(factory, emitHelpers(), node, compilerOptions); + if (externalHelpersImportDeclaration) { + var statements = []; + var statementOffset = factory.copyPrologue(node.statements, statements); + ts2.append(statements, externalHelpersImportDeclaration); + ts2.addRange(statements, ts2.visitNodes(node.statements, visitor, ts2.isStatement, statementOffset)); + return factory.updateSourceFile(node, ts2.setTextRange(factory.createNodeArray(statements), node.statements)); + } else { + return ts2.visitEachChild(node, visitor, context2); + } + } + function visitor(node) { + switch (node.kind) { + case 268: + return ts2.getEmitModuleKind(compilerOptions) >= ts2.ModuleKind.Node16 ? visitImportEqualsDeclaration(node) : void 0; + case 274: + return visitExportAssignment(node); + case 275: + var exportDecl = node; + return visitExportDeclaration(exportDecl); + } + return node; + } + function createRequireCall(importNode) { + var moduleName3 = ts2.getExternalModuleNameLiteral(factory, importNode, ts2.Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions); + var args = []; + if (moduleName3) { + args.push(moduleName3); + } + if (!importRequireStatements) { + var createRequireName = factory.createUniqueName( + "_createRequire", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ); + var importStatement = factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamedImports([ + factory.createImportSpecifier( + /*isTypeOnly*/ + false, + factory.createIdentifier("createRequire"), + createRequireName + ) + ]) + ), + factory.createStringLiteral("module") + ); + var requireHelperName = factory.createUniqueName( + "__require", + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ); + var requireStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + requireHelperName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createCallExpression( + factory.cloneNode(createRequireName), + /*typeArguments*/ + void 0, + [ + factory.createPropertyAccessExpression(factory.createMetaProperty(100, factory.createIdentifier("meta")), factory.createIdentifier("url")) + ] + ) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* NodeFlags.None */ + ) + ); + importRequireStatements = [importStatement, requireStatement]; + } + var name2 = importRequireStatements[1].declarationList.declarations[0].name; + ts2.Debug.assertNode(name2, ts2.isIdentifier); + return factory.createCallExpression( + factory.cloneNode(name2), + /*typeArguments*/ + void 0, + args + ); + } + function visitImportEqualsDeclaration(node) { + ts2.Debug.assert(ts2.isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + var statements; + statements = ts2.append(statements, ts2.setOriginalNode(ts2.setTextRange(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + factory.cloneNode(node.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall(node) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* NodeFlags.None */ + ) + ), node), node)); + statements = appendExportsOfImportEqualsDeclaration(statements, node); + return ts2.singleOrMany(statements); + } + function appendExportsOfImportEqualsDeclaration(statements, node) { + if (ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + )) { + statements = ts2.append(statements, factory.createExportDeclaration( + /*modifiers*/ + void 0, + node.isTypeOnly, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + ts2.idText(node.name) + )]) + )); + } + return statements; + } + function visitExportAssignment(node) { + return node.isExportEquals ? void 0 : node; + } + function visitExportDeclaration(node) { + if (compilerOptions.module !== void 0 && compilerOptions.module > ts2.ModuleKind.ES2015) { + return node; + } + if (!node.exportClause || !ts2.isNamespaceExport(node.exportClause) || !node.moduleSpecifier) { + return node; + } + var oldIdentifier = node.exportClause.name; + var synthName = factory.getGeneratedNameForNode(oldIdentifier); + var importDecl = factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamespaceImport(synthName) + ), + node.moduleSpecifier, + node.assertClause + ); + ts2.setOriginalNode(importDecl, node.exportClause); + var exportDecl = ts2.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + synthName, + oldIdentifier + )]) + ); + ts2.setOriginalNode(exportDecl, node); + return [importDecl, exportDecl]; + } + function onEmitNode(hint, node, emitCallback) { + if (ts2.isSourceFile(node)) { + if ((ts2.isExternalModule(node) || compilerOptions.isolatedModules) && compilerOptions.importHelpers) { + helperNameSubstitutions = new ts2.Map(); + } + previousOnEmitNode(hint, node, emitCallback); + helperNameSubstitutions = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (helperNameSubstitutions && ts2.isIdentifier(node) && ts2.getEmitFlags(node) & 4096) { + return substituteHelperName(node); + } + return node; + } + function substituteHelperName(node) { + var name2 = ts2.idText(node); + var substitution = helperNameSubstitutions.get(name2); + if (!substitution) { + helperNameSubstitutions.set(name2, substitution = factory.createUniqueName( + name2, + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + )); + } + return substitution; + } + } + ts2.transformECMAScriptModule = transformECMAScriptModule; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transformNodeModule(context2) { + var previousOnSubstituteNode = context2.onSubstituteNode; + var previousOnEmitNode = context2.onEmitNode; + var esmTransform = ts2.transformECMAScriptModule(context2); + var esmOnSubstituteNode = context2.onSubstituteNode; + var esmOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = previousOnSubstituteNode; + context2.onEmitNode = previousOnEmitNode; + var cjsTransform = ts2.transformModule(context2); + var cjsOnSubstituteNode = context2.onSubstituteNode; + var cjsOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 308 + /* SyntaxKind.SourceFile */ + ); + context2.enableEmitNotification( + 308 + /* SyntaxKind.SourceFile */ + ); + var currentSourceFile; + return transformSourceFileOrBundle; + function onSubstituteNode(hint, node) { + if (ts2.isSourceFile(node)) { + currentSourceFile = node; + return previousOnSubstituteNode(hint, node); + } else { + if (!currentSourceFile) { + return previousOnSubstituteNode(hint, node); + } + if (currentSourceFile.impliedNodeFormat === ts2.ModuleKind.ESNext) { + return esmOnSubstituteNode(hint, node); + } + return cjsOnSubstituteNode(hint, node); + } + } + function onEmitNode(hint, node, emitCallback) { + if (ts2.isSourceFile(node)) { + currentSourceFile = node; + } + if (!currentSourceFile) { + return previousOnEmitNode(hint, node, emitCallback); + } + if (currentSourceFile.impliedNodeFormat === ts2.ModuleKind.ESNext) { + return esmOnEmitNode(hint, node, emitCallback); + } + return cjsOnEmitNode(hint, node, emitCallback); + } + function getModuleTransformForFile(file) { + return file.impliedNodeFormat === ts2.ModuleKind.ESNext ? esmTransform : cjsTransform; + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + var result2 = getModuleTransformForFile(node)(node); + currentSourceFile = void 0; + ts2.Debug.assert(ts2.isSourceFile(result2)); + return result2; + } + function transformSourceFileOrBundle(node) { + return node.kind === 308 ? transformSourceFile(node) : transformBundle(node); + } + function transformBundle(node) { + return context2.factory.createBundle(ts2.map(node.sourceFiles, transformSourceFile), node.prepends); + } + } + ts2.transformNodeModule = transformNodeModule; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function canProduceDiagnostics(node) { + return ts2.isVariableDeclaration(node) || ts2.isPropertyDeclaration(node) || ts2.isPropertySignature(node) || ts2.isBindingElement(node) || ts2.isSetAccessor(node) || ts2.isGetAccessor(node) || ts2.isConstructSignatureDeclaration(node) || ts2.isCallSignatureDeclaration(node) || ts2.isMethodDeclaration(node) || ts2.isMethodSignature(node) || ts2.isFunctionDeclaration(node) || ts2.isParameter(node) || ts2.isTypeParameterDeclaration(node) || ts2.isExpressionWithTypeArguments(node) || ts2.isImportEqualsDeclaration(node) || ts2.isTypeAliasDeclaration(node) || ts2.isConstructorDeclaration(node) || ts2.isIndexSignatureDeclaration(node) || ts2.isPropertyAccessExpression(node) || ts2.isJSDocTypeAlias(node); + } + ts2.canProduceDiagnostics = canProduceDiagnostics; + function createGetSymbolAccessibilityDiagnosticForNodeName(node) { + if (ts2.isSetAccessor(node) || ts2.isGetAccessor(node)) { + return getAccessorNameVisibilityError; + } else if (ts2.isMethodSignature(node) || ts2.isMethodDeclaration(node)) { + return getMethodNameVisibilityError; + } else { + return createGetSymbolAccessibilityDiagnosticForNode(node); + } + function getAccessorNameVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage = getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (ts2.isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 260) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + function getMethodNameVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage = getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (ts2.isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 260) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + } + ts2.createGetSymbolAccessibilityDiagnosticForNodeName = createGetSymbolAccessibilityDiagnosticForNodeName; + function createGetSymbolAccessibilityDiagnosticForNode(node) { + if (ts2.isVariableDeclaration(node) || ts2.isPropertyDeclaration(node) || ts2.isPropertySignature(node) || ts2.isPropertyAccessExpression(node) || ts2.isBindingElement(node) || ts2.isConstructorDeclaration(node)) { + return getVariableDeclarationTypeVisibilityError; + } else if (ts2.isSetAccessor(node) || ts2.isGetAccessor(node)) { + return getAccessorDeclarationTypeVisibilityError; + } else if (ts2.isConstructSignatureDeclaration(node) || ts2.isCallSignatureDeclaration(node) || ts2.isMethodDeclaration(node) || ts2.isMethodSignature(node) || ts2.isFunctionDeclaration(node) || ts2.isIndexSignatureDeclaration(node)) { + return getReturnTypeVisibilityError; + } else if (ts2.isParameter(node)) { + if (ts2.isParameterPropertyDeclaration(node, node.parent) && ts2.hasSyntacticModifier( + node.parent, + 8 + /* ModifierFlags.Private */ + )) { + return getVariableDeclarationTypeVisibilityError; + } + return getParameterDeclarationTypeVisibilityError; + } else if (ts2.isTypeParameterDeclaration(node)) { + return getTypeParameterConstraintVisibilityError; + } else if (ts2.isExpressionWithTypeArguments(node)) { + return getHeritageClauseVisibilityError; + } else if (ts2.isImportEqualsDeclaration(node)) { + return getImportEntityNameVisibilityError; + } else if (ts2.isTypeAliasDeclaration(node) || ts2.isJSDocTypeAlias(node)) { + return getTypeAliasDeclarationVisibilityError; + } else { + return ts2.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts2.Debug.formatSyntaxKind(node.kind))); + } + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (node.kind === 257 || node.kind === 205) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } else if (node.kind === 169 || node.kind === 208 || node.kind === 168 || node.kind === 166 && ts2.hasSyntacticModifier( + node.parent, + 8 + /* ModifierFlags.Private */ + )) { + if (ts2.isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 260 || node.kind === 166) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + } + function getVariableDeclarationTypeVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage; + if (node.kind === 175) { + if (ts2.isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1; + } + } else { + if (ts2.isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1; + } + } + return { + diagnosticMessage, + errorNode: node.name, + typeName: node.name + }; + } + function getReturnTypeVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage; + switch (node.kind) { + case 177: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 176: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 178: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 171: + case 170: + if (ts2.isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts2.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } else if (node.parent.kind === 260) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts2.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + case 259: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts2.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts2.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + default: + return ts2.Debug.fail("This is unknown kind for signature: " + node.kind); + } + return { + diagnosticMessage, + errorNode: node.name || node + }; + } + function getParameterDeclarationTypeVisibilityError(symbolAccessibilityResult) { + var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { + switch (node.parent.kind) { + case 173: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + case 177: + case 182: + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + case 176: + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 178: + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 171: + case 170: + if (ts2.isStatic(node.parent)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.parent.kind === 260) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + case 259: + case 181: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + case 175: + case 174: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts2.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts2.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : ts2.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1; + default: + return ts2.Debug.fail("Unknown parent for parameter: ".concat(ts2.Debug.formatSyntaxKind(node.parent.kind))); + } + } + function getTypeParameterConstraintVisibilityError() { + var diagnosticMessage; + switch (node.parent.kind) { + case 260: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; + break; + case 261: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; + break; + case 197: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; + break; + case 182: + case 177: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 176: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 171: + case 170: + if (ts2.isStatic(node.parent)) { + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.parent.kind === 260) { + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + case 181: + case 259: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + case 262: + diagnosticMessage = ts2.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; + break; + default: + return ts2.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); + } + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + function getHeritageClauseVisibilityError() { + var diagnosticMessage; + if (ts2.isClassDeclaration(node.parent.parent)) { + diagnosticMessage = ts2.isHeritageClause(node.parent) && node.parent.token === 117 ? ts2.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : node.parent.parent.name ? ts2.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts2.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0; + } else { + diagnosticMessage = ts2.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + } + return { + diagnosticMessage, + errorNode: node, + typeName: ts2.getNameOfDeclaration(node.parent.parent) + }; + } + function getImportEntityNameVisibilityError() { + return { + diagnosticMessage: ts2.Diagnostics.Import_declaration_0_is_using_private_name_1, + errorNode: node, + typeName: node.name + }; + } + function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) { + return { + diagnosticMessage: symbolAccessibilityResult.errorModuleName ? ts2.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 : ts2.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, + errorNode: ts2.isJSDocTypeAlias(node) ? ts2.Debug.checkDefined(node.typeExpression) : node.type, + typeName: ts2.isJSDocTypeAlias(node) ? ts2.getNameOfDeclaration(node) : node.name + }; + } + } + ts2.createGetSymbolAccessibilityDiagnosticForNode = createGetSymbolAccessibilityDiagnosticForNode; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getDeclarationDiagnostics(host, resolver, file) { + var compilerOptions = host.getCompilerOptions(); + var result2 = ts2.transformNodes( + resolver, + host, + ts2.factory, + compilerOptions, + file ? [file] : ts2.filter(host.getSourceFiles(), ts2.isSourceFileNotJson), + [transformDeclarations], + /*allowDtsFiles*/ + false + ); + return result2.diagnostics; + } + ts2.getDeclarationDiagnostics = getDeclarationDiagnostics; + function hasInternalAnnotation(range2, currentSourceFile) { + var comment = currentSourceFile.text.substring(range2.pos, range2.end); + return ts2.stringContains(comment, "@internal"); + } + function isInternalDeclaration(node, currentSourceFile) { + var parseTreeNode = ts2.getParseTreeNode(node); + if (parseTreeNode && parseTreeNode.kind === 166) { + var paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); + var previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; + var text = currentSourceFile.text; + var commentRanges = previousSibling ? ts2.concatenate( + // to handle + // ... parameters, /* @internal */ + // public param: string + ts2.getTrailingCommentRanges(text, ts2.skipTrivia( + text, + previousSibling.end + 1, + /* stopAfterLineBreak */ + false, + /* stopAtComments */ + true + )), + ts2.getLeadingCommentRanges(text, node.pos) + ) : ts2.getTrailingCommentRanges(text, ts2.skipTrivia( + text, + node.pos, + /* stopAfterLineBreak */ + false, + /* stopAtComments */ + true + )); + return commentRanges && commentRanges.length && hasInternalAnnotation(ts2.last(commentRanges), currentSourceFile); + } + var leadingCommentRanges = parseTreeNode && ts2.getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile); + return !!ts2.forEach(leadingCommentRanges, function(range2) { + return hasInternalAnnotation(range2, currentSourceFile); + }); + } + ts2.isInternalDeclaration = isInternalDeclaration; + var declarationEmitNodeBuilderFlags = 1024 | 2048 | 4096 | 8 | 524288 | 4 | 1; + function transformDeclarations(context2) { + var throwDiagnostic = function() { + return ts2.Debug.fail("Diagnostic emitted without context"); + }; + var getSymbolAccessibilityDiagnostic = throwDiagnostic; + var needsDeclare = true; + var isBundledEmit = false; + var resultHasExternalModuleIndicator = false; + var needsScopeFixMarker = false; + var resultHasScopeMarker = false; + var enclosingDeclaration; + var necessaryTypeReferences; + var lateMarkedStatements; + var lateStatementReplacementMap; + var suppressNewDiagnosticContexts; + var exportedModulesFromDeclarationEmit; + var factory = context2.factory; + var host = context2.getEmitHost(); + var symbolTracker = { + trackSymbol, + reportInaccessibleThisError, + reportInaccessibleUniqueSymbolError, + reportCyclicStructureError, + reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError, + reportTruncationError, + moduleResolverHost: host, + trackReferencedAmbientModule, + trackExternalModuleSymbolOfImportTypeNode, + reportNonlocalAugmentation, + reportNonSerializableProperty, + reportImportTypeNodeResolutionModeOverride + }; + var errorNameNode; + var errorFallbackNode; + var currentSourceFile; + var refs; + var libs; + var emittedImports; + var resolver = context2.getEmitResolver(); + var options = context2.getCompilerOptions(); + var noResolve = options.noResolve, stripInternal = options.stripInternal; + return transformRoot; + function recordTypeReferenceDirectivesIfNecessary(typeReferenceDirectives) { + if (!typeReferenceDirectives) { + return; + } + necessaryTypeReferences = necessaryTypeReferences || new ts2.Set(); + for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) { + var ref = typeReferenceDirectives_2[_i]; + necessaryTypeReferences.add(ref); + } + } + function trackReferencedAmbientModule(node, symbol) { + var directives = resolver.getTypeReferenceDirectivesForSymbol( + symbol, + 67108863 + /* SymbolFlags.All */ + ); + if (ts2.length(directives)) { + return recordTypeReferenceDirectivesIfNecessary(directives); + } + var container = ts2.getSourceFileOfNode(node); + refs.set(ts2.getOriginalNodeId(container), container); + } + function handleSymbolAccessibilityError(symbolAccessibilityResult) { + if (symbolAccessibilityResult.accessibility === 0) { + if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) { + if (!lateMarkedStatements) { + lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible; + } else { + for (var _i = 0, _a2 = symbolAccessibilityResult.aliasesToMakeVisible; _i < _a2.length; _i++) { + var ref = _a2[_i]; + ts2.pushIfUnique(lateMarkedStatements, ref); + } + } + } + } else { + var errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult); + if (errorInfo) { + if (errorInfo.typeName) { + context2.addDiagnostic(ts2.createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts2.getTextOfNode(errorInfo.typeName), symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); + } else { + context2.addDiagnostic(ts2.createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); + } + return true; + } + } + return false; + } + function trackExternalModuleSymbolOfImportTypeNode(symbol) { + if (!isBundledEmit) { + (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol); + } + } + function trackSymbol(symbol, enclosingDeclaration2, meaning) { + if (symbol.flags & 262144) + return false; + var issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible( + symbol, + enclosingDeclaration2, + meaning, + /*shouldComputeAliasesToMakeVisible*/ + true + )); + recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); + return issuedDiagnostic; + } + function reportPrivateInBaseOfClassExpression(propertyName) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName)); + } + } + function errorDeclarationNameWithFallback() { + return errorNameNode ? ts2.declarationNameToString(errorNameNode) : errorFallbackNode && ts2.getNameOfDeclaration(errorFallbackNode) ? ts2.declarationNameToString(ts2.getNameOfDeclaration(errorFallbackNode)) : errorFallbackNode && ts2.isExportAssignment(errorFallbackNode) ? errorFallbackNode.isExportEquals ? "export=" : "default" : "(Missing)"; + } + function reportInaccessibleUniqueSymbolError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "unique symbol")); + } + } + function reportCyclicStructureError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, errorDeclarationNameWithFallback())); + } + } + function reportInaccessibleThisError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this")); + } + } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier)); + } + } + function reportTruncationError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); + } + } + function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { + var _a2; + var primaryDeclaration = (_a2 = parentSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(function(d7) { + return ts2.getSourceFileOfNode(d7) === containingFile; + }); + var augmentingDeclarations = ts2.filter(symbol.declarations, function(d7) { + return ts2.getSourceFileOfNode(d7) !== containingFile; + }); + if (primaryDeclaration && augmentingDeclarations) { + for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) { + var augmentations = augmentingDeclarations_1[_i]; + context2.addDiagnostic(ts2.addRelatedInfo(ts2.createDiagnosticForNode(augmentations, ts2.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts2.createDiagnosticForNode(primaryDeclaration, ts2.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file))); + } + } + } + function reportNonSerializableProperty(propertyName) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName)); + } + } + function reportImportTypeNodeResolutionModeOverride() { + if (!ts2.isNightly() && (errorNameNode || errorFallbackNode)) { + context2.addDiagnostic(ts2.createDiagnosticForNode(errorNameNode || errorFallbackNode, ts2.Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); + } + } + function transformDeclarationsForJS(sourceFile, bundled) { + var oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = function(s7) { + return s7.errorNode && ts2.canProduceDiagnostics(s7.errorNode) ? ts2.createGetSymbolAccessibilityDiagnosticForNode(s7.errorNode)(s7) : { + diagnosticMessage: s7.errorModuleName ? ts2.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit : ts2.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit, + errorNode: s7.errorNode || sourceFile + }; + }; + var result2 = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, symbolTracker, bundled); + getSymbolAccessibilityDiagnostic = oldDiag; + return result2; + } + function transformRoot(node) { + if (node.kind === 308 && node.isDeclarationFile) { + return node; + } + if (node.kind === 309) { + isBundledEmit = true; + refs = new ts2.Map(); + libs = new ts2.Map(); + var hasNoDefaultLib_1 = false; + var bundle = factory.createBundle(ts2.map(node.sourceFiles, function(sourceFile) { + if (sourceFile.isDeclarationFile) + return void 0; + hasNoDefaultLib_1 = hasNoDefaultLib_1 || sourceFile.hasNoDefaultLib; + currentSourceFile = sourceFile; + enclosingDeclaration = sourceFile; + lateMarkedStatements = void 0; + suppressNewDiagnosticContexts = false; + lateStatementReplacementMap = new ts2.Map(); + getSymbolAccessibilityDiagnostic = throwDiagnostic; + needsScopeFixMarker = false; + resultHasScopeMarker = false; + collectReferences(sourceFile, refs); + collectLibs(sourceFile, libs); + if (ts2.isExternalOrCommonJsModule(sourceFile) || ts2.isJsonSourceFile(sourceFile)) { + resultHasExternalModuleIndicator = false; + needsDeclare = false; + var statements2 = ts2.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS( + sourceFile, + /*bundled*/ + true + )) : ts2.visitNodes(sourceFile.statements, visitDeclarationStatements); + var newFile = factory.updateSourceFile( + sourceFile, + [factory.createModuleDeclaration([factory.createModifier( + 136 + /* SyntaxKind.DeclareKeyword */ + )], factory.createStringLiteral(ts2.getResolvedExternalModuleName(context2.getEmitHost(), sourceFile)), factory.createModuleBlock(ts2.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements2)), sourceFile.statements)))], + /*isDeclarationFile*/ + true, + /*referencedFiles*/ + [], + /*typeReferences*/ + [], + /*hasNoDefaultLib*/ + false, + /*libReferences*/ + [] + ); + return newFile; + } + needsDeclare = true; + var updated2 = ts2.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts2.visitNodes(sourceFile.statements, visitDeclarationStatements); + return factory.updateSourceFile( + sourceFile, + transformAndReplaceLatePaintedStatements(updated2), + /*isDeclarationFile*/ + true, + /*referencedFiles*/ + [], + /*typeReferences*/ + [], + /*hasNoDefaultLib*/ + false, + /*libReferences*/ + [] + ); + }), ts2.mapDefined(node.prepends, function(prepend) { + if (prepend.kind === 311) { + var sourceFile = ts2.createUnparsedSourceFile(prepend, "dts", stripInternal); + hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib; + collectReferences(sourceFile, refs); + recordTypeReferenceDirectivesIfNecessary(ts2.map(sourceFile.typeReferenceDirectives, function(ref) { + return [ref.fileName, ref.resolutionMode]; + })); + collectLibs(sourceFile, libs); + return sourceFile; + } + return prepend; + })); + bundle.syntheticFileReferences = []; + bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences(); + bundle.syntheticLibReferences = getLibReferences(); + bundle.hasNoDefaultLib = hasNoDefaultLib_1; + var outputFilePath_1 = ts2.getDirectoryPath(ts2.normalizeSlashes(ts2.getOutputPathsFor( + node, + host, + /*forceDtsPaths*/ + true + ).declarationFilePath)); + var referenceVisitor_1 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath_1); + refs.forEach(referenceVisitor_1); + return bundle; + } + needsDeclare = true; + needsScopeFixMarker = false; + resultHasScopeMarker = false; + enclosingDeclaration = node; + currentSourceFile = node; + getSymbolAccessibilityDiagnostic = throwDiagnostic; + isBundledEmit = false; + resultHasExternalModuleIndicator = false; + suppressNewDiagnosticContexts = false; + lateMarkedStatements = void 0; + lateStatementReplacementMap = new ts2.Map(); + necessaryTypeReferences = void 0; + refs = collectReferences(currentSourceFile, new ts2.Map()); + libs = collectLibs(currentSourceFile, new ts2.Map()); + var references = []; + var outputFilePath = ts2.getDirectoryPath(ts2.normalizeSlashes(ts2.getOutputPathsFor( + node, + host, + /*forceDtsPaths*/ + true + ).declarationFilePath)); + var referenceVisitor = mapReferencesIntoArray(references, outputFilePath); + var combinedStatements; + if (ts2.isSourceFileJS(currentSourceFile)) { + combinedStatements = factory.createNodeArray(transformDeclarationsForJS(node)); + refs.forEach(referenceVisitor); + emittedImports = ts2.filter(combinedStatements, ts2.isAnyImportSyntax); + } else { + var statements = ts2.visitNodes(node.statements, visitDeclarationStatements); + combinedStatements = ts2.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); + refs.forEach(referenceVisitor); + emittedImports = ts2.filter(combinedStatements, ts2.isAnyImportSyntax); + if (ts2.isExternalModule(node) && (!resultHasExternalModuleIndicator || needsScopeFixMarker && !resultHasScopeMarker)) { + combinedStatements = ts2.setTextRange(factory.createNodeArray(__spreadArray9(__spreadArray9([], combinedStatements, true), [ts2.createEmptyExports(factory)], false)), combinedStatements); + } + } + var updated = factory.updateSourceFile( + node, + combinedStatements, + /*isDeclarationFile*/ + true, + references, + getFileReferencesForUsedTypeReferences(), + node.hasNoDefaultLib, + getLibReferences() + ); + updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit; + return updated; + function getLibReferences() { + return ts2.map(ts2.arrayFrom(libs.keys()), function(lib2) { + return { fileName: lib2, pos: -1, end: -1 }; + }); + } + function getFileReferencesForUsedTypeReferences() { + return necessaryTypeReferences ? ts2.mapDefined(ts2.arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : []; + } + function getFileReferenceForSpecifierModeTuple(_a2) { + var typeName = _a2[0], mode = _a2[1]; + if (emittedImports) { + for (var _i = 0, emittedImports_1 = emittedImports; _i < emittedImports_1.length; _i++) { + var importStatement = emittedImports_1[_i]; + if (ts2.isImportEqualsDeclaration(importStatement) && ts2.isExternalModuleReference(importStatement.moduleReference)) { + var expr = importStatement.moduleReference.expression; + if (ts2.isStringLiteralLike(expr) && expr.text === typeName) { + return void 0; + } + } else if (ts2.isImportDeclaration(importStatement) && ts2.isStringLiteral(importStatement.moduleSpecifier) && importStatement.moduleSpecifier.text === typeName) { + return void 0; + } + } + } + return __assign16({ fileName: typeName, pos: -1, end: -1 }, mode ? { resolutionMode: mode } : void 0); + } + function mapReferencesIntoArray(references2, outputFilePath2) { + return function(file) { + var declFileName; + if (file.isDeclarationFile) { + declFileName = file.fileName; + } else { + if (isBundledEmit && ts2.contains(node.sourceFiles, file)) + return; + var paths = ts2.getOutputPathsFor( + file, + host, + /*forceDtsPaths*/ + true + ); + declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName; + } + if (declFileName) { + var specifier = ts2.moduleSpecifiers.getModuleSpecifier(options, currentSourceFile, ts2.toPath(outputFilePath2, host.getCurrentDirectory(), host.getCanonicalFileName), ts2.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host); + if (!ts2.pathIsRelative(specifier)) { + recordTypeReferenceDirectivesIfNecessary([[ + specifier, + /*mode*/ + void 0 + ]]); + return; + } + var fileName = ts2.getRelativePathToDirectoryOrUrl( + outputFilePath2, + declFileName, + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + if (ts2.startsWith(fileName, "./") && ts2.hasExtension(fileName)) { + fileName = fileName.substring(2); + } + if (ts2.startsWith(fileName, "node_modules/") || ts2.pathContainsNodeModules(fileName)) { + return; + } + references2.push({ pos: -1, end: -1, fileName }); + } + }; + } + } + function collectReferences(sourceFile, ret) { + if (noResolve || !ts2.isUnparsedSource(sourceFile) && ts2.isSourceFileJS(sourceFile)) + return ret; + ts2.forEach(sourceFile.referencedFiles, function(f8) { + var elem = host.getSourceFileFromReference(sourceFile, f8); + if (elem) { + ret.set(ts2.getOriginalNodeId(elem), elem); + } + }); + return ret; + } + function collectLibs(sourceFile, ret) { + ts2.forEach(sourceFile.libReferenceDirectives, function(ref) { + var lib2 = host.getLibFileFromReference(ref); + if (lib2) { + ret.set(ts2.toFileNameLowerCase(ref.fileName), true); + } + }); + return ret; + } + function filterBindingPatternInitializersAndRenamings(name2) { + if (name2.kind === 79) { + return name2; + } else { + if (name2.kind === 204) { + return factory.updateArrayBindingPattern(name2, ts2.visitNodes(name2.elements, visitBindingElement)); + } else { + return factory.updateObjectBindingPattern(name2, ts2.visitNodes(name2.elements, visitBindingElement)); + } + } + function visitBindingElement(elem) { + if (elem.kind === 229) { + return elem; + } + if (elem.propertyName && ts2.isIdentifier(elem.propertyName) && ts2.isIdentifier(elem.name) && !elem.symbol.isReferenced) { + return factory.updateBindingElement( + elem, + elem.dotDotDotToken, + /* propertyName */ + void 0, + elem.propertyName, + shouldPrintWithInitializer(elem) ? elem.initializer : void 0 + ); + } + return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializersAndRenamings(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : void 0); + } + } + function ensureParameter(p7, modifierMask, type3) { + var oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(p7); + } + var newParam = factory.updateParameterDeclaration( + p7, + maskModifiers(p7, modifierMask), + p7.dotDotDotToken, + filterBindingPatternInitializersAndRenamings(p7.name), + resolver.isOptionalParameter(p7) ? p7.questionToken || factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + ensureType( + p7, + type3 || p7.type, + /*ignorePrivate*/ + true + ), + // Ignore private param props, since this type is going straight back into a param + ensureNoInitializer(p7) + ); + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + return newParam; + } + function shouldPrintWithInitializer(node) { + return canHaveLiteralInitializer(node) && resolver.isLiteralConstDeclaration(ts2.getParseTreeNode(node)); + } + function ensureNoInitializer(node) { + if (shouldPrintWithInitializer(node)) { + return resolver.createLiteralConstValue(ts2.getParseTreeNode(node), symbolTracker); + } + return void 0; + } + function ensureType(node, type3, ignorePrivate) { + if (!ignorePrivate && ts2.hasEffectiveModifier( + node, + 8 + /* ModifierFlags.Private */ + )) { + return; + } + if (shouldPrintWithInitializer(node)) { + return; + } + var shouldUseResolverType = node.kind === 166 && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); + if (type3 && !shouldUseResolverType) { + return ts2.visitNode(type3, visitDeclarationSubtree); + } + if (!ts2.getParseTreeNode(node)) { + return type3 ? ts2.visitNode(type3, visitDeclarationSubtree) : factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + if (node.kind === 175) { + return factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + errorNameNode = node.name; + var oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(node); + } + if (node.kind === 257 || node.kind === 205) { + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + } + if (node.kind === 166 || node.kind === 169 || node.kind === 168) { + if (ts2.isPropertySignature(node) || !node.initializer) + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + } + return cleanup(resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + function cleanup(returnValue) { + errorNameNode = void 0; + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + return returnValue || factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + } + function isDeclarationAndNotVisible(node) { + node = ts2.getParseTreeNode(node); + switch (node.kind) { + case 259: + case 264: + case 261: + case 260: + case 262: + case 263: + return !resolver.isDeclarationVisible(node); + case 257: + return !getBindingNameVisible(node); + case 268: + case 269: + case 275: + case 274: + return false; + case 172: + return true; + } + return false; + } + function shouldEmitFunctionProperties(input) { + var _a2; + if (input.body) { + return true; + } + var overloadSignatures = (_a2 = input.symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.filter(function(decl) { + return ts2.isFunctionDeclaration(decl) && !decl.body; + }); + return !overloadSignatures || overloadSignatures.indexOf(input) === overloadSignatures.length - 1; + } + function getBindingNameVisible(elem) { + if (ts2.isOmittedExpression(elem)) { + return false; + } + if (ts2.isBindingPattern(elem.name)) { + return ts2.some(elem.name.elements, getBindingNameVisible); + } else { + return resolver.isDeclarationVisible(elem); + } + } + function updateParamsList(node, params, modifierMask) { + if (ts2.hasEffectiveModifier( + node, + 8 + /* ModifierFlags.Private */ + )) { + return void 0; + } + var newParams = ts2.map(params, function(p7) { + return ensureParameter(p7, modifierMask); + }); + if (!newParams) { + return void 0; + } + return factory.createNodeArray(newParams, params.hasTrailingComma); + } + function updateAccessorParamsList(input, isPrivate) { + var newParams; + if (!isPrivate) { + var thisParameter = ts2.getThisParameter(input); + if (thisParameter) { + newParams = [ensureParameter(thisParameter)]; + } + } + if (ts2.isSetAccessorDeclaration(input)) { + var newValueParameter = void 0; + if (!isPrivate) { + var valueParameter = ts2.getSetAccessorValueParameter(input); + if (valueParameter) { + var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); + newValueParameter = ensureParameter( + valueParameter, + /*modifierMask*/ + void 0, + accessorType + ); + } + } + if (!newValueParameter) { + newValueParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + ); + } + newParams = ts2.append(newParams, newValueParameter); + } + return factory.createNodeArray(newParams || ts2.emptyArray); + } + function ensureTypeParams(node, params) { + return ts2.hasEffectiveModifier( + node, + 8 + /* ModifierFlags.Private */ + ) ? void 0 : ts2.visitNodes(params, visitDeclarationSubtree); + } + function isEnclosingDeclaration(node) { + return ts2.isSourceFile(node) || ts2.isTypeAliasDeclaration(node) || ts2.isModuleDeclaration(node) || ts2.isClassDeclaration(node) || ts2.isInterfaceDeclaration(node) || ts2.isFunctionLike(node) || ts2.isIndexSignatureDeclaration(node) || ts2.isMappedTypeNode(node); + } + function checkEntityNameVisibility(entityName, enclosingDeclaration2) { + var visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2); + handleSymbolAccessibilityError(visibilityResult); + recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); + } + function preserveJsDoc(updated, original) { + if (ts2.hasJSDocNodes(updated) && ts2.hasJSDocNodes(original)) { + updated.jsDoc = original.jsDoc; + } + return ts2.setCommentRange(updated, ts2.getCommentRange(original)); + } + function rewriteModuleSpecifier(parent2, input) { + if (!input) + return void 0; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent2.kind !== 264 && parent2.kind !== 202; + if (ts2.isStringLiteralLike(input)) { + if (isBundledEmit) { + var newName = ts2.getExternalModuleNameFromDeclaration(context2.getEmitHost(), resolver, parent2); + if (newName) { + return factory.createStringLiteral(newName); + } + } else { + var symbol = resolver.getSymbolOfExternalModuleSpecifier(input); + if (symbol) { + (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol); + } + } + } + return input; + } + function transformImportEqualsDeclaration(decl) { + if (!resolver.isDeclarationVisible(decl)) + return; + if (decl.moduleReference.kind === 280) { + var specifier = ts2.getExternalModuleImportEqualsDeclarationExpression(decl); + return factory.updateImportEqualsDeclaration(decl, decl.modifiers, decl.isTypeOnly, decl.name, factory.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier))); + } else { + var oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(decl); + checkEntityNameVisibility(decl.moduleReference, enclosingDeclaration); + getSymbolAccessibilityDiagnostic = oldDiag; + return decl; + } + } + function transformImportDeclaration(decl) { + if (!decl.importClause) { + return factory.updateImportDeclaration(decl, decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)); + } + var visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0; + if (!decl.importClause.namedBindings) { + return visibleDefaultBinding && factory.updateImportDeclaration(decl, decl.modifiers, factory.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + /*namedBindings*/ + void 0 + ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)); + } + if (decl.importClause.namedBindings.kind === 271) { + var namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : ( + /*namedBindings*/ + void 0 + ); + return visibleDefaultBinding || namedBindings ? factory.updateImportDeclaration(decl, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, namedBindings), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)) : void 0; + } + var bindingList = ts2.mapDefined(decl.importClause.namedBindings.elements, function(b8) { + return resolver.isDeclarationVisible(b8) ? b8 : void 0; + }); + if (bindingList && bindingList.length || visibleDefaultBinding) { + return factory.updateImportDeclaration(decl, decl.modifiers, factory.updateImportClause(decl.importClause, decl.importClause.isTypeOnly, visibleDefaultBinding, bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0), rewriteModuleSpecifier(decl, decl.moduleSpecifier), getResolutionModeOverrideForClauseInNightly(decl.assertClause)); + } + if (resolver.isImportRequiredByAugmentation(decl)) { + return factory.updateImportDeclaration( + decl, + decl.modifiers, + /*importClause*/ + void 0, + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + getResolutionModeOverrideForClauseInNightly(decl.assertClause) + ); + } + } + function getResolutionModeOverrideForClauseInNightly(assertClause) { + var mode = ts2.getResolutionModeOverrideForClause(assertClause); + if (mode !== void 0) { + if (!ts2.isNightly()) { + context2.addDiagnostic(ts2.createDiagnosticForNode(assertClause, ts2.Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); + } + return assertClause; + } + return void 0; + } + function transformAndReplaceLatePaintedStatements(statements) { + while (ts2.length(lateMarkedStatements)) { + var i7 = lateMarkedStatements.shift(); + if (!ts2.isLateVisibilityPaintedStatement(i7)) { + return ts2.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(ts2.Debug.formatSyntaxKind(i7.kind))); + } + var priorNeedsDeclare = needsDeclare; + needsDeclare = i7.parent && ts2.isSourceFile(i7.parent) && !(ts2.isExternalModule(i7.parent) && isBundledEmit); + var result2 = transformTopLevelDeclaration(i7); + needsDeclare = priorNeedsDeclare; + lateStatementReplacementMap.set(ts2.getOriginalNodeId(i7), result2); + } + return ts2.visitNodes(statements, visitLateVisibilityMarkedStatements); + function visitLateVisibilityMarkedStatements(statement) { + if (ts2.isLateVisibilityPaintedStatement(statement)) { + var key = ts2.getOriginalNodeId(statement); + if (lateStatementReplacementMap.has(key)) { + var result3 = lateStatementReplacementMap.get(key); + lateStatementReplacementMap.delete(key); + if (result3) { + if (ts2.isArray(result3) ? ts2.some(result3, ts2.needsScopeMarker) : ts2.needsScopeMarker(result3)) { + needsScopeFixMarker = true; + } + if (ts2.isSourceFile(statement.parent) && (ts2.isArray(result3) ? ts2.some(result3, ts2.isExternalModuleIndicator) : ts2.isExternalModuleIndicator(result3))) { + resultHasExternalModuleIndicator = true; + } + } + return result3; + } + } + return statement; + } + } + function visitDeclarationSubtree(input) { + if (shouldStripInternal(input)) + return; + if (ts2.isDeclaration(input)) { + if (isDeclarationAndNotVisible(input)) + return; + if (ts2.hasDynamicName(input) && !resolver.isLateBound(ts2.getParseTreeNode(input))) { + return; + } + } + if (ts2.isFunctionLike(input) && resolver.isImplementationOfOverload(input)) + return; + if (ts2.isSemicolonClassElement(input)) + return; + var previousEnclosingDeclaration; + if (isEnclosingDeclaration(input)) { + previousEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = input; + } + var oldDiag = getSymbolAccessibilityDiagnostic; + var canProduceDiagnostic = ts2.canProduceDiagnostics(input); + var oldWithinObjectLiteralType = suppressNewDiagnosticContexts; + var shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 184 || input.kind === 197) && input.parent.kind !== 262; + if (ts2.isMethodDeclaration(input) || ts2.isMethodSignature(input)) { + if (ts2.hasEffectiveModifier( + input, + 8 + /* ModifierFlags.Private */ + )) { + if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) + return; + return cleanup(factory.createPropertyDeclaration( + ensureModifiers(input), + input.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )); + } + } + if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(input); + } + if (ts2.isTypeQueryNode(input)) { + checkEntityNameVisibility(input.exprName, enclosingDeclaration); + } + if (shouldEnterSuppressNewDiagnosticsContextContext) { + suppressNewDiagnosticContexts = true; + } + if (isProcessedComponent(input)) { + switch (input.kind) { + case 230: { + if (ts2.isEntityName(input.expression) || ts2.isEntityNameExpression(input.expression)) { + checkEntityNameVisibility(input.expression, enclosingDeclaration); + } + var node = ts2.visitEachChild(input, visitDeclarationSubtree, context2); + return cleanup(factory.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); + } + case 180: { + checkEntityNameVisibility(input.typeName, enclosingDeclaration); + var node = ts2.visitEachChild(input, visitDeclarationSubtree, context2); + return cleanup(factory.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); + } + case 177: + return cleanup(factory.updateConstructSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); + case 173: { + var ctor = factory.createConstructorDeclaration( + /*modifiers*/ + ensureModifiers(input), + updateParamsList( + input, + input.parameters, + 0 + /* ModifierFlags.None */ + ), + /*body*/ + void 0 + ); + return cleanup(ctor); + } + case 171: { + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + var sig = factory.createMethodDeclaration( + ensureModifiers(input), + /*asteriskToken*/ + void 0, + input.name, + input.questionToken, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type), + /*body*/ + void 0 + ); + return cleanup(sig); + } + case 174: { + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + var accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); + return cleanup(factory.updateGetAccessorDeclaration( + input, + ensureModifiers(input), + input.name, + updateAccessorParamsList(input, ts2.hasEffectiveModifier( + input, + 8 + /* ModifierFlags.Private */ + )), + ensureType(input, accessorType), + /*body*/ + void 0 + )); + } + case 175: { + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory.updateSetAccessorDeclaration( + input, + ensureModifiers(input), + input.name, + updateAccessorParamsList(input, ts2.hasEffectiveModifier( + input, + 8 + /* ModifierFlags.Private */ + )), + /*body*/ + void 0 + )); + } + case 169: + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory.updatePropertyDeclaration(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type), ensureNoInitializer(input))); + case 168: + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory.updatePropertySignature(input, ensureModifiers(input), input.name, input.questionToken, ensureType(input, input.type))); + case 170: { + if (ts2.isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory.updateMethodSignature(input, ensureModifiers(input), input.name, input.questionToken, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); + } + case 176: { + return cleanup(factory.updateCallSignature(input, ensureTypeParams(input, input.typeParameters), updateParamsList(input, input.parameters), ensureType(input, input.type))); + } + case 178: { + return cleanup(factory.updateIndexSignature(input, ensureModifiers(input), updateParamsList(input, input.parameters), ts2.visitNode(input.type, visitDeclarationSubtree) || factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ))); + } + case 257: { + if (ts2.isBindingPattern(input.name)) { + return recreateBindingPattern(input.name); + } + shouldEnterSuppressNewDiagnosticsContextContext = true; + suppressNewDiagnosticContexts = true; + return cleanup(factory.updateVariableDeclaration( + input, + input.name, + /*exclamationToken*/ + void 0, + ensureType(input, input.type), + ensureNoInitializer(input) + )); + } + case 165: { + if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { + return cleanup(factory.updateTypeParameterDeclaration( + input, + input.modifiers, + input.name, + /*constraint*/ + void 0, + /*defaultType*/ + void 0 + )); + } + return cleanup(ts2.visitEachChild(input, visitDeclarationSubtree, context2)); + } + case 191: { + var checkType = ts2.visitNode(input.checkType, visitDeclarationSubtree); + var extendsType = ts2.visitNode(input.extendsType, visitDeclarationSubtree); + var oldEnclosingDecl = enclosingDeclaration; + enclosingDeclaration = input.trueType; + var trueType = ts2.visitNode(input.trueType, visitDeclarationSubtree); + enclosingDeclaration = oldEnclosingDecl; + var falseType = ts2.visitNode(input.falseType, visitDeclarationSubtree); + return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); + } + case 181: { + return cleanup(factory.updateFunctionTypeNode(input, ts2.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts2.visitNode(input.type, visitDeclarationSubtree))); + } + case 182: { + return cleanup(factory.updateConstructorTypeNode(input, ensureModifiers(input), ts2.visitNodes(input.typeParameters, visitDeclarationSubtree), updateParamsList(input, input.parameters), ts2.visitNode(input.type, visitDeclarationSubtree))); + } + case 202: { + if (!ts2.isLiteralImportTypeNode(input)) + return cleanup(input); + return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.assertions, input.qualifier, ts2.visitNodes(input.typeArguments, visitDeclarationSubtree, ts2.isTypeNode), input.isTypeOf)); + } + default: + ts2.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts2.Debug.formatSyntaxKind(input.kind))); + } + } + if (ts2.isTupleTypeNode(input) && ts2.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts2.getLineAndCharacterOfPosition(currentSourceFile, input.end).line) { + ts2.setEmitFlags( + input, + 1 + /* EmitFlags.SingleLine */ + ); + } + return cleanup(ts2.visitEachChild(input, visitDeclarationSubtree, context2)); + function cleanup(returnValue) { + if (returnValue && canProduceDiagnostic && ts2.hasDynamicName(input)) { + checkName(input); + } + if (isEnclosingDeclaration(input)) { + enclosingDeclaration = previousEnclosingDeclaration; + } + if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + if (shouldEnterSuppressNewDiagnosticsContextContext) { + suppressNewDiagnosticContexts = oldWithinObjectLiteralType; + } + if (returnValue === input) { + return returnValue; + } + return returnValue && ts2.setOriginalNode(preserveJsDoc(returnValue, input), input); + } + } + function isPrivateMethodTypeParameter(node) { + return node.parent.kind === 171 && ts2.hasEffectiveModifier( + node.parent, + 8 + /* ModifierFlags.Private */ + ); + } + function visitDeclarationStatements(input) { + if (!isPreservedDeclarationStatement(input)) { + return; + } + if (shouldStripInternal(input)) + return; + switch (input.kind) { + case 275: { + if (ts2.isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + return factory.updateExportDeclaration(input, input.modifiers, input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), ts2.getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0); + } + case 274: { + if (ts2.isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + if (input.expression.kind === 79) { + return input; + } else { + var newId = factory.createUniqueName( + "_default", + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + getSymbolAccessibilityDiagnostic = function() { + return { + diagnosticMessage: ts2.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: input + }; + }; + errorFallbackNode = input; + var varDecl = factory.createVariableDeclaration( + newId, + /*exclamationToken*/ + void 0, + resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), + /*initializer*/ + void 0 + ); + errorFallbackNode = void 0; + var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier( + 136 + /* SyntaxKind.DeclareKeyword */ + )] : [], factory.createVariableDeclarationList( + [varDecl], + 2 + /* NodeFlags.Const */ + )); + preserveJsDoc(statement, input); + ts2.removeAllComments(input); + return [statement, factory.updateExportAssignment(input, input.modifiers, newId)]; + } + } + } + var result2 = transformTopLevelDeclaration(input); + lateStatementReplacementMap.set(ts2.getOriginalNodeId(input), result2); + return input; + } + function stripExportModifiers(statement) { + if (ts2.isImportEqualsDeclaration(statement) || ts2.hasEffectiveModifier( + statement, + 1024 + /* ModifierFlags.Default */ + ) || !ts2.canHaveModifiers(statement)) { + return statement; + } + var modifiers = factory.createModifiersFromModifierFlags(ts2.getEffectiveModifierFlags(statement) & (258047 ^ 1)); + return factory.updateModifiers(statement, modifiers); + } + function transformTopLevelDeclaration(input) { + if (lateMarkedStatements) { + while (ts2.orderedRemoveItem(lateMarkedStatements, input)) + ; + } + if (shouldStripInternal(input)) + return; + switch (input.kind) { + case 268: { + return transformImportEqualsDeclaration(input); + } + case 269: { + return transformImportDeclaration(input); + } + } + if (ts2.isDeclaration(input) && isDeclarationAndNotVisible(input)) + return; + if (ts2.isFunctionLike(input) && resolver.isImplementationOfOverload(input)) + return; + var previousEnclosingDeclaration; + if (isEnclosingDeclaration(input)) { + previousEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = input; + } + var canProdiceDiagnostic = ts2.canProduceDiagnostics(input); + var oldDiag = getSymbolAccessibilityDiagnostic; + if (canProdiceDiagnostic) { + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(input); + } + var previousNeedsDeclare = needsDeclare; + switch (input.kind) { + case 262: { + needsDeclare = false; + var clean = cleanup(factory.updateTypeAliasDeclaration(input, ensureModifiers(input), input.name, ts2.visitNodes(input.typeParameters, visitDeclarationSubtree, ts2.isTypeParameterDeclaration), ts2.visitNode(input.type, visitDeclarationSubtree, ts2.isTypeNode))); + needsDeclare = previousNeedsDeclare; + return clean; + } + case 261: { + return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts2.visitNodes(input.members, visitDeclarationSubtree))); + } + case 259: { + var clean = cleanup(factory.updateFunctionDeclaration( + input, + ensureModifiers(input), + /*asteriskToken*/ + void 0, + input.name, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type), + /*body*/ + void 0 + )); + if (clean && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) { + var props = resolver.getPropertiesOfContainerFunction(input); + var fakespace_1 = ts2.parseNodeFactory.createModuleDeclaration( + /*modifiers*/ + void 0, + clean.name || factory.createIdentifier("_default"), + factory.createModuleBlock([]), + 16 + /* NodeFlags.Namespace */ + ); + ts2.setParent(fakespace_1, enclosingDeclaration); + fakespace_1.locals = ts2.createSymbolTable(props); + fakespace_1.symbol = props[0].parent; + var exportMappings_1 = []; + var declarations = ts2.mapDefined(props, function(p7) { + if (!p7.valueDeclaration || !ts2.isPropertyAccessExpression(p7.valueDeclaration)) { + return void 0; + } + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(p7.valueDeclaration); + var type3 = resolver.createTypeOfDeclaration(p7.valueDeclaration, fakespace_1, declarationEmitNodeBuilderFlags, symbolTracker); + getSymbolAccessibilityDiagnostic = oldDiag; + var nameStr = ts2.unescapeLeadingUnderscores(p7.escapedName); + var isNonContextualKeywordName = ts2.isStringANonContextualKeyword(nameStr); + var name2 = isNonContextualKeywordName ? factory.getGeneratedNameForNode(p7.valueDeclaration) : factory.createIdentifier(nameStr); + if (isNonContextualKeywordName) { + exportMappings_1.push([name2, nameStr]); + } + var varDecl2 = factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + type3, + /*initializer*/ + void 0 + ); + return factory.createVariableStatement(isNonContextualKeywordName ? void 0 : [factory.createToken( + 93 + /* SyntaxKind.ExportKeyword */ + )], factory.createVariableDeclarationList([varDecl2])); + }); + if (!exportMappings_1.length) { + declarations = ts2.mapDefined(declarations, function(declaration) { + return factory.updateModifiers( + declaration, + 0 + /* ModifierFlags.None */ + ); + }); + } else { + declarations.push(factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(ts2.map(exportMappings_1, function(_a2) { + var gen = _a2[0], exp = _a2[1]; + return factory.createExportSpecifier( + /*isTypeOnly*/ + false, + gen, + exp + ); + })) + )); + } + var namespaceDecl = factory.createModuleDeclaration( + ensureModifiers(input), + input.name, + factory.createModuleBlock(declarations), + 16 + /* NodeFlags.Namespace */ + ); + if (!ts2.hasEffectiveModifier( + clean, + 1024 + /* ModifierFlags.Default */ + )) { + return [clean, namespaceDecl]; + } + var modifiers = factory.createModifiersFromModifierFlags( + ts2.getEffectiveModifierFlags(clean) & ~1025 | 2 + /* ModifierFlags.Ambient */ + ); + var cleanDeclaration = factory.updateFunctionDeclaration( + clean, + modifiers, + /*asteriskToken*/ + void 0, + clean.name, + clean.typeParameters, + clean.parameters, + clean.type, + /*body*/ + void 0 + ); + var namespaceDeclaration = factory.updateModuleDeclaration(namespaceDecl, modifiers, namespaceDecl.name, namespaceDecl.body); + var exportDefaultDeclaration = factory.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + namespaceDecl.name + ); + if (ts2.isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + return [cleanDeclaration, namespaceDeclaration, exportDefaultDeclaration]; + } else { + return clean; + } + } + case 264: { + needsDeclare = false; + var inner = input.body; + if (inner && inner.kind === 265) { + var oldNeedsScopeFix = needsScopeFixMarker; + var oldHasScopeFix = resultHasScopeMarker; + resultHasScopeMarker = false; + needsScopeFixMarker = false; + var statements = ts2.visitNodes(inner.statements, visitDeclarationStatements); + var lateStatements = transformAndReplaceLatePaintedStatements(statements); + if (input.flags & 16777216) { + needsScopeFixMarker = false; + } + if (!ts2.isGlobalScopeAugmentation(input) && !hasScopeMarker(lateStatements) && !resultHasScopeMarker) { + if (needsScopeFixMarker) { + lateStatements = factory.createNodeArray(__spreadArray9(__spreadArray9([], lateStatements, true), [ts2.createEmptyExports(factory)], false)); + } else { + lateStatements = ts2.visitNodes(lateStatements, stripExportModifiers); + } + } + var body = factory.updateModuleBlock(inner, lateStatements); + needsDeclare = previousNeedsDeclare; + needsScopeFixMarker = oldNeedsScopeFix; + resultHasScopeMarker = oldHasScopeFix; + var mods = ensureModifiers(input); + return cleanup(factory.updateModuleDeclaration(input, mods, ts2.isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name, body)); + } else { + needsDeclare = previousNeedsDeclare; + var mods = ensureModifiers(input); + needsDeclare = false; + ts2.visitNode(inner, visitDeclarationStatements); + var id = ts2.getOriginalNodeId(inner); + var body = lateStatementReplacementMap.get(id); + lateStatementReplacementMap.delete(id); + return cleanup(factory.updateModuleDeclaration(input, mods, input.name, body)); + } + } + case 260: { + errorNameNode = input.name; + errorFallbackNode = input; + var modifiers = factory.createNodeArray(ensureModifiers(input)); + var typeParameters = ensureTypeParams(input, input.typeParameters); + var ctor = ts2.getFirstConstructorWithBody(input); + var parameterProperties = void 0; + if (ctor) { + var oldDiag_1 = getSymbolAccessibilityDiagnostic; + parameterProperties = ts2.compact(ts2.flatMap(ctor.parameters, function(param) { + if (!ts2.hasSyntacticModifier( + param, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ) || shouldStripInternal(param)) + return; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(param); + if (param.name.kind === 79) { + return preserveJsDoc(factory.createPropertyDeclaration(ensureModifiers(param), param.name, param.questionToken, ensureType(param, param.type), ensureNoInitializer(param)), param); + } else { + return walkBindingPattern(param.name); + } + function walkBindingPattern(pattern5) { + var elems; + for (var _i = 0, _a2 = pattern5.elements; _i < _a2.length; _i++) { + var elem = _a2[_i]; + if (ts2.isOmittedExpression(elem)) + continue; + if (ts2.isBindingPattern(elem.name)) { + elems = ts2.concatenate(elems, walkBindingPattern(elem.name)); + } + elems = elems || []; + elems.push(factory.createPropertyDeclaration( + ensureModifiers(param), + elem.name, + /*questionToken*/ + void 0, + ensureType( + elem, + /*type*/ + void 0 + ), + /*initializer*/ + void 0 + )); + } + return elems; + } + })); + getSymbolAccessibilityDiagnostic = oldDiag_1; + } + var hasPrivateIdentifier = ts2.some(input.members, function(member) { + return !!member.name && ts2.isPrivateIdentifier(member.name); + }); + var privateIdentifier = hasPrivateIdentifier ? [ + factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + factory.createPrivateIdentifier("#private"), + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ) + ] : void 0; + var memberNodes = ts2.concatenate(ts2.concatenate(privateIdentifier, parameterProperties), ts2.visitNodes(input.members, visitDeclarationSubtree)); + var members = factory.createNodeArray(memberNodes); + var extendsClause_1 = ts2.getEffectiveBaseTypeNode(input); + if (extendsClause_1 && !ts2.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104) { + var oldId = input.name ? ts2.unescapeLeadingUnderscores(input.name.escapedText) : "default"; + var newId_1 = factory.createUniqueName( + "".concat(oldId, "_base"), + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + getSymbolAccessibilityDiagnostic = function() { + return { + diagnosticMessage: ts2.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, + errorNode: extendsClause_1, + typeName: input.name + }; + }; + var varDecl = factory.createVariableDeclaration( + newId_1, + /*exclamationToken*/ + void 0, + resolver.createTypeOfExpression(extendsClause_1.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), + /*initializer*/ + void 0 + ); + var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier( + 136 + /* SyntaxKind.DeclareKeyword */ + )] : [], factory.createVariableDeclarationList( + [varDecl], + 2 + /* NodeFlags.Const */ + )); + var heritageClauses = factory.createNodeArray(ts2.map(input.heritageClauses, function(clause) { + if (clause.token === 94) { + var oldDiag_2 = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); + var newClause = factory.updateHeritageClause(clause, ts2.map(clause.types, function(t8) { + return factory.updateExpressionWithTypeArguments(t8, newId_1, ts2.visitNodes(t8.typeArguments, visitDeclarationSubtree)); + })); + getSymbolAccessibilityDiagnostic = oldDiag_2; + return newClause; + } + return factory.updateHeritageClause(clause, ts2.visitNodes(factory.createNodeArray(ts2.filter(clause.types, function(t8) { + return ts2.isEntityNameExpression(t8.expression) || t8.expression.kind === 104; + })), visitDeclarationSubtree)); + })); + return [statement, cleanup(factory.updateClassDeclaration(input, modifiers, input.name, typeParameters, heritageClauses, members))]; + } else { + var heritageClauses = transformHeritageClauses(input.heritageClauses); + return cleanup(factory.updateClassDeclaration(input, modifiers, input.name, typeParameters, heritageClauses, members)); + } + } + case 240: { + return cleanup(transformVariableStatement(input)); + } + case 263: { + return cleanup(factory.updateEnumDeclaration(input, factory.createNodeArray(ensureModifiers(input)), input.name, factory.createNodeArray(ts2.mapDefined(input.members, function(m7) { + if (shouldStripInternal(m7)) + return; + var constValue = resolver.getConstantValue(m7); + return preserveJsDoc(factory.updateEnumMember(m7, m7.name, constValue !== void 0 ? typeof constValue === "string" ? factory.createStringLiteral(constValue) : factory.createNumericLiteral(constValue) : void 0), m7); + })))); + } + } + return ts2.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts2.Debug.formatSyntaxKind(input.kind))); + function cleanup(node) { + if (isEnclosingDeclaration(input)) { + enclosingDeclaration = previousEnclosingDeclaration; + } + if (canProdiceDiagnostic) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + if (input.kind === 264) { + needsDeclare = previousNeedsDeclare; + } + if (node === input) { + return node; + } + errorFallbackNode = void 0; + errorNameNode = void 0; + return node && ts2.setOriginalNode(preserveJsDoc(node, input), input); + } + } + function transformVariableStatement(input) { + if (!ts2.forEach(input.declarationList.declarations, getBindingNameVisible)) + return; + var nodes = ts2.visitNodes(input.declarationList.declarations, visitDeclarationSubtree); + if (!ts2.length(nodes)) + return; + return factory.updateVariableStatement(input, factory.createNodeArray(ensureModifiers(input)), factory.updateVariableDeclarationList(input.declarationList, nodes)); + } + function recreateBindingPattern(d7) { + return ts2.flatten(ts2.mapDefined(d7.elements, function(e10) { + return recreateBindingElement(e10); + })); + } + function recreateBindingElement(e10) { + if (e10.kind === 229) { + return; + } + if (e10.name) { + if (!getBindingNameVisible(e10)) + return; + if (ts2.isBindingPattern(e10.name)) { + return recreateBindingPattern(e10.name); + } else { + return factory.createVariableDeclaration( + e10.name, + /*exclamationToken*/ + void 0, + ensureType( + e10, + /*type*/ + void 0 + ), + /*initializer*/ + void 0 + ); + } + } + } + function checkName(node) { + var oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNodeName(node); + } + errorNameNode = node.name; + ts2.Debug.assert(resolver.isLateBound(ts2.getParseTreeNode(node))); + var decl = node; + var entityName = decl.name.expression; + checkEntityNameVisibility(entityName, enclosingDeclaration); + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + errorNameNode = void 0; + } + function shouldStripInternal(node) { + return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile); + } + function isScopeMarker(node) { + return ts2.isExportAssignment(node) || ts2.isExportDeclaration(node); + } + function hasScopeMarker(statements) { + return ts2.some(statements, isScopeMarker); + } + function ensureModifiers(node) { + var currentFlags = ts2.getEffectiveModifierFlags(node); + var newFlags = ensureModifierFlags(node); + if (currentFlags === newFlags) { + return ts2.visitArray(node.modifiers, function(n7) { + return ts2.tryCast(n7, ts2.isModifier); + }, ts2.isModifier); + } + return factory.createModifiersFromModifierFlags(newFlags); + } + function ensureModifierFlags(node) { + var mask = 258047 ^ (4 | 512 | 16384); + var additions = needsDeclare && !isAlwaysType(node) ? 2 : 0; + var parentIsFile = node.parent.kind === 308; + if (!parentIsFile || isBundledEmit && parentIsFile && ts2.isExternalModule(node.parent)) { + mask ^= 2; + additions = 0; + } + return maskModifierFlags(node, mask, additions); + } + function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) { + var accessorType = getTypeAnnotationFromAccessor(node); + if (!accessorType && node !== accessors.firstAccessor) { + accessorType = getTypeAnnotationFromAccessor(accessors.firstAccessor); + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(accessors.firstAccessor); + } + if (!accessorType && accessors.secondAccessor && node !== accessors.secondAccessor) { + accessorType = getTypeAnnotationFromAccessor(accessors.secondAccessor); + getSymbolAccessibilityDiagnostic = ts2.createGetSymbolAccessibilityDiagnosticForNode(accessors.secondAccessor); + } + return accessorType; + } + function transformHeritageClauses(nodes) { + return factory.createNodeArray(ts2.filter(ts2.map(nodes, function(clause) { + return factory.updateHeritageClause(clause, ts2.visitNodes(factory.createNodeArray(ts2.filter(clause.types, function(t8) { + return ts2.isEntityNameExpression(t8.expression) || clause.token === 94 && t8.expression.kind === 104; + })), visitDeclarationSubtree)); + }), function(clause) { + return clause.types && !!clause.types.length; + })); + } + } + ts2.transformDeclarations = transformDeclarations; + function isAlwaysType(node) { + if (node.kind === 261) { + return true; + } + return false; + } + function maskModifiers(node, modifierMask, modifierAdditions) { + return ts2.factory.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions)); + } + function maskModifierFlags(node, modifierMask, modifierAdditions) { + if (modifierMask === void 0) { + modifierMask = 258047 ^ 4; + } + if (modifierAdditions === void 0) { + modifierAdditions = 0; + } + var flags = ts2.getEffectiveModifierFlags(node) & modifierMask | modifierAdditions; + if (flags & 1024 && !(flags & 1)) { + flags ^= 1; + } + if (flags & 1024 && flags & 2) { + flags ^= 2; + } + return flags; + } + function getTypeAnnotationFromAccessor(accessor) { + if (accessor) { + return accessor.kind === 174 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0; + } + } + function canHaveLiteralInitializer(node) { + switch (node.kind) { + case 169: + case 168: + return !ts2.hasEffectiveModifier( + node, + 8 + /* ModifierFlags.Private */ + ); + case 166: + case 257: + return true; + } + return false; + } + function isPreservedDeclarationStatement(node) { + switch (node.kind) { + case 259: + case 264: + case 268: + case 261: + case 260: + case 262: + case 263: + case 240: + case 269: + case 275: + case 274: + return true; + } + return false; + } + function isProcessedComponent(node) { + switch (node.kind) { + case 177: + case 173: + case 171: + case 174: + case 175: + case 169: + case 168: + case 170: + case 176: + case 178: + case 257: + case 165: + case 230: + case 180: + case 191: + case 181: + case 182: + case 202: + return true; + } + return false; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case ts2.ModuleKind.ESNext: + case ts2.ModuleKind.ES2022: + case ts2.ModuleKind.ES2020: + case ts2.ModuleKind.ES2015: + return ts2.transformECMAScriptModule; + case ts2.ModuleKind.System: + return ts2.transformSystemModule; + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + return ts2.transformNodeModule; + default: + return ts2.transformModule; + } + } + var TransformationState; + (function(TransformationState2) { + TransformationState2[TransformationState2["Uninitialized"] = 0] = "Uninitialized"; + TransformationState2[TransformationState2["Initialized"] = 1] = "Initialized"; + TransformationState2[TransformationState2["Completed"] = 2] = "Completed"; + TransformationState2[TransformationState2["Disposed"] = 3] = "Disposed"; + })(TransformationState || (TransformationState = {})); + var SyntaxKindFeatureFlags; + (function(SyntaxKindFeatureFlags2) { + SyntaxKindFeatureFlags2[SyntaxKindFeatureFlags2["Substitution"] = 1] = "Substitution"; + SyntaxKindFeatureFlags2[SyntaxKindFeatureFlags2["EmitNotifications"] = 2] = "EmitNotifications"; + })(SyntaxKindFeatureFlags || (SyntaxKindFeatureFlags = {})); + ts2.noTransformers = { scriptTransformers: ts2.emptyArray, declarationTransformers: ts2.emptyArray }; + function getTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { + return { + scriptTransformers: getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles), + declarationTransformers: getDeclarationTransformers(customTransformers) + }; + } + ts2.getTransformers = getTransformers; + function getScriptTransformers(compilerOptions, customTransformers, emitOnlyDtsFiles) { + if (emitOnlyDtsFiles) + return ts2.emptyArray; + var languageVersion = ts2.getEmitScriptTarget(compilerOptions); + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var transformers = []; + ts2.addRange(transformers, customTransformers && ts2.map(customTransformers.before, wrapScriptTransformerFactory)); + transformers.push(ts2.transformTypeScript); + transformers.push(ts2.transformLegacyDecorators); + transformers.push(ts2.transformClassFields); + if (ts2.getJSXTransformEnabled(compilerOptions)) { + transformers.push(ts2.transformJsx); + } + if (languageVersion < 99) { + transformers.push(ts2.transformESNext); + } + if (languageVersion < 8) { + transformers.push(ts2.transformES2021); + } + if (languageVersion < 7) { + transformers.push(ts2.transformES2020); + } + if (languageVersion < 6) { + transformers.push(ts2.transformES2019); + } + if (languageVersion < 5) { + transformers.push(ts2.transformES2018); + } + if (languageVersion < 4) { + transformers.push(ts2.transformES2017); + } + if (languageVersion < 3) { + transformers.push(ts2.transformES2016); + } + if (languageVersion < 2) { + transformers.push(ts2.transformES2015); + transformers.push(ts2.transformGenerators); + } + transformers.push(getModuleTransformer(moduleKind)); + if (languageVersion < 1) { + transformers.push(ts2.transformES5); + } + ts2.addRange(transformers, customTransformers && ts2.map(customTransformers.after, wrapScriptTransformerFactory)); + return transformers; + } + function getDeclarationTransformers(customTransformers) { + var transformers = []; + transformers.push(ts2.transformDeclarations); + ts2.addRange(transformers, customTransformers && ts2.map(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory)); + return transformers; + } + function wrapCustomTransformer(transformer) { + return function(node) { + return ts2.isBundle(node) ? transformer.transformBundle(node) : transformer.transformSourceFile(node); + }; + } + function wrapCustomTransformerFactory(transformer, handleDefault) { + return function(context2) { + var customTransformer = transformer(context2); + return typeof customTransformer === "function" ? handleDefault(context2, customTransformer) : wrapCustomTransformer(customTransformer); + }; + } + function wrapScriptTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, ts2.chainBundle); + } + function wrapDeclarationTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, function(_6, node) { + return node; + }); + } + function noEmitSubstitution(_hint, node) { + return node; + } + ts2.noEmitSubstitution = noEmitSubstitution; + function noEmitNotification(hint, node, callback) { + callback(hint, node); + } + ts2.noEmitNotification = noEmitNotification; + function transformNodes(resolver, host, factory, options, nodes, transformers, allowDtsFiles) { + var enabledSyntaxKindFeatures = new Array( + 358 + /* SyntaxKind.Count */ + ); + var lexicalEnvironmentVariableDeclarations; + var lexicalEnvironmentFunctionDeclarations; + var lexicalEnvironmentStatements; + var lexicalEnvironmentFlags = 0; + var lexicalEnvironmentVariableDeclarationsStack = []; + var lexicalEnvironmentFunctionDeclarationsStack = []; + var lexicalEnvironmentStatementsStack = []; + var lexicalEnvironmentFlagsStack = []; + var lexicalEnvironmentStackOffset = 0; + var lexicalEnvironmentSuspended = false; + var blockScopedVariableDeclarationsStack = []; + var blockScopeStackOffset = 0; + var blockScopedVariableDeclarations; + var emitHelpers; + var onSubstituteNode = noEmitSubstitution; + var onEmitNode = noEmitNotification; + var state = 0; + var diagnostics = []; + var context2 = { + factory, + getCompilerOptions: function() { + return options; + }, + getEmitResolver: function() { + return resolver; + }, + getEmitHost: function() { + return host; + }, + getEmitHelperFactory: ts2.memoize(function() { + return ts2.createEmitHelperFactory(context2); + }), + startLexicalEnvironment, + suspendLexicalEnvironment, + resumeLexicalEnvironment, + endLexicalEnvironment, + setLexicalEnvironmentFlags, + getLexicalEnvironmentFlags, + hoistVariableDeclaration, + hoistFunctionDeclaration, + addInitializationStatement, + startBlockScope, + endBlockScope, + addBlockScopedVariable, + requestEmitHelper, + readEmitHelpers, + enableSubstitution, + enableEmitNotification, + isSubstitutionEnabled, + isEmitNotificationEnabled, + get onSubstituteNode() { + return onSubstituteNode; + }, + set onSubstituteNode(value2) { + ts2.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts2.Debug.assert(value2 !== void 0, "Value must not be 'undefined'"); + onSubstituteNode = value2; + }, + get onEmitNode() { + return onEmitNode; + }, + set onEmitNode(value2) { + ts2.Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + ts2.Debug.assert(value2 !== void 0, "Value must not be 'undefined'"); + onEmitNode = value2; + }, + addDiagnostic: function(diag) { + diagnostics.push(diag); + } + }; + for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) { + var node = nodes_2[_i]; + ts2.disposeEmitNodes(ts2.getSourceFileOfNode(ts2.getParseTreeNode(node))); + } + ts2.performance.mark("beforeTransform"); + var transformersWithContext = transformers.map(function(t8) { + return t8(context2); + }); + var transformation = function(node2) { + for (var _i2 = 0, transformersWithContext_1 = transformersWithContext; _i2 < transformersWithContext_1.length; _i2++) { + var transform2 = transformersWithContext_1[_i2]; + node2 = transform2(node2); + } + return node2; + }; + state = 1; + var transformed = []; + for (var _a2 = 0, nodes_3 = nodes; _a2 < nodes_3.length; _a2++) { + var node = nodes_3[_a2]; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("emit", "transformNodes", node.kind === 308 ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); + transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + state = 2; + ts2.performance.mark("afterTransform"); + ts2.performance.measure("transformTime", "beforeTransform", "afterTransform"); + return { + transformed, + substituteNode, + emitNodeWithNotification, + isEmitNotificationEnabled, + dispose, + diagnostics + }; + function transformRoot(node2) { + return node2 && (!ts2.isSourceFile(node2) || !node2.isDeclarationFile) ? transformation(node2) : node2; + } + function enableSubstitution(kind) { + ts2.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + enabledSyntaxKindFeatures[kind] |= 1; + } + function isSubstitutionEnabled(node2) { + return (enabledSyntaxKindFeatures[node2.kind] & 1) !== 0 && (ts2.getEmitFlags(node2) & 4) === 0; + } + function substituteNode(hint, node2) { + ts2.Debug.assert(state < 3, "Cannot substitute a node after the result is disposed."); + return node2 && isSubstitutionEnabled(node2) && onSubstituteNode(hint, node2) || node2; + } + function enableEmitNotification(kind) { + ts2.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + enabledSyntaxKindFeatures[kind] |= 2; + } + function isEmitNotificationEnabled(node2) { + return (enabledSyntaxKindFeatures[node2.kind] & 2) !== 0 || (ts2.getEmitFlags(node2) & 2) !== 0; + } + function emitNodeWithNotification(hint, node2, emitCallback) { + ts2.Debug.assert(state < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."); + if (node2) { + if (isEmitNotificationEnabled(node2)) { + onEmitNode(hint, node2, emitCallback); + } else { + emitCallback(hint, node2); + } + } + } + function hoistVariableDeclaration(name2) { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + var decl = ts2.setEmitFlags( + factory.createVariableDeclaration(name2), + 64 + /* EmitFlags.NoNestedSourceMaps */ + ); + if (!lexicalEnvironmentVariableDeclarations) { + lexicalEnvironmentVariableDeclarations = [decl]; + } else { + lexicalEnvironmentVariableDeclarations.push(decl); + } + if (lexicalEnvironmentFlags & 1) { + lexicalEnvironmentFlags |= 2; + } + } + function hoistFunctionDeclaration(func) { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.setEmitFlags( + func, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + if (!lexicalEnvironmentFunctionDeclarations) { + lexicalEnvironmentFunctionDeclarations = [func]; + } else { + lexicalEnvironmentFunctionDeclarations.push(func); + } + } + function addInitializationStatement(node2) { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.setEmitFlags( + node2, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + if (!lexicalEnvironmentStatements) { + lexicalEnvironmentStatements = [node2]; + } else { + lexicalEnvironmentStatements.push(node2); + } + } + function startLexicalEnvironment() { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); + lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; + lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; + lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentStatements; + lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFlags; + lexicalEnvironmentStackOffset++; + lexicalEnvironmentVariableDeclarations = void 0; + lexicalEnvironmentFunctionDeclarations = void 0; + lexicalEnvironmentStatements = void 0; + lexicalEnvironmentFlags = 0; + } + function suspendLexicalEnvironment() { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); + lexicalEnvironmentSuspended = true; + } + function resumeLexicalEnvironment() { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); + lexicalEnvironmentSuspended = false; + } + function endLexicalEnvironment() { + ts2.Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + ts2.Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); + var statements; + if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations || lexicalEnvironmentStatements) { + if (lexicalEnvironmentFunctionDeclarations) { + statements = __spreadArray9([], lexicalEnvironmentFunctionDeclarations, true); + } + if (lexicalEnvironmentVariableDeclarations) { + var statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations) + ); + ts2.setEmitFlags( + statement, + 1048576 + /* EmitFlags.CustomPrologue */ + ); + if (!statements) { + statements = [statement]; + } else { + statements.push(statement); + } + } + if (lexicalEnvironmentStatements) { + if (!statements) { + statements = __spreadArray9([], lexicalEnvironmentStatements, true); + } else { + statements = __spreadArray9(__spreadArray9([], statements, true), lexicalEnvironmentStatements, true); + } + } + } + lexicalEnvironmentStackOffset--; + lexicalEnvironmentVariableDeclarations = lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentFunctionDeclarations = lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentStatements = lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentFlags = lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset]; + if (lexicalEnvironmentStackOffset === 0) { + lexicalEnvironmentVariableDeclarationsStack = []; + lexicalEnvironmentFunctionDeclarationsStack = []; + lexicalEnvironmentStatementsStack = []; + lexicalEnvironmentFlagsStack = []; + } + return statements; + } + function setLexicalEnvironmentFlags(flags, value2) { + lexicalEnvironmentFlags = value2 ? lexicalEnvironmentFlags | flags : lexicalEnvironmentFlags & ~flags; + } + function getLexicalEnvironmentFlags() { + return lexicalEnvironmentFlags; + } + function startBlockScope() { + ts2.Debug.assert(state > 0, "Cannot start a block scope during initialization."); + ts2.Debug.assert(state < 2, "Cannot start a block scope after transformation has completed."); + blockScopedVariableDeclarationsStack[blockScopeStackOffset] = blockScopedVariableDeclarations; + blockScopeStackOffset++; + blockScopedVariableDeclarations = void 0; + } + function endBlockScope() { + ts2.Debug.assert(state > 0, "Cannot end a block scope during initialization."); + ts2.Debug.assert(state < 2, "Cannot end a block scope after transformation has completed."); + var statements = ts2.some(blockScopedVariableDeclarations) ? [ + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + blockScopedVariableDeclarations.map(function(identifier) { + return factory.createVariableDeclaration(identifier); + }), + 1 + /* NodeFlags.Let */ + ) + ) + ] : void 0; + blockScopeStackOffset--; + blockScopedVariableDeclarations = blockScopedVariableDeclarationsStack[blockScopeStackOffset]; + if (blockScopeStackOffset === 0) { + blockScopedVariableDeclarationsStack = []; + } + return statements; + } + function addBlockScopedVariable(name2) { + ts2.Debug.assert(blockScopeStackOffset > 0, "Cannot add a block scoped variable outside of an iteration body."); + (blockScopedVariableDeclarations || (blockScopedVariableDeclarations = [])).push(name2); + } + function requestEmitHelper(helper) { + ts2.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + ts2.Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); + if (helper.dependencies) { + for (var _i2 = 0, _a3 = helper.dependencies; _i2 < _a3.length; _i2++) { + var h8 = _a3[_i2]; + requestEmitHelper(h8); + } + } + emitHelpers = ts2.append(emitHelpers, helper); + } + function readEmitHelpers() { + ts2.Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + ts2.Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + var helpers = emitHelpers; + emitHelpers = void 0; + return helpers; + } + function dispose() { + if (state < 3) { + for (var _i2 = 0, nodes_4 = nodes; _i2 < nodes_4.length; _i2++) { + var node2 = nodes_4[_i2]; + ts2.disposeEmitNodes(ts2.getSourceFileOfNode(ts2.getParseTreeNode(node2))); + } + lexicalEnvironmentVariableDeclarations = void 0; + lexicalEnvironmentVariableDeclarationsStack = void 0; + lexicalEnvironmentFunctionDeclarations = void 0; + lexicalEnvironmentFunctionDeclarationsStack = void 0; + onSubstituteNode = void 0; + onEmitNode = void 0; + emitHelpers = void 0; + state = 3; + } + } + } + ts2.transformNodes = transformNodes; + ts2.nullTransformationContext = { + factory: ts2.factory, + getCompilerOptions: function() { + return {}; + }, + getEmitResolver: ts2.notImplemented, + getEmitHost: ts2.notImplemented, + getEmitHelperFactory: ts2.notImplemented, + startLexicalEnvironment: ts2.noop, + resumeLexicalEnvironment: ts2.noop, + suspendLexicalEnvironment: ts2.noop, + endLexicalEnvironment: ts2.returnUndefined, + setLexicalEnvironmentFlags: ts2.noop, + getLexicalEnvironmentFlags: function() { + return 0; + }, + hoistVariableDeclaration: ts2.noop, + hoistFunctionDeclaration: ts2.noop, + addInitializationStatement: ts2.noop, + startBlockScope: ts2.noop, + endBlockScope: ts2.returnUndefined, + addBlockScopedVariable: ts2.noop, + requestEmitHelper: ts2.noop, + readEmitHelpers: ts2.notImplemented, + enableSubstitution: ts2.noop, + enableEmitNotification: ts2.noop, + isSubstitutionEnabled: ts2.notImplemented, + isEmitNotificationEnabled: ts2.notImplemented, + onSubstituteNode: noEmitSubstitution, + onEmitNode: noEmitNotification, + addDiagnostic: ts2.noop + }; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var brackets = createBracketsMap(); + function isBuildInfoFile(file) { + return ts2.fileExtensionIs( + file, + ".tsbuildinfo" + /* Extension.TsBuildInfo */ + ); + } + ts2.isBuildInfoFile = isBuildInfoFile; + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit, onlyBuildInfo, includeBuildInfo) { + if (forceDtsEmit === void 0) { + forceDtsEmit = false; + } + var sourceFiles = ts2.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts2.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit); + var options = host.getCompilerOptions(); + if (ts2.outFile(options)) { + var prepends = host.getPrependNodes(); + if (sourceFiles.length || prepends.length) { + var bundle = ts2.factory.createBundle(sourceFiles, prepends); + var result2 = action(getOutputPathsFor(bundle, host, forceDtsEmit), bundle); + if (result2) { + return result2; + } + } + } else { + if (!onlyBuildInfo) { + for (var _a2 = 0, sourceFiles_1 = sourceFiles; _a2 < sourceFiles_1.length; _a2++) { + var sourceFile = sourceFiles_1[_a2]; + var result2 = action(getOutputPathsFor(sourceFile, host, forceDtsEmit), sourceFile); + if (result2) { + return result2; + } + } + } + if (includeBuildInfo) { + var buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); + if (buildInfoPath) + return action( + { buildInfoPath }, + /*sourceFileOrBundle*/ + void 0 + ); + } + } + } + ts2.forEachEmittedFile = forEachEmittedFile; + function getTsBuildInfoEmitOutputFilePath(options) { + var configFile = options.configFilePath; + if (!ts2.isIncrementalCompilation(options)) + return void 0; + if (options.tsBuildInfoFile) + return options.tsBuildInfoFile; + var outPath = ts2.outFile(options); + var buildInfoExtensionLess; + if (outPath) { + buildInfoExtensionLess = ts2.removeFileExtension(outPath); + } else { + if (!configFile) + return void 0; + var configFileExtensionLess = ts2.removeFileExtension(configFile); + buildInfoExtensionLess = options.outDir ? options.rootDir ? ts2.resolvePath(options.outDir, ts2.getRelativePathFromDirectory( + options.rootDir, + configFileExtensionLess, + /*ignoreCase*/ + true + )) : ts2.combinePaths(options.outDir, ts2.getBaseFileName(configFileExtensionLess)) : configFileExtensionLess; + } + return buildInfoExtensionLess + ".tsbuildinfo"; + } + ts2.getTsBuildInfoEmitOutputFilePath = getTsBuildInfoEmitOutputFilePath; + function getOutputPathsForBundle(options, forceDtsPaths) { + var outPath = ts2.outFile(options); + var jsFilePath = options.emitDeclarationOnly ? void 0 : outPath; + var sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = forceDtsPaths || ts2.getEmitDeclarations(options) ? ts2.removeFileExtension(outPath) + ".d.ts" : void 0; + var declarationMapPath = declarationFilePath && ts2.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; + var buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); + return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath }; + } + ts2.getOutputPathsForBundle = getOutputPathsForBundle; + function getOutputPathsFor(sourceFile, host, forceDtsPaths) { + var options = host.getCompilerOptions(); + if (sourceFile.kind === 309) { + return getOutputPathsForBundle(options, forceDtsPaths); + } else { + var ownOutputFilePath = ts2.getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); + var isJsonFile = ts2.isJsonSourceFile(sourceFile); + var isJsonEmittedToSameLocation = isJsonFile && ts2.comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0; + var jsFilePath = options.emitDeclarationOnly || isJsonEmittedToSameLocation ? void 0 : ownOutputFilePath; + var sourceMapFilePath = !jsFilePath || ts2.isJsonSourceFile(sourceFile) ? void 0 : getSourceMapFilePath(jsFilePath, options); + var declarationFilePath = forceDtsPaths || ts2.getEmitDeclarations(options) && !isJsonFile ? ts2.getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : void 0; + var declarationMapPath = declarationFilePath && ts2.getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; + return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath: void 0 }; + } + } + ts2.getOutputPathsFor = getOutputPathsFor; + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap && !options.inlineSourceMap ? jsFilePath + ".map" : void 0; + } + function getOutputExtension(fileName, options) { + return ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + ) ? ".json" : options.jsx === 1 && ts2.fileExtensionIsOneOf(fileName, [ + ".jsx", + ".tsx" + /* Extension.Tsx */ + ]) ? ".jsx" : ts2.fileExtensionIsOneOf(fileName, [ + ".mts", + ".mjs" + /* Extension.Mjs */ + ]) ? ".mjs" : ts2.fileExtensionIsOneOf(fileName, [ + ".cts", + ".cjs" + /* Extension.Cjs */ + ]) ? ".cjs" : ".js"; + } + ts2.getOutputExtension = getOutputExtension; + function getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, outputDir, getCommonSourceDirectory2) { + return outputDir ? ts2.resolvePath(outputDir, ts2.getRelativePathFromDirectory(getCommonSourceDirectory2 ? getCommonSourceDirectory2() : getCommonSourceDirectoryOfConfig(configFile, ignoreCase), inputFileName, ignoreCase)) : inputFileName; + } + function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) { + return ts2.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.declarationDir || configFile.options.outDir, getCommonSourceDirectory2), ts2.getDeclarationEmitExtensionForPath(inputFileName)); + } + ts2.getOutputDeclarationFileName = getOutputDeclarationFileName; + function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) { + if (configFile.options.emitDeclarationOnly) + return void 0; + var isJsonFile = ts2.fileExtensionIs( + inputFileName, + ".json" + /* Extension.Json */ + ); + var outputFileName = ts2.changeExtension(getOutputPathWithoutChangingExt(inputFileName, configFile, ignoreCase, configFile.options.outDir, getCommonSourceDirectory2), getOutputExtension(inputFileName, configFile.options)); + return !isJsonFile || ts2.comparePaths(inputFileName, outputFileName, ts2.Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 ? outputFileName : void 0; + } + function createAddOutput() { + var outputs; + return { addOutput, getOutputs }; + function addOutput(path2) { + if (path2) { + (outputs || (outputs = [])).push(path2); + } + } + function getOutputs() { + return outputs || ts2.emptyArray; + } + } + function getSingleOutputFileNames(configFile, addOutput) { + var _a2 = getOutputPathsForBundle( + configFile.options, + /*forceDtsPaths*/ + false + ), jsFilePath = _a2.jsFilePath, sourceMapFilePath = _a2.sourceMapFilePath, declarationFilePath = _a2.declarationFilePath, declarationMapPath = _a2.declarationMapPath, buildInfoPath = _a2.buildInfoPath; + addOutput(jsFilePath); + addOutput(sourceMapFilePath); + addOutput(declarationFilePath); + addOutput(declarationMapPath); + addOutput(buildInfoPath); + } + function getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory2) { + if (ts2.isDeclarationFileName(inputFileName)) + return; + var js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + addOutput(js); + if (ts2.fileExtensionIs( + inputFileName, + ".json" + /* Extension.Json */ + )) + return; + if (js && configFile.options.sourceMap) { + addOutput("".concat(js, ".map")); + } + if (ts2.getEmitDeclarations(configFile.options)) { + var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + addOutput(dts); + if (configFile.options.declarationMap) { + addOutput("".concat(dts, ".map")); + } + } + } + function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { + var commonSourceDirectory; + if (options.rootDir) { + commonSourceDirectory = ts2.getNormalizedAbsolutePath(options.rootDir, currentDirectory); + checkSourceFilesBelongToPath === null || checkSourceFilesBelongToPath === void 0 ? void 0 : checkSourceFilesBelongToPath(options.rootDir); + } else if (options.composite && options.configFilePath) { + commonSourceDirectory = ts2.getDirectoryPath(ts2.normalizeSlashes(options.configFilePath)); + checkSourceFilesBelongToPath === null || checkSourceFilesBelongToPath === void 0 ? void 0 : checkSourceFilesBelongToPath(commonSourceDirectory); + } else { + commonSourceDirectory = ts2.computeCommonSourceDirectoryOfFilenames(emittedFiles(), currentDirectory, getCanonicalFileName); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts2.directorySeparator) { + commonSourceDirectory += ts2.directorySeparator; + } + return commonSourceDirectory; + } + ts2.getCommonSourceDirectory = getCommonSourceDirectory; + function getCommonSourceDirectoryOfConfig(_a2, ignoreCase) { + var options = _a2.options, fileNames = _a2.fileNames; + return getCommonSourceDirectory(options, function() { + return ts2.filter(fileNames, function(file) { + return !(options.noEmitForJsFiles && ts2.fileExtensionIsOneOf(file, ts2.supportedJSExtensionsFlat)) && !ts2.isDeclarationFileName(file); + }); + }, ts2.getDirectoryPath(ts2.normalizeSlashes(ts2.Debug.checkDefined(options.configFilePath))), ts2.createGetCanonicalFileName(!ignoreCase)); + } + ts2.getCommonSourceDirectoryOfConfig = getCommonSourceDirectoryOfConfig; + function getAllProjectOutputs(configFile, ignoreCase) { + var _a2 = createAddOutput(), addOutput = _a2.addOutput, getOutputs = _a2.getOutputs; + if (ts2.outFile(configFile.options)) { + getSingleOutputFileNames(configFile, addOutput); + } else { + var getCommonSourceDirectory_1 = ts2.memoize(function() { + return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); + }); + for (var _b = 0, _c = configFile.fileNames; _b < _c.length; _b++) { + var inputFileName = _c[_b]; + getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory_1); + } + addOutput(getTsBuildInfoEmitOutputFilePath(configFile.options)); + } + return getOutputs(); + } + ts2.getAllProjectOutputs = getAllProjectOutputs; + function getOutputFileNames(commandLine, inputFileName, ignoreCase) { + inputFileName = ts2.normalizePath(inputFileName); + ts2.Debug.assert(ts2.contains(commandLine.fileNames, inputFileName), "Expected fileName to be present in command line"); + var _a2 = createAddOutput(), addOutput = _a2.addOutput, getOutputs = _a2.getOutputs; + if (ts2.outFile(commandLine.options)) { + getSingleOutputFileNames(commandLine, addOutput); + } else { + getOwnOutputFileNames(commandLine, inputFileName, ignoreCase, addOutput); + } + return getOutputs(); + } + ts2.getOutputFileNames = getOutputFileNames; + function getFirstProjectOutput(configFile, ignoreCase) { + if (ts2.outFile(configFile.options)) { + var jsFilePath = getOutputPathsForBundle( + configFile.options, + /*forceDtsPaths*/ + false + ).jsFilePath; + return ts2.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output")); + } + var getCommonSourceDirectory2 = ts2.memoize(function() { + return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); + }); + for (var _a2 = 0, _b = configFile.fileNames; _a2 < _b.length; _a2++) { + var inputFileName = _b[_a2]; + if (ts2.isDeclarationFileName(inputFileName)) + continue; + var jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + if (jsFilePath) + return jsFilePath; + if (ts2.fileExtensionIs( + inputFileName, + ".json" + /* Extension.Json */ + )) + continue; + if (ts2.getEmitDeclarations(configFile.options)) { + return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + } + } + var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options); + if (buildInfoPath) + return buildInfoPath; + return ts2.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output")); + } + ts2.getFirstProjectOutput = getFirstProjectOutput; + function emitFiles(resolver, host, targetSourceFile, _a2, emitOnlyDtsFiles, onlyBuildInfo, forceDtsEmit) { + var scriptTransformers = _a2.scriptTransformers, declarationTransformers = _a2.declarationTransformers; + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || ts2.getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = ts2.createDiagnosticCollection(); + var newLine = ts2.getNewLineCharacter(compilerOptions, function() { + return host.getNewLine(); + }); + var writer = ts2.createTextWriter(newLine); + var _b = ts2.performance.createTimer("printTime", "beforePrint", "afterPrint"), enter = _b.enter, exit3 = _b.exit; + var bundleBuildInfo; + var emitSkipped = false; + enter(); + forEachEmittedFile(host, emitSourceFileOrBundle, ts2.getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), forceDtsEmit, onlyBuildInfo, !targetSourceFile); + exit3(); + return { + emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), + emittedFiles: emittedFilesList, + sourceMaps: sourceMapDataList + }; + function emitSourceFileOrBundle(_a3, sourceFileOrBundle) { + var jsFilePath = _a3.jsFilePath, sourceMapFilePath = _a3.sourceMapFilePath, declarationFilePath = _a3.declarationFilePath, declarationMapPath = _a3.declarationMapPath, buildInfoPath = _a3.buildInfoPath; + var buildInfoDirectory; + if (buildInfoPath && sourceFileOrBundle && ts2.isBundle(sourceFileOrBundle)) { + buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + bundleBuildInfo = { + commonSourceDirectory: relativeToBuildInfo(host.getCommonSourceDirectory()), + sourceFiles: sourceFileOrBundle.sourceFiles.map(function(file) { + return relativeToBuildInfo(ts2.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); + }) + }; + } + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("emit", "emitJsFileOrBundle", { jsFilePath }); + emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("emit", "emitDeclarationFileOrBundle", { declarationFilePath }); + emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("emit", "emitBuildInfo", { buildInfoPath }); + emitBuildInfo(bundleBuildInfo, buildInfoPath); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + if (!emitSkipped && emittedFilesList) { + if (!emitOnlyDtsFiles) { + if (jsFilePath) { + emittedFilesList.push(jsFilePath); + } + if (sourceMapFilePath) { + emittedFilesList.push(sourceMapFilePath); + } + if (buildInfoPath) { + emittedFilesList.push(buildInfoPath); + } + } + if (declarationFilePath) { + emittedFilesList.push(declarationFilePath); + } + if (declarationMapPath) { + emittedFilesList.push(declarationMapPath); + } + } + function relativeToBuildInfo(path2) { + return ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(buildInfoDirectory, path2, host.getCanonicalFileName)); + } + } + function emitBuildInfo(bundle, buildInfoPath) { + if (!buildInfoPath || targetSourceFile || emitSkipped) + return; + var program = host.getProgramBuildInfo(); + if (host.isEmitBlocked(buildInfoPath)) { + emitSkipped = true; + return; + } + var version5 = ts2.version; + var buildInfo = { bundle, program, version: version5 }; + ts2.writeFile( + host, + emitterDiagnostics, + buildInfoPath, + getBuildInfoText(buildInfo), + /*writeByteOrderMark*/ + false, + /*sourceFiles*/ + void 0, + { buildInfo } + ); + } + function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) { + if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) { + return; + } + if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit) { + emitSkipped = true; + return; + } + var transform2 = ts2.transformNodes( + resolver, + host, + ts2.factory, + compilerOptions, + [sourceFileOrBundle], + scriptTransformers, + /*allowDtsFiles*/ + false + ); + var printerOptions = { + removeComments: compilerOptions.removeComments, + newLine: compilerOptions.newLine, + noEmitHelpers: compilerOptions.noEmitHelpers, + module: compilerOptions.module, + target: compilerOptions.target, + sourceMap: compilerOptions.sourceMap, + inlineSourceMap: compilerOptions.inlineSourceMap, + inlineSources: compilerOptions.inlineSources, + extendedDiagnostics: compilerOptions.extendedDiagnostics, + writeBundleFileInfo: !!bundleBuildInfo, + relativeToBuildInfo + }; + var printer = createPrinter(printerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: transform2.emitNodeWithNotification, + isEmitNotificationEnabled: transform2.isEmitNotificationEnabled, + substituteNode: transform2.substituteNode + }); + ts2.Debug.assert(transform2.transformed.length === 1, "Should only see one output from the transform"); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, compilerOptions); + transform2.dispose(); + if (bundleBuildInfo) + bundleBuildInfo.js = printer.bundleFileInfo; + } + function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) { + if (!sourceFileOrBundle) + return; + if (!declarationFilePath) { + if (emitOnlyDtsFiles || compilerOptions.emitDeclarationOnly) + emitSkipped = true; + return; + } + var sourceFiles = ts2.isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles; + var filesForEmit = forceDtsEmit ? sourceFiles : ts2.filter(sourceFiles, ts2.isSourceFileNotJson); + var inputListOrBundle = ts2.outFile(compilerOptions) ? [ts2.factory.createBundle(filesForEmit, !ts2.isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : void 0)] : filesForEmit; + if (emitOnlyDtsFiles && !ts2.getEmitDeclarations(compilerOptions)) { + filesForEmit.forEach(collectLinkedAliases); + } + var declarationTransform = ts2.transformNodes( + resolver, + host, + ts2.factory, + compilerOptions, + inputListOrBundle, + declarationTransformers, + /*allowDtsFiles*/ + false + ); + if (ts2.length(declarationTransform.diagnostics)) { + for (var _a3 = 0, _b2 = declarationTransform.diagnostics; _a3 < _b2.length; _a3++) { + var diagnostic = _b2[_a3]; + emitterDiagnostics.add(diagnostic); + } + } + var printerOptions = { + removeComments: compilerOptions.removeComments, + newLine: compilerOptions.newLine, + noEmitHelpers: true, + module: compilerOptions.module, + target: compilerOptions.target, + sourceMap: !forceDtsEmit && compilerOptions.declarationMap, + inlineSourceMap: compilerOptions.inlineSourceMap, + extendedDiagnostics: compilerOptions.extendedDiagnostics, + onlyPrintJsDocStyle: true, + writeBundleFileInfo: !!bundleBuildInfo, + recordInternalSection: !!bundleBuildInfo, + relativeToBuildInfo + }; + var declarationPrinter = createPrinter(printerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: declarationTransform.emitNodeWithNotification, + isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled, + substituteNode: declarationTransform.substituteNode + }); + var declBlocked = !!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit; + emitSkipped = emitSkipped || declBlocked; + if (!declBlocked || forceDtsEmit) { + ts2.Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform"); + printSourceFileOrBundle(declarationFilePath, declarationMapPath, declarationTransform, declarationPrinter, { + sourceMap: printerOptions.sourceMap, + sourceRoot: compilerOptions.sourceRoot, + mapRoot: compilerOptions.mapRoot, + extendedDiagnostics: compilerOptions.extendedDiagnostics + // Explicitly do not passthru either `inline` option + }); + } + declarationTransform.dispose(); + if (bundleBuildInfo) + bundleBuildInfo.dts = declarationPrinter.bundleFileInfo; + } + function collectLinkedAliases(node) { + if (ts2.isExportAssignment(node)) { + if (node.expression.kind === 79) { + resolver.collectLinkedAliases( + node.expression, + /*setVisibility*/ + true + ); + } + return; + } else if (ts2.isExportSpecifier(node)) { + resolver.collectLinkedAliases( + node.propertyName || node.name, + /*setVisibility*/ + true + ); + return; + } + ts2.forEachChild(node, collectLinkedAliases); + } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform2, printer, mapOptions) { + var sourceFileOrBundle = transform2.transformed[0]; + var bundle = sourceFileOrBundle.kind === 309 ? sourceFileOrBundle : void 0; + var sourceFile = sourceFileOrBundle.kind === 308 ? sourceFileOrBundle : void 0; + var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + var sourceMapGenerator; + if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { + sourceMapGenerator = ts2.createSourceMapGenerator(host, ts2.getBaseFileName(ts2.normalizeSlashes(jsFilePath)), getSourceRoot(mapOptions), getSourceMapDirectory(mapOptions, jsFilePath, sourceFile), mapOptions); + } + if (bundle) { + printer.writeBundle(bundle, writer, sourceMapGenerator); + } else { + printer.writeFile(sourceFile, writer, sourceMapGenerator); + } + var sourceMapUrlPos; + if (sourceMapGenerator) { + if (sourceMapDataList) { + sourceMapDataList.push({ + inputSourceFileNames: sourceMapGenerator.getSources(), + sourceMap: sourceMapGenerator.toJSON() + }); + } + var sourceMappingURL = getSourceMappingURL(mapOptions, sourceMapGenerator, jsFilePath, sourceMapFilePath, sourceFile); + if (sourceMappingURL) { + if (!writer.isAtStartOfLine()) + writer.rawWrite(newLine); + sourceMapUrlPos = writer.getTextPos(); + writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); + } + if (sourceMapFilePath) { + var sourceMap = sourceMapGenerator.toString(); + ts2.writeFile( + host, + emitterDiagnostics, + sourceMapFilePath, + sourceMap, + /*writeByteOrderMark*/ + false, + sourceFiles + ); + if (printer.bundleFileInfo) + printer.bundleFileInfo.mapHash = ts2.computeSignature(sourceMap, ts2.maybeBind(host, host.createHash)); + } + } else { + writer.writeLine(); + } + var text = writer.getText(); + ts2.writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos, diagnostics: transform2.diagnostics }); + if (printer.bundleFileInfo) + printer.bundleFileInfo.hash = ts2.computeSignature(text, ts2.maybeBind(host, host.createHash)); + writer.clear(); + } + function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { + return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 308 || !ts2.fileExtensionIs( + sourceFileOrBundle.fileName, + ".json" + /* Extension.Json */ + )); + } + function getSourceRoot(mapOptions) { + var sourceRoot = ts2.normalizeSlashes(mapOptions.sourceRoot || ""); + return sourceRoot ? ts2.ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot; + } + function getSourceMapDirectory(mapOptions, filePath, sourceFile) { + if (mapOptions.sourceRoot) + return host.getCommonSourceDirectory(); + if (mapOptions.mapRoot) { + var sourceMapDir = ts2.normalizeSlashes(mapOptions.mapRoot); + if (sourceFile) { + sourceMapDir = ts2.getDirectoryPath(ts2.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); + } + if (ts2.getRootLength(sourceMapDir) === 0) { + sourceMapDir = ts2.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + } + return sourceMapDir; + } + return ts2.getDirectoryPath(ts2.normalizePath(filePath)); + } + function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) { + if (mapOptions.inlineSourceMap) { + var sourceMapText = sourceMapGenerator.toString(); + var base64SourceMapText = ts2.base64encode(ts2.sys, sourceMapText); + return "data:application/json;base64,".concat(base64SourceMapText); + } + var sourceMapFile = ts2.getBaseFileName(ts2.normalizeSlashes(ts2.Debug.checkDefined(sourceMapFilePath))); + if (mapOptions.mapRoot) { + var sourceMapDir = ts2.normalizeSlashes(mapOptions.mapRoot); + if (sourceFile) { + sourceMapDir = ts2.getDirectoryPath(ts2.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); + } + if (ts2.getRootLength(sourceMapDir) === 0) { + sourceMapDir = ts2.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + return encodeURI(ts2.getRelativePathToDirectoryOrUrl( + ts2.getDirectoryPath(ts2.normalizePath(filePath)), + // get the relative sourceMapDir path based on jsFilePath + ts2.combinePaths(sourceMapDir, sourceMapFile), + // this is where user expects to see sourceMap + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + true + )); + } else { + return encodeURI(ts2.combinePaths(sourceMapDir, sourceMapFile)); + } + } + return encodeURI(sourceMapFile); + } + } + ts2.emitFiles = emitFiles; + function getBuildInfoText(buildInfo) { + return JSON.stringify(buildInfo); + } + ts2.getBuildInfoText = getBuildInfoText; + function getBuildInfo(buildInfoFile, buildInfoText) { + return ts2.readJsonOrUndefined(buildInfoFile, buildInfoText); + } + ts2.getBuildInfo = getBuildInfo; + ts2.notImplementedResolver = { + hasGlobalName: ts2.notImplemented, + getReferencedExportContainer: ts2.notImplemented, + getReferencedImportDeclaration: ts2.notImplemented, + getReferencedDeclarationWithCollidingName: ts2.notImplemented, + isDeclarationWithCollidingName: ts2.notImplemented, + isValueAliasDeclaration: ts2.notImplemented, + isReferencedAliasDeclaration: ts2.notImplemented, + isTopLevelValueImportEqualsWithEntityName: ts2.notImplemented, + getNodeCheckFlags: ts2.notImplemented, + isDeclarationVisible: ts2.notImplemented, + isLateBound: function(_node) { + return false; + }, + collectLinkedAliases: ts2.notImplemented, + isImplementationOfOverload: ts2.notImplemented, + isRequiredInitializedParameter: ts2.notImplemented, + isOptionalUninitializedParameterProperty: ts2.notImplemented, + isExpandoFunctionDeclaration: ts2.notImplemented, + getPropertiesOfContainerFunction: ts2.notImplemented, + createTypeOfDeclaration: ts2.notImplemented, + createReturnTypeOfSignatureDeclaration: ts2.notImplemented, + createTypeOfExpression: ts2.notImplemented, + createLiteralConstValue: ts2.notImplemented, + isSymbolAccessible: ts2.notImplemented, + isEntityNameVisible: ts2.notImplemented, + // Returns the constant value this property access resolves to: notImplemented, or 'undefined' for a non-constant + getConstantValue: ts2.notImplemented, + getReferencedValueDeclaration: ts2.notImplemented, + getTypeReferenceSerializationKind: ts2.notImplemented, + isOptionalParameter: ts2.notImplemented, + moduleExportsSomeValue: ts2.notImplemented, + isArgumentsLocalBinding: ts2.notImplemented, + getExternalModuleFileFromDeclaration: ts2.notImplemented, + getTypeReferenceDirectivesForEntityName: ts2.notImplemented, + getTypeReferenceDirectivesForSymbol: ts2.notImplemented, + isLiteralConstDeclaration: ts2.notImplemented, + getJsxFactoryEntity: ts2.notImplemented, + getJsxFragmentFactoryEntity: ts2.notImplemented, + getAllAccessorDeclarations: ts2.notImplemented, + getSymbolOfExternalModuleSpecifier: ts2.notImplemented, + isBindingCapturedByNode: ts2.notImplemented, + getDeclarationStatementsForSourceFile: ts2.notImplemented, + isImportRequiredByAugmentation: ts2.notImplemented + }; + function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { + var _a2; + var jsBundle = ts2.Debug.checkDefined(bundle.js); + var prologueMap = ((_a2 = jsBundle.sources) === null || _a2 === void 0 ? void 0 : _a2.prologues) && ts2.arrayToMap(jsBundle.sources.prologues, function(prologueInfo) { + return prologueInfo.file; + }); + return bundle.sourceFiles.map(function(fileName, index4) { + var _a3, _b; + var prologueInfo = prologueMap === null || prologueMap === void 0 ? void 0 : prologueMap.get(index4); + var statements = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.directives.map(function(directive) { + var literal = ts2.setTextRange(ts2.factory.createStringLiteral(directive.expression.text), directive.expression); + var statement = ts2.setTextRange(ts2.factory.createExpressionStatement(literal), directive); + ts2.setParent(literal, statement); + return statement; + }); + var eofToken = ts2.factory.createToken( + 1 + /* SyntaxKind.EndOfFileToken */ + ); + var sourceFile = ts2.factory.createSourceFile( + statements !== null && statements !== void 0 ? statements : [], + eofToken, + 0 + /* NodeFlags.None */ + ); + sourceFile.fileName = ts2.getRelativePathFromDirectory(host.getCurrentDirectory(), ts2.getNormalizedAbsolutePath(fileName, buildInfoDirectory), !host.useCaseSensitiveFileNames()); + sourceFile.text = (_a3 = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.text) !== null && _a3 !== void 0 ? _a3 : ""; + ts2.setTextRangePosWidth(sourceFile, 0, (_b = prologueInfo === null || prologueInfo === void 0 ? void 0 : prologueInfo.text.length) !== null && _b !== void 0 ? _b : 0); + ts2.setEachParent(sourceFile.statements, sourceFile); + ts2.setTextRangePosWidth(eofToken, sourceFile.end, 0); + ts2.setParent(eofToken, sourceFile); + return sourceFile; + }); + } + function emitUsingBuildInfo(config3, host, getCommandLine, customTransformers) { + var createHash2 = ts2.maybeBind(host, host.createHash); + var _a2 = getOutputPathsForBundle( + config3.options, + /*forceDtsPaths*/ + false + ), buildInfoPath = _a2.buildInfoPath, jsFilePath = _a2.jsFilePath, sourceMapFilePath = _a2.sourceMapFilePath, declarationFilePath = _a2.declarationFilePath, declarationMapPath = _a2.declarationMapPath; + var buildInfo; + if (host.getBuildInfo) { + buildInfo = host.getBuildInfo(buildInfoPath, config3.options.configFilePath); + } else { + var buildInfoText = host.readFile(buildInfoPath); + if (!buildInfoText) + return buildInfoPath; + buildInfo = getBuildInfo(buildInfoPath, buildInfoText); + } + if (!buildInfo) + return buildInfoPath; + if (!buildInfo.bundle || !buildInfo.bundle.js || declarationFilePath && !buildInfo.bundle.dts) + return buildInfoPath; + var jsFileText = host.readFile(ts2.Debug.checkDefined(jsFilePath)); + if (!jsFileText) + return jsFilePath; + if (ts2.computeSignature(jsFileText, createHash2) !== buildInfo.bundle.js.hash) + return jsFilePath; + var sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath); + if (sourceMapFilePath && !sourceMapText || config3.options.inlineSourceMap) + return sourceMapFilePath || "inline sourcemap decoding"; + if (sourceMapFilePath && ts2.computeSignature(sourceMapText, createHash2) !== buildInfo.bundle.js.mapHash) + return sourceMapFilePath; + var declarationText = declarationFilePath && host.readFile(declarationFilePath); + if (declarationFilePath && !declarationText) + return declarationFilePath; + if (declarationFilePath && ts2.computeSignature(declarationText, createHash2) !== buildInfo.bundle.dts.hash) + return declarationFilePath; + var declarationMapText = declarationMapPath && host.readFile(declarationMapPath); + if (declarationMapPath && !declarationMapText || config3.options.inlineSourceMap) + return declarationMapPath || "inline sourcemap decoding"; + if (declarationMapPath && ts2.computeSignature(declarationMapText, createHash2) !== buildInfo.bundle.dts.mapHash) + return declarationMapPath; + var buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + var ownPrependInput = ts2.createInputFiles( + jsFileText, + declarationText, + sourceMapFilePath, + sourceMapText, + declarationMapPath, + declarationMapText, + jsFilePath, + declarationFilePath, + buildInfoPath, + buildInfo, + /*onlyOwnText*/ + true + ); + var outputFiles = []; + var prependNodes = ts2.createPrependNodes(config3.projectReferences, getCommandLine, function(f8) { + return host.readFile(f8); + }); + var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host); + var changedDtsText; + var changedDtsData; + var emitHost = { + getPrependNodes: ts2.memoize(function() { + return __spreadArray9(__spreadArray9([], prependNodes, true), [ownPrependInput], false); + }), + getCanonicalFileName: host.getCanonicalFileName, + getCommonSourceDirectory: function() { + return ts2.getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory); + }, + getCompilerOptions: function() { + return config3.options; + }, + getCurrentDirectory: function() { + return host.getCurrentDirectory(); + }, + getNewLine: function() { + return host.getNewLine(); + }, + getSourceFile: ts2.returnUndefined, + getSourceFileByPath: ts2.returnUndefined, + getSourceFiles: function() { + return sourceFilesForJsEmit; + }, + getLibFileFromReference: ts2.notImplemented, + isSourceFileFromExternalLibrary: ts2.returnFalse, + getResolvedProjectReferenceToRedirect: ts2.returnUndefined, + getProjectReferenceRedirect: ts2.returnUndefined, + isSourceOfProjectReferenceRedirect: ts2.returnFalse, + writeFile: function(name2, text, writeByteOrderMark, _onError, _sourceFiles, data) { + switch (name2) { + case jsFilePath: + if (jsFileText === text) + return; + break; + case sourceMapFilePath: + if (sourceMapText === text) + return; + break; + case buildInfoPath: + var newBuildInfo = data.buildInfo; + newBuildInfo.program = buildInfo.program; + if (newBuildInfo.program && changedDtsText !== void 0 && config3.options.composite) { + newBuildInfo.program.outSignature = ts2.computeSignature(changedDtsText, createHash2, changedDtsData); + } + var _a3 = buildInfo.bundle, js = _a3.js, dts = _a3.dts, sourceFiles = _a3.sourceFiles; + newBuildInfo.bundle.js.sources = js.sources; + if (dts) { + newBuildInfo.bundle.dts.sources = dts.sources; + } + newBuildInfo.bundle.sourceFiles = sourceFiles; + outputFiles.push({ name: name2, text: getBuildInfoText(newBuildInfo), writeByteOrderMark, buildInfo: newBuildInfo }); + return; + case declarationFilePath: + if (declarationText === text) + return; + changedDtsText = text; + changedDtsData = data; + break; + case declarationMapPath: + if (declarationMapText === text) + return; + break; + default: + ts2.Debug.fail("Unexpected path: ".concat(name2)); + } + outputFiles.push({ name: name2, text, writeByteOrderMark }); + }, + isEmitBlocked: ts2.returnFalse, + readFile: function(f8) { + return host.readFile(f8); + }, + fileExists: function(f8) { + return host.fileExists(f8); + }, + useCaseSensitiveFileNames: function() { + return host.useCaseSensitiveFileNames(); + }, + getProgramBuildInfo: ts2.returnUndefined, + getSourceFileFromReference: ts2.returnUndefined, + redirectTargetsMap: ts2.createMultiMap(), + getFileIncludeReasons: ts2.notImplemented, + createHash: createHash2 + }; + emitFiles( + ts2.notImplementedResolver, + emitHost, + /*targetSourceFile*/ + void 0, + ts2.getTransformers(config3.options, customTransformers) + ); + return outputFiles; + } + ts2.emitUsingBuildInfo = emitUsingBuildInfo; + var PipelinePhase; + (function(PipelinePhase2) { + PipelinePhase2[PipelinePhase2["Notification"] = 0] = "Notification"; + PipelinePhase2[PipelinePhase2["Substitution"] = 1] = "Substitution"; + PipelinePhase2[PipelinePhase2["Comments"] = 2] = "Comments"; + PipelinePhase2[PipelinePhase2["SourceMaps"] = 3] = "SourceMaps"; + PipelinePhase2[PipelinePhase2["Emit"] = 4] = "Emit"; + })(PipelinePhase || (PipelinePhase = {})); + function createPrinter(printerOptions, handlers) { + if (printerOptions === void 0) { + printerOptions = {}; + } + if (handlers === void 0) { + handlers = {}; + } + var hasGlobalName = handlers.hasGlobalName, _a2 = handlers.onEmitNode, onEmitNode = _a2 === void 0 ? ts2.noEmitNotification : _a2, isEmitNotificationEnabled = handlers.isEmitNotificationEnabled, _b = handlers.substituteNode, substituteNode = _b === void 0 ? ts2.noEmitSubstitution : _b, onBeforeEmitNode = handlers.onBeforeEmitNode, onAfterEmitNode = handlers.onAfterEmitNode, onBeforeEmitNodeArray = handlers.onBeforeEmitNodeArray, onAfterEmitNodeArray = handlers.onAfterEmitNodeArray, onBeforeEmitToken = handlers.onBeforeEmitToken, onAfterEmitToken = handlers.onAfterEmitToken; + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var newLine = ts2.getNewLineCharacter(printerOptions); + var moduleKind = ts2.getEmitModuleKind(printerOptions); + var bundledHelpers = new ts2.Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? ts2.Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text"; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var _c = ts2.performance.createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"), enterComment = _c.enter, exitComment = _c.exit; + var parenthesizer = ts2.factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { + select: function(index4) { + return index4 === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0; + } + }; + var emitBinaryExpression = createEmitBinaryExpression(); + reset(); + return { + // public API + printNode, + printList, + printFile, + printBundle, + // internal API + writeNode: writeNode2, + writeList, + writeFile: writeFile2, + writeBundle, + bundleFileInfo + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0: + ts2.Debug.assert(ts2.isSourceFile(node), "Expected a SourceFile node."); + break; + case 2: + ts2.Debug.assert(ts2.isIdentifier(node), "Expected an Identifier node."); + break; + case 1: + ts2.Debug.assert(ts2.isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 308: + return printFile(node); + case 309: + return printBundle(node); + case 310: + return printUnparsedSource(node); + } + writeNode2(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printList(format5, nodes, sourceFile) { + writeList(format5, nodes, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle( + bundle, + beginPrint(), + /*sourceMapEmitter*/ + void 0 + ); + return endPrint(); + } + function printFile(sourceFile) { + writeFile2( + sourceFile, + beginPrint(), + /*sourceMapEmitter*/ + void 0 + ); + return endPrint(); + } + function printUnparsedSource(unparsed) { + writeUnparsedSource(unparsed, beginPrint()); + return endPrint(); + } + function writeNode2(hint, node, sourceFile, output) { + var previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print(hint, node, sourceFile); + reset(); + writer = previousWriter; + } + function writeList(format5, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList( + /*parentNode*/ + void 0, + nodes, + format5 + ); + reset(); + writer = previousWriter; + } + function getTextPosWithWriteLine() { + return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos(); + } + function updateOrPushBundleFileTextLike(pos, end, kind) { + var last2 = ts2.lastOrUndefined(bundleFileInfo.sections); + if (last2 && last2.kind === kind) { + last2.end = end; + } else { + bundleFileInfo.sections.push({ pos, end, kind }); + } + } + function recordBundleFileInternalSectionStart(node) { + if (recordInternalSection && bundleFileInfo && currentSourceFile && (ts2.isDeclaration(node) || ts2.isVariableStatement(node)) && ts2.isInternalDeclaration(node, currentSourceFile) && sourceFileTextKind !== "internal") { + var prevSourceFileTextKind = sourceFileTextKind; + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = "internal"; + return prevSourceFileTextKind; + } + return void 0; + } + function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) { + if (prevSourceFileTextKind) { + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = prevSourceFileTextKind; + } + } + function recordBundleFileTextLikeSection(end) { + if (sourceFileTextPos < end) { + updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind); + return true; + } + return false; + } + function writeBundle(bundle, output, sourceMapGenerator2) { + var _a3; + isOwnFileEmit = false; + var previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpers(bundle); + emitSyntheticTripleSlashReferencesIfNeeded(bundle); + for (var _b2 = 0, _c2 = bundle.prepends; _b2 < _c2.length; _b2++) { + var prepend = _c2[_b2]; + writeLine(); + var pos = writer.getTextPos(); + var savedSections = bundleFileInfo && bundleFileInfo.sections; + if (savedSections) + bundleFileInfo.sections = []; + print( + 4, + prepend, + /*sourceFile*/ + void 0 + ); + if (bundleFileInfo) { + var newSections = bundleFileInfo.sections; + bundleFileInfo.sections = savedSections; + if (prepend.oldFileOfCurrentEmit) + (_a3 = bundleFileInfo.sections).push.apply(_a3, newSections); + else { + newSections.forEach(function(section) { + return ts2.Debug.assert(ts2.isBundleFileTextLike(section)); + }); + bundleFileInfo.sections.push({ + pos, + end: writer.getTextPos(), + kind: "prepend", + data: relativeToBuildInfo(prepend.fileName), + texts: newSections + }); + } + } + } + sourceFileTextPos = getTextPosWithWriteLine(); + for (var _d = 0, _e2 = bundle.sourceFiles; _d < _e2.length; _d++) { + var sourceFile = _e2[_d]; + print(0, sourceFile, sourceFile); + } + if (bundleFileInfo && bundle.sourceFiles.length) { + var end = writer.getTextPos(); + if (recordBundleFileTextLikeSection(end)) { + var prologues = getPrologueDirectivesFromBundledSourceFiles(bundle); + if (prologues) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.prologues = prologues; + } + var helpers = getHelpersFromBundledSourceFiles(bundle); + if (helpers) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.helpers = helpers; + } + } + } + reset(); + writer = previousWriter; + } + function writeUnparsedSource(unparsed, output) { + var previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print( + 4, + unparsed, + /*sourceFile*/ + void 0 + ); + reset(); + writer = previousWriter; + } + function writeFile2(sourceFile, output, sourceMapGenerator2) { + isOwnFileEmit = true; + var previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0, sourceFile, sourceFile); + reset(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = ts2.createTextWriter(newLine)); + } + function endPrint() { + var text = ownWriter.getText(); + ownWriter.clear(); + return text; + } + function print(hint, node, sourceFile) { + if (sourceFile) { + setSourceFile(sourceFile); + } + pipelineEmit( + hint, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + if (sourceFile) { + setSourceMapSource(sourceFile); + } + } + function setWriter(_writer, _sourceMapGenerator) { + if (_writer && printerOptions.omitTrailingSemicolon) { + _writer = ts2.getTrailingSemicolonDeferringWriter(_writer); + } + writer = _writer; + sourceMapGenerator = _sourceMapGenerator; + sourceMapsDisabled = !writer || !sourceMapGenerator; + } + function reset() { + nodeIdToGeneratedName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = new ts2.Set(); + formattedNameTempFlagsStack = []; + formattedNameTempFlags = new ts2.Map(); + privateNameTempFlagsStack = []; + privateNameTempFlags = 0; + tempFlagsStack = []; + tempFlags = 0; + reservedNamesStack = []; + currentSourceFile = void 0; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + setWriter( + /*output*/ + void 0, + /*_sourceMapGenerator*/ + void 0 + ); + } + function getCurrentLineMap() { + return currentLineMap || (currentLineMap = ts2.getLineStarts(ts2.Debug.checkDefined(currentSourceFile))); + } + function emit3(node, parenthesizerRule) { + if (node === void 0) + return; + var prevSourceFileTextKind = recordBundleFileInternalSectionStart(node); + pipelineEmit(4, node, parenthesizerRule); + recordBundleFileInternalSectionEnd(prevSourceFileTextKind); + } + function emitIdentifierName(node) { + if (node === void 0) + return; + pipelineEmit( + 2, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function emitExpression(node, parenthesizerRule) { + if (node === void 0) + return; + pipelineEmit(1, node, parenthesizerRule); + } + function emitJsxAttributeValue(node) { + pipelineEmit(ts2.isStringLiteral(node) ? 6 : 4, node); + } + function beforeEmitNode(node) { + if (preserveSourceNewlines && ts2.getEmitFlags(node) & 134217728) { + preserveSourceNewlines = false; + } + } + function afterEmitNode(savedPreserveSourceNewlines) { + preserveSourceNewlines = savedPreserveSourceNewlines; + } + function pipelineEmit(emitHint, node, parenthesizerRule) { + currentParenthesizerRule = parenthesizerRule; + var pipelinePhase = getPipelinePhase(0, emitHint, node); + pipelinePhase(emitHint, node); + currentParenthesizerRule = void 0; + } + function shouldEmitComments(node) { + return !commentsDisabled && !ts2.isSourceFile(node); + } + function shouldEmitSourceMaps(node) { + return !sourceMapsDisabled && !ts2.isSourceFile(node) && !ts2.isInJsonFile(node) && !ts2.isUnparsedSource(node) && !ts2.isUnparsedPrepend(node); + } + function getPipelinePhase(phase, emitHint, node) { + switch (phase) { + case 0: + if (onEmitNode !== ts2.noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { + return pipelineEmitWithNotification; + } + case 1: + if (substituteNode !== ts2.noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { + if (currentParenthesizerRule) { + lastSubstitution = currentParenthesizerRule(lastSubstitution); + } + return pipelineEmitWithSubstitution; + } + case 2: + if (shouldEmitComments(node)) { + return pipelineEmitWithComments; + } + case 3: + if (shouldEmitSourceMaps(node)) { + return pipelineEmitWithSourceMaps; + } + case 4: + return pipelineEmitWithHint; + default: + return ts2.Debug.assertNever(phase); + } + } + function getNextPipelinePhase(currentPhase, emitHint, node) { + return getPipelinePhase(currentPhase + 1, emitHint, node); + } + function pipelineEmitWithNotification(hint, node) { + var pipelinePhase = getNextPipelinePhase(0, hint, node); + onEmitNode(hint, node, pipelinePhase); + } + function pipelineEmitWithHint(hint, node) { + onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(node); + if (preserveSourceNewlines) { + var savedPreserveSourceNewlines = preserveSourceNewlines; + beforeEmitNode(node); + pipelineEmitWithHintWorker(hint, node); + afterEmitNode(savedPreserveSourceNewlines); + } else { + pipelineEmitWithHintWorker(hint, node); + } + onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node); + currentParenthesizerRule = void 0; + } + function pipelineEmitWithHintWorker(hint, node, allowSnippets) { + if (allowSnippets === void 0) { + allowSnippets = true; + } + if (allowSnippets) { + var snippet2 = ts2.getSnippetElement(node); + if (snippet2) { + return emitSnippetNode(hint, node, snippet2); + } + } + if (hint === 0) + return emitSourceFile(ts2.cast(node, ts2.isSourceFile)); + if (hint === 2) + return emitIdentifier(ts2.cast(node, ts2.isIdentifier)); + if (hint === 6) + return emitLiteral( + ts2.cast(node, ts2.isStringLiteral), + /*jsxAttributeEscape*/ + true + ); + if (hint === 3) + return emitMappedTypeParameter(ts2.cast(node, ts2.isTypeParameterDeclaration)); + if (hint === 5) { + ts2.Debug.assertNode(node, ts2.isEmptyStatement); + return emitEmptyStatement( + /*isEmbeddedStatement*/ + true + ); + } + if (hint === 4) { + switch (node.kind) { + case 15: + case 16: + case 17: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 79: + return emitIdentifier(node); + case 80: + return emitPrivateIdentifier(node); + case 163: + return emitQualifiedName(node); + case 164: + return emitComputedPropertyName(node); + case 165: + return emitTypeParameter(node); + case 166: + return emitParameter(node); + case 167: + return emitDecorator(node); + case 168: + return emitPropertySignature(node); + case 169: + return emitPropertyDeclaration(node); + case 170: + return emitMethodSignature(node); + case 171: + return emitMethodDeclaration(node); + case 172: + return emitClassStaticBlockDeclaration(node); + case 173: + return emitConstructor(node); + case 174: + case 175: + return emitAccessorDeclaration(node); + case 176: + return emitCallSignature(node); + case 177: + return emitConstructSignature(node); + case 178: + return emitIndexSignature(node); + case 179: + return emitTypePredicate(node); + case 180: + return emitTypeReference(node); + case 181: + return emitFunctionType(node); + case 182: + return emitConstructorType(node); + case 183: + return emitTypeQuery(node); + case 184: + return emitTypeLiteral(node); + case 185: + return emitArrayType(node); + case 186: + return emitTupleType(node); + case 187: + return emitOptionalType(node); + case 189: + return emitUnionType(node); + case 190: + return emitIntersectionType(node); + case 191: + return emitConditionalType(node); + case 192: + return emitInferType(node); + case 193: + return emitParenthesizedType(node); + case 230: + return emitExpressionWithTypeArguments(node); + case 194: + return emitThisType(); + case 195: + return emitTypeOperator(node); + case 196: + return emitIndexedAccessType(node); + case 197: + return emitMappedType(node); + case 198: + return emitLiteralType(node); + case 199: + return emitNamedTupleMember(node); + case 200: + return emitTemplateType(node); + case 201: + return emitTemplateTypeSpan(node); + case 202: + return emitImportTypeNode(node); + case 203: + return emitObjectBindingPattern(node); + case 204: + return emitArrayBindingPattern(node); + case 205: + return emitBindingElement(node); + case 236: + return emitTemplateSpan(node); + case 237: + return emitSemicolonClassElement(); + case 238: + return emitBlock(node); + case 240: + return emitVariableStatement(node); + case 239: + return emitEmptyStatement( + /*isEmbeddedStatement*/ + false + ); + case 241: + return emitExpressionStatement(node); + case 242: + return emitIfStatement(node); + case 243: + return emitDoStatement(node); + case 244: + return emitWhileStatement(node); + case 245: + return emitForStatement(node); + case 246: + return emitForInStatement(node); + case 247: + return emitForOfStatement(node); + case 248: + return emitContinueStatement(node); + case 249: + return emitBreakStatement(node); + case 250: + return emitReturnStatement(node); + case 251: + return emitWithStatement(node); + case 252: + return emitSwitchStatement(node); + case 253: + return emitLabeledStatement(node); + case 254: + return emitThrowStatement(node); + case 255: + return emitTryStatement(node); + case 256: + return emitDebuggerStatement(node); + case 257: + return emitVariableDeclaration(node); + case 258: + return emitVariableDeclarationList(node); + case 259: + return emitFunctionDeclaration(node); + case 260: + return emitClassDeclaration(node); + case 261: + return emitInterfaceDeclaration(node); + case 262: + return emitTypeAliasDeclaration(node); + case 263: + return emitEnumDeclaration(node); + case 264: + return emitModuleDeclaration(node); + case 265: + return emitModuleBlock(node); + case 266: + return emitCaseBlock(node); + case 267: + return emitNamespaceExportDeclaration(node); + case 268: + return emitImportEqualsDeclaration(node); + case 269: + return emitImportDeclaration(node); + case 270: + return emitImportClause(node); + case 271: + return emitNamespaceImport(node); + case 277: + return emitNamespaceExport(node); + case 272: + return emitNamedImports(node); + case 273: + return emitImportSpecifier(node); + case 274: + return emitExportAssignment(node); + case 275: + return emitExportDeclaration(node); + case 276: + return emitNamedExports(node); + case 278: + return emitExportSpecifier(node); + case 296: + return emitAssertClause(node); + case 297: + return emitAssertEntry(node); + case 279: + return; + case 280: + return emitExternalModuleReference(node); + case 11: + return emitJsxText(node); + case 283: + case 286: + return emitJsxOpeningElementOrFragment(node); + case 284: + case 287: + return emitJsxClosingElementOrFragment(node); + case 288: + return emitJsxAttribute(node); + case 289: + return emitJsxAttributes(node); + case 290: + return emitJsxSpreadAttribute(node); + case 291: + return emitJsxExpression(node); + case 292: + return emitCaseClause(node); + case 293: + return emitDefaultClause(node); + case 294: + return emitHeritageClause(node); + case 295: + return emitCatchClause(node); + case 299: + return emitPropertyAssignment(node); + case 300: + return emitShorthandPropertyAssignment(node); + case 301: + return emitSpreadAssignment(node); + case 302: + return emitEnumMember(node); + case 303: + return writeUnparsedNode(node); + case 310: + case 304: + return emitUnparsedSourceOrPrepend(node); + case 305: + case 306: + return emitUnparsedTextLike(node); + case 307: + return emitUnparsedSyntheticReference(node); + case 308: + return emitSourceFile(node); + case 309: + return ts2.Debug.fail("Bundles should be printed using printBundle"); + case 311: + return ts2.Debug.fail("InputFiles should not be printed"); + case 312: + return emitJSDocTypeExpression(node); + case 313: + return emitJSDocNameReference(node); + case 315: + return writePunctuation("*"); + case 316: + return writePunctuation("?"); + case 317: + return emitJSDocNullableType(node); + case 318: + return emitJSDocNonNullableType(node); + case 319: + return emitJSDocOptionalType(node); + case 320: + return emitJSDocFunctionType(node); + case 188: + case 321: + return emitRestOrJSDocVariadicType(node); + case 322: + return; + case 323: + return emitJSDoc(node); + case 325: + return emitJSDocTypeLiteral(node); + case 326: + return emitJSDocSignature(node); + case 330: + case 335: + case 340: + return emitJSDocSimpleTag(node); + case 331: + case 332: + return emitJSDocHeritageTag(node); + case 333: + case 334: + return; + case 336: + case 337: + case 338: + case 339: + return; + case 341: + return emitJSDocCallbackTag(node); + case 343: + case 350: + return emitJSDocPropertyLikeTag(node); + case 342: + case 344: + case 345: + case 346: + return emitJSDocSimpleTypedTag(node); + case 347: + return emitJSDocTemplateTag(node); + case 348: + return emitJSDocTypedefTag(node); + case 349: + return emitJSDocSeeTag(node); + case 352: + case 356: + case 355: + return; + } + if (ts2.isExpression(node)) { + hint = 1; + if (substituteNode !== ts2.noEmitSubstitution) { + var substitute = substituteNode(hint, node) || node; + if (substitute !== node) { + node = substitute; + if (currentParenthesizerRule) { + node = currentParenthesizerRule(node); + } + } + } + } + } + if (hint === 1) { + switch (node.kind) { + case 8: + case 9: + return emitNumericOrBigIntLiteral(node); + case 10: + case 13: + case 14: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 79: + return emitIdentifier(node); + case 80: + return emitPrivateIdentifier(node); + case 206: + return emitArrayLiteralExpression(node); + case 207: + return emitObjectLiteralExpression(node); + case 208: + return emitPropertyAccessExpression(node); + case 209: + return emitElementAccessExpression(node); + case 210: + return emitCallExpression(node); + case 211: + return emitNewExpression(node); + case 212: + return emitTaggedTemplateExpression(node); + case 213: + return emitTypeAssertionExpression(node); + case 214: + return emitParenthesizedExpression(node); + case 215: + return emitFunctionExpression(node); + case 216: + return emitArrowFunction(node); + case 217: + return emitDeleteExpression(node); + case 218: + return emitTypeOfExpression(node); + case 219: + return emitVoidExpression(node); + case 220: + return emitAwaitExpression(node); + case 221: + return emitPrefixUnaryExpression(node); + case 222: + return emitPostfixUnaryExpression(node); + case 223: + return emitBinaryExpression(node); + case 224: + return emitConditionalExpression(node); + case 225: + return emitTemplateExpression(node); + case 226: + return emitYieldExpression(node); + case 227: + return emitSpreadElement(node); + case 228: + return emitClassExpression(node); + case 229: + return; + case 231: + return emitAsExpression(node); + case 232: + return emitNonNullExpression(node); + case 230: + return emitExpressionWithTypeArguments(node); + case 235: + return emitSatisfiesExpression(node); + case 233: + return emitMetaProperty(node); + case 234: + return ts2.Debug.fail("SyntheticExpression should never be printed."); + case 281: + return emitJsxElement(node); + case 282: + return emitJsxSelfClosingElement(node); + case 285: + return emitJsxFragment(node); + case 351: + return ts2.Debug.fail("SyntaxList should not be printed"); + case 352: + return; + case 353: + return emitPartiallyEmittedExpression(node); + case 354: + return emitCommaList(node); + case 355: + case 356: + return; + case 357: + return ts2.Debug.fail("SyntheticReferenceExpression should not be printed"); + } + } + if (ts2.isKeyword(node.kind)) + return writeTokenNode(node, writeKeyword); + if (ts2.isTokenKind(node.kind)) + return writeTokenNode(node, writePunctuation); + ts2.Debug.fail("Unhandled SyntaxKind: ".concat(ts2.Debug.formatSyntaxKind(node.kind), ".")); + } + function emitMappedTypeParameter(node) { + emit3(node.name); + writeSpace(); + writeKeyword("in"); + writeSpace(); + emit3(node.constraint); + } + function pipelineEmitWithSubstitution(hint, node) { + var pipelinePhase = getNextPipelinePhase(1, hint, node); + ts2.Debug.assertIsDefined(lastSubstitution); + node = lastSubstitution; + lastSubstitution = void 0; + pipelinePhase(hint, node); + } + function getHelpersFromBundledSourceFiles(bundle) { + var result2; + if (moduleKind === ts2.ModuleKind.None || printerOptions.noEmitHelpers) { + return void 0; + } + var bundledHelpers2 = new ts2.Map(); + for (var _a3 = 0, _b2 = bundle.sourceFiles; _a3 < _b2.length; _a3++) { + var sourceFile = _b2[_a3]; + var shouldSkip = ts2.getExternalHelpersModuleName(sourceFile) !== void 0; + var helpers = getSortedEmitHelpers(sourceFile); + if (!helpers) + continue; + for (var _c2 = 0, helpers_5 = helpers; _c2 < helpers_5.length; _c2++) { + var helper = helpers_5[_c2]; + if (!helper.scoped && !shouldSkip && !bundledHelpers2.get(helper.name)) { + bundledHelpers2.set(helper.name, true); + (result2 || (result2 = [])).push(helper.name); + } + } + } + return result2; + } + function emitHelpers(node) { + var helpersEmitted = false; + var bundle = node.kind === 309 ? node : void 0; + if (bundle && moduleKind === ts2.ModuleKind.None) { + return; + } + var numPrepends = bundle ? bundle.prepends.length : 0; + var numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; + for (var i7 = 0; i7 < numNodes; i7++) { + var currentNode = bundle ? i7 < numPrepends ? bundle.prepends[i7] : bundle.sourceFiles[i7 - numPrepends] : node; + var sourceFile = ts2.isSourceFile(currentNode) ? currentNode : ts2.isUnparsedSource(currentNode) ? void 0 : currentSourceFile; + var shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && ts2.hasRecordedExternalHelpers(sourceFile); + var shouldBundle = (ts2.isSourceFile(currentNode) || ts2.isUnparsedSource(currentNode)) && !isOwnFileEmit; + var helpers = ts2.isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); + if (helpers) { + for (var _a3 = 0, helpers_6 = helpers; _a3 < helpers_6.length; _a3++) { + var helper = helpers_6[_a3]; + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } else if (bundle) { + continue; + } + var pos = getTextPosWithWriteLine(); + if (typeof helper.text === "string") { + writeLines(helper.text); + } else { + writeLines(helper.text(makeFileLevelOptimisticUniqueName)); + } + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "emitHelpers", data: helper.name }); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + function getSortedEmitHelpers(node) { + var helpers = ts2.getEmitHelpers(node); + return helpers && ts2.stableSort(helpers, ts2.compareEmitHelpers); + } + function emitNumericOrBigIntLiteral(node) { + emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + } + function emitLiteral(node, jsxAttributeEscape) { + var text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape); + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 10 || ts2.isTemplateLiteralKind(node.kind))) { + writeLiteral(text); + } else { + writeStringLiteral(text); + } + } + function emitUnparsedSourceOrPrepend(unparsed) { + for (var _a3 = 0, _b2 = unparsed.texts; _a3 < _b2.length; _a3++) { + var text = _b2[_a3]; + writeLine(); + emit3(text); + } + } + function writeUnparsedNode(unparsed) { + writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end)); + } + function emitUnparsedTextLike(unparsed) { + var pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + updateOrPushBundleFileTextLike( + pos, + writer.getTextPos(), + unparsed.kind === 305 ? "text" : "internal" + /* BundleFileSectionKind.Internal */ + ); + } + } + function emitUnparsedSyntheticReference(unparsed) { + var pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + var section = ts2.clone(unparsed.section); + section.pos = pos; + section.end = writer.getTextPos(); + bundleFileInfo.sections.push(section); + } + } + function emitSnippetNode(hint, node, snippet2) { + switch (snippet2.kind) { + case 1: + emitPlaceholder(hint, node, snippet2); + break; + case 0: + emitTabStop(hint, node, snippet2); + break; + } + } + function emitPlaceholder(hint, node, snippet2) { + nonEscapingWrite("${".concat(snippet2.order, ":")); + pipelineEmitWithHintWorker( + hint, + node, + /*allowSnippets*/ + false + ); + nonEscapingWrite("}"); + } + function emitTabStop(hint, node, snippet2) { + ts2.Debug.assert(node.kind === 239, "A tab stop cannot be attached to a node of kind ".concat(ts2.Debug.formatSyntaxKind(node.kind), ".")); + ts2.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement."); + nonEscapingWrite("$".concat(snippet2.order)); + } + function emitIdentifier(node) { + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode( + node, + /*includeTrivia*/ + false + ), node.symbol); + emitList( + node, + node.typeArguments, + 53776 + /* ListFormat.TypeParameters */ + ); + } + function emitPrivateIdentifier(node) { + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode( + node, + /*includeTrivia*/ + false + ), node.symbol); + } + function emitQualifiedName(node) { + emitEntityName(node.left); + writePunctuation("."); + emit3(node.right); + } + function emitEntityName(node) { + if (node.kind === 79) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitComputedPropertyName(node) { + writePunctuation("["); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); + writePunctuation("]"); + } + function emitTypeParameter(node) { + emitModifiers(node, node.modifiers); + emit3(node.name); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit3(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit3(node.default); + } + } + function emitParameter(node) { + emitDecoratorsAndModifiers(node, node.modifiers); + emit3(node.dotDotDotToken); + emitNodeWithWriter(node.name, writeParameter); + emit3(node.questionToken); + if (node.parent && node.parent.kind === 320 && !node.name) { + emit3(node.type); + } else { + emitTypeAnnotation(node.type); + } + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitDecorator(decorator) { + writePunctuation("@"); + emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); + } + function emitPropertySignature(node) { + emitModifiers(node, node.modifiers); + emitNodeWithWriter(node.name, writeProperty); + emit3(node.questionToken); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitPropertyDeclaration(node) { + emitDecoratorsAndModifiers(node, node.modifiers); + emit3(node.name); + emit3(node.questionToken); + emit3(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); + writeTrailingSemicolon(); + } + function emitMethodSignature(node) { + pushNameGenerationScope(node); + emitModifiers(node, node.modifiers); + emit3(node.name); + emit3(node.questionToken); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitMethodDeclaration(node) { + emitDecoratorsAndModifiers(node, node.modifiers); + emit3(node.asteriskToken); + emit3(node.name); + emit3(node.questionToken); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitClassStaticBlockDeclaration(node) { + writeKeyword("static"); + emitBlockFunctionBody(node.body); + } + function emitConstructor(node) { + emitModifiers(node, node.modifiers); + writeKeyword("constructor"); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitAccessorDeclaration(node) { + emitDecoratorsAndModifiers(node, node.modifiers); + writeKeyword(node.kind === 174 ? "get" : "set"); + writeSpace(); + emit3(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitCallSignature(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitConstructSignature(node) { + pushNameGenerationScope(node); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitIndexSignature(node) { + emitModifiers(node, node.modifiers); + emitParametersForIndexSignature(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitTemplateTypeSpan(node) { + emit3(node.type); + emit3(node.literal); + } + function emitSemicolonClassElement() { + writeTrailingSemicolon(); + } + function emitTypePredicate(node) { + if (node.assertsModifier) { + emit3(node.assertsModifier); + writeSpace(); + } + emit3(node.parameterName); + if (node.type) { + writeSpace(); + writeKeyword("is"); + writeSpace(); + emit3(node.type); + } + } + function emitTypeReference(node) { + emit3(node.typeName); + emitTypeArguments(node, node.typeArguments); + } + function emitFunctionType(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit3(node.type); + popNameGenerationScope(node); + } + function emitJSDocFunctionType(node) { + writeKeyword("function"); + emitParameters(node, node.parameters); + writePunctuation(":"); + emit3(node.type); + } + function emitJSDocNullableType(node) { + writePunctuation("?"); + emit3(node.type); + } + function emitJSDocNonNullableType(node) { + writePunctuation("!"); + emit3(node.type); + } + function emitJSDocOptionalType(node) { + emit3(node.type); + writePunctuation("="); + } + function emitConstructorType(node) { + pushNameGenerationScope(node); + emitModifiers(node, node.modifiers); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit3(node.type); + popNameGenerationScope(node); + } + function emitTypeQuery(node) { + writeKeyword("typeof"); + writeSpace(); + emit3(node.exprName); + emitTypeArguments(node, node.typeArguments); + } + function emitTypeLiteral(node) { + writePunctuation("{"); + var flags = ts2.getEmitFlags(node) & 1 ? 768 : 32897; + emitList( + node, + node.members, + flags | 524288 + /* ListFormat.NoSpaceIfEmpty */ + ); + writePunctuation("}"); + } + function emitArrayType(node) { + emit3(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + writePunctuation("]"); + } + function emitRestOrJSDocVariadicType(node) { + writePunctuation("..."); + emit3(node.type); + } + function emitTupleType(node) { + emitTokenWithComment(22, node.pos, writePunctuation, node); + var flags = ts2.getEmitFlags(node) & 1 ? 528 : 657; + emitList(node, node.elements, flags | 524288, parenthesizer.parenthesizeElementTypeOfTupleType); + emitTokenWithComment(23, node.elements.end, writePunctuation, node); + } + function emitNamedTupleMember(node) { + emit3(node.dotDotDotToken); + emit3(node.name); + emit3(node.questionToken); + emitTokenWithComment(58, node.name.end, writePunctuation, node); + writeSpace(); + emit3(node.type); + } + function emitOptionalType(node) { + emit3(node.type, parenthesizer.parenthesizeTypeOfOptionalType); + writePunctuation("?"); + } + function emitUnionType(node) { + emitList(node, node.types, 516, parenthesizer.parenthesizeConstituentTypeOfUnionType); + } + function emitIntersectionType(node) { + emitList(node, node.types, 520, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); + } + function emitConditionalType(node) { + emit3(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit3(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit3(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit3(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit3(node.typeParameter); + } + function emitParenthesizedType(node) { + writePunctuation("("); + emit3(node.type); + writePunctuation(")"); + } + function emitThisType() { + writeKeyword("this"); + } + function emitTypeOperator(node) { + writeTokenText(node.operator, writeKeyword); + writeSpace(); + var parenthesizerRule = node.operator === 146 ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; + emit3(node.type, parenthesizerRule); + } + function emitIndexedAccessType(node) { + emit3(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + emit3(node.indexType); + writePunctuation("]"); + } + function emitMappedType(node) { + var emitFlags = ts2.getEmitFlags(node); + writePunctuation("{"); + if (emitFlags & 1) { + writeSpace(); + } else { + writeLine(); + increaseIndent(); + } + if (node.readonlyToken) { + emit3(node.readonlyToken); + if (node.readonlyToken.kind !== 146) { + writeKeyword("readonly"); + } + writeSpace(); + } + writePunctuation("["); + pipelineEmit(3, node.typeParameter); + if (node.nameType) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit3(node.nameType); + } + writePunctuation("]"); + if (node.questionToken) { + emit3(node.questionToken); + if (node.questionToken.kind !== 57) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); + emit3(node.type); + writeTrailingSemicolon(); + if (emitFlags & 1) { + writeSpace(); + } else { + writeLine(); + decreaseIndent(); + } + emitList( + node, + node.members, + 2 + /* ListFormat.PreserveLines */ + ); + writePunctuation("}"); + } + function emitLiteralType(node) { + emitExpression(node.literal); + } + function emitTemplateType(node) { + emit3(node.head); + emitList( + node, + node.templateSpans, + 262144 + /* ListFormat.TemplateExpressionSpans */ + ); + } + function emitImportTypeNode(node) { + if (node.isTypeOf) { + writeKeyword("typeof"); + writeSpace(); + } + writeKeyword("import"); + writePunctuation("("); + emit3(node.argument); + if (node.assertions) { + writePunctuation(","); + writeSpace(); + writePunctuation("{"); + writeSpace(); + writeKeyword("assert"); + writePunctuation(":"); + writeSpace(); + var elements = node.assertions.assertClause.elements; + emitList( + node.assertions.assertClause, + elements, + 526226 + /* ListFormat.ImportClauseEntries */ + ); + writeSpace(); + writePunctuation("}"); + } + writePunctuation(")"); + if (node.qualifier) { + writePunctuation("."); + emit3(node.qualifier); + } + emitTypeArguments(node, node.typeArguments); + } + function emitObjectBindingPattern(node) { + writePunctuation("{"); + emitList( + node, + node.elements, + 525136 + /* ListFormat.ObjectBindingPatternElements */ + ); + writePunctuation("}"); + } + function emitArrayBindingPattern(node) { + writePunctuation("["); + emitList( + node, + node.elements, + 524880 + /* ListFormat.ArrayBindingPatternElements */ + ); + writePunctuation("]"); + } + function emitBindingElement(node) { + emit3(node.dotDotDotToken); + if (node.propertyName) { + emit3(node.propertyName); + writePunctuation(":"); + writeSpace(); + } + emit3(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitArrayLiteralExpression(node) { + var elements = node.elements; + var preferNewLine = node.multiLine ? 65536 : 0; + emitExpressionList(node, elements, 8914 | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitObjectLiteralExpression(node) { + ts2.forEach(node.properties, generateMemberNames); + var indentedFlag = ts2.getEmitFlags(node) & 65536; + if (indentedFlag) { + increaseIndent(); + } + var preferNewLine = node.multiLine ? 65536 : 0; + var allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 && !ts2.isJsonSourceFile(currentSourceFile) ? 64 : 0; + emitList(node, node.properties, 526226 | allowTrailingComma | preferNewLine); + if (indentedFlag) { + decreaseIndent(); + } + } + function emitPropertyAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + var token = node.questionDotToken || ts2.setTextRangePosEnd(ts2.factory.createToken( + 24 + /* SyntaxKind.DotToken */ + ), node.expression.end, node.name.pos); + var linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); + var linesAfterDot = getLinesBetweenNodes(node, token, node.name); + writeLinesAndIndent( + linesBeforeDot, + /*writeSpaceIfNotIndenting*/ + false + ); + var shouldEmitDotDot = token.kind !== 28 && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); + if (shouldEmitDotDot) { + writePunctuation("."); + } + if (node.questionDotToken) { + emit3(token); + } else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } + writeLinesAndIndent( + linesAfterDot, + /*writeSpaceIfNotIndenting*/ + false + ); + emit3(node.name); + decreaseIndentIf(linesBeforeDot, linesAfterDot); + } + function mayNeedDotDotForPropertyAccess(expression) { + expression = ts2.skipPartiallyEmittedExpressions(expression); + if (ts2.isNumericLiteral(expression)) { + var text = getLiteralTextOfNode( + expression, + /*neverAsciiEscape*/ + true, + /*jsxAttributeEscape*/ + false + ); + return !expression.numericLiteralFlags && !ts2.stringContains(text, ts2.tokenToString( + 24 + /* SyntaxKind.DotToken */ + )); + } else if (ts2.isAccessExpression(expression)) { + var constantValue = ts2.getConstantValue(expression); + return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue; + } + } + function emitElementAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emit3(node.questionDotToken); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + emitExpression(node.argumentExpression); + emitTokenWithComment(23, node.argumentExpression.end, writePunctuation, node); + } + function emitCallExpression(node) { + var indirectCall = ts2.getEmitFlags(node) & 536870912; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emit3(node.questionDotToken); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 2576, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitNewExpression(node) { + emitTokenWithComment(103, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 18960, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitTaggedTemplateExpression(node) { + var indirectCall = ts2.getEmitFlags(node) & 536870912; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emitExpression(node.template); + } + function emitTypeAssertionExpression(node) { + writePunctuation("<"); + emit3(node.type); + writePunctuation(">"); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitParenthesizedExpression(node) { + var openParenPos = emitTokenWithComment(20, node.pos, writePunctuation, node); + var indented = writeLineSeparatorsAndIndentBefore(node.expression, node); + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + writeLineSeparatorsAfter(node.expression, node); + decreaseIndentIf(indented); + emitTokenWithComment(21, node.expression ? node.expression.end : openParenPos, writePunctuation, node); + } + function emitFunctionExpression(node) { + generateNameIfNeeded(node.name); + emitFunctionDeclarationOrExpression(node); + } + function emitArrowFunction(node) { + emitModifiers(node, node.modifiers); + emitSignatureAndBody(node, emitArrowFunctionHead); + } + function emitArrowFunctionHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + emitTypeAnnotation(node.type); + writeSpace(); + emit3(node.equalsGreaterThanToken); + } + function emitDeleteExpression(node) { + emitTokenWithComment(89, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitTypeOfExpression(node) { + emitTokenWithComment(112, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitVoidExpression(node) { + emitTokenWithComment(114, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitAwaitExpression(node) { + emitTokenWithComment(133, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitPrefixUnaryExpression(node) { + writeTokenText(node.operator, writeOperator); + if (shouldEmitWhitespaceBeforeOperand(node)) { + writeSpace(); + } + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function shouldEmitWhitespaceBeforeOperand(node) { + var operand = node.operand; + return operand.kind === 221 && (node.operator === 39 && (operand.operator === 39 || operand.operator === 45) || node.operator === 40 && (operand.operator === 40 || operand.operator === 46)); + } + function emitPostfixUnaryExpression(node) { + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); + writeTokenText(node.operator, writeOperator); + } + function createEmitBinaryExpression() { + return ts2.createBinaryExpressionTrampoline( + onEnter, + onLeft, + onOperator, + onRight, + onExit, + /*foldState*/ + void 0 + ); + function onEnter(node, state) { + if (state) { + state.stackIndex++; + state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; + state.containerPosStack[state.stackIndex] = containerPos; + state.containerEndStack[state.stackIndex] = containerEnd; + state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; + var emitComments_1 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); + var emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); + onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(node); + if (emitComments_1) + emitCommentsBeforeNode(node); + if (emitSourceMaps) + emitSourceMapsBeforeNode(node); + beforeEmitNode(node); + } else { + state = { + stackIndex: 0, + preserveSourceNewlinesStack: [void 0], + containerPosStack: [-1], + containerEndStack: [-1], + declarationListContainerEndStack: [-1], + shouldEmitCommentsStack: [false], + shouldEmitSourceMapsStack: [false] + }; + } + return state; + } + function onLeft(next, _workArea, parent2) { + return maybeEmitExpression(next, parent2, "left"); + } + function onOperator(operatorToken, _state, node) { + var isCommaOperator = operatorToken.kind !== 27; + var linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); + var linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); + writeLinesAndIndent(linesBeforeOperator, isCommaOperator); + emitLeadingCommentsOfPosition(operatorToken.pos); + writeTokenNode(operatorToken, operatorToken.kind === 101 ? writeKeyword : writeOperator); + emitTrailingCommentsOfPosition( + operatorToken.end, + /*prefixSpace*/ + true + ); + writeLinesAndIndent( + linesAfterOperator, + /*writeSpaceIfNotIndenting*/ + true + ); + } + function onRight(next, _workArea, parent2) { + return maybeEmitExpression(next, parent2, "right"); + } + function onExit(node, state) { + var linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); + var linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); + decreaseIndentIf(linesBeforeOperator, linesAfterOperator); + if (state.stackIndex > 0) { + var savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; + var savedContainerPos = state.containerPosStack[state.stackIndex]; + var savedContainerEnd = state.containerEndStack[state.stackIndex]; + var savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; + var shouldEmitComments_1 = state.shouldEmitCommentsStack[state.stackIndex]; + var shouldEmitSourceMaps_1 = state.shouldEmitSourceMapsStack[state.stackIndex]; + afterEmitNode(savedPreserveSourceNewlines); + if (shouldEmitSourceMaps_1) + emitSourceMapsAfterNode(node); + if (shouldEmitComments_1) + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(node); + state.stackIndex--; + } + } + function maybeEmitExpression(next, parent2, side) { + var parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent2.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent2.operatorToken.kind); + var pipelinePhase = getPipelinePhase(0, 1, next); + if (pipelinePhase === pipelineEmitWithSubstitution) { + ts2.Debug.assertIsDefined(lastSubstitution); + next = parenthesizerRule(ts2.cast(lastSubstitution, ts2.isExpression)); + pipelinePhase = getNextPipelinePhase(1, 1, next); + lastSubstitution = void 0; + } + if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { + if (ts2.isBinaryExpression(next)) { + return next; + } + } + currentParenthesizerRule = parenthesizerRule; + pipelinePhase(1, next); + } + } + function emitConditionalExpression(node) { + var linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); + var linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); + var linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); + var linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); + emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); + writeLinesAndIndent( + linesBeforeQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emit3(node.questionToken); + writeLinesAndIndent( + linesAfterQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); + writeLinesAndIndent( + linesBeforeColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emit3(node.colonToken); + writeLinesAndIndent( + linesAfterColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeColon, linesAfterColon); + } + function emitTemplateExpression(node) { + emit3(node.head); + emitList( + node, + node.templateSpans, + 262144 + /* ListFormat.TemplateExpressionSpans */ + ); + } + function emitYieldExpression(node) { + emitTokenWithComment(125, node.pos, writeKeyword, node); + emit3(node.asteriskToken); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); + } + function emitSpreadElement(node) { + emitTokenWithComment(25, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitClassExpression(node) { + generateNameIfNeeded(node.name); + emitClassDeclarationOrExpression(node); + } + function emitExpressionWithTypeArguments(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emitTypeArguments(node, node.typeArguments); + } + function emitAsExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit3(node.type); + } + } + function emitNonNullExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + writeOperator("!"); + } + function emitSatisfiesExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRules*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("satisfies"); + writeSpace(); + emit3(node.type); + } + } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); + emit3(node.name); + } + function emitTemplateSpan(node) { + emitExpression(node.expression); + emit3(node.literal); + } + function emitBlock(node) { + emitBlockStatements( + node, + /*forceSingleLine*/ + !node.multiLine && isEmptyBlock(node) + ); + } + function emitBlockStatements(node, forceSingleLine) { + emitTokenWithComment( + 18, + node.pos, + writePunctuation, + /*contextNode*/ + node + ); + var format5 = forceSingleLine || ts2.getEmitFlags(node) & 1 ? 768 : 129; + emitList(node, node.statements, format5); + emitTokenWithComment( + 19, + node.statements.end, + writePunctuation, + /*contextNode*/ + node, + /*indentLeading*/ + !!(format5 & 1) + ); + } + function emitVariableStatement(node) { + emitModifiers(node, node.modifiers); + emit3(node.declarationList); + writeTrailingSemicolon(); + } + function emitEmptyStatement(isEmbeddedStatement) { + if (isEmbeddedStatement) { + writePunctuation(";"); + } else { + writeTrailingSemicolon(); + } + } + function emitExpressionStatement(node) { + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); + if (!currentSourceFile || !ts2.isJsonSourceFile(currentSourceFile) || ts2.nodeIsSynthesized(node.expression)) { + writeTrailingSemicolon(); + } + } + function emitIfStatement(node) { + var openParenPos = emitTokenWithComment(99, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.thenStatement); + if (node.elseStatement) { + writeLineOrSpace(node, node.thenStatement, node.elseStatement); + emitTokenWithComment(91, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 242) { + writeSpace(); + emit3(node.elseStatement); + } else { + emitEmbeddedStatement(node, node.elseStatement); + } + } + } + function emitWhileClause(node, startPos) { + var openParenPos = emitTokenWithComment(115, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + } + function emitDoStatement(node) { + emitTokenWithComment(90, node.pos, writeKeyword, node); + emitEmbeddedStatement(node, node.statement); + if (ts2.isBlock(node.statement) && !preserveSourceNewlines) { + writeSpace(); + } else { + writeLineOrSpace(node, node.statement, node.expression); + } + emitWhileClause(node, node.statement.end); + writeTrailingSemicolon(); + } + function emitWhileStatement(node) { + emitWhileClause(node, node.pos); + emitEmbeddedStatement(node, node.statement); + } + function emitForStatement(node) { + var openParenPos = emitTokenWithComment(97, node.pos, writeKeyword, node); + writeSpace(); + var pos = emitTokenWithComment( + 20, + openParenPos, + writePunctuation, + /*contextNode*/ + node + ); + emitForBinding(node.initializer); + pos = emitTokenWithComment(26, node.initializer ? node.initializer.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.condition); + pos = emitTokenWithComment(26, node.condition ? node.condition.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.incrementor); + emitTokenWithComment(21, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForInStatement(node) { + var openParenPos = emitTokenWithComment(97, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(101, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForOfStatement(node) { + var openParenPos = emitTokenWithComment(97, node.pos, writeKeyword, node); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(162, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForBinding(node) { + if (node !== void 0) { + if (node.kind === 258) { + emit3(node); + } else { + emitExpression(node); + } + } + } + function emitContinueStatement(node) { + emitTokenWithComment(86, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitBreakStatement(node) { + emitTokenWithComment(81, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { + var node = ts2.getParseTreeNode(contextNode); + var isSimilarNode = node && node.kind === contextNode.kind; + var startPos = pos; + if (isSimilarNode && currentSourceFile) { + pos = ts2.skipTrivia(currentSourceFile.text, pos); + } + if (isSimilarNode && contextNode.pos !== startPos) { + var needsIndent = indentLeading && currentSourceFile && !ts2.positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + pos = writeTokenText(token, writer2, pos); + if (isSimilarNode && contextNode.end !== pos) { + var isJsxExprContext = contextNode.kind === 291; + emitTrailingCommentsOfPosition( + pos, + /*prefixSpace*/ + !isJsxExprContext, + /*forceNoNewline*/ + isJsxExprContext + ); + } + return pos; + } + function commentWillEmitNewLine(node) { + return node.kind === 2 || !!node.hasTrailingNewLine; + } + function willEmitLeadingNewLine(node) { + if (!currentSourceFile) + return false; + if (ts2.some(ts2.getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine)) + return true; + if (ts2.some(ts2.getSyntheticLeadingComments(node), commentWillEmitNewLine)) + return true; + if (ts2.isPartiallyEmittedExpression(node)) { + if (node.pos !== node.expression.pos) { + if (ts2.some(ts2.getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) + return true; + } + return willEmitLeadingNewLine(node.expression); + } + return false; + } + function parenthesizeExpressionForNoAsi(node) { + if (!commentsDisabled && ts2.isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { + var parseNode = ts2.getParseTreeNode(node); + if (parseNode && ts2.isParenthesizedExpression(parseNode)) { + var parens = ts2.factory.createParenthesizedExpression(node.expression); + ts2.setOriginalNode(parens, node); + ts2.setTextRange(parens, parseNode); + return parens; + } + return ts2.factory.createParenthesizedExpression(node); + } + return node; + } + function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { + return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); + } + function emitReturnStatement(node) { + emitTokenWithComment( + 105, + node.pos, + writeKeyword, + /*contextNode*/ + node + ); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitWithStatement(node) { + var openParenPos = emitTokenWithComment(116, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitSwitchStatement(node) { + var openParenPos = emitTokenWithComment(107, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(21, node.expression.end, writePunctuation, node); + writeSpace(); + emit3(node.caseBlock); + } + function emitLabeledStatement(node) { + emit3(node.label); + emitTokenWithComment(58, node.label.end, writePunctuation, node); + writeSpace(); + emit3(node.statement); + } + function emitThrowStatement(node) { + emitTokenWithComment(109, node.pos, writeKeyword, node); + emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitTryStatement(node) { + emitTokenWithComment(111, node.pos, writeKeyword, node); + writeSpace(); + emit3(node.tryBlock); + if (node.catchClause) { + writeLineOrSpace(node, node.tryBlock, node.catchClause); + emit3(node.catchClause); + } + if (node.finallyBlock) { + writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); + emitTokenWithComment(96, (node.catchClause || node.tryBlock).end, writeKeyword, node); + writeSpace(); + emit3(node.finallyBlock); + } + } + function emitDebuggerStatement(node) { + writeToken(87, node.pos, writeKeyword); + writeTrailingSemicolon(); + } + function emitVariableDeclaration(node) { + var _a3, _b2, _c2, _d, _e2; + emit3(node.name); + emit3(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, (_e2 = (_b2 = (_a3 = node.type) === null || _a3 === void 0 ? void 0 : _a3.end) !== null && _b2 !== void 0 ? _b2 : (_d = (_c2 = node.name.emitNode) === null || _c2 === void 0 ? void 0 : _c2.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e2 !== void 0 ? _e2 : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitVariableDeclarationList(node) { + writeKeyword(ts2.isLet(node) ? "let" : ts2.isVarConst(node) ? "const" : "var"); + writeSpace(); + emitList( + node, + node.declarations, + 528 + /* ListFormat.VariableDeclarationList */ + ); + } + function emitFunctionDeclaration(node) { + emitFunctionDeclarationOrExpression(node); + } + function emitFunctionDeclarationOrExpression(node) { + emitModifiers(node, node.modifiers); + writeKeyword("function"); + emit3(node.asteriskToken); + writeSpace(); + emitIdentifierName(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitSignatureAndBody(node, emitSignatureHead2) { + var body = node.body; + if (body) { + if (ts2.isBlock(body)) { + var indentedFlag = ts2.getEmitFlags(node) & 65536; + if (indentedFlag) { + increaseIndent(); + } + pushNameGenerationScope(node); + ts2.forEach(node.parameters, generateNames); + generateNames(node.body); + emitSignatureHead2(node); + emitBlockFunctionBody(body); + popNameGenerationScope(node); + if (indentedFlag) { + decreaseIndent(); + } + } else { + emitSignatureHead2(node); + writeSpace(); + emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); + } + } else { + emitSignatureHead2(node); + writeTrailingSemicolon(); + } + } + function emitSignatureHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + } + function shouldEmitBlockFunctionBodyOnSingleLine(body) { + if (ts2.getEmitFlags(body) & 1) { + return true; + } + if (body.multiLine) { + return false; + } + if (!ts2.nodeIsSynthesized(body) && currentSourceFile && !ts2.rangeIsOnSingleLine(body, currentSourceFile)) { + return false; + } + if (getLeadingLineTerminatorCount( + body, + ts2.firstOrUndefined(body.statements), + 2 + /* ListFormat.PreserveLines */ + ) || getClosingLineTerminatorCount(body, ts2.lastOrUndefined(body.statements), 2, body.statements)) { + return false; + } + var previousStatement; + for (var _a3 = 0, _b2 = body.statements; _a3 < _b2.length; _a3++) { + var statement = _b2[_a3]; + if (getSeparatingLineTerminatorCount( + previousStatement, + statement, + 2 + /* ListFormat.PreserveLines */ + ) > 0) { + return false; + } + previousStatement = statement; + } + return true; + } + function emitBlockFunctionBody(body) { + onBeforeEmitNode === null || onBeforeEmitNode === void 0 ? void 0 : onBeforeEmitNode(body); + writeSpace(); + writePunctuation("{"); + increaseIndent(); + var emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); + decreaseIndent(); + writeToken(19, body.statements.end, writePunctuation, body); + onAfterEmitNode === null || onAfterEmitNode === void 0 ? void 0 : onAfterEmitNode(body); + } + function emitBlockFunctionBodyOnSingleLine(body) { + emitBlockFunctionBodyWorker( + body, + /*emitBlockFunctionBodyOnSingleLine*/ + true + ); + } + function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { + var statementOffset = emitPrologueDirectives(body.statements); + var pos = writer.getTextPos(); + emitHelpers(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { + decreaseIndent(); + emitList( + body, + body.statements, + 768 + /* ListFormat.SingleLineFunctionBodyStatements */ + ); + increaseIndent(); + } else { + emitList( + body, + body.statements, + 1, + /*parenthesizerRule*/ + void 0, + statementOffset + ); + } + } + function emitClassDeclaration(node) { + emitClassDeclarationOrExpression(node); + } + function emitClassDeclarationOrExpression(node) { + ts2.forEach(node.members, generateMemberNames); + emitDecoratorsAndModifiers(node, node.modifiers); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } + var indentedFlag = ts2.getEmitFlags(node) & 65536; + if (indentedFlag) { + increaseIndent(); + } + emitTypeParameters(node, node.typeParameters); + emitList( + node, + node.heritageClauses, + 0 + /* ListFormat.ClassHeritageClauses */ + ); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 129 + /* ListFormat.ClassMembers */ + ); + writePunctuation("}"); + if (indentedFlag) { + decreaseIndent(); + } + } + function emitInterfaceDeclaration(node) { + emitModifiers(node, node.modifiers); + writeKeyword("interface"); + writeSpace(); + emit3(node.name); + emitTypeParameters(node, node.typeParameters); + emitList( + node, + node.heritageClauses, + 512 + /* ListFormat.HeritageClauses */ + ); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 129 + /* ListFormat.InterfaceMembers */ + ); + writePunctuation("}"); + } + function emitTypeAliasDeclaration(node) { + emitModifiers(node, node.modifiers); + writeKeyword("type"); + writeSpace(); + emit3(node.name); + emitTypeParameters(node, node.typeParameters); + writeSpace(); + writePunctuation("="); + writeSpace(); + emit3(node.type); + writeTrailingSemicolon(); + } + function emitEnumDeclaration(node) { + emitModifiers(node, node.modifiers); + writeKeyword("enum"); + writeSpace(); + emit3(node.name); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 145 + /* ListFormat.EnumMembers */ + ); + writePunctuation("}"); + } + function emitModuleDeclaration(node) { + emitModifiers(node, node.modifiers); + if (~node.flags & 1024) { + writeKeyword(node.flags & 16 ? "namespace" : "module"); + writeSpace(); + } + emit3(node.name); + var body = node.body; + if (!body) + return writeTrailingSemicolon(); + while (body && ts2.isModuleDeclaration(body)) { + writePunctuation("."); + emit3(body.name); + body = body.body; + } + writeSpace(); + emit3(body); + } + function emitModuleBlock(node) { + pushNameGenerationScope(node); + ts2.forEach(node.statements, generateNames); + emitBlockStatements( + node, + /*forceSingleLine*/ + isEmptyBlock(node) + ); + popNameGenerationScope(node); + } + function emitCaseBlock(node) { + emitTokenWithComment(18, node.pos, writePunctuation, node); + emitList( + node, + node.clauses, + 129 + /* ListFormat.CaseBlockClauses */ + ); + emitTokenWithComment( + 19, + node.clauses.end, + writePunctuation, + node, + /*indentLeading*/ + true + ); + } + function emitImportEqualsDeclaration(node) { + emitModifiers(node, node.modifiers); + emitTokenWithComment(100, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + emitTokenWithComment(154, node.pos, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + writeSpace(); + emitTokenWithComment(63, node.name.end, writePunctuation, node); + writeSpace(); + emitModuleReference(node.moduleReference); + writeTrailingSemicolon(); + } + function emitModuleReference(node) { + if (node.kind === 79) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitImportDeclaration(node) { + emitModifiers(node, node.modifiers); + emitTokenWithComment(100, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.importClause) { + emit3(node.importClause); + writeSpace(); + emitTokenWithComment(158, node.importClause.end, writeKeyword, node); + writeSpace(); + } + emitExpression(node.moduleSpecifier); + if (node.assertClause) { + emitWithLeadingSpace(node.assertClause); + } + writeTrailingSemicolon(); + } + function emitImportClause(node) { + if (node.isTypeOnly) { + emitTokenWithComment(154, node.pos, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + if (node.name && node.namedBindings) { + emitTokenWithComment(27, node.name.end, writePunctuation, node); + writeSpace(); + } + emit3(node.namedBindings); + } + function emitNamespaceImport(node) { + var asPos = emitTokenWithComment(41, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(128, asPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + } + function emitNamedImports(node) { + emitNamedImportsOrExports(node); + } + function emitImportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitExportAssignment(node) { + var nextPos = emitTokenWithComment(93, node.pos, writeKeyword, node); + writeSpace(); + if (node.isExportEquals) { + emitTokenWithComment(63, nextPos, writeOperator, node); + } else { + emitTokenWithComment(88, nextPos, writeKeyword, node); + } + writeSpace(); + emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator( + 63 + /* SyntaxKind.EqualsToken */ + ) : parenthesizer.parenthesizeExpressionOfExportDefault); + writeTrailingSemicolon(); + } + function emitExportDeclaration(node) { + emitModifiers(node, node.modifiers); + var nextPos = emitTokenWithComment(93, node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + nextPos = emitTokenWithComment(154, nextPos, writeKeyword, node); + writeSpace(); + } + if (node.exportClause) { + emit3(node.exportClause); + } else { + nextPos = emitTokenWithComment(41, nextPos, writePunctuation, node); + } + if (node.moduleSpecifier) { + writeSpace(); + var fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(158, fromPos, writeKeyword, node); + writeSpace(); + emitExpression(node.moduleSpecifier); + } + if (node.assertClause) { + emitWithLeadingSpace(node.assertClause); + } + writeTrailingSemicolon(); + } + function emitAssertClause(node) { + emitTokenWithComment(130, node.pos, writeKeyword, node); + writeSpace(); + var elements = node.elements; + emitList( + node, + elements, + 526226 + /* ListFormat.ImportClauseEntries */ + ); + } + function emitAssertEntry(node) { + emit3(node.name); + writePunctuation(":"); + writeSpace(); + var value2 = node.value; + if ((ts2.getEmitFlags(value2) & 512) === 0) { + var commentRange = ts2.getCommentRange(value2); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emit3(value2); + } + function emitNamespaceExportDeclaration(node) { + var nextPos = emitTokenWithComment(93, node.pos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(128, nextPos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(143, nextPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + writeTrailingSemicolon(); + } + function emitNamespaceExport(node) { + var asPos = emitTokenWithComment(41, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(128, asPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + } + function emitNamedExports(node) { + emitNamedImportsOrExports(node); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitNamedImportsOrExports(node) { + writePunctuation("{"); + emitList( + node, + node.elements, + 525136 + /* ListFormat.NamedImportsOrExportsElements */ + ); + writePunctuation("}"); + } + function emitImportOrExportSpecifier(node) { + if (node.isTypeOnly) { + writeKeyword("type"); + writeSpace(); + } + if (node.propertyName) { + emit3(node.propertyName); + writeSpace(); + emitTokenWithComment(128, node.propertyName.end, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + } + function emitExternalModuleReference(node) { + writeKeyword("require"); + writePunctuation("("); + emitExpression(node.expression); + writePunctuation(")"); + } + function emitJsxElement(node) { + emit3(node.openingElement); + emitList( + node, + node.children, + 262144 + /* ListFormat.JsxElementOrFragmentChildren */ + ); + emit3(node.closingElement); + } + function emitJsxSelfClosingElement(node) { + writePunctuation("<"); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emit3(node.attributes); + writePunctuation("/>"); + } + function emitJsxFragment(node) { + emit3(node.openingFragment); + emitList( + node, + node.children, + 262144 + /* ListFormat.JsxElementOrFragmentChildren */ + ); + emit3(node.closingFragment); + } + function emitJsxOpeningElementOrFragment(node) { + writePunctuation("<"); + if (ts2.isJsxOpeningElement(node)) { + var indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + if (node.attributes.properties && node.attributes.properties.length > 0) { + writeSpace(); + } + emit3(node.attributes); + writeLineSeparatorsAfter(node.attributes, node); + decreaseIndentIf(indented); + } + writePunctuation(">"); + } + function emitJsxText(node) { + writer.writeLiteral(node.text); + } + function emitJsxClosingElementOrFragment(node) { + writePunctuation(""); + } + function emitJsxAttributes(node) { + emitList( + node, + node.properties, + 262656 + /* ListFormat.JsxElementAttributes */ + ); + } + function emitJsxAttribute(node) { + emit3(node.name); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); + } + function emitJsxSpreadAttribute(node) { + writePunctuation("{..."); + emitExpression(node.expression); + writePunctuation("}"); + } + function hasTrailingCommentsAtPosition(pos) { + var result2 = false; + ts2.forEachTrailingCommentRange((currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.text) || "", pos + 1, function() { + return result2 = true; + }); + return result2; + } + function hasLeadingCommentsAtPosition(pos) { + var result2 = false; + ts2.forEachLeadingCommentRange((currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.text) || "", pos + 1, function() { + return result2 = true; + }); + return result2; + } + function hasCommentsAtPosition(pos) { + return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); + } + function emitJsxExpression(node) { + var _a3; + if (node.expression || !commentsDisabled && !ts2.nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { + var isMultiline = currentSourceFile && !ts2.nodeIsSynthesized(node) && ts2.getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== ts2.getLineAndCharacterOfPosition(currentSourceFile, node.end).line; + if (isMultiline) { + writer.increaseIndent(); + } + var end = emitTokenWithComment(18, node.pos, writePunctuation, node); + emit3(node.dotDotDotToken); + emitExpression(node.expression); + emitTokenWithComment(19, ((_a3 = node.expression) === null || _a3 === void 0 ? void 0 : _a3.end) || end, writePunctuation, node); + if (isMultiline) { + writer.decreaseIndent(); + } + } + } + function emitJsxTagName(node) { + if (node.kind === 79) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitCaseClause(node) { + emitTokenWithComment(82, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); + } + function emitDefaultClause(node) { + var pos = emitTokenWithComment(88, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); + } + function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { + var emitAsSingleStatement = statements.length === 1 && // treat synthesized nodes as located on the same line for emit purposes + (!currentSourceFile || ts2.nodeIsSynthesized(parentNode) || ts2.nodeIsSynthesized(statements[0]) || ts2.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); + var format5 = 163969; + if (emitAsSingleStatement) { + writeToken(58, colonPos, writePunctuation, parentNode); + writeSpace(); + format5 &= ~(1 | 128); + } else { + emitTokenWithComment(58, colonPos, writePunctuation, parentNode); + } + emitList(parentNode, statements, format5); + } + function emitHeritageClause(node) { + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); + emitList( + node, + node.types, + 528 + /* ListFormat.HeritageClauseTypes */ + ); + } + function emitCatchClause(node) { + var openParenPos = emitTokenWithComment(83, node.pos, writeKeyword, node); + writeSpace(); + if (node.variableDeclaration) { + emitTokenWithComment(20, openParenPos, writePunctuation, node); + emit3(node.variableDeclaration); + emitTokenWithComment(21, node.variableDeclaration.end, writePunctuation, node); + writeSpace(); + } + emit3(node.block); + } + function emitPropertyAssignment(node) { + emit3(node.name); + writePunctuation(":"); + writeSpace(); + var initializer = node.initializer; + if ((ts2.getEmitFlags(initializer) & 512) === 0) { + var commentRange = ts2.getCommentRange(initializer); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitShorthandPropertyAssignment(node) { + emit3(node.name); + if (node.objectAssignmentInitializer) { + writeSpace(); + writePunctuation("="); + writeSpace(); + emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitSpreadAssignment(node) { + if (node.expression) { + emitTokenWithComment(25, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitEnumMember(node) { + emit3(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitJSDoc(node) { + write("/**"); + if (node.comment) { + var text = ts2.getTextOfJSDocComment(node.comment); + if (text) { + var lines = text.split(/\r\n?|\n/g); + for (var _a3 = 0, lines_2 = lines; _a3 < lines_2.length; _a3++) { + var line = lines_2[_a3]; + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + write(line); + } + } + } + if (node.tags) { + if (node.tags.length === 1 && node.tags[0].kind === 346 && !node.comment) { + writeSpace(); + emit3(node.tags[0]); + } else { + emitList( + node, + node.tags, + 33 + /* ListFormat.JSDocComment */ + ); + } + } + writeSpace(); + write("*/"); + } + function emitJSDocSimpleTypedTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.typeExpression); + emitJSDocComment(tag.comment); + } + function emitJSDocSeeTag(tag) { + emitJSDocTagName(tag.tagName); + emit3(tag.name); + emitJSDocComment(tag.comment); + } + function emitJSDocNameReference(node) { + writeSpace(); + writePunctuation("{"); + emit3(node.name); + writePunctuation("}"); + } + function emitJSDocHeritageTag(tag) { + emitJSDocTagName(tag.tagName); + writeSpace(); + writePunctuation("{"); + emit3(tag.class); + writePunctuation("}"); + emitJSDocComment(tag.comment); + } + function emitJSDocTemplateTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.constraint); + writeSpace(); + emitList( + tag, + tag.typeParameters, + 528 + /* ListFormat.CommaListElements */ + ); + emitJSDocComment(tag.comment); + } + function emitJSDocTypedefTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.typeExpression) { + if (tag.typeExpression.kind === 312) { + emitJSDocTypeExpression(tag.typeExpression); + } else { + writeSpace(); + writePunctuation("{"); + write("Object"); + if (tag.typeExpression.isArrayType) { + writePunctuation("["); + writePunctuation("]"); + } + writePunctuation("}"); + } + } + if (tag.fullName) { + writeSpace(); + emit3(tag.fullName); + } + emitJSDocComment(tag.comment); + if (tag.typeExpression && tag.typeExpression.kind === 325) { + emitJSDocTypeLiteral(tag.typeExpression); + } + } + function emitJSDocCallbackTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.name) { + writeSpace(); + emit3(tag.name); + } + emitJSDocComment(tag.comment); + emitJSDocSignature(tag.typeExpression); + } + function emitJSDocSimpleTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocComment(tag.comment); + } + function emitJSDocTypeLiteral(lit) { + emitList( + lit, + ts2.factory.createNodeArray(lit.jsDocPropertyTags), + 33 + /* ListFormat.JSDocComment */ + ); + } + function emitJSDocSignature(sig) { + if (sig.typeParameters) { + emitList( + sig, + ts2.factory.createNodeArray(sig.typeParameters), + 33 + /* ListFormat.JSDocComment */ + ); + } + if (sig.parameters) { + emitList( + sig, + ts2.factory.createNodeArray(sig.parameters), + 33 + /* ListFormat.JSDocComment */ + ); + } + if (sig.type) { + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + emit3(sig.type); + } + } + function emitJSDocPropertyLikeTag(param) { + emitJSDocTagName(param.tagName); + emitJSDocTypeExpression(param.typeExpression); + writeSpace(); + if (param.isBracketed) { + writePunctuation("["); + } + emit3(param.name); + if (param.isBracketed) { + writePunctuation("]"); + } + emitJSDocComment(param.comment); + } + function emitJSDocTagName(tagName) { + writePunctuation("@"); + emit3(tagName); + } + function emitJSDocComment(comment) { + var text = ts2.getTextOfJSDocComment(comment); + if (text) { + writeSpace(); + write(text); + } + } + function emitJSDocTypeExpression(typeExpression) { + if (typeExpression) { + writeSpace(); + writePunctuation("{"); + emit3(typeExpression.type); + writePunctuation("}"); + } + } + function emitSourceFile(node) { + writeLine(); + var statements = node.statements; + var shouldEmitDetachedComment = statements.length === 0 || !ts2.isPrologueDirective(statements[0]) || ts2.nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + emitSourceFileWorker(node); + } + function emitSyntheticTripleSlashReferencesIfNeeded(node) { + emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); + for (var _a3 = 0, _b2 = node.prepends; _a3 < _b2.length; _a3++) { + var prepend = _b2[_a3]; + if (ts2.isUnparsedSource(prepend) && prepend.syntheticReferences) { + for (var _c2 = 0, _d = prepend.syntheticReferences; _c2 < _d.length; _c2++) { + var ref = _d[_c2]; + emit3(ref); + writeLine(); + } + } + } + } + function emitTripleSlashDirectivesIfNeeded(node) { + if (node.isDeclarationFile) + emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); + } + function emitTripleSlashDirectives(hasNoDefaultLib, files, types3, libs) { + if (hasNoDefaultLib) { + var pos = writer.getTextPos(); + writeComment('/// '); + if (bundleFileInfo) + bundleFileInfo.sections.push({ + pos, + end: writer.getTextPos(), + kind: "no-default-lib" + /* BundleFileSectionKind.NoDefaultLib */ + }); + writeLine(); + } + if (currentSourceFile && currentSourceFile.moduleName) { + writeComment('/// ')); + writeLine(); + } + if (currentSourceFile && currentSourceFile.amdDependencies) { + for (var _a3 = 0, _b2 = currentSourceFile.amdDependencies; _a3 < _b2.length; _a3++) { + var dep = _b2[_a3]; + if (dep.name) { + writeComment('/// ')); + } else { + writeComment('/// ')); + } + writeLine(); + } + } + for (var _c2 = 0, files_2 = files; _c2 < files_2.length; _c2++) { + var directive = files_2[_c2]; + var pos = writer.getTextPos(); + writeComment('/// ')); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName }); + writeLine(); + } + for (var _d = 0, types_23 = types3; _d < types_23.length; _d++) { + var directive = types_23[_d]; + var pos = writer.getTextPos(); + var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat) ? 'resolution-mode="'.concat(directive.resolutionMode === ts2.ModuleKind.ESNext ? "import" : "require", '"') : ""; + writeComment('/// ")); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" : directive.resolutionMode === ts2.ModuleKind.ESNext ? "type-import" : "type-require", data: directive.fileName }); + writeLine(); + } + for (var _e2 = 0, libs_1 = libs; _e2 < libs_1.length; _e2++) { + var directive = libs_1[_e2]; + var pos = writer.getTextPos(); + writeComment('/// ')); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "lib", data: directive.fileName }); + writeLine(); + } + } + function emitSourceFileWorker(node) { + var statements = node.statements; + pushNameGenerationScope(node); + ts2.forEach(node.statements, generateNames); + emitHelpers(node); + var index4 = ts2.findIndex(statements, function(statement) { + return !ts2.isPrologueDirective(statement); + }); + emitTripleSlashDirectivesIfNeeded(node); + emitList( + node, + statements, + 1, + /*parenthesizerRule*/ + void 0, + index4 === -1 ? statements.length : index4 + ); + popNameGenerationScope(node); + } + function emitPartiallyEmittedExpression(node) { + var emitFlags = ts2.getEmitFlags(node); + if (!(emitFlags & 512) && node.pos !== node.expression.pos) { + emitTrailingCommentsOfPosition(node.expression.pos); + } + emitExpression(node.expression); + if (!(emitFlags & 1024) && node.end !== node.expression.end) { + emitLeadingCommentsOfPosition(node.expression.end); + } + } + function emitCommaList(node) { + emitExpressionList( + node, + node.elements, + 528, + /*parenthesizerRule*/ + void 0 + ); + } + function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) { + var needsToSetSourceFile = !!sourceFile; + for (var i7 = 0; i7 < statements.length; i7++) { + var statement = statements[i7]; + if (ts2.isPrologueDirective(statement)) { + var shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (needsToSetSourceFile) { + needsToSetSourceFile = false; + setSourceFile(sourceFile); + } + writeLine(); + var pos = writer.getTextPos(); + emit3(statement); + if (recordBundleFileSection && bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue", data: statement.expression.text }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(statement.expression.text); + } + } + } else { + return i7; + } + } + return statements.length; + } + function emitUnparsedPrologues(prologues, seenPrologueDirectives) { + for (var _a3 = 0, prologues_1 = prologues; _a3 < prologues_1.length; _a3++) { + var prologue = prologues_1[_a3]; + if (!seenPrologueDirectives.has(prologue.data)) { + writeLine(); + var pos = writer.getTextPos(); + emit3(prologue); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue", data: prologue.data }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(prologue.data); + } + } + } + } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (ts2.isSourceFile(sourceFileOrBundle)) { + emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); + } else { + var seenPrologueDirectives = new ts2.Set(); + for (var _a3 = 0, _b2 = sourceFileOrBundle.prepends; _a3 < _b2.length; _a3++) { + var prepend = _b2[_a3]; + emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives); + } + for (var _c2 = 0, _d = sourceFileOrBundle.sourceFiles; _c2 < _d.length; _c2++) { + var sourceFile = _d[_c2]; + emitPrologueDirectives( + sourceFile.statements, + sourceFile, + seenPrologueDirectives, + /*recordBundleFileSection*/ + true + ); + } + setSourceFile(void 0); + } + } + function getPrologueDirectivesFromBundledSourceFiles(bundle) { + var seenPrologueDirectives = new ts2.Set(); + var prologues; + for (var index4 = 0; index4 < bundle.sourceFiles.length; index4++) { + var sourceFile = bundle.sourceFiles[index4]; + var directives = void 0; + var end = 0; + for (var _a3 = 0, _b2 = sourceFile.statements; _a3 < _b2.length; _a3++) { + var statement = _b2[_a3]; + if (!ts2.isPrologueDirective(statement)) + break; + if (seenPrologueDirectives.has(statement.expression.text)) + continue; + seenPrologueDirectives.add(statement.expression.text); + (directives || (directives = [])).push({ + pos: statement.pos, + end: statement.end, + expression: { + pos: statement.expression.pos, + end: statement.expression.end, + text: statement.expression.text + } + }); + end = end < statement.end ? statement.end : end; + } + if (directives) + (prologues || (prologues = [])).push({ file: index4, text: sourceFile.text.substring(0, end), directives }); + } + return prologues; + } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (ts2.isSourceFile(sourceFileOrBundle) || ts2.isUnparsedSource(sourceFileOrBundle)) { + var shebang = ts2.getShebang(sourceFileOrBundle.text); + if (shebang) { + writeComment(shebang); + writeLine(); + return true; + } + } else { + for (var _a3 = 0, _b2 = sourceFileOrBundle.prepends; _a3 < _b2.length; _a3++) { + var prepend = _b2[_a3]; + ts2.Debug.assertNode(prepend, ts2.isUnparsedSource); + if (emitShebangIfNeeded(prepend)) { + return true; + } + } + for (var _c2 = 0, _d = sourceFileOrBundle.sourceFiles; _c2 < _d.length; _c2++) { + var sourceFile = _d[_c2]; + if (emitShebangIfNeeded(sourceFile)) { + return true; + } + } + } + } + function emitNodeWithWriter(node, writer2) { + if (!node) + return; + var savedWrite = write; + write = writer2; + emit3(node); + write = savedWrite; + } + function emitDecoratorsAndModifiers(node, modifiers) { + if (modifiers === null || modifiers === void 0 ? void 0 : modifiers.length) { + if (ts2.every(modifiers, ts2.isModifier)) { + return emitModifiers(node, modifiers); + } + if (ts2.every(modifiers, ts2.isDecorator)) { + return emitDecorators(node, modifiers); + } + onBeforeEmitNodeArray === null || onBeforeEmitNodeArray === void 0 ? void 0 : onBeforeEmitNodeArray(modifiers); + var lastMode = void 0; + var mode = void 0; + var start = 0; + var pos = 0; + while (start < modifiers.length) { + while (pos < modifiers.length) { + var modifier = modifiers[pos]; + mode = ts2.isDecorator(modifier) ? "decorators" : "modifiers"; + if (lastMode === void 0) { + lastMode = mode; + } else if (mode !== lastMode) { + break; + } + pos++; + } + var textRange = { pos: -1, end: -1 }; + if (start === 0) + textRange.pos = modifiers.pos; + if (pos === modifiers.length - 1) + textRange.end = modifiers.end; + emitNodeListItems( + emit3, + node, + modifiers, + lastMode === "modifiers" ? 2359808 : 2146305, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + start = pos; + lastMode = mode; + pos++; + } + onAfterEmitNodeArray === null || onAfterEmitNodeArray === void 0 ? void 0 : onAfterEmitNodeArray(modifiers); + } + } + function emitModifiers(node, modifiers) { + emitList( + node, + modifiers, + 2359808 + /* ListFormat.Modifiers */ + ); + } + function emitTypeAnnotation(node) { + if (node) { + writePunctuation(":"); + writeSpace(); + emit3(node); + } + } + function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { + if (node) { + writeSpace(); + emitTokenWithComment(63, equalCommentStartPos, writeOperator, container); + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit4) { + if (node) { + prefixWriter(prefix); + emit4(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit3(node); + } + } + function emitExpressionWithLeadingSpace(node, parenthesizerRule) { + if (node) { + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitWithTrailingSpace(node) { + if (node) { + emit3(node); + writeSpace(); + } + } + function emitEmbeddedStatement(parent2, node) { + if (ts2.isBlock(node) || ts2.getEmitFlags(parent2) & 1) { + writeSpace(); + emit3(node); + } else { + writeLine(); + increaseIndent(); + if (ts2.isEmptyStatement(node)) { + pipelineEmit(5, node); + } else { + emit3(node); + } + decreaseIndent(); + } + } + function emitDecorators(parentNode, decorators) { + emitList( + parentNode, + decorators, + 2146305 + /* ListFormat.Decorators */ + ); + } + function emitTypeArguments(parentNode, typeArguments) { + emitList(parentNode, typeArguments, 53776, typeArgumentParenthesizerRuleSelector); + } + function emitTypeParameters(parentNode, typeParameters) { + if (ts2.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList( + parentNode, + typeParameters, + 53776 + /* ListFormat.TypeParameters */ + ); + } + function emitParameters(parentNode, parameters) { + emitList( + parentNode, + parameters, + 2576 + /* ListFormat.Parameters */ + ); + } + function canEmitSimpleArrowHead(parentNode, parameters) { + var parameter = ts2.singleOrUndefined(parameters); + return parameter && parameter.pos === parentNode.pos && ts2.isArrowFunction(parentNode) && !parentNode.type && !ts2.some(parentNode.modifiers) && !ts2.some(parentNode.typeParameters) && !ts2.some(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && ts2.isIdentifier(parameter.name); + } + function emitParametersForArrow(parentNode, parameters) { + if (canEmitSimpleArrowHead(parentNode, parameters)) { + emitList( + parentNode, + parameters, + 2576 & ~2048 + /* ListFormat.Parenthesis */ + ); + } else { + emitParameters(parentNode, parameters); + } + } + function emitParametersForIndexSignature(parentNode, parameters) { + emitList( + parentNode, + parameters, + 8848 + /* ListFormat.IndexSignatureParameters */ + ); + } + function writeDelimiter(format5) { + switch (format5 & 60) { + case 0: + break; + case 16: + writePunctuation(","); + break; + case 4: + writeSpace(); + writePunctuation("|"); + break; + case 32: + writeSpace(); + writePunctuation("*"); + writeSpace(); + break; + case 8: + writeSpace(); + writePunctuation("&"); + break; + } + } + function emitList(parentNode, children, format5, parenthesizerRule, start, count2) { + emitNodeList(emit3, parentNode, children, format5, parenthesizerRule, start, count2); + } + function emitExpressionList(parentNode, children, format5, parenthesizerRule, start, count2) { + emitNodeList(emitExpression, parentNode, children, format5, parenthesizerRule, start, count2); + } + function emitNodeList(emit4, parentNode, children, format5, parenthesizerRule, start, count2) { + if (start === void 0) { + start = 0; + } + if (count2 === void 0) { + count2 = children ? children.length - start : 0; + } + var isUndefined3 = children === void 0; + if (isUndefined3 && format5 & 16384) { + return; + } + var isEmpty4 = children === void 0 || start >= children.length || count2 === 0; + if (isEmpty4 && format5 & 32768) { + onBeforeEmitNodeArray === null || onBeforeEmitNodeArray === void 0 ? void 0 : onBeforeEmitNodeArray(children); + onAfterEmitNodeArray === null || onAfterEmitNodeArray === void 0 ? void 0 : onAfterEmitNodeArray(children); + return; + } + if (format5 & 15360) { + writePunctuation(getOpeningBracket(format5)); + if (isEmpty4 && children) { + emitTrailingCommentsOfPosition( + children.pos, + /*prefixSpace*/ + true + ); + } + } + onBeforeEmitNodeArray === null || onBeforeEmitNodeArray === void 0 ? void 0 : onBeforeEmitNodeArray(children); + if (isEmpty4) { + if (format5 & 1 && !(preserveSourceNewlines && (!parentNode || currentSourceFile && ts2.rangeIsOnSingleLine(parentNode, currentSourceFile)))) { + writeLine(); + } else if (format5 & 256 && !(format5 & 524288)) { + writeSpace(); + } + } else { + emitNodeListItems(emit4, parentNode, children, format5, parenthesizerRule, start, count2, children.hasTrailingComma, children); + } + onAfterEmitNodeArray === null || onAfterEmitNodeArray === void 0 ? void 0 : onAfterEmitNodeArray(children); + if (format5 & 15360) { + if (isEmpty4 && children) { + emitLeadingCommentsOfPosition(children.end); + } + writePunctuation(getClosingBracket(format5)); + } + } + function emitNodeListItems(emit4, parentNode, children, format5, parenthesizerRule, start, count2, hasTrailingComma, childrenTextRange) { + var mayEmitInterveningComments = (format5 & 262144) === 0; + var shouldEmitInterveningComments = mayEmitInterveningComments; + var leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format5); + if (leadingLineTerminatorCount) { + writeLine(leadingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (format5 & 256) { + writeSpace(); + } + if (format5 & 128) { + increaseIndent(); + } + var emitListItem = getEmitListItem(emit4, parenthesizerRule); + var previousSibling; + var previousSourceFileTextKind; + var shouldDecreaseIndentAfterEmit = false; + for (var i7 = 0; i7 < count2; i7++) { + var child = children[start + i7]; + if (format5 & 32) { + writeLine(); + writeDelimiter(format5); + } else if (previousSibling) { + if (format5 & 60 && previousSibling.end !== (parentNode ? parentNode.end : -1)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } + writeDelimiter(format5); + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + var separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format5); + if (separatingLineTerminatorCount > 0) { + if ((format5 & (3 | 128)) === 0) { + increaseIndent(); + shouldDecreaseIndentAfterEmit = true; + } + writeLine(separatingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (previousSibling && format5 & 512) { + writeSpace(); + } + } + previousSourceFileTextKind = recordBundleFileInternalSectionStart(child); + if (shouldEmitInterveningComments) { + var commentRange = ts2.getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } else { + shouldEmitInterveningComments = mayEmitInterveningComments; + } + nextListElementPos = child.pos; + emitListItem(child, emit4, parenthesizerRule, i7); + if (shouldDecreaseIndentAfterEmit) { + decreaseIndent(); + shouldDecreaseIndentAfterEmit = false; + } + previousSibling = child; + } + var emitFlags = previousSibling ? ts2.getEmitFlags(previousSibling) : 0; + var skipTrailingComments = commentsDisabled || !!(emitFlags & 1024); + var emitTrailingComma = hasTrailingComma && format5 & 64 && format5 & 16; + if (emitTrailingComma) { + if (previousSibling && !skipTrailingComments) { + emitTokenWithComment(27, previousSibling.end, writePunctuation, previousSibling); + } else { + writePunctuation(","); + } + } + if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format5 & 60 && !skipTrailingComments) { + emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange === null || childrenTextRange === void 0 ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); + } + if (format5 & 128) { + decreaseIndent(); + } + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + var closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count2 - 1], format5, childrenTextRange); + if (closingLineTerminatorCount) { + writeLine(closingLineTerminatorCount); + } else if (format5 & (2097152 | 256)) { + writeSpace(); + } + } + function writeLiteral(s7) { + writer.writeLiteral(s7); + } + function writeStringLiteral(s7) { + writer.writeStringLiteral(s7); + } + function writeBase(s7) { + writer.write(s7); + } + function writeSymbol(s7, sym) { + writer.writeSymbol(s7, sym); + } + function writePunctuation(s7) { + writer.writePunctuation(s7); + } + function writeTrailingSemicolon() { + writer.writeTrailingSemicolon(";"); + } + function writeKeyword(s7) { + writer.writeKeyword(s7); + } + function writeOperator(s7) { + writer.writeOperator(s7); + } + function writeParameter(s7) { + writer.writeParameter(s7); + } + function writeComment(s7) { + writer.writeComment(s7); + } + function writeSpace() { + writer.writeSpace(" "); + } + function writeProperty(s7) { + writer.writeProperty(s7); + } + function nonEscapingWrite(s7) { + if (writer.nonEscapingWrite) { + writer.nonEscapingWrite(s7); + } else { + writer.write(s7); + } + } + function writeLine(count2) { + if (count2 === void 0) { + count2 = 1; + } + for (var i7 = 0; i7 < count2; i7++) { + writer.writeLine(i7 > 0); + } + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function writeToken(token, pos, writer2, contextNode) { + return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); + } + function writeTokenNode(node, writer2) { + if (onBeforeEmitToken) { + onBeforeEmitToken(node); + } + writer2(ts2.tokenToString(node.kind)); + if (onAfterEmitToken) { + onAfterEmitToken(node); + } + } + function writeTokenText(token, writer2, pos) { + var tokenString = ts2.tokenToString(token); + writer2(tokenString); + return pos < 0 ? pos : pos + tokenString.length; + } + function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { + if (ts2.getEmitFlags(parentNode) & 1) { + writeSpace(); + } else if (preserveSourceNewlines) { + var lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); + if (lines) { + writeLine(lines); + } else { + writeSpace(); + } + } else { + writeLine(); + } + } + function writeLines(text) { + var lines = text.split(/\r\n?|\n/g); + var indentation = ts2.guessIndentation(lines); + for (var _a3 = 0, lines_3 = lines; _a3 < lines_3.length; _a3++) { + var lineText = lines_3[_a3]; + var line = indentation ? lineText.slice(indentation) : lineText; + if (line.length) { + writeLine(); + write(line); + } + } + } + function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { + if (lineCount) { + increaseIndent(); + writeLine(lineCount); + } else if (writeSpaceIfNotIndenting) { + writeSpace(); + } + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { + decreaseIndent(); + } + } + function getLeadingLineTerminatorCount(parentNode, firstChild, format5) { + if (format5 & 2 || preserveSourceNewlines) { + if (format5 & 65536) { + return 1; + } + if (firstChild === void 0) { + return !parentNode || currentSourceFile && ts2.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (firstChild.pos === nextListElementPos) { + return 0; + } + if (firstChild.kind === 11) { + return 0; + } + if (currentSourceFile && parentNode && !ts2.positionIsSynthesized(parentNode.pos) && !ts2.nodeIsSynthesized(firstChild) && (!firstChild.parent || ts2.getOriginalNode(firstChild.parent) === ts2.getOriginalNode(parentNode))) { + if (preserveSourceNewlines) { + return getEffectiveLines(function(includeComments) { + return ts2.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(firstChild.pos, parentNode.pos, currentSourceFile, includeComments); + }); + } + return ts2.rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(firstChild, format5)) { + return 1; + } + } + return format5 & 1 ? 1 : 0; + } + function getSeparatingLineTerminatorCount(previousNode, nextNode, format5) { + if (format5 & 2 || preserveSourceNewlines) { + if (previousNode === void 0 || nextNode === void 0) { + return 0; + } + if (nextNode.kind === 11) { + return 0; + } else if (currentSourceFile && !ts2.nodeIsSynthesized(previousNode) && !ts2.nodeIsSynthesized(nextNode)) { + if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { + return getEffectiveLines(function(includeComments) { + return ts2.getLinesBetweenRangeEndAndRangeStart(previousNode, nextNode, currentSourceFile, includeComments); + }); + } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { + return ts2.rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; + } + return format5 & 65536 ? 1 : 0; + } else if (synthesizedNodeStartsOnNewLine(previousNode, format5) || synthesizedNodeStartsOnNewLine(nextNode, format5)) { + return 1; + } + } else if (ts2.getStartsOnNewLine(nextNode)) { + return 1; + } + return format5 & 1 ? 1 : 0; + } + function getClosingLineTerminatorCount(parentNode, lastChild, format5, childrenTextRange) { + if (format5 & 2 || preserveSourceNewlines) { + if (format5 & 65536) { + return 1; + } + if (lastChild === void 0) { + return !parentNode || currentSourceFile && ts2.rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (currentSourceFile && parentNode && !ts2.positionIsSynthesized(parentNode.pos) && !ts2.nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { + if (preserveSourceNewlines) { + var end_1 = childrenTextRange && !ts2.positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; + return getEffectiveLines(function(includeComments) { + return ts2.getLinesBetweenPositionAndNextNonWhitespaceCharacter(end_1, parentNode.end, currentSourceFile, includeComments); + }); + } + return ts2.rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(lastChild, format5)) { + return 1; + } + } + if (format5 & 1 && !(format5 & 131072)) { + return 1; + } + return 0; + } + function getEffectiveLines(getLineDifference) { + ts2.Debug.assert(!!preserveSourceNewlines); + var lines = getLineDifference( + /*includeComments*/ + true + ); + if (lines === 0) { + return getLineDifference( + /*includeComments*/ + false + ); + } + return lines; + } + function writeLineSeparatorsAndIndentBefore(node, parent2) { + var leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount( + parent2, + node, + 0 + /* ListFormat.None */ + ); + if (leadingNewlines) { + writeLinesAndIndent( + leadingNewlines, + /*writeSpaceIfNotIndenting*/ + false + ); + } + return !!leadingNewlines; + } + function writeLineSeparatorsAfter(node, parent2) { + var trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount( + parent2, + node, + 0, + /*childrenTextRange*/ + void 0 + ); + if (trailingNewlines) { + writeLine(trailingNewlines); + } + } + function synthesizedNodeStartsOnNewLine(node, format5) { + if (ts2.nodeIsSynthesized(node)) { + var startsOnNewLine = ts2.getStartsOnNewLine(node); + if (startsOnNewLine === void 0) { + return (format5 & 65536) !== 0; + } + return startsOnNewLine; + } + return (format5 & 65536) !== 0; + } + function getLinesBetweenNodes(parent2, node1, node2) { + if (ts2.getEmitFlags(parent2) & 131072) { + return 0; + } + parent2 = skipSynthesizedParentheses(parent2); + node1 = skipSynthesizedParentheses(node1); + node2 = skipSynthesizedParentheses(node2); + if (ts2.getStartsOnNewLine(node2)) { + return 1; + } + if (currentSourceFile && !ts2.nodeIsSynthesized(parent2) && !ts2.nodeIsSynthesized(node1) && !ts2.nodeIsSynthesized(node2)) { + if (preserveSourceNewlines) { + return getEffectiveLines(function(includeComments) { + return ts2.getLinesBetweenRangeEndAndRangeStart(node1, node2, currentSourceFile, includeComments); + }); + } + return ts2.rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; + } + return 0; + } + function isEmptyBlock(block) { + return block.statements.length === 0 && (!currentSourceFile || ts2.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); + } + function skipSynthesizedParentheses(node) { + while (node.kind === 214 && ts2.nodeIsSynthesized(node)) { + node = node.expression; + } + return node; + } + function getTextOfNode(node, includeTrivia) { + if (ts2.isGeneratedIdentifier(node) || ts2.isGeneratedPrivateIdentifier(node)) { + return generateName(node); + } + if (ts2.isStringLiteral(node) && node.textSourceNode) { + return getTextOfNode(node.textSourceNode, includeTrivia); + } + var sourceFile = currentSourceFile; + var canUseSourceFile = !!sourceFile && !!node.parent && !ts2.nodeIsSynthesized(node); + if (ts2.isMemberName(node)) { + if (!canUseSourceFile || ts2.getSourceFileOfNode(node) !== ts2.getOriginalNode(sourceFile)) { + return ts2.idText(node); + } + } else { + ts2.Debug.assertNode(node, ts2.isLiteralExpression); + if (!canUseSourceFile) { + return node.text; + } + } + return ts2.getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); + } + function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) { + if (node.kind === 10 && node.textSourceNode) { + var textSourceNode = node.textSourceNode; + if (ts2.isIdentifier(textSourceNode) || ts2.isPrivateIdentifier(textSourceNode) || ts2.isNumericLiteral(textSourceNode)) { + var text = ts2.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode); + return jsxAttributeEscape ? '"'.concat(ts2.escapeJsxAttributeString(text), '"') : neverAsciiEscape || ts2.getEmitFlags(node) & 16777216 ? '"'.concat(ts2.escapeString(text), '"') : '"'.concat(ts2.escapeNonAsciiString(text), '"'); + } else { + return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); + } + } + var flags = (neverAsciiEscape ? 1 : 0) | (jsxAttributeEscape ? 2 : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 : 0) | (printerOptions.target && printerOptions.target === 99 ? 8 : 0); + return ts2.getLiteralText(node, currentSourceFile, flags); + } + function pushNameGenerationScope(node) { + if (node && ts2.getEmitFlags(node) & 524288) { + return; + } + tempFlagsStack.push(tempFlags); + tempFlags = 0; + privateNameTempFlagsStack.push(privateNameTempFlags); + privateNameTempFlags = 0; + formattedNameTempFlagsStack.push(formattedNameTempFlags); + formattedNameTempFlags = void 0; + reservedNamesStack.push(reservedNames); + } + function popNameGenerationScope(node) { + if (node && ts2.getEmitFlags(node) & 524288) { + return; + } + tempFlags = tempFlagsStack.pop(); + privateNameTempFlags = privateNameTempFlagsStack.pop(); + formattedNameTempFlags = formattedNameTempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name2) { + if (!reservedNames || reservedNames === ts2.lastOrUndefined(reservedNamesStack)) { + reservedNames = new ts2.Set(); + } + reservedNames.add(name2); + } + function generateNames(node) { + if (!node) + return; + switch (node.kind) { + case 238: + ts2.forEach(node.statements, generateNames); + break; + case 253: + case 251: + case 243: + case 244: + generateNames(node.statement); + break; + case 242: + generateNames(node.thenStatement); + generateNames(node.elseStatement); + break; + case 245: + case 247: + case 246: + generateNames(node.initializer); + generateNames(node.statement); + break; + case 252: + generateNames(node.caseBlock); + break; + case 266: + ts2.forEach(node.clauses, generateNames); + break; + case 292: + case 293: + ts2.forEach(node.statements, generateNames); + break; + case 255: + generateNames(node.tryBlock); + generateNames(node.catchClause); + generateNames(node.finallyBlock); + break; + case 295: + generateNames(node.variableDeclaration); + generateNames(node.block); + break; + case 240: + generateNames(node.declarationList); + break; + case 258: + ts2.forEach(node.declarations, generateNames); + break; + case 257: + case 166: + case 205: + case 260: + generateNameIfNeeded(node.name); + break; + case 259: + generateNameIfNeeded(node.name); + if (ts2.getEmitFlags(node) & 524288) { + ts2.forEach(node.parameters, generateNames); + generateNames(node.body); + } + break; + case 203: + case 204: + ts2.forEach(node.elements, generateNames); + break; + case 269: + generateNames(node.importClause); + break; + case 270: + generateNameIfNeeded(node.name); + generateNames(node.namedBindings); + break; + case 271: + generateNameIfNeeded(node.name); + break; + case 277: + generateNameIfNeeded(node.name); + break; + case 272: + ts2.forEach(node.elements, generateNames); + break; + case 273: + generateNameIfNeeded(node.propertyName || node.name); + break; + } + } + function generateMemberNames(node) { + if (!node) + return; + switch (node.kind) { + case 299: + case 300: + case 169: + case 171: + case 174: + case 175: + generateNameIfNeeded(node.name); + break; + } + } + function generateNameIfNeeded(name2) { + if (name2) { + if (ts2.isGeneratedIdentifier(name2) || ts2.isGeneratedPrivateIdentifier(name2)) { + generateName(name2); + } else if (ts2.isBindingPattern(name2)) { + generateNames(name2); + } + } + } + function generateName(name2) { + if ((name2.autoGenerateFlags & 7) === 4) { + return generateNameCached(ts2.getNodeForGeneratedName(name2), ts2.isPrivateIdentifier(name2), name2.autoGenerateFlags, name2.autoGeneratePrefix, name2.autoGenerateSuffix); + } else { + var autoGenerateId = name2.autoGenerateId; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name2)); + } + } + function generateNameCached(node, privateName, flags, prefix, suffix) { + var nodeId = ts2.getNodeId(node); + return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags !== null && flags !== void 0 ? flags : 0, ts2.formatGeneratedNamePart(prefix, generateName), ts2.formatGeneratedNamePart(suffix))); + } + function isUniqueName(name2) { + return isFileLevelUniqueName(name2) && !generatedNames.has(name2) && !(reservedNames && reservedNames.has(name2)); + } + function isFileLevelUniqueName(name2) { + return currentSourceFile ? ts2.isFileLevelUniqueName(currentSourceFile, name2, hasGlobalName) : true; + } + function isUniqueLocalName(name2, container) { + for (var node = container; ts2.isNodeDescendantOf(node, container); node = node.nextContainer) { + if (node.locals) { + var local = node.locals.get(ts2.escapeLeadingUnderscores(name2)); + if (local && local.flags & (111551 | 1048576 | 2097152)) { + return false; + } + } + } + return true; + } + function getTempFlags(formattedNameKey) { + var _a3; + switch (formattedNameKey) { + case "": + return tempFlags; + case "#": + return privateNameTempFlags; + default: + return (_a3 = formattedNameTempFlags === null || formattedNameTempFlags === void 0 ? void 0 : formattedNameTempFlags.get(formattedNameKey)) !== null && _a3 !== void 0 ? _a3 : 0; + } + } + function setTempFlags(formattedNameKey, flags) { + switch (formattedNameKey) { + case "": + tempFlags = flags; + break; + case "#": + privateNameTempFlags = flags; + break; + default: + formattedNameTempFlags !== null && formattedNameTempFlags !== void 0 ? formattedNameTempFlags : formattedNameTempFlags = new ts2.Map(); + formattedNameTempFlags.set(formattedNameKey, flags); + break; + } + } + function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { + if (prefix.length > 0 && prefix.charCodeAt(0) === 35) { + prefix = prefix.slice(1); + } + var key = ts2.formatGeneratedName(privateName, prefix, "", suffix); + var tempFlags2 = getTempFlags(key); + if (flags && !(tempFlags2 & flags)) { + var name2 = flags === 268435456 ? "_i" : "_n"; + var fullName = ts2.formatGeneratedName(privateName, prefix, name2, suffix); + if (isUniqueName(fullName)) { + tempFlags2 |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + while (true) { + var count2 = tempFlags2 & 268435455; + tempFlags2++; + if (count2 !== 8 && count2 !== 13) { + var name2 = count2 < 26 ? "_" + String.fromCharCode(97 + count2) : "_" + (count2 - 26); + var fullName = ts2.formatGeneratedName(privateName, prefix, name2, suffix); + if (isUniqueName(fullName)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + } + } + function makeUniqueName(baseName, checkFn, optimistic, scoped, privateName, prefix, suffix) { + if (checkFn === void 0) { + checkFn = isUniqueName; + } + if (baseName.length > 0 && baseName.charCodeAt(0) === 35) { + baseName = baseName.slice(1); + } + if (prefix.length > 0 && prefix.charCodeAt(0) === 35) { + prefix = prefix.slice(1); + } + if (optimistic) { + var fullName = ts2.formatGeneratedName(privateName, prefix, baseName, suffix); + if (checkFn(fullName)) { + if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + } + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + var i7 = 1; + while (true) { + var fullName = ts2.formatGeneratedName(privateName, prefix, baseName + i7, suffix); + if (checkFn(fullName)) { + if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + i7++; + } + } + function makeFileLevelOptimisticUniqueName(name2) { + return makeUniqueName( + name2, + isFileLevelUniqueName, + /*optimistic*/ + true, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForModuleOrEnum(node) { + var name2 = getTextOfNode(node.name); + return isUniqueLocalName(name2, node) ? name2 : makeUniqueName( + name2, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForImportOrExportDeclaration(node) { + var expr = ts2.getExternalModuleName(node); + var baseName = ts2.isStringLiteral(expr) ? ts2.makeIdentifierFromModuleName(expr.text) : "module"; + return makeUniqueName( + baseName, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForExportDefault() { + return makeUniqueName( + "default", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForClassExpression() { + return makeUniqueName( + "class", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { + if (ts2.isIdentifier(node.name)) { + return generateNameCached(node.name, privateName); + } + return makeTempVariableName( + 0, + /*reservedInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + function generateNameForNode(node, privateName, flags, prefix, suffix) { + switch (node.kind) { + case 79: + case 80: + return makeUniqueName(getTextOfNode(node), isUniqueName, !!(flags & 16), !!(flags & 8), privateName, prefix, suffix); + case 264: + case 263: + ts2.Debug.assert(!prefix && !suffix && !privateName); + return generateNameForModuleOrEnum(node); + case 269: + case 275: + ts2.Debug.assert(!prefix && !suffix && !privateName); + return generateNameForImportOrExportDeclaration(node); + case 259: + case 260: + case 274: + ts2.Debug.assert(!prefix && !suffix && !privateName); + return generateNameForExportDefault(); + case 228: + ts2.Debug.assert(!prefix && !suffix && !privateName); + return generateNameForClassExpression(); + case 171: + case 174: + case 175: + return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); + case 164: + return makeTempVariableName( + 0, + /*reserveInNestedScopes*/ + true, + privateName, + prefix, + suffix + ); + default: + return makeTempVariableName( + 0, + /*reserveInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + } + function makeName(name2) { + var prefix = ts2.formatGeneratedNamePart(name2.autoGeneratePrefix, generateName); + var suffix = ts2.formatGeneratedNamePart(name2.autoGenerateSuffix); + switch (name2.autoGenerateFlags & 7) { + case 1: + return makeTempVariableName(0, !!(name2.autoGenerateFlags & 8), ts2.isPrivateIdentifier(name2), prefix, suffix); + case 2: + ts2.Debug.assertNode(name2, ts2.isIdentifier); + return makeTempVariableName( + 268435456, + !!(name2.autoGenerateFlags & 8), + /*privateName*/ + false, + prefix, + suffix + ); + case 3: + return makeUniqueName(ts2.idText(name2), name2.autoGenerateFlags & 32 ? isFileLevelUniqueName : isUniqueName, !!(name2.autoGenerateFlags & 16), !!(name2.autoGenerateFlags & 8), ts2.isPrivateIdentifier(name2), prefix, suffix); + } + return ts2.Debug.fail("Unsupported GeneratedIdentifierKind: ".concat(ts2.Debug.formatEnum( + name2.autoGenerateFlags & 7, + ts2.GeneratedIdentifierFlags, + /*isFlags*/ + true + ), ".")); + } + function pipelineEmitWithComments(hint, node) { + var pipelinePhase = getNextPipelinePhase(2, hint, node); + var savedContainerPos = containerPos; + var savedContainerEnd = containerEnd; + var savedDeclarationListContainerEnd = declarationListContainerEnd; + emitCommentsBeforeNode(node); + pipelinePhase(hint, node); + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + function emitCommentsBeforeNode(node) { + var emitFlags = ts2.getEmitFlags(node); + var commentRange = ts2.getCommentRange(node); + emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); + if (emitFlags & 2048) { + commentsDisabled = true; + } + } + function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + var emitFlags = ts2.getEmitFlags(node); + var commentRange = ts2.getCommentRange(node); + if (emitFlags & 2048) { + commentsDisabled = false; + } + emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + var typeNode = ts2.getTypeNode(node); + if (typeNode) { + emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + } + function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { + enterComment(); + hasWrittenComment = false; + var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 11; + var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11; + if ((pos > 0 || end > 0) && pos !== end) { + if (!skipLeadingComments) { + emitLeadingComments( + pos, + /*isEmittedNode*/ + node.kind !== 352 + /* SyntaxKind.NotEmittedStatement */ + ); + } + if (!skipLeadingComments || pos >= 0 && (emitFlags & 512) !== 0) { + containerPos = pos; + } + if (!skipTrailingComments || end >= 0 && (emitFlags & 1024) !== 0) { + containerEnd = end; + if (node.kind === 258) { + declarationListContainerEnd = end; + } + } + } + ts2.forEach(ts2.getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); + exitComment(); + } + function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + enterComment(); + var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 11; + ts2.forEach(ts2.getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); + if ((pos > 0 || end > 0) && pos !== end) { + containerPos = savedContainerPos; + containerEnd = savedContainerEnd; + declarationListContainerEnd = savedDeclarationListContainerEnd; + if (!skipTrailingComments && node.kind !== 352) { + emitTrailingComments(end); + } + } + exitComment(); + } + function emitLeadingSynthesizedComment(comment) { + if (comment.hasLeadingNewline || comment.kind === 2) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + var text = formatSynthesizedComment(comment); + var lineMap = comment.kind === 3 ? ts2.computeLineStarts(text) : void 0; + ts2.writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 ? "/*".concat(comment.text, "*/") : "//".concat(comment.text); + } + function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { + enterComment(); + var pos = detachedRange.pos, end = detachedRange.end; + var emitFlags = ts2.getEmitFlags(node); + var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0; + var skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 1024) !== 0; + if (!skipLeadingComments) { + emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); + } + exitComment(); + if (emitFlags & 2048 && !commentsDisabled) { + commentsDisabled = true; + emitCallback(node); + commentsDisabled = false; + } else { + emitCallback(node); + } + enterComment(); + if (!skipTrailingComments) { + emitLeadingComments( + detachedRange.end, + /*isEmittedNode*/ + true + ); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } + } + exitComment(); + } + function originalNodesHaveSameParent(nodeA, nodeB) { + nodeA = ts2.getOriginalNode(nodeA); + return nodeA.parent && nodeA.parent === ts2.getOriginalNode(nodeB).parent; + } + function siblingNodePositionsAreComparable(previousNode, nextNode) { + if (nextNode.pos < previousNode.end) { + return false; + } + previousNode = ts2.getOriginalNode(previousNode); + nextNode = ts2.getOriginalNode(nextNode); + var parent2 = previousNode.parent; + if (!parent2 || parent2 !== nextNode.parent) { + return false; + } + var parentNodeArray = ts2.getContainingNodeArray(previousNode); + var prevNodeIndex = parentNodeArray === null || parentNodeArray === void 0 ? void 0 : parentNodeArray.indexOf(previousNode); + return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; + } + function emitLeadingComments(pos, isEmittedNode) { + hasWrittenComment = false; + if (isEmittedNode) { + if (pos === 0 && (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.isDeclarationFile)) { + forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); + } else { + forEachLeadingCommentToEmit(pos, emitLeadingComment); + } + } else if (pos === 0) { + forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); + } + } + function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function shouldWriteComment(text, pos) { + if (printerOptions.onlyPrintJsDocStyle) { + return ts2.isJSDocLikeText(text, pos) || ts2.isPinnedComment(text, pos); + } + return true; + } + function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!hasWrittenComment) { + ts2.emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); + hasWrittenComment = true; + } + emitPos(commentPos); + ts2.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else if (kind === 3) { + writer.writeSpace(" "); + } + } + function emitLeadingCommentsOfPosition(pos) { + if (commentsDisabled || pos === -1) { + return; + } + emitLeadingComments( + pos, + /*isEmittedNode*/ + true + ); + } + function emitTrailingComments(pos) { + forEachTrailingCommentToEmit(pos, emitTrailingComment); + } + function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + emitPos(commentPos); + ts2.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } + } + function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { + if (commentsDisabled) { + return; + } + enterComment(); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); + exitComment(); + } + function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { + if (!currentSourceFile) + return; + emitPos(commentPos); + ts2.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (kind === 2) { + writer.writeLine(); + } + } + function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile) + return; + emitPos(commentPos); + ts2.writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function forEachLeadingCommentToEmit(pos, cb) { + if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { + if (hasDetachedComments(pos)) { + forEachLeadingCommentWithoutDetachedComments(cb); + } else { + ts2.forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + } + } + function forEachTrailingCommentToEmit(end, cb) { + if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { + ts2.forEachTrailingCommentRange(currentSourceFile.text, end, cb); + } + } + function hasDetachedComments(pos) { + return detachedCommentsInfo !== void 0 && ts2.last(detachedCommentsInfo).nodePos === pos; + } + function forEachLeadingCommentWithoutDetachedComments(cb) { + if (!currentSourceFile) + return; + var pos = ts2.last(detachedCommentsInfo).detachedCommentEndPos; + if (detachedCommentsInfo.length - 1) { + detachedCommentsInfo.pop(); + } else { + detachedCommentsInfo = void 0; + } + ts2.forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + function emitDetachedCommentsAndUpdateCommentsInfo(range2) { + var currentDetachedCommentInfo = currentSourceFile && ts2.emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range2, newLine, commentsDisabled); + if (currentDetachedCommentInfo) { + if (detachedCommentsInfo) { + detachedCommentsInfo.push(currentDetachedCommentInfo); + } else { + detachedCommentsInfo = [currentDetachedCommentInfo]; + } + } + } + function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + emitPos(commentPos); + ts2.writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); + emitPos(commentEnd); + } + function isTripleSlashComment(commentPos, commentEnd) { + return !!currentSourceFile && ts2.isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); + } + function getParsedSourceMap(node) { + if (node.parsedSourceMap === void 0 && node.sourceMapText !== void 0) { + node.parsedSourceMap = ts2.tryParseRawSourceMap(node.sourceMapText) || false; + } + return node.parsedSourceMap || void 0; + } + function pipelineEmitWithSourceMaps(hint, node) { + var pipelinePhase = getNextPipelinePhase(3, hint, node); + emitSourceMapsBeforeNode(node); + pipelinePhase(hint, node); + emitSourceMapsAfterNode(node); + } + function emitSourceMapsBeforeNode(node) { + var emitFlags = ts2.getEmitFlags(node); + var sourceMapRange = ts2.getSourceMapRange(node); + if (ts2.isUnparsedNode(node)) { + ts2.Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers"); + var parsed = getParsedSourceMap(node.parent); + if (parsed && sourceMapGenerator) { + sourceMapGenerator.appendSourceMap(writer.getLine(), writer.getColumn(), parsed, node.parent.sourceMapPath, node.parent.getLineAndCharacterOfPosition(node.pos), node.parent.getLineAndCharacterOfPosition(node.end)); + } + } else { + var source = sourceMapRange.source || sourceMapSource; + if (node.kind !== 352 && (emitFlags & 16) === 0 && sourceMapRange.pos >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); + } + if (emitFlags & 64) { + sourceMapsDisabled = true; + } + } + } + function emitSourceMapsAfterNode(node) { + var emitFlags = ts2.getEmitFlags(node); + var sourceMapRange = ts2.getSourceMapRange(node); + if (!ts2.isUnparsedNode(node)) { + if (emitFlags & 64) { + sourceMapsDisabled = false; + } + if (node.kind !== 352 && (emitFlags & 32) === 0 && sourceMapRange.end >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); + } + } + } + function skipSourceTrivia(source, pos) { + return source.skipTrivia ? source.skipTrivia(pos) : ts2.skipTrivia(source.text, pos); + } + function emitPos(pos) { + if (sourceMapsDisabled || ts2.positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { + return; + } + var _a3 = ts2.getLineAndCharacterOfPosition(sourceMapSource, pos), sourceLine = _a3.line, sourceCharacter = _a3.character; + sourceMapGenerator.addMapping( + writer.getLine(), + writer.getColumn(), + sourceMapSourceIndex, + sourceLine, + sourceCharacter, + /*nameIndex*/ + void 0 + ); + } + function emitSourcePos(source, pos) { + if (source !== sourceMapSource) { + var savedSourceMapSource = sourceMapSource; + var savedSourceMapSourceIndex = sourceMapSourceIndex; + setSourceMapSource(source); + emitPos(pos); + resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + } else { + emitPos(pos); + } + } + function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { + if (sourceMapsDisabled || node && ts2.isInJsonFile(node)) { + return emitCallback(token, writer2, tokenPos); + } + var emitNode = node && node.emitNode; + var emitFlags = emitNode && emitNode.flags || 0; + var range2 = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; + var source = range2 && range2.source || sourceMapSource; + tokenPos = skipSourceTrivia(source, range2 ? range2.pos : tokenPos); + if ((emitFlags & 128) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + tokenPos = emitCallback(token, writer2, tokenPos); + if (range2) + tokenPos = range2.end; + if ((emitFlags & 256) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + return tokenPos; + } + function setSourceMapSource(source) { + if (sourceMapsDisabled) { + return; + } + sourceMapSource = source; + if (source === mostRecentlyAddedSourceMapSource) { + sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; + return; + } + if (isJsonSourceMapSource(source)) { + return; + } + sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); + if (printerOptions.inlineSources) { + sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); + } + mostRecentlyAddedSourceMapSource = source; + mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; + } + function resetSourceMapSource(source, sourceIndex) { + sourceMapSource = source; + sourceMapSourceIndex = sourceIndex; + } + function isJsonSourceMapSource(sourceFile) { + return ts2.fileExtensionIs( + sourceFile.fileName, + ".json" + /* Extension.Json */ + ); + } + } + ts2.createPrinter = createPrinter; + function createBracketsMap() { + var brackets2 = []; + brackets2[ + 1024 + /* ListFormat.Braces */ + ] = ["{", "}"]; + brackets2[ + 2048 + /* ListFormat.Parenthesis */ + ] = ["(", ")"]; + brackets2[ + 4096 + /* ListFormat.AngleBrackets */ + ] = ["<", ">"]; + brackets2[ + 8192 + /* ListFormat.SquareBrackets */ + ] = ["[", "]"]; + return brackets2; + } + function getOpeningBracket(format5) { + return brackets[ + format5 & 15360 + /* ListFormat.BracketsMask */ + ][0]; + } + function getClosingBracket(format5) { + return brackets[ + format5 & 15360 + /* ListFormat.BracketsMask */ + ][1]; + } + var TempFlags; + (function(TempFlags2) { + TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; + TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; + TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; + })(TempFlags || (TempFlags = {})); + function emitListItemNoParenthesizer(node, emit3, _parenthesizerRule, _index) { + emit3(node); + } + function emitListItemWithParenthesizerRuleSelector(node, emit3, parenthesizerRuleSelector, index4) { + emit3(node, parenthesizerRuleSelector.select(index4)); + } + function emitListItemWithParenthesizerRule(node, emit3, parenthesizerRule, _index) { + emit3(node, parenthesizerRule); + } + function getEmitListItem(emit3, parenthesizerRule) { + return emit3.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return void 0; + } + var cachedReadDirectoryResult = new ts2.Map(); + var getCanonicalFileName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames, + fileExists, + readFile: function(path2, encoding) { + return host.readFile(path2, encoding); + }, + directoryExists: host.directoryExists && directoryExists, + getDirectories, + readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile2, + addOrDeleteFileOrDirectory, + addOrDeleteFile, + clearCache, + realpath: host.realpath && realpath2 + }; + function toPath2(fileName) { + return ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(ts2.ensureTrailingDirectorySeparator(rootDirPath)); + } + function getCachedFileSystemEntriesForBaseDir(path2) { + var entries = getCachedFileSystemEntries(ts2.getDirectoryPath(path2)); + if (!entries) { + return entries; + } + if (!entries.sortedAndCanonicalizedFiles) { + entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort(); + entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort(); + } + return entries; + } + function getBaseNameOfFileName(fileName) { + return ts2.getBaseFileName(ts2.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var _a2; + if (!host.realpath || ts2.ensureTrailingDirectorySeparator(toPath2(host.realpath(rootDir))) === rootDirPath) { + var resultFromHost = { + files: ts2.map(host.readDirectory( + rootDir, + /*extensions*/ + void 0, + /*exclude*/ + void 0, + /*include*/ + ["*.*"] + ), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(ts2.ensureTrailingDirectorySeparator(rootDirPath), resultFromHost); + return resultFromHost; + } + if ((_a2 = host.directoryExists) === null || _a2 === void 0 ? void 0 : _a2.call(host, rootDir)) { + cachedReadDirectoryResult.set(rootDirPath, false); + return false; + } + return void 0; + } + function tryReadDirectory(rootDir, rootDirPath) { + rootDirPath = ts2.ensureTrailingDirectorySeparator(rootDirPath); + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } catch (_e2) { + ts2.Debug.assert(!cachedReadDirectoryResult.has(ts2.ensureTrailingDirectorySeparator(rootDirPath))); + return void 0; + } + } + function hasEntry(entries, name2) { + var index4 = ts2.binarySearch(entries, name2, ts2.identity, ts2.compareStringsCaseSensitive); + return index4 >= 0; + } + function writeFile2(fileName, data, writeByteOrderMark) { + var path2 = toPath2(fileName); + var result2 = getCachedFileSystemEntriesForBaseDir(path2); + if (result2) { + updateFilesOfFileSystemEntry( + result2, + getBaseNameOfFileName(fileName), + /*fileExists*/ + true + ); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path2 = toPath2(fileName); + var result2 = getCachedFileSystemEntriesForBaseDir(path2); + return result2 && hasEntry(result2.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) || host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path2 = toPath2(dirPath); + return cachedReadDirectoryResult.has(ts2.ensureTrailingDirectorySeparator(path2)) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path2 = toPath2(dirPath); + var result2 = getCachedFileSystemEntriesForBaseDir(path2); + if (result2) { + var baseName = getBaseNameOfFileName(dirPath); + var canonicalizedBaseName = getCanonicalFileName(baseName); + var canonicalizedDirectories = result2.sortedAndCanonicalizedDirectories; + if (ts2.insertSorted(canonicalizedDirectories, canonicalizedBaseName, ts2.compareStringsCaseSensitive)) { + result2.directories.push(baseName); + } + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath2(rootDir); + var result2 = tryReadDirectory(rootDir, rootDirPath); + if (result2) { + return result2.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions6, excludes, includes2, depth) { + var rootDirPath = toPath2(rootDir); + var rootResult = tryReadDirectory(rootDir, rootDirPath); + var rootSymLinkResult; + if (rootResult !== void 0) { + return ts2.matchFiles(rootDir, extensions6, excludes, includes2, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath2); + } + return host.readDirectory(rootDir, extensions6, excludes, includes2, depth); + function getFileSystemEntries(dir2) { + var path2 = toPath2(dir2); + if (path2 === rootDirPath) { + return rootResult || getFileSystemEntriesFromHost(dir2, path2); + } + var result2 = tryReadDirectory(dir2, path2); + return result2 !== void 0 ? result2 || getFileSystemEntriesFromHost(dir2, path2) : ts2.emptyFileSystemEntries; + } + function getFileSystemEntriesFromHost(dir2, path2) { + if (rootSymLinkResult && path2 === rootDirPath) + return rootSymLinkResult; + var result2 = { + files: ts2.map(host.readDirectory( + dir2, + /*extensions*/ + void 0, + /*exclude*/ + void 0, + /*include*/ + ["*.*"] + ), getBaseNameOfFileName) || ts2.emptyArray, + directories: host.getDirectories(dir2) || ts2.emptyArray + }; + if (path2 === rootDirPath) + rootSymLinkResult = result2; + return result2; + } + } + function realpath2(s7) { + return host.realpath ? host.realpath(s7) : s7; + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult !== void 0) { + clearCache(); + return void 0; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return void 0; + } + if (!host.directoryExists) { + clearCache(); + return void 0; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) { + clearCache(); + } else { + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts2.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts2.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists2) { + var canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles; + var canonicalizedBaseName = getCanonicalFileName(baseName); + if (fileExists2) { + if (ts2.insertSorted(canonicalizedFiles, canonicalizedBaseName, ts2.compareStringsCaseSensitive)) { + parentResult.files.push(baseName); + } + } else { + var sortedIndex2 = ts2.binarySearch(canonicalizedFiles, canonicalizedBaseName, ts2.identity, ts2.compareStringsCaseSensitive); + if (sortedIndex2 >= 0) { + canonicalizedFiles.splice(sortedIndex2, 1); + var unsortedIndex = parentResult.files.findIndex(function(entry) { + return getCanonicalFileName(entry) === canonicalizedBaseName; + }); + parentResult.files.splice(unsortedIndex, 1); + } + } + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts2.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + var ConfigFileProgramReloadLevel; + (function(ConfigFileProgramReloadLevel2) { + ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["None"] = 0] = "None"; + ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Partial"] = 1] = "Partial"; + ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Full"] = 2] = "Full"; + })(ConfigFileProgramReloadLevel = ts2.ConfigFileProgramReloadLevel || (ts2.ConfigFileProgramReloadLevel = {})); + function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath2) { + var _a2; + var extendedConfigs = ts2.arrayToMap(((_a2 = options === null || options === void 0 ? void 0 : options.configFile) === null || _a2 === void 0 ? void 0 : _a2.extendedSourceFiles) || ts2.emptyArray, toPath2); + extendedConfigFilesMap.forEach(function(watcher, extendedConfigFilePath) { + if (!extendedConfigs.has(extendedConfigFilePath)) { + watcher.projects.delete(projectPath); + watcher.close(); + } + }); + extendedConfigs.forEach(function(extendedConfigFileName, extendedConfigFilePath) { + var existing = extendedConfigFilesMap.get(extendedConfigFilePath); + if (existing) { + existing.projects.add(projectPath); + } else { + extendedConfigFilesMap.set(extendedConfigFilePath, { + projects: new ts2.Set([projectPath]), + watcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath), + close: function() { + var existing2 = extendedConfigFilesMap.get(extendedConfigFilePath); + if (!existing2 || existing2.projects.size !== 0) + return; + existing2.watcher.close(); + extendedConfigFilesMap.delete(extendedConfigFilePath); + } + }); + } + }); + } + ts2.updateSharedExtendedConfigFileWatcher = updateSharedExtendedConfigFileWatcher; + function clearSharedExtendedConfigFileWatcher(projectPath, extendedConfigFilesMap) { + extendedConfigFilesMap.forEach(function(watcher) { + if (watcher.projects.delete(projectPath)) + watcher.close(); + }); + } + ts2.clearSharedExtendedConfigFileWatcher = clearSharedExtendedConfigFileWatcher; + function cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath2) { + if (!extendedConfigCache.delete(extendedConfigFilePath)) + return; + extendedConfigCache.forEach(function(_a2, key) { + var _b; + var extendedResult = _a2.extendedResult; + if ((_b = extendedResult.extendedSourceFiles) === null || _b === void 0 ? void 0 : _b.some(function(extendedFile) { + return toPath2(extendedFile) === extendedConfigFilePath; + })) { + cleanExtendedConfigCache(extendedConfigCache, key, toPath2); + } + }); + } + ts2.cleanExtendedConfigCache = cleanExtendedConfigCache; + function updatePackageJsonWatch(lookups, packageJsonWatches, createPackageJsonWatch) { + var newMap = new ts2.Map(lookups); + ts2.mutateMap(packageJsonWatches, newMap, { + createNewValue: createPackageJsonWatch, + onDeleteValue: ts2.closeFileWatcher + }); + } + ts2.updatePackageJsonWatch = updatePackageJsonWatch; + function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) { + var missingFilePaths = program.getMissingFilePaths(); + var newMissingFilePathMap = ts2.arrayToMap(missingFilePaths, ts2.identity, ts2.returnTrue); + ts2.mutateMap(missingFileWatches, newMissingFilePathMap, { + // Watch the missing files + createNewValue: createMissingFileWatch, + // Files that are no longer missing (e.g. because they are no longer required) + // should no longer be watched. + onDeleteValue: ts2.closeFileWatcher + }); + } + ts2.updateMissingFilePathsWatch = updateMissingFilePathsWatch; + function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) { + ts2.mutateMap(existingWatchedForWildcards, wildcardDirectories, { + // Create new watch and recursive info + createNewValue: createWildcardDirectoryWatcher, + // Close existing watch thats not needed any more + onDeleteValue: closeFileWatcherOf, + // Close existing watch that doesnt match in the flags + onExistingValue: updateWildcardDirectoryWatcher + }); + function createWildcardDirectoryWatcher(directory, flags) { + return { + watcher: watchDirectory(directory, flags), + flags + }; + } + function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) { + if (existingWatcher.flags === flags) { + return; + } + existingWatcher.watcher.close(); + existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags)); + } + } + ts2.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isIgnoredFileFromWildCardWatching(_a2) { + var watchedDirPath = _a2.watchedDirPath, fileOrDirectory = _a2.fileOrDirectory, fileOrDirectoryPath = _a2.fileOrDirectoryPath, configFileName = _a2.configFileName, options = _a2.options, program = _a2.program, extraFileExtensions = _a2.extraFileExtensions, currentDirectory = _a2.currentDirectory, useCaseSensitiveFileNames = _a2.useCaseSensitiveFileNames, writeLog = _a2.writeLog, toPath2 = _a2.toPath; + var newPath = ts2.removeIgnoredPath(fileOrDirectoryPath); + if (!newPath) { + writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory)); + return true; + } + fileOrDirectoryPath = newPath; + if (fileOrDirectoryPath === watchedDirPath) + return false; + if (ts2.hasExtension(fileOrDirectoryPath) && !ts2.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) { + writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory)); + return true; + } + if (ts2.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) { + writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory)); + return true; + } + if (!program) + return false; + if (ts2.outFile(options) || options.outDir) + return false; + if (ts2.isDeclarationFileName(fileOrDirectoryPath)) { + if (options.declarationDir) + return false; + } else if (!ts2.fileExtensionIsOneOf(fileOrDirectoryPath, ts2.supportedJSExtensionsFlat)) { + return false; + } + var filePathWithoutExtension = ts2.removeFileExtension(fileOrDirectoryPath); + var realProgram = ts2.isArray(program) ? void 0 : isBuilderProgram(program) ? program.getProgramOrUndefined() : program; + var builderProgram = !realProgram && !ts2.isArray(program) ? program : void 0; + if (hasSourceFile(filePathWithoutExtension + ".ts") || hasSourceFile(filePathWithoutExtension + ".tsx")) { + writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory)); + return true; + } + return false; + function hasSourceFile(file) { + return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!ts2.find(program, function(rootFile) { + return toPath2(rootFile) === file; + }); + } + } + ts2.isIgnoredFileFromWildCardWatching = isIgnoredFileFromWildCardWatching; + function isBuilderProgram(program) { + return !!program.getState; + } + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts2.isEmittedFileOfProgram = isEmittedFileOfProgram; + var WatchLogLevel; + (function(WatchLogLevel2) { + WatchLogLevel2[WatchLogLevel2["None"] = 0] = "None"; + WatchLogLevel2[WatchLogLevel2["TriggerOnly"] = 1] = "TriggerOnly"; + WatchLogLevel2[WatchLogLevel2["Verbose"] = 2] = "Verbose"; + })(WatchLogLevel = ts2.WatchLogLevel || (ts2.WatchLogLevel = {})); + function getWatchFactory(host, watchLogLevel, log3, getDetailWatchInfo) { + ts2.setSysLog(watchLogLevel === WatchLogLevel.Verbose ? log3 : ts2.noop); + var plainInvokeFactory = { + watchFile: function(file, callback, pollingInterval, options) { + return host.watchFile(file, callback, pollingInterval, options); + }, + watchDirectory: function(directory, callback, flags, options) { + return host.watchDirectory(directory, callback, (flags & 1) !== 0, options); + } + }; + var triggerInvokingFactory = watchLogLevel !== WatchLogLevel.None ? { + watchFile: createTriggerLoggingAddWatch("watchFile"), + watchDirectory: createTriggerLoggingAddWatch("watchDirectory") + } : void 0; + var factory = watchLogLevel === WatchLogLevel.Verbose ? { + watchFile: createFileWatcherWithLogging, + watchDirectory: createDirectoryWatcherWithLogging + } : triggerInvokingFactory || plainInvokeFactory; + var excludeWatcherFactory = watchLogLevel === WatchLogLevel.Verbose ? createExcludeWatcherWithLogging : ts2.returnNoopFileWatcher; + return { + watchFile: createExcludeHandlingAddWatch("watchFile"), + watchDirectory: createExcludeHandlingAddWatch("watchDirectory") + }; + function createExcludeHandlingAddWatch(key) { + return function(file, cb, flags, options, detailInfo1, detailInfo2) { + var _a2; + return !ts2.matchesExclude(file, key === "watchFile" ? options === null || options === void 0 ? void 0 : options.excludeFiles : options === null || options === void 0 ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a2 = host.getCurrentDirectory) === null || _a2 === void 0 ? void 0 : _a2.call(host)) || "") ? factory[key].call( + /*thisArgs*/ + void 0, + file, + cb, + flags, + options, + detailInfo1, + detailInfo2 + ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); + }; + } + function useCaseSensitiveFileNames() { + return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); + } + function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { + log3("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); + return { + close: function() { + return log3("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); + } + }; + } + function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + log3("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); + var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); + return { + close: function() { + log3("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); + watcher.close(); + } + }; + } + function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); + log3(watchInfo); + var start = ts2.timestamp(); + var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); + var elapsed = ts2.timestamp() - start; + log3("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo)); + return { + close: function() { + var watchInfo2 = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); + log3(watchInfo2); + var start2 = ts2.timestamp(); + watcher.close(); + var elapsed2 = ts2.timestamp() - start2; + log3("Elapsed:: ".concat(elapsed2, "ms ").concat(watchInfo2)); + } + }; + } + function createTriggerLoggingAddWatch(key) { + return function(file, cb, flags, options, detailInfo1, detailInfo2) { + return plainInvokeFactory[key].call( + /*thisArgs*/ + void 0, + file, + function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var triggerredInfo = "".concat(key === "watchFile" ? "FileWatcher" : "DirectoryWatcher", ":: Triggered with ").concat(args[0], " ").concat(args[1] !== void 0 ? args[1] : "", ":: ").concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); + log3(triggerredInfo); + var start = ts2.timestamp(); + cb.call.apply(cb, __spreadArray9([ + /*thisArg*/ + void 0 + ], args, false)); + var elapsed = ts2.timestamp() - start; + log3("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo)); + }, + flags, + options, + detailInfo1, + detailInfo2 + ); + }; + } + function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2) { + return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo2 ? getDetailWatchInfo2(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2)); + } + } + ts2.getWatchFactory = getWatchFactory; + function getFallbackOptions(options) { + var fallbackPolling = options === null || options === void 0 ? void 0 : options.fallbackPolling; + return { + watchFile: fallbackPolling !== void 0 ? fallbackPolling : ts2.WatchFileKind.PriorityPollingInterval + }; + } + ts2.getFallbackOptions = getFallbackOptions; + function closeFileWatcherOf(objWithWatcher) { + objWithWatcher.watcher.close(); + } + ts2.closeFileWatcherOf = closeFileWatcherOf; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function findConfigFile(searchPath, fileExists, configName) { + if (configName === void 0) { + configName = "tsconfig.json"; + } + return ts2.forEachAncestorDirectory(searchPath, function(ancestor) { + var fileName = ts2.combinePaths(ancestor, configName); + return fileExists(fileName) ? fileName : void 0; + }); + } + ts2.findConfigFile = findConfigFile; + function resolveTripleslashReference(moduleName3, containingFile) { + var basePath = ts2.getDirectoryPath(containingFile); + var referencedFileName = ts2.isRootedDiskPath(moduleName3) ? moduleName3 : ts2.combinePaths(basePath, moduleName3); + return ts2.normalizePath(referencedFileName); + } + ts2.resolveTripleslashReference = resolveTripleslashReference; + function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { + var commonPathComponents; + var failed = ts2.forEach(fileNames, function(sourceFile) { + var sourcePathComponents = ts2.getNormalizedPathComponents(sourceFile, currentDirectory); + sourcePathComponents.pop(); + if (!commonPathComponents) { + commonPathComponents = sourcePathComponents; + return; + } + var n7 = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (var i7 = 0; i7 < n7; i7++) { + if (getCanonicalFileName(commonPathComponents[i7]) !== getCanonicalFileName(sourcePathComponents[i7])) { + if (i7 === 0) { + return true; + } + commonPathComponents.length = i7; + break; + } + } + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + if (failed) { + return ""; + } + if (!commonPathComponents) { + return currentDirectory; + } + return ts2.getPathFromPathComponents(commonPathComponents); + } + ts2.computeCommonSourceDirectoryOfFilenames = computeCommonSourceDirectoryOfFilenames; + function createCompilerHost(options, setParentNodes) { + return createCompilerHostWorker(options, setParentNodes); + } + ts2.createCompilerHost = createCompilerHost; + function createCompilerHostWorker(options, setParentNodes, system) { + if (system === void 0) { + system = ts2.sys; + } + var existingDirectories = new ts2.Map(); + var getCanonicalFileName = ts2.createGetCanonicalFileName(system.useCaseSensitiveFileNames); + function getSourceFile(fileName, languageVersionOrOptions, onError) { + var text; + try { + ts2.performance.mark("beforeIORead"); + text = compilerHost.readFile(fileName); + ts2.performance.mark("afterIORead"); + ts2.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + text = ""; + } + return text !== void 0 ? ts2.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0; + } + function directoryExists(directoryPath) { + if (existingDirectories.has(directoryPath)) { + return true; + } + if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) { + existingDirectories.set(directoryPath, true); + return true; + } + return false; + } + function writeFile2(fileName, data, writeByteOrderMark, onError) { + try { + ts2.performance.mark("beforeIOWrite"); + ts2.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function(path2, data2, writeByteOrderMark2) { + return system.writeFile(path2, data2, writeByteOrderMark2); + }, function(path2) { + return (compilerHost.createDirectory || system.createDirectory)(path2); + }, function(path2) { + return directoryExists(path2); + }); + ts2.performance.mark("afterIOWrite"); + ts2.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + } + } + function getDefaultLibLocation() { + return ts2.getDirectoryPath(ts2.normalizePath(system.getExecutingFilePath())); + } + var newLine = ts2.getNewLineCharacter(options, function() { + return system.newLine; + }); + var realpath2 = system.realpath && function(path2) { + return system.realpath(path2); + }; + var compilerHost = { + getSourceFile, + getDefaultLibLocation, + getDefaultLibFileName: function(options2) { + return ts2.combinePaths(getDefaultLibLocation(), ts2.getDefaultLibFileName(options2)); + }, + writeFile: writeFile2, + getCurrentDirectory: ts2.memoize(function() { + return system.getCurrentDirectory(); + }), + useCaseSensitiveFileNames: function() { + return system.useCaseSensitiveFileNames; + }, + getCanonicalFileName, + getNewLine: function() { + return newLine; + }, + fileExists: function(fileName) { + return system.fileExists(fileName); + }, + readFile: function(fileName) { + return system.readFile(fileName); + }, + trace: function(s7) { + return system.write(s7 + newLine); + }, + directoryExists: function(directoryName) { + return system.directoryExists(directoryName); + }, + getEnvironmentVariable: function(name2) { + return system.getEnvironmentVariable ? system.getEnvironmentVariable(name2) : ""; + }, + getDirectories: function(path2) { + return system.getDirectories(path2); + }, + realpath: realpath2, + readDirectory: function(path2, extensions6, include, exclude, depth) { + return system.readDirectory(path2, extensions6, include, exclude, depth); + }, + createDirectory: function(d7) { + return system.createDirectory(d7); + }, + createHash: ts2.maybeBind(system, system.createHash) + }; + return compilerHost; + } + ts2.createCompilerHostWorker = createCompilerHostWorker; + function changeCompilerHostLikeToUseCache(host, toPath2, getSourceFile) { + var originalReadFile = host.readFile; + var originalFileExists = host.fileExists; + var originalDirectoryExists = host.directoryExists; + var originalCreateDirectory = host.createDirectory; + var originalWriteFile = host.writeFile; + var readFileCache = new ts2.Map(); + var fileExistsCache = new ts2.Map(); + var directoryExistsCache = new ts2.Map(); + var sourceFileCache = new ts2.Map(); + var readFileWithCache = function(fileName) { + var key = toPath2(fileName); + var value2 = readFileCache.get(key); + if (value2 !== void 0) + return value2 !== false ? value2 : void 0; + return setReadFileCache(key, fileName); + }; + var setReadFileCache = function(key, fileName) { + var newValue = originalReadFile.call(host, fileName); + readFileCache.set(key, newValue !== void 0 ? newValue : false); + return newValue; + }; + host.readFile = function(fileName) { + var key = toPath2(fileName); + var value2 = readFileCache.get(key); + if (value2 !== void 0) + return value2 !== false ? value2 : void 0; + if (!ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + ) && !ts2.isBuildInfoFile(fileName)) { + return originalReadFile.call(host, fileName); + } + return setReadFileCache(key, fileName); + }; + var getSourceFileWithCache = getSourceFile ? function(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { + var key = toPath2(fileName); + var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0; + var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat); + var value2 = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key); + if (value2) + return value2; + var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile); + if (sourceFile && (ts2.isDeclarationFileName(fileName) || ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + ))) { + sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts2.Map()).set(key, sourceFile)); + } + return sourceFile; + } : void 0; + host.fileExists = function(fileName) { + var key = toPath2(fileName); + var value2 = fileExistsCache.get(key); + if (value2 !== void 0) + return value2; + var newValue = originalFileExists.call(host, fileName); + fileExistsCache.set(key, !!newValue); + return newValue; + }; + if (originalWriteFile) { + host.writeFile = function(fileName, data) { + var rest2 = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest2[_i - 2] = arguments[_i]; + } + var key = toPath2(fileName); + fileExistsCache.delete(key); + var value2 = readFileCache.get(key); + if (value2 !== void 0 && value2 !== data) { + readFileCache.delete(key); + sourceFileCache.forEach(function(map4) { + return map4.delete(key); + }); + } else if (getSourceFileWithCache) { + sourceFileCache.forEach(function(map4) { + var sourceFile = map4.get(key); + if (sourceFile && sourceFile.text !== data) { + map4.delete(key); + } + }); + } + originalWriteFile.call.apply(originalWriteFile, __spreadArray9([host, fileName, data], rest2, false)); + }; + } + if (originalDirectoryExists) { + host.directoryExists = function(directory) { + var key = toPath2(directory); + var value2 = directoryExistsCache.get(key); + if (value2 !== void 0) + return value2; + var newValue = originalDirectoryExists.call(host, directory); + directoryExistsCache.set(key, !!newValue); + return newValue; + }; + if (originalCreateDirectory) { + host.createDirectory = function(directory) { + var key = toPath2(directory); + directoryExistsCache.delete(key); + originalCreateDirectory.call(host, directory); + }; + } + } + return { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + getSourceFileWithCache, + readFileWithCache + }; + } + ts2.changeCompilerHostLikeToUseCache = changeCompilerHostLikeToUseCache; + function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { + var diagnostics; + diagnostics = ts2.addRange(diagnostics, program.getConfigFileParsingDiagnostics()); + diagnostics = ts2.addRange(diagnostics, program.getOptionsDiagnostics(cancellationToken)); + diagnostics = ts2.addRange(diagnostics, program.getSyntacticDiagnostics(sourceFile, cancellationToken)); + diagnostics = ts2.addRange(diagnostics, program.getGlobalDiagnostics(cancellationToken)); + diagnostics = ts2.addRange(diagnostics, program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (ts2.getEmitDeclarations(program.getCompilerOptions())) { + diagnostics = ts2.addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + } + return ts2.sortAndDeduplicateDiagnostics(diagnostics || ts2.emptyArray); + } + ts2.getPreEmitDiagnostics = getPreEmitDiagnostics; + function formatDiagnostics(diagnostics, host) { + var output = ""; + for (var _i = 0, diagnostics_3 = diagnostics; _i < diagnostics_3.length; _i++) { + var diagnostic = diagnostics_3[_i]; + output += formatDiagnostic(diagnostic, host); + } + return output; + } + ts2.formatDiagnostics = formatDiagnostics; + function formatDiagnostic(diagnostic, host) { + var errorMessage = "".concat(ts2.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine()); + if (diagnostic.file) { + var _a2 = ts2.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a2.line, character = _a2.character; + var fileName = diagnostic.file.fileName; + var relativeFileName = ts2.convertToRelativePath(fileName, host.getCurrentDirectory(), function(fileName2) { + return host.getCanonicalFileName(fileName2); + }); + return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage; + } + return errorMessage; + } + ts2.formatDiagnostic = formatDiagnostic; + var ForegroundColorEscapeSequences; + (function(ForegroundColorEscapeSequences2) { + ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m"; + ForegroundColorEscapeSequences2["Red"] = "\x1B[91m"; + ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m"; + ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m"; + ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m"; + })(ForegroundColorEscapeSequences = ts2.ForegroundColorEscapeSequences || (ts2.ForegroundColorEscapeSequences = {})); + var gutterStyleSequence = "\x1B[7m"; + var gutterSeparator = " "; + var resetEscapeSequence = "\x1B[0m"; + var ellipsis = "..."; + var halfIndent = " "; + var indent = " "; + function getCategoryFormat(category) { + switch (category) { + case ts2.DiagnosticCategory.Error: + return ForegroundColorEscapeSequences.Red; + case ts2.DiagnosticCategory.Warning: + return ForegroundColorEscapeSequences.Yellow; + case ts2.DiagnosticCategory.Suggestion: + return ts2.Debug.fail("Should never get an Info diagnostic on the command line."); + case ts2.DiagnosticCategory.Message: + return ForegroundColorEscapeSequences.Blue; + } + } + function formatColorAndReset(text, formatStyle) { + return formatStyle + text + resetEscapeSequence; + } + ts2.formatColorAndReset = formatColorAndReset; + function formatCodeSpan(file, start, length, indent2, squiggleColor, host) { + var _a2 = ts2.getLineAndCharacterOfPosition(file, start), firstLine = _a2.line, firstLineChar = _a2.character; + var _b = ts2.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character; + var lastLineInFile = ts2.getLineAndCharacterOfPosition(file, file.text.length).line; + var hasMoreThanFiveLines = lastLine - firstLine >= 4; + var gutterWidth = (lastLine + 1 + "").length; + if (hasMoreThanFiveLines) { + gutterWidth = Math.max(ellipsis.length, gutterWidth); + } + var context2 = ""; + for (var i7 = firstLine; i7 <= lastLine; i7++) { + context2 += host.getNewLine(); + if (hasMoreThanFiveLines && firstLine + 1 < i7 && i7 < lastLine - 1) { + context2 += indent2 + formatColorAndReset(ts2.padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + i7 = lastLine - 1; + } + var lineStart = ts2.getPositionOfLineAndCharacter(file, i7, 0); + var lineEnd = i7 < lastLineInFile ? ts2.getPositionOfLineAndCharacter(file, i7 + 1, 0) : file.text.length; + var lineContent = file.text.slice(lineStart, lineEnd); + lineContent = ts2.trimStringEnd(lineContent); + lineContent = lineContent.replace(/\t/g, " "); + context2 += indent2 + formatColorAndReset(ts2.padLeft(i7 + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context2 += lineContent + host.getNewLine(); + context2 += indent2 + formatColorAndReset(ts2.padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context2 += squiggleColor; + if (i7 === firstLine) { + var lastCharForLine = i7 === lastLine ? lastLineChar : void 0; + context2 += lineContent.slice(0, firstLineChar).replace(/\S/g, " "); + context2 += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~"); + } else if (i7 === lastLine) { + context2 += lineContent.slice(0, lastLineChar).replace(/./g, "~"); + } else { + context2 += lineContent.replace(/./g, "~"); + } + context2 += resetEscapeSequence; + } + return context2; + } + function formatLocation(file, start, host, color) { + if (color === void 0) { + color = formatColorAndReset; + } + var _a2 = ts2.getLineAndCharacterOfPosition(file, start), firstLine = _a2.line, firstLineChar = _a2.character; + var relativeFileName = host ? ts2.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function(fileName) { + return host.getCanonicalFileName(fileName); + }) : file.fileName; + var output = ""; + output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + return output; + } + ts2.formatLocation = formatLocation; + function formatDiagnosticsWithColorAndContext(diagnostics, host) { + var output = ""; + for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) { + var diagnostic = diagnostics_4[_i]; + if (diagnostic.file) { + var file = diagnostic.file, start = diagnostic.start; + output += formatLocation(file, start, host); + output += " - "; + } + output += formatColorAndReset(ts2.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); + output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + if (diagnostic.file) { + output += host.getNewLine(); + output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host); + } + if (diagnostic.relatedInformation) { + output += host.getNewLine(); + for (var _a2 = 0, _b = diagnostic.relatedInformation; _a2 < _b.length; _a2++) { + var _c = _b[_a2], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText; + if (file) { + output += host.getNewLine(); + output += halfIndent + formatLocation(file, start, host); + output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host); + } + output += host.getNewLine(); + output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine()); + } + } + output += host.getNewLine(); + } + return output; + } + ts2.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; + function flattenDiagnosticMessageText(diag, newLine, indent2) { + if (indent2 === void 0) { + indent2 = 0; + } + if (ts2.isString(diag)) { + return diag; + } else if (diag === void 0) { + return ""; + } + var result2 = ""; + if (indent2) { + result2 += newLine; + for (var i7 = 0; i7 < indent2; i7++) { + result2 += " "; + } + } + result2 += diag.messageText; + indent2++; + if (diag.next) { + for (var _i = 0, _a2 = diag.next; _i < _a2.length; _i++) { + var kid = _a2[_i]; + result2 += flattenDiagnosticMessageText(kid, newLine, indent2); + } + } + return result2; + } + ts2.flattenDiagnosticMessageText = flattenDiagnosticMessageText; + function loadWithTypeDirectiveCache(names, containingFile, redirectedReference, containingFileMode, loader2) { + if (names.length === 0) { + return []; + } + var resolutions = []; + var cache = new ts2.Map(); + for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { + var name2 = names_2[_i]; + var result2 = void 0; + var mode = getModeForFileReference(name2, containingFileMode); + var strName = ts2.isString(name2) ? name2 : name2.fileName.toLowerCase(); + var cacheKey = mode !== void 0 ? "".concat(mode, "|").concat(strName) : strName; + if (cache.has(cacheKey)) { + result2 = cache.get(cacheKey); + } else { + cache.set(cacheKey, result2 = loader2(strName, containingFile, redirectedReference, mode)); + } + resolutions.push(result2); + } + return resolutions; + } + ts2.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache; + function getModeForFileReference(ref, containingFileMode) { + return (ts2.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode; + } + ts2.getModeForFileReference = getModeForFileReference; + function getModeForResolutionAtIndex(file, index4) { + if (file.impliedNodeFormat === void 0) + return void 0; + return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index4)); + } + ts2.getModeForResolutionAtIndex = getModeForResolutionAtIndex; + function isExclusivelyTypeOnlyImportOrExport(decl) { + var _a2; + if (ts2.isExportDeclaration(decl)) { + return decl.isTypeOnly; + } + if ((_a2 = decl.importClause) === null || _a2 === void 0 ? void 0 : _a2.isTypeOnly) { + return true; + } + return false; + } + ts2.isExclusivelyTypeOnlyImportOrExport = isExclusivelyTypeOnlyImportOrExport; + function getModeForUsageLocation(file, usage) { + var _a2, _b; + if (file.impliedNodeFormat === void 0) + return void 0; + if (ts2.isImportDeclaration(usage.parent) || ts2.isExportDeclaration(usage.parent)) { + var isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent); + if (isTypeOnly) { + var override = getResolutionModeOverrideForClause(usage.parent.assertClause); + if (override) { + return override; + } + } + } + if (usage.parent.parent && ts2.isImportTypeNode(usage.parent.parent)) { + var override = getResolutionModeOverrideForClause((_a2 = usage.parent.parent.assertions) === null || _a2 === void 0 ? void 0 : _a2.assertClause); + if (override) { + return override; + } + } + if (file.impliedNodeFormat !== ts2.ModuleKind.ESNext) { + return ts2.isImportCall(ts2.walkUpParenthesizedExpressions(usage.parent)) ? ts2.ModuleKind.ESNext : ts2.ModuleKind.CommonJS; + } + var exprParentParent = (_b = ts2.walkUpParenthesizedExpressions(usage.parent)) === null || _b === void 0 ? void 0 : _b.parent; + return exprParentParent && ts2.isImportEqualsDeclaration(exprParentParent) ? ts2.ModuleKind.CommonJS : ts2.ModuleKind.ESNext; + } + ts2.getModeForUsageLocation = getModeForUsageLocation; + function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) { + if (!clause) + return void 0; + if (ts2.length(clause.elements) !== 1) { + grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(clause, ts2.Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require); + return void 0; + } + var elem = clause.elements[0]; + if (!ts2.isStringLiteralLike(elem.name)) + return void 0; + if (elem.name.text !== "resolution-mode") { + grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.name, ts2.Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions); + return void 0; + } + if (!ts2.isStringLiteralLike(elem.value)) + return void 0; + if (elem.value.text !== "import" && elem.value.text !== "require") { + grammarErrorOnNode === null || grammarErrorOnNode === void 0 ? void 0 : grammarErrorOnNode(elem.value, ts2.Diagnostics.resolution_mode_should_be_either_require_or_import); + return void 0; + } + return elem.value.text === "import" ? ts2.ModuleKind.ESNext : ts2.ModuleKind.CommonJS; + } + ts2.getResolutionModeOverrideForClause = getResolutionModeOverrideForClause; + function loadWithModeAwareCache(names, containingFile, containingFileName, redirectedReference, loader2) { + if (names.length === 0) { + return []; + } + var resolutions = []; + var cache = new ts2.Map(); + var i7 = 0; + for (var _i = 0, names_3 = names; _i < names_3.length; _i++) { + var name2 = names_3[_i]; + var result2 = void 0; + var mode = getModeForResolutionAtIndex(containingFile, i7); + i7++; + var cacheKey = mode !== void 0 ? "".concat(mode, "|").concat(name2) : name2; + if (cache.has(cacheKey)) { + result2 = cache.get(cacheKey); + } else { + cache.set(cacheKey, result2 = loader2(name2, mode, containingFileName, redirectedReference)); + } + resolutions.push(result2); + } + return resolutions; + } + ts2.loadWithModeAwareCache = loadWithModeAwareCache; + function forEachResolvedProjectReference(resolvedProjectReferences, cb) { + return forEachProjectReference( + /*projectReferences*/ + void 0, + resolvedProjectReferences, + function(resolvedRef, parent2) { + return resolvedRef && cb(resolvedRef, parent2); + } + ); + } + ts2.forEachResolvedProjectReference = forEachResolvedProjectReference; + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + var seenResolvedRefs; + return worker( + projectReferences, + resolvedProjectReferences, + /*parent*/ + void 0 + ); + function worker(projectReferences2, resolvedProjectReferences2, parent2) { + if (cbRef) { + var result2 = cbRef(projectReferences2, parent2); + if (result2) + return result2; + } + return ts2.forEach(resolvedProjectReferences2, function(resolvedRef, index4) { + if (resolvedRef && (seenResolvedRefs === null || seenResolvedRefs === void 0 ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { + return void 0; + } + var result3 = cbResolvedRef(resolvedRef, parent2, index4); + if (result3 || !resolvedRef) + return result3; + (seenResolvedRefs || (seenResolvedRefs = new ts2.Set())).add(resolvedRef.sourceFile.path); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); + }); + } + } + ts2.inferredTypesContainingFile = "__inferred type names__.ts"; + function isReferencedFile(reason) { + switch (reason === null || reason === void 0 ? void 0 : reason.kind) { + case ts2.FileIncludeKind.Import: + case ts2.FileIncludeKind.ReferenceFile: + case ts2.FileIncludeKind.TypeReferenceDirective: + case ts2.FileIncludeKind.LibReferenceDirective: + return true; + default: + return false; + } + } + ts2.isReferencedFile = isReferencedFile; + function isReferenceFileLocation(location2) { + return location2.pos !== void 0; + } + ts2.isReferenceFileLocation = isReferenceFileLocation; + function getReferencedFileLocation(getSourceFileByPath, ref) { + var _a2, _b, _c; + var _d, _e2, _f, _g; + var file = ts2.Debug.checkDefined(getSourceFileByPath(ref.file)); + var kind = ref.kind, index4 = ref.index; + var pos, end, packageId, resolutionMode; + switch (kind) { + case ts2.FileIncludeKind.Import: + var importLiteral = getModuleNameStringLiteralAt(file, index4); + packageId = (_e2 = (_d = file.resolvedModules) === null || _d === void 0 ? void 0 : _d.get(importLiteral.text, getModeForResolutionAtIndex(file, index4))) === null || _e2 === void 0 ? void 0 : _e2.packageId; + if (importLiteral.pos === -1) + return { file, packageId, text: importLiteral.text }; + pos = ts2.skipTrivia(file.text, importLiteral.pos); + end = importLiteral.end; + break; + case ts2.FileIncludeKind.ReferenceFile: + _a2 = file.referencedFiles[index4], pos = _a2.pos, end = _a2.end; + break; + case ts2.FileIncludeKind.TypeReferenceDirective: + _b = file.typeReferenceDirectives[index4], pos = _b.pos, end = _b.end, resolutionMode = _b.resolutionMode; + packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts2.toFileNameLowerCase(file.typeReferenceDirectives[index4].fileName), resolutionMode || file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId; + break; + case ts2.FileIncludeKind.LibReferenceDirective: + _c = file.libReferenceDirectives[index4], pos = _c.pos, end = _c.end; + break; + default: + return ts2.Debug.assertNever(kind); + } + return { file, pos, end, packageId }; + } + ts2.getReferencedFileLocation = getReferencedFileLocation; + function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) { + if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames())) + return false; + if (!ts2.arrayIsEqualTo(program.getRootFileNames(), rootFileNames)) + return false; + var seenResolvedRefs; + if (!ts2.arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) + return false; + if (program.getSourceFiles().some(sourceFileNotUptoDate)) + return false; + if (program.getMissingFilePaths().some(fileExists)) + return false; + var currentOptions = program.getCompilerOptions(); + if (!ts2.compareDataObjects(currentOptions, newOptions)) + return false; + if (currentOptions.configFile && newOptions.configFile) + return currentOptions.configFile.text === newOptions.configFile.text; + return true; + function sourceFileNotUptoDate(sourceFile) { + return !sourceFileVersionUptoDate(sourceFile) || hasInvalidatedResolutions(sourceFile.path); + } + function sourceFileVersionUptoDate(sourceFile) { + return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName); + } + function projectReferenceUptoDate(oldRef, newRef, index4) { + return ts2.projectReferenceIsEqualTo(oldRef, newRef) && resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index4], oldRef); + } + function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) { + if (oldResolvedRef) { + if (ts2.contains(seenResolvedRefs, oldResolvedRef)) + return true; + var refPath_1 = resolveProjectReferencePath(oldRef); + var newParsedCommandLine = getParsedCommandLine(refPath_1); + if (!newParsedCommandLine) + return false; + if (oldResolvedRef.commandLine.options.configFile !== newParsedCommandLine.options.configFile) + return false; + if (!ts2.arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newParsedCommandLine.fileNames)) + return false; + (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef); + return !ts2.forEach(oldResolvedRef.references, function(childResolvedRef, index4) { + return !resolvedProjectReferenceUptoDate(childResolvedRef, oldResolvedRef.commandLine.projectReferences[index4]); + }); + } + var refPath = resolveProjectReferencePath(oldRef); + return !getParsedCommandLine(refPath); + } + } + ts2.isProgramUptoDate = isProgramUptoDate; + function getConfigFileParsingDiagnostics(configFileParseResult) { + return configFileParseResult.options.configFile ? __spreadArray9(__spreadArray9([], configFileParseResult.options.configFile.parseDiagnostics, true), configFileParseResult.errors, true) : configFileParseResult.errors; + } + ts2.getConfigFileParsingDiagnostics = getConfigFileParsingDiagnostics; + function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) { + var result2 = getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options); + return typeof result2 === "object" ? result2.impliedNodeFormat : result2; + } + ts2.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile; + function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) { + switch (ts2.getEmitModuleResolutionKind(options)) { + case ts2.ModuleResolutionKind.Node16: + case ts2.ModuleResolutionKind.NodeNext: + return ts2.fileExtensionIsOneOf(fileName, [ + ".d.mts", + ".mts", + ".mjs" + /* Extension.Mjs */ + ]) ? ts2.ModuleKind.ESNext : ts2.fileExtensionIsOneOf(fileName, [ + ".d.cts", + ".cts", + ".cjs" + /* Extension.Cjs */ + ]) ? ts2.ModuleKind.CommonJS : ts2.fileExtensionIsOneOf(fileName, [ + ".d.ts", + ".ts", + ".tsx", + ".js", + ".jsx" + /* Extension.Jsx */ + ]) ? lookupFromPackageJson() : void 0; + default: + return void 0; + } + function lookupFromPackageJson() { + var state = ts2.getTemporaryModuleResolutionState(packageJsonInfoCache, host, options); + var packageJsonLocations = []; + state.failedLookupLocations = packageJsonLocations; + state.affectingLocations = packageJsonLocations; + var packageJsonScope = ts2.getPackageScopeForPath(fileName, state); + var impliedNodeFormat = (packageJsonScope === null || packageJsonScope === void 0 ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? ts2.ModuleKind.ESNext : ts2.ModuleKind.CommonJS; + return { impliedNodeFormat, packageJsonLocations, packageJsonScope }; + } + } + ts2.getImpliedNodeFormatForFileWorker = getImpliedNodeFormatForFileWorker; + ts2.plainJSErrors = new ts2.Set([ + // binder errors + ts2.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, + ts2.Diagnostics.A_module_cannot_have_multiple_default_exports.code, + ts2.Diagnostics.Another_export_default_is_here.code, + ts2.Diagnostics.The_first_export_default_is_here.code, + ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, + ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, + ts2.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, + ts2.Diagnostics.constructor_is_a_reserved_word.code, + ts2.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, + ts2.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, + ts2.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, + ts2.Diagnostics.Invalid_use_of_0_in_strict_mode.code, + ts2.Diagnostics.A_label_is_not_allowed_here.code, + ts2.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code, + ts2.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, + // grammar errors + ts2.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, + ts2.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, + ts2.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, + ts2.Diagnostics.A_class_member_cannot_have_the_0_keyword.code, + ts2.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, + ts2.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, + ts2.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + ts2.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + ts2.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, + ts2.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, + ts2.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, + ts2.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, + ts2.Diagnostics.A_get_accessor_cannot_have_parameters.code, + ts2.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, + ts2.Diagnostics.A_rest_element_cannot_have_a_property_name.code, + ts2.Diagnostics.A_rest_element_cannot_have_an_initializer.code, + ts2.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, + ts2.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, + ts2.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, + ts2.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, + ts2.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, + ts2.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, + ts2.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, + ts2.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + ts2.Diagnostics.An_export_declaration_cannot_have_modifiers.code, + ts2.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + ts2.Diagnostics.An_import_declaration_cannot_have_modifiers.code, + ts2.Diagnostics.An_object_member_cannot_be_declared_optional.code, + ts2.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, + ts2.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, + ts2.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, + ts2.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, + ts2.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, + ts2.Diagnostics.Classes_can_only_extend_a_single_class.code, + ts2.Diagnostics.Classes_may_not_have_a_field_named_constructor.code, + ts2.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code, + ts2.Diagnostics.Duplicate_label_0.code, + ts2.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, + ts2.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code, + ts2.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, + ts2.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, + ts2.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, + ts2.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, + ts2.Diagnostics.Jump_target_cannot_cross_function_boundary.code, + ts2.Diagnostics.Line_terminator_not_permitted_before_arrow.code, + ts2.Diagnostics.Modifiers_cannot_appear_here.code, + ts2.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, + ts2.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, + ts2.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code, + ts2.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, + ts2.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, + ts2.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, + ts2.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, + ts2.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, + ts2.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, + ts2.Diagnostics.Trailing_comma_not_allowed.code, + ts2.Diagnostics.Variable_declaration_list_cannot_be_empty.code, + ts2.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, + ts2.Diagnostics._0_expected.code, + ts2.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, + ts2.Diagnostics._0_list_cannot_be_empty.code, + ts2.Diagnostics._0_modifier_already_seen.code, + ts2.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, + ts2.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, + ts2.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, + ts2.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, + ts2.Diagnostics._0_modifier_cannot_be_used_here.code, + ts2.Diagnostics._0_modifier_must_precede_1_modifier.code, + ts2.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code, + ts2.Diagnostics.const_declarations_must_be_initialized.code, + ts2.Diagnostics.extends_clause_already_seen.code, + ts2.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code, + ts2.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, + ts2.Diagnostics.Class_constructor_may_not_be_a_generator.code, + ts2.Diagnostics.Class_constructor_may_not_be_an_accessor.code, + ts2.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code + ]); + function shouldProgramCreateNewSourceFiles(program, newOptions) { + if (!program) + return false; + return ts2.optionsHaveChanges(program.getCompilerOptions(), newOptions, ts2.sourceFileAffectingCompilerOptions); + } + function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) { + return { + rootNames, + options, + host, + oldProgram, + configFileParsingDiagnostics + }; + } + function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a2, _b, _c, _d; + var createProgramOptions = ts2.isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; + var rootNames = createProgramOptions.rootNames, options = createProgramOptions.options, configFileParsingDiagnostics = createProgramOptions.configFileParsingDiagnostics, projectReferences = createProgramOptions.projectReferences; + var oldProgram = createProgramOptions.oldProgram; + var processingDefaultLibFiles; + var processingOtherFiles; + var files; + var symlinks; + var commonSourceDirectory; + var typeChecker; + var classifiableNames; + var ambientModuleNameToUnmodifiedFileName = new ts2.Map(); + var fileReasons = ts2.createMultiMap(); + var cachedBindAndCheckDiagnosticsForFile = {}; + var cachedDeclarationDiagnosticsForFile = {}; + var resolvedTypeReferenceDirectives = ts2.createModeAwareCache(); + var fileProcessingDiagnostics; + var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; + var currentNodeModulesDepth = 0; + var modulesWithElidedImports = new ts2.Map(); + var sourceFilesFoundSearchingNodeModules = new ts2.Map(); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "program", + "createProgram", + { configFilePath: options.configFilePath, rootDir: options.rootDir }, + /*separateBeginAndEnd*/ + true + ); + ts2.performance.mark("beforeProgram"); + var host = createProgramOptions.host || createCompilerHost(options); + var configParsingHost = parseConfigHostFromCompilerHostLike(host); + var skipDefaultLib = options.noLib; + var getDefaultLibraryFileName = ts2.memoize(function() { + return host.getDefaultLibFileName(options); + }); + var defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : ts2.getDirectoryPath(getDefaultLibraryFileName()); + var programDiagnostics = ts2.createDiagnosticCollection(); + var currentDirectory = host.getCurrentDirectory(); + var supportedExtensions = ts2.getSupportedExtensions(options); + var supportedExtensionsWithJsonIfResolveJsonModule = ts2.getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); + var hasEmitBlockingDiagnostics = new ts2.Map(); + var _compilerOptionsObjectLiteralSyntax; + var moduleResolutionCache; + var typeReferenceDirectiveResolutionCache; + var actualResolveModuleNamesWorker; + var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts2.returnFalse; + if (host.resolveModuleNames) { + actualResolveModuleNamesWorker = function(moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { + return host.resolveModuleNames(ts2.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function(resolved) { + if (!resolved || resolved.extension !== void 0) { + return resolved; + } + var withExtension = ts2.clone(resolved); + withExtension.extension = ts2.extensionFromPath(resolved.resolvedFileName); + return withExtension; + }); + }; + moduleResolutionCache = (_a2 = host.getModuleResolutionCache) === null || _a2 === void 0 ? void 0 : _a2.call(host); + } else { + moduleResolutionCache = ts2.createModuleResolutionCache(currentDirectory, getCanonicalFileName, options); + var loader_1 = function(moduleName3, resolverMode, containingFileName, redirectedReference) { + return ts2.resolveModuleName(moduleName3, containingFileName, options, host, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; + }; + actualResolveModuleNamesWorker = function(moduleNames, containingFile, containingFileName, _reusedNames, redirectedReference) { + return loadWithModeAwareCache(ts2.Debug.checkEachDefined(moduleNames), containingFile, containingFileName, redirectedReference, loader_1); + }; + } + var actualResolveTypeReferenceDirectiveNamesWorker; + if (host.resolveTypeReferenceDirectives) { + actualResolveTypeReferenceDirectiveNamesWorker = function(typeDirectiveNames, containingFile, redirectedReference, containingFileMode) { + return host.resolveTypeReferenceDirectives(ts2.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options, containingFileMode); + }; + } else { + typeReferenceDirectiveResolutionCache = ts2.createTypeReferenceDirectiveResolutionCache( + currentDirectory, + getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() + ); + var loader_2 = function(typesRef, containingFile, redirectedReference, resolutionMode) { + return ts2.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode).resolvedTypeReferenceDirective; + }; + actualResolveTypeReferenceDirectiveNamesWorker = function(typeReferenceDirectiveNames, containingFile, redirectedReference, containingFileMode) { + return loadWithTypeDirectiveCache(ts2.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_2); + }; + } + var packageIdToSourceFile = new ts2.Map(); + var sourceFileToPackageName = new ts2.Map(); + var redirectTargetsMap = ts2.createMultiMap(); + var usesUriStyleNodeCoreModules = false; + var filesByName = new ts2.Map(); + var missingFilePaths; + var filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? new ts2.Map() : void 0; + var resolvedProjectReferences; + var projectReferenceRedirects; + var mapFromFileToProjectReferenceRedirects; + var mapFromToProjectReferenceRedirectSource; + var useSourceOfProjectReferenceRedirect = !!((_b = host.useSourceOfProjectReferenceRedirect) === null || _b === void 0 ? void 0 : _b.call(host)) && !options.disableSourceOfProjectReferenceRedirect; + var _e2 = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + getSymlinkCache, + useSourceOfProjectReferenceRedirect, + toPath: toPath2, + getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference2 + }), onProgramCreateComplete = _e2.onProgramCreateComplete, fileExists = _e2.fileExists, directoryExists = _e2.directoryExists; + var readFile2 = host.readFile.bind(host); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); + var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + var structureIsReused; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "tryReuseStructureFromOldProgram", {}); + structureIsReused = tryReuseStructureFromOldProgram(); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + if (structureIsReused !== 2) { + processingDefaultLibFiles = []; + processingOtherFiles = []; + if (projectReferences) { + if (!resolvedProjectReferences) { + resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); + } + if (rootNames.length) { + resolvedProjectReferences === null || resolvedProjectReferences === void 0 ? void 0 : resolvedProjectReferences.forEach(function(parsedRef, index4) { + if (!parsedRef) + return; + var out = ts2.outFile(parsedRef.commandLine.options); + if (useSourceOfProjectReferenceRedirect) { + if (out || ts2.getEmitModuleKind(parsedRef.commandLine.options) === ts2.ModuleKind.None) { + for (var _i2 = 0, _a3 = parsedRef.commandLine.fileNames; _i2 < _a3.length; _i2++) { + var fileName = _a3[_i2]; + processProjectReferenceFile(fileName, { kind: ts2.FileIncludeKind.SourceFromProjectReference, index: index4 }); + } + } + } else { + if (out) { + processProjectReferenceFile(ts2.changeExtension(out, ".d.ts"), { kind: ts2.FileIncludeKind.OutputFromProjectReference, index: index4 }); + } else if (ts2.getEmitModuleKind(parsedRef.commandLine.options) === ts2.ModuleKind.None) { + var getCommonSourceDirectory_2 = ts2.memoize(function() { + return ts2.getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames()); + }); + for (var _b2 = 0, _c2 = parsedRef.commandLine.fileNames; _b2 < _c2.length; _b2++) { + var fileName = _c2[_b2]; + if (!ts2.isDeclarationFileName(fileName) && !ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + )) { + processProjectReferenceFile(ts2.getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_2), { kind: ts2.FileIncludeKind.OutputFromProjectReference, index: index4 }); + } + } + } + } + }); + } + } + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "processRootFiles", { count: rootNames.length }); + ts2.forEach(rootNames, function(name2, index4) { + return processRootFile( + name2, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + { kind: ts2.FileIncludeKind.RootFile, index: index4 } + ); + }); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + var typeReferences = rootNames.length ? ts2.getAutomaticTypeDirectiveNames(options, host) : ts2.emptyArray; + if (typeReferences.length) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "processTypeReferences", { count: typeReferences.length }); + var containingDirectory = options.configFilePath ? ts2.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory(); + var containingFilename = ts2.combinePaths(containingDirectory, ts2.inferredTypesContainingFile); + var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename); + for (var i7 = 0; i7 < typeReferences.length; i7++) { + processTypeReferenceDirective( + typeReferences[i7], + /*mode*/ + void 0, + resolutions[i7], + { kind: ts2.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i7], packageId: (_c = resolutions[i7]) === null || _c === void 0 ? void 0 : _c.packageId } + ); + } + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + if (rootNames.length && !skipDefaultLib) { + var defaultLibraryFileName = getDefaultLibraryFileName(); + if (!options.lib && defaultLibraryFileName) { + processRootFile( + defaultLibraryFileName, + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + false, + { kind: ts2.FileIncludeKind.LibFile } + ); + } else { + ts2.forEach(options.lib, function(libFileName, index4) { + processRootFile( + pathForLibFile(libFileName), + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + false, + { kind: ts2.FileIncludeKind.LibFile, index: index4 } + ); + }); + } + } + missingFilePaths = ts2.arrayFrom(ts2.mapDefinedIterator(filesByName.entries(), function(_a3) { + var path2 = _a3[0], file = _a3[1]; + return file === void 0 ? path2 : void 0; + })); + files = ts2.stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); + processingDefaultLibFiles = void 0; + processingOtherFiles = void 0; + } + ts2.Debug.assert(!!missingFilePaths); + if (oldProgram && host.onReleaseOldSourceFile) { + var oldSourceFiles = oldProgram.getSourceFiles(); + for (var _i = 0, oldSourceFiles_1 = oldSourceFiles; _i < oldSourceFiles_1.length; _i++) { + var oldSourceFile = oldSourceFiles_1[_i]; + var newFile = getSourceFileByPath(oldSourceFile.resolvedPath); + if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is + oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) { + host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); + } + } + if (!host.getParsedCommandLine) { + oldProgram.forEachResolvedProjectReference(function(resolvedProjectReference) { + if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + host.onReleaseOldSourceFile( + resolvedProjectReference.sourceFile, + oldProgram.getCompilerOptions(), + /*hasSourceFileByPath*/ + false + ); + } + }); + } + } + if (oldProgram && host.onReleaseParsedCommandLine) { + forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function(oldResolvedRef, parent2, index4) { + var oldReference = (parent2 === null || parent2 === void 0 ? void 0 : parent2.commandLine.projectReferences[index4]) || oldProgram.getProjectReferences()[index4]; + var oldRefPath = resolveProjectReferencePath(oldReference); + if (!(projectReferenceRedirects === null || projectReferenceRedirects === void 0 ? void 0 : projectReferenceRedirects.has(toPath2(oldRefPath)))) { + host.onReleaseParsedCommandLine(oldRefPath, oldResolvedRef, oldProgram.getCompilerOptions()); + } + }); + } + typeReferenceDirectiveResolutionCache = void 0; + oldProgram = void 0; + var program = { + getRootFileNames: function() { + return rootNames; + }, + getSourceFile, + getSourceFileByPath, + getSourceFiles: function() { + return files; + }, + getMissingFilePaths: function() { + return missingFilePaths; + }, + getModuleResolutionCache: function() { + return moduleResolutionCache; + }, + getFilesByNameMap: function() { + return filesByName; + }, + getCompilerOptions: function() { + return options; + }, + getSyntacticDiagnostics, + getOptionsDiagnostics, + getGlobalDiagnostics, + getSemanticDiagnostics, + getCachedSemanticDiagnostics, + getSuggestionDiagnostics, + getDeclarationDiagnostics, + getBindAndCheckDiagnostics, + getProgramDiagnostics, + getTypeChecker, + getClassifiableNames, + getCommonSourceDirectory, + emit: emit3, + getCurrentDirectory: function() { + return currentDirectory; + }, + getNodeCount: function() { + return getTypeChecker().getNodeCount(); + }, + getIdentifierCount: function() { + return getTypeChecker().getIdentifierCount(); + }, + getSymbolCount: function() { + return getTypeChecker().getSymbolCount(); + }, + getTypeCount: function() { + return getTypeChecker().getTypeCount(); + }, + getInstantiationCount: function() { + return getTypeChecker().getInstantiationCount(); + }, + getRelationCacheSizes: function() { + return getTypeChecker().getRelationCacheSizes(); + }, + getFileProcessingDiagnostics: function() { + return fileProcessingDiagnostics; + }, + getResolvedTypeReferenceDirectives: function() { + return resolvedTypeReferenceDirectives; + }, + isSourceFileFromExternalLibrary, + isSourceFileDefaultLibrary, + getSourceFileFromReference, + getLibFileFromReference, + sourceFileToPackageName, + redirectTargetsMap, + usesUriStyleNodeCoreModules, + isEmittedFile, + getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2, + getResolvedModuleWithFailedLookupLocationsFromCache, + getProjectReferences, + getResolvedProjectReferences, + getProjectReferenceRedirect, + getResolvedProjectReferenceToRedirect, + getResolvedProjectReferenceByPath, + forEachResolvedProjectReference: forEachResolvedProjectReference2, + isSourceOfProjectReferenceRedirect, + emitBuildInfo, + fileExists, + readFile: readFile2, + directoryExists, + getSymlinkCache, + realpath: (_d = host.realpath) === null || _d === void 0 ? void 0 : _d.bind(host), + useCaseSensitiveFileNames: function() { + return host.useCaseSensitiveFileNames(); + }, + getFileIncludeReasons: function() { + return fileReasons; + }, + structureIsReused, + writeFile: writeFile2 + }; + onProgramCreateComplete(); + fileProcessingDiagnostics === null || fileProcessingDiagnostics === void 0 ? void 0 : fileProcessingDiagnostics.forEach(function(diagnostic) { + switch (diagnostic.kind) { + case 1: + return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || ts2.emptyArray)); + case 0: + var _a3 = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason), file = _a3.file, pos = _a3.pos, end = _a3.end; + return programDiagnostics.add(ts2.createFileDiagnostic.apply(void 0, __spreadArray9([file, ts2.Debug.checkDefined(pos), ts2.Debug.checkDefined(end) - pos, diagnostic.diagnostic], diagnostic.args || ts2.emptyArray, false))); + default: + ts2.Debug.assertNever(diagnostic); + } + }); + verifyCompilerOptions(); + ts2.performance.mark("afterProgram"); + ts2.performance.measure("Program", "beforeProgram", "afterProgram"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return program; + function addResolutionDiagnostics(list) { + if (!list) + return; + for (var _i2 = 0, list_3 = list; _i2 < list_3.length; _i2++) { + var elem = list_3[_i2]; + programDiagnostics.add(elem); + } + } + function pullDiagnosticsFromCache(names, containingFile) { + var _a3; + if (!moduleResolutionCache) + return; + var containingFileName = ts2.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); + var containingFileMode = !ts2.isString(containingFile) ? containingFile.impliedNodeFormat : void 0; + var containingDir = ts2.getDirectoryPath(containingFileName); + var redirectedReference = getRedirectReferenceForResolution(containingFile); + var i8 = 0; + for (var _i2 = 0, names_4 = names; _i2 < names_4.length; _i2++) { + var n7 = names_4[_i2]; + var mode = typeof n7 === "string" ? getModeForResolutionAtIndex(containingFile, i8) : getModeForFileReference(n7, containingFileMode); + var name2 = typeof n7 === "string" ? n7 : n7.fileName; + i8++; + if (ts2.isExternalModuleNameRelative(name2)) + continue; + var diags = (_a3 = moduleResolutionCache.getOrCreateCacheForModuleName(name2, mode, redirectedReference).get(containingDir)) === null || _a3 === void 0 ? void 0 : _a3.resolutionDiagnostics; + addResolutionDiagnostics(diags); + } + } + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { + if (!moduleNames.length) + return ts2.emptyArray; + var containingFileName = ts2.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); + var redirectedReference = getRedirectReferenceForResolution(containingFile); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "resolveModuleNamesWorker", { containingFileName }); + ts2.performance.mark("beforeResolveModule"); + var result2 = actualResolveModuleNamesWorker(moduleNames, containingFile, containingFileName, reusedNames, redirectedReference); + ts2.performance.mark("afterResolveModule"); + ts2.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + pullDiagnosticsFromCache(moduleNames, containingFile); + return result2; + } + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) { + if (!typeDirectiveNames.length) + return []; + var containingFileName = !ts2.isString(containingFile) ? ts2.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; + var redirectedReference = !ts2.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : void 0; + var containingFileMode = !ts2.isString(containingFile) ? containingFile.impliedNodeFormat : void 0; + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName }); + ts2.performance.mark("beforeResolveTypeReference"); + var result2 = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, containingFileMode); + ts2.performance.mark("afterResolveTypeReference"); + ts2.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return result2; + } + function getRedirectReferenceForResolution(file) { + var redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); + if (redirect || !ts2.isDeclarationFileName(file.originalFileName)) + return redirect; + var resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path); + if (resultFromDts) + return resultFromDts; + if (!host.realpath || !options.preserveSymlinks || !ts2.stringContains(file.originalFileName, ts2.nodeModulesPathPart)) + return void 0; + var realDeclarationPath = toPath2(host.realpath(file.originalFileName)); + return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath); + } + function getRedirectReferenceForResolutionFromSourceOfProject(filePath) { + var source = getSourceOfProjectReferenceRedirect(filePath); + if (ts2.isString(source)) + return getResolvedProjectReferenceToRedirect(source); + if (!source) + return void 0; + return forEachResolvedProjectReference2(function(resolvedRef) { + var out = ts2.outFile(resolvedRef.commandLine.options); + if (!out) + return void 0; + return toPath2(out) === filePath ? resolvedRef : void 0; + }); + } + function compareDefaultLibFiles(a7, b8) { + return ts2.compareValues(getDefaultLibFilePriority(a7), getDefaultLibFilePriority(b8)); + } + function getDefaultLibFilePriority(a7) { + if (ts2.containsPath( + defaultLibraryPath, + a7.fileName, + /*ignoreCase*/ + false + )) { + var basename2 = ts2.getBaseFileName(a7.fileName); + if (basename2 === "lib.d.ts" || basename2 === "lib.es6.d.ts") + return 0; + var name2 = ts2.removeSuffix(ts2.removePrefix(basename2, "lib."), ".d.ts"); + var index4 = ts2.libs.indexOf(name2); + if (index4 !== -1) + return index4 + 1; + } + return ts2.libs.length + 2; + } + function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName3, containingFile, mode) { + return moduleResolutionCache && ts2.resolveModuleNameFromCache(moduleName3, containingFile, moduleResolutionCache, mode); + } + function toPath2(fileName) { + return ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCommonSourceDirectory() { + if (commonSourceDirectory === void 0) { + var emittedFiles_1 = ts2.filter(files, function(file) { + return ts2.sourceFileMayBeEmitted(file, program); + }); + commonSourceDirectory = ts2.getCommonSourceDirectory(options, function() { + return ts2.mapDefined(emittedFiles_1, function(file) { + return file.isDeclarationFile ? void 0 : file.fileName; + }); + }, currentDirectory, getCanonicalFileName, function(commonSourceDirectory2) { + return checkSourceFilesBelongToPath(emittedFiles_1, commonSourceDirectory2); + }); + } + return commonSourceDirectory; + } + function getClassifiableNames() { + var _a3; + if (!classifiableNames) { + getTypeChecker(); + classifiableNames = new ts2.Set(); + for (var _i2 = 0, files_3 = files; _i2 < files_3.length; _i2++) { + var sourceFile = files_3[_i2]; + (_a3 = sourceFile.classifiableNames) === null || _a3 === void 0 ? void 0 : _a3.forEach(function(value2) { + return classifiableNames.add(value2); + }); + } + } + return classifiableNames; + } + function resolveModuleNamesReusingOldState(moduleNames, file) { + if (structureIsReused === 0 && !file.ambientModuleNames.length) { + return resolveModuleNamesWorker( + moduleNames, + file, + /*reusedNames*/ + void 0 + ); + } + var oldSourceFile2 = oldProgram && oldProgram.getSourceFile(file.fileName); + if (oldSourceFile2 !== file && file.resolvedModules) { + var result_14 = []; + var i8 = 0; + for (var _i2 = 0, moduleNames_1 = moduleNames; _i2 < moduleNames_1.length; _i2++) { + var moduleName3 = moduleNames_1[_i2]; + var resolvedModule = file.resolvedModules.get(moduleName3, getModeForResolutionAtIndex(file, i8)); + i8++; + result_14.push(resolvedModule); + } + return result_14; + } + var unknownModuleNames; + var result2; + var reusedNames; + var predictedToResolveToAmbientModuleMarker = {}; + for (var i8 = 0; i8 < moduleNames.length; i8++) { + var moduleName3 = moduleNames[i8]; + if (file === oldSourceFile2 && !hasInvalidatedResolutions(oldSourceFile2.path)) { + var oldResolvedModule = ts2.getResolvedModule(oldSourceFile2, moduleName3, getModeForResolutionAtIndex(oldSourceFile2, i8)); + if (oldResolvedModule) { + if (ts2.isTraceEnabled(options, host)) { + ts2.trace(host, oldResolvedModule.packageId ? ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2, moduleName3, ts2.getNormalizedAbsolutePath(file.originalFileName, currentDirectory), oldResolvedModule.resolvedFileName, oldResolvedModule.packageId && ts2.packageIdToString(oldResolvedModule.packageId)); + } + (result2 || (result2 = new Array(moduleNames.length)))[i8] = oldResolvedModule; + (reusedNames || (reusedNames = [])).push(moduleName3); + continue; + } + } + var resolvesToAmbientModuleInNonModifiedFile = false; + if (ts2.contains(file.ambientModuleNames, moduleName3)) { + resolvesToAmbientModuleInNonModifiedFile = true; + if (ts2.isTraceEnabled(options, host)) { + ts2.trace(host, ts2.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName3, ts2.getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + } + } else { + resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName3, i8); + } + if (resolvesToAmbientModuleInNonModifiedFile) { + (result2 || (result2 = new Array(moduleNames.length)))[i8] = predictedToResolveToAmbientModuleMarker; + } else { + (unknownModuleNames || (unknownModuleNames = [])).push(moduleName3); + } + } + var resolutions2 = unknownModuleNames && unknownModuleNames.length ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) : ts2.emptyArray; + if (!result2) { + ts2.Debug.assert(resolutions2.length === moduleNames.length); + return resolutions2; + } + var j6 = 0; + for (var i8 = 0; i8 < result2.length; i8++) { + if (result2[i8]) { + if (result2[i8] === predictedToResolveToAmbientModuleMarker) { + result2[i8] = void 0; + } + } else { + result2[i8] = resolutions2[j6]; + j6++; + } + } + ts2.Debug.assert(j6 === resolutions2.length); + return result2; + function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName4, index4) { + if (index4 >= ts2.length(oldSourceFile2 === null || oldSourceFile2 === void 0 ? void 0 : oldSourceFile2.imports) + ts2.length(oldSourceFile2 === null || oldSourceFile2 === void 0 ? void 0 : oldSourceFile2.moduleAugmentations)) + return false; + var resolutionToFile = ts2.getResolvedModule(oldSourceFile2, moduleName4, oldSourceFile2 && getModeForResolutionAtIndex(oldSourceFile2, index4)); + var resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile) { + return false; + } + var unmodifiedFile = ambientModuleNameToUnmodifiedFileName.get(moduleName4); + if (!unmodifiedFile) { + return false; + } + if (ts2.isTraceEnabled(options, host)) { + ts2.trace(host, ts2.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName4, unmodifiedFile); + } + return true; + } + } + function canReuseProjectReferences() { + return !forEachProjectReference(oldProgram.getProjectReferences(), oldProgram.getResolvedProjectReferences(), function(oldResolvedRef, parent2, index4) { + var newRef = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index4]; + var newResolvedRef = parseProjectReferenceConfigFile(newRef); + if (oldResolvedRef) { + return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile || !ts2.arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newResolvedRef.commandLine.fileNames); + } else { + return newResolvedRef !== void 0; + } + }, function(oldProjectReferences, parent2) { + var newReferences = parent2 ? getResolvedProjectReferenceByPath(parent2.sourceFile.path).commandLine.projectReferences : projectReferences; + return !ts2.arrayIsEqualTo(oldProjectReferences, newReferences, ts2.projectReferenceIsEqualTo); + }); + } + function tryReuseStructureFromOldProgram() { + var _a3, _b2; + if (!oldProgram) { + return 0; + } + var oldOptions = oldProgram.getCompilerOptions(); + if (ts2.changesAffectModuleResolution(oldOptions, options)) { + return 0; + } + var oldRootNames = oldProgram.getRootFileNames(); + if (!ts2.arrayIsEqualTo(oldRootNames, rootNames)) { + return 0; + } + if (!canReuseProjectReferences()) { + return 0; + } + if (projectReferences) { + resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); + } + var newSourceFiles = []; + var modifiedSourceFiles = []; + structureIsReused = 2; + if (oldProgram.getMissingFilePaths().some(function(missingFilePath) { + return host.fileExists(missingFilePath); + })) { + return 0; + } + var oldSourceFiles2 = oldProgram.getSourceFiles(); + var SeenPackageName; + (function(SeenPackageName2) { + SeenPackageName2[SeenPackageName2["Exists"] = 0] = "Exists"; + SeenPackageName2[SeenPackageName2["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + var seenPackageNames = new ts2.Map(); + for (var _i2 = 0, oldSourceFiles_2 = oldSourceFiles2; _i2 < oldSourceFiles_2.length; _i2++) { + var oldSourceFile2 = oldSourceFiles_2[_i2]; + var sourceFileOptions = getCreateSourceFileOptions(oldSourceFile2.fileName, moduleResolutionCache, host, options); + var newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath( + oldSourceFile2.fileName, + oldSourceFile2.resolvedPath, + sourceFileOptions, + /*onError*/ + void 0, + shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile2.impliedNodeFormat + ) : host.getSourceFile( + oldSourceFile2.fileName, + sourceFileOptions, + /*onError*/ + void 0, + shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile2.impliedNodeFormat + ); + if (!newSourceFile) { + return 0; + } + newSourceFile.packageJsonLocations = ((_a3 = sourceFileOptions.packageJsonLocations) === null || _a3 === void 0 ? void 0 : _a3.length) ? sourceFileOptions.packageJsonLocations : void 0; + newSourceFile.packageJsonScope = sourceFileOptions.packageJsonScope; + ts2.Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + var fileChanged = void 0; + if (oldSourceFile2.redirectInfo) { + if (newSourceFile !== oldSourceFile2.redirectInfo.unredirected) { + return 0; + } + fileChanged = false; + newSourceFile = oldSourceFile2; + } else if (oldProgram.redirectTargetsMap.has(oldSourceFile2.path)) { + if (newSourceFile !== oldSourceFile2) { + return 0; + } + fileChanged = false; + } else { + fileChanged = newSourceFile !== oldSourceFile2; + } + newSourceFile.path = oldSourceFile2.path; + newSourceFile.originalFileName = oldSourceFile2.originalFileName; + newSourceFile.resolvedPath = oldSourceFile2.resolvedPath; + newSourceFile.fileName = oldSourceFile2.fileName; + var packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile2.path); + if (packageName !== void 0) { + var prevKind = seenPackageNames.get(packageName); + var newKind = fileChanged ? 1 : 0; + if (prevKind !== void 0 && newKind === 1 || prevKind === 1) { + return 0; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { + if (oldSourceFile2.impliedNodeFormat !== newSourceFile.impliedNodeFormat) { + structureIsReused = 1; + } else if (!ts2.arrayIsEqualTo(oldSourceFile2.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } else if (oldSourceFile2.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { + structureIsReused = 1; + } else if (!ts2.arrayIsEqualTo(oldSourceFile2.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } else { + collectExternalModuleReferences(newSourceFile); + if (!ts2.arrayIsEqualTo(oldSourceFile2.imports, newSourceFile.imports, moduleNameIsEqualTo)) { + structureIsReused = 1; + } else if (!ts2.arrayIsEqualTo(oldSourceFile2.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + structureIsReused = 1; + } else if ((oldSourceFile2.flags & 6291456) !== (newSourceFile.flags & 6291456)) { + structureIsReused = 1; + } else if (!ts2.arrayIsEqualTo(oldSourceFile2.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } + } + modifiedSourceFiles.push({ oldFile: oldSourceFile2, newFile: newSourceFile }); + } else if (hasInvalidatedResolutions(oldSourceFile2.path)) { + structureIsReused = 1; + modifiedSourceFiles.push({ oldFile: oldSourceFile2, newFile: newSourceFile }); + } + newSourceFiles.push(newSourceFile); + } + if (structureIsReused !== 2) { + return structureIsReused; + } + var modifiedFiles = modifiedSourceFiles.map(function(f8) { + return f8.oldFile; + }); + for (var _c2 = 0, oldSourceFiles_3 = oldSourceFiles2; _c2 < oldSourceFiles_3.length; _c2++) { + var oldFile = oldSourceFiles_3[_c2]; + if (!ts2.contains(modifiedFiles, oldFile)) { + for (var _d2 = 0, _e3 = oldFile.ambientModuleNames; _d2 < _e3.length; _d2++) { + var moduleName3 = _e3[_d2]; + ambientModuleNameToUnmodifiedFileName.set(moduleName3, oldFile.fileName); + } + } + } + for (var _f = 0, modifiedSourceFiles_1 = modifiedSourceFiles; _f < modifiedSourceFiles_1.length; _f++) { + var _g = modifiedSourceFiles_1[_f], oldSourceFile2 = _g.oldFile, newSourceFile = _g.newFile; + var moduleNames = getModuleNames(newSourceFile); + var resolutions2 = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + var resolutionsChanged = ts2.hasChangesInResolutions(moduleNames, resolutions2, oldSourceFile2.resolvedModules, oldSourceFile2, ts2.moduleResolutionIsEqualTo); + if (resolutionsChanged) { + structureIsReused = 1; + newSourceFile.resolvedModules = ts2.zipToModeAwareCache(newSourceFile, moduleNames, resolutions2); + } else { + newSourceFile.resolvedModules = oldSourceFile2.resolvedModules; + } + var typesReferenceDirectives = newSourceFile.typeReferenceDirectives; + var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile); + var typeReferenceResolutionsChanged = ts2.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile2.resolvedTypeReferenceDirectiveNames, oldSourceFile2, ts2.typeDirectiveIsEqualTo); + if (typeReferenceResolutionsChanged) { + structureIsReused = 1; + newSourceFile.resolvedTypeReferenceDirectiveNames = ts2.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions); + } else { + newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile2.resolvedTypeReferenceDirectiveNames; + } + } + if (structureIsReused !== 2) { + return structureIsReused; + } + if (ts2.changesAffectingProgramStructure(oldOptions, options) || ((_b2 = host.hasChangedAutomaticTypeDirectiveNames) === null || _b2 === void 0 ? void 0 : _b2.call(host))) { + return 1; + } + missingFilePaths = oldProgram.getMissingFilePaths(); + ts2.Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length); + for (var _h = 0, newSourceFiles_1 = newSourceFiles; _h < newSourceFiles_1.length; _h++) { + var newSourceFile = newSourceFiles_1[_h]; + filesByName.set(newSourceFile.path, newSourceFile); + } + var oldFilesByNameMap = oldProgram.getFilesByNameMap(); + oldFilesByNameMap.forEach(function(oldFile2, path2) { + if (!oldFile2) { + filesByName.set(path2, oldFile2); + return; + } + if (oldFile2.path === path2) { + if (oldProgram.isSourceFileFromExternalLibrary(oldFile2)) { + sourceFilesFoundSearchingNodeModules.set(oldFile2.path, true); + } + return; + } + filesByName.set(path2, filesByName.get(oldFile2.path)); + }); + files = newSourceFiles; + fileReasons = oldProgram.getFileIncludeReasons(); + fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); + resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsMap = oldProgram.redirectTargetsMap; + usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules; + return 2; + } + function getEmitHost(writeFileCallback) { + return { + getPrependNodes, + getCanonicalFileName, + getCommonSourceDirectory: program.getCommonSourceDirectory, + getCompilerOptions: program.getCompilerOptions, + getCurrentDirectory: function() { + return currentDirectory; + }, + getNewLine: function() { + return host.getNewLine(); + }, + getSourceFile: program.getSourceFile, + getSourceFileByPath: program.getSourceFileByPath, + getSourceFiles: program.getSourceFiles, + getLibFileFromReference: program.getLibFileFromReference, + isSourceFileFromExternalLibrary, + getResolvedProjectReferenceToRedirect, + getProjectReferenceRedirect, + isSourceOfProjectReferenceRedirect, + getSymlinkCache, + writeFile: writeFileCallback || writeFile2, + isEmitBlocked, + readFile: function(f8) { + return host.readFile(f8); + }, + fileExists: function(f8) { + var path2 = toPath2(f8); + if (getSourceFileByPath(path2)) + return true; + if (ts2.contains(missingFilePaths, path2)) + return false; + return host.fileExists(f8); + }, + useCaseSensitiveFileNames: function() { + return host.useCaseSensitiveFileNames(); + }, + getProgramBuildInfo: function() { + return program.getProgramBuildInfo && program.getProgramBuildInfo(); + }, + getSourceFileFromReference: function(file, ref) { + return program.getSourceFileFromReference(file, ref); + }, + redirectTargetsMap, + getFileIncludeReasons: program.getFileIncludeReasons, + createHash: ts2.maybeBind(host, host.createHash) + }; + } + function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) { + host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + } + function emitBuildInfo(writeFileCallback) { + ts2.Debug.assert(!ts2.outFile(options)); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "emit", + "emitBuildInfo", + {}, + /*separateBeginAndEnd*/ + true + ); + ts2.performance.mark("beforeEmit"); + var emitResult = ts2.emitFiles( + ts2.notImplementedResolver, + getEmitHost(writeFileCallback), + /*targetSourceFile*/ + void 0, + /*transformers*/ + ts2.noTransformers, + /*emitOnlyDtsFiles*/ + false, + /*onlyBuildInfo*/ + true + ); + ts2.performance.mark("afterEmit"); + ts2.performance.measure("Emit", "beforeEmit", "afterEmit"); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return emitResult; + } + function getResolvedProjectReferences() { + return resolvedProjectReferences; + } + function getProjectReferences() { + return projectReferences; + } + function getPrependNodes() { + return createPrependNodes(projectReferences, function(_ref, index4) { + var _a3; + return (_a3 = resolvedProjectReferences[index4]) === null || _a3 === void 0 ? void 0 : _a3.commandLine; + }, function(fileName) { + var path2 = toPath2(fileName); + var sourceFile = getSourceFileByPath(path2); + return sourceFile ? sourceFile.text : filesByName.has(path2) ? void 0 : host.readFile(path2); + }); + } + function isSourceFileFromExternalLibrary(file) { + return !!sourceFilesFoundSearchingNodeModules.get(file.path); + } + function isSourceFileDefaultLibrary(file) { + if (!file.isDeclarationFile) { + return false; + } + if (file.hasNoDefaultLib) { + return true; + } + if (!options.noLib) { + return false; + } + var equalityComparer = host.useCaseSensitiveFileNames() ? ts2.equateStringsCaseSensitive : ts2.equateStringsCaseInsensitive; + if (!options.lib) { + return equalityComparer(file.fileName, getDefaultLibraryFileName()); + } else { + return ts2.some(options.lib, function(libFileName) { + return equalityComparer(file.fileName, pathForLibFile(libFileName)); + }); + } + } + function getTypeChecker() { + return typeChecker || (typeChecker = ts2.createTypeChecker(program)); + } + function emit3(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push( + "emit", + "emit", + { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }, + /*separateBeginAndEnd*/ + true + ); + var result2 = runWithCancellationToken(function() { + return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); + }); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return result2; + } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.has(toPath2(emitFileName)); + } + function emitWorker(program2, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit) { + if (!forceDtsEmit) { + var result2 = handleNoEmitOptions(program2, sourceFile, writeFileCallback, cancellationToken); + if (result2) + return result2; + } + var emitResolver = getTypeChecker().getEmitResolver(ts2.outFile(options) ? void 0 : sourceFile, cancellationToken); + ts2.performance.mark("beforeEmit"); + var emitResult = ts2.emitFiles( + emitResolver, + getEmitHost(writeFileCallback), + sourceFile, + ts2.getTransformers(options, customTransformers, emitOnlyDtsFiles), + emitOnlyDtsFiles, + /*onlyBuildInfo*/ + false, + forceDtsEmit + ); + ts2.performance.mark("afterEmit"); + ts2.performance.measure("Emit", "beforeEmit", "afterEmit"); + return emitResult; + } + function getSourceFile(fileName) { + return getSourceFileByPath(toPath2(fileName)); + } + function getSourceFileByPath(path2) { + return filesByName.get(path2) || void 0; + } + function getDiagnosticsHelper(sourceFile, getDiagnostics, cancellationToken) { + if (sourceFile) { + return getDiagnostics(sourceFile, cancellationToken); + } + return ts2.sortAndDeduplicateDiagnostics(ts2.flatMap(program.getSourceFiles(), function(sourceFile2) { + if (cancellationToken) { + cancellationToken.throwIfCancellationRequested(); + } + return getDiagnostics(sourceFile2, cancellationToken); + })); + } + function getSyntacticDiagnostics(sourceFile, cancellationToken) { + return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken); + } + function getSemanticDiagnostics(sourceFile, cancellationToken) { + return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); + } + function getCachedSemanticDiagnostics(sourceFile) { + var _a3; + return sourceFile ? (_a3 = cachedBindAndCheckDiagnosticsForFile.perFile) === null || _a3 === void 0 ? void 0 : _a3.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; + } + function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { + return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); + } + function getProgramDiagnostics(sourceFile) { + var _a3; + if (ts2.skipTypeChecking(sourceFile, options, program)) { + return ts2.emptyArray; + } + var programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); + if (!((_a3 = sourceFile.commentDirectives) === null || _a3 === void 0 ? void 0 : _a3.length)) { + return programDiagnosticsInFile; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics; + } + function getDeclarationDiagnostics(sourceFile, cancellationToken) { + var options2 = program.getCompilerOptions(); + if (!sourceFile || ts2.outFile(options2)) { + return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + } else { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); + } + } + function getSyntacticDiagnosticsForFile(sourceFile) { + if (ts2.isSourceFileJS(sourceFile)) { + if (!sourceFile.additionalSyntacticDiagnostics) { + sourceFile.additionalSyntacticDiagnostics = getJSSyntacticDiagnosticsForFile(sourceFile); + } + return ts2.concatenate(sourceFile.additionalSyntacticDiagnostics, sourceFile.parseDiagnostics); + } + return sourceFile.parseDiagnostics; + } + function runWithCancellationToken(func) { + try { + return func(); + } catch (e10) { + if (e10 instanceof ts2.OperationCanceledException) { + typeChecker = void 0; + } + throw e10; + } + } + function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return ts2.concatenate(filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), getProgramDiagnostics(sourceFile)); + } + function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache); + } + function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken) { + return runWithCancellationToken(function() { + if (ts2.skipTypeChecking(sourceFile, options, program)) { + return ts2.emptyArray; + } + var typeChecker2 = getTypeChecker(); + ts2.Debug.assert(!!sourceFile.bindDiagnostics); + var isJs = sourceFile.scriptKind === 1 || sourceFile.scriptKind === 2; + var isCheckJs = isJs && ts2.isCheckJsEnabledForFile(sourceFile, options); + var isPlainJs = ts2.isPlainJsFile(sourceFile, options.checkJs); + var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false; + var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4 || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7); + var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts2.emptyArray; + var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker2.getDiagnostics(sourceFile, cancellationToken) : ts2.emptyArray; + if (isPlainJs) { + bindDiagnostics = ts2.filter(bindDiagnostics, function(d7) { + return ts2.plainJSErrors.has(d7.code); + }); + checkDiagnostics = ts2.filter(checkDiagnostics, function(d7) { + return ts2.plainJSErrors.has(d7.code); + }); + } + return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : void 0); + }); + } + function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics) { + var _a3; + var allDiagnostics = []; + for (var _i2 = 2; _i2 < arguments.length; _i2++) { + allDiagnostics[_i2 - 2] = arguments[_i2]; + } + var flatDiagnostics = ts2.flatten(allDiagnostics); + if (!includeBindAndCheckDiagnostics || !((_a3 = sourceFile.commentDirectives) === null || _a3 === void 0 ? void 0 : _a3.length)) { + return flatDiagnostics; + } + var _b2 = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics), diagnostics = _b2.diagnostics, directives = _b2.directives; + for (var _c2 = 0, _d2 = directives.getUnusedExpectations(); _c2 < _d2.length; _c2++) { + var errorExpectation = _d2[_c2]; + diagnostics.push(ts2.createDiagnosticForRange(sourceFile, errorExpectation.range, ts2.Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + var directives = ts2.createCommentDirectivesMap(sourceFile, commentDirectives); + var diagnostics = flatDiagnostics.filter(function(diagnostic) { + return markPrecedingCommentDirectiveLine(diagnostic, directives) === -1; + }); + return { diagnostics, directives }; + } + function getSuggestionDiagnostics(sourceFile, cancellationToken) { + return runWithCancellationToken(function() { + return getTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); + }); + } + function markPrecedingCommentDirectiveLine(diagnostic, directives) { + var file = diagnostic.file, start = diagnostic.start; + if (!file) { + return -1; + } + var lineStarts = ts2.getLineStarts(file); + var line = ts2.computeLineAndCharacterOfPosition(lineStarts, start).line - 1; + while (line >= 0) { + if (directives.markUsed(line)) { + return line; + } + var lineText = file.text.slice(lineStarts[line], lineStarts[line + 1]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; + } + line--; + } + return -1; + } + function getJSSyntacticDiagnosticsForFile(sourceFile) { + return runWithCancellationToken(function() { + var diagnostics = []; + walk(sourceFile, sourceFile); + ts2.forEachChildRecursively(sourceFile, walk, walkArray); + return diagnostics; + function walk(node, parent2) { + switch (parent2.kind) { + case 166: + case 169: + case 171: + if (parent2.questionToken === node) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); + return "skip"; + } + case 170: + case 173: + case 174: + case 175: + case 215: + case 259: + case 216: + case 257: + if (parent2.type === node) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + } + switch (node.kind) { + case 270: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode(parent2, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + return "skip"; + } + break; + case 275: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); + return "skip"; + } + break; + case 273: + case 278: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, ts2.isImportSpecifier(node) ? "import...type" : "export...type")); + return "skip"; + } + break; + case 268: + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.import_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 274: + if (node.isExportEquals) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.export_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 294: + var heritageClause = node; + if (heritageClause.token === 117) { + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 261: + var interfaceKeyword = ts2.tokenToString( + 118 + /* SyntaxKind.InterfaceKeyword */ + ); + ts2.Debug.assertIsDefined(interfaceKeyword); + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); + return "skip"; + case 264: + var moduleKeyword = node.flags & 16 ? ts2.tokenToString( + 143 + /* SyntaxKind.NamespaceKeyword */ + ) : ts2.tokenToString( + 142 + /* SyntaxKind.ModuleKeyword */ + ); + ts2.Debug.assertIsDefined(moduleKeyword); + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); + return "skip"; + case 262: + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 263: + var enumKeyword = ts2.Debug.checkDefined(ts2.tokenToString( + 92 + /* SyntaxKind.EnumKeyword */ + )); + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); + return "skip"; + case 232: + diagnostics.push(createDiagnosticForNode(node, ts2.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 231: + diagnostics.push(createDiagnosticForNode(node.type, ts2.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 235: + diagnostics.push(createDiagnosticForNode(node.type, ts2.Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 213: + ts2.Debug.fail(); + } + } + function walkArray(nodes, parent2) { + if (ts2.canHaveModifiers(parent2) && parent2.modifiers === nodes && ts2.some(nodes, ts2.isDecorator) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode(parent2, ts2.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)); + } + switch (parent2.kind) { + case 260: + case 228: + case 171: + case 173: + case 174: + case 175: + case 215: + case 259: + case 216: + if (nodes === parent2.typeParameters) { + diagnostics.push(createDiagnosticForNodeArray(nodes, ts2.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + case 240: + if (nodes === parent2.modifiers) { + checkModifiers( + parent2.modifiers, + parent2.kind === 240 + /* SyntaxKind.VariableStatement */ + ); + return "skip"; + } + break; + case 169: + if (nodes === parent2.modifiers) { + for (var _i2 = 0, _a3 = nodes; _i2 < _a3.length; _i2++) { + var modifier = _a3[_i2]; + if (ts2.isModifier(modifier) && modifier.kind !== 124 && modifier.kind !== 127) { + diagnostics.push(createDiagnosticForNode(modifier, ts2.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts2.tokenToString(modifier.kind))); + } + } + return "skip"; + } + break; + case 166: + if (nodes === parent2.modifiers && ts2.some(nodes, ts2.isModifier)) { + diagnostics.push(createDiagnosticForNodeArray(nodes, ts2.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 210: + case 211: + case 230: + case 282: + case 283: + case 212: + if (nodes === parent2.typeArguments) { + diagnostics.push(createDiagnosticForNodeArray(nodes, ts2.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + } + } + function checkModifiers(modifiers, isConstValid) { + for (var _i2 = 0, modifiers_2 = modifiers; _i2 < modifiers_2.length; _i2++) { + var modifier = modifiers_2[_i2]; + switch (modifier.kind) { + case 85: + if (isConstValid) { + continue; + } + case 123: + case 121: + case 122: + case 146: + case 136: + case 126: + case 161: + case 101: + case 145: + diagnostics.push(createDiagnosticForNode(modifier, ts2.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts2.tokenToString(modifier.kind))); + break; + case 124: + case 93: + case 88: + case 127: + } + } + } + function createDiagnosticForNodeArray(nodes, message, arg0, arg1, arg2) { + var start = nodes.pos; + return ts2.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2); + } + function createDiagnosticForNode(node, message, arg0, arg1, arg2) { + return ts2.createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2); + } + }); + } + function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { + return runWithCancellationToken(function() { + var resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken); + return ts2.getDeclarationDiagnostics(getEmitHost(ts2.noop), resolver, sourceFile) || ts2.emptyArray; + }); + } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics) { + var _a3; + var cachedResult = sourceFile ? (_a3 = cache.perFile) === null || _a3 === void 0 ? void 0 : _a3.get(sourceFile.path) : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + var result2 = getDiagnostics(sourceFile, cancellationToken); + if (sourceFile) { + (cache.perFile || (cache.perFile = new ts2.Map())).set(sourceFile.path, result2); + } else { + cache.allDiagnostics = result2; + } + return result2; + } + function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { + return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + } + function getOptionsDiagnostics() { + return ts2.sortAndDeduplicateDiagnostics(ts2.concatenate(programDiagnostics.getGlobalDiagnostics(), getOptionsDiagnosticsOfConfigFile())); + } + function getOptionsDiagnosticsOfConfigFile() { + if (!options.configFile) + return ts2.emptyArray; + var diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); + forEachResolvedProjectReference2(function(resolvedRef) { + diagnostics = ts2.concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + }); + return diagnostics; + } + function getGlobalDiagnostics() { + return rootNames.length ? ts2.sortAndDeduplicateDiagnostics(getTypeChecker().getGlobalDiagnostics().slice()) : ts2.emptyArray; + } + function getConfigFileParsingDiagnostics2() { + return configFileParsingDiagnostics || ts2.emptyArray; + } + function processRootFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason) { + processSourceFile( + ts2.normalizePath(fileName), + isDefaultLib, + ignoreNoDefaultLib, + /*packageId*/ + void 0, + reason + ); + } + function fileReferenceIsEqualTo(a7, b8) { + return a7.fileName === b8.fileName; + } + function moduleNameIsEqualTo(a7, b8) { + return a7.kind === 79 ? b8.kind === 79 && a7.escapedText === b8.escapedText : b8.kind === 10 && a7.text === b8.text; + } + function createSyntheticImport(text, file) { + var externalHelpersModuleReference = ts2.factory.createStringLiteral(text); + var importDecl = ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + /*importClause*/ + void 0, + externalHelpersModuleReference, + /*assertClause*/ + void 0 + ); + ts2.addEmitFlags( + importDecl, + 67108864 + /* EmitFlags.NeverApplyImportHelper */ + ); + ts2.setParent(externalHelpersModuleReference, importDecl); + ts2.setParent(importDecl, file); + externalHelpersModuleReference.flags &= ~8; + importDecl.flags &= ~8; + return externalHelpersModuleReference; + } + function collectExternalModuleReferences(file) { + if (file.imports) { + return; + } + var isJavaScriptFile = ts2.isSourceFileJS(file); + var isExternalModuleFile = ts2.isExternalModule(file); + var imports; + var moduleAugmentations; + var ambientModules; + if ((options.isolatedModules || isExternalModuleFile) && !file.isDeclarationFile) { + if (options.importHelpers) { + imports = [createSyntheticImport(ts2.externalHelpersModuleNameText, file)]; + } + var jsxImport = ts2.getJSXRuntimeImport(ts2.getJSXImplicitImportBase(options, file), options); + if (jsxImport) { + (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); + } + } + for (var _i2 = 0, _a3 = file.statements; _i2 < _a3.length; _i2++) { + var node = _a3[_i2]; + collectModuleReferences( + node, + /*inAmbientModule*/ + false + ); + } + if (file.flags & 2097152 || isJavaScriptFile) { + collectDynamicImportOrRequireCalls(file); + } + file.imports = imports || ts2.emptyArray; + file.moduleAugmentations = moduleAugmentations || ts2.emptyArray; + file.ambientModuleNames = ambientModules || ts2.emptyArray; + return; + function collectModuleReferences(node2, inAmbientModule) { + if (ts2.isAnyImportOrReExport(node2)) { + var moduleNameExpr = ts2.getExternalModuleName(node2); + if (moduleNameExpr && ts2.isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !ts2.isExternalModuleNameRelative(moduleNameExpr.text))) { + ts2.setParentRecursive( + node2, + /*incremental*/ + false + ); + imports = ts2.append(imports, moduleNameExpr); + if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) { + usesUriStyleNodeCoreModules = ts2.startsWith(moduleNameExpr.text, "node:"); + } + } + } else if (ts2.isModuleDeclaration(node2)) { + if (ts2.isAmbientModule(node2) && (inAmbientModule || ts2.hasSyntacticModifier( + node2, + 2 + /* ModifierFlags.Ambient */ + ) || file.isDeclarationFile)) { + node2.name.parent = node2; + var nameText = ts2.getTextOfIdentifierOrLiteral(node2.name); + if (isExternalModuleFile || inAmbientModule && !ts2.isExternalModuleNameRelative(nameText)) { + (moduleAugmentations || (moduleAugmentations = [])).push(node2.name); + } else if (!inAmbientModule) { + if (file.isDeclarationFile) { + (ambientModules || (ambientModules = [])).push(nameText); + } + var body = node2.body; + if (body) { + for (var _i3 = 0, _a4 = body.statements; _i3 < _a4.length; _i3++) { + var statement = _a4[_i3]; + collectModuleReferences( + statement, + /*inAmbientModule*/ + true + ); + } + } + } + } + } + } + function collectDynamicImportOrRequireCalls(file2) { + var r8 = /import|require/g; + while (r8.exec(file2.text) !== null) { + var node2 = getNodeAtPosition(file2, r8.lastIndex); + if (isJavaScriptFile && ts2.isRequireCall( + node2, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + ts2.setParentRecursive( + node2, + /*incremental*/ + false + ); + imports = ts2.append(imports, node2.arguments[0]); + } else if (ts2.isImportCall(node2) && node2.arguments.length >= 1 && ts2.isStringLiteralLike(node2.arguments[0])) { + ts2.setParentRecursive( + node2, + /*incremental*/ + false + ); + imports = ts2.append(imports, node2.arguments[0]); + } else if (ts2.isLiteralImportTypeNode(node2)) { + ts2.setParentRecursive( + node2, + /*incremental*/ + false + ); + imports = ts2.append(imports, node2.argument.literal); + } + } + } + function getNodeAtPosition(sourceFile, position) { + var current = sourceFile; + var getContainingChild = function(child2) { + if (child2.pos <= position && (position < child2.end || position === child2.end && child2.kind === 1)) { + return child2; + } + }; + while (true) { + var child = isJavaScriptFile && ts2.hasJSDocNodes(current) && ts2.forEach(current.jsDoc, getContainingChild) || ts2.forEachChild(current, getContainingChild); + if (!child) { + return current; + } + current = child; + } + } + } + function getLibFileFromReference(ref) { + var libName = ts2.toFileNameLowerCase(ref.fileName); + var libFileName = ts2.libMap.get(libName); + if (libFileName) { + return getSourceFile(pathForLibFile(libFileName)); + } + } + function getSourceFileFromReference(referencingFile, ref) { + return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), getSourceFile); + } + function getSourceFileFromReferenceWorker(fileName, getSourceFile2, fail2, reason) { + if (ts2.hasExtension(fileName)) { + var canonicalFileName_1 = host.getCanonicalFileName(fileName); + if (!options.allowNonTsExtensions && !ts2.forEach(ts2.flatten(supportedExtensionsWithJsonIfResolveJsonModule), function(extension) { + return ts2.fileExtensionIs(canonicalFileName_1, extension); + })) { + if (fail2) { + if (ts2.hasJSFileExtension(canonicalFileName_1)) { + fail2(ts2.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName); + } else { + fail2(ts2.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + ts2.flatten(supportedExtensions).join("', '") + "'"); + } + } + return void 0; + } + var sourceFile = getSourceFile2(fileName); + if (fail2) { + if (!sourceFile) { + var redirect = getProjectReferenceRedirect(fileName); + if (redirect) { + fail2(ts2.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName); + } else { + fail2(ts2.Diagnostics.File_0_not_found, fileName); + } + } else if (isReferencedFile(reason) && canonicalFileName_1 === host.getCanonicalFileName(getSourceFileByPath(reason.file).fileName)) { + fail2(ts2.Diagnostics.A_file_cannot_have_a_reference_to_itself); + } + } + return sourceFile; + } else { + var sourceFileNoExtension = options.allowNonTsExtensions && getSourceFile2(fileName); + if (sourceFileNoExtension) + return sourceFileNoExtension; + if (fail2 && options.allowNonTsExtensions) { + fail2(ts2.Diagnostics.File_0_not_found, fileName); + return void 0; + } + var sourceFileWithAddedExtension = ts2.forEach(supportedExtensions[0], function(extension) { + return getSourceFile2(fileName + extension); + }); + if (fail2 && !sourceFileWithAddedExtension) + fail2(ts2.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + ts2.flatten(supportedExtensions).join("', '") + "'"); + return sourceFileWithAddedExtension; + } + } + function processSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, packageId, reason) { + getSourceFileFromReferenceWorker( + fileName, + function(fileName2) { + return findSourceFile(fileName2, isDefaultLib, ignoreNoDefaultLib, reason, packageId); + }, + // TODO: GH#18217 + function(diagnostic) { + var args = []; + for (var _i2 = 1; _i2 < arguments.length; _i2++) { + args[_i2 - 1] = arguments[_i2]; + } + return addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + diagnostic, + args + ); + }, + reason + ); + } + function processProjectReferenceFile(fileName, reason) { + return processSourceFile( + fileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + /*packageId*/ + void 0, + reason + ); + } + function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) { + var hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && ts2.some(fileReasons.get(existingFile.path), isReferencedFile); + if (hasExistingReasonToReportErrorOn) { + addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts2.Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]); + } else { + addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts2.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]); + } + } + function createRedirectSourceFile(redirectTarget, unredirected, fileName, path2, resolvedPath, originalFileName, sourceFileOptions) { + var _a3; + var redirect = Object.create(redirectTarget); + redirect.fileName = fileName; + redirect.path = path2; + redirect.resolvedPath = resolvedPath; + redirect.originalFileName = originalFileName; + redirect.redirectInfo = { redirectTarget, unredirected }; + redirect.packageJsonLocations = ((_a3 = sourceFileOptions.packageJsonLocations) === null || _a3 === void 0 ? void 0 : _a3.length) ? sourceFileOptions.packageJsonLocations : void 0; + redirect.packageJsonScope = sourceFileOptions.packageJsonScope; + sourceFilesFoundSearchingNodeModules.set(path2, currentNodeModulesDepth > 0); + Object.defineProperties(redirect, { + id: { + get: function() { + return this.redirectInfo.redirectTarget.id; + }, + set: function(value2) { + this.redirectInfo.redirectTarget.id = value2; + } + }, + symbol: { + get: function() { + return this.redirectInfo.redirectTarget.symbol; + }, + set: function(value2) { + this.redirectInfo.redirectTarget.symbol = value2; + } + } + }); + return redirect; + } + function findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "findSourceFile", { + fileName, + isDefaultLib: isDefaultLib || void 0, + fileIncludeKind: ts2.FileIncludeKind[reason.kind] + }); + var result2 = findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + return result2; + } + function getCreateSourceFileOptions(fileName, moduleResolutionCache2, host2, options2) { + var result2 = getImpliedNodeFormatForFileWorker(ts2.getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 === null || moduleResolutionCache2 === void 0 ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2); + var languageVersion = ts2.getEmitScriptTarget(options2); + var setExternalModuleIndicator = ts2.getSetExternalModuleIndicator(options2); + return typeof result2 === "object" ? __assign16(__assign16({}, result2), { languageVersion, setExternalModuleIndicator }) : { languageVersion, impliedNodeFormat: result2, setExternalModuleIndicator }; + } + function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { + var _a3, _b2; + var path2 = toPath2(fileName); + if (useSourceOfProjectReferenceRedirect) { + var source = getSourceOfProjectReferenceRedirect(path2); + if (!source && host.realpath && options.preserveSymlinks && ts2.isDeclarationFileName(fileName) && ts2.stringContains(fileName, ts2.nodeModulesPathPart)) { + var realPath = toPath2(host.realpath(fileName)); + if (realPath !== path2) + source = getSourceOfProjectReferenceRedirect(realPath); + } + if (source) { + var file_1 = ts2.isString(source) ? findSourceFile(source, isDefaultLib, ignoreNoDefaultLib, reason, packageId) : void 0; + if (file_1) + addFileToFilesByName( + file_1, + path2, + /*redirectedPath*/ + void 0 + ); + return file_1; + } + } + var originalFileName = fileName; + if (filesByName.has(path2)) { + var file_2 = filesByName.get(path2); + addFileIncludeReason(file_2 || void 0, reason); + if (file_2 && options.forceConsistentCasingInFileNames) { + var checkedName = file_2.fileName; + var isRedirect = toPath2(checkedName) !== toPath2(fileName); + if (isRedirect) { + fileName = getProjectReferenceRedirect(fileName) || fileName; + } + var checkedAbsolutePath = ts2.getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); + var inputAbsolutePath = ts2.getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory); + if (checkedAbsolutePath !== inputAbsolutePath) { + reportFileNamesDifferOnlyInCasingError(fileName, file_2, reason); + } + } + if (file_2 && sourceFilesFoundSearchingNodeModules.get(file_2.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file_2.path, false); + if (!options.noResolve) { + processReferencedFiles(file_2, isDefaultLib); + processTypeReferenceDirectives(file_2); + } + if (!options.noLib) { + processLibReferenceDirectives(file_2); + } + modulesWithElidedImports.set(file_2.path, false); + processImportedModules(file_2); + } else if (file_2 && modulesWithElidedImports.get(file_2.path)) { + if (currentNodeModulesDepth < maxNodeModuleJsDepth) { + modulesWithElidedImports.set(file_2.path, false); + processImportedModules(file_2); + } + } + return file_2 || void 0; + } + var redirectedPath; + if (isReferencedFile(reason) && !useSourceOfProjectReferenceRedirect) { + var redirectProject = getProjectReferenceRedirectProject(fileName); + if (redirectProject) { + if (ts2.outFile(redirectProject.commandLine.options)) { + return void 0; + } + var redirect = getProjectReferenceOutputName(redirectProject, fileName); + fileName = redirect; + redirectedPath = toPath2(redirect); + } + } + var sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options); + var file = host.getSourceFile(fileName, sourceFileOptions, function(hostErrorMessage) { + return addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + ts2.Diagnostics.Cannot_read_file_0_Colon_1, + [fileName, hostErrorMessage] + ); + }, shouldCreateNewSourceFile || ((_a3 = oldProgram === null || oldProgram === void 0 ? void 0 : oldProgram.getSourceFileByPath(toPath2(fileName))) === null || _a3 === void 0 ? void 0 : _a3.impliedNodeFormat) !== sourceFileOptions.impliedNodeFormat); + if (packageId) { + var packageIdKey = ts2.packageIdToString(packageId); + var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path2, toPath2(fileName), originalFileName, sourceFileOptions); + redirectTargetsMap.add(fileFromPackageId.path, fileName); + addFileToFilesByName(dupFile, path2, redirectedPath); + addFileIncludeReason(dupFile, reason); + sourceFileToPackageName.set(path2, ts2.packageIdToPackageName(packageId)); + processingOtherFiles.push(dupFile); + return dupFile; + } else if (file) { + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path2, ts2.packageIdToPackageName(packageId)); + } + } + addFileToFilesByName(file, path2, redirectedPath); + if (file) { + sourceFilesFoundSearchingNodeModules.set(path2, currentNodeModulesDepth > 0); + file.fileName = fileName; + file.path = path2; + file.resolvedPath = toPath2(fileName); + file.originalFileName = originalFileName; + file.packageJsonLocations = ((_b2 = sourceFileOptions.packageJsonLocations) === null || _b2 === void 0 ? void 0 : _b2.length) ? sourceFileOptions.packageJsonLocations : void 0; + file.packageJsonScope = sourceFileOptions.packageJsonScope; + addFileIncludeReason(file, reason); + if (host.useCaseSensitiveFileNames()) { + var pathLowerCase = ts2.toFileNameLowerCase(path2); + var existingFile = filesByNameIgnoreCase.get(pathLowerCase); + if (existingFile) { + reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason); + } else { + filesByNameIgnoreCase.set(pathLowerCase, file); + } + } + skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib && !ignoreNoDefaultLib; + if (!options.noResolve) { + processReferencedFiles(file, isDefaultLib); + processTypeReferenceDirectives(file); + } + if (!options.noLib) { + processLibReferenceDirectives(file); + } + processImportedModules(file); + if (isDefaultLib) { + processingDefaultLibFiles.push(file); + } else { + processingOtherFiles.push(file); + } + } + return file; + } + function addFileIncludeReason(file, reason) { + if (file) + fileReasons.add(file.path, reason); + } + function addFileToFilesByName(file, path2, redirectedPath) { + if (redirectedPath) { + filesByName.set(redirectedPath, file); + filesByName.set(path2, file || false); + } else { + filesByName.set(path2, file); + } + } + function getProjectReferenceRedirect(fileName) { + var referencedProject = getProjectReferenceRedirectProject(fileName); + return referencedProject && getProjectReferenceOutputName(referencedProject, fileName); + } + function getProjectReferenceRedirectProject(fileName) { + if (!resolvedProjectReferences || !resolvedProjectReferences.length || ts2.isDeclarationFileName(fileName) || ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + )) { + return void 0; + } + return getResolvedProjectReferenceToRedirect(fileName); + } + function getProjectReferenceOutputName(referencedProject, fileName) { + var out = ts2.outFile(referencedProject.commandLine.options); + return out ? ts2.changeExtension( + out, + ".d.ts" + /* Extension.Dts */ + ) : ts2.getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); + } + function getResolvedProjectReferenceToRedirect(fileName) { + if (mapFromFileToProjectReferenceRedirects === void 0) { + mapFromFileToProjectReferenceRedirects = new ts2.Map(); + forEachResolvedProjectReference2(function(referencedProject) { + if (toPath2(options.configFilePath) !== referencedProject.sourceFile.path) { + referencedProject.commandLine.fileNames.forEach(function(f8) { + return mapFromFileToProjectReferenceRedirects.set(toPath2(f8), referencedProject.sourceFile.path); + }); + } + }); + } + var referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath2(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); + } + function forEachResolvedProjectReference2(cb) { + return ts2.forEachResolvedProjectReference(resolvedProjectReferences, cb); + } + function getSourceOfProjectReferenceRedirect(path2) { + if (!ts2.isDeclarationFileName(path2)) + return void 0; + if (mapFromToProjectReferenceRedirectSource === void 0) { + mapFromToProjectReferenceRedirectSource = new ts2.Map(); + forEachResolvedProjectReference2(function(resolvedRef) { + var out = ts2.outFile(resolvedRef.commandLine.options); + if (out) { + var outputDts = ts2.changeExtension( + out, + ".d.ts" + /* Extension.Dts */ + ); + mapFromToProjectReferenceRedirectSource.set(toPath2(outputDts), true); + } else { + var getCommonSourceDirectory_3 = ts2.memoize(function() { + return ts2.getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames()); + }); + ts2.forEach(resolvedRef.commandLine.fileNames, function(fileName) { + if (!ts2.isDeclarationFileName(fileName) && !ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + )) { + var outputDts2 = ts2.getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory_3); + mapFromToProjectReferenceRedirectSource.set(toPath2(outputDts2), fileName); + } + }); + } + }); + } + return mapFromToProjectReferenceRedirectSource.get(path2); + } + function isSourceOfProjectReferenceRedirect(fileName) { + return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); + } + function getResolvedProjectReferenceByPath(projectReferencePath) { + if (!projectReferenceRedirects) { + return void 0; + } + return projectReferenceRedirects.get(projectReferencePath) || void 0; + } + function processReferencedFiles(file, isDefaultLib) { + ts2.forEach(file.referencedFiles, function(ref, index4) { + processSourceFile( + resolveTripleslashReference(ref.fileName, file.fileName), + isDefaultLib, + /*ignoreNoDefaultLib*/ + false, + /*packageId*/ + void 0, + { kind: ts2.FileIncludeKind.ReferenceFile, file: file.path, index: index4 } + ); + }); + } + function processTypeReferenceDirectives(file) { + var typeDirectives = file.typeReferenceDirectives; + if (!typeDirectives) { + return; + } + var resolutions2 = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file); + for (var index4 = 0; index4 < typeDirectives.length; index4++) { + var ref = file.typeReferenceDirectives[index4]; + var resolvedTypeReferenceDirective = resolutions2[index4]; + var fileName = ts2.toFileNameLowerCase(ref.fileName); + ts2.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective); + var mode = ref.resolutionMode || file.impliedNodeFormat; + if (mode && ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.NodeNext) { + programDiagnostics.add(ts2.createDiagnosticForRange(file, ref, ts2.Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)); + } + processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts2.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index4 }); + } + } + function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 }); + processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason); + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.pop(); + } + function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) { + var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode); + if (previousResolution && previousResolution.primary) { + return; + } + var saveResolution = true; + if (resolvedTypeReferenceDirective) { + if (resolvedTypeReferenceDirective.isExternalLibraryImport) + currentNodeModulesDepth++; + if (resolvedTypeReferenceDirective.primary) { + processSourceFile( + resolvedTypeReferenceDirective.resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + resolvedTypeReferenceDirective.packageId, + reason + ); + } else { + if (previousResolution) { + if (resolvedTypeReferenceDirective.resolvedFileName !== previousResolution.resolvedFileName) { + var otherFileText = host.readFile(resolvedTypeReferenceDirective.resolvedFileName); + var existingFile = getSourceFile(previousResolution.resolvedFileName); + if (otherFileText !== existingFile.text) { + addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, ts2.Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict, [typeReferenceDirective, resolvedTypeReferenceDirective.resolvedFileName, previousResolution.resolvedFileName]); + } + } + saveResolution = false; + } else { + processSourceFile( + resolvedTypeReferenceDirective.resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + resolvedTypeReferenceDirective.packageId, + reason + ); + } + } + if (resolvedTypeReferenceDirective.isExternalLibraryImport) + currentNodeModulesDepth--; + } else { + addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + ts2.Diagnostics.Cannot_find_type_definition_file_for_0, + [typeReferenceDirective] + ); + } + if (saveResolution) { + resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolvedTypeReferenceDirective); + } + } + function pathForLibFile(libFileName) { + var components = libFileName.split("."); + var path2 = components[1]; + var i8 = 2; + while (components[i8] && components[i8] !== "d") { + path2 += (i8 === 2 ? "/" : "-") + components[i8]; + i8++; + } + var resolveFrom = ts2.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts")); + var localOverrideModuleResult = ts2.resolveModuleName("@typescript/lib-" + path2, resolveFrom, { moduleResolution: ts2.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache); + if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) { + return localOverrideModuleResult.resolvedModule.resolvedFileName; + } + return ts2.combinePaths(defaultLibraryPath, libFileName); + } + function processLibReferenceDirectives(file) { + ts2.forEach(file.libReferenceDirectives, function(libReference, index4) { + var libName = ts2.toFileNameLowerCase(libReference.fileName); + var libFileName = ts2.libMap.get(libName); + if (libFileName) { + processRootFile( + pathForLibFile(libFileName), + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + true, + { kind: ts2.FileIncludeKind.LibReferenceDirective, file: file.path, index: index4 } + ); + } else { + var unqualifiedLibName = ts2.removeSuffix(ts2.removePrefix(libName, "lib."), ".d.ts"); + var suggestion = ts2.getSpellingSuggestion(unqualifiedLibName, ts2.libs, ts2.identity); + var diagnostic = suggestion ? ts2.Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : ts2.Diagnostics.Cannot_find_lib_definition_for_0; + (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({ + kind: 0, + reason: { kind: ts2.FileIncludeKind.LibReferenceDirective, file: file.path, index: index4 }, + diagnostic, + args: [libName, suggestion] + }); + } + }); + } + function getCanonicalFileName(fileName) { + return host.getCanonicalFileName(fileName); + } + function processImportedModules(file) { + var _a3; + collectExternalModuleReferences(file); + if (file.imports.length || file.moduleAugmentations.length) { + var moduleNames = getModuleNames(file); + var resolutions2 = resolveModuleNamesReusingOldState(moduleNames, file); + ts2.Debug.assert(resolutions2.length === moduleNames.length); + var optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a3 = getRedirectReferenceForResolution(file)) === null || _a3 === void 0 ? void 0 : _a3.commandLine.options : void 0) || options; + for (var index4 = 0; index4 < moduleNames.length; index4++) { + var resolution = resolutions2[index4]; + ts2.setResolvedModule(file, moduleNames[index4], resolution, getModeForResolutionAtIndex(file, index4)); + if (!resolution) { + continue; + } + var isFromNodeModulesSearch = resolution.isExternalLibraryImport; + var isJsFile = !ts2.resolutionExtensionIsTSOrJson(resolution.extension); + var isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile; + var resolvedFileName = resolution.resolvedFileName; + if (isFromNodeModulesSearch) { + currentNodeModulesDepth++; + } + var elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; + var shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution) && !optionsForFile.noResolve && index4 < file.imports.length && !elideImport && !(isJsFile && !ts2.getAllowJSCompilerOption(optionsForFile)) && (ts2.isInJSFile(file.imports[index4]) || !(file.imports[index4].flags & 8388608)); + if (elideImport) { + modulesWithElidedImports.set(file.path, true); + } else if (shouldAddFile) { + findSourceFile( + resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + { kind: ts2.FileIncludeKind.Import, file: file.path, index: index4 }, + resolution.packageId + ); + } + if (isFromNodeModulesSearch) { + currentNodeModulesDepth--; + } + } + } else { + file.resolvedModules = void 0; + } + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + var allFilesBelongToPath = true; + var absoluteRootDirectoryPath = host.getCanonicalFileName(ts2.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (var _i2 = 0, sourceFiles_2 = sourceFiles; _i2 < sourceFiles_2.length; _i2++) { + var sourceFile = sourceFiles_2[_i2]; + if (!sourceFile.isDeclarationFile) { + var absoluteSourceFilePath = host.getCanonicalFileName(ts2.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + addProgramDiagnosticExplainingFile(sourceFile, ts2.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, [sourceFile.fileName, rootDirectory]); + allFilesBelongToPath = false; + } + } + } + return allFilesBelongToPath; + } + function parseProjectReferenceConfigFile(ref) { + if (!projectReferenceRedirects) { + projectReferenceRedirects = new ts2.Map(); + } + var refPath = resolveProjectReferencePath(ref); + var sourceFilePath = toPath2(refPath); + var fromCache = projectReferenceRedirects.get(sourceFilePath); + if (fromCache !== void 0) { + return fromCache || void 0; + } + var commandLine; + var sourceFile; + if (host.getParsedCommandLine) { + commandLine = host.getParsedCommandLine(refPath); + if (!commandLine) { + addFileToFilesByName( + /*sourceFile*/ + void 0, + sourceFilePath, + /*redirectedPath*/ + void 0 + ); + projectReferenceRedirects.set(sourceFilePath, false); + return void 0; + } + sourceFile = ts2.Debug.checkDefined(commandLine.options.configFile); + ts2.Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath); + addFileToFilesByName( + sourceFile, + sourceFilePath, + /*redirectedPath*/ + void 0 + ); + } else { + var basePath = ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(refPath), host.getCurrentDirectory()); + sourceFile = host.getSourceFile( + refPath, + 100 + /* ScriptTarget.JSON */ + ); + addFileToFilesByName( + sourceFile, + sourceFilePath, + /*redirectedPath*/ + void 0 + ); + if (sourceFile === void 0) { + projectReferenceRedirects.set(sourceFilePath, false); + return void 0; + } + commandLine = ts2.parseJsonSourceFileConfigFileContent( + sourceFile, + configParsingHost, + basePath, + /*existingOptions*/ + void 0, + refPath + ); + } + sourceFile.fileName = refPath; + sourceFile.path = sourceFilePath; + sourceFile.resolvedPath = sourceFilePath; + sourceFile.originalFileName = refPath; + var resolvedRef = { commandLine, sourceFile }; + projectReferenceRedirects.set(sourceFilePath, resolvedRef); + if (commandLine.projectReferences) { + resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile); + } + return resolvedRef; + } + function verifyCompilerOptions() { + if (options.strictPropertyInitialization && !ts2.getStrictOptionValue(options, "strictNullChecks")) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks"); + } + if (options.exactOptionalPropertyTypes && !ts2.getStrictOptionValue(options, "strictNullChecks")) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); + } + if (options.isolatedModules) { + if (options.out) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "isolatedModules"); + } + if (options.outFile) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", "isolatedModules"); + } + } + if (options.inlineSourceMap) { + if (options.sourceMap) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceMap", "inlineSourceMap"); + } + if (options.mapRoot) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); + } + } + if (options.composite) { + if (options.declaration === false) { + createDiagnosticForOptionName(ts2.Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); + } + if (options.incremental === false) { + createDiagnosticForOptionName(ts2.Diagnostics.Composite_projects_may_not_disable_incremental_compilation, "declaration"); + } + } + var outputFile = ts2.outFile(options); + if (options.tsBuildInfoFile) { + if (!ts2.isIncrementalCompilation(options)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "tsBuildInfoFile", "incremental", "composite"); + } + } else if (options.incremental && !outputFile && !options.configFilePath) { + programDiagnostics.add(ts2.createCompilerDiagnostic(ts2.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); + } + verifyProjectReferences(); + if (options.composite) { + var rootPaths = new ts2.Set(rootNames.map(toPath2)); + for (var _i2 = 0, files_4 = files; _i2 < files_4.length; _i2++) { + var file = files_4[_i2]; + if (ts2.sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) { + addProgramDiagnosticExplainingFile(file, ts2.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, [file.fileName, options.configFilePath || ""]); + } + } + } + if (options.paths) { + for (var key in options.paths) { + if (!ts2.hasProperty(options.paths, key)) { + continue; + } + if (!ts2.hasZeroOrOneAsteriskCharacter(key)) { + createDiagnosticForOptionPaths( + /*onKey*/ + true, + key, + ts2.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, + key + ); + } + if (ts2.isArray(options.paths[key])) { + var len = options.paths[key].length; + if (len === 0) { + createDiagnosticForOptionPaths( + /*onKey*/ + false, + key, + ts2.Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array, + key + ); + } + for (var i8 = 0; i8 < len; i8++) { + var subst = options.paths[key][i8]; + var typeOfSubst = typeof subst; + if (typeOfSubst === "string") { + if (!ts2.hasZeroOrOneAsteriskCharacter(subst)) { + createDiagnosticForOptionPathKeyValue(key, i8, ts2.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); + } + if (!options.baseUrl && !ts2.pathIsRelative(subst) && !ts2.pathIsAbsolute(subst)) { + createDiagnosticForOptionPathKeyValue(key, i8, ts2.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); + } + } else { + createDiagnosticForOptionPathKeyValue(key, i8, ts2.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); + } + } + } else { + createDiagnosticForOptionPaths( + /*onKey*/ + false, + key, + ts2.Diagnostics.Substitutions_for_pattern_0_should_be_an_array, + key + ); + } + } + } + if (!options.sourceMap && !options.inlineSourceMap) { + if (options.inlineSources) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "inlineSources"); + } + if (options.sourceRoot) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "sourceRoot"); + } + } + if (options.out && options.outFile) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile"); + } + if (options.mapRoot && !(options.sourceMap || options.declarationMap)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "mapRoot", "sourceMap", "declarationMap"); + } + if (options.declarationDir) { + if (!ts2.getEmitDeclarations(options)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); + } + if (outputFile) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", options.out ? "out" : "outFile"); + } + } + if (options.declarationMap && !ts2.getEmitDeclarations(options)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationMap", "declaration", "composite"); + } + if (options.lib && options.noLib) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib"); + } + if (options.noImplicitUseStrict && ts2.getStrictOptionValue(options, "alwaysStrict")) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict"); + } + var languageVersion = ts2.getEmitScriptTarget(options); + var firstNonAmbientExternalModuleSourceFile = ts2.find(files, function(f8) { + return ts2.isExternalModule(f8) && !f8.isDeclarationFile; + }); + if (options.isolatedModules) { + if (options.module === ts2.ModuleKind.None && languageVersion < 2) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); + } + if (options.preserveConstEnums === false) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled, "preserveConstEnums", "isolatedModules"); + } + for (var _a3 = 0, files_5 = files; _a3 < files_5.length; _a3++) { + var file = files_5[_a3]; + if (!ts2.isExternalModule(file) && !ts2.isSourceFileJS(file) && !file.isDeclarationFile && file.scriptKind !== 6) { + var span = ts2.getErrorSpanForNode(file, file); + programDiagnostics.add(ts2.createFileDiagnostic(file, span.start, span.length, ts2.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module, ts2.getBaseFileName(file.fileName))); + } + } + } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === ts2.ModuleKind.None) { + var span = ts2.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); + programDiagnostics.add(ts2.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts2.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)); + } + if (outputFile && !options.emitDeclarationOnly) { + if (options.module && !(options.module === ts2.ModuleKind.AMD || options.module === ts2.ModuleKind.System)) { + createDiagnosticForOptionName(ts2.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module"); + } else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) { + var span = ts2.getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); + programDiagnostics.add(ts2.createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, ts2.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile")); + } + } + if (options.resolveJsonModule) { + if (ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.NodeJs && ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.NodeNext) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule"); + } else if (!ts2.hasJsonModuleEmitEnabled(options)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module"); + } + } + if (options.outDir || // there is --outDir specified + options.rootDir || // there is --rootDir specified + options.sourceRoot || // there is --sourceRoot specified + options.mapRoot) { + var dir2 = getCommonSourceDirectory(); + if (options.outDir && dir2 === "" && files.some(function(file2) { + return ts2.getRootLength(file2.fileName) > 1; + })) { + createDiagnosticForOptionName(ts2.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir"); + } + } + if (options.useDefineForClassFields && languageVersion === 0) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); + } + if (options.checkJs && !ts2.getAllowJSCompilerOption(options)) { + programDiagnostics.add(ts2.createCompilerDiagnostic(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } + if (options.emitDeclarationOnly) { + if (!ts2.getEmitDeclarations(options)) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } + if (options.emitDecoratorMetadata && !options.experimentalDecorators) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); + } + if (options.jsxFactory) { + if (options.reactNamespace) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); + } + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", ts2.inverseJsxOptionMap.get("" + options.jsx)); + } + if (!ts2.parseIsolatedEntityName(options.jsxFactory, languageVersion)) { + createOptionValueDiagnostic("jsxFactory", ts2.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); + } + } else if (options.reactNamespace && !ts2.isIdentifierText(options.reactNamespace, languageVersion)) { + createOptionValueDiagnostic("reactNamespace", ts2.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace); + } + if (options.jsxFragmentFactory) { + if (!options.jsxFactory) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); + } + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", ts2.inverseJsxOptionMap.get("" + options.jsx)); + } + if (!ts2.parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { + createOptionValueDiagnostic("jsxFragmentFactory", ts2.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); + } + } + if (options.reactNamespace) { + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", ts2.inverseJsxOptionMap.get("" + options.jsx)); + } + } + if (options.jsxImportSource) { + if (options.jsx === 2) { + createDiagnosticForOptionName(ts2.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", ts2.inverseJsxOptionMap.get("" + options.jsx)); + } + } + if (options.preserveValueImports && ts2.getEmitModuleKind(options) < ts2.ModuleKind.ES2015) { + createOptionValueDiagnostic("importsNotUsedAsValues", ts2.Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later); + } + if (!options.noEmit && !options.suppressOutputPathCheck) { + var emitHost = getEmitHost(); + var emitFilesSeen_1 = new ts2.Set(); + ts2.forEachEmittedFile(emitHost, function(emitFileNames) { + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); + }); + } + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + var emitFilePath = toPath2(emitFileName); + if (filesByName.has(emitFilePath)) { + var chain3 = void 0; + if (!options.configFilePath) { + chain3 = ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig + ); + } + chain3 = ts2.chainDiagnosticMessages(chain3, ts2.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts2.createCompilerDiagnosticFromMessageChain(chain3)); + } + var emitFileKey = !host.useCaseSensitiveFileNames() ? ts2.toFileNameLowerCase(emitFilePath) : emitFilePath; + if (emitFilesSeen.has(emitFileKey)) { + blockEmittingOfFile(emitFileName, ts2.createCompilerDiagnostic(ts2.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName)); + } else { + emitFilesSeen.add(emitFileKey); + } + } + } + } + function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { + var _a3; + var fileIncludeReasons; + var relatedInfo; + var locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0; + if (file) + (_a3 = fileReasons.get(file.path)) === null || _a3 === void 0 ? void 0 : _a3.forEach(processReason); + if (fileProcessingReason) + processReason(fileProcessingReason); + if (locationReason && (fileIncludeReasons === null || fileIncludeReasons === void 0 ? void 0 : fileIncludeReasons.length) === 1) + fileIncludeReasons = void 0; + var location2 = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason); + var fileIncludeReasonDetails = fileIncludeReasons && ts2.chainDiagnosticMessages(fileIncludeReasons, ts2.Diagnostics.The_file_is_in_the_program_because_Colon); + var redirectInfo = file && ts2.explainIfFileIsRedirectAndImpliedFormat(file); + var chain3 = ts2.chainDiagnosticMessages.apply(void 0, __spreadArray9([redirectInfo ? fileIncludeReasonDetails ? __spreadArray9([fileIncludeReasonDetails], redirectInfo, true) : redirectInfo : fileIncludeReasonDetails, diagnostic], args || ts2.emptyArray, false)); + return location2 && isReferenceFileLocation(location2) ? ts2.createFileDiagnosticFromMessageChain(location2.file, location2.pos, location2.end - location2.pos, chain3, relatedInfo) : ts2.createCompilerDiagnosticFromMessageChain(chain3, relatedInfo); + function processReason(reason) { + (fileIncludeReasons || (fileIncludeReasons = [])).push(ts2.fileIncludeReasonToDiagnostics(program, reason)); + if (!locationReason && isReferencedFile(reason)) { + locationReason = reason; + } else if (locationReason !== reason) { + relatedInfo = ts2.append(relatedInfo, fileIncludeReasonToRelatedInformation(reason)); + } + if (reason === fileProcessingReason) + fileProcessingReason = void 0; + } + } + function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) { + (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({ + kind: 1, + file: file && file.path, + fileProcessingReason, + diagnostic, + args + }); + } + function addProgramDiagnosticExplainingFile(file, diagnostic, args) { + programDiagnostics.add(createDiagnosticExplainingFile( + file, + /*fileProcessingReason*/ + void 0, + diagnostic, + args + )); + } + function fileIncludeReasonToRelatedInformation(reason) { + if (isReferencedFile(reason)) { + var referenceLocation = getReferencedFileLocation(getSourceFileByPath, reason); + var message_2; + switch (reason.kind) { + case ts2.FileIncludeKind.Import: + message_2 = ts2.Diagnostics.File_is_included_via_import_here; + break; + case ts2.FileIncludeKind.ReferenceFile: + message_2 = ts2.Diagnostics.File_is_included_via_reference_here; + break; + case ts2.FileIncludeKind.TypeReferenceDirective: + message_2 = ts2.Diagnostics.File_is_included_via_type_library_reference_here; + break; + case ts2.FileIncludeKind.LibReferenceDirective: + message_2 = ts2.Diagnostics.File_is_included_via_library_reference_here; + break; + default: + ts2.Debug.assertNever(reason); + } + return isReferenceFileLocation(referenceLocation) ? ts2.createFileDiagnostic(referenceLocation.file, referenceLocation.pos, referenceLocation.end - referenceLocation.pos, message_2) : void 0; + } + if (!options.configFile) + return void 0; + var configFileNode; + var message; + switch (reason.kind) { + case ts2.FileIncludeKind.RootFile: + if (!options.configFile.configFileSpecs) + return void 0; + var fileName = ts2.getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory); + var matchedByFiles = ts2.getMatchedFileSpec(program, fileName); + if (matchedByFiles) { + configFileNode = ts2.getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles); + message = ts2.Diagnostics.File_is_matched_by_files_list_specified_here; + break; + } + var matchedByInclude = ts2.getMatchedIncludeSpec(program, fileName); + if (!matchedByInclude || !ts2.isString(matchedByInclude)) + return void 0; + configFileNode = ts2.getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); + message = ts2.Diagnostics.File_is_matched_by_include_pattern_specified_here; + break; + case ts2.FileIncludeKind.SourceFromProjectReference: + case ts2.FileIncludeKind.OutputFromProjectReference: + var referencedResolvedRef_1 = ts2.Debug.checkDefined(resolvedProjectReferences === null || resolvedProjectReferences === void 0 ? void 0 : resolvedProjectReferences[reason.index]); + var referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, function(resolvedRef, parent2, index5) { + return resolvedRef === referencedResolvedRef_1 ? { sourceFile: (parent2 === null || parent2 === void 0 ? void 0 : parent2.sourceFile) || options.configFile, index: index5 } : void 0; + }); + if (!referenceInfo) + return void 0; + var sourceFile = referenceInfo.sourceFile, index4 = referenceInfo.index; + var referencesSyntax = ts2.firstDefined(ts2.getTsConfigPropArray(sourceFile, "references"), function(property2) { + return ts2.isArrayLiteralExpression(property2.initializer) ? property2.initializer : void 0; + }); + return referencesSyntax && referencesSyntax.elements.length > index4 ? ts2.createDiagnosticForNodeInSourceFile(sourceFile, referencesSyntax.elements[index4], reason.kind === ts2.FileIncludeKind.OutputFromProjectReference ? ts2.Diagnostics.File_is_output_from_referenced_project_specified_here : ts2.Diagnostics.File_is_source_from_referenced_project_specified_here) : void 0; + case ts2.FileIncludeKind.AutomaticTypeDirectiveFile: + if (!options.types) + return void 0; + configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference); + message = ts2.Diagnostics.File_is_entry_point_of_type_library_specified_here; + break; + case ts2.FileIncludeKind.LibFile: + if (reason.index !== void 0) { + configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]); + message = ts2.Diagnostics.File_is_library_specified_here; + break; + } + var target = ts2.forEachEntry(ts2.targetOptionDeclaration.type, function(value2, key) { + return value2 === ts2.getEmitScriptTarget(options) ? key : void 0; + }); + configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0; + message = ts2.Diagnostics.File_is_default_library_for_target_specified_here; + break; + default: + ts2.Debug.assertNever(reason); + } + return configFileNode && ts2.createDiagnosticForNodeInSourceFile(options.configFile, configFileNode, message); + } + function verifyProjectReferences() { + var buildInfoPath = !options.suppressOutputPathCheck ? ts2.getTsBuildInfoEmitOutputFilePath(options) : void 0; + forEachProjectReference(projectReferences, resolvedProjectReferences, function(resolvedRef, parent2, index4) { + var ref = (parent2 ? parent2.commandLine.projectReferences : projectReferences)[index4]; + var parentFile = parent2 && parent2.sourceFile; + if (!resolvedRef) { + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.File_0_not_found, ref.path); + return; + } + var options2 = resolvedRef.commandLine.options; + if (!options2.composite || options2.noEmit) { + var inputs = parent2 ? parent2.commandLine.fileNames : rootNames; + if (inputs.length) { + if (!options2.composite) + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path); + if (options2.noEmit) + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path); + } + } + if (ref.prepend) { + var out = ts2.outFile(options2); + if (out) { + if (!host.fileExists(out)) { + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path); + } + } else { + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path); + } + } + if (!parent2 && buildInfoPath && buildInfoPath === ts2.getTsBuildInfoEmitOutputFilePath(options2)) { + createDiagnosticForReference(parentFile, index4, ts2.Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path); + hasEmitBlockingDiagnostics.set(toPath2(buildInfoPath), true); + } + }); + } + function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, arg0, arg1, arg2) { + var needCompilerDiagnostic = true; + var pathsSyntax = getOptionPathsSyntax(); + for (var _i2 = 0, pathsSyntax_1 = pathsSyntax; _i2 < pathsSyntax_1.length; _i2++) { + var pathProp = pathsSyntax_1[_i2]; + if (ts2.isObjectLiteralExpression(pathProp.initializer)) { + for (var _a3 = 0, _b2 = ts2.getPropertyAssignment(pathProp.initializer, key); _a3 < _b2.length; _a3++) { + var keyProps = _b2[_a3]; + var initializer = keyProps.initializer; + if (ts2.isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) { + programDiagnostics.add(ts2.createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, arg0, arg1, arg2)); + needCompilerDiagnostic = false; + } + } + } + } + if (needCompilerDiagnostic) { + programDiagnostics.add(ts2.createCompilerDiagnostic(message, arg0, arg1, arg2)); + } + } + function createDiagnosticForOptionPaths(onKey, key, message, arg0) { + var needCompilerDiagnostic = true; + var pathsSyntax = getOptionPathsSyntax(); + for (var _i2 = 0, pathsSyntax_2 = pathsSyntax; _i2 < pathsSyntax_2.length; _i2++) { + var pathProp = pathsSyntax_2[_i2]; + if (ts2.isObjectLiteralExpression(pathProp.initializer) && createOptionDiagnosticInObjectLiteralSyntax( + pathProp.initializer, + onKey, + key, + /*key2*/ + void 0, + message, + arg0 + )) { + needCompilerDiagnostic = false; + } + } + if (needCompilerDiagnostic) { + programDiagnostics.add(ts2.createCompilerDiagnostic(message, arg0)); + } + } + function getOptionsSyntaxByName(name2) { + var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + return compilerOptionsObjectLiteralSyntax && ts2.getPropertyAssignment(compilerOptionsObjectLiteralSyntax, name2); + } + function getOptionPathsSyntax() { + return getOptionsSyntaxByName("paths") || ts2.emptyArray; + } + function getOptionsSyntaxByValue(name2, value2) { + var syntaxByName = getOptionsSyntaxByName(name2); + return syntaxByName && ts2.firstDefined(syntaxByName, function(property2) { + return ts2.isStringLiteral(property2.initializer) && property2.initializer.text === value2 ? property2.initializer : void 0; + }); + } + function getOptionsSyntaxByArrayElementValue(name2, value2) { + var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + return compilerOptionsObjectLiteralSyntax && ts2.getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name2, value2); + } + function createDiagnosticForOptionName(message, option1, option2, option3) { + createDiagnosticForOption( + /*onKey*/ + true, + option1, + option2, + message, + option1, + option2, + option3 + ); + } + function createOptionValueDiagnostic(option1, message, arg0, arg1) { + createDiagnosticForOption( + /*onKey*/ + false, + option1, + /*option2*/ + void 0, + message, + arg0, + arg1 + ); + } + function createDiagnosticForReference(sourceFile, index4, message, arg0, arg1) { + var referencesSyntax = ts2.firstDefined(ts2.getTsConfigPropArray(sourceFile || options.configFile, "references"), function(property2) { + return ts2.isArrayLiteralExpression(property2.initializer) ? property2.initializer : void 0; + }); + if (referencesSyntax && referencesSyntax.elements.length > index4) { + programDiagnostics.add(ts2.createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index4], message, arg0, arg1)); + } else { + programDiagnostics.add(ts2.createCompilerDiagnostic(message, arg0, arg1)); + } + } + function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) { + var compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + var needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2); + if (needCompilerDiagnostic) { + programDiagnostics.add(ts2.createCompilerDiagnostic(message, arg0, arg1, arg2)); + } + } + function getCompilerOptionsObjectLiteralSyntax() { + if (_compilerOptionsObjectLiteralSyntax === void 0) { + _compilerOptionsObjectLiteralSyntax = false; + var jsonObjectLiteral = ts2.getTsConfigObjectLiteralExpression(options.configFile); + if (jsonObjectLiteral) { + for (var _i2 = 0, _a3 = ts2.getPropertyAssignment(jsonObjectLiteral, "compilerOptions"); _i2 < _a3.length; _i2++) { + var prop = _a3[_i2]; + if (ts2.isObjectLiteralExpression(prop.initializer)) { + _compilerOptionsObjectLiteralSyntax = prop.initializer; + break; + } + } + } + } + return _compilerOptionsObjectLiteralSyntax || void 0; + } + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) { + var props = ts2.getPropertyAssignment(objectLiteral, key1, key2); + for (var _i2 = 0, props_3 = props; _i2 < props_3.length; _i2++) { + var prop = props_3[_i2]; + programDiagnostics.add(ts2.createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2)); + } + return !!props.length; + } + function blockEmittingOfFile(emitFileName, diag) { + hasEmitBlockingDiagnostics.set(toPath2(emitFileName), true); + programDiagnostics.add(diag); + } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + var filePath = toPath2(file); + if (getSourceFileByPath(filePath)) { + return false; + } + var out = ts2.outFile(options); + if (out) { + return isSameFile(filePath, out) || isSameFile( + filePath, + ts2.removeFileExtension(out) + ".d.ts" + /* Extension.Dts */ + ); + } + if (options.declarationDir && ts2.containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) { + return true; + } + if (options.outDir) { + return ts2.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts2.fileExtensionIsOneOf(filePath, ts2.supportedJSExtensionsFlat) || ts2.isDeclarationFileName(filePath)) { + var filePathWithoutExtension = ts2.removeFileExtension(filePath); + return !!getSourceFileByPath(filePathWithoutExtension + ".ts") || !!getSourceFileByPath(filePathWithoutExtension + ".tsx"); + } + return false; + } + function isSameFile(file1, file2) { + return ts2.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0; + } + function getSymlinkCache() { + if (host.getSymlinkCache) { + return host.getSymlinkCache(); + } + if (!symlinks) { + symlinks = ts2.createSymlinkCache(currentDirectory, getCanonicalFileName); + } + if (files && resolvedTypeReferenceDirectives && !symlinks.hasProcessedResolutions()) { + symlinks.setSymlinksFromResolutions(files, resolvedTypeReferenceDirectives); + } + return symlinks; + } + } + ts2.createProgram = createProgram; + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + var setOfDeclarationDirectories; + var originalFileExists = host.compilerHost.fileExists; + var originalDirectoryExists = host.compilerHost.directoryExists; + var originalGetDirectories = host.compilerHost.getDirectories; + var originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return { onProgramCreateComplete: ts2.noop, fileExists }; + host.compilerHost.fileExists = fileExists; + var directoryExists; + if (originalDirectoryExists) { + directoryExists = host.compilerHost.directoryExists = function(path2) { + if (originalDirectoryExists.call(host.compilerHost, path2)) { + handleDirectoryCouldBeSymlink(path2); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!setOfDeclarationDirectories) { + setOfDeclarationDirectories = new ts2.Set(); + host.forEachResolvedProjectReference(function(ref) { + var out = ts2.outFile(ref.commandLine.options); + if (out) { + setOfDeclarationDirectories.add(ts2.getDirectoryPath(host.toPath(out))); + } else { + var declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + setOfDeclarationDirectories.add(host.toPath(declarationDir)); + } + } + }); + } + return fileOrDirectoryExistsUsingSource( + path2, + /*isFile*/ + false + ); + }; + } + if (originalGetDirectories) { + host.compilerHost.getDirectories = function(path2) { + return !host.getResolvedProjectReferences() || originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path2) ? originalGetDirectories.call(host.compilerHost, path2) : []; + }; + } + if (originalRealpath) { + host.compilerHost.realpath = function(s7) { + var _a2; + return ((_a2 = host.getSymlinkCache().getSymlinkedFiles()) === null || _a2 === void 0 ? void 0 : _a2.get(host.toPath(s7))) || originalRealpath.call(host.compilerHost, s7); + }; + } + return { onProgramCreateComplete, fileExists, directoryExists }; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + } + function fileExists(file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!ts2.isDeclarationFileName(file)) + return false; + return fileOrDirectoryExistsUsingSource( + file, + /*isFile*/ + true + ); + } + function fileExistsIfProjectReferenceDts(file) { + var source = host.getSourceOfProjectReferenceRedirect(host.toPath(file)); + return source !== void 0 ? ts2.isString(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0; + } + function directoryExistsIfProjectReferenceDeclDir(dir2) { + var dirPath = host.toPath(dir2); + var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts2.directorySeparator); + return ts2.forEachKey(setOfDeclarationDirectories, function(declDirPath) { + return dirPath === declDirPath || // Any parent directory of declaration dir + ts2.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) || // Any directory inside declaration dir + ts2.startsWith(dirPath, "".concat(declDirPath, "/")); + }); + } + function handleDirectoryCouldBeSymlink(directory) { + var _a2; + if (!host.getResolvedProjectReferences() || ts2.containsIgnoredPath(directory)) + return; + if (!originalRealpath || !ts2.stringContains(directory, ts2.nodeModulesPathPart)) + return; + var symlinkCache = host.getSymlinkCache(); + var directoryPath = ts2.ensureTrailingDirectorySeparator(host.toPath(directory)); + if ((_a2 = symlinkCache.getSymlinkedDirectories()) === null || _a2 === void 0 ? void 0 : _a2.has(directoryPath)) + return; + var real = ts2.normalizePath(originalRealpath.call(host.compilerHost, directory)); + var realPath; + if (real === directory || (realPath = ts2.ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + symlinkCache.setSymlinkedDirectory(directoryPath, false); + return; + } + symlinkCache.setSymlinkedDirectory(directory, { + real: ts2.ensureTrailingDirectorySeparator(real), + realPath + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var _a2; + var fileOrDirectoryExistsUsingSource2 = isFile ? function(file) { + return fileExistsIfProjectReferenceDts(file); + } : function(dir2) { + return directoryExistsIfProjectReferenceDeclDir(dir2); + }; + var result2 = fileOrDirectoryExistsUsingSource2(fileOrDirectory); + if (result2 !== void 0) + return result2; + var symlinkCache = host.getSymlinkCache(); + var symlinkedDirectories = symlinkCache.getSymlinkedDirectories(); + if (!symlinkedDirectories) + return false; + var fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!ts2.stringContains(fileOrDirectoryPath, ts2.nodeModulesPathPart)) + return false; + if (isFile && ((_a2 = symlinkCache.getSymlinkedFiles()) === null || _a2 === void 0 ? void 0 : _a2.has(fileOrDirectoryPath))) + return true; + return ts2.firstDefinedIterator(symlinkedDirectories.entries(), function(_a3) { + var directoryPath = _a3[0], symlinkedDirectory = _a3[1]; + if (!symlinkedDirectory || !ts2.startsWith(fileOrDirectoryPath, directoryPath)) + return void 0; + var result3 = fileOrDirectoryExistsUsingSource2(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result3) { + var absolutePath = ts2.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), ""))); + } + return result3; + }) || false; + } + } + ts2.emitSkippedWithNoDiagnostics = { diagnostics: ts2.emptyArray, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: true }; + function handleNoEmitOptions(program, sourceFile, writeFile2, cancellationToken) { + var options = program.getCompilerOptions(); + if (options.noEmit) { + program.getSemanticDiagnostics(sourceFile, cancellationToken); + return sourceFile || ts2.outFile(options) ? ts2.emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile2, cancellationToken); + } + if (!options.noEmitOnError) + return void 0; + var diagnostics = __spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], program.getOptionsDiagnostics(cancellationToken), true), program.getSyntacticDiagnostics(sourceFile, cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true), program.getSemanticDiagnostics(sourceFile, cancellationToken), true); + if (diagnostics.length === 0 && ts2.getEmitDeclarations(program.getCompilerOptions())) { + diagnostics = program.getDeclarationDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ); + } + if (!diagnostics.length) + return void 0; + var emittedFiles; + if (!sourceFile && !ts2.outFile(options)) { + var emitResult = program.emitBuildInfo(writeFile2, cancellationToken); + if (emitResult.diagnostics) + diagnostics = __spreadArray9(__spreadArray9([], diagnostics, true), emitResult.diagnostics, true); + emittedFiles = emitResult.emittedFiles; + } + return { diagnostics, sourceMaps: void 0, emittedFiles, emitSkipped: true }; + } + ts2.handleNoEmitOptions = handleNoEmitOptions; + function filterSemanticDiagnostics(diagnostic, option) { + return ts2.filter(diagnostic, function(d7) { + return !d7.skippedOn || !option[d7.skippedOn]; + }); + } + ts2.filterSemanticDiagnostics = filterSemanticDiagnostics; + function parseConfigHostFromCompilerHostLike(host, directoryStructureHost) { + if (directoryStructureHost === void 0) { + directoryStructureHost = host; + } + return { + fileExists: function(f8) { + return directoryStructureHost.fileExists(f8); + }, + readDirectory: function(root2, extensions6, excludes, includes2, depth) { + ts2.Debug.assertIsDefined(directoryStructureHost.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return directoryStructureHost.readDirectory(root2, extensions6, excludes, includes2, depth); + }, + readFile: function(f8) { + return directoryStructureHost.readFile(f8); + }, + useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(), + getCurrentDirectory: function() { + return host.getCurrentDirectory(); + }, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || ts2.returnUndefined, + trace: host.trace ? function(s7) { + return host.trace(s7); + } : void 0 + }; + } + ts2.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike; + function createPrependNodes(projectReferences, getCommandLine, readFile2) { + if (!projectReferences) + return ts2.emptyArray; + var nodes; + for (var i7 = 0; i7 < projectReferences.length; i7++) { + var ref = projectReferences[i7]; + var resolvedRefOpts = getCommandLine(ref, i7); + if (ref.prepend && resolvedRefOpts && resolvedRefOpts.options) { + var out = ts2.outFile(resolvedRefOpts.options); + if (!out) + continue; + var _a2 = ts2.getOutputPathsForBundle( + resolvedRefOpts.options, + /*forceDtsPaths*/ + true + ), jsFilePath = _a2.jsFilePath, sourceMapFilePath = _a2.sourceMapFilePath, declarationFilePath = _a2.declarationFilePath, declarationMapPath = _a2.declarationMapPath, buildInfoPath = _a2.buildInfoPath; + var node = ts2.createInputFiles(readFile2, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath); + (nodes || (nodes = [])).push(node); + } + } + return nodes || ts2.emptyArray; + } + ts2.createPrependNodes = createPrependNodes; + function resolveProjectReferencePath(hostOrRef, ref) { + var passedInRef = ref ? ref : hostOrRef; + return ts2.resolveConfigFileProjectName(passedInRef.path); + } + ts2.resolveProjectReferencePath = resolveProjectReferencePath; + function getResolutionDiagnostic(options, _a2) { + var extension = _a2.extension; + switch (extension) { + case ".ts": + case ".d.ts": + return void 0; + case ".tsx": + return needJsx(); + case ".jsx": + return needJsx() || needAllowJs(); + case ".js": + return needAllowJs(); + case ".json": + return needResolveJsonModule(); + } + function needJsx() { + return options.jsx ? void 0 : ts2.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; + } + function needAllowJs() { + return ts2.getAllowJSCompilerOption(options) || !ts2.getStrictOptionValue(options, "noImplicitAny") ? void 0 : ts2.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + } + function needResolveJsonModule() { + return options.resolveJsonModule ? void 0 : ts2.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; + } + } + ts2.getResolutionDiagnostic = getResolutionDiagnostic; + function getModuleNames(_a2) { + var imports = _a2.imports, moduleAugmentations = _a2.moduleAugmentations; + var res = imports.map(function(i7) { + return i7.text; + }); + for (var _i = 0, moduleAugmentations_1 = moduleAugmentations; _i < moduleAugmentations_1.length; _i++) { + var aug = moduleAugmentations_1[_i]; + if (aug.kind === 10) { + res.push(aug.text); + } + } + return res; + } + function getModuleNameStringLiteralAt(_a2, index4) { + var imports = _a2.imports, moduleAugmentations = _a2.moduleAugmentations; + if (index4 < imports.length) + return imports[index4]; + var augIndex = imports.length; + for (var _i = 0, moduleAugmentations_2 = moduleAugmentations; _i < moduleAugmentations_2.length; _i++) { + var aug = moduleAugmentations_2[_i]; + if (aug.kind === 10) { + if (index4 === augIndex) + return aug; + augIndex++; + } + } + ts2.Debug.fail("should never ask for module name at index higher than possible module name"); + } + ts2.getModuleNameStringLiteralAt = getModuleNameStringLiteralAt; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) { + var outputFiles = []; + var _a2 = program.emit(sourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit), emitSkipped = _a2.emitSkipped, diagnostics = _a2.diagnostics; + return { outputFiles, emitSkipped, diagnostics }; + function writeFile2(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark, text }); + } + } + ts2.getFileEmitOutput = getFileEmitOutput; + var BuilderState; + (function(BuilderState2) { + function createManyToManyPathMap() { + function create3(forward, reverse2, deleted) { + var map4 = { + getKeys: function(v8) { + return reverse2.get(v8); + }, + getValues: function(k6) { + return forward.get(k6); + }, + keys: function() { + return forward.keys(); + }, + deleteKey: function(k6) { + (deleted || (deleted = new ts2.Set())).add(k6); + var set4 = forward.get(k6); + if (!set4) { + return false; + } + set4.forEach(function(v8) { + return deleteFromMultimap(reverse2, v8, k6); + }); + forward.delete(k6); + return true; + }, + set: function(k6, vSet) { + deleted === null || deleted === void 0 ? void 0 : deleted.delete(k6); + var existingVSet = forward.get(k6); + forward.set(k6, vSet); + existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.forEach(function(v8) { + if (!vSet.has(v8)) { + deleteFromMultimap(reverse2, v8, k6); + } + }); + vSet.forEach(function(v8) { + if (!(existingVSet === null || existingVSet === void 0 ? void 0 : existingVSet.has(v8))) { + addToMultimap(reverse2, v8, k6); + } + }); + return map4; + } + }; + return map4; + } + return create3( + new ts2.Map(), + new ts2.Map(), + /*deleted*/ + void 0 + ); + } + BuilderState2.createManyToManyPathMap = createManyToManyPathMap; + function addToMultimap(map4, k6, v8) { + var set4 = map4.get(k6); + if (!set4) { + set4 = new ts2.Set(); + map4.set(k6, set4); + } + set4.add(v8); + } + function deleteFromMultimap(map4, k6, v8) { + var set4 = map4.get(k6); + if (set4 === null || set4 === void 0 ? void 0 : set4.delete(v8)) { + if (!set4.size) { + map4.delete(k6); + } + return true; + } + return false; + } + function getReferencedFilesFromImportedModuleSymbol(symbol) { + return ts2.mapDefined(symbol.declarations, function(declaration) { + var _a2; + return (_a2 = ts2.getSourceFileOfNode(declaration)) === null || _a2 === void 0 ? void 0 : _a2.resolvedPath; + }); + } + function getReferencedFilesFromImportLiteral(checker, importName) { + var symbol = checker.getSymbolAtLocation(importName); + return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); + } + function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { + return ts2.toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); + } + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a2 = sourceFile.imports; _i < _a2.length; _i++) { + var importName = _a2[_i]; + var declarationSourceFilePaths = getReferencedFilesFromImportLiteral(checker, importName); + declarationSourceFilePaths === null || declarationSourceFilePaths === void 0 ? void 0 : declarationSourceFilePaths.forEach(addReferencedFile); + } + } + var sourceFileDirectory = ts2.getDirectoryPath(sourceFile.resolvedPath); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = getReferencedFileFromFileName(program, referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function(resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + if (sourceFile.moduleAugmentations.length) { + var checker = program.getTypeChecker(); + for (var _d = 0, _e2 = sourceFile.moduleAugmentations; _d < _e2.length; _d++) { + var moduleName3 = _e2[_d]; + if (!ts2.isStringLiteral(moduleName3)) + continue; + var symbol = checker.getSymbolAtLocation(moduleName3); + if (!symbol) + continue; + addReferenceFromAmbientModule(symbol); + } + } + for (var _f = 0, _g = program.getTypeChecker().getAmbientModules(); _f < _g.length; _f++) { + var ambientModule = _g[_f]; + if (ambientModule.declarations && ambientModule.declarations.length > 1) { + addReferenceFromAmbientModule(ambientModule); + } + } + return referencedFiles; + function addReferenceFromAmbientModule(symbol2) { + if (!symbol2.declarations) { + return; + } + for (var _i2 = 0, _a3 = symbol2.declarations; _i2 < _a3.length; _i2++) { + var declaration = _a3[_i2]; + var declarationSourceFile = ts2.getSourceFileOfNode(declaration); + if (declarationSourceFile && declarationSourceFile !== sourceFile) { + addReferencedFile(declarationSourceFile.resolvedPath); + } + } + } + function addReferencedFile(referencedPath2) { + (referencedFiles || (referencedFiles = new ts2.Set())).add(referencedPath2); + } + } + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState2.canReuseOldState = canReuseOldState; + function create2(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) { + var _a2, _b, _c; + var fileInfos = new ts2.Map(); + var referencedMap = newProgram.getCompilerOptions().module !== ts2.ModuleKind.None ? createManyToManyPathMap() : void 0; + var exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0; + var useOldState = canReuseOldState(referencedMap, oldState); + newProgram.getTypeChecker(); + for (var _i = 0, _d = newProgram.getSourceFiles(); _i < _d.length; _i++) { + var sourceFile = _d[_i]; + var version_2 = ts2.Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + var oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) === null || _a2 === void 0 ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0; + var signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) === null || _b === void 0 ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0; + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.resolvedPath, newReferences); + } + if (useOldState) { + var oldUncommittedExportedModules = (_c = oldState.oldExportedModulesMap) === null || _c === void 0 ? void 0 : _c.get(sourceFile.resolvedPath); + var exportedModules = oldUncommittedExportedModules === void 0 ? oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) : oldUncommittedExportedModules || void 0; + if (exportedModules) { + exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); + } + } + } + fileInfos.set(sourceFile.resolvedPath, { + version: version_2, + signature, + affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || void 0, + impliedFormat: sourceFile.impliedNodeFormat + }); + } + return { + fileInfos, + referencedMap, + exportedModulesMap, + useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState + }; + } + BuilderState2.create = create2; + function releaseCache(state) { + state.allFilesExcludingDefaultLibraryFile = void 0; + state.allFileNames = void 0; + } + BuilderState2.releaseCache = releaseCache; + function getFilesAffectedBy(state, programOfThisState, path2, cancellationToken, computeHash, getCanonicalFileName) { + var _a2, _b; + var result2 = getFilesAffectedByWithOldState(state, programOfThisState, path2, cancellationToken, computeHash, getCanonicalFileName); + (_a2 = state.oldSignatures) === null || _a2 === void 0 ? void 0 : _a2.clear(); + (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear(); + return result2; + } + BuilderState2.getFilesAffectedBy = getFilesAffectedBy; + function getFilesAffectedByWithOldState(state, programOfThisState, path2, cancellationToken, computeHash, getCanonicalFileName) { + var sourceFile = programOfThisState.getSourceFileByPath(path2); + if (!sourceFile) { + return ts2.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName)) { + return [sourceFile]; + } + return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName); + } + BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState; + function updateSignatureOfFile(state, signature, path2) { + state.fileInfos.get(path2).signature = signature; + (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts2.Set())).add(path2); + } + BuilderState2.updateSignatureOfFile = updateSignatureOfFile; + function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName, useFileVersionAsSignature) { + var _a2; + if (useFileVersionAsSignature === void 0) { + useFileVersionAsSignature = state.useFileVersionAsSignature; + } + if ((_a2 = state.hasCalledUpdateShapeSignature) === null || _a2 === void 0 ? void 0 : _a2.has(sourceFile.resolvedPath)) + return false; + var info2 = state.fileInfos.get(sourceFile.resolvedPath); + var prevSignature = info2.signature; + var latestSignature; + if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) { + programOfThisState.emit( + sourceFile, + function(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) { + ts2.Debug.assert(ts2.isDeclarationFileName(fileName), "File extension for signature expected to be dts: Got:: ".concat(fileName)); + latestSignature = ts2.computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data); + if (latestSignature !== prevSignature) { + updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit); + } + }, + cancellationToken, + /*emitOnlyDtsFiles*/ + true, + /*customTransformers*/ + void 0, + /*forceDtsEmit*/ + true + ); + } + if (latestSignature === void 0) { + latestSignature = sourceFile.version; + if (state.exportedModulesMap && latestSignature !== prevSignature) { + (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts2.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); + var references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : void 0; + if (references) { + state.exportedModulesMap.set(sourceFile.resolvedPath, references); + } else { + state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); + } + } + } + (state.oldSignatures || (state.oldSignatures = new ts2.Map())).set(sourceFile.resolvedPath, prevSignature || false); + (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new ts2.Set())).add(sourceFile.resolvedPath); + info2.signature = latestSignature; + return latestSignature !== prevSignature; + } + BuilderState2.updateShapeSignature = updateShapeSignature; + function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) { + if (!state.exportedModulesMap) + return; + (state.oldExportedModulesMap || (state.oldExportedModulesMap = new ts2.Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); + if (!exportedModulesFromDeclarationEmit) { + state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); + return; + } + var exportedModules; + exportedModulesFromDeclarationEmit.forEach(function(symbol) { + return addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)); + }); + if (exportedModules) { + state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); + } else { + state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); + } + function addExportedModule(exportedModulePaths) { + if (exportedModulePaths === null || exportedModulePaths === void 0 ? void 0 : exportedModulePaths.length) { + if (!exportedModules) { + exportedModules = new ts2.Set(); + } + exportedModulePaths.forEach(function(path2) { + return exportedModules.add(path2); + }); + } + } + } + BuilderState2.updateExportedModules = updateExportedModules; + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (ts2.outFile(compilerOptions)) { + return getAllFileNames(state, programOfThisState); + } + if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) { + return getAllFileNames(state, programOfThisState); + } + var seenMap = new ts2.Set(); + var queue3 = [sourceFile.resolvedPath]; + while (queue3.length) { + var path2 = queue3.pop(); + if (!seenMap.has(path2)) { + seenMap.add(path2); + var references = state.referencedMap.getValues(path2); + if (references) { + var iterator = references.keys(); + for (var iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { + queue3.push(iterResult.value); + } + } + } + } + return ts2.arrayFrom(ts2.mapDefinedIterator(seenMap.keys(), function(path3) { + var _a2, _b; + return (_b = (_a2 = programOfThisState.getSourceFileByPath(path3)) === null || _a2 === void 0 ? void 0 : _a2.fileName) !== null && _b !== void 0 ? _b : path3; + })); + } + BuilderState2.getAllDependencies = getAllDependencies; + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts2.emptyArray ? ts2.emptyArray : sourceFiles.map(function(file) { + return file.fileName; + }); + } + return state.allFileNames; + } + function getReferencedByPaths(state, referencedFilePath) { + var keys2 = state.referencedMap.getKeys(referencedFilePath); + return keys2 ? ts2.arrayFrom(keys2.keys()) : []; + } + BuilderState2.getReferencedByPaths = getReferencedByPaths; + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a2 = sourceFile.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (!ts2.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + function containsGlobalScopeAugmentation(sourceFile) { + return ts2.some(sourceFile.moduleAugmentations, function(augmentation) { + return ts2.isGlobalScopeAugmentation(augmentation.parent); + }); + } + function isFileAffectingGlobalScope(sourceFile) { + return containsGlobalScopeAugmentation(sourceFile) || !ts2.isExternalOrCommonJsModule(sourceFile) && !ts2.isJsonSourceFile(sourceFile) && !containsOnlyAmbientModules(sourceFile); + } + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result2; + if (firstSourceFile) + addSourceFile(firstSourceFile); + for (var _i = 0, _a2 = programOfThisState.getSourceFiles(); _i < _a2.length; _i++) { + var sourceFile = _a2[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result2 || ts2.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile2) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile2)) { + (result2 || (result2 = [])).push(sourceFile2); + } + } + } + BuilderState2.getAllFilesExcludingDefaultLibraryFile = getAllFilesExcludingDefaultLibraryFile; + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && ts2.outFile(compilerOptions)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash, getCanonicalFileName) { + if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || ts2.outFile(compilerOptions))) { + return [sourceFileWithUpdatedShape]; + } + var seenFileNamesMap = new ts2.Map(); + seenFileNamesMap.set(sourceFileWithUpdatedShape.resolvedPath, sourceFileWithUpdatedShape); + var queue3 = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); + while (queue3.length > 0) { + var currentPath = queue3.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash, getCanonicalFileName)) { + queue3.push.apply(queue3, getReferencedByPaths(state, currentSourceFile.resolvedPath)); + } + } + } + return ts2.arrayFrom(ts2.mapDefinedIterator(seenFileNamesMap.values(), function(value2) { + return value2; + })); + } + })(BuilderState = ts2.BuilderState || (ts2.BuilderState = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var BuilderFileEmit; + (function(BuilderFileEmit2) { + BuilderFileEmit2[BuilderFileEmit2["DtsOnly"] = 0] = "DtsOnly"; + BuilderFileEmit2[BuilderFileEmit2["Full"] = 1] = "Full"; + })(BuilderFileEmit = ts2.BuilderFileEmit || (ts2.BuilderFileEmit = {})); + function hasSameKeys(map1, map22) { + return map1 === map22 || map1 !== void 0 && map22 !== void 0 && map1.size === map22.size && !ts2.forEachKey(map1, function(key) { + return !map22.has(key); + }); + } + function createBuilderProgramState(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) { + var _a2, _b; + var state = ts2.BuilderState.create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature); + state.program = newProgram; + var compilerOptions = newProgram.getCompilerOptions(); + state.compilerOptions = compilerOptions; + var outFilePath = ts2.outFile(compilerOptions); + if (!outFilePath) { + state.semanticDiagnosticsPerFile = new ts2.Map(); + } else if (compilerOptions.composite && (oldState === null || oldState === void 0 ? void 0 : oldState.outSignature) && outFilePath === ts2.outFile(oldState === null || oldState === void 0 ? void 0 : oldState.compilerOptions)) { + state.outSignature = oldState === null || oldState === void 0 ? void 0 : oldState.outSignature; + } + state.changedFilesSet = new ts2.Set(); + state.latestChangedDtsFile = compilerOptions.composite ? oldState === null || oldState === void 0 ? void 0 : oldState.latestChangedDtsFile : void 0; + var useOldState = ts2.BuilderState.canReuseOldState(state.referencedMap, oldState); + var oldCompilerOptions = useOldState ? oldState.compilerOptions : void 0; + var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile && !ts2.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions); + var canCopyEmitSignatures = compilerOptions.composite && (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) && !outFilePath && !ts2.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions); + if (useOldState) { + (_a2 = oldState.changedFilesSet) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(value2) { + return state.changedFilesSet.add(value2); + }); + if (!outFilePath && oldState.affectedFilesPendingEmit) { + state.affectedFilesPendingEmit = oldState.affectedFilesPendingEmit.slice(); + state.affectedFilesPendingEmitKind = oldState.affectedFilesPendingEmitKind && new ts2.Map(oldState.affectedFilesPendingEmitKind); + state.affectedFilesPendingEmitIndex = oldState.affectedFilesPendingEmitIndex; + state.seenAffectedFiles = new ts2.Set(); + } + } + var referencedMap = state.referencedMap; + var oldReferencedMap = useOldState ? oldState.referencedMap : void 0; + var copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck; + var copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck; + state.fileInfos.forEach(function(info2, sourceFilePath) { + var oldInfo; + var newReferences; + if (!useOldState || // File wasn't present in old state + !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || // versions dont match + oldInfo.version !== info2.version || // Implied formats dont match + oldInfo.impliedFormat !== info2.impliedFormat || // Referenced files changed + !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program + newReferences && ts2.forEachKey(newReferences, function(path2) { + return !state.fileInfos.has(path2) && oldState.fileInfos.has(path2); + })) { + state.changedFilesSet.add(sourceFilePath); + } else if (canCopySemanticDiagnostics) { + var sourceFile = newProgram.getSourceFileByPath(sourceFilePath); + if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) + return; + if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) + return; + var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath); + if (diagnostics) { + state.semanticDiagnosticsPerFile.set(sourceFilePath, oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) : diagnostics); + if (!state.semanticDiagnosticsFromOldState) { + state.semanticDiagnosticsFromOldState = new ts2.Set(); + } + state.semanticDiagnosticsFromOldState.add(sourceFilePath); + } + } + if (canCopyEmitSignatures) { + var oldEmitSignature = oldState.emitSignatures.get(sourceFilePath); + if (oldEmitSignature) + (state.emitSignatures || (state.emitSignatures = new ts2.Map())).set(sourceFilePath, oldEmitSignature); + } + }); + if (useOldState && ts2.forEachEntry(oldState.fileInfos, function(info2, sourceFilePath) { + return info2.affectsGlobalScope && !state.fileInfos.has(sourceFilePath); + })) { + ts2.BuilderState.getAllFilesExcludingDefaultLibraryFile( + state, + newProgram, + /*firstSourceFile*/ + void 0 + ).forEach(function(file) { + return state.changedFilesSet.add(file.resolvedPath); + }); + } else if (oldCompilerOptions && !outFilePath && ts2.compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions)) { + newProgram.getSourceFiles().forEach(function(f8) { + return addToAffectedFilesPendingEmit( + state, + f8.resolvedPath, + 1 + /* BuilderFileEmit.Full */ + ); + }); + ts2.Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || new ts2.Set(); + } + state.buildInfoEmitPending = !useOldState || state.changedFilesSet.size !== (((_b = oldState.changedFilesSet) === null || _b === void 0 ? void 0 : _b.size) || 0); + return state; + } + function convertToDiagnostics(diagnostics, newProgram, getCanonicalFileName) { + if (!diagnostics.length) + return ts2.emptyArray; + var buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(ts2.getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory())); + return diagnostics.map(function(diagnostic) { + var result2 = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath2); + result2.reportsUnnecessary = diagnostic.reportsUnnecessary; + result2.reportsDeprecated = diagnostic.reportDeprecated; + result2.source = diagnostic.source; + result2.skippedOn = diagnostic.skippedOn; + var relatedInformation = diagnostic.relatedInformation; + result2.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function(r8) { + return convertToDiagnosticRelatedInformation(r8, newProgram, toPath2); + }) : [] : void 0; + return result2; + }); + function toPath2(path2) { + return ts2.toPath(path2, buildInfoDirectory, getCanonicalFileName); + } + } + function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath2) { + var file = diagnostic.file; + return __assign16(__assign16({}, diagnostic), { file: file ? newProgram.getSourceFileByPath(toPath2(file)) : void 0 }); + } + function releaseCache(state) { + ts2.BuilderState.releaseCache(state); + state.program = void 0; + } + function backupBuilderProgramEmitState(state) { + var outFilePath = ts2.outFile(state.compilerOptions); + ts2.Debug.assert(!state.changedFilesSet.size || outFilePath); + return { + affectedFilesPendingEmit: state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice(), + affectedFilesPendingEmitKind: state.affectedFilesPendingEmitKind && new ts2.Map(state.affectedFilesPendingEmitKind), + affectedFilesPendingEmitIndex: state.affectedFilesPendingEmitIndex, + seenEmittedFiles: state.seenEmittedFiles && new ts2.Map(state.seenEmittedFiles), + programEmitComplete: state.programEmitComplete, + emitSignatures: state.emitSignatures && new ts2.Map(state.emitSignatures), + outSignature: state.outSignature, + latestChangedDtsFile: state.latestChangedDtsFile, + hasChangedEmitSignature: state.hasChangedEmitSignature, + changedFilesSet: outFilePath ? new ts2.Set(state.changedFilesSet) : void 0 + }; + } + function restoreBuilderProgramEmitState(state, savedEmitState) { + state.affectedFilesPendingEmit = savedEmitState.affectedFilesPendingEmit; + state.affectedFilesPendingEmitKind = savedEmitState.affectedFilesPendingEmitKind; + state.affectedFilesPendingEmitIndex = savedEmitState.affectedFilesPendingEmitIndex; + state.seenEmittedFiles = savedEmitState.seenEmittedFiles; + state.programEmitComplete = savedEmitState.programEmitComplete; + state.emitSignatures = savedEmitState.emitSignatures; + state.outSignature = savedEmitState.outSignature; + state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile; + state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature; + if (savedEmitState.changedFilesSet) + state.changedFilesSet = savedEmitState.changedFilesSet; + } + function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { + ts2.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath)); + } + function getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host) { + var _a2, _b; + while (true) { + var affectedFiles = state.affectedFiles; + if (affectedFiles) { + var seenAffectedFiles = state.seenAffectedFiles; + var affectedFilesIndex = state.affectedFilesIndex; + while (affectedFilesIndex < affectedFiles.length) { + var affectedFile = affectedFiles[affectedFilesIndex]; + if (!seenAffectedFiles.has(affectedFile.resolvedPath)) { + state.affectedFilesIndex = affectedFilesIndex; + handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host); + return affectedFile; + } + affectedFilesIndex++; + } + state.changedFilesSet.delete(state.currentChangedFilePath); + state.currentChangedFilePath = void 0; + (_a2 = state.oldSignatures) === null || _a2 === void 0 ? void 0 : _a2.clear(); + (_b = state.oldExportedModulesMap) === null || _b === void 0 ? void 0 : _b.clear(); + state.affectedFiles = void 0; + } + var nextKey = state.changedFilesSet.keys().next(); + if (nextKey.done) { + return void 0; + } + var program = ts2.Debug.checkDefined(state.program); + var compilerOptions = program.getCompilerOptions(); + if (ts2.outFile(compilerOptions)) { + ts2.Debug.assert(!state.semanticDiagnosticsPerFile); + return program; + } + state.affectedFiles = ts2.BuilderState.getFilesAffectedByWithOldState(state, program, nextKey.value, cancellationToken, computeHash, getCanonicalFileName); + state.currentChangedFilePath = nextKey.value; + state.affectedFilesIndex = 0; + if (!state.seenAffectedFiles) + state.seenAffectedFiles = new ts2.Set(); + } + } + function clearAffectedFilesPendingEmit(state) { + state.affectedFilesPendingEmit = void 0; + state.affectedFilesPendingEmitKind = void 0; + state.affectedFilesPendingEmitIndex = void 0; + } + function getNextAffectedFilePendingEmit(state) { + var affectedFilesPendingEmit = state.affectedFilesPendingEmit; + if (affectedFilesPendingEmit) { + var seenEmittedFiles = state.seenEmittedFiles || (state.seenEmittedFiles = new ts2.Map()); + for (var i7 = state.affectedFilesPendingEmitIndex; i7 < affectedFilesPendingEmit.length; i7++) { + var affectedFile = ts2.Debug.checkDefined(state.program).getSourceFileByPath(affectedFilesPendingEmit[i7]); + if (affectedFile) { + var seenKind = seenEmittedFiles.get(affectedFile.resolvedPath); + var emitKind = ts2.Debug.checkDefined(ts2.Debug.checkDefined(state.affectedFilesPendingEmitKind).get(affectedFile.resolvedPath)); + if (seenKind === void 0 || seenKind < emitKind) { + state.affectedFilesPendingEmitIndex = i7; + return { affectedFile, emitKind }; + } + } + } + clearAffectedFilesPendingEmit(state); + } + return void 0; + } + function removeDiagnosticsOfLibraryFiles(state) { + if (!state.cleanedDiagnosticsOfLibFiles) { + state.cleanedDiagnosticsOfLibFiles = true; + var program_1 = ts2.Debug.checkDefined(state.program); + var options_2 = program_1.getCompilerOptions(); + ts2.forEach(program_1.getSourceFiles(), function(f8) { + return program_1.isSourceFileDefaultLibrary(f8) && !ts2.skipTypeChecking(f8, options_2, program_1) && removeSemanticDiagnosticsOf(state, f8.resolvedPath); + }); + } + } + function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) { + removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath); + if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { + removeDiagnosticsOfLibraryFiles(state); + ts2.BuilderState.updateShapeSignature(state, ts2.Debug.checkDefined(state.program), affectedFile, cancellationToken, computeHash, getCanonicalFileName); + return; + } + if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) + return; + handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host); + } + function handleDtsMayChangeOf(state, path2, cancellationToken, computeHash, getCanonicalFileName, host) { + removeSemanticDiagnosticsOf(state, path2); + if (!state.changedFilesSet.has(path2)) { + var program = ts2.Debug.checkDefined(state.program); + var sourceFile = program.getSourceFileByPath(path2); + if (sourceFile) { + ts2.BuilderState.updateShapeSignature(state, program, sourceFile, cancellationToken, computeHash, getCanonicalFileName, !host.disableUseFileVersionAsSignature); + if (ts2.getEmitDeclarations(state.compilerOptions)) { + addToAffectedFilesPendingEmit( + state, + path2, + 0 + /* BuilderFileEmit.DtsOnly */ + ); + } + } + } + } + function removeSemanticDiagnosticsOf(state, path2) { + if (!state.semanticDiagnosticsFromOldState) { + return true; + } + state.semanticDiagnosticsFromOldState.delete(path2); + state.semanticDiagnosticsPerFile.delete(path2); + return !state.semanticDiagnosticsFromOldState.size; + } + function isChangedSignature(state, path2) { + var oldSignature = ts2.Debug.checkDefined(state.oldSignatures).get(path2) || void 0; + var newSignature = ts2.Debug.checkDefined(state.fileInfos.get(path2)).signature; + return newSignature !== oldSignature; + } + function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host) { + var _a2; + if (!((_a2 = state.fileInfos.get(filePath)) === null || _a2 === void 0 ? void 0 : _a2.affectsGlobalScope)) + return false; + ts2.BuilderState.getAllFilesExcludingDefaultLibraryFile( + state, + state.program, + /*firstSourceFile*/ + void 0 + ).forEach(function(file) { + return handleDtsMayChangeOf(state, file.resolvedPath, cancellationToken, computeHash, getCanonicalFileName, host); + }); + removeDiagnosticsOfLibraryFiles(state); + return true; + } + function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, getCanonicalFileName, host) { + var _a2; + if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) + return; + if (!isChangedSignature(state, affectedFile.resolvedPath)) + return; + if (state.compilerOptions.isolatedModules) { + var seenFileNamesMap = new ts2.Map(); + seenFileNamesMap.set(affectedFile.resolvedPath, true); + var queue3 = ts2.BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); + while (queue3.length > 0) { + var currentPath = queue3.pop(); + if (!seenFileNamesMap.has(currentPath)) { + seenFileNamesMap.set(currentPath, true); + if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host)) + return; + handleDtsMayChangeOf(state, currentPath, cancellationToken, computeHash, getCanonicalFileName, host); + if (isChangedSignature(state, currentPath)) { + var currentSourceFile = ts2.Debug.checkDefined(state.program).getSourceFileByPath(currentPath); + queue3.push.apply(queue3, ts2.BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); + } + } + } + } + var seenFileAndExportsOfFile = new ts2.Set(); + (_a2 = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(exportedFromPath) { + if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, computeHash, getCanonicalFileName, host)) + return true; + var references = state.referencedMap.getKeys(exportedFromPath); + return references && ts2.forEachKey(references, function(filePath) { + return handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host); + }); + }); + } + function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host) { + var _a2, _b; + if (!ts2.tryAddToSet(seenFileAndExportsOfFile, filePath)) + return void 0; + if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host)) + return true; + handleDtsMayChangeOf(state, filePath, cancellationToken, computeHash, getCanonicalFileName, host); + (_a2 = state.exportedModulesMap.getKeys(filePath)) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(exportedFromPath) { + return handleDtsMayChangeOfFileAndExportsOfFile(state, exportedFromPath, seenFileAndExportsOfFile, cancellationToken, computeHash, getCanonicalFileName, host); + }); + (_b = state.referencedMap.getKeys(filePath)) === null || _b === void 0 ? void 0 : _b.forEach(function(referencingFilePath) { + return !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file + handleDtsMayChangeOf( + // Dont add to seen since this is not yet done with the export removal + state, + referencingFilePath, + cancellationToken, + computeHash, + getCanonicalFileName, + host + ); + }); + return void 0; + } + function doneWithAffectedFile(state, affected, emitKind, isPendingEmit, isBuildInfoEmit) { + if (isBuildInfoEmit) { + state.buildInfoEmitPending = false; + } else if (affected === state.program) { + state.changedFilesSet.clear(); + state.programEmitComplete = true; + } else { + state.seenAffectedFiles.add(affected.resolvedPath); + state.buildInfoEmitPending = true; + if (emitKind !== void 0) { + (state.seenEmittedFiles || (state.seenEmittedFiles = new ts2.Map())).set(affected.resolvedPath, emitKind); + } + if (isPendingEmit) { + state.affectedFilesPendingEmitIndex++; + } else { + state.affectedFilesIndex++; + } + } + } + function toAffectedFileResult(state, result2, affected) { + doneWithAffectedFile(state, affected); + return { result: result2, affected }; + } + function toAffectedFileEmitResult(state, result2, affected, emitKind, isPendingEmit, isBuildInfoEmit) { + doneWithAffectedFile(state, affected, emitKind, isPendingEmit, isBuildInfoEmit); + return { result: result2, affected }; + } + function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { + return ts2.concatenate(getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken), ts2.Debug.checkDefined(state.program).getProgramDiagnostics(sourceFile)); + } + function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken) { + var path2 = sourceFile.resolvedPath; + if (state.semanticDiagnosticsPerFile) { + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path2); + if (cachedDiagnostics) { + return ts2.filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions); + } + } + var diagnostics = ts2.Debug.checkDefined(state.program).getBindAndCheckDiagnostics(sourceFile, cancellationToken); + if (state.semanticDiagnosticsPerFile) { + state.semanticDiagnosticsPerFile.set(path2, diagnostics); + } + return ts2.filterSemanticDiagnostics(diagnostics, state.compilerOptions); + } + function isProgramBundleEmitBuildInfo(info2) { + return !!ts2.outFile(info2.options || {}); + } + ts2.isProgramBundleEmitBuildInfo = isProgramBundleEmitBuildInfo; + function getProgramBuildInfo(state, getCanonicalFileName) { + var outFilePath = ts2.outFile(state.compilerOptions); + if (outFilePath && !state.compilerOptions.composite) + return; + var currentDirectory = ts2.Debug.checkDefined(state.program).getCurrentDirectory(); + var buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(ts2.getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory)); + var latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; + if (outFilePath) { + var fileNames_1 = []; + var fileInfos_1 = []; + state.program.getRootFileNames().forEach(function(f8) { + var sourceFile = state.program.getSourceFile(f8); + if (!sourceFile) + return; + fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath)); + fileInfos_1.push(sourceFile.version); + }); + var result_15 = { + fileNames: fileNames_1, + fileInfos: fileInfos_1, + options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"), + outSignature: state.outSignature, + latestChangedDtsFile + }; + return result_15; + } + var fileNames = []; + var fileNameToFileId = new ts2.Map(); + var fileIdsList; + var fileNamesToFileIdListId; + var emitSignatures; + var fileInfos = ts2.arrayFrom(state.fileInfos.entries(), function(_a3) { + var _b2, _c2; + var key2 = _a3[0], value3 = _a3[1]; + var fileId = toFileId(key2); + ts2.Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key2)); + var oldSignature = (_b2 = state.oldSignatures) === null || _b2 === void 0 ? void 0 : _b2.get(key2); + var actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value3.signature; + if (state.compilerOptions.composite) { + var file = state.program.getSourceFileByPath(key2); + if (!ts2.isJsonSourceFile(file) && ts2.sourceFileMayBeEmitted(file, state.program)) { + var emitSignature = (_c2 = state.emitSignatures) === null || _c2 === void 0 ? void 0 : _c2.get(key2); + if (emitSignature !== actualSignature) { + (emitSignatures || (emitSignatures = [])).push(emitSignature === void 0 ? fileId : [fileId, emitSignature]); + } + } + } + return value3.version === actualSignature ? value3.affectsGlobalScope || value3.impliedFormat ? ( + // If file version is same as signature, dont serialize signature + { version: value3.version, signature: void 0, affectsGlobalScope: value3.affectsGlobalScope, impliedFormat: value3.impliedFormat } + ) : ( + // If file info only contains version and signature and both are same we can just write string + value3.version + ) : actualSignature !== void 0 ? ( + // If signature is not same as version, encode signature in the fileInfo + oldSignature === void 0 ? ( + // If we havent computed signature, use fileInfo as is + value3 + ) : ( + // Serialize fileInfo with new updated signature + { version: value3.version, signature: actualSignature, affectsGlobalScope: value3.affectsGlobalScope, impliedFormat: value3.impliedFormat } + ) + ) : ( + // Signature of the FileInfo is undefined, serialize it as false + { version: value3.version, signature: false, affectsGlobalScope: value3.affectsGlobalScope, impliedFormat: value3.impliedFormat } + ); + }); + var referencedMap; + if (state.referencedMap) { + referencedMap = ts2.arrayFrom(state.referencedMap.keys()).sort(ts2.compareStringsCaseSensitive).map(function(key2) { + return [ + toFileId(key2), + toFileIdListId(state.referencedMap.getValues(key2)) + ]; + }); + } + var exportedModulesMap; + if (state.exportedModulesMap) { + exportedModulesMap = ts2.mapDefined(ts2.arrayFrom(state.exportedModulesMap.keys()).sort(ts2.compareStringsCaseSensitive), function(key2) { + var _a3; + var oldValue = (_a3 = state.oldExportedModulesMap) === null || _a3 === void 0 ? void 0 : _a3.get(key2); + if (oldValue === void 0) + return [toFileId(key2), toFileIdListId(state.exportedModulesMap.getValues(key2))]; + if (oldValue) + return [toFileId(key2), toFileIdListId(oldValue)]; + return void 0; + }); + } + var semanticDiagnosticsPerFile; + if (state.semanticDiagnosticsPerFile) { + for (var _i = 0, _a2 = ts2.arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(ts2.compareStringsCaseSensitive); _i < _a2.length; _i++) { + var key = _a2[_i]; + var value2 = state.semanticDiagnosticsPerFile.get(key); + (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(value2.length ? [ + toFileId(key), + convertToReusableDiagnostics(value2, relativeToBuildInfo) + ] : toFileId(key)); + } + } + var affectedFilesPendingEmit; + if (state.affectedFilesPendingEmit) { + var seenFiles = new ts2.Set(); + for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts2.compareStringsCaseSensitive); _b < _c.length; _b++) { + var path2 = _c[_b]; + if (ts2.tryAddToSet(seenFiles, path2)) { + (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path2), state.affectedFilesPendingEmitKind.get(path2)]); + } + } + } + var changeFileSet; + if (state.changedFilesSet.size) { + for (var _d = 0, _e2 = ts2.arrayFrom(state.changedFilesSet.keys()).sort(ts2.compareStringsCaseSensitive); _d < _e2.length; _d++) { + var path2 = _e2[_d]; + (changeFileSet || (changeFileSet = [])).push(toFileId(path2)); + } + } + var result2 = { + fileNames, + fileInfos, + options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsMultiFileEmitBuildInfo"), + fileIdsList, + referencedMap, + exportedModulesMap, + semanticDiagnosticsPerFile, + affectedFilesPendingEmit, + changeFileSet, + emitSignatures, + latestChangedDtsFile + }; + return result2; + function relativeToBuildInfoEnsuringAbsolutePath(path3) { + return relativeToBuildInfo(ts2.getNormalizedAbsolutePath(path3, currentDirectory)); + } + function relativeToBuildInfo(path3) { + return ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(buildInfoDirectory, path3, getCanonicalFileName)); + } + function toFileId(path3) { + var fileId = fileNameToFileId.get(path3); + if (fileId === void 0) { + fileNames.push(relativeToBuildInfo(path3)); + fileNameToFileId.set(path3, fileId = fileNames.length); + } + return fileId; + } + function toFileIdListId(set4) { + var fileIds = ts2.arrayFrom(set4.keys(), toFileId).sort(ts2.compareValues); + var key2 = fileIds.join(); + var fileIdListId = fileNamesToFileIdListId === null || fileNamesToFileIdListId === void 0 ? void 0 : fileNamesToFileIdListId.get(key2); + if (fileIdListId === void 0) { + (fileIdsList || (fileIdsList = [])).push(fileIds); + (fileNamesToFileIdListId || (fileNamesToFileIdListId = new ts2.Map())).set(key2, fileIdListId = fileIdsList.length); + } + return fileIdListId; + } + function convertToProgramBuildInfoCompilerOptions(options, optionKey) { + var result3; + var optionsNameMap = ts2.getOptionsNameMap().optionsNameMap; + for (var _i2 = 0, _a3 = ts2.getOwnKeys(options).sort(ts2.compareStringsCaseSensitive); _i2 < _a3.length; _i2++) { + var name2 = _a3[_i2]; + var optionInfo = optionsNameMap.get(name2.toLowerCase()); + if (optionInfo === null || optionInfo === void 0 ? void 0 : optionInfo[optionKey]) { + (result3 || (result3 = {}))[name2] = convertToReusableCompilerOptionValue(optionInfo, options[name2], relativeToBuildInfoEnsuringAbsolutePath); + } + } + return result3; + } + } + function convertToReusableCompilerOptionValue(option, value2, relativeToBuildInfo) { + if (option) { + if (option.type === "list") { + var values2 = value2; + if (option.element.isFilePath && values2.length) { + return values2.map(relativeToBuildInfo); + } + } else if (option.isFilePath) { + return relativeToBuildInfo(value2); + } + } + return value2; + } + function convertToReusableDiagnostics(diagnostics, relativeToBuildInfo) { + ts2.Debug.assert(!!diagnostics.length); + return diagnostics.map(function(diagnostic) { + var result2 = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo); + result2.reportsUnnecessary = diagnostic.reportsUnnecessary; + result2.reportDeprecated = diagnostic.reportsDeprecated; + result2.source = diagnostic.source; + result2.skippedOn = diagnostic.skippedOn; + var relatedInformation = diagnostic.relatedInformation; + result2.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map(function(r8) { + return convertToReusableDiagnosticRelatedInformation(r8, relativeToBuildInfo); + }) : [] : void 0; + return result2; + }); + } + function convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo) { + var file = diagnostic.file; + return __assign16(__assign16({}, diagnostic), { file: file ? relativeToBuildInfo(file.resolvedPath) : void 0 }); + } + var BuilderProgramKind; + (function(BuilderProgramKind2) { + BuilderProgramKind2[BuilderProgramKind2["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; + BuilderProgramKind2[BuilderProgramKind2["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; + })(BuilderProgramKind = ts2.BuilderProgramKind || (ts2.BuilderProgramKind = {})); + function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + var host; + var newProgram; + var oldProgram; + if (newProgramOrRootNames === void 0) { + ts2.Debug.assert(hostOrOptions === void 0); + host = oldProgramOrHost; + oldProgram = configFileParsingDiagnosticsOrOldProgram; + ts2.Debug.assert(!!oldProgram); + newProgram = oldProgram.getProgram(); + } else if (ts2.isArray(newProgramOrRootNames)) { + oldProgram = configFileParsingDiagnosticsOrOldProgram; + newProgram = ts2.createProgram({ + rootNames: newProgramOrRootNames, + options: hostOrOptions, + host: oldProgramOrHost, + oldProgram: oldProgram && oldProgram.getProgramOrUndefined(), + configFileParsingDiagnostics, + projectReferences + }); + host = oldProgramOrHost; + } else { + newProgram = newProgramOrRootNames; + host = hostOrOptions; + oldProgram = oldProgramOrHost; + configFileParsingDiagnostics = configFileParsingDiagnosticsOrOldProgram; + } + return { host, newProgram, oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || ts2.emptyArray }; + } + ts2.getBuilderCreationParameters = getBuilderCreationParameters; + function getTextHandlingSourceMapForSignature(text, data) { + return (data === null || data === void 0 ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text; + } + function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data) { + var _a2; + text = getTextHandlingSourceMapForSignature(text, data); + var sourceFileDirectory; + if ((_a2 = data === null || data === void 0 ? void 0 : data.diagnostics) === null || _a2 === void 0 ? void 0 : _a2.length) { + text += data.diagnostics.map(function(diagnostic) { + return "".concat(locationInfo(diagnostic)).concat(ts2.DiagnosticCategory[diagnostic.category]).concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText)); + }).join("\n"); + } + return (computeHash !== null && computeHash !== void 0 ? computeHash : ts2.generateDjb2Hash)(text); + function flattenDiagnosticMessageText(diagnostic) { + return ts2.isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText).join("\n"); + } + function locationInfo(diagnostic) { + if (diagnostic.file.resolvedPath === sourceFile.resolvedPath) + return "(".concat(diagnostic.start, ",").concat(diagnostic.length, ")"); + if (sourceFileDirectory === void 0) + sourceFileDirectory = ts2.getDirectoryPath(sourceFile.resolvedPath); + return "".concat(ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(sourceFileDirectory, diagnostic.file.resolvedPath, getCanonicalFileName)), "(").concat(diagnostic.start, ",").concat(diagnostic.length, ")"); + } + } + ts2.computeSignatureWithDiagnostics = computeSignatureWithDiagnostics; + function computeSignature(text, computeHash, data) { + return (computeHash !== null && computeHash !== void 0 ? computeHash : ts2.generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data)); + } + ts2.computeSignature = computeSignature; + function createBuilderProgram(kind, _a2) { + var newProgram = _a2.newProgram, host = _a2.host, oldProgram = _a2.oldProgram, configFileParsingDiagnostics = _a2.configFileParsingDiagnostics; + var oldState = oldProgram && oldProgram.getState(); + if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) { + newProgram = void 0; + oldState = void 0; + return oldProgram; + } + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var computeHash = ts2.maybeBind(host, host.createHash); + var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature); + newProgram.getProgramBuildInfo = function() { + return getProgramBuildInfo(state, getCanonicalFileName); + }; + newProgram = void 0; + oldProgram = void 0; + oldState = void 0; + var getState = function() { + return state; + }; + var builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics); + builderProgram.getState = getState; + builderProgram.saveEmitState = function() { + return backupBuilderProgramEmitState(state); + }; + builderProgram.restoreEmitState = function(saved) { + return restoreBuilderProgramEmitState(state, saved); + }; + builderProgram.hasChangedEmitSignature = function() { + return !!state.hasChangedEmitSignature; + }; + builderProgram.getAllDependencies = function(sourceFile) { + return ts2.BuilderState.getAllDependencies(state, ts2.Debug.checkDefined(state.program), sourceFile); + }; + builderProgram.getSemanticDiagnostics = getSemanticDiagnostics; + builderProgram.emit = emit3; + builderProgram.releaseProgram = function() { + return releaseCache(state); + }; + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + } else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + builderProgram.emitNextAffectedFile = emitNextAffectedFile; + builderProgram.emitBuildInfo = emitBuildInfo; + } else { + ts2.notImplemented(); + } + return builderProgram; + function emitBuildInfo(writeFile2, cancellationToken) { + if (state.buildInfoEmitPending) { + var result2 = ts2.Debug.checkDefined(state.program).emitBuildInfo(writeFile2 || ts2.maybeBind(host, host.writeFile), cancellationToken); + state.buildInfoEmitPending = false; + return result2; + } + return ts2.emitSkippedWithNoDiagnostics; + } + function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host); + var emitKind = 1; + var isPendingEmitFile = false; + if (!affected) { + if (!ts2.outFile(state.compilerOptions)) { + var pendingAffectedFile = getNextAffectedFilePendingEmit(state); + if (!pendingAffectedFile) { + if (!state.buildInfoEmitPending) { + return void 0; + } + var affected_1 = ts2.Debug.checkDefined(state.program); + return toAffectedFileEmitResult( + state, + // When whole program is affected, do emit only once (eg when --out or --outFile is specified) + // Otherwise just affected file + affected_1.emitBuildInfo(writeFile2 || ts2.maybeBind(host, host.writeFile), cancellationToken), + affected_1, + 1, + /*isPendingEmitFile*/ + false, + /*isBuildInfoEmit*/ + true + ); + } + affected = pendingAffectedFile.affectedFile, emitKind = pendingAffectedFile.emitKind; + isPendingEmitFile = true; + } else { + var program = ts2.Debug.checkDefined(state.program); + if (state.programEmitComplete) + return void 0; + affected = program; + } + } + return toAffectedFileEmitResult( + state, + // When whole program is affected, do emit only once (eg when --out or --outFile is specified) + // Otherwise just affected file + ts2.Debug.checkDefined(state.program).emit(affected === state.program ? void 0 : affected, ts2.getEmitDeclarations(state.compilerOptions) ? getWriteFileCallback(writeFile2, customTransformers) : writeFile2 || ts2.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles || emitKind === 0, customTransformers), + affected, + emitKind, + isPendingEmitFile + ); + } + function getWriteFileCallback(writeFile2, customTransformers) { + return function(fileName, text, writeByteOrderMark, onError, sourceFiles, data) { + var _a3, _b, _c, _d, _e2, _f, _g; + if (ts2.isDeclarationFileName(fileName)) { + if (!ts2.outFile(state.compilerOptions)) { + ts2.Debug.assert((sourceFiles === null || sourceFiles === void 0 ? void 0 : sourceFiles.length) === 1); + var emitSignature = void 0; + if (!customTransformers) { + var file = sourceFiles[0]; + var info2 = state.fileInfos.get(file.resolvedPath); + if (info2.signature === file.version) { + var signature = computeSignatureWithDiagnostics(file, text, computeHash, getCanonicalFileName, data); + if (!((_a3 = data === null || data === void 0 ? void 0 : data.diagnostics) === null || _a3 === void 0 ? void 0 : _a3.length)) + emitSignature = signature; + if (signature !== file.version) { + if (host.storeFilesChangingSignatureDuringEmit) + ((_b = state.filesChangingSignature) !== null && _b !== void 0 ? _b : state.filesChangingSignature = new ts2.Set()).add(file.resolvedPath); + if (state.exportedModulesMap) + ts2.BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit); + if (state.affectedFiles) { + var existing = (_c = state.oldSignatures) === null || _c === void 0 ? void 0 : _c.get(file.resolvedPath); + if (existing === void 0) + ((_d = state.oldSignatures) !== null && _d !== void 0 ? _d : state.oldSignatures = new ts2.Map()).set(file.resolvedPath, info2.signature || false); + info2.signature = signature; + } else { + info2.signature = signature; + (_e2 = state.oldExportedModulesMap) === null || _e2 === void 0 ? void 0 : _e2.clear(); + } + } + } + } + if (state.compilerOptions.composite) { + var filePath = sourceFiles[0].resolvedPath; + var oldSignature = (_f = state.emitSignatures) === null || _f === void 0 ? void 0 : _f.get(filePath); + emitSignature !== null && emitSignature !== void 0 ? emitSignature : emitSignature = computeSignature(text, computeHash, data); + if (emitSignature === oldSignature) + return; + ((_g = state.emitSignatures) !== null && _g !== void 0 ? _g : state.emitSignatures = new ts2.Map()).set(filePath, emitSignature); + state.hasChangedEmitSignature = true; + state.latestChangedDtsFile = fileName; + } + } else if (state.compilerOptions.composite) { + var newSignature = computeSignature(text, computeHash, data); + if (newSignature === state.outSignature) + return; + state.outSignature = newSignature; + state.hasChangedEmitSignature = true; + state.latestChangedDtsFile = fileName; + } + } + if (writeFile2) + writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else if (host.writeFile) + host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else + state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + }; + } + function emit3(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var _a3; + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); + } + var result2 = ts2.handleNoEmitOptions(builderProgram, targetSourceFile, writeFile2, cancellationToken); + if (result2) + return result2; + if (!targetSourceFile) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + var sourceMaps = []; + var emitSkipped = false; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts2.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts2.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts2.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped, + diagnostics: diagnostics || ts2.emptyArray, + emittedFiles, + sourceMaps + }; + } else if ((_a3 = state.affectedFilesPendingEmitKind) === null || _a3 === void 0 ? void 0 : _a3.size) { + ts2.Debug.assert(kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram); + if (!emitOnlyDtsFiles || ts2.every(state.affectedFilesPendingEmit, function(path2, index4) { + return index4 < state.affectedFilesPendingEmitIndex || state.affectedFilesPendingEmitKind.get(path2) === 0; + })) { + clearAffectedFilesPendingEmit(state); + } + } + } + return ts2.Debug.checkDefined(state.program).emit(targetSourceFile, ts2.getEmitDeclarations(state.compilerOptions) ? getWriteFileCallback(writeFile2, customTransformers) : writeFile2 || ts2.maybeBind(host, host.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); + } + function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { + while (true) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash, getCanonicalFileName, host); + if (!affected) { + return void 0; + } else if (affected === state.program) { + return toAffectedFileResult(state, state.program.getSemanticDiagnostics( + /*targetSourceFile*/ + void 0, + cancellationToken + ), affected); + } + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram || state.compilerOptions.noEmit || state.compilerOptions.noEmitOnError) { + addToAffectedFilesPendingEmit( + state, + affected.resolvedPath, + 1 + /* BuilderFileEmit.Full */ + ); + } + if (ignoreSourceFile && ignoreSourceFile(affected)) { + doneWithAffectedFile(state, affected); + continue; + } + return toAffectedFileResult(state, getSemanticDiagnosticsOfFile(state, affected, cancellationToken), affected); + } + } + function getSemanticDiagnostics(sourceFile, cancellationToken) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + var compilerOptions = ts2.Debug.checkDefined(state.program).getCompilerOptions(); + if (ts2.outFile(compilerOptions)) { + ts2.Debug.assert(!state.semanticDiagnosticsPerFile); + return ts2.Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); + } + if (sourceFile) { + return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); + } + while (getSemanticDiagnosticsOfNextAffectedFile(cancellationToken)) { + } + var diagnostics; + for (var _i = 0, _a3 = ts2.Debug.checkDefined(state.program).getSourceFiles(); _i < _a3.length; _i++) { + var sourceFile_1 = _a3[_i]; + diagnostics = ts2.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_1, cancellationToken)); + } + return diagnostics || ts2.emptyArray; + } + } + ts2.createBuilderProgram = createBuilderProgram; + function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) { + if (!state.affectedFilesPendingEmit) + state.affectedFilesPendingEmit = []; + if (!state.affectedFilesPendingEmitKind) + state.affectedFilesPendingEmitKind = new ts2.Map(); + var existingKind = state.affectedFilesPendingEmitKind.get(affectedFilePendingEmit); + state.affectedFilesPendingEmit.push(affectedFilePendingEmit); + state.affectedFilesPendingEmitKind.set(affectedFilePendingEmit, existingKind || kind); + if (state.affectedFilesPendingEmitIndex === void 0) { + state.affectedFilesPendingEmitIndex = 0; + } + } + function toBuilderStateFileInfo(fileInfo) { + return ts2.isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : ts2.isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat }; + } + ts2.toBuilderStateFileInfo = toBuilderStateFileInfo; + function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) { + var _a2, _b, _c, _d; + var buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var state; + var filePaths; + var filePathsSetList; + var latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : void 0; + if (isProgramBundleEmitBuildInfo(program)) { + state = { + fileInfos: new ts2.Map(), + compilerOptions: program.options ? ts2.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {}, + latestChangedDtsFile, + outSignature: program.outSignature + }; + } else { + filePaths = (_a2 = program.fileNames) === null || _a2 === void 0 ? void 0 : _a2.map(toPath2); + filePathsSetList = (_b = program.fileIdsList) === null || _b === void 0 ? void 0 : _b.map(function(fileIds) { + return new ts2.Set(fileIds.map(toFilePath)); + }); + var fileInfos_2 = new ts2.Map(); + var emitSignatures_1 = ((_c = program.options) === null || _c === void 0 ? void 0 : _c.composite) && !ts2.outFile(program.options) ? new ts2.Map() : void 0; + program.fileInfos.forEach(function(fileInfo, index4) { + var path2 = toFilePath(index4 + 1); + var stateFileInfo = toBuilderStateFileInfo(fileInfo); + fileInfos_2.set(path2, stateFileInfo); + if (emitSignatures_1 && stateFileInfo.signature) + emitSignatures_1.set(path2, stateFileInfo.signature); + }); + (_d = program.emitSignatures) === null || _d === void 0 ? void 0 : _d.forEach(function(value2) { + if (ts2.isNumber(value2)) + emitSignatures_1.delete(toFilePath(value2)); + else + emitSignatures_1.set(toFilePath(value2[0]), value2[1]); + }); + state = { + fileInfos: fileInfos_2, + compilerOptions: program.options ? ts2.convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {}, + referencedMap: toManyToManyPathMap(program.referencedMap), + exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap), + semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts2.arrayToMap(program.semanticDiagnosticsPerFile, function(value2) { + return toFilePath(ts2.isNumber(value2) ? value2 : value2[0]); + }, function(value2) { + return ts2.isNumber(value2) ? ts2.emptyArray : value2[1]; + }), + hasReusableDiagnostic: true, + affectedFilesPendingEmit: ts2.map(program.affectedFilesPendingEmit, function(value2) { + return toFilePath(value2[0]); + }), + affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts2.arrayToMap(program.affectedFilesPendingEmit, function(value2) { + return toFilePath(value2[0]); + }, function(value2) { + return value2[1]; + }), + affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0, + changedFilesSet: new ts2.Set(ts2.map(program.changeFileSet, toFilePath)), + latestChangedDtsFile, + emitSignatures: (emitSignatures_1 === null || emitSignatures_1 === void 0 ? void 0 : emitSignatures_1.size) ? emitSignatures_1 : void 0 + }; + } + return { + getState: function() { + return state; + }, + saveEmitState: ts2.noop, + restoreEmitState: ts2.noop, + getProgram: ts2.notImplemented, + getProgramOrUndefined: ts2.returnUndefined, + releaseProgram: ts2.noop, + getCompilerOptions: function() { + return state.compilerOptions; + }, + getSourceFile: ts2.notImplemented, + getSourceFiles: ts2.notImplemented, + getOptionsDiagnostics: ts2.notImplemented, + getGlobalDiagnostics: ts2.notImplemented, + getConfigFileParsingDiagnostics: ts2.notImplemented, + getSyntacticDiagnostics: ts2.notImplemented, + getDeclarationDiagnostics: ts2.notImplemented, + getSemanticDiagnostics: ts2.notImplemented, + emit: ts2.notImplemented, + getAllDependencies: ts2.notImplemented, + getCurrentDirectory: ts2.notImplemented, + emitNextAffectedFile: ts2.notImplemented, + getSemanticDiagnosticsOfNextAffectedFile: ts2.notImplemented, + emitBuildInfo: ts2.notImplemented, + close: ts2.noop, + hasChangedEmitSignature: ts2.returnFalse + }; + function toPath2(path2) { + return ts2.toPath(path2, buildInfoDirectory, getCanonicalFileName); + } + function toAbsolutePath(path2) { + return ts2.getNormalizedAbsolutePath(path2, buildInfoDirectory); + } + function toFilePath(fileId) { + return filePaths[fileId - 1]; + } + function toFilePathsSet(fileIdsListId) { + return filePathsSetList[fileIdsListId - 1]; + } + function toManyToManyPathMap(referenceMap) { + if (!referenceMap) { + return void 0; + } + var map4 = ts2.BuilderState.createManyToManyPathMap(); + referenceMap.forEach(function(_a3) { + var fileId = _a3[0], fileIdListId = _a3[1]; + return map4.set(toFilePath(fileId), toFilePathsSet(fileIdListId)); + }); + return map4; + } + } + ts2.createBuilderProgramUsingProgramBuildInfo = createBuilderProgramUsingProgramBuildInfo; + function getBuildInfoFileVersionMap(program, buildInfoPath, host) { + var buildInfoDirectory = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var fileInfos = new ts2.Map(); + program.fileInfos.forEach(function(fileInfo, index4) { + var path2 = ts2.toPath(program.fileNames[index4], buildInfoDirectory, getCanonicalFileName); + var version5 = ts2.isString(fileInfo) ? fileInfo : fileInfo.version; + fileInfos.set(path2, version5); + }); + return fileInfos; + } + ts2.getBuildInfoFileVersionMap = getBuildInfoFileVersionMap; + function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { + return { + getState: ts2.notImplemented, + saveEmitState: ts2.noop, + restoreEmitState: ts2.noop, + getProgram, + getProgramOrUndefined: function() { + return getState().program; + }, + releaseProgram: function() { + return getState().program = void 0; + }, + getCompilerOptions: function() { + return getState().compilerOptions; + }, + getSourceFile: function(fileName) { + return getProgram().getSourceFile(fileName); + }, + getSourceFiles: function() { + return getProgram().getSourceFiles(); + }, + getOptionsDiagnostics: function(cancellationToken) { + return getProgram().getOptionsDiagnostics(cancellationToken); + }, + getGlobalDiagnostics: function(cancellationToken) { + return getProgram().getGlobalDiagnostics(cancellationToken); + }, + getConfigFileParsingDiagnostics: function() { + return configFileParsingDiagnostics; + }, + getSyntacticDiagnostics: function(sourceFile, cancellationToken) { + return getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken); + }, + getDeclarationDiagnostics: function(sourceFile, cancellationToken) { + return getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken); + }, + getSemanticDiagnostics: function(sourceFile, cancellationToken) { + return getProgram().getSemanticDiagnostics(sourceFile, cancellationToken); + }, + emit: function(sourceFile, writeFile2, cancellationToken, emitOnlyDts, customTransformers) { + return getProgram().emit(sourceFile, writeFile2, cancellationToken, emitOnlyDts, customTransformers); + }, + emitBuildInfo: function(writeFile2, cancellationToken) { + return getProgram().emitBuildInfo(writeFile2, cancellationToken); + }, + getAllDependencies: ts2.notImplemented, + getCurrentDirectory: function() { + return getProgram().getCurrentDirectory(); + }, + close: ts2.noop + }; + function getProgram() { + return ts2.Debug.checkDefined(getState().program); + } + } + ts2.createRedirectedBuilderProgram = createRedirectedBuilderProgram; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + return ts2.createBuilderProgram(ts2.BuilderProgramKind.SemanticDiagnosticsBuilderProgram, ts2.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences)); + } + ts2.createSemanticDiagnosticsBuilderProgram = createSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + return ts2.createBuilderProgram(ts2.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, ts2.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences)); + } + ts2.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; + function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + var _a2 = ts2.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences), newProgram = _a2.newProgram, newConfigFileParsingDiagnostics = _a2.configFileParsingDiagnostics; + return ts2.createRedirectedBuilderProgram(function() { + return { program: newProgram, compilerOptions: newProgram.getCompilerOptions() }; + }, newConfigFileParsingDiagnostics); + } + ts2.createAbstractBuilder = createAbstractBuilder; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function removeIgnoredPath(path2) { + if (ts2.endsWith(path2, "/node_modules/.staging")) { + return ts2.removeSuffix(path2, "/.staging"); + } + return ts2.some(ts2.ignoredPaths, function(searchPath) { + return ts2.stringContains(path2, searchPath); + }) ? void 0 : path2; + } + ts2.removeIgnoredPath = removeIgnoredPath; + function canWatchDirectoryOrFile(dirPath) { + var rootLength = ts2.getRootLength(dirPath); + if (dirPath.length === rootLength) { + return false; + } + var nextDirectorySeparator = dirPath.indexOf(ts2.directorySeparator, rootLength); + if (nextDirectorySeparator === -1) { + return false; + } + var pathPartForUserCheck = dirPath.substring(rootLength, nextDirectorySeparator + 1); + var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47; + if (isNonDirectorySeparatorRoot && dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths + pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) { + nextDirectorySeparator = dirPath.indexOf(ts2.directorySeparator, nextDirectorySeparator + 1); + if (nextDirectorySeparator === -1) { + return false; + } + pathPartForUserCheck = dirPath.substring(rootLength + pathPartForUserCheck.length, nextDirectorySeparator + 1); + } + if (isNonDirectorySeparatorRoot && pathPartForUserCheck.search(/users\//i) !== 0) { + return true; + } + for (var searchIndex = nextDirectorySeparator + 1, searchLevels = 2; searchLevels > 0; searchLevels--) { + searchIndex = dirPath.indexOf(ts2.directorySeparator, searchIndex) + 1; + if (searchIndex === 0) { + return false; + } + } + return true; + } + ts2.canWatchDirectoryOrFile = canWatchDirectoryOrFile; + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { + var filesWithChangedSetOfUnresolvedImports; + var filesWithInvalidatedResolutions; + var filesWithInvalidatedNonRelativeUnresolvedImports; + var nonRelativeExternalModuleResolutions = ts2.createMultiMap(); + var resolutionsWithFailedLookups = []; + var resolutionsWithOnlyAffectingLocations = []; + var resolvedFileToResolution = ts2.createMultiMap(); + var impliedFormatPackageJsons = new ts2.Map(); + var hasChangedAutomaticTypeDirectiveNames = false; + var affectingPathChecksForFile; + var affectingPathChecks; + var failedLookupChecks; + var startsWithPathChecks; + var isInDirectoryChecks; + var getCurrentDirectory = ts2.memoize(function() { + return resolutionHost.getCurrentDirectory(); + }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); + var resolvedModuleNames = new ts2.Map(); + var perDirectoryResolvedModuleNames = ts2.createCacheWithRedirects(); + var nonRelativeModuleNameCache = ts2.createCacheWithRedirects(); + var moduleResolutionCache = ts2.createModuleResolutionCache( + getCurrentDirectory(), + resolutionHost.getCanonicalFileName, + /*options*/ + void 0, + perDirectoryResolvedModuleNames, + nonRelativeModuleNameCache + ); + var resolvedTypeReferenceDirectives = new ts2.Map(); + var perDirectoryResolvedTypeReferenceDirectives = ts2.createCacheWithRedirects(); + var typeReferenceDirectiveResolutionCache = ts2.createTypeReferenceDirectiveResolutionCache( + getCurrentDirectory(), + resolutionHost.getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache.getPackageJsonInfoCache(), + perDirectoryResolvedTypeReferenceDirectives + ); + var failedLookupDefaultExtensions = [ + ".ts", + ".tsx", + ".js", + ".jsx", + ".json" + /* Extension.Json */ + ]; + var customFailedLookupPaths = new ts2.Map(); + var directoryWatchesOfFailedLookups = new ts2.Map(); + var fileWatchesOfAffectingLocations = new ts2.Map(); + var rootDir = rootDirForResolution && ts2.removeTrailingDirectorySeparator(ts2.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory())); + var rootPath = rootDir && resolutionHost.toPath(rootDir); + var rootSplitLength = rootPath !== void 0 ? rootPath.split(ts2.directorySeparator).length : 0; + var typeRootsWatches = new ts2.Map(); + return { + getModuleResolutionCache: function() { + return moduleResolutionCache; + }, + startRecordingFilesWithChangedResolutions, + finishRecordingFilesWithChangedResolutions, + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + startCachingPerDirectoryResolution, + finishCachingPerDirectoryResolution, + resolveModuleNames, + getResolvedModuleWithFailedLookupLocationsFromCache, + resolveTypeReferenceDirectives, + removeResolutionsFromProjectReferenceRedirects, + removeResolutionsOfFile, + hasChangedAutomaticTypeDirectiveNames: function() { + return hasChangedAutomaticTypeDirectiveNames; + }, + invalidateResolutionOfFile, + invalidateResolutionsOfFailedLookupLocations, + setFilesWithInvalidatedNonRelativeUnresolvedImports, + createHasInvalidatedResolutions, + isFileWithInvalidatedNonRelativeUnresolvedImports, + updateTypeRootsWatch, + closeTypeRootsWatch, + clear: clear2 + }; + function getResolvedModule(resolution) { + return resolution.resolvedModule; + } + function getResolvedTypeReferenceDirective(resolution) { + return resolution.resolvedTypeReferenceDirective; + } + function isInDirectoryPath(dir2, file) { + if (dir2 === void 0 || file.length <= dir2.length) { + return false; + } + return ts2.startsWith(file, dir2) && file[dir2.length] === ts2.directorySeparator; + } + function clear2() { + ts2.clearMap(directoryWatchesOfFailedLookups, ts2.closeFileWatcherOf); + ts2.clearMap(fileWatchesOfAffectingLocations, ts2.closeFileWatcherOf); + customFailedLookupPaths.clear(); + nonRelativeExternalModuleResolutions.clear(); + closeTypeRootsWatch(); + resolvedModuleNames.clear(); + resolvedTypeReferenceDirectives.clear(); + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.length = 0; + resolutionsWithOnlyAffectingLocations.length = 0; + failedLookupChecks = void 0; + startsWithPathChecks = void 0; + isInDirectoryChecks = void 0; + affectingPathChecks = void 0; + affectingPathChecksForFile = void 0; + moduleResolutionCache.clear(); + typeReferenceDirectiveResolutionCache.clear(); + impliedFormatPackageJsons.clear(); + hasChangedAutomaticTypeDirectiveNames = false; + } + function startRecordingFilesWithChangedResolutions() { + filesWithChangedSetOfUnresolvedImports = []; + } + function finishRecordingFilesWithChangedResolutions() { + var collected = filesWithChangedSetOfUnresolvedImports; + filesWithChangedSetOfUnresolvedImports = void 0; + return collected; + } + function isFileWithInvalidatedNonRelativeUnresolvedImports(path2) { + if (!filesWithInvalidatedNonRelativeUnresolvedImports) { + return false; + } + var value2 = filesWithInvalidatedNonRelativeUnresolvedImports.get(path2); + return !!value2 && !!value2.length; + } + function createHasInvalidatedResolutions(customHasInvalidatedResolutions) { + invalidateResolutionsOfFailedLookupLocations(); + var collected = filesWithInvalidatedResolutions; + filesWithInvalidatedResolutions = void 0; + return function(path2) { + return customHasInvalidatedResolutions(path2) || !!(collected === null || collected === void 0 ? void 0 : collected.has(path2)) || isFileWithInvalidatedNonRelativeUnresolvedImports(path2); + }; + } + function startCachingPerDirectoryResolution() { + moduleResolutionCache.clearAllExceptPackageJsonInfoCache(); + typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache(); + nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions); + nonRelativeExternalModuleResolutions.clear(); + } + function finishCachingPerDirectoryResolution(newProgram, oldProgram) { + filesWithInvalidatedNonRelativeUnresolvedImports = void 0; + nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions); + nonRelativeExternalModuleResolutions.clear(); + if (newProgram !== oldProgram) { + newProgram === null || newProgram === void 0 ? void 0 : newProgram.getSourceFiles().forEach(function(newFile) { + var _a2, _b, _c; + var expected = ts2.isExternalOrCommonJsModule(newFile) ? (_b = (_a2 = newFile.packageJsonLocations) === null || _a2 === void 0 ? void 0 : _a2.length) !== null && _b !== void 0 ? _b : 0 : 0; + var existing = (_c = impliedFormatPackageJsons.get(newFile.path)) !== null && _c !== void 0 ? _c : ts2.emptyArray; + for (var i7 = existing.length; i7 < expected; i7++) { + createFileWatcherOfAffectingLocation( + newFile.packageJsonLocations[i7], + /*forResolution*/ + false + ); + } + if (existing.length > expected) { + for (var i7 = expected; i7 < existing.length; i7++) { + fileWatchesOfAffectingLocations.get(existing[i7]).files--; + } + } + if (expected) + impliedFormatPackageJsons.set(newFile.path, newFile.packageJsonLocations); + else + impliedFormatPackageJsons.delete(newFile.path); + }); + impliedFormatPackageJsons.forEach(function(existing, path2) { + if (!(newProgram === null || newProgram === void 0 ? void 0 : newProgram.getSourceFileByPath(path2))) { + existing.forEach(function(location2) { + return fileWatchesOfAffectingLocations.get(location2).files--; + }); + impliedFormatPackageJsons.delete(path2); + } + }); + } + directoryWatchesOfFailedLookups.forEach(function(watcher, path2) { + if (watcher.refCount === 0) { + directoryWatchesOfFailedLookups.delete(path2); + watcher.watcher.close(); + } + }); + fileWatchesOfAffectingLocations.forEach(function(watcher, path2) { + if (watcher.files === 0 && watcher.resolutions === 0) { + fileWatchesOfAffectingLocations.delete(path2); + watcher.watcher.close(); + } + }); + hasChangedAutomaticTypeDirectiveNames = false; + } + function resolveModuleName(moduleName3, containingFile, compilerOptions, host, redirectedReference, _containingSourceFile, mode) { + var _a2, _b; + var primaryResult = ts2.resolveModuleName(moduleName3, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode); + if (!resolutionHost.getGlobalCache) { + return primaryResult; + } + var globalCache = resolutionHost.getGlobalCache(); + if (globalCache !== void 0 && !ts2.isExternalModuleNameRelative(moduleName3) && !(primaryResult.resolvedModule && ts2.extensionIsTS(primaryResult.resolvedModule.extension))) { + var _c = ts2.loadModuleFromGlobalCache(ts2.Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName3), resolutionHost.projectName, compilerOptions, host, globalCache, moduleResolutionCache), resolvedModule = _c.resolvedModule, failedLookupLocations = _c.failedLookupLocations, affectingLocations = _c.affectingLocations; + if (resolvedModule) { + primaryResult.resolvedModule = resolvedModule; + (_a2 = primaryResult.failedLookupLocations).push.apply(_a2, failedLookupLocations); + (_b = primaryResult.affectingLocations).push.apply(_b, affectingLocations); + return primaryResult; + } + } + return primaryResult; + } + function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, _containingSourceFile, resolutionMode) { + return ts2.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode); + } + function resolveNamesWithLocalCache(_a2) { + var _b, _c, _d; + var names = _a2.names, containingFile = _a2.containingFile, redirectedReference = _a2.redirectedReference, cache = _a2.cache, perDirectoryCacheWithRedirects = _a2.perDirectoryCacheWithRedirects, loader2 = _a2.loader, getResolutionWithResolvedFileName = _a2.getResolutionWithResolvedFileName, shouldRetryResolution = _a2.shouldRetryResolution, reusedNames = _a2.reusedNames, logChanges = _a2.logChanges, containingSourceFile = _a2.containingSourceFile, containingSourceFileMode = _a2.containingSourceFileMode; + var path2 = resolutionHost.toPath(containingFile); + var resolutionsInFile = cache.get(path2) || cache.set(path2, ts2.createModeAwareCache()).get(path2); + var dirPath = ts2.getDirectoryPath(path2); + var perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference); + var perDirectoryResolution = perDirectoryCache.get(dirPath); + if (!perDirectoryResolution) { + perDirectoryResolution = ts2.createModeAwareCache(); + perDirectoryCache.set(dirPath, perDirectoryResolution); + } + var resolvedModules = []; + var compilerOptions = resolutionHost.getCompilationSettings(); + var hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path2); + var program = resolutionHost.getCurrentProgram(); + var oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile); + var unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference; + var seenNamesInFile = ts2.createModeAwareCache(); + var i7 = 0; + for (var _i = 0, names_5 = names; _i < names_5.length; _i++) { + var entry = names_5[_i]; + var name2 = ts2.isString(entry) ? entry : entry.fileName.toLowerCase(); + var mode = !ts2.isString(entry) ? ts2.getModeForFileReference(entry, containingSourceFileMode) : containingSourceFile ? ts2.getModeForResolutionAtIndex(containingSourceFile, i7) : void 0; + i7++; + var resolution = resolutionsInFile.get(name2, mode); + if (!seenNamesInFile.has(name2, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate + hasInvalidatedNonRelativeUnresolvedImport && !ts2.isExternalModuleNameRelative(name2) && shouldRetryResolution(resolution)) { + var existingResolution = resolution; + var resolutionInDirectory = perDirectoryResolution.get(name2, mode); + if (resolutionInDirectory) { + resolution = resolutionInDirectory; + var host = ((_b = resolutionHost.getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(resolutionHost)) || resolutionHost; + if (ts2.isTraceEnabled(compilerOptions, host)) { + var resolved = getResolutionWithResolvedFileName(resolution); + ts2.trace(host, loader2 === resolveModuleName ? (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ? resolved.packagetId ? ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved : (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ? resolved.packagetId ? ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved, name2, containingFile, ts2.getDirectoryPath(containingFile), resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName, (resolved === null || resolved === void 0 ? void 0 : resolved.packagetId) && ts2.packageIdToString(resolved.packagetId)); + } + } else { + resolution = loader2(name2, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode); + perDirectoryResolution.set(name2, mode, resolution); + if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) { + resolutionHost.onDiscoveredSymlink(); + } + } + resolutionsInFile.set(name2, mode, resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name2, resolution, path2, getResolutionWithResolvedFileName); + if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution, path2, getResolutionWithResolvedFileName); + } + if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + filesWithChangedSetOfUnresolvedImports.push(path2); + logChanges = false; + } + } else { + var host = ((_d = resolutionHost.getCompilerHost) === null || _d === void 0 ? void 0 : _d.call(resolutionHost)) || resolutionHost; + if (ts2.isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name2, mode)) { + var resolved = getResolutionWithResolvedFileName(resolution); + ts2.trace(host, loader2 === resolveModuleName ? (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ? resolved.packagetId ? ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : ts2.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved : (resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName) ? resolved.packagetId ? ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : ts2.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved, name2, containingFile, resolved === null || resolved === void 0 ? void 0 : resolved.resolvedFileName, (resolved === null || resolved === void 0 ? void 0 : resolved.packagetId) && ts2.packageIdToString(resolved.packagetId)); + } + } + ts2.Debug.assert(resolution !== void 0 && !resolution.isInvalidated); + seenNamesInFile.set(name2, mode, true); + resolvedModules.push(getResolutionWithResolvedFileName(resolution)); + } + resolutionsInFile.forEach(function(resolution2, name3, mode2) { + if (!seenNamesInFile.has(name3, mode2) && !ts2.contains(reusedNames, name3)) { + stopWatchFailedLookupLocationOfResolution(resolution2, path2, getResolutionWithResolvedFileName); + resolutionsInFile.delete(name3, mode2); + } + }); + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution) { + return false; + } + var oldResult = getResolutionWithResolvedFileName(oldResolution); + var newResult = getResolutionWithResolvedFileName(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return oldResult.resolvedFileName === newResult.resolvedFileName; + } + } + function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode) { + return resolveNamesWithLocalCache({ + names: typeDirectiveNames, + containingFile, + redirectedReference, + cache: resolvedTypeReferenceDirectives, + perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives, + loader: resolveTypeReferenceDirective, + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: function(resolution) { + return resolution.resolvedTypeReferenceDirective === void 0; + }, + containingSourceFileMode: containingFileMode + }); + } + function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) { + return resolveNamesWithLocalCache({ + names: moduleNames, + containingFile, + redirectedReference, + cache: resolvedModuleNames, + perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames, + loader: resolveModuleName, + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: function(resolution) { + return !resolution.resolvedModule || !ts2.resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension); + }, + reusedNames, + logChanges: logChangesWhenResolvingModule, + containingSourceFile + }); + } + function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName3, containingFile, resolutionMode) { + var cache = resolvedModuleNames.get(resolutionHost.toPath(containingFile)); + if (!cache) + return void 0; + return cache.get(moduleName3, resolutionMode); + } + function isNodeModulesAtTypesDirectory(dirPath) { + return ts2.endsWith(dirPath, "/node_modules/@types"); + } + function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) { + if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { + failedLookupLocation = ts2.isRootedDiskPath(failedLookupLocation) ? ts2.normalizePath(failedLookupLocation) : ts2.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory()); + var failedLookupPathSplit = failedLookupLocationPath.split(ts2.directorySeparator); + var failedLookupSplit = failedLookupLocation.split(ts2.directorySeparator); + ts2.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath)); + if (failedLookupPathSplit.length > rootSplitLength + 1) { + return { + dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(ts2.directorySeparator), + dirPath: failedLookupPathSplit.slice(0, rootSplitLength + 1).join(ts2.directorySeparator) + }; + } else { + return { + dir: rootDir, + dirPath: rootPath, + nonRecursive: false + }; + } + } + return getDirectoryToWatchFromFailedLookupLocationDirectory(ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())), ts2.getDirectoryPath(failedLookupLocationPath)); + } + function getDirectoryToWatchFromFailedLookupLocationDirectory(dir2, dirPath) { + while (ts2.pathContainsNodeModules(dirPath)) { + dir2 = ts2.getDirectoryPath(dir2); + dirPath = ts2.getDirectoryPath(dirPath); + } + if (ts2.isNodeModulesDirectory(dirPath)) { + return canWatchDirectoryOrFile(ts2.getDirectoryPath(dirPath)) ? { dir: dir2, dirPath } : void 0; + } + var nonRecursive = true; + var subDirectoryPath, subDirectory; + if (rootPath !== void 0) { + while (!isInDirectoryPath(dirPath, rootPath)) { + var parentPath = ts2.getDirectoryPath(dirPath); + if (parentPath === dirPath) { + break; + } + nonRecursive = false; + subDirectoryPath = dirPath; + subDirectory = dir2; + dirPath = parentPath; + dir2 = ts2.getDirectoryPath(dir2); + } + } + return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir2, dirPath: subDirectoryPath || dirPath, nonRecursive } : void 0; + } + function isPathWithDefaultFailedLookupExtension(path2) { + return ts2.fileExtensionIsOneOf(path2, failedLookupDefaultExtensions); + } + function watchFailedLookupLocationsOfExternalModuleResolutions(name2, resolution, filePath, getResolutionWithResolvedFileName) { + if (resolution.refCount) { + resolution.refCount++; + ts2.Debug.assertIsDefined(resolution.files); + } else { + resolution.refCount = 1; + ts2.Debug.assert(ts2.length(resolution.files) === 0); + if (ts2.isExternalModuleNameRelative(name2)) { + watchFailedLookupLocationOfResolution(resolution); + } else { + nonRelativeExternalModuleResolutions.add(name2, resolution); + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.add(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + } + (resolution.files || (resolution.files = [])).push(filePath); + } + function watchFailedLookupLocationOfResolution(resolution) { + ts2.Debug.assert(!!resolution.refCount); + var failedLookupLocations = resolution.failedLookupLocations, affectingLocations = resolution.affectingLocations; + if (!failedLookupLocations.length && !affectingLocations.length) + return; + if (failedLookupLocations.length) + resolutionsWithFailedLookups.push(resolution); + var setAtRoot = false; + for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { + var failedLookupLocation = failedLookupLocations_1[_i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); + if (toWatch) { + var dir2 = toWatch.dir, dirPath = toWatch.dirPath, nonRecursive = toWatch.nonRecursive; + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + if (dirPath === rootPath) { + ts2.Debug.assert(!nonRecursive); + setAtRoot = true; + } else { + setDirectoryWatcher(dir2, dirPath, nonRecursive); + } + } + } + if (setAtRoot) { + setDirectoryWatcher( + rootDir, + rootPath, + /*nonRecursive*/ + true + ); + } + watchAffectingLocationsOfResolution(resolution, !failedLookupLocations.length); + } + function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) { + ts2.Debug.assert(!!resolution.refCount); + var affectingLocations = resolution.affectingLocations; + if (!affectingLocations.length) + return; + if (addToResolutionsWithOnlyAffectingLocations) + resolutionsWithOnlyAffectingLocations.push(resolution); + for (var _i = 0, affectingLocations_1 = affectingLocations; _i < affectingLocations_1.length; _i++) { + var affectingLocation = affectingLocations_1[_i]; + createFileWatcherOfAffectingLocation( + affectingLocation, + /*forResolution*/ + true + ); + } + } + function createFileWatcherOfAffectingLocation(affectingLocation, forResolution) { + var fileWatcher = fileWatchesOfAffectingLocations.get(affectingLocation); + if (fileWatcher) { + if (forResolution) + fileWatcher.resolutions++; + else + fileWatcher.files++; + return; + } + var locationToWatch = affectingLocation; + if (resolutionHost.realpath) { + locationToWatch = resolutionHost.realpath(affectingLocation); + if (affectingLocation !== locationToWatch) { + var fileWatcher_1 = fileWatchesOfAffectingLocations.get(locationToWatch); + if (fileWatcher_1) { + if (forResolution) + fileWatcher_1.resolutions++; + else + fileWatcher_1.files++; + fileWatcher_1.paths.add(affectingLocation); + fileWatchesOfAffectingLocations.set(affectingLocation, fileWatcher_1); + return; + } + } + } + var paths = new ts2.Set(); + paths.add(locationToWatch); + var actualWatcher = canWatchDirectoryOrFile(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, function(fileName, eventKind) { + cachedDirectoryStructureHost === null || cachedDirectoryStructureHost === void 0 ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind); + var packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(); + paths.forEach(function(path2) { + if (watcher.resolutions) + (affectingPathChecks !== null && affectingPathChecks !== void 0 ? affectingPathChecks : affectingPathChecks = new ts2.Set()).add(path2); + if (watcher.files) + (affectingPathChecksForFile !== null && affectingPathChecksForFile !== void 0 ? affectingPathChecksForFile : affectingPathChecksForFile = new ts2.Set()).add(path2); + packageJsonMap === null || packageJsonMap === void 0 ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path2)); + }); + resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); + }) : ts2.noopFileWatcher; + var watcher = { + watcher: actualWatcher !== ts2.noopFileWatcher ? { + close: function() { + actualWatcher.close(); + actualWatcher = ts2.noopFileWatcher; + } + } : actualWatcher, + resolutions: forResolution ? 1 : 0, + files: forResolution ? 0 : 1, + paths + }; + fileWatchesOfAffectingLocations.set(locationToWatch, watcher); + if (affectingLocation !== locationToWatch) { + fileWatchesOfAffectingLocations.set(affectingLocation, watcher); + paths.add(affectingLocation); + } + } + function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name2) { + var program = resolutionHost.getCurrentProgram(); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name2)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } else { + resolutions.forEach(function(resolution) { + return watchAffectingLocationsOfResolution( + resolution, + /*addToResolutionWithOnlyAffectingLocations*/ + true + ); + }); + } + } + function setDirectoryWatcher(dir2, dirPath, nonRecursive) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + ts2.Debug.assert(!!nonRecursive === !!dirWatcher.nonRecursive); + dirWatcher.refCount++; + } else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir2, dirPath, nonRecursive), refCount: 1, nonRecursive }); + } + } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) { + ts2.unorderedRemoveItem(ts2.Debug.checkDefined(resolution.files), filePath); + resolution.refCount--; + if (resolution.refCount) { + return; + } + var resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + resolvedFileToResolution.remove(resolutionHost.toPath(resolved.resolvedFileName), resolution); + } + var failedLookupLocations = resolution.failedLookupLocations, affectingLocations = resolution.affectingLocations; + if (ts2.unorderedRemoveItem(resolutionsWithFailedLookups, resolution)) { + var removeAtRoot = false; + for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { + var failedLookupLocation = failedLookupLocations_2[_i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + var toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); + if (toWatch) { + var dirPath = toWatch.dirPath; + var refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } else { + ts2.Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + if (dirPath === rootPath) { + removeAtRoot = true; + } else { + removeDirectoryWatcher(dirPath); + } + } + } + if (removeAtRoot) { + removeDirectoryWatcher(rootPath); + } + } else if (affectingLocations.length) { + ts2.unorderedRemoveItem(resolutionsWithOnlyAffectingLocations, resolution); + } + for (var _a2 = 0, affectingLocations_2 = affectingLocations; _a2 < affectingLocations_2.length; _a2++) { + var affectingLocation = affectingLocations_2[_a2]; + var watcher = fileWatchesOfAffectingLocations.get(affectingLocation); + watcher.resolutions--; + } + } + function removeDirectoryWatcher(dirPath) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + dirWatcher.refCount--; + } + function createDirectoryWatcher(directory, dirPath, nonRecursive) { + return resolutionHost.watchDirectoryOfFailedLookupLocation( + directory, + function(fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); + }, + nonRecursive ? 0 : 1 + /* WatchDirectoryFlags.Recursive */ + ); + } + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) { + var resolutions = cache.get(filePath); + if (resolutions) { + resolutions.forEach(function(resolution) { + return stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName); + }); + cache.delete(filePath); + } + } + function removeResolutionsFromProjectReferenceRedirects(filePath) { + if (!ts2.fileExtensionIs( + filePath, + ".json" + /* Extension.Json */ + )) + return; + var program = resolutionHost.getCurrentProgram(); + if (!program) + return; + var resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath); + if (!resolvedProjectReference) + return; + resolvedProjectReference.commandLine.fileNames.forEach(function(f8) { + return removeResolutionsOfFile(resolutionHost.toPath(f8)); + }); + } + function removeResolutionsOfFile(filePath) { + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective); + } + function invalidateResolutions(resolutions, canInvalidate) { + if (!resolutions) + return false; + var invalidated = false; + for (var _i = 0, resolutions_1 = resolutions; _i < resolutions_1.length; _i++) { + var resolution = resolutions_1[_i]; + if (resolution.isInvalidated || !canInvalidate(resolution)) + continue; + resolution.isInvalidated = invalidated = true; + for (var _a2 = 0, _b = ts2.Debug.checkDefined(resolution.files); _a2 < _b.length; _a2++) { + var containingFilePath = _b[_a2]; + (filesWithInvalidatedResolutions !== null && filesWithInvalidatedResolutions !== void 0 ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = new ts2.Set()).add(containingFilePath); + hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || ts2.endsWith(containingFilePath, ts2.inferredTypesContainingFile); + } + } + return invalidated; + } + function invalidateResolutionOfFile(filePath) { + removeResolutionsOfFile(filePath); + var prevHasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + if (invalidateResolutions(resolvedFileToResolution.get(filePath), ts2.returnTrue) && hasChangedAutomaticTypeDirectiveNames && !prevHasChangedAutomaticTypeDirectiveNames) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + } + } + function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { + ts2.Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === void 0); + filesWithInvalidatedNonRelativeUnresolvedImports = filesMap; + } + function scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) { + if (isCreatingWatchedDirectory) { + (isInDirectoryChecks || (isInDirectoryChecks = new ts2.Set())).add(fileOrDirectoryPath); + } else { + var updatedPath = removeIgnoredPath(fileOrDirectoryPath); + if (!updatedPath) + return false; + fileOrDirectoryPath = updatedPath; + if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) { + return false; + } + var dirOfFileOrDirectory = ts2.getDirectoryPath(fileOrDirectoryPath); + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || ts2.isNodeModulesDirectory(fileOrDirectoryPath) || isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || ts2.isNodeModulesDirectory(dirOfFileOrDirectory)) { + (failedLookupChecks || (failedLookupChecks = new ts2.Set())).add(fileOrDirectoryPath); + (startsWithPathChecks || (startsWithPathChecks = new ts2.Set())).add(fileOrDirectoryPath); + } else { + if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { + return false; + } + if (ts2.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } + (failedLookupChecks || (failedLookupChecks = new ts2.Set())).add(fileOrDirectoryPath); + var packagePath = ts2.parseNodeModuleFromPath(fileOrDirectoryPath); + if (packagePath) + (startsWithPathChecks || (startsWithPathChecks = new ts2.Set())).add(packagePath); + } + } + resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); + } + function invalidateResolutionsOfFailedLookupLocations() { + var _a2; + var invalidated = false; + if (affectingPathChecksForFile) { + (_a2 = resolutionHost.getCurrentProgram()) === null || _a2 === void 0 ? void 0 : _a2.getSourceFiles().forEach(function(f8) { + if (ts2.some(f8.packageJsonLocations, function(location2) { + return affectingPathChecksForFile.has(location2); + })) { + (filesWithInvalidatedResolutions !== null && filesWithInvalidatedResolutions !== void 0 ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = new ts2.Set()).add(f8.path); + invalidated = true; + } + }); + affectingPathChecksForFile = void 0; + } + if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks && !affectingPathChecks) { + return invalidated; + } + invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution) || invalidated; + var packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(); + if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) { + packageJsonMap.forEach(function(_value, path2) { + return isInvalidatedFailedLookup(path2) ? packageJsonMap.delete(path2) : void 0; + }); + } + failedLookupChecks = void 0; + startsWithPathChecks = void 0; + isInDirectoryChecks = void 0; + invalidated = invalidateResolutions(resolutionsWithOnlyAffectingLocations, canInvalidatedFailedLookupResolutionWithAffectingLocation) || invalidated; + affectingPathChecks = void 0; + return invalidated; + } + function canInvalidateFailedLookupResolution(resolution) { + if (canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution)) + return true; + if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks) + return false; + return resolution.failedLookupLocations.some(function(location2) { + return isInvalidatedFailedLookup(resolutionHost.toPath(location2)); + }); + } + function isInvalidatedFailedLookup(locationPath) { + return (failedLookupChecks === null || failedLookupChecks === void 0 ? void 0 : failedLookupChecks.has(locationPath)) || ts2.firstDefinedIterator((startsWithPathChecks === null || startsWithPathChecks === void 0 ? void 0 : startsWithPathChecks.keys()) || ts2.emptyIterator, function(fileOrDirectoryPath) { + return ts2.startsWith(locationPath, fileOrDirectoryPath) ? true : void 0; + }) || ts2.firstDefinedIterator((isInDirectoryChecks === null || isInDirectoryChecks === void 0 ? void 0 : isInDirectoryChecks.keys()) || ts2.emptyIterator, function(fileOrDirectoryPath) { + return isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : void 0; + }); + } + function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) { + return !!affectingPathChecks && resolution.affectingLocations.some(function(location2) { + return affectingPathChecks.has(location2); + }); + } + function closeTypeRootsWatch() { + ts2.clearMap(typeRootsWatches, ts2.closeFileWatcher); + } + function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { + if (isInDirectoryPath(rootPath, typeRootPath)) { + return rootPath; + } + var toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath); + return toWatch && directoryWatchesOfFailedLookups.has(toWatch.dirPath) ? toWatch.dirPath : void 0; + } + function createTypeRootsWatch(typeRootPath, typeRoot) { + return resolutionHost.watchTypeRootsDirectory( + typeRoot, + function(fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + hasChangedAutomaticTypeDirectiveNames = true; + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + var dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath); + if (dirPath) { + scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); + } + }, + 1 + /* WatchDirectoryFlags.Recursive */ + ); + } + function updateTypeRootsWatch() { + var options = resolutionHost.getCompilationSettings(); + if (options.types) { + closeTypeRootsWatch(); + return; + } + var typeRoots = ts2.getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory }); + if (typeRoots) { + ts2.mutateMap(typeRootsWatches, ts2.arrayToMap(typeRoots, function(tr) { + return resolutionHost.toPath(tr); + }), { + createNewValue: createTypeRootsWatch, + onDeleteValue: ts2.closeFileWatcher + }); + } else { + closeTypeRootsWatch(); + } + } + function directoryExistsForTypeRootWatch(nodeTypesDirectory) { + var dir2 = ts2.getDirectoryPath(ts2.getDirectoryPath(nodeTypesDirectory)); + var dirPath = resolutionHost.toPath(dir2); + return dirPath === rootPath || canWatchDirectoryOrFile(dirPath); + } + } + ts2.createResolutionCache = createResolutionCache; + function resolutionIsSymlink(resolution) { + var _a2, _b; + return !!(((_a2 = resolution.resolvedModule) === null || _a2 === void 0 ? void 0 : _a2.originalPath) || ((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath)); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var moduleSpecifiers; + (function(moduleSpecifiers_1) { + var RelativePreference; + (function(RelativePreference2) { + RelativePreference2[RelativePreference2["Relative"] = 0] = "Relative"; + RelativePreference2[RelativePreference2["NonRelative"] = 1] = "NonRelative"; + RelativePreference2[RelativePreference2["Shortest"] = 2] = "Shortest"; + RelativePreference2[RelativePreference2["ExternalNonRelative"] = 3] = "ExternalNonRelative"; + })(RelativePreference || (RelativePreference = {})); + var Ending; + (function(Ending2) { + Ending2[Ending2["Minimal"] = 0] = "Minimal"; + Ending2[Ending2["Index"] = 1] = "Index"; + Ending2[Ending2["JsExtension"] = 2] = "JsExtension"; + })(Ending || (Ending = {})); + function getPreferences(host, _a2, compilerOptions, importingSourceFile) { + var importModuleSpecifierPreference = _a2.importModuleSpecifierPreference, importModuleSpecifierEnding = _a2.importModuleSpecifierEnding; + return { + relativePreference: importModuleSpecifierPreference === "relative" ? 0 : importModuleSpecifierPreference === "non-relative" ? 1 : importModuleSpecifierPreference === "project-relative" ? 3 : 2, + ending: getEnding() + }; + function getEnding() { + switch (importModuleSpecifierEnding) { + case "minimal": + return 0; + case "index": + return 1; + case "js": + return 2; + default: + return usesJsExtensionOnImports(importingSourceFile) || isFormatRequiringExtensions(compilerOptions, importingSourceFile.path, host) ? 2 : ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.NodeJs ? 1 : 0; + } + } + } + function getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host) { + return { + relativePreference: ts2.isExternalModuleNameRelative(oldImportSpecifier) ? 0 : 1, + ending: ts2.hasJSFileExtension(oldImportSpecifier) || isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) ? 2 : ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.NodeJs || ts2.endsWith(oldImportSpecifier, "index") ? 1 : 0 + }; + } + function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) { + var _a2; + if (ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.Node16 && ts2.getEmitModuleResolutionKind(compilerOptions) !== ts2.ModuleResolutionKind.NodeNext) { + return false; + } + return ts2.getImpliedNodeFormatForFile(importingSourceFileName, (_a2 = host.getPackageJsonInfoCache) === null || _a2 === void 0 ? void 0 : _a2.call(host), getModuleResolutionHost(host), compilerOptions) !== ts2.ModuleKind.CommonJS; + } + function getModuleResolutionHost(host) { + var _a2; + return { + fileExists: host.fileExists, + readFile: ts2.Debug.checkDefined(host.readFile), + directoryExists: host.directoryExists, + getCurrentDirectory: host.getCurrentDirectory, + realpath: host.realpath, + useCaseSensitiveFileNames: (_a2 = host.useCaseSensitiveFileNames) === null || _a2 === void 0 ? void 0 : _a2.call(host) + }; + } + function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier, options) { + if (options === void 0) { + options = {}; + } + var res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {}, options); + if (res === oldImportSpecifier) + return void 0; + return res; + } + moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier; + function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, options) { + if (options === void 0) { + options = {}; + } + return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {}, options); + } + moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier; + function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options) { + if (options === void 0) { + options = {}; + } + var info2 = getInfo(importingSourceFile.path, host); + var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences, options); + return ts2.firstDefined(modulePaths, function(modulePath) { + return tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + preferences, + /*packageNameOnly*/ + true, + options.overrideImportMode + ); + }); + } + moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName; + function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences, options) { + if (options === void 0) { + options = {}; + } + var info2 = getInfo(importingSourceFileName, host); + var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options); + return ts2.firstDefined(modulePaths, function(modulePath) { + return tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + userPreferences, + /*packageNameOnly*/ + void 0, + options.overrideImportMode + ); + }) || getLocalModuleSpecifier(toFileName, info2, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences); + } + function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options) { + if (options === void 0) { + options = {}; + } + return tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options)[0]; + } + moduleSpecifiers_1.tryGetModuleSpecifiersFromCache = tryGetModuleSpecifiersFromCache; + function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options) { + var _a2; + if (options === void 0) { + options = {}; + } + var moduleSourceFile = ts2.getSourceFileOfModule(moduleSymbol); + if (!moduleSourceFile) { + return ts2.emptyArray; + } + var cache = (_a2 = host.getModuleSpecifierCache) === null || _a2 === void 0 ? void 0 : _a2.call(host); + var cached = cache === null || cache === void 0 ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options); + return [cached === null || cached === void 0 ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached === null || cached === void 0 ? void 0 : cached.modulePaths, cache]; + } + function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) { + if (options === void 0) { + options = {}; + } + return getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options).moduleSpecifiers; + } + moduleSpecifiers_1.getModuleSpecifiers = getModuleSpecifiers; + function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options) { + if (options === void 0) { + options = {}; + } + var computedWithoutCache = false; + var ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker); + if (ambient) + return { moduleSpecifiers: [ambient], computedWithoutCache }; + var _a2 = tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options), specifiers = _a2[0], moduleSourceFile = _a2[1], modulePaths = _a2[2], cache = _a2[3]; + if (specifiers) + return { moduleSpecifiers: specifiers, computedWithoutCache }; + if (!moduleSourceFile) + return { moduleSpecifiers: ts2.emptyArray, computedWithoutCache }; + computedWithoutCache = true; + modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host)); + var result2 = computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options); + cache === null || cache === void 0 ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result2); + return { moduleSpecifiers: result2, computedWithoutCache }; + } + moduleSpecifiers_1.getModuleSpecifiersWithCacheInfo = getModuleSpecifiersWithCacheInfo; + function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options) { + if (options === void 0) { + options = {}; + } + var info2 = getInfo(importingSourceFile.path, host); + var preferences = getPreferences(host, userPreferences, compilerOptions, importingSourceFile); + var existingSpecifier = ts2.forEach(modulePaths, function(modulePath2) { + return ts2.forEach(host.getFileIncludeReasons().get(ts2.toPath(modulePath2.path, host.getCurrentDirectory(), info2.getCanonicalFileName)), function(reason) { + if (reason.kind !== ts2.FileIncludeKind.Import || reason.file !== importingSourceFile.path) + return void 0; + if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== ts2.getModeForResolutionAtIndex(importingSourceFile, reason.index)) + return void 0; + var specifier2 = ts2.getModuleNameStringLiteralAt(importingSourceFile, reason.index).text; + return preferences.relativePreference !== 1 || !ts2.pathIsRelative(specifier2) ? specifier2 : void 0; + }); + }); + if (existingSpecifier) { + var moduleSpecifiers_2 = [existingSpecifier]; + return moduleSpecifiers_2; + } + var importedFileIsInNodeModules = ts2.some(modulePaths, function(p7) { + return p7.isInNodeModules; + }); + var nodeModulesSpecifiers; + var pathsSpecifiers; + var relativeSpecifiers; + for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) { + var modulePath = modulePaths_1[_i]; + var specifier = tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + userPreferences, + /*packageNameOnly*/ + void 0, + options.overrideImportMode + ); + nodeModulesSpecifiers = ts2.append(nodeModulesSpecifiers, specifier); + if (specifier && modulePath.isRedirect) { + return nodeModulesSpecifiers; + } + if (!specifier && !modulePath.isRedirect) { + var local = getLocalModuleSpecifier(modulePath.path, info2, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences); + if (ts2.pathIsBareSpecifier(local)) { + pathsSpecifiers = ts2.append(pathsSpecifiers, local); + } else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) { + relativeSpecifiers = ts2.append(relativeSpecifiers, local); + } + } + } + return (pathsSpecifiers === null || pathsSpecifiers === void 0 ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (nodeModulesSpecifiers === null || nodeModulesSpecifiers === void 0 ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : ts2.Debug.checkDefined(relativeSpecifiers); + } + function getInfo(importingSourceFileName, host) { + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true); + var sourceDirectory = ts2.getDirectoryPath(importingSourceFileName); + return { getCanonicalFileName, importingSourceFileName, sourceDirectory }; + } + function getLocalModuleSpecifier(moduleFileName, info2, compilerOptions, host, importMode, _a2) { + var ending = _a2.ending, relativePreference = _a2.relativePreference; + var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths, rootDirs = compilerOptions.rootDirs; + var sourceDirectory = info2.sourceDirectory, getCanonicalFileName = info2.getCanonicalFileName; + var relativePath2 = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) || removeExtensionAndIndexPostFix(ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), ending, compilerOptions); + if (!baseUrl && !paths || relativePreference === 0) { + return relativePath2; + } + var baseDirectory = ts2.getNormalizedAbsolutePath(ts2.getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory()); + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseDirectory, getCanonicalFileName); + if (!relativeToBaseUrl) { + return relativePath2; + } + var fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions); + var nonRelative = fromPaths === void 0 && baseUrl !== void 0 ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths; + if (!nonRelative) { + return relativePath2; + } + if (relativePreference === 1) { + return nonRelative; + } + if (relativePreference === 3) { + var projectDirectory = compilerOptions.configFilePath ? ts2.toPath(ts2.getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info2.getCanonicalFileName) : info2.getCanonicalFileName(host.getCurrentDirectory()); + var modulePath = ts2.toPath(moduleFileName, projectDirectory, getCanonicalFileName); + var sourceIsInternal = ts2.startsWith(sourceDirectory, projectDirectory); + var targetIsInternal = ts2.startsWith(modulePath, projectDirectory); + if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) { + return nonRelative; + } + var nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, ts2.getDirectoryPath(modulePath)); + var nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory); + if (nearestSourcePackageJson !== nearestTargetPackageJson) { + return nonRelative; + } + return relativePath2; + } + if (relativePreference !== 2) + ts2.Debug.assertNever(relativePreference); + return isPathRelativeToParent(nonRelative) || countPathComponents(relativePath2) < countPathComponents(nonRelative) ? relativePath2 : nonRelative; + } + function countPathComponents(path2) { + var count2 = 0; + for (var i7 = ts2.startsWith(path2, "./") ? 2 : 0; i7 < path2.length; i7++) { + if (path2.charCodeAt(i7) === 47) + count2++; + } + return count2; + } + moduleSpecifiers_1.countPathComponents = countPathComponents; + function usesJsExtensionOnImports(_a2) { + var imports = _a2.imports; + return ts2.firstDefined(imports, function(_a3) { + var text = _a3.text; + return ts2.pathIsRelative(text) ? ts2.hasJSFileExtension(text) : void 0; + }) || false; + } + function comparePathsByRedirectAndNumberOfDirectorySeparators(a7, b8) { + return ts2.compareBooleans(b8.isRedirect, a7.isRedirect) || ts2.compareNumberOfDirectorySeparators(a7.path, b8.path); + } + function getNearestAncestorDirectoryWithPackageJson(host, fileName) { + if (host.getNearestAncestorDirectoryWithPackageJson) { + return host.getNearestAncestorDirectoryWithPackageJson(fileName); + } + return !!ts2.forEachAncestorDirectory(fileName, function(directory) { + return host.fileExists(ts2.combinePaths(directory, "package.json")) ? true : void 0; + }); + } + function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { + var _a2; + var getCanonicalFileName = ts2.hostGetCanonicalFileName(host); + var cwd3 = host.getCurrentDirectory(); + var referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : void 0; + var importedPath = ts2.toPath(importedFileName, cwd3, getCanonicalFileName); + var redirects = host.redirectTargetsMap.get(importedPath) || ts2.emptyArray; + var importedFileNames = __spreadArray9(__spreadArray9(__spreadArray9([], referenceRedirect ? [referenceRedirect] : ts2.emptyArray, true), [importedFileName], false), redirects, true); + var targets = importedFileNames.map(function(f8) { + return ts2.getNormalizedAbsolutePath(f8, cwd3); + }); + var shouldFilterIgnoredPaths = !ts2.every(targets, ts2.containsIgnoredPath); + if (!preferSymlinks) { + var result_16 = ts2.forEach(targets, function(p7) { + return !(shouldFilterIgnoredPaths && ts2.containsIgnoredPath(p7)) && cb(p7, referenceRedirect === p7); + }); + if (result_16) + return result_16; + } + var symlinkedDirectories = (_a2 = host.getSymlinkCache) === null || _a2 === void 0 ? void 0 : _a2.call(host).getSymlinkedDirectoriesByRealpath(); + var fullImportedFileName = ts2.getNormalizedAbsolutePath(importedFileName, cwd3); + var result2 = symlinkedDirectories && ts2.forEachAncestorDirectory(ts2.getDirectoryPath(fullImportedFileName), function(realPathDirectory) { + var symlinkDirectories = symlinkedDirectories.get(ts2.ensureTrailingDirectorySeparator(ts2.toPath(realPathDirectory, cwd3, getCanonicalFileName))); + if (!symlinkDirectories) + return void 0; + if (ts2.startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) { + return false; + } + return ts2.forEach(targets, function(target) { + if (!ts2.startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) { + return; + } + var relative2 = ts2.getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName); + for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) { + var symlinkDirectory = symlinkDirectories_1[_i]; + var option = ts2.resolvePath(symlinkDirectory, relative2); + var result_17 = cb(option, target === referenceRedirect); + shouldFilterIgnoredPaths = true; + if (result_17) + return result_17; + } + }); + }); + return result2 || (preferSymlinks ? ts2.forEach(targets, function(p7) { + return shouldFilterIgnoredPaths && ts2.containsIgnoredPath(p7) ? void 0 : cb(p7, p7 === referenceRedirect); + }) : void 0); + } + moduleSpecifiers_1.forEachFileNameOfModule = forEachFileNameOfModule; + function getAllModulePaths(importingFilePath, importedFileName, host, preferences, options) { + var _a2; + if (options === void 0) { + options = {}; + } + var importedFilePath = ts2.toPath(importedFileName, host.getCurrentDirectory(), ts2.hostGetCanonicalFileName(host)); + var cache = (_a2 = host.getModuleSpecifierCache) === null || _a2 === void 0 ? void 0 : _a2.call(host); + if (cache) { + var cached = cache.get(importingFilePath, importedFilePath, preferences, options); + if (cached === null || cached === void 0 ? void 0 : cached.modulePaths) + return cached.modulePaths; + } + var modulePaths = getAllModulePathsWorker(importingFilePath, importedFileName, host); + if (cache) { + cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths); + } + return modulePaths; + } + function getAllModulePathsWorker(importingFileName, importedFileName, host) { + var getCanonicalFileName = ts2.hostGetCanonicalFileName(host); + var allFileNames = new ts2.Map(); + var importedFileFromNodeModules = false; + forEachFileNameOfModule( + importingFileName, + importedFileName, + host, + /*preferSymlinks*/ + true, + function(path2, isRedirect) { + var isInNodeModules = ts2.pathContainsNodeModules(path2); + allFileNames.set(path2, { path: getCanonicalFileName(path2), isRedirect, isInNodeModules }); + importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; + } + ); + var sortedPaths = []; + var _loop_35 = function(directory2) { + var directoryStart = ts2.ensureTrailingDirectorySeparator(directory2); + var pathsInDirectory; + allFileNames.forEach(function(_a2, fileName) { + var path2 = _a2.path, isRedirect = _a2.isRedirect, isInNodeModules = _a2.isInNodeModules; + if (ts2.startsWith(path2, directoryStart)) { + (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect, isInNodeModules }); + allFileNames.delete(fileName); + } + }); + if (pathsInDirectory) { + if (pathsInDirectory.length > 1) { + pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + } + sortedPaths.push.apply(sortedPaths, pathsInDirectory); + } + var newDirectory = ts2.getDirectoryPath(directory2); + if (newDirectory === directory2) + return out_directory_1 = directory2, "break"; + directory2 = newDirectory; + out_directory_1 = directory2; + }; + var out_directory_1; + for (var directory = ts2.getDirectoryPath(importingFileName); allFileNames.size !== 0; ) { + var state_11 = _loop_35(directory); + directory = out_directory_1; + if (state_11 === "break") + break; + } + if (allFileNames.size) { + var remainingPaths = ts2.arrayFrom(allFileNames.values()); + if (remainingPaths.length > 1) + remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + sortedPaths.push.apply(sortedPaths, remainingPaths); + } + return sortedPaths; + } + function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) { + var _a2; + var decl = (_a2 = moduleSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.find(function(d7) { + return ts2.isNonGlobalAmbientModule(d7) && (!ts2.isExternalModuleAugmentation(d7) || !ts2.isExternalModuleNameRelative(ts2.getTextOfIdentifierOrLiteral(d7.name))); + }); + if (decl) { + return decl.name.text; + } + var ambientModuleDeclareCandidates = ts2.mapDefined(moduleSymbol.declarations, function(d7) { + var _a3, _b, _c, _d; + if (!ts2.isModuleDeclaration(d7)) + return; + var topNamespace = getTopNamespace(d7); + if (!(((_a3 = topNamespace === null || topNamespace === void 0 ? void 0 : topNamespace.parent) === null || _a3 === void 0 ? void 0 : _a3.parent) && ts2.isModuleBlock(topNamespace.parent) && ts2.isAmbientModule(topNamespace.parent.parent) && ts2.isSourceFile(topNamespace.parent.parent.parent))) + return; + var exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) === null || _b === void 0 ? void 0 : _b.get("export=")) === null || _c === void 0 ? void 0 : _c.valueDeclaration) === null || _d === void 0 ? void 0 : _d.expression; + if (!exportAssignment) + return; + var exportSymbol = checker.getSymbolAtLocation(exportAssignment); + if (!exportSymbol) + return; + var originalExportSymbol = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.flags) & 2097152 ? checker.getAliasedSymbol(exportSymbol) : exportSymbol; + if (originalExportSymbol === d7.symbol) + return topNamespace.parent.parent; + function getTopNamespace(namespaceDeclaration) { + while (namespaceDeclaration.flags & 4) { + namespaceDeclaration = namespaceDeclaration.parent; + } + return namespaceDeclaration; + } + }); + var ambientModuleDeclare = ambientModuleDeclareCandidates[0]; + if (ambientModuleDeclare) { + return ambientModuleDeclare.name.text; + } + } + function getAllowedEndings(preferredEnding, compilerOptions, importMode) { + if (ts2.getEmitModuleResolutionKind(compilerOptions) >= ts2.ModuleResolutionKind.Node16 && importMode === ts2.ModuleKind.ESNext) { + return [ + 2 + /* Ending.JsExtension */ + ]; + } + switch (preferredEnding) { + case 2: + return [ + 2, + 0, + 1 + /* Ending.Index */ + ]; + case 1: + return [ + 1, + 0, + 2 + /* Ending.JsExtension */ + ]; + case 0: + return [ + 0, + 1, + 2 + /* Ending.JsExtension */ + ]; + default: + ts2.Debug.assertNever(preferredEnding); + } + } + function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) { + for (var key in paths) { + var _loop_36 = function(patternText_12) { + var pattern5 = ts2.normalizePath(patternText_12); + var indexOfStar = pattern5.indexOf("*"); + var candidates = allowedEndings.map(function(ending2) { + return { + ending: ending2, + value: removeExtensionAndIndexPostFix(relativeToBaseUrl, ending2, compilerOptions) + }; + }); + if (ts2.tryGetExtensionFromPath(pattern5)) { + candidates.push({ ending: void 0, value: relativeToBaseUrl }); + } + if (indexOfStar !== -1) { + var prefix = pattern5.substring(0, indexOfStar); + var suffix = pattern5.substring(indexOfStar + 1); + for (var _b = 0, candidates_3 = candidates; _b < candidates_3.length; _b++) { + var _c = candidates_3[_b], ending = _c.ending, value2 = _c.value; + if (value2.length >= prefix.length + suffix.length && ts2.startsWith(value2, prefix) && ts2.endsWith(value2, suffix) && validateEnding({ ending, value: value2 })) { + var matchedStar = value2.substring(prefix.length, value2.length - suffix.length); + return { value: key.replace("*", matchedStar) }; + } + } + } else if (ts2.some(candidates, function(c7) { + return c7.ending !== 0 && pattern5 === c7.value; + }) || ts2.some(candidates, function(c7) { + return c7.ending === 0 && pattern5 === c7.value && validateEnding(c7); + })) { + return { value: key }; + } + }; + for (var _i = 0, _a2 = paths[key]; _i < _a2.length; _i++) { + var patternText_1 = _a2[_i]; + var state_12 = _loop_36(patternText_1); + if (typeof state_12 === "object") + return state_12.value; + } + } + function validateEnding(_a3) { + var ending = _a3.ending, value2 = _a3.value; + return ending !== 0 || value2 === removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions, host); + } + } + var MatchingMode; + (function(MatchingMode2) { + MatchingMode2[MatchingMode2["Exact"] = 0] = "Exact"; + MatchingMode2[MatchingMode2["Directory"] = 1] = "Directory"; + MatchingMode2[MatchingMode2["Pattern"] = 2] = "Pattern"; + })(MatchingMode || (MatchingMode = {})); + function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports29, conditions, mode) { + if (mode === void 0) { + mode = 0; + } + if (typeof exports29 === "string") { + var pathOrPattern = ts2.getNormalizedAbsolutePath( + ts2.combinePaths(packageDirectory, exports29), + /*currentDirectory*/ + void 0 + ); + var extensionSwappedTarget = ts2.hasTSFileExtension(targetFilePath) ? ts2.removeFileExtension(targetFilePath) + tryGetJSExtensionForFile(targetFilePath, options) : void 0; + switch (mode) { + case 0: + if (ts2.comparePaths(targetFilePath, pathOrPattern) === 0 || extensionSwappedTarget && ts2.comparePaths(extensionSwappedTarget, pathOrPattern) === 0) { + return { moduleFileToTry: packageName }; + } + break; + case 1: + if (ts2.containsPath(pathOrPattern, targetFilePath)) { + var fragment = ts2.getRelativePathFromDirectory( + pathOrPattern, + targetFilePath, + /*ignoreCase*/ + false + ); + return { moduleFileToTry: ts2.getNormalizedAbsolutePath( + ts2.combinePaths(ts2.combinePaths(packageName, exports29), fragment), + /*currentDirectory*/ + void 0 + ) }; + } + break; + case 2: + var starPos = pathOrPattern.indexOf("*"); + var leadingSlice = pathOrPattern.slice(0, starPos); + var trailingSlice = pathOrPattern.slice(starPos + 1); + if (ts2.startsWith(targetFilePath, leadingSlice) && ts2.endsWith(targetFilePath, trailingSlice)) { + var starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length); + return { moduleFileToTry: packageName.replace("*", starReplacement) }; + } + if (extensionSwappedTarget && ts2.startsWith(extensionSwappedTarget, leadingSlice) && ts2.endsWith(extensionSwappedTarget, trailingSlice)) { + var starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length); + return { moduleFileToTry: packageName.replace("*", starReplacement) }; + } + break; + } + } else if (Array.isArray(exports29)) { + return ts2.forEach(exports29, function(e10) { + return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e10, conditions); + }); + } else if (typeof exports29 === "object" && exports29 !== null) { + if (ts2.allKeysStartWithDot(exports29)) { + return ts2.forEach(ts2.getOwnKeys(exports29), function(k6) { + var subPackageName = ts2.getNormalizedAbsolutePath( + ts2.combinePaths(packageName, k6), + /*currentDirectory*/ + void 0 + ); + var mode2 = ts2.endsWith(k6, "/") ? 1 : ts2.stringContains(k6, "*") ? 2 : 0; + return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports29[k6], conditions, mode2); + }); + } else { + for (var _i = 0, _a2 = ts2.getOwnKeys(exports29); _i < _a2.length; _i++) { + var key = _a2[_i]; + if (key === "default" || conditions.indexOf(key) >= 0 || ts2.isApplicableVersionedTypesKey(conditions, key)) { + var subTarget = exports29[key]; + var result2 = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions); + if (result2) { + return result2; + } + } + } + } + } + return void 0; + } + function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) { + var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName); + if (normalizedTargetPaths === void 0) { + return void 0; + } + var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName); + var relativePaths = ts2.flatMap(normalizedSourcePaths, function(sourcePath) { + return ts2.map(normalizedTargetPaths, function(targetPath) { + return ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); + }); + }); + var shortest = ts2.min(relativePaths, ts2.compareNumberOfDirectorySeparators); + if (!shortest) { + return void 0; + } + return ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeJs ? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions) : ts2.removeFileExtension(shortest); + } + function tryGetModuleNameAsNodeModule(_a2, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) { + var path2 = _a2.path, isRedirect = _a2.isRedirect; + var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory; + if (!host.fileExists || !host.readFile) { + return void 0; + } + var parts = ts2.getNodeModulePathParts(path2); + if (!parts) { + return void 0; + } + var preferences = getPreferences(host, userPreferences, options, importingSourceFile); + var moduleSpecifier = path2; + var isPackageRootPath = false; + if (!packageNameOnly) { + var packageRootIndex = parts.packageRootIndex; + var moduleFileName = void 0; + while (true) { + var _c = tryDirectoryWithPackageJson(packageRootIndex), moduleFileToTry = _c.moduleFileToTry, packageRootPath = _c.packageRootPath, blockedByExports = _c.blockedByExports, verbatimFromExports = _c.verbatimFromExports; + if (ts2.getEmitModuleResolutionKind(options) !== ts2.ModuleResolutionKind.Classic) { + if (blockedByExports) { + return void 0; + } + if (verbatimFromExports) { + return moduleFileToTry; + } + } + if (packageRootPath) { + moduleSpecifier = packageRootPath; + isPackageRootPath = true; + break; + } + if (!moduleFileName) + moduleFileName = moduleFileToTry; + packageRootIndex = path2.indexOf(ts2.directorySeparator, packageRootIndex + 1); + if (packageRootIndex === -1) { + moduleSpecifier = removeExtensionAndIndexPostFix(moduleFileName, preferences.ending, options, host); + break; + } + } + } + if (isRedirect && !isPackageRootPath) { + return void 0; + } + var globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); + var pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)); + if (!(ts2.startsWith(sourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && ts2.startsWith(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { + return void 0; + } + var nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1); + var packageName = ts2.getPackageNameFromTypesPackageName(nodeModulesDirectoryName); + return ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? void 0 : packageName; + function tryDirectoryWithPackageJson(packageRootIndex2) { + var _a3, _b2; + var packageRootPath2 = path2.substring(0, packageRootIndex2); + var packageJsonPath = ts2.combinePaths(packageRootPath2, "package.json"); + var moduleFileToTry2 = path2; + var maybeBlockedByTypesVersions = false; + var cachedPackageJson = (_b2 = (_a3 = host.getPackageJsonInfoCache) === null || _a3 === void 0 ? void 0 : _a3.call(host)) === null || _b2 === void 0 ? void 0 : _b2.getPackageJsonInfo(packageJsonPath); + if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { + var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath)); + var importMode = overrideMode || importingSourceFile.impliedNodeFormat; + if (ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(options) === ts2.ModuleResolutionKind.NodeNext) { + var conditions = ["node", importMode === ts2.ModuleKind.ESNext ? "import" : "require", "types"]; + var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path2, packageRootPath2, ts2.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0; + if (fromExports) { + var withJsExtension = !ts2.hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: ts2.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) }; + return __assign16(__assign16({}, withJsExtension), { verbatimFromExports: true }); + } + if (packageJsonContent.exports) { + return { moduleFileToTry: path2, blockedByExports: true }; + } + } + var versionPaths = packageJsonContent.typesVersions ? ts2.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : void 0; + if (versionPaths) { + var subModuleName = path2.slice(packageRootPath2.length + 1); + var fromPaths = tryGetModuleNameFromPaths(subModuleName, versionPaths.paths, getAllowedEndings(preferences.ending, options, importMode), host, options); + if (fromPaths === void 0) { + maybeBlockedByTypesVersions = true; + } else { + moduleFileToTry2 = ts2.combinePaths(packageRootPath2, fromPaths); + } + } + var mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js"; + if (ts2.isString(mainFileRelative) && !(maybeBlockedByTypesVersions && ts2.matchPatternOrExact(ts2.tryParsePatterns(versionPaths.paths), mainFileRelative))) { + var mainExportFile = ts2.toPath(mainFileRelative, packageRootPath2, getCanonicalFileName); + if (ts2.removeFileExtension(mainExportFile) === ts2.removeFileExtension(getCanonicalFileName(moduleFileToTry2))) { + return { packageRootPath: packageRootPath2, moduleFileToTry: moduleFileToTry2 }; + } + } + } else { + var fileName = getCanonicalFileName(moduleFileToTry2.substring(parts.packageRootIndex + 1)); + if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") { + return { moduleFileToTry: moduleFileToTry2, packageRootPath: packageRootPath2 }; + } + } + return { moduleFileToTry: moduleFileToTry2 }; + } + } + function tryGetAnyFileFromPath(host, path2) { + if (!host.fileExists) + return; + var extensions6 = ts2.flatten(ts2.getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { + extension: "json", + isMixedContent: false, + scriptKind: 6 + /* ScriptKind.JSON */ + }])); + for (var _i = 0, extensions_3 = extensions6; _i < extensions_3.length; _i++) { + var e10 = extensions_3[_i]; + var fullPath = path2 + e10; + if (host.fileExists(fullPath)) { + return fullPath; + } + } + } + function getPathsRelativeToRootDirs(path2, rootDirs, getCanonicalFileName) { + return ts2.mapDefined(rootDirs, function(rootDir) { + var relativePath2 = getRelativePathIfInDirectory(path2, rootDir, getCanonicalFileName); + return relativePath2 !== void 0 && isPathRelativeToParent(relativePath2) ? void 0 : relativePath2; + }); + } + function removeExtensionAndIndexPostFix(fileName, ending, options, host) { + if (ts2.fileExtensionIsOneOf(fileName, [ + ".json", + ".mjs", + ".cjs" + /* Extension.Cjs */ + ])) + return fileName; + var noExtension = ts2.removeFileExtension(fileName); + if (fileName === noExtension) + return fileName; + if (ts2.fileExtensionIsOneOf(fileName, [ + ".d.mts", + ".mts", + ".d.cts", + ".cts" + /* Extension.Cts */ + ])) + return noExtension + getJSExtensionForFile(fileName, options); + switch (ending) { + case 0: + var withoutIndex = ts2.removeSuffix(noExtension, "/index"); + if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) { + return noExtension; + } + return withoutIndex; + case 1: + return noExtension; + case 2: + return noExtension + getJSExtensionForFile(fileName, options); + default: + return ts2.Debug.assertNever(ending); + } + } + function getJSExtensionForFile(fileName, options) { + var _a2; + return (_a2 = tryGetJSExtensionForFile(fileName, options)) !== null && _a2 !== void 0 ? _a2 : ts2.Debug.fail("Extension ".concat(ts2.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName)); + } + function tryGetJSExtensionForFile(fileName, options) { + var ext = ts2.tryGetExtensionFromPath(fileName); + switch (ext) { + case ".ts": + case ".d.ts": + return ".js"; + case ".tsx": + return options.jsx === 1 ? ".jsx" : ".js"; + case ".js": + case ".jsx": + case ".json": + return ext; + case ".d.mts": + case ".mts": + case ".mjs": + return ".mjs"; + case ".d.cts": + case ".cts": + case ".cjs": + return ".cjs"; + default: + return void 0; + } + } + moduleSpecifiers_1.tryGetJSExtensionForFile = tryGetJSExtensionForFile; + function getRelativePathIfInDirectory(path2, directoryPath, getCanonicalFileName) { + var relativePath2 = ts2.getRelativePathToDirectoryOrUrl( + directoryPath, + path2, + directoryPath, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + return ts2.isRootedDiskPath(relativePath2) ? void 0 : relativePath2; + } + function isPathRelativeToParent(path2) { + return ts2.startsWith(path2, ".."); + } + })(moduleSpecifiers = ts2.moduleSpecifiers || (ts2.moduleSpecifiers = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var sysFormatDiagnosticsHost = ts2.sys ? { + getCurrentDirectory: function() { + return ts2.sys.getCurrentDirectory(); + }, + getNewLine: function() { + return ts2.sys.newLine; + }, + getCanonicalFileName: ts2.createGetCanonicalFileName(ts2.sys.useCaseSensitiveFileNames) + } : void 0; + function createDiagnosticReporter(system, pretty) { + var host = system === ts2.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : { + getCurrentDirectory: function() { + return system.getCurrentDirectory(); + }, + getNewLine: function() { + return system.newLine; + }, + getCanonicalFileName: ts2.createGetCanonicalFileName(system.useCaseSensitiveFileNames) + }; + if (!pretty) { + return function(diagnostic) { + return system.write(ts2.formatDiagnostic(diagnostic, host)); + }; + } + var diagnostics = new Array(1); + return function(diagnostic) { + diagnostics[0] = diagnostic; + system.write(ts2.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); + diagnostics[0] = void 0; + }; + } + ts2.createDiagnosticReporter = createDiagnosticReporter; + function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { + if (system.clearScreen && !options.preserveWatchOutput && !options.extendedDiagnostics && !options.diagnostics && ts2.contains(ts2.screenStartingMessageCodes, diagnostic.code)) { + system.clearScreen(); + return true; + } + return false; + } + ts2.screenStartingMessageCodes = [ + ts2.Diagnostics.Starting_compilation_in_watch_mode.code, + ts2.Diagnostics.File_change_detected_Starting_incremental_compilation.code + ]; + function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) { + return ts2.contains(ts2.screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; + } + function getLocaleTimeString(system) { + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( + // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. + // This branch is solely for testing, so just switch it to a normal space for baseline stability. + // See: + // - https://github.com/nodejs/node/issues/45171 + // - https://github.com/nodejs/node/issues/45753 + system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ") + ); + } + ts2.getLocaleTimeString = getLocaleTimeString; + function createWatchStatusReporter(system, pretty) { + return pretty ? function(diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = "[".concat(ts2.formatColorAndReset(getLocaleTimeString(system), ts2.ForegroundColorEscapeSequences.Grey), "] "); + output += "".concat(ts2.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine); + system.write(output); + } : function(diagnostic, newLine, options) { + var output = ""; + if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) { + output += newLine; + } + output += "".concat(getLocaleTimeString(system), " - "); + output += "".concat(ts2.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine)); + system.write(output); + }; + } + ts2.createWatchStatusReporter = createWatchStatusReporter; + function parseConfigFileWithSystem(configFileName, optionsToExtend, extendedConfigCache, watchOptionsToExtend, system, reportDiagnostic) { + var host = system; + host.onUnRecoverableConfigFileDiagnostic = function(diagnostic) { + return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); + }; + var result2 = ts2.getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend); + host.onUnRecoverableConfigFileDiagnostic = void 0; + return result2; + } + ts2.parseConfigFileWithSystem = parseConfigFileWithSystem; + function getErrorCountForSummary(diagnostics) { + return ts2.countWhere(diagnostics, function(diagnostic) { + return diagnostic.category === ts2.DiagnosticCategory.Error; + }); + } + ts2.getErrorCountForSummary = getErrorCountForSummary; + function getFilesInErrorForSummary(diagnostics) { + var filesInError = ts2.filter(diagnostics, function(diagnostic) { + return diagnostic.category === ts2.DiagnosticCategory.Error; + }).map(function(errorDiagnostic) { + if (errorDiagnostic.file === void 0) + return; + return "".concat(errorDiagnostic.file.fileName); + }); + return filesInError.map(function(fileName) { + var diagnosticForFileName = ts2.find(diagnostics, function(diagnostic) { + return diagnostic.file !== void 0 && diagnostic.file.fileName === fileName; + }); + if (diagnosticForFileName !== void 0) { + var line = ts2.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line; + return { + fileName, + line: line + 1 + }; + } + }); + } + ts2.getFilesInErrorForSummary = getFilesInErrorForSummary; + function getWatchErrorSummaryDiagnosticMessage(errorCount) { + return errorCount === 1 ? ts2.Diagnostics.Found_1_error_Watching_for_file_changes : ts2.Diagnostics.Found_0_errors_Watching_for_file_changes; + } + ts2.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage; + function prettyPathForFileError(error2, cwd3) { + var line = ts2.formatColorAndReset(":" + error2.line, ts2.ForegroundColorEscapeSequences.Grey); + if (ts2.pathIsAbsolute(error2.fileName) && ts2.pathIsAbsolute(cwd3)) { + return ts2.getRelativePathFromDirectory( + cwd3, + error2.fileName, + /* ignoreCase */ + false + ) + line; + } + return error2.fileName + line; + } + function getErrorSummaryText(errorCount, filesInError, newLine, host) { + if (errorCount === 0) + return ""; + var nonNilFiles = filesInError.filter(function(fileInError) { + return fileInError !== void 0; + }); + var distinctFileNamesWithLines = nonNilFiles.map(function(fileInError) { + return "".concat(fileInError.fileName, ":").concat(fileInError.line); + }).filter(function(value2, index4, self2) { + return self2.indexOf(value2) === index4; + }); + var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory()); + var d7 = errorCount === 1 ? ts2.createCompilerDiagnostic(filesInError[0] !== void 0 ? ts2.Diagnostics.Found_1_error_in_1 : ts2.Diagnostics.Found_1_error, errorCount, firstFileReference) : ts2.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ? ts2.Diagnostics.Found_0_errors : distinctFileNamesWithLines.length === 1 ? ts2.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 : ts2.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length); + var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : ""; + return "".concat(newLine).concat(ts2.flattenDiagnosticMessageText(d7.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix); + } + ts2.getErrorSummaryText = getErrorSummaryText; + function createTabularErrorsDisplay(filesInError, host) { + var distinctFiles = filesInError.filter(function(value2, index4, self2) { + return index4 === self2.findIndex(function(file) { + return (file === null || file === void 0 ? void 0 : file.fileName) === (value2 === null || value2 === void 0 ? void 0 : value2.fileName); + }); + }); + if (distinctFiles.length === 0) + return ""; + var numberLength = function(num) { + return Math.log(num) * Math.LOG10E + 1; + }; + var fileToErrorCount = distinctFiles.map(function(file) { + return [file, ts2.countWhere(filesInError, function(fileInError) { + return fileInError.fileName === file.fileName; + })]; + }); + var maxErrors = fileToErrorCount.reduce(function(acc, value2) { + return Math.max(acc, value2[1] || 0); + }, 0); + var headerRow = ts2.Diagnostics.Errors_Files.message; + var leftColumnHeadingLength = headerRow.split(" ")[0].length; + var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors)); + var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0); + var tabularData = ""; + tabularData += " ".repeat(headerPadding) + headerRow + "\n"; + fileToErrorCount.forEach(function(row) { + var file = row[0], errorCount = row[1]; + var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0; + var leftPadding = errorCountDigitsLength < leftPaddingGoal ? " ".repeat(leftPaddingGoal - errorCountDigitsLength) : ""; + var fileRef = prettyPathForFileError(file, host.getCurrentDirectory()); + tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n"); + }); + return tabularData; + } + function isBuilderProgram(program) { + return !!program.getState; + } + ts2.isBuilderProgram = isBuilderProgram; + function listFiles(program, write) { + var options = program.getCompilerOptions(); + if (options.explainFiles) { + explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write); + } else if (options.listFiles || options.listFilesOnly) { + ts2.forEach(program.getSourceFiles(), function(file) { + write(file.fileName); + }); + } + } + ts2.listFiles = listFiles; + function explainFiles(program, write) { + var _a2, _b; + var reasons = program.getFileIncludeReasons(); + var getCanonicalFileName = ts2.createGetCanonicalFileName(program.useCaseSensitiveFileNames()); + var relativeFileName = function(fileName) { + return ts2.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); + }; + for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) { + var file = _c[_i]; + write("".concat(toFileName(file, relativeFileName))); + (_a2 = reasons.get(file.path)) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(reason) { + return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); + }); + (_b = explainIfFileIsRedirectAndImpliedFormat(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function(d7) { + return write(" ".concat(d7.messageText)); + }); + } + } + ts2.explainFiles = explainFiles; + function explainIfFileIsRedirectAndImpliedFormat(file, fileNameConvertor) { + var _a2; + var result2; + if (file.path !== file.resolvedPath) { + (result2 !== null && result2 !== void 0 ? result2 : result2 = []).push(ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.File_is_output_of_project_reference_source_0, + toFileName(file.originalFileName, fileNameConvertor) + )); + } + if (file.redirectInfo) { + (result2 !== null && result2 !== void 0 ? result2 : result2 = []).push(ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.File_redirects_to_file_0, + toFileName(file.redirectInfo.redirectTarget, fileNameConvertor) + )); + } + if (ts2.isExternalOrCommonJsModule(file)) { + switch (file.impliedNodeFormat) { + case ts2.ModuleKind.ESNext: + if (file.packageJsonScope) { + (result2 !== null && result2 !== void 0 ? result2 : result2 = []).push(ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.File_is_ECMAScript_module_because_0_has_field_type_with_value_module, + toFileName(ts2.last(file.packageJsonLocations), fileNameConvertor) + )); + } + break; + case ts2.ModuleKind.CommonJS: + if (file.packageJsonScope) { + (result2 !== null && result2 !== void 0 ? result2 : result2 = []).push(ts2.chainDiagnosticMessages( + /*details*/ + void 0, + file.packageJsonScope.contents.packageJsonContent.type ? ts2.Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module : ts2.Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, + toFileName(ts2.last(file.packageJsonLocations), fileNameConvertor) + )); + } else if ((_a2 = file.packageJsonLocations) === null || _a2 === void 0 ? void 0 : _a2.length) { + (result2 !== null && result2 !== void 0 ? result2 : result2 = []).push(ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.File_is_CommonJS_module_because_package_json_was_not_found + )); + } + break; + } + } + return result2; + } + ts2.explainIfFileIsRedirectAndImpliedFormat = explainIfFileIsRedirectAndImpliedFormat; + function getMatchedFileSpec(program, fileName) { + var _a2; + var configFile = program.getCompilerOptions().configFile; + if (!((_a2 = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a2 === void 0 ? void 0 : _a2.validatedFilesSpec)) + return void 0; + var getCanonicalFileName = ts2.createGetCanonicalFileName(program.useCaseSensitiveFileNames()); + var filePath = getCanonicalFileName(fileName); + var basePath = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); + return ts2.find(configFile.configFileSpecs.validatedFilesSpec, function(fileSpec) { + return getCanonicalFileName(ts2.getNormalizedAbsolutePath(fileSpec, basePath)) === filePath; + }); + } + ts2.getMatchedFileSpec = getMatchedFileSpec; + function getMatchedIncludeSpec(program, fileName) { + var _a2, _b; + var configFile = program.getCompilerOptions().configFile; + if (!((_a2 = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a2 === void 0 ? void 0 : _a2.validatedIncludeSpecs)) + return void 0; + if (configFile.configFileSpecs.isDefaultIncludeSpec) + return true; + var isJsonFile = ts2.fileExtensionIs( + fileName, + ".json" + /* Extension.Json */ + ); + var basePath = ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); + var useCaseSensitiveFileNames = program.useCaseSensitiveFileNames(); + return ts2.find((_b = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs, function(includeSpec) { + if (isJsonFile && !ts2.endsWith( + includeSpec, + ".json" + /* Extension.Json */ + )) + return false; + var pattern5 = ts2.getPatternFromSpec(includeSpec, basePath, "files"); + return !!pattern5 && ts2.getRegexFromPattern("(".concat(pattern5, ")$"), useCaseSensitiveFileNames).test(fileName); + }); + } + ts2.getMatchedIncludeSpec = getMatchedIncludeSpec; + function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) { + var _a2, _b; + var options = program.getCompilerOptions(); + if (ts2.isReferencedFile(reason)) { + var referenceLocation = ts2.getReferencedFileLocation(function(path2) { + return program.getSourceFileByPath(path2); + }, reason); + var referenceText = ts2.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : '"'.concat(referenceLocation.text, '"'); + var message = void 0; + ts2.Debug.assert(ts2.isReferenceFileLocation(referenceLocation) || reason.kind === ts2.FileIncludeKind.Import, "Only synthetic references are imports"); + switch (reason.kind) { + case ts2.FileIncludeKind.Import: + if (ts2.isReferenceFileLocation(referenceLocation)) { + message = referenceLocation.packageId ? ts2.Diagnostics.Imported_via_0_from_file_1_with_packageId_2 : ts2.Diagnostics.Imported_via_0_from_file_1; + } else if (referenceLocation.text === ts2.externalHelpersModuleNameText) { + message = referenceLocation.packageId ? ts2.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions : ts2.Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions; + } else { + message = referenceLocation.packageId ? ts2.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions : ts2.Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions; + } + break; + case ts2.FileIncludeKind.ReferenceFile: + ts2.Debug.assert(!referenceLocation.packageId); + message = ts2.Diagnostics.Referenced_via_0_from_file_1; + break; + case ts2.FileIncludeKind.TypeReferenceDirective: + message = referenceLocation.packageId ? ts2.Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2 : ts2.Diagnostics.Type_library_referenced_via_0_from_file_1; + break; + case ts2.FileIncludeKind.LibReferenceDirective: + ts2.Debug.assert(!referenceLocation.packageId); + message = ts2.Diagnostics.Library_referenced_via_0_from_file_1; + break; + default: + ts2.Debug.assertNever(reason); + } + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + message, + referenceText, + toFileName(referenceLocation.file, fileNameConvertor), + referenceLocation.packageId && ts2.packageIdToString(referenceLocation.packageId) + ); + } + switch (reason.kind) { + case ts2.FileIncludeKind.RootFile: + if (!((_a2 = options.configFile) === null || _a2 === void 0 ? void 0 : _a2.configFileSpecs)) + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Root_file_specified_for_compilation + ); + var fileName = ts2.getNormalizedAbsolutePath(program.getRootFileNames()[reason.index], program.getCurrentDirectory()); + var matchedByFiles = getMatchedFileSpec(program, fileName); + if (matchedByFiles) + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Part_of_files_list_in_tsconfig_json + ); + var matchedByInclude = getMatchedIncludeSpec(program, fileName); + return ts2.isString(matchedByInclude) ? ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Matched_by_include_pattern_0_in_1, + matchedByInclude, + toFileName(options.configFile, fileNameConvertor) + ) : ( + // Could be additional files specified as roots or matched by default include + ts2.chainDiagnosticMessages( + /*details*/ + void 0, + matchedByInclude ? ts2.Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk : ts2.Diagnostics.Root_file_specified_for_compilation + ) + ); + case ts2.FileIncludeKind.SourceFromProjectReference: + case ts2.FileIncludeKind.OutputFromProjectReference: + var isOutput = reason.kind === ts2.FileIncludeKind.OutputFromProjectReference; + var referencedResolvedRef = ts2.Debug.checkDefined((_b = program.getResolvedProjectReferences()) === null || _b === void 0 ? void 0 : _b[reason.index]); + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.outFile(options) ? isOutput ? ts2.Diagnostics.Output_from_referenced_project_0_included_because_1_specified : ts2.Diagnostics.Source_from_referenced_project_0_included_because_1_specified : isOutput ? ts2.Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none : ts2.Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none, + toFileName(referencedResolvedRef.sourceFile.fileName, fileNameConvertor), + options.outFile ? "--outFile" : "--out" + ); + case ts2.FileIncludeKind.AutomaticTypeDirectiveFile: + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + options.types ? reason.packageId ? ts2.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1 : ts2.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions : reason.packageId ? ts2.Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1 : ts2.Diagnostics.Entry_point_for_implicit_type_library_0, + reason.typeReference, + reason.packageId && ts2.packageIdToString(reason.packageId) + ); + case ts2.FileIncludeKind.LibFile: + if (reason.index !== void 0) + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + ts2.Diagnostics.Library_0_specified_in_compilerOptions, + options.lib[reason.index] + ); + var target = ts2.forEachEntry(ts2.targetOptionDeclaration.type, function(value2, key) { + return value2 === ts2.getEmitScriptTarget(options) ? key : void 0; + }); + return ts2.chainDiagnosticMessages( + /*details*/ + void 0, + target ? ts2.Diagnostics.Default_library_for_target_0 : ts2.Diagnostics.Default_library, + target + ); + default: + ts2.Debug.assertNever(reason); + } + } + ts2.fileIncludeReasonToDiagnostics = fileIncludeReasonToDiagnostics; + function toFileName(file, fileNameConvertor) { + var fileName = ts2.isString(file) ? file : file.fileName; + return fileNameConvertor ? fileNameConvertor(fileName) : fileName; + } + function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var isListFilesOnly = !!program.getCompilerOptions().listFilesOnly; + var allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); + var configFileParsingDiagnosticsLength = allDiagnostics.length; + ts2.addRange(allDiagnostics, program.getSyntacticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + )); + if (allDiagnostics.length === configFileParsingDiagnosticsLength) { + ts2.addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken)); + if (!isListFilesOnly) { + ts2.addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken)); + if (allDiagnostics.length === configFileParsingDiagnosticsLength) { + ts2.addRange(allDiagnostics, program.getSemanticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + )); + } + } + } + var emitResult = isListFilesOnly ? { emitSkipped: true, diagnostics: ts2.emptyArray } : program.emit( + /*targetSourceFile*/ + void 0, + writeFile2, + cancellationToken, + emitOnlyDtsFiles, + customTransformers + ); + var emittedFiles = emitResult.emittedFiles, emitDiagnostics = emitResult.diagnostics; + ts2.addRange(allDiagnostics, emitDiagnostics); + var diagnostics = ts2.sortAndDeduplicateDiagnostics(allDiagnostics); + diagnostics.forEach(reportDiagnostic); + if (write) { + var currentDir_1 = program.getCurrentDirectory(); + ts2.forEach(emittedFiles, function(file) { + var filepath = ts2.getNormalizedAbsolutePath(file, currentDir_1); + write("TSFILE: ".concat(filepath)); + }); + listFiles(program, write); + } + if (reportSummary) { + reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics)); + } + return { + emitResult, + diagnostics + }; + } + ts2.emitFilesAndReportErrors = emitFilesAndReportErrors; + function emitFilesAndReportErrorsAndGetExitStatus(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var _a2 = emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers), emitResult = _a2.emitResult, diagnostics = _a2.diagnostics; + if (emitResult.emitSkipped && diagnostics.length > 0) { + return ts2.ExitStatus.DiagnosticsPresent_OutputsSkipped; + } else if (diagnostics.length > 0) { + return ts2.ExitStatus.DiagnosticsPresent_OutputsGenerated; + } + return ts2.ExitStatus.Success; + } + ts2.emitFilesAndReportErrorsAndGetExitStatus = emitFilesAndReportErrorsAndGetExitStatus; + ts2.noopFileWatcher = { close: ts2.noop }; + ts2.returnNoopFileWatcher = function() { + return ts2.noopFileWatcher; + }; + function createWatchHost(system, reportWatchStatus) { + if (system === void 0) { + system = ts2.sys; + } + var onWatchStatusChange = reportWatchStatus || createWatchStatusReporter(system); + return { + onWatchStatusChange, + watchFile: ts2.maybeBind(system, system.watchFile) || ts2.returnNoopFileWatcher, + watchDirectory: ts2.maybeBind(system, system.watchDirectory) || ts2.returnNoopFileWatcher, + setTimeout: ts2.maybeBind(system, system.setTimeout) || ts2.noop, + clearTimeout: ts2.maybeBind(system, system.clearTimeout) || ts2.noop + }; + } + ts2.createWatchHost = createWatchHost; + ts2.WatchType = { + ConfigFile: "Config file", + ExtendedConfigFile: "Extended config file", + SourceFile: "Source file", + MissingFile: "Missing file", + WildcardDirectory: "Wild card directory", + FailedLookupLocations: "Failed Lookup Locations", + AffectingFileLocation: "File location affecting resolution", + TypeRoots: "Type roots", + ConfigFileOfReferencedProject: "Config file of referened project", + ExtendedConfigOfReferencedProject: "Extended config file of referenced project", + WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project", + PackageJson: "package.json file", + ClosedScriptInfo: "Closed Script info", + ConfigFileForInferredRoot: "Config file for the inferred project root", + NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache", + MissingSourceMapFile: "Missing source map file", + NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root", + MissingGeneratedFile: "Missing generated file", + NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation" + }; + function createWatchFactory(host, options) { + var watchLogLevel = host.trace ? options.extendedDiagnostics ? ts2.WatchLogLevel.Verbose : options.diagnostics ? ts2.WatchLogLevel.TriggerOnly : ts2.WatchLogLevel.None : ts2.WatchLogLevel.None; + var writeLog = watchLogLevel !== ts2.WatchLogLevel.None ? function(s7) { + return host.trace(s7); + } : ts2.noop; + var result2 = ts2.getWatchFactory(host, watchLogLevel, writeLog); + result2.writeLog = writeLog; + return result2; + } + ts2.createWatchFactory = createWatchFactory; + function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost) { + if (directoryStructureHost === void 0) { + directoryStructureHost = host; + } + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var hostGetNewLine = ts2.memoize(function() { + return host.getNewLine(); + }); + var compilerHost = { + getSourceFile: function(fileName, languageVersionOrOptions, onError) { + var text; + try { + ts2.performance.mark("beforeIORead"); + var encoding = getCompilerOptions().charset; + text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding); + ts2.performance.mark("afterIORead"); + ts2.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + text = ""; + } + return text !== void 0 ? ts2.createSourceFile(fileName, text, languageVersionOrOptions) : void 0; + }, + getDefaultLibLocation: ts2.maybeBind(host, host.getDefaultLibLocation), + getDefaultLibFileName: function(options) { + return host.getDefaultLibFileName(options); + }, + writeFile: writeFile2, + getCurrentDirectory: ts2.memoize(function() { + return host.getCurrentDirectory(); + }), + useCaseSensitiveFileNames: function() { + return useCaseSensitiveFileNames; + }, + getCanonicalFileName: ts2.createGetCanonicalFileName(useCaseSensitiveFileNames), + getNewLine: function() { + return ts2.getNewLineCharacter(getCompilerOptions(), hostGetNewLine); + }, + fileExists: function(f8) { + return host.fileExists(f8); + }, + readFile: function(f8) { + return host.readFile(f8); + }, + trace: ts2.maybeBind(host, host.trace), + directoryExists: ts2.maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: ts2.maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: ts2.maybeBind(host, host.realpath), + getEnvironmentVariable: ts2.maybeBind(host, host.getEnvironmentVariable) || function() { + return ""; + }, + createHash: ts2.maybeBind(host, host.createHash), + readDirectory: ts2.maybeBind(host, host.readDirectory), + disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature, + storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit + }; + return compilerHost; + function writeFile2(fileName, text, writeByteOrderMark, onError) { + try { + ts2.performance.mark("beforeIOWrite"); + ts2.writeFileEnsuringDirectories(fileName, text, writeByteOrderMark, function(path2, data, writeByteOrderMark2) { + return host.writeFile(path2, data, writeByteOrderMark2); + }, function(path2) { + return host.createDirectory(path2); + }, function(path2) { + return host.directoryExists(path2); + }); + ts2.performance.mark("afterIOWrite"); + ts2.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + } + } + } + ts2.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost; + function setGetSourceFileAsHashVersioned(compilerHost) { + var originalGetSourceFile = compilerHost.getSourceFile; + var computeHash = ts2.maybeBind(compilerHost, compilerHost.createHash) || ts2.generateDjb2Hash; + compilerHost.getSourceFile = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var result2 = originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray9([compilerHost], args, false)); + if (result2) { + result2.version = computeHash(result2.text); + } + return result2; + }; + } + ts2.setGetSourceFileAsHashVersioned = setGetSourceFileAsHashVersioned; + function createProgramHost(system, createProgram) { + var getDefaultLibLocation = ts2.memoize(function() { + return ts2.getDirectoryPath(ts2.normalizePath(system.getExecutingFilePath())); + }); + return { + useCaseSensitiveFileNames: function() { + return system.useCaseSensitiveFileNames; + }, + getNewLine: function() { + return system.newLine; + }, + getCurrentDirectory: ts2.memoize(function() { + return system.getCurrentDirectory(); + }), + getDefaultLibLocation, + getDefaultLibFileName: function(options) { + return ts2.combinePaths(getDefaultLibLocation(), ts2.getDefaultLibFileName(options)); + }, + fileExists: function(path2) { + return system.fileExists(path2); + }, + readFile: function(path2, encoding) { + return system.readFile(path2, encoding); + }, + directoryExists: function(path2) { + return system.directoryExists(path2); + }, + getDirectories: function(path2) { + return system.getDirectories(path2); + }, + readDirectory: function(path2, extensions6, exclude, include, depth) { + return system.readDirectory(path2, extensions6, exclude, include, depth); + }, + realpath: ts2.maybeBind(system, system.realpath), + getEnvironmentVariable: ts2.maybeBind(system, system.getEnvironmentVariable), + trace: function(s7) { + return system.write(s7 + system.newLine); + }, + createDirectory: function(path2) { + return system.createDirectory(path2); + }, + writeFile: function(path2, data, writeByteOrderMark) { + return system.writeFile(path2, data, writeByteOrderMark); + }, + createHash: ts2.maybeBind(system, system.createHash), + createProgram: createProgram || ts2.createEmitAndSemanticDiagnosticsBuilderProgram, + disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature, + storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit, + now: ts2.maybeBind(system, system.now) + }; + } + ts2.createProgramHost = createProgramHost; + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { + if (system === void 0) { + system = ts2.sys; + } + var write = function(s7) { + return system.write(s7 + system.newLine); + }; + var result2 = createProgramHost(system, createProgram); + ts2.copyProperties(result2, createWatchHost(system, reportWatchStatus)); + result2.afterProgramCreate = function(builderProgram) { + var compilerOptions = builderProgram.getCompilerOptions(); + var newLine = ts2.getNewLineCharacter(compilerOptions, function() { + return system.newLine; + }); + emitFilesAndReportErrors(builderProgram, reportDiagnostic, write, function(errorCount) { + return result2.onWatchStatusChange(ts2.createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), newLine, compilerOptions, errorCount); + }); + }; + return result2; + } + function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { + reportDiagnostic(diagnostic); + system.exit(ts2.ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + function createWatchCompilerHostOfConfigFile(_a2) { + var configFileName = _a2.configFileName, optionsToExtend = _a2.optionsToExtend, watchOptionsToExtend = _a2.watchOptionsToExtend, extraFileExtensions = _a2.extraFileExtensions, system = _a2.system, createProgram = _a2.createProgram, reportDiagnostic = _a2.reportDiagnostic, reportWatchStatus = _a2.reportWatchStatus; + var diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system); + var host = createWatchCompilerHost(system, createProgram, diagnosticReporter, reportWatchStatus); + host.onUnRecoverableConfigFileDiagnostic = function(diagnostic) { + return reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); + }; + host.configFileName = configFileName; + host.optionsToExtend = optionsToExtend; + host.watchOptionsToExtend = watchOptionsToExtend; + host.extraFileExtensions = extraFileExtensions; + return host; + } + ts2.createWatchCompilerHostOfConfigFile = createWatchCompilerHostOfConfigFile; + function createWatchCompilerHostOfFilesAndCompilerOptions(_a2) { + var rootFiles = _a2.rootFiles, options = _a2.options, watchOptions = _a2.watchOptions, projectReferences = _a2.projectReferences, system = _a2.system, createProgram = _a2.createProgram, reportDiagnostic = _a2.reportDiagnostic, reportWatchStatus = _a2.reportWatchStatus; + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus); + host.rootFiles = rootFiles; + host.options = options; + host.watchOptions = watchOptions; + host.projectReferences = projectReferences; + return host; + } + ts2.createWatchCompilerHostOfFilesAndCompilerOptions = createWatchCompilerHostOfFilesAndCompilerOptions; + function performIncrementalCompilation(input) { + var system = input.system || ts2.sys; + var host = input.host || (input.host = ts2.createIncrementalCompilerHost(input.options, system)); + var builderProgram = ts2.createIncrementalProgram(input); + var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function(s7) { + return host.trace && host.trace(s7); + }, input.reportErrorSummary || input.options.pretty ? function(errorCount, filesInError) { + return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)); + } : void 0); + if (input.afterProgramEmitAndDiagnostics) + input.afterProgramEmitAndDiagnostics(builderProgram); + return exitStatus; + } + ts2.performIncrementalCompilation = performIncrementalCompilation; + })(ts || (ts = {})); + var ts; + (function(ts2) { + function readBuilderProgram(compilerOptions, host) { + var buildInfoPath = ts2.getTsBuildInfoEmitOutputFilePath(compilerOptions); + if (!buildInfoPath) + return void 0; + var buildInfo; + if (host.getBuildInfo) { + buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath); + } else { + var content = host.readFile(buildInfoPath); + if (!content) + return void 0; + buildInfo = ts2.getBuildInfo(buildInfoPath, content); + } + if (!buildInfo || buildInfo.version !== ts2.version || !buildInfo.program) + return void 0; + return ts2.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host); + } + ts2.readBuilderProgram = readBuilderProgram; + function createIncrementalCompilerHost(options, system) { + if (system === void 0) { + system = ts2.sys; + } + var host = ts2.createCompilerHostWorker( + options, + /*setParentNodes*/ + void 0, + system + ); + host.createHash = ts2.maybeBind(system, system.createHash); + host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature; + host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit; + ts2.setGetSourceFileAsHashVersioned(host); + ts2.changeCompilerHostLikeToUseCache(host, function(fileName) { + return ts2.toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName); + }); + return host; + } + ts2.createIncrementalCompilerHost = createIncrementalCompilerHost; + function createIncrementalProgram(_a2) { + var rootNames = _a2.rootNames, options = _a2.options, configFileParsingDiagnostics = _a2.configFileParsingDiagnostics, projectReferences = _a2.projectReferences, host = _a2.host, createProgram = _a2.createProgram; + host = host || createIncrementalCompilerHost(options); + createProgram = createProgram || ts2.createEmitAndSemanticDiagnosticsBuilderProgram; + var oldProgram = readBuilderProgram(options, host); + return createProgram(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences); + } + ts2.createIncrementalProgram = createIncrementalProgram; + function createWatchCompilerHost(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus, projectReferencesOrWatchOptionsToExtend, watchOptionsOrExtraFileExtensions) { + if (ts2.isArray(rootFilesOrConfigFileName)) { + return ts2.createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles: rootFilesOrConfigFileName, + options, + watchOptions: watchOptionsOrExtraFileExtensions, + projectReferences: projectReferencesOrWatchOptionsToExtend, + system, + createProgram, + reportDiagnostic, + reportWatchStatus + }); + } else { + return ts2.createWatchCompilerHostOfConfigFile({ + configFileName: rootFilesOrConfigFileName, + optionsToExtend: options, + watchOptionsToExtend: projectReferencesOrWatchOptionsToExtend, + extraFileExtensions: watchOptionsOrExtraFileExtensions, + system, + createProgram, + reportDiagnostic, + reportWatchStatus + }); + } + } + ts2.createWatchCompilerHost = createWatchCompilerHost; + function createWatchProgram(host) { + var builderProgram; + var reloadLevel; + var missingFilesMap; + var watchedWildcardDirectories; + var timerToUpdateProgram; + var timerToInvalidateFailedLookupResolutions; + var parsedConfigs; + var sharedExtendedConfigFileWatchers; + var extendedConfigCache = host.extendedConfigCache; + var reportFileChangeDetectedOnCreateProgram = false; + var sourceFilesCache = new ts2.Map(); + var missingFilePathsRequestedForRelease; + var hasChangedCompilerOptions = false; + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var currentDirectory = host.getCurrentDirectory(); + var configFileName = host.configFileName, _a2 = host.optionsToExtend, optionsToExtendForConfigFile = _a2 === void 0 ? {} : _a2, watchOptionsToExtend = host.watchOptionsToExtend, extraFileExtensions = host.extraFileExtensions, createProgram = host.createProgram; + var rootFileNames = host.rootFiles, compilerOptions = host.options, watchOptions = host.watchOptions, projectReferences = host.projectReferences; + var wildcardDirectories; + var configFileParsingDiagnostics; + var canConfigFileJsonReportNoInputFiles = false; + var hasChangedConfigFileParsingErrors = false; + var cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : ts2.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); + var directoryStructureHost = cachedDirectoryStructureHost || host; + var parseConfigFileHost = ts2.parseConfigHostFromCompilerHostLike(host, directoryStructureHost); + var newLine = updateNewLine(); + if (configFileName && host.configFileParsingResult) { + setConfigFileParsingResult(host.configFileParsingResult); + newLine = updateNewLine(); + } + reportWatchDiagnostic(ts2.Diagnostics.Starting_compilation_in_watch_mode); + if (configFileName && !host.configFileParsingResult) { + newLine = ts2.getNewLineCharacter(optionsToExtendForConfigFile, function() { + return host.getNewLine(); + }); + ts2.Debug.assert(!rootFileNames); + parseConfigFile(); + newLine = updateNewLine(); + } + var _b = ts2.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog; + var getCanonicalFileName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames)); + var configFileWatcher; + if (configFileName) { + configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts2.PollingInterval.High, watchOptions, ts2.WatchType.ConfigFile); + } + var compilerHost = ts2.createCompilerHostFromProgramHost(host, function() { + return compilerOptions; + }, directoryStructureHost); + ts2.setGetSourceFileAsHashVersioned(compilerHost); + var getNewSourceFile = compilerHost.getSourceFile; + compilerHost.getSourceFile = function(fileName) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return getVersionedSourceFileByPath.apply(void 0, __spreadArray9([fileName, toPath2(fileName)], args, false)); + }; + compilerHost.getSourceFileByPath = getVersionedSourceFileByPath; + compilerHost.getNewLine = function() { + return newLine; + }; + compilerHost.fileExists = fileExists; + compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; + compilerHost.onReleaseParsedCommandLine = onReleaseParsedCommandLine; + compilerHost.toPath = toPath2; + compilerHost.getCompilationSettings = function() { + return compilerOptions; + }; + compilerHost.useSourceOfProjectReferenceRedirect = ts2.maybeBind(host, host.useSourceOfProjectReferenceRedirect); + compilerHost.watchDirectoryOfFailedLookupLocation = function(dir2, cb, flags) { + return watchDirectory(dir2, cb, flags, watchOptions, ts2.WatchType.FailedLookupLocations); + }; + compilerHost.watchAffectingFileLocation = function(file, cb) { + return watchFile(file, cb, ts2.PollingInterval.High, watchOptions, ts2.WatchType.AffectingFileLocation); + }; + compilerHost.watchTypeRootsDirectory = function(dir2, cb, flags) { + return watchDirectory(dir2, cb, flags, watchOptions, ts2.WatchType.TypeRoots); + }; + compilerHost.getCachedDirectoryStructureHost = function() { + return cachedDirectoryStructureHost; + }; + compilerHost.scheduleInvalidateResolutionsOfFailedLookupLocations = scheduleInvalidateResolutionsOfFailedLookupLocations; + compilerHost.onInvalidatedResolution = scheduleProgramUpdate; + compilerHost.onChangedAutomaticTypeDirectiveNames = scheduleProgramUpdate; + compilerHost.fileIsOpen = ts2.returnFalse; + compilerHost.getCurrentProgram = getCurrentProgram; + compilerHost.writeLog = writeLog; + compilerHost.getParsedCommandLine = getParsedCommandLine; + var resolutionCache = ts2.createResolutionCache( + compilerHost, + configFileName ? ts2.getDirectoryPath(ts2.getNormalizedAbsolutePath(configFileName, currentDirectory)) : currentDirectory, + /*logChangesWhenResolvingModule*/ + false + ); + compilerHost.resolveModuleNames = host.resolveModuleNames ? function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return host.resolveModuleNames.apply(host, args); + } : function(moduleNames, containingFile, reusedNames, redirectedReference, _options, sourceFile) { + return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, sourceFile); + }; + compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ? function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return host.resolveTypeReferenceDirectives.apply(host, args); + } : function(typeDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) { + return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode); + }; + compilerHost.getModuleResolutionCache = host.resolveModuleNames ? ts2.maybeBind(host, host.getModuleResolutionCache) : function() { + return resolutionCache.getModuleResolutionCache(); + }; + var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; + var customHasInvalidatedResolutions = userProvidedResolution ? ts2.maybeBind(host, host.hasInvalidatedResolutions) || ts2.returnTrue : ts2.returnFalse; + builderProgram = readBuilderProgram(compilerOptions, compilerHost); + synchronizeProgram(); + watchConfigFileWildCardDirectories(); + if (configFileName) + updateExtendedConfigFilesWatches(toPath2(configFileName), compilerOptions, watchOptions, ts2.WatchType.ExtendedConfigFile); + return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close }; + function close() { + clearInvalidateResolutionsOfFailedLookupLocations(); + resolutionCache.clear(); + ts2.clearMap(sourceFilesCache, function(value2) { + if (value2 && value2.fileWatcher) { + value2.fileWatcher.close(); + value2.fileWatcher = void 0; + } + }); + if (configFileWatcher) { + configFileWatcher.close(); + configFileWatcher = void 0; + } + extendedConfigCache === null || extendedConfigCache === void 0 ? void 0 : extendedConfigCache.clear(); + extendedConfigCache = void 0; + if (sharedExtendedConfigFileWatchers) { + ts2.clearMap(sharedExtendedConfigFileWatchers, ts2.closeFileWatcherOf); + sharedExtendedConfigFileWatchers = void 0; + } + if (watchedWildcardDirectories) { + ts2.clearMap(watchedWildcardDirectories, ts2.closeFileWatcherOf); + watchedWildcardDirectories = void 0; + } + if (missingFilesMap) { + ts2.clearMap(missingFilesMap, ts2.closeFileWatcher); + missingFilesMap = void 0; + } + if (parsedConfigs) { + ts2.clearMap(parsedConfigs, function(config3) { + var _a3; + (_a3 = config3.watcher) === null || _a3 === void 0 ? void 0 : _a3.close(); + config3.watcher = void 0; + if (config3.watchedDirectories) + ts2.clearMap(config3.watchedDirectories, ts2.closeFileWatcherOf); + config3.watchedDirectories = void 0; + }); + parsedConfigs = void 0; + } + } + function getCurrentBuilderProgram() { + return builderProgram; + } + function getCurrentProgram() { + return builderProgram && builderProgram.getProgramOrUndefined(); + } + function synchronizeProgram() { + writeLog("Synchronizing program"); + clearInvalidateResolutionsOfFailedLookupLocations(); + var program = getCurrentBuilderProgram(); + if (hasChangedCompilerOptions) { + newLine = updateNewLine(); + if (program && ts2.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { + resolutionCache.clear(); + } + } + var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions); + var _a3 = ts2.changeCompilerHostLikeToUseCache(compilerHost, toPath2), originalReadFile = _a3.originalReadFile, originalFileExists = _a3.originalFileExists, originalDirectoryExists = _a3.originalDirectoryExists, originalCreateDirectory = _a3.originalCreateDirectory, originalWriteFile = _a3.originalWriteFile, readFileWithCache = _a3.readFileWithCache; + if (ts2.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, function(path2) { + return getSourceVersion(path2, readFileWithCache); + }, function(fileName) { + return compilerHost.fileExists(fileName); + }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { + if (hasChangedConfigFileParsingErrors) { + if (reportFileChangeDetectedOnCreateProgram) { + reportWatchDiagnostic(ts2.Diagnostics.File_change_detected_Starting_incremental_compilation); + } + builderProgram = createProgram( + /*rootNames*/ + void 0, + /*options*/ + void 0, + compilerHost, + builderProgram, + configFileParsingDiagnostics, + projectReferences + ); + hasChangedConfigFileParsingErrors = false; + } + } else { + if (reportFileChangeDetectedOnCreateProgram) { + reportWatchDiagnostic(ts2.Diagnostics.File_change_detected_Starting_incremental_compilation); + } + createNewProgram(hasInvalidatedResolutions); + } + reportFileChangeDetectedOnCreateProgram = false; + if (host.afterProgramCreate && program !== builderProgram) { + host.afterProgramCreate(builderProgram); + } + compilerHost.readFile = originalReadFile; + compilerHost.fileExists = originalFileExists; + compilerHost.directoryExists = originalDirectoryExists; + compilerHost.createDirectory = originalCreateDirectory; + compilerHost.writeFile = originalWriteFile; + return builderProgram; + } + function createNewProgram(hasInvalidatedResolutions) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: ".concat(JSON.stringify(rootFileNames))); + writeLog(" options: ".concat(JSON.stringify(compilerOptions))); + if (projectReferences) + writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences))); + var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram(); + hasChangedCompilerOptions = false; + hasChangedConfigFileParsingErrors = false; + resolutionCache.startCachingPerDirectoryResolution(); + compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions; + compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + var oldProgram = getCurrentProgram(); + builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); + resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram); + ts2.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = new ts2.Map()), watchMissingFilePath); + if (needsUpdateInTypeRootWatch) { + resolutionCache.updateTypeRootsWatch(); + } + if (missingFilePathsRequestedForRelease) { + for (var _i = 0, missingFilePathsRequestedForRelease_1 = missingFilePathsRequestedForRelease; _i < missingFilePathsRequestedForRelease_1.length; _i++) { + var missingFilePath = missingFilePathsRequestedForRelease_1[_i]; + if (!missingFilesMap.has(missingFilePath)) { + sourceFilesCache.delete(missingFilePath); + } + } + missingFilePathsRequestedForRelease = void 0; + } + } + function updateRootFileNames(files) { + ts2.Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); + rootFileNames = files; + scheduleProgramUpdate(); + } + function updateNewLine() { + return ts2.getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile, function() { + return host.getNewLine(); + }); + } + function toPath2(fileName) { + return ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "boolean"; + } + function isFilePresenceUnknownOnHost(hostSourceFile) { + return typeof hostSourceFile.version === "boolean"; + } + function fileExists(fileName) { + var path2 = toPath2(fileName); + if (isFileMissingOnHost(sourceFilesCache.get(path2))) { + return false; + } + return directoryStructureHost.fileExists(fileName); + } + function getVersionedSourceFileByPath(fileName, path2, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { + var hostSourceFile = sourceFilesCache.get(path2); + if (isFileMissingOnHost(hostSourceFile)) { + return void 0; + } + if (hostSourceFile === void 0 || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile)) { + var sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError); + if (hostSourceFile) { + if (sourceFile) { + hostSourceFile.sourceFile = sourceFile; + hostSourceFile.version = sourceFile.version; + if (!hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher = watchFilePath(path2, fileName, onSourceFileChange, ts2.PollingInterval.Low, watchOptions, ts2.WatchType.SourceFile); + } + } else { + if (hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path2, false); + } + } else { + if (sourceFile) { + var fileWatcher = watchFilePath(path2, fileName, onSourceFileChange, ts2.PollingInterval.Low, watchOptions, ts2.WatchType.SourceFile); + sourceFilesCache.set(path2, { sourceFile, version: sourceFile.version, fileWatcher }); + } else { + sourceFilesCache.set(path2, false); + } + } + return sourceFile; + } + return hostSourceFile.sourceFile; + } + function nextSourceFileVersion(path2) { + var hostSourceFile = sourceFilesCache.get(path2); + if (hostSourceFile !== void 0) { + if (isFileMissingOnHost(hostSourceFile)) { + sourceFilesCache.set(path2, { version: false }); + } else { + hostSourceFile.version = false; + } + } + } + function getSourceVersion(path2, readFileWithCache) { + var hostSourceFile = sourceFilesCache.get(path2); + if (!hostSourceFile) + return void 0; + if (hostSourceFile.version) + return hostSourceFile.version; + var text = readFileWithCache(path2); + return text !== void 0 ? (compilerHost.createHash || ts2.generateDjb2Hash)(text) : void 0; + } + function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) { + var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath); + if (hostSourceFileInfo !== void 0) { + if (isFileMissingOnHost(hostSourceFileInfo)) { + (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); + } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + if (hostSourceFileInfo.fileWatcher) { + hostSourceFileInfo.fileWatcher.close(); + } + sourceFilesCache.delete(oldSourceFile.resolvedPath); + if (!hasSourceFileByPath) { + resolutionCache.removeResolutionsOfFile(oldSourceFile.path); + } + } + } + } + function reportWatchDiagnostic(message) { + if (host.onWatchStatusChange) { + host.onWatchStatusChange(ts2.createCompilerDiagnostic(message), newLine, compilerOptions || optionsToExtendForConfigFile); + } + } + function hasChangedAutomaticTypeDirectiveNames() { + return resolutionCache.hasChangedAutomaticTypeDirectiveNames(); + } + function clearInvalidateResolutionsOfFailedLookupLocations() { + if (!timerToInvalidateFailedLookupResolutions) + return false; + host.clearTimeout(timerToInvalidateFailedLookupResolutions); + timerToInvalidateFailedLookupResolutions = void 0; + return true; + } + function scheduleInvalidateResolutionsOfFailedLookupLocations() { + if (!host.setTimeout || !host.clearTimeout) { + return resolutionCache.invalidateResolutionsOfFailedLookupLocations(); + } + var pending = clearInvalidateResolutionsOfFailedLookupLocations(); + writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : "")); + timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250); + } + function invalidateResolutionsOfFailedLookup() { + timerToInvalidateFailedLookupResolutions = void 0; + if (resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + scheduleProgramUpdate(); + } + } + function scheduleProgramUpdate() { + if (!host.setTimeout || !host.clearTimeout) { + return; + } + if (timerToUpdateProgram) { + host.clearTimeout(timerToUpdateProgram); + } + writeLog("Scheduling update"); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250); + } + function scheduleProgramReload() { + ts2.Debug.assert(!!configFileName); + reloadLevel = ts2.ConfigFileProgramReloadLevel.Full; + scheduleProgramUpdate(); + } + function updateProgramWithWatchStatus() { + timerToUpdateProgram = void 0; + reportFileChangeDetectedOnCreateProgram = true; + updateProgram(); + } + function updateProgram() { + switch (reloadLevel) { + case ts2.ConfigFileProgramReloadLevel.Partial: + ts2.perfLogger.logStartUpdateProgram("PartialConfigReload"); + reloadFileNamesFromConfigFile(); + break; + case ts2.ConfigFileProgramReloadLevel.Full: + ts2.perfLogger.logStartUpdateProgram("FullConfigReload"); + reloadConfigFile(); + break; + default: + ts2.perfLogger.logStartUpdateProgram("SynchronizeProgram"); + synchronizeProgram(); + break; + } + ts2.perfLogger.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); + } + function reloadFileNamesFromConfigFile() { + writeLog("Reloading new file names and options"); + reloadLevel = ts2.ConfigFileProgramReloadLevel.None; + rootFileNames = ts2.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + if (ts2.updateErrorForNoInputFiles(rootFileNames, ts2.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { + hasChangedConfigFileParsingErrors = true; + } + synchronizeProgram(); + } + function reloadConfigFile() { + writeLog("Reloading config file: ".concat(configFileName)); + reloadLevel = ts2.ConfigFileProgramReloadLevel.None; + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.clearCache(); + } + parseConfigFile(); + hasChangedCompilerOptions = true; + synchronizeProgram(); + watchConfigFileWildCardDirectories(); + updateExtendedConfigFilesWatches(toPath2(configFileName), compilerOptions, watchOptions, ts2.WatchType.ExtendedConfigFile); + } + function parseConfigFile() { + setConfigFileParsingResult(ts2.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts2.Map()), watchOptionsToExtend, extraFileExtensions)); + } + function setConfigFileParsingResult(configFileParseResult) { + rootFileNames = configFileParseResult.fileNames; + compilerOptions = configFileParseResult.options; + watchOptions = configFileParseResult.watchOptions; + projectReferences = configFileParseResult.projectReferences; + wildcardDirectories = configFileParseResult.wildcardDirectories; + configFileParsingDiagnostics = ts2.getConfigFileParsingDiagnostics(configFileParseResult).slice(); + canConfigFileJsonReportNoInputFiles = ts2.canJsonReportNoInputFiles(configFileParseResult.raw); + hasChangedConfigFileParsingErrors = true; + } + function getParsedCommandLine(configFileName2) { + var configPath = toPath2(configFileName2); + var config3 = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath); + if (config3) { + if (!config3.reloadLevel) + return config3.parsedCommandLine; + if (config3.parsedCommandLine && config3.reloadLevel === ts2.ConfigFileProgramReloadLevel.Partial && !host.getParsedCommandLine) { + writeLog("Reloading new file names and options"); + var fileNames = ts2.getFileNamesFromConfigSpecs(config3.parsedCommandLine.options.configFile.configFileSpecs, ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(configFileName2), currentDirectory), compilerOptions, parseConfigFileHost); + config3.parsedCommandLine = __assign16(__assign16({}, config3.parsedCommandLine), { fileNames }); + config3.reloadLevel = void 0; + return config3.parsedCommandLine; + } + } + writeLog("Loading config file: ".concat(configFileName2)); + var parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2); + if (config3) { + config3.parsedCommandLine = parsedCommandLine; + config3.reloadLevel = void 0; + } else { + (parsedConfigs || (parsedConfigs = new ts2.Map())).set(configPath, config3 = { parsedCommandLine }); + } + watchReferencedProject(configFileName2, configPath, config3); + return parsedCommandLine; + } + function getParsedCommandLineFromConfigFileHost(configFileName2) { + var onUnRecoverableConfigFileDiagnostic = parseConfigFileHost.onUnRecoverableConfigFileDiagnostic; + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts2.noop; + var parsedCommandLine = ts2.getParsedCommandLineOfConfigFile( + configFileName2, + /*optionsToExtend*/ + void 0, + parseConfigFileHost, + extendedConfigCache || (extendedConfigCache = new ts2.Map()), + watchOptionsToExtend + ); + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = onUnRecoverableConfigFileDiagnostic; + return parsedCommandLine; + } + function onReleaseParsedCommandLine(fileName) { + var _a3; + var path2 = toPath2(fileName); + var config3 = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(path2); + if (!config3) + return; + parsedConfigs.delete(path2); + if (config3.watchedDirectories) + ts2.clearMap(config3.watchedDirectories, ts2.closeFileWatcherOf); + (_a3 = config3.watcher) === null || _a3 === void 0 ? void 0 : _a3.close(); + ts2.clearSharedExtendedConfigFileWatcher(path2, sharedExtendedConfigFileWatchers); + } + function watchFilePath(path2, file, callback, pollingInterval, options, watchType) { + return watchFile(file, function(fileName, eventKind) { + return callback(fileName, eventKind, path2); + }, pollingInterval, options, watchType); + } + function onSourceFileChange(fileName, eventKind, path2) { + updateCachedSystemWithFile(fileName, path2, eventKind); + if (eventKind === ts2.FileWatcherEventKind.Deleted && sourceFilesCache.has(path2)) { + resolutionCache.invalidateResolutionOfFile(path2); + } + nextSourceFileVersion(path2); + scheduleProgramUpdate(); + } + function updateCachedSystemWithFile(fileName, path2, eventKind) { + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFile(fileName, path2, eventKind); + } + } + function watchMissingFilePath(missingFilePath) { + return (parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.has(missingFilePath)) ? ts2.noopFileWatcher : watchFilePath(missingFilePath, missingFilePath, onMissingFileChange, ts2.PollingInterval.Medium, watchOptions, ts2.WatchType.MissingFile); + } + function onMissingFileChange(fileName, eventKind, missingFilePath) { + updateCachedSystemWithFile(fileName, missingFilePath, eventKind); + if (eventKind === ts2.FileWatcherEventKind.Created && missingFilesMap.has(missingFilePath)) { + missingFilesMap.get(missingFilePath).close(); + missingFilesMap.delete(missingFilePath); + nextSourceFileVersion(missingFilePath); + scheduleProgramUpdate(); + } + } + function watchConfigFileWildCardDirectories() { + if (wildcardDirectories) { + ts2.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = new ts2.Map()), new ts2.Map(ts2.getEntries(wildcardDirectories)), watchWildcardDirectory); + } else if (watchedWildcardDirectories) { + ts2.clearMap(watchedWildcardDirectories, ts2.closeFileWatcherOf); + } + } + function watchWildcardDirectory(directory, flags) { + return watchDirectory(directory, function(fileOrDirectory) { + ts2.Debug.assert(!!configFileName); + var fileOrDirectoryPath = toPath2(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + if (ts2.isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath2(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName, + extraFileExtensions, + options: compilerOptions, + program: getCurrentBuilderProgram() || rootFileNames, + currentDirectory, + useCaseSensitiveFileNames, + writeLog, + toPath: toPath2 + })) + return; + if (reloadLevel !== ts2.ConfigFileProgramReloadLevel.Full) { + reloadLevel = ts2.ConfigFileProgramReloadLevel.Partial; + scheduleProgramUpdate(); + } + }, flags, watchOptions, ts2.WatchType.WildcardDirectory); + } + function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + ts2.updateSharedExtendedConfigFileWatcher(forProjectPath, options, sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = new ts2.Map()), function(extendedConfigFileName, extendedConfigFilePath) { + return watchFile(extendedConfigFileName, function(_fileName, eventKind) { + var _a3; + updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind); + if (extendedConfigCache) + ts2.cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath2); + var projects = (_a3 = sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) === null || _a3 === void 0 ? void 0 : _a3.projects; + if (!(projects === null || projects === void 0 ? void 0 : projects.size)) + return; + projects.forEach(function(projectPath) { + if (toPath2(configFileName) === projectPath) { + reloadLevel = ts2.ConfigFileProgramReloadLevel.Full; + } else { + var config3 = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(projectPath); + if (config3) + config3.reloadLevel = ts2.ConfigFileProgramReloadLevel.Full; + resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath); + } + scheduleProgramUpdate(); + }); + }, ts2.PollingInterval.High, watchOptions2, watchType); + }, toPath2); + } + function watchReferencedProject(configFileName2, configPath, commandLine) { + var _a3, _b2, _c, _d, _e2; + commandLine.watcher || (commandLine.watcher = watchFile(configFileName2, function(_fileName, eventKind) { + updateCachedSystemWithFile(configFileName2, configPath, eventKind); + var config3 = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath); + if (config3) + config3.reloadLevel = ts2.ConfigFileProgramReloadLevel.Full; + resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath); + scheduleProgramUpdate(); + }, ts2.PollingInterval.High, ((_a3 = commandLine.parsedCommandLine) === null || _a3 === void 0 ? void 0 : _a3.watchOptions) || watchOptions, ts2.WatchType.ConfigFileOfReferencedProject)); + if ((_b2 = commandLine.parsedCommandLine) === null || _b2 === void 0 ? void 0 : _b2.wildcardDirectories) { + ts2.updateWatchingWildcardDirectories(commandLine.watchedDirectories || (commandLine.watchedDirectories = new ts2.Map()), new ts2.Map(ts2.getEntries((_c = commandLine.parsedCommandLine) === null || _c === void 0 ? void 0 : _c.wildcardDirectories)), function(directory, flags) { + var _a4; + return watchDirectory(directory, function(fileOrDirectory) { + var fileOrDirectoryPath = toPath2(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + var config3 = parsedConfigs === null || parsedConfigs === void 0 ? void 0 : parsedConfigs.get(configPath); + if (!(config3 === null || config3 === void 0 ? void 0 : config3.parsedCommandLine)) + return; + if (ts2.isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath2(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName: configFileName2, + options: config3.parsedCommandLine.options, + program: config3.parsedCommandLine.fileNames, + currentDirectory, + useCaseSensitiveFileNames, + writeLog, + toPath: toPath2 + })) + return; + if (config3.reloadLevel !== ts2.ConfigFileProgramReloadLevel.Full) { + config3.reloadLevel = ts2.ConfigFileProgramReloadLevel.Partial; + scheduleProgramUpdate(); + } + }, flags, ((_a4 = commandLine.parsedCommandLine) === null || _a4 === void 0 ? void 0 : _a4.watchOptions) || watchOptions, ts2.WatchType.WildcardDirectoryOfReferencedProject); + }); + } else if (commandLine.watchedDirectories) { + ts2.clearMap(commandLine.watchedDirectories, ts2.closeFileWatcherOf); + commandLine.watchedDirectories = void 0; + } + updateExtendedConfigFilesWatches(configPath, (_d = commandLine.parsedCommandLine) === null || _d === void 0 ? void 0 : _d.options, ((_e2 = commandLine.parsedCommandLine) === null || _e2 === void 0 ? void 0 : _e2.watchOptions) || watchOptions, ts2.WatchType.ExtendedConfigOfReferencedProject); + } + } + ts2.createWatchProgram = createWatchProgram; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var UpToDateStatusType; + (function(UpToDateStatusType2) { + UpToDateStatusType2[UpToDateStatusType2["Unbuildable"] = 0] = "Unbuildable"; + UpToDateStatusType2[UpToDateStatusType2["UpToDate"] = 1] = "UpToDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithUpstreamTypes"] = 2] = "UpToDateWithUpstreamTypes"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithPrepend"] = 3] = "OutOfDateWithPrepend"; + UpToDateStatusType2[UpToDateStatusType2["OutputMissing"] = 4] = "OutputMissing"; + UpToDateStatusType2[UpToDateStatusType2["ErrorReadingFile"] = 5] = "ErrorReadingFile"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithSelf"] = 6] = "OutOfDateWithSelf"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 9] = "UpstreamOutOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 10] = "UpstreamBlocked"; + UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 11] = "ComputingUpstream"; + UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 12] = "TsVersionOutputOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 13] = "UpToDateWithInputFileText"; + UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 14] = "ContainerOnly"; + UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 15] = "ForceBuild"; + })(UpToDateStatusType = ts2.UpToDateStatusType || (ts2.UpToDateStatusType = {})); + function resolveConfigFileProjectName(project) { + if (ts2.fileExtensionIs( + project, + ".json" + /* Extension.Json */ + )) { + return project; + } + return ts2.combinePaths(project, "tsconfig.json"); + } + ts2.resolveConfigFileProjectName = resolveConfigFileProjectName; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var minimumDate = /* @__PURE__ */ new Date(-864e13); + var maximumDate = /* @__PURE__ */ new Date(864e13); + var BuildResultFlags; + (function(BuildResultFlags2) { + BuildResultFlags2[BuildResultFlags2["None"] = 0] = "None"; + BuildResultFlags2[BuildResultFlags2["Success"] = 1] = "Success"; + BuildResultFlags2[BuildResultFlags2["DeclarationOutputUnchanged"] = 2] = "DeclarationOutputUnchanged"; + BuildResultFlags2[BuildResultFlags2["ConfigFileErrors"] = 4] = "ConfigFileErrors"; + BuildResultFlags2[BuildResultFlags2["SyntaxErrors"] = 8] = "SyntaxErrors"; + BuildResultFlags2[BuildResultFlags2["TypeErrors"] = 16] = "TypeErrors"; + BuildResultFlags2[BuildResultFlags2["DeclarationEmitErrors"] = 32] = "DeclarationEmitErrors"; + BuildResultFlags2[BuildResultFlags2["EmitErrors"] = 64] = "EmitErrors"; + BuildResultFlags2[BuildResultFlags2["AnyErrors"] = 124] = "AnyErrors"; + })(BuildResultFlags || (BuildResultFlags = {})); + function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) { + var existingValue = configFileMap.get(resolved); + var newValue; + if (!existingValue) { + newValue = createT(); + configFileMap.set(resolved, newValue); + } + return existingValue || newValue; + } + function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) { + return getOrCreateValueFromConfigFileMap(configFileMap, resolved, function() { + return new ts2.Map(); + }); + } + function getCurrentTime(host) { + return host.now ? host.now() : /* @__PURE__ */ new Date(); + } + ts2.getCurrentTime = getCurrentTime; + function isCircularBuildOrder(buildOrder) { + return !!buildOrder && !!buildOrder.buildOrder; + } + ts2.isCircularBuildOrder = isCircularBuildOrder; + function getBuildOrderFromAnyBuildOrder(anyBuildOrder) { + return isCircularBuildOrder(anyBuildOrder) ? anyBuildOrder.buildOrder : anyBuildOrder; + } + ts2.getBuildOrderFromAnyBuildOrder = getBuildOrderFromAnyBuildOrder; + function createBuilderStatusReporter(system, pretty) { + return function(diagnostic) { + var output = pretty ? "[".concat(ts2.formatColorAndReset(ts2.getLocaleTimeString(system), ts2.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts2.getLocaleTimeString(system), " - "); + output += "".concat(ts2.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine); + system.write(output); + }; + } + ts2.createBuilderStatusReporter = createBuilderStatusReporter; + function createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus) { + var host = ts2.createProgramHost(system, createProgram); + host.getModifiedTime = system.getModifiedTime ? function(path2) { + return system.getModifiedTime(path2); + } : ts2.returnUndefined; + host.setModifiedTime = system.setModifiedTime ? function(path2, date) { + return system.setModifiedTime(path2, date); + } : ts2.noop; + host.deleteFile = system.deleteFile ? function(path2) { + return system.deleteFile(path2); + } : ts2.noop; + host.reportDiagnostic = reportDiagnostic || ts2.createDiagnosticReporter(system); + host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system); + host.now = ts2.maybeBind(system, system.now); + return host; + } + function createSolutionBuilderHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary2) { + if (system === void 0) { + system = ts2.sys; + } + var host = createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus); + host.reportErrorSummary = reportErrorSummary2; + return host; + } + ts2.createSolutionBuilderHost = createSolutionBuilderHost; + function createSolutionBuilderWithWatchHost(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus2) { + if (system === void 0) { + system = ts2.sys; + } + var host = createSolutionBuilderHostBase(system, createProgram, reportDiagnostic, reportSolutionBuilderStatus); + var watchHost = ts2.createWatchHost(system, reportWatchStatus2); + ts2.copyProperties(host, watchHost); + return host; + } + ts2.createSolutionBuilderWithWatchHost = createSolutionBuilderWithWatchHost; + function getCompilerOptionsOfBuildOptions(buildOptions2) { + var result2 = {}; + ts2.commonOptionsWithBuild.forEach(function(option) { + if (ts2.hasProperty(buildOptions2, option.name)) + result2[option.name] = buildOptions2[option.name]; + }); + return result2; + } + function createSolutionBuilder(host, rootNames, defaultOptions9) { + return createSolutionBuilderWorker( + /*watch*/ + false, + host, + rootNames, + defaultOptions9 + ); + } + ts2.createSolutionBuilder = createSolutionBuilder; + function createSolutionBuilderWithWatch(host, rootNames, defaultOptions9, baseWatchOptions) { + return createSolutionBuilderWorker( + /*watch*/ + true, + host, + rootNames, + defaultOptions9, + baseWatchOptions + ); + } + ts2.createSolutionBuilderWithWatch = createSolutionBuilderWithWatch; + function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { + var host = hostOrHostWithWatch; + var hostWithWatch = hostOrHostWithWatch; + var currentDirectory = host.getCurrentDirectory(); + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); + var compilerHost = ts2.createCompilerHostFromProgramHost(host, function() { + return state.projectCompilerOptions; + }); + ts2.setGetSourceFileAsHashVersioned(compilerHost); + compilerHost.getParsedCommandLine = function(fileName) { + return parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); + }; + compilerHost.resolveModuleNames = ts2.maybeBind(host, host.resolveModuleNames); + compilerHost.resolveTypeReferenceDirectives = ts2.maybeBind(host, host.resolveTypeReferenceDirectives); + compilerHost.getModuleResolutionCache = ts2.maybeBind(host, host.getModuleResolutionCache); + var moduleResolutionCache = !compilerHost.resolveModuleNames ? ts2.createModuleResolutionCache(currentDirectory, getCanonicalFileName) : void 0; + var typeReferenceDirectiveResolutionCache = !compilerHost.resolveTypeReferenceDirectives ? ts2.createTypeReferenceDirectiveResolutionCache( + currentDirectory, + getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() + ) : void 0; + if (!compilerHost.resolveModuleNames) { + var loader_3 = function(moduleName3, resolverMode, containingFile, redirectedReference) { + return ts2.resolveModuleName(moduleName3, containingFile, state.projectCompilerOptions, compilerHost, moduleResolutionCache, redirectedReference, resolverMode).resolvedModule; + }; + compilerHost.resolveModuleNames = function(moduleNames, containingFile, _reusedNames, redirectedReference, _options, containingSourceFile) { + return ts2.loadWithModeAwareCache(ts2.Debug.checkEachDefined(moduleNames), ts2.Debug.checkDefined(containingSourceFile), containingFile, redirectedReference, loader_3); + }; + compilerHost.getModuleResolutionCache = function() { + return moduleResolutionCache; + }; + } + if (!compilerHost.resolveTypeReferenceDirectives) { + var loader_4 = function(moduleName3, containingFile, redirectedReference, containingFileMode) { + return ts2.resolveTypeReferenceDirective(moduleName3, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache, containingFileMode).resolvedTypeReferenceDirective; + }; + compilerHost.resolveTypeReferenceDirectives = function(typeReferenceDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) { + return ts2.loadWithTypeDirectiveCache(ts2.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4); + }; + } + compilerHost.getBuildInfo = function(fileName, configFilePath) { + return getBuildInfo( + state, + fileName, + toResolvedConfigFilePath(state, configFilePath), + /*modifiedTime*/ + void 0 + ); + }; + var _a2 = ts2.createWatchFactory(hostWithWatch, options), watchFile2 = _a2.watchFile, watchDirectory = _a2.watchDirectory, writeLog = _a2.writeLog; + var state = { + host, + hostWithWatch, + currentDirectory, + getCanonicalFileName, + parseConfigFileHost: ts2.parseConfigHostFromCompilerHostLike(host), + write: ts2.maybeBind(host, host.trace), + // State of solution + options, + baseCompilerOptions, + rootNames, + baseWatchOptions, + resolvedConfigFilePaths: new ts2.Map(), + configFileCache: new ts2.Map(), + projectStatus: new ts2.Map(), + extendedConfigCache: new ts2.Map(), + buildInfoCache: new ts2.Map(), + outputTimeStamps: new ts2.Map(), + builderPrograms: new ts2.Map(), + diagnostics: new ts2.Map(), + projectPendingBuild: new ts2.Map(), + projectErrorsReported: new ts2.Map(), + compilerHost, + moduleResolutionCache, + typeReferenceDirectiveResolutionCache, + // Mutable state + buildOrder: void 0, + readFileWithCache: function(f8) { + return host.readFile(f8); + }, + projectCompilerOptions: baseCompilerOptions, + cache: void 0, + allProjectBuildPending: true, + needsSummary: true, + watchAllProjectsPending: watch, + // Watch state + watch, + allWatchedWildcardDirectories: new ts2.Map(), + allWatchedInputFiles: new ts2.Map(), + allWatchedConfigFiles: new ts2.Map(), + allWatchedExtendedConfigFiles: new ts2.Map(), + allWatchedPackageJsonFiles: new ts2.Map(), + filesWatched: new ts2.Map(), + lastCachedPackageJsonLookups: new ts2.Map(), + timerToBuildInvalidatedProject: void 0, + reportFileChangeDetected: false, + watchFile: watchFile2, + watchDirectory, + writeLog + }; + return state; + } + function toPath2(state, fileName) { + return ts2.toPath(fileName, state.currentDirectory, state.getCanonicalFileName); + } + function toResolvedConfigFilePath(state, fileName) { + var resolvedConfigFilePaths = state.resolvedConfigFilePaths; + var path2 = resolvedConfigFilePaths.get(fileName); + if (path2 !== void 0) + return path2; + var resolvedPath = toPath2(state, fileName); + resolvedConfigFilePaths.set(fileName, resolvedPath); + return resolvedPath; + } + function isParsedCommandLine(entry) { + return !!entry.options; + } + function getCachedParsedConfigFile(state, configFilePath) { + var value2 = state.configFileCache.get(configFilePath); + return value2 && isParsedCommandLine(value2) ? value2 : void 0; + } + function parseConfigFile(state, configFileName, configFilePath) { + var configFileCache = state.configFileCache; + var value2 = configFileCache.get(configFilePath); + if (value2) { + return isParsedCommandLine(value2) ? value2 : void 0; + } + ts2.performance.mark("SolutionBuilder::beforeConfigFileParsing"); + var diagnostic; + var parseConfigFileHost = state.parseConfigFileHost, baseCompilerOptions = state.baseCompilerOptions, baseWatchOptions = state.baseWatchOptions, extendedConfigCache = state.extendedConfigCache, host = state.host; + var parsed; + if (host.getParsedCommandLine) { + parsed = host.getParsedCommandLine(configFileName); + if (!parsed) + diagnostic = ts2.createCompilerDiagnostic(ts2.Diagnostics.File_0_not_found, configFileName); + } else { + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = function(d7) { + return diagnostic = d7; + }; + parsed = ts2.getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions); + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts2.noop; + } + configFileCache.set(configFilePath, parsed || diagnostic); + ts2.performance.mark("SolutionBuilder::afterConfigFileParsing"); + ts2.performance.measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing"); + return parsed; + } + function resolveProjectName(state, name2) { + return ts2.resolveConfigFileProjectName(ts2.resolvePath(state.currentDirectory, name2)); + } + function createBuildOrder(state, roots) { + var temporaryMarks = new ts2.Map(); + var permanentMarks = new ts2.Map(); + var circularityReportStack = []; + var buildOrder; + var circularDiagnostics; + for (var _i = 0, roots_1 = roots; _i < roots_1.length; _i++) { + var root2 = roots_1[_i]; + visit7(root2); + } + return circularDiagnostics ? { buildOrder: buildOrder || ts2.emptyArray, circularDiagnostics } : buildOrder || ts2.emptyArray; + function visit7(configFileName, inCircularContext) { + var projPath = toResolvedConfigFilePath(state, configFileName); + if (permanentMarks.has(projPath)) + return; + if (temporaryMarks.has(projPath)) { + if (!inCircularContext) { + (circularDiagnostics || (circularDiagnostics = [])).push(ts2.createCompilerDiagnostic(ts2.Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0, circularityReportStack.join("\r\n"))); + } + return; + } + temporaryMarks.set(projPath, true); + circularityReportStack.push(configFileName); + var parsed = parseConfigFile(state, configFileName, projPath); + if (parsed && parsed.projectReferences) { + for (var _i2 = 0, _a2 = parsed.projectReferences; _i2 < _a2.length; _i2++) { + var ref = _a2[_i2]; + var resolvedRefPath = resolveProjectName(state, ref.path); + visit7(resolvedRefPath, inCircularContext || ref.circular); + } + } + circularityReportStack.pop(); + permanentMarks.set(projPath, true); + (buildOrder || (buildOrder = [])).push(configFileName); + } + } + function getBuildOrder(state) { + return state.buildOrder || createStateBuildOrder(state); + } + function createStateBuildOrder(state) { + var buildOrder = createBuildOrder(state, state.rootNames.map(function(f8) { + return resolveProjectName(state, f8); + })); + state.resolvedConfigFilePaths.clear(); + var currentProjects = new ts2.Map(getBuildOrderFromAnyBuildOrder(buildOrder).map(function(resolved) { + return [toResolvedConfigFilePath(state, resolved), true]; + })); + var noopOnDelete = { onDeleteValue: ts2.noop }; + ts2.mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete); + ts2.mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete); + if (state.watch) { + ts2.mutateMapSkippingNewValues(state.allWatchedConfigFiles, currentProjects, { onDeleteValue: ts2.closeFileWatcher }); + state.allWatchedExtendedConfigFiles.forEach(function(watcher) { + watcher.projects.forEach(function(project) { + if (!currentProjects.has(project)) { + watcher.projects.delete(project); + } + }); + watcher.close(); + }); + ts2.mutateMapSkippingNewValues(state.allWatchedWildcardDirectories, currentProjects, { onDeleteValue: function(existingMap) { + return existingMap.forEach(ts2.closeFileWatcherOf); + } }); + ts2.mutateMapSkippingNewValues(state.allWatchedInputFiles, currentProjects, { onDeleteValue: function(existingMap) { + return existingMap.forEach(ts2.closeFileWatcher); + } }); + ts2.mutateMapSkippingNewValues(state.allWatchedPackageJsonFiles, currentProjects, { onDeleteValue: function(existingMap) { + return existingMap.forEach(ts2.closeFileWatcher); + } }); + } + return state.buildOrder = buildOrder; + } + function getBuildOrderFor(state, project, onlyReferences) { + var resolvedProject = project && resolveProjectName(state, project); + var buildOrderFromState = getBuildOrder(state); + if (isCircularBuildOrder(buildOrderFromState)) + return buildOrderFromState; + if (resolvedProject) { + var projectPath_1 = toResolvedConfigFilePath(state, resolvedProject); + var projectIndex = ts2.findIndex(buildOrderFromState, function(configFileName) { + return toResolvedConfigFilePath(state, configFileName) === projectPath_1; + }); + if (projectIndex === -1) + return void 0; + } + var buildOrder = resolvedProject ? createBuildOrder(state, [resolvedProject]) : buildOrderFromState; + ts2.Debug.assert(!isCircularBuildOrder(buildOrder)); + ts2.Debug.assert(!onlyReferences || resolvedProject !== void 0); + ts2.Debug.assert(!onlyReferences || buildOrder[buildOrder.length - 1] === resolvedProject); + return onlyReferences ? buildOrder.slice(0, buildOrder.length - 1) : buildOrder; + } + function enableCache(state) { + if (state.cache) { + disableCache(state); + } + var compilerHost = state.compilerHost, host = state.host; + var originalReadFileWithCache = state.readFileWithCache; + var originalGetSourceFile = compilerHost.getSourceFile; + var _a2 = ts2.changeCompilerHostLikeToUseCache(host, function(fileName) { + return toPath2(state, fileName); + }, function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray9([compilerHost], args, false)); + }), originalReadFile = _a2.originalReadFile, originalFileExists = _a2.originalFileExists, originalDirectoryExists = _a2.originalDirectoryExists, originalCreateDirectory = _a2.originalCreateDirectory, originalWriteFile = _a2.originalWriteFile, getSourceFileWithCache = _a2.getSourceFileWithCache, readFileWithCache = _a2.readFileWithCache; + state.readFileWithCache = readFileWithCache; + compilerHost.getSourceFile = getSourceFileWithCache; + state.cache = { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + originalReadFileWithCache, + originalGetSourceFile + }; + } + function disableCache(state) { + if (!state.cache) + return; + var cache = state.cache, host = state.host, compilerHost = state.compilerHost, extendedConfigCache = state.extendedConfigCache, moduleResolutionCache = state.moduleResolutionCache, typeReferenceDirectiveResolutionCache = state.typeReferenceDirectiveResolutionCache; + host.readFile = cache.originalReadFile; + host.fileExists = cache.originalFileExists; + host.directoryExists = cache.originalDirectoryExists; + host.createDirectory = cache.originalCreateDirectory; + host.writeFile = cache.originalWriteFile; + compilerHost.getSourceFile = cache.originalGetSourceFile; + state.readFileWithCache = cache.originalReadFileWithCache; + extendedConfigCache.clear(); + moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.clear(); + typeReferenceDirectiveResolutionCache === null || typeReferenceDirectiveResolutionCache === void 0 ? void 0 : typeReferenceDirectiveResolutionCache.clear(); + state.cache = void 0; + } + function clearProjectStatus(state, resolved) { + state.projectStatus.delete(resolved); + state.diagnostics.delete(resolved); + } + function addProjToQueue(_a2, proj, reloadLevel) { + var projectPendingBuild = _a2.projectPendingBuild; + var value2 = projectPendingBuild.get(proj); + if (value2 === void 0) { + projectPendingBuild.set(proj, reloadLevel); + } else if (value2 < reloadLevel) { + projectPendingBuild.set(proj, reloadLevel); + } + } + function setupInitialBuild(state, cancellationToken) { + if (!state.allProjectBuildPending) + return; + state.allProjectBuildPending = false; + if (state.options.watch) + reportWatchStatus(state, ts2.Diagnostics.Starting_compilation_in_watch_mode); + enableCache(state); + var buildOrder = getBuildOrderFromAnyBuildOrder(getBuildOrder(state)); + buildOrder.forEach(function(configFileName) { + return state.projectPendingBuild.set(toResolvedConfigFilePath(state, configFileName), ts2.ConfigFileProgramReloadLevel.None); + }); + if (cancellationToken) { + cancellationToken.throwIfCancellationRequested(); + } + } + var InvalidatedProjectKind; + (function(InvalidatedProjectKind2) { + InvalidatedProjectKind2[InvalidatedProjectKind2["Build"] = 0] = "Build"; + InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateBundle"] = 1] = "UpdateBundle"; + InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateOutputFileStamps"] = 2] = "UpdateOutputFileStamps"; + })(InvalidatedProjectKind = ts2.InvalidatedProjectKind || (ts2.InvalidatedProjectKind = {})); + function doneInvalidatedProject(state, projectPath) { + state.projectPendingBuild.delete(projectPath); + return state.diagnostics.has(projectPath) ? ts2.ExitStatus.DiagnosticsPresent_OutputsSkipped : ts2.ExitStatus.Success; + } + function createUpdateOutputFileStampsProject(state, project, projectPath, config3, buildOrder) { + var updateOutputFileStampsPending = true; + return { + kind: InvalidatedProjectKind.UpdateOutputFileStamps, + project, + projectPath, + buildOrder, + getCompilerOptions: function() { + return config3.options; + }, + getCurrentDirectory: function() { + return state.currentDirectory; + }, + updateOutputFileStatmps: function() { + updateOutputTimestamps(state, config3, projectPath); + updateOutputFileStampsPending = false; + }, + done: function() { + if (updateOutputFileStampsPending) { + updateOutputTimestamps(state, config3, projectPath); + } + ts2.performance.mark("SolutionBuilder::Timestamps only updates"); + return doneInvalidatedProject(state, projectPath); + } + }; + } + var BuildStep; + (function(BuildStep2) { + BuildStep2[BuildStep2["CreateProgram"] = 0] = "CreateProgram"; + BuildStep2[BuildStep2["SyntaxDiagnostics"] = 1] = "SyntaxDiagnostics"; + BuildStep2[BuildStep2["SemanticDiagnostics"] = 2] = "SemanticDiagnostics"; + BuildStep2[BuildStep2["Emit"] = 3] = "Emit"; + BuildStep2[BuildStep2["EmitBundle"] = 4] = "EmitBundle"; + BuildStep2[BuildStep2["EmitBuildInfo"] = 5] = "EmitBuildInfo"; + BuildStep2[BuildStep2["BuildInvalidatedProjectOfBundle"] = 6] = "BuildInvalidatedProjectOfBundle"; + BuildStep2[BuildStep2["QueueReferencingProjects"] = 7] = "QueueReferencingProjects"; + BuildStep2[BuildStep2["Done"] = 8] = "Done"; + })(BuildStep || (BuildStep = {})); + function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath, projectIndex, config3, buildOrder) { + var step = kind === InvalidatedProjectKind.Build ? BuildStep.CreateProgram : BuildStep.EmitBundle; + var program; + var buildResult; + var invalidatedProjectOfBundle; + return kind === InvalidatedProjectKind.Build ? { + kind, + project, + projectPath, + buildOrder, + getCompilerOptions: function() { + return config3.options; + }, + getCurrentDirectory: function() { + return state.currentDirectory; + }, + getBuilderProgram: function() { + return withProgramOrUndefined(ts2.identity); + }, + getProgram: function() { + return withProgramOrUndefined(function(program2) { + return program2.getProgramOrUndefined(); + }); + }, + getSourceFile: function(fileName) { + return withProgramOrUndefined(function(program2) { + return program2.getSourceFile(fileName); + }); + }, + getSourceFiles: function() { + return withProgramOrEmptyArray(function(program2) { + return program2.getSourceFiles(); + }); + }, + getOptionsDiagnostics: function(cancellationToken) { + return withProgramOrEmptyArray(function(program2) { + return program2.getOptionsDiagnostics(cancellationToken); + }); + }, + getGlobalDiagnostics: function(cancellationToken) { + return withProgramOrEmptyArray(function(program2) { + return program2.getGlobalDiagnostics(cancellationToken); + }); + }, + getConfigFileParsingDiagnostics: function() { + return withProgramOrEmptyArray(function(program2) { + return program2.getConfigFileParsingDiagnostics(); + }); + }, + getSyntacticDiagnostics: function(sourceFile, cancellationToken) { + return withProgramOrEmptyArray(function(program2) { + return program2.getSyntacticDiagnostics(sourceFile, cancellationToken); + }); + }, + getAllDependencies: function(sourceFile) { + return withProgramOrEmptyArray(function(program2) { + return program2.getAllDependencies(sourceFile); + }); + }, + getSemanticDiagnostics: function(sourceFile, cancellationToken) { + return withProgramOrEmptyArray(function(program2) { + return program2.getSemanticDiagnostics(sourceFile, cancellationToken); + }); + }, + getSemanticDiagnosticsOfNextAffectedFile: function(cancellationToken, ignoreSourceFile) { + return withProgramOrUndefined(function(program2) { + return program2.getSemanticDiagnosticsOfNextAffectedFile && program2.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile); + }); + }, + emit: function(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) { + if (targetSourceFile || emitOnlyDtsFiles) { + return withProgramOrUndefined(function(program2) { + var _a2, _b; + return program2.emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a2 = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a2, project))); + }); + } + executeSteps(BuildStep.SemanticDiagnostics, cancellationToken); + if (step === BuildStep.EmitBuildInfo) { + return emitBuildInfo(writeFile2, cancellationToken); + } + if (step !== BuildStep.Emit) + return void 0; + return emit3(writeFile2, cancellationToken, customTransformers); + }, + done + } : { + kind, + project, + projectPath, + buildOrder, + getCompilerOptions: function() { + return config3.options; + }, + getCurrentDirectory: function() { + return state.currentDirectory; + }, + emit: function(writeFile2, customTransformers) { + if (step !== BuildStep.EmitBundle) + return invalidatedProjectOfBundle; + return emitBundle(writeFile2, customTransformers); + }, + done + }; + function done(cancellationToken, writeFile2, customTransformers) { + executeSteps(BuildStep.Done, cancellationToken, writeFile2, customTransformers); + if (kind === InvalidatedProjectKind.Build) + ts2.performance.mark("SolutionBuilder::Projects built"); + else + ts2.performance.mark("SolutionBuilder::Bundles updated"); + return doneInvalidatedProject(state, projectPath); + } + function withProgramOrUndefined(action) { + executeSteps(BuildStep.CreateProgram); + return program && action(program); + } + function withProgramOrEmptyArray(action) { + return withProgramOrUndefined(action) || ts2.emptyArray; + } + function createProgram() { + var _a2, _b; + ts2.Debug.assert(program === void 0); + if (state.options.dry) { + reportStatus(state, ts2.Diagnostics.A_non_dry_build_would_build_project_0, project); + buildResult = BuildResultFlags.Success; + step = BuildStep.QueueReferencingProjects; + return; + } + if (state.options.verbose) + reportStatus(state, ts2.Diagnostics.Building_project_0, project); + if (config3.fileNames.length === 0) { + reportAndStoreErrors(state, projectPath, ts2.getConfigFileParsingDiagnostics(config3)); + buildResult = BuildResultFlags.None; + step = BuildStep.QueueReferencingProjects; + return; + } + var host = state.host, compilerHost = state.compilerHost; + state.projectCompilerOptions = config3.options; + (_a2 = state.moduleResolutionCache) === null || _a2 === void 0 ? void 0 : _a2.update(config3.options); + (_b = state.typeReferenceDirectiveResolutionCache) === null || _b === void 0 ? void 0 : _b.update(config3.options); + program = host.createProgram(config3.fileNames, config3.options, compilerHost, getOldProgram(state, projectPath, config3), ts2.getConfigFileParsingDiagnostics(config3), config3.projectReferences); + if (state.watch) { + state.lastCachedPackageJsonLookups.set(projectPath, state.moduleResolutionCache && ts2.map(state.moduleResolutionCache.getPackageJsonInfoCache().entries(), function(_a3) { + var path2 = _a3[0], data = _a3[1]; + return [state.host.realpath && data ? toPath2(state, state.host.realpath(path2)) : path2, data]; + })); + state.builderPrograms.set(projectPath, program); + } + step++; + } + function handleDiagnostics(diagnostics, errorFlags, errorType) { + var _a2; + if (diagnostics.length) { + _a2 = buildErrors(state, projectPath, program, config3, diagnostics, errorFlags, errorType), buildResult = _a2.buildResult, step = _a2.step; + } else { + step++; + } + } + function getSyntaxDiagnostics(cancellationToken) { + ts2.Debug.assertIsDefined(program); + handleDiagnostics(__spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], program.getConfigFileParsingDiagnostics(), true), program.getOptionsDiagnostics(cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true), program.getSyntacticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ), true), BuildResultFlags.SyntaxErrors, "Syntactic"); + } + function getSemanticDiagnostics(cancellationToken) { + handleDiagnostics(ts2.Debug.checkDefined(program).getSemanticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ), BuildResultFlags.TypeErrors, "Semantic"); + } + function emit3(writeFileCallback, cancellationToken, customTransformers) { + var _a2; + var _b, _c, _d; + ts2.Debug.assertIsDefined(program); + ts2.Debug.assert(step === BuildStep.Emit); + var saved = program.saveEmitState(); + var declDiagnostics; + var reportDeclarationDiagnostics = function(d7) { + return (declDiagnostics || (declDiagnostics = [])).push(d7); + }; + var outputFiles = []; + var emitResult = ts2.emitFilesAndReportErrors( + program, + reportDeclarationDiagnostics, + /*write*/ + void 0, + /*reportSummary*/ + void 0, + function(name2, text, writeByteOrderMark, _onError, _sourceFiles, data) { + return outputFiles.push({ name: name2, text, writeByteOrderMark, buildInfo: data === null || data === void 0 ? void 0 : data.buildInfo }); + }, + cancellationToken, + /*emitOnlyDts*/ + false, + customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project)) + ).emitResult; + if (declDiagnostics) { + program.restoreEmitState(saved); + _a2 = buildErrors(state, projectPath, program, config3, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a2.buildResult, step = _a2.step; + return { + emitSkipped: true, + diagnostics: emitResult.diagnostics + }; + } + var host = state.host, compilerHost = state.compilerHost; + var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged; + var emitterDiagnostics = ts2.createDiagnosticCollection(); + var emittedOutputs = new ts2.Map(); + var options = program.getCompilerOptions(); + var isIncremental = ts2.isIncrementalCompilation(options); + var outputTimeStampMap; + var now2; + outputFiles.forEach(function(_a3) { + var name2 = _a3.name, text = _a3.text, writeByteOrderMark = _a3.writeByteOrderMark, buildInfo = _a3.buildInfo; + var path2 = toPath2(state, name2); + emittedOutputs.set(toPath2(state, name2), name2); + if (buildInfo) + setBuildInfo(state, buildInfo, projectPath, options, resultFlags); + ts2.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name2, text, writeByteOrderMark); + if (!isIncremental && state.watch) { + (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path2, now2 || (now2 = getCurrentTime(state.host))); + } + }); + finishEmit(emitterDiagnostics, emittedOutputs, outputFiles.length ? outputFiles[0].name : ts2.getFirstProjectOutput(config3, !host.useCaseSensitiveFileNames()), resultFlags); + return emitResult; + } + function emitBuildInfo(writeFileCallback, cancellationToken) { + ts2.Debug.assertIsDefined(program); + ts2.Debug.assert(step === BuildStep.EmitBuildInfo); + var emitResult = program.emitBuildInfo(function(name2, text, writeByteOrderMark, onError, sourceFiles, data) { + if (data === null || data === void 0 ? void 0 : data.buildInfo) + setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions(), BuildResultFlags.DeclarationOutputUnchanged); + if (writeFileCallback) + writeFileCallback(name2, text, writeByteOrderMark, onError, sourceFiles, data); + else + state.compilerHost.writeFile(name2, text, writeByteOrderMark, onError, sourceFiles, data); + }, cancellationToken); + if (emitResult.diagnostics.length) { + reportErrors(state, emitResult.diagnostics); + state.diagnostics.set(projectPath, __spreadArray9(__spreadArray9([], state.diagnostics.get(projectPath), true), emitResult.diagnostics, true)); + buildResult = BuildResultFlags.EmitErrors & buildResult; + } + if (emitResult.emittedFiles && state.write) { + emitResult.emittedFiles.forEach(function(name2) { + return listEmittedFile(state, config3, name2); + }); + } + afterProgramDone(state, program, config3); + step = BuildStep.QueueReferencingProjects; + return emitResult; + } + function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) { + var _a2; + var emitDiagnostics = emitterDiagnostics.getDiagnostics(); + if (emitDiagnostics.length) { + _a2 = buildErrors(state, projectPath, program, config3, emitDiagnostics, BuildResultFlags.EmitErrors, "Emit"), buildResult = _a2.buildResult, step = _a2.step; + return emitDiagnostics; + } + if (state.write) { + emittedOutputs.forEach(function(name2) { + return listEmittedFile(state, config3, name2); + }); + } + updateOutputTimestampsWorker(state, config3, projectPath, ts2.Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); + state.diagnostics.delete(projectPath); + state.projectStatus.set(projectPath, { + type: ts2.UpToDateStatusType.UpToDate, + oldestOutputFileName + }); + afterProgramDone(state, program, config3); + step = BuildStep.QueueReferencingProjects; + buildResult = resultFlags; + return emitDiagnostics; + } + function emitBundle(writeFileCallback, customTransformers) { + var _a2, _b; + ts2.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle); + if (state.options.dry) { + reportStatus(state, ts2.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); + buildResult = BuildResultFlags.Success; + step = BuildStep.QueueReferencingProjects; + return void 0; + } + if (state.options.verbose) + reportStatus(state, ts2.Diagnostics.Updating_output_of_project_0, project); + var compilerHost = state.compilerHost; + state.projectCompilerOptions = config3.options; + var outputFiles = ts2.emitUsingBuildInfo(config3, compilerHost, function(ref) { + var refName = resolveProjectName(state, ref.path); + return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); + }, customTransformers || ((_b = (_a2 = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a2, project))); + if (ts2.isString(outputFiles)) { + reportStatus(state, ts2.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); + step = BuildStep.BuildInvalidatedProjectOfBundle; + return invalidatedProjectOfBundle = createBuildOrUpdateInvalidedProject(InvalidatedProjectKind.Build, state, project, projectPath, projectIndex, config3, buildOrder); + } + ts2.Debug.assert(!!outputFiles.length); + var emitterDiagnostics = ts2.createDiagnosticCollection(); + var emittedOutputs = new ts2.Map(); + var resultFlags = BuildResultFlags.DeclarationOutputUnchanged; + var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo || void 0; + outputFiles.forEach(function(_a3) { + var _b2, _c; + var name2 = _a3.name, text = _a3.text, writeByteOrderMark = _a3.writeByteOrderMark, buildInfo = _a3.buildInfo; + emittedOutputs.set(toPath2(state, name2), name2); + if (buildInfo) { + if (((_b2 = buildInfo.program) === null || _b2 === void 0 ? void 0 : _b2.outSignature) !== ((_c = existingBuildInfo === null || existingBuildInfo === void 0 ? void 0 : existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) { + resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged; + } + setBuildInfo(state, buildInfo, projectPath, config3.options, resultFlags); + } + ts2.writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name2, text, writeByteOrderMark); + }); + var emitDiagnostics = finishEmit(emitterDiagnostics, emittedOutputs, outputFiles[0].name, resultFlags); + return { emitSkipped: false, diagnostics: emitDiagnostics }; + } + function executeSteps(till, cancellationToken, writeFile2, customTransformers) { + while (step <= till && step < BuildStep.Done) { + var currentStep = step; + switch (step) { + case BuildStep.CreateProgram: + createProgram(); + break; + case BuildStep.SyntaxDiagnostics: + getSyntaxDiagnostics(cancellationToken); + break; + case BuildStep.SemanticDiagnostics: + getSemanticDiagnostics(cancellationToken); + break; + case BuildStep.Emit: + emit3(writeFile2, cancellationToken, customTransformers); + break; + case BuildStep.EmitBuildInfo: + emitBuildInfo(writeFile2, cancellationToken); + break; + case BuildStep.EmitBundle: + emitBundle(writeFile2, customTransformers); + break; + case BuildStep.BuildInvalidatedProjectOfBundle: + ts2.Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken, writeFile2, customTransformers); + step = BuildStep.Done; + break; + case BuildStep.QueueReferencingProjects: + queueReferencingProjects(state, project, projectPath, projectIndex, config3, buildOrder, ts2.Debug.checkDefined(buildResult)); + step++; + break; + case BuildStep.Done: + default: + ts2.assertType(step); + } + ts2.Debug.assert(step > currentStep); + } + } + } + function needsBuild(_a2, status, config3) { + var options = _a2.options; + if (status.type !== ts2.UpToDateStatusType.OutOfDateWithPrepend || options.force) + return true; + return config3.fileNames.length === 0 || !!ts2.getConfigFileParsingDiagnostics(config3).length || !ts2.isIncrementalCompilation(config3.options); + } + function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { + if (!state.projectPendingBuild.size) + return void 0; + if (isCircularBuildOrder(buildOrder)) + return void 0; + var options = state.options, projectPendingBuild = state.projectPendingBuild; + for (var projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) { + var project = buildOrder[projectIndex]; + var projectPath = toResolvedConfigFilePath(state, project); + var reloadLevel = state.projectPendingBuild.get(projectPath); + if (reloadLevel === void 0) + continue; + if (reportQueue) { + reportQueue = false; + reportBuildQueue(state, buildOrder); + } + var config3 = parseConfigFile(state, project, projectPath); + if (!config3) { + reportParseConfigFileDiagnostic(state, projectPath); + projectPendingBuild.delete(projectPath); + continue; + } + if (reloadLevel === ts2.ConfigFileProgramReloadLevel.Full) { + watchConfigFile(state, project, projectPath, config3); + watchExtendedConfigFiles(state, projectPath, config3); + watchWildCardDirectories(state, project, projectPath, config3); + watchInputFiles(state, project, projectPath, config3); + watchPackageJsonFiles(state, project, projectPath, config3); + } else if (reloadLevel === ts2.ConfigFileProgramReloadLevel.Partial) { + config3.fileNames = ts2.getFileNamesFromConfigSpecs(config3.options.configFile.configFileSpecs, ts2.getDirectoryPath(project), config3.options, state.parseConfigFileHost); + ts2.updateErrorForNoInputFiles(config3.fileNames, project, config3.options.configFile.configFileSpecs, config3.errors, ts2.canJsonReportNoInputFiles(config3.raw)); + watchInputFiles(state, project, projectPath, config3); + watchPackageJsonFiles(state, project, projectPath, config3); + } + var status = getUpToDateStatus(state, config3, projectPath); + if (!options.force) { + if (status.type === ts2.UpToDateStatusType.UpToDate) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, ts2.getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + if (options.dry) { + reportStatus(state, ts2.Diagnostics.Project_0_is_up_to_date, project); + } + continue; + } + if (status.type === ts2.UpToDateStatusType.UpToDateWithUpstreamTypes || status.type === ts2.UpToDateStatusType.UpToDateWithInputFileText) { + reportAndStoreErrors(state, projectPath, ts2.getConfigFileParsingDiagnostics(config3)); + return { + kind: InvalidatedProjectKind.UpdateOutputFileStamps, + status, + project, + projectPath, + projectIndex, + config: config3 + }; + } + } + if (status.type === ts2.UpToDateStatusType.UpstreamBlocked) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, ts2.getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + if (options.verbose) { + reportStatus(state, status.upstreamProjectBlocked ? ts2.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : ts2.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, project, status.upstreamProjectName); + } + continue; + } + if (status.type === ts2.UpToDateStatusType.ContainerOnly) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, ts2.getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + continue; + } + return { + kind: needsBuild(state, status, config3) ? InvalidatedProjectKind.Build : InvalidatedProjectKind.UpdateBundle, + status, + project, + projectPath, + projectIndex, + config: config3 + }; + } + return void 0; + } + function createInvalidatedProjectWithInfo(state, info2, buildOrder) { + verboseReportProjectStatus(state, info2.project, info2.status); + return info2.kind !== InvalidatedProjectKind.UpdateOutputFileStamps ? createBuildOrUpdateInvalidedProject(info2.kind, state, info2.project, info2.projectPath, info2.projectIndex, info2.config, buildOrder) : createUpdateOutputFileStampsProject(state, info2.project, info2.projectPath, info2.config, buildOrder); + } + function getNextInvalidatedProject(state, buildOrder, reportQueue) { + var info2 = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue); + if (!info2) + return info2; + return createInvalidatedProjectWithInfo(state, info2, buildOrder); + } + function listEmittedFile(_a2, proj, file) { + var write = _a2.write; + if (write && proj.options.listEmittedFiles) { + write("TSFILE: ".concat(file)); + } + } + function getOldProgram(_a2, proj, parsed) { + var options = _a2.options, builderPrograms = _a2.builderPrograms, compilerHost = _a2.compilerHost; + if (options.force) + return void 0; + var value2 = builderPrograms.get(proj); + if (value2) + return value2; + return ts2.readBuilderProgram(parsed.options, compilerHost); + } + function afterProgramDone(state, program, config3) { + if (program) { + if (state.write) + ts2.listFiles(program, state.write); + if (state.host.afterProgramEmitAndDiagnostics) { + state.host.afterProgramEmitAndDiagnostics(program); + } + program.releaseProgram(); + } else if (state.host.afterEmitBundle) { + state.host.afterEmitBundle(config3); + } + state.projectCompilerOptions = state.baseCompilerOptions; + } + function buildErrors(state, resolvedPath, program, config3, diagnostics, buildResult, errorType) { + var canEmitBuildInfo = program && !ts2.outFile(program.getCompilerOptions()); + reportAndStoreErrors(state, resolvedPath, diagnostics); + state.projectStatus.set(resolvedPath, { type: ts2.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") }); + if (canEmitBuildInfo) + return { buildResult, step: BuildStep.EmitBuildInfo }; + afterProgramDone(state, program, config3); + return { buildResult, step: BuildStep.QueueReferencingProjects }; + } + function isFileWatcherWithModifiedTime(value2) { + return !!value2.watcher; + } + function getModifiedTime(state, fileName) { + var path2 = toPath2(state, fileName); + var existing = state.filesWatched.get(path2); + if (state.watch && !!existing) { + if (!isFileWatcherWithModifiedTime(existing)) + return existing; + if (existing.modifiedTime) + return existing.modifiedTime; + } + var result2 = ts2.getModifiedTime(state.host, fileName); + if (state.watch) { + if (existing) + existing.modifiedTime = result2; + else + state.filesWatched.set(path2, result2); + } + return result2; + } + function watchFile(state, file, callback, pollingInterval, options, watchType, project) { + var path2 = toPath2(state, file); + var existing = state.filesWatched.get(path2); + if (existing && isFileWatcherWithModifiedTime(existing)) { + existing.callbacks.push(callback); + } else { + var watcher = state.watchFile(file, function(fileName, eventKind, modifiedTime) { + var existing2 = ts2.Debug.checkDefined(state.filesWatched.get(path2)); + ts2.Debug.assert(isFileWatcherWithModifiedTime(existing2)); + existing2.modifiedTime = modifiedTime; + existing2.callbacks.forEach(function(cb) { + return cb(fileName, eventKind, modifiedTime); + }); + }, pollingInterval, options, watchType, project); + state.filesWatched.set(path2, { callbacks: [callback], watcher, modifiedTime: existing }); + } + return { + close: function() { + var existing2 = ts2.Debug.checkDefined(state.filesWatched.get(path2)); + ts2.Debug.assert(isFileWatcherWithModifiedTime(existing2)); + if (existing2.callbacks.length === 1) { + state.filesWatched.delete(path2); + ts2.closeFileWatcherOf(existing2); + } else { + ts2.unorderedRemoveItem(existing2.callbacks, callback); + } + } + }; + } + function getOutputTimeStampMap(state, resolvedConfigFilePath) { + if (!state.watch) + return void 0; + var result2 = state.outputTimeStamps.get(resolvedConfigFilePath); + if (!result2) + state.outputTimeStamps.set(resolvedConfigFilePath, result2 = new ts2.Map()); + return result2; + } + function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) { + var buildInfoPath = ts2.getTsBuildInfoEmitOutputFilePath(options); + var existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath); + var modifiedTime = getCurrentTime(state.host); + if (existing) { + existing.buildInfo = buildInfo; + existing.modifiedTime = modifiedTime; + if (!(resultFlags & BuildResultFlags.DeclarationOutputUnchanged)) + existing.latestChangedDtsTime = modifiedTime; + } else { + state.buildInfoCache.set(resolvedConfigPath, { + path: toPath2(state, buildInfoPath), + buildInfo, + modifiedTime, + latestChangedDtsTime: resultFlags & BuildResultFlags.DeclarationOutputUnchanged ? void 0 : modifiedTime + }); + } + } + function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) { + var path2 = toPath2(state, buildInfoPath); + var existing = state.buildInfoCache.get(resolvedConfigPath); + return (existing === null || existing === void 0 ? void 0 : existing.path) === path2 ? existing : void 0; + } + function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) { + var path2 = toPath2(state, buildInfoPath); + var existing = state.buildInfoCache.get(resolvedConfigPath); + if (existing !== void 0 && existing.path === path2) { + return existing.buildInfo || void 0; + } + var value2 = state.readFileWithCache(buildInfoPath); + var buildInfo = value2 ? ts2.getBuildInfo(buildInfoPath, value2) : void 0; + state.buildInfoCache.set(resolvedConfigPath, { path: path2, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts2.missingFileModifiedTime }); + return buildInfo; + } + function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) { + var tsconfigTime = getModifiedTime(state, configFile); + if (oldestOutputFileTime < tsconfigTime) { + return { + type: ts2.UpToDateStatusType.OutOfDateWithSelf, + outOfDateOutputFileName: oldestOutputFileName, + newerInputFileName: configFile + }; + } + } + function getUpToDateStatusWorker(state, project, resolvedPath) { + var _a2, _b; + if (!project.fileNames.length && !ts2.canJsonReportNoInputFiles(project.raw)) { + return { + type: ts2.UpToDateStatusType.ContainerOnly + }; + } + var referenceStatuses; + var force = !!state.options.force; + if (project.projectReferences) { + state.projectStatus.set(resolvedPath, { type: ts2.UpToDateStatusType.ComputingUpstream }); + for (var _i = 0, _c = project.projectReferences; _i < _c.length; _i++) { + var ref = _c[_i]; + var resolvedRef = ts2.resolveProjectReferencePath(ref); + var resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); + var resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); + var refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); + if (refStatus.type === ts2.UpToDateStatusType.ComputingUpstream || refStatus.type === ts2.UpToDateStatusType.ContainerOnly) { + continue; + } + if (refStatus.type === ts2.UpToDateStatusType.Unbuildable || refStatus.type === ts2.UpToDateStatusType.UpstreamBlocked) { + return { + type: ts2.UpToDateStatusType.UpstreamBlocked, + upstreamProjectName: ref.path, + upstreamProjectBlocked: refStatus.type === ts2.UpToDateStatusType.UpstreamBlocked + }; + } + if (refStatus.type !== ts2.UpToDateStatusType.UpToDate) { + return { + type: ts2.UpToDateStatusType.UpstreamOutOfDate, + upstreamProjectName: ref.path + }; + } + if (!force) + (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig }); + } + } + if (force) + return { type: ts2.UpToDateStatusType.ForceBuild }; + var host = state.host; + var buildInfoPath = ts2.getTsBuildInfoEmitOutputFilePath(project.options); + var oldestOutputFileName; + var oldestOutputFileTime = maximumDate; + var buildInfoTime; + var buildInfoProgram; + var buildInfoVersionMap; + if (buildInfoPath) { + var buildInfoCacheEntry_1 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath); + buildInfoTime = (buildInfoCacheEntry_1 === null || buildInfoCacheEntry_1 === void 0 ? void 0 : buildInfoCacheEntry_1.modifiedTime) || ts2.getModifiedTime(host, buildInfoPath); + if (buildInfoTime === ts2.missingFileModifiedTime) { + if (!buildInfoCacheEntry_1) { + state.buildInfoCache.set(resolvedPath, { + path: toPath2(state, buildInfoPath), + buildInfo: false, + modifiedTime: buildInfoTime + }); + } + return { + type: ts2.UpToDateStatusType.OutputMissing, + missingOutputFileName: buildInfoPath + }; + } + var buildInfo = getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime); + if (!buildInfo) { + return { + type: ts2.UpToDateStatusType.ErrorReadingFile, + fileName: buildInfoPath + }; + } + if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts2.version) { + return { + type: ts2.UpToDateStatusType.TsVersionOutputOfDate, + version: buildInfo.version + }; + } + if (buildInfo.program) { + if (((_a2 = buildInfo.program.changeFileSet) === null || _a2 === void 0 ? void 0 : _a2.length) || (!project.options.noEmit ? (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length : ts2.some(buildInfo.program.semanticDiagnosticsPerFile, ts2.isArray))) { + return { + type: ts2.UpToDateStatusType.OutOfDateBuildInfo, + buildInfoFile: buildInfoPath + }; + } + buildInfoProgram = buildInfo.program; + } + oldestOutputFileTime = buildInfoTime; + oldestOutputFileName = buildInfoPath; + } + var newestInputFileName = void 0; + var newestInputFileTime = minimumDate; + var pseudoInputUpToDate = false; + for (var _d = 0, _e2 = project.fileNames; _d < _e2.length; _d++) { + var inputFile = _e2[_d]; + var inputTime = getModifiedTime(state, inputFile); + if (inputTime === ts2.missingFileModifiedTime) { + return { + type: ts2.UpToDateStatusType.Unbuildable, + reason: "".concat(inputFile, " does not exist") + }; + } + if (buildInfoTime && buildInfoTime < inputTime) { + var version_3 = void 0; + var currentVersion = void 0; + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = ts2.getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + version_3 = buildInfoVersionMap.get(toPath2(state, inputFile)); + var text = version_3 ? state.readFileWithCache(inputFile) : void 0; + currentVersion = text !== void 0 ? (host.createHash || ts2.generateDjb2Hash)(text) : void 0; + if (version_3 && version_3 === currentVersion) + pseudoInputUpToDate = true; + } + if (!version_3 || version_3 !== currentVersion) { + return { + type: ts2.UpToDateStatusType.OutOfDateWithSelf, + outOfDateOutputFileName: buildInfoPath, + newerInputFileName: inputFile + }; + } + } + if (inputTime > newestInputFileTime) { + newestInputFileName = inputFile; + newestInputFileTime = inputTime; + } + } + if (!buildInfoPath) { + var outputs = ts2.getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); + var outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath); + for (var _f = 0, outputs_1 = outputs; _f < outputs_1.length; _f++) { + var output = outputs_1[_f]; + var path2 = toPath2(state, output); + var outputTime = outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.get(path2); + if (!outputTime) { + outputTime = ts2.getModifiedTime(state.host, output); + outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.set(path2, outputTime); + } + if (outputTime === ts2.missingFileModifiedTime) { + return { + type: ts2.UpToDateStatusType.OutputMissing, + missingOutputFileName: output + }; + } + if (outputTime < newestInputFileTime) { + return { + type: ts2.UpToDateStatusType.OutOfDateWithSelf, + outOfDateOutputFileName: output, + newerInputFileName: newestInputFileName + }; + } + if (outputTime < oldestOutputFileTime) { + oldestOutputFileTime = outputTime; + oldestOutputFileName = output; + } + } + } + var buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath); + var pseudoUpToDate = false; + var usesPrepend = false; + var upstreamChangedProject; + if (referenceStatuses) { + for (var _g = 0, referenceStatuses_1 = referenceStatuses; _g < referenceStatuses_1.length; _g++) { + var _h = referenceStatuses_1[_g], ref = _h.ref, refStatus = _h.refStatus, resolvedConfig = _h.resolvedConfig, resolvedRefPath = _h.resolvedRefPath; + usesPrepend = usesPrepend || !!ref.prepend; + if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) { + continue; + } + if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) { + return { + type: ts2.UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: buildInfoPath, + newerProjectName: ref.path + }; + } + var newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath); + if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) { + pseudoUpToDate = true; + upstreamChangedProject = ref.path; + continue; + } + ts2.Debug.assert(oldestOutputFileName !== void 0, "Should have an oldest output filename here"); + return { + type: ts2.UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: oldestOutputFileName, + newerProjectName: ref.path + }; + } + } + var configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName); + if (configStatus) + return configStatus; + var extendedConfigStatus = ts2.forEach(project.options.configFile.extendedSourceFiles || ts2.emptyArray, function(configFile) { + return checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName); + }); + if (extendedConfigStatus) + return extendedConfigStatus; + var dependentPackageFileStatus = ts2.forEach(state.lastCachedPackageJsonLookups.get(resolvedPath) || ts2.emptyArray, function(_a3) { + var path3 = _a3[0]; + return checkConfigFileUpToDateStatus(state, path3, oldestOutputFileTime, oldestOutputFileName); + }); + if (dependentPackageFileStatus) + return dependentPackageFileStatus; + if (usesPrepend && pseudoUpToDate) { + return { + type: ts2.UpToDateStatusType.OutOfDateWithPrepend, + outOfDateOutputFileName: oldestOutputFileName, + newerProjectName: upstreamChangedProject + }; + } + return { + type: pseudoUpToDate ? ts2.UpToDateStatusType.UpToDateWithUpstreamTypes : pseudoInputUpToDate ? ts2.UpToDateStatusType.UpToDateWithInputFileText : ts2.UpToDateStatusType.UpToDate, + newestInputFileTime, + newestInputFileName, + oldestOutputFileName + }; + } + function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) { + var refBuildInfo = state.buildInfoCache.get(resolvedRefPath); + return refBuildInfo.path === buildInfoCacheEntry.path; + } + function getUpToDateStatus(state, project, resolvedPath) { + if (project === void 0) { + return { type: ts2.UpToDateStatusType.Unbuildable, reason: "File deleted mid-build" }; + } + var prior = state.projectStatus.get(resolvedPath); + if (prior !== void 0) { + return prior; + } + ts2.performance.mark("SolutionBuilder::beforeUpToDateCheck"); + var actual = getUpToDateStatusWorker(state, project, resolvedPath); + ts2.performance.mark("SolutionBuilder::afterUpToDateCheck"); + ts2.performance.measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck"); + state.projectStatus.set(resolvedPath, actual); + return actual; + } + function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) { + if (proj.options.noEmit) + return; + var now2; + var buildInfoPath = ts2.getTsBuildInfoEmitOutputFilePath(proj.options); + if (buildInfoPath) { + if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(toPath2(state, buildInfoPath)))) { + if (!!state.options.verbose) + reportStatus(state, verboseMessage, proj.options.configFilePath); + state.host.setModifiedTime(buildInfoPath, now2 = getCurrentTime(state.host)); + getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now2; + } + state.outputTimeStamps.delete(projectPath); + return; + } + var host = state.host; + var outputs = ts2.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames()); + var outputTimeStampMap = getOutputTimeStampMap(state, projectPath); + var modifiedOutputs = outputTimeStampMap ? new ts2.Set() : void 0; + if (!skipOutputs || outputs.length !== skipOutputs.size) { + var reportVerbose = !!state.options.verbose; + for (var _i = 0, outputs_2 = outputs; _i < outputs_2.length; _i++) { + var file = outputs_2[_i]; + var path2 = toPath2(state, file); + if (skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(path2)) + continue; + if (reportVerbose) { + reportVerbose = false; + reportStatus(state, verboseMessage, proj.options.configFilePath); + } + host.setModifiedTime(file, now2 || (now2 = getCurrentTime(state.host))); + if (outputTimeStampMap) { + outputTimeStampMap.set(path2, now2); + modifiedOutputs.add(path2); + } + } + } + outputTimeStampMap === null || outputTimeStampMap === void 0 ? void 0 : outputTimeStampMap.forEach(function(_value, key) { + if (!(skipOutputs === null || skipOutputs === void 0 ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key)) + outputTimeStampMap.delete(key); + }); + } + function getLatestChangedDtsTime(state, options, resolvedConfigPath) { + if (!options.composite) + return void 0; + var entry = ts2.Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath)); + if (entry.latestChangedDtsTime !== void 0) + return entry.latestChangedDtsTime || void 0; + var latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ? state.host.getModifiedTime(ts2.getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, ts2.getDirectoryPath(entry.path))) : void 0; + entry.latestChangedDtsTime = latestChangedDtsTime || false; + return latestChangedDtsTime; + } + function updateOutputTimestamps(state, proj, resolvedPath) { + if (state.options.dry) { + return reportStatus(state, ts2.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath); + } + updateOutputTimestampsWorker(state, proj, resolvedPath, ts2.Diagnostics.Updating_output_timestamps_of_project_0); + state.projectStatus.set(resolvedPath, { + type: ts2.UpToDateStatusType.UpToDate, + oldestOutputFileName: ts2.getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames()) + }); + } + function queueReferencingProjects(state, project, projectPath, projectIndex, config3, buildOrder, buildResult) { + if (buildResult & BuildResultFlags.AnyErrors) + return; + if (!config3.options.composite) + return; + for (var index4 = projectIndex + 1; index4 < buildOrder.length; index4++) { + var nextProject = buildOrder[index4]; + var nextProjectPath = toResolvedConfigFilePath(state, nextProject); + if (state.projectPendingBuild.has(nextProjectPath)) + continue; + var nextProjectConfig = parseConfigFile(state, nextProject, nextProjectPath); + if (!nextProjectConfig || !nextProjectConfig.projectReferences) + continue; + for (var _i = 0, _a2 = nextProjectConfig.projectReferences; _i < _a2.length; _i++) { + var ref = _a2[_i]; + var resolvedRefPath = resolveProjectName(state, ref.path); + if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath) + continue; + var status = state.projectStatus.get(nextProjectPath); + if (status) { + switch (status.type) { + case ts2.UpToDateStatusType.UpToDate: + if (buildResult & BuildResultFlags.DeclarationOutputUnchanged) { + if (ref.prepend) { + state.projectStatus.set(nextProjectPath, { + type: ts2.UpToDateStatusType.OutOfDateWithPrepend, + outOfDateOutputFileName: status.oldestOutputFileName, + newerProjectName: project + }); + } else { + status.type = ts2.UpToDateStatusType.UpToDateWithUpstreamTypes; + } + break; + } + case ts2.UpToDateStatusType.UpToDateWithInputFileText: + case ts2.UpToDateStatusType.UpToDateWithUpstreamTypes: + case ts2.UpToDateStatusType.OutOfDateWithPrepend: + if (!(buildResult & BuildResultFlags.DeclarationOutputUnchanged)) { + state.projectStatus.set(nextProjectPath, { + type: ts2.UpToDateStatusType.OutOfDateWithUpstream, + outOfDateOutputFileName: status.type === ts2.UpToDateStatusType.OutOfDateWithPrepend ? status.outOfDateOutputFileName : status.oldestOutputFileName, + newerProjectName: project + }); + } + break; + case ts2.UpToDateStatusType.UpstreamBlocked: + if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { + clearProjectStatus(state, nextProjectPath); + } + break; + } + } + addProjToQueue(state, nextProjectPath, ts2.ConfigFileProgramReloadLevel.None); + break; + } + } + } + function build(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences) { + ts2.performance.mark("SolutionBuilder::beforeBuild"); + var result2 = buildWorker(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences); + ts2.performance.mark("SolutionBuilder::afterBuild"); + ts2.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); + return result2; + } + function buildWorker(state, project, cancellationToken, writeFile2, getCustomTransformers, onlyReferences) { + var buildOrder = getBuildOrderFor(state, project, onlyReferences); + if (!buildOrder) + return ts2.ExitStatus.InvalidProject_OutputsSkipped; + setupInitialBuild(state, cancellationToken); + var reportQueue = true; + var successfulProjects = 0; + while (true) { + var invalidatedProject = getNextInvalidatedProject(state, buildOrder, reportQueue); + if (!invalidatedProject) + break; + reportQueue = false; + invalidatedProject.done(cancellationToken, writeFile2, getCustomTransformers === null || getCustomTransformers === void 0 ? void 0 : getCustomTransformers(invalidatedProject.project)); + if (!state.diagnostics.has(invalidatedProject.projectPath)) + successfulProjects++; + } + disableCache(state); + reportErrorSummary(state, buildOrder); + startWatching(state, buildOrder); + return isCircularBuildOrder(buildOrder) ? ts2.ExitStatus.ProjectReferenceCycle_OutputsSkipped : !buildOrder.some(function(p7) { + return state.diagnostics.has(toResolvedConfigFilePath(state, p7)); + }) ? ts2.ExitStatus.Success : successfulProjects ? ts2.ExitStatus.DiagnosticsPresent_OutputsGenerated : ts2.ExitStatus.DiagnosticsPresent_OutputsSkipped; + } + function clean(state, project, onlyReferences) { + ts2.performance.mark("SolutionBuilder::beforeClean"); + var result2 = cleanWorker(state, project, onlyReferences); + ts2.performance.mark("SolutionBuilder::afterClean"); + ts2.performance.measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean"); + return result2; + } + function cleanWorker(state, project, onlyReferences) { + var buildOrder = getBuildOrderFor(state, project, onlyReferences); + if (!buildOrder) + return ts2.ExitStatus.InvalidProject_OutputsSkipped; + if (isCircularBuildOrder(buildOrder)) { + reportErrors(state, buildOrder.circularDiagnostics); + return ts2.ExitStatus.ProjectReferenceCycle_OutputsSkipped; + } + var options = state.options, host = state.host; + var filesToDelete = options.dry ? [] : void 0; + for (var _i = 0, buildOrder_1 = buildOrder; _i < buildOrder_1.length; _i++) { + var proj = buildOrder_1[_i]; + var resolvedPath = toResolvedConfigFilePath(state, proj); + var parsed = parseConfigFile(state, proj, resolvedPath); + if (parsed === void 0) { + reportParseConfigFileDiagnostic(state, resolvedPath); + continue; + } + var outputs = ts2.getAllProjectOutputs(parsed, !host.useCaseSensitiveFileNames()); + if (!outputs.length) + continue; + var inputFileNames = new ts2.Set(parsed.fileNames.map(function(f8) { + return toPath2(state, f8); + })); + for (var _a2 = 0, outputs_3 = outputs; _a2 < outputs_3.length; _a2++) { + var output = outputs_3[_a2]; + if (inputFileNames.has(toPath2(state, output))) + continue; + if (host.fileExists(output)) { + if (filesToDelete) { + filesToDelete.push(output); + } else { + host.deleteFile(output); + invalidateProject(state, resolvedPath, ts2.ConfigFileProgramReloadLevel.None); + } + } + } + } + if (filesToDelete) { + reportStatus(state, ts2.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function(f8) { + return "\r\n * ".concat(f8); + }).join("")); + } + return ts2.ExitStatus.Success; + } + function invalidateProject(state, resolved, reloadLevel) { + if (state.host.getParsedCommandLine && reloadLevel === ts2.ConfigFileProgramReloadLevel.Partial) { + reloadLevel = ts2.ConfigFileProgramReloadLevel.Full; + } + if (reloadLevel === ts2.ConfigFileProgramReloadLevel.Full) { + state.configFileCache.delete(resolved); + state.buildOrder = void 0; + } + state.needsSummary = true; + clearProjectStatus(state, resolved); + addProjToQueue(state, resolved, reloadLevel); + enableCache(state); + } + function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) { + state.reportFileChangeDetected = true; + invalidateProject(state, resolvedPath, reloadLevel); + scheduleBuildInvalidatedProject( + state, + 250, + /*changeDetected*/ + true + ); + } + function scheduleBuildInvalidatedProject(state, time2, changeDetected) { + var hostWithWatch = state.hostWithWatch; + if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) { + return; + } + if (state.timerToBuildInvalidatedProject) { + hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject); + } + state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time2, state, changeDetected); + } + function buildNextInvalidatedProject(state, changeDetected) { + ts2.performance.mark("SolutionBuilder::beforeBuild"); + var buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected); + ts2.performance.mark("SolutionBuilder::afterBuild"); + ts2.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); + if (buildOrder) + reportErrorSummary(state, buildOrder); + } + function buildNextInvalidatedProjectWorker(state, changeDetected) { + state.timerToBuildInvalidatedProject = void 0; + if (state.reportFileChangeDetected) { + state.reportFileChangeDetected = false; + state.projectErrorsReported.clear(); + reportWatchStatus(state, ts2.Diagnostics.File_change_detected_Starting_incremental_compilation); + } + var projectsBuilt = 0; + var buildOrder = getBuildOrder(state); + var invalidatedProject = getNextInvalidatedProject( + state, + buildOrder, + /*reportQueue*/ + false + ); + if (invalidatedProject) { + invalidatedProject.done(); + projectsBuilt++; + while (state.projectPendingBuild.size) { + if (state.timerToBuildInvalidatedProject) + return; + var info2 = getNextInvalidatedProjectCreateInfo( + state, + buildOrder, + /*reportQueue*/ + false + ); + if (!info2) + break; + if (info2.kind !== InvalidatedProjectKind.UpdateOutputFileStamps && (changeDetected || projectsBuilt === 5)) { + scheduleBuildInvalidatedProject( + state, + 100, + /*changeDetected*/ + false + ); + return; + } + var project = createInvalidatedProjectWithInfo(state, info2, buildOrder); + project.done(); + if (info2.kind !== InvalidatedProjectKind.UpdateOutputFileStamps) + projectsBuilt++; + } + } + disableCache(state); + return buildOrder; + } + function watchConfigFile(state, resolved, resolvedPath, parsed) { + if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath)) + return; + state.allWatchedConfigFiles.set(resolvedPath, watchFile(state, resolved, function() { + return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts2.ConfigFileProgramReloadLevel.Full); + }, ts2.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts2.WatchType.ConfigFile, resolved)); + } + function watchExtendedConfigFiles(state, resolvedPath, parsed) { + ts2.updateSharedExtendedConfigFileWatcher(resolvedPath, parsed === null || parsed === void 0 ? void 0 : parsed.options, state.allWatchedExtendedConfigFiles, function(extendedConfigFileName, extendedConfigFilePath) { + return watchFile(state, extendedConfigFileName, function() { + var _a2; + return (_a2 = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) === null || _a2 === void 0 ? void 0 : _a2.projects.forEach(function(projectConfigFilePath) { + return invalidateProjectAndScheduleBuilds(state, projectConfigFilePath, ts2.ConfigFileProgramReloadLevel.Full); + }); + }, ts2.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts2.WatchType.ExtendedConfigFile); + }, function(fileName) { + return toPath2(state, fileName); + }); + } + function watchWildCardDirectories(state, resolved, resolvedPath, parsed) { + if (!state.watch) + return; + ts2.updateWatchingWildcardDirectories(getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), new ts2.Map(ts2.getEntries(parsed.wildcardDirectories)), function(dir2, flags) { + return state.watchDirectory(dir2, function(fileOrDirectory) { + var _a2; + if (ts2.isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath2(state, dir2), + fileOrDirectory, + fileOrDirectoryPath: toPath2(state, fileOrDirectory), + configFileName: resolved, + currentDirectory: state.currentDirectory, + options: parsed.options, + program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) === null || _a2 === void 0 ? void 0 : _a2.fileNames), + useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames, + writeLog: function(s7) { + return state.writeLog(s7); + }, + toPath: function(fileName) { + return toPath2(state, fileName); + } + })) + return; + invalidateProjectAndScheduleBuilds(state, resolvedPath, ts2.ConfigFileProgramReloadLevel.Partial); + }, flags, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts2.WatchType.WildcardDirectory, resolved); + }); + } + function watchInputFiles(state, resolved, resolvedPath, parsed) { + if (!state.watch) + return; + ts2.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), ts2.arrayToMap(parsed.fileNames, function(fileName) { + return toPath2(state, fileName); + }), { + createNewValue: function(_path, input) { + return watchFile(state, input, function() { + return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts2.ConfigFileProgramReloadLevel.None); + }, ts2.PollingInterval.Low, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts2.WatchType.SourceFile, resolved); + }, + onDeleteValue: ts2.closeFileWatcher + }); + } + function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) { + if (!state.watch || !state.lastCachedPackageJsonLookups) + return; + ts2.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts2.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), { + createNewValue: function(path2, _input) { + return watchFile(state, path2, function() { + return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts2.ConfigFileProgramReloadLevel.None); + }, ts2.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts2.WatchType.PackageJson, resolved); + }, + onDeleteValue: ts2.closeFileWatcher + }); + } + function startWatching(state, buildOrder) { + if (!state.watchAllProjectsPending) + return; + ts2.performance.mark("SolutionBuilder::beforeWatcherCreation"); + state.watchAllProjectsPending = false; + for (var _i = 0, _a2 = getBuildOrderFromAnyBuildOrder(buildOrder); _i < _a2.length; _i++) { + var resolved = _a2[_i]; + var resolvedPath = toResolvedConfigFilePath(state, resolved); + var cfg = parseConfigFile(state, resolved, resolvedPath); + watchConfigFile(state, resolved, resolvedPath, cfg); + watchExtendedConfigFiles(state, resolvedPath, cfg); + if (cfg) { + watchWildCardDirectories(state, resolved, resolvedPath, cfg); + watchInputFiles(state, resolved, resolvedPath, cfg); + watchPackageJsonFiles(state, resolved, resolvedPath, cfg); + } + } + ts2.performance.mark("SolutionBuilder::afterWatcherCreation"); + ts2.performance.measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation"); + } + function stopWatching(state) { + ts2.clearMap(state.allWatchedConfigFiles, ts2.closeFileWatcher); + ts2.clearMap(state.allWatchedExtendedConfigFiles, ts2.closeFileWatcherOf); + ts2.clearMap(state.allWatchedWildcardDirectories, function(watchedWildcardDirectories) { + return ts2.clearMap(watchedWildcardDirectories, ts2.closeFileWatcherOf); + }); + ts2.clearMap(state.allWatchedInputFiles, function(watchedWildcardDirectories) { + return ts2.clearMap(watchedWildcardDirectories, ts2.closeFileWatcher); + }); + ts2.clearMap(state.allWatchedPackageJsonFiles, function(watchedPacageJsonFiles) { + return ts2.clearMap(watchedPacageJsonFiles, ts2.closeFileWatcher); + }); + } + function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { + var state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions); + return { + build: function(project, cancellationToken, writeFile2, getCustomTransformers) { + return build(state, project, cancellationToken, writeFile2, getCustomTransformers); + }, + clean: function(project) { + return clean(state, project); + }, + buildReferences: function(project, cancellationToken, writeFile2, getCustomTransformers) { + return build( + state, + project, + cancellationToken, + writeFile2, + getCustomTransformers, + /*onlyReferences*/ + true + ); + }, + cleanReferences: function(project) { + return clean( + state, + project, + /*onlyReferences*/ + true + ); + }, + getNextInvalidatedProject: function(cancellationToken) { + setupInitialBuild(state, cancellationToken); + return getNextInvalidatedProject( + state, + getBuildOrder(state), + /*reportQueue*/ + false + ); + }, + getBuildOrder: function() { + return getBuildOrder(state); + }, + getUpToDateStatusOfProject: function(project) { + var configFileName = resolveProjectName(state, project); + var configFilePath = toResolvedConfigFilePath(state, configFileName); + return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath); + }, + invalidateProject: function(configFilePath, reloadLevel) { + return invalidateProject(state, configFilePath, reloadLevel || ts2.ConfigFileProgramReloadLevel.None); + }, + close: function() { + return stopWatching(state); + } + }; + } + function relName(state, path2) { + return ts2.convertToRelativePath(path2, state.currentDirectory, function(f8) { + return state.getCanonicalFileName(f8); + }); + } + function reportStatus(state, message) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + state.host.reportSolutionBuilderStatus(ts2.createCompilerDiagnostic.apply(void 0, __spreadArray9([message], args, false))); + } + function reportWatchStatus(state, message) { + var _a2, _b; + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + (_b = (_a2 = state.hostWithWatch).onWatchStatusChange) === null || _b === void 0 ? void 0 : _b.call(_a2, ts2.createCompilerDiagnostic.apply(void 0, __spreadArray9([message], args, false)), state.host.getNewLine(), state.baseCompilerOptions); + } + function reportErrors(_a2, errors) { + var host = _a2.host; + errors.forEach(function(err) { + return host.reportDiagnostic(err); + }); + } + function reportAndStoreErrors(state, proj, errors) { + reportErrors(state, errors); + state.projectErrorsReported.set(proj, true); + if (errors.length) { + state.diagnostics.set(proj, errors); + } + } + function reportParseConfigFileDiagnostic(state, proj) { + reportAndStoreErrors(state, proj, [state.configFileCache.get(proj)]); + } + function reportErrorSummary(state, buildOrder) { + if (!state.needsSummary) + return; + state.needsSummary = false; + var canReportSummary = state.watch || !!state.host.reportErrorSummary; + var diagnostics = state.diagnostics; + var totalErrors = 0; + var filesInError = []; + if (isCircularBuildOrder(buildOrder)) { + reportBuildQueue(state, buildOrder.buildOrder); + reportErrors(state, buildOrder.circularDiagnostics); + if (canReportSummary) + totalErrors += ts2.getErrorCountForSummary(buildOrder.circularDiagnostics); + if (canReportSummary) + filesInError = __spreadArray9(__spreadArray9([], filesInError, true), ts2.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true); + } else { + buildOrder.forEach(function(project) { + var projectPath = toResolvedConfigFilePath(state, project); + if (!state.projectErrorsReported.has(projectPath)) { + reportErrors(state, diagnostics.get(projectPath) || ts2.emptyArray); + } + }); + if (canReportSummary) + diagnostics.forEach(function(singleProjectErrors) { + return totalErrors += ts2.getErrorCountForSummary(singleProjectErrors); + }); + if (canReportSummary) + diagnostics.forEach(function(singleProjectErrors) { + return __spreadArray9(__spreadArray9([], filesInError, true), ts2.getFilesInErrorForSummary(singleProjectErrors), true); + }); + } + if (state.watch) { + reportWatchStatus(state, ts2.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors); + } else if (state.host.reportErrorSummary) { + state.host.reportErrorSummary(totalErrors, filesInError); + } + } + function reportBuildQueue(state, buildQueue) { + if (state.options.verbose) { + reportStatus(state, ts2.Diagnostics.Projects_in_this_build_Colon_0, buildQueue.map(function(s7) { + return "\r\n * " + relName(state, s7); + }).join("")); + } + } + function reportUpToDateStatus(state, configFileName, status) { + switch (status.type) { + case ts2.UpToDateStatusType.OutOfDateWithSelf: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerInputFileName)); + case ts2.UpToDateStatusType.OutOfDateWithUpstream: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName)); + case ts2.UpToDateStatusType.OutputMissing: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relName(state, configFileName), relName(state, status.missingOutputFileName)); + case ts2.UpToDateStatusType.ErrorReadingFile: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1, relName(state, configFileName), relName(state, status.fileName)); + case ts2.UpToDateStatusType.OutOfDateBuildInfo: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted, relName(state, configFileName), relName(state, status.buildInfoFile)); + case ts2.UpToDateStatusType.UpToDate: + if (status.newestInputFileTime !== void 0) { + return reportStatus(state, ts2.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, relName(state, configFileName), relName(state, status.newestInputFileName || ""), relName(state, status.oldestOutputFileName || "")); + } + break; + case ts2.UpToDateStatusType.OutOfDateWithPrepend: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed, relName(state, configFileName), relName(state, status.newerProjectName)); + case ts2.UpToDateStatusType.UpToDateWithUpstreamTypes: + return reportStatus(state, ts2.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, relName(state, configFileName)); + case ts2.UpToDateStatusType.UpToDateWithInputFileText: + return reportStatus(state, ts2.Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, relName(state, configFileName)); + case ts2.UpToDateStatusType.UpstreamOutOfDate: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, relName(state, configFileName), relName(state, status.upstreamProjectName)); + case ts2.UpToDateStatusType.UpstreamBlocked: + return reportStatus(state, status.upstreamProjectBlocked ? ts2.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : ts2.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, relName(state, configFileName), relName(state, status.upstreamProjectName)); + case ts2.UpToDateStatusType.Unbuildable: + return reportStatus(state, ts2.Diagnostics.Failed_to_parse_file_0_Colon_1, relName(state, configFileName), status.reason); + case ts2.UpToDateStatusType.TsVersionOutputOfDate: + return reportStatus(state, ts2.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, relName(state, configFileName), status.version, ts2.version); + case ts2.UpToDateStatusType.ForceBuild: + return reportStatus(state, ts2.Diagnostics.Project_0_is_being_forcibly_rebuilt, relName(state, configFileName)); + case ts2.UpToDateStatusType.ContainerOnly: + case ts2.UpToDateStatusType.ComputingUpstream: + break; + default: + ts2.assertType(status); + } + } + function verboseReportProjectStatus(state, configFileName, status) { + if (state.options.verbose) { + reportUpToDateStatus(state, configFileName, status); + } + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var server; + (function(server2) { + server2.ActionSet = "action::set"; + server2.ActionInvalidate = "action::invalidate"; + server2.ActionPackageInstalled = "action::packageInstalled"; + server2.EventTypesRegistry = "event::typesRegistry"; + server2.EventBeginInstallTypes = "event::beginInstallTypes"; + server2.EventEndInstallTypes = "event::endInstallTypes"; + server2.EventInitializationFailed = "event::initializationFailed"; + var Arguments; + (function(Arguments2) { + Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments2.LogFile = "--logFile"; + Arguments2.EnableTelemetry = "--enableTelemetry"; + Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments2.TypesMapLocation = "--typesMapLocation"; + Arguments2.NpmLocation = "--npmLocation"; + Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; + })(Arguments = server2.Arguments || (server2.Arguments = {})); + function hasArgument(argumentName) { + return ts2.sys.args.indexOf(argumentName) >= 0; + } + server2.hasArgument = hasArgument; + function findArgument(argumentName) { + var index4 = ts2.sys.args.indexOf(argumentName); + return index4 >= 0 && index4 < ts2.sys.args.length - 1 ? ts2.sys.args[index4 + 1] : void 0; + } + server2.findArgument = findArgument; + function nowString() { + var d7 = /* @__PURE__ */ new Date(); + return "".concat(ts2.padLeft(d7.getHours().toString(), 2, "0"), ":").concat(ts2.padLeft(d7.getMinutes().toString(), 2, "0"), ":").concat(ts2.padLeft(d7.getSeconds().toString(), 2, "0"), ".").concat(ts2.padLeft(d7.getMilliseconds().toString(), 3, "0")); + } + server2.nowString = nowString; + })(server = ts2.server || (ts2.server = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var JsTyping; + (function(JsTyping2) { + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = new ts2.Version(ts2.getProperty(availableTypingVersions, "ts".concat(ts2.versionMajorMinor)) || ts2.getProperty(availableTypingVersions, "latest")); + return availableVersion.compareTo(cachedTyping.version) <= 0; + } + JsTyping2.isTypingUpToDate = isTypingUpToDate; + var unprefixedNodeCoreModuleList = [ + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "https", + "http2", + "inspector", + "module", + "net", + "os", + "path", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "stream/promises", + "string_decoder", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "wasi", + "worker_threads", + "zlib" + ]; + JsTyping2.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function(name2) { + return "node:".concat(name2); + }); + JsTyping2.nodeCoreModuleList = __spreadArray9(__spreadArray9([], unprefixedNodeCoreModuleList, true), JsTyping2.prefixedNodeCoreModuleList, true); + JsTyping2.nodeCoreModules = new ts2.Set(JsTyping2.nodeCoreModuleList); + function nonRelativeModuleNameForTypingCache(moduleName3) { + return JsTyping2.nodeCoreModules.has(moduleName3) ? "node" : moduleName3; + } + JsTyping2.nonRelativeModuleNameForTypingCache = nonRelativeModuleNameForTypingCache; + function loadSafeList(host, safeListPath) { + var result2 = ts2.readConfigFile(safeListPath, function(path2) { + return host.readFile(path2); + }); + return new ts2.Map(ts2.getEntries(result2.config)); + } + JsTyping2.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result2 = ts2.readConfigFile(typesMapPath, function(path2) { + return host.readFile(path2); + }); + if (result2.config) { + return new ts2.Map(ts2.getEntries(result2.config.simpleMap)); + } + return void 0; + } + JsTyping2.loadTypesMap = loadTypesMap; + function discoverTypings(host, log3, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry, compilerOptions) { + if (!typeAcquisition || !typeAcquisition.enable) { + return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; + } + var inferredTypings = new ts2.Map(); + fileNames = ts2.mapDefined(fileNames, function(fileName) { + var path2 = ts2.normalizePath(fileName); + if (ts2.hasJSFileExtension(path2)) { + return path2; + } + }); + var filesToWatch = []; + if (typeAcquisition.include) + addInferredTypings(typeAcquisition.include, "Explicitly included types"); + var exclude = typeAcquisition.exclude || []; + if (!compilerOptions.types) { + var possibleSearchDirs = new ts2.Set(fileNames.map(ts2.getDirectoryPath)); + possibleSearchDirs.add(projectRootPath); + possibleSearchDirs.forEach(function(searchDir) { + getTypingNames(searchDir, "bower.json", "bower_components", filesToWatch); + getTypingNames(searchDir, "package.json", "node_modules", filesToWatch); + }); + } + if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { + getTypingNamesFromSourceFileNames(fileNames); + } + if (unresolvedImports) { + var module_1 = ts2.deduplicate(unresolvedImports.map(nonRelativeModuleNameForTypingCache), ts2.equateStringsCaseSensitive, ts2.compareStringsCaseSensitive); + addInferredTypings(module_1, "Inferred typings from unresolved imports"); + } + packageNameToTypingLocation.forEach(function(typing, name2) { + var registryEntry = typesRegistry.get(name2); + if (inferredTypings.has(name2) && inferredTypings.get(name2) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) { + inferredTypings.set(name2, typing.typingLocation); + } + }); + for (var _i = 0, exclude_1 = exclude; _i < exclude_1.length; _i++) { + var excludeTypingName = exclude_1[_i]; + var didDelete = inferredTypings.delete(excludeTypingName); + if (didDelete && log3) + log3("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored.")); + } + var newTypingNames = []; + var cachedTypingPaths = []; + inferredTypings.forEach(function(inferred, typing) { + if (inferred !== void 0) { + cachedTypingPaths.push(inferred); + } else { + newTypingNames.push(typing); + } + }); + var result2 = { cachedTypingPaths, newTypingNames, filesToWatch }; + if (log3) + log3("Result: ".concat(JSON.stringify(result2))); + return result2; + function addInferredTyping(typingName) { + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, void 0); + } + } + function addInferredTypings(typingNames, message) { + if (log3) + log3("".concat(message, ": ").concat(JSON.stringify(typingNames))); + ts2.forEach(typingNames, addInferredTyping); + } + function getTypingNames(projectRootPath2, manifestName, modulesDirName, filesToWatch2) { + var manifestPath = ts2.combinePaths(projectRootPath2, manifestName); + var manifest; + var manifestTypingNames; + if (host.fileExists(manifestPath)) { + filesToWatch2.push(manifestPath); + manifest = ts2.readConfigFile(manifestPath, function(path2) { + return host.readFile(path2); + }).config; + manifestTypingNames = ts2.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts2.getOwnKeys); + addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies")); + } + var packagesFolderPath = ts2.combinePaths(projectRootPath2, modulesDirName); + filesToWatch2.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { + return; + } + var packageNames = []; + var dependencyManifestNames = manifestTypingNames ? manifestTypingNames.map(function(typingName) { + return ts2.combinePaths(packagesFolderPath, typingName, manifestName); + }) : host.readDirectory( + packagesFolderPath, + [ + ".json" + /* Extension.Json */ + ], + /*excludes*/ + void 0, + /*includes*/ + void 0, + /*depth*/ + 3 + ).filter(function(manifestPath2) { + if (ts2.getBaseFileName(manifestPath2) !== manifestName) { + return false; + } + var pathComponents = ts2.getPathComponents(ts2.normalizePath(manifestPath2)); + var isScoped = pathComponents[pathComponents.length - 3][0] === "@"; + return isScoped && pathComponents[pathComponents.length - 4].toLowerCase() === modulesDirName || // `node_modules/@foo/bar` + !isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; + }); + if (log3) + log3("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames))); + for (var _i2 = 0, dependencyManifestNames_1 = dependencyManifestNames; _i2 < dependencyManifestNames_1.length; _i2++) { + var manifestPath_1 = dependencyManifestNames_1[_i2]; + var normalizedFileName = ts2.normalizePath(manifestPath_1); + var result_1 = ts2.readConfigFile(normalizedFileName, function(path2) { + return host.readFile(path2); + }); + var manifest_1 = result_1.config; + if (!manifest_1.name) { + continue; + } + var ownTypes = manifest_1.types || manifest_1.typings; + if (ownTypes) { + var absolutePath = ts2.getNormalizedAbsolutePath(ownTypes, ts2.getDirectoryPath(normalizedFileName)); + if (host.fileExists(absolutePath)) { + if (log3) + log3(" Package '".concat(manifest_1.name, "' provides its own types.")); + inferredTypings.set(manifest_1.name, absolutePath); + } else { + if (log3) + log3(" Package '".concat(manifest_1.name, "' provides its own types but they are missing.")); + } + } else { + packageNames.push(manifest_1.name); + } + } + addInferredTypings(packageNames, " Found package names"); + } + function getTypingNamesFromSourceFileNames(fileNames2) { + var fromFileNames = ts2.mapDefined(fileNames2, function(j6) { + if (!ts2.hasJSFileExtension(j6)) + return void 0; + var inferredTypingName = ts2.removeFileExtension(ts2.getBaseFileName(j6.toLowerCase())); + var cleanedTypingName = ts2.removeMinAndVersionNumbers(inferredTypingName); + return safeList.get(cleanedTypingName); + }); + if (fromFileNames.length) { + addInferredTypings(fromFileNames, "Inferred typings from file names"); + } + var hasJsxFile = ts2.some(fileNames2, function(f8) { + return ts2.fileExtensionIs( + f8, + ".jsx" + /* Extension.Jsx */ + ); + }); + if (hasJsxFile) { + if (log3) + log3("Inferred 'react' typings due to presence of '.jsx' extension"); + addInferredTyping("react"); + } + } + } + JsTyping2.discoverTypings = discoverTypings; + var NameValidationResult; + (function(NameValidationResult2) { + NameValidationResult2[NameValidationResult2["Ok"] = 0] = "Ok"; + NameValidationResult2[NameValidationResult2["EmptyName"] = 1] = "EmptyName"; + NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong"; + NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot"; + NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore"; + NameValidationResult2[NameValidationResult2["NameContainsNonURISafeCharacters"] = 5] = "NameContainsNonURISafeCharacters"; + })(NameValidationResult = JsTyping2.NameValidationResult || (JsTyping2.NameValidationResult = {})); + var maxPackageNameLength = 214; + function validatePackageName(packageName) { + return validatePackageNameWorker( + packageName, + /*supportScopedPackage*/ + true + ); + } + JsTyping2.validatePackageName = validatePackageName; + function validatePackageNameWorker(packageName, supportScopedPackage) { + if (!packageName) { + return 1; + } + if (packageName.length > maxPackageNameLength) { + return 2; + } + if (packageName.charCodeAt(0) === 46) { + return 3; + } + if (packageName.charCodeAt(0) === 95) { + return 4; + } + if (supportScopedPackage) { + var matches2 = /^@([^/]+)\/([^/]+)$/.exec(packageName); + if (matches2) { + var scopeResult = validatePackageNameWorker( + matches2[1], + /*supportScopedPackage*/ + false + ); + if (scopeResult !== 0) { + return { name: matches2[1], isScopeName: true, result: scopeResult }; + } + var packageResult = validatePackageNameWorker( + matches2[2], + /*supportScopedPackage*/ + false + ); + if (packageResult !== 0) { + return { name: matches2[2], isScopeName: false, result: packageResult }; + } + return 0; + } + } + if (encodeURIComponent(packageName) !== packageName) { + return 5; + } + return 0; + } + function renderPackageNameValidationFailure(result2, typing) { + return typeof result2 === "object" ? renderPackageNameValidationFailureWorker(typing, result2.result, result2.name, result2.isScopeName) : renderPackageNameValidationFailureWorker( + typing, + result2, + typing, + /*isScopeName*/ + false + ); + } + JsTyping2.renderPackageNameValidationFailure = renderPackageNameValidationFailure; + function renderPackageNameValidationFailureWorker(typing, result2, name2, isScopeName) { + var kind = isScopeName ? "Scope" : "Package"; + switch (result2) { + case 1: + return "'".concat(typing, "':: ").concat(kind, " name '").concat(name2, "' cannot be empty"); + case 2: + return "'".concat(typing, "':: ").concat(kind, " name '").concat(name2, "' should be less than ").concat(maxPackageNameLength, " characters"); + case 3: + return "'".concat(typing, "':: ").concat(kind, " name '").concat(name2, "' cannot start with '.'"); + case 4: + return "'".concat(typing, "':: ").concat(kind, " name '").concat(name2, "' cannot start with '_'"); + case 5: + return "'".concat(typing, "':: ").concat(kind, " name '").concat(name2, "' contains non URI safe characters"); + case 0: + return ts2.Debug.fail(); + default: + throw ts2.Debug.assertNever(result2); + } + } + })(JsTyping = ts2.JsTyping || (ts2.JsTyping = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ScriptSnapshot; + (function(ScriptSnapshot2) { + var StringScriptSnapshot = ( + /** @class */ + function() { + function StringScriptSnapshot2(text) { + this.text = text; + } + StringScriptSnapshot2.prototype.getText = function(start, end) { + return start === 0 && end === this.text.length ? this.text : this.text.substring(start, end); + }; + StringScriptSnapshot2.prototype.getLength = function() { + return this.text.length; + }; + StringScriptSnapshot2.prototype.getChangeRange = function() { + return void 0; + }; + return StringScriptSnapshot2; + }() + ); + function fromString(text) { + return new StringScriptSnapshot(text); + } + ScriptSnapshot2.fromString = fromString; + })(ScriptSnapshot = ts2.ScriptSnapshot || (ts2.ScriptSnapshot = {})); + var PackageJsonDependencyGroup; + (function(PackageJsonDependencyGroup2) { + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["Dependencies"] = 1] = "Dependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["DevDependencies"] = 2] = "DevDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["PeerDependencies"] = 4] = "PeerDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["OptionalDependencies"] = 8] = "OptionalDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["All"] = 15] = "All"; + })(PackageJsonDependencyGroup = ts2.PackageJsonDependencyGroup || (ts2.PackageJsonDependencyGroup = {})); + var PackageJsonAutoImportPreference; + (function(PackageJsonAutoImportPreference2) { + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Off"] = 0] = "Off"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["On"] = 1] = "On"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Auto"] = 2] = "Auto"; + })(PackageJsonAutoImportPreference = ts2.PackageJsonAutoImportPreference || (ts2.PackageJsonAutoImportPreference = {})); + var LanguageServiceMode; + (function(LanguageServiceMode2) { + LanguageServiceMode2[LanguageServiceMode2["Semantic"] = 0] = "Semantic"; + LanguageServiceMode2[LanguageServiceMode2["PartialSemantic"] = 1] = "PartialSemantic"; + LanguageServiceMode2[LanguageServiceMode2["Syntactic"] = 2] = "Syntactic"; + })(LanguageServiceMode = ts2.LanguageServiceMode || (ts2.LanguageServiceMode = {})); + ts2.emptyOptions = {}; + var SemanticClassificationFormat; + (function(SemanticClassificationFormat2) { + SemanticClassificationFormat2["Original"] = "original"; + SemanticClassificationFormat2["TwentyTwenty"] = "2020"; + })(SemanticClassificationFormat = ts2.SemanticClassificationFormat || (ts2.SemanticClassificationFormat = {})); + var OrganizeImportsMode; + (function(OrganizeImportsMode2) { + OrganizeImportsMode2["All"] = "All"; + OrganizeImportsMode2["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode2["RemoveUnused"] = "RemoveUnused"; + })(OrganizeImportsMode = ts2.OrganizeImportsMode || (ts2.OrganizeImportsMode = {})); + var CompletionTriggerKind; + (function(CompletionTriggerKind2) { + CompletionTriggerKind2[CompletionTriggerKind2["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + })(CompletionTriggerKind = ts2.CompletionTriggerKind || (ts2.CompletionTriggerKind = {})); + var InlayHintKind; + (function(InlayHintKind2) { + InlayHintKind2["Type"] = "Type"; + InlayHintKind2["Parameter"] = "Parameter"; + InlayHintKind2["Enum"] = "Enum"; + })(InlayHintKind = ts2.InlayHintKind || (ts2.InlayHintKind = {})); + var HighlightSpanKind; + (function(HighlightSpanKind2) { + HighlightSpanKind2["none"] = "none"; + HighlightSpanKind2["definition"] = "definition"; + HighlightSpanKind2["reference"] = "reference"; + HighlightSpanKind2["writtenReference"] = "writtenReference"; + })(HighlightSpanKind = ts2.HighlightSpanKind || (ts2.HighlightSpanKind = {})); + var IndentStyle; + (function(IndentStyle2) { + IndentStyle2[IndentStyle2["None"] = 0] = "None"; + IndentStyle2[IndentStyle2["Block"] = 1] = "Block"; + IndentStyle2[IndentStyle2["Smart"] = 2] = "Smart"; + })(IndentStyle = ts2.IndentStyle || (ts2.IndentStyle = {})); + var SemicolonPreference; + (function(SemicolonPreference2) { + SemicolonPreference2["Ignore"] = "ignore"; + SemicolonPreference2["Insert"] = "insert"; + SemicolonPreference2["Remove"] = "remove"; + })(SemicolonPreference = ts2.SemicolonPreference || (ts2.SemicolonPreference = {})); + function getDefaultFormatCodeSettings(newLineCharacter) { + return { + indentSize: 4, + tabSize: 4, + newLineCharacter: newLineCharacter || "\n", + convertTabsToSpaces: true, + indentStyle: IndentStyle.Smart, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + semicolons: SemicolonPreference.Ignore, + trimTrailingWhitespace: true + }; + } + ts2.getDefaultFormatCodeSettings = getDefaultFormatCodeSettings; + ts2.testFormatSettings = getDefaultFormatCodeSettings("\n"); + var SymbolDisplayPartKind; + (function(SymbolDisplayPartKind2) { + SymbolDisplayPartKind2[SymbolDisplayPartKind2["aliasName"] = 0] = "aliasName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["className"] = 1] = "className"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumName"] = 2] = "enumName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["fieldName"] = 3] = "fieldName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["interfaceName"] = 4] = "interfaceName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["keyword"] = 5] = "keyword"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["lineBreak"] = 6] = "lineBreak"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["numericLiteral"] = 7] = "numericLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["stringLiteral"] = 8] = "stringLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["localName"] = 9] = "localName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["methodName"] = 10] = "methodName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["moduleName"] = 11] = "moduleName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["operator"] = 12] = "operator"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["parameterName"] = 13] = "parameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["propertyName"] = 14] = "propertyName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["punctuation"] = 15] = "punctuation"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["space"] = 16] = "space"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["text"] = 17] = "text"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["typeParameterName"] = 18] = "typeParameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumMemberName"] = 19] = "enumMemberName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["functionName"] = 20] = "functionName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["link"] = 22] = "link"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkName"] = 23] = "linkName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkText"] = 24] = "linkText"; + })(SymbolDisplayPartKind = ts2.SymbolDisplayPartKind || (ts2.SymbolDisplayPartKind = {})); + var CompletionInfoFlags; + (function(CompletionInfoFlags2) { + CompletionInfoFlags2[CompletionInfoFlags2["None"] = 0] = "None"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeAutoImports"] = 1] = "MayIncludeAutoImports"; + CompletionInfoFlags2[CompletionInfoFlags2["IsImportStatementCompletion"] = 2] = "IsImportStatementCompletion"; + CompletionInfoFlags2[CompletionInfoFlags2["IsContinuation"] = 4] = "IsContinuation"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiers"] = 8] = "ResolvedModuleSpecifiers"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiersBeyondLimit"] = 16] = "ResolvedModuleSpecifiersBeyondLimit"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeMethodSnippets"] = 32] = "MayIncludeMethodSnippets"; + })(CompletionInfoFlags = ts2.CompletionInfoFlags || (ts2.CompletionInfoFlags = {})); + var OutliningSpanKind; + (function(OutliningSpanKind2) { + OutliningSpanKind2["Comment"] = "comment"; + OutliningSpanKind2["Region"] = "region"; + OutliningSpanKind2["Code"] = "code"; + OutliningSpanKind2["Imports"] = "imports"; + })(OutliningSpanKind = ts2.OutliningSpanKind || (ts2.OutliningSpanKind = {})); + var OutputFileType; + (function(OutputFileType2) { + OutputFileType2[OutputFileType2["JavaScript"] = 0] = "JavaScript"; + OutputFileType2[OutputFileType2["SourceMap"] = 1] = "SourceMap"; + OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; + })(OutputFileType = ts2.OutputFileType || (ts2.OutputFileType = {})); + var EndOfLineState; + (function(EndOfLineState2) { + EndOfLineState2[EndOfLineState2["None"] = 0] = "None"; + EndOfLineState2[EndOfLineState2["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState2[EndOfLineState2["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState2[EndOfLineState2["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState2[EndOfLineState2["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + })(EndOfLineState = ts2.EndOfLineState || (ts2.EndOfLineState = {})); + var TokenClass; + (function(TokenClass2) { + TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; + TokenClass2[TokenClass2["Keyword"] = 1] = "Keyword"; + TokenClass2[TokenClass2["Operator"] = 2] = "Operator"; + TokenClass2[TokenClass2["Comment"] = 3] = "Comment"; + TokenClass2[TokenClass2["Whitespace"] = 4] = "Whitespace"; + TokenClass2[TokenClass2["Identifier"] = 5] = "Identifier"; + TokenClass2[TokenClass2["NumberLiteral"] = 6] = "NumberLiteral"; + TokenClass2[TokenClass2["BigIntLiteral"] = 7] = "BigIntLiteral"; + TokenClass2[TokenClass2["StringLiteral"] = 8] = "StringLiteral"; + TokenClass2[TokenClass2["RegExpLiteral"] = 9] = "RegExpLiteral"; + })(TokenClass = ts2.TokenClass || (ts2.TokenClass = {})); + var ScriptElementKind; + (function(ScriptElementKind2) { + ScriptElementKind2["unknown"] = ""; + ScriptElementKind2["warning"] = "warning"; + ScriptElementKind2["keyword"] = "keyword"; + ScriptElementKind2["scriptElement"] = "script"; + ScriptElementKind2["moduleElement"] = "module"; + ScriptElementKind2["classElement"] = "class"; + ScriptElementKind2["localClassElement"] = "local class"; + ScriptElementKind2["interfaceElement"] = "interface"; + ScriptElementKind2["typeElement"] = "type"; + ScriptElementKind2["enumElement"] = "enum"; + ScriptElementKind2["enumMemberElement"] = "enum member"; + ScriptElementKind2["variableElement"] = "var"; + ScriptElementKind2["localVariableElement"] = "local var"; + ScriptElementKind2["functionElement"] = "function"; + ScriptElementKind2["localFunctionElement"] = "local function"; + ScriptElementKind2["memberFunctionElement"] = "method"; + ScriptElementKind2["memberGetAccessorElement"] = "getter"; + ScriptElementKind2["memberSetAccessorElement"] = "setter"; + ScriptElementKind2["memberVariableElement"] = "property"; + ScriptElementKind2["memberAccessorVariableElement"] = "accessor"; + ScriptElementKind2["constructorImplementationElement"] = "constructor"; + ScriptElementKind2["callSignatureElement"] = "call"; + ScriptElementKind2["indexSignatureElement"] = "index"; + ScriptElementKind2["constructSignatureElement"] = "construct"; + ScriptElementKind2["parameterElement"] = "parameter"; + ScriptElementKind2["typeParameterElement"] = "type parameter"; + ScriptElementKind2["primitiveType"] = "primitive type"; + ScriptElementKind2["label"] = "label"; + ScriptElementKind2["alias"] = "alias"; + ScriptElementKind2["constElement"] = "const"; + ScriptElementKind2["letElement"] = "let"; + ScriptElementKind2["directory"] = "directory"; + ScriptElementKind2["externalModuleName"] = "external module name"; + ScriptElementKind2["jsxAttribute"] = "JSX attribute"; + ScriptElementKind2["string"] = "string"; + ScriptElementKind2["link"] = "link"; + ScriptElementKind2["linkName"] = "link name"; + ScriptElementKind2["linkText"] = "link text"; + })(ScriptElementKind = ts2.ScriptElementKind || (ts2.ScriptElementKind = {})); + var ScriptElementKindModifier; + (function(ScriptElementKindModifier2) { + ScriptElementKindModifier2["none"] = ""; + ScriptElementKindModifier2["publicMemberModifier"] = "public"; + ScriptElementKindModifier2["privateMemberModifier"] = "private"; + ScriptElementKindModifier2["protectedMemberModifier"] = "protected"; + ScriptElementKindModifier2["exportedModifier"] = "export"; + ScriptElementKindModifier2["ambientModifier"] = "declare"; + ScriptElementKindModifier2["staticModifier"] = "static"; + ScriptElementKindModifier2["abstractModifier"] = "abstract"; + ScriptElementKindModifier2["optionalModifier"] = "optional"; + ScriptElementKindModifier2["deprecatedModifier"] = "deprecated"; + ScriptElementKindModifier2["dtsModifier"] = ".d.ts"; + ScriptElementKindModifier2["tsModifier"] = ".ts"; + ScriptElementKindModifier2["tsxModifier"] = ".tsx"; + ScriptElementKindModifier2["jsModifier"] = ".js"; + ScriptElementKindModifier2["jsxModifier"] = ".jsx"; + ScriptElementKindModifier2["jsonModifier"] = ".json"; + ScriptElementKindModifier2["dmtsModifier"] = ".d.mts"; + ScriptElementKindModifier2["mtsModifier"] = ".mts"; + ScriptElementKindModifier2["mjsModifier"] = ".mjs"; + ScriptElementKindModifier2["dctsModifier"] = ".d.cts"; + ScriptElementKindModifier2["ctsModifier"] = ".cts"; + ScriptElementKindModifier2["cjsModifier"] = ".cjs"; + })(ScriptElementKindModifier = ts2.ScriptElementKindModifier || (ts2.ScriptElementKindModifier = {})); + var ClassificationTypeNames; + (function(ClassificationTypeNames2) { + ClassificationTypeNames2["comment"] = "comment"; + ClassificationTypeNames2["identifier"] = "identifier"; + ClassificationTypeNames2["keyword"] = "keyword"; + ClassificationTypeNames2["numericLiteral"] = "number"; + ClassificationTypeNames2["bigintLiteral"] = "bigint"; + ClassificationTypeNames2["operator"] = "operator"; + ClassificationTypeNames2["stringLiteral"] = "string"; + ClassificationTypeNames2["whiteSpace"] = "whitespace"; + ClassificationTypeNames2["text"] = "text"; + ClassificationTypeNames2["punctuation"] = "punctuation"; + ClassificationTypeNames2["className"] = "class name"; + ClassificationTypeNames2["enumName"] = "enum name"; + ClassificationTypeNames2["interfaceName"] = "interface name"; + ClassificationTypeNames2["moduleName"] = "module name"; + ClassificationTypeNames2["typeParameterName"] = "type parameter name"; + ClassificationTypeNames2["typeAliasName"] = "type alias name"; + ClassificationTypeNames2["parameterName"] = "parameter name"; + ClassificationTypeNames2["docCommentTagName"] = "doc comment tag name"; + ClassificationTypeNames2["jsxOpenTagName"] = "jsx open tag name"; + ClassificationTypeNames2["jsxCloseTagName"] = "jsx close tag name"; + ClassificationTypeNames2["jsxSelfClosingTagName"] = "jsx self closing tag name"; + ClassificationTypeNames2["jsxAttribute"] = "jsx attribute"; + ClassificationTypeNames2["jsxText"] = "jsx text"; + ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; + })(ClassificationTypeNames = ts2.ClassificationTypeNames || (ts2.ClassificationTypeNames = {})); + var ClassificationType; + (function(ClassificationType2) { + ClassificationType2[ClassificationType2["comment"] = 1] = "comment"; + ClassificationType2[ClassificationType2["identifier"] = 2] = "identifier"; + ClassificationType2[ClassificationType2["keyword"] = 3] = "keyword"; + ClassificationType2[ClassificationType2["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType2[ClassificationType2["operator"] = 5] = "operator"; + ClassificationType2[ClassificationType2["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType2[ClassificationType2["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType2[ClassificationType2["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType2[ClassificationType2["text"] = 9] = "text"; + ClassificationType2[ClassificationType2["punctuation"] = 10] = "punctuation"; + ClassificationType2[ClassificationType2["className"] = 11] = "className"; + ClassificationType2[ClassificationType2["enumName"] = 12] = "enumName"; + ClassificationType2[ClassificationType2["interfaceName"] = 13] = "interfaceName"; + ClassificationType2[ClassificationType2["moduleName"] = 14] = "moduleName"; + ClassificationType2[ClassificationType2["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType2[ClassificationType2["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType2[ClassificationType2["parameterName"] = 17] = "parameterName"; + ClassificationType2[ClassificationType2["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType2[ClassificationType2["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType2[ClassificationType2["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType2[ClassificationType2["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType2[ClassificationType2["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType2[ClassificationType2["jsxText"] = 23] = "jsxText"; + ClassificationType2[ClassificationType2["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType2[ClassificationType2["bigintLiteral"] = 25] = "bigintLiteral"; + })(ClassificationType = ts2.ClassificationType || (ts2.ClassificationType = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.scanner = ts2.createScanner( + 99, + /*skipTrivia*/ + true + ); + var SemanticMeaning; + (function(SemanticMeaning2) { + SemanticMeaning2[SemanticMeaning2["None"] = 0] = "None"; + SemanticMeaning2[SemanticMeaning2["Value"] = 1] = "Value"; + SemanticMeaning2[SemanticMeaning2["Type"] = 2] = "Type"; + SemanticMeaning2[SemanticMeaning2["Namespace"] = 4] = "Namespace"; + SemanticMeaning2[SemanticMeaning2["All"] = 7] = "All"; + })(SemanticMeaning = ts2.SemanticMeaning || (ts2.SemanticMeaning = {})); + function getMeaningFromDeclaration(node) { + switch (node.kind) { + case 257: + return ts2.isInJSFile(node) && ts2.getJSDocEnumTag(node) ? 7 : 1; + case 166: + case 205: + case 169: + case 168: + case 299: + case 300: + case 171: + case 170: + case 173: + case 174: + case 175: + case 259: + case 215: + case 216: + case 295: + case 288: + return 1; + case 165: + case 261: + case 262: + case 184: + return 2; + case 348: + return node.name === void 0 ? 1 | 2 : 2; + case 302: + case 260: + return 1 | 2; + case 264: + if (ts2.isAmbientModule(node)) { + return 4 | 1; + } else if (ts2.getModuleInstanceState(node) === 1) { + return 4 | 1; + } else { + return 4; + } + case 263: + case 272: + case 273: + case 268: + case 269: + case 274: + case 275: + return 7; + case 308: + return 4 | 1; + } + return 7; + } + ts2.getMeaningFromDeclaration = getMeaningFromDeclaration; + function getMeaningFromLocation(node) { + node = getAdjustedReferenceLocation(node); + var parent2 = node.parent; + if (node.kind === 308) { + return 1; + } else if (ts2.isExportAssignment(parent2) || ts2.isExportSpecifier(parent2) || ts2.isExternalModuleReference(parent2) || ts2.isImportSpecifier(parent2) || ts2.isImportClause(parent2) || ts2.isImportEqualsDeclaration(parent2) && node === parent2.name) { + return 7; + } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { + return getMeaningFromRightHandSideOfImportEquals(node); + } else if (ts2.isDeclarationName(node)) { + return getMeaningFromDeclaration(parent2); + } else if (ts2.isEntityName(node) && ts2.findAncestor(node, ts2.or(ts2.isJSDocNameReference, ts2.isJSDocLinkLike, ts2.isJSDocMemberName))) { + return 7; + } else if (isTypeReference(node)) { + return 2; + } else if (isNamespaceReference(node)) { + return 4; + } else if (ts2.isTypeParameterDeclaration(parent2)) { + ts2.Debug.assert(ts2.isJSDocTemplateTag(parent2.parent)); + return 2; + } else if (ts2.isLiteralTypeNode(parent2)) { + return 2 | 1; + } else { + return 1; + } + } + ts2.getMeaningFromLocation = getMeaningFromLocation; + function getMeaningFromRightHandSideOfImportEquals(node) { + var name2 = node.kind === 163 ? node : ts2.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; + return name2 && name2.parent.kind === 268 ? 7 : 4; + } + function isInRightSideOfInternalImportEqualsDeclaration(node) { + while (node.parent.kind === 163) { + node = node.parent; + } + return ts2.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; + } + ts2.isInRightSideOfInternalImportEqualsDeclaration = isInRightSideOfInternalImportEqualsDeclaration; + function isNamespaceReference(node) { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + function isQualifiedNameNamespaceReference(node) { + var root2 = node; + var isLastClause = true; + if (root2.parent.kind === 163) { + while (root2.parent && root2.parent.kind === 163) { + root2 = root2.parent; + } + isLastClause = root2.right === node; + } + return root2.parent.kind === 180 && !isLastClause; + } + function isPropertyAccessNamespaceReference(node) { + var root2 = node; + var isLastClause = true; + if (root2.parent.kind === 208) { + while (root2.parent && root2.parent.kind === 208) { + root2 = root2.parent; + } + isLastClause = root2.name === node; + } + if (!isLastClause && root2.parent.kind === 230 && root2.parent.parent.kind === 294) { + var decl = root2.parent.parent.parent; + return decl.kind === 260 && root2.parent.parent.token === 117 || decl.kind === 261 && root2.parent.parent.token === 94; + } + return false; + } + function isTypeReference(node) { + if (ts2.isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + switch (node.kind) { + case 108: + return !ts2.isExpressionNode(node); + case 194: + return true; + } + switch (node.parent.kind) { + case 180: + return true; + case 202: + return !node.parent.isTypeOf; + case 230: + return ts2.isPartOfTypeNode(node.parent); + } + return false; + } + function isCallExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isCallExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + ts2.isCallExpressionTarget = isCallExpressionTarget; + function isNewExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + ts2.isNewExpressionTarget = isNewExpressionTarget; + function isCallOrNewExpressionTarget(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isCallOrNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + ts2.isCallOrNewExpressionTarget = isCallOrNewExpressionTarget; + function isTaggedTemplateTag(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isTaggedTemplateExpression, selectTagOfTaggedTemplateExpression, includeElementAccess, skipPastOuterExpressions); + } + ts2.isTaggedTemplateTag = isTaggedTemplateTag; + function isDecoratorTarget(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isDecorator, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + ts2.isDecoratorTarget = isDecoratorTarget; + function isJsxOpeningLikeElementTagName(node, includeElementAccess, skipPastOuterExpressions) { + if (includeElementAccess === void 0) { + includeElementAccess = false; + } + if (skipPastOuterExpressions === void 0) { + skipPastOuterExpressions = false; + } + return isCalleeWorker(node, ts2.isJsxOpeningLikeElement, selectTagNameOfJsxOpeningLikeElement, includeElementAccess, skipPastOuterExpressions); + } + ts2.isJsxOpeningLikeElementTagName = isJsxOpeningLikeElementTagName; + function selectExpressionOfCallOrNewExpressionOrDecorator(node) { + return node.expression; + } + function selectTagOfTaggedTemplateExpression(node) { + return node.tag; + } + function selectTagNameOfJsxOpeningLikeElement(node) { + return node.tagName; + } + function isCalleeWorker(node, pred, calleeSelector, includeElementAccess, skipPastOuterExpressions) { + var target = includeElementAccess ? climbPastPropertyOrElementAccess(node) : climbPastPropertyAccess(node); + if (skipPastOuterExpressions) { + target = ts2.skipOuterExpressions(target); + } + return !!target && !!target.parent && pred(target.parent) && calleeSelector(target.parent) === target; + } + function climbPastPropertyAccess(node) { + return isRightSideOfPropertyAccess(node) ? node.parent : node; + } + ts2.climbPastPropertyAccess = climbPastPropertyAccess; + function climbPastPropertyOrElementAccess(node) { + return isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node) ? node.parent : node; + } + ts2.climbPastPropertyOrElementAccess = climbPastPropertyOrElementAccess; + function getTargetLabel(referenceNode, labelName) { + while (referenceNode) { + if (referenceNode.kind === 253 && referenceNode.label.escapedText === labelName) { + return referenceNode.label; + } + referenceNode = referenceNode.parent; + } + return void 0; + } + ts2.getTargetLabel = getTargetLabel; + function hasPropertyAccessExpressionWithName(node, funcName) { + if (!ts2.isPropertyAccessExpression(node.expression)) { + return false; + } + return node.expression.name.text === funcName; + } + ts2.hasPropertyAccessExpressionWithName = hasPropertyAccessExpressionWithName; + function isJumpStatementTarget(node) { + var _a2; + return ts2.isIdentifier(node) && ((_a2 = ts2.tryCast(node.parent, ts2.isBreakOrContinueStatement)) === null || _a2 === void 0 ? void 0 : _a2.label) === node; + } + ts2.isJumpStatementTarget = isJumpStatementTarget; + function isLabelOfLabeledStatement(node) { + var _a2; + return ts2.isIdentifier(node) && ((_a2 = ts2.tryCast(node.parent, ts2.isLabeledStatement)) === null || _a2 === void 0 ? void 0 : _a2.label) === node; + } + ts2.isLabelOfLabeledStatement = isLabelOfLabeledStatement; + function isLabelName(node) { + return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); + } + ts2.isLabelName = isLabelName; + function isTagName(node) { + var _a2; + return ((_a2 = ts2.tryCast(node.parent, ts2.isJSDocTag)) === null || _a2 === void 0 ? void 0 : _a2.tagName) === node; + } + ts2.isTagName = isTagName; + function isRightSideOfQualifiedName(node) { + var _a2; + return ((_a2 = ts2.tryCast(node.parent, ts2.isQualifiedName)) === null || _a2 === void 0 ? void 0 : _a2.right) === node; + } + ts2.isRightSideOfQualifiedName = isRightSideOfQualifiedName; + function isRightSideOfPropertyAccess(node) { + var _a2; + return ((_a2 = ts2.tryCast(node.parent, ts2.isPropertyAccessExpression)) === null || _a2 === void 0 ? void 0 : _a2.name) === node; + } + ts2.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; + function isArgumentExpressionOfElementAccess(node) { + var _a2; + return ((_a2 = ts2.tryCast(node.parent, ts2.isElementAccessExpression)) === null || _a2 === void 0 ? void 0 : _a2.argumentExpression) === node; + } + ts2.isArgumentExpressionOfElementAccess = isArgumentExpressionOfElementAccess; + function isNameOfModuleDeclaration(node) { + var _a2; + return ((_a2 = ts2.tryCast(node.parent, ts2.isModuleDeclaration)) === null || _a2 === void 0 ? void 0 : _a2.name) === node; + } + ts2.isNameOfModuleDeclaration = isNameOfModuleDeclaration; + function isNameOfFunctionDeclaration(node) { + var _a2; + return ts2.isIdentifier(node) && ((_a2 = ts2.tryCast(node.parent, ts2.isFunctionLike)) === null || _a2 === void 0 ? void 0 : _a2.name) === node; + } + ts2.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; + function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { + switch (node.parent.kind) { + case 169: + case 168: + case 299: + case 302: + case 171: + case 170: + case 174: + case 175: + case 264: + return ts2.getNameOfDeclaration(node.parent) === node; + case 209: + return node.parent.argumentExpression === node; + case 164: + return true; + case 198: + return node.parent.parent.kind === 196; + default: + return false; + } + } + ts2.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; + function isExpressionOfExternalModuleImportEqualsDeclaration(node) { + return ts2.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts2.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node; + } + ts2.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; + function getContainerNode(node) { + if (ts2.isJSDocTypeAlias(node)) { + node = node.parent.parent; + } + while (true) { + node = node.parent; + if (!node) { + return void 0; + } + switch (node.kind) { + case 308: + case 171: + case 170: + case 259: + case 215: + case 174: + case 175: + case 260: + case 261: + case 263: + case 264: + return node; + } + } + } + ts2.getContainerNode = getContainerNode; + function getNodeKind(node) { + switch (node.kind) { + case 308: + return ts2.isExternalModule(node) ? "module" : "script"; + case 264: + return "module"; + case 260: + case 228: + return "class"; + case 261: + return "interface"; + case 262: + case 341: + case 348: + return "type"; + case 263: + return "enum"; + case 257: + return getKindOfVariableDeclaration(node); + case 205: + return getKindOfVariableDeclaration(ts2.getRootDeclaration(node)); + case 216: + case 259: + case 215: + return "function"; + case 174: + return "getter"; + case 175: + return "setter"; + case 171: + case 170: + return "method"; + case 299: + var initializer = node.initializer; + return ts2.isFunctionLike(initializer) ? "method" : "property"; + case 169: + case 168: + case 300: + case 301: + return "property"; + case 178: + return "index"; + case 177: + return "construct"; + case 176: + return "call"; + case 173: + case 172: + return "constructor"; + case 165: + return "type parameter"; + case 302: + return "enum member"; + case 166: + return ts2.hasSyntacticModifier( + node, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + ) ? "property" : "parameter"; + case 268: + case 273: + case 278: + case 271: + case 277: + return "alias"; + case 223: + var kind = ts2.getAssignmentDeclarationKind(node); + var right = node.right; + switch (kind) { + case 7: + case 8: + case 9: + case 0: + return ""; + case 1: + case 2: + var rightKind = getNodeKind(right); + return rightKind === "" ? "const" : rightKind; + case 3: + return ts2.isFunctionExpression(right) ? "method" : "property"; + case 4: + return "property"; + case 5: + return ts2.isFunctionExpression(right) ? "method" : "property"; + case 6: + return "local class"; + default: { + ts2.assertType(kind); + return ""; + } + } + case 79: + return ts2.isImportClause(node.parent) ? "alias" : ""; + case 274: + var scriptKind = getNodeKind(node.expression); + return scriptKind === "" ? "const" : scriptKind; + default: + return ""; + } + function getKindOfVariableDeclaration(v8) { + return ts2.isVarConst(v8) ? "const" : ts2.isLet(v8) ? "let" : "var"; + } + } + ts2.getNodeKind = getNodeKind; + function isThis(node) { + switch (node.kind) { + case 108: + return true; + case 79: + return ts2.identifierIsThisKeyword(node) && node.parent.kind === 166; + default: + return false; + } + } + ts2.isThis = isThis; + var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= range2.end; + } + ts2.startEndContainsRange = startEndContainsRange; + function rangeContainsStartEnd(range2, start, end) { + return range2.pos <= start && range2.end >= end; + } + ts2.rangeContainsStartEnd = rangeContainsStartEnd; + function rangeOverlapsWithStartEnd(r1, start, end) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + ts2.rangeOverlapsWithStartEnd = rangeOverlapsWithStartEnd; + function nodeOverlapsWithStartEnd(node, sourceFile, start, end) { + return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end, start, end); + } + ts2.nodeOverlapsWithStartEnd = nodeOverlapsWithStartEnd; + function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { + var start = Math.max(start1, start2); + var end = Math.min(end1, end2); + return start < end; + } + ts2.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; + function positionBelongsToNode(candidate, position, sourceFile) { + ts2.Debug.assert(candidate.pos <= position); + return position < candidate.end || !isCompletedNode(candidate, sourceFile); + } + ts2.positionBelongsToNode = positionBelongsToNode; + function isCompletedNode(n7, sourceFile) { + if (n7 === void 0 || ts2.nodeIsMissing(n7)) { + return false; + } + switch (n7.kind) { + case 260: + case 261: + case 263: + case 207: + case 203: + case 184: + case 238: + case 265: + case 266: + case 272: + case 276: + return nodeEndsWith(n7, 19, sourceFile); + case 295: + return isCompletedNode(n7.block, sourceFile); + case 211: + if (!n7.arguments) { + return true; + } + case 210: + case 214: + case 193: + return nodeEndsWith(n7, 21, sourceFile); + case 181: + case 182: + return isCompletedNode(n7.type, sourceFile); + case 173: + case 174: + case 175: + case 259: + case 215: + case 171: + case 170: + case 177: + case 176: + case 216: + if (n7.body) { + return isCompletedNode(n7.body, sourceFile); + } + if (n7.type) { + return isCompletedNode(n7.type, sourceFile); + } + return hasChildOfKind(n7, 21, sourceFile); + case 264: + return !!n7.body && isCompletedNode(n7.body, sourceFile); + case 242: + if (n7.elseStatement) { + return isCompletedNode(n7.elseStatement, sourceFile); + } + return isCompletedNode(n7.thenStatement, sourceFile); + case 241: + return isCompletedNode(n7.expression, sourceFile) || hasChildOfKind(n7, 26, sourceFile); + case 206: + case 204: + case 209: + case 164: + case 186: + return nodeEndsWith(n7, 23, sourceFile); + case 178: + if (n7.type) { + return isCompletedNode(n7.type, sourceFile); + } + return hasChildOfKind(n7, 23, sourceFile); + case 292: + case 293: + return false; + case 245: + case 246: + case 247: + case 244: + return isCompletedNode(n7.statement, sourceFile); + case 243: + return hasChildOfKind(n7, 115, sourceFile) ? nodeEndsWith(n7, 21, sourceFile) : isCompletedNode(n7.statement, sourceFile); + case 183: + return isCompletedNode(n7.exprName, sourceFile); + case 218: + case 217: + case 219: + case 226: + case 227: + var unaryWordExpression = n7; + return isCompletedNode(unaryWordExpression.expression, sourceFile); + case 212: + return isCompletedNode(n7.template, sourceFile); + case 225: + var lastSpan = ts2.lastOrUndefined(n7.templateSpans); + return isCompletedNode(lastSpan, sourceFile); + case 236: + return ts2.nodeIsPresent(n7.literal); + case 275: + case 269: + return ts2.nodeIsPresent(n7.moduleSpecifier); + case 221: + return isCompletedNode(n7.operand, sourceFile); + case 223: + return isCompletedNode(n7.right, sourceFile); + case 224: + return isCompletedNode(n7.whenFalse, sourceFile); + default: + return true; + } + } + function nodeEndsWith(n7, expectedLastToken, sourceFile) { + var children = n7.getChildren(sourceFile); + if (children.length) { + var lastChild = ts2.last(children); + if (lastChild.kind === expectedLastToken) { + return true; + } else if (lastChild.kind === 26 && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } + function findListItemInfo(node) { + var list = findContainingList(node); + if (!list) { + return void 0; + } + var children = list.getChildren(); + var listItemIndex = ts2.indexOfNode(children, node); + return { + listItemIndex, + list + }; + } + ts2.findListItemInfo = findListItemInfo; + function hasChildOfKind(n7, kind, sourceFile) { + return !!findChildOfKind(n7, kind, sourceFile); + } + ts2.hasChildOfKind = hasChildOfKind; + function findChildOfKind(n7, kind, sourceFile) { + return ts2.find(n7.getChildren(sourceFile), function(c7) { + return c7.kind === kind; + }); + } + ts2.findChildOfKind = findChildOfKind; + function findContainingList(node) { + var syntaxList = ts2.find(node.parent.getChildren(), function(c7) { + return ts2.isSyntaxList(c7) && rangeContainsRange(c7, node); + }); + ts2.Debug.assert(!syntaxList || ts2.contains(syntaxList.getChildren(), node)); + return syntaxList; + } + ts2.findContainingList = findContainingList; + function isDefaultModifier(node) { + return node.kind === 88; + } + function isClassKeyword(node) { + return node.kind === 84; + } + function isFunctionKeyword(node) { + return node.kind === 98; + } + function getAdjustedLocationForClass(node) { + if (ts2.isNamedDeclaration(node)) { + return node.name; + } + if (ts2.isClassDeclaration(node)) { + var defaultModifier = node.modifiers && ts2.find(node.modifiers, isDefaultModifier); + if (defaultModifier) + return defaultModifier; + } + if (ts2.isClassExpression(node)) { + var classKeyword = ts2.find(node.getChildren(), isClassKeyword); + if (classKeyword) + return classKeyword; + } + } + function getAdjustedLocationForFunction(node) { + if (ts2.isNamedDeclaration(node)) { + return node.name; + } + if (ts2.isFunctionDeclaration(node)) { + var defaultModifier = ts2.find(node.modifiers, isDefaultModifier); + if (defaultModifier) + return defaultModifier; + } + if (ts2.isFunctionExpression(node)) { + var functionKeyword = ts2.find(node.getChildren(), isFunctionKeyword); + if (functionKeyword) + return functionKeyword; + } + } + function getAncestorTypeNode(node) { + var lastTypeNode; + ts2.findAncestor(node, function(a7) { + if (ts2.isTypeNode(a7)) { + lastTypeNode = a7; + } + return !ts2.isQualifiedName(a7.parent) && !ts2.isTypeNode(a7.parent) && !ts2.isTypeElement(a7.parent); + }); + return lastTypeNode; + } + function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { + if (node.flags & (8388608 & ~262144)) + return void 0; + var contextualType = getContextualTypeFromParent(node, checker); + if (contextualType) + return contextualType; + var ancestorTypeNode = getAncestorTypeNode(node); + return ancestorTypeNode && checker.getTypeAtLocation(ancestorTypeNode); + } + ts2.getContextualTypeFromParentOrAncestorTypeNode = getContextualTypeFromParentOrAncestorTypeNode; + function getAdjustedLocationForDeclaration(node, forRename) { + if (!forRename) { + switch (node.kind) { + case 260: + case 228: + return getAdjustedLocationForClass(node); + case 259: + case 215: + return getAdjustedLocationForFunction(node); + case 173: + return node; + } + } + if (ts2.isNamedDeclaration(node)) { + return node.name; + } + } + function getAdjustedLocationForImportDeclaration(node, forRename) { + if (node.importClause) { + if (node.importClause.name && node.importClause.namedBindings) { + return; + } + if (node.importClause.name) { + return node.importClause.name; + } + if (node.importClause.namedBindings) { + if (ts2.isNamedImports(node.importClause.namedBindings)) { + var onlyBinding = ts2.singleOrUndefined(node.importClause.namedBindings.elements); + if (!onlyBinding) { + return; + } + return onlyBinding.name; + } else if (ts2.isNamespaceImport(node.importClause.namedBindings)) { + return node.importClause.namedBindings.name; + } + } + } + if (!forRename) { + return node.moduleSpecifier; + } + } + function getAdjustedLocationForExportDeclaration(node, forRename) { + if (node.exportClause) { + if (ts2.isNamedExports(node.exportClause)) { + var onlyBinding = ts2.singleOrUndefined(node.exportClause.elements); + if (!onlyBinding) { + return; + } + return node.exportClause.elements[0].name; + } else if (ts2.isNamespaceExport(node.exportClause)) { + return node.exportClause.name; + } + } + if (!forRename) { + return node.moduleSpecifier; + } + } + function getAdjustedLocationForHeritageClause(node) { + if (node.types.length === 1) { + return node.types[0].expression; + } + } + function getAdjustedLocation(node, forRename) { + var parent2 = node.parent; + if (ts2.isModifier(node) && (forRename || node.kind !== 88) ? ts2.canHaveModifiers(parent2) && ts2.contains(parent2.modifiers, node) : node.kind === 84 ? ts2.isClassDeclaration(parent2) || ts2.isClassExpression(node) : node.kind === 98 ? ts2.isFunctionDeclaration(parent2) || ts2.isFunctionExpression(node) : node.kind === 118 ? ts2.isInterfaceDeclaration(parent2) : node.kind === 92 ? ts2.isEnumDeclaration(parent2) : node.kind === 154 ? ts2.isTypeAliasDeclaration(parent2) : node.kind === 143 || node.kind === 142 ? ts2.isModuleDeclaration(parent2) : node.kind === 100 ? ts2.isImportEqualsDeclaration(parent2) : node.kind === 137 ? ts2.isGetAccessorDeclaration(parent2) : node.kind === 151 && ts2.isSetAccessorDeclaration(parent2)) { + var location2 = getAdjustedLocationForDeclaration(parent2, forRename); + if (location2) { + return location2; + } + } + if ((node.kind === 113 || node.kind === 85 || node.kind === 119) && ts2.isVariableDeclarationList(parent2) && parent2.declarations.length === 1) { + var decl = parent2.declarations[0]; + if (ts2.isIdentifier(decl.name)) { + return decl.name; + } + } + if (node.kind === 154) { + if (ts2.isImportClause(parent2) && parent2.isTypeOnly) { + var location2 = getAdjustedLocationForImportDeclaration(parent2.parent, forRename); + if (location2) { + return location2; + } + } + if (ts2.isExportDeclaration(parent2) && parent2.isTypeOnly) { + var location2 = getAdjustedLocationForExportDeclaration(parent2, forRename); + if (location2) { + return location2; + } + } + } + if (node.kind === 128) { + if (ts2.isImportSpecifier(parent2) && parent2.propertyName || ts2.isExportSpecifier(parent2) && parent2.propertyName || ts2.isNamespaceImport(parent2) || ts2.isNamespaceExport(parent2)) { + return parent2.name; + } + if (ts2.isExportDeclaration(parent2) && parent2.exportClause && ts2.isNamespaceExport(parent2.exportClause)) { + return parent2.exportClause.name; + } + } + if (node.kind === 100 && ts2.isImportDeclaration(parent2)) { + var location2 = getAdjustedLocationForImportDeclaration(parent2, forRename); + if (location2) { + return location2; + } + } + if (node.kind === 93) { + if (ts2.isExportDeclaration(parent2)) { + var location2 = getAdjustedLocationForExportDeclaration(parent2, forRename); + if (location2) { + return location2; + } + } + if (ts2.isExportAssignment(parent2)) { + return ts2.skipOuterExpressions(parent2.expression); + } + } + if (node.kind === 147 && ts2.isExternalModuleReference(parent2)) { + return parent2.expression; + } + if (node.kind === 158 && (ts2.isImportDeclaration(parent2) || ts2.isExportDeclaration(parent2)) && parent2.moduleSpecifier) { + return parent2.moduleSpecifier; + } + if ((node.kind === 94 || node.kind === 117) && ts2.isHeritageClause(parent2) && parent2.token === node.kind) { + var location2 = getAdjustedLocationForHeritageClause(parent2); + if (location2) { + return location2; + } + } + if (node.kind === 94) { + if (ts2.isTypeParameterDeclaration(parent2) && parent2.constraint && ts2.isTypeReferenceNode(parent2.constraint)) { + return parent2.constraint.typeName; + } + if (ts2.isConditionalTypeNode(parent2) && ts2.isTypeReferenceNode(parent2.extendsType)) { + return parent2.extendsType.typeName; + } + } + if (node.kind === 138 && ts2.isInferTypeNode(parent2)) { + return parent2.typeParameter.name; + } + if (node.kind === 101 && ts2.isTypeParameterDeclaration(parent2) && ts2.isMappedTypeNode(parent2.parent)) { + return parent2.name; + } + if (node.kind === 141 && ts2.isTypeOperatorNode(parent2) && parent2.operator === 141 && ts2.isTypeReferenceNode(parent2.type)) { + return parent2.type.typeName; + } + if (node.kind === 146 && ts2.isTypeOperatorNode(parent2) && parent2.operator === 146 && ts2.isArrayTypeNode(parent2.type) && ts2.isTypeReferenceNode(parent2.type.elementType)) { + return parent2.type.elementType.typeName; + } + if (!forRename) { + if (node.kind === 103 && ts2.isNewExpression(parent2) || node.kind === 114 && ts2.isVoidExpression(parent2) || node.kind === 112 && ts2.isTypeOfExpression(parent2) || node.kind === 133 && ts2.isAwaitExpression(parent2) || node.kind === 125 && ts2.isYieldExpression(parent2) || node.kind === 89 && ts2.isDeleteExpression(parent2)) { + if (parent2.expression) { + return ts2.skipOuterExpressions(parent2.expression); + } + } + if ((node.kind === 101 || node.kind === 102) && ts2.isBinaryExpression(parent2) && parent2.operatorToken === node) { + return ts2.skipOuterExpressions(parent2.right); + } + if (node.kind === 128 && ts2.isAsExpression(parent2) && ts2.isTypeReferenceNode(parent2.type)) { + return parent2.type.typeName; + } + if (node.kind === 101 && ts2.isForInStatement(parent2) || node.kind === 162 && ts2.isForOfStatement(parent2)) { + return ts2.skipOuterExpressions(parent2.expression); + } + } + return node; + } + function getAdjustedReferenceLocation(node) { + return getAdjustedLocation( + node, + /*forRename*/ + false + ); + } + ts2.getAdjustedReferenceLocation = getAdjustedReferenceLocation; + function getAdjustedRenameLocation(node) { + return getAdjustedLocation( + node, + /*forRename*/ + true + ); + } + ts2.getAdjustedRenameLocation = getAdjustedRenameLocation; + function getTouchingPropertyName(sourceFile, position) { + return getTouchingToken(sourceFile, position, function(n7) { + return ts2.isPropertyNameLiteral(n7) || ts2.isKeyword(n7.kind) || ts2.isPrivateIdentifier(n7); + }); + } + ts2.getTouchingPropertyName = getTouchingPropertyName; + function getTouchingToken(sourceFile, position, includePrecedingTokenAtEndPosition) { + return getTokenAtPositionWorker( + sourceFile, + position, + /*allowPositionInLeadingTrivia*/ + false, + includePrecedingTokenAtEndPosition, + /*includeEndPosition*/ + false + ); + } + ts2.getTouchingToken = getTouchingToken; + function getTokenAtPosition(sourceFile, position) { + return getTokenAtPositionWorker( + sourceFile, + position, + /*allowPositionInLeadingTrivia*/ + true, + /*includePrecedingTokenAtEndPosition*/ + void 0, + /*includeEndPosition*/ + false + ); + } + ts2.getTokenAtPosition = getTokenAtPosition; + function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includePrecedingTokenAtEndPosition, includeEndPosition) { + var current = sourceFile; + var foundToken; + var _loop_1 = function() { + var children = current.getChildren(sourceFile); + var i7 = ts2.binarySearchKey(children, position, function(_6, i8) { + return i8; + }, function(middle, _6) { + var end = children[middle].getEnd(); + if (end < position) { + return -1; + } + var start = allowPositionInLeadingTrivia ? children[middle].getFullStart() : children[middle].getStart( + sourceFile, + /*includeJsDoc*/ + true + ); + if (start > position) { + return 1; + } + if (nodeContainsPosition(children[middle], start, end)) { + if (children[middle - 1]) { + if (nodeContainsPosition(children[middle - 1])) { + return 1; + } + } + return 0; + } + if (includePrecedingTokenAtEndPosition && start === position && children[middle - 1] && children[middle - 1].getEnd() === position && nodeContainsPosition(children[middle - 1])) { + return 1; + } + return -1; + }); + if (foundToken) { + return { value: foundToken }; + } + if (i7 >= 0 && children[i7]) { + current = children[i7]; + return "continue-outer"; + } + return { value: current }; + }; + outer: + while (true) { + var state_1 = _loop_1(); + if (typeof state_1 === "object") + return state_1.value; + switch (state_1) { + case "continue-outer": + continue outer; + } + } + function nodeContainsPosition(node, start, end) { + end !== null && end !== void 0 ? end : end = node.getEnd(); + if (end < position) { + return false; + } + start !== null && start !== void 0 ? start : start = allowPositionInLeadingTrivia ? node.getFullStart() : node.getStart( + sourceFile, + /*includeJsDoc*/ + true + ); + if (start > position) { + return false; + } + if (position < end || position === end && (node.kind === 1 || includeEndPosition)) { + return true; + } else if (includePrecedingTokenAtEndPosition && end === position) { + var previousToken = findPrecedingToken(position, sourceFile, node); + if (previousToken && includePrecedingTokenAtEndPosition(previousToken)) { + foundToken = previousToken; + return true; + } + } + return false; + } + } + function findFirstNonJsxWhitespaceToken(sourceFile, position) { + var tokenAtPosition = getTokenAtPosition(sourceFile, position); + while (isWhiteSpaceOnlyJsxText(tokenAtPosition)) { + var nextToken = findNextToken(tokenAtPosition, tokenAtPosition.parent, sourceFile); + if (!nextToken) + return; + tokenAtPosition = nextToken; + } + return tokenAtPosition; + } + ts2.findFirstNonJsxWhitespaceToken = findFirstNonJsxWhitespaceToken; + function findTokenOnLeftOfPosition(file, position) { + var tokenAtPosition = getTokenAtPosition(file, position); + if (ts2.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + return tokenAtPosition; + } + return findPrecedingToken(position, file); + } + ts2.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; + function findNextToken(previousToken, parent2, sourceFile) { + return find2(parent2); + function find2(n7) { + if (ts2.isToken(n7) && n7.pos === previousToken.end) { + return n7; + } + return ts2.firstDefined(n7.getChildren(sourceFile), function(child) { + var shouldDiveInChildNode = ( + // previous token is enclosed somewhere in the child + child.pos <= previousToken.pos && child.end > previousToken.end || // previous token ends exactly at the beginning of child + child.pos === previousToken.end + ); + return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find2(child) : void 0; + }); + } + } + ts2.findNextToken = findNextToken; + function findPrecedingToken(position, sourceFile, startNode, excludeJsdoc) { + var result2 = find2(startNode || sourceFile); + ts2.Debug.assert(!(result2 && isWhiteSpaceOnlyJsxText(result2))); + return result2; + function find2(n7) { + if (isNonWhitespaceToken(n7) && n7.kind !== 1) { + return n7; + } + var children = n7.getChildren(sourceFile); + var i7 = ts2.binarySearchKey(children, position, function(_6, i8) { + return i8; + }, function(middle, _6) { + if (position < children[middle].end) { + if (!children[middle - 1] || position >= children[middle - 1].end) { + return 0; + } + return 1; + } + return -1; + }); + if (i7 >= 0 && children[i7]) { + var child = children[i7]; + if (position < child.end) { + var start = child.getStart( + sourceFile, + /*includeJsDoc*/ + !excludeJsdoc + ); + var lookInPreviousChild = start >= position || // cursor in the leading trivia + !nodeHasTokens(child, sourceFile) || isWhiteSpaceOnlyJsxText(child); + if (lookInPreviousChild) { + var candidate_1 = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + i7, + sourceFile, + n7.kind + ); + return candidate_1 && findRightmostToken(candidate_1, sourceFile); + } else { + return find2(child); + } + } + } + ts2.Debug.assert(startNode !== void 0 || n7.kind === 308 || n7.kind === 1 || ts2.isJSDocCommentContainingNode(n7)); + var candidate = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + children.length, + sourceFile, + n7.kind + ); + return candidate && findRightmostToken(candidate, sourceFile); + } + } + ts2.findPrecedingToken = findPrecedingToken; + function isNonWhitespaceToken(n7) { + return ts2.isToken(n7) && !isWhiteSpaceOnlyJsxText(n7); + } + function findRightmostToken(n7, sourceFile) { + if (isNonWhitespaceToken(n7)) { + return n7; + } + var children = n7.getChildren(sourceFile); + if (children.length === 0) { + return n7; + } + var candidate = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + children.length, + sourceFile, + n7.kind + ); + return candidate && findRightmostToken(candidate, sourceFile); + } + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile, parentKind) { + for (var i7 = exclusiveStartPosition - 1; i7 >= 0; i7--) { + var child = children[i7]; + if (isWhiteSpaceOnlyJsxText(child)) { + if (i7 === 0 && (parentKind === 11 || parentKind === 282)) { + ts2.Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + } else if (nodeHasTokens(children[i7], sourceFile)) { + return children[i7]; + } + } + } + function isInString(sourceFile, position, previousToken) { + if (previousToken === void 0) { + previousToken = findPrecedingToken(position, sourceFile); + } + if (previousToken && ts2.isStringTextContainingNode(previousToken)) { + var start = previousToken.getStart(sourceFile); + var end = previousToken.getEnd(); + if (start < position && position < end) { + return true; + } + if (position === end) { + return !!previousToken.isUnterminated; + } + } + return false; + } + ts2.isInString = isInString; + function isInsideJsxElementOrAttribute(sourceFile, position) { + var token = getTokenAtPosition(sourceFile, position); + if (!token) { + return false; + } + if (token.kind === 11) { + return true; + } + if (token.kind === 29 && token.parent.kind === 11) { + return true; + } + if (token.kind === 29 && token.parent.kind === 291) { + return true; + } + if (token && token.kind === 19 && token.parent.kind === 291) { + return true; + } + if (token.kind === 29 && token.parent.kind === 284) { + return true; + } + return false; + } + ts2.isInsideJsxElementOrAttribute = isInsideJsxElementOrAttribute; + function isWhiteSpaceOnlyJsxText(node) { + return ts2.isJsxText(node) && node.containsOnlyTriviaWhiteSpaces; + } + function isInTemplateString(sourceFile, position) { + var token = getTokenAtPosition(sourceFile, position); + return ts2.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); + } + ts2.isInTemplateString = isInTemplateString; + function isInJSXText(sourceFile, position) { + var token = getTokenAtPosition(sourceFile, position); + if (ts2.isJsxText(token)) { + return true; + } + if (token.kind === 18 && ts2.isJsxExpression(token.parent) && ts2.isJsxElement(token.parent.parent)) { + return true; + } + if (token.kind === 29 && ts2.isJsxOpeningLikeElement(token.parent) && ts2.isJsxElement(token.parent.parent)) { + return true; + } + return false; + } + ts2.isInJSXText = isInJSXText; + function isInsideJsxElement(sourceFile, position) { + function isInsideJsxElementTraversal(node) { + while (node) { + if (node.kind >= 282 && node.kind <= 291 || node.kind === 11 || node.kind === 29 || node.kind === 31 || node.kind === 79 || node.kind === 19 || node.kind === 18 || node.kind === 43) { + node = node.parent; + } else if (node.kind === 281) { + if (position > node.getStart(sourceFile)) + return true; + node = node.parent; + } else { + return false; + } + } + return false; + } + return isInsideJsxElementTraversal(getTokenAtPosition(sourceFile, position)); + } + ts2.isInsideJsxElement = isInsideJsxElement; + function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) { + var closeTokenText = ts2.tokenToString(token.kind); + var matchingTokenText = ts2.tokenToString(matchingTokenKind); + var tokenFullStart = token.getFullStart(); + var bestGuessIndex = sourceFile.text.lastIndexOf(matchingTokenText, tokenFullStart); + if (bestGuessIndex === -1) { + return void 0; + } + if (sourceFile.text.lastIndexOf(closeTokenText, tokenFullStart - 1) < bestGuessIndex) { + var nodeAtGuess = findPrecedingToken(bestGuessIndex + 1, sourceFile); + if (nodeAtGuess && nodeAtGuess.kind === matchingTokenKind) { + return nodeAtGuess; + } + } + var tokenKind = token.kind; + var remainingMatchingTokens = 0; + while (true) { + var preceding = findPrecedingToken(token.getFullStart(), sourceFile); + if (!preceding) { + return void 0; + } + token = preceding; + if (token.kind === matchingTokenKind) { + if (remainingMatchingTokens === 0) { + return token; + } + remainingMatchingTokens--; + } else if (token.kind === tokenKind) { + remainingMatchingTokens++; + } + } + } + ts2.findPrecedingMatchingToken = findPrecedingMatchingToken; + function removeOptionality(type3, isOptionalExpression, isOptionalChain) { + return isOptionalExpression ? type3.getNonNullableType() : isOptionalChain ? type3.getNonOptionalType() : type3; + } + ts2.removeOptionality = removeOptionality; + function isPossiblyTypeArgumentPosition(token, sourceFile, checker) { + var info2 = getPossibleTypeArgumentsInfo(token, sourceFile); + return info2 !== void 0 && (ts2.isPartOfTypeNode(info2.called) || getPossibleGenericSignatures(info2.called, info2.nTypeArguments, checker).length !== 0 || isPossiblyTypeArgumentPosition(info2.called, sourceFile, checker)); + } + ts2.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition; + function getPossibleGenericSignatures(called, typeArgumentCount, checker) { + var type3 = checker.getTypeAtLocation(called); + if (ts2.isOptionalChain(called.parent)) { + type3 = removeOptionality( + type3, + ts2.isOptionalChainRoot(called.parent), + /*isOptionalChain*/ + true + ); + } + var signatures = ts2.isNewExpression(called.parent) ? type3.getConstructSignatures() : type3.getCallSignatures(); + return signatures.filter(function(candidate) { + return !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount; + }); + } + ts2.getPossibleGenericSignatures = getPossibleGenericSignatures; + function getPossibleTypeArgumentsInfo(tokenIn, sourceFile) { + if (sourceFile.text.lastIndexOf("<", tokenIn ? tokenIn.pos : sourceFile.text.length) === -1) { + return void 0; + } + var token = tokenIn; + var remainingLessThanTokens = 0; + var nTypeArguments = 0; + while (token) { + switch (token.kind) { + case 29: + token = findPrecedingToken(token.getFullStart(), sourceFile); + if (token && token.kind === 28) { + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + if (!token || !ts2.isIdentifier(token)) + return void 0; + if (!remainingLessThanTokens) { + return ts2.isDeclarationName(token) ? void 0 : { called: token, nTypeArguments }; + } + remainingLessThanTokens--; + break; + case 49: + remainingLessThanTokens = 3; + break; + case 48: + remainingLessThanTokens = 2; + break; + case 31: + remainingLessThanTokens++; + break; + case 19: + token = findPrecedingMatchingToken(token, 18, sourceFile); + if (!token) + return void 0; + break; + case 21: + token = findPrecedingMatchingToken(token, 20, sourceFile); + if (!token) + return void 0; + break; + case 23: + token = findPrecedingMatchingToken(token, 22, sourceFile); + if (!token) + return void 0; + break; + case 27: + nTypeArguments++; + break; + case 38: + case 79: + case 10: + case 8: + case 9: + case 110: + case 95: + case 112: + case 94: + case 141: + case 24: + case 51: + case 57: + case 58: + break; + default: + if (ts2.isTypeNode(token)) { + break; + } + return void 0; + } + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + return void 0; + } + ts2.getPossibleTypeArgumentsInfo = getPossibleTypeArgumentsInfo; + function isInComment(sourceFile, position, tokenAtPosition) { + return ts2.formatting.getRangeOfEnclosingComment( + sourceFile, + position, + /*precedingToken*/ + void 0, + tokenAtPosition + ); + } + ts2.isInComment = isInComment; + function hasDocComment(sourceFile, position) { + var token = getTokenAtPosition(sourceFile, position); + return !!ts2.findAncestor(token, ts2.isJSDoc); + } + ts2.hasDocComment = hasDocComment; + function nodeHasTokens(n7, sourceFile) { + return n7.kind === 1 ? !!n7.jsDoc : n7.getWidth(sourceFile) !== 0; + } + function getNodeModifiers(node, excludeFlags) { + if (excludeFlags === void 0) { + excludeFlags = 0; + } + var result2 = []; + var flags = ts2.isDeclaration(node) ? ts2.getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0; + if (flags & 8) + result2.push( + "private" + /* ScriptElementKindModifier.privateMemberModifier */ + ); + if (flags & 16) + result2.push( + "protected" + /* ScriptElementKindModifier.protectedMemberModifier */ + ); + if (flags & 4) + result2.push( + "public" + /* ScriptElementKindModifier.publicMemberModifier */ + ); + if (flags & 32 || ts2.isClassStaticBlockDeclaration(node)) + result2.push( + "static" + /* ScriptElementKindModifier.staticModifier */ + ); + if (flags & 256) + result2.push( + "abstract" + /* ScriptElementKindModifier.abstractModifier */ + ); + if (flags & 1) + result2.push( + "export" + /* ScriptElementKindModifier.exportedModifier */ + ); + if (flags & 8192) + result2.push( + "deprecated" + /* ScriptElementKindModifier.deprecatedModifier */ + ); + if (node.flags & 16777216) + result2.push( + "declare" + /* ScriptElementKindModifier.ambientModifier */ + ); + if (node.kind === 274) + result2.push( + "export" + /* ScriptElementKindModifier.exportedModifier */ + ); + return result2.length > 0 ? result2.join(",") : ""; + } + ts2.getNodeModifiers = getNodeModifiers; + function getTypeArgumentOrTypeParameterList(node) { + if (node.kind === 180 || node.kind === 210) { + return node.typeArguments; + } + if (ts2.isFunctionLike(node) || node.kind === 260 || node.kind === 261) { + return node.typeParameters; + } + return void 0; + } + ts2.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; + function isComment(kind) { + return kind === 2 || kind === 3; + } + ts2.isComment = isComment; + function isStringOrRegularExpressionOrTemplateLiteral(kind) { + if (kind === 10 || kind === 13 || ts2.isTemplateLiteralKind(kind)) { + return true; + } + return false; + } + ts2.isStringOrRegularExpressionOrTemplateLiteral = isStringOrRegularExpressionOrTemplateLiteral; + function isPunctuation(kind) { + return 18 <= kind && kind <= 78; + } + ts2.isPunctuation = isPunctuation; + function isInsideTemplateLiteral(node, position, sourceFile) { + return ts2.isTemplateLiteralKind(node.kind) && (node.getStart(sourceFile) < position && position < node.end) || !!node.isUnterminated && position === node.end; + } + ts2.isInsideTemplateLiteral = isInsideTemplateLiteral; + function isAccessibilityModifier(kind) { + switch (kind) { + case 123: + case 121: + case 122: + return true; + } + return false; + } + ts2.isAccessibilityModifier = isAccessibilityModifier; + function cloneCompilerOptions(options) { + var result2 = ts2.clone(options); + ts2.setConfigFileInOptions(result2, options && options.configFile); + return result2; + } + ts2.cloneCompilerOptions = cloneCompilerOptions; + function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { + if (node.kind === 206 || node.kind === 207) { + if (node.parent.kind === 223 && node.parent.left === node && node.parent.operatorToken.kind === 63) { + return true; + } + if (node.parent.kind === 247 && node.parent.initializer === node) { + return true; + } + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 299 ? node.parent.parent : node.parent)) { + return true; + } + } + return false; + } + ts2.isArrayLiteralOrObjectLiteralDestructuringPattern = isArrayLiteralOrObjectLiteralDestructuringPattern; + function isInReferenceComment(sourceFile, position) { + return isInReferenceCommentWorker( + sourceFile, + position, + /*shouldBeReference*/ + true + ); + } + ts2.isInReferenceComment = isInReferenceComment; + function isInNonReferenceComment(sourceFile, position) { + return isInReferenceCommentWorker( + sourceFile, + position, + /*shouldBeReference*/ + false + ); + } + ts2.isInNonReferenceComment = isInNonReferenceComment; + function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) { + var range2 = isInComment( + sourceFile, + position, + /*tokenAtPosition*/ + void 0 + ); + return !!range2 && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range2.pos, range2.end)); + } + function getReplacementSpanForContextToken(contextToken) { + if (!contextToken) + return void 0; + switch (contextToken.kind) { + case 10: + case 14: + return createTextSpanFromStringLiteralLikeContent(contextToken); + default: + return createTextSpanFromNode(contextToken); + } + } + ts2.getReplacementSpanForContextToken = getReplacementSpanForContextToken; + function createTextSpanFromNode(node, sourceFile, endNode) { + return ts2.createTextSpanFromBounds(node.getStart(sourceFile), (endNode || node).getEnd()); + } + ts2.createTextSpanFromNode = createTextSpanFromNode; + function createTextSpanFromStringLiteralLikeContent(node) { + if (node.isUnterminated) + return void 0; + return ts2.createTextSpanFromBounds(node.getStart() + 1, node.getEnd() - 1); + } + ts2.createTextSpanFromStringLiteralLikeContent = createTextSpanFromStringLiteralLikeContent; + function createTextRangeFromNode(node, sourceFile) { + return ts2.createRange(node.getStart(sourceFile), node.end); + } + ts2.createTextRangeFromNode = createTextRangeFromNode; + function createTextSpanFromRange(range2) { + return ts2.createTextSpanFromBounds(range2.pos, range2.end); + } + ts2.createTextSpanFromRange = createTextSpanFromRange; + function createTextRangeFromSpan(span) { + return ts2.createRange(span.start, span.start + span.length); + } + ts2.createTextRangeFromSpan = createTextRangeFromSpan; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts2.createTextSpan(start, length), newText); + } + ts2.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span, newText }; + } + ts2.createTextChange = createTextChange; + ts2.typeKeywords = [ + 131, + 129, + 160, + 134, + 95, + 138, + 141, + 144, + 104, + 148, + 149, + 146, + 152, + 153, + 110, + 114, + 155, + 156, + 157 + ]; + function isTypeKeyword(kind) { + return ts2.contains(ts2.typeKeywords, kind); + } + ts2.isTypeKeyword = isTypeKeyword; + function isTypeKeywordToken(node) { + return node.kind === 154; + } + ts2.isTypeKeywordToken = isTypeKeywordToken; + function isTypeKeywordTokenOrIdentifier(node) { + return isTypeKeywordToken(node) || ts2.isIdentifier(node) && node.text === "type"; + } + ts2.isTypeKeywordTokenOrIdentifier = isTypeKeywordTokenOrIdentifier; + function isExternalModuleSymbol(moduleSymbol) { + return !!(moduleSymbol.flags & 1536) && moduleSymbol.name.charCodeAt(0) === 34; + } + ts2.isExternalModuleSymbol = isExternalModuleSymbol; + function nodeSeenTracker() { + var seen = []; + return function(node) { + var id = ts2.getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + ts2.nodeSeenTracker = nodeSeenTracker; + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + ts2.getSnapshotText = getSnapshotText; + function repeatString(str2, count2) { + var result2 = ""; + for (var i7 = 0; i7 < count2; i7++) { + result2 += str2; + } + return result2; + } + ts2.repeatString = repeatString; + function skipConstraint(type3) { + return type3.isTypeParameter() ? type3.getConstraint() || type3 : type3; + } + ts2.skipConstraint = skipConstraint; + function getNameFromPropertyName(name2) { + return name2.kind === 164 ? ts2.isStringOrNumericLiteralLike(name2.expression) ? name2.expression.text : void 0 : ts2.isPrivateIdentifier(name2) ? ts2.idText(name2) : ts2.getTextOfIdentifierOrLiteral(name2); + } + ts2.getNameFromPropertyName = getNameFromPropertyName; + function programContainsModules(program) { + return program.getSourceFiles().some(function(s7) { + return !s7.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s7) && !!(s7.externalModuleIndicator || s7.commonJsModuleIndicator); + }); + } + ts2.programContainsModules = programContainsModules; + function programContainsEsModules(program) { + return program.getSourceFiles().some(function(s7) { + return !s7.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s7) && !!s7.externalModuleIndicator; + }); + } + ts2.programContainsEsModules = programContainsEsModules; + function compilerOptionsIndicateEsModules(compilerOptions) { + return !!compilerOptions.module || ts2.getEmitScriptTarget(compilerOptions) >= 2 || !!compilerOptions.noEmit; + } + ts2.compilerOptionsIndicateEsModules = compilerOptionsIndicateEsModules; + function createModuleSpecifierResolutionHost(program, host) { + return { + fileExists: function(fileName) { + return program.fileExists(fileName); + }, + getCurrentDirectory: function() { + return host.getCurrentDirectory(); + }, + readFile: ts2.maybeBind(host, host.readFile), + useCaseSensitiveFileNames: ts2.maybeBind(host, host.useCaseSensitiveFileNames), + getSymlinkCache: ts2.maybeBind(host, host.getSymlinkCache) || program.getSymlinkCache, + getModuleSpecifierCache: ts2.maybeBind(host, host.getModuleSpecifierCache), + getPackageJsonInfoCache: function() { + var _a2; + return (_a2 = program.getModuleResolutionCache()) === null || _a2 === void 0 ? void 0 : _a2.getPackageJsonInfoCache(); + }, + getGlobalTypingsCacheLocation: ts2.maybeBind(host, host.getGlobalTypingsCacheLocation), + redirectTargetsMap: program.redirectTargetsMap, + getProjectReferenceRedirect: function(fileName) { + return program.getProjectReferenceRedirect(fileName); + }, + isSourceOfProjectReferenceRedirect: function(fileName) { + return program.isSourceOfProjectReferenceRedirect(fileName); + }, + getNearestAncestorDirectoryWithPackageJson: ts2.maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson), + getFileIncludeReasons: function() { + return program.getFileIncludeReasons(); + } + }; + } + ts2.createModuleSpecifierResolutionHost = createModuleSpecifierResolutionHost; + function getModuleSpecifierResolverHost(program, host) { + return __assign16(__assign16({}, createModuleSpecifierResolutionHost(program, host)), { getCommonSourceDirectory: function() { + return program.getCommonSourceDirectory(); + } }); + } + ts2.getModuleSpecifierResolverHost = getModuleSpecifierResolverHost; + function moduleResolutionRespectsExports(moduleResolution) { + return moduleResolution >= ts2.ModuleResolutionKind.Node16 && moduleResolution <= ts2.ModuleResolutionKind.NodeNext; + } + ts2.moduleResolutionRespectsExports = moduleResolutionRespectsExports; + function moduleResolutionUsesNodeModules(moduleResolution) { + return moduleResolution === ts2.ModuleResolutionKind.NodeJs || moduleResolution >= ts2.ModuleResolutionKind.Node16 && moduleResolution <= ts2.ModuleResolutionKind.NodeNext; + } + ts2.moduleResolutionUsesNodeModules = moduleResolutionUsesNodeModules; + function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) { + return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0; + } + ts2.makeImportIfNecessary = makeImportIfNecessary; + function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference, isTypeOnly) { + return ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + defaultImport || namedImports ? ts2.factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? ts2.factory.createNamedImports(namedImports) : void 0) : void 0, + typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, + /*assertClause*/ + void 0 + ); + } + ts2.makeImport = makeImport; + function makeStringLiteral(text, quotePreference) { + return ts2.factory.createStringLiteral( + text, + quotePreference === 0 + /* QuotePreference.Single */ + ); + } + ts2.makeStringLiteral = makeStringLiteral; + var QuotePreference; + (function(QuotePreference2) { + QuotePreference2[QuotePreference2["Single"] = 0] = "Single"; + QuotePreference2[QuotePreference2["Double"] = 1] = "Double"; + })(QuotePreference = ts2.QuotePreference || (ts2.QuotePreference = {})); + function quotePreferenceFromString(str2, sourceFile) { + return ts2.isStringDoubleQuoted(str2, sourceFile) ? 1 : 0; + } + ts2.quotePreferenceFromString = quotePreferenceFromString; + function getQuotePreference(sourceFile, preferences) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { + return preferences.quotePreference === "single" ? 0 : 1; + } else { + var firstModuleSpecifier = sourceFile.imports && ts2.find(sourceFile.imports, function(n7) { + return ts2.isStringLiteral(n7) && !ts2.nodeIsSynthesized(n7.parent); + }); + return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1; + } + } + ts2.getQuotePreference = getQuotePreference; + function getQuoteFromPreference(qp) { + switch (qp) { + case 0: + return "'"; + case 1: + return '"'; + default: + return ts2.Debug.assertNever(qp); + } + } + ts2.getQuoteFromPreference = getQuoteFromPreference; + function symbolNameNoDefault(symbol) { + var escaped = symbolEscapedNameNoDefault(symbol); + return escaped === void 0 ? void 0 : ts2.unescapeLeadingUnderscores(escaped); + } + ts2.symbolNameNoDefault = symbolNameNoDefault; + function symbolEscapedNameNoDefault(symbol) { + if (symbol.escapedName !== "default") { + return symbol.escapedName; + } + return ts2.firstDefined(symbol.declarations, function(decl) { + var name2 = ts2.getNameOfDeclaration(decl); + return name2 && name2.kind === 79 ? name2.escapedText : void 0; + }); + } + ts2.symbolEscapedNameNoDefault = symbolEscapedNameNoDefault; + function isModuleSpecifierLike(node) { + return ts2.isStringLiteralLike(node) && (ts2.isExternalModuleReference(node.parent) || ts2.isImportDeclaration(node.parent) || ts2.isRequireCall( + node.parent, + /*requireStringLiteralLikeArgument*/ + false + ) && node.parent.arguments[0] === node || ts2.isImportCall(node.parent) && node.parent.arguments[0] === node); + } + ts2.isModuleSpecifierLike = isModuleSpecifierLike; + function isObjectBindingElementWithoutPropertyName(bindingElement) { + return ts2.isBindingElement(bindingElement) && ts2.isObjectBindingPattern(bindingElement.parent) && ts2.isIdentifier(bindingElement.name) && !bindingElement.propertyName; + } + ts2.isObjectBindingElementWithoutPropertyName = isObjectBindingElementWithoutPropertyName; + function getPropertySymbolFromBindingElement(checker, bindingElement) { + var typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + } + ts2.getPropertySymbolFromBindingElement = getPropertySymbolFromBindingElement; + function getParentNodeInSpan(node, file, span) { + if (!node) + return void 0; + while (node.parent) { + if (ts2.isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; + } + } + ts2.getParentNodeInSpan = getParentNodeInSpan; + function spanContainsNode(span, node, file) { + return ts2.textSpanContainsPosition(span, node.getStart(file)) && node.getEnd() <= ts2.textSpanEnd(span); + } + function findModifier(node, kind) { + return ts2.canHaveModifiers(node) ? ts2.find(node.modifiers, function(m7) { + return m7.kind === kind; + }) : void 0; + } + ts2.findModifier = findModifier; + function insertImports(changes, sourceFile, imports, blankLineBetween) { + var decl = ts2.isArray(imports) ? imports[0] : imports; + var importKindPredicate = decl.kind === 240 ? ts2.isRequireVariableStatement : ts2.isAnyImportSyntax; + var existingImportStatements = ts2.filter(sourceFile.statements, importKindPredicate); + var sortedNewImports = ts2.isArray(imports) ? ts2.stableSort(imports, ts2.OrganizeImports.compareImportsOrRequireStatements) : [imports]; + if (!existingImportStatements.length) { + changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); + } else if (existingImportStatements && ts2.OrganizeImports.importsAreSorted(existingImportStatements)) { + for (var _i = 0, sortedNewImports_1 = sortedNewImports; _i < sortedNewImports_1.length; _i++) { + var newImport = sortedNewImports_1[_i]; + var insertionIndex = ts2.OrganizeImports.getImportDeclarationInsertionIndex(existingImportStatements, newImport); + if (insertionIndex === 0) { + var options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude } : {}; + changes.insertNodeBefore( + sourceFile, + existingImportStatements[0], + newImport, + /*blankLineBetween*/ + false, + options + ); + } else { + var prevImport = existingImportStatements[insertionIndex - 1]; + changes.insertNodeAfter(sourceFile, prevImport, newImport); + } + } + } else { + var lastExistingImport = ts2.lastOrUndefined(existingImportStatements); + if (lastExistingImport) { + changes.insertNodesAfter(sourceFile, lastExistingImport, sortedNewImports); + } else { + changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); + } + } + } + ts2.insertImports = insertImports; + function getTypeKeywordOfTypeOnlyImport(importClause, sourceFile) { + ts2.Debug.assert(importClause.isTypeOnly); + return ts2.cast(importClause.getChildAt(0, sourceFile), isTypeKeywordToken); + } + ts2.getTypeKeywordOfTypeOnlyImport = getTypeKeywordOfTypeOnlyImport; + function textSpansEqual(a7, b8) { + return !!a7 && !!b8 && a7.start === b8.start && a7.length === b8.length; + } + ts2.textSpansEqual = textSpansEqual; + function documentSpansEqual(a7, b8) { + return a7.fileName === b8.fileName && textSpansEqual(a7.textSpan, b8.textSpan); + } + ts2.documentSpansEqual = documentSpansEqual; + function forEachUnique(array, callback) { + if (array) { + for (var i7 = 0; i7 < array.length; i7++) { + if (array.indexOf(array[i7]) === i7) { + var result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + } + return void 0; + } + ts2.forEachUnique = forEachUnique; + function isTextWhiteSpaceLike(text, startPos, endPos) { + for (var i7 = startPos; i7 < endPos; i7++) { + if (!ts2.isWhiteSpaceLike(text.charCodeAt(i7))) { + return false; + } + } + return true; + } + ts2.isTextWhiteSpaceLike = isTextWhiteSpaceLike; + function getMappedLocation(location2, sourceMapper, fileExists) { + var mapsTo = sourceMapper.tryGetSourcePosition(location2); + return mapsTo && (!fileExists || fileExists(ts2.normalizePath(mapsTo.fileName)) ? mapsTo : void 0); + } + ts2.getMappedLocation = getMappedLocation; + function getMappedDocumentSpan(documentSpan, sourceMapper, fileExists) { + var fileName = documentSpan.fileName, textSpan = documentSpan.textSpan; + var newPosition = getMappedLocation({ fileName, pos: textSpan.start }, sourceMapper, fileExists); + if (!newPosition) + return void 0; + var newEndPosition = getMappedLocation({ fileName, pos: textSpan.start + textSpan.length }, sourceMapper, fileExists); + var newLength = newEndPosition ? newEndPosition.pos - newPosition.pos : textSpan.length; + return { + fileName: newPosition.fileName, + textSpan: { + start: newPosition.pos, + length: newLength + }, + originalFileName: documentSpan.fileName, + originalTextSpan: documentSpan.textSpan, + contextSpan: getMappedContextSpan(documentSpan, sourceMapper, fileExists), + originalContextSpan: documentSpan.contextSpan + }; + } + ts2.getMappedDocumentSpan = getMappedDocumentSpan; + function getMappedContextSpan(documentSpan, sourceMapper, fileExists) { + var contextSpanStart = documentSpan.contextSpan && getMappedLocation({ fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start }, sourceMapper, fileExists); + var contextSpanEnd = documentSpan.contextSpan && getMappedLocation({ fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start + documentSpan.contextSpan.length }, sourceMapper, fileExists); + return contextSpanStart && contextSpanEnd ? { start: contextSpanStart.pos, length: contextSpanEnd.pos - contextSpanStart.pos } : void 0; + } + ts2.getMappedContextSpan = getMappedContextSpan; + function isFirstDeclarationOfSymbolParameter(symbol) { + var declaration = symbol.declarations ? ts2.firstOrUndefined(symbol.declarations) : void 0; + return !!ts2.findAncestor(declaration, function(n7) { + return ts2.isParameter(n7) ? true : ts2.isBindingElement(n7) || ts2.isObjectBindingPattern(n7) || ts2.isArrayBindingPattern(n7) ? false : "quit"; + }); + } + ts2.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; + var displayPartWriter = getDisplayPartWriter(); + function getDisplayPartWriter() { + var absoluteMaximumLength = ts2.defaultMaximumTruncationLength * 10; + var displayParts; + var lineStart; + var indent; + var length; + resetWriter(); + var unknownWrite = function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.text); + }; + return { + displayParts: function() { + var finalText = displayParts.length && displayParts[displayParts.length - 1].text; + if (length > absoluteMaximumLength && finalText && finalText !== "...") { + if (!ts2.isWhiteSpaceLike(finalText.charCodeAt(finalText.length - 1))) { + displayParts.push(displayPart(" ", ts2.SymbolDisplayPartKind.space)); + } + displayParts.push(displayPart("...", ts2.SymbolDisplayPartKind.punctuation)); + } + return displayParts; + }, + writeKeyword: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.keyword); + }, + writeOperator: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.operator); + }, + writePunctuation: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.punctuation); + }, + writeTrailingSemicolon: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.punctuation); + }, + writeSpace: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.space); + }, + writeStringLiteral: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.stringLiteral); + }, + writeParameter: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.parameterName); + }, + writeProperty: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.propertyName); + }, + writeLiteral: function(text) { + return writeKind(text, ts2.SymbolDisplayPartKind.stringLiteral); + }, + writeSymbol, + writeLine, + write: unknownWrite, + writeComment: unknownWrite, + getText: function() { + return ""; + }, + getTextPos: function() { + return 0; + }, + getColumn: function() { + return 0; + }, + getLine: function() { + return 0; + }, + isAtStartOfLine: function() { + return false; + }, + hasTrailingWhitespace: function() { + return false; + }, + hasTrailingComment: function() { + return false; + }, + rawWrite: ts2.notImplemented, + getIndent: function() { + return indent; + }, + increaseIndent: function() { + indent++; + }, + decreaseIndent: function() { + indent--; + }, + clear: resetWriter, + trackSymbol: function() { + return false; + }, + reportInaccessibleThisError: ts2.noop, + reportInaccessibleUniqueSymbolError: ts2.noop, + reportPrivateInBaseOfClassExpression: ts2.noop + }; + function writeIndent() { + if (length > absoluteMaximumLength) + return; + if (lineStart) { + var indentString2 = ts2.getIndentString(indent); + if (indentString2) { + length += indentString2.length; + displayParts.push(displayPart(indentString2, ts2.SymbolDisplayPartKind.space)); + } + lineStart = false; + } + } + function writeKind(text, kind) { + if (length > absoluteMaximumLength) + return; + writeIndent(); + length += text.length; + displayParts.push(displayPart(text, kind)); + } + function writeSymbol(text, symbol) { + if (length > absoluteMaximumLength) + return; + writeIndent(); + length += text.length; + displayParts.push(symbolPart(text, symbol)); + } + function writeLine() { + if (length > absoluteMaximumLength) + return; + length += 1; + displayParts.push(lineBreakPart()); + lineStart = true; + } + function resetWriter() { + displayParts = []; + lineStart = true; + indent = 0; + length = 0; + } + } + function symbolPart(text, symbol) { + return displayPart(text, displayPartKind(symbol)); + function displayPartKind(symbol2) { + var flags = symbol2.flags; + if (flags & 3) { + return isFirstDeclarationOfSymbolParameter(symbol2) ? ts2.SymbolDisplayPartKind.parameterName : ts2.SymbolDisplayPartKind.localName; + } + if (flags & 4) + return ts2.SymbolDisplayPartKind.propertyName; + if (flags & 32768) + return ts2.SymbolDisplayPartKind.propertyName; + if (flags & 65536) + return ts2.SymbolDisplayPartKind.propertyName; + if (flags & 8) + return ts2.SymbolDisplayPartKind.enumMemberName; + if (flags & 16) + return ts2.SymbolDisplayPartKind.functionName; + if (flags & 32) + return ts2.SymbolDisplayPartKind.className; + if (flags & 64) + return ts2.SymbolDisplayPartKind.interfaceName; + if (flags & 384) + return ts2.SymbolDisplayPartKind.enumName; + if (flags & 1536) + return ts2.SymbolDisplayPartKind.moduleName; + if (flags & 8192) + return ts2.SymbolDisplayPartKind.methodName; + if (flags & 262144) + return ts2.SymbolDisplayPartKind.typeParameterName; + if (flags & 524288) + return ts2.SymbolDisplayPartKind.aliasName; + if (flags & 2097152) + return ts2.SymbolDisplayPartKind.aliasName; + return ts2.SymbolDisplayPartKind.text; + } + } + ts2.symbolPart = symbolPart; + function displayPart(text, kind) { + return { text, kind: ts2.SymbolDisplayPartKind[kind] }; + } + ts2.displayPart = displayPart; + function spacePart() { + return displayPart(" ", ts2.SymbolDisplayPartKind.space); + } + ts2.spacePart = spacePart; + function keywordPart(kind) { + return displayPart(ts2.tokenToString(kind), ts2.SymbolDisplayPartKind.keyword); + } + ts2.keywordPart = keywordPart; + function punctuationPart(kind) { + return displayPart(ts2.tokenToString(kind), ts2.SymbolDisplayPartKind.punctuation); + } + ts2.punctuationPart = punctuationPart; + function operatorPart(kind) { + return displayPart(ts2.tokenToString(kind), ts2.SymbolDisplayPartKind.operator); + } + ts2.operatorPart = operatorPart; + function parameterNamePart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.parameterName); + } + ts2.parameterNamePart = parameterNamePart; + function propertyNamePart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.propertyName); + } + ts2.propertyNamePart = propertyNamePart; + function textOrKeywordPart(text) { + var kind = ts2.stringToToken(text); + return kind === void 0 ? textPart(text) : keywordPart(kind); + } + ts2.textOrKeywordPart = textOrKeywordPart; + function textPart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.text); + } + ts2.textPart = textPart; + function typeAliasNamePart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.aliasName); + } + ts2.typeAliasNamePart = typeAliasNamePart; + function typeParameterNamePart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.typeParameterName); + } + ts2.typeParameterNamePart = typeParameterNamePart; + function linkTextPart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.linkText); + } + ts2.linkTextPart = linkTextPart; + function linkNamePart(text, target) { + return { + text, + kind: ts2.SymbolDisplayPartKind[ts2.SymbolDisplayPartKind.linkName], + target: { + fileName: ts2.getSourceFileOfNode(target).fileName, + textSpan: createTextSpanFromNode(target) + } + }; + } + ts2.linkNamePart = linkNamePart; + function linkPart(text) { + return displayPart(text, ts2.SymbolDisplayPartKind.link); + } + ts2.linkPart = linkPart; + function buildLinkParts(link2, checker) { + var _a2; + var prefix = ts2.isJSDocLink(link2) ? "link" : ts2.isJSDocLinkCode(link2) ? "linkcode" : "linkplain"; + var parts = [linkPart("{@".concat(prefix, " "))]; + if (!link2.name) { + if (link2.text) { + parts.push(linkTextPart(link2.text)); + } + } else { + var symbol = checker === null || checker === void 0 ? void 0 : checker.getSymbolAtLocation(link2.name); + var suffix = findLinkNameEnd(link2.text); + var name2 = ts2.getTextOfNode(link2.name) + link2.text.slice(0, suffix); + var text = skipSeparatorFromLinkText(link2.text.slice(suffix)); + var decl = (symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration) || ((_a2 = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]); + if (decl) { + parts.push(linkNamePart(name2, decl)); + if (text) + parts.push(linkTextPart(text)); + } else { + parts.push(linkTextPart(name2 + (suffix || text.indexOf("://") === 0 ? "" : " ") + text)); + } + } + parts.push(linkPart("}")); + return parts; + } + ts2.buildLinkParts = buildLinkParts; + function skipSeparatorFromLinkText(text) { + var pos = 0; + if (text.charCodeAt(pos++) === 124) { + while (pos < text.length && text.charCodeAt(pos) === 32) + pos++; + return text.slice(pos); + } + return text; + } + function findLinkNameEnd(text) { + if (text.indexOf("()") === 0) + return 2; + if (text[0] !== "<") + return 0; + var brackets = 0; + var i7 = 0; + while (i7 < text.length) { + if (text[i7] === "<") + brackets++; + if (text[i7] === ">") + brackets--; + i7++; + if (!brackets) + return i7; + } + return 0; + } + var carriageReturnLineFeed = "\r\n"; + function getNewLineOrDefaultFromHost(host, formatSettings) { + var _a2; + return (formatSettings === null || formatSettings === void 0 ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) === null || _a2 === void 0 ? void 0 : _a2.call(host)) || carriageReturnLineFeed; + } + ts2.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost; + function lineBreakPart() { + return displayPart("\n", ts2.SymbolDisplayPartKind.lineBreak); + } + ts2.lineBreakPart = lineBreakPart; + function mapToDisplayParts(writeDisplayParts) { + try { + writeDisplayParts(displayPartWriter); + return displayPartWriter.displayParts(); + } finally { + displayPartWriter.clear(); + } + } + ts2.mapToDisplayParts = mapToDisplayParts; + function typeToDisplayParts(typechecker, type3, enclosingDeclaration, flags) { + if (flags === void 0) { + flags = 0; + } + return mapToDisplayParts(function(writer) { + typechecker.writeType(type3, enclosingDeclaration, flags | 1024 | 16384, writer); + }); + } + ts2.typeToDisplayParts = typeToDisplayParts; + function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { + if (flags === void 0) { + flags = 0; + } + return mapToDisplayParts(function(writer) { + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8, writer); + }); + } + ts2.symbolToDisplayParts = symbolToDisplayParts; + function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { + if (flags === void 0) { + flags = 0; + } + flags |= 16384 | 1024 | 32 | 8192; + return mapToDisplayParts(function(writer) { + typechecker.writeSignature( + signature, + enclosingDeclaration, + flags, + /*signatureKind*/ + void 0, + writer + ); + }); + } + ts2.signatureToDisplayParts = signatureToDisplayParts; + function nodeToDisplayParts(node, enclosingDeclaration) { + var file = enclosingDeclaration.getSourceFile(); + return mapToDisplayParts(function(writer) { + var printer = ts2.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + printer.writeNode(4, node, file, writer); + }); + } + ts2.nodeToDisplayParts = nodeToDisplayParts; + function isImportOrExportSpecifierName(location2) { + return !!location2.parent && ts2.isImportOrExportSpecifier(location2.parent) && location2.parent.propertyName === location2; + } + ts2.isImportOrExportSpecifierName = isImportOrExportSpecifierName; + function getScriptKind(fileName, host) { + return ts2.ensureScriptKind(fileName, host.getScriptKind && host.getScriptKind(fileName)); + } + ts2.getScriptKind = getScriptKind; + function getSymbolTarget(symbol, checker) { + var next = symbol; + while (isAliasSymbol(next) || isTransientSymbol(next) && next.target) { + if (isTransientSymbol(next) && next.target) { + next = next.target; + } else { + next = ts2.skipAlias(next, checker); + } + } + return next; + } + ts2.getSymbolTarget = getSymbolTarget; + function isTransientSymbol(symbol) { + return (symbol.flags & 33554432) !== 0; + } + function isAliasSymbol(symbol) { + return (symbol.flags & 2097152) !== 0; + } + function getUniqueSymbolId(symbol, checker) { + return ts2.getSymbolId(ts2.skipAlias(symbol, checker)); + } + ts2.getUniqueSymbolId = getUniqueSymbolId; + function getFirstNonSpaceCharacterPosition(text, position) { + while (ts2.isWhiteSpaceLike(text.charCodeAt(position))) { + position += 1; + } + return position; + } + ts2.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; + function getPrecedingNonSpaceCharacterPosition(text, position) { + while (position > -1 && ts2.isWhiteSpaceSingleLine(text.charCodeAt(position))) { + position -= 1; + } + return position + 1; + } + ts2.getPrecedingNonSpaceCharacterPosition = getPrecedingNonSpaceCharacterPosition; + function getSynthesizedDeepClone(node, includeTrivia) { + if (includeTrivia === void 0) { + includeTrivia = true; + } + var clone2 = node && getSynthesizedDeepCloneWorker(node); + if (clone2 && !includeTrivia) + suppressLeadingAndTrailingTrivia(clone2); + return clone2; + } + ts2.getSynthesizedDeepClone = getSynthesizedDeepClone; + function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode2) { + var clone2 = replaceNode2(node); + if (clone2) { + ts2.setOriginalNode(clone2, node); + } else { + clone2 = getSynthesizedDeepCloneWorker(node, replaceNode2); + } + if (clone2 && !includeTrivia) + suppressLeadingAndTrailingTrivia(clone2); + return clone2; + } + ts2.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements; + function getSynthesizedDeepCloneWorker(node, replaceNode2) { + var nodeClone = replaceNode2 ? function(n7) { + return getSynthesizedDeepCloneWithReplacements( + n7, + /*includeTrivia*/ + true, + replaceNode2 + ); + } : getSynthesizedDeepClone; + var nodesClone = replaceNode2 ? function(ns) { + return ns && getSynthesizedDeepClonesWithReplacements( + ns, + /*includeTrivia*/ + true, + replaceNode2 + ); + } : function(ns) { + return ns && getSynthesizedDeepClones(ns); + }; + var visited = ts2.visitEachChild(node, nodeClone, ts2.nullTransformationContext, nodesClone, nodeClone); + if (visited === node) { + var clone_1 = ts2.isStringLiteral(node) ? ts2.setOriginalNode(ts2.factory.createStringLiteralFromNode(node), node) : ts2.isNumericLiteral(node) ? ts2.setOriginalNode(ts2.factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : ts2.factory.cloneNode(node); + return ts2.setTextRange(clone_1, node); + } + visited.parent = void 0; + return visited; + } + function getSynthesizedDeepClones(nodes, includeTrivia) { + if (includeTrivia === void 0) { + includeTrivia = true; + } + return nodes && ts2.factory.createNodeArray(nodes.map(function(n7) { + return getSynthesizedDeepClone(n7, includeTrivia); + }), nodes.hasTrailingComma); + } + ts2.getSynthesizedDeepClones = getSynthesizedDeepClones; + function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode2) { + return ts2.factory.createNodeArray(nodes.map(function(n7) { + return getSynthesizedDeepCloneWithReplacements(n7, includeTrivia, replaceNode2); + }), nodes.hasTrailingComma); + } + ts2.getSynthesizedDeepClonesWithReplacements = getSynthesizedDeepClonesWithReplacements; + function suppressLeadingAndTrailingTrivia(node) { + suppressLeadingTrivia(node); + suppressTrailingTrivia(node); + } + ts2.suppressLeadingAndTrailingTrivia = suppressLeadingAndTrailingTrivia; + function suppressLeadingTrivia(node) { + addEmitFlagsRecursively(node, 512, getFirstChild); + } + ts2.suppressLeadingTrivia = suppressLeadingTrivia; + function suppressTrailingTrivia(node) { + addEmitFlagsRecursively(node, 1024, ts2.getLastChild); + } + ts2.suppressTrailingTrivia = suppressTrailingTrivia; + function copyComments(sourceNode, targetNode) { + var sourceFile = sourceNode.getSourceFile(); + var text = sourceFile.text; + if (hasLeadingLineBreak(sourceNode, text)) { + copyLeadingComments(sourceNode, targetNode, sourceFile); + } else { + copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile); + } + copyTrailingComments(sourceNode, targetNode, sourceFile); + } + ts2.copyComments = copyComments; + function hasLeadingLineBreak(node, text) { + var start = node.getFullStart(); + var end = node.getStart(); + for (var i7 = start; i7 < end; i7++) { + if (text.charCodeAt(i7) === 10) + return true; + } + return false; + } + function addEmitFlagsRecursively(node, flag, getChild) { + ts2.addEmitFlags(node, flag); + var child = getChild(node); + if (child) + addEmitFlagsRecursively(child, flag, getChild); + } + function getFirstChild(node) { + return node.forEachChild(function(child) { + return child; + }); + } + function getUniqueName(baseName, sourceFile) { + var nameText = baseName; + for (var i7 = 1; !ts2.isFileLevelUniqueName(sourceFile, nameText); i7++) { + nameText = "".concat(baseName, "_").concat(i7); + } + return nameText; + } + ts2.getUniqueName = getUniqueName; + function getRenameLocation(edits, renameFilename, name2, preferLastLocation) { + var delta = 0; + var lastPos = -1; + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a2 = edits_1[_i], fileName = _a2.fileName, textChanges_2 = _a2.textChanges; + ts2.Debug.assert(fileName === renameFilename); + for (var _b = 0, textChanges_1 = textChanges_2; _b < textChanges_1.length; _b++) { + var change = textChanges_1[_b]; + var span = change.span, newText = change.newText; + var index4 = indexInTextChange(newText, ts2.escapeString(name2)); + if (index4 !== -1) { + lastPos = span.start + delta + index4; + if (!preferLastLocation) { + return lastPos; + } + } + delta += newText.length - span.length; + } + } + ts2.Debug.assert(preferLastLocation); + ts2.Debug.assert(lastPos >= 0); + return lastPos; + } + ts2.getRenameLocation = getRenameLocation; + function copyLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + ts2.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts2.addSyntheticLeadingComment)); + } + ts2.copyLeadingComments = copyLeadingComments; + function copyTrailingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + ts2.forEachTrailingCommentRange(sourceFile.text, sourceNode.end, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts2.addSyntheticTrailingComment)); + } + ts2.copyTrailingComments = copyTrailingComments; + function copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + ts2.forEachTrailingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, ts2.addSyntheticLeadingComment)); + } + ts2.copyTrailingAsLeadingComments = copyTrailingAsLeadingComments; + function getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, cb) { + return function(pos, end, kind, htnl) { + if (kind === 3) { + pos += 2; + end -= 2; + } else { + pos += 2; + } + cb(targetNode, commentKind || kind, sourceFile.text.slice(pos, end), hasTrailingNewLine !== void 0 ? hasTrailingNewLine : htnl); + }; + } + function indexInTextChange(change, name2) { + if (ts2.startsWith(change, name2)) + return 0; + var idx = change.indexOf(" " + name2); + if (idx === -1) + idx = change.indexOf("." + name2); + if (idx === -1) + idx = change.indexOf('"' + name2); + return idx === -1 ? -1 : idx + 1; + } + function needsParentheses(expression) { + return ts2.isBinaryExpression(expression) && expression.operatorToken.kind === 27 || ts2.isObjectLiteralExpression(expression) || ts2.isAsExpression(expression) && ts2.isObjectLiteralExpression(expression.expression); + } + ts2.needsParentheses = needsParentheses; + function getContextualTypeFromParent(node, checker) { + var parent2 = node.parent; + switch (parent2.kind) { + case 211: + return checker.getContextualType(parent2); + case 223: { + var _a2 = parent2, left = _a2.left, operatorToken = _a2.operatorToken, right = _a2.right; + return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); + } + case 292: + return parent2.expression === node ? getSwitchedType(parent2, checker) : void 0; + default: + return checker.getContextualType(node); + } + } + ts2.getContextualTypeFromParent = getContextualTypeFromParent; + function quote(sourceFile, preferences, text) { + var quotePreference = getQuotePreference(sourceFile, preferences); + var quoted = JSON.stringify(text); + return quotePreference === 0 ? "'".concat(ts2.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted; + } + ts2.quote = quote; + function isEqualityOperatorKind(kind) { + switch (kind) { + case 36: + case 34: + case 37: + case 35: + return true; + default: + return false; + } + } + ts2.isEqualityOperatorKind = isEqualityOperatorKind; + function isStringLiteralOrTemplate(node) { + switch (node.kind) { + case 10: + case 14: + case 225: + case 212: + return true; + default: + return false; + } + } + ts2.isStringLiteralOrTemplate = isStringLiteralOrTemplate; + function hasIndexSignature(type3) { + return !!type3.getStringIndexType() || !!type3.getNumberIndexType(); + } + ts2.hasIndexSignature = hasIndexSignature; + function getSwitchedType(caseClause, checker) { + return checker.getTypeAtLocation(caseClause.parent.parent.expression); + } + ts2.getSwitchedType = getSwitchedType; + ts2.ANONYMOUS = "anonymous function"; + function getTypeNodeIfAccessible(type3, enclosingScope, program, host) { + var checker = program.getTypeChecker(); + var typeIsAccessible = true; + var notAccessible = function() { + return typeIsAccessible = false; + }; + var res = checker.typeToTypeNode(type3, enclosingScope, 1, { + trackSymbol: function(symbol, declaration, meaning) { + typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible( + symbol, + declaration, + meaning, + /*shouldComputeAliasToMarkVisible*/ + false + ).accessibility === 0; + return !typeIsAccessible; + }, + reportInaccessibleThisError: notAccessible, + reportPrivateInBaseOfClassExpression: notAccessible, + reportInaccessibleUniqueSymbolError: notAccessible, + moduleResolverHost: getModuleSpecifierResolverHost(program, host) + }); + return typeIsAccessible ? res : void 0; + } + ts2.getTypeNodeIfAccessible = getTypeNodeIfAccessible; + function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { + return kind === 176 || kind === 177 || kind === 178 || kind === 168 || kind === 170; + } + function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { + return kind === 259 || kind === 173 || kind === 171 || kind === 174 || kind === 175; + } + function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { + return kind === 264; + } + function syntaxRequiresTrailingSemicolonOrASI(kind) { + return kind === 240 || kind === 241 || kind === 243 || kind === 248 || kind === 249 || kind === 250 || kind === 254 || kind === 256 || kind === 169 || kind === 262 || kind === 269 || kind === 268 || kind === 275 || kind === 267 || kind === 274; + } + ts2.syntaxRequiresTrailingSemicolonOrASI = syntaxRequiresTrailingSemicolonOrASI; + ts2.syntaxMayBeASICandidate = ts2.or(syntaxRequiresTrailingCommaOrSemicolonOrASI, syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, syntaxRequiresTrailingSemicolonOrASI); + function nodeIsASICandidate(node, sourceFile) { + var lastToken = node.getLastToken(sourceFile); + if (lastToken && lastToken.kind === 26) { + return false; + } + if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { + if (lastToken && lastToken.kind === 27) { + return false; + } + } else if (syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(node.kind)) { + var lastChild = ts2.last(node.getChildren(sourceFile)); + if (lastChild && ts2.isModuleBlock(lastChild)) { + return false; + } + } else if (syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(node.kind)) { + var lastChild = ts2.last(node.getChildren(sourceFile)); + if (lastChild && ts2.isFunctionBlock(lastChild)) { + return false; + } + } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { + return false; + } + if (node.kind === 243) { + return true; + } + var topNode = ts2.findAncestor(node, function(ancestor) { + return !ancestor.parent; + }); + var nextToken = findNextToken(node, topNode, sourceFile); + if (!nextToken || nextToken.kind === 19) { + return true; + } + var startLine = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(nextToken.getStart(sourceFile)).line; + return startLine !== endLine; + } + function positionIsASICandidate(pos, context2, sourceFile) { + var contextAncestor = ts2.findAncestor(context2, function(ancestor) { + if (ancestor.end !== pos) { + return "quit"; + } + return ts2.syntaxMayBeASICandidate(ancestor.kind); + }); + return !!contextAncestor && nodeIsASICandidate(contextAncestor, sourceFile); + } + ts2.positionIsASICandidate = positionIsASICandidate; + function probablyUsesSemicolons(sourceFile) { + var withSemicolon = 0; + var withoutSemicolon = 0; + var nStatementsToObserve = 5; + ts2.forEachChild(sourceFile, function visit7(node) { + if (syntaxRequiresTrailingSemicolonOrASI(node.kind)) { + var lastToken = node.getLastToken(sourceFile); + if ((lastToken === null || lastToken === void 0 ? void 0 : lastToken.kind) === 26) { + withSemicolon++; + } else { + withoutSemicolon++; + } + } else if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { + var lastToken = node.getLastToken(sourceFile); + if ((lastToken === null || lastToken === void 0 ? void 0 : lastToken.kind) === 26) { + withSemicolon++; + } else if (lastToken && lastToken.kind !== 27) { + var lastTokenLine = ts2.getLineAndCharacterOfPosition(sourceFile, lastToken.getStart(sourceFile)).line; + var nextTokenLine = ts2.getLineAndCharacterOfPosition(sourceFile, ts2.getSpanOfTokenAtPosition(sourceFile, lastToken.end).start).line; + if (lastTokenLine !== nextTokenLine) { + withoutSemicolon++; + } + } + } + if (withSemicolon + withoutSemicolon >= nStatementsToObserve) { + return true; + } + return ts2.forEachChild(node, visit7); + }); + if (withSemicolon === 0 && withoutSemicolon <= 1) { + return true; + } + return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve; + } + ts2.probablyUsesSemicolons = probablyUsesSemicolons; + function tryGetDirectories(host, directoryName) { + return tryIOAndConsumeErrors(host, host.getDirectories, directoryName) || []; + } + ts2.tryGetDirectories = tryGetDirectories; + function tryReadDirectory(host, path2, extensions6, exclude, include) { + return tryIOAndConsumeErrors(host, host.readDirectory, path2, extensions6, exclude, include) || ts2.emptyArray; + } + ts2.tryReadDirectory = tryReadDirectory; + function tryFileExists(host, path2) { + return tryIOAndConsumeErrors(host, host.fileExists, path2); + } + ts2.tryFileExists = tryFileExists; + function tryDirectoryExists(host, path2) { + return tryAndIgnoreErrors(function() { + return ts2.directoryProbablyExists(path2, host); + }) || false; + } + ts2.tryDirectoryExists = tryDirectoryExists; + function tryAndIgnoreErrors(cb) { + try { + return cb(); + } catch (_a2) { + return void 0; + } + } + ts2.tryAndIgnoreErrors = tryAndIgnoreErrors; + function tryIOAndConsumeErrors(host, toApply) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return tryAndIgnoreErrors(function() { + return toApply && toApply.apply(host, args); + }); + } + ts2.tryIOAndConsumeErrors = tryIOAndConsumeErrors; + function findPackageJsons(startDirectory, host, stopDirectory) { + var paths = []; + ts2.forEachAncestorDirectory(startDirectory, function(ancestor) { + if (ancestor === stopDirectory) { + return true; + } + var currentConfigPath = ts2.combinePaths(ancestor, "package.json"); + if (tryFileExists(host, currentConfigPath)) { + paths.push(currentConfigPath); + } + }); + return paths; + } + ts2.findPackageJsons = findPackageJsons; + function findPackageJson(directory, host) { + var packageJson; + ts2.forEachAncestorDirectory(directory, function(ancestor) { + if (ancestor === "node_modules") + return true; + packageJson = ts2.findConfigFile(ancestor, function(f8) { + return tryFileExists(host, f8); + }, "package.json"); + if (packageJson) { + return true; + } + }); + return packageJson; + } + ts2.findPackageJson = findPackageJson; + function getPackageJsonsVisibleToFile(fileName, host) { + if (!host.fileExists) { + return []; + } + var packageJsons = []; + ts2.forEachAncestorDirectory(ts2.getDirectoryPath(fileName), function(ancestor) { + var packageJsonFileName = ts2.combinePaths(ancestor, "package.json"); + if (host.fileExists(packageJsonFileName)) { + var info2 = createPackageJsonInfo(packageJsonFileName, host); + if (info2) { + packageJsons.push(info2); + } + } + }); + return packageJsons; + } + ts2.getPackageJsonsVisibleToFile = getPackageJsonsVisibleToFile; + function createPackageJsonInfo(fileName, host) { + if (!host.readFile) { + return void 0; + } + var dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]; + var stringContent = host.readFile(fileName) || ""; + var content = tryParseJson(stringContent); + var info2 = {}; + if (content) { + for (var _i = 0, dependencyKeys_1 = dependencyKeys; _i < dependencyKeys_1.length; _i++) { + var key = dependencyKeys_1[_i]; + var dependencies = content[key]; + if (!dependencies) { + continue; + } + var dependencyMap = new ts2.Map(); + for (var packageName in dependencies) { + dependencyMap.set(packageName, dependencies[packageName]); + } + info2[key] = dependencyMap; + } + } + var dependencyGroups = [ + [1, info2.dependencies], + [2, info2.devDependencies], + [8, info2.optionalDependencies], + [4, info2.peerDependencies] + ]; + return __assign16(__assign16({}, info2), { parseable: !!content, fileName, get: get4, has: function(dependencyName, inGroups) { + return !!get4(dependencyName, inGroups); + } }); + function get4(dependencyName, inGroups) { + if (inGroups === void 0) { + inGroups = 15; + } + for (var _i2 = 0, dependencyGroups_1 = dependencyGroups; _i2 < dependencyGroups_1.length; _i2++) { + var _a2 = dependencyGroups_1[_i2], group_1 = _a2[0], deps = _a2[1]; + if (deps && inGroups & group_1) { + var dep = deps.get(dependencyName); + if (dep !== void 0) { + return dep; + } + } + } + } + } + ts2.createPackageJsonInfo = createPackageJsonInfo; + function createPackageJsonImportFilter(fromFile2, preferences, host) { + var packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile2.fileName) || getPackageJsonsVisibleToFile(fromFile2.fileName, host)).filter(function(p7) { + return p7.parseable; + }); + var usesNodeCoreModules; + return { allowsImportingAmbientModule, allowsImportingSourceFile, allowsImportingSpecifier }; + function moduleSpecifierIsCoveredByPackageJson(specifier) { + var packageName = getNodeModuleRootSpecifier(specifier); + for (var _i = 0, packageJsons_1 = packageJsons; _i < packageJsons_1.length; _i++) { + var packageJson = packageJsons_1[_i]; + if (packageJson.has(packageName) || packageJson.has(ts2.getTypesPackageName(packageName))) { + return true; + } + } + return false; + } + function allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost) { + if (!packageJsons.length || !moduleSymbol.valueDeclaration) { + return true; + } + var declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); + var declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); + if (typeof declaringNodeModuleName === "undefined") { + return true; + } + var declaredModuleSpecifier = ts2.stripQuotes(moduleSymbol.getName()); + if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { + return true; + } + return moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + } + function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) { + if (!packageJsons.length) { + return true; + } + var moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); + if (!moduleSpecifier) { + return true; + } + return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + } + function allowsImportingSpecifier(moduleSpecifier) { + if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { + return true; + } + if (ts2.pathIsRelative(moduleSpecifier) || ts2.isRootedDiskPath(moduleSpecifier)) { + return true; + } + return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + } + function isAllowedCoreNodeModulesImport(moduleSpecifier) { + if (ts2.isSourceFileJS(fromFile2) && ts2.JsTyping.nodeCoreModules.has(moduleSpecifier)) { + if (usesNodeCoreModules === void 0) { + usesNodeCoreModules = consumesNodeCoreModules(fromFile2); + } + if (usesNodeCoreModules) { + return true; + } + } + return false; + } + function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) { + if (!ts2.stringContains(importedFileName, "node_modules")) { + return void 0; + } + var specifier = ts2.moduleSpecifiers.getNodeModulesPackageName(host.getCompilationSettings(), fromFile2, importedFileName, moduleSpecifierResolutionHost, preferences); + if (!specifier) { + return void 0; + } + if (!ts2.pathIsRelative(specifier) && !ts2.isRootedDiskPath(specifier)) { + return getNodeModuleRootSpecifier(specifier); + } + } + function getNodeModuleRootSpecifier(fullSpecifier) { + var components = ts2.getPathComponents(ts2.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1); + if (ts2.startsWith(components[0], "@")) { + return "".concat(components[0], "/").concat(components[1]); + } + return components[0]; + } + } + ts2.createPackageJsonImportFilter = createPackageJsonImportFilter; + function tryParseJson(text) { + try { + return JSON.parse(text); + } catch (_a2) { + return void 0; + } + } + function consumesNodeCoreModules(sourceFile) { + return ts2.some(sourceFile.imports, function(_a2) { + var text = _a2.text; + return ts2.JsTyping.nodeCoreModules.has(text); + }); + } + ts2.consumesNodeCoreModules = consumesNodeCoreModules; + function isInsideNodeModules(fileOrDirectory) { + return ts2.contains(ts2.getPathComponents(fileOrDirectory), "node_modules"); + } + ts2.isInsideNodeModules = isInsideNodeModules; + function isDiagnosticWithLocation(diagnostic) { + return diagnostic.file !== void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0; + } + ts2.isDiagnosticWithLocation = isDiagnosticWithLocation; + function findDiagnosticForNode(node, sortedFileDiagnostics) { + var span = createTextSpanFromNode(node); + var index4 = ts2.binarySearchKey(sortedFileDiagnostics, span, ts2.identity, ts2.compareTextSpans); + if (index4 >= 0) { + var diagnostic = sortedFileDiagnostics[index4]; + ts2.Debug.assertEqual(diagnostic.file, node.getSourceFile(), "Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"); + return ts2.cast(diagnostic, isDiagnosticWithLocation); + } + } + ts2.findDiagnosticForNode = findDiagnosticForNode; + function getDiagnosticsWithinSpan(span, sortedFileDiagnostics) { + var _a2; + var index4 = ts2.binarySearchKey(sortedFileDiagnostics, span.start, function(diag) { + return diag.start; + }, ts2.compareValues); + if (index4 < 0) { + index4 = ~index4; + } + while (((_a2 = sortedFileDiagnostics[index4 - 1]) === null || _a2 === void 0 ? void 0 : _a2.start) === span.start) { + index4--; + } + var result2 = []; + var end = ts2.textSpanEnd(span); + while (true) { + var diagnostic = ts2.tryCast(sortedFileDiagnostics[index4], isDiagnosticWithLocation); + if (!diagnostic || diagnostic.start > end) { + break; + } + if (ts2.textSpanContainsTextSpan(span, diagnostic)) { + result2.push(diagnostic); + } + index4++; + } + return result2; + } + ts2.getDiagnosticsWithinSpan = getDiagnosticsWithinSpan; + function getRefactorContextSpan(_a2) { + var startPosition = _a2.startPosition, endPosition = _a2.endPosition; + return ts2.createTextSpanFromBounds(startPosition, endPosition === void 0 ? startPosition : endPosition); + } + ts2.getRefactorContextSpan = getRefactorContextSpan; + function getFixableErrorSpanExpression(sourceFile, span) { + var token = getTokenAtPosition(sourceFile, span.start); + var expression = ts2.findAncestor(token, function(node) { + if (node.getStart(sourceFile) < span.start || node.getEnd() > ts2.textSpanEnd(span)) { + return "quit"; + } + return ts2.isExpression(node) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile)); + }); + return expression; + } + ts2.getFixableErrorSpanExpression = getFixableErrorSpanExpression; + function mapOneOrMany(valueOrArray, f8, resultSelector) { + if (resultSelector === void 0) { + resultSelector = ts2.identity; + } + return valueOrArray ? ts2.isArray(valueOrArray) ? resultSelector(ts2.map(valueOrArray, f8)) : f8(valueOrArray, 0) : void 0; + } + ts2.mapOneOrMany = mapOneOrMany; + function firstOrOnly(valueOrArray) { + return ts2.isArray(valueOrArray) ? ts2.first(valueOrArray) : valueOrArray; + } + ts2.firstOrOnly = firstOrOnly; + function getNamesForExportedSymbol(symbol, scriptTarget) { + if (needsNameFromDeclaration(symbol)) { + var fromDeclaration = getDefaultLikeExportNameFromDeclaration(symbol); + if (fromDeclaration) + return fromDeclaration; + var fileNameCase = ts2.codefix.moduleSymbolToValidIdentifier( + getSymbolParentOrFail(symbol), + scriptTarget, + /*preferCapitalized*/ + false + ); + var capitalized = ts2.codefix.moduleSymbolToValidIdentifier( + getSymbolParentOrFail(symbol), + scriptTarget, + /*preferCapitalized*/ + true + ); + if (fileNameCase === capitalized) + return fileNameCase; + return [fileNameCase, capitalized]; + } + return symbol.name; + } + ts2.getNamesForExportedSymbol = getNamesForExportedSymbol; + function getNameForExportedSymbol(symbol, scriptTarget, preferCapitalized) { + if (needsNameFromDeclaration(symbol)) { + return getDefaultLikeExportNameFromDeclaration(symbol) || ts2.codefix.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, !!preferCapitalized); + } + return symbol.name; + } + ts2.getNameForExportedSymbol = getNameForExportedSymbol; + function needsNameFromDeclaration(symbol) { + return !(symbol.flags & 33554432) && (symbol.escapedName === "export=" || symbol.escapedName === "default"); + } + function getDefaultLikeExportNameFromDeclaration(symbol) { + return ts2.firstDefined(symbol.declarations, function(d7) { + var _a2; + return ts2.isExportAssignment(d7) ? (_a2 = ts2.tryCast(ts2.skipOuterExpressions(d7.expression), ts2.isIdentifier)) === null || _a2 === void 0 ? void 0 : _a2.text : void 0; + }); + } + function getSymbolParentOrFail(symbol) { + var _a2; + return ts2.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts2.Debug.formatSymbolFlags(symbol.flags), ". ") + "Declarations: ".concat((_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.map(function(d7) { + var kind = ts2.Debug.formatSyntaxKind(d7.kind); + var inJS = ts2.isInJSFile(d7); + var expression = d7.expression; + return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts2.Debug.formatSyntaxKind(expression.kind), ")") : ""); + }).join(", "), ".")); + } + function stringContainsAt(haystack, needle, startIndex) { + var needleLength = needle.length; + if (needleLength + startIndex > haystack.length) { + return false; + } + for (var i7 = 0; i7 < needleLength; i7++) { + if (needle.charCodeAt(i7) !== haystack.charCodeAt(i7 + startIndex)) + return false; + } + return true; + } + ts2.stringContainsAt = stringContainsAt; + function startsWithUnderscore(name2) { + return name2.charCodeAt(0) === 95; + } + ts2.startsWithUnderscore = startsWithUnderscore; + function isGlobalDeclaration(declaration) { + return !isNonGlobalDeclaration(declaration); + } + ts2.isGlobalDeclaration = isGlobalDeclaration; + function isNonGlobalDeclaration(declaration) { + var sourceFile = declaration.getSourceFile(); + if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) { + return false; + } + return ts2.isInJSFile(declaration) || !ts2.findAncestor(declaration, ts2.isGlobalScopeAugmentation); + } + ts2.isNonGlobalDeclaration = isNonGlobalDeclaration; + function isDeprecatedDeclaration(decl) { + return !!(ts2.getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 8192); + } + ts2.isDeprecatedDeclaration = isDeprecatedDeclaration; + function shouldUseUriStyleNodeCoreModules(file, program) { + var decisionFromFile = ts2.firstDefined(file.imports, function(node) { + if (ts2.JsTyping.nodeCoreModules.has(node.text)) { + return ts2.startsWith(node.text, "node:"); + } + }); + return decisionFromFile !== null && decisionFromFile !== void 0 ? decisionFromFile : program.usesUriStyleNodeCoreModules; + } + ts2.shouldUseUriStyleNodeCoreModules = shouldUseUriStyleNodeCoreModules; + function getNewLineKind(newLineCharacter) { + return newLineCharacter === "\n" ? 1 : 0; + } + ts2.getNewLineKind = getNewLineKind; + function diagnosticToString(diag) { + return ts2.isArray(diag) ? ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(diag[0]), diag.slice(1)) : ts2.getLocaleSpecificMessage(diag); + } + ts2.diagnosticToString = diagnosticToString; + function getFormatCodeSettingsForWriting(_a2, sourceFile) { + var options = _a2.options; + var shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === ts2.SemicolonPreference.Ignore; + var shouldRemoveSemicolons = options.semicolons === ts2.SemicolonPreference.Remove || shouldAutoDetectSemicolonPreference && !probablyUsesSemicolons(sourceFile); + return __assign16(__assign16({}, options), { semicolons: shouldRemoveSemicolons ? ts2.SemicolonPreference.Remove : ts2.SemicolonPreference.Ignore }); + } + ts2.getFormatCodeSettingsForWriting = getFormatCodeSettingsForWriting; + function jsxModeNeedsExplicitImport(jsx) { + return jsx === 2 || jsx === 3; + } + ts2.jsxModeNeedsExplicitImport = jsxModeNeedsExplicitImport; + function isSourceFileFromLibrary(program, node) { + return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); + } + ts2.isSourceFileFromLibrary = isSourceFileFromLibrary; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var ImportKind; + (function(ImportKind2) { + ImportKind2[ImportKind2["Named"] = 0] = "Named"; + ImportKind2[ImportKind2["Default"] = 1] = "Default"; + ImportKind2[ImportKind2["Namespace"] = 2] = "Namespace"; + ImportKind2[ImportKind2["CommonJS"] = 3] = "CommonJS"; + })(ImportKind = ts2.ImportKind || (ts2.ImportKind = {})); + var ExportKind; + (function(ExportKind2) { + ExportKind2[ExportKind2["Named"] = 0] = "Named"; + ExportKind2[ExportKind2["Default"] = 1] = "Default"; + ExportKind2[ExportKind2["ExportEquals"] = 2] = "ExportEquals"; + ExportKind2[ExportKind2["UMD"] = 3] = "UMD"; + })(ExportKind = ts2.ExportKind || (ts2.ExportKind = {})); + function createCacheableExportInfoMap(host) { + var exportInfoId = 1; + var exportInfo = ts2.createMultiMap(); + var symbols = new ts2.Map(); + var packages = new ts2.Map(); + var usableByFileName; + var cache = { + isUsableByFile: function(importingFile) { + return importingFile === usableByFileName; + }, + isEmpty: function() { + return !exportInfo.size; + }, + clear: function() { + exportInfo.clear(); + symbols.clear(); + usableByFileName = void 0; + }, + add: function(importingFile, symbol, symbolTableKey, moduleSymbol, moduleFile, exportKind, isFromPackageJson, checker) { + if (importingFile !== usableByFileName) { + cache.clear(); + usableByFileName = importingFile; + } + var packageName; + if (moduleFile) { + var nodeModulesPathParts = ts2.getNodeModulePathParts(moduleFile.fileName); + if (nodeModulesPathParts) { + var topLevelNodeModulesIndex = nodeModulesPathParts.topLevelNodeModulesIndex, topLevelPackageNameIndex = nodeModulesPathParts.topLevelPackageNameIndex, packageRootIndex = nodeModulesPathParts.packageRootIndex; + packageName = ts2.unmangleScopedPackageName(ts2.getPackageNameFromTypesPackageName(moduleFile.fileName.substring(topLevelPackageNameIndex + 1, packageRootIndex))); + if (ts2.startsWith(importingFile, moduleFile.path.substring(0, topLevelNodeModulesIndex))) { + var prevDeepestNodeModulesPath = packages.get(packageName); + var nodeModulesPath = moduleFile.fileName.substring(0, topLevelPackageNameIndex + 1); + if (prevDeepestNodeModulesPath) { + var prevDeepestNodeModulesIndex = prevDeepestNodeModulesPath.indexOf(ts2.nodeModulesPathPart); + if (topLevelNodeModulesIndex > prevDeepestNodeModulesIndex) { + packages.set(packageName, nodeModulesPath); + } + } else { + packages.set(packageName, nodeModulesPath); + } + } + } + } + var isDefault = exportKind === 1; + var namedSymbol = isDefault && ts2.getLocalSymbolForExportDefault(symbol) || symbol; + var names = exportKind === 0 || ts2.isExternalModuleSymbol(namedSymbol) ? ts2.unescapeLeadingUnderscores(symbolTableKey) : ts2.getNamesForExportedSymbol( + namedSymbol, + /*scriptTarget*/ + void 0 + ); + var symbolName = typeof names === "string" ? names : names[0]; + var capitalizedSymbolName = typeof names === "string" ? void 0 : names[1]; + var moduleName3 = ts2.stripQuotes(moduleSymbol.name); + var id = exportInfoId++; + var target = ts2.skipAlias(symbol, checker); + var storedSymbol = symbol.flags & 33554432 ? void 0 : symbol; + var storedModuleSymbol = moduleSymbol.flags & 33554432 ? void 0 : moduleSymbol; + if (!storedSymbol || !storedModuleSymbol) + symbols.set(id, [symbol, moduleSymbol]); + exportInfo.add(key(symbolName, symbol, ts2.isExternalModuleNameRelative(moduleName3) ? void 0 : moduleName3, checker), { + id, + symbolTableKey, + symbolName, + capitalizedSymbolName, + moduleName: moduleName3, + moduleFile, + moduleFileName: moduleFile === null || moduleFile === void 0 ? void 0 : moduleFile.fileName, + packageName, + exportKind, + targetFlags: target.flags, + isFromPackageJson, + symbol: storedSymbol, + moduleSymbol: storedModuleSymbol + }); + }, + get: function(importingFile, key2) { + if (importingFile !== usableByFileName) + return; + var result2 = exportInfo.get(key2); + return result2 === null || result2 === void 0 ? void 0 : result2.map(rehydrateCachedInfo); + }, + search: function(importingFile, preferCapitalized, matches2, action) { + if (importingFile !== usableByFileName) + return; + return ts2.forEachEntry(exportInfo, function(info2, key2) { + var _a2 = parseKey(key2), symbolName = _a2.symbolName, ambientModuleName = _a2.ambientModuleName; + var name2 = preferCapitalized && info2[0].capitalizedSymbolName || symbolName; + if (matches2(name2, info2[0].targetFlags)) { + var rehydrated = info2.map(rehydrateCachedInfo); + var filtered = rehydrated.filter(function(r8, i7) { + return isNotShadowedByDeeperNodeModulesPackage(r8, info2[i7].packageName); + }); + if (filtered.length) { + var res = action(filtered, name2, !!ambientModuleName, key2); + if (res !== void 0) + return res; + } + } + }); + }, + releaseSymbols: function() { + symbols.clear(); + }, + onFileChanged: function(oldSourceFile, newSourceFile, typeAcquisitionEnabled) { + if (fileIsGlobalOnly(oldSourceFile) && fileIsGlobalOnly(newSourceFile)) { + return false; + } + if (usableByFileName && usableByFileName !== newSourceFile.path || // If ATA is enabled, auto-imports uses existing imports to guess whether you want auto-imports from node. + // Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list. + typeAcquisitionEnabled && ts2.consumesNodeCoreModules(oldSourceFile) !== ts2.consumesNodeCoreModules(newSourceFile) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported. + // Changes elsewhere in the file can change the *type* of an export in a module augmentation, + // but type info is gathered in getCompletionEntryDetails, which doesn’t use the cache. + !ts2.arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) || !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)) { + cache.clear(); + return true; + } + usableByFileName = newSourceFile.path; + return false; + } + }; + if (ts2.Debug.isDebugging) { + Object.defineProperty(cache, "__cache", { get: function() { + return exportInfo; + } }); + } + return cache; + function rehydrateCachedInfo(info2) { + if (info2.symbol && info2.moduleSymbol) + return info2; + var id = info2.id, exportKind = info2.exportKind, targetFlags = info2.targetFlags, isFromPackageJson = info2.isFromPackageJson, moduleFileName = info2.moduleFileName; + var _a2 = symbols.get(id) || ts2.emptyArray, cachedSymbol = _a2[0], cachedModuleSymbol = _a2[1]; + if (cachedSymbol && cachedModuleSymbol) { + return { + symbol: cachedSymbol, + moduleSymbol: cachedModuleSymbol, + moduleFileName, + exportKind, + targetFlags, + isFromPackageJson + }; + } + var checker = (isFromPackageJson ? host.getPackageJsonAutoImportProvider() : host.getCurrentProgram()).getTypeChecker(); + var moduleSymbol = info2.moduleSymbol || cachedModuleSymbol || ts2.Debug.checkDefined(info2.moduleFile ? checker.getMergedSymbol(info2.moduleFile.symbol) : checker.tryFindAmbientModule(info2.moduleName)); + var symbol = info2.symbol || cachedSymbol || ts2.Debug.checkDefined(exportKind === 2 ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(ts2.unescapeLeadingUnderscores(info2.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info2.symbolName, "' by key '").concat(info2.symbolTableKey, "' in module ").concat(moduleSymbol.name)); + symbols.set(id, [symbol, moduleSymbol]); + return { + symbol, + moduleSymbol, + moduleFileName, + exportKind, + targetFlags, + isFromPackageJson + }; + } + function key(importedName, symbol, ambientModuleName, checker) { + var moduleKey = ambientModuleName || ""; + return "".concat(importedName, "|").concat(ts2.getSymbolId(ts2.skipAlias(symbol, checker)), "|").concat(moduleKey); + } + function parseKey(key2) { + var symbolName = key2.substring(0, key2.indexOf("|")); + var moduleKey = key2.substring(key2.lastIndexOf("|") + 1); + var ambientModuleName = moduleKey === "" ? void 0 : moduleKey; + return { symbolName, ambientModuleName }; + } + function fileIsGlobalOnly(file) { + return !file.commonJsModuleIndicator && !file.externalModuleIndicator && !file.moduleAugmentations && !file.ambientModuleNames; + } + function ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile) { + if (!ts2.arrayIsEqualTo(oldSourceFile.ambientModuleNames, newSourceFile.ambientModuleNames)) { + return false; + } + var oldFileStatementIndex = -1; + var newFileStatementIndex = -1; + var _loop_2 = function(ambientModuleName2) { + var isMatchingModuleDeclaration = function(node) { + return ts2.isNonGlobalAmbientModule(node) && node.name.text === ambientModuleName2; + }; + oldFileStatementIndex = ts2.findIndex(oldSourceFile.statements, isMatchingModuleDeclaration, oldFileStatementIndex + 1); + newFileStatementIndex = ts2.findIndex(newSourceFile.statements, isMatchingModuleDeclaration, newFileStatementIndex + 1); + if (oldSourceFile.statements[oldFileStatementIndex] !== newSourceFile.statements[newFileStatementIndex]) { + return { value: false }; + } + }; + for (var _i = 0, _a2 = newSourceFile.ambientModuleNames; _i < _a2.length; _i++) { + var ambientModuleName = _a2[_i]; + var state_2 = _loop_2(ambientModuleName); + if (typeof state_2 === "object") + return state_2.value; + } + return true; + } + function isNotShadowedByDeeperNodeModulesPackage(info2, packageName) { + if (!packageName || !info2.moduleFileName) + return true; + var typingsCacheLocation = host.getGlobalTypingsCacheLocation(); + if (typingsCacheLocation && ts2.startsWith(info2.moduleFileName, typingsCacheLocation)) + return true; + var packageDeepestNodeModulesPath = packages.get(packageName); + return !packageDeepestNodeModulesPath || ts2.startsWith(info2.moduleFileName, packageDeepestNodeModulesPath); + } + } + ts2.createCacheableExportInfoMap = createCacheableExportInfoMap; + function isImportableFile(program, from, to, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) { + var _a2; + if (from === to) + return false; + var cachedResult = moduleSpecifierCache === null || moduleSpecifierCache === void 0 ? void 0 : moduleSpecifierCache.get(from.path, to.path, preferences, {}); + if ((cachedResult === null || cachedResult === void 0 ? void 0 : cachedResult.isBlockedByPackageJsonDependencies) !== void 0) { + return !cachedResult.isBlockedByPackageJsonDependencies; + } + var getCanonicalFileName = ts2.hostGetCanonicalFileName(moduleSpecifierResolutionHost); + var globalTypingsCache = (_a2 = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) === null || _a2 === void 0 ? void 0 : _a2.call(moduleSpecifierResolutionHost); + var hasImportablePath = !!ts2.moduleSpecifiers.forEachFileNameOfModule( + from.fileName, + to.fileName, + moduleSpecifierResolutionHost, + /*preferSymlinks*/ + false, + function(toPath2) { + var toFile = program.getSourceFile(toPath2); + return (toFile === to || !toFile) && isImportablePath(from.fileName, toPath2, getCanonicalFileName, globalTypingsCache); + } + ); + if (packageJsonFilter) { + var isAutoImportable = hasImportablePath && packageJsonFilter.allowsImportingSourceFile(to, moduleSpecifierResolutionHost); + moduleSpecifierCache === null || moduleSpecifierCache === void 0 ? void 0 : moduleSpecifierCache.setBlockedByPackageJsonDependencies(from.path, to.path, preferences, {}, !isAutoImportable); + return isAutoImportable; + } + return hasImportablePath; + } + ts2.isImportableFile = isImportableFile; + function isImportablePath(fromPath, toPath2, getCanonicalFileName, globalCachePath) { + var toNodeModules = ts2.forEachAncestorDirectory(toPath2, function(ancestor) { + return ts2.getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0; + }); + var toNodeModulesParent = toNodeModules && ts2.getDirectoryPath(getCanonicalFileName(toNodeModules)); + return toNodeModulesParent === void 0 || ts2.startsWith(getCanonicalFileName(fromPath), toNodeModulesParent) || !!globalCachePath && ts2.startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent); + } + function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) { + var _a2, _b; + var useCaseSensitiveFileNames = ts2.hostUsesCaseSensitiveFileNames(host); + var excludePatterns = preferences.autoImportFileExcludePatterns && ts2.mapDefined(preferences.autoImportFileExcludePatterns, function(spec) { + var pattern5 = ts2.getPatternFromSpec(spec, "", "exclude"); + return pattern5 ? ts2.getRegexFromPattern(pattern5, useCaseSensitiveFileNames) : void 0; + }); + forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, function(module6, file) { + return cb( + module6, + file, + program, + /*isFromPackageJson*/ + false + ); + }); + var autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) === null || _a2 === void 0 ? void 0 : _a2.call(host)); + if (autoImportProvider) { + var start = ts2.timestamp(); + forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, function(module6, file) { + return cb( + module6, + file, + autoImportProvider, + /*isFromPackageJson*/ + true + ); + }); + (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts2.timestamp() - start)); + } + } + ts2.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom; + function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) { + var _a2; + var isExcluded = function(fileName) { + return excludePatterns === null || excludePatterns === void 0 ? void 0 : excludePatterns.some(function(p7) { + return p7.test(fileName); + }); + }; + for (var _i = 0, _b = checker.getAmbientModules(); _i < _b.length; _i++) { + var ambient = _b[_i]; + if (!ts2.stringContains(ambient.name, "*") && !(excludePatterns && ((_a2 = ambient.declarations) === null || _a2 === void 0 ? void 0 : _a2.every(function(d7) { + return isExcluded(d7.getSourceFile().fileName); + })))) { + cb( + ambient, + /*sourceFile*/ + void 0 + ); + } + } + for (var _c = 0, allSourceFiles_1 = allSourceFiles; _c < allSourceFiles_1.length; _c++) { + var sourceFile = allSourceFiles_1[_c]; + if (ts2.isExternalOrCommonJsModule(sourceFile) && !isExcluded(sourceFile.fileName)) { + cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); + } + } + } + function getExportInfoMap(importingFile, host, program, preferences, cancellationToken) { + var _a2, _b, _c, _d, _e2; + var start = ts2.timestamp(); + (_a2 = host.getPackageJsonAutoImportProvider) === null || _a2 === void 0 ? void 0 : _a2.call(host); + var cache = ((_b = host.getCachedExportInfoMap) === null || _b === void 0 ? void 0 : _b.call(host)) || createCacheableExportInfoMap({ + getCurrentProgram: function() { + return program; + }, + getPackageJsonAutoImportProvider: function() { + var _a3; + return (_a3 = host.getPackageJsonAutoImportProvider) === null || _a3 === void 0 ? void 0 : _a3.call(host); + }, + getGlobalTypingsCacheLocation: function() { + var _a3; + return (_a3 = host.getGlobalTypingsCacheLocation) === null || _a3 === void 0 ? void 0 : _a3.call(host); + } + }); + if (cache.isUsableByFile(importingFile.path)) { + (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "getExportInfoMap: cache hit"); + return cache; + } + (_d = host.log) === null || _d === void 0 ? void 0 : _d.call(host, "getExportInfoMap: cache miss or empty; calculating new results"); + var compilerOptions = program.getCompilerOptions(); + var moduleCount = 0; + try { + forEachExternalModuleToImportFrom( + program, + host, + preferences, + /*useAutoImportProvider*/ + true, + function(moduleSymbol, moduleFile, program2, isFromPackageJson) { + if (++moduleCount % 100 === 0) + cancellationToken === null || cancellationToken === void 0 ? void 0 : cancellationToken.throwIfCancellationRequested(); + var seenExports = new ts2.Map(); + var checker = program2.getTypeChecker(); + var defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) { + cache.add(importingFile.path, defaultInfo.symbol, defaultInfo.exportKind === 1 ? "default" : "export=", moduleSymbol, moduleFile, defaultInfo.exportKind, isFromPackageJson, checker); + } + checker.forEachExportAndPropertyOfModule(moduleSymbol, function(exported, key) { + if (exported !== (defaultInfo === null || defaultInfo === void 0 ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && ts2.addToSeen(seenExports, key)) { + cache.add(importingFile.path, exported, key, moduleSymbol, moduleFile, 0, isFromPackageJson, checker); + } + }); + } + ); + } catch (err) { + cache.clear(); + throw err; + } + (_e2 = host.log) === null || _e2 === void 0 ? void 0 : _e2.call(host, "getExportInfoMap: done in ".concat(ts2.timestamp() - start, " ms")); + return cache; + } + ts2.getExportInfoMap = getExportInfoMap; + function getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions) { + var exported = getDefaultLikeExportWorker(moduleSymbol, checker); + if (!exported) + return void 0; + var symbol = exported.symbol, exportKind = exported.exportKind; + var info2 = getDefaultExportInfoWorker(symbol, checker, compilerOptions); + return info2 && __assign16({ symbol, exportKind }, info2); + } + ts2.getDefaultLikeExportInfo = getDefaultLikeExportInfo; + function isImportableSymbol(symbol, checker) { + return !checker.isUndefinedSymbol(symbol) && !checker.isUnknownSymbol(symbol) && !ts2.isKnownSymbol(symbol) && !ts2.isPrivateIdentifierSymbol(symbol); + } + function getDefaultLikeExportWorker(moduleSymbol, checker) { + var exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) + return { + symbol: exportEquals, + exportKind: 2 + /* ExportKind.ExportEquals */ + }; + var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + if (defaultExport) + return { + symbol: defaultExport, + exportKind: 1 + /* ExportKind.Default */ + }; + } + function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { + var localSymbol = ts2.getLocalSymbolForExportDefault(defaultExport); + if (localSymbol) + return { symbolForMeaning: localSymbol, name: localSymbol.name }; + var name2 = getNameForExportDefault(defaultExport); + if (name2 !== void 0) + return { symbolForMeaning: defaultExport, name: name2 }; + if (defaultExport.flags & 2097152) { + var aliased = checker.getImmediateAliasedSymbol(defaultExport); + if (aliased && aliased.parent) { + return getDefaultExportInfoWorker(aliased, checker, compilerOptions); + } + } + if (defaultExport.escapedName !== "default" && defaultExport.escapedName !== "export=") { + return { symbolForMeaning: defaultExport, name: defaultExport.getName() }; + } + return { symbolForMeaning: defaultExport, name: ts2.getNameForExportedSymbol(defaultExport, compilerOptions.target) }; + } + function getNameForExportDefault(symbol) { + return symbol.declarations && ts2.firstDefined(symbol.declarations, function(declaration) { + var _a2; + if (ts2.isExportAssignment(declaration)) { + return (_a2 = ts2.tryCast(ts2.skipOuterExpressions(declaration.expression), ts2.isIdentifier)) === null || _a2 === void 0 ? void 0 : _a2.text; + } else if (ts2.isExportSpecifier(declaration)) { + ts2.Debug.assert(declaration.name.text === "default", "Expected the specifier to be a default export"); + return declaration.propertyName && declaration.propertyName.text; + } + }); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function createClassifier() { + var scanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false + ); + function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + return convertClassificationsToResult(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } + function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { + var token = 0; + var lastNonTriviaToken = 0; + var templateStack = []; + var _a2 = getPrefixFromLexState(lexState), prefix = _a2.prefix, pushTemplate = _a2.pushTemplate; + text = prefix + text; + var offset = prefix.length; + if (pushTemplate) { + templateStack.push( + 15 + /* SyntaxKind.TemplateHead */ + ); + } + scanner.setText(text); + var endOfLineState = 0; + var spans = []; + var angleBracketStack = 0; + do { + token = scanner.scan(); + if (!ts2.isTrivia(token)) { + handleToken(); + lastNonTriviaToken = token; + } + var end = scanner.getTextPos(); + pushEncodedClassification(scanner.getTokenPos(), end, offset, classFromKind(token), spans); + if (end >= text.length) { + var end_1 = getNewEndOfLineState(scanner, token, ts2.lastOrUndefined(templateStack)); + if (end_1 !== void 0) { + endOfLineState = end_1; + } + } + } while (token !== 1); + function handleToken() { + switch (token) { + case 43: + case 68: + if (!noRegexTable[lastNonTriviaToken] && scanner.reScanSlashToken() === 13) { + token = 13; + } + break; + case 29: + if (lastNonTriviaToken === 79) { + angleBracketStack++; + } + break; + case 31: + if (angleBracketStack > 0) { + angleBracketStack--; + } + break; + case 131: + case 152: + case 148: + case 134: + case 153: + if (angleBracketStack > 0 && !syntacticClassifierAbsent) { + token = 79; + } + break; + case 15: + templateStack.push(token); + break; + case 18: + if (templateStack.length > 0) { + templateStack.push(token); + } + break; + case 19: + if (templateStack.length > 0) { + var lastTemplateStackToken = ts2.lastOrUndefined(templateStack); + if (lastTemplateStackToken === 15) { + token = scanner.reScanTemplateToken( + /* isTaggedTemplate */ + false + ); + if (token === 17) { + templateStack.pop(); + } else { + ts2.Debug.assertEqual(token, 16, "Should have been a template middle."); + } + } else { + ts2.Debug.assertEqual(lastTemplateStackToken, 18, "Should have been an open brace"); + templateStack.pop(); + } + } + break; + default: + if (!ts2.isKeyword(token)) { + break; + } + if (lastNonTriviaToken === 24) { + token = 79; + } else if (ts2.isKeyword(lastNonTriviaToken) && ts2.isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { + token = 79; + } + } + } + return { endOfLineState, spans }; + } + return { getClassificationsForLine, getEncodedLexicalClassifications }; + } + ts2.createClassifier = createClassifier; + var noRegexTable = ts2.arrayToNumericMap([ + 79, + 10, + 8, + 9, + 13, + 108, + 45, + 46, + 21, + 23, + 19, + 110, + 95 + ], function(token) { + return token; + }, function() { + return true; + }); + function getNewEndOfLineState(scanner, token, lastOnTemplateStack) { + switch (token) { + case 10: { + if (!scanner.isUnterminated()) + return void 0; + var tokenText = scanner.getTokenText(); + var lastCharIndex = tokenText.length - 1; + var numBackslashes = 0; + while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { + numBackslashes++; + } + if ((numBackslashes & 1) === 0) + return void 0; + return tokenText.charCodeAt(0) === 34 ? 3 : 2; + } + case 3: + return scanner.isUnterminated() ? 1 : void 0; + default: + if (ts2.isTemplateLiteralKind(token)) { + if (!scanner.isUnterminated()) { + return void 0; + } + switch (token) { + case 17: + return 5; + case 14: + return 4; + default: + return ts2.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + } + } + return lastOnTemplateStack === 15 ? 6 : void 0; + } + } + function pushEncodedClassification(start, end, offset, classification, result2) { + if (classification === 8) { + return; + } + if (start === 0 && offset > 0) { + start += offset; + } + var length = end - start; + if (length > 0) { + result2.push(start - offset, length, classification); + } + } + function convertClassificationsToResult(classifications, text) { + var entries = []; + var dense = classifications.spans; + var lastEnd = 0; + for (var i7 = 0; i7 < dense.length; i7 += 3) { + var start = dense[i7]; + var length_1 = dense[i7 + 1]; + var type3 = dense[i7 + 2]; + if (lastEnd >= 0) { + var whitespaceLength_1 = start - lastEnd; + if (whitespaceLength_1 > 0) { + entries.push({ length: whitespaceLength_1, classification: ts2.TokenClass.Whitespace }); + } + } + entries.push({ length: length_1, classification: convertClassification(type3) }); + lastEnd = start + length_1; + } + var whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ length: whitespaceLength, classification: ts2.TokenClass.Whitespace }); + } + return { entries, finalLexState: classifications.endOfLineState }; + } + function convertClassification(type3) { + switch (type3) { + case 1: + return ts2.TokenClass.Comment; + case 3: + return ts2.TokenClass.Keyword; + case 4: + return ts2.TokenClass.NumberLiteral; + case 25: + return ts2.TokenClass.BigIntLiteral; + case 5: + return ts2.TokenClass.Operator; + case 6: + return ts2.TokenClass.StringLiteral; + case 8: + return ts2.TokenClass.Whitespace; + case 10: + return ts2.TokenClass.Punctuation; + case 2: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 9: + case 17: + return ts2.TokenClass.Identifier; + default: + return void 0; + } + } + function canFollow(keyword1, keyword2) { + if (!ts2.isAccessibilityModifier(keyword1)) { + return true; + } + switch (keyword2) { + case 137: + case 151: + case 135: + case 124: + case 127: + return true; + default: + return false; + } + } + function getPrefixFromLexState(lexState) { + switch (lexState) { + case 3: + return { prefix: '"\\\n' }; + case 2: + return { prefix: "'\\\n" }; + case 1: + return { prefix: "/*\n" }; + case 4: + return { prefix: "`\n" }; + case 5: + return { prefix: "}\n", pushTemplate: true }; + case 6: + return { prefix: "", pushTemplate: true }; + case 0: + return { prefix: "" }; + default: + return ts2.Debug.assertNever(lexState); + } + } + function isBinaryExpressionOperatorToken(token) { + switch (token) { + case 41: + case 43: + case 44: + case 39: + case 40: + case 47: + case 48: + case 49: + case 29: + case 31: + case 32: + case 33: + case 102: + case 101: + case 128: + case 150: + case 34: + case 35: + case 36: + case 37: + case 50: + case 52: + case 51: + case 55: + case 56: + case 74: + case 73: + case 78: + case 70: + case 71: + case 72: + case 64: + case 65: + case 66: + case 68: + case 69: + case 63: + case 27: + case 60: + case 75: + case 76: + case 77: + return true; + default: + return false; + } + } + function isPrefixUnaryExpressionOperatorToken(token) { + switch (token) { + case 39: + case 40: + case 54: + case 53: + case 45: + case 46: + return true; + default: + return false; + } + } + function classFromKind(token) { + if (ts2.isKeyword(token)) { + return 3; + } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { + return 5; + } else if (token >= 18 && token <= 78) { + return 10; + } + switch (token) { + case 8: + return 4; + case 9: + return 25; + case 10: + return 6; + case 13: + return 7; + case 7: + case 3: + case 2: + return 1; + case 5: + case 4: + return 8; + case 79: + default: + if (ts2.isTemplateLiteralKind(token)) { + return 6; + } + return 2; + } + } + function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { + return convertClassificationsToSpans(getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span)); + } + ts2.getSemanticClassifications = getSemanticClassifications; + function checkForClassificationCancellation(cancellationToken, kind) { + switch (kind) { + case 264: + case 260: + case 261: + case 259: + case 228: + case 215: + case 216: + cancellationToken.throwIfCancellationRequested(); + } + } + function getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { + var spans = []; + sourceFile.forEachChild(function cb(node) { + if (!node || !ts2.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { + return; + } + checkForClassificationCancellation(cancellationToken, node.kind); + if (ts2.isIdentifier(node) && !ts2.nodeIsMissing(node) && classifiableNames.has(node.escapedText)) { + var symbol = typeChecker.getSymbolAtLocation(node); + var type3 = symbol && classifySymbol(symbol, ts2.getMeaningFromLocation(node), typeChecker); + if (type3) { + pushClassification(node.getStart(sourceFile), node.getEnd(), type3); + } + } + node.forEachChild(cb); + }); + return { + spans, + endOfLineState: 0 + /* EndOfLineState.None */ + }; + function pushClassification(start, end, type3) { + var length = end - start; + ts2.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length)); + spans.push(start); + spans.push(length); + spans.push(type3); + } + } + ts2.getEncodedSemanticClassifications = getEncodedSemanticClassifications; + function classifySymbol(symbol, meaningAtPosition, checker) { + var flags = symbol.getFlags(); + if ((flags & 2885600) === 0) { + return void 0; + } else if (flags & 32) { + return 11; + } else if (flags & 384) { + return 12; + } else if (flags & 524288) { + return 16; + } else if (flags & 1536) { + return meaningAtPosition & 4 || meaningAtPosition & 1 && hasValueSideModule(symbol) ? 14 : void 0; + } else if (flags & 2097152) { + return classifySymbol(checker.getAliasedSymbol(symbol), meaningAtPosition, checker); + } else if (meaningAtPosition & 2) { + return flags & 64 ? 13 : flags & 262144 ? 15 : void 0; + } else { + return void 0; + } + } + function hasValueSideModule(symbol) { + return ts2.some(symbol.declarations, function(declaration) { + return ts2.isModuleDeclaration(declaration) && ts2.getModuleInstanceState(declaration) === 1; + }); + } + function getClassificationTypeName(type3) { + switch (type3) { + case 1: + return "comment"; + case 2: + return "identifier"; + case 3: + return "keyword"; + case 4: + return "number"; + case 25: + return "bigint"; + case 5: + return "operator"; + case 6: + return "string"; + case 8: + return "whitespace"; + case 9: + return "text"; + case 10: + return "punctuation"; + case 11: + return "class name"; + case 12: + return "enum name"; + case 13: + return "interface name"; + case 14: + return "module name"; + case 15: + return "type parameter name"; + case 16: + return "type alias name"; + case 17: + return "parameter name"; + case 18: + return "doc comment tag name"; + case 19: + return "jsx open tag name"; + case 20: + return "jsx close tag name"; + case 21: + return "jsx self closing tag name"; + case 22: + return "jsx attribute"; + case 23: + return "jsx text"; + case 24: + return "jsx attribute string literal value"; + default: + return void 0; + } + } + function convertClassificationsToSpans(classifications) { + ts2.Debug.assert(classifications.spans.length % 3 === 0); + var dense = classifications.spans; + var result2 = []; + for (var i7 = 0; i7 < dense.length; i7 += 3) { + result2.push({ + textSpan: ts2.createTextSpan(dense[i7], dense[i7 + 1]), + classificationType: getClassificationTypeName(dense[i7 + 2]) + }); + } + return result2; + } + function getSyntacticClassifications(cancellationToken, sourceFile, span) { + return convertClassificationsToSpans(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)); + } + ts2.getSyntacticClassifications = getSyntacticClassifications; + function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) { + var spanStart = span.start; + var spanLength = span.length; + var triviaScanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false, + sourceFile.languageVariant, + sourceFile.text + ); + var mergeConflictScanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false, + sourceFile.languageVariant, + sourceFile.text + ); + var result2 = []; + processElement(sourceFile); + return { + spans: result2, + endOfLineState: 0 + /* EndOfLineState.None */ + }; + function pushClassification(start, length, type3) { + result2.push(start); + result2.push(length); + result2.push(type3); + } + function classifyLeadingTriviaAndGetTokenStart(token) { + triviaScanner.setTextPos(token.pos); + while (true) { + var start = triviaScanner.getTextPos(); + if (!ts2.couldStartTrivia(sourceFile.text, start)) { + return start; + } + var kind = triviaScanner.scan(); + var end = triviaScanner.getTextPos(); + var width = end - start; + if (!ts2.isTrivia(kind)) { + return start; + } + switch (kind) { + case 4: + case 5: + continue; + case 2: + case 3: + classifyComment(token, kind, start, width); + triviaScanner.setTextPos(end); + continue; + case 7: + var text = sourceFile.text; + var ch = text.charCodeAt(start); + if (ch === 60 || ch === 62) { + pushClassification( + start, + width, + 1 + /* ClassificationType.comment */ + ); + continue; + } + ts2.Debug.assert( + ch === 124 || ch === 61 + /* CharacterCodes.equals */ + ); + classifyDisabledMergeCode(text, start, end); + break; + case 6: + break; + default: + ts2.Debug.assertNever(kind); + } + } + } + function classifyComment(token, kind, start, width) { + if (kind === 3) { + var docCommentAndDiagnostics = ts2.parseIsolatedJSDocComment(sourceFile.text, start, width); + if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDoc) { + ts2.setParent(docCommentAndDiagnostics.jsDoc, token); + classifyJSDocComment(docCommentAndDiagnostics.jsDoc); + return; + } + } else if (kind === 2) { + if (tryClassifyTripleSlashComment(start, width)) { + return; + } + } + pushCommentRange(start, width); + } + function pushCommentRange(start, width) { + pushClassification( + start, + width, + 1 + /* ClassificationType.comment */ + ); + } + function classifyJSDocComment(docComment) { + var _a2, _b, _c, _d, _e2, _f, _g; + var pos = docComment.pos; + if (docComment.tags) { + for (var _i = 0, _h = docComment.tags; _i < _h.length; _i++) { + var tag = _h[_i]; + if (tag.pos !== pos) { + pushCommentRange(pos, tag.pos - pos); + } + pushClassification( + tag.pos, + 1, + 10 + /* ClassificationType.punctuation */ + ); + pushClassification( + tag.tagName.pos, + tag.tagName.end - tag.tagName.pos, + 18 + /* ClassificationType.docCommentTagName */ + ); + pos = tag.tagName.end; + var commentStart = tag.tagName.end; + switch (tag.kind) { + case 343: + var param = tag; + processJSDocParameterTag(param); + commentStart = param.isNameFirst && ((_a2 = param.typeExpression) === null || _a2 === void 0 ? void 0 : _a2.end) || param.name.end; + break; + case 350: + var prop = tag; + commentStart = prop.isNameFirst && ((_b = prop.typeExpression) === null || _b === void 0 ? void 0 : _b.end) || prop.name.end; + break; + case 347: + processJSDocTemplateTag(tag); + pos = tag.end; + commentStart = tag.typeParameters.end; + break; + case 348: + var type3 = tag; + commentStart = ((_c = type3.typeExpression) === null || _c === void 0 ? void 0 : _c.kind) === 312 && ((_d = type3.fullName) === null || _d === void 0 ? void 0 : _d.end) || ((_e2 = type3.typeExpression) === null || _e2 === void 0 ? void 0 : _e2.end) || commentStart; + break; + case 341: + commentStart = tag.typeExpression.end; + break; + case 346: + processElement(tag.typeExpression); + pos = tag.end; + commentStart = tag.typeExpression.end; + break; + case 345: + case 342: + commentStart = tag.typeExpression.end; + break; + case 344: + processElement(tag.typeExpression); + pos = tag.end; + commentStart = ((_f = tag.typeExpression) === null || _f === void 0 ? void 0 : _f.end) || commentStart; + break; + case 349: + commentStart = ((_g = tag.name) === null || _g === void 0 ? void 0 : _g.end) || commentStart; + break; + case 331: + case 332: + commentStart = tag.class.end; + break; + } + if (typeof tag.comment === "object") { + pushCommentRange(tag.comment.pos, tag.comment.end - tag.comment.pos); + } else if (typeof tag.comment === "string") { + pushCommentRange(commentStart, tag.end - commentStart); + } + } + } + if (pos !== docComment.end) { + pushCommentRange(pos, docComment.end - pos); + } + return; + function processJSDocParameterTag(tag2) { + if (tag2.isNameFirst) { + pushCommentRange(pos, tag2.name.pos - pos); + pushClassification( + tag2.name.pos, + tag2.name.end - tag2.name.pos, + 17 + /* ClassificationType.parameterName */ + ); + pos = tag2.name.end; + } + if (tag2.typeExpression) { + pushCommentRange(pos, tag2.typeExpression.pos - pos); + processElement(tag2.typeExpression); + pos = tag2.typeExpression.end; + } + if (!tag2.isNameFirst) { + pushCommentRange(pos, tag2.name.pos - pos); + pushClassification( + tag2.name.pos, + tag2.name.end - tag2.name.pos, + 17 + /* ClassificationType.parameterName */ + ); + pos = tag2.name.end; + } + } + } + function tryClassifyTripleSlashComment(start, width) { + var tripleSlashXMLCommentRegEx = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im; + var attributeRegex = /(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/img; + var text = sourceFile.text.substr(start, width); + var match = tripleSlashXMLCommentRegEx.exec(text); + if (!match) { + return false; + } + if (!match[3] || !(match[3] in ts2.commentPragmas)) { + return false; + } + var pos = start; + pushCommentRange(pos, match[1].length); + pos += match[1].length; + pushClassification( + pos, + match[2].length, + 10 + /* ClassificationType.punctuation */ + ); + pos += match[2].length; + pushClassification( + pos, + match[3].length, + 21 + /* ClassificationType.jsxSelfClosingTagName */ + ); + pos += match[3].length; + var attrText = match[4]; + var attrPos = pos; + while (true) { + var attrMatch = attributeRegex.exec(attrText); + if (!attrMatch) { + break; + } + var newAttrPos = pos + attrMatch.index + attrMatch[1].length; + if (newAttrPos > attrPos) { + pushCommentRange(attrPos, newAttrPos - attrPos); + attrPos = newAttrPos; + } + pushClassification( + attrPos, + attrMatch[2].length, + 22 + /* ClassificationType.jsxAttribute */ + ); + attrPos += attrMatch[2].length; + if (attrMatch[3].length) { + pushCommentRange(attrPos, attrMatch[3].length); + attrPos += attrMatch[3].length; + } + pushClassification( + attrPos, + attrMatch[4].length, + 5 + /* ClassificationType.operator */ + ); + attrPos += attrMatch[4].length; + if (attrMatch[5].length) { + pushCommentRange(attrPos, attrMatch[5].length); + attrPos += attrMatch[5].length; + } + pushClassification( + attrPos, + attrMatch[6].length, + 24 + /* ClassificationType.jsxAttributeStringLiteralValue */ + ); + attrPos += attrMatch[6].length; + } + pos += match[4].length; + if (pos > attrPos) { + pushCommentRange(attrPos, pos - attrPos); + } + if (match[5]) { + pushClassification( + pos, + match[5].length, + 10 + /* ClassificationType.punctuation */ + ); + pos += match[5].length; + } + var end = start + width; + if (pos < end) { + pushCommentRange(pos, end - pos); + } + return true; + } + function processJSDocTemplateTag(tag) { + for (var _i = 0, _a2 = tag.getChildren(); _i < _a2.length; _i++) { + var child = _a2[_i]; + processElement(child); + } + } + function classifyDisabledMergeCode(text, start, end) { + var i7; + for (i7 = start; i7 < end; i7++) { + if (ts2.isLineBreak(text.charCodeAt(i7))) { + break; + } + } + pushClassification( + start, + i7 - start, + 1 + /* ClassificationType.comment */ + ); + mergeConflictScanner.setTextPos(i7); + while (mergeConflictScanner.getTextPos() < end) { + classifyDisabledCodeToken(); + } + } + function classifyDisabledCodeToken() { + var start = mergeConflictScanner.getTextPos(); + var tokenKind = mergeConflictScanner.scan(); + var end = mergeConflictScanner.getTextPos(); + var type3 = classifyTokenType(tokenKind); + if (type3) { + pushClassification(start, end - start, type3); + } + } + function tryClassifyNode(node) { + if (ts2.isJSDoc(node)) { + return true; + } + if (ts2.nodeIsMissing(node)) { + return true; + } + var classifiedElementName = tryClassifyJsxElementName(node); + if (!ts2.isToken(node) && node.kind !== 11 && classifiedElementName === void 0) { + return false; + } + var tokenStart = node.kind === 11 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); + var tokenWidth = node.end - tokenStart; + ts2.Debug.assert(tokenWidth >= 0); + if (tokenWidth > 0) { + var type3 = classifiedElementName || classifyTokenType(node.kind, node); + if (type3) { + pushClassification(tokenStart, tokenWidth, type3); + } + } + return true; + } + function tryClassifyJsxElementName(token) { + switch (token.parent && token.parent.kind) { + case 283: + if (token.parent.tagName === token) { + return 19; + } + break; + case 284: + if (token.parent.tagName === token) { + return 20; + } + break; + case 282: + if (token.parent.tagName === token) { + return 21; + } + break; + case 288: + if (token.parent.name === token) { + return 22; + } + break; + } + return void 0; + } + function classifyTokenType(tokenKind, token) { + if (ts2.isKeyword(tokenKind)) { + return 3; + } + if (tokenKind === 29 || tokenKind === 31) { + if (token && ts2.getTypeArgumentOrTypeParameterList(token.parent)) { + return 10; + } + } + if (ts2.isPunctuation(tokenKind)) { + if (token) { + var parent2 = token.parent; + if (tokenKind === 63) { + if (parent2.kind === 257 || parent2.kind === 169 || parent2.kind === 166 || parent2.kind === 288) { + return 5; + } + } + if (parent2.kind === 223 || parent2.kind === 221 || parent2.kind === 222 || parent2.kind === 224) { + return 5; + } + } + return 10; + } else if (tokenKind === 8) { + return 4; + } else if (tokenKind === 9) { + return 25; + } else if (tokenKind === 10) { + return token && token.parent.kind === 288 ? 24 : 6; + } else if (tokenKind === 13) { + return 6; + } else if (ts2.isTemplateLiteralKind(tokenKind)) { + return 6; + } else if (tokenKind === 11) { + return 23; + } else if (tokenKind === 79) { + if (token) { + switch (token.parent.kind) { + case 260: + if (token.parent.name === token) { + return 11; + } + return; + case 165: + if (token.parent.name === token) { + return 15; + } + return; + case 261: + if (token.parent.name === token) { + return 13; + } + return; + case 263: + if (token.parent.name === token) { + return 12; + } + return; + case 264: + if (token.parent.name === token) { + return 14; + } + return; + case 166: + if (token.parent.name === token) { + return ts2.isThisIdentifier(token) ? 3 : 17; + } + return; + } + if (ts2.isConstTypeReference(token.parent)) { + return 3; + } + } + return 2; + } + } + function processElement(element) { + if (!element) { + return; + } + if (ts2.decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { + checkForClassificationCancellation(cancellationToken, element.kind); + for (var _i = 0, _a2 = element.getChildren(sourceFile); _i < _a2.length; _i++) { + var child = _a2[_i]; + if (!tryClassifyNode(child)) { + processElement(child); + } + } + } + } + } + ts2.getEncodedSyntacticClassifications = getEncodedSyntacticClassifications; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var classifier; + (function(classifier2) { + var v2020; + (function(v20202) { + var TokenEncodingConsts; + (function(TokenEncodingConsts2) { + TokenEncodingConsts2[TokenEncodingConsts2["typeOffset"] = 8] = "typeOffset"; + TokenEncodingConsts2[TokenEncodingConsts2["modifierMask"] = 255] = "modifierMask"; + })(TokenEncodingConsts = v20202.TokenEncodingConsts || (v20202.TokenEncodingConsts = {})); + var TokenType; + (function(TokenType2) { + TokenType2[TokenType2["class"] = 0] = "class"; + TokenType2[TokenType2["enum"] = 1] = "enum"; + TokenType2[TokenType2["interface"] = 2] = "interface"; + TokenType2[TokenType2["namespace"] = 3] = "namespace"; + TokenType2[TokenType2["typeParameter"] = 4] = "typeParameter"; + TokenType2[TokenType2["type"] = 5] = "type"; + TokenType2[TokenType2["parameter"] = 6] = "parameter"; + TokenType2[TokenType2["variable"] = 7] = "variable"; + TokenType2[TokenType2["enumMember"] = 8] = "enumMember"; + TokenType2[TokenType2["property"] = 9] = "property"; + TokenType2[TokenType2["function"] = 10] = "function"; + TokenType2[TokenType2["member"] = 11] = "member"; + })(TokenType = v20202.TokenType || (v20202.TokenType = {})); + var TokenModifier; + (function(TokenModifier2) { + TokenModifier2[TokenModifier2["declaration"] = 0] = "declaration"; + TokenModifier2[TokenModifier2["static"] = 1] = "static"; + TokenModifier2[TokenModifier2["async"] = 2] = "async"; + TokenModifier2[TokenModifier2["readonly"] = 3] = "readonly"; + TokenModifier2[TokenModifier2["defaultLibrary"] = 4] = "defaultLibrary"; + TokenModifier2[TokenModifier2["local"] = 5] = "local"; + })(TokenModifier = v20202.TokenModifier || (v20202.TokenModifier = {})); + function getSemanticClassifications(program, cancellationToken, sourceFile, span) { + var classifications = getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span); + ts2.Debug.assert(classifications.spans.length % 3 === 0); + var dense = classifications.spans; + var result2 = []; + for (var i7 = 0; i7 < dense.length; i7 += 3) { + result2.push({ + textSpan: ts2.createTextSpan(dense[i7], dense[i7 + 1]), + classificationType: dense[i7 + 2] + }); + } + return result2; + } + v20202.getSemanticClassifications = getSemanticClassifications; + function getEncodedSemanticClassifications(program, cancellationToken, sourceFile, span) { + return { + spans: getSemanticTokens(program, sourceFile, span, cancellationToken), + endOfLineState: 0 + /* EndOfLineState.None */ + }; + } + v20202.getEncodedSemanticClassifications = getEncodedSemanticClassifications; + function getSemanticTokens(program, sourceFile, span, cancellationToken) { + var resultTokens = []; + var collector = function(node, typeIdx, modifierSet) { + resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), (typeIdx + 1 << 8) + modifierSet); + }; + if (program && sourceFile) { + collectTokens(program, sourceFile, span, collector, cancellationToken); + } + return resultTokens; + } + function collectTokens(program, sourceFile, span, collector, cancellationToken) { + var typeChecker = program.getTypeChecker(); + var inJSXElement = false; + function visit7(node) { + switch (node.kind) { + case 264: + case 260: + case 261: + case 259: + case 228: + case 215: + case 216: + cancellationToken.throwIfCancellationRequested(); + } + if (!node || !ts2.textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { + return; + } + var prevInJSXElement = inJSXElement; + if (ts2.isJsxElement(node) || ts2.isJsxSelfClosingElement(node)) { + inJSXElement = true; + } + if (ts2.isJsxExpression(node)) { + inJSXElement = false; + } + if (ts2.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !ts2.isInfinityOrNaNString(node.escapedText)) { + var symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + if (symbol.flags & 2097152) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + var typeIdx = classifySymbol(symbol, ts2.getMeaningFromLocation(node)); + if (typeIdx !== void 0) { + var modifierSet = 0; + if (node.parent) { + var parentIsDeclaration = ts2.isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx; + if (parentIsDeclaration && node.parent.name === node) { + modifierSet = 1 << 0; + } + } + if (typeIdx === 6 && isRightSideOfQualifiedNameOrPropertyAccess(node)) { + typeIdx = 9; + } + typeIdx = reclassifyByType(typeChecker, node, typeIdx); + var decl = symbol.valueDeclaration; + if (decl) { + var modifiers = ts2.getCombinedModifierFlags(decl); + var nodeFlags = ts2.getCombinedNodeFlags(decl); + if (modifiers & 32) { + modifierSet |= 1 << 1; + } + if (modifiers & 512) { + modifierSet |= 1 << 2; + } + if (typeIdx !== 0 && typeIdx !== 2) { + if (modifiers & 64 || nodeFlags & 2 || symbol.getFlags() & 8) { + modifierSet |= 1 << 3; + } + } + if ((typeIdx === 7 || typeIdx === 10) && isLocalDeclaration(decl, sourceFile)) { + modifierSet |= 1 << 5; + } + if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { + modifierSet |= 1 << 4; + } + } else if (symbol.declarations && symbol.declarations.some(function(d7) { + return program.isSourceFileDefaultLibrary(d7.getSourceFile()); + })) { + modifierSet |= 1 << 4; + } + collector(node, typeIdx, modifierSet); + } + } + } + ts2.forEachChild(node, visit7); + inJSXElement = prevInJSXElement; + } + visit7(sourceFile); + } + function classifySymbol(symbol, meaning) { + var flags = symbol.getFlags(); + if (flags & 32) { + return 0; + } else if (flags & 384) { + return 1; + } else if (flags & 524288) { + return 5; + } else if (flags & 64) { + if (meaning & 2) { + return 2; + } + } else if (flags & 262144) { + return 4; + } + var decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; + if (decl && ts2.isBindingElement(decl)) { + decl = getDeclarationForBindingElement(decl); + } + return decl && tokenFromDeclarationMapping.get(decl.kind); + } + function reclassifyByType(typeChecker, node, typeIdx) { + if (typeIdx === 7 || typeIdx === 9 || typeIdx === 6) { + var type_1 = typeChecker.getTypeAtLocation(node); + if (type_1) { + var test = function(condition) { + return condition(type_1) || type_1.isUnion() && type_1.types.some(condition); + }; + if (typeIdx !== 6 && test(function(t8) { + return t8.getConstructSignatures().length > 0; + })) { + return 0; + } + if (test(function(t8) { + return t8.getCallSignatures().length > 0; + }) && !test(function(t8) { + return t8.getProperties().length > 0; + }) || isExpressionInCallExpression(node)) { + return typeIdx === 9 ? 11 : 10; + } + } + } + return typeIdx; + } + function isLocalDeclaration(decl, sourceFile) { + if (ts2.isBindingElement(decl)) { + decl = getDeclarationForBindingElement(decl); + } + if (ts2.isVariableDeclaration(decl)) { + return (!ts2.isSourceFile(decl.parent.parent.parent) || ts2.isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; + } else if (ts2.isFunctionDeclaration(decl)) { + return !ts2.isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; + } + return false; + } + function getDeclarationForBindingElement(element) { + while (true) { + if (ts2.isBindingElement(element.parent.parent)) { + element = element.parent.parent; + } else { + return element.parent.parent; + } + } + } + function inImportClause(node) { + var parent2 = node.parent; + return parent2 && (ts2.isImportClause(parent2) || ts2.isImportSpecifier(parent2) || ts2.isNamespaceImport(parent2)); + } + function isExpressionInCallExpression(node) { + while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + return ts2.isCallExpression(node.parent) && node.parent.expression === node; + } + function isRightSideOfQualifiedNameOrPropertyAccess(node) { + return ts2.isQualifiedName(node.parent) && node.parent.right === node || ts2.isPropertyAccessExpression(node.parent) && node.parent.name === node; + } + var tokenFromDeclarationMapping = new ts2.Map([ + [ + 257, + 7 + /* TokenType.variable */ + ], + [ + 166, + 6 + /* TokenType.parameter */ + ], + [ + 169, + 9 + /* TokenType.property */ + ], + [ + 264, + 3 + /* TokenType.namespace */ + ], + [ + 263, + 1 + /* TokenType.enum */ + ], + [ + 302, + 8 + /* TokenType.enumMember */ + ], + [ + 260, + 0 + /* TokenType.class */ + ], + [ + 171, + 11 + /* TokenType.member */ + ], + [ + 259, + 10 + /* TokenType.function */ + ], + [ + 215, + 10 + /* TokenType.function */ + ], + [ + 170, + 11 + /* TokenType.member */ + ], + [ + 174, + 9 + /* TokenType.property */ + ], + [ + 175, + 9 + /* TokenType.property */ + ], + [ + 168, + 9 + /* TokenType.property */ + ], + [ + 261, + 2 + /* TokenType.interface */ + ], + [ + 262, + 5 + /* TokenType.type */ + ], + [ + 165, + 4 + /* TokenType.typeParameter */ + ], + [ + 299, + 9 + /* TokenType.property */ + ], + [ + 300, + 9 + /* TokenType.property */ + ] + ]); + })(v2020 = classifier2.v2020 || (classifier2.v2020 = {})); + })(classifier = ts2.classifier || (ts2.classifier = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var Completions; + (function(Completions2) { + var StringCompletions; + (function(StringCompletions2) { + var _a2; + var kindPrecedence = (_a2 = {}, _a2[ + "directory" + /* ScriptElementKind.directory */ + ] = 0, _a2[ + "script" + /* ScriptElementKind.scriptElement */ + ] = 1, _a2[ + "external module name" + /* ScriptElementKind.externalModuleName */ + ] = 2, _a2); + function createNameAndKindSet() { + var map4 = new ts2.Map(); + function add2(value2) { + var existing = map4.get(value2.name); + if (!existing || kindPrecedence[existing.kind] < kindPrecedence[value2.kind]) { + map4.set(value2.name, value2); + } + } + return { + add: add2, + has: map4.has.bind(map4), + values: map4.values.bind(map4) + }; + } + function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log3, preferences) { + if (ts2.isInReferenceComment(sourceFile, position)) { + var entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host); + return entries && convertPathCompletions(entries); + } + if (ts2.isInString(sourceFile, position, contextToken)) { + if (!contextToken || !ts2.isStringLiteralLike(contextToken)) + return void 0; + var entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log3, options, preferences); + } + } + StringCompletions2.getStringLiteralCompletions = getStringLiteralCompletions; + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log3, options, preferences) { + if (completion === void 0) { + return void 0; + } + var optionalReplacementSpan = ts2.createTextSpanFromStringLiteralLikeContent(contextToken); + switch (completion.kind) { + case 0: + return convertPathCompletions(completion.paths); + case 1: { + var entries = ts2.createSortedArray(); + Completions2.getCompletionEntriesFromSymbols( + completion.symbols, + entries, + contextToken, + contextToken, + sourceFile, + sourceFile, + host, + program, + 99, + log3, + 4, + preferences, + options, + /*formatContext*/ + void 0 + ); + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; + } + case 2: { + var entries = completion.types.map(function(type3) { + return { + name: type3.value, + kindModifiers: "", + kind: "string", + sortText: Completions2.SortText.LocationPriority, + replacementSpan: ts2.getReplacementSpanForContextToken(contextToken) + }; + }); + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan, entries }; + } + default: + return ts2.Debug.assertNever(completion); + } + } + function getStringLiteralCompletionDetails(name2, sourceFile, position, contextToken, checker, options, host, cancellationToken, preferences) { + if (!contextToken || !ts2.isStringLiteralLike(contextToken)) + return void 0; + var completions = getStringLiteralCompletionEntries(sourceFile, contextToken, position, checker, options, host, preferences); + return completions && stringLiteralCompletionDetails(name2, contextToken, completions, sourceFile, checker, cancellationToken); + } + StringCompletions2.getStringLiteralCompletionDetails = getStringLiteralCompletionDetails; + function stringLiteralCompletionDetails(name2, location2, completion, sourceFile, checker, cancellationToken) { + switch (completion.kind) { + case 0: { + var match = ts2.find(completion.paths, function(p7) { + return p7.name === name2; + }); + return match && Completions2.createCompletionDetails(name2, kindModifiersFromExtension(match.extension), match.kind, [ts2.textPart(name2)]); + } + case 1: { + var match = ts2.find(completion.symbols, function(s7) { + return s7.name === name2; + }); + return match && Completions2.createCompletionDetailsForSymbol(match, checker, sourceFile, location2, cancellationToken); + } + case 2: + return ts2.find(completion.types, function(t8) { + return t8.value === name2; + }) ? Completions2.createCompletionDetails(name2, "", "type", [ts2.textPart(name2)]) : void 0; + default: + return ts2.Debug.assertNever(completion); + } + } + function convertPathCompletions(pathCompletions) { + var isGlobalCompletion = false; + var isNewIdentifierLocation = true; + var entries = pathCompletions.map(function(_a3) { + var name2 = _a3.name, kind = _a3.kind, span = _a3.span, extension = _a3.extension; + return { name: name2, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: Completions2.SortText.LocationPriority, replacementSpan: span }; + }); + return { isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation, entries }; + } + function kindModifiersFromExtension(extension) { + switch (extension) { + case ".d.ts": + return ".d.ts"; + case ".js": + return ".js"; + case ".json": + return ".json"; + case ".jsx": + return ".jsx"; + case ".ts": + return ".ts"; + case ".tsx": + return ".tsx"; + case ".d.mts": + return ".d.mts"; + case ".mjs": + return ".mjs"; + case ".mts": + return ".mts"; + case ".d.cts": + return ".d.cts"; + case ".cjs": + return ".cjs"; + case ".cts": + return ".cts"; + case ".tsbuildinfo": + return ts2.Debug.fail("Extension ".concat(".tsbuildinfo", " is unsupported.")); + case void 0: + return ""; + default: + return ts2.Debug.assertNever(extension); + } + } + var StringLiteralCompletionKind; + (function(StringLiteralCompletionKind2) { + StringLiteralCompletionKind2[StringLiteralCompletionKind2["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind2[StringLiteralCompletionKind2["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind2[StringLiteralCompletionKind2["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host, preferences) { + var parent2 = walkUpParentheses(node.parent); + switch (parent2.kind) { + case 198: { + var grandParent_1 = walkUpParentheses(parent2.parent); + switch (grandParent_1.kind) { + case 230: + case 180: { + var typeArgument = ts2.findAncestor(parent2, function(n7) { + return n7.parent === grandParent_1; + }); + if (typeArgument) { + return { kind: 2, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; + } + return void 0; + } + case 196: + var _a3 = grandParent_1, indexType = _a3.indexType, objectType2 = _a3.objectType; + if (!ts2.rangeContainsPosition(indexType, position)) { + return void 0; + } + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType2)); + case 202: + return { kind: 0, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + case 189: { + if (!ts2.isTypeReferenceNode(grandParent_1.parent)) { + return void 0; + } + var alreadyUsedTypes_1 = getAlreadyUsedTypesInStringLiteralUnion(grandParent_1, parent2); + var types3 = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent_1)).filter(function(t8) { + return !ts2.contains(alreadyUsedTypes_1, t8.value); + }); + return { kind: 2, types: types3, isNewIdentifier: false }; + } + default: + return void 0; + } + } + case 299: + if (ts2.isObjectLiteralExpression(parent2.parent) && parent2.name === node) { + return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent); + } + return fromContextualType(); + case 209: { + var _b = parent2, expression = _b.expression, argumentExpression = _b.argumentExpression; + if (node === ts2.skipParentheses(argumentExpression)) { + return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); + } + return void 0; + } + case 210: + case 211: + case 288: + if (!isRequireCallArgument(node) && !ts2.isImportCall(parent2)) { + var argumentInfo = ts2.SignatureHelp.getArgumentInfoForCompletions(parent2.kind === 288 ? parent2.parent : node, position, sourceFile); + return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(); + } + case 269: + case 275: + case 280: + return { kind: 0, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) }; + default: + return fromContextualType(); + } + function fromContextualType() { + return { kind: 2, types: getStringLiteralTypes(ts2.getContextualTypeFromParent(node, typeChecker)), isNewIdentifier: false }; + } + } + function walkUpParentheses(node) { + switch (node.kind) { + case 193: + return ts2.walkUpParenthesizedTypes(node); + case 214: + return ts2.walkUpParenthesizedExpressions(node); + default: + return node; + } + } + function getAlreadyUsedTypesInStringLiteralUnion(union2, current) { + return ts2.mapDefined(union2.types, function(type3) { + return type3 !== current && ts2.isLiteralTypeNode(type3) && ts2.isStringLiteral(type3.literal) ? type3.literal.text : void 0; + }); + } + function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) { + var isNewIdentifier = false; + var uniques = new ts2.Map(); + var candidates = []; + var editingArgument = ts2.isJsxOpeningLikeElement(call) ? ts2.Debug.checkDefined(ts2.findAncestor(arg.parent, ts2.isJsxAttribute)) : arg; + checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates); + var types3 = ts2.flatMap(candidates, function(candidate) { + if (!ts2.signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) + return; + var type3 = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex); + if (ts2.isJsxOpeningLikeElement(call)) { + var propType = checker.getTypeOfPropertyOfType(type3, editingArgument.name.text); + if (propType) { + type3 = propType; + } + } + isNewIdentifier = isNewIdentifier || !!(type3.flags & 4); + return getStringLiteralTypes(type3, uniques); + }); + return ts2.length(types3) ? { kind: 2, types: types3, isNewIdentifier } : void 0; + } + function stringLiteralCompletionsFromProperties(type3) { + return type3 && { + kind: 1, + symbols: ts2.filter(type3.getApparentProperties(), function(prop) { + return !(prop.valueDeclaration && ts2.isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)); + }), + hasIndexSignature: ts2.hasIndexSignature(type3) + }; + } + function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) { + var contextualType = checker.getContextualType(objectLiteralExpression); + if (!contextualType) + return void 0; + var completionsType = checker.getContextualType( + objectLiteralExpression, + 4 + /* ContextFlags.Completions */ + ); + var symbols = Completions2.getPropertiesForObjectExpression(contextualType, completionsType, objectLiteralExpression, checker); + return { + kind: 1, + symbols, + hasIndexSignature: ts2.hasIndexSignature(contextualType) + }; + } + function getStringLiteralTypes(type3, uniques) { + if (uniques === void 0) { + uniques = new ts2.Map(); + } + if (!type3) + return ts2.emptyArray; + type3 = ts2.skipConstraint(type3); + return type3.isUnion() ? ts2.flatMap(type3.types, function(t8) { + return getStringLiteralTypes(t8, uniques); + }) : type3.isStringLiteral() && !(type3.flags & 1024) && ts2.addToSeen(uniques, type3.value) ? [type3] : ts2.emptyArray; + } + function nameAndKind(name2, kind, extension) { + return { name: name2, kind, extension }; + } + function directoryResult(name2) { + return nameAndKind( + name2, + "directory", + /*extension*/ + void 0 + ); + } + function addReplacementSpans(text, textStart, names) { + var span = getDirectoryFragmentTextSpan(text, textStart); + var wholeSpan = text.length === 0 ? void 0 : ts2.createTextSpan(textStart, text.length); + return names.map(function(_a3) { + var name2 = _a3.name, kind = _a3.kind, extension = _a3.extension; + return Math.max(name2.indexOf(ts2.directorySeparator), name2.indexOf(ts2.altDirectorySeparator)) !== -1 ? { name: name2, kind, extension, span: wholeSpan } : { name: name2, kind, extension, span }; + }); + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) { + return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences)); + } + function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences) { + var literalValue = ts2.normalizeSlashes(node.text); + var mode = ts2.isStringLiteralLike(node) ? ts2.getModeForUsageLocation(sourceFile, node) : void 0; + var scriptPath = sourceFile.path; + var scriptDirectory = ts2.getDirectoryPath(scriptPath); + return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && (ts2.isRootedDiskPath(literalValue) || ts2.isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, getIncludeExtensionOption()) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, getIncludeExtensionOption(), typeChecker); + function getIncludeExtensionOption() { + var mode2 = ts2.isStringLiteralLike(node) ? ts2.getModeForUsageLocation(sourceFile, node) : void 0; + return preferences.importModuleSpecifierEnding === "js" || mode2 === ts2.ModuleKind.ESNext ? 2 : 0; + } + } + function getExtensionOptions(compilerOptions, includeExtensionsOption) { + if (includeExtensionsOption === void 0) { + includeExtensionsOption = 0; + } + return { extensions: ts2.flatten(getSupportedExtensionsForModuleResolution(compilerOptions)), includeExtensionsOption }; + } + function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, includeExtensions) { + var extensionOptions = getExtensionOptions(compilerOptions, includeExtensions); + if (compilerOptions.rootDirs) { + return getCompletionEntriesForDirectoryFragmentWithRootDirs(compilerOptions.rootDirs, literalValue, scriptDirectory, extensionOptions, compilerOptions, host, scriptPath); + } else { + return ts2.arrayFrom(getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, scriptPath).values()); + } + } + function isEmitResolutionKindUsingNodeModules(compilerOptions) { + return ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeJs || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeNext; + } + function isEmitModuleResolutionRespectingExportMaps(compilerOptions) { + return ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.Node16 || ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeNext; + } + function getSupportedExtensionsForModuleResolution(compilerOptions) { + var extensions6 = ts2.getSupportedExtensions(compilerOptions); + return isEmitResolutionKindUsingNodeModules(compilerOptions) ? ts2.getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions6) : extensions6; + } + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { + rootDirs = rootDirs.map(function(rootDirectory) { + return ts2.normalizePath(ts2.isRootedDiskPath(rootDirectory) ? rootDirectory : ts2.combinePaths(basePath, rootDirectory)); + }); + var relativeDirectory = ts2.firstDefined(rootDirs, function(rootDirectory) { + return ts2.containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : void 0; + }); + return ts2.deduplicate(__spreadArray9(__spreadArray9([], rootDirs.map(function(rootDirectory) { + return ts2.combinePaths(rootDirectory, relativeDirectory); + }), true), [scriptDirectory], false), ts2.equateStringsCaseSensitive, ts2.compareStringsCaseSensitive); + } + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { + var basePath = compilerOptions.project || host.getCurrentDirectory(); + var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + var baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return ts2.flatMap(baseDirectories, function(baseDirectory) { + return ts2.arrayFrom(getCompletionEntriesForDirectoryFragment(fragment, baseDirectory, extensionOptions, host, exclude).values()); + }); + } + var IncludeExtensionsOption; + (function(IncludeExtensionsOption2) { + IncludeExtensionsOption2[IncludeExtensionsOption2["Exclude"] = 0] = "Exclude"; + IncludeExtensionsOption2[IncludeExtensionsOption2["Include"] = 1] = "Include"; + IncludeExtensionsOption2[IncludeExtensionsOption2["ModuleSpecifierCompletion"] = 2] = "ModuleSpecifierCompletion"; + })(IncludeExtensionsOption || (IncludeExtensionsOption = {})); + function getCompletionEntriesForDirectoryFragment(fragment, scriptPath, extensionOptions, host, exclude, result2) { + var _a3; + if (result2 === void 0) { + result2 = createNameAndKindSet(); + } + if (fragment === void 0) { + fragment = ""; + } + fragment = ts2.normalizeSlashes(fragment); + if (!ts2.hasTrailingDirectorySeparator(fragment)) { + fragment = ts2.getDirectoryPath(fragment); + } + if (fragment === "") { + fragment = "." + ts2.directorySeparator; + } + fragment = ts2.ensureTrailingDirectorySeparator(fragment); + var absolutePath = ts2.resolvePath(scriptPath, fragment); + var baseDirectory = ts2.hasTrailingDirectorySeparator(absolutePath) ? absolutePath : ts2.getDirectoryPath(absolutePath); + var packageJsonPath = ts2.findPackageJson(baseDirectory, host); + if (packageJsonPath) { + var packageJson = ts2.readJson(packageJsonPath, host); + var typesVersions = packageJson.typesVersions; + if (typeof typesVersions === "object") { + var versionPaths = (_a3 = ts2.getPackageJsonTypesVersionsPaths(typesVersions)) === null || _a3 === void 0 ? void 0 : _a3.paths; + if (versionPaths) { + var packageDirectory = ts2.getDirectoryPath(packageJsonPath); + var pathInPackage = absolutePath.slice(ts2.ensureTrailingDirectorySeparator(packageDirectory).length); + if (addCompletionEntriesFromPaths(result2, pathInPackage, packageDirectory, extensionOptions, host, versionPaths)) { + return result2; + } + } + } + } + var ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + if (!ts2.tryDirectoryExists(host, baseDirectory)) + return result2; + var files = ts2.tryReadDirectory( + host, + baseDirectory, + extensionOptions.extensions, + /*exclude*/ + void 0, + /*include*/ + ["./*"] + ); + if (files) { + for (var _i = 0, files_1 = files; _i < files_1.length; _i++) { + var filePath = files_1[_i]; + filePath = ts2.normalizePath(filePath); + if (exclude && ts2.comparePaths(filePath, exclude, scriptPath, ignoreCase) === 0) { + continue; + } + var _b = getFilenameWithExtensionOption(ts2.getBaseFileName(filePath), host.getCompilationSettings(), extensionOptions.includeExtensionsOption), name2 = _b.name, extension = _b.extension; + result2.add(nameAndKind(name2, "script", extension)); + } + } + var directories = ts2.tryGetDirectories(host, baseDirectory); + if (directories) { + for (var _c = 0, directories_1 = directories; _c < directories_1.length; _c++) { + var directory = directories_1[_c]; + var directoryName = ts2.getBaseFileName(ts2.normalizePath(directory)); + if (directoryName !== "@types") { + result2.add(directoryResult(directoryName)); + } + } + } + return result2; + } + function getFilenameWithExtensionOption(name2, compilerOptions, includeExtensionsOption) { + var outputExtension = ts2.moduleSpecifiers.tryGetJSExtensionForFile(name2, compilerOptions); + if (includeExtensionsOption === 0 && !ts2.fileExtensionIsOneOf(name2, [ + ".json", + ".mts", + ".cts", + ".d.mts", + ".d.cts", + ".mjs", + ".cjs" + /* Extension.Cjs */ + ])) { + return { name: ts2.removeFileExtension(name2), extension: ts2.tryGetExtensionFromPath(name2) }; + } else if ((ts2.fileExtensionIsOneOf(name2, [ + ".mts", + ".cts", + ".d.mts", + ".d.cts", + ".mjs", + ".cjs" + /* Extension.Cjs */ + ]) || includeExtensionsOption === 2) && outputExtension) { + return { name: ts2.changeExtension(name2, outputExtension), extension: outputExtension }; + } else { + return { name: name2, extension: ts2.tryGetExtensionFromPath(name2) }; + } + } + function addCompletionEntriesFromPaths(result2, fragment, baseDirectory, extensionOptions, host, paths) { + var getPatternsForKey = function(key) { + return paths[key]; + }; + var comparePaths = function(a7, b8) { + var patternA = ts2.tryParsePattern(a7); + var patternB = ts2.tryParsePattern(b8); + var lengthA = typeof patternA === "object" ? patternA.prefix.length : a7.length; + var lengthB = typeof patternB === "object" ? patternB.prefix.length : b8.length; + return ts2.compareValues(lengthB, lengthA); + }; + return addCompletionEntriesFromPathsOrExports(result2, fragment, baseDirectory, extensionOptions, host, ts2.getOwnKeys(paths), getPatternsForKey, comparePaths); + } + function addCompletionEntriesFromPathsOrExports(result2, fragment, baseDirectory, extensionOptions, host, keys2, getPatternsForKey, comparePaths) { + var pathResults = []; + var matchedPath; + for (var _i = 0, keys_1 = keys2; _i < keys_1.length; _i++) { + var key = keys_1[_i]; + if (key === ".") + continue; + var keyWithoutLeadingDotSlash = key.replace(/^\.\//, ""); + var patterns = getPatternsForKey(key); + if (patterns) { + var pathPattern = ts2.tryParsePattern(keyWithoutLeadingDotSlash); + if (!pathPattern) + continue; + var isMatch2 = typeof pathPattern === "object" && ts2.isPatternMatch(pathPattern, fragment); + var isLongestMatch = isMatch2 && (matchedPath === void 0 || comparePaths(key, matchedPath) === -1); + if (isLongestMatch) { + matchedPath = key; + pathResults = pathResults.filter(function(r8) { + return !r8.matchedPattern; + }); + } + if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths(key, matchedPath) !== 1) { + pathResults.push({ + matchedPattern: isMatch2, + results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, host).map(function(_a3) { + var name2 = _a3.name, kind = _a3.kind, extension = _a3.extension; + return nameAndKind(name2, kind, extension); + }) + }); + } + } + } + pathResults.forEach(function(pathResult) { + return pathResult.results.forEach(function(r8) { + return result2.add(r8); + }); + }); + return matchedPath !== void 0; + } + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, compilerOptions, host, includeExtensionsOption, typeChecker) { + var baseUrl = compilerOptions.baseUrl, paths = compilerOptions.paths; + var result2 = createNameAndKindSet(); + var extensionOptions = getExtensionOptions(compilerOptions, includeExtensionsOption); + if (baseUrl) { + var projectDir = compilerOptions.project || host.getCurrentDirectory(); + var absolute = ts2.normalizePath(ts2.combinePaths(projectDir, baseUrl)); + getCompletionEntriesForDirectoryFragment( + fragment, + absolute, + extensionOptions, + host, + /*exclude*/ + void 0, + result2 + ); + if (paths) { + addCompletionEntriesFromPaths(result2, fragment, absolute, extensionOptions, host, paths); + } + } + var fragmentDirectory = getFragmentDirectory(fragment); + for (var _i = 0, _a3 = getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker); _i < _a3.length; _i++) { + var ambientName = _a3[_i]; + result2.add(nameAndKind( + ambientName, + "external module name", + /*extension*/ + void 0 + )); + } + getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result2); + if (isEmitResolutionKindUsingNodeModules(compilerOptions)) { + var foundGlobal = false; + if (fragmentDirectory === void 0) { + for (var _b = 0, _c = enumerateNodeModulesVisibleToScript(host, scriptPath); _b < _c.length; _b++) { + var moduleName3 = _c[_b]; + var moduleResult = nameAndKind( + moduleName3, + "external module name", + /*extension*/ + void 0 + ); + if (!result2.has(moduleResult.name)) { + foundGlobal = true; + result2.add(moduleResult); + } + } + } + if (!foundGlobal) { + var ancestorLookup = function(ancestor) { + var nodeModules = ts2.combinePaths(ancestor, "node_modules"); + if (ts2.tryDirectoryExists(host, nodeModules)) { + getCompletionEntriesForDirectoryFragment( + fragment, + nodeModules, + extensionOptions, + host, + /*exclude*/ + void 0, + result2 + ); + } + }; + if (fragmentDirectory && isEmitModuleResolutionRespectingExportMaps(compilerOptions)) { + var nodeModulesDirectoryLookup_1 = ancestorLookup; + ancestorLookup = function(ancestor) { + var components = ts2.getPathComponents(fragment); + components.shift(); + var packagePath = components.shift(); + if (!packagePath) { + return nodeModulesDirectoryLookup_1(ancestor); + } + if (ts2.startsWith(packagePath, "@")) { + var subName = components.shift(); + if (!subName) { + return nodeModulesDirectoryLookup_1(ancestor); + } + packagePath = ts2.combinePaths(packagePath, subName); + } + var packageDirectory = ts2.combinePaths(ancestor, "node_modules", packagePath); + var packageFile = ts2.combinePaths(packageDirectory, "package.json"); + if (ts2.tryFileExists(host, packageFile)) { + var packageJson = ts2.readJson(packageFile, host); + var exports_1 = packageJson.exports; + if (exports_1) { + if (typeof exports_1 !== "object" || exports_1 === null) { + return; + } + var keys2 = ts2.getOwnKeys(exports_1); + var fragmentSubpath = components.join("/") + (components.length && ts2.hasTrailingDirectorySeparator(fragment) ? "/" : ""); + var conditions_1 = mode === ts2.ModuleKind.ESNext ? ["node", "import", "types"] : ["node", "require", "types"]; + addCompletionEntriesFromPathsOrExports(result2, fragmentSubpath, packageDirectory, extensionOptions, host, keys2, function(key) { + return ts2.singleElementArray(getPatternFromFirstMatchingCondition(exports_1[key], conditions_1)); + }, ts2.comparePatternKeys); + return; + } + } + return nodeModulesDirectoryLookup_1(ancestor); + }; + } + ts2.forEachAncestorDirectory(scriptPath, ancestorLookup); + } + } + return ts2.arrayFrom(result2.values()); + } + function getPatternFromFirstMatchingCondition(target, conditions) { + if (typeof target === "string") { + return target; + } + if (target && typeof target === "object" && !ts2.isArray(target)) { + for (var condition in target) { + if (condition === "default" || conditions.indexOf(condition) > -1 || ts2.isApplicableVersionedTypesKey(conditions, condition)) { + var pattern5 = target[condition]; + return getPatternFromFirstMatchingCondition(pattern5, conditions); + } + } + } + } + function getFragmentDirectory(fragment) { + return containsSlash(fragment) ? ts2.hasTrailingDirectorySeparator(fragment) ? fragment : ts2.getDirectoryPath(fragment) : void 0; + } + function getCompletionsForPathMapping(path2, patterns, fragment, packageDirectory, extensionOptions, host) { + if (!ts2.endsWith(path2, "*")) { + return !ts2.stringContains(path2, "*") ? justPathMappingName( + path2, + "script" + /* ScriptElementKind.scriptElement */ + ) : ts2.emptyArray; + } + var pathPrefix = path2.slice(0, path2.length - 1); + var remainingFragment = ts2.tryRemovePrefix(fragment, pathPrefix); + if (remainingFragment === void 0) { + var starIsFullPathComponent = path2[path2.length - 2] === "/"; + return starIsFullPathComponent ? justPathMappingName( + pathPrefix, + "directory" + /* ScriptElementKind.directory */ + ) : ts2.flatMap(patterns, function(pattern5) { + var _a3; + return (_a3 = getModulesForPathsPattern("", packageDirectory, pattern5, extensionOptions, host)) === null || _a3 === void 0 ? void 0 : _a3.map(function(_a4) { + var name2 = _a4.name, rest2 = __rest13(_a4, ["name"]); + return __assign16({ name: pathPrefix + name2 }, rest2); + }); + }); + } + return ts2.flatMap(patterns, function(pattern5) { + return getModulesForPathsPattern(remainingFragment, packageDirectory, pattern5, extensionOptions, host); + }); + function justPathMappingName(name2, kind) { + return ts2.startsWith(name2, fragment) ? [{ name: ts2.removeTrailingDirectorySeparator(name2), kind, extension: void 0 }] : ts2.emptyArray; + } + } + function getModulesForPathsPattern(fragment, packageDirectory, pattern5, extensionOptions, host) { + if (!host.readDirectory) { + return void 0; + } + var parsed = ts2.tryParsePattern(pattern5); + if (parsed === void 0 || ts2.isString(parsed)) { + return void 0; + } + var normalizedPrefix = ts2.resolvePath(parsed.prefix); + var normalizedPrefixDirectory = ts2.hasTrailingDirectorySeparator(parsed.prefix) ? normalizedPrefix : ts2.getDirectoryPath(normalizedPrefix); + var normalizedPrefixBase = ts2.hasTrailingDirectorySeparator(parsed.prefix) ? "" : ts2.getBaseFileName(normalizedPrefix); + var fragmentHasPath = containsSlash(fragment); + var fragmentDirectory = fragmentHasPath ? ts2.hasTrailingDirectorySeparator(fragment) ? fragment : ts2.getDirectoryPath(fragment) : void 0; + var expandedPrefixDirectory = fragmentHasPath ? ts2.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory; + var normalizedSuffix = ts2.normalizePath(parsed.suffix); + var baseDirectory = ts2.normalizePath(ts2.combinePaths(packageDirectory, expandedPrefixDirectory)); + var completePrefix = fragmentHasPath ? baseDirectory : ts2.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + var includeGlob = normalizedSuffix ? "**/*" + normalizedSuffix : "./*"; + var matches2 = ts2.mapDefined(ts2.tryReadDirectory( + host, + baseDirectory, + extensionOptions.extensions, + /*exclude*/ + void 0, + [includeGlob] + ), function(match) { + var trimmedWithPattern = trimPrefixAndSuffix(match); + if (trimmedWithPattern) { + if (containsSlash(trimmedWithPattern)) { + return directoryResult(ts2.getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]); + } + var _a3 = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions.includeExtensionsOption), name2 = _a3.name, extension = _a3.extension; + return nameAndKind(name2, "script", extension); + } + }); + var directories = normalizedSuffix ? ts2.emptyArray : ts2.mapDefined(ts2.tryGetDirectories(host, baseDirectory), function(dir2) { + return dir2 === "node_modules" ? void 0 : directoryResult(dir2); + }); + return __spreadArray9(__spreadArray9([], matches2, true), directories, true); + function trimPrefixAndSuffix(path2) { + var inner = withoutStartAndEnd(ts2.normalizePath(path2), completePrefix, normalizedSuffix); + return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner); + } + } + function withoutStartAndEnd(s7, start, end) { + return ts2.startsWith(s7, start) && ts2.endsWith(s7, end) ? s7.slice(start.length, s7.length - end.length) : void 0; + } + function removeLeadingDirectorySeparator(path2) { + return path2[0] === ts2.directorySeparator ? path2.slice(1) : path2; + } + function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { + var ambientModules = checker.getAmbientModules().map(function(sym) { + return ts2.stripQuotes(sym.name); + }); + var nonRelativeModuleNames = ambientModules.filter(function(moduleName3) { + return ts2.startsWith(moduleName3, fragment); + }); + if (fragmentDirectory !== void 0) { + var moduleNameWithSeparator_1 = ts2.ensureTrailingDirectorySeparator(fragmentDirectory); + return nonRelativeModuleNames.map(function(nonRelativeModuleName) { + return ts2.removePrefix(nonRelativeModuleName, moduleNameWithSeparator_1); + }); + } + return nonRelativeModuleNames; + } + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { + var token = ts2.getTokenAtPosition(sourceFile, position); + var commentRanges = ts2.getLeadingCommentRanges(sourceFile.text, token.pos); + var range2 = commentRanges && ts2.find(commentRanges, function(commentRange) { + return position >= commentRange.pos && position <= commentRange.end; + }); + if (!range2) { + return void 0; + } + var text = sourceFile.text.slice(range2.pos, position); + var match = tripleSlashDirectiveFragmentRegex.exec(text); + if (!match) { + return void 0; + } + var prefix = match[1], kind = match[2], toComplete = match[3]; + var scriptPath = ts2.getDirectoryPath(sourceFile.path); + var names = kind === "path" ? getCompletionEntriesForDirectoryFragment(toComplete, scriptPath, getExtensionOptions( + compilerOptions, + 1 + /* IncludeExtensionsOption.Include */ + ), host, sourceFile.path) : kind === "types" ? getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions)) : ts2.Debug.fail(); + return addReplacementSpans(toComplete, range2.pos + prefix.length, ts2.arrayFrom(names.values())); + } + function getCompletionEntriesFromTypings(host, options, scriptPath, fragmentDirectory, extensionOptions, result2) { + if (result2 === void 0) { + result2 = createNameAndKindSet(); + } + var seen = new ts2.Map(); + var typeRoots = ts2.tryAndIgnoreErrors(function() { + return ts2.getEffectiveTypeRoots(options, host); + }) || ts2.emptyArray; + for (var _i = 0, typeRoots_1 = typeRoots; _i < typeRoots_1.length; _i++) { + var root2 = typeRoots_1[_i]; + getCompletionEntriesFromDirectories(root2); + } + for (var _a3 = 0, _b = ts2.findPackageJsons(scriptPath, host); _a3 < _b.length; _a3++) { + var packageJson = _b[_a3]; + var typesDir = ts2.combinePaths(ts2.getDirectoryPath(packageJson), "node_modules/@types"); + getCompletionEntriesFromDirectories(typesDir); + } + return result2; + function getCompletionEntriesFromDirectories(directory) { + if (!ts2.tryDirectoryExists(host, directory)) + return; + for (var _i2 = 0, _a4 = ts2.tryGetDirectories(host, directory); _i2 < _a4.length; _i2++) { + var typeDirectoryName = _a4[_i2]; + var packageName = ts2.unmangleScopedPackageName(typeDirectoryName); + if (options.types && !ts2.contains(options.types, packageName)) + continue; + if (fragmentDirectory === void 0) { + if (!seen.has(packageName)) { + result2.add(nameAndKind( + packageName, + "external module name", + /*extension*/ + void 0 + )); + seen.set(packageName, true); + } + } else { + var baseDirectory = ts2.combinePaths(directory, typeDirectoryName); + var remainingFragment = ts2.tryRemoveDirectoryPrefix(fragmentDirectory, packageName, ts2.hostGetCanonicalFileName(host)); + if (remainingFragment !== void 0) { + getCompletionEntriesForDirectoryFragment( + remainingFragment, + baseDirectory, + extensionOptions, + host, + /*exclude*/ + void 0, + result2 + ); + } + } + } + } + } + function enumerateNodeModulesVisibleToScript(host, scriptPath) { + if (!host.readFile || !host.fileExists) + return ts2.emptyArray; + var result2 = []; + for (var _i = 0, _a3 = ts2.findPackageJsons(scriptPath, host); _i < _a3.length; _i++) { + var packageJson = _a3[_i]; + var contents = ts2.readJson(packageJson, host); + for (var _b = 0, nodeModulesDependencyKeys_1 = nodeModulesDependencyKeys; _b < nodeModulesDependencyKeys_1.length; _b++) { + var key = nodeModulesDependencyKeys_1[_b]; + var dependencies = contents[key]; + if (!dependencies) + continue; + for (var dep in dependencies) { + if (ts2.hasProperty(dependencies, dep) && !ts2.startsWith(dep, "@types/")) { + result2.push(dep); + } + } + } + } + return result2; + } + function getDirectoryFragmentTextSpan(text, textStart) { + var index4 = Math.max(text.lastIndexOf(ts2.directorySeparator), text.lastIndexOf(ts2.altDirectorySeparator)); + var offset = index4 !== -1 ? index4 + 1 : 0; + var length = text.length - offset; + return length === 0 || ts2.isIdentifierText( + text.substr(offset, length), + 99 + /* ScriptTarget.ESNext */ + ) ? void 0 : ts2.createTextSpan(textStart + offset, length); + } + function isPathRelativeToScript(path2) { + if (path2 && path2.length >= 2 && path2.charCodeAt(0) === 46) { + var slashIndex = path2.length >= 3 && path2.charCodeAt(1) === 46 ? 2 : 1; + var slashCharCode = path2.charCodeAt(slashIndex); + return slashCharCode === 47 || slashCharCode === 92; + } + return false; + } + var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* 0; + }, + resolvedBeyondLimit: function() { + return resolvedCount > Completions2.moduleSpecifierResolutionLimit; + } + }); + var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : ""; + (_a2 = host.log) === null || _a2 === void 0 ? void 0 : _a2.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage)); + (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(skippedAny ? "incomplete" : "complete")); + (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts2.timestamp() - start)); + return result2; + function tryResolve(exportInfo, symbolName, isFromAmbientModule) { + if (isFromAmbientModule) { + var result_1 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite); + if (result_1) { + ambientCount++; + } + return result_1 || "failed"; + } + var shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < Completions2.moduleSpecifierResolutionLimit; + var shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < Completions2.moduleSpecifierResolutionCacheAttemptLimit; + var result3 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; + if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result3) { + skippedAny = true; + } + resolvedCount += (result3 === null || result3 === void 0 ? void 0 : result3.computedWithoutCacheCount) || 0; + resolvedFromCacheCount += exportInfo.length - ((result3 === null || result3 === void 0 ? void 0 : result3.computedWithoutCacheCount) || 0); + if (shouldGetModuleSpecifierFromCache) { + cacheAttemptCount++; + } + return result3 || (needsFullResolution ? "failed" : "skipped"); + } + } + function getCompletionsAtPosition(host, program, log3, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) { + var _a2; + var previousToken = getRelevantTokens(position, sourceFile).previousToken; + if (triggerCharacter && !ts2.isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { + return void 0; + } + if (triggerCharacter === " ") { + if (preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { + return { isGlobalCompletion: true, isMemberCompletion: false, isNewIdentifierLocation: true, isIncomplete: true, entries: [] }; + } + return void 0; + } + var compilerOptions = program.getCompilerOptions(); + var incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a2 = host.getIncompleteCompletionsCache) === null || _a2 === void 0 ? void 0 : _a2.call(host) : void 0; + if (incompleteCompletionsCache && completionKind === 3 && previousToken && ts2.isIdentifier(previousToken)) { + var incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken); + if (incompleteContinuation) { + return incompleteContinuation; + } + } else { + incompleteCompletionsCache === null || incompleteCompletionsCache === void 0 ? void 0 : incompleteCompletionsCache.clear(); + } + var stringCompletions = Completions2.StringCompletions.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log3, preferences); + if (stringCompletions) { + return stringCompletions; + } + if (previousToken && ts2.isBreakOrContinueStatement(previousToken.parent) && (previousToken.kind === 81 || previousToken.kind === 86 || previousToken.kind === 79)) { + return getLabelCompletionAtPosition(previousToken.parent); + } + var completionData = getCompletionData( + program, + log3, + sourceFile, + compilerOptions, + position, + preferences, + /*detailsEntryId*/ + void 0, + host, + formatContext, + cancellationToken + ); + if (!completionData) { + return void 0; + } + switch (completionData.kind) { + case 0: + var response = completionInfoFromData(sourceFile, host, program, compilerOptions, log3, completionData, preferences, formatContext, position); + if (response === null || response === void 0 ? void 0 : response.isIncomplete) { + incompleteCompletionsCache === null || incompleteCompletionsCache === void 0 ? void 0 : incompleteCompletionsCache.set(response); + } + return response; + case 1: + return jsdocCompletionInfo(ts2.JsDoc.getJSDocTagNameCompletions()); + case 2: + return jsdocCompletionInfo(ts2.JsDoc.getJSDocTagCompletions()); + case 3: + return jsdocCompletionInfo(ts2.JsDoc.getJSDocParameterNameCompletions(completionData.tag)); + case 4: + return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); + default: + return ts2.Debug.assertNever(completionData); + } + } + Completions2.getCompletionsAtPosition = getCompletionsAtPosition; + function compareCompletionEntries(entryInArray, entryToInsert) { + var _a2, _b; + var result2 = ts2.compareStringsCaseSensitiveUI(entryInArray.sortText, entryToInsert.sortText); + if (result2 === 0) { + result2 = ts2.compareStringsCaseSensitiveUI(entryInArray.name, entryToInsert.name); + } + if (result2 === 0 && ((_a2 = entryInArray.data) === null || _a2 === void 0 ? void 0 : _a2.moduleSpecifier) && ((_b = entryToInsert.data) === null || _b === void 0 ? void 0 : _b.moduleSpecifier)) { + result2 = ts2.compareNumberOfDirectorySeparators(entryInArray.data.moduleSpecifier, entryToInsert.data.moduleSpecifier); + } + if (result2 === 0) { + return -1; + } + return result2; + } + function completionEntryDataIsResolved(data) { + return !!(data === null || data === void 0 ? void 0 : data.moduleSpecifier); + } + function continuePreviousIncompleteResponse(cache, file, location2, program, host, preferences, cancellationToken) { + var previousResponse = cache.get(); + if (!previousResponse) + return void 0; + var lowerCaseTokenText = location2.text.toLowerCase(); + var exportMap = ts2.getExportInfoMap(file, host, program, preferences, cancellationToken); + var newEntries = resolvingModuleSpecifiers( + "continuePreviousIncompleteResponse", + host, + ts2.codefix.createImportSpecifierResolver(file, program, host, preferences), + program, + location2.getStart(), + preferences, + /*isForImportStatementCompletion*/ + false, + ts2.isValidTypeOnlyAliasUseSite(location2), + function(context2) { + var entries = ts2.mapDefined(previousResponse.entries, function(entry) { + var _a2; + if (!entry.hasAction || !entry.source || !entry.data || completionEntryDataIsResolved(entry.data)) { + return entry; + } + if (!charactersFuzzyMatchInString(entry.name, lowerCaseTokenText)) { + return void 0; + } + var origin = ts2.Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)).origin; + var info2 = exportMap.get(file.path, entry.data.exportMapKey); + var result2 = info2 && context2.tryResolve(info2, entry.name, !ts2.isExternalModuleNameRelative(ts2.stripQuotes(origin.moduleSymbol.name))); + if (result2 === "skipped") + return entry; + if (!result2 || result2 === "failed") { + (_a2 = host.log) === null || _a2 === void 0 ? void 0 : _a2.call(host, "Unexpected failure resolving auto import for '".concat(entry.name, "' from '").concat(entry.source, "'")); + return void 0; + } + var newOrigin = __assign16(__assign16({}, origin), { kind: 32, moduleSpecifier: result2.moduleSpecifier }); + entry.data = originToCompletionEntryData(newOrigin); + entry.source = getSourceFromOrigin(newOrigin); + entry.sourceDisplay = [ts2.textPart(newOrigin.moduleSpecifier)]; + return entry; + }); + if (!context2.skippedAny()) { + previousResponse.isIncomplete = void 0; + } + return entries; + } + ); + previousResponse.entries = newEntries; + previousResponse.flags = (previousResponse.flags || 0) | 4; + return previousResponse; + } + function jsdocCompletionInfo(entries) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries }; + } + function keywordToCompletionEntry(keyword) { + return { + name: ts2.tokenToString(keyword), + kind: "keyword", + kindModifiers: "", + sortText: Completions2.SortText.GlobalsOrKeywords + }; + } + function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) { + return { + isGlobalCompletion: false, + isMemberCompletion: false, + isNewIdentifierLocation, + entries: entries.slice() + }; + } + function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { + return { + kind: 4, + keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), + isNewIdentifierLocation + }; + } + function keywordFiltersFromSyntaxKind(keywordCompletion) { + switch (keywordCompletion) { + case 154: + return 8; + default: + ts2.Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters"); + } + } + function getOptionalReplacementSpan(location2) { + return (location2 === null || location2 === void 0 ? void 0 : location2.kind) === 79 ? ts2.createTextSpanFromNode(location2) : void 0; + } + function completionInfoFromData(sourceFile, host, program, compilerOptions, log3, completionData, preferences, formatContext, position) { + var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location2 = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, isRightOfOpenTag = completionData.isRightOfOpenTag, importStatementCompletion = completionData.importStatementCompletion, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap, hasUnresolvedAutoImports = completionData.hasUnresolvedAutoImports; + if (ts2.getLanguageVariant(sourceFile.scriptKind) === 1) { + var completionInfo = getJsxClosingTagCompletion(location2, sourceFile); + if (completionInfo) { + return completionInfo; + } + } + var entries = ts2.createSortedArray(); + var isChecked = isCheckedFile(sourceFile, compilerOptions); + if (isChecked && !isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0) { + return void 0; + } + var uniqueNames = getCompletionEntriesFromSymbols( + symbols, + entries, + /*replacementToken*/ + void 0, + contextToken, + location2, + sourceFile, + host, + program, + ts2.getEmitScriptTarget(compilerOptions), + log3, + completionKind, + preferences, + compilerOptions, + formatContext, + isTypeOnlyLocation, + propertyAccessToConvert, + isJsxIdentifierExpected, + isJsxInitializer, + importStatementCompletion, + recommendedCompletion, + symbolToOriginInfoMap, + symbolToSortTextMap, + isJsxIdentifierExpected, + isRightOfOpenTag + ); + if (keywordFilters !== 0) { + for (var _i = 0, _a2 = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts2.isSourceFileJS(sourceFile)); _i < _a2.length; _i++) { + var keywordEntry = _a2[_i]; + if (isTypeOnlyLocation && ts2.isTypeKeyword(ts2.stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) { + uniqueNames.add(keywordEntry.name); + ts2.insertSorted( + entries, + keywordEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + } + } + for (var _b = 0, _c = getContextualKeywords(contextToken, position); _b < _c.length; _b++) { + var keywordEntry = _c[_b]; + if (!uniqueNames.has(keywordEntry.name)) { + uniqueNames.add(keywordEntry.name); + ts2.insertSorted( + entries, + keywordEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + } + for (var _d = 0, literals_1 = literals; _d < literals_1.length; _d++) { + var literal = literals_1[_d]; + var literalEntry = createCompletionEntryForLiteral(sourceFile, preferences, literal); + uniqueNames.add(literalEntry.name); + ts2.insertSorted( + entries, + literalEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + if (!isChecked) { + getJSCompletionEntries(sourceFile, location2.pos, uniqueNames, ts2.getEmitScriptTarget(compilerOptions), entries); + } + return { + flags: completionData.flags, + isGlobalCompletion: isInSnippetScope, + isIncomplete: preferences.allowIncompleteCompletions && hasUnresolvedAutoImports ? true : void 0, + isMemberCompletion: isMemberCompletionKind(completionKind), + isNewIdentifierLocation, + optionalReplacementSpan: getOptionalReplacementSpan(location2), + entries + }; + } + function isCheckedFile(sourceFile, compilerOptions) { + return !ts2.isSourceFileJS(sourceFile) || !!ts2.isCheckJsEnabledForFile(sourceFile, compilerOptions); + } + function isMemberCompletionKind(kind) { + switch (kind) { + case 0: + case 3: + case 2: + return true; + default: + return false; + } + } + function getJsxClosingTagCompletion(location2, sourceFile) { + var jsxClosingElement = ts2.findAncestor(location2, function(node) { + switch (node.kind) { + case 284: + return true; + case 43: + case 31: + case 79: + case 208: + return false; + default: + return "quit"; + } + }); + if (jsxClosingElement) { + var hasClosingAngleBracket = !!ts2.findChildOfKind(jsxClosingElement, 31, sourceFile); + var tagName = jsxClosingElement.parent.openingElement.tagName; + var closingTag = tagName.getText(sourceFile); + var fullClosingTag = closingTag + (hasClosingAngleBracket ? "" : ">"); + var replacementSpan = ts2.createTextSpanFromNode(jsxClosingElement.tagName); + var entry = { + name: fullClosingTag, + kind: "class", + kindModifiers: void 0, + sortText: Completions2.SortText.LocationPriority + }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: replacementSpan, entries: [entry] }; + } + return; + } + function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entries) { + ts2.getNameTable(sourceFile).forEach(function(pos, name2) { + if (pos === position) { + return; + } + var realName = ts2.unescapeLeadingUnderscores(name2); + if (!uniqueNames.has(realName) && ts2.isIdentifierText(realName, target)) { + uniqueNames.add(realName); + ts2.insertSorted(entries, { + name: realName, + kind: "warning", + kindModifiers: "", + sortText: Completions2.SortText.JavascriptIdentifiers, + isFromUncheckedFile: true + }, compareCompletionEntries); + } + }); + } + function completionNameForLiteral(sourceFile, preferences, literal) { + return typeof literal === "object" ? ts2.pseudoBigIntToString(literal) + "n" : ts2.isString(literal) ? ts2.quote(sourceFile, preferences, literal) : JSON.stringify(literal); + } + function createCompletionEntryForLiteral(sourceFile, preferences, literal) { + return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string", kindModifiers: "", sortText: Completions2.SortText.LocationPriority }; + } + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location2, sourceFile, host, program, name2, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) { + var _a2, _b; + var insertText; + var replacementSpan = ts2.getReplacementSpanForContextToken(replacementToken); + var data; + var isSnippet; + var source = getSourceFromOrigin(origin); + var sourceDisplay; + var hasAction; + var labelDetails; + var typeChecker = program.getTypeChecker(); + var insertQuestionDot = origin && originIsNullableMember(origin); + var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; + if (origin && originIsThisType(origin)) { + insertText = needsConvertPropertyAccess ? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name2), "]") : "this".concat(insertQuestionDot ? "?." : ".").concat(name2); + } else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { + insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name2), "]") : "[".concat(name2, "]") : name2; + if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { + insertText = "?.".concat(insertText); + } + var dot = ts2.findChildOfKind(propertyAccessToConvert, 24, sourceFile) || ts2.findChildOfKind(propertyAccessToConvert, 28, sourceFile); + if (!dot) { + return void 0; + } + var end = ts2.startsWith(name2, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; + replacementSpan = ts2.createTextSpanFromBounds(dot.getStart(sourceFile), end); + } + if (isJsxInitializer) { + if (insertText === void 0) + insertText = name2; + insertText = "{".concat(insertText, "}"); + if (typeof isJsxInitializer !== "boolean") { + replacementSpan = ts2.createTextSpanFromNode(isJsxInitializer, sourceFile); + } + } + if (origin && originIsPromise(origin) && propertyAccessToConvert) { + if (insertText === void 0) + insertText = name2; + var precedingToken = ts2.findPrecedingToken(propertyAccessToConvert.pos, sourceFile); + var awaitText = ""; + if (precedingToken && ts2.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { + awaitText = ";"; + } + awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")"); + insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText); + replacementSpan = ts2.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end); + } + if (originIsResolvedExport(origin)) { + sourceDisplay = [ts2.textPart(origin.moduleSpecifier)]; + if (importStatementCompletion) { + _a2 = getInsertTextAndReplacementSpanForImportCompletion(name2, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences), insertText = _a2.insertText, replacementSpan = _a2.replacementSpan; + isSnippet = preferences.includeCompletionsWithSnippetText ? true : void 0; + } + } + if ((origin === null || origin === void 0 ? void 0 : origin.kind) === 64) { + hasAction = true; + } + if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 && isClassLikeMemberCompletion(symbol, location2, sourceFile)) { + var importAdder = void 0; + _b = getEntryForMemberCompletion(host, program, options, preferences, name2, symbol, location2, contextToken, formatContext), insertText = _b.insertText, isSnippet = _b.isSnippet, importAdder = _b.importAdder, replacementSpan = _b.replacementSpan; + sortText = Completions2.SortText.ClassMemberSnippets; + if (importAdder === null || importAdder === void 0 ? void 0 : importAdder.hasFixes()) { + hasAction = true; + source = CompletionSource.ClassMemberSnippet; + } + } + if (origin && originIsObjectLiteralMethod(origin)) { + insertText = origin.insertText, isSnippet = origin.isSnippet, labelDetails = origin.labelDetails; + if (!preferences.useLabelDetailsInCompletionEntries) { + name2 = name2 + labelDetails.detail; + labelDetails = void 0; + } + source = CompletionSource.ObjectLiteralMethodSnippet; + sortText = Completions2.SortText.SortBelow(sortText); + } + if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") { + var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces"; + var type3 = typeChecker.getTypeOfSymbolAtLocation(symbol, location2); + if (preferences.jsxAttributeCompletionStyle === "auto" && !(type3.flags & 528) && !(type3.flags & 1048576 && ts2.find(type3.types, function(type4) { + return !!(type4.flags & 528); + }))) { + if (type3.flags & 402653316 || type3.flags & 1048576 && ts2.every(type3.types, function(type4) { + return !!(type4.flags & (402653316 | 32768)); + })) { + insertText = "".concat(ts2.escapeSnippetText(name2), "=").concat(ts2.quote(sourceFile, preferences, "$1")); + isSnippet = true; + } else { + useBraces_1 = true; + } + } + if (useBraces_1) { + insertText = "".concat(ts2.escapeSnippetText(name2), "={$1}"); + isSnippet = true; + } + } + if (insertText !== void 0 && !preferences.includeCompletionsWithInsertText) { + return void 0; + } + if (originIsExport(origin) || originIsResolvedExport(origin)) { + data = originToCompletionEntryData(origin); + hasAction = !importStatementCompletion; + } + return { + name: name2, + kind: ts2.SymbolDisplay.getSymbolKind(typeChecker, symbol, location2), + kindModifiers: ts2.SymbolDisplay.getSymbolModifiers(typeChecker, symbol), + sortText, + source, + hasAction: hasAction ? true : void 0, + isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0, + insertText, + replacementSpan, + sourceDisplay, + labelDetails, + isSnippet, + isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, + isImportStatementCompletion: !!importStatementCompletion || void 0, + data + }; + } + function isClassLikeMemberCompletion(symbol, location2, sourceFile) { + if (ts2.isInJSFile(location2)) { + return false; + } + var memberFlags = 106500 & 900095; + return !!(symbol.flags & memberFlags) && (ts2.isClassLike(location2) || location2.parent && location2.parent.parent && ts2.isClassElement(location2.parent) && location2 === location2.parent.name && location2.parent.getLastToken(sourceFile) === location2.parent.name && ts2.isClassLike(location2.parent.parent) || location2.parent && ts2.isSyntaxList(location2) && ts2.isClassLike(location2.parent)); + } + function getEntryForMemberCompletion(host, program, options, preferences, name2, symbol, location2, contextToken, formatContext) { + var classLikeDeclaration = ts2.findAncestor(location2, ts2.isClassLike); + if (!classLikeDeclaration) { + return { insertText: name2 }; + } + var isSnippet; + var replacementSpan; + var insertText = name2; + var checker = program.getTypeChecker(); + var sourceFile = location2.getSourceFile(); + var printer = createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: false, + newLine: ts2.getNewLineKind(ts2.getNewLineCharacter(options, ts2.maybeBind(host, host.getNewLine))) + }); + var importAdder = ts2.codefix.createImportAdder(sourceFile, program, preferences, host); + var body; + if (preferences.includeCompletionsWithSnippetText) { + isSnippet = true; + var emptyStmt = ts2.factory.createEmptyStatement(); + body = ts2.factory.createBlock( + [emptyStmt], + /* multiline */ + true + ); + ts2.setSnippetElement(emptyStmt, { kind: 0, order: 0 }); + } else { + body = ts2.factory.createBlock( + [], + /* multiline */ + true + ); + } + var modifiers = 0; + var _a2 = getPresentModifiers(contextToken), presentModifiers = _a2.modifiers, modifiersSpan = _a2.span; + var isAbstract = !!(presentModifiers & 256); + var completionNodes = []; + ts2.codefix.addNewNodeForMemberSymbol( + symbol, + classLikeDeclaration, + sourceFile, + { program, host }, + preferences, + importAdder, + // `addNewNodeForMemberSymbol` calls this callback function for each new member node + // it adds for the given member symbol. + // We store these member nodes in the `completionNodes` array. + // Note: there might be: + // - No nodes if `addNewNodeForMemberSymbol` cannot figure out a node for the member; + // - One node; + // - More than one node if the member is overloaded (e.g. a method with overload signatures). + function(node) { + var requiredModifiers = 0; + if (isAbstract) { + requiredModifiers |= 256; + } + if (ts2.isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1) { + requiredModifiers |= 16384; + } + if (!completionNodes.length) { + modifiers = node.modifierFlagsCache | requiredModifiers | presentModifiers; + } + node = ts2.factory.updateModifiers(node, modifiers); + completionNodes.push(node); + }, + body, + 2, + isAbstract + ); + if (completionNodes.length) { + var format5 = 1 | 131072; + replacementSpan = modifiersSpan; + if (formatContext) { + insertText = printer.printAndFormatSnippetList(format5, ts2.factory.createNodeArray(completionNodes), sourceFile, formatContext); + } else { + insertText = printer.printSnippetList(format5, ts2.factory.createNodeArray(completionNodes), sourceFile); + } + } + return { insertText, isSnippet, importAdder, replacementSpan }; + } + function getPresentModifiers(contextToken) { + if (!contextToken) { + return { + modifiers: 0 + /* ModifierFlags.None */ + }; + } + var modifiers = 0; + var span; + var contextMod; + if (contextMod = isModifierLike(contextToken)) { + modifiers |= ts2.modifierToFlag(contextMod); + span = ts2.createTextSpanFromNode(contextToken); + } + if (ts2.isPropertyDeclaration(contextToken.parent)) { + modifiers |= ts2.modifiersToFlags(contextToken.parent.modifiers) & 126975; + span = ts2.createTextSpanFromNode(contextToken.parent); + } + return { modifiers, span }; + } + function isModifierLike(node) { + if (ts2.isModifier(node)) { + return node.kind; + } + if (ts2.isIdentifier(node) && node.originalKeywordKind && ts2.isModifierKind(node.originalKeywordKind)) { + return node.originalKeywordKind; + } + return void 0; + } + function getEntryForObjectLiteralMethodCompletion(symbol, name2, enclosingDeclaration, program, host, options, preferences, formatContext) { + var isSnippet = preferences.includeCompletionsWithSnippetText || void 0; + var insertText = name2; + var sourceFile = enclosingDeclaration.getSourceFile(); + var method2 = createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences); + if (!method2) { + return void 0; + } + var printer = createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: false, + newLine: ts2.getNewLineKind(ts2.getNewLineCharacter(options, ts2.maybeBind(host, host.getNewLine))) + }); + if (formatContext) { + insertText = printer.printAndFormatSnippetList(16 | 64, ts2.factory.createNodeArray( + [method2], + /*hasTrailingComma*/ + true + ), sourceFile, formatContext); + } else { + insertText = printer.printSnippetList(16 | 64, ts2.factory.createNodeArray( + [method2], + /*hasTrailingComma*/ + true + ), sourceFile); + } + var signaturePrinter = ts2.createPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: true + }); + var methodSignature = ts2.factory.createMethodSignature( + /*modifiers*/ + void 0, + /*name*/ + "", + method2.questionToken, + method2.typeParameters, + method2.parameters, + method2.type + ); + var labelDetails = { detail: signaturePrinter.printNode(4, methodSignature, sourceFile) }; + return { isSnippet, insertText, labelDetails }; + } + function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences) { + var declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return void 0; + } + var checker = program.getTypeChecker(); + var declaration = declarations[0]; + var name2 = ts2.getSynthesizedDeepClone( + ts2.getNameOfDeclaration(declaration), + /*includeTrivia*/ + false + ); + var type3 = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + var builderFlags = 33554432 | (quotePreference === 0 ? 268435456 : 0); + switch (declaration.kind) { + case 168: + case 169: + case 170: + case 171: { + var effectiveType = type3.flags & 1048576 && type3.types.length < 10 ? checker.getUnionType( + type3.types, + 2 + /* UnionReduction.Subtype */ + ) : type3; + if (effectiveType.flags & 1048576) { + var functionTypes = ts2.filter(effectiveType.types, function(type4) { + return checker.getSignaturesOfType( + type4, + 0 + /* SignatureKind.Call */ + ).length > 0; + }); + if (functionTypes.length === 1) { + effectiveType = functionTypes[0]; + } else { + return void 0; + } + } + var signatures = checker.getSignaturesOfType( + effectiveType, + 0 + /* SignatureKind.Call */ + ); + if (signatures.length !== 1) { + return void 0; + } + var typeNode = checker.typeToTypeNode(effectiveType, enclosingDeclaration, builderFlags, ts2.codefix.getNoopSymbolTrackerWithResolver({ program, host })); + if (!typeNode || !ts2.isFunctionTypeNode(typeNode)) { + return void 0; + } + var body = void 0; + if (preferences.includeCompletionsWithSnippetText) { + var emptyStmt = ts2.factory.createEmptyStatement(); + body = ts2.factory.createBlock( + [emptyStmt], + /* multiline */ + true + ); + ts2.setSnippetElement(emptyStmt, { kind: 0, order: 0 }); + } else { + body = ts2.factory.createBlock( + [], + /* multiline */ + true + ); + } + var parameters = typeNode.parameters.map(function(typedParam) { + return ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + typedParam.dotDotDotToken, + typedParam.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + typedParam.initializer + ); + }); + return ts2.factory.createMethodDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + default: + return void 0; + } + } + function createSnippetPrinter(printerOptions) { + var escapes; + var baseWriter = ts2.textChanges.createWriter(ts2.getNewLineCharacter(printerOptions)); + var printer = ts2.createPrinter(printerOptions, baseWriter); + var writer = __assign16(__assign16({}, baseWriter), { write: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.write(s7); + }); + }, nonEscapingWrite: baseWriter.write, writeLiteral: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.writeLiteral(s7); + }); + }, writeStringLiteral: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.writeStringLiteral(s7); + }); + }, writeSymbol: function(s7, symbol) { + return escapingWrite(s7, function() { + return baseWriter.writeSymbol(s7, symbol); + }); + }, writeParameter: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.writeParameter(s7); + }); + }, writeComment: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.writeComment(s7); + }); + }, writeProperty: function(s7) { + return escapingWrite(s7, function() { + return baseWriter.writeProperty(s7); + }); + } }); + return { + printSnippetList, + printAndFormatSnippetList + }; + function escapingWrite(s7, write) { + var escaped = ts2.escapeSnippetText(s7); + if (escaped !== s7) { + var start = baseWriter.getTextPos(); + write(); + var end = baseWriter.getTextPos(); + escapes = ts2.append(escapes || (escapes = []), { newText: escaped, span: { start, length: end - start } }); + } else { + write(); + } + } + function printSnippetList(format5, list, sourceFile) { + var unescaped = printUnescapedSnippetList(format5, list, sourceFile); + return escapes ? ts2.textChanges.applyChanges(unescaped, escapes) : unescaped; + } + function printUnescapedSnippetList(format5, list, sourceFile) { + escapes = void 0; + writer.clear(); + printer.writeList(format5, list, sourceFile, writer); + return writer.getText(); + } + function printAndFormatSnippetList(format5, list, sourceFile, formatContext) { + var syntheticFile = { + text: printUnescapedSnippetList(format5, list, sourceFile), + getLineAndCharacterOfPosition: function(pos) { + return ts2.getLineAndCharacterOfPosition(this, pos); + } + }; + var formatOptions = ts2.getFormatCodeSettingsForWriting(formatContext, sourceFile); + var changes = ts2.flatMap(list, function(node) { + var nodeWithPos = ts2.textChanges.assignPositionsToNode(node); + return ts2.formatting.formatNodeGivenIndentation( + nodeWithPos, + syntheticFile, + sourceFile.languageVariant, + /* indentation */ + 0, + /* delta */ + 0, + __assign16(__assign16({}, formatContext), { options: formatOptions }) + ); + }); + var allChanges = escapes ? ts2.stableSort(ts2.concatenate(changes, escapes), function(a7, b8) { + return ts2.compareTextSpans(a7.span, b8.span); + }) : changes; + return ts2.textChanges.applyChanges(syntheticFile.text, allChanges); + } + } + function originToCompletionEntryData(origin) { + var ambientModuleName = origin.fileName ? void 0 : ts2.stripQuotes(origin.moduleSymbol.name); + var isPackageJsonImport = origin.isFromPackageJson ? true : void 0; + if (originIsResolvedExport(origin)) { + var resolvedData = { + exportName: origin.exportName, + moduleSpecifier: origin.moduleSpecifier, + ambientModuleName, + fileName: origin.fileName, + isPackageJsonImport + }; + return resolvedData; + } + var unresolvedData = { + exportName: origin.exportName, + exportMapKey: origin.exportMapKey, + fileName: origin.fileName, + ambientModuleName: origin.fileName ? void 0 : ts2.stripQuotes(origin.moduleSymbol.name), + isPackageJsonImport: origin.isFromPackageJson ? true : void 0 + }; + return unresolvedData; + } + function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbol) { + var isDefaultExport = data.exportName === "default"; + var isFromPackageJson = !!data.isPackageJsonImport; + if (completionEntryDataIsResolved(data)) { + var resolvedOrigin = { + kind: 32, + exportName: data.exportName, + moduleSpecifier: data.moduleSpecifier, + symbolName: completionName, + fileName: data.fileName, + moduleSymbol, + isDefaultExport, + isFromPackageJson + }; + return resolvedOrigin; + } + var unresolvedOrigin = { + kind: 4, + exportName: data.exportName, + exportMapKey: data.exportMapKey, + symbolName: completionName, + fileName: data.fileName, + moduleSymbol, + isDefaultExport, + isFromPackageJson + }; + return unresolvedOrigin; + } + function getInsertTextAndReplacementSpanForImportCompletion(name2, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) { + var replacementSpan = importStatementCompletion.replacementSpan; + var quotedModuleSpecifier = ts2.quote(sourceFile, preferences, origin.moduleSpecifier); + var exportKind = origin.isDefaultExport ? 1 : origin.exportName === "export=" ? 2 : 0; + var tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; + var importKind = ts2.codefix.getImportKind( + sourceFile, + exportKind, + options, + /*forceImportKeyword*/ + true + ); + var isImportSpecifierTypeOnly = importStatementCompletion.couldBeTypeOnlyImportSpecifier; + var topLevelTypeOnlyText = importStatementCompletion.isTopLevelTypeOnly ? " ".concat(ts2.tokenToString( + 154 + /* SyntaxKind.TypeKeyword */ + ), " ") : " "; + var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts2.tokenToString( + 154 + /* SyntaxKind.TypeKeyword */ + ), " ") : ""; + var suffix = useSemicolons ? ";" : ""; + switch (importKind) { + case 3: + return { replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts2.escapeSnippetText(name2)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) }; + case 1: + return { replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts2.escapeSnippetText(name2)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) }; + case 2: + return { replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts2.escapeSnippetText(name2), " from ").concat(quotedModuleSpecifier).concat(suffix) }; + case 0: + return { replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts2.escapeSnippetText(name2)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) }; + } + } + function quotePropertyName(sourceFile, preferences, name2) { + if (/^\d+$/.test(name2)) { + return name2; + } + return ts2.quote(sourceFile, preferences, name2); + } + function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { + return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; + } + function getSourceFromOrigin(origin) { + if (originIsExport(origin)) { + return ts2.stripQuotes(origin.moduleSymbol.name); + } + if (originIsResolvedExport(origin)) { + return origin.moduleSpecifier; + } + if ((origin === null || origin === void 0 ? void 0 : origin.kind) === 1) { + return CompletionSource.ThisProperty; + } + if ((origin === null || origin === void 0 ? void 0 : origin.kind) === 64) { + return CompletionSource.TypeOnlyAlias; + } + } + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location2, sourceFile, host, program, target, log3, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) { + var _a2; + var start = ts2.timestamp(); + var variableDeclaration = getVariableDeclaration(location2); + var useSemicolons = ts2.probablyUsesSemicolons(sourceFile); + var typeChecker = program.getTypeChecker(); + var uniques = new ts2.Map(); + for (var i7 = 0; i7 < symbols.length; i7++) { + var symbol = symbols[i7]; + var origin = symbolToOriginInfoMap === null || symbolToOriginInfoMap === void 0 ? void 0 : symbolToOriginInfoMap[i7]; + var info2 = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); + if (!info2 || uniques.get(info2.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { + continue; + } + var name2 = info2.name, needsConvertPropertyAccess = info2.needsConvertPropertyAccess; + var originalSortText = (_a2 = symbolToSortTextMap === null || symbolToSortTextMap === void 0 ? void 0 : symbolToSortTextMap[ts2.getSymbolId(symbol)]) !== null && _a2 !== void 0 ? _a2 : Completions2.SortText.LocationPriority; + var sortText = isDeprecated(symbol, typeChecker) ? Completions2.SortText.Deprecated(originalSortText) : originalSortText; + var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location2, sourceFile, host, program, name2, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag); + if (!entry) { + continue; + } + var shouldShadowLaterSymbols = (!origin || originIsTypeOnlyAlias(origin)) && !(symbol.parent === void 0 && !ts2.some(symbol.declarations, function(d7) { + return d7.getSourceFile() === location2.getSourceFile(); + })); + uniques.set(name2, shouldShadowLaterSymbols); + ts2.insertSorted( + entries, + entry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + log3("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts2.timestamp() - start)); + return { + has: function(name3) { + return uniques.has(name3); + }, + add: function(name3) { + return uniques.set(name3, true); + } + }; + function shouldIncludeSymbol(symbol2, symbolToSortTextMap2) { + var allFlags = symbol2.flags; + if (!ts2.isSourceFile(location2)) { + if (ts2.isExportAssignment(location2.parent)) { + return true; + } + if (variableDeclaration && symbol2.valueDeclaration === variableDeclaration) { + return false; + } + var symbolOrigin = ts2.skipAlias(symbol2, typeChecker); + if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[ts2.getSymbolId(symbol2)] === Completions2.SortText.GlobalsOrKeywords && (symbolToSortTextMap2[ts2.getSymbolId(symbolOrigin)] === Completions2.SortText.AutoImportSuggestions || symbolToSortTextMap2[ts2.getSymbolId(symbolOrigin)] === Completions2.SortText.LocationPriority)) { + return false; + } + allFlags |= ts2.getCombinedLocalAndExportSymbolFlags(symbolOrigin); + if (ts2.isInRightSideOfInternalImportEqualsDeclaration(location2)) { + return !!(allFlags & 1920); + } + if (isTypeOnlyLocation) { + return symbolCanBeReferencedAtTypeLocation(symbol2, typeChecker); + } + } + return !!(allFlags & 111551); + } + } + Completions2.getCompletionEntriesFromSymbols = getCompletionEntriesFromSymbols; + function getLabelCompletionAtPosition(node) { + var entries = getLabelStatementCompletions(node); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries }; + } + } + function getLabelStatementCompletions(node) { + var entries = []; + var uniques = new ts2.Map(); + var current = node; + while (current) { + if (ts2.isFunctionLike(current)) { + break; + } + if (ts2.isLabeledStatement(current)) { + var name2 = current.label.text; + if (!uniques.has(name2)) { + uniques.set(name2, true); + entries.push({ + name: name2, + kindModifiers: "", + kind: "label", + sortText: Completions2.SortText.LocationPriority + }); + } + } + current = current.parent; + } + return entries; + } + function getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences) { + if (entryId.data) { + var autoImport = getAutoImportSymbolFromCompletionEntryData(entryId.name, entryId.data, program, host); + if (autoImport) { + var _a2 = getRelevantTokens(position, sourceFile), contextToken_1 = _a2.contextToken, previousToken_1 = _a2.previousToken; + return { + type: "symbol", + symbol: autoImport.symbol, + location: ts2.getTouchingPropertyName(sourceFile, position), + previousToken: previousToken_1, + contextToken: contextToken_1, + isJsxInitializer: false, + isTypeOnlyLocation: false, + origin: autoImport.origin + }; + } + } + var compilerOptions = program.getCompilerOptions(); + var completionData = getCompletionData( + program, + log3, + sourceFile, + compilerOptions, + position, + { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, + entryId, + host, + /*formatContext*/ + void 0 + ); + if (!completionData) { + return { type: "none" }; + } + if (completionData.kind !== 0) { + return { type: "request", request: completionData }; + } + var symbols = completionData.symbols, literals = completionData.literals, location2 = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, contextToken = completionData.contextToken, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation; + var literal = ts2.find(literals, function(l7) { + return completionNameForLiteral(sourceFile, preferences, l7) === entryId.name; + }); + if (literal !== void 0) + return { type: "literal", literal }; + return ts2.firstDefined(symbols, function(symbol, index4) { + var origin = symbolToOriginInfoMap[index4]; + var info2 = getCompletionEntryDisplayNameForSymbol(symbol, ts2.getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected); + return info2 && info2.name === entryId.name && (entryId.source === CompletionSource.ClassMemberSnippet && symbol.flags & 106500 || entryId.source === CompletionSource.ObjectLiteralMethodSnippet && symbol.flags & (4 | 8192) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location: location2, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0; + }) || { type: "none" }; + } + function getCompletionEntryDetails(program, log3, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) { + var typeChecker = program.getTypeChecker(); + var compilerOptions = program.getCompilerOptions(); + var name2 = entryId.name, source = entryId.source, data = entryId.data; + var contextToken = ts2.findPrecedingToken(position, sourceFile); + if (ts2.isInString(sourceFile, position, contextToken)) { + return Completions2.StringCompletions.getStringLiteralCompletionDetails(name2, sourceFile, position, contextToken, typeChecker, compilerOptions, host, cancellationToken, preferences); + } + var symbolCompletion = getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences); + switch (symbolCompletion.type) { + case "request": { + var request3 = symbolCompletion.request; + switch (request3.kind) { + case 1: + return ts2.JsDoc.getJSDocTagNameCompletionDetails(name2); + case 2: + return ts2.JsDoc.getJSDocTagCompletionDetails(name2); + case 3: + return ts2.JsDoc.getJSDocParameterNameCompletionDetails(name2); + case 4: + return ts2.some(request3.keywordCompletions, function(c7) { + return c7.name === name2; + }) ? createSimpleDetails(name2, "keyword", ts2.SymbolDisplayPartKind.keyword) : void 0; + default: + return ts2.Debug.assertNever(request3); + } + } + case "symbol": { + var symbol = symbolCompletion.symbol, location2 = symbolCompletion.location, contextToken_2 = symbolCompletion.contextToken, origin = symbolCompletion.origin, previousToken = symbolCompletion.previousToken; + var _a2 = getCompletionEntryCodeActionsAndSourceDisplay(name2, location2, contextToken_2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken), codeActions = _a2.codeActions, sourceDisplay = _a2.sourceDisplay; + return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location2, cancellationToken, codeActions, sourceDisplay); + } + case "literal": { + var literal = symbolCompletion.literal; + return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string", typeof literal === "string" ? ts2.SymbolDisplayPartKind.stringLiteral : ts2.SymbolDisplayPartKind.numericLiteral); + } + case "none": + return allKeywordsCompletions().some(function(c7) { + return c7.name === name2; + }) ? createSimpleDetails(name2, "keyword", ts2.SymbolDisplayPartKind.keyword) : void 0; + default: + ts2.Debug.assertNever(symbolCompletion); + } + } + Completions2.getCompletionEntryDetails = getCompletionEntryDetails; + function createSimpleDetails(name2, kind, kind2) { + return createCompletionDetails(name2, "", kind, [ts2.displayPart(name2, kind2)]); + } + function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location2, cancellationToken, codeActions, sourceDisplay) { + var _a2 = checker.runWithCancellationToken(cancellationToken, function(checker2) { + return ts2.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind( + checker2, + symbol, + sourceFile, + location2, + location2, + 7 + /* SemanticMeaning.All */ + ); + }), displayParts = _a2.displayParts, documentation = _a2.documentation, symbolKind = _a2.symbolKind, tags6 = _a2.tags; + return createCompletionDetails(symbol.name, ts2.SymbolDisplay.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags6, codeActions, sourceDisplay); + } + Completions2.createCompletionDetailsForSymbol = createCompletionDetailsForSymbol; + function createCompletionDetails(name2, kindModifiers, kind, displayParts, documentation, tags6, codeActions, source) { + return { name: name2, kindModifiers, kind, displayParts, documentation, tags: tags6, codeActions, source, sourceDisplay: source }; + } + Completions2.createCompletionDetails = createCompletionDetails; + function getCompletionEntryCodeActionsAndSourceDisplay(name2, location2, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) { + if (data === null || data === void 0 ? void 0 : data.moduleSpecifier) { + if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) { + return { codeActions: void 0, sourceDisplay: [ts2.textPart(data.moduleSpecifier)] }; + } + } + if (source === CompletionSource.ClassMemberSnippet) { + var importAdder = getEntryForMemberCompletion(host, program, compilerOptions, preferences, name2, symbol, location2, contextToken, formatContext).importAdder; + if (importAdder) { + var changes = ts2.textChanges.ChangeTracker.with({ host, formatContext, preferences }, importAdder.writeFixes); + return { + sourceDisplay: void 0, + codeActions: [{ + changes, + description: ts2.diagnosticToString([ts2.Diagnostics.Includes_imports_of_types_referenced_by_0, name2]) + }] + }; + } + } + if (originIsTypeOnlyAlias(origin)) { + var codeAction_1 = ts2.codefix.getPromoteTypeOnlyCompletionAction(sourceFile, origin.declaration.name, program, host, formatContext, preferences); + ts2.Debug.assertIsDefined(codeAction_1, "Expected to have a code action for promoting type-only alias"); + return { codeActions: [codeAction_1], sourceDisplay: void 0 }; + } + if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) { + return { codeActions: void 0, sourceDisplay: void 0 }; + } + var checker = origin.isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker(); + var moduleSymbol = origin.moduleSymbol; + var targetSymbol = checker.getMergedSymbol(ts2.skipAlias(symbol.exportSymbol || symbol, checker)); + var isJsxOpeningTagName = (contextToken === null || contextToken === void 0 ? void 0 : contextToken.kind) === 29 && ts2.isJsxOpeningLikeElement(contextToken.parent); + var _a2 = ts2.codefix.getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, ts2.getNameForExportedSymbol(symbol, ts2.getEmitScriptTarget(compilerOptions), isJsxOpeningTagName), isJsxOpeningTagName, host, program, formatContext, previousToken && ts2.isIdentifier(previousToken) ? previousToken.getStart(sourceFile) : position, preferences, cancellationToken), moduleSpecifier = _a2.moduleSpecifier, codeAction = _a2.codeAction; + ts2.Debug.assert(!(data === null || data === void 0 ? void 0 : data.moduleSpecifier) || moduleSpecifier === data.moduleSpecifier); + return { sourceDisplay: [ts2.textPart(moduleSpecifier)], codeActions: [codeAction] }; + } + function getCompletionEntrySymbol(program, log3, sourceFile, position, entryId, host, preferences) { + var completion = getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences); + return completion.type === "symbol" ? completion.symbol : void 0; + } + Completions2.getCompletionEntrySymbol = getCompletionEntrySymbol; + var CompletionDataKind; + (function(CompletionDataKind2) { + CompletionDataKind2[CompletionDataKind2["Data"] = 0] = "Data"; + CompletionDataKind2[CompletionDataKind2["JsDocTagName"] = 1] = "JsDocTagName"; + CompletionDataKind2[CompletionDataKind2["JsDocTag"] = 2] = "JsDocTag"; + CompletionDataKind2[CompletionDataKind2["JsDocParameterName"] = 3] = "JsDocParameterName"; + CompletionDataKind2[CompletionDataKind2["Keywords"] = 4] = "Keywords"; + })(CompletionDataKind || (CompletionDataKind = {})); + var CompletionKind; + (function(CompletionKind2) { + CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; + CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; + CompletionKind2[CompletionKind2["PropertyAccess"] = 2] = "PropertyAccess"; + CompletionKind2[CompletionKind2["MemberLike"] = 3] = "MemberLike"; + CompletionKind2[CompletionKind2["String"] = 4] = "String"; + CompletionKind2[CompletionKind2["None"] = 5] = "None"; + })(CompletionKind = Completions2.CompletionKind || (Completions2.CompletionKind = {})); + function getRecommendedCompletion(previousToken, contextualType, checker) { + return ts2.firstDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), function(type3) { + var symbol = type3 && type3.symbol; + return symbol && (symbol.flags & (8 | 384 | 32) && !ts2.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, previousToken, checker) : void 0; + }); + } + function getContextualType(previousToken, position, sourceFile, checker) { + var parent2 = previousToken.parent; + switch (previousToken.kind) { + case 79: + return ts2.getContextualTypeFromParent(previousToken, checker); + case 63: + switch (parent2.kind) { + case 257: + return checker.getContextualType(parent2.initializer); + case 223: + return checker.getTypeAtLocation(parent2.left); + case 288: + return checker.getContextualTypeForJsxAttribute(parent2); + default: + return void 0; + } + case 103: + return checker.getContextualType(parent2); + case 82: + var caseClause = ts2.tryCast(parent2, ts2.isCaseClause); + return caseClause ? ts2.getSwitchedType(caseClause, checker) : void 0; + case 18: + return ts2.isJsxExpression(parent2) && !ts2.isJsxElement(parent2.parent) && !ts2.isJsxFragment(parent2.parent) ? checker.getContextualTypeForJsxAttribute(parent2.parent) : void 0; + default: + var argInfo = ts2.SignatureHelp.getArgumentInfoForCompletions(previousToken, position, sourceFile); + return argInfo ? ( + // At `,`, treat this as the next argument after the comma. + checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === 27 ? 1 : 0)) + ) : ts2.isEqualityOperatorKind(previousToken.kind) && ts2.isBinaryExpression(parent2) && ts2.isEqualityOperatorKind(parent2.operatorToken.kind) ? ( + // completion at `x ===/**/` should be for the right side + checker.getTypeAtLocation(parent2.left) + ) : checker.getContextualType(previousToken); + } + } + function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { + var chain3 = checker.getAccessibleSymbolChain( + symbol, + enclosingDeclaration, + /*meaning*/ + 67108863, + /*useOnlyExternalAliasing*/ + false + ); + if (chain3) + return ts2.first(chain3); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); + } + function isModuleSymbol(symbol) { + var _a2; + return !!((_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.some(function(d7) { + return d7.kind === 308; + })); + } + function getCompletionData(program, log3, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { + var typeChecker = program.getTypeChecker(); + var inCheckedFile = isCheckedFile(sourceFile, compilerOptions); + var start = ts2.timestamp(); + var currentToken = ts2.getTokenAtPosition(sourceFile, position); + log3("getCompletionData: Get current token: " + (ts2.timestamp() - start)); + start = ts2.timestamp(); + var insideComment = ts2.isInComment(sourceFile, position, currentToken); + log3("getCompletionData: Is inside comment: " + (ts2.timestamp() - start)); + var insideJsDocTagTypeExpression = false; + var isInSnippetScope = false; + if (insideComment) { + if (ts2.hasDocComment(sourceFile, position)) { + if (sourceFile.text.charCodeAt(position - 1) === 64) { + return { + kind: 1 + /* CompletionDataKind.JsDocTagName */ + }; + } else { + var lineStart = ts2.getLineStartPositionForPosition(position, sourceFile); + if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { + return { + kind: 2 + /* CompletionDataKind.JsDocTag */ + }; + } + } + } + var tag = getJsDocTagAtPosition(currentToken, position); + if (tag) { + if (tag.tagName.pos <= position && position <= tag.tagName.end) { + return { + kind: 1 + /* CompletionDataKind.JsDocTagName */ + }; + } + var typeExpression = tryGetTypeExpressionFromTag(tag); + if (typeExpression) { + currentToken = ts2.getTokenAtPosition(sourceFile, position); + if (!currentToken || !ts2.isDeclarationName(currentToken) && (currentToken.parent.kind !== 350 || currentToken.parent.name !== currentToken)) { + insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); + } + } + if (!insideJsDocTagTypeExpression && ts2.isJSDocParameterTag(tag) && (ts2.nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { + return { kind: 3, tag }; + } + } + if (!insideJsDocTagTypeExpression) { + log3("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); + return void 0; + } + } + start = ts2.timestamp(); + var isJsOnlyLocation = !insideJsDocTagTypeExpression && ts2.isSourceFileJS(sourceFile); + var tokens = getRelevantTokens(position, sourceFile); + var previousToken = tokens.previousToken; + var contextToken = tokens.contextToken; + log3("getCompletionData: Get previous token: " + (ts2.timestamp() - start)); + var node = currentToken; + var propertyAccessToConvert; + var isRightOfDot = false; + var isRightOfQuestionDot = false; + var isRightOfOpenTag = false; + var isStartingCloseTag = false; + var isJsxInitializer = false; + var isJsxIdentifierExpected = false; + var importStatementCompletion; + var location2 = ts2.getTouchingPropertyName(sourceFile, position); + var keywordFilters = 0; + var isNewIdentifierLocation = false; + var flags = 0; + if (contextToken) { + var importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken); + if (importStatementCompletionInfo.keywordCompletion) { + if (importStatementCompletionInfo.isKeywordOnlyCompletion) { + return { + kind: 4, + keywordCompletions: [keywordToCompletionEntry(importStatementCompletionInfo.keywordCompletion)], + isNewIdentifierLocation: importStatementCompletionInfo.isNewIdentifierLocation + }; + } + keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletionInfo.keywordCompletion); + } + if (importStatementCompletionInfo.replacementSpan && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { + flags |= 2; + importStatementCompletion = importStatementCompletionInfo; + isNewIdentifierLocation = importStatementCompletionInfo.isNewIdentifierLocation; + } + if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) { + log3("Returning an empty list because completion was requested in an invalid position."); + return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierDefinitionLocation()) : void 0; + } + var parent2 = contextToken.parent; + if (contextToken.kind === 24 || contextToken.kind === 28) { + isRightOfDot = contextToken.kind === 24; + isRightOfQuestionDot = contextToken.kind === 28; + switch (parent2.kind) { + case 208: + propertyAccessToConvert = parent2; + node = propertyAccessToConvert.expression; + var leftmostAccessExpression = ts2.getLeftmostAccessExpression(propertyAccessToConvert); + if (ts2.nodeIsMissing(leftmostAccessExpression) || (ts2.isCallExpression(node) || ts2.isFunctionLike(node)) && node.end === contextToken.pos && node.getChildCount(sourceFile) && ts2.last(node.getChildren(sourceFile)).kind !== 21) { + return void 0; + } + break; + case 163: + node = parent2.left; + break; + case 264: + node = parent2.name; + break; + case 202: + node = parent2; + break; + case 233: + node = parent2.getFirstToken(sourceFile); + ts2.Debug.assert( + node.kind === 100 || node.kind === 103 + /* SyntaxKind.NewKeyword */ + ); + break; + default: + return void 0; + } + } else if (!importStatementCompletion) { + if (parent2 && parent2.kind === 208) { + contextToken = parent2; + parent2 = parent2.parent; + } + if (currentToken.parent === location2) { + switch (currentToken.kind) { + case 31: + if (currentToken.parent.kind === 281 || currentToken.parent.kind === 283) { + location2 = currentToken; + } + break; + case 43: + if (currentToken.parent.kind === 282) { + location2 = currentToken; + } + break; + } + } + switch (parent2.kind) { + case 284: + if (contextToken.kind === 43) { + isStartingCloseTag = true; + location2 = contextToken; + } + break; + case 223: + if (!binaryExpressionMayBeOpenTag(parent2)) { + break; + } + case 282: + case 281: + case 283: + isJsxIdentifierExpected = true; + if (contextToken.kind === 29) { + isRightOfOpenTag = true; + location2 = contextToken; + } + break; + case 291: + case 290: + if (previousToken.kind === 19 && currentToken.kind === 31) { + isJsxIdentifierExpected = true; + } + break; + case 288: + if (parent2.initializer === previousToken && previousToken.end < position) { + isJsxIdentifierExpected = true; + break; + } + switch (previousToken.kind) { + case 63: + isJsxInitializer = true; + break; + case 79: + isJsxIdentifierExpected = true; + if (parent2 !== previousToken.parent && !parent2.initializer && ts2.findChildOfKind(parent2, 63, sourceFile)) { + isJsxInitializer = previousToken; + } + } + break; + } + } + } + var semanticStart = ts2.timestamp(); + var completionKind = 5; + var isNonContextualObjectLiteral = false; + var hasUnresolvedAutoImports = false; + var symbols = []; + var importSpecifierResolver; + var symbolToOriginInfoMap = []; + var symbolToSortTextMap = []; + var seenPropertySymbols = new ts2.Map(); + var isTypeOnlyLocation = isTypeOnlyCompletion(); + var getModuleSpecifierResolutionHost = ts2.memoizeOne(function(isFromPackageJson) { + return ts2.createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); + }); + if (isRightOfDot || isRightOfQuestionDot) { + getTypeScriptMemberSymbols(); + } else if (isRightOfOpenTag) { + symbols = typeChecker.getJsxIntrinsicTagNamesAt(location2); + ts2.Debug.assertEachIsDefined(symbols, "getJsxIntrinsicTagNames() should all be defined"); + tryGetGlobalSymbols(); + completionKind = 1; + keywordFilters = 0; + } else if (isStartingCloseTag) { + var tagName = contextToken.parent.parent.openingElement.tagName; + var tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (tagSymbol) { + symbols = [tagSymbol]; + } + completionKind = 1; + keywordFilters = 0; + } else { + if (!tryGetGlobalSymbols()) { + return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierLocation) : void 0; + } + } + log3("getCompletionData: Semantic work: " + (ts2.timestamp() - semanticStart)); + var contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker); + var literals = ts2.mapDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), function(t8) { + return t8.isLiteral() && !(t8.flags & 1024) ? t8.value : void 0; + }); + var recommendedCompletion = previousToken && contextualType && getRecommendedCompletion(previousToken, contextualType, typeChecker); + return { + kind: 0, + symbols, + completionKind, + isInSnippetScope, + propertyAccessToConvert, + isNewIdentifierLocation, + location: location2, + keywordFilters, + literals, + symbolToOriginInfoMap, + recommendedCompletion, + previousToken, + contextToken, + isJsxInitializer, + insideJsDocTagTypeExpression, + symbolToSortTextMap, + isTypeOnlyLocation, + isJsxIdentifierExpected, + isRightOfOpenTag, + importStatementCompletion, + hasUnresolvedAutoImports, + flags + }; + function isTagWithTypeExpression(tag2) { + switch (tag2.kind) { + case 343: + case 350: + case 344: + case 346: + case 348: + return true; + case 347: + return !!tag2.constraint; + default: + return false; + } + } + function tryGetTypeExpressionFromTag(tag2) { + if (isTagWithTypeExpression(tag2)) { + var typeExpression2 = ts2.isJSDocTemplateTag(tag2) ? tag2.constraint : tag2.typeExpression; + return typeExpression2 && typeExpression2.kind === 312 ? typeExpression2 : void 0; + } + return void 0; + } + function getTypeScriptMemberSymbols() { + completionKind = 2; + var isImportType = ts2.isLiteralImportTypeNode(node); + var isTypeLocation = insideJsDocTagTypeExpression || isImportType && !node.isTypeOf || ts2.isPartOfTypeNode(node.parent) || ts2.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + var isRhsOfImportDeclaration = ts2.isInRightSideOfInternalImportEqualsDeclaration(node); + if (ts2.isEntityName(node) || isImportType || ts2.isPropertyAccessExpression(node)) { + var isNamespaceName = ts2.isModuleDeclaration(node.parent); + if (isNamespaceName) + isNewIdentifierLocation = true; + var symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + symbol = ts2.skipAlias(symbol, typeChecker); + if (symbol.flags & (1536 | 384)) { + var exportedSymbols = typeChecker.getExportsOfModule(symbol); + ts2.Debug.assertEachIsDefined(exportedSymbols, "getExportsOfModule() should all be defined"); + var isValidValueAccess_1 = function(symbol2) { + return typeChecker.isValidPropertyAccess(isImportType ? node : node.parent, symbol2.name); + }; + var isValidTypeAccess_1 = function(symbol2) { + return symbolCanBeReferencedAtTypeLocation(symbol2, typeChecker); + }; + var isValidAccess = isNamespaceName ? function(symbol2) { + var _a2; + return !!(symbol2.flags & 1920) && !((_a2 = symbol2.declarations) === null || _a2 === void 0 ? void 0 : _a2.every(function(d7) { + return d7.parent === node.parent; + })); + } : isRhsOfImportDeclaration ? ( + // Any kind is allowed when dotting off namespace in internal import equals declaration + function(symbol2) { + return isValidTypeAccess_1(symbol2) || isValidValueAccess_1(symbol2); + } + ) : isTypeLocation ? isValidTypeAccess_1 : isValidValueAccess_1; + for (var _i = 0, exportedSymbols_1 = exportedSymbols; _i < exportedSymbols_1.length; _i++) { + var exportedSymbol = exportedSymbols_1[_i]; + if (isValidAccess(exportedSymbol)) { + symbols.push(exportedSymbol); + } + } + if (!isTypeLocation && symbol.declarations && symbol.declarations.some(function(d7) { + return d7.kind !== 308 && d7.kind !== 264 && d7.kind !== 263; + })) { + var type3 = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); + var insertQuestionDot = false; + if (type3.isNullableType()) { + var canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; + if (canCorrectToQuestionDot || isRightOfQuestionDot) { + type3 = type3.getNonNullableType(); + if (canCorrectToQuestionDot) { + insertQuestionDot = true; + } + } + } + addTypeProperties(type3, !!(node.flags & 32768), insertQuestionDot); + } + return; + } + } + } + if (!isTypeLocation) { + typeChecker.tryGetThisTypeAt( + node, + /*includeGlobalThis*/ + false + ); + var type3 = typeChecker.getTypeAtLocation(node).getNonOptionalType(); + var insertQuestionDot = false; + if (type3.isNullableType()) { + var canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; + if (canCorrectToQuestionDot || isRightOfQuestionDot) { + type3 = type3.getNonNullableType(); + if (canCorrectToQuestionDot) { + insertQuestionDot = true; + } + } + } + addTypeProperties(type3, !!(node.flags & 32768), insertQuestionDot); + } + } + function addTypeProperties(type3, insertAwait, insertQuestionDot) { + isNewIdentifierLocation = !!type3.getStringIndexType(); + if (isRightOfQuestionDot && ts2.some(type3.getCallSignatures())) { + isNewIdentifierLocation = true; + } + var propertyAccess = node.kind === 202 ? node : node.parent; + if (inCheckedFile) { + for (var _i = 0, _a2 = type3.getApparentProperties(); _i < _a2.length; _i++) { + var symbol = _a2[_i]; + if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type3, symbol)) { + addPropertySymbol( + symbol, + /* insertAwait */ + false, + insertQuestionDot + ); + } + } + } else { + symbols.push.apply(symbols, ts2.filter(getPropertiesForCompletion(type3, typeChecker), function(s7) { + return typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type3, s7); + })); + } + if (insertAwait && preferences.includeCompletionsWithInsertText) { + var promiseType2 = typeChecker.getPromisedTypeOfPromise(type3); + if (promiseType2) { + for (var _b = 0, _c = promiseType2.getApparentProperties(); _b < _c.length; _b++) { + var symbol = _c[_b]; + if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, promiseType2, symbol)) { + addPropertySymbol( + symbol, + /* insertAwait */ + true, + insertQuestionDot + ); + } + } + } + } + } + function addPropertySymbol(symbol, insertAwait, insertQuestionDot) { + var _a2; + var computedPropertyName = ts2.firstDefined(symbol.declarations, function(decl) { + return ts2.tryCast(ts2.getNameOfDeclaration(decl), ts2.isComputedPropertyName); + }); + if (computedPropertyName) { + var leftMostName = getLeftMostName(computedPropertyName.expression); + var nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName); + var firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker); + if (firstAccessibleSymbol && ts2.addToSeen(seenPropertySymbols, ts2.getSymbolId(firstAccessibleSymbol))) { + var index4 = symbols.length; + symbols.push(firstAccessibleSymbol); + var moduleSymbol = firstAccessibleSymbol.parent; + if (!moduleSymbol || !ts2.isExternalModuleSymbol(moduleSymbol) || typeChecker.tryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.name, moduleSymbol) !== firstAccessibleSymbol) { + symbolToOriginInfoMap[index4] = { kind: getNullableSymbolOriginInfoKind( + 2 + /* SymbolOriginInfoKind.SymbolMemberNoExport */ + ) }; + } else { + var fileName = ts2.isExternalModuleNameRelative(ts2.stripQuotes(moduleSymbol.name)) ? (_a2 = ts2.getSourceFileOfModule(moduleSymbol)) === null || _a2 === void 0 ? void 0 : _a2.fileName : void 0; + var moduleSpecifier = ((importSpecifierResolver || (importSpecifierResolver = ts2.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences))).getModuleSpecifierForBestExportInfo([{ + exportKind: 0, + moduleFileName: fileName, + isFromPackageJson: false, + moduleSymbol, + symbol: firstAccessibleSymbol, + targetFlags: ts2.skipAlias(firstAccessibleSymbol, typeChecker).flags + }], firstAccessibleSymbol.name, position, ts2.isValidTypeOnlyAliasUseSite(location2)) || {}).moduleSpecifier; + if (moduleSpecifier) { + var origin = { + kind: getNullableSymbolOriginInfoKind( + 6 + /* SymbolOriginInfoKind.SymbolMemberExport */ + ), + moduleSymbol, + isDefaultExport: false, + symbolName: firstAccessibleSymbol.name, + exportName: firstAccessibleSymbol.name, + fileName, + moduleSpecifier + }; + symbolToOriginInfoMap[index4] = origin; + } + } + } else if (preferences.includeCompletionsWithInsertText) { + addSymbolOriginInfo(symbol); + addSymbolSortInfo(symbol); + symbols.push(symbol); + } + } else { + addSymbolOriginInfo(symbol); + addSymbolSortInfo(symbol); + symbols.push(symbol); + } + function addSymbolSortInfo(symbol2) { + if (isStaticProperty(symbol2)) { + symbolToSortTextMap[ts2.getSymbolId(symbol2)] = Completions2.SortText.LocalDeclarationPriority; + } + } + function addSymbolOriginInfo(symbol2) { + if (preferences.includeCompletionsWithInsertText) { + if (insertAwait && ts2.addToSeen(seenPropertySymbols, ts2.getSymbolId(symbol2))) { + symbolToOriginInfoMap[symbols.length] = { kind: getNullableSymbolOriginInfoKind( + 8 + /* SymbolOriginInfoKind.Promise */ + ) }; + } else if (insertQuestionDot) { + symbolToOriginInfoMap[symbols.length] = { + kind: 16 + /* SymbolOriginInfoKind.Nullable */ + }; + } + } + } + function getNullableSymbolOriginInfoKind(kind) { + return insertQuestionDot ? kind | 16 : kind; + } + } + function getLeftMostName(e10) { + return ts2.isIdentifier(e10) ? e10 : ts2.isPropertyAccessExpression(e10) ? getLeftMostName(e10.expression) : void 0; + } + function tryGetGlobalSymbols() { + var result2 = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1); + return result2 === 1; + } + function tryGetConstructorCompletion() { + if (!tryGetConstructorLikeCompletionContainer(contextToken)) + return 0; + completionKind = 5; + isNewIdentifierLocation = true; + keywordFilters = 4; + return 1; + } + function tryGetJsxCompletionSymbols() { + var jsxContainer = tryGetContainingJsxElement(contextToken); + var attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes); + if (!attrsType) + return 0; + var completionsType = jsxContainer && typeChecker.getContextualType( + jsxContainer.attributes, + 4 + /* ContextFlags.Completions */ + ); + symbols = ts2.concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties)); + setSortTextToOptionalMember(); + completionKind = 3; + isNewIdentifierLocation = false; + return 1; + } + function tryGetImportCompletionSymbols() { + if (!importStatementCompletion) + return 0; + isNewIdentifierLocation = true; + collectAutoImports(); + return 1; + } + function getGlobalCompletions() { + keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 : 1; + completionKind = 1; + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(); + if (previousToken !== contextToken) { + ts2.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + var adjustedPosition = previousToken !== contextToken ? previousToken.getStart() : position; + var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; + isInSnippetScope = isSnippetScope(scopeNode); + var symbolMeanings = (isTypeOnlyLocation ? 0 : 111551) | 788968 | 1920 | 2097152; + var typeOnlyAliasNeedsPromotion = previousToken && !ts2.isValidTypeOnlyAliasUseSite(previousToken); + symbols = ts2.concatenate(symbols, typeChecker.getSymbolsInScope(scopeNode, symbolMeanings)); + ts2.Debug.assertEachIsDefined(symbols, "getSymbolsInScope() should all be defined"); + for (var i7 = 0; i7 < symbols.length; i7++) { + var symbol = symbols[i7]; + if (!typeChecker.isArgumentsSymbol(symbol) && !ts2.some(symbol.declarations, function(d7) { + return d7.getSourceFile() === sourceFile; + })) { + symbolToSortTextMap[ts2.getSymbolId(symbol)] = Completions2.SortText.GlobalsOrKeywords; + } + if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551)) { + var typeOnlyAliasDeclaration = symbol.declarations && ts2.find(symbol.declarations, ts2.isTypeOnlyImportOrExportDeclaration); + if (typeOnlyAliasDeclaration) { + var origin = { kind: 64, declaration: typeOnlyAliasDeclaration }; + symbolToOriginInfoMap[i7] = origin; + } + } + } + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 308) { + var thisType = typeChecker.tryGetThisTypeAt( + scopeNode, + /*includeGlobalThis*/ + false, + ts2.isClassLike(scopeNode.parent) ? scopeNode : void 0 + ); + if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { + for (var _i = 0, _a2 = getPropertiesForCompletion(thisType, typeChecker); _i < _a2.length; _i++) { + var symbol = _a2[_i]; + symbolToOriginInfoMap[symbols.length] = { + kind: 1 + /* SymbolOriginInfoKind.ThisType */ + }; + symbols.push(symbol); + symbolToSortTextMap[ts2.getSymbolId(symbol)] = Completions2.SortText.SuggestedClassMembers; + } + } + } + collectAutoImports(); + if (isTypeOnlyLocation) { + keywordFilters = contextToken && ts2.isAssertionExpression(contextToken.parent) ? 6 : 7; + } + } + function shouldOfferImportCompletions() { + if (importStatementCompletion) + return true; + if (isNonContextualObjectLiteral) + return false; + if (!preferences.includeCompletionsForModuleExports) + return false; + if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator) + return true; + if (ts2.compilerOptionsIndicateEsModules(program.getCompilerOptions())) + return true; + return ts2.programContainsModules(program); + } + function isSnippetScope(scopeNode) { + switch (scopeNode.kind) { + case 308: + case 225: + case 291: + case 238: + return true; + default: + return ts2.isStatement(scopeNode); + } + } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !!importStatementCompletion && ts2.isTypeOnlyImportOrExportDeclaration(location2.parent) || !isContextTokenValueLocation(contextToken) && (ts2.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || ts2.isPartOfTypeNode(location2) || isContextTokenTypeLocation(contextToken)); + } + function isContextTokenValueLocation(contextToken2) { + return contextToken2 && (contextToken2.kind === 112 && (contextToken2.parent.kind === 183 || ts2.isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 129 && contextToken2.parent.kind === 179); + } + function isContextTokenTypeLocation(contextToken2) { + if (contextToken2) { + var parentKind = contextToken2.parent.kind; + switch (contextToken2.kind) { + case 58: + return parentKind === 169 || parentKind === 168 || parentKind === 166 || parentKind === 257 || ts2.isFunctionLikeKind(parentKind); + case 63: + return parentKind === 262; + case 128: + return parentKind === 231; + case 29: + return parentKind === 180 || parentKind === 213; + case 94: + return parentKind === 165; + case 150: + return parentKind === 235; + } + } + return false; + } + function collectAutoImports() { + var _a2, _b; + if (!shouldOfferImportCompletions()) + return; + ts2.Debug.assert(!(detailsEntryId === null || detailsEntryId === void 0 ? void 0 : detailsEntryId.data), "Should not run 'collectAutoImports' when faster path is available via `data`"); + if (detailsEntryId && !detailsEntryId.source) { + return; + } + flags |= 1; + var isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken && importStatementCompletion; + var lowerCaseTokenText = isAfterTypeOnlyImportSpecifierModifier ? "" : previousToken && ts2.isIdentifier(previousToken) ? previousToken.text.toLowerCase() : ""; + var moduleSpecifierCache = (_a2 = host.getModuleSpecifierCache) === null || _a2 === void 0 ? void 0 : _a2.call(host); + var exportInfo = ts2.getExportInfoMap(sourceFile, host, program, preferences, cancellationToken); + var packageJsonAutoImportProvider = (_b = host.getPackageJsonAutoImportProvider) === null || _b === void 0 ? void 0 : _b.call(host); + var packageJsonFilter = detailsEntryId ? void 0 : ts2.createPackageJsonImportFilter(sourceFile, preferences, host); + resolvingModuleSpecifiers("collectAutoImports", host, importSpecifierResolver || (importSpecifierResolver = ts2.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences)), program, position, preferences, !!importStatementCompletion, ts2.isValidTypeOnlyAliasUseSite(location2), function(context2) { + exportInfo.search( + sourceFile.path, + /*preferCapitalized*/ + isRightOfOpenTag, + function(symbolName, targetFlags) { + if (!ts2.isIdentifierText(symbolName, ts2.getEmitScriptTarget(host.getCompilationSettings()))) + return false; + if (!detailsEntryId && ts2.isStringANonContextualKeyword(symbolName)) + return false; + if (!isTypeOnlyLocation && !importStatementCompletion && !(targetFlags & 111551)) + return false; + if (isTypeOnlyLocation && !(targetFlags & (1536 | 788968))) + return false; + var firstChar = symbolName.charCodeAt(0); + if (isRightOfOpenTag && (firstChar < 65 || firstChar > 90)) + return false; + if (detailsEntryId) + return true; + return charactersFuzzyMatchInString(symbolName, lowerCaseTokenText); + }, + function(info2, symbolName, isFromAmbientModule, exportMapKey) { + var _a3; + if (detailsEntryId && !ts2.some(info2, function(i7) { + return detailsEntryId.source === ts2.stripQuotes(i7.moduleSymbol.name); + })) { + return; + } + var firstImportableExportInfo = ts2.find(info2, isImportableExportInfo); + if (!firstImportableExportInfo) { + return; + } + var result2 = context2.tryResolve(info2, symbolName, isFromAmbientModule) || {}; + if (result2 === "failed") + return; + var exportInfo2 = firstImportableExportInfo, moduleSpecifier; + if (result2 !== "skipped") { + _a3 = result2.exportInfo, exportInfo2 = _a3 === void 0 ? firstImportableExportInfo : _a3, moduleSpecifier = result2.moduleSpecifier; + } + var isDefaultExport = exportInfo2.exportKind === 1; + var symbol = isDefaultExport && ts2.getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol; + pushAutoImportSymbol(symbol, { + kind: moduleSpecifier ? 32 : 4, + moduleSpecifier, + symbolName, + exportMapKey, + exportName: exportInfo2.exportKind === 2 ? "export=" : exportInfo2.symbol.name, + fileName: exportInfo2.moduleFileName, + isDefaultExport, + moduleSymbol: exportInfo2.moduleSymbol, + isFromPackageJson: exportInfo2.isFromPackageJson + }); + } + ); + hasUnresolvedAutoImports = context2.skippedAny(); + flags |= context2.resolvedAny() ? 8 : 0; + flags |= context2.resolvedBeyondLimit() ? 16 : 0; + }); + function isImportableExportInfo(info2) { + var moduleFile = ts2.tryCast(info2.moduleSymbol.valueDeclaration, ts2.isSourceFile); + if (!moduleFile) { + var moduleName3 = ts2.stripQuotes(info2.moduleSymbol.name); + if (ts2.JsTyping.nodeCoreModules.has(moduleName3) && ts2.startsWith(moduleName3, "node:") !== ts2.shouldUseUriStyleNodeCoreModules(sourceFile, program)) { + return false; + } + return packageJsonFilter ? packageJsonFilter.allowsImportingAmbientModule(info2.moduleSymbol, getModuleSpecifierResolutionHost(info2.isFromPackageJson)) : true; + } + return ts2.isImportableFile(info2.isFromPackageJson ? packageJsonAutoImportProvider : program, sourceFile, moduleFile, preferences, packageJsonFilter, getModuleSpecifierResolutionHost(info2.isFromPackageJson), moduleSpecifierCache); + } + } + function pushAutoImportSymbol(symbol, origin) { + var symbolId = ts2.getSymbolId(symbol); + if (symbolToSortTextMap[symbolId] === Completions2.SortText.GlobalsOrKeywords) { + return; + } + symbolToOriginInfoMap[symbols.length] = origin; + symbolToSortTextMap[symbolId] = importStatementCompletion ? Completions2.SortText.LocationPriority : Completions2.SortText.AutoImportSuggestions; + symbols.push(symbol); + } + function collectObjectLiteralMethodSymbols(members, enclosingDeclaration) { + if (ts2.isInJSFile(location2)) { + return; + } + members.forEach(function(member) { + if (!isObjectLiteralMethodSymbol(member)) { + return; + } + var displayName = getCompletionEntryDisplayNameForSymbol( + member, + ts2.getEmitScriptTarget(compilerOptions), + /*origin*/ + void 0, + 0, + /*jsxIdentifierExpected*/ + false + ); + if (!displayName) { + return; + } + var name2 = displayName.name; + var entryProps = getEntryForObjectLiteralMethodCompletion(member, name2, enclosingDeclaration, program, host, compilerOptions, preferences, formatContext); + if (!entryProps) { + return; + } + var origin = __assign16({ + kind: 128 + /* SymbolOriginInfoKind.ObjectLiteralMethod */ + }, entryProps); + flags |= 32; + symbolToOriginInfoMap[symbols.length] = origin; + symbols.push(member); + }); + } + function isObjectLiteralMethodSymbol(symbol) { + if (!(symbol.flags & (4 | 8192))) { + return false; + } + return true; + } + function getScopeNode(initialToken, position2, sourceFile2) { + var scope = initialToken; + while (scope && !ts2.positionBelongsToNode(scope, position2, sourceFile2)) { + scope = scope.parent; + } + return scope; + } + function isCompletionListBlocker(contextToken2) { + var start2 = ts2.timestamp(); + var result2 = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) || isSolelyIdentifierDefinitionLocation(contextToken2) || isDotOfNumericLiteral(contextToken2) || isInJsxText(contextToken2) || ts2.isBigIntLiteral(contextToken2); + log3("getCompletionsAtPosition: isCompletionListBlocker: " + (ts2.timestamp() - start2)); + return result2; + } + function isInJsxText(contextToken2) { + if (contextToken2.kind === 11) { + return true; + } + if (contextToken2.kind === 31 && contextToken2.parent) { + if (location2 === contextToken2.parent && (location2.kind === 283 || location2.kind === 282)) { + return false; + } + if (contextToken2.parent.kind === 283) { + return location2.parent.kind !== 283; + } + if (contextToken2.parent.kind === 284 || contextToken2.parent.kind === 282) { + return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 281; + } + } + return false; + } + function isNewIdentifierDefinitionLocation() { + if (contextToken) { + var containingNodeKind = contextToken.parent.kind; + var tokenKind = keywordForNode(contextToken); + switch (tokenKind) { + case 27: + return containingNodeKind === 210 || containingNodeKind === 173 || containingNodeKind === 211 || containingNodeKind === 206 || containingNodeKind === 223 || containingNodeKind === 181 || containingNodeKind === 207; + case 20: + return containingNodeKind === 210 || containingNodeKind === 173 || containingNodeKind === 211 || containingNodeKind === 214 || containingNodeKind === 193; + case 22: + return containingNodeKind === 206 || containingNodeKind === 178 || containingNodeKind === 164; + case 142: + case 143: + case 100: + return true; + case 24: + return containingNodeKind === 264; + case 18: + return containingNodeKind === 260 || containingNodeKind === 207; + case 63: + return containingNodeKind === 257 || containingNodeKind === 223; + case 15: + return containingNodeKind === 225; + case 16: + return containingNodeKind === 236; + case 132: + return containingNodeKind === 171 || containingNodeKind === 300; + case 41: + return containingNodeKind === 171; + } + if (isClassMemberCompletionKeyword(tokenKind)) { + return true; + } + } + return false; + } + function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { + return (ts2.isRegularExpressionLiteral(contextToken2) || ts2.isStringTextContainingNode(contextToken2)) && (ts2.rangeContainsPositionExclusive(ts2.createTextRangeFromSpan(ts2.createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || ts2.isRegularExpressionLiteral(contextToken2))); + } + function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { + var typeLiteralNode = tryGetTypeLiteralNode(contextToken); + if (!typeLiteralNode) + return 0; + var intersectionTypeNode = ts2.isIntersectionTypeNode(typeLiteralNode.parent) ? typeLiteralNode.parent : void 0; + var containerTypeNode = intersectionTypeNode || typeLiteralNode; + var containerExpectedType = getConstraintOfTypeArgumentProperty(containerTypeNode, typeChecker); + if (!containerExpectedType) + return 0; + var containerActualType = typeChecker.getTypeFromTypeNode(containerTypeNode); + var members = getPropertiesForCompletion(containerExpectedType, typeChecker); + var existingMembers = getPropertiesForCompletion(containerActualType, typeChecker); + var existingMemberEscapedNames = new ts2.Set(); + existingMembers.forEach(function(s7) { + return existingMemberEscapedNames.add(s7.escapedName); + }); + symbols = ts2.concatenate(symbols, ts2.filter(members, function(s7) { + return !existingMemberEscapedNames.has(s7.escapedName); + })); + completionKind = 0; + isNewIdentifierLocation = true; + return 1; + } + function tryGetObjectLikeCompletionSymbols() { + var symbolsStartIndex = symbols.length; + var objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken); + if (!objectLikeContainer) + return 0; + completionKind = 0; + var typeMembers; + var existingMembers; + if (objectLikeContainer.kind === 207) { + var instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); + if (instantiatedType === void 0) { + if (objectLikeContainer.flags & 33554432) { + return 2; + } + isNonContextualObjectLiteral = true; + return 0; + } + var completionsType = typeChecker.getContextualType( + objectLikeContainer, + 4 + /* ContextFlags.Completions */ + ); + var hasStringIndexType = (completionsType || instantiatedType).getStringIndexType(); + var hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType(); + isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype; + typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); + existingMembers = objectLikeContainer.properties; + if (typeMembers.length === 0) { + if (!hasNumberIndextype) { + isNonContextualObjectLiteral = true; + return 0; + } + } + } else { + ts2.Debug.assert( + objectLikeContainer.kind === 203 + /* SyntaxKind.ObjectBindingPattern */ + ); + isNewIdentifierLocation = false; + var rootDeclaration = ts2.getRootDeclaration(objectLikeContainer.parent); + if (!ts2.isVariableLike(rootDeclaration)) + return ts2.Debug.fail("Root declaration is not variable-like."); + var canGetType = ts2.hasInitializer(rootDeclaration) || !!ts2.getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 247; + if (!canGetType && rootDeclaration.kind === 166) { + if (ts2.isExpression(rootDeclaration.parent)) { + canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); + } else if (rootDeclaration.parent.kind === 171 || rootDeclaration.parent.kind === 175) { + canGetType = ts2.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); + } + } + if (canGetType) { + var typeForObject_1 = typeChecker.getTypeAtLocation(objectLikeContainer); + if (!typeForObject_1) + return 2; + typeMembers = typeChecker.getPropertiesOfType(typeForObject_1).filter(function(propertySymbol) { + return typeChecker.isPropertyAccessible( + objectLikeContainer, + /*isSuper*/ + false, + /*writing*/ + false, + typeForObject_1, + propertySymbol + ); + }); + existingMembers = objectLikeContainer.elements; + } + } + if (typeMembers && typeMembers.length > 0) { + var filteredMembers = filterObjectMembersList(typeMembers, ts2.Debug.checkDefined(existingMembers)); + symbols = ts2.concatenate(symbols, filteredMembers); + setSortTextToOptionalMember(); + if (objectLikeContainer.kind === 207 && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { + transformObjectLiteralMembersSortText(symbolsStartIndex); + collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); + } + } + return 1; + } + function tryGetImportOrExportClauseCompletionSymbols() { + if (!contextToken) + return 0; + var namedImportsOrExports = contextToken.kind === 18 || contextToken.kind === 27 ? ts2.tryCast(contextToken.parent, ts2.isNamedImportsOrExports) : ts2.isTypeKeywordTokenOrIdentifier(contextToken) ? ts2.tryCast(contextToken.parent.parent, ts2.isNamedImportsOrExports) : void 0; + if (!namedImportsOrExports) + return 0; + if (!ts2.isTypeKeywordTokenOrIdentifier(contextToken)) { + keywordFilters = 8; + } + var moduleSpecifier = (namedImportsOrExports.kind === 272 ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent).moduleSpecifier; + if (!moduleSpecifier) { + isNewIdentifierLocation = true; + return namedImportsOrExports.kind === 272 ? 2 : 0; + } + var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); + if (!moduleSpecifierSymbol) { + isNewIdentifierLocation = true; + return 2; + } + completionKind = 3; + isNewIdentifierLocation = false; + var exports29 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); + var existing = new ts2.Set(namedImportsOrExports.elements.filter(function(n7) { + return !isCurrentlyEditingNode(n7); + }).map(function(n7) { + return (n7.propertyName || n7.name).escapedText; + })); + var uniques = exports29.filter(function(e10) { + return e10.escapedName !== "default" && !existing.has(e10.escapedName); + }); + symbols = ts2.concatenate(symbols, uniques); + if (!uniques.length) { + keywordFilters = 0; + } + return 1; + } + function tryGetLocalNamedExportCompletionSymbols() { + var _a2; + var namedExports = contextToken && (contextToken.kind === 18 || contextToken.kind === 27) ? ts2.tryCast(contextToken.parent, ts2.isNamedExports) : void 0; + if (!namedExports) { + return 0; + } + var localsContainer = ts2.findAncestor(namedExports, ts2.or(ts2.isSourceFile, ts2.isModuleDeclaration)); + completionKind = 5; + isNewIdentifierLocation = false; + (_a2 = localsContainer.locals) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(symbol, name2) { + var _a3, _b; + symbols.push(symbol); + if ((_b = (_a3 = localsContainer.symbol) === null || _a3 === void 0 ? void 0 : _a3.exports) === null || _b === void 0 ? void 0 : _b.has(name2)) { + symbolToSortTextMap[ts2.getSymbolId(symbol)] = Completions2.SortText.OptionalMember; + } + }); + return 1; + } + function tryGetClassLikeCompletionSymbols() { + var decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location2, position); + if (!decl) + return 0; + completionKind = 3; + isNewIdentifierLocation = true; + keywordFilters = contextToken.kind === 41 ? 0 : ts2.isClassLike(decl) ? 2 : 3; + if (!ts2.isClassLike(decl)) + return 1; + var classElement = contextToken.kind === 26 ? contextToken.parent.parent : contextToken.parent; + var classElementModifierFlags = ts2.isClassElement(classElement) ? ts2.getEffectiveModifierFlags(classElement) : 0; + if (contextToken.kind === 79 && !isCurrentlyEditingNode(contextToken)) { + switch (contextToken.getText()) { + case "private": + classElementModifierFlags = classElementModifierFlags | 8; + break; + case "static": + classElementModifierFlags = classElementModifierFlags | 32; + break; + case "override": + classElementModifierFlags = classElementModifierFlags | 16384; + break; + } + } + if (ts2.isClassStaticBlockDeclaration(classElement)) { + classElementModifierFlags |= 32; + } + if (!(classElementModifierFlags & 8)) { + var baseTypeNodes = ts2.isClassLike(decl) && classElementModifierFlags & 16384 ? ts2.singleElementArray(ts2.getEffectiveBaseTypeNode(decl)) : ts2.getAllSuperTypeNodes(decl); + var baseSymbols = ts2.flatMap(baseTypeNodes, function(baseTypeNode) { + var type3 = typeChecker.getTypeAtLocation(baseTypeNode); + return classElementModifierFlags & 32 ? (type3 === null || type3 === void 0 ? void 0 : type3.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type3.symbol, decl)) : type3 && typeChecker.getPropertiesOfType(type3); + }); + symbols = ts2.concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); + } + return 1; + } + function isConstructorParameterCompletion(node2) { + return !!node2.parent && ts2.isParameter(node2.parent) && ts2.isConstructorDeclaration(node2.parent.parent) && (ts2.isParameterPropertyModifier(node2.kind) || ts2.isDeclarationName(node2)); + } + function tryGetConstructorLikeCompletionContainer(contextToken2) { + if (contextToken2) { + var parent3 = contextToken2.parent; + switch (contextToken2.kind) { + case 20: + case 27: + return ts2.isConstructorDeclaration(contextToken2.parent) ? contextToken2.parent : void 0; + default: + if (isConstructorParameterCompletion(contextToken2)) { + return parent3.parent; + } + } + } + return void 0; + } + function tryGetFunctionLikeBodyCompletionContainer(contextToken2) { + if (contextToken2) { + var prev_1; + var container = ts2.findAncestor(contextToken2.parent, function(node2) { + if (ts2.isClassLike(node2)) { + return "quit"; + } + if (ts2.isFunctionLikeDeclaration(node2) && prev_1 === node2.body) { + return true; + } + prev_1 = node2; + return false; + }); + return container && container; + } + } + function tryGetContainingJsxElement(contextToken2) { + if (contextToken2) { + var parent3 = contextToken2.parent; + switch (contextToken2.kind) { + case 31: + case 30: + case 43: + case 79: + case 208: + case 289: + case 288: + case 290: + if (parent3 && (parent3.kind === 282 || parent3.kind === 283)) { + if (contextToken2.kind === 31) { + var precedingToken = ts2.findPrecedingToken( + contextToken2.pos, + sourceFile, + /*startNode*/ + void 0 + ); + if (!parent3.typeArguments || precedingToken && precedingToken.kind === 43) + break; + } + return parent3; + } else if (parent3.kind === 288) { + return parent3.parent.parent; + } + break; + case 10: + if (parent3 && (parent3.kind === 288 || parent3.kind === 290)) { + return parent3.parent.parent; + } + break; + case 19: + if (parent3 && parent3.kind === 291 && parent3.parent && parent3.parent.kind === 288) { + return parent3.parent.parent.parent; + } + if (parent3 && parent3.kind === 290) { + return parent3.parent.parent; + } + break; + } + } + return void 0; + } + function isSolelyIdentifierDefinitionLocation(contextToken2) { + var parent3 = contextToken2.parent; + var containingNodeKind = parent3.kind; + switch (contextToken2.kind) { + case 27: + return containingNodeKind === 257 || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 240 || containingNodeKind === 263 || // enum a { foo, | + isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 261 || // interface A= contextToken2.pos; + case 24: + return containingNodeKind === 204; + case 58: + return containingNodeKind === 205; + case 22: + return containingNodeKind === 204; + case 20: + return containingNodeKind === 295 || isFunctionLikeButNotConstructor(containingNodeKind); + case 18: + return containingNodeKind === 263; + case 29: + return containingNodeKind === 260 || // class A< | + containingNodeKind === 228 || // var C = class D< | + containingNodeKind === 261 || // interface A< | + containingNodeKind === 262 || // type List< | + ts2.isFunctionLikeKind(containingNodeKind); + case 124: + return containingNodeKind === 169 && !ts2.isClassLike(parent3.parent); + case 25: + return containingNodeKind === 166 || !!parent3.parent && parent3.parent.kind === 204; + case 123: + case 121: + case 122: + return containingNodeKind === 166 && !ts2.isConstructorDeclaration(parent3.parent); + case 128: + return containingNodeKind === 273 || containingNodeKind === 278 || containingNodeKind === 271; + case 137: + case 151: + return !isFromObjectTypeDeclaration(contextToken2); + case 79: + if (containingNodeKind === 273 && contextToken2 === parent3.name && contextToken2.text === "type") { + return false; + } + break; + case 84: + case 92: + case 118: + case 98: + case 113: + case 100: + case 119: + case 85: + case 138: + return true; + case 154: + return containingNodeKind !== 273; + case 41: + return ts2.isFunctionLike(contextToken2.parent) && !ts2.isMethodDeclaration(contextToken2.parent); + } + if (isClassMemberCompletionKeyword(keywordForNode(contextToken2)) && isFromObjectTypeDeclaration(contextToken2)) { + return false; + } + if (isConstructorParameterCompletion(contextToken2)) { + if (!ts2.isIdentifier(contextToken2) || ts2.isParameterPropertyModifier(keywordForNode(contextToken2)) || isCurrentlyEditingNode(contextToken2)) { + return false; + } + } + switch (keywordForNode(contextToken2)) { + case 126: + case 84: + case 85: + case 136: + case 92: + case 98: + case 118: + case 119: + case 121: + case 122: + case 123: + case 124: + case 113: + return true; + case 132: + return ts2.isPropertyDeclaration(contextToken2.parent); + } + var ancestorClassLike = ts2.findAncestor(contextToken2.parent, ts2.isClassLike); + if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { + return false; + } + var ancestorPropertyDeclaraion = ts2.getAncestor( + contextToken2.parent, + 169 + /* SyntaxKind.PropertyDeclaration */ + ); + if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && ts2.isClassLike(previousToken.parent.parent) && position <= previousToken.end) { + if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { + return false; + } else if (contextToken2.kind !== 63 && (ts2.isInitializedProperty(ancestorPropertyDeclaraion) || ts2.hasType(ancestorPropertyDeclaraion))) { + return true; + } + } + return ts2.isDeclarationName(contextToken2) && !ts2.isShorthandPropertyAssignment(contextToken2.parent) && !ts2.isJsxAttribute(contextToken2.parent) && !(ts2.isClassLike(contextToken2.parent) && (contextToken2 !== previousToken || position > previousToken.end)); + } + function isPreviousPropertyDeclarationTerminated(contextToken2, position2) { + return contextToken2.kind !== 63 && (contextToken2.kind === 26 || !ts2.positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); + } + function isFunctionLikeButNotConstructor(kind) { + return ts2.isFunctionLikeKind(kind) && kind !== 173; + } + function isDotOfNumericLiteral(contextToken2) { + if (contextToken2.kind === 8) { + var text = contextToken2.getFullText(); + return text.charAt(text.length - 1) === "."; + } + return false; + } + function isVariableDeclarationListButNotTypeArgument(node2) { + return node2.parent.kind === 258 && !ts2.isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); + } + function filterObjectMembersList(contextualMemberSymbols, existingMembers) { + if (existingMembers.length === 0) { + return contextualMemberSymbols; + } + var membersDeclaredBySpreadAssignment = new ts2.Set(); + var existingMemberNames = new ts2.Set(); + for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { + var m7 = existingMembers_1[_i]; + if (m7.kind !== 299 && m7.kind !== 300 && m7.kind !== 205 && m7.kind !== 171 && m7.kind !== 174 && m7.kind !== 175 && m7.kind !== 301) { + continue; + } + if (isCurrentlyEditingNode(m7)) { + continue; + } + var existingName = void 0; + if (ts2.isSpreadAssignment(m7)) { + setMembersDeclaredBySpreadAssignment(m7, membersDeclaredBySpreadAssignment); + } else if (ts2.isBindingElement(m7) && m7.propertyName) { + if (m7.propertyName.kind === 79) { + existingName = m7.propertyName.escapedText; + } + } else { + var name2 = ts2.getNameOfDeclaration(m7); + existingName = name2 && ts2.isPropertyNameLiteral(name2) ? ts2.getEscapedTextOfIdentifierOrLiteral(name2) : void 0; + } + if (existingName !== void 0) { + existingMemberNames.add(existingName); + } + } + var filteredSymbols = contextualMemberSymbols.filter(function(m8) { + return !existingMemberNames.has(m8.escapedName); + }); + setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); + return filteredSymbols; + } + function setMembersDeclaredBySpreadAssignment(declaration, membersDeclaredBySpreadAssignment) { + var expression = declaration.expression; + var symbol = typeChecker.getSymbolAtLocation(expression); + var type3 = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, expression); + var properties = type3 && type3.properties; + if (properties) { + properties.forEach(function(property2) { + membersDeclaredBySpreadAssignment.add(property2.name); + }); + } + } + function setSortTextToOptionalMember() { + symbols.forEach(function(m7) { + var _a2; + if (m7.flags & 16777216) { + var symbolId = ts2.getSymbolId(m7); + symbolToSortTextMap[symbolId] = (_a2 = symbolToSortTextMap[symbolId]) !== null && _a2 !== void 0 ? _a2 : Completions2.SortText.OptionalMember; + } + }); + } + function setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, contextualMemberSymbols) { + if (membersDeclaredBySpreadAssignment.size === 0) { + return; + } + for (var _i = 0, contextualMemberSymbols_1 = contextualMemberSymbols; _i < contextualMemberSymbols_1.length; _i++) { + var contextualMemberSymbol = contextualMemberSymbols_1[_i]; + if (membersDeclaredBySpreadAssignment.has(contextualMemberSymbol.name)) { + symbolToSortTextMap[ts2.getSymbolId(contextualMemberSymbol)] = Completions2.SortText.MemberDeclaredBySpreadAssignment; + } + } + } + function transformObjectLiteralMembersSortText(start2) { + var _a2; + for (var i7 = start2; i7 < symbols.length; i7++) { + var symbol = symbols[i7]; + var symbolId = ts2.getSymbolId(symbol); + var origin = symbolToOriginInfoMap === null || symbolToOriginInfoMap === void 0 ? void 0 : symbolToOriginInfoMap[i7]; + var target = ts2.getEmitScriptTarget(compilerOptions); + var displayName = getCompletionEntryDisplayNameForSymbol( + symbol, + target, + origin, + 0, + /*jsxIdentifierExpected*/ + false + ); + if (displayName) { + var originalSortText = (_a2 = symbolToSortTextMap[symbolId]) !== null && _a2 !== void 0 ? _a2 : Completions2.SortText.LocationPriority; + var name2 = displayName.name; + symbolToSortTextMap[symbolId] = Completions2.SortText.ObjectLiteralProperty(originalSortText, name2); + } + } + } + function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { + var existingMemberNames = new ts2.Set(); + for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { + var m7 = existingMembers_2[_i]; + if (m7.kind !== 169 && m7.kind !== 171 && m7.kind !== 174 && m7.kind !== 175) { + continue; + } + if (isCurrentlyEditingNode(m7)) { + continue; + } + if (ts2.hasEffectiveModifier( + m7, + 8 + /* ModifierFlags.Private */ + )) { + continue; + } + if (ts2.isStatic(m7) !== !!(currentClassElementModifierFlags & 32)) { + continue; + } + var existingName = ts2.getPropertyNameForPropertyNameNode(m7.name); + if (existingName) { + existingMemberNames.add(existingName); + } + } + return baseSymbols.filter(function(propertySymbol) { + return !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(ts2.getDeclarationModifierFlagsFromSymbol(propertySymbol) & 8) && !(propertySymbol.valueDeclaration && ts2.isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration)); + }); + } + function filterJsxAttributes(symbols2, attributes) { + var seenNames = new ts2.Set(); + var membersDeclaredBySpreadAssignment = new ts2.Set(); + for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) { + var attr = attributes_1[_i]; + if (isCurrentlyEditingNode(attr)) { + continue; + } + if (attr.kind === 288) { + seenNames.add(attr.name.escapedText); + } else if (ts2.isJsxSpreadAttribute(attr)) { + setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); + } + } + var filteredSymbols = symbols2.filter(function(a7) { + return !seenNames.has(a7.escapedName); + }); + setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); + return filteredSymbols; + } + function isCurrentlyEditingNode(node2) { + return node2.getStart(sourceFile) <= position && position <= node2.getEnd(); + } + } + function tryGetObjectLikeCompletionContainer(contextToken) { + if (contextToken) { + var parent2 = contextToken.parent; + switch (contextToken.kind) { + case 18: + case 27: + if (ts2.isObjectLiteralExpression(parent2) || ts2.isObjectBindingPattern(parent2)) { + return parent2; + } + break; + case 41: + return ts2.isMethodDeclaration(parent2) ? ts2.tryCast(parent2.parent, ts2.isObjectLiteralExpression) : void 0; + case 79: + return contextToken.text === "async" && ts2.isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0; + } + } + return void 0; + } + function getRelevantTokens(position, sourceFile) { + var previousToken = ts2.findPrecedingToken(position, sourceFile); + if (previousToken && position <= previousToken.end && (ts2.isMemberName(previousToken) || ts2.isKeyword(previousToken.kind))) { + var contextToken = ts2.findPrecedingToken( + previousToken.getFullStart(), + sourceFile, + /*startNode*/ + void 0 + ); + return { contextToken, previousToken }; + } + return { contextToken: previousToken, previousToken }; + } + function getAutoImportSymbolFromCompletionEntryData(name2, data, program, host) { + var containingProgram = data.isPackageJsonImport ? host.getPackageJsonAutoImportProvider() : program; + var checker = containingProgram.getTypeChecker(); + var moduleSymbol = data.ambientModuleName ? checker.tryFindAmbientModule(data.ambientModuleName) : data.fileName ? checker.getMergedSymbol(ts2.Debug.checkDefined(containingProgram.getSourceFile(data.fileName)).symbol) : void 0; + if (!moduleSymbol) + return void 0; + var symbol = data.exportName === "export=" ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(data.exportName, moduleSymbol); + if (!symbol) + return void 0; + var isDefaultExport = data.exportName === "default"; + symbol = isDefaultExport && ts2.getLocalSymbolForExportDefault(symbol) || symbol; + return { symbol, origin: completionEntryDataToSymbolOriginInfo(data, name2, moduleSymbol) }; + } + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, jsxIdentifierExpected) { + var name2 = originIncludesSymbolName(origin) ? origin.symbolName : symbol.name; + if (name2 === void 0 || symbol.flags & 1536 && ts2.isSingleOrDoubleQuote(name2.charCodeAt(0)) || ts2.isKnownSymbol(symbol)) { + return void 0; + } + var validNameResult = { name: name2, needsConvertPropertyAccess: false }; + if (ts2.isIdentifierText( + name2, + target, + jsxIdentifierExpected ? 1 : 0 + /* LanguageVariant.Standard */ + ) || symbol.valueDeclaration && ts2.isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { + return validNameResult; + } + switch (kind) { + case 3: + return void 0; + case 0: + return { name: JSON.stringify(name2), needsConvertPropertyAccess: false }; + case 2: + case 1: + return name2.charCodeAt(0) === 32 ? void 0 : { name: name2, needsConvertPropertyAccess: true }; + case 5: + case 4: + return validNameResult; + default: + ts2.Debug.assertNever(kind); + } + } + var _keywordCompletions = []; + var allKeywordsCompletions = ts2.memoize(function() { + var res = []; + for (var i7 = 81; i7 <= 162; i7++) { + res.push({ + name: ts2.tokenToString(i7), + kind: "keyword", + kindModifiers: "", + sortText: Completions2.SortText.GlobalsOrKeywords + }); + } + return res; + }); + function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) { + if (!filterOutTsOnlyKeywords) + return getTypescriptKeywordCompletions(keywordFilter); + var index4 = keywordFilter + 8 + 1; + return _keywordCompletions[index4] || (_keywordCompletions[index4] = getTypescriptKeywordCompletions(keywordFilter).filter(function(entry) { + return !isTypeScriptOnlyKeyword(ts2.stringToToken(entry.name)); + })); + } + function getTypescriptKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function(entry) { + var kind = ts2.stringToToken(entry.name); + switch (keywordFilter) { + case 0: + return false; + case 1: + return isFunctionLikeBodyKeyword(kind) || kind === 136 || kind === 142 || kind === 154 || kind === 143 || kind === 126 || ts2.isTypeKeyword(kind) && kind !== 155; + case 5: + return isFunctionLikeBodyKeyword(kind); + case 2: + return isClassMemberCompletionKeyword(kind); + case 3: + return isInterfaceOrTypeLiteralCompletionKeyword(kind); + case 4: + return ts2.isParameterPropertyModifier(kind); + case 6: + return ts2.isTypeKeyword(kind) || kind === 85; + case 7: + return ts2.isTypeKeyword(kind); + case 8: + return kind === 154; + default: + return ts2.Debug.assertNever(keywordFilter); + } + })); + } + function isTypeScriptOnlyKeyword(kind) { + switch (kind) { + case 126: + case 131: + case 160: + case 134: + case 136: + case 92: + case 159: + case 117: + case 138: + case 118: + case 140: + case 141: + case 142: + case 143: + case 144: + case 148: + case 149: + case 161: + case 121: + case 122: + case 123: + case 146: + case 152: + case 153: + case 154: + case 156: + case 157: + return true; + default: + return false; + } + } + function isInterfaceOrTypeLiteralCompletionKeyword(kind) { + return kind === 146; + } + function isClassMemberCompletionKeyword(kind) { + switch (kind) { + case 126: + case 127: + case 135: + case 137: + case 151: + case 132: + case 136: + case 161: + return true; + default: + return ts2.isClassMemberModifier(kind); + } + } + function isFunctionLikeBodyKeyword(kind) { + return kind === 132 || kind === 133 || kind === 128 || kind === 150 || kind === 154 || !ts2.isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + } + function keywordForNode(node) { + return ts2.isIdentifier(node) ? node.originalKeywordKind || 0 : node.kind; + } + function getContextualKeywords(contextToken, position) { + var entries = []; + if (contextToken) { + var file = contextToken.getSourceFile(); + var parent2 = contextToken.parent; + var tokenLine = file.getLineAndCharacterOfPosition(contextToken.end).line; + var currentLine = file.getLineAndCharacterOfPosition(position).line; + if ((ts2.isImportDeclaration(parent2) || ts2.isExportDeclaration(parent2) && parent2.moduleSpecifier) && contextToken === parent2.moduleSpecifier && tokenLine === currentLine) { + entries.push({ + name: ts2.tokenToString( + 130 + /* SyntaxKind.AssertKeyword */ + ), + kind: "keyword", + kindModifiers: "", + sortText: Completions2.SortText.GlobalsOrKeywords + }); + } + } + return entries; + } + function getJsDocTagAtPosition(node, position) { + return ts2.findAncestor(node, function(n7) { + return ts2.isJSDocTag(n7) && ts2.rangeContainsPosition(n7, position) ? true : ts2.isJSDoc(n7) ? "quit" : false; + }); + } + function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) { + var hasCompletionsType = completionsType && completionsType !== contextualType; + var type3 = hasCompletionsType && !(completionsType.flags & 3) ? checker.getUnionType([contextualType, completionsType]) : contextualType; + var properties = getApparentProperties(type3, obj, checker); + return type3.isClass() && containsNonPublicProperties(properties) ? [] : hasCompletionsType ? ts2.filter(properties, hasDeclarationOtherThanSelf) : properties; + function hasDeclarationOtherThanSelf(member) { + if (!ts2.length(member.declarations)) + return true; + return ts2.some(member.declarations, function(decl) { + return decl.parent !== obj; + }); + } + } + Completions2.getPropertiesForObjectExpression = getPropertiesForObjectExpression; + function getApparentProperties(type3, node, checker) { + if (!type3.isUnion()) + return type3.getApparentProperties(); + return checker.getAllPossiblePropertiesOfTypes(ts2.filter(type3.types, function(memberType) { + return !(memberType.flags & 131068 || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || ts2.typeHasCallOrConstructSignatures(memberType, checker) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())); + })); + } + function containsNonPublicProperties(props) { + return ts2.some(props, function(p7) { + return !!(ts2.getDeclarationModifierFlagsFromSymbol(p7) & 24); + }); + } + function getPropertiesForCompletion(type3, checker) { + return type3.isUnion() ? ts2.Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type3.types), "getAllPossiblePropertiesOfTypes() should all be defined") : ts2.Debug.checkEachDefined(type3.getApparentProperties(), "getApparentProperties() should all be defined"); + } + function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location2, position) { + switch (location2.kind) { + case 351: + return ts2.tryCast(location2.parent, ts2.isObjectTypeDeclaration); + case 1: + var cls = ts2.tryCast(ts2.lastOrUndefined(ts2.cast(location2.parent, ts2.isSourceFile).statements), ts2.isObjectTypeDeclaration); + if (cls && !ts2.findChildOfKind(cls, 19, sourceFile)) { + return cls; + } + break; + case 79: { + var originalKeywordKind = location2.originalKeywordKind; + if (originalKeywordKind && ts2.isKeyword(originalKeywordKind)) { + return void 0; + } + if (ts2.isPropertyDeclaration(location2.parent) && location2.parent.initializer === location2) { + return void 0; + } + if (isFromObjectTypeDeclaration(location2)) { + return ts2.findAncestor(location2, ts2.isObjectTypeDeclaration); + } + } + } + if (!contextToken) + return void 0; + if (location2.kind === 135 || ts2.isIdentifier(contextToken) && ts2.isPropertyDeclaration(contextToken.parent) && ts2.isClassLike(location2)) { + return ts2.findAncestor(contextToken, ts2.isClassLike); + } + switch (contextToken.kind) { + case 63: + return void 0; + case 26: + case 19: + return isFromObjectTypeDeclaration(location2) && location2.parent.name === location2 ? location2.parent.parent : ts2.tryCast(location2, ts2.isObjectTypeDeclaration); + case 18: + case 27: + return ts2.tryCast(contextToken.parent, ts2.isObjectTypeDeclaration); + default: + if (!isFromObjectTypeDeclaration(contextToken)) { + if (ts2.getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== ts2.getLineAndCharacterOfPosition(sourceFile, position).line && ts2.isObjectTypeDeclaration(location2)) { + return location2; + } + return void 0; + } + var isValidKeyword = ts2.isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; + return isValidKeyword(contextToken.kind) || contextToken.kind === 41 || ts2.isIdentifier(contextToken) && isValidKeyword(ts2.stringToToken(contextToken.text)) ? contextToken.parent.parent : void 0; + } + } + function tryGetTypeLiteralNode(node) { + if (!node) + return void 0; + var parent2 = node.parent; + switch (node.kind) { + case 18: + if (ts2.isTypeLiteralNode(parent2)) { + return parent2; + } + break; + case 26: + case 27: + case 79: + if (parent2.kind === 168 && ts2.isTypeLiteralNode(parent2.parent)) { + return parent2.parent; + } + break; + } + return void 0; + } + function getConstraintOfTypeArgumentProperty(node, checker) { + if (!node) + return void 0; + if (ts2.isTypeNode(node) && ts2.isTypeReferenceType(node.parent)) { + return checker.getTypeArgumentConstraint(node); + } + var t8 = getConstraintOfTypeArgumentProperty(node.parent, checker); + if (!t8) + return void 0; + switch (node.kind) { + case 168: + return checker.getTypeOfPropertyOfContextualType(t8, node.symbol.escapedName); + case 190: + case 184: + case 189: + return t8; + } + } + function isFromObjectTypeDeclaration(node) { + return node.parent && ts2.isClassOrTypeElement(node.parent) && ts2.isObjectTypeDeclaration(node.parent.parent); + } + function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { + switch (triggerCharacter) { + case ".": + case "@": + return true; + case '"': + case "'": + case "`": + return !!contextToken && ts2.isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1; + case "#": + return !!contextToken && ts2.isPrivateIdentifier(contextToken) && !!ts2.getContainingClass(contextToken); + case "<": + return !!contextToken && contextToken.kind === 29 && (!ts2.isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); + case "/": + return !!contextToken && (ts2.isStringLiteralLike(contextToken) ? !!ts2.tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 43 && ts2.isJsxClosingElement(contextToken.parent)); + case " ": + return !!contextToken && ts2.isImportKeyword(contextToken) && contextToken.parent.kind === 308; + default: + return ts2.Debug.assertNever(triggerCharacter); + } + } + function binaryExpressionMayBeOpenTag(_a2) { + var left = _a2.left; + return ts2.nodeIsMissing(left); + } + function isProbablyGlobalType(type3, sourceFile, checker) { + var selfSymbol = checker.resolveName( + "self", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (selfSymbol && checker.getTypeOfSymbolAtLocation(selfSymbol, sourceFile) === type3) { + return true; + } + var globalSymbol = checker.resolveName( + "global", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (globalSymbol && checker.getTypeOfSymbolAtLocation(globalSymbol, sourceFile) === type3) { + return true; + } + var globalThisSymbol = checker.resolveName( + "globalThis", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (globalThisSymbol && checker.getTypeOfSymbolAtLocation(globalThisSymbol, sourceFile) === type3) { + return true; + } + return false; + } + function isStaticProperty(symbol) { + return !!(symbol.valueDeclaration && ts2.getEffectiveModifierFlags(symbol.valueDeclaration) & 32 && ts2.isClassLike(symbol.valueDeclaration.parent)); + } + function tryGetObjectLiteralContextualType(node, typeChecker) { + var type3 = typeChecker.getContextualType(node); + if (type3) { + return type3; + } + var parent2 = ts2.walkUpParenthesizedExpressions(node.parent); + if (ts2.isBinaryExpression(parent2) && parent2.operatorToken.kind === 63 && node === parent2.left) { + return typeChecker.getTypeAtLocation(parent2); + } + if (ts2.isExpression(parent2)) { + return typeChecker.getContextualType(parent2); + } + return void 0; + } + function getImportStatementCompletionInfo(contextToken) { + var _a2, _b, _c; + var keywordCompletion; + var isKeywordOnlyCompletion = false; + var candidate = getCandidate(); + return { + isKeywordOnlyCompletion, + keywordCompletion, + isNewIdentifierLocation: !!(candidate || keywordCompletion === 154), + isTopLevelTypeOnly: !!((_b = (_a2 = ts2.tryCast(candidate, ts2.isImportDeclaration)) === null || _a2 === void 0 ? void 0 : _a2.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || !!((_c = ts2.tryCast(candidate, ts2.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly), + couldBeTypeOnlyImportSpecifier: !!candidate && couldBeTypeOnlyImportSpecifier(candidate, contextToken), + replacementSpan: getSingleLineReplacementSpanForImportCompletionNode(candidate) + }; + function getCandidate() { + var parent2 = contextToken.parent; + if (ts2.isImportEqualsDeclaration(parent2)) { + keywordCompletion = contextToken.kind === 154 ? void 0 : 154; + return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0; + } + if (couldBeTypeOnlyImportSpecifier(parent2, contextToken) && canCompleteFromNamedBindings(parent2.parent)) { + return parent2; + } + if (ts2.isNamedImports(parent2) || ts2.isNamespaceImport(parent2)) { + if (!parent2.parent.isTypeOnly && (contextToken.kind === 18 || contextToken.kind === 100 || contextToken.kind === 27)) { + keywordCompletion = 154; + } + if (canCompleteFromNamedBindings(parent2)) { + if (contextToken.kind === 19 || contextToken.kind === 79) { + isKeywordOnlyCompletion = true; + keywordCompletion = 158; + } else { + return parent2.parent.parent; + } + } + return void 0; + } + if (ts2.isImportKeyword(contextToken) && ts2.isSourceFile(parent2)) { + keywordCompletion = 154; + return contextToken; + } + if (ts2.isImportKeyword(contextToken) && ts2.isImportDeclaration(parent2)) { + keywordCompletion = 154; + return isModuleSpecifierMissingOrEmpty(parent2.moduleSpecifier) ? parent2 : void 0; + } + return void 0; + } + } + function getSingleLineReplacementSpanForImportCompletionNode(node) { + var _a2, _b, _c; + if (!node) + return void 0; + var top = (_a2 = ts2.findAncestor(node, ts2.or(ts2.isImportDeclaration, ts2.isImportEqualsDeclaration))) !== null && _a2 !== void 0 ? _a2 : node; + var sourceFile = top.getSourceFile(); + if (ts2.rangeIsOnSingleLine(top, sourceFile)) { + return ts2.createTextSpanFromNode(top, sourceFile); + } + ts2.Debug.assert( + top.kind !== 100 && top.kind !== 273 + /* SyntaxKind.ImportSpecifier */ + ); + var potentialSplitPoint = top.kind === 269 ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings)) !== null && _c !== void 0 ? _c : top.moduleSpecifier : top.moduleReference; + var withoutModuleSpecifier = { + pos: top.getFirstToken().getStart(), + end: potentialSplitPoint.pos + }; + if (ts2.rangeIsOnSingleLine(withoutModuleSpecifier, sourceFile)) { + return ts2.createTextSpanFromRange(withoutModuleSpecifier); + } + } + function getPotentiallyInvalidImportSpecifier(namedBindings) { + var _a2; + return ts2.find((_a2 = ts2.tryCast(namedBindings, ts2.isNamedImports)) === null || _a2 === void 0 ? void 0 : _a2.elements, function(e10) { + var _a3; + return !e10.propertyName && ts2.isStringANonContextualKeyword(e10.name.text) && ((_a3 = ts2.findPrecedingToken(e10.name.pos, namedBindings.getSourceFile(), namedBindings)) === null || _a3 === void 0 ? void 0 : _a3.kind) !== 27; + }); + } + function couldBeTypeOnlyImportSpecifier(importSpecifier, contextToken) { + return ts2.isImportSpecifier(importSpecifier) && (importSpecifier.isTypeOnly || contextToken === importSpecifier.name && ts2.isTypeKeywordTokenOrIdentifier(contextToken)); + } + function canCompleteFromNamedBindings(namedBindings) { + if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings.parent.name) { + return false; + } + if (ts2.isNamedImports(namedBindings)) { + var invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings); + var validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : namedBindings.elements.length; + return validImports < 2; + } + return true; + } + function isModuleSpecifierMissingOrEmpty(specifier) { + var _a2; + if (ts2.nodeIsMissing(specifier)) + return true; + return !((_a2 = ts2.tryCast(ts2.isExternalModuleReference(specifier) ? specifier.expression : specifier, ts2.isStringLiteralLike)) === null || _a2 === void 0 ? void 0 : _a2.text); + } + function getVariableDeclaration(property2) { + var variableDeclaration = ts2.findAncestor(property2, function(node) { + return ts2.isFunctionBlock(node) || isArrowFunctionBody(node) || ts2.isBindingPattern(node) ? "quit" : ts2.isVariableDeclaration(node); + }); + return variableDeclaration; + } + function isArrowFunctionBody(node) { + return node.parent && ts2.isArrowFunction(node.parent) && node.parent.body === node; + } + function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules) { + if (seenModules === void 0) { + seenModules = new ts2.Map(); + } + return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(ts2.skipAlias(symbol.exportSymbol || symbol, checker)); + function nonAliasCanBeReferencedAtTypeLocation(symbol2) { + return !!(symbol2.flags & 788968) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536) && ts2.addToSeen(seenModules, ts2.getSymbolId(symbol2)) && checker.getExportsOfModule(symbol2).some(function(e10) { + return symbolCanBeReferencedAtTypeLocation(e10, checker, seenModules); + }); + } + } + function isDeprecated(symbol, checker) { + var declarations = ts2.skipAlias(symbol, checker).declarations; + return !!ts2.length(declarations) && ts2.every(declarations, ts2.isDeprecatedDeclaration); + } + function charactersFuzzyMatchInString(identifierString, lowercaseCharacters) { + if (lowercaseCharacters.length === 0) { + return true; + } + var matchedFirstCharacter = false; + var prevChar; + var characterIndex = 0; + var len = identifierString.length; + for (var strIndex = 0; strIndex < len; strIndex++) { + var strChar = identifierString.charCodeAt(strIndex); + var testChar = lowercaseCharacters.charCodeAt(characterIndex); + if (strChar === testChar || strChar === toUpperCharCode(testChar)) { + matchedFirstCharacter || (matchedFirstCharacter = prevChar === void 0 || // Beginning of word + 97 <= prevChar && prevChar <= 122 && 65 <= strChar && strChar <= 90 || // camelCase transition + prevChar === 95 && strChar !== 95); + if (matchedFirstCharacter) { + characterIndex++; + } + if (characterIndex === lowercaseCharacters.length) { + return true; + } + } + prevChar = strChar; + } + return false; + } + function toUpperCharCode(charCode) { + if (97 <= charCode && charCode <= 122) { + return charCode - 32; + } + return charCode; + } + })(Completions = ts2.Completions || (ts2.Completions = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var DocumentHighlights; + (function(DocumentHighlights2) { + function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { + var node = ts2.getTouchingPropertyName(sourceFile, position); + if (node.parent && (ts2.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts2.isJsxClosingElement(node.parent))) { + var _a2 = node.parent.parent, openingElement = _a2.openingElement, closingElement = _a2.closingElement; + var highlightSpans = [openingElement, closingElement].map(function(_a3) { + var tagName = _a3.tagName; + return getHighlightSpanForNode(tagName, sourceFile); + }); + return [{ fileName: sourceFile.fileName, highlightSpans }]; + } + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + } + DocumentHighlights2.getDocumentHighlights = getDocumentHighlights; + function getHighlightSpanForNode(node, sourceFile) { + return { + fileName: sourceFile.fileName, + textSpan: ts2.createTextSpanFromNode(node, sourceFile), + kind: "none" + /* HighlightSpanKind.none */ + }; + } + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + var sourceFilesSet = new ts2.Set(sourceFilesToSearch.map(function(f8) { + return f8.fileName; + })); + var referenceEntries = ts2.FindAllReferences.getReferenceEntriesForNode( + position, + node, + program, + sourceFilesToSearch, + cancellationToken, + /*options*/ + void 0, + sourceFilesSet + ); + if (!referenceEntries) + return void 0; + var map4 = ts2.arrayToMultiMap(referenceEntries.map(ts2.FindAllReferences.toHighlightSpan), function(e10) { + return e10.fileName; + }, function(e10) { + return e10.span; + }); + var getCanonicalFileName = ts2.createGetCanonicalFileName(program.useCaseSensitiveFileNames()); + return ts2.mapDefined(ts2.arrayFrom(map4.entries()), function(_a2) { + var fileName = _a2[0], highlightSpans = _a2[1]; + if (!sourceFilesSet.has(fileName)) { + if (!program.redirectTargetsMap.has(ts2.toPath(fileName, program.getCurrentDirectory(), getCanonicalFileName))) { + return void 0; + } + var redirectTarget_1 = program.getSourceFile(fileName); + var redirect = ts2.find(sourceFilesToSearch, function(f8) { + return !!f8.redirectInfo && f8.redirectInfo.redirectTarget === redirectTarget_1; + }); + fileName = redirect.fileName; + ts2.Debug.assert(sourceFilesSet.has(fileName)); + } + return { fileName, highlightSpans }; + }); + } + function getSyntacticDocumentHighlights(node, sourceFile) { + var highlightSpans = getHighlightSpans(node, sourceFile); + return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }]; + } + function getHighlightSpans(node, sourceFile) { + switch (node.kind) { + case 99: + case 91: + return ts2.isIfStatement(node.parent) ? getIfElseOccurrences(node.parent, sourceFile) : void 0; + case 105: + return useParent(node.parent, ts2.isReturnStatement, getReturnOccurrences); + case 109: + return useParent(node.parent, ts2.isThrowStatement, getThrowOccurrences); + case 111: + case 83: + case 96: + var tryStatement = node.kind === 83 ? node.parent.parent : node.parent; + return useParent(tryStatement, ts2.isTryStatement, getTryCatchFinallyOccurrences); + case 107: + return useParent(node.parent, ts2.isSwitchStatement, getSwitchCaseDefaultOccurrences); + case 82: + case 88: { + if (ts2.isDefaultClause(node.parent) || ts2.isCaseClause(node.parent)) { + return useParent(node.parent.parent.parent, ts2.isSwitchStatement, getSwitchCaseDefaultOccurrences); + } + return void 0; + } + case 81: + case 86: + return useParent(node.parent, ts2.isBreakOrContinueStatement, getBreakOrContinueStatementOccurrences); + case 97: + case 115: + case 90: + return useParent(node.parent, function(n7) { + return ts2.isIterationStatement( + n7, + /*lookInLabeledStatements*/ + true + ); + }, getLoopBreakContinueOccurrences); + case 135: + return getFromAllDeclarations(ts2.isConstructorDeclaration, [ + 135 + /* SyntaxKind.ConstructorKeyword */ + ]); + case 137: + case 151: + return getFromAllDeclarations(ts2.isAccessor, [ + 137, + 151 + /* SyntaxKind.SetKeyword */ + ]); + case 133: + return useParent(node.parent, ts2.isAwaitExpression, getAsyncAndAwaitOccurrences); + case 132: + return highlightSpans(getAsyncAndAwaitOccurrences(node)); + case 125: + return highlightSpans(getYieldOccurrences(node)); + case 101: + return void 0; + default: + return ts2.isModifierKind(node.kind) && (ts2.isDeclaration(node.parent) || ts2.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : void 0; + } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function(decl) { + return ts2.mapDefined(decl.symbol.declarations, function(d7) { + return nodeTest(d7) ? ts2.find(d7.getChildren(sourceFile), function(c7) { + return ts2.contains(keywords, c7.kind); + }) : void 0; + }); + }); + } + function useParent(node2, nodeTest, getNodes) { + return nodeTest(node2) ? highlightSpans(getNodes(node2, sourceFile)) : void 0; + } + function highlightSpans(nodes) { + return nodes && nodes.map(function(node2) { + return getHighlightSpanForNode(node2, sourceFile); + }); + } + } + function aggregateOwnedThrowStatements(node) { + if (ts2.isThrowStatement(node)) { + return [node]; + } else if (ts2.isTryStatement(node)) { + return ts2.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock)); + } + return ts2.isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateOwnedThrowStatements); + } + function getThrowStatementOwner(throwStatement) { + var child = throwStatement; + while (child.parent) { + var parent2 = child.parent; + if (ts2.isFunctionBlock(parent2) || parent2.kind === 308) { + return parent2; + } + if (ts2.isTryStatement(parent2) && parent2.tryBlock === child && parent2.catchClause) { + return child; + } + child = parent2; + } + return void 0; + } + function aggregateAllBreakAndContinueStatements(node) { + return ts2.isBreakOrContinueStatement(node) ? [node] : ts2.isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result2 = []; + node.forEachChild(function(child) { + var value2 = cb(child); + if (value2 !== void 0) { + result2.push.apply(result2, ts2.toArray(value2)); + } + }); + return result2; + } + function ownsBreakOrContinueStatement(owner, statement) { + var actualOwner = getBreakOrContinueOwner(statement); + return !!actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + return ts2.findAncestor(statement, function(node) { + switch (node.kind) { + case 252: + if (statement.kind === 248) { + return false; + } + case 245: + case 246: + case 247: + case 244: + case 243: + return !statement.label || isLabeledBy(node, statement.label.escapedText); + default: + return ts2.isFunctionLike(node) && "quit"; + } + }); + } + function getModifierOccurrences(modifier, declaration) { + return ts2.mapDefined(getNodesToSearchForModifier(declaration, ts2.modifierToFlag(modifier)), function(node) { + return ts2.findModifier(node, modifier); + }); + } + function getNodesToSearchForModifier(declaration, modifierFlag) { + var container = declaration.parent; + switch (container.kind) { + case 265: + case 308: + case 238: + case 292: + case 293: + if (modifierFlag & 256 && ts2.isClassDeclaration(declaration)) { + return __spreadArray9(__spreadArray9([], declaration.members, true), [declaration], false); + } else { + return container.statements; + } + case 173: + case 171: + case 259: + return __spreadArray9(__spreadArray9([], container.parameters, true), ts2.isClassLike(container.parent) ? container.parent.members : [], true); + case 260: + case 228: + case 261: + case 184: + var nodes = container.members; + if (modifierFlag & (28 | 64)) { + var constructor = ts2.find(container.members, ts2.isConstructorDeclaration); + if (constructor) { + return __spreadArray9(__spreadArray9([], nodes, true), constructor.parameters, true); + } + } else if (modifierFlag & 256) { + return __spreadArray9(__spreadArray9([], nodes, true), [container], false); + } + return nodes; + case 207: + return void 0; + default: + ts2.Debug.assertNever(container, "Invalid container kind."); + } + } + function pushKeywordIf(keywordList, token) { + var expected = []; + for (var _i = 2; _i < arguments.length; _i++) { + expected[_i - 2] = arguments[_i]; + } + if (token && ts2.contains(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getLoopBreakContinueOccurrences(loopNode) { + var keywords = []; + if (pushKeywordIf( + keywords, + loopNode.getFirstToken(), + 97, + 115, + 90 + /* SyntaxKind.DoKeyword */ + )) { + if (loopNode.kind === 243) { + var loopTokens = loopNode.getChildren(); + for (var i7 = loopTokens.length - 1; i7 >= 0; i7--) { + if (pushKeywordIf( + keywords, + loopTokens[i7], + 115 + /* SyntaxKind.WhileKeyword */ + )) { + break; + } + } + } + } + ts2.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function(statement) { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf( + keywords, + statement.getFirstToken(), + 81, + 86 + /* SyntaxKind.ContinueKeyword */ + ); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + var owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 245: + case 246: + case 247: + case 243: + case 244: + return getLoopBreakContinueOccurrences(owner); + case 252: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return void 0; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + var keywords = []; + pushKeywordIf( + keywords, + switchStatement.getFirstToken(), + 107 + /* SyntaxKind.SwitchKeyword */ + ); + ts2.forEach(switchStatement.caseBlock.clauses, function(clause) { + pushKeywordIf( + keywords, + clause.getFirstToken(), + 82, + 88 + /* SyntaxKind.DefaultKeyword */ + ); + ts2.forEach(aggregateAllBreakAndContinueStatements(clause), function(statement) { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf( + keywords, + statement.getFirstToken(), + 81 + /* SyntaxKind.BreakKeyword */ + ); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + var keywords = []; + pushKeywordIf( + keywords, + tryStatement.getFirstToken(), + 111 + /* SyntaxKind.TryKeyword */ + ); + if (tryStatement.catchClause) { + pushKeywordIf( + keywords, + tryStatement.catchClause.getFirstToken(), + 83 + /* SyntaxKind.CatchKeyword */ + ); + } + if (tryStatement.finallyBlock) { + var finallyKeyword = ts2.findChildOfKind(tryStatement, 96, sourceFile); + pushKeywordIf( + keywords, + finallyKeyword, + 96 + /* SyntaxKind.FinallyKeyword */ + ); + } + return keywords; + } + function getThrowOccurrences(throwStatement, sourceFile) { + var owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return void 0; + } + var keywords = []; + ts2.forEach(aggregateOwnedThrowStatements(owner), function(throwStatement2) { + keywords.push(ts2.findChildOfKind(throwStatement2, 109, sourceFile)); + }); + if (ts2.isFunctionBlock(owner)) { + ts2.forEachReturnStatement(owner, function(returnStatement) { + keywords.push(ts2.findChildOfKind(returnStatement, 105, sourceFile)); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement, sourceFile) { + var func = ts2.getContainingFunction(returnStatement); + if (!func) { + return void 0; + } + var keywords = []; + ts2.forEachReturnStatement(ts2.cast(func.body, ts2.isBlock), function(returnStatement2) { + keywords.push(ts2.findChildOfKind(returnStatement2, 105, sourceFile)); + }); + ts2.forEach(aggregateOwnedThrowStatements(func.body), function(throwStatement) { + keywords.push(ts2.findChildOfKind(throwStatement, 109, sourceFile)); + }); + return keywords; + } + function getAsyncAndAwaitOccurrences(node) { + var func = ts2.getContainingFunction(node); + if (!func) { + return void 0; + } + var keywords = []; + if (func.modifiers) { + func.modifiers.forEach(function(modifier) { + pushKeywordIf( + keywords, + modifier, + 132 + /* SyntaxKind.AsyncKeyword */ + ); + }); + } + ts2.forEachChild(func, function(child) { + traverseWithoutCrossingFunction(child, function(node2) { + if (ts2.isAwaitExpression(node2)) { + pushKeywordIf( + keywords, + node2.getFirstToken(), + 133 + /* SyntaxKind.AwaitKeyword */ + ); + } + }); + }); + return keywords; + } + function getYieldOccurrences(node) { + var func = ts2.getContainingFunction(node); + if (!func) { + return void 0; + } + var keywords = []; + ts2.forEachChild(func, function(child) { + traverseWithoutCrossingFunction(child, function(node2) { + if (ts2.isYieldExpression(node2)) { + pushKeywordIf( + keywords, + node2.getFirstToken(), + 125 + /* SyntaxKind.YieldKeyword */ + ); + } + }); + }); + return keywords; + } + function traverseWithoutCrossingFunction(node, cb) { + cb(node); + if (!ts2.isFunctionLike(node) && !ts2.isClassLike(node) && !ts2.isInterfaceDeclaration(node) && !ts2.isModuleDeclaration(node) && !ts2.isTypeAliasDeclaration(node) && !ts2.isTypeNode(node)) { + ts2.forEachChild(node, function(child) { + return traverseWithoutCrossingFunction(child, cb); + }); + } + } + function getIfElseOccurrences(ifStatement, sourceFile) { + var keywords = getIfElseKeywords(ifStatement, sourceFile); + var result2 = []; + for (var i7 = 0; i7 < keywords.length; i7++) { + if (keywords[i7].kind === 91 && i7 < keywords.length - 1) { + var elseKeyword = keywords[i7]; + var ifKeyword = keywords[i7 + 1]; + var shouldCombineElseAndIf = true; + for (var j6 = ifKeyword.getStart(sourceFile) - 1; j6 >= elseKeyword.end; j6--) { + if (!ts2.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j6))) { + shouldCombineElseAndIf = false; + break; + } + } + if (shouldCombineElseAndIf) { + result2.push({ + fileName: sourceFile.fileName, + textSpan: ts2.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: "reference" + /* HighlightSpanKind.reference */ + }); + i7++; + continue; + } + } + result2.push(getHighlightSpanForNode(keywords[i7], sourceFile)); + } + return result2; + } + function getIfElseKeywords(ifStatement, sourceFile) { + var keywords = []; + while (ts2.isIfStatement(ifStatement.parent) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + while (true) { + var children = ifStatement.getChildren(sourceFile); + pushKeywordIf( + keywords, + children[0], + 99 + /* SyntaxKind.IfKeyword */ + ); + for (var i7 = children.length - 1; i7 >= 0; i7--) { + if (pushKeywordIf( + keywords, + children[i7], + 91 + /* SyntaxKind.ElseKeyword */ + )) { + break; + } + } + if (!ifStatement.elseStatement || !ts2.isIfStatement(ifStatement.elseStatement)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + return keywords; + } + function isLabeledBy(node, labelName) { + return !!ts2.findAncestor(node.parent, function(owner) { + return !ts2.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; + }); + } + })(DocumentHighlights = ts2.DocumentHighlights || (ts2.DocumentHighlights = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function isDocumentRegistryEntry(entry) { + return !!entry.sourceFile; + } + function createDocumentRegistry(useCaseSensitiveFileNames, currentDirectory) { + return createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory); + } + ts2.createDocumentRegistry = createDocumentRegistry; + function createDocumentRegistryInternal(useCaseSensitiveFileNames, currentDirectory, externalCache) { + if (currentDirectory === void 0) { + currentDirectory = ""; + } + var buckets = new ts2.Map(); + var getCanonicalFileName = ts2.createGetCanonicalFileName(!!useCaseSensitiveFileNames); + function reportStats() { + var bucketInfoArray = ts2.arrayFrom(buckets.keys()).filter(function(name2) { + return name2 && name2.charAt(0) === "_"; + }).map(function(name2) { + var entries = buckets.get(name2); + var sourceFiles = []; + entries.forEach(function(entry, name3) { + if (isDocumentRegistryEntry(entry)) { + sourceFiles.push({ + name: name3, + scriptKind: entry.sourceFile.scriptKind, + refCount: entry.languageServiceRefCount + }); + } else { + entry.forEach(function(value2, scriptKind) { + return sourceFiles.push({ name: name3, scriptKind, refCount: value2.languageServiceRefCount }); + }); + } + }); + sourceFiles.sort(function(x7, y7) { + return y7.refCount - x7.refCount; + }); + return { + bucket: name2, + sourceFiles + }; + }); + return JSON.stringify(bucketInfoArray, void 0, 2); + } + function getCompilationSettings(settingsOrHost) { + if (typeof settingsOrHost.getCompilationSettings === "function") { + return settingsOrHost.getCompilationSettings(); + } + return settingsOrHost; + } + function acquireDocument(fileName, compilationSettings, scriptSnapshot, version5, scriptKind, languageVersionOrOptions) { + var path2 = ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); + return acquireDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version5, scriptKind, languageVersionOrOptions); + } + function acquireDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version5, scriptKind, languageVersionOrOptions) { + return acquireOrUpdateDocument( + fileName, + path2, + compilationSettings, + key, + scriptSnapshot, + version5, + /*acquiring*/ + true, + scriptKind, + languageVersionOrOptions + ); + } + function updateDocument(fileName, compilationSettings, scriptSnapshot, version5, scriptKind, languageVersionOrOptions) { + var path2 = ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + var key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); + return updateDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version5, scriptKind, languageVersionOrOptions); + } + function updateDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version5, scriptKind, languageVersionOrOptions) { + return acquireOrUpdateDocument( + fileName, + path2, + getCompilationSettings(compilationSettings), + key, + scriptSnapshot, + version5, + /*acquiring*/ + false, + scriptKind, + languageVersionOrOptions + ); + } + function getDocumentRegistryEntry(bucketEntry, scriptKind) { + var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts2.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided")); + ts2.Debug.assert(scriptKind === void 0 || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry)); + return entry; + } + function acquireOrUpdateDocument(fileName, path2, compilationSettingsOrHost, key, scriptSnapshot, version5, acquiring, scriptKind, languageVersionOrOptions) { + var _a2, _b, _c, _d; + scriptKind = ts2.ensureScriptKind(fileName, scriptKind); + var compilationSettings = getCompilationSettings(compilationSettingsOrHost); + var host = compilationSettingsOrHost === compilationSettings ? void 0 : compilationSettingsOrHost; + var scriptTarget = scriptKind === 6 ? 100 : ts2.getEmitScriptTarget(compilationSettings); + var sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { + languageVersion: scriptTarget, + impliedNodeFormat: host && ts2.getImpliedNodeFormatForFile(path2, (_d = (_c = (_b = (_a2 = host.getCompilerHost) === null || _a2 === void 0 ? void 0 : _a2.call(host)) === null || _b === void 0 ? void 0 : _b.getModuleResolutionCache) === null || _c === void 0 ? void 0 : _c.call(_b)) === null || _d === void 0 ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings), + setExternalModuleIndicator: ts2.getSetExternalModuleIndicator(compilationSettings) + }; + sourceFileOptions.languageVersion = scriptTarget; + var oldBucketCount = buckets.size; + var keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat); + var bucket = ts2.getOrUpdate(buckets, keyWithMode, function() { + return new ts2.Map(); + }); + if (ts2.tracing) { + if (buckets.size > oldBucketCount) { + ts2.tracing.instant("session", "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: keyWithMode }); + } + var otherBucketKey = !ts2.isDeclarationFileName(path2) && ts2.forEachEntry(buckets, function(bucket2, bucketKey) { + return bucketKey !== keyWithMode && bucket2.has(path2) && bucketKey; + }); + if (otherBucketKey) { + ts2.tracing.instant("session", "documentRegistryBucketOverlap", { path: path2, key1: otherBucketKey, key2: keyWithMode }); + } + } + var bucketEntry = bucket.get(path2); + var entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); + if (!entry && externalCache) { + var sourceFile = externalCache.getDocument(keyWithMode, path2); + if (sourceFile) { + ts2.Debug.assert(acquiring); + entry = { + sourceFile, + languageServiceRefCount: 0 + }; + setBucketEntry(); + } + } + if (!entry) { + var sourceFile = ts2.createLanguageServiceSourceFile( + fileName, + scriptSnapshot, + sourceFileOptions, + version5, + /*setNodeParents*/ + false, + scriptKind + ); + if (externalCache) { + externalCache.setDocument(keyWithMode, path2, sourceFile); + } + entry = { + sourceFile, + languageServiceRefCount: 1 + }; + setBucketEntry(); + } else { + if (entry.sourceFile.version !== version5) { + entry.sourceFile = ts2.updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version5, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); + if (externalCache) { + externalCache.setDocument(keyWithMode, path2, entry.sourceFile); + } + } + if (acquiring) { + entry.languageServiceRefCount++; + } + } + ts2.Debug.assert(entry.languageServiceRefCount !== 0); + return entry.sourceFile; + function setBucketEntry() { + if (!bucketEntry) { + bucket.set(path2, entry); + } else if (isDocumentRegistryEntry(bucketEntry)) { + var scriptKindMap = new ts2.Map(); + scriptKindMap.set(bucketEntry.sourceFile.scriptKind, bucketEntry); + scriptKindMap.set(scriptKind, entry); + bucket.set(path2, scriptKindMap); + } else { + bucketEntry.set(scriptKind, entry); + } + } + } + function releaseDocument(fileName, compilationSettings, scriptKind, impliedNodeFormat) { + var path2 = ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + var key = getKeyForCompilationSettings(compilationSettings); + return releaseDocumentWithKey(path2, key, scriptKind, impliedNodeFormat); + } + function releaseDocumentWithKey(path2, key, scriptKind, impliedNodeFormat) { + var bucket = ts2.Debug.checkDefined(buckets.get(getDocumentRegistryBucketKeyWithMode(key, impliedNodeFormat))); + var bucketEntry = bucket.get(path2); + var entry = getDocumentRegistryEntry(bucketEntry, scriptKind); + entry.languageServiceRefCount--; + ts2.Debug.assert(entry.languageServiceRefCount >= 0); + if (entry.languageServiceRefCount === 0) { + if (isDocumentRegistryEntry(bucketEntry)) { + bucket.delete(path2); + } else { + bucketEntry.delete(scriptKind); + if (bucketEntry.size === 1) { + bucket.set(path2, ts2.firstDefinedIterator(bucketEntry.values(), ts2.identity)); + } + } + } + } + function getLanguageServiceRefCounts(path2, scriptKind) { + return ts2.arrayFrom(buckets.entries(), function(_a2) { + var key = _a2[0], bucket = _a2[1]; + var bucketEntry = bucket.get(path2); + var entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); + return [key, entry && entry.languageServiceRefCount]; + }); + } + return { + acquireDocument, + acquireDocumentWithKey, + updateDocument, + updateDocumentWithKey, + releaseDocument, + releaseDocumentWithKey, + getLanguageServiceRefCounts, + reportStats, + getKeyForCompilationSettings + }; + } + ts2.createDocumentRegistryInternal = createDocumentRegistryInternal; + function compilerOptionValueToString(value2) { + var _a2; + if (value2 === null || typeof value2 !== "object") { + return "" + value2; + } + if (ts2.isArray(value2)) { + return "[".concat((_a2 = ts2.map(value2, function(e10) { + return compilerOptionValueToString(e10); + })) === null || _a2 === void 0 ? void 0 : _a2.join(","), "]"); + } + var str2 = "{"; + for (var key in value2) { + if (ts2.hasProperty(value2, key)) { + str2 += "".concat(key, ": ").concat(compilerOptionValueToString(value2[key])); + } + } + return str2 + "}"; + } + function getKeyForCompilationSettings(settings) { + return ts2.sourceFileAffectingCompilerOptions.map(function(option) { + return compilerOptionValueToString(ts2.getCompilerOptionValue(settings, option)); + }).join("|") + (settings.pathsBasePath ? "|".concat(settings.pathsBasePath) : void 0); + } + function getDocumentRegistryBucketKeyWithMode(key, mode) { + return mode ? "".concat(key, "|").concat(mode) : key; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var FindAllReferences; + (function(FindAllReferences2) { + function createImportTracker(sourceFiles, sourceFilesSet, checker, cancellationToken) { + var allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return function(exportSymbol, exportInfo, isForRename) { + var _a2 = getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, exportInfo, checker, cancellationToken), directImports = _a2.directImports, indirectUsers = _a2.indirectUsers; + return __assign16({ indirectUsers }, getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename)); + }; + } + FindAllReferences2.createImportTracker = createImportTracker; + var ExportKind; + (function(ExportKind2) { + ExportKind2[ExportKind2["Named"] = 0] = "Named"; + ExportKind2[ExportKind2["Default"] = 1] = "Default"; + ExportKind2[ExportKind2["ExportEquals"] = 2] = "ExportEquals"; + })(ExportKind = FindAllReferences2.ExportKind || (FindAllReferences2.ExportKind = {})); + var ImportExport; + (function(ImportExport2) { + ImportExport2[ImportExport2["Import"] = 0] = "Import"; + ImportExport2[ImportExport2["Export"] = 1] = "Export"; + })(ImportExport = FindAllReferences2.ImportExport || (FindAllReferences2.ImportExport = {})); + function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, _a2, checker, cancellationToken) { + var exportingModuleSymbol = _a2.exportingModuleSymbol, exportKind = _a2.exportKind; + var markSeenDirectImport = ts2.nodeSeenTracker(); + var markSeenIndirectUser = ts2.nodeSeenTracker(); + var directImports = []; + var isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + var indirectUserDeclarations = isAvailableThroughGlobal ? void 0 : []; + handleDirectImports(exportingModuleSymbol); + return { directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + return sourceFiles; + } + if (exportingModuleSymbol.declarations) { + for (var _i = 0, _a3 = exportingModuleSymbol.declarations; _i < _a3.length; _i++) { + var decl = _a3[_i]; + if (ts2.isExternalModuleAugmentation(decl) && sourceFilesSet.has(decl.getSourceFile().fileName)) { + addIndirectUser(decl); + } + } + } + return indirectUserDeclarations.map(ts2.getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol2) { + var theseDirectImports = getDirectImports(exportingModuleSymbol2); + if (theseDirectImports) { + for (var _i = 0, theseDirectImports_1 = theseDirectImports; _i < theseDirectImports_1.length; _i++) { + var direct = theseDirectImports_1[_i]; + if (!markSeenDirectImport(direct)) { + continue; + } + if (cancellationToken) + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 210: + if (ts2.isImportCall(direct)) { + handleImportCall(direct); + break; + } + if (!isAvailableThroughGlobal) { + var parent2 = direct.parent; + if (exportKind === 2 && parent2.kind === 257) { + var name2 = parent2.name; + if (name2.kind === 79) { + directImports.push(name2); + break; + } + } + } + break; + case 79: + break; + case 268: + handleNamespaceImport( + direct, + direct.name, + ts2.hasSyntacticModifier( + direct, + 1 + /* ModifierFlags.Export */ + ), + /*alreadyAddedDirect*/ + false + ); + break; + case 269: + directImports.push(direct); + var namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 271) { + handleNamespaceImport( + direct, + namedBindings.name, + /*isReExport*/ + false, + /*alreadyAddedDirect*/ + true + ); + } else if (!isAvailableThroughGlobal && ts2.isDefaultImport(direct)) { + addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); + } + break; + case 275: + if (!direct.exportClause) { + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } else if (direct.exportClause.kind === 277) { + addIndirectUser( + getSourceFileLikeForImportDeclaration(direct), + /** addTransitiveDependencies */ + true + ); + } else { + directImports.push(direct); + } + break; + case 202: + if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) { + addIndirectUser( + direct.getSourceFile(), + /** addTransitiveDependencies */ + true + ); + } + directImports.push(direct); + break; + default: + ts2.Debug.failBadSyntaxKind(direct, "Unexpected import kind."); + } + } + } + } + function handleImportCall(importCall) { + var top = ts2.findAncestor(importCall, isAmbientModuleDeclaration) || importCall.getSourceFile(); + addIndirectUser( + top, + /** addTransitiveDependencies */ + !!isExported( + importCall, + /** stopAtAmbientModule */ + true + ) + ); + } + function isExported(node, stopAtAmbientModule) { + if (stopAtAmbientModule === void 0) { + stopAtAmbientModule = false; + } + return ts2.findAncestor(node, function(node2) { + if (stopAtAmbientModule && isAmbientModuleDeclaration(node2)) + return "quit"; + return ts2.canHaveModifiers(node2) && ts2.some(node2.modifiers, ts2.isExportModifier); + }); + } + function handleNamespaceImport(importDeclaration, name2, isReExport, alreadyAddedDirect) { + if (exportKind === 2) { + if (!alreadyAddedDirect) + directImports.push(importDeclaration); + } else if (!isAvailableThroughGlobal) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + ts2.Debug.assert( + sourceFileLike.kind === 308 || sourceFileLike.kind === 264 + /* SyntaxKind.ModuleDeclaration */ + ); + if (isReExport || findNamespaceReExports(sourceFileLike, name2, checker)) { + addIndirectUser( + sourceFileLike, + /** addTransitiveDependencies */ + true + ); + } else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike, addTransitiveDependencies) { + if (addTransitiveDependencies === void 0) { + addTransitiveDependencies = false; + } + ts2.Debug.assert(!isAvailableThroughGlobal); + var isNew = markSeenIndirectUser(sourceFileLike); + if (!isNew) + return; + indirectUserDeclarations.push(sourceFileLike); + if (!addTransitiveDependencies) + return; + var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + if (!moduleSymbol) + return; + ts2.Debug.assert(!!(moduleSymbol.flags & 1536)); + var directImports2 = getDirectImports(moduleSymbol); + if (directImports2) { + for (var _i = 0, directImports_1 = directImports2; _i < directImports_1.length; _i++) { + var directImport = directImports_1[_i]; + if (!ts2.isImportTypeNode(directImport)) { + addIndirectUser( + getSourceFileLikeForImportDeclaration(directImport), + /** addTransitiveDependencies */ + true + ); + } + } + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(ts2.getSymbolId(moduleSymbol).toString()); + } + } + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + var importSearches = []; + var singleReferences = []; + function addSearch(location2, symbol) { + importSearches.push([location2, symbol]); + } + if (directImports) { + for (var _i = 0, directImports_2 = directImports; _i < directImports_2.length; _i++) { + var decl = directImports_2[_i]; + handleImport(decl); + } + } + return { importSearches, singleReferences }; + function handleImport(decl2) { + if (decl2.kind === 268) { + if (isExternalModuleImportEquals(decl2)) { + handleNamespaceImportLike(decl2.name); + } + return; + } + if (decl2.kind === 79) { + handleNamespaceImportLike(decl2); + return; + } + if (decl2.kind === 202) { + if (decl2.qualifier) { + var firstIdentifier = ts2.getFirstIdentifier(decl2.qualifier); + if (firstIdentifier.escapedText === ts2.symbolName(exportSymbol)) { + singleReferences.push(firstIdentifier); + } + } else if (exportKind === 2) { + singleReferences.push(decl2.argument.literal); + } + return; + } + if (decl2.moduleSpecifier.kind !== 10) { + return; + } + if (decl2.kind === 275) { + if (decl2.exportClause && ts2.isNamedExports(decl2.exportClause)) { + searchForNamedImport(decl2.exportClause); + } + return; + } + var _a2 = decl2.importClause || { name: void 0, namedBindings: void 0 }, name2 = _a2.name, namedBindings = _a2.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 271: + handleNamespaceImportLike(namedBindings.name); + break; + case 272: + if (exportKind === 0 || exportKind === 1) { + searchForNamedImport(namedBindings); + } + break; + default: + ts2.Debug.assertNever(namedBindings); + } + } + if (name2 && (exportKind === 1 || exportKind === 2) && (!isForRename || name2.escapedText === ts2.symbolEscapedNameNoDefault(exportSymbol))) { + var defaultImportAlias = checker.getSymbolAtLocation(name2); + addSearch(name2, defaultImportAlias); + } + } + function handleNamespaceImportLike(importName) { + if (exportKind === 2 && (!isForRename || isNameMatch(importName.escapedText))) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (!namedBindings) { + return; + } + for (var _i2 = 0, _a2 = namedBindings.elements; _i2 < _a2.length; _i2++) { + var element = _a2[_i2]; + var name2 = element.name, propertyName = element.propertyName; + if (!isNameMatch((propertyName || name2).escapedText)) { + continue; + } + if (propertyName) { + singleReferences.push(propertyName); + if (!isForRename || name2.escapedText === exportSymbol.escapedName) { + addSearch(name2, checker.getSymbolAtLocation(name2)); + } + } else { + var localSymbol = element.kind === 278 && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name2); + addSearch(name2, localSymbol); + } + } + } + function isNameMatch(name2) { + return name2 === exportSymbol.escapedName || exportKind !== 0 && name2 === "default"; + } + } + function findNamespaceReExports(sourceFileLike, name2, checker) { + var namespaceImportSymbol = checker.getSymbolAtLocation(name2); + return !!forEachPossibleImportOrExportStatement(sourceFileLike, function(statement) { + if (!ts2.isExportDeclaration(statement)) + return; + var exportClause = statement.exportClause, moduleSpecifier = statement.moduleSpecifier; + return !moduleSpecifier && exportClause && ts2.isNamedExports(exportClause) && exportClause.elements.some(function(element) { + return checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol; + }); + }); + } + function findModuleReferences(program, sourceFiles, searchModuleSymbol) { + var refs = []; + var checker = program.getTypeChecker(); + for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) { + var referencingFile = sourceFiles_1[_i]; + var searchSourceFile = searchModuleSymbol.valueDeclaration; + if ((searchSourceFile === null || searchSourceFile === void 0 ? void 0 : searchSourceFile.kind) === 308) { + for (var _a2 = 0, _b = referencingFile.referencedFiles; _a2 < _b.length; _a2++) { + var ref = _b[_a2]; + if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { + refs.push({ kind: "reference", referencingFile, ref }); + } + } + for (var _c = 0, _d = referencingFile.typeReferenceDirectives; _c < _d.length; _c++) { + var ref = _d[_c]; + var referenced = program.getResolvedTypeReferenceDirectives().get(ref.fileName, ref.resolutionMode || referencingFile.impliedNodeFormat); + if (referenced !== void 0 && referenced.resolvedFileName === searchSourceFile.fileName) { + refs.push({ kind: "reference", referencingFile, ref }); + } + } + } + forEachImport(referencingFile, function(_importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol === searchModuleSymbol) { + refs.push({ kind: "import", literal: moduleSpecifier }); + } + }); + } + return refs; + } + FindAllReferences2.findModuleReferences = findModuleReferences; + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + var map4 = new ts2.Map(); + for (var _i = 0, sourceFiles_2 = sourceFiles; _i < sourceFiles_2.length; _i++) { + var sourceFile = sourceFiles_2[_i]; + if (cancellationToken) + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, function(importDecl, moduleSpecifier) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + var id = ts2.getSymbolId(moduleSymbol).toString(); + var imports = map4.get(id); + if (!imports) { + map4.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map4; + } + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return ts2.forEach(sourceFileLike.kind === 308 ? sourceFileLike.statements : sourceFileLike.body.statements, function(statement) { + return action(statement) || isAmbientModuleDeclaration(statement) && ts2.forEach(statement.body && statement.body.statements, action); + }); + } + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) { + for (var _i = 0, _a2 = sourceFile.imports; _i < _a2.length; _i++) { + var i7 = _a2[_i]; + action(ts2.importFromModuleSpecifier(i7), i7); + } + } else { + forEachPossibleImportOrExportStatement(sourceFile, function(statement) { + switch (statement.kind) { + case 275: + case 269: { + var decl = statement; + if (decl.moduleSpecifier && ts2.isStringLiteral(decl.moduleSpecifier)) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 268: { + var decl = statement; + if (isExternalModuleImportEquals(decl)) { + action(decl, decl.moduleReference.expression); + } + break; + } + } + }); + } + } + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var _a2; + var parent2 = node.parent; + var grandparent = parent2.parent; + if (symbol.exportSymbol) { + if (parent2.kind === 208) { + return ((_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.some(function(d7) { + return d7 === parent2; + })) && ts2.isBinaryExpression(grandparent) ? getSpecialPropertyExport( + grandparent, + /*useLhsSymbol*/ + false + ) : void 0; + } else { + return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent2)); + } + } else { + var exportNode = getExportNode(parent2, node); + if (exportNode && ts2.hasSyntacticModifier( + exportNode, + 1 + /* ModifierFlags.Export */ + )) { + if (ts2.isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) { + if (comingFromExport) { + return void 0; + } + var lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0, symbol: lhsSymbol }; + } else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } else if (ts2.isNamespaceExport(parent2)) { + return exportInfo( + symbol, + 0 + /* ExportKind.Named */ + ); + } else if (ts2.isExportAssignment(parent2)) { + return getExportAssignmentExport(parent2); + } else if (ts2.isExportAssignment(grandparent)) { + return getExportAssignmentExport(grandparent); + } else if (ts2.isBinaryExpression(parent2)) { + return getSpecialPropertyExport( + parent2, + /*useLhsSymbol*/ + true + ); + } else if (ts2.isBinaryExpression(grandparent)) { + return getSpecialPropertyExport( + grandparent, + /*useLhsSymbol*/ + true + ); + } else if (ts2.isJSDocTypedefTag(parent2)) { + return exportInfo( + symbol, + 0 + /* ExportKind.Named */ + ); + } + } + function getExportAssignmentExport(ex) { + if (!ex.symbol.parent) + return void 0; + var exportKind = ex.isExportEquals ? 2 : 1; + return { kind: 1, symbol, exportInfo: { exportingModuleSymbol: ex.symbol.parent, exportKind } }; + } + function getSpecialPropertyExport(node2, useLhsSymbol) { + var kind; + switch (ts2.getAssignmentDeclarationKind(node2)) { + case 1: + kind = 0; + break; + case 2: + kind = 2; + break; + default: + return void 0; + } + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts2.getNameOfAccessExpression(ts2.cast(node2.left, ts2.isAccessExpression))) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + var isImport = isNodeImport(node); + if (!isImport) + return void 0; + var importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (!importedSymbol) + return void 0; + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + if (importedSymbol.escapedName === "export=") { + importedSymbol = getExportEqualsLocalSymbol(importedSymbol, checker); + if (importedSymbol === void 0) + return void 0; + } + var importedName = ts2.symbolEscapedNameNoDefault(importedSymbol); + if (importedName === void 0 || importedName === "default" || importedName === symbol.escapedName) { + return { kind: 0, symbol: importedSymbol }; + } + } + function exportInfo(symbol2, kind) { + var exportInfo2 = getExportInfo(symbol2, kind, checker); + return exportInfo2 && { kind: 1, symbol: symbol2, exportInfo: exportInfo2 }; + } + function getExportKindForDeclaration(node2) { + return ts2.hasSyntacticModifier( + node2, + 1024 + /* ModifierFlags.Default */ + ) ? 1 : 0; + } + } + FindAllReferences2.getImportOrExportSymbol = getImportOrExportSymbol; + function getExportEqualsLocalSymbol(importedSymbol, checker) { + if (importedSymbol.flags & 2097152) { + return checker.getImmediateAliasedSymbol(importedSymbol); + } + var decl = ts2.Debug.checkDefined(importedSymbol.valueDeclaration); + if (ts2.isExportAssignment(decl)) { + return decl.expression.symbol; + } else if (ts2.isBinaryExpression(decl)) { + return decl.right.symbol; + } else if (ts2.isSourceFile(decl)) { + return decl.symbol; + } + return void 0; + } + function getExportNode(parent2, node) { + var declaration = ts2.isVariableDeclaration(parent2) ? parent2 : ts2.isBindingElement(parent2) ? ts2.walkUpBindingElementsAndPatterns(parent2) : void 0; + if (declaration) { + return parent2.name !== node ? void 0 : ts2.isCatchClause(declaration.parent) ? void 0 : ts2.isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : void 0; + } else { + return parent2; + } + } + function isNodeImport(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 268: + return parent2.name === node && isExternalModuleImportEquals(parent2); + case 273: + return !parent2.propertyName; + case 270: + case 271: + ts2.Debug.assert(parent2.name === node); + return true; + case 205: + return ts2.isInJSFile(node) && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(parent2.parent.parent); + default: + return false; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return void 0; + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); + return ts2.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : void 0; + } + FindAllReferences2.getExportInfo = getExportInfo; + function skipExportSpecifierSymbol(symbol, checker) { + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (ts2.isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration); + } else if (ts2.isPropertyAccessExpression(declaration) && ts2.isModuleExportsAccessExpression(declaration.expression) && !ts2.isPrivateIdentifier(declaration.name)) { + return checker.getSymbolAtLocation(declaration); + } else if (ts2.isShorthandPropertyAssignment(declaration) && ts2.isBinaryExpression(declaration.parent.parent) && ts2.getAssignmentDeclarationKind(declaration.parent.parent) === 2) { + return checker.getExportSpecifierLocalTargetSymbol(declaration.name); + } + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 210) { + return node.getSourceFile(); + } + var parent2 = node.parent; + if (parent2.kind === 308) { + return parent2; + } + ts2.Debug.assert( + parent2.kind === 265 + /* SyntaxKind.ModuleBlock */ + ); + return ts2.cast(parent2.parent, isAmbientModuleDeclaration); + } + function isAmbientModuleDeclaration(node) { + return node.kind === 264 && node.name.kind === 10; + } + function isExternalModuleImportEquals(eq2) { + return eq2.moduleReference.kind === 280 && eq2.moduleReference.expression.kind === 10; + } + })(FindAllReferences = ts2.FindAllReferences || (ts2.FindAllReferences = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var FindAllReferences; + (function(FindAllReferences2) { + var DefinitionKind; + (function(DefinitionKind2) { + DefinitionKind2[DefinitionKind2["Symbol"] = 0] = "Symbol"; + DefinitionKind2[DefinitionKind2["Label"] = 1] = "Label"; + DefinitionKind2[DefinitionKind2["Keyword"] = 2] = "Keyword"; + DefinitionKind2[DefinitionKind2["This"] = 3] = "This"; + DefinitionKind2[DefinitionKind2["String"] = 4] = "String"; + DefinitionKind2[DefinitionKind2["TripleSlashReference"] = 5] = "TripleSlashReference"; + })(DefinitionKind = FindAllReferences2.DefinitionKind || (FindAllReferences2.DefinitionKind = {})); + var EntryKind; + (function(EntryKind2) { + EntryKind2[EntryKind2["Span"] = 0] = "Span"; + EntryKind2[EntryKind2["Node"] = 1] = "Node"; + EntryKind2[EntryKind2["StringLiteral"] = 2] = "StringLiteral"; + EntryKind2[EntryKind2["SearchedLocalFoundProperty"] = 3] = "SearchedLocalFoundProperty"; + EntryKind2[EntryKind2["SearchedPropertyFoundLocal"] = 4] = "SearchedPropertyFoundLocal"; + })(EntryKind = FindAllReferences2.EntryKind || (FindAllReferences2.EntryKind = {})); + function nodeEntry(node, kind) { + if (kind === void 0) { + kind = 1; + } + return { + kind, + node: node.name || node, + context: getContextNodeForNodeEntry(node) + }; + } + FindAllReferences2.nodeEntry = nodeEntry; + function isContextWithStartAndEndNode(node) { + return node && node.kind === void 0; + } + FindAllReferences2.isContextWithStartAndEndNode = isContextWithStartAndEndNode; + function getContextNodeForNodeEntry(node) { + if (ts2.isDeclaration(node)) { + return getContextNode(node); + } + if (!node.parent) + return void 0; + if (!ts2.isDeclaration(node.parent) && !ts2.isExportAssignment(node.parent)) { + if (ts2.isInJSFile(node)) { + var binaryExpression = ts2.isBinaryExpression(node.parent) ? node.parent : ts2.isAccessExpression(node.parent) && ts2.isBinaryExpression(node.parent.parent) && node.parent.parent.left === node.parent ? node.parent.parent : void 0; + if (binaryExpression && ts2.getAssignmentDeclarationKind(binaryExpression) !== 0) { + return getContextNode(binaryExpression); + } + } + if (ts2.isJsxOpeningElement(node.parent) || ts2.isJsxClosingElement(node.parent)) { + return node.parent.parent; + } else if (ts2.isJsxSelfClosingElement(node.parent) || ts2.isLabeledStatement(node.parent) || ts2.isBreakOrContinueStatement(node.parent)) { + return node.parent; + } else if (ts2.isStringLiteralLike(node)) { + var validImport = ts2.tryGetImportFromModuleSpecifier(node); + if (validImport) { + var declOrStatement = ts2.findAncestor(validImport, function(node2) { + return ts2.isDeclaration(node2) || ts2.isStatement(node2) || ts2.isJSDocTag(node2); + }); + return ts2.isDeclaration(declOrStatement) ? getContextNode(declOrStatement) : declOrStatement; + } + } + var propertyName = ts2.findAncestor(node, ts2.isComputedPropertyName); + return propertyName ? getContextNode(propertyName.parent) : void 0; + } + if (node.parent.name === node || // node is name of declaration, use parent + ts2.isConstructorDeclaration(node.parent) || ts2.isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent + (ts2.isImportOrExportSpecifier(node.parent) || ts2.isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export + node.kind === 88 && ts2.hasSyntacticModifier( + node.parent, + 1025 + /* ModifierFlags.ExportDefault */ + )) { + return getContextNode(node.parent); + } + return void 0; + } + function getContextNode(node) { + if (!node) + return void 0; + switch (node.kind) { + case 257: + return !ts2.isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : ts2.isVariableStatement(node.parent.parent) ? node.parent.parent : ts2.isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; + case 205: + return getContextNode(node.parent.parent); + case 273: + return node.parent.parent.parent; + case 278: + case 271: + return node.parent.parent; + case 270: + case 277: + return node.parent; + case 223: + return ts2.isExpressionStatement(node.parent) ? node.parent : node; + case 247: + case 246: + return { + start: node.initializer, + end: node.expression + }; + case 299: + case 300: + return ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(ts2.findAncestor(node.parent, function(node2) { + return ts2.isBinaryExpression(node2) || ts2.isForInOrOfStatement(node2); + })) : node; + default: + return node; + } + } + FindAllReferences2.getContextNode = getContextNode; + function toContextSpan(textSpan, sourceFile, context2) { + if (!context2) + return void 0; + var contextSpan = isContextWithStartAndEndNode(context2) ? getTextSpan(context2.start, sourceFile, context2.end) : getTextSpan(context2, sourceFile); + return contextSpan.start !== textSpan.start || contextSpan.length !== textSpan.length ? { contextSpan } : void 0; + } + FindAllReferences2.toContextSpan = toContextSpan; + var FindReferencesUse; + (function(FindReferencesUse2) { + FindReferencesUse2[FindReferencesUse2["Other"] = 0] = "Other"; + FindReferencesUse2[FindReferencesUse2["References"] = 1] = "References"; + FindReferencesUse2[FindReferencesUse2["Rename"] = 2] = "Rename"; + })(FindReferencesUse = FindAllReferences2.FindReferencesUse || (FindAllReferences2.FindReferencesUse = {})); + function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts2.getTouchingPropertyName(sourceFile, position); + var options = { + use: 1 + /* FindReferencesUse.References */ + }; + var referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); + var checker = program.getTypeChecker(); + var adjustedNode = Core.getAdjustedNode(node, options); + var symbol = isDefinitionForReference(adjustedNode) ? checker.getSymbolAtLocation(adjustedNode) : void 0; + return !referencedSymbols || !referencedSymbols.length ? void 0 : ts2.mapDefined(referencedSymbols, function(_a2) { + var definition = _a2.definition, references = _a2.references; + return definition && { + definition: checker.runWithCancellationToken(cancellationToken, function(checker2) { + return definitionToReferencedSymbolDefinitionInfo(definition, checker2, node); + }), + references: references.map(function(r8) { + return toReferencedSymbolEntry(r8, symbol); + }) + }; + }); + } + FindAllReferences2.findReferencedSymbols = findReferencedSymbols; + function isDefinitionForReference(node) { + return node.kind === 88 || !!ts2.getDeclarationFromName(node) || ts2.isLiteralComputedPropertyDeclarationName(node) || node.kind === 135 && ts2.isConstructorDeclaration(node.parent); + } + function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { + var node = ts2.getTouchingPropertyName(sourceFile, position); + var referenceEntries; + var entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); + if (node.parent.kind === 208 || node.parent.kind === 205 || node.parent.kind === 209 || node.kind === 106) { + referenceEntries = entries && __spreadArray9([], entries, true); + } else if (entries) { + var queue3 = ts2.createQueue(entries); + var seenNodes = new ts2.Map(); + while (!queue3.isEmpty()) { + var entry = queue3.dequeue(); + if (!ts2.addToSeen(seenNodes, ts2.getNodeId(entry.node))) { + continue; + } + referenceEntries = ts2.append(referenceEntries, entry); + var entries_1 = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, entry.node, entry.node.pos); + if (entries_1) { + queue3.enqueue.apply(queue3, entries_1); + } + } + } + var checker = program.getTypeChecker(); + return ts2.map(referenceEntries, function(entry2) { + return toImplementationLocation(entry2, checker); + }); + } + FindAllReferences2.getImplementationsAtPosition = getImplementationsAtPosition; + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 308) { + return void 0; + } + var checker = program.getTypeChecker(); + if (node.parent.kind === 300) { + var result_2 = []; + Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function(node2) { + return result_2.push(nodeEntry(node2)); + }); + return result_2; + } else if (node.kind === 106 || ts2.isSuperProperty(node.parent)) { + var symbol = checker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } else { + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { + implementations: true, + use: 1 + /* FindReferencesUse.References */ + }); + } + } + function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { + return ts2.map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), function(entry) { + return convertEntry(entry, node, program.getTypeChecker()); + }); + } + FindAllReferences2.findReferenceOrRenameEntries = findReferenceOrRenameEntries; + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + if (options === void 0) { + options = {}; + } + if (sourceFilesSet === void 0) { + sourceFilesSet = new ts2.Set(sourceFiles.map(function(f8) { + return f8.fileName; + })); + } + return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet)); + } + FindAllReferences2.getReferenceEntriesForNode = getReferenceEntriesForNode; + function flattenEntries(referenceSymbols) { + return referenceSymbols && ts2.flatMap(referenceSymbols, function(r8) { + return r8.references; + }); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) { + var info2 = function() { + switch (def.type) { + case 0: { + var symbol = def.symbol; + var _a2 = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a2.displayParts, kind_1 = _a2.kind; + var name_1 = displayParts_1.map(function(p7) { + return p7.text; + }).join(""); + var declaration = symbol.declarations && ts2.firstOrUndefined(symbol.declarations); + var node = declaration ? ts2.getNameOfDeclaration(declaration) || declaration : originalNode; + return __assign16(__assign16({}, getFileAndTextSpanFromNode(node)), { name: name_1, kind: kind_1, displayParts: displayParts_1, context: getContextNode(declaration) }); + } + case 1: { + var node = def.node; + return __assign16(__assign16({}, getFileAndTextSpanFromNode(node)), { name: node.text, kind: "label", displayParts: [ts2.displayPart(node.text, ts2.SymbolDisplayPartKind.text)] }); + } + case 2: { + var node = def.node; + var name_2 = ts2.tokenToString(node.kind); + return __assign16(__assign16({}, getFileAndTextSpanFromNode(node)), { name: name_2, kind: "keyword", displayParts: [{ + text: name_2, + kind: "keyword" + /* ScriptElementKind.keyword */ + }] }); + } + case 3: { + var node = def.node; + var symbol = checker.getSymbolAtLocation(node); + var displayParts_2 = symbol && ts2.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts2.getContainerNode(node), node).displayParts || [ts2.textPart("this")]; + return __assign16(__assign16({}, getFileAndTextSpanFromNode(node)), { name: "this", kind: "var", displayParts: displayParts_2 }); + } + case 4: { + var node = def.node; + return __assign16(__assign16({}, getFileAndTextSpanFromNode(node)), { name: node.text, kind: "var", displayParts: [ts2.displayPart(ts2.getTextOfNode(node), ts2.SymbolDisplayPartKind.stringLiteral)] }); + } + case 5: { + return { + textSpan: ts2.createTextSpanFromRange(def.reference), + sourceFile: def.file, + name: def.reference.fileName, + kind: "string", + displayParts: [ts2.displayPart('"'.concat(def.reference.fileName, '"'), ts2.SymbolDisplayPartKind.stringLiteral)] + }; + } + default: + return ts2.Debug.assertNever(def); + } + }(); + var sourceFile = info2.sourceFile, textSpan = info2.textSpan, name2 = info2.name, kind = info2.kind, displayParts = info2.displayParts, context2 = info2.context; + return __assign16({ containerKind: "", containerName: "", fileName: sourceFile.fileName, kind, name: name2, textSpan, displayParts }, toContextSpan(textSpan, sourceFile, context2)); + } + function getFileAndTextSpanFromNode(node) { + var sourceFile = node.getSourceFile(); + return { + sourceFile, + textSpan: getTextSpan(ts2.isComputedPropertyName(node) ? node.expression : node, sourceFile) + }; + } + function getDefinitionKindAndDisplayParts(symbol, checker, node) { + var meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol); + var enclosingDeclaration = symbol.declarations && ts2.firstOrUndefined(symbol.declarations) || node; + var _a2 = ts2.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a2.displayParts, symbolKind = _a2.symbolKind; + return { displayParts, kind: symbolKind }; + } + function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText) { + return __assign16(__assign16({}, entryToDocumentSpan(entry)), providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker)); + } + FindAllReferences2.toRenameLocation = toRenameLocation; + function toReferencedSymbolEntry(entry, symbol) { + var referenceEntry = toReferenceEntry(entry); + if (!symbol) + return referenceEntry; + return __assign16(__assign16({}, referenceEntry), { isDefinition: entry.kind !== 0 && isDeclarationOfSymbol(entry.node, symbol) }); + } + function toReferenceEntry(entry) { + var documentSpan = entryToDocumentSpan(entry); + if (entry.kind === 0) { + return __assign16(__assign16({}, documentSpan), { isWriteAccess: false }); + } + var kind = entry.kind, node = entry.node; + return __assign16(__assign16({}, documentSpan), { isWriteAccess: isWriteAccessForReference(node), isInString: kind === 2 ? true : void 0 }); + } + FindAllReferences2.toReferenceEntry = toReferenceEntry; + function entryToDocumentSpan(entry) { + if (entry.kind === 0) { + return { textSpan: entry.textSpan, fileName: entry.fileName }; + } else { + var sourceFile = entry.node.getSourceFile(); + var textSpan = getTextSpan(entry.node, sourceFile); + return __assign16({ textSpan, fileName: sourceFile.fileName }, toContextSpan(textSpan, sourceFile, entry.context)); + } + } + function getPrefixAndSuffixText(entry, originalNode, checker) { + if (entry.kind !== 0 && ts2.isIdentifier(originalNode)) { + var node = entry.node, kind = entry.kind; + var parent2 = node.parent; + var name2 = originalNode.text; + var isShorthandAssignment = ts2.isShorthandPropertyAssignment(parent2); + if (isShorthandAssignment || ts2.isObjectBindingElementWithoutPropertyName(parent2) && parent2.name === node && parent2.dotDotDotToken === void 0) { + var prefixColon = { prefixText: name2 + ": " }; + var suffixColon = { suffixText: ": " + name2 }; + if (kind === 3) { + return prefixColon; + } + if (kind === 4) { + return suffixColon; + } + if (isShorthandAssignment) { + var grandParent = parent2.parent; + if (ts2.isObjectLiteralExpression(grandParent) && ts2.isBinaryExpression(grandParent.parent) && ts2.isModuleExportsAccessExpression(grandParent.parent.left)) { + return prefixColon; + } + return suffixColon; + } else { + return prefixColon; + } + } else if (ts2.isImportSpecifier(parent2) && !parent2.propertyName) { + var originalSymbol = ts2.isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return ts2.contains(originalSymbol.declarations, parent2) ? { prefixText: name2 + " as " } : ts2.emptyOptions; + } else if (ts2.isExportSpecifier(parent2) && !parent2.propertyName) { + return originalNode === entry.node || checker.getSymbolAtLocation(originalNode) === checker.getSymbolAtLocation(entry.node) ? { prefixText: name2 + " as " } : { suffixText: " as " + name2 }; + } + } + return ts2.emptyOptions; + } + function toImplementationLocation(entry, checker) { + var documentSpan = entryToDocumentSpan(entry); + if (entry.kind !== 0) { + var node = entry.node; + return __assign16(__assign16({}, documentSpan), implementationKindDisplayParts(node, checker)); + } else { + return __assign16(__assign16({}, documentSpan), { kind: "", displayParts: [] }); + } + } + function implementationKindDisplayParts(node, checker) { + var symbol = checker.getSymbolAtLocation(ts2.isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, checker, node); + } else if (node.kind === 207) { + return { + kind: "interface", + displayParts: [ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + ), ts2.textPart("object literal"), ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )] + }; + } else if (node.kind === 228) { + return { + kind: "local class", + displayParts: [ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + ), ts2.textPart("anonymous local class"), ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )] + }; + } else { + return { kind: ts2.getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + var documentSpan = entryToDocumentSpan(entry); + if (entry.kind === 0) { + return { + fileName: documentSpan.fileName, + span: { + textSpan: documentSpan.textSpan, + kind: "reference" + /* HighlightSpanKind.reference */ + } + }; + } + var writeAccess = isWriteAccessForReference(entry.node); + var span = __assign16({ textSpan: documentSpan.textSpan, kind: writeAccess ? "writtenReference" : "reference", isInString: entry.kind === 2 ? true : void 0 }, documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan }); + return { fileName: documentSpan.fileName, span }; + } + FindAllReferences2.toHighlightSpan = toHighlightSpan; + function getTextSpan(node, sourceFile, endNode) { + var start = node.getStart(sourceFile); + var end = (endNode || node).getEnd(); + if (ts2.isStringLiteralLike(node) && end - start > 2) { + ts2.Debug.assert(endNode === void 0); + start += 1; + end -= 1; + } + return ts2.createTextSpanFromBounds(start, end); + } + function getTextSpanOfEntry(entry) { + return entry.kind === 0 ? entry.textSpan : getTextSpan(entry.node, entry.node.getSourceFile()); + } + FindAllReferences2.getTextSpanOfEntry = getTextSpanOfEntry; + function isWriteAccessForReference(node) { + var decl = ts2.getDeclarationFromName(node); + return !!decl && declarationIsWriteAccess(decl) || node.kind === 88 || ts2.isWriteAccess(node); + } + function isDeclarationOfSymbol(node, target) { + var _a2; + if (!target) + return false; + var source = ts2.getDeclarationFromName(node) || (node.kind === 88 ? node.parent : ts2.isLiteralComputedPropertyDeclarationName(node) ? node.parent.parent : node.kind === 135 && ts2.isConstructorDeclaration(node.parent) ? node.parent.parent : void 0); + var commonjsSource = source && ts2.isBinaryExpression(source) ? source.left : void 0; + return !!(source && ((_a2 = target.declarations) === null || _a2 === void 0 ? void 0 : _a2.some(function(d7) { + return d7 === source || d7 === commonjsSource; + }))); + } + FindAllReferences2.isDeclarationOfSymbol = isDeclarationOfSymbol; + function declarationIsWriteAccess(decl) { + if (!!(decl.flags & 16777216)) + return true; + switch (decl.kind) { + case 223: + case 205: + case 260: + case 228: + case 88: + case 263: + case 302: + case 278: + case 270: + case 268: + case 273: + case 261: + case 341: + case 348: + case 288: + case 264: + case 267: + case 271: + case 277: + case 166: + case 300: + case 262: + case 165: + return true; + case 299: + return !ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); + case 259: + case 215: + case 173: + case 171: + case 174: + case 175: + return !!decl.body; + case 257: + case 169: + return !!decl.initializer || ts2.isCatchClause(decl.parent); + case 170: + case 168: + case 350: + case 343: + return false; + default: + return ts2.Debug.failBadSyntaxKind(decl); + } + } + var Core; + (function(Core2) { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + var _a2, _b; + if (options === void 0) { + options = {}; + } + if (sourceFilesSet === void 0) { + sourceFilesSet = new ts2.Set(sourceFiles.map(function(f8) { + return f8.fileName; + })); + } + node = getAdjustedNode(node, options); + if (ts2.isSourceFile(node)) { + var resolvedRef = ts2.GoToDefinition.getReferenceAtPosition(node, position, program); + if (!(resolvedRef === null || resolvedRef === void 0 ? void 0 : resolvedRef.file)) { + return void 0; + } + var moduleSymbol = program.getTypeChecker().getMergedSymbol(resolvedRef.file.symbol); + if (moduleSymbol) { + return getReferencedSymbolsForModule( + program, + moduleSymbol, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + ); + } + var fileIncludeReasons = program.getFileIncludeReasons(); + if (!fileIncludeReasons) { + return void 0; + } + return [{ + definition: { type: 5, reference: resolvedRef.reference, file: node }, + references: getReferencesForNonModule(resolvedRef.file, fileIncludeReasons, program) || ts2.emptyArray + }]; + } + if (!options.implementations) { + var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + var checker = program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(ts2.isConstructorDeclaration(node) && node.parent.name || node); + if (!symbol) { + if (!options.implementations && ts2.isStringLiteralLike(node)) { + if (ts2.isModuleSpecifierLike(node)) { + var fileIncludeReasons = program.getFileIncludeReasons(); + var referencedFileName = (_b = (_a2 = node.getSourceFile().resolvedModules) === null || _a2 === void 0 ? void 0 : _a2.get(node.text, ts2.getModeForUsageLocation(node.getSourceFile(), node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName; + var referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0; + if (referencedFile) { + return [{ definition: { type: 4, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || ts2.emptyArray }]; + } + } + return getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken); + } + return void 0; + } + if (symbol.escapedName === "export=") { + return getReferencedSymbolsForModule( + program, + symbol.parent, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + ); + } + var moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + if (moduleReferences && !(symbol.flags & 33554432)) { + return moduleReferences; + } + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker); + var moduleReferencesOfExportTarget = aliasedSymbol && getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + var references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options); + return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget); + } + Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + function getAdjustedNode(node, options) { + if (options.use === 1) { + node = ts2.getAdjustedReferenceLocation(node); + } else if (options.use === 2) { + node = ts2.getAdjustedRenameLocation(node); + } + return node; + } + Core2.getAdjustedNode = getAdjustedNode; + function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet) { + var _a2, _b; + if (sourceFilesSet === void 0) { + sourceFilesSet = new ts2.Set(sourceFiles.map(function(f8) { + return f8.fileName; + })); + } + var moduleSymbol = (_a2 = program.getSourceFile(fileName)) === null || _a2 === void 0 ? void 0 : _a2.symbol; + if (moduleSymbol) { + return ((_b = getReferencedSymbolsForModule( + program, + moduleSymbol, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + )[0]) === null || _b === void 0 ? void 0 : _b.references) || ts2.emptyArray; + } + var fileIncludeReasons = program.getFileIncludeReasons(); + var referencedFile = program.getSourceFile(fileName); + return referencedFile && fileIncludeReasons && getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || ts2.emptyArray; + } + Core2.getReferencesForFileName = getReferencesForFileName; + function getReferencesForNonModule(referencedFile, refFileMap, program) { + var entries; + var references = refFileMap.get(referencedFile.path) || ts2.emptyArray; + for (var _i = 0, references_1 = references; _i < references_1.length; _i++) { + var ref = references_1[_i]; + if (ts2.isReferencedFile(ref)) { + var referencingFile = program.getSourceFileByPath(ref.file); + var location2 = ts2.getReferencedFileLocation(program.getSourceFileByPath, ref); + if (ts2.isReferenceFileLocation(location2)) { + entries = ts2.append(entries, { + kind: 0, + fileName: referencingFile.fileName, + textSpan: ts2.createTextSpanFromRange(location2) + }); + } + } + } + return entries; + } + function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) { + if (node.parent && ts2.isNamespaceExportDeclaration(node.parent)) { + var aliasedSymbol = checker.getAliasedSymbol(symbol); + var targetSymbol = checker.getMergedSymbol(aliasedSymbol); + if (aliasedSymbol !== targetSymbol) { + return targetSymbol; + } + } + return void 0; + } + function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + var moduleSourceFile = symbol.flags & 1536 && symbol.declarations && ts2.find(symbol.declarations, ts2.isSourceFile); + if (!moduleSourceFile) + return void 0; + var exportEquals = symbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + var moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); + if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) + return moduleReferences; + var checker = program.getTypeChecker(); + symbol = ts2.skipAlias(exportEquals, checker); + return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol( + symbol, + /*node*/ + void 0, + sourceFiles, + sourceFilesSet, + checker, + cancellationToken, + options + )); + } + function mergeReferences(program) { + var referencesToMerge = []; + for (var _i = 1; _i < arguments.length; _i++) { + referencesToMerge[_i - 1] = arguments[_i]; + } + var result2; + for (var _a2 = 0, referencesToMerge_1 = referencesToMerge; _a2 < referencesToMerge_1.length; _a2++) { + var references = referencesToMerge_1[_a2]; + if (!references || !references.length) + continue; + if (!result2) { + result2 = references; + continue; + } + var _loop_3 = function(entry2) { + if (!entry2.definition || entry2.definition.type !== 0) { + result2.push(entry2); + return "continue"; + } + var symbol = entry2.definition.symbol; + var refIndex = ts2.findIndex(result2, function(ref) { + return !!ref.definition && ref.definition.type === 0 && ref.definition.symbol === symbol; + }); + if (refIndex === -1) { + result2.push(entry2); + return "continue"; + } + var reference = result2[refIndex]; + result2[refIndex] = { + definition: reference.definition, + references: reference.references.concat(entry2.references).sort(function(entry1, entry22) { + var entry1File = getSourceFileIndexOfEntry(program, entry1); + var entry2File = getSourceFileIndexOfEntry(program, entry22); + if (entry1File !== entry2File) { + return ts2.compareValues(entry1File, entry2File); + } + var entry1Span = getTextSpanOfEntry(entry1); + var entry2Span = getTextSpanOfEntry(entry22); + return entry1Span.start !== entry2Span.start ? ts2.compareValues(entry1Span.start, entry2Span.start) : ts2.compareValues(entry1Span.length, entry2Span.length); + }) + }; + }; + for (var _b = 0, references_2 = references; _b < references_2.length; _b++) { + var entry = references_2[_b]; + _loop_3(entry); + } + } + return result2; + } + function getSourceFileIndexOfEntry(program, entry) { + var sourceFile = entry.kind === 0 ? program.getSourceFile(entry.fileName) : entry.node.getSourceFile(); + return program.getSourceFiles().indexOf(sourceFile); + } + function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) { + ts2.Debug.assert(!!symbol.valueDeclaration); + var references = ts2.mapDefined(FindAllReferences2.findModuleReferences(program, sourceFiles, symbol), function(reference) { + if (reference.kind === "import") { + var parent2 = reference.literal.parent; + if (ts2.isLiteralTypeNode(parent2)) { + var importType = ts2.cast(parent2.parent, ts2.isImportTypeNode); + if (excludeImportTypeOfExportEquals && !importType.qualifier) { + return void 0; + } + } + return nodeEntry(reference.literal); + } else { + return { + kind: 0, + fileName: reference.referencingFile.fileName, + textSpan: ts2.createTextSpanFromRange(reference.ref) + }; + } + }); + if (symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + switch (decl.kind) { + case 308: + break; + case 264: + if (sourceFilesSet.has(decl.getSourceFile().fileName)) { + references.push(nodeEntry(decl.name)); + } + break; + default: + ts2.Debug.assert(!!(symbol.flags & 33554432), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); + } + } + } + var exported = symbol.exports.get( + "export=" + /* InternalSymbolName.ExportEquals */ + ); + if (exported === null || exported === void 0 ? void 0 : exported.declarations) { + for (var _b = 0, _c = exported.declarations; _b < _c.length; _b++) { + var decl = _c[_b]; + var sourceFile = decl.getSourceFile(); + if (sourceFilesSet.has(sourceFile.fileName)) { + var node = ts2.isBinaryExpression(decl) && ts2.isPropertyAccessExpression(decl.left) ? decl.left.expression : ts2.isExportAssignment(decl) ? ts2.Debug.checkDefined(ts2.findChildOfKind(decl, 93, sourceFile)) : ts2.getNameOfDeclaration(decl) || decl; + references.push(nodeEntry(node)); + } + } + } + return references.length ? [{ definition: { type: 0, symbol }, references }] : ts2.emptyArray; + } + function isReadonlyTypeOperator(node) { + return node.kind === 146 && ts2.isTypeOperatorNode(node.parent) && node.parent.operator === 146; + } + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (ts2.isTypeKeyword(node.kind)) { + if (node.kind === 114 && ts2.isVoidExpression(node.parent)) { + return void 0; + } + if (node.kind === 146 && !isReadonlyTypeOperator(node)) { + return void 0; + } + return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken, node.kind === 146 ? isReadonlyTypeOperator : void 0); + } + if (ts2.isImportMeta(node.parent) && node.parent.name === node) { + return getAllReferencesForImportMeta(sourceFiles, cancellationToken); + } + if (ts2.isStaticModifier(node) && ts2.isClassStaticBlockDeclaration(node.parent)) { + return [{ definition: { type: 2, node }, references: [nodeEntry(node)] }]; + } + if (ts2.isJumpStatementTarget(node)) { + var labelDefinition = ts2.getTargetLabel(node.parent, node.text); + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); + } else if (ts2.isLabelOfLabeledStatement(node)) { + return getLabelReferencesInNode(node.parent, node); + } + if (ts2.isThis(node)) { + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); + } + if (node.kind === 106) { + return getReferencesForSuperKeyword(node); + } + return void 0; + } + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + var symbol = node && skipPastExportOrImportSpecifierOrUnion( + originalSymbol, + node, + checker, + /*useLocalSymbolForExportSpecifier*/ + !isForRenameWithPrefixAndSuffixText(options) + ) || originalSymbol; + var searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7; + var result2 = []; + var state = new State2(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0, checker, cancellationToken, searchMeaning, options, result2); + var exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : ts2.find(symbol.declarations, ts2.isExportSpecifier); + if (exportSpecifier) { + getReferencesAtExportSpecifier( + exportSpecifier.name, + symbol, + exportSpecifier, + state.createSearch( + node, + originalSymbol, + /*comingFrom*/ + void 0 + ), + state, + /*addReferencesHere*/ + true, + /*alwaysGetReferences*/ + true + ); + } else if (node && node.kind === 88 && symbol.escapedName === "default" && symbol.parent) { + addReference(node, symbol, state); + searchForImportsOfExport(node, symbol, { + exportingModuleSymbol: symbol.parent, + exportKind: 1 + /* ExportKind.Default */ + }, state); + } else { + var search = state.createSearch( + node, + symbol, + /*comingFrom*/ + void 0, + { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, options.use === 2, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] } + ); + getReferencesInContainerOrFiles(symbol, state, search); + } + return result2; + } + function getReferencesInContainerOrFiles(symbol, state, search) { + var scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer( + scope, + scope.getSourceFile(), + search, + state, + /*addReferencesHere*/ + !(ts2.isSourceFile(scope) && !ts2.contains(state.sourceFiles, scope)) + ); + } else { + for (var _i = 0, _a2 = state.sourceFiles; _i < _a2.length; _i++) { + var sourceFile = _a2[_i]; + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + } + function getSpecialSearchKind(node) { + switch (node.kind) { + case 173: + case 135: + return 1; + case 79: + if (ts2.isClassLike(node.parent)) { + ts2.Debug.assert(node.parent.name === node); + return 2; + } + default: + return 0; + } + } + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { + var parent2 = node.parent; + if (ts2.isExportSpecifier(parent2) && useLocalSymbolForExportSpecifier) { + return getLocalSymbolForExportSpecifier(node, symbol, parent2, checker); + } + return ts2.firstDefined(symbol.declarations, function(decl) { + if (!decl.parent) { + if (symbol.flags & 33554432) + return void 0; + ts2.Debug.fail("Unexpected symbol at ".concat(ts2.Debug.formatSyntaxKind(node.kind), ": ").concat(ts2.Debug.formatSymbol(symbol))); + } + return ts2.isTypeLiteralNode(decl.parent) && ts2.isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : void 0; + }); + } + var SpecialSearchKind; + (function(SpecialSearchKind2) { + SpecialSearchKind2[SpecialSearchKind2["None"] = 0] = "None"; + SpecialSearchKind2[SpecialSearchKind2["Constructor"] = 1] = "Constructor"; + SpecialSearchKind2[SpecialSearchKind2["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); + function getNonModuleSymbolOfMergedModuleSymbol(symbol) { + if (!(symbol.flags & (1536 | 33554432))) + return void 0; + var decl = symbol.declarations && ts2.find(symbol.declarations, function(d7) { + return !ts2.isSourceFile(d7) && !ts2.isModuleDeclaration(d7); + }); + return decl && decl.symbol; + } + var State2 = ( + /** @class */ + function() { + function State3(sourceFiles, sourceFilesSet, specialSearchKind, checker, cancellationToken, searchMeaning, options, result2) { + this.sourceFiles = sourceFiles; + this.sourceFilesSet = sourceFilesSet; + this.specialSearchKind = specialSearchKind; + this.checker = checker; + this.cancellationToken = cancellationToken; + this.searchMeaning = searchMeaning; + this.options = options; + this.result = result2; + this.inheritsFromCache = new ts2.Map(); + this.markSeenContainingTypeReference = ts2.nodeSeenTracker(); + this.markSeenReExportRHS = ts2.nodeSeenTracker(); + this.symbolIdToReferences = []; + this.sourceFileToSeenSymbols = []; + } + State3.prototype.includesSourceFile = function(sourceFile) { + return this.sourceFilesSet.has(sourceFile.fileName); + }; + State3.prototype.getImportSearches = function(exportSymbol, exportInfo) { + if (!this.importTracker) + this.importTracker = FindAllReferences2.createImportTracker(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken); + return this.importTracker( + exportSymbol, + exportInfo, + this.options.use === 2 + /* FindReferencesUse.Rename */ + ); + }; + State3.prototype.createSearch = function(location2, symbol, comingFrom, searchOptions) { + if (searchOptions === void 0) { + searchOptions = {}; + } + var _a2 = searchOptions.text, text = _a2 === void 0 ? ts2.stripQuotes(ts2.symbolName(ts2.getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol)) : _a2, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? [symbol] : _b; + var escapedText = ts2.escapeLeadingUnderscores(text); + var parents = this.options.implementations && location2 ? getParentSymbolsOfPropertyAccess(location2, symbol, this.checker) : void 0; + return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, includes: function(sym) { + return ts2.contains(allSearchSymbols, sym); + } }; + }; + State3.prototype.referenceAdder = function(searchSymbol) { + var symbolId = ts2.getSymbolId(searchSymbol); + var references = this.symbolIdToReferences[symbolId]; + if (!references) { + references = this.symbolIdToReferences[symbolId] = []; + this.result.push({ definition: { type: 0, symbol: searchSymbol }, references }); + } + return function(node, kind) { + return references.push(nodeEntry(node, kind)); + }; + }; + State3.prototype.addStringOrCommentReference = function(fileName, textSpan) { + this.result.push({ + definition: void 0, + references: [{ kind: 0, fileName, textSpan }] + }); + }; + State3.prototype.markSearchedSymbols = function(sourceFile, symbols) { + var sourceId = ts2.getNodeId(sourceFile); + var seenSymbols = this.sourceFileToSeenSymbols[sourceId] || (this.sourceFileToSeenSymbols[sourceId] = new ts2.Set()); + var anyNewSymbols = false; + for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { + var sym = symbols_1[_i]; + anyNewSymbols = ts2.tryAddToSet(seenSymbols, ts2.getSymbolId(sym)) || anyNewSymbols; + } + return anyNewSymbols; + }; + return State3; + }() + ); + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + var _a2 = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a2.importSearches, singleReferences = _a2.singleReferences, indirectUsers = _a2.indirectUsers; + if (singleReferences.length) { + var addRef = state.referenceAdder(exportSymbol); + for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { + var singleRef = singleReferences_1[_i]; + if (shouldAddSingleReference(singleRef, state)) + addRef(singleRef); + } + } + for (var _b = 0, importSearches_1 = importSearches; _b < importSearches_1.length; _b++) { + var _c = importSearches_1[_b], importLocation = _c[0], importSymbol = _c[1]; + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch( + importLocation, + importSymbol, + 1 + /* ImportExport.Export */ + ), state); + } + if (indirectUsers.length) { + var indirectSearch = void 0; + switch (exportInfo.exportKind) { + case 0: + indirectSearch = state.createSearch( + exportLocation, + exportSymbol, + 1 + /* ImportExport.Export */ + ); + break; + case 1: + indirectSearch = state.options.use === 2 ? void 0 : state.createSearch(exportLocation, exportSymbol, 1, { text: "default" }); + break; + case 2: + break; + } + if (indirectSearch) { + for (var _d = 0, indirectUsers_1 = indirectUsers; _d < indirectUsers_1.length; _d++) { + var indirectUser = indirectUsers_1[_d]; + searchForName(indirectUser, indirectSearch, state); + } + } + } + } + function eachExportReference(sourceFiles, checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName, isDefaultExport, cb) { + var importTracker = FindAllReferences2.createImportTracker(sourceFiles, new ts2.Set(sourceFiles.map(function(f8) { + return f8.fileName; + })), checker, cancellationToken); + var _a2 = importTracker( + exportSymbol, + { exportKind: isDefaultExport ? 1 : 0, exportingModuleSymbol }, + /*isForRename*/ + false + ), importSearches = _a2.importSearches, indirectUsers = _a2.indirectUsers, singleReferences = _a2.singleReferences; + for (var _i = 0, importSearches_2 = importSearches; _i < importSearches_2.length; _i++) { + var importLocation = importSearches_2[_i][0]; + cb(importLocation); + } + for (var _b = 0, singleReferences_2 = singleReferences; _b < singleReferences_2.length; _b++) { + var singleReference = singleReferences_2[_b]; + if (ts2.isIdentifier(singleReference) && ts2.isImportTypeNode(singleReference.parent)) { + cb(singleReference); + } + } + for (var _c = 0, indirectUsers_2 = indirectUsers; _c < indirectUsers_2.length; _c++) { + var indirectUser = indirectUsers_2[_c]; + for (var _d = 0, _e2 = getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName); _d < _e2.length; _d++) { + var node = _e2[_d]; + var symbol = checker.getSymbolAtLocation(node); + var hasExportAssignmentDeclaration = ts2.some(symbol === null || symbol === void 0 ? void 0 : symbol.declarations, function(d7) { + return ts2.tryCast(d7, ts2.isExportAssignment) ? true : false; + }); + if (ts2.isIdentifier(node) && !ts2.isImportOrExportSpecifier(node.parent) && (symbol === exportSymbol || hasExportAssignmentDeclaration)) { + cb(node); + } + } + } + } + Core2.eachExportReference = eachExportReference; + function shouldAddSingleReference(singleRef, state) { + if (!hasMatchingMeaning(singleRef, state)) + return false; + if (state.options.use !== 2) + return true; + if (!ts2.isIdentifier(singleRef)) + return false; + return !(ts2.isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default"); + } + function searchForImportedSymbol(symbol, state) { + if (!symbol.declarations) + return; + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + var exportingFile = declaration.getSourceFile(); + getReferencesInSourceFile(exportingFile, state.createSearch( + declaration, + symbol, + 0 + /* ImportExport.Import */ + ), state, state.includesSourceFile(exportingFile)); + } + } + function searchForName(sourceFile, search, state) { + if (ts2.getNameTable(sourceFile).get(search.escapedText) !== void 0) { + getReferencesInSourceFile(sourceFile, search, state); + } + } + function getPropertySymbolOfDestructuringAssignment(location2, checker) { + return ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(location2.parent.parent) ? checker.getPropertySymbolOfDestructuringAssignment(location2) : void 0; + } + function getSymbolScope(symbol) { + var declarations = symbol.declarations, flags = symbol.flags, parent2 = symbol.parent, valueDeclaration = symbol.valueDeclaration; + if (valueDeclaration && (valueDeclaration.kind === 215 || valueDeclaration.kind === 228)) { + return valueDeclaration; + } + if (!declarations) { + return void 0; + } + if (flags & (4 | 8192)) { + var privateDeclaration = ts2.find(declarations, function(d7) { + return ts2.hasEffectiveModifier( + d7, + 8 + /* ModifierFlags.Private */ + ) || ts2.isPrivateIdentifierClassElementDeclaration(d7); + }); + if (privateDeclaration) { + return ts2.getAncestor( + privateDeclaration, + 260 + /* SyntaxKind.ClassDeclaration */ + ); + } + return void 0; + } + if (declarations.some(ts2.isObjectBindingElementWithoutPropertyName)) { + return void 0; + } + var exposedByParent = parent2 && !(symbol.flags & 262144); + if (exposedByParent && !(ts2.isExternalModuleSymbol(parent2) && !parent2.globalExports)) { + return void 0; + } + var scope; + for (var _i = 0, declarations_1 = declarations; _i < declarations_1.length; _i++) { + var declaration = declarations_1[_i]; + var container = ts2.getContainerNode(declaration); + if (scope && scope !== container) { + return void 0; + } + if (!container || container.kind === 308 && !ts2.isExternalOrCommonJsModule(container)) { + return void 0; + } + scope = container; + if (ts2.isFunctionExpression(scope)) { + var next = void 0; + while (next = ts2.getNextJSDocCommentLocation(scope)) { + scope = next; + } + } + } + return exposedByParent ? scope.getSourceFile() : scope; + } + function isSymbolReferencedInFile(definition, checker, sourceFile, searchContainer) { + if (searchContainer === void 0) { + searchContainer = sourceFile; + } + return eachSymbolReferenceInFile(definition, checker, sourceFile, function() { + return true; + }, searchContainer) || false; + } + Core2.isSymbolReferencedInFile = isSymbolReferencedInFile; + function eachSymbolReferenceInFile(definition, checker, sourceFile, cb, searchContainer) { + if (searchContainer === void 0) { + searchContainer = sourceFile; + } + var symbol = ts2.isParameterPropertyDeclaration(definition.parent, definition.parent.parent) ? ts2.first(checker.getSymbolsOfParameterPropertyDeclaration(definition.parent, definition.text)) : checker.getSymbolAtLocation(definition); + if (!symbol) + return void 0; + for (var _i = 0, _a2 = getPossibleSymbolReferenceNodes(sourceFile, symbol.name, searchContainer); _i < _a2.length; _i++) { + var token = _a2[_i]; + if (!ts2.isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText) + continue; + var referenceSymbol = checker.getSymbolAtLocation(token); + if (referenceSymbol === symbol || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol || ts2.isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol) { + var res = cb(token); + if (res) + return res; + } + } + } + Core2.eachSymbolReferenceInFile = eachSymbolReferenceInFile; + function getTopMostDeclarationNamesInFile(declarationName, sourceFile) { + var candidates = ts2.filter(getPossibleSymbolReferenceNodes(sourceFile, declarationName), function(name2) { + return !!ts2.getDeclarationFromName(name2); + }); + return candidates.reduce(function(topMost, decl) { + var depth = getDepth(decl); + if (!ts2.some(topMost.declarationNames) || depth === topMost.depth) { + topMost.declarationNames.push(decl); + topMost.depth = depth; + } else if (depth < topMost.depth) { + topMost.declarationNames = [decl]; + topMost.depth = depth; + } + return topMost; + }, { depth: Infinity, declarationNames: [] }).declarationNames; + function getDepth(declaration) { + var depth = 0; + while (declaration) { + declaration = ts2.getContainerNode(declaration); + depth++; + } + return depth; + } + } + Core2.getTopMostDeclarationNamesInFile = getTopMostDeclarationNamesInFile; + function someSignatureUsage(signature, sourceFiles, checker, cb) { + if (!signature.name || !ts2.isIdentifier(signature.name)) + return false; + var symbol = ts2.Debug.checkDefined(checker.getSymbolAtLocation(signature.name)); + for (var _i = 0, sourceFiles_3 = sourceFiles; _i < sourceFiles_3.length; _i++) { + var sourceFile = sourceFiles_3[_i]; + for (var _a2 = 0, _b = getPossibleSymbolReferenceNodes(sourceFile, symbol.name); _a2 < _b.length; _a2++) { + var name2 = _b[_a2]; + if (!ts2.isIdentifier(name2) || name2 === signature.name || name2.escapedText !== signature.name.escapedText) + continue; + var called = ts2.climbPastPropertyAccess(name2); + var call = ts2.isCallExpression(called.parent) && called.parent.expression === called ? called.parent : void 0; + var referenceSymbol = checker.getSymbolAtLocation(name2); + if (referenceSymbol && checker.getRootSymbols(referenceSymbol).some(function(s7) { + return s7 === symbol; + })) { + if (cb(name2, call)) { + return true; + } + } + } + } + return false; + } + Core2.someSignatureUsage = someSignatureUsage; + function getPossibleSymbolReferenceNodes(sourceFile, symbolName, container) { + if (container === void 0) { + container = sourceFile; + } + return getPossibleSymbolReferencePositions(sourceFile, symbolName, container).map(function(pos) { + return ts2.getTouchingPropertyName(sourceFile, pos); + }); + } + function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) { + if (container === void 0) { + container = sourceFile; + } + var positions = []; + if (!symbolName || !symbolName.length) { + return positions; + } + var text = sourceFile.text; + var sourceLength = text.length; + var symbolNameLength = symbolName.length; + var position = text.indexOf(symbolName, container.pos); + while (position >= 0) { + if (position > container.end) + break; + var endPosition = position + symbolNameLength; + if ((position === 0 || !ts2.isIdentifierPart( + text.charCodeAt(position - 1), + 99 + /* ScriptTarget.Latest */ + )) && (endPosition === sourceLength || !ts2.isIdentifierPart( + text.charCodeAt(endPosition), + 99 + /* ScriptTarget.Latest */ + ))) { + positions.push(position); + } + position = text.indexOf(symbolName, position + symbolNameLength + 1); + } + return positions; + } + function getLabelReferencesInNode(container, targetLabel) { + var sourceFile = container.getSourceFile(); + var labelName = targetLabel.text; + var references = ts2.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), function(node) { + return node === targetLabel || ts2.isJumpStatementTarget(node) && ts2.getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0; + }); + return [{ definition: { type: 1, node: targetLabel }, references }]; + } + function isValidReferencePosition(node, searchSymbolName) { + switch (node.kind) { + case 80: + if (ts2.isJSDocMemberName(node.parent)) { + return true; + } + case 79: + return node.text.length === searchSymbolName.length; + case 14: + case 10: { + var str2 = node; + return (ts2.isLiteralNameOfPropertyDeclarationOrIndexAccess(str2) || ts2.isNameOfModuleDeclaration(node) || ts2.isExpressionOfExternalModuleImportEqualsDeclaration(node) || ts2.isCallExpression(node.parent) && ts2.isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node) && str2.text.length === searchSymbolName.length; + } + case 8: + return ts2.isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length; + case 88: + return "default".length === searchSymbolName.length; + default: + return false; + } + } + function getAllReferencesForImportMeta(sourceFiles, cancellationToken) { + var references = ts2.flatMap(sourceFiles, function(sourceFile) { + cancellationToken.throwIfCancellationRequested(); + return ts2.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "meta", sourceFile), function(node) { + var parent2 = node.parent; + if (ts2.isImportMeta(parent2)) { + return nodeEntry(parent2); + } + }); + }); + return references.length ? [{ definition: { type: 2, node: references[0].node }, references }] : void 0; + } + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken, filter2) { + var references = ts2.flatMap(sourceFiles, function(sourceFile) { + cancellationToken.throwIfCancellationRequested(); + return ts2.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, ts2.tokenToString(keywordKind), sourceFile), function(referenceLocation) { + if (referenceLocation.kind === keywordKind && (!filter2 || filter2(referenceLocation))) { + return nodeEntry(referenceLocation); + } + }); + }); + return references.length ? [{ definition: { type: 2, node: references[0].node }, references }] : void 0; + } + function getReferencesInSourceFile(sourceFile, search, state, addReferencesHere) { + if (addReferencesHere === void 0) { + addReferencesHere = true; + } + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state, addReferencesHere); + } + function getReferencesInContainer(container, sourceFile, search, state, addReferencesHere) { + if (!state.markSearchedSymbols(sourceFile, search.allSearchSymbols)) { + return; + } + for (var _i = 0, _a2 = getPossibleSymbolReferencePositions(sourceFile, search.text, container); _i < _a2.length; _i++) { + var position = _a2[_i]; + getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere); + } + } + function hasMatchingMeaning(referenceLocation, state) { + return !!(ts2.getMeaningFromLocation(referenceLocation) & state.searchMeaning); + } + function getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere) { + var referenceLocation = ts2.getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + if (!state.options.implementations && (state.options.findInStrings && ts2.isInString(sourceFile, position) || state.options.findInComments && ts2.isInNonReferenceComment(sourceFile, position))) { + state.addStringOrCommentReference(sourceFile.fileName, ts2.createTextSpan(position, search.text.length)); + } + return; + } + if (!hasMatchingMeaning(referenceLocation, state)) + return; + var referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + var parent2 = referenceLocation.parent; + if (ts2.isImportSpecifier(parent2) && parent2.propertyName === referenceLocation) { + return; + } + if (ts2.isExportSpecifier(parent2)) { + ts2.Debug.assert( + referenceLocation.kind === 79 + /* SyntaxKind.Identifier */ + ); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent2, search, state, addReferencesHere); + return; + } + var relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + switch (state.specialSearchKind) { + case 0: + if (addReferencesHere) + addReference(referenceLocation, relatedSymbol, state); + break; + case 1: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + ts2.Debug.assertNever(state.specialSearchKind); + } + if (ts2.isInJSFile(referenceLocation) && referenceLocation.parent.kind === 205 && ts2.isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) { + referenceSymbol = referenceLocation.parent.symbol; + if (!referenceSymbol) + return; + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { + ts2.Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled"); + var parent2 = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name2 = exportSpecifier.name; + var exportDeclaration = parent2.parent; + var localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!alwaysGetReferences && !search.includes(localSymbol)) { + return; + } + if (!propertyName) { + if (!(state.options.use === 2 && name2.escapedText === "default")) { + addRef(); + } + } else if (referenceLocation === propertyName) { + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (addReferencesHere && state.options.use !== 2 && state.markSeenReExportRHS(name2)) { + addReference(name2, ts2.Debug.checkDefined(exportSpecifier.symbol), state); + } + } else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); + } + } + if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { + var isDefaultExport = referenceLocation.originalKeywordKind === 88 || exportSpecifier.name.originalKeywordKind === 88; + var exportKind = isDefaultExport ? 1 : 0; + var exportSymbol = ts2.Debug.checkDefined(exportSpecifier.symbol); + var exportInfo = FindAllReferences2.getExportInfo(exportSymbol, exportKind, state.checker); + if (exportInfo) { + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); + } + } + if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) { + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); + } + function addRef() { + if (addReferencesHere) + addReference(referenceLocation, localSymbol, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + var parent2 = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name2 = exportSpecifier.name; + ts2.Debug.assert(propertyName === referenceLocation || name2 === referenceLocation); + if (propertyName) { + return propertyName === referenceLocation; + } else { + return !parent2.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + var importOrExport = FindAllReferences2.getImportOrExportSymbol( + referenceLocation, + referenceSymbol, + state.checker, + search.comingFrom === 1 + /* ImportExport.Export */ + ); + if (!importOrExport) + return; + var symbol = importOrExport.symbol; + if (importOrExport.kind === 0) { + if (!isForRenameWithPrefixAndSuffixText(state.options)) { + searchForImportedSymbol(symbol, state); + } + } else { + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty(_a2, search, state) { + var flags = _a2.flags, valueDeclaration = _a2.valueDeclaration; + var shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + var name2 = valueDeclaration && ts2.getNameOfDeclaration(valueDeclaration); + if (!(flags & 33554432) && name2 && search.includes(shorthandValueSymbol)) { + addReference(name2, shorthandValueSymbol, state); + } + } + function addReference(referenceLocation, relatedSymbol, state) { + var _a2 = "kind" in relatedSymbol ? relatedSymbol : { kind: void 0, symbol: relatedSymbol }, kind = _a2.kind, symbol = _a2.symbol; + if (state.options.use === 2 && referenceLocation.kind === 88) { + return; + } + var addRef = state.referenceAdder(symbol); + if (state.options.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } else { + addRef(referenceLocation, kind); + } + } + function addConstructorReferences(referenceLocation, sourceFile, search, state) { + if (ts2.isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, state); + } + var pusher = function() { + return state.referenceAdder(search.symbol); + }; + if (ts2.isClassLike(referenceLocation.parent)) { + ts2.Debug.assert(referenceLocation.kind === 88 || referenceLocation.parent.name === referenceLocation); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); + } else { + var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); + findInheritedConstructorReferences(classExtending, state); + } + } + } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, state); + var classLike = referenceLocation.parent; + if (state.options.use === 2 || !ts2.isClassLike(classLike)) + return; + ts2.Debug.assert(classLike.name === referenceLocation); + var addRef = state.referenceAdder(search.symbol); + for (var _i = 0, _a2 = classLike.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (!(ts2.isMethodOrAccessor(member) && ts2.isStatic(member))) { + continue; + } + if (member.body) { + member.body.forEachChild(function cb(node) { + if (node.kind === 108) { + addRef(node); + } else if (!ts2.isFunctionLike(node) && !ts2.isClassLike(node)) { + node.forEachChild(cb); + } + }); + } + } + } + function findOwnConstructorReferences(classSymbol, sourceFile, addNode2) { + var constructorSymbol = getClassConstructorSymbol(classSymbol); + if (constructorSymbol && constructorSymbol.declarations) { + for (var _i = 0, _a2 = constructorSymbol.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + var ctrKeyword = ts2.findChildOfKind(decl, 135, sourceFile); + ts2.Debug.assert(decl.kind === 173 && !!ctrKeyword); + addNode2(ctrKeyword); + } + } + if (classSymbol.exports) { + classSymbol.exports.forEach(function(member) { + var decl2 = member.valueDeclaration; + if (decl2 && decl2.kind === 171) { + var body = decl2.body; + if (body) { + forEachDescendantOfKind(body, 108, function(thisKeyword) { + if (ts2.isNewExpressionTarget(thisKeyword)) { + addNode2(thisKeyword); + } + }); + } + } + }); + } + } + function getClassConstructorSymbol(classSymbol) { + return classSymbol.members && classSymbol.members.get( + "__constructor" + /* InternalSymbolName.Constructor */ + ); + } + function findSuperConstructorAccesses(classDeclaration, addNode2) { + var constructor = getClassConstructorSymbol(classDeclaration.symbol); + if (!(constructor && constructor.declarations)) { + return; + } + for (var _i = 0, _a2 = constructor.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + ts2.Debug.assert( + decl.kind === 173 + /* SyntaxKind.Constructor */ + ); + var body = decl.body; + if (body) { + forEachDescendantOfKind(body, 106, function(node) { + if (ts2.isCallExpressionTarget(node)) { + addNode2(node); + } + }); + } + } + } + function hasOwnConstructor(classDeclaration) { + return !!getClassConstructorSymbol(classDeclaration.symbol); + } + function findInheritedConstructorReferences(classDeclaration, state) { + if (hasOwnConstructor(classDeclaration)) + return; + var classSymbol = classDeclaration.symbol; + var search = state.createSearch( + /*location*/ + void 0, + classSymbol, + /*comingFrom*/ + void 0 + ); + getReferencesInContainerOrFiles(classSymbol, state, search); + } + function addImplementationReferences(refNode, addReference2, state) { + if (ts2.isDeclarationName(refNode) && isImplementation(refNode.parent)) { + addReference2(refNode); + return; + } + if (refNode.kind !== 79) { + return; + } + if (refNode.parent.kind === 300) { + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); + } + var containingClass = getContainingClassIfInHeritageClause(refNode); + if (containingClass) { + addReference2(containingClass); + return; + } + var typeNode = ts2.findAncestor(refNode, function(a7) { + return !ts2.isQualifiedName(a7.parent) && !ts2.isTypeNode(a7.parent) && !ts2.isTypeElement(a7.parent); + }); + var typeHavingNode = typeNode.parent; + if (ts2.hasType(typeHavingNode) && typeHavingNode.type === typeNode && state.markSeenContainingTypeReference(typeHavingNode)) { + if (ts2.hasInitializer(typeHavingNode)) { + addIfImplementation(typeHavingNode.initializer); + } else if (ts2.isFunctionLike(typeHavingNode) && typeHavingNode.body) { + var body = typeHavingNode.body; + if (body.kind === 238) { + ts2.forEachReturnStatement(body, function(returnStatement) { + if (returnStatement.expression) + addIfImplementation(returnStatement.expression); + }); + } else { + addIfImplementation(body); + } + } else if (ts2.isAssertionExpression(typeHavingNode)) { + addIfImplementation(typeHavingNode.expression); + } + } + function addIfImplementation(e10) { + if (isImplementationExpression(e10)) + addReference2(e10); + } + } + function getContainingClassIfInHeritageClause(node) { + return ts2.isIdentifier(node) || ts2.isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent) : ts2.isExpressionWithTypeArguments(node) ? ts2.tryCast(node.parent.parent, ts2.isClassLike) : void 0; + } + function isImplementationExpression(node) { + switch (node.kind) { + case 214: + return isImplementationExpression(node.expression); + case 216: + case 215: + case 207: + case 228: + case 206: + return true; + default: + return false; + } + } + function explicitlyInheritsFrom(symbol, parent2, cachedResults, checker) { + if (symbol === parent2) { + return true; + } + var key = ts2.getSymbolId(symbol) + "," + ts2.getSymbolId(parent2); + var cached = cachedResults.get(key); + if (cached !== void 0) { + return cached; + } + cachedResults.set(key, false); + var inherits2 = !!symbol.declarations && symbol.declarations.some(function(declaration) { + return ts2.getAllSuperTypeNodes(declaration).some(function(typeReference) { + var type3 = checker.getTypeAtLocation(typeReference); + return !!type3 && !!type3.symbol && explicitlyInheritsFrom(type3.symbol, parent2, cachedResults, checker); + }); + }); + cachedResults.set(key, inherits2); + return inherits2; + } + function getReferencesForSuperKeyword(superKeyword) { + var searchSpaceNode = ts2.getSuperContainer( + superKeyword, + /*stopOnFunctions*/ + false + ); + if (!searchSpaceNode) { + return void 0; + } + var staticFlag = 32; + switch (searchSpaceNode.kind) { + case 169: + case 168: + case 171: + case 170: + case 173: + case 174: + case 175: + staticFlag &= ts2.getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + default: + return void 0; + } + var sourceFile = searchSpaceNode.getSourceFile(); + var references = ts2.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "super", searchSpaceNode), function(node) { + if (node.kind !== 106) { + return; + } + var container = ts2.getSuperContainer( + node, + /*stopOnFunctions*/ + false + ); + return container && ts2.isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : void 0; + }); + return [{ definition: { type: 0, symbol: searchSpaceNode.symbol }, references }]; + } + function isParameterName(node) { + return node.kind === 79 && node.parent.kind === 166 && node.parent.name === node; + } + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { + var searchSpaceNode = ts2.getThisContainer( + thisOrSuperKeyword, + /* includeArrowFunctions */ + false + ); + var staticFlag = 32; + switch (searchSpaceNode.kind) { + case 171: + case 170: + if (ts2.isObjectLiteralMethod(searchSpaceNode)) { + staticFlag &= ts2.getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + } + case 169: + case 168: + case 173: + case 174: + case 175: + staticFlag &= ts2.getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + case 308: + if (ts2.isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { + return void 0; + } + case 259: + case 215: + break; + default: + return void 0; + } + var references = ts2.flatMap(searchSpaceNode.kind === 308 ? sourceFiles : [searchSpaceNode.getSourceFile()], function(sourceFile) { + cancellationToken.throwIfCancellationRequested(); + return getPossibleSymbolReferenceNodes(sourceFile, "this", ts2.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter(function(node) { + if (!ts2.isThis(node)) { + return false; + } + var container = ts2.getThisContainer( + node, + /* includeArrowFunctions */ + false + ); + switch (searchSpaceNode.kind) { + case 215: + case 259: + return searchSpaceNode.symbol === container.symbol; + case 171: + case 170: + return ts2.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; + case 228: + case 260: + case 207: + return container.parent && searchSpaceNode.symbol === container.parent.symbol && ts2.isStatic(container) === !!staticFlag; + case 308: + return container.kind === 308 && !ts2.isExternalModule(container) && !isParameterName(node); + } + }); + }).map(function(n7) { + return nodeEntry(n7); + }); + var thisParameter = ts2.firstDefined(references, function(r8) { + return ts2.isParameter(r8.node.parent) ? r8.node : void 0; + }); + return [{ + definition: { type: 3, node: thisParameter || thisOrSuperKeyword }, + references + }]; + } + function getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken) { + var type3 = ts2.getContextualTypeFromParentOrAncestorTypeNode(node, checker); + var references = ts2.flatMap(sourceFiles, function(sourceFile) { + cancellationToken.throwIfCancellationRequested(); + return ts2.mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), function(ref) { + if (ts2.isStringLiteralLike(ref) && ref.text === node.text) { + if (type3) { + var refType = ts2.getContextualTypeFromParentOrAncestorTypeNode(ref, checker); + if (type3 !== checker.getStringType() && type3 === refType) { + return nodeEntry( + ref, + 2 + /* EntryKind.StringLiteral */ + ); + } + } else { + return ts2.isNoSubstitutionTemplateLiteral(ref) && !ts2.rangeIsOnSingleLine(ref, sourceFile) ? void 0 : nodeEntry( + ref, + 2 + /* EntryKind.StringLiteral */ + ); + } + } + }); + }); + return [{ + definition: { type: 4, node }, + references + }]; + } + function populateSearchSymbolSet(symbol, location2, checker, isForRename, providePrefixAndSuffixText, implementations) { + var result2 = []; + forEachRelatedSymbol( + symbol, + location2, + checker, + isForRename, + !(isForRename && providePrefixAndSuffixText), + function(sym, root2, base) { + if (base) { + if (isStaticSymbol(symbol) !== isStaticSymbol(base)) { + base = void 0; + } + } + result2.push(base || root2 || sym); + }, + // when try to find implementation, implementations is true, and not allowed to find base class + /*allowBaseTypes*/ + function() { + return !implementations; + } + ); + return result2; + } + function forEachRelatedSymbol(symbol, location2, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, cbSymbol, allowBaseTypes) { + var containingObjectLiteralElement = ts2.getContainingObjectLiteralElement(location2); + if (containingObjectLiteralElement) { + var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location2.parent); + if (shorthandValueSymbol && isForRenamePopulateSearchSymbolSet) { + return cbSymbol( + shorthandValueSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 3 + /* EntryKind.SearchedLocalFoundProperty */ + ); + } + var contextualType = checker.getContextualType(containingObjectLiteralElement.parent); + var res_1 = contextualType && ts2.firstDefined(ts2.getPropertySymbolsFromContextualType( + containingObjectLiteralElement, + checker, + contextualType, + /*unionSymbolOk*/ + true + ), function(sym) { + return fromRoot( + sym, + 4 + /* EntryKind.SearchedPropertyFoundLocal */ + ); + }); + if (res_1) + return res_1; + var propertySymbol = getPropertySymbolOfDestructuringAssignment(location2, checker); + var res1 = propertySymbol && cbSymbol( + propertySymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 4 + /* EntryKind.SearchedPropertyFoundLocal */ + ); + if (res1) + return res1; + var res2 = shorthandValueSymbol && cbSymbol( + shorthandValueSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 3 + /* EntryKind.SearchedLocalFoundProperty */ + ); + if (res2) + return res2; + } + var aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location2, symbol, checker); + if (aliasedSymbol) { + var res_2 = cbSymbol( + aliasedSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 1 + /* EntryKind.Node */ + ); + if (res_2) + return res_2; + } + var res = fromRoot(symbol); + if (res) + return res; + if (symbol.valueDeclaration && ts2.isParameterPropertyDeclaration(symbol.valueDeclaration, symbol.valueDeclaration.parent)) { + var paramProps = checker.getSymbolsOfParameterPropertyDeclaration(ts2.cast(symbol.valueDeclaration, ts2.isParameter), symbol.name); + ts2.Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1) && !!(paramProps[1].flags & 4)); + return fromRoot(symbol.flags & 1 ? paramProps[1] : paramProps[0]); + } + var exportSpecifier = ts2.getDeclarationOfKind( + symbol, + 278 + /* SyntaxKind.ExportSpecifier */ + ); + if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { + var localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (localSymbol) { + var res_3 = cbSymbol( + localSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 1 + /* EntryKind.Node */ + ); + if (res_3) + return res_3; + } + } + if (!isForRenamePopulateSearchSymbolSet) { + var bindingElementPropertySymbol = void 0; + if (onlyIncludeBindingElementAtReferenceLocation) { + bindingElementPropertySymbol = ts2.isObjectBindingElementWithoutPropertyName(location2.parent) ? ts2.getPropertySymbolFromBindingElement(checker, location2.parent) : void 0; + } else { + bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + } + return bindingElementPropertySymbol && fromRoot( + bindingElementPropertySymbol, + 4 + /* EntryKind.SearchedPropertyFoundLocal */ + ); + } + ts2.Debug.assert(isForRenamePopulateSearchSymbolSet); + var includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation; + if (includeOriginalSymbolOfBindingElement) { + var bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + return bindingElementPropertySymbol && fromRoot( + bindingElementPropertySymbol, + 4 + /* EntryKind.SearchedPropertyFoundLocal */ + ); + } + function fromRoot(sym, kind) { + return ts2.firstDefined(checker.getRootSymbols(sym), function(rootSymbol) { + return cbSymbol( + sym, + rootSymbol, + /*baseSymbol*/ + void 0, + kind + ) || (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, function(base) { + return cbSymbol(sym, rootSymbol, base, kind); + }) : void 0); + }); + } + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) { + var bindingElement = ts2.getDeclarationOfKind( + symbol2, + 205 + /* SyntaxKind.BindingElement */ + ); + if (bindingElement && ts2.isObjectBindingElementWithoutPropertyName(bindingElement)) { + return ts2.getPropertySymbolFromBindingElement(checker2, bindingElement); + } + } + } + function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) { + var seen = new ts2.Map(); + return recur(symbol); + function recur(symbol2) { + if (!(symbol2.flags & (32 | 64)) || !ts2.addToSeen(seen, ts2.getSymbolId(symbol2))) + return; + return ts2.firstDefined(symbol2.declarations, function(declaration) { + return ts2.firstDefined(ts2.getAllSuperTypeNodes(declaration), function(typeReference) { + var type3 = checker.getTypeAtLocation(typeReference); + var propertySymbol = type3 && type3.symbol && checker.getPropertyOfType(type3, propertyName); + return type3 && propertySymbol && (ts2.firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type3.symbol)); + }); + }); + } + } + function isStaticSymbol(symbol) { + if (!symbol.valueDeclaration) + return false; + var modifierFlags = ts2.getEffectiveModifierFlags(symbol.valueDeclaration); + return !!(modifierFlags & 32); + } + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + var checker = state.checker; + return forEachRelatedSymbol( + referenceSymbol, + referenceLocation, + checker, + /*isForRenamePopulateSearchSymbolSet*/ + false, + /*onlyIncludeBindingElementAtReferenceLocation*/ + state.options.use !== 2 || !!state.options.providePrefixAndSuffixTextForRename, + function(sym, rootSymbol, baseSymbol, kind) { + if (baseSymbol) { + if (isStaticSymbol(referenceSymbol) !== isStaticSymbol(baseSymbol)) { + baseSymbol = void 0; + } + } + return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(ts2.getCheckFlags(sym) & 6) ? rootSymbol : sym, kind } : void 0; + }, + /*allowBaseTypes*/ + function(rootSymbol) { + return !(search.parents && !search.parents.some(function(parent2) { + return explicitlyInheritsFrom(rootSymbol.parent, parent2, state.inheritsFromCache, checker); + })); + } + ); + } + function getIntersectingMeaningFromDeclarations(node, symbol) { + var meaning = ts2.getMeaningFromLocation(node); + var declarations = symbol.declarations; + if (declarations) { + var lastIterationMeaning = void 0; + do { + lastIterationMeaning = meaning; + for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { + var declaration = declarations_2[_i]; + var declarationMeaning = ts2.getMeaningFromDeclaration(declaration); + if (declarationMeaning & meaning) { + meaning |= declarationMeaning; + } + } + } while (meaning !== lastIterationMeaning); + } + return meaning; + } + Core2.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; + function isImplementation(node) { + return !!(node.flags & 16777216) ? !(ts2.isInterfaceDeclaration(node) || ts2.isTypeAliasDeclaration(node)) : ts2.isVariableLike(node) ? ts2.hasInitializer(node) : ts2.isFunctionLikeDeclaration(node) ? !!node.body : ts2.isClassLike(node) || ts2.isModuleOrEnumDeclaration(node); + } + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference2) { + var refSymbol = checker.getSymbolAtLocation(node); + var shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (var _i = 0, _a2 = shorthandSymbol.getDeclarations(); _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (ts2.getMeaningFromDeclaration(declaration) & 1) { + addReference2(declaration); + } + } + } + } + Core2.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + ts2.forEachChild(node, function(child) { + if (child.kind === kind) { + action(child); + } + forEachDescendantOfKind(child, kind, action); + }); + } + function tryGetClassByExtendingIdentifier(node) { + return ts2.tryGetClassExtendingExpressionWithTypeArguments(ts2.climbPastPropertyAccess(node).parent); + } + function getParentSymbolsOfPropertyAccess(location2, symbol, checker) { + var propertyAccessExpression = ts2.isRightSideOfPropertyAccess(location2) ? location2.parent : void 0; + var lhsType = propertyAccessExpression && checker.getTypeAtLocation(propertyAccessExpression.expression); + var res = ts2.mapDefined(lhsType && (lhsType.isUnionOrIntersection() ? lhsType.types : lhsType.symbol === symbol.parent ? void 0 : [lhsType]), function(t8) { + return t8.symbol && t8.symbol.flags & (32 | 64) ? t8.symbol : void 0; + }); + return res.length === 0 ? void 0 : res; + } + function isForRenameWithPrefixAndSuffixText(options) { + return options.use === 2 && options.providePrefixAndSuffixTextForRename; + } + })(Core = FindAllReferences2.Core || (FindAllReferences2.Core = {})); + })(FindAllReferences = ts2.FindAllReferences || (ts2.FindAllReferences = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var CallHierarchy; + (function(CallHierarchy2) { + function isNamedExpression(node) { + return (ts2.isFunctionExpression(node) || ts2.isClassExpression(node)) && ts2.isNamedDeclaration(node); + } + function isConstNamedExpression(node) { + return (ts2.isFunctionExpression(node) || ts2.isArrowFunction(node) || ts2.isClassExpression(node)) && ts2.isVariableDeclaration(node.parent) && node === node.parent.initializer && ts2.isIdentifier(node.parent.name) && !!(ts2.getCombinedNodeFlags(node.parent) & 2); + } + function isPossibleCallHierarchyDeclaration(node) { + return ts2.isSourceFile(node) || ts2.isModuleDeclaration(node) || ts2.isFunctionDeclaration(node) || ts2.isFunctionExpression(node) || ts2.isClassDeclaration(node) || ts2.isClassExpression(node) || ts2.isClassStaticBlockDeclaration(node) || ts2.isMethodDeclaration(node) || ts2.isMethodSignature(node) || ts2.isGetAccessorDeclaration(node) || ts2.isSetAccessorDeclaration(node); + } + function isValidCallHierarchyDeclaration(node) { + return ts2.isSourceFile(node) || ts2.isModuleDeclaration(node) && ts2.isIdentifier(node.name) || ts2.isFunctionDeclaration(node) || ts2.isClassDeclaration(node) || ts2.isClassStaticBlockDeclaration(node) || ts2.isMethodDeclaration(node) || ts2.isMethodSignature(node) || ts2.isGetAccessorDeclaration(node) || ts2.isSetAccessorDeclaration(node) || isNamedExpression(node) || isConstNamedExpression(node); + } + function getCallHierarchyDeclarationReferenceNode(node) { + if (ts2.isSourceFile(node)) + return node; + if (ts2.isNamedDeclaration(node)) + return node.name; + if (isConstNamedExpression(node)) + return node.parent.name; + return ts2.Debug.checkDefined(node.modifiers && ts2.find(node.modifiers, isDefaultModifier)); + } + function isDefaultModifier(node) { + return node.kind === 88; + } + function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { + var location2 = getCallHierarchyDeclarationReferenceNode(node); + return location2 && typeChecker.getSymbolAtLocation(location2); + } + function getCallHierarchyItemName(program, node) { + if (ts2.isSourceFile(node)) { + return { text: node.fileName, pos: 0, end: 0 }; + } + if ((ts2.isFunctionDeclaration(node) || ts2.isClassDeclaration(node)) && !ts2.isNamedDeclaration(node)) { + var defaultModifier = node.modifiers && ts2.find(node.modifiers, isDefaultModifier); + if (defaultModifier) { + return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; + } + } + if (ts2.isClassStaticBlockDeclaration(node)) { + var sourceFile = node.getSourceFile(); + var pos = ts2.skipTrivia(sourceFile.text, ts2.moveRangePastModifiers(node).pos); + var end = pos + 6; + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(node.parent); + var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : ""; + return { text: "".concat(prefix, "static {}"), pos, end }; + } + var declName = isConstNamedExpression(node) ? node.parent.name : ts2.Debug.checkDefined(ts2.getNameOfDeclaration(node), "Expected call hierarchy item to have a name"); + var text = ts2.isIdentifier(declName) ? ts2.idText(declName) : ts2.isStringOrNumericLiteralLike(declName) ? declName.text : ts2.isComputedPropertyName(declName) ? ts2.isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text : void 0 : void 0; + if (text === void 0) { + var typeChecker = program.getTypeChecker(); + var symbol = typeChecker.getSymbolAtLocation(declName); + if (symbol) { + text = typeChecker.symbolToString(symbol, node); + } + } + if (text === void 0) { + var printer_1 = ts2.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + text = ts2.usingSingleLineStringWriter(function(writer) { + return printer_1.writeNode(4, node, node.getSourceFile(), writer); + }); + } + return { text, pos: declName.getStart(), end: declName.getEnd() }; + } + function getCallHierarchItemContainerName(node) { + var _a2, _b; + if (isConstNamedExpression(node)) { + if (ts2.isModuleBlock(node.parent.parent.parent.parent) && ts2.isIdentifier(node.parent.parent.parent.parent.parent.name)) { + return node.parent.parent.parent.parent.parent.name.getText(); + } + return; + } + switch (node.kind) { + case 174: + case 175: + case 171: + if (node.parent.kind === 207) { + return (_a2 = ts2.getAssignedName(node.parent)) === null || _a2 === void 0 ? void 0 : _a2.getText(); + } + return (_b = ts2.getNameOfDeclaration(node.parent)) === null || _b === void 0 ? void 0 : _b.getText(); + case 259: + case 260: + case 264: + if (ts2.isModuleBlock(node.parent) && ts2.isIdentifier(node.parent.parent.name)) { + return node.parent.parent.name.getText(); + } + } + } + function findImplementation(typeChecker, node) { + if (node.body) { + return node; + } + if (ts2.isConstructorDeclaration(node)) { + return ts2.getFirstConstructorWithBody(node.parent); + } + if (ts2.isFunctionDeclaration(node) || ts2.isMethodDeclaration(node)) { + var symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); + if (symbol && symbol.valueDeclaration && ts2.isFunctionLikeDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.body) { + return symbol.valueDeclaration; + } + return void 0; + } + return node; + } + function findAllInitialDeclarations(typeChecker, node) { + var symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); + var declarations; + if (symbol && symbol.declarations) { + var indices = ts2.indicesOf(symbol.declarations); + var keys_2 = ts2.map(symbol.declarations, function(decl2) { + return { file: decl2.getSourceFile().fileName, pos: decl2.pos }; + }); + indices.sort(function(a7, b8) { + return ts2.compareStringsCaseSensitive(keys_2[a7].file, keys_2[b8].file) || keys_2[a7].pos - keys_2[b8].pos; + }); + var sortedDeclarations = ts2.map(indices, function(i7) { + return symbol.declarations[i7]; + }); + var lastDecl = void 0; + for (var _i = 0, sortedDeclarations_1 = sortedDeclarations; _i < sortedDeclarations_1.length; _i++) { + var decl = sortedDeclarations_1[_i]; + if (isValidCallHierarchyDeclaration(decl)) { + if (!lastDecl || lastDecl.parent !== decl.parent || lastDecl.end !== decl.pos) { + declarations = ts2.append(declarations, decl); + } + lastDecl = decl; + } + } + } + return declarations; + } + function findImplementationOrAllInitialDeclarations(typeChecker, node) { + var _a2, _b, _c; + if (ts2.isClassStaticBlockDeclaration(node)) { + return node; + } + if (ts2.isFunctionLikeDeclaration(node)) { + return (_b = (_a2 = findImplementation(typeChecker, node)) !== null && _a2 !== void 0 ? _a2 : findAllInitialDeclarations(typeChecker, node)) !== null && _b !== void 0 ? _b : node; + } + return (_c = findAllInitialDeclarations(typeChecker, node)) !== null && _c !== void 0 ? _c : node; + } + function resolveCallHierarchyDeclaration(program, location2) { + var typeChecker = program.getTypeChecker(); + var followingSymbol = false; + while (true) { + if (isValidCallHierarchyDeclaration(location2)) { + return findImplementationOrAllInitialDeclarations(typeChecker, location2); + } + if (isPossibleCallHierarchyDeclaration(location2)) { + var ancestor = ts2.findAncestor(location2, isValidCallHierarchyDeclaration); + return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); + } + if (ts2.isDeclarationName(location2)) { + if (isValidCallHierarchyDeclaration(location2.parent)) { + return findImplementationOrAllInitialDeclarations(typeChecker, location2.parent); + } + if (isPossibleCallHierarchyDeclaration(location2.parent)) { + var ancestor = ts2.findAncestor(location2.parent, isValidCallHierarchyDeclaration); + return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); + } + if (ts2.isVariableDeclaration(location2.parent) && location2.parent.initializer && isConstNamedExpression(location2.parent.initializer)) { + return location2.parent.initializer; + } + return void 0; + } + if (ts2.isConstructorDeclaration(location2)) { + if (isValidCallHierarchyDeclaration(location2.parent)) { + return location2.parent; + } + return void 0; + } + if (location2.kind === 124 && ts2.isClassStaticBlockDeclaration(location2.parent)) { + location2 = location2.parent; + continue; + } + if (ts2.isVariableDeclaration(location2) && location2.initializer && isConstNamedExpression(location2.initializer)) { + return location2.initializer; + } + if (!followingSymbol) { + var symbol = typeChecker.getSymbolAtLocation(location2); + if (symbol) { + if (symbol.flags & 2097152) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + if (symbol.valueDeclaration) { + followingSymbol = true; + location2 = symbol.valueDeclaration; + continue; + } + } + } + return void 0; + } + } + CallHierarchy2.resolveCallHierarchyDeclaration = resolveCallHierarchyDeclaration; + function createCallHierarchyItem(program, node) { + var sourceFile = node.getSourceFile(); + var name2 = getCallHierarchyItemName(program, node); + var containerName = getCallHierarchItemContainerName(node); + var kind = ts2.getNodeKind(node); + var kindModifiers = ts2.getNodeModifiers(node); + var span = ts2.createTextSpanFromBounds(ts2.skipTrivia( + sourceFile.text, + node.getFullStart(), + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ), node.getEnd()); + var selectionSpan = ts2.createTextSpanFromBounds(name2.pos, name2.end); + return { file: sourceFile.fileName, kind, kindModifiers, name: name2.text, containerName, span, selectionSpan }; + } + CallHierarchy2.createCallHierarchyItem = createCallHierarchyItem; + function isDefined(x7) { + return x7 !== void 0; + } + function convertEntryToCallSite(entry) { + if (entry.kind === 1) { + var node = entry.node; + if (ts2.isCallOrNewExpressionTarget( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || ts2.isTaggedTemplateTag( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || ts2.isDecoratorTarget( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || ts2.isJsxOpeningLikeElementTagName( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || ts2.isRightSideOfPropertyAccess(node) || ts2.isArgumentExpressionOfElementAccess(node)) { + var sourceFile = node.getSourceFile(); + var ancestor = ts2.findAncestor(node, isValidCallHierarchyDeclaration) || sourceFile; + return { declaration: ancestor, range: ts2.createTextRangeFromNode(node, sourceFile) }; + } + } + } + function getCallSiteGroupKey(entry) { + return ts2.getNodeId(entry.declaration); + } + function createCallHierarchyIncomingCall(from, fromSpans) { + return { from, fromSpans }; + } + function convertCallSiteGroupToIncomingCall(program, entries) { + return createCallHierarchyIncomingCall(createCallHierarchyItem(program, entries[0].declaration), ts2.map(entries, function(entry) { + return ts2.createTextSpanFromRange(entry.range); + })); + } + function getIncomingCalls(program, declaration, cancellationToken) { + if (ts2.isSourceFile(declaration) || ts2.isModuleDeclaration(declaration) || ts2.isClassStaticBlockDeclaration(declaration)) { + return []; + } + var location2 = getCallHierarchyDeclarationReferenceNode(declaration); + var calls = ts2.filter(ts2.FindAllReferences.findReferenceOrRenameEntries( + program, + cancellationToken, + program.getSourceFiles(), + location2, + /*position*/ + 0, + { + use: 1 + /* FindAllReferences.FindReferencesUse.References */ + }, + convertEntryToCallSite + ), isDefined); + return calls ? ts2.group(calls, getCallSiteGroupKey, function(entries) { + return convertCallSiteGroupToIncomingCall(program, entries); + }) : []; + } + CallHierarchy2.getIncomingCalls = getIncomingCalls; + function createCallSiteCollector(program, callSites) { + function recordCallSite(node) { + var target = ts2.isTaggedTemplateExpression(node) ? node.tag : ts2.isJsxOpeningLikeElement(node) ? node.tagName : ts2.isAccessExpression(node) ? node : ts2.isClassStaticBlockDeclaration(node) ? node : node.expression; + var declaration = resolveCallHierarchyDeclaration(program, target); + if (declaration) { + var range2 = ts2.createTextRangeFromNode(target, node.getSourceFile()); + if (ts2.isArray(declaration)) { + for (var _i = 0, declaration_1 = declaration; _i < declaration_1.length; _i++) { + var decl = declaration_1[_i]; + callSites.push({ declaration: decl, range: range2 }); + } + } else { + callSites.push({ declaration, range: range2 }); + } + } + } + function collect(node) { + if (!node) + return; + if (node.flags & 16777216) { + return; + } + if (isValidCallHierarchyDeclaration(node)) { + if (ts2.isClassLike(node)) { + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (member.name && ts2.isComputedPropertyName(member.name)) { + collect(member.name.expression); + } + } + } + return; + } + switch (node.kind) { + case 79: + case 268: + case 269: + case 275: + case 261: + case 262: + return; + case 172: + recordCallSite(node); + return; + case 213: + case 231: + collect(node.expression); + return; + case 257: + case 166: + collect(node.name); + collect(node.initializer); + return; + case 210: + recordCallSite(node); + collect(node.expression); + ts2.forEach(node.arguments, collect); + return; + case 211: + recordCallSite(node); + collect(node.expression); + ts2.forEach(node.arguments, collect); + return; + case 212: + recordCallSite(node); + collect(node.tag); + collect(node.template); + return; + case 283: + case 282: + recordCallSite(node); + collect(node.tagName); + collect(node.attributes); + return; + case 167: + recordCallSite(node); + collect(node.expression); + return; + case 208: + case 209: + recordCallSite(node); + ts2.forEachChild(node, collect); + break; + case 235: + collect(node.expression); + return; + } + if (ts2.isPartOfTypeNode(node)) { + return; + } + ts2.forEachChild(node, collect); + } + return collect; + } + function collectCallSitesOfSourceFile(node, collect) { + ts2.forEach(node.statements, collect); + } + function collectCallSitesOfModuleDeclaration(node, collect) { + if (!ts2.hasSyntacticModifier( + node, + 2 + /* ModifierFlags.Ambient */ + ) && node.body && ts2.isModuleBlock(node.body)) { + ts2.forEach(node.body.statements, collect); + } + } + function collectCallSitesOfFunctionLikeDeclaration(typeChecker, node, collect) { + var implementation = findImplementation(typeChecker, node); + if (implementation) { + ts2.forEach(implementation.parameters, collect); + collect(implementation.body); + } + } + function collectCallSitesOfClassStaticBlockDeclaration(node, collect) { + collect(node.body); + } + function collectCallSitesOfClassLikeDeclaration(node, collect) { + ts2.forEach(node.modifiers, collect); + var heritage = ts2.getClassExtendsHeritageElement(node); + if (heritage) { + collect(heritage.expression); + } + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (ts2.canHaveModifiers(member)) { + ts2.forEach(member.modifiers, collect); + } + if (ts2.isPropertyDeclaration(member)) { + collect(member.initializer); + } else if (ts2.isConstructorDeclaration(member) && member.body) { + ts2.forEach(member.parameters, collect); + collect(member.body); + } else if (ts2.isClassStaticBlockDeclaration(member)) { + collect(member); + } + } + } + function collectCallSites(program, node) { + var callSites = []; + var collect = createCallSiteCollector(program, callSites); + switch (node.kind) { + case 308: + collectCallSitesOfSourceFile(node, collect); + break; + case 264: + collectCallSitesOfModuleDeclaration(node, collect); + break; + case 259: + case 215: + case 216: + case 171: + case 174: + case 175: + collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); + break; + case 260: + case 228: + collectCallSitesOfClassLikeDeclaration(node, collect); + break; + case 172: + collectCallSitesOfClassStaticBlockDeclaration(node, collect); + break; + default: + ts2.Debug.assertNever(node); + } + return callSites; + } + function createCallHierarchyOutgoingCall(to, fromSpans) { + return { to, fromSpans }; + } + function convertCallSiteGroupToOutgoingCall(program, entries) { + return createCallHierarchyOutgoingCall(createCallHierarchyItem(program, entries[0].declaration), ts2.map(entries, function(entry) { + return ts2.createTextSpanFromRange(entry.range); + })); + } + function getOutgoingCalls(program, declaration) { + if (declaration.flags & 16777216 || ts2.isMethodSignature(declaration)) { + return []; + } + return ts2.group(collectCallSites(program, declaration), getCallSiteGroupKey, function(entries) { + return convertCallSiteGroupToOutgoingCall(program, entries); + }); + } + CallHierarchy2.getOutgoingCalls = getOutgoingCalls; + })(CallHierarchy = ts2.CallHierarchy || (ts2.CallHierarchy = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) { + var useCaseSensitiveFileNames = ts2.hostUsesCaseSensitiveFileNames(host); + var getCanonicalFileName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + var oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper); + var newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper); + return ts2.textChanges.ChangeTracker.with({ host, formatContext, preferences }, function(changeTracker) { + updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames); + updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName); + }); + } + ts2.getEditsForFileRename = getEditsForFileRename; + function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper) { + var canonicalOldPath = getCanonicalFileName(oldFileOrDirPath); + return function(path2) { + var originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName: path2, pos: 0 }); + var updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path2); + return originalPath ? updatedPath === void 0 ? void 0 : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path2, getCanonicalFileName) : updatedPath; + }; + function getUpdatedPath(pathToUpdate) { + if (getCanonicalFileName(pathToUpdate) === canonicalOldPath) + return newFileOrDirPath; + var suffix = ts2.tryRemoveDirectoryPrefix(pathToUpdate, canonicalOldPath, getCanonicalFileName); + return suffix === void 0 ? void 0 : newFileOrDirPath + "/" + suffix; + } + } + ts2.getPathUpdater = getPathUpdater; + function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) { + var rel = ts2.getRelativePathFromFile(a0, b0, getCanonicalFileName); + return combinePathsSafe(ts2.getDirectoryPath(a1), rel); + } + function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames) { + var configFile = program.getCompilerOptions().configFile; + if (!configFile) + return; + var configDir = ts2.getDirectoryPath(configFile.fileName); + var jsonObjectLiteral = ts2.getTsConfigObjectLiteralExpression(configFile); + if (!jsonObjectLiteral) + return; + forEachProperty(jsonObjectLiteral, function(property2, propertyName) { + switch (propertyName) { + case "files": + case "include": + case "exclude": { + var foundExactMatch = updatePaths(property2); + if (foundExactMatch || propertyName !== "include" || !ts2.isArrayLiteralExpression(property2.initializer)) + return; + var includes2 = ts2.mapDefined(property2.initializer.elements, function(e10) { + return ts2.isStringLiteral(e10) ? e10.text : void 0; + }); + if (includes2.length === 0) + return; + var matchers = ts2.getFileMatcherPatterns( + configDir, + /*excludes*/ + [], + includes2, + useCaseSensitiveFileNames, + currentDirectory + ); + if (ts2.getRegexFromPattern(ts2.Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(oldFileOrDirPath) && !ts2.getRegexFromPattern(ts2.Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames).test(newFileOrDirPath)) { + changeTracker.insertNodeAfter(configFile, ts2.last(property2.initializer.elements), ts2.factory.createStringLiteral(relativePath2(newFileOrDirPath))); + } + return; + } + case "compilerOptions": + forEachProperty(property2.initializer, function(property3, propertyName2) { + var option = ts2.getOptionFromName(propertyName2); + if (option && (option.isFilePath || option.type === "list" && option.element.isFilePath)) { + updatePaths(property3); + } else if (propertyName2 === "paths") { + forEachProperty(property3.initializer, function(pathsProperty) { + if (!ts2.isArrayLiteralExpression(pathsProperty.initializer)) + return; + for (var _i = 0, _a2 = pathsProperty.initializer.elements; _i < _a2.length; _i++) { + var e10 = _a2[_i]; + tryUpdateString(e10); + } + }); + } + }); + return; + } + }); + function updatePaths(property2) { + var elements = ts2.isArrayLiteralExpression(property2.initializer) ? property2.initializer.elements : [property2.initializer]; + var foundExactMatch = false; + for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { + var element = elements_1[_i]; + foundExactMatch = tryUpdateString(element) || foundExactMatch; + } + return foundExactMatch; + } + function tryUpdateString(element) { + if (!ts2.isStringLiteral(element)) + return false; + var elementFileName = combinePathsSafe(configDir, element.text); + var updated = oldToNew(elementFileName); + if (updated !== void 0) { + changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath2(updated)); + return true; + } + return false; + } + function relativePath2(path2) { + return ts2.getRelativePathFromDirectory( + configDir, + path2, + /*ignoreCase*/ + !useCaseSensitiveFileNames + ); + } + } + function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) { + var allFiles = program.getSourceFiles(); + var _loop_4 = function(sourceFile2) { + var newFromOld = oldToNew(sourceFile2.fileName); + var newImportFromPath = newFromOld !== null && newFromOld !== void 0 ? newFromOld : sourceFile2.fileName; + var newImportFromDirectory = ts2.getDirectoryPath(newImportFromPath); + var oldFromNew = newToOld(sourceFile2.fileName); + var oldImportFromPath = oldFromNew || sourceFile2.fileName; + var oldImportFromDirectory = ts2.getDirectoryPath(oldImportFromPath); + var importingSourceFileMoved = newFromOld !== void 0 || oldFromNew !== void 0; + updateImportsWorker(sourceFile2, changeTracker, function(referenceText) { + if (!ts2.pathIsRelative(referenceText)) + return void 0; + var oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText); + var newAbsolute = oldToNew(oldAbsolute); + return newAbsolute === void 0 ? void 0 : ts2.ensurePathIsNonModuleName(ts2.getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName)); + }, function(importLiteral) { + var importedModuleSymbol = program.getTypeChecker().getSymbolAtLocation(importLiteral); + if ((importedModuleSymbol === null || importedModuleSymbol === void 0 ? void 0 : importedModuleSymbol.declarations) && importedModuleSymbol.declarations.some(function(d7) { + return ts2.isAmbientModule(d7); + })) + return void 0; + var toImport = oldFromNew !== void 0 ? getSourceFileToImportFromResolved(importLiteral, ts2.resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile2, program, host, oldToNew); + return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && ts2.pathIsRelative(importLiteral.text)) ? ts2.moduleSpecifiers.updateModuleSpecifier(program.getCompilerOptions(), sourceFile2, getCanonicalFileName(newImportFromPath), toImport.newFileName, ts2.createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0; + }); + }; + for (var _i = 0, allFiles_1 = allFiles; _i < allFiles_1.length; _i++) { + var sourceFile = allFiles_1[_i]; + _loop_4(sourceFile); + } + } + function combineNormal(pathA, pathB) { + return ts2.normalizePath(ts2.combinePaths(pathA, pathB)); + } + function combinePathsSafe(pathA, pathB) { + return ts2.ensurePathIsNonModuleName(combineNormal(pathA, pathB)); + } + function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) { + if (importedModuleSymbol) { + var oldFileName = ts2.find(importedModuleSymbol.declarations, ts2.isSourceFile).fileName; + var newFileName = oldToNew(oldFileName); + return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true }; + } else { + var mode = ts2.getModeForUsageLocation(importingSourceFile, importLiteral); + var resolved = host.resolveModuleNames ? host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode) : program.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode); + return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles()); + } + } + function getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, sourceFiles) { + if (!resolved) + return void 0; + if (resolved.resolvedModule) { + var result_3 = tryChange(resolved.resolvedModule.resolvedFileName); + if (result_3) + return result_3; + } + var result2 = ts2.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJsonExisting) || ts2.pathIsRelative(importLiteral.text) && ts2.forEach(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson); + if (result2) + return result2; + return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false }; + function tryChangeWithIgnoringPackageJsonExisting(oldFileName) { + var newFileName = oldToNew(oldFileName); + return newFileName && ts2.find(sourceFiles, function(src) { + return src.fileName === newFileName; + }) ? tryChangeWithIgnoringPackageJson(oldFileName) : void 0; + } + function tryChangeWithIgnoringPackageJson(oldFileName) { + return !ts2.endsWith(oldFileName, "/package.json") ? tryChange(oldFileName) : void 0; + } + function tryChange(oldFileName) { + var newFileName = oldToNew(oldFileName); + return newFileName && { newFileName, updated: true }; + } + } + function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport) { + for (var _i = 0, _a2 = sourceFile.referencedFiles || ts2.emptyArray; _i < _a2.length; _i++) { + var ref = _a2[_i]; + var updated = updateRef(ref.fileName); + if (updated !== void 0 && updated !== sourceFile.text.slice(ref.pos, ref.end)) + changeTracker.replaceRangeWithText(sourceFile, ref, updated); + } + for (var _b = 0, _c = sourceFile.imports; _b < _c.length; _b++) { + var importStringLiteral = _c[_b]; + var updated = updateImport(importStringLiteral); + if (updated !== void 0 && updated !== importStringLiteral.text) + changeTracker.replaceRangeWithText(sourceFile, createStringRange(importStringLiteral, sourceFile), updated); + } + } + function createStringRange(node, sourceFile) { + return ts2.createRange(node.getStart(sourceFile) + 1, node.end - 1); + } + function forEachProperty(objectLiteral, cb) { + if (!ts2.isObjectLiteralExpression(objectLiteral)) + return; + for (var _i = 0, _a2 = objectLiteral.properties; _i < _a2.length; _i++) { + var property2 = _a2[_i]; + if (ts2.isPropertyAssignment(property2) && ts2.isStringLiteral(property2.name)) { + cb(property2, property2.name.text); + } + } + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var GoToDefinition; + (function(GoToDefinition2) { + function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) { + var _a2; + var _b; + var resolvedRef = getReferenceAtPosition(sourceFile, position, program); + var fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || ts2.emptyArray; + if (resolvedRef === null || resolvedRef === void 0 ? void 0 : resolvedRef.file) { + return fileReferenceDefinition; + } + var node = ts2.getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + var parent2 = node.parent; + var typeChecker = program.getTypeChecker(); + if (node.kind === 161 || ts2.isIdentifier(node) && ts2.isJSDocOverrideTag(parent2) && parent2.tagName === node) { + return getDefinitionFromOverriddenMember(typeChecker, node) || ts2.emptyArray; + } + if (ts2.isJumpStatementTarget(node)) { + var label = ts2.getTargetLabel(node.parent, node.text); + return label ? [createDefinitionInfoFromName( + typeChecker, + label, + "label", + node.text, + /*containerName*/ + void 0 + )] : void 0; + } + if (node.kind === 105) { + var functionDeclaration = ts2.findAncestor(node.parent, function(n7) { + return ts2.isClassStaticBlockDeclaration(n7) ? "quit" : ts2.isFunctionLikeDeclaration(n7); + }); + return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0; + } + if (ts2.isStaticModifier(node) && ts2.isClassStaticBlockDeclaration(node.parent)) { + var classDecl = node.parent.parent; + var _c = getSymbol(classDecl, typeChecker, stopAtAlias), symbol_1 = _c.symbol, failedAliasResolution_1 = _c.failedAliasResolution; + var staticBlocks = ts2.filter(classDecl.members, ts2.isClassStaticBlockDeclaration); + var containerName_1 = symbol_1 ? typeChecker.symbolToString(symbol_1, classDecl) : ""; + var sourceFile_1 = node.getSourceFile(); + return ts2.map(staticBlocks, function(staticBlock) { + var pos = ts2.moveRangePastModifiers(staticBlock).pos; + pos = ts2.skipTrivia(sourceFile_1.text, pos); + return createDefinitionInfoFromName( + typeChecker, + staticBlock, + "constructor", + "static {}", + containerName_1, + /*unverified*/ + false, + failedAliasResolution_1, + { start: pos, length: "static".length } + ); + }); + } + var _d = getSymbol(node, typeChecker, stopAtAlias), symbol = _d.symbol, failedAliasResolution = _d.failedAliasResolution; + var fallbackNode = node; + if (searchOtherFilesOnly && failedAliasResolution) { + var importDeclaration = ts2.forEach(__spreadArray9([node], (symbol === null || symbol === void 0 ? void 0 : symbol.declarations) || ts2.emptyArray, true), function(n7) { + return ts2.findAncestor(n7, ts2.isAnyImportOrBareOrAccessedRequire); + }); + var moduleSpecifier = importDeclaration && ts2.tryGetModuleSpecifierFromDeclaration(importDeclaration); + if (moduleSpecifier) { + _a2 = getSymbol(moduleSpecifier, typeChecker, stopAtAlias), symbol = _a2.symbol, failedAliasResolution = _a2.failedAliasResolution; + fallbackNode = moduleSpecifier; + } + } + if (!symbol && ts2.isModuleSpecifierLike(fallbackNode)) { + var ref = (_b = sourceFile.resolvedModules) === null || _b === void 0 ? void 0 : _b.get(fallbackNode.text, ts2.getModeForUsageLocation(sourceFile, fallbackNode)); + if (ref) { + return [{ + name: fallbackNode.text, + fileName: ref.resolvedFileName, + containerName: void 0, + containerKind: void 0, + kind: "script", + textSpan: ts2.createTextSpan(0, 0), + failedAliasResolution, + isAmbient: ts2.isDeclarationFileName(ref.resolvedFileName), + unverified: fallbackNode !== node + }]; + } + } + if (!symbol) { + return ts2.concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker)); + } + if (searchOtherFilesOnly && ts2.every(symbol.declarations, function(d7) { + return d7.getSourceFile().fileName === sourceFile.fileName; + })) + return void 0; + var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); + if (calledDeclaration && !(ts2.isJsxOpeningLikeElement(node.parent) && isConstructorLike(calledDeclaration))) { + var sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration, failedAliasResolution); + if (typeChecker.getRootSymbols(symbol).some(function(s7) { + return symbolMatchesSignature(s7, calledDeclaration); + })) { + return [sigInfo]; + } else { + var defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, calledDeclaration) || ts2.emptyArray; + return node.kind === 106 ? __spreadArray9([sigInfo], defs, true) : __spreadArray9(__spreadArray9([], defs, true), [sigInfo], false); + } + } + if (node.parent.kind === 300) { + var shorthandSymbol_1 = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + var definitions = (shorthandSymbol_1 === null || shorthandSymbol_1 === void 0 ? void 0 : shorthandSymbol_1.declarations) ? shorthandSymbol_1.declarations.map(function(decl) { + return createDefinitionInfo( + decl, + typeChecker, + shorthandSymbol_1, + node, + /*unverified*/ + false, + failedAliasResolution + ); + }) : ts2.emptyArray; + return ts2.concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker, node) || ts2.emptyArray); + } + if (ts2.isPropertyName(node) && ts2.isBindingElement(parent2) && ts2.isObjectBindingPattern(parent2.parent) && node === (parent2.propertyName || parent2.name)) { + var name_3 = ts2.getNameFromPropertyName(node); + var type3 = typeChecker.getTypeAtLocation(parent2.parent); + return name_3 === void 0 ? ts2.emptyArray : ts2.flatMap(type3.isUnion() ? type3.types : [type3], function(t8) { + var prop = t8.getProperty(name_3); + return prop && getDefinitionFromSymbol(typeChecker, prop, node); + }); + } + return ts2.concatenate(fileReferenceDefinition, getDefinitionFromObjectLiteralElement(typeChecker, node) || getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution)); + } + GoToDefinition2.getDefinitionAtPosition = getDefinitionAtPosition; + function symbolMatchesSignature(s7, calledDeclaration) { + return s7 === calledDeclaration.symbol || s7 === calledDeclaration.symbol.parent || ts2.isAssignmentExpression(calledDeclaration.parent) || !ts2.isCallLikeExpression(calledDeclaration.parent) && s7 === calledDeclaration.parent.symbol; + } + function getDefinitionFromObjectLiteralElement(typeChecker, node) { + var element = ts2.getContainingObjectLiteralElement(node); + if (element) { + var contextualType = element && typeChecker.getContextualType(element.parent); + if (contextualType) { + return ts2.flatMap(ts2.getPropertySymbolsFromContextualType( + element, + typeChecker, + contextualType, + /*unionSymbolOk*/ + false + ), function(propertySymbol) { + return getDefinitionFromSymbol(typeChecker, propertySymbol, node); + }); + } + } + } + function getDefinitionFromOverriddenMember(typeChecker, node) { + var classElement = ts2.findAncestor(node, ts2.isClassElement); + if (!(classElement && classElement.name)) + return; + var baseDeclaration = ts2.findAncestor(classElement, ts2.isClassLike); + if (!baseDeclaration) + return; + var baseTypeNode = ts2.getEffectiveBaseTypeNode(baseDeclaration); + if (!baseTypeNode) + return; + var expression = ts2.skipParentheses(baseTypeNode.expression); + var base = ts2.isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression); + if (!base) + return; + var name2 = ts2.unescapeLeadingUnderscores(ts2.getTextOfPropertyName(classElement.name)); + var symbol = ts2.hasStaticModifier(classElement) ? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name2) : typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name2); + if (!symbol) + return; + return getDefinitionFromSymbol(typeChecker, symbol, node); + } + function getReferenceAtPosition(sourceFile, position, program) { + var _a2, _b; + var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + var file = program.getSourceFileFromReference(sourceFile, referencePath); + return file && { reference: referencePath, fileName: file.fileName, file, unverified: false }; + } + var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName, typeReferenceDirective.resolutionMode || sourceFile.impliedNodeFormat); + var file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { reference: typeReferenceDirective, fileName: file.fileName, file, unverified: false }; + } + var libReferenceDirective = findReferenceInPosition(sourceFile.libReferenceDirectives, position); + if (libReferenceDirective) { + var file = program.getLibFileFromReference(libReferenceDirective); + return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false }; + } + if ((_a2 = sourceFile.resolvedModules) === null || _a2 === void 0 ? void 0 : _a2.size()) { + var node = ts2.getTouchingToken(sourceFile, position); + if (ts2.isModuleSpecifierLike(node) && ts2.isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, ts2.getModeForUsageLocation(sourceFile, node))) { + var verifiedFileName = (_b = sourceFile.resolvedModules.get(node.text, ts2.getModeForUsageLocation(sourceFile, node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName; + var fileName = verifiedFileName || ts2.resolvePath(ts2.getDirectoryPath(sourceFile.fileName), node.text); + return { + file: program.getSourceFile(fileName), + fileName, + reference: { + pos: node.getStart(), + end: node.getEnd(), + fileName: node.text + }, + unverified: !verifiedFileName + }; + } + } + return void 0; + } + GoToDefinition2.getReferenceAtPosition = getReferenceAtPosition; + function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { + var node = ts2.getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + if (ts2.isImportMeta(node.parent) && node.parent.name === node) { + return definitionFromType( + typeChecker.getTypeAtLocation(node.parent), + typeChecker, + node.parent, + /*failedAliasResolution*/ + false + ); + } + var _a2 = getSymbol( + node, + typeChecker, + /*stopAtAlias*/ + false + ), symbol = _a2.symbol, failedAliasResolution = _a2.failedAliasResolution; + if (!symbol) + return void 0; + var typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + var returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker); + var fromReturnType = returnType && definitionFromType(returnType, typeChecker, node, failedAliasResolution); + var typeDefinitions = fromReturnType && fromReturnType.length !== 0 ? fromReturnType : definitionFromType(typeAtLocation, typeChecker, node, failedAliasResolution); + return typeDefinitions.length ? typeDefinitions : !(symbol.flags & 111551) && symbol.flags & 788968 ? getDefinitionFromSymbol(typeChecker, ts2.skipAlias(symbol, typeChecker), node, failedAliasResolution) : void 0; + } + GoToDefinition2.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition; + function definitionFromType(type3, checker, node, failedAliasResolution) { + return ts2.flatMap(type3.isUnion() && !(type3.flags & 32) ? type3.types : [type3], function(t8) { + return t8.symbol && getDefinitionFromSymbol(checker, t8.symbol, node, failedAliasResolution); + }); + } + function tryGetReturnTypeOfFunction(symbol, type3, checker) { + if (type3.symbol === symbol || // At `const f = () => {}`, the symbol is `f` and the type symbol is at `() => {}` + symbol.valueDeclaration && type3.symbol && ts2.isVariableDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.initializer === type3.symbol.valueDeclaration) { + var sigs = type3.getCallSignatures(); + if (sigs.length === 1) + return checker.getReturnTypeOfSignature(ts2.first(sigs)); + } + return void 0; + } + function getDefinitionAndBoundSpan(program, sourceFile, position) { + var definitions = getDefinitionAtPosition(program, sourceFile, position); + if (!definitions || definitions.length === 0) { + return void 0; + } + var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position) || findReferenceInPosition(sourceFile.libReferenceDirectives, position); + if (comment) { + return { definitions, textSpan: ts2.createTextSpanFromRange(comment) }; + } + var node = ts2.getTouchingPropertyName(sourceFile, position); + var textSpan = ts2.createTextSpan(node.getStart(), node.getWidth()); + return { definitions, textSpan }; + } + GoToDefinition2.getDefinitionAndBoundSpan = getDefinitionAndBoundSpan; + function getDefinitionInfoForIndexSignatures(node, checker) { + return ts2.mapDefined(checker.getIndexInfosAtLocation(node), function(info2) { + return info2.declaration && createDefinitionFromSignatureDeclaration(checker, info2.declaration); + }); + } + function getSymbol(node, checker, stopAtAlias) { + var symbol = checker.getSymbolAtLocation(node); + var failedAliasResolution = false; + if ((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) && symbol.flags & 2097152 && !stopAtAlias && shouldSkipAlias(node, symbol.declarations[0])) { + var aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return { symbol: aliased }; + } else { + failedAliasResolution = true; + } + } + return { symbol, failedAliasResolution }; + } + function shouldSkipAlias(node, declaration) { + if (node.kind !== 79) { + return false; + } + if (node.parent === declaration) { + return true; + } + if (declaration.kind === 271) { + return false; + } + return true; + } + function isExpandoDeclaration(node) { + if (!ts2.isAssignmentDeclaration(node)) + return false; + var containingAssignment = ts2.findAncestor(node, function(p7) { + if (ts2.isAssignmentExpression(p7)) + return true; + if (!ts2.isAssignmentDeclaration(p7)) + return "quit"; + return false; + }); + return !!containingAssignment && ts2.getAssignmentDeclarationKind(containingAssignment) === 5; + } + function getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, excludeDeclaration) { + var filteredDeclarations = ts2.filter(symbol.declarations, function(d7) { + return d7 !== excludeDeclaration; + }); + var withoutExpandos = ts2.filter(filteredDeclarations, function(d7) { + return !isExpandoDeclaration(d7); + }); + var results = ts2.some(withoutExpandos) ? withoutExpandos : filteredDeclarations; + return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts2.map(results, function(declaration) { + return createDefinitionInfo( + declaration, + typeChecker, + symbol, + node, + /*unverified*/ + false, + failedAliasResolution + ); + }); + function getConstructSignatureDefinition() { + if (symbol.flags & 32 && !(symbol.flags & (16 | 3)) && (ts2.isNewExpressionTarget(node) || node.kind === 135)) { + var cls = ts2.find(filteredDeclarations, ts2.isClassLike) || ts2.Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition( + cls.members, + /*selectConstructors*/ + true + ); + } + } + function getCallSignatureDefinition() { + return ts2.isCallOrNewExpressionTarget(node) || ts2.isNameOfFunctionDeclaration(node) ? getSignatureDefinition( + filteredDeclarations, + /*selectConstructors*/ + false + ) : void 0; + } + function getSignatureDefinition(signatureDeclarations, selectConstructors) { + if (!signatureDeclarations) { + return void 0; + } + var declarations = signatureDeclarations.filter(selectConstructors ? ts2.isConstructorDeclaration : ts2.isFunctionLike); + var declarationsWithBody = declarations.filter(function(d7) { + return !!d7.body; + }); + return declarations.length ? declarationsWithBody.length !== 0 ? declarationsWithBody.map(function(x7) { + return createDefinitionInfo(x7, typeChecker, symbol, node); + }) : [createDefinitionInfo( + ts2.last(declarations), + typeChecker, + symbol, + node, + /*unverified*/ + false, + failedAliasResolution + )] : void 0; + } + } + function createDefinitionInfo(declaration, checker, symbol, node, unverified, failedAliasResolution) { + var symbolName = checker.symbolToString(symbol); + var symbolKind = ts2.SymbolDisplay.getSymbolKind(checker, symbol, node); + var containerName = symbol.parent ? checker.symbolToString(symbol.parent, node) : ""; + return createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName, containerName, unverified, failedAliasResolution); + } + GoToDefinition2.createDefinitionInfo = createDefinitionInfo; + function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName, containerName, unverified, failedAliasResolution, textSpan) { + var sourceFile = declaration.getSourceFile(); + if (!textSpan) { + var name2 = ts2.getNameOfDeclaration(declaration) || declaration; + textSpan = ts2.createTextSpanFromNode(name2, sourceFile); + } + return __assign16(__assign16({ + fileName: sourceFile.fileName, + textSpan, + kind: symbolKind, + name: symbolName, + containerKind: void 0, + // TODO: GH#18217 + containerName + }, ts2.FindAllReferences.toContextSpan(textSpan, sourceFile, ts2.FindAllReferences.getContextNode(declaration))), { isLocal: !isDefinitionVisible(checker, declaration), isAmbient: !!(declaration.flags & 16777216), unverified, failedAliasResolution }); + } + function isDefinitionVisible(checker, declaration) { + if (checker.isDeclarationVisible(declaration)) + return true; + if (!declaration.parent) + return false; + if (ts2.hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) + return isDefinitionVisible(checker, declaration.parent); + switch (declaration.kind) { + case 169: + case 174: + case 175: + case 171: + if (ts2.hasEffectiveModifier( + declaration, + 8 + /* ModifierFlags.Private */ + )) + return false; + case 173: + case 299: + case 300: + case 207: + case 228: + case 216: + case 215: + return isDefinitionVisible(checker, declaration.parent); + default: + return false; + } + } + function createDefinitionFromSignatureDeclaration(typeChecker, decl, failedAliasResolution) { + return createDefinitionInfo( + decl, + typeChecker, + decl.symbol, + decl, + /*unverified*/ + false, + failedAliasResolution + ); + } + function findReferenceInPosition(refs, pos) { + return ts2.find(refs, function(ref) { + return ts2.textRangeContainsPositionInclusive(ref, pos); + }); + } + GoToDefinition2.findReferenceInPosition = findReferenceInPosition; + function getDefinitionInfoForFileReference(name2, targetFileName, unverified) { + return { + fileName: targetFileName, + textSpan: ts2.createTextSpanFromBounds(0, 0), + kind: "script", + name: name2, + containerName: void 0, + containerKind: void 0, + unverified + }; + } + function getAncestorCallLikeExpression(node) { + var target = ts2.findAncestor(node, function(n7) { + return !ts2.isRightSideOfPropertyAccess(n7); + }); + var callLike = target === null || target === void 0 ? void 0 : target.parent; + return callLike && ts2.isCallLikeExpression(callLike) && ts2.getInvokedExpression(callLike) === target ? callLike : void 0; + } + function tryGetSignatureDeclaration(typeChecker, node) { + var callLike = getAncestorCallLikeExpression(node); + var signature = callLike && typeChecker.getResolvedSignature(callLike); + return ts2.tryCast(signature && signature.declaration, function(d7) { + return ts2.isFunctionLike(d7) && !ts2.isFunctionTypeNode(d7); + }); + } + function isConstructorLike(node) { + switch (node.kind) { + case 173: + case 182: + case 177: + return true; + default: + return false; + } + } + })(GoToDefinition = ts2.GoToDefinition || (ts2.GoToDefinition = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var JsDoc; + (function(JsDoc2) { + var jsDocTagNames = [ + "abstract", + "access", + "alias", + "argument", + "async", + "augments", + "author", + "borrows", + "callback", + "class", + "classdesc", + "constant", + "constructor", + "constructs", + "copyright", + "default", + "deprecated", + "description", + "emits", + "enum", + "event", + "example", + "exports", + "extends", + "external", + "field", + "file", + "fileoverview", + "fires", + "function", + "generator", + "global", + "hideconstructor", + "host", + "ignore", + "implements", + "inheritdoc", + "inner", + "instance", + "interface", + "kind", + "lends", + "license", + "link", + "listens", + "member", + "memberof", + "method", + "mixes", + "module", + "name", + "namespace", + "override", + "package", + "param", + "private", + "property", + "protected", + "public", + "readonly", + "requires", + "returns", + "see", + "since", + "static", + "summary", + "template", + "this", + "throws", + "todo", + "tutorial", + "type", + "typedef", + "var", + "variation", + "version", + "virtual", + "yields" + ]; + var jsDocTagNameCompletionEntries; + var jsDocTagCompletionEntries; + function getJsDocCommentsFromDeclarations(declarations, checker) { + var parts = []; + ts2.forEachUnique(declarations, function(declaration) { + for (var _i = 0, _a2 = getCommentHavingNodes(declaration); _i < _a2.length; _i++) { + var jsdoc = _a2[_i]; + var inheritDoc = ts2.isJSDoc(jsdoc) && jsdoc.tags && ts2.find(jsdoc.tags, function(t8) { + return t8.kind === 330 && (t8.tagName.escapedText === "inheritDoc" || t8.tagName.escapedText === "inheritdoc"); + }); + if (jsdoc.comment === void 0 && !inheritDoc || ts2.isJSDoc(jsdoc) && declaration.kind !== 348 && declaration.kind !== 341 && jsdoc.tags && jsdoc.tags.some(function(t8) { + return t8.kind === 348 || t8.kind === 341; + }) && !jsdoc.tags.some(function(t8) { + return t8.kind === 343 || t8.kind === 344; + })) { + continue; + } + var newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; + if (inheritDoc && inheritDoc.comment) { + newparts = newparts.concat(getDisplayPartsFromComment(inheritDoc.comment, checker)); + } + if (!ts2.contains(parts, newparts, isIdenticalListOfDisplayParts)) { + parts.push(newparts); + } + } + }); + return ts2.flatten(ts2.intersperse(parts, [ts2.lineBreakPart()])); + } + JsDoc2.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function isIdenticalListOfDisplayParts(parts1, parts2) { + return ts2.arraysEqual(parts1, parts2, function(p1, p22) { + return p1.kind === p22.kind && p1.text === p22.text; + }); + } + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 343: + case 350: + return [declaration]; + case 341: + case 348: + return [declaration, declaration.parent]; + default: + return ts2.getJSDocCommentsAndTags(declaration); + } + } + function getJsDocTagsFromDeclarations(declarations, checker) { + var infos = []; + ts2.forEachUnique(declarations, function(declaration) { + var tags6 = ts2.getJSDocTags(declaration); + if (tags6.some(function(t8) { + return t8.kind === 348 || t8.kind === 341; + }) && !tags6.some(function(t8) { + return t8.kind === 343 || t8.kind === 344; + })) { + return; + } + for (var _i = 0, tags_1 = tags6; _i < tags_1.length; _i++) { + var tag = tags_1[_i]; + infos.push({ name: tag.tagName.text, text: getCommentDisplayParts(tag, checker) }); + } + }); + return infos; + } + JsDoc2.getJsDocTagsFromDeclarations = getJsDocTagsFromDeclarations; + function getDisplayPartsFromComment(comment, checker) { + if (typeof comment === "string") { + return [ts2.textPart(comment)]; + } + return ts2.flatMap(comment, function(node) { + return node.kind === 324 ? [ts2.textPart(node.text)] : ts2.buildLinkParts(node, checker); + }); + } + function getCommentDisplayParts(tag, checker) { + var comment = tag.comment, kind = tag.kind; + var namePart = getTagNameDisplayPart(kind); + switch (kind) { + case 332: + return withNode(tag.class); + case 331: + return withNode(tag.class); + case 347: + var templateTag = tag; + var displayParts_3 = []; + if (templateTag.constraint) { + displayParts_3.push(ts2.textPart(templateTag.constraint.getText())); + } + if (ts2.length(templateTag.typeParameters)) { + if (ts2.length(displayParts_3)) { + displayParts_3.push(ts2.spacePart()); + } + var lastTypeParameter_1 = templateTag.typeParameters[templateTag.typeParameters.length - 1]; + ts2.forEach(templateTag.typeParameters, function(tp) { + displayParts_3.push(namePart(tp.getText())); + if (lastTypeParameter_1 !== tp) { + displayParts_3.push.apply(displayParts_3, [ts2.punctuationPart( + 27 + /* SyntaxKind.CommaToken */ + ), ts2.spacePart()]); + } + }); + } + if (comment) { + displayParts_3.push.apply(displayParts_3, __spreadArray9([ts2.spacePart()], getDisplayPartsFromComment(comment, checker), true)); + } + return displayParts_3; + case 346: + return withNode(tag.typeExpression); + case 348: + case 341: + case 350: + case 343: + case 349: + var name2 = tag.name; + return name2 ? withNode(name2) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); + default: + return comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); + } + function withNode(node) { + return addComment(node.getText()); + } + function addComment(s7) { + if (comment) { + if (s7.match(/^https?$/)) { + return __spreadArray9([ts2.textPart(s7)], getDisplayPartsFromComment(comment, checker), true); + } else { + return __spreadArray9([namePart(s7), ts2.spacePart()], getDisplayPartsFromComment(comment, checker), true); + } + } else { + return [ts2.textPart(s7)]; + } + } + } + function getTagNameDisplayPart(kind) { + switch (kind) { + case 343: + return ts2.parameterNamePart; + case 350: + return ts2.propertyNamePart; + case 347: + return ts2.typeParameterNamePart; + case 348: + case 341: + return ts2.typeAliasNamePart; + default: + return ts2.textPart; + } + } + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts2.map(jsDocTagNames, function(tagName) { + return { + name: tagName, + kind: "keyword", + kindModifiers: "", + sortText: ts2.Completions.SortText.LocationPriority + }; + })); + } + JsDoc2.getJSDocTagNameCompletions = getJSDocTagNameCompletions; + JsDoc2.getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails; + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts2.map(jsDocTagNames, function(tagName) { + return { + name: "@".concat(tagName), + kind: "keyword", + kindModifiers: "", + sortText: ts2.Completions.SortText.LocationPriority + }; + })); + } + JsDoc2.getJSDocTagCompletions = getJSDocTagCompletions; + function getJSDocTagCompletionDetails(name2) { + return { + name: name2, + kind: "", + kindModifiers: "", + displayParts: [ts2.textPart(name2)], + documentation: ts2.emptyArray, + tags: void 0, + codeActions: void 0 + }; + } + JsDoc2.getJSDocTagCompletionDetails = getJSDocTagCompletionDetails; + function getJSDocParameterNameCompletions(tag) { + if (!ts2.isIdentifier(tag.name)) { + return ts2.emptyArray; + } + var nameThusFar = tag.name.text; + var jsdoc = tag.parent; + var fn = jsdoc.parent; + if (!ts2.isFunctionLike(fn)) + return []; + return ts2.mapDefined(fn.parameters, function(param) { + if (!ts2.isIdentifier(param.name)) + return void 0; + var name2 = param.name.text; + if (jsdoc.tags.some(function(t8) { + return t8 !== tag && ts2.isJSDocParameterTag(t8) && ts2.isIdentifier(t8.name) && t8.name.escapedText === name2; + }) || nameThusFar !== void 0 && !ts2.startsWith(name2, nameThusFar)) { + return void 0; + } + return { name: name2, kind: "parameter", kindModifiers: "", sortText: ts2.Completions.SortText.LocationPriority }; + }); + } + JsDoc2.getJSDocParameterNameCompletions = getJSDocParameterNameCompletions; + function getJSDocParameterNameCompletionDetails(name2) { + return { + name: name2, + kind: "parameter", + kindModifiers: "", + displayParts: [ts2.textPart(name2)], + documentation: ts2.emptyArray, + tags: void 0, + codeActions: void 0 + }; + } + JsDoc2.getJSDocParameterNameCompletionDetails = getJSDocParameterNameCompletionDetails; + function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options) { + var tokenAtPos = ts2.getTokenAtPosition(sourceFile, position); + var existingDocComment = ts2.findAncestor(tokenAtPos, ts2.isJSDoc); + if (existingDocComment && (existingDocComment.comment !== void 0 || ts2.length(existingDocComment.tags))) { + return void 0; + } + var tokenStart = tokenAtPos.getStart(sourceFile); + if (!existingDocComment && tokenStart < position) { + return void 0; + } + var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos, options); + if (!commentOwnerInfo) { + return void 0; + } + var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters, hasReturn2 = commentOwnerInfo.hasReturn; + var commentOwnerJsDoc = ts2.hasJSDocNodes(commentOwner) && commentOwner.jsDoc ? commentOwner.jsDoc : void 0; + var lastJsDoc = ts2.lastOrUndefined(commentOwnerJsDoc); + if (commentOwner.getStart(sourceFile) < position || lastJsDoc && existingDocComment && lastJsDoc !== existingDocComment) { + return void 0; + } + var indentationStr = getIndentationStringAtPosition(sourceFile, position); + var isJavaScriptFile = ts2.hasJSFileExtension(sourceFile.fileName); + var tags6 = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : ""); + var openComment = "/**"; + var closeComment = " */"; + var hasTag = (commentOwnerJsDoc || []).some(function(jsDoc) { + return !!jsDoc.tags; + }); + if (tags6 && !hasTag) { + var preamble = openComment + newLine + indentationStr + " * "; + var endLine = tokenStart === position ? newLine + indentationStr : ""; + var result2 = preamble + newLine + tags6 + indentationStr + closeComment + endLine; + return { newText: result2, caretOffset: preamble.length }; + } + return { newText: openComment + closeComment, caretOffset: 3 }; + } + JsDoc2.getDocCommentTemplateAtPosition = getDocCommentTemplateAtPosition; + function getIndentationStringAtPosition(sourceFile, position) { + var text = sourceFile.text; + var lineStart = ts2.getLineStartPositionForPosition(position, sourceFile); + var pos = lineStart; + for (; pos <= position && ts2.isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) + ; + return text.slice(lineStart, pos); + } + function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) { + return parameters.map(function(_a2, i7) { + var name2 = _a2.name, dotDotDotToken = _a2.dotDotDotToken; + var paramName = name2.kind === 79 ? name2.text : "param" + i7; + var type3 = isJavaScriptFile ? dotDotDotToken ? "{...any} " : "{any} " : ""; + return "".concat(indentationStr, " * @param ").concat(type3).concat(paramName).concat(newLine); + }).join(""); + } + function returnsDocComment(indentationStr, newLine) { + return "".concat(indentationStr, " * @returns").concat(newLine); + } + function getCommentOwnerInfo(tokenAtPos, options) { + return ts2.forEachAncestor(tokenAtPos, function(n7) { + return getCommentOwnerInfoWorker(n7, options); + }); + } + function getCommentOwnerInfoWorker(commentOwner, options) { + switch (commentOwner.kind) { + case 259: + case 215: + case 171: + case 173: + case 170: + case 216: + var host = commentOwner; + return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; + case 299: + return getCommentOwnerInfoWorker(commentOwner.initializer, options); + case 260: + case 261: + case 263: + case 302: + case 262: + return { commentOwner }; + case 168: { + var host_1 = commentOwner; + return host_1.type && ts2.isFunctionTypeNode(host_1.type) ? { commentOwner, parameters: host_1.type.parameters, hasReturn: hasReturn(host_1.type, options) } : { commentOwner }; + } + case 240: { + var varStatement = commentOwner; + var varDeclarations = varStatement.declarationList.declarations; + var host_2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0; + return host_2 ? { commentOwner, parameters: host_2.parameters, hasReturn: hasReturn(host_2, options) } : { commentOwner }; + } + case 308: + return "quit"; + case 264: + return commentOwner.parent.kind === 264 ? void 0 : { commentOwner }; + case 241: + return getCommentOwnerInfoWorker(commentOwner.expression, options); + case 223: { + var be4 = commentOwner; + if (ts2.getAssignmentDeclarationKind(be4) === 0) { + return "quit"; + } + return ts2.isFunctionLike(be4.right) ? { commentOwner, parameters: be4.right.parameters, hasReturn: hasReturn(be4.right, options) } : { commentOwner }; + } + case 169: + var init2 = commentOwner.initializer; + if (init2 && (ts2.isFunctionExpression(init2) || ts2.isArrowFunction(init2))) { + return { commentOwner, parameters: init2.parameters, hasReturn: hasReturn(init2, options) }; + } + } + } + function hasReturn(node, options) { + return !!(options === null || options === void 0 ? void 0 : options.generateReturnInDocTemplate) && (ts2.isFunctionTypeNode(node) || ts2.isArrowFunction(node) && ts2.isExpression(node.body) || ts2.isFunctionLikeDeclaration(node) && node.body && ts2.isBlock(node.body) && !!ts2.forEachReturnStatement(node.body, function(n7) { + return n7; + })); + } + function getRightHandSideOfAssignment(rightHandSide) { + while (rightHandSide.kind === 214) { + rightHandSide = rightHandSide.expression; + } + switch (rightHandSide.kind) { + case 215: + case 216: + return rightHandSide; + case 228: + return ts2.find(rightHandSide.members, ts2.isConstructorDeclaration); + } + } + })(JsDoc = ts2.JsDoc || (ts2.JsDoc = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var NavigateTo; + (function(NavigateTo2) { + function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles) { + var patternMatcher = ts2.createPatternMatcher(searchValue); + if (!patternMatcher) + return ts2.emptyArray; + var rawItems = []; + var _loop_5 = function(sourceFile2) { + cancellationToken.throwIfCancellationRequested(); + if (excludeDtsFiles && sourceFile2.isDeclarationFile) { + return "continue"; + } + sourceFile2.getNamedDeclarations().forEach(function(declarations, name2) { + getItemsFromNamedDeclaration(patternMatcher, name2, declarations, checker, sourceFile2.fileName, rawItems); + }); + }; + for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { + var sourceFile = sourceFiles_4[_i]; + _loop_5(sourceFile); + } + rawItems.sort(compareNavigateToItems); + return (maxResultCount === void 0 ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); + } + NavigateTo2.getNavigateToItems = getNavigateToItems; + function getItemsFromNamedDeclaration(patternMatcher, name2, declarations, checker, fileName, rawItems) { + var match = patternMatcher.getMatchForLastSegmentOfPattern(name2); + if (!match) { + return; + } + for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { + var declaration = declarations_3[_i]; + if (!shouldKeepItem(declaration, checker)) + continue; + if (patternMatcher.patternContainsDots) { + var fullMatch = patternMatcher.getFullMatch(getContainers(declaration), name2); + if (fullMatch) { + rawItems.push({ name: name2, fileName, matchKind: fullMatch.kind, isCaseSensitive: fullMatch.isCaseSensitive, declaration }); + } + } else { + rawItems.push({ name: name2, fileName, matchKind: match.kind, isCaseSensitive: match.isCaseSensitive, declaration }); + } + } + } + function shouldKeepItem(declaration, checker) { + switch (declaration.kind) { + case 270: + case 273: + case 268: + var importer = checker.getSymbolAtLocation(declaration.name); + var imported = checker.getAliasedSymbol(importer); + return importer.escapedName !== imported.escapedName; + default: + return true; + } + } + function tryAddSingleDeclarationName(declaration, containers) { + var name2 = ts2.getNameOfDeclaration(declaration); + return !!name2 && (pushLiteral(name2, containers) || name2.kind === 164 && tryAddComputedPropertyName(name2.expression, containers)); + } + function tryAddComputedPropertyName(expression, containers) { + return pushLiteral(expression, containers) || ts2.isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers); + } + function pushLiteral(node, containers) { + return ts2.isPropertyNameLiteral(node) && (containers.push(ts2.getTextOfIdentifierOrLiteral(node)), true); + } + function getContainers(declaration) { + var containers = []; + var name2 = ts2.getNameOfDeclaration(declaration); + if (name2 && name2.kind === 164 && !tryAddComputedPropertyName(name2.expression, containers)) { + return ts2.emptyArray; + } + containers.shift(); + var container = ts2.getContainerNode(declaration); + while (container) { + if (!tryAddSingleDeclarationName(container, containers)) { + return ts2.emptyArray; + } + container = ts2.getContainerNode(container); + } + return containers.reverse(); + } + function compareNavigateToItems(i1, i22) { + return ts2.compareValues(i1.matchKind, i22.matchKind) || ts2.compareStringsCaseSensitiveUI(i1.name, i22.name); + } + function createNavigateToItem(rawItem) { + var declaration = rawItem.declaration; + var container = ts2.getContainerNode(declaration); + var containerName = container && ts2.getNameOfDeclaration(container); + return { + name: rawItem.name, + kind: ts2.getNodeKind(declaration), + kindModifiers: ts2.getNodeModifiers(declaration), + matchKind: ts2.PatternMatchKind[rawItem.matchKind], + isCaseSensitive: rawItem.isCaseSensitive, + fileName: rawItem.fileName, + textSpan: ts2.createTextSpanFromNode(declaration), + // TODO(jfreeman): What should be the containerName when the container has a computed name? + containerName: containerName ? containerName.text : "", + containerKind: containerName ? ts2.getNodeKind(container) : "" + }; + } + })(NavigateTo = ts2.NavigateTo || (ts2.NavigateTo = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var NavigationBar; + (function(NavigationBar2) { + var _a2; + var whiteSpaceRegex = /\s+/g; + var maxLength = 150; + var curCancellationToken; + var curSourceFile; + var parentsStack = []; + var parent2; + var trackedEs5ClassesStack = []; + var trackedEs5Classes; + var emptyChildItemArray = []; + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; + curSourceFile = sourceFile; + try { + return ts2.map(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem); + } finally { + reset(); + } + } + NavigationBar2.getNavigationBarItems = getNavigationBarItems; + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; + curSourceFile = sourceFile; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } finally { + reset(); + } + } + NavigationBar2.getNavigationTree = getNavigationTree; + function reset() { + curSourceFile = void 0; + curCancellationToken = void 0; + parentsStack = []; + parent2 = void 0; + emptyChildItemArray = []; + } + function nodeText(node) { + return cleanText(node.getText(curSourceFile)); + } + function navigationBarNodeKind(n7) { + return n7.node.kind; + } + function pushChild(parent3, child) { + if (parent3.children) { + parent3.children.push(child); + } else { + parent3.children = [child]; + } + } + function rootNavigationBarNode(sourceFile) { + ts2.Debug.assert(!parentsStack.length); + var root2 = { node: sourceFile, name: void 0, additionalNodes: void 0, parent: void 0, children: void 0, indent: 0 }; + parent2 = root2; + for (var _i = 0, _a3 = sourceFile.statements; _i < _a3.length; _i++) { + var statement = _a3[_i]; + addChildrenRecursively(statement); + } + endNode(); + ts2.Debug.assert(!parent2 && !parentsStack.length); + return root2; + } + function addLeafNode(node, name2) { + pushChild(parent2, emptyNavigationBarNode(node, name2)); + } + function emptyNavigationBarNode(node, name2) { + return { + node, + name: name2 || (ts2.isDeclaration(node) || ts2.isExpression(node) ? ts2.getNameOfDeclaration(node) : void 0), + additionalNodes: void 0, + parent: parent2, + children: void 0, + indent: parent2.indent + 1 + }; + } + function addTrackedEs5Class(name2) { + if (!trackedEs5Classes) { + trackedEs5Classes = new ts2.Map(); + } + trackedEs5Classes.set(name2, true); + } + function endNestedNodes(depth) { + for (var i7 = 0; i7 < depth; i7++) + endNode(); + } + function startNestedNodes(targetNode, entityName) { + var names = []; + while (!ts2.isPropertyNameLiteral(entityName)) { + var name2 = ts2.getNameOrArgument(entityName); + var nameText = ts2.getElementOrPropertyAccessName(entityName); + entityName = entityName.expression; + if (nameText === "prototype" || ts2.isPrivateIdentifier(name2)) + continue; + names.push(name2); + } + names.push(entityName); + for (var i7 = names.length - 1; i7 > 0; i7--) { + var name2 = names[i7]; + startNode(targetNode, name2); + } + return [names.length - 1, names[0]]; + } + function startNode(node, name2) { + var navNode = emptyNavigationBarNode(node, name2); + pushChild(parent2, navNode); + parentsStack.push(parent2); + trackedEs5ClassesStack.push(trackedEs5Classes); + trackedEs5Classes = void 0; + parent2 = navNode; + } + function endNode() { + if (parent2.children) { + mergeChildren(parent2.children, parent2); + sortChildren(parent2.children); + } + parent2 = parentsStack.pop(); + trackedEs5Classes = trackedEs5ClassesStack.pop(); + } + function addNodeWithRecursiveChild(node, child, name2) { + startNode(node, name2); + addChildrenRecursively(child); + endNode(); + } + function addNodeWithRecursiveInitializer(node) { + if (node.initializer && isFunctionOrClassExpression(node.initializer)) { + startNode(node); + ts2.forEachChild(node.initializer, addChildrenRecursively); + endNode(); + } else { + addNodeWithRecursiveChild(node, node.initializer); + } + } + function hasNavigationBarName(node) { + return !ts2.hasDynamicName(node) || node.kind !== 223 && ts2.isPropertyAccessExpression(node.name.expression) && ts2.isIdentifier(node.name.expression.expression) && ts2.idText(node.name.expression.expression) === "Symbol"; + } + function addChildrenRecursively(node) { + var _a3; + curCancellationToken.throwIfCancellationRequested(); + if (!node || ts2.isToken(node)) { + return; + } + switch (node.kind) { + case 173: + var ctr = node; + addNodeWithRecursiveChild(ctr, ctr.body); + for (var _i = 0, _b = ctr.parameters; _i < _b.length; _i++) { + var param = _b[_i]; + if (ts2.isParameterPropertyDeclaration(param, ctr)) { + addLeafNode(param); + } + } + break; + case 171: + case 174: + case 175: + case 170: + if (hasNavigationBarName(node)) { + addNodeWithRecursiveChild(node, node.body); + } + break; + case 169: + if (hasNavigationBarName(node)) { + addNodeWithRecursiveInitializer(node); + } + break; + case 168: + if (hasNavigationBarName(node)) { + addLeafNode(node); + } + break; + case 270: + var importClause = node; + if (importClause.name) { + addLeafNode(importClause.name); + } + var namedBindings = importClause.namedBindings; + if (namedBindings) { + if (namedBindings.kind === 271) { + addLeafNode(namedBindings); + } else { + for (var _c = 0, _d = namedBindings.elements; _c < _d.length; _c++) { + var element = _d[_c]; + addLeafNode(element); + } + } + } + break; + case 300: + addNodeWithRecursiveChild(node, node.name); + break; + case 301: + var expression = node.expression; + ts2.isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); + break; + case 205: + case 299: + case 257: { + var child = node; + if (ts2.isBindingPattern(child.name)) { + addChildrenRecursively(child.name); + } else { + addNodeWithRecursiveInitializer(child); + } + break; + } + case 259: + var nameNode = node.name; + if (nameNode && ts2.isIdentifier(nameNode)) { + addTrackedEs5Class(nameNode.text); + } + addNodeWithRecursiveChild(node, node.body); + break; + case 216: + case 215: + addNodeWithRecursiveChild(node, node.body); + break; + case 263: + startNode(node); + for (var _e2 = 0, _f = node.members; _e2 < _f.length; _e2++) { + var member = _f[_e2]; + if (!isComputedProperty(member)) { + addLeafNode(member); + } + } + endNode(); + break; + case 260: + case 228: + case 261: + startNode(node); + for (var _g = 0, _h = node.members; _g < _h.length; _g++) { + var member = _h[_g]; + addChildrenRecursively(member); + } + endNode(); + break; + case 264: + addNodeWithRecursiveChild(node, getInteriorModule(node).body); + break; + case 274: { + var expression_1 = node.expression; + var child = ts2.isObjectLiteralExpression(expression_1) || ts2.isCallExpression(expression_1) ? expression_1 : ts2.isArrowFunction(expression_1) || ts2.isFunctionExpression(expression_1) ? expression_1.body : void 0; + if (child) { + startNode(node); + addChildrenRecursively(child); + endNode(); + } else { + addLeafNode(node); + } + break; + } + case 278: + case 268: + case 178: + case 176: + case 177: + case 262: + addLeafNode(node); + break; + case 210: + case 223: { + var special = ts2.getAssignmentDeclarationKind(node); + switch (special) { + case 1: + case 2: + addNodeWithRecursiveChild(node, node.right); + return; + case 6: + case 3: { + var binaryExpression = node; + var assignmentTarget = binaryExpression.left; + var prototypeAccess = special === 3 ? assignmentTarget.expression : assignmentTarget; + var depth = 0; + var className = void 0; + if (ts2.isIdentifier(prototypeAccess.expression)) { + addTrackedEs5Class(prototypeAccess.expression.text); + className = prototypeAccess.expression; + } else { + _a3 = startNestedNodes(binaryExpression, prototypeAccess.expression), depth = _a3[0], className = _a3[1]; + } + if (special === 6) { + if (ts2.isObjectLiteralExpression(binaryExpression.right)) { + if (binaryExpression.right.properties.length > 0) { + startNode(binaryExpression, className); + ts2.forEachChild(binaryExpression.right, addChildrenRecursively); + endNode(); + } + } + } else if (ts2.isFunctionExpression(binaryExpression.right) || ts2.isArrowFunction(binaryExpression.right)) { + addNodeWithRecursiveChild(node, binaryExpression.right, className); + } else { + startNode(binaryExpression, className); + addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name); + endNode(); + } + endNestedNodes(depth); + return; + } + case 7: + case 9: { + var defineCall = node; + var className = special === 7 ? defineCall.arguments[0] : defineCall.arguments[0].expression; + var memberName = defineCall.arguments[1]; + var _j = startNestedNodes(node, className), depth = _j[0], classNameIdentifier = _j[1]; + startNode(node, classNameIdentifier); + startNode(node, ts2.setTextRange(ts2.factory.createIdentifier(memberName.text), memberName)); + addChildrenRecursively(node.arguments[2]); + endNode(); + endNode(); + endNestedNodes(depth); + return; + } + case 5: { + var binaryExpression = node; + var assignmentTarget = binaryExpression.left; + var targetFunction = assignmentTarget.expression; + if (ts2.isIdentifier(targetFunction) && ts2.getElementOrPropertyAccessName(assignmentTarget) !== "prototype" && trackedEs5Classes && trackedEs5Classes.has(targetFunction.text)) { + if (ts2.isFunctionExpression(binaryExpression.right) || ts2.isArrowFunction(binaryExpression.right)) { + addNodeWithRecursiveChild(node, binaryExpression.right, targetFunction); + } else if (ts2.isBindableStaticAccessExpression(assignmentTarget)) { + startNode(binaryExpression, targetFunction); + addNodeWithRecursiveChild(binaryExpression.left, binaryExpression.right, ts2.getNameOrArgument(assignmentTarget)); + endNode(); + } + return; + } + break; + } + case 4: + case 0: + case 8: + break; + default: + ts2.Debug.assertNever(special); + } + } + default: + if (ts2.hasJSDocNodes(node)) { + ts2.forEach(node.jsDoc, function(jsDoc) { + ts2.forEach(jsDoc.tags, function(tag) { + if (ts2.isJSDocTypeAlias(tag)) { + addLeafNode(tag); + } + }); + }); + } + ts2.forEachChild(node, addChildrenRecursively); + } + } + function mergeChildren(children, node) { + var nameToItems = new ts2.Map(); + ts2.filterMutate(children, function(child, index4) { + var declName = child.name || ts2.getNameOfDeclaration(child.node); + var name2 = declName && nodeText(declName); + if (!name2) { + return true; + } + var itemsWithSameName = nameToItems.get(name2); + if (!itemsWithSameName) { + nameToItems.set(name2, child); + return true; + } + if (itemsWithSameName instanceof Array) { + for (var _i = 0, itemsWithSameName_1 = itemsWithSameName; _i < itemsWithSameName_1.length; _i++) { + var itemWithSameName = itemsWithSameName_1[_i]; + if (tryMerge(itemWithSameName, child, index4, node)) { + return false; + } + } + itemsWithSameName.push(child); + return true; + } else { + var itemWithSameName = itemsWithSameName; + if (tryMerge(itemWithSameName, child, index4, node)) { + return false; + } + nameToItems.set(name2, [itemWithSameName, child]); + return true; + } + }); + } + var isEs5ClassMember = (_a2 = {}, _a2[ + 5 + /* AssignmentDeclarationKind.Property */ + ] = true, _a2[ + 3 + /* AssignmentDeclarationKind.PrototypeProperty */ + ] = true, _a2[ + 7 + /* AssignmentDeclarationKind.ObjectDefinePropertyValue */ + ] = true, _a2[ + 9 + /* AssignmentDeclarationKind.ObjectDefinePrototypeProperty */ + ] = true, _a2[ + 0 + /* AssignmentDeclarationKind.None */ + ] = false, _a2[ + 1 + /* AssignmentDeclarationKind.ExportsProperty */ + ] = false, _a2[ + 2 + /* AssignmentDeclarationKind.ModuleExports */ + ] = false, _a2[ + 8 + /* AssignmentDeclarationKind.ObjectDefinePropertyExports */ + ] = false, _a2[ + 6 + /* AssignmentDeclarationKind.Prototype */ + ] = true, _a2[ + 4 + /* AssignmentDeclarationKind.ThisProperty */ + ] = false, _a2); + function tryMergeEs5Class(a7, b8, bIndex, parent3) { + function isPossibleConstructor(node) { + return ts2.isFunctionExpression(node) || ts2.isFunctionDeclaration(node) || ts2.isVariableDeclaration(node); + } + var bAssignmentDeclarationKind = ts2.isBinaryExpression(b8.node) || ts2.isCallExpression(b8.node) ? ts2.getAssignmentDeclarationKind(b8.node) : 0; + var aAssignmentDeclarationKind = ts2.isBinaryExpression(a7.node) || ts2.isCallExpression(a7.node) ? ts2.getAssignmentDeclarationKind(a7.node) : 0; + if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a7.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(b8.node) && isEs5ClassMember[aAssignmentDeclarationKind] || ts2.isClassDeclaration(a7.node) && isSynthesized(a7.node) && isEs5ClassMember[bAssignmentDeclarationKind] || ts2.isClassDeclaration(b8.node) && isEs5ClassMember[aAssignmentDeclarationKind] || ts2.isClassDeclaration(a7.node) && isSynthesized(a7.node) && isPossibleConstructor(b8.node) || ts2.isClassDeclaration(b8.node) && isPossibleConstructor(a7.node) && isSynthesized(a7.node)) { + var lastANode = a7.additionalNodes && ts2.lastOrUndefined(a7.additionalNodes) || a7.node; + if (!ts2.isClassDeclaration(a7.node) && !ts2.isClassDeclaration(b8.node) || isPossibleConstructor(a7.node) || isPossibleConstructor(b8.node)) { + var ctorFunction = isPossibleConstructor(a7.node) ? a7.node : isPossibleConstructor(b8.node) ? b8.node : void 0; + if (ctorFunction !== void 0) { + var ctorNode = ts2.setTextRange(ts2.factory.createConstructorDeclaration( + /* modifiers */ + void 0, + [], + /* body */ + void 0 + ), ctorFunction); + var ctor = emptyNavigationBarNode(ctorNode); + ctor.indent = a7.indent + 1; + ctor.children = a7.node === ctorFunction ? a7.children : b8.children; + a7.children = a7.node === ctorFunction ? ts2.concatenate([ctor], b8.children || [b8]) : ts2.concatenate(a7.children || [__assign16({}, a7)], [ctor]); + } else { + if (a7.children || b8.children) { + a7.children = ts2.concatenate(a7.children || [__assign16({}, a7)], b8.children || [b8]); + if (a7.children) { + mergeChildren(a7.children, a7); + sortChildren(a7.children); + } + } + } + lastANode = a7.node = ts2.setTextRange(ts2.factory.createClassDeclaration( + /* modifiers */ + void 0, + a7.name || ts2.factory.createIdentifier("__class__"), + /* typeParameters */ + void 0, + /* heritageClauses */ + void 0, + [] + ), a7.node); + } else { + a7.children = ts2.concatenate(a7.children, b8.children); + if (a7.children) { + mergeChildren(a7.children, a7); + } + } + var bNode = b8.node; + if (parent3.children[bIndex - 1].node.end === lastANode.end) { + ts2.setTextRange(lastANode, { pos: lastANode.pos, end: bNode.end }); + } else { + if (!a7.additionalNodes) + a7.additionalNodes = []; + a7.additionalNodes.push(ts2.setTextRange(ts2.factory.createClassDeclaration( + /* modifiers */ + void 0, + a7.name || ts2.factory.createIdentifier("__class__"), + /* typeParameters */ + void 0, + /* heritageClauses */ + void 0, + [] + ), b8.node)); + } + return true; + } + return bAssignmentDeclarationKind === 0 ? false : true; + } + function tryMerge(a7, b8, bIndex, parent3) { + if (tryMergeEs5Class(a7, b8, bIndex, parent3)) { + return true; + } + if (shouldReallyMerge(a7.node, b8.node, parent3)) { + merge7(a7, b8); + return true; + } + return false; + } + function shouldReallyMerge(a7, b8, parent3) { + if (a7.kind !== b8.kind || a7.parent !== b8.parent && !(isOwnChild(a7, parent3) && isOwnChild(b8, parent3))) { + return false; + } + switch (a7.kind) { + case 169: + case 171: + case 174: + case 175: + return ts2.isStatic(a7) === ts2.isStatic(b8); + case 264: + return areSameModule(a7, b8) && getFullyQualifiedModuleName(a7) === getFullyQualifiedModuleName(b8); + default: + return true; + } + } + function isSynthesized(node) { + return !!(node.flags & 8); + } + function isOwnChild(n7, parent3) { + var par = ts2.isModuleBlock(n7.parent) ? n7.parent.parent : n7.parent; + return par === parent3.node || ts2.contains(parent3.additionalNodes, par); + } + function areSameModule(a7, b8) { + if (!a7.body || !b8.body) { + return a7.body === b8.body; + } + return a7.body.kind === b8.body.kind && (a7.body.kind !== 264 || areSameModule(a7.body, b8.body)); + } + function merge7(target, source) { + var _a3; + target.additionalNodes = target.additionalNodes || []; + target.additionalNodes.push(source.node); + if (source.additionalNodes) { + (_a3 = target.additionalNodes).push.apply(_a3, source.additionalNodes); + } + target.children = ts2.concatenate(target.children, source.children); + if (target.children) { + mergeChildren(target.children, target); + sortChildren(target.children); + } + } + function sortChildren(children) { + children.sort(compareChildren); + } + function compareChildren(child1, child2) { + return ts2.compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || ts2.compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); + } + function tryGetName(node) { + if (node.kind === 264) { + return getModuleName(node); + } + var declName = ts2.getNameOfDeclaration(node); + if (declName && ts2.isPropertyName(declName)) { + var propertyName = ts2.getPropertyNameForPropertyNameNode(declName); + return propertyName && ts2.unescapeLeadingUnderscores(propertyName); + } + switch (node.kind) { + case 215: + case 216: + case 228: + return getFunctionOrClassName(node); + default: + return void 0; + } + } + function getItemName(node, name2) { + if (node.kind === 264) { + return cleanText(getModuleName(node)); + } + if (name2) { + var text = ts2.isIdentifier(name2) ? name2.text : ts2.isElementAccessExpression(name2) ? "[".concat(nodeText(name2.argumentExpression), "]") : nodeText(name2); + if (text.length > 0) { + return cleanText(text); + } + } + switch (node.kind) { + case 308: + var sourceFile = node; + return ts2.isExternalModule(sourceFile) ? '"'.concat(ts2.escapeString(ts2.getBaseFileName(ts2.removeFileExtension(ts2.normalizePath(sourceFile.fileName)))), '"') : ""; + case 274: + return ts2.isExportAssignment(node) && node.isExportEquals ? "export=" : "default"; + case 216: + case 259: + case 215: + case 260: + case 228: + if (ts2.getSyntacticModifierFlags(node) & 1024) { + return "default"; + } + return getFunctionOrClassName(node); + case 173: + return "constructor"; + case 177: + return "new()"; + case 176: + return "()"; + case 178: + return "[]"; + default: + return ""; + } + } + function primaryNavBarMenuItems(root2) { + var primaryNavBarMenuItems2 = []; + function recur(item) { + if (shouldAppearInPrimaryNavBarMenu(item)) { + primaryNavBarMenuItems2.push(item); + if (item.children) { + for (var _i = 0, _a3 = item.children; _i < _a3.length; _i++) { + var child = _a3[_i]; + recur(child); + } + } + } + } + recur(root2); + return primaryNavBarMenuItems2; + function shouldAppearInPrimaryNavBarMenu(item) { + if (item.children) { + return true; + } + switch (navigationBarNodeKind(item)) { + case 260: + case 228: + case 263: + case 261: + case 264: + case 308: + case 262: + case 348: + case 341: + return true; + case 216: + case 259: + case 215: + return isTopLevelFunctionDeclaration(item); + default: + return false; + } + function isTopLevelFunctionDeclaration(item2) { + if (!item2.node.body) { + return false; + } + switch (navigationBarNodeKind(item2.parent)) { + case 265: + case 308: + case 171: + case 173: + return true; + default: + return false; + } + } + } + } + function convertToTree(n7) { + return { + text: getItemName(n7.node, n7.name), + kind: ts2.getNodeKind(n7.node), + kindModifiers: getModifiers(n7.node), + spans: getSpans(n7), + nameSpan: n7.name && getNodeSpan(n7.name), + childItems: ts2.map(n7.children, convertToTree) + }; + } + function convertToPrimaryNavBarMenuItem(n7) { + return { + text: getItemName(n7.node, n7.name), + kind: ts2.getNodeKind(n7.node), + kindModifiers: getModifiers(n7.node), + spans: getSpans(n7), + childItems: ts2.map(n7.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray, + indent: n7.indent, + bolded: false, + grayed: false + }; + function convertToSecondaryNavBarMenuItem(n8) { + return { + text: getItemName(n8.node, n8.name), + kind: ts2.getNodeKind(n8.node), + kindModifiers: ts2.getNodeModifiers(n8.node), + spans: getSpans(n8), + childItems: emptyChildItemArray, + indent: 0, + bolded: false, + grayed: false + }; + } + } + function getSpans(n7) { + var spans = [getNodeSpan(n7.node)]; + if (n7.additionalNodes) { + for (var _i = 0, _a3 = n7.additionalNodes; _i < _a3.length; _i++) { + var node = _a3[_i]; + spans.push(getNodeSpan(node)); + } + } + return spans; + } + function getModuleName(moduleDeclaration) { + if (ts2.isAmbientModule(moduleDeclaration)) { + return ts2.getTextOfNode(moduleDeclaration.name); + } + return getFullyQualifiedModuleName(moduleDeclaration); + } + function getFullyQualifiedModuleName(moduleDeclaration) { + var result2 = [ts2.getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; + while (moduleDeclaration.body && moduleDeclaration.body.kind === 264) { + moduleDeclaration = moduleDeclaration.body; + result2.push(ts2.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + } + return result2.join("."); + } + function getInteriorModule(decl) { + return decl.body && ts2.isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; + } + function isComputedProperty(member) { + return !member.name || member.name.kind === 164; + } + function getNodeSpan(node) { + return node.kind === 308 ? ts2.createTextSpanFromRange(node) : ts2.createTextSpanFromNode(node, curSourceFile); + } + function getModifiers(node) { + if (node.parent && node.parent.kind === 257) { + node = node.parent; + } + return ts2.getNodeModifiers(node); + } + function getFunctionOrClassName(node) { + var parent3 = node.parent; + if (node.name && ts2.getFullWidth(node.name) > 0) { + return cleanText(ts2.declarationNameToString(node.name)); + } else if (ts2.isVariableDeclaration(parent3)) { + return cleanText(ts2.declarationNameToString(parent3.name)); + } else if (ts2.isBinaryExpression(parent3) && parent3.operatorToken.kind === 63) { + return nodeText(parent3.left).replace(whiteSpaceRegex, ""); + } else if (ts2.isPropertyAssignment(parent3)) { + return nodeText(parent3.name); + } else if (ts2.getSyntacticModifierFlags(node) & 1024) { + return "default"; + } else if (ts2.isClassLike(node)) { + return ""; + } else if (ts2.isCallExpression(parent3)) { + var name2 = getCalledExpressionName(parent3.expression); + if (name2 !== void 0) { + name2 = cleanText(name2); + if (name2.length > maxLength) { + return "".concat(name2, " callback"); + } + var args = cleanText(ts2.mapDefined(parent3.arguments, function(a7) { + return ts2.isStringLiteralLike(a7) ? a7.getText(curSourceFile) : void 0; + }).join(", ")); + return "".concat(name2, "(").concat(args, ") callback"); + } + } + return ""; + } + function getCalledExpressionName(expr) { + if (ts2.isIdentifier(expr)) { + return expr.text; + } else if (ts2.isPropertyAccessExpression(expr)) { + var left = getCalledExpressionName(expr.expression); + var right = expr.name.text; + return left === void 0 ? right : "".concat(left, ".").concat(right); + } else { + return void 0; + } + } + function isFunctionOrClassExpression(node) { + switch (node.kind) { + case 216: + case 215: + case 228: + return true; + default: + return false; + } + } + function cleanText(text) { + text = text.length > maxLength ? text.substring(0, maxLength) + "..." : text; + return text.replace(/\\?(\r?\n|\r|\u2028|\u2029)/g, ""); + } + })(NavigationBar = ts2.NavigationBar || (ts2.NavigationBar = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var OrganizeImports; + (function(OrganizeImports2) { + function organizeImports(sourceFile, formatContext, host, program, preferences, mode) { + var changeTracker = ts2.textChanges.ChangeTracker.fromContext({ host, formatContext, preferences }); + var shouldSort = mode === "SortAndCombine" || mode === "All"; + var shouldCombine = shouldSort; + var shouldRemove = mode === "RemoveUnused" || mode === "All"; + var maybeRemove = shouldRemove ? removeUnusedImports : ts2.identity; + var maybeCoalesce = shouldCombine ? coalesceImports : ts2.identity; + var processImportsOfSameModuleSpecifier = function(importGroup) { + var processedDeclarations = maybeCoalesce(maybeRemove(importGroup, sourceFile, program)); + return shouldSort ? ts2.stableSort(processedDeclarations, function(s1, s22) { + return compareImportsOrRequireStatements(s1, s22); + }) : processedDeclarations; + }; + var topLevelImportGroupDecls = groupImportsByNewlineContiguous(sourceFile, sourceFile.statements.filter(ts2.isImportDeclaration)); + topLevelImportGroupDecls.forEach(function(importGroupDecl) { + return organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier); + }); + if (mode !== "RemoveUnused") { + var topLevelExportDecls = sourceFile.statements.filter(ts2.isExportDeclaration); + organizeImportsWorker(topLevelExportDecls, coalesceExports); + } + for (var _i = 0, _a2 = sourceFile.statements.filter(ts2.isAmbientModule); _i < _a2.length; _i++) { + var ambientModule = _a2[_i]; + if (!ambientModule.body) + continue; + var ambientModuleImportGroupDecls = groupImportsByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(ts2.isImportDeclaration)); + ambientModuleImportGroupDecls.forEach(function(importGroupDecl) { + return organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier); + }); + if (mode !== "RemoveUnused") { + var ambientModuleExportDecls = ambientModule.body.statements.filter(ts2.isExportDeclaration); + organizeImportsWorker(ambientModuleExportDecls, coalesceExports); + } + } + return changeTracker.getChanges(); + function organizeImportsWorker(oldImportDecls, coalesce) { + if (ts2.length(oldImportDecls) === 0) { + return; + } + ts2.suppressLeadingTrivia(oldImportDecls[0]); + var oldImportGroups = shouldCombine ? ts2.group(oldImportDecls, function(importDecl) { + return getExternalModuleName(importDecl.moduleSpecifier); + }) : [oldImportDecls]; + var sortedImportGroups = shouldSort ? ts2.stableSort(oldImportGroups, function(group1, group2) { + return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); + }) : oldImportGroups; + var newImportDecls = ts2.flatMap(sortedImportGroups, function(importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) ? coalesce(importGroup) : importGroup; + }); + if (newImportDecls.length === 0) { + changeTracker.deleteNodes( + sourceFile, + oldImportDecls, + { + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Include + }, + /*hasTrailingComment*/ + true + ); + } else { + var replaceOptions = { + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Include, + suffix: ts2.getNewLineOrDefaultFromHost(host, formatContext.options) + }; + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); + var hasTrailingComment = changeTracker.nodeHasTrailingComment(sourceFile, oldImportDecls[0], replaceOptions); + changeTracker.deleteNodes(sourceFile, oldImportDecls.slice(1), { + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Include + }, hasTrailingComment); + } + } + } + OrganizeImports2.organizeImports = organizeImports; + function groupImportsByNewlineContiguous(sourceFile, importDecls) { + var scanner = ts2.createScanner( + sourceFile.languageVersion, + /*skipTrivia*/ + false, + sourceFile.languageVariant + ); + var groupImports = []; + var groupIndex = 0; + for (var _i = 0, importDecls_1 = importDecls; _i < importDecls_1.length; _i++) { + var topLevelImportDecl = importDecls_1[_i]; + if (isNewGroup(sourceFile, topLevelImportDecl, scanner)) { + groupIndex++; + } + if (!groupImports[groupIndex]) { + groupImports[groupIndex] = []; + } + groupImports[groupIndex].push(topLevelImportDecl); + } + return groupImports; + } + function isNewGroup(sourceFile, topLevelImportDecl, scanner) { + var startPos = topLevelImportDecl.getFullStart(); + var endPos = topLevelImportDecl.getStart(); + scanner.setText(sourceFile.text, startPos, endPos - startPos); + var numberOfNewLines = 0; + while (scanner.getTokenPos() < endPos) { + var tokenKind = scanner.scan(); + if (tokenKind === 4) { + numberOfNewLines++; + if (numberOfNewLines >= 2) { + return true; + } + } + } + return false; + } + function removeUnusedImports(oldImports, sourceFile, program) { + var typeChecker = program.getTypeChecker(); + var compilerOptions = program.getCompilerOptions(); + var jsxNamespace = typeChecker.getJsxNamespace(sourceFile); + var jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile); + var jsxElementsPresent = !!(sourceFile.transformFlags & 2); + var usedImports = []; + for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) { + var importDecl = oldImports_1[_i]; + var importClause = importDecl.importClause, moduleSpecifier = importDecl.moduleSpecifier; + if (!importClause) { + usedImports.push(importDecl); + continue; + } + var name2 = importClause.name, namedBindings = importClause.namedBindings; + if (name2 && !isDeclarationUsed(name2)) { + name2 = void 0; + } + if (namedBindings) { + if (ts2.isNamespaceImport(namedBindings)) { + if (!isDeclarationUsed(namedBindings.name)) { + namedBindings = void 0; + } + } else { + var newElements = namedBindings.elements.filter(function(e10) { + return isDeclarationUsed(e10.name); + }); + if (newElements.length < namedBindings.elements.length) { + namedBindings = newElements.length ? ts2.factory.updateNamedImports(namedBindings, newElements) : void 0; + } + } + } + if (name2 || namedBindings) { + usedImports.push(updateImportDeclarationAndClause(importDecl, name2, namedBindings)); + } else if (hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier)) { + if (sourceFile.isDeclarationFile) { + usedImports.push(ts2.factory.createImportDeclaration( + importDecl.modifiers, + /*importClause*/ + void 0, + moduleSpecifier, + /*assertClause*/ + void 0 + )); + } else { + usedImports.push(importDecl); + } + } + } + return usedImports; + function isDeclarationUsed(identifier) { + return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) && ts2.jsxModeNeedsExplicitImport(compilerOptions.jsx) || ts2.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); + } + } + function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) { + var moduleSpecifierText = ts2.isStringLiteral(moduleSpecifier) && moduleSpecifier.text; + return ts2.isString(moduleSpecifierText) && ts2.some(sourceFile.moduleAugmentations, function(moduleName3) { + return ts2.isStringLiteral(moduleName3) && moduleName3.text === moduleSpecifierText; + }); + } + function getExternalModuleName(specifier) { + return specifier !== void 0 && ts2.isStringLiteralLike(specifier) ? specifier.text : void 0; + } + function coalesceImports(importGroup) { + var _a2; + if (importGroup.length === 0) { + return importGroup; + } + var _b = getCategorizedImports(importGroup), importWithoutClause = _b.importWithoutClause, typeOnlyImports = _b.typeOnlyImports, regularImports = _b.regularImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + for (var _i = 0, _c = [regularImports, typeOnlyImports]; _i < _c.length; _i++) { + var group_2 = _c[_i]; + var isTypeOnly = group_2 === typeOnlyImports; + var defaultImports = group_2.defaultImports, namespaceImports = group_2.namespaceImports, namedImports = group_2.namedImports; + if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + var defaultImport = defaultImports[0]; + coalescedImports.push(updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)); + continue; + } + var sortedNamespaceImports = ts2.stableSort(namespaceImports, function(i1, i22) { + return compareIdentifiers(i1.importClause.namedBindings.name, i22.importClause.namedBindings.name); + }); + for (var _d = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _d < sortedNamespaceImports_1.length; _d++) { + var namespaceImport = sortedNamespaceImports_1[_d]; + coalescedImports.push(updateImportDeclarationAndClause( + namespaceImport, + /*name*/ + void 0, + namespaceImport.importClause.namedBindings + )); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + continue; + } + var newDefaultImport = void 0; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0].importClause.name; + } else { + for (var _e2 = 0, defaultImports_1 = defaultImports; _e2 < defaultImports_1.length; _e2++) { + var defaultImport = defaultImports_1[_e2]; + newImportSpecifiers.push(ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + ts2.factory.createIdentifier("default"), + defaultImport.importClause.name + )); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, getNewImportSpecifiers(namedImports)); + var sortedImportSpecifiers = sortSpecifiers(newImportSpecifiers); + var importDecl = defaultImports.length > 0 ? defaultImports[0] : namedImports[0]; + var newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : ts2.factory.createNamedImports(ts2.emptyArray) : namedImports.length === 0 ? ts2.factory.createNamedImports(sortedImportSpecifiers) : ts2.factory.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); + if (isTypeOnly && newDefaultImport && newNamedImports) { + coalescedImports.push(updateImportDeclarationAndClause( + importDecl, + newDefaultImport, + /*namedBindings*/ + void 0 + )); + coalescedImports.push(updateImportDeclarationAndClause( + (_a2 = namedImports[0]) !== null && _a2 !== void 0 ? _a2 : importDecl, + /*name*/ + void 0, + newNamedImports + )); + } else { + coalescedImports.push(updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)); + } + } + return coalescedImports; + } + OrganizeImports2.coalesceImports = coalesceImports; + function getCategorizedImports(importGroup) { + var importWithoutClause; + var typeOnlyImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; + var regularImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === void 0) { + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var group_3 = importDeclaration.importClause.isTypeOnly ? typeOnlyImports : regularImports; + var _a2 = importDeclaration.importClause, name2 = _a2.name, namedBindings = _a2.namedBindings; + if (name2) { + group_3.defaultImports.push(importDeclaration); + } + if (namedBindings) { + if (ts2.isNamespaceImport(namedBindings)) { + group_3.namespaceImports.push(importDeclaration); + } else { + group_3.namedImports.push(importDeclaration); + } + } + } + return { + importWithoutClause, + typeOnlyImports, + regularImports + }; + } + function coalesceExports(exportGroup) { + if (exportGroup.length === 0) { + return exportGroup; + } + var _a2 = getCategorizedExports(exportGroup), exportWithoutClause = _a2.exportWithoutClause, namedExports = _a2.namedExports, typeOnlyExports = _a2.typeOnlyExports; + var coalescedExports = []; + if (exportWithoutClause) { + coalescedExports.push(exportWithoutClause); + } + for (var _i = 0, _b = [namedExports, typeOnlyExports]; _i < _b.length; _i++) { + var exportGroup_1 = _b[_i]; + if (exportGroup_1.length === 0) { + continue; + } + var newExportSpecifiers = []; + newExportSpecifiers.push.apply(newExportSpecifiers, ts2.flatMap(exportGroup_1, function(i7) { + return i7.exportClause && ts2.isNamedExports(i7.exportClause) ? i7.exportClause.elements : ts2.emptyArray; + })); + var sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers); + var exportDecl = exportGroup_1[0]; + coalescedExports.push(ts2.factory.updateExportDeclaration(exportDecl, exportDecl.modifiers, exportDecl.isTypeOnly, exportDecl.exportClause && (ts2.isNamedExports(exportDecl.exportClause) ? ts2.factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : ts2.factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)), exportDecl.moduleSpecifier, exportDecl.assertClause)); + } + return coalescedExports; + function getCategorizedExports(exportGroup2) { + var exportWithoutClause2; + var namedExports2 = []; + var typeOnlyExports2 = []; + for (var _i2 = 0, exportGroup_2 = exportGroup2; _i2 < exportGroup_2.length; _i2++) { + var exportDeclaration = exportGroup_2[_i2]; + if (exportDeclaration.exportClause === void 0) { + exportWithoutClause2 = exportWithoutClause2 || exportDeclaration; + } else if (exportDeclaration.isTypeOnly) { + typeOnlyExports2.push(exportDeclaration); + } else { + namedExports2.push(exportDeclaration); + } + } + return { + exportWithoutClause: exportWithoutClause2, + namedExports: namedExports2, + typeOnlyExports: typeOnlyExports2 + }; + } + } + OrganizeImports2.coalesceExports = coalesceExports; + function updateImportDeclarationAndClause(importDeclaration, name2, namedBindings) { + return ts2.factory.updateImportDeclaration( + importDeclaration, + importDeclaration.modifiers, + ts2.factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name2, namedBindings), + // TODO: GH#18217 + importDeclaration.moduleSpecifier, + importDeclaration.assertClause + ); + } + function sortSpecifiers(specifiers) { + return ts2.stableSort(specifiers, compareImportOrExportSpecifiers); + } + function compareImportOrExportSpecifiers(s1, s22) { + return ts2.compareBooleans(s1.isTypeOnly, s22.isTypeOnly) || compareIdentifiers(s1.propertyName || s1.name, s22.propertyName || s22.name) || compareIdentifiers(s1.name, s22.name); + } + OrganizeImports2.compareImportOrExportSpecifiers = compareImportOrExportSpecifiers; + function compareModuleSpecifiers(m1, m22) { + var name1 = m1 === void 0 ? void 0 : getExternalModuleName(m1); + var name2 = m22 === void 0 ? void 0 : getExternalModuleName(m22); + return ts2.compareBooleans(name1 === void 0, name2 === void 0) || ts2.compareBooleans(ts2.isExternalModuleNameRelative(name1), ts2.isExternalModuleNameRelative(name2)) || ts2.compareStringsCaseInsensitive(name1, name2); + } + OrganizeImports2.compareModuleSpecifiers = compareModuleSpecifiers; + function compareIdentifiers(s1, s22) { + return ts2.compareStringsCaseInsensitive(s1.text, s22.text); + } + function getModuleSpecifierExpression(declaration) { + var _a2; + switch (declaration.kind) { + case 268: + return (_a2 = ts2.tryCast(declaration.moduleReference, ts2.isExternalModuleReference)) === null || _a2 === void 0 ? void 0 : _a2.expression; + case 269: + return declaration.moduleSpecifier; + case 240: + return declaration.declarationList.declarations[0].initializer.arguments[0]; + } + } + function importsAreSorted(imports) { + return ts2.arrayIsSorted(imports, compareImportsOrRequireStatements); + } + OrganizeImports2.importsAreSorted = importsAreSorted; + function importSpecifiersAreSorted(imports) { + return ts2.arrayIsSorted(imports, compareImportOrExportSpecifiers); + } + OrganizeImports2.importSpecifiersAreSorted = importSpecifiersAreSorted; + function getImportDeclarationInsertionIndex(sortedImports, newImport) { + var index4 = ts2.binarySearch(sortedImports, newImport, ts2.identity, compareImportsOrRequireStatements); + return index4 < 0 ? ~index4 : index4; + } + OrganizeImports2.getImportDeclarationInsertionIndex = getImportDeclarationInsertionIndex; + function getImportSpecifierInsertionIndex(sortedImports, newImport) { + var index4 = ts2.binarySearch(sortedImports, newImport, ts2.identity, compareImportOrExportSpecifiers); + return index4 < 0 ? ~index4 : index4; + } + OrganizeImports2.getImportSpecifierInsertionIndex = getImportSpecifierInsertionIndex; + function compareImportsOrRequireStatements(s1, s22) { + return compareModuleSpecifiers(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s22)) || compareImportKind(s1, s22); + } + OrganizeImports2.compareImportsOrRequireStatements = compareImportsOrRequireStatements; + function compareImportKind(s1, s22) { + return ts2.compareValues(getImportKindOrder(s1), getImportKindOrder(s22)); + } + function getImportKindOrder(s1) { + var _a2; + switch (s1.kind) { + case 269: + if (!s1.importClause) + return 0; + if (s1.importClause.isTypeOnly) + return 1; + if (((_a2 = s1.importClause.namedBindings) === null || _a2 === void 0 ? void 0 : _a2.kind) === 271) + return 2; + if (s1.importClause.name) + return 3; + return 4; + case 268: + return 5; + case 240: + return 6; + } + } + function getNewImportSpecifiers(namedImports) { + return ts2.flatMap(namedImports, function(namedImport) { + return ts2.map(tryGetNamedBindingElements(namedImport), function(importSpecifier) { + return importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText ? ts2.factory.updateImportSpecifier( + importSpecifier, + importSpecifier.isTypeOnly, + /*propertyName*/ + void 0, + importSpecifier.name + ) : importSpecifier; + }); + }); + } + function tryGetNamedBindingElements(namedImport) { + var _a2; + return ((_a2 = namedImport.importClause) === null || _a2 === void 0 ? void 0 : _a2.namedBindings) && ts2.isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; + } + })(OrganizeImports = ts2.OrganizeImports || (ts2.OrganizeImports = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var OutliningElementsCollector; + (function(OutliningElementsCollector2) { + function collectElements(sourceFile, cancellationToken) { + var res = []; + addNodeOutliningSpans(sourceFile, cancellationToken, res); + addRegionOutliningSpans(sourceFile, res); + return res.sort(function(span1, span2) { + return span1.textSpan.start - span2.textSpan.start; + }); + } + OutliningElementsCollector2.collectElements = collectElements; + function addNodeOutliningSpans(sourceFile, cancellationToken, out) { + var depthRemaining = 40; + var current = 0; + var statements = __spreadArray9(__spreadArray9([], sourceFile.statements, true), [sourceFile.endOfFileToken], false); + var n7 = statements.length; + while (current < n7) { + while (current < n7 && !ts2.isAnyImportSyntax(statements[current])) { + visitNonImportNode(statements[current]); + current++; + } + if (current === n7) + break; + var firstImport = current; + while (current < n7 && ts2.isAnyImportSyntax(statements[current])) { + addOutliningForLeadingCommentsForNode(statements[current], sourceFile, cancellationToken, out); + current++; + } + var lastImport = current - 1; + if (lastImport !== firstImport) { + out.push(createOutliningSpanFromBounds( + ts2.findChildOfKind(statements[firstImport], 100, sourceFile).getStart(sourceFile), + statements[lastImport].getEnd(), + "imports" + /* OutliningSpanKind.Imports */ + )); + } + } + function visitNonImportNode(n8) { + var _a2; + if (depthRemaining === 0) + return; + cancellationToken.throwIfCancellationRequested(); + if (ts2.isDeclaration(n8) || ts2.isVariableStatement(n8) || ts2.isReturnStatement(n8) || ts2.isCallOrNewExpression(n8) || n8.kind === 1) { + addOutliningForLeadingCommentsForNode(n8, sourceFile, cancellationToken, out); + } + if (ts2.isFunctionLike(n8) && ts2.isBinaryExpression(n8.parent) && ts2.isPropertyAccessExpression(n8.parent.left)) { + addOutliningForLeadingCommentsForNode(n8.parent.left, sourceFile, cancellationToken, out); + } + if (ts2.isBlock(n8) || ts2.isModuleBlock(n8)) { + addOutliningForLeadingCommentsForPos(n8.statements.end, sourceFile, cancellationToken, out); + } + if (ts2.isClassLike(n8) || ts2.isInterfaceDeclaration(n8)) { + addOutliningForLeadingCommentsForPos(n8.members.end, sourceFile, cancellationToken, out); + } + var span = getOutliningSpanForNode(n8, sourceFile); + if (span) + out.push(span); + depthRemaining--; + if (ts2.isCallExpression(n8)) { + depthRemaining++; + visitNonImportNode(n8.expression); + depthRemaining--; + n8.arguments.forEach(visitNonImportNode); + (_a2 = n8.typeArguments) === null || _a2 === void 0 ? void 0 : _a2.forEach(visitNonImportNode); + } else if (ts2.isIfStatement(n8) && n8.elseStatement && ts2.isIfStatement(n8.elseStatement)) { + visitNonImportNode(n8.expression); + visitNonImportNode(n8.thenStatement); + depthRemaining++; + visitNonImportNode(n8.elseStatement); + depthRemaining--; + } else { + n8.forEachChild(visitNonImportNode); + } + depthRemaining++; + } + } + function addRegionOutliningSpans(sourceFile, out) { + var regions = []; + var lineStarts = sourceFile.getLineStarts(); + for (var _i = 0, lineStarts_1 = lineStarts; _i < lineStarts_1.length; _i++) { + var currentLineStart = lineStarts_1[_i]; + var lineEnd = sourceFile.getLineEndOfPosition(currentLineStart); + var lineText = sourceFile.text.substring(currentLineStart, lineEnd); + var result2 = isRegionDelimiter(lineText); + if (!result2 || ts2.isInComment(sourceFile, currentLineStart)) { + continue; + } + if (!result2[1]) { + var span = ts2.createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); + regions.push(createOutliningSpan( + span, + "region", + span, + /*autoCollapse*/ + false, + result2[2] || "#region" + )); + } else { + var region = regions.pop(); + if (region) { + region.textSpan.length = lineEnd - region.textSpan.start; + region.hintSpan.length = lineEnd - region.textSpan.start; + out.push(region); + } + } + } + } + var regionDelimiterRegExp = /^#(end)?region(?:\s+(.*))?(?:\r)?$/; + function isRegionDelimiter(lineText) { + lineText = ts2.trimStringStart(lineText); + if (!ts2.startsWith(lineText, "//")) { + return null; + } + lineText = ts2.trimString(lineText.slice(2)); + return regionDelimiterRegExp.exec(lineText); + } + function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) { + var comments = ts2.getLeadingCommentRanges(sourceFile.text, pos); + if (!comments) + return; + var firstSingleLineCommentStart = -1; + var lastSingleLineCommentEnd = -1; + var singleLineCommentCount = 0; + var sourceText = sourceFile.getFullText(); + for (var _i = 0, comments_1 = comments; _i < comments_1.length; _i++) { + var _a2 = comments_1[_i], kind = _a2.kind, pos_1 = _a2.pos, end = _a2.end; + cancellationToken.throwIfCancellationRequested(); + switch (kind) { + case 2: + var commentText = sourceText.slice(pos_1, end); + if (isRegionDelimiter(commentText)) { + combineAndAddMultipleSingleLineComments(); + singleLineCommentCount = 0; + break; + } + if (singleLineCommentCount === 0) { + firstSingleLineCommentStart = pos_1; + } + lastSingleLineCommentEnd = end; + singleLineCommentCount++; + break; + case 3: + combineAndAddMultipleSingleLineComments(); + out.push(createOutliningSpanFromBounds( + pos_1, + end, + "comment" + /* OutliningSpanKind.Comment */ + )); + singleLineCommentCount = 0; + break; + default: + ts2.Debug.assertNever(kind); + } + } + combineAndAddMultipleSingleLineComments(); + function combineAndAddMultipleSingleLineComments() { + if (singleLineCommentCount > 1) { + out.push(createOutliningSpanFromBounds( + firstSingleLineCommentStart, + lastSingleLineCommentEnd, + "comment" + /* OutliningSpanKind.Comment */ + )); + } + } + } + function addOutliningForLeadingCommentsForNode(n7, sourceFile, cancellationToken, out) { + if (ts2.isJsxText(n7)) + return; + addOutliningForLeadingCommentsForPos(n7.pos, sourceFile, cancellationToken, out); + } + function createOutliningSpanFromBounds(pos, end, kind) { + return createOutliningSpan(ts2.createTextSpanFromBounds(pos, end), kind); + } + function getOutliningSpanForNode(n7, sourceFile) { + switch (n7.kind) { + case 238: + if (ts2.isFunctionLike(n7.parent)) { + return functionSpan(n7.parent, n7, sourceFile); + } + switch (n7.parent.kind) { + case 243: + case 246: + case 247: + case 245: + case 242: + case 244: + case 251: + case 295: + return spanForNode(n7.parent); + case 255: + var tryStatement = n7.parent; + if (tryStatement.tryBlock === n7) { + return spanForNode(n7.parent); + } else if (tryStatement.finallyBlock === n7) { + var node = ts2.findChildOfKind(tryStatement, 96, sourceFile); + if (node) + return spanForNode(node); + } + default: + return createOutliningSpan( + ts2.createTextSpanFromNode(n7, sourceFile), + "code" + /* OutliningSpanKind.Code */ + ); + } + case 265: + return spanForNode(n7.parent); + case 260: + case 228: + case 261: + case 263: + case 266: + case 184: + case 203: + return spanForNode(n7); + case 186: + return spanForNode( + n7, + /*autoCollapse*/ + false, + /*useFullStart*/ + !ts2.isTupleTypeNode(n7.parent), + 22 + /* SyntaxKind.OpenBracketToken */ + ); + case 292: + case 293: + return spanForNodeArray(n7.statements); + case 207: + return spanForObjectOrArrayLiteral(n7); + case 206: + return spanForObjectOrArrayLiteral( + n7, + 22 + /* SyntaxKind.OpenBracketToken */ + ); + case 281: + return spanForJSXElement(n7); + case 285: + return spanForJSXFragment(n7); + case 282: + case 283: + return spanForJSXAttributes(n7.attributes); + case 225: + case 14: + return spanForTemplateLiteral(n7); + case 204: + return spanForNode( + n7, + /*autoCollapse*/ + false, + /*useFullStart*/ + !ts2.isBindingElement(n7.parent), + 22 + /* SyntaxKind.OpenBracketToken */ + ); + case 216: + return spanForArrowFunction(n7); + case 210: + return spanForCallExpression(n7); + case 214: + return spanForParenthesizedExpression(n7); + } + function spanForCallExpression(node2) { + if (!node2.arguments.length) { + return void 0; + } + var openToken = ts2.findChildOfKind(node2, 20, sourceFile); + var closeToken = ts2.findChildOfKind(node2, 21, sourceFile); + if (!openToken || !closeToken || ts2.positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) { + return void 0; + } + return spanBetweenTokens( + openToken, + closeToken, + node2, + sourceFile, + /*autoCollapse*/ + false, + /*useFullStart*/ + true + ); + } + function spanForArrowFunction(node2) { + if (ts2.isBlock(node2.body) || ts2.isParenthesizedExpression(node2.body) || ts2.positionsAreOnSameLine(node2.body.getFullStart(), node2.body.getEnd(), sourceFile)) { + return void 0; + } + var textSpan = ts2.createTextSpanFromBounds(node2.body.getFullStart(), node2.body.getEnd()); + return createOutliningSpan(textSpan, "code", ts2.createTextSpanFromNode(node2)); + } + function spanForJSXElement(node2) { + var textSpan = ts2.createTextSpanFromBounds(node2.openingElement.getStart(sourceFile), node2.closingElement.getEnd()); + var tagName = node2.openingElement.tagName.getText(sourceFile); + var bannerText = "<" + tagName + ">..."; + return createOutliningSpan( + textSpan, + "code", + textSpan, + /*autoCollapse*/ + false, + bannerText + ); + } + function spanForJSXFragment(node2) { + var textSpan = ts2.createTextSpanFromBounds(node2.openingFragment.getStart(sourceFile), node2.closingFragment.getEnd()); + var bannerText = "<>..."; + return createOutliningSpan( + textSpan, + "code", + textSpan, + /*autoCollapse*/ + false, + bannerText + ); + } + function spanForJSXAttributes(node2) { + if (node2.properties.length === 0) { + return void 0; + } + return createOutliningSpanFromBounds( + node2.getStart(sourceFile), + node2.getEnd(), + "code" + /* OutliningSpanKind.Code */ + ); + } + function spanForTemplateLiteral(node2) { + if (node2.kind === 14 && node2.text.length === 0) { + return void 0; + } + return createOutliningSpanFromBounds( + node2.getStart(sourceFile), + node2.getEnd(), + "code" + /* OutliningSpanKind.Code */ + ); + } + function spanForObjectOrArrayLiteral(node2, open2) { + if (open2 === void 0) { + open2 = 18; + } + return spanForNode( + node2, + /*autoCollapse*/ + false, + /*useFullStart*/ + !ts2.isArrayLiteralExpression(node2.parent) && !ts2.isCallExpression(node2.parent), + open2 + ); + } + function spanForNode(hintSpanNode, autoCollapse, useFullStart, open2, close) { + if (autoCollapse === void 0) { + autoCollapse = false; + } + if (useFullStart === void 0) { + useFullStart = true; + } + if (open2 === void 0) { + open2 = 18; + } + if (close === void 0) { + close = open2 === 18 ? 19 : 23; + } + var openToken = ts2.findChildOfKind(n7, open2, sourceFile); + var closeToken = ts2.findChildOfKind(n7, close, sourceFile); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); + } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan( + ts2.createTextSpanFromRange(nodeArray), + "code" + /* OutliningSpanKind.Code */ + ) : void 0; + } + function spanForParenthesizedExpression(node2) { + if (ts2.positionsAreOnSameLine(node2.getStart(), node2.getEnd(), sourceFile)) + return void 0; + var textSpan = ts2.createTextSpanFromBounds(node2.getStart(), node2.getEnd()); + return createOutliningSpan(textSpan, "code", ts2.createTextSpanFromNode(node2)); + } + } + function functionSpan(node, body, sourceFile) { + var openToken = tryGetFunctionOpenToken(node, body, sourceFile); + var closeToken = ts2.findChildOfKind(body, 19, sourceFile); + return openToken && closeToken && spanBetweenTokens( + openToken, + closeToken, + node, + sourceFile, + /*autoCollapse*/ + node.kind !== 216 + /* SyntaxKind.ArrowFunction */ + ); + } + function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart) { + if (autoCollapse === void 0) { + autoCollapse = false; + } + if (useFullStart === void 0) { + useFullStart = true; + } + var textSpan = ts2.createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd()); + return createOutliningSpan(textSpan, "code", ts2.createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse); + } + function createOutliningSpan(textSpan, kind, hintSpan, autoCollapse, bannerText) { + if (hintSpan === void 0) { + hintSpan = textSpan; + } + if (autoCollapse === void 0) { + autoCollapse = false; + } + if (bannerText === void 0) { + bannerText = "..."; + } + return { textSpan, kind, hintSpan, bannerText, autoCollapse }; + } + function tryGetFunctionOpenToken(node, body, sourceFile) { + if (ts2.isNodeArrayMultiLine(node.parameters, sourceFile)) { + var openParenToken = ts2.findChildOfKind(node, 20, sourceFile); + if (openParenToken) { + return openParenToken; + } + } + return ts2.findChildOfKind(body, 18, sourceFile); + } + })(OutliningElementsCollector = ts2.OutliningElementsCollector || (ts2.OutliningElementsCollector = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var PatternMatchKind; + (function(PatternMatchKind2) { + PatternMatchKind2[PatternMatchKind2["exact"] = 0] = "exact"; + PatternMatchKind2[PatternMatchKind2["prefix"] = 1] = "prefix"; + PatternMatchKind2[PatternMatchKind2["substring"] = 2] = "substring"; + PatternMatchKind2[PatternMatchKind2["camelCase"] = 3] = "camelCase"; + })(PatternMatchKind = ts2.PatternMatchKind || (ts2.PatternMatchKind = {})); + function createPatternMatch(kind, isCaseSensitive) { + return { + kind, + isCaseSensitive + }; + } + function createPatternMatcher(pattern5) { + var stringToWordSpans = new ts2.Map(); + var dotSeparatedSegments = pattern5.trim().split(".").map(function(p7) { + return createSegment(p7.trim()); + }); + if (dotSeparatedSegments.some(function(segment) { + return !segment.subWordTextChunks.length; + })) + return void 0; + return { + getFullMatch: function(containers, candidate) { + return getFullMatch(containers, candidate, dotSeparatedSegments, stringToWordSpans); + }, + getMatchForLastSegmentOfPattern: function(candidate) { + return matchSegment(candidate, ts2.last(dotSeparatedSegments), stringToWordSpans); + }, + patternContainsDots: dotSeparatedSegments.length > 1 + }; + } + ts2.createPatternMatcher = createPatternMatcher; + function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) { + var candidateMatch = matchSegment(candidate, ts2.last(dotSeparatedSegments), stringToWordSpans); + if (!candidateMatch) { + return void 0; + } + if (dotSeparatedSegments.length - 1 > candidateContainers.length) { + return void 0; + } + var bestMatch; + for (var i7 = dotSeparatedSegments.length - 2, j6 = candidateContainers.length - 1; i7 >= 0; i7 -= 1, j6 -= 1) { + bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j6], dotSeparatedSegments[i7], stringToWordSpans)); + } + return bestMatch; + } + function getWordSpans(word, stringToWordSpans) { + var spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); + } + return spans; + } + function matchTextChunk(candidate, chunk2, stringToWordSpans) { + var index4 = indexOfIgnoringCase(candidate, chunk2.textLowerCase); + if (index4 === 0) { + return createPatternMatch( + chunk2.text.length === candidate.length ? PatternMatchKind.exact : PatternMatchKind.prefix, + /*isCaseSensitive:*/ + ts2.startsWith(candidate, chunk2.text) + ); + } + if (chunk2.isLowerCase) { + if (index4 === -1) + return void 0; + var wordSpans = getWordSpans(candidate, stringToWordSpans); + for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { + var span = wordSpans_1[_i]; + if (partStartsWith( + candidate, + span, + chunk2.text, + /*ignoreCase:*/ + true + )) { + return createPatternMatch( + PatternMatchKind.substring, + /*isCaseSensitive:*/ + partStartsWith( + candidate, + span, + chunk2.text, + /*ignoreCase:*/ + false + ) + ); + } + } + if (chunk2.text.length < candidate.length && isUpperCaseLetter(candidate.charCodeAt(index4))) { + return createPatternMatch( + PatternMatchKind.substring, + /*isCaseSensitive:*/ + false + ); + } + } else { + if (candidate.indexOf(chunk2.text) > 0) { + return createPatternMatch( + PatternMatchKind.substring, + /*isCaseSensitive:*/ + true + ); + } + if (chunk2.characterSpans.length > 0) { + var candidateParts = getWordSpans(candidate, stringToWordSpans); + var isCaseSensitive = tryCamelCaseMatch( + candidate, + candidateParts, + chunk2, + /*ignoreCase:*/ + false + ) ? true : tryCamelCaseMatch( + candidate, + candidateParts, + chunk2, + /*ignoreCase:*/ + true + ) ? false : void 0; + if (isCaseSensitive !== void 0) { + return createPatternMatch(PatternMatchKind.camelCase, isCaseSensitive); + } + } + } + } + function matchSegment(candidate, segment, stringToWordSpans) { + if (every2(segment.totalTextChunk.text, function(ch) { + return ch !== 32 && ch !== 42; + })) { + var match = matchTextChunk(candidate, segment.totalTextChunk, stringToWordSpans); + if (match) + return match; + } + var subWordTextChunks = segment.subWordTextChunks; + var bestMatch; + for (var _i = 0, subWordTextChunks_1 = subWordTextChunks; _i < subWordTextChunks_1.length; _i++) { + var subWordTextChunk = subWordTextChunks_1[_i]; + bestMatch = betterMatch(bestMatch, matchTextChunk(candidate, subWordTextChunk, stringToWordSpans)); + } + return bestMatch; + } + function betterMatch(a7, b8) { + return ts2.min([a7, b8], compareMatches); + } + function compareMatches(a7, b8) { + return a7 === void 0 ? 1 : b8 === void 0 ? -1 : ts2.compareValues(a7.kind, b8.kind) || ts2.compareBooleans(!a7.isCaseSensitive, !b8.isCaseSensitive); + } + function partStartsWith(candidate, candidateSpan, pattern5, ignoreCase, patternSpan) { + if (patternSpan === void 0) { + patternSpan = { start: 0, length: pattern5.length }; + } + return patternSpan.length <= candidateSpan.length && everyInRange(0, patternSpan.length, function(i7) { + return equalChars(pattern5.charCodeAt(patternSpan.start + i7), candidate.charCodeAt(candidateSpan.start + i7), ignoreCase); + }); + } + function equalChars(ch1, ch2, ignoreCase) { + return ignoreCase ? toLowerCase(ch1) === toLowerCase(ch2) : ch1 === ch2; + } + function tryCamelCaseMatch(candidate, candidateParts, chunk2, ignoreCase) { + var chunkCharacterSpans = chunk2.characterSpans; + var currentCandidate = 0; + var currentChunkSpan = 0; + var firstMatch; + var contiguous; + while (true) { + if (currentChunkSpan === chunkCharacterSpans.length) { + return true; + } else if (currentCandidate === candidateParts.length) { + return false; + } + var candidatePart = candidateParts[currentCandidate]; + var gotOneMatchThisCandidate = false; + for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { + var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; + if (gotOneMatchThisCandidate) { + if (!isUpperCaseLetter(chunk2.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk2.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { + break; + } + } + if (!partStartsWith(candidate, candidatePart, chunk2.text, ignoreCase, chunkCharacterSpan)) { + break; + } + gotOneMatchThisCandidate = true; + firstMatch = firstMatch === void 0 ? currentCandidate : firstMatch; + contiguous = contiguous === void 0 ? true : contiguous; + candidatePart = ts2.createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); + } + if (!gotOneMatchThisCandidate && contiguous !== void 0) { + contiguous = false; + } + currentCandidate++; + } + } + function createSegment(text) { + return { + totalTextChunk: createTextChunk(text), + subWordTextChunks: breakPatternIntoTextChunks(text) + }; + } + function isUpperCaseLetter(ch) { + if (ch >= 65 && ch <= 90) { + return true; + } + if (ch < 127 || !ts2.isUnicodeIdentifierStart( + ch, + 99 + /* ScriptTarget.Latest */ + )) { + return false; + } + var str2 = String.fromCharCode(ch); + return str2 === str2.toUpperCase(); + } + function isLowerCaseLetter(ch) { + if (ch >= 97 && ch <= 122) { + return true; + } + if (ch < 127 || !ts2.isUnicodeIdentifierStart( + ch, + 99 + /* ScriptTarget.Latest */ + )) { + return false; + } + var str2 = String.fromCharCode(ch); + return str2 === str2.toLowerCase(); + } + function indexOfIgnoringCase(str2, value2) { + var n7 = str2.length - value2.length; + var _loop_6 = function(start2) { + if (every2(value2, function(valueChar, i7) { + return toLowerCase(str2.charCodeAt(i7 + start2)) === valueChar; + })) { + return { value: start2 }; + } + }; + for (var start = 0; start <= n7; start++) { + var state_3 = _loop_6(start); + if (typeof state_3 === "object") + return state_3.value; + } + return -1; + } + function toLowerCase(ch) { + if (ch >= 65 && ch <= 90) { + return 97 + (ch - 65); + } + if (ch < 127) { + return ch; + } + return String.fromCharCode(ch).toLowerCase().charCodeAt(0); + } + function isDigit2(ch) { + return ch >= 48 && ch <= 57; + } + function isWordChar(ch) { + return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit2(ch) || ch === 95 || ch === 36; + } + function breakPatternIntoTextChunks(pattern5) { + var result2 = []; + var wordStart = 0; + var wordLength = 0; + for (var i7 = 0; i7 < pattern5.length; i7++) { + var ch = pattern5.charCodeAt(i7); + if (isWordChar(ch)) { + if (wordLength === 0) { + wordStart = i7; + } + wordLength++; + } else { + if (wordLength > 0) { + result2.push(createTextChunk(pattern5.substr(wordStart, wordLength))); + wordLength = 0; + } + } + } + if (wordLength > 0) { + result2.push(createTextChunk(pattern5.substr(wordStart, wordLength))); + } + return result2; + } + function createTextChunk(text) { + var textLowerCase = text.toLowerCase(); + return { + text, + textLowerCase, + isLowerCase: text === textLowerCase, + characterSpans: breakIntoCharacterSpans(text) + }; + } + function breakIntoCharacterSpans(identifier) { + return breakIntoSpans( + identifier, + /*word:*/ + false + ); + } + ts2.breakIntoCharacterSpans = breakIntoCharacterSpans; + function breakIntoWordSpans(identifier) { + return breakIntoSpans( + identifier, + /*word:*/ + true + ); + } + ts2.breakIntoWordSpans = breakIntoWordSpans; + function breakIntoSpans(identifier, word) { + var result2 = []; + var wordStart = 0; + for (var i7 = 1; i7 < identifier.length; i7++) { + var lastIsDigit = isDigit2(identifier.charCodeAt(i7 - 1)); + var currentIsDigit = isDigit2(identifier.charCodeAt(i7)); + var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i7); + var hasTransitionFromUpperToLower = word && transitionFromUpperToLower(identifier, i7, wordStart); + if (charIsPunctuation(identifier.charCodeAt(i7 - 1)) || charIsPunctuation(identifier.charCodeAt(i7)) || lastIsDigit !== currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { + if (!isAllPunctuation(identifier, wordStart, i7)) { + result2.push(ts2.createTextSpan(wordStart, i7 - wordStart)); + } + wordStart = i7; + } + } + if (!isAllPunctuation(identifier, wordStart, identifier.length)) { + result2.push(ts2.createTextSpan(wordStart, identifier.length - wordStart)); + } + return result2; + } + function charIsPunctuation(ch) { + switch (ch) { + case 33: + case 34: + case 35: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 44: + case 45: + case 46: + case 47: + case 58: + case 59: + case 63: + case 64: + case 91: + case 92: + case 93: + case 95: + case 123: + case 125: + return true; + } + return false; + } + function isAllPunctuation(identifier, start, end) { + return every2(identifier, function(ch) { + return charIsPunctuation(ch) && ch !== 95; + }, start, end); + } + function transitionFromUpperToLower(identifier, index4, wordStart) { + return index4 !== wordStart && index4 + 1 < identifier.length && isUpperCaseLetter(identifier.charCodeAt(index4)) && isLowerCaseLetter(identifier.charCodeAt(index4 + 1)) && every2(identifier, isUpperCaseLetter, wordStart, index4); + } + function transitionFromLowerToUpper(identifier, word, index4) { + var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index4 - 1)); + var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index4)); + return currentIsUpper && (!word || !lastIsUpper); + } + function everyInRange(start, end, pred) { + for (var i7 = start; i7 < end; i7++) { + if (!pred(i7)) { + return false; + } + } + return true; + } + function every2(s7, pred, start, end) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = s7.length; + } + return everyInRange(start, end, function(i7) { + return pred(s7.charCodeAt(i7), i7); + }); + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { + if (readImportFiles === void 0) { + readImportFiles = true; + } + if (detectJavaScriptImports === void 0) { + detectJavaScriptImports = false; + } + var pragmaContext = { + languageVersion: 1, + pragmas: void 0, + checkJsDirective: void 0, + referencedFiles: [], + typeReferenceDirectives: [], + libReferenceDirectives: [], + amdDependencies: [], + hasNoDefaultLib: void 0, + moduleName: void 0 + }; + var importedFiles = []; + var ambientExternalModules; + var lastToken; + var currentToken; + var braceNesting = 0; + var externalModule = false; + function nextToken() { + lastToken = currentToken; + currentToken = ts2.scanner.scan(); + if (currentToken === 18) { + braceNesting++; + } else if (currentToken === 19) { + braceNesting--; + } + return currentToken; + } + function getFileReference() { + var fileName = ts2.scanner.getTokenValue(); + var pos = ts2.scanner.getTokenPos(); + return { fileName, pos, end: pos + fileName.length }; + } + function recordAmbientExternalModule() { + if (!ambientExternalModules) { + ambientExternalModules = []; + } + ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting }); + } + function recordModuleName() { + importedFiles.push(getFileReference()); + markAsExternalModuleIfTopLevel(); + } + function markAsExternalModuleIfTopLevel() { + if (braceNesting === 0) { + externalModule = true; + } + } + function tryConsumeDeclare() { + var token = ts2.scanner.getToken(); + if (token === 136) { + token = nextToken(); + if (token === 142) { + token = nextToken(); + if (token === 10) { + recordAmbientExternalModule(); + } + } + return true; + } + return false; + } + function tryConsumeImport() { + if (lastToken === 24) { + return false; + } + var token = ts2.scanner.getToken(); + if (token === 100) { + token = nextToken(); + if (token === 20) { + token = nextToken(); + if (token === 10 || token === 14) { + recordModuleName(); + return true; + } + } else if (token === 10) { + recordModuleName(); + return true; + } else { + if (token === 154) { + var skipTypeKeyword = ts2.scanner.lookAhead(function() { + var token2 = ts2.scanner.scan(); + return token2 !== 158 && (token2 === 41 || token2 === 18 || token2 === 79 || ts2.isKeyword(token2)); + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 79 || ts2.isKeyword(token)) { + token = nextToken(); + if (token === 158) { + token = nextToken(); + if (token === 10) { + recordModuleName(); + return true; + } + } else if (token === 63) { + if (tryConsumeRequireCall( + /*skipCurrentToken*/ + true + )) { + return true; + } + } else if (token === 27) { + token = nextToken(); + } else { + return true; + } + } + if (token === 18) { + token = nextToken(); + while (token !== 19 && token !== 1) { + token = nextToken(); + } + if (token === 19) { + token = nextToken(); + if (token === 158) { + token = nextToken(); + if (token === 10) { + recordModuleName(); + } + } + } + } else if (token === 41) { + token = nextToken(); + if (token === 128) { + token = nextToken(); + if (token === 79 || ts2.isKeyword(token)) { + token = nextToken(); + if (token === 158) { + token = nextToken(); + if (token === 10) { + recordModuleName(); + } + } + } + } + } + } + return true; + } + return false; + } + function tryConsumeExport() { + var token = ts2.scanner.getToken(); + if (token === 93) { + markAsExternalModuleIfTopLevel(); + token = nextToken(); + if (token === 154) { + var skipTypeKeyword = ts2.scanner.lookAhead(function() { + var token2 = ts2.scanner.scan(); + return token2 === 41 || token2 === 18; + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 18) { + token = nextToken(); + while (token !== 19 && token !== 1) { + token = nextToken(); + } + if (token === 19) { + token = nextToken(); + if (token === 158) { + token = nextToken(); + if (token === 10) { + recordModuleName(); + } + } + } + } else if (token === 41) { + token = nextToken(); + if (token === 158) { + token = nextToken(); + if (token === 10) { + recordModuleName(); + } + } + } else if (token === 100) { + token = nextToken(); + if (token === 154) { + var skipTypeKeyword = ts2.scanner.lookAhead(function() { + var token2 = ts2.scanner.scan(); + return token2 === 79 || ts2.isKeyword(token2); + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 79 || ts2.isKeyword(token)) { + token = nextToken(); + if (token === 63) { + if (tryConsumeRequireCall( + /*skipCurrentToken*/ + true + )) { + return true; + } + } + } + } + return true; + } + return false; + } + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals) { + if (allowTemplateLiterals === void 0) { + allowTemplateLiterals = false; + } + var token = skipCurrentToken ? nextToken() : ts2.scanner.getToken(); + if (token === 147) { + token = nextToken(); + if (token === 20) { + token = nextToken(); + if (token === 10 || allowTemplateLiterals && token === 14) { + recordModuleName(); + } + } + return true; + } + return false; + } + function tryConsumeDefine() { + var token = ts2.scanner.getToken(); + if (token === 79 && ts2.scanner.getTokenValue() === "define") { + token = nextToken(); + if (token !== 20) { + return true; + } + token = nextToken(); + if (token === 10 || token === 14) { + token = nextToken(); + if (token === 27) { + token = nextToken(); + } else { + return true; + } + } + if (token !== 22) { + return true; + } + token = nextToken(); + while (token !== 23 && token !== 1) { + if (token === 10 || token === 14) { + recordModuleName(); + } + token = nextToken(); + } + return true; + } + return false; + } + function processImports() { + ts2.scanner.setText(sourceText); + nextToken(); + while (true) { + if (ts2.scanner.getToken() === 1) { + break; + } + if (ts2.scanner.getToken() === 15) { + var stack = [ts2.scanner.getToken()]; + loop: + while (ts2.length(stack)) { + var token = ts2.scanner.scan(); + switch (token) { + case 1: + break loop; + case 100: + tryConsumeImport(); + break; + case 15: + stack.push(token); + break; + case 18: + if (ts2.length(stack)) { + stack.push(token); + } + break; + case 19: + if (ts2.length(stack)) { + if (ts2.lastOrUndefined(stack) === 15) { + if (ts2.scanner.reScanTemplateToken( + /* isTaggedTemplate */ + false + ) === 17) { + stack.pop(); + } + } else { + stack.pop(); + } + } + break; + } + } + nextToken(); + } + if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || detectJavaScriptImports && (tryConsumeRequireCall( + /*skipCurrentToken*/ + false, + /*allowTemplateLiterals*/ + true + ) || tryConsumeDefine())) { + continue; + } else { + nextToken(); + } + } + ts2.scanner.setText(void 0); + } + if (readImportFiles) { + processImports(); + } + ts2.processCommentPragmas(pragmaContext, sourceText); + ts2.processPragmasIntoFields(pragmaContext, ts2.noop); + if (externalModule) { + if (ambientExternalModules) { + for (var _i = 0, ambientExternalModules_1 = ambientExternalModules; _i < ambientExternalModules_1.length; _i++) { + var decl = ambientExternalModules_1[_i]; + importedFiles.push(decl.ref); + } + } + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: void 0 }; + } else { + var ambientModuleNames = void 0; + if (ambientExternalModules) { + for (var _a2 = 0, ambientExternalModules_2 = ambientExternalModules; _a2 < ambientExternalModules_2.length; _a2++) { + var decl = ambientExternalModules_2[_a2]; + if (decl.depth === 0) { + if (!ambientModuleNames) { + ambientModuleNames = []; + } + ambientModuleNames.push(decl.ref.fileName); + } else { + importedFiles.push(decl.ref); + } + } + } + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; + } + } + ts2.preProcessFile = preProcessFile; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var Rename; + (function(Rename2) { + function getRenameInfo(program, sourceFile, position, preferences) { + var node = ts2.getAdjustedRenameLocation(ts2.getTouchingPropertyName(sourceFile, position)); + if (nodeIsEligibleForRename(node)) { + var renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, program, preferences); + if (renameInfo) { + return renameInfo; + } + } + return getRenameInfoError(ts2.Diagnostics.You_cannot_rename_this_element); + } + Rename2.getRenameInfo = getRenameInfo; + function getRenameInfoForNode(node, typeChecker, sourceFile, program, preferences) { + var symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + if (ts2.isStringLiteralLike(node)) { + var type3 = ts2.getContextualTypeFromParentOrAncestorTypeNode(node, typeChecker); + if (type3 && (type3.flags & 128 || type3.flags & 1048576 && ts2.every(type3.types, function(type4) { + return !!(type4.flags & 128); + }))) { + return getRenameInfoSuccess(node.text, node.text, "string", "", node, sourceFile); + } + } else if (ts2.isLabelName(node)) { + var name2 = ts2.getTextOfNode(node); + return getRenameInfoSuccess(name2, name2, "label", "", node, sourceFile); + } + return void 0; + } + var declarations = symbol.declarations; + if (!declarations || declarations.length === 0) + return; + if (declarations.some(function(declaration) { + return isDefinedInLibraryFile(program, declaration); + })) { + return getRenameInfoError(ts2.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + if (ts2.isIdentifier(node) && node.originalKeywordKind === 88 && symbol.parent && symbol.parent.flags & 1536) { + return void 0; + } + if (ts2.isStringLiteralLike(node) && ts2.tryGetImportFromModuleSpecifier(node)) { + return preferences.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : void 0; + } + var wouldRenameNodeModules = wouldRenameInOtherNodeModules(sourceFile, symbol, typeChecker, preferences); + if (wouldRenameNodeModules) { + return getRenameInfoError(wouldRenameNodeModules); + } + var kind = ts2.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); + var specifierName = ts2.isImportOrExportSpecifierName(node) || ts2.isStringOrNumericLiteralLike(node) && node.parent.kind === 164 ? ts2.stripQuotes(ts2.getTextOfIdentifierOrLiteral(node)) : void 0; + var displayName = specifierName || typeChecker.symbolToString(symbol); + var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts2.SymbolDisplay.getSymbolModifiers(typeChecker, symbol), node, sourceFile); + } + function isDefinedInLibraryFile(program, declaration) { + var sourceFile = declaration.getSourceFile(); + return program.isSourceFileDefaultLibrary(sourceFile) && ts2.fileExtensionIs( + sourceFile.fileName, + ".d.ts" + /* Extension.Dts */ + ); + } + function wouldRenameInOtherNodeModules(originalFile, symbol, checker, preferences) { + if (!preferences.providePrefixAndSuffixTextForRename && symbol.flags & 2097152) { + var importSpecifier = symbol.declarations && ts2.find(symbol.declarations, function(decl) { + return ts2.isImportSpecifier(decl); + }); + if (importSpecifier && !importSpecifier.propertyName) { + symbol = checker.getAliasedSymbol(symbol); + } + } + var declarations = symbol.declarations; + if (!declarations) { + return void 0; + } + var originalPackage = getPackagePathComponents(originalFile.path); + if (originalPackage === void 0) { + if (ts2.some(declarations, function(declaration2) { + return ts2.isInsideNodeModules(declaration2.getSourceFile().path); + })) { + return ts2.Diagnostics.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder; + } else { + return void 0; + } + } + for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) { + var declaration = declarations_4[_i]; + var declPackage = getPackagePathComponents(declaration.getSourceFile().path); + if (declPackage) { + var length_2 = Math.min(originalPackage.length, declPackage.length); + for (var i7 = 0; i7 <= length_2; i7++) { + if (ts2.compareStringsCaseSensitive(originalPackage[i7], declPackage[i7]) !== 0) { + return ts2.Diagnostics.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder; + } + } + } + } + return void 0; + } + function getPackagePathComponents(filePath) { + var components = ts2.getPathComponents(filePath); + var nodeModulesIdx = components.lastIndexOf("node_modules"); + if (nodeModulesIdx === -1) { + return void 0; + } + return components.slice(0, nodeModulesIdx + 2); + } + function getRenameInfoForModule(node, sourceFile, moduleSymbol) { + if (!ts2.isExternalModuleNameRelative(node.text)) { + return getRenameInfoError(ts2.Diagnostics.You_cannot_rename_a_module_via_a_global_import); + } + var moduleSourceFile = moduleSymbol.declarations && ts2.find(moduleSymbol.declarations, ts2.isSourceFile); + if (!moduleSourceFile) + return void 0; + var withoutIndex = ts2.endsWith(node.text, "/index") || ts2.endsWith(node.text, "/index.js") ? void 0 : ts2.tryRemoveSuffix(ts2.removeFileExtension(moduleSourceFile.fileName), "/index"); + var name2 = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex; + var kind = withoutIndex === void 0 ? "module" : "directory"; + var indexAfterLastSlash = node.text.lastIndexOf("/") + 1; + var triggerSpan = ts2.createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash); + return { + canRename: true, + fileToRename: name2, + kind, + displayName: name2, + fullDisplayName: name2, + kindModifiers: "", + triggerSpan + }; + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + fileToRename: void 0, + kind, + displayName, + fullDisplayName, + kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { canRename: false, localizedErrorMessage: ts2.getLocaleSpecificMessage(diagnostic) }; + } + function createTriggerSpanForNode(node, sourceFile) { + var start = node.getStart(sourceFile); + var width = node.getWidth(sourceFile); + if (ts2.isStringLiteralLike(node)) { + start += 1; + width -= 2; + } + return ts2.createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + switch (node.kind) { + case 79: + case 80: + case 10: + case 14: + case 108: + return true; + case 8: + return ts2.isLiteralNameOfPropertyDeclarationOrIndexAccess(node); + default: + return false; + } + } + Rename2.nodeIsEligibleForRename = nodeIsEligibleForRename; + })(Rename = ts2.Rename || (ts2.Rename = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var SmartSelectionRange; + (function(SmartSelectionRange2) { + function getSmartSelectionRange(pos, sourceFile) { + var _a2, _b; + var selectionRange = { + textSpan: ts2.createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) + }; + var parentNode = sourceFile; + outer: + while (true) { + var children = getSelectionChildren(parentNode); + if (!children.length) + break; + for (var i7 = 0; i7 < children.length; i7++) { + var prevNode = children[i7 - 1]; + var node = children[i7]; + var nextNode = children[i7 + 1]; + if (ts2.getTokenPosOfNode( + node, + sourceFile, + /*includeJsDoc*/ + true + ) > pos) { + break outer; + } + var comment = ts2.singleOrUndefined(ts2.getTrailingCommentRanges(sourceFile.text, node.end)); + if (comment && comment.kind === 2) { + pushSelectionCommentRange(comment.pos, comment.end); + } + if (positionShouldSnapToNode(sourceFile, pos, node)) { + if (ts2.isFunctionBody(node) && ts2.isFunctionLikeDeclaration(parentNode) && !ts2.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) { + pushSelectionRange(node.getStart(sourceFile), node.getEnd()); + } + if (ts2.isBlock(node) || ts2.isTemplateSpan(node) || ts2.isTemplateHead(node) || ts2.isTemplateTail(node) || prevNode && ts2.isTemplateHead(prevNode) || ts2.isVariableDeclarationList(node) && ts2.isVariableStatement(parentNode) || ts2.isSyntaxList(node) && ts2.isVariableDeclarationList(parentNode) || ts2.isVariableDeclaration(node) && ts2.isSyntaxList(parentNode) && children.length === 1 || ts2.isJSDocTypeExpression(node) || ts2.isJSDocSignature(node) || ts2.isJSDocTypeLiteral(node)) { + parentNode = node; + break; + } + if (ts2.isTemplateSpan(parentNode) && nextNode && ts2.isTemplateMiddleOrTemplateTail(nextNode)) { + var start_1 = node.getFullStart() - "${".length; + var end_2 = nextNode.getStart() + "}".length; + pushSelectionRange(start_1, end_2); + } + var isBetweenMultiLineBookends = ts2.isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) && !ts2.positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + var start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); + var end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); + if (ts2.hasJSDocNodes(node) && ((_a2 = node.jsDoc) === null || _a2 === void 0 ? void 0 : _a2.length)) { + pushSelectionRange(ts2.first(node.jsDoc).getStart(), end); + } + if (ts2.isSyntaxList(node)) { + var firstChild = node.getChildren()[0]; + if (firstChild && ts2.hasJSDocNodes(firstChild) && ((_b = firstChild.jsDoc) === null || _b === void 0 ? void 0 : _b.length) && firstChild.getStart() !== node.pos) { + start = Math.min(start, ts2.first(firstChild.jsDoc).getStart()); + } + } + pushSelectionRange(start, end); + if (ts2.isStringLiteral(node) || ts2.isTemplateLiteral(node)) { + pushSelectionRange(start + 1, end - 1); + } + parentNode = node; + break; + } + if (i7 === children.length - 1) { + break outer; + } + } + } + return selectionRange; + function pushSelectionRange(start2, end2) { + if (start2 !== end2) { + var textSpan = ts2.createTextSpanFromBounds(start2, end2); + if (!selectionRange || // Skip ranges that are identical to the parent + !ts2.textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don’t contain the original position + ts2.textSpanIntersectsWithPosition(textSpan, pos)) { + selectionRange = __assign16({ textSpan }, selectionRange && { parent: selectionRange }); + } + } + } + function pushSelectionCommentRange(start2, end2) { + pushSelectionRange(start2, end2); + var pos2 = start2; + while (sourceFile.text.charCodeAt(pos2) === 47) { + pos2++; + } + pushSelectionRange(pos2, end2); + } + } + SmartSelectionRange2.getSmartSelectionRange = getSmartSelectionRange; + function positionShouldSnapToNode(sourceFile, pos, node) { + ts2.Debug.assert(node.pos <= pos); + if (pos < node.end) { + return true; + } + var nodeEnd = node.getEnd(); + if (nodeEnd === pos) { + return ts2.getTouchingPropertyName(sourceFile, pos).pos < node.end; + } + return false; + } + var isImport = ts2.or(ts2.isImportDeclaration, ts2.isImportEqualsDeclaration); + function getSelectionChildren(node) { + var _a2; + if (ts2.isSourceFile(node)) { + return groupChildren(node.getChildAt(0).getChildren(), isImport); + } + if (ts2.isMappedTypeNode(node)) { + var _b = node.getChildren(), openBraceToken = _b[0], children = _b.slice(1); + var closeBraceToken = ts2.Debug.checkDefined(children.pop()); + ts2.Debug.assertEqual( + openBraceToken.kind, + 18 + /* SyntaxKind.OpenBraceToken */ + ); + ts2.Debug.assertEqual( + closeBraceToken.kind, + 19 + /* SyntaxKind.CloseBraceToken */ + ); + var groupedWithPlusMinusTokens = groupChildren(children, function(child) { + return child === node.readonlyToken || child.kind === 146 || child === node.questionToken || child.kind === 57; + }); + var groupedWithBrackets = groupChildren(groupedWithPlusMinusTokens, function(_a3) { + var kind = _a3.kind; + return kind === 22 || kind === 165 || kind === 23; + }); + return [ + openBraceToken, + // Pivot on `:` + createSyntaxList(splitChildren(groupedWithBrackets, function(_a3) { + var kind = _a3.kind; + return kind === 58; + })), + closeBraceToken + ]; + } + if (ts2.isPropertySignature(node)) { + var children = groupChildren(node.getChildren(), function(child) { + return child === node.name || ts2.contains(node.modifiers, child); + }); + var firstJSDocChild = ((_a2 = children[0]) === null || _a2 === void 0 ? void 0 : _a2.kind) === 323 ? children[0] : void 0; + var withJSDocSeparated = firstJSDocChild ? children.slice(1) : children; + var splittedChildren = splitChildren(withJSDocSeparated, function(_a3) { + var kind = _a3.kind; + return kind === 58; + }); + return firstJSDocChild ? [firstJSDocChild, createSyntaxList(splittedChildren)] : splittedChildren; + } + if (ts2.isParameter(node)) { + var groupedDotDotDotAndName_1 = groupChildren(node.getChildren(), function(child) { + return child === node.dotDotDotToken || child === node.name; + }); + var groupedWithQuestionToken = groupChildren(groupedDotDotDotAndName_1, function(child) { + return child === groupedDotDotDotAndName_1[0] || child === node.questionToken; + }); + return splitChildren(groupedWithQuestionToken, function(_a3) { + var kind = _a3.kind; + return kind === 63; + }); + } + if (ts2.isBindingElement(node)) { + return splitChildren(node.getChildren(), function(_a3) { + var kind = _a3.kind; + return kind === 63; + }); + } + return node.getChildren(); + } + function groupChildren(children, groupOn) { + var result2 = []; + var group2; + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + if (groupOn(child)) { + group2 = group2 || []; + group2.push(child); + } else { + if (group2) { + result2.push(createSyntaxList(group2)); + group2 = void 0; + } + result2.push(child); + } + } + if (group2) { + result2.push(createSyntaxList(group2)); + } + return result2; + } + function splitChildren(children, pivotOn, separateTrailingSemicolon) { + if (separateTrailingSemicolon === void 0) { + separateTrailingSemicolon = true; + } + if (children.length < 2) { + return children; + } + var splitTokenIndex = ts2.findIndex(children, pivotOn); + if (splitTokenIndex === -1) { + return children; + } + var leftChildren = children.slice(0, splitTokenIndex); + var splitToken = children[splitTokenIndex]; + var lastToken = ts2.last(children); + var separateLastToken = separateTrailingSemicolon && lastToken.kind === 26; + var rightChildren = children.slice(splitTokenIndex + 1, separateLastToken ? children.length - 1 : void 0); + var result2 = ts2.compact([ + leftChildren.length ? createSyntaxList(leftChildren) : void 0, + splitToken, + rightChildren.length ? createSyntaxList(rightChildren) : void 0 + ]); + return separateLastToken ? result2.concat(lastToken) : result2; + } + function createSyntaxList(children) { + ts2.Debug.assertGreaterThanOrEqual(children.length, 1); + return ts2.setTextRangePosEnd(ts2.parseNodeFactory.createSyntaxList(children), children[0].pos, ts2.last(children).end); + } + function isListOpener(token) { + var kind = token && token.kind; + return kind === 18 || kind === 22 || kind === 20 || kind === 283; + } + function isListCloser(token) { + var kind = token && token.kind; + return kind === 19 || kind === 23 || kind === 21 || kind === 284; + } + function getEndPos(sourceFile, node) { + switch (node.kind) { + case 343: + case 341: + case 350: + case 348: + case 345: + return sourceFile.getLineEndOfPosition(node.getStart()); + default: + return node.getEnd(); + } + } + })(SmartSelectionRange = ts2.SmartSelectionRange || (ts2.SmartSelectionRange = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var SignatureHelp; + (function(SignatureHelp2) { + var InvocationKind; + (function(InvocationKind2) { + InvocationKind2[InvocationKind2["Call"] = 0] = "Call"; + InvocationKind2[InvocationKind2["TypeArgs"] = 1] = "TypeArgs"; + InvocationKind2[InvocationKind2["Contextual"] = 2] = "Contextual"; + })(InvocationKind || (InvocationKind = {})); + function getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken) { + var typeChecker = program.getTypeChecker(); + var startingToken = ts2.findTokenOnLeftOfPosition(sourceFile, position); + if (!startingToken) { + return void 0; + } + var onlyUseSyntacticOwners = !!triggerReason && triggerReason.kind === "characterTyped"; + if (onlyUseSyntacticOwners && (ts2.isInString(sourceFile, position, startingToken) || ts2.isInComment(sourceFile, position))) { + return void 0; + } + var isManuallyInvoked = !!triggerReason && triggerReason.kind === "invoked"; + var argumentInfo = getContainingArgumentInfo(startingToken, position, sourceFile, typeChecker, isManuallyInvoked); + if (!argumentInfo) + return void 0; + cancellationToken.throwIfCancellationRequested(); + var candidateInfo = getCandidateOrTypeInfo(argumentInfo, typeChecker, sourceFile, startingToken, onlyUseSyntacticOwners); + cancellationToken.throwIfCancellationRequested(); + if (!candidateInfo) { + return ts2.isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; + } + return typeChecker.runWithCancellationToken(cancellationToken, function(typeChecker2) { + return candidateInfo.kind === 0 ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2); + }); + } + SignatureHelp2.getSignatureHelpItems = getSignatureHelpItems; + var CandidateOrTypeKind; + (function(CandidateOrTypeKind2) { + CandidateOrTypeKind2[CandidateOrTypeKind2["Candidate"] = 0] = "Candidate"; + CandidateOrTypeKind2[CandidateOrTypeKind2["Type"] = 1] = "Type"; + })(CandidateOrTypeKind || (CandidateOrTypeKind = {})); + function getCandidateOrTypeInfo(_a2, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { + var invocation = _a2.invocation, argumentCount = _a2.argumentCount; + switch (invocation.kind) { + case 0: { + if (onlyUseSyntacticOwners && !isSyntacticOwner(startingToken, invocation.node, sourceFile)) { + return void 0; + } + var candidates = []; + var resolvedSignature = checker.getResolvedSignatureForSignatureHelp(invocation.node, candidates, argumentCount); + return candidates.length === 0 ? void 0 : { kind: 0, candidates, resolvedSignature }; + } + case 1: { + var called = invocation.called; + if (onlyUseSyntacticOwners && !containsPrecedingToken(startingToken, sourceFile, ts2.isIdentifier(called) ? called.parent : called)) { + return void 0; + } + var candidates = ts2.getPossibleGenericSignatures(called, argumentCount, checker); + if (candidates.length !== 0) + return { kind: 0, candidates, resolvedSignature: ts2.first(candidates) }; + var symbol = checker.getSymbolAtLocation(called); + return symbol && { kind: 1, symbol }; + } + case 2: + return { kind: 0, candidates: [invocation.signature], resolvedSignature: invocation.signature }; + default: + return ts2.Debug.assertNever(invocation); + } + } + function isSyntacticOwner(startingToken, node, sourceFile) { + if (!ts2.isCallOrNewExpression(node)) + return false; + var invocationChildren = node.getChildren(sourceFile); + switch (startingToken.kind) { + case 20: + return ts2.contains(invocationChildren, startingToken); + case 27: { + var containingList = ts2.findContainingList(startingToken); + return !!containingList && ts2.contains(invocationChildren, containingList); + } + case 29: + return containsPrecedingToken(startingToken, sourceFile, node.expression); + default: + return false; + } + } + function createJSSignatureHelpItems(argumentInfo, program, cancellationToken) { + if (argumentInfo.invocation.kind === 2) + return void 0; + var expression = getExpressionFromInvocation(argumentInfo.invocation); + var name2 = ts2.isPropertyAccessExpression(expression) ? expression.name.text : void 0; + var typeChecker = program.getTypeChecker(); + return name2 === void 0 ? void 0 : ts2.firstDefined(program.getSourceFiles(), function(sourceFile) { + return ts2.firstDefined(sourceFile.getNamedDeclarations().get(name2), function(declaration) { + var type3 = declaration.symbol && typeChecker.getTypeOfSymbolAtLocation(declaration.symbol, declaration); + var callSignatures = type3 && type3.getCallSignatures(); + if (callSignatures && callSignatures.length) { + return typeChecker.runWithCancellationToken(cancellationToken, function(typeChecker2) { + return createSignatureHelpItems( + callSignatures, + callSignatures[0], + argumentInfo, + sourceFile, + typeChecker2, + /*useFullPrefix*/ + true + ); + }); + } + }); + }); + } + function containsPrecedingToken(startingToken, sourceFile, container) { + var pos = startingToken.getFullStart(); + var currentParent = startingToken.parent; + while (currentParent) { + var precedingToken = ts2.findPrecedingToken( + pos, + sourceFile, + currentParent, + /*excludeJsdoc*/ + true + ); + if (precedingToken) { + return ts2.rangeContainsRange(container, precedingToken); + } + currentParent = currentParent.parent; + } + return ts2.Debug.fail("Could not find preceding token"); + } + function getArgumentInfoForCompletions(node, position, sourceFile) { + var info2 = getImmediatelyContainingArgumentInfo(node, position, sourceFile); + return !info2 || info2.isTypeParameterList || info2.invocation.kind !== 0 ? void 0 : { invocation: info2.invocation.node, argumentCount: info2.argumentCount, argumentIndex: info2.argumentIndex }; + } + SignatureHelp2.getArgumentInfoForCompletions = getArgumentInfoForCompletions; + function getArgumentOrParameterListInfo(node, position, sourceFile) { + var info2 = getArgumentOrParameterListAndIndex(node, sourceFile); + if (!info2) + return void 0; + var list = info2.list, argumentIndex = info2.argumentIndex; + var argumentCount = getArgumentCount( + list, + /*ignoreTrailingComma*/ + ts2.isInString(sourceFile, position, node) + ); + if (argumentIndex !== 0) { + ts2.Debug.assertLessThan(argumentIndex, argumentCount); + } + var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); + return { list, argumentIndex, argumentCount, argumentsSpan }; + } + function getArgumentOrParameterListAndIndex(node, sourceFile) { + if (node.kind === 29 || node.kind === 20) { + return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 }; + } else { + var list = ts2.findContainingList(node); + return list && { list, argumentIndex: getArgumentIndex(list, node) }; + } + } + function getImmediatelyContainingArgumentInfo(node, position, sourceFile) { + var parent2 = node.parent; + if (ts2.isCallOrNewExpression(parent2)) { + var invocation = parent2; + var info2 = getArgumentOrParameterListInfo(node, position, sourceFile); + if (!info2) + return void 0; + var list = info2.list, argumentIndex = info2.argumentIndex, argumentCount = info2.argumentCount, argumentsSpan = info2.argumentsSpan; + var isTypeParameterList = !!parent2.typeArguments && parent2.typeArguments.pos === list.pos; + return { isTypeParameterList, invocation: { kind: 0, node: invocation }, argumentsSpan, argumentIndex, argumentCount }; + } else if (ts2.isNoSubstitutionTemplateLiteral(node) && ts2.isTaggedTemplateExpression(parent2)) { + if (ts2.isInsideTemplateLiteral(node, position, sourceFile)) { + return getArgumentListInfoForTemplate( + parent2, + /*argumentIndex*/ + 0, + sourceFile + ); + } + return void 0; + } else if (ts2.isTemplateHead(node) && parent2.parent.kind === 212) { + var templateExpression = parent2; + var tagExpression = templateExpression.parent; + ts2.Debug.assert( + templateExpression.kind === 225 + /* SyntaxKind.TemplateExpression */ + ); + var argumentIndex = ts2.isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); + } else if (ts2.isTemplateSpan(parent2) && ts2.isTaggedTemplateExpression(parent2.parent.parent)) { + var templateSpan = parent2; + var tagExpression = parent2.parent.parent; + if (ts2.isTemplateTail(node) && !ts2.isInsideTemplateLiteral(node, position, sourceFile)) { + return void 0; + } + var spanIndex = templateSpan.parent.templateSpans.indexOf(templateSpan); + var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile); + return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); + } else if (ts2.isJsxOpeningLikeElement(parent2)) { + var attributeSpanStart = parent2.attributes.pos; + var attributeSpanEnd = ts2.skipTrivia( + sourceFile.text, + parent2.attributes.end, + /*stopAfterLineBreak*/ + false + ); + return { + isTypeParameterList: false, + invocation: { kind: 0, node: parent2 }, + argumentsSpan: ts2.createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart), + argumentIndex: 0, + argumentCount: 1 + }; + } else { + var typeArgInfo = ts2.getPossibleTypeArgumentsInfo(node, sourceFile); + if (typeArgInfo) { + var called = typeArgInfo.called, nTypeArguments = typeArgInfo.nTypeArguments; + var invocation = { kind: 1, called }; + var argumentsSpan = ts2.createTextSpanFromBounds(called.getStart(sourceFile), node.end); + return { isTypeParameterList: true, invocation, argumentsSpan, argumentIndex: nTypeArguments, argumentCount: nTypeArguments + 1 }; + } + return void 0; + } + } + function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) { + return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile); + } + function getHighestBinary(b8) { + return ts2.isBinaryExpression(b8.parent) ? getHighestBinary(b8.parent) : b8; + } + function countBinaryExpressionParameters(b8) { + return ts2.isBinaryExpression(b8.left) ? countBinaryExpressionParameters(b8.left) + 1 : 2; + } + function tryGetParameterInfo(startingToken, position, sourceFile, checker) { + var info2 = getContextualSignatureLocationInfo(startingToken, sourceFile, position, checker); + if (!info2) + return void 0; + var contextualType = info2.contextualType, argumentIndex = info2.argumentIndex, argumentCount = info2.argumentCount, argumentsSpan = info2.argumentsSpan; + var nonNullableContextualType = contextualType.getNonNullableType(); + var symbol = nonNullableContextualType.symbol; + if (symbol === void 0) + return void 0; + var signature = ts2.lastOrUndefined(nonNullableContextualType.getCallSignatures()); + if (signature === void 0) + return void 0; + var invocation = { kind: 2, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) }; + return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount }; + } + function getContextualSignatureLocationInfo(startingToken, sourceFile, position, checker) { + if (startingToken.kind !== 20 && startingToken.kind !== 27) + return void 0; + var parent2 = startingToken.parent; + switch (parent2.kind) { + case 214: + case 171: + case 215: + case 216: + var info2 = getArgumentOrParameterListInfo(startingToken, position, sourceFile); + if (!info2) + return void 0; + var argumentIndex = info2.argumentIndex, argumentCount = info2.argumentCount, argumentsSpan = info2.argumentsSpan; + var contextualType = ts2.isMethodDeclaration(parent2) ? checker.getContextualTypeForObjectLiteralElement(parent2) : checker.getContextualType(parent2); + return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan }; + case 223: { + var highestBinary = getHighestBinary(parent2); + var contextualType_1 = checker.getContextualType(highestBinary); + var argumentIndex_1 = startingToken.kind === 20 ? 0 : countBinaryExpressionParameters(parent2) - 1; + var argumentCount_1 = countBinaryExpressionParameters(highestBinary); + return contextualType_1 && { contextualType: contextualType_1, argumentIndex: argumentIndex_1, argumentCount: argumentCount_1, argumentsSpan: ts2.createTextSpanFromNode(parent2) }; + } + default: + return void 0; + } + } + function chooseBetterSymbol(s7) { + return s7.name === "__type" ? ts2.firstDefined(s7.declarations, function(d7) { + return ts2.isFunctionTypeNode(d7) ? d7.parent.symbol : void 0; + }) || s7 : s7; + } + function getArgumentIndex(argumentsList, node) { + var argumentIndex = 0; + for (var _i = 0, _a2 = argumentsList.getChildren(); _i < _a2.length; _i++) { + var child = _a2[_i]; + if (child === node) { + break; + } + if (child.kind !== 27) { + argumentIndex++; + } + } + return argumentIndex; + } + function getArgumentCount(argumentsList, ignoreTrailingComma) { + var listChildren = argumentsList.getChildren(); + var argumentCount = ts2.countWhere(listChildren, function(arg) { + return arg.kind !== 27; + }); + if (!ignoreTrailingComma && listChildren.length > 0 && ts2.last(listChildren).kind === 27) { + argumentCount++; + } + return argumentCount; + } + function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) { + ts2.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); + if (ts2.isTemplateLiteralToken(node)) { + if (ts2.isInsideTemplateLiteral(node, position, sourceFile)) { + return 0; + } + return spanIndex + 2; + } + return spanIndex + 1; + } + function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { + var argumentCount = ts2.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; + if (argumentIndex !== 0) { + ts2.Debug.assertLessThan(argumentIndex, argumentCount); + } + return { + isTypeParameterList: false, + invocation: { kind: 0, node: tagExpression }, + argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression, sourceFile), + argumentIndex, + argumentCount + }; + } + function getApplicableSpanForArguments(argumentsList, sourceFile) { + var applicableSpanStart = argumentsList.getFullStart(); + var applicableSpanEnd = ts2.skipTrivia( + sourceFile.text, + argumentsList.getEnd(), + /*stopAfterLineBreak*/ + false + ); + return ts2.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) { + var template2 = taggedTemplate.template; + var applicableSpanStart = template2.getStart(); + var applicableSpanEnd = template2.getEnd(); + if (template2.kind === 225) { + var lastSpan = ts2.last(template2.templateSpans); + if (lastSpan.literal.getFullWidth() === 0) { + applicableSpanEnd = ts2.skipTrivia( + sourceFile.text, + applicableSpanEnd, + /*stopAfterLineBreak*/ + false + ); + } + } + return ts2.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) { + var _loop_7 = function(n8) { + ts2.Debug.assert(ts2.rangeContainsRange(n8.parent, n8), "Not a subspan", function() { + return "Child: ".concat(ts2.Debug.formatSyntaxKind(n8.kind), ", parent: ").concat(ts2.Debug.formatSyntaxKind(n8.parent.kind)); + }); + var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n8, position, sourceFile, checker); + if (argumentInfo) { + return { value: argumentInfo }; + } + }; + for (var n7 = node; !ts2.isSourceFile(n7) && (isManuallyInvoked || !ts2.isBlock(n7)); n7 = n7.parent) { + var state_4 = _loop_7(n7); + if (typeof state_4 === "object") + return state_4.value; + } + return void 0; + } + function getChildListThatStartsWithOpenerToken(parent2, openerToken, sourceFile) { + var children = parent2.getChildren(sourceFile); + var indexOfOpenerToken = children.indexOf(openerToken); + ts2.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); + return children[indexOfOpenerToken + 1]; + } + function getExpressionFromInvocation(invocation) { + return invocation.kind === 0 ? ts2.getInvokedExpression(invocation.node) : invocation.called; + } + function getEnclosingDeclarationFromInvocation(invocation) { + return invocation.kind === 0 ? invocation.node : invocation.kind === 1 ? invocation.called : invocation.node; + } + var signatureHelpNodeBuilderFlags = 8192 | 70221824 | 16384; + function createSignatureHelpItems(candidates, resolvedSignature, _a2, sourceFile, typeChecker, useFullPrefix) { + var _b; + var isTypeParameterList = _a2.isTypeParameterList, argumentCount = _a2.argumentCount, applicableSpan = _a2.argumentsSpan, invocation = _a2.invocation, argumentIndex = _a2.argumentIndex; + var enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); + var callTargetSymbol = invocation.kind === 2 ? invocation.symbol : typeChecker.getSymbolAtLocation(getExpressionFromInvocation(invocation)) || useFullPrefix && ((_b = resolvedSignature.declaration) === null || _b === void 0 ? void 0 : _b.symbol); + var callTargetDisplayParts = callTargetSymbol ? ts2.symbolToDisplayParts( + typeChecker, + callTargetSymbol, + useFullPrefix ? sourceFile : void 0, + /*meaning*/ + void 0 + ) : ts2.emptyArray; + var items = ts2.map(candidates, function(candidateSignature) { + return getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile); + }); + if (argumentIndex !== 0) { + ts2.Debug.assertLessThan(argumentIndex, argumentCount); + } + var selectedItemIndex = 0; + var itemsSeen = 0; + for (var i7 = 0; i7 < items.length; i7++) { + var item = items[i7]; + if (candidates[i7] === resolvedSignature) { + selectedItemIndex = itemsSeen; + if (item.length > 1) { + var count2 = 0; + for (var _i = 0, item_1 = item; _i < item_1.length; _i++) { + var i_1 = item_1[_i]; + if (i_1.isVariadic || i_1.parameters.length >= argumentCount) { + selectedItemIndex = itemsSeen + count2; + break; + } + count2++; + } + } + } + itemsSeen += item.length; + } + ts2.Debug.assert(selectedItemIndex !== -1); + var help = { items: ts2.flatMapToMutable(items, ts2.identity), applicableSpan, selectedItemIndex, argumentIndex, argumentCount }; + var selected = help.items[selectedItemIndex]; + if (selected.isVariadic) { + var firstRest = ts2.findIndex(selected.parameters, function(p7) { + return !!p7.isRest; + }); + if (-1 < firstRest && firstRest < selected.parameters.length - 1) { + help.argumentIndex = selected.parameters.length; + } else { + help.argumentIndex = Math.min(help.argumentIndex, selected.parameters.length - 1); + } + } + return help; + } + function createTypeHelpItems(symbol, _a2, sourceFile, checker) { + var argumentCount = _a2.argumentCount, applicableSpan = _a2.argumentsSpan, invocation = _a2.invocation, argumentIndex = _a2.argumentIndex; + var typeParameters = checker.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (!typeParameters) + return void 0; + var items = [getTypeHelpItem(symbol, typeParameters, checker, getEnclosingDeclarationFromInvocation(invocation), sourceFile)]; + return { items, applicableSpan, selectedItemIndex: 0, argumentIndex, argumentCount }; + } + function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { + var typeSymbolDisplay = ts2.symbolToDisplayParts(checker, symbol); + var printer = ts2.createPrinter({ removeComments: true }); + var parameters = typeParameters.map(function(t8) { + return createSignatureHelpParameterForTypeParameter(t8, checker, enclosingDeclaration, sourceFile, printer); + }); + var documentation = symbol.getDocumentationComment(checker); + var tags6 = symbol.getJsDocTags(checker); + var prefixDisplayParts = __spreadArray9(__spreadArray9([], typeSymbolDisplay, true), [ts2.punctuationPart( + 29 + /* SyntaxKind.LessThanToken */ + )], false); + return { isVariadic: false, prefixDisplayParts, suffixDisplayParts: [ts2.punctuationPart( + 31 + /* SyntaxKind.GreaterThanToken */ + )], separatorDisplayParts, parameters, documentation, tags: tags6 }; + } + var separatorDisplayParts = [ts2.punctuationPart( + 27 + /* SyntaxKind.CommaToken */ + ), ts2.spacePart()]; + function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) { + var infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile); + return ts2.map(infos, function(_a2) { + var isVariadic = _a2.isVariadic, parameters = _a2.parameters, prefix = _a2.prefix, suffix = _a2.suffix; + var prefixDisplayParts = __spreadArray9(__spreadArray9([], callTargetDisplayParts, true), prefix, true); + var suffixDisplayParts = __spreadArray9(__spreadArray9([], suffix, true), returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker), true); + var documentation = candidateSignature.getDocumentationComment(checker); + var tags6 = candidateSignature.getJsDocTags(); + return { isVariadic, prefixDisplayParts, suffixDisplayParts, separatorDisplayParts, parameters, documentation, tags: tags6 }; + }); + } + function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker) { + return ts2.mapToDisplayParts(function(writer) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = checker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + checker.writeTypePredicate( + predicate, + enclosingDeclaration, + /*flags*/ + void 0, + writer + ); + } else { + checker.writeType( + checker.getReturnTypeOfSignature(candidateSignature), + enclosingDeclaration, + /*flags*/ + void 0, + writer + ); + } + }); + } + function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { + var typeParameters = (candidateSignature.target || candidateSignature).typeParameters; + var printer = ts2.createPrinter({ removeComments: true }); + var parameters = (typeParameters || ts2.emptyArray).map(function(t8) { + return createSignatureHelpParameterForTypeParameter(t8, checker, enclosingDeclaration, sourceFile, printer); + }); + var thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; + return checker.getExpandedParameters(candidateSignature).map(function(paramList) { + var params = ts2.factory.createNodeArray(__spreadArray9(__spreadArray9([], thisParameter, true), ts2.map(paramList, function(param) { + return checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags); + }), true)); + var parameterParts = ts2.mapToDisplayParts(function(writer) { + printer.writeList(2576, params, sourceFile, writer); + }); + return { isVariadic: false, parameters, prefix: [ts2.punctuationPart( + 29 + /* SyntaxKind.LessThanToken */ + )], suffix: __spreadArray9([ts2.punctuationPart( + 31 + /* SyntaxKind.GreaterThanToken */ + )], parameterParts, true) }; + }); + } + function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { + var printer = ts2.createPrinter({ removeComments: true }); + var typeParameterParts = ts2.mapToDisplayParts(function(writer) { + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + var args = ts2.factory.createNodeArray(candidateSignature.typeParameters.map(function(p7) { + return checker.typeParameterToDeclaration(p7, enclosingDeclaration, signatureHelpNodeBuilderFlags); + })); + printer.writeList(53776, args, sourceFile, writer); + } + }); + var lists = checker.getExpandedParameters(candidateSignature); + var isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? function(_6) { + return false; + } : lists.length === 1 ? function(_6) { + return true; + } : function(pList) { + return !!(pList.length && pList[pList.length - 1].checkFlags & 32768); + }; + return lists.map(function(parameterList) { + return { + isVariadic: isVariadic(parameterList), + parameters: parameterList.map(function(p7) { + return createSignatureHelpParameterForParameter(p7, checker, enclosingDeclaration, sourceFile, printer); + }), + prefix: __spreadArray9(__spreadArray9([], typeParameterParts, true), [ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )], false), + suffix: [ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )] + }; + }); + } + function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) { + var displayParts = ts2.mapToDisplayParts(function(writer) { + var param = checker.symbolToParameterDeclaration(parameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); + printer.writeNode(4, param, sourceFile, writer); + }); + var isOptional2 = checker.isOptionalParameter(parameter.valueDeclaration); + var isRest = !!(parameter.checkFlags & 32768); + return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional: isOptional2, isRest }; + } + function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) { + var displayParts = ts2.mapToDisplayParts(function(writer) { + var param = checker.typeParameterToDeclaration(typeParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); + printer.writeNode(4, param, sourceFile, writer); + }); + return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts, isOptional: false, isRest: false }; + } + })(SignatureHelp = ts2.SignatureHelp || (ts2.SignatureHelp = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var InlayHints; + (function(InlayHints2) { + var maxHintsLength = 30; + var leadingParameterNameCommentRegexFactory = function(name2) { + return new RegExp("^\\s?/\\*\\*?\\s?".concat(name2, "\\s?\\*\\/\\s?$")); + }; + function shouldShowParameterNameHints(preferences) { + return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all"; + } + function shouldShowLiteralParameterNameHintsOnly(preferences) { + return preferences.includeInlayParameterNameHints === "literals"; + } + function provideInlayHints(context2) { + var file = context2.file, program = context2.program, span = context2.span, cancellationToken = context2.cancellationToken, preferences = context2.preferences; + var sourceFileText = file.text; + var compilerOptions = program.getCompilerOptions(); + var checker = program.getTypeChecker(); + var result2 = []; + visitor(file); + return result2; + function visitor(node) { + if (!node || node.getFullWidth() === 0) { + return; + } + switch (node.kind) { + case 264: + case 260: + case 261: + case 259: + case 228: + case 215: + case 171: + case 216: + cancellationToken.throwIfCancellationRequested(); + } + if (!ts2.textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { + return; + } + if (ts2.isTypeNode(node) && !ts2.isExpressionWithTypeArguments(node)) { + return; + } + if (preferences.includeInlayVariableTypeHints && ts2.isVariableDeclaration(node)) { + visitVariableLikeDeclaration(node); + } else if (preferences.includeInlayPropertyDeclarationTypeHints && ts2.isPropertyDeclaration(node)) { + visitVariableLikeDeclaration(node); + } else if (preferences.includeInlayEnumMemberValueHints && ts2.isEnumMember(node)) { + visitEnumMember(node); + } else if (shouldShowParameterNameHints(preferences) && (ts2.isCallExpression(node) || ts2.isNewExpression(node))) { + visitCallOrNewExpression(node); + } else { + if (preferences.includeInlayFunctionParameterTypeHints && ts2.isFunctionLikeDeclaration(node) && ts2.hasContextSensitiveParameters(node)) { + visitFunctionLikeForParameterType(node); + } + if (preferences.includeInlayFunctionLikeReturnTypeHints && isSignatureSupportingReturnAnnotation(node)) { + visitFunctionDeclarationLikeForReturnType(node); + } + } + return ts2.forEachChild(node, visitor); + } + function isSignatureSupportingReturnAnnotation(node) { + return ts2.isArrowFunction(node) || ts2.isFunctionExpression(node) || ts2.isFunctionDeclaration(node) || ts2.isMethodDeclaration(node) || ts2.isGetAccessorDeclaration(node); + } + function addParameterHints(text, position, isFirstVariadicArgument) { + result2.push({ + text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"), + position, + kind: "Parameter", + whitespaceAfter: true + }); + } + function addTypeHints(text, position) { + result2.push({ + text: ": ".concat(truncation(text, maxHintsLength)), + position, + kind: "Type", + whitespaceBefore: true + }); + } + function addEnumMemberValueHints(text, position) { + result2.push({ + text: "= ".concat(truncation(text, maxHintsLength)), + position, + kind: "Enum", + whitespaceBefore: true + }); + } + function visitEnumMember(member) { + if (member.initializer) { + return; + } + var enumValue = checker.getConstantValue(member); + if (enumValue !== void 0) { + addEnumMemberValueHints(enumValue.toString(), member.end); + } + } + function isModuleReferenceType(type3) { + return type3.symbol && type3.symbol.flags & 1536; + } + function visitVariableLikeDeclaration(decl) { + if (!decl.initializer || ts2.isBindingPattern(decl.name) || ts2.isVariableDeclaration(decl) && !isHintableDeclaration(decl)) { + return; + } + var effectiveTypeAnnotation = ts2.getEffectiveTypeAnnotationNode(decl); + if (effectiveTypeAnnotation) { + return; + } + var declarationType = checker.getTypeAtLocation(decl); + if (isModuleReferenceType(declarationType)) { + return; + } + var typeDisplayString = printTypeInSingleLine(declarationType); + if (typeDisplayString) { + var isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && ts2.equateStringsCaseInsensitive(decl.name.getText(), typeDisplayString); + if (isVariableNameMatchesType) { + return; + } + addTypeHints(typeDisplayString, decl.name.end); + } + } + function visitCallOrNewExpression(expr) { + var args = expr.arguments; + if (!args || !args.length) { + return; + } + var candidates = []; + var signature = checker.getResolvedSignatureForSignatureHelp(expr, candidates); + if (!signature || !candidates.length) { + return; + } + for (var i7 = 0; i7 < args.length; ++i7) { + var originalArg = args[i7]; + var arg = ts2.skipParentheses(originalArg); + if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) { + continue; + } + var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i7); + if (identifierNameInfo) { + var parameterName = identifierNameInfo[0], isFirstVariadicArgument = identifierNameInfo[1]; + var isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName); + if (!isParameterNameNotSameAsArgument && !isFirstVariadicArgument) { + continue; + } + var name2 = ts2.unescapeLeadingUnderscores(parameterName); + if (leadingCommentsContainsParameterName(arg, name2)) { + continue; + } + addParameterHints(name2, originalArg.getStart(), isFirstVariadicArgument); + } + } + } + function identifierOrAccessExpressionPostfixMatchesParameterName(expr, parameterName) { + if (ts2.isIdentifier(expr)) { + return expr.text === parameterName; + } + if (ts2.isPropertyAccessExpression(expr)) { + return expr.name.text === parameterName; + } + return false; + } + function leadingCommentsContainsParameterName(node, name2) { + if (!ts2.isIdentifierText(name2, compilerOptions.target, ts2.getLanguageVariant(file.scriptKind))) { + return false; + } + var ranges = ts2.getLeadingCommentRanges(sourceFileText, node.pos); + if (!(ranges === null || ranges === void 0 ? void 0 : ranges.length)) { + return false; + } + var regex = leadingParameterNameCommentRegexFactory(name2); + return ts2.some(ranges, function(range2) { + return regex.test(sourceFileText.substring(range2.pos, range2.end)); + }); + } + function isHintableLiteral(node) { + switch (node.kind) { + case 221: { + var operand = node.operand; + return ts2.isLiteralExpression(operand) || ts2.isIdentifier(operand) && ts2.isInfinityOrNaNString(operand.escapedText); + } + case 110: + case 95: + case 104: + case 14: + case 225: + return true; + case 79: { + var name2 = node.escapedText; + return isUndefined3(name2) || ts2.isInfinityOrNaNString(name2); + } + } + return ts2.isLiteralExpression(node); + } + function visitFunctionDeclarationLikeForReturnType(decl) { + if (ts2.isArrowFunction(decl)) { + if (!ts2.findChildOfKind(decl, 20, file)) { + return; + } + } + var effectiveTypeAnnotation = ts2.getEffectiveReturnTypeNode(decl); + if (effectiveTypeAnnotation || !decl.body) { + return; + } + var signature = checker.getSignatureFromDeclaration(decl); + if (!signature) { + return; + } + var returnType = checker.getReturnTypeOfSignature(signature); + if (isModuleReferenceType(returnType)) { + return; + } + var typeDisplayString = printTypeInSingleLine(returnType); + if (!typeDisplayString) { + return; + } + addTypeHints(typeDisplayString, getTypeAnnotationPosition(decl)); + } + function getTypeAnnotationPosition(decl) { + var closeParenToken = ts2.findChildOfKind(decl, 21, file); + if (closeParenToken) { + return closeParenToken.end; + } + return decl.parameters.end; + } + function visitFunctionLikeForParameterType(node) { + var signature = checker.getSignatureFromDeclaration(node); + if (!signature) { + return; + } + for (var i7 = 0; i7 < node.parameters.length && i7 < signature.parameters.length; ++i7) { + var param = node.parameters[i7]; + if (!isHintableDeclaration(param)) { + continue; + } + var effectiveTypeAnnotation = ts2.getEffectiveTypeAnnotationNode(param); + if (effectiveTypeAnnotation) { + continue; + } + var typeDisplayString = getParameterDeclarationTypeDisplayString(signature.parameters[i7]); + if (!typeDisplayString) { + continue; + } + addTypeHints(typeDisplayString, param.questionToken ? param.questionToken.end : param.name.end); + } + } + function getParameterDeclarationTypeDisplayString(symbol) { + var valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || !ts2.isParameter(valueDeclaration)) { + return void 0; + } + var signatureParamType = checker.getTypeOfSymbolAtLocation(symbol, valueDeclaration); + if (isModuleReferenceType(signatureParamType)) { + return void 0; + } + return printTypeInSingleLine(signatureParamType); + } + function truncation(text, maxLength) { + if (text.length > maxLength) { + return text.substr(0, maxLength - "...".length) + "..."; + } + return text; + } + function printTypeInSingleLine(type3) { + var flags = 70221824 | 1048576 | 16384; + var options = { removeComments: true }; + var printer = ts2.createPrinter(options); + return ts2.usingSingleLineStringWriter(function(writer) { + var typeNode = checker.typeToTypeNode( + type3, + /*enclosingDeclaration*/ + void 0, + flags, + writer + ); + ts2.Debug.assertIsDefined(typeNode, "should always get typenode"); + printer.writeNode( + 4, + typeNode, + /*sourceFile*/ + file, + writer + ); + }); + } + function isUndefined3(name2) { + return name2 === "undefined"; + } + function isHintableDeclaration(node) { + if ((ts2.isParameterDeclaration(node) || ts2.isVariableDeclaration(node) && ts2.isVarConst(node)) && node.initializer) { + var initializer = ts2.skipParentheses(node.initializer); + return !(isHintableLiteral(initializer) || ts2.isNewExpression(initializer) || ts2.isObjectLiteralExpression(initializer) || ts2.isAssertionExpression(initializer)); + } + return true; + } + } + InlayHints2.provideInlayHints = provideInlayHints; + })(InlayHints = ts2.InlayHints || (ts2.InlayHints = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/; + function getSourceMapper(host) { + var getCanonicalFileName = ts2.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var currentDirectory = host.getCurrentDirectory(); + var sourceFileLike = new ts2.Map(); + var documentPositionMappers = new ts2.Map(); + return { tryGetSourcePosition, tryGetGeneratedPosition, toLineColumnOffset, clearCache }; + function toPath2(fileName) { + return ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getDocumentPositionMapper2(generatedFileName, sourceFileName) { + var path2 = toPath2(generatedFileName); + var value2 = documentPositionMappers.get(path2); + if (value2) + return value2; + var mapper; + if (host.getDocumentPositionMapper) { + mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); + } else if (host.readFile) { + var file = getSourceFileLike(generatedFileName); + mapper = file && ts2.getDocumentPositionMapper({ getSourceFileLike, getCanonicalFileName, log: function(s7) { + return host.log(s7); + } }, generatedFileName, ts2.getLineInfo(file.text, ts2.getLineStarts(file)), function(f8) { + return !host.fileExists || host.fileExists(f8) ? host.readFile(f8) : void 0; + }); + } + documentPositionMappers.set(path2, mapper || ts2.identitySourceMapConsumer); + return mapper || ts2.identitySourceMapConsumer; + } + function tryGetSourcePosition(info2) { + if (!ts2.isDeclarationFileName(info2.fileName)) + return void 0; + var file = getSourceFile(info2.fileName); + if (!file) + return void 0; + var newLoc = getDocumentPositionMapper2(info2.fileName).getSourcePosition(info2); + return !newLoc || newLoc === info2 ? void 0 : tryGetSourcePosition(newLoc) || newLoc; + } + function tryGetGeneratedPosition(info2) { + if (ts2.isDeclarationFileName(info2.fileName)) + return void 0; + var sourceFile = getSourceFile(info2.fileName); + if (!sourceFile) + return void 0; + var program = host.getProgram(); + if (program.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) { + return void 0; + } + var options = program.getCompilerOptions(); + var outPath = ts2.outFile(options); + var declarationPath = outPath ? ts2.removeFileExtension(outPath) + ".d.ts" : ts2.getDeclarationEmitOutputFilePathWorker(info2.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); + if (declarationPath === void 0) + return void 0; + var newLoc = getDocumentPositionMapper2(declarationPath, info2.fileName).getGeneratedPosition(info2); + return newLoc === info2 ? void 0 : newLoc; + } + function getSourceFile(fileName) { + var program = host.getProgram(); + if (!program) + return void 0; + var path2 = toPath2(fileName); + var file = program.getSourceFileByPath(path2); + return file && file.resolvedPath === path2 ? file : void 0; + } + function getOrCreateSourceFileLike(fileName) { + var path2 = toPath2(fileName); + var fileFromCache = sourceFileLike.get(path2); + if (fileFromCache !== void 0) + return fileFromCache ? fileFromCache : void 0; + if (!host.readFile || host.fileExists && !host.fileExists(path2)) { + sourceFileLike.set(path2, false); + return void 0; + } + var text = host.readFile(path2); + var file = text ? createSourceFileLike(text) : false; + sourceFileLike.set(path2, file); + return file ? file : void 0; + } + function getSourceFileLike(fileName) { + return !host.getSourceFileLike ? getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : host.getSourceFileLike(fileName); + } + function toLineColumnOffset(fileName, position) { + var file = getSourceFileLike(fileName); + return file.getLineAndCharacterOfPosition(position); + } + function clearCache() { + sourceFileLike.clear(); + documentPositionMappers.clear(); + } + } + ts2.getSourceMapper = getSourceMapper; + function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) { + var mapFileName = ts2.tryGetSourceMappingURL(generatedFileLineInfo); + if (mapFileName) { + var match = base64UrlRegExp.exec(mapFileName); + if (match) { + if (match[1]) { + var base64Object = match[1]; + return convertDocumentToSourceMapper(host, ts2.base64decode(ts2.sys, base64Object), generatedFileName); + } + mapFileName = void 0; + } + } + var possibleMapLocations = []; + if (mapFileName) { + possibleMapLocations.push(mapFileName); + } + possibleMapLocations.push(generatedFileName + ".map"); + var originalMapFileName = mapFileName && ts2.getNormalizedAbsolutePath(mapFileName, ts2.getDirectoryPath(generatedFileName)); + for (var _i = 0, possibleMapLocations_1 = possibleMapLocations; _i < possibleMapLocations_1.length; _i++) { + var location2 = possibleMapLocations_1[_i]; + var mapFileName_1 = ts2.getNormalizedAbsolutePath(location2, ts2.getDirectoryPath(generatedFileName)); + var mapFileContents = readMapFile(mapFileName_1, originalMapFileName); + if (ts2.isString(mapFileContents)) { + return convertDocumentToSourceMapper(host, mapFileContents, mapFileName_1); + } + if (mapFileContents !== void 0) { + return mapFileContents || void 0; + } + } + return void 0; + } + ts2.getDocumentPositionMapper = getDocumentPositionMapper; + function convertDocumentToSourceMapper(host, contents, mapFileName) { + var map4 = ts2.tryParseRawSourceMap(contents); + if (!map4 || !map4.sources || !map4.file || !map4.mappings) { + return void 0; + } + if (map4.sourcesContent && map4.sourcesContent.some(ts2.isString)) + return void 0; + return ts2.createDocumentPositionMapper(host, map4, mapFileName); + } + function createSourceFileLike(text, lineMap) { + return { + text, + lineMap, + getLineAndCharacterOfPosition: function(pos) { + return ts2.computeLineAndCharacterOfPosition(ts2.getLineStarts(this), pos); + } + }; + } + })(ts || (ts = {})); + var ts; + (function(ts2) { + var visitedNestedConvertibleFunctions = new ts2.Map(); + function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { + program.getSemanticDiagnostics(sourceFile, cancellationToken); + var diags = []; + var checker = program.getTypeChecker(); + var isCommonJSFile = sourceFile.impliedNodeFormat === ts2.ModuleKind.CommonJS || ts2.fileExtensionIsOneOf(sourceFile.fileName, [ + ".cts", + ".cjs" + /* Extension.Cjs */ + ]); + if (!isCommonJSFile && sourceFile.commonJsModuleIndicator && (ts2.programContainsEsModules(program) || ts2.compilerOptionsIndicateEsModules(program.getCompilerOptions())) && containsTopLevelCommonjs(sourceFile)) { + diags.push(ts2.createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), ts2.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module)); + } + var isJsFile = ts2.isSourceFileJS(sourceFile); + visitedNestedConvertibleFunctions.clear(); + check(sourceFile); + if (ts2.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { + for (var _i = 0, _a2 = sourceFile.imports; _i < _a2.length; _i++) { + var moduleSpecifier = _a2[_i]; + var importNode = ts2.importFromModuleSpecifier(moduleSpecifier); + var name2 = importNameForConvertToDefaultImport(importNode); + if (!name2) + continue; + var module_1 = ts2.getResolvedModule(sourceFile, moduleSpecifier.text, ts2.getModeForUsageLocation(sourceFile, moduleSpecifier)); + var resolvedFile = module_1 && program.getSourceFile(module_1.resolvedFileName); + if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && ts2.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) { + diags.push(ts2.createDiagnosticForNode(name2, ts2.Diagnostics.Import_may_be_converted_to_a_default_import)); + } + } + } + ts2.addRange(diags, sourceFile.bindSuggestionDiagnostics); + ts2.addRange(diags, program.getSuggestionDiagnostics(sourceFile, cancellationToken)); + return diags.sort(function(d1, d22) { + return d1.start - d22.start; + }); + function check(node) { + if (isJsFile) { + if (canBeConvertedToClass(node, checker)) { + diags.push(ts2.createDiagnosticForNode(ts2.isVariableDeclaration(node.parent) ? node.parent.name : node, ts2.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); + } + } else { + if (ts2.isVariableStatement(node) && node.parent === sourceFile && node.declarationList.flags & 2 && node.declarationList.declarations.length === 1) { + var init2 = node.declarationList.declarations[0].initializer; + if (init2 && ts2.isRequireCall( + init2, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + diags.push(ts2.createDiagnosticForNode(init2, ts2.Diagnostics.require_call_may_be_converted_to_an_import)); + } + } + if (ts2.codefix.parameterShouldGetTypeFromJSDoc(node)) { + diags.push(ts2.createDiagnosticForNode(node.name || node, ts2.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types)); + } + } + if (canBeConvertedToAsync(node)) { + addConvertToAsyncFunctionDiagnostics(node, checker, diags); + } + node.forEachChild(check); + } + } + ts2.computeSuggestionDiagnostics = computeSuggestionDiagnostics; + function containsTopLevelCommonjs(sourceFile) { + return sourceFile.statements.some(function(statement) { + switch (statement.kind) { + case 240: + return statement.declarationList.declarations.some(function(decl) { + return !!decl.initializer && ts2.isRequireCall( + propertyAccessLeftHandSide(decl.initializer), + /*checkArgumentIsStringLiteralLike*/ + true + ); + }); + case 241: { + var expression = statement.expression; + if (!ts2.isBinaryExpression(expression)) + return ts2.isRequireCall( + expression, + /*checkArgumentIsStringLiteralLike*/ + true + ); + var kind = ts2.getAssignmentDeclarationKind(expression); + return kind === 1 || kind === 2; + } + default: + return false; + } + }); + } + function propertyAccessLeftHandSide(node) { + return ts2.isPropertyAccessExpression(node) ? propertyAccessLeftHandSide(node.expression) : node; + } + function importNameForConvertToDefaultImport(node) { + switch (node.kind) { + case 269: + var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 271 && ts2.isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; + case 268: + return node.name; + default: + return void 0; + } + } + function addConvertToAsyncFunctionDiagnostics(node, checker, diags) { + if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) { + diags.push(ts2.createDiagnosticForNode(!node.name && ts2.isVariableDeclaration(node.parent) && ts2.isIdentifier(node.parent.name) ? node.parent.name : node, ts2.Diagnostics.This_may_be_converted_to_an_async_function)); + } + } + function isConvertibleFunction(node, checker) { + return !ts2.isAsyncFunction(node) && node.body && ts2.isBlock(node.body) && hasReturnStatementWithPromiseHandler(node.body, checker) && returnsPromise(node, checker); + } + function returnsPromise(node, checker) { + var signature = checker.getSignatureFromDeclaration(node); + var returnType = signature ? checker.getReturnTypeOfSignature(signature) : void 0; + return !!returnType && !!checker.getPromisedTypeOfPromise(returnType); + } + ts2.returnsPromise = returnsPromise; + function getErrorNodeFromCommonJsIndicator(commonJsModuleIndicator) { + return ts2.isBinaryExpression(commonJsModuleIndicator) ? commonJsModuleIndicator.left : commonJsModuleIndicator; + } + function hasReturnStatementWithPromiseHandler(body, checker) { + return !!ts2.forEachReturnStatement(body, function(statement) { + return isReturnStatementWithFixablePromiseHandler(statement, checker); + }); + } + function isReturnStatementWithFixablePromiseHandler(node, checker) { + return ts2.isReturnStatement(node) && !!node.expression && isFixablePromiseHandler(node.expression, checker); + } + ts2.isReturnStatementWithFixablePromiseHandler = isReturnStatementWithFixablePromiseHandler; + function isFixablePromiseHandler(node, checker) { + if (!isPromiseHandler(node) || !hasSupportedNumberOfArguments(node) || !node.arguments.every(function(arg) { + return isFixablePromiseArgument(arg, checker); + })) { + return false; + } + var currentNode = node.expression.expression; + while (isPromiseHandler(currentNode) || ts2.isPropertyAccessExpression(currentNode)) { + if (ts2.isCallExpression(currentNode)) { + if (!hasSupportedNumberOfArguments(currentNode) || !currentNode.arguments.every(function(arg) { + return isFixablePromiseArgument(arg, checker); + })) { + return false; + } + currentNode = currentNode.expression.expression; + } else { + currentNode = currentNode.expression; + } + } + return true; + } + ts2.isFixablePromiseHandler = isFixablePromiseHandler; + function isPromiseHandler(node) { + return ts2.isCallExpression(node) && (ts2.hasPropertyAccessExpressionWithName(node, "then") || ts2.hasPropertyAccessExpressionWithName(node, "catch") || ts2.hasPropertyAccessExpressionWithName(node, "finally")); + } + function hasSupportedNumberOfArguments(node) { + var name2 = node.expression.name.text; + var maxArguments = name2 === "then" ? 2 : name2 === "catch" ? 1 : name2 === "finally" ? 1 : 0; + if (node.arguments.length > maxArguments) + return false; + if (node.arguments.length < maxArguments) + return true; + return maxArguments === 1 || ts2.some(node.arguments, function(arg) { + return arg.kind === 104 || ts2.isIdentifier(arg) && arg.text === "undefined"; + }); + } + function isFixablePromiseArgument(arg, checker) { + switch (arg.kind) { + case 259: + case 215: + var functionFlags = ts2.getFunctionFlags(arg); + if (functionFlags & 1) { + return false; + } + case 216: + visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); + case 104: + return true; + case 79: + case 208: { + var symbol = checker.getSymbolAtLocation(arg); + if (!symbol) { + return false; + } + return checker.isUndefinedSymbol(symbol) || ts2.some(ts2.skipAlias(symbol, checker).declarations, function(d7) { + return ts2.isFunctionLike(d7) || ts2.hasInitializer(d7) && !!d7.initializer && ts2.isFunctionLike(d7.initializer); + }); + } + default: + return false; + } + } + function getKeyFromNode(exp) { + return "".concat(exp.pos.toString(), ":").concat(exp.end.toString()); + } + function canBeConvertedToClass(node, checker) { + var _a2, _b, _c, _d; + if (node.kind === 215) { + if (ts2.isVariableDeclaration(node.parent) && ((_a2 = node.symbol.members) === null || _a2 === void 0 ? void 0 : _a2.size)) { + return true; + } + var symbol = checker.getSymbolOfExpando( + node, + /*allowDeclaration*/ + false + ); + return !!(symbol && (((_b = symbol.exports) === null || _b === void 0 ? void 0 : _b.size) || ((_c = symbol.members) === null || _c === void 0 ? void 0 : _c.size))); + } + if (node.kind === 259) { + return !!((_d = node.symbol.members) === null || _d === void 0 ? void 0 : _d.size); + } + return false; + } + function canBeConvertedToAsync(node) { + switch (node.kind) { + case 259: + case 171: + case 215: + case 216: + return true; + default: + return false; + } + } + ts2.canBeConvertedToAsync = canBeConvertedToAsync; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var SymbolDisplay; + (function(SymbolDisplay2) { + var symbolDisplayNodeBuilderFlags = 8192 | 70221824 | 16384; + function getSymbolKind(typeChecker, symbol, location2) { + var result2 = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2); + if (result2 !== "") { + return result2; + } + var flags = ts2.getCombinedLocalAndExportSymbolFlags(symbol); + if (flags & 32) { + return ts2.getDeclarationOfKind( + symbol, + 228 + /* SyntaxKind.ClassExpression */ + ) ? "local class" : "class"; + } + if (flags & 384) + return "enum"; + if (flags & 524288) + return "type"; + if (flags & 64) + return "interface"; + if (flags & 262144) + return "type parameter"; + if (flags & 8) + return "enum member"; + if (flags & 2097152) + return "alias"; + if (flags & 1536) + return "module"; + return result2; + } + SymbolDisplay2.getSymbolKind = getSymbolKind; + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2) { + var roots = typeChecker.getRootSymbols(symbol); + if (roots.length === 1 && ts2.first(roots).flags & 8192 && typeChecker.getTypeOfSymbolAtLocation(symbol, location2).getNonNullableType().getCallSignatures().length !== 0) { + return "method"; + } + if (typeChecker.isUndefinedSymbol(symbol)) { + return "var"; + } + if (typeChecker.isArgumentsSymbol(symbol)) { + return "local var"; + } + if (location2.kind === 108 && ts2.isExpression(location2) || ts2.isThisInTypeQuery(location2)) { + return "parameter"; + } + var flags = ts2.getCombinedLocalAndExportSymbolFlags(symbol); + if (flags & 3) { + if (ts2.isFirstDeclarationOfSymbolParameter(symbol)) { + return "parameter"; + } else if (symbol.valueDeclaration && ts2.isVarConst(symbol.valueDeclaration)) { + return "const"; + } else if (ts2.forEach(symbol.declarations, ts2.isLet)) { + return "let"; + } + return isLocalVariableOrFunction(symbol) ? "local var" : "var"; + } + if (flags & 16) + return isLocalVariableOrFunction(symbol) ? "local function" : "function"; + if (flags & 32768) + return "getter"; + if (flags & 65536) + return "setter"; + if (flags & 8192) + return "method"; + if (flags & 16384) + return "constructor"; + if (flags & 131072) + return "index"; + if (flags & 4) { + if (flags & 33554432 && symbol.checkFlags & 6) { + var unionPropertyKind = ts2.forEach(typeChecker.getRootSymbols(symbol), function(rootSymbol) { + var rootSymbolFlags = rootSymbol.getFlags(); + if (rootSymbolFlags & (98308 | 3)) { + return "property"; + } + }); + if (!unionPropertyKind) { + var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location2); + if (typeOfUnionProperty.getCallSignatures().length) { + return "method"; + } + return "property"; + } + return unionPropertyKind; + } + return "property"; + } + return ""; + } + function getNormalizedSymbolModifiers(symbol) { + if (symbol.declarations && symbol.declarations.length) { + var _a2 = symbol.declarations, declaration = _a2[0], declarations = _a2.slice(1); + var excludeFlags = ts2.length(declarations) && ts2.isDeprecatedDeclaration(declaration) && ts2.some(declarations, function(d7) { + return !ts2.isDeprecatedDeclaration(d7); + }) ? 8192 : 0; + var modifiers = ts2.getNodeModifiers(declaration, excludeFlags); + if (modifiers) { + return modifiers.split(","); + } + } + return []; + } + function getSymbolModifiers(typeChecker, symbol) { + if (!symbol) { + return ""; + } + var modifiers = new ts2.Set(getNormalizedSymbolModifiers(symbol)); + if (symbol.flags & 2097152) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol) { + ts2.forEach(getNormalizedSymbolModifiers(resolvedSymbol), function(modifier) { + modifiers.add(modifier); + }); + } + } + if (symbol.flags & 16777216) { + modifiers.add( + "optional" + /* ScriptElementKindModifier.optionalModifier */ + ); + } + return modifiers.size > 0 ? ts2.arrayFrom(modifiers.values()).join(",") : ""; + } + SymbolDisplay2.getSymbolModifiers = getSymbolModifiers; + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location2, semanticMeaning, alias) { + var _a2; + if (semanticMeaning === void 0) { + semanticMeaning = ts2.getMeaningFromLocation(location2); + } + var displayParts = []; + var documentation = []; + var tags6 = []; + var symbolFlags = ts2.getCombinedLocalAndExportSymbolFlags(symbol); + var symbolKind = semanticMeaning & 1 ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2) : ""; + var hasAddedSymbolInfo = false; + var isThisExpression = location2.kind === 108 && ts2.isInExpressionContext(location2) || ts2.isThisInTypeQuery(location2); + var type3; + var printer; + var documentationFromAlias; + var tagsFromAlias; + var hasMultipleSignatures = false; + if (location2.kind === 108 && !isThisExpression) { + return { displayParts: [ts2.keywordPart( + 108 + /* SyntaxKind.ThisKeyword */ + )], documentation: [], symbolKind: "primitive type", tags: void 0 }; + } + if (symbolKind !== "" || symbolFlags & 32 || symbolFlags & 2097152) { + if (symbolKind === "getter" || symbolKind === "setter") { + var declaration = ts2.find(symbol.declarations, function(declaration2) { + return declaration2.name === location2; + }); + if (declaration) { + switch (declaration.kind) { + case 174: + symbolKind = "getter"; + break; + case 175: + symbolKind = "setter"; + break; + case 169: + symbolKind = "accessor"; + break; + default: + ts2.Debug.assertNever(declaration); + } + } else { + symbolKind = "property"; + } + } + var signature = void 0; + type3 = isThisExpression ? typeChecker.getTypeAtLocation(location2) : typeChecker.getTypeOfSymbolAtLocation(symbol, location2); + if (location2.parent && location2.parent.kind === 208) { + var right = location2.parent.name; + if (right === location2 || right && right.getFullWidth() === 0) { + location2 = location2.parent; + } + } + var callExpressionLike = void 0; + if (ts2.isCallOrNewExpression(location2)) { + callExpressionLike = location2; + } else if (ts2.isCallExpressionTarget(location2) || ts2.isNewExpressionTarget(location2)) { + callExpressionLike = location2.parent; + } else if (location2.parent && (ts2.isJsxOpeningLikeElement(location2.parent) || ts2.isTaggedTemplateExpression(location2.parent)) && ts2.isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location2.parent; + } + if (callExpressionLike) { + signature = typeChecker.getResolvedSignature(callExpressionLike); + var useConstructSignatures = callExpressionLike.kind === 211 || ts2.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 106; + var allSignatures = useConstructSignatures ? type3.getConstructSignatures() : type3.getCallSignatures(); + if (signature && !ts2.contains(allSignatures, signature.target) && !ts2.contains(allSignatures, signature)) { + signature = allSignatures.length ? allSignatures[0] : void 0; + } + if (signature) { + if (useConstructSignatures && symbolFlags & 32) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type3.symbol, symbolKind); + } else if (symbolFlags & 2097152) { + symbolKind = "alias"; + pushSymbolKind(symbolKind); + displayParts.push(ts2.spacePart()); + if (useConstructSignatures) { + if (signature.flags & 4) { + displayParts.push(ts2.keywordPart( + 126 + /* SyntaxKind.AbstractKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + displayParts.push(ts2.keywordPart( + 103 + /* SyntaxKind.NewKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + addFullSymbolName(symbol); + } else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute": + case "property": + case "var": + case "const": + case "let": + case "parameter": + case "local var": + displayParts.push(ts2.punctuationPart( + 58 + /* SyntaxKind.ColonToken */ + )); + displayParts.push(ts2.spacePart()); + if (!(ts2.getObjectFlags(type3) & 16) && type3.symbol) { + ts2.addRange(displayParts, ts2.symbolToDisplayParts( + typeChecker, + type3.symbol, + enclosingDeclaration, + /*meaning*/ + void 0, + 4 | 1 + /* SymbolFormatFlags.WriteTypeParametersOrArguments */ + )); + displayParts.push(ts2.lineBreakPart()); + } + if (useConstructSignatures) { + if (signature.flags & 4) { + displayParts.push(ts2.keywordPart( + 126 + /* SyntaxKind.AbstractKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + displayParts.push(ts2.keywordPart( + 103 + /* SyntaxKind.NewKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + addSignatureDisplayParts( + signature, + allSignatures, + 262144 + /* TypeFormatFlags.WriteArrowStyleSignature */ + ); + break; + default: + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + hasMultipleSignatures = allSignatures.length > 1; + } + } else if (ts2.isNameOfFunctionDeclaration(location2) && !(symbolFlags & 98304) || // name of function declaration + location2.kind === 135 && location2.parent.kind === 173) { + var functionDeclaration_1 = location2.parent; + var locationIsSymbolDeclaration = symbol.declarations && ts2.find(symbol.declarations, function(declaration2) { + return declaration2 === (location2.kind === 135 ? functionDeclaration_1.parent : functionDeclaration_1); + }); + if (locationIsSymbolDeclaration) { + var allSignatures = functionDeclaration_1.kind === 173 ? type3.getNonNullableType().getConstructSignatures() : type3.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); + } else { + signature = allSignatures[0]; + } + if (functionDeclaration_1.kind === 173) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type3.symbol, symbolKind); + } else { + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 176 && !(type3.symbol.flags & 2048 || type3.symbol.flags & 4096) ? type3.symbol : symbol, symbolKind); + } + if (signature) { + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + hasMultipleSignatures = allSignatures.length > 1; + } + } + } + if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) { + addAliasPrefixIfNecessary(); + if (ts2.getDeclarationOfKind( + symbol, + 228 + /* SyntaxKind.ClassExpression */ + )) { + pushSymbolKind( + "local class" + /* ScriptElementKind.localClassElement */ + ); + } else { + displayParts.push(ts2.keywordPart( + 84 + /* SyntaxKind.ClassKeyword */ + )); + } + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & 64 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(ts2.keywordPart( + 118 + /* SyntaxKind.InterfaceKeyword */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & 524288 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(ts2.keywordPart( + 154 + /* SyntaxKind.TypeKeyword */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.operatorPart( + 63 + /* SyntaxKind.EqualsToken */ + )); + displayParts.push(ts2.spacePart()); + ts2.addRange(displayParts, ts2.typeToDisplayParts( + typeChecker, + ts2.isConstTypeReference(location2.parent) ? typeChecker.getTypeAtLocation(location2.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), + enclosingDeclaration, + 8388608 + /* TypeFormatFlags.InTypeAlias */ + )); + } + if (symbolFlags & 384) { + prefixNextMeaning(); + if (ts2.some(symbol.declarations, function(d7) { + return ts2.isEnumDeclaration(d7) && ts2.isEnumConst(d7); + })) { + displayParts.push(ts2.keywordPart( + 85 + /* SyntaxKind.ConstKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + displayParts.push(ts2.keywordPart( + 92 + /* SyntaxKind.EnumKeyword */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & 1536 && !isThisExpression) { + prefixNextMeaning(); + var declaration = ts2.getDeclarationOfKind( + symbol, + 264 + /* SyntaxKind.ModuleDeclaration */ + ); + var isNamespace = declaration && declaration.name && declaration.name.kind === 79; + displayParts.push(ts2.keywordPart( + isNamespace ? 143 : 142 + /* SyntaxKind.ModuleKeyword */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & 262144 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )); + displayParts.push(ts2.textPart("type parameter")); + displayParts.push(ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + if (symbol.parent) { + addInPrefix(); + addFullSymbolName(symbol.parent, enclosingDeclaration); + writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); + } else { + var decl = ts2.getDeclarationOfKind( + symbol, + 165 + /* SyntaxKind.TypeParameter */ + ); + if (decl === void 0) + return ts2.Debug.fail(); + var declaration = decl.parent; + if (declaration) { + if (ts2.isFunctionLikeKind(declaration.kind)) { + addInPrefix(); + var signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === 177) { + displayParts.push(ts2.keywordPart( + 103 + /* SyntaxKind.NewKeyword */ + )); + displayParts.push(ts2.spacePart()); + } else if (declaration.kind !== 176 && declaration.name) { + addFullSymbolName(declaration.symbol); + } + ts2.addRange(displayParts, ts2.signatureToDisplayParts( + typeChecker, + signature, + sourceFile, + 32 + /* TypeFormatFlags.WriteTypeArgumentsOfSignature */ + )); + } else if (declaration.kind === 262) { + addInPrefix(); + displayParts.push(ts2.keywordPart( + 154 + /* SyntaxKind.TypeKeyword */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); + } + } + } + } + if (symbolFlags & 8) { + symbolKind = "enum member"; + addPrefixForAnyFunctionOrVar(symbol, "enum member"); + var declaration = (_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]; + if ((declaration === null || declaration === void 0 ? void 0 : declaration.kind) === 302) { + var constantValue = typeChecker.getConstantValue(declaration); + if (constantValue !== void 0) { + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.operatorPart( + 63 + /* SyntaxKind.EqualsToken */ + )); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.displayPart(ts2.getTextOfConstantValue(constantValue), typeof constantValue === "number" ? ts2.SymbolDisplayPartKind.numericLiteral : ts2.SymbolDisplayPartKind.stringLiteral)); + } + } + } + if (symbol.flags & 2097152) { + prefixNextMeaning(); + if (!hasAddedSymbolInfo) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + var resolvedNode = resolvedSymbol.declarations[0]; + var declarationName = ts2.getNameOfDeclaration(resolvedNode); + if (declarationName) { + var isExternalModuleDeclaration = ts2.isModuleWithStringLiteralName(resolvedNode) && ts2.hasSyntacticModifier( + resolvedNode, + 2 + /* ModifierFlags.Ambient */ + ); + var shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts2.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol); + displayParts.push.apply(displayParts, resolvedInfo.displayParts); + displayParts.push(ts2.lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + tagsFromAlias = resolvedInfo.tags; + } else { + documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker); + tagsFromAlias = resolvedSymbol.getJsDocTags(typeChecker); + } + } + } + if (symbol.declarations) { + switch (symbol.declarations[0].kind) { + case 267: + displayParts.push(ts2.keywordPart( + 93 + /* SyntaxKind.ExportKeyword */ + )); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.keywordPart( + 143 + /* SyntaxKind.NamespaceKeyword */ + )); + break; + case 274: + displayParts.push(ts2.keywordPart( + 93 + /* SyntaxKind.ExportKeyword */ + )); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.keywordPart( + symbol.declarations[0].isExportEquals ? 63 : 88 + /* SyntaxKind.DefaultKeyword */ + )); + break; + case 278: + displayParts.push(ts2.keywordPart( + 93 + /* SyntaxKind.ExportKeyword */ + )); + break; + default: + displayParts.push(ts2.keywordPart( + 100 + /* SyntaxKind.ImportKeyword */ + )); + } + } + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol); + ts2.forEach(symbol.declarations, function(declaration2) { + if (declaration2.kind === 268) { + var importEqualsDeclaration = declaration2; + if (ts2.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.operatorPart( + 63 + /* SyntaxKind.EqualsToken */ + )); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.keywordPart( + 147 + /* SyntaxKind.RequireKeyword */ + )); + displayParts.push(ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )); + displayParts.push(ts2.displayPart(ts2.getTextOfNode(ts2.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts2.SymbolDisplayPartKind.stringLiteral)); + displayParts.push(ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } else { + var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + if (internalAliasSymbol) { + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.operatorPart( + 63 + /* SyntaxKind.EqualsToken */ + )); + displayParts.push(ts2.spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } + } + return true; + } + }); + } + if (!hasAddedSymbolInfo) { + if (symbolKind !== "") { + if (type3) { + if (isThisExpression) { + prefixNextMeaning(); + displayParts.push(ts2.keywordPart( + 108 + /* SyntaxKind.ThisKeyword */ + )); + } else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + if (symbolKind === "property" || symbolKind === "accessor" || symbolKind === "getter" || symbolKind === "setter" || symbolKind === "JSX attribute" || symbolFlags & 3 || symbolKind === "local var" || symbolKind === "index" || isThisExpression) { + displayParts.push(ts2.punctuationPart( + 58 + /* SyntaxKind.ColonToken */ + )); + displayParts.push(ts2.spacePart()); + if (type3.symbol && type3.symbol.flags & 262144 && symbolKind !== "index") { + var typeParameterParts = ts2.mapToDisplayParts(function(writer) { + var param = typeChecker.typeParameterToDeclaration(type3, enclosingDeclaration, symbolDisplayNodeBuilderFlags); + getPrinter().writeNode(4, param, ts2.getSourceFileOfNode(ts2.getParseTreeNode(enclosingDeclaration)), writer); + }); + ts2.addRange(displayParts, typeParameterParts); + } else { + ts2.addRange(displayParts, ts2.typeToDisplayParts(typeChecker, type3, enclosingDeclaration)); + } + if (symbol.target && symbol.target.tupleLabelDeclaration) { + var labelDecl = symbol.target.tupleLabelDeclaration; + ts2.Debug.assertNode(labelDecl.name, ts2.isIdentifier); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )); + displayParts.push(ts2.textPart(ts2.idText(labelDecl.name))); + displayParts.push(ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + } else if (symbolFlags & 16 || symbolFlags & 8192 || symbolFlags & 16384 || symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === "method") { + var allSignatures = type3.getNonNullableType().getCallSignatures(); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + hasMultipleSignatures = allSignatures.length > 1; + } + } + } + } else { + symbolKind = getSymbolKind(typeChecker, symbol, location2); + } + } + if (documentation.length === 0 && !hasMultipleSignatures) { + documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); + } + if (documentation.length === 0 && symbolFlags & 4) { + if (symbol.parent && symbol.declarations && ts2.forEach(symbol.parent.declarations, function(declaration2) { + return declaration2.kind === 308; + })) { + for (var _i = 0, _b = symbol.declarations; _i < _b.length; _i++) { + var declaration = _b[_i]; + if (!declaration.parent || declaration.parent.kind !== 223) { + continue; + } + var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); + if (!rhsSymbol) { + continue; + } + documentation = rhsSymbol.getDocumentationComment(typeChecker); + tags6 = rhsSymbol.getJsDocTags(typeChecker); + if (documentation.length > 0) { + break; + } + } + } + } + if (documentation.length === 0 && ts2.isIdentifier(location2) && symbol.valueDeclaration && ts2.isBindingElement(symbol.valueDeclaration)) { + var declaration = symbol.valueDeclaration; + var parent2 = declaration.parent; + if (ts2.isIdentifier(declaration.name) && ts2.isObjectBindingPattern(parent2)) { + var name_4 = ts2.getTextOfIdentifierOrLiteral(declaration.name); + var objectType2 = typeChecker.getTypeAtLocation(parent2); + documentation = ts2.firstDefined(objectType2.isUnion() ? objectType2.types : [objectType2], function(t8) { + var prop = t8.getProperty(name_4); + return prop ? prop.getDocumentationComment(typeChecker) : void 0; + }) || ts2.emptyArray; + } + } + if (tags6.length === 0 && !hasMultipleSignatures) { + tags6 = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker); + } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } + if (tags6.length === 0 && tagsFromAlias) { + tags6 = tagsFromAlias; + } + return { displayParts, documentation, symbolKind, tags: tags6.length === 0 ? void 0 : tags6 }; + function getPrinter() { + if (!printer) { + printer = ts2.createPrinter({ removeComments: true }); + } + return printer; + } + function prefixNextMeaning() { + if (displayParts.length) { + displayParts.push(ts2.lineBreakPart()); + } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushSymbolKind( + "alias" + /* ScriptElementKind.alias */ + ); + displayParts.push(ts2.spacePart()); + } + } + function addInPrefix() { + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.keywordPart( + 101 + /* SyntaxKind.InKeyword */ + )); + displayParts.push(ts2.spacePart()); + } + function addFullSymbolName(symbolToDisplay, enclosingDeclaration2) { + var indexInfos; + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + if (symbolKind === "index") { + indexInfos = typeChecker.getIndexInfosOfIndexSymbol(symbolToDisplay); + } + var fullSymbolDisplayParts = []; + if (symbolToDisplay.flags & 131072 && indexInfos) { + if (symbolToDisplay.parent) { + fullSymbolDisplayParts = ts2.symbolToDisplayParts(typeChecker, symbolToDisplay.parent); + } + fullSymbolDisplayParts.push(ts2.punctuationPart( + 22 + /* SyntaxKind.OpenBracketToken */ + )); + indexInfos.forEach(function(info2, i7) { + fullSymbolDisplayParts.push.apply(fullSymbolDisplayParts, ts2.typeToDisplayParts(typeChecker, info2.keyType)); + if (i7 !== indexInfos.length - 1) { + fullSymbolDisplayParts.push(ts2.spacePart()); + fullSymbolDisplayParts.push(ts2.punctuationPart( + 51 + /* SyntaxKind.BarToken */ + )); + fullSymbolDisplayParts.push(ts2.spacePart()); + } + }); + fullSymbolDisplayParts.push(ts2.punctuationPart( + 23 + /* SyntaxKind.CloseBracketToken */ + )); + } else { + fullSymbolDisplayParts = ts2.symbolToDisplayParts( + typeChecker, + symbolToDisplay, + enclosingDeclaration2 || sourceFile, + /*meaning*/ + void 0, + 1 | 2 | 4 + /* SymbolFormatFlags.AllowAnyNodeKind */ + ); + } + ts2.addRange(displayParts, fullSymbolDisplayParts); + if (symbol.flags & 16777216) { + displayParts.push(ts2.punctuationPart( + 57 + /* SyntaxKind.QuestionToken */ + )); + } + } + function addPrefixForAnyFunctionOrVar(symbol2, symbolKind2) { + prefixNextMeaning(); + if (symbolKind2) { + pushSymbolKind(symbolKind2); + if (symbol2 && !ts2.some(symbol2.declarations, function(d7) { + return ts2.isArrowFunction(d7) || (ts2.isFunctionExpression(d7) || ts2.isClassExpression(d7)) && !d7.name; + })) { + displayParts.push(ts2.spacePart()); + addFullSymbolName(symbol2); + } + } + } + function pushSymbolKind(symbolKind2) { + switch (symbolKind2) { + case "var": + case "function": + case "let": + case "const": + case "constructor": + displayParts.push(ts2.textOrKeywordPart(symbolKind2)); + return; + default: + displayParts.push(ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )); + displayParts.push(ts2.textOrKeywordPart(symbolKind2)); + displayParts.push(ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )); + return; + } + } + function addSignatureDisplayParts(signature2, allSignatures2, flags) { + if (flags === void 0) { + flags = 0; + } + ts2.addRange(displayParts, ts2.signatureToDisplayParts( + typeChecker, + signature2, + enclosingDeclaration, + flags | 32 + /* TypeFormatFlags.WriteTypeArgumentsOfSignature */ + )); + if (allSignatures2.length > 1) { + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.punctuationPart( + 20 + /* SyntaxKind.OpenParenToken */ + )); + displayParts.push(ts2.operatorPart( + 39 + /* SyntaxKind.PlusToken */ + )); + displayParts.push(ts2.displayPart((allSignatures2.length - 1).toString(), ts2.SymbolDisplayPartKind.numericLiteral)); + displayParts.push(ts2.spacePart()); + displayParts.push(ts2.textPart(allSignatures2.length === 2 ? "overload" : "overloads")); + displayParts.push(ts2.punctuationPart( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + documentation = signature2.getDocumentationComment(typeChecker); + tags6 = signature2.getJsDocTags(); + if (allSignatures2.length > 1 && documentation.length === 0 && tags6.length === 0) { + documentation = allSignatures2[0].getDocumentationComment(typeChecker); + tags6 = allSignatures2[0].getJsDocTags().filter(function(tag) { + return tag.name !== "deprecated"; + }); + } + } + function writeTypeParametersOfSymbol(symbol2, enclosingDeclaration2) { + var typeParameterParts2 = ts2.mapToDisplayParts(function(writer) { + var params = typeChecker.symbolToTypeParameterDeclarations(symbol2, enclosingDeclaration2, symbolDisplayNodeBuilderFlags); + getPrinter().writeList(53776, params, ts2.getSourceFileOfNode(ts2.getParseTreeNode(enclosingDeclaration2)), writer); + }); + ts2.addRange(displayParts, typeParameterParts2); + } + } + SymbolDisplay2.getSymbolDisplayPartsDocumentationAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind; + function isLocalVariableOrFunction(symbol) { + if (symbol.parent) { + return false; + } + return ts2.forEach(symbol.declarations, function(declaration) { + if (declaration.kind === 215) { + return true; + } + if (declaration.kind !== 257 && declaration.kind !== 259) { + return false; + } + for (var parent2 = declaration.parent; !ts2.isFunctionBlock(parent2); parent2 = parent2.parent) { + if (parent2.kind === 308 || parent2.kind === 265) { + return false; + } + } + return true; + }); + } + })(SymbolDisplay = ts2.SymbolDisplay || (ts2.SymbolDisplay = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transpileModule(input, transpileOptions) { + var diagnostics = []; + var options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {}; + var defaultOptions9 = ts2.getDefaultCompilerOptions(); + for (var key in defaultOptions9) { + if (ts2.hasProperty(defaultOptions9, key) && options[key] === void 0) { + options[key] = defaultOptions9[key]; + } + } + for (var _i = 0, transpileOptionValueCompilerOptions_1 = ts2.transpileOptionValueCompilerOptions; _i < transpileOptionValueCompilerOptions_1.length; _i++) { + var option = transpileOptionValueCompilerOptions_1[_i]; + options[option.name] = option.transpileOptionValue; + } + options.suppressOutputPathCheck = true; + options.allowNonTsExtensions = true; + var newLine = ts2.getNewLineCharacter(options); + var compilerHost = { + getSourceFile: function(fileName) { + return fileName === ts2.normalizePath(inputFileName) ? sourceFile : void 0; + }, + writeFile: function(name2, text) { + if (ts2.fileExtensionIs(name2, ".map")) { + ts2.Debug.assertEqual(sourceMapText, void 0, "Unexpected multiple source map outputs, file:", name2); + sourceMapText = text; + } else { + ts2.Debug.assertEqual(outputText, void 0, "Unexpected multiple outputs, file:", name2); + outputText = text; + } + }, + getDefaultLibFileName: function() { + return "lib.d.ts"; + }, + useCaseSensitiveFileNames: function() { + return false; + }, + getCanonicalFileName: function(fileName) { + return fileName; + }, + getCurrentDirectory: function() { + return ""; + }, + getNewLine: function() { + return newLine; + }, + fileExists: function(fileName) { + return fileName === inputFileName; + }, + readFile: function() { + return ""; + }, + directoryExists: function() { + return true; + }, + getDirectories: function() { + return []; + } + }; + var inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts"); + var sourceFile = ts2.createSourceFile(inputFileName, input, { + languageVersion: ts2.getEmitScriptTarget(options), + impliedNodeFormat: ts2.getImpliedNodeFormatForFile( + ts2.toPath(inputFileName, "", compilerHost.getCanonicalFileName), + /*cache*/ + void 0, + compilerHost, + options + ), + setExternalModuleIndicator: ts2.getSetExternalModuleIndicator(options) + }); + if (transpileOptions.moduleName) { + sourceFile.moduleName = transpileOptions.moduleName; + } + if (transpileOptions.renamedDependencies) { + sourceFile.renamedDependencies = new ts2.Map(ts2.getEntries(transpileOptions.renamedDependencies)); + } + var outputText; + var sourceMapText; + var program = ts2.createProgram([inputFileName], options, compilerHost); + if (transpileOptions.reportDiagnostics) { + ts2.addRange( + /*to*/ + diagnostics, + /*from*/ + program.getSyntacticDiagnostics(sourceFile) + ); + ts2.addRange( + /*to*/ + diagnostics, + /*from*/ + program.getOptionsDiagnostics() + ); + } + program.emit( + /*targetSourceFile*/ + void 0, + /*writeFile*/ + void 0, + /*cancellationToken*/ + void 0, + /*emitOnlyDtsFiles*/ + void 0, + transpileOptions.transformers + ); + if (outputText === void 0) + return ts2.Debug.fail("Output generation failed"); + return { outputText, diagnostics, sourceMapText }; + } + ts2.transpileModule = transpileModule; + function transpile(input, compilerOptions, fileName, diagnostics, moduleName3) { + var output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName: moduleName3 }); + ts2.addRange(diagnostics, output.diagnostics); + return output.outputText; + } + ts2.transpile = transpile; + var commandLineOptionsStringToEnum; + function fixupCompilerOptions(options, diagnostics) { + commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || ts2.filter(ts2.optionDeclarations, function(o7) { + return typeof o7.type === "object" && !ts2.forEachEntry(o7.type, function(v8) { + return typeof v8 !== "number"; + }); + }); + options = ts2.cloneCompilerOptions(options); + var _loop_8 = function(opt2) { + if (!ts2.hasProperty(options, opt2.name)) { + return "continue"; + } + var value2 = options[opt2.name]; + if (ts2.isString(value2)) { + options[opt2.name] = ts2.parseCustomTypeOption(opt2, value2, diagnostics); + } else { + if (!ts2.forEachEntry(opt2.type, function(v8) { + return v8 === value2; + })) { + diagnostics.push(ts2.createCompilerDiagnosticForInvalidCustomType(opt2)); + } + } + }; + for (var _i = 0, commandLineOptionsStringToEnum_1 = commandLineOptionsStringToEnum; _i < commandLineOptionsStringToEnum_1.length; _i++) { + var opt = commandLineOptionsStringToEnum_1[_i]; + _loop_8(opt); + } + return options; + } + ts2.fixupCompilerOptions = fixupCompilerOptions; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + var FormattingRequestKind; + (function(FormattingRequestKind2) { + FormattingRequestKind2[FormattingRequestKind2["FormatDocument"] = 0] = "FormatDocument"; + FormattingRequestKind2[FormattingRequestKind2["FormatSelection"] = 1] = "FormatSelection"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnEnter"] = 2] = "FormatOnEnter"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnOpeningCurlyBrace"] = 4] = "FormatOnOpeningCurlyBrace"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnClosingCurlyBrace"] = 5] = "FormatOnClosingCurlyBrace"; + })(FormattingRequestKind = formatting2.FormattingRequestKind || (formatting2.FormattingRequestKind = {})); + var FormattingContext = ( + /** @class */ + function() { + function FormattingContext2(sourceFile, formattingRequestKind, options) { + this.sourceFile = sourceFile; + this.formattingRequestKind = formattingRequestKind; + this.options = options; + } + FormattingContext2.prototype.updateContext = function(currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { + this.currentTokenSpan = ts2.Debug.checkDefined(currentRange); + this.currentTokenParent = ts2.Debug.checkDefined(currentTokenParent); + this.nextTokenSpan = ts2.Debug.checkDefined(nextRange); + this.nextTokenParent = ts2.Debug.checkDefined(nextTokenParent); + this.contextNode = ts2.Debug.checkDefined(commonParent); + this.contextNodeAllOnSameLine = void 0; + this.nextNodeAllOnSameLine = void 0; + this.tokensAreOnSameLine = void 0; + this.contextNodeBlockIsOnOneLine = void 0; + this.nextNodeBlockIsOnOneLine = void 0; + }; + FormattingContext2.prototype.ContextNodeAllOnSameLine = function() { + if (this.contextNodeAllOnSameLine === void 0) { + this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); + } + return this.contextNodeAllOnSameLine; + }; + FormattingContext2.prototype.NextNodeAllOnSameLine = function() { + if (this.nextNodeAllOnSameLine === void 0) { + this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeAllOnSameLine; + }; + FormattingContext2.prototype.TokensAreOnSameLine = function() { + if (this.tokensAreOnSameLine === void 0) { + var startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; + var endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; + this.tokensAreOnSameLine = startLine === endLine; + } + return this.tokensAreOnSameLine; + }; + FormattingContext2.prototype.ContextNodeBlockIsOnOneLine = function() { + if (this.contextNodeBlockIsOnOneLine === void 0) { + this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); + } + return this.contextNodeBlockIsOnOneLine; + }; + FormattingContext2.prototype.NextNodeBlockIsOnOneLine = function() { + if (this.nextNodeBlockIsOnOneLine === void 0) { + this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeBlockIsOnOneLine; + }; + FormattingContext2.prototype.NodeIsOnOneLine = function(node) { + var startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; + var endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; + return startLine === endLine; + }; + FormattingContext2.prototype.BlockIsOnOneLine = function(node) { + var openBrace = ts2.findChildOfKind(node, 18, this.sourceFile); + var closeBrace = ts2.findChildOfKind(node, 19, this.sourceFile); + if (openBrace && closeBrace) { + var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; + var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; + }; + return FormattingContext2; + }() + ); + formatting2.FormattingContext = FormattingContext; + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + var standardScanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false, + 0 + /* LanguageVariant.Standard */ + ); + var jsxScanner = ts2.createScanner( + 99, + /*skipTrivia*/ + false, + 1 + /* LanguageVariant.JSX */ + ); + var ScanAction; + (function(ScanAction2) { + ScanAction2[ScanAction2["Scan"] = 0] = "Scan"; + ScanAction2[ScanAction2["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken"; + ScanAction2[ScanAction2["RescanSlashToken"] = 2] = "RescanSlashToken"; + ScanAction2[ScanAction2["RescanTemplateToken"] = 3] = "RescanTemplateToken"; + ScanAction2[ScanAction2["RescanJsxIdentifier"] = 4] = "RescanJsxIdentifier"; + ScanAction2[ScanAction2["RescanJsxText"] = 5] = "RescanJsxText"; + ScanAction2[ScanAction2["RescanJsxAttributeValue"] = 6] = "RescanJsxAttributeValue"; + })(ScanAction || (ScanAction = {})); + function getFormattingScanner(text, languageVariant, startPos, endPos, cb) { + var scanner = languageVariant === 1 ? jsxScanner : standardScanner; + scanner.setText(text); + scanner.setTextPos(startPos); + var wasNewLine = true; + var leadingTrivia; + var trailingTrivia; + var savedPos; + var lastScanAction; + var lastTokenInfo; + var res = cb({ + advance, + readTokenInfo, + readEOFTokenRange, + isOnToken, + isOnEOF, + getCurrentLeadingTrivia: function() { + return leadingTrivia; + }, + lastTrailingTriviaWasNewLine: function() { + return wasNewLine; + }, + skipToEndOf, + skipToStartOf, + getStartPos: function() { + var _a2; + return (_a2 = lastTokenInfo === null || lastTokenInfo === void 0 ? void 0 : lastTokenInfo.token.pos) !== null && _a2 !== void 0 ? _a2 : scanner.getTokenPos(); + } + }); + lastTokenInfo = void 0; + scanner.setText(void 0); + return res; + function advance() { + lastTokenInfo = void 0; + var isStarted = scanner.getStartPos() !== startPos; + if (isStarted) { + wasNewLine = !!trailingTrivia && ts2.last(trailingTrivia).kind === 4; + } else { + scanner.scan(); + } + leadingTrivia = void 0; + trailingTrivia = void 0; + var pos = scanner.getStartPos(); + while (pos < endPos) { + var t8 = scanner.getToken(); + if (!ts2.isTrivia(t8)) { + break; + } + scanner.scan(); + var item = { + pos, + end: scanner.getStartPos(), + kind: t8 + }; + pos = scanner.getStartPos(); + leadingTrivia = ts2.append(leadingTrivia, item); + } + savedPos = scanner.getStartPos(); + } + function shouldRescanGreaterThanToken(node) { + switch (node.kind) { + case 33: + case 71: + case 72: + case 49: + case 48: + return true; + } + return false; + } + function shouldRescanJsxIdentifier(node) { + if (node.parent) { + switch (node.parent.kind) { + case 288: + case 283: + case 284: + case 282: + return ts2.isKeyword(node.kind) || node.kind === 79; + } + } + return false; + } + function shouldRescanJsxText(node) { + return ts2.isJsxText(node) || ts2.isJsxElement(node) && (lastTokenInfo === null || lastTokenInfo === void 0 ? void 0 : lastTokenInfo.token.kind) === 11; + } + function shouldRescanSlashToken(container) { + return container.kind === 13; + } + function shouldRescanTemplateToken(container) { + return container.kind === 16 || container.kind === 17; + } + function shouldRescanJsxAttributeValue(node) { + return node.parent && ts2.isJsxAttribute(node.parent) && node.parent.initializer === node; + } + function startsWithSlashToken(t8) { + return t8 === 43 || t8 === 68; + } + function readTokenInfo(n7) { + ts2.Debug.assert(isOnToken()); + var expectedScanAction = shouldRescanGreaterThanToken(n7) ? 1 : shouldRescanSlashToken(n7) ? 2 : shouldRescanTemplateToken(n7) ? 3 : shouldRescanJsxIdentifier(n7) ? 4 : shouldRescanJsxText(n7) ? 5 : shouldRescanJsxAttributeValue(n7) ? 6 : 0; + if (lastTokenInfo && expectedScanAction === lastScanAction) { + return fixTokenKind(lastTokenInfo, n7); + } + if (scanner.getStartPos() !== savedPos) { + ts2.Debug.assert(lastTokenInfo !== void 0); + scanner.setTextPos(savedPos); + scanner.scan(); + } + var currentToken = getNextToken(n7, expectedScanAction); + var token = formatting2.createTextRangeWithKind(scanner.getStartPos(), scanner.getTextPos(), currentToken); + if (trailingTrivia) { + trailingTrivia = void 0; + } + while (scanner.getStartPos() < endPos) { + currentToken = scanner.scan(); + if (!ts2.isTrivia(currentToken)) { + break; + } + var trivia = formatting2.createTextRangeWithKind(scanner.getStartPos(), scanner.getTextPos(), currentToken); + if (!trailingTrivia) { + trailingTrivia = []; + } + trailingTrivia.push(trivia); + if (currentToken === 4) { + scanner.scan(); + break; + } + } + lastTokenInfo = { leadingTrivia, trailingTrivia, token }; + return fixTokenKind(lastTokenInfo, n7); + } + function getNextToken(n7, expectedScanAction) { + var token = scanner.getToken(); + lastScanAction = 0; + switch (expectedScanAction) { + case 1: + if (token === 31) { + lastScanAction = 1; + var newToken = scanner.reScanGreaterToken(); + ts2.Debug.assert(n7.kind === newToken); + return newToken; + } + break; + case 2: + if (startsWithSlashToken(token)) { + lastScanAction = 2; + var newToken = scanner.reScanSlashToken(); + ts2.Debug.assert(n7.kind === newToken); + return newToken; + } + break; + case 3: + if (token === 19) { + lastScanAction = 3; + return scanner.reScanTemplateToken( + /* isTaggedTemplate */ + false + ); + } + break; + case 4: + lastScanAction = 4; + return scanner.scanJsxIdentifier(); + case 5: + lastScanAction = 5; + return scanner.reScanJsxToken( + /* allowMultilineJsxText */ + false + ); + case 6: + lastScanAction = 6; + return scanner.reScanJsxAttributeValue(); + case 0: + break; + default: + ts2.Debug.assertNever(expectedScanAction); + } + return token; + } + function readEOFTokenRange() { + ts2.Debug.assert(isOnEOF()); + return formatting2.createTextRangeWithKind( + scanner.getStartPos(), + scanner.getTextPos(), + 1 + /* SyntaxKind.EndOfFileToken */ + ); + } + function isOnToken() { + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + return current !== 1 && !ts2.isTrivia(current); + } + function isOnEOF() { + var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken(); + return current === 1; + } + function fixTokenKind(tokenInfo, container) { + if (ts2.isToken(container) && tokenInfo.token.kind !== container.kind) { + tokenInfo.token.kind = container.kind; + } + return tokenInfo; + } + function skipToEndOf(node) { + scanner.setTextPos(node.end); + savedPos = scanner.getStartPos(); + lastScanAction = void 0; + lastTokenInfo = void 0; + wasNewLine = false; + leadingTrivia = void 0; + trailingTrivia = void 0; + } + function skipToStartOf(node) { + scanner.setTextPos(node.pos); + savedPos = scanner.getStartPos(); + lastScanAction = void 0; + lastTokenInfo = void 0; + wasNewLine = false; + leadingTrivia = void 0; + trailingTrivia = void 0; + } + } + formatting2.getFormattingScanner = getFormattingScanner; + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + formatting2.anyContext = ts2.emptyArray; + var RuleAction; + (function(RuleAction2) { + RuleAction2[RuleAction2["StopProcessingSpaceActions"] = 1] = "StopProcessingSpaceActions"; + RuleAction2[RuleAction2["StopProcessingTokenActions"] = 2] = "StopProcessingTokenActions"; + RuleAction2[RuleAction2["InsertSpace"] = 4] = "InsertSpace"; + RuleAction2[RuleAction2["InsertNewLine"] = 8] = "InsertNewLine"; + RuleAction2[RuleAction2["DeleteSpace"] = 16] = "DeleteSpace"; + RuleAction2[RuleAction2["DeleteToken"] = 32] = "DeleteToken"; + RuleAction2[RuleAction2["InsertTrailingSemicolon"] = 64] = "InsertTrailingSemicolon"; + RuleAction2[RuleAction2["StopAction"] = 3] = "StopAction"; + RuleAction2[RuleAction2["ModifySpaceAction"] = 28] = "ModifySpaceAction"; + RuleAction2[RuleAction2["ModifyTokenAction"] = 96] = "ModifyTokenAction"; + })(RuleAction = formatting2.RuleAction || (formatting2.RuleAction = {})); + var RuleFlags; + (function(RuleFlags2) { + RuleFlags2[RuleFlags2["None"] = 0] = "None"; + RuleFlags2[RuleFlags2["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; + })(RuleFlags = formatting2.RuleFlags || (formatting2.RuleFlags = {})); + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + function getAllRules() { + var allTokens = []; + for (var token = 0; token <= 162; token++) { + if (token !== 1) { + allTokens.push(token); + } + } + function anyTokenExcept() { + var tokens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tokens[_i] = arguments[_i]; + } + return { tokens: allTokens.filter(function(t8) { + return !tokens.some(function(t22) { + return t22 === t8; + }); + }), isSpecific: false }; + } + var anyToken = { tokens: allTokens, isSpecific: false }; + var anyTokenIncludingMultilineComments = tokenRangeFrom(__spreadArray9(__spreadArray9([], allTokens, true), [ + 3 + /* SyntaxKind.MultiLineCommentTrivia */ + ], false)); + var anyTokenIncludingEOF = tokenRangeFrom(__spreadArray9(__spreadArray9([], allTokens, true), [ + 1 + /* SyntaxKind.EndOfFileToken */ + ], false)); + var keywords = tokenRangeFromRange( + 81, + 162 + /* SyntaxKind.LastKeyword */ + ); + var binaryOperators = tokenRangeFromRange( + 29, + 78 + /* SyntaxKind.LastBinaryOperator */ + ); + var binaryKeywordOperators = [ + 101, + 102, + 162, + 128, + 140 + /* SyntaxKind.IsKeyword */ + ]; + var unaryPrefixOperators = [ + 45, + 46, + 54, + 53 + /* SyntaxKind.ExclamationToken */ + ]; + var unaryPrefixExpressions = [ + 8, + 9, + 79, + 20, + 22, + 18, + 108, + 103 + /* SyntaxKind.NewKeyword */ + ]; + var unaryPreincrementExpressions = [ + 79, + 20, + 108, + 103 + /* SyntaxKind.NewKeyword */ + ]; + var unaryPostincrementExpressions = [ + 79, + 21, + 23, + 103 + /* SyntaxKind.NewKeyword */ + ]; + var unaryPredecrementExpressions = [ + 79, + 20, + 108, + 103 + /* SyntaxKind.NewKeyword */ + ]; + var unaryPostdecrementExpressions = [ + 79, + 21, + 23, + 103 + /* SyntaxKind.NewKeyword */ + ]; + var comments = [ + 2, + 3 + /* SyntaxKind.MultiLineCommentTrivia */ + ]; + var typeNames = __spreadArray9([ + 79 + /* SyntaxKind.Identifier */ + ], ts2.typeKeywords, true); + var functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments; + var typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([ + 79, + 3, + 84, + 93, + 100 + /* SyntaxKind.ImportKeyword */ + ]); + var controlOpenBraceLeftTokenRange = tokenRangeFrom([ + 21, + 3, + 90, + 111, + 96, + 91 + /* SyntaxKind.ElseKeyword */ + ]); + var highPriorityCommonRules = [ + // Leave comments alone + rule( + "IgnoreBeforeComment", + anyToken, + comments, + formatting2.anyContext, + 1 + /* RuleAction.StopProcessingSpaceActions */ + ), + rule( + "IgnoreAfterLineComment", + 2, + anyToken, + formatting2.anyContext, + 1 + /* RuleAction.StopProcessingSpaceActions */ + ), + rule( + "NotSpaceBeforeColon", + anyToken, + 58, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceAfterColon", + 58, + anyToken, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeQuestionMark", + anyToken, + 57, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // insert space after '?' only when it is used in conditional operator + rule( + "SpaceAfterQuestionMarkInConditionalOperator", + 57, + anyToken, + [isNonJsxSameLineTokenContext, isConditionalOperatorContext], + 4 + /* RuleAction.InsertSpace */ + ), + // in other cases there should be no space between '?' and next token + rule( + "NoSpaceAfterQuestionMark", + 57, + anyToken, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeDot", + anyToken, + [ + 24, + 28 + /* SyntaxKind.QuestionDotToken */ + ], + [isNonJsxSameLineTokenContext, isNotPropertyAccessOnIntegerLiteral], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterDot", + [ + 24, + 28 + /* SyntaxKind.QuestionDotToken */ + ], + anyToken, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBetweenImportParenInImportType", + 100, + 20, + [isNonJsxSameLineTokenContext, isImportTypeContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Special handling of unary operators. + // Prefix operators generally shouldn't have a space between + // them and their target unary expression. + rule( + "NoSpaceAfterUnaryPrefixOperator", + unaryPrefixOperators, + unaryPrefixExpressions, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterUnaryPreincrementOperator", + 45, + unaryPreincrementExpressions, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterUnaryPredecrementOperator", + 46, + unaryPredecrementExpressions, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeUnaryPostincrementOperator", + unaryPostincrementExpressions, + 45, + [isNonJsxSameLineTokenContext, isNotStatementConditionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeUnaryPostdecrementOperator", + unaryPostdecrementExpressions, + 46, + [isNonJsxSameLineTokenContext, isNotStatementConditionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // More unary operator special-casing. + // DevDiv 181814: Be careful when removing leading whitespace + // around unary operators. Examples: + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b + rule( + "SpaceAfterPostincrementWhenFollowedByAdd", + 45, + 39, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterAddWhenFollowedByUnaryPlus", + 39, + 39, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterAddWhenFollowedByPreincrement", + 39, + 45, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterPostdecrementWhenFollowedBySubtract", + 46, + 40, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterSubtractWhenFollowedByUnaryMinus", + 40, + 40, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterSubtractWhenFollowedByPredecrement", + 40, + 46, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterCloseBrace", + 19, + [ + 27, + 26 + /* SyntaxKind.SemicolonToken */ + ], + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // For functions and control block place } on a new line [multi-line rule] + rule( + "NewLineBeforeCloseBraceInBlockContext", + anyTokenIncludingMultilineComments, + 19, + [isMultilineBlockContext], + 8 + /* RuleAction.InsertNewLine */ + ), + // Space/new line after }. + rule( + "SpaceAfterCloseBrace", + 19, + anyTokenExcept( + 21 + /* SyntaxKind.CloseParenToken */ + ), + [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied + // Also should not apply to }) + rule( + "SpaceBetweenCloseBraceAndElse", + 19, + 91, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBetweenCloseBraceAndWhile", + 19, + 115, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 18, + 19, + [isNonJsxSameLineTokenContext, isObjectContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule( + "SpaceAfterConditionalClosingParen", + 21, + 22, + [isControlDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenFunctionKeywordAndStar", + 98, + 41, + [isFunctionDeclarationOrFunctionExpressionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceAfterStarInGeneratorDeclaration", + 41, + 79, + [isFunctionDeclarationOrFunctionExpressionContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterFunctionInFuncDecl", + 98, + anyToken, + [isFunctionDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Insert new line after { and before } in multi-line contexts. + rule( + "NewLineAfterOpenBraceInBlockContext", + 18, + anyToken, + [isMultilineBlockContext], + 8 + /* RuleAction.InsertNewLine */ + ), + // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token. + // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: + // get x() {} + // set x(val) {} + rule( + "SpaceAfterGetSetInMember", + [ + 137, + 151 + /* SyntaxKind.SetKeyword */ + ], + 79, + [isFunctionDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenYieldKeywordAndStar", + 125, + 41, + [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceBetweenYieldOrYieldStarAndOperand", + [ + 125, + 41 + /* SyntaxKind.AsteriskToken */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenReturnAndSemicolon", + 105, + 26, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceAfterCertainKeywords", + [ + 113, + 109, + 103, + 89, + 105, + 112, + 133 + /* SyntaxKind.AwaitKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterLetConstInVariableDeclaration", + [ + 119, + 85 + /* SyntaxKind.ConstKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeOpenParenInFuncCall", + anyToken, + 20, + [isNonJsxSameLineTokenContext, isFunctionCallOrNewContext, isPreviousTokenNotComma], + 16 + /* RuleAction.DeleteSpace */ + ), + // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. + rule( + "SpaceBeforeBinaryKeywordOperator", + anyToken, + binaryKeywordOperators, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterBinaryKeywordOperator", + binaryKeywordOperators, + anyToken, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterVoidOperator", + 114, + anyToken, + [isNonJsxSameLineTokenContext, isVoidOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Async-await + rule( + "SpaceBetweenAsyncAndOpenParen", + 132, + 20, + [isArrowFunctionContext, isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBetweenAsyncAndFunctionKeyword", + 132, + [ + 98, + 79 + /* SyntaxKind.Identifier */ + ], + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Template string + rule( + "NoSpaceBetweenTagAndTemplateString", + [ + 79, + 21 + /* SyntaxKind.CloseParenToken */ + ], + [ + 14, + 15 + /* SyntaxKind.TemplateHead */ + ], + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // JSX opening elements + rule( + "SpaceBeforeJsxAttribute", + anyToken, + 79, + [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeSlashInJsxOpeningElement", + anyToken, + 43, + [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeGreaterThanTokenInJsxOpeningElement", + 43, + 31, + [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeEqualInJsxAttribute", + anyToken, + 63, + [isJsxAttributeContext, isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterEqualInJsxAttribute", + 63, + anyToken, + [isJsxAttributeContext, isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // TypeScript-specific rules + // Use of module as a function call. e.g.: import m2 = module("m2"); + rule( + "NoSpaceAfterModuleImport", + [ + 142, + 147 + /* SyntaxKind.RequireKeyword */ + ], + 20, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Add a space around certain TypeScript keywords + rule( + "SpaceAfterCertainTypeScriptKeywords", + [ + 126, + 127, + 84, + 136, + 88, + 92, + 93, + 94, + 137, + 117, + 100, + 118, + 142, + 143, + 121, + 123, + 122, + 146, + 151, + 124, + 154, + 158, + 141, + 138 + ], + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeCertainTypeScriptKeywords", + anyToken, + [ + 94, + 117, + 158 + /* SyntaxKind.FromKeyword */ + ], + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { + rule( + "SpaceAfterModuleName", + 10, + 18, + [isModuleDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Lambda expressions + rule( + "SpaceBeforeArrow", + anyToken, + 38, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterArrow", + 38, + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Optional parameters and let args + rule( + "NoSpaceAfterEllipsis", + 25, + 79, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterOptionalParameters", + 57, + [ + 21, + 27 + /* SyntaxKind.CommaToken */ + ], + [isNonJsxSameLineTokenContext, isNotBinaryOpContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Remove spaces in empty interface literals. e.g.: x: {} + rule( + "NoSpaceBetweenEmptyInterfaceBraceBrackets", + 18, + 19, + [isNonJsxSameLineTokenContext, isObjectTypeContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // generics and type assertions + rule( + "NoSpaceBeforeOpenAngularBracket", + typeNames, + 29, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBetweenCloseParenAndAngularBracket", + 21, + 29, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenAngularBracket", + 29, + anyToken, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseAngularBracket", + anyToken, + 31, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterCloseAngularBracket", + 31, + [ + 20, + 22, + 31, + 27 + /* SyntaxKind.CommaToken */ + ], + [ + isNonJsxSameLineTokenContext, + isTypeArgumentOrParameterOrAssertionContext, + isNotFunctionDeclContext + /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ + ], + 16 + /* RuleAction.DeleteSpace */ + ), + // decorators + rule( + "SpaceBeforeAt", + [ + 21, + 79 + /* SyntaxKind.Identifier */ + ], + 59, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterAt", + 59, + anyToken, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after @ in decorator + rule( + "SpaceAfterDecorator", + anyToken, + [ + 126, + 79, + 93, + 88, + 84, + 124, + 123, + 121, + 122, + 137, + 151, + 22, + 41 + ], + [isEndOfDecoratorContextOnSameLine], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeNonNullAssertionOperator", + anyToken, + 53, + [isNonJsxSameLineTokenContext, isNonNullAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterNewKeywordOnConstructorSignature", + 103, + 20, + [isNonJsxSameLineTokenContext, isConstructorSignatureContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceLessThanAndNonJSXTypeAnnotation", + 29, + 29, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ) + ]; + var userConfigurableRules = [ + // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + rule( + "SpaceAfterConstructor", + 135, + 20, + [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterConstructor", + 135, + 20, + [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceAfterComma", + 27, + anyToken, + [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterComma", + 27, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after function keyword for anonymous functions + rule( + "SpaceAfterAnonymousFunctionKeyword", + [ + 98, + 41 + /* SyntaxKind.AsteriskToken */ + ], + 20, + [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterAnonymousFunctionKeyword", + [ + 98, + 41 + /* SyntaxKind.AsteriskToken */ + ], + 20, + [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after keywords in control flow statements + rule( + "SpaceAfterKeywordInControl", + keywords, + 20, + [isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterKeywordInControl", + keywords, + 20, + [isOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after opening and before closing nonempty parenthesis + rule( + "SpaceAfterOpenParen", + 20, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeCloseParen", + anyToken, + 21, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBetweenOpenParens", + 20, + 20, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenParens", + 20, + 21, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenParen", + 20, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseParen", + anyToken, + 21, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after opening and before closing nonempty brackets + rule( + "SpaceAfterOpenBracket", + 22, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeCloseBracket", + anyToken, + 23, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenBrackets", + 22, + 23, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenBracket", + 22, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBracket", + anyToken, + 23, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. + rule( + "SpaceAfterOpenBrace", + 18, + anyToken, + [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeCloseBrace", + anyToken, + 19, + [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 18, + 19, + [isNonJsxSameLineTokenContext, isObjectContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenBrace", + 18, + anyToken, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBrace", + anyToken, + 19, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert a space after opening and before closing empty brace brackets + rule( + "SpaceBetweenEmptyBraceBrackets", + 18, + 19, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 18, + 19, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after opening and before closing template string braces + rule( + "SpaceAfterTemplateHeadAndMiddle", + [ + 15, + 16 + /* SyntaxKind.TemplateMiddle */ + ], + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], + 4, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "SpaceBeforeTemplateMiddleAndTail", + anyToken, + [ + 16, + 17 + /* SyntaxKind.TemplateTail */ + ], + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterTemplateHeadAndMiddle", + [ + 15, + 16 + /* SyntaxKind.TemplateMiddle */ + ], + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], + 16, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "NoSpaceBeforeTemplateMiddleAndTail", + anyToken, + [ + 16, + 17 + /* SyntaxKind.TemplateTail */ + ], + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // No space after { and before } in JSX expression + rule( + "SpaceAfterOpenBraceInJsxExpression", + 18, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceBeforeCloseBraceInJsxExpression", + anyToken, + 19, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterOpenBraceInJsxExpression", + 18, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBraceInJsxExpression", + anyToken, + 19, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space after semicolon in for statement + rule( + "SpaceAfterSemicolonInFor", + 26, + anyToken, + [isOptionEnabled("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterSemicolonInFor", + 26, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Insert space before and after binary operators + rule( + "SpaceBeforeBinaryOperator", + anyToken, + binaryOperators, + [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "SpaceAfterBinaryOperator", + binaryOperators, + anyToken, + [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeBinaryOperator", + anyToken, + binaryOperators, + [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterBinaryOperator", + binaryOperators, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceBeforeOpenParenInFuncDecl", + anyToken, + 20, + [isOptionEnabled("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeOpenParenInFuncDecl", + anyToken, + 20, + [isOptionDisabledOrUndefined("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // Open Brace braces after control block + rule( + "NewLineBeforeOpenBraceInControl", + controlOpenBraceLeftTokenRange, + 18, + [isOptionEnabled("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isBeforeMultilineBlockContext], + 8, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + // Open Brace braces after function + // TypeScript: Function can have return types, which can be made of tons of different token kinds + rule( + "NewLineBeforeOpenBraceInFunction", + functionOpenBraceLeftTokenRange, + 18, + [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeMultilineBlockContext], + 8, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + // Open Brace braces after TypeScript module/class/interface + rule( + "NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", + typeScriptOpenBraceLeftTokenRange, + 18, + [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], + 8, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "SpaceAfterTypeAssertion", + 31, + anyToken, + [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceAfterTypeAssertion", + 31, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceBeforeTypeAnnotation", + anyToken, + [ + 57, + 58 + /* SyntaxKind.ColonToken */ + ], + [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], + 4 + /* RuleAction.InsertSpace */ + ), + rule( + "NoSpaceBeforeTypeAnnotation", + anyToken, + [ + 57, + 58 + /* SyntaxKind.ColonToken */ + ], + [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoOptionalSemicolon", + 26, + anyTokenIncludingEOF, + [optionEquals("semicolons", ts2.SemicolonPreference.Remove), isSemicolonDeletionContext], + 32 + /* RuleAction.DeleteToken */ + ), + rule( + "OptionalSemicolon", + anyToken, + anyTokenIncludingEOF, + [optionEquals("semicolons", ts2.SemicolonPreference.Insert), isSemicolonInsertionContext], + 64 + /* RuleAction.InsertTrailingSemicolon */ + ) + ]; + var lowPriorityCommonRules = [ + // Space after keyword but not before ; or : or ? + rule( + "NoSpaceBeforeSemicolon", + anyToken, + 26, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceBeforeOpenBraceInControl", + controlOpenBraceLeftTokenRange, + 18, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "SpaceBeforeOpenBraceInFunction", + functionOpenBraceLeftTokenRange, + 18, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", + typeScriptOpenBraceLeftTokenRange, + 18, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* RuleFlags.CanDeleteNewLines */ + ), + rule( + "NoSpaceBeforeComma", + anyToken, + 27, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + // No space before and after indexer `x[]` + rule( + "NoSpaceBeforeOpenBracket", + anyTokenExcept( + 132, + 82 + /* SyntaxKind.CaseKeyword */ + ), + 22, + [isNonJsxSameLineTokenContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "NoSpaceAfterCloseBracket", + 23, + anyToken, + [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], + 16 + /* RuleAction.DeleteSpace */ + ), + rule( + "SpaceAfterSemicolon", + 26, + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Remove extra space between for and await + rule( + "SpaceBetweenForAndAwaitKeyword", + 97, + 133, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ), + // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. + // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] + rule( + "SpaceBetweenStatements", + [ + 21, + 90, + 91, + 82 + /* SyntaxKind.CaseKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], + 4 + /* RuleAction.InsertSpace */ + ), + // This low-pri rule takes care of "try {", "catch {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. + rule( + "SpaceAfterTryCatchFinally", + [ + 111, + 83, + 96 + /* SyntaxKind.FinallyKeyword */ + ], + 18, + [isNonJsxSameLineTokenContext], + 4 + /* RuleAction.InsertSpace */ + ) + ]; + return __spreadArray9(__spreadArray9(__spreadArray9([], highPriorityCommonRules, true), userConfigurableRules, true), lowPriorityCommonRules, true); + } + formatting2.getAllRules = getAllRules; + function rule(debugName, left, right, context2, action, flags) { + if (flags === void 0) { + flags = 0; + } + return { leftTokenRange: toTokenRange(left), rightTokenRange: toTokenRange(right), rule: { debugName, context: context2, action, flags } }; + } + function tokenRangeFrom(tokens) { + return { tokens, isSpecific: true }; + } + function toTokenRange(arg) { + return typeof arg === "number" ? tokenRangeFrom([arg]) : ts2.isArray(arg) ? tokenRangeFrom(arg) : arg; + } + function tokenRangeFromRange(from, to, except) { + if (except === void 0) { + except = []; + } + var tokens = []; + for (var token = from; token <= to; token++) { + if (!ts2.contains(except, token)) { + tokens.push(token); + } + } + return tokenRangeFrom(tokens); + } + function optionEquals(optionName, optionValue) { + return function(context2) { + return context2.options && context2.options[optionName] === optionValue; + }; + } + function isOptionEnabled(optionName) { + return function(context2) { + return context2.options && ts2.hasProperty(context2.options, optionName) && !!context2.options[optionName]; + }; + } + function isOptionDisabled(optionName) { + return function(context2) { + return context2.options && ts2.hasProperty(context2.options, optionName) && !context2.options[optionName]; + }; + } + function isOptionDisabledOrUndefined(optionName) { + return function(context2) { + return !context2.options || !ts2.hasProperty(context2.options, optionName) || !context2.options[optionName]; + }; + } + function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) { + return function(context2) { + return !context2.options || !ts2.hasProperty(context2.options, optionName) || !context2.options[optionName] || context2.TokensAreOnSameLine(); + }; + } + function isOptionEnabledOrUndefined(optionName) { + return function(context2) { + return !context2.options || !ts2.hasProperty(context2.options, optionName) || !!context2.options[optionName]; + }; + } + function isForContext(context2) { + return context2.contextNode.kind === 245; + } + function isNotForContext(context2) { + return !isForContext(context2); + } + function isBinaryOpContext(context2) { + switch (context2.contextNode.kind) { + case 223: + return context2.contextNode.operatorToken.kind !== 27; + case 224: + case 191: + case 231: + case 278: + case 273: + case 179: + case 189: + case 190: + case 235: + return true; + case 205: + case 262: + case 268: + case 274: + case 257: + case 166: + case 302: + case 169: + case 168: + return context2.currentTokenSpan.kind === 63 || context2.nextTokenSpan.kind === 63; + case 246: + case 165: + return context2.currentTokenSpan.kind === 101 || context2.nextTokenSpan.kind === 101 || context2.currentTokenSpan.kind === 63 || context2.nextTokenSpan.kind === 63; + case 247: + return context2.currentTokenSpan.kind === 162 || context2.nextTokenSpan.kind === 162; + } + return false; + } + function isNotBinaryOpContext(context2) { + return !isBinaryOpContext(context2); + } + function isNotTypeAnnotationContext(context2) { + return !isTypeAnnotationContext(context2); + } + function isTypeAnnotationContext(context2) { + var contextKind = context2.contextNode.kind; + return contextKind === 169 || contextKind === 168 || contextKind === 166 || contextKind === 257 || ts2.isFunctionLikeKind(contextKind); + } + function isConditionalOperatorContext(context2) { + return context2.contextNode.kind === 224 || context2.contextNode.kind === 191; + } + function isSameLineTokenOrBeforeBlockContext(context2) { + return context2.TokensAreOnSameLine() || isBeforeBlockContext(context2); + } + function isBraceWrappedContext(context2) { + return context2.contextNode.kind === 203 || context2.contextNode.kind === 197 || isSingleLineBlockContext(context2); + } + function isBeforeMultilineBlockContext(context2) { + return isBeforeBlockContext(context2) && !(context2.NextNodeAllOnSameLine() || context2.NextNodeBlockIsOnOneLine()); + } + function isMultilineBlockContext(context2) { + return isBlockContext(context2) && !(context2.ContextNodeAllOnSameLine() || context2.ContextNodeBlockIsOnOneLine()); + } + function isSingleLineBlockContext(context2) { + return isBlockContext(context2) && (context2.ContextNodeAllOnSameLine() || context2.ContextNodeBlockIsOnOneLine()); + } + function isBlockContext(context2) { + return nodeIsBlockContext(context2.contextNode); + } + function isBeforeBlockContext(context2) { + return nodeIsBlockContext(context2.nextTokenParent); + } + function nodeIsBlockContext(node) { + if (nodeIsTypeScriptDeclWithBlockContext(node)) { + return true; + } + switch (node.kind) { + case 238: + case 266: + case 207: + case 265: + return true; + } + return false; + } + function isFunctionDeclContext(context2) { + switch (context2.contextNode.kind) { + case 259: + case 171: + case 170: + case 174: + case 175: + case 176: + case 215: + case 173: + case 216: + case 261: + return true; + } + return false; + } + function isNotFunctionDeclContext(context2) { + return !isFunctionDeclContext(context2); + } + function isFunctionDeclarationOrFunctionExpressionContext(context2) { + return context2.contextNode.kind === 259 || context2.contextNode.kind === 215; + } + function isTypeScriptDeclWithBlockContext(context2) { + return nodeIsTypeScriptDeclWithBlockContext(context2.contextNode); + } + function nodeIsTypeScriptDeclWithBlockContext(node) { + switch (node.kind) { + case 260: + case 228: + case 261: + case 263: + case 184: + case 264: + case 275: + case 276: + case 269: + case 272: + return true; + } + return false; + } + function isAfterCodeBlockContext(context2) { + switch (context2.currentTokenParent.kind) { + case 260: + case 264: + case 263: + case 295: + case 265: + case 252: + return true; + case 238: { + var blockParent = context2.currentTokenParent.parent; + if (!blockParent || blockParent.kind !== 216 && blockParent.kind !== 215) { + return true; + } + } + } + return false; + } + function isControlDeclContext(context2) { + switch (context2.contextNode.kind) { + case 242: + case 252: + case 245: + case 246: + case 247: + case 244: + case 255: + case 243: + case 251: + case 295: + return true; + default: + return false; + } + } + function isObjectContext(context2) { + return context2.contextNode.kind === 207; + } + function isFunctionCallContext(context2) { + return context2.contextNode.kind === 210; + } + function isNewContext(context2) { + return context2.contextNode.kind === 211; + } + function isFunctionCallOrNewContext(context2) { + return isFunctionCallContext(context2) || isNewContext(context2); + } + function isPreviousTokenNotComma(context2) { + return context2.currentTokenSpan.kind !== 27; + } + function isNextTokenNotCloseBracket(context2) { + return context2.nextTokenSpan.kind !== 23; + } + function isNextTokenNotCloseParen(context2) { + return context2.nextTokenSpan.kind !== 21; + } + function isArrowFunctionContext(context2) { + return context2.contextNode.kind === 216; + } + function isImportTypeContext(context2) { + return context2.contextNode.kind === 202; + } + function isNonJsxSameLineTokenContext(context2) { + return context2.TokensAreOnSameLine() && context2.contextNode.kind !== 11; + } + function isNonJsxTextContext(context2) { + return context2.contextNode.kind !== 11; + } + function isNonJsxElementOrFragmentContext(context2) { + return context2.contextNode.kind !== 281 && context2.contextNode.kind !== 285; + } + function isJsxExpressionContext(context2) { + return context2.contextNode.kind === 291 || context2.contextNode.kind === 290; + } + function isNextTokenParentJsxAttribute(context2) { + return context2.nextTokenParent.kind === 288; + } + function isJsxAttributeContext(context2) { + return context2.contextNode.kind === 288; + } + function isJsxSelfClosingElementContext(context2) { + return context2.contextNode.kind === 282; + } + function isNotBeforeBlockInFunctionDeclarationContext(context2) { + return !isFunctionDeclContext(context2) && !isBeforeBlockContext(context2); + } + function isEndOfDecoratorContextOnSameLine(context2) { + return context2.TokensAreOnSameLine() && ts2.hasDecorators(context2.contextNode) && nodeIsInDecoratorContext(context2.currentTokenParent) && !nodeIsInDecoratorContext(context2.nextTokenParent); + } + function nodeIsInDecoratorContext(node) { + while (node && ts2.isExpression(node)) { + node = node.parent; + } + return node && node.kind === 167; + } + function isStartOfVariableDeclarationList(context2) { + return context2.currentTokenParent.kind === 258 && context2.currentTokenParent.getStart(context2.sourceFile) === context2.currentTokenSpan.pos; + } + function isNotFormatOnEnter(context2) { + return context2.formattingRequestKind !== 2; + } + function isModuleDeclContext(context2) { + return context2.contextNode.kind === 264; + } + function isObjectTypeContext(context2) { + return context2.contextNode.kind === 184; + } + function isConstructorSignatureContext(context2) { + return context2.contextNode.kind === 177; + } + function isTypeArgumentOrParameterOrAssertion(token, parent2) { + if (token.kind !== 29 && token.kind !== 31) { + return false; + } + switch (parent2.kind) { + case 180: + case 213: + case 262: + case 260: + case 228: + case 261: + case 259: + case 215: + case 216: + case 171: + case 170: + case 176: + case 177: + case 210: + case 211: + case 230: + return true; + default: + return false; + } + } + function isTypeArgumentOrParameterOrAssertionContext(context2) { + return isTypeArgumentOrParameterOrAssertion(context2.currentTokenSpan, context2.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context2.nextTokenSpan, context2.nextTokenParent); + } + function isTypeAssertionContext(context2) { + return context2.contextNode.kind === 213; + } + function isVoidOpContext(context2) { + return context2.currentTokenSpan.kind === 114 && context2.currentTokenParent.kind === 219; + } + function isYieldOrYieldStarWithOperand(context2) { + return context2.contextNode.kind === 226 && context2.contextNode.expression !== void 0; + } + function isNonNullAssertionContext(context2) { + return context2.contextNode.kind === 232; + } + function isNotStatementConditionContext(context2) { + return !isStatementConditionContext(context2); + } + function isStatementConditionContext(context2) { + switch (context2.contextNode.kind) { + case 242: + case 245: + case 246: + case 247: + case 243: + case 244: + return true; + default: + return false; + } + } + function isSemicolonDeletionContext(context2) { + var nextTokenKind = context2.nextTokenSpan.kind; + var nextTokenStart = context2.nextTokenSpan.pos; + if (ts2.isTrivia(nextTokenKind)) { + var nextRealToken = context2.nextTokenParent === context2.currentTokenParent ? ts2.findNextToken(context2.currentTokenParent, ts2.findAncestor(context2.currentTokenParent, function(a7) { + return !a7.parent; + }), context2.sourceFile) : context2.nextTokenParent.getFirstToken(context2.sourceFile); + if (!nextRealToken) { + return true; + } + nextTokenKind = nextRealToken.kind; + nextTokenStart = nextRealToken.getStart(context2.sourceFile); + } + var startLine = context2.sourceFile.getLineAndCharacterOfPosition(context2.currentTokenSpan.pos).line; + var endLine = context2.sourceFile.getLineAndCharacterOfPosition(nextTokenStart).line; + if (startLine === endLine) { + return nextTokenKind === 19 || nextTokenKind === 1; + } + if (nextTokenKind === 237 || nextTokenKind === 26) { + return false; + } + if (context2.contextNode.kind === 261 || context2.contextNode.kind === 262) { + return !ts2.isPropertySignature(context2.currentTokenParent) || !!context2.currentTokenParent.type || nextTokenKind !== 20; + } + if (ts2.isPropertyDeclaration(context2.currentTokenParent)) { + return !context2.currentTokenParent.initializer; + } + return context2.currentTokenParent.kind !== 245 && context2.currentTokenParent.kind !== 239 && context2.currentTokenParent.kind !== 237 && nextTokenKind !== 22 && nextTokenKind !== 20 && nextTokenKind !== 39 && nextTokenKind !== 40 && nextTokenKind !== 43 && nextTokenKind !== 13 && nextTokenKind !== 27 && nextTokenKind !== 225 && nextTokenKind !== 15 && nextTokenKind !== 14 && nextTokenKind !== 24; + } + function isSemicolonInsertionContext(context2) { + return ts2.positionIsASICandidate(context2.currentTokenSpan.end, context2.currentTokenParent, context2.sourceFile); + } + function isNotPropertyAccessOnIntegerLiteral(context2) { + return !ts2.isPropertyAccessExpression(context2.contextNode) || !ts2.isNumericLiteral(context2.contextNode.expression) || context2.contextNode.expression.getText().indexOf(".") !== -1; + } + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + function getFormatContext(options, host) { + return { options, getRules: getRulesMap(), host }; + } + formatting2.getFormatContext = getFormatContext; + var rulesMapCache; + function getRulesMap() { + if (rulesMapCache === void 0) { + rulesMapCache = createRulesMap(formatting2.getAllRules()); + } + return rulesMapCache; + } + function getRuleActionExclusion(ruleAction) { + var mask2 = 0; + if (ruleAction & 1) { + mask2 |= 28; + } + if (ruleAction & 2) { + mask2 |= 96; + } + if (ruleAction & 28) { + mask2 |= 28; + } + if (ruleAction & 96) { + mask2 |= 96; + } + return mask2; + } + function createRulesMap(rules) { + var map4 = buildMap(rules); + return function(context2) { + var bucket = map4[getRuleBucketIndex(context2.currentTokenSpan.kind, context2.nextTokenSpan.kind)]; + if (bucket) { + var rules_1 = []; + var ruleActionMask = 0; + for (var _i = 0, bucket_1 = bucket; _i < bucket_1.length; _i++) { + var rule = bucket_1[_i]; + var acceptRuleActions = ~getRuleActionExclusion(ruleActionMask); + if (rule.action & acceptRuleActions && ts2.every(rule.context, function(c7) { + return c7(context2); + })) { + rules_1.push(rule); + ruleActionMask |= rule.action; + } + } + if (rules_1.length) { + return rules_1; + } + } + }; + } + function buildMap(rules) { + var map4 = new Array(mapRowLength * mapRowLength); + var rulesBucketConstructionStateList = new Array(map4.length); + for (var _i = 0, rules_2 = rules; _i < rules_2.length; _i++) { + var rule = rules_2[_i]; + var specificRule = rule.leftTokenRange.isSpecific && rule.rightTokenRange.isSpecific; + for (var _a2 = 0, _b = rule.leftTokenRange.tokens; _a2 < _b.length; _a2++) { + var left = _b[_a2]; + for (var _c = 0, _d = rule.rightTokenRange.tokens; _c < _d.length; _c++) { + var right = _d[_c]; + var index4 = getRuleBucketIndex(left, right); + var rulesBucket = map4[index4]; + if (rulesBucket === void 0) { + rulesBucket = map4[index4] = []; + } + addRule(rulesBucket, rule.rule, specificRule, rulesBucketConstructionStateList, index4); + } + } + } + return map4; + } + function getRuleBucketIndex(row, column) { + ts2.Debug.assert(row <= 162 && column <= 162, "Must compute formatting context from tokens"); + return row * mapRowLength + column; + } + var maskBitSize = 5; + var mask = 31; + var mapRowLength = 162 + 1; + var RulesPosition; + (function(RulesPosition2) { + RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; + RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; + RulesPosition2[RulesPosition2["ContextRulesSpecific"] = maskBitSize * 2] = "ContextRulesSpecific"; + RulesPosition2[RulesPosition2["ContextRulesAny"] = maskBitSize * 3] = "ContextRulesAny"; + RulesPosition2[RulesPosition2["NoContextRulesSpecific"] = maskBitSize * 4] = "NoContextRulesSpecific"; + RulesPosition2[RulesPosition2["NoContextRulesAny"] = maskBitSize * 5] = "NoContextRulesAny"; + })(RulesPosition || (RulesPosition = {})); + function addRule(rules, rule, specificTokens, constructionState, rulesBucketIndex) { + var position = rule.action & 3 ? specificTokens ? RulesPosition.StopRulesSpecific : RulesPosition.StopRulesAny : rule.context !== formatting2.anyContext ? specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny : specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; + var state = constructionState[rulesBucketIndex] || 0; + rules.splice(getInsertionIndex(state, position), 0, rule); + constructionState[rulesBucketIndex] = increaseInsertionIndex(state, position); + } + function getInsertionIndex(indexBitmap, maskPosition) { + var index4 = 0; + for (var pos = 0; pos <= maskPosition; pos += maskBitSize) { + index4 += indexBitmap & mask; + indexBitmap >>= maskBitSize; + } + return index4; + } + function increaseInsertionIndex(indexBitmap, maskPosition) { + var value2 = (indexBitmap >> maskPosition & mask) + 1; + ts2.Debug.assert((value2 & mask) === value2, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); + return indexBitmap & ~(mask << maskPosition) | value2 << maskPosition; + } + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + function createTextRangeWithKind(pos, end, kind) { + var textRangeWithKind = { pos, end, kind }; + if (ts2.Debug.isDebugging) { + Object.defineProperty(textRangeWithKind, "__debugKind", { + get: function() { + return ts2.Debug.formatSyntaxKind(kind); + } + }); + } + return textRangeWithKind; + } + formatting2.createTextRangeWithKind = createTextRangeWithKind; + var Constants; + (function(Constants2) { + Constants2[Constants2["Unknown"] = -1] = "Unknown"; + })(Constants || (Constants = {})); + function formatOnEnter(position, sourceFile, formatContext) { + var line = sourceFile.getLineAndCharacterOfPosition(position).line; + if (line === 0) { + return []; + } + var endOfFormatSpan = ts2.getEndLinePosition(line, sourceFile); + while (ts2.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(endOfFormatSpan))) { + endOfFormatSpan--; + } + if (ts2.isLineBreak(sourceFile.text.charCodeAt(endOfFormatSpan))) { + endOfFormatSpan--; + } + var span = { + // get start position for the previous line + pos: ts2.getStartPositionOfLine(line - 1, sourceFile), + // end value is exclusive so add 1 to the result + end: endOfFormatSpan + 1 + }; + return formatSpan( + span, + sourceFile, + formatContext, + 2 + /* FormattingRequestKind.FormatOnEnter */ + ); + } + formatting2.formatOnEnter = formatOnEnter; + function formatOnSemicolon(position, sourceFile, formatContext) { + var semicolon = findImmediatelyPrecedingTokenOfKind(position, 26, sourceFile); + return formatNodeLines( + findOutermostNodeWithinListLevel(semicolon), + sourceFile, + formatContext, + 3 + /* FormattingRequestKind.FormatOnSemicolon */ + ); + } + formatting2.formatOnSemicolon = formatOnSemicolon; + function formatOnOpeningCurly(position, sourceFile, formatContext) { + var openingCurly = findImmediatelyPrecedingTokenOfKind(position, 18, sourceFile); + if (!openingCurly) { + return []; + } + var curlyBraceRange = openingCurly.parent; + var outermostNode = findOutermostNodeWithinListLevel(curlyBraceRange); + var textRange = { + pos: ts2.getLineStartPositionForPosition(outermostNode.getStart(sourceFile), sourceFile), + end: position + }; + return formatSpan( + textRange, + sourceFile, + formatContext, + 4 + /* FormattingRequestKind.FormatOnOpeningCurlyBrace */ + ); + } + formatting2.formatOnOpeningCurly = formatOnOpeningCurly; + function formatOnClosingCurly(position, sourceFile, formatContext) { + var precedingToken = findImmediatelyPrecedingTokenOfKind(position, 19, sourceFile); + return formatNodeLines( + findOutermostNodeWithinListLevel(precedingToken), + sourceFile, + formatContext, + 5 + /* FormattingRequestKind.FormatOnClosingCurlyBrace */ + ); + } + formatting2.formatOnClosingCurly = formatOnClosingCurly; + function formatDocument(sourceFile, formatContext) { + var span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan( + span, + sourceFile, + formatContext, + 0 + /* FormattingRequestKind.FormatDocument */ + ); + } + formatting2.formatDocument = formatDocument; + function formatSelection(start, end, sourceFile, formatContext) { + var span = { + pos: ts2.getLineStartPositionForPosition(start, sourceFile), + end + }; + return formatSpan( + span, + sourceFile, + formatContext, + 1 + /* FormattingRequestKind.FormatSelection */ + ); + } + formatting2.formatSelection = formatSelection; + function findImmediatelyPrecedingTokenOfKind(end, expectedTokenKind, sourceFile) { + var precedingToken = ts2.findPrecedingToken(end, sourceFile); + return precedingToken && precedingToken.kind === expectedTokenKind && end === precedingToken.getEnd() ? precedingToken : void 0; + } + function findOutermostNodeWithinListLevel(node) { + var current = node; + while (current && current.parent && current.parent.end === node.end && !isListElement(current.parent, current)) { + current = current.parent; + } + return current; + } + function isListElement(parent2, node) { + switch (parent2.kind) { + case 260: + case 261: + return ts2.rangeContainsRange(parent2.members, node); + case 264: + var body = parent2.body; + return !!body && body.kind === 265 && ts2.rangeContainsRange(body.statements, node); + case 308: + case 238: + case 265: + return ts2.rangeContainsRange(parent2.statements, node); + case 295: + return ts2.rangeContainsRange(parent2.block.statements, node); + } + return false; + } + function findEnclosingNode(range2, sourceFile) { + return find2(sourceFile); + function find2(n7) { + var candidate = ts2.forEachChild(n7, function(c7) { + return ts2.startEndContainsRange(c7.getStart(sourceFile), c7.end, range2) && c7; + }); + if (candidate) { + var result2 = find2(candidate); + if (result2) { + return result2; + } + } + return n7; + } + } + function prepareRangeContainsErrorFunction(errors, originalRange) { + if (!errors.length) { + return rangeHasNoErrors; + } + var sorted = errors.filter(function(d7) { + return ts2.rangeOverlapsWithStartEnd(originalRange, d7.start, d7.start + d7.length); + }).sort(function(e1, e22) { + return e1.start - e22.start; + }); + if (!sorted.length) { + return rangeHasNoErrors; + } + var index4 = 0; + return function(r8) { + while (true) { + if (index4 >= sorted.length) { + return false; + } + var error2 = sorted[index4]; + if (r8.end <= error2.start) { + return false; + } + if (ts2.startEndOverlapsWithStartEnd(r8.pos, r8.end, error2.start, error2.start + error2.length)) { + return true; + } + index4++; + } + }; + function rangeHasNoErrors() { + return false; + } + } + function getScanStartPosition(enclosingNode, originalRange, sourceFile) { + var start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + var precedingToken = ts2.findPrecedingToken(originalRange.pos, sourceFile); + if (!precedingToken) { + return enclosingNode.pos; + } + if (precedingToken.end >= originalRange.pos) { + return enclosingNode.pos; + } + return precedingToken.end; + } + function getOwnOrInheritedDelta(n7, options, sourceFile) { + var previousLine = -1; + var child; + while (n7) { + var line = sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)).line; + if (previousLine !== -1 && line !== previousLine) { + break; + } + if (formatting2.SmartIndenter.shouldIndentChildNode(options, n7, child, sourceFile)) { + return options.indentSize; + } + previousLine = line; + child = n7; + n7 = n7.parent; + } + return 0; + } + function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) { + var range2 = { pos: node.pos, end: node.end }; + return formatting2.getFormattingScanner(sourceFileLike.text, languageVariant, range2.pos, range2.end, function(scanner) { + return formatSpanWorker( + range2, + node, + initialIndentation, + delta, + scanner, + formatContext, + 1, + function(_6) { + return false; + }, + // assume that node does not have any errors + sourceFileLike + ); + }); + } + formatting2.formatNodeGivenIndentation = formatNodeGivenIndentation; + function formatNodeLines(node, sourceFile, formatContext, requestKind) { + if (!node) { + return []; + } + var span = { + pos: ts2.getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile), + end: node.end + }; + return formatSpan(span, sourceFile, formatContext, requestKind); + } + function formatSpan(originalRange, sourceFile, formatContext, requestKind) { + var enclosingNode = findEnclosingNode(originalRange, sourceFile); + return formatting2.getFormattingScanner(sourceFile.text, sourceFile.languageVariant, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end, function(scanner) { + return formatSpanWorker(originalRange, enclosingNode, formatting2.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), scanner, formatContext, requestKind, prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), sourceFile); + }); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, _a2, requestKind, rangeContainsError, sourceFile) { + var _b; + var options = _a2.options, getRules = _a2.getRules, host = _a2.host; + var formattingContext = new formatting2.FormattingContext(sourceFile, requestKind, options); + var previousRangeTriviaEnd; + var previousRange; + var previousParent; + var previousRangeStartLine; + var lastIndentedLine; + var indentationOnLastIndentedLine = -1; + var edits = []; + formattingScanner.advance(); + if (formattingScanner.isOnToken()) { + var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + var undecoratedStartLine = startLine; + if (ts2.hasDecorators(enclosingNode)) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts2.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); + } + if (!formattingScanner.isOnToken()) { + var indentation = formatting2.SmartIndenter.nodeWillIndentChild( + options, + enclosingNode, + /*child*/ + void 0, + sourceFile, + /*indentByDefault*/ + false + ) ? initialIndentation + options.indentSize : initialIndentation; + var leadingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (leadingTrivia) { + indentTriviaItems( + leadingTrivia, + indentation, + /*indentNextTokenOrTrivia*/ + false, + function(item) { + return processRange( + item, + sourceFile.getLineAndCharacterOfPosition(item.pos), + enclosingNode, + enclosingNode, + /*dynamicIndentation*/ + void 0 + ); + } + ); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(leadingTrivia); + } + } + } + if (previousRange && formattingScanner.getStartPos() >= originalRange.end) { + var tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() : formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token : void 0; + if (tokenInfo && tokenInfo.pos === previousRangeTriviaEnd) { + var parent2 = ((_b = ts2.findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) === null || _b === void 0 ? void 0 : _b.parent) || previousParent; + processPair( + tokenInfo, + sourceFile.getLineAndCharacterOfPosition(tokenInfo.pos).line, + parent2, + previousRange, + previousRangeStartLine, + previousParent, + parent2, + /*dynamicIndentation*/ + void 0 + ); + } + } + return edits; + function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range2, inheritedIndentation) { + if (ts2.rangeOverlapsWithStartEnd(range2, startPos, endPos) || ts2.rangeContainsStartEnd(range2, startPos, endPos)) { + if (inheritedIndentation !== -1) { + return inheritedIndentation; + } + } else { + var startLine2 = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var startLinePosition = ts2.getLineStartPositionForPosition(startPos, sourceFile); + var column = formatting2.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine2 !== parentStartLine || startPos === column) { + var baseIndentSize = formatting2.SmartIndenter.getBaseIndentation(options); + return baseIndentSize > column ? baseIndentSize : column; + } + } + return -1; + } + function computeIndentation(node, startLine2, inheritedIndentation, parent3, parentDynamicIndentation, effectiveParentStartLine) { + var delta2 = formatting2.SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; + if (effectiveParentStartLine === startLine2) { + return { + indentation: startLine2 === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta2) + }; + } else if (inheritedIndentation === -1) { + if (node.kind === 20 && startLine2 === lastIndentedLine) { + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } else if (formatting2.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent3, node, startLine2, sourceFile) || formatting2.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(parent3, node, startLine2, sourceFile) || formatting2.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(parent3, node, startLine2, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta2 }; + } else { + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta2 }; + } + } else { + return { indentation: inheritedIndentation, delta: delta2 }; + } + } + function getFirstNonDecoratorTokenOfNode(node) { + if (ts2.canHaveModifiers(node)) { + var modifier = ts2.find(node.modifiers, ts2.isModifier, ts2.findIndex(node.modifiers, ts2.isDecorator)); + if (modifier) + return modifier.kind; + } + switch (node.kind) { + case 260: + return 84; + case 261: + return 118; + case 259: + return 98; + case 263: + return 263; + case 174: + return 137; + case 175: + return 151; + case 171: + if (node.asteriskToken) { + return 41; + } + case 169: + case 166: + var name2 = ts2.getNameOfDeclaration(node); + if (name2) { + return name2.kind; + } + } + } + function getDynamicIndentation(node, nodeStartLine, indentation2, delta2) { + return { + getIndentationForComment: function(kind, tokenIndentation, container) { + switch (kind) { + case 19: + case 23: + case 21: + return indentation2 + getDelta(container); + } + return tokenIndentation !== -1 ? tokenIndentation : indentation2; + }, + // if list end token is LessThanToken '>' then its delta should be explicitly suppressed + // so that LessThanToken as a binary operator can still be indented. + // foo.then + // < + // number, + // string, + // >(); + // vs + // var a = xValue + // > yValue; + getIndentationForToken: function(line, kind, container, suppressDelta) { + return !suppressDelta && shouldAddDelta(line, kind, container) ? indentation2 + getDelta(container) : indentation2; + }, + getIndentation: function() { + return indentation2; + }, + getDelta, + recomputeIndentation: function(lineAdded, parent3) { + if (formatting2.SmartIndenter.shouldIndentChildNode(options, parent3, node, sourceFile)) { + indentation2 += lineAdded ? options.indentSize : -options.indentSize; + delta2 = formatting2.SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; + } + } + }; + function shouldAddDelta(line, kind, container) { + switch (kind) { + case 18: + case 19: + case 21: + case 91: + case 115: + case 59: + return false; + case 43: + case 31: + switch (container.kind) { + case 283: + case 284: + case 282: + return false; + } + break; + case 22: + case 23: + if (container.kind !== 197) { + return false; + } + break; + } + return nodeStartLine !== line && !(ts2.hasDecorators(node) && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { + return formatting2.SmartIndenter.nodeWillIndentChild( + options, + node, + child, + sourceFile, + /*indentByDefault*/ + true + ) ? delta2 : 0; + } + } + function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation2, delta2) { + if (!ts2.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation2, delta2); + var childContextNode = contextNode; + ts2.forEachChild(node, function(child) { + processChildNode( + child, + /*inheritedIndentation*/ + -1, + node, + nodeDynamicIndentation, + nodeStartLine, + undecoratedNodeStartLine, + /*isListItem*/ + false + ); + }, function(nodes) { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + }); + while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) { + var tokenInfo2 = formattingScanner.readTokenInfo(node); + if (tokenInfo2.token.end > Math.min(node.end, originalRange.end)) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo2, node, nodeDynamicIndentation, node); + } + function processChildNode(child, inheritedIndentation, parent3, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { + ts2.Debug.assert(!ts2.nodeIsSynthesized(child)); + if (ts2.nodeIsMissing(child)) { + return inheritedIndentation; + } + var childStartPos = child.getStart(sourceFile); + var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + var undecoratedChildStartLine = childStartLine; + if (ts2.hasDecorators(child)) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts2.getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } + var childIndentationAmount = -1; + if (isListItem && ts2.rangeContainsRange(originalRange, parent3)) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== -1) { + inheritedIndentation = childIndentationAmount; + } + } + if (!ts2.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + if (child.end < originalRange.pos) { + formattingScanner.skipToEndOf(child); + } + return inheritedIndentation; + } + if (child.getFullWidth() === 0) { + return inheritedIndentation; + } + while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) { + var tokenInfo3 = formattingScanner.readTokenInfo(node); + if (tokenInfo3.token.end > originalRange.end) { + return inheritedIndentation; + } + if (tokenInfo3.token.end > childStartPos) { + if (tokenInfo3.token.pos > childStartPos) { + formattingScanner.skipToStartOf(child); + } + break; + } + consumeTokenAndAdvanceScanner(tokenInfo3, node, parentDynamicIndentation, node); + } + if (!formattingScanner.isOnToken() || formattingScanner.getStartPos() >= originalRange.end) { + return inheritedIndentation; + } + if (ts2.isToken(child)) { + var tokenInfo3 = formattingScanner.readTokenInfo(child); + if (child.kind !== 11) { + ts2.Debug.assert(tokenInfo3.token.end === child.end, "Token end is child end"); + consumeTokenAndAdvanceScanner(tokenInfo3, node, parentDynamicIndentation, child); + return inheritedIndentation; + } + } + var effectiveParentStartLine = child.kind === 167 ? childStartLine : undecoratedParentStartLine; + var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); + childContextNode = node; + if (isFirstListItem && parent3.kind === 206 && inheritedIndentation === -1) { + inheritedIndentation = childIndentation.indentation; + } + return inheritedIndentation; + } + function processChildNodes(nodes, parent3, parentStartLine, parentDynamicIndentation) { + ts2.Debug.assert(ts2.isNodeArray(nodes)); + ts2.Debug.assert(!ts2.nodeIsSynthesized(nodes)); + var listStartToken = getOpenTokenForList(parent3, nodes); + var listDynamicIndentation = parentDynamicIndentation; + var startLine2 = parentStartLine; + if (!ts2.rangeOverlapsWithStartEnd(originalRange, nodes.pos, nodes.end)) { + if (nodes.end < originalRange.pos) { + formattingScanner.skipToEndOf(nodes); + } + return; + } + if (listStartToken !== 0) { + while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) { + var tokenInfo3 = formattingScanner.readTokenInfo(parent3); + if (tokenInfo3.token.end > nodes.pos) { + break; + } else if (tokenInfo3.token.kind === listStartToken) { + startLine2 = sourceFile.getLineAndCharacterOfPosition(tokenInfo3.token.pos).line; + consumeTokenAndAdvanceScanner(tokenInfo3, parent3, parentDynamicIndentation, parent3); + var indentationOnListStartToken = void 0; + if (indentationOnLastIndentedLine !== -1) { + indentationOnListStartToken = indentationOnLastIndentedLine; + } else { + var startLinePosition = ts2.getLineStartPositionForPosition(tokenInfo3.token.pos, sourceFile); + indentationOnListStartToken = formatting2.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, tokenInfo3.token.pos, sourceFile, options); + } + listDynamicIndentation = getDynamicIndentation(parent3, parentStartLine, indentationOnListStartToken, options.indentSize); + } else { + consumeTokenAndAdvanceScanner(tokenInfo3, parent3, parentDynamicIndentation, parent3); + } + } + } + var inheritedIndentation = -1; + for (var i7 = 0; i7 < nodes.length; i7++) { + var child = nodes[i7]; + inheritedIndentation = processChildNode( + child, + inheritedIndentation, + node, + listDynamicIndentation, + startLine2, + startLine2, + /*isListItem*/ + true, + /*isFirstListItem*/ + i7 === 0 + ); + } + var listEndToken = getCloseTokenForOpenToken(listStartToken); + if (listEndToken !== 0 && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) { + var tokenInfo3 = formattingScanner.readTokenInfo(parent3); + if (tokenInfo3.token.kind === 27) { + consumeTokenAndAdvanceScanner(tokenInfo3, parent3, listDynamicIndentation, parent3); + tokenInfo3 = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent3) : void 0; + } + if (tokenInfo3 && tokenInfo3.token.kind === listEndToken && ts2.rangeContainsRange(parent3, tokenInfo3.token)) { + consumeTokenAndAdvanceScanner( + tokenInfo3, + parent3, + listDynamicIndentation, + parent3, + /*isListEndToken*/ + true + ); + } + } + } + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent3, dynamicIndentation, container, isListEndToken) { + ts2.Debug.assert(ts2.rangeContainsRange(parent3, currentTokenInfo.token)); + var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + var indentToken = false; + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent3, childContextNode, dynamicIndentation); + } + var lineAction = 0; + var isTokenInRange = ts2.rangeContainsRange(originalRange, currentTokenInfo.token); + var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + var rangeHasError = rangeContainsError(currentTokenInfo.token); + var savePreviousRange = previousRange; + lineAction = processRange(currentTokenInfo.token, tokenStart, parent3, childContextNode, dynamicIndentation); + if (!rangeHasError) { + if (lineAction === 0) { + var prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; + } else { + indentToken = lineAction === 1; + } + } + } + if (currentTokenInfo.trailingTrivia) { + previousRangeTriviaEnd = ts2.last(currentTokenInfo.trailingTrivia).end; + processTrivia(currentTokenInfo.trailingTrivia, parent3, childContextNode, dynamicIndentation); + } + if (indentToken) { + var tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) : -1; + var indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); + indentNextTokenOrTrivia = indentTriviaItems(currentTokenInfo.leadingTrivia, commentIndentation_1, indentNextTokenOrTrivia, function(item) { + return insertIndentation( + item.pos, + commentIndentation_1, + /*lineAdded*/ + false + ); + }); + } + if (tokenIndentation !== -1 && indentNextTokenOrTrivia) { + insertIndentation( + currentTokenInfo.token.pos, + tokenIndentation, + lineAction === 1 + /* LineAction.LineAdded */ + ); + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; + } + } + formattingScanner.advance(); + childContextNode = parent3; + } + } + function indentTriviaItems(trivia, commentIndentation, indentNextTokenOrTrivia, indentSingleLine) { + for (var _i = 0, trivia_1 = trivia; _i < trivia_1.length; _i++) { + var triviaItem = trivia_1[_i]; + var triviaInRange = ts2.rangeContainsRange(originalRange, triviaItem); + switch (triviaItem.kind) { + case 3: + if (triviaInRange) { + indentMultilineComment( + triviaItem, + commentIndentation, + /*firstLineIsIndented*/ + !indentNextTokenOrTrivia + ); + } + indentNextTokenOrTrivia = false; + break; + case 2: + if (indentNextTokenOrTrivia && triviaInRange) { + indentSingleLine(triviaItem); + } + indentNextTokenOrTrivia = false; + break; + case 4: + indentNextTokenOrTrivia = true; + break; + } + } + return indentNextTokenOrTrivia; + } + function processTrivia(trivia, parent3, contextNode, dynamicIndentation) { + for (var _i = 0, trivia_2 = trivia; _i < trivia_2.length; _i++) { + var triviaItem = trivia_2[_i]; + if (ts2.isComment(triviaItem.kind) && ts2.rangeContainsRange(originalRange, triviaItem)) { + var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent3, contextNode, dynamicIndentation); + } + } + } + function processRange(range2, rangeStart, parent3, contextNode, dynamicIndentation) { + var rangeHasError = rangeContainsError(range2); + var lineAction = 0; + if (!rangeHasError) { + if (!previousRange) { + var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } else { + lineAction = processPair(range2, rangeStart.line, parent3, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + } + } + previousRange = range2; + previousRangeTriviaEnd = range2.end; + previousParent = parent3; + previousRangeStartLine = rangeStart.line; + return lineAction; + } + function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent2, contextNode, dynamicIndentation) { + formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); + var rules = getRules(formattingContext); + var trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; + var lineAction = 0; + if (rules) { + ts2.forEachRight(rules, function(rule) { + lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + if (dynamicIndentation) { + switch (lineAction) { + case 2: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation( + /*lineAddedByFormatting*/ + false, + contextNode + ); + } + break; + case 1: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation( + /*lineAddedByFormatting*/ + true, + contextNode + ); + } + break; + default: + ts2.Debug.assert( + lineAction === 0 + /* LineAction.None */ + ); + } + } + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16) && rule.flags !== 1; + }); + } else { + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1; + } + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + return lineAction; + } + function insertIndentation(pos, indentation2, lineAdded) { + var indentationString = getIndentationString(indentation2, options); + if (lineAdded) { + recordReplace(pos, 0, indentationString); + } else { + var tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); + var startLinePosition = ts2.getStartPositionOfLine(tokenStart.line, sourceFile); + if (indentation2 !== characterToColumn(startLinePosition, tokenStart.character) || indentationIsDifferent(indentationString, startLinePosition)) { + recordReplace(startLinePosition, tokenStart.character, indentationString); + } + } + } + function characterToColumn(startLinePosition, characterInLine) { + var column = 0; + for (var i7 = 0; i7 < characterInLine; i7++) { + if (sourceFile.text.charCodeAt(startLinePosition + i7) === 9) { + column += options.tabSize - column % options.tabSize; + } else { + column++; + } + } + return column; + } + function indentationIsDifferent(indentationString, startLinePosition) { + return indentationString !== sourceFile.text.substr(startLinePosition, indentationString.length); + } + function indentMultilineComment(commentRange, indentation2, firstLineIsIndented, indentFinalLine) { + if (indentFinalLine === void 0) { + indentFinalLine = true; + } + var startLine2 = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; + if (startLine2 === endLine) { + if (!firstLineIsIndented) { + insertIndentation( + commentRange.pos, + indentation2, + /*lineAdded*/ + false + ); + } + return; + } + var parts = []; + var startPos = commentRange.pos; + for (var line = startLine2; line < endLine; line++) { + var endOfLine = ts2.getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = ts2.getStartPositionOfLine(line + 1, sourceFile); + } + if (indentFinalLine) { + parts.push({ pos: startPos, end: commentRange.end }); + } + if (parts.length === 0) + return; + var startLinePos = ts2.getStartPositionOfLine(startLine2, sourceFile); + var nonWhitespaceColumnInFirstPart = formatting2.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); + var startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine2++; + } + var delta2 = indentation2 - nonWhitespaceColumnInFirstPart.column; + for (var i7 = startIndex; i7 < parts.length; i7++, startLine2++) { + var startLinePos_1 = ts2.getStartPositionOfLine(startLine2, sourceFile); + var nonWhitespaceCharacterAndColumn = i7 === 0 ? nonWhitespaceColumnInFirstPart : formatting2.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i7].pos, parts[i7].end, sourceFile, options); + var newIndentation = nonWhitespaceCharacterAndColumn.column + delta2; + if (newIndentation > 0) { + var indentationString = getIndentationString(newIndentation, options); + recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString); + } else { + recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character); + } + } + } + function trimTrailingWhitespacesForLines(line1, line2, range2) { + for (var line = line1; line < line2; line++) { + var lineStartPosition = ts2.getStartPositionOfLine(line, sourceFile); + var lineEndPosition = ts2.getEndLinePosition(line, sourceFile); + if (range2 && (ts2.isComment(range2.kind) || ts2.isStringOrRegularExpressionOrTemplateLiteral(range2.kind)) && range2.pos <= lineEndPosition && range2.end > lineEndPosition) { + continue; + } + var whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + ts2.Debug.assert(whitespaceStart === lineStartPosition || !ts2.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); + } + } + } + function getTrailingWhitespaceStartPosition(start, end) { + var pos = end; + while (pos >= start && ts2.isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + function trimTrailingWhitespacesForRemainingRange(trivias) { + var startPos = previousRange ? previousRange.end : originalRange.pos; + for (var _i = 0, trivias_1 = trivias; _i < trivias_1.length; _i++) { + var trivia = trivias_1[_i]; + if (ts2.isComment(trivia.kind)) { + if (startPos < trivia.pos) { + trimTrailingWitespacesForPositions(startPos, trivia.pos - 1, previousRange); + } + startPos = trivia.end + 1; + } + } + if (startPos < originalRange.end) { + trimTrailingWitespacesForPositions(startPos, originalRange.end, previousRange); + } + } + function trimTrailingWitespacesForPositions(startPos, endPos, previousRange2) { + var startLine2 = sourceFile.getLineAndCharacterOfPosition(startPos).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line; + trimTrailingWhitespacesForLines(startLine2, endLine + 1, previousRange2); + } + function recordDelete(start, len) { + if (len) { + edits.push(ts2.createTextChangeFromStartLength(start, len, "")); + } + } + function recordReplace(start, len, newText) { + if (len || newText) { + edits.push(ts2.createTextChangeFromStartLength(start, len, newText)); + } + } + function recordInsert(start, text) { + if (text) { + edits.push(ts2.createTextChangeFromStartLength(start, 0, text)); + } + } + function applyRuleEdits(rule, previousRange2, previousStartLine, currentRange, currentStartLine) { + var onLaterLine = currentStartLine !== previousStartLine; + switch (rule.action) { + case 1: + return 0; + case 16: + if (previousRange2.end !== currentRange.pos) { + recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); + return onLaterLine ? 2 : 0; + } + break; + case 32: + recordDelete(previousRange2.pos, previousRange2.end - previousRange2.pos); + break; + case 8: + if (rule.flags !== 1 && previousStartLine !== currentStartLine) { + return 0; + } + var lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, ts2.getNewLineOrDefaultFromHost(host, options)); + return onLaterLine ? 0 : 1; + } + break; + case 4: + if (rule.flags !== 1 && previousStartLine !== currentStartLine) { + return 0; + } + var posDelta = currentRange.pos - previousRange2.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32) { + recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); + return onLaterLine ? 2 : 0; + } + break; + case 64: + recordInsert(previousRange2.end, ";"); + } + return 0; + } + } + var LineAction; + (function(LineAction2) { + LineAction2[LineAction2["None"] = 0] = "None"; + LineAction2[LineAction2["LineAdded"] = 1] = "LineAdded"; + LineAction2[LineAction2["LineRemoved"] = 2] = "LineRemoved"; + })(LineAction || (LineAction = {})); + function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition) { + if (tokenAtPosition === void 0) { + tokenAtPosition = ts2.getTokenAtPosition(sourceFile, position); + } + var jsdoc = ts2.findAncestor(tokenAtPosition, ts2.isJSDoc); + if (jsdoc) + tokenAtPosition = jsdoc.parent; + var tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return void 0; + } + precedingToken = precedingToken === null ? void 0 : precedingToken === void 0 ? ts2.findPrecedingToken(position, sourceFile) : precedingToken; + var trailingRangesOfPreviousToken = precedingToken && ts2.getTrailingCommentRanges(sourceFile.text, precedingToken.end); + var leadingCommentRangesOfNextToken = ts2.getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + var commentRanges = ts2.concatenate(trailingRangesOfPreviousToken, leadingCommentRangesOfNextToken); + return commentRanges && ts2.find(commentRanges, function(range2) { + return ts2.rangeContainsPositionExclusive(range2, position) || // The end marker of a single-line comment does not include the newline character. + // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): + // + // // asdf ^\n + // + // But for closed multi-line comments, we don't want to be inside the comment in the following case: + // + // /* asdf */^ + // + // However, unterminated multi-line comments *do* contain their end. + // + // Internally, we represent the end of the comment at the newline and closing '/', respectively. + // + position === range2.end && (range2.kind === 2 || position === sourceFile.getFullWidth()); + }); + } + formatting2.getRangeOfEnclosingComment = getRangeOfEnclosingComment; + function getOpenTokenForList(node, list) { + switch (node.kind) { + case 173: + case 259: + case 215: + case 171: + case 170: + case 216: + case 176: + case 177: + case 181: + case 182: + case 174: + case 175: + if (node.typeParameters === list) { + return 29; + } else if (node.parameters === list) { + return 20; + } + break; + case 210: + case 211: + if (node.typeArguments === list) { + return 29; + } else if (node.arguments === list) { + return 20; + } + break; + case 260: + case 228: + case 261: + case 262: + if (node.typeParameters === list) { + return 29; + } + break; + case 180: + case 212: + case 183: + case 230: + case 202: + if (node.typeArguments === list) { + return 29; + } + break; + case 184: + return 18; + } + return 0; + } + function getCloseTokenForOpenToken(kind) { + switch (kind) { + case 20: + return 21; + case 29: + return 31; + case 18: + return 19; + } + return 0; + } + var internedSizes; + var internedTabsIndentation; + var internedSpacesIndentation; + function getIndentationString(indentation, options) { + var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.tabSize || internedSizes.indentSize !== options.indentSize); + if (resetInternedStrings) { + internedSizes = { tabSize: options.tabSize, indentSize: options.indentSize }; + internedTabsIndentation = internedSpacesIndentation = void 0; + } + if (!options.convertTabsToSpaces) { + var tabs = Math.floor(indentation / options.tabSize); + var spaces = indentation - tabs * options.tabSize; + var tabString = void 0; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + if (internedTabsIndentation[tabs] === void 0) { + internedTabsIndentation[tabs] = tabString = ts2.repeatString(" ", tabs); + } else { + tabString = internedTabsIndentation[tabs]; + } + return spaces ? tabString + ts2.repeatString(" ", spaces) : tabString; + } else { + var spacesString = void 0; + var quotient = Math.floor(indentation / options.indentSize); + var remainder = indentation % options.indentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + if (internedSpacesIndentation[quotient] === void 0) { + spacesString = ts2.repeatString(" ", options.indentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } else { + spacesString = internedSpacesIndentation[quotient]; + } + return remainder ? spacesString + ts2.repeatString(" ", remainder) : spacesString; + } + } + formatting2.getIndentationString = getIndentationString; + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var formatting; + (function(formatting2) { + var SmartIndenter; + (function(SmartIndenter2) { + var Value; + (function(Value2) { + Value2[Value2["Unknown"] = -1] = "Unknown"; + })(Value || (Value = {})); + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace) { + if (assumeNewLineBeforeCloseBrace === void 0) { + assumeNewLineBeforeCloseBrace = false; + } + if (position > sourceFile.text.length) { + return getBaseIndentation(options); + } + if (options.indentStyle === ts2.IndentStyle.None) { + return 0; + } + var precedingToken = ts2.findPrecedingToken( + position, + sourceFile, + /*startNode*/ + void 0, + /*excludeJsdoc*/ + true + ); + var enclosingCommentRange = formatting2.getRangeOfEnclosingComment(sourceFile, position, precedingToken || null); + if (enclosingCommentRange && enclosingCommentRange.kind === 3) { + return getCommentIndent(sourceFile, position, options, enclosingCommentRange); + } + if (!precedingToken) { + return getBaseIndentation(options); + } + var precedingTokenIsLiteral = ts2.isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { + return 0; + } + var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + var currentToken = ts2.getTokenAtPosition(sourceFile, position); + var isObjectLiteral2 = currentToken.kind === 18 && currentToken.parent.kind === 207; + if (options.indentStyle === ts2.IndentStyle.Block || isObjectLiteral2) { + return getBlockIndent(sourceFile, position, options); + } + if (precedingToken.kind === 27 && precedingToken.parent.kind !== 223) { + var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + } + var containerList = getListByPosition(position, precedingToken.parent, sourceFile); + if (containerList && !ts2.rangeContainsRange(containerList, precedingToken)) { + var useTheSameBaseIndentation = [ + 215, + 216 + /* SyntaxKind.ArrowFunction */ + ].indexOf(currentToken.parent.kind) !== -1; + var indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; + return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; + } + return getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options); + } + SmartIndenter2.getIndentation = getIndentation; + function getCommentIndent(sourceFile, position, options, enclosingCommentRange) { + var previousLine = ts2.getLineAndCharacterOfPosition(sourceFile, position).line - 1; + var commentStartLine = ts2.getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + ts2.Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(ts2.getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + var startPositionOfLine = ts2.getStartPositionOfLine(previousLine, sourceFile); + var _a2 = findFirstNonWhitespaceCharacterAndColumn(startPositionOfLine, position, sourceFile, options), column = _a2.column, character = _a2.character; + if (column === 0) { + return column; + } + var firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPositionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 ? column - 1 : column; + } + function getBlockIndent(sourceFile, position, options) { + var current = position; + while (current > 0) { + var char = sourceFile.text.charCodeAt(current); + if (!ts2.isWhiteSpaceLike(char)) { + break; + } + current--; + } + var lineStart = ts2.getLineStartPositionForPosition(current, sourceFile); + return findFirstNonWhitespaceColumn(lineStart, current, sourceFile, options); + } + function getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options) { + var previous; + var current = precedingToken; + while (current) { + if (ts2.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode( + options, + current, + previous, + sourceFile, + /*isNextChild*/ + true + )) { + var currentStart = getStartLineAndCharacterForNode(current, sourceFile); + var nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + var indentationDelta = nextTokenKind !== 0 ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; + return getIndentationForNodeWorker( + current, + currentStart, + /*ignoreActualIndentationRange*/ + void 0, + indentationDelta, + sourceFile, + /*isNextChild*/ + true, + options + ); + } + var actualIndentation = getActualIndentationForListItem( + current, + sourceFile, + options, + /*listIndentsChild*/ + true + ); + if (actualIndentation !== -1) { + return actualIndentation; + } + previous = current; + current = current.parent; + } + return getBaseIndentation(options); + } + function getIndentationForNode(n7, ignoreActualIndentationRange, sourceFile, options) { + var start = sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)); + return getIndentationForNodeWorker( + n7, + start, + ignoreActualIndentationRange, + /*indentationDelta*/ + 0, + sourceFile, + /*isNextChild*/ + false, + options + ); + } + SmartIndenter2.getIndentationForNode = getIndentationForNode; + function getBaseIndentation(options) { + return options.baseIndentSize || 0; + } + SmartIndenter2.getBaseIndentation = getBaseIndentation; + function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, isNextChild, options) { + var _a2; + var parent2 = current.parent; + while (parent2) { + var useActualIndentation = true; + if (ignoreActualIndentationRange) { + var start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; + } + var containingListOrParentStart = getContainingListOrParentStart(parent2, current, sourceFile); + var parentAndChildShareLine = containingListOrParentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent2, current, currentStart.line, sourceFile); + if (useActualIndentation) { + var firstListChild = (_a2 = getContainingList(current, sourceFile)) === null || _a2 === void 0 ? void 0 : _a2[0]; + var listIndentsChild = !!firstListChild && getStartLineAndCharacterForNode(firstListChild, sourceFile).line > containingListOrParentStart.line; + var actualIndentation = getActualIndentationForListItem(current, sourceFile, options, listIndentsChild); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + actualIndentation = getActualIndentationForNode(current, parent2, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + if (shouldIndentChildNode(options, parent2, current, sourceFile, isNextChild) && !parentAndChildShareLine) { + indentationDelta += options.indentSize; + } + var useTrueStart = isArgumentAndStartLineOverlapsExpressionBeingCalled(parent2, current, currentStart.line, sourceFile); + current = parent2; + parent2 = current.parent; + currentStart = useTrueStart ? sourceFile.getLineAndCharacterOfPosition(current.getStart(sourceFile)) : containingListOrParentStart; + } + return indentationDelta + getBaseIndentation(options); + } + function getContainingListOrParentStart(parent2, child, sourceFile) { + var containingList = getContainingList(child, sourceFile); + var startPos = containingList ? containingList.pos : parent2.getStart(sourceFile); + return sourceFile.getLineAndCharacterOfPosition(startPos); + } + function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { + var commaItemInfo = ts2.findListItemInfo(commaToken); + if (commaItemInfo && commaItemInfo.listItemIndex > 0) { + return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); + } else { + return -1; + } + } + function getActualIndentationForNode(current, parent2, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { + var useActualIndentation = (ts2.isDeclaration(current) || ts2.isStatementButNotDeclaration(current)) && (parent2.kind === 308 || !parentAndChildShareLine); + if (!useActualIndentation) { + return -1; + } + return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); + } + var NextTokenKind; + (function(NextTokenKind2) { + NextTokenKind2[NextTokenKind2["Unknown"] = 0] = "Unknown"; + NextTokenKind2[NextTokenKind2["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind2[NextTokenKind2["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); + function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { + var nextToken = ts2.findNextToken(precedingToken, current, sourceFile); + if (!nextToken) { + return 0; + } + if (nextToken.kind === 18) { + return 1; + } else if (nextToken.kind === 19) { + var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; + return lineAtPosition === nextTokenStartLine ? 2 : 0; + } + return 0; + } + function getStartLineAndCharacterForNode(n7, sourceFile) { + return sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)); + } + function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent2, child, childStartLine, sourceFile) { + if (!(ts2.isCallExpression(parent2) && ts2.contains(parent2.arguments, child))) { + return false; + } + var expressionOfCallExpressionEnd = parent2.expression.getEnd(); + var expressionOfCallExpressionEndLine = ts2.getLineAndCharacterOfPosition(sourceFile, expressionOfCallExpressionEnd).line; + return expressionOfCallExpressionEndLine === childStartLine; + } + SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; + function childStartsOnTheSameLineWithElseInIfStatement(parent2, child, childStartLine, sourceFile) { + if (parent2.kind === 242 && parent2.elseStatement === child) { + var elseKeyword = ts2.findChildOfKind(parent2, 91, sourceFile); + ts2.Debug.assert(elseKeyword !== void 0); + var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + return elseKeywordStartLine === childStartLine; + } + return false; + } + SmartIndenter2.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function childIsUnindentedBranchOfConditionalExpression(parent2, child, childStartLine, sourceFile) { + if (ts2.isConditionalExpression(parent2) && (child === parent2.whenTrue || child === parent2.whenFalse)) { + var conditionEndLine = ts2.getLineAndCharacterOfPosition(sourceFile, parent2.condition.end).line; + if (child === parent2.whenTrue) { + return childStartLine === conditionEndLine; + } else { + var trueStartLine = getStartLineAndCharacterForNode(parent2.whenTrue, sourceFile).line; + var trueEndLine = ts2.getLineAndCharacterOfPosition(sourceFile, parent2.whenTrue.end).line; + return conditionEndLine === trueStartLine && trueEndLine === childStartLine; + } + } + return false; + } + SmartIndenter2.childIsUnindentedBranchOfConditionalExpression = childIsUnindentedBranchOfConditionalExpression; + function argumentStartsOnSameLineAsPreviousArgument(parent2, child, childStartLine, sourceFile) { + if (ts2.isCallOrNewExpression(parent2)) { + if (!parent2.arguments) + return false; + var currentNode = ts2.find(parent2.arguments, function(arg) { + return arg.pos === child.pos; + }); + if (!currentNode) + return false; + var currentIndex = parent2.arguments.indexOf(currentNode); + if (currentIndex === 0) + return false; + var previousNode = parent2.arguments[currentIndex - 1]; + var lineOfPreviousNode = ts2.getLineAndCharacterOfPosition(sourceFile, previousNode.getEnd()).line; + if (childStartLine === lineOfPreviousNode) { + return true; + } + } + return false; + } + SmartIndenter2.argumentStartsOnSameLineAsPreviousArgument = argumentStartsOnSameLineAsPreviousArgument; + function getContainingList(node, sourceFile) { + return node.parent && getListByRange(node.getStart(sourceFile), node.getEnd(), node.parent, sourceFile); + } + SmartIndenter2.getContainingList = getContainingList; + function getListByPosition(pos, node, sourceFile) { + return node && getListByRange(pos, pos, node, sourceFile); + } + function getListByRange(start, end, node, sourceFile) { + switch (node.kind) { + case 180: + return getList(node.typeArguments); + case 207: + return getList(node.properties); + case 206: + return getList(node.elements); + case 184: + return getList(node.members); + case 259: + case 215: + case 216: + case 171: + case 170: + case 176: + case 173: + case 182: + case 177: + return getList(node.typeParameters) || getList(node.parameters); + case 174: + return getList(node.parameters); + case 260: + case 228: + case 261: + case 262: + case 347: + return getList(node.typeParameters); + case 211: + case 210: + return getList(node.typeArguments) || getList(node.arguments); + case 258: + return getList(node.declarations); + case 272: + case 276: + return getList(node.elements); + case 203: + case 204: + return getList(node.elements); + } + function getList(list) { + return list && ts2.rangeContainsStartEnd(getVisualListRange(node, list, sourceFile), start, end) ? list : void 0; + } + } + function getVisualListRange(node, list, sourceFile) { + var children = node.getChildren(sourceFile); + for (var i7 = 1; i7 < children.length - 1; i7++) { + if (children[i7].pos === list.pos && children[i7].end === list.end) { + return { pos: children[i7 - 1].end, end: children[i7 + 1].getStart(sourceFile) }; + } + } + return list; + } + function getActualIndentationForListStartLine(list, sourceFile, options) { + if (!list) { + return -1; + } + return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); + } + function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { + if (node.parent && node.parent.kind === 258) { + return -1; + } + var containingList = getContainingList(node, sourceFile); + if (containingList) { + var index4 = containingList.indexOf(node); + if (index4 !== -1) { + var result2 = deriveActualIndentationFromList(containingList, index4, sourceFile, options); + if (result2 !== -1) { + return result2; + } + } + return getActualIndentationForListStartLine(containingList, sourceFile, options) + (listIndentsChild ? options.indentSize : 0); + } + return -1; + } + function deriveActualIndentationFromList(list, index4, sourceFile, options) { + ts2.Debug.assert(index4 >= 0 && index4 < list.length); + var node = list[index4]; + var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + for (var i7 = index4 - 1; i7 >= 0; i7--) { + if (list[i7].kind === 27) { + continue; + } + var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i7].end).line; + if (prevEndLine !== lineAndCharacter.line) { + return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); + } + lineAndCharacter = getStartLineAndCharacterForNode(list[i7], sourceFile); + } + return -1; + } + function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { + var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { + var character = 0; + var column = 0; + for (var pos = startPos; pos < endPos; pos++) { + var ch = sourceFile.text.charCodeAt(pos); + if (!ts2.isWhiteSpaceSingleLine(ch)) { + break; + } + if (ch === 9) { + column += options.tabSize + column % options.tabSize; + } else { + column++; + } + character++; + } + return { column, character }; + } + SmartIndenter2.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; + function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { + return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column; + } + SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; + function nodeWillIndentChild(settings, parent2, child, sourceFile, indentByDefault) { + var childKind = child ? child.kind : 0; + switch (parent2.kind) { + case 241: + case 260: + case 228: + case 261: + case 263: + case 262: + case 206: + case 238: + case 265: + case 207: + case 184: + case 197: + case 186: + case 266: + case 293: + case 292: + case 214: + case 208: + case 210: + case 211: + case 240: + case 274: + case 250: + case 224: + case 204: + case 203: + case 283: + case 286: + case 282: + case 291: + case 170: + case 176: + case 177: + case 166: + case 181: + case 182: + case 193: + case 212: + case 220: + case 276: + case 272: + case 278: + case 273: + case 169: + return true; + case 257: + case 299: + case 223: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 207) { + return rangeIsOnOneLine(sourceFile, child); + } + if (parent2.kind === 223 && sourceFile && child && childKind === 281) { + var parentStartLine = sourceFile.getLineAndCharacterOfPosition(ts2.skipTrivia(sourceFile.text, parent2.pos)).line; + var childStartLine = sourceFile.getLineAndCharacterOfPosition(ts2.skipTrivia(sourceFile.text, child.pos)).line; + return parentStartLine !== childStartLine; + } + if (parent2.kind !== 223) { + return true; + } + break; + case 243: + case 244: + case 246: + case 247: + case 245: + case 242: + case 259: + case 215: + case 171: + case 173: + case 174: + case 175: + return childKind !== 238; + case 216: + if (sourceFile && childKind === 214) { + return rangeIsOnOneLine(sourceFile, child); + } + return childKind !== 238; + case 275: + return childKind !== 276; + case 269: + return childKind !== 270 || !!child.namedBindings && child.namedBindings.kind !== 272; + case 281: + return childKind !== 284; + case 285: + return childKind !== 287; + case 190: + case 189: + if (childKind === 184 || childKind === 186) { + return false; + } + break; + } + return indentByDefault; + } + SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; + function isControlFlowEndingStatement(kind, parent2) { + switch (kind) { + case 250: + case 254: + case 248: + case 249: + return parent2.kind !== 238; + default: + return false; + } + } + function shouldIndentChildNode(settings, parent2, child, sourceFile, isNextChild) { + if (isNextChild === void 0) { + isNextChild = false; + } + return nodeWillIndentChild( + settings, + parent2, + child, + sourceFile, + /*indentByDefault*/ + false + ) && !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent2)); + } + SmartIndenter2.shouldIndentChildNode = shouldIndentChildNode; + function rangeIsOnOneLine(sourceFile, range2) { + var rangeStart = ts2.skipTrivia(sourceFile.text, range2.pos); + var startLine = sourceFile.getLineAndCharacterOfPosition(rangeStart).line; + var endLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line; + return startLine === endLine; + } + })(SmartIndenter = formatting2.SmartIndenter || (formatting2.SmartIndenter = {})); + })(formatting = ts2.formatting || (ts2.formatting = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var textChanges; + (function(textChanges_3) { + function getPos(n7) { + var result2 = n7.__pos; + ts2.Debug.assert(typeof result2 === "number"); + return result2; + } + function setPos(n7, pos) { + ts2.Debug.assert(typeof pos === "number"); + n7.__pos = pos; + } + function getEnd(n7) { + var result2 = n7.__end; + ts2.Debug.assert(typeof result2 === "number"); + return result2; + } + function setEnd(n7, end) { + ts2.Debug.assert(typeof end === "number"); + n7.__end = end; + } + var LeadingTriviaOption; + (function(LeadingTriviaOption2) { + LeadingTriviaOption2[LeadingTriviaOption2["Exclude"] = 0] = "Exclude"; + LeadingTriviaOption2[LeadingTriviaOption2["IncludeAll"] = 1] = "IncludeAll"; + LeadingTriviaOption2[LeadingTriviaOption2["JSDoc"] = 2] = "JSDoc"; + LeadingTriviaOption2[LeadingTriviaOption2["StartLine"] = 3] = "StartLine"; + })(LeadingTriviaOption = textChanges_3.LeadingTriviaOption || (textChanges_3.LeadingTriviaOption = {})); + var TrailingTriviaOption; + (function(TrailingTriviaOption2) { + TrailingTriviaOption2[TrailingTriviaOption2["Exclude"] = 0] = "Exclude"; + TrailingTriviaOption2[TrailingTriviaOption2["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; + TrailingTriviaOption2[TrailingTriviaOption2["Include"] = 2] = "Include"; + })(TrailingTriviaOption = textChanges_3.TrailingTriviaOption || (textChanges_3.TrailingTriviaOption = {})); + function skipWhitespacesAndLineBreaks(text, start) { + return ts2.skipTrivia( + text, + start, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + function hasCommentsBeforeLineBreak(text, start) { + var i7 = start; + while (i7 < text.length) { + var ch = text.charCodeAt(i7); + if (ts2.isWhiteSpaceSingleLine(ch)) { + i7++; + continue; + } + return ch === 47; + } + return false; + } + var useNonAdjustedPositions = { + leadingTriviaOption: LeadingTriviaOption.Exclude, + trailingTriviaOption: TrailingTriviaOption.Exclude + }; + var ChangeKind; + (function(ChangeKind2) { + ChangeKind2[ChangeKind2["Remove"] = 0] = "Remove"; + ChangeKind2[ChangeKind2["ReplaceWithSingleNode"] = 1] = "ReplaceWithSingleNode"; + ChangeKind2[ChangeKind2["ReplaceWithMultipleNodes"] = 2] = "ReplaceWithMultipleNodes"; + ChangeKind2[ChangeKind2["Text"] = 3] = "Text"; + })(ChangeKind || (ChangeKind = {})); + function getAdjustedRange(sourceFile, startNode, endNode, options) { + return { pos: getAdjustedStartPosition(sourceFile, startNode, options), end: getAdjustedEndPosition(sourceFile, endNode, options) }; + } + function getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment) { + var _a2, _b; + if (hasTrailingComment === void 0) { + hasTrailingComment = false; + } + var leadingTriviaOption = options.leadingTriviaOption; + if (leadingTriviaOption === LeadingTriviaOption.Exclude) { + return node.getStart(sourceFile); + } + if (leadingTriviaOption === LeadingTriviaOption.StartLine) { + var startPos = node.getStart(sourceFile); + var pos = ts2.getLineStartPositionForPosition(startPos, sourceFile); + return ts2.rangeContainsPosition(node, pos) ? pos : startPos; + } + if (leadingTriviaOption === LeadingTriviaOption.JSDoc) { + var JSDocComments = ts2.getJSDocCommentRanges(node, sourceFile.text); + if (JSDocComments === null || JSDocComments === void 0 ? void 0 : JSDocComments.length) { + return ts2.getLineStartPositionForPosition(JSDocComments[0].pos, sourceFile); + } + } + var fullStart = node.getFullStart(); + var start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + var fullStartLine = ts2.getLineStartPositionForPosition(fullStart, sourceFile); + var startLine = ts2.getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + return leadingTriviaOption === LeadingTriviaOption.IncludeAll ? fullStart : start; + } + if (hasTrailingComment) { + var comment = ((_a2 = ts2.getLeadingCommentRanges(sourceFile.text, fullStart)) === null || _a2 === void 0 ? void 0 : _a2[0]) || ((_b = ts2.getTrailingCommentRanges(sourceFile.text, fullStart)) === null || _b === void 0 ? void 0 : _b[0]); + if (comment) { + return ts2.skipTrivia( + sourceFile.text, + comment.end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + } + } + var nextLineStart = fullStart > 0 ? 1 : 0; + var adjustedStartPosition = ts2.getStartPositionOfLine(ts2.getLineOfLocalPosition(sourceFile, fullStartLine) + nextLineStart, sourceFile); + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return ts2.getStartPositionOfLine(ts2.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + function getEndPositionOfMultilineTrailingComment(sourceFile, node, options) { + var end = node.end; + var trailingTriviaOption = options.trailingTriviaOption; + if (trailingTriviaOption === TrailingTriviaOption.Include) { + var comments = ts2.getTrailingCommentRanges(sourceFile.text, end); + if (comments) { + var nodeEndLine = ts2.getLineOfLocalPosition(sourceFile, node.end); + for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { + var comment = comments_2[_i]; + if (comment.kind === 2 || ts2.getLineOfLocalPosition(sourceFile, comment.pos) > nodeEndLine) { + break; + } + var commentEndLine = ts2.getLineOfLocalPosition(sourceFile, comment.end); + if (commentEndLine > nodeEndLine) { + return ts2.skipTrivia( + sourceFile.text, + comment.end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + } + } + } + } + return void 0; + } + function getAdjustedEndPosition(sourceFile, node, options) { + var _a2; + var end = node.end; + var trailingTriviaOption = options.trailingTriviaOption; + if (trailingTriviaOption === TrailingTriviaOption.Exclude) { + return end; + } + if (trailingTriviaOption === TrailingTriviaOption.ExcludeWhitespace) { + var comments = ts2.concatenate(ts2.getTrailingCommentRanges(sourceFile.text, end), ts2.getLeadingCommentRanges(sourceFile.text, end)); + var realEnd = (_a2 = comments === null || comments === void 0 ? void 0 : comments[comments.length - 1]) === null || _a2 === void 0 ? void 0 : _a2.end; + if (realEnd) { + return realEnd; + } + return end; + } + var multilineEndPosition = getEndPositionOfMultilineTrailingComment(sourceFile, node, options); + if (multilineEndPosition) { + return multilineEndPosition; + } + var newEnd = ts2.skipTrivia( + sourceFile.text, + end, + /*stopAfterLineBreak*/ + true + ); + return newEnd !== end && (trailingTriviaOption === TrailingTriviaOption.Include || ts2.isLineBreak(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end; + } + function isSeparator(node, candidate) { + return !!candidate && !!node.parent && (candidate.kind === 27 || candidate.kind === 26 && node.parent.kind === 207); + } + function isThisTypeAnnotatable(containingFunction) { + return ts2.isFunctionExpression(containingFunction) || ts2.isFunctionDeclaration(containingFunction); + } + textChanges_3.isThisTypeAnnotatable = isThisTypeAnnotatable; + var ChangeTracker = ( + /** @class */ + function() { + function ChangeTracker2(newLineCharacter, formatContext) { + this.newLineCharacter = newLineCharacter; + this.formatContext = formatContext; + this.changes = []; + this.newFiles = []; + this.classesWithNodesInsertedAtStart = new ts2.Map(); + this.deletedNodes = []; + } + ChangeTracker2.fromContext = function(context2) { + return new ChangeTracker2(ts2.getNewLineOrDefaultFromHost(context2.host, context2.formatContext.options), context2.formatContext); + }; + ChangeTracker2.with = function(context2, cb) { + var tracker = ChangeTracker2.fromContext(context2); + cb(tracker); + return tracker.getChanges(); + }; + ChangeTracker2.prototype.pushRaw = function(sourceFile, change) { + ts2.Debug.assertEqual(sourceFile.fileName, change.fileName); + for (var _i = 0, _a2 = change.textChanges; _i < _a2.length; _i++) { + var c7 = _a2[_i]; + this.changes.push({ + kind: ChangeKind.Text, + sourceFile, + text: c7.newText, + range: ts2.createTextRangeFromSpan(c7.span) + }); + } + }; + ChangeTracker2.prototype.deleteRange = function(sourceFile, range2) { + this.changes.push({ kind: ChangeKind.Remove, sourceFile, range: range2 }); + }; + ChangeTracker2.prototype.delete = function(sourceFile, node) { + this.deletedNodes.push({ sourceFile, node }); + }; + ChangeTracker2.prototype.deleteNode = function(sourceFile, node, options) { + if (options === void 0) { + options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; + } + this.deleteRange(sourceFile, getAdjustedRange(sourceFile, node, node, options)); + }; + ChangeTracker2.prototype.deleteNodes = function(sourceFile, nodes, options, hasTrailingComment) { + if (options === void 0) { + options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; + } + for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + var node = nodes_1[_i]; + var pos = getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment); + var end = getAdjustedEndPosition(sourceFile, node, options); + this.deleteRange(sourceFile, { pos, end }); + hasTrailingComment = !!getEndPositionOfMultilineTrailingComment(sourceFile, node, options); + } + }; + ChangeTracker2.prototype.deleteModifier = function(sourceFile, modifier) { + this.deleteRange(sourceFile, { pos: modifier.getStart(sourceFile), end: ts2.skipTrivia( + sourceFile.text, + modifier.end, + /*stopAfterLineBreak*/ + true + ) }); + }; + ChangeTracker2.prototype.deleteNodeRange = function(sourceFile, startNode, endNode, options) { + if (options === void 0) { + options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; + } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options); + var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + }; + ChangeTracker2.prototype.deleteNodeRangeExcludingEnd = function(sourceFile, startNode, afterEndNode, options) { + if (options === void 0) { + options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; + } + var startPosition = getAdjustedStartPosition(sourceFile, startNode, options); + var endPosition = afterEndNode === void 0 ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + }; + ChangeTracker2.prototype.replaceRange = function(sourceFile, range2, newNode, options) { + if (options === void 0) { + options = {}; + } + this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range: range2, options, node: newNode }); + }; + ChangeTracker2.prototype.replaceNode = function(sourceFile, oldNode, newNode, options) { + if (options === void 0) { + options = useNonAdjustedPositions; + } + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + }; + ChangeTracker2.prototype.replaceNodeRange = function(sourceFile, startNode, endNode, newNode, options) { + if (options === void 0) { + options = useNonAdjustedPositions; + } + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNode, options); + }; + ChangeTracker2.prototype.replaceRangeWithNodes = function(sourceFile, range2, newNodes, options) { + if (options === void 0) { + options = {}; + } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile, range: range2, options, nodes: newNodes }); + }; + ChangeTracker2.prototype.replaceNodeWithNodes = function(sourceFile, oldNode, newNodes, options) { + if (options === void 0) { + options = useNonAdjustedPositions; + } + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + }; + ChangeTracker2.prototype.replaceNodeWithText = function(sourceFile, oldNode, text) { + this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, useNonAdjustedPositions), text); + }; + ChangeTracker2.prototype.replaceNodeRangeWithNodes = function(sourceFile, startNode, endNode, newNodes, options) { + if (options === void 0) { + options = useNonAdjustedPositions; + } + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode, endNode, options), newNodes, options); + }; + ChangeTracker2.prototype.nodeHasTrailingComment = function(sourceFile, oldNode, configurableEnd) { + if (configurableEnd === void 0) { + configurableEnd = useNonAdjustedPositions; + } + return !!getEndPositionOfMultilineTrailingComment(sourceFile, oldNode, configurableEnd); + }; + ChangeTracker2.prototype.nextCommaToken = function(sourceFile, node) { + var next = ts2.findNextToken(node, node.parent, sourceFile); + return next && next.kind === 27 ? next : void 0; + }; + ChangeTracker2.prototype.replacePropertyAssignment = function(sourceFile, oldNode, newNode) { + var suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : "," + this.newLineCharacter; + this.replaceNode(sourceFile, oldNode, newNode, { suffix }); + }; + ChangeTracker2.prototype.insertNodeAt = function(sourceFile, pos, newNode, options) { + if (options === void 0) { + options = {}; + } + this.replaceRange(sourceFile, ts2.createRange(pos), newNode, options); + }; + ChangeTracker2.prototype.insertNodesAt = function(sourceFile, pos, newNodes, options) { + if (options === void 0) { + options = {}; + } + this.replaceRangeWithNodes(sourceFile, ts2.createRange(pos), newNodes, options); + }; + ChangeTracker2.prototype.insertNodeAtTopOfFile = function(sourceFile, newNode, blankLineBetween) { + this.insertAtTopOfFile(sourceFile, newNode, blankLineBetween); + }; + ChangeTracker2.prototype.insertNodesAtTopOfFile = function(sourceFile, newNodes, blankLineBetween) { + this.insertAtTopOfFile(sourceFile, newNodes, blankLineBetween); + }; + ChangeTracker2.prototype.insertAtTopOfFile = function(sourceFile, insert, blankLineBetween) { + var pos = getInsertionPositionAtSourceFileTop(sourceFile); + var options = { + prefix: pos === 0 ? void 0 : this.newLineCharacter, + suffix: (ts2.isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : "") + }; + if (ts2.isArray(insert)) { + this.insertNodesAt(sourceFile, pos, insert, options); + } else { + this.insertNodeAt(sourceFile, pos, insert, options); + } + }; + ChangeTracker2.prototype.insertFirstParameter = function(sourceFile, parameters, newParam) { + var p0 = ts2.firstOrUndefined(parameters); + if (p0) { + this.insertNodeBefore(sourceFile, p0, newParam); + } else { + this.insertNodeAt(sourceFile, parameters.pos, newParam); + } + }; + ChangeTracker2.prototype.insertNodeBefore = function(sourceFile, before2, newNode, blankLineBetween, options) { + if (blankLineBetween === void 0) { + blankLineBetween = false; + } + if (options === void 0) { + options = {}; + } + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before2, options), newNode, this.getOptionsForInsertNodeBefore(before2, newNode, blankLineBetween)); + }; + ChangeTracker2.prototype.insertModifierAt = function(sourceFile, pos, modifier, options) { + if (options === void 0) { + options = {}; + } + this.insertNodeAt(sourceFile, pos, ts2.factory.createToken(modifier), options); + }; + ChangeTracker2.prototype.insertModifierBefore = function(sourceFile, modifier, before2) { + return this.insertModifierAt(sourceFile, before2.getStart(sourceFile), modifier, { suffix: " " }); + }; + ChangeTracker2.prototype.insertCommentBeforeLine = function(sourceFile, lineNumber, position, commentText) { + var lineStartPosition = ts2.getStartPositionOfLine(lineNumber, sourceFile); + var startPosition = ts2.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition); + var token = ts2.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position); + var indent = sourceFile.text.slice(lineStartPosition, startPosition); + var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent); + this.insertText(sourceFile, token.getStart(sourceFile), text); + }; + ChangeTracker2.prototype.insertJsdocCommentBefore = function(sourceFile, node, tag) { + var fnStart = node.getStart(sourceFile); + if (node.jsDoc) { + for (var _i = 0, _a2 = node.jsDoc; _i < _a2.length; _i++) { + var jsdoc = _a2[_i]; + this.deleteRange(sourceFile, { + pos: ts2.getLineStartPositionForPosition(jsdoc.getStart(sourceFile), sourceFile), + end: getAdjustedEndPosition( + sourceFile, + jsdoc, + /*options*/ + {} + ) + }); + } + } + var startPosition = ts2.getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1); + var indent = sourceFile.text.slice(startPosition, fnStart); + this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent }); + }; + ChangeTracker2.prototype.createJSDocText = function(sourceFile, node) { + var comments = ts2.flatMap(node.jsDoc, function(jsDoc2) { + return ts2.isString(jsDoc2.comment) ? ts2.factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment; + }); + var jsDoc = ts2.singleOrUndefined(node.jsDoc); + return jsDoc && ts2.positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && ts2.length(comments) === 0 ? void 0 : ts2.factory.createNodeArray(ts2.intersperse(comments, ts2.factory.createJSDocText("\n"))); + }; + ChangeTracker2.prototype.replaceJSDocComment = function(sourceFile, node, tags6) { + this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), ts2.factory.createJSDocComment(this.createJSDocText(sourceFile, node), ts2.factory.createNodeArray(tags6))); + }; + ChangeTracker2.prototype.addJSDocTags = function(sourceFile, parent2, newTags) { + var oldTags = ts2.flatMapToMutable(parent2.jsDoc, function(j6) { + return j6.tags; + }); + var unmergedNewTags = newTags.filter(function(newTag) { + return !oldTags.some(function(tag, i7) { + var merged = tryMergeJsdocTags(tag, newTag); + if (merged) + oldTags[i7] = merged; + return !!merged; + }); + }); + this.replaceJSDocComment(sourceFile, parent2, __spreadArray9(__spreadArray9([], oldTags, true), unmergedNewTags, true)); + }; + ChangeTracker2.prototype.filterJSDocTags = function(sourceFile, parent2, predicate) { + this.replaceJSDocComment(sourceFile, parent2, ts2.filter(ts2.flatMapToMutable(parent2.jsDoc, function(j6) { + return j6.tags; + }), predicate)); + }; + ChangeTracker2.prototype.replaceRangeWithText = function(sourceFile, range2, text) { + this.changes.push({ kind: ChangeKind.Text, sourceFile, range: range2, text }); + }; + ChangeTracker2.prototype.insertText = function(sourceFile, pos, text) { + this.replaceRangeWithText(sourceFile, ts2.createRange(pos), text); + }; + ChangeTracker2.prototype.tryInsertTypeAnnotation = function(sourceFile, node, type3) { + var _a2; + var endNode; + if (ts2.isFunctionLike(node)) { + endNode = ts2.findChildOfKind(node, 21, sourceFile); + if (!endNode) { + if (!ts2.isArrowFunction(node)) + return false; + endNode = ts2.first(node.parameters); + } + } else { + endNode = (_a2 = node.kind === 257 ? node.exclamationToken : node.questionToken) !== null && _a2 !== void 0 ? _a2 : node.name; + } + this.insertNodeAt(sourceFile, endNode.end, type3, { prefix: ": " }); + return true; + }; + ChangeTracker2.prototype.tryInsertThisTypeAnnotation = function(sourceFile, node, type3) { + var start = ts2.findChildOfKind(node, 20, sourceFile).getStart(sourceFile) + 1; + var suffix = node.parameters.length ? ", " : ""; + this.insertNodeAt(sourceFile, start, type3, { prefix: "this: ", suffix }); + }; + ChangeTracker2.prototype.insertTypeParameters = function(sourceFile, node, typeParameters) { + var start = (ts2.findChildOfKind(node, 20, sourceFile) || ts2.first(node.parameters)).getStart(sourceFile); + this.insertNodesAt(sourceFile, start, typeParameters, { prefix: "<", suffix: ">", joiner: ", " }); + }; + ChangeTracker2.prototype.getOptionsForInsertNodeBefore = function(before2, inserted, blankLineBetween) { + if (ts2.isStatement(before2) || ts2.isClassElement(before2)) { + return { suffix: blankLineBetween ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } else if (ts2.isVariableDeclaration(before2)) { + return { suffix: ", " }; + } else if (ts2.isParameter(before2)) { + return ts2.isParameter(inserted) ? { suffix: ", " } : {}; + } else if (ts2.isStringLiteral(before2) && ts2.isImportDeclaration(before2.parent) || ts2.isNamedImports(before2)) { + return { suffix: ", " }; + } else if (ts2.isImportSpecifier(before2)) { + return { suffix: "," + (blankLineBetween ? this.newLineCharacter : " ") }; + } + return ts2.Debug.failBadSyntaxKind(before2); + }; + ChangeTracker2.prototype.insertNodeAtConstructorStart = function(sourceFile, ctr, newStatement) { + var firstStatement = ts2.firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, __spreadArray9([newStatement], ctr.body.statements, true)); + } else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + }; + ChangeTracker2.prototype.insertNodeAtConstructorStartAfterSuperCall = function(sourceFile, ctr, newStatement) { + var superCallStatement = ts2.find(ctr.body.statements, function(stmt) { + return ts2.isExpressionStatement(stmt) && ts2.isSuperCall(stmt.expression); + }); + if (!superCallStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, __spreadArray9(__spreadArray9([], ctr.body.statements, true), [newStatement], false)); + } else { + this.insertNodeAfter(sourceFile, superCallStatement, newStatement); + } + }; + ChangeTracker2.prototype.insertNodeAtConstructorEnd = function(sourceFile, ctr, newStatement) { + var lastStatement = ts2.lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, __spreadArray9(__spreadArray9([], ctr.body.statements, true), [newStatement], false)); + } else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + }; + ChangeTracker2.prototype.replaceConstructorBody = function(sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, ts2.factory.createBlock( + statements, + /*multiLine*/ + true + )); + }; + ChangeTracker2.prototype.insertNodeAtEndOfScope = function(sourceFile, scope, newNode) { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: ts2.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + }; + ChangeTracker2.prototype.insertMemberAtStart = function(sourceFile, node, newElement) { + this.insertNodeAtStartWorker(sourceFile, node, newElement); + }; + ChangeTracker2.prototype.insertNodeAtObjectStart = function(sourceFile, obj, newElement) { + this.insertNodeAtStartWorker(sourceFile, obj, newElement); + }; + ChangeTracker2.prototype.insertNodeAtStartWorker = function(sourceFile, node, newElement) { + var _a2; + var indentation = (_a2 = this.guessIndentationFromExistingMembers(sourceFile, node)) !== null && _a2 !== void 0 ? _a2 : this.computeIndentationForNewMember(sourceFile, node); + this.insertNodeAt(sourceFile, getMembersOrProperties(node).pos, newElement, this.getInsertNodeAtStartInsertOptions(sourceFile, node, indentation)); + }; + ChangeTracker2.prototype.guessIndentationFromExistingMembers = function(sourceFile, node) { + var indentation; + var lastRange = node; + for (var _i = 0, _a2 = getMembersOrProperties(node); _i < _a2.length; _i++) { + var member = _a2[_i]; + if (ts2.rangeStartPositionsAreOnSameLine(lastRange, member, sourceFile)) { + return void 0; + } + var memberStart = member.getStart(sourceFile); + var memberIndentation = ts2.formatting.SmartIndenter.findFirstNonWhitespaceColumn(ts2.getLineStartPositionForPosition(memberStart, sourceFile), memberStart, sourceFile, this.formatContext.options); + if (indentation === void 0) { + indentation = memberIndentation; + } else if (memberIndentation !== indentation) { + return void 0; + } + lastRange = member; + } + return indentation; + }; + ChangeTracker2.prototype.computeIndentationForNewMember = function(sourceFile, node) { + var _a2; + var nodeStart = node.getStart(sourceFile); + return ts2.formatting.SmartIndenter.findFirstNonWhitespaceColumn(ts2.getLineStartPositionForPosition(nodeStart, sourceFile), nodeStart, sourceFile, this.formatContext.options) + ((_a2 = this.formatContext.options.indentSize) !== null && _a2 !== void 0 ? _a2 : 4); + }; + ChangeTracker2.prototype.getInsertNodeAtStartInsertOptions = function(sourceFile, node, indentation) { + var members = getMembersOrProperties(node); + var isEmpty4 = members.length === 0; + var isFirstInsertion = ts2.addToSeen(this.classesWithNodesInsertedAtStart, ts2.getNodeId(node), { node, sourceFile }); + var insertTrailingComma = ts2.isObjectLiteralExpression(node) && (!ts2.isJsonSourceFile(sourceFile) || !isEmpty4); + var insertLeadingComma = ts2.isObjectLiteralExpression(node) && ts2.isJsonSourceFile(sourceFile) && isEmpty4 && !isFirstInsertion; + return { + indentation, + prefix: (insertLeadingComma ? "," : "") + this.newLineCharacter, + suffix: insertTrailingComma ? "," : ts2.isInterfaceDeclaration(node) && isEmpty4 ? ";" : "" + }; + }; + ChangeTracker2.prototype.insertNodeAfterComma = function(sourceFile, after2, newNode) { + var endPosition = this.insertNodeAfterWorker(sourceFile, this.nextCommaToken(sourceFile, after2) || after2, newNode); + this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after2)); + }; + ChangeTracker2.prototype.insertNodeAfter = function(sourceFile, after2, newNode) { + var endPosition = this.insertNodeAfterWorker(sourceFile, after2, newNode); + this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after2)); + }; + ChangeTracker2.prototype.insertNodeAtEndOfList = function(sourceFile, list, newNode) { + this.insertNodeAt(sourceFile, list.end, newNode, { prefix: ", " }); + }; + ChangeTracker2.prototype.insertNodesAfter = function(sourceFile, after2, newNodes) { + var endPosition = this.insertNodeAfterWorker(sourceFile, after2, ts2.first(newNodes)); + this.insertNodesAt(sourceFile, endPosition, newNodes, this.getInsertNodeAfterOptions(sourceFile, after2)); + }; + ChangeTracker2.prototype.insertNodeAfterWorker = function(sourceFile, after2, newNode) { + if (needSemicolonBetween(after2, newNode)) { + if (sourceFile.text.charCodeAt(after2.end - 1) !== 59) { + this.replaceRange(sourceFile, ts2.createRange(after2.end), ts2.factory.createToken( + 26 + /* SyntaxKind.SemicolonToken */ + )); + } + } + var endPosition = getAdjustedEndPosition(sourceFile, after2, {}); + return endPosition; + }; + ChangeTracker2.prototype.getInsertNodeAfterOptions = function(sourceFile, after2) { + var options = this.getInsertNodeAfterOptionsWorker(after2); + return __assign16(__assign16({}, options), { prefix: after2.end === sourceFile.end && ts2.isStatement(after2) ? options.prefix ? "\n".concat(options.prefix) : "\n" : options.prefix }); + }; + ChangeTracker2.prototype.getInsertNodeAfterOptionsWorker = function(node) { + switch (node.kind) { + case 260: + case 264: + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + case 257: + case 10: + case 79: + return { prefix: ", " }; + case 299: + return { suffix: "," + this.newLineCharacter }; + case 93: + return { prefix: " " }; + case 166: + return {}; + default: + ts2.Debug.assert(ts2.isStatement(node) || ts2.isClassOrTypeElement(node)); + return { suffix: this.newLineCharacter }; + } + }; + ChangeTracker2.prototype.insertName = function(sourceFile, node, name2) { + ts2.Debug.assert(!node.name); + if (node.kind === 216) { + var arrow = ts2.findChildOfKind(node, 38, sourceFile); + var lparen = ts2.findChildOfKind(node, 20, sourceFile); + if (lparen) { + this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [ts2.factory.createToken( + 98 + /* SyntaxKind.FunctionKeyword */ + ), ts2.factory.createIdentifier(name2)], { joiner: " " }); + deleteNode(this, sourceFile, arrow); + } else { + this.insertText(sourceFile, ts2.first(node.parameters).getStart(sourceFile), "function ".concat(name2, "(")); + this.replaceRange(sourceFile, arrow, ts2.factory.createToken( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + if (node.body.kind !== 238) { + this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [ts2.factory.createToken( + 18 + /* SyntaxKind.OpenBraceToken */ + ), ts2.factory.createToken( + 105 + /* SyntaxKind.ReturnKeyword */ + )], { joiner: " ", suffix: " " }); + this.insertNodesAt(sourceFile, node.body.end, [ts2.factory.createToken( + 26 + /* SyntaxKind.SemicolonToken */ + ), ts2.factory.createToken( + 19 + /* SyntaxKind.CloseBraceToken */ + )], { joiner: " " }); + } + } else { + var pos = ts2.findChildOfKind(node, node.kind === 215 ? 98 : 84, sourceFile).end; + this.insertNodeAt(sourceFile, pos, ts2.factory.createIdentifier(name2), { prefix: " " }); + } + }; + ChangeTracker2.prototype.insertExportModifier = function(sourceFile, node) { + this.insertText(sourceFile, node.getStart(sourceFile), "export "); + }; + ChangeTracker2.prototype.insertImportSpecifierAtIndex = function(sourceFile, importSpecifier, namedImports, index4) { + var prevSpecifier = namedImports.elements[index4 - 1]; + if (prevSpecifier) { + this.insertNodeInListAfter(sourceFile, prevSpecifier, importSpecifier); + } else { + this.insertNodeBefore(sourceFile, namedImports.elements[0], importSpecifier, !ts2.positionsAreOnSameLine(namedImports.elements[0].getStart(), namedImports.parent.parent.getStart(), sourceFile)); + } + }; + ChangeTracker2.prototype.insertNodeInListAfter = function(sourceFile, after2, newNode, containingList) { + if (containingList === void 0) { + containingList = ts2.formatting.SmartIndenter.getContainingList(after2, sourceFile); + } + if (!containingList) { + ts2.Debug.fail("node is not a list element"); + return; + } + var index4 = ts2.indexOfNode(containingList, after2); + if (index4 < 0) { + return; + } + var end = after2.getEnd(); + if (index4 !== containingList.length - 1) { + var nextToken = ts2.getTokenAtPosition(sourceFile, after2.end); + if (nextToken && isSeparator(after2, nextToken)) { + var nextNode = containingList[index4 + 1]; + var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart()); + var suffix = "".concat(ts2.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos)); + this.insertNodesAt(sourceFile, startPos, [newNode], { suffix }); + } + } else { + var afterStart = after2.getStart(sourceFile); + var afterStartLinePosition = ts2.getLineStartPositionForPosition(afterStart, sourceFile); + var separator = void 0; + var multilineList = false; + if (containingList.length === 1) { + separator = 27; + } else { + var tokenBeforeInsertPosition = ts2.findPrecedingToken(after2.pos, sourceFile); + separator = isSeparator(after2, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 27; + var afterMinusOneStartLinePosition = ts2.getLineStartPositionForPosition(containingList[index4 - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after2.end)) { + multilineList = true; + } + if (multilineList) { + this.replaceRange(sourceFile, ts2.createRange(end), ts2.factory.createToken(separator)); + var indentation = ts2.formatting.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.formatContext.options); + var insertPos = ts2.skipTrivia( + sourceFile.text, + end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + false + ); + while (insertPos !== end && ts2.isLineBreak(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.replaceRange(sourceFile, ts2.createRange(insertPos), newNode, { indentation, prefix: this.newLineCharacter }); + } else { + this.replaceRange(sourceFile, ts2.createRange(end), newNode, { prefix: "".concat(ts2.tokenToString(separator), " ") }); + } + } + }; + ChangeTracker2.prototype.parenthesizeExpression = function(sourceFile, expression) { + this.replaceRange(sourceFile, ts2.rangeOfNode(expression), ts2.factory.createParenthesizedExpression(expression)); + }; + ChangeTracker2.prototype.finishClassesWithNodesInsertedAtStart = function() { + var _this = this; + this.classesWithNodesInsertedAtStart.forEach(function(_a2) { + var node = _a2.node, sourceFile = _a2.sourceFile; + var _b = getClassOrObjectBraceEnds(node, sourceFile), openBraceEnd = _b[0], closeBraceEnd = _b[1]; + if (openBraceEnd !== void 0 && closeBraceEnd !== void 0) { + var isEmpty4 = getMembersOrProperties(node).length === 0; + var isSingleLine = ts2.positionsAreOnSameLine(openBraceEnd, closeBraceEnd, sourceFile); + if (isEmpty4 && isSingleLine && openBraceEnd !== closeBraceEnd - 1) { + _this.deleteRange(sourceFile, ts2.createRange(openBraceEnd, closeBraceEnd - 1)); + } + if (isSingleLine) { + _this.insertText(sourceFile, closeBraceEnd - 1, _this.newLineCharacter); + } + } + }); + }; + ChangeTracker2.prototype.finishDeleteDeclarations = function() { + var _this = this; + var deletedNodesInLists = new ts2.Set(); + var _loop_9 = function(sourceFile2, node2) { + if (!this_1.deletedNodes.some(function(d7) { + return d7.sourceFile === sourceFile2 && ts2.rangeContainsRangeExclusive(d7.node, node2); + })) { + if (ts2.isArray(node2)) { + this_1.deleteRange(sourceFile2, ts2.rangeOfTypeParameters(sourceFile2, node2)); + } else { + deleteDeclaration.deleteDeclaration(this_1, deletedNodesInLists, sourceFile2, node2); + } + } + }; + var this_1 = this; + for (var _i = 0, _a2 = this.deletedNodes; _i < _a2.length; _i++) { + var _b = _a2[_i], sourceFile = _b.sourceFile, node = _b.node; + _loop_9(sourceFile, node); + } + deletedNodesInLists.forEach(function(node2) { + var sourceFile2 = node2.getSourceFile(); + var list = ts2.formatting.SmartIndenter.getContainingList(node2, sourceFile2); + if (node2 !== ts2.last(list)) + return; + var lastNonDeletedIndex = ts2.findLastIndex(list, function(n7) { + return !deletedNodesInLists.has(n7); + }, list.length - 2); + if (lastNonDeletedIndex !== -1) { + _this.deleteRange(sourceFile2, { pos: list[lastNonDeletedIndex].end, end: startPositionToDeleteNodeInList(sourceFile2, list[lastNonDeletedIndex + 1]) }); + } + }); + }; + ChangeTracker2.prototype.getChanges = function(validate15) { + this.finishDeleteDeclarations(); + this.finishClassesWithNodesInsertedAtStart(); + var changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate15); + for (var _i = 0, _a2 = this.newFiles; _i < _a2.length; _i++) { + var _b = _a2[_i], oldFile = _b.oldFile, fileName = _b.fileName, statements = _b.statements; + changes.push(changesToText.newFileChanges(oldFile, fileName, statements, this.newLineCharacter, this.formatContext)); + } + return changes; + }; + ChangeTracker2.prototype.createNewFile = function(oldFile, fileName, statements) { + this.newFiles.push({ oldFile, fileName, statements }); + }; + return ChangeTracker2; + }() + ); + textChanges_3.ChangeTracker = ChangeTracker; + function updateJSDocHost(parent2) { + if (parent2.kind !== 216) { + return parent2; + } + var jsDocNode = parent2.parent.kind === 169 ? parent2.parent : parent2.parent.parent; + jsDocNode.jsDoc = parent2.jsDoc; + jsDocNode.jsDocCache = parent2.jsDocCache; + return jsDocNode; + } + function tryMergeJsdocTags(oldTag, newTag) { + if (oldTag.kind !== newTag.kind) { + return void 0; + } + switch (oldTag.kind) { + case 343: { + var oldParam = oldTag; + var newParam = newTag; + return ts2.isIdentifier(oldParam.name) && ts2.isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? ts2.factory.createJSDocParameterTag( + /*tagName*/ + void 0, + newParam.name, + /*isBracketed*/ + false, + newParam.typeExpression, + newParam.isNameFirst, + oldParam.comment + ) : void 0; + } + case 344: + return ts2.factory.createJSDocReturnTag( + /*tagName*/ + void 0, + newTag.typeExpression, + oldTag.comment + ); + case 346: + return ts2.factory.createJSDocTypeTag( + /*tagName*/ + void 0, + newTag.typeExpression, + oldTag.comment + ); + } + } + function startPositionToDeleteNodeInList(sourceFile, node) { + return ts2.skipTrivia( + sourceFile.text, + getAdjustedStartPosition(sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.IncludeAll }), + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + function endPositionToDeleteNodeInList(sourceFile, node, prevNode, nextNode) { + var end = startPositionToDeleteNodeInList(sourceFile, nextNode); + if (prevNode === void 0 || ts2.positionsAreOnSameLine(getAdjustedEndPosition(sourceFile, node, {}), end, sourceFile)) { + return end; + } + var token = ts2.findPrecedingToken(nextNode.getStart(sourceFile), sourceFile); + if (isSeparator(node, token)) { + var prevToken = ts2.findPrecedingToken(node.getStart(sourceFile), sourceFile); + if (isSeparator(prevNode, prevToken)) { + var pos = ts2.skipTrivia( + sourceFile.text, + token.getEnd(), + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + if (ts2.positionsAreOnSameLine(prevToken.getStart(sourceFile), token.getStart(sourceFile), sourceFile)) { + return ts2.isLineBreak(sourceFile.text.charCodeAt(pos - 1)) ? pos - 1 : pos; + } + if (ts2.isLineBreak(sourceFile.text.charCodeAt(pos))) { + return pos; + } + } + } + return end; + } + function getClassOrObjectBraceEnds(cls, sourceFile) { + var open2 = ts2.findChildOfKind(cls, 18, sourceFile); + var close = ts2.findChildOfKind(cls, 19, sourceFile); + return [open2 === null || open2 === void 0 ? void 0 : open2.end, close === null || close === void 0 ? void 0 : close.end]; + } + function getMembersOrProperties(node) { + return ts2.isObjectLiteralExpression(node) ? node.properties : node.members; + } + function getNewFileText(statements, scriptKind, newLineCharacter, formatContext) { + return changesToText.newFileChangesWorker( + /*oldFile*/ + void 0, + scriptKind, + statements, + newLineCharacter, + formatContext + ); + } + textChanges_3.getNewFileText = getNewFileText; + var changesToText; + (function(changesToText2) { + function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate15) { + return ts2.mapDefined(ts2.group(changes, function(c7) { + return c7.sourceFile.path; + }), function(changesInFile) { + var sourceFile = changesInFile[0].sourceFile; + var normalized = ts2.stableSort(changesInFile, function(a7, b8) { + return a7.range.pos - b8.range.pos || a7.range.end - b8.range.end; + }); + var _loop_10 = function(i8) { + ts2.Debug.assert(normalized[i8].range.end <= normalized[i8 + 1].range.pos, "Changes overlap", function() { + return "".concat(JSON.stringify(normalized[i8].range), " and ").concat(JSON.stringify(normalized[i8 + 1].range)); + }); + }; + for (var i7 = 0; i7 < normalized.length - 1; i7++) { + _loop_10(i7); + } + var textChanges2 = ts2.mapDefined(normalized, function(c7) { + var span = ts2.createTextSpanFromRange(c7.range); + var newText = computeNewText(c7, sourceFile, newLineCharacter, formatContext, validate15); + if (span.length === newText.length && ts2.stringContainsAt(sourceFile.text, newText, span.start)) { + return void 0; + } + return ts2.createTextChange(span, newText); + }); + return textChanges2.length > 0 ? { fileName: sourceFile.fileName, textChanges: textChanges2 } : void 0; + }); + } + changesToText2.getTextChangesFromChanges = getTextChangesFromChanges; + function newFileChanges(oldFile, fileName, statements, newLineCharacter, formatContext) { + var text = newFileChangesWorker(oldFile, ts2.getScriptKindFromFileName(fileName), statements, newLineCharacter, formatContext); + return { fileName, textChanges: [ts2.createTextChange(ts2.createTextSpan(0, 0), text)], isNewFile: true }; + } + changesToText2.newFileChanges = newFileChanges; + function newFileChangesWorker(oldFile, scriptKind, statements, newLineCharacter, formatContext) { + var nonFormattedText = statements.map(function(s7) { + return s7 === 4 ? "" : getNonformattedText(s7, oldFile, newLineCharacter).text; + }).join(newLineCharacter); + var sourceFile = ts2.createSourceFile( + "any file name", + nonFormattedText, + 99, + /*setParentNodes*/ + true, + scriptKind + ); + var changes = ts2.formatting.formatDocument(sourceFile, formatContext); + return applyChanges(nonFormattedText, changes) + newLineCharacter; + } + changesToText2.newFileChangesWorker = newFileChangesWorker; + function computeNewText(change, sourceFile, newLineCharacter, formatContext, validate15) { + var _a2; + if (change.kind === ChangeKind.Remove) { + return ""; + } + if (change.kind === ChangeKind.Text) { + return change.text; + } + var _b = change.options, options = _b === void 0 ? {} : _b, pos = change.range.pos; + var format5 = function(n7) { + return getFormattedTextOfNode(n7, sourceFile, pos, options, newLineCharacter, formatContext, validate15); + }; + var text = change.kind === ChangeKind.ReplaceWithMultipleNodes ? change.nodes.map(function(n7) { + return ts2.removeSuffix(format5(n7), newLineCharacter); + }).join(((_a2 = change.options) === null || _a2 === void 0 ? void 0 : _a2.joiner) || newLineCharacter) : format5(change.node); + var noIndent = options.indentation !== void 0 || ts2.getLineStartPositionForPosition(pos, sourceFile) === pos ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + noIndent + (!options.suffix || ts2.endsWith(noIndent, options.suffix) ? "" : options.suffix); + } + function getFormattedTextOfNode(nodeIn, sourceFile, pos, _a2, newLineCharacter, formatContext, validate15) { + var indentation = _a2.indentation, prefix = _a2.prefix, delta = _a2.delta; + var _b = getNonformattedText(nodeIn, sourceFile, newLineCharacter), node = _b.node, text = _b.text; + if (validate15) + validate15(node, text); + var formatOptions = ts2.getFormatCodeSettingsForWriting(formatContext, sourceFile); + var initialIndentation = indentation !== void 0 ? indentation : ts2.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, prefix === newLineCharacter || ts2.getLineStartPositionForPosition(pos, sourceFile) === pos); + if (delta === void 0) { + delta = ts2.formatting.SmartIndenter.shouldIndentChildNode(formatOptions, nodeIn) ? formatOptions.indentSize || 0 : 0; + } + var file = { + text, + getLineAndCharacterOfPosition: function(pos2) { + return ts2.getLineAndCharacterOfPosition(this, pos2); + } + }; + var changes = ts2.formatting.formatNodeGivenIndentation(node, file, sourceFile.languageVariant, initialIndentation, delta, __assign16(__assign16({}, formatContext), { options: formatOptions })); + return applyChanges(text, changes); + } + function getNonformattedText(node, sourceFile, newLineCharacter) { + var writer = createWriter(newLineCharacter); + var newLine = ts2.getNewLineKind(newLineCharacter); + ts2.createPrinter({ + newLine, + neverAsciiEscape: true, + preserveSourceNewlines: true, + terminateUnterminatedLiterals: true + }, writer).writeNode(4, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + changesToText2.getNonformattedText = getNonformattedText; + })(changesToText || (changesToText = {})); + function applyChanges(text, changes) { + for (var i7 = changes.length - 1; i7 >= 0; i7--) { + var _a2 = changes[i7], span = _a2.span, newText = _a2.newText; + text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts2.textSpanEnd(span))); + } + return text; + } + textChanges_3.applyChanges = applyChanges; + function isTrivia(s7) { + return ts2.skipTrivia(s7, 0) === s7.length; + } + var textChangesTransformationContext = __assign16(__assign16({}, ts2.nullTransformationContext), { factory: ts2.createNodeFactory(ts2.nullTransformationContext.factory.flags | 1, ts2.nullTransformationContext.factory.baseFactory) }); + function assignPositionsToNode(node) { + var visited = ts2.visitEachChild(node, assignPositionsToNode, textChangesTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + var newNode = ts2.nodeIsSynthesized(visited) ? visited : Object.create(visited); + ts2.setTextRangePosEnd(newNode, getPos(node), getEnd(node)); + return newNode; + } + textChanges_3.assignPositionsToNode = assignPositionsToNode; + function assignPositionsToNodeArray(nodes, visitor, test, start, count2) { + var visited = ts2.visitNodes(nodes, visitor, test, start, count2); + if (!visited) { + return visited; + } + var nodeArray = visited === nodes ? ts2.factory.createNodeArray(visited.slice(0)) : visited; + ts2.setTextRangePosEnd(nodeArray, getPos(nodes), getEnd(nodes)); + return nodeArray; + } + function createWriter(newLine) { + var lastNonTriviaPosition = 0; + var writer = ts2.createTextWriter(newLine); + var onBeforeEmitNode = function(node) { + if (node) { + setPos(node, lastNonTriviaPosition); + } + }; + var onAfterEmitNode = function(node) { + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + var onBeforeEmitNodeArray = function(nodes) { + if (nodes) { + setPos(nodes, lastNonTriviaPosition); + } + }; + var onAfterEmitNodeArray = function(nodes) { + if (nodes) { + setEnd(nodes, lastNonTriviaPosition); + } + }; + var onBeforeEmitToken = function(node) { + if (node) { + setPos(node, lastNonTriviaPosition); + } + }; + var onAfterEmitToken = function(node) { + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + function setLastNonTriviaPosition(s7, force) { + if (force || !isTrivia(s7)) { + lastNonTriviaPosition = writer.getTextPos(); + var i7 = 0; + while (ts2.isWhiteSpaceLike(s7.charCodeAt(s7.length - i7 - 1))) { + i7++; + } + lastNonTriviaPosition -= i7; + } + } + function write(s7) { + writer.write(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeComment(s7) { + writer.writeComment(s7); + } + function writeKeyword(s7) { + writer.writeKeyword(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeOperator(s7) { + writer.writeOperator(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writePunctuation(s7) { + writer.writePunctuation(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeTrailingSemicolon(s7) { + writer.writeTrailingSemicolon(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeParameter(s7) { + writer.writeParameter(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeProperty(s7) { + writer.writeProperty(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeSpace(s7) { + writer.writeSpace(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeStringLiteral(s7) { + writer.writeStringLiteral(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeSymbol(s7, sym) { + writer.writeSymbol(s7, sym); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeLine(force) { + writer.writeLine(force); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function getText() { + return writer.getText(); + } + function rawWrite(s7) { + writer.rawWrite(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeLiteral(s7) { + writer.writeLiteral(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + true + ); + } + function getTextPos() { + return writer.getTextPos(); + } + function getLine2() { + return writer.getLine(); + } + function getColumn() { + return writer.getColumn(); + } + function getIndent() { + return writer.getIndent(); + } + function isAtStartOfLine() { + return writer.isAtStartOfLine(); + } + function clear2() { + writer.clear(); + lastNonTriviaPosition = 0; + } + return { + onBeforeEmitNode, + onAfterEmitNode, + onBeforeEmitNodeArray, + onAfterEmitNodeArray, + onBeforeEmitToken, + onAfterEmitToken, + write, + writeComment, + writeKeyword, + writeOperator, + writePunctuation, + writeTrailingSemicolon, + writeParameter, + writeProperty, + writeSpace, + writeStringLiteral, + writeSymbol, + writeLine, + increaseIndent, + decreaseIndent, + getText, + rawWrite, + writeLiteral, + getTextPos, + getLine: getLine2, + getColumn, + getIndent, + isAtStartOfLine, + hasTrailingComment: function() { + return writer.hasTrailingComment(); + }, + hasTrailingWhitespace: function() { + return writer.hasTrailingWhitespace(); + }, + clear: clear2 + }; + } + textChanges_3.createWriter = createWriter; + function getInsertionPositionAtSourceFileTop(sourceFile) { + var lastPrologue; + for (var _i = 0, _a2 = sourceFile.statements; _i < _a2.length; _i++) { + var node = _a2[_i]; + if (ts2.isPrologueDirective(node)) { + lastPrologue = node; + } else { + break; + } + } + var position = 0; + var text = sourceFile.text; + if (lastPrologue) { + position = lastPrologue.end; + advancePastLineBreak(); + return position; + } + var shebang = ts2.getShebang(text); + if (shebang !== void 0) { + position = shebang.length; + advancePastLineBreak(); + } + var ranges = ts2.getLeadingCommentRanges(text, position); + if (!ranges) + return position; + var lastComment; + var firstNodeLine; + for (var _b = 0, ranges_1 = ranges; _b < ranges_1.length; _b++) { + var range2 = ranges_1[_b]; + if (range2.kind === 3) { + if (ts2.isPinnedComment(text, range2.pos)) { + lastComment = { range: range2, pinnedOrTripleSlash: true }; + continue; + } + } else if (ts2.isRecognizedTripleSlashComment(text, range2.pos, range2.end)) { + lastComment = { range: range2, pinnedOrTripleSlash: true }; + continue; + } + if (lastComment) { + if (lastComment.pinnedOrTripleSlash) + break; + var commentLine = sourceFile.getLineAndCharacterOfPosition(range2.pos).line; + var lastCommentEndLine = sourceFile.getLineAndCharacterOfPosition(lastComment.range.end).line; + if (commentLine >= lastCommentEndLine + 2) + break; + } + if (sourceFile.statements.length) { + if (firstNodeLine === void 0) + firstNodeLine = sourceFile.getLineAndCharacterOfPosition(sourceFile.statements[0].getStart()).line; + var commentEndLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line; + if (firstNodeLine < commentEndLine + 2) + break; + } + lastComment = { range: range2, pinnedOrTripleSlash: false }; + } + if (lastComment) { + position = lastComment.range.end; + advancePastLineBreak(); + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + var charCode = text.charCodeAt(position); + if (ts2.isLineBreak(charCode)) { + position++; + if (position < text.length && charCode === 13 && text.charCodeAt(position) === 10) { + position++; + } + } + } + } + } + function isValidLocationToAddComment(sourceFile, position) { + return !ts2.isInComment(sourceFile, position) && !ts2.isInString(sourceFile, position) && !ts2.isInTemplateString(sourceFile, position) && !ts2.isInJSXText(sourceFile, position); + } + textChanges_3.isValidLocationToAddComment = isValidLocationToAddComment; + function needSemicolonBetween(a7, b8) { + return (ts2.isPropertySignature(a7) || ts2.isPropertyDeclaration(a7)) && ts2.isClassOrTypeElement(b8) && b8.name.kind === 164 || ts2.isStatementButNotDeclaration(a7) && ts2.isStatementButNotDeclaration(b8); + } + var deleteDeclaration; + (function(deleteDeclaration_1) { + function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { + switch (node.kind) { + case 166: { + var oldFunction = node.parent; + if (ts2.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !ts2.findChildOfKind(oldFunction, 20, sourceFile)) { + changes.replaceNodeWithText(sourceFile, node, "()"); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + } + case 269: + case 268: + var isFirstImport = sourceFile.imports.length && node === ts2.first(sourceFile.imports).parent || node === ts2.find(sourceFile.statements, ts2.isAnyImportSyntax); + deleteNode(changes, sourceFile, node, { + leadingTriviaOption: isFirstImport ? LeadingTriviaOption.Exclude : ts2.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine + }); + break; + case 205: + var pattern5 = node.parent; + var preserveComma = pattern5.kind === 204 && node !== ts2.last(pattern5.elements); + if (preserveComma) { + deleteNode(changes, sourceFile, node); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + case 257: + deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); + break; + case 165: + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + break; + case 273: + var namedImports = node.parent; + if (namedImports.elements.length === 1) { + deleteImportBinding(changes, sourceFile, namedImports); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + case 271: + deleteImportBinding(changes, sourceFile, node); + break; + case 26: + deleteNode(changes, sourceFile, node, { trailingTriviaOption: TrailingTriviaOption.Exclude }); + break; + case 98: + deleteNode(changes, sourceFile, node, { leadingTriviaOption: LeadingTriviaOption.Exclude }); + break; + case 260: + case 259: + deleteNode(changes, sourceFile, node, { leadingTriviaOption: ts2.hasJSDocNodes(node) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); + break; + default: + if (!node.parent) { + deleteNode(changes, sourceFile, node); + } else if (ts2.isImportClause(node.parent) && node.parent.name === node) { + deleteDefaultImport(changes, sourceFile, node.parent); + } else if (ts2.isCallExpression(node.parent) && ts2.contains(node.parent.arguments, node)) { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } else { + deleteNode(changes, sourceFile, node); + } + } + } + deleteDeclaration_1.deleteDeclaration = deleteDeclaration2; + function deleteDefaultImport(changes, sourceFile, importClause) { + if (!importClause.namedBindings) { + deleteNode(changes, sourceFile, importClause.parent); + } else { + var start = importClause.name.getStart(sourceFile); + var nextToken = ts2.getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 27) { + var end = ts2.skipTrivia( + sourceFile.text, + nextToken.end, + /*stopAfterLineBreaks*/ + false, + /*stopAtComments*/ + true + ); + changes.deleteRange(sourceFile, { pos: start, end }); + } else { + deleteNode(changes, sourceFile, importClause.name); + } + } + } + function deleteImportBinding(changes, sourceFile, node) { + if (node.parent.name) { + var previousToken = ts2.Debug.checkDefined(ts2.getTokenAtPosition(sourceFile, node.pos - 1)); + changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); + } else { + var importDecl = ts2.getAncestor( + node, + 269 + /* SyntaxKind.ImportDeclaration */ + ); + deleteNode(changes, sourceFile, importDecl); + } + } + function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { + var parent2 = node.parent; + if (parent2.kind === 295) { + changes.deleteNodeRange(sourceFile, ts2.findChildOfKind(parent2, 20, sourceFile), ts2.findChildOfKind(parent2, 21, sourceFile)); + return; + } + if (parent2.declarations.length !== 1) { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + return; + } + var gp = parent2.parent; + switch (gp.kind) { + case 247: + case 246: + changes.replaceNode(sourceFile, node, ts2.factory.createObjectLiteralExpression()); + break; + case 245: + deleteNode(changes, sourceFile, parent2); + break; + case 240: + deleteNode(changes, sourceFile, gp, { leadingTriviaOption: ts2.hasJSDocNodes(gp) ? LeadingTriviaOption.JSDoc : LeadingTriviaOption.StartLine }); + break; + default: + ts2.Debug.assertNever(gp); + } + } + })(deleteDeclaration || (deleteDeclaration = {})); + function deleteNode(changes, sourceFile, node, options) { + if (options === void 0) { + options = { leadingTriviaOption: LeadingTriviaOption.IncludeAll }; + } + var startPosition = getAdjustedStartPosition(sourceFile, node, options); + var endPosition = getAdjustedEndPosition(sourceFile, node, options); + changes.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + textChanges_3.deleteNode = deleteNode; + function deleteNodeInList(changes, deletedNodesInLists, sourceFile, node) { + var containingList = ts2.Debug.checkDefined(ts2.formatting.SmartIndenter.getContainingList(node, sourceFile)); + var index4 = ts2.indexOfNode(containingList, node); + ts2.Debug.assert(index4 !== -1); + if (containingList.length === 1) { + deleteNode(changes, sourceFile, node); + return; + } + ts2.Debug.assert(!deletedNodesInLists.has(node), "Deleting a node twice"); + deletedNodesInLists.add(node); + changes.deleteRange(sourceFile, { + pos: startPositionToDeleteNodeInList(sourceFile, node), + end: index4 === containingList.length - 1 ? getAdjustedEndPosition(sourceFile, node, {}) : endPositionToDeleteNodeInList(sourceFile, node, containingList[index4 - 1], containingList[index4 + 1]) + }); + } + })(textChanges = ts2.textChanges || (ts2.textChanges = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodeToFixes = ts2.createMultiMap(); + var fixIdToRegistration = new ts2.Map(); + function createCodeFixActionWithoutFixAll(fixName, changes, description7) { + return createCodeFixActionWorker( + fixName, + ts2.diagnosticToString(description7), + changes, + /*fixId*/ + void 0, + /*fixAllDescription*/ + void 0 + ); + } + codefix2.createCodeFixActionWithoutFixAll = createCodeFixActionWithoutFixAll; + function createCodeFixAction(fixName, changes, description7, fixId, fixAllDescription, command) { + return createCodeFixActionWorker(fixName, ts2.diagnosticToString(description7), changes, fixId, ts2.diagnosticToString(fixAllDescription), command); + } + codefix2.createCodeFixAction = createCodeFixAction; + function createCodeFixActionMaybeFixAll(fixName, changes, description7, fixId, fixAllDescription, command) { + return createCodeFixActionWorker(fixName, ts2.diagnosticToString(description7), changes, fixId, fixAllDescription && ts2.diagnosticToString(fixAllDescription), command); + } + codefix2.createCodeFixActionMaybeFixAll = createCodeFixActionMaybeFixAll; + function createCodeFixActionWorker(fixName, description7, changes, fixId, fixAllDescription, command) { + return { fixName, description: description7, changes, fixId, fixAllDescription, commands: command ? [command] : void 0 }; + } + function registerCodeFix(reg) { + for (var _i = 0, _a2 = reg.errorCodes; _i < _a2.length; _i++) { + var error2 = _a2[_i]; + errorCodeToFixes.add(String(error2), reg); + } + if (reg.fixIds) { + for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) { + var fixId = _c[_b]; + ts2.Debug.assert(!fixIdToRegistration.has(fixId)); + fixIdToRegistration.set(fixId, reg); + } + } + } + codefix2.registerCodeFix = registerCodeFix; + function getSupportedErrorCodes() { + return ts2.arrayFrom(errorCodeToFixes.keys()); + } + codefix2.getSupportedErrorCodes = getSupportedErrorCodes; + function removeFixIdIfFixAllUnavailable(registration, diagnostics) { + var errorCodes = registration.errorCodes; + var maybeFixableDiagnostics = 0; + for (var _i = 0, diagnostics_1 = diagnostics; _i < diagnostics_1.length; _i++) { + var diag = diagnostics_1[_i]; + if (ts2.contains(errorCodes, diag.code)) + maybeFixableDiagnostics++; + if (maybeFixableDiagnostics > 1) + break; + } + var fixAllUnavailable = maybeFixableDiagnostics < 2; + return function(_a2) { + var fixId = _a2.fixId, fixAllDescription = _a2.fixAllDescription, action = __rest13(_a2, ["fixId", "fixAllDescription"]); + return fixAllUnavailable ? action : __assign16(__assign16({}, action), { fixId, fixAllDescription }); + }; + } + function getFixes(context2) { + var diagnostics = getDiagnostics(context2); + var registrations = errorCodeToFixes.get(String(context2.errorCode)); + return ts2.flatMap(registrations, function(f8) { + return ts2.map(f8.getCodeActions(context2), removeFixIdIfFixAllUnavailable(f8, diagnostics)); + }); + } + codefix2.getFixes = getFixes; + function getAllFixes(context2) { + return fixIdToRegistration.get(ts2.cast(context2.fixId, ts2.isString)).getAllCodeActions(context2); + } + codefix2.getAllFixes = getAllFixes; + function createCombinedCodeActions(changes, commands) { + return { changes, commands }; + } + codefix2.createCombinedCodeActions = createCombinedCodeActions; + function createFileTextChanges(fileName, textChanges) { + return { fileName, textChanges }; + } + codefix2.createFileTextChanges = createFileTextChanges; + function codeFixAll(context2, errorCodes, use) { + var commands = []; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return eachDiagnostic(context2, errorCodes, function(diag) { + return use(t8, diag, commands); + }); + }); + return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); + } + codefix2.codeFixAll = codeFixAll; + function eachDiagnostic(context2, errorCodes, cb) { + for (var _i = 0, _a2 = getDiagnostics(context2); _i < _a2.length; _i++) { + var diag = _a2[_i]; + if (ts2.contains(errorCodes, diag.code)) { + cb(diag); + } + } + } + codefix2.eachDiagnostic = eachDiagnostic; + function getDiagnostics(_a2) { + var program = _a2.program, sourceFile = _a2.sourceFile, cancellationToken = _a2.cancellationToken; + return __spreadArray9(__spreadArray9(__spreadArray9([], program.getSemanticDiagnostics(sourceFile, cancellationToken), true), program.getSyntacticDiagnostics(sourceFile, cancellationToken), true), ts2.computeSuggestionDiagnostics(sourceFile, program, cancellationToken), true); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor_1) { + var refactors = new ts2.Map(); + function registerRefactor(name2, refactor2) { + refactors.set(name2, refactor2); + } + refactor_1.registerRefactor = registerRefactor; + function getApplicableRefactors(context2) { + return ts2.arrayFrom(ts2.flatMapIterator(refactors.values(), function(refactor2) { + var _a2; + return context2.cancellationToken && context2.cancellationToken.isCancellationRequested() || !((_a2 = refactor2.kinds) === null || _a2 === void 0 ? void 0 : _a2.some(function(kind) { + return refactor_1.refactorKindBeginsWith(kind, context2.kind); + })) ? void 0 : refactor2.getAvailableActions(context2); + })); + } + refactor_1.getApplicableRefactors = getApplicableRefactors; + function getEditsForRefactor(context2, refactorName, actionName) { + var refactor2 = refactors.get(refactorName); + return refactor2 && refactor2.getEditsForAction(context2, actionName); + } + refactor_1.getEditsForRefactor = getEditsForRefactor; + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addConvertToUnknownForNonOverlappingTypes"; + var errorCodes = [ts2.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddConvertToUnknownForNonOverlappingTypes(context2) { + var assertion = getAssertion(context2.sourceFile, context2.span.start); + if (assertion === void 0) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, assertion); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_unknown_conversion_for_non_overlapping_types, fixId, ts2.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var assertion = getAssertion(diag.file, diag.start); + if (assertion) { + makeChange(changes, diag.file, assertion); + } + }); + } + }); + function makeChange(changeTracker, sourceFile, assertion) { + var replacement = ts2.isAsExpression(assertion) ? ts2.factory.createAsExpression(assertion.expression, ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + )) : ts2.factory.createTypeAssertion(ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + ), assertion.expression); + changeTracker.replaceNode(sourceFile, assertion.expression, replacement); + } + function getAssertion(sourceFile, pos) { + if (ts2.isInJSFile(sourceFile)) + return void 0; + return ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, pos), function(n7) { + return ts2.isAsExpression(n7) || ts2.isTypeAssertionExpression(n7); + }); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + codefix2.registerCodeFix({ + errorCodes: [ + ts2.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code, + ts2.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code + ], + getCodeActions: function getCodeActionsToAddEmptyExportDeclaration(context2) { + var sourceFile = context2.sourceFile; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changes2) { + var exportDeclaration = ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([]), + /*moduleSpecifier*/ + void 0 + ); + changes2.insertNodeAtEndOfScope(sourceFile, sourceFile, exportDeclaration); + }); + return [codefix2.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration", changes, ts2.Diagnostics.Add_export_to_make_this_file_into_a_module)]; + } + }); + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingAsync"; + var errorCodes = [ + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code, + ts2.Diagnostics.Type_0_is_not_comparable_to_type_1.code + ]; + codefix2.registerCodeFix({ + fixIds: [fixId], + errorCodes, + getCodeActions: function getCodeActionsToAddMissingAsync(context2) { + var sourceFile = context2.sourceFile, errorCode = context2.errorCode, cancellationToken = context2.cancellationToken, program = context2.program, span = context2.span; + var diagnostic = ts2.find(program.getTypeChecker().getDiagnostics(sourceFile, cancellationToken), getIsMatchingAsyncError(span, errorCode)); + var directSpan = diagnostic && diagnostic.relatedInformation && ts2.find(diagnostic.relatedInformation, function(r8) { + return r8.code === ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; + }); + var decl = getFixableErrorSpanDeclaration(sourceFile, directSpan); + if (!decl) { + return; + } + var trackChanges = function(cb) { + return ts2.textChanges.ChangeTracker.with(context2, cb); + }; + return [getFix(context2, decl, trackChanges)]; + }, + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var fixedDeclarations = new ts2.Set(); + return codefix2.codeFixAll(context2, errorCodes, function(t8, diagnostic) { + var span = diagnostic.relatedInformation && ts2.find(diagnostic.relatedInformation, function(r8) { + return r8.code === ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; + }); + var decl = getFixableErrorSpanDeclaration(sourceFile, span); + if (!decl) { + return; + } + var trackChanges = function(cb) { + return cb(t8), []; + }; + return getFix(context2, decl, trackChanges, fixedDeclarations); + }); + } + }); + function getFix(context2, decl, trackChanges, fixedDeclarations) { + var changes = trackChanges(function(t8) { + return makeChange(t8, context2.sourceFile, decl, fixedDeclarations); + }); + return codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_async_modifier_to_containing_function, fixId, ts2.Diagnostics.Add_all_missing_async_modifiers); + } + function makeChange(changeTracker, sourceFile, insertionSite, fixedDeclarations) { + if (fixedDeclarations) { + if (fixedDeclarations.has(ts2.getNodeId(insertionSite))) { + return; + } + } + fixedDeclarations === null || fixedDeclarations === void 0 ? void 0 : fixedDeclarations.add(ts2.getNodeId(insertionSite)); + var cloneWithModifier = ts2.factory.updateModifiers(ts2.getSynthesizedDeepClone( + insertionSite, + /*includeTrivia*/ + true + ), ts2.factory.createNodeArray(ts2.factory.createModifiersFromModifierFlags( + ts2.getSyntacticModifierFlags(insertionSite) | 512 + /* ModifierFlags.Async */ + ))); + changeTracker.replaceNode(sourceFile, insertionSite, cloneWithModifier); + } + function getFixableErrorSpanDeclaration(sourceFile, span) { + if (!span) + return void 0; + var token = ts2.getTokenAtPosition(sourceFile, span.start); + var decl = ts2.findAncestor(token, function(node) { + if (node.getStart(sourceFile) < span.start || node.getEnd() > ts2.textSpanEnd(span)) { + return "quit"; + } + return (ts2.isArrowFunction(node) || ts2.isMethodDeclaration(node) || ts2.isFunctionExpression(node) || ts2.isFunctionDeclaration(node)) && ts2.textSpansEqual(span, ts2.createTextSpanFromNode(node, sourceFile)); + }); + return decl; + } + function getIsMatchingAsyncError(span, errorCode) { + return function(_a2) { + var start = _a2.start, length = _a2.length, relatedInformation = _a2.relatedInformation, code = _a2.code; + return ts2.isNumber(start) && ts2.isNumber(length) && ts2.textSpansEqual({ start, length }, span) && code === errorCode && !!relatedInformation && ts2.some(relatedInformation, function(related) { + return related.code === ts2.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; + }); + }; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingAwait"; + var propertyAccessCode = ts2.Diagnostics.Property_0_does_not_exist_on_type_1.code; + var callableConstructableErrorCodes = [ + ts2.Diagnostics.This_expression_is_not_callable.code, + ts2.Diagnostics.This_expression_is_not_constructable.code + ]; + var errorCodes = __spreadArray9([ + ts2.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code, + ts2.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, + ts2.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, + ts2.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code, + ts2.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code, + ts2.Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code, + ts2.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code, + ts2.Diagnostics.Type_0_is_not_an_array_type.code, + ts2.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code, + ts2.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code, + ts2.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + ts2.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + ts2.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + ts2.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code, + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + propertyAccessCode + ], callableConstructableErrorCodes, true); + codefix2.registerCodeFix({ + fixIds: [fixId], + errorCodes, + getCodeActions: function getCodeActionsToAddMissingAwait(context2) { + var sourceFile = context2.sourceFile, errorCode = context2.errorCode, span = context2.span, cancellationToken = context2.cancellationToken, program = context2.program; + var expression = getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program); + if (!expression) { + return; + } + var checker = context2.program.getTypeChecker(); + var trackChanges = function(cb) { + return ts2.textChanges.ChangeTracker.with(context2, cb); + }; + return ts2.compact([ + getDeclarationSiteFix(context2, expression, errorCode, checker, trackChanges), + getUseSiteFix(context2, expression, errorCode, checker, trackChanges) + ]); + }, + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, cancellationToken = context2.cancellationToken; + var checker = context2.program.getTypeChecker(); + var fixedDeclarations = new ts2.Set(); + return codefix2.codeFixAll(context2, errorCodes, function(t8, diagnostic) { + var expression = getAwaitErrorSpanExpression(sourceFile, diagnostic.code, diagnostic, cancellationToken, program); + if (!expression) { + return; + } + var trackChanges = function(cb) { + return cb(t8), []; + }; + return getDeclarationSiteFix(context2, expression, diagnostic.code, checker, trackChanges, fixedDeclarations) || getUseSiteFix(context2, expression, diagnostic.code, checker, trackChanges, fixedDeclarations); + }); + } + }); + function getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program) { + var expression = ts2.getFixableErrorSpanExpression(sourceFile, span); + return expression && isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) && isInsideAwaitableBody(expression) ? expression : void 0; + } + function getDeclarationSiteFix(context2, expression, errorCode, checker, trackChanges, fixedDeclarations) { + var sourceFile = context2.sourceFile, program = context2.program, cancellationToken = context2.cancellationToken; + var awaitableInitializers = findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker); + if (awaitableInitializers) { + var initializerChanges = trackChanges(function(t8) { + ts2.forEach(awaitableInitializers.initializers, function(_a2) { + var expression2 = _a2.expression; + return makeChange(t8, errorCode, sourceFile, checker, expression2, fixedDeclarations); + }); + if (fixedDeclarations && awaitableInitializers.needsSecondPassForFixAll) { + makeChange(t8, errorCode, sourceFile, checker, expression, fixedDeclarations); + } + }); + return codefix2.createCodeFixActionWithoutFixAll("addMissingAwaitToInitializer", initializerChanges, awaitableInitializers.initializers.length === 1 ? [ts2.Diagnostics.Add_await_to_initializer_for_0, awaitableInitializers.initializers[0].declarationSymbol.name] : ts2.Diagnostics.Add_await_to_initializers); + } + } + function getUseSiteFix(context2, expression, errorCode, checker, trackChanges, fixedDeclarations) { + var changes = trackChanges(function(t8) { + return makeChange(t8, errorCode, context2.sourceFile, checker, expression, fixedDeclarations); + }); + return codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_await, fixId, ts2.Diagnostics.Fix_all_expressions_possibly_missing_await); + } + function isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) { + var checker = program.getTypeChecker(); + var diagnostics = checker.getDiagnostics(sourceFile, cancellationToken); + return ts2.some(diagnostics, function(_a2) { + var start = _a2.start, length = _a2.length, relatedInformation = _a2.relatedInformation, code = _a2.code; + return ts2.isNumber(start) && ts2.isNumber(length) && ts2.textSpansEqual({ start, length }, span) && code === errorCode && !!relatedInformation && ts2.some(relatedInformation, function(related) { + return related.code === ts2.Diagnostics.Did_you_forget_to_use_await.code; + }); + }); + } + function findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker) { + var identifiers = getIdentifiersFromErrorSpanExpression(expression, checker); + if (!identifiers) { + return; + } + var isCompleteFix = identifiers.isCompleteFix; + var initializers; + var _loop_11 = function(identifier2) { + var symbol = checker.getSymbolAtLocation(identifier2); + if (!symbol) { + return "continue"; + } + var declaration = ts2.tryCast(symbol.valueDeclaration, ts2.isVariableDeclaration); + var variableName = declaration && ts2.tryCast(declaration.name, ts2.isIdentifier); + var variableStatement = ts2.getAncestor( + declaration, + 240 + /* SyntaxKind.VariableStatement */ + ); + if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || ts2.hasSyntacticModifier( + variableStatement, + 1 + /* ModifierFlags.Export */ + ) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { + isCompleteFix = false; + return "continue"; + } + var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); + var isUsedElsewhere = ts2.FindAllReferences.Core.eachSymbolReferenceInFile(variableName, checker, sourceFile, function(reference) { + return identifier2 !== reference && !symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker); + }); + if (isUsedElsewhere) { + isCompleteFix = false; + return "continue"; + } + (initializers || (initializers = [])).push({ + expression: declaration.initializer, + declarationSymbol: symbol + }); + }; + for (var _i = 0, _a2 = identifiers.identifiers; _i < _a2.length; _i++) { + var identifier = _a2[_i]; + _loop_11(identifier); + } + return initializers && { + initializers, + needsSecondPassForFixAll: !isCompleteFix + }; + } + function getIdentifiersFromErrorSpanExpression(expression, checker) { + if (ts2.isPropertyAccessExpression(expression.parent) && ts2.isIdentifier(expression.parent.expression)) { + return { identifiers: [expression.parent.expression], isCompleteFix: true }; + } + if (ts2.isIdentifier(expression)) { + return { identifiers: [expression], isCompleteFix: true }; + } + if (ts2.isBinaryExpression(expression)) { + var sides = void 0; + var isCompleteFix = true; + for (var _i = 0, _a2 = [expression.left, expression.right]; _i < _a2.length; _i++) { + var side = _a2[_i]; + var type3 = checker.getTypeAtLocation(side); + if (checker.getPromisedTypeOfPromise(type3)) { + if (!ts2.isIdentifier(side)) { + isCompleteFix = false; + continue; + } + (sides || (sides = [])).push(side); + } + } + return sides && { identifiers: sides, isCompleteFix }; + } + } + function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) { + var errorNode = ts2.isPropertyAccessExpression(reference.parent) ? reference.parent.name : ts2.isBinaryExpression(reference.parent) ? reference.parent : reference; + var diagnostic = ts2.find(diagnostics, function(diagnostic2) { + return diagnostic2.start === errorNode.getStart(sourceFile) && diagnostic2.start + diagnostic2.length === errorNode.getEnd(); + }); + return diagnostic && ts2.contains(errorCodes, diagnostic.code) || // A Promise is usually not correct in a binary expression (it’s not valid + // in an arithmetic expression and an equality comparison seems unusual), + // but if the other side of the binary expression has an error, the side + // is typed `any` which will squash the error that would identify this + // Promise as an invalid operand. So if the whole binary expression is + // typed `any` as a result, there is a strong likelihood that this Promise + // is accidentally missing `await`. + checker.getTypeAtLocation(errorNode).flags & 1; + } + function isInsideAwaitableBody(node) { + return node.kind & 32768 || !!ts2.findAncestor(node, function(ancestor) { + return ancestor.parent && ts2.isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || ts2.isBlock(ancestor) && (ancestor.parent.kind === 259 || ancestor.parent.kind === 215 || ancestor.parent.kind === 216 || ancestor.parent.kind === 171); + }); + } + function makeChange(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { + if (ts2.isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { + var exprType = checker.getTypeAtLocation(insertionSite); + var asyncIter = checker.getAsyncIterableType(); + if (asyncIter && checker.isTypeAssignableTo(exprType, asyncIter)) { + var forOf = insertionSite.parent; + changeTracker.replaceNode(sourceFile, forOf, ts2.factory.updateForOfStatement(forOf, ts2.factory.createToken( + 133 + /* SyntaxKind.AwaitKeyword */ + ), forOf.initializer, forOf.expression, forOf.statement)); + return; + } + } + if (ts2.isBinaryExpression(insertionSite)) { + for (var _i = 0, _a2 = [insertionSite.left, insertionSite.right]; _i < _a2.length; _i++) { + var side = _a2[_i]; + if (fixedDeclarations && ts2.isIdentifier(side)) { + var symbol = checker.getSymbolAtLocation(side); + if (symbol && fixedDeclarations.has(ts2.getSymbolId(symbol))) { + continue; + } + } + var type3 = checker.getTypeAtLocation(side); + var newNode = checker.getPromisedTypeOfPromise(type3) ? ts2.factory.createAwaitExpression(side) : side; + changeTracker.replaceNode(sourceFile, side, newNode); + } + } else if (errorCode === propertyAccessCode && ts2.isPropertyAccessExpression(insertionSite.parent)) { + if (fixedDeclarations && ts2.isIdentifier(insertionSite.parent.expression)) { + var symbol = checker.getSymbolAtLocation(insertionSite.parent.expression); + if (symbol && fixedDeclarations.has(ts2.getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode(sourceFile, insertionSite.parent.expression, ts2.factory.createParenthesizedExpression(ts2.factory.createAwaitExpression(insertionSite.parent.expression))); + insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile); + } else if (ts2.contains(callableConstructableErrorCodes, errorCode) && ts2.isCallOrNewExpression(insertionSite.parent)) { + if (fixedDeclarations && ts2.isIdentifier(insertionSite)) { + var symbol = checker.getSymbolAtLocation(insertionSite); + if (symbol && fixedDeclarations.has(ts2.getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode(sourceFile, insertionSite, ts2.factory.createParenthesizedExpression(ts2.factory.createAwaitExpression(insertionSite))); + insertLeadingSemicolonIfNeeded(changeTracker, insertionSite, sourceFile); + } else { + if (fixedDeclarations && ts2.isVariableDeclaration(insertionSite.parent) && ts2.isIdentifier(insertionSite.parent.name)) { + var symbol = checker.getSymbolAtLocation(insertionSite.parent.name); + if (symbol && !ts2.tryAddToSet(fixedDeclarations, ts2.getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode(sourceFile, insertionSite, ts2.factory.createAwaitExpression(insertionSite)); + } + } + function insertLeadingSemicolonIfNeeded(changeTracker, beforeNode, sourceFile) { + var precedingToken = ts2.findPrecedingToken(beforeNode.pos, sourceFile); + if (precedingToken && ts2.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { + changeTracker.insertText(sourceFile, beforeNode.getStart(sourceFile), ";"); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingConst"; + var errorCodes = [ + ts2.Diagnostics.Cannot_find_name_0.code, + ts2.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddMissingConst(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span.start, context2.program); + }); + if (changes.length > 0) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_const_to_unresolved_variable, fixId, ts2.Diagnostics.Add_const_to_all_unresolved_variables)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var fixedNodes = new ts2.Set(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag.start, context2.program, fixedNodes); + }); + } + }); + function makeChange(changeTracker, sourceFile, pos, program, fixedNodes) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var forInitializer = ts2.findAncestor(token, function(node) { + return ts2.isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit"; + }); + if (forInitializer) + return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); + var parent2 = token.parent; + if (ts2.isBinaryExpression(parent2) && parent2.operatorToken.kind === 63 && ts2.isExpressionStatement(parent2.parent)) { + return applyChange(changeTracker, token, sourceFile, fixedNodes); + } + if (ts2.isArrayLiteralExpression(parent2)) { + var checker_1 = program.getTypeChecker(); + if (!ts2.every(parent2.elements, function(element) { + return arrayElementCouldBeVariableDeclaration(element, checker_1); + })) { + return; + } + return applyChange(changeTracker, parent2, sourceFile, fixedNodes); + } + var commaExpression = ts2.findAncestor(token, function(node) { + return ts2.isExpressionStatement(node.parent) ? true : isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit"; + }); + if (commaExpression) { + var checker = program.getTypeChecker(); + if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) { + return; + } + return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes); + } + } + function applyChange(changeTracker, initializer, sourceFile, fixedNodes) { + if (!fixedNodes || ts2.tryAddToSet(fixedNodes, initializer)) { + changeTracker.insertModifierBefore(sourceFile, 85, initializer); + } + } + function isPossiblyPartOfDestructuring(node) { + switch (node.kind) { + case 79: + case 206: + case 207: + case 299: + case 300: + return true; + default: + return false; + } + } + function arrayElementCouldBeVariableDeclaration(expression, checker) { + var identifier = ts2.isIdentifier(expression) ? expression : ts2.isAssignmentExpression( + expression, + /*excludeCompoundAssignment*/ + true + ) && ts2.isIdentifier(expression.left) ? expression.left : void 0; + return !!identifier && !checker.getSymbolAtLocation(identifier); + } + function isPossiblyPartOfCommaSeperatedInitializer(node) { + switch (node.kind) { + case 79: + case 223: + case 27: + return true; + default: + return false; + } + } + function expressionCouldBeVariableDeclaration(expression, checker) { + if (!ts2.isBinaryExpression(expression)) { + return false; + } + if (expression.operatorToken.kind === 27) { + return ts2.every([expression.left, expression.right], function(expression2) { + return expressionCouldBeVariableDeclaration(expression2, checker); + }); + } + return expression.operatorToken.kind === 63 && ts2.isIdentifier(expression.left) && !checker.getSymbolAtLocation(expression.left); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingDeclareProperty"; + var errorCodes = [ + ts2.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddMissingDeclareOnProperty(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span.start); + }); + if (changes.length > 0) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Prefix_with_declare, fixId, ts2.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var fixedNodes = new ts2.Set(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag.start, fixedNodes); + }); + } + }); + function makeChange(changeTracker, sourceFile, pos, fixedNodes) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (!ts2.isIdentifier(token)) { + return; + } + var declaration = token.parent; + if (declaration.kind === 169 && (!fixedNodes || ts2.tryAddToSet(fixedNodes, declaration))) { + changeTracker.insertModifierBefore(sourceFile, 136, declaration); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingInvocationForDecorator"; + var errorCodes = [ts2.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddMissingInvocationForDecorator(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span.start); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Call_decorator_expression, fixId, ts2.Diagnostics.Add_to_all_uncalled_decorators)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag.start); + }); + } + }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var decorator = ts2.findAncestor(token, ts2.isDecorator); + ts2.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + var replacement = ts2.factory.createCallExpression( + decorator.expression, + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addNameToNamelessParameter"; + var errorCodes = [ts2.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddNameToNamelessParameter(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span.start); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_parameter_name, fixId, ts2.Diagnostics.Add_names_to_all_parameters_without_names)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag.start); + }); + } + }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var param = token.parent; + if (!ts2.isParameter(param)) { + return ts2.Debug.fail("Tried to add a parameter name to a non-parameter: " + ts2.Debug.formatSyntaxKind(token.kind)); + } + var i7 = param.parent.parameters.indexOf(param); + ts2.Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); + ts2.Debug.assert(i7 > -1, "Parameter not found in parent parameter list."); + var typeNode = ts2.factory.createTypeReferenceNode( + param.name, + /*typeArguments*/ + void 0 + ); + var replacement = ts2.factory.createParameterDeclaration(param.modifiers, param.dotDotDotToken, "arg" + i7, param.questionToken, param.dotDotDotToken ? ts2.factory.createArrayTypeNode(typeNode) : typeNode, param.initializer); + changeTracker.replaceNode(sourceFile, param, replacement); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var addOptionalPropertyUndefined = "addOptionalPropertyUndefined"; + var errorCodes = [ + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var typeChecker = context2.program.getTypeChecker(); + var toAdd = getPropertiesToAdd(context2.sourceFile, context2.span, typeChecker); + if (!toAdd.length) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addUndefinedToOptionalProperty(t8, toAdd); + }); + return [codefix2.createCodeFixActionWithoutFixAll(addOptionalPropertyUndefined, changes, ts2.Diagnostics.Add_undefined_to_optional_property_type)]; + }, + fixIds: [addOptionalPropertyUndefined] + }); + function getPropertiesToAdd(file, span, checker) { + var _a2, _b; + var sourceTarget = getSourceTarget(ts2.getFixableErrorSpanExpression(file, span), checker); + if (!sourceTarget) { + return ts2.emptyArray; + } + var sourceNode = sourceTarget.source, targetNode = sourceTarget.target; + var target = shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) ? checker.getTypeAtLocation(targetNode.expression) : checker.getTypeAtLocation(targetNode); + if ((_b = (_a2 = target.symbol) === null || _a2 === void 0 ? void 0 : _a2.declarations) === null || _b === void 0 ? void 0 : _b.some(function(d7) { + return ts2.getSourceFileOfNode(d7).fileName.match(/\.d\.ts$/); + })) { + return ts2.emptyArray; + } + return checker.getExactOptionalProperties(target); + } + function shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) { + return ts2.isPropertyAccessExpression(targetNode) && !!checker.getExactOptionalProperties(checker.getTypeAtLocation(targetNode.expression)).length && checker.getTypeAtLocation(sourceNode) === checker.getUndefinedType(); + } + function getSourceTarget(errorNode, checker) { + var _a2; + if (!errorNode) { + return void 0; + } else if (ts2.isBinaryExpression(errorNode.parent) && errorNode.parent.operatorToken.kind === 63) { + return { source: errorNode.parent.right, target: errorNode.parent.left }; + } else if (ts2.isVariableDeclaration(errorNode.parent) && errorNode.parent.initializer) { + return { source: errorNode.parent.initializer, target: errorNode.parent.name }; + } else if (ts2.isCallExpression(errorNode.parent)) { + var n7 = checker.getSymbolAtLocation(errorNode.parent.expression); + if (!(n7 === null || n7 === void 0 ? void 0 : n7.valueDeclaration) || !ts2.isFunctionLikeKind(n7.valueDeclaration.kind)) + return void 0; + if (!ts2.isExpression(errorNode)) + return void 0; + var i7 = errorNode.parent.arguments.indexOf(errorNode); + if (i7 === -1) + return void 0; + var name2 = n7.valueDeclaration.parameters[i7].name; + if (ts2.isIdentifier(name2)) + return { source: errorNode, target: name2 }; + } else if (ts2.isPropertyAssignment(errorNode.parent) && ts2.isIdentifier(errorNode.parent.name) || ts2.isShorthandPropertyAssignment(errorNode.parent)) { + var parentTarget = getSourceTarget(errorNode.parent.parent, checker); + if (!parentTarget) + return void 0; + var prop = checker.getPropertyOfType(checker.getTypeAtLocation(parentTarget.target), errorNode.parent.name.text); + var declaration = (_a2 = prop === null || prop === void 0 ? void 0 : prop.declarations) === null || _a2 === void 0 ? void 0 : _a2[0]; + if (!declaration) + return void 0; + return { + source: ts2.isPropertyAssignment(errorNode.parent) ? errorNode.parent.initializer : errorNode.parent.name, + target: declaration + }; + } + return void 0; + } + function addUndefinedToOptionalProperty(changes, toAdd) { + for (var _i = 0, toAdd_1 = toAdd; _i < toAdd_1.length; _i++) { + var add2 = toAdd_1[_i]; + var d7 = add2.valueDeclaration; + if (d7 && (ts2.isPropertySignature(d7) || ts2.isPropertyDeclaration(d7)) && d7.type) { + var t8 = ts2.factory.createUnionTypeNode(__spreadArray9(__spreadArray9([], d7.type.kind === 189 ? d7.type.types : [d7.type], true), [ + ts2.factory.createTypeReferenceNode("undefined") + ], false)); + changes.replaceNode(d7.getSourceFile(), d7.type, t8); + } + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "annotateWithTypeFromJSDoc"; + var errorCodes = [ts2.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var decl = getDeclaration(context2.sourceFile, context2.span.start); + if (!decl) + return; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, decl); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Annotate_with_type_from_JSDoc, fixId, ts2.Diagnostics.Annotate_everything_with_types_from_JSDoc)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var decl = getDeclaration(diag.file, diag.start); + if (decl) + doChange(changes, diag.file, decl); + }); + } + }); + function getDeclaration(file, pos) { + var name2 = ts2.getTokenAtPosition(file, pos); + return ts2.tryCast(ts2.isParameter(name2.parent) ? name2.parent.parent : name2.parent, parameterShouldGetTypeFromJSDoc); + } + function parameterShouldGetTypeFromJSDoc(node) { + return isDeclarationWithType(node) && hasUsableJSDoc(node); + } + codefix2.parameterShouldGetTypeFromJSDoc = parameterShouldGetTypeFromJSDoc; + function hasUsableJSDoc(decl) { + return ts2.isFunctionLikeDeclaration(decl) ? decl.parameters.some(hasUsableJSDoc) || !decl.type && !!ts2.getJSDocReturnType(decl) : !decl.type && !!ts2.getJSDocType(decl); + } + function doChange(changes, sourceFile, decl) { + if (ts2.isFunctionLikeDeclaration(decl) && (ts2.getJSDocReturnType(decl) || decl.parameters.some(function(p7) { + return !!ts2.getJSDocType(p7); + }))) { + if (!decl.typeParameters) { + var typeParameters = ts2.getJSDocTypeParameterDeclarations(decl); + if (typeParameters.length) + changes.insertTypeParameters(sourceFile, decl, typeParameters); + } + var needParens = ts2.isArrowFunction(decl) && !ts2.findChildOfKind(decl, 20, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, ts2.first(decl.parameters), ts2.factory.createToken( + 20 + /* SyntaxKind.OpenParenToken */ + )); + for (var _i = 0, _a2 = decl.parameters; _i < _a2.length; _i++) { + var param = _a2[_i]; + if (!param.type) { + var paramType = ts2.getJSDocType(param); + if (paramType) + changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, ts2.last(decl.parameters), ts2.factory.createToken( + 21 + /* SyntaxKind.CloseParenToken */ + )); + if (!decl.type) { + var returnType = ts2.getJSDocReturnType(decl); + if (returnType) + changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + } + } else { + var jsdocType = ts2.Debug.checkDefined(ts2.getJSDocType(decl), "A JSDocType for this declaration should exist"); + ts2.Debug.assert(!decl.type, "The JSDocType decl should have a type"); + changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + } + } + function isDeclarationWithType(node) { + return ts2.isFunctionLikeDeclaration(node) || node.kind === 257 || node.kind === 168 || node.kind === 169; + } + function transformJSDocType(node) { + switch (node.kind) { + case 315: + case 316: + return ts2.factory.createTypeReferenceNode("any", ts2.emptyArray); + case 319: + return transformJSDocOptionalType(node); + case 318: + return transformJSDocType(node.type); + case 317: + return transformJSDocNullableType(node); + case 321: + return transformJSDocVariadicType(node); + case 320: + return transformJSDocFunctionType(node); + case 180: + return transformJSDocTypeReference(node); + default: + var visited = ts2.visitEachChild(node, transformJSDocType, ts2.nullTransformationContext); + ts2.setEmitFlags( + visited, + 1 + /* EmitFlags.SingleLine */ + ); + return visited; + } + } + function transformJSDocOptionalType(node) { + return ts2.factory.createUnionTypeNode([ts2.visitNode(node.type, transformJSDocType), ts2.factory.createTypeReferenceNode("undefined", ts2.emptyArray)]); + } + function transformJSDocNullableType(node) { + return ts2.factory.createUnionTypeNode([ts2.visitNode(node.type, transformJSDocType), ts2.factory.createTypeReferenceNode("null", ts2.emptyArray)]); + } + function transformJSDocVariadicType(node) { + return ts2.factory.createArrayTypeNode(ts2.visitNode(node.type, transformJSDocType)); + } + function transformJSDocFunctionType(node) { + var _a2; + return ts2.factory.createFunctionTypeNode(ts2.emptyArray, node.parameters.map(transformJSDocParameter), (_a2 = node.type) !== null && _a2 !== void 0 ? _a2 : ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + )); + } + function transformJSDocParameter(node) { + var index4 = node.parent.parameters.indexOf(node); + var isRest = node.type.kind === 321 && index4 === node.parent.parameters.length - 1; + var name2 = node.name || (isRest ? "rest" : "arg" + index4); + var dotdotdot = isRest ? ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ) : node.dotDotDotToken; + return ts2.factory.createParameterDeclaration(node.modifiers, dotdotdot, name2, node.questionToken, ts2.visitNode(node.type, transformJSDocType), node.initializer); + } + function transformJSDocTypeReference(node) { + var name2 = node.typeName; + var args = node.typeArguments; + if (ts2.isIdentifier(node.typeName)) { + if (ts2.isJSDocIndexSignature(node)) { + return transformJSDocIndexSignature(node); + } + var text = node.typeName.text; + switch (node.typeName.text) { + case "String": + case "Boolean": + case "Object": + case "Number": + text = text.toLowerCase(); + break; + case "array": + case "date": + case "promise": + text = text[0].toUpperCase() + text.slice(1); + break; + } + name2 = ts2.factory.createIdentifier(text); + if ((text === "Array" || text === "Promise") && !node.typeArguments) { + args = ts2.factory.createNodeArray([ts2.factory.createTypeReferenceNode("any", ts2.emptyArray)]); + } else { + args = ts2.visitNodes(node.typeArguments, transformJSDocType); + } + } + return ts2.factory.createTypeReferenceNode(name2, args); + } + function transformJSDocIndexSignature(node) { + var index4 = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + node.typeArguments[0].kind === 148 ? "n" : "s", + /*questionToken*/ + void 0, + ts2.factory.createTypeReferenceNode(node.typeArguments[0].kind === 148 ? "number" : "string", []), + /*initializer*/ + void 0 + ); + var indexSignature = ts2.factory.createTypeLiteralNode([ts2.factory.createIndexSignature( + /*modifiers*/ + void 0, + [index4], + node.typeArguments[1] + )]); + ts2.setEmitFlags( + indexSignature, + 1 + /* EmitFlags.SingleLine */ + ); + return indexSignature; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "convertFunctionToEs6Class"; + var errorCodes = [ts2.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, context2.span.start, context2.program.getTypeChecker(), context2.preferences, context2.program.getCompilerOptions()); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_function_to_an_ES2015_class, fixId, ts2.Diagnostics.Convert_all_constructor_functions_to_classes)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, err) { + return doChange(changes, err.file, err.start, context2.program.getTypeChecker(), context2.preferences, context2.program.getCompilerOptions()); + }); + } + }); + function doChange(changes, sourceFile, position, checker, preferences, compilerOptions) { + var ctorSymbol = checker.getSymbolAtLocation(ts2.getTokenAtPosition(sourceFile, position)); + if (!ctorSymbol || !ctorSymbol.valueDeclaration || !(ctorSymbol.flags & (16 | 3))) { + return void 0; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + if (ts2.isFunctionDeclaration(ctorDeclaration) || ts2.isFunctionExpression(ctorDeclaration)) { + changes.replaceNode(sourceFile, ctorDeclaration, createClassFromFunction(ctorDeclaration)); + } else if (ts2.isVariableDeclaration(ctorDeclaration)) { + var classDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + if (!classDeclaration) { + return void 0; + } + var ancestor = ctorDeclaration.parent.parent; + if (ts2.isVariableDeclarationList(ctorDeclaration.parent) && ctorDeclaration.parent.declarations.length > 1) { + changes.delete(sourceFile, ctorDeclaration); + changes.insertNodeAfter(sourceFile, ancestor, classDeclaration); + } else { + changes.replaceNode(sourceFile, ancestor, classDeclaration); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + if (symbol.exports) { + symbol.exports.forEach(function(member) { + if (member.name === "prototype" && member.declarations) { + var firstDeclaration = member.declarations[0]; + if (member.declarations.length === 1 && ts2.isPropertyAccessExpression(firstDeclaration) && ts2.isBinaryExpression(firstDeclaration.parent) && firstDeclaration.parent.operatorToken.kind === 63 && ts2.isObjectLiteralExpression(firstDeclaration.parent.right)) { + var prototypes = firstDeclaration.parent.right; + createClassElement( + prototypes.symbol, + /** modifiers */ + void 0, + memberElements + ); + } + } else { + createClassElement(member, [ts2.factory.createToken( + 124 + /* SyntaxKind.StaticKeyword */ + )], memberElements); + } + }); + } + if (symbol.members) { + symbol.members.forEach(function(member, key) { + var _a2, _b, _c, _d; + if (key === "constructor" && member.valueDeclaration) { + var prototypeAssignment = (_d = (_c = (_b = (_a2 = symbol.exports) === null || _a2 === void 0 ? void 0 : _a2.get("prototype")) === null || _b === void 0 ? void 0 : _b.declarations) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.parent; + if (prototypeAssignment && ts2.isBinaryExpression(prototypeAssignment) && ts2.isObjectLiteralExpression(prototypeAssignment.right) && ts2.some(prototypeAssignment.right.properties, isConstructorAssignment)) { + } else { + changes.delete(sourceFile, member.valueDeclaration.parent); + } + return; + } + createClassElement( + member, + /*modifiers*/ + void 0, + memberElements + ); + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + if (ts2.isAccessExpression(_target)) { + if (ts2.isPropertyAccessExpression(_target) && isConstructorAssignment(_target)) + return true; + return ts2.isFunctionLike(source); + } else { + return ts2.every(_target.properties, function(property2) { + if (ts2.isMethodDeclaration(property2) || ts2.isGetOrSetAccessorDeclaration(property2)) + return true; + if (ts2.isPropertyAssignment(property2) && ts2.isFunctionExpression(property2.initializer) && !!property2.name) + return true; + if (isConstructorAssignment(property2)) + return true; + return false; + }); + } + } + function createClassElement(symbol2, modifiers, members) { + if (!(symbol2.flags & 8192) && !(symbol2.flags & 4096)) { + return; + } + var memberDeclaration = symbol2.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + var assignmentExpr = assignmentBinaryExpression.right; + if (!shouldConvertDeclaration(memberDeclaration, assignmentExpr)) { + return; + } + if (ts2.some(members, function(m7) { + var name3 = ts2.getNameOfDeclaration(m7); + if (name3 && ts2.isIdentifier(name3) && ts2.idText(name3) === ts2.symbolName(symbol2)) { + return true; + } + return false; + })) { + return; + } + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 241 ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + changes.delete(sourceFile, nodeToDelete); + if (!assignmentExpr) { + members.push(ts2.factory.createPropertyDeclaration( + modifiers, + symbol2.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )); + return; + } + if (ts2.isAccessExpression(memberDeclaration) && (ts2.isFunctionExpression(assignmentExpr) || ts2.isArrowFunction(assignmentExpr))) { + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + var name2 = tryGetPropertyName(memberDeclaration, compilerOptions, quotePreference); + if (name2) { + createFunctionLikeExpressionMember(members, assignmentExpr, name2); + } + return; + } else if (ts2.isObjectLiteralExpression(assignmentExpr)) { + ts2.forEach(assignmentExpr.properties, function(property2) { + if (ts2.isMethodDeclaration(property2) || ts2.isGetOrSetAccessorDeclaration(property2)) { + members.push(property2); + } + if (ts2.isPropertyAssignment(property2) && ts2.isFunctionExpression(property2.initializer)) { + createFunctionLikeExpressionMember(members, property2.initializer, property2.name); + } + if (isConstructorAssignment(property2)) + return; + return; + }); + return; + } else { + if (ts2.isSourceFileJS(sourceFile)) + return; + if (!ts2.isPropertyAccessExpression(memberDeclaration)) + return; + var prop = ts2.factory.createPropertyDeclaration( + modifiers, + memberDeclaration.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + assignmentExpr + ); + ts2.copyLeadingComments(assignmentBinaryExpression.parent, prop, sourceFile); + members.push(prop); + return; + } + function createFunctionLikeExpressionMember(members2, expression, name3) { + if (ts2.isFunctionExpression(expression)) + return createFunctionExpressionMember(members2, expression, name3); + else + return createArrowFunctionExpressionMember(members2, expression, name3); + } + function createFunctionExpressionMember(members2, functionExpression, name3) { + var fullModifiers = ts2.concatenate(modifiers, getModifierKindFromSource( + functionExpression, + 132 + /* SyntaxKind.AsyncKeyword */ + )); + var method2 = ts2.factory.createMethodDeclaration( + fullModifiers, + /*asteriskToken*/ + void 0, + name3, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + functionExpression.parameters, + /*type*/ + void 0, + functionExpression.body + ); + ts2.copyLeadingComments(assignmentBinaryExpression, method2, sourceFile); + members2.push(method2); + return; + } + function createArrowFunctionExpressionMember(members2, arrowFunction, name3) { + var arrowFunctionBody = arrowFunction.body; + var bodyBlock; + if (arrowFunctionBody.kind === 238) { + bodyBlock = arrowFunctionBody; + } else { + bodyBlock = ts2.factory.createBlock([ts2.factory.createReturnStatement(arrowFunctionBody)]); + } + var fullModifiers = ts2.concatenate(modifiers, getModifierKindFromSource( + arrowFunction, + 132 + /* SyntaxKind.AsyncKeyword */ + )); + var method2 = ts2.factory.createMethodDeclaration( + fullModifiers, + /*asteriskToken*/ + void 0, + name3, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + arrowFunction.parameters, + /*type*/ + void 0, + bodyBlock + ); + ts2.copyLeadingComments(assignmentBinaryExpression, method2, sourceFile); + members2.push(method2); + } + } + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || !ts2.isFunctionExpression(initializer) || !ts2.isIdentifier(node.name)) { + return void 0; + } + var memberElements = createClassElementsFromSymbol(node.symbol); + if (initializer.body) { + memberElements.unshift(ts2.factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + initializer.parameters, + initializer.body + )); + } + var modifiers = getModifierKindFromSource( + node.parent.parent, + 93 + /* SyntaxKind.ExportKeyword */ + ); + var cls = ts2.factory.createClassDeclaration( + modifiers, + node.name, + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + memberElements + ); + return cls; + } + function createClassFromFunction(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts2.factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + node.parameters, + node.body + )); + } + var modifiers = getModifierKindFromSource( + node, + 93 + /* SyntaxKind.ExportKeyword */ + ); + var cls = ts2.factory.createClassDeclaration( + modifiers, + node.name, + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + memberElements + ); + return cls; + } + } + function getModifierKindFromSource(source, kind) { + return ts2.canHaveModifiers(source) ? ts2.filter(source.modifiers, function(modifier) { + return modifier.kind === kind; + }) : void 0; + } + function isConstructorAssignment(x7) { + if (!x7.name) + return false; + if (ts2.isIdentifier(x7.name) && x7.name.text === "constructor") + return true; + return false; + } + function tryGetPropertyName(node, compilerOptions, quotePreference) { + if (ts2.isPropertyAccessExpression(node)) { + return node.name; + } + var propName2 = node.argumentExpression; + if (ts2.isNumericLiteral(propName2)) { + return propName2; + } + if (ts2.isStringLiteralLike(propName2)) { + return ts2.isIdentifierText(propName2.text, ts2.getEmitScriptTarget(compilerOptions)) ? ts2.factory.createIdentifier(propName2.text) : ts2.isNoSubstitutionTemplateLiteral(propName2) ? ts2.factory.createStringLiteral( + propName2.text, + quotePreference === 0 + /* QuotePreference.Single */ + ) : propName2; + } + return void 0; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "convertToAsyncFunction"; + var errorCodes = [ts2.Diagnostics.This_may_be_converted_to_an_async_function.code]; + var codeActionSucceeded = true; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + codeActionSucceeded = true; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return convertToAsyncFunction(t8, context2.sourceFile, context2.span.start, context2.program.getTypeChecker()); + }); + return codeActionSucceeded ? [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_to_async_function, fixId, ts2.Diagnostics.Convert_all_to_async_functions)] : []; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, err) { + return convertToAsyncFunction(changes, err.file, err.start, context2.program.getTypeChecker()); + }); + } + }); + var SynthBindingNameKind; + (function(SynthBindingNameKind2) { + SynthBindingNameKind2[SynthBindingNameKind2["Identifier"] = 0] = "Identifier"; + SynthBindingNameKind2[SynthBindingNameKind2["BindingPattern"] = 1] = "BindingPattern"; + })(SynthBindingNameKind || (SynthBindingNameKind = {})); + function convertToAsyncFunction(changes, sourceFile, position, checker) { + var tokenAtPosition = ts2.getTokenAtPosition(sourceFile, position); + var functionToConvert; + if (ts2.isIdentifier(tokenAtPosition) && ts2.isVariableDeclaration(tokenAtPosition.parent) && tokenAtPosition.parent.initializer && ts2.isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) { + functionToConvert = tokenAtPosition.parent.initializer; + } else { + functionToConvert = ts2.tryCast(ts2.getContainingFunction(ts2.getTokenAtPosition(sourceFile, position)), ts2.canBeConvertedToAsync); + } + if (!functionToConvert) { + return; + } + var synthNamesMap = new ts2.Map(); + var isInJavascript = ts2.isInJSFile(functionToConvert); + var setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); + var functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap); + if (!ts2.returnsPromise(functionToConvertRenamed, checker)) { + return; + } + var returnStatements = functionToConvertRenamed.body && ts2.isBlock(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body, checker) : ts2.emptyArray; + var transformer = { checker, synthNamesMap, setOfExpressionsToReturn, isInJSFile: isInJavascript }; + if (!returnStatements.length) { + return; + } + var pos = ts2.skipTrivia(sourceFile.text, ts2.moveRangePastModifiers(functionToConvert).pos); + changes.insertModifierAt(sourceFile, pos, 132, { suffix: " " }); + var _loop_12 = function(returnStatement2) { + ts2.forEachChild(returnStatement2, function visit7(node) { + if (ts2.isCallExpression(node)) { + var newNodes = transformExpression( + node, + node, + transformer, + /*hasContinuation*/ + false + ); + if (hasFailed()) { + return true; + } + changes.replaceNodeWithNodes(sourceFile, returnStatement2, newNodes); + } else if (!ts2.isFunctionLike(node)) { + ts2.forEachChild(node, visit7); + if (hasFailed()) { + return true; + } + } + }); + if (hasFailed()) { + return { value: void 0 }; + } + }; + for (var _i = 0, returnStatements_1 = returnStatements; _i < returnStatements_1.length; _i++) { + var returnStatement = returnStatements_1[_i]; + var state_5 = _loop_12(returnStatement); + if (typeof state_5 === "object") + return state_5.value; + } + } + function getReturnStatementsWithPromiseHandlers(body, checker) { + var res = []; + ts2.forEachReturnStatement(body, function(ret) { + if (ts2.isReturnStatementWithFixablePromiseHandler(ret, checker)) + res.push(ret); + }); + return res; + } + function getAllPromiseExpressionsToReturn(func, checker) { + if (!func.body) { + return new ts2.Set(); + } + var setOfExpressionsToReturn = new ts2.Set(); + ts2.forEachChild(func.body, function visit7(node) { + if (isPromiseReturningCallExpression(node, checker, "then")) { + setOfExpressionsToReturn.add(ts2.getNodeId(node)); + ts2.forEach(node.arguments, visit7); + } else if (isPromiseReturningCallExpression(node, checker, "catch") || isPromiseReturningCallExpression(node, checker, "finally")) { + setOfExpressionsToReturn.add(ts2.getNodeId(node)); + ts2.forEachChild(node, visit7); + } else if (isPromiseTypedExpression(node, checker)) { + setOfExpressionsToReturn.add(ts2.getNodeId(node)); + } else { + ts2.forEachChild(node, visit7); + } + }); + return setOfExpressionsToReturn; + } + function isPromiseReturningCallExpression(node, checker, name2) { + if (!ts2.isCallExpression(node)) + return false; + var isExpressionOfName = ts2.hasPropertyAccessExpressionWithName(node, name2); + var nodeType = isExpressionOfName && checker.getTypeAtLocation(node); + return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); + } + function isReferenceToType(type3, target) { + return (ts2.getObjectFlags(type3) & 4) !== 0 && type3.target === target; + } + function getExplicitPromisedTypeOfPromiseReturningCallExpression(node, callback, checker) { + if (node.expression.name.escapedText === "finally") { + return void 0; + } + var promiseType2 = checker.getTypeAtLocation(node.expression.expression); + if (isReferenceToType(promiseType2, checker.getPromiseType()) || isReferenceToType(promiseType2, checker.getPromiseLikeType())) { + if (node.expression.name.escapedText === "then") { + if (callback === ts2.elementAt(node.arguments, 0)) { + return ts2.elementAt(node.typeArguments, 0); + } else if (callback === ts2.elementAt(node.arguments, 1)) { + return ts2.elementAt(node.typeArguments, 1); + } + } else { + return ts2.elementAt(node.typeArguments, 0); + } + } + } + function isPromiseTypedExpression(node, checker) { + if (!ts2.isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap) { + var identsToRenameMap = new ts2.Map(); + var collidingSymbolMap = ts2.createMultiMap(); + ts2.forEachChild(nodeToRename, function visit7(node) { + if (!ts2.isIdentifier(node)) { + ts2.forEachChild(node, visit7); + return; + } + var symbol = checker.getSymbolAtLocation(node); + if (symbol) { + var type3 = checker.getTypeAtLocation(node); + var lastCallSignature = getLastCallSignature(type3, checker); + var symbolIdString = ts2.getSymbolId(symbol).toString(); + if (lastCallSignature && !ts2.isParameter(node.parent) && !ts2.isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + var firstParameter = ts2.firstOrUndefined(lastCallSignature.parameters); + var ident = (firstParameter === null || firstParameter === void 0 ? void 0 : firstParameter.valueDeclaration) && ts2.isParameter(firstParameter.valueDeclaration) && ts2.tryCast(firstParameter.valueDeclaration.name, ts2.isIdentifier) || ts2.factory.createUniqueName( + "result", + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + var synthName = getNewNameIfConflict(ident, collidingSymbolMap); + synthNamesMap.set(symbolIdString, synthName); + collidingSymbolMap.add(ident.text, symbol); + } else if (node.parent && (ts2.isParameter(node.parent) || ts2.isVariableDeclaration(node.parent) || ts2.isBindingElement(node.parent))) { + var originalName = node.text; + var collidingSymbols = collidingSymbolMap.get(originalName); + if (collidingSymbols && collidingSymbols.some(function(prevSymbol) { + return prevSymbol !== symbol; + })) { + var newName = getNewNameIfConflict(node, collidingSymbolMap); + identsToRenameMap.set(symbolIdString, newName.identifier); + synthNamesMap.set(symbolIdString, newName); + collidingSymbolMap.add(originalName, symbol); + } else { + var identifier = ts2.getSynthesizedDeepClone(node); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + collidingSymbolMap.add(originalName, symbol); + } + } + } + }); + return ts2.getSynthesizedDeepCloneWithReplacements( + nodeToRename, + /*includeTrivia*/ + true, + function(original) { + if (ts2.isBindingElement(original) && ts2.isIdentifier(original.name) && ts2.isObjectBindingPattern(original.parent)) { + var symbol = checker.getSymbolAtLocation(original.name); + var renameInfo = symbol && identsToRenameMap.get(String(ts2.getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { + return ts2.factory.createBindingElement(original.dotDotDotToken, original.propertyName || original.name, renameInfo, original.initializer); + } + } else if (ts2.isIdentifier(original)) { + var symbol = checker.getSymbolAtLocation(original); + var renameInfo = symbol && identsToRenameMap.get(String(ts2.getSymbolId(symbol))); + if (renameInfo) { + return ts2.factory.createIdentifier(renameInfo.text); + } + } + } + ); + } + function getNewNameIfConflict(name2, originalNames) { + var numVarsSameName = (originalNames.get(name2.text) || ts2.emptyArray).length; + var identifier = numVarsSameName === 0 ? name2 : ts2.factory.createIdentifier(name2.text + "_" + numVarsSameName); + return createSynthIdentifier(identifier); + } + function hasFailed() { + return !codeActionSucceeded; + } + function silentFail() { + codeActionSucceeded = false; + return ts2.emptyArray; + } + function transformExpression(returnContextNode, node, transformer, hasContinuation, continuationArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + return transformThen(node, ts2.elementAt(node.arguments, 0), ts2.elementAt(node.arguments, 1), transformer, hasContinuation, continuationArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + return transformCatch(node, ts2.elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "finally")) { + return transformFinally(node, ts2.elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); + } + if (ts2.isPropertyAccessExpression(node)) { + return transformExpression(returnContextNode, node.expression, transformer, hasContinuation, continuationArgName); + } + var nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + ts2.Debug.assertNode(ts2.getOriginalNode(node).parent, ts2.isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName); + } + return silentFail(); + } + function isNullOrUndefined2(_a2, node) { + var checker = _a2.checker; + if (node.kind === 104) + return true; + if (ts2.isIdentifier(node) && !ts2.isGeneratedIdentifier(node) && ts2.idText(node) === "undefined") { + var symbol = checker.getSymbolAtLocation(node); + return !symbol || checker.isUndefinedSymbol(symbol); + } + return false; + } + function createUniqueSynthName(prevArgName) { + var renamedPrevArg = ts2.factory.createUniqueName( + prevArgName.identifier.text, + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + return createSynthIdentifier(renamedPrevArg); + } + function getPossibleNameForVarDecl(node, transformer, continuationArgName) { + var possibleNameForVarDecl; + if (continuationArgName && !shouldReturn(node, transformer)) { + if (isSynthIdentifier(continuationArgName)) { + possibleNameForVarDecl = continuationArgName; + transformer.synthNamesMap.forEach(function(val, key) { + if (val.identifier.text === continuationArgName.identifier.text) { + var newSynthName = createUniqueSynthName(continuationArgName); + transformer.synthNamesMap.set(key, newSynthName); + } + }); + } else { + possibleNameForVarDecl = createSynthIdentifier(ts2.factory.createUniqueName( + "result", + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ), continuationArgName.types); + } + declareSynthIdentifier(possibleNameForVarDecl); + } + return possibleNameForVarDecl; + } + function finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName) { + var statements = []; + var varDeclIdentifier; + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { + varDeclIdentifier = ts2.getSynthesizedDeepClone(declareSynthIdentifier(possibleNameForVarDecl)); + var typeArray = possibleNameForVarDecl.types; + var unionType2 = transformer.checker.getUnionType( + typeArray, + 2 + /* UnionReduction.Subtype */ + ); + var unionTypeNode = transformer.isInJSFile ? void 0 : transformer.checker.typeToTypeNode( + unionType2, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0 + ); + var varDecl = [ts2.factory.createVariableDeclaration( + varDeclIdentifier, + /*exclamationToken*/ + void 0, + unionTypeNode + )]; + var varDeclList = ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + varDecl, + 1 + /* NodeFlags.Let */ + ) + ); + statements.push(varDeclList); + } + statements.push(tryStatement); + if (continuationArgName && varDeclIdentifier && isSynthBindingPattern(continuationArgName)) { + statements.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ + ts2.factory.createVariableDeclaration( + ts2.getSynthesizedDeepClone(declareSynthBindingPattern(continuationArgName)), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + varDeclIdentifier + ) + ], + 2 + /* NodeFlags.Const */ + ) + )); + } + return statements; + } + function transformFinally(node, onFinally, transformer, hasContinuation, continuationArgName) { + if (!onFinally || isNullOrUndefined2(transformer, onFinally)) { + return transformExpression( + /* returnContextNode */ + node, + node.expression.expression, + transformer, + hasContinuation, + continuationArgName + ); + } + var possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); + var inlinedLeftHandSide = transformExpression( + /*returnContextNode*/ + node, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + possibleNameForVarDecl + ); + if (hasFailed()) + return silentFail(); + var inlinedCallback = transformCallbackArgument( + onFinally, + hasContinuation, + /*continuationArgName*/ + void 0, + /*argName*/ + void 0, + node, + transformer + ); + if (hasFailed()) + return silentFail(); + var tryBlock = ts2.factory.createBlock(inlinedLeftHandSide); + var finallyBlock = ts2.factory.createBlock(inlinedCallback); + var tryStatement = ts2.factory.createTryStatement( + tryBlock, + /*catchClause*/ + void 0, + finallyBlock + ); + return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); + } + function transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName) { + if (!onRejected || isNullOrUndefined2(transformer, onRejected)) { + return transformExpression( + /* returnContextNode */ + node, + node.expression.expression, + transformer, + hasContinuation, + continuationArgName + ); + } + var inputArgName = getArgBindingName(onRejected, transformer); + var possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); + var inlinedLeftHandSide = transformExpression( + /*returnContextNode*/ + node, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + possibleNameForVarDecl + ); + if (hasFailed()) + return silentFail(); + var inlinedCallback = transformCallbackArgument(onRejected, hasContinuation, possibleNameForVarDecl, inputArgName, node, transformer); + if (hasFailed()) + return silentFail(); + var tryBlock = ts2.factory.createBlock(inlinedLeftHandSide); + var catchClause = ts2.factory.createCatchClause(inputArgName && ts2.getSynthesizedDeepClone(declareSynthBindingName(inputArgName)), ts2.factory.createBlock(inlinedCallback)); + var tryStatement = ts2.factory.createTryStatement( + tryBlock, + catchClause, + /*finallyBlock*/ + void 0 + ); + return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); + } + function transformThen(node, onFulfilled, onRejected, transformer, hasContinuation, continuationArgName) { + if (!onFulfilled || isNullOrUndefined2(transformer, onFulfilled)) { + return transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName); + } + if (onRejected && !isNullOrUndefined2(transformer, onRejected)) { + return silentFail(); + } + var inputArgName = getArgBindingName(onFulfilled, transformer); + var inlinedLeftHandSide = transformExpression( + node.expression.expression, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + inputArgName + ); + if (hasFailed()) + return silentFail(); + var inlinedCallback = transformCallbackArgument(onFulfilled, hasContinuation, continuationArgName, inputArgName, node, transformer); + if (hasFailed()) + return silentFail(); + return ts2.concatenate(inlinedLeftHandSide, inlinedCallback); + } + function transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName) { + if (shouldReturn(returnContextNode, transformer)) { + var returnValue = ts2.getSynthesizedDeepClone(node); + if (hasContinuation) { + returnValue = ts2.factory.createAwaitExpression(returnValue); + } + return [ts2.factory.createReturnStatement(returnValue)]; + } + return createVariableOrAssignmentOrExpressionStatement( + continuationArgName, + ts2.factory.createAwaitExpression(node), + /*typeAnnotation*/ + void 0 + ); + } + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide, typeAnnotation) { + if (!variableName || isEmptyBindingName(variableName)) { + return [ts2.factory.createExpressionStatement(rightHandSide)]; + } + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { + return [ts2.factory.createExpressionStatement(ts2.factory.createAssignment(ts2.getSynthesizedDeepClone(referenceSynthIdentifier(variableName)), rightHandSide))]; + } + return [ + ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ + ts2.factory.createVariableDeclaration( + ts2.getSynthesizedDeepClone(declareSynthBindingName(variableName)), + /*exclamationToken*/ + void 0, + typeAnnotation, + rightHandSide + ) + ], + 2 + /* NodeFlags.Const */ + ) + ) + ]; + } + function maybeAnnotateAndReturn(expressionToReturn, typeAnnotation) { + if (typeAnnotation && expressionToReturn) { + var name2 = ts2.factory.createUniqueName( + "result", + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + return __spreadArray9(__spreadArray9([], createVariableOrAssignmentOrExpressionStatement(createSynthIdentifier(name2), expressionToReturn, typeAnnotation), true), [ + ts2.factory.createReturnStatement(name2) + ], false); + } + return [ts2.factory.createReturnStatement(expressionToReturn)]; + } + function transformCallbackArgument(func, hasContinuation, continuationArgName, inputArgName, parent2, transformer) { + var _a2; + switch (func.kind) { + case 104: + break; + case 208: + case 79: + if (!inputArgName) { + break; + } + var synthCall = ts2.factory.createCallExpression( + ts2.getSynthesizedDeepClone(func), + /*typeArguments*/ + void 0, + isSynthIdentifier(inputArgName) ? [referenceSynthIdentifier(inputArgName)] : [] + ); + if (shouldReturn(parent2, transformer)) { + return maybeAnnotateAndReturn(synthCall, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); + } + var type3 = transformer.checker.getTypeAtLocation(func); + var callSignatures = transformer.checker.getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + if (!callSignatures.length) { + return silentFail(); + } + var returnType = callSignatures[0].getReturnType(); + var varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(continuationArgName, ts2.factory.createAwaitExpression(synthCall), getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); + if (continuationArgName) { + continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); + } + return varDeclOrAssignment; + case 215: + case 216: { + var funcBody = func.body; + var returnType_1 = (_a2 = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) === null || _a2 === void 0 ? void 0 : _a2.getReturnType(); + if (ts2.isBlock(funcBody)) { + var refactoredStmts = []; + var seenReturnStatement = false; + for (var _i = 0, _b = funcBody.statements; _i < _b.length; _i++) { + var statement = _b[_i]; + if (ts2.isReturnStatement(statement)) { + seenReturnStatement = true; + if (ts2.isReturnStatementWithFixablePromiseHandler(statement, transformer.checker)) { + refactoredStmts = refactoredStmts.concat(transformReturnStatementWithFixablePromiseHandler(transformer, statement, hasContinuation, continuationArgName)); + } else { + var possiblyAwaitedRightHandSide = returnType_1 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, statement.expression) : statement.expression; + refactoredStmts.push.apply(refactoredStmts, maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker))); + } + } else if (hasContinuation && ts2.forEachReturnStatement(statement, ts2.returnTrue)) { + return silentFail(); + } else { + refactoredStmts.push(statement); + } + } + return shouldReturn(parent2, transformer) ? refactoredStmts.map(function(s7) { + return ts2.getSynthesizedDeepClone(s7); + }) : removeReturns(refactoredStmts, continuationArgName, transformer, seenReturnStatement); + } else { + var inlinedStatements = ts2.isFixablePromiseHandler(funcBody, transformer.checker) ? transformReturnStatementWithFixablePromiseHandler(transformer, ts2.factory.createReturnStatement(funcBody), hasContinuation, continuationArgName) : ts2.emptyArray; + if (inlinedStatements.length > 0) { + return inlinedStatements; + } + if (returnType_1) { + var possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType_1, funcBody); + if (!shouldReturn(parent2, transformer)) { + var transformedStatement = createVariableOrAssignmentOrExpressionStatement( + continuationArgName, + possiblyAwaitedRightHandSide, + /*typeAnnotation*/ + void 0 + ); + if (continuationArgName) { + continuationArgName.types.push(transformer.checker.getAwaitedType(returnType_1) || returnType_1); + } + return transformedStatement; + } else { + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent2, func, transformer.checker)); + } + } else { + return silentFail(); + } + } + } + default: + return silentFail(); + } + return ts2.emptyArray; + } + function getPossiblyAwaitedRightHandSide(checker, type3, expr) { + var rightHandSide = ts2.getSynthesizedDeepClone(expr); + return !!checker.getPromisedTypeOfPromise(type3) ? ts2.factory.createAwaitExpression(rightHandSide) : rightHandSide; + } + function getLastCallSignature(type3, checker) { + var callSignatures = checker.getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + return ts2.lastOrUndefined(callSignatures); + } + function removeReturns(stmts, prevArgName, transformer, seenReturnStatement) { + var ret = []; + for (var _i = 0, stmts_1 = stmts; _i < stmts_1.length; _i++) { + var stmt = stmts_1[_i]; + if (ts2.isReturnStatement(stmt)) { + if (stmt.expression) { + var possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? ts2.factory.createAwaitExpression(stmt.expression) : stmt.expression; + if (prevArgName === void 0) { + ret.push(ts2.factory.createExpressionStatement(possiblyAwaitedExpression)); + } else if (isSynthIdentifier(prevArgName) && prevArgName.hasBeenDeclared) { + ret.push(ts2.factory.createExpressionStatement(ts2.factory.createAssignment(referenceSynthIdentifier(prevArgName), possiblyAwaitedExpression))); + } else { + ret.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ts2.factory.createVariableDeclaration( + declareSynthBindingName(prevArgName), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + possiblyAwaitedExpression + )], + 2 + /* NodeFlags.Const */ + ) + )); + } + } + } else { + ret.push(ts2.getSynthesizedDeepClone(stmt)); + } + } + if (!seenReturnStatement && prevArgName !== void 0) { + ret.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ts2.factory.createVariableDeclaration( + declareSynthBindingName(prevArgName), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.factory.createIdentifier("undefined") + )], + 2 + /* NodeFlags.Const */ + ) + )); + } + return ret; + } + function transformReturnStatementWithFixablePromiseHandler(transformer, innerRetStmt, hasContinuation, continuationArgName) { + var innerCbBody = []; + ts2.forEachChild(innerRetStmt, function visit7(node) { + if (ts2.isCallExpression(node)) { + var temp = transformExpression(node, node, transformer, hasContinuation, continuationArgName); + innerCbBody = innerCbBody.concat(temp); + if (innerCbBody.length > 0) { + return; + } + } else if (!ts2.isFunctionLike(node)) { + ts2.forEachChild(node, visit7); + } + }); + return innerCbBody; + } + function getArgBindingName(funcNode, transformer) { + var types3 = []; + var name2; + if (ts2.isFunctionLikeDeclaration(funcNode)) { + if (funcNode.parameters.length > 0) { + var param = funcNode.parameters[0].name; + name2 = getMappedBindingNameOrDefault(param); + } + } else if (ts2.isIdentifier(funcNode)) { + name2 = getMapEntryOrDefault(funcNode); + } else if (ts2.isPropertyAccessExpression(funcNode) && ts2.isIdentifier(funcNode.name)) { + name2 = getMapEntryOrDefault(funcNode.name); + } + if (!name2 || "identifier" in name2 && name2.identifier.text === "undefined") { + return void 0; + } + return name2; + function getMappedBindingNameOrDefault(bindingName) { + if (ts2.isIdentifier(bindingName)) + return getMapEntryOrDefault(bindingName); + var elements = ts2.flatMap(bindingName.elements, function(element) { + if (ts2.isOmittedExpression(element)) + return []; + return [getMappedBindingNameOrDefault(element.name)]; + }); + return createSynthBindingPattern(bindingName, elements); + } + function getMapEntryOrDefault(identifier) { + var originalNode = getOriginalNode(identifier); + var symbol = getSymbol(originalNode); + if (!symbol) { + return createSynthIdentifier(identifier, types3); + } + var mapEntry = transformer.synthNamesMap.get(ts2.getSymbolId(symbol).toString()); + return mapEntry || createSynthIdentifier(identifier, types3); + } + function getSymbol(node) { + return node.symbol ? node.symbol : transformer.checker.getSymbolAtLocation(node); + } + function getOriginalNode(node) { + return node.original ? node.original : node; + } + } + function isEmptyBindingName(bindingName) { + if (!bindingName) { + return true; + } + if (isSynthIdentifier(bindingName)) { + return !bindingName.identifier.text; + } + return ts2.every(bindingName.elements, isEmptyBindingName); + } + function createSynthIdentifier(identifier, types3) { + if (types3 === void 0) { + types3 = []; + } + return { kind: 0, identifier, types: types3, hasBeenDeclared: false, hasBeenReferenced: false }; + } + function createSynthBindingPattern(bindingPattern, elements, types3) { + if (elements === void 0) { + elements = ts2.emptyArray; + } + if (types3 === void 0) { + types3 = []; + } + return { kind: 1, bindingPattern, elements, types: types3 }; + } + function referenceSynthIdentifier(synthId) { + synthId.hasBeenReferenced = true; + return synthId.identifier; + } + function declareSynthBindingName(synthName) { + return isSynthIdentifier(synthName) ? declareSynthIdentifier(synthName) : declareSynthBindingPattern(synthName); + } + function declareSynthBindingPattern(synthPattern) { + for (var _i = 0, _a2 = synthPattern.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + declareSynthBindingName(element); + } + return synthPattern.bindingPattern; + } + function declareSynthIdentifier(synthId) { + synthId.hasBeenDeclared = true; + return synthId.identifier; + } + function isSynthIdentifier(bindingName) { + return bindingName.kind === 0; + } + function isSynthBindingPattern(bindingName) { + return bindingName.kind === 1; + } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(ts2.getNodeId(expression.original)); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + codefix2.registerCodeFix({ + errorCodes: [ts2.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, preferences = context2.preferences; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changes2) { + var moduleExportsChangedToDefault = convertFileToEsModule(sourceFile, program.getTypeChecker(), changes2, ts2.getEmitScriptTarget(program.getCompilerOptions()), ts2.getQuotePreference(sourceFile, preferences)); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a2 = program.getSourceFiles(); _i < _a2.length; _i++) { + var importingFile = _a2[_i]; + fixImportOfModuleExports(importingFile, sourceFile, changes2, ts2.getQuotePreference(importingFile, preferences)); + } + } + }); + return [codefix2.createCodeFixActionWithoutFixAll("convertToEsModule", changes, ts2.Diagnostics.Convert_to_ES_module)]; + } + }); + function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePreference) { + for (var _i = 0, _a2 = importingFile.imports; _i < _a2.length; _i++) { + var moduleSpecifier = _a2[_i]; + var imported = ts2.getResolvedModule(importingFile, moduleSpecifier.text, ts2.getModeForUsageLocation(importingFile, moduleSpecifier)); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var importNode = ts2.importFromModuleSpecifier(moduleSpecifier); + switch (importNode.kind) { + case 268: + changes.replaceNode(importingFile, importNode, ts2.makeImport( + importNode.name, + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + )); + break; + case 210: + if (ts2.isRequireCall( + importNode, + /*checkArgumentIsStringLiteralLike*/ + false + )) { + changes.replaceNode(importingFile, importNode, ts2.factory.createPropertyAccessExpression(ts2.getSynthesizedDeepClone(importNode), "default")); + } + break; + } + } + } + function convertFileToEsModule(sourceFile, checker, changes, target, quotePreference) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: new ts2.Set() }; + var exports29 = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports29, changes); + var moduleExportsChangedToDefault = false; + var useSitesToUnqualify; + for (var _i = 0, _a2 = ts2.filter(sourceFile.statements, ts2.isVariableStatement); _i < _a2.length; _i++) { + var statement = _a2[_i]; + var newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); + if (newUseSites) { + ts2.copyEntries(newUseSites, useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : useSitesToUnqualify = new ts2.Map()); + } + } + for (var _b = 0, _c = ts2.filter(sourceFile.statements, function(s7) { + return !ts2.isVariableStatement(s7); + }); _b < _c.length; _b++) { + var statement = _c[_b]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports29, useSitesToUnqualify, quotePreference); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + useSitesToUnqualify === null || useSitesToUnqualify === void 0 ? void 0 : useSitesToUnqualify.forEach(function(replacement, original) { + changes.replaceNode(sourceFile, original, replacement); + }); + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = new ts2.Map(); + forEachExportReference(sourceFile, function(node) { + var _a2 = node.name, text = _a2.text, originalKeywordKind = _a2.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== void 0 && ts2.isNonContextualKeyword(originalKeywordKind) || checker.resolveName( + text, + node, + 111551, + /*excludeGlobals*/ + true + ))) { + res.set(text, makeUniqueName("_".concat(text), identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports29, changes) { + forEachExportReference(sourceFile, function(node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts2.factory.createIdentifier(exports29.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts2.isPropertyAccessExpression(node) && ts2.isExportsOrModuleExportsOrAlias(sourceFile, node.expression) && ts2.isIdentifier(node.name)) { + var parent2 = node.parent; + cb( + node, + ts2.isBinaryExpression(parent2) && parent2.left === node && parent2.operatorToken.kind === 63 + /* SyntaxKind.EqualsToken */ + ); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports29, useSitesToUnqualify, quotePreference) { + switch (statement.kind) { + case 240: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); + return false; + case 241: { + var expression = statement.expression; + switch (expression.kind) { + case 210: { + if (ts2.isRequireCall( + expression, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + changes.replaceNode(sourceFile, statement, ts2.makeImport( + /*name*/ + void 0, + /*namedImports*/ + void 0, + expression.arguments[0], + quotePreference + )); + } + return false; + } + case 223: { + var operatorToken = expression.operatorToken; + return operatorToken.kind === 63 && convertAssignment(sourceFile, checker, expression, changes, exports29, useSitesToUnqualify); + } + } + } + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { + var declarationList = statement.declarationList; + var foundImport = false; + var converted = ts2.map(declarationList.declarations, function(decl) { + var name2 = decl.name, initializer = decl.initializer; + if (initializer) { + if (ts2.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + foundImport = true; + return convertedImports([]); + } else if (ts2.isRequireCall( + initializer, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + foundImport = true; + return convertSingleImport(name2, initializer.arguments[0], checker, identifiers, target, quotePreference); + } else if (ts2.isPropertyAccessExpression(initializer) && ts2.isRequireCall( + initializer.expression, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + foundImport = true; + return convertPropertyAccessImport(name2, initializer.name.text, initializer.expression.arguments[0], identifiers, quotePreference); + } + } + return convertedImports([ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList([decl], declarationList.flags) + )]); + }); + if (foundImport) { + changes.replaceNodeWithNodes(sourceFile, statement, ts2.flatMap(converted, function(c7) { + return c7.newImports; + })); + var combinedUseSites_1; + ts2.forEach(converted, function(c7) { + if (c7.useSitesToUnqualify) { + ts2.copyEntries(c7.useSitesToUnqualify, combinedUseSites_1 !== null && combinedUseSites_1 !== void 0 ? combinedUseSites_1 : combinedUseSites_1 = new ts2.Map()); + } + }); + return combinedUseSites_1; + } + } + function convertPropertyAccessImport(name2, propertyName, moduleSpecifier, identifiers, quotePreference) { + switch (name2.kind) { + case 203: + case 204: { + var tmp = makeUniqueName(propertyName, identifiers); + return convertedImports([ + makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), + makeConst( + /*modifiers*/ + void 0, + name2, + ts2.factory.createIdentifier(tmp) + ) + ]); + } + case 79: + return convertedImports([makeSingleImport(name2.text, propertyName, moduleSpecifier, quotePreference)]); + default: + return ts2.Debug.assertNever(name2, "Convert to ES module got invalid syntax form ".concat(name2.kind)); + } + } + function convertAssignment(sourceFile, checker, assignment, changes, exports29, useSitesToUnqualify) { + var left = assignment.left, right = assignment.right; + if (!ts2.isPropertyAccessExpression(left)) { + return false; + } + if (ts2.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts2.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + changes.delete(sourceFile, assignment.parent); + } else { + var replacement = ts2.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) : ts2.isRequireCall( + right, + /*checkArgumentIsStringLiteralLike*/ + true + ) ? convertReExportAll(right.arguments[0], checker) : void 0; + if (replacement) { + changes.replaceNodeWithNodes(sourceFile, assignment.parent, replacement[0]); + return replacement[1]; + } else { + changes.replaceRangeWithText(sourceFile, ts2.createRange(left.getStart(sourceFile), right.pos), "export default"); + return true; + } + } + } else if (ts2.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, assignment, changes, exports29); + } + return false; + } + function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + var statements = ts2.mapAllOrFail(object.properties, function(prop) { + switch (prop.kind) { + case 174: + case 175: + case 300: + case 301: + return void 0; + case 299: + return !ts2.isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); + case 171: + return !ts2.isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [ts2.factory.createToken( + 93 + /* SyntaxKind.ExportKeyword */ + )], prop, useSitesToUnqualify); + default: + ts2.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind)); + } + }); + return statements && [statements, false]; + } + function convertNamedExport(sourceFile, assignment, changes, exports29) { + var text = assignment.left.name.text; + var rename2 = exports29.get(text); + if (rename2 !== void 0) { + var newNodes = [ + makeConst( + /*modifiers*/ + void 0, + rename2, + assignment.right + ), + makeExportDeclaration([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + rename2, + text + )]) + ]; + changes.replaceNodeWithNodes(sourceFile, assignment.parent, newNodes); + } else { + convertExportsPropertyAssignment(assignment, sourceFile, changes); + } + } + function convertReExportAll(reExported, checker) { + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports29 = moduleSymbol ? moduleSymbol.exports : ts2.emptyMap; + return exports29.has( + "export=" + /* InternalSymbolName.ExportEquals */ + ) ? [[reExportDefault(moduleSpecifier)], true] : !exports29.has( + "default" + /* InternalSymbolName.Default */ + ) ? [[reExportStar(moduleSpecifier)], false] : ( + // If there's some non-default export, must include both `export *` and `export default`. + exports29.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true] + ); + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration( + /*exportClause*/ + void 0, + moduleSpecifier + ); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + "default" + )], moduleSpecifier); + } + function convertExportsPropertyAssignment(_a2, sourceFile, changes) { + var left = _a2.left, right = _a2.right, parent2 = _a2.parent; + var name2 = left.name.text; + if ((ts2.isFunctionExpression(right) || ts2.isArrowFunction(right) || ts2.isClassExpression(right)) && (!right.name || right.name.text === name2)) { + changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, ts2.factory.createToken( + 93 + /* SyntaxKind.ExportKeyword */ + ), { suffix: " " }); + if (!right.name) + changes.insertName(sourceFile, right, name2); + var semi = ts2.findChildOfKind(parent2, 26, sourceFile); + if (semi) + changes.delete(sourceFile, semi); + } else { + changes.replaceNodeRangeWithNodes(sourceFile, left.expression, ts2.findChildOfKind(left, 24, sourceFile), [ts2.factory.createToken( + 93 + /* SyntaxKind.ExportKeyword */ + ), ts2.factory.createToken( + 85 + /* SyntaxKind.ConstKeyword */ + )], { joiner: " ", suffix: " " }); + } + } + function convertExportsDotXEquals_replaceNode(name2, exported, useSitesToUnqualify) { + var modifiers = [ts2.factory.createToken( + 93 + /* SyntaxKind.ExportKeyword */ + )]; + switch (exported.kind) { + case 215: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name2) { + return exportConst(); + } + } + case 216: + return functionExpressionToDeclaration(name2, modifiers, exported, useSitesToUnqualify); + case 228: + return classExpressionToDeclaration(name2, modifiers, exported, useSitesToUnqualify); + default: + return exportConst(); + } + function exportConst() { + return makeConst(modifiers, ts2.factory.createIdentifier(name2), replaceImportUseSites(exported, useSitesToUnqualify)); + } + } + function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { + if (!useSitesToUnqualify || !ts2.some(ts2.arrayFrom(useSitesToUnqualify.keys()), function(original) { + return ts2.rangeContainsRange(nodeOrNodes, original); + })) { + return nodeOrNodes; + } + return ts2.isArray(nodeOrNodes) ? ts2.getSynthesizedDeepClonesWithReplacements( + nodeOrNodes, + /*includeTrivia*/ + true, + replaceNode2 + ) : ts2.getSynthesizedDeepCloneWithReplacements( + nodeOrNodes, + /*includeTrivia*/ + true, + replaceNode2 + ); + function replaceNode2(original) { + if (original.kind === 208) { + var replacement = useSitesToUnqualify.get(original); + useSitesToUnqualify.delete(original); + return replacement; + } + } + } + function convertSingleImport(name2, moduleSpecifier, checker, identifiers, target, quotePreference) { + switch (name2.kind) { + case 203: { + var importSpecifiers = ts2.mapAllOrFail(name2.elements, function(e10) { + return e10.dotDotDotToken || e10.initializer || e10.propertyName && !ts2.isIdentifier(e10.propertyName) || !ts2.isIdentifier(e10.name) ? void 0 : makeImportSpecifier(e10.propertyName && e10.propertyName.text, e10.name.text); + }); + if (importSpecifiers) { + return convertedImports([ts2.makeImport( + /*name*/ + void 0, + importSpecifiers, + moduleSpecifier, + quotePreference + )]); + } + } + case 204: { + var tmp = makeUniqueName(codefix2.moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); + return convertedImports([ + ts2.makeImport( + ts2.factory.createIdentifier(tmp), + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + ), + makeConst( + /*modifiers*/ + void 0, + ts2.getSynthesizedDeepClone(name2), + ts2.factory.createIdentifier(tmp) + ) + ]); + } + case 79: + return convertSingleIdentifierImport(name2, moduleSpecifier, checker, identifiers, quotePreference); + default: + return ts2.Debug.assertNever(name2, "Convert to ES module got invalid name kind ".concat(name2.kind)); + } + } + function convertSingleIdentifierImport(name2, moduleSpecifier, checker, identifiers, quotePreference) { + var nameSymbol = checker.getSymbolAtLocation(name2); + var namedBindingsNames = new ts2.Map(); + var needDefaultImport = false; + var useSitesToUnqualify; + for (var _i = 0, _a2 = identifiers.original.get(name2.text); _i < _a2.length; _i++) { + var use = _a2[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name2) { + continue; + } + var parent2 = use.parent; + if (ts2.isPropertyAccessExpression(parent2)) { + var propertyName = parent2.name.text; + if (propertyName === "default") { + needDefaultImport = true; + var importDefaultName = use.getText(); + (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : useSitesToUnqualify = new ts2.Map()).set(parent2, ts2.factory.createIdentifier(importDefaultName)); + } else { + ts2.Debug.assert(parent2.expression === use, "Didn't expect expression === use"); + var idName = namedBindingsNames.get(propertyName); + if (idName === void 0) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + (useSitesToUnqualify !== null && useSitesToUnqualify !== void 0 ? useSitesToUnqualify : useSitesToUnqualify = new ts2.Map()).set(parent2, ts2.factory.createIdentifier(idName)); + } + } else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? void 0 : ts2.arrayFrom(ts2.mapIterator(namedBindingsNames.entries(), function(_a3) { + var propertyName2 = _a3[0], idName2 = _a3[1]; + return ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName2 === idName2 ? void 0 : ts2.factory.createIdentifier(propertyName2), + ts2.factory.createIdentifier(idName2) + ); + })); + if (!namedBindings) { + needDefaultImport = true; + } + return convertedImports([ts2.makeImport(needDefaultImport ? ts2.getSynthesizedDeepClone(name2) : void 0, namedBindings, moduleSpecifier, quotePreference)], useSitesToUnqualify); + } + function makeUniqueName(name2, identifiers) { + while (identifiers.original.has(name2) || identifiers.additional.has(name2)) { + name2 = "_".concat(name2); + } + identifiers.additional.add(name2); + return name2; + } + function collectFreeIdentifiers(file) { + var map4 = ts2.createMultiMap(); + forEachFreeIdentifier(file, function(id) { + return map4.add(id.text, id); + }); + return map4; + } + function forEachFreeIdentifier(node, cb) { + if (ts2.isIdentifier(node) && isFreeIdentifier(node)) + cb(node); + node.forEachChild(function(child) { + return forEachFreeIdentifier(child, cb); + }); + } + function isFreeIdentifier(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 208: + return parent2.name !== node; + case 205: + return parent2.propertyName !== node; + case 273: + return parent2.propertyName !== node; + default: + return true; + } + } + function functionExpressionToDeclaration(name2, additionalModifiers, fn, useSitesToUnqualify) { + return ts2.factory.createFunctionDeclaration(ts2.concatenate(additionalModifiers, ts2.getSynthesizedDeepClones(fn.modifiers)), ts2.getSynthesizedDeepClone(fn.asteriskToken), name2, ts2.getSynthesizedDeepClones(fn.typeParameters), ts2.getSynthesizedDeepClones(fn.parameters), ts2.getSynthesizedDeepClone(fn.type), ts2.factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify))); + } + function classExpressionToDeclaration(name2, additionalModifiers, cls, useSitesToUnqualify) { + return ts2.factory.createClassDeclaration(ts2.concatenate(additionalModifiers, ts2.getSynthesizedDeepClones(cls.modifiers)), name2, ts2.getSynthesizedDeepClones(cls.typeParameters), ts2.getSynthesizedDeepClones(cls.heritageClauses), replaceImportUseSites(cls.members, useSitesToUnqualify)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { + return propertyName === "default" ? ts2.makeImport( + ts2.factory.createIdentifier(localName), + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + ) : ts2.makeImport( + /*name*/ + void 0, + [makeImportSpecifier(propertyName, localName)], + moduleSpecifier, + quotePreference + ); + } + function makeImportSpecifier(propertyName, name2) { + return ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName !== void 0 && propertyName !== name2 ? ts2.factory.createIdentifier(propertyName) : void 0, + ts2.factory.createIdentifier(name2) + ); + } + function makeConst(modifiers, name2, init2) { + return ts2.factory.createVariableStatement(modifiers, ts2.factory.createVariableDeclarationList( + [ts2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + init2 + )], + 2 + /* NodeFlags.Const */ + )); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + exportSpecifiers && ts2.factory.createNamedExports(exportSpecifiers), + moduleSpecifier === void 0 ? void 0 : ts2.factory.createStringLiteral(moduleSpecifier) + ); + } + function convertedImports(newImports, useSitesToUnqualify) { + return { + newImports, + useSitesToUnqualify + }; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "correctQualifiedNameToIndexedAccessType"; + var errorCodes = [ts2.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var qualifiedName = getQualifiedName(context2.sourceFile, context2.span.start); + if (!qualifiedName) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, qualifiedName); + }); + var newText = "".concat(qualifiedName.left.text, '["').concat(qualifiedName.right.text, '"]'); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts2.Diagnostics.Rewrite_all_as_indexed_access_types)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var q5 = getQualifiedName(diag.file, diag.start); + if (q5) { + doChange(changes, diag.file, q5); + } + }); + } + }); + function getQualifiedName(sourceFile, pos) { + var qualifiedName = ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, pos), ts2.isQualifiedName); + ts2.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return ts2.isIdentifier(qualifiedName.left) ? qualifiedName : void 0; + } + function doChange(changeTracker, sourceFile, qualifiedName) { + var rightText = qualifiedName.right.text; + var replacement = ts2.factory.createIndexedAccessTypeNode(ts2.factory.createTypeReferenceNode( + qualifiedName.left, + /*typeArguments*/ + void 0 + ), ts2.factory.createLiteralTypeNode(ts2.factory.createStringLiteral(rightText))); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ts2.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code]; + var fixId = "convertToTypeOnlyExport"; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToConvertToTypeOnlyExport(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return fixSingleExportDeclaration(t8, getExportSpecifierForDiagnosticSpan(context2.span, context2.sourceFile), context2); + }); + if (changes.length) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_to_type_only_export, fixId, ts2.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context2) { + var fixedExportDeclarations = new ts2.Map(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context2.sourceFile); + if (exportSpecifier && ts2.addToSeen(fixedExportDeclarations, ts2.getNodeId(exportSpecifier.parent.parent))) { + fixSingleExportDeclaration(changes, exportSpecifier, context2); + } + }); + } + }); + function getExportSpecifierForDiagnosticSpan(span, sourceFile) { + return ts2.tryCast(ts2.getTokenAtPosition(sourceFile, span.start).parent, ts2.isExportSpecifier); + } + function fixSingleExportDeclaration(changes, exportSpecifier, context2) { + if (!exportSpecifier) { + return; + } + var exportClause = exportSpecifier.parent; + var exportDeclaration = exportClause.parent; + var typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context2); + if (typeExportSpecifiers.length === exportClause.elements.length) { + changes.insertModifierBefore(context2.sourceFile, 154, exportClause); + } else { + var valueExportDeclaration = ts2.factory.updateExportDeclaration( + exportDeclaration, + exportDeclaration.modifiers, + /*isTypeOnly*/ + false, + ts2.factory.updateNamedExports(exportClause, ts2.filter(exportClause.elements, function(e10) { + return !ts2.contains(typeExportSpecifiers, e10); + })), + exportDeclaration.moduleSpecifier, + /*assertClause*/ + void 0 + ); + var typeExportDeclaration = ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + true, + ts2.factory.createNamedExports(typeExportSpecifiers), + exportDeclaration.moduleSpecifier, + /*assertClause*/ + void 0 + ); + changes.replaceNode(context2.sourceFile, exportDeclaration, valueExportDeclaration, { + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Exclude + }); + changes.insertNodeAfter(context2.sourceFile, exportDeclaration, typeExportDeclaration); + } + } + function getTypeExportSpecifiers(originExportSpecifier, context2) { + var exportClause = originExportSpecifier.parent; + if (exportClause.elements.length === 1) { + return exportClause.elements; + } + var diagnostics = ts2.getDiagnosticsWithinSpan(ts2.createTextSpanFromNode(exportClause), context2.program.getSemanticDiagnostics(context2.sourceFile, context2.cancellationToken)); + return ts2.filter(exportClause.elements, function(element) { + var _a2; + return element === originExportSpecifier || ((_a2 = ts2.findDiagnosticForNode(element, diagnostics)) === null || _a2 === void 0 ? void 0 : _a2.code) === errorCodes[0]; + }); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ts2.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code]; + var fixId = "convertToTypeOnlyImport"; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + var importDeclaration = getImportDeclarationForDiagnosticSpan(context2.span, context2.sourceFile); + fixSingleImportDeclaration(t8, importDeclaration, context2); + }); + if (changes.length) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_to_type_only_import, fixId, ts2.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var importDeclaration = getImportDeclarationForDiagnosticSpan(diag, context2.sourceFile); + fixSingleImportDeclaration(changes, importDeclaration, context2); + }); + } + }); + function getImportDeclarationForDiagnosticSpan(span, sourceFile) { + return ts2.tryCast(ts2.getTokenAtPosition(sourceFile, span.start).parent, ts2.isImportDeclaration); + } + function fixSingleImportDeclaration(changes, importDeclaration, context2) { + if (!(importDeclaration === null || importDeclaration === void 0 ? void 0 : importDeclaration.importClause)) { + return; + } + var importClause = importDeclaration.importClause; + changes.insertText(context2.sourceFile, importDeclaration.getStart() + "import".length, " type"); + if (importClause.name && importClause.namedBindings) { + changes.deleteNodeRangeExcludingEnd(context2.sourceFile, importClause.name, importDeclaration.importClause.namedBindings); + changes.insertNodeBefore(context2.sourceFile, importDeclaration, ts2.factory.updateImportDeclaration( + importDeclaration, + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + true, + importClause.name, + /*namedBindings*/ + void 0 + ), + importDeclaration.moduleSpecifier, + /*assertClause*/ + void 0 + )); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "convertLiteralTypeToMappedType"; + var errorCodes = [ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToConvertLiteralTypeToMappedType(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var info2 = getInfo(sourceFile, span.start); + if (!info2) { + return void 0; + } + var name2 = info2.name, constraint = info2.constraint; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Convert_0_to_1_in_0, constraint, name2], fixId, ts2.Diagnostics.Convert_all_type_literals_to_mapped_type)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start); + if (info2) { + doChange(changes, diag.file, info2); + } + }); + } + }); + function getInfo(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (ts2.isIdentifier(token)) { + var propertySignature = ts2.cast(token.parent.parent, ts2.isPropertySignature); + var propertyName = token.getText(sourceFile); + return { + container: ts2.cast(propertySignature.parent, ts2.isTypeLiteralNode), + typeNode: propertySignature.type, + constraint: propertyName, + name: propertyName === "K" ? "P" : "K" + }; + } + return void 0; + } + function doChange(changes, sourceFile, _a2) { + var container = _a2.container, typeNode = _a2.typeNode, constraint = _a2.constraint, name2 = _a2.name; + changes.replaceNode(sourceFile, container, ts2.factory.createMappedTypeNode( + /*readonlyToken*/ + void 0, + ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + ts2.factory.createTypeReferenceNode(constraint) + ), + /*nameType*/ + void 0, + /*questionToken*/ + void 0, + typeNode, + /*members*/ + void 0 + )); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ + ts2.Diagnostics.Class_0_incorrectly_implements_interface_1.code, + ts2.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code + ]; + var fixId = "fixClassIncorrectlyImplementsInterface"; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var classDeclaration = getClass(sourceFile, span.start); + return ts2.mapDefined(ts2.getEffectiveImplementsTypeNodes(classDeclaration), function(implementedTypeNode) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMissingDeclarations(context2, implementedTypeNode, sourceFile, classDeclaration, t8, context2.preferences); + }); + return changes.length === 0 ? void 0 : codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId, ts2.Diagnostics.Implement_all_unimplemented_interfaces); + }); + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var seenClassDeclarations = new ts2.Map(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts2.addToSeen(seenClassDeclarations, ts2.getNodeId(classDeclaration))) { + for (var _i = 0, _a2 = ts2.getEffectiveImplementsTypeNodes(classDeclaration); _i < _a2.length; _i++) { + var implementedTypeNode = _a2[_i]; + addMissingDeclarations(context2, implementedTypeNode, diag.file, classDeclaration, changes, context2.preferences); + } + } + }); + } + }); + function getClass(sourceFile, pos) { + return ts2.Debug.checkDefined(ts2.getContainingClass(ts2.getTokenAtPosition(sourceFile, pos)), "There should be a containing class"); + } + function symbolPointsToNonPrivateMember(symbol) { + return !symbol.valueDeclaration || !(ts2.getEffectiveModifierFlags(symbol.valueDeclaration) & 8); + } + function addMissingDeclarations(context2, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + var checker = context2.program.getTypeChecker(); + var maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker); + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(ts2.and(symbolPointsToNonPrivateMember, function(symbol) { + return !maybeHeritageClauseSymbol.has(symbol.escapedName); + })); + var classType = checker.getTypeAtLocation(classDeclaration); + var constructor = ts2.find(classDeclaration.members, function(m7) { + return ts2.isConstructorDeclaration(m7); + }); + if (!classType.getNumberIndexType()) { + createMissingIndexSignatureDeclaration( + implementedType, + 1 + /* IndexKind.Number */ + ); + } + if (!classType.getStringIndexType()) { + createMissingIndexSignatureDeclaration( + implementedType, + 0 + /* IndexKind.String */ + ); + } + var importAdder = codefix2.createImportAdder(sourceFile, context2.program, preferences, context2.host); + codefix2.createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context2, preferences, importAdder, function(member) { + return insertInterfaceMemberNode(sourceFile, classDeclaration, member); + }); + importAdder.writeFixes(changeTracker); + function createMissingIndexSignatureDeclaration(type3, kind) { + var indexInfoOfKind = checker.getIndexInfoOfType(type3, kind); + if (indexInfoOfKind) { + insertInterfaceMemberNode(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration( + indexInfoOfKind, + classDeclaration, + /*flags*/ + void 0, + codefix2.getNoopSymbolTrackerWithResolver(context2) + )); + } + } + function insertInterfaceMemberNode(sourceFile2, cls, newElement) { + if (constructor) { + changeTracker.insertNodeAfter(sourceFile2, constructor, newElement); + } else { + changeTracker.insertMemberAtStart(sourceFile2, cls, newElement); + } + } + } + function getHeritageClauseSymbolTable(classDeclaration, checker) { + var heritageClauseNode = ts2.getEffectiveBaseTypeNode(classDeclaration); + if (!heritageClauseNode) + return ts2.createSymbolTable(); + var heritageClauseType = checker.getTypeAtLocation(heritageClauseNode); + var heritageClauseTypeSymbols = checker.getPropertiesOfType(heritageClauseType); + return ts2.createSymbolTable(heritageClauseTypeSymbols.filter(symbolPointsToNonPrivateMember)); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + codefix2.importFixName = "import"; + var importFixId = "fixMissingImport"; + var errorCodes = [ + ts2.Diagnostics.Cannot_find_name_0.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, + ts2.Diagnostics.Cannot_find_namespace_0.code, + ts2.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code, + ts2.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code, + ts2.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code, + ts2.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var errorCode = context2.errorCode, preferences = context2.preferences, sourceFile = context2.sourceFile, span = context2.span, program = context2.program; + var info2 = getFixInfos( + context2, + errorCode, + span.start, + /*useAutoImportProvider*/ + true + ); + if (!info2) + return void 0; + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + return info2.map(function(_a2) { + var fix = _a2.fix, symbolName = _a2.symbolName, errorIdentifierText = _a2.errorIdentifierText; + return codeActionForFix( + context2, + sourceFile, + symbolName, + fix, + /*includeSymbolNameInDescription*/ + symbolName !== errorIdentifierText, + quotePreference, + program.getCompilerOptions() + ); + }); + }, + fixIds: [importFixId], + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, preferences = context2.preferences, host = context2.host, cancellationToken = context2.cancellationToken; + var importAdder = createImportAdderWorker( + sourceFile, + program, + /*useAutoImportProvider*/ + true, + preferences, + host, + cancellationToken + ); + codefix2.eachDiagnostic(context2, errorCodes, function(diag) { + return importAdder.addImportFromDiagnostic(diag, context2); + }); + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, importAdder.writeFixes)); + } + }); + function createImportAdder(sourceFile, program, preferences, host, cancellationToken) { + return createImportAdderWorker( + sourceFile, + program, + /*useAutoImportProvider*/ + false, + preferences, + host, + cancellationToken + ); + } + codefix2.createImportAdder = createImportAdder; + function createImportAdderWorker(sourceFile, program, useAutoImportProvider, preferences, host, cancellationToken) { + var compilerOptions = program.getCompilerOptions(); + var addToNamespace = []; + var importType = []; + var addToExisting = new ts2.Map(); + var newImports = new ts2.Map(); + return { addImportFromDiagnostic, addImportFromExportedSymbol, writeFixes, hasFixes }; + function addImportFromDiagnostic(diagnostic, context2) { + var info2 = getFixInfos(context2, diagnostic.code, diagnostic.start, useAutoImportProvider); + if (!info2 || !info2.length) + return; + addImport(ts2.first(info2)); + } + function addImportFromExportedSymbol(exportedSymbol, isValidTypeOnlyUseSite) { + var moduleSymbol = ts2.Debug.checkDefined(exportedSymbol.parent); + var symbolName = ts2.getNameForExportedSymbol(exportedSymbol, ts2.getEmitScriptTarget(compilerOptions)); + var checker = program.getTypeChecker(); + var symbol = checker.getMergedSymbol(ts2.skipAlias(exportedSymbol, checker)); + var exportInfo = getAllExportInfoForSymbol( + sourceFile, + symbol, + symbolName, + /*isJsxTagName*/ + false, + program, + host, + preferences, + cancellationToken + ); + var useRequire = shouldUseRequire(sourceFile, program); + var fix = getImportFixForSymbol( + sourceFile, + ts2.Debug.checkDefined(exportInfo), + moduleSymbol, + program, + /*useNamespaceInfo*/ + void 0, + !!isValidTypeOnlyUseSite, + useRequire, + host, + preferences + ); + if (fix) { + addImport({ fix, symbolName, errorIdentifierText: void 0 }); + } + } + function addImport(info2) { + var _a2, _b; + var fix = info2.fix, symbolName = info2.symbolName; + switch (fix.kind) { + case 0: + addToNamespace.push(fix); + break; + case 1: + importType.push(fix); + break; + case 2: { + var importClauseOrBindingPattern = fix.importClauseOrBindingPattern, importKind = fix.importKind, addAsTypeOnly = fix.addAsTypeOnly; + var key = String(ts2.getNodeId(importClauseOrBindingPattern)); + var entry = addToExisting.get(key); + if (!entry) { + addToExisting.set(key, entry = { importClauseOrBindingPattern, defaultImport: void 0, namedImports: new ts2.Map() }); + } + if (importKind === 0) { + var prevValue = entry === null || entry === void 0 ? void 0 : entry.namedImports.get(symbolName); + entry.namedImports.set(symbolName, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly)); + } else { + ts2.Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName, "(Add to Existing) Default import should be missing or match symbolName"); + entry.defaultImport = { + name: symbolName, + addAsTypeOnly: reduceAddAsTypeOnlyValues((_a2 = entry.defaultImport) === null || _a2 === void 0 ? void 0 : _a2.addAsTypeOnly, addAsTypeOnly) + }; + } + break; + } + case 3: { + var moduleSpecifier = fix.moduleSpecifier, importKind = fix.importKind, useRequire = fix.useRequire, addAsTypeOnly = fix.addAsTypeOnly; + var entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); + ts2.Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); + switch (importKind) { + case 1: + ts2.Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName, "(Add new) Default import should be missing or match symbolName"); + entry.defaultImport = { name: symbolName, addAsTypeOnly: reduceAddAsTypeOnlyValues((_b = entry.defaultImport) === null || _b === void 0 ? void 0 : _b.addAsTypeOnly, addAsTypeOnly) }; + break; + case 0: + var prevValue = (entry.namedImports || (entry.namedImports = new ts2.Map())).get(symbolName); + entry.namedImports.set(symbolName, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly)); + break; + case 3: + case 2: + ts2.Debug.assert(entry.namespaceLikeImport === void 0 || entry.namespaceLikeImport.name === symbolName, "Namespacelike import shoudl be missing or match symbolName"); + entry.namespaceLikeImport = { importKind, name: symbolName, addAsTypeOnly }; + break; + } + break; + } + case 4: + break; + default: + ts2.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind)); + } + function reduceAddAsTypeOnlyValues(prevValue2, newValue) { + return Math.max(prevValue2 !== null && prevValue2 !== void 0 ? prevValue2 : 0, newValue); + } + function getNewImportEntry(moduleSpecifier2, importKind2, useRequire2, addAsTypeOnly2) { + var typeOnlyKey = newImportsKey( + moduleSpecifier2, + /*topLevelTypeOnly*/ + true + ); + var nonTypeOnlyKey = newImportsKey( + moduleSpecifier2, + /*topLevelTypeOnly*/ + false + ); + var typeOnlyEntry = newImports.get(typeOnlyKey); + var nonTypeOnlyEntry = newImports.get(nonTypeOnlyKey); + var newEntry = { + defaultImport: void 0, + namedImports: void 0, + namespaceLikeImport: void 0, + useRequire: useRequire2 + }; + if (importKind2 === 1 && addAsTypeOnly2 === 2) { + if (typeOnlyEntry) + return typeOnlyEntry; + newImports.set(typeOnlyKey, newEntry); + return newEntry; + } + if (addAsTypeOnly2 === 1 && (typeOnlyEntry || nonTypeOnlyEntry)) { + return typeOnlyEntry || nonTypeOnlyEntry; + } + if (nonTypeOnlyEntry) { + return nonTypeOnlyEntry; + } + newImports.set(nonTypeOnlyKey, newEntry); + return newEntry; + } + function newImportsKey(moduleSpecifier2, topLevelTypeOnly) { + return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier2); + } + } + function writeFixes(changeTracker) { + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + for (var _i = 0, addToNamespace_1 = addToNamespace; _i < addToNamespace_1.length; _i++) { + var fix = addToNamespace_1[_i]; + addNamespaceQualifier(changeTracker, sourceFile, fix); + } + for (var _a2 = 0, importType_1 = importType; _a2 < importType_1.length; _a2++) { + var fix = importType_1[_a2]; + addImportType(changeTracker, sourceFile, fix, quotePreference); + } + addToExisting.forEach(function(_a3) { + var importClauseOrBindingPattern = _a3.importClauseOrBindingPattern, defaultImport = _a3.defaultImport, namedImports = _a3.namedImports; + doAddExistingFix(changeTracker, sourceFile, importClauseOrBindingPattern, defaultImport, ts2.arrayFrom(namedImports.entries(), function(_a4) { + var name2 = _a4[0], addAsTypeOnly = _a4[1]; + return { addAsTypeOnly, name: name2 }; + }), compilerOptions); + }); + var newDeclarations; + newImports.forEach(function(_a3, key) { + var useRequire = _a3.useRequire, defaultImport = _a3.defaultImport, namedImports = _a3.namedImports, namespaceLikeImport = _a3.namespaceLikeImport; + var moduleSpecifier = key.slice(2); + var getDeclarations = useRequire ? getNewRequires : getNewImports; + var declarations = getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports && ts2.arrayFrom(namedImports.entries(), function(_a4) { + var name2 = _a4[0], addAsTypeOnly = _a4[1]; + return { addAsTypeOnly, name: name2 }; + }), namespaceLikeImport); + newDeclarations = ts2.combine(newDeclarations, declarations); + }); + if (newDeclarations) { + ts2.insertImports( + changeTracker, + sourceFile, + newDeclarations, + /*blankLineBetween*/ + true + ); + } + } + function hasFixes() { + return addToNamespace.length > 0 || importType.length > 0 || addToExisting.size > 0 || newImports.size > 0; + } + } + function createImportSpecifierResolver(importingFile, program, host, preferences) { + var packageJsonImportFilter = ts2.createPackageJsonImportFilter(importingFile, preferences, host); + var importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions()); + return { getModuleSpecifierForBestExportInfo }; + function getModuleSpecifierForBestExportInfo(exportInfo, symbolName, position, isValidTypeOnlyUseSite, fromCacheOnly) { + var _a2 = getImportFixes( + exportInfo, + { symbolName, position }, + isValidTypeOnlyUseSite, + /*useRequire*/ + false, + program, + importingFile, + host, + preferences, + importMap, + fromCacheOnly + ), fixes = _a2.fixes, computedWithoutCacheCount = _a2.computedWithoutCacheCount; + var result2 = getBestFix(fixes, importingFile, program, packageJsonImportFilter, host); + return result2 && __assign16(__assign16({}, result2), { computedWithoutCacheCount }); + } + } + codefix2.createImportSpecifierResolver = createImportSpecifierResolver; + var ImportFixKind; + (function(ImportFixKind2) { + ImportFixKind2[ImportFixKind2["UseNamespace"] = 0] = "UseNamespace"; + ImportFixKind2[ImportFixKind2["JsdocTypeImport"] = 1] = "JsdocTypeImport"; + ImportFixKind2[ImportFixKind2["AddToExisting"] = 2] = "AddToExisting"; + ImportFixKind2[ImportFixKind2["AddNew"] = 3] = "AddNew"; + ImportFixKind2[ImportFixKind2["PromoteTypeOnly"] = 4] = "PromoteTypeOnly"; + })(ImportFixKind || (ImportFixKind = {})); + var AddAsTypeOnly; + (function(AddAsTypeOnly2) { + AddAsTypeOnly2[AddAsTypeOnly2["Allowed"] = 1] = "Allowed"; + AddAsTypeOnly2[AddAsTypeOnly2["Required"] = 2] = "Required"; + AddAsTypeOnly2[AddAsTypeOnly2["NotAllowed"] = 4] = "NotAllowed"; + })(AddAsTypeOnly || (AddAsTypeOnly = {})); + function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { + var compilerOptions = program.getCompilerOptions(); + var exportInfos = ts2.pathIsBareSpecifier(ts2.stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName, isJsxTagName, program, host, preferences, cancellationToken); + ts2.Debug.assertIsDefined(exportInfos); + var useRequire = shouldUseRequire(sourceFile, program); + var isValidTypeOnlyUseSite = ts2.isValidTypeOnlyAliasUseSite(ts2.getTokenAtPosition(sourceFile, position)); + var fix = ts2.Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, { symbolName, position }, isValidTypeOnlyUseSite, useRequire, host, preferences)); + return { + moduleSpecifier: fix.moduleSpecifier, + codeAction: codeFixActionToCodeAction(codeActionForFix( + { host, formatContext, preferences }, + sourceFile, + symbolName, + fix, + /*includeSymbolNameInDescription*/ + false, + ts2.getQuotePreference(sourceFile, preferences), + compilerOptions + )) + }; + } + codefix2.getImportCompletionAction = getImportCompletionAction; + function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, host, formatContext, preferences) { + var compilerOptions = program.getCompilerOptions(); + var symbolName = ts2.single(getSymbolNamesToImport(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions)); + var fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program); + var includeSymbolNameInDescription = symbolName !== symbolToken.text; + return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName, fix, includeSymbolNameInDescription, 1, compilerOptions)); + } + codefix2.getPromoteTypeOnlyCompletionAction = getPromoteTypeOnlyCompletionAction; + function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, host, preferences) { + ts2.Debug.assert(exportInfos.some(function(info2) { + return info2.moduleSymbol === moduleSymbol || info2.symbol.parent === moduleSymbol; + }), "Some exportInfo should match the specified moduleSymbol"); + var packageJsonImportFilter = ts2.createPackageJsonImportFilter(sourceFile, preferences, host); + return getBestFix(getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); + } + function codeFixActionToCodeAction(_a2) { + var description7 = _a2.description, changes = _a2.changes, commands = _a2.commands; + return { description: description7, changes, commands }; + } + function getAllExportInfoForSymbol(importingFile, symbol, symbolName, preferCapitalized, program, host, preferences, cancellationToken) { + var getChecker = createGetChecker(program, host); + return ts2.getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, function(name2) { + return name2 === symbolName; + }, function(info2) { + if (ts2.skipAlias(info2[0].symbol, getChecker(info2[0].isFromPackageJson)) === symbol) { + return info2; + } + }); + } + function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) { + var _a2, _b; + var compilerOptions = program.getCompilerOptions(); + var mainProgramInfo = getInfoWithChecker( + program.getTypeChecker(), + /*isFromPackageJson*/ + false + ); + if (mainProgramInfo) { + return mainProgramInfo; + } + var autoImportProvider = (_b = (_a2 = host.getPackageJsonAutoImportProvider) === null || _a2 === void 0 ? void 0 : _a2.call(host)) === null || _b === void 0 ? void 0 : _b.getTypeChecker(); + return ts2.Debug.checkDefined(autoImportProvider && getInfoWithChecker( + autoImportProvider, + /*isFromPackageJson*/ + true + ), "Could not find symbol in specified module for code actions"); + function getInfoWithChecker(checker, isFromPackageJson) { + var defaultInfo = ts2.getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && ts2.skipAlias(defaultInfo.symbol, checker) === symbol) { + return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: ts2.skipAlias(symbol, checker).flags, isFromPackageJson }; + } + var named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol); + if (named && ts2.skipAlias(named, checker) === symbol) { + return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0, targetFlags: ts2.skipAlias(symbol, checker).flags, isFromPackageJson }; + } + } + } + function getImportFixes(exportInfos, useNamespaceInfo, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap, fromCacheOnly) { + if (importMap === void 0) { + importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()); + } + var checker = program.getTypeChecker(); + var existingImports = ts2.flatMap(exportInfos, importMap.getImportsForExportInfo); + var useNamespace = useNamespaceInfo && tryUseExistingNamespaceImport(existingImports, useNamespaceInfo.symbolName, useNamespaceInfo.position, checker); + var addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); + if (addToExisting) { + return { + computedWithoutCacheCount: 0, + fixes: __spreadArray9(__spreadArray9([], useNamespace ? [useNamespace] : ts2.emptyArray, true), [addToExisting], false) + }; + } + var _a2 = getFixesForAddImport(exportInfos, existingImports, program, sourceFile, useNamespaceInfo === null || useNamespaceInfo === void 0 ? void 0 : useNamespaceInfo.position, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly), fixes = _a2.fixes, _b = _a2.computedWithoutCacheCount, computedWithoutCacheCount = _b === void 0 ? 0 : _b; + return { + computedWithoutCacheCount, + fixes: __spreadArray9(__spreadArray9([], useNamespace ? [useNamespace] : ts2.emptyArray, true), fixes, true) + }; + } + function tryUseExistingNamespaceImport(existingImports, symbolName, position, checker) { + return ts2.firstDefined(existingImports, function(_a2) { + var _b; + var declaration = _a2.declaration; + var namespacePrefix = getNamespaceLikeImportText(declaration); + var moduleSpecifier = (_b = ts2.tryGetModuleSpecifierFromDeclaration(declaration)) === null || _b === void 0 ? void 0 : _b.text; + if (namespacePrefix && moduleSpecifier) { + var moduleSymbol = getTargetModuleFromNamespaceLikeImport(declaration, checker); + if (moduleSymbol && moduleSymbol.exports.has(ts2.escapeLeadingUnderscores(symbolName))) { + return { kind: 0, namespacePrefix, position, moduleSpecifier }; + } + } + }); + } + function getTargetModuleFromNamespaceLikeImport(declaration, checker) { + var _a2; + switch (declaration.kind) { + case 257: + return checker.resolveExternalModuleName(declaration.initializer.arguments[0]); + case 268: + return checker.getAliasedSymbol(declaration.symbol); + case 269: + var namespaceImport = ts2.tryCast((_a2 = declaration.importClause) === null || _a2 === void 0 ? void 0 : _a2.namedBindings, ts2.isNamespaceImport); + return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol); + default: + return ts2.Debug.assertNever(declaration); + } + } + function getNamespaceLikeImportText(declaration) { + var _a2, _b, _c; + switch (declaration.kind) { + case 257: + return (_a2 = ts2.tryCast(declaration.name, ts2.isIdentifier)) === null || _a2 === void 0 ? void 0 : _a2.text; + case 268: + return declaration.name.text; + case 269: + return (_c = ts2.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts2.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text; + default: + return ts2.Debug.assertNever(declaration); + } + } + function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, symbol, targetFlags, checker, compilerOptions) { + if (!isValidTypeOnlyUseSite) { + return 4; + } + if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2) { + return 2; + } + if (compilerOptions.isolatedModules && compilerOptions.preserveValueImports && (!(targetFlags & 111551) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + return 2; + } + return 1; + } + function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) { + return ts2.firstDefined(existingImports, function(_a2) { + var declaration = _a2.declaration, importKind = _a2.importKind, symbol = _a2.symbol, targetFlags = _a2.targetFlags; + if (importKind === 3 || importKind === 2 || declaration.kind === 268) { + return void 0; + } + if (declaration.kind === 257) { + return (importKind === 0 || importKind === 1) && declaration.name.kind === 203 ? { + kind: 2, + importClauseOrBindingPattern: declaration.name, + importKind, + moduleSpecifier: declaration.initializer.arguments[0].text, + addAsTypeOnly: 4 + /* AddAsTypeOnly.NotAllowed */ + } : void 0; + } + var importClause = declaration.importClause; + if (!importClause || !ts2.isStringLiteralLike(declaration.moduleSpecifier)) + return void 0; + var name2 = importClause.name, namedBindings = importClause.namedBindings; + if (importClause.isTypeOnly && !(importKind === 0 && namedBindings)) + return void 0; + var addAsTypeOnly = getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + false, + symbol, + targetFlags, + checker, + compilerOptions + ); + if (importKind === 1 && (name2 || // Cannot add a default import to a declaration that already has one + addAsTypeOnly === 2 && namedBindings)) + return void 0; + if (importKind === 0 && (namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === 271) + return void 0; + return { + kind: 2, + importClauseOrBindingPattern: importClause, + importKind, + moduleSpecifier: declaration.moduleSpecifier.text, + addAsTypeOnly + }; + }); + } + function createExistingImportMap(checker, importingFile, compilerOptions) { + var importMap; + for (var _i = 0, _a2 = importingFile.imports; _i < _a2.length; _i++) { + var moduleSpecifier = _a2[_i]; + var i7 = ts2.importFromModuleSpecifier(moduleSpecifier); + if (ts2.isVariableDeclarationInitializedToRequire(i7.parent)) { + var moduleSymbol = checker.resolveExternalModuleName(moduleSpecifier); + if (moduleSymbol) { + (importMap || (importMap = ts2.createMultiMap())).add(ts2.getSymbolId(moduleSymbol), i7.parent); + } + } else if (i7.kind === 269 || i7.kind === 268) { + var moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + (importMap || (importMap = ts2.createMultiMap())).add(ts2.getSymbolId(moduleSymbol), i7); + } + } + } + return { + getImportsForExportInfo: function(_a3) { + var moduleSymbol2 = _a3.moduleSymbol, exportKind = _a3.exportKind, targetFlags = _a3.targetFlags, symbol = _a3.symbol; + if (!(targetFlags & 111551) && ts2.isSourceFileJS(importingFile)) + return ts2.emptyArray; + var matchingDeclarations = importMap === null || importMap === void 0 ? void 0 : importMap.get(ts2.getSymbolId(moduleSymbol2)); + if (!matchingDeclarations) + return ts2.emptyArray; + var importKind = getImportKind(importingFile, exportKind, compilerOptions); + return matchingDeclarations.map(function(declaration) { + return { declaration, importKind, symbol, targetFlags }; + }); + } + }; + } + function shouldUseRequire(sourceFile, program) { + if (!ts2.isSourceFileJS(sourceFile)) { + return false; + } + if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) + return true; + if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) + return false; + var compilerOptions = program.getCompilerOptions(); + if (compilerOptions.configFile) { + return ts2.getEmitModuleKind(compilerOptions) < ts2.ModuleKind.ES2015; + } + for (var _i = 0, _a2 = program.getSourceFiles(); _i < _a2.length; _i++) { + var otherFile = _a2[_i]; + if (otherFile === sourceFile || !ts2.isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) + continue; + if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) + return true; + if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) + return false; + } + return true; + } + function createGetChecker(program, host) { + return ts2.memoizeOne(function(isFromPackageJson) { + return isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker(); + }); + } + function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { + var isJs = ts2.isSourceFileJS(sourceFile); + var compilerOptions = program.getCompilerOptions(); + var moduleSpecifierResolutionHost = ts2.createModuleSpecifierResolutionHost(program, host); + var getChecker = createGetChecker(program, host); + var rejectNodeModulesRelativePaths = ts2.moduleResolutionUsesNodeModules(ts2.getEmitModuleResolutionKind(compilerOptions)); + var getModuleSpecifiers = fromCacheOnly ? function(moduleSymbol) { + return { moduleSpecifiers: ts2.moduleSpecifiers.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }; + } : function(moduleSymbol, checker) { + return ts2.moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences); + }; + var computedWithoutCacheCount = 0; + var fixes = ts2.flatMap(exportInfo, function(exportInfo2, i7) { + var checker = getChecker(exportInfo2.isFromPackageJson); + var _a2 = getModuleSpecifiers(exportInfo2.moduleSymbol, checker), computedWithoutCache = _a2.computedWithoutCache, moduleSpecifiers = _a2.moduleSpecifiers; + var importedSymbolHasValueMeaning = !!(exportInfo2.targetFlags & 111551); + var addAsTypeOnly = getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + true, + exportInfo2.symbol, + exportInfo2.targetFlags, + checker, + compilerOptions + ); + computedWithoutCacheCount += computedWithoutCache ? 1 : 0; + return ts2.mapDefined(moduleSpecifiers, function(moduleSpecifier) { + return rejectNodeModulesRelativePaths && ts2.pathContainsNodeModules(moduleSpecifier) ? void 0 : ( + // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. + !importedSymbolHasValueMeaning && isJs && position !== void 0 ? { kind: 1, moduleSpecifier, position, exportInfo: exportInfo2, isReExport: i7 > 0 } : { + kind: 3, + moduleSpecifier, + importKind: getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions), + useRequire, + addAsTypeOnly, + exportInfo: exportInfo2, + isReExport: i7 > 0 + } + ); + }); + }); + return { computedWithoutCacheCount, fixes }; + } + function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { + var existingDeclaration = ts2.firstDefined(existingImports, function(info2) { + return newImportInfoFromExistingSpecifier(info2, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions()); + }); + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); + } + function newImportInfoFromExistingSpecifier(_a2, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { + var _b; + var declaration = _a2.declaration, importKind = _a2.importKind, symbol = _a2.symbol, targetFlags = _a2.targetFlags; + var moduleSpecifier = (_b = ts2.tryGetModuleSpecifierFromDeclaration(declaration)) === null || _b === void 0 ? void 0 : _b.text; + if (moduleSpecifier) { + var addAsTypeOnly = useRequire ? 4 : getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + true, + symbol, + targetFlags, + checker, + compilerOptions + ); + return { kind: 3, moduleSpecifier, importKind, addAsTypeOnly, useRequire }; + } + } + function getFixInfos(context2, errorCode, pos, useAutoImportProvider) { + var symbolToken = ts2.getTokenAtPosition(context2.sourceFile, pos); + var info2; + if (errorCode === ts2.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + info2 = getFixesInfoForUMDImport(context2, symbolToken); + } else if (!ts2.isIdentifier(symbolToken)) { + return void 0; + } else if (errorCode === ts2.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code) { + var symbolName_1 = ts2.single(getSymbolNamesToImport(context2.sourceFile, context2.program.getTypeChecker(), symbolToken, context2.program.getCompilerOptions())); + var fix = getTypeOnlyPromotionFix(context2.sourceFile, symbolToken, symbolName_1, context2.program); + return fix && [{ fix, symbolName: symbolName_1, errorIdentifierText: symbolToken.text }]; + } else { + info2 = getFixesInfoForNonUMDImport(context2, symbolToken, useAutoImportProvider); + } + var packageJsonImportFilter = ts2.createPackageJsonImportFilter(context2.sourceFile, context2.preferences, context2.host); + return info2 && sortFixInfo(info2, context2.sourceFile, context2.program, packageJsonImportFilter, context2.host); + } + function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host) { + var _toPath = function(fileName) { + return ts2.toPath(fileName, host.getCurrentDirectory(), ts2.hostGetCanonicalFileName(host)); + }; + return ts2.sort(fixes, function(a7, b8) { + return ts2.compareBooleans(!!a7.isJsxNamespaceFix, !!b8.isJsxNamespaceFix) || ts2.compareValues(a7.fix.kind, b8.fix.kind) || compareModuleSpecifiers(a7.fix, b8.fix, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, _toPath); + }); + } + function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host) { + if (!ts2.some(fixes)) + return; + if (fixes[0].kind === 0 || fixes[0].kind === 2) { + return fixes[0]; + } + return fixes.reduce(function(best, fix) { + return compareModuleSpecifiers(fix, best, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, function(fileName) { + return ts2.toPath(fileName, host.getCurrentDirectory(), ts2.hostGetCanonicalFileName(host)); + }) === -1 ? fix : best; + }); + } + function compareModuleSpecifiers(a7, b8, importingFile, program, allowsImportingSpecifier, toPath2) { + if (a7.kind !== 0 && b8.kind !== 0) { + return ts2.compareBooleans(allowsImportingSpecifier(b8.moduleSpecifier), allowsImportingSpecifier(a7.moduleSpecifier)) || compareNodeCoreModuleSpecifiers(a7.moduleSpecifier, b8.moduleSpecifier, importingFile, program) || ts2.compareBooleans(isFixPossiblyReExportingImportingFile(a7, importingFile, program.getCompilerOptions(), toPath2), isFixPossiblyReExportingImportingFile(b8, importingFile, program.getCompilerOptions(), toPath2)) || ts2.compareNumberOfDirectorySeparators(a7.moduleSpecifier, b8.moduleSpecifier); + } + return 0; + } + function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath2) { + var _a2; + if (fix.isReExport && ((_a2 = fix.exportInfo) === null || _a2 === void 0 ? void 0 : _a2.moduleFileName) && ts2.getEmitModuleResolutionKind(compilerOptions) === ts2.ModuleResolutionKind.NodeJs && isIndexFileName(fix.exportInfo.moduleFileName)) { + var reExportDir = toPath2(ts2.getDirectoryPath(fix.exportInfo.moduleFileName)); + return ts2.startsWith(importingFile.path, reExportDir); + } + return false; + } + function isIndexFileName(fileName) { + return ts2.getBaseFileName( + fileName, + [".js", ".jsx", ".d.ts", ".ts", ".tsx"], + /*ignoreCase*/ + true + ) === "index"; + } + function compareNodeCoreModuleSpecifiers(a7, b8, importingFile, program) { + if (ts2.startsWith(a7, "node:") && !ts2.startsWith(b8, "node:")) + return ts2.shouldUseUriStyleNodeCoreModules(importingFile, program) ? -1 : 1; + if (ts2.startsWith(b8, "node:") && !ts2.startsWith(a7, "node:")) + return ts2.shouldUseUriStyleNodeCoreModules(importingFile, program) ? 1 : -1; + return 0; + } + function getFixesInfoForUMDImport(_a2, token) { + var sourceFile = _a2.sourceFile, program = _a2.program, host = _a2.host, preferences = _a2.preferences; + var checker = program.getTypeChecker(); + var umdSymbol = getUmdSymbol(token, checker); + if (!umdSymbol) + return void 0; + var symbol = checker.getAliasedSymbol(umdSymbol); + var symbolName = umdSymbol.name; + var exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3, targetFlags: symbol.flags, isFromPackageJson: false }]; + var useRequire = shouldUseRequire(sourceFile, program); + var position = ts2.isIdentifier(token) ? token.getStart(sourceFile) : void 0; + var fixes = getImportFixes( + exportInfo, + position ? { position, symbolName } : void 0, + /*isValidTypeOnlyUseSite*/ + false, + useRequire, + program, + sourceFile, + host, + preferences + ).fixes; + return fixes.map(function(fix) { + var _a3; + return { fix, symbolName, errorIdentifierText: (_a3 = ts2.tryCast(token, ts2.isIdentifier)) === null || _a3 === void 0 ? void 0 : _a3.text }; + }); + } + function getUmdSymbol(token, checker) { + var umdSymbol = ts2.isIdentifier(token) ? checker.getSymbolAtLocation(token) : void 0; + if (ts2.isUMDExportSymbol(umdSymbol)) + return umdSymbol; + var parent2 = token.parent; + return ts2.isJsxOpeningLikeElement(parent2) && parent2.tagName === token || ts2.isJsxOpeningFragment(parent2) ? ts2.tryCast(checker.resolveName( + checker.getJsxNamespace(parent2), + ts2.isJsxOpeningLikeElement(parent2) ? token : parent2, + 111551, + /*excludeGlobals*/ + false + ), ts2.isUMDExportSymbol) : void 0; + } + function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) { + switch (exportKind) { + case 0: + return 0; + case 1: + return 1; + case 2: + return getExportEqualsImportKind(importingFile, compilerOptions, !!forceImportKeyword); + case 3: + return getUmdImportKind(importingFile, compilerOptions, !!forceImportKeyword); + default: + return ts2.Debug.assertNever(exportKind); + } + } + codefix2.getImportKind = getImportKind; + function getUmdImportKind(importingFile, compilerOptions, forceImportKeyword) { + if (ts2.getAllowSyntheticDefaultImports(compilerOptions)) { + return 1; + } + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + switch (moduleKind) { + case ts2.ModuleKind.AMD: + case ts2.ModuleKind.CommonJS: + case ts2.ModuleKind.UMD: + if (ts2.isInJSFile(importingFile)) { + return ts2.isExternalModule(importingFile) || forceImportKeyword ? 2 : 3; + } + return 3; + case ts2.ModuleKind.System: + case ts2.ModuleKind.ES2015: + case ts2.ModuleKind.ES2020: + case ts2.ModuleKind.ES2022: + case ts2.ModuleKind.ESNext: + case ts2.ModuleKind.None: + return 2; + case ts2.ModuleKind.Node16: + case ts2.ModuleKind.NodeNext: + return importingFile.impliedNodeFormat === ts2.ModuleKind.ESNext ? 2 : 3; + default: + return ts2.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind)); + } + } + function getFixesInfoForNonUMDImport(_a2, symbolToken, useAutoImportProvider) { + var sourceFile = _a2.sourceFile, program = _a2.program, cancellationToken = _a2.cancellationToken, host = _a2.host, preferences = _a2.preferences; + var checker = program.getTypeChecker(); + var compilerOptions = program.getCompilerOptions(); + return ts2.flatMap(getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions), function(symbolName) { + if (symbolName === "default") { + return void 0; + } + var isValidTypeOnlyUseSite = ts2.isValidTypeOnlyAliasUseSite(symbolToken); + var useRequire = shouldUseRequire(sourceFile, program); + var exportInfo = getExportInfos(symbolName, ts2.isJSXTagName(symbolToken), ts2.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); + var fixes = ts2.arrayFrom(ts2.flatMapIterator(exportInfo.entries(), function(_a3) { + var _6 = _a3[0], exportInfos = _a3[1]; + return getImportFixes(exportInfos, { symbolName, position: symbolToken.getStart(sourceFile) }, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes; + })); + return fixes.map(function(fix) { + return { fix, symbolName, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName !== symbolToken.text }; + }); + }); + } + function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName, program) { + var checker = program.getTypeChecker(); + var symbol = checker.resolveName( + symbolName, + symbolToken, + 111551, + /*excludeGlobals*/ + true + ); + if (!symbol) + return void 0; + var typeOnlyAliasDeclaration = checker.getTypeOnlyAliasDeclaration(symbol); + if (!typeOnlyAliasDeclaration || ts2.getSourceFileOfNode(typeOnlyAliasDeclaration) !== sourceFile) + return void 0; + return { kind: 4, typeOnlyAliasDeclaration }; + } + function getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions) { + var parent2 = symbolToken.parent; + if ((ts2.isJsxOpeningLikeElement(parent2) || ts2.isJsxClosingElement(parent2)) && parent2.tagName === symbolToken && ts2.jsxModeNeedsExplicitImport(compilerOptions.jsx)) { + var jsxNamespace = checker.getJsxNamespace(sourceFile); + if (needsJsxNamespaceFix(jsxNamespace, symbolToken, checker)) { + var needsComponentNameFix = !ts2.isIntrinsicJsxName(symbolToken.text) && !checker.resolveName( + symbolToken.text, + symbolToken, + 111551, + /*excludeGlobals*/ + false + ); + return needsComponentNameFix ? [symbolToken.text, jsxNamespace] : [jsxNamespace]; + } + } + return [symbolToken.text]; + } + function needsJsxNamespaceFix(jsxNamespace, symbolToken, checker) { + if (ts2.isIntrinsicJsxName(symbolToken.text)) + return true; + var namespaceSymbol = checker.resolveName( + jsxNamespace, + symbolToken, + 111551, + /*excludeGlobals*/ + true + ); + return !namespaceSymbol || ts2.some(namespaceSymbol.declarations, ts2.isTypeOnlyImportOrExportDeclaration) && !(namespaceSymbol.flags & 111551); + } + function getExportInfos(symbolName, isJsxTagName, currentTokenMeaning, cancellationToken, fromFile2, program, useAutoImportProvider, host, preferences) { + var _a2; + var originalSymbolToExportInfos = ts2.createMultiMap(); + var packageJsonFilter = ts2.createPackageJsonImportFilter(fromFile2, preferences, host); + var moduleSpecifierCache = (_a2 = host.getModuleSpecifierCache) === null || _a2 === void 0 ? void 0 : _a2.call(host); + var getModuleSpecifierResolutionHost = ts2.memoizeOne(function(isFromPackageJson) { + return ts2.createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); + }); + function addSymbol(moduleSymbol, toFile, exportedSymbol, exportKind, program2, isFromPackageJson) { + var moduleSpecifierResolutionHost = getModuleSpecifierResolutionHost(isFromPackageJson); + if (toFile && ts2.isImportableFile(program2, fromFile2, toFile, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) || !toFile && packageJsonFilter.allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost)) { + var checker = program2.getTypeChecker(); + originalSymbolToExportInfos.add(ts2.getUniqueSymbolId(exportedSymbol, checker).toString(), { symbol: exportedSymbol, moduleSymbol, moduleFileName: toFile === null || toFile === void 0 ? void 0 : toFile.fileName, exportKind, targetFlags: ts2.skipAlias(exportedSymbol, checker).flags, isFromPackageJson }); + } + } + ts2.forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, function(moduleSymbol, sourceFile, program2, isFromPackageJson) { + var checker = program2.getTypeChecker(); + cancellationToken.throwIfCancellationRequested(); + var compilerOptions = program2.getCompilerOptions(); + var defaultInfo = ts2.getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts2.getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName) && symbolHasMeaning(defaultInfo.symbolForMeaning, currentTokenMeaning)) { + addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); + } + var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); + if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { + addSymbol(moduleSymbol, sourceFile, exportSymbolWithIdenticalName, 0, program2, isFromPackageJson); + } + }); + return originalSymbolToExportInfos; + } + function getExportEqualsImportKind(importingFile, compilerOptions, forceImportKeyword) { + var allowSyntheticDefaults = ts2.getAllowSyntheticDefaultImports(compilerOptions); + var isJS = ts2.isInJSFile(importingFile); + if (!isJS && ts2.getEmitModuleKind(compilerOptions) >= ts2.ModuleKind.ES2015) { + return allowSyntheticDefaults ? 1 : 2; + } + if (isJS) { + return ts2.isExternalModule(importingFile) || forceImportKeyword ? allowSyntheticDefaults ? 1 : 2 : 3; + } + for (var _i = 0, _a2 = importingFile.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (ts2.isImportEqualsDeclaration(statement) && !ts2.nodeIsMissing(statement.moduleReference)) { + return 3; + } + } + return allowSyntheticDefaults ? 1 : 3; + } + function codeActionForFix(context2, sourceFile, symbolName, fix, includeSymbolNameInDescription, quotePreference, compilerOptions) { + var diag; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(tracker) { + diag = codeActionForFixWorker(tracker, sourceFile, symbolName, fix, includeSymbolNameInDescription, quotePreference, compilerOptions); + }); + return codefix2.createCodeFixAction(codefix2.importFixName, changes, diag, importFixId, ts2.Diagnostics.Add_all_missing_imports); + } + function codeActionForFixWorker(changes, sourceFile, symbolName, fix, includeSymbolNameInDescription, quotePreference, compilerOptions) { + switch (fix.kind) { + case 0: + addNamespaceQualifier(changes, sourceFile, fix); + return [ts2.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)]; + case 1: + addImportType(changes, sourceFile, fix, quotePreference); + return [ts2.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName]; + case 2: { + var importClauseOrBindingPattern = fix.importClauseOrBindingPattern, importKind = fix.importKind, addAsTypeOnly = fix.addAsTypeOnly, moduleSpecifier = fix.moduleSpecifier; + doAddExistingFix(changes, sourceFile, importClauseOrBindingPattern, importKind === 1 ? { name: symbolName, addAsTypeOnly } : void 0, importKind === 0 ? [{ name: symbolName, addAsTypeOnly }] : ts2.emptyArray, compilerOptions); + var moduleSpecifierWithoutQuotes = ts2.stripQuotes(moduleSpecifier); + return includeSymbolNameInDescription ? [ts2.Diagnostics.Import_0_from_1, symbolName, moduleSpecifierWithoutQuotes] : [ts2.Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; + } + case 3: { + var importKind = fix.importKind, moduleSpecifier = fix.moduleSpecifier, addAsTypeOnly = fix.addAsTypeOnly, useRequire = fix.useRequire; + var getDeclarations = useRequire ? getNewRequires : getNewImports; + var defaultImport = importKind === 1 ? { name: symbolName, addAsTypeOnly } : void 0; + var namedImports = importKind === 0 ? [{ name: symbolName, addAsTypeOnly }] : void 0; + var namespaceLikeImport = importKind === 2 || importKind === 3 ? { importKind, name: symbolName, addAsTypeOnly } : void 0; + ts2.insertImports( + changes, + sourceFile, + getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport), + /*blankLineBetween*/ + true + ); + return includeSymbolNameInDescription ? [ts2.Diagnostics.Import_0_from_1, symbolName, moduleSpecifier] : [ts2.Diagnostics.Add_import_from_0, moduleSpecifier]; + } + case 4: { + var typeOnlyAliasDeclaration = fix.typeOnlyAliasDeclaration; + var promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile); + return promotedDeclaration.kind === 273 ? [ts2.Diagnostics.Remove_type_from_import_of_0_from_1, symbolName, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [ts2.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; + } + default: + return ts2.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind)); + } + } + function getModuleSpecifierText(promotedDeclaration) { + var _a2, _b; + return promotedDeclaration.kind === 268 ? ((_b = ts2.tryCast((_a2 = ts2.tryCast(promotedDeclaration.moduleReference, ts2.isExternalModuleReference)) === null || _a2 === void 0 ? void 0 : _a2.expression, ts2.isStringLiteralLike)) === null || _b === void 0 ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : ts2.cast(promotedDeclaration.parent.moduleSpecifier, ts2.isStringLiteral).text; + } + function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) { + var convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + switch (aliasDeclaration.kind) { + case 273: + if (aliasDeclaration.isTypeOnly) { + if (aliasDeclaration.parent.elements.length > 1 && ts2.OrganizeImports.importSpecifiersAreSorted(aliasDeclaration.parent.elements)) { + changes.delete(sourceFile, aliasDeclaration); + var newSpecifier = ts2.factory.updateImportSpecifier( + aliasDeclaration, + /*isTypeOnly*/ + false, + aliasDeclaration.propertyName, + aliasDeclaration.name + ); + var insertionIndex = ts2.OrganizeImports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier); + changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); + } else { + changes.deleteRange(sourceFile, aliasDeclaration.getFirstToken()); + } + return aliasDeclaration; + } else { + ts2.Debug.assert(aliasDeclaration.parent.parent.isTypeOnly); + promoteImportClause(aliasDeclaration.parent.parent); + return aliasDeclaration.parent.parent; + } + case 270: + promoteImportClause(aliasDeclaration); + return aliasDeclaration; + case 271: + promoteImportClause(aliasDeclaration.parent); + return aliasDeclaration.parent; + case 268: + changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1)); + return aliasDeclaration; + default: + ts2.Debug.failBadSyntaxKind(aliasDeclaration); + } + function promoteImportClause(importClause) { + changes.delete(sourceFile, ts2.getTypeKeywordOfTypeOnlyImport(importClause, sourceFile)); + if (convertExistingToTypeOnly) { + var namedImports = ts2.tryCast(importClause.namedBindings, ts2.isNamedImports); + if (namedImports && namedImports.elements.length > 1) { + if (ts2.OrganizeImports.importSpecifiersAreSorted(namedImports.elements) && aliasDeclaration.kind === 273 && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + changes.delete(sourceFile, aliasDeclaration); + changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); + } + for (var _i = 0, _a2 = namedImports.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (element !== aliasDeclaration && !element.isTypeOnly) { + changes.insertModifierBefore(sourceFile, 154, element); + } + } + } + } + } + } + function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) { + var _a2; + if (clause.kind === 203) { + if (defaultImport) { + addElementToBindingPattern(clause, defaultImport.name, "default"); + } + for (var _i = 0, namedImports_1 = namedImports; _i < namedImports_1.length; _i++) { + var specifier = namedImports_1[_i]; + addElementToBindingPattern( + clause, + specifier.name, + /*propertyName*/ + void 0 + ); + } + return; + } + var promoteFromTypeOnly2 = clause.isTypeOnly && ts2.some(__spreadArray9([defaultImport], namedImports, true), function(i7) { + return (i7 === null || i7 === void 0 ? void 0 : i7.addAsTypeOnly) === 4; + }); + var existingSpecifiers = clause.namedBindings && ((_a2 = ts2.tryCast(clause.namedBindings, ts2.isNamedImports)) === null || _a2 === void 0 ? void 0 : _a2.elements); + var convertExistingToTypeOnly = promoteFromTypeOnly2 && compilerOptions.preserveValueImports && compilerOptions.isolatedModules; + if (defaultImport) { + ts2.Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); + changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), ts2.factory.createIdentifier(defaultImport.name), { suffix: ", " }); + } + if (namedImports.length) { + var newSpecifiers = ts2.stableSort(namedImports.map(function(namedImport) { + return ts2.factory.createImportSpecifier( + (!clause.isTypeOnly || promoteFromTypeOnly2) && needsTypeOnly(namedImport), + /*propertyName*/ + void 0, + ts2.factory.createIdentifier(namedImport.name) + ); + }), ts2.OrganizeImports.compareImportOrExportSpecifiers); + if ((existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) && ts2.OrganizeImports.importSpecifiersAreSorted(existingSpecifiers)) { + for (var _b = 0, newSpecifiers_1 = newSpecifiers; _b < newSpecifiers_1.length; _b++) { + var spec = newSpecifiers_1[_b]; + var insertionIndex = convertExistingToTypeOnly && !spec.isTypeOnly ? 0 : ts2.OrganizeImports.getImportSpecifierInsertionIndex(existingSpecifiers, spec); + changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); + } + } else if (existingSpecifiers === null || existingSpecifiers === void 0 ? void 0 : existingSpecifiers.length) { + for (var _c = 0, newSpecifiers_2 = newSpecifiers; _c < newSpecifiers_2.length; _c++) { + var spec = newSpecifiers_2[_c]; + changes.insertNodeInListAfter(sourceFile, ts2.last(existingSpecifiers), spec, existingSpecifiers); + } + } else { + if (newSpecifiers.length) { + var namedImports_2 = ts2.factory.createNamedImports(newSpecifiers); + if (clause.namedBindings) { + changes.replaceNode(sourceFile, clause.namedBindings, namedImports_2); + } else { + changes.insertNodeAfter(sourceFile, ts2.Debug.checkDefined(clause.name, "Import clause must have either named imports or a default import"), namedImports_2); + } + } + } + } + if (promoteFromTypeOnly2) { + changes.delete(sourceFile, ts2.getTypeKeywordOfTypeOnlyImport(clause, sourceFile)); + if (convertExistingToTypeOnly && existingSpecifiers) { + for (var _d = 0, existingSpecifiers_1 = existingSpecifiers; _d < existingSpecifiers_1.length; _d++) { + var specifier = existingSpecifiers_1[_d]; + changes.insertModifierBefore(sourceFile, 154, specifier); + } + } + } + function addElementToBindingPattern(bindingPattern, name2, propertyName) { + var element = ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + propertyName, + name2 + ); + if (bindingPattern.elements.length) { + changes.insertNodeInListAfter(sourceFile, ts2.last(bindingPattern.elements), element); + } else { + changes.replaceNode(sourceFile, bindingPattern, ts2.factory.createObjectBindingPattern([element])); + } + } + } + function addNamespaceQualifier(changes, sourceFile, _a2) { + var namespacePrefix = _a2.namespacePrefix, position = _a2.position; + changes.insertText(sourceFile, position, namespacePrefix + "."); + } + function addImportType(changes, sourceFile, _a2, quotePreference) { + var moduleSpecifier = _a2.moduleSpecifier, position = _a2.position; + changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); + } + function getImportTypePrefix(moduleSpecifier, quotePreference) { + var quote = ts2.getQuoteFromPreference(quotePreference); + return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ")."); + } + function needsTypeOnly(_a2) { + var addAsTypeOnly = _a2.addAsTypeOnly; + return addAsTypeOnly === 2; + } + function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { + var quotedModuleSpecifier = ts2.makeStringLiteral(moduleSpecifier, quotePreference); + var statements; + if (defaultImport !== void 0 || (namedImports === null || namedImports === void 0 ? void 0 : namedImports.length)) { + var topLevelTypeOnly_1 = (!defaultImport || needsTypeOnly(defaultImport)) && ts2.every(namedImports, needsTypeOnly); + statements = ts2.combine(statements, ts2.makeImport(defaultImport && ts2.factory.createIdentifier(defaultImport.name), namedImports === null || namedImports === void 0 ? void 0 : namedImports.map(function(_a2) { + var addAsTypeOnly = _a2.addAsTypeOnly, name2 = _a2.name; + return ts2.factory.createImportSpecifier( + !topLevelTypeOnly_1 && addAsTypeOnly === 2, + /*propertyName*/ + void 0, + ts2.factory.createIdentifier(name2) + ); + }), moduleSpecifier, quotePreference, topLevelTypeOnly_1)); + } + if (namespaceLikeImport) { + var declaration = namespaceLikeImport.importKind === 3 ? ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + needsTypeOnly(namespaceLikeImport), + ts2.factory.createIdentifier(namespaceLikeImport.name), + ts2.factory.createExternalModuleReference(quotedModuleSpecifier) + ) : ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + needsTypeOnly(namespaceLikeImport), + /*name*/ + void 0, + ts2.factory.createNamespaceImport(ts2.factory.createIdentifier(namespaceLikeImport.name)) + ), + quotedModuleSpecifier, + /*assertClause*/ + void 0 + ); + statements = ts2.combine(statements, declaration); + } + return ts2.Debug.checkDefined(statements); + } + function getNewRequires(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { + var quotedModuleSpecifier = ts2.makeStringLiteral(moduleSpecifier, quotePreference); + var statements; + if (defaultImport || (namedImports === null || namedImports === void 0 ? void 0 : namedImports.length)) { + var bindingElements = (namedImports === null || namedImports === void 0 ? void 0 : namedImports.map(function(_a2) { + var name2 = _a2.name; + return ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + name2 + ); + })) || []; + if (defaultImport) { + bindingElements.unshift(ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + "default", + defaultImport.name + )); + } + var declaration = createConstEqualsRequireDeclaration(ts2.factory.createObjectBindingPattern(bindingElements), quotedModuleSpecifier); + statements = ts2.combine(statements, declaration); + } + if (namespaceLikeImport) { + var declaration = createConstEqualsRequireDeclaration(namespaceLikeImport.name, quotedModuleSpecifier); + statements = ts2.combine(statements, declaration); + } + return ts2.Debug.checkDefined(statements); + } + function createConstEqualsRequireDeclaration(name2, quotedModuleSpecifier) { + return ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ + ts2.factory.createVariableDeclaration( + typeof name2 === "string" ? ts2.factory.createIdentifier(name2) : name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + ts2.factory.createCallExpression( + ts2.factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [quotedModuleSpecifier] + ) + ) + ], + 2 + /* NodeFlags.Const */ + ) + ); + } + function symbolHasMeaning(_a2, meaning) { + var declarations = _a2.declarations; + return ts2.some(declarations, function(decl) { + return !!(ts2.getMeaningFromDeclaration(decl) & meaning); + }); + } + function moduleSymbolToValidIdentifier(moduleSymbol, target, forceCapitalize) { + return moduleSpecifierToValidIdentifier(ts2.removeFileExtension(ts2.stripQuotes(moduleSymbol.name)), target, forceCapitalize); + } + codefix2.moduleSymbolToValidIdentifier = moduleSymbolToValidIdentifier; + function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) { + var baseName = ts2.getBaseFileName(ts2.removeSuffix(moduleSpecifier, "/index")); + var res = ""; + var lastCharWasValid = true; + var firstCharCode = baseName.charCodeAt(0); + if (ts2.isIdentifierStart(firstCharCode, target)) { + res += String.fromCharCode(firstCharCode); + if (forceCapitalize) { + res = res.toUpperCase(); + } + } else { + lastCharWasValid = false; + } + for (var i7 = 1; i7 < baseName.length; i7++) { + var ch = baseName.charCodeAt(i7); + var isValid2 = ts2.isIdentifierPart(ch, target); + if (isValid2) { + var char = String.fromCharCode(ch); + if (!lastCharWasValid) { + char = char.toUpperCase(); + } + res += char; + } + lastCharWasValid = isValid2; + } + return !ts2.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res); + } + codefix2.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingConstraint"; + var errorCodes = [ + // We want errors this could be attached to: + // Diagnostics.This_type_parameter_probably_needs_an_extends_0_constraint + ts2.Diagnostics.Type_0_is_not_comparable_to_type_1.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code, + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + ts2.Diagnostics.Property_0_is_incompatible_with_index_signature.code, + ts2.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, + ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span, program = context2.program, preferences = context2.preferences, host = context2.host; + var info2 = getInfo(program, sourceFile, span); + if (info2 === void 0) + return; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMissingConstraint(t8, program, preferences, host, sourceFile, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_extends_constraint, fixId, ts2.Diagnostics.Add_extends_constraint_to_all_type_parameters)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var program = context2.program, preferences = context2.preferences, host = context2.host; + var seen = new ts2.Map(); + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, function(changes) { + codefix2.eachDiagnostic(context2, errorCodes, function(diag) { + var info2 = getInfo(program, diag.file, ts2.createTextSpan(diag.start, diag.length)); + if (info2) { + if (ts2.addToSeen(seen, ts2.getNodeId(info2.declaration))) { + return addMissingConstraint(changes, program, preferences, host, diag.file, info2); + } + } + return void 0; + }); + })); + } + }); + function getInfo(program, sourceFile, span) { + var diag = ts2.find(program.getSemanticDiagnostics(sourceFile), function(diag2) { + return diag2.start === span.start && diag2.length === span.length; + }); + if (diag === void 0 || diag.relatedInformation === void 0) + return; + var related = ts2.find(diag.relatedInformation, function(related2) { + return related2.code === ts2.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code; + }); + if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) + return; + var declaration = codefix2.findAncestorMatchingSpan(related.file, ts2.createTextSpan(related.start, related.length)); + if (declaration === void 0) + return; + if (ts2.isIdentifier(declaration) && ts2.isTypeParameterDeclaration(declaration.parent)) { + declaration = declaration.parent; + } + if (ts2.isTypeParameterDeclaration(declaration)) { + if (ts2.isMappedTypeNode(declaration.parent)) + return; + var token = ts2.getTokenAtPosition(sourceFile, span.start); + var checker = program.getTypeChecker(); + var constraint = tryGetConstraintType(checker, token) || tryGetConstraintFromDiagnosticMessage(related.messageText); + return { constraint, declaration, token }; + } + return void 0; + } + function addMissingConstraint(changes, program, preferences, host, sourceFile, info2) { + var declaration = info2.declaration, constraint = info2.constraint; + var checker = program.getTypeChecker(); + if (ts2.isString(constraint)) { + changes.insertText(sourceFile, declaration.name.end, " extends ".concat(constraint)); + } else { + var scriptTarget = ts2.getEmitScriptTarget(program.getCompilerOptions()); + var tracker = codefix2.getNoopSymbolTrackerWithResolver({ program, host }); + var importAdder = codefix2.createImportAdder(sourceFile, program, preferences, host); + var typeNode = codefix2.typeToAutoImportableTypeNode( + checker, + importAdder, + constraint, + /*contextNode*/ + void 0, + scriptTarget, + /*flags*/ + void 0, + tracker + ); + if (typeNode) { + changes.replaceNode(sourceFile, declaration, ts2.factory.updateTypeParameterDeclaration( + declaration, + /*modifiers*/ + void 0, + declaration.name, + typeNode, + declaration.default + )); + importAdder.writeFixes(changes); + } + } + } + function tryGetConstraintFromDiagnosticMessage(messageText) { + var _a2 = ts2.flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [], _6 = _a2[0], constraint = _a2[1]; + return constraint; + } + function tryGetConstraintType(checker, node) { + if (ts2.isTypeNode(node.parent)) { + return checker.getTypeArgumentConstraint(node.parent); + } + var contextualType = ts2.isExpression(node) ? checker.getContextualType(node) : void 0; + return contextualType || checker.getTypeAtLocation(node); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var _a2; + var fixName = "fixOverrideModifier"; + var fixAddOverrideId = "fixAddOverrideModifier"; + var fixRemoveOverrideId = "fixRemoveOverrideModifier"; + var errorCodes = [ + ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code, + ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code, + ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code, + ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code, + ts2.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code, + ts2.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, + ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code, + ts2.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, + ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code + ]; + var errorCodeFixIdMap = (_a2 = {}, // case #1: + _a2[ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: ts2.Diagnostics.Add_all_missing_override_modifiers + }, _a2[ts2.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: ts2.Diagnostics.Add_all_missing_override_modifiers + }, // case #2: + _a2[ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code] = { + descriptions: ts2.Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: ts2.Diagnostics.Remove_all_unnecessary_override_modifiers + }, _a2[ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code] = { + descriptions: ts2.Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: ts2.Diagnostics.Remove_override_modifier + }, // case #3: + _a2[ts2.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code] = { + descriptions: ts2.Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: ts2.Diagnostics.Add_all_missing_override_modifiers + }, _a2[ts2.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: ts2.Diagnostics.Add_all_missing_override_modifiers + }, // case #4: + _a2[ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: ts2.Diagnostics.Remove_all_unnecessary_override_modifiers + }, // case #5: + _a2[ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: ts2.Diagnostics.Remove_all_unnecessary_override_modifiers + }, _a2[ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code] = { + descriptions: ts2.Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: ts2.Diagnostics.Remove_all_unnecessary_override_modifiers + }, _a2); + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixOverrideModifierIssues(context2) { + var errorCode = context2.errorCode, span = context2.span; + var info2 = errorCodeFixIdMap[errorCode]; + if (!info2) + return ts2.emptyArray; + var descriptions = info2.descriptions, fixId = info2.fixId, fixAllDescriptions = info2.fixAllDescriptions; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changes2) { + return dispatchChanges(changes2, context2, errorCode, span.start); + }); + return [ + codefix2.createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId, fixAllDescriptions) + ]; + }, + fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var code = diag.code, start = diag.start; + var info2 = errorCodeFixIdMap[code]; + if (!info2 || info2.fixId !== context2.fixId) { + return; + } + dispatchChanges(changes, context2, code, start); + }); + } + }); + function dispatchChanges(changeTracker, context2, errorCode, pos) { + switch (errorCode) { + case ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code: + case ts2.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: + case ts2.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code: + case ts2.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code: + case ts2.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: + return doAddOverrideModifierChange(changeTracker, context2.sourceFile, pos); + case ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code: + case ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code: + case ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code: + case ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code: + return doRemoveOverrideModifierChange(changeTracker, context2.sourceFile, pos); + default: + ts2.Debug.fail("Unexpected error code: " + errorCode); + } + } + function doAddOverrideModifierChange(changeTracker, sourceFile, pos) { + var classElement = findContainerClassElementLike(sourceFile, pos); + if (ts2.isSourceFileJS(sourceFile)) { + changeTracker.addJSDocTags(sourceFile, classElement, [ts2.factory.createJSDocOverrideTag(ts2.factory.createIdentifier("override"))]); + return; + } + var modifiers = classElement.modifiers || ts2.emptyArray; + var staticModifier = ts2.find(modifiers, ts2.isStaticModifier); + var abstractModifier = ts2.find(modifiers, ts2.isAbstractModifier); + var accessibilityModifier = ts2.find(modifiers, function(m7) { + return ts2.isAccessibilityModifier(m7.kind); + }); + var lastDecorator = ts2.findLast(modifiers, ts2.isDecorator); + var modifierPos = abstractModifier ? abstractModifier.end : staticModifier ? staticModifier.end : accessibilityModifier ? accessibilityModifier.end : lastDecorator ? ts2.skipTrivia(sourceFile.text, lastDecorator.end) : classElement.getStart(sourceFile); + var options = accessibilityModifier || staticModifier || abstractModifier ? { prefix: " " } : { suffix: " " }; + changeTracker.insertModifierAt(sourceFile, modifierPos, 161, options); + } + function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { + var classElement = findContainerClassElementLike(sourceFile, pos); + if (ts2.isSourceFileJS(sourceFile)) { + changeTracker.filterJSDocTags(sourceFile, classElement, ts2.not(ts2.isJSDocOverrideTag)); + return; + } + var overrideModifier = ts2.find(classElement.modifiers, ts2.isOverrideModifier); + ts2.Debug.assertIsDefined(overrideModifier); + changeTracker.deleteModifier(sourceFile, overrideModifier); + } + function isClassElementLikeHasJSDoc(node) { + switch (node.kind) { + case 173: + case 169: + case 171: + case 174: + case 175: + return true; + case 166: + return ts2.isParameterPropertyDeclaration(node, node.parent); + default: + return false; + } + } + function findContainerClassElementLike(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var classElement = ts2.findAncestor(token, function(node) { + if (ts2.isClassLike(node)) + return "quit"; + return isClassElementLikeHasJSDoc(node); + }); + ts2.Debug.assert(classElement && isClassElementLikeHasJSDoc(classElement)); + return classElement; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixNoPropertyAccessFromIndexSignature"; + var errorCodes = [ + ts2.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span, preferences = context2.preferences; + var property2 = getPropertyAccessExpression(sourceFile, span.start); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, property2, preferences); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Use_element_access_for_0, property2.name.text], fixId, ts2.Diagnostics.Use_element_access_for_all_undeclared_properties)]; + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, diag.file, getPropertyAccessExpression(diag.file, diag.start), context2.preferences); + }); + } + }); + function doChange(changes, sourceFile, node, preferences) { + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + var argumentsExpression = ts2.factory.createStringLiteral( + node.name.text, + quotePreference === 0 + /* QuotePreference.Single */ + ); + changes.replaceNode(sourceFile, node, ts2.isPropertyAccessChain(node) ? ts2.factory.createElementAccessChain(node.expression, node.questionDotToken, argumentsExpression) : ts2.factory.createElementAccessExpression(node.expression, argumentsExpression)); + } + function getPropertyAccessExpression(sourceFile, pos) { + return ts2.cast(ts2.getTokenAtPosition(sourceFile, pos).parent, ts2.isPropertyAccessExpression); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixImplicitThis"; + var errorCodes = [ts2.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixImplicitThis(context2) { + var sourceFile = context2.sourceFile, program = context2.program, span = context2.span; + var diagnostic; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + diagnostic = doChange(t8, sourceFile, span.start, program.getTypeChecker()); + }); + return diagnostic ? [codefix2.createCodeFixAction(fixId, changes, diagnostic, fixId, ts2.Diagnostics.Fix_all_implicit_this_errors)] : ts2.emptyArray; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + doChange(changes, diag.file, diag.start, context2.program.getTypeChecker()); + }); + } + }); + function doChange(changes, sourceFile, pos, checker) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (!ts2.isThis(token)) + return void 0; + var fn = ts2.getThisContainer( + token, + /*includeArrowFunctions*/ + false + ); + if (!ts2.isFunctionDeclaration(fn) && !ts2.isFunctionExpression(fn)) + return void 0; + if (!ts2.isSourceFile(ts2.getThisContainer( + fn, + /*includeArrowFunctions*/ + false + ))) { + var fnKeyword = ts2.Debug.checkDefined(ts2.findChildOfKind(fn, 98, sourceFile)); + var name2 = fn.name; + var body = ts2.Debug.checkDefined(fn.body); + if (ts2.isFunctionExpression(fn)) { + if (name2 && ts2.FindAllReferences.Core.isSymbolReferencedInFile(name2, checker, sourceFile, body)) { + return void 0; + } + changes.delete(sourceFile, fnKeyword); + if (name2) { + changes.delete(sourceFile, name2); + } + changes.insertText(sourceFile, body.pos, " =>"); + return [ts2.Diagnostics.Convert_function_expression_0_to_arrow_function, name2 ? name2.text : ts2.ANONYMOUS]; + } else { + changes.replaceNode(sourceFile, fnKeyword, ts2.factory.createToken( + 85 + /* SyntaxKind.ConstKeyword */ + )); + changes.insertText(sourceFile, name2.end, " = "); + changes.insertText(sourceFile, body.pos, " =>"); + return [ts2.Diagnostics.Convert_function_declaration_0_to_arrow_function, name2.text]; + } + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixImportNonExportedMember"; + var errorCodes = [ + ts2.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span, program = context2.program; + var info2 = getInfo(sourceFile, span.start, program); + if (info2 === void 0) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, program, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Export_0_from_module_1, info2.exportName.node.text, info2.moduleSpecifier], fixId, ts2.Diagnostics.Export_all_referenced_locals)]; + }, + getAllCodeActions: function(context2) { + var program = context2.program; + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, function(changes) { + var exports29 = new ts2.Map(); + codefix2.eachDiagnostic(context2, errorCodes, function(diag) { + var info2 = getInfo(diag.file, diag.start, program); + if (info2 === void 0) + return void 0; + var exportName = info2.exportName, node = info2.node, moduleSourceFile = info2.moduleSourceFile; + if (tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly) === void 0 && ts2.canHaveExportModifier(node)) { + changes.insertExportModifier(moduleSourceFile, node); + } else { + var moduleExports4 = exports29.get(moduleSourceFile) || { typeOnlyExports: [], exports: [] }; + if (exportName.isTypeOnly) { + moduleExports4.typeOnlyExports.push(exportName); + } else { + moduleExports4.exports.push(exportName); + } + exports29.set(moduleSourceFile, moduleExports4); + } + }); + exports29.forEach(function(moduleExports4, moduleSourceFile) { + var exportDeclaration = tryGetExportDeclaration( + moduleSourceFile, + /*isTypeOnly*/ + true + ); + if (exportDeclaration && exportDeclaration.isTypeOnly) { + doChanges(changes, program, moduleSourceFile, moduleExports4.typeOnlyExports, exportDeclaration); + doChanges(changes, program, moduleSourceFile, moduleExports4.exports, tryGetExportDeclaration( + moduleSourceFile, + /*isTypeOnly*/ + false + )); + } else { + doChanges(changes, program, moduleSourceFile, __spreadArray9(__spreadArray9([], moduleExports4.exports, true), moduleExports4.typeOnlyExports, true), exportDeclaration); + } + }); + })); + } + }); + function getInfo(sourceFile, pos, program) { + var _a2; + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (ts2.isIdentifier(token)) { + var importDeclaration = ts2.findAncestor(token, ts2.isImportDeclaration); + if (importDeclaration === void 0) + return void 0; + var moduleSpecifier = ts2.isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier.text : void 0; + if (moduleSpecifier === void 0) + return void 0; + var resolvedModule = ts2.getResolvedModule( + sourceFile, + moduleSpecifier, + /*mode*/ + void 0 + ); + if (resolvedModule === void 0) + return void 0; + var moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName); + if (moduleSourceFile === void 0 || ts2.isSourceFileFromLibrary(program, moduleSourceFile)) + return void 0; + var moduleSymbol = moduleSourceFile.symbol; + var locals = (_a2 = moduleSymbol.valueDeclaration) === null || _a2 === void 0 ? void 0 : _a2.locals; + if (locals === void 0) + return void 0; + var localSymbol = locals.get(token.escapedText); + if (localSymbol === void 0) + return void 0; + var node = getNodeOfSymbol(localSymbol); + if (node === void 0) + return void 0; + var exportName = { node: token, isTypeOnly: ts2.isTypeDeclaration(node) }; + return { exportName, node, moduleSourceFile, moduleSpecifier }; + } + return void 0; + } + function doChange(changes, program, _a2) { + var exportName = _a2.exportName, node = _a2.node, moduleSourceFile = _a2.moduleSourceFile; + var exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); + if (exportDeclaration) { + updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); + } else if (ts2.canHaveExportModifier(node)) { + changes.insertExportModifier(moduleSourceFile, node); + } else { + createExport(changes, program, moduleSourceFile, [exportName]); + } + } + function doChanges(changes, program, sourceFile, moduleExports4, node) { + if (ts2.length(moduleExports4)) { + if (node) { + updateExport(changes, program, sourceFile, node, moduleExports4); + } else { + createExport(changes, program, sourceFile, moduleExports4); + } + } + } + function tryGetExportDeclaration(sourceFile, isTypeOnly) { + var predicate = function(node) { + return ts2.isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly); + }; + return ts2.findLast(sourceFile.statements, predicate); + } + function updateExport(changes, program, sourceFile, node, names) { + var namedExports = node.exportClause && ts2.isNamedExports(node.exportClause) ? node.exportClause.elements : ts2.factory.createNodeArray([]); + var allowTypeModifier = !node.isTypeOnly && !!(program.getCompilerOptions().isolatedModules || ts2.find(namedExports, function(e10) { + return e10.isTypeOnly; + })); + changes.replaceNode(sourceFile, node, ts2.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, ts2.factory.createNamedExports(ts2.factory.createNodeArray( + __spreadArray9(__spreadArray9([], namedExports, true), createExportSpecifiers(names, allowTypeModifier), true), + /*hasTrailingComma*/ + namedExports.hasTrailingComma + )), node.moduleSpecifier, node.assertClause)); + } + function createExport(changes, program, sourceFile, names) { + changes.insertNodeAtEndOfScope(sourceFile, sourceFile, ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports(createExportSpecifiers( + names, + /*allowTypeModifier*/ + !!program.getCompilerOptions().isolatedModules + )), + /*moduleSpecifier*/ + void 0, + /*assertClause*/ + void 0 + )); + } + function createExportSpecifiers(names, allowTypeModifier) { + return ts2.factory.createNodeArray(ts2.map(names, function(n7) { + return ts2.factory.createExportSpecifier( + allowTypeModifier && n7.isTypeOnly, + /*propertyName*/ + void 0, + n7.node + ); + })); + } + function getNodeOfSymbol(symbol) { + if (symbol.valueDeclaration === void 0) { + return ts2.firstOrUndefined(symbol.declarations); + } + var declaration = symbol.valueDeclaration; + var variableStatement = ts2.isVariableDeclaration(declaration) ? ts2.tryCast(declaration.parent.parent, ts2.isVariableStatement) : void 0; + return variableStatement && ts2.length(variableStatement.declarationList.declarations) === 1 ? variableStatement : declaration; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixIncorrectNamedTupleSyntax"; + var errorCodes = [ + ts2.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code, + ts2.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var namedTupleMember = getNamedTupleMember(sourceFile, span.start); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, namedTupleMember); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId, ts2.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; + }, + fixIds: [fixId] + }); + function getNamedTupleMember(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + return ts2.findAncestor(token, function(t8) { + return t8.kind === 199; + }); + } + function doChange(changes, sourceFile, namedTupleMember) { + if (!namedTupleMember) { + return; + } + var unwrappedType = namedTupleMember.type; + var sawOptional = false; + var sawRest = false; + while (unwrappedType.kind === 187 || unwrappedType.kind === 188 || unwrappedType.kind === 193) { + if (unwrappedType.kind === 187) { + sawOptional = true; + } else if (unwrappedType.kind === 188) { + sawRest = true; + } + unwrappedType = unwrappedType.type; + } + var updated = ts2.factory.updateNamedTupleMember(namedTupleMember, namedTupleMember.dotDotDotToken || (sawRest ? ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ) : void 0), namedTupleMember.name, namedTupleMember.questionToken || (sawOptional ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0), unwrappedType); + if (updated === namedTupleMember) { + return; + } + changes.replaceNode(sourceFile, namedTupleMember, updated); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixSpelling"; + var errorCodes = [ + ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts2.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ts2.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code, + ts2.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, + ts2.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + ts2.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code, + ts2.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code, + // for JSX class components + ts2.Diagnostics.No_overload_matches_this_call.code, + // for JSX FC + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, errorCode = context2.errorCode; + var info2 = getInfo(sourceFile, context2.span.start, context2, errorCode); + if (!info2) + return void 0; + var node = info2.node, suggestedSymbol = info2.suggestedSymbol; + var target = ts2.getEmitScriptTarget(context2.host.getCompilationSettings()); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, node, suggestedSymbol, target); + }); + return [codefix2.createCodeFixAction("spelling", changes, [ts2.Diagnostics.Change_spelling_to_0, ts2.symbolName(suggestedSymbol)], fixId, ts2.Diagnostics.Fix_all_detected_spelling_errors)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start, context2, diag.code); + var target = ts2.getEmitScriptTarget(context2.host.getCompilationSettings()); + if (info2) + doChange(changes, context2.sourceFile, info2.node, info2.suggestedSymbol, target); + }); + } + }); + function getInfo(sourceFile, pos, context2, errorCode) { + var node = ts2.getTokenAtPosition(sourceFile, pos); + var parent2 = node.parent; + if ((errorCode === ts2.Diagnostics.No_overload_matches_this_call.code || errorCode === ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code) && !ts2.isJsxAttribute(parent2)) + return void 0; + var checker = context2.program.getTypeChecker(); + var suggestedSymbol; + if (ts2.isPropertyAccessExpression(parent2) && parent2.name === node) { + ts2.Debug.assert(ts2.isMemberName(node), "Expected an identifier for spelling (property access)"); + var containingType = checker.getTypeAtLocation(parent2.expression); + if (parent2.flags & 32) { + containingType = checker.getNonNullableType(containingType); + } + suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); + } else if (ts2.isBinaryExpression(parent2) && parent2.operatorToken.kind === 101 && parent2.left === node && ts2.isPrivateIdentifier(node)) { + var receiverType = checker.getTypeAtLocation(parent2.right); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, receiverType); + } else if (ts2.isQualifiedName(parent2) && parent2.right === node) { + var symbol = checker.getSymbolAtLocation(parent2.left); + if (symbol && symbol.flags & 1536) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent2.right, symbol); + } + } else if (ts2.isImportSpecifier(parent2) && parent2.name === node) { + ts2.Debug.assertNode(node, ts2.isIdentifier, "Expected an identifier for spelling (import)"); + var importDeclaration = ts2.findAncestor(node, ts2.isImportDeclaration); + var resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context2, importDeclaration); + if (resolvedSourceFile && resolvedSourceFile.symbol) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(node, resolvedSourceFile.symbol); + } + } else if (ts2.isJsxAttribute(parent2) && parent2.name === node) { + ts2.Debug.assertNode(node, ts2.isIdentifier, "Expected an identifier for JSX attribute"); + var tag = ts2.findAncestor(node, ts2.isJsxOpeningLikeElement); + var props = checker.getContextualTypeForArgumentAtIndex(tag, 0); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props); + } else if (ts2.hasSyntacticModifier( + parent2, + 16384 + /* ModifierFlags.Override */ + ) && ts2.isClassElement(parent2) && parent2.name === node) { + var baseDeclaration = ts2.findAncestor(node, ts2.isClassLike); + var baseTypeNode = baseDeclaration ? ts2.getEffectiveBaseTypeNode(baseDeclaration) : void 0; + var baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0; + if (baseType) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentClassMember(ts2.getTextOfNode(node), baseType); + } + } else { + var meaning = ts2.getMeaningFromLocation(node); + var name2 = ts2.getTextOfNode(node); + ts2.Debug.assert(name2 !== void 0, "name should be defined"); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentSymbol(node, name2, convertSemanticMeaningToSymbolFlags(meaning)); + } + return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; + } + function doChange(changes, sourceFile, node, suggestedSymbol, target) { + var suggestion = ts2.symbolName(suggestedSymbol); + if (!ts2.isIdentifierText(suggestion, target) && ts2.isPropertyAccessExpression(node.parent)) { + var valDecl = suggestedSymbol.valueDeclaration; + if (valDecl && ts2.isNamedDeclaration(valDecl) && ts2.isPrivateIdentifier(valDecl.name)) { + changes.replaceNode(sourceFile, node, ts2.factory.createIdentifier(suggestion)); + } else { + changes.replaceNode(sourceFile, node.parent, ts2.factory.createElementAccessExpression(node.parent.expression, ts2.factory.createStringLiteral(suggestion))); + } + } else { + changes.replaceNode(sourceFile, node, ts2.factory.createIdentifier(suggestion)); + } + } + function convertSemanticMeaningToSymbolFlags(meaning) { + var flags = 0; + if (meaning & 4) { + flags |= 1920; + } + if (meaning & 2) { + flags |= 788968; + } + if (meaning & 1) { + flags |= 111551; + } + return flags; + } + function getResolvedSourceFileFromImportDeclaration(sourceFile, context2, importDeclaration) { + if (!importDeclaration || !ts2.isStringLiteralLike(importDeclaration.moduleSpecifier)) + return void 0; + var resolvedModule = ts2.getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, ts2.getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier)); + if (!resolvedModule) + return void 0; + return context2.program.getSourceFile(resolvedModule.resolvedFileName); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "returnValueCorrect"; + var fixIdAddReturnStatement = "fixAddReturnStatement"; + var fixRemoveBracesFromArrowFunctionBody = "fixRemoveBracesFromArrowFunctionBody"; + var fixIdWrapTheBlockWithParen = "fixWrapTheBlockWithParen"; + var errorCodes = [ + ts2.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code, + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code + ]; + var ProblemKind; + (function(ProblemKind2) { + ProblemKind2[ProblemKind2["MissingReturnStatement"] = 0] = "MissingReturnStatement"; + ProblemKind2[ProblemKind2["MissingParentheses"] = 1] = "MissingParentheses"; + })(ProblemKind || (ProblemKind = {})); + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen], + getCodeActions: function getCodeActionsToCorrectReturnValue(context2) { + var program = context2.program, sourceFile = context2.sourceFile, start = context2.span.start, errorCode = context2.errorCode; + var info2 = getInfo(program.getTypeChecker(), sourceFile, start, errorCode); + if (!info2) + return void 0; + if (info2.kind === ProblemKind.MissingReturnStatement) { + return ts2.append([getActionForfixAddReturnStatement(context2, info2.expression, info2.statement)], ts2.isArrowFunction(info2.declaration) ? getActionForFixRemoveBracesFromArrowFunctionBody(context2, info2.declaration, info2.expression, info2.commentSource) : void 0); + } else { + return [getActionForfixWrapTheBlockWithParen(context2, info2.declaration, info2.expression)]; + } + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(context2.program.getTypeChecker(), diag.file, diag.start, diag.code); + if (!info2) + return void 0; + switch (context2.fixId) { + case fixIdAddReturnStatement: + addReturnStatement(changes, diag.file, info2.expression, info2.statement); + break; + case fixRemoveBracesFromArrowFunctionBody: + if (!ts2.isArrowFunction(info2.declaration)) + return void 0; + removeBlockBodyBrace( + changes, + diag.file, + info2.declaration, + info2.expression, + info2.commentSource, + /* withParen */ + false + ); + break; + case fixIdWrapTheBlockWithParen: + if (!ts2.isArrowFunction(info2.declaration)) + return void 0; + wrapBlockWithParen(changes, diag.file, info2.declaration, info2.expression); + break; + default: + ts2.Debug.fail(JSON.stringify(context2.fixId)); + } + }); + } + }); + function createObjectTypeFromLabeledExpression(checker, label, expression) { + var member = checker.createSymbol(4, label.escapedText); + member.type = checker.getTypeAtLocation(expression); + var members = ts2.createSymbolTable([member]); + return checker.createAnonymousType( + /*symbol*/ + void 0, + members, + [], + [], + [] + ); + } + function getFixInfo(checker, declaration, expectType, isFunctionType) { + if (!declaration.body || !ts2.isBlock(declaration.body) || ts2.length(declaration.body.statements) !== 1) + return void 0; + var firstStatement = ts2.first(declaration.body.statements); + if (ts2.isExpressionStatement(firstStatement) && checkFixedAssignableTo(checker, declaration, checker.getTypeAtLocation(firstStatement.expression), expectType, isFunctionType)) { + return { + declaration, + kind: ProblemKind.MissingReturnStatement, + expression: firstStatement.expression, + statement: firstStatement, + commentSource: firstStatement.expression + }; + } else if (ts2.isLabeledStatement(firstStatement) && ts2.isExpressionStatement(firstStatement.statement)) { + var node = ts2.factory.createObjectLiteralExpression([ts2.factory.createPropertyAssignment(firstStatement.label, firstStatement.statement.expression)]); + var nodeType = createObjectTypeFromLabeledExpression(checker, firstStatement.label, firstStatement.statement.expression); + if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { + return ts2.isArrowFunction(declaration) ? { + declaration, + kind: ProblemKind.MissingParentheses, + expression: node, + statement: firstStatement, + commentSource: firstStatement.statement.expression + } : { + declaration, + kind: ProblemKind.MissingReturnStatement, + expression: node, + statement: firstStatement, + commentSource: firstStatement.statement.expression + }; + } + } else if (ts2.isBlock(firstStatement) && ts2.length(firstStatement.statements) === 1) { + var firstBlockStatement = ts2.first(firstStatement.statements); + if (ts2.isLabeledStatement(firstBlockStatement) && ts2.isExpressionStatement(firstBlockStatement.statement)) { + var node = ts2.factory.createObjectLiteralExpression([ts2.factory.createPropertyAssignment(firstBlockStatement.label, firstBlockStatement.statement.expression)]); + var nodeType = createObjectTypeFromLabeledExpression(checker, firstBlockStatement.label, firstBlockStatement.statement.expression); + if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { + return { + declaration, + kind: ProblemKind.MissingReturnStatement, + expression: node, + statement: firstStatement, + commentSource: firstBlockStatement + }; + } + } + } + return void 0; + } + function checkFixedAssignableTo(checker, declaration, exprType, type3, isFunctionType) { + if (isFunctionType) { + var sig = checker.getSignatureFromDeclaration(declaration); + if (sig) { + if (ts2.hasSyntacticModifier( + declaration, + 512 + /* ModifierFlags.Async */ + )) { + exprType = checker.createPromiseType(exprType); + } + var newSig = checker.createSignature( + declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + exprType, + /*typePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags + ); + exprType = checker.createAnonymousType( + /*symbol*/ + void 0, + ts2.createSymbolTable(), + [newSig], + [], + [] + ); + } else { + exprType = checker.getAnyType(); + } + } + return checker.isTypeAssignableTo(exprType, type3); + } + function getInfo(checker, sourceFile, position, errorCode) { + var node = ts2.getTokenAtPosition(sourceFile, position); + if (!node.parent) + return void 0; + var declaration = ts2.findAncestor(node.parent, ts2.isFunctionLikeDeclaration); + switch (errorCode) { + case ts2.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code: + if (!declaration || !declaration.body || !declaration.type || !ts2.rangeContainsRange(declaration.type, node)) + return void 0; + return getFixInfo( + checker, + declaration, + checker.getTypeFromTypeNode(declaration.type), + /* isFunctionType */ + false + ); + case ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code: + if (!declaration || !ts2.isCallExpression(declaration.parent) || !declaration.body) + return void 0; + var pos = declaration.parent.arguments.indexOf(declaration); + var type3 = checker.getContextualTypeForArgumentAtIndex(declaration.parent, pos); + if (!type3) + return void 0; + return getFixInfo( + checker, + declaration, + type3, + /* isFunctionType */ + true + ); + case ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code: + if (!ts2.isDeclarationName(node) || !ts2.isVariableLike(node.parent) && !ts2.isJsxAttribute(node.parent)) + return void 0; + var initializer = getVariableLikeInitializer(node.parent); + if (!initializer || !ts2.isFunctionLikeDeclaration(initializer) || !initializer.body) + return void 0; + return getFixInfo( + checker, + initializer, + checker.getTypeAtLocation(node.parent), + /* isFunctionType */ + true + ); + } + return void 0; + } + function getVariableLikeInitializer(declaration) { + switch (declaration.kind) { + case 257: + case 166: + case 205: + case 169: + case 299: + return declaration.initializer; + case 288: + return declaration.initializer && (ts2.isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); + case 300: + case 168: + case 302: + case 350: + case 343: + return void 0; + } + } + function addReturnStatement(changes, sourceFile, expression, statement) { + ts2.suppressLeadingAndTrailingTrivia(expression); + var probablyNeedSemi = ts2.probablyUsesSemicolons(sourceFile); + changes.replaceNode(sourceFile, statement, ts2.factory.createReturnStatement(expression), { + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Exclude, + suffix: probablyNeedSemi ? ";" : void 0 + }); + } + function removeBlockBodyBrace(changes, sourceFile, declaration, expression, commentSource, withParen) { + var newBody = withParen || ts2.needsParentheses(expression) ? ts2.factory.createParenthesizedExpression(expression) : expression; + ts2.suppressLeadingAndTrailingTrivia(commentSource); + ts2.copyComments(commentSource, newBody); + changes.replaceNode(sourceFile, declaration.body, newBody); + } + function wrapBlockWithParen(changes, sourceFile, declaration, expression) { + changes.replaceNode(sourceFile, declaration.body, ts2.factory.createParenthesizedExpression(expression)); + } + function getActionForfixAddReturnStatement(context2, expression, statement) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addReturnStatement(t8, context2.sourceFile, expression, statement); + }); + return codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_a_return_statement, fixIdAddReturnStatement, ts2.Diagnostics.Add_all_missing_return_statement); + } + function getActionForFixRemoveBracesFromArrowFunctionBody(context2, declaration, expression, commentSource) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return removeBlockBodyBrace( + t8, + context2.sourceFile, + declaration, + expression, + commentSource, + /* withParen */ + false + ); + }); + return codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Remove_braces_from_arrow_function_body, fixRemoveBracesFromArrowFunctionBody, ts2.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues); + } + function getActionForfixWrapTheBlockWithParen(context2, declaration, expression) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return wrapBlockWithParen(t8, context2.sourceFile, declaration, expression); + }); + return codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal, fixIdWrapTheBlockWithParen, ts2.Diagnostics.Wrap_all_object_literal_with_parentheses); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixMissingMember = "fixMissingMember"; + var fixMissingProperties = "fixMissingProperties"; + var fixMissingAttributes = "fixMissingAttributes"; + var fixMissingFunctionDeclaration = "fixMissingFunctionDeclaration"; + var errorCodes = [ + ts2.Diagnostics.Property_0_does_not_exist_on_type_1.code, + ts2.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts2.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code, + ts2.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code, + ts2.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code, + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + ts2.Diagnostics.Cannot_find_name_0.code + ]; + var InfoKind; + (function(InfoKind2) { + InfoKind2[InfoKind2["TypeLikeDeclaration"] = 0] = "TypeLikeDeclaration"; + InfoKind2[InfoKind2["Enum"] = 1] = "Enum"; + InfoKind2[InfoKind2["Function"] = 2] = "Function"; + InfoKind2[InfoKind2["ObjectLiteral"] = 3] = "ObjectLiteral"; + InfoKind2[InfoKind2["JsxAttributes"] = 4] = "JsxAttributes"; + InfoKind2[InfoKind2["Signature"] = 5] = "Signature"; + })(InfoKind || (InfoKind = {})); + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var typeChecker = context2.program.getTypeChecker(); + var info2 = getInfo(context2.sourceFile, context2.span.start, context2.errorCode, typeChecker, context2.program); + if (!info2) { + return void 0; + } + if (info2.kind === InfoKind.ObjectLiteral) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addObjectLiteralProperties(t8, context2, info2); + }); + return [codefix2.createCodeFixAction(fixMissingProperties, changes, ts2.Diagnostics.Add_missing_properties, fixMissingProperties, ts2.Diagnostics.Add_all_missing_properties)]; + } + if (info2.kind === InfoKind.JsxAttributes) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addJsxAttributes(t8, context2, info2); + }); + return [codefix2.createCodeFixAction(fixMissingAttributes, changes, ts2.Diagnostics.Add_missing_attributes, fixMissingAttributes, ts2.Diagnostics.Add_all_missing_attributes)]; + } + if (info2.kind === InfoKind.Function || info2.kind === InfoKind.Signature) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addFunctionDeclaration(t8, context2, info2); + }); + return [codefix2.createCodeFixAction(fixMissingFunctionDeclaration, changes, [ts2.Diagnostics.Add_missing_function_declaration_0, info2.token.text], fixMissingFunctionDeclaration, ts2.Diagnostics.Add_all_missing_function_declarations)]; + } + if (info2.kind === InfoKind.Enum) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addEnumMemberDeclaration(t8, context2.program.getTypeChecker(), info2); + }); + return [codefix2.createCodeFixAction(fixMissingMember, changes, [ts2.Diagnostics.Add_missing_enum_member_0, info2.token.text], fixMissingMember, ts2.Diagnostics.Add_all_missing_members)]; + } + return ts2.concatenate(getActionsForMissingMethodDeclaration(context2, info2), getActionsForMissingMemberDeclaration(context2, info2)); + }, + fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], + getAllCodeActions: function(context2) { + var program = context2.program, fixId = context2.fixId; + var checker = program.getTypeChecker(); + var seen = new ts2.Map(); + var typeDeclToMembers = new ts2.Map(); + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, function(changes) { + codefix2.eachDiagnostic(context2, errorCodes, function(diag) { + var info2 = getInfo(diag.file, diag.start, diag.code, checker, context2.program); + if (!info2 || !ts2.addToSeen(seen, ts2.getNodeId(info2.parentDeclaration) + "#" + info2.token.text)) { + return; + } + if (fixId === fixMissingFunctionDeclaration && (info2.kind === InfoKind.Function || info2.kind === InfoKind.Signature)) { + addFunctionDeclaration(changes, context2, info2); + } else if (fixId === fixMissingProperties && info2.kind === InfoKind.ObjectLiteral) { + addObjectLiteralProperties(changes, context2, info2); + } else if (fixId === fixMissingAttributes && info2.kind === InfoKind.JsxAttributes) { + addJsxAttributes(changes, context2, info2); + } else { + if (info2.kind === InfoKind.Enum) { + addEnumMemberDeclaration(changes, checker, info2); + } + if (info2.kind === InfoKind.TypeLikeDeclaration) { + var parentDeclaration = info2.parentDeclaration, token_1 = info2.token; + var infos = ts2.getOrUpdate(typeDeclToMembers, parentDeclaration, function() { + return []; + }); + if (!infos.some(function(i7) { + return i7.token.text === token_1.text; + })) { + infos.push(info2); + } + } + } + }); + typeDeclToMembers.forEach(function(infos, declaration) { + var supers = ts2.isTypeLiteralNode(declaration) ? void 0 : codefix2.getAllSupers(declaration, checker); + var _loop_13 = function(info3) { + if (supers === null || supers === void 0 ? void 0 : supers.some(function(superClassOrInterface) { + var superInfos = typeDeclToMembers.get(superClassOrInterface); + return !!superInfos && superInfos.some(function(_a2) { + var token2 = _a2.token; + return token2.text === info3.token.text; + }); + })) + return "continue"; + var parentDeclaration = info3.parentDeclaration, declSourceFile = info3.declSourceFile, modifierFlags = info3.modifierFlags, token = info3.token, call = info3.call, isJSFile = info3.isJSFile; + if (call && !ts2.isPrivateIdentifier(token)) { + addMethodDeclaration(context2, changes, call, token, modifierFlags & 32, parentDeclaration, declSourceFile); + } else { + if (isJSFile && !ts2.isInterfaceDeclaration(parentDeclaration) && !ts2.isTypeLiteralNode(parentDeclaration)) { + addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32)); + } else { + var typeNode = getTypeNode(checker, parentDeclaration, token); + addPropertyDeclaration( + changes, + declSourceFile, + parentDeclaration, + token.text, + typeNode, + modifierFlags & 32 + /* ModifierFlags.Static */ + ); + } + } + }; + for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) { + var info2 = infos_1[_i]; + _loop_13(info2); + } + }); + })); + } + }); + function getInfo(sourceFile, tokenPos, errorCode, checker, program) { + var token = ts2.getTokenAtPosition(sourceFile, tokenPos); + var parent2 = token.parent; + if (errorCode === ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) { + if (!(token.kind === 18 && ts2.isObjectLiteralExpression(parent2) && ts2.isCallExpression(parent2.parent))) + return void 0; + var argIndex = ts2.findIndex(parent2.parent.arguments, function(arg) { + return arg === parent2; + }); + if (argIndex < 0) + return void 0; + var signature = checker.getResolvedSignature(parent2.parent); + if (!(signature && signature.declaration && signature.parameters[argIndex])) + return void 0; + var param = signature.parameters[argIndex].valueDeclaration; + if (!(param && ts2.isParameter(param) && ts2.isIdentifier(param.name))) + return void 0; + var properties = ts2.arrayFrom(checker.getUnmatchedProperties( + checker.getTypeAtLocation(parent2), + checker.getParameterType(signature, argIndex), + /* requireOptionalProperties */ + false, + /* matchDiscriminantProperties */ + false + )); + if (!ts2.length(properties)) + return void 0; + return { kind: InfoKind.ObjectLiteral, token: param.name, properties, parentDeclaration: parent2 }; + } + if (!ts2.isMemberName(token)) + return void 0; + if (ts2.isIdentifier(token) && ts2.hasInitializer(parent2) && parent2.initializer && ts2.isObjectLiteralExpression(parent2.initializer)) { + var properties = ts2.arrayFrom(checker.getUnmatchedProperties( + checker.getTypeAtLocation(parent2.initializer), + checker.getTypeAtLocation(token), + /* requireOptionalProperties */ + false, + /* matchDiscriminantProperties */ + false + )); + if (!ts2.length(properties)) + return void 0; + return { kind: InfoKind.ObjectLiteral, token, properties, parentDeclaration: parent2.initializer }; + } + if (ts2.isIdentifier(token) && ts2.isJsxOpeningLikeElement(token.parent)) { + var target = ts2.getEmitScriptTarget(program.getCompilerOptions()); + var attributes = getUnmatchedAttributes(checker, target, token.parent); + if (!ts2.length(attributes)) + return void 0; + return { kind: InfoKind.JsxAttributes, token, attributes, parentDeclaration: token.parent }; + } + if (ts2.isIdentifier(token)) { + var type3 = checker.getContextualType(token); + if (type3 && ts2.getObjectFlags(type3) & 16) { + var signature = ts2.firstOrUndefined(checker.getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + )); + if (signature === void 0) + return void 0; + return { kind: InfoKind.Signature, token, signature, sourceFile, parentDeclaration: findScope(token) }; + } + if (ts2.isCallExpression(parent2) && parent2.expression === token) { + return { kind: InfoKind.Function, token, call: parent2, sourceFile, modifierFlags: 0, parentDeclaration: findScope(token) }; + } + } + if (!ts2.isPropertyAccessExpression(parent2)) + return void 0; + var leftExpressionType = ts2.skipConstraint(checker.getTypeAtLocation(parent2.expression)); + var symbol = leftExpressionType.symbol; + if (!symbol || !symbol.declarations) + return void 0; + if (ts2.isIdentifier(token) && ts2.isCallExpression(parent2.parent)) { + var moduleDeclaration = ts2.find(symbol.declarations, ts2.isModuleDeclaration); + var moduleDeclarationSourceFile = moduleDeclaration === null || moduleDeclaration === void 0 ? void 0 : moduleDeclaration.getSourceFile(); + if (moduleDeclaration && moduleDeclarationSourceFile && !ts2.isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) { + return { kind: InfoKind.Function, token, call: parent2.parent, sourceFile, modifierFlags: 1, parentDeclaration: moduleDeclaration }; + } + var moduleSourceFile = ts2.find(symbol.declarations, ts2.isSourceFile); + if (sourceFile.commonJsModuleIndicator) + return void 0; + if (moduleSourceFile && !ts2.isSourceFileFromLibrary(program, moduleSourceFile)) { + return { kind: InfoKind.Function, token, call: parent2.parent, sourceFile: moduleSourceFile, modifierFlags: 1, parentDeclaration: moduleSourceFile }; + } + } + var classDeclaration = ts2.find(symbol.declarations, ts2.isClassLike); + if (!classDeclaration && ts2.isPrivateIdentifier(token)) + return void 0; + var declaration = classDeclaration || ts2.find(symbol.declarations, function(d7) { + return ts2.isInterfaceDeclaration(d7) || ts2.isTypeLiteralNode(d7); + }); + if (declaration && !ts2.isSourceFileFromLibrary(program, declaration.getSourceFile())) { + var makeStatic = !ts2.isTypeLiteralNode(declaration) && (leftExpressionType.target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol); + if (makeStatic && (ts2.isPrivateIdentifier(token) || ts2.isInterfaceDeclaration(declaration))) + return void 0; + var declSourceFile = declaration.getSourceFile(); + var modifierFlags = ts2.isTypeLiteralNode(declaration) ? 0 : (makeStatic ? 32 : 0) | (ts2.startsWithUnderscore(token.text) ? 8 : 0); + var isJSFile = ts2.isSourceFileJS(declSourceFile); + var call = ts2.tryCast(parent2.parent, ts2.isCallExpression); + return { kind: InfoKind.TypeLikeDeclaration, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile }; + } + var enumDeclaration = ts2.find(symbol.declarations, ts2.isEnumDeclaration); + if (enumDeclaration && !(leftExpressionType.flags & 1056) && !ts2.isPrivateIdentifier(token) && !ts2.isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) { + return { kind: InfoKind.Enum, token, parentDeclaration: enumDeclaration }; + } + return void 0; + } + function getActionsForMissingMemberDeclaration(context2, info2) { + return info2.isJSFile ? ts2.singleElementArray(createActionForAddMissingMemberInJavascriptFile(context2, info2)) : createActionsForAddMissingMemberInTypeScriptFile(context2, info2); + } + function createActionForAddMissingMemberInJavascriptFile(context2, _a2) { + var parentDeclaration = _a2.parentDeclaration, declSourceFile = _a2.declSourceFile, modifierFlags = _a2.modifierFlags, token = _a2.token; + if (ts2.isInterfaceDeclaration(parentDeclaration) || ts2.isTypeLiteralNode(parentDeclaration)) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMissingMemberInJs(t8, declSourceFile, parentDeclaration, token, !!(modifierFlags & 32)); + }); + if (changes.length === 0) { + return void 0; + } + var diagnostic = modifierFlags & 32 ? ts2.Diagnostics.Initialize_static_property_0 : ts2.isPrivateIdentifier(token) ? ts2.Diagnostics.Declare_a_private_field_named_0 : ts2.Diagnostics.Initialize_property_0_in_the_constructor; + return codefix2.createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, ts2.Diagnostics.Add_all_missing_members); + } + function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) { + var tokenName = token.text; + if (makeStatic) { + if (classDeclaration.kind === 228) { + return; + } + var className = classDeclaration.name.getText(); + var staticInitialization = initializePropertyToUndefined(ts2.factory.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(sourceFile, classDeclaration, staticInitialization); + } else if (ts2.isPrivateIdentifier(token)) { + var property2 = ts2.factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + tokenName, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + var lastProp = getNodeToInsertPropertyAfter(classDeclaration); + if (lastProp) { + changeTracker.insertNodeAfter(sourceFile, lastProp, property2); + } else { + changeTracker.insertMemberAtStart(sourceFile, classDeclaration, property2); + } + } else { + var classConstructor = ts2.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; + } + var propertyInitialization = initializePropertyToUndefined(ts2.factory.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(sourceFile, classConstructor, propertyInitialization); + } + } + function initializePropertyToUndefined(obj, propertyName) { + return ts2.factory.createExpressionStatement(ts2.factory.createAssignment(ts2.factory.createPropertyAccessExpression(obj, propertyName), createUndefined())); + } + function createActionsForAddMissingMemberInTypeScriptFile(context2, _a2) { + var parentDeclaration = _a2.parentDeclaration, declSourceFile = _a2.declSourceFile, modifierFlags = _a2.modifierFlags, token = _a2.token; + var memberName = token.text; + var isStatic = modifierFlags & 32; + var typeNode = getTypeNode(context2.program.getTypeChecker(), parentDeclaration, token); + var addPropertyDeclarationChanges = function(modifierFlags2) { + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addPropertyDeclaration(t8, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2); + }); + }; + var actions = [codefix2.createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges( + modifierFlags & 32 + /* ModifierFlags.Static */ + ), [isStatic ? ts2.Diagnostics.Declare_static_property_0 : ts2.Diagnostics.Declare_property_0, memberName], fixMissingMember, ts2.Diagnostics.Add_all_missing_members)]; + if (isStatic || ts2.isPrivateIdentifier(token)) { + return actions; + } + if (modifierFlags & 8) { + actions.unshift(codefix2.createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges( + 8 + /* ModifierFlags.Private */ + ), [ts2.Diagnostics.Declare_private_property_0, memberName])); + } + actions.push(createAddIndexSignatureAction(context2, declSourceFile, parentDeclaration, token.text, typeNode)); + return actions; + } + function getTypeNode(checker, node, token) { + var typeNode; + if (token.parent.parent.kind === 223) { + var binaryExpression = token.parent.parent; + var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode( + widenedType, + node, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + } else { + var contextualType = checker.getContextualType(token.parent); + typeNode = contextualType ? checker.typeToTypeNode( + contextualType, + /*enclosingDeclaration*/ + void 0, + 1 + /* NodeBuilderFlags.NoTruncation */ + ) : void 0; + } + return typeNode || ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + ); + } + function addPropertyDeclaration(changeTracker, sourceFile, node, tokenName, typeNode, modifierFlags) { + var modifiers = modifierFlags ? ts2.factory.createNodeArray(ts2.factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; + var property2 = ts2.isClassLike(node) ? ts2.factory.createPropertyDeclaration( + modifiers, + tokenName, + /*questionToken*/ + void 0, + typeNode, + /*initializer*/ + void 0 + ) : ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + tokenName, + /*questionToken*/ + void 0, + typeNode + ); + var lastProp = getNodeToInsertPropertyAfter(node); + if (lastProp) { + changeTracker.insertNodeAfter(sourceFile, lastProp, property2); + } else { + changeTracker.insertMemberAtStart(sourceFile, node, property2); + } + } + function getNodeToInsertPropertyAfter(node) { + var res; + for (var _i = 0, _a2 = node.members; _i < _a2.length; _i++) { + var member = _a2[_i]; + if (!ts2.isPropertyDeclaration(member)) + break; + res = member; + } + return res; + } + function createAddIndexSignatureAction(context2, sourceFile, node, tokenName, typeNode) { + var stringTypeNode = ts2.factory.createKeywordTypeNode( + 152 + /* SyntaxKind.StringKeyword */ + ); + var indexingParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "x", + /*questionToken*/ + void 0, + stringTypeNode, + /*initializer*/ + void 0 + ); + var indexSignature = ts2.factory.createIndexSignature( + /*modifiers*/ + void 0, + [indexingParameter], + typeNode + ); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.insertMemberAtStart(sourceFile, node, indexSignature); + }); + return codefix2.createCodeFixActionWithoutFixAll(fixMissingMember, changes, [ts2.Diagnostics.Add_index_signature_for_property_0, tokenName]); + } + function getActionsForMissingMethodDeclaration(context2, info2) { + var parentDeclaration = info2.parentDeclaration, declSourceFile = info2.declSourceFile, modifierFlags = info2.modifierFlags, token = info2.token, call = info2.call; + if (call === void 0) { + return void 0; + } + if (ts2.isPrivateIdentifier(token)) { + return void 0; + } + var methodName = token.text; + var addMethodDeclarationChanges = function(modifierFlags2) { + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMethodDeclaration(context2, t8, call, token, modifierFlags2, parentDeclaration, declSourceFile); + }); + }; + var actions = [codefix2.createCodeFixAction(fixMissingMember, addMethodDeclarationChanges( + modifierFlags & 32 + /* ModifierFlags.Static */ + ), [modifierFlags & 32 ? ts2.Diagnostics.Declare_static_method_0 : ts2.Diagnostics.Declare_method_0, methodName], fixMissingMember, ts2.Diagnostics.Add_all_missing_members)]; + if (modifierFlags & 8) { + actions.unshift(codefix2.createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges( + 8 + /* ModifierFlags.Private */ + ), [ts2.Diagnostics.Declare_private_method_0, methodName])); + } + return actions; + } + function addMethodDeclaration(context2, changes, callExpression, name2, modifierFlags, parentDeclaration, sourceFile) { + var importAdder = codefix2.createImportAdder(sourceFile, context2.program, context2.preferences, context2.host); + var kind = ts2.isClassLike(parentDeclaration) ? 171 : 170; + var signatureDeclaration = codefix2.createSignatureDeclarationFromCallExpression(kind, context2, importAdder, callExpression, name2, modifierFlags, parentDeclaration); + var containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); + if (containingMethodDeclaration) { + changes.insertNodeAfter(sourceFile, containingMethodDeclaration, signatureDeclaration); + } else { + changes.insertMemberAtStart(sourceFile, parentDeclaration, signatureDeclaration); + } + importAdder.writeFixes(changes); + } + function addEnumMemberDeclaration(changes, checker, _a2) { + var token = _a2.token, parentDeclaration = _a2.parentDeclaration; + var hasStringInitializer = ts2.some(parentDeclaration.members, function(member) { + var type3 = checker.getTypeAtLocation(member); + return !!(type3 && type3.flags & 402653316); + }); + var enumMember = ts2.factory.createEnumMember(token, hasStringInitializer ? ts2.factory.createStringLiteral(token.text) : void 0); + changes.replaceNode(parentDeclaration.getSourceFile(), parentDeclaration, ts2.factory.updateEnumDeclaration(parentDeclaration, parentDeclaration.modifiers, parentDeclaration.name, ts2.concatenate(parentDeclaration.members, ts2.singleElementArray(enumMember))), { + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Exclude + }); + } + function addFunctionDeclaration(changes, context2, info2) { + var quotePreference = ts2.getQuotePreference(context2.sourceFile, context2.preferences); + var importAdder = codefix2.createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + var functionDeclaration = info2.kind === InfoKind.Function ? codefix2.createSignatureDeclarationFromCallExpression(259, context2, importAdder, info2.call, ts2.idText(info2.token), info2.modifierFlags, info2.parentDeclaration) : codefix2.createSignatureDeclarationFromSignature( + 259, + context2, + quotePreference, + info2.signature, + codefix2.createStubbedBody(ts2.Diagnostics.Function_not_implemented.message, quotePreference), + info2.token, + /*modifiers*/ + void 0, + /*optional*/ + void 0, + /*enclosingDeclaration*/ + void 0, + importAdder + ); + if (functionDeclaration === void 0) { + ts2.Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error."); + } + ts2.isReturnStatement(info2.parentDeclaration) ? changes.insertNodeBefore( + info2.sourceFile, + info2.parentDeclaration, + functionDeclaration, + /*blankLineBetween*/ + true + ) : changes.insertNodeAtEndOfScope(info2.sourceFile, info2.parentDeclaration, functionDeclaration); + importAdder.writeFixes(changes); + } + function addJsxAttributes(changes, context2, info2) { + var importAdder = codefix2.createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + var quotePreference = ts2.getQuotePreference(context2.sourceFile, context2.preferences); + var checker = context2.program.getTypeChecker(); + var jsxAttributesNode = info2.parentDeclaration.attributes; + var hasSpreadAttribute = ts2.some(jsxAttributesNode.properties, ts2.isJsxSpreadAttribute); + var attrs = ts2.map(info2.attributes, function(attr) { + var value2 = tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info2.parentDeclaration); + var name2 = ts2.factory.createIdentifier(attr.name); + var jsxAttribute = ts2.factory.createJsxAttribute(name2, ts2.factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + value2 + )); + ts2.setParent(name2, jsxAttribute); + return jsxAttribute; + }); + var jsxAttributes = ts2.factory.createJsxAttributes(hasSpreadAttribute ? __spreadArray9(__spreadArray9([], attrs, true), jsxAttributesNode.properties, true) : __spreadArray9(__spreadArray9([], jsxAttributesNode.properties, true), attrs, true)); + var options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : void 0 }; + changes.replaceNode(context2.sourceFile, jsxAttributesNode, jsxAttributes, options); + importAdder.writeFixes(changes); + } + function addObjectLiteralProperties(changes, context2, info2) { + var importAdder = codefix2.createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + var quotePreference = ts2.getQuotePreference(context2.sourceFile, context2.preferences); + var target = ts2.getEmitScriptTarget(context2.program.getCompilerOptions()); + var checker = context2.program.getTypeChecker(); + var props = ts2.map(info2.properties, function(prop) { + var initializer = tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info2.parentDeclaration); + return ts2.factory.createPropertyAssignment(createPropertyNameFromSymbol(prop, target, quotePreference, checker), initializer); + }); + var options = { + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Exclude, + indentation: info2.indentation + }; + changes.replaceNode(context2.sourceFile, info2.parentDeclaration, ts2.factory.createObjectLiteralExpression( + __spreadArray9(__spreadArray9([], info2.parentDeclaration.properties, true), props, true), + /*multiLine*/ + true + ), options); + importAdder.writeFixes(changes); + } + function tryGetValueFromType(context2, checker, importAdder, quotePreference, type3, enclosingDeclaration) { + if (type3.flags & 3) { + return createUndefined(); + } + if (type3.flags & (4 | 134217728)) { + return ts2.factory.createStringLiteral( + "", + /* isSingleQuote */ + quotePreference === 0 + /* QuotePreference.Single */ + ); + } + if (type3.flags & 8) { + return ts2.factory.createNumericLiteral(0); + } + if (type3.flags & 64) { + return ts2.factory.createBigIntLiteral("0n"); + } + if (type3.flags & 16) { + return ts2.factory.createFalse(); + } + if (type3.flags & 1056) { + var enumMember = type3.symbol.exports ? ts2.firstOrUndefined(ts2.arrayFrom(type3.symbol.exports.values())) : type3.symbol; + var name2 = checker.symbolToExpression( + type3.symbol.parent ? type3.symbol.parent : type3.symbol, + 111551, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0 + ); + return enumMember === void 0 || name2 === void 0 ? ts2.factory.createNumericLiteral(0) : ts2.factory.createPropertyAccessExpression(name2, checker.symbolToString(enumMember)); + } + if (type3.flags & 256) { + return ts2.factory.createNumericLiteral(type3.value); + } + if (type3.flags & 2048) { + return ts2.factory.createBigIntLiteral(type3.value); + } + if (type3.flags & 128) { + return ts2.factory.createStringLiteral( + type3.value, + /* isSingleQuote */ + quotePreference === 0 + /* QuotePreference.Single */ + ); + } + if (type3.flags & 512) { + return type3 === checker.getFalseType() || type3 === checker.getFalseType( + /*fresh*/ + true + ) ? ts2.factory.createFalse() : ts2.factory.createTrue(); + } + if (type3.flags & 65536) { + return ts2.factory.createNull(); + } + if (type3.flags & 1048576) { + var expression = ts2.firstDefined(type3.types, function(t8) { + return tryGetValueFromType(context2, checker, importAdder, quotePreference, t8, enclosingDeclaration); + }); + return expression !== null && expression !== void 0 ? expression : createUndefined(); + } + if (checker.isArrayLikeType(type3)) { + return ts2.factory.createArrayLiteralExpression(); + } + if (isObjectLiteralType(type3)) { + var props = ts2.map(checker.getPropertiesOfType(type3), function(prop) { + var initializer = prop.valueDeclaration ? tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration), enclosingDeclaration) : createUndefined(); + return ts2.factory.createPropertyAssignment(prop.name, initializer); + }); + return ts2.factory.createObjectLiteralExpression( + props, + /*multiLine*/ + true + ); + } + if (ts2.getObjectFlags(type3) & 16) { + var decl = ts2.find(type3.symbol.declarations || ts2.emptyArray, ts2.or(ts2.isFunctionTypeNode, ts2.isMethodSignature, ts2.isMethodDeclaration)); + if (decl === void 0) + return createUndefined(); + var signature = checker.getSignaturesOfType( + type3, + 0 + /* SignatureKind.Call */ + ); + if (signature === void 0) + return createUndefined(); + var func = codefix2.createSignatureDeclarationFromSignature( + 215, + context2, + quotePreference, + signature[0], + codefix2.createStubbedBody(ts2.Diagnostics.Function_not_implemented.message, quotePreference), + /*name*/ + void 0, + /*modifiers*/ + void 0, + /*optional*/ + void 0, + /*enclosingDeclaration*/ + enclosingDeclaration, + importAdder + ); + return func !== null && func !== void 0 ? func : createUndefined(); + } + if (ts2.getObjectFlags(type3) & 1) { + var classDeclaration = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + if (classDeclaration === void 0 || ts2.hasAbstractModifier(classDeclaration)) + return createUndefined(); + var constructorDeclaration = ts2.getFirstConstructorWithBody(classDeclaration); + if (constructorDeclaration && ts2.length(constructorDeclaration.parameters)) + return createUndefined(); + return ts2.factory.createNewExpression( + ts2.factory.createIdentifier(type3.symbol.name), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + } + return createUndefined(); + } + function createUndefined() { + return ts2.factory.createIdentifier("undefined"); + } + function isObjectLiteralType(type3) { + return type3.flags & 524288 && (ts2.getObjectFlags(type3) & 128 || type3.symbol && ts2.tryCast(ts2.singleOrUndefined(type3.symbol.declarations), ts2.isTypeLiteralNode)); + } + function getUnmatchedAttributes(checker, target, source) { + var attrsType = checker.getContextualType(source.attributes); + if (attrsType === void 0) + return ts2.emptyArray; + var targetProps = attrsType.getProperties(); + if (!ts2.length(targetProps)) + return ts2.emptyArray; + var seenNames = new ts2.Set(); + for (var _i = 0, _a2 = source.attributes.properties; _i < _a2.length; _i++) { + var sourceProp = _a2[_i]; + if (ts2.isJsxAttribute(sourceProp)) { + seenNames.add(sourceProp.name.escapedText); + } + if (ts2.isJsxSpreadAttribute(sourceProp)) { + var type3 = checker.getTypeAtLocation(sourceProp.expression); + for (var _b = 0, _c = type3.getProperties(); _b < _c.length; _b++) { + var prop = _c[_b]; + seenNames.add(prop.escapedName); + } + } + } + return ts2.filter(targetProps, function(targetProp) { + return ts2.isIdentifierText( + targetProp.name, + target, + 1 + /* LanguageVariant.JSX */ + ) && !(targetProp.flags & 16777216 || ts2.getCheckFlags(targetProp) & 48 || seenNames.has(targetProp.escapedName)); + }); + } + function tryGetContainingMethodDeclaration(node, callExpression) { + if (ts2.isTypeLiteralNode(node)) { + return void 0; + } + var declaration = ts2.findAncestor(callExpression, function(n7) { + return ts2.isMethodDeclaration(n7) || ts2.isConstructorDeclaration(n7); + }); + return declaration && declaration.parent === node ? declaration : void 0; + } + function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) { + if (ts2.isTransientSymbol(symbol)) { + var prop = checker.symbolToNode( + symbol, + 111551, + /*enclosingDeclaration*/ + void 0, + 1073741824 + /* NodeBuilderFlags.WriteComputedProps */ + ); + if (prop && ts2.isComputedPropertyName(prop)) + return prop; + } + return ts2.createPropertyNameNodeForIdentifierOrLiteral( + symbol.name, + target, + quotePreference === 0 + /* QuotePreference.Single */ + ); + } + function findScope(node) { + if (ts2.findAncestor(node, ts2.isJsxExpression)) { + var returnStatement = ts2.findAncestor(node.parent, ts2.isReturnStatement); + if (returnStatement) + return returnStatement; + } + return ts2.getSourceFileOfNode(node); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "addMissingNewOperator"; + var errorCodes = [ts2.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMissingNewOperator(t8, sourceFile, span); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_missing_new_operator_to_call, fixId, ts2.Diagnostics.Add_missing_new_operator_to_all_calls)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return addMissingNewOperator(changes, context2.sourceFile, diag); + }); + } + }); + function addMissingNewOperator(changes, sourceFile, span) { + var call = ts2.cast(findAncestorMatchingSpan(sourceFile, span), ts2.isCallExpression); + var newExpression = ts2.factory.createNewExpression(call.expression, call.typeArguments, call.arguments); + changes.replaceNode(sourceFile, call, newExpression); + } + function findAncestorMatchingSpan(sourceFile, span) { + var token = ts2.getTokenAtPosition(sourceFile, span.start); + var end = ts2.textSpanEnd(span); + while (token.end < end) { + token = token.parent; + } + return token; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "fixCannotFindModule"; + var fixIdInstallTypesPackage = "installTypesPackage"; + var errorCodeCannotFindModule = ts2.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; + var errorCodes = [ + errorCodeCannotFindModule, + ts2.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixNotFoundModule(context2) { + var host = context2.host, sourceFile = context2.sourceFile, start = context2.span.start; + var packageName = tryGetImportedPackageName(sourceFile, start); + if (packageName === void 0) + return void 0; + var typesPackageName = getTypesPackageNameToInstall(packageName, host, context2.errorCode); + return typesPackageName === void 0 ? [] : [codefix2.createCodeFixAction( + fixName, + /*changes*/ + [], + [ts2.Diagnostics.Install_0, typesPackageName], + fixIdInstallTypesPackage, + ts2.Diagnostics.Install_all_missing_types_packages, + getInstallCommand(sourceFile.fileName, typesPackageName) + )]; + }, + fixIds: [fixIdInstallTypesPackage], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(_changes, diag, commands) { + var packageName = tryGetImportedPackageName(diag.file, diag.start); + if (packageName === void 0) + return void 0; + switch (context2.fixId) { + case fixIdInstallTypesPackage: { + var pkg = getTypesPackageNameToInstall(packageName, context2.host, diag.code); + if (pkg) { + commands.push(getInstallCommand(diag.file.fileName, pkg)); + } + break; + } + default: + ts2.Debug.fail("Bad fixId: ".concat(context2.fixId)); + } + }); + } + }); + function getInstallCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName }; + } + function tryGetImportedPackageName(sourceFile, pos) { + var moduleSpecifierText = ts2.tryCast(ts2.getTokenAtPosition(sourceFile, pos), ts2.isStringLiteral); + if (!moduleSpecifierText) + return void 0; + var moduleName3 = moduleSpecifierText.text; + var packageName = ts2.parsePackageName(moduleName3).packageName; + return ts2.isExternalModuleNameRelative(packageName) ? void 0 : packageName; + } + function getTypesPackageNameToInstall(packageName, host, diagCode) { + var _a2; + return diagCode === errorCodeCannotFindModule ? ts2.JsTyping.nodeCoreModules.has(packageName) ? "@types/node" : void 0 : ((_a2 = host.isKnownTypesPackageName) === null || _a2 === void 0 ? void 0 : _a2.call(host, packageName)) ? ts2.getTypesPackageName(packageName) : void 0; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ + ts2.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, + ts2.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code + ]; + var fixId = "fixClassDoesntImplementInheritedAbstractMember"; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixClassNotImplementingInheritedMembers(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, context2, t8, context2.preferences); + }); + return changes.length === 0 ? void 0 : [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Implement_inherited_abstract_class, fixId, ts2.Diagnostics.Implement_all_inherited_abstract_classes)]; + }, + fixIds: [fixId], + getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context2) { + var seenClassDeclarations = new ts2.Map(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts2.addToSeen(seenClassDeclarations, ts2.getNodeId(classDeclaration))) { + addMissingMembers(classDeclaration, context2.sourceFile, context2, changes, context2.preferences); + } + }); + } + }); + function getClass(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + return ts2.cast(token.parent, ts2.isClassLike); + } + function addMissingMembers(classDeclaration, sourceFile, context2, changeTracker, preferences) { + var extendsNode = ts2.getEffectiveBaseTypeNode(classDeclaration); + var checker = context2.program.getTypeChecker(); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + var importAdder = codefix2.createImportAdder(sourceFile, context2.program, preferences, context2.host); + codefix2.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context2, preferences, importAdder, function(member) { + return changeTracker.insertMemberAtStart(sourceFile, classDeclaration, member); + }); + importAdder.writeFixes(changeTracker); + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + var flags = ts2.getSyntacticModifierFlags(ts2.first(symbol.getDeclarations())); + return !(flags & 8) && !!(flags & 256); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "classSuperMustPrecedeThisAccess"; + var errorCodes = [ts2.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return void 0; + var constructor = nodes.constructor, superCall = nodes.superCall; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, constructor, superCall); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId, ts2.Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var seenClasses = new ts2.Map(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + var constructor = nodes.constructor, superCall = nodes.superCall; + if (ts2.addToSeen(seenClasses, ts2.getNodeId(constructor.parent))) { + doChange(changes, sourceFile, constructor, superCall); + } + }); + } + }); + function doChange(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.delete(sourceFile, superCall); + } + function getNodes(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (token.kind !== 108) + return void 0; + var constructor = ts2.getContainingFunction(token); + var superCall = findSuperCall(constructor.body); + return superCall && !superCall.expression.arguments.some(function(arg) { + return ts2.isPropertyAccessExpression(arg) && arg.expression === token; + }) ? { constructor, superCall } : void 0; + } + function findSuperCall(n7) { + return ts2.isExpressionStatement(n7) && ts2.isSuperCall(n7.expression) ? n7 : ts2.isFunctionLike(n7) ? void 0 : ts2.forEachChild(n7, findSuperCall); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "constructorForDerivedNeedSuperCall"; + var errorCodes = [ts2.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var ctr = getNode(sourceFile, span.start); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, ctr); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_missing_super_call, fixId, ts2.Diagnostics.Add_all_missing_super_calls)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, context2.sourceFile, getNode(diag.file, diag.start)); + }); + } + }); + function getNode(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + ts2.Debug.assert(ts2.isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); + return token.parent; + } + function doChange(changes, sourceFile, ctr) { + var superCall = ts2.factory.createExpressionStatement(ts2.factory.createCallExpression( + ts2.factory.createSuper(), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + ts2.emptyArray + )); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "enableExperimentalDecorators"; + var errorCodes = [ + ts2.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToEnableExperimentalDecorators(context2) { + var configFile = context2.program.getCompilerOptions().configFile; + if (configFile === void 0) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changeTracker) { + return doChange(changeTracker, configFile); + }); + return [codefix2.createCodeFixActionWithoutFixAll(fixId, changes, ts2.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes) { + var configFile = context2.program.getCompilerOptions().configFile; + if (configFile === void 0) { + return void 0; + } + doChange(changes, configFile); + }); + } + }); + function doChange(changeTracker, configFile) { + codefix2.setJsonCompilerOptionValue(changeTracker, configFile, "experimentalDecorators", ts2.factory.createTrue()); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixID = "fixEnableJsxFlag"; + var errorCodes = [ts2.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToFixEnableJsxFlag(context2) { + var configFile = context2.program.getCompilerOptions().configFile; + if (configFile === void 0) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changeTracker) { + return doChange(changeTracker, configFile); + }); + return [ + codefix2.createCodeFixActionWithoutFixAll(fixID, changes, ts2.Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) + ]; + }, + fixIds: [fixID], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes) { + var configFile = context2.program.getCompilerOptions().configFile; + if (configFile === void 0) { + return void 0; + } + doChange(changes, configFile); + }); + } + }); + function doChange(changeTracker, configFile) { + codefix2.setJsonCompilerOptionValue(changeTracker, configFile, "jsx", ts2.factory.createStringLiteral("react")); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixNaNEquality"; + var errorCodes = [ + ts2.Diagnostics.This_condition_will_always_return_0.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span, program = context2.program; + var info2 = getInfo(program, sourceFile, span); + if (info2 === void 0) + return; + var suggestion = info2.suggestion, expression = info2.expression, arg = info2.arg; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, arg, expression); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Use_0, suggestion], fixId, ts2.Diagnostics.Use_Number_isNaN_in_all_conditions)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(context2.program, diag.file, ts2.createTextSpan(diag.start, diag.length)); + if (info2) { + doChange(changes, diag.file, info2.arg, info2.expression); + } + }); + } + }); + function getInfo(program, sourceFile, span) { + var diag = ts2.find(program.getSemanticDiagnostics(sourceFile), function(diag2) { + return diag2.start === span.start && diag2.length === span.length; + }); + if (diag === void 0 || diag.relatedInformation === void 0) + return; + var related = ts2.find(diag.relatedInformation, function(related2) { + return related2.code === ts2.Diagnostics.Did_you_mean_0.code; + }); + if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) + return; + var token = codefix2.findAncestorMatchingSpan(related.file, ts2.createTextSpan(related.start, related.length)); + if (token === void 0) + return; + if (ts2.isExpression(token) && ts2.isBinaryExpression(token.parent)) { + return { suggestion: getSuggestion(related.messageText), expression: token.parent, arg: token }; + } + return void 0; + } + function doChange(changes, sourceFile, arg, expression) { + var callExpression = ts2.factory.createCallExpression( + ts2.factory.createPropertyAccessExpression(ts2.factory.createIdentifier("Number"), ts2.factory.createIdentifier("isNaN")), + /*typeArguments*/ + void 0, + [arg] + ); + var operator = expression.operatorToken.kind; + changes.replaceNode(sourceFile, expression, operator === 37 || operator === 35 ? ts2.factory.createPrefixUnaryExpression(53, callExpression) : callExpression); + } + function getSuggestion(messageText) { + var _a2 = ts2.flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || [], _6 = _a2[0], suggestion = _a2[1]; + return suggestion; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + codefix2.registerCodeFix({ + errorCodes: [ + ts2.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code, + ts2.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code + ], + getCodeActions: function getCodeActionsToFixModuleAndTarget(context2) { + var compilerOptions = context2.program.getCompilerOptions(); + var configFile = compilerOptions.configFile; + if (configFile === void 0) { + return void 0; + } + var codeFixes = []; + var moduleKind = ts2.getEmitModuleKind(compilerOptions); + var moduleOutOfRange = moduleKind >= ts2.ModuleKind.ES2015 && moduleKind < ts2.ModuleKind.ESNext; + if (moduleOutOfRange) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changes2) { + codefix2.setJsonCompilerOptionValue(changes2, configFile, "module", ts2.factory.createStringLiteral("esnext")); + }); + codeFixes.push(codefix2.createCodeFixActionWithoutFixAll("fixModuleOption", changes, [ts2.Diagnostics.Set_the_module_option_in_your_configuration_file_to_0, "esnext"])); + } + var target = ts2.getEmitScriptTarget(compilerOptions); + var targetOutOfRange = target < 4 || target > 99; + if (targetOutOfRange) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(tracker) { + var configObject = ts2.getTsConfigObjectLiteralExpression(configFile); + if (!configObject) + return; + var options = [["target", ts2.factory.createStringLiteral("es2017")]]; + if (moduleKind === ts2.ModuleKind.CommonJS) { + options.push(["module", ts2.factory.createStringLiteral("commonjs")]); + } + codefix2.setJsonCompilerOptionValues(tracker, configFile, options); + }); + codeFixes.push(codefix2.createCodeFixActionWithoutFixAll("fixTargetOption", changes, [ts2.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0, "es2017"])); + } + return codeFixes.length ? codeFixes : void 0; + } + }); + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixPropertyAssignment"; + var errorCodes = [ + ts2.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var property2 = getProperty(sourceFile, span.start); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, property2); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Change_0_to_1, "=", ":"], fixId, [ts2.Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, diag.file, getProperty(diag.file, diag.start)); + }); + } + }); + function doChange(changes, sourceFile, node) { + changes.replaceNode(sourceFile, node, ts2.factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); + } + function getProperty(sourceFile, pos) { + return ts2.cast(ts2.getTokenAtPosition(sourceFile, pos).parent, ts2.isShorthandPropertyAssignment); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "extendsInterfaceBecomesImplements"; + var errorCodes = [ts2.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var nodes = getNodes(sourceFile, context2.span.start); + if (!nodes) + return void 0; + var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChanges(t8, sourceFile, extendsToken, heritageClauses); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Change_extends_to_implements, fixId, ts2.Diagnostics.Change_all_extended_interfaces_to_implements)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (nodes) + doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses); + }); + } + }); + function getNodes(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var heritageClauses = ts2.getContainingClass(token).heritageClauses; + var extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 94 ? { extendsToken, heritageClauses } : void 0; + } + function doChanges(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, ts2.factory.createToken( + 117 + /* SyntaxKind.ImplementsKeyword */ + )); + if (heritageClauses.length === 2 && heritageClauses[0].token === 94 && heritageClauses[1].token === 117) { + var implementsToken = heritageClauses[1].getFirstToken(); + var implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts2.factory.createToken( + 27 + /* SyntaxKind.CommaToken */ + )); + var text = sourceFile.text; + var end = implementsToken.end; + while (end < text.length && ts2.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end }); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "forgottenThisPropertyAccess"; + var didYouMeanStaticMemberCode = ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; + var errorCodes = [ + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + ts2.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, + didYouMeanStaticMemberCode + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var info2 = getInfo(sourceFile, context2.span.start, context2.errorCode); + if (!info2) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Add_0_to_unresolved_variable, info2.className || "this"], fixId, ts2.Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start, diag.code); + if (info2) + doChange(changes, context2.sourceFile, info2); + }); + } + }); + function getInfo(sourceFile, pos, diagCode) { + var node = ts2.getTokenAtPosition(sourceFile, pos); + if (ts2.isIdentifier(node) || ts2.isPrivateIdentifier(node)) { + return { node, className: diagCode === didYouMeanStaticMemberCode ? ts2.getContainingClass(node).name.text : void 0 }; + } + } + function doChange(changes, sourceFile, _a2) { + var node = _a2.node, className = _a2.className; + ts2.suppressLeadingAndTrailingTrivia(node); + changes.replaceNode(sourceFile, node, ts2.factory.createPropertyAccessExpression(className ? ts2.factory.createIdentifier(className) : ts2.factory.createThis(), node)); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixIdExpression = "fixInvalidJsxCharacters_expression"; + var fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; + var errorCodes = [ + ts2.Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, + ts2.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixIdExpression, fixIdHtmlEntity], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, preferences = context2.preferences, span = context2.span; + var changeToExpression = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange( + t8, + preferences, + sourceFile, + span.start, + /* useHtmlEntity */ + false + ); + }); + var changeToHtmlEntity = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange( + t8, + preferences, + sourceFile, + span.start, + /* useHtmlEntity */ + true + ); + }); + return [ + codefix2.createCodeFixAction(fixIdExpression, changeToExpression, ts2.Diagnostics.Wrap_invalid_character_in_an_expression_container, fixIdExpression, ts2.Diagnostics.Wrap_all_invalid_characters_in_an_expression_container), + codefix2.createCodeFixAction(fixIdHtmlEntity, changeToHtmlEntity, ts2.Diagnostics.Convert_invalid_character_to_its_html_entity_code, fixIdHtmlEntity, ts2.Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code) + ]; + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diagnostic) { + return doChange(changes, context2.preferences, diagnostic.file, diagnostic.start, context2.fixId === fixIdHtmlEntity); + }); + } + }); + var htmlEntity = { + ">": ">", + "}": "}" + }; + function isValidCharacter(character) { + return ts2.hasProperty(htmlEntity, character); + } + function doChange(changes, preferences, sourceFile, start, useHtmlEntity) { + var character = sourceFile.getText()[start]; + if (!isValidCharacter(character)) { + return; + } + var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts2.quote(sourceFile, preferences, character), "}"); + changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var deleteUnmatchedParameter = "deleteUnmatchedParameter"; + var renameUnmatchedParameter = "renameUnmatchedParameter"; + var errorCodes = [ + ts2.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code + ]; + codefix2.registerCodeFix({ + fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], + errorCodes, + getCodeActions: function getCodeActionsToFixUnmatchedParameter(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var actions = []; + var info2 = getInfo(sourceFile, span.start); + if (info2) { + ts2.append(actions, getDeleteAction(context2, info2)); + ts2.append(actions, getRenameAction(context2, info2)); + return actions; + } + return void 0; + }, + getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context2) { + var tagsToSignature = new ts2.Map(); + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, function(changes) { + codefix2.eachDiagnostic(context2, errorCodes, function(_a2) { + var file = _a2.file, start = _a2.start; + var info2 = getInfo(file, start); + if (info2) { + tagsToSignature.set(info2.signature, ts2.append(tagsToSignature.get(info2.signature), info2.jsDocParameterTag)); + } + }); + tagsToSignature.forEach(function(tags6, signature) { + if (context2.fixId === deleteUnmatchedParameter) { + var tagsSet_1 = new ts2.Set(tags6); + changes.filterJSDocTags(signature.getSourceFile(), signature, function(t8) { + return !tagsSet_1.has(t8); + }); + } + }); + })); + } + }); + function getDeleteAction(context2, _a2) { + var name2 = _a2.name, signature = _a2.signature, jsDocParameterTag = _a2.jsDocParameterTag; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changeTracker) { + return changeTracker.filterJSDocTags(context2.sourceFile, signature, function(t8) { + return t8 !== jsDocParameterTag; + }); + }); + return codefix2.createCodeFixAction(deleteUnmatchedParameter, changes, [ts2.Diagnostics.Delete_unused_param_tag_0, name2.getText(context2.sourceFile)], deleteUnmatchedParameter, ts2.Diagnostics.Delete_all_unused_param_tags); + } + function getRenameAction(context2, _a2) { + var name2 = _a2.name, signature = _a2.signature, jsDocParameterTag = _a2.jsDocParameterTag; + if (!ts2.length(signature.parameters)) + return void 0; + var sourceFile = context2.sourceFile; + var tags6 = ts2.getJSDocTags(signature); + var names = new ts2.Set(); + for (var _i = 0, tags_2 = tags6; _i < tags_2.length; _i++) { + var tag = tags_2[_i]; + if (ts2.isJSDocParameterTag(tag) && ts2.isIdentifier(tag.name)) { + names.add(tag.name.escapedText); + } + } + var parameterName = ts2.firstDefined(signature.parameters, function(p7) { + return ts2.isIdentifier(p7.name) && !names.has(p7.name.escapedText) ? p7.name.getText(sourceFile) : void 0; + }); + if (parameterName === void 0) + return void 0; + var newJSDocParameterTag = ts2.factory.updateJSDocParameterTag(jsDocParameterTag, jsDocParameterTag.tagName, ts2.factory.createIdentifier(parameterName), jsDocParameterTag.isBracketed, jsDocParameterTag.typeExpression, jsDocParameterTag.isNameFirst, jsDocParameterTag.comment); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changeTracker) { + return changeTracker.replaceJSDocComment(sourceFile, signature, ts2.map(tags6, function(t8) { + return t8 === jsDocParameterTag ? newJSDocParameterTag : t8; + })); + }); + return codefix2.createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [ts2.Diagnostics.Rename_param_tag_name_0_to_1, name2.getText(sourceFile), parameterName]); + } + function getInfo(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (token.parent && ts2.isJSDocParameterTag(token.parent) && ts2.isIdentifier(token.parent.name)) { + var jsDocParameterTag = token.parent; + var signature = ts2.getHostSignatureFromJSDoc(jsDocParameterTag); + if (signature) { + return { signature, name: token.parent.name, jsDocParameterTag }; + } + } + return void 0; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixUnreferenceableDecoratorMetadata"; + var errorCodes = [ts2.Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var importDeclaration = getImportDeclaration(context2.sourceFile, context2.program, context2.span.start); + if (!importDeclaration) + return; + var namespaceChanges = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return importDeclaration.kind === 273 && doNamespaceImportChange(t8, context2.sourceFile, importDeclaration, context2.program); + }); + var typeOnlyChanges = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doTypeOnlyImportChange(t8, context2.sourceFile, importDeclaration, context2.program); + }); + var actions; + if (namespaceChanges.length) { + actions = ts2.append(actions, codefix2.createCodeFixActionWithoutFixAll(fixId, namespaceChanges, ts2.Diagnostics.Convert_named_imports_to_namespace_import)); + } + if (typeOnlyChanges.length) { + actions = ts2.append(actions, codefix2.createCodeFixActionWithoutFixAll(fixId, typeOnlyChanges, ts2.Diagnostics.Convert_to_type_only_import)); + } + return actions; + }, + fixIds: [fixId] + }); + function getImportDeclaration(sourceFile, program, start) { + var identifier = ts2.tryCast(ts2.getTokenAtPosition(sourceFile, start), ts2.isIdentifier); + if (!identifier || identifier.parent.kind !== 180) + return; + var checker = program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(identifier); + return ts2.find((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) || ts2.emptyArray, ts2.or(ts2.isImportClause, ts2.isImportSpecifier, ts2.isImportEqualsDeclaration)); + } + function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) { + if (importDeclaration.kind === 268) { + changes.insertModifierBefore(sourceFile, 154, importDeclaration.name); + return; + } + var importClause = importDeclaration.kind === 270 ? importDeclaration : importDeclaration.parent.parent; + if (importClause.name && importClause.namedBindings) { + return; + } + var checker = program.getTypeChecker(); + var importsValue = !!ts2.forEachImportClauseDeclaration(importClause, function(decl) { + if (ts2.skipAlias(decl.symbol, checker).flags & 111551) + return true; + }); + if (importsValue) { + return; + } + changes.insertModifierBefore(sourceFile, 154, importClause); + } + function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) { + ts2.refactor.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "unusedIdentifier"; + var fixIdPrefix = "unusedIdentifier_prefix"; + var fixIdDelete = "unusedIdentifier_delete"; + var fixIdDeleteImports = "unusedIdentifier_deleteImports"; + var fixIdInfer = "unusedIdentifier_infer"; + var errorCodes = [ + ts2.Diagnostics._0_is_declared_but_its_value_is_never_read.code, + ts2.Diagnostics._0_is_declared_but_never_used.code, + ts2.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ts2.Diagnostics.All_imports_in_import_declaration_are_unused.code, + ts2.Diagnostics.All_destructured_elements_are_unused.code, + ts2.Diagnostics.All_variables_are_unused.code, + ts2.Diagnostics.All_type_parameters_are_unused.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var errorCode = context2.errorCode, sourceFile = context2.sourceFile, program = context2.program, cancellationToken = context2.cancellationToken; + var checker = program.getTypeChecker(); + var sourceFiles = program.getSourceFiles(); + var token = ts2.getTokenAtPosition(sourceFile, context2.span.start); + if (ts2.isJSDocTemplateTag(token)) { + return [createDeleteFix(ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.delete(sourceFile, token); + }), ts2.Diagnostics.Remove_template_tag)]; + } + if (token.kind === 29) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return deleteTypeParameters(t8, sourceFile, token); + }); + return [createDeleteFix(changes, ts2.Diagnostics.Remove_type_parameters)]; + } + var importDecl = tryGetFullImport(token); + if (importDecl) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.delete(sourceFile, importDecl); + }); + return [codefix2.createCodeFixAction(fixName, changes, [ts2.Diagnostics.Remove_import_from_0, ts2.showModuleSpecifier(importDecl)], fixIdDeleteImports, ts2.Diagnostics.Delete_all_unused_imports)]; + } else if (isImport(token)) { + var deletion = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return tryDeleteDeclaration( + sourceFile, + token, + t8, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + false + ); + }); + if (deletion.length) { + return [codefix2.createCodeFixAction(fixName, deletion, [ts2.Diagnostics.Remove_unused_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDeleteImports, ts2.Diagnostics.Delete_all_unused_imports)]; + } + } + if (ts2.isObjectBindingPattern(token.parent) || ts2.isArrayBindingPattern(token.parent)) { + if (ts2.isParameter(token.parent.parent)) { + var elements = token.parent.elements; + var diagnostic = [ + elements.length > 1 ? ts2.Diagnostics.Remove_unused_declarations_for_Colon_0 : ts2.Diagnostics.Remove_unused_declaration_for_Colon_0, + ts2.map(elements, function(e10) { + return e10.getText(sourceFile); + }).join(", ") + ]; + return [ + createDeleteFix(ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return deleteDestructuringElements(t8, sourceFile, token.parent); + }), diagnostic) + ]; + } + return [ + createDeleteFix(ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.delete(sourceFile, token.parent.parent); + }), ts2.Diagnostics.Remove_unused_destructuring_declaration) + ]; + } + if (canDeleteEntireVariableStatement(sourceFile, token)) { + return [ + createDeleteFix(ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return deleteEntireVariableStatement(t8, sourceFile, token.parent); + }), ts2.Diagnostics.Remove_variable_statement) + ]; + } + var result2 = []; + if (token.kind === 138) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return changeInferToUnknown(t8, sourceFile, token); + }); + var name2 = ts2.cast(token.parent, ts2.isInferTypeNode).typeParameter.name.text; + result2.push(codefix2.createCodeFixAction(fixName, changes, [ts2.Diagnostics.Replace_infer_0_with_unknown, name2], fixIdInfer, ts2.Diagnostics.Replace_all_unused_infer_with_unknown)); + } else { + var deletion = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return tryDeleteDeclaration( + sourceFile, + token, + t8, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + false + ); + }); + if (deletion.length) { + var name2 = ts2.isComputedPropertyName(token.parent) ? token.parent : token; + result2.push(createDeleteFix(deletion, [ts2.Diagnostics.Remove_unused_declaration_for_Colon_0, name2.getText(sourceFile)])); + } + } + var prefix = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return tryPrefixDeclaration(t8, errorCode, sourceFile, token); + }); + if (prefix.length) { + result2.push(codefix2.createCodeFixAction(fixName, prefix, [ts2.Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, ts2.Diagnostics.Prefix_all_unused_declarations_with_where_possible)); + } + return result2; + }, + fixIds: [fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer], + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, cancellationToken = context2.cancellationToken; + var checker = program.getTypeChecker(); + var sourceFiles = program.getSourceFiles(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var token = ts2.getTokenAtPosition(sourceFile, diag.start); + switch (context2.fixId) { + case fixIdPrefix: + tryPrefixDeclaration(changes, diag.code, sourceFile, token); + break; + case fixIdDeleteImports: { + var importDecl = tryGetFullImport(token); + if (importDecl) { + changes.delete(sourceFile, importDecl); + } else if (isImport(token)) { + tryDeleteDeclaration( + sourceFile, + token, + changes, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + true + ); + } + break; + } + case fixIdDelete: { + if (token.kind === 138 || isImport(token)) { + break; + } else if (ts2.isJSDocTemplateTag(token)) { + changes.delete(sourceFile, token); + } else if (token.kind === 29) { + deleteTypeParameters(changes, sourceFile, token); + } else if (ts2.isObjectBindingPattern(token.parent)) { + if (token.parent.parent.initializer) { + break; + } else if (!ts2.isParameter(token.parent.parent) || isNotProvidedArguments(token.parent.parent, checker, sourceFiles)) { + changes.delete(sourceFile, token.parent.parent); + } + } else if (ts2.isArrayBindingPattern(token.parent.parent) && token.parent.parent.parent.initializer) { + break; + } else if (canDeleteEntireVariableStatement(sourceFile, token)) { + deleteEntireVariableStatement(changes, sourceFile, token.parent); + } else { + tryDeleteDeclaration( + sourceFile, + token, + changes, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + true + ); + } + break; + } + case fixIdInfer: + if (token.kind === 138) { + changeInferToUnknown(changes, sourceFile, token); + } + break; + default: + ts2.Debug.fail(JSON.stringify(context2.fixId)); + } + }); + } + }); + function changeInferToUnknown(changes, sourceFile, token) { + changes.replaceNode(sourceFile, token.parent, ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + )); + } + function createDeleteFix(changes, diag) { + return codefix2.createCodeFixAction(fixName, changes, diag, fixIdDelete, ts2.Diagnostics.Delete_all_unused_declarations); + } + function deleteTypeParameters(changes, sourceFile, token) { + changes.delete(sourceFile, ts2.Debug.checkDefined(ts2.cast(token.parent, ts2.isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist")); + } + function isImport(token) { + return token.kind === 100 || token.kind === 79 && (token.parent.kind === 273 || token.parent.kind === 270); + } + function tryGetFullImport(token) { + return token.kind === 100 ? ts2.tryCast(token.parent, ts2.isImportDeclaration) : void 0; + } + function canDeleteEntireVariableStatement(sourceFile, token) { + return ts2.isVariableDeclarationList(token.parent) && ts2.first(token.parent.getChildren(sourceFile)) === token; + } + function deleteEntireVariableStatement(changes, sourceFile, node) { + changes.delete(sourceFile, node.parent.kind === 240 ? node.parent : node); + } + function deleteDestructuringElements(changes, sourceFile, node) { + ts2.forEach(node.elements, function(n7) { + return changes.delete(sourceFile, n7); + }); + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + if (errorCode === ts2.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) + return; + if (token.kind === 138) { + token = ts2.cast(token.parent, ts2.isInferTypeNode).typeParameter.name; + } + if (ts2.isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, ts2.factory.createIdentifier("_".concat(token.text))); + if (ts2.isParameter(token.parent)) { + ts2.getJSDocParameterTags(token.parent).forEach(function(tag) { + if (ts2.isIdentifier(tag.name)) { + changes.replaceNode(sourceFile, tag.name, ts2.factory.createIdentifier("_".concat(tag.name.text))); + } + }); + } + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 166: + case 165: + return true; + case 257: { + var varDecl = token.parent; + switch (varDecl.parent.parent.kind) { + case 247: + case 246: + return true; + } + } + } + return false; + } + function tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, isFixAll) { + tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll); + if (ts2.isIdentifier(token)) { + ts2.FindAllReferences.Core.eachSymbolReferenceInFile(token, checker, sourceFile, function(ref) { + if (ts2.isPropertyAccessExpression(ref.parent) && ref.parent.name === ref) + ref = ref.parent; + if (!isFixAll && mayDeleteExpression(ref)) { + changes.delete(sourceFile, ref.parent.parent); + } + }); + } + } + function tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll) { + var parent2 = token.parent; + if (ts2.isParameter(parent2)) { + tryDeleteParameter(changes, sourceFile, parent2, checker, sourceFiles, program, cancellationToken, isFixAll); + } else if (!(isFixAll && ts2.isIdentifier(token) && ts2.FindAllReferences.Core.isSymbolReferencedInFile(token, checker, sourceFile))) { + var node = ts2.isImportClause(parent2) ? token : ts2.isComputedPropertyName(parent2) ? parent2.parent : parent2; + ts2.Debug.assert(node !== sourceFile, "should not delete whole source file"); + changes.delete(sourceFile, node); + } + } + function tryDeleteParameter(changes, sourceFile, parameter, checker, sourceFiles, program, cancellationToken, isFixAll) { + if (isFixAll === void 0) { + isFixAll = false; + } + if (mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll)) { + if (parameter.modifiers && parameter.modifiers.length > 0 && (!ts2.isIdentifier(parameter.name) || ts2.FindAllReferences.Core.isSymbolReferencedInFile(parameter.name, checker, sourceFile))) { + for (var _i = 0, _a2 = parameter.modifiers; _i < _a2.length; _i++) { + var modifier = _a2[_i]; + if (ts2.isModifier(modifier)) { + changes.deleteModifier(sourceFile, modifier); + } + } + } else if (!parameter.initializer && isNotProvidedArguments(parameter, checker, sourceFiles)) { + changes.delete(sourceFile, parameter); + } + } + } + function isNotProvidedArguments(parameter, checker, sourceFiles) { + var index4 = parameter.parent.parameters.indexOf(parameter); + return !ts2.FindAllReferences.Core.someSignatureUsage(parameter.parent, sourceFiles, checker, function(_6, call) { + return !call || call.arguments.length > index4; + }); + } + function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { + var parent2 = parameter.parent; + switch (parent2.kind) { + case 171: + case 173: + var index4 = parent2.parameters.indexOf(parameter); + var referent = ts2.isMethodDeclaration(parent2) ? parent2.name : parent2; + var entries = ts2.FindAllReferences.Core.getReferencedSymbolsForNode(parent2.pos, referent, program, sourceFiles, cancellationToken); + if (entries) { + for (var _i = 0, entries_2 = entries; _i < entries_2.length; _i++) { + var entry = entries_2[_i]; + for (var _a2 = 0, _b = entry.references; _a2 < _b.length; _a2++) { + var reference = _b[_a2]; + if (reference.kind === 1) { + var isSuperCall_1 = ts2.isSuperKeyword(reference.node) && ts2.isCallExpression(reference.node.parent) && reference.node.parent.arguments.length > index4; + var isSuperMethodCall = ts2.isPropertyAccessExpression(reference.node.parent) && ts2.isSuperKeyword(reference.node.parent.expression) && ts2.isCallExpression(reference.node.parent.parent) && reference.node.parent.parent.arguments.length > index4; + var isOverriddenMethod = (ts2.isMethodDeclaration(reference.node.parent) || ts2.isMethodSignature(reference.node.parent)) && reference.node.parent !== parameter.parent && reference.node.parent.parameters.length > index4; + if (isSuperCall_1 || isSuperMethodCall || isOverriddenMethod) + return false; + } + } + } + } + return true; + case 259: { + if (parent2.name && isCallbackLike(checker, sourceFile, parent2.name)) { + return isLastParameter(parent2, parameter, isFixAll); + } + return true; + } + case 215: + case 216: + return isLastParameter(parent2, parameter, isFixAll); + case 175: + return false; + case 174: + return true; + default: + return ts2.Debug.failBadSyntaxKind(parent2); + } + } + function isCallbackLike(checker, sourceFile, name2) { + return !!ts2.FindAllReferences.Core.eachSymbolReferenceInFile(name2, checker, sourceFile, function(reference) { + return ts2.isIdentifier(reference) && ts2.isCallExpression(reference.parent) && reference.parent.arguments.indexOf(reference) >= 0; + }); + } + function isLastParameter(func, parameter, isFixAll) { + var parameters = func.parameters; + var index4 = parameters.indexOf(parameter); + ts2.Debug.assert(index4 !== -1, "The parameter should already be in the list"); + return isFixAll ? parameters.slice(index4 + 1).every(function(p7) { + return ts2.isIdentifier(p7.name) && !p7.symbol.isReferenced; + }) : index4 === parameters.length - 1; + } + function mayDeleteExpression(node) { + return (ts2.isBinaryExpression(node.parent) && node.parent.left === node || (ts2.isPostfixUnaryExpression(node.parent) || ts2.isPrefixUnaryExpression(node.parent)) && node.parent.operand === node) && ts2.isExpressionStatement(node.parent.parent); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixUnreachableCode"; + var errorCodes = [ts2.Diagnostics.Unreachable_code_detected.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var syntacticDiagnostics = context2.program.getSyntacticDiagnostics(context2.sourceFile, context2.cancellationToken); + if (syntacticDiagnostics.length) + return; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, context2.span.start, context2.span.length, context2.errorCode); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Remove_unreachable_code, fixId, ts2.Diagnostics.Remove_all_unreachable_code)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, diag.file, diag.start, diag.length, diag.code); + }); + } + }); + function doChange(changes, sourceFile, start, length, errorCode) { + var token = ts2.getTokenAtPosition(sourceFile, start); + var statement = ts2.findAncestor(token, ts2.isStatement); + if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { + var logData = JSON.stringify({ + statementKind: ts2.Debug.formatSyntaxKind(statement.kind), + tokenKind: ts2.Debug.formatSyntaxKind(token.kind), + errorCode, + start, + length + }); + ts2.Debug.fail("Token and statement should start at the same point. " + logData); + } + var container = (ts2.isBlock(statement.parent) ? statement.parent : statement).parent; + if (!ts2.isBlock(statement.parent) || statement === ts2.first(statement.parent.statements)) { + switch (container.kind) { + case 242: + if (container.elseStatement) { + if (ts2.isBlock(statement.parent)) { + break; + } else { + changes.replaceNode(sourceFile, statement, ts2.factory.createBlock(ts2.emptyArray)); + } + return; + } + case 244: + case 245: + changes.delete(sourceFile, container); + return; + } + } + if (ts2.isBlock(statement.parent)) { + var end_3 = start + length; + var lastStatement = ts2.Debug.checkDefined(lastWhere(ts2.sliceAfter(statement.parent.statements, statement), function(s7) { + return s7.pos < end_3; + }), "Some statement should be last"); + changes.deleteNodeRange(sourceFile, statement, lastStatement); + } else { + changes.delete(sourceFile, statement); + } + } + function lastWhere(a7, pred) { + var last2; + for (var _i = 0, a_1 = a7; _i < a_1.length; _i++) { + var value2 = a_1[_i]; + if (!pred(value2)) + break; + last2 = value2; + } + return last2; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixUnusedLabel"; + var errorCodes = [ts2.Diagnostics.Unused_label.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, context2.span.start); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Remove_unused_label, fixId, ts2.Diagnostics.Remove_all_unused_labels)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, diag.file, diag.start); + }); + } + }); + function doChange(changes, sourceFile, start) { + var token = ts2.getTokenAtPosition(sourceFile, start); + var labeledStatement = ts2.cast(token.parent, ts2.isLabeledStatement); + var pos = token.getStart(sourceFile); + var statementPos = labeledStatement.statement.getStart(sourceFile); + var end = ts2.positionsAreOnSameLine(pos, statementPos, sourceFile) ? statementPos : ts2.skipTrivia( + sourceFile.text, + ts2.findChildOfKind(labeledStatement, 58, sourceFile).end, + /*stopAfterLineBreak*/ + true + ); + changes.deleteRange(sourceFile, { pos, end }); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixIdPlain = "fixJSDocTypes_plain"; + var fixIdNullable = "fixJSDocTypes_nullable"; + var errorCodes = [ts2.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var checker = context2.program.getTypeChecker(); + var info2 = getInfo(sourceFile, context2.span.start, checker); + if (!info2) + return void 0; + var typeNode = info2.typeNode, type3 = info2.type; + var original = typeNode.getText(sourceFile); + var actions = [fix(type3, fixIdPlain, ts2.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; + if (typeNode.kind === 317) { + actions.push(fix(checker.getNullableType( + type3, + 32768 + /* TypeFlags.Undefined */ + ), fixIdNullable, ts2.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); + } + return actions; + function fix(type4, fixId, fixAllDescription) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, typeNode, type4, checker); + }); + return codefix2.createCodeFixAction("jdocTypes", changes, [ts2.Diagnostics.Change_0_to_1, original, checker.typeToString(type4)], fixId, fixAllDescription); + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions: function(context2) { + var fixId = context2.fixId, program = context2.program, sourceFile = context2.sourceFile; + var checker = program.getTypeChecker(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, err) { + var info2 = getInfo(err.file, err.start, checker); + if (!info2) + return; + var typeNode = info2.typeNode, type3 = info2.type; + var fixedType = typeNode.kind === 317 && fixId === fixIdNullable ? checker.getNullableType( + type3, + 32768 + /* TypeFlags.Undefined */ + ) : type3; + doChange(changes, sourceFile, typeNode, fixedType, checker); + }); + } + }); + function doChange(changes, sourceFile, oldTypeNode, newType, checker) { + changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( + newType, + /*enclosingDeclaration*/ + oldTypeNode, + /*flags*/ + void 0 + )); + } + function getInfo(sourceFile, pos, checker) { + var decl = ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, pos), isTypeContainer); + var typeNode = decl && decl.type; + return typeNode && { typeNode, type: checker.getTypeFromTypeNode(typeNode) }; + } + function isTypeContainer(node) { + switch (node.kind) { + case 231: + case 176: + case 177: + case 259: + case 174: + case 178: + case 197: + case 171: + case 170: + case 166: + case 169: + case 168: + case 175: + case 262: + case 213: + case 257: + return true; + default: + return false; + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixMissingCallParentheses"; + var errorCodes = [ + ts2.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var callName = getCallName(sourceFile, span.start); + if (!callName) + return; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, callName); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_missing_call_parentheses, fixId, ts2.Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var callName = getCallName(diag.file, diag.start); + if (callName) + doChange(changes, diag.file, callName); + }); + } + }); + function doChange(changes, sourceFile, name2) { + changes.replaceNodeWithText(sourceFile, name2, "".concat(name2.text, "()")); + } + function getCallName(sourceFile, start) { + var token = ts2.getTokenAtPosition(sourceFile, start); + if (ts2.isPropertyAccessExpression(token.parent)) { + var current = token.parent; + while (ts2.isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (ts2.isIdentifier(token)) { + return token; + } + return void 0; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixAwaitInSyncFunction"; + var errorCodes = [ + ts2.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + ts2.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + ts2.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, nodes); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_async_modifier_to_containing_function, fixId, ts2.Diagnostics.Add_all_missing_async_modifiers)]; + }, + fixIds: [fixId], + getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context2) { + var seen = new ts2.Map(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes || !ts2.addToSeen(seen, ts2.getNodeId(nodes.insertBefore))) + return; + doChange(changes, context2.sourceFile, nodes); + }); + } + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (ts2.isVariableDeclaration(expr.parent) && expr.parent.type && ts2.isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes(sourceFile, start) { + var token = ts2.getTokenAtPosition(sourceFile, start); + var containingFunction = ts2.getContainingFunction(token); + if (!containingFunction) { + return; + } + var insertBefore; + switch (containingFunction.kind) { + case 171: + insertBefore = containingFunction.name; + break; + case 259: + case 215: + insertBefore = ts2.findChildOfKind(containingFunction, 98, sourceFile); + break; + case 216: + var kind = containingFunction.typeParameters ? 29 : 20; + insertBefore = ts2.findChildOfKind(containingFunction, kind, sourceFile) || ts2.first(containingFunction.parameters); + break; + default: + return; + } + return insertBefore && { + insertBefore, + returnType: getReturnType(containingFunction) + }; + } + function doChange(changes, sourceFile, _a2) { + var insertBefore = _a2.insertBefore, returnType = _a2.returnType; + if (returnType) { + var entityName = ts2.getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 79 || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, ts2.factory.createTypeReferenceNode("Promise", ts2.factory.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 132, insertBefore); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ + ts2.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code, + ts2.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code + ]; + var fixId = "fixPropertyOverrideAccessor"; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var edits = doChange(context2.sourceFile, context2.span.start, context2.span.length, context2.errorCode, context2); + if (edits) { + return [codefix2.createCodeFixAction(fixId, edits, ts2.Diagnostics.Generate_get_and_set_accessors, fixId, ts2.Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var edits = doChange(diag.file, diag.start, diag.length, diag.code, context2); + if (edits) { + for (var _i = 0, edits_2 = edits; _i < edits_2.length; _i++) { + var edit = edits_2[_i]; + changes.pushRaw(context2.sourceFile, edit); + } + } + }); + } + }); + function doChange(file, start, length, code, context2) { + var startPosition; + var endPosition; + if (code === ts2.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { + startPosition = start; + endPosition = start + length; + } else if (code === ts2.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) { + var checker = context2.program.getTypeChecker(); + var node = ts2.getTokenAtPosition(file, start).parent; + ts2.Debug.assert(ts2.isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor"); + var containingClass = node.parent; + ts2.Debug.assert(ts2.isClassLike(containingClass), "erroneous accessors should only be inside classes"); + var base = ts2.singleOrUndefined(codefix2.getAllSupers(containingClass, checker)); + if (!base) + return []; + var name2 = ts2.unescapeLeadingUnderscores(ts2.getTextOfPropertyName(node.name)); + var baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name2); + if (!baseProp || !baseProp.valueDeclaration) + return []; + startPosition = baseProp.valueDeclaration.pos; + endPosition = baseProp.valueDeclaration.end; + file = ts2.getSourceFileOfNode(baseProp.valueDeclaration); + } else { + ts2.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); + } + return codefix2.generateAccessorFromProperty(file, context2.program, startPosition, endPosition, context2, ts2.Diagnostics.Generate_get_and_set_accessors.message); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "inferFromUsage"; + var errorCodes = [ + // Variable declarations + ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + // Variable uses + ts2.Diagnostics.Variable_0_implicitly_has_an_1_type.code, + // Parameter declarations + ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + // Get Accessor declarations + ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + ts2.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + // Set Accessor declarations + ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + // Property declarations + ts2.Diagnostics.Member_0_implicitly_has_an_1_type.code, + //// Suggestions + // Variable declarations + ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code, + // Variable uses + ts2.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + // Parameter declarations + ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code, + // Get Accessor declarations + ts2.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code, + ts2.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code, + // Set Accessor declarations + ts2.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code, + // Property declarations + ts2.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + // Function expressions and declarations + ts2.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, start = context2.span.start, errorCode = context2.errorCode, cancellationToken = context2.cancellationToken, host = context2.host, preferences = context2.preferences; + var token = ts2.getTokenAtPosition(sourceFile, start); + var declaration; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(changes2) { + declaration = doChange( + changes2, + sourceFile, + token, + errorCode, + program, + cancellationToken, + /*markSeen*/ + ts2.returnTrue, + host, + preferences + ); + }); + var name2 = declaration && ts2.getNameOfDeclaration(declaration); + return !name2 || changes.length === 0 ? void 0 : [codefix2.createCodeFixAction(fixId, changes, [getDiagnostic(errorCode, token), ts2.getTextOfNode(name2)], fixId, ts2.Diagnostics.Infer_all_types_from_usage)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var sourceFile = context2.sourceFile, program = context2.program, cancellationToken = context2.cancellationToken, host = context2.host, preferences = context2.preferences; + var markSeen = ts2.nodeSeenTracker(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, err) { + doChange(changes, sourceFile, ts2.getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + }); + } + }); + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + case ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.isSetAccessorDeclaration(ts2.getContainingFunction(token)) ? ts2.Diagnostics.Infer_type_of_0_from_usage : ts2.Diagnostics.Infer_parameter_types_from_usage; + case ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + case ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Infer_parameter_types_from_usage; + case ts2.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: + return ts2.Diagnostics.Infer_this_type_of_0_from_usage; + default: + return ts2.Diagnostics.Infer_type_of_0_from_usage; + } + } + function mapSuggestionDiagnostic(errorCode) { + switch (errorCode) { + case ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code; + case ts2.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Variable_0_implicitly_has_an_1_type.code; + case ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type.code; + case ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code; + case ts2.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code; + case ts2.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code; + case ts2.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code; + case ts2.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return ts2.Diagnostics.Member_0_implicitly_has_an_1_type.code; + } + return errorCode; + } + function doChange(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + if (!ts2.isParameterPropertyModifier(token.kind) && token.kind !== 79 && token.kind !== 25 && token.kind !== 108) { + return void 0; + } + var parent2 = token.parent; + var importAdder = codefix2.createImportAdder(sourceFile, program, preferences, host); + errorCode = mapSuggestionDiagnostic(errorCode); + switch (errorCode) { + case ts2.Diagnostics.Member_0_implicitly_has_an_1_type.code: + case ts2.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + if (ts2.isVariableDeclaration(parent2) && markSeen(parent2) || ts2.isPropertyDeclaration(parent2) || ts2.isPropertySignature(parent2)) { + annotateVariableDeclaration(changes, importAdder, sourceFile, parent2, program, host, cancellationToken); + importAdder.writeFixes(changes); + return parent2; + } + if (ts2.isPropertyAccessExpression(parent2)) { + var type3 = inferTypeForVariableFromUsage(parent2.name, program, cancellationToken); + var typeNode = ts2.getTypeNodeIfAccessible(type3, parent2, program, host); + if (typeNode) { + var typeTag = ts2.factory.createJSDocTypeTag( + /*tagName*/ + void 0, + ts2.factory.createJSDocTypeExpression(typeNode), + /*comment*/ + void 0 + ); + changes.addJSDocTags(sourceFile, ts2.cast(parent2.parent.parent, ts2.isExpressionStatement), [typeTag]); + } + importAdder.writeFixes(changes); + return parent2; + } + return void 0; + case ts2.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + var symbol = program.getTypeChecker().getSymbolAtLocation(token); + if (symbol && symbol.valueDeclaration && ts2.isVariableDeclaration(symbol.valueDeclaration) && markSeen(symbol.valueDeclaration)) { + annotateVariableDeclaration(changes, importAdder, ts2.getSourceFileOfNode(symbol.valueDeclaration), symbol.valueDeclaration, program, host, cancellationToken); + importAdder.writeFixes(changes); + return symbol.valueDeclaration; + } + return void 0; + } + } + var containingFunction = ts2.getContainingFunction(token); + if (containingFunction === void 0) { + return void 0; + } + var declaration; + switch (errorCode) { + case ts2.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (ts2.isSetAccessorDeclaration(containingFunction)) { + annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + break; + } + case ts2.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + if (markSeen(containingFunction)) { + var param = ts2.cast(parent2, ts2.isParameter); + annotateParameters(changes, importAdder, sourceFile, param, containingFunction, program, host, cancellationToken); + declaration = param; + } + break; + case ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case ts2.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + if (ts2.isGetAccessorDeclaration(containingFunction) && ts2.isIdentifier(containingFunction.name)) { + annotate(changes, importAdder, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program, host); + declaration = containingFunction; + } + break; + case ts2.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + if (ts2.isSetAccessorDeclaration(containingFunction)) { + annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + } + break; + case ts2.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: + if (ts2.textChanges.isThisTypeAnnotatable(containingFunction) && markSeen(containingFunction)) { + annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + } + break; + default: + return ts2.Debug.fail(String(errorCode)); + } + importAdder.writeFixes(changes); + return declaration; + } + function annotateVariableDeclaration(changes, importAdder, sourceFile, declaration, program, host, cancellationToken) { + if (ts2.isIdentifier(declaration.name)) { + annotate(changes, importAdder, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program, host); + } + } + function annotateParameters(changes, importAdder, sourceFile, parameterDeclaration, containingFunction, program, host, cancellationToken) { + if (!ts2.isIdentifier(parameterDeclaration.name)) { + return; + } + var parameterInferences = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken); + ts2.Debug.assert(containingFunction.parameters.length === parameterInferences.length, "Parameter count and inference count should match"); + if (ts2.isInJSFile(containingFunction)) { + annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host); + } else { + var needParens = ts2.isArrowFunction(containingFunction) && !ts2.findChildOfKind(containingFunction, 20, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, ts2.first(containingFunction.parameters), ts2.factory.createToken( + 20 + /* SyntaxKind.OpenParenToken */ + )); + for (var _i = 0, parameterInferences_1 = parameterInferences; _i < parameterInferences_1.length; _i++) { + var _a2 = parameterInferences_1[_i], declaration = _a2.declaration, type3 = _a2.type; + if (declaration && !declaration.type && !declaration.initializer) { + annotate(changes, importAdder, sourceFile, declaration, type3, program, host); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, ts2.last(containingFunction.parameters), ts2.factory.createToken( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + } + function annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken) { + var references = getFunctionReferences(containingFunction, sourceFile, program, cancellationToken); + if (!references || !references.length) { + return; + } + var thisInference = inferTypeFromReferences(program, references, cancellationToken).thisParameter(); + var typeNode = ts2.getTypeNodeIfAccessible(thisInference, containingFunction, program, host); + if (!typeNode) { + return; + } + if (ts2.isInJSFile(containingFunction)) { + annotateJSDocThis(changes, sourceFile, containingFunction, typeNode); + } else { + changes.tryInsertThisTypeAnnotation(sourceFile, containingFunction, typeNode); + } + } + function annotateJSDocThis(changes, sourceFile, containingFunction, typeNode) { + changes.addJSDocTags(sourceFile, containingFunction, [ + ts2.factory.createJSDocThisTag( + /*tagName*/ + void 0, + ts2.factory.createJSDocTypeExpression(typeNode) + ) + ]); + } + function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken) { + var param = ts2.firstOrUndefined(setAccessorDeclaration.parameters); + if (param && ts2.isIdentifier(setAccessorDeclaration.name) && ts2.isIdentifier(param.name)) { + var type3 = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken); + if (type3 === program.getTypeChecker().getAnyType()) { + type3 = inferTypeForVariableFromUsage(param.name, program, cancellationToken); + } + if (ts2.isInJSFile(setAccessorDeclaration)) { + annotateJSDocParameters(changes, sourceFile, [{ declaration: param, type: type3 }], program, host); + } else { + annotate(changes, importAdder, sourceFile, param, type3, program, host); + } + } + } + function annotate(changes, importAdder, sourceFile, declaration, type3, program, host) { + var typeNode = ts2.getTypeNodeIfAccessible(type3, declaration, program, host); + if (typeNode) { + if (ts2.isInJSFile(sourceFile) && declaration.kind !== 168) { + var parent2 = ts2.isVariableDeclaration(declaration) ? ts2.tryCast(declaration.parent.parent, ts2.isVariableStatement) : declaration; + if (!parent2) { + return; + } + var typeExpression = ts2.factory.createJSDocTypeExpression(typeNode); + var typeTag = ts2.isGetAccessorDeclaration(declaration) ? ts2.factory.createJSDocReturnTag( + /*tagName*/ + void 0, + typeExpression, + /*comment*/ + void 0 + ) : ts2.factory.createJSDocTypeTag( + /*tagName*/ + void 0, + typeExpression, + /*comment*/ + void 0 + ); + changes.addJSDocTags(sourceFile, parent2, [typeTag]); + } else if (!tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, ts2.getEmitScriptTarget(program.getCompilerOptions()))) { + changes.tryInsertTypeAnnotation(sourceFile, declaration, typeNode); + } + } + } + function tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget) { + var importableReference = codefix2.tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference && changes.tryInsertTypeAnnotation(sourceFile, declaration, importableReference.typeNode)) { + ts2.forEach(importableReference.symbols, function(s7) { + return importAdder.addImportFromExportedSymbol( + s7, + /*usageIsTypeOnly*/ + true + ); + }); + return true; + } + return false; + } + function annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host) { + var signature = parameterInferences.length && parameterInferences[0].declaration.parent; + if (!signature) { + return; + } + var inferences = ts2.mapDefined(parameterInferences, function(inference) { + var param = inference.declaration; + if (param.initializer || ts2.getJSDocType(param) || !ts2.isIdentifier(param.name)) { + return; + } + var typeNode = inference.type && ts2.getTypeNodeIfAccessible(inference.type, param, program, host); + if (typeNode) { + var name2 = ts2.factory.cloneNode(param.name); + ts2.setEmitFlags( + name2, + 1536 | 2048 + /* EmitFlags.NoNestedComments */ + ); + return { name: ts2.factory.cloneNode(param.name), param, isOptional: !!inference.isOptional, typeNode }; + } + }); + if (!inferences.length) { + return; + } + if (ts2.isArrowFunction(signature) || ts2.isFunctionExpression(signature)) { + var needParens = ts2.isArrowFunction(signature) && !ts2.findChildOfKind(signature, 20, sourceFile); + if (needParens) { + changes.insertNodeBefore(sourceFile, ts2.first(signature.parameters), ts2.factory.createToken( + 20 + /* SyntaxKind.OpenParenToken */ + )); + } + ts2.forEach(inferences, function(_a2) { + var typeNode = _a2.typeNode, param = _a2.param; + var typeTag = ts2.factory.createJSDocTypeTag( + /*tagName*/ + void 0, + ts2.factory.createJSDocTypeExpression(typeNode) + ); + var jsDoc = ts2.factory.createJSDocComment( + /*comment*/ + void 0, + [typeTag] + ); + changes.insertNodeAt(sourceFile, param.getStart(sourceFile), jsDoc, { suffix: " " }); + }); + if (needParens) { + changes.insertNodeAfter(sourceFile, ts2.last(signature.parameters), ts2.factory.createToken( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + } else { + var paramTags = ts2.map(inferences, function(_a2) { + var name2 = _a2.name, typeNode = _a2.typeNode, isOptional2 = _a2.isOptional; + return ts2.factory.createJSDocParameterTag( + /*tagName*/ + void 0, + name2, + /*isBracketed*/ + !!isOptional2, + ts2.factory.createJSDocTypeExpression(typeNode), + /* isNameFirst */ + false, + /*comment*/ + void 0 + ); + }); + changes.addJSDocTags(sourceFile, signature, paramTags); + } + } + function getReferences(token, program, cancellationToken) { + return ts2.mapDefined(ts2.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function(entry) { + return entry.kind !== 0 ? ts2.tryCast(entry.node, ts2.isIdentifier) : void 0; + }); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + var references = getReferences(token, program, cancellationToken); + return inferTypeFromReferences(program, references, cancellationToken).single(); + } + function inferTypeForParametersFromUsage(func, sourceFile, program, cancellationToken) { + var references = getFunctionReferences(func, sourceFile, program, cancellationToken); + return references && inferTypeFromReferences(program, references, cancellationToken).parameters(func) || func.parameters.map(function(p7) { + return { + declaration: p7, + type: ts2.isIdentifier(p7.name) ? inferTypeForVariableFromUsage(p7.name, program, cancellationToken) : program.getTypeChecker().getAnyType() + }; + }); + } + function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { + var searchToken; + switch (containingFunction.kind) { + case 173: + searchToken = ts2.findChildOfKind(containingFunction, 135, sourceFile); + break; + case 216: + case 215: + var parent2 = containingFunction.parent; + searchToken = (ts2.isVariableDeclaration(parent2) || ts2.isPropertyDeclaration(parent2)) && ts2.isIdentifier(parent2.name) ? parent2.name : containingFunction.name; + break; + case 259: + case 171: + case 170: + searchToken = containingFunction.name; + break; + } + if (!searchToken) { + return void 0; + } + return getReferences(searchToken, program, cancellationToken); + } + function inferTypeFromReferences(program, references, cancellationToken) { + var checker = program.getTypeChecker(); + var builtinConstructors = { + string: function() { + return checker.getStringType(); + }, + number: function() { + return checker.getNumberType(); + }, + Array: function(t8) { + return checker.createArrayType(t8); + }, + Promise: function(t8) { + return checker.createPromiseType(t8); + } + }; + var builtins = [ + checker.getStringType(), + checker.getNumberType(), + checker.createArrayType(checker.getAnyType()), + checker.createPromiseType(checker.getAnyType()) + ]; + return { + single, + parameters, + thisParameter + }; + function createEmptyUsage() { + return { + isNumber: void 0, + isString: void 0, + isNumberOrString: void 0, + candidateTypes: void 0, + properties: void 0, + calls: void 0, + constructs: void 0, + numberIndex: void 0, + stringIndex: void 0, + candidateThisTypes: void 0, + inferredTypes: void 0 + }; + } + function combineUsages(usages) { + var combinedProperties = new ts2.Map(); + for (var _i = 0, usages_1 = usages; _i < usages_1.length; _i++) { + var u7 = usages_1[_i]; + if (u7.properties) { + u7.properties.forEach(function(p7, name2) { + if (!combinedProperties.has(name2)) { + combinedProperties.set(name2, []); + } + combinedProperties.get(name2).push(p7); + }); + } + } + var properties = new ts2.Map(); + combinedProperties.forEach(function(ps, name2) { + properties.set(name2, combineUsages(ps)); + }); + return { + isNumber: usages.some(function(u8) { + return u8.isNumber; + }), + isString: usages.some(function(u8) { + return u8.isString; + }), + isNumberOrString: usages.some(function(u8) { + return u8.isNumberOrString; + }), + candidateTypes: ts2.flatMap(usages, function(u8) { + return u8.candidateTypes; + }), + properties, + calls: ts2.flatMap(usages, function(u8) { + return u8.calls; + }), + constructs: ts2.flatMap(usages, function(u8) { + return u8.constructs; + }), + numberIndex: ts2.forEach(usages, function(u8) { + return u8.numberIndex; + }), + stringIndex: ts2.forEach(usages, function(u8) { + return u8.stringIndex; + }), + candidateThisTypes: ts2.flatMap(usages, function(u8) { + return u8.candidateThisTypes; + }), + inferredTypes: void 0 + // clear type cache + }; + } + function single() { + return combineTypes(inferTypesFromReferencesSingle(references)); + } + function parameters(declaration) { + if (references.length === 0 || !declaration.parameters) { + return void 0; + } + var usage = createEmptyUsage(); + for (var _i = 0, references_3 = references; _i < references_3.length; _i++) { + var reference = references_3[_i]; + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + var calls = __spreadArray9(__spreadArray9([], usage.constructs || [], true), usage.calls || [], true); + return declaration.parameters.map(function(parameter, parameterIndex) { + var types3 = []; + var isRest = ts2.isRestParameter(parameter); + var isOptional2 = false; + for (var _i2 = 0, calls_1 = calls; _i2 < calls_1.length; _i2++) { + var call = calls_1[_i2]; + if (call.argumentTypes.length <= parameterIndex) { + isOptional2 = ts2.isInJSFile(declaration); + types3.push(checker.getUndefinedType()); + } else if (isRest) { + for (var i7 = parameterIndex; i7 < call.argumentTypes.length; i7++) { + types3.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[i7])); + } + } else { + types3.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[parameterIndex])); + } + } + if (ts2.isIdentifier(parameter.name)) { + var inferred = inferTypesFromReferencesSingle(getReferences(parameter.name, program, cancellationToken)); + types3.push.apply(types3, isRest ? ts2.mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred); + } + var type3 = combineTypes(types3); + return { + type: isRest ? checker.createArrayType(type3) : type3, + isOptional: isOptional2 && !isRest, + declaration: parameter + }; + }); + } + function thisParameter() { + var usage = createEmptyUsage(); + for (var _i = 0, references_4 = references; _i < references_4.length; _i++) { + var reference = references_4[_i]; + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + return combineTypes(usage.candidateThisTypes || ts2.emptyArray); + } + function inferTypesFromReferencesSingle(references2) { + var usage = createEmptyUsage(); + for (var _i = 0, references_5 = references2; _i < references_5.length; _i++) { + var reference = references_5[_i]; + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + return inferTypes(usage); + } + function calculateUsageOfNode(node, usage) { + while (ts2.isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + switch (node.parent.kind) { + case 241: + inferTypeFromExpressionStatement(node, usage); + break; + case 222: + usage.isNumber = true; + break; + case 221: + inferTypeFromPrefixUnaryExpression(node.parent, usage); + break; + case 223: + inferTypeFromBinaryExpression(node, node.parent, usage); + break; + case 292: + case 293: + inferTypeFromSwitchStatementLabel(node.parent, usage); + break; + case 210: + case 211: + if (node.parent.expression === node) { + inferTypeFromCallExpression(node.parent, usage); + } else { + inferTypeFromContextualType(node, usage); + } + break; + case 208: + inferTypeFromPropertyAccessExpression(node.parent, usage); + break; + case 209: + inferTypeFromPropertyElementExpression(node.parent, node, usage); + break; + case 299: + case 300: + inferTypeFromPropertyAssignment(node.parent, usage); + break; + case 169: + inferTypeFromPropertyDeclaration(node.parent, usage); + break; + case 257: { + var _a2 = node.parent, name2 = _a2.name, initializer = _a2.initializer; + if (node === name2) { + if (initializer) { + addCandidateType(usage, checker.getTypeAtLocation(initializer)); + } + break; + } + } + default: + return inferTypeFromContextualType(node, usage); + } + } + function inferTypeFromContextualType(node, usage) { + if (ts2.isExpressionNode(node)) { + addCandidateType(usage, checker.getContextualType(node)); + } + } + function inferTypeFromExpressionStatement(node, usage) { + addCandidateType(usage, ts2.isCallExpression(node) ? checker.getVoidType() : checker.getAnyType()); + } + function inferTypeFromPrefixUnaryExpression(node, usage) { + switch (node.operator) { + case 45: + case 46: + case 40: + case 54: + usage.isNumber = true; + break; + case 39: + usage.isNumberOrString = true; + break; + } + } + function inferTypeFromBinaryExpression(node, parent2, usage) { + switch (parent2.operatorToken.kind) { + case 42: + case 41: + case 43: + case 44: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 65: + case 67: + case 66: + case 68: + case 69: + case 73: + case 74: + case 78: + case 70: + case 72: + case 71: + case 40: + case 29: + case 32: + case 31: + case 33: + var operandType = checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left); + if (operandType.flags & 1056) { + addCandidateType(usage, operandType); + } else { + usage.isNumber = true; + } + break; + case 64: + case 39: + var otherOperandType = checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left); + if (otherOperandType.flags & 1056) { + addCandidateType(usage, otherOperandType); + } else if (otherOperandType.flags & 296) { + usage.isNumber = true; + } else if (otherOperandType.flags & 402653316) { + usage.isString = true; + } else if (otherOperandType.flags & 1) { + } else { + usage.isNumberOrString = true; + } + break; + case 63: + case 34: + case 36: + case 37: + case 35: + addCandidateType(usage, checker.getTypeAtLocation(parent2.left === node ? parent2.right : parent2.left)); + break; + case 101: + if (node === parent2.left) { + usage.isString = true; + } + break; + case 56: + case 60: + if (node === parent2.left && (node.parent.parent.kind === 257 || ts2.isAssignmentExpression( + node.parent.parent, + /*excludeCompoundAssignment*/ + true + ))) { + addCandidateType(usage, checker.getTypeAtLocation(parent2.right)); + } + break; + case 55: + case 27: + case 102: + break; + } + } + function inferTypeFromSwitchStatementLabel(parent2, usage) { + addCandidateType(usage, checker.getTypeAtLocation(parent2.parent.parent.expression)); + } + function inferTypeFromCallExpression(parent2, usage) { + var call = { + argumentTypes: [], + return_: createEmptyUsage() + }; + if (parent2.arguments) { + for (var _i = 0, _a2 = parent2.arguments; _i < _a2.length; _i++) { + var argument = _a2[_i]; + call.argumentTypes.push(checker.getTypeAtLocation(argument)); + } + } + calculateUsageOfNode(parent2, call.return_); + if (parent2.kind === 210) { + (usage.calls || (usage.calls = [])).push(call); + } else { + (usage.constructs || (usage.constructs = [])).push(call); + } + } + function inferTypeFromPropertyAccessExpression(parent2, usage) { + var name2 = ts2.escapeLeadingUnderscores(parent2.name.text); + if (!usage.properties) { + usage.properties = new ts2.Map(); + } + var propertyUsage = usage.properties.get(name2) || createEmptyUsage(); + calculateUsageOfNode(parent2, propertyUsage); + usage.properties.set(name2, propertyUsage); + } + function inferTypeFromPropertyElementExpression(parent2, node, usage) { + if (node === parent2.argumentExpression) { + usage.isNumberOrString = true; + return; + } else { + var indexType = checker.getTypeAtLocation(parent2.argumentExpression); + var indexUsage = createEmptyUsage(); + calculateUsageOfNode(parent2, indexUsage); + if (indexType.flags & 296) { + usage.numberIndex = indexUsage; + } else { + usage.stringIndex = indexUsage; + } + } + } + function inferTypeFromPropertyAssignment(assignment, usage) { + var nodeWithRealType = ts2.isVariableDeclaration(assignment.parent.parent) ? assignment.parent.parent : assignment.parent; + addCandidateThisType(usage, checker.getTypeAtLocation(nodeWithRealType)); + } + function inferTypeFromPropertyDeclaration(declaration, usage) { + addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent)); + } + function removeLowPriorityInferences(inferences, priorities) { + var toRemove = []; + for (var _i = 0, inferences_1 = inferences; _i < inferences_1.length; _i++) { + var i7 = inferences_1[_i]; + for (var _a2 = 0, priorities_1 = priorities; _a2 < priorities_1.length; _a2++) { + var _b = priorities_1[_a2], high = _b.high, low = _b.low; + if (high(i7)) { + ts2.Debug.assert(!low(i7), "Priority can't have both low and high"); + toRemove.push(low); + } + } + } + return inferences.filter(function(i8) { + return toRemove.every(function(f8) { + return !f8(i8); + }); + }); + } + function combineFromUsage(usage) { + return combineTypes(inferTypes(usage)); + } + function combineTypes(inferences) { + if (!inferences.length) + return checker.getAnyType(); + var stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + var priorities = [ + { + high: function(t8) { + return t8 === checker.getStringType() || t8 === checker.getNumberType(); + }, + low: function(t8) { + return t8 === stringNumber; + } + }, + { + high: function(t8) { + return !(t8.flags & (1 | 16384)); + }, + low: function(t8) { + return !!(t8.flags & (1 | 16384)); + } + }, + { + high: function(t8) { + return !(t8.flags & (98304 | 1 | 16384)) && !(ts2.getObjectFlags(t8) & 16); + }, + low: function(t8) { + return !!(ts2.getObjectFlags(t8) & 16); + } + } + ]; + var good = removeLowPriorityInferences(inferences, priorities); + var anons = good.filter(function(i7) { + return ts2.getObjectFlags(i7) & 16; + }); + if (anons.length) { + good = good.filter(function(i7) { + return !(ts2.getObjectFlags(i7) & 16); + }); + good.push(combineAnonymousTypes(anons)); + } + return checker.getWidenedType(checker.getUnionType( + good.map(checker.getBaseTypeOfLiteralType), + 2 + /* UnionReduction.Subtype */ + )); + } + function combineAnonymousTypes(anons) { + if (anons.length === 1) { + return anons[0]; + } + var calls = []; + var constructs = []; + var stringIndices = []; + var numberIndices = []; + var stringIndexReadonly = false; + var numberIndexReadonly = false; + var props = ts2.createMultiMap(); + for (var _i = 0, anons_1 = anons; _i < anons_1.length; _i++) { + var anon = anons_1[_i]; + for (var _a2 = 0, _b = checker.getPropertiesOfType(anon); _a2 < _b.length; _a2++) { + var p7 = _b[_a2]; + props.add(p7.name, p7.valueDeclaration ? checker.getTypeOfSymbolAtLocation(p7, p7.valueDeclaration) : checker.getAnyType()); + } + calls.push.apply(calls, checker.getSignaturesOfType( + anon, + 0 + /* SignatureKind.Call */ + )); + constructs.push.apply(constructs, checker.getSignaturesOfType( + anon, + 1 + /* SignatureKind.Construct */ + )); + var stringIndexInfo = checker.getIndexInfoOfType( + anon, + 0 + /* IndexKind.String */ + ); + if (stringIndexInfo) { + stringIndices.push(stringIndexInfo.type); + stringIndexReadonly = stringIndexReadonly || stringIndexInfo.isReadonly; + } + var numberIndexInfo = checker.getIndexInfoOfType( + anon, + 1 + /* IndexKind.Number */ + ); + if (numberIndexInfo) { + numberIndices.push(numberIndexInfo.type); + numberIndexReadonly = numberIndexReadonly || numberIndexInfo.isReadonly; + } + } + var members = ts2.mapEntries(props, function(name2, types3) { + var isOptional2 = types3.length < anons.length ? 16777216 : 0; + var s7 = checker.createSymbol(4 | isOptional2, name2); + s7.type = checker.getUnionType(types3); + return [name2, s7]; + }); + var indexInfos = []; + if (stringIndices.length) + indexInfos.push(checker.createIndexInfo(checker.getStringType(), checker.getUnionType(stringIndices), stringIndexReadonly)); + if (numberIndices.length) + indexInfos.push(checker.createIndexInfo(checker.getNumberType(), checker.getUnionType(numberIndices), numberIndexReadonly)); + return checker.createAnonymousType(anons[0].symbol, members, calls, constructs, indexInfos); + } + function inferTypes(usage) { + var _a2, _b, _c; + var types3 = []; + if (usage.isNumber) { + types3.push(checker.getNumberType()); + } + if (usage.isString) { + types3.push(checker.getStringType()); + } + if (usage.isNumberOrString) { + types3.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } + if (usage.numberIndex) { + types3.push(checker.createArrayType(combineFromUsage(usage.numberIndex))); + } + if (((_a2 = usage.properties) === null || _a2 === void 0 ? void 0 : _a2.size) || ((_b = usage.constructs) === null || _b === void 0 ? void 0 : _b.length) || usage.stringIndex) { + types3.push(inferStructuralType(usage)); + } + var candidateTypes = (usage.candidateTypes || []).map(function(t8) { + return checker.getBaseTypeOfLiteralType(t8); + }); + var callsType = ((_c = usage.calls) === null || _c === void 0 ? void 0 : _c.length) ? inferStructuralType(usage) : void 0; + if (callsType && candidateTypes) { + types3.push(checker.getUnionType( + __spreadArray9([callsType], candidateTypes, true), + 2 + /* UnionReduction.Subtype */ + )); + } else { + if (callsType) { + types3.push(callsType); + } + if (ts2.length(candidateTypes)) { + types3.push.apply(types3, candidateTypes); + } + } + types3.push.apply(types3, inferNamedTypesFromProperties(usage)); + return types3; + } + function inferStructuralType(usage) { + var members = new ts2.Map(); + if (usage.properties) { + usage.properties.forEach(function(u7, name2) { + var symbol = checker.createSymbol(4, name2); + symbol.type = combineFromUsage(u7); + members.set(name2, symbol); + }); + } + var callSignatures = usage.calls ? [getSignatureFromCalls(usage.calls)] : []; + var constructSignatures = usage.constructs ? [getSignatureFromCalls(usage.constructs)] : []; + var indexInfos = usage.stringIndex ? [checker.createIndexInfo( + checker.getStringType(), + combineFromUsage(usage.stringIndex), + /*isReadonly*/ + false + )] : []; + return checker.createAnonymousType( + /*symbol*/ + void 0, + members, + callSignatures, + constructSignatures, + indexInfos + ); + } + function inferNamedTypesFromProperties(usage) { + if (!usage.properties || !usage.properties.size) + return []; + var types3 = builtins.filter(function(t8) { + return allPropertiesAreAssignableToUsage(t8, usage); + }); + if (0 < types3.length && types3.length < 3) { + return types3.map(function(t8) { + return inferInstantiationFromUsage(t8, usage); + }); + } + return []; + } + function allPropertiesAreAssignableToUsage(type3, usage) { + if (!usage.properties) + return false; + return !ts2.forEachEntry(usage.properties, function(propUsage, name2) { + var source = checker.getTypeOfPropertyOfType(type3, name2); + if (!source) { + return true; + } + if (propUsage.calls) { + var sigs = checker.getSignaturesOfType( + source, + 0 + /* SignatureKind.Call */ + ); + return !sigs.length || !checker.isTypeAssignableTo(source, getFunctionFromCalls(propUsage.calls)); + } else { + return !checker.isTypeAssignableTo(source, combineFromUsage(propUsage)); + } + }); + } + function inferInstantiationFromUsage(type3, usage) { + if (!(ts2.getObjectFlags(type3) & 4) || !usage.properties) { + return type3; + } + var generic = type3.target; + var singleTypeParameter = ts2.singleOrUndefined(generic.typeParameters); + if (!singleTypeParameter) + return type3; + var types3 = []; + usage.properties.forEach(function(propUsage, name2) { + var genericPropertyType = checker.getTypeOfPropertyOfType(generic, name2); + ts2.Debug.assert(!!genericPropertyType, "generic should have all the properties of its reference."); + types3.push.apply(types3, inferTypeParameters(genericPropertyType, combineFromUsage(propUsage), singleTypeParameter)); + }); + return builtinConstructors[type3.symbol.escapedName](combineTypes(types3)); + } + function inferTypeParameters(genericType, usageType, typeParameter) { + if (genericType === typeParameter) { + return [usageType]; + } else if (genericType.flags & 3145728) { + return ts2.flatMap(genericType.types, function(t8) { + return inferTypeParameters(t8, usageType, typeParameter); + }); + } else if (ts2.getObjectFlags(genericType) & 4 && ts2.getObjectFlags(usageType) & 4) { + var genericArgs = checker.getTypeArguments(genericType); + var usageArgs = checker.getTypeArguments(usageType); + var types3 = []; + if (genericArgs && usageArgs) { + for (var i7 = 0; i7 < genericArgs.length; i7++) { + if (usageArgs[i7]) { + types3.push.apply(types3, inferTypeParameters(genericArgs[i7], usageArgs[i7], typeParameter)); + } + } + } + return types3; + } + var genericSigs = checker.getSignaturesOfType( + genericType, + 0 + /* SignatureKind.Call */ + ); + var usageSigs = checker.getSignaturesOfType( + usageType, + 0 + /* SignatureKind.Call */ + ); + if (genericSigs.length === 1 && usageSigs.length === 1) { + return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); + } + return []; + } + function inferFromSignatures(genericSig, usageSig, typeParameter) { + var types3 = []; + for (var i7 = 0; i7 < genericSig.parameters.length; i7++) { + var genericParam = genericSig.parameters[i7]; + var usageParam = usageSig.parameters[i7]; + var isRest = genericSig.declaration && ts2.isRestParameter(genericSig.declaration.parameters[i7]); + if (!usageParam) { + break; + } + var genericParamType = genericParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(genericParam, genericParam.valueDeclaration) : checker.getAnyType(); + var elementType = isRest && checker.getElementTypeOfArrayType(genericParamType); + if (elementType) { + genericParamType = elementType; + } + var targetType = usageParam.type || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType()); + types3.push.apply(types3, inferTypeParameters(genericParamType, targetType, typeParameter)); + } + var genericReturn = checker.getReturnTypeOfSignature(genericSig); + var usageReturn = checker.getReturnTypeOfSignature(usageSig); + types3.push.apply(types3, inferTypeParameters(genericReturn, usageReturn, typeParameter)); + return types3; + } + function getFunctionFromCalls(calls) { + return checker.createAnonymousType( + /*symbol*/ + void 0, + ts2.createSymbolTable(), + [getSignatureFromCalls(calls)], + ts2.emptyArray, + ts2.emptyArray + ); + } + function getSignatureFromCalls(calls) { + var parameters2 = []; + var length = Math.max.apply(Math, calls.map(function(c7) { + return c7.argumentTypes.length; + })); + var _loop_14 = function(i8) { + var symbol = checker.createSymbol(1, ts2.escapeLeadingUnderscores("arg".concat(i8))); + symbol.type = combineTypes(calls.map(function(call) { + return call.argumentTypes[i8] || checker.getUndefinedType(); + })); + if (calls.some(function(call) { + return call.argumentTypes[i8] === void 0; + })) { + symbol.flags |= 16777216; + } + parameters2.push(symbol); + }; + for (var i7 = 0; i7 < length; i7++) { + _loop_14(i7); + } + var returnType = combineFromUsage(combineUsages(calls.map(function(call) { + return call.return_; + }))); + return checker.createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + parameters2, + returnType, + /*typePredicate*/ + void 0, + length, + 0 + /* SignatureFlags.None */ + ); + } + function addCandidateType(usage, type3) { + if (type3 && !(type3.flags & 1) && !(type3.flags & 131072)) { + (usage.candidateTypes || (usage.candidateTypes = [])).push(type3); + } + } + function addCandidateThisType(usage, type3) { + if (type3 && !(type3.flags & 1) && !(type3.flags & 131072)) { + (usage.candidateThisTypes || (usage.candidateThisTypes = [])).push(type3); + } + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixReturnTypeInAsyncFunction"; + var errorCodes = [ + ts2.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context2) { + var sourceFile = context2.sourceFile, program = context2.program, span = context2.span; + var checker = program.getTypeChecker(); + var info2 = getInfo(sourceFile, program.getTypeChecker(), span.start); + if (!info2) { + return void 0; + } + var returnTypeNode = info2.returnTypeNode, returnType = info2.returnType, promisedTypeNode = info2.promisedTypeNode, promisedType = info2.promisedType; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, returnTypeNode, promisedTypeNode); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ + ts2.Diagnostics.Replace_0_with_Promise_1, + checker.typeToString(returnType), + checker.typeToString(promisedType) + ], fixId, ts2.Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions)]; + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, context2.program.getTypeChecker(), diag.start); + if (info2) { + doChange(changes, diag.file, info2.returnTypeNode, info2.promisedTypeNode); + } + }); + } + }); + function getInfo(sourceFile, checker, pos) { + if (ts2.isInJSFile(sourceFile)) { + return void 0; + } + var token = ts2.getTokenAtPosition(sourceFile, pos); + var func = ts2.findAncestor(token, ts2.isFunctionLikeDeclaration); + var returnTypeNode = func === null || func === void 0 ? void 0 : func.type; + if (!returnTypeNode) { + return void 0; + } + var returnType = checker.getTypeFromTypeNode(returnTypeNode); + var promisedType = checker.getAwaitedType(returnType) || checker.getVoidType(); + var promisedTypeNode = checker.typeToTypeNode( + promisedType, + /*enclosingDeclaration*/ + returnTypeNode, + /*flags*/ + void 0 + ); + if (promisedTypeNode) { + return { returnTypeNode, returnType, promisedTypeNode, promisedType }; + } + } + function doChange(changes, sourceFile, returnTypeNode, promisedTypeNode) { + changes.replaceNode(sourceFile, returnTypeNode, ts2.factory.createTypeReferenceNode("Promise", [promisedTypeNode])); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "disableJsDiagnostics"; + var fixId = "disableJsDiagnostics"; + var errorCodes = ts2.mapDefined(Object.keys(ts2.Diagnostics), function(key) { + var diag = ts2.Diagnostics[key]; + return diag.category === ts2.DiagnosticCategory.Error ? diag.code : void 0; + }); + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToDisableJsDiagnostics(context2) { + var sourceFile = context2.sourceFile, program = context2.program, span = context2.span, host = context2.host, formatContext = context2.formatContext; + if (!ts2.isInJSFile(sourceFile) || !ts2.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return void 0; + } + var newLineCharacter = sourceFile.checkJsDirective ? "" : ts2.getNewLineOrDefaultFromHost(host, formatContext.options); + var fixes = [ + // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. + codefix2.createCodeFixActionWithoutFixAll(fixName, [codefix2.createFileTextChanges(sourceFile.fileName, [ + ts2.createTextChange(sourceFile.checkJsDirective ? ts2.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : ts2.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)) + ])], ts2.Diagnostics.Disable_checking_for_this_file) + ]; + if (ts2.textChanges.isValidLocationToAddComment(sourceFile, span.start)) { + fixes.unshift(codefix2.createCodeFixAction(fixName, ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, sourceFile, span.start); + }), ts2.Diagnostics.Ignore_this_error_message, fixId, ts2.Diagnostics.Add_ts_ignore_to_all_error_messages)); + } + return fixes; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + var seenLines = new ts2.Set(); + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + if (ts2.textChanges.isValidLocationToAddComment(diag.file, diag.start)) { + makeChange(changes, diag.file, diag.start, seenLines); + } + }); + } + }); + function makeChange(changes, sourceFile, position, seenLines) { + var lineNumber = ts2.getLineAndCharacterOfPosition(sourceFile, position).line; + if (!seenLines || ts2.tryAddToSet(seenLines, lineNumber)) { + changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore"); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, sourceFile, context2, preferences, importAdder, addClassElement) { + var classMembers = classDeclaration.symbol.members; + for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { + var symbol = possiblyMissingSymbols_1[_i]; + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol( + symbol, + classDeclaration, + sourceFile, + context2, + preferences, + importAdder, + addClassElement, + /* body */ + void 0 + ); + } + } + } + codefix2.createMissingMemberNodes = createMissingMemberNodes; + function getNoopSymbolTrackerWithResolver(context2) { + return { + trackSymbol: function() { + return false; + }, + moduleResolverHost: ts2.getModuleSpecifierResolverHost(context2.program, context2.host) + }; + } + codefix2.getNoopSymbolTrackerWithResolver = getNoopSymbolTrackerWithResolver; + var PreserveOptionalFlags; + (function(PreserveOptionalFlags2) { + PreserveOptionalFlags2[PreserveOptionalFlags2["Method"] = 1] = "Method"; + PreserveOptionalFlags2[PreserveOptionalFlags2["Property"] = 2] = "Property"; + PreserveOptionalFlags2[PreserveOptionalFlags2["All"] = 3] = "All"; + })(PreserveOptionalFlags = codefix2.PreserveOptionalFlags || (codefix2.PreserveOptionalFlags = {})); + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context2, preferences, importAdder, addClassElement, body, preserveOptional, isAmbient) { + var _a2; + if (preserveOptional === void 0) { + preserveOptional = 3; + } + if (isAmbient === void 0) { + isAmbient = false; + } + var declarations = symbol.getDeclarations(); + var declaration = declarations === null || declarations === void 0 ? void 0 : declarations[0]; + var checker = context2.program.getTypeChecker(); + var scriptTarget = ts2.getEmitScriptTarget(context2.program.getCompilerOptions()); + var kind = (_a2 = declaration === null || declaration === void 0 ? void 0 : declaration.kind) !== null && _a2 !== void 0 ? _a2 : 168; + var declarationName = ts2.getSynthesizedDeepClone( + ts2.getNameOfDeclaration(declaration), + /*includeTrivia*/ + false + ); + var effectiveModifierFlags = declaration ? ts2.getEffectiveModifierFlags(declaration) : 0; + var modifierFlags = effectiveModifierFlags & 4 ? 4 : effectiveModifierFlags & 16 ? 16 : 0; + if (declaration && ts2.isAutoAccessorPropertyDeclaration(declaration)) { + modifierFlags |= 128; + } + var modifiers = modifierFlags ? ts2.factory.createNodeArray(ts2.factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; + var type3 = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + var optional = !!(symbol.flags & 16777216); + var ambient = !!(enclosingDeclaration.flags & 16777216) || isAmbient; + var quotePreference = ts2.getQuotePreference(sourceFile, preferences); + switch (kind) { + case 168: + case 169: + var flags = quotePreference === 0 ? 268435456 : void 0; + var typeNode = checker.typeToTypeNode(type3, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context2)); + if (importAdder) { + var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference) { + typeNode = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + addClassElement(ts2.factory.createPropertyDeclaration( + modifiers, + declaration ? createName(declarationName) : symbol.getName(), + optional && preserveOptional & 2 ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + typeNode, + /*initializer*/ + void 0 + )); + break; + case 174: + case 175: { + ts2.Debug.assertIsDefined(declarations); + var typeNode_1 = checker.typeToTypeNode( + type3, + enclosingDeclaration, + /*flags*/ + void 0, + getNoopSymbolTrackerWithResolver(context2) + ); + var allAccessors = ts2.getAllAccessorDeclarations(declarations, declaration); + var orderedAccessors = allAccessors.secondAccessor ? [allAccessors.firstAccessor, allAccessors.secondAccessor] : [allAccessors.firstAccessor]; + if (importAdder) { + var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode_1, scriptTarget); + if (importableReference) { + typeNode_1 = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + for (var _i = 0, orderedAccessors_1 = orderedAccessors; _i < orderedAccessors_1.length; _i++) { + var accessor = orderedAccessors_1[_i]; + if (ts2.isGetAccessorDeclaration(accessor)) { + addClassElement(ts2.factory.createGetAccessorDeclaration(modifiers, createName(declarationName), ts2.emptyArray, createTypeNode(typeNode_1), createBody(body, quotePreference, ambient))); + } else { + ts2.Debug.assertNode(accessor, ts2.isSetAccessorDeclaration, "The counterpart to a getter should be a setter"); + var parameter = ts2.getSetAccessorValueParameter(accessor); + var parameterName = parameter && ts2.isIdentifier(parameter.name) ? ts2.idText(parameter.name) : void 0; + addClassElement(ts2.factory.createSetAccessorDeclaration(modifiers, createName(declarationName), createDummyParameters( + 1, + [parameterName], + [createTypeNode(typeNode_1)], + 1, + /*inJs*/ + false + ), createBody(body, quotePreference, ambient))); + } + } + break; + } + case 170: + case 171: + ts2.Debug.assertIsDefined(declarations); + var signatures = type3.isUnion() ? ts2.flatMap(type3.types, function(t8) { + return t8.getCallSignatures(); + }) : type3.getCallSignatures(); + if (!ts2.some(signatures)) { + break; + } + if (declarations.length === 1) { + ts2.Debug.assert(signatures.length === 1, "One declaration implies one signature"); + var signature = signatures[0]; + outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference, ambient)); + break; + } + for (var _b = 0, signatures_1 = signatures; _b < signatures_1.length; _b++) { + var signature = signatures_1[_b]; + outputMethod(quotePreference, signature, modifiers, createName(declarationName)); + } + if (!ambient) { + if (declarations.length > signatures.length) { + var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference)); + } else { + ts2.Debug.assert(declarations.length === signatures.length, "Declarations and signatures should match count"); + addClassElement(createMethodImplementingSignatures(checker, context2, enclosingDeclaration, signatures, createName(declarationName), optional && !!(preserveOptional & 1), modifiers, quotePreference, body)); + } + } + break; + } + function outputMethod(quotePreference2, signature2, modifiers2, name2, body2) { + var method2 = createSignatureDeclarationFromSignature(171, context2, quotePreference2, signature2, body2, name2, modifiers2, optional && !!(preserveOptional & 1), enclosingDeclaration, importAdder); + if (method2) + addClassElement(method2); + } + function createName(node) { + return ts2.getSynthesizedDeepClone( + node, + /*includeTrivia*/ + false + ); + } + function createBody(block, quotePreference2, ambient2) { + return ambient2 ? void 0 : ts2.getSynthesizedDeepClone( + block, + /*includeTrivia*/ + false + ) || createStubbedMethodBody(quotePreference2); + } + function createTypeNode(typeNode2) { + return ts2.getSynthesizedDeepClone( + typeNode2, + /*includeTrivia*/ + false + ); + } + } + codefix2.addNewNodeForMemberSymbol = addNewNodeForMemberSymbol; + function createSignatureDeclarationFromSignature(kind, context2, quotePreference, signature, body, name2, modifiers, optional, enclosingDeclaration, importAdder) { + var program = context2.program; + var checker = program.getTypeChecker(); + var scriptTarget = ts2.getEmitScriptTarget(program.getCompilerOptions()); + var flags = 1 | 256 | 524288 | (quotePreference === 0 ? 268435456 : 0); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, kind, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context2)); + if (!signatureDeclaration) { + return void 0; + } + var typeParameters = signatureDeclaration.typeParameters; + var parameters = signatureDeclaration.parameters; + var type3 = signatureDeclaration.type; + if (importAdder) { + if (typeParameters) { + var newTypeParameters = ts2.sameMap(typeParameters, function(typeParameterDecl) { + var constraint = typeParameterDecl.constraint; + var defaultType = typeParameterDecl.default; + if (constraint) { + var importableReference2 = tryGetAutoImportableReferenceFromTypeNode(constraint, scriptTarget); + if (importableReference2) { + constraint = importableReference2.typeNode; + importSymbols(importAdder, importableReference2.symbols); + } + } + if (defaultType) { + var importableReference2 = tryGetAutoImportableReferenceFromTypeNode(defaultType, scriptTarget); + if (importableReference2) { + defaultType = importableReference2.typeNode; + importSymbols(importAdder, importableReference2.symbols); + } + } + return ts2.factory.updateTypeParameterDeclaration(typeParameterDecl, typeParameterDecl.modifiers, typeParameterDecl.name, constraint, defaultType); + }); + if (typeParameters !== newTypeParameters) { + typeParameters = ts2.setTextRange(ts2.factory.createNodeArray(newTypeParameters, typeParameters.hasTrailingComma), typeParameters); + } + } + var newParameters = ts2.sameMap(parameters, function(parameterDecl) { + var importableReference2 = tryGetAutoImportableReferenceFromTypeNode(parameterDecl.type, scriptTarget); + var type4 = parameterDecl.type; + if (importableReference2) { + type4 = importableReference2.typeNode; + importSymbols(importAdder, importableReference2.symbols); + } + return ts2.factory.updateParameterDeclaration(parameterDecl, parameterDecl.modifiers, parameterDecl.dotDotDotToken, parameterDecl.name, parameterDecl.questionToken, type4, parameterDecl.initializer); + }); + if (parameters !== newParameters) { + parameters = ts2.setTextRange(ts2.factory.createNodeArray(newParameters, parameters.hasTrailingComma), parameters); + } + if (type3) { + var importableReference = tryGetAutoImportableReferenceFromTypeNode(type3, scriptTarget); + if (importableReference) { + type3 = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + } + var questionToken = optional ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0; + var asteriskToken = signatureDeclaration.asteriskToken; + if (ts2.isFunctionExpression(signatureDeclaration)) { + return ts2.factory.updateFunctionExpression(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, ts2.tryCast(name2, ts2.isIdentifier), typeParameters, parameters, type3, body !== null && body !== void 0 ? body : signatureDeclaration.body); + } + if (ts2.isArrowFunction(signatureDeclaration)) { + return ts2.factory.updateArrowFunction(signatureDeclaration, modifiers, typeParameters, parameters, type3, signatureDeclaration.equalsGreaterThanToken, body !== null && body !== void 0 ? body : signatureDeclaration.body); + } + if (ts2.isMethodDeclaration(signatureDeclaration)) { + return ts2.factory.updateMethodDeclaration(signatureDeclaration, modifiers, asteriskToken, name2 !== null && name2 !== void 0 ? name2 : ts2.factory.createIdentifier(""), questionToken, typeParameters, parameters, type3, body); + } + if (ts2.isFunctionDeclaration(signatureDeclaration)) { + return ts2.factory.updateFunctionDeclaration(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, ts2.tryCast(name2, ts2.isIdentifier), typeParameters, parameters, type3, body !== null && body !== void 0 ? body : signatureDeclaration.body); + } + return void 0; + } + codefix2.createSignatureDeclarationFromSignature = createSignatureDeclarationFromSignature; + function createSignatureDeclarationFromCallExpression(kind, context2, importAdder, call, name2, modifierFlags, contextNode) { + var quotePreference = ts2.getQuotePreference(context2.sourceFile, context2.preferences); + var scriptTarget = ts2.getEmitScriptTarget(context2.program.getCompilerOptions()); + var tracker = getNoopSymbolTrackerWithResolver(context2); + var checker = context2.program.getTypeChecker(); + var isJs = ts2.isInJSFile(contextNode); + var typeArguments = call.typeArguments, args = call.arguments, parent2 = call.parent; + var contextualType = isJs ? void 0 : checker.getContextualType(call); + var names = ts2.map(args, function(arg) { + return ts2.isIdentifier(arg) ? arg.text : ts2.isPropertyAccessExpression(arg) && ts2.isIdentifier(arg.name) ? arg.name.text : void 0; + }); + var instanceTypes = isJs ? [] : ts2.map(args, function(arg) { + return checker.getTypeAtLocation(arg); + }); + var _a2 = getArgumentTypesAndTypeParameters( + checker, + importAdder, + instanceTypes, + contextNode, + scriptTarget, + /*flags*/ + void 0, + tracker + ), argumentTypeNodes = _a2.argumentTypeNodes, argumentTypeParameters = _a2.argumentTypeParameters; + var modifiers = modifierFlags ? ts2.factory.createNodeArray(ts2.factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; + var asteriskToken = ts2.isYieldExpression(parent2) ? ts2.factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ) : void 0; + var typeParameters = isJs ? void 0 : createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments); + var parameters = createDummyParameters( + args.length, + names, + argumentTypeNodes, + /*minArgumentCount*/ + void 0, + isJs + ); + var type3 = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode( + contextualType, + contextNode, + /*flags*/ + void 0, + tracker + ); + switch (kind) { + case 171: + return ts2.factory.createMethodDeclaration( + modifiers, + asteriskToken, + name2, + /*questionToken*/ + void 0, + typeParameters, + parameters, + type3, + createStubbedMethodBody(quotePreference) + ); + case 170: + return ts2.factory.createMethodSignature( + modifiers, + name2, + /*questionToken*/ + void 0, + typeParameters, + parameters, + type3 === void 0 ? ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + ) : type3 + ); + case 259: + return ts2.factory.createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, createStubbedBody(ts2.Diagnostics.Function_not_implemented.message, quotePreference)); + default: + ts2.Debug.fail("Unexpected kind"); + } + } + codefix2.createSignatureDeclarationFromCallExpression = createSignatureDeclarationFromCallExpression; + function createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments) { + var usedNames = new ts2.Set(argumentTypeParameters.map(function(pair) { + return pair[0]; + })); + var constraintsByName = new ts2.Map(argumentTypeParameters); + if (typeArguments) { + var typeArgumentsWithNewTypes = typeArguments.filter(function(typeArgument) { + return !argumentTypeParameters.some(function(pair) { + var _a2; + return checker.getTypeAtLocation(typeArgument) === ((_a2 = pair[1]) === null || _a2 === void 0 ? void 0 : _a2.argumentType); + }); + }); + var targetSize = usedNames.size + typeArgumentsWithNewTypes.length; + for (var i7 = 0; usedNames.size < targetSize; i7 += 1) { + usedNames.add(createTypeParameterName(i7)); + } + } + return ts2.map(ts2.arrayFrom(usedNames.values()), function(usedName) { + var _a2; + return ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + usedName, + (_a2 = constraintsByName.get(usedName)) === null || _a2 === void 0 ? void 0 : _a2.constraint + ); + }); + } + function createTypeParameterName(index4) { + return 84 + index4 <= 90 ? String.fromCharCode(84 + index4) : "T".concat(index4); + } + function typeToAutoImportableTypeNode(checker, importAdder, type3, contextNode, scriptTarget, flags, tracker) { + var typeNode = checker.typeToTypeNode(type3, contextNode, flags, tracker); + if (typeNode && ts2.isImportTypeNode(typeNode)) { + var importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference) { + importSymbols(importAdder, importableReference.symbols); + typeNode = importableReference.typeNode; + } + } + return ts2.getSynthesizedDeepClone(typeNode); + } + codefix2.typeToAutoImportableTypeNode = typeToAutoImportableTypeNode; + function typeContainsTypeParameter(type3) { + if (type3.isUnionOrIntersection()) { + return type3.types.some(typeContainsTypeParameter); + } + return type3.flags & 262144; + } + function getArgumentTypesAndTypeParameters(checker, importAdder, instanceTypes, contextNode, scriptTarget, flags, tracker) { + var argumentTypeNodes = []; + var argumentTypeParameters = new ts2.Map(); + for (var i7 = 0; i7 < instanceTypes.length; i7 += 1) { + var instanceType = instanceTypes[i7]; + if (instanceType.isUnionOrIntersection() && instanceType.types.some(typeContainsTypeParameter)) { + var synthesizedTypeParameterName = createTypeParameterName(i7); + argumentTypeNodes.push(ts2.factory.createTypeReferenceNode(synthesizedTypeParameterName)); + argumentTypeParameters.set(synthesizedTypeParameterName, void 0); + continue; + } + var widenedInstanceType = checker.getBaseTypeOfLiteralType(instanceType); + var argumentTypeNode = typeToAutoImportableTypeNode(checker, importAdder, widenedInstanceType, contextNode, scriptTarget, flags, tracker); + if (!argumentTypeNode) { + continue; + } + argumentTypeNodes.push(argumentTypeNode); + var argumentTypeParameter = getFirstTypeParameterName(instanceType); + var instanceTypeConstraint = instanceType.isTypeParameter() && instanceType.constraint && !isAnonymousObjectConstraintType(instanceType.constraint) ? typeToAutoImportableTypeNode(checker, importAdder, instanceType.constraint, contextNode, scriptTarget, flags, tracker) : void 0; + if (argumentTypeParameter) { + argumentTypeParameters.set(argumentTypeParameter, { argumentType: instanceType, constraint: instanceTypeConstraint }); + } + } + return { argumentTypeNodes, argumentTypeParameters: ts2.arrayFrom(argumentTypeParameters.entries()) }; + } + codefix2.getArgumentTypesAndTypeParameters = getArgumentTypesAndTypeParameters; + function isAnonymousObjectConstraintType(type3) { + return type3.flags & 524288 && type3.objectFlags === 16; + } + function getFirstTypeParameterName(type3) { + var _a2; + if (type3.flags & (1048576 | 2097152)) { + for (var _i = 0, _b = type3.types; _i < _b.length; _i++) { + var subType = _b[_i]; + var subTypeName = getFirstTypeParameterName(subType); + if (subTypeName) { + return subTypeName; + } + } + } + return type3.flags & 262144 ? (_a2 = type3.getSymbol()) === null || _a2 === void 0 ? void 0 : _a2.getName() : void 0; + } + function createDummyParameters(argCount, names, types3, minArgumentCount, inJs) { + var parameters = []; + var parameterNameCounts = new ts2.Map(); + for (var i7 = 0; i7 < argCount; i7++) { + var parameterName = (names === null || names === void 0 ? void 0 : names[i7]) || "arg".concat(i7); + var parameterNameCount = parameterNameCounts.get(parameterName); + parameterNameCounts.set(parameterName, (parameterNameCount || 0) + 1); + var newParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + parameterName + (parameterNameCount || ""), + /*questionToken*/ + minArgumentCount !== void 0 && i7 >= minArgumentCount ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + /*type*/ + inJs ? void 0 : (types3 === null || types3 === void 0 ? void 0 : types3[i7]) || ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + ), + /*initializer*/ + void 0 + ); + parameters.push(newParameter); + } + return parameters; + } + function createMethodImplementingSignatures(checker, context2, enclosingDeclaration, signatures, name2, optional, modifiers, quotePreference, body) { + var maxArgsSignature = signatures[0]; + var minArgumentCount = signatures[0].minArgumentCount; + var someSigHasRestParameter = false; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (ts2.signatureHasRestParameter(sig)) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!ts2.signatureHasRestParameter(sig) || ts2.signatureHasRestParameter(maxArgsSignature))) { + maxArgsSignature = sig; + } + } + var maxNonRestArgs = maxArgsSignature.parameters.length - (ts2.signatureHasRestParameter(maxArgsSignature) ? 1 : 0); + var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function(symbol) { + return symbol.name; + }); + var parameters = createDummyParameters( + maxNonRestArgs, + maxArgsParameterSymbolNames, + /* types */ + void 0, + minArgumentCount, + /*inJs*/ + false + ); + if (someSigHasRestParameter) { + var restParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ), + maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", + /*questionToken*/ + maxNonRestArgs >= minArgumentCount ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + ts2.factory.createArrayTypeNode(ts2.factory.createKeywordTypeNode( + 157 + /* SyntaxKind.UnknownKeyword */ + )), + /*initializer*/ + void 0 + ); + parameters.push(restParameter); + } + return createStubbedMethod( + modifiers, + name2, + optional, + /*typeParameters*/ + void 0, + parameters, + getReturnTypeFromSignatures(signatures, checker, context2, enclosingDeclaration), + quotePreference, + body + ); + } + function getReturnTypeFromSignatures(signatures, checker, context2, enclosingDeclaration) { + if (ts2.length(signatures)) { + var type3 = checker.getUnionType(ts2.map(signatures, checker.getReturnTypeOfSignature)); + return checker.typeToTypeNode( + type3, + enclosingDeclaration, + /*flags*/ + void 0, + getNoopSymbolTrackerWithResolver(context2) + ); + } + } + function createStubbedMethod(modifiers, name2, optional, typeParameters, parameters, returnType, quotePreference, body) { + return ts2.factory.createMethodDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + name2, + optional ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : void 0, + typeParameters, + parameters, + returnType, + body || createStubbedMethodBody(quotePreference) + ); + } + function createStubbedMethodBody(quotePreference) { + return createStubbedBody(ts2.Diagnostics.Method_not_implemented.message, quotePreference); + } + function createStubbedBody(text, quotePreference) { + return ts2.factory.createBlock( + [ts2.factory.createThrowStatement(ts2.factory.createNewExpression( + ts2.factory.createIdentifier("Error"), + /*typeArguments*/ + void 0, + // TODO Handle auto quote preference. + [ts2.factory.createStringLiteral( + text, + /*isSingleQuote*/ + quotePreference === 0 + /* QuotePreference.Single */ + )] + ))], + /*multiline*/ + true + ); + } + codefix2.createStubbedBody = createStubbedBody; + function setJsonCompilerOptionValues(changeTracker, configFile, options) { + var tsconfigObjectLiteral = ts2.getTsConfigObjectLiteralExpression(configFile); + if (!tsconfigObjectLiteral) + return void 0; + var compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); + if (compilerOptionsProperty === void 0) { + changeTracker.insertNodeAtObjectStart(configFile, tsconfigObjectLiteral, createJsonPropertyAssignment("compilerOptions", ts2.factory.createObjectLiteralExpression( + options.map(function(_a3) { + var optionName2 = _a3[0], optionValue2 = _a3[1]; + return createJsonPropertyAssignment(optionName2, optionValue2); + }), + /*multiLine*/ + true + ))); + return; + } + var compilerOptions = compilerOptionsProperty.initializer; + if (!ts2.isObjectLiteralExpression(compilerOptions)) { + return; + } + for (var _i = 0, options_1 = options; _i < options_1.length; _i++) { + var _a2 = options_1[_i], optionName = _a2[0], optionValue = _a2[1]; + var optionProperty = findJsonProperty(compilerOptions, optionName); + if (optionProperty === void 0) { + changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue)); + } else { + changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue); + } + } + } + codefix2.setJsonCompilerOptionValues = setJsonCompilerOptionValues; + function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) { + setJsonCompilerOptionValues(changeTracker, configFile, [[optionName, optionValue]]); + } + codefix2.setJsonCompilerOptionValue = setJsonCompilerOptionValue; + function createJsonPropertyAssignment(name2, initializer) { + return ts2.factory.createPropertyAssignment(ts2.factory.createStringLiteral(name2), initializer); + } + codefix2.createJsonPropertyAssignment = createJsonPropertyAssignment; + function findJsonProperty(obj, name2) { + return ts2.find(obj.properties, function(p7) { + return ts2.isPropertyAssignment(p7) && !!p7.name && ts2.isStringLiteral(p7.name) && p7.name.text === name2; + }); + } + codefix2.findJsonProperty = findJsonProperty; + function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { + var symbols; + var typeNode = ts2.visitNode(importTypeNode, visit7); + if (symbols && typeNode) { + return { typeNode, symbols }; + } + function visit7(node) { + var _a2; + if (ts2.isLiteralImportTypeNode(node) && node.qualifier) { + var firstIdentifier = ts2.getFirstIdentifier(node.qualifier); + var name2 = ts2.getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); + var qualifier = name2 !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, ts2.factory.createIdentifier(name2)) : node.qualifier; + symbols = ts2.append(symbols, firstIdentifier.symbol); + var typeArguments = (_a2 = node.typeArguments) === null || _a2 === void 0 ? void 0 : _a2.map(visit7); + return ts2.factory.createTypeReferenceNode(qualifier, typeArguments); + } + return ts2.visitEachChild(node, visit7, ts2.nullTransformationContext); + } + } + codefix2.tryGetAutoImportableReferenceFromTypeNode = tryGetAutoImportableReferenceFromTypeNode; + function replaceFirstIdentifierOfEntityName(name2, newIdentifier) { + if (name2.kind === 79) { + return newIdentifier; + } + return ts2.factory.createQualifiedName(replaceFirstIdentifierOfEntityName(name2.left, newIdentifier), name2.right); + } + function importSymbols(importAdder, symbols) { + symbols.forEach(function(s7) { + return importAdder.addImportFromExportedSymbol( + s7, + /*isValidTypeOnlyUseSite*/ + true + ); + }); + } + codefix2.importSymbols = importSymbols; + function findAncestorMatchingSpan(sourceFile, span) { + var end = ts2.textSpanEnd(span); + var token = ts2.getTokenAtPosition(sourceFile, span.start); + while (token.end < end) { + token = token.parent; + } + return token; + } + codefix2.findAncestorMatchingSpan = findAncestorMatchingSpan; + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + function generateAccessorFromProperty(file, program, start, end, context2, _actionName) { + var fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + if (!fieldInfo || ts2.refactor.isRefactorErrorInfo(fieldInfo)) + return void 0; + var changeTracker = ts2.textChanges.ChangeTracker.fromContext(context2); + var isStatic = fieldInfo.isStatic, isReadonly = fieldInfo.isReadonly, fieldName = fieldInfo.fieldName, accessorName = fieldInfo.accessorName, originalName = fieldInfo.originalName, type3 = fieldInfo.type, container = fieldInfo.container, declaration = fieldInfo.declaration; + ts2.suppressLeadingAndTrailingTrivia(fieldName); + ts2.suppressLeadingAndTrailingTrivia(accessorName); + ts2.suppressLeadingAndTrailingTrivia(declaration); + ts2.suppressLeadingAndTrailingTrivia(container); + var accessorModifiers; + var fieldModifiers; + if (ts2.isClassLike(container)) { + var modifierFlags = ts2.getEffectiveModifierFlags(declaration); + if (ts2.isSourceFileJS(file)) { + var modifiers = ts2.factory.createModifiersFromModifierFlags(modifierFlags); + accessorModifiers = modifiers; + fieldModifiers = modifiers; + } else { + accessorModifiers = ts2.factory.createModifiersFromModifierFlags(prepareModifierFlagsForAccessor(modifierFlags)); + fieldModifiers = ts2.factory.createModifiersFromModifierFlags(prepareModifierFlagsForField(modifierFlags)); + } + if (ts2.canHaveDecorators(declaration)) { + fieldModifiers = ts2.concatenate(ts2.getDecorators(declaration), fieldModifiers); + } + } + updateFieldDeclaration(changeTracker, file, declaration, type3, fieldName, fieldModifiers); + var getAccessor = generateGetAccessor(fieldName, accessorName, type3, accessorModifiers, isStatic, container); + ts2.suppressLeadingAndTrailingTrivia(getAccessor); + insertAccessor(changeTracker, file, getAccessor, declaration, container); + if (isReadonly) { + var constructor = ts2.getFirstConstructorWithBody(container); + if (constructor) { + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); + } + } else { + var setAccessor = generateSetAccessor(fieldName, accessorName, type3, accessorModifiers, isStatic, container); + ts2.suppressLeadingAndTrailingTrivia(setAccessor); + insertAccessor(changeTracker, file, setAccessor, declaration, container); + } + return changeTracker.getChanges(); + } + codefix2.generateAccessorFromProperty = generateAccessorFromProperty; + function isConvertibleName(name2) { + return ts2.isIdentifier(name2) || ts2.isStringLiteral(name2); + } + function isAcceptedDeclaration(node) { + return ts2.isParameterPropertyDeclaration(node, node.parent) || ts2.isPropertyDeclaration(node) || ts2.isPropertyAssignment(node); + } + function createPropertyName(name2, originalName) { + return ts2.isIdentifier(originalName) ? ts2.factory.createIdentifier(name2) : ts2.factory.createStringLiteral(name2); + } + function createAccessorAccessExpression(fieldName, isStatic, container) { + var leftHead = isStatic ? container.name : ts2.factory.createThis(); + return ts2.isIdentifier(fieldName) ? ts2.factory.createPropertyAccessExpression(leftHead, fieldName) : ts2.factory.createElementAccessExpression(leftHead, ts2.factory.createStringLiteralFromNode(fieldName)); + } + function prepareModifierFlagsForAccessor(modifierFlags) { + modifierFlags &= ~64; + modifierFlags &= ~8; + if (!(modifierFlags & 16)) { + modifierFlags |= 4; + } + return modifierFlags; + } + function prepareModifierFlagsForField(modifierFlags) { + modifierFlags &= ~4; + modifierFlags &= ~16; + modifierFlags |= 8; + return modifierFlags; + } + function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans) { + if (considerEmptySpans === void 0) { + considerEmptySpans = true; + } + var node = ts2.getTokenAtPosition(file, start); + var cursorRequest = start === end && considerEmptySpans; + var declaration = ts2.findAncestor(node.parent, isAcceptedDeclaration); + var meaning = 28 | 32 | 64; + if (!declaration || !(ts2.nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest)) { + return { + error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_property_for_which_to_generate_accessor) + }; + } + if (!isConvertibleName(declaration.name)) { + return { + error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Name_is_not_valid) + }; + } + if ((ts2.getEffectiveModifierFlags(declaration) & 126975 | meaning) !== meaning) { + return { + error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Can_only_convert_property_with_modifier) + }; + } + var name2 = declaration.name.text; + var startWithUnderscore = ts2.startsWithUnderscore(name2); + var fieldName = createPropertyName(startWithUnderscore ? name2 : ts2.getUniqueName("_".concat(name2), file), declaration.name); + var accessorName = createPropertyName(startWithUnderscore ? ts2.getUniqueName(name2.substring(1), file) : name2, declaration.name); + return { + isStatic: ts2.hasStaticModifier(declaration), + isReadonly: ts2.hasEffectiveReadonlyModifier(declaration), + type: getDeclarationType(declaration, program), + container: declaration.kind === 166 ? declaration.parent.parent : declaration.parent, + originalName: declaration.name.text, + declaration, + fieldName, + accessorName, + renameAccessor: startWithUnderscore + }; + } + codefix2.getAccessorConvertiblePropertyAtPosition = getAccessorConvertiblePropertyAtPosition; + function generateGetAccessor(fieldName, accessorName, type3, modifiers, isStatic, container) { + return ts2.factory.createGetAccessorDeclaration( + modifiers, + accessorName, + /*parameters*/ + void 0, + // TODO: GH#18217 + type3, + ts2.factory.createBlock( + [ + ts2.factory.createReturnStatement(createAccessorAccessExpression(fieldName, isStatic, container)) + ], + /*multiLine*/ + true + ) + ); + } + function generateSetAccessor(fieldName, accessorName, type3, modifiers, isStatic, container) { + return ts2.factory.createSetAccessorDeclaration(modifiers, accessorName, [ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + ts2.factory.createIdentifier("value"), + /*questionToken*/ + void 0, + type3 + )], ts2.factory.createBlock( + [ + ts2.factory.createExpressionStatement(ts2.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts2.factory.createIdentifier("value"))) + ], + /*multiLine*/ + true + )); + } + function updatePropertyDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers) { + var property2 = ts2.factory.updatePropertyDeclaration(declaration, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type3, declaration.initializer); + changeTracker.replaceNode(file, declaration, property2); + } + function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { + var assignment = ts2.factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + changeTracker.replacePropertyAssignment(file, declaration, assignment); + } + function updateFieldDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers) { + if (ts2.isPropertyDeclaration(declaration)) { + updatePropertyDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers); + } else if (ts2.isPropertyAssignment(declaration)) { + updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); + } else { + changeTracker.replaceNode(file, declaration, ts2.factory.updateParameterDeclaration(declaration, modifiers, declaration.dotDotDotToken, ts2.cast(fieldName, ts2.isIdentifier), declaration.questionToken, declaration.type, declaration.initializer)); + } + } + function insertAccessor(changeTracker, file, accessor, declaration, container) { + ts2.isParameterPropertyDeclaration(declaration, declaration.parent) ? changeTracker.insertMemberAtStart(file, container, accessor) : ts2.isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); + } + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { + if (!constructor.body) + return; + constructor.body.forEachChild(function recur(node) { + if (ts2.isElementAccessExpression(node) && node.expression.kind === 108 && ts2.isStringLiteral(node.argumentExpression) && node.argumentExpression.text === originalName && ts2.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, ts2.factory.createStringLiteral(fieldName)); + } + if (ts2.isPropertyAccessExpression(node) && node.expression.kind === 108 && node.name.text === originalName && ts2.isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, ts2.factory.createIdentifier(fieldName)); + } + if (!ts2.isFunctionLike(node) && !ts2.isClassLike(node)) { + node.forEachChild(recur); + } + }); + } + function getDeclarationType(declaration, program) { + var typeNode = ts2.getTypeAnnotationNode(declaration); + if (ts2.isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { + var typeChecker = program.getTypeChecker(); + var type3 = typeChecker.getTypeFromTypeNode(typeNode); + if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type3)) { + var types3 = ts2.isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; + return ts2.factory.createUnionTypeNode(__spreadArray9(__spreadArray9([], types3, true), [ts2.factory.createKeywordTypeNode( + 155 + /* SyntaxKind.UndefinedKeyword */ + )], false)); + } + } + return typeNode; + } + function getAllSupers(decl, checker) { + var res = []; + while (decl) { + var superElement = ts2.getClassExtendsHeritageElement(decl); + var superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); + if (!superSymbol) + break; + var symbol = superSymbol.flags & 2097152 ? checker.getAliasedSymbol(superSymbol) : superSymbol; + var superDecl = symbol.declarations && ts2.find(symbol.declarations, ts2.isClassLike); + if (!superDecl) + break; + res.push(superDecl); + decl = superDecl; + } + return res; + } + codefix2.getAllSupers = getAllSupers; + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "invalidImportSyntax"; + function getCodeFixesForImportDeclaration(context2, node) { + var sourceFile = ts2.getSourceFileOfNode(node); + var namespace = ts2.getNamespaceDeclarationNode(node); + var opts = context2.program.getCompilerOptions(); + var variations = []; + variations.push(createAction(context2, sourceFile, node, ts2.makeImport( + namespace.name, + /*namedImports*/ + void 0, + node.moduleSpecifier, + ts2.getQuotePreference(sourceFile, context2.preferences) + ))); + if (ts2.getEmitModuleKind(opts) === ts2.ModuleKind.CommonJS) { + variations.push(createAction(context2, sourceFile, node, ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + namespace.name, + ts2.factory.createExternalModuleReference(node.moduleSpecifier) + ))); + } + return variations; + } + function createAction(context2, sourceFile, node, replacement) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(sourceFile, node, replacement); + }); + return codefix2.createCodeFixActionWithoutFixAll(fixName, changes, [ts2.Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]); + } + codefix2.registerCodeFix({ + errorCodes: [ + ts2.Diagnostics.This_expression_is_not_callable.code, + ts2.Diagnostics.This_expression_is_not_constructable.code + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + function getActionsForUsageOfInvalidImport(context2) { + var sourceFile = context2.sourceFile; + var targetKind = ts2.Diagnostics.This_expression_is_not_callable.code === context2.errorCode ? 210 : 211; + var node = ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, context2.span.start), function(a7) { + return a7.kind === targetKind; + }); + if (!node) { + return []; + } + var expr = node.expression; + return getImportCodeFixesForExpression(context2, expr); + } + codefix2.registerCodeFix({ + errorCodes: [ + // The following error codes cover pretty much all assignability errors that could involve an expression + ts2.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + ts2.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1.code, + ts2.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, + ts2.Diagnostics.Type_predicate_0_is_not_assignable_to_1.code, + ts2.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code, + ts2.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code, + ts2.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code, + ts2.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, + ts2.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code, + ts2.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code + ], + getCodeActions: getActionsForInvalidImportLocation + }); + function getActionsForInvalidImportLocation(context2) { + var sourceFile = context2.sourceFile; + var node = ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, context2.span.start), function(a7) { + return a7.getStart() === context2.span.start && a7.getEnd() === context2.span.start + context2.span.length; + }); + if (!node) { + return []; + } + return getImportCodeFixesForExpression(context2, node); + } + function getImportCodeFixesForExpression(context2, expr) { + var type3 = context2.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type3.symbol && type3.symbol.originatingImport)) { + return []; + } + var fixes = []; + var relatedImport = type3.symbol.originatingImport; + if (!ts2.isImportCall(relatedImport)) { + ts2.addRange(fixes, getCodeFixesForImportDeclaration(context2, relatedImport)); + } + if (ts2.isExpression(expr) && !(ts2.isNamedDeclaration(expr.parent) && expr.parent.name === expr)) { + var sourceFile_2 = context2.sourceFile; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(sourceFile_2, expr, ts2.factory.createPropertyAccessExpression(expr, "default"), {}); + }); + fixes.push(codefix2.createCodeFixActionWithoutFixAll(fixName, changes, ts2.Diagnostics.Use_synthetic_default_member)); + } + return fixes; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "strictClassInitialization"; + var fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; + var fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; + var fixIdAddInitializer = "addMissingPropertyInitializer"; + var errorCodes = [ts2.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context2) { + var info2 = getInfo(context2.sourceFile, context2.span.start); + if (!info2) + return; + var result2 = []; + ts2.append(result2, getActionForAddMissingUndefinedType(context2, info2)); + ts2.append(result2, getActionForAddMissingDefiniteAssignmentAssertion(context2, info2)); + ts2.append(result2, getActionForAddMissingInitializer(context2, info2)); + return result2; + }, + fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start); + if (!info2) + return; + switch (context2.fixId) { + case fixIdAddDefiniteAssignmentAssertions: + addDefiniteAssignmentAssertion(changes, diag.file, info2.prop); + break; + case fixIdAddUndefinedType: + addUndefinedType(changes, diag.file, info2); + break; + case fixIdAddInitializer: + var checker = context2.program.getTypeChecker(); + var initializer = getInitializer(checker, info2.prop); + if (!initializer) + return; + addInitializer(changes, diag.file, info2.prop, initializer); + break; + default: + ts2.Debug.fail(JSON.stringify(context2.fixId)); + } + }); + } + }); + function getInfo(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + if (ts2.isIdentifier(token) && ts2.isPropertyDeclaration(token.parent)) { + var type3 = ts2.getEffectiveTypeAnnotationNode(token.parent); + if (type3) { + return { type: type3, prop: token.parent, isJs: ts2.isInJSFile(token.parent) }; + } + } + return void 0; + } + function getActionForAddMissingDefiniteAssignmentAssertion(context2, info2) { + if (info2.isJs) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addDefiniteAssignmentAssertion(t8, context2.sourceFile, info2.prop); + }); + return codefix2.createCodeFixAction(fixName, changes, [ts2.Diagnostics.Add_definite_assignment_assertion_to_property_0, info2.prop.getText()], fixIdAddDefiniteAssignmentAssertions, ts2.Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties); + } + function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { + ts2.suppressLeadingAndTrailingTrivia(propertyDeclaration); + var property2 = ts2.factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.modifiers, propertyDeclaration.name, ts2.factory.createToken( + 53 + /* SyntaxKind.ExclamationToken */ + ), propertyDeclaration.type, propertyDeclaration.initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property2); + } + function getActionForAddMissingUndefinedType(context2, info2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addUndefinedType(t8, context2.sourceFile, info2); + }); + return codefix2.createCodeFixAction(fixName, changes, [ts2.Diagnostics.Add_undefined_type_to_property_0, info2.prop.name.getText()], fixIdAddUndefinedType, ts2.Diagnostics.Add_undefined_type_to_all_uninitialized_properties); + } + function addUndefinedType(changeTracker, sourceFile, info2) { + var undefinedTypeNode = ts2.factory.createKeywordTypeNode( + 155 + /* SyntaxKind.UndefinedKeyword */ + ); + var types3 = ts2.isUnionTypeNode(info2.type) ? info2.type.types.concat(undefinedTypeNode) : [info2.type, undefinedTypeNode]; + var unionTypeNode = ts2.factory.createUnionTypeNode(types3); + if (info2.isJs) { + changeTracker.addJSDocTags(sourceFile, info2.prop, [ts2.factory.createJSDocTypeTag( + /*tagName*/ + void 0, + ts2.factory.createJSDocTypeExpression(unionTypeNode) + )]); + } else { + changeTracker.replaceNode(sourceFile, info2.type, unionTypeNode); + } + } + function getActionForAddMissingInitializer(context2, info2) { + if (info2.isJs) + return void 0; + var checker = context2.program.getTypeChecker(); + var initializer = getInitializer(checker, info2.prop); + if (!initializer) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return addInitializer(t8, context2.sourceFile, info2.prop, initializer); + }); + return codefix2.createCodeFixAction(fixName, changes, [ts2.Diagnostics.Add_initializer_to_property_0, info2.prop.name.getText()], fixIdAddInitializer, ts2.Diagnostics.Add_initializers_to_all_uninitialized_properties); + } + function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer) { + ts2.suppressLeadingAndTrailingTrivia(propertyDeclaration); + var property2 = ts2.factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.modifiers, propertyDeclaration.name, propertyDeclaration.questionToken, propertyDeclaration.type, initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property2); + } + function getInitializer(checker, propertyDeclaration) { + return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); + } + function getDefaultValueFromType(checker, type3) { + if (type3.flags & 512) { + return type3 === checker.getFalseType() || type3 === checker.getFalseType( + /*fresh*/ + true + ) ? ts2.factory.createFalse() : ts2.factory.createTrue(); + } else if (type3.isStringLiteral()) { + return ts2.factory.createStringLiteral(type3.value); + } else if (type3.isNumberLiteral()) { + return ts2.factory.createNumericLiteral(type3.value); + } else if (type3.flags & 2048) { + return ts2.factory.createBigIntLiteral(type3.value); + } else if (type3.isUnion()) { + return ts2.firstDefined(type3.types, function(t8) { + return getDefaultValueFromType(checker, t8); + }); + } else if (type3.isClass()) { + var classDeclaration = ts2.getClassLikeDeclarationOfSymbol(type3.symbol); + if (!classDeclaration || ts2.hasSyntacticModifier( + classDeclaration, + 256 + /* ModifierFlags.Abstract */ + )) + return void 0; + var constructorDeclaration = ts2.getFirstConstructorWithBody(classDeclaration); + if (constructorDeclaration && constructorDeclaration.parameters.length) + return void 0; + return ts2.factory.createNewExpression( + ts2.factory.createIdentifier(type3.symbol.name), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + } else if (checker.isArrayLikeType(type3)) { + return ts2.factory.createArrayLiteralExpression(); + } + return void 0; + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "requireInTs"; + var errorCodes = [ts2.Diagnostics.require_call_may_be_converted_to_an_import.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var info2 = getInfo(context2.sourceFile, context2.program, context2.span.start); + if (!info2) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, context2.sourceFile, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_require_to_import, fixId, ts2.Diagnostics.Convert_all_require_to_import)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, context2.program, diag.start); + if (info2) { + doChange(changes, context2.sourceFile, info2); + } + }); + } + }); + function doChange(changes, sourceFile, info2) { + var allowSyntheticDefaults = info2.allowSyntheticDefaults, defaultImportName = info2.defaultImportName, namedImports = info2.namedImports, statement = info2.statement, required = info2.required; + changes.replaceNode(sourceFile, statement, defaultImportName && !allowSyntheticDefaults ? ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + defaultImportName, + ts2.factory.createExternalModuleReference(required) + ) : ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImportName, + namedImports + ), + required, + /*assertClause*/ + void 0 + )); + } + function getInfo(sourceFile, program, pos) { + var parent2 = ts2.getTokenAtPosition(sourceFile, pos).parent; + if (!ts2.isRequireCall( + parent2, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + throw ts2.Debug.failBadSyntaxKind(parent2); + } + var decl = ts2.cast(parent2.parent, ts2.isVariableDeclaration); + var defaultImportName = ts2.tryCast(decl.name, ts2.isIdentifier); + var namedImports = ts2.isObjectBindingPattern(decl.name) ? tryCreateNamedImportsFromObjectBindingPattern(decl.name) : void 0; + if (defaultImportName || namedImports) { + return { + allowSyntheticDefaults: ts2.getAllowSyntheticDefaultImports(program.getCompilerOptions()), + defaultImportName, + namedImports, + statement: ts2.cast(decl.parent.parent, ts2.isVariableStatement), + required: ts2.first(parent2.arguments) + }; + } + } + function tryCreateNamedImportsFromObjectBindingPattern(node) { + var importSpecifiers = []; + for (var _i = 0, _a2 = node.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (!ts2.isIdentifier(element.name) || element.initializer) { + return void 0; + } + importSpecifiers.push(ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + ts2.tryCast(element.propertyName, ts2.isIdentifier), + element.name + )); + } + if (importSpecifiers.length) { + return ts2.factory.createNamedImports(importSpecifiers); + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "useDefaultImport"; + var errorCodes = [ts2.Diagnostics.Import_may_be_converted_to_a_default_import.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile, start = context2.span.start; + var info2 = getInfo(sourceFile, start); + if (!info2) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2, context2.preferences); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_to_default_import, fixId, ts2.Diagnostics.Convert_all_to_default_imports)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start); + if (info2) + doChange(changes, diag.file, info2, context2.preferences); + }); + } + }); + function getInfo(sourceFile, pos) { + var name2 = ts2.getTokenAtPosition(sourceFile, pos); + if (!ts2.isIdentifier(name2)) + return void 0; + var parent2 = name2.parent; + if (ts2.isImportEqualsDeclaration(parent2) && ts2.isExternalModuleReference(parent2.moduleReference)) { + return { importNode: parent2, name: name2, moduleSpecifier: parent2.moduleReference.expression }; + } else if (ts2.isNamespaceImport(parent2)) { + var importNode = parent2.parent.parent; + return { importNode, name: name2, moduleSpecifier: importNode.moduleSpecifier }; + } + } + function doChange(changes, sourceFile, info2, preferences) { + changes.replaceNode(sourceFile, info2.importNode, ts2.makeImport( + info2.name, + /*namedImports*/ + void 0, + info2.moduleSpecifier, + ts2.getQuotePreference(sourceFile, preferences) + )); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "useBigintLiteral"; + var errorCodes = [ + ts2.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToUseBigintLiteral(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span); + }); + if (changes.length > 0) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Convert_to_a_bigint_numeric_literal, fixId, ts2.Diagnostics.Convert_all_to_bigint_numeric_literals)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag); + }); + } + }); + function makeChange(changeTracker, sourceFile, span) { + var numericLiteral = ts2.tryCast(ts2.getTokenAtPosition(sourceFile, span.start), ts2.isNumericLiteral); + if (!numericLiteral) { + return; + } + var newText = numericLiteral.getText(sourceFile) + "n"; + changeTracker.replaceNode(sourceFile, numericLiteral, ts2.factory.createBigIntLiteral(newText)); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; + var fixId = fixIdAddMissingTypeof; + var errorCodes = [ts2.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddMissingTypeof(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var importType = getImportTypeNode(sourceFile, span.start); + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, importType); + }); + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Add_missing_typeof, fixId, ts2.Diagnostics.Add_missing_typeof)]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return doChange(changes, context2.sourceFile, getImportTypeNode(diag.file, diag.start)); + }); + } + }); + function getImportTypeNode(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + ts2.Debug.assert(token.kind === 100, "This token should be an ImportKeyword"); + ts2.Debug.assert(token.parent.kind === 202, "Token parent should be an ImportType"); + return token.parent; + } + function doChange(changes, sourceFile, importType) { + var newTypeNode = ts2.factory.updateImportTypeNode( + importType, + importType.argument, + importType.assertions, + importType.qualifier, + importType.typeArguments, + /* isTypeOf */ + true + ); + changes.replaceNode(sourceFile, importType, newTypeNode); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixID = "wrapJsxInFragment"; + var errorCodes = [ts2.Diagnostics.JSX_expressions_must_have_one_parent_element.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToWrapJsxInFragment(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var node = findNodeToFix(sourceFile, span.start); + if (!node) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, node); + }); + return [codefix2.createCodeFixAction(fixID, changes, ts2.Diagnostics.Wrap_in_JSX_fragment, fixID, ts2.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; + }, + fixIds: [fixID], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var node = findNodeToFix(context2.sourceFile, diag.start); + if (!node) + return void 0; + doChange(changes, context2.sourceFile, node); + }); + } + }); + function findNodeToFix(sourceFile, pos) { + var lessThanToken = ts2.getTokenAtPosition(sourceFile, pos); + var firstJsxElementOrOpenElement = lessThanToken.parent; + var binaryExpr = firstJsxElementOrOpenElement.parent; + if (!ts2.isBinaryExpression(binaryExpr)) { + binaryExpr = binaryExpr.parent; + if (!ts2.isBinaryExpression(binaryExpr)) + return void 0; + } + if (!ts2.nodeIsMissing(binaryExpr.operatorToken)) + return void 0; + return binaryExpr; + } + function doChange(changeTracker, sf, node) { + var jsx = flattenInvalidBinaryExpr(node); + if (jsx) + changeTracker.replaceNode(sf, node, ts2.factory.createJsxFragment(ts2.factory.createJsxOpeningFragment(), jsx, ts2.factory.createJsxJsxClosingFragment())); + } + function flattenInvalidBinaryExpr(node) { + var children = []; + var current = node; + while (true) { + if (ts2.isBinaryExpression(current) && ts2.nodeIsMissing(current.operatorToken) && current.operatorToken.kind === 27) { + children.push(current.left); + if (ts2.isJsxChild(current.right)) { + children.push(current.right); + return children; + } else if (ts2.isBinaryExpression(current.right)) { + current = current.right; + continue; + } else + return void 0; + } else + return void 0; + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixConvertToMappedObjectType"; + var errorCodes = [ts2.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context2) { + var sourceFile = context2.sourceFile, span = context2.span; + var info2 = getInfo(sourceFile, span.start); + if (!info2) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2); + }); + var name2 = ts2.idText(info2.container.name); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Convert_0_to_mapped_object_type, name2], fixId, [ts2.Diagnostics.Convert_0_to_mapped_object_type, name2])]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start); + if (info2) + doChange(changes, diag.file, info2); + }); + } + }); + function getInfo(sourceFile, pos) { + var token = ts2.getTokenAtPosition(sourceFile, pos); + var indexSignature = ts2.tryCast(token.parent.parent, ts2.isIndexSignatureDeclaration); + if (!indexSignature) + return void 0; + var container = ts2.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts2.tryCast(indexSignature.parent.parent, ts2.isTypeAliasDeclaration); + if (!container) + return void 0; + return { indexSignature, container }; + } + function createTypeAliasFromInterface(declaration, type3) { + return ts2.factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type3); + } + function doChange(changes, sourceFile, _a2) { + var indexSignature = _a2.indexSignature, container = _a2.container; + var members = ts2.isInterfaceDeclaration(container) ? container.members : container.type.members; + var otherMembers = members.filter(function(member) { + return !ts2.isIndexSignatureDeclaration(member); + }); + var parameter = ts2.first(indexSignature.parameters); + var mappedTypeParameter = ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + ts2.cast(parameter.name, ts2.isIdentifier), + parameter.type + ); + var mappedIntersectionType = ts2.factory.createMappedTypeNode( + ts2.hasEffectiveReadonlyModifier(indexSignature) ? ts2.factory.createModifier( + 146 + /* SyntaxKind.ReadonlyKeyword */ + ) : void 0, + mappedTypeParameter, + /*nameType*/ + void 0, + indexSignature.questionToken, + indexSignature.type, + /*members*/ + void 0 + ); + var intersectionType2 = ts2.factory.createIntersectionTypeNode(__spreadArray9(__spreadArray9(__spreadArray9([], ts2.getAllSuperTypeNodes(container), true), [ + mappedIntersectionType + ], false), otherMembers.length ? [ts2.factory.createTypeLiteralNode(otherMembers)] : ts2.emptyArray, true)); + changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType2)); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "removeAccidentalCallParentheses"; + var errorCodes = [ + ts2.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var callExpression = ts2.findAncestor(ts2.getTokenAtPosition(context2.sourceFile, context2.span.start), ts2.isCallExpression); + if (!callExpression) { + return void 0; + } + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + t8.deleteRange(context2.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); + }); + return [codefix2.createCodeFixActionWithoutFixAll(fixId, changes, ts2.Diagnostics.Remove_parentheses)]; + }, + fixIds: [fixId] + }); + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "removeUnnecessaryAwait"; + var errorCodes = [ + ts2.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code + ]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span); + }); + if (changes.length > 0) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Remove_unnecessary_await, fixId, ts2.Diagnostics.Remove_all_unnecessary_uses_of_await)]; + } + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag); + }); + } + }); + function makeChange(changeTracker, sourceFile, span) { + var awaitKeyword = ts2.tryCast(ts2.getTokenAtPosition(sourceFile, span.start), function(node) { + return node.kind === 133; + }); + var awaitExpression = awaitKeyword && ts2.tryCast(awaitKeyword.parent, ts2.isAwaitExpression); + if (!awaitExpression) { + return; + } + var expressionToReplace = awaitExpression; + var hasSurroundingParens = ts2.isParenthesizedExpression(awaitExpression.parent); + if (hasSurroundingParens) { + var leftMostExpression = ts2.getLeftmostExpression( + awaitExpression.expression, + /*stopAtCallExpressions*/ + false + ); + if (ts2.isIdentifier(leftMostExpression)) { + var precedingToken = ts2.findPrecedingToken(awaitExpression.parent.pos, sourceFile); + if (precedingToken && precedingToken.kind !== 103) { + expressionToReplace = awaitExpression.parent; + } + } + } + changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var errorCodes = [ts2.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; + var fixId = "splitTypeOnlyImport"; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return splitTypeOnlyImport(t8, getImportDeclaration(context2.sourceFile, context2.span), context2); + }); + if (changes.length) { + return [codefix2.createCodeFixAction(fixId, changes, ts2.Diagnostics.Split_into_two_separate_import_declarations, fixId, ts2.Diagnostics.Split_all_invalid_type_only_imports)]; + } + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, error2) { + splitTypeOnlyImport(changes, getImportDeclaration(context2.sourceFile, error2), context2); + }); + } + }); + function getImportDeclaration(sourceFile, span) { + return ts2.findAncestor(ts2.getTokenAtPosition(sourceFile, span.start), ts2.isImportDeclaration); + } + function splitTypeOnlyImport(changes, importDeclaration, context2) { + if (!importDeclaration) { + return; + } + var importClause = ts2.Debug.checkDefined(importDeclaration.importClause); + changes.replaceNode(context2.sourceFile, importDeclaration, ts2.factory.updateImportDeclaration(importDeclaration, importDeclaration.modifiers, ts2.factory.updateImportClause( + importClause, + importClause.isTypeOnly, + importClause.name, + /*namedBindings*/ + void 0 + ), importDeclaration.moduleSpecifier, importDeclaration.assertClause)); + changes.insertNodeAfter(context2.sourceFile, importDeclaration, ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.updateImportClause( + importClause, + importClause.isTypeOnly, + /*name*/ + void 0, + importClause.namedBindings + ), + importDeclaration.moduleSpecifier, + importDeclaration.assertClause + )); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixConvertConstToLet"; + var errorCodes = [ts2.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToConvertConstToLet(context2) { + var sourceFile = context2.sourceFile, span = context2.span, program = context2.program; + var info2 = getInfo(sourceFile, span.start, program); + if (info2 === void 0) + return; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2.token); + }); + return [codefix2.createCodeFixActionMaybeFixAll(fixId, changes, ts2.Diagnostics.Convert_const_to_let, fixId, ts2.Diagnostics.Convert_all_const_to_let)]; + }, + getAllCodeActions: function(context2) { + var program = context2.program; + var seen = new ts2.Map(); + return codefix2.createCombinedCodeActions(ts2.textChanges.ChangeTracker.with(context2, function(changes) { + codefix2.eachDiagnostic(context2, errorCodes, function(diag) { + var info2 = getInfo(diag.file, diag.start, program); + if (info2) { + if (ts2.addToSeen(seen, ts2.getSymbolId(info2.symbol))) { + return doChange(changes, diag.file, info2.token); + } + } + return void 0; + }); + })); + }, + fixIds: [fixId] + }); + function getInfo(sourceFile, pos, program) { + var _a2; + var checker = program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(ts2.getTokenAtPosition(sourceFile, pos)); + if (symbol === void 0) + return; + var declaration = ts2.tryCast((_a2 = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration) === null || _a2 === void 0 ? void 0 : _a2.parent, ts2.isVariableDeclarationList); + if (declaration === void 0) + return; + var constToken = ts2.findChildOfKind(declaration, 85, sourceFile); + if (constToken === void 0) + return; + return { symbol, token: constToken }; + } + function doChange(changes, sourceFile, token) { + changes.replaceNode(sourceFile, token, ts2.factory.createToken( + 119 + /* SyntaxKind.LetKeyword */ + )); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixId = "fixExpectedComma"; + var expectedErrorCode = ts2.Diagnostics._0_expected.code; + var errorCodes = [expectedErrorCode]; + codefix2.registerCodeFix({ + errorCodes, + getCodeActions: function(context2) { + var sourceFile = context2.sourceFile; + var info2 = getInfo(sourceFile, context2.span.start, context2.errorCode); + if (!info2) + return void 0; + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(t8, sourceFile, info2); + }); + return [codefix2.createCodeFixAction(fixId, changes, [ts2.Diagnostics.Change_0_to_1, ";", ","], fixId, [ts2.Diagnostics.Change_0_to_1, ";", ","])]; + }, + fixIds: [fixId], + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + var info2 = getInfo(diag.file, diag.start, diag.code); + if (info2) + doChange(changes, context2.sourceFile, info2); + }); + } + }); + function getInfo(sourceFile, pos, _6) { + var node = ts2.getTokenAtPosition(sourceFile, pos); + return node.kind === 26 && node.parent && (ts2.isObjectLiteralExpression(node.parent) || ts2.isArrayLiteralExpression(node.parent)) ? { node } : void 0; + } + function doChange(changes, sourceFile, _a2) { + var node = _a2.node; + var newNode = ts2.factory.createToken( + 27 + /* SyntaxKind.CommaToken */ + ); + changes.replaceNode(sourceFile, node, newNode); + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var codefix; + (function(codefix2) { + var fixName = "addVoidToPromise"; + var fixId = "addVoidToPromise"; + var errorCodes = [ + ts2.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, + ts2.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code + ]; + codefix2.registerCodeFix({ + errorCodes, + fixIds: [fixId], + getCodeActions: function(context2) { + var changes = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return makeChange(t8, context2.sourceFile, context2.span, context2.program); + }); + if (changes.length > 0) { + return [codefix2.createCodeFixAction(fixName, changes, ts2.Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId, ts2.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; + } + }, + getAllCodeActions: function(context2) { + return codefix2.codeFixAll(context2, errorCodes, function(changes, diag) { + return makeChange(changes, diag.file, diag, context2.program, new ts2.Set()); + }); + } + }); + function makeChange(changes, sourceFile, span, program, seen) { + var node = ts2.getTokenAtPosition(sourceFile, span.start); + if (!ts2.isIdentifier(node) || !ts2.isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) + return; + var checker = program.getTypeChecker(); + var symbol = checker.getSymbolAtLocation(node); + var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration; + if (!decl || !ts2.isParameter(decl) || !ts2.isNewExpression(decl.parent.parent)) + return; + if (seen === null || seen === void 0 ? void 0 : seen.has(decl)) + return; + seen === null || seen === void 0 ? void 0 : seen.add(decl); + var typeArguments = getEffectiveTypeArguments(decl.parent.parent); + if (ts2.some(typeArguments)) { + var typeArgument = typeArguments[0]; + var needsParens = !ts2.isUnionTypeNode(typeArgument) && !ts2.isParenthesizedTypeNode(typeArgument) && ts2.isParenthesizedTypeNode(ts2.factory.createUnionTypeNode([typeArgument, ts2.factory.createKeywordTypeNode( + 114 + /* SyntaxKind.VoidKeyword */ + )]).types[0]); + if (needsParens) { + changes.insertText(sourceFile, typeArgument.pos, "("); + } + changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); + } else { + var signature = checker.getResolvedSignature(node.parent); + var parameter = signature === null || signature === void 0 ? void 0 : signature.parameters[0]; + var parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); + if (ts2.isInJSFile(decl)) { + if (!parameterType || parameterType.flags & 3) { + changes.insertText(sourceFile, decl.parent.parent.end, ")"); + changes.insertText(sourceFile, ts2.skipTrivia(sourceFile.text, decl.parent.parent.pos), "/** @type {Promise} */("); + } + } else { + if (!parameterType || parameterType.flags & 2) { + changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); + } + } + } + } + function getEffectiveTypeArguments(node) { + var _a2; + if (ts2.isInJSFile(node)) { + if (ts2.isParenthesizedExpression(node.parent)) { + var jsDocType = (_a2 = ts2.getJSDocTypeTag(node.parent)) === null || _a2 === void 0 ? void 0 : _a2.typeExpression.type; + if (jsDocType && ts2.isTypeReferenceNode(jsDocType) && ts2.isIdentifier(jsDocType.typeName) && ts2.idText(jsDocType.typeName) === "Promise") { + return jsDocType.typeArguments; + } + } + } else { + return node.typeArguments; + } + } + })(codefix = ts2.codefix || (ts2.codefix = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var refactorName = "Convert export"; + var defaultToNamedAction = { + name: "Convert default export to named export", + description: ts2.Diagnostics.Convert_default_export_to_named_export.message, + kind: "refactor.rewrite.export.named" + }; + var namedToDefaultAction = { + name: "Convert named export to default export", + description: ts2.Diagnostics.Convert_named_export_to_default_export.message, + kind: "refactor.rewrite.export.default" + }; + refactor2.registerRefactor(refactorName, { + kinds: [ + defaultToNamedAction.kind, + namedToDefaultAction.kind + ], + getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndDefaultExports(context2) { + var info2 = getInfo(context2, context2.triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + var action = info2.wasDefault ? defaultToNamedAction : namedToDefaultAction; + return [{ name: refactorName, description: action.description, actions: [action] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [ + { name: refactorName, description: ts2.Diagnostics.Convert_default_export_to_named_export.message, actions: [ + __assign16(__assign16({}, defaultToNamedAction), { notApplicableReason: info2.error }), + __assign16(__assign16({}, namedToDefaultAction), { notApplicableReason: info2.error }) + ] } + ]; + } + return ts2.emptyArray; + }, + getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndDefaultExports(context2, actionName) { + ts2.Debug.assert(actionName === defaultToNamedAction.name || actionName === namedToDefaultAction.name, "Unexpected action name"); + var info2 = getInfo(context2); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected applicable refactor info"); + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(context2.file, context2.program, info2, t8, context2.cancellationToken); + }); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + function getInfo(context2, considerPartialSpans) { + if (considerPartialSpans === void 0) { + considerPartialSpans = true; + } + var file = context2.file, program = context2.program; + var span = ts2.getRefactorContextSpan(context2); + var token = ts2.getTokenAtPosition(file, span.start); + var exportNode = !!(token.parent && ts2.getSyntacticModifierFlags(token.parent) & 1) && considerPartialSpans ? token.parent : ts2.getParentNodeInSpan(token, file, span); + if (!exportNode || !ts2.isSourceFile(exportNode.parent) && !(ts2.isModuleBlock(exportNode.parent) && ts2.isAmbientModule(exportNode.parent.parent))) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_export_statement) }; + } + var checker = program.getTypeChecker(); + var exportingModuleSymbol = getExportingModuleSymbol(exportNode, checker); + var flags = ts2.getSyntacticModifierFlags(exportNode) || (ts2.isExportAssignment(exportNode) && !exportNode.isExportEquals ? 1025 : 0); + var wasDefault = !!(flags & 1024); + if (!(flags & 1) || !wasDefault && exportingModuleSymbol.exports.has( + "default" + /* InternalSymbolName.Default */ + )) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.This_file_already_has_a_default_export) }; + } + var noSymbolError = function(id) { + return ts2.isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Can_only_convert_named_export) }; + }; + switch (exportNode.kind) { + case 259: + case 260: + case 261: + case 263: + case 262: + case 264: { + var node = exportNode; + if (!node.name) + return void 0; + return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; + } + case 240: { + var vs = exportNode; + if (!(vs.declarationList.flags & 2) || vs.declarationList.declarations.length !== 1) { + return void 0; + } + var decl = ts2.first(vs.declarationList.declarations); + if (!decl.initializer) + return void 0; + ts2.Debug.assert(!wasDefault, "Can't have a default flag here"); + return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; + } + case 274: { + var node = exportNode; + if (node.isExportEquals) + return void 0; + return noSymbolError(node.expression) || { exportNode: node, exportName: node.expression, wasDefault, exportingModuleSymbol }; + } + default: + return void 0; + } + } + function doChange(exportingSourceFile, program, info2, changes, cancellationToken) { + changeExport(exportingSourceFile, info2, changes, program.getTypeChecker()); + changeImports(program, info2, changes, cancellationToken); + } + function changeExport(exportingSourceFile, _a2, changes, checker) { + var wasDefault = _a2.wasDefault, exportNode = _a2.exportNode, exportName = _a2.exportName; + if (wasDefault) { + if (ts2.isExportAssignment(exportNode) && !exportNode.isExportEquals) { + var exp = exportNode.expression; + var spec = makeExportSpecifier(exp.text, exp.text); + changes.replaceNode(exportingSourceFile, exportNode, ts2.factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + ts2.factory.createNamedExports([spec]) + )); + } else { + changes.delete(exportingSourceFile, ts2.Debug.checkDefined(ts2.findModifier( + exportNode, + 88 + /* SyntaxKind.DefaultKeyword */ + ), "Should find a default keyword in modifier list")); + } + } else { + var exportKeyword = ts2.Debug.checkDefined(ts2.findModifier( + exportNode, + 93 + /* SyntaxKind.ExportKeyword */ + ), "Should find an export keyword in modifier list"); + switch (exportNode.kind) { + case 259: + case 260: + case 261: + changes.insertNodeAfter(exportingSourceFile, exportKeyword, ts2.factory.createToken( + 88 + /* SyntaxKind.DefaultKeyword */ + )); + break; + case 240: + var decl = ts2.first(exportNode.declarationList.declarations); + if (!ts2.FindAllReferences.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + changes.replaceNode(exportingSourceFile, exportNode, ts2.factory.createExportDefault(ts2.Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + break; + } + case 263: + case 262: + case 264: + changes.deleteModifier(exportingSourceFile, exportKeyword); + changes.insertNodeAfter(exportingSourceFile, exportNode, ts2.factory.createExportDefault(ts2.factory.createIdentifier(exportName.text))); + break; + default: + ts2.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind)); + } + } + } + function changeImports(program, _a2, changes, cancellationToken) { + var wasDefault = _a2.wasDefault, exportName = _a2.exportName, exportingModuleSymbol = _a2.exportingModuleSymbol; + var checker = program.getTypeChecker(); + var exportSymbol = ts2.Debug.checkDefined(checker.getSymbolAtLocation(exportName), "Export name should resolve to a symbol"); + ts2.FindAllReferences.Core.eachExportReference(program.getSourceFiles(), checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName.text, wasDefault, function(ref) { + if (exportName === ref) + return; + var importingSourceFile = ref.getSourceFile(); + if (wasDefault) { + changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName.text); + } else { + changeNamedToDefaultImport(importingSourceFile, ref, changes); + } + }); + } + function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { + var parent2 = ref.parent; + switch (parent2.kind) { + case 208: + changes.replaceNode(importingSourceFile, ref, ts2.factory.createIdentifier(exportName)); + break; + case 273: + case 278: { + var spec = parent2; + changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); + break; + } + case 270: { + var clause = parent2; + ts2.Debug.assert(clause.name === ref, "Import clause name should match provided ref"); + var spec = makeImportSpecifier(exportName, ref.text); + var namedBindings = clause.namedBindings; + if (!namedBindings) { + changes.replaceNode(importingSourceFile, ref, ts2.factory.createNamedImports([spec])); + } else if (namedBindings.kind === 271) { + changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); + var quotePreference = ts2.isStringLiteral(clause.parent.moduleSpecifier) ? ts2.quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1; + var newImport = ts2.makeImport( + /*default*/ + void 0, + [makeImportSpecifier(exportName, ref.text)], + clause.parent.moduleSpecifier, + quotePreference + ); + changes.insertNodeAfter(importingSourceFile, clause.parent, newImport); + } else { + changes.delete(importingSourceFile, ref); + changes.insertNodeAtEndOfList(importingSourceFile, namedBindings.elements, spec); + } + break; + } + case 202: + var importTypeNode = parent2; + changes.replaceNode(importingSourceFile, parent2, ts2.factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, ts2.factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); + break; + default: + ts2.Debug.failBadSyntaxKind(parent2); + } + } + function changeNamedToDefaultImport(importingSourceFile, ref, changes) { + var parent2 = ref.parent; + switch (parent2.kind) { + case 208: + changes.replaceNode(importingSourceFile, ref, ts2.factory.createIdentifier("default")); + break; + case 273: { + var defaultImport = ts2.factory.createIdentifier(parent2.name.text); + if (parent2.parent.elements.length === 1) { + changes.replaceNode(importingSourceFile, parent2.parent, defaultImport); + } else { + changes.delete(importingSourceFile, parent2); + changes.insertNodeBefore(importingSourceFile, parent2.parent, defaultImport); + } + break; + } + case 278: { + changes.replaceNode(importingSourceFile, parent2, makeExportSpecifier("default", parent2.name.text)); + break; + } + default: + ts2.Debug.assertNever(parent2, "Unexpected parent kind ".concat(parent2.kind)); + } + } + function makeImportSpecifier(propertyName, name2) { + return ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName === name2 ? void 0 : ts2.factory.createIdentifier(propertyName), + ts2.factory.createIdentifier(name2) + ); + } + function makeExportSpecifier(propertyName, name2) { + return ts2.factory.createExportSpecifier( + /*isTypeOnly*/ + false, + propertyName === name2 ? void 0 : ts2.factory.createIdentifier(propertyName), + ts2.factory.createIdentifier(name2) + ); + } + function getExportingModuleSymbol(node, checker) { + var parent2 = node.parent; + if (ts2.isSourceFile(parent2)) { + return parent2.symbol; + } + var symbol = parent2.parent.symbol; + if (symbol.valueDeclaration && ts2.isExternalModuleAugmentation(symbol.valueDeclaration)) { + return checker.getMergedSymbol(symbol); + } + return symbol; + } + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var _a2; + var refactorName = "Convert import"; + var actions = (_a2 = {}, _a2[ + 0 + /* ImportKind.Named */ + ] = { + name: "Convert namespace import to named imports", + description: ts2.Diagnostics.Convert_namespace_import_to_named_imports.message, + kind: "refactor.rewrite.import.named" + }, _a2[ + 2 + /* ImportKind.Namespace */ + ] = { + name: "Convert named imports to namespace import", + description: ts2.Diagnostics.Convert_named_imports_to_namespace_import.message, + kind: "refactor.rewrite.import.namespace" + }, _a2[ + 1 + /* ImportKind.Default */ + ] = { + name: "Convert named imports to default import", + description: ts2.Diagnostics.Convert_named_imports_to_default_import.message, + kind: "refactor.rewrite.import.default" + }, _a2); + refactor2.registerRefactor(refactorName, { + kinds: ts2.getOwnValues(actions).map(function(a7) { + return a7.kind; + }), + getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndNamespacedImports(context2) { + var info2 = getImportConversionInfo(context2, context2.triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + var action = actions[info2.convertTo]; + return [{ name: refactorName, description: action.description, actions: [action] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return ts2.getOwnValues(actions).map(function(action2) { + return { + name: refactorName, + description: action2.description, + actions: [__assign16(__assign16({}, action2), { notApplicableReason: info2.error })] + }; + }); + } + return ts2.emptyArray; + }, + getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndNamespacedImports(context2, actionName) { + ts2.Debug.assert(ts2.some(ts2.getOwnValues(actions), function(action) { + return action.name === actionName; + }), "Unexpected action name"); + var info2 = getImportConversionInfo(context2); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected applicable refactor info"); + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(context2.file, context2.program, t8, info2); + }); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + function getImportConversionInfo(context2, considerPartialSpans) { + if (considerPartialSpans === void 0) { + considerPartialSpans = true; + } + var file = context2.file; + var span = ts2.getRefactorContextSpan(context2); + var token = ts2.getTokenAtPosition(file, span.start); + var importDecl = considerPartialSpans ? ts2.findAncestor(token, ts2.isImportDeclaration) : ts2.getParentNodeInSpan(token, file, span); + if (!importDecl || !ts2.isImportDeclaration(importDecl)) + return { error: "Selection is not an import declaration." }; + var end = span.start + span.length; + var nextToken = ts2.findNextToken(importDecl, importDecl.parent, file); + if (nextToken && end > nextToken.getStart()) + return void 0; + var importClause = importDecl.importClause; + if (!importClause) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_import_clause) }; + } + if (!importClause.namedBindings) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_namespace_import_or_named_imports) }; + } + if (importClause.namedBindings.kind === 271) { + return { convertTo: 0, import: importClause.namedBindings }; + } + var shouldUseDefault = getShouldUseDefault(context2.program, importClause); + return shouldUseDefault ? { convertTo: 1, import: importClause.namedBindings } : { convertTo: 2, import: importClause.namedBindings }; + } + function getShouldUseDefault(program, importClause) { + return ts2.getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); + } + function doChange(sourceFile, program, changes, info2) { + var checker = program.getTypeChecker(); + if (info2.convertTo === 0) { + doChangeNamespaceToNamed(sourceFile, checker, changes, info2.import, ts2.getAllowSyntheticDefaultImports(program.getCompilerOptions())); + } else { + doChangeNamedToNamespaceOrDefault( + sourceFile, + program, + changes, + info2.import, + info2.convertTo === 1 + /* ImportKind.Default */ + ); + } + } + function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allowSyntheticDefaultImports) { + var usedAsNamespaceOrDefault = false; + var nodesToReplace = []; + var conflictingNames = new ts2.Map(); + ts2.FindAllReferences.Core.eachSymbolReferenceInFile(toConvert.name, checker, sourceFile, function(id) { + if (!ts2.isPropertyAccessOrQualifiedName(id.parent)) { + usedAsNamespaceOrDefault = true; + } else { + var exportName2 = getRightOfPropertyAccessOrQualifiedName(id.parent).text; + if (checker.resolveName( + exportName2, + id, + 67108863, + /*excludeGlobals*/ + true + )) { + conflictingNames.set(exportName2, true); + } + ts2.Debug.assert(getLeftOfPropertyAccessOrQualifiedName(id.parent) === id, "Parent expression should match id"); + nodesToReplace.push(id.parent); + } + }); + var exportNameToImportName = new ts2.Map(); + for (var _i = 0, nodesToReplace_1 = nodesToReplace; _i < nodesToReplace_1.length; _i++) { + var propertyAccessOrQualifiedName = nodesToReplace_1[_i]; + var exportName = getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName).text; + var importName = exportNameToImportName.get(exportName); + if (importName === void 0) { + exportNameToImportName.set(exportName, importName = conflictingNames.has(exportName) ? ts2.getUniqueName(exportName, sourceFile) : exportName); + } + changes.replaceNode(sourceFile, propertyAccessOrQualifiedName, ts2.factory.createIdentifier(importName)); + } + var importSpecifiers = []; + exportNameToImportName.forEach(function(name2, propertyName) { + importSpecifiers.push(ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + name2 === propertyName ? void 0 : ts2.factory.createIdentifier(propertyName), + ts2.factory.createIdentifier(name2) + )); + }); + var importDecl = toConvert.parent.parent; + if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) { + changes.insertNodeAfter(sourceFile, importDecl, updateImport( + importDecl, + /*defaultImportName*/ + void 0, + importSpecifiers + )); + } else { + changes.replaceNode(sourceFile, importDecl, updateImport(importDecl, usedAsNamespaceOrDefault ? ts2.factory.createIdentifier(toConvert.name.text) : void 0, importSpecifiers)); + } + } + function getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { + return ts2.isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.name : propertyAccessOrQualifiedName.right; + } + function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { + return ts2.isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.expression : propertyAccessOrQualifiedName.left; + } + function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault) { + if (shouldUseDefault === void 0) { + shouldUseDefault = getShouldUseDefault(program, toConvert.parent); + } + var checker = program.getTypeChecker(); + var importDecl = toConvert.parent.parent; + var moduleSpecifier = importDecl.moduleSpecifier; + var toConvertSymbols = new ts2.Set(); + toConvert.elements.forEach(function(namedImport) { + var symbol = checker.getSymbolAtLocation(namedImport.name); + if (symbol) { + toConvertSymbols.add(symbol); + } + }); + var preferredName = moduleSpecifier && ts2.isStringLiteral(moduleSpecifier) ? ts2.codefix.moduleSpecifierToValidIdentifier( + moduleSpecifier.text, + 99 + /* ScriptTarget.ESNext */ + ) : "module"; + function hasNamespaceNameConflict(namedImport) { + return !!ts2.FindAllReferences.Core.eachSymbolReferenceInFile(namedImport.name, checker, sourceFile, function(id) { + var symbol = checker.resolveName( + preferredName, + id, + 67108863, + /*excludeGlobals*/ + true + ); + if (symbol) { + if (toConvertSymbols.has(symbol)) { + return ts2.isExportSpecifier(id.parent); + } + return true; + } + return false; + }); + } + var namespaceNameConflicts = toConvert.elements.some(hasNamespaceNameConflict); + var namespaceImportName = namespaceNameConflicts ? ts2.getUniqueName(preferredName, sourceFile) : preferredName; + var neededNamedImports = new ts2.Set(); + var _loop_15 = function(element2) { + var propertyName = (element2.propertyName || element2.name).text; + ts2.FindAllReferences.Core.eachSymbolReferenceInFile(element2.name, checker, sourceFile, function(id) { + var access2 = ts2.factory.createPropertyAccessExpression(ts2.factory.createIdentifier(namespaceImportName), propertyName); + if (ts2.isShorthandPropertyAssignment(id.parent)) { + changes.replaceNode(sourceFile, id.parent, ts2.factory.createPropertyAssignment(id.text, access2)); + } else if (ts2.isExportSpecifier(id.parent)) { + neededNamedImports.add(element2); + } else { + changes.replaceNode(sourceFile, id, access2); + } + }); + }; + for (var _i = 0, _a3 = toConvert.elements; _i < _a3.length; _i++) { + var element = _a3[_i]; + _loop_15(element); + } + changes.replaceNode(sourceFile, toConvert, shouldUseDefault ? ts2.factory.createIdentifier(namespaceImportName) : ts2.factory.createNamespaceImport(ts2.factory.createIdentifier(namespaceImportName))); + if (neededNamedImports.size) { + var newNamedImports = ts2.arrayFrom(neededNamedImports.values()).map(function(element2) { + return ts2.factory.createImportSpecifier(element2.isTypeOnly, element2.propertyName && ts2.factory.createIdentifier(element2.propertyName.text), ts2.factory.createIdentifier(element2.name.text)); + }); + changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport( + importDecl, + /*defaultImportName*/ + void 0, + newNamedImports + )); + } + } + refactor2.doChangeNamedToNamespaceOrDefault = doChangeNamedToNamespaceOrDefault; + function isExportEqualsModule(moduleSpecifier, checker) { + var externalModule = checker.resolveExternalModuleName(moduleSpecifier); + if (!externalModule) + return false; + var exportEquals = checker.resolveExternalModuleSymbol(externalModule); + return externalModule !== exportEquals; + } + function updateImport(old, defaultImportName, elements) { + return ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImportName, + elements && elements.length ? ts2.factory.createNamedImports(elements) : void 0 + ), + old.moduleSpecifier, + /*assertClause*/ + void 0 + ); + } + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var convertToOptionalChainExpression; + (function(convertToOptionalChainExpression2) { + var refactorName = "Convert to optional chain expression"; + var convertToOptionalChainExpressionMessage = ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_to_optional_chain_expression); + var toOptionalChainAction = { + name: refactorName, + description: convertToOptionalChainExpressionMessage, + kind: "refactor.rewrite.expression.optionalChain" + }; + refactor2.registerRefactor(refactorName, { + kinds: [toOptionalChainAction.kind], + getEditsForAction: getRefactorEditsToConvertToOptionalChain, + getAvailableActions: getRefactorActionsToConvertToOptionalChain + }); + function getRefactorActionsToConvertToOptionalChain(context2) { + var info2 = getInfo(context2, context2.triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + return [{ + name: refactorName, + description: convertToOptionalChainExpressionMessage, + actions: [toOptionalChainAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName, + description: convertToOptionalChainExpressionMessage, + actions: [__assign16(__assign16({}, toOptionalChainAction), { notApplicableReason: info2.error })] + }]; + } + return ts2.emptyArray; + } + function getRefactorEditsToConvertToOptionalChain(context2, actionName) { + var info2 = getInfo(context2); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected applicable refactor info"); + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(context2.file, context2.program.getTypeChecker(), t8, info2, actionName); + }); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + function isValidExpression(node) { + return ts2.isBinaryExpression(node) || ts2.isConditionalExpression(node); + } + function isValidStatement(node) { + return ts2.isExpressionStatement(node) || ts2.isReturnStatement(node) || ts2.isVariableStatement(node); + } + function isValidExpressionOrStatement(node) { + return isValidExpression(node) || isValidStatement(node); + } + function getInfo(context2, considerEmptySpans) { + if (considerEmptySpans === void 0) { + considerEmptySpans = true; + } + var file = context2.file, program = context2.program; + var span = ts2.getRefactorContextSpan(context2); + var forEmptySpan = span.length === 0; + if (forEmptySpan && !considerEmptySpans) + return void 0; + var startToken = ts2.getTokenAtPosition(file, span.start); + var endToken = ts2.findTokenOnLeftOfPosition(file, span.start + span.length); + var adjustedSpan = ts2.createTextSpanFromBounds(startToken.pos, endToken && endToken.end >= startToken.pos ? endToken.getEnd() : startToken.getEnd()); + var parent2 = forEmptySpan ? getValidParentNodeOfEmptySpan(startToken) : getValidParentNodeContainingSpan(startToken, adjustedSpan); + var expression = parent2 && isValidExpressionOrStatement(parent2) ? getExpression(parent2) : void 0; + if (!expression) + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_convertible_access_expression) }; + var checker = program.getTypeChecker(); + return ts2.isConditionalExpression(expression) ? getConditionalInfo(expression, checker) : getBinaryInfo(expression); + } + function getConditionalInfo(expression, checker) { + var condition = expression.condition; + var finalExpression = getFinalExpressionInChain(expression.whenTrue); + if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_convertible_access_expression) }; + } + if ((ts2.isPropertyAccessExpression(condition) || ts2.isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { + return { finalExpression, occurrences: [condition], expression }; + } else if (ts2.isBinaryExpression(condition)) { + var occurrences = getOccurrencesInExpression(finalExpression.expression, condition); + return occurrences ? { finalExpression, occurrences, expression } : { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_matching_access_expressions) }; + } + } + function getBinaryInfo(expression) { + if (expression.operatorToken.kind !== 55) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Can_only_convert_logical_AND_access_chains) }; + } + var finalExpression = getFinalExpressionInChain(expression.right); + if (!finalExpression) + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_convertible_access_expression) }; + var occurrences = getOccurrencesInExpression(finalExpression.expression, expression.left); + return occurrences ? { finalExpression, occurrences, expression } : { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_matching_access_expressions) }; + } + function getOccurrencesInExpression(matchTo, expression) { + var occurrences = []; + while (ts2.isBinaryExpression(expression) && expression.operatorToken.kind === 55) { + var match = getMatchingStart(ts2.skipParentheses(matchTo), ts2.skipParentheses(expression.right)); + if (!match) { + break; + } + occurrences.push(match); + matchTo = match; + expression = expression.left; + } + var finalMatch = getMatchingStart(matchTo, expression); + if (finalMatch) { + occurrences.push(finalMatch); + } + return occurrences.length > 0 ? occurrences : void 0; + } + function getMatchingStart(chain3, subchain) { + if (!ts2.isIdentifier(subchain) && !ts2.isPropertyAccessExpression(subchain) && !ts2.isElementAccessExpression(subchain)) { + return void 0; + } + return chainStartsWith(chain3, subchain) ? subchain : void 0; + } + function chainStartsWith(chain3, subchain) { + while (ts2.isCallExpression(chain3) || ts2.isPropertyAccessExpression(chain3) || ts2.isElementAccessExpression(chain3)) { + if (getTextOfChainNode(chain3) === getTextOfChainNode(subchain)) + break; + chain3 = chain3.expression; + } + while (ts2.isPropertyAccessExpression(chain3) && ts2.isPropertyAccessExpression(subchain) || ts2.isElementAccessExpression(chain3) && ts2.isElementAccessExpression(subchain)) { + if (getTextOfChainNode(chain3) !== getTextOfChainNode(subchain)) + return false; + chain3 = chain3.expression; + subchain = subchain.expression; + } + return ts2.isIdentifier(chain3) && ts2.isIdentifier(subchain) && chain3.getText() === subchain.getText(); + } + function getTextOfChainNode(node) { + if (ts2.isIdentifier(node) || ts2.isStringOrNumericLiteralLike(node)) { + return node.getText(); + } + if (ts2.isPropertyAccessExpression(node)) { + return getTextOfChainNode(node.name); + } + if (ts2.isElementAccessExpression(node)) { + return getTextOfChainNode(node.argumentExpression); + } + return void 0; + } + function getValidParentNodeContainingSpan(node, span) { + while (node.parent) { + if (isValidExpressionOrStatement(node) && span.length !== 0 && node.end >= span.start + span.length) { + return node; + } + node = node.parent; + } + return void 0; + } + function getValidParentNodeOfEmptySpan(node) { + while (node.parent) { + if (isValidExpressionOrStatement(node) && !isValidExpressionOrStatement(node.parent)) { + return node; + } + node = node.parent; + } + return void 0; + } + function getExpression(node) { + if (isValidExpression(node)) { + return node; + } + if (ts2.isVariableStatement(node)) { + var variable = ts2.getSingleVariableOfVariableStatement(node); + var initializer = variable === null || variable === void 0 ? void 0 : variable.initializer; + return initializer && isValidExpression(initializer) ? initializer : void 0; + } + return node.expression && isValidExpression(node.expression) ? node.expression : void 0; + } + function getFinalExpressionInChain(node) { + node = ts2.skipParentheses(node); + if (ts2.isBinaryExpression(node)) { + return getFinalExpressionInChain(node.left); + } else if ((ts2.isPropertyAccessExpression(node) || ts2.isElementAccessExpression(node) || ts2.isCallExpression(node)) && !ts2.isOptionalChain(node)) { + return node; + } + return void 0; + } + function convertOccurrences(checker, toConvert, occurrences) { + if (ts2.isPropertyAccessExpression(toConvert) || ts2.isElementAccessExpression(toConvert) || ts2.isCallExpression(toConvert)) { + var chain3 = convertOccurrences(checker, toConvert.expression, occurrences); + var lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : void 0; + var isOccurrence = (lastOccurrence === null || lastOccurrence === void 0 ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); + if (isOccurrence) + occurrences.pop(); + if (ts2.isCallExpression(toConvert)) { + return isOccurrence ? ts2.factory.createCallChain(chain3, ts2.factory.createToken( + 28 + /* SyntaxKind.QuestionDotToken */ + ), toConvert.typeArguments, toConvert.arguments) : ts2.factory.createCallChain(chain3, toConvert.questionDotToken, toConvert.typeArguments, toConvert.arguments); + } else if (ts2.isPropertyAccessExpression(toConvert)) { + return isOccurrence ? ts2.factory.createPropertyAccessChain(chain3, ts2.factory.createToken( + 28 + /* SyntaxKind.QuestionDotToken */ + ), toConvert.name) : ts2.factory.createPropertyAccessChain(chain3, toConvert.questionDotToken, toConvert.name); + } else if (ts2.isElementAccessExpression(toConvert)) { + return isOccurrence ? ts2.factory.createElementAccessChain(chain3, ts2.factory.createToken( + 28 + /* SyntaxKind.QuestionDotToken */ + ), toConvert.argumentExpression) : ts2.factory.createElementAccessChain(chain3, toConvert.questionDotToken, toConvert.argumentExpression); + } + } + return toConvert; + } + function doChange(sourceFile, checker, changes, info2, _actionName) { + var finalExpression = info2.finalExpression, occurrences = info2.occurrences, expression = info2.expression; + var firstOccurrence = occurrences[occurrences.length - 1]; + var convertedChain = convertOccurrences(checker, finalExpression, occurrences); + if (convertedChain && (ts2.isPropertyAccessExpression(convertedChain) || ts2.isElementAccessExpression(convertedChain) || ts2.isCallExpression(convertedChain))) { + if (ts2.isBinaryExpression(expression)) { + changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); + } else if (ts2.isConditionalExpression(expression)) { + changes.replaceNode(sourceFile, expression, ts2.factory.createBinaryExpression(convertedChain, ts2.factory.createToken( + 60 + /* SyntaxKind.QuestionQuestionToken */ + ), expression.whenFalse)); + } + } + } + })(convertToOptionalChainExpression = refactor2.convertToOptionalChainExpression || (refactor2.convertToOptionalChainExpression = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var addOrRemoveBracesToArrowFunction; + (function(addOrRemoveBracesToArrowFunction2) { + var refactorName = "Convert overload list to single signature"; + var refactorDescription = ts2.Diagnostics.Convert_overload_list_to_single_signature.message; + var functionOverloadAction = { + name: refactorName, + description: refactorDescription, + kind: "refactor.rewrite.function.overloadList" + }; + refactor2.registerRefactor(refactorName, { + kinds: [functionOverloadAction.kind], + getEditsForAction: getRefactorEditsToConvertOverloadsToOneSignature, + getAvailableActions: getRefactorActionsToConvertOverloadsToOneSignature + }); + function getRefactorActionsToConvertOverloadsToOneSignature(context2) { + var file = context2.file, startPosition = context2.startPosition, program = context2.program; + var info2 = getConvertableOverloadListAtPosition(file, startPosition, program); + if (!info2) + return ts2.emptyArray; + return [{ + name: refactorName, + description: refactorDescription, + actions: [functionOverloadAction] + }]; + } + function getRefactorEditsToConvertOverloadsToOneSignature(context2) { + var file = context2.file, startPosition = context2.startPosition, program = context2.program; + var signatureDecls = getConvertableOverloadListAtPosition(file, startPosition, program); + if (!signatureDecls) + return void 0; + var checker = program.getTypeChecker(); + var lastDeclaration = signatureDecls[signatureDecls.length - 1]; + var updated = lastDeclaration; + switch (lastDeclaration.kind) { + case 170: { + updated = ts2.factory.updateMethodSignature(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); + break; + } + case 171: { + updated = ts2.factory.updateMethodDeclaration(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.questionToken, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); + break; + } + case 176: { + updated = ts2.factory.updateCallSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); + break; + } + case 173: { + updated = ts2.factory.updateConstructorDeclaration(lastDeclaration, lastDeclaration.modifiers, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.body); + break; + } + case 177: { + updated = ts2.factory.updateConstructSignature(lastDeclaration, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type); + break; + } + case 259: { + updated = ts2.factory.updateFunctionDeclaration(lastDeclaration, lastDeclaration.modifiers, lastDeclaration.asteriskToken, lastDeclaration.name, lastDeclaration.typeParameters, getNewParametersForCombinedSignature(signatureDecls), lastDeclaration.type, lastDeclaration.body); + break; + } + default: + return ts2.Debug.failBadSyntaxKind(lastDeclaration, "Unhandled signature kind in overload list conversion refactoring"); + } + if (updated === lastDeclaration) { + return; + } + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + t8.replaceNodeRange(file, signatureDecls[0], signatureDecls[signatureDecls.length - 1], updated); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + function getNewParametersForCombinedSignature(signatureDeclarations) { + var lastSig = signatureDeclarations[signatureDeclarations.length - 1]; + if (ts2.isFunctionLikeDeclaration(lastSig) && lastSig.body) { + signatureDeclarations = signatureDeclarations.slice(0, signatureDeclarations.length - 1); + } + return ts2.factory.createNodeArray([ + ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createToken( + 25 + /* SyntaxKind.DotDotDotToken */ + ), + "args", + /*questionToken*/ + void 0, + ts2.factory.createUnionTypeNode(ts2.map(signatureDeclarations, convertSignatureParametersToTuple)) + ) + ]); + } + function convertSignatureParametersToTuple(decl) { + var members = ts2.map(decl.parameters, convertParameterToNamedTupleMember); + return ts2.setEmitFlags( + ts2.factory.createTupleTypeNode(members), + ts2.some(members, function(m7) { + return !!ts2.length(ts2.getSyntheticLeadingComments(m7)); + }) ? 0 : 1 + /* EmitFlags.SingleLine */ + ); + } + function convertParameterToNamedTupleMember(p7) { + ts2.Debug.assert(ts2.isIdentifier(p7.name)); + var result2 = ts2.setTextRange(ts2.factory.createNamedTupleMember(p7.dotDotDotToken, p7.name, p7.questionToken, p7.type || ts2.factory.createKeywordTypeNode( + 131 + /* SyntaxKind.AnyKeyword */ + )), p7); + var parameterDocComment = p7.symbol && p7.symbol.getDocumentationComment(checker); + if (parameterDocComment) { + var newComment = ts2.displayPartsToString(parameterDocComment); + if (newComment.length) { + ts2.setSyntheticLeadingComments(result2, [{ + text: "*\n".concat(newComment.split("\n").map(function(c7) { + return " * ".concat(c7); + }).join("\n"), "\n "), + kind: 3, + pos: -1, + end: -1, + hasTrailingNewLine: true, + hasLeadingNewline: true + }]); + } + } + return result2; + } + } + function isConvertableSignatureDeclaration(d7) { + switch (d7.kind) { + case 170: + case 171: + case 176: + case 173: + case 177: + case 259: + return true; + } + return false; + } + function getConvertableOverloadListAtPosition(file, startPosition, program) { + var node = ts2.getTokenAtPosition(file, startPosition); + var containingDecl = ts2.findAncestor(node, isConvertableSignatureDeclaration); + if (!containingDecl) { + return; + } + if (ts2.isFunctionLikeDeclaration(containingDecl) && containingDecl.body && ts2.rangeContainsPosition(containingDecl.body, startPosition)) { + return; + } + var checker = program.getTypeChecker(); + var signatureSymbol = containingDecl.symbol; + if (!signatureSymbol) { + return; + } + var decls = signatureSymbol.declarations; + if (ts2.length(decls) <= 1) { + return; + } + if (!ts2.every(decls, function(d7) { + return ts2.getSourceFileOfNode(d7) === file; + })) { + return; + } + if (!isConvertableSignatureDeclaration(decls[0])) { + return; + } + var kindOne = decls[0].kind; + if (!ts2.every(decls, function(d7) { + return d7.kind === kindOne; + })) { + return; + } + var signatureDecls = decls; + if (ts2.some(signatureDecls, function(d7) { + return !!d7.typeParameters || ts2.some(d7.parameters, function(p7) { + return !!p7.modifiers || !ts2.isIdentifier(p7.name); + }); + })) { + return; + } + var signatures = ts2.mapDefined(signatureDecls, function(d7) { + return checker.getSignatureFromDeclaration(d7); + }); + if (ts2.length(signatures) !== ts2.length(decls)) { + return; + } + var returnOne = checker.getReturnTypeOfSignature(signatures[0]); + if (!ts2.every(signatures, function(s7) { + return checker.getReturnTypeOfSignature(s7) === returnOne; + })) { + return; + } + return signatureDecls; + } + })(addOrRemoveBracesToArrowFunction = refactor2.addOrRemoveBracesToArrowFunction || (refactor2.addOrRemoveBracesToArrowFunction = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var extractSymbol; + (function(extractSymbol2) { + var refactorName = "Extract Symbol"; + var extractConstantAction = { + name: "Extract Constant", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_constant), + kind: "refactor.extract.constant" + }; + var extractFunctionAction = { + name: "Extract Function", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_function), + kind: "refactor.extract.function" + }; + refactor2.registerRefactor(refactorName, { + kinds: [ + extractConstantAction.kind, + extractFunctionAction.kind + ], + getEditsForAction: getRefactorEditsToExtractSymbol, + getAvailableActions: getRefactorActionsToExtractSymbol + }); + function getRefactorActionsToExtractSymbol(context2) { + var requestedRefactor = context2.kind; + var rangeToExtract = getRangeToExtract(context2.file, ts2.getRefactorContextSpan(context2), context2.triggerReason === "invoked"); + var targetRange = rangeToExtract.targetRange; + if (targetRange === void 0) { + if (!rangeToExtract.errors || rangeToExtract.errors.length === 0 || !context2.preferences.provideRefactorNotApplicableReason) { + return ts2.emptyArray; + } + var errors = []; + if (refactor2.refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { + errors.push({ + name: refactorName, + description: extractFunctionAction.description, + actions: [__assign16(__assign16({}, extractFunctionAction), { notApplicableReason: getStringError(rangeToExtract.errors) })] + }); + } + if (refactor2.refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { + errors.push({ + name: refactorName, + description: extractConstantAction.description, + actions: [__assign16(__assign16({}, extractConstantAction), { notApplicableReason: getStringError(rangeToExtract.errors) })] + }); + } + return errors; + } + var extractions = getPossibleExtractions(targetRange, context2); + if (extractions === void 0) { + return ts2.emptyArray; + } + var functionActions = []; + var usedFunctionNames = new ts2.Map(); + var innermostErrorFunctionAction; + var constantActions = []; + var usedConstantNames = new ts2.Map(); + var innermostErrorConstantAction; + var i7 = 0; + for (var _i = 0, extractions_1 = extractions; _i < extractions_1.length; _i++) { + var _a2 = extractions_1[_i], functionExtraction = _a2.functionExtraction, constantExtraction = _a2.constantExtraction; + if (refactor2.refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { + var description7 = functionExtraction.description; + if (functionExtraction.errors.length === 0) { + if (!usedFunctionNames.has(description7)) { + usedFunctionNames.set(description7, true); + functionActions.push({ + description: description7, + name: "function_scope_".concat(i7), + kind: extractFunctionAction.kind + }); + } + } else if (!innermostErrorFunctionAction) { + innermostErrorFunctionAction = { + description: description7, + name: "function_scope_".concat(i7), + notApplicableReason: getStringError(functionExtraction.errors), + kind: extractFunctionAction.kind + }; + } + } + if (refactor2.refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { + var description7 = constantExtraction.description; + if (constantExtraction.errors.length === 0) { + if (!usedConstantNames.has(description7)) { + usedConstantNames.set(description7, true); + constantActions.push({ + description: description7, + name: "constant_scope_".concat(i7), + kind: extractConstantAction.kind + }); + } + } else if (!innermostErrorConstantAction) { + innermostErrorConstantAction = { + description: description7, + name: "constant_scope_".concat(i7), + notApplicableReason: getStringError(constantExtraction.errors), + kind: extractConstantAction.kind + }; + } + } + i7++; + } + var infos = []; + if (functionActions.length) { + infos.push({ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_function), + actions: functionActions + }); + } else if (context2.preferences.provideRefactorNotApplicableReason && innermostErrorFunctionAction) { + infos.push({ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_function), + actions: [innermostErrorFunctionAction] + }); + } + if (constantActions.length) { + infos.push({ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_constant), + actions: constantActions + }); + } else if (context2.preferences.provideRefactorNotApplicableReason && innermostErrorConstantAction) { + infos.push({ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_constant), + actions: [innermostErrorConstantAction] + }); + } + return infos.length ? infos : ts2.emptyArray; + function getStringError(errors2) { + var error2 = errors2[0].messageText; + if (typeof error2 !== "string") { + error2 = error2.messageText; + } + return error2; + } + } + extractSymbol2.getRefactorActionsToExtractSymbol = getRefactorActionsToExtractSymbol; + function getRefactorEditsToExtractSymbol(context2, actionName) { + var rangeToExtract = getRangeToExtract(context2.file, ts2.getRefactorContextSpan(context2)); + var targetRange = rangeToExtract.targetRange; + var parsedFunctionIndexMatch = /^function_scope_(\d+)$/.exec(actionName); + if (parsedFunctionIndexMatch) { + var index4 = +parsedFunctionIndexMatch[1]; + ts2.Debug.assert(isFinite(index4), "Expected to parse a finite number from the function scope index"); + return getFunctionExtractionAtIndex(targetRange, context2, index4); + } + var parsedConstantIndexMatch = /^constant_scope_(\d+)$/.exec(actionName); + if (parsedConstantIndexMatch) { + var index4 = +parsedConstantIndexMatch[1]; + ts2.Debug.assert(isFinite(index4), "Expected to parse a finite number from the constant scope index"); + return getConstantExtractionAtIndex(targetRange, context2, index4); + } + ts2.Debug.fail("Unrecognized action name"); + } + extractSymbol2.getRefactorEditsToExtractSymbol = getRefactorEditsToExtractSymbol; + var Messages6; + (function(Messages7) { + function createMessage(message) { + return { message, code: 0, category: ts2.DiagnosticCategory.Message, key: message }; + } + Messages7.cannotExtractRange = createMessage("Cannot extract range."); + Messages7.cannotExtractImport = createMessage("Cannot extract import statement."); + Messages7.cannotExtractSuper = createMessage("Cannot extract super call."); + Messages7.cannotExtractJSDoc = createMessage("Cannot extract JSDoc."); + Messages7.cannotExtractEmpty = createMessage("Cannot extract empty range."); + Messages7.expressionExpected = createMessage("expression expected."); + Messages7.uselessConstantType = createMessage("No reason to extract constant of type."); + Messages7.statementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages7.cannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages7.cannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages7.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages7.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages7.typeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages7.functionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages7.cannotExtractIdentifier = createMessage("Select more than a single identifier."); + Messages7.cannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages7.cannotWriteInExpression = createMessage("Cannot write back side-effects when extracting an expression"); + Messages7.cannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages7.cannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + Messages7.cannotAccessVariablesFromNestedScopes = createMessage("Cannot access variables from nested scopes"); + Messages7.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); + Messages7.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); + Messages7.cannotExtractFunctionsContainingThisToMethod = createMessage("Cannot extract functions containing this to method"); + })(Messages6 = extractSymbol2.Messages || (extractSymbol2.Messages = {})); + var RangeFacts; + (function(RangeFacts2) { + RangeFacts2[RangeFacts2["None"] = 0] = "None"; + RangeFacts2[RangeFacts2["HasReturn"] = 1] = "HasReturn"; + RangeFacts2[RangeFacts2["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts2[RangeFacts2["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts2[RangeFacts2["UsesThis"] = 8] = "UsesThis"; + RangeFacts2[RangeFacts2["UsesThisInFunction"] = 16] = "UsesThisInFunction"; + RangeFacts2[RangeFacts2["InStaticRegion"] = 32] = "InStaticRegion"; + })(RangeFacts || (RangeFacts = {})); + function getRangeToExtract(sourceFile, span, invoked) { + if (invoked === void 0) { + invoked = true; + } + var length = span.length; + if (length === 0 && !invoked) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractEmpty)] }; + } + var cursorRequest = length === 0 && invoked; + var startToken = ts2.findFirstNonJsxWhitespaceToken(sourceFile, span.start); + var endToken = ts2.findTokenOnLeftOfPosition(sourceFile, ts2.textSpanEnd(span)); + var adjustedSpan = startToken && endToken && invoked ? getAdjustedSpanFromNodes(startToken, endToken, sourceFile) : span; + var start = cursorRequest ? getExtractableParent(startToken) : ts2.getParentNodeInSpan(startToken, sourceFile, adjustedSpan); + var end = cursorRequest ? start : ts2.getParentNodeInSpan(endToken, sourceFile, adjustedSpan); + var rangeFacts = RangeFacts.None; + var thisNode; + if (!start || !end) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractRange)] }; + } + if (start.flags & 8388608) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractJSDoc)] }; + } + if (start.parent !== end.parent) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractRange)] }; + } + if (start !== end) { + if (!isBlockLike(start.parent)) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractRange)] }; + } + var statements = []; + for (var _i = 0, _a2 = start.parent.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (statement === start || statements.length) { + var errors_1 = checkNode(statement); + if (errors_1) { + return { errors: errors_1 }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + if (!statements.length) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractRange)] }; + } + return { targetRange: { range: statements, facts: rangeFacts, thisNode } }; + } + if (ts2.isReturnStatement(start) && !start.expression) { + return { errors: [ts2.createFileDiagnostic(sourceFile, span.start, length, Messages6.cannotExtractRange)] }; + } + var node = refineNode(start); + var errors = checkRootNode(node) || checkNode(node); + if (errors) { + return { errors }; + } + return { targetRange: { range: getStatementOrExpressionRange(node), facts: rangeFacts, thisNode } }; + function refineNode(node2) { + if (ts2.isReturnStatement(node2)) { + if (node2.expression) { + return node2.expression; + } + } else if (ts2.isVariableStatement(node2) || ts2.isVariableDeclarationList(node2)) { + var declarations = ts2.isVariableStatement(node2) ? node2.declarationList.declarations : node2.declarations; + var numInitializers = 0; + var lastInitializer = void 0; + for (var _i2 = 0, declarations_5 = declarations; _i2 < declarations_5.length; _i2++) { + var declaration = declarations_5[_i2]; + if (declaration.initializer) { + numInitializers++; + lastInitializer = declaration.initializer; + } + } + if (numInitializers === 1) { + return lastInitializer; + } + } else if (ts2.isVariableDeclaration(node2)) { + if (node2.initializer) { + return node2.initializer; + } + } + return node2; + } + function checkRootNode(node2) { + if (ts2.isIdentifier(ts2.isExpressionStatement(node2) ? node2.expression : node2)) { + return [ts2.createDiagnosticForNode(node2, Messages6.cannotExtractIdentifier)]; + } + return void 0; + } + function checkForStaticContext(nodeToCheck, containingClass) { + var current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 169) { + if (ts2.isStatic(current)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } else if (current.kind === 166) { + var ctorOrMethod = ts2.getContainingFunction(current); + if (ctorOrMethod.kind === 173) { + rangeFacts |= RangeFacts.InStaticRegion; + } + break; + } else if (current.kind === 171) { + if (ts2.isStatic(current)) { + rangeFacts |= RangeFacts.InStaticRegion; + } + } + current = current.parent; + } + } + function checkNode(nodeToCheck) { + var PermittedJumps; + (function(PermittedJumps2) { + PermittedJumps2[PermittedJumps2["None"] = 0] = "None"; + PermittedJumps2[PermittedJumps2["Break"] = 1] = "Break"; + PermittedJumps2[PermittedJumps2["Continue"] = 2] = "Continue"; + PermittedJumps2[PermittedJumps2["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + ts2.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"); + ts2.Debug.assert(!ts2.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"); + if (!ts2.isStatement(nodeToCheck) && !(ts2.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck)) && !isStringLiteralJsxAttribute(nodeToCheck)) { + return [ts2.createDiagnosticForNode(nodeToCheck, Messages6.statementOrExpressionExpected)]; + } + if (nodeToCheck.flags & 16777216) { + return [ts2.createDiagnosticForNode(nodeToCheck, Messages6.cannotExtractAmbientBlock)]; + } + var containingClass = ts2.getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + var errors2; + var permittedJumps = 4; + var seenLabels; + visit7(nodeToCheck); + if (rangeFacts & RangeFacts.UsesThis) { + var container = ts2.getThisContainer( + nodeToCheck, + /** includeArrowFunctions */ + false + ); + if (container.kind === 259 || container.kind === 171 && container.parent.kind === 207 || container.kind === 215) { + rangeFacts |= RangeFacts.UsesThisInFunction; + } + } + return errors2; + function visit7(node2) { + if (errors2) { + return true; + } + if (ts2.isDeclaration(node2)) { + var declaringNode = node2.kind === 257 ? node2.parent.parent : node2; + if (ts2.hasSyntacticModifier( + declaringNode, + 1 + /* ModifierFlags.Export */ + )) { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractExportedEntity)); + return true; + } + } + switch (node2.kind) { + case 269: + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractImport)); + return true; + case 274: + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractExportedEntity)); + return true; + case 106: + if (node2.parent.kind === 210) { + var containingClass_1 = ts2.getContainingClass(node2); + if (containingClass_1 === void 0 || containingClass_1.pos < span.start || containingClass_1.end >= span.start + span.length) { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractSuper)); + return true; + } + } else { + rangeFacts |= RangeFacts.UsesThis; + thisNode = node2; + } + break; + case 216: + ts2.forEachChild(node2, function check(n7) { + if (ts2.isThis(n7)) { + rangeFacts |= RangeFacts.UsesThis; + thisNode = node2; + } else if (ts2.isClassLike(n7) || ts2.isFunctionLike(n7) && !ts2.isArrowFunction(n7)) { + return false; + } else { + ts2.forEachChild(n7, check); + } + }); + case 260: + case 259: + if (ts2.isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.functionWillNotBeVisibleInTheNewScope)); + } + case 228: + case 215: + case 171: + case 173: + case 174: + case 175: + return false; + } + var savedPermittedJumps = permittedJumps; + switch (node2.kind) { + case 242: + permittedJumps &= ~4; + break; + case 255: + permittedJumps = 0; + break; + case 238: + if (node2.parent && node2.parent.kind === 255 && node2.parent.finallyBlock === node2) { + permittedJumps = 4; + } + break; + case 293: + case 292: + permittedJumps |= 1; + break; + default: + if (ts2.isIterationStatement( + node2, + /*lookInLabeledStatements*/ + false + )) { + permittedJumps |= 1 | 2; + } + break; + } + switch (node2.kind) { + case 194: + case 108: + rangeFacts |= RangeFacts.UsesThis; + thisNode = node2; + break; + case 253: { + var label = node2.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + ts2.forEachChild(node2, visit7); + seenLabels.pop(); + break; + } + case 249: + case 248: { + var label = node2.label; + if (label) { + if (!ts2.contains(seenLabels, label.escapedText)) { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } else { + if (!(permittedJumps & (node2.kind === 249 ? 1 : 2))) { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 220: + rangeFacts |= RangeFacts.IsAsyncFunction; + break; + case 226: + rangeFacts |= RangeFacts.IsGenerator; + break; + case 250: + if (permittedJumps & 4) { + rangeFacts |= RangeFacts.HasReturn; + } else { + (errors2 || (errors2 = [])).push(ts2.createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + ts2.forEachChild(node2, visit7); + break; + } + permittedJumps = savedPermittedJumps; + } + } + } + extractSymbol2.getRangeToExtract = getRangeToExtract; + function getAdjustedSpanFromNodes(startNode, endNode, sourceFile) { + var start = startNode.getStart(sourceFile); + var end = endNode.getEnd(); + if (sourceFile.text.charCodeAt(end) === 59) { + end++; + } + return { start, length: end - start }; + } + function getStatementOrExpressionRange(node) { + if (ts2.isStatement(node)) { + return [node]; + } + if (ts2.isExpressionNode(node)) { + return ts2.isExpressionStatement(node.parent) ? [node.parent] : node; + } + if (isStringLiteralJsxAttribute(node)) { + return node; + } + return void 0; + } + function isScope(node) { + return ts2.isArrowFunction(node) ? ts2.isFunctionBody(node.body) : ts2.isFunctionLikeDeclaration(node) || ts2.isSourceFile(node) || ts2.isModuleBlock(node) || ts2.isClassLike(node); + } + function collectEnclosingScopes(range2) { + var current = isReadonlyArray(range2.range) ? ts2.first(range2.range) : range2.range; + if (range2.facts & RangeFacts.UsesThis && !(range2.facts & RangeFacts.UsesThisInFunction)) { + var containingClass = ts2.getContainingClass(current); + if (containingClass) { + var containingFunction = ts2.findAncestor(current, ts2.isFunctionLikeDeclaration); + return containingFunction ? [containingFunction, containingClass] : [containingClass]; + } + } + var scopes = []; + while (true) { + current = current.parent; + if (current.kind === 166) { + current = ts2.findAncestor(current, function(parent2) { + return ts2.isFunctionLikeDeclaration(parent2); + }).parent; + } + if (isScope(current)) { + scopes.push(current); + if (current.kind === 308) { + return scopes; + } + } + } + } + function getFunctionExtractionAtIndex(targetRange, context2, requestedChangesIndex) { + var _a2 = getPossibleExtractionsWorker(targetRange, context2), scopes = _a2.scopes, _b = _a2.readsAndWrites, target = _b.target, usagesPerScope = _b.usagesPerScope, functionErrorsPerScope = _b.functionErrorsPerScope, exposedVariableDeclarations = _b.exposedVariableDeclarations; + ts2.Debug.assert(!functionErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); + context2.cancellationToken.throwIfCancellationRequested(); + return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context2); + } + function getConstantExtractionAtIndex(targetRange, context2, requestedChangesIndex) { + var _a2 = getPossibleExtractionsWorker(targetRange, context2), scopes = _a2.scopes, _b = _a2.readsAndWrites, target = _b.target, usagesPerScope = _b.usagesPerScope, constantErrorsPerScope = _b.constantErrorsPerScope, exposedVariableDeclarations = _b.exposedVariableDeclarations; + ts2.Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); + ts2.Debug.assert(exposedVariableDeclarations.length === 0, "Extract constant accepted a range containing a variable declaration?"); + context2.cancellationToken.throwIfCancellationRequested(); + var expression = ts2.isExpression(target) ? target : target.statements[0].expression; + return extractConstantInScope(expression, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange.facts, context2); + } + function getPossibleExtractions(targetRange, context2) { + var _a2 = getPossibleExtractionsWorker(targetRange, context2), scopes = _a2.scopes, _b = _a2.readsAndWrites, functionErrorsPerScope = _b.functionErrorsPerScope, constantErrorsPerScope = _b.constantErrorsPerScope; + var extractions = scopes.map(function(scope, i7) { + var functionDescriptionPart = getDescriptionForFunctionInScope(scope); + var constantDescriptionPart = getDescriptionForConstantInScope(scope); + var scopeDescription = ts2.isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : ts2.isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); + var functionDescription; + var constantDescription; + if (scopeDescription === 1) { + functionDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); + constantDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); + } else if (scopeDescription === 0) { + functionDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); + constantDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); + } else { + functionDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1), [functionDescriptionPart, scopeDescription]); + constantDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_1), [constantDescriptionPart, scopeDescription]); + } + if (i7 === 0 && !ts2.isClassLike(scope)) { + constantDescription = ts2.formatStringFromArgs(ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_0_in_enclosing_scope), [constantDescriptionPart]); + } + return { + functionExtraction: { + description: functionDescription, + errors: functionErrorsPerScope[i7] + }, + constantExtraction: { + description: constantDescription, + errors: constantErrorsPerScope[i7] + } + }; + }); + return extractions; + } + function getPossibleExtractionsWorker(targetRange, context2) { + var sourceFile = context2.file; + var scopes = collectEnclosingScopes(targetRange); + var enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + var readsAndWrites = collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, context2.program.getTypeChecker(), context2.cancellationToken); + return { scopes, readsAndWrites }; + } + function getDescriptionForFunctionInScope(scope) { + return ts2.isFunctionLikeDeclaration(scope) ? "inner function" : ts2.isClassLike(scope) ? "method" : "function"; + } + function getDescriptionForConstantInScope(scope) { + return ts2.isClassLike(scope) ? "readonly field" : "constant"; + } + function getDescriptionForFunctionLikeDeclaration(scope) { + switch (scope.kind) { + case 173: + return "constructor"; + case 215: + case 259: + return scope.name ? "function '".concat(scope.name.text, "'") : ts2.ANONYMOUS; + case 216: + return "arrow function"; + case 171: + return "method '".concat(scope.name.getText(), "'"); + case 174: + return "'get ".concat(scope.name.getText(), "'"); + case 175: + return "'set ".concat(scope.name.getText(), "'"); + default: + throw ts2.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind)); + } + } + function getDescriptionForClassLikeDeclaration(scope) { + return scope.kind === 260 ? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration" : scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression"; + } + function getDescriptionForModuleLikeDeclaration(scope) { + return scope.kind === 265 ? "namespace '".concat(scope.parent.name.getText(), "'") : scope.externalModuleIndicator ? 0 : 1; + } + var SpecialScope; + (function(SpecialScope2) { + SpecialScope2[SpecialScope2["Module"] = 0] = "Module"; + SpecialScope2[SpecialScope2["Global"] = 1] = "Global"; + })(SpecialScope || (SpecialScope = {})); + function extractFunctionInScope(node, scope, _a2, exposedVariableDeclarations, range2, context2) { + var usagesInScope = _a2.usages, typeParameterUsages = _a2.typeParameterUsages, substitutions = _a2.substitutions; + var checker = context2.program.getTypeChecker(); + var scriptTarget = ts2.getEmitScriptTarget(context2.program.getCompilerOptions()); + var importAdder = ts2.codefix.createImportAdder(context2.file, context2.program, context2.preferences, context2.host); + var file = scope.getSourceFile(); + var functionNameText = ts2.getUniqueName(ts2.isClassLike(scope) ? "newMethod" : "newFunction", file); + var isJS = ts2.isInJSFile(scope); + var functionName = ts2.factory.createIdentifier(functionNameText); + var returnType; + var parameters = []; + var callArguments = []; + var writes; + usagesInScope.forEach(function(usage, name2) { + var typeNode; + if (!isJS) { + var type3 = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + type3 = checker.getBaseTypeOfLiteralType(type3); + typeNode = ts2.codefix.typeToAutoImportableTypeNode( + checker, + importAdder, + type3, + scope, + scriptTarget, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + } + var paramDecl = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + name2, + /*questionToken*/ + void 0, + typeNode + ); + parameters.push(paramDecl); + if (usage.usage === 2) { + (writes || (writes = [])).push(usage); + } + callArguments.push(ts2.factory.createIdentifier(name2)); + }); + var typeParametersAndDeclarations = ts2.arrayFrom(typeParameterUsages.values()).map(function(type3) { + return { type: type3, declaration: getFirstDeclaration(type3) }; + }); + var sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder); + var typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations.map(function(t8) { + return t8.declaration; + }); + var callTypeArguments = typeParameters !== void 0 ? typeParameters.map(function(decl) { + return ts2.factory.createTypeReferenceNode( + decl.name, + /*typeArguments*/ + void 0 + ); + }) : void 0; + if (ts2.isExpression(node) && !isJS) { + var contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode( + contextualType, + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + } + var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range2.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty; + ts2.suppressLeadingAndTrailingTrivia(body); + var newFunction; + var callThis = !!(range2.facts & RangeFacts.UsesThisInFunction); + if (ts2.isClassLike(scope)) { + var modifiers = isJS ? [] : [ts2.factory.createModifier( + 121 + /* SyntaxKind.PrivateKeyword */ + )]; + if (range2.facts & RangeFacts.InStaticRegion) { + modifiers.push(ts2.factory.createModifier( + 124 + /* SyntaxKind.StaticKeyword */ + )); + } + if (range2.facts & RangeFacts.IsAsyncFunction) { + modifiers.push(ts2.factory.createModifier( + 132 + /* SyntaxKind.AsyncKeyword */ + )); + } + newFunction = ts2.factory.createMethodDeclaration( + modifiers.length ? modifiers : void 0, + range2.facts & RangeFacts.IsGenerator ? ts2.factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ) : void 0, + functionName, + /*questionToken*/ + void 0, + typeParameters, + parameters, + returnType, + body + ); + } else { + if (callThis) { + parameters.unshift(ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + "this", + /*questionToken*/ + void 0, + checker.typeToTypeNode( + checker.getTypeAtLocation(range2.thisNode), + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ), + /*initializer*/ + void 0 + )); + } + newFunction = ts2.factory.createFunctionDeclaration(range2.facts & RangeFacts.IsAsyncFunction ? [ts2.factory.createToken( + 132 + /* SyntaxKind.AsyncKeyword */ + )] : void 0, range2.facts & RangeFacts.IsGenerator ? ts2.factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ) : void 0, functionName, typeParameters, parameters, returnType, body); + } + var changeTracker = ts2.textChanges.ChangeTracker.fromContext(context2); + var minInsertionPos = (isReadonlyArray(range2.range) ? ts2.last(range2.range) : range2.range).end; + var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); + if (nodeToInsertBefore) { + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newFunction, + /*blankLineBetween*/ + true + ); + } else { + changeTracker.insertNodeAtEndOfScope(context2.file, scope, newFunction); + } + importAdder.writeFixes(changeTracker); + var newNodes = []; + var called = getCalledExpression(scope, range2, functionNameText); + if (callThis) { + callArguments.unshift(ts2.factory.createIdentifier("this")); + } + var call = ts2.factory.createCallExpression( + callThis ? ts2.factory.createPropertyAccessExpression(called, "call") : called, + callTypeArguments, + // Note that no attempt is made to take advantage of type argument inference + callArguments + ); + if (range2.facts & RangeFacts.IsGenerator) { + call = ts2.factory.createYieldExpression(ts2.factory.createToken( + 41 + /* SyntaxKind.AsteriskToken */ + ), call); + } + if (range2.facts & RangeFacts.IsAsyncFunction) { + call = ts2.factory.createAwaitExpression(call); + } + if (isInJSXContent(node)) { + call = ts2.factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + call + ); + } + if (exposedVariableDeclarations.length && !writes) { + ts2.Debug.assert(!returnValueProperty, "Expected no returnValueProperty"); + ts2.Debug.assert(!(range2.facts & RangeFacts.HasReturn), "Expected RangeFacts.HasReturn flag to be unset"); + if (exposedVariableDeclarations.length === 1) { + var variableDeclaration = exposedVariableDeclarations[0]; + newNodes.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ts2.factory.createVariableDeclaration( + ts2.getSynthesizedDeepClone(variableDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + ts2.getSynthesizedDeepClone(variableDeclaration.type), + /*initializer*/ + call + )], + // TODO (acasey): test binding patterns + variableDeclaration.parent.flags + ) + )); + } else { + var bindingElements = []; + var typeElements = []; + var commonNodeFlags = exposedVariableDeclarations[0].parent.flags; + var sawExplicitType = false; + for (var _i = 0, exposedVariableDeclarations_1 = exposedVariableDeclarations; _i < exposedVariableDeclarations_1.length; _i++) { + var variableDeclaration = exposedVariableDeclarations_1[_i]; + bindingElements.push(ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + /*name*/ + ts2.getSynthesizedDeepClone(variableDeclaration.name) + )); + var variableType = checker.typeToTypeNode( + checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + typeElements.push(ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + /*name*/ + variableDeclaration.symbol.name, + /*questionToken*/ + void 0, + /*type*/ + variableType + )); + sawExplicitType = sawExplicitType || variableDeclaration.type !== void 0; + commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags; + } + var typeLiteral = sawExplicitType ? ts2.factory.createTypeLiteralNode(typeElements) : void 0; + if (typeLiteral) { + ts2.setEmitFlags( + typeLiteral, + 1 + /* EmitFlags.SingleLine */ + ); + } + newNodes.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList([ts2.factory.createVariableDeclaration( + ts2.factory.createObjectBindingPattern(bindingElements), + /*exclamationToken*/ + void 0, + /*type*/ + typeLiteral, + /*initializer*/ + call + )], commonNodeFlags) + )); + } + } else if (exposedVariableDeclarations.length || writes) { + if (exposedVariableDeclarations.length) { + for (var _c = 0, exposedVariableDeclarations_2 = exposedVariableDeclarations; _c < exposedVariableDeclarations_2.length; _c++) { + var variableDeclaration = exposedVariableDeclarations_2[_c]; + var flags = variableDeclaration.parent.flags; + if (flags & 2) { + flags = flags & ~2 | 1; + } + newNodes.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList([ts2.factory.createVariableDeclaration( + variableDeclaration.symbol.name, + /*exclamationToken*/ + void 0, + getTypeDeepCloneUnionUndefined(variableDeclaration.type) + )], flags) + )); + } + } + if (returnValueProperty) { + newNodes.push(ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [ts2.factory.createVariableDeclaration( + returnValueProperty, + /*exclamationToken*/ + void 0, + getTypeDeepCloneUnionUndefined(returnType) + )], + 1 + /* NodeFlags.Let */ + ) + )); + } + var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (returnValueProperty) { + assignments.unshift(ts2.factory.createShorthandPropertyAssignment(returnValueProperty)); + } + if (assignments.length === 1) { + ts2.Debug.assert(!returnValueProperty, "Shouldn't have returnValueProperty here"); + newNodes.push(ts2.factory.createExpressionStatement(ts2.factory.createAssignment(assignments[0].name, call))); + if (range2.facts & RangeFacts.HasReturn) { + newNodes.push(ts2.factory.createReturnStatement()); + } + } else { + newNodes.push(ts2.factory.createExpressionStatement(ts2.factory.createAssignment(ts2.factory.createObjectLiteralExpression(assignments), call))); + if (returnValueProperty) { + newNodes.push(ts2.factory.createReturnStatement(ts2.factory.createIdentifier(returnValueProperty))); + } + } + } else { + if (range2.facts & RangeFacts.HasReturn) { + newNodes.push(ts2.factory.createReturnStatement(call)); + } else if (isReadonlyArray(range2.range)) { + newNodes.push(ts2.factory.createExpressionStatement(call)); + } else { + newNodes.push(call); + } + } + if (isReadonlyArray(range2.range)) { + changeTracker.replaceNodeRangeWithNodes(context2.file, ts2.first(range2.range), ts2.last(range2.range), newNodes); + } else { + changeTracker.replaceNodeWithNodes(context2.file, range2.range, newNodes); + } + var edits = changeTracker.getChanges(); + var renameRange = isReadonlyArray(range2.range) ? ts2.first(range2.range) : range2.range; + var renameFilename = renameRange.getSourceFile().fileName; + var renameLocation = ts2.getRenameLocation( + edits, + renameFilename, + functionNameText, + /*isDeclaredBeforeUse*/ + false + ); + return { renameFilename, renameLocation, edits }; + function getTypeDeepCloneUnionUndefined(typeNode) { + if (typeNode === void 0) { + return void 0; + } + var clone2 = ts2.getSynthesizedDeepClone(typeNode); + var withoutParens = clone2; + while (ts2.isParenthesizedTypeNode(withoutParens)) { + withoutParens = withoutParens.type; + } + return ts2.isUnionTypeNode(withoutParens) && ts2.find(withoutParens.types, function(t8) { + return t8.kind === 155; + }) ? clone2 : ts2.factory.createUnionTypeNode([clone2, ts2.factory.createKeywordTypeNode( + 155 + /* SyntaxKind.UndefinedKeyword */ + )]); + } + } + function extractConstantInScope(node, scope, _a2, rangeFacts, context2) { + var _b; + var substitutions = _a2.substitutions; + var checker = context2.program.getTypeChecker(); + var file = scope.getSourceFile(); + var localNameText = ts2.isPropertyAccessExpression(node) && !ts2.isClassLike(scope) && !checker.resolveName( + node.name.text, + node, + 111551, + /*excludeGlobals*/ + false + ) && !ts2.isPrivateIdentifier(node.name) && !ts2.isKeyword(node.name.originalKeywordKind) ? node.name.text : ts2.getUniqueName(ts2.isClassLike(scope) ? "newProperty" : "newLocal", file); + var isJS = ts2.isInJSFile(scope); + var variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode( + checker.getContextualType(node), + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + var initializer = transformConstantInitializer(ts2.skipParentheses(node), substitutions); + _b = transformFunctionInitializerAndType(variableType, initializer), variableType = _b.variableType, initializer = _b.initializer; + ts2.suppressLeadingAndTrailingTrivia(initializer); + var changeTracker = ts2.textChanges.ChangeTracker.fromContext(context2); + if (ts2.isClassLike(scope)) { + ts2.Debug.assert(!isJS, "Cannot extract to a JS class"); + var modifiers = []; + modifiers.push(ts2.factory.createModifier( + 121 + /* SyntaxKind.PrivateKeyword */ + )); + if (rangeFacts & RangeFacts.InStaticRegion) { + modifiers.push(ts2.factory.createModifier( + 124 + /* SyntaxKind.StaticKeyword */ + )); + } + modifiers.push(ts2.factory.createModifier( + 146 + /* SyntaxKind.ReadonlyKeyword */ + )); + var newVariable = ts2.factory.createPropertyDeclaration( + modifiers, + localNameText, + /*questionToken*/ + void 0, + variableType, + initializer + ); + var localReference = ts2.factory.createPropertyAccessExpression(rangeFacts & RangeFacts.InStaticRegion ? ts2.factory.createIdentifier(scope.name.getText()) : ts2.factory.createThis(), ts2.factory.createIdentifier(localNameText)); + if (isInJSXContent(node)) { + localReference = ts2.factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + localReference + ); + } + var maxInsertionPos = node.pos; + var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newVariable, + /*blankLineBetween*/ + true + ); + changeTracker.replaceNode(context2.file, node, localReference); + } else { + var newVariableDeclaration = ts2.factory.createVariableDeclaration( + localNameText, + /*exclamationToken*/ + void 0, + variableType, + initializer + ); + var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); + if (oldVariableDeclaration) { + changeTracker.insertNodeBefore(context2.file, oldVariableDeclaration, newVariableDeclaration); + var localReference = ts2.factory.createIdentifier(localNameText); + changeTracker.replaceNode(context2.file, node, localReference); + } else if (node.parent.kind === 241 && scope === ts2.findAncestor(node, isScope)) { + var newVariableStatement = ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [newVariableDeclaration], + 2 + /* NodeFlags.Const */ + ) + ); + changeTracker.replaceNode(context2.file, node.parent, newVariableStatement); + } else { + var newVariableStatement = ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList( + [newVariableDeclaration], + 2 + /* NodeFlags.Const */ + ) + ); + var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); + if (nodeToInsertBefore.pos === 0) { + changeTracker.insertNodeAtTopOfFile( + context2.file, + newVariableStatement, + /*blankLineBetween*/ + false + ); + } else { + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newVariableStatement, + /*blankLineBetween*/ + false + ); + } + if (node.parent.kind === 241) { + changeTracker.delete(context2.file, node.parent); + } else { + var localReference = ts2.factory.createIdentifier(localNameText); + if (isInJSXContent(node)) { + localReference = ts2.factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + localReference + ); + } + changeTracker.replaceNode(context2.file, node, localReference); + } + } + } + var edits = changeTracker.getChanges(); + var renameFilename = node.getSourceFile().fileName; + var renameLocation = ts2.getRenameLocation( + edits, + renameFilename, + localNameText, + /*isDeclaredBeforeUse*/ + true + ); + return { renameFilename, renameLocation, edits }; + function transformFunctionInitializerAndType(variableType2, initializer2) { + if (variableType2 === void 0) + return { variableType: variableType2, initializer: initializer2 }; + if (!ts2.isFunctionExpression(initializer2) && !ts2.isArrowFunction(initializer2) || !!initializer2.typeParameters) + return { variableType: variableType2, initializer: initializer2 }; + var functionType2 = checker.getTypeAtLocation(node); + var functionSignature = ts2.singleOrUndefined(checker.getSignaturesOfType( + functionType2, + 0 + /* SignatureKind.Call */ + )); + if (!functionSignature) + return { variableType: variableType2, initializer: initializer2 }; + if (!!functionSignature.getTypeParameters()) + return { variableType: variableType2, initializer: initializer2 }; + var parameters = []; + var hasAny = false; + for (var _i = 0, _a3 = initializer2.parameters; _i < _a3.length; _i++) { + var p7 = _a3[_i]; + if (p7.type) { + parameters.push(p7); + } else { + var paramType = checker.getTypeAtLocation(p7); + if (paramType === checker.getAnyType()) + hasAny = true; + parameters.push(ts2.factory.updateParameterDeclaration(p7, p7.modifiers, p7.dotDotDotToken, p7.name, p7.questionToken, p7.type || checker.typeToTypeNode( + paramType, + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ), p7.initializer)); + } + } + if (hasAny) + return { variableType: variableType2, initializer: initializer2 }; + variableType2 = void 0; + if (ts2.isArrowFunction(initializer2)) { + initializer2 = ts2.factory.updateArrowFunction(initializer2, ts2.canHaveModifiers(node) ? ts2.getModifiers(node) : void 0, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode( + functionSignature.getReturnType(), + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ), initializer2.equalsGreaterThanToken, initializer2.body); + } else { + if (functionSignature && !!functionSignature.thisParameter) { + var firstParameter = ts2.firstOrUndefined(parameters); + if (!firstParameter || ts2.isIdentifier(firstParameter.name) && firstParameter.name.escapedText !== "this") { + var thisType = checker.getTypeOfSymbolAtLocation(functionSignature.thisParameter, node); + parameters.splice(0, 0, ts2.factory.createParameterDeclaration( + /* modifiers */ + void 0, + /* dotDotDotToken */ + void 0, + "this", + /* questionToken */ + void 0, + checker.typeToTypeNode( + thisType, + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ) + )); + } + } + initializer2 = ts2.factory.updateFunctionExpression(initializer2, ts2.canHaveModifiers(node) ? ts2.getModifiers(node) : void 0, initializer2.asteriskToken, initializer2.name, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode( + functionSignature.getReturnType(), + scope, + 1 + /* NodeBuilderFlags.NoTruncation */ + ), initializer2.body); + } + return { variableType: variableType2, initializer: initializer2 }; + } + } + function getContainingVariableDeclarationIfInList(node, scope) { + var prevNode; + while (node !== void 0 && node !== scope) { + if (ts2.isVariableDeclaration(node) && node.initializer === prevNode && ts2.isVariableDeclarationList(node.parent) && node.parent.declarations.length > 1) { + return node; + } + prevNode = node; + node = node.parent; + } + } + function getFirstDeclaration(type3) { + var firstDeclaration; + var symbol = type3.symbol; + if (symbol && symbol.declarations) { + for (var _i = 0, _a2 = symbol.declarations; _i < _a2.length; _i++) { + var declaration = _a2[_i]; + if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) { + firstDeclaration = declaration; + } + } + } + return firstDeclaration; + } + function compareTypesByDeclarationOrder(_a2, _b) { + var type1 = _a2.type, declaration1 = _a2.declaration; + var type22 = _b.type, declaration2 = _b.declaration; + return ts2.compareProperties(declaration1, declaration2, "pos", ts2.compareValues) || ts2.compareStringsCaseSensitive(type1.symbol ? type1.symbol.getName() : "", type22.symbol ? type22.symbol.getName() : "") || ts2.compareValues(type1.id, type22.id); + } + function getCalledExpression(scope, range2, functionNameText) { + var functionReference = ts2.factory.createIdentifier(functionNameText); + if (ts2.isClassLike(scope)) { + var lhs = range2.facts & RangeFacts.InStaticRegion ? ts2.factory.createIdentifier(scope.name.text) : ts2.factory.createThis(); + return ts2.factory.createPropertyAccessExpression(lhs, functionReference); + } else { + return functionReference; + } + } + function transformFunctionBody(body, exposedVariableDeclarations, writes, substitutions, hasReturn) { + var hasWritesOrVariableDeclarations = writes !== void 0 || exposedVariableDeclarations.length > 0; + if (ts2.isBlock(body) && !hasWritesOrVariableDeclarations && substitutions.size === 0) { + return { body: ts2.factory.createBlock( + body.statements, + /*multLine*/ + true + ), returnValueProperty: void 0 }; + } + var returnValueProperty; + var ignoreReturns = false; + var statements = ts2.factory.createNodeArray(ts2.isBlock(body) ? body.statements.slice(0) : [ts2.isStatement(body) ? body : ts2.factory.createReturnStatement(ts2.skipParentheses(body))]); + if (hasWritesOrVariableDeclarations || substitutions.size) { + var rewrittenStatements = ts2.visitNodes(statements, visitor).slice(); + if (hasWritesOrVariableDeclarations && !hasReturn && ts2.isStatement(body)) { + var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (assignments.length === 1) { + rewrittenStatements.push(ts2.factory.createReturnStatement(assignments[0].name)); + } else { + rewrittenStatements.push(ts2.factory.createReturnStatement(ts2.factory.createObjectLiteralExpression(assignments))); + } + } + return { body: ts2.factory.createBlock( + rewrittenStatements, + /*multiLine*/ + true + ), returnValueProperty }; + } else { + return { body: ts2.factory.createBlock( + statements, + /*multiLine*/ + true + ), returnValueProperty: void 0 }; + } + function visitor(node) { + if (!ignoreReturns && ts2.isReturnStatement(node) && hasWritesOrVariableDeclarations) { + var assignments2 = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = "__return"; + } + assignments2.unshift(ts2.factory.createPropertyAssignment(returnValueProperty, ts2.visitNode(node.expression, visitor))); + } + if (assignments2.length === 1) { + return ts2.factory.createReturnStatement(assignments2[0].name); + } else { + return ts2.factory.createReturnStatement(ts2.factory.createObjectLiteralExpression(assignments2)); + } + } else { + var oldIgnoreReturns = ignoreReturns; + ignoreReturns = ignoreReturns || ts2.isFunctionLikeDeclaration(node) || ts2.isClassLike(node); + var substitution = substitutions.get(ts2.getNodeId(node).toString()); + var result2 = substitution ? ts2.getSynthesizedDeepClone(substitution) : ts2.visitEachChild(node, visitor, ts2.nullTransformationContext); + ignoreReturns = oldIgnoreReturns; + return result2; + } + } + } + function transformConstantInitializer(initializer, substitutions) { + return substitutions.size ? visitor(initializer) : initializer; + function visitor(node) { + var substitution = substitutions.get(ts2.getNodeId(node).toString()); + return substitution ? ts2.getSynthesizedDeepClone(substitution) : ts2.visitEachChild(node, visitor, ts2.nullTransformationContext); + } + } + function getStatementsOrClassElements(scope) { + if (ts2.isFunctionLikeDeclaration(scope)) { + var body = scope.body; + if (ts2.isBlock(body)) { + return body.statements; + } + } else if (ts2.isModuleBlock(scope) || ts2.isSourceFile(scope)) { + return scope.statements; + } else if (ts2.isClassLike(scope)) { + return scope.members; + } else { + ts2.assertType(scope); + } + return ts2.emptyArray; + } + function getNodeToInsertFunctionBefore(minPos, scope) { + return ts2.find(getStatementsOrClassElements(scope), function(child) { + return child.pos >= minPos && ts2.isFunctionLikeDeclaration(child) && !ts2.isConstructorDeclaration(child); + }); + } + function getNodeToInsertPropertyBefore(maxPos, scope) { + var members = scope.members; + ts2.Debug.assert(members.length > 0, "Found no members"); + var prevMember; + var allProperties = true; + for (var _i = 0, members_1 = members; _i < members_1.length; _i++) { + var member = members_1[_i]; + if (member.pos > maxPos) { + return prevMember || members[0]; + } + if (allProperties && !ts2.isPropertyDeclaration(member)) { + if (prevMember !== void 0) { + return member; + } + allProperties = false; + } + prevMember = member; + } + if (prevMember === void 0) + return ts2.Debug.fail(); + return prevMember; + } + function getNodeToInsertConstantBefore(node, scope) { + ts2.Debug.assert(!ts2.isClassLike(scope)); + var prevScope; + for (var curr = node; curr !== scope; curr = curr.parent) { + if (isScope(curr)) { + prevScope = curr; + } + } + for (var curr = (prevScope || node).parent; ; curr = curr.parent) { + if (isBlockLike(curr)) { + var prevStatement = void 0; + for (var _i = 0, _a2 = curr.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (statement.pos > node.pos) { + break; + } + prevStatement = statement; + } + if (!prevStatement && ts2.isCaseClause(curr)) { + ts2.Debug.assert(ts2.isSwitchStatement(curr.parent.parent), "Grandparent isn't a switch statement"); + return curr.parent.parent; + } + return ts2.Debug.checkDefined(prevStatement, "prevStatement failed to get set"); + } + ts2.Debug.assert(curr !== scope, "Didn't encounter a block-like before encountering scope"); + } + } + function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) { + var variableAssignments = ts2.map(exposedVariableDeclarations, function(v8) { + return ts2.factory.createShorthandPropertyAssignment(v8.symbol.name); + }); + var writeAssignments = ts2.map(writes, function(w6) { + return ts2.factory.createShorthandPropertyAssignment(w6.symbol.name); + }); + return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments); + } + function isReadonlyArray(v8) { + return ts2.isArray(v8); + } + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) ? { pos: ts2.first(targetRange.range).getStart(sourceFile), end: ts2.last(targetRange.range).getEnd() } : targetRange.range; + } + var Usage; + (function(Usage2) { + Usage2[Usage2["Read"] = 1] = "Read"; + Usage2[Usage2["Write"] = 2] = "Write"; + })(Usage || (Usage = {})); + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker, cancellationToken) { + var allTypeParameterUsages = new ts2.Map(); + var usagesPerScope = []; + var substitutionsPerScope = []; + var functionErrorsPerScope = []; + var constantErrorsPerScope = []; + var visibleDeclarationsInExtractedRange = []; + var exposedVariableSymbolSet = new ts2.Map(); + var exposedVariableDeclarations = []; + var firstExposedNonVariableDeclaration; + var expression = !isReadonlyArray(targetRange.range) ? targetRange.range : targetRange.range.length === 1 && ts2.isExpressionStatement(targetRange.range[0]) ? targetRange.range[0].expression : void 0; + var expressionDiagnostic; + if (expression === void 0) { + var statements = targetRange.range; + var start = ts2.first(statements).getStart(); + var end = ts2.last(statements).end; + expressionDiagnostic = ts2.createFileDiagnostic(sourceFile, start, end - start, Messages6.expressionExpected); + } else if (checker.getTypeAtLocation(expression).flags & (16384 | 131072)) { + expressionDiagnostic = ts2.createDiagnosticForNode(expression, Messages6.uselessConstantType); + } + for (var _i = 0, scopes_1 = scopes; _i < scopes_1.length; _i++) { + var scope = scopes_1[_i]; + usagesPerScope.push({ usages: new ts2.Map(), typeParameterUsages: new ts2.Map(), substitutions: new ts2.Map() }); + substitutionsPerScope.push(new ts2.Map()); + functionErrorsPerScope.push([]); + var constantErrors = []; + if (expressionDiagnostic) { + constantErrors.push(expressionDiagnostic); + } + if (ts2.isClassLike(scope) && ts2.isInJSFile(scope)) { + constantErrors.push(ts2.createDiagnosticForNode(scope, Messages6.cannotExtractToJSClass)); + } + if (ts2.isArrowFunction(scope) && !ts2.isBlock(scope.body)) { + constantErrors.push(ts2.createDiagnosticForNode(scope, Messages6.cannotExtractToExpressionArrowFunction)); + } + constantErrorsPerScope.push(constantErrors); + } + var seenUsages = new ts2.Map(); + var target = isReadonlyArray(targetRange.range) ? ts2.factory.createBlock(targetRange.range) : targetRange.range; + var unmodifiedNode = isReadonlyArray(targetRange.range) ? ts2.first(targetRange.range) : targetRange.range; + var inGenericContext = isInGenericContext(unmodifiedNode); + collectUsages(target); + if (inGenericContext && !isReadonlyArray(targetRange.range) && !ts2.isJsxAttribute(targetRange.range)) { + var contextualType = checker.getContextualType(targetRange.range); + recordTypeParameterUsages(contextualType); + } + if (allTypeParameterUsages.size > 0) { + var seenTypeParameterUsages = new ts2.Map(); + var i_2 = 0; + for (var curr = unmodifiedNode; curr !== void 0 && i_2 < scopes.length; curr = curr.parent) { + if (curr === scopes[i_2]) { + seenTypeParameterUsages.forEach(function(typeParameter2, id) { + usagesPerScope[i_2].typeParameterUsages.set(id, typeParameter2); + }); + i_2++; + } + if (ts2.isDeclarationWithTypeParameters(curr)) { + for (var _a2 = 0, _b = ts2.getEffectiveTypeParameterDeclarations(curr); _a2 < _b.length; _a2++) { + var typeParameterDecl = _b[_a2]; + var typeParameter = checker.getTypeAtLocation(typeParameterDecl); + if (allTypeParameterUsages.has(typeParameter.id.toString())) { + seenTypeParameterUsages.set(typeParameter.id.toString(), typeParameter); + } + } + } + } + ts2.Debug.assert(i_2 === scopes.length, "Should have iterated all scopes"); + } + if (visibleDeclarationsInExtractedRange.length) { + var containingLexicalScopeOfExtraction = ts2.isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : ts2.getEnclosingBlockScopeContainer(scopes[0]); + ts2.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + var _loop_16 = function(i8) { + var scopeUsages = usagesPerScope[i8]; + if (i8 > 0 && (scopeUsages.usages.size > 0 || scopeUsages.typeParameterUsages.size > 0)) { + var errorNode = isReadonlyArray(targetRange.range) ? targetRange.range[0] : targetRange.range; + constantErrorsPerScope[i8].push(ts2.createDiagnosticForNode(errorNode, Messages6.cannotAccessVariablesFromNestedScopes)); + } + if (targetRange.facts & RangeFacts.UsesThisInFunction && ts2.isClassLike(scopes[i8])) { + functionErrorsPerScope[i8].push(ts2.createDiagnosticForNode(targetRange.thisNode, Messages6.cannotExtractFunctionsContainingThisToMethod)); + } + var hasWrite = false; + var readonlyClassPropertyWrite; + usagesPerScope[i8].usages.forEach(function(value2) { + if (value2.usage === 2) { + hasWrite = true; + if (value2.symbol.flags & 106500 && value2.symbol.valueDeclaration && ts2.hasEffectiveModifier( + value2.symbol.valueDeclaration, + 64 + /* ModifierFlags.Readonly */ + )) { + readonlyClassPropertyWrite = value2.symbol.valueDeclaration; + } + } + }); + ts2.Debug.assert(isReadonlyArray(targetRange.range) || exposedVariableDeclarations.length === 0, "No variable declarations expected if something was extracted"); + if (hasWrite && !isReadonlyArray(targetRange.range)) { + var diag = ts2.createDiagnosticForNode(targetRange.range, Messages6.cannotWriteInExpression); + functionErrorsPerScope[i8].push(diag); + constantErrorsPerScope[i8].push(diag); + } else if (readonlyClassPropertyWrite && i8 > 0) { + var diag = ts2.createDiagnosticForNode(readonlyClassPropertyWrite, Messages6.cannotExtractReadonlyPropertyInitializerOutsideConstructor); + functionErrorsPerScope[i8].push(diag); + constantErrorsPerScope[i8].push(diag); + } else if (firstExposedNonVariableDeclaration) { + var diag = ts2.createDiagnosticForNode(firstExposedNonVariableDeclaration, Messages6.cannotExtractExportedEntity); + functionErrorsPerScope[i8].push(diag); + constantErrorsPerScope[i8].push(diag); + } + }; + for (var i7 = 0; i7 < scopes.length; i7++) { + _loop_16(i7); + } + return { target, usagesPerScope, functionErrorsPerScope, constantErrorsPerScope, exposedVariableDeclarations }; + function isInGenericContext(node) { + return !!ts2.findAncestor(node, function(n7) { + return ts2.isDeclarationWithTypeParameters(n7) && ts2.getEffectiveTypeParameterDeclarations(n7).length !== 0; + }); + } + function recordTypeParameterUsages(type3) { + var symbolWalker = checker.getSymbolWalker(function() { + return cancellationToken.throwIfCancellationRequested(), true; + }); + var visitedTypes = symbolWalker.walkType(type3).visitedTypes; + for (var _i2 = 0, visitedTypes_1 = visitedTypes; _i2 < visitedTypes_1.length; _i2++) { + var visitedType = visitedTypes_1[_i2]; + if (visitedType.isTypeParameter()) { + allTypeParameterUsages.set(visitedType.id.toString(), visitedType); + } + } + } + function collectUsages(node, valueUsage) { + if (valueUsage === void 0) { + valueUsage = 1; + } + if (inGenericContext) { + var type3 = checker.getTypeAtLocation(node); + recordTypeParameterUsages(type3); + } + if (ts2.isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node); + } + if (ts2.isAssignmentExpression(node)) { + collectUsages( + node.left, + 2 + /* Usage.Write */ + ); + collectUsages(node.right); + } else if (ts2.isUnaryExpressionWithWrite(node)) { + collectUsages( + node.operand, + 2 + /* Usage.Write */ + ); + } else if (ts2.isPropertyAccessExpression(node) || ts2.isElementAccessExpression(node)) { + ts2.forEachChild(node, collectUsages); + } else if (ts2.isIdentifier(node)) { + if (!node.parent) { + return; + } + if (ts2.isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (ts2.isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage( + node, + valueUsage, + /*isTypeNode*/ + ts2.isPartOfTypeNode(node) + ); + } else { + ts2.forEachChild(node, collectUsages); + } + } + function recordUsage(n7, usage, isTypeNode) { + var symbolId = recordUsagebySymbol(n7, usage, isTypeNode); + if (symbolId) { + for (var i8 = 0; i8 < scopes.length; i8++) { + var substitution = substitutionsPerScope[i8].get(symbolId); + if (substitution) { + usagesPerScope[i8].substitutions.set(ts2.getNodeId(n7).toString(), substitution); + } + } + } + } + function recordUsagebySymbol(identifier, usage, isTypeName) { + var symbol = getSymbolReferencedByIdentifier(identifier); + if (!symbol) { + return void 0; + } + var symbolId = ts2.getSymbolId(symbol).toString(); + var lastUsage = seenUsages.get(symbolId); + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + for (var _i2 = 0, usagesPerScope_1 = usagesPerScope; _i2 < usagesPerScope_1.length; _i2++) { + var perScope = usagesPerScope_1[_i2]; + var prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage, symbol, node: identifier }); + } + } + return symbolId; + } + var decls = symbol.getDeclarations(); + var declInFile = decls && ts2.find(decls, function(d7) { + return d7.getSourceFile() === sourceFile; + }); + if (!declInFile) { + return void 0; + } + if (ts2.rangeContainsStartEnd(enclosingTextRange, declInFile.getStart(), declInFile.end)) { + return void 0; + } + if (targetRange.facts & RangeFacts.IsGenerator && usage === 2) { + var diag = ts2.createDiagnosticForNode(identifier, Messages6.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators); + for (var _a3 = 0, functionErrorsPerScope_1 = functionErrorsPerScope; _a3 < functionErrorsPerScope_1.length; _a3++) { + var errors = functionErrorsPerScope_1[_a3]; + errors.push(diag); + } + for (var _b2 = 0, constantErrorsPerScope_1 = constantErrorsPerScope; _b2 < constantErrorsPerScope_1.length; _b2++) { + var errors = constantErrorsPerScope_1[_b2]; + errors.push(diag); + } + } + for (var i8 = 0; i8 < scopes.length; i8++) { + var scope2 = scopes[i8]; + var resolvedSymbol = checker.resolveName( + symbol.name, + scope2, + symbol.flags, + /*excludeGlobals*/ + false + ); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i8].has(symbolId)) { + var substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope2, isTypeName); + if (substitution) { + substitutionsPerScope[i8].set(symbolId, substitution); + } else if (isTypeName) { + if (!(symbol.flags & 262144)) { + var diag = ts2.createDiagnosticForNode(identifier, Messages6.typeWillNotBeVisibleInTheNewScope); + functionErrorsPerScope[i8].push(diag); + constantErrorsPerScope[i8].push(diag); + } + } else { + usagesPerScope[i8].usages.set(identifier.text, { usage, symbol, node: identifier }); + } + } + } + return symbolId; + } + function checkForUsedDeclarations(node) { + if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.indexOf(node) >= 0) { + return; + } + var sym = ts2.isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node); + if (sym) { + var decl = ts2.find(visibleDeclarationsInExtractedRange, function(d7) { + return d7.symbol === sym; + }); + if (decl) { + if (ts2.isVariableDeclaration(decl)) { + var idString = decl.symbol.id.toString(); + if (!exposedVariableSymbolSet.has(idString)) { + exposedVariableDeclarations.push(decl); + exposedVariableSymbolSet.set(idString, true); + } + } else { + firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl; + } + } + } + ts2.forEachChild(node, checkForUsedDeclarations); + } + function getSymbolReferencedByIdentifier(identifier) { + return identifier.parent && ts2.isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier ? checker.getShorthandAssignmentValueSymbol(identifier.parent) : checker.getSymbolAtLocation(identifier); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode) { + if (!symbol) { + return void 0; + } + var decls = symbol.getDeclarations(); + if (decls && decls.some(function(d7) { + return d7.parent === scopeDecl; + })) { + return ts2.factory.createIdentifier(symbol.name); + } + var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); + if (prefix === void 0) { + return void 0; + } + return isTypeNode ? ts2.factory.createQualifiedName(prefix, ts2.factory.createIdentifier(symbol.name)) : ts2.factory.createPropertyAccessExpression(prefix, symbol.name); + } + } + function getExtractableParent(node) { + return ts2.findAncestor(node, function(node2) { + return node2.parent && isExtractableExpression(node2) && !ts2.isBinaryExpression(node2.parent); + }); + } + function isExtractableExpression(node) { + var parent2 = node.parent; + switch (parent2.kind) { + case 302: + return false; + } + switch (node.kind) { + case 10: + return parent2.kind !== 269 && parent2.kind !== 273; + case 227: + case 203: + case 205: + return false; + case 79: + return parent2.kind !== 205 && parent2.kind !== 273 && parent2.kind !== 278; + } + return true; + } + function isBlockLike(node) { + switch (node.kind) { + case 238: + case 308: + case 265: + case 292: + return true; + default: + return false; + } + } + function isInJSXContent(node) { + return isStringLiteralJsxAttribute(node) || (ts2.isJsxElement(node) || ts2.isJsxSelfClosingElement(node) || ts2.isJsxFragment(node)) && (ts2.isJsxElement(node.parent) || ts2.isJsxFragment(node.parent)); + } + function isStringLiteralJsxAttribute(node) { + return ts2.isStringLiteral(node) && node.parent && ts2.isJsxAttribute(node.parent); + } + })(extractSymbol = refactor2.extractSymbol || (refactor2.extractSymbol = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var refactorName = "Extract type"; + var extractToTypeAliasAction = { + name: "Extract to type alias", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_type_alias), + kind: "refactor.extract.type" + }; + var extractToInterfaceAction = { + name: "Extract to interface", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_interface), + kind: "refactor.extract.interface" + }; + var extractToTypeDefAction = { + name: "Extract to typedef", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_to_typedef), + kind: "refactor.extract.typedef" + }; + refactor2.registerRefactor(refactorName, { + kinds: [ + extractToTypeAliasAction.kind, + extractToInterfaceAction.kind, + extractToTypeDefAction.kind + ], + getAvailableActions: function getRefactorActionsToExtractType(context2) { + var info2 = getRangeToExtract(context2, context2.triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + return [{ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_type), + actions: info2.isJS ? [extractToTypeDefAction] : ts2.append([extractToTypeAliasAction], info2.typeElements && extractToInterfaceAction) + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName, + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Extract_type), + actions: [ + __assign16(__assign16({}, extractToTypeDefAction), { notApplicableReason: info2.error }), + __assign16(__assign16({}, extractToTypeAliasAction), { notApplicableReason: info2.error }), + __assign16(__assign16({}, extractToInterfaceAction), { notApplicableReason: info2.error }) + ] + }]; + } + return ts2.emptyArray; + }, + getEditsForAction: function getRefactorEditsToExtractType(context2, actionName) { + var file = context2.file; + var info2 = getRangeToExtract(context2); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected to find a range to extract"); + var name2 = ts2.getUniqueName("NewType", file); + var edits = ts2.textChanges.ChangeTracker.with(context2, function(changes) { + switch (actionName) { + case extractToTypeAliasAction.name: + ts2.Debug.assert(!info2.isJS, "Invalid actionName/JS combo"); + return doTypeAliasChange(changes, file, name2, info2); + case extractToTypeDefAction.name: + ts2.Debug.assert(info2.isJS, "Invalid actionName/JS combo"); + return doTypedefChange(changes, file, name2, info2); + case extractToInterfaceAction.name: + ts2.Debug.assert(!info2.isJS && !!info2.typeElements, "Invalid actionName/JS combo"); + return doInterfaceChange(changes, file, name2, info2); + default: + ts2.Debug.fail("Unexpected action name"); + } + }); + var renameFilename = file.fileName; + var renameLocation = ts2.getRenameLocation( + edits, + renameFilename, + name2, + /*preferLastLocation*/ + false + ); + return { edits, renameFilename, renameLocation }; + } + }); + function getRangeToExtract(context2, considerEmptySpans) { + if (considerEmptySpans === void 0) { + considerEmptySpans = true; + } + var file = context2.file, startPosition = context2.startPosition; + var isJS = ts2.isSourceFileJS(file); + var current = ts2.getTokenAtPosition(file, startPosition); + var range2 = ts2.createTextRangeFromSpan(ts2.getRefactorContextSpan(context2)); + var cursorRequest = range2.pos === range2.end && considerEmptySpans; + var selection = ts2.findAncestor(current, function(node) { + return node.parent && ts2.isTypeNode(node) && !rangeContainsSkipTrivia(range2, node.parent, file) && (cursorRequest || ts2.nodeOverlapsWithStartEnd(current, file, range2.pos, range2.end)); + }); + if (!selection || !ts2.isTypeNode(selection)) + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Selection_is_not_a_valid_type_node) }; + var checker = context2.program.getTypeChecker(); + var firstStatement = ts2.Debug.checkDefined(ts2.findAncestor(selection, ts2.isStatement), "Should find a statement"); + var typeParameters = collectTypeParameters(checker, selection, firstStatement, file); + if (!typeParameters) + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.No_type_could_be_extracted_from_this_type_node) }; + var typeElements = flattenTypeLiteralNodeReference(checker, selection); + return { isJS, selection, firstStatement, typeParameters, typeElements }; + } + function flattenTypeLiteralNodeReference(checker, node) { + if (!node) + return void 0; + if (ts2.isIntersectionTypeNode(node)) { + var result2 = []; + var seen_1 = new ts2.Map(); + for (var _i = 0, _a2 = node.types; _i < _a2.length; _i++) { + var type3 = _a2[_i]; + var flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type3); + if (!flattenedTypeMembers || !flattenedTypeMembers.every(function(type4) { + return type4.name && ts2.addToSeen(seen_1, ts2.getNameFromPropertyName(type4.name)); + })) { + return void 0; + } + ts2.addRange(result2, flattenedTypeMembers); + } + return result2; + } else if (ts2.isParenthesizedTypeNode(node)) { + return flattenTypeLiteralNodeReference(checker, node.type); + } else if (ts2.isTypeLiteralNode(node)) { + return node.members; + } + return void 0; + } + function rangeContainsSkipTrivia(r1, node, file) { + return ts2.rangeContainsStartEnd(r1, ts2.skipTrivia(file.text, node.pos), node.end); + } + function collectTypeParameters(checker, selection, statement, file) { + var result2 = []; + return visitor(selection) ? void 0 : result2; + function visitor(node) { + if (ts2.isTypeReferenceNode(node)) { + if (ts2.isIdentifier(node.typeName)) { + var typeName = node.typeName; + var symbol = checker.resolveName( + typeName.text, + typeName, + 262144, + /* excludeGlobals */ + true + ); + for (var _i = 0, _a2 = (symbol === null || symbol === void 0 ? void 0 : symbol.declarations) || ts2.emptyArray; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (ts2.isTypeParameterDeclaration(decl) && decl.getSourceFile() === file) { + if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selection, file)) { + return true; + } + if (rangeContainsSkipTrivia(statement, decl, file) && !rangeContainsSkipTrivia(selection, decl, file)) { + ts2.pushIfUnique(result2, decl); + break; + } + } + } + } + } else if (ts2.isInferTypeNode(node)) { + var conditionalTypeNode = ts2.findAncestor(node, function(n7) { + return ts2.isConditionalTypeNode(n7) && rangeContainsSkipTrivia(n7.extendsType, node, file); + }); + if (!conditionalTypeNode || !rangeContainsSkipTrivia(selection, conditionalTypeNode, file)) { + return true; + } + } else if (ts2.isTypePredicateNode(node) || ts2.isThisTypeNode(node)) { + var functionLikeNode = ts2.findAncestor(node.parent, ts2.isFunctionLike); + if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selection, functionLikeNode, file)) { + return true; + } + } else if (ts2.isTypeQueryNode(node)) { + if (ts2.isIdentifier(node.exprName)) { + var symbol = checker.resolveName( + node.exprName.text, + node.exprName, + 111551, + /* excludeGlobals */ + false + ); + if ((symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(statement, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selection, symbol.valueDeclaration, file)) { + return true; + } + } else { + if (ts2.isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selection, node.parent, file)) { + return true; + } + } + } + if (file && ts2.isTupleTypeNode(node) && ts2.getLineAndCharacterOfPosition(file, node.pos).line === ts2.getLineAndCharacterOfPosition(file, node.end).line) { + ts2.setEmitFlags( + node, + 1 + /* EmitFlags.SingleLine */ + ); + } + return ts2.forEachChild(node, visitor); + } + } + function doTypeAliasChange(changes, file, name2, info2) { + var firstStatement = info2.firstStatement, selection = info2.selection, typeParameters = info2.typeParameters; + var newTypeNode = ts2.factory.createTypeAliasDeclaration( + /* modifiers */ + void 0, + name2, + typeParameters.map(function(id) { + return ts2.factory.updateTypeParameterDeclaration( + id, + id.modifiers, + id.name, + id.constraint, + /* defaultType */ + void 0 + ); + }), + selection + ); + changes.insertNodeBefore( + file, + firstStatement, + ts2.ignoreSourceNewlines(newTypeNode), + /* blankLineBetween */ + true + ); + changes.replaceNode(file, selection, ts2.factory.createTypeReferenceNode(name2, typeParameters.map(function(id) { + return ts2.factory.createTypeReferenceNode( + id.name, + /* typeArguments */ + void 0 + ); + })), { leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + } + function doInterfaceChange(changes, file, name2, info2) { + var _a2; + var firstStatement = info2.firstStatement, selection = info2.selection, typeParameters = info2.typeParameters, typeElements = info2.typeElements; + var newTypeNode = ts2.factory.createInterfaceDeclaration( + /* modifiers */ + void 0, + name2, + typeParameters, + /* heritageClauses */ + void 0, + typeElements + ); + ts2.setTextRange(newTypeNode, (_a2 = typeElements[0]) === null || _a2 === void 0 ? void 0 : _a2.parent); + changes.insertNodeBefore( + file, + firstStatement, + ts2.ignoreSourceNewlines(newTypeNode), + /* blankLineBetween */ + true + ); + changes.replaceNode(file, selection, ts2.factory.createTypeReferenceNode(name2, typeParameters.map(function(id) { + return ts2.factory.createTypeReferenceNode( + id.name, + /* typeArguments */ + void 0 + ); + })), { leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.Exclude, trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.ExcludeWhitespace }); + } + function doTypedefChange(changes, file, name2, info2) { + var firstStatement = info2.firstStatement, selection = info2.selection, typeParameters = info2.typeParameters; + ts2.setEmitFlags( + selection, + 1536 | 2048 + /* EmitFlags.NoNestedComments */ + ); + var node = ts2.factory.createJSDocTypedefTag(ts2.factory.createIdentifier("typedef"), ts2.factory.createJSDocTypeExpression(selection), ts2.factory.createIdentifier(name2)); + var templates = []; + ts2.forEach(typeParameters, function(typeParameter) { + var constraint = ts2.getEffectiveConstraintOfTypeParameter(typeParameter); + var parameter = ts2.factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + typeParameter.name + ); + var template2 = ts2.factory.createJSDocTemplateTag(ts2.factory.createIdentifier("template"), constraint && ts2.cast(constraint, ts2.isJSDocTypeExpression), [parameter]); + templates.push(template2); + }); + changes.insertNodeBefore( + file, + firstStatement, + ts2.factory.createJSDocComment( + /* comment */ + void 0, + ts2.factory.createNodeArray(ts2.concatenate(templates, [node])) + ), + /* blankLineBetween */ + true + ); + changes.replaceNode(file, selection, ts2.factory.createTypeReferenceNode(name2, typeParameters.map(function(id) { + return ts2.factory.createTypeReferenceNode( + id.name, + /* typeArguments */ + void 0 + ); + }))); + } + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var generateGetAccessorAndSetAccessor; + (function(generateGetAccessorAndSetAccessor2) { + var actionName = "Generate 'get' and 'set' accessors"; + var actionDescription = ts2.Diagnostics.Generate_get_and_set_accessors.message; + var generateGetSetAction = { + name: actionName, + description: actionDescription, + kind: "refactor.rewrite.property.generateAccessors" + }; + refactor2.registerRefactor(actionName, { + kinds: [generateGetSetAction.kind], + getEditsForAction: function getRefactorActionsToGenerateGetAndSetAccessors(context2, actionName2) { + if (!context2.endPosition) + return void 0; + var info2 = ts2.codefix.getAccessorConvertiblePropertyAtPosition(context2.file, context2.program, context2.startPosition, context2.endPosition); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected applicable refactor info"); + var edits = ts2.codefix.generateAccessorFromProperty(context2.file, context2.program, context2.startPosition, context2.endPosition, context2, actionName2); + if (!edits) + return void 0; + var renameFilename = context2.file.fileName; + var nameNeedRename = info2.renameAccessor ? info2.accessorName : info2.fieldName; + var renameLocationOffset = ts2.isIdentifier(nameNeedRename) ? 0 : -1; + var renameLocation = renameLocationOffset + ts2.getRenameLocation( + edits, + renameFilename, + nameNeedRename.text, + /*preferLastLocation*/ + ts2.isParameter(info2.declaration) + ); + return { renameFilename, renameLocation, edits }; + }, + getAvailableActions: function(context2) { + if (!context2.endPosition) + return ts2.emptyArray; + var info2 = ts2.codefix.getAccessorConvertiblePropertyAtPosition(context2.file, context2.program, context2.startPosition, context2.endPosition, context2.triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + return [{ + name: actionName, + description: actionDescription, + actions: [generateGetSetAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: actionName, + description: actionDescription, + actions: [__assign16(__assign16({}, generateGetSetAction), { notApplicableReason: info2.error })] + }]; + } + return ts2.emptyArray; + } + }); + })(generateGetAccessorAndSetAccessor = refactor2.generateGetAccessorAndSetAccessor || (refactor2.generateGetAccessorAndSetAccessor = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + function isRefactorErrorInfo(info2) { + return info2.error !== void 0; + } + refactor2.isRefactorErrorInfo = isRefactorErrorInfo; + function refactorKindBeginsWith(known, requested) { + if (!requested) + return true; + return known.substr(0, requested.length) === requested; + } + refactor2.refactorKindBeginsWith = refactorKindBeginsWith; + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var refactorName = "Move to a new file"; + var description7 = ts2.getLocaleSpecificMessage(ts2.Diagnostics.Move_to_a_new_file); + var moveToNewFileAction = { + name: refactorName, + description: description7, + kind: "refactor.move.newFile" + }; + refactor2.registerRefactor(refactorName, { + kinds: [moveToNewFileAction.kind], + getAvailableActions: function getRefactorActionsToMoveToNewFile(context2) { + var statements = getStatementsToMove(context2); + if (context2.preferences.allowTextChangesInNewFiles && statements) { + return [{ name: refactorName, description: description7, actions: [moveToNewFileAction] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName, + description: description7, + actions: [__assign16(__assign16({}, moveToNewFileAction), { notApplicableReason: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Selection_is_not_a_valid_statement_or_statements) })] + }]; + } + return ts2.emptyArray; + }, + getEditsForAction: function getRefactorEditsToMoveToNewFile(context2, actionName) { + ts2.Debug.assert(actionName === refactorName, "Wrong refactor invoked"); + var statements = ts2.Debug.checkDefined(getStatementsToMove(context2)); + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(context2.file, context2.program, statements, t8, context2.host, context2.preferences); + }); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + function getRangeToMove(context2) { + var file = context2.file; + var range2 = ts2.createTextRangeFromSpan(ts2.getRefactorContextSpan(context2)); + var statements = file.statements; + var startNodeIndex = ts2.findIndex(statements, function(s7) { + return s7.end > range2.pos; + }); + if (startNodeIndex === -1) + return void 0; + var startStatement = statements[startNodeIndex]; + if (ts2.isNamedDeclaration(startStatement) && startStatement.name && ts2.rangeContainsRange(startStatement.name, range2)) { + return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] }; + } + if (range2.pos > startStatement.getStart(file)) + return void 0; + var afterEndNodeIndex = ts2.findIndex(statements, function(s7) { + return s7.end > range2.end; + }, startNodeIndex); + if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range2.end)) + return void 0; + return { + toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex), + afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex] + }; + } + function doChange(oldFile, program, toMove, changes, host, preferences) { + var checker = program.getTypeChecker(); + var usage = getUsageInfo(oldFile, toMove.all, checker); + var currentDirectory = ts2.getDirectoryPath(oldFile.fileName); + var extension = ts2.extensionFromPath(oldFile.fileName); + var newModuleName = makeUniqueModuleName(getNewModuleName(usage.oldFileImportsFromNewFile, usage.movedSymbols), extension, currentDirectory, host); + var newFileNameWithExtension = newModuleName + extension; + changes.createNewFile(oldFile, ts2.combinePaths(currentDirectory, newFileNameWithExtension), getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences)); + addNewFileToTsconfig(program, changes, oldFile.fileName, newFileNameWithExtension, ts2.hostGetCanonicalFileName(host)); + } + function getStatementsToMove(context2) { + var rangeToMove = getRangeToMove(context2); + if (rangeToMove === void 0) + return void 0; + var all = []; + var ranges = []; + var toMove = rangeToMove.toMove, afterLast = rangeToMove.afterLast; + ts2.getRangesWhere(toMove, isAllowedStatementToMove, function(start, afterEndIndex) { + for (var i7 = start; i7 < afterEndIndex; i7++) + all.push(toMove[i7]); + ranges.push({ first: toMove[start], afterLast }); + }); + return all.length === 0 ? void 0 : { all, ranges }; + } + function isAllowedStatementToMove(statement) { + return !isPureImport(statement) && !ts2.isPrologueDirective(statement); + } + function isPureImport(node) { + switch (node.kind) { + case 269: + return true; + case 268: + return !ts2.hasSyntacticModifier( + node, + 1 + /* ModifierFlags.Export */ + ); + case 240: + return node.declarationList.declarations.every(function(d7) { + return !!d7.initializer && ts2.isRequireCall( + d7.initializer, + /*checkArgumentIsStringLiteralLike*/ + true + ); + }); + default: + return false; + } + } + function addNewFileToTsconfig(program, changes, oldFileName, newFileNameWithExtension, getCanonicalFileName) { + var cfg = program.getCompilerOptions().configFile; + if (!cfg) + return; + var newFileAbsolutePath = ts2.normalizePath(ts2.combinePaths(oldFileName, "..", newFileNameWithExtension)); + var newFilePath = ts2.getRelativePathFromFile(cfg.fileName, newFileAbsolutePath, getCanonicalFileName); + var cfgObject = cfg.statements[0] && ts2.tryCast(cfg.statements[0].expression, ts2.isObjectLiteralExpression); + var filesProp = cfgObject && ts2.find(cfgObject.properties, function(prop) { + return ts2.isPropertyAssignment(prop) && ts2.isStringLiteral(prop.name) && prop.name.text === "files"; + }); + if (filesProp && ts2.isArrayLiteralExpression(filesProp.initializer)) { + changes.insertNodeInListAfter(cfg, ts2.last(filesProp.initializer.elements), ts2.factory.createStringLiteral(newFilePath), filesProp.initializer.elements); + } + } + function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, newModuleName, preferences) { + var checker = program.getTypeChecker(); + var prologueDirectives = ts2.takeWhile(oldFile.statements, ts2.isPrologueDirective); + if (oldFile.externalModuleIndicator === void 0 && oldFile.commonJsModuleIndicator === void 0 && usage.oldImportsNeededByNewFile.size() === 0) { + deleteMovedStatements(oldFile, toMove.ranges, changes); + return __spreadArray9(__spreadArray9([], prologueDirectives, true), toMove.all, true); + } + var useEsModuleSyntax = !!oldFile.externalModuleIndicator; + var quotePreference = ts2.getQuotePreference(oldFile, preferences); + var importsFromNewFile = createOldFileImportsFromNewFile(usage.oldFileImportsFromNewFile, newModuleName, useEsModuleSyntax, quotePreference); + if (importsFromNewFile) { + ts2.insertImports( + changes, + oldFile, + importsFromNewFile, + /*blankLineBetween*/ + true + ); + } + deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); + deleteMovedStatements(oldFile, toMove.ranges, changes); + updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols, newModuleName); + var imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEsModuleSyntax, quotePreference); + var body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEsModuleSyntax); + if (imports.length && body.length) { + return __spreadArray9(__spreadArray9(__spreadArray9(__spreadArray9([], prologueDirectives, true), imports, true), [ + 4 + /* SyntaxKind.NewLineTrivia */ + ], false), body, true); + } + return __spreadArray9(__spreadArray9(__spreadArray9([], prologueDirectives, true), imports, true), body, true); + } + function deleteMovedStatements(sourceFile, moved, changes) { + for (var _i = 0, moved_1 = moved; _i < moved_1.length; _i++) { + var _a2 = moved_1[_i], first_1 = _a2.first, afterLast = _a2.afterLast; + changes.deleteNodeRangeExcludingEnd(sourceFile, first_1, afterLast); + } + } + function deleteUnusedOldImports(oldFile, toMove, changes, toDelete, checker) { + for (var _i = 0, _a2 = oldFile.statements; _i < _a2.length; _i++) { + var statement = _a2[_i]; + if (ts2.contains(toMove, statement)) + continue; + forEachImportInStatement(statement, function(i7) { + return deleteUnusedImports(oldFile, i7, changes, function(name2) { + return toDelete.has(checker.getSymbolAtLocation(name2)); + }); + }); + } + } + function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols, newModuleName) { + var checker = program.getTypeChecker(); + var _loop_17 = function(sourceFile2) { + if (sourceFile2 === oldFile) + return "continue"; + var _loop_18 = function(statement2) { + forEachImportInStatement(statement2, function(importNode) { + if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol) + return; + var shouldMove = function(name2) { + var symbol = ts2.isBindingElement(name2.parent) ? ts2.getPropertySymbolFromBindingElement(checker, name2.parent) : ts2.skipAlias(checker.getSymbolAtLocation(name2), checker); + return !!symbol && movedSymbols.has(symbol); + }; + deleteUnusedImports(sourceFile2, importNode, changes, shouldMove); + var newModuleSpecifier = ts2.combinePaths(ts2.getDirectoryPath(moduleSpecifierFromImport(importNode).text), newModuleName); + var newImportDeclaration = filterImport(importNode, ts2.factory.createStringLiteral(newModuleSpecifier), shouldMove); + if (newImportDeclaration) + changes.insertNodeAfter(sourceFile2, statement2, newImportDeclaration); + var ns = getNamespaceLikeImport(importNode); + if (ns) + updateNamespaceLikeImport(changes, sourceFile2, checker, movedSymbols, newModuleName, newModuleSpecifier, ns, importNode); + }); + }; + for (var _b = 0, _c = sourceFile2.statements; _b < _c.length; _b++) { + var statement = _c[_b]; + _loop_18(statement); + } + }; + for (var _i = 0, _a2 = program.getSourceFiles(); _i < _a2.length; _i++) { + var sourceFile = _a2[_i]; + _loop_17(sourceFile); + } + } + function getNamespaceLikeImport(node) { + switch (node.kind) { + case 269: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 271 ? node.importClause.namedBindings.name : void 0; + case 268: + return node.name; + case 257: + return ts2.tryCast(node.name, ts2.isIdentifier); + default: + return ts2.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind)); + } + } + function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) { + var preferredNewNamespaceName = ts2.codefix.moduleSpecifierToValidIdentifier( + newModuleName, + 99 + /* ScriptTarget.ESNext */ + ); + var needUniqueName = false; + var toChange = []; + ts2.FindAllReferences.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, function(ref2) { + if (!ts2.isPropertyAccessExpression(ref2.parent)) + return; + needUniqueName = needUniqueName || !!checker.resolveName( + preferredNewNamespaceName, + ref2, + 67108863, + /*excludeGlobals*/ + true + ); + if (movedSymbols.has(checker.getSymbolAtLocation(ref2.parent.name))) { + toChange.push(ref2); + } + }); + if (toChange.length) { + var newNamespaceName = needUniqueName ? ts2.getUniqueName(preferredNewNamespaceName, sourceFile) : preferredNewNamespaceName; + for (var _i = 0, toChange_1 = toChange; _i < toChange_1.length; _i++) { + var ref = toChange_1[_i]; + changes.replaceNode(sourceFile, ref, ts2.factory.createIdentifier(newNamespaceName)); + } + changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, newModuleName, newModuleSpecifier)); + } + } + function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) { + var newNamespaceId = ts2.factory.createIdentifier(newNamespaceName); + var newModuleString = ts2.factory.createStringLiteral(newModuleSpecifier); + switch (node.kind) { + case 269: + return ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + ts2.factory.createNamespaceImport(newNamespaceId) + ), + newModuleString, + /*assertClause*/ + void 0 + ); + case 268: + return ts2.factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + newNamespaceId, + ts2.factory.createExternalModuleReference(newModuleString) + ); + case 257: + return ts2.factory.createVariableDeclaration( + newNamespaceId, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall(newModuleString) + ); + default: + return ts2.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind)); + } + } + function moduleSpecifierFromImport(i7) { + return i7.kind === 269 ? i7.moduleSpecifier : i7.kind === 268 ? i7.moduleReference.expression : i7.initializer.arguments[0]; + } + function forEachImportInStatement(statement, cb) { + if (ts2.isImportDeclaration(statement)) { + if (ts2.isStringLiteral(statement.moduleSpecifier)) + cb(statement); + } else if (ts2.isImportEqualsDeclaration(statement)) { + if (ts2.isExternalModuleReference(statement.moduleReference) && ts2.isStringLiteralLike(statement.moduleReference.expression)) { + cb(statement); + } + } else if (ts2.isVariableStatement(statement)) { + for (var _i = 0, _a2 = statement.declarationList.declarations; _i < _a2.length; _i++) { + var decl = _a2[_i]; + if (decl.initializer && ts2.isRequireCall( + decl.initializer, + /*checkArgumentIsStringLiteralLike*/ + true + )) { + cb(decl); + } + } + } + } + function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports, quotePreference) { + var defaultImport; + var imports = []; + newFileNeedExport.forEach(function(symbol) { + if (symbol.escapedName === "default") { + defaultImport = ts2.factory.createIdentifier(ts2.symbolNameNoDefault(symbol)); + } else { + imports.push(symbol.name); + } + }); + return makeImportOrRequire(defaultImport, imports, newFileNameWithExtension, useEs6Imports, quotePreference); + } + function makeImportOrRequire(defaultImport, imports, path2, useEs6Imports, quotePreference) { + path2 = ts2.ensurePathIsNonModuleName(path2); + if (useEs6Imports) { + var specifiers = imports.map(function(i7) { + return ts2.factory.createImportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + ts2.factory.createIdentifier(i7) + ); + }); + return ts2.makeImportIfNecessary(defaultImport, specifiers, path2, quotePreference); + } else { + ts2.Debug.assert(!defaultImport, "No default import should exist"); + var bindingElements = imports.map(function(i7) { + return ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + i7 + ); + }); + return bindingElements.length ? makeVariableStatement( + ts2.factory.createObjectBindingPattern(bindingElements), + /*type*/ + void 0, + createRequireCall(ts2.factory.createStringLiteral(path2)) + ) : void 0; + } + } + function makeVariableStatement(name2, type3, initializer, flags) { + if (flags === void 0) { + flags = 2; + } + return ts2.factory.createVariableStatement( + /*modifiers*/ + void 0, + ts2.factory.createVariableDeclarationList([ts2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + type3, + initializer + )], flags) + ); + } + function createRequireCall(moduleSpecifier) { + return ts2.factory.createCallExpression( + ts2.factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [moduleSpecifier] + ); + } + function addExports(sourceFile, toMove, needExport, useEs6Exports) { + return ts2.flatMap(toMove, function(statement) { + if (isTopLevelDeclarationStatement(statement) && !isExported(sourceFile, statement, useEs6Exports) && forEachTopLevelDeclaration(statement, function(d7) { + return needExport.has(ts2.Debug.checkDefined(d7.symbol)); + })) { + var exports29 = addExport(statement, useEs6Exports); + if (exports29) + return exports29; + } + return statement; + }); + } + function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { + switch (importDecl.kind) { + case 269: + deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); + break; + case 268: + if (isUnused(importDecl.name)) { + changes.delete(sourceFile, importDecl); + } + break; + case 257: + deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); + break; + default: + ts2.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind)); + } + } + function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) { + if (!importDecl.importClause) + return; + var _a2 = importDecl.importClause, name2 = _a2.name, namedBindings = _a2.namedBindings; + var defaultUnused = !name2 || isUnused(name2); + var namedBindingsUnused = !namedBindings || (namedBindings.kind === 271 ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every(function(e10) { + return isUnused(e10.name); + })); + if (defaultUnused && namedBindingsUnused) { + changes.delete(sourceFile, importDecl); + } else { + if (name2 && defaultUnused) { + changes.delete(sourceFile, name2); + } + if (namedBindings) { + if (namedBindingsUnused) { + changes.replaceNode(sourceFile, importDecl.importClause, ts2.factory.updateImportClause( + importDecl.importClause, + importDecl.importClause.isTypeOnly, + name2, + /*namedBindings*/ + void 0 + )); + } else if (namedBindings.kind === 272) { + for (var _i = 0, _b = namedBindings.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (isUnused(element.name)) + changes.delete(sourceFile, element); + } + } + } + } + } + function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes, isUnused) { + var name2 = varDecl.name; + switch (name2.kind) { + case 79: + if (isUnused(name2)) { + if (varDecl.initializer && ts2.isRequireCall( + varDecl.initializer, + /*requireStringLiteralLikeArgument*/ + true + )) { + changes.delete(sourceFile, ts2.isVariableDeclarationList(varDecl.parent) && ts2.length(varDecl.parent.declarations) === 1 ? varDecl.parent.parent : varDecl); + } else { + changes.delete(sourceFile, name2); + } + } + break; + case 204: + break; + case 203: + if (name2.elements.every(function(e10) { + return ts2.isIdentifier(e10.name) && isUnused(e10.name); + })) { + changes.delete(sourceFile, ts2.isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); + } else { + for (var _i = 0, _a2 = name2.elements; _i < _a2.length; _i++) { + var element = _a2[_i]; + if (ts2.isIdentifier(element.name) && isUnused(element.name)) { + changes.delete(sourceFile, element.name); + } + } + } + break; + } + } + function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, useEsModuleSyntax, quotePreference) { + var copiedOldImports = []; + for (var _i = 0, _a2 = oldFile.statements; _i < _a2.length; _i++) { + var oldStatement = _a2[_i]; + forEachImportInStatement(oldStatement, function(i7) { + ts2.append(copiedOldImports, filterImport(i7, moduleSpecifierFromImport(i7), function(name2) { + return importsToCopy.has(checker.getSymbolAtLocation(name2)); + })); + }); + } + var oldFileDefault; + var oldFileNamedImports = []; + var markSeenTop = ts2.nodeSeenTracker(); + newFileImportsFromOldFile.forEach(function(symbol) { + if (!symbol.declarations) { + return; + } + for (var _i2 = 0, _a3 = symbol.declarations; _i2 < _a3.length; _i2++) { + var decl = _a3[_i2]; + if (!isTopLevelDeclaration(decl)) + continue; + var name2 = nameOfTopLevelDeclaration(decl); + if (!name2) + continue; + var top = getTopLevelDeclarationStatement(decl); + if (markSeenTop(top)) { + addExportToChanges(oldFile, top, name2, changes, useEsModuleSyntax); + } + if (ts2.hasSyntacticModifier( + decl, + 1024 + /* ModifierFlags.Default */ + )) { + oldFileDefault = name2; + } else { + oldFileNamedImports.push(name2.text); + } + } + }); + ts2.append(copiedOldImports, makeImportOrRequire(oldFileDefault, oldFileNamedImports, ts2.removeFileExtension(ts2.getBaseFileName(oldFile.fileName)), useEsModuleSyntax, quotePreference)); + return copiedOldImports; + } + function makeUniqueModuleName(moduleName3, extension, inDirectory, host) { + var newModuleName = moduleName3; + for (var i7 = 1; ; i7++) { + var name2 = ts2.combinePaths(inDirectory, newModuleName + extension); + if (!host.fileExists(name2)) + return newModuleName; + newModuleName = "".concat(moduleName3, ".").concat(i7); + } + } + function getNewModuleName(importsFromNewFile, movedSymbols) { + return importsFromNewFile.forEachEntry(ts2.symbolNameNoDefault) || movedSymbols.forEachEntry(ts2.symbolNameNoDefault) || "newFile"; + } + function getUsageInfo(oldFile, toMove, checker) { + var movedSymbols = new SymbolSet(); + var oldImportsNeededByNewFile = new SymbolSet(); + var newFileImportsFromOldFile = new SymbolSet(); + var containsJsx = ts2.find(toMove, function(statement2) { + return !!(statement2.transformFlags & 2); + }); + var jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx); + if (jsxNamespaceSymbol) { + oldImportsNeededByNewFile.add(jsxNamespaceSymbol); + } + for (var _i = 0, toMove_1 = toMove; _i < toMove_1.length; _i++) { + var statement = toMove_1[_i]; + forEachTopLevelDeclaration(statement, function(decl) { + movedSymbols.add(ts2.Debug.checkDefined(ts2.isExpressionStatement(decl) ? checker.getSymbolAtLocation(decl.expression.left) : decl.symbol, "Need a symbol here")); + }); + } + for (var _a2 = 0, toMove_2 = toMove; _a2 < toMove_2.length; _a2++) { + var statement = toMove_2[_a2]; + forEachReference(statement, checker, function(symbol) { + if (!symbol.declarations) + return; + for (var _i2 = 0, _a3 = symbol.declarations; _i2 < _a3.length; _i2++) { + var decl = _a3[_i2]; + if (isInImport(decl)) { + oldImportsNeededByNewFile.add(symbol); + } else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) { + newFileImportsFromOldFile.add(symbol); + } + } + }); + } + var unusedImportsFromOldFile = oldImportsNeededByNewFile.clone(); + var oldFileImportsFromNewFile = new SymbolSet(); + for (var _b = 0, _c = oldFile.statements; _b < _c.length; _b++) { + var statement = _c[_b]; + if (ts2.contains(toMove, statement)) + continue; + if (jsxNamespaceSymbol && !!(statement.transformFlags & 2)) { + unusedImportsFromOldFile.delete(jsxNamespaceSymbol); + } + forEachReference(statement, checker, function(symbol) { + if (movedSymbols.has(symbol)) + oldFileImportsFromNewFile.add(symbol); + unusedImportsFromOldFile.delete(symbol); + }); + } + return { movedSymbols, newFileImportsFromOldFile, oldFileImportsFromNewFile, oldImportsNeededByNewFile, unusedImportsFromOldFile }; + function getJsxNamespaceSymbol(containsJsx2) { + if (containsJsx2 === void 0) { + return void 0; + } + var jsxNamespace = checker.getJsxNamespace(containsJsx2); + var jsxNamespaceSymbol2 = checker.resolveName( + jsxNamespace, + containsJsx2, + 1920, + /*excludeGlobals*/ + true + ); + return !!jsxNamespaceSymbol2 && ts2.some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0; + } + } + function isInImport(decl) { + switch (decl.kind) { + case 268: + case 273: + case 270: + case 271: + return true; + case 257: + return isVariableDeclarationInImport(decl); + case 205: + return ts2.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); + default: + return false; + } + } + function isVariableDeclarationInImport(decl) { + return ts2.isSourceFile(decl.parent.parent.parent) && !!decl.initializer && ts2.isRequireCall( + decl.initializer, + /*checkArgumentIsStringLiteralLike*/ + true + ); + } + function filterImport(i7, moduleSpecifier, keep) { + switch (i7.kind) { + case 269: { + var clause = i7.importClause; + if (!clause) + return void 0; + var defaultImport = clause.name && keep(clause.name) ? clause.name : void 0; + var namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep); + return defaultImport || namedBindings ? ts2.factory.createImportDeclaration( + /*modifiers*/ + void 0, + ts2.factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImport, + namedBindings + ), + moduleSpecifier, + /*assertClause*/ + void 0 + ) : void 0; + } + case 268: + return keep(i7.name) ? i7 : void 0; + case 257: { + var name2 = filterBindingName(i7.name, keep); + return name2 ? makeVariableStatement(name2, i7.type, createRequireCall(moduleSpecifier), i7.parent.flags) : void 0; + } + default: + return ts2.Debug.assertNever(i7, "Unexpected import kind ".concat(i7.kind)); + } + } + function filterNamedBindings(namedBindings, keep) { + if (namedBindings.kind === 271) { + return keep(namedBindings.name) ? namedBindings : void 0; + } else { + var newElements = namedBindings.elements.filter(function(e10) { + return keep(e10.name); + }); + return newElements.length ? ts2.factory.createNamedImports(newElements) : void 0; + } + } + function filterBindingName(name2, keep) { + switch (name2.kind) { + case 79: + return keep(name2) ? name2 : void 0; + case 204: + return name2; + case 203: { + var newElements = name2.elements.filter(function(prop) { + return prop.propertyName || !ts2.isIdentifier(prop.name) || keep(prop.name); + }); + return newElements.length ? ts2.factory.createObjectBindingPattern(newElements) : void 0; + } + } + } + function forEachReference(node, checker, onReference) { + node.forEachChild(function cb(node2) { + if (ts2.isIdentifier(node2) && !ts2.isDeclarationName(node2)) { + var sym = checker.getSymbolAtLocation(node2); + if (sym) + onReference(sym); + } else { + node2.forEachChild(cb); + } + }); + } + var SymbolSet = ( + /** @class */ + function() { + function SymbolSet2() { + this.map = new ts2.Map(); + } + SymbolSet2.prototype.add = function(symbol) { + this.map.set(String(ts2.getSymbolId(symbol)), symbol); + }; + SymbolSet2.prototype.has = function(symbol) { + return this.map.has(String(ts2.getSymbolId(symbol))); + }; + SymbolSet2.prototype.delete = function(symbol) { + this.map.delete(String(ts2.getSymbolId(symbol))); + }; + SymbolSet2.prototype.forEach = function(cb) { + this.map.forEach(cb); + }; + SymbolSet2.prototype.forEachEntry = function(cb) { + return ts2.forEachEntry(this.map, cb); + }; + SymbolSet2.prototype.clone = function() { + var clone2 = new SymbolSet2(); + ts2.copyEntries(this.map, clone2.map); + return clone2; + }; + SymbolSet2.prototype.size = function() { + return this.map.size; + }; + return SymbolSet2; + }() + ); + function isTopLevelDeclaration(node) { + return isNonVariableTopLevelDeclaration(node) && ts2.isSourceFile(node.parent) || ts2.isVariableDeclaration(node) && ts2.isSourceFile(node.parent.parent.parent); + } + function sourceFileOfTopLevelDeclaration(node) { + return ts2.isVariableDeclaration(node) ? node.parent.parent.parent : node.parent; + } + function isTopLevelDeclarationStatement(node) { + ts2.Debug.assert(ts2.isSourceFile(node.parent), "Node parent should be a SourceFile"); + return isNonVariableTopLevelDeclaration(node) || ts2.isVariableStatement(node); + } + function isNonVariableTopLevelDeclaration(node) { + switch (node.kind) { + case 259: + case 260: + case 264: + case 263: + case 262: + case 261: + case 268: + return true; + default: + return false; + } + } + function forEachTopLevelDeclaration(statement, cb) { + switch (statement.kind) { + case 259: + case 260: + case 264: + case 263: + case 262: + case 261: + case 268: + return cb(statement); + case 240: + return ts2.firstDefined(statement.declarationList.declarations, function(decl) { + return forEachTopLevelDeclarationInBindingName(decl.name, cb); + }); + case 241: { + var expression = statement.expression; + return ts2.isBinaryExpression(expression) && ts2.getAssignmentDeclarationKind(expression) === 1 ? cb(statement) : void 0; + } + } + } + function forEachTopLevelDeclarationInBindingName(name2, cb) { + switch (name2.kind) { + case 79: + return cb(ts2.cast(name2.parent, function(x7) { + return ts2.isVariableDeclaration(x7) || ts2.isBindingElement(x7); + })); + case 204: + case 203: + return ts2.firstDefined(name2.elements, function(em) { + return ts2.isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb); + }); + default: + return ts2.Debug.assertNever(name2, "Unexpected name kind ".concat(name2.kind)); + } + } + function nameOfTopLevelDeclaration(d7) { + return ts2.isExpressionStatement(d7) ? ts2.tryCast(d7.expression.left.name, ts2.isIdentifier) : ts2.tryCast(d7.name, ts2.isIdentifier); + } + function getTopLevelDeclarationStatement(d7) { + switch (d7.kind) { + case 257: + return d7.parent.parent; + case 205: + return getTopLevelDeclarationStatement(ts2.cast(d7.parent.parent, function(p7) { + return ts2.isVariableDeclaration(p7) || ts2.isBindingElement(p7); + })); + default: + return d7; + } + } + function addExportToChanges(sourceFile, decl, name2, changes, useEs6Exports) { + if (isExported(sourceFile, decl, useEs6Exports, name2)) + return; + if (useEs6Exports) { + if (!ts2.isExpressionStatement(decl)) + changes.insertExportModifier(sourceFile, decl); + } else { + var names = getNamesToExportInCommonJS(decl); + if (names.length !== 0) + changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment)); + } + } + function isExported(sourceFile, decl, useEs6Exports, name2) { + var _a2; + if (useEs6Exports) { + return !ts2.isExpressionStatement(decl) && ts2.hasSyntacticModifier( + decl, + 1 + /* ModifierFlags.Export */ + ) || !!(name2 && ((_a2 = sourceFile.symbol.exports) === null || _a2 === void 0 ? void 0 : _a2.has(name2.escapedText))); + } + return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some(function(name3) { + return sourceFile.symbol.exports.has(ts2.escapeLeadingUnderscores(name3)); + }); + } + function addExport(decl, useEs6Exports) { + return useEs6Exports ? [addEs6Export(decl)] : addCommonjsExport(decl); + } + function addEs6Export(d7) { + var modifiers = ts2.canHaveModifiers(d7) ? ts2.concatenate([ts2.factory.createModifier( + 93 + /* SyntaxKind.ExportKeyword */ + )], ts2.getModifiers(d7)) : void 0; + switch (d7.kind) { + case 259: + return ts2.factory.updateFunctionDeclaration(d7, modifiers, d7.asteriskToken, d7.name, d7.typeParameters, d7.parameters, d7.type, d7.body); + case 260: + var decorators = ts2.canHaveDecorators(d7) ? ts2.getDecorators(d7) : void 0; + return ts2.factory.updateClassDeclaration(d7, ts2.concatenate(decorators, modifiers), d7.name, d7.typeParameters, d7.heritageClauses, d7.members); + case 240: + return ts2.factory.updateVariableStatement(d7, modifiers, d7.declarationList); + case 264: + return ts2.factory.updateModuleDeclaration(d7, modifiers, d7.name, d7.body); + case 263: + return ts2.factory.updateEnumDeclaration(d7, modifiers, d7.name, d7.members); + case 262: + return ts2.factory.updateTypeAliasDeclaration(d7, modifiers, d7.name, d7.typeParameters, d7.type); + case 261: + return ts2.factory.updateInterfaceDeclaration(d7, modifiers, d7.name, d7.typeParameters, d7.heritageClauses, d7.members); + case 268: + return ts2.factory.updateImportEqualsDeclaration(d7, modifiers, d7.isTypeOnly, d7.name, d7.moduleReference); + case 241: + return ts2.Debug.fail(); + default: + return ts2.Debug.assertNever(d7, "Unexpected declaration kind ".concat(d7.kind)); + } + } + function addCommonjsExport(decl) { + return __spreadArray9([decl], getNamesToExportInCommonJS(decl).map(createExportAssignment), true); + } + function getNamesToExportInCommonJS(decl) { + switch (decl.kind) { + case 259: + case 260: + return [decl.name.text]; + case 240: + return ts2.mapDefined(decl.declarationList.declarations, function(d7) { + return ts2.isIdentifier(d7.name) ? d7.name.text : void 0; + }); + case 264: + case 263: + case 262: + case 261: + case 268: + return ts2.emptyArray; + case 241: + return ts2.Debug.fail("Can't export an ExpressionStatement"); + default: + return ts2.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind)); + } + } + function createExportAssignment(name2) { + return ts2.factory.createExpressionStatement(ts2.factory.createBinaryExpression(ts2.factory.createPropertyAccessExpression(ts2.factory.createIdentifier("exports"), ts2.factory.createIdentifier(name2)), 63, ts2.factory.createIdentifier(name2))); + } + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var addOrRemoveBracesToArrowFunction; + (function(addOrRemoveBracesToArrowFunction2) { + var refactorName = "Add or remove braces in an arrow function"; + var refactorDescription = ts2.Diagnostics.Add_or_remove_braces_in_an_arrow_function.message; + var addBracesAction = { + name: "Add braces to arrow function", + description: ts2.Diagnostics.Add_braces_to_arrow_function.message, + kind: "refactor.rewrite.arrow.braces.add" + }; + var removeBracesAction = { + name: "Remove braces from arrow function", + description: ts2.Diagnostics.Remove_braces_from_arrow_function.message, + kind: "refactor.rewrite.arrow.braces.remove" + }; + refactor2.registerRefactor(refactorName, { + kinds: [removeBracesAction.kind], + getEditsForAction: getRefactorEditsToRemoveFunctionBraces, + getAvailableActions: getRefactorActionsToRemoveFunctionBraces + }); + function getRefactorActionsToRemoveFunctionBraces(context2) { + var file = context2.file, startPosition = context2.startPosition, triggerReason = context2.triggerReason; + var info2 = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason === "invoked"); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + return [{ + name: refactorName, + description: refactorDescription, + actions: [ + info2.addBraces ? addBracesAction : removeBracesAction + ] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName, + description: refactorDescription, + actions: [ + __assign16(__assign16({}, addBracesAction), { notApplicableReason: info2.error }), + __assign16(__assign16({}, removeBracesAction), { notApplicableReason: info2.error }) + ] + }]; + } + return ts2.emptyArray; + } + function getRefactorEditsToRemoveFunctionBraces(context2, actionName) { + var file = context2.file, startPosition = context2.startPosition; + var info2 = getConvertibleArrowFunctionAtPosition(file, startPosition); + ts2.Debug.assert(info2 && !refactor2.isRefactorErrorInfo(info2), "Expected applicable refactor info"); + var expression = info2.expression, returnStatement = info2.returnStatement, func = info2.func; + var body; + if (actionName === addBracesAction.name) { + var returnStatement_1 = ts2.factory.createReturnStatement(expression); + body = ts2.factory.createBlock( + [returnStatement_1], + /* multiLine */ + true + ); + ts2.copyLeadingComments( + expression, + returnStatement_1, + file, + 3, + /* hasTrailingNewLine */ + true + ); + } else if (actionName === removeBracesAction.name && returnStatement) { + var actualExpression = expression || ts2.factory.createVoidZero(); + body = ts2.needsParentheses(actualExpression) ? ts2.factory.createParenthesizedExpression(actualExpression) : actualExpression; + ts2.copyTrailingAsLeadingComments( + returnStatement, + body, + file, + 3, + /* hasTrailingNewLine */ + false + ); + ts2.copyLeadingComments( + returnStatement, + body, + file, + 3, + /* hasTrailingNewLine */ + false + ); + ts2.copyTrailingComments( + returnStatement, + body, + file, + 3, + /* hasTrailingNewLine */ + false + ); + } else { + ts2.Debug.fail("invalid action"); + } + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + t8.replaceNode(file, func.body, body); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + function getConvertibleArrowFunctionAtPosition(file, startPosition, considerFunctionBodies, kind) { + if (considerFunctionBodies === void 0) { + considerFunctionBodies = true; + } + var node = ts2.getTokenAtPosition(file, startPosition); + var func = ts2.getContainingFunction(node); + if (!func) { + return { + error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_find_a_containing_arrow_function) + }; + } + if (!ts2.isArrowFunction(func)) { + return { + error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Containing_function_is_not_an_arrow_function) + }; + } + if (!ts2.rangeContainsRange(func, node) || ts2.rangeContainsRange(func.body, node) && !considerFunctionBodies) { + return void 0; + } + if (refactor2.refactorKindBeginsWith(addBracesAction.kind, kind) && ts2.isExpression(func.body)) { + return { func, addBraces: true, expression: func.body }; + } else if (refactor2.refactorKindBeginsWith(removeBracesAction.kind, kind) && ts2.isBlock(func.body) && func.body.statements.length === 1) { + var firstStatement = ts2.first(func.body.statements); + if (ts2.isReturnStatement(firstStatement)) { + return { func, addBraces: false, expression: firstStatement.expression, returnStatement: firstStatement }; + } + } + return void 0; + } + })(addOrRemoveBracesToArrowFunction = refactor2.addOrRemoveBracesToArrowFunction || (refactor2.addOrRemoveBracesToArrowFunction = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var convertParamsToDestructuredObject; + (function(convertParamsToDestructuredObject2) { + var refactorName = "Convert parameters to destructured object"; + var minimumParameterLength = 1; + var refactorDescription = ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_parameters_to_destructured_object); + var toDestructuredAction = { + name: refactorName, + description: refactorDescription, + kind: "refactor.rewrite.parameters.toDestructured" + }; + refactor2.registerRefactor(refactorName, { + kinds: [toDestructuredAction.kind], + getEditsForAction: getRefactorEditsToConvertParametersToDestructuredObject, + getAvailableActions: getRefactorActionsToConvertParametersToDestructuredObject + }); + function getRefactorActionsToConvertParametersToDestructuredObject(context2) { + var file = context2.file, startPosition = context2.startPosition; + var isJSFile = ts2.isSourceFileJS(file); + if (isJSFile) + return ts2.emptyArray; + var functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, context2.program.getTypeChecker()); + if (!functionDeclaration) + return ts2.emptyArray; + return [{ + name: refactorName, + description: refactorDescription, + actions: [toDestructuredAction] + }]; + } + function getRefactorEditsToConvertParametersToDestructuredObject(context2, actionName) { + ts2.Debug.assert(actionName === refactorName, "Unexpected action name"); + var file = context2.file, startPosition = context2.startPosition, program = context2.program, cancellationToken = context2.cancellationToken, host = context2.host; + var functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, program.getTypeChecker()); + if (!functionDeclaration || !cancellationToken) + return void 0; + var groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); + if (groupedReferences.valid) { + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(file, program, host, t8, functionDeclaration, groupedReferences); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + return { edits: [] }; + } + function doChange(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + var signature = groupedReferences.signature; + var newFunctionDeclarationParams = ts2.map(createNewParameters(functionDeclaration, program, host), function(param) { + return ts2.getSynthesizedDeepClone(param); + }); + if (signature) { + var newSignatureParams = ts2.map(createNewParameters(signature, program, host), function(param) { + return ts2.getSynthesizedDeepClone(param); + }); + replaceParameters(signature, newSignatureParams); + } + replaceParameters(functionDeclaration, newFunctionDeclarationParams); + var functionCalls = ts2.sortAndDeduplicate( + groupedReferences.functionCalls, + /*comparer*/ + function(a7, b8) { + return ts2.compareValues(a7.pos, b8.pos); + } + ); + for (var _i = 0, functionCalls_1 = functionCalls; _i < functionCalls_1.length; _i++) { + var call = functionCalls_1[_i]; + if (call.arguments && call.arguments.length) { + var newArgument = ts2.getSynthesizedDeepClone( + createNewArgument(functionDeclaration, call.arguments), + /*includeTrivia*/ + true + ); + changes.replaceNodeRange(ts2.getSourceFileOfNode(call), ts2.first(call.arguments), ts2.last(call.arguments), newArgument, { leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.IncludeAll, trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Include }); + } + } + function replaceParameters(declarationOrSignature, parameterDeclarations) { + changes.replaceNodeRangeWithNodes(sourceFile, ts2.first(declarationOrSignature.parameters), ts2.last(declarationOrSignature.parameters), parameterDeclarations, { + joiner: ", ", + // indentation is set to 0 because otherwise the object parameter will be indented if there is a `this` parameter + indentation: 0, + leadingTriviaOption: ts2.textChanges.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts2.textChanges.TrailingTriviaOption.Include + }); + } + } + function getGroupedReferences(functionDeclaration, program, cancellationToken) { + var functionNames = getFunctionNames(functionDeclaration); + var classNames = ts2.isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : []; + var names = ts2.deduplicate(__spreadArray9(__spreadArray9([], functionNames, true), classNames, true), ts2.equateValues); + var checker = program.getTypeChecker(); + var references = ts2.flatMap( + names, + /*mapfn*/ + function(name2) { + return ts2.FindAllReferences.getReferenceEntriesForNode(-1, name2, program, program.getSourceFiles(), cancellationToken); + } + ); + var groupedReferences = groupReferences(references); + if (!ts2.every( + groupedReferences.declarations, + /*callback*/ + function(decl) { + return ts2.contains(names, decl); + } + )) { + groupedReferences.valid = false; + } + return groupedReferences; + function groupReferences(referenceEntries) { + var classReferences = { accessExpressions: [], typeUsages: [] }; + var groupedReferences2 = { functionCalls: [], declarations: [], classReferences, valid: true }; + var functionSymbols = ts2.map(functionNames, getSymbolTargetAtLocation); + var classSymbols = ts2.map(classNames, getSymbolTargetAtLocation); + var isConstructor = ts2.isConstructorDeclaration(functionDeclaration); + var contextualSymbols = ts2.map(functionNames, function(name2) { + return getSymbolForContextualType(name2, checker); + }); + for (var _i = 0, referenceEntries_1 = referenceEntries; _i < referenceEntries_1.length; _i++) { + var entry = referenceEntries_1[_i]; + if (entry.kind === 0) { + groupedReferences2.valid = false; + continue; + } + if (ts2.contains(contextualSymbols, getSymbolTargetAtLocation(entry.node))) { + if (isValidMethodSignature(entry.node.parent)) { + groupedReferences2.signature = entry.node.parent; + continue; + } + var call = entryToFunctionCall(entry); + if (call) { + groupedReferences2.functionCalls.push(call); + continue; + } + } + var contextualSymbol = getSymbolForContextualType(entry.node, checker); + if (contextualSymbol && ts2.contains(contextualSymbols, contextualSymbol)) { + var decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + } + if (ts2.contains(functionSymbols, getSymbolTargetAtLocation(entry.node)) || ts2.isNewExpressionTarget(entry.node)) { + var importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } + var decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + var call = entryToFunctionCall(entry); + if (call) { + groupedReferences2.functionCalls.push(call); + continue; + } + } + if (isConstructor && ts2.contains(classSymbols, getSymbolTargetAtLocation(entry.node))) { + var importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } + var decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + var accessExpression = entryToAccessExpression(entry); + if (accessExpression) { + classReferences.accessExpressions.push(accessExpression); + continue; + } + if (ts2.isClassDeclaration(functionDeclaration.parent)) { + var type3 = entryToType(entry); + if (type3) { + classReferences.typeUsages.push(type3); + continue; + } + } + } + groupedReferences2.valid = false; + } + return groupedReferences2; + } + function getSymbolTargetAtLocation(node) { + var symbol = checker.getSymbolAtLocation(node); + return symbol && ts2.getSymbolTarget(symbol, checker); + } + } + function getSymbolForContextualType(node, checker) { + var element = ts2.getContainingObjectLiteralElement(node); + if (element) { + var contextualType = checker.getContextualTypeForObjectLiteralElement(element); + var symbol = contextualType === null || contextualType === void 0 ? void 0 : contextualType.getSymbol(); + if (symbol && !(ts2.getCheckFlags(symbol) & 6)) { + return symbol; + } + } + } + function entryToImportOrExport(entry) { + var node = entry.node; + if (ts2.isImportSpecifier(node.parent) || ts2.isImportClause(node.parent) || ts2.isImportEqualsDeclaration(node.parent) || ts2.isNamespaceImport(node.parent)) { + return node; + } + if (ts2.isExportSpecifier(node.parent) || ts2.isExportAssignment(node.parent)) { + return node; + } + return void 0; + } + function entryToDeclaration(entry) { + if (ts2.isDeclaration(entry.node.parent)) { + return entry.node; + } + return void 0; + } + function entryToFunctionCall(entry) { + if (entry.node.parent) { + var functionReference = entry.node; + var parent2 = functionReference.parent; + switch (parent2.kind) { + case 210: + case 211: + var callOrNewExpression = ts2.tryCast(parent2, ts2.isCallOrNewExpression); + if (callOrNewExpression && callOrNewExpression.expression === functionReference) { + return callOrNewExpression; + } + break; + case 208: + var propertyAccessExpression = ts2.tryCast(parent2, ts2.isPropertyAccessExpression); + if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { + var callOrNewExpression_1 = ts2.tryCast(propertyAccessExpression.parent, ts2.isCallOrNewExpression); + if (callOrNewExpression_1 && callOrNewExpression_1.expression === propertyAccessExpression) { + return callOrNewExpression_1; + } + } + break; + case 209: + var elementAccessExpression = ts2.tryCast(parent2, ts2.isElementAccessExpression); + if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { + var callOrNewExpression_2 = ts2.tryCast(elementAccessExpression.parent, ts2.isCallOrNewExpression); + if (callOrNewExpression_2 && callOrNewExpression_2.expression === elementAccessExpression) { + return callOrNewExpression_2; + } + } + break; + } + } + return void 0; + } + function entryToAccessExpression(entry) { + if (entry.node.parent) { + var reference = entry.node; + var parent2 = reference.parent; + switch (parent2.kind) { + case 208: + var propertyAccessExpression = ts2.tryCast(parent2, ts2.isPropertyAccessExpression); + if (propertyAccessExpression && propertyAccessExpression.expression === reference) { + return propertyAccessExpression; + } + break; + case 209: + var elementAccessExpression = ts2.tryCast(parent2, ts2.isElementAccessExpression); + if (elementAccessExpression && elementAccessExpression.expression === reference) { + return elementAccessExpression; + } + break; + } + } + return void 0; + } + function entryToType(entry) { + var reference = entry.node; + if (ts2.getMeaningFromLocation(reference) === 2 || ts2.isExpressionWithTypeArgumentsInClassExtendsClause(reference.parent)) { + return reference; + } + return void 0; + } + function getFunctionDeclarationAtPosition(file, startPosition, checker) { + var node = ts2.getTouchingToken(file, startPosition); + var functionDeclaration = ts2.getContainingFunctionDeclaration(node); + if (isTopLevelJSDoc(node)) + return void 0; + if (functionDeclaration && isValidFunctionDeclaration(functionDeclaration, checker) && ts2.rangeContainsRange(functionDeclaration, node) && !(functionDeclaration.body && ts2.rangeContainsRange(functionDeclaration.body, node))) + return functionDeclaration; + return void 0; + } + function isTopLevelJSDoc(node) { + var containingJSDoc = ts2.findAncestor(node, ts2.isJSDocNode); + if (containingJSDoc) { + var containingNonJSDoc = ts2.findAncestor(containingJSDoc, function(n7) { + return !ts2.isJSDocNode(n7); + }); + return !!containingNonJSDoc && ts2.isFunctionLikeDeclaration(containingNonJSDoc); + } + return false; + } + function isValidMethodSignature(node) { + return ts2.isMethodSignature(node) && (ts2.isInterfaceDeclaration(node.parent) || ts2.isTypeLiteralNode(node.parent)); + } + function isValidFunctionDeclaration(functionDeclaration, checker) { + var _a2; + if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) + return false; + switch (functionDeclaration.kind) { + case 259: + return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); + case 171: + if (ts2.isObjectLiteralExpression(functionDeclaration.parent)) { + var contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker); + return ((_a2 = contextualSymbol === null || contextualSymbol === void 0 ? void 0 : contextualSymbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.length) === 1 && isSingleImplementation(functionDeclaration, checker); + } + return isSingleImplementation(functionDeclaration, checker); + case 173: + if (ts2.isClassDeclaration(functionDeclaration.parent)) { + return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); + } else { + return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); + } + case 215: + case 216: + return isValidVariableDeclaration(functionDeclaration.parent); + } + return false; + } + function isSingleImplementation(functionDeclaration, checker) { + return !!functionDeclaration.body && !checker.isImplementationOfOverload(functionDeclaration); + } + function hasNameOrDefault(functionOrClassDeclaration) { + if (!functionOrClassDeclaration.name) { + var defaultKeyword = ts2.findModifier( + functionOrClassDeclaration, + 88 + /* SyntaxKind.DefaultKeyword */ + ); + return !!defaultKeyword; + } + return true; + } + function isValidParameterNodeArray(parameters, checker) { + return getRefactorableParametersLength(parameters) >= minimumParameterLength && ts2.every( + parameters, + /*callback*/ + function(paramDecl) { + return isValidParameterDeclaration(paramDecl, checker); + } + ); + } + function isValidParameterDeclaration(parameterDeclaration, checker) { + if (ts2.isRestParameter(parameterDeclaration)) { + var type3 = checker.getTypeAtLocation(parameterDeclaration); + if (!checker.isArrayType(type3) && !checker.isTupleType(type3)) + return false; + } + return !parameterDeclaration.modifiers && ts2.isIdentifier(parameterDeclaration.name); + } + function isValidVariableDeclaration(node) { + return ts2.isVariableDeclaration(node) && ts2.isVarConst(node) && ts2.isIdentifier(node.name) && !node.type; + } + function hasThisParameter(parameters) { + return parameters.length > 0 && ts2.isThis(parameters[0].name); + } + function getRefactorableParametersLength(parameters) { + if (hasThisParameter(parameters)) { + return parameters.length - 1; + } + return parameters.length; + } + function getRefactorableParameters(parameters) { + if (hasThisParameter(parameters)) { + parameters = ts2.factory.createNodeArray(parameters.slice(1), parameters.hasTrailingComma); + } + return parameters; + } + function createPropertyOrShorthandAssignment(name2, initializer) { + if (ts2.isIdentifier(initializer) && ts2.getTextOfIdentifierOrLiteral(initializer) === name2) { + return ts2.factory.createShorthandPropertyAssignment(name2); + } + return ts2.factory.createPropertyAssignment(name2, initializer); + } + function createNewArgument(functionDeclaration, functionArguments) { + var parameters = getRefactorableParameters(functionDeclaration.parameters); + var hasRestParameter = ts2.isRestParameter(ts2.last(parameters)); + var nonRestArguments = hasRestParameter ? functionArguments.slice(0, parameters.length - 1) : functionArguments; + var properties = ts2.map(nonRestArguments, function(arg, i7) { + var parameterName = getParameterName(parameters[i7]); + var property2 = createPropertyOrShorthandAssignment(parameterName, arg); + ts2.suppressLeadingAndTrailingTrivia(property2.name); + if (ts2.isPropertyAssignment(property2)) + ts2.suppressLeadingAndTrailingTrivia(property2.initializer); + ts2.copyComments(arg, property2); + return property2; + }); + if (hasRestParameter && functionArguments.length >= parameters.length) { + var restArguments = functionArguments.slice(parameters.length - 1); + var restProperty = ts2.factory.createPropertyAssignment(getParameterName(ts2.last(parameters)), ts2.factory.createArrayLiteralExpression(restArguments)); + properties.push(restProperty); + } + var objectLiteral = ts2.factory.createObjectLiteralExpression( + properties, + /*multiLine*/ + false + ); + return objectLiteral; + } + function createNewParameters(functionDeclaration, program, host) { + var checker = program.getTypeChecker(); + var refactorableParameters = getRefactorableParameters(functionDeclaration.parameters); + var bindingElements = ts2.map(refactorableParameters, createBindingElementFromParameterDeclaration); + var objectParameterName = ts2.factory.createObjectBindingPattern(bindingElements); + var objectParameterType = createParameterTypeNode(refactorableParameters); + var objectInitializer; + if (ts2.every(refactorableParameters, isOptionalParameter)) { + objectInitializer = ts2.factory.createObjectLiteralExpression(); + } + var objectParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + objectParameterName, + /*questionToken*/ + void 0, + objectParameterType, + objectInitializer + ); + if (hasThisParameter(functionDeclaration.parameters)) { + var thisParameter = functionDeclaration.parameters[0]; + var newThisParameter = ts2.factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + thisParameter.name, + /*questionToken*/ + void 0, + thisParameter.type + ); + ts2.suppressLeadingAndTrailingTrivia(newThisParameter.name); + ts2.copyComments(thisParameter.name, newThisParameter.name); + if (thisParameter.type) { + ts2.suppressLeadingAndTrailingTrivia(newThisParameter.type); + ts2.copyComments(thisParameter.type, newThisParameter.type); + } + return ts2.factory.createNodeArray([newThisParameter, objectParameter]); + } + return ts2.factory.createNodeArray([objectParameter]); + function createBindingElementFromParameterDeclaration(parameterDeclaration) { + var element = ts2.factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + getParameterName(parameterDeclaration), + ts2.isRestParameter(parameterDeclaration) && isOptionalParameter(parameterDeclaration) ? ts2.factory.createArrayLiteralExpression() : parameterDeclaration.initializer + ); + ts2.suppressLeadingAndTrailingTrivia(element); + if (parameterDeclaration.initializer && element.initializer) { + ts2.copyComments(parameterDeclaration.initializer, element.initializer); + } + return element; + } + function createParameterTypeNode(parameters) { + var members = ts2.map(parameters, createPropertySignatureFromParameterDeclaration); + var typeNode = ts2.addEmitFlags( + ts2.factory.createTypeLiteralNode(members), + 1 + /* EmitFlags.SingleLine */ + ); + return typeNode; + } + function createPropertySignatureFromParameterDeclaration(parameterDeclaration) { + var parameterType = parameterDeclaration.type; + if (!parameterType && (parameterDeclaration.initializer || ts2.isRestParameter(parameterDeclaration))) { + parameterType = getTypeNode(parameterDeclaration); + } + var propertySignature = ts2.factory.createPropertySignature( + /*modifiers*/ + void 0, + getParameterName(parameterDeclaration), + isOptionalParameter(parameterDeclaration) ? ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ) : parameterDeclaration.questionToken, + parameterType + ); + ts2.suppressLeadingAndTrailingTrivia(propertySignature); + ts2.copyComments(parameterDeclaration.name, propertySignature.name); + if (parameterDeclaration.type && propertySignature.type) { + ts2.copyComments(parameterDeclaration.type, propertySignature.type); + } + return propertySignature; + } + function getTypeNode(node) { + var type3 = checker.getTypeAtLocation(node); + return ts2.getTypeNodeIfAccessible(type3, node, program, host); + } + function isOptionalParameter(parameterDeclaration) { + if (ts2.isRestParameter(parameterDeclaration)) { + var type3 = checker.getTypeAtLocation(parameterDeclaration); + return !checker.isTupleType(type3); + } + return checker.isOptionalParameter(parameterDeclaration); + } + } + function getParameterName(paramDeclaration) { + return ts2.getTextOfIdentifierOrLiteral(paramDeclaration.name); + } + function getClassNames(constructorDeclaration) { + switch (constructorDeclaration.parent.kind) { + case 260: + var classDeclaration = constructorDeclaration.parent; + if (classDeclaration.name) + return [classDeclaration.name]; + var defaultModifier = ts2.Debug.checkDefined(ts2.findModifier( + classDeclaration, + 88 + /* SyntaxKind.DefaultKeyword */ + ), "Nameless class declaration should be a default export"); + return [defaultModifier]; + case 228: + var classExpression = constructorDeclaration.parent; + var variableDeclaration = constructorDeclaration.parent.parent; + var className = classExpression.name; + if (className) + return [className, variableDeclaration.name]; + return [variableDeclaration.name]; + } + } + function getFunctionNames(functionDeclaration) { + switch (functionDeclaration.kind) { + case 259: + if (functionDeclaration.name) + return [functionDeclaration.name]; + var defaultModifier = ts2.Debug.checkDefined(ts2.findModifier( + functionDeclaration, + 88 + /* SyntaxKind.DefaultKeyword */ + ), "Nameless function declaration should be a default export"); + return [defaultModifier]; + case 171: + return [functionDeclaration.name]; + case 173: + var ctrKeyword = ts2.Debug.checkDefined(ts2.findChildOfKind(functionDeclaration, 135, functionDeclaration.getSourceFile()), "Constructor declaration should have constructor keyword"); + if (functionDeclaration.parent.kind === 228) { + var variableDeclaration = functionDeclaration.parent.parent; + return [variableDeclaration.name, ctrKeyword]; + } + return [ctrKeyword]; + case 216: + return [functionDeclaration.parent.name]; + case 215: + if (functionDeclaration.name) + return [functionDeclaration.name, functionDeclaration.parent.name]; + return [functionDeclaration.parent.name]; + default: + return ts2.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind)); + } + } + })(convertParamsToDestructuredObject = refactor2.convertParamsToDestructuredObject || (refactor2.convertParamsToDestructuredObject = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var convertStringOrTemplateLiteral; + (function(convertStringOrTemplateLiteral2) { + var refactorName = "Convert to template string"; + var refactorDescription = ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_to_template_string); + var convertStringAction = { + name: refactorName, + description: refactorDescription, + kind: "refactor.rewrite.string" + }; + refactor2.registerRefactor(refactorName, { + kinds: [convertStringAction.kind], + getEditsForAction: getRefactorEditsToConvertToTemplateString, + getAvailableActions: getRefactorActionsToConvertToTemplateString + }); + function getRefactorActionsToConvertToTemplateString(context2) { + var file = context2.file, startPosition = context2.startPosition; + var node = getNodeOrParentOfParentheses(file, startPosition); + var maybeBinary = getParentBinaryExpression(node); + var refactorInfo = { name: refactorName, description: refactorDescription, actions: [] }; + if (ts2.isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation) { + refactorInfo.actions.push(convertStringAction); + return [refactorInfo]; + } else if (context2.preferences.provideRefactorNotApplicableReason) { + refactorInfo.actions.push(__assign16(__assign16({}, convertStringAction), { notApplicableReason: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Can_only_convert_string_concatenation) })); + return [refactorInfo]; + } + return ts2.emptyArray; + } + function getNodeOrParentOfParentheses(file, startPosition) { + var node = ts2.getTokenAtPosition(file, startPosition); + var nestedBinary = getParentBinaryExpression(node); + var isNonStringBinary = !treeToArray(nestedBinary).isValidConcatenation; + if (isNonStringBinary && ts2.isParenthesizedExpression(nestedBinary.parent) && ts2.isBinaryExpression(nestedBinary.parent.parent)) { + return nestedBinary.parent.parent; + } + return node; + } + function getRefactorEditsToConvertToTemplateString(context2, actionName) { + var file = context2.file, startPosition = context2.startPosition; + var node = getNodeOrParentOfParentheses(file, startPosition); + switch (actionName) { + case refactorDescription: + return { edits: getEditsForToTemplateLiteral(context2, node) }; + default: + return ts2.Debug.fail("invalid action"); + } + } + function getEditsForToTemplateLiteral(context2, node) { + var maybeBinary = getParentBinaryExpression(node); + var file = context2.file; + var templateLiteral = nodesToTemplate(treeToArray(maybeBinary), file); + var trailingCommentRanges = ts2.getTrailingCommentRanges(file.text, maybeBinary.end); + if (trailingCommentRanges) { + var lastComment = trailingCommentRanges[trailingCommentRanges.length - 1]; + var trailingRange_1 = { pos: trailingCommentRanges[0].pos, end: lastComment.end }; + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + t8.deleteRange(file, trailingRange_1); + t8.replaceNode(file, maybeBinary, templateLiteral); + }); + } else { + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(file, maybeBinary, templateLiteral); + }); + } + } + function isNotEqualsOperator(node) { + return node.operatorToken.kind !== 63; + } + function getParentBinaryExpression(expr) { + var container = ts2.findAncestor(expr.parent, function(n7) { + switch (n7.kind) { + case 208: + case 209: + return false; + case 225: + case 223: + return !(ts2.isBinaryExpression(n7.parent) && isNotEqualsOperator(n7.parent)); + default: + return "quit"; + } + }); + return container || expr; + } + function treeToArray(current) { + var loop = function(current2) { + if (!ts2.isBinaryExpression(current2)) { + return { + nodes: [current2], + operators: [], + validOperators: true, + hasString: ts2.isStringLiteral(current2) || ts2.isNoSubstitutionTemplateLiteral(current2) + }; + } + var _a3 = loop(current2.left), nodes2 = _a3.nodes, operators2 = _a3.operators, leftHasString = _a3.hasString, leftOperatorValid = _a3.validOperators; + if (!(leftHasString || ts2.isStringLiteral(current2.right) || ts2.isTemplateExpression(current2.right))) { + return { nodes: [current2], operators: [], hasString: false, validOperators: true }; + } + var currentOperatorValid = current2.operatorToken.kind === 39; + var validOperators2 = leftOperatorValid && currentOperatorValid; + nodes2.push(current2.right); + operators2.push(current2.operatorToken); + return { nodes: nodes2, operators: operators2, hasString: true, validOperators: validOperators2 }; + }; + var _a2 = loop(current), nodes = _a2.nodes, operators = _a2.operators, validOperators = _a2.validOperators, hasString = _a2.hasString; + return { nodes, operators, isValidConcatenation: validOperators && hasString }; + } + var copyTrailingOperatorComments = function(operators, file) { + return function(index4, targetNode) { + if (index4 < operators.length) { + ts2.copyTrailingComments( + operators[index4], + targetNode, + file, + 3, + /* hasTrailingNewLine */ + false + ); + } + }; + }; + var copyCommentFromMultiNode = function(nodes, file, copyOperatorComments) { + return function(indexes, targetNode) { + while (indexes.length > 0) { + var index4 = indexes.shift(); + ts2.copyTrailingComments( + nodes[index4], + targetNode, + file, + 3, + /* hasTrailingNewLine */ + false + ); + copyOperatorComments(index4, targetNode); + } + }; + }; + function escapeRawStringForTemplate(s7) { + return s7.replace(/\\.|[$`]/g, function(m7) { + return m7[0] === "\\" ? m7 : "\\" + m7; + }); + } + function getRawTextOfTemplate(node) { + var rightShaving = ts2.isTemplateHead(node) || ts2.isTemplateMiddle(node) ? -2 : -1; + return ts2.getTextOfNode(node).slice(1, rightShaving); + } + function concatConsecutiveString(index4, nodes) { + var indexes = []; + var text = "", rawText = ""; + while (index4 < nodes.length) { + var node = nodes[index4]; + if (ts2.isStringLiteralLike(node)) { + text += node.text; + rawText += escapeRawStringForTemplate(ts2.getTextOfNode(node).slice(1, -1)); + indexes.push(index4); + index4++; + } else if (ts2.isTemplateExpression(node)) { + text += node.head.text; + rawText += getRawTextOfTemplate(node.head); + break; + } else { + break; + } + } + return [index4, text, rawText, indexes]; + } + function nodesToTemplate(_a2, file) { + var nodes = _a2.nodes, operators = _a2.operators; + var copyOperatorComments = copyTrailingOperatorComments(operators, file); + var copyCommentFromStringLiterals = copyCommentFromMultiNode(nodes, file, copyOperatorComments); + var _b = concatConsecutiveString(0, nodes), begin = _b[0], headText = _b[1], rawHeadText = _b[2], headIndexes = _b[3]; + if (begin === nodes.length) { + var noSubstitutionTemplateLiteral = ts2.factory.createNoSubstitutionTemplateLiteral(headText, rawHeadText); + copyCommentFromStringLiterals(headIndexes, noSubstitutionTemplateLiteral); + return noSubstitutionTemplateLiteral; + } + var templateSpans = []; + var templateHead = ts2.factory.createTemplateHead(headText, rawHeadText); + copyCommentFromStringLiterals(headIndexes, templateHead); + var _loop_19 = function(i8) { + var currentNode = getExpressionFromParenthesesOrExpression(nodes[i8]); + copyOperatorComments(i8, currentNode); + var _c = concatConsecutiveString(i8 + 1, nodes), newIndex = _c[0], subsequentText = _c[1], rawSubsequentText = _c[2], stringIndexes = _c[3]; + i8 = newIndex - 1; + var isLast = i8 === nodes.length - 1; + if (ts2.isTemplateExpression(currentNode)) { + var spans = ts2.map(currentNode.templateSpans, function(span, index4) { + copyExpressionComments(span); + var isLastSpan = index4 === currentNode.templateSpans.length - 1; + var text = span.literal.text + (isLastSpan ? subsequentText : ""); + var rawText = getRawTextOfTemplate(span.literal) + (isLastSpan ? rawSubsequentText : ""); + return ts2.factory.createTemplateSpan(span.expression, isLast && isLastSpan ? ts2.factory.createTemplateTail(text, rawText) : ts2.factory.createTemplateMiddle(text, rawText)); + }); + templateSpans.push.apply(templateSpans, spans); + } else { + var templatePart = isLast ? ts2.factory.createTemplateTail(subsequentText, rawSubsequentText) : ts2.factory.createTemplateMiddle(subsequentText, rawSubsequentText); + copyCommentFromStringLiterals(stringIndexes, templatePart); + templateSpans.push(ts2.factory.createTemplateSpan(currentNode, templatePart)); + } + out_i_1 = i8; + }; + var out_i_1; + for (var i7 = begin; i7 < nodes.length; i7++) { + _loop_19(i7); + i7 = out_i_1; + } + return ts2.factory.createTemplateExpression(templateHead, templateSpans); + } + function copyExpressionComments(node) { + var file = node.getSourceFile(); + ts2.copyTrailingComments( + node, + node.expression, + file, + 3, + /* hasTrailingNewLine */ + false + ); + ts2.copyTrailingAsLeadingComments( + node.expression, + node.expression, + file, + 3, + /* hasTrailingNewLine */ + false + ); + } + function getExpressionFromParenthesesOrExpression(node) { + if (ts2.isParenthesizedExpression(node)) { + copyExpressionComments(node); + node = node.expression; + } + return node; + } + })(convertStringOrTemplateLiteral = refactor2.convertStringOrTemplateLiteral || (refactor2.convertStringOrTemplateLiteral = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var convertArrowFunctionOrFunctionExpression; + (function(convertArrowFunctionOrFunctionExpression2) { + var refactorName = "Convert arrow function or function expression"; + var refactorDescription = ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_arrow_function_or_function_expression); + var toAnonymousFunctionAction = { + name: "Convert to anonymous function", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_to_anonymous_function), + kind: "refactor.rewrite.function.anonymous" + }; + var toNamedFunctionAction = { + name: "Convert to named function", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_to_named_function), + kind: "refactor.rewrite.function.named" + }; + var toArrowFunctionAction = { + name: "Convert to arrow function", + description: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Convert_to_arrow_function), + kind: "refactor.rewrite.function.arrow" + }; + refactor2.registerRefactor(refactorName, { + kinds: [ + toAnonymousFunctionAction.kind, + toNamedFunctionAction.kind, + toArrowFunctionAction.kind + ], + getEditsForAction: getRefactorEditsToConvertFunctionExpressions, + getAvailableActions: getRefactorActionsToConvertFunctionExpressions + }); + function getRefactorActionsToConvertFunctionExpressions(context2) { + var file = context2.file, startPosition = context2.startPosition, program = context2.program, kind = context2.kind; + var info2 = getFunctionInfo(file, startPosition, program); + if (!info2) + return ts2.emptyArray; + var selectedVariableDeclaration = info2.selectedVariableDeclaration, func = info2.func; + var possibleActions = []; + var errors = []; + if (refactor2.refactorKindBeginsWith(toNamedFunctionAction.kind, kind)) { + var error2 = selectedVariableDeclaration || ts2.isArrowFunction(func) && ts2.isVariableDeclaration(func.parent) ? void 0 : ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_convert_to_named_function); + if (error2) { + errors.push(__assign16(__assign16({}, toNamedFunctionAction), { notApplicableReason: error2 })); + } else { + possibleActions.push(toNamedFunctionAction); + } + } + if (refactor2.refactorKindBeginsWith(toAnonymousFunctionAction.kind, kind)) { + var error2 = !selectedVariableDeclaration && ts2.isArrowFunction(func) ? void 0 : ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_convert_to_anonymous_function); + if (error2) { + errors.push(__assign16(__assign16({}, toAnonymousFunctionAction), { notApplicableReason: error2 })); + } else { + possibleActions.push(toAnonymousFunctionAction); + } + } + if (refactor2.refactorKindBeginsWith(toArrowFunctionAction.kind, kind)) { + var error2 = ts2.isFunctionExpression(func) ? void 0 : ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_convert_to_arrow_function); + if (error2) { + errors.push(__assign16(__assign16({}, toArrowFunctionAction), { notApplicableReason: error2 })); + } else { + possibleActions.push(toArrowFunctionAction); + } + } + return [{ + name: refactorName, + description: refactorDescription, + actions: possibleActions.length === 0 && context2.preferences.provideRefactorNotApplicableReason ? errors : possibleActions + }]; + } + function getRefactorEditsToConvertFunctionExpressions(context2, actionName) { + var file = context2.file, startPosition = context2.startPosition, program = context2.program; + var info2 = getFunctionInfo(file, startPosition, program); + if (!info2) + return void 0; + var func = info2.func; + var edits = []; + switch (actionName) { + case toAnonymousFunctionAction.name: + edits.push.apply(edits, getEditInfoForConvertToAnonymousFunction(context2, func)); + break; + case toNamedFunctionAction.name: + var variableInfo = getVariableInfo(func); + if (!variableInfo) + return void 0; + edits.push.apply(edits, getEditInfoForConvertToNamedFunction(context2, func, variableInfo)); + break; + case toArrowFunctionAction.name: + if (!ts2.isFunctionExpression(func)) + return void 0; + edits.push.apply(edits, getEditInfoForConvertToArrowFunction(context2, func)); + break; + default: + return ts2.Debug.fail("invalid action"); + } + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + function containingThis(node) { + var containsThis = false; + node.forEachChild(function checkThis(child) { + if (ts2.isThis(child)) { + containsThis = true; + return; + } + if (!ts2.isClassLike(child) && !ts2.isFunctionDeclaration(child) && !ts2.isFunctionExpression(child)) { + ts2.forEachChild(child, checkThis); + } + }); + return containsThis; + } + function getFunctionInfo(file, startPosition, program) { + var token = ts2.getTokenAtPosition(file, startPosition); + var typeChecker = program.getTypeChecker(); + var func = tryGetFunctionFromVariableDeclaration(file, typeChecker, token.parent); + if (func && !containingThis(func.body) && !typeChecker.containsArgumentsReference(func)) { + return { selectedVariableDeclaration: true, func }; + } + var maybeFunc = ts2.getContainingFunction(token); + if (maybeFunc && (ts2.isFunctionExpression(maybeFunc) || ts2.isArrowFunction(maybeFunc)) && !ts2.rangeContainsRange(maybeFunc.body, token) && !containingThis(maybeFunc.body) && !typeChecker.containsArgumentsReference(maybeFunc)) { + if (ts2.isFunctionExpression(maybeFunc) && isFunctionReferencedInFile(file, typeChecker, maybeFunc)) + return void 0; + return { selectedVariableDeclaration: false, func: maybeFunc }; + } + return void 0; + } + function isSingleVariableDeclaration(parent2) { + return ts2.isVariableDeclaration(parent2) || ts2.isVariableDeclarationList(parent2) && parent2.declarations.length === 1; + } + function tryGetFunctionFromVariableDeclaration(sourceFile, typeChecker, parent2) { + if (!isSingleVariableDeclaration(parent2)) { + return void 0; + } + var variableDeclaration = ts2.isVariableDeclaration(parent2) ? parent2 : ts2.first(parent2.declarations); + var initializer = variableDeclaration.initializer; + if (initializer && (ts2.isArrowFunction(initializer) || ts2.isFunctionExpression(initializer) && !isFunctionReferencedInFile(sourceFile, typeChecker, initializer))) { + return initializer; + } + return void 0; + } + function convertToBlock(body) { + if (ts2.isExpression(body)) { + var returnStatement = ts2.factory.createReturnStatement(body); + var file = body.getSourceFile(); + ts2.suppressLeadingAndTrailingTrivia(returnStatement); + ts2.copyTrailingAsLeadingComments( + body, + returnStatement, + file, + /* commentKind */ + void 0, + /* hasTrailingNewLine */ + true + ); + return ts2.factory.createBlock( + [returnStatement], + /* multiLine */ + true + ); + } else { + return body; + } + } + function getVariableInfo(func) { + var variableDeclaration = func.parent; + if (!ts2.isVariableDeclaration(variableDeclaration) || !ts2.isVariableDeclarationInVariableStatement(variableDeclaration)) + return void 0; + var variableDeclarationList = variableDeclaration.parent; + var statement = variableDeclarationList.parent; + if (!ts2.isVariableDeclarationList(variableDeclarationList) || !ts2.isVariableStatement(statement) || !ts2.isIdentifier(variableDeclaration.name)) + return void 0; + return { variableDeclaration, variableDeclarationList, statement, name: variableDeclaration.name }; + } + function getEditInfoForConvertToAnonymousFunction(context2, func) { + var file = context2.file; + var body = convertToBlock(func.body); + var newNode = ts2.factory.createFunctionExpression( + func.modifiers, + func.asteriskToken, + /* name */ + void 0, + func.typeParameters, + func.parameters, + func.type, + body + ); + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(file, func, newNode); + }); + } + function getEditInfoForConvertToNamedFunction(context2, func, variableInfo) { + var file = context2.file; + var body = convertToBlock(func.body); + var variableDeclaration = variableInfo.variableDeclaration, variableDeclarationList = variableInfo.variableDeclarationList, statement = variableInfo.statement, name2 = variableInfo.name; + ts2.suppressLeadingTrivia(statement); + var modifiersFlags = ts2.getCombinedModifierFlags(variableDeclaration) & 1 | ts2.getEffectiveModifierFlags(func); + var modifiers = ts2.factory.createModifiersFromModifierFlags(modifiersFlags); + var newNode = ts2.factory.createFunctionDeclaration(ts2.length(modifiers) ? modifiers : void 0, func.asteriskToken, name2, func.typeParameters, func.parameters, func.type, body); + if (variableDeclarationList.declarations.length === 1) { + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(file, statement, newNode); + }); + } else { + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + t8.delete(file, variableDeclaration); + t8.insertNodeAfter(file, statement, newNode); + }); + } + } + function getEditInfoForConvertToArrowFunction(context2, func) { + var file = context2.file; + var statements = func.body.statements; + var head2 = statements[0]; + var body; + if (canBeConvertedToExpression(func.body, head2)) { + body = head2.expression; + ts2.suppressLeadingAndTrailingTrivia(body); + ts2.copyComments(head2, body); + } else { + body = func.body; + } + var newNode = ts2.factory.createArrowFunction(func.modifiers, func.typeParameters, func.parameters, func.type, ts2.factory.createToken( + 38 + /* SyntaxKind.EqualsGreaterThanToken */ + ), body); + return ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return t8.replaceNode(file, func, newNode); + }); + } + function canBeConvertedToExpression(body, head2) { + return body.statements.length === 1 && (ts2.isReturnStatement(head2) && !!head2.expression); + } + function isFunctionReferencedInFile(sourceFile, typeChecker, node) { + return !!node.name && ts2.FindAllReferences.Core.isSymbolReferencedInFile(node.name, typeChecker, sourceFile); + } + })(convertArrowFunctionOrFunctionExpression = refactor2.convertArrowFunctionOrFunctionExpression || (refactor2.convertArrowFunctionOrFunctionExpression = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var refactor; + (function(refactor2) { + var inferFunctionReturnType; + (function(inferFunctionReturnType2) { + var refactorName = "Infer function return type"; + var refactorDescription = ts2.Diagnostics.Infer_function_return_type.message; + var inferReturnTypeAction = { + name: refactorName, + description: refactorDescription, + kind: "refactor.rewrite.function.returnType" + }; + refactor2.registerRefactor(refactorName, { + kinds: [inferReturnTypeAction.kind], + getEditsForAction: getRefactorEditsToInferReturnType, + getAvailableActions: getRefactorActionsToInferReturnType + }); + function getRefactorEditsToInferReturnType(context2) { + var info2 = getInfo(context2); + if (info2 && !refactor2.isRefactorErrorInfo(info2)) { + var edits = ts2.textChanges.ChangeTracker.with(context2, function(t8) { + return doChange(context2.file, t8, info2.declaration, info2.returnTypeNode); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + return void 0; + } + function getRefactorActionsToInferReturnType(context2) { + var info2 = getInfo(context2); + if (!info2) + return ts2.emptyArray; + if (!refactor2.isRefactorErrorInfo(info2)) { + return [{ + name: refactorName, + description: refactorDescription, + actions: [inferReturnTypeAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName, + description: refactorDescription, + actions: [__assign16(__assign16({}, inferReturnTypeAction), { notApplicableReason: info2.error })] + }]; + } + return ts2.emptyArray; + } + function doChange(sourceFile, changes, declaration, typeNode) { + var closeParen = ts2.findChildOfKind(declaration, 21, sourceFile); + var needParens = ts2.isArrowFunction(declaration) && closeParen === void 0; + var endNode = needParens ? ts2.first(declaration.parameters) : closeParen; + if (endNode) { + if (needParens) { + changes.insertNodeBefore(sourceFile, endNode, ts2.factory.createToken( + 20 + /* SyntaxKind.OpenParenToken */ + )); + changes.insertNodeAfter(sourceFile, endNode, ts2.factory.createToken( + 21 + /* SyntaxKind.CloseParenToken */ + )); + } + changes.insertNodeAt(sourceFile, endNode.end, typeNode, { prefix: ": " }); + } + } + function getInfo(context2) { + if (ts2.isInJSFile(context2.file) || !refactor2.refactorKindBeginsWith(inferReturnTypeAction.kind, context2.kind)) + return; + var token = ts2.getTokenAtPosition(context2.file, context2.startPosition); + var declaration = ts2.findAncestor(token, function(n7) { + return ts2.isBlock(n7) || n7.parent && ts2.isArrowFunction(n7.parent) && (n7.kind === 38 || n7.parent.body === n7) ? "quit" : isConvertibleDeclaration(n7); + }); + if (!declaration || !declaration.body || declaration.type) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Return_type_must_be_inferred_from_a_function) }; + } + var typeChecker = context2.program.getTypeChecker(); + var returnType = tryGetReturnType(typeChecker, declaration); + if (!returnType) { + return { error: ts2.getLocaleSpecificMessage(ts2.Diagnostics.Could_not_determine_function_return_type) }; + } + var returnTypeNode = typeChecker.typeToTypeNode( + returnType, + declaration, + 1 + /* NodeBuilderFlags.NoTruncation */ + ); + if (returnTypeNode) { + return { declaration, returnTypeNode }; + } + } + function isConvertibleDeclaration(node) { + switch (node.kind) { + case 259: + case 215: + case 216: + case 171: + return true; + default: + return false; + } + } + function tryGetReturnType(typeChecker, node) { + if (typeChecker.isImplementationOfOverload(node)) { + var signatures = typeChecker.getTypeAtLocation(node).getCallSignatures(); + if (signatures.length > 1) { + return typeChecker.getUnionType(ts2.mapDefined(signatures, function(s7) { + return s7.getReturnType(); + })); + } + } + var signature = typeChecker.getSignatureFromDeclaration(node); + if (signature) { + return typeChecker.getReturnTypeOfSignature(signature); + } + } + })(inferFunctionReturnType = refactor2.inferFunctionReturnType || (refactor2.inferFunctionReturnType = {})); + })(refactor = ts2.refactor || (ts2.refactor = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.servicesVersion = "0.8"; + function createNode2(kind, pos, end, parent2) { + var node = ts2.isNodeKind(kind) ? new NodeObject(kind, pos, end) : kind === 79 ? new IdentifierObject(79, pos, end) : kind === 80 ? new PrivateIdentifierObject(80, pos, end) : new TokenObject(kind, pos, end); + node.parent = parent2; + node.flags = parent2.flags & 50720768; + return node; + } + var NodeObject = ( + /** @class */ + function() { + function NodeObject2(kind, pos, end) { + this.pos = pos; + this.end = end; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + this.kind = kind; + } + NodeObject2.prototype.assertHasRealPosition = function(message) { + ts2.Debug.assert(!ts2.positionIsSynthesized(this.pos) && !ts2.positionIsSynthesized(this.end), message || "Node must have a real position for this operation"); + }; + NodeObject2.prototype.getSourceFile = function() { + return ts2.getSourceFileOfNode(this); + }; + NodeObject2.prototype.getStart = function(sourceFile, includeJsDocComment) { + this.assertHasRealPosition(); + return ts2.getTokenPosOfNode(this, sourceFile, includeJsDocComment); + }; + NodeObject2.prototype.getFullStart = function() { + this.assertHasRealPosition(); + return this.pos; + }; + NodeObject2.prototype.getEnd = function() { + this.assertHasRealPosition(); + return this.end; + }; + NodeObject2.prototype.getWidth = function(sourceFile) { + this.assertHasRealPosition(); + return this.getEnd() - this.getStart(sourceFile); + }; + NodeObject2.prototype.getFullWidth = function() { + this.assertHasRealPosition(); + return this.end - this.pos; + }; + NodeObject2.prototype.getLeadingTriviaWidth = function(sourceFile) { + this.assertHasRealPosition(); + return this.getStart(sourceFile) - this.pos; + }; + NodeObject2.prototype.getFullText = function(sourceFile) { + this.assertHasRealPosition(); + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + }; + NodeObject2.prototype.getText = function(sourceFile) { + this.assertHasRealPosition(); + if (!sourceFile) { + sourceFile = this.getSourceFile(); + } + return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); + }; + NodeObject2.prototype.getChildCount = function(sourceFile) { + return this.getChildren(sourceFile).length; + }; + NodeObject2.prototype.getChildAt = function(index4, sourceFile) { + return this.getChildren(sourceFile)[index4]; + }; + NodeObject2.prototype.getChildren = function(sourceFile) { + this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"); + return this._children || (this._children = createChildren(this, sourceFile)); + }; + NodeObject2.prototype.getFirstToken = function(sourceFile) { + this.assertHasRealPosition(); + var children = this.getChildren(sourceFile); + if (!children.length) { + return void 0; + } + var child = ts2.find(children, function(kid) { + return kid.kind < 312 || kid.kind > 350; + }); + return child.kind < 163 ? child : child.getFirstToken(sourceFile); + }; + NodeObject2.prototype.getLastToken = function(sourceFile) { + this.assertHasRealPosition(); + var children = this.getChildren(sourceFile); + var child = ts2.lastOrUndefined(children); + if (!child) { + return void 0; + } + return child.kind < 163 ? child : child.getLastToken(sourceFile); + }; + NodeObject2.prototype.forEachChild = function(cbNode, cbNodeArray) { + return ts2.forEachChild(this, cbNode, cbNodeArray); + }; + return NodeObject2; + }() + ); + function createChildren(node, sourceFile) { + if (!ts2.isNodeKind(node.kind)) { + return ts2.emptyArray; + } + var children = []; + if (ts2.isJSDocCommentContainingNode(node)) { + node.forEachChild(function(child) { + children.push(child); + }); + return children; + } + ts2.scanner.setText((sourceFile || node.getSourceFile()).text); + var pos = node.pos; + var processNode = function(child) { + addSyntheticNodes(children, pos, child.pos, node); + children.push(child); + pos = child.end; + }; + var processNodes = function(nodes) { + addSyntheticNodes(children, pos, nodes.pos, node); + children.push(createSyntaxList(nodes, node)); + pos = nodes.end; + }; + ts2.forEach(node.jsDoc, processNode); + pos = node.pos; + node.forEachChild(processNode, processNodes); + addSyntheticNodes(children, pos, node.end, node); + ts2.scanner.setText(void 0); + return children; + } + function addSyntheticNodes(nodes, pos, end, parent2) { + ts2.scanner.setTextPos(pos); + while (pos < end) { + var token = ts2.scanner.scan(); + var textPos = ts2.scanner.getTextPos(); + if (textPos <= end) { + if (token === 79) { + ts2.Debug.fail("Did not expect ".concat(ts2.Debug.formatSyntaxKind(parent2.kind), " to have an Identifier in its trivia")); + } + nodes.push(createNode2(token, pos, textPos, parent2)); + } + pos = textPos; + if (token === 1) { + break; + } + } + } + function createSyntaxList(nodes, parent2) { + var list = createNode2(351, nodes.pos, nodes.end, parent2); + list._children = []; + var pos = nodes.pos; + for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) { + var node = nodes_2[_i]; + addSyntheticNodes(list._children, pos, node.pos, parent2); + list._children.push(node); + pos = node.end; + } + addSyntheticNodes(list._children, pos, nodes.end, parent2); + return list; + } + var TokenOrIdentifierObject = ( + /** @class */ + function() { + function TokenOrIdentifierObject2(pos, end) { + this.pos = pos; + this.end = end; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + } + TokenOrIdentifierObject2.prototype.getSourceFile = function() { + return ts2.getSourceFileOfNode(this); + }; + TokenOrIdentifierObject2.prototype.getStart = function(sourceFile, includeJsDocComment) { + return ts2.getTokenPosOfNode(this, sourceFile, includeJsDocComment); + }; + TokenOrIdentifierObject2.prototype.getFullStart = function() { + return this.pos; + }; + TokenOrIdentifierObject2.prototype.getEnd = function() { + return this.end; + }; + TokenOrIdentifierObject2.prototype.getWidth = function(sourceFile) { + return this.getEnd() - this.getStart(sourceFile); + }; + TokenOrIdentifierObject2.prototype.getFullWidth = function() { + return this.end - this.pos; + }; + TokenOrIdentifierObject2.prototype.getLeadingTriviaWidth = function(sourceFile) { + return this.getStart(sourceFile) - this.pos; + }; + TokenOrIdentifierObject2.prototype.getFullText = function(sourceFile) { + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + }; + TokenOrIdentifierObject2.prototype.getText = function(sourceFile) { + if (!sourceFile) { + sourceFile = this.getSourceFile(); + } + return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); + }; + TokenOrIdentifierObject2.prototype.getChildCount = function() { + return this.getChildren().length; + }; + TokenOrIdentifierObject2.prototype.getChildAt = function(index4) { + return this.getChildren()[index4]; + }; + TokenOrIdentifierObject2.prototype.getChildren = function() { + return this.kind === 1 ? this.jsDoc || ts2.emptyArray : ts2.emptyArray; + }; + TokenOrIdentifierObject2.prototype.getFirstToken = function() { + return void 0; + }; + TokenOrIdentifierObject2.prototype.getLastToken = function() { + return void 0; + }; + TokenOrIdentifierObject2.prototype.forEachChild = function() { + return void 0; + }; + return TokenOrIdentifierObject2; + }() + ); + var SymbolObject = ( + /** @class */ + function() { + function SymbolObject2(flags, name2) { + this.flags = flags; + this.escapedName = name2; + } + SymbolObject2.prototype.getFlags = function() { + return this.flags; + }; + Object.defineProperty(SymbolObject2.prototype, "name", { + get: function() { + return ts2.symbolName(this); + }, + enumerable: false, + configurable: true + }); + SymbolObject2.prototype.getEscapedName = function() { + return this.escapedName; + }; + SymbolObject2.prototype.getName = function() { + return this.name; + }; + SymbolObject2.prototype.getDeclarations = function() { + return this.declarations; + }; + SymbolObject2.prototype.getDocumentationComment = function(checker) { + if (!this.documentationComment) { + this.documentationComment = ts2.emptyArray; + if (!this.declarations && this.target && this.target.tupleLabelDeclaration) { + var labelDecl = this.target.tupleLabelDeclaration; + this.documentationComment = getDocumentationComment([labelDecl], checker); + } else { + this.documentationComment = getDocumentationComment(this.declarations, checker); + } + } + return this.documentationComment; + }; + SymbolObject2.prototype.getContextualDocumentationComment = function(context2, checker) { + if (context2) { + if (ts2.isGetAccessor(context2)) { + if (!this.contextualGetAccessorDocumentationComment) { + this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts2.filter(this.declarations, ts2.isGetAccessor), checker); + } + if (ts2.length(this.contextualGetAccessorDocumentationComment)) { + return this.contextualGetAccessorDocumentationComment; + } + } + if (ts2.isSetAccessor(context2)) { + if (!this.contextualSetAccessorDocumentationComment) { + this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts2.filter(this.declarations, ts2.isSetAccessor), checker); + } + if (ts2.length(this.contextualSetAccessorDocumentationComment)) { + return this.contextualSetAccessorDocumentationComment; + } + } + } + return this.getDocumentationComment(checker); + }; + SymbolObject2.prototype.getJsDocTags = function(checker) { + if (this.tags === void 0) { + this.tags = getJsDocTagsOfDeclarations(this.declarations, checker); + } + return this.tags; + }; + SymbolObject2.prototype.getContextualJsDocTags = function(context2, checker) { + if (context2) { + if (ts2.isGetAccessor(context2)) { + if (!this.contextualGetAccessorTags) { + this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(ts2.filter(this.declarations, ts2.isGetAccessor), checker); + } + if (ts2.length(this.contextualGetAccessorTags)) { + return this.contextualGetAccessorTags; + } + } + if (ts2.isSetAccessor(context2)) { + if (!this.contextualSetAccessorTags) { + this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(ts2.filter(this.declarations, ts2.isSetAccessor), checker); + } + if (ts2.length(this.contextualSetAccessorTags)) { + return this.contextualSetAccessorTags; + } + } + } + return this.getJsDocTags(checker); + }; + return SymbolObject2; + }() + ); + var TokenObject = ( + /** @class */ + function(_super) { + __extends10(TokenObject2, _super); + function TokenObject2(kind, pos, end) { + var _this = _super.call(this, pos, end) || this; + _this.kind = kind; + return _this; + } + return TokenObject2; + }(TokenOrIdentifierObject) + ); + var IdentifierObject = ( + /** @class */ + function(_super) { + __extends10(IdentifierObject2, _super); + function IdentifierObject2(_kind, pos, end) { + var _this = _super.call(this, pos, end) || this; + _this.kind = 79; + return _this; + } + Object.defineProperty(IdentifierObject2.prototype, "text", { + get: function() { + return ts2.idText(this); + }, + enumerable: false, + configurable: true + }); + return IdentifierObject2; + }(TokenOrIdentifierObject) + ); + IdentifierObject.prototype.kind = 79; + var PrivateIdentifierObject = ( + /** @class */ + function(_super) { + __extends10(PrivateIdentifierObject2, _super); + function PrivateIdentifierObject2(_kind, pos, end) { + return _super.call(this, pos, end) || this; + } + Object.defineProperty(PrivateIdentifierObject2.prototype, "text", { + get: function() { + return ts2.idText(this); + }, + enumerable: false, + configurable: true + }); + return PrivateIdentifierObject2; + }(TokenOrIdentifierObject) + ); + PrivateIdentifierObject.prototype.kind = 80; + var TypeObject = ( + /** @class */ + function() { + function TypeObject2(checker, flags) { + this.checker = checker; + this.flags = flags; + } + TypeObject2.prototype.getFlags = function() { + return this.flags; + }; + TypeObject2.prototype.getSymbol = function() { + return this.symbol; + }; + TypeObject2.prototype.getProperties = function() { + return this.checker.getPropertiesOfType(this); + }; + TypeObject2.prototype.getProperty = function(propertyName) { + return this.checker.getPropertyOfType(this, propertyName); + }; + TypeObject2.prototype.getApparentProperties = function() { + return this.checker.getAugmentedPropertiesOfType(this); + }; + TypeObject2.prototype.getCallSignatures = function() { + return this.checker.getSignaturesOfType( + this, + 0 + /* SignatureKind.Call */ + ); + }; + TypeObject2.prototype.getConstructSignatures = function() { + return this.checker.getSignaturesOfType( + this, + 1 + /* SignatureKind.Construct */ + ); + }; + TypeObject2.prototype.getStringIndexType = function() { + return this.checker.getIndexTypeOfType( + this, + 0 + /* IndexKind.String */ + ); + }; + TypeObject2.prototype.getNumberIndexType = function() { + return this.checker.getIndexTypeOfType( + this, + 1 + /* IndexKind.Number */ + ); + }; + TypeObject2.prototype.getBaseTypes = function() { + return this.isClassOrInterface() ? this.checker.getBaseTypes(this) : void 0; + }; + TypeObject2.prototype.isNullableType = function() { + return this.checker.isNullableType(this); + }; + TypeObject2.prototype.getNonNullableType = function() { + return this.checker.getNonNullableType(this); + }; + TypeObject2.prototype.getNonOptionalType = function() { + return this.checker.getNonOptionalType(this); + }; + TypeObject2.prototype.getConstraint = function() { + return this.checker.getBaseConstraintOfType(this); + }; + TypeObject2.prototype.getDefault = function() { + return this.checker.getDefaultFromTypeParameter(this); + }; + TypeObject2.prototype.isUnion = function() { + return !!(this.flags & 1048576); + }; + TypeObject2.prototype.isIntersection = function() { + return !!(this.flags & 2097152); + }; + TypeObject2.prototype.isUnionOrIntersection = function() { + return !!(this.flags & 3145728); + }; + TypeObject2.prototype.isLiteral = function() { + return !!(this.flags & 384); + }; + TypeObject2.prototype.isStringLiteral = function() { + return !!(this.flags & 128); + }; + TypeObject2.prototype.isNumberLiteral = function() { + return !!(this.flags & 256); + }; + TypeObject2.prototype.isTypeParameter = function() { + return !!(this.flags & 262144); + }; + TypeObject2.prototype.isClassOrInterface = function() { + return !!(ts2.getObjectFlags(this) & 3); + }; + TypeObject2.prototype.isClass = function() { + return !!(ts2.getObjectFlags(this) & 1); + }; + TypeObject2.prototype.isIndexType = function() { + return !!(this.flags & 4194304); + }; + Object.defineProperty(TypeObject2.prototype, "typeArguments", { + /** + * This polyfills `referenceType.typeArguments` for API consumers + */ + get: function() { + if (ts2.getObjectFlags(this) & 4) { + return this.checker.getTypeArguments(this); + } + return void 0; + }, + enumerable: false, + configurable: true + }); + return TypeObject2; + }() + ); + var SignatureObject = ( + /** @class */ + function() { + function SignatureObject2(checker, flags) { + this.checker = checker; + this.flags = flags; + } + SignatureObject2.prototype.getDeclaration = function() { + return this.declaration; + }; + SignatureObject2.prototype.getTypeParameters = function() { + return this.typeParameters; + }; + SignatureObject2.prototype.getParameters = function() { + return this.parameters; + }; + SignatureObject2.prototype.getReturnType = function() { + return this.checker.getReturnTypeOfSignature(this); + }; + SignatureObject2.prototype.getTypeParameterAtPosition = function(pos) { + var type3 = this.checker.getParameterType(this, pos); + if (type3.isIndexType() && ts2.isThisTypeParameter(type3.type)) { + var constraint = type3.type.getConstraint(); + if (constraint) { + return this.checker.getIndexType(constraint); + } + } + return type3; + }; + SignatureObject2.prototype.getDocumentationComment = function() { + return this.documentationComment || (this.documentationComment = getDocumentationComment(ts2.singleElementArray(this.declaration), this.checker)); + }; + SignatureObject2.prototype.getJsDocTags = function() { + return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(ts2.singleElementArray(this.declaration), this.checker)); + }; + return SignatureObject2; + }() + ); + function hasJSDocInheritDocTag(node) { + return ts2.getJSDocTags(node).some(function(tag) { + return tag.tagName.text === "inheritDoc" || tag.tagName.text === "inheritdoc"; + }); + } + function getJsDocTagsOfDeclarations(declarations, checker) { + if (!declarations) + return ts2.emptyArray; + var tags6 = ts2.JsDoc.getJsDocTagsFromDeclarations(declarations, checker); + if (checker && (tags6.length === 0 || declarations.some(hasJSDocInheritDocTag))) { + var seenSymbols_1 = new ts2.Set(); + var _loop_20 = function(declaration2) { + var inheritedTags = findBaseOfDeclaration(checker, declaration2, function(symbol) { + var _a2; + if (!seenSymbols_1.has(symbol)) { + seenSymbols_1.add(symbol); + if (declaration2.kind === 174 || declaration2.kind === 175) { + return symbol.getContextualJsDocTags(declaration2, checker); + } + return ((_a2 = symbol.declarations) === null || _a2 === void 0 ? void 0 : _a2.length) === 1 ? symbol.getJsDocTags() : void 0; + } + }); + if (inheritedTags) { + tags6 = __spreadArray9(__spreadArray9([], inheritedTags, true), tags6, true); + } + }; + for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) { + var declaration = declarations_6[_i]; + _loop_20(declaration); + } + } + return tags6; + } + function getDocumentationComment(declarations, checker) { + if (!declarations) + return ts2.emptyArray; + var doc = ts2.JsDoc.getJsDocCommentsFromDeclarations(declarations, checker); + if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) { + var seenSymbols_2 = new ts2.Set(); + var _loop_21 = function(declaration2) { + var inheritedDocs = findBaseOfDeclaration(checker, declaration2, function(symbol) { + if (!seenSymbols_2.has(symbol)) { + seenSymbols_2.add(symbol); + if (declaration2.kind === 174 || declaration2.kind === 175) { + return symbol.getContextualDocumentationComment(declaration2, checker); + } + return symbol.getDocumentationComment(checker); + } + }); + if (inheritedDocs) + doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts2.lineBreakPart(), doc); + }; + for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { + var declaration = declarations_7[_i]; + _loop_21(declaration); + } + } + return doc; + } + function findBaseOfDeclaration(checker, declaration, cb) { + var _a2; + var classOrInterfaceDeclaration = ((_a2 = declaration.parent) === null || _a2 === void 0 ? void 0 : _a2.kind) === 173 ? declaration.parent.parent : declaration.parent; + if (!classOrInterfaceDeclaration) + return; + var isStaticMember = ts2.hasStaticModifier(declaration); + return ts2.firstDefined(ts2.getAllSuperTypeNodes(classOrInterfaceDeclaration), function(superTypeNode) { + var baseType = checker.getTypeAtLocation(superTypeNode); + var type3 = isStaticMember && baseType.symbol ? checker.getTypeOfSymbol(baseType.symbol) : baseType; + var symbol = checker.getPropertyOfType(type3, declaration.symbol.name); + return symbol ? cb(symbol) : void 0; + }); + } + var SourceFileObject = ( + /** @class */ + function(_super) { + __extends10(SourceFileObject2, _super); + function SourceFileObject2(kind, pos, end) { + var _this = _super.call(this, kind, pos, end) || this; + _this.kind = 308; + return _this; + } + SourceFileObject2.prototype.update = function(newText, textChangeRange) { + return ts2.updateSourceFile(this, newText, textChangeRange); + }; + SourceFileObject2.prototype.getLineAndCharacterOfPosition = function(position) { + return ts2.getLineAndCharacterOfPosition(this, position); + }; + SourceFileObject2.prototype.getLineStarts = function() { + return ts2.getLineStarts(this); + }; + SourceFileObject2.prototype.getPositionOfLineAndCharacter = function(line, character, allowEdits) { + return ts2.computePositionOfLineAndCharacter(ts2.getLineStarts(this), line, character, this.text, allowEdits); + }; + SourceFileObject2.prototype.getLineEndOfPosition = function(pos) { + var line = this.getLineAndCharacterOfPosition(pos).line; + var lineStarts = this.getLineStarts(); + var lastCharPos; + if (line + 1 >= lineStarts.length) { + lastCharPos = this.getEnd(); + } + if (!lastCharPos) { + lastCharPos = lineStarts[line + 1] - 1; + } + var fullText = this.getFullText(); + return fullText[lastCharPos] === "\n" && fullText[lastCharPos - 1] === "\r" ? lastCharPos - 1 : lastCharPos; + }; + SourceFileObject2.prototype.getNamedDeclarations = function() { + if (!this.namedDeclarations) { + this.namedDeclarations = this.computeNamedDeclarations(); + } + return this.namedDeclarations; + }; + SourceFileObject2.prototype.computeNamedDeclarations = function() { + var result2 = ts2.createMultiMap(); + this.forEachChild(visit7); + return result2; + function addDeclaration(declaration) { + var name2 = getDeclarationName(declaration); + if (name2) { + result2.add(name2, declaration); + } + } + function getDeclarations(name2) { + var declarations = result2.get(name2); + if (!declarations) { + result2.set(name2, declarations = []); + } + return declarations; + } + function getDeclarationName(declaration) { + var name2 = ts2.getNonAssignedNameOfDeclaration(declaration); + return name2 && (ts2.isComputedPropertyName(name2) && ts2.isPropertyAccessExpression(name2.expression) ? name2.expression.name.text : ts2.isPropertyName(name2) ? ts2.getNameFromPropertyName(name2) : void 0); + } + function visit7(node) { + switch (node.kind) { + case 259: + case 215: + case 171: + case 170: + var functionDeclaration = node; + var declarationName = getDeclarationName(functionDeclaration); + if (declarationName) { + var declarations = getDeclarations(declarationName); + var lastDeclaration = ts2.lastOrUndefined(declarations); + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { + if (functionDeclaration.body && !lastDeclaration.body) { + declarations[declarations.length - 1] = functionDeclaration; + } + } else { + declarations.push(functionDeclaration); + } + } + ts2.forEachChild(node, visit7); + break; + case 260: + case 228: + case 261: + case 262: + case 263: + case 264: + case 268: + case 278: + case 273: + case 270: + case 271: + case 174: + case 175: + case 184: + addDeclaration(node); + ts2.forEachChild(node, visit7); + break; + case 166: + if (!ts2.hasSyntacticModifier( + node, + 16476 + /* ModifierFlags.ParameterPropertyModifier */ + )) { + break; + } + case 257: + case 205: { + var decl = node; + if (ts2.isBindingPattern(decl.name)) { + ts2.forEachChild(decl.name, visit7); + break; + } + if (decl.initializer) { + visit7(decl.initializer); + } + } + case 302: + case 169: + case 168: + addDeclaration(node); + break; + case 275: + var exportDeclaration = node; + if (exportDeclaration.exportClause) { + if (ts2.isNamedExports(exportDeclaration.exportClause)) { + ts2.forEach(exportDeclaration.exportClause.elements, visit7); + } else { + visit7(exportDeclaration.exportClause.name); + } + } + break; + case 269: + var importClause = node.importClause; + if (importClause) { + if (importClause.name) { + addDeclaration(importClause.name); + } + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === 271) { + addDeclaration(importClause.namedBindings); + } else { + ts2.forEach(importClause.namedBindings.elements, visit7); + } + } + } + break; + case 223: + if (ts2.getAssignmentDeclarationKind(node) !== 0) { + addDeclaration(node); + } + default: + ts2.forEachChild(node, visit7); + } + } + }; + return SourceFileObject2; + }(NodeObject) + ); + var SourceMapSourceObject = ( + /** @class */ + function() { + function SourceMapSourceObject2(fileName, text, skipTrivia) { + this.fileName = fileName; + this.text = text; + this.skipTrivia = skipTrivia; + } + SourceMapSourceObject2.prototype.getLineAndCharacterOfPosition = function(pos) { + return ts2.getLineAndCharacterOfPosition(this, pos); + }; + return SourceMapSourceObject2; + }() + ); + function getServicesObjectAllocator() { + return { + getNodeConstructor: function() { + return NodeObject; + }, + getTokenConstructor: function() { + return TokenObject; + }, + getIdentifierConstructor: function() { + return IdentifierObject; + }, + getPrivateIdentifierConstructor: function() { + return PrivateIdentifierObject; + }, + getSourceFileConstructor: function() { + return SourceFileObject; + }, + getSymbolConstructor: function() { + return SymbolObject; + }, + getTypeConstructor: function() { + return TypeObject; + }, + getSignatureConstructor: function() { + return SignatureObject; + }, + getSourceMapSourceConstructor: function() { + return SourceMapSourceObject; + } + }; + } + function toEditorSettings(optionsAsMap) { + var allPropertiesAreCamelCased = true; + for (var key in optionsAsMap) { + if (ts2.hasProperty(optionsAsMap, key) && !isCamelCase(key)) { + allPropertiesAreCamelCased = false; + break; + } + } + if (allPropertiesAreCamelCased) { + return optionsAsMap; + } + var settings = {}; + for (var key in optionsAsMap) { + if (ts2.hasProperty(optionsAsMap, key)) { + var newKey = isCamelCase(key) ? key : key.charAt(0).toLowerCase() + key.substr(1); + settings[newKey] = optionsAsMap[key]; + } + } + return settings; + } + ts2.toEditorSettings = toEditorSettings; + function isCamelCase(s7) { + return !s7.length || s7.charAt(0) === s7.charAt(0).toLowerCase(); + } + function displayPartsToString(displayParts) { + if (displayParts) { + return ts2.map(displayParts, function(displayPart) { + return displayPart.text; + }).join(""); + } + return ""; + } + ts2.displayPartsToString = displayPartsToString; + function getDefaultCompilerOptions() { + return { + target: 1, + jsx: 1 + /* JsxEmit.Preserve */ + }; + } + ts2.getDefaultCompilerOptions = getDefaultCompilerOptions; + function getSupportedCodeFixes() { + return ts2.codefix.getSupportedErrorCodes(); + } + ts2.getSupportedCodeFixes = getSupportedCodeFixes; + var SyntaxTreeCache = ( + /** @class */ + function() { + function SyntaxTreeCache2(host) { + this.host = host; + } + SyntaxTreeCache2.prototype.getCurrentSourceFile = function(fileName) { + var _a2, _b, _c, _d, _e2, _f, _g, _h; + var scriptSnapshot = this.host.getScriptSnapshot(fileName); + if (!scriptSnapshot) { + throw new Error("Could not find file: '" + fileName + "'."); + } + var scriptKind = ts2.getScriptKind(fileName, this.host); + var version5 = this.host.getScriptVersion(fileName); + var sourceFile; + if (this.currentFileName !== fileName) { + var options = { + languageVersion: 99, + impliedNodeFormat: ts2.getImpliedNodeFormatForFile(ts2.toPath(fileName, this.host.getCurrentDirectory(), ((_c = (_b = (_a2 = this.host).getCompilerHost) === null || _b === void 0 ? void 0 : _b.call(_a2)) === null || _c === void 0 ? void 0 : _c.getCanonicalFileName) || ts2.hostGetCanonicalFileName(this.host)), (_h = (_g = (_f = (_e2 = (_d = this.host).getCompilerHost) === null || _e2 === void 0 ? void 0 : _e2.call(_d)) === null || _f === void 0 ? void 0 : _f.getModuleResolutionCache) === null || _g === void 0 ? void 0 : _g.call(_f)) === null || _h === void 0 ? void 0 : _h.getPackageJsonInfoCache(), this.host, this.host.getCompilationSettings()), + setExternalModuleIndicator: ts2.getSetExternalModuleIndicator(this.host.getCompilationSettings()) + }; + sourceFile = createLanguageServiceSourceFile( + fileName, + scriptSnapshot, + options, + version5, + /*setNodeParents*/ + true, + scriptKind + ); + } else if (this.currentFileVersion !== version5) { + var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version5, editRange); + } + if (sourceFile) { + this.currentFileVersion = version5; + this.currentFileName = fileName; + this.currentFileScriptSnapshot = scriptSnapshot; + this.currentSourceFile = sourceFile; + } + return this.currentSourceFile; + }; + return SyntaxTreeCache2; + }() + ); + function setSourceFileFields(sourceFile, scriptSnapshot, version5) { + sourceFile.version = version5; + sourceFile.scriptSnapshot = scriptSnapshot; + } + function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version5, setNodeParents, scriptKind) { + var sourceFile = ts2.createSourceFile(fileName, ts2.getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind); + setSourceFileFields(sourceFile, scriptSnapshot, version5); + return sourceFile; + } + ts2.createLanguageServiceSourceFile = createLanguageServiceSourceFile; + function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version5, textChangeRange, aggressiveChecks) { + if (textChangeRange) { + if (version5 !== sourceFile.version) { + var newText = void 0; + var prefix = textChangeRange.span.start !== 0 ? sourceFile.text.substr(0, textChangeRange.span.start) : ""; + var suffix = ts2.textSpanEnd(textChangeRange.span) !== sourceFile.text.length ? sourceFile.text.substr(ts2.textSpanEnd(textChangeRange.span)) : ""; + if (textChangeRange.newLength === 0) { + newText = prefix && suffix ? prefix + suffix : prefix || suffix; + } else { + var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength); + newText = prefix && suffix ? prefix + changedText + suffix : prefix ? prefix + changedText : changedText + suffix; + } + var newSourceFile = ts2.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + setSourceFileFields(newSourceFile, scriptSnapshot, version5); + newSourceFile.nameTable = void 0; + if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) { + if (sourceFile.scriptSnapshot.dispose) { + sourceFile.scriptSnapshot.dispose(); + } + sourceFile.scriptSnapshot = void 0; + } + return newSourceFile; + } + } + var options = { + languageVersion: sourceFile.languageVersion, + impliedNodeFormat: sourceFile.impliedNodeFormat, + setExternalModuleIndicator: sourceFile.setExternalModuleIndicator + }; + return createLanguageServiceSourceFile( + sourceFile.fileName, + scriptSnapshot, + options, + version5, + /*setNodeParents*/ + true, + sourceFile.scriptKind + ); + } + ts2.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; + var NoopCancellationToken = { + isCancellationRequested: ts2.returnFalse, + throwIfCancellationRequested: ts2.noop + }; + var CancellationTokenObject = ( + /** @class */ + function() { + function CancellationTokenObject2(cancellationToken) { + this.cancellationToken = cancellationToken; + } + CancellationTokenObject2.prototype.isCancellationRequested = function() { + return this.cancellationToken.isCancellationRequested(); + }; + CancellationTokenObject2.prototype.throwIfCancellationRequested = function() { + if (this.isCancellationRequested()) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("session", "cancellationThrown", { kind: "CancellationTokenObject" }); + throw new ts2.OperationCanceledException(); + } + }; + return CancellationTokenObject2; + }() + ); + var ThrottledCancellationToken = ( + /** @class */ + function() { + function ThrottledCancellationToken2(hostCancellationToken, throttleWaitMilliseconds) { + if (throttleWaitMilliseconds === void 0) { + throttleWaitMilliseconds = 20; + } + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + this.lastCancellationCheckTime = 0; + } + ThrottledCancellationToken2.prototype.isCancellationRequested = function() { + var time2 = ts2.timestamp(); + var duration = Math.abs(time2 - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + this.lastCancellationCheckTime = time2; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + }; + ThrottledCancellationToken2.prototype.throwIfCancellationRequested = function() { + if (this.isCancellationRequested()) { + ts2.tracing === null || ts2.tracing === void 0 ? void 0 : ts2.tracing.instant("session", "cancellationThrown", { kind: "ThrottledCancellationToken" }); + throw new ts2.OperationCanceledException(); + } + }; + return ThrottledCancellationToken2; + }() + ); + ts2.ThrottledCancellationToken = ThrottledCancellationToken; + var invalidOperationsInPartialSemanticMode = [ + "getSemanticDiagnostics", + "getSuggestionDiagnostics", + "getCompilerOptionsDiagnostics", + "getSemanticClassifications", + "getEncodedSemanticClassifications", + "getCodeFixesAtPosition", + "getCombinedCodeFix", + "applyCodeActionCommand", + "organizeImports", + "getEditsForFileRename", + "getEmitOutput", + "getApplicableRefactors", + "getEditsForRefactor", + "prepareCallHierarchy", + "provideCallHierarchyIncomingCalls", + "provideCallHierarchyOutgoingCalls", + "provideInlayHints" + ]; + var invalidOperationsInSyntacticMode = __spreadArray9(__spreadArray9([], invalidOperationsInPartialSemanticMode, true), [ + "getCompletionsAtPosition", + "getCompletionEntryDetails", + "getCompletionEntrySymbol", + "getSignatureHelpItems", + "getQuickInfoAtPosition", + "getDefinitionAtPosition", + "getDefinitionAndBoundSpan", + "getImplementationAtPosition", + "getTypeDefinitionAtPosition", + "getReferencesAtPosition", + "findReferences", + "getOccurrencesAtPosition", + "getDocumentHighlights", + "getNavigateToItems", + "getRenameInfo", + "findRenameLocations", + "getApplicableRefactors" + ], false); + function createLanguageService(host, documentRegistry, syntaxOnlyOrLanguageServiceMode) { + var _a2; + var _b; + if (documentRegistry === void 0) { + documentRegistry = ts2.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); + } + var languageServiceMode; + if (syntaxOnlyOrLanguageServiceMode === void 0) { + languageServiceMode = ts2.LanguageServiceMode.Semantic; + } else if (typeof syntaxOnlyOrLanguageServiceMode === "boolean") { + languageServiceMode = syntaxOnlyOrLanguageServiceMode ? ts2.LanguageServiceMode.Syntactic : ts2.LanguageServiceMode.Semantic; + } else { + languageServiceMode = syntaxOnlyOrLanguageServiceMode; + } + var syntaxTreeCache = new SyntaxTreeCache(host); + var program; + var lastProjectVersion; + var lastTypesRootVersion = 0; + var cancellationToken = host.getCancellationToken ? new CancellationTokenObject(host.getCancellationToken()) : NoopCancellationToken; + var currentDirectory = host.getCurrentDirectory(); + ts2.maybeSetLocalizedDiagnosticMessages((_b = host.getLocalizedDiagnosticMessages) === null || _b === void 0 ? void 0 : _b.bind(host)); + function log3(message) { + if (host.log) { + host.log(message); + } + } + var useCaseSensitiveFileNames = ts2.hostUsesCaseSensitiveFileNames(host); + var getCanonicalFileName = ts2.createGetCanonicalFileName(useCaseSensitiveFileNames); + var sourceMapper = ts2.getSourceMapper({ + useCaseSensitiveFileNames: function() { + return useCaseSensitiveFileNames; + }, + getCurrentDirectory: function() { + return currentDirectory; + }, + getProgram, + fileExists: ts2.maybeBind(host, host.fileExists), + readFile: ts2.maybeBind(host, host.readFile), + getDocumentPositionMapper: ts2.maybeBind(host, host.getDocumentPositionMapper), + getSourceFileLike: ts2.maybeBind(host, host.getSourceFileLike), + log: log3 + }); + function getValidSourceFile(fileName) { + var sourceFile = program.getSourceFile(fileName); + if (!sourceFile) { + var error2 = new Error("Could not find source file: '".concat(fileName, "'.")); + error2.ProgramFiles = program.getSourceFiles().map(function(f8) { + return f8.fileName; + }); + throw error2; + } + return sourceFile; + } + function synchronizeHostData() { + var _a3, _b2, _c; + ts2.Debug.assert(languageServiceMode !== ts2.LanguageServiceMode.Syntactic); + if (host.getProjectVersion) { + var hostProjectVersion = host.getProjectVersion(); + if (hostProjectVersion) { + if (lastProjectVersion === hostProjectVersion && !((_a3 = host.hasChangedAutomaticTypeDirectiveNames) === null || _a3 === void 0 ? void 0 : _a3.call(host))) { + return; + } + lastProjectVersion = hostProjectVersion; + } + } + var typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0; + if (lastTypesRootVersion !== typeRootsVersion) { + log3("TypeRoots version has changed; provide new program"); + program = void 0; + lastTypesRootVersion = typeRootsVersion; + } + var rootFileNames = host.getScriptFileNames().slice(); + var newSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); + var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts2.returnFalse; + var hasChangedAutomaticTypeDirectiveNames = ts2.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames); + var projectReferences = (_b2 = host.getProjectReferences) === null || _b2 === void 0 ? void 0 : _b2.call(host); + var parsedCommandLines; + var compilerHost = { + getSourceFile: getOrCreateSourceFile, + getSourceFileByPath: getOrCreateSourceFileByPath, + getCancellationToken: function() { + return cancellationToken; + }, + getCanonicalFileName, + useCaseSensitiveFileNames: function() { + return useCaseSensitiveFileNames; + }, + getNewLine: function() { + return ts2.getNewLineCharacter(newSettings, function() { + return ts2.getNewLineOrDefaultFromHost(host); + }); + }, + getDefaultLibFileName: function(options2) { + return host.getDefaultLibFileName(options2); + }, + writeFile: ts2.noop, + getCurrentDirectory: function() { + return currentDirectory; + }, + fileExists: function(fileName) { + return host.fileExists(fileName); + }, + readFile: function(fileName) { + return host.readFile && host.readFile(fileName); + }, + getSymlinkCache: ts2.maybeBind(host, host.getSymlinkCache), + realpath: ts2.maybeBind(host, host.realpath), + directoryExists: function(directoryName) { + return ts2.directoryProbablyExists(directoryName, host); + }, + getDirectories: function(path2) { + return host.getDirectories ? host.getDirectories(path2) : []; + }, + readDirectory: function(path2, extensions6, exclude, include, depth) { + ts2.Debug.checkDefined(host.readDirectory, "'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return host.readDirectory(path2, extensions6, exclude, include, depth); + }, + onReleaseOldSourceFile, + onReleaseParsedCommandLine, + hasInvalidatedResolutions, + hasChangedAutomaticTypeDirectiveNames, + trace: ts2.maybeBind(host, host.trace), + resolveModuleNames: ts2.maybeBind(host, host.resolveModuleNames), + getModuleResolutionCache: ts2.maybeBind(host, host.getModuleResolutionCache), + resolveTypeReferenceDirectives: ts2.maybeBind(host, host.resolveTypeReferenceDirectives), + useSourceOfProjectReferenceRedirect: ts2.maybeBind(host, host.useSourceOfProjectReferenceRedirect), + getParsedCommandLine + }; + var originalGetSourceFile = compilerHost.getSourceFile; + var getSourceFileWithCache = ts2.changeCompilerHostLikeToUseCache(compilerHost, function(fileName) { + return ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + }, function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return originalGetSourceFile.call.apply(originalGetSourceFile, __spreadArray9([compilerHost], args, false)); + }).getSourceFileWithCache; + compilerHost.getSourceFile = getSourceFileWithCache; + (_c = host.setCompilerHost) === null || _c === void 0 ? void 0 : _c.call(host, compilerHost); + var parseConfigHost = { + useCaseSensitiveFileNames, + fileExists: function(fileName) { + return compilerHost.fileExists(fileName); + }, + readFile: function(fileName) { + return compilerHost.readFile(fileName); + }, + readDirectory: function() { + var _a4; + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return (_a4 = compilerHost).readDirectory.apply(_a4, args); + }, + trace: compilerHost.trace, + getCurrentDirectory: compilerHost.getCurrentDirectory, + onUnRecoverableConfigFileDiagnostic: ts2.noop + }; + var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); + if (ts2.isProgramUptoDate(program, rootFileNames, newSettings, function(_path, fileName) { + return host.getScriptVersion(fileName); + }, function(fileName) { + return compilerHost.fileExists(fileName); + }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { + return; + } + var options = { + rootNames: rootFileNames, + options: newSettings, + host: compilerHost, + oldProgram: program, + projectReferences + }; + program = ts2.createProgram(options); + compilerHost = void 0; + parsedCommandLines = void 0; + sourceMapper.clearCache(); + program.getTypeChecker(); + return; + function getParsedCommandLine(fileName) { + var path2 = ts2.toPath(fileName, currentDirectory, getCanonicalFileName); + var existing = parsedCommandLines === null || parsedCommandLines === void 0 ? void 0 : parsedCommandLines.get(path2); + if (existing !== void 0) + return existing || void 0; + var result2 = host.getParsedCommandLine ? host.getParsedCommandLine(fileName) : getParsedCommandLineOfConfigFileUsingSourceFile(fileName); + (parsedCommandLines || (parsedCommandLines = new ts2.Map())).set(path2, result2 || false); + return result2; + } + function getParsedCommandLineOfConfigFileUsingSourceFile(configFileName) { + var result2 = getOrCreateSourceFile( + configFileName, + 100 + /* ScriptTarget.JSON */ + ); + if (!result2) + return void 0; + result2.path = ts2.toPath(configFileName, currentDirectory, getCanonicalFileName); + result2.resolvedPath = result2.path; + result2.originalFileName = result2.fileName; + return ts2.parseJsonSourceFileConfigFileContent( + result2, + parseConfigHost, + ts2.getNormalizedAbsolutePath(ts2.getDirectoryPath(configFileName), currentDirectory), + /*optionsToExtend*/ + void 0, + ts2.getNormalizedAbsolutePath(configFileName, currentDirectory) + ); + } + function onReleaseParsedCommandLine(configFileName, oldResolvedRef, oldOptions) { + var _a4; + if (host.getParsedCommandLine) { + (_a4 = host.onReleaseParsedCommandLine) === null || _a4 === void 0 ? void 0 : _a4.call(host, configFileName, oldResolvedRef, oldOptions); + } else if (oldResolvedRef) { + onReleaseOldSourceFile(oldResolvedRef.sourceFile, oldOptions); + } + } + function onReleaseOldSourceFile(oldSourceFile, oldOptions) { + var oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldOptions); + documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, oldSettingsKey, oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); + } + function getOrCreateSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { + return getOrCreateSourceFileByPath(fileName, ts2.toPath(fileName, currentDirectory, getCanonicalFileName), languageVersionOrOptions, onError, shouldCreateNewSourceFile); + } + function getOrCreateSourceFileByPath(fileName, path2, languageVersionOrOptions, _onError, shouldCreateNewSourceFile) { + ts2.Debug.assert(compilerHost, "getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host."); + var scriptSnapshot = host.getScriptSnapshot(fileName); + if (!scriptSnapshot) { + return void 0; + } + var scriptKind = ts2.getScriptKind(fileName, host); + var scriptVersion = host.getScriptVersion(fileName); + if (!shouldCreateNewSourceFile) { + var oldSourceFile = program && program.getSourceFileByPath(path2); + if (oldSourceFile) { + if (scriptKind === oldSourceFile.scriptKind) { + return documentRegistry.updateDocumentWithKey(fileName, path2, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); + } else { + documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); + } + } + } + return documentRegistry.acquireDocumentWithKey(fileName, path2, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); + } + } + function getProgram() { + if (languageServiceMode === ts2.LanguageServiceMode.Syntactic) { + ts2.Debug.assert(program === void 0); + return void 0; + } + synchronizeHostData(); + return program; + } + function getAutoImportProvider() { + var _a3; + return (_a3 = host.getPackageJsonAutoImportProvider) === null || _a3 === void 0 ? void 0 : _a3.call(host); + } + function updateIsDefinitionOfReferencedSymbols(referencedSymbols, knownSymbolSpans) { + var checker = program.getTypeChecker(); + var symbol = getSymbolForProgram(); + if (!symbol) + return false; + for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { + var referencedSymbol = referencedSymbols_1[_i]; + for (var _a3 = 0, _b2 = referencedSymbol.references; _a3 < _b2.length; _a3++) { + var ref = _b2[_a3]; + var refNode = getNodeForSpan(ref); + ts2.Debug.assertIsDefined(refNode); + if (knownSymbolSpans.has(ref) || ts2.FindAllReferences.isDeclarationOfSymbol(refNode, symbol)) { + knownSymbolSpans.add(ref); + ref.isDefinition = true; + var mappedSpan = ts2.getMappedDocumentSpan(ref, sourceMapper, ts2.maybeBind(host, host.fileExists)); + if (mappedSpan) { + knownSymbolSpans.add(mappedSpan); + } + } else { + ref.isDefinition = false; + } + } + } + return true; + function getSymbolForProgram() { + for (var _i2 = 0, referencedSymbols_2 = referencedSymbols; _i2 < referencedSymbols_2.length; _i2++) { + var referencedSymbol2 = referencedSymbols_2[_i2]; + for (var _a4 = 0, _b3 = referencedSymbol2.references; _a4 < _b3.length; _a4++) { + var ref2 = _b3[_a4]; + if (knownSymbolSpans.has(ref2)) { + var refNode2 = getNodeForSpan(ref2); + ts2.Debug.assertIsDefined(refNode2); + return checker.getSymbolAtLocation(refNode2); + } + var mappedSpan2 = ts2.getMappedDocumentSpan(ref2, sourceMapper, ts2.maybeBind(host, host.fileExists)); + if (mappedSpan2 && knownSymbolSpans.has(mappedSpan2)) { + var refNode2 = getNodeForSpan(mappedSpan2); + if (refNode2) { + return checker.getSymbolAtLocation(refNode2); + } + } + } + } + return void 0; + } + function getNodeForSpan(docSpan) { + var sourceFile = program.getSourceFile(docSpan.fileName); + if (!sourceFile) + return void 0; + var rawNode = ts2.getTouchingPropertyName(sourceFile, docSpan.textSpan.start); + var adjustedNode = ts2.FindAllReferences.Core.getAdjustedNode(rawNode, { + use: 1 + /* FindAllReferences.FindReferencesUse.References */ + }); + return adjustedNode; + } + } + function cleanupSemanticCache() { + program = void 0; + } + function dispose() { + if (program) { + var key_1 = documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()); + ts2.forEach(program.getSourceFiles(), function(f8) { + return documentRegistry.releaseDocumentWithKey(f8.resolvedPath, key_1, f8.scriptKind, f8.impliedNodeFormat); + }); + program = void 0; + } + host = void 0; + } + function getSyntacticDiagnostics(fileName) { + synchronizeHostData(); + return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken).slice(); + } + function getSemanticDiagnostics(fileName) { + synchronizeHostData(); + var targetSourceFile = getValidSourceFile(fileName); + var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); + if (!ts2.getEmitDeclarations(program.getCompilerOptions())) { + return semanticDiagnostics.slice(); + } + var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); + return __spreadArray9(__spreadArray9([], semanticDiagnostics, true), declarationDiagnostics, true); + } + function getSuggestionDiagnostics(fileName) { + synchronizeHostData(); + return ts2.computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken); + } + function getCompilerOptionsDiagnostics() { + synchronizeHostData(); + return __spreadArray9(__spreadArray9([], program.getOptionsDiagnostics(cancellationToken), true), program.getGlobalDiagnostics(cancellationToken), true); + } + function getCompletionsAtPosition(fileName, position, options, formattingSettings) { + if (options === void 0) { + options = ts2.emptyOptions; + } + var fullPreferences = __assign16(__assign16({}, ts2.identity(options)), { includeCompletionsForModuleExports: options.includeCompletionsForModuleExports || options.includeExternalModuleExports, includeCompletionsWithInsertText: options.includeCompletionsWithInsertText || options.includeInsertTextCompletions }); + synchronizeHostData(); + return ts2.Completions.getCompletionsAtPosition(host, program, log3, getValidSourceFile(fileName), position, fullPreferences, options.triggerCharacter, options.triggerKind, cancellationToken, formattingSettings && ts2.formatting.getFormatContext(formattingSettings, host)); + } + function getCompletionEntryDetails(fileName, position, name2, formattingOptions, source, preferences, data) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + return ts2.Completions.getCompletionEntryDetails( + program, + log3, + getValidSourceFile(fileName), + position, + { name: name2, source, data }, + host, + formattingOptions && ts2.formatting.getFormatContext(formattingOptions, host), + // TODO: GH#18217 + preferences, + cancellationToken + ); + } + function getCompletionEntrySymbol(fileName, position, name2, source, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + return ts2.Completions.getCompletionEntrySymbol(program, log3, getValidSourceFile(fileName), position, { name: name2, source }, host, preferences); + } + function getQuickInfoAtPosition(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var node = ts2.getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + var typeChecker = program.getTypeChecker(); + var nodeForQuickInfo = getNodeForQuickInfo(node); + var symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker); + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { + var type_2 = shouldGetType(sourceFile, nodeForQuickInfo, position) ? typeChecker.getTypeAtLocation(nodeForQuickInfo) : void 0; + return type_2 && { + kind: "", + kindModifiers: "", + textSpan: ts2.createTextSpanFromNode(nodeForQuickInfo, sourceFile), + displayParts: typeChecker.runWithCancellationToken(cancellationToken, function(typeChecker2) { + return ts2.typeToDisplayParts(typeChecker2, type_2, ts2.getContainerNode(nodeForQuickInfo)); + }), + documentation: type_2.symbol ? type_2.symbol.getDocumentationComment(typeChecker) : void 0, + tags: type_2.symbol ? type_2.symbol.getJsDocTags(typeChecker) : void 0 + }; + } + var _a3 = typeChecker.runWithCancellationToken(cancellationToken, function(typeChecker2) { + return ts2.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, ts2.getContainerNode(nodeForQuickInfo), nodeForQuickInfo); + }), symbolKind = _a3.symbolKind, displayParts = _a3.displayParts, documentation = _a3.documentation, tags6 = _a3.tags; + return { + kind: symbolKind, + kindModifiers: ts2.SymbolDisplay.getSymbolModifiers(typeChecker, symbol), + textSpan: ts2.createTextSpanFromNode(nodeForQuickInfo, sourceFile), + displayParts, + documentation, + tags: tags6 + }; + } + function getNodeForQuickInfo(node) { + if (ts2.isNewExpression(node.parent) && node.pos === node.parent.pos) { + return node.parent.expression; + } + if (ts2.isNamedTupleMember(node.parent) && node.pos === node.parent.pos) { + return node.parent; + } + if (ts2.isImportMeta(node.parent) && node.parent.name === node) { + return node.parent; + } + return node; + } + function shouldGetType(sourceFile, node, position) { + switch (node.kind) { + case 79: + return !ts2.isLabelName(node) && !ts2.isTagName(node) && !ts2.isConstTypeReference(node.parent); + case 208: + case 163: + return !ts2.isInComment(sourceFile, position); + case 108: + case 194: + case 106: + case 199: + return true; + case 233: + return ts2.isImportMeta(node); + default: + return false; + } + } + function getDefinitionAtPosition(fileName, position, searchOtherFilesOnly, stopAtAlias) { + synchronizeHostData(); + return ts2.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly, stopAtAlias); + } + function getDefinitionAndBoundSpan(fileName, position) { + synchronizeHostData(); + return ts2.GoToDefinition.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position); + } + function getTypeDefinitionAtPosition(fileName, position) { + synchronizeHostData(); + return ts2.GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); + } + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts2.FindAllReferences.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + function getOccurrencesAtPosition(fileName, position) { + return ts2.flatMap(getDocumentHighlights(fileName, position, [fileName]), function(entry) { + return entry.highlightSpans.map(function(highlightSpan) { + return __assign16(__assign16({ + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" + /* HighlightSpanKind.writtenReference */ + }, highlightSpan.isInString && { isInString: true }), highlightSpan.contextSpan && { contextSpan: highlightSpan.contextSpan }); + }); + }); + } + function getDocumentHighlights(fileName, position, filesToSearch) { + var normalizedFileName = ts2.normalizePath(fileName); + ts2.Debug.assert(filesToSearch.some(function(f8) { + return ts2.normalizePath(f8) === normalizedFileName; + })); + synchronizeHostData(); + var sourceFilesToSearch = ts2.mapDefined(filesToSearch, function(fileName2) { + return program.getSourceFile(fileName2); + }); + var sourceFile = getValidSourceFile(fileName); + return ts2.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); + } + function findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var node = ts2.getAdjustedRenameLocation(ts2.getTouchingPropertyName(sourceFile, position)); + if (!ts2.Rename.nodeIsEligibleForRename(node)) + return void 0; + if (ts2.isIdentifier(node) && (ts2.isJsxOpeningElement(node.parent) || ts2.isJsxClosingElement(node.parent)) && ts2.isIntrinsicJsxName(node.escapedText)) { + var _a3 = node.parent.parent, openingElement = _a3.openingElement, closingElement = _a3.closingElement; + return [openingElement, closingElement].map(function(node2) { + var textSpan = ts2.createTextSpanFromNode(node2.tagName, sourceFile); + return __assign16({ fileName: sourceFile.fileName, textSpan }, ts2.FindAllReferences.toContextSpan(textSpan, sourceFile, node2.parent)); + }); + } else { + return getReferencesWorker(node, position, { + findInStrings, + findInComments, + providePrefixAndSuffixTextForRename, + use: 2 + /* FindAllReferences.FindReferencesUse.Rename */ + }, function(entry, originalNode, checker) { + return ts2.FindAllReferences.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false); + }); + } + } + function getReferencesAtPosition(fileName, position) { + synchronizeHostData(); + return getReferencesWorker(ts2.getTouchingPropertyName(getValidSourceFile(fileName), position), position, { + use: 1 + /* FindAllReferences.FindReferencesUse.References */ + }, ts2.FindAllReferences.toReferenceEntry); + } + function getReferencesWorker(node, position, options, cb) { + synchronizeHostData(); + var sourceFiles = options && options.use === 2 ? program.getSourceFiles().filter(function(sourceFile) { + return !program.isSourceFileDefaultLibrary(sourceFile); + }) : program.getSourceFiles(); + return ts2.FindAllReferences.findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, cb); + } + function findReferences(fileName, position) { + synchronizeHostData(); + return ts2.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + function getFileReferences(fileName) { + synchronizeHostData(); + return ts2.FindAllReferences.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(ts2.FindAllReferences.toReferenceEntry); + } + function getNavigateToItems(searchValue, maxResultCount, fileName, excludeDtsFiles) { + if (excludeDtsFiles === void 0) { + excludeDtsFiles = false; + } + synchronizeHostData(); + var sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles(); + return ts2.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); + } + function getEmitOutput(fileName, emitOnlyDtsFiles, forceDtsEmit) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + return ts2.getFileEmitOutput(program, sourceFile, !!emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit); + } + function getSignatureHelpItems(fileName, position, _a3) { + var _b2 = _a3 === void 0 ? ts2.emptyOptions : _a3, triggerReason = _b2.triggerReason; + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + return ts2.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); + } + function getNonBoundSourceFile(fileName) { + return syntaxTreeCache.getCurrentSourceFile(fileName); + } + function getNameOrDottedNameSpan(fileName, startPos, _endPos) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var node = ts2.getTouchingPropertyName(sourceFile, startPos); + if (node === sourceFile) { + return void 0; + } + switch (node.kind) { + case 208: + case 163: + case 10: + case 95: + case 110: + case 104: + case 106: + case 108: + case 194: + case 79: + break; + default: + return void 0; + } + var nodeForStartPos = node; + while (true) { + if (ts2.isRightSideOfPropertyAccess(nodeForStartPos) || ts2.isRightSideOfQualifiedName(nodeForStartPos)) { + nodeForStartPos = nodeForStartPos.parent; + } else if (ts2.isNameOfModuleDeclaration(nodeForStartPos)) { + if (nodeForStartPos.parent.parent.kind === 264 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + nodeForStartPos = nodeForStartPos.parent.parent.name; + } else { + break; + } + } else { + break; + } + } + return ts2.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); + } + function getBreakpointStatementAtPosition(fileName, position) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts2.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); + } + function getNavigationBarItems(fileName) { + return ts2.NavigationBar.getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); + } + function getNavigationTree(fileName) { + return ts2.NavigationBar.getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); + } + function getSemanticClassifications(fileName, span, format5) { + synchronizeHostData(); + var responseFormat = format5 || "original"; + if (responseFormat === "2020") { + return ts2.classifier.v2020.getSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); + } else { + return ts2.getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); + } + } + function getEncodedSemanticClassifications(fileName, span, format5) { + synchronizeHostData(); + var responseFormat = format5 || "original"; + if (responseFormat === "original") { + return ts2.getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); + } else { + return ts2.classifier.v2020.getEncodedSemanticClassifications(program, cancellationToken, getValidSourceFile(fileName), span); + } + } + function getSyntacticClassifications(fileName, span) { + return ts2.getSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); + } + function getEncodedSyntacticClassifications(fileName, span) { + return ts2.getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); + } + function getOutliningSpans(fileName) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts2.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); + } + var braceMatching = new ts2.Map(ts2.getEntries((_a2 = {}, _a2[ + 18 + /* SyntaxKind.OpenBraceToken */ + ] = 19, _a2[ + 20 + /* SyntaxKind.OpenParenToken */ + ] = 21, _a2[ + 22 + /* SyntaxKind.OpenBracketToken */ + ] = 23, _a2[ + 31 + /* SyntaxKind.GreaterThanToken */ + ] = 29, _a2))); + braceMatching.forEach(function(value2, key) { + return braceMatching.set(value2.toString(), Number(key)); + }); + function getBraceMatchingAtPosition(fileName, position) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var token = ts2.getTouchingToken(sourceFile, position); + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : void 0; + var match = matchKind && ts2.findChildOfKind(token.parent, matchKind, sourceFile); + return match ? [ts2.createTextSpanFromNode(token, sourceFile), ts2.createTextSpanFromNode(match, sourceFile)].sort(function(a7, b8) { + return a7.start - b8.start; + }) : ts2.emptyArray; + } + function getIndentationAtPosition(fileName, position, editorOptions) { + var start = ts2.timestamp(); + var settings = toEditorSettings(editorOptions); + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + log3("getIndentationAtPosition: getCurrentSourceFile: " + (ts2.timestamp() - start)); + start = ts2.timestamp(); + var result2 = ts2.formatting.SmartIndenter.getIndentation(position, sourceFile, settings); + log3("getIndentationAtPosition: computeIndentation : " + (ts2.timestamp() - start)); + return result2; + } + function getFormattingEditsForRange(fileName, start, end, options) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts2.formatting.formatSelection(start, end, sourceFile, ts2.formatting.getFormatContext(toEditorSettings(options), host)); + } + function getFormattingEditsForDocument(fileName, options) { + return ts2.formatting.formatDocument(syntaxTreeCache.getCurrentSourceFile(fileName), ts2.formatting.getFormatContext(toEditorSettings(options), host)); + } + function getFormattingEditsAfterKeystroke(fileName, position, key, options) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var formatContext = ts2.formatting.getFormatContext(toEditorSettings(options), host); + if (!ts2.isInComment(sourceFile, position)) { + switch (key) { + case "{": + return ts2.formatting.formatOnOpeningCurly(position, sourceFile, formatContext); + case "}": + return ts2.formatting.formatOnClosingCurly(position, sourceFile, formatContext); + case ";": + return ts2.formatting.formatOnSemicolon(position, sourceFile, formatContext); + case "\n": + return ts2.formatting.formatOnEnter(position, sourceFile, formatContext); + } + } + return []; + } + function getCodeFixesAtPosition(fileName, start, end, errorCodes, formatOptions, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var span = ts2.createTextSpanFromBounds(start, end); + var formatContext = ts2.formatting.getFormatContext(formatOptions, host); + return ts2.flatMap(ts2.deduplicate(errorCodes, ts2.equateValues, ts2.compareValues), function(errorCode) { + cancellationToken.throwIfCancellationRequested(); + return ts2.codefix.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); + }); + } + function getCombinedCodeFix(scope, fixId, formatOptions, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + ts2.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts2.formatting.getFormatContext(formatOptions, host); + return ts2.codefix.getAllFixes({ fixId, sourceFile, program, host, cancellationToken, formatContext, preferences }); + } + function organizeImports(args, formatOptions, preferences) { + var _a3; + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + ts2.Debug.assert(args.type === "file"); + var sourceFile = getValidSourceFile(args.fileName); + var formatContext = ts2.formatting.getFormatContext(formatOptions, host); + var mode = (_a3 = args.mode) !== null && _a3 !== void 0 ? _a3 : args.skipDestructiveCodeActions ? "SortAndCombine" : "All"; + return ts2.OrganizeImports.organizeImports(sourceFile, formatContext, host, program, preferences, mode); + } + function getEditsForFileRename(oldFilePath, newFilePath, formatOptions, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + return ts2.getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts2.formatting.getFormatContext(formatOptions, host), preferences, sourceMapper); + } + function applyCodeActionCommand(fileName, actionOrFormatSettingsOrUndefined) { + var action = typeof fileName === "string" ? actionOrFormatSettingsOrUndefined : fileName; + return ts2.isArray(action) ? Promise.all(action.map(function(a7) { + return applySingleCodeActionCommand(a7); + })) : applySingleCodeActionCommand(action); + } + function applySingleCodeActionCommand(action) { + var getPath = function(path2) { + return ts2.toPath(path2, currentDirectory, getCanonicalFileName); + }; + ts2.Debug.assertEqual(action.type, "install package"); + return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); + } + function getDocCommentTemplateAtPosition(fileName, position, options) { + return ts2.JsDoc.getDocCommentTemplateAtPosition(ts2.getNewLineOrDefaultFromHost(host), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + } + function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { + if (openingBrace === 60) { + return false; + } + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + if (ts2.isInString(sourceFile, position)) { + return false; + } + if (ts2.isInsideJsxElementOrAttribute(sourceFile, position)) { + return openingBrace === 123; + } + if (ts2.isInTemplateString(sourceFile, position)) { + return false; + } + switch (openingBrace) { + case 39: + case 34: + case 96: + return !ts2.isInComment(sourceFile, position); + } + return true; + } + function getJsxClosingTagAtPosition(fileName, position) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var token = ts2.findPrecedingToken(position, sourceFile); + if (!token) + return void 0; + var element = token.kind === 31 && ts2.isJsxOpeningElement(token.parent) ? token.parent.parent : ts2.isJsxText(token) && ts2.isJsxElement(token.parent) ? token.parent : void 0; + if (element && isUnclosedTag(element)) { + return { newText: "") }; + } + var fragment = token.kind === 31 && ts2.isJsxOpeningFragment(token.parent) ? token.parent.parent : ts2.isJsxText(token) && ts2.isJsxFragment(token.parent) ? token.parent : void 0; + if (fragment && isUnclosedFragment(fragment)) { + return { newText: "" }; + } + } + function getLinesForRange(sourceFile, textRange) { + return { + lineStarts: sourceFile.getLineStarts(), + firstLine: sourceFile.getLineAndCharacterOfPosition(textRange.pos).line, + lastLine: sourceFile.getLineAndCharacterOfPosition(textRange.end).line + }; + } + function toggleLineComment(fileName, textRange, insertComment) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var textChanges = []; + var _a3 = getLinesForRange(sourceFile, textRange), lineStarts = _a3.lineStarts, firstLine = _a3.firstLine, lastLine = _a3.lastLine; + var isCommenting = insertComment || false; + var leftMostPosition = Number.MAX_VALUE; + var lineTextStarts = new ts2.Map(); + var firstNonWhitespaceCharacterRegex = new RegExp(/\S/); + var isJsx = ts2.isInsideJsxElement(sourceFile, lineStarts[firstLine]); + var openComment = isJsx ? "{/*" : "//"; + for (var i7 = firstLine; i7 <= lastLine; i7++) { + var lineText = sourceFile.text.substring(lineStarts[i7], sourceFile.getLineEndOfPosition(lineStarts[i7])); + var regExec = firstNonWhitespaceCharacterRegex.exec(lineText); + if (regExec) { + leftMostPosition = Math.min(leftMostPosition, regExec.index); + lineTextStarts.set(i7.toString(), regExec.index); + if (lineText.substr(regExec.index, openComment.length) !== openComment) { + isCommenting = insertComment === void 0 || insertComment; + } + } + } + for (var i7 = firstLine; i7 <= lastLine; i7++) { + if (firstLine !== lastLine && lineStarts[i7] === textRange.end) { + continue; + } + var lineTextStart = lineTextStarts.get(i7.toString()); + if (lineTextStart !== void 0) { + if (isJsx) { + textChanges.push.apply(textChanges, toggleMultilineComment(fileName, { pos: lineStarts[i7] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i7]) }, isCommenting, isJsx)); + } else if (isCommenting) { + textChanges.push({ + newText: openComment, + span: { + length: 0, + start: lineStarts[i7] + leftMostPosition + } + }); + } else if (sourceFile.text.substr(lineStarts[i7] + lineTextStart, openComment.length) === openComment) { + textChanges.push({ + newText: "", + span: { + length: openComment.length, + start: lineStarts[i7] + lineTextStart + } + }); + } + } + } + return textChanges; + } + function toggleMultilineComment(fileName, textRange, insertComment, isInsideJsx) { + var _a3; + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var textChanges = []; + var text = sourceFile.text; + var hasComment = false; + var isCommenting = insertComment || false; + var positions = []; + var pos = textRange.pos; + var isJsx = isInsideJsx !== void 0 ? isInsideJsx : ts2.isInsideJsxElement(sourceFile, pos); + var openMultiline = isJsx ? "{/*" : "/*"; + var closeMultiline = isJsx ? "*/}" : "*/"; + var openMultilineRegex = isJsx ? "\\{\\/\\*" : "\\/\\*"; + var closeMultilineRegex = isJsx ? "\\*\\/\\}" : "\\*\\/"; + while (pos <= textRange.end) { + var offset = text.substr(pos, openMultiline.length) === openMultiline ? openMultiline.length : 0; + var commentRange = ts2.isInComment(sourceFile, pos + offset); + if (commentRange) { + if (isJsx) { + commentRange.pos--; + commentRange.end++; + } + positions.push(commentRange.pos); + if (commentRange.kind === 3) { + positions.push(commentRange.end); + } + hasComment = true; + pos = commentRange.end + 1; + } else { + var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")")); + isCommenting = insertComment !== void 0 ? insertComment : isCommenting || !ts2.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); + pos = newPos === -1 ? textRange.end + 1 : pos + newPos + closeMultiline.length; + } + } + if (isCommenting || !hasComment) { + if (((_a3 = ts2.isInComment(sourceFile, textRange.pos)) === null || _a3 === void 0 ? void 0 : _a3.kind) !== 2) { + ts2.insertSorted(positions, textRange.pos, ts2.compareValues); + } + ts2.insertSorted(positions, textRange.end, ts2.compareValues); + var firstPos = positions[0]; + if (text.substr(firstPos, openMultiline.length) !== openMultiline) { + textChanges.push({ + newText: openMultiline, + span: { + length: 0, + start: firstPos + } + }); + } + for (var i7 = 1; i7 < positions.length - 1; i7++) { + if (text.substr(positions[i7] - closeMultiline.length, closeMultiline.length) !== closeMultiline) { + textChanges.push({ + newText: closeMultiline, + span: { + length: 0, + start: positions[i7] + } + }); + } + if (text.substr(positions[i7], openMultiline.length) !== openMultiline) { + textChanges.push({ + newText: openMultiline, + span: { + length: 0, + start: positions[i7] + } + }); + } + } + if (textChanges.length % 2 !== 0) { + textChanges.push({ + newText: closeMultiline, + span: { + length: 0, + start: positions[positions.length - 1] + } + }); + } + } else { + for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) { + var pos_2 = positions_1[_i]; + var from = pos_2 - closeMultiline.length > 0 ? pos_2 - closeMultiline.length : 0; + var offset = text.substr(from, closeMultiline.length) === closeMultiline ? closeMultiline.length : 0; + textChanges.push({ + newText: "", + span: { + length: openMultiline.length, + start: pos_2 - offset + } + }); + } + } + return textChanges; + } + function commentSelection(fileName, textRange) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var _a3 = getLinesForRange(sourceFile, textRange), firstLine = _a3.firstLine, lastLine = _a3.lastLine; + return firstLine === lastLine && textRange.pos !== textRange.end ? toggleMultilineComment( + fileName, + textRange, + /*insertComment*/ + true + ) : toggleLineComment( + fileName, + textRange, + /*insertComment*/ + true + ); + } + function uncommentSelection(fileName, textRange) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var textChanges = []; + var pos = textRange.pos; + var end = textRange.end; + if (pos === end) { + end += ts2.isInsideJsxElement(sourceFile, pos) ? 2 : 1; + } + for (var i7 = pos; i7 <= end; i7++) { + var commentRange = ts2.isInComment(sourceFile, i7); + if (commentRange) { + switch (commentRange.kind) { + case 2: + textChanges.push.apply(textChanges, toggleLineComment( + fileName, + { end: commentRange.end, pos: commentRange.pos + 1 }, + /*insertComment*/ + false + )); + break; + case 3: + textChanges.push.apply(textChanges, toggleMultilineComment( + fileName, + { end: commentRange.end, pos: commentRange.pos + 1 }, + /*insertComment*/ + false + )); + } + i7 = commentRange.end + 1; + } + } + return textChanges; + } + function isUnclosedTag(_a3) { + var openingElement = _a3.openingElement, closingElement = _a3.closingElement, parent2 = _a3.parent; + return !ts2.tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) || ts2.isJsxElement(parent2) && ts2.tagNamesAreEquivalent(openingElement.tagName, parent2.openingElement.tagName) && isUnclosedTag(parent2); + } + function isUnclosedFragment(_a3) { + var closingFragment = _a3.closingFragment, parent2 = _a3.parent; + return !!(closingFragment.flags & 131072) || ts2.isJsxFragment(parent2) && isUnclosedFragment(parent2); + } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + var range2 = ts2.formatting.getRangeOfEnclosingComment(sourceFile, position); + return range2 && (!onlyMultiLine || range2.kind === 3) ? ts2.createTextSpanFromRange(range2) : void 0; + } + function getTodoComments(fileName, descriptors) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + cancellationToken.throwIfCancellationRequested(); + var fileContents = sourceFile.text; + var result2 = []; + if (descriptors.length > 0 && !isNodeModulesFile(sourceFile.fileName)) { + var regExp = getTodoCommentsRegExp(); + var matchArray = void 0; + while (matchArray = regExp.exec(fileContents)) { + cancellationToken.throwIfCancellationRequested(); + var firstDescriptorCaptureIndex = 3; + ts2.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); + var preamble = matchArray[1]; + var matchPosition = matchArray.index + preamble.length; + if (!ts2.isInComment(sourceFile, matchPosition)) { + continue; + } + var descriptor = void 0; + for (var i7 = 0; i7 < descriptors.length; i7++) { + if (matchArray[i7 + firstDescriptorCaptureIndex]) { + descriptor = descriptors[i7]; + } + } + if (descriptor === void 0) + return ts2.Debug.fail(); + if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { + continue; + } + var message = matchArray[2]; + result2.push({ descriptor, message, position: matchPosition }); + } + } + return result2; + function escapeRegExp3(str2) { + return str2.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + function getTodoCommentsRegExp() { + var singleLineCommentStart = /(?:\/\/+\s*)/.source; + var multiLineCommentStart = /(?:\/\*+\s*)/.source; + var anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + var preamble2 = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + var literals = "(?:" + ts2.map(descriptors, function(d7) { + return "(" + escapeRegExp3(d7.text) + ")"; + }).join("|") + ")"; + var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; + var messageRemainder = /(?:.*?)/.source; + var messagePortion = "(" + literals + messageRemainder + ")"; + var regExpString = preamble2 + messagePortion + endOfLineOrEndOfComment; + return new RegExp(regExpString, "gim"); + } + function isLetterOrDigit(char) { + return char >= 97 && char <= 122 || char >= 65 && char <= 90 || char >= 48 && char <= 57; + } + function isNodeModulesFile(path2) { + return ts2.stringContains(path2, "/node_modules/"); + } + } + function getRenameInfo(fileName, position, preferences) { + synchronizeHostData(); + return ts2.Rename.getRenameInfo(program, getValidSourceFile(fileName), position, preferences || {}); + } + function getRefactorContext(file, positionOrRange, preferences, formatOptions, triggerReason, kind) { + var _a3 = typeof positionOrRange === "number" ? [positionOrRange, void 0] : [positionOrRange.pos, positionOrRange.end], startPosition = _a3[0], endPosition = _a3[1]; + return { + file, + startPosition, + endPosition, + program: getProgram(), + host, + formatContext: ts2.formatting.getFormatContext(formatOptions, host), + cancellationToken, + preferences, + triggerReason, + kind + }; + } + function getInlayHintsContext(file, span, preferences) { + return { + file, + program: getProgram(), + host, + span, + preferences, + cancellationToken + }; + } + function getSmartSelectionRange(fileName, position) { + return ts2.SmartSelectionRange.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName)); + } + function getApplicableRefactors(fileName, positionOrRange, preferences, triggerReason, kind) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + var file = getValidSourceFile(fileName); + return ts2.refactor.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, ts2.emptyOptions, triggerReason, kind)); + } + function getEditsForRefactor(fileName, formatOptions, positionOrRange, refactorName, actionName, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + var file = getValidSourceFile(fileName); + return ts2.refactor.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName, actionName); + } + function toLineColumnOffset(fileName, position) { + if (position === 0) { + return { line: 0, character: 0 }; + } + return sourceMapper.toLineColumnOffset(fileName, position); + } + function prepareCallHierarchy(fileName, position) { + synchronizeHostData(); + var declarations = ts2.CallHierarchy.resolveCallHierarchyDeclaration(program, ts2.getTouchingPropertyName(getValidSourceFile(fileName), position)); + return declarations && ts2.mapOneOrMany(declarations, function(declaration) { + return ts2.CallHierarchy.createCallHierarchyItem(program, declaration); + }); + } + function provideCallHierarchyIncomingCalls(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var declaration = ts2.firstOrOnly(ts2.CallHierarchy.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : ts2.getTouchingPropertyName(sourceFile, position))); + return declaration ? ts2.CallHierarchy.getIncomingCalls(program, declaration, cancellationToken) : []; + } + function provideCallHierarchyOutgoingCalls(fileName, position) { + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + var declaration = ts2.firstOrOnly(ts2.CallHierarchy.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : ts2.getTouchingPropertyName(sourceFile, position))); + return declaration ? ts2.CallHierarchy.getOutgoingCalls(program, declaration) : []; + } + function provideInlayHints(fileName, span, preferences) { + if (preferences === void 0) { + preferences = ts2.emptyOptions; + } + synchronizeHostData(); + var sourceFile = getValidSourceFile(fileName); + return ts2.InlayHints.provideInlayHints(getInlayHintsContext(sourceFile, span, preferences)); + } + var ls = { + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getSuggestionDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications, + getSemanticClassifications, + getEncodedSyntacticClassifications, + getEncodedSemanticClassifications, + getCompletionsAtPosition, + getCompletionEntryDetails, + getCompletionEntrySymbol, + getSignatureHelpItems, + getQuickInfoAtPosition, + getDefinitionAtPosition, + getDefinitionAndBoundSpan, + getImplementationAtPosition, + getTypeDefinitionAtPosition, + getReferencesAtPosition, + findReferences, + getFileReferences, + getOccurrencesAtPosition, + getDocumentHighlights, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems, + getRenameInfo, + getSmartSelectionRange, + findRenameLocations, + getNavigationBarItems, + getNavigationTree, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getDocCommentTemplateAtPosition, + isValidBraceCompletionAtPosition, + getJsxClosingTagAtPosition, + getSpanOfEnclosingComment, + getCodeFixesAtPosition, + getCombinedCodeFix, + applyCodeActionCommand, + organizeImports, + getEditsForFileRename, + getEmitOutput, + getNonBoundSourceFile, + getProgram, + getCurrentProgram: function() { + return program; + }, + getAutoImportProvider, + updateIsDefinitionOfReferencedSymbols, + getApplicableRefactors, + getEditsForRefactor, + toLineColumnOffset, + getSourceMapper: function() { + return sourceMapper; + }, + clearSourceMapperCache: function() { + return sourceMapper.clearCache(); + }, + prepareCallHierarchy, + provideCallHierarchyIncomingCalls, + provideCallHierarchyOutgoingCalls, + toggleLineComment, + toggleMultilineComment, + commentSelection, + uncommentSelection, + provideInlayHints + }; + switch (languageServiceMode) { + case ts2.LanguageServiceMode.Semantic: + break; + case ts2.LanguageServiceMode.PartialSemantic: + invalidOperationsInPartialSemanticMode.forEach(function(key) { + return ls[key] = function() { + throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic")); + }; + }); + break; + case ts2.LanguageServiceMode.Syntactic: + invalidOperationsInSyntacticMode.forEach(function(key) { + return ls[key] = function() { + throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic")); + }; + }); + break; + default: + ts2.Debug.assertNever(languageServiceMode); + } + return ls; + } + ts2.createLanguageService = createLanguageService; + function getNameTable(sourceFile) { + if (!sourceFile.nameTable) { + initializeNameTable(sourceFile); + } + return sourceFile.nameTable; + } + ts2.getNameTable = getNameTable; + function initializeNameTable(sourceFile) { + var nameTable = sourceFile.nameTable = new ts2.Map(); + sourceFile.forEachChild(function walk(node) { + if (ts2.isIdentifier(node) && !ts2.isTagName(node) && node.escapedText || ts2.isStringOrNumericLiteralLike(node) && literalIsName(node)) { + var text = ts2.getEscapedTextOfIdentifierOrLiteral(node); + nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); + } else if (ts2.isPrivateIdentifier(node)) { + var text = node.escapedText; + nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); + } + ts2.forEachChild(node, walk); + if (ts2.hasJSDocNodes(node)) { + for (var _i = 0, _a2 = node.jsDoc; _i < _a2.length; _i++) { + var jsDoc = _a2[_i]; + ts2.forEachChild(jsDoc, walk); + } + } + }); + } + function literalIsName(node) { + return ts2.isDeclarationName(node) || node.parent.kind === 280 || isArgumentOfElementAccessExpression(node) || ts2.isLiteralComputedPropertyDeclarationName(node); + } + function getContainingObjectLiteralElement(node) { + var element = getContainingObjectLiteralElementWorker(node); + return element && (ts2.isObjectLiteralExpression(element.parent) || ts2.isJsxAttributes(element.parent)) ? element : void 0; + } + ts2.getContainingObjectLiteralElement = getContainingObjectLiteralElement; + function getContainingObjectLiteralElementWorker(node) { + switch (node.kind) { + case 10: + case 14: + case 8: + if (node.parent.kind === 164) { + return ts2.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; + } + case 79: + return ts2.isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 207 || node.parent.parent.kind === 289) && node.parent.name === node ? node.parent : void 0; + } + return void 0; + } + function getSymbolAtLocationForQuickInfo(node, checker) { + var object = getContainingObjectLiteralElement(node); + if (object) { + var contextualType = checker.getContextualType(object.parent); + var properties = contextualType && getPropertySymbolsFromContextualType( + object, + checker, + contextualType, + /*unionSymbolOk*/ + false + ); + if (properties && properties.length === 1) { + return ts2.first(properties); + } + } + return checker.getSymbolAtLocation(node); + } + function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) { + var name2 = ts2.getNameFromPropertyName(node.name); + if (!name2) + return ts2.emptyArray; + if (!contextualType.isUnion()) { + var symbol = contextualType.getProperty(name2); + return symbol ? [symbol] : ts2.emptyArray; + } + var discriminatedPropertySymbols = ts2.mapDefined(contextualType.types, function(t8) { + return (ts2.isObjectLiteralExpression(node.parent) || ts2.isJsxAttributes(node.parent)) && checker.isTypeInvalidDueToUnionDiscriminant(t8, node.parent) ? void 0 : t8.getProperty(name2); + }); + if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) { + var symbol = contextualType.getProperty(name2); + if (symbol) + return [symbol]; + } + if (discriminatedPropertySymbols.length === 0) { + return ts2.mapDefined(contextualType.types, function(t8) { + return t8.getProperty(name2); + }); + } + return discriminatedPropertySymbols; + } + ts2.getPropertySymbolsFromContextualType = getPropertySymbolsFromContextualType; + function isArgumentOfElementAccessExpression(node) { + return node && node.parent && node.parent.kind === 209 && node.parent.argumentExpression === node; + } + function getDefaultLibFilePath(options) { + if (typeof __dirname !== "undefined") { + return ts2.combinePaths(__dirname, ts2.getDefaultLibFileName(options)); + } + throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); + } + ts2.getDefaultLibFilePath = getDefaultLibFilePath; + ts2.setObjectAllocator(getServicesObjectAllocator()); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var BreakpointResolver; + (function(BreakpointResolver2) { + function spanInSourceFileAtLocation(sourceFile, position) { + if (sourceFile.isDeclarationFile) { + return void 0; + } + var tokenAtLocation = ts2.getTokenAtPosition(sourceFile, position); + var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { + var preceding = ts2.findPrecedingToken(tokenAtLocation.pos, sourceFile); + if (!preceding || sourceFile.getLineAndCharacterOfPosition(preceding.getEnd()).line !== lineOfPosition) { + return void 0; + } + tokenAtLocation = preceding; + } + if (tokenAtLocation.flags & 16777216) { + return void 0; + } + return spanInNode(tokenAtLocation); + function textSpan(startNode, endNode) { + var lastDecorator = ts2.canHaveDecorators(startNode) ? ts2.findLast(startNode.modifiers, ts2.isDecorator) : void 0; + var start = lastDecorator ? ts2.skipTrivia(sourceFile.text, lastDecorator.end) : startNode.getStart(sourceFile); + return ts2.createTextSpanFromBounds(start, (endNode || startNode).getEnd()); + } + function textSpanEndingAtNextToken(startNode, previousTokenToFindNextEndToken) { + return textSpan(startNode, ts2.findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent, sourceFile)); + } + function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } + function spanInNodeArray(nodeArray, node, match) { + if (nodeArray) { + var index4 = nodeArray.indexOf(node); + if (index4 >= 0) { + var start = index4; + var end = index4 + 1; + while (start > 0 && match(nodeArray[start - 1])) + start--; + while (end < nodeArray.length && match(nodeArray[end])) + end++; + return ts2.createTextSpanFromBounds(ts2.skipTrivia(sourceFile.text, nodeArray[start].pos), nodeArray[end - 1].end); + } + } + return textSpan(node); + } + function spanInPreviousNode(node) { + return spanInNode(ts2.findPrecedingToken(node.pos, sourceFile)); + } + function spanInNextNode(node) { + return spanInNode(ts2.findNextToken(node, node.parent, sourceFile)); + } + function spanInNode(node) { + if (node) { + var parent2 = node.parent; + switch (node.kind) { + case 240: + return spanInVariableDeclaration(node.declarationList.declarations[0]); + case 257: + case 169: + case 168: + return spanInVariableDeclaration(node); + case 166: + return spanInParameterDeclaration(node); + case 259: + case 171: + case 170: + case 174: + case 175: + case 173: + case 215: + case 216: + return spanInFunctionDeclaration(node); + case 238: + if (ts2.isFunctionBlock(node)) { + return spanInFunctionBlock(node); + } + case 265: + return spanInBlock(node); + case 295: + return spanInBlock(node.block); + case 241: + return textSpan(node.expression); + case 250: + return textSpan(node.getChildAt(0), node.expression); + case 244: + return textSpanEndingAtNextToken(node, node.expression); + case 243: + return spanInNode(node.statement); + case 256: + return textSpan(node.getChildAt(0)); + case 242: + return textSpanEndingAtNextToken(node, node.expression); + case 253: + return spanInNode(node.statement); + case 249: + case 248: + return textSpan(node.getChildAt(0), node.label); + case 245: + return spanInForStatement(node); + case 246: + return textSpanEndingAtNextToken(node, node.expression); + case 247: + return spanInInitializerOfForLike(node); + case 252: + return textSpanEndingAtNextToken(node, node.expression); + case 292: + case 293: + return spanInNode(node.statements[0]); + case 255: + return spanInBlock(node.tryBlock); + case 254: + return textSpan(node, node.expression); + case 274: + return textSpan(node, node.expression); + case 268: + return textSpan(node, node.moduleReference); + case 269: + return textSpan(node, node.moduleSpecifier); + case 275: + return textSpan(node, node.moduleSpecifier); + case 264: + if (ts2.getModuleInstanceState(node) !== 1) { + return void 0; + } + case 260: + case 263: + case 302: + case 205: + return textSpan(node); + case 251: + return spanInNode(node.statement); + case 167: + return spanInNodeArray(parent2.modifiers, node, ts2.isDecorator); + case 203: + case 204: + return spanInBindingPattern(node); + case 261: + case 262: + return void 0; + case 26: + case 1: + return spanInNodeIfStartsOnSameLine(ts2.findPrecedingToken(node.pos, sourceFile)); + case 27: + return spanInPreviousNode(node); + case 18: + return spanInOpenBraceToken(node); + case 19: + return spanInCloseBraceToken(node); + case 23: + return spanInCloseBracketToken(node); + case 20: + return spanInOpenParenToken(node); + case 21: + return spanInCloseParenToken(node); + case 58: + return spanInColonToken(node); + case 31: + case 29: + return spanInGreaterThanOrLessThanToken(node); + case 115: + return spanInWhileKeyword(node); + case 91: + case 83: + case 96: + return spanInNextNode(node); + case 162: + return spanInOfKeyword(node); + default: + if (ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + if ((node.kind === 79 || node.kind === 227 || node.kind === 299 || node.kind === 300) && ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(parent2)) { + return textSpan(node); + } + if (node.kind === 223) { + var _a2 = node, left = _a2.left, operatorToken = _a2.operatorToken; + if (ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left); + } + if (operatorToken.kind === 63 && ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); + } + if (operatorToken.kind === 27) { + return spanInNode(left); + } + } + if (ts2.isExpressionNode(node)) { + switch (parent2.kind) { + case 243: + return spanInPreviousNode(node); + case 167: + return spanInNode(node.parent); + case 245: + case 247: + return textSpan(node); + case 223: + if (node.parent.operatorToken.kind === 27) { + return textSpan(node); + } + break; + case 216: + if (node.parent.body === node) { + return textSpan(node); + } + break; + } + } + switch (node.parent.kind) { + case 299: + if (node.parent.name === node && !ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode(node.parent.initializer); + } + break; + case 213: + if (node.parent.type === node) { + return spanInNextNode(node.parent.type); + } + break; + case 257: + case 166: { + var _b = node.parent, initializer = _b.initializer, type3 = _b.type; + if (initializer === node || type3 === node || ts2.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + break; + } + case 223: { + var left = node.parent.left; + if (ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { + return spanInPreviousNode(node); + } + break; + } + default: + if (ts2.isFunctionLike(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } + } + return spanInNode(node.parent); + } + } + function textSpanFromVariableDeclaration(variableDeclaration) { + if (ts2.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { + return textSpan(ts2.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } else { + return textSpan(variableDeclaration); + } + } + function spanInVariableDeclaration(variableDeclaration) { + if (variableDeclaration.parent.parent.kind === 246) { + return spanInNode(variableDeclaration.parent.parent); + } + var parent3 = variableDeclaration.parent; + if (ts2.isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); + } + if (ts2.hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || ts2.hasSyntacticModifier( + variableDeclaration, + 1 + /* ModifierFlags.Export */ + ) || parent3.parent.kind === 247) { + return textSpanFromVariableDeclaration(variableDeclaration); + } + if (ts2.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { + return spanInNode(ts2.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); + } + } + function canHaveSpanInParameterDeclaration(parameter) { + return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || ts2.hasSyntacticModifier( + parameter, + 4 | 8 + /* ModifierFlags.Private */ + ); + } + function spanInParameterDeclaration(parameter) { + if (ts2.isBindingPattern(parameter.name)) { + return spanInBindingPattern(parameter.name); + } else if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); + } else { + var functionDeclaration = parameter.parent; + var indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + ts2.Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } else { + return spanInNode(functionDeclaration.body); + } + } + } + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { + return ts2.hasSyntacticModifier( + functionDeclaration, + 1 + /* ModifierFlags.Export */ + ) || functionDeclaration.parent.kind === 260 && functionDeclaration.kind !== 173; + } + function spanInFunctionDeclaration(functionDeclaration) { + if (!functionDeclaration.body) { + return void 0; + } + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + return textSpan(functionDeclaration); + } + return spanInNode(functionDeclaration.body); + } + function spanInFunctionBlock(block) { + var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + return spanInNode(nodeForSpanInBlock); + } + function spanInBlock(block) { + switch (block.parent.kind) { + case 264: + if (ts2.getModuleInstanceState(block.parent) !== 1) { + return void 0; + } + case 244: + case 242: + case 246: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 245: + case 247: + return spanInNodeIfStartsOnSameLine(ts2.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + return spanInNode(block.statements[0]); + } + function spanInInitializerOfForLike(forLikeStatement) { + if (forLikeStatement.initializer.kind === 258) { + var variableDeclarationList = forLikeStatement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } else { + return spanInNode(forLikeStatement.initializer); + } + } + function spanInForStatement(forStatement) { + if (forStatement.initializer) { + return spanInInitializerOfForLike(forStatement); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); + } + } + function spanInBindingPattern(bindingPattern) { + var firstBindingElement = ts2.forEach(bindingPattern.elements, function(element) { + return element.kind !== 229 ? element : void 0; + }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + if (bindingPattern.parent.kind === 205) { + return textSpan(bindingPattern.parent); + } + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { + ts2.Debug.assert( + node2.kind !== 204 && node2.kind !== 203 + /* SyntaxKind.ObjectBindingPattern */ + ); + var elements = node2.kind === 206 ? node2.elements : node2.properties; + var firstBindingElement = ts2.forEach(elements, function(element) { + return element.kind !== 229 ? element : void 0; + }); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + return textSpan(node2.parent.kind === 223 ? node2.parent : node2); + } + function spanInOpenBraceToken(node2) { + switch (node2.parent.kind) { + case 263: + var enumDeclaration = node2.parent; + return spanInNodeIfStartsOnSameLine(ts2.findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + case 260: + var classDeclaration = node2.parent; + return spanInNodeIfStartsOnSameLine(ts2.findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + case 266: + return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); + } + return spanInNode(node2.parent); + } + function spanInCloseBraceToken(node2) { + switch (node2.parent.kind) { + case 265: + if (ts2.getModuleInstanceState(node2.parent.parent) !== 1) { + return void 0; + } + case 263: + case 260: + return textSpan(node2); + case 238: + if (ts2.isFunctionBlock(node2.parent)) { + return textSpan(node2); + } + case 295: + return spanInNode(ts2.lastOrUndefined(node2.parent.statements)); + case 266: + var caseBlock = node2.parent; + var lastClause = ts2.lastOrUndefined(caseBlock.clauses); + if (lastClause) { + return spanInNode(ts2.lastOrUndefined(lastClause.statements)); + } + return void 0; + case 203: + var bindingPattern = node2.parent; + return spanInNode(ts2.lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { + var objectLiteral = node2.parent; + return textSpan(ts2.lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node2.parent); + } + } + function spanInCloseBracketToken(node2) { + switch (node2.parent.kind) { + case 204: + var bindingPattern = node2.parent; + return textSpan(ts2.lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (ts2.isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { + var arrayLiteral = node2.parent; + return textSpan(ts2.lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + return spanInNode(node2.parent); + } + } + function spanInOpenParenToken(node2) { + if (node2.parent.kind === 243 || // Go to while keyword and do action instead + node2.parent.kind === 210 || node2.parent.kind === 211) { + return spanInPreviousNode(node2); + } + if (node2.parent.kind === 214) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + function spanInCloseParenToken(node2) { + switch (node2.parent.kind) { + case 215: + case 259: + case 216: + case 171: + case 170: + case 174: + case 175: + case 173: + case 244: + case 243: + case 245: + case 247: + case 210: + case 211: + case 214: + return spanInPreviousNode(node2); + default: + return spanInNode(node2.parent); + } + } + function spanInColonToken(node2) { + if (ts2.isFunctionLike(node2.parent) || node2.parent.kind === 299 || node2.parent.kind === 166) { + return spanInPreviousNode(node2); + } + return spanInNode(node2.parent); + } + function spanInGreaterThanOrLessThanToken(node2) { + if (node2.parent.kind === 213) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + function spanInWhileKeyword(node2) { + if (node2.parent.kind === 243) { + return textSpanEndingAtNextToken(node2, node2.parent.expression); + } + return spanInNode(node2.parent); + } + function spanInOfKeyword(node2) { + if (node2.parent.kind === 247) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + } + } + BreakpointResolver2.spanInSourceFileAtLocation = spanInSourceFileAtLocation; + })(BreakpointResolver = ts2.BreakpointResolver || (ts2.BreakpointResolver = {})); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function transform2(source, transformers, compilerOptions) { + var diagnostics = []; + compilerOptions = ts2.fixupCompilerOptions(compilerOptions, diagnostics); + var nodes = ts2.isArray(source) ? source : [source]; + var result2 = ts2.transformNodes( + /*resolver*/ + void 0, + /*emitHost*/ + void 0, + ts2.factory, + compilerOptions, + nodes, + transformers, + /*allowDtsFiles*/ + true + ); + result2.diagnostics = ts2.concatenate(result2.diagnostics, diagnostics); + return result2; + } + ts2.transform = transform2; + })(ts || (ts = {})); + var debugObjectHost = /* @__PURE__ */ function() { + return this; + }(); + var ts; + (function(ts2) { + function logInternalError(logger, err) { + if (logger) { + logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); + } + } + var ScriptSnapshotShimAdapter = ( + /** @class */ + function() { + function ScriptSnapshotShimAdapter2(scriptSnapshotShim) { + this.scriptSnapshotShim = scriptSnapshotShim; + } + ScriptSnapshotShimAdapter2.prototype.getText = function(start, end) { + return this.scriptSnapshotShim.getText(start, end); + }; + ScriptSnapshotShimAdapter2.prototype.getLength = function() { + return this.scriptSnapshotShim.getLength(); + }; + ScriptSnapshotShimAdapter2.prototype.getChangeRange = function(oldSnapshot) { + var oldSnapshotShim = oldSnapshot; + var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); + if (encoded === null) { + return null; + } + var decoded = JSON.parse(encoded); + return ts2.createTextChangeRange(ts2.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength); + }; + ScriptSnapshotShimAdapter2.prototype.dispose = function() { + if ("dispose" in this.scriptSnapshotShim) { + this.scriptSnapshotShim.dispose(); + } + }; + return ScriptSnapshotShimAdapter2; + }() + ); + var LanguageServiceShimHostAdapter = ( + /** @class */ + function() { + function LanguageServiceShimHostAdapter2(shimHost) { + var _this = this; + this.shimHost = shimHost; + this.loggingEnabled = false; + this.tracingEnabled = false; + if ("getModuleResolutionsForFile" in this.shimHost) { + this.resolveModuleNames = function(moduleNames, containingFile) { + var resolutionsInFile = JSON.parse(_this.shimHost.getModuleResolutionsForFile(containingFile)); + return ts2.map(moduleNames, function(name2) { + var result2 = ts2.getProperty(resolutionsInFile, name2); + return result2 ? { resolvedFileName: result2, extension: ts2.extensionFromPath(result2), isExternalLibraryImport: false } : void 0; + }); + }; + } + if ("directoryExists" in this.shimHost) { + this.directoryExists = function(directoryName) { + return _this.shimHost.directoryExists(directoryName); + }; + } + if ("getTypeReferenceDirectiveResolutionsForFile" in this.shimHost) { + this.resolveTypeReferenceDirectives = function(typeDirectiveNames, containingFile) { + var typeDirectivesForFile = JSON.parse(_this.shimHost.getTypeReferenceDirectiveResolutionsForFile(containingFile)); + return ts2.map(typeDirectiveNames, function(name2) { + return ts2.getProperty(typeDirectivesForFile, ts2.isString(name2) ? name2 : name2.fileName.toLowerCase()); + }); + }; + } + } + LanguageServiceShimHostAdapter2.prototype.log = function(s7) { + if (this.loggingEnabled) { + this.shimHost.log(s7); + } + }; + LanguageServiceShimHostAdapter2.prototype.trace = function(s7) { + if (this.tracingEnabled) { + this.shimHost.trace(s7); + } + }; + LanguageServiceShimHostAdapter2.prototype.error = function(s7) { + this.shimHost.error(s7); + }; + LanguageServiceShimHostAdapter2.prototype.getProjectVersion = function() { + if (!this.shimHost.getProjectVersion) { + return void 0; + } + return this.shimHost.getProjectVersion(); + }; + LanguageServiceShimHostAdapter2.prototype.getTypeRootsVersion = function() { + if (!this.shimHost.getTypeRootsVersion) { + return 0; + } + return this.shimHost.getTypeRootsVersion(); + }; + LanguageServiceShimHostAdapter2.prototype.useCaseSensitiveFileNames = function() { + return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; + }; + LanguageServiceShimHostAdapter2.prototype.getCompilationSettings = function() { + var settingsJson = this.shimHost.getCompilationSettings(); + if (settingsJson === null || settingsJson === "") { + throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); + } + var compilerOptions = JSON.parse(settingsJson); + compilerOptions.allowNonTsExtensions = true; + return compilerOptions; + }; + LanguageServiceShimHostAdapter2.prototype.getScriptFileNames = function() { + var encoded = this.shimHost.getScriptFileNames(); + return JSON.parse(encoded); + }; + LanguageServiceShimHostAdapter2.prototype.getScriptSnapshot = function(fileName) { + var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); + return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); + }; + LanguageServiceShimHostAdapter2.prototype.getScriptKind = function(fileName) { + if ("getScriptKind" in this.shimHost) { + return this.shimHost.getScriptKind(fileName); + } else { + return 0; + } + }; + LanguageServiceShimHostAdapter2.prototype.getScriptVersion = function(fileName) { + return this.shimHost.getScriptVersion(fileName); + }; + LanguageServiceShimHostAdapter2.prototype.getLocalizedDiagnosticMessages = function() { + var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); + if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { + return null; + } + try { + return JSON.parse(diagnosticMessagesJson); + } catch (e10) { + this.log(e10.description || "diagnosticMessages.generated.json has invalid JSON format"); + return null; + } + }; + LanguageServiceShimHostAdapter2.prototype.getCancellationToken = function() { + var hostCancellationToken = this.shimHost.getCancellationToken(); + return new ts2.ThrottledCancellationToken(hostCancellationToken); + }; + LanguageServiceShimHostAdapter2.prototype.getCurrentDirectory = function() { + return this.shimHost.getCurrentDirectory(); + }; + LanguageServiceShimHostAdapter2.prototype.getDirectories = function(path2) { + return JSON.parse(this.shimHost.getDirectories(path2)); + }; + LanguageServiceShimHostAdapter2.prototype.getDefaultLibFileName = function(options) { + return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); + }; + LanguageServiceShimHostAdapter2.prototype.readDirectory = function(path2, extensions6, exclude, include, depth) { + var pattern5 = ts2.getFileMatcherPatterns(path2, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); + return JSON.parse(this.shimHost.readDirectory(path2, JSON.stringify(extensions6), JSON.stringify(pattern5.basePaths), pattern5.excludePattern, pattern5.includeFilePattern, pattern5.includeDirectoryPattern, depth)); + }; + LanguageServiceShimHostAdapter2.prototype.readFile = function(path2, encoding) { + return this.shimHost.readFile(path2, encoding); + }; + LanguageServiceShimHostAdapter2.prototype.fileExists = function(path2) { + return this.shimHost.fileExists(path2); + }; + return LanguageServiceShimHostAdapter2; + }() + ); + ts2.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; + var CoreServicesShimHostAdapter = ( + /** @class */ + function() { + function CoreServicesShimHostAdapter2(shimHost) { + var _this = this; + this.shimHost = shimHost; + this.useCaseSensitiveFileNames = this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; + if ("directoryExists" in this.shimHost) { + this.directoryExists = function(directoryName) { + return _this.shimHost.directoryExists(directoryName); + }; + } else { + this.directoryExists = void 0; + } + if ("realpath" in this.shimHost) { + this.realpath = function(path2) { + return _this.shimHost.realpath(path2); + }; + } else { + this.realpath = void 0; + } + } + CoreServicesShimHostAdapter2.prototype.readDirectory = function(rootDir, extensions6, exclude, include, depth) { + var pattern5 = ts2.getFileMatcherPatterns(rootDir, exclude, include, this.shimHost.useCaseSensitiveFileNames(), this.shimHost.getCurrentDirectory()); + return JSON.parse(this.shimHost.readDirectory(rootDir, JSON.stringify(extensions6), JSON.stringify(pattern5.basePaths), pattern5.excludePattern, pattern5.includeFilePattern, pattern5.includeDirectoryPattern, depth)); + }; + CoreServicesShimHostAdapter2.prototype.fileExists = function(fileName) { + return this.shimHost.fileExists(fileName); + }; + CoreServicesShimHostAdapter2.prototype.readFile = function(fileName) { + return this.shimHost.readFile(fileName); + }; + CoreServicesShimHostAdapter2.prototype.getDirectories = function(path2) { + return JSON.parse(this.shimHost.getDirectories(path2)); + }; + return CoreServicesShimHostAdapter2; + }() + ); + ts2.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; + function simpleForwardCall(logger, actionDescription, action, logPerformance) { + var start; + if (logPerformance) { + logger.log(actionDescription); + start = ts2.timestamp(); + } + var result2 = action(); + if (logPerformance) { + var end = ts2.timestamp(); + logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec")); + if (ts2.isString(result2)) { + var str2 = result2; + if (str2.length > 128) { + str2 = str2.substring(0, 128) + "..."; + } + logger.log(" result.length=".concat(str2.length, ", result='").concat(JSON.stringify(str2), "'")); + } + } + return result2; + } + function forwardJSONCall(logger, actionDescription, action, logPerformance) { + return forwardCall( + logger, + actionDescription, + /*returnJson*/ + true, + action, + logPerformance + ); + } + function forwardCall(logger, actionDescription, returnJson, action, logPerformance) { + try { + var result2 = simpleForwardCall(logger, actionDescription, action, logPerformance); + return returnJson ? JSON.stringify({ result: result2 }) : result2; + } catch (err) { + if (err instanceof ts2.OperationCanceledException) { + return JSON.stringify({ canceled: true }); + } + logInternalError(logger, err); + err.description = actionDescription; + return JSON.stringify({ error: err }); + } + } + var ShimBase = ( + /** @class */ + function() { + function ShimBase2(factory) { + this.factory = factory; + factory.registerShim(this); + } + ShimBase2.prototype.dispose = function(_dummy) { + this.factory.unregisterShim(this); + }; + return ShimBase2; + }() + ); + function realizeDiagnostics(diagnostics, newLine) { + return diagnostics.map(function(d7) { + return realizeDiagnostic(d7, newLine); + }); + } + ts2.realizeDiagnostics = realizeDiagnostics; + function realizeDiagnostic(diagnostic, newLine) { + return { + message: ts2.flattenDiagnosticMessageText(diagnostic.messageText, newLine), + start: diagnostic.start, + length: diagnostic.length, + category: ts2.diagnosticCategoryName(diagnostic), + code: diagnostic.code, + reportsUnnecessary: diagnostic.reportsUnnecessary, + reportsDeprecated: diagnostic.reportsDeprecated + }; + } + var LanguageServiceShimObject = ( + /** @class */ + function(_super) { + __extends10(LanguageServiceShimObject2, _super); + function LanguageServiceShimObject2(factory, host, languageService) { + var _this = _super.call(this, factory) || this; + _this.host = host; + _this.languageService = languageService; + _this.logPerformance = false; + _this.logger = _this.host; + return _this; + } + LanguageServiceShimObject2.prototype.forwardJSONCall = function(actionDescription, action) { + return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); + }; + LanguageServiceShimObject2.prototype.dispose = function(dummy) { + this.logger.log("dispose()"); + this.languageService.dispose(); + this.languageService = null; + if (debugObjectHost && debugObjectHost.CollectGarbage) { + debugObjectHost.CollectGarbage(); + this.logger.log("CollectGarbage()"); + } + this.logger = null; + _super.prototype.dispose.call(this, dummy); + }; + LanguageServiceShimObject2.prototype.refresh = function(throwOnError) { + this.forwardJSONCall( + "refresh(".concat(throwOnError, ")"), + function() { + return null; + } + // eslint-disable-line no-null/no-null + ); + }; + LanguageServiceShimObject2.prototype.cleanupSemanticCache = function() { + var _this = this; + this.forwardJSONCall("cleanupSemanticCache()", function() { + _this.languageService.cleanupSemanticCache(); + return null; + }); + }; + LanguageServiceShimObject2.prototype.realizeDiagnostics = function(diagnostics) { + var newLine = ts2.getNewLineOrDefaultFromHost(this.host); + return realizeDiagnostics(diagnostics, newLine); + }; + LanguageServiceShimObject2.prototype.getSyntacticClassifications = function(fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function() { + return _this.languageService.getSyntacticClassifications(fileName, ts2.createTextSpan(start, length)); + }); + }; + LanguageServiceShimObject2.prototype.getSemanticClassifications = function(fileName, start, length) { + var _this = this; + return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function() { + return _this.languageService.getSemanticClassifications(fileName, ts2.createTextSpan(start, length)); + }); + }; + LanguageServiceShimObject2.prototype.getEncodedSyntacticClassifications = function(fileName, start, length) { + var _this = this; + return this.forwardJSONCall( + "getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function() { + return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts2.createTextSpan(start, length))); + } + ); + }; + LanguageServiceShimObject2.prototype.getEncodedSemanticClassifications = function(fileName, start, length) { + var _this = this; + return this.forwardJSONCall( + "getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), + // directly serialize the spans out to a string. This is much faster to decode + // on the managed side versus a full JSON array. + function() { + return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts2.createTextSpan(start, length))); + } + ); + }; + LanguageServiceShimObject2.prototype.getSyntacticDiagnostics = function(fileName) { + var _this = this; + return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function() { + var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName); + return _this.realizeDiagnostics(diagnostics); + }); + }; + LanguageServiceShimObject2.prototype.getSemanticDiagnostics = function(fileName) { + var _this = this; + return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function() { + var diagnostics = _this.languageService.getSemanticDiagnostics(fileName); + return _this.realizeDiagnostics(diagnostics); + }); + }; + LanguageServiceShimObject2.prototype.getSuggestionDiagnostics = function(fileName) { + var _this = this; + return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function() { + return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); + }); + }; + LanguageServiceShimObject2.prototype.getCompilerOptionsDiagnostics = function() { + var _this = this; + return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function() { + var diagnostics = _this.languageService.getCompilerOptionsDiagnostics(); + return _this.realizeDiagnostics(diagnostics); + }); + }; + LanguageServiceShimObject2.prototype.getQuickInfoAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getQuickInfoAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getNameOrDottedNameSpan = function(fileName, startPos, endPos) { + var _this = this; + return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function() { + return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); + }); + }; + LanguageServiceShimObject2.prototype.getBreakpointStatementAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getBreakpointStatementAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getSignatureHelpItems = function(fileName, position, options) { + var _this = this; + return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getSignatureHelpItems(fileName, position, options); + }); + }; + LanguageServiceShimObject2.prototype.getDefinitionAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getDefinitionAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getDefinitionAndBoundSpan = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getDefinitionAndBoundSpan(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getTypeDefinitionAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getTypeDefinitionAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getImplementationAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getImplementationAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getRenameInfo = function(fileName, position, preferences) { + var _this = this; + return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getRenameInfo(fileName, position, preferences); + }); + }; + LanguageServiceShimObject2.prototype.getSmartSelectionRange = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getSmartSelectionRange(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.findRenameLocations = function(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) { + var _this = this; + return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function() { + return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); + }); + }; + LanguageServiceShimObject2.prototype.getBraceMatchingAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getBraceMatchingAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.isValidBraceCompletionAtPosition = function(fileName, position, openingBrace) { + var _this = this; + return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function() { + return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); + }); + }; + LanguageServiceShimObject2.prototype.getSpanOfEnclosingComment = function(fileName, position, onlyMultiLine) { + var _this = this; + return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); + }); + }; + LanguageServiceShimObject2.prototype.getIndentationAtPosition = function(fileName, position, options) { + var _this = this; + return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + var localOptions = JSON.parse(options); + return _this.languageService.getIndentationAtPosition(fileName, position, localOptions); + }); + }; + LanguageServiceShimObject2.prototype.getReferencesAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getReferencesAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.findReferences = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.findReferences(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getFileReferences = function(fileName) { + var _this = this; + return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function() { + return _this.languageService.getFileReferences(fileName); + }); + }; + LanguageServiceShimObject2.prototype.getOccurrencesAtPosition = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getOccurrencesAtPosition(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.getDocumentHighlights = function(fileName, position, filesToSearch) { + var _this = this; + return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function() { + var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); + var normalizedName = ts2.toFileNameLowerCase(ts2.normalizeSlashes(fileName)); + return ts2.filter(results, function(r8) { + return ts2.toFileNameLowerCase(ts2.normalizeSlashes(r8.fileName)) === normalizedName; + }); + }); + }; + LanguageServiceShimObject2.prototype.getCompletionsAtPosition = function(fileName, position, preferences, formattingSettings) { + var _this = this; + return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function() { + return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); + }); + }; + LanguageServiceShimObject2.prototype.getCompletionEntryDetails = function(fileName, position, entryName, formatOptions, source, preferences, data) { + var _this = this; + return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function() { + var localOptions = formatOptions === void 0 ? void 0 : JSON.parse(formatOptions); + return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data); + }); + }; + LanguageServiceShimObject2.prototype.getFormattingEditsForRange = function(fileName, start, end, options) { + var _this = this; + return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function() { + var localOptions = JSON.parse(options); + return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); + }); + }; + LanguageServiceShimObject2.prototype.getFormattingEditsForDocument = function(fileName, options) { + var _this = this; + return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function() { + var localOptions = JSON.parse(options); + return _this.languageService.getFormattingEditsForDocument(fileName, localOptions); + }); + }; + LanguageServiceShimObject2.prototype.getFormattingEditsAfterKeystroke = function(fileName, position, key, options) { + var _this = this; + return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function() { + var localOptions = JSON.parse(options); + return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); + }); + }; + LanguageServiceShimObject2.prototype.getDocCommentTemplateAtPosition = function(fileName, position, options) { + var _this = this; + return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); + }); + }; + LanguageServiceShimObject2.prototype.getNavigateToItems = function(searchValue, maxResultCount, fileName) { + var _this = this; + return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function() { + return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); + }); + }; + LanguageServiceShimObject2.prototype.getNavigationBarItems = function(fileName) { + var _this = this; + return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function() { + return _this.languageService.getNavigationBarItems(fileName); + }); + }; + LanguageServiceShimObject2.prototype.getNavigationTree = function(fileName) { + var _this = this; + return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function() { + return _this.languageService.getNavigationTree(fileName); + }); + }; + LanguageServiceShimObject2.prototype.getOutliningSpans = function(fileName) { + var _this = this; + return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function() { + return _this.languageService.getOutliningSpans(fileName); + }); + }; + LanguageServiceShimObject2.prototype.getTodoComments = function(fileName, descriptors) { + var _this = this; + return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function() { + return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); + }); + }; + LanguageServiceShimObject2.prototype.prepareCallHierarchy = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.prepareCallHierarchy(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.provideCallHierarchyIncomingCalls = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.provideCallHierarchyOutgoingCalls = function(fileName, position) { + var _this = this; + return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function() { + return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); + }); + }; + LanguageServiceShimObject2.prototype.provideInlayHints = function(fileName, span, preference) { + var _this = this; + return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function() { + return _this.languageService.provideInlayHints(fileName, span, preference); + }); + }; + LanguageServiceShimObject2.prototype.getEmitOutput = function(fileName) { + var _this = this; + return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function() { + var _a2 = _this.languageService.getEmitOutput(fileName), diagnostics = _a2.diagnostics, rest2 = __rest13(_a2, ["diagnostics"]); + return __assign16(__assign16({}, rest2), { diagnostics: _this.realizeDiagnostics(diagnostics) }); + }); + }; + LanguageServiceShimObject2.prototype.getEmitOutputObject = function(fileName) { + var _this = this; + return forwardCall( + this.logger, + "getEmitOutput('".concat(fileName, "')"), + /*returnJson*/ + false, + function() { + return _this.languageService.getEmitOutput(fileName); + }, + this.logPerformance + ); + }; + LanguageServiceShimObject2.prototype.toggleLineComment = function(fileName, textRange) { + var _this = this; + return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function() { + return _this.languageService.toggleLineComment(fileName, textRange); + }); + }; + LanguageServiceShimObject2.prototype.toggleMultilineComment = function(fileName, textRange) { + var _this = this; + return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function() { + return _this.languageService.toggleMultilineComment(fileName, textRange); + }); + }; + LanguageServiceShimObject2.prototype.commentSelection = function(fileName, textRange) { + var _this = this; + return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function() { + return _this.languageService.commentSelection(fileName, textRange); + }); + }; + LanguageServiceShimObject2.prototype.uncommentSelection = function(fileName, textRange) { + var _this = this; + return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function() { + return _this.languageService.uncommentSelection(fileName, textRange); + }); + }; + return LanguageServiceShimObject2; + }(ShimBase) + ); + function convertClassifications(classifications) { + return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; + } + var ClassifierShimObject = ( + /** @class */ + function(_super) { + __extends10(ClassifierShimObject2, _super); + function ClassifierShimObject2(factory, logger) { + var _this = _super.call(this, factory) || this; + _this.logger = logger; + _this.logPerformance = false; + _this.classifier = ts2.createClassifier(); + return _this; + } + ClassifierShimObject2.prototype.getEncodedLexicalClassifications = function(text, lexState, syntacticClassifierAbsent) { + var _this = this; + if (syntacticClassifierAbsent === void 0) { + syntacticClassifierAbsent = false; + } + return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function() { + return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); + }, this.logPerformance); + }; + ClassifierShimObject2.prototype.getClassificationsForLine = function(text, lexState, classifyKeywordsInGenerics) { + if (classifyKeywordsInGenerics === void 0) { + classifyKeywordsInGenerics = false; + } + var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); + var result2 = ""; + for (var _i = 0, _a2 = classification.entries; _i < _a2.length; _i++) { + var item = _a2[_i]; + result2 += item.length + "\n"; + result2 += item.classification + "\n"; + } + result2 += classification.finalLexState; + return result2; + }; + return ClassifierShimObject2; + }(ShimBase) + ); + var CoreServicesShimObject = ( + /** @class */ + function(_super) { + __extends10(CoreServicesShimObject2, _super); + function CoreServicesShimObject2(factory, logger, host) { + var _this = _super.call(this, factory) || this; + _this.logger = logger; + _this.host = host; + _this.logPerformance = false; + return _this; + } + CoreServicesShimObject2.prototype.forwardJSONCall = function(actionDescription, action) { + return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); + }; + CoreServicesShimObject2.prototype.resolveModuleName = function(fileName, moduleName3, compilerOptionsJson) { + var _this = this; + return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function() { + var compilerOptions = JSON.parse(compilerOptionsJson); + var result2 = ts2.resolveModuleName(moduleName3, ts2.normalizeSlashes(fileName), compilerOptions, _this.host); + var resolvedFileName = result2.resolvedModule ? result2.resolvedModule.resolvedFileName : void 0; + if (result2.resolvedModule && result2.resolvedModule.extension !== ".ts" && result2.resolvedModule.extension !== ".tsx" && result2.resolvedModule.extension !== ".d.ts") { + resolvedFileName = void 0; + } + return { + resolvedFileName, + failedLookupLocations: result2.failedLookupLocations, + affectingLocations: result2.affectingLocations + }; + }); + }; + CoreServicesShimObject2.prototype.resolveTypeReferenceDirective = function(fileName, typeReferenceDirective, compilerOptionsJson) { + var _this = this; + return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function() { + var compilerOptions = JSON.parse(compilerOptionsJson); + var result2 = ts2.resolveTypeReferenceDirective(typeReferenceDirective, ts2.normalizeSlashes(fileName), compilerOptions, _this.host); + return { + resolvedFileName: result2.resolvedTypeReferenceDirective ? result2.resolvedTypeReferenceDirective.resolvedFileName : void 0, + primary: result2.resolvedTypeReferenceDirective ? result2.resolvedTypeReferenceDirective.primary : true, + failedLookupLocations: result2.failedLookupLocations + }; + }); + }; + CoreServicesShimObject2.prototype.getPreProcessedFileInfo = function(fileName, sourceTextSnapshot) { + var _this = this; + return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function() { + var result2 = ts2.preProcessFile( + ts2.getSnapshotText(sourceTextSnapshot), + /* readImportFiles */ + true, + /* detectJavaScriptImports */ + true + ); + return { + referencedFiles: _this.convertFileReferences(result2.referencedFiles), + importedFiles: _this.convertFileReferences(result2.importedFiles), + ambientExternalModules: result2.ambientExternalModules, + isLibFile: result2.isLibFile, + typeReferenceDirectives: _this.convertFileReferences(result2.typeReferenceDirectives), + libReferenceDirectives: _this.convertFileReferences(result2.libReferenceDirectives) + }; + }); + }; + CoreServicesShimObject2.prototype.getAutomaticTypeDirectiveNames = function(compilerOptionsJson) { + var _this = this; + return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function() { + var compilerOptions = JSON.parse(compilerOptionsJson); + return ts2.getAutomaticTypeDirectiveNames(compilerOptions, _this.host); + }); + }; + CoreServicesShimObject2.prototype.convertFileReferences = function(refs) { + if (!refs) { + return void 0; + } + var result2 = []; + for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) { + var ref = refs_1[_i]; + result2.push({ + path: ts2.normalizeSlashes(ref.fileName), + position: ref.pos, + length: ref.end - ref.pos + }); + } + return result2; + }; + CoreServicesShimObject2.prototype.getTSConfigFileInfo = function(fileName, sourceTextSnapshot) { + var _this = this; + return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function() { + var result2 = ts2.parseJsonText(fileName, ts2.getSnapshotText(sourceTextSnapshot)); + var normalizedFileName = ts2.normalizeSlashes(fileName); + var configFile = ts2.parseJsonSourceFileConfigFileContent( + result2, + _this.host, + ts2.getDirectoryPath(normalizedFileName), + /*existingOptions*/ + {}, + normalizedFileName + ); + return { + options: configFile.options, + typeAcquisition: configFile.typeAcquisition, + files: configFile.fileNames, + raw: configFile.raw, + errors: realizeDiagnostics(__spreadArray9(__spreadArray9([], result2.parseDiagnostics, true), configFile.errors, true), "\r\n") + }; + }); + }; + CoreServicesShimObject2.prototype.getDefaultCompilationSettings = function() { + return this.forwardJSONCall("getDefaultCompilationSettings()", function() { + return ts2.getDefaultCompilerOptions(); + }); + }; + CoreServicesShimObject2.prototype.discoverTypings = function(discoverTypingsJson) { + var _this = this; + var getCanonicalFileName = ts2.createGetCanonicalFileName( + /*useCaseSensitivefileNames:*/ + false + ); + return this.forwardJSONCall("discoverTypings()", function() { + var info2 = JSON.parse(discoverTypingsJson); + if (_this.safeList === void 0) { + _this.safeList = ts2.JsTyping.loadSafeList(_this.host, ts2.toPath(info2.safeListPath, info2.safeListPath, getCanonicalFileName)); + } + return ts2.JsTyping.discoverTypings(_this.host, function(msg) { + return _this.logger.log(msg); + }, info2.fileNames, ts2.toPath(info2.projectRootPath, info2.projectRootPath, getCanonicalFileName), _this.safeList, info2.packageNameToTypingLocation, info2.typeAcquisition, info2.unresolvedImports, info2.typesRegistry, ts2.emptyOptions); + }); + }; + return CoreServicesShimObject2; + }(ShimBase) + ); + var TypeScriptServicesFactory = ( + /** @class */ + function() { + function TypeScriptServicesFactory2() { + this._shims = []; + } + TypeScriptServicesFactory2.prototype.getServicesVersion = function() { + return ts2.servicesVersion; + }; + TypeScriptServicesFactory2.prototype.createLanguageServiceShim = function(host) { + try { + if (this.documentRegistry === void 0) { + this.documentRegistry = ts2.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()); + } + var hostAdapter = new LanguageServiceShimHostAdapter(host); + var languageService = ts2.createLanguageService( + hostAdapter, + this.documentRegistry, + /*syntaxOnly*/ + false + ); + return new LanguageServiceShimObject(this, host, languageService); + } catch (err) { + logInternalError(host, err); + throw err; + } + }; + TypeScriptServicesFactory2.prototype.createClassifierShim = function(logger) { + try { + return new ClassifierShimObject(this, logger); + } catch (err) { + logInternalError(logger, err); + throw err; + } + }; + TypeScriptServicesFactory2.prototype.createCoreServicesShim = function(host) { + try { + var adapter = new CoreServicesShimHostAdapter(host); + return new CoreServicesShimObject(this, host, adapter); + } catch (err) { + logInternalError(host, err); + throw err; + } + }; + TypeScriptServicesFactory2.prototype.close = function() { + ts2.clear(this._shims); + this.documentRegistry = void 0; + }; + TypeScriptServicesFactory2.prototype.registerShim = function(shim) { + this._shims.push(shim); + }; + TypeScriptServicesFactory2.prototype.unregisterShim = function(shim) { + for (var i7 = 0; i7 < this._shims.length; i7++) { + if (this._shims[i7] === shim) { + delete this._shims[i7]; + return; + } + } + throw new Error("Invalid operation"); + }; + return TypeScriptServicesFactory2; + }() + ); + ts2.TypeScriptServicesFactory = TypeScriptServicesFactory; + })(ts || (ts = {})); + (function() { + if (typeof globalThis === "object") + return; + try { + Object.defineProperty(Object.prototype, "__magic__", { + get: function() { + return this; + }, + configurable: true + }); + __magic__.globalThis = __magic__; + if (typeof globalThis === "undefined") { + window.globalThis = window; + } + delete Object.prototype.__magic__; + } catch (error2) { + window.globalThis = window; + } + })(); + if (typeof process === "undefined" || process.browser) { + globalThis.TypeScript = globalThis.TypeScript || {}; + globalThis.TypeScript.Services = globalThis.TypeScript.Services || {}; + globalThis.TypeScript.Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; + globalThis.toolsVersion = ts.versionMajorMinor; + } + if (typeof module5 !== "undefined" && module5.exports) { + module5.exports = ts; + } + var ts; + (function(ts2) { + function createOverload(name2, overloads, binder, deprecations) { + Object.defineProperty(call, "name", __assign16(__assign16({}, Object.getOwnPropertyDescriptor(call, "name")), { value: name2 })); + if (deprecations) { + for (var _i = 0, _a2 = Object.keys(deprecations); _i < _a2.length; _i++) { + var key = _a2[_i]; + var index4 = +key; + if (!isNaN(index4) && ts2.hasProperty(overloads, "".concat(index4))) { + overloads[index4] = ts2.Debug.deprecate(overloads[index4], __assign16(__assign16({}, deprecations[index4]), { name: name2 })); + } + } + } + var bind2 = createBinder(overloads, binder); + return call; + function call() { + var args = []; + for (var _i2 = 0; _i2 < arguments.length; _i2++) { + args[_i2] = arguments[_i2]; + } + var index5 = bind2(args); + var fn = index5 !== void 0 ? overloads[index5] : void 0; + if (typeof fn === "function") { + return fn.apply(void 0, args); + } + throw new TypeError("Invalid arguments"); + } + } + ts2.createOverload = createOverload; + function createBinder(overloads, binder) { + return function(args) { + for (var i7 = 0; ts2.hasProperty(overloads, "".concat(i7)) && ts2.hasProperty(binder, "".concat(i7)); i7++) { + var fn = binder[i7]; + if (fn(args)) { + return i7; + } + } + }; + } + function buildOverload(name2) { + return { + overload: function(overloads) { + return { + bind: function(binder) { + return { + finish: function() { + return createOverload(name2, overloads, binder); + }, + deprecate: function(deprecations) { + return { + finish: function() { + return createOverload(name2, overloads, binder, deprecations); + } + }; + } + }; + } + }; + } + }; + } + ts2.buildOverload = buildOverload; + })(ts || (ts = {})); + var ts; + (function(ts2) { + var factoryDeprecation = { since: "4.0", warnAfter: "4.1", message: "Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead." }; + ts2.createNodeArray = ts2.Debug.deprecate(ts2.factory.createNodeArray, factoryDeprecation); + ts2.createNumericLiteral = ts2.Debug.deprecate(ts2.factory.createNumericLiteral, factoryDeprecation); + ts2.createBigIntLiteral = ts2.Debug.deprecate(ts2.factory.createBigIntLiteral, factoryDeprecation); + ts2.createStringLiteral = ts2.Debug.deprecate(ts2.factory.createStringLiteral, factoryDeprecation); + ts2.createStringLiteralFromNode = ts2.Debug.deprecate(ts2.factory.createStringLiteralFromNode, factoryDeprecation); + ts2.createRegularExpressionLiteral = ts2.Debug.deprecate(ts2.factory.createRegularExpressionLiteral, factoryDeprecation); + ts2.createLoopVariable = ts2.Debug.deprecate(ts2.factory.createLoopVariable, factoryDeprecation); + ts2.createUniqueName = ts2.Debug.deprecate(ts2.factory.createUniqueName, factoryDeprecation); + ts2.createPrivateIdentifier = ts2.Debug.deprecate(ts2.factory.createPrivateIdentifier, factoryDeprecation); + ts2.createSuper = ts2.Debug.deprecate(ts2.factory.createSuper, factoryDeprecation); + ts2.createThis = ts2.Debug.deprecate(ts2.factory.createThis, factoryDeprecation); + ts2.createNull = ts2.Debug.deprecate(ts2.factory.createNull, factoryDeprecation); + ts2.createTrue = ts2.Debug.deprecate(ts2.factory.createTrue, factoryDeprecation); + ts2.createFalse = ts2.Debug.deprecate(ts2.factory.createFalse, factoryDeprecation); + ts2.createModifier = ts2.Debug.deprecate(ts2.factory.createModifier, factoryDeprecation); + ts2.createModifiersFromModifierFlags = ts2.Debug.deprecate(ts2.factory.createModifiersFromModifierFlags, factoryDeprecation); + ts2.createQualifiedName = ts2.Debug.deprecate(ts2.factory.createQualifiedName, factoryDeprecation); + ts2.updateQualifiedName = ts2.Debug.deprecate(ts2.factory.updateQualifiedName, factoryDeprecation); + ts2.createComputedPropertyName = ts2.Debug.deprecate(ts2.factory.createComputedPropertyName, factoryDeprecation); + ts2.updateComputedPropertyName = ts2.Debug.deprecate(ts2.factory.updateComputedPropertyName, factoryDeprecation); + ts2.createTypeParameterDeclaration = ts2.Debug.deprecate(ts2.factory.createTypeParameterDeclaration, factoryDeprecation); + ts2.updateTypeParameterDeclaration = ts2.Debug.deprecate(ts2.factory.updateTypeParameterDeclaration, factoryDeprecation); + ts2.createParameter = ts2.Debug.deprecate(ts2.factory.createParameterDeclaration, factoryDeprecation); + ts2.updateParameter = ts2.Debug.deprecate(ts2.factory.updateParameterDeclaration, factoryDeprecation); + ts2.createDecorator = ts2.Debug.deprecate(ts2.factory.createDecorator, factoryDeprecation); + ts2.updateDecorator = ts2.Debug.deprecate(ts2.factory.updateDecorator, factoryDeprecation); + ts2.createProperty = ts2.Debug.deprecate(ts2.factory.createPropertyDeclaration, factoryDeprecation); + ts2.updateProperty = ts2.Debug.deprecate(ts2.factory.updatePropertyDeclaration, factoryDeprecation); + ts2.createMethod = ts2.Debug.deprecate(ts2.factory.createMethodDeclaration, factoryDeprecation); + ts2.updateMethod = ts2.Debug.deprecate(ts2.factory.updateMethodDeclaration, factoryDeprecation); + ts2.createConstructor = ts2.Debug.deprecate(ts2.factory.createConstructorDeclaration, factoryDeprecation); + ts2.updateConstructor = ts2.Debug.deprecate(ts2.factory.updateConstructorDeclaration, factoryDeprecation); + ts2.createGetAccessor = ts2.Debug.deprecate(ts2.factory.createGetAccessorDeclaration, factoryDeprecation); + ts2.updateGetAccessor = ts2.Debug.deprecate(ts2.factory.updateGetAccessorDeclaration, factoryDeprecation); + ts2.createSetAccessor = ts2.Debug.deprecate(ts2.factory.createSetAccessorDeclaration, factoryDeprecation); + ts2.updateSetAccessor = ts2.Debug.deprecate(ts2.factory.updateSetAccessorDeclaration, factoryDeprecation); + ts2.createCallSignature = ts2.Debug.deprecate(ts2.factory.createCallSignature, factoryDeprecation); + ts2.updateCallSignature = ts2.Debug.deprecate(ts2.factory.updateCallSignature, factoryDeprecation); + ts2.createConstructSignature = ts2.Debug.deprecate(ts2.factory.createConstructSignature, factoryDeprecation); + ts2.updateConstructSignature = ts2.Debug.deprecate(ts2.factory.updateConstructSignature, factoryDeprecation); + ts2.updateIndexSignature = ts2.Debug.deprecate(ts2.factory.updateIndexSignature, factoryDeprecation); + ts2.createKeywordTypeNode = ts2.Debug.deprecate(ts2.factory.createKeywordTypeNode, factoryDeprecation); + ts2.createTypePredicateNodeWithModifier = ts2.Debug.deprecate(ts2.factory.createTypePredicateNode, factoryDeprecation); + ts2.updateTypePredicateNodeWithModifier = ts2.Debug.deprecate(ts2.factory.updateTypePredicateNode, factoryDeprecation); + ts2.createTypeReferenceNode = ts2.Debug.deprecate(ts2.factory.createTypeReferenceNode, factoryDeprecation); + ts2.updateTypeReferenceNode = ts2.Debug.deprecate(ts2.factory.updateTypeReferenceNode, factoryDeprecation); + ts2.createFunctionTypeNode = ts2.Debug.deprecate(ts2.factory.createFunctionTypeNode, factoryDeprecation); + ts2.updateFunctionTypeNode = ts2.Debug.deprecate(ts2.factory.updateFunctionTypeNode, factoryDeprecation); + ts2.createConstructorTypeNode = ts2.Debug.deprecate(function(typeParameters, parameters, type3) { + return ts2.factory.createConstructorTypeNode( + /*modifiers*/ + void 0, + typeParameters, + parameters, + type3 + ); + }, factoryDeprecation); + ts2.updateConstructorTypeNode = ts2.Debug.deprecate(function(node, typeParameters, parameters, type3) { + return ts2.factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type3); + }, factoryDeprecation); + ts2.createTypeQueryNode = ts2.Debug.deprecate(ts2.factory.createTypeQueryNode, factoryDeprecation); + ts2.updateTypeQueryNode = ts2.Debug.deprecate(ts2.factory.updateTypeQueryNode, factoryDeprecation); + ts2.createTypeLiteralNode = ts2.Debug.deprecate(ts2.factory.createTypeLiteralNode, factoryDeprecation); + ts2.updateTypeLiteralNode = ts2.Debug.deprecate(ts2.factory.updateTypeLiteralNode, factoryDeprecation); + ts2.createArrayTypeNode = ts2.Debug.deprecate(ts2.factory.createArrayTypeNode, factoryDeprecation); + ts2.updateArrayTypeNode = ts2.Debug.deprecate(ts2.factory.updateArrayTypeNode, factoryDeprecation); + ts2.createTupleTypeNode = ts2.Debug.deprecate(ts2.factory.createTupleTypeNode, factoryDeprecation); + ts2.updateTupleTypeNode = ts2.Debug.deprecate(ts2.factory.updateTupleTypeNode, factoryDeprecation); + ts2.createOptionalTypeNode = ts2.Debug.deprecate(ts2.factory.createOptionalTypeNode, factoryDeprecation); + ts2.updateOptionalTypeNode = ts2.Debug.deprecate(ts2.factory.updateOptionalTypeNode, factoryDeprecation); + ts2.createRestTypeNode = ts2.Debug.deprecate(ts2.factory.createRestTypeNode, factoryDeprecation); + ts2.updateRestTypeNode = ts2.Debug.deprecate(ts2.factory.updateRestTypeNode, factoryDeprecation); + ts2.createUnionTypeNode = ts2.Debug.deprecate(ts2.factory.createUnionTypeNode, factoryDeprecation); + ts2.updateUnionTypeNode = ts2.Debug.deprecate(ts2.factory.updateUnionTypeNode, factoryDeprecation); + ts2.createIntersectionTypeNode = ts2.Debug.deprecate(ts2.factory.createIntersectionTypeNode, factoryDeprecation); + ts2.updateIntersectionTypeNode = ts2.Debug.deprecate(ts2.factory.updateIntersectionTypeNode, factoryDeprecation); + ts2.createConditionalTypeNode = ts2.Debug.deprecate(ts2.factory.createConditionalTypeNode, factoryDeprecation); + ts2.updateConditionalTypeNode = ts2.Debug.deprecate(ts2.factory.updateConditionalTypeNode, factoryDeprecation); + ts2.createInferTypeNode = ts2.Debug.deprecate(ts2.factory.createInferTypeNode, factoryDeprecation); + ts2.updateInferTypeNode = ts2.Debug.deprecate(ts2.factory.updateInferTypeNode, factoryDeprecation); + ts2.createImportTypeNode = ts2.Debug.deprecate(ts2.factory.createImportTypeNode, factoryDeprecation); + ts2.updateImportTypeNode = ts2.Debug.deprecate(ts2.factory.updateImportTypeNode, factoryDeprecation); + ts2.createParenthesizedType = ts2.Debug.deprecate(ts2.factory.createParenthesizedType, factoryDeprecation); + ts2.updateParenthesizedType = ts2.Debug.deprecate(ts2.factory.updateParenthesizedType, factoryDeprecation); + ts2.createThisTypeNode = ts2.Debug.deprecate(ts2.factory.createThisTypeNode, factoryDeprecation); + ts2.updateTypeOperatorNode = ts2.Debug.deprecate(ts2.factory.updateTypeOperatorNode, factoryDeprecation); + ts2.createIndexedAccessTypeNode = ts2.Debug.deprecate(ts2.factory.createIndexedAccessTypeNode, factoryDeprecation); + ts2.updateIndexedAccessTypeNode = ts2.Debug.deprecate(ts2.factory.updateIndexedAccessTypeNode, factoryDeprecation); + ts2.createMappedTypeNode = ts2.Debug.deprecate(ts2.factory.createMappedTypeNode, factoryDeprecation); + ts2.updateMappedTypeNode = ts2.Debug.deprecate(ts2.factory.updateMappedTypeNode, factoryDeprecation); + ts2.createLiteralTypeNode = ts2.Debug.deprecate(ts2.factory.createLiteralTypeNode, factoryDeprecation); + ts2.updateLiteralTypeNode = ts2.Debug.deprecate(ts2.factory.updateLiteralTypeNode, factoryDeprecation); + ts2.createObjectBindingPattern = ts2.Debug.deprecate(ts2.factory.createObjectBindingPattern, factoryDeprecation); + ts2.updateObjectBindingPattern = ts2.Debug.deprecate(ts2.factory.updateObjectBindingPattern, factoryDeprecation); + ts2.createArrayBindingPattern = ts2.Debug.deprecate(ts2.factory.createArrayBindingPattern, factoryDeprecation); + ts2.updateArrayBindingPattern = ts2.Debug.deprecate(ts2.factory.updateArrayBindingPattern, factoryDeprecation); + ts2.createBindingElement = ts2.Debug.deprecate(ts2.factory.createBindingElement, factoryDeprecation); + ts2.updateBindingElement = ts2.Debug.deprecate(ts2.factory.updateBindingElement, factoryDeprecation); + ts2.createArrayLiteral = ts2.Debug.deprecate(ts2.factory.createArrayLiteralExpression, factoryDeprecation); + ts2.updateArrayLiteral = ts2.Debug.deprecate(ts2.factory.updateArrayLiteralExpression, factoryDeprecation); + ts2.createObjectLiteral = ts2.Debug.deprecate(ts2.factory.createObjectLiteralExpression, factoryDeprecation); + ts2.updateObjectLiteral = ts2.Debug.deprecate(ts2.factory.updateObjectLiteralExpression, factoryDeprecation); + ts2.createPropertyAccess = ts2.Debug.deprecate(ts2.factory.createPropertyAccessExpression, factoryDeprecation); + ts2.updatePropertyAccess = ts2.Debug.deprecate(ts2.factory.updatePropertyAccessExpression, factoryDeprecation); + ts2.createPropertyAccessChain = ts2.Debug.deprecate(ts2.factory.createPropertyAccessChain, factoryDeprecation); + ts2.updatePropertyAccessChain = ts2.Debug.deprecate(ts2.factory.updatePropertyAccessChain, factoryDeprecation); + ts2.createElementAccess = ts2.Debug.deprecate(ts2.factory.createElementAccessExpression, factoryDeprecation); + ts2.updateElementAccess = ts2.Debug.deprecate(ts2.factory.updateElementAccessExpression, factoryDeprecation); + ts2.createElementAccessChain = ts2.Debug.deprecate(ts2.factory.createElementAccessChain, factoryDeprecation); + ts2.updateElementAccessChain = ts2.Debug.deprecate(ts2.factory.updateElementAccessChain, factoryDeprecation); + ts2.createCall = ts2.Debug.deprecate(ts2.factory.createCallExpression, factoryDeprecation); + ts2.updateCall = ts2.Debug.deprecate(ts2.factory.updateCallExpression, factoryDeprecation); + ts2.createCallChain = ts2.Debug.deprecate(ts2.factory.createCallChain, factoryDeprecation); + ts2.updateCallChain = ts2.Debug.deprecate(ts2.factory.updateCallChain, factoryDeprecation); + ts2.createNew = ts2.Debug.deprecate(ts2.factory.createNewExpression, factoryDeprecation); + ts2.updateNew = ts2.Debug.deprecate(ts2.factory.updateNewExpression, factoryDeprecation); + ts2.createTypeAssertion = ts2.Debug.deprecate(ts2.factory.createTypeAssertion, factoryDeprecation); + ts2.updateTypeAssertion = ts2.Debug.deprecate(ts2.factory.updateTypeAssertion, factoryDeprecation); + ts2.createParen = ts2.Debug.deprecate(ts2.factory.createParenthesizedExpression, factoryDeprecation); + ts2.updateParen = ts2.Debug.deprecate(ts2.factory.updateParenthesizedExpression, factoryDeprecation); + ts2.createFunctionExpression = ts2.Debug.deprecate(ts2.factory.createFunctionExpression, factoryDeprecation); + ts2.updateFunctionExpression = ts2.Debug.deprecate(ts2.factory.updateFunctionExpression, factoryDeprecation); + ts2.createDelete = ts2.Debug.deprecate(ts2.factory.createDeleteExpression, factoryDeprecation); + ts2.updateDelete = ts2.Debug.deprecate(ts2.factory.updateDeleteExpression, factoryDeprecation); + ts2.createTypeOf = ts2.Debug.deprecate(ts2.factory.createTypeOfExpression, factoryDeprecation); + ts2.updateTypeOf = ts2.Debug.deprecate(ts2.factory.updateTypeOfExpression, factoryDeprecation); + ts2.createVoid = ts2.Debug.deprecate(ts2.factory.createVoidExpression, factoryDeprecation); + ts2.updateVoid = ts2.Debug.deprecate(ts2.factory.updateVoidExpression, factoryDeprecation); + ts2.createAwait = ts2.Debug.deprecate(ts2.factory.createAwaitExpression, factoryDeprecation); + ts2.updateAwait = ts2.Debug.deprecate(ts2.factory.updateAwaitExpression, factoryDeprecation); + ts2.createPrefix = ts2.Debug.deprecate(ts2.factory.createPrefixUnaryExpression, factoryDeprecation); + ts2.updatePrefix = ts2.Debug.deprecate(ts2.factory.updatePrefixUnaryExpression, factoryDeprecation); + ts2.createPostfix = ts2.Debug.deprecate(ts2.factory.createPostfixUnaryExpression, factoryDeprecation); + ts2.updatePostfix = ts2.Debug.deprecate(ts2.factory.updatePostfixUnaryExpression, factoryDeprecation); + ts2.createBinary = ts2.Debug.deprecate(ts2.factory.createBinaryExpression, factoryDeprecation); + ts2.updateConditional = ts2.Debug.deprecate(ts2.factory.updateConditionalExpression, factoryDeprecation); + ts2.createTemplateExpression = ts2.Debug.deprecate(ts2.factory.createTemplateExpression, factoryDeprecation); + ts2.updateTemplateExpression = ts2.Debug.deprecate(ts2.factory.updateTemplateExpression, factoryDeprecation); + ts2.createTemplateHead = ts2.Debug.deprecate(ts2.factory.createTemplateHead, factoryDeprecation); + ts2.createTemplateMiddle = ts2.Debug.deprecate(ts2.factory.createTemplateMiddle, factoryDeprecation); + ts2.createTemplateTail = ts2.Debug.deprecate(ts2.factory.createTemplateTail, factoryDeprecation); + ts2.createNoSubstitutionTemplateLiteral = ts2.Debug.deprecate(ts2.factory.createNoSubstitutionTemplateLiteral, factoryDeprecation); + ts2.updateYield = ts2.Debug.deprecate(ts2.factory.updateYieldExpression, factoryDeprecation); + ts2.createSpread = ts2.Debug.deprecate(ts2.factory.createSpreadElement, factoryDeprecation); + ts2.updateSpread = ts2.Debug.deprecate(ts2.factory.updateSpreadElement, factoryDeprecation); + ts2.createOmittedExpression = ts2.Debug.deprecate(ts2.factory.createOmittedExpression, factoryDeprecation); + ts2.createAsExpression = ts2.Debug.deprecate(ts2.factory.createAsExpression, factoryDeprecation); + ts2.updateAsExpression = ts2.Debug.deprecate(ts2.factory.updateAsExpression, factoryDeprecation); + ts2.createNonNullExpression = ts2.Debug.deprecate(ts2.factory.createNonNullExpression, factoryDeprecation); + ts2.updateNonNullExpression = ts2.Debug.deprecate(ts2.factory.updateNonNullExpression, factoryDeprecation); + ts2.createNonNullChain = ts2.Debug.deprecate(ts2.factory.createNonNullChain, factoryDeprecation); + ts2.updateNonNullChain = ts2.Debug.deprecate(ts2.factory.updateNonNullChain, factoryDeprecation); + ts2.createMetaProperty = ts2.Debug.deprecate(ts2.factory.createMetaProperty, factoryDeprecation); + ts2.updateMetaProperty = ts2.Debug.deprecate(ts2.factory.updateMetaProperty, factoryDeprecation); + ts2.createTemplateSpan = ts2.Debug.deprecate(ts2.factory.createTemplateSpan, factoryDeprecation); + ts2.updateTemplateSpan = ts2.Debug.deprecate(ts2.factory.updateTemplateSpan, factoryDeprecation); + ts2.createSemicolonClassElement = ts2.Debug.deprecate(ts2.factory.createSemicolonClassElement, factoryDeprecation); + ts2.createBlock = ts2.Debug.deprecate(ts2.factory.createBlock, factoryDeprecation); + ts2.updateBlock = ts2.Debug.deprecate(ts2.factory.updateBlock, factoryDeprecation); + ts2.createVariableStatement = ts2.Debug.deprecate(ts2.factory.createVariableStatement, factoryDeprecation); + ts2.updateVariableStatement = ts2.Debug.deprecate(ts2.factory.updateVariableStatement, factoryDeprecation); + ts2.createEmptyStatement = ts2.Debug.deprecate(ts2.factory.createEmptyStatement, factoryDeprecation); + ts2.createExpressionStatement = ts2.Debug.deprecate(ts2.factory.createExpressionStatement, factoryDeprecation); + ts2.updateExpressionStatement = ts2.Debug.deprecate(ts2.factory.updateExpressionStatement, factoryDeprecation); + ts2.createStatement = ts2.Debug.deprecate(ts2.factory.createExpressionStatement, factoryDeprecation); + ts2.updateStatement = ts2.Debug.deprecate(ts2.factory.updateExpressionStatement, factoryDeprecation); + ts2.createIf = ts2.Debug.deprecate(ts2.factory.createIfStatement, factoryDeprecation); + ts2.updateIf = ts2.Debug.deprecate(ts2.factory.updateIfStatement, factoryDeprecation); + ts2.createDo = ts2.Debug.deprecate(ts2.factory.createDoStatement, factoryDeprecation); + ts2.updateDo = ts2.Debug.deprecate(ts2.factory.updateDoStatement, factoryDeprecation); + ts2.createWhile = ts2.Debug.deprecate(ts2.factory.createWhileStatement, factoryDeprecation); + ts2.updateWhile = ts2.Debug.deprecate(ts2.factory.updateWhileStatement, factoryDeprecation); + ts2.createFor = ts2.Debug.deprecate(ts2.factory.createForStatement, factoryDeprecation); + ts2.updateFor = ts2.Debug.deprecate(ts2.factory.updateForStatement, factoryDeprecation); + ts2.createForIn = ts2.Debug.deprecate(ts2.factory.createForInStatement, factoryDeprecation); + ts2.updateForIn = ts2.Debug.deprecate(ts2.factory.updateForInStatement, factoryDeprecation); + ts2.createForOf = ts2.Debug.deprecate(ts2.factory.createForOfStatement, factoryDeprecation); + ts2.updateForOf = ts2.Debug.deprecate(ts2.factory.updateForOfStatement, factoryDeprecation); + ts2.createContinue = ts2.Debug.deprecate(ts2.factory.createContinueStatement, factoryDeprecation); + ts2.updateContinue = ts2.Debug.deprecate(ts2.factory.updateContinueStatement, factoryDeprecation); + ts2.createBreak = ts2.Debug.deprecate(ts2.factory.createBreakStatement, factoryDeprecation); + ts2.updateBreak = ts2.Debug.deprecate(ts2.factory.updateBreakStatement, factoryDeprecation); + ts2.createReturn = ts2.Debug.deprecate(ts2.factory.createReturnStatement, factoryDeprecation); + ts2.updateReturn = ts2.Debug.deprecate(ts2.factory.updateReturnStatement, factoryDeprecation); + ts2.createWith = ts2.Debug.deprecate(ts2.factory.createWithStatement, factoryDeprecation); + ts2.updateWith = ts2.Debug.deprecate(ts2.factory.updateWithStatement, factoryDeprecation); + ts2.createSwitch = ts2.Debug.deprecate(ts2.factory.createSwitchStatement, factoryDeprecation); + ts2.updateSwitch = ts2.Debug.deprecate(ts2.factory.updateSwitchStatement, factoryDeprecation); + ts2.createLabel = ts2.Debug.deprecate(ts2.factory.createLabeledStatement, factoryDeprecation); + ts2.updateLabel = ts2.Debug.deprecate(ts2.factory.updateLabeledStatement, factoryDeprecation); + ts2.createThrow = ts2.Debug.deprecate(ts2.factory.createThrowStatement, factoryDeprecation); + ts2.updateThrow = ts2.Debug.deprecate(ts2.factory.updateThrowStatement, factoryDeprecation); + ts2.createTry = ts2.Debug.deprecate(ts2.factory.createTryStatement, factoryDeprecation); + ts2.updateTry = ts2.Debug.deprecate(ts2.factory.updateTryStatement, factoryDeprecation); + ts2.createDebuggerStatement = ts2.Debug.deprecate(ts2.factory.createDebuggerStatement, factoryDeprecation); + ts2.createVariableDeclarationList = ts2.Debug.deprecate(ts2.factory.createVariableDeclarationList, factoryDeprecation); + ts2.updateVariableDeclarationList = ts2.Debug.deprecate(ts2.factory.updateVariableDeclarationList, factoryDeprecation); + ts2.createFunctionDeclaration = ts2.Debug.deprecate(ts2.factory.createFunctionDeclaration, factoryDeprecation); + ts2.updateFunctionDeclaration = ts2.Debug.deprecate(ts2.factory.updateFunctionDeclaration, factoryDeprecation); + ts2.createClassDeclaration = ts2.Debug.deprecate(ts2.factory.createClassDeclaration, factoryDeprecation); + ts2.updateClassDeclaration = ts2.Debug.deprecate(ts2.factory.updateClassDeclaration, factoryDeprecation); + ts2.createInterfaceDeclaration = ts2.Debug.deprecate(ts2.factory.createInterfaceDeclaration, factoryDeprecation); + ts2.updateInterfaceDeclaration = ts2.Debug.deprecate(ts2.factory.updateInterfaceDeclaration, factoryDeprecation); + ts2.createTypeAliasDeclaration = ts2.Debug.deprecate(ts2.factory.createTypeAliasDeclaration, factoryDeprecation); + ts2.updateTypeAliasDeclaration = ts2.Debug.deprecate(ts2.factory.updateTypeAliasDeclaration, factoryDeprecation); + ts2.createEnumDeclaration = ts2.Debug.deprecate(ts2.factory.createEnumDeclaration, factoryDeprecation); + ts2.updateEnumDeclaration = ts2.Debug.deprecate(ts2.factory.updateEnumDeclaration, factoryDeprecation); + ts2.createModuleDeclaration = ts2.Debug.deprecate(ts2.factory.createModuleDeclaration, factoryDeprecation); + ts2.updateModuleDeclaration = ts2.Debug.deprecate(ts2.factory.updateModuleDeclaration, factoryDeprecation); + ts2.createModuleBlock = ts2.Debug.deprecate(ts2.factory.createModuleBlock, factoryDeprecation); + ts2.updateModuleBlock = ts2.Debug.deprecate(ts2.factory.updateModuleBlock, factoryDeprecation); + ts2.createCaseBlock = ts2.Debug.deprecate(ts2.factory.createCaseBlock, factoryDeprecation); + ts2.updateCaseBlock = ts2.Debug.deprecate(ts2.factory.updateCaseBlock, factoryDeprecation); + ts2.createNamespaceExportDeclaration = ts2.Debug.deprecate(ts2.factory.createNamespaceExportDeclaration, factoryDeprecation); + ts2.updateNamespaceExportDeclaration = ts2.Debug.deprecate(ts2.factory.updateNamespaceExportDeclaration, factoryDeprecation); + ts2.createImportEqualsDeclaration = ts2.Debug.deprecate(ts2.factory.createImportEqualsDeclaration, factoryDeprecation); + ts2.updateImportEqualsDeclaration = ts2.Debug.deprecate(ts2.factory.updateImportEqualsDeclaration, factoryDeprecation); + ts2.createImportDeclaration = ts2.Debug.deprecate(ts2.factory.createImportDeclaration, factoryDeprecation); + ts2.updateImportDeclaration = ts2.Debug.deprecate(ts2.factory.updateImportDeclaration, factoryDeprecation); + ts2.createNamespaceImport = ts2.Debug.deprecate(ts2.factory.createNamespaceImport, factoryDeprecation); + ts2.updateNamespaceImport = ts2.Debug.deprecate(ts2.factory.updateNamespaceImport, factoryDeprecation); + ts2.createNamedImports = ts2.Debug.deprecate(ts2.factory.createNamedImports, factoryDeprecation); + ts2.updateNamedImports = ts2.Debug.deprecate(ts2.factory.updateNamedImports, factoryDeprecation); + ts2.createImportSpecifier = ts2.Debug.deprecate(ts2.factory.createImportSpecifier, factoryDeprecation); + ts2.updateImportSpecifier = ts2.Debug.deprecate(ts2.factory.updateImportSpecifier, factoryDeprecation); + ts2.createExportAssignment = ts2.Debug.deprecate(ts2.factory.createExportAssignment, factoryDeprecation); + ts2.updateExportAssignment = ts2.Debug.deprecate(ts2.factory.updateExportAssignment, factoryDeprecation); + ts2.createNamedExports = ts2.Debug.deprecate(ts2.factory.createNamedExports, factoryDeprecation); + ts2.updateNamedExports = ts2.Debug.deprecate(ts2.factory.updateNamedExports, factoryDeprecation); + ts2.createExportSpecifier = ts2.Debug.deprecate(ts2.factory.createExportSpecifier, factoryDeprecation); + ts2.updateExportSpecifier = ts2.Debug.deprecate(ts2.factory.updateExportSpecifier, factoryDeprecation); + ts2.createExternalModuleReference = ts2.Debug.deprecate(ts2.factory.createExternalModuleReference, factoryDeprecation); + ts2.updateExternalModuleReference = ts2.Debug.deprecate(ts2.factory.updateExternalModuleReference, factoryDeprecation); + ts2.createJSDocTypeExpression = ts2.Debug.deprecate(ts2.factory.createJSDocTypeExpression, factoryDeprecation); + ts2.createJSDocTypeTag = ts2.Debug.deprecate(ts2.factory.createJSDocTypeTag, factoryDeprecation); + ts2.createJSDocReturnTag = ts2.Debug.deprecate(ts2.factory.createJSDocReturnTag, factoryDeprecation); + ts2.createJSDocThisTag = ts2.Debug.deprecate(ts2.factory.createJSDocThisTag, factoryDeprecation); + ts2.createJSDocComment = ts2.Debug.deprecate(ts2.factory.createJSDocComment, factoryDeprecation); + ts2.createJSDocParameterTag = ts2.Debug.deprecate(ts2.factory.createJSDocParameterTag, factoryDeprecation); + ts2.createJSDocClassTag = ts2.Debug.deprecate(ts2.factory.createJSDocClassTag, factoryDeprecation); + ts2.createJSDocAugmentsTag = ts2.Debug.deprecate(ts2.factory.createJSDocAugmentsTag, factoryDeprecation); + ts2.createJSDocEnumTag = ts2.Debug.deprecate(ts2.factory.createJSDocEnumTag, factoryDeprecation); + ts2.createJSDocTemplateTag = ts2.Debug.deprecate(ts2.factory.createJSDocTemplateTag, factoryDeprecation); + ts2.createJSDocTypedefTag = ts2.Debug.deprecate(ts2.factory.createJSDocTypedefTag, factoryDeprecation); + ts2.createJSDocCallbackTag = ts2.Debug.deprecate(ts2.factory.createJSDocCallbackTag, factoryDeprecation); + ts2.createJSDocSignature = ts2.Debug.deprecate(ts2.factory.createJSDocSignature, factoryDeprecation); + ts2.createJSDocPropertyTag = ts2.Debug.deprecate(ts2.factory.createJSDocPropertyTag, factoryDeprecation); + ts2.createJSDocTypeLiteral = ts2.Debug.deprecate(ts2.factory.createJSDocTypeLiteral, factoryDeprecation); + ts2.createJSDocImplementsTag = ts2.Debug.deprecate(ts2.factory.createJSDocImplementsTag, factoryDeprecation); + ts2.createJSDocAuthorTag = ts2.Debug.deprecate(ts2.factory.createJSDocAuthorTag, factoryDeprecation); + ts2.createJSDocPublicTag = ts2.Debug.deprecate(ts2.factory.createJSDocPublicTag, factoryDeprecation); + ts2.createJSDocPrivateTag = ts2.Debug.deprecate(ts2.factory.createJSDocPrivateTag, factoryDeprecation); + ts2.createJSDocProtectedTag = ts2.Debug.deprecate(ts2.factory.createJSDocProtectedTag, factoryDeprecation); + ts2.createJSDocReadonlyTag = ts2.Debug.deprecate(ts2.factory.createJSDocReadonlyTag, factoryDeprecation); + ts2.createJSDocTag = ts2.Debug.deprecate(ts2.factory.createJSDocUnknownTag, factoryDeprecation); + ts2.createJsxElement = ts2.Debug.deprecate(ts2.factory.createJsxElement, factoryDeprecation); + ts2.updateJsxElement = ts2.Debug.deprecate(ts2.factory.updateJsxElement, factoryDeprecation); + ts2.createJsxSelfClosingElement = ts2.Debug.deprecate(ts2.factory.createJsxSelfClosingElement, factoryDeprecation); + ts2.updateJsxSelfClosingElement = ts2.Debug.deprecate(ts2.factory.updateJsxSelfClosingElement, factoryDeprecation); + ts2.createJsxOpeningElement = ts2.Debug.deprecate(ts2.factory.createJsxOpeningElement, factoryDeprecation); + ts2.updateJsxOpeningElement = ts2.Debug.deprecate(ts2.factory.updateJsxOpeningElement, factoryDeprecation); + ts2.createJsxClosingElement = ts2.Debug.deprecate(ts2.factory.createJsxClosingElement, factoryDeprecation); + ts2.updateJsxClosingElement = ts2.Debug.deprecate(ts2.factory.updateJsxClosingElement, factoryDeprecation); + ts2.createJsxFragment = ts2.Debug.deprecate(ts2.factory.createJsxFragment, factoryDeprecation); + ts2.createJsxText = ts2.Debug.deprecate(ts2.factory.createJsxText, factoryDeprecation); + ts2.updateJsxText = ts2.Debug.deprecate(ts2.factory.updateJsxText, factoryDeprecation); + ts2.createJsxOpeningFragment = ts2.Debug.deprecate(ts2.factory.createJsxOpeningFragment, factoryDeprecation); + ts2.createJsxJsxClosingFragment = ts2.Debug.deprecate(ts2.factory.createJsxJsxClosingFragment, factoryDeprecation); + ts2.updateJsxFragment = ts2.Debug.deprecate(ts2.factory.updateJsxFragment, factoryDeprecation); + ts2.createJsxAttribute = ts2.Debug.deprecate(ts2.factory.createJsxAttribute, factoryDeprecation); + ts2.updateJsxAttribute = ts2.Debug.deprecate(ts2.factory.updateJsxAttribute, factoryDeprecation); + ts2.createJsxAttributes = ts2.Debug.deprecate(ts2.factory.createJsxAttributes, factoryDeprecation); + ts2.updateJsxAttributes = ts2.Debug.deprecate(ts2.factory.updateJsxAttributes, factoryDeprecation); + ts2.createJsxSpreadAttribute = ts2.Debug.deprecate(ts2.factory.createJsxSpreadAttribute, factoryDeprecation); + ts2.updateJsxSpreadAttribute = ts2.Debug.deprecate(ts2.factory.updateJsxSpreadAttribute, factoryDeprecation); + ts2.createJsxExpression = ts2.Debug.deprecate(ts2.factory.createJsxExpression, factoryDeprecation); + ts2.updateJsxExpression = ts2.Debug.deprecate(ts2.factory.updateJsxExpression, factoryDeprecation); + ts2.createCaseClause = ts2.Debug.deprecate(ts2.factory.createCaseClause, factoryDeprecation); + ts2.updateCaseClause = ts2.Debug.deprecate(ts2.factory.updateCaseClause, factoryDeprecation); + ts2.createDefaultClause = ts2.Debug.deprecate(ts2.factory.createDefaultClause, factoryDeprecation); + ts2.updateDefaultClause = ts2.Debug.deprecate(ts2.factory.updateDefaultClause, factoryDeprecation); + ts2.createHeritageClause = ts2.Debug.deprecate(ts2.factory.createHeritageClause, factoryDeprecation); + ts2.updateHeritageClause = ts2.Debug.deprecate(ts2.factory.updateHeritageClause, factoryDeprecation); + ts2.createCatchClause = ts2.Debug.deprecate(ts2.factory.createCatchClause, factoryDeprecation); + ts2.updateCatchClause = ts2.Debug.deprecate(ts2.factory.updateCatchClause, factoryDeprecation); + ts2.createPropertyAssignment = ts2.Debug.deprecate(ts2.factory.createPropertyAssignment, factoryDeprecation); + ts2.updatePropertyAssignment = ts2.Debug.deprecate(ts2.factory.updatePropertyAssignment, factoryDeprecation); + ts2.createShorthandPropertyAssignment = ts2.Debug.deprecate(ts2.factory.createShorthandPropertyAssignment, factoryDeprecation); + ts2.updateShorthandPropertyAssignment = ts2.Debug.deprecate(ts2.factory.updateShorthandPropertyAssignment, factoryDeprecation); + ts2.createSpreadAssignment = ts2.Debug.deprecate(ts2.factory.createSpreadAssignment, factoryDeprecation); + ts2.updateSpreadAssignment = ts2.Debug.deprecate(ts2.factory.updateSpreadAssignment, factoryDeprecation); + ts2.createEnumMember = ts2.Debug.deprecate(ts2.factory.createEnumMember, factoryDeprecation); + ts2.updateEnumMember = ts2.Debug.deprecate(ts2.factory.updateEnumMember, factoryDeprecation); + ts2.updateSourceFileNode = ts2.Debug.deprecate(ts2.factory.updateSourceFile, factoryDeprecation); + ts2.createNotEmittedStatement = ts2.Debug.deprecate(ts2.factory.createNotEmittedStatement, factoryDeprecation); + ts2.createPartiallyEmittedExpression = ts2.Debug.deprecate(ts2.factory.createPartiallyEmittedExpression, factoryDeprecation); + ts2.updatePartiallyEmittedExpression = ts2.Debug.deprecate(ts2.factory.updatePartiallyEmittedExpression, factoryDeprecation); + ts2.createCommaList = ts2.Debug.deprecate(ts2.factory.createCommaListExpression, factoryDeprecation); + ts2.updateCommaList = ts2.Debug.deprecate(ts2.factory.updateCommaListExpression, factoryDeprecation); + ts2.createBundle = ts2.Debug.deprecate(ts2.factory.createBundle, factoryDeprecation); + ts2.updateBundle = ts2.Debug.deprecate(ts2.factory.updateBundle, factoryDeprecation); + ts2.createImmediatelyInvokedFunctionExpression = ts2.Debug.deprecate(ts2.factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation); + ts2.createImmediatelyInvokedArrowFunction = ts2.Debug.deprecate(ts2.factory.createImmediatelyInvokedArrowFunction, factoryDeprecation); + ts2.createVoidZero = ts2.Debug.deprecate(ts2.factory.createVoidZero, factoryDeprecation); + ts2.createExportDefault = ts2.Debug.deprecate(ts2.factory.createExportDefault, factoryDeprecation); + ts2.createExternalModuleExport = ts2.Debug.deprecate(ts2.factory.createExternalModuleExport, factoryDeprecation); + ts2.createNamespaceExport = ts2.Debug.deprecate(ts2.factory.createNamespaceExport, factoryDeprecation); + ts2.updateNamespaceExport = ts2.Debug.deprecate(ts2.factory.updateNamespaceExport, factoryDeprecation); + ts2.createToken = ts2.Debug.deprecate(function createToken(kind) { + return ts2.factory.createToken(kind); + }, factoryDeprecation); + ts2.createIdentifier = ts2.Debug.deprecate(function createIdentifier(text) { + return ts2.factory.createIdentifier( + text, + /*typeArguments*/ + void 0, + /*originalKeywordKind*/ + void 0 + ); + }, factoryDeprecation); + ts2.createTempVariable = ts2.Debug.deprecate(function createTempVariable(recordTempVariable) { + return ts2.factory.createTempVariable( + recordTempVariable, + /*reserveInNestedScopes*/ + void 0 + ); + }, factoryDeprecation); + ts2.getGeneratedNameForNode = ts2.Debug.deprecate(function getGeneratedNameForNode(node) { + return ts2.factory.getGeneratedNameForNode( + node, + /*flags*/ + void 0 + ); + }, factoryDeprecation); + ts2.createOptimisticUniqueName = ts2.Debug.deprecate(function createOptimisticUniqueName(text) { + return ts2.factory.createUniqueName( + text, + 16 + /* GeneratedIdentifierFlags.Optimistic */ + ); + }, factoryDeprecation); + ts2.createFileLevelUniqueName = ts2.Debug.deprecate(function createFileLevelUniqueName(text) { + return ts2.factory.createUniqueName( + text, + 16 | 32 + /* GeneratedIdentifierFlags.FileLevel */ + ); + }, factoryDeprecation); + ts2.createIndexSignature = ts2.Debug.deprecate(function createIndexSignature(decorators, modifiers, parameters, type3) { + return ts2.factory.createIndexSignature(decorators, modifiers, parameters, type3); + }, factoryDeprecation); + ts2.createTypePredicateNode = ts2.Debug.deprecate(function createTypePredicateNode(parameterName, type3) { + return ts2.factory.createTypePredicateNode( + /*assertsModifier*/ + void 0, + parameterName, + type3 + ); + }, factoryDeprecation); + ts2.updateTypePredicateNode = ts2.Debug.deprecate(function updateTypePredicateNode(node, parameterName, type3) { + return ts2.factory.updateTypePredicateNode( + node, + /*assertsModifier*/ + void 0, + parameterName, + type3 + ); + }, factoryDeprecation); + ts2.createLiteral = ts2.Debug.deprecate(function createLiteral(value2) { + if (typeof value2 === "number") { + return ts2.factory.createNumericLiteral(value2); + } + if (typeof value2 === "object" && "base10Value" in value2) { + return ts2.factory.createBigIntLiteral(value2); + } + if (typeof value2 === "boolean") { + return value2 ? ts2.factory.createTrue() : ts2.factory.createFalse(); + } + if (typeof value2 === "string") { + return ts2.factory.createStringLiteral( + value2, + /*isSingleQuote*/ + void 0 + ); + } + return ts2.factory.createStringLiteralFromNode(value2); + }, { since: "4.0", warnAfter: "4.1", message: "Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead." }); + ts2.createMethodSignature = ts2.Debug.deprecate(function createMethodSignature(typeParameters, parameters, type3, name2, questionToken) { + return ts2.factory.createMethodSignature( + /*modifiers*/ + void 0, + name2, + questionToken, + typeParameters, + parameters, + type3 + ); + }, factoryDeprecation); + ts2.updateMethodSignature = ts2.Debug.deprecate(function updateMethodSignature(node, typeParameters, parameters, type3, name2, questionToken) { + return ts2.factory.updateMethodSignature(node, node.modifiers, name2, questionToken, typeParameters, parameters, type3); + }, factoryDeprecation); + ts2.createTypeOperatorNode = ts2.Debug.deprecate(function createTypeOperatorNode(operatorOrType, type3) { + var operator; + if (type3) { + operator = operatorOrType; + } else { + type3 = operatorOrType; + operator = 141; + } + return ts2.factory.createTypeOperatorNode(operator, type3); + }, factoryDeprecation); + ts2.createTaggedTemplate = ts2.Debug.deprecate(function createTaggedTemplate(tag, typeArgumentsOrTemplate, template2) { + var typeArguments; + if (template2) { + typeArguments = typeArgumentsOrTemplate; + } else { + template2 = typeArgumentsOrTemplate; + } + return ts2.factory.createTaggedTemplateExpression(tag, typeArguments, template2); + }, factoryDeprecation); + ts2.updateTaggedTemplate = ts2.Debug.deprecate(function updateTaggedTemplate(node, tag, typeArgumentsOrTemplate, template2) { + var typeArguments; + if (template2) { + typeArguments = typeArgumentsOrTemplate; + } else { + template2 = typeArgumentsOrTemplate; + } + return ts2.factory.updateTaggedTemplateExpression(node, tag, typeArguments, template2); + }, factoryDeprecation); + ts2.updateBinary = ts2.Debug.deprecate(function updateBinary(node, left, right, operator) { + if (operator === void 0) { + operator = node.operatorToken; + } + if (typeof operator === "number") { + operator = operator === node.operatorToken.kind ? node.operatorToken : ts2.factory.createToken(operator); + } + return ts2.factory.updateBinaryExpression(node, left, operator, right); + }, factoryDeprecation); + ts2.createConditional = ts2.Debug.deprecate(function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { + return arguments.length === 5 ? ts2.factory.createConditionalExpression(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) : arguments.length === 3 ? ts2.factory.createConditionalExpression(condition, ts2.factory.createToken( + 57 + /* SyntaxKind.QuestionToken */ + ), questionTokenOrWhenTrue, ts2.factory.createToken( + 58 + /* SyntaxKind.ColonToken */ + ), whenTrueOrWhenFalse) : ts2.Debug.fail("Argument count mismatch"); + }, factoryDeprecation); + ts2.createYield = ts2.Debug.deprecate(function createYield(asteriskTokenOrExpression, expression) { + var asteriskToken; + if (expression) { + asteriskToken = asteriskTokenOrExpression; + } else { + expression = asteriskTokenOrExpression; + } + return ts2.factory.createYieldExpression(asteriskToken, expression); + }, factoryDeprecation); + ts2.createClassExpression = ts2.Debug.deprecate(function createClassExpression(modifiers, name2, typeParameters, heritageClauses, members) { + return ts2.factory.createClassExpression( + /*decorators*/ + void 0, + modifiers, + name2, + typeParameters, + heritageClauses, + members + ); + }, factoryDeprecation); + ts2.updateClassExpression = ts2.Debug.deprecate(function updateClassExpression(node, modifiers, name2, typeParameters, heritageClauses, members) { + return ts2.factory.updateClassExpression( + node, + /*decorators*/ + void 0, + modifiers, + name2, + typeParameters, + heritageClauses, + members + ); + }, factoryDeprecation); + ts2.createPropertySignature = ts2.Debug.deprecate(function createPropertySignature(modifiers, name2, questionToken, type3, initializer) { + var node = ts2.factory.createPropertySignature(modifiers, name2, questionToken, type3); + node.initializer = initializer; + return node; + }, factoryDeprecation); + ts2.updatePropertySignature = ts2.Debug.deprecate(function updatePropertySignature(node, modifiers, name2, questionToken, type3, initializer) { + var updated = ts2.factory.updatePropertySignature(node, modifiers, name2, questionToken, type3); + if (node.initializer !== initializer) { + if (updated === node) { + updated = ts2.factory.cloneNode(node); + } + updated.initializer = initializer; + } + return updated; + }, factoryDeprecation); + ts2.createExpressionWithTypeArguments = ts2.Debug.deprecate(function createExpressionWithTypeArguments(typeArguments, expression) { + return ts2.factory.createExpressionWithTypeArguments(expression, typeArguments); + }, factoryDeprecation); + ts2.updateExpressionWithTypeArguments = ts2.Debug.deprecate(function updateExpressionWithTypeArguments(node, typeArguments, expression) { + return ts2.factory.updateExpressionWithTypeArguments(node, expression, typeArguments); + }, factoryDeprecation); + ts2.createArrowFunction = ts2.Debug.deprecate(function createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanTokenOrBody, body) { + return arguments.length === 6 ? ts2.factory.createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanTokenOrBody, body) : arguments.length === 5 ? ts2.factory.createArrowFunction( + modifiers, + typeParameters, + parameters, + type3, + /*equalsGreaterThanToken*/ + void 0, + equalsGreaterThanTokenOrBody + ) : ts2.Debug.fail("Argument count mismatch"); + }, factoryDeprecation); + ts2.updateArrowFunction = ts2.Debug.deprecate(function updateArrowFunction(node, modifiers, typeParameters, parameters, type3, equalsGreaterThanTokenOrBody, body) { + return arguments.length === 7 ? ts2.factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type3, equalsGreaterThanTokenOrBody, body) : arguments.length === 6 ? ts2.factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type3, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody) : ts2.Debug.fail("Argument count mismatch"); + }, factoryDeprecation); + ts2.createVariableDeclaration = ts2.Debug.deprecate(function createVariableDeclaration(name2, exclamationTokenOrType, typeOrInitializer, initializer) { + return arguments.length === 4 ? ts2.factory.createVariableDeclaration(name2, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length >= 1 && arguments.length <= 3 ? ts2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + exclamationTokenOrType, + typeOrInitializer + ) : ts2.Debug.fail("Argument count mismatch"); + }, factoryDeprecation); + ts2.updateVariableDeclaration = ts2.Debug.deprecate(function updateVariableDeclaration(node, name2, exclamationTokenOrType, typeOrInitializer, initializer) { + return arguments.length === 5 ? ts2.factory.updateVariableDeclaration(node, name2, exclamationTokenOrType, typeOrInitializer, initializer) : arguments.length === 4 ? ts2.factory.updateVariableDeclaration(node, name2, node.exclamationToken, exclamationTokenOrType, typeOrInitializer) : ts2.Debug.fail("Argument count mismatch"); + }, factoryDeprecation); + ts2.createImportClause = ts2.Debug.deprecate(function createImportClause(name2, namedBindings, isTypeOnly) { + if (isTypeOnly === void 0) { + isTypeOnly = false; + } + return ts2.factory.createImportClause(isTypeOnly, name2, namedBindings); + }, factoryDeprecation); + ts2.updateImportClause = ts2.Debug.deprecate(function updateImportClause(node, name2, namedBindings, isTypeOnly) { + return ts2.factory.updateImportClause(node, isTypeOnly, name2, namedBindings); + }, factoryDeprecation); + ts2.createExportDeclaration = ts2.Debug.deprecate(function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { + if (isTypeOnly === void 0) { + isTypeOnly = false; + } + return ts2.factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); + }, factoryDeprecation); + ts2.updateExportDeclaration = ts2.Debug.deprecate(function updateExportDeclaration(node, decorators, modifiers, exportClause, moduleSpecifier, isTypeOnly) { + return ts2.factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, node.assertClause); + }, factoryDeprecation); + ts2.createJSDocParamTag = ts2.Debug.deprecate(function createJSDocParamTag(name2, isBracketed, typeExpression, comment) { + return ts2.factory.createJSDocParameterTag( + /*tagName*/ + void 0, + name2, + isBracketed, + typeExpression, + /*isNameFirst*/ + false, + comment ? ts2.factory.createNodeArray([ts2.factory.createJSDocText(comment)]) : void 0 + ); + }, factoryDeprecation); + ts2.createComma = ts2.Debug.deprecate(function createComma(left, right) { + return ts2.factory.createComma(left, right); + }, factoryDeprecation); + ts2.createLessThan = ts2.Debug.deprecate(function createLessThan(left, right) { + return ts2.factory.createLessThan(left, right); + }, factoryDeprecation); + ts2.createAssignment = ts2.Debug.deprecate(function createAssignment(left, right) { + return ts2.factory.createAssignment(left, right); + }, factoryDeprecation); + ts2.createStrictEquality = ts2.Debug.deprecate(function createStrictEquality(left, right) { + return ts2.factory.createStrictEquality(left, right); + }, factoryDeprecation); + ts2.createStrictInequality = ts2.Debug.deprecate(function createStrictInequality(left, right) { + return ts2.factory.createStrictInequality(left, right); + }, factoryDeprecation); + ts2.createAdd = ts2.Debug.deprecate(function createAdd(left, right) { + return ts2.factory.createAdd(left, right); + }, factoryDeprecation); + ts2.createSubtract = ts2.Debug.deprecate(function createSubtract(left, right) { + return ts2.factory.createSubtract(left, right); + }, factoryDeprecation); + ts2.createLogicalAnd = ts2.Debug.deprecate(function createLogicalAnd(left, right) { + return ts2.factory.createLogicalAnd(left, right); + }, factoryDeprecation); + ts2.createLogicalOr = ts2.Debug.deprecate(function createLogicalOr(left, right) { + return ts2.factory.createLogicalOr(left, right); + }, factoryDeprecation); + ts2.createPostfixIncrement = ts2.Debug.deprecate(function createPostfixIncrement(operand) { + return ts2.factory.createPostfixIncrement(operand); + }, factoryDeprecation); + ts2.createLogicalNot = ts2.Debug.deprecate(function createLogicalNot(operand) { + return ts2.factory.createLogicalNot(operand); + }, factoryDeprecation); + ts2.createNode = ts2.Debug.deprecate(function createNode2(kind, pos, end) { + if (pos === void 0) { + pos = 0; + } + if (end === void 0) { + end = 0; + } + return ts2.setTextRangePosEnd(kind === 308 ? ts2.parseBaseNodeFactory.createBaseSourceFileNode(kind) : kind === 79 ? ts2.parseBaseNodeFactory.createBaseIdentifierNode(kind) : kind === 80 ? ts2.parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : !ts2.isNodeKind(kind) ? ts2.parseBaseNodeFactory.createBaseTokenNode(kind) : ts2.parseBaseNodeFactory.createBaseNode(kind), pos, end); + }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory` method instead." }); + ts2.getMutableClone = ts2.Debug.deprecate(function getMutableClone(node) { + var clone2 = ts2.factory.cloneNode(node); + ts2.setTextRange(clone2, node); + ts2.setParent(clone2, node.parent); + return clone2; + }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`." }); + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.isTypeAssertion = ts2.Debug.deprecate(function isTypeAssertion(node) { + return node.kind === 213; + }, { + since: "4.0", + warnAfter: "4.1", + message: "Use `isTypeAssertionExpression` instead." + }); + })(ts || (ts = {})); + var ts; + (function(ts2) { + ts2.isIdentifierOrPrivateIdentifier = ts2.Debug.deprecate(function isIdentifierOrPrivateIdentifier(node) { + return ts2.isMemberName(node); + }, { + since: "4.2", + warnAfter: "4.3", + message: "Use `isMemberName` instead." + }); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function patchNodeFactory(factory) { + var createConstructorTypeNode = factory.createConstructorTypeNode, updateConstructorTypeNode = factory.updateConstructorTypeNode; + factory.createConstructorTypeNode = ts2.buildOverload("createConstructorTypeNode").overload({ + 0: function(modifiers, typeParameters, parameters, type3) { + return createConstructorTypeNode(modifiers, typeParameters, parameters, type3); + }, + 1: function(typeParameters, parameters, type3) { + return createConstructorTypeNode( + /*modifiers*/ + void 0, + typeParameters, + parameters, + type3 + ); + } + }).bind({ + 0: function(args) { + return args.length === 4; + }, + 1: function(args) { + return args.length === 3; + } + }).deprecate({ + 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } + }).finish(); + factory.updateConstructorTypeNode = ts2.buildOverload("updateConstructorTypeNode").overload({ + 0: function(node, modifiers, typeParameters, parameters, type3) { + return updateConstructorTypeNode(node, modifiers, typeParameters, parameters, type3); + }, + 1: function(node, typeParameters, parameters, type3) { + return updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type3); + } + }).bind({ + 0: function(args) { + return args.length === 5; + }, + 1: function(args) { + return args.length === 4; + } + }).deprecate({ + 1: { since: "4.2", warnAfter: "4.3", message: "Use the overload that accepts 'modifiers'" } + }).finish(); + } + var prevCreateNodeFactory = ts2.createNodeFactory; + ts2.createNodeFactory = function(flags, baseFactory) { + var factory = prevCreateNodeFactory(flags, baseFactory); + patchNodeFactory(factory); + return factory; + }; + patchNodeFactory(ts2.factory); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function patchNodeFactory(factory) { + var createImportTypeNode = factory.createImportTypeNode, updateImportTypeNode = factory.updateImportTypeNode; + factory.createImportTypeNode = ts2.buildOverload("createImportTypeNode").overload({ + 0: function(argument, assertions, qualifier, typeArguments, isTypeOf) { + return createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf); + }, + 1: function(argument, qualifier, typeArguments, isTypeOf) { + return createImportTypeNode( + argument, + /*assertions*/ + void 0, + qualifier, + typeArguments, + isTypeOf + ); + } + }).bind({ + 0: function(_a2) { + var assertions = _a2[1], qualifier = _a2[2], typeArguments = _a2[3], isTypeOf = _a2[4]; + return (assertions === void 0 || ts2.isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !ts2.isArray(qualifier)) && (typeArguments === void 0 || ts2.isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"); + }, + 1: function(_a2) { + var qualifier = _a2[1], typeArguments = _a2[2], isTypeOf = _a2[3], other = _a2[4]; + return other === void 0 && (qualifier === void 0 || ts2.isEntityName(qualifier)) && (typeArguments === void 0 || ts2.isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"); + } + }).deprecate({ + 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } + }).finish(); + factory.updateImportTypeNode = ts2.buildOverload("updateImportTypeNode").overload({ + 0: function(node, argument, assertions, qualifier, typeArguments, isTypeOf) { + return updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf); + }, + 1: function(node, argument, qualifier, typeArguments, isTypeOf) { + return updateImportTypeNode(node, argument, node.assertions, qualifier, typeArguments, isTypeOf); + } + }).bind({ + 0: function(_a2) { + var assertions = _a2[2], qualifier = _a2[3], typeArguments = _a2[4], isTypeOf = _a2[5]; + return (assertions === void 0 || ts2.isImportTypeAssertionContainer(assertions)) && (qualifier === void 0 || !ts2.isArray(qualifier)) && (typeArguments === void 0 || ts2.isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"); + }, + 1: function(_a2) { + var qualifier = _a2[2], typeArguments = _a2[3], isTypeOf = _a2[4], other = _a2[5]; + return other === void 0 && (qualifier === void 0 || ts2.isEntityName(qualifier)) && (typeArguments === void 0 || ts2.isArray(typeArguments)) && (isTypeOf === void 0 || typeof isTypeOf === "boolean"); + } + }).deprecate({ + 1: { since: "4.6", warnAfter: "4.7", message: "Use the overload that accepts 'assertions'" } + }).finish(); + } + var prevCreateNodeFactory = ts2.createNodeFactory; + ts2.createNodeFactory = function(flags, baseFactory) { + var factory = prevCreateNodeFactory(flags, baseFactory); + patchNodeFactory(factory); + return factory; + }; + patchNodeFactory(ts2.factory); + })(ts || (ts = {})); + var ts; + (function(ts2) { + function patchNodeFactory(factory) { + var createTypeParameterDeclaration = factory.createTypeParameterDeclaration, updateTypeParameterDeclaration = factory.updateTypeParameterDeclaration; + factory.createTypeParameterDeclaration = ts2.buildOverload("createTypeParameterDeclaration").overload({ + 0: function(modifiers, name2, constraint, defaultType) { + return createTypeParameterDeclaration(modifiers, name2, constraint, defaultType); + }, + 1: function(name2, constraint, defaultType) { + return createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + constraint, + defaultType + ); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0]; + return modifiers === void 0 || ts2.isArray(modifiers); + }, + 1: function(_a2) { + var name2 = _a2[0]; + return name2 !== void 0 && !ts2.isArray(name2); + } + }).deprecate({ + 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } + }).finish(); + factory.updateTypeParameterDeclaration = ts2.buildOverload("updateTypeParameterDeclaration").overload({ + 0: function(node, modifiers, name2, constraint, defaultType) { + return updateTypeParameterDeclaration(node, modifiers, name2, constraint, defaultType); + }, + 1: function(node, name2, constraint, defaultType) { + return updateTypeParameterDeclaration(node, node.modifiers, name2, constraint, defaultType); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1]; + return modifiers === void 0 || ts2.isArray(modifiers); + }, + 1: function(_a2) { + var name2 = _a2[1]; + return name2 !== void 0 && !ts2.isArray(name2); + } + }).deprecate({ + 1: { since: "4.7", warnAfter: "4.8", message: "Use the overload that accepts 'modifiers'" } + }).finish(); + } + var prevCreateNodeFactory = ts2.createNodeFactory; + ts2.createNodeFactory = function(flags, baseFactory) { + var factory = prevCreateNodeFactory(flags, baseFactory); + patchNodeFactory(factory); + return factory; + }; + patchNodeFactory(ts2.factory); + })(ts || (ts = {})); + var ts; + (function(ts2) { + var MUST_MERGE = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter." }; + var DISALLOW_DECORATORS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter." }; + var DISALLOW_DECORATORS_AND_MODIFIERS = { since: "4.8", warnAfter: "4.9.0-0", message: "Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters." }; + function patchNodeFactory(factory) { + var createParameterDeclaration = factory.createParameterDeclaration, updateParameterDeclaration = factory.updateParameterDeclaration, createPropertyDeclaration = factory.createPropertyDeclaration, updatePropertyDeclaration = factory.updatePropertyDeclaration, createMethodDeclaration = factory.createMethodDeclaration, updateMethodDeclaration = factory.updateMethodDeclaration, createConstructorDeclaration = factory.createConstructorDeclaration, updateConstructorDeclaration = factory.updateConstructorDeclaration, createGetAccessorDeclaration = factory.createGetAccessorDeclaration, updateGetAccessorDeclaration = factory.updateGetAccessorDeclaration, createSetAccessorDeclaration = factory.createSetAccessorDeclaration, updateSetAccessorDeclaration = factory.updateSetAccessorDeclaration, createIndexSignature = factory.createIndexSignature, updateIndexSignature = factory.updateIndexSignature, createClassStaticBlockDeclaration = factory.createClassStaticBlockDeclaration, updateClassStaticBlockDeclaration = factory.updateClassStaticBlockDeclaration, createClassExpression = factory.createClassExpression, updateClassExpression = factory.updateClassExpression, createFunctionDeclaration = factory.createFunctionDeclaration, updateFunctionDeclaration = factory.updateFunctionDeclaration, createClassDeclaration = factory.createClassDeclaration, updateClassDeclaration = factory.updateClassDeclaration, createInterfaceDeclaration = factory.createInterfaceDeclaration, updateInterfaceDeclaration = factory.updateInterfaceDeclaration, createTypeAliasDeclaration = factory.createTypeAliasDeclaration, updateTypeAliasDeclaration = factory.updateTypeAliasDeclaration, createEnumDeclaration = factory.createEnumDeclaration, updateEnumDeclaration = factory.updateEnumDeclaration, createModuleDeclaration = factory.createModuleDeclaration, updateModuleDeclaration = factory.updateModuleDeclaration, createImportEqualsDeclaration = factory.createImportEqualsDeclaration, updateImportEqualsDeclaration = factory.updateImportEqualsDeclaration, createImportDeclaration = factory.createImportDeclaration, updateImportDeclaration = factory.updateImportDeclaration, createExportAssignment = factory.createExportAssignment, updateExportAssignment = factory.updateExportAssignment, createExportDeclaration = factory.createExportDeclaration, updateExportDeclaration = factory.updateExportDeclaration; + factory.createParameterDeclaration = ts2.buildOverload("createParameterDeclaration").overload({ + 0: function(modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return createParameterDeclaration(modifiers, dotDotDotToken, name2, questionToken, type3, initializer); + }, + 1: function(decorators, modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return createParameterDeclaration(ts2.concatenate(decorators, modifiers), dotDotDotToken, name2, questionToken, type3, initializer); + } + }).bind({ + 0: function(_a2) { + var dotDotDotToken = _a2[1], name2 = _a2[2], questionToken = _a2[3], type3 = _a2[4], initializer = _a2[5], other = _a2[6]; + return other === void 0 && (dotDotDotToken === void 0 || !ts2.isArray(dotDotDotToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isBindingName(name2)) && (questionToken === void 0 || typeof questionToken === "object" && ts2.isQuestionToken(questionToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + }, + 1: function(_a2) { + var modifiers = _a2[1], dotDotDotToken = _a2[2], name2 = _a2[3], questionToken = _a2[4], type3 = _a2[5], initializer = _a2[6]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && ts2.isDotDotDotToken(dotDotDotToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isBindingName(name2)) && (questionToken === void 0 || ts2.isQuestionToken(questionToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updateParameterDeclaration = ts2.buildOverload("updateParameterDeclaration").overload({ + 0: function(node, modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return updateParameterDeclaration(node, modifiers, dotDotDotToken, name2, questionToken, type3, initializer); + }, + 1: function(node, decorators, modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return updateParameterDeclaration(node, ts2.concatenate(decorators, modifiers), dotDotDotToken, name2, questionToken, type3, initializer); + } + }).bind({ + 0: function(_a2) { + var dotDotDotToken = _a2[2], name2 = _a2[3], questionToken = _a2[4], type3 = _a2[5], initializer = _a2[6], other = _a2[7]; + return other === void 0 && (dotDotDotToken === void 0 || !ts2.isArray(dotDotDotToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isBindingName(name2)) && (questionToken === void 0 || typeof questionToken === "object" && ts2.isQuestionToken(questionToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + }, + 1: function(_a2) { + var modifiers = _a2[2], dotDotDotToken = _a2[3], name2 = _a2[4], questionToken = _a2[5], type3 = _a2[6], initializer = _a2[7]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (dotDotDotToken === void 0 || typeof dotDotDotToken === "object" && ts2.isDotDotDotToken(dotDotDotToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isBindingName(name2)) && (questionToken === void 0 || ts2.isQuestionToken(questionToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createPropertyDeclaration = ts2.buildOverload("createPropertyDeclaration").overload({ + 0: function(modifiers, name2, questionOrExclamationToken, type3, initializer) { + return createPropertyDeclaration(modifiers, name2, questionOrExclamationToken, type3, initializer); + }, + 1: function(decorators, modifiers, name2, questionOrExclamationToken, type3, initializer) { + return createPropertyDeclaration(ts2.concatenate(decorators, modifiers), name2, questionOrExclamationToken, type3, initializer); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[1], questionOrExclamationToken = _a2[2], type3 = _a2[3], initializer = _a2[4], other = _a2[5]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && ts2.isQuestionOrExclamationToken(questionOrExclamationToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + }, + 1: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], questionOrExclamationToken = _a2[3], type3 = _a2[4], initializer = _a2[5]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionOrExclamationToken === void 0 || ts2.isQuestionOrExclamationToken(questionOrExclamationToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updatePropertyDeclaration = ts2.buildOverload("updatePropertyDeclaration").overload({ + 0: function(node, modifiers, name2, questionOrExclamationToken, type3, initializer) { + return updatePropertyDeclaration(node, modifiers, name2, questionOrExclamationToken, type3, initializer); + }, + 1: function(node, decorators, modifiers, name2, questionOrExclamationToken, type3, initializer) { + return updatePropertyDeclaration(node, ts2.concatenate(decorators, modifiers), name2, questionOrExclamationToken, type3, initializer); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[2], questionOrExclamationToken = _a2[3], type3 = _a2[4], initializer = _a2[5], other = _a2[6]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (questionOrExclamationToken === void 0 || typeof questionOrExclamationToken === "object" && ts2.isQuestionOrExclamationToken(questionOrExclamationToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + }, + 1: function(_a2) { + var modifiers = _a2[2], name2 = _a2[3], questionOrExclamationToken = _a2[4], type3 = _a2[5], initializer = _a2[6]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionOrExclamationToken === void 0 || ts2.isQuestionOrExclamationToken(questionOrExclamationToken)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (initializer === void 0 || ts2.isExpression(initializer)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createMethodDeclaration = ts2.buildOverload("createMethodDeclaration").overload({ + 0: function(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return createMethodDeclaration(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body); + }, + 1: function(decorators, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return createMethodDeclaration(ts2.concatenate(decorators, modifiers), asteriskToken, name2, questionToken, typeParameters, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var asteriskToken = _a2[1], name2 = _a2[2], questionToken = _a2[3], typeParameters = _a2[4], parameters = _a2[5], type3 = _a2[6], body = _a2[7], other = _a2[8]; + return other === void 0 && (asteriskToken === void 0 || !ts2.isArray(asteriskToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionToken === void 0 || typeof questionToken === "object" && ts2.isQuestionToken(questionToken)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (parameters === void 0 || !ts2.some(parameters, ts2.isTypeParameterDeclaration)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[1], asteriskToken = _a2[2], name2 = _a2[3], questionToken = _a2[4], typeParameters = _a2[5], parameters = _a2[6], type3 = _a2[7], body = _a2[8]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && ts2.isAsteriskToken(asteriskToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionToken === void 0 || !ts2.isArray(questionToken)) && (typeParameters === void 0 || !ts2.some(typeParameters, ts2.isParameter)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updateMethodDeclaration = ts2.buildOverload("updateMethodDeclaration").overload({ + 0: function(node, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return updateMethodDeclaration(node, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body); + }, + 1: function(node, decorators, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return updateMethodDeclaration(node, ts2.concatenate(decorators, modifiers), asteriskToken, name2, questionToken, typeParameters, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var asteriskToken = _a2[2], name2 = _a2[3], questionToken = _a2[4], typeParameters = _a2[5], parameters = _a2[6], type3 = _a2[7], body = _a2[8], other = _a2[9]; + return other === void 0 && (asteriskToken === void 0 || !ts2.isArray(asteriskToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionToken === void 0 || typeof questionToken === "object" && ts2.isQuestionToken(questionToken)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (parameters === void 0 || !ts2.some(parameters, ts2.isTypeParameterDeclaration)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[2], asteriskToken = _a2[3], name2 = _a2[4], questionToken = _a2[5], typeParameters = _a2[6], parameters = _a2[7], type3 = _a2[8], body = _a2[9]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken === "object" && ts2.isAsteriskToken(asteriskToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isPropertyName(name2)) && (questionToken === void 0 || !ts2.isArray(questionToken)) && (typeParameters === void 0 || !ts2.some(typeParameters, ts2.isParameter)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createConstructorDeclaration = ts2.buildOverload("createConstructorDeclaration").overload({ + 0: function(modifiers, parameters, body) { + return createConstructorDeclaration(modifiers, parameters, body); + }, + 1: function(_decorators, modifiers, parameters, body) { + return createConstructorDeclaration(modifiers, parameters, body); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], parameters = _a2[1], body = _a2[2], other = _a2[3]; + return other === void 0 && (modifiers === void 0 || !ts2.some(modifiers, ts2.isDecorator)) && (parameters === void 0 || !ts2.some(parameters, ts2.isModifier)) && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], parameters = _a2[2], body = _a2[3]; + return (decorators === void 0 || !ts2.some(decorators, ts2.isModifier)) && (modifiers === void 0 || !ts2.some(modifiers, ts2.isParameter)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateConstructorDeclaration = ts2.buildOverload("updateConstructorDeclaration").overload({ + 0: function(node, modifiers, parameters, body) { + return updateConstructorDeclaration(node, modifiers, parameters, body); + }, + 1: function(node, _decorators, modifiers, parameters, body) { + return updateConstructorDeclaration(node, modifiers, parameters, body); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], parameters = _a2[2], body = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || !ts2.some(modifiers, ts2.isDecorator)) && (parameters === void 0 || !ts2.some(parameters, ts2.isModifier)) && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], parameters = _a2[3], body = _a2[4]; + return (decorators === void 0 || !ts2.some(decorators, ts2.isModifier)) && (modifiers === void 0 || !ts2.some(modifiers, ts2.isParameter)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createGetAccessorDeclaration = ts2.buildOverload("createGetAccessorDeclaration").overload({ + 0: function(modifiers, name2, parameters, type3, body) { + return createGetAccessorDeclaration(modifiers, name2, parameters, type3, body); + }, + 1: function(decorators, modifiers, name2, parameters, type3, body) { + return createGetAccessorDeclaration(ts2.concatenate(decorators, modifiers), name2, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[1], parameters = _a2[2], type3 = _a2[3], body = _a2[4], other = _a2[5]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], parameters = _a2[3], type3 = _a2[4], body = _a2[5]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updateGetAccessorDeclaration = ts2.buildOverload("updateGetAccessorDeclaration").overload({ + 0: function(node, modifiers, name2, parameters, type3, body) { + return updateGetAccessorDeclaration(node, modifiers, name2, parameters, type3, body); + }, + 1: function(node, decorators, modifiers, name2, parameters, type3, body) { + return updateGetAccessorDeclaration(node, ts2.concatenate(decorators, modifiers), name2, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[2], parameters = _a2[3], type3 = _a2[4], body = _a2[5], other = _a2[6]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[2], name2 = _a2[3], parameters = _a2[4], type3 = _a2[5], body = _a2[6]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createSetAccessorDeclaration = ts2.buildOverload("createSetAccessorDeclaration").overload({ + 0: function(modifiers, name2, parameters, body) { + return createSetAccessorDeclaration(modifiers, name2, parameters, body); + }, + 1: function(decorators, modifiers, name2, parameters, body) { + return createSetAccessorDeclaration(ts2.concatenate(decorators, modifiers), name2, parameters, body); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[1], parameters = _a2[2], body = _a2[3], other = _a2[4]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], parameters = _a2[3], body = _a2[4]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updateSetAccessorDeclaration = ts2.buildOverload("updateSetAccessorDeclaration").overload({ + 0: function(node, modifiers, name2, parameters, body) { + return updateSetAccessorDeclaration(node, modifiers, name2, parameters, body); + }, + 1: function(node, decorators, modifiers, name2, parameters, body) { + return updateSetAccessorDeclaration(node, ts2.concatenate(decorators, modifiers), name2, parameters, body); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[2], parameters = _a2[3], body = _a2[4], other = _a2[5]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var modifiers = _a2[2], name2 = _a2[3], parameters = _a2[4], body = _a2[5]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (parameters === void 0 || ts2.isArray(parameters)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createIndexSignature = ts2.buildOverload("createIndexSignature").overload({ + 0: function(modifiers, parameters, type3) { + return createIndexSignature(modifiers, parameters, type3); + }, + 1: function(_decorators, modifiers, parameters, type3) { + return createIndexSignature(modifiers, parameters, type3); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], parameters = _a2[1], type3 = _a2[2], other = _a2[3]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (parameters === void 0 || ts2.every(parameters, ts2.isParameter)) && (type3 === void 0 || !ts2.isArray(type3)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], parameters = _a2[2], type3 = _a2[3]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateIndexSignature = ts2.buildOverload("updateIndexSignature").overload({ + 0: function(node, modifiers, parameters, type3) { + return updateIndexSignature(node, modifiers, parameters, type3); + }, + 1: function(node, _decorators, modifiers, parameters, type3) { + return updateIndexSignature(node, modifiers, parameters, type3); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], parameters = _a2[2], type3 = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (parameters === void 0 || ts2.every(parameters, ts2.isParameter)) && (type3 === void 0 || !ts2.isArray(type3)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], parameters = _a2[3], type3 = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createClassStaticBlockDeclaration = ts2.buildOverload("createClassStaticBlockDeclaration").overload({ + 0: function(body) { + return createClassStaticBlockDeclaration(body); + }, + 1: function(_decorators, _modifiers, body) { + return createClassStaticBlockDeclaration(body); + } + }).bind({ + 0: function(_a2) { + var body = _a2[0], other1 = _a2[1], other2 = _a2[2]; + return other1 === void 0 && other2 === void 0 && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], body = _a2[2]; + return (decorators === void 0 || ts2.isArray(decorators)) && (modifiers === void 0 || ts2.isArray(decorators)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS_AND_MODIFIERS + }).finish(); + factory.updateClassStaticBlockDeclaration = ts2.buildOverload("updateClassStaticBlockDeclaration").overload({ + 0: function(node, body) { + return updateClassStaticBlockDeclaration(node, body); + }, + 1: function(node, _decorators, _modifiers, body) { + return updateClassStaticBlockDeclaration(node, body); + } + }).bind({ + 0: function(_a2) { + var body = _a2[1], other1 = _a2[2], other2 = _a2[3]; + return other1 === void 0 && other2 === void 0 && (body === void 0 || !ts2.isArray(body)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], body = _a2[3]; + return (decorators === void 0 || ts2.isArray(decorators)) && (modifiers === void 0 || ts2.isArray(decorators)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS_AND_MODIFIERS + }).finish(); + factory.createClassExpression = ts2.buildOverload("createClassExpression").overload({ + 0: function(modifiers, name2, typeParameters, heritageClauses, members) { + return createClassExpression(modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return createClassExpression(ts2.concatenate(decorators, modifiers), name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[1], typeParameters = _a2[2], heritageClauses = _a2[3], members = _a2[4], other = _a2[5]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isClassElement)); + }, + 1: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], typeParameters = _a2[3], heritageClauses = _a2[4], members = _a2[5]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.isArray(members)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateClassExpression = ts2.buildOverload("updateClassExpression").overload({ + 0: function(node, modifiers, name2, typeParameters, heritageClauses, members) { + return updateClassExpression(node, modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(node, decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return updateClassExpression(node, ts2.concatenate(decorators, modifiers), name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[2], typeParameters = _a2[3], heritageClauses = _a2[4], members = _a2[5], other = _a2[6]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isClassElement)); + }, + 1: function(_a2) { + var modifiers = _a2[2], name2 = _a2[3], typeParameters = _a2[4], heritageClauses = _a2[5], members = _a2[6]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.isArray(members)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createFunctionDeclaration = ts2.buildOverload("createFunctionDeclaration").overload({ + 0: function(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + }, + 1: function(_decorators, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var asteriskToken = _a2[1], name2 = _a2[2], typeParameters = _a2[3], parameters = _a2[4], type3 = _a2[5], body = _a2[6], other = _a2[7]; + return other === void 0 && (asteriskToken === void 0 || !ts2.isArray(asteriskToken)) && (name2 === void 0 || typeof name2 === "string" || ts2.isIdentifier(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (parameters === void 0 || ts2.every(parameters, ts2.isParameter)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[1], asteriskToken = _a2[2], name2 = _a2[3], typeParameters = _a2[4], parameters = _a2[5], type3 = _a2[6], body = _a2[7]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && ts2.isAsteriskToken(asteriskToken)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateFunctionDeclaration = ts2.buildOverload("updateFunctionDeclaration").overload({ + 0: function(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return updateFunctionDeclaration(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + }, + 1: function(node, _decorators, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return updateFunctionDeclaration(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + } + }).bind({ + 0: function(_a2) { + var asteriskToken = _a2[2], name2 = _a2[3], typeParameters = _a2[4], parameters = _a2[5], type3 = _a2[6], body = _a2[7], other = _a2[8]; + return other === void 0 && (asteriskToken === void 0 || !ts2.isArray(asteriskToken)) && (name2 === void 0 || ts2.isIdentifier(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (parameters === void 0 || ts2.every(parameters, ts2.isParameter)) && (type3 === void 0 || !ts2.isArray(type3)) && (body === void 0 || ts2.isBlock(body)); + }, + 1: function(_a2) { + var modifiers = _a2[2], asteriskToken = _a2[3], name2 = _a2[4], typeParameters = _a2[5], parameters = _a2[6], type3 = _a2[7], body = _a2[8]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (asteriskToken === void 0 || typeof asteriskToken !== "string" && ts2.isAsteriskToken(asteriskToken)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (parameters === void 0 || ts2.isArray(parameters)) && (type3 === void 0 || ts2.isTypeNode(type3)) && (body === void 0 || ts2.isBlock(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createClassDeclaration = ts2.buildOverload("createClassDeclaration").overload({ + 0: function(modifiers, name2, typeParameters, heritageClauses, members) { + return createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return createClassDeclaration(ts2.concatenate(decorators, modifiers), name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[1], typeParameters = _a2[2], heritageClauses = _a2[3], members = _a2[4], other = _a2[5]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isClassElement)); + }, + 1: function() { + return true; + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.updateClassDeclaration = ts2.buildOverload("updateClassDeclaration").overload({ + 0: function(node, modifiers, name2, typeParameters, heritageClauses, members) { + return updateClassDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(node, decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return updateClassDeclaration(node, ts2.concatenate(decorators, modifiers), name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var name2 = _a2[2], typeParameters = _a2[3], heritageClauses = _a2[4], members = _a2[5], other = _a2[6]; + return other === void 0 && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isClassElement)); + }, + 1: function(_a2) { + var modifiers = _a2[2], name2 = _a2[3], typeParameters = _a2[4], heritageClauses = _a2[5], members = _a2[6]; + return (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.isArray(members)); + } + }).deprecate({ + 1: MUST_MERGE + }).finish(); + factory.createInterfaceDeclaration = ts2.buildOverload("createInterfaceDeclaration").overload({ + 0: function(modifiers, name2, typeParameters, heritageClauses, members) { + return createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(_decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], name2 = _a2[1], typeParameters = _a2[2], heritageClauses = _a2[3], members = _a2[4], other = _a2[5]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isTypeElement)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], name2 = _a2[2], typeParameters = _a2[3], heritageClauses = _a2[4], members = _a2[5]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isTypeElement)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateInterfaceDeclaration = ts2.buildOverload("updateInterfaceDeclaration").overload({ + 0: function(node, modifiers, name2, typeParameters, heritageClauses, members) { + return updateInterfaceDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members); + }, + 1: function(node, _decorators, modifiers, name2, typeParameters, heritageClauses, members) { + return updateInterfaceDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], typeParameters = _a2[3], heritageClauses = _a2[4], members = _a2[5], other = _a2[6]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isTypeElement)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], name2 = _a2[3], typeParameters = _a2[4], heritageClauses = _a2[5], members = _a2[6]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.every(typeParameters, ts2.isTypeParameterDeclaration)) && (heritageClauses === void 0 || ts2.every(heritageClauses, ts2.isHeritageClause)) && (members === void 0 || ts2.every(members, ts2.isTypeElement)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createTypeAliasDeclaration = ts2.buildOverload("createTypeAliasDeclaration").overload({ + 0: function(modifiers, name2, typeParameters, type3) { + return createTypeAliasDeclaration(modifiers, name2, typeParameters, type3); + }, + 1: function(_decorators, modifiers, name2, typeParameters, type3) { + return createTypeAliasDeclaration(modifiers, name2, typeParameters, type3); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], name2 = _a2[1], typeParameters = _a2[2], type3 = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (type3 === void 0 || !ts2.isArray(type3)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], name2 = _a2[2], typeParameters = _a2[3], type3 = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (type3 === void 0 || ts2.isTypeNode(type3)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateTypeAliasDeclaration = ts2.buildOverload("updateTypeAliasDeclaration").overload({ + 0: function(node, modifiers, name2, typeParameters, type3) { + return updateTypeAliasDeclaration(node, modifiers, name2, typeParameters, type3); + }, + 1: function(node, _decorators, modifiers, name2, typeParameters, type3) { + return updateTypeAliasDeclaration(node, modifiers, name2, typeParameters, type3); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], typeParameters = _a2[3], type3 = _a2[4], other = _a2[5]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (type3 === void 0 || !ts2.isArray(type3)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], name2 = _a2[3], typeParameters = _a2[4], type3 = _a2[5]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (typeParameters === void 0 || ts2.isArray(typeParameters)) && (type3 === void 0 || ts2.isTypeNode(type3)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createEnumDeclaration = ts2.buildOverload("createEnumDeclaration").overload({ + 0: function(modifiers, name2, members) { + return createEnumDeclaration(modifiers, name2, members); + }, + 1: function(_decorators, modifiers, name2, members) { + return createEnumDeclaration(modifiers, name2, members); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], name2 = _a2[1], members = _a2[2], other = _a2[3]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (members === void 0 || ts2.isArray(members)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], name2 = _a2[2], members = _a2[3]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (members === void 0 || ts2.isArray(members)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateEnumDeclaration = ts2.buildOverload("updateEnumDeclaration").overload({ + 0: function(node, modifiers, name2, members) { + return updateEnumDeclaration(node, modifiers, name2, members); + }, + 1: function(node, _decorators, modifiers, name2, members) { + return updateEnumDeclaration(node, modifiers, name2, members); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], members = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (members === void 0 || ts2.isArray(members)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], name2 = _a2[3], members = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 === void 0 || !ts2.isArray(name2)) && (members === void 0 || ts2.isArray(members)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createModuleDeclaration = ts2.buildOverload("createModuleDeclaration").overload({ + 0: function(modifiers, name2, body, flags) { + return createModuleDeclaration(modifiers, name2, body, flags); + }, + 1: function(_decorators, modifiers, name2, body, flags) { + return createModuleDeclaration(modifiers, name2, body, flags); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], name2 = _a2[1], body = _a2[2], flags = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 !== void 0 && !ts2.isArray(name2)) && (body === void 0 || ts2.isModuleBody(body)) && (flags === void 0 || typeof flags === "number"); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], name2 = _a2[2], body = _a2[3], flags = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 !== void 0 && ts2.isModuleName(name2)) && (body === void 0 || typeof body === "object") && (flags === void 0 || typeof flags === "number"); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateModuleDeclaration = ts2.buildOverload("updateModuleDeclaration").overload({ + 0: function(node, modifiers, name2, body) { + return updateModuleDeclaration(node, modifiers, name2, body); + }, + 1: function(node, _decorators, modifiers, name2, body) { + return updateModuleDeclaration(node, modifiers, name2, body); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], name2 = _a2[2], body = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (name2 === void 0 || !ts2.isArray(name2)) && (body === void 0 || ts2.isModuleBody(body)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], name2 = _a2[3], body = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (name2 !== void 0 && ts2.isModuleName(name2)) && (body === void 0 || ts2.isModuleBody(body)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createImportEqualsDeclaration = ts2.buildOverload("createImportEqualsDeclaration").overload({ + 0: function(modifiers, isTypeOnly, name2, moduleReference) { + return createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference); + }, + 1: function(_decorators, modifiers, isTypeOnly, name2, moduleReference) { + return createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], isTypeOnly = _a2[1], name2 = _a2[2], moduleReference = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name2 !== "boolean" && typeof moduleReference !== "string"; + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], isTypeOnly = _a2[2], name2 = _a2[3], moduleReference = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name2 === "string" || ts2.isIdentifier(name2)) && (moduleReference !== void 0 && ts2.isModuleReference(moduleReference)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateImportEqualsDeclaration = ts2.buildOverload("updateImportEqualsDeclaration").overload({ + 0: function(node, modifiers, isTypeOnly, name2, moduleReference) { + return updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name2, moduleReference); + }, + 1: function(node, _decorators, modifiers, isTypeOnly, name2, moduleReference) { + return updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name2, moduleReference); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], isTypeOnly = _a2[2], name2 = _a2[3], moduleReference = _a2[4], other = _a2[5]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && typeof name2 !== "boolean" && typeof moduleReference !== "string"; + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], isTypeOnly = _a2[3], name2 = _a2[4], moduleReference = _a2[5]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (isTypeOnly === void 0 || typeof isTypeOnly === "boolean") && (typeof name2 === "string" || ts2.isIdentifier(name2)) && (moduleReference !== void 0 && ts2.isModuleReference(moduleReference)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createImportDeclaration = ts2.buildOverload("createImportDeclaration").overload({ + 0: function(modifiers, importClause, moduleSpecifier, assertClause) { + return createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); + }, + 1: function(_decorators, modifiers, importClause, moduleSpecifier, assertClause) { + return createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], importClause = _a2[1], moduleSpecifier = _a2[2], assertClause = _a2[3], other = _a2[4]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (importClause === void 0 || !ts2.isArray(importClause)) && (moduleSpecifier !== void 0 && ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], importClause = _a2[2], moduleSpecifier = _a2[3], assertClause = _a2[4]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (importClause === void 0 || ts2.isImportClause(importClause)) && (moduleSpecifier !== void 0 && ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateImportDeclaration = ts2.buildOverload("updateImportDeclaration").overload({ + 0: function(node, modifiers, importClause, moduleSpecifier, assertClause) { + return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); + }, + 1: function(node, _decorators, modifiers, importClause, moduleSpecifier, assertClause) { + return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], importClause = _a2[2], moduleSpecifier = _a2[3], assertClause = _a2[4], other = _a2[5]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (importClause === void 0 || !ts2.isArray(importClause)) && (moduleSpecifier === void 0 || ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], importClause = _a2[3], moduleSpecifier = _a2[4], assertClause = _a2[5]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (importClause === void 0 || ts2.isImportClause(importClause)) && (moduleSpecifier !== void 0 && ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createExportAssignment = ts2.buildOverload("createExportAssignment").overload({ + 0: function(modifiers, isExportEquals, expression) { + return createExportAssignment(modifiers, isExportEquals, expression); + }, + 1: function(_decorators, modifiers, isExportEquals, expression) { + return createExportAssignment(modifiers, isExportEquals, expression); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], isExportEquals = _a2[1], expression = _a2[2], other = _a2[3]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && typeof expression === "object"; + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], isExportEquals = _a2[2], expression = _a2[3]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (isExportEquals === void 0 || typeof isExportEquals === "boolean") && (expression !== void 0 && ts2.isExpression(expression)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateExportAssignment = ts2.buildOverload("updateExportAssignment").overload({ + 0: function(node, modifiers, expression) { + return updateExportAssignment(node, modifiers, expression); + }, + 1: function(node, _decorators, modifiers, expression) { + return updateExportAssignment(node, modifiers, expression); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], expression = _a2[2], other = _a2[3]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && (expression !== void 0 && !ts2.isArray(expression)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], expression = _a2[3]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && (expression !== void 0 && ts2.isExpression(expression)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.createExportDeclaration = ts2.buildOverload("createExportDeclaration").overload({ + 0: function(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + }, + 1: function(_decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[0], isTypeOnly = _a2[1], exportClause = _a2[2], moduleSpecifier = _a2[3], assertClause = _a2[4], other = _a2[5]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + }, + 1: function(_a2) { + var decorators = _a2[0], modifiers = _a2[1], isTypeOnly = _a2[2], exportClause = _a2[3], moduleSpecifier = _a2[4], assertClause = _a2[5]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || ts2.isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + factory.updateExportDeclaration = ts2.buildOverload("updateExportDeclaration").overload({ + 0: function(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + }, + 1: function(node, _decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { + return updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + } + }).bind({ + 0: function(_a2) { + var modifiers = _a2[1], isTypeOnly = _a2[2], exportClause = _a2[3], moduleSpecifier = _a2[4], assertClause = _a2[5], other = _a2[6]; + return other === void 0 && (modifiers === void 0 || ts2.every(modifiers, ts2.isModifier)) && typeof isTypeOnly === "boolean" && typeof exportClause !== "boolean" && (moduleSpecifier === void 0 || ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + }, + 1: function(_a2) { + var decorators = _a2[1], modifiers = _a2[2], isTypeOnly = _a2[3], exportClause = _a2[4], moduleSpecifier = _a2[5], assertClause = _a2[6]; + return (decorators === void 0 || ts2.every(decorators, ts2.isDecorator)) && (modifiers === void 0 || ts2.isArray(modifiers)) && typeof isTypeOnly === "boolean" && (exportClause === void 0 || ts2.isNamedExportBindings(exportClause)) && (moduleSpecifier === void 0 || ts2.isExpression(moduleSpecifier)) && (assertClause === void 0 || ts2.isAssertClause(assertClause)); + } + }).deprecate({ + 1: DISALLOW_DECORATORS + }).finish(); + } + var prevCreateNodeFactory = ts2.createNodeFactory; + ts2.createNodeFactory = function(flags, baseFactory) { + var factory = prevCreateNodeFactory(flags, baseFactory); + patchNodeFactory(factory); + return factory; + }; + patchNodeFactory(ts2.factory); + })(ts || (ts = {})); + var ts; + (function(ts2) { + if (typeof console !== "undefined") { + ts2.Debug.loggingHost = { + log: function(level, s7) { + switch (level) { + case ts2.LogLevel.Error: + return console.error(s7); + case ts2.LogLevel.Warning: + return console.warn(s7); + case ts2.LogLevel.Info: + return console.log(s7); + case ts2.LogLevel.Verbose: + return console.log(s7); + } + } + }; + } + })(ts || (ts = {})); + } +}); + +// node_modules/path-equal/cjs/index.js +var require_cjs2 = __commonJS({ + "node_modules/path-equal/cjs/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.pathEqual = void 0; + function pathEqual(actual, expected) { + return actual === expected || normalizePath(actual) === normalizePath(expected); + } + exports28.pathEqual = pathEqual; + function normalizePath(path2) { + var replace3 = [ + [/\\/g, "/"], + [/(\w):/, "/$1"], + [/(\w+)\/\.\.\/?/g, ""], + [/^\.\//, ""], + [/\/\.\//, "/"], + [/\/\.$/, ""], + [/\/$/, ""] + ]; + replace3.forEach(function(array) { + while (array[0].test(path2)) { + path2 = path2.replace(array[0], array[1]); + } + }); + return path2; + } + } +}); + +// node_modules/@jspm/core/nodelibs/browser/module.js +var module_exports = {}; +__export(module_exports, { + Module: () => unimplemented4, + SourceMap: () => unimplemented4, + _cache: () => _cache, + _debug: () => unimplemented4, + _extensions: () => _extensions, + _findPath: () => unimplemented4, + _initPaths: () => unimplemented4, + _load: () => unimplemented4, + _nodeModulePaths: () => unimplemented4, + _pathCache: () => _pathCache, + _preloadModules: () => unimplemented4, + _resolveFilename: () => unimplemented4, + _resolveLookupPaths: () => unimplemented4, + builtinModules: () => builtinModules, + createRequire: () => unimplemented4, + createRequireFromPath: () => unimplemented4, + default: () => module4, + findSourceMap: () => unimplemented4, + globalPaths: () => globalPaths, + runMain: () => unimplemented4, + syncBuiltinESMExports: () => unimplemented4 +}); +function unimplemented4() { + throw new Error("Node.js module module is not supported by JSPM core in the browser"); +} +var builtinModules, module4, _cache, _pathCache, _extensions, globalPaths; +var init_module = __esm({ + "node_modules/@jspm/core/nodelibs/browser/module.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + builtinModules = [ + "_http_agent", + "_http_client", + "_http_common", + "_http_incoming", + "_http_outgoing", + "_http_server", + "_stream_duplex", + "_stream_passthrough", + "_stream_readable", + "_stream_transform", + "_stream_wrap", + "_stream_writable", + "_tls_common", + "_tls_wrap", + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "http2", + "https", + "inspector", + "module", + "net", + "os", + "path", + "path/posix", + "path/win32", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "stream/consumers", + "stream/promises", + "stream/web", + "string_decoder", + "sys", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "worker_threads", + "zlib" + ]; + module4 = { + builtinModules, + _cache: null, + _pathCache: null, + _extensions: null, + globalPaths: null, + _debug: unimplemented4, + _findPath: unimplemented4, + _nodeModulePaths: unimplemented4, + _resolveLookupPaths: unimplemented4, + _load: unimplemented4, + _resolveFilename: unimplemented4, + createRequireFromPath: unimplemented4, + createRequire: unimplemented4, + _initPaths: unimplemented4, + _preloadModules: unimplemented4, + syncBuiltinESMExports: unimplemented4, + Module: unimplemented4, + runMain: unimplemented4, + findSourceMap: unimplemented4, + SourceMap: unimplemented4 + }; + _cache = null; + _pathCache = null; + _extensions = null; + globalPaths = null; + } +}); + +// node_modules/make-error/index.js +var require_make_error = __commonJS({ + "node_modules/make-error/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var construct = typeof Reflect !== "undefined" ? Reflect.construct : void 0; + var defineProperty2 = Object.defineProperty; + var captureStackTrace = Error.captureStackTrace; + if (captureStackTrace === void 0) { + captureStackTrace = function captureStackTrace2(error2) { + var container = new Error(); + defineProperty2(error2, "stack", { + configurable: true, + get: function getStack() { + var stack = container.stack; + defineProperty2(this, "stack", { + configurable: true, + value: stack, + writable: true + }); + return stack; + }, + set: function setStack(stack) { + defineProperty2(error2, "stack", { + configurable: true, + value: stack, + writable: true + }); + } + }); + }; + } + function BaseError(message) { + if (message !== void 0) { + defineProperty2(this, "message", { + configurable: true, + value: message, + writable: true + }); + } + var cname = this.constructor.name; + if (cname !== void 0 && cname !== this.name) { + defineProperty2(this, "name", { + configurable: true, + value: cname, + writable: true + }); + } + captureStackTrace(this, this.constructor); + } + BaseError.prototype = Object.create(Error.prototype, { + // See: https://github.com/JsCommunity/make-error/issues/4 + constructor: { + configurable: true, + value: BaseError, + writable: true + } + }); + var setFunctionName = function() { + function setFunctionName2(fn, name2) { + return defineProperty2(fn, "name", { + configurable: true, + value: name2 + }); + } + try { + var f8 = function() { + }; + setFunctionName2(f8, "foo"); + if (f8.name === "foo") { + return setFunctionName2; + } + } catch (_6) { + } + }(); + function makeError(constructor, super_) { + if (super_ == null || super_ === Error) { + super_ = BaseError; + } else if (typeof super_ !== "function") { + throw new TypeError("super_ should be a function"); + } + var name2; + if (typeof constructor === "string") { + name2 = constructor; + constructor = construct !== void 0 ? function() { + return construct(super_, arguments, this.constructor); + } : function() { + super_.apply(this, arguments); + }; + if (setFunctionName !== void 0) { + setFunctionName(constructor, name2); + name2 = void 0; + } + } else if (typeof constructor !== "function") { + throw new TypeError("constructor should be either a string or a function"); + } + constructor.super_ = constructor["super"] = super_; + var properties = { + constructor: { + configurable: true, + value: constructor, + writable: true + } + }; + if (name2 !== void 0) { + properties.name = { + configurable: true, + value: name2, + writable: true + }; + } + constructor.prototype = Object.create(super_.prototype, properties); + return constructor; + } + exports28 = module5.exports = makeError; + exports28.BaseError = BaseError; + } +}); + +// node_modules/yn/lenient.js +var require_lenient = __commonJS({ + "node_modules/yn/lenient.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var YES_MATCH_SCORE_THRESHOLD = 2; + var NO_MATCH_SCORE_THRESHOLD = 1.25; + var yMatch = /* @__PURE__ */ new Map([ + [5, 0.25], + [6, 0.25], + [7, 0.25], + ["t", 0.75], + ["y", 1], + ["u", 0.75], + ["g", 0.25], + ["h", 0.25], + ["j", 0.25] + ]); + var eMatch = /* @__PURE__ */ new Map([ + [2, 0.25], + [3, 0.25], + [4, 0.25], + ["w", 0.75], + ["e", 1], + ["r", 0.75], + ["s", 0.25], + ["d", 0.25], + ["f", 0.25] + ]); + var sMatch = /* @__PURE__ */ new Map([ + ["q", 0.25], + ["w", 0.25], + ["e", 0.25], + ["a", 0.75], + ["s", 1], + ["d", 0.75], + ["z", 0.25], + ["x", 0.25], + ["c", 0.25] + ]); + var nMatch = /* @__PURE__ */ new Map([ + ["h", 0.25], + ["j", 0.25], + ["k", 0.25], + ["b", 0.75], + ["n", 1], + ["m", 0.75] + ]); + var oMatch = /* @__PURE__ */ new Map([ + [9, 0.25], + [0, 0.25], + ["i", 0.75], + ["o", 1], + ["p", 0.75], + ["k", 0.25], + ["l", 0.25] + ]); + function getYesMatchScore(value2) { + const [y7, e10, s7] = value2; + let score = 0; + if (yMatch.has(y7)) { + score += yMatch.get(y7); + } + if (eMatch.has(e10)) { + score += eMatch.get(e10); + } + if (sMatch.has(s7)) { + score += sMatch.get(s7); + } + return score; + } + function getNoMatchScore(value2) { + const [n7, o7] = value2; + let score = 0; + if (nMatch.has(n7)) { + score += nMatch.get(n7); + } + if (oMatch.has(o7)) { + score += oMatch.get(o7); + } + return score; + } + module5.exports = (input, options) => { + if (getYesMatchScore(input) >= YES_MATCH_SCORE_THRESHOLD) { + return true; + } + if (getNoMatchScore(input) >= NO_MATCH_SCORE_THRESHOLD) { + return false; + } + return options.default; + }; + } +}); + +// node_modules/yn/index.js +var require_yn = __commonJS({ + "node_modules/yn/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var lenient = require_lenient(); + var yn = (input, options) => { + input = String(input).trim(); + options = Object.assign({ + lenient: false, + default: null + }, options); + if (options.default !== null && typeof options.default !== "boolean") { + throw new TypeError(`Expected the \`default\` option to be of type \`boolean\`, got \`${typeof options.default}\``); + } + if (/^(?:y|yes|true|1)$/i.test(input)) { + return true; + } + if (/^(?:n|no|false|0)$/i.test(input)) { + return false; + } + if (options.lenient === true) { + return lenient(input, options); + } + return options.default; + }; + module5.exports = yn; + module5.exports.default = yn; + } +}); + +// node_modules/create-require/create-require.js +var require_create_require = __commonJS({ + "node_modules/create-require/create-require.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var nativeModule = (init_module(), __toCommonJS(module_exports)); + var path2 = (init_path(), __toCommonJS(path_exports)); + var fs = (init_fs(), __toCommonJS(fs_exports)); + function createRequire(filename) { + if (!filename) { + filename = process.cwd(); + } + if (isDir(filename)) { + filename = path2.join(filename, "index.js"); + } + if (nativeModule.createRequire) { + return nativeModule.createRequire(filename); + } + if (nativeModule.createRequireFromPath) { + return nativeModule.createRequireFromPath(filename); + } + return _createRequire(filename); + } + function _createRequire(filename) { + const mod2 = new nativeModule.Module(filename, null); + mod2.filename = filename; + mod2.paths = nativeModule.Module._nodeModulePaths(path2.dirname(filename)); + mod2._compile("module.exports = require;", filename); + return mod2.exports; + } + function isDir(path3) { + try { + const stat2 = fs.lstatSync(path3); + return stat2.isDirectory(); + } catch (e10) { + return false; + } + } + module5.exports = createRequire; + } +}); + +// node_modules/v8-compile-cache-lib/v8-compile-cache.js +var require_v8_compile_cache = __commonJS({ + "node_modules/v8-compile-cache-lib/v8-compile-cache.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Module = (init_module(), __toCommonJS(module_exports)); + var crypto2 = (init_crypto(), __toCommonJS(crypto_exports)); + var fs = (init_fs(), __toCommonJS(fs_exports)); + var path2 = (init_path(), __toCommonJS(path_exports)); + var vm = (init_vm(), __toCommonJS(vm_exports)); + var os = (init_os(), __toCommonJS(os_exports)); + var hasOwnProperty27 = Object.prototype.hasOwnProperty; + var FileSystemBlobStore = class { + constructor(directory, prefix) { + const name2 = prefix ? slashEscape(prefix + ".") : ""; + this._blobFilename = path2.join(directory, name2 + "BLOB"); + this._mapFilename = path2.join(directory, name2 + "MAP"); + this._lockFilename = path2.join(directory, name2 + "LOCK"); + this._directory = directory; + this._load(); + } + has(key, invalidationKey) { + if (hasOwnProperty27.call(this._memoryBlobs, key)) { + return this._invalidationKeys[key] === invalidationKey; + } else if (hasOwnProperty27.call(this._storedMap, key)) { + return this._storedMap[key][0] === invalidationKey; + } + return false; + } + get(key, invalidationKey) { + if (hasOwnProperty27.call(this._memoryBlobs, key)) { + if (this._invalidationKeys[key] === invalidationKey) { + return this._memoryBlobs[key]; + } + } else if (hasOwnProperty27.call(this._storedMap, key)) { + const mapping = this._storedMap[key]; + if (mapping[0] === invalidationKey) { + return this._storedBlob.slice(mapping[1], mapping[2]); + } + } + } + set(key, invalidationKey, buffer2) { + this._invalidationKeys[key] = invalidationKey; + this._memoryBlobs[key] = buffer2; + this._dirty = true; + } + delete(key) { + if (hasOwnProperty27.call(this._memoryBlobs, key)) { + this._dirty = true; + delete this._memoryBlobs[key]; + } + if (hasOwnProperty27.call(this._invalidationKeys, key)) { + this._dirty = true; + delete this._invalidationKeys[key]; + } + if (hasOwnProperty27.call(this._storedMap, key)) { + this._dirty = true; + delete this._storedMap[key]; + } + } + isDirty() { + return this._dirty; + } + save() { + const dump2 = this._getDump(); + const blobToStore = Buffer.concat(dump2[0]); + const mapToStore = JSON.stringify(dump2[1]); + try { + mkdirpSync(this._directory); + fs.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" }); + } catch (error2) { + return false; + } + try { + fs.writeFileSync(this._blobFilename, blobToStore); + fs.writeFileSync(this._mapFilename, mapToStore); + } finally { + fs.unlinkSync(this._lockFilename); + } + return true; + } + _load() { + try { + this._storedBlob = fs.readFileSync(this._blobFilename); + this._storedMap = JSON.parse(fs.readFileSync(this._mapFilename)); + } catch (e10) { + this._storedBlob = Buffer.alloc(0); + this._storedMap = {}; + } + this._dirty = false; + this._memoryBlobs = {}; + this._invalidationKeys = {}; + } + _getDump() { + const buffers = []; + const newMap = {}; + let offset = 0; + function push4(key, invalidationKey, buffer2) { + buffers.push(buffer2); + newMap[key] = [invalidationKey, offset, offset + buffer2.length]; + offset += buffer2.length; + } + for (const key of Object.keys(this._memoryBlobs)) { + const buffer2 = this._memoryBlobs[key]; + const invalidationKey = this._invalidationKeys[key]; + push4(key, invalidationKey, buffer2); + } + for (const key of Object.keys(this._storedMap)) { + if (hasOwnProperty27.call(newMap, key)) + continue; + const mapping = this._storedMap[key]; + const buffer2 = this._storedBlob.slice(mapping[1], mapping[2]); + push4(key, mapping[0], buffer2); + } + return [buffers, newMap]; + } + }; + var NativeCompileCache = class { + constructor() { + this._cacheStore = null; + this._previousModuleCompile = null; + } + setCacheStore(cacheStore) { + this._cacheStore = cacheStore; + } + install() { + const self2 = this; + const hasRequireResolvePaths = typeof __require.resolve.paths === "function"; + this._previousModuleCompile = Module.prototype._compile; + Module.prototype._compile = this._ownModuleCompile = _ownModuleCompile; + self2.enabled = true; + function _ownModuleCompile(content, filename) { + if (!self2.enabled) + return this._previousModuleCompile.apply(this, arguments); + const mod2 = this; + function require2(id) { + return mod2.require(id); + } + function resolve3(request3, options) { + return Module._resolveFilename(request3, mod2, false, options); + } + require2.resolve = resolve3; + if (hasRequireResolvePaths) { + resolve3.paths = function paths(request3) { + return Module._resolveLookupPaths(request3, mod2, true); + }; + } + require2.main = process.mainModule; + require2.extensions = Module._extensions; + require2.cache = Module._cache; + const dirname2 = path2.dirname(filename); + const compiledWrapper = self2._moduleCompile(filename, content); + const args = [mod2.exports, require2, mod2, filename, dirname2, process, globalThis, Buffer]; + return compiledWrapper.apply(mod2.exports, args); + } + } + uninstall() { + this.enabled = false; + if (Module.prototype._compile === this._ownModuleCompile) { + Module.prototype._compile = this._previousModuleCompile; + } + } + _moduleCompile(filename, content) { + var contLen = content.length; + if (contLen >= 2) { + if (content.charCodeAt(0) === 35 && content.charCodeAt(1) === 33) { + if (contLen === 2) { + content = ""; + } else { + var i7 = 2; + for (; i7 < contLen; ++i7) { + var code = content.charCodeAt(i7); + if (code === 10 || code === 13) + break; + } + if (i7 === contLen) { + content = ""; + } else { + content = content.slice(i7); + } + } + } + } + var wrapper = Module.wrap(content); + var invalidationKey = crypto2.createHash("sha1").update(content, "utf8").digest("hex"); + var buffer2 = this._cacheStore.get(filename, invalidationKey); + var script = new vm.Script(wrapper, { + filename, + lineOffset: 0, + displayErrors: true, + cachedData: buffer2, + produceCachedData: true + }); + if (script.cachedDataProduced) { + this._cacheStore.set(filename, invalidationKey, script.cachedData); + } else if (script.cachedDataRejected) { + this._cacheStore.delete(filename); + } + var compiledWrapper = script.runInThisContext({ + filename, + lineOffset: 0, + columnOffset: 0, + displayErrors: true + }); + return compiledWrapper; + } + }; + function mkdirpSync(p_) { + _mkdirpSync(path2.resolve(p_), 511); + } + function _mkdirpSync(p7, mode) { + try { + fs.mkdirSync(p7, mode); + } catch (err0) { + if (err0.code === "ENOENT") { + _mkdirpSync(path2.dirname(p7)); + _mkdirpSync(p7); + } else { + try { + const stat2 = fs.statSync(p7); + if (!stat2.isDirectory()) { + throw err0; + } + } catch (err1) { + throw err0; + } + } + } + } + function slashEscape(str2) { + const ESCAPE_LOOKUP = { + "\\": "zB", + ":": "zC", + "/": "zS", + "\0": "z0", + "z": "zZ" + }; + const ESCAPE_REGEX = /[\\:/\x00z]/g; + return str2.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]); + } + function supportsCachedData() { + const script = new vm.Script('""', { produceCachedData: true }); + return script.cachedDataProduced === true; + } + function getCacheDir() { + const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR; + if (v8_compile_cache_cache_dir) { + return v8_compile_cache_cache_dir; + } + const dirname2 = typeof process.getuid === "function" ? "v8-compile-cache-" + process.getuid() : "v8-compile-cache"; + const version5 = typeof process.versions.v8 === "string" ? process.versions.v8 : typeof process.versions.chakracore === "string" ? "chakracore-" + process.versions.chakracore : "node-" + process.version; + const cacheDir = path2.join(os.tmpdir(), dirname2, version5); + return cacheDir; + } + function getMainName() { + const mainName = __require.main && typeof __require.main.filename === "string" ? __require.main.filename : process.cwd(); + return mainName; + } + function install(opts) { + if (!process.env.DISABLE_V8_COMPILE_CACHE && supportsCachedData()) { + if (typeof opts === "undefined") + opts = {}; + let cacheDir = opts.cacheDir; + if (typeof cacheDir === "undefined") + cacheDir = getCacheDir(); + let prefix = opts.prefix; + if (typeof prefix === "undefined") + prefix = getMainName(); + const blobStore = new FileSystemBlobStore(cacheDir, prefix); + const nativeCompileCache = new NativeCompileCache(); + nativeCompileCache.setCacheStore(blobStore); + nativeCompileCache.install(); + let uninstalled = false; + const uninstall = () => { + if (uninstalled) + return; + uninstalled = true; + process.removeListener("exit", uninstall); + if (blobStore.isDirty()) { + blobStore.save(); + } + nativeCompileCache.uninstall(); + }; + process.once("exit", uninstall); + return { uninstall }; + } + } + module5.exports.install = install; + module5.exports.__TEST__ = { + FileSystemBlobStore, + NativeCompileCache, + mkdirpSync, + slashEscape, + supportsCachedData, + getCacheDir, + getMainName + }; + } +}); + +// node_modules/ts-node/dist/util.js +var require_util6 = __commonJS({ + "node_modules/ts-node/dist/util.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _a2; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.versionGteLt = exports28.once = exports28.getBasePathForProjectLocalDependencyResolution = exports28.createProjectLocalResolveHelper = exports28.attemptRequireWithV8CompileCache = exports28.cachedLookup = exports28.hasOwnProperty = exports28.normalizeSlashes = exports28.parse = exports28.split = exports28.assign = exports28.yn = exports28.createRequire = void 0; + var module_1 = (init_module(), __toCommonJS(module_exports)); + var ynModule = require_yn(); + var path_1 = (init_path(), __toCommonJS(path_exports)); + exports28.createRequire = (_a2 = module_1.createRequire !== null && module_1.createRequire !== void 0 ? module_1.createRequire : module_1.createRequireFromPath) !== null && _a2 !== void 0 ? _a2 : require_create_require(); + function yn(value2) { + var _a3; + return (_a3 = ynModule(value2)) !== null && _a3 !== void 0 ? _a3 : void 0; + } + exports28.yn = yn; + function assign3(initialValue, ...sources) { + for (const source of sources) { + for (const key of Object.keys(source)) { + const value2 = source[key]; + if (value2 !== void 0) + initialValue[key] = value2; + } + } + return initialValue; + } + exports28.assign = assign3; + function split3(value2) { + return typeof value2 === "string" ? value2.split(/ *, */g).filter((v8) => v8 !== "") : void 0; + } + exports28.split = split3; + function parse17(value2) { + return typeof value2 === "string" ? JSON.parse(value2) : void 0; + } + exports28.parse = parse17; + var directorySeparator = "/"; + var backslashRegExp = /\\/g; + function normalizeSlashes(value2) { + return value2.replace(backslashRegExp, directorySeparator); + } + exports28.normalizeSlashes = normalizeSlashes; + function hasOwnProperty27(object, property2) { + return Object.prototype.hasOwnProperty.call(object, property2); + } + exports28.hasOwnProperty = hasOwnProperty27; + function cachedLookup(fn) { + const cache = /* @__PURE__ */ new Map(); + return (arg) => { + if (!cache.has(arg)) { + const v8 = fn(arg); + cache.set(arg, v8); + return v8; + } + return cache.get(arg); + }; + } + exports28.cachedLookup = cachedLookup; + function attemptRequireWithV8CompileCache(requireFn, specifier) { + try { + const v8CC = require_v8_compile_cache().install(); + try { + return requireFn(specifier); + } finally { + v8CC === null || v8CC === void 0 ? void 0 : v8CC.uninstall(); + } + } catch (e10) { + return requireFn(specifier); + } + } + exports28.attemptRequireWithV8CompileCache = attemptRequireWithV8CompileCache; + function createProjectLocalResolveHelper(localDirectory) { + return function projectLocalResolveHelper(specifier, fallbackToTsNodeRelative) { + return __require.resolve(specifier, { + paths: fallbackToTsNodeRelative ? [localDirectory, __dirname] : [localDirectory] + }); + }; + } + exports28.createProjectLocalResolveHelper = createProjectLocalResolveHelper; + function getBasePathForProjectLocalDependencyResolution(configFilePath, projectSearchDirOption, projectOption, cwdOption) { + var _a3; + if (configFilePath != null) + return (0, path_1.dirname)(configFilePath); + return (_a3 = projectSearchDirOption !== null && projectSearchDirOption !== void 0 ? projectSearchDirOption : projectOption) !== null && _a3 !== void 0 ? _a3 : cwdOption; + } + exports28.getBasePathForProjectLocalDependencyResolution = getBasePathForProjectLocalDependencyResolution; + function once5(fn) { + let value2; + let ran = false; + function onceFn(...args) { + if (ran) + return value2; + value2 = fn(...args); + ran = true; + return value2; + } + return onceFn; + } + exports28.once = once5; + function versionGteLt(version5, gteRequirement, ltRequirement) { + const [major, minor, patch, extra] = parse18(version5); + const [gteMajor, gteMinor, gtePatch] = parse18(gteRequirement); + const isGte = major > gteMajor || major === gteMajor && (minor > gteMinor || minor === gteMinor && patch >= gtePatch); + let isLt = true; + if (ltRequirement) { + const [ltMajor, ltMinor, ltPatch] = parse18(ltRequirement); + isLt = major < ltMajor || major === ltMajor && (minor < ltMinor || minor === ltMinor && patch < ltPatch); + } + return isGte && isLt; + function parse18(requirement) { + return requirement.split(/[\.-]/).map((s7) => parseInt(s7, 10)); + } + } + exports28.versionGteLt = versionGteLt; + } +}); + +// node_modules/ts-node/dist/ts-internals.js +var require_ts_internals = __commonJS({ + "node_modules/ts-node/dist/ts-internals.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getEmitScriptTarget = exports28.getUseDefineForClassFields = exports28.getPatternFromSpec = exports28.createTsInternals = void 0; + var path_1 = (init_path(), __toCommonJS(path_exports)); + var util_1 = require_util6(); + exports28.createTsInternals = (0, util_1.cachedLookup)(createTsInternalsUncached); + function createTsInternalsUncached(_ts) { + const ts = _ts; + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { + extendedConfig = (0, util_1.normalizeSlashes)(extendedConfig); + if (isRootedDiskPath(extendedConfig) || startsWith2(extendedConfig, "./") || startsWith2(extendedConfig, "../")) { + let extendedConfigPath = getNormalizedAbsolutePath(extendedConfig, basePath); + if (!host.fileExists(extendedConfigPath) && !endsWith2(extendedConfigPath, ts.Extension.Json)) { + extendedConfigPath = `${extendedConfigPath}.json`; + if (!host.fileExists(extendedConfigPath)) { + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); + return void 0; + } + } + return extendedConfigPath; + } + const tsGte5_3_0 = (0, util_1.versionGteLt)(ts.version, "5.3.0"); + const resolved = ts.nodeModuleNameResolver( + extendedConfig, + combinePaths(basePath, "tsconfig.json"), + { moduleResolution: ts.ModuleResolutionKind.NodeJs }, + host, + /*cache*/ + void 0, + /*projectRefs*/ + void 0, + /*conditionsOrIsConfigLookup*/ + tsGte5_3_0 ? void 0 : true, + /*isConfigLookup*/ + tsGte5_3_0 ? true : void 0 + ); + if (resolved.resolvedModule) { + return resolved.resolvedModule.resolvedFileName; + } + errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig)); + return void 0; + } + return { getExtendsConfigPath }; + } + function isRootedDiskPath(path2) { + return (0, path_1.isAbsolute)(path2); + } + function combinePaths(path2, ...paths) { + return (0, util_1.normalizeSlashes)((0, path_1.resolve)(path2, ...paths.filter((path3) => path3))); + } + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return (0, util_1.normalizeSlashes)(currentDirectory != null ? (0, path_1.resolve)(currentDirectory, fileName) : (0, path_1.resolve)(fileName)); + } + function startsWith2(str2, prefix) { + return str2.lastIndexOf(prefix, 0) === 0; + } + function endsWith2(str2, suffix) { + const expectedPos = str2.length - suffix.length; + return expectedPos >= 0 && str2.indexOf(suffix, expectedPos) === expectedPos; + } + var reservedCharacterPattern = /[^\w\s\/]/g; + function getPatternFromSpec(spec, basePath) { + const pattern5 = spec && getSubPatternFromSpec(spec, basePath, excludeMatcher); + return pattern5 && `^(${pattern5})${"($|/)"}`; + } + exports28.getPatternFromSpec = getPatternFromSpec; + function getSubPatternFromSpec(spec, basePath, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 }) { + let subpattern = ""; + let hasWrittenComponent = false; + const components = getNormalizedPathComponents(spec, basePath); + const lastComponent = last2(components); + components[0] = removeTrailingDirectorySeparator(components[0]); + if (isImplicitGlob(lastComponent)) { + components.push("**", "*"); + } + let optionalCount = 0; + for (let component of components) { + if (component === "**") { + subpattern += doubleAsteriskRegexFragment; + } else { + if (hasWrittenComponent) { + subpattern += directorySeparator; + } + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); + } + hasWrittenComponent = true; + } + while (optionalCount > 0) { + subpattern += ")?"; + optionalCount--; + } + return subpattern; + } + var excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) + }; + function getNormalizedPathComponents(path2, currentDirectory) { + return reducePathComponents(getPathComponents(path2, currentDirectory)); + } + function getPathComponents(path2, currentDirectory = "") { + path2 = combinePaths(currentDirectory, path2); + return pathComponents(path2, getRootLength(path2)); + } + function reducePathComponents(components) { + if (!some2(components)) + return []; + const reduced = [components[0]]; + for (let i7 = 1; i7 < components.length; i7++) { + const component = components[i7]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + function getRootLength(path2) { + const rootLength = getEncodedRootLength(path2); + return rootLength < 0 ? ~rootLength : rootLength; + } + function getEncodedRootLength(path2) { + if (!path2) + return 0; + const ch0 = path2.charCodeAt(0); + if (ch0 === 47 || ch0 === 92) { + if (path2.charCodeAt(1) !== ch0) + return 1; + const p1 = path2.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path2.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58) { + const ch2 = path2.charCodeAt(2); + if (ch2 === 47 || ch2 === 92) + return 3; + if (path2.length === 2) + return 2; + } + const schemeEnd = path2.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path2.indexOf(directorySeparator, authorityStart); + if (authorityEnd !== -1) { + const scheme = path2.slice(0, schemeEnd); + const authority = path2.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path2.charCodeAt(volumeSeparatorEnd) === 47) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path2.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path2.length; + } + return 0; + } + function hasTrailingDirectorySeparator(path2) { + return path2.length > 0 && isAnyDirectorySeparator(path2.charCodeAt(path2.length - 1)); + } + function isAnyDirectorySeparator(charCode) { + return charCode === 47 || charCode === 92; + } + function removeTrailingDirectorySeparator(path2) { + if (hasTrailingDirectorySeparator(path2)) { + return path2.substr(0, path2.length - 1); + } + return path2; + } + var directorySeparator = "/"; + var altDirectorySeparator = "\\"; + var urlSchemeSeparator = "://"; + function isVolumeCharacter(charCode) { + return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90; + } + function getFileUrlVolumeSeparatorEnd(url, start) { + const ch0 = url.charCodeAt(start); + if (ch0 === 58) + return start + 1; + if (ch0 === 37 && url.charCodeAt(start + 1) === 51) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 || ch2 === 65) + return start + 3; + } + return -1; + } + function some2(array, predicate) { + if (array) { + if (predicate) { + for (const v8 of array) { + if (predicate(v8)) { + return true; + } + } + } else { + return array.length > 0; + } + } + return false; + } + function pathComponents(path2, rootLength) { + const root2 = path2.substring(0, rootLength); + const rest2 = path2.substring(rootLength).split(directorySeparator); + if (rest2.length && !lastOrUndefined(rest2)) + rest2.pop(); + return [root2, ...rest2]; + } + function lastOrUndefined(array) { + return array.length === 0 ? void 0 : array[array.length - 1]; + } + function last2(array) { + return array[array.length - 1]; + } + function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { + return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; + } + function isImplicitGlob(lastPathComponent) { + return !/[.*?]/.test(lastPathComponent); + } + var ts_ScriptTarget_ES5 = 1; + var ts_ScriptTarget_ES2022 = 9; + var ts_ScriptTarget_ESNext = 99; + var ts_ModuleKind_Node16 = 100; + var ts_ModuleKind_NodeNext = 199; + function getUseDefineForClassFields(compilerOptions) { + return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= ts_ScriptTarget_ES2022 : compilerOptions.useDefineForClassFields; + } + exports28.getUseDefineForClassFields = getUseDefineForClassFields; + function getEmitScriptTarget(compilerOptions) { + var _a2; + return (_a2 = compilerOptions.target) !== null && _a2 !== void 0 ? _a2 : compilerOptions.module === ts_ModuleKind_Node16 && ts_ScriptTarget_ES2022 || compilerOptions.module === ts_ModuleKind_NodeNext && ts_ScriptTarget_ESNext || ts_ScriptTarget_ES5; + } + exports28.getEmitScriptTarget = getEmitScriptTarget; + } +}); + +// node_modules/@tsconfig/node16/tsconfig.json +var require_tsconfig = __commonJS({ + "node_modules/@tsconfig/node16/tsconfig.json"(exports28, module5) { + module5.exports = { + $schema: "https://json.schemastore.org/tsconfig", + display: "Node 16", + compilerOptions: { + lib: ["es2021"], + module: "Node16", + target: "es2021", + strict: true, + esModuleInterop: true, + skipLibCheck: true, + forceConsistentCasingInFileNames: true, + moduleResolution: "node" + } + }; + } +}); + +// node_modules/@tsconfig/node14/tsconfig.json +var require_tsconfig2 = __commonJS({ + "node_modules/@tsconfig/node14/tsconfig.json"(exports28, module5) { + module5.exports = { + $schema: "https://json.schemastore.org/tsconfig", + display: "Node 14", + compilerOptions: { + lib: ["es2020"], + module: "commonjs", + target: "es2020", + strict: true, + esModuleInterop: true, + skipLibCheck: true, + forceConsistentCasingInFileNames: true, + moduleResolution: "node" + } + }; + } +}); + +// node_modules/@tsconfig/node12/tsconfig.json +var require_tsconfig3 = __commonJS({ + "node_modules/@tsconfig/node12/tsconfig.json"(exports28, module5) { + module5.exports = { + $schema: "https://json.schemastore.org/tsconfig", + display: "Node 12", + compilerOptions: { + lib: ["es2019", "es2020.promise", "es2020.bigint", "es2020.string"], + module: "commonjs", + target: "es2019", + strict: true, + esModuleInterop: true, + skipLibCheck: true, + forceConsistentCasingInFileNames: true, + moduleResolution: "node" + } + }; + } +}); + +// node_modules/@tsconfig/node10/tsconfig.json +var require_tsconfig4 = __commonJS({ + "node_modules/@tsconfig/node10/tsconfig.json"(exports28, module5) { + module5.exports = { + $schema: "https://json.schemastore.org/tsconfig", + compilerOptions: { + lib: ["es2018"], + module: "commonjs", + target: "es2018", + strict: true, + esModuleInterop: true, + skipLibCheck: true, + moduleResolution: "node" + } + }; + } +}); + +// node_modules/ts-node/dist/tsconfigs.js +var require_tsconfigs = __commonJS({ + "node_modules/ts-node/dist/tsconfigs.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getDefaultTsconfigJsonForNodeVersion = void 0; + var nodeMajor = parseInt(process.versions.node.split(".")[0], 10); + function getDefaultTsconfigJsonForNodeVersion(ts) { + const tsInternal = ts; + if (nodeMajor >= 16) { + const config3 = require_tsconfig(); + if (configCompatible(config3)) + return config3; + } + if (nodeMajor >= 14) { + const config3 = require_tsconfig2(); + if (configCompatible(config3)) + return config3; + } + if (nodeMajor >= 12) { + const config3 = require_tsconfig3(); + if (configCompatible(config3)) + return config3; + } + return require_tsconfig4(); + function configCompatible(config3) { + return typeof ts.ScriptTarget[config3.compilerOptions.target.toUpperCase()] === "number" && tsInternal.libs && config3.compilerOptions.lib.every((lib2) => tsInternal.libs.includes(lib2)); + } + } + exports28.getDefaultTsconfigJsonForNodeVersion = getDefaultTsconfigJsonForNodeVersion; + } +}); + +// node_modules/ts-node/dist/configuration.js +var require_configuration = __commonJS({ + "node_modules/ts-node/dist/configuration.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getTsConfigDefaults = exports28.ComputeAsCommonRootOfFiles = exports28.loadCompiler = exports28.resolveAndLoadCompiler = exports28.readConfig = exports28.findAndReadConfig = void 0; + var path_1 = (init_path(), __toCommonJS(path_exports)); + var index_1 = require_dist16(); + var ts_internals_1 = require_ts_internals(); + var tsconfigs_1 = require_tsconfigs(); + var util_1 = require_util6(); + var TS_NODE_COMPILER_OPTIONS = { + sourceMap: true, + inlineSourceMap: false, + inlineSources: true, + declaration: false, + noEmit: false, + outDir: ".ts-node" + }; + function fixConfig(ts, config3) { + delete config3.options.out; + delete config3.options.outFile; + delete config3.options.composite; + delete config3.options.declarationDir; + delete config3.options.declarationMap; + delete config3.options.emitDeclarationOnly; + if (config3.options.target === void 0) { + config3.options.target = ts.ScriptTarget.ES5; + } + if (config3.options.module === void 0) { + config3.options.module = ts.ModuleKind.CommonJS; + } + return config3; + } + function findAndReadConfig(rawOptions) { + var _a2, _b, _c, _d, _e2; + const cwd3 = (0, path_1.resolve)((_c = (_b = (_a2 = rawOptions.cwd) !== null && _a2 !== void 0 ? _a2 : rawOptions.dir) !== null && _b !== void 0 ? _b : index_1.DEFAULTS.cwd) !== null && _c !== void 0 ? _c : process.cwd()); + const compilerName = (_d = rawOptions.compiler) !== null && _d !== void 0 ? _d : index_1.DEFAULTS.compiler; + let projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(void 0, rawOptions.projectSearchDir, rawOptions.project, cwd3); + let { compiler, ts } = resolveAndLoadCompiler(compilerName, projectLocalResolveDir); + const { configFilePath, config: config3, tsNodeOptionsFromTsconfig, optionBasePaths } = readConfig(cwd3, ts, rawOptions); + const options = (0, util_1.assign)({}, index_1.DEFAULTS, tsNodeOptionsFromTsconfig || {}, { optionBasePaths }, rawOptions); + options.require = [ + ...tsNodeOptionsFromTsconfig.require || [], + ...rawOptions.require || [] + ]; + if (configFilePath) { + projectLocalResolveDir = (0, util_1.getBasePathForProjectLocalDependencyResolution)(configFilePath, rawOptions.projectSearchDir, rawOptions.project, cwd3); + ({ compiler } = resolveCompiler(options.compiler, (_e2 = optionBasePaths.compiler) !== null && _e2 !== void 0 ? _e2 : projectLocalResolveDir)); + } + return { + options, + config: config3, + projectLocalResolveDir, + optionBasePaths, + configFilePath, + cwd: cwd3, + compiler + }; + } + exports28.findAndReadConfig = findAndReadConfig; + function readConfig(cwd3, ts, rawApiOptions) { + var _a2, _b, _c; + const configChain = []; + let config3 = { compilerOptions: {} }; + let basePath = cwd3; + let configFilePath = void 0; + const projectSearchDir = (0, path_1.resolve)(cwd3, (_a2 = rawApiOptions.projectSearchDir) !== null && _a2 !== void 0 ? _a2 : cwd3); + const { fileExists = ts.sys.fileExists, readFile: readFile2 = ts.sys.readFile, skipProject = index_1.DEFAULTS.skipProject, project = index_1.DEFAULTS.project, tsTrace = index_1.DEFAULTS.tsTrace } = rawApiOptions; + if (!skipProject) { + if (project) { + const resolved = (0, path_1.resolve)(cwd3, project); + const nested = (0, path_1.join)(resolved, "tsconfig.json"); + configFilePath = fileExists(nested) ? nested : resolved; + } else { + configFilePath = ts.findConfigFile(projectSearchDir, fileExists); + } + if (configFilePath) { + let pathToNextConfigInChain = configFilePath; + const tsInternals = (0, ts_internals_1.createTsInternals)(ts); + const errors = []; + while (true) { + const result2 = ts.readConfigFile(pathToNextConfigInChain, readFile2); + if (result2.error) { + return { + configFilePath, + config: { errors: [result2.error], fileNames: [], options: {} }, + tsNodeOptionsFromTsconfig: {}, + optionBasePaths: {} + }; + } + const c7 = result2.config; + const bp = (0, path_1.dirname)(pathToNextConfigInChain); + configChain.push({ + config: c7, + basePath: bp, + configPath: pathToNextConfigInChain + }); + if (c7.extends == null) + break; + const resolvedExtendedConfigPath = tsInternals.getExtendsConfigPath(c7.extends, { + fileExists, + readDirectory: ts.sys.readDirectory, + readFile: readFile2, + useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, + trace: tsTrace + }, bp, errors, ts.createCompilerDiagnostic); + if (errors.length) { + return { + configFilePath, + config: { errors, fileNames: [], options: {} }, + tsNodeOptionsFromTsconfig: {}, + optionBasePaths: {} + }; + } + if (resolvedExtendedConfigPath == null) + break; + pathToNextConfigInChain = resolvedExtendedConfigPath; + } + ({ config: config3, basePath } = configChain[0]); + } + } + const tsNodeOptionsFromTsconfig = {}; + const optionBasePaths = {}; + for (let i7 = configChain.length - 1; i7 >= 0; i7--) { + const { config: config4, basePath: basePath2, configPath } = configChain[i7]; + const options = filterRecognizedTsConfigTsNodeOptions(config4["ts-node"]).recognized; + if (options.require) { + const tsconfigRelativeResolver = (0, util_1.createProjectLocalResolveHelper)((0, path_1.dirname)(configPath)); + options.require = options.require.map((path2) => tsconfigRelativeResolver(path2, false)); + } + if (options.scopeDir) { + options.scopeDir = (0, path_1.resolve)(basePath2, options.scopeDir); + } + if (options.moduleTypes) { + optionBasePaths.moduleTypes = basePath2; + } + if (options.transpiler != null) { + optionBasePaths.transpiler = basePath2; + } + if (options.compiler != null) { + optionBasePaths.compiler = basePath2; + } + if (options.swc != null) { + optionBasePaths.swc = basePath2; + } + (0, util_1.assign)(tsNodeOptionsFromTsconfig, options); + } + const files = (_c = (_b = rawApiOptions.files) !== null && _b !== void 0 ? _b : tsNodeOptionsFromTsconfig.files) !== null && _c !== void 0 ? _c : index_1.DEFAULTS.files; + const skipDefaultCompilerOptions = configFilePath != null; + const defaultCompilerOptionsForNodeVersion = skipDefaultCompilerOptions ? void 0 : { + ...(0, tsconfigs_1.getDefaultTsconfigJsonForNodeVersion)(ts).compilerOptions, + types: ["node"] + }; + config3.compilerOptions = Object.assign( + {}, + // automatically-applied options from @tsconfig/bases + defaultCompilerOptionsForNodeVersion, + // tsconfig.json "compilerOptions" + config3.compilerOptions, + // from env var + index_1.DEFAULTS.compilerOptions, + // tsconfig.json "ts-node": "compilerOptions" + tsNodeOptionsFromTsconfig.compilerOptions, + // passed programmatically + rawApiOptions.compilerOptions, + // overrides required by ts-node, cannot be changed + TS_NODE_COMPILER_OPTIONS + ); + const fixedConfig = fixConfig(ts, ts.parseJsonConfigFileContent(config3, { + fileExists, + readFile: readFile2, + // Only used for globbing "files", "include", "exclude" + // When `files` option disabled, we want to avoid the fs calls + readDirectory: files ? ts.sys.readDirectory : () => [], + useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames + }, basePath, void 0, configFilePath)); + return { + configFilePath, + config: fixedConfig, + tsNodeOptionsFromTsconfig, + optionBasePaths + }; + } + exports28.readConfig = readConfig; + function resolveAndLoadCompiler(name2, relativeToPath) { + const { compiler } = resolveCompiler(name2, relativeToPath); + const ts = loadCompiler(compiler); + return { compiler, ts }; + } + exports28.resolveAndLoadCompiler = resolveAndLoadCompiler; + function resolveCompiler(name2, relativeToPath) { + const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(relativeToPath); + const compiler = projectLocalResolveHelper(name2 || "typescript", true); + return { compiler }; + } + function loadCompiler(compiler) { + return (0, util_1.attemptRequireWithV8CompileCache)(__require, compiler); + } + exports28.loadCompiler = loadCompiler; + function filterRecognizedTsConfigTsNodeOptions(jsonObject) { + if (jsonObject == null) + return { recognized: {}, unrecognized: {} }; + const { compiler, compilerHost, compilerOptions, emit: emit3, files, ignore, ignoreDiagnostics, logError, preferTsExts, pretty, require: require2, skipIgnore, transpileOnly, typeCheck, transpiler, scope, scopeDir, moduleTypes, experimentalReplAwait, swc, experimentalResolver, esm, experimentalSpecifierResolution, experimentalTsImportSpecifiers, ...unrecognized } = jsonObject; + const filteredTsConfigOptions = { + compiler, + compilerHost, + compilerOptions, + emit: emit3, + experimentalReplAwait, + files, + ignore, + ignoreDiagnostics, + logError, + preferTsExts, + pretty, + require: require2, + skipIgnore, + transpileOnly, + typeCheck, + transpiler, + scope, + scopeDir, + moduleTypes, + swc, + experimentalResolver, + esm, + experimentalSpecifierResolution, + experimentalTsImportSpecifiers + }; + const catchExtraneousProps = null; + const catchMissingProps = null; + return { recognized: filteredTsConfigOptions, unrecognized }; + } + exports28.ComputeAsCommonRootOfFiles = Symbol(); + function getTsConfigDefaults(config3, basePath, _files, _include, _exclude) { + const { composite = false } = config3.options; + let rootDir = config3.options.rootDir; + if (rootDir == null) { + if (composite) + rootDir = basePath; + else + rootDir = exports28.ComputeAsCommonRootOfFiles; + } + const { outDir = rootDir } = config3.options; + const include = _files ? [] : ["**/*"]; + const files = _files !== null && _files !== void 0 ? _files : []; + const exclude = _exclude !== null && _exclude !== void 0 ? _exclude : [outDir]; + return { rootDir, outDir, include, files, exclude, composite }; + } + exports28.getTsConfigDefaults = getTsConfigDefaults; + } +}); + +// node_modules/ts-node/dist/module-type-classifier.js +var require_module_type_classifier = __commonJS({ + "node_modules/ts-node/dist/module-type-classifier.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createModuleTypeClassifier = void 0; + var ts_internals_1 = require_ts_internals(); + var util_1 = require_util6(); + function createModuleTypeClassifier(options) { + const { patterns, basePath: _basePath } = options; + const basePath = _basePath !== void 0 ? (0, util_1.normalizeSlashes)(_basePath).replace(/\/$/, "") : void 0; + const patternTypePairs = Object.entries(patterns !== null && patterns !== void 0 ? patterns : []).map(([_pattern, type3]) => { + const pattern5 = (0, util_1.normalizeSlashes)(_pattern); + return { pattern: parsePattern(basePath, pattern5), type: type3 }; + }); + const classifications = { + package: { + moduleType: "auto" + }, + cjs: { + moduleType: "cjs" + }, + esm: { + moduleType: "esm" + } + }; + const auto = classifications.package; + function classifyModuleNonCached(path2) { + const matched = matchPatterns(patternTypePairs, (_6) => _6.pattern, path2); + if (matched) + return classifications[matched.type]; + return auto; + } + const classifyModule = (0, util_1.cachedLookup)(classifyModuleNonCached); + function classifyModuleAuto(path2) { + return auto; + } + return { + classifyModuleByModuleTypeOverrides: patternTypePairs.length ? classifyModule : classifyModuleAuto + }; + } + exports28.createModuleTypeClassifier = createModuleTypeClassifier; + function parsePattern(basePath, patternString) { + const pattern5 = (0, ts_internals_1.getPatternFromSpec)(patternString, basePath); + return pattern5 !== void 0 ? new RegExp(pattern5) : /(?:)/; + } + function matchPatterns(objects, getPattern, candidate) { + for (let i7 = objects.length - 1; i7 >= 0; i7--) { + const object = objects[i7]; + const pattern5 = getPattern(object); + if (pattern5 === null || pattern5 === void 0 ? void 0 : pattern5.test(candidate)) { + return object; + } + } + } + } +}); + +// node_modules/ts-node/dist/resolver-functions.js +var require_resolver_functions = __commonJS({ + "node_modules/ts-node/dist/resolver-functions.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createResolverFunctions = void 0; + var path_1 = (init_path(), __toCommonJS(path_exports)); + function createResolverFunctions(kwargs) { + const { host, ts, config: config3, cwd: cwd3, getCanonicalFileName, projectLocalResolveHelper, options, extensions: extensions6 } = kwargs; + const moduleResolutionCache = ts.createModuleResolutionCache(cwd3, getCanonicalFileName, config3.options); + const knownInternalFilenames = /* @__PURE__ */ new Set(); + const internalBuckets = /* @__PURE__ */ new Set(); + const moduleBucketRe = /.*\/node_modules\/(?:@[^\/]+\/)?[^\/]+\//; + function getModuleBucket(filename) { + const find2 = moduleBucketRe.exec(filename); + if (find2) + return find2[0]; + return ""; + } + function markBucketOfFilenameInternal(filename) { + internalBuckets.add(getModuleBucket(filename)); + } + function isFileInInternalBucket(filename) { + return internalBuckets.has(getModuleBucket(filename)); + } + function isFileKnownToBeInternal(filename) { + return knownInternalFilenames.has(filename); + } + const fixupResolvedModule = (resolvedModule) => { + const { resolvedFileName } = resolvedModule; + if (resolvedFileName === void 0) + return; + if (resolvedModule.isExternalLibraryImport && (resolvedFileName.endsWith(".ts") && !resolvedFileName.endsWith(".d.ts") || resolvedFileName.endsWith(".cts") && !resolvedFileName.endsWith(".d.cts") || resolvedFileName.endsWith(".mts") && !resolvedFileName.endsWith(".d.mts") || isFileKnownToBeInternal(resolvedFileName) || isFileInInternalBucket(resolvedFileName))) { + resolvedModule.isExternalLibraryImport = false; + } + if (!resolvedModule.isExternalLibraryImport) { + knownInternalFilenames.add(resolvedFileName); + } + }; + const resolveModuleNames = (moduleNames, containingFile, reusedNames, redirectedReference, optionsOnlyWithNewerTsVersions, containingSourceFile) => { + return moduleNames.map((moduleName3, i7) => { + var _a2, _b; + const mode = containingSourceFile ? (_b = (_a2 = ts).getModeForResolutionAtIndex) === null || _b === void 0 ? void 0 : _b.call(_a2, containingSourceFile, i7) : void 0; + let { resolvedModule } = ts.resolveModuleName(moduleName3, containingFile, config3.options, host, moduleResolutionCache, redirectedReference, mode); + if (!resolvedModule && options.experimentalTsImportSpecifiers) { + const lastDotIndex = moduleName3.lastIndexOf("."); + const ext = lastDotIndex >= 0 ? moduleName3.slice(lastDotIndex) : ""; + if (ext) { + const replacements = extensions6.tsResolverEquivalents.get(ext); + for (const replacementExt of replacements !== null && replacements !== void 0 ? replacements : []) { + ({ resolvedModule } = ts.resolveModuleName(moduleName3.slice(0, -ext.length) + replacementExt, containingFile, config3.options, host, moduleResolutionCache, redirectedReference, mode)); + if (resolvedModule) + break; + } + } + } + if (resolvedModule) { + fixupResolvedModule(resolvedModule); + } + return resolvedModule; + }); + }; + const getResolvedModuleWithFailedLookupLocationsFromCache = (moduleName3, containingFile, resolutionMode) => { + const ret = ts.resolveModuleNameFromCache(moduleName3, containingFile, moduleResolutionCache, resolutionMode); + if (ret && ret.resolvedModule) { + fixupResolvedModule(ret.resolvedModule); + } + return ret; + }; + const resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile, redirectedReference, options2, containingFileMode) => { + return typeDirectiveNames.map((typeDirectiveName) => { + const nameIsString = typeof typeDirectiveName === "string"; + const mode = nameIsString ? void 0 : ts.getModeForFileReference(typeDirectiveName, containingFileMode); + const strName = nameIsString ? typeDirectiveName : typeDirectiveName.fileName.toLowerCase(); + let { resolvedTypeReferenceDirective } = ts.resolveTypeReferenceDirective(strName, containingFile, config3.options, host, redirectedReference, void 0, mode); + if (typeDirectiveName === "node" && !resolvedTypeReferenceDirective) { + let typesNodePackageJsonPath; + try { + typesNodePackageJsonPath = projectLocalResolveHelper("@types/node/package.json", true); + } catch { + } + if (typesNodePackageJsonPath) { + const typeRoots = [(0, path_1.resolve)(typesNodePackageJsonPath, "../..")]; + ({ resolvedTypeReferenceDirective } = ts.resolveTypeReferenceDirective(typeDirectiveName, containingFile, { + ...config3.options, + typeRoots + }, host, redirectedReference)); + } + } + if (resolvedTypeReferenceDirective) { + fixupResolvedModule(resolvedTypeReferenceDirective); + } + return resolvedTypeReferenceDirective; + }); + }; + return { + resolveModuleNames, + getResolvedModuleWithFailedLookupLocationsFromCache, + resolveTypeReferenceDirectives, + isFileKnownToBeInternal, + markBucketOfFilenameInternal + }; + } + exports28.createResolverFunctions = createResolverFunctions; + } +}); + +// node_modules/ts-node/dist/cjs-resolve-hooks.js +var require_cjs_resolve_hooks = __commonJS({ + "node_modules/ts-node/dist/cjs-resolve-hooks.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.installCommonjsResolveHooksIfNecessary = void 0; + function installCommonjsResolveHooksIfNecessary(tsNodeService) { + const Module = (init_module(), __toCommonJS(module_exports)); + const originalResolveFilename = Module._resolveFilename; + const originalFindPath = Module._findPath; + const shouldInstallHook = tsNodeService.options.experimentalResolver; + if (shouldInstallHook) { + let _resolveFilename = function(request3, parent2, isMain, options, ...rest2) { + if (!tsNodeService.enabled()) + return originalResolveFilename.call(this, request3, parent2, isMain, options, ...rest2); + return Module_resolveFilename.call(this, request3, parent2, isMain, options, ...rest2); + }, _findPath = function() { + if (!tsNodeService.enabled()) + return originalFindPath.apply(this, arguments); + return Module_findPath.apply(this, arguments); + }; + const { Module_findPath, Module_resolveFilename } = tsNodeService.getNodeCjsLoader(); + Module._resolveFilename = _resolveFilename; + Module._findPath = _findPath; + } + } + exports28.installCommonjsResolveHooksIfNecessary = installCommonjsResolveHooksIfNecessary; + } +}); + +// node_modules/ts-node/dist-raw/node-primordials.js +var require_node_primordials = __commonJS({ + "node_modules/ts-node/dist-raw/node-primordials.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + ArrayFrom: Array.from, + ArrayIsArray: Array.isArray, + ArrayPrototypeShift: (obj) => Array.prototype.shift.call(obj), + ArrayPrototypeForEach: (arr, ...rest2) => Array.prototype.forEach.apply(arr, rest2), + ArrayPrototypeIncludes: (arr, ...rest2) => Array.prototype.includes.apply(arr, rest2), + ArrayPrototypeJoin: (arr, ...rest2) => Array.prototype.join.apply(arr, rest2), + ArrayPrototypePop: (arr, ...rest2) => Array.prototype.pop.apply(arr, rest2), + ArrayPrototypePush: (arr, ...rest2) => Array.prototype.push.apply(arr, rest2), + FunctionPrototype: Function.prototype, + JSONParse: JSON.parse, + JSONStringify: JSON.stringify, + ObjectFreeze: Object.freeze, + ObjectKeys: Object.keys, + ObjectGetOwnPropertyNames: Object.getOwnPropertyNames, + ObjectDefineProperty: Object.defineProperty, + ObjectPrototypeHasOwnProperty: (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop), + RegExpPrototypeExec: (obj, string2) => RegExp.prototype.exec.call(obj, string2), + RegExpPrototypeTest: (obj, string2) => RegExp.prototype.test.call(obj, string2), + RegExpPrototypeSymbolReplace: (obj, ...rest2) => RegExp.prototype[Symbol.replace].apply(obj, rest2), + SafeMap: Map, + SafeSet: Set, + SafeWeakMap: WeakMap, + StringPrototypeEndsWith: (str2, ...rest2) => String.prototype.endsWith.apply(str2, rest2), + StringPrototypeIncludes: (str2, ...rest2) => String.prototype.includes.apply(str2, rest2), + StringPrototypeLastIndexOf: (str2, ...rest2) => String.prototype.lastIndexOf.apply(str2, rest2), + StringPrototypeIndexOf: (str2, ...rest2) => String.prototype.indexOf.apply(str2, rest2), + StringPrototypeRepeat: (str2, ...rest2) => String.prototype.repeat.apply(str2, rest2), + StringPrototypeReplace: (str2, ...rest2) => String.prototype.replace.apply(str2, rest2), + StringPrototypeSlice: (str2, ...rest2) => String.prototype.slice.apply(str2, rest2), + StringPrototypeSplit: (str2, ...rest2) => String.prototype.split.apply(str2, rest2), + StringPrototypeStartsWith: (str2, ...rest2) => String.prototype.startsWith.apply(str2, rest2), + StringPrototypeSubstr: (str2, ...rest2) => String.prototype.substr.apply(str2, rest2), + StringPrototypeCharCodeAt: (str2, ...rest2) => String.prototype.charCodeAt.apply(str2, rest2), + StringPrototypeMatch: (str2, ...rest2) => String.prototype.match.apply(str2, rest2), + SyntaxError + }; + } +}); + +// node_modules/ts-node/dist-raw/node-nativemodule.js +var require_node_nativemodule = __commonJS({ + "node_modules/ts-node/dist-raw/node-nativemodule.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + var Module = (init_module(), __toCommonJS(module_exports)); + var NativeModule = { + canBeRequiredByUsers(specifier) { + return Module.builtinModules.includes(specifier); + } + }; + exports28.NativeModule = NativeModule; + } +}); + +// node_modules/ts-node/dist-raw/node-internalBinding-fs.js +var require_node_internalBinding_fs = __commonJS({ + "node_modules/ts-node/dist-raw/node-internalBinding-fs.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var fs = (init_fs(), __toCommonJS(fs_exports)); + var { versionGteLt } = require_util6(); + function internalModuleReadJSON(path2) { + let string2; + try { + string2 = fs.readFileSync(path2, "utf8"); + } catch (e10) { + if (e10.code === "ENOENT") + return []; + throw e10; + } + const containsKeys = true; + return [string2, containsKeys]; + } + function internalModuleStat(path2) { + const stat2 = fs.statSync(path2, { throwIfNoEntry: false }); + if (!stat2) + return -1; + if (stat2.isFile()) + return 0; + if (stat2.isDirectory()) + return 1; + } + function internalModuleStatInefficient(path2) { + try { + const stat2 = fs.statSync(path2); + if (stat2.isFile()) + return 0; + if (stat2.isDirectory()) + return 1; + } catch (e10) { + return -e10.errno || -1; + } + } + var statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, "15.3.0") || versionGteLt(process.versions.node, "14.17.0", "15.0.0"); + module5.exports = { + internalModuleReadJSON, + internalModuleStat: statSupportsThrowIfNoEntry ? internalModuleStat : internalModuleStatInefficient + }; + } +}); + +// node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +var require_node_internal_modules_package_json_reader = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { SafeMap } = require_node_primordials(); + var { internalModuleReadJSON } = require_node_internalBinding_fs(); + var { pathToFileURL: pathToFileURL3 } = (init_url(), __toCommonJS(url_exports)); + var { toNamespacedPath } = (init_path(), __toCommonJS(path_exports)); + var cache = new SafeMap(); + var manifest; + function read(jsonPath) { + if (cache.has(jsonPath)) { + return cache.get(jsonPath); + } + const [string2, containsKeys] = internalModuleReadJSON( + toNamespacedPath(jsonPath) + ); + const result2 = { string: string2, containsKeys }; + if (string2 !== void 0) { + if (manifest === void 0) { + manifest = null; + } + if (manifest !== null) { + const jsonURL = pathToFileURL3(jsonPath); + manifest.assertIntegrity(jsonURL, string2); + } + } + cache.set(jsonPath, result2); + return result2; + } + module5.exports = { read }; + } +}); + +// node_modules/arg/index.js +var require_arg = __commonJS({ + "node_modules/arg/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var flagSymbol = Symbol("arg flag"); + function arg(opts, { argv: argv3 = process.argv.slice(2), permissive = false, stopAtPositional = false } = {}) { + if (!opts) { + throw new Error("Argument specification object is required"); + } + const result2 = { _: [] }; + const aliases = {}; + const handlers = {}; + for (const key of Object.keys(opts)) { + if (!key) { + throw new TypeError("Argument key cannot be an empty string"); + } + if (key[0] !== "-") { + throw new TypeError(`Argument key must start with '-' but found: '${key}'`); + } + if (key.length === 1) { + throw new TypeError(`Argument key must have a name; singular '-' keys are not allowed: ${key}`); + } + if (typeof opts[key] === "string") { + aliases[key] = opts[key]; + continue; + } + let type3 = opts[key]; + let isFlag = false; + if (Array.isArray(type3) && type3.length === 1 && typeof type3[0] === "function") { + const [fn] = type3; + type3 = (value2, name2, prev = []) => { + prev.push(fn(value2, name2, prev[prev.length - 1])); + return prev; + }; + isFlag = fn === Boolean || fn[flagSymbol] === true; + } else if (typeof type3 === "function") { + isFlag = type3 === Boolean || type3[flagSymbol] === true; + } else { + throw new TypeError(`Type missing or not a function or valid array type: ${key}`); + } + if (key[1] !== "-" && key.length > 2) { + throw new TypeError(`Short argument keys (with a single hyphen) must have only one character: ${key}`); + } + handlers[key] = [type3, isFlag]; + } + for (let i7 = 0, len = argv3.length; i7 < len; i7++) { + const wholeArg = argv3[i7]; + if (stopAtPositional && result2._.length > 0) { + result2._ = result2._.concat(argv3.slice(i7)); + break; + } + if (wholeArg === "--") { + result2._ = result2._.concat(argv3.slice(i7 + 1)); + break; + } + if (wholeArg.length > 1 && wholeArg[0] === "-") { + const separatedArguments = wholeArg[1] === "-" || wholeArg.length === 2 ? [wholeArg] : wholeArg.slice(1).split("").map((a7) => `-${a7}`); + for (let j6 = 0; j6 < separatedArguments.length; j6++) { + const arg2 = separatedArguments[j6]; + const [originalArgName, argStr] = arg2[1] === "-" ? arg2.split(/=(.*)/, 2) : [arg2, void 0]; + let argName = originalArgName; + while (argName in aliases) { + argName = aliases[argName]; + } + if (!(argName in handlers)) { + if (permissive) { + result2._.push(arg2); + continue; + } else { + const err = new Error(`Unknown or unexpected option: ${originalArgName}`); + err.code = "ARG_UNKNOWN_OPTION"; + throw err; + } + } + const [type3, isFlag] = handlers[argName]; + if (!isFlag && j6 + 1 < separatedArguments.length) { + throw new TypeError(`Option requires argument (but was followed by another short argument): ${originalArgName}`); + } + if (isFlag) { + result2[argName] = type3(true, argName, result2[argName]); + } else if (argStr === void 0) { + if (argv3.length < i7 + 2 || argv3[i7 + 1].length > 1 && argv3[i7 + 1][0] === "-" && !(argv3[i7 + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && (type3 === Number || // eslint-disable-next-line no-undef + typeof BigInt !== "undefined" && type3 === BigInt))) { + const extended = originalArgName === argName ? "" : ` (alias for ${argName})`; + throw new Error(`Option requires argument: ${originalArgName}${extended}`); + } + result2[argName] = type3(argv3[i7 + 1], argName, result2[argName]); + ++i7; + } else { + result2[argName] = type3(argStr, argName, result2[argName]); + } + } + } else { + result2._.push(wholeArg); + } + } + return result2; + } + arg.flag = (fn) => { + fn[flagSymbol] = true; + return fn; + }; + arg.COUNT = arg.flag((v8, name2, existingCount) => (existingCount || 0) + 1); + module5.exports = arg; + } +}); + +// node_modules/ts-node/dist-raw/node-options.js +var require_node_options = __commonJS({ + "node_modules/ts-node/dist-raw/node-options.js"(exports28) { + init_dirname(); + init_buffer2(); + init_process2(); + exports28.getOptionValue = getOptionValue; + function getOptionValue(opt) { + parseOptions2(); + return options[opt]; + } + var options; + function parseOptions2() { + if (!options) { + options = { + "--preserve-symlinks": false, + "--preserve-symlinks-main": false, + "--input-type": void 0, + "--experimental-specifier-resolution": "explicit", + "--experimental-policy": void 0, + "--conditions": [], + "--pending-deprecation": false, + ...parseArgv(getNodeOptionsEnvArgv()), + ...parseArgv(process.execArgv), + ...getOptionValuesFromOtherEnvVars() + }; + } + } + function parseArgv(argv3) { + return require_arg()({ + "--preserve-symlinks": Boolean, + "--preserve-symlinks-main": Boolean, + "--input-type": String, + "--experimental-specifier-resolution": String, + // Legacy alias for node versions prior to 12.16 + "--es-module-specifier-resolution": "--experimental-specifier-resolution", + "--experimental-policy": String, + "--conditions": [String], + "--pending-deprecation": Boolean, + "--experimental-json-modules": Boolean, + "--experimental-wasm-modules": Boolean + }, { + argv: argv3, + permissive: true + }); + } + function getNodeOptionsEnvArgv() { + const errors = []; + const envArgv = ParseNodeOptionsEnvVar(process.env.NODE_OPTIONS || "", errors); + if (errors.length !== 0) { + } + return envArgv; + } + function ParseNodeOptionsEnvVar(node_options, errors) { + const env_argv = []; + let is_in_string = false; + let will_start_new_arg = true; + for (let index4 = 0; index4 < node_options.length; ++index4) { + let c7 = node_options[index4]; + if (c7 === "\\" && is_in_string) { + if (index4 + 1 === node_options.length) { + errors.push("invalid value for NODE_OPTIONS (invalid escape)\n"); + return env_argv; + } else { + c7 = node_options[++index4]; + } + } else if (c7 === " " && !is_in_string) { + will_start_new_arg = true; + continue; + } else if (c7 === '"') { + is_in_string = !is_in_string; + continue; + } + if (will_start_new_arg) { + env_argv.push(c7); + will_start_new_arg = false; + } else { + env_argv[env_argv.length - 1] += c7; + } + } + if (is_in_string) { + errors.push("invalid value for NODE_OPTIONS (unterminated string)\n"); + } + return env_argv; + } + function getOptionValuesFromOtherEnvVars() { + const options2 = {}; + if (process.env.NODE_PENDING_DEPRECATION === "1") { + options2["--pending-deprecation"] = true; + } + return options2; + } + } +}); + +// node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +var require_node_internal_modules_cjs_helpers = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { + ArrayPrototypeForEach, + ObjectDefineProperty, + ObjectPrototypeHasOwnProperty, + SafeSet, + StringPrototypeIncludes, + StringPrototypeStartsWith + } = require_node_primordials(); + var { getOptionValue } = require_node_options(); + var userConditions = getOptionValue("--conditions"); + var noAddons = getOptionValue("--no-addons"); + var addonConditions = noAddons ? [] : ["node-addons"]; + var cjsConditions = new SafeSet([ + "require", + "node", + ...addonConditions, + ...userConditions + ]); + function addBuiltinLibsToObject(object, dummyModuleName) { + const Module = (init_module(), __toCommonJS(module_exports)).Module; + const { builtinModules: builtinModules2 } = Module; + const dummyModule = new Module(dummyModuleName); + ArrayPrototypeForEach(builtinModules2, (name2) => { + if (StringPrototypeStartsWith(name2, "_") || StringPrototypeIncludes(name2, "/") || ObjectPrototypeHasOwnProperty(object, name2)) { + return; + } + const setReal = (val) => { + delete object[name2]; + object[name2] = val; + }; + ObjectDefineProperty(object, name2, { + get: () => { + const lib2 = (dummyModule.require || __require)(name2); + delete object[name2]; + ObjectDefineProperty(object, name2, { + get: () => lib2, + set: setReal, + configurable: true, + enumerable: false + }); + return lib2; + }, + set: setReal, + configurable: true, + enumerable: false + }); + }); + } + exports28.addBuiltinLibsToObject = addBuiltinLibsToObject; + exports28.cjsConditions = cjsConditions; + } +}); + +// node_modules/ts-node/dist-raw/node-internal-errors.js +var require_node_internal_errors = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-errors.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + exports28.codes = { + ERR_INPUT_TYPE_NOT_ALLOWED: createErrorCtor(joinArgs("ERR_INPUT_TYPE_NOT_ALLOWED")), + ERR_INVALID_ARG_VALUE: createErrorCtor(joinArgs("ERR_INVALID_ARG_VALUE")), + ERR_INVALID_MODULE_SPECIFIER: createErrorCtor(joinArgs("ERR_INVALID_MODULE_SPECIFIER")), + ERR_INVALID_PACKAGE_CONFIG: createErrorCtor(joinArgs("ERR_INVALID_PACKAGE_CONFIG")), + ERR_INVALID_PACKAGE_TARGET: createErrorCtor(joinArgs("ERR_INVALID_PACKAGE_TARGET")), + ERR_MANIFEST_DEPENDENCY_MISSING: createErrorCtor(joinArgs("ERR_MANIFEST_DEPENDENCY_MISSING")), + ERR_MODULE_NOT_FOUND: createErrorCtor((path3, base, type3 = "package") => { + return `Cannot find ${type3} '${path3}' imported from ${base}`; + }), + ERR_PACKAGE_IMPORT_NOT_DEFINED: createErrorCtor(joinArgs("ERR_PACKAGE_IMPORT_NOT_DEFINED")), + ERR_PACKAGE_PATH_NOT_EXPORTED: createErrorCtor(joinArgs("ERR_PACKAGE_PATH_NOT_EXPORTED")), + ERR_UNSUPPORTED_DIR_IMPORT: createErrorCtor(joinArgs("ERR_UNSUPPORTED_DIR_IMPORT")), + ERR_UNSUPPORTED_ESM_URL_SCHEME: createErrorCtor(joinArgs("ERR_UNSUPPORTED_ESM_URL_SCHEME")), + ERR_UNKNOWN_FILE_EXTENSION: createErrorCtor(joinArgs("ERR_UNKNOWN_FILE_EXTENSION")) + }; + function joinArgs(name2) { + return (...args) => { + return [name2, ...args].join(" "); + }; + } + function createErrorCtor(errorMessageCreator) { + return class CustomError extends Error { + constructor(...args) { + super(errorMessageCreator(...args)); + } + }; + } + exports28.createErrRequireEsm = createErrRequireEsm; + function createErrRequireEsm(filename, parentPath, packageJsonPath) { + const code = "ERR_REQUIRE_ESM"; + const err = new Error(getErrRequireEsmMessage(filename, parentPath, packageJsonPath)); + err.name = `Error [${code}]`; + err.stack; + Object.defineProperty(err, "name", { + value: "Error", + enumerable: false, + writable: true, + configurable: true + }); + err.code = code; + return err; + } + function getErrRequireEsmMessage(filename, parentPath = null, packageJsonPath = null) { + const ext = path2.extname(filename); + let msg = `Must use import to load ES Module: ${filename}`; + if (parentPath && packageJsonPath) { + const path3 = (init_path(), __toCommonJS(path_exports)); + const basename2 = path3.basename(filename) === path3.basename(parentPath) ? filename : path3.basename(filename); + msg += ` +require() of ES modules is not supported. +require() of ${filename} ${parentPath ? `from ${parentPath} ` : ""}is an ES module file as it is a ${ext} file whose nearest parent package.json contains "type": "module" which defines all ${ext} files in that package scope as ES modules. +Instead change the requiring code to use import(), or remove "type": "module" from ${packageJsonPath}. +`; + return msg; + } + return msg; + } + } +}); + +// node_modules/ts-node/dist-raw/node-internal-constants.js +var require_node_internal_constants = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-constants.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = { + CHAR_FORWARD_SLASH: 47 + /* / */ + }; + } +}); + +// node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +var require_node_internal_modules_cjs_loader = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypePush, + JSONParse, + ObjectKeys, + RegExpPrototypeTest, + SafeMap, + SafeWeakMap, + StringPrototypeCharCodeAt, + StringPrototypeEndsWith, + StringPrototypeLastIndexOf, + StringPrototypeIndexOf, + StringPrototypeMatch, + StringPrototypeSlice, + StringPrototypeStartsWith + } = require_node_primordials(); + var { NativeModule } = require_node_nativemodule(); + var { pathToFileURL: pathToFileURL3, fileURLToPath: fileURLToPath3 } = (init_url(), __toCommonJS(url_exports)); + var fs = (init_fs(), __toCommonJS(fs_exports)); + var path2 = (init_path(), __toCommonJS(path_exports)); + var { sep: sep2 } = path2; + var { internalModuleStat } = require_node_internalBinding_fs(); + var packageJsonReader = require_node_internal_modules_package_json_reader(); + var { + cjsConditions + } = require_node_internal_modules_cjs_helpers(); + var { getOptionValue } = require_node_options(); + var preserveSymlinks = getOptionValue("--preserve-symlinks"); + var preserveSymlinksMain = getOptionValue("--preserve-symlinks-main"); + var { normalizeSlashes } = require_util6(); + var { createErrRequireEsm } = require_node_internal_errors(); + var { + codes: { + ERR_INVALID_MODULE_SPECIFIER + } + } = require_node_internal_errors(); + var { + CHAR_FORWARD_SLASH: CHAR_FORWARD_SLASH3 + } = require_node_internal_constants(); + var Module = (init_module(), __toCommonJS(module_exports)); + var isWindows3 = process.platform === "win32"; + var statCache = null; + function stat2(filename) { + filename = path2.toNamespacedPath(filename); + if (statCache !== null) { + const result3 = statCache.get(filename); + if (result3 !== void 0) + return result3; + } + const result2 = internalModuleStat(filename); + if (statCache !== null && result2 >= 0) { + statCache.set(filename, result2); + } + return result2; + } + var moduleParentCache = new SafeWeakMap(); + var packageJsonCache = new SafeMap(); + function readPackage(requestPath) { + const jsonPath = path2.resolve(requestPath, "package.json"); + const existing = packageJsonCache.get(jsonPath); + if (existing !== void 0) + return existing; + const result2 = packageJsonReader.read(jsonPath); + const json2 = result2.containsKeys === false ? "{}" : result2.string; + if (json2 === void 0) { + packageJsonCache.set(jsonPath, false); + return false; + } + try { + const parsed = JSONParse(json2); + const filtered = { + name: parsed.name, + main: parsed.main, + exports: parsed.exports, + imports: parsed.imports, + type: parsed.type + }; + packageJsonCache.set(jsonPath, filtered); + return filtered; + } catch (e10) { + e10.path = jsonPath; + e10.message = "Error parsing " + jsonPath + ": " + e10.message; + throw e10; + } + } + function readPackageScope(checkPath) { + const rootSeparatorIndex = StringPrototypeIndexOf(checkPath, sep2); + let separatorIndex; + do { + separatorIndex = StringPrototypeLastIndexOf(checkPath, sep2); + checkPath = StringPrototypeSlice(checkPath, 0, separatorIndex); + if (StringPrototypeEndsWith(checkPath, sep2 + "node_modules")) + return false; + const pjson = readPackage(checkPath + sep2); + if (pjson) + return { + data: pjson, + path: checkPath + }; + } while (separatorIndex > rootSeparatorIndex); + return false; + } + function createCjsLoader(opts) { + const { nodeEsmResolver, preferTsExts } = opts; + const { replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx } = opts.extensions; + const { + encodedSepRegEx, + packageExportsResolve, + packageImportsResolve + } = nodeEsmResolver; + function tryPackage(requestPath, exts, isMain, originalPath) { + const tmp = readPackage(requestPath); + const pkg = tmp != null ? tmp.main : void 0; + if (!pkg) { + return tryExtensions(path2.resolve(requestPath, "index"), exts, isMain); + } + const filename = path2.resolve(requestPath, pkg); + let actual = tryReplacementExtensions(filename, isMain) || tryFile(filename, isMain) || tryExtensions(filename, exts, isMain) || tryExtensions(path2.resolve(filename, "index"), exts, isMain); + if (actual === false) { + actual = tryExtensions(path2.resolve(requestPath, "index"), exts, isMain); + if (!actual) { + const err = new Error( + `Cannot find module '${filename}'. Please verify that the package.json has a valid "main" entry` + ); + err.code = "MODULE_NOT_FOUND"; + err.path = path2.resolve(requestPath, "package.json"); + err.requestPath = originalPath; + throw err; + } else { + const jsonPath = path2.resolve(requestPath, "package.json"); + process.emitWarning( + `Invalid 'main' field in '${jsonPath}' of '${pkg}'. Please either fix that or report it to the module author`, + "DeprecationWarning", + "DEP0128" + ); + } + } + return actual; + } + const realpathCache = new SafeMap(); + function tryFile(requestPath, isMain) { + const rc = stat2(requestPath); + if (rc !== 0) + return; + if (preserveSymlinks && !isMain) { + return path2.resolve(requestPath); + } + return toRealPath(requestPath); + } + function toRealPath(requestPath) { + return fs.realpathSync(requestPath, { + // [internalFS.realpathCacheKey]: realpathCache + }); + } + function statReplacementExtensions(p7) { + const lastDotIndex = p7.lastIndexOf("."); + if (lastDotIndex >= 0) { + const ext = p7.slice(lastDotIndex); + if (ext === ".js" || ext === ".jsx" || ext === ".mjs" || ext === ".cjs") { + const pathnameWithoutExtension = p7.slice(0, lastDotIndex); + const replacementExts = ext === ".js" ? replacementsForJs : ext === ".jsx" ? replacementsForJsx : ext === ".mjs" ? replacementsForMjs : replacementsForCjs; + for (let i7 = 0; i7 < replacementExts.length; i7++) { + const filename = pathnameWithoutExtension + replacementExts[i7]; + const rc = stat2(filename); + if (rc === 0) { + return [rc, filename]; + } + } + } + } + return [stat2(p7), p7]; + } + function tryReplacementExtensions(p7, isMain) { + const lastDotIndex = p7.lastIndexOf("."); + if (lastDotIndex >= 0) { + const ext = p7.slice(lastDotIndex); + if (ext === ".js" || ext === ".jsx" || ext === ".mjs" || ext === ".cjs") { + const pathnameWithoutExtension = p7.slice(0, lastDotIndex); + const replacementExts = ext === ".js" ? replacementsForJs : ext === ".jsx" ? replacementsForJsx : ext === ".mjs" ? replacementsForMjs : replacementsForCjs; + for (let i7 = 0; i7 < replacementExts.length; i7++) { + const filename = tryFile(pathnameWithoutExtension + replacementExts[i7], isMain); + if (filename) { + return filename; + } + } + } + } + return false; + } + function tryExtensions(p7, exts, isMain) { + for (let i7 = 0; i7 < exts.length; i7++) { + const filename = tryFile(p7 + exts[i7], isMain); + if (filename) { + return filename; + } + } + return false; + } + function trySelfParentPath(parent2) { + if (!parent2) + return false; + if (parent2.filename) { + return parent2.filename; + } else if (parent2.id === "" || parent2.id === "internal/preload") { + try { + return process.cwd() + path2.sep; + } catch { + return false; + } + } + } + function trySelf(parentPath, request3) { + if (!parentPath) + return false; + const { data: pkg, path: pkgPath } = readPackageScope(parentPath) || {}; + if (!pkg || pkg.exports === void 0) + return false; + if (typeof pkg.name !== "string") + return false; + let expansion; + if (request3 === pkg.name) { + expansion = "."; + } else if (StringPrototypeStartsWith(request3, `${pkg.name}/`)) { + expansion = "." + StringPrototypeSlice(request3, pkg.name.length); + } else { + return false; + } + try { + return finalizeEsmResolution(packageExportsResolve( + pathToFileURL3(pkgPath + "/package.json"), + expansion, + pkg, + pathToFileURL3(parentPath), + cjsConditions + ).resolved, parentPath, pkgPath); + } catch (e10) { + if (e10.code === "ERR_MODULE_NOT_FOUND") + throw createEsmNotFoundErr(request3, pkgPath + "/package.json"); + throw e10; + } + } + const EXPORTS_PATTERN = /^((?:@[^/\\%]+\/)?[^./\\%][^/\\%]*)(\/.*)?$/; + function resolveExports(nmPath, request3) { + const { 1: name2, 2: expansion = "" } = StringPrototypeMatch(request3, EXPORTS_PATTERN) || []; + if (!name2) + return; + const pkgPath = path2.resolve(nmPath, name2); + const pkg = readPackage(pkgPath); + if (pkg != null && pkg.exports != null) { + try { + return finalizeEsmResolution(packageExportsResolve( + pathToFileURL3(pkgPath + "/package.json"), + "." + expansion, + pkg, + null, + cjsConditions + ).resolved, null, pkgPath); + } catch (e10) { + if (e10.code === "ERR_MODULE_NOT_FOUND") + throw createEsmNotFoundErr(request3, pkgPath + "/package.json"); + throw e10; + } + } + } + const hasModulePathCache = !!(init_module(), __toCommonJS(module_exports))._pathCache; + const Module_pathCache = /* @__PURE__ */ Object.create(null); + const Module_pathCache_get = hasModulePathCache ? (cacheKey) => Module._pathCache[cacheKey] : (cacheKey) => Module_pathCache[cacheKey]; + const Module_pathCache_set = hasModulePathCache ? (cacheKey, value2) => Module._pathCache[cacheKey] = value2 : (cacheKey) => Module_pathCache[cacheKey] = value; + const trailingSlashRegex = /(?:^|\/)\.?\.$/; + const Module_findPath = function _findPath(request3, paths, isMain) { + const absoluteRequest = path2.isAbsolute(request3); + if (absoluteRequest) { + paths = [""]; + } else if (!paths || paths.length === 0) { + return false; + } + const cacheKey = request3 + "\0" + ArrayPrototypeJoin(paths, "\0"); + const entry = Module_pathCache_get(cacheKey); + if (entry) + return entry; + let exts; + let trailingSlash = request3.length > 0 && StringPrototypeCharCodeAt(request3, request3.length - 1) === CHAR_FORWARD_SLASH3; + if (!trailingSlash) { + trailingSlash = RegExpPrototypeTest(trailingSlashRegex, request3); + } + for (let i7 = 0; i7 < paths.length; i7++) { + const curPath = paths[i7]; + if (curPath && stat2(curPath) < 1) + continue; + if (!absoluteRequest) { + const exportsResolved = resolveExports(curPath, request3); + if (exportsResolved) + return exportsResolved; + } + const _basePath = path2.resolve(curPath, request3); + let filename; + const [rc, basePath] = statReplacementExtensions(_basePath); + if (!trailingSlash) { + if (rc === 0) { + if (!isMain) { + if (preserveSymlinks) { + filename = path2.resolve(basePath); + } else { + filename = toRealPath(basePath); + } + } else if (preserveSymlinksMain) { + filename = path2.resolve(basePath); + } else { + filename = toRealPath(basePath); + } + } + if (!filename) { + if (exts === void 0) + exts = ObjectKeys(Module._extensions); + filename = tryExtensions(basePath, exts, isMain); + } + } + if (!filename && rc === 1) { + if (exts === void 0) + exts = ObjectKeys(Module._extensions); + filename = tryPackage(basePath, exts, isMain, request3); + } + if (filename) { + Module_pathCache_set(cacheKey, filename); + return filename; + } + } + return false; + }; + const Module_resolveFilename = function _resolveFilename(request3, parent2, isMain, options) { + if (StringPrototypeStartsWith(request3, "node:") || NativeModule.canBeRequiredByUsers(request3)) { + return request3; + } + let paths; + if (typeof options === "object" && options !== null) { + if (ArrayIsArray(options.paths)) { + const isRelative = StringPrototypeStartsWith(request3, "./") || StringPrototypeStartsWith(request3, "../") || (isWindows3 && StringPrototypeStartsWith(request3, ".\\") || StringPrototypeStartsWith(request3, "..\\")); + if (isRelative) { + paths = options.paths; + } else { + const fakeParent = new Module("", null); + paths = []; + for (let i7 = 0; i7 < options.paths.length; i7++) { + const path3 = options.paths[i7]; + fakeParent.paths = Module._nodeModulePaths(path3); + const lookupPaths = Module._resolveLookupPaths(request3, fakeParent); + for (let j6 = 0; j6 < lookupPaths.length; j6++) { + if (!ArrayPrototypeIncludes(paths, lookupPaths[j6])) + ArrayPrototypePush(paths, lookupPaths[j6]); + } + } + } + } else if (options.paths === void 0) { + paths = Module._resolveLookupPaths(request3, parent2); + } else { + throw new ERR_INVALID_ARG_VALUE("options.paths", options.paths); + } + } else { + paths = Module._resolveLookupPaths(request3, parent2); + } + if (parent2 != null && parent2.filename) { + if (request3[0] === "#") { + const pkg = readPackageScope(parent2.filename) || {}; + if (pkg.data != null && pkg.data.imports != null) { + try { + return finalizeEsmResolution( + packageImportsResolve( + request3, + pathToFileURL3(parent2.filename), + cjsConditions + ), + parent2.filename, + pkg.path + ); + } catch (e10) { + if (e10.code === "ERR_MODULE_NOT_FOUND") + throw createEsmNotFoundErr(request3); + throw e10; + } + } + } + } + const parentPath = trySelfParentPath(parent2); + const selfResolved = trySelf(parentPath, request3); + if (selfResolved) { + const cacheKey = request3 + "\0" + (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, "\0")); + Module._pathCache[cacheKey] = selfResolved; + return selfResolved; + } + const filename = Module._findPath(request3, paths, isMain, false); + if (filename) + return filename; + const requireStack = []; + for (let cursor = parent2; cursor; cursor = moduleParentCache.get(cursor)) { + ArrayPrototypePush(requireStack, cursor.filename || cursor.id); + } + let message = `Cannot find module '${request3}'`; + if (requireStack.length > 0) { + message = message + "\nRequire stack:\n- " + ArrayPrototypeJoin(requireStack, "\n- "); + } + const err = new Error(message); + err.code = "MODULE_NOT_FOUND"; + err.requireStack = requireStack; + throw err; + }; + function finalizeEsmResolution(resolved, parentPath, pkgPath) { + if (RegExpPrototypeTest(encodedSepRegEx, resolved)) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved, + 'must not include encoded "/" or "\\" characters', + parentPath + ); + const filename = fileURLToPath3(resolved); + const actual = tryReplacementExtensions(filename) || tryFile(filename); + if (actual) + return actual; + const err = createEsmNotFoundErr( + filename, + path2.resolve(pkgPath, "package.json") + ); + throw err; + } + function createEsmNotFoundErr(request3, path3) { + const err = new Error(`Cannot find module '${request3}'`); + err.code = "MODULE_NOT_FOUND"; + if (path3) + err.path = path3; + return err; + } + return { + Module_findPath, + Module_resolveFilename + }; + } + function assertScriptCanLoadAsCJSImpl(service, module6, filename) { + const pkg = readPackageScope(filename); + const tsNodeClassification = service.moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizeSlashes(filename)); + if (tsNodeClassification.moduleType === "cjs") + return; + const lastDotIndex = filename.lastIndexOf("."); + const ext = lastDotIndex >= 0 ? filename.slice(lastDotIndex) : ""; + if ((ext === ".cts" || ext === ".cjs") && tsNodeClassification.moduleType === "auto") + return; + if (ext === ".mts" || ext === ".mjs" || tsNodeClassification.moduleType === "esm" || pkg && pkg.data && pkg.data.type === "module") { + const parentPath = module6.parent && module6.parent.filename; + const packageJsonPath = pkg ? path2.resolve(pkg.path, "package.json") : null; + throw createErrRequireEsm(filename, parentPath, packageJsonPath); + } + } + module5.exports = { + createCjsLoader, + assertScriptCanLoadAsCJSImpl, + readPackageScope + }; + } +}); + +// node_modules/ts-node/dist/node-module-type-classifier.js +var require_node_module_type_classifier = __commonJS({ + "node_modules/ts-node/dist/node-module-type-classifier.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.classifyModule = void 0; + var node_internal_modules_cjs_loader_1 = require_node_internal_modules_cjs_loader(); + function classifyModule(nativeFilename, isNodeModuleType) { + const lastDotIndex = nativeFilename.lastIndexOf("."); + const ext = lastDotIndex >= 0 ? nativeFilename.slice(lastDotIndex) : ""; + switch (ext) { + case ".cjs": + case ".cts": + return isNodeModuleType ? "nodecjs" : "cjs"; + case ".mjs": + case ".mts": + return isNodeModuleType ? "nodeesm" : "esm"; + } + if (isNodeModuleType) { + const packageScope = (0, node_internal_modules_cjs_loader_1.readPackageScope)(nativeFilename); + if (packageScope && packageScope.data.type === "module") + return "nodeesm"; + return "nodecjs"; + } + return void 0; + } + exports28.classifyModule = classifyModule; + } +}); + +// node_modules/ts-node/dist/file-extensions.js +var require_file_extensions = __commonJS({ + "node_modules/ts-node/dist/file-extensions.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getExtensions = void 0; + var util_1 = require_util6(); + var nodeEquivalents = /* @__PURE__ */ new Map([ + [".ts", ".js"], + [".tsx", ".js"], + [".jsx", ".js"], + [".mts", ".mjs"], + [".cts", ".cjs"] + ]); + var tsResolverEquivalents = /* @__PURE__ */ new Map([ + [".ts", [".js"]], + [".tsx", [".js", ".jsx"]], + [".mts", [".mjs"]], + [".cts", [".cjs"]] + ]); + var vanillaNodeExtensions = [ + ".js", + ".json", + ".node", + ".mjs", + ".cjs" + ]; + var nodeDoesNotUnderstand = [ + ".ts", + ".tsx", + ".jsx", + ".cts", + ".mts" + ]; + function getExtensions(config3, options, tsVersion) { + const tsSupportsMtsCtsExts = (0, util_1.versionGteLt)(tsVersion, "4.5.0"); + const requiresHigherTypescriptVersion = []; + if (!tsSupportsMtsCtsExts) + requiresHigherTypescriptVersion.push(".cts", ".cjs", ".mts", ".mjs"); + const allPossibleExtensionsSortedByPreference = Array.from(/* @__PURE__ */ new Set([ + ...options.preferTsExts ? nodeDoesNotUnderstand : [], + ...vanillaNodeExtensions, + ...nodeDoesNotUnderstand + ])); + const compiledJsUnsorted = [".ts"]; + const compiledJsxUnsorted = []; + if (config3.options.jsx) + compiledJsxUnsorted.push(".tsx"); + if (tsSupportsMtsCtsExts) + compiledJsUnsorted.push(".mts", ".cts"); + if (config3.options.allowJs) { + compiledJsUnsorted.push(".js"); + if (config3.options.jsx) + compiledJsxUnsorted.push(".jsx"); + if (tsSupportsMtsCtsExts) + compiledJsUnsorted.push(".mjs", ".cjs"); + } + const compiledUnsorted = [...compiledJsUnsorted, ...compiledJsxUnsorted]; + const compiled = allPossibleExtensionsSortedByPreference.filter((ext) => compiledUnsorted.includes(ext)); + const compiledNodeDoesNotUnderstand = nodeDoesNotUnderstand.filter((ext) => compiled.includes(ext)); + const r8 = allPossibleExtensionsSortedByPreference.filter((ext) => [...compiledUnsorted, ".js", ".mjs", ".cjs", ".mts", ".cts"].includes(ext)); + const replacementsForJs = r8.filter((ext) => [".js", ".jsx", ".ts", ".tsx"].includes(ext)); + const replacementsForJsx = r8.filter((ext) => [".jsx", ".tsx"].includes(ext)); + const replacementsForMjs = r8.filter((ext) => [".mjs", ".mts"].includes(ext)); + const replacementsForCjs = r8.filter((ext) => [".cjs", ".cts"].includes(ext)); + const replacementsForJsOrMjs = r8.filter((ext) => [".js", ".jsx", ".ts", ".tsx", ".mjs", ".mts"].includes(ext)); + const experimentalSpecifierResolutionAddsIfOmitted = Array.from(/* @__PURE__ */ new Set([...replacementsForJsOrMjs, ".json", ".node"])); + const legacyMainResolveAddsIfOmitted = Array.from(/* @__PURE__ */ new Set([...replacementsForJs, ".json", ".node"])); + return { + /** All file extensions we transform, ordered by resolution preference according to preferTsExts */ + compiled, + /** Resolved extensions that vanilla node will not understand; we should handle them */ + nodeDoesNotUnderstand, + /** Like the above, but only the ones we're compiling */ + compiledNodeDoesNotUnderstand, + /** + * Mapping from extensions understood by tsc to the equivalent for node, + * as far as getFormat is concerned. + */ + nodeEquivalents, + /** + * Mapping from extensions rejected by TSC in import specifiers, to the + * possible alternatives that TS's resolver will accept. + * + * When we allow users to opt-in to .ts extensions in import specifiers, TS's + * resolver requires us to replace the .ts extensions with .js alternatives. + * Otherwise, resolution fails. + * + * Note TS's resolver is only used by, and only required for, typechecking. + * This is separate from node's resolver, which we hook separately and which + * does not require this mapping. + */ + tsResolverEquivalents, + /** + * Extensions that we can support if the user upgrades their typescript version. + * Used when raising hints. + */ + requiresHigherTypescriptVersion, + /** + * --experimental-specifier-resolution=node will add these extensions. + */ + experimentalSpecifierResolutionAddsIfOmitted, + /** + * ESM loader will add these extensions to package.json "main" field + */ + legacyMainResolveAddsIfOmitted, + replacementsForMjs, + replacementsForCjs, + replacementsForJsx, + replacementsForJs + }; + } + exports28.getExtensions = getExtensions; + } +}); + +// node_modules/ts-node/dist/ts-transpile-module.js +var require_ts_transpile_module = __commonJS({ + "node_modules/ts-node/dist/ts-transpile-module.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createTsTranspileModule = void 0; + function createTsTranspileModule(ts, transpileOptions) { + const { createProgram, createSourceFile, getDefaultCompilerOptions, getImpliedNodeFormatForFile, fixupCompilerOptions, transpileOptionValueCompilerOptions, getNewLineCharacter, fileExtensionIs, normalizePath, Debug, toPath: toPath2, getSetExternalModuleIndicator, getEntries, addRange, hasProperty, getEmitScriptTarget, getDirectoryPath } = ts; + const compilerOptionsDiagnostics = []; + const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, compilerOptionsDiagnostics) : {}; + const defaultOptions9 = getDefaultCompilerOptions(); + for (const key in defaultOptions9) { + if (hasProperty(defaultOptions9, key) && options[key] === void 0) { + options[key] = defaultOptions9[key]; + } + } + for (const option of transpileOptionValueCompilerOptions) { + options[option.name] = option.transpileOptionValue; + } + options.suppressOutputPathCheck = true; + options.allowNonTsExtensions = true; + const newLine = getNewLineCharacter(options); + const compilerHost = { + getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : void 0, + writeFile: (name2, text) => { + if (fileExtensionIs(name2, ".map")) { + Debug.assertEqual(sourceMapText, void 0, "Unexpected multiple source map outputs, file:", name2); + sourceMapText = text; + } else { + Debug.assertEqual(outputText, void 0, "Unexpected multiple outputs, file:", name2); + outputText = text; + } + }, + getDefaultLibFileName: () => "lib.d.ts", + useCaseSensitiveFileNames: () => true, + getCanonicalFileName: (fileName) => fileName, + getCurrentDirectory: () => "", + getNewLine: () => newLine, + fileExists: (fileName) => fileName === inputFileName || fileName === packageJsonFileName, + readFile: (fileName) => fileName === packageJsonFileName ? `{"type": "${_packageJsonType}"}` : "", + directoryExists: () => true, + getDirectories: () => [] + }; + let inputFileName; + let packageJsonFileName; + let _packageJsonType; + let sourceFile; + let outputText; + let sourceMapText; + return transpileModule; + function transpileModule(input, transpileOptions2, packageJsonType = "commonjs") { + inputFileName = transpileOptions2.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts"); + packageJsonFileName = getDirectoryPath(inputFileName) + "/package.json"; + _packageJsonType = packageJsonType; + sourceFile = createSourceFile(inputFileName, input, { + languageVersion: getEmitScriptTarget(options), + impliedNodeFormat: getImpliedNodeFormatForFile( + toPath2(inputFileName, "", compilerHost.getCanonicalFileName), + /*cache*/ + void 0, + compilerHost, + options + ), + setExternalModuleIndicator: getSetExternalModuleIndicator(options) + }); + if (transpileOptions2.moduleName) { + sourceFile.moduleName = transpileOptions2.moduleName; + } + if (transpileOptions2.renamedDependencies) { + sourceFile.renamedDependencies = new Map(getEntries(transpileOptions2.renamedDependencies)); + } + outputText = void 0; + sourceMapText = void 0; + const program = createProgram([inputFileName], options, compilerHost); + const diagnostics = compilerOptionsDiagnostics.slice(); + if (transpileOptions.reportDiagnostics) { + addRange( + /*to*/ + diagnostics, + /*from*/ + program.getSyntacticDiagnostics(sourceFile) + ); + addRange( + /*to*/ + diagnostics, + /*from*/ + program.getOptionsDiagnostics() + ); + } + program.emit( + /*targetSourceFile*/ + void 0, + /*writeFile*/ + void 0, + /*cancellationToken*/ + void 0, + /*emitOnlyDtsFiles*/ + void 0, + transpileOptions.transformers + ); + if (outputText === void 0) + return Debug.fail("Output generation failed"); + return { outputText, diagnostics, sourceMapText }; + } + } + exports28.createTsTranspileModule = createTsTranspileModule; + } +}); + +// node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js +var empty_exports = {}; +__export(empty_exports, { + default: () => empty_default +}); +var empty_default; +var init_empty = __esm({ + "node_modules/esbuild-plugin-polyfill-node/polyfills/empty.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + empty_default = {}; + } +}); + +// node_modules/@jspm/core/nodelibs/browser/console.js +var console_exports = {}; +__export(console_exports, { + assert: () => assert3, + clear: () => clear, + context: () => context, + count: () => count, + countReset: () => countReset, + debug: () => debug, + default: () => exports27, + dir: () => dir, + dirxml: () => dirxml, + error: () => error, + group: () => group, + groupCollapsed: () => groupCollapsed, + groupEnd: () => groupEnd, + info: () => info, + log: () => log2, + memory: () => memory, + profile: () => profile, + profileEnd: () => profileEnd, + table: () => table, + time: () => time, + timeEnd: () => timeEnd, + timeStamp: () => timeStamp, + trace: () => trace, + warn: () => warn2 +}); +function dew24() { + if (_dewExec24) + return exports$120; + _dewExec24 = true; + var util2 = X2; + var assert4 = et2; + function now2() { + return (/* @__PURE__ */ new Date()).getTime(); + } + var slice2 = Array.prototype.slice; + var console2; + var times2 = {}; + if (typeof _global12 !== "undefined" && _global12.console) { + console2 = _global12.console; + } else if (typeof window !== "undefined" && window.console) { + console2 = window.console; + } else { + console2 = {}; + } + var functions2 = [[log3, "log"], [info2, "info"], [warn3, "warn"], [error2, "error"], [time2, "time"], [timeEnd2, "timeEnd"], [trace2, "trace"], [dir2, "dir"], [consoleAssert, "assert"]]; + for (var i7 = 0; i7 < functions2.length; i7++) { + var tuple = functions2[i7]; + var f8 = tuple[0]; + var name2 = tuple[1]; + if (!console2[name2]) { + console2[name2] = f8; + } + } + exports$120 = console2; + function log3() { + } + function info2() { + console2.log.apply(console2, arguments); + } + function warn3() { + console2.log.apply(console2, arguments); + } + function error2() { + console2.warn.apply(console2, arguments); + } + function time2(label) { + times2[label] = now2(); + } + function timeEnd2(label) { + var time3 = times2[label]; + if (!time3) { + throw new Error("No such label: " + label); + } + delete times2[label]; + var duration = now2() - time3; + console2.log(label + ": " + duration + "ms"); + } + function trace2() { + var err = new Error(); + err.name = "Trace"; + err.message = util2.format.apply(null, arguments); + console2.error(err.stack); + } + function dir2(object) { + console2.log(util2.inspect(object) + "\n"); + } + function consoleAssert(expression) { + if (!expression) { + var arr = slice2.call(arguments, 1); + assert4.ok(false, util2.format.apply(null, arr)); + } + } + return exports$120; +} +var exports$120, _dewExec24, _global12, exports27, assert3, clear, context, count, countReset, debug, dir, dirxml, error, group, groupCollapsed, groupEnd, info, log2, memory, profile, profileEnd, table, time, timeEnd, timeStamp, trace, warn2; +var init_console = __esm({ + "node_modules/@jspm/core/nodelibs/browser/console.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + init_chunk_CbQqNoLO(); + init_chunk_CjPlbOtt(); + init_chunk_D3uu3VYh(); + exports$120 = {}; + _dewExec24 = false; + _global12 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : globalThis; + exports27 = dew24(); + assert3 = exports27.assert; + clear = exports27.clear; + context = exports27.context; + count = exports27.count; + countReset = exports27.countReset; + debug = exports27.debug; + dir = exports27.dir; + dirxml = exports27.dirxml; + error = exports27.error; + group = exports27.group; + groupCollapsed = exports27.groupCollapsed; + groupEnd = exports27.groupEnd; + info = exports27.info; + log2 = exports27.log; + memory = exports27.memory; + profile = exports27.profile; + profileEnd = exports27.profileEnd; + table = exports27.table; + time = exports27.time; + timeEnd = exports27.timeEnd; + timeStamp = exports27.timeStamp; + trace = exports27.trace; + warn2 = exports27.warn; + } +}); + +// node_modules/acorn/dist/acorn.js +var require_acorn = __commonJS({ + "node_modules/acorn/dist/acorn.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.acorn = {})); + })(exports28, function(exports29) { + "use strict"; + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; + var nonASCIIidentifierChars = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65"; + var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + var keywords$1 = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" + }; + var keywordRelationalOperator = /^in(stanceof)?$/; + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + function isInAstralSet(code, set4) { + var pos = 65536; + for (var i8 = 0; i8 < set4.length; i8 += 2) { + pos += set4[i8]; + if (pos > code) { + return false; + } + pos += set4[i8 + 1]; + if (pos >= code) { + return true; + } + } + return false; + } + function isIdentifierStart(code, astral) { + if (code < 65) { + return code === 36; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes); + } + function isIdentifierChar(code, astral) { + if (code < 48) { + return code === 36; + } + if (code < 58) { + return true; + } + if (code < 65) { + return false; + } + if (code < 91) { + return true; + } + if (code < 97) { + return code === 95; + } + if (code < 123) { + return true; + } + if (code <= 65535) { + return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); + } + if (astral === false) { + return false; + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); + } + var TokenType = function TokenType2(label, conf) { + if (conf === void 0) + conf = {}; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + function binop(name2, prec) { + return new TokenType(name2, { beforeExpr: true, binop: prec }); + } + var beforeExpr = { beforeExpr: true }, startsExpr = { startsExpr: true }; + var keywords = {}; + function kw(name2, options) { + if (options === void 0) + options = {}; + options.keyword = name2; + return keywords[name2] = new TokenType(name2, options); + } + var types$1 = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + privateId: new TokenType("privateId", startsExpr), + eof: new TokenType("eof"), + // Punctuation token types. + bracketL: new TokenType("[", { beforeExpr: true, startsExpr: true }), + bracketR: new TokenType("]"), + braceL: new TokenType("{", { beforeExpr: true, startsExpr: true }), + braceR: new TokenType("}"), + parenL: new TokenType("(", { beforeExpr: true, startsExpr: true }), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", { beforeExpr: true, startsExpr: true }), + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + eq: new TokenType("=", { beforeExpr: true, isAssign: true }), + assign: new TokenType("_=", { beforeExpr: true, isAssign: true }), + incDec: new TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), + prefix: new TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", { beforeExpr: true }), + coalesce: binop("??", 1), + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", { isLoop: true, beforeExpr: true }), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", { isLoop: true }), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", { isLoop: true }), + _with: kw("with"), + _new: kw("new", { beforeExpr: true, startsExpr: true }), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", { beforeExpr: true, binop: 7 }), + _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), + _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), + _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), + _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) + }; + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + function isNewLine(code) { + return code === 10 || code === 13 || code === 8232 || code === 8233; + } + function nextLineBreak(code, from, end) { + if (end === void 0) + end = code.length; + for (var i8 = from; i8 < end; i8++) { + var next = code.charCodeAt(i8); + if (isNewLine(next)) { + return i8 < end - 1 && next === 13 && code.charCodeAt(i8 + 1) === 10 ? i8 + 2 : i8 + 1; + } + } + return -1; + } + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + var ref = Object.prototype; + var hasOwnProperty27 = ref.hasOwnProperty; + var toString3 = ref.toString; + var hasOwn = Object.hasOwn || function(obj, propName2) { + return hasOwnProperty27.call(obj, propName2); + }; + var isArray3 = Array.isArray || function(obj) { + return toString3.call(obj) === "[object Array]"; + }; + var regexpCache = /* @__PURE__ */ Object.create(null); + function wordsRegexp(words2) { + return regexpCache[words2] || (regexpCache[words2] = new RegExp("^(?:" + words2.replace(/ /g, "|") + ")$")); + } + function codePointToString(code) { + if (code <= 65535) { + return String.fromCharCode(code); + } + code -= 65536; + return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320); + } + var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; + var Position = function Position2(line, col) { + this.line = line; + this.column = col; + }; + Position.prototype.offset = function offset(n7) { + return new Position(this.line, this.column + n7); + }; + var SourceLocation = function SourceLocation2(p7, start, end) { + this.start = start; + this.end = end; + if (p7.sourceFile !== null) { + this.source = p7.sourceFile; + } + }; + function getLineInfo(input, offset) { + for (var line = 1, cur = 0; ; ) { + var nextBreak = nextLineBreak(input, cur, offset); + if (nextBreak < 0) { + return new Position(line, offset - cur); + } + ++line; + cur = nextBreak; + } + } + var defaultOptions9 = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 + // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` + // (the latest version the library supports). This influences + // support for strict mode, the set of reserved words, and support + // for new syntax features. + ecmaVersion: null, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called when + // a semicolon is automatically inserted. It will be passed the + // position of the inserted semicolon as an offset, and if + // `locations` is enabled, it is given the location as a `{line, + // column}` object as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program, and an import.meta expression + // in a script isn't considered an error. + allowImportExportEverywhere: false, + // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022. + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: null, + // When enabled, super identifiers are not constrained to + // appearing in methods and do not raise an error when they appear elsewhere. + allowSuperOutsideMethod: null, + // When enabled, hashbang directive in the beginning of file is + // allowed and treated as a line comment. Enabled by default when + // `ecmaVersion` >= 2023. + allowHashBang: false, + // By default, the parser will verify that private properties are + // only used in places where they are valid and have been declared. + // Set this to false to turn such checks off. + checkPrivateFields: true, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + // When this option has an array as value, objects representing the + // comments are pushed to it. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; + var warnedAboutEcmaVersion = false; + function getOptions(opts) { + var options = {}; + for (var opt in defaultOptions9) { + options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions9[opt]; + } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } + if (options.allowReserved == null) { + options.allowReserved = options.ecmaVersion < 5; + } + if (!opts || opts.allowHashBang == null) { + options.allowHashBang = options.ecmaVersion >= 14; + } + if (isArray3(options.onToken)) { + var tokens = options.onToken; + options.onToken = function(token) { + return tokens.push(token); + }; + } + if (isArray3(options.onComment)) { + options.onComment = pushComment(options, options.onComment); + } + return options; + } + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start, + end + }; + if (options.locations) { + comment.loc = new SourceLocation(this, startLoc, endLoc); + } + if (options.ranges) { + comment.range = [start, end]; + } + array.push(comment); + }; + } + var SCOPE_TOP = 1, SCOPE_FUNCTION = 2, SCOPE_ASYNC = 4, SCOPE_GENERATOR = 8, SCOPE_ARROW = 16, SCOPE_SIMPLE_CATCH = 32, SCOPE_SUPER = 64, SCOPE_DIRECT_SUPER = 128, SCOPE_CLASS_STATIC_BLOCK = 256, SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK; + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0); + } + var BIND_NONE = 0, BIND_VAR = 1, BIND_LEXICAL = 2, BIND_FUNCTION = 3, BIND_SIMPLE_CATCH = 4, BIND_OUTSIDE = 5; + var Parser7 = function Parser8(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; + if (options.sourceType === "module") { + reserved += " await"; + } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + this.containsEsc = false; + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + this.type = types$1.eof; + this.value = null; + this.start = this.end = this.pos; + this.startLoc = this.endLoc = this.curPosition(); + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + this.context = this.initialContext(); + this.exprAllowed = true; + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + this.potentialArrowAt = -1; + this.potentialArrowInForAwait = false; + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + this.labels = []; + this.undefinedExports = /* @__PURE__ */ Object.create(null); + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") { + this.skipLineComment(2); + } + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + this.regexpState = null; + this.privateNameStack = []; + }; + var prototypeAccessors = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } }; + Parser7.prototype.parse = function parse18() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); + }; + prototypeAccessors.inFunction.get = function() { + return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0; + }; + prototypeAccessors.inGenerator.get = function() { + return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors.inAsync.get = function() { + return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit; + }; + prototypeAccessors.canAwait.get = function() { + for (var i8 = this.scopeStack.length - 1; i8 >= 0; i8--) { + var scope = this.scopeStack[i8]; + if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { + return false; + } + if (scope.flags & SCOPE_FUNCTION) { + return (scope.flags & SCOPE_ASYNC) > 0; + } + } + return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction; + }; + prototypeAccessors.allowSuper.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod; + }; + prototypeAccessors.allowDirectSuper.get = function() { + return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; + }; + prototypeAccessors.treatFunctionsAsVar.get = function() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + }; + prototypeAccessors.allowNewDotTarget.get = function() { + var ref2 = this.currentThisScope(); + var flags = ref2.flags; + var inClassFieldInit = ref2.inClassFieldInit; + return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit; + }; + prototypeAccessors.inClassStaticBlock.get = function() { + return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0; + }; + Parser7.extend = function extend3() { + var plugins = [], len = arguments.length; + while (len--) + plugins[len] = arguments[len]; + var cls = this; + for (var i8 = 0; i8 < plugins.length; i8++) { + cls = plugins[i8](cls); + } + return cls; + }; + Parser7.parse = function parse18(input, options) { + return new this(options, input).parse(); + }; + Parser7.parseExpressionAt = function parseExpressionAt2(input, pos, options) { + var parser3 = new this(options, input, pos); + parser3.nextToken(); + return parser3.parseExpression(); + }; + Parser7.tokenizer = function tokenizer2(input, options) { + return new this(options, input); + }; + Object.defineProperties(Parser7.prototype, prototypeAccessors); + var pp$9 = Parser7.prototype; + var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { + return false; + } + for (; ; ) { + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { + return false; + } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || lineBreak.test(spaceAfter[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="); + } + start += match[0].length; + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") { + start++; + } + } + }; + pp$9.eat = function(type3) { + if (this.type === type3) { + this.next(); + return true; + } else { + return false; + } + }; + pp$9.isContextual = function(name2) { + return this.type === types$1.name && this.value === name2 && !this.containsEsc; + }; + pp$9.eatContextual = function(name2) { + if (!this.isContextual(name2)) { + return false; + } + this.next(); + return true; + }; + pp$9.expectContextual = function(name2) { + if (!this.eatContextual(name2)) { + this.unexpected(); + } + }; + pp$9.canInsertSemicolon = function() { + return this.type === types$1.eof || this.type === types$1.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$9.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) { + this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + } + return true; + } + }; + pp$9.semicolon = function() { + if (!this.eat(types$1.semi) && !this.insertSemicolon()) { + this.unexpected(); + } + }; + pp$9.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) { + this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + } + if (!notNext) { + this.next(); + } + return true; + } + }; + pp$9.expect = function(type3) { + this.eat(type3) || this.unexpected(); + }; + pp$9.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + var DestructuringErrors = function DestructuringErrors2() { + this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1; + }; + pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { + return; + } + if (refDestructuringErrors.trailingComma > -1) { + this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); + } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { + this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); + } + }; + pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { + return false; + } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { + return shorthandAssign >= 0 || doubleProto >= 0; + } + if (shorthandAssign >= 0) { + this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); + } + if (doubleProto >= 0) { + this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); + } + }; + pp$9.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) { + this.raise(this.yieldPos, "Yield expression cannot be a default value"); + } + if (this.awaitPos) { + this.raise(this.awaitPos, "Await expression cannot be a default value"); + } + }; + pp$9.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") { + return this.isSimpleAssignTarget(expr.expression); + } + return expr.type === "Identifier" || expr.type === "MemberExpression"; + }; + var pp$8 = Parser7.prototype; + pp$8.parseTopLevel = function(node) { + var exports30 = /* @__PURE__ */ Object.create(null); + if (!node.body) { + node.body = []; + } + while (this.type !== types$1.eof) { + var stmt = this.parseStatement(null, true, exports30); + node.body.push(stmt); + } + if (this.inModule) { + for (var i8 = 0, list2 = Object.keys(this.undefinedExports); i8 < list2.length; i8 += 1) { + var name2 = list2[i8]; + this.raiseRecoverable(this.undefinedExports[name2].start, "Export '" + name2 + "' is not defined"); + } + } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program"); + }; + var loopLabel = { kind: "loop" }, switchLabel = { kind: "switch" }; + pp$8.isLet = function(context2) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh === 92) { + return true; + } + if (context2) { + return false; + } + if (nextCh === 123 || nextCh > 55295 && nextCh < 56320) { + return true; + } + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { + ++pos; + } + if (nextCh === 92 || nextCh > 55295 && nextCh < 56320) { + return true; + } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { + return true; + } + } + return false; + }; + pp$8.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) { + return false; + } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, after2; + return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after2 = this.input.charCodeAt(next + 8)) || after2 > 55295 && after2 < 56320)); + }; + pp$8.parseStatement = function(context2, topLevel, exports30) { + var starttype = this.type, node = this.startNode(), kind; + if (this.isLet(context2)) { + starttype = types$1._var; + kind = "let"; + } + switch (starttype) { + case types$1._break: + case types$1._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case types$1._debugger: + return this.parseDebuggerStatement(node); + case types$1._do: + return this.parseDoStatement(node); + case types$1._for: + return this.parseForStatement(node); + case types$1._function: + if (context2 && (this.strict || context2 !== "if" && context2 !== "label") && this.options.ecmaVersion >= 6) { + this.unexpected(); + } + return this.parseFunctionStatement(node, false, !context2); + case types$1._class: + if (context2) { + this.unexpected(); + } + return this.parseClass(node, true); + case types$1._if: + return this.parseIfStatement(node); + case types$1._return: + return this.parseReturnStatement(node); + case types$1._switch: + return this.parseSwitchStatement(node); + case types$1._throw: + return this.parseThrowStatement(node); + case types$1._try: + return this.parseTryStatement(node); + case types$1._const: + case types$1._var: + kind = kind || this.value; + if (context2 && kind !== "var") { + this.unexpected(); + } + return this.parseVarStatement(node, kind); + case types$1._while: + return this.parseWhileStatement(node); + case types$1._with: + return this.parseWithStatement(node); + case types$1.braceL: + return this.parseBlock(true, node); + case types$1.semi: + return this.parseEmptyStatement(node); + case types$1._export: + case types$1._import: + if (this.options.ecmaVersion > 10 && starttype === types$1._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) { + return this.parseExpressionStatement(node, this.parseExpression()); + } + } + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) { + this.raise(this.start, "'import' and 'export' may only appear at the top level"); + } + if (!this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + } + return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports30); + default: + if (this.isAsyncFunction()) { + if (context2) { + this.unexpected(); + } + this.next(); + return this.parseFunctionStatement(node, true, !context2); + } + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) { + return this.parseLabeledStatement(node, maybeName, expr, context2); + } else { + return this.parseExpressionStatement(node, expr); + } + } + }; + pp$8.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.label = null; + } else if (this.type !== types$1.name) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + var i8 = 0; + for (; i8 < this.labels.length; ++i8) { + var lab = this.labels[i8]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { + break; + } + if (node.label && isBreak) { + break; + } + } + } + if (i8 === this.labels.length) { + this.raise(node.start, "Unsyntactic " + keyword); + } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + }; + pp$8.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + }; + pp$8.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types$1._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) { + this.eat(types$1.semi); + } else { + this.semicolon(); + } + return this.finishNode(node, "DoWhileStatement"); + }; + pp$8.parseForStatement = function(node) { + this.next(); + var awaitAt = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types$1.parenL); + if (this.type === types$1.semi) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + var isLet = this.isLet(); + if (this.type === types$1._var || this.type === types$1._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + return this.parseForIn(node, init$1); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init$1); + } + var startsWithLet = this.isContextual("let"), isForOf = false; + var refDestructuringErrors = new DestructuringErrors(); + var init2 = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types$1._in) { + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + } else { + node.await = awaitAt > -1; + } + } + if (startsWithLet && isForOf) { + this.raise(init2.start, "The left-hand side of a for-of loop may not start with 'let'."); + } + this.toAssignable(init2, false, refDestructuringErrors); + this.checkLValPattern(init2); + return this.parseForIn(node, init2); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init2); + }; + pp$8.parseFunctionStatement = function(node, isAsync2, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync2); + }; + pp$8.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement"); + }; + pp$8.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.start, "'return' outside of function"); + } + this.next(); + if (this.eat(types$1.semi) || this.insertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + }; + pp$8.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types$1.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + var cur; + for (var sawDefault = false; this.type !== types$1.braceR; ) { + if (this.type === types$1._case || this.type === types$1._default) { + var isCase = this.type === types$1._case; + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); + } + sawDefault = true; + cur.test = null; + } + this.expect(types$1.colon); + } else { + if (!cur) { + this.unexpected(); + } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { + this.finishNode(cur, "SwitchCase"); + } + this.next(); + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + }; + pp$8.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) { + this.raise(this.lastTokEnd, "Illegal newline after throw"); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + }; + var empty$1 = []; + pp$8.parseCatchClauseParam = function() { + var param = this.parseBindingAtom(); + var simple = param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + return param; + }; + pp$8.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types$1._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types$1.parenL)) { + clause.param = this.parseCatchClauseParam(); + } else { + if (this.options.ecmaVersion < 10) { + this.unexpected(); + } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + return this.finishNode(node, "TryStatement"); + }; + pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) { + this.next(); + this.parseVar(node, false, kind, allowMissingInitializer); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + }; + pp$8.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); + }; + pp$8.parseWithStatement = function(node) { + if (this.strict) { + this.raise(this.start, "'with' in strict mode"); + } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement"); + }; + pp$8.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + }; + pp$8.parseLabeledStatement = function(node, maybeName, expr, context2) { + for (var i$16 = 0, list2 = this.labels; i$16 < list2.length; i$16 += 1) { + var label = list2[i$16]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; + for (var i8 = this.labels.length - 1; i8 >= 0; i8--) { + var label$1 = this.labels[i8]; + if (label$1.statementStart === node.start) { + label$1.statementStart = this.start; + label$1.kind = kind; + } else { + break; + } + } + this.labels.push({ name: maybeName, kind, statementStart: this.start }); + node.body = this.parseStatement(context2 ? context2.indexOf("label") === -1 ? context2 + "label" : context2 : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + }; + pp$8.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + }; + pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if (createNewLexicalScope === void 0) + createNewLexicalScope = true; + if (node === void 0) + node = this.startNode(); + node.body = []; + this.expect(types$1.braceL); + if (createNewLexicalScope) { + this.enterScope(0); + } + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { + this.strict = false; + } + this.next(); + if (createNewLexicalScope) { + this.exitScope(); + } + return this.finishNode(node, "BlockStatement"); + }; + pp$8.parseFor = function(node, init2) { + node.init = init2; + this.expect(types$1.semi); + node.test = this.type === types$1.semi ? null : this.parseExpression(); + this.expect(types$1.semi); + node.update = this.type === types$1.parenR ? null : this.parseExpression(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); + }; + pp$8.parseForIn = function(node, init2) { + var isForIn = this.type === types$1._in; + this.next(); + if (init2.type === "VariableDeclaration" && init2.declarations[0].init != null && (!isForIn || this.options.ecmaVersion < 8 || this.strict || init2.kind !== "var" || init2.declarations[0].id.type !== "Identifier")) { + this.raise( + init2.start, + (isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer" + ); + } + node.left = init2; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types$1.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + }; + pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) { + node.declarations = []; + node.kind = kind; + for (; ; ) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types$1.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types$1.comma)) { + break; + } + } + return node; + }; + pp$8.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; + pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync2, forInit) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync2) { + if (this.type === types$1.star && statement & FUNC_HANGING_STATEMENT) { + this.unexpected(); + } + node.generator = this.eat(types$1.star); + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync2; + } + if (statement & FUNC_STATEMENT) { + node.id = statement & FUNC_NULLABLE_ID && this.type !== types$1.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) { + this.checkLValSimple(node.id, this.strict || node.generator || node.async ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); + } + } + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + if (!(statement & FUNC_STATEMENT)) { + node.id = this.type === types$1.name ? this.parseIdent() : null; + } + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, statement & FUNC_STATEMENT ? "FunctionDeclaration" : "FunctionExpression"); + }; + pp$8.parseFunctionParams = function(node) { + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + pp$8.parseClass = function(node, isStatement) { + this.next(); + var oldStrict = this.strict; + this.strict = true; + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var privateNameMap = this.enterClassBody(); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types$1.braceL); + while (this.type !== types$1.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { + this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); + } + hadConstructor = true; + } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) { + this.raiseRecoverable(element.key.start, "Identifier '#" + element.key.name + "' has already been declared"); + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + this.exitClassBody(); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + }; + pp$8.parseClassElement = function(constructorAllowsSuper) { + if (this.eat(types$1.semi)) { + return null; + } + var ecmaVersion2 = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; + var isAsync2 = false; + var kind = "method"; + var isStatic = false; + if (this.eatContextual("static")) { + if (ecmaVersion2 >= 13 && this.eat(types$1.braceL)) { + this.parseClassStaticBlock(node); + return node; + } + if (this.isClassElementNameStart() || this.type === types$1.star) { + isStatic = true; + } else { + keyName = "static"; + } + } + node.static = isStatic; + if (!keyName && ecmaVersion2 >= 8 && this.eatContextual("async")) { + if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { + isAsync2 = true; + } else { + keyName = "async"; + } + } + if (!keyName && (ecmaVersion2 >= 9 || !isAsync2) && this.eat(types$1.star)) { + isGenerator = true; + } + if (!keyName && !isAsync2 && !isGenerator) { + var lastValue = this.value; + if (this.eatContextual("get") || this.eatContextual("set")) { + if (this.isClassElementNameStart()) { + kind = lastValue; + } else { + keyName = lastValue; + } + } + } + if (keyName) { + node.computed = false; + node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc); + node.key.name = keyName; + this.finishNode(node.key, "Identifier"); + } else { + this.parseClassElementName(node); + } + if (ecmaVersion2 < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync2) { + var isConstructor = !node.static && checkKeyName(node, "constructor"); + var allowsDirectSuper = isConstructor && constructorAllowsSuper; + if (isConstructor && kind !== "method") { + this.raise(node.key.start, "Constructor can't have get/set modifier"); + } + node.kind = isConstructor ? "constructor" : kind; + this.parseClassMethod(node, isGenerator, isAsync2, allowsDirectSuper); + } else { + this.parseClassField(node); + } + return node; + }; + pp$8.isClassElementNameStart = function() { + return this.type === types$1.name || this.type === types$1.privateId || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword; + }; + pp$8.parseClassElementName = function(element) { + if (this.type === types$1.privateId) { + if (this.value === "constructor") { + this.raise(this.start, "Classes can't have an element named '#constructor'"); + } + element.computed = false; + element.key = this.parsePrivateIdent(); + } else { + this.parsePropertyName(element); + } + }; + pp$8.parseClassMethod = function(method2, isGenerator, isAsync2, allowsDirectSuper) { + var key = method2.key; + if (method2.kind === "constructor") { + if (isGenerator) { + this.raise(key.start, "Constructor can't be a generator"); + } + if (isAsync2) { + this.raise(key.start, "Constructor can't be an async method"); + } + } else if (method2.static && checkKeyName(method2, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + var value2 = method2.value = this.parseMethod(isGenerator, isAsync2, allowsDirectSuper); + if (method2.kind === "get" && value2.params.length !== 0) { + this.raiseRecoverable(value2.start, "getter should have no params"); + } + if (method2.kind === "set" && value2.params.length !== 1) { + this.raiseRecoverable(value2.start, "setter should have exactly one param"); + } + if (method2.kind === "set" && value2.params[0].type === "RestElement") { + this.raiseRecoverable(value2.params[0].start, "Setter cannot use rest params"); + } + return this.finishNode(method2, "MethodDefinition"); + }; + pp$8.parseClassField = function(field) { + if (checkKeyName(field, "constructor")) { + this.raise(field.key.start, "Classes can't have a field named 'constructor'"); + } else if (field.static && checkKeyName(field, "prototype")) { + this.raise(field.key.start, "Classes can't have a static field named 'prototype'"); + } + if (this.eat(types$1.eq)) { + var scope = this.currentThisScope(); + var inClassFieldInit = scope.inClassFieldInit; + scope.inClassFieldInit = true; + field.value = this.parseMaybeAssign(); + scope.inClassFieldInit = inClassFieldInit; + } else { + field.value = null; + } + this.semicolon(); + return this.finishNode(field, "PropertyDefinition"); + }; + pp$8.parseClassStaticBlock = function(node) { + node.body = []; + var oldLabels = this.labels; + this.labels = []; + this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); + while (this.type !== types$1.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + this.next(); + this.exitScope(); + this.labels = oldLabels; + return this.finishNode(node, "StaticBlock"); + }; + pp$8.parseClassId = function(node, isStatement) { + if (this.type === types$1.name) { + node.id = this.parseIdent(); + if (isStatement) { + this.checkLValSimple(node.id, BIND_LEXICAL, false); + } + } else { + if (isStatement === true) { + this.unexpected(); + } + node.id = null; + } + }; + pp$8.parseClassSuper = function(node) { + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; + }; + pp$8.enterClassBody = function() { + var element = { declared: /* @__PURE__ */ Object.create(null), used: [] }; + this.privateNameStack.push(element); + return element.declared; + }; + pp$8.exitClassBody = function() { + var ref2 = this.privateNameStack.pop(); + var declared = ref2.declared; + var used = ref2.used; + if (!this.options.checkPrivateFields) { + return; + } + var len = this.privateNameStack.length; + var parent2 = len === 0 ? null : this.privateNameStack[len - 1]; + for (var i8 = 0; i8 < used.length; ++i8) { + var id = used[i8]; + if (!hasOwn(declared, id.name)) { + if (parent2) { + parent2.used.push(id); + } else { + this.raiseRecoverable(id.start, "Private field '#" + id.name + "' must be declared in an enclosing class"); + } + } + } + }; + function isPrivateNameConflicted(privateNameMap, element) { + var name2 = element.key.name; + var curr = privateNameMap[name2]; + var next = "true"; + if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) { + next = (element.static ? "s" : "i") + element.kind; + } + if (curr === "iget" && next === "iset" || curr === "iset" && next === "iget" || curr === "sget" && next === "sset" || curr === "sset" && next === "sget") { + privateNameMap[name2] = "true"; + return false; + } else if (!curr) { + privateNameMap[name2] = next; + return false; + } else { + return true; + } + } + function checkKeyName(node, name2) { + var computed = node.computed; + var key = node.key; + return !computed && (key.type === "Identifier" && key.name === name2 || key.type === "Literal" && key.value === name2); + } + pp$8.parseExportAllDeclaration = function(node, exports30) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports30, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + }; + pp$8.parseExport = function(node, exports30) { + this.next(); + if (this.eat(types$1.star)) { + return this.parseExportAllDeclaration(node, exports30); + } + if (this.eat(types$1._default)) { + this.checkExport(exports30, "default", this.lastTokStart); + node.declaration = this.parseExportDefaultDeclaration(); + return this.finishNode(node, "ExportDefaultDeclaration"); + } + if (this.shouldParseExportStatement()) { + node.declaration = this.parseExportDeclaration(node); + if (node.declaration.type === "VariableDeclaration") { + this.checkVariableExport(exports30, node.declaration.declarations); + } else { + this.checkExport(exports30, node.declaration.id, node.declaration.id.start); + } + node.specifiers = []; + node.source = null; + } else { + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports30); + if (this.eatContextual("from")) { + if (this.type !== types$1.string) { + this.unexpected(); + } + node.source = this.parseExprAtom(); + } else { + for (var i8 = 0, list2 = node.specifiers; i8 < list2.length; i8 += 1) { + var spec = list2[i8]; + this.checkUnreserved(spec.local); + this.checkLocalExport(spec.local); + if (spec.local.type === "Literal") { + this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`."); + } + } + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); + }; + pp$8.parseExportDeclaration = function(node) { + return this.parseStatement(null); + }; + pp$8.parseExportDefaultDeclaration = function() { + var isAsync2; + if (this.type === types$1._function || (isAsync2 = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync2) { + this.next(); + } + return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync2); + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + return this.parseClass(cNode, "nullableID"); + } else { + var declaration = this.parseMaybeAssign(); + this.semicolon(); + return declaration; + } + }; + pp$8.checkExport = function(exports30, name2, pos) { + if (!exports30) { + return; + } + if (typeof name2 !== "string") { + name2 = name2.type === "Identifier" ? name2.name : name2.value; + } + if (hasOwn(exports30, name2)) { + this.raiseRecoverable(pos, "Duplicate export '" + name2 + "'"); + } + exports30[name2] = true; + }; + pp$8.checkPatternExport = function(exports30, pat) { + var type3 = pat.type; + if (type3 === "Identifier") { + this.checkExport(exports30, pat, pat.start); + } else if (type3 === "ObjectPattern") { + for (var i8 = 0, list2 = pat.properties; i8 < list2.length; i8 += 1) { + var prop = list2[i8]; + this.checkPatternExport(exports30, prop); + } + } else if (type3 === "ArrayPattern") { + for (var i$16 = 0, list$1 = pat.elements; i$16 < list$1.length; i$16 += 1) { + var elt = list$1[i$16]; + if (elt) { + this.checkPatternExport(exports30, elt); + } + } + } else if (type3 === "Property") { + this.checkPatternExport(exports30, pat.value); + } else if (type3 === "AssignmentPattern") { + this.checkPatternExport(exports30, pat.left); + } else if (type3 === "RestElement") { + this.checkPatternExport(exports30, pat.argument); + } + }; + pp$8.checkVariableExport = function(exports30, decls) { + if (!exports30) { + return; + } + for (var i8 = 0, list2 = decls; i8 < list2.length; i8 += 1) { + var decl = list2[i8]; + this.checkPatternExport(exports30, decl.id); + } + }; + pp$8.shouldParseExportStatement = function() { + return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction(); + }; + pp$8.parseExportSpecifier = function(exports30) { + var node = this.startNode(); + node.local = this.parseModuleExportName(); + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports30, + node.exported, + node.exported.start + ); + return this.finishNode(node, "ExportSpecifier"); + }; + pp$8.parseExportSpecifiers = function(exports30) { + var nodes = [], first = true; + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + nodes.push(this.parseExportSpecifier(exports30)); + } + return nodes; + }; + pp$8.parseImport = function(node) { + this.next(); + if (this.type === types$1.string) { + node.specifiers = empty$1; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + }; + pp$8.parseImportSpecifier = function() { + var node = this.startNode(); + node.imported = this.parseModuleExportName(); + if (this.eatContextual("as")) { + node.local = this.parseIdent(); + } else { + this.checkUnreserved(node.imported); + node.local = node.imported; + } + this.checkLValSimple(node.local, BIND_LEXICAL); + return this.finishNode(node, "ImportSpecifier"); + }; + pp$8.parseImportDefaultSpecifier = function() { + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + return this.finishNode(node, "ImportDefaultSpecifier"); + }; + pp$8.parseImportNamespaceSpecifier = function() { + var node = this.startNode(); + this.next(); + this.expectContextual("as"); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + return this.finishNode(node, "ImportNamespaceSpecifier"); + }; + pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + nodes.push(this.parseImportDefaultSpecifier()); + if (!this.eat(types$1.comma)) { + return nodes; + } + } + if (this.type === types$1.star) { + nodes.push(this.parseImportNamespaceSpecifier()); + return nodes; + } + this.expect(types$1.braceL); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + nodes.push(this.parseImportSpecifier()); + } + return nodes; + }; + pp$8.parseModuleExportName = function() { + if (this.options.ecmaVersion >= 13 && this.type === types$1.string) { + var stringLiteral = this.parseLiteral(this.value); + if (loneSurrogate.test(stringLiteral.value)) { + this.raise(stringLiteral.start, "An export name cannot include a lone surrogate."); + } + return stringLiteral; + } + return this.parseIdent(true); + }; + pp$8.adaptDirectivePrologue = function(statements) { + for (var i8 = 0; i8 < statements.length && this.isDirectiveCandidate(statements[i8]); ++i8) { + statements[i8].directive = statements[i8].expression.raw.slice(1, -1); + } + }; + pp$8.isDirectiveCandidate = function(statement) { + return this.options.ecmaVersion >= 5 && statement.type === "ExpressionStatement" && statement.expression.type === "Literal" && typeof statement.expression.value === "string" && // Reject parenthesized strings. + (this.input[statement.start] === '"' || this.input[statement.start] === "'"); + }; + var pp$7 = Parser7.prototype; + pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") { + this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); + } + break; + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + break; + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + for (var i8 = 0, list2 = node.properties; i8 < list2.length; i8 += 1) { + var prop = list2[i8]; + this.toAssignable(prop, isBinding); + if (prop.type === "RestElement" && (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break; + case "Property": + if (node.kind !== "init") { + this.raise(node.key.start, "Object pattern can't contain getter or setter"); + } + this.toAssignable(node.value, isBinding); + break; + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + this.toAssignableList(node.elements, isBinding); + break; + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") { + this.raise(node.argument.start, "Rest elements cannot have a default value"); + } + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + break; + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break; + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (!isBinding) { + break; + } + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { + this.checkPatternErrors(refDestructuringErrors, true); + } + return node; + }; + pp$7.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i8 = 0; i8 < end; i8++) { + var elt = exprList[i8]; + if (elt) { + this.toAssignable(elt, isBinding); + } + } + if (end) { + var last2 = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last2 && last2.type === "RestElement" && last2.argument.type !== "Identifier") { + this.unexpected(last2.argument.start); + } + } + return exprList; + }; + pp$7.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); + }; + pp$7.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion === 6 && this.type !== types$1.name) { + this.unexpected(); + } + node.argument = this.parseBindingAtom(); + return this.finishNode(node, "RestElement"); + }; + pp$7.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types$1.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types$1.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + case types$1.braceL: + return this.parseObj(true); + } + } + return this.parseIdent(); + }; + pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(types$1.comma); + } + if (allowEmpty && this.type === types$1.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === types$1.ellipsis) { + var rest2 = this.parseRestBinding(); + this.parseBindingListItem(rest2); + elts.push(rest2); + if (this.type === types$1.comma) { + this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); + } + this.expect(close); + break; + } else { + elts.push(this.parseAssignableListItem(allowModifiers)); + } + } + return elts; + }; + pp$7.parseAssignableListItem = function(allowModifiers) { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + return elem; + }; + pp$7.parseBindingListItem = function(param) { + return param; + }; + pp$7.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { + return left; + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); + }; + pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + var isBind = bindingType !== BIND_NONE; + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) { + this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") { + this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); + } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) { + this.raiseRecoverable(expr.start, "Argument name clash"); + } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { + this.declareName(expr.name, bindingType, expr.start); + } + } + break; + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break; + case "MemberExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding member expression"); + } + break; + case "ParenthesizedExpression": + if (isBind) { + this.raiseRecoverable(expr.start, "Binding parenthesized expression"); + } + return this.checkLValSimple(expr.expression, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); + } + }; + pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "ObjectPattern": + for (var i8 = 0, list2 = expr.properties; i8 < list2.length; i8 += 1) { + var prop = list2[i8]; + this.checkLValInnerPattern(prop, bindingType, checkClashes); + } + break; + case "ArrayPattern": + for (var i$16 = 0, list$1 = expr.elements; i$16 < list$1.length; i$16 += 1) { + var elem = list$1[i$16]; + if (elem) { + this.checkLValInnerPattern(elem, bindingType, checkClashes); + } + } + break; + default: + this.checkLValSimple(expr, bindingType, checkClashes); + } + }; + pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if (bindingType === void 0) + bindingType = BIND_NONE; + switch (expr.type) { + case "Property": + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break; + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break; + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break; + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } + }; + var TokContext = function TokContext2(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + var types3 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function(p7) { + return p7.tryReadTemplateToken(); + }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + var pp$6 = Parser7.prototype; + pp$6.initialContext = function() { + return [types3.b_stat]; + }; + pp$6.curContext = function() { + return this.context[this.context.length - 1]; + }; + pp$6.braceIsBlock = function(prevType) { + var parent2 = this.curContext(); + if (parent2 === types3.f_expr || parent2 === types3.f_stat) { + return true; + } + if (prevType === types$1.colon && (parent2 === types3.b_stat || parent2 === types3.b_expr)) { + return !parent2.isExpr; + } + if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) { + return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + } + if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) { + return true; + } + if (prevType === types$1.braceL) { + return parent2 === types3.b_stat; + } + if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) { + return false; + } + return !this.exprAllowed; + }; + pp$6.inGeneratorContext = function() { + for (var i8 = this.context.length - 1; i8 >= 1; i8--) { + var context2 = this.context[i8]; + if (context2.token === "function") { + return context2.generator; + } + } + return false; + }; + pp$6.updateContext = function(prevType) { + var update2, type3 = this.type; + if (type3.keyword && prevType === types$1.dot) { + this.exprAllowed = false; + } else if (update2 = type3.updateContext) { + update2.call(this, prevType); + } else { + this.exprAllowed = type3.beforeExpr; + } + }; + pp$6.overrideContext = function(tokenCtx) { + if (this.curContext() !== tokenCtx) { + this.context[this.context.length - 1] = tokenCtx; + } + }; + types$1.parenR.updateContext = types$1.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types3.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + types$1.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types3.b_stat : types3.b_expr); + this.exprAllowed = true; + }; + types$1.dollarBraceL.updateContext = function() { + this.context.push(types3.b_tmpl); + this.exprAllowed = true; + }; + types$1.parenL.updateContext = function(prevType) { + var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; + this.context.push(statementParens ? types3.p_stat : types3.p_expr); + this.exprAllowed = true; + }; + types$1.incDec.updateContext = function() { + }; + types$1._function.updateContext = types$1._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types$1._else && !(prevType === types$1.semi && this.curContext() !== types3.p_stat) && !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types3.b_stat)) { + this.context.push(types3.f_expr); + } else { + this.context.push(types3.f_stat); + } + this.exprAllowed = false; + }; + types$1.colon.updateContext = function() { + if (this.curContext().token === "function") { + this.context.pop(); + } + this.exprAllowed = true; + }; + types$1.backQuote.updateContext = function() { + if (this.curContext() === types3.q_tmpl) { + this.context.pop(); + } else { + this.context.push(types3.q_tmpl); + } + this.exprAllowed = false; + }; + types$1.star.updateContext = function(prevType) { + if (prevType === types$1._function) { + var index4 = this.context.length - 1; + if (this.context[index4] === types3.f_expr) { + this.context[index4] = types3.f_expr_gen; + } else { + this.context[index4] = types3.f_gen; + } + } + this.exprAllowed = true; + }; + types$1.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { + if (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) { + allowed = true; + } + } + this.exprAllowed = allowed; + }; + var pp$5 = Parser7.prototype; + pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") { + return; + } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) { + return; + } + var key = prop.key; + var name2; + switch (key.type) { + case "Identifier": + name2 = key.name; + break; + case "Literal": + name2 = String(key.value); + break; + default: + return; + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name2 === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) { + refDestructuringErrors.doubleProto = key.start; + } + } else { + this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); + } + } + propHash.proto = true; + } + return; + } + name2 = "$" + name2; + var other = propHash[name2]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) { + this.raiseRecoverable(key.start, "Redefinition of property"); + } + } else { + other = propHash[name2] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + pp$5.parseExpression = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); + if (this.type === types$1.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types$1.comma)) { + node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); + } + return this.finishNode(node, "SequenceExpression"); + } + return expr; + }; + pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { + return this.parseYield(forInit); + } else { + this.exprAllowed = false; + } + } + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + oldDoubleProto = refDestructuringErrors.doubleProto; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors(); + ownDestructuringErrors = true; + } + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types$1.parenL || this.type === types$1.name) { + this.potentialArrowAt = this.start; + this.potentialArrowInForAwait = forInit === "await"; + } + var left = this.parseMaybeConditional(forInit, refDestructuringErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startPos, startLoc); + } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + if (this.type === types$1.eq) { + left = this.toAssignable(left, false, refDestructuringErrors); + } + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= left.start) { + refDestructuringErrors.shorthandAssign = -1; + } + if (this.type === types$1.eq) { + this.checkLValPattern(left); + } else { + this.checkLValSimple(left); + } + node.left = left; + this.next(); + node.right = this.parseMaybeAssign(forInit); + if (oldDoubleProto > -1) { + refDestructuringErrors.doubleProto = oldDoubleProto; + } + return this.finishNode(node, "AssignmentExpression"); + } else { + if (ownDestructuringErrors) { + this.checkExpressionErrors(refDestructuringErrors, true); + } + } + if (oldParenAssign > -1) { + refDestructuringErrors.parenthesizedAssign = oldParenAssign; + } + if (oldTrailingComma > -1) { + refDestructuringErrors.trailingComma = oldTrailingComma; + } + return left; + }; + pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(forInit, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + if (this.eat(types$1.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types$1.colon); + node.alternate = this.parseMaybeAssign(forInit); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + }; + pp$5.parseExprOps = function(forInit, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit); + }; + pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { + var prec = this.type.binop; + if (prec != null && (!forInit || this.type !== types$1._in)) { + if (prec > minPrec) { + var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; + var coalesce = this.type === types$1.coalesce; + if (coalesce) { + prec = types$1.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if (logical && this.type === types$1.coalesce || coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND)) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit); + } + } + return left; + }; + pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { + if (right.type === "PrivateIdentifier") { + this.raise(right.start, "Private identifier can only be left side of binary expression"); + } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression"); + }; + pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && this.canAwait) { + expr = this.parseAwait(forInit); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update2 = this.type === types$1.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true, update2, forInit); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update2) { + this.checkLValSimple(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); + } else if (node.operator === "delete" && isPrivateFieldAccess(node.argument)) { + this.raiseRecoverable(node.start, "Private fields can not be deleted"); + } else { + sawUnary = true; + } + expr = this.finishNode(node, update2 ? "UpdateExpression" : "UnaryExpression"); + } else if (!sawUnary && this.type === types$1.privateId) { + if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { + this.unexpected(); + } + expr = this.parsePrivateIdent(); + if (this.type !== types$1._in) { + this.unexpected(); + } + } else { + expr = this.parseExprSubscripts(refDestructuringErrors, forInit); + if (this.checkExpressionErrors(refDestructuringErrors)) { + return expr; + } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLValSimple(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + if (!incDec && this.eat(types$1.starstar)) { + if (sawUnary) { + this.unexpected(this.lastTokStart); + } else { + return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false); + } + } else { + return expr; + } + }; + function isPrivateFieldAccess(node) { + return node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || node.type === "ChainExpression" && isPrivateFieldAccess(node.expression); + } + pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors, forInit); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") { + return expr; + } + var result2 = this.parseSubscripts(expr, startPos, startLoc, false, forInit); + if (refDestructuringErrors && result2.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result2.start) { + refDestructuringErrors.parenthesizedAssign = -1; + } + if (refDestructuringErrors.parenthesizedBind >= result2.start) { + refDestructuringErrors.parenthesizedBind = -1; + } + if (refDestructuringErrors.trailingComma >= result2.start) { + refDestructuringErrors.trailingComma = -1; + } + } + return result2; + }; + pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.potentialArrowAt === base.start; + var optionalChained = false; + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit); + if (element.optional) { + optionalChained = true; + } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element; + } + base = element; + } + }; + pp$5.shouldParseAsyncArrow = function() { + return !this.canInsertSemicolon() && this.eat(types$1.arrow); + }; + pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit); + }; + pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types$1.questionDot); + if (noCalls && optional) { + this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); + } + var computed = this.eat(types$1.bracketL); + if (computed || optional && this.type !== types$1.parenL && this.type !== types$1.backQuote || this.eat(types$1.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + if (computed) { + node.property = this.parseExpression(); + this.expect(types$1.bracketR); + } else if (this.type === types$1.privateId && base.type !== "Super") { + node.property = this.parsePrivateIdent(); + } else { + node.property = this.parseIdent(this.options.allowReserved !== "never"); + } + node.computed = !!computed; + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types$1.parenL)) { + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) { + this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); + } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types$1.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({ isTagged: true }); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base; + }; + pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) { + if (this.type === types$1.slash) { + this.readRegexp(); + } + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types$1._super: + if (!this.allowSuper) { + this.raise(this.start, "'super' keyword outside a method"); + } + node = this.startNode(); + this.next(); + if (this.type === types$1.parenL && !this.allowDirectSuper) { + this.raise(node.start, "super() call outside constructor of a subclass"); + } + if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) { + this.unexpected(); + } + return this.finishNode(node, "Super"); + case types$1._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case types$1.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { + this.overrideContext(types3.f_expr); + return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit); + } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types$1.arrow)) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit); + } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) { + this.unexpected(); + } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit); + } + } + return id; + case types$1.regexp: + var value2 = this.value; + node = this.parseLiteral(value2.value); + node.regex = { pattern: value2.pattern, flags: value2.flags }; + return node; + case types$1.num: + case types$1.string: + return this.parseLiteral(this.value); + case types$1._null: + case types$1._true: + case types$1._false: + node = this.startNode(); + node.value = this.type === types$1._null ? null : this.type === types$1._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + case types$1.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) { + refDestructuringErrors.parenthesizedAssign = start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = start; + } + } + return expr; + case types$1.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + case types$1.braceL: + this.overrideContext(types3.b_expr); + return this.parseObj(false, refDestructuringErrors); + case types$1._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0); + case types$1._class: + return this.parseClass(this.startNode(), false); + case types$1._new: + return this.parseNew(); + case types$1.backQuote: + return this.parseTemplate(); + case types$1._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport(forNew); + } else { + return this.unexpected(); + } + default: + return this.parseExprAtomDefault(); + } + }; + pp$5.parseExprAtomDefault = function() { + this.unexpected(); + }; + pp$5.parseExprImport = function(forNew) { + var node = this.startNode(); + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword import"); + } + this.next(); + if (this.type === types$1.parenL && !forNew) { + return this.parseDynamicImport(node); + } else if (this.type === types$1.dot) { + var meta = this.startNodeAt(node.start, node.loc && node.loc.start); + meta.name = "import"; + node.meta = this.finishNode(meta, "Identifier"); + return this.parseImportMeta(node); + } else { + this.unexpected(); + } + }; + pp$5.parseDynamicImport = function(node) { + this.next(); + node.source = this.parseMaybeAssign(); + if (!this.eat(types$1.parenR)) { + var errorPos = this.start; + if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + return this.finishNode(node, "ImportExpression"); + }; + pp$5.parseImportMeta = function(node) { + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); + } + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { + this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); + } + return this.finishNode(node, "MetaProperty"); + }; + pp$5.parseLiteral = function(value2) { + var node = this.startNode(); + node.value = value2; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { + node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); + } + this.next(); + return this.finishNode(node, "Literal"); + }; + pp$5.parseParenExpression = function() { + this.expect(types$1.parenL); + var val = this.parseExpression(); + this.expect(types$1.parenR); + return val; + }; + pp$5.shouldParseArrow = function(exprList) { + return !this.canInsertSemicolon(); + }; + pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types$1.parenR) { + first ? first = false : this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { + lastIsComma = true; + break; + } else if (this.type === types$1.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types$1.comma) { + this.raiseRecoverable( + this.start, + "Comma is not permitted after the rest element" + ); + } + break; + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; + this.expect(types$1.parenR); + if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList, forInit); + } + if (!exprList.length || lastIsComma) { + this.unexpected(this.lastTokStart); + } + if (spreadStart) { + this.unexpected(spreadStart); + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } + }; + pp$5.parseParenItem = function(item) { + return item; + }; + pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit); + }; + var empty2 = []; + pp$5.parseNew = function() { + if (this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword new"); + } + var node = this.startNode(); + this.next(); + if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) { + var meta = this.startNodeAt(node.start, node.loc && node.loc.start); + meta.name = "new"; + node.meta = this.finishNode(meta, "Identifier"); + this.next(); + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") { + this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); + } + if (containsEsc) { + this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); + } + if (!this.allowNewDotTarget) { + this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); + } + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false); + if (this.eat(types$1.parenL)) { + node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); + } else { + node.arguments = empty2; + } + return this.finishNode(node, "NewExpression"); + }; + pp$5.parseTemplateElement = function(ref2) { + var isTagged = ref2.isTagged; + var elem = this.startNode(); + if (this.type === types$1.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types$1.backQuote; + return this.finishNode(elem, "TemplateElement"); + }; + pp$5.parseTemplate = function(ref2) { + if (ref2 === void 0) + ref2 = {}; + var isTagged = ref2.isTagged; + if (isTagged === void 0) + isTagged = false; + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({ isTagged }); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types$1.eof) { + this.raise(this.pos, "Unterminated template literal"); + } + this.expect(types$1.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types$1.braceR); + node.quasis.push(curElt = this.parseTemplateElement({ isTagged })); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); + }; + pp$5.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === types$1.star) && !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + }; + pp$5.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types$1.braceR)) { + if (!first) { + this.expect(types$1.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { + break; + } + } else { + first = false; + } + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { + this.checkPropClash(prop, propHash, refDestructuringErrors); + } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + }; + pp$5.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync2, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types$1.comma) { + this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement"); + } + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + return this.finishNode(prop, "SpreadElement"); + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(types$1.star); + } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync2 = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); + this.parsePropertyName(prop); + } else { + isAsync2 = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync2, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property"); + }; + pp$5.parseGetterSetter = function(prop) { + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") { + this.raiseRecoverable(start, "getter should have no params"); + } else { + this.raiseRecoverable(start, "setter should have exactly one param"); + } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); + } + } + }; + pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync2, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync2) && this.type === types$1.colon) { + this.unexpected(); + } + if (this.eat(types$1.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { + if (isPattern) { + this.unexpected(); + } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync2); + } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { + if (isGenerator || isAsync2) { + this.unexpected(); + } + this.parseGetterSetter(prop); + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync2) { + this.unexpected(); + } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = startPos; + } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) { + refDestructuringErrors.shorthandAssign = this.start; + } + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else { + prop.value = this.copyNode(prop.key); + } + prop.shorthand = true; + } else { + this.unexpected(); + } + }; + pp$5.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types$1.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types$1.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"); + }; + pp$5.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = node.expression = false; + } + if (this.options.ecmaVersion >= 8) { + node.async = false; + } + }; + pp$5.parseMethod = function(isGenerator, isAsync2, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.initFunction(node); + if (this.options.ecmaVersion >= 6) { + node.generator = isGenerator; + } + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync2; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync2, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + this.expect(types$1.parenL); + node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true, false); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression"); + }; + pp$5.parseArrowExpression = function(node, params, isAsync2, forInit) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.enterScope(functionFlags(isAsync2, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { + node.async = !!isAsync2; + } + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false, forInit); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression"); + }; + pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { + var isExpression = isArrowFunction && this.type !== types$1.braceL; + var oldStrict = this.strict, useStrict = false; + if (isExpression) { + node.body = this.parseMaybeAssign(forInit); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + if (useStrict && nonSimple) { + this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); + } + } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { + this.strict = true; + } + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + if (this.strict && node.id) { + this.checkLValSimple(node.id, BIND_OUTSIDE); + } + node.body = this.parseBlock(false, void 0, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + pp$5.isSimpleParamList = function(params) { + for (var i8 = 0, list2 = params; i8 < list2.length; i8 += 1) { + var param = list2[i8]; + if (param.type !== "Identifier") { + return false; + } + } + return true; + }; + pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = /* @__PURE__ */ Object.create(null); + for (var i8 = 0, list2 = node.params; i8 < list2.length; i8 += 1) { + var param = list2[i8]; + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; + pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types$1.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } + } else { + first = false; + } + var elt = void 0; + if (allowEmpty && this.type === types$1.comma) { + elt = null; + } else if (this.type === types$1.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts; + }; + pp$5.checkUnreserved = function(ref2) { + var start = ref2.start; + var end = ref2.end; + var name2 = ref2.name; + if (this.inGenerator && name2 === "yield") { + this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); + } + if (this.inAsync && name2 === "await") { + this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); + } + if (this.currentThisScope().inClassFieldInit && name2 === "arguments") { + this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); + } + if (this.inClassStaticBlock && (name2 === "arguments" || name2 === "await")) { + this.raise(start, "Cannot use " + name2 + " in class static initialization block"); + } + if (this.keywords.test(name2)) { + this.raise(start, "Unexpected keyword '" + name2 + "'"); + } + if (this.options.ecmaVersion < 6 && this.input.slice(start, end).indexOf("\\") !== -1) { + return; + } + var re4 = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re4.test(name2)) { + if (!this.inAsync && name2 === "await") { + this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); + } + this.raiseRecoverable(start, "The keyword '" + name2 + "' is reserved"); + } + }; + pp$5.parseIdent = function(liberal) { + var node = this.parseIdentNode(); + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) { + this.awaitIdentPos = node.start; + } + } + return node; + }; + pp$5.parseIdentNode = function() { + var node = this.startNode(); + if (this.type === types$1.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + if ((node.name === "class" || node.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + this.type = types$1.name; + } else { + this.unexpected(); + } + return node; + }; + pp$5.parsePrivateIdent = function() { + var node = this.startNode(); + if (this.type === types$1.privateId) { + node.name = this.value; + } else { + this.unexpected(); + } + this.next(); + this.finishNode(node, "PrivateIdentifier"); + if (this.options.checkPrivateFields) { + if (this.privateNameStack.length === 0) { + this.raise(node.start, "Private field '#" + node.name + "' must be declared in an enclosing class"); + } else { + this.privateNameStack[this.privateNameStack.length - 1].used.push(node); + } + } + return node; + }; + pp$5.parseYield = function(forInit) { + if (!this.yieldPos) { + this.yieldPos = this.start; + } + var node = this.startNode(); + this.next(); + if (this.type === types$1.semi || this.canInsertSemicolon() || this.type !== types$1.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types$1.star); + node.argument = this.parseMaybeAssign(forInit); + } + return this.finishNode(node, "YieldExpression"); + }; + pp$5.parseAwait = function(forInit) { + if (!this.awaitPos) { + this.awaitPos = this.start; + } + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true, false, forInit); + return this.finishNode(node, "AwaitExpression"); + }; + var pp$4 = Parser7.prototype; + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + err.raisedAt = this.pos; + throw err; + }; + pp$4.raiseRecoverable = pp$4.raise; + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart); + } + }; + var pp$3 = Parser7.prototype; + var Scope = function Scope2(flags) { + this.flags = flags; + this.var = []; + this.lexical = []; + this.functions = []; + this.inClassFieldInit = false; + }; + pp$3.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + pp$3.exitScope = function() { + this.scopeStack.pop(); + }; + pp$3.treatFunctionsAsVarInScope = function(scope) { + return scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_TOP; + }; + pp$3.declareName = function(name2, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name2) > -1 || scope.functions.indexOf(name2) > -1 || scope.var.indexOf(name2) > -1; + scope.lexical.push(name2); + if (this.inModule && scope.flags & SCOPE_TOP) { + delete this.undefinedExports[name2]; + } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name2); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) { + redeclared = scope$2.lexical.indexOf(name2) > -1; + } else { + redeclared = scope$2.lexical.indexOf(name2) > -1 || scope$2.var.indexOf(name2) > -1; + } + scope$2.functions.push(name2); + } else { + for (var i8 = this.scopeStack.length - 1; i8 >= 0; --i8) { + var scope$3 = this.scopeStack[i8]; + if (scope$3.lexical.indexOf(name2) > -1 && !(scope$3.flags & SCOPE_SIMPLE_CATCH && scope$3.lexical[0] === name2) || !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name2) > -1) { + redeclared = true; + break; + } + scope$3.var.push(name2); + if (this.inModule && scope$3.flags & SCOPE_TOP) { + delete this.undefinedExports[name2]; + } + if (scope$3.flags & SCOPE_VAR) { + break; + } + } + } + if (redeclared) { + this.raiseRecoverable(pos, "Identifier '" + name2 + "' has already been declared"); + } + }; + pp$3.checkLocalExport = function(id) { + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + pp$3.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1]; + }; + pp$3.currentVarScope = function() { + for (var i8 = this.scopeStack.length - 1; ; i8--) { + var scope = this.scopeStack[i8]; + if (scope.flags & SCOPE_VAR) { + return scope; + } + } + }; + pp$3.currentThisScope = function() { + for (var i8 = this.scopeStack.length - 1; ; i8--) { + var scope = this.scopeStack[i8]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { + return scope; + } + } + }; + var Node = function Node2(parser3, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser3.options.locations) { + this.loc = new SourceLocation(parser3, loc); + } + if (parser3.options.directSourceFile) { + this.sourceFile = parser3.options.directSourceFile; + } + if (parser3.options.ranges) { + this.range = [pos, 0]; + } + }; + var pp$2 = Parser7.prototype; + pp$2.startNode = function() { + return new Node(this, this.start, this.startLoc); + }; + pp$2.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc); + }; + function finishNodeAt(node, type3, pos, loc) { + node.type = type3; + node.end = pos; + if (this.options.locations) { + node.loc.end = loc; + } + if (this.options.ranges) { + node.range[1] = pos; + } + return node; + } + pp$2.finishNode = function(node, type3) { + return finishNodeAt.call(this, node, type3, this.lastTokEnd, this.lastTokEndLoc); + }; + pp$2.finishNodeAt = function(node, type3, pos, loc) { + return finishNodeAt.call(this, node, type3, pos, loc); + }; + pp$2.copyNode = function(node) { + var newNode = new Node(this, node.start, this.startLoc); + for (var prop in node) { + newNode[prop] = node[prop]; + } + return newNode; + }; + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties + }; + var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"; + var unicodeBinaryPropertiesOfStrings = { + 9: "", + 10: "", + 11: "", + 12: "", + 13: "", + 14: ecma14BinaryPropertiesOfStrings + }; + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; + var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var ecma14ScriptValues = ecma13ScriptValues + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues, + 14: ecma14ScriptValues + }; + var data = {}; + function buildUnicodeData(ecmaVersion2) { + var d7 = data[ecmaVersion2] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion2] + " " + unicodeGeneralCategoryValues), + binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion2]), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion2]) + } + }; + d7.nonBinary.Script_Extensions = d7.nonBinary.Script; + d7.nonBinary.gc = d7.nonBinary.General_Category; + d7.nonBinary.sc = d7.nonBinary.Script; + d7.nonBinary.scx = d7.nonBinary.Script_Extensions; + } + for (var i7 = 0, list = [9, 10, 11, 12, 13, 14]; i7 < list.length; i7 += 1) { + var ecmaVersion = list[i7]; + buildUnicodeData(ecmaVersion); + } + var pp$1 = Parser7.prototype; + var RegExpValidationState = function RegExpValidationState2(parser3) { + this.parser = parser3; + this.validFlags = "gim" + (parser3.options.ecmaVersion >= 6 ? "uy" : "") + (parser3.options.ecmaVersion >= 9 ? "s" : "") + (parser3.options.ecmaVersion >= 13 ? "d" : "") + (parser3.options.ecmaVersion >= 15 ? "v" : ""); + this.unicodeProperties = data[parser3.options.ecmaVersion >= 14 ? 14 : parser3.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchV = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + RegExpValidationState.prototype.reset = function reset(start, pattern5, flags) { + var unicodeSets = flags.indexOf("v") !== -1; + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern5 + ""; + this.flags = flags; + if (unicodeSets && this.parser.options.ecmaVersion >= 15) { + this.switchU = true; + this.switchV = true; + this.switchN = true; + } else { + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchV = false; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + } + }; + RegExpValidationState.prototype.raise = function raise(message) { + this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + message); + }; + RegExpValidationState.prototype.at = function at2(i8, forceU) { + if (forceU === void 0) + forceU = false; + var s7 = this.source; + var l7 = s7.length; + if (i8 >= l7) { + return -1; + } + var c7 = s7.charCodeAt(i8); + if (!(forceU || this.switchU) || c7 <= 55295 || c7 >= 57344 || i8 + 1 >= l7) { + return c7; + } + var next = s7.charCodeAt(i8 + 1); + return next >= 56320 && next <= 57343 ? (c7 << 10) + next - 56613888 : c7; + }; + RegExpValidationState.prototype.nextIndex = function nextIndex(i8, forceU) { + if (forceU === void 0) + forceU = false; + var s7 = this.source; + var l7 = s7.length; + if (i8 >= l7) { + return l7; + } + var c7 = s7.charCodeAt(i8), next; + if (!(forceU || this.switchU) || c7 <= 55295 || c7 >= 57344 || i8 + 1 >= l7 || (next = s7.charCodeAt(i8 + 1)) < 56320 || next > 57343) { + return i8 + 1; + } + return i8 + 2; + }; + RegExpValidationState.prototype.current = function current(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.pos, forceU); + }; + RegExpValidationState.prototype.lookahead = function lookahead(forceU) { + if (forceU === void 0) + forceU = false; + return this.at(this.nextIndex(this.pos, forceU), forceU); + }; + RegExpValidationState.prototype.advance = function advance(forceU) { + if (forceU === void 0) + forceU = false; + this.pos = this.nextIndex(this.pos, forceU); + }; + RegExpValidationState.prototype.eat = function eat(ch, forceU) { + if (forceU === void 0) + forceU = false; + if (this.current(forceU) === ch) { + this.advance(forceU); + return true; + } + return false; + }; + RegExpValidationState.prototype.eatChars = function eatChars(chs, forceU) { + if (forceU === void 0) + forceU = false; + var pos = this.pos; + for (var i8 = 0, list2 = chs; i8 < list2.length; i8 += 1) { + var ch = list2[i8]; + var current = this.at(pos, forceU); + if (current === -1 || current !== ch) { + return false; + } + pos = this.nextIndex(pos, forceU); + } + this.pos = pos; + return true; + }; + pp$1.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + var u7 = false; + var v8 = false; + for (var i8 = 0; i8 < flags.length; i8++) { + var flag = flags.charAt(i8); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i8 + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + if (flag === "u") { + u7 = true; + } + if (flag === "v") { + v8 = true; + } + } + if (this.options.ecmaVersion >= 15 && u7 && v8) { + this.raise(state.start, "Invalid regular expression flag"); + } + }; + pp$1.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + pp$1.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + this.regexp_disjunction(state); + if (state.pos !== state.source.length) { + if (state.eat( + 41 + /* ) */ + )) { + state.raise("Unmatched ')'"); + } + if (state.eat( + 93 + /* ] */ + ) || state.eat( + 125 + /* } */ + )) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i8 = 0, list2 = state.backReferenceNames; i8 < list2.length; i8 += 1) { + var name2 = list2[i8]; + if (state.groupNames.indexOf(name2) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + pp$1.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat( + 124 + /* | */ + )) { + this.regexp_alternative(state); + } + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat( + 123 + /* { */ + )) { + state.raise("Lone quantifier brackets"); + } + }; + pp$1.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) { + } + }; + pp$1.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true; + } + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true; + } + return false; + }; + pp$1.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + if (state.eat( + 94 + /* ^ */ + ) || state.eat( + 36 + /* $ */ + )) { + return true; + } + if (state.eat( + 92 + /* \ */ + )) { + if (state.eat( + 66 + /* B */ + ) || state.eat( + 98 + /* b */ + )) { + return true; + } + state.pos = start; + } + if (state.eat( + 40 + /* ( */ + ) && state.eat( + 63 + /* ? */ + )) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat( + 60 + /* < */ + ); + } + if (state.eat( + 61 + /* = */ + ) || state.eat( + 33 + /* ! */ + )) { + this.regexp_disjunction(state); + if (!state.eat( + 41 + /* ) */ + )) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true; + } + } + state.pos = start; + return false; + }; + pp$1.regexp_eatQuantifier = function(state, noError) { + if (noError === void 0) + noError = false; + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat( + 63 + /* ? */ + ); + return true; + } + return false; + }; + pp$1.regexp_eatQuantifierPrefix = function(state, noError) { + return state.eat( + 42 + /* * */ + ) || state.eat( + 43 + /* + */ + ) || state.eat( + 63 + /* ? */ + ) || this.regexp_eatBracedQuantifier(state, noError); + }; + pp$1.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat( + 123 + /* { */ + )) { + var min2 = 0, max2 = -1; + if (this.regexp_eatDecimalDigits(state)) { + min2 = state.lastIntValue; + if (state.eat( + 44 + /* , */ + ) && this.regexp_eatDecimalDigits(state)) { + max2 = state.lastIntValue; + } + if (state.eat( + 125 + /* } */ + )) { + if (max2 !== -1 && max2 < min2 && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true; + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatAtom = function(state) { + return this.regexp_eatPatternCharacters(state) || state.eat( + 46 + /* . */ + ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state); + }; + pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat( + 92 + /* \ */ + )) { + if (this.regexp_eatAtomEscape(state)) { + return true; + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat( + 40 + /* ( */ + )) { + if (state.eat( + 63 + /* ? */ + ) && state.eat( + 58 + /* : */ + )) { + this.regexp_disjunction(state); + if (state.eat( + 41 + /* ) */ + )) { + return true; + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatCapturingGroup = function(state) { + if (state.eat( + 40 + /* ( */ + )) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 63) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat( + 41 + /* ) */ + )) { + state.numCapturingParens += 1; + return true; + } + state.raise("Unterminated group"); + } + return false; + }; + pp$1.regexp_eatExtendedAtom = function(state) { + return state.eat( + 46 + /* . */ + ) || this.regexp_eatReverseSolidusAtomEscape(state) || this.regexp_eatCharacterClass(state) || this.regexp_eatUncapturingGroup(state) || this.regexp_eatCapturingGroup(state) || this.regexp_eatInvalidBracedQuantifier(state) || this.regexp_eatExtendedPatternCharacter(state); + }; + pp$1.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false; + }; + pp$1.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + function isSyntaxCharacter(ch) { + return ch === 36 || ch >= 40 && ch <= 43 || ch === 46 || ch === 63 || ch >= 91 && ch <= 94 || ch >= 123 && ch <= 125; + } + pp$1.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start; + }; + pp$1.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if (ch !== -1 && ch !== 36 && !(ch >= 40 && ch <= 43) && ch !== 46 && ch !== 63 && ch !== 91 && ch !== 94 && ch !== 124) { + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_groupSpecifier = function(state) { + if (state.eat( + 63 + /* ? */ + )) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return; + } + state.raise("Invalid group"); + } + }; + pp$1.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat( + 60 + /* < */ + )) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat( + 62 + /* > */ + )) { + return true; + } + state.raise("Invalid capture group name"); + } + return false; + }; + pp$1.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true; + } + return false; + }; + pp$1.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start; + return false; + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 36 || ch === 95; + } + pp$1.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + if (ch === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true; + } + state.pos = start; + return false; + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 36 || ch === 95 || ch === 8204 || ch === 8205; + } + pp$1.regexp_eatAtomEscape = function(state) { + if (this.regexp_eatBackReference(state) || this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state) || state.switchN && this.regexp_eatKGroupName(state)) { + return true; + } + if (state.switchU) { + if (state.current() === 99) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false; + }; + pp$1.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n7 = state.lastIntValue; + if (state.switchU) { + if (n7 > state.maxBackReference) { + state.maxBackReference = n7; + } + return true; + } + if (n7 <= state.numCapturingParens) { + return true; + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatKGroupName = function(state) { + if (state.eat( + 107 + /* k */ + )) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true; + } + state.raise("Invalid named reference"); + } + return false; + }; + pp$1.regexp_eatCharacterEscape = function(state) { + return this.regexp_eatControlEscape(state) || this.regexp_eatCControlLetter(state) || this.regexp_eatZero(state) || this.regexp_eatHexEscapeSequence(state) || this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || !state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state) || this.regexp_eatIdentityEscape(state); + }; + pp$1.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat( + 99 + /* c */ + )) { + if (this.regexp_eatControlLetter(state)) { + return true; + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatZero = function(state) { + if (state.current() === 48 && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 116) { + state.lastIntValue = 9; + state.advance(); + return true; + } + if (ch === 110) { + state.lastIntValue = 10; + state.advance(); + return true; + } + if (ch === 118) { + state.lastIntValue = 11; + state.advance(); + return true; + } + if (ch === 102) { + state.lastIntValue = 12; + state.advance(); + return true; + } + if (ch === 114) { + state.lastIntValue = 13; + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + function isControlLetter(ch) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122; + } + pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if (forceU === void 0) + forceU = false; + var start = state.pos; + var switchU = forceU || state.switchU; + if (state.eat( + 117 + /* u */ + )) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 55296 && lead <= 56319) { + var leadSurrogateEnd = state.pos; + if (state.eat( + 92 + /* \ */ + ) && state.eat( + 117 + /* u */ + ) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 56320 && trail <= 57343) { + state.lastIntValue = (lead - 55296) * 1024 + (trail - 56320) + 65536; + return true; + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true; + } + if (switchU && state.eat( + 123 + /* { */ + ) && this.regexp_eatHexDigits(state) && state.eat( + 125 + /* } */ + ) && isValidUnicode(state.lastIntValue)) { + return true; + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + return false; + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 1114111; + } + pp$1.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true; + } + if (state.eat( + 47 + /* / */ + )) { + state.lastIntValue = 47; + return true; + } + return false; + } + var ch = state.current(); + if (ch !== 99 && (!state.switchN || ch !== 107)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 49 && ch <= 57) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } while ((ch = state.current()) >= 48 && ch <= 57); + return true; + } + return false; + }; + var CharSetNone = 0; + var CharSetOk = 1; + var CharSetString = 2; + pp$1.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return CharSetOk; + } + var negate2 = false; + if (state.switchU && this.options.ecmaVersion >= 9 && ((negate2 = ch === 80) || ch === 112)) { + state.lastIntValue = -1; + state.advance(); + var result2; + if (state.eat( + 123 + /* { */ + ) && (result2 = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat( + 125 + /* } */ + )) { + if (negate2 && result2 === CharSetString) { + state.raise("Invalid property name"); + } + return result2; + } + state.raise("Invalid property name"); + } + return CharSetNone; + }; + function isCharacterClassEscape(ch) { + return ch === 100 || ch === 68 || ch === 115 || ch === 83 || ch === 119 || ch === 87; + } + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + if (this.regexp_eatUnicodePropertyName(state) && state.eat( + 61 + /* = */ + )) { + var name2 = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value2 = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name2, value2); + return CharSetOk; + } + } + state.pos = start; + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + } + return CharSetNone; + }; + pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name2, value2) { + if (!hasOwn(state.unicodeProperties.nonBinary, name2)) { + state.raise("Invalid property name"); + } + if (!state.unicodeProperties.nonBinary[name2].test(value2)) { + state.raise("Invalid property value"); + } + }; + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (state.unicodeProperties.binary.test(nameOrValue)) { + return CharSetOk; + } + if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { + return CharSetString; + } + state.raise("Invalid property name"); + }; + pp$1.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 95; + } + pp$1.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== ""; + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch); + } + pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state); + }; + pp$1.regexp_eatCharacterClass = function(state) { + if (state.eat( + 91 + /* [ */ + )) { + var negate2 = state.eat( + 94 + /* ^ */ + ); + var result2 = this.regexp_classContents(state); + if (!state.eat( + 93 + /* ] */ + )) { + state.raise("Unterminated character class"); + } + if (negate2 && result2 === CharSetString) { + state.raise("Negated character class may contain strings"); + } + return true; + } + return false; + }; + pp$1.regexp_classContents = function(state) { + if (state.current() === 93) { + return CharSetOk; + } + if (state.switchV) { + return this.regexp_classSetExpression(state); + } + this.regexp_nonEmptyClassRanges(state); + return CharSetOk; + }; + pp$1.regexp_nonEmptyClassRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat( + 45 + /* - */ + ) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + pp$1.regexp_eatClassAtom = function(state) { + var start = state.pos; + if (state.eat( + 92 + /* \ */ + )) { + if (this.regexp_eatClassEscape(state)) { + return true; + } + if (state.switchU) { + var ch$1 = state.current(); + if (ch$1 === 99 || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + var ch = state.current(); + if (ch !== 93) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_eatClassEscape = function(state) { + var start = state.pos; + if (state.eat( + 98 + /* b */ + )) { + state.lastIntValue = 8; + return true; + } + if (state.switchU && state.eat( + 45 + /* - */ + )) { + state.lastIntValue = 45; + return true; + } + if (!state.switchU && state.eat( + 99 + /* c */ + )) { + if (this.regexp_eatClassControlLetter(state)) { + return true; + } + state.pos = start; + } + return this.regexp_eatCharacterClassEscape(state) || this.regexp_eatCharacterEscape(state); + }; + pp$1.regexp_classSetExpression = function(state) { + var result2 = CharSetOk, subResult; + if (this.regexp_eatClassSetRange(state)) + ; + else if (subResult = this.regexp_eatClassSetOperand(state)) { + if (subResult === CharSetString) { + result2 = CharSetString; + } + var start = state.pos; + while (state.eatChars( + [38, 38] + /* && */ + )) { + if (state.current() !== 38 && (subResult = this.regexp_eatClassSetOperand(state))) { + if (subResult !== CharSetString) { + result2 = CharSetOk; + } + continue; + } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { + return result2; + } + while (state.eatChars( + [45, 45] + /* -- */ + )) { + if (this.regexp_eatClassSetOperand(state)) { + continue; + } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { + return result2; + } + } else { + state.raise("Invalid character in character class"); + } + for (; ; ) { + if (this.regexp_eatClassSetRange(state)) { + continue; + } + subResult = this.regexp_eatClassSetOperand(state); + if (!subResult) { + return result2; + } + if (subResult === CharSetString) { + result2 = CharSetString; + } + } + }; + pp$1.regexp_eatClassSetRange = function(state) { + var start = state.pos; + if (this.regexp_eatClassSetCharacter(state)) { + var left = state.lastIntValue; + if (state.eat( + 45 + /* - */ + ) && this.regexp_eatClassSetCharacter(state)) { + var right = state.lastIntValue; + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + return true; + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatClassSetOperand = function(state) { + if (this.regexp_eatClassSetCharacter(state)) { + return CharSetOk; + } + return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state); + }; + pp$1.regexp_eatNestedClass = function(state) { + var start = state.pos; + if (state.eat( + 91 + /* [ */ + )) { + var negate2 = state.eat( + 94 + /* ^ */ + ); + var result2 = this.regexp_classContents(state); + if (state.eat( + 93 + /* ] */ + )) { + if (negate2 && result2 === CharSetString) { + state.raise("Negated character class may contain strings"); + } + return result2; + } + state.pos = start; + } + if (state.eat( + 92 + /* \ */ + )) { + var result$1 = this.regexp_eatCharacterClassEscape(state); + if (result$1) { + return result$1; + } + state.pos = start; + } + return null; + }; + pp$1.regexp_eatClassStringDisjunction = function(state) { + var start = state.pos; + if (state.eatChars( + [92, 113] + /* \q */ + )) { + if (state.eat( + 123 + /* { */ + )) { + var result2 = this.regexp_classStringDisjunctionContents(state); + if (state.eat( + 125 + /* } */ + )) { + return result2; + } + } else { + state.raise("Invalid escape"); + } + state.pos = start; + } + return null; + }; + pp$1.regexp_classStringDisjunctionContents = function(state) { + var result2 = this.regexp_classString(state); + while (state.eat( + 124 + /* | */ + )) { + if (this.regexp_classString(state) === CharSetString) { + result2 = CharSetString; + } + } + return result2; + }; + pp$1.regexp_classString = function(state) { + var count2 = 0; + while (this.regexp_eatClassSetCharacter(state)) { + count2++; + } + return count2 === 1 ? CharSetOk : CharSetString; + }; + pp$1.regexp_eatClassSetCharacter = function(state) { + var start = state.pos; + if (state.eat( + 92 + /* \ */ + )) { + if (this.regexp_eatCharacterEscape(state) || this.regexp_eatClassSetReservedPunctuator(state)) { + return true; + } + if (state.eat( + 98 + /* b */ + )) { + state.lastIntValue = 8; + return true; + } + state.pos = start; + return false; + } + var ch = state.current(); + if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { + return false; + } + if (isClassSetSyntaxCharacter(ch)) { + return false; + } + state.advance(); + state.lastIntValue = ch; + return true; + }; + function isClassSetReservedDoublePunctuatorCharacter(ch) { + return ch === 33 || ch >= 35 && ch <= 38 || ch >= 42 && ch <= 44 || ch === 46 || ch >= 58 && ch <= 64 || ch === 94 || ch === 96 || ch === 126; + } + function isClassSetSyntaxCharacter(ch) { + return ch === 40 || ch === 41 || ch === 45 || ch === 47 || ch >= 91 && ch <= 93 || ch >= 123 && ch <= 125; + } + pp$1.regexp_eatClassSetReservedPunctuator = function(state) { + var ch = state.current(); + if (isClassSetReservedPunctuator(ch)) { + state.lastIntValue = ch; + state.advance(); + return true; + } + return false; + }; + function isClassSetReservedPunctuator(ch) { + return ch === 33 || ch === 35 || ch === 37 || ch === 38 || ch === 44 || ch === 45 || ch >= 58 && ch <= 62 || ch === 64 || ch === 96 || ch === 126; + } + pp$1.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 95) { + state.lastIntValue = ch % 32; + state.advance(); + return true; + } + return false; + }; + pp$1.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat( + 120 + /* x */ + )) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true; + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false; + }; + pp$1.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 48); + state.advance(); + } + return state.pos !== start; + }; + function isDecimalDigit(ch) { + return ch >= 48 && ch <= 57; + } + pp$1.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start; + }; + function isHexDigit(ch) { + return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; + } + function hexToInt(ch) { + if (ch >= 65 && ch <= 70) { + return 10 + (ch - 65); + } + if (ch >= 97 && ch <= 102) { + return 10 + (ch - 97); + } + return ch - 48; + } + pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n22 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n22 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n22; + } + } else { + state.lastIntValue = n1; + } + return true; + } + return false; + }; + pp$1.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 48; + state.advance(); + return true; + } + state.lastIntValue = 0; + return false; + }; + function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; + } + pp$1.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i8 = 0; i8 < length; ++i8) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false; + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true; + }; + var Token = function Token2(p7) { + this.type = p7.type; + this.value = p7.value; + this.start = p7.start; + this.end = p7.end; + if (p7.options.locations) { + this.loc = new SourceLocation(p7, p7.startLoc, p7.endLoc); + } + if (p7.options.ranges) { + this.range = [p7.start, p7.end]; + } + }; + var pp = Parser7.prototype; + pp.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) { + this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); + } + if (this.options.onToken) { + this.options.onToken(new Token(this)); + } + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + pp.getToken = function() { + this.next(); + return new Token(this); + }; + if (typeof Symbol !== "undefined") { + pp[Symbol.iterator] = function() { + var this$1$1 = this; + return { + next: function() { + var token = this$1$1.getToken(); + return { + done: token.type === types$1.eof, + value: token + }; + } + }; + }; + } + pp.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { + this.skipSpace(); + } + this.start = this.pos; + if (this.options.locations) { + this.startLoc = this.curPosition(); + } + if (this.pos >= this.input.length) { + return this.finishToken(types$1.eof); + } + if (curContext.override) { + return curContext.override(this); + } else { + this.readToken(this.fullCharCodeAtPos()); + } + }; + pp.readToken = function(code) { + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92) { + return this.readWord(); + } + return this.getTokenFromCode(code); + }; + pp.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 55295 || code >= 56320) { + return code; + } + var next = this.input.charCodeAt(this.pos + 1); + return next <= 56319 || next >= 57344 ? code : (code << 10) + next - 56613888; + }; + pp.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { + this.raise(this.pos - 2, "Unterminated comment"); + } + this.pos = end + 2; + if (this.options.locations) { + for (var nextBreak = void 0, pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1; ) { + ++this.curLine; + pos = this.lineStart = nextBreak; + } + } + if (this.options.onComment) { + this.options.onComment( + true, + this.input.slice(start + 2, end), + start, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) { + this.options.onComment( + false, + this.input.slice(start + startSkip, this.pos), + start, + this.pos, + startLoc, + this.curPosition() + ); + } + }; + pp.skipSpace = function() { + loop: + while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: + case 160: + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: + case 8232: + case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } + }; + pp.finishToken = function(type3, val) { + this.end = this.pos; + if (this.options.locations) { + this.endLoc = this.curPosition(); + } + var prevType = this.type; + this.type = type3; + this.value = val; + this.updateContext(prevType); + }; + pp.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + this.pos += 3; + return this.finishToken(types$1.ellipsis); + } else { + ++this.pos; + return this.finishToken(types$1.dot); + } + }; + pp.readToken_slash = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos; + return this.readRegexp(); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.slash, 1); + }; + pp.readToken_mult_modulo_exp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size2 = 1; + var tokentype = code === 42 ? types$1.star : types$1.modulo; + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size2; + tokentype = types$1.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, size2 + 1); + } + return this.finishOp(tokentype, size2); + }; + pp.readToken_pipe_amp = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1); + }; + pp.readToken_caret = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.bitwiseXOR, 1); + }; + pp.readToken_plus_min = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(types$1.incDec, 2); + } + if (next === 61) { + return this.finishOp(types$1.assign, 2); + } + return this.finishOp(types$1.plusMin, 1); + }; + pp.readToken_lt_gt = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + var size2 = 1; + if (next === code) { + size2 = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size2) === 61) { + return this.finishOp(types$1.assign, size2 + 1); + } + return this.finishOp(types$1.bitShift, size2); + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45) { + this.skipLineComment(4); + this.skipSpace(); + return this.nextToken(); + } + if (next === 61) { + size2 = 2; + } + return this.finishOp(types$1.relational, size2); + }; + pp.readToken_eq_excl = function(code) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { + return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2); + } + if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { + this.pos += 2; + return this.finishToken(types$1.arrow); + } + return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1); + }; + pp.readToken_question = function() { + var ecmaVersion2 = this.options.ecmaVersion; + if (ecmaVersion2 >= 11) { + var next = this.input.charCodeAt(this.pos + 1); + if (next === 46) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 < 48 || next2 > 57) { + return this.finishOp(types$1.questionDot, 2); + } + } + if (next === 63) { + if (ecmaVersion2 >= 12) { + var next2$1 = this.input.charCodeAt(this.pos + 2); + if (next2$1 === 61) { + return this.finishOp(types$1.assign, 3); + } + } + return this.finishOp(types$1.coalesce, 2); + } + } + return this.finishOp(types$1.question, 1); + }; + pp.readToken_numberSign = function() { + var ecmaVersion2 = this.options.ecmaVersion; + var code = 35; + if (ecmaVersion2 >= 13) { + ++this.pos; + code = this.fullCharCodeAtPos(); + if (isIdentifierStart(code, true) || code === 92) { + return this.finishToken(types$1.privateId, this.readWord1()); + } + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); + }; + pp.getTokenFromCode = function(code) { + switch (code) { + case 46: + return this.readToken_dot(); + case 40: + ++this.pos; + return this.finishToken(types$1.parenL); + case 41: + ++this.pos; + return this.finishToken(types$1.parenR); + case 59: + ++this.pos; + return this.finishToken(types$1.semi); + case 44: + ++this.pos; + return this.finishToken(types$1.comma); + case 91: + ++this.pos; + return this.finishToken(types$1.bracketL); + case 93: + ++this.pos; + return this.finishToken(types$1.bracketR); + case 123: + ++this.pos; + return this.finishToken(types$1.braceL); + case 125: + ++this.pos; + return this.finishToken(types$1.braceR); + case 58: + ++this.pos; + return this.finishToken(types$1.colon); + case 96: + if (this.options.ecmaVersion < 6) { + break; + } + ++this.pos; + return this.finishToken(types$1.backQuote); + case 48: + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { + return this.readRadixNumber(16); + } + if (this.options.ecmaVersion >= 6) { + if (next === 111 || next === 79) { + return this.readRadixNumber(8); + } + if (next === 98 || next === 66) { + return this.readRadixNumber(2); + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return this.readNumber(false); + case 34: + case 39: + return this.readString(code); + case 47: + return this.readToken_slash(); + case 37: + case 42: + return this.readToken_mult_modulo_exp(code); + case 124: + case 38: + return this.readToken_pipe_amp(code); + case 94: + return this.readToken_caret(); + case 43: + case 45: + return this.readToken_plus_min(code); + case 60: + case 62: + return this.readToken_lt_gt(code); + case 61: + case 33: + return this.readToken_eq_excl(code); + case 63: + return this.readToken_question(); + case 126: + return this.finishOp(types$1.prefix, 1); + case 35: + return this.readToken_numberSign(); + } + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); + }; + pp.finishOp = function(type3, size2) { + var str2 = this.input.slice(this.pos, this.pos + size2); + this.pos += size2; + return this.finishToken(type3, str2); + }; + pp.readRegexp = function() { + var escaped, inClass, start = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak.test(ch)) { + this.raise(start, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern5 = this.input.slice(start, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start, pattern5, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value2 = null; + try { + value2 = new RegExp(pattern5, flags); + } catch (e10) { + } + return this.finishToken(types$1.regexp, { pattern: pattern5, flags, value: value2 }); + }; + pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start = this.pos, total = 0, lastCode = 0; + for (var i8 = 0, e10 = len == null ? Infinity : len; i8 < e10; ++i8, ++this.pos) { + var code = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i8 === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (code >= 48 && code <= 57) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start || len != null && this.pos - start !== len) { + return null; + } + return total; + }; + function stringToNumber(str2, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str2, 8); + } + return parseFloat(str2.replace(/_/g, "")); + } + function stringToBigInt(str2) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str2.replace(/_/g, "")); + } + pp.readRadixNumber = function(radix) { + var start = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val); + }; + pp.readNumber = function(startsWithDot) { + var start = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start, "Invalid number"); + } + var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (octal && this.strict) { + this.raise(start, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start, "Invalid number"); + } + } + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber(this.input.slice(start, this.pos), octal); + return this.finishToken(types$1.num, val); + }; + pp.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code = this.readHexChar(4); + } + return code; + }; + pp.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$1.string, out); + }; + var INVALID_TEMPLATE_ESCAPE_ERROR = {}; + pp.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; + }; + pp.invalidStringToken = function(position, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR; + } else { + this.raise(position, message); + } + }; + pp.readTmplToken = function() { + var out = "", chunkStart = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated template"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$1.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$1.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$1.template, out); + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; + } + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; + } else { + ++this.pos; + } + } + }; + pp.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); + }; + pp.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine(ch)) { + return ""; + } + return String.fromCharCode(ch); + } + }; + pp.readHexChar = function(len) { + var codePos = this.pos; + var n7 = this.readInt(16, len); + if (n7 === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); + } + return n7; + }; + pp.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); + } + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); + } + word += codePointToString(esc); + chunkStart = this.pos; + } else { + break; + } + first = false; + } + return word + this.input.slice(chunkStart, this.pos); + }; + pp.readWord = function() { + var word = this.readWord1(); + var type3 = types$1.name; + if (this.keywords.test(word)) { + type3 = keywords[word]; + } + return this.finishToken(type3, word); + }; + var version5 = "8.11.3"; + Parser7.acorn = { + Parser: Parser7, + version: version5, + defaultOptions: defaultOptions9, + Position, + SourceLocation, + getLineInfo, + Node, + TokenType, + tokTypes: types$1, + keywordTypes: keywords, + TokContext, + tokContexts: types3, + isIdentifierChar, + isIdentifierStart, + Token, + isNewLine, + lineBreak, + lineBreakG, + nonASCIIwhitespace + }; + function parse17(input, options) { + return Parser7.parse(input, options); + } + function parseExpressionAt(input, pos, options) { + return Parser7.parseExpressionAt(input, pos, options); + } + function tokenizer(input, options) { + return Parser7.tokenizer(input, options); + } + exports29.Node = Node; + exports29.Parser = Parser7; + exports29.Position = Position; + exports29.SourceLocation = SourceLocation; + exports29.TokContext = TokContext; + exports29.Token = Token; + exports29.TokenType = TokenType; + exports29.defaultOptions = defaultOptions9; + exports29.getLineInfo = getLineInfo; + exports29.isIdentifierChar = isIdentifierChar; + exports29.isIdentifierStart = isIdentifierStart; + exports29.isNewLine = isNewLine; + exports29.keywordTypes = keywords; + exports29.lineBreak = lineBreak; + exports29.lineBreakG = lineBreakG; + exports29.nonASCIIwhitespace = nonASCIIwhitespace; + exports29.parse = parse17; + exports29.parseExpressionAt = parseExpressionAt; + exports29.tokContexts = types3; + exports29.tokTypes = types$1; + exports29.tokenizer = tokenizer; + exports29.version = version5; + }); + } +}); + +// node_modules/acorn-walk/dist/walk.js +var require_walk = __commonJS({ + "node_modules/acorn-walk/dist/walk.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory((global2.acorn = global2.acorn || {}, global2.acorn.walk = {}))); + })(exports28, function(exports29) { + "use strict"; + function simple(node, visitors, baseVisitor, state, override) { + if (!baseVisitor) { + baseVisitor = base; + } + (function c7(node2, st2, override2) { + var type3 = override2 || node2.type; + baseVisitor[type3](node2, st2, c7); + if (visitors[type3]) { + visitors[type3](node2, st2); + } + })(node, state, override); + } + function ancestor(node, visitors, baseVisitor, state, override) { + var ancestors = []; + if (!baseVisitor) { + baseVisitor = base; + } + (function c7(node2, st2, override2) { + var type3 = override2 || node2.type; + var isNew = node2 !== ancestors[ancestors.length - 1]; + if (isNew) { + ancestors.push(node2); + } + baseVisitor[type3](node2, st2, c7); + if (visitors[type3]) { + visitors[type3](node2, st2 || ancestors, ancestors); + } + if (isNew) { + ancestors.pop(); + } + })(node, state, override); + } + function recursive(node, state, funcs, baseVisitor, override) { + var visitor = funcs ? make(funcs, baseVisitor || void 0) : baseVisitor; + (function c7(node2, st2, override2) { + visitor[override2 || node2.type](node2, st2, c7); + })(node, state, override); + } + function makeTest(test) { + if (typeof test === "string") { + return function(type3) { + return type3 === test; + }; + } else if (!test) { + return function() { + return true; + }; + } else { + return test; + } + } + var Found = function Found2(node, state) { + this.node = node; + this.state = state; + }; + function full(node, callback, baseVisitor, state, override) { + if (!baseVisitor) { + baseVisitor = base; + } + var last2; + (function c7(node2, st2, override2) { + var type3 = override2 || node2.type; + baseVisitor[type3](node2, st2, c7); + if (last2 !== node2) { + callback(node2, st2, type3); + last2 = node2; + } + })(node, state, override); + } + function fullAncestor(node, callback, baseVisitor, state) { + if (!baseVisitor) { + baseVisitor = base; + } + var ancestors = [], last2; + (function c7(node2, st2, override) { + var type3 = override || node2.type; + var isNew = node2 !== ancestors[ancestors.length - 1]; + if (isNew) { + ancestors.push(node2); + } + baseVisitor[type3](node2, st2, c7); + if (last2 !== node2) { + callback(node2, st2 || ancestors, ancestors, type3); + last2 = node2; + } + if (isNew) { + ancestors.pop(); + } + })(node, state); + } + function findNodeAt(node, start, end, test, baseVisitor, state) { + if (!baseVisitor) { + baseVisitor = base; + } + test = makeTest(test); + try { + (function c7(node2, st2, override) { + var type3 = override || node2.type; + if ((start == null || node2.start <= start) && (end == null || node2.end >= end)) { + baseVisitor[type3](node2, st2, c7); + } + if ((start == null || node2.start === start) && (end == null || node2.end === end) && test(type3, node2)) { + throw new Found(node2, st2); + } + })(node, state); + } catch (e10) { + if (e10 instanceof Found) { + return e10; + } + throw e10; + } + } + function findNodeAround(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { + baseVisitor = base; + } + try { + (function c7(node2, st2, override) { + var type3 = override || node2.type; + if (node2.start > pos || node2.end < pos) { + return; + } + baseVisitor[type3](node2, st2, c7); + if (test(type3, node2)) { + throw new Found(node2, st2); + } + })(node, state); + } catch (e10) { + if (e10 instanceof Found) { + return e10; + } + throw e10; + } + } + function findNodeAfter(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { + baseVisitor = base; + } + try { + (function c7(node2, st2, override) { + if (node2.end < pos) { + return; + } + var type3 = override || node2.type; + if (node2.start >= pos && test(type3, node2)) { + throw new Found(node2, st2); + } + baseVisitor[type3](node2, st2, c7); + })(node, state); + } catch (e10) { + if (e10 instanceof Found) { + return e10; + } + throw e10; + } + } + function findNodeBefore(node, pos, test, baseVisitor, state) { + test = makeTest(test); + if (!baseVisitor) { + baseVisitor = base; + } + var max2; + (function c7(node2, st2, override) { + if (node2.start > pos) { + return; + } + var type3 = override || node2.type; + if (node2.end <= pos && (!max2 || max2.node.end < node2.end) && test(type3, node2)) { + max2 = new Found(node2, st2); + } + baseVisitor[type3](node2, st2, c7); + })(node, state); + return max2; + } + function make(funcs, baseVisitor) { + var visitor = Object.create(baseVisitor || base); + for (var type3 in funcs) { + visitor[type3] = funcs[type3]; + } + return visitor; + } + function skipThrough(node, st2, c7) { + c7(node, st2); + } + function ignore(_node, _st, _c) { + } + var base = {}; + base.Program = base.BlockStatement = base.StaticBlock = function(node, st2, c7) { + for (var i7 = 0, list = node.body; i7 < list.length; i7 += 1) { + var stmt = list[i7]; + c7(stmt, st2, "Statement"); + } + }; + base.Statement = skipThrough; + base.EmptyStatement = ignore; + base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression = function(node, st2, c7) { + return c7(node.expression, st2, "Expression"); + }; + base.IfStatement = function(node, st2, c7) { + c7(node.test, st2, "Expression"); + c7(node.consequent, st2, "Statement"); + if (node.alternate) { + c7(node.alternate, st2, "Statement"); + } + }; + base.LabeledStatement = function(node, st2, c7) { + return c7(node.body, st2, "Statement"); + }; + base.BreakStatement = base.ContinueStatement = ignore; + base.WithStatement = function(node, st2, c7) { + c7(node.object, st2, "Expression"); + c7(node.body, st2, "Statement"); + }; + base.SwitchStatement = function(node, st2, c7) { + c7(node.discriminant, st2, "Expression"); + for (var i$16 = 0, list$1 = node.cases; i$16 < list$1.length; i$16 += 1) { + var cs = list$1[i$16]; + if (cs.test) { + c7(cs.test, st2, "Expression"); + } + for (var i7 = 0, list = cs.consequent; i7 < list.length; i7 += 1) { + var cons = list[i7]; + c7(cons, st2, "Statement"); + } + } + }; + base.SwitchCase = function(node, st2, c7) { + if (node.test) { + c7(node.test, st2, "Expression"); + } + for (var i7 = 0, list = node.consequent; i7 < list.length; i7 += 1) { + var cons = list[i7]; + c7(cons, st2, "Statement"); + } + }; + base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function(node, st2, c7) { + if (node.argument) { + c7(node.argument, st2, "Expression"); + } + }; + base.ThrowStatement = base.SpreadElement = function(node, st2, c7) { + return c7(node.argument, st2, "Expression"); + }; + base.TryStatement = function(node, st2, c7) { + c7(node.block, st2, "Statement"); + if (node.handler) { + c7(node.handler, st2); + } + if (node.finalizer) { + c7(node.finalizer, st2, "Statement"); + } + }; + base.CatchClause = function(node, st2, c7) { + if (node.param) { + c7(node.param, st2, "Pattern"); + } + c7(node.body, st2, "Statement"); + }; + base.WhileStatement = base.DoWhileStatement = function(node, st2, c7) { + c7(node.test, st2, "Expression"); + c7(node.body, st2, "Statement"); + }; + base.ForStatement = function(node, st2, c7) { + if (node.init) { + c7(node.init, st2, "ForInit"); + } + if (node.test) { + c7(node.test, st2, "Expression"); + } + if (node.update) { + c7(node.update, st2, "Expression"); + } + c7(node.body, st2, "Statement"); + }; + base.ForInStatement = base.ForOfStatement = function(node, st2, c7) { + c7(node.left, st2, "ForInit"); + c7(node.right, st2, "Expression"); + c7(node.body, st2, "Statement"); + }; + base.ForInit = function(node, st2, c7) { + if (node.type === "VariableDeclaration") { + c7(node, st2); + } else { + c7(node, st2, "Expression"); + } + }; + base.DebuggerStatement = ignore; + base.FunctionDeclaration = function(node, st2, c7) { + return c7(node, st2, "Function"); + }; + base.VariableDeclaration = function(node, st2, c7) { + for (var i7 = 0, list = node.declarations; i7 < list.length; i7 += 1) { + var decl = list[i7]; + c7(decl, st2); + } + }; + base.VariableDeclarator = function(node, st2, c7) { + c7(node.id, st2, "Pattern"); + if (node.init) { + c7(node.init, st2, "Expression"); + } + }; + base.Function = function(node, st2, c7) { + if (node.id) { + c7(node.id, st2, "Pattern"); + } + for (var i7 = 0, list = node.params; i7 < list.length; i7 += 1) { + var param = list[i7]; + c7(param, st2, "Pattern"); + } + c7(node.body, st2, node.expression ? "Expression" : "Statement"); + }; + base.Pattern = function(node, st2, c7) { + if (node.type === "Identifier") { + c7(node, st2, "VariablePattern"); + } else if (node.type === "MemberExpression") { + c7(node, st2, "MemberPattern"); + } else { + c7(node, st2); + } + }; + base.VariablePattern = ignore; + base.MemberPattern = skipThrough; + base.RestElement = function(node, st2, c7) { + return c7(node.argument, st2, "Pattern"); + }; + base.ArrayPattern = function(node, st2, c7) { + for (var i7 = 0, list = node.elements; i7 < list.length; i7 += 1) { + var elt = list[i7]; + if (elt) { + c7(elt, st2, "Pattern"); + } + } + }; + base.ObjectPattern = function(node, st2, c7) { + for (var i7 = 0, list = node.properties; i7 < list.length; i7 += 1) { + var prop = list[i7]; + if (prop.type === "Property") { + if (prop.computed) { + c7(prop.key, st2, "Expression"); + } + c7(prop.value, st2, "Pattern"); + } else if (prop.type === "RestElement") { + c7(prop.argument, st2, "Pattern"); + } + } + }; + base.Expression = skipThrough; + base.ThisExpression = base.Super = base.MetaProperty = ignore; + base.ArrayExpression = function(node, st2, c7) { + for (var i7 = 0, list = node.elements; i7 < list.length; i7 += 1) { + var elt = list[i7]; + if (elt) { + c7(elt, st2, "Expression"); + } + } + }; + base.ObjectExpression = function(node, st2, c7) { + for (var i7 = 0, list = node.properties; i7 < list.length; i7 += 1) { + var prop = list[i7]; + c7(prop, st2); + } + }; + base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration; + base.SequenceExpression = function(node, st2, c7) { + for (var i7 = 0, list = node.expressions; i7 < list.length; i7 += 1) { + var expr = list[i7]; + c7(expr, st2, "Expression"); + } + }; + base.TemplateLiteral = function(node, st2, c7) { + for (var i7 = 0, list = node.quasis; i7 < list.length; i7 += 1) { + var quasi = list[i7]; + c7(quasi, st2); + } + for (var i$16 = 0, list$1 = node.expressions; i$16 < list$1.length; i$16 += 1) { + var expr = list$1[i$16]; + c7(expr, st2, "Expression"); + } + }; + base.TemplateElement = ignore; + base.UnaryExpression = base.UpdateExpression = function(node, st2, c7) { + c7(node.argument, st2, "Expression"); + }; + base.BinaryExpression = base.LogicalExpression = function(node, st2, c7) { + c7(node.left, st2, "Expression"); + c7(node.right, st2, "Expression"); + }; + base.AssignmentExpression = base.AssignmentPattern = function(node, st2, c7) { + c7(node.left, st2, "Pattern"); + c7(node.right, st2, "Expression"); + }; + base.ConditionalExpression = function(node, st2, c7) { + c7(node.test, st2, "Expression"); + c7(node.consequent, st2, "Expression"); + c7(node.alternate, st2, "Expression"); + }; + base.NewExpression = base.CallExpression = function(node, st2, c7) { + c7(node.callee, st2, "Expression"); + if (node.arguments) { + for (var i7 = 0, list = node.arguments; i7 < list.length; i7 += 1) { + var arg = list[i7]; + c7(arg, st2, "Expression"); + } + } + }; + base.MemberExpression = function(node, st2, c7) { + c7(node.object, st2, "Expression"); + if (node.computed) { + c7(node.property, st2, "Expression"); + } + }; + base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function(node, st2, c7) { + if (node.declaration) { + c7(node.declaration, st2, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); + } + if (node.source) { + c7(node.source, st2, "Expression"); + } + }; + base.ExportAllDeclaration = function(node, st2, c7) { + if (node.exported) { + c7(node.exported, st2); + } + c7(node.source, st2, "Expression"); + }; + base.ImportDeclaration = function(node, st2, c7) { + for (var i7 = 0, list = node.specifiers; i7 < list.length; i7 += 1) { + var spec = list[i7]; + c7(spec, st2); + } + c7(node.source, st2, "Expression"); + }; + base.ImportExpression = function(node, st2, c7) { + c7(node.source, st2, "Expression"); + }; + base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore; + base.TaggedTemplateExpression = function(node, st2, c7) { + c7(node.tag, st2, "Expression"); + c7(node.quasi, st2, "Expression"); + }; + base.ClassDeclaration = base.ClassExpression = function(node, st2, c7) { + return c7(node, st2, "Class"); + }; + base.Class = function(node, st2, c7) { + if (node.id) { + c7(node.id, st2, "Pattern"); + } + if (node.superClass) { + c7(node.superClass, st2, "Expression"); + } + c7(node.body, st2); + }; + base.ClassBody = function(node, st2, c7) { + for (var i7 = 0, list = node.body; i7 < list.length; i7 += 1) { + var elt = list[i7]; + c7(elt, st2); + } + }; + base.MethodDefinition = base.PropertyDefinition = base.Property = function(node, st2, c7) { + if (node.computed) { + c7(node.key, st2, "Expression"); + } + if (node.value) { + c7(node.value, st2, "Expression"); + } + }; + exports29.ancestor = ancestor; + exports29.base = base; + exports29.findNodeAfter = findNodeAfter; + exports29.findNodeAround = findNodeAround; + exports29.findNodeAt = findNodeAt; + exports29.findNodeBefore = findNodeBefore; + exports29.full = full; + exports29.fullAncestor = fullAncestor; + exports29.make = make; + exports29.recursive = recursive; + exports29.simple = simple; + }); + } +}); + +// node_modules/ts-node/dist-raw/node-internal-repl-await.js +var require_node_internal_repl_await = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-repl-await.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { + ArrayFrom, + ArrayPrototypeForEach, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, + ArrayPrototypePop, + ArrayPrototypePush, + FunctionPrototype, + ObjectKeys, + RegExpPrototypeSymbolReplace, + StringPrototypeEndsWith, + StringPrototypeIncludes, + StringPrototypeIndexOf, + StringPrototypeRepeat, + StringPrototypeSplit, + StringPrototypeStartsWith, + SyntaxError: SyntaxError2 + } = require_node_primordials(); + var parser3 = require_acorn().Parser; + var walk = require_walk(); + var { Recoverable } = (init_empty(), __toCommonJS(empty_exports)); + function isTopLevelDeclaration(state) { + return state.ancestors[state.ancestors.length - 2] === state.body; + } + var noop4 = FunctionPrototype; + var visitorsWithoutAncestors = { + ClassDeclaration(node, state, c7) { + if (isTopLevelDeclaration(state)) { + state.prepend(node, `${node.id.name}=`); + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `let ${node.id.name}; ` + ); + } + walk.base.ClassDeclaration(node, state, c7); + }, + ForOfStatement(node, state, c7) { + if (node.await === true) { + state.containsAwait = true; + } + walk.base.ForOfStatement(node, state, c7); + }, + FunctionDeclaration(node, state, c7) { + state.prepend(node, `${node.id.name}=`); + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `var ${node.id.name}; ` + ); + }, + FunctionExpression: noop4, + ArrowFunctionExpression: noop4, + MethodDefinition: noop4, + AwaitExpression(node, state, c7) { + state.containsAwait = true; + walk.base.AwaitExpression(node, state, c7); + }, + ReturnStatement(node, state, c7) { + state.containsReturn = true; + walk.base.ReturnStatement(node, state, c7); + }, + VariableDeclaration(node, state, c7) { + const variableKind = node.kind; + const isIterableForDeclaration = ArrayPrototypeIncludes( + ["ForOfStatement", "ForInStatement"], + state.ancestors[state.ancestors.length - 2].type + ); + if (variableKind === "var" || isTopLevelDeclaration(state)) { + let registerVariableDeclarationIdentifiers = function(node2) { + switch (node2.type) { + case "Identifier": + ArrayPrototypePush( + variableIdentifiersToHoist[variableKind === "var" ? 0 : 1][1], + node2.name + ); + break; + case "ObjectPattern": + ArrayPrototypeForEach(node2.properties, (property2) => { + registerVariableDeclarationIdentifiers(property2.value); + }); + break; + case "ArrayPattern": + ArrayPrototypeForEach(node2.elements, (element) => { + registerVariableDeclarationIdentifiers(element); + }); + break; + } + }; + state.replace( + node.start, + node.start + variableKind.length + (isIterableForDeclaration ? 1 : 0), + variableKind === "var" && isIterableForDeclaration ? "" : "void" + (node.declarations.length === 1 ? "" : " (") + ); + if (!isIterableForDeclaration) { + ArrayPrototypeForEach(node.declarations, (decl) => { + state.prepend(decl, "("); + state.append(decl, decl.init ? ")" : "=undefined)"); + }); + if (node.declarations.length !== 1) { + state.append(node.declarations[node.declarations.length - 1], ")"); + } + } + const variableIdentifiersToHoist = [ + ["var", []], + ["let", []] + ]; + ArrayPrototypeForEach(node.declarations, (decl) => { + registerVariableDeclarationIdentifiers(decl.id); + }); + ArrayPrototypeForEach( + variableIdentifiersToHoist, + ({ 0: kind, 1: identifiers }) => { + if (identifiers.length > 0) { + ArrayPrototypePush( + state.hoistedDeclarationStatements, + `${kind} ${ArrayPrototypeJoin(identifiers, ", ")}; ` + ); + } + } + ); + } + walk.base.VariableDeclaration(node, state, c7); + } + }; + var visitors = {}; + for (const nodeType of ObjectKeys(walk.base)) { + const callback = visitorsWithoutAncestors[nodeType] || walk.base[nodeType]; + visitors[nodeType] = (node, state, c7) => { + const isNew = node !== state.ancestors[state.ancestors.length - 1]; + if (isNew) { + ArrayPrototypePush(state.ancestors, node); + } + callback(node, state, c7); + if (isNew) { + ArrayPrototypePop(state.ancestors); + } + }; + } + function processTopLevelAwait(src) { + const wrapPrefix = "(async () => { "; + const wrapped = `${wrapPrefix}${src} })()`; + const wrappedArray = ArrayFrom(wrapped); + let root2; + try { + root2 = parser3.parse(wrapped, { ecmaVersion: "latest" }); + } catch (e10) { + if (StringPrototypeStartsWith(e10.message, "Unterminated ")) + throw new Recoverable(e10); + const awaitPos = StringPrototypeIndexOf(src, "await"); + const errPos = e10.pos - wrapPrefix.length; + if (awaitPos > errPos) + return null; + if (errPos === awaitPos + 6 && StringPrototypeIncludes(e10.message, "Expecting Unicode escape sequence")) + return null; + if (errPos === awaitPos + 7 && StringPrototypeIncludes(e10.message, "Unexpected token")) + return null; + const line = e10.loc.line; + const column = line === 1 ? e10.loc.column - wrapPrefix.length : e10.loc.column; + let message = "\n" + StringPrototypeSplit(src, "\n")[line - 1] + "\n" + StringPrototypeRepeat(" ", column) + "^\n\n" + RegExpPrototypeSymbolReplace(/ \([^)]+\)/, e10.message, ""); + if (StringPrototypeEndsWith(message, "Unexpected token")) + message += " '" + // Wrapper end may cause acorn to report error position after the source + (src.length - 1 >= e10.pos - wrapPrefix.length ? src[e10.pos - wrapPrefix.length] : src[src.length - 1]) + "'"; + throw new SyntaxError2(message); + } + const body = root2.body[0].expression.callee.body; + const state = { + body, + ancestors: [], + hoistedDeclarationStatements: [], + replace(from, to, str2) { + for (let i7 = from; i7 < to; i7++) { + wrappedArray[i7] = ""; + } + if (from === to) + str2 += wrappedArray[from]; + wrappedArray[from] = str2; + }, + prepend(node, str2) { + wrappedArray[node.start] = str2 + wrappedArray[node.start]; + }, + append(node, str2) { + wrappedArray[node.end - 1] += str2; + }, + containsAwait: false, + containsReturn: false + }; + walk.recursive(body, state, visitors); + if (!state.containsAwait || state.containsReturn) { + return null; + } + const last2 = body.body[body.body.length - 1]; + if (last2.type === "ExpressionStatement") { + state.prepend(last2, "return ("); + state.append(last2.expression, ")"); + } + return ArrayPrototypeJoin(state.hoistedDeclarationStatements, "") + ArrayPrototypeJoin(wrappedArray, ""); + } + module5.exports = { + processTopLevelAwait + }; + } +}); + +// node_modules/ts-node/node_modules/diff/dist/diff.js +var require_diff = __commonJS({ + "node_modules/ts-node/node_modules/diff/dist/diff.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = global2 || self, factory(global2.Diff = {})); + })(exports28, function(exports29) { + "use strict"; + function Diff() { + } + Diff.prototype = { + diff: function diff(oldString, newString) { + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var callback = options.callback; + if (typeof options === "function") { + callback = options; + options = {}; + } + this.options = options; + var self2 = this; + function done(value2) { + if (callback) { + setTimeout(function() { + callback(void 0, value2); + }, 0); + return true; + } else { + return value2; + } + } + oldString = this.castInput(oldString); + newString = this.castInput(newString); + oldString = this.removeEmpty(this.tokenize(oldString)); + newString = this.removeEmpty(this.tokenize(newString)); + var newLen = newString.length, oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + var bestPath = [{ + newPos: -1, + components: [] + }]; + var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + return done([{ + value: this.join(newString), + count: newString.length + }]); + } + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath = void 0; + var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + if (addPath) { + bestPath[diagonalPath - 1] = void 0; + } + var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + if (!canAdd && !canRemove) { + bestPath[diagonalPath] = void 0; + continue; + } + if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { + basePath = clonePath(removePath); + self2.pushComponent(basePath.components, void 0, true); + } else { + basePath = addPath; + basePath.newPos++; + self2.pushComponent(basePath.components, true, void 0); + } + _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath); + if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { + return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + } + } + editLength++; + } + if (callback) { + (function exec() { + setTimeout(function() { + if (editLength > maxEditLength) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + pushComponent: function pushComponent(components, added, removed) { + var last2 = components[components.length - 1]; + if (last2 && last2.added === added && last2.removed === removed) { + components[components.length - 1] = { + count: last2.count + 1, + added, + removed + }; + } else { + components.push({ + count: 1, + added, + removed + }); + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { + var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + if (commonCount) { + basePath.components.push({ + count: commonCount + }); + } + basePath.newPos = newPos; + return oldPos; + }, + equals: function equals(left, right) { + if (this.options.comparator) { + return this.options.comparator(left, right); + } else { + return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i7 = 0; i7 < array.length; i7++) { + if (array[i7]) { + ret.push(array[i7]); + } + } + return ret; + }, + castInput: function castInput(value2) { + return value2; + }, + tokenize: function tokenize(value2) { + return value2.split(""); + }, + join: function join3(chars) { + return chars.join(""); + } + }; + function buildValues(diff, components, newString, oldString, useLongestToken) { + var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value2 = newString.slice(newPos, newPos + component.count); + value2 = value2.map(function(value3, i7) { + var oldValue = oldString[oldPos + i7]; + return oldValue.length > value3.length ? oldValue : value3; + }); + component.value = diff.join(value2); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + if (componentPos && components[componentPos - 1].added) { + var tmp = components[componentPos - 1]; + components[componentPos - 1] = components[componentPos]; + components[componentPos] = tmp; + } + } + } + var lastComponent = components[componentLen - 1]; + if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + return components; + } + function clonePath(path2) { + return { + newPos: path2.newPos, + components: path2.components.slice(0) + }; + } + var characterDiff = new Diff(); + function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); + } + function generateOptions(options, defaults2) { + if (typeof options === "function") { + defaults2.callback = options; + } else if (options) { + for (var name2 in options) { + if (options.hasOwnProperty(name2)) { + defaults2[name2] = options[name2]; + } + } + } + return defaults2; + } + var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; + var reWhitespace2 = /\S/; + var wordDiff = new Diff(); + wordDiff.equals = function(left, right) { + if (this.options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left === right || this.options.ignoreWhitespace && !reWhitespace2.test(left) && !reWhitespace2.test(right); + }; + wordDiff.tokenize = function(value2) { + var tokens = value2.split(/(\s+|[()[\]{}'"]|\b)/); + for (var i7 = 0; i7 < tokens.length - 1; i7++) { + if (!tokens[i7 + 1] && tokens[i7 + 2] && extendedWordChars.test(tokens[i7]) && extendedWordChars.test(tokens[i7 + 2])) { + tokens[i7] += tokens[i7 + 2]; + tokens.splice(i7 + 1, 2); + i7--; + } + } + return tokens; + }; + function diffWords(oldStr, newStr, options) { + options = generateOptions(options, { + ignoreWhitespace: true + }); + return wordDiff.diff(oldStr, newStr, options); + } + function diffWordsWithSpace(oldStr, newStr, options) { + return wordDiff.diff(oldStr, newStr, options); + } + var lineDiff = new Diff(); + lineDiff.tokenize = function(value2) { + var retLines = [], linesAndNewlines = value2.split(/(\n|\r\n)/); + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + for (var i7 = 0; i7 < linesAndNewlines.length; i7++) { + var line = linesAndNewlines[i7]; + if (i7 % 2 && !this.options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + if (this.options.ignoreWhitespace) { + line = line.trim(); + } + retLines.push(line); + } + } + return retLines; + }; + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + function diffTrimmedLines(oldStr, newStr, callback) { + var options = generateOptions(callback, { + ignoreWhitespace: true + }); + return lineDiff.diff(oldStr, newStr, options); + } + var sentenceDiff = new Diff(); + sentenceDiff.tokenize = function(value2) { + return value2.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + var cssDiff = new Diff(); + cssDiff.tokenize = function(value2) { + return value2.split(/([{}:;,]|\s+)/); + }; + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + function _typeof3(obj) { + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof3 = function(obj2) { + return typeof obj2; + }; + } else { + _typeof3 = function(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof3(obj); + } + function _toConsumableArray3(arr) { + return _arrayWithoutHoles3(arr) || _iterableToArray3(arr) || _nonIterableSpread3(); + } + function _arrayWithoutHoles3(arr) { + if (Array.isArray(arr)) { + for (var i7 = 0, arr2 = new Array(arr.length); i7 < arr.length; i7++) + arr2[i7] = arr[i7]; + return arr2; + } + } + function _iterableToArray3(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") + return Array.from(iter); + } + function _nonIterableSpread3() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); + } + var objectPrototypeToString = Object.prototype.toString; + var jsonDiff = new Diff(); + jsonDiff.useLongestToken = true; + jsonDiff.tokenize = lineDiff.tokenize; + jsonDiff.castInput = function(value2) { + var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k6, v8) { + return typeof v8 === "undefined" ? undefinedReplacement : v8; + } : _this$options$stringi; + return typeof value2 === "string" ? value2 : JSON.stringify(canonicalize(value2, null, null, stringifyReplacer), stringifyReplacer, " "); + }; + jsonDiff.equals = function(left, right) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); + }; + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + function canonicalize(obj, stack, replacementStack, replacer, key) { + stack = stack || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key, obj); + } + var i7; + for (i7 = 0; i7 < stack.length; i7 += 1) { + if (stack[i7] === obj) { + return replacementStack[i7]; + } + } + var canonicalizedObj; + if ("[object Array]" === objectPrototypeToString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i7 = 0; i7 < obj.length; i7 += 1) { + canonicalizedObj[i7] = canonicalize(obj[i7], stack, replacementStack, replacer, key); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof3(obj) === "object" && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], _key; + for (_key in obj) { + if (obj.hasOwnProperty(_key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i7 = 0; i7 < sortedKeys.length; i7 += 1) { + _key = sortedKeys[i7]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + var arrayDiff = new Diff(); + arrayDiff.tokenize = function(value2) { + return value2.slice(); + }; + arrayDiff.join = arrayDiff.removeEmpty = function(value2) { + return value2; + }; + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + function parsePatch(uniDiff) { + var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; + var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i7 = 0; + function parseIndex() { + var index4 = {}; + list.push(index4); + while (i7 < diffstr.length) { + var line = diffstr[i7]; + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index4.index = header[1]; + } + i7++; + } + parseFileHeader(index4); + parseFileHeader(index4); + index4.hunks = []; + while (i7 < diffstr.length) { + var _line = diffstr[i7]; + if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index4.hunks.push(parseHunk()); + } else if (_line && options.strict) { + throw new Error("Unknown line " + (i7 + 1) + " " + JSON.stringify(_line)); + } else { + i7++; + } + } + } + function parseFileHeader(index4) { + var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i7]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === "---" ? "old" : "new"; + var data = fileHeader[2].split(" ", 2); + var fileName = data[0].replace(/\\\\/g, "\\"); + if (/^".*"$/.test(fileName)) { + fileName = fileName.substr(1, fileName.length - 2); + } + index4[keyPrefix + "FileName"] = fileName; + index4[keyPrefix + "Header"] = (data[1] || "").trim(); + i7++; + } + } + function parseHunk() { + var chunkHeaderIndex = i7, chunkHeaderLine = diffstr[i7++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + var hunk = { + oldStart: +chunkHeader[1], + oldLines: +chunkHeader[2] || 1, + newStart: +chunkHeader[3], + newLines: +chunkHeader[4] || 1, + lines: [], + linedelimiters: [] + }; + var addCount = 0, removeCount = 0; + for (; i7 < diffstr.length; i7++) { + if (diffstr[i7].indexOf("--- ") === 0 && i7 + 2 < diffstr.length && diffstr[i7 + 1].indexOf("+++ ") === 0 && diffstr[i7 + 2].indexOf("@@") === 0) { + break; + } + var operation = diffstr[i7].length == 0 && i7 != diffstr.length - 1 ? " " : diffstr[i7][0]; + if (operation === "+" || operation === "-" || operation === " " || operation === "\\") { + hunk.lines.push(diffstr[i7]); + hunk.linedelimiters.push(delimiters[i7] || "\n"); + if (operation === "+") { + addCount++; + } else if (operation === "-") { + removeCount++; + } else if (operation === " ") { + addCount++; + removeCount++; + } + } else { + break; + } + } + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + if (options.strict) { + if (addCount !== hunk.newLines) { + throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1)); + } + } + return hunk; + } + while (i7 < diffstr.length) { + parseIndex(); + } + return list; + } + function distanceIterator(start, minLine, maxLine) { + var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + if (start + localOffset <= maxLine) { + return localOffset; + } + forwardExhausted = true; + } + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + if (minLine <= start - localOffset) { + return -localOffset++; + } + backwardExhausted = true; + return iterator(); + } + }; + } + function applyPatch(source, uniDiff) { + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + if (typeof uniDiff === "string") { + uniDiff = parsePatch(uniDiff); + } + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error("applyPatch only works with a single input."); + } + uniDiff = uniDiff[0]; + } + var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function(lineNumber, line2, operation2, patchContent) { + return line2 === patchContent; + }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL, addEOFNL; + function hunkFits(hunk2, toPos2) { + for (var j7 = 0; j7 < hunk2.lines.length; j7++) { + var line2 = hunk2.lines[j7], operation2 = line2.length > 0 ? line2[0] : " ", content2 = line2.length > 0 ? line2.substr(1) : line2; + if (operation2 === " " || operation2 === "-") { + if (!compareLine(toPos2 + 1, lines[toPos2], operation2, content2)) { + errorCount++; + if (errorCount > fuzzFactor) { + return false; + } + } + toPos2++; + } + } + return true; + } + for (var i7 = 0; i7 < hunks.length; i7++) { + var hunk = hunks[i7], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; + var iterator = distanceIterator(toPos, minLine, maxLine); + for (; localOffset !== void 0; localOffset = iterator()) { + if (hunkFits(hunk, toPos + localOffset)) { + hunk.offset = offset += localOffset; + break; + } + } + if (localOffset === void 0) { + return false; + } + minLine = hunk.offset + hunk.oldStart + hunk.oldLines; + } + var diffOffset = 0; + for (var _i = 0; _i < hunks.length; _i++) { + var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; + diffOffset += _hunk.newLines - _hunk.oldLines; + if (_toPos < 0) { + _toPos = 0; + } + for (var j6 = 0; j6 < _hunk.lines.length; j6++) { + var line = _hunk.lines[j6], operation = line.length > 0 ? line[0] : " ", content = line.length > 0 ? line.substr(1) : line, delimiter2 = _hunk.linedelimiters[j6]; + if (operation === " ") { + _toPos++; + } else if (operation === "-") { + lines.splice(_toPos, 1); + delimiters.splice(_toPos, 1); + } else if (operation === "+") { + lines.splice(_toPos, 0, content); + delimiters.splice(_toPos, 0, delimiter2); + _toPos++; + } else if (operation === "\\") { + var previousOperation = _hunk.lines[j6 - 1] ? _hunk.lines[j6 - 1][0] : null; + if (previousOperation === "+") { + removeEOFNL = true; + } else if (previousOperation === "-") { + addEOFNL = true; + } + } + } + } + if (removeEOFNL) { + while (!lines[lines.length - 1]) { + lines.pop(); + delimiters.pop(); + } + } else if (addEOFNL) { + lines.push(""); + delimiters.push("\n"); + } + for (var _k = 0; _k < lines.length - 1; _k++) { + lines[_k] = lines[_k] + delimiters[_k]; + } + return lines.join(""); + } + function applyPatches(uniDiff, options) { + if (typeof uniDiff === "string") { + uniDiff = parsePatch(uniDiff); + } + var currentIndex = 0; + function processIndex() { + var index4 = uniDiff[currentIndex++]; + if (!index4) { + return options.complete(); + } + options.loadFile(index4, function(err, data) { + if (err) { + return options.complete(err); + } + var updatedContent = applyPatch(data, index4, options); + options.patched(index4, updatedContent, function(err2) { + if (err2) { + return options.complete(err2); + } + processIndex(); + }); + }); + } + processIndex(); + } + function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options.context === "undefined") { + options.context = 4; + } + var diff = diffLines(oldStr, newStr, options); + diff.push({ + value: "", + lines: [] + }); + function contextLines(lines) { + return lines.map(function(entry) { + return " " + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; + var _loop = function _loop2(i8) { + var current = diff[i8], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + if (!oldRangeStart) { + var prev = diff[i8 - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + (_curRange = curRange).push.apply(_curRange, _toConsumableArray3(lines.map(function(entry) { + return (current.added ? "+" : "-") + entry; + }))); + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + if (oldRangeStart) { + if (lines.length <= options.context * 2 && i8 < diff.length - 2) { + var _curRange2; + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray3(contextLines(lines))); + } else { + var _curRange3; + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray3(contextLines(lines.slice(0, contextSize)))); + var hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + if (i8 >= diff.length - 2 && lines.length <= options.context) { + var oldEOFNewline = /\n$/.test(oldStr); + var newEOFNewline = /\n$/.test(newStr); + var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; + if (!oldEOFNewline && noNlBeforeAdds) { + curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file"); + } + if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { + curRange.push("\\ No newline at end of file"); + } + } + hunks.push(hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i7 = 0; i7 < diff.length; i7++) { + _loop(i7); + } + return { + oldFileName, + newFileName, + oldHeader, + newHeader, + hunks + }; + } + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + var ret = []; + if (oldFileName == newFileName) { + ret.push("Index: " + oldFileName); + } + ret.push("==================================================================="); + ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader)); + ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader)); + for (var i7 = 0; i7 < diff.hunks.length; i7++) { + var hunk = diff.hunks[i7]; + ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); + ret.push.apply(ret, hunk.lines); + } + return ret.join("\n") + "\n"; + } + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); + } + function arrayEqual(a7, b8) { + if (a7.length !== b8.length) { + return false; + } + return arrayStartsWith(a7, b8); + } + function arrayStartsWith(array, start) { + if (start.length > array.length) { + return false; + } + for (var i7 = 0; i7 < start.length; i7++) { + if (start[i7] !== array[i7]) { + return false; + } + } + return true; + } + function calcLineCount(hunk) { + var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines; + if (oldLines !== void 0) { + hunk.oldLines = oldLines; + } else { + delete hunk.oldLines; + } + if (newLines !== void 0) { + hunk.newLines = newLines; + } else { + delete hunk.newLines; + } + } + function merge7(mine, theirs, base) { + mine = loadPatch(mine, base); + theirs = loadPatch(theirs, base); + var ret = {}; + if (mine.index || theirs.index) { + ret.index = mine.index || theirs.index; + } + if (mine.newFileName || theirs.newFileName) { + if (!fileNameChanged(mine)) { + ret.oldFileName = theirs.oldFileName || mine.oldFileName; + ret.newFileName = theirs.newFileName || mine.newFileName; + ret.oldHeader = theirs.oldHeader || mine.oldHeader; + ret.newHeader = theirs.newHeader || mine.newHeader; + } else if (!fileNameChanged(theirs)) { + ret.oldFileName = mine.oldFileName; + ret.newFileName = mine.newFileName; + ret.oldHeader = mine.oldHeader; + ret.newHeader = mine.newHeader; + } else { + ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); + ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); + ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); + ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); + } + } + ret.hunks = []; + var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; + while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { + var mineCurrent = mine.hunks[mineIndex] || { + oldStart: Infinity + }, theirsCurrent = theirs.hunks[theirsIndex] || { + oldStart: Infinity + }; + if (hunkBefore(mineCurrent, theirsCurrent)) { + ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); + mineIndex++; + theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; + } else if (hunkBefore(theirsCurrent, mineCurrent)) { + ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); + theirsIndex++; + mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; + } else { + var mergedHunk = { + oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), + oldLines: 0, + newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), + newLines: 0, + lines: [] + }; + mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); + theirsIndex++; + mineIndex++; + ret.hunks.push(mergedHunk); + } + } + return ret; + } + function loadPatch(param, base) { + if (typeof param === "string") { + if (/^@@/m.test(param) || /^Index:/m.test(param)) { + return parsePatch(param)[0]; + } + if (!base) { + throw new Error("Must provide a base reference or pass in a patch"); + } + return structuredPatch(void 0, void 0, base, param); + } + return param; + } + function fileNameChanged(patch) { + return patch.newFileName && patch.newFileName !== patch.oldFileName; + } + function selectField(index4, mine, theirs) { + if (mine === theirs) { + return mine; + } else { + index4.conflict = true; + return { + mine, + theirs + }; + } + } + function hunkBefore(test, check) { + return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; + } + function cloneHunk(hunk, offset) { + return { + oldStart: hunk.oldStart, + oldLines: hunk.oldLines, + newStart: hunk.newStart + offset, + newLines: hunk.newLines, + lines: hunk.lines + }; + } + function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { + var mine = { + offset: mineOffset, + lines: mineLines, + index: 0 + }, their = { + offset: theirOffset, + lines: theirLines, + index: 0 + }; + insertLeading(hunk, mine, their); + insertLeading(hunk, their, mine); + while (mine.index < mine.lines.length && their.index < their.lines.length) { + var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; + if ((mineCurrent[0] === "-" || mineCurrent[0] === "+") && (theirCurrent[0] === "-" || theirCurrent[0] === "+")) { + mutualChange(hunk, mine, their); + } else if (mineCurrent[0] === "+" && theirCurrent[0] === " ") { + var _hunk$lines; + (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray3(collectChange(mine))); + } else if (theirCurrent[0] === "+" && mineCurrent[0] === " ") { + var _hunk$lines2; + (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray3(collectChange(their))); + } else if (mineCurrent[0] === "-" && theirCurrent[0] === " ") { + removal(hunk, mine, their); + } else if (theirCurrent[0] === "-" && mineCurrent[0] === " ") { + removal(hunk, their, mine, true); + } else if (mineCurrent === theirCurrent) { + hunk.lines.push(mineCurrent); + mine.index++; + their.index++; + } else { + conflict(hunk, collectChange(mine), collectChange(their)); + } + } + insertTrailing(hunk, mine); + insertTrailing(hunk, their); + calcLineCount(hunk); + } + function mutualChange(hunk, mine, their) { + var myChanges = collectChange(mine), theirChanges = collectChange(their); + if (allRemoves(myChanges) && allRemoves(theirChanges)) { + if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { + var _hunk$lines3; + (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray3(myChanges)); + return; + } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { + var _hunk$lines4; + (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray3(theirChanges)); + return; + } + } else if (arrayEqual(myChanges, theirChanges)) { + var _hunk$lines5; + (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray3(myChanges)); + return; + } + conflict(hunk, myChanges, theirChanges); + } + function removal(hunk, mine, their, swap) { + var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); + if (theirChanges.merged) { + var _hunk$lines6; + (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray3(theirChanges.merged)); + } else { + conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); + } + } + function conflict(hunk, mine, their) { + hunk.conflict = true; + hunk.lines.push({ + conflict: true, + mine, + theirs: their + }); + } + function insertLeading(hunk, insert, their) { + while (insert.offset < their.offset && insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + insert.offset++; + } + } + function insertTrailing(hunk, insert) { + while (insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + } + } + function collectChange(state) { + var ret = [], operation = state.lines[state.index][0]; + while (state.index < state.lines.length) { + var line = state.lines[state.index]; + if (operation === "-" && line[0] === "+") { + operation = "+"; + } + if (operation === line[0]) { + ret.push(line); + state.index++; + } else { + break; + } + } + return ret; + } + function collectContext(state, matchChanges) { + var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; + while (matchIndex < matchChanges.length && state.index < state.lines.length) { + var change = state.lines[state.index], match = matchChanges[matchIndex]; + if (match[0] === "+") { + break; + } + contextChanges = contextChanges || change[0] !== " "; + merged.push(match); + matchIndex++; + if (change[0] === "+") { + conflicted = true; + while (change[0] === "+") { + changes.push(change); + change = state.lines[++state.index]; + } + } + if (match.substr(1) === change.substr(1)) { + changes.push(change); + state.index++; + } else { + conflicted = true; + } + } + if ((matchChanges[matchIndex] || "")[0] === "+" && contextChanges) { + conflicted = true; + } + if (conflicted) { + return changes; + } + while (matchIndex < matchChanges.length) { + merged.push(matchChanges[matchIndex++]); + } + return { + merged, + changes + }; + } + function allRemoves(changes) { + return changes.reduce(function(prev, change) { + return prev && change[0] === "-"; + }, true); + } + function skipRemoveSuperset(state, removeChanges, delta) { + for (var i7 = 0; i7 < delta; i7++) { + var changeContent = removeChanges[removeChanges.length - delta + i7].substr(1); + if (state.lines[state.index + i7] !== " " + changeContent) { + return false; + } + } + state.index += delta; + return true; + } + function calcOldNewLineCount(lines) { + var oldLines = 0; + var newLines = 0; + lines.forEach(function(line) { + if (typeof line !== "string") { + var myCount = calcOldNewLineCount(line.mine); + var theirCount = calcOldNewLineCount(line.theirs); + if (oldLines !== void 0) { + if (myCount.oldLines === theirCount.oldLines) { + oldLines += myCount.oldLines; + } else { + oldLines = void 0; + } + } + if (newLines !== void 0) { + if (myCount.newLines === theirCount.newLines) { + newLines += myCount.newLines; + } else { + newLines = void 0; + } + } + } else { + if (newLines !== void 0 && (line[0] === "+" || line[0] === " ")) { + newLines++; + } + if (oldLines !== void 0 && (line[0] === "-" || line[0] === " ")) { + oldLines++; + } + } + }); + return { + oldLines, + newLines + }; + } + function convertChangesToDMP(changes) { + var ret = [], change, operation; + for (var i7 = 0; i7 < changes.length; i7++) { + change = changes[i7]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + ret.push([operation, change.value]); + } + return ret; + } + function convertChangesToXML(changes) { + var ret = []; + for (var i7 = 0; i7 < changes.length; i7++) { + var change = changes[i7]; + if (change.added) { + ret.push(""); + } else if (change.removed) { + ret.push(""); + } + ret.push(escapeHTML(change.value)); + if (change.added) { + ret.push(""); + } else if (change.removed) { + ret.push(""); + } + } + return ret.join(""); + } + function escapeHTML(s7) { + var n7 = s7; + n7 = n7.replace(/&/g, "&"); + n7 = n7.replace(//g, ">"); + n7 = n7.replace(/"/g, """); + return n7; + } + exports29.Diff = Diff; + exports29.diffChars = diffChars; + exports29.diffWords = diffWords; + exports29.diffWordsWithSpace = diffWordsWithSpace; + exports29.diffLines = diffLines; + exports29.diffTrimmedLines = diffTrimmedLines; + exports29.diffSentences = diffSentences; + exports29.diffCss = diffCss; + exports29.diffJson = diffJson; + exports29.diffArrays = diffArrays; + exports29.structuredPatch = structuredPatch; + exports29.createTwoFilesPatch = createTwoFilesPatch; + exports29.createPatch = createPatch; + exports29.applyPatch = applyPatch; + exports29.applyPatches = applyPatches; + exports29.parsePatch = parsePatch; + exports29.merge = merge7; + exports29.convertChangesToDMP = convertChangesToDMP; + exports29.convertChangesToXML = convertChangesToXML; + exports29.canonicalize = canonicalize; + Object.defineProperty(exports29, "__esModule", { value: true }); + }); + } +}); + +// node_modules/ts-node/dist/repl.js +var require_repl = __commonJS({ + "node_modules/ts-node/dist/repl.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.setupContext = exports28.createEvalAwarePartialHost = exports28.EvalState = exports28.createRepl = exports28.REPL_NAME = exports28.REPL_FILENAME = exports28.STDIN_NAME = exports28.STDIN_FILENAME = exports28.EVAL_NAME = exports28.EVAL_FILENAME = void 0; + var os_1 = (init_os(), __toCommonJS(os_exports)); + var path_1 = (init_path(), __toCommonJS(path_exports)); + var repl_1 = (init_empty(), __toCommonJS(empty_exports)); + var vm_1 = (init_vm(), __toCommonJS(vm_exports)); + var index_1 = require_dist16(); + var fs_1 = (init_fs(), __toCommonJS(fs_exports)); + var console_1 = (init_console(), __toCommonJS(console_exports)); + var assert4 = (init_assert(), __toCommonJS(assert_exports)); + var module_1 = (init_module(), __toCommonJS(module_exports)); + var _processTopLevelAwait; + function getProcessTopLevelAwait() { + if (_processTopLevelAwait === void 0) { + ({ + processTopLevelAwait: _processTopLevelAwait + } = require_node_internal_repl_await()); + } + return _processTopLevelAwait; + } + var diff; + function getDiffLines() { + if (diff === void 0) { + diff = require_diff(); + } + return diff.diffLines; + } + exports28.EVAL_FILENAME = `[eval].ts`; + exports28.EVAL_NAME = `[eval]`; + exports28.STDIN_FILENAME = `[stdin].ts`; + exports28.STDIN_NAME = `[stdin]`; + exports28.REPL_FILENAME = ".ts"; + exports28.REPL_NAME = ""; + function createRepl(options = {}) { + var _a2, _b, _c, _d, _e2; + const { ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl = true } = options; + let service = options.service; + let nodeReplServer; + let context2; + const state = (_a2 = options.state) !== null && _a2 !== void 0 ? _a2 : new EvalState((0, path_1.join)(process.cwd(), exports28.REPL_FILENAME)); + const evalAwarePartialHost = createEvalAwarePartialHost(state, options.composeWithEvalAwarePartialHost); + const stdin3 = (_b = options.stdin) !== null && _b !== void 0 ? _b : process.stdin; + const stdout3 = (_c = options.stdout) !== null && _c !== void 0 ? _c : process.stdout; + const stderr3 = (_d = options.stderr) !== null && _d !== void 0 ? _d : process.stderr; + const _console = stdout3 === process.stdout && stderr3 === process.stderr ? console : new console_1.Console(stdout3, stderr3); + const replService = { + state: (_e2 = options.state) !== null && _e2 !== void 0 ? _e2 : new EvalState((0, path_1.join)(process.cwd(), exports28.EVAL_FILENAME)), + setService, + evalCode, + evalCodeInternal, + nodeEval, + evalAwarePartialHost, + start, + startInternal, + stdin: stdin3, + stdout: stdout3, + stderr: stderr3, + console: _console + }; + return replService; + function setService(_service) { + service = _service; + if (ignoreDiagnosticsThatAreAnnoyingInInteractiveRepl) { + service.addDiagnosticFilter({ + appliesToAllFiles: false, + filenamesAbsolute: [state.path], + diagnosticsIgnored: [ + 2393, + 6133, + 7027, + ...service.shouldReplAwait ? topLevelAwaitDiagnosticCodes : [] + ] + }); + } + } + function evalCode(code) { + const result2 = appendCompileAndEvalInput({ + service, + state, + input: code, + context: context2, + overrideIsCompletion: false + }); + assert4(result2.containsTopLevelAwait === false); + return result2.value; + } + function evalCodeInternal(options2) { + const { code, enableTopLevelAwait, context: context3 } = options2; + return appendCompileAndEvalInput({ + service, + state, + input: code, + enableTopLevelAwait, + context: context3 + }); + } + function nodeEval(code, context3, _filename, callback) { + if (code === ".scope") { + callback(null); + return; + } + try { + const evalResult = evalCodeInternal({ + code, + enableTopLevelAwait: true, + context: context3 + }); + if (evalResult.containsTopLevelAwait) { + (async () => { + try { + callback(null, await evalResult.valuePromise); + } catch (promiseError) { + handleError(promiseError); + } + })(); + } else { + callback(null, evalResult.value); + } + } catch (error2) { + handleError(error2); + } + function handleError(error2) { + var _a3, _b2; + const canLogTopLevelAwaitHint = service.options.experimentalReplAwait !== false && !service.shouldReplAwait; + if (error2 instanceof index_1.TSError) { + if (repl_1.Recoverable && isRecoverable(error2)) { + callback(new repl_1.Recoverable(error2)); + return; + } else { + _console.error(error2); + if (canLogTopLevelAwaitHint && error2.diagnosticCodes.some((dC) => topLevelAwaitDiagnosticCodes.includes(dC))) { + _console.error(getTopLevelAwaitHint()); + } + callback(null); + } + } else { + let _error = error2; + if (canLogTopLevelAwaitHint && _error instanceof SyntaxError && ((_a3 = _error.message) === null || _a3 === void 0 ? void 0 : _a3.includes("await is only valid"))) { + try { + _error.message += ` + +${getTopLevelAwaitHint()}`; + _error.stack = (_b2 = _error.stack) === null || _b2 === void 0 ? void 0 : _b2.replace(/(SyntaxError:.*)/, (_6, $1) => `${$1} + +${getTopLevelAwaitHint()}`); + } catch { + } + } + callback(_error); + } + } + function getTopLevelAwaitHint() { + return `Hint: REPL top-level await requires TypeScript version 3.8 or higher and target ES2018 or higher. You are using TypeScript ${service.ts.version} and target ${service.ts.ScriptTarget[service.config.options.target]}.`; + } + } + function start(code) { + startInternal({ code }); + } + function startInternal(options2) { + const { code, forceToBeModule = true, ...optionsOverride } = options2 !== null && options2 !== void 0 ? options2 : {}; + if (code) { + try { + evalCode(`${code} +`); + } catch (err) { + _console.error(err); + process.exit(1); + } + } + service === null || service === void 0 ? void 0 : service.compile("", state.path); + const repl = (0, repl_1.start)({ + prompt: "> ", + input: replService.stdin, + output: replService.stdout, + // Mimicking node's REPL implementation: https://github.com/nodejs/node/blob/168b22ba073ee1cbf8d0bcb4ded7ff3099335d04/lib/internal/repl.js#L28-L30 + terminal: stdout3.isTTY && !parseInt(index_1.env.NODE_NO_READLINE, 10), + eval: nodeEval, + useGlobal: true, + ...optionsOverride + }); + nodeReplServer = repl; + context2 = repl.context; + const resetEval = appendToEvalState(state, ""); + function reset() { + resetEval(); + runInContext2("exports = module.exports", state.path, context2); + if (forceToBeModule) { + state.input += "export {};void 0;\n"; + } + if (!(service === null || service === void 0 ? void 0 : service.transpileOnly)) { + state.input += `// @ts-ignore +${module_1.builtinModules.filter((name2) => !name2.startsWith("_") && !name2.includes("/") && !["console", "module", "process"].includes(name2)).map((name2) => `declare import ${name2} = require('${name2}')`).join(";")} +`; + } + } + reset(); + repl.on("reset", reset); + repl.defineCommand("type", { + help: "Check the type of a TypeScript identifier", + action: function(identifier) { + if (!identifier) { + repl.displayPrompt(); + return; + } + const undo = appendToEvalState(state, identifier); + const { name: name2, comment } = service.getTypeInfo(state.input, state.path, state.input.length); + undo(); + if (name2) + repl.outputStream.write(`${name2} +`); + if (comment) + repl.outputStream.write(`${comment} +`); + repl.displayPrompt(); + } + }); + if (repl.setupHistory) { + const historyPath = index_1.env.TS_NODE_HISTORY || (0, path_1.join)((0, os_1.homedir)(), ".ts_node_repl_history"); + repl.setupHistory(historyPath, (err) => { + if (!err) + return; + _console.error(err); + process.exit(1); + }); + } + return repl; + } + } + exports28.createRepl = createRepl; + var EvalState = class { + constructor(path2) { + this.path = path2; + this.input = ""; + this.output = ""; + this.version = 0; + this.lines = 0; + } + }; + exports28.EvalState = EvalState; + function createEvalAwarePartialHost(state, composeWith) { + function readFile2(path2) { + if (path2 === state.path) + return state.input; + if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.readFile) + return composeWith.readFile(path2); + try { + return (0, fs_1.readFileSync)(path2, "utf8"); + } catch (err) { + } + } + function fileExists(path2) { + if (path2 === state.path) + return true; + if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.fileExists) + return composeWith.fileExists(path2); + try { + const stats = (0, fs_1.statSync)(path2); + return stats.isFile() || stats.isFIFO(); + } catch (err) { + return false; + } + } + return { readFile: readFile2, fileExists }; + } + exports28.createEvalAwarePartialHost = createEvalAwarePartialHost; + var sourcemapCommentRe = /\/\/# ?sourceMappingURL=\S+[\s\r\n]*$/; + function appendCompileAndEvalInput(options) { + const { service, state, wrappedErr, enableTopLevelAwait = false, context: context2, overrideIsCompletion } = options; + let { input } = options; + let wrappedCmd = false; + if (!wrappedErr && /^\s*{/.test(input) && !/;\s*$/.test(input)) { + input = `(${input.trim()}) +`; + wrappedCmd = true; + } + const lines = state.lines; + const isCompletion = overrideIsCompletion !== null && overrideIsCompletion !== void 0 ? overrideIsCompletion : !/\n$/.test(input); + const undo = appendToEvalState(state, input); + let output; + function adjustUseStrict(code) { + return code.replace(/^"use strict";/, '"use strict"; void 0;'); + } + try { + output = service.compile(state.input, state.path, -lines); + } catch (err) { + undo(); + if (wrappedCmd) { + if (err instanceof index_1.TSError && err.diagnosticCodes[0] === 2339) { + throw err; + } + return appendCompileAndEvalInput({ + ...options, + wrappedErr: err + }); + } + if (wrappedErr) + throw wrappedErr; + throw err; + } + output = adjustUseStrict(output); + const outputWithoutSourcemapComment = output.replace(sourcemapCommentRe, ""); + const oldOutputWithoutSourcemapComment = state.output.replace(sourcemapCommentRe, ""); + const changes = getDiffLines()(oldOutputWithoutSourcemapComment, outputWithoutSourcemapComment); + if (isCompletion) { + undo(); + } else { + state.output = output; + state.input = state.input.replace(/([^\n\s])([\n\s]*)$/, (all, lastChar, whitespace) => { + if (lastChar !== ";") + return `${lastChar};${whitespace}`; + return all; + }); + } + let commands = []; + let containsTopLevelAwait = false; + for (const change of changes) { + if (change.added) { + if (enableTopLevelAwait && service.shouldReplAwait && change.value.indexOf("await") > -1) { + const processTopLevelAwait = getProcessTopLevelAwait(); + const wrappedResult = processTopLevelAwait(change.value + "\n"); + if (wrappedResult !== null) { + containsTopLevelAwait = true; + commands.push({ + mustAwait: true, + execCommand: () => runInContext2(wrappedResult, state.path, context2) + }); + continue; + } + } + commands.push({ + execCommand: () => runInContext2(change.value, state.path, context2) + }); + } + } + if (containsTopLevelAwait) { + return { + containsTopLevelAwait, + valuePromise: (async () => { + let value2; + for (const command of commands) { + const r8 = command.execCommand(); + value2 = command.mustAwait ? await r8 : r8; + } + return value2; + })() + }; + } else { + return { + containsTopLevelAwait: false, + value: commands.reduce((_6, c7) => c7.execCommand(), void 0) + }; + } + } + function runInContext2(code, filename, context2) { + const script = new vm_1.Script(code, { filename }); + if (context2 === void 0 || context2 === globalThis) { + return script.runInThisContext(); + } else { + return script.runInContext(context2); + } + } + function appendToEvalState(state, input) { + const undoInput = state.input; + const undoVersion = state.version; + const undoOutput = state.output; + const undoLines = state.lines; + state.input += input; + state.lines += lineCount(input); + state.version++; + return function() { + state.input = undoInput; + state.output = undoOutput; + state.version = undoVersion; + state.lines = undoLines; + }; + } + function lineCount(value2) { + let count2 = 0; + for (const char of value2) { + if (char === "\n") { + count2++; + } + } + return count2; + } + var RECOVERY_CODES = /* @__PURE__ */ new Map([ + [1003, null], + [1005, null], + [1109, null], + [1126, null], + [ + 1136, + /* @__PURE__ */ new Set([1005]) + // happens when typing out an object literal or block scope across multiple lines: '{ foo: 123,' + ], + [1160, null], + [1161, null], + [2355, null], + [2391, null], + [ + 7010, + /* @__PURE__ */ new Set([1005]) + // happens when fn signature spread across multiple lines: 'function a(\nb: any\n) {' + ] + ]); + var topLevelAwaitDiagnosticCodes = [ + 1375, + 1378, + 1431, + 1432 + // Top-level 'for await' loops are only allowed when the 'module' option is set to 'esnext' or 'system', and the 'target' option is set to 'es2017' or higher. + ]; + function isRecoverable(error2) { + return error2.diagnosticCodes.every((code) => { + const deps = RECOVERY_CODES.get(code); + return deps === null || deps && error2.diagnosticCodes.some((code2) => deps.has(code2)); + }); + } + function setupContext(context2, module6, filenameAndDirname) { + if (filenameAndDirname) { + context2.__dirname = "."; + context2.__filename = `[${filenameAndDirname}]`; + } + context2.module = module6; + context2.exports = module6.exports; + context2.require = module6.require.bind(module6); + } + exports28.setupContext = setupContext; + } +}); + +// node_modules/ts-node/package.json +var require_package = __commonJS({ + "node_modules/ts-node/package.json"(exports28, module5) { + module5.exports = { + name: "ts-node", + version: "10.9.2", + description: "TypeScript execution environment and REPL for node.js, with source map support", + main: "dist/index.js", + exports: { + ".": "./dist/index.js", + "./package": "./package.json", + "./package.json": "./package.json", + "./dist/bin": "./dist/bin.js", + "./dist/bin.js": "./dist/bin.js", + "./dist/bin-transpile": "./dist/bin-transpile.js", + "./dist/bin-transpile.js": "./dist/bin-transpile.js", + "./dist/bin-script": "./dist/bin-script.js", + "./dist/bin-script.js": "./dist/bin-script.js", + "./dist/bin-cwd": "./dist/bin-cwd.js", + "./dist/bin-cwd.js": "./dist/bin-cwd.js", + "./dist/bin-esm": "./dist/bin-esm.js", + "./dist/bin-esm.js": "./dist/bin-esm.js", + "./register": "./register/index.js", + "./register/files": "./register/files.js", + "./register/transpile-only": "./register/transpile-only.js", + "./register/type-check": "./register/type-check.js", + "./esm": "./esm.mjs", + "./esm.mjs": "./esm.mjs", + "./esm/transpile-only": "./esm/transpile-only.mjs", + "./esm/transpile-only.mjs": "./esm/transpile-only.mjs", + "./child-loader.mjs": "./child-loader.mjs", + "./transpilers/swc": "./transpilers/swc.js", + "./transpilers/swc-experimental": "./transpilers/swc-experimental.js", + "./node10/tsconfig.json": "./node10/tsconfig.json", + "./node12/tsconfig.json": "./node12/tsconfig.json", + "./node14/tsconfig.json": "./node14/tsconfig.json", + "./node16/tsconfig.json": "./node16/tsconfig.json" + }, + types: "dist/index.d.ts", + bin: { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + files: [ + "/transpilers/", + "/dist/", + "!/dist/test", + "/dist-raw/NODE-LICENSE.md", + "/dist-raw/**.js", + "/register/", + "/esm/", + "/esm.mjs", + "/child-loader.mjs", + "/LICENSE", + "/tsconfig.schema.json", + "/tsconfig.schemastore-schema.json", + "/node10/", + "/node12/", + "/node14/", + "/node16/" + ], + scripts: { + lint: "dprint check", + "lint-fix": "dprint fmt", + clean: "rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp", + rebuild: "npm run clean && npm run build", + build: "npm run build-nopack && npm run build-pack", + "build-nopack": "npm run build-tsc && npm run build-configSchema", + "build-tsc": "tsc -b ./tsconfig.build-dist.json", + "build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema", + "build-pack": "node ./scripts/build-pack.js", + "test-spec": "ava", + "test-cov": "nyc ava", + test: "npm run build && npm run lint && npm run test-cov --", + "test-local": "npm run lint-fix && npm run build-tsc && npm run build-pack && npm run test-spec --", + "pre-debug": "npm run build-tsc && npm run build-pack", + "coverage-report": "nyc report --reporter=lcov", + prepare: "npm run clean && npm run build-nopack", + "api-extractor": "api-extractor run --local --verbose", + "esm-usage-example": "npm run build-tsc && cd esm-usage-example && node --experimental-specifier-resolution node --loader ../esm.mjs ./index", + "esm-usage-example2": "npm run build-tsc && cd tests && TS_NODE_PROJECT=./module-types/override-to-cjs/tsconfig.json node --loader ../esm.mjs ./module-types/override-to-cjs/test.cjs" + }, + repository: { + type: "git", + url: "git://github.com/TypeStrong/ts-node.git" + }, + keywords: [ + "typescript", + "node", + "runtime", + "environment", + "ts", + "compiler" + ], + author: { + name: "Blake Embrey", + email: "hello@blakeembrey.com", + url: "http://blakeembrey.me" + }, + contributors: [ + { + name: "Andrew Bradley", + email: "cspotcode@gmail.com", + url: "https://github.com/cspotcode" + } + ], + license: "MIT", + bugs: { + url: "https://github.com/TypeStrong/ts-node/issues" + }, + homepage: "https://typestrong.org/ts-node", + devDependencies: { + "@microsoft/api-extractor": "^7.19.4", + "@swc/core": "^1.3.100", + "@swc/wasm": "^1.3.100", + "@types/diff": "^4.0.2", + "@types/lodash": "^4.14.151", + "@types/node": "13.13.5", + "@types/proper-lockfile": "^4.1.2", + "@types/proxyquire": "^1.3.28", + "@types/react": "^16.14.19", + "@types/rimraf": "^3.0.0", + "@types/semver": "^7.1.0", + "@yarnpkg/fslib": "^2.4.0", + ava: "^3.15.0", + axios: "^0.21.1", + dprint: "^0.25.0", + expect: "^27.0.2", + "get-stream": "^6.0.0", + lodash: "^4.17.15", + ntypescript: "^1.201507091536.1", + nyc: "^15.0.1", + outdent: "^0.8.0", + "proper-lockfile": "^4.1.2", + proxyquire: "^2.0.0", + react: "^16.14.0", + rimraf: "^3.0.0", + semver: "^7.1.3", + throat: "^6.0.1", + typedoc: "^0.22.10", + typescript: "4.7.4", + "typescript-json-schema": "^0.53.0", + "util.promisify": "^1.0.1" + }, + peerDependencies: { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + typescript: ">=2.7" + }, + peerDependenciesMeta: { + "@swc/core": { + optional: true + }, + "@swc/wasm": { + optional: true + } + }, + dependencies: { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + acorn: "^8.4.1", + "acorn-walk": "^8.1.1", + arg: "^4.1.0", + "create-require": "^1.1.0", + diff: "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + yn: "3.1.1" + }, + prettier: { + singleQuote: true + }, + volta: { + node: "18.1.0", + npm: "6.14.15" + } + }; + } +}); + +// node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +var require_sourcemap_codec_umd = __commonJS({ + "node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.sourcemapCodec = {})); + })(exports28, function(exports29) { + "use strict"; + const comma = ",".charCodeAt(0); + const semicolon = ";".charCodeAt(0); + const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + const intToChar = new Uint8Array(64); + const charToInt = new Uint8Array(128); + for (let i7 = 0; i7 < chars.length; i7++) { + const c7 = chars.charCodeAt(i7); + intToChar[i7] = c7; + charToInt[c7] = i7; + } + const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } + } : { + decode(buf) { + let out = ""; + for (let i7 = 0; i7 < buf.length; i7++) { + out += String.fromCharCode(buf[i7]); + } + return out; + } + }; + function decode2(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index4 = 0; + do { + const semi = indexOf4(mappings, index4); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i7 = index4; i7 < semi; i7++) { + let seg; + i7 = decodeInteger(mappings, i7, state, 0); + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i7, semi)) { + i7 = decodeInteger(mappings, i7, state, 1); + i7 = decodeInteger(mappings, i7, state, 2); + i7 = decodeInteger(mappings, i7, state, 3); + if (hasMoreVlq(mappings, i7, semi)) { + i7 = decodeInteger(mappings, i7, state, 4); + seg = [col, state[1], state[2], state[3], state[4]]; + } else { + seg = [col, state[1], state[2], state[3]]; + } + } else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index4 = semi + 1; + } while (index4 <= mappings.length); + return decoded; + } + function indexOf4(mappings, index4) { + const idx = mappings.indexOf(";", index4); + return idx === -1 ? mappings.length : idx; + } + function decodeInteger(mappings, pos, state, j6) { + let value2 = 0; + let shift = 0; + let integer = 0; + do { + const c7 = mappings.charCodeAt(pos++); + integer = charToInt[c7]; + value2 |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value2 & 1; + value2 >>>= 1; + if (shouldNegate) { + value2 = -2147483648 | -value2; + } + state[j6] += value2; + return pos; + } + function hasMoreVlq(mappings, i7, length) { + if (i7 >= length) + return false; + return mappings.charCodeAt(i7) !== comma; + } + function sort(line) { + line.sort(sortComparator); + } + function sortComparator(a7, b8) { + return a7[0] - b8[0]; + } + function encode2(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ""; + for (let i7 = 0; i7 < decoded.length; i7++) { + const line = decoded[i7]; + if (i7 > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j6 = 0; j6 < line.length; j6++) { + const segment = line[j6]; + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j6 > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); + pos = encodeInteger(buf, pos, state, segment, 2); + pos = encodeInteger(buf, pos, state, segment, 3); + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); + } + } + return out + td.decode(buf.subarray(0, pos)); + } + function encodeInteger(buf, pos, state, segment, j6) { + const next = segment[j6]; + let num = next - state[j6]; + state[j6] = next; + num = num < 0 ? -num << 1 | 1 : num << 1; + do { + let clamped = num & 31; + num >>>= 5; + if (num > 0) + clamped |= 32; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; + } + exports29.decode = decode2; + exports29.encode = encode2; + Object.defineProperty(exports29, "__esModule", { value: true }); + }); + } +}); + +// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +var require_resolve_uri_umd = __commonJS({ + "node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? module5.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.resolveURI = factory()); + })(exports28, function() { + "use strict"; + const schemeRegex = /^[\w+.-]+:\/\//; + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith("//"); + } + function isAbsolutePath2(input) { + return input.startsWith("/"); + } + function isFileUrl(input) { + return input.startsWith("file:"); + } + function isRelative(input) { + return /^[.?#]/.test(input); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || ""); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path2 = match[2]; + return makeUrl("file:", "", match[1] || "", "", isAbsolutePath2(path2) ? path2 : "/" + path2, match[3] || "", match[4] || ""); + } + function makeUrl(scheme, user, host, port, path2, query, hash) { + return { + scheme, + user, + host, + port, + path: path2, + query, + hash, + type: 7 + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url2 = parseAbsoluteUrl("http:" + input); + url2.scheme = ""; + url2.type = 6; + return url2; + } + if (isAbsolutePath2(input)) { + const url2 = parseAbsoluteUrl("http://foo.com" + input); + url2.scheme = ""; + url2.host = ""; + url2.type = 5; + return url2; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl("http://foo.com/" + input); + url.scheme = ""; + url.host = ""; + url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1; + return url; + } + function stripPathFilename(path2) { + if (path2.endsWith("/..")) + return path2; + const index4 = path2.lastIndexOf("/"); + return path2.slice(0, index4 + 1); + } + function mergePaths(url, base) { + normalizePath(base, base.type); + if (url.path === "/") { + url.path = base.path; + } else { + url.path = stripPathFilename(base.path) + url.path; + } + } + function normalizePath(url, type3) { + const rel = type3 <= 4; + const pieces = url.path.split("/"); + let pointer = 1; + let positive = 0; + let addTrailingSlash = false; + for (let i7 = 1; i7 < pieces.length; i7++) { + const piece = pieces[i7]; + if (!piece) { + addTrailingSlash = true; + continue; + } + addTrailingSlash = false; + if (piece === ".") + continue; + if (piece === "..") { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } else if (rel) { + pieces[pointer++] = piece; + } + continue; + } + pieces[pointer++] = piece; + positive++; + } + let path2 = ""; + for (let i7 = 1; i7 < pointer; i7++) { + path2 += "/" + pieces[i7]; + } + if (!path2 || addTrailingSlash && !path2.endsWith("/..")) { + path2 += "/"; + } + url.path = path2; + } + function resolve3(input, base) { + if (!input && !base) + return ""; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== 7) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1: + url.hash = baseUrl.hash; + case 2: + url.query = baseUrl.query; + case 3: + case 4: + mergePaths(url, baseUrl); + case 5: + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + case 6: + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + case 2: + case 3: + return queryHash; + case 4: { + const path2 = url.path.slice(1); + if (!path2) + return queryHash || "."; + if (isRelative(base || input) && !isRelative(path2)) { + return "./" + path2 + queryHash; + } + return path2 + queryHash; + } + case 5: + return url.path + queryHash; + default: + return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash; + } + } + return resolve3; + }); + } +}); + +// node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +var require_trace_mapping_umd = __commonJS({ + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function(global2, factory) { + typeof exports28 === "object" && typeof module5 !== "undefined" ? factory(exports28, require_sourcemap_codec_umd(), require_resolve_uri_umd()) : typeof define === "function" && define.amd ? define(["exports", "@jridgewell/sourcemap-codec", "@jridgewell/resolve-uri"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.traceMapping = {}, global2.sourcemapCodec, global2.resolveURI)); + })(exports28, function(exports29, sourcemapCodec, resolveUri) { + "use strict"; + function _interopDefaultLegacy(e10) { + return e10 && typeof e10 === "object" && "default" in e10 ? e10 : { "default": e10 }; + } + var resolveUri__default = /* @__PURE__ */ _interopDefaultLegacy(resolveUri); + function resolve3(input, base) { + if (base && !base.endsWith("/")) + base += "/"; + return resolveUri__default["default"](input, base); + } + function stripFilename(path2) { + if (!path2) + return ""; + const index4 = path2.lastIndexOf("/"); + return path2.slice(0, index4 + 1); + } + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + const REV_GENERATED_LINE = 1; + const REV_GENERATED_COLUMN = 2; + function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + if (!owned) + mappings = mappings.slice(); + for (let i7 = unsortedIndex; i7 < mappings.length; i7 = nextUnsortedSegmentLine(mappings, i7 + 1)) { + mappings[i7] = sortSegments(mappings[i7], owned); + } + return mappings; + } + function nextUnsortedSegmentLine(mappings, start) { + for (let i7 = start; i7 < mappings.length; i7++) { + if (!isSorted(mappings[i7])) + return i7; + } + return mappings.length; + } + function isSorted(line) { + for (let j6 = 1; j6 < line.length; j6++) { + if (line[j6][COLUMN] < line[j6 - 1][COLUMN]) { + return false; + } + } + return true; + } + function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); + } + function sortComparator(a7, b8) { + return a7[COLUMN] - b8[COLUMN]; + } + let found = false; + function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + found = false; + return low - 1; + } + function upperBound(haystack, needle, index4) { + for (let i7 = index4 + 1; i7 < haystack.length; i7++, index4++) { + if (haystack[i7][COLUMN] !== needle) + break; + } + return index4; + } + function lowerBound(haystack, needle, index4) { + for (let i7 = index4 - 1; i7 >= 0; i7--, index4--) { + if (haystack[i7][COLUMN] !== needle) + break; + } + return index4; + } + function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; + } + function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); + } + function buildBySources(decoded, memos) { + const sources = memos.map(buildNullArray); + for (let i7 = 0; i7 < decoded.length; i7++) { + const line = decoded[i7]; + for (let j6 = 0; j6 < line.length; j6++) { + const seg = line[j6]; + if (seg.length === 1) + continue; + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const originalSource = sources[sourceIndex]; + const originalLine = originalSource[sourceLine] || (originalSource[sourceLine] = []); + const memo = memos[sourceIndex]; + const index4 = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); + insert(originalLine, memo.lastIndex = index4 + 1, [sourceColumn, i7, seg[COLUMN]]); + } + } + return sources; + } + function insert(array, index4, value2) { + for (let i7 = array.length; i7 > index4; i7--) { + array[i7] = array[i7 - 1]; + } + array[index4] = value2; + } + function buildNullArray() { + return { __proto__: null }; + } + const AnyMap = function(map4, mapUrl) { + const parsed = typeof map4 === "string" ? JSON.parse(map4) : map4; + if (!("sections" in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const { sections } = parsed; + let i7 = 0; + for (; i7 < sections.length - 1; i7++) { + const no = sections[i7 + 1].offset; + addSection(sections[i7], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); + } + if (sections.length > 0) { + addSection(sections[i7], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); + } + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings + }; + return exports29.presortedDecodedMap(joined); + }; + function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { + const map4 = AnyMap(section.map, mapUrl); + const { line: lineOffset, column: columnOffset } = section.offset; + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = exports29.decodedMappings(map4); + const { resolvedSources } = map4; + append(sources, resolvedSources); + append(sourcesContent, map4.sourcesContent || fillSourcesContent(resolvedSources.length)); + append(names, map4.names); + for (let i7 = mappings.length; i7 <= lineOffset; i7++) + mappings.push([]); + const stopI = stopLine - lineOffset; + const len = Math.min(decoded.length, stopI + 1); + for (let i7 = 0; i7 < len; i7++) { + const line = decoded[i7]; + const out = i7 === 0 ? mappings[lineOffset] : mappings[lineOffset + i7] = []; + const cOffset = i7 === 0 ? columnOffset : 0; + for (let j6 = 0; j6 < line.length; j6++) { + const seg = line[j6]; + const column = cOffset + seg[COLUMN]; + if (i7 === stopI && column >= stopColumn) + break; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + if (seg.length === 4) { + out.push([column, sourcesIndex, sourceLine, sourceColumn]); + continue; + } + out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); + } + } + } + function append(arr, other) { + for (let i7 = 0; i7 < other.length; i7++) + arr.push(other[i7]); + } + function fillSourcesContent(len) { + const sourcesContent = []; + for (let i7 = 0; i7 < len; i7++) + sourcesContent[i7] = null; + return sourcesContent; + } + const INVALID_ORIGINAL_MAPPING = Object.freeze({ + source: null, + line: null, + column: null, + name: null + }); + const INVALID_GENERATED_MAPPING = Object.freeze({ + line: null, + column: null + }); + const LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; + const COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; + const LEAST_UPPER_BOUND = -1; + const GREATEST_LOWER_BOUND = 1; + exports29.encodedMappings = void 0; + exports29.decodedMappings = void 0; + exports29.traceSegment = void 0; + exports29.originalPositionFor = void 0; + exports29.generatedPositionFor = void 0; + exports29.eachMapping = void 0; + exports29.presortedDecodedMap = void 0; + exports29.decodedMap = void 0; + exports29.encodedMap = void 0; + class TraceMap { + constructor(map4, mapUrl) { + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + const isString4 = typeof map4 === "string"; + if (!isString4 && map4.constructor === TraceMap) + return map4; + const parsed = isString4 ? JSON.parse(map4) : map4; + const { version: version5, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version5; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + if (sourceRoot || mapUrl) { + const from = resolve3(sourceRoot || "", stripFilename(mapUrl)); + this.resolvedSources = sources.map((s7) => resolve3(s7 || "", from)); + } else { + this.resolvedSources = sources.map((s7) => s7 || ""); + } + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString4); + } + } + } + (() => { + exports29.encodedMappings = (map4) => { + var _a2; + return (_a2 = map4._encoded) !== null && _a2 !== void 0 ? _a2 : map4._encoded = sourcemapCodec.encode(map4._decoded); + }; + exports29.decodedMappings = (map4) => { + return map4._decoded || (map4._decoded = sourcemapCodec.decode(map4._encoded)); + }; + exports29.traceSegment = (map4, line, column) => { + const decoded = exports29.decodedMappings(map4); + if (line >= decoded.length) + return null; + return traceSegmentInternal(decoded[line], map4._decodedMemo, line, column, GREATEST_LOWER_BOUND); + }; + exports29.originalPositionFor = (map4, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = exports29.decodedMappings(map4); + if (line >= decoded.length) + return INVALID_ORIGINAL_MAPPING; + const segment = traceSegmentInternal(decoded[line], map4._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (segment == null) + return INVALID_ORIGINAL_MAPPING; + if (segment.length == 1) + return INVALID_ORIGINAL_MAPPING; + const { names, resolvedSources } = map4; + return { + source: resolvedSources[segment[SOURCES_INDEX]], + line: segment[SOURCE_LINE] + 1, + column: segment[SOURCE_COLUMN], + name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null + }; + }; + exports29.generatedPositionFor = (map4, { source, line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map4; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) + sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) + return INVALID_GENERATED_MAPPING; + const generated = map4._bySources || (map4._bySources = buildBySources(exports29.decodedMappings(map4), map4._bySourceMemos = sources.map(memoizedState))); + const memos = map4._bySourceMemos; + const segments = generated[sourceIndex][line]; + if (segments == null) + return INVALID_GENERATED_MAPPING; + const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND); + if (segment == null) + return INVALID_GENERATED_MAPPING; + return { + line: segment[REV_GENERATED_LINE] + 1, + column: segment[REV_GENERATED_COLUMN] + }; + }; + exports29.eachMapping = (map4, cb) => { + const decoded = exports29.decodedMappings(map4); + const { names, resolvedSources } = map4; + for (let i7 = 0; i7 < decoded.length; i7++) { + const line = decoded[i7]; + for (let j6 = 0; j6 < line.length; j6++) { + const seg = line[j6]; + const generatedLine = i7 + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name2 = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) + name2 = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name: name2 + }); + } + } + }; + exports29.presortedDecodedMap = (map4, mapUrl) => { + const clone2 = Object.assign({}, map4); + clone2.mappings = []; + const tracer = new TraceMap(clone2, mapUrl); + tracer._decoded = map4.mappings; + return tracer; + }; + exports29.decodedMap = (map4) => { + return { + version: 3, + file: map4.file, + names: map4.names, + sourceRoot: map4.sourceRoot, + sources: map4.sources, + sourcesContent: map4.sourcesContent, + mappings: exports29.decodedMappings(map4) + }; + }; + exports29.encodedMap = (map4) => { + return { + version: 3, + file: map4.file, + names: map4.names, + sourceRoot: map4.sourceRoot, + sources: map4.sources, + sourcesContent: map4.sourcesContent, + mappings: exports29.encodedMappings(map4) + }; + }; + })(); + function traceSegmentInternal(segments, memo, line, column, bias) { + let index4 = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index4 = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index4); + } else if (bias === LEAST_UPPER_BOUND) + index4++; + if (index4 === -1 || index4 === segments.length) + return null; + return segments[index4]; + } + exports29.AnyMap = AnyMap; + exports29.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND; + exports29.LEAST_UPPER_BOUND = LEAST_UPPER_BOUND; + exports29.TraceMap = TraceMap; + Object.defineProperty(exports29, "__esModule", { value: true }); + }); + } +}); + +// node_modules/@cspotcode/source-map-support/source-map-support.js +var require_source_map_support2 = __commonJS({ + "node_modules/@cspotcode/source-map-support/source-map-support.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var { TraceMap, originalPositionFor, AnyMap } = require_trace_mapping_umd(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var { fileURLToPath: fileURLToPath3, pathToFileURL: pathToFileURL3 } = (init_url(), __toCommonJS(url_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var fs; + try { + fs = (init_fs(), __toCommonJS(fs_exports)); + if (!fs.existsSync || !fs.readFileSync) { + fs = null; + } + } catch (err) { + } + function dynamicRequire(mod2, request3) { + return mod2.require(request3); + } + var sharedDataVersion = 1; + function initializeSharedData(defaults2) { + var sharedDataKey = "source-map-support/sharedData"; + if (typeof Symbol !== "undefined") { + sharedDataKey = Symbol.for(sharedDataKey); + } + var sharedData2 = this[sharedDataKey]; + if (!sharedData2) { + sharedData2 = { version: sharedDataVersion }; + if (Object.defineProperty) { + Object.defineProperty(this, sharedDataKey, { value: sharedData2 }); + } else { + this[sharedDataKey] = sharedData2; + } + } + if (sharedDataVersion !== sharedData2.version) { + throw new Error("Multiple incompatible instances of source-map-support were loaded"); + } + for (var key in defaults2) { + if (!(key in sharedData2)) { + sharedData2[key] = defaults2[key]; + } + } + return sharedData2; + } + var sharedData = initializeSharedData({ + // Only install once if called multiple times + // Remember how the environment looked before installation so we can restore if able + /** @type {HookState} */ + errorPrepareStackTraceHook: void 0, + /** @type {HookState} */ + processEmitHook: void 0, + /** @type {HookState} */ + moduleResolveFilenameHook: void 0, + /** @type {Array<(request: string, parent: any, isMain: boolean, options: any, redirectedRequest: string) => void>} */ + onConflictingLibraryRedirectArr: [], + // If true, the caches are reset before a stack trace formatting operation + emptyCacheBetweenOperations: false, + // Maps a file path to a string containing the file contents + fileContentsCache: /* @__PURE__ */ Object.create(null), + // Maps a file path to a source map for that file + /** @type {Record C:/dir/file + "/" + ); + }); + } + const key = getCacheKey(path3); + if (hasFileContentsCacheFromKey(key)) { + return getFileContentsCacheFromKey(key); + } + var contents = ""; + try { + if (!fs) { + var xhr = new XMLHttpRequest(); + xhr.open( + "GET", + path3, + /** async */ + false + ); + xhr.send(null); + if (xhr.readyState === 4 && xhr.status === 200) { + contents = xhr.responseText; + } + } else if (fs.existsSync(path3)) { + contents = fs.readFileSync(path3, "utf8"); + } + } catch (er) { + } + return setFileContentsCache(path3, contents); + }); + function supportRelativeURL(file, url) { + if (!file) + return url; + try { + if (isAbsoluteUrl(file) || isSchemeRelativeUrl(file)) { + if (isAbsoluteUrl(url) || isSchemeRelativeUrl(url)) { + return new URL(url, file).toString(); + } + if (path2.isAbsolute(url)) { + return new URL(pathToFileURL3(url), file).toString(); + } + return new URL(url.replace(/\\/g, "/"), file).toString(); + } + if (path2.isAbsolute(file)) { + if (isFileUrl(url)) { + return fileURLToPath3(url); + } + if (isSchemeRelativeUrl(url)) { + return fileURLToPath3(new URL(url, "file://")); + } + if (isAbsoluteUrl(url)) { + return url; + } + if (path2.isAbsolute(url)) { + return path2.normalize(url); + } + return path2.join(file, "..", decodeURI(url)); + } + if (isAbsoluteUrl(url) || isSchemeRelativeUrl(url)) { + return url; + } + return path2.join(file, "..", url); + } catch (e10) { + return url; + } + } + function matchStyleOfPathOrUrl(matchStyleOf, pathOrUrl) { + try { + if (isAbsoluteUrl(matchStyleOf) || isSchemeRelativeUrl(matchStyleOf)) { + if (isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) + return pathOrUrl; + if (path2.isAbsolute(pathOrUrl)) + return pathToFileURL3(pathOrUrl).toString(); + } else if (path2.isAbsolute(matchStyleOf)) { + if (isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) { + return fileURLToPath3(new URL(pathOrUrl, "file://")); + } + } + return pathOrUrl; + } catch (e10) { + return pathOrUrl; + } + } + function retrieveSourceMapURL(source) { + var fileData; + if (isInBrowser()) { + try { + var xhr = new XMLHttpRequest(); + xhr.open("GET", source, false); + xhr.send(null); + fileData = xhr.readyState === 4 ? xhr.responseText : null; + var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap"); + if (sourceMapHeader) { + return sourceMapHeader; + } + } catch (e10) { + } + } + fileData = retrieveFile(tryFileURLToPath(source)); + var re4 = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg; + var lastMatch, match; + while (match = re4.exec(fileData)) + lastMatch = match; + if (!lastMatch) + return null; + return lastMatch[1]; + } + var retrieveSourceMap = handlerExec(sharedData.retrieveMapHandlers, sharedData.internalRetrieveMapHandlers); + sharedData.internalRetrieveMapHandlers.push(function(source) { + var sourceMappingURL = retrieveSourceMapURL(source); + if (!sourceMappingURL) + return null; + var sourceMapData; + if (reSourceMap.test(sourceMappingURL)) { + var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1); + sourceMapData = Buffer.from(rawData, "base64").toString(); + sourceMappingURL = source; + } else { + sourceMappingURL = supportRelativeURL(source, sourceMappingURL); + sourceMapData = retrieveFile(tryFileURLToPath(sourceMappingURL)); + } + if (!sourceMapData) { + return null; + } + return { + url: sourceMappingURL, + map: sourceMapData + }; + }); + function mapSourcePosition(position) { + var sourceMap = getSourceMapCache(position.source); + if (!sourceMap) { + var urlAndMap = retrieveSourceMap(position.source); + if (urlAndMap) { + sourceMap = setSourceMapCache(position.source, { + url: urlAndMap.url, + map: new AnyMap(urlAndMap.map, urlAndMap.url) + }); + sourceMap.map.resolvedSources = sourceMap.map.sources.map((s7) => supportRelativeURL(sourceMap.url, s7)); + if (sourceMap.map.sourcesContent) { + sourceMap.map.resolvedSources.forEach(function(resolvedSource, i7) { + var contents = sourceMap.map.sourcesContent[i7]; + if (contents) { + setFileContentsCache(resolvedSource, contents); + } + }); + } + } else { + sourceMap = setSourceMapCache(position.source, { + url: null, + map: null + }); + } + } + if (sourceMap && sourceMap.map) { + var originalPosition = originalPositionFor(sourceMap.map, position); + if (originalPosition.source !== null) { + originalPosition.source = matchStyleOfPathOrUrl( + position.source, + originalPosition.source + ); + return originalPosition; + } + } + return position; + } + function mapEvalOrigin(origin) { + var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin); + if (match) { + var position = mapSourcePosition({ + source: match[2], + line: +match[3], + column: match[4] - 1 + }); + return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")"; + } + match = /^eval at ([^(]+) \((.+)\)$/.exec(origin); + if (match) { + return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")"; + } + return origin; + } + function CallSiteToString() { + var fileName; + var fileLocation = ""; + if (this.isNative()) { + fileLocation = "native"; + } else { + fileName = this.getScriptNameOrSourceURL(); + if (!fileName && this.isEval()) { + fileLocation = this.getEvalOrigin(); + fileLocation += ", "; + } + if (fileName) { + fileLocation += fileName; + } else { + fileLocation += ""; + } + var lineNumber = this.getLineNumber(); + if (lineNumber != null) { + fileLocation += ":" + lineNumber; + var columnNumber = this.getColumnNumber(); + if (columnNumber) { + fileLocation += ":" + columnNumber; + } + } + } + var line = ""; + var isAsync2 = this.isAsync ? this.isAsync() : false; + if (isAsync2) { + line += "async "; + var isPromiseAll = this.isPromiseAll ? this.isPromiseAll() : false; + var isPromiseAny = this.isPromiseAny ? this.isPromiseAny() : false; + if (isPromiseAny || isPromiseAll) { + line += isPromiseAll ? "Promise.all (index " : "Promise.any (index "; + var promiseIndex = this.getPromiseIndex(); + line += promiseIndex + ")"; + } + } + var functionName = this.getFunctionName(); + var addSuffix = true; + var isConstructor = this.isConstructor(); + var isMethodCall = !(this.isToplevel() || isConstructor); + if (isMethodCall) { + var typeName = this.getTypeName(); + if (typeName === "[object Object]") { + typeName = "null"; + } + var methodName = this.getMethodName(); + if (functionName) { + if (typeName && functionName.indexOf(typeName) != 0) { + line += typeName + "."; + } + line += functionName; + if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) { + line += " [as " + methodName + "]"; + } + } else { + line += typeName + "." + (methodName || ""); + } + } else if (isConstructor) { + line += "new " + (functionName || ""); + } else if (functionName) { + line += functionName; + } else { + line += fileLocation; + addSuffix = false; + } + if (addSuffix) { + line += " (" + fileLocation + ")"; + } + return line; + } + function cloneCallSite(frame) { + var object = {}; + Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name2) { + object[name2] = /^(?:is|get)/.test(name2) ? function() { + return frame[name2].call(frame); + } : frame[name2]; + }); + object.toString = CallSiteToString; + return object; + } + function wrapCallSite(frame, state) { + if (state === void 0) { + state = { nextPosition: null, curPosition: null }; + } + if (frame.isNative()) { + state.curPosition = null; + return frame; + } + var source = frame.getFileName() || frame.getScriptNameOrSourceURL(); + if (source) { + if (source.startsWith("wasm://")) { + state.curPosition = null; + return frame; + } + var line = frame.getLineNumber(); + var column = frame.getColumnNumber() - 1; + var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/; + var headerLength = noHeader.test(process.version) ? 0 : 62; + if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) { + column -= headerLength; + } + var position = mapSourcePosition({ + source, + line, + column + }); + state.curPosition = position; + frame = cloneCallSite(frame); + var originalFunctionName = frame.getFunctionName; + frame.getFunctionName = function() { + if (state.nextPosition == null) { + return originalFunctionName(); + } + return state.nextPosition.name || originalFunctionName(); + }; + frame.getFileName = function() { + return position.source; + }; + frame.getLineNumber = function() { + return position.line; + }; + frame.getColumnNumber = function() { + return position.column + 1; + }; + frame.getScriptNameOrSourceURL = function() { + return position.source; + }; + return frame; + } + var origin = frame.isEval() && frame.getEvalOrigin(); + if (origin) { + origin = mapEvalOrigin(origin); + frame = cloneCallSite(frame); + frame.getEvalOrigin = function() { + return origin; + }; + return frame; + } + return frame; + } + var kIsNodeError = void 0; + try { + path2.resolve(123); + } catch (e10) { + const symbols = Object.getOwnPropertySymbols(e10); + const symbol = symbols.find(function(s7) { + return s7.toString().indexOf("kIsNodeError") >= 0; + }); + if (symbol) + kIsNodeError = symbol; + } + var ErrorPrototypeToString = (err) => Error.prototype.toString.call(err); + function createPrepareStackTrace(hookState) { + return prepareStackTrace; + function prepareStackTrace(error2, stack) { + if (!hookState.enabled) + return hookState.originalValue.apply(this, arguments); + if (sharedData.emptyCacheBetweenOperations) { + clearCaches(); + } + var errorString; + if (kIsNodeError) { + if (kIsNodeError in error2) { + errorString = `${error2.name} [${error2.code}]: ${error2.message}`; + } else { + errorString = ErrorPrototypeToString(error2); + } + } else { + var name2 = error2.name || "Error"; + var message = error2.message || ""; + errorString = message ? name2 + ": " + message : name2; + } + var state = { nextPosition: null, curPosition: null }; + var processedStack = []; + for (var i7 = stack.length - 1; i7 >= 0; i7--) { + processedStack.push("\n at " + wrapCallSite(stack[i7], state)); + state.nextPosition = state.curPosition; + } + state.curPosition = state.nextPosition = null; + return errorString + processedStack.reverse().join(""); + } + } + function getErrorSource(error2) { + var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error2.stack); + if (match) { + var source = match[1]; + var line = +match[2]; + var column = +match[3]; + var contents = getFileContentsCache(source); + const sourceAsPath = tryFileURLToPath(source); + if (!contents && fs && fs.existsSync(sourceAsPath)) { + try { + contents = fs.readFileSync(sourceAsPath, "utf8"); + } catch (er) { + contents = ""; + } + } + if (contents) { + var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; + if (code) { + return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^"; + } + } + } + return null; + } + function printFatalErrorUponExit(error2) { + var source = getErrorSource(error2); + if (process.stderr._handle && process.stderr._handle.setBlocking) { + process.stderr._handle.setBlocking(true); + } + if (source) { + console.error(source); + } + console.error( + util2.inspect(error2, { + customInspect: false, + colors: process.stderr.isTTY + }) + ); + } + function shimEmitUncaughtException() { + const originalValue = process.emit; + var hook = sharedData.processEmitHook = { + enabled: true, + originalValue, + installedValue: void 0 + }; + var isTerminatingDueToFatalException = false; + var fatalException; + process.emit = sharedData.processEmitHook.installedValue = function(type3) { + const hadListeners = originalValue.apply(this, arguments); + if (hook.enabled) { + if (type3 === "uncaughtException" && !hadListeners) { + isTerminatingDueToFatalException = true; + fatalException = arguments[1]; + process.exit(1); + } + if (type3 === "exit" && isTerminatingDueToFatalException) { + printFatalErrorUponExit(fatalException); + } + } + return hadListeners; + }; + } + var originalRetrieveFileHandlers = sharedData.retrieveFileHandlers.slice(0); + var originalRetrieveMapHandlers = sharedData.retrieveMapHandlers.slice(0); + exports28.wrapCallSite = wrapCallSite; + exports28.getErrorSource = getErrorSource; + exports28.mapSourcePosition = mapSourcePosition; + exports28.retrieveSourceMap = retrieveSourceMap; + exports28.install = function(options) { + options = options || {}; + if (options.environment) { + environment = options.environment; + if (["node", "browser", "auto"].indexOf(environment) === -1) { + throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}"); + } + } + var Module = dynamicRequire(module5, "module"); + const { redirectConflictingLibrary = true, onConflictingLibraryRedirect } = options; + if (redirectConflictingLibrary) { + if (!sharedData.moduleResolveFilenameHook) { + const originalValue = Module._resolveFilename; + const moduleResolveFilenameHook = sharedData.moduleResolveFilenameHook = { + enabled: true, + originalValue, + installedValue: void 0 + }; + Module._resolveFilename = sharedData.moduleResolveFilenameHook.installedValue = function(request3, parent2, isMain, options2) { + if (moduleResolveFilenameHook.enabled) { + let requestRedirect; + if (request3 === "source-map-support") { + requestRedirect = "./"; + } else if (request3 === "source-map-support/register") { + requestRedirect = "./register"; + } + if (requestRedirect !== void 0) { + const newRequest = __require.resolve(requestRedirect); + for (const cb of sharedData.onConflictingLibraryRedirectArr) { + cb(request3, parent2, isMain, options2, newRequest); + } + request3 = newRequest; + } + } + return originalValue.call(this, request3, parent2, isMain, options2); + }; + } + if (onConflictingLibraryRedirect) { + sharedData.onConflictingLibraryRedirectArr.push(onConflictingLibraryRedirect); + } + } + if (options.retrieveFile) { + if (options.overrideRetrieveFile) { + sharedData.retrieveFileHandlers.length = 0; + } + sharedData.retrieveFileHandlers.unshift(options.retrieveFile); + } + if (options.retrieveSourceMap) { + if (options.overrideRetrieveSourceMap) { + sharedData.retrieveMapHandlers.length = 0; + } + sharedData.retrieveMapHandlers.unshift(options.retrieveSourceMap); + } + if (options.hookRequire && !isInBrowser()) { + var $compile = Module.prototype._compile; + if (!$compile.__sourceMapSupport) { + Module.prototype._compile = function(content, filename) { + setFileContentsCache(filename, content); + setSourceMapCache(filename, void 0); + return $compile.call(this, content, filename); + }; + Module.prototype._compile.__sourceMapSupport = true; + } + } + if (!sharedData.emptyCacheBetweenOperations) { + sharedData.emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false; + } + if (!sharedData.errorPrepareStackTraceHook) { + const originalValue = Error.prepareStackTrace; + sharedData.errorPrepareStackTraceHook = { + enabled: true, + originalValue, + installedValue: void 0 + }; + Error.prepareStackTrace = sharedData.errorPrepareStackTraceHook.installedValue = createPrepareStackTrace(sharedData.errorPrepareStackTraceHook); + } + if (!sharedData.processEmitHook) { + var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true; + try { + var worker_threads = dynamicRequire(module5, "worker_threads"); + if (worker_threads.isMainThread === false) { + installHandler = false; + } + } catch (e10) { + } + if (installHandler && hasGlobalProcessEventEmitter()) { + shimEmitUncaughtException(); + } + } + }; + exports28.uninstall = function() { + if (sharedData.processEmitHook) { + sharedData.processEmitHook.enabled = false; + if (process.emit === sharedData.processEmitHook.installedValue) { + process.emit = sharedData.processEmitHook.originalValue; + } + sharedData.processEmitHook = void 0; + } + if (sharedData.errorPrepareStackTraceHook) { + sharedData.errorPrepareStackTraceHook.enabled = false; + if (Error.prepareStackTrace === sharedData.errorPrepareStackTraceHook.installedValue || typeof sharedData.errorPrepareStackTraceHook.originalValue !== "function") { + Error.prepareStackTrace = sharedData.errorPrepareStackTraceHook.originalValue; + } + sharedData.errorPrepareStackTraceHook = void 0; + } + if (sharedData.moduleResolveFilenameHook) { + sharedData.moduleResolveFilenameHook.enabled = false; + var Module = dynamicRequire(module5, "module"); + if (Module._resolveFilename === sharedData.moduleResolveFilenameHook.installedValue) { + Module._resolveFilename = sharedData.moduleResolveFilenameHook.originalValue; + } + sharedData.moduleResolveFilenameHook = void 0; + } + sharedData.onConflictingLibraryRedirectArr.length = 0; + }; + exports28.resetRetrieveHandlers = function() { + sharedData.retrieveFileHandlers.length = 0; + sharedData.retrieveMapHandlers.length = 0; + }; + } +}); + +// node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +var require_node_internal_modules_esm_resolve = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { versionGteLt } = require_util6(); + var builtinModuleProtocol = versionGteLt(process.versions.node, "14.13.1") || versionGteLt(process.versions.node, "12.20.0", "13.0.0") ? "node:" : "nodejs:"; + var { + ArrayIsArray, + ArrayPrototypeJoin, + ArrayPrototypeShift, + JSONParse, + JSONStringify, + ObjectFreeze, + ObjectGetOwnPropertyNames, + ObjectPrototypeHasOwnProperty, + RegExpPrototypeTest, + SafeMap, + SafeSet, + StringPrototypeEndsWith, + StringPrototypeIndexOf, + StringPrototypeLastIndexOf, + StringPrototypeReplace, + StringPrototypeSlice, + StringPrototypeSplit, + StringPrototypeStartsWith, + StringPrototypeSubstr + } = require_node_primordials(); + var Module = (init_module(), __toCommonJS(module_exports)); + var { NativeModule } = require_node_nativemodule(); + var { + realpathSync: realpathSync2, + statSync: statSync2, + Stats: Stats2 + } = (init_fs(), __toCommonJS(fs_exports)); + var { getOptionValue } = require_node_options(); + var policy = null; + var { sep: sep2, relative: relative2 } = (init_path(), __toCommonJS(path_exports)); + var preserveSymlinks = getOptionValue("--preserve-symlinks"); + var preserveSymlinksMain = getOptionValue("--preserve-symlinks-main"); + var typeFlag = getOptionValue("--input-type"); + var { URL: URL2, pathToFileURL: pathToFileURL3, fileURLToPath: fileURLToPath3 } = (init_url(), __toCommonJS(url_exports)); + var { + ERR_INPUT_TYPE_NOT_ALLOWED, + ERR_INVALID_ARG_VALUE: ERR_INVALID_ARG_VALUE2, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG, + ERR_INVALID_PACKAGE_TARGET, + ERR_MANIFEST_DEPENDENCY_MISSING, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_ESM_URL_SCHEME + // } = require('internal/errors').codes; + } = require_node_internal_errors().codes; + var CJSModule = Module; + var packageJsonReader = require_node_internal_modules_package_json_reader(); + var userConditions = getOptionValue("--conditions"); + var DEFAULT_CONDITIONS = ObjectFreeze(["node", "import", ...userConditions]); + var DEFAULT_CONDITIONS_SET = new SafeSet(DEFAULT_CONDITIONS); + var pendingDeprecation = getOptionValue("--pending-deprecation"); + function createResolve(opts) { + const { preferTsExts, tsNodeExperimentalSpecifierResolution, extensions: extensions6 } = opts; + const esrnExtensions = extensions6.experimentalSpecifierResolutionAddsIfOmitted; + const { legacyMainResolveAddsIfOmitted, replacementsForCjs, replacementsForJs, replacementsForMjs, replacementsForJsx } = extensions6; + const experimentalSpecifierResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue("--experimental-specifier-resolution"); + const emittedPackageWarnings = new SafeSet(); + function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) { + const pjsonPath = fileURLToPath3(pjsonUrl); + if (!pendingDeprecation) { + const nodeModulesIndex = StringPrototypeLastIndexOf( + pjsonPath, + "/node_modules/" + ); + if (nodeModulesIndex !== -1) { + const afterNodeModulesPath = StringPrototypeSlice( + pjsonPath, + nodeModulesIndex + 14, + -13 + ); + try { + const { packageSubpath } = parsePackageName(afterNodeModulesPath); + if (packageSubpath === ".") + return; + } catch { + } + } + } + if (emittedPackageWarnings.has(pjsonPath + "|" + match)) + return; + emittedPackageWarnings.add(pjsonPath + "|" + match); + process.emitWarning( + `Use of deprecated folder mapping "${match}" in the ${isExports ? '"exports"' : '"imports"'} field module resolution of the package at ${pjsonPath}${base ? ` imported from ${fileURLToPath3(base)}` : ""}. +Update this package.json to use a subpath pattern like "${match}*".`, + "DeprecationWarning", + "DEP0148" + ); + } + function getConditionsSet(conditions) { + if (conditions !== void 0 && conditions !== DEFAULT_CONDITIONS) { + if (!ArrayIsArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE2( + "conditions", + conditions, + "expected an array" + ); + } + return new SafeSet(conditions); + } + return DEFAULT_CONDITIONS_SET; + } + const realpathCache = new SafeMap(); + const packageJSONCache = new SafeMap(); + const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, "15.3.0") || versionGteLt(process.versions.node, "14.17.0", "15.0.0"); + const tryStatSync = statSupportsThrowIfNoEntry ? tryStatSyncWithoutErrors : tryStatSyncWithErrors; + const statsIfNotFound = new Stats2(); + function tryStatSyncWithoutErrors(path2) { + const stats = statSync2(path2, { throwIfNoEntry: false }); + if (stats != null) + return stats; + return statsIfNotFound; + } + function tryStatSyncWithErrors(path2) { + try { + return statSync2(path2); + } catch { + return statsIfNotFound; + } + } + function getPackageConfig(path2, specifier, base) { + const existing = packageJSONCache.get(path2); + if (existing !== void 0) { + return existing; + } + const source = packageJsonReader.read(path2).string; + if (source === void 0) { + const packageConfig2 = { + pjsonPath: path2, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(path2, packageConfig2); + return packageConfig2; + } + let packageJSON; + try { + packageJSON = JSONParse(source); + } catch (error2) { + throw new ERR_INVALID_PACKAGE_CONFIG( + path2, + (base ? `"${specifier}" from ` : "") + fileURLToPath3(base || specifier), + error2.message + ); + } + let { imports, main, name: name2, type: type3 } = packageJSON; + const { exports: exports29 } = packageJSON; + if (typeof imports !== "object" || imports === null) + imports = void 0; + if (typeof main !== "string") + main = void 0; + if (typeof name2 !== "string") + name2 = void 0; + if (type3 !== "module" && type3 !== "commonjs") + type3 = "none"; + const packageConfig = { + pjsonPath: path2, + exists: true, + main, + name: name2, + type: type3, + exports: exports29, + imports + }; + packageJSONCache.set(path2, packageConfig); + return packageConfig; + } + function getPackageScopeConfig(resolved) { + let packageJSONUrl = new URL2("./package.json", resolved); + while (true) { + const packageJSONPath2 = packageJSONUrl.pathname; + if (StringPrototypeEndsWith(packageJSONPath2, "node_modules/package.json")) + break; + const packageConfig2 = getPackageConfig( + fileURLToPath3(packageJSONUrl), + resolved + ); + if (packageConfig2.exists) + return packageConfig2; + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL2("../package.json", packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) + break; + } + const packageJSONPath = fileURLToPath3(packageJSONUrl); + const packageConfig = { + pjsonPath: packageJSONPath, + exists: false, + main: void 0, + name: void 0, + type: "none", + exports: void 0, + imports: void 0 + }; + packageJSONCache.set(packageJSONPath, packageConfig); + return packageConfig; + } + function fileExists(url) { + return tryStatSync(fileURLToPath3(url)).isFile(); + } + function legacyMainResolve(packageJSONUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== void 0) { + if (guess = resolveReplacementExtensions(new URL2(`./${packageConfig.main}`, packageJSONUrl))) { + return guess; + } + if (fileExists(guess = new URL2( + `./${packageConfig.main}`, + packageJSONUrl + ))) { + return guess; + } + for (const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL2( + `./${packageConfig.main}${extension}`, + packageJSONUrl + ))) { + return guess; + } + } + for (const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL2( + `./${packageConfig.main}/index${extension}`, + packageJSONUrl + ))) { + return guess; + } + } + } + for (const extension of legacyMainResolveAddsIfOmitted) { + if (fileExists(guess = new URL2(`./index${extension}`, packageJSONUrl))) { + return guess; + } + } + throw new ERR_MODULE_NOT_FOUND( + fileURLToPath3(new URL2(".", packageJSONUrl)), + fileURLToPath3(base) + ); + } + function resolveExtensionsWithTryExactName(search) { + const resolvedReplacementExtension = resolveReplacementExtensions(search); + if (resolvedReplacementExtension) + return resolvedReplacementExtension; + if (fileExists(search)) + return search; + return resolveExtensions(search); + } + function resolveExtensions(search) { + for (let i7 = 0; i7 < esrnExtensions.length; i7++) { + const extension = esrnExtensions[i7]; + const guess = new URL2(`${search.pathname}${extension}`, search); + if (fileExists(guess)) + return guess; + } + return void 0; + } + function resolveReplacementExtensions(search) { + const lastDotIndex = search.pathname.lastIndexOf("."); + if (lastDotIndex >= 0) { + const ext = search.pathname.slice(lastDotIndex); + if (ext === ".js" || ext === ".jsx" || ext === ".mjs" || ext === ".cjs") { + const pathnameWithoutExtension = search.pathname.slice(0, lastDotIndex); + const replacementExts = ext === ".js" ? replacementsForJs : ext === ".jsx" ? replacementsForJsx : ext === ".mjs" ? replacementsForMjs : replacementsForCjs; + const guess = new URL2(search.toString()); + for (let i7 = 0; i7 < replacementExts.length; i7++) { + const extension = replacementExts[i7]; + guess.pathname = `${pathnameWithoutExtension}${extension}`; + if (fileExists(guess)) + return guess; + } + } + } + return void 0; + } + function resolveIndex(search) { + return resolveExtensions(new URL2("index", search)); + } + const encodedSepRegEx = /%2F|%2C/i; + function finalizeResolution(resolved, base) { + if (RegExpPrototypeTest(encodedSepRegEx, resolved.pathname)) + throw new ERR_INVALID_MODULE_SPECIFIER( + resolved.pathname, + 'must not include encoded "/" or "\\" characters', + fileURLToPath3(base) + ); + if (experimentalSpecifierResolution === "node") { + const path3 = fileURLToPath3(resolved); + let file2 = resolveExtensionsWithTryExactName(resolved); + if (file2 !== void 0) + return file2; + if (!StringPrototypeEndsWith(path3, "/")) { + file2 = resolveIndex(new URL2(`${resolved}/`)); + if (file2 !== void 0) + return file2; + } else { + return resolveIndex(resolved) || resolved; + } + throw new ERR_MODULE_NOT_FOUND( + resolved.pathname, + fileURLToPath3(base), + "module" + ); + } + const file = resolveReplacementExtensions(resolved) || resolved; + const path2 = fileURLToPath3(file); + const stats = tryStatSync(StringPrototypeEndsWith(path2, "/") ? StringPrototypeSlice(path2, -1) : path2); + if (stats.isDirectory()) { + const err = new ERR_UNSUPPORTED_DIR_IMPORT(path2, fileURLToPath3(base)); + err.url = String(resolved); + throw err; + } else if (!stats.isFile()) { + throw new ERR_MODULE_NOT_FOUND( + path2 || resolved.pathname, + fileURLToPath3(base), + "module" + ); + } + return file; + } + function throwImportNotDefined(specifier, packageJSONUrl, base) { + throw new ERR_PACKAGE_IMPORT_NOT_DEFINED( + specifier, + packageJSONUrl && fileURLToPath3(new URL2(".", packageJSONUrl)), + fileURLToPath3(base) + ); + } + function throwExportsNotFound(subpath, packageJSONUrl, base) { + throw new ERR_PACKAGE_PATH_NOT_EXPORTED( + fileURLToPath3(new URL2(".", packageJSONUrl)), + subpath, + base && fileURLToPath3(base) + ); + } + function throwInvalidSubpath(subpath, packageJSONUrl, internal4, base) { + const reason = `request is not a valid subpath for the "${internal4 ? "imports" : "exports"}" resolution of ${fileURLToPath3(packageJSONUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER( + subpath, + reason, + base && fileURLToPath3(base) + ); + } + function throwInvalidPackageTarget(subpath, target, packageJSONUrl, internal4, base) { + if (typeof target === "object" && target !== null) { + target = JSONStringify(target, null, ""); + } else { + target = `${target}`; + } + throw new ERR_INVALID_PACKAGE_TARGET( + fileURLToPath3(new URL2(".", packageJSONUrl)), + subpath, + target, + internal4, + base && fileURLToPath3(base) + ); + } + const invalidSegmentRegEx = /(^|\\|\/)(\.\.?|node_modules)(\\|\/|$)/; + const patternRegEx = /\*/g; + function resolvePackageTargetString(target, subpath, match, packageJSONUrl, base, pattern5, internal4, conditions) { + if (subpath !== "" && !pattern5 && target[target.length - 1] !== "/") + throwInvalidPackageTarget(match, target, packageJSONUrl, internal4, base); + if (!StringPrototypeStartsWith(target, "./")) { + if (internal4 && !StringPrototypeStartsWith(target, "../") && !StringPrototypeStartsWith(target, "/")) { + let isURL = false; + try { + new URL2(target); + isURL = true; + } catch { + } + if (!isURL) { + const exportTarget = pattern5 ? StringPrototypeReplace(target, patternRegEx, subpath) : target + subpath; + return packageResolve(exportTarget, packageJSONUrl, conditions); + } + } + throwInvalidPackageTarget(match, target, packageJSONUrl, internal4, base); + } + if (RegExpPrototypeTest(invalidSegmentRegEx, StringPrototypeSlice(target, 2))) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal4, base); + const resolved = new URL2(target, packageJSONUrl); + const resolvedPath = resolved.pathname; + const packagePath = new URL2(".", packageJSONUrl).pathname; + if (!StringPrototypeStartsWith(resolvedPath, packagePath)) + throwInvalidPackageTarget(match, target, packageJSONUrl, internal4, base); + if (subpath === "") + return resolved; + if (RegExpPrototypeTest(invalidSegmentRegEx, subpath)) + throwInvalidSubpath(match + subpath, packageJSONUrl, internal4, base); + if (pattern5) + return new URL2(StringPrototypeReplace( + resolved.href, + patternRegEx, + subpath + )); + return new URL2(subpath, resolved); + } + function isArrayIndex(key) { + const keyNum = +key; + if (`${keyNum}` !== key) + return false; + return keyNum >= 0 && keyNum < 4294967295; + } + function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath, base, pattern5, internal4, conditions) { + if (typeof target === "string") { + return resolvePackageTargetString( + target, + subpath, + packageSubpath, + packageJSONUrl, + base, + pattern5, + internal4, + conditions + ); + } else if (ArrayIsArray(target)) { + if (target.length === 0) + return null; + let lastException; + for (let i7 = 0; i7 < target.length; i7++) { + const targetItem = target[i7]; + let resolved; + try { + resolved = resolvePackageTarget( + packageJSONUrl, + targetItem, + subpath, + packageSubpath, + base, + pattern5, + internal4, + conditions + ); + } catch (e10) { + lastException = e10; + if (e10.code === "ERR_INVALID_PACKAGE_TARGET") + continue; + throw e10; + } + if (resolved === void 0) + continue; + if (resolved === null) { + lastException = null; + continue; + } + return resolved; + } + if (lastException === void 0 || lastException === null) + return lastException; + throw lastException; + } else if (typeof target === "object" && target !== null) { + const keys2 = ObjectGetOwnPropertyNames(target); + for (let i7 = 0; i7 < keys2.length; i7++) { + const key = keys2[i7]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath3(packageJSONUrl), + base, + '"exports" cannot contain numeric property keys.' + ); + } + } + for (let i7 = 0; i7 < keys2.length; i7++) { + const key = keys2[i7]; + if (key === "default" || conditions.has(key)) { + const conditionalTarget = target[key]; + const resolved = resolvePackageTarget( + packageJSONUrl, + conditionalTarget, + subpath, + packageSubpath, + base, + pattern5, + internal4, + conditions + ); + if (resolved === void 0) + continue; + return resolved; + } + } + return void 0; + } else if (target === null) { + return null; + } + throwInvalidPackageTarget( + packageSubpath, + target, + packageJSONUrl, + internal4, + base + ); + } + function isConditionalExportsMainSugar(exports29, packageJSONUrl, base) { + if (typeof exports29 === "string" || ArrayIsArray(exports29)) + return true; + if (typeof exports29 !== "object" || exports29 === null) + return false; + const keys2 = ObjectGetOwnPropertyNames(exports29); + let isConditionalSugar = false; + let i7 = 0; + for (let j6 = 0; j6 < keys2.length; j6++) { + const key = keys2[j6]; + const curIsConditionalSugar = key === "" || key[0] !== "."; + if (i7++ === 0) { + isConditionalSugar = curIsConditionalSugar; + } else if (isConditionalSugar !== curIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG( + fileURLToPath3(packageJSONUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); + } + } + return isConditionalSugar; + } + function packageExportsResolve(packageJSONUrl, packageSubpath, packageConfig, base, conditions) { + let exports29 = packageConfig.exports; + if (isConditionalExportsMainSugar(exports29, packageJSONUrl, base)) + exports29 = { ".": exports29 }; + if (ObjectPrototypeHasOwnProperty(exports29, packageSubpath)) { + const target = exports29[packageSubpath]; + const resolved = resolvePackageTarget( + packageJSONUrl, + target, + "", + packageSubpath, + base, + false, + false, + conditions + ); + if (resolved === null || resolved === void 0) + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + return { resolved, exact: true }; + } + let bestMatch = ""; + const keys2 = ObjectGetOwnPropertyNames(exports29); + for (let i7 = 0; i7 < keys2.length; i7++) { + const key = keys2[i7]; + if (key[key.length - 1] === "*" && StringPrototypeStartsWith( + packageSubpath, + StringPrototypeSlice(key, 0, -1) + ) && packageSubpath.length >= key.length && key.length > bestMatch.length) { + bestMatch = key; + } else if (key[key.length - 1] === "/" && StringPrototypeStartsWith(packageSubpath, key) && key.length > bestMatch.length) { + bestMatch = key; + } + } + if (bestMatch) { + const target = exports29[bestMatch]; + const pattern5 = bestMatch[bestMatch.length - 1] === "*"; + const subpath = StringPrototypeSubstr(packageSubpath, bestMatch.length - (pattern5 ? 1 : 0)); + const resolved = resolvePackageTarget( + packageJSONUrl, + target, + subpath, + bestMatch, + base, + pattern5, + false, + conditions + ); + if (resolved === null || resolved === void 0) + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + if (!pattern5) + emitFolderMapDeprecation(bestMatch, packageJSONUrl, true, base); + return { resolved, exact: pattern5 }; + } + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + } + function packageImportsResolve(name2, base, conditions) { + if (name2 === "#" || StringPrototypeStartsWith(name2, "#/")) { + const reason = "is not a valid internal imports specifier name"; + throw new ERR_INVALID_MODULE_SPECIFIER(name2, reason, fileURLToPath3(base)); + } + let packageJSONUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJSONUrl = pathToFileURL3(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (ObjectPrototypeHasOwnProperty(imports, name2)) { + const resolved = resolvePackageTarget( + packageJSONUrl, + imports[name2], + "", + name2, + base, + false, + true, + conditions + ); + if (resolved !== null) + return { resolved, exact: true }; + } else { + let bestMatch = ""; + const keys2 = ObjectGetOwnPropertyNames(imports); + for (let i7 = 0; i7 < keys2.length; i7++) { + const key = keys2[i7]; + if (key[key.length - 1] === "*" && StringPrototypeStartsWith( + name2, + StringPrototypeSlice(key, 0, -1) + ) && name2.length >= key.length && key.length > bestMatch.length) { + bestMatch = key; + } else if (key[key.length - 1] === "/" && StringPrototypeStartsWith(name2, key) && key.length > bestMatch.length) { + bestMatch = key; + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const pattern5 = bestMatch[bestMatch.length - 1] === "*"; + const subpath = StringPrototypeSubstr(name2, bestMatch.length - (pattern5 ? 1 : 0)); + const resolved = resolvePackageTarget( + packageJSONUrl, + target, + subpath, + bestMatch, + base, + pattern5, + true, + conditions + ); + if (resolved !== null) { + if (!pattern5) + emitFolderMapDeprecation(bestMatch, packageJSONUrl, false, base); + return { resolved, exact: pattern5 }; + } + } + } + } + } + throwImportNotDefined(name2, packageJSONUrl, base); + } + function getPackageType(url) { + const packageConfig = getPackageScopeConfig(url); + return packageConfig.type; + } + function parsePackageName(specifier, base) { + let separatorIndex = StringPrototypeIndexOf(specifier, "/"); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === "@") { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = StringPrototypeIndexOf( + specifier, + "/", + separatorIndex + 1 + ); + } + } + const packageName = separatorIndex === -1 ? specifier : StringPrototypeSlice(specifier, 0, separatorIndex); + for (let i7 = 0; i7 < packageName.length; i7++) { + if (packageName[i7] === "%" || packageName[i7] === "\\") { + validPackageName = false; + break; + } + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER( + specifier, + "is not a valid package name", + fileURLToPath3(base) + ); + } + const packageSubpath = "." + (separatorIndex === -1 ? "" : StringPrototypeSlice(specifier, separatorIndex)); + return { packageName, packageSubpath, isScoped }; + } + function packageResolve(specifier, base, conditions) { + const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJSONUrl2 = pathToFileURL3(packageConfig.pjsonPath); + if (packageConfig.name === packageName && packageConfig.exports !== void 0 && packageConfig.exports !== null) { + return packageExportsResolve( + packageJSONUrl2, + packageSubpath, + packageConfig, + base, + conditions + ).resolved; + } + } + let packageJSONUrl = new URL2("./node_modules/" + packageName + "/package.json", base); + let packageJSONPath = fileURLToPath3(packageJSONUrl); + let lastPath; + do { + const stat2 = tryStatSync(StringPrototypeSlice( + packageJSONPath, + 0, + packageJSONPath.length - 13 + )); + if (!stat2.isDirectory()) { + lastPath = packageJSONPath; + packageJSONUrl = new URL2((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJSONUrl); + packageJSONPath = fileURLToPath3(packageJSONUrl); + continue; + } + const packageConfig2 = getPackageConfig(packageJSONPath, specifier, base); + if (packageConfig2.exports !== void 0 && packageConfig2.exports !== null) + return packageExportsResolve( + packageJSONUrl, + packageSubpath, + packageConfig2, + base, + conditions + ).resolved; + if (packageSubpath === ".") + return legacyMainResolve(packageJSONUrl, packageConfig2, base); + return new URL2(packageSubpath, packageJSONUrl); + } while (packageJSONPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath3(base)); + } + function isBareSpecifier(specifier) { + return specifier[0] && specifier[0] !== "/" && specifier[0] !== "."; + } + function isRelativeSpecifier(specifier) { + if (specifier[0] === ".") { + if (specifier.length === 1 || specifier[1] === "/") + return true; + if (specifier[1] === ".") { + if (specifier.length === 2 || specifier[2] === "/") + return true; + } + } + return false; + } + function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === "") + return false; + if (specifier[0] === "/") + return true; + return isRelativeSpecifier(specifier); + } + function moduleResolve(specifier, base, conditions) { + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + resolved = new URL2(specifier, base); + } else if (specifier[0] === "#") { + ({ resolved } = packageImportsResolve(specifier, base, conditions)); + } else { + try { + resolved = new URL2(specifier); + } catch { + resolved = packageResolve(specifier, base, conditions); + } + } + return finalizeResolution(resolved, base); + } + function resolveAsCommonJS(specifier, parentURL) { + try { + const parent2 = fileURLToPath3(parentURL); + const tmpModule = new CJSModule(parent2, null); + tmpModule.paths = CJSModule._nodeModulePaths(parent2); + let found = CJSModule._resolveFilename(specifier, tmpModule, false); + if (isRelativeSpecifier(specifier)) { + found = relative2(parent2, found); + if (!StringPrototypeStartsWith(found, `..${sep2}`)) { + found = `.${sep2}${found}`; + } + } else if (isBareSpecifier(specifier)) { + const pkg = StringPrototypeSplit(specifier, "/")[0]; + const index4 = StringPrototypeIndexOf(found, pkg); + if (index4 !== -1) { + found = StringPrototypeSlice(found, index4); + } + } + if (process.platform === "win32") { + found = StringPrototypeReplace(found, new RegExp(`\\${sep2}`, "g"), "/"); + } + return found; + } catch { + return false; + } + } + function defaultResolve(specifier, context2 = {}, defaultResolveUnused) { + let { parentURL, conditions } = context2; + if (parentURL && policy != null && policy.manifest) { + const redirects = policy.manifest.getDependencyMapper(parentURL); + if (redirects) { + const { resolve: resolve3, reaction } = redirects; + const destination = resolve3(specifier, new SafeSet(conditions)); + let missing = true; + if (destination === true) { + missing = false; + } else if (destination) { + const href = destination.href; + return { url: href }; + } + if (missing) { + reaction( + new ERR_MANIFEST_DEPENDENCY_MISSING( + parentURL, + specifier, + ArrayPrototypeJoin([...conditions], ", ") + ) + ); + } + } + } + let parsed; + try { + parsed = new URL2(specifier); + if (parsed.protocol === "data:") { + return { + url: specifier + }; + } + } catch { + } + if (parsed && parsed.protocol === builtinModuleProtocol) + return { url: specifier }; + if (parsed && parsed.protocol !== "file:" && parsed.protocol !== "data:") + throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed); + if (NativeModule.canBeRequiredByUsers(specifier)) { + return { + url: builtinModuleProtocol + specifier + }; + } + if (parentURL && StringPrototypeStartsWith(parentURL, "data:")) { + new URL2(specifier, parentURL); + } + const isMain = parentURL === void 0; + if (isMain) { + parentURL = pathToFileURL3(`${process.cwd()}/`).href; + if (typeFlag) + throw new ERR_INPUT_TYPE_NOT_ALLOWED(); + } + conditions = getConditionsSet(conditions); + let url; + try { + url = moduleResolve(specifier, parentURL, conditions); + } catch (error2) { + if (error2.code === "ERR_MODULE_NOT_FOUND" || error2.code === "ERR_UNSUPPORTED_DIR_IMPORT") { + if (StringPrototypeStartsWith(specifier, "file://")) { + specifier = fileURLToPath3(specifier); + } + const found = resolveAsCommonJS(specifier, parentURL); + if (found) { + const lines = StringPrototypeSplit(error2.stack, "\n"); + const hint = `Did you mean to import ${found}?`; + error2.stack = ArrayPrototypeShift(lines) + "\n" + hint + "\n" + ArrayPrototypeJoin(lines, "\n"); + error2.message += ` +${hint}`; + } + } + throw error2; + } + if (isMain ? !preserveSymlinksMain : !preserveSymlinks) { + const urlPath = fileURLToPath3(url); + const real = realpathSync2(urlPath, { + // [internalFS.realpathCacheKey]: realpathCache + }); + const old = url; + url = pathToFileURL3( + real + (StringPrototypeEndsWith(urlPath, sep2) ? "/" : "") + ); + url.search = old.search; + url.hash = old.hash; + } + return { url: `${url}` }; + } + return { + DEFAULT_CONDITIONS, + defaultResolve, + encodedSepRegEx, + getPackageType, + packageExportsResolve, + packageImportsResolve + }; + } + module5.exports = { + createResolve + }; + } +}); + +// node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +var require_node_internal_modules_esm_get_format = __commonJS({ + "node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var { + RegExpPrototypeExec, + StringPrototypeStartsWith + } = require_node_primordials(); + var { extname: extname2 } = (init_path(), __toCommonJS(path_exports)); + var { getOptionValue } = require_node_options(); + var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((s7) => parseInt(s7, 10)); + var experimentalJsonModules = nodeMajor > 17 || nodeMajor === 17 && nodeMinor >= 5 || nodeMajor === 16 && nodeMinor >= 15 || getOptionValue("--experimental-json-modules"); + var experimentalWasmModules = getOptionValue("--experimental-wasm-modules"); + var { URL: URL2, fileURLToPath: fileURLToPath3 } = (init_url(), __toCommonJS(url_exports)); + var { ERR_UNKNOWN_FILE_EXTENSION } = require_node_internal_errors().codes; + var extensionFormatMap = { + "__proto__": null, + ".cjs": "commonjs", + ".js": "module", + ".mjs": "module" + }; + var legacyExtensionFormatMap = { + "__proto__": null, + ".cjs": "commonjs", + ".js": "commonjs", + ".json": "commonjs", + ".mjs": "module", + ".node": "commonjs" + }; + if (experimentalWasmModules) + extensionFormatMap[".wasm"] = legacyExtensionFormatMap[".wasm"] = "wasm"; + if (experimentalJsonModules) + extensionFormatMap[".json"] = legacyExtensionFormatMap[".json"] = "json"; + function createGetFormat(tsNodeExperimentalSpecifierResolution, nodeEsmResolver) { + let experimentalSpeciferResolution = tsNodeExperimentalSpecifierResolution != null ? tsNodeExperimentalSpecifierResolution : getOptionValue("--experimental-specifier-resolution"); + const { getPackageType } = nodeEsmResolver; + function defaultGetFormat(url, context2, defaultGetFormatUnused) { + if (StringPrototypeStartsWith(url, "node:")) { + return { format: "builtin" }; + } + const parsed = new URL2(url); + if (parsed.protocol === "data:") { + const [, mime] = RegExpPrototypeExec( + /^([^/]+\/[^;,]+)(?:[^,]*?)(;base64)?,/, + parsed.pathname + ) || [null, null, null]; + const format5 = { + "__proto__": null, + "text/javascript": "module", + "application/json": experimentalJsonModules ? "json" : null, + "application/wasm": experimentalWasmModules ? "wasm" : null + }[mime] || null; + return { format: format5 }; + } else if (parsed.protocol === "file:") { + const ext = extname2(parsed.pathname); + let format5; + if (ext === ".js") { + format5 = getPackageType(parsed.href) === "module" ? "module" : "commonjs"; + } else { + format5 = extensionFormatMap[ext]; + } + if (!format5) { + if (experimentalSpeciferResolution === "node") { + process.emitWarning( + "The Node.js specifier resolution in ESM is experimental.", + "ExperimentalWarning" + ); + format5 = legacyExtensionFormatMap[ext]; + } else { + throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath3(url)); + } + } + return { format: format5 || null }; + } + return { format: null }; + } + return { defaultGetFormat }; + } + module5.exports = { + createGetFormat + }; + } +}); + +// node_modules/ts-node/dist/esm.js +var require_esm = __commonJS({ + "node_modules/ts-node/dist/esm.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createEsmHooks = exports28.registerAndCreateEsmHooks = exports28.filterHooksByAPIVersion = void 0; + var index_1 = require_dist16(); + var url_1 = (init_url(), __toCommonJS(url_exports)); + var path_1 = (init_path(), __toCommonJS(path_exports)); + var assert4 = (init_assert(), __toCommonJS(assert_exports)); + var util_1 = require_util6(); + var module_1 = (init_module(), __toCommonJS(module_exports)); + var newHooksAPI = (0, util_1.versionGteLt)(process.versions.node, "16.12.0"); + function filterHooksByAPIVersion(hooks2) { + const { getFormat, load: load2, resolve: resolve3, transformSource } = hooks2; + const hooksAPI = newHooksAPI ? { resolve: resolve3, load: load2, getFormat: void 0, transformSource: void 0 } : { resolve: resolve3, getFormat, transformSource, load: void 0 }; + return hooksAPI; + } + exports28.filterHooksByAPIVersion = filterHooksByAPIVersion; + function registerAndCreateEsmHooks(opts) { + const tsNodeInstance = (0, index_1.register)(opts); + return createEsmHooks(tsNodeInstance); + } + exports28.registerAndCreateEsmHooks = registerAndCreateEsmHooks; + function createEsmHooks(tsNodeService) { + tsNodeService.enableExperimentalEsmLoaderInterop(); + const nodeResolveImplementation = tsNodeService.getNodeEsmResolver(); + const nodeGetFormatImplementation = tsNodeService.getNodeEsmGetFormat(); + const extensions6 = tsNodeService.extensions; + const hooksAPI = filterHooksByAPIVersion({ + resolve: resolve3, + load: load2, + getFormat, + transformSource + }); + function isFileUrlOrNodeStyleSpecifier(parsed) { + const { protocol } = parsed; + return protocol === null || protocol === "file:"; + } + function isProbablyEntrypoint(specifier, parentURL) { + return parentURL === void 0 && specifier.startsWith("file://"); + } + const rememberIsProbablyEntrypoint = /* @__PURE__ */ new Set(); + const rememberResolvedViaCommonjsFallback = /* @__PURE__ */ new Set(); + async function resolve3(specifier, context2, defaultResolve) { + const defer2 = async () => { + const r8 = await defaultResolve(specifier, context2, defaultResolve); + return r8; + }; + async function entrypointFallback(cb) { + try { + const resolution = await cb(); + if ((resolution === null || resolution === void 0 ? void 0 : resolution.url) && isProbablyEntrypoint(specifier, context2.parentURL)) + rememberIsProbablyEntrypoint.add(resolution.url); + return resolution; + } catch (esmResolverError) { + if (!isProbablyEntrypoint(specifier, context2.parentURL)) + throw esmResolverError; + try { + let cjsSpecifier = specifier; + try { + if (specifier.startsWith("file://")) + cjsSpecifier = (0, url_1.fileURLToPath)(specifier); + } catch { + } + const resolution = (0, url_1.pathToFileURL)((0, module_1.createRequire)(process.cwd()).resolve(cjsSpecifier)).toString(); + rememberIsProbablyEntrypoint.add(resolution); + rememberResolvedViaCommonjsFallback.add(resolution); + return { url: resolution, format: "commonjs" }; + } catch (commonjsResolverError) { + throw esmResolverError; + } + } + } + return addShortCircuitFlag(async () => { + const parsed = (0, url_1.parse)(specifier); + const { pathname, protocol, hostname: hostname2 } = parsed; + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return entrypointFallback(defer2); + } + if (protocol !== null && protocol !== "file:") { + return entrypointFallback(defer2); + } + if (hostname2) { + return entrypointFallback(defer2); + } + return entrypointFallback(() => nodeResolveImplementation.defaultResolve(specifier, context2, defaultResolve)); + }); + } + async function load2(url, context2, defaultLoad) { + return addShortCircuitFlag(async () => { + var _a2; + const format5 = (_a2 = context2.format) !== null && _a2 !== void 0 ? _a2 : (await getFormat(url, context2, nodeGetFormatImplementation.defaultGetFormat)).format; + let source = void 0; + if (format5 !== "builtin" && format5 !== "commonjs") { + const { source: rawSource } = await defaultLoad(url, { + ...context2, + format: format5 + }, defaultLoad); + if (rawSource === void 0 || rawSource === null) { + throw new Error(`Failed to load raw source: Format was '${format5}' and url was '${url}''.`); + } + const defaultTransformSource = async (source2, _context, _defaultTransformSource) => ({ source: source2 }); + const { source: transformedSource } = await transformSource(rawSource, { url, format: format5 }, defaultTransformSource); + source = transformedSource; + } + return { format: format5, source }; + }); + } + async function getFormat(url, context2, defaultGetFormat) { + const defer2 = (overrideUrl = url) => defaultGetFormat(overrideUrl, context2, defaultGetFormat); + async function entrypointFallback(cb) { + try { + return await cb(); + } catch (getFormatError) { + if (!rememberIsProbablyEntrypoint.has(url)) + throw getFormatError; + return { format: "commonjs" }; + } + } + const parsed = (0, url_1.parse)(url); + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return entrypointFallback(defer2); + } + const { pathname } = parsed; + assert4(pathname !== null, "ESM getFormat() hook: URL should never have null pathname"); + const nativePath = (0, url_1.fileURLToPath)(url); + let nodeSays; + const ext = (0, path_1.extname)(nativePath); + const tsNodeIgnored = tsNodeService.ignored(nativePath); + const nodeEquivalentExt = extensions6.nodeEquivalents.get(ext); + if (nodeEquivalentExt && !tsNodeIgnored) { + nodeSays = await entrypointFallback(() => defer2((0, url_1.format)((0, url_1.pathToFileURL)(nativePath + nodeEquivalentExt)))); + } else { + try { + nodeSays = await entrypointFallback(defer2); + } catch (e10) { + if (e10 instanceof Error && tsNodeIgnored && extensions6.nodeDoesNotUnderstand.includes(ext)) { + e10.message += ` + +Hint: +ts-node is configured to ignore this file. +If you want ts-node to handle this file, consider enabling the "skipIgnore" option or adjusting your "ignore" patterns. +https://typestrong.org/ts-node/docs/scope +`; + } + throw e10; + } + } + if (!tsNodeService.ignored(nativePath) && (nodeSays.format === "commonjs" || nodeSays.format === "module")) { + const { moduleType } = tsNodeService.moduleTypeClassifier.classifyModuleByModuleTypeOverrides((0, util_1.normalizeSlashes)(nativePath)); + if (moduleType === "cjs") { + return { format: "commonjs" }; + } else if (moduleType === "esm") { + return { format: "module" }; + } + } + return nodeSays; + } + async function transformSource(source, context2, defaultTransformSource) { + if (source === null || source === void 0) { + throw new Error("No source"); + } + const defer2 = () => defaultTransformSource(source, context2, defaultTransformSource); + const sourceAsString = typeof source === "string" ? source : source.toString("utf8"); + const { url } = context2; + const parsed = (0, url_1.parse)(url); + if (!isFileUrlOrNodeStyleSpecifier(parsed)) { + return defer2(); + } + const nativePath = (0, url_1.fileURLToPath)(url); + if (tsNodeService.ignored(nativePath)) { + return defer2(); + } + const emittedJs = tsNodeService.compile(sourceAsString, nativePath); + return { source: emittedJs }; + } + return hooksAPI; + } + exports28.createEsmHooks = createEsmHooks; + async function addShortCircuitFlag(fn) { + const ret = await fn(); + if (ret == null) + return ret; + return { + ...ret, + shortCircuit: true + }; + } + } +}); + +// node_modules/ts-node/dist/index.js +var require_dist16 = __commonJS({ + "node_modules/ts-node/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var _a2; + var _b; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.createEsmHooks = exports28.createFromPreloadedConfig = exports28.create = exports28.register = exports28.TSError = exports28.DEFAULTS = exports28.VERSION = exports28.debug = exports28.INSPECT_CUSTOM = exports28.env = exports28.REGISTER_INSTANCE = exports28.createRepl = void 0; + var path_1 = (init_path(), __toCommonJS(path_exports)); + var module_1 = (init_module(), __toCommonJS(module_exports)); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var url_1 = (init_url(), __toCommonJS(url_exports)); + var make_error_1 = require_make_error(); + var util_1 = require_util6(); + var configuration_1 = require_configuration(); + var module_type_classifier_1 = require_module_type_classifier(); + var resolver_functions_1 = require_resolver_functions(); + var cjs_resolve_hooks_1 = require_cjs_resolve_hooks(); + var node_module_type_classifier_1 = require_node_module_type_classifier(); + var file_extensions_1 = require_file_extensions(); + var ts_transpile_module_1 = require_ts_transpile_module(); + var repl_1 = require_repl(); + Object.defineProperty(exports28, "createRepl", { enumerable: true, get: function() { + return repl_1.createRepl; + } }); + var engineSupportsPackageTypeField = parseInt(process.versions.node.split(".")[0], 10) >= 12; + var assertScriptCanLoadAsCJS = engineSupportsPackageTypeField ? require_node_internal_modules_cjs_loader().assertScriptCanLoadAsCJSImpl : () => { + }; + exports28.REGISTER_INSTANCE = Symbol.for("ts-node.register.instance"); + exports28.env = process.env; + exports28.INSPECT_CUSTOM = util2.inspect.custom || "inspect"; + var shouldDebug = (0, util_1.yn)(exports28.env.TS_NODE_DEBUG); + exports28.debug = shouldDebug ? (...args) => console.log(`[ts-node ${(/* @__PURE__ */ new Date()).toISOString()}]`, ...args) : () => void 0; + var debugFn = shouldDebug ? (key, fn) => { + let i7 = 0; + return (x7) => { + (0, exports28.debug)(key, x7, ++i7); + return fn(x7); + }; + } : (_6, fn) => fn; + exports28.VERSION = require_package().version; + exports28.DEFAULTS = { + cwd: (_a2 = exports28.env.TS_NODE_CWD) !== null && _a2 !== void 0 ? _a2 : exports28.env.TS_NODE_DIR, + emit: (0, util_1.yn)(exports28.env.TS_NODE_EMIT), + scope: (0, util_1.yn)(exports28.env.TS_NODE_SCOPE), + scopeDir: exports28.env.TS_NODE_SCOPE_DIR, + files: (0, util_1.yn)(exports28.env.TS_NODE_FILES), + pretty: (0, util_1.yn)(exports28.env.TS_NODE_PRETTY), + compiler: exports28.env.TS_NODE_COMPILER, + compilerOptions: (0, util_1.parse)(exports28.env.TS_NODE_COMPILER_OPTIONS), + ignore: (0, util_1.split)(exports28.env.TS_NODE_IGNORE), + project: exports28.env.TS_NODE_PROJECT, + skipProject: (0, util_1.yn)(exports28.env.TS_NODE_SKIP_PROJECT), + skipIgnore: (0, util_1.yn)(exports28.env.TS_NODE_SKIP_IGNORE), + preferTsExts: (0, util_1.yn)(exports28.env.TS_NODE_PREFER_TS_EXTS), + ignoreDiagnostics: (0, util_1.split)(exports28.env.TS_NODE_IGNORE_DIAGNOSTICS), + transpileOnly: (0, util_1.yn)(exports28.env.TS_NODE_TRANSPILE_ONLY), + typeCheck: (0, util_1.yn)(exports28.env.TS_NODE_TYPE_CHECK), + compilerHost: (0, util_1.yn)(exports28.env.TS_NODE_COMPILER_HOST), + logError: (0, util_1.yn)(exports28.env.TS_NODE_LOG_ERROR), + experimentalReplAwait: (_b = (0, util_1.yn)(exports28.env.TS_NODE_EXPERIMENTAL_REPL_AWAIT)) !== null && _b !== void 0 ? _b : void 0, + tsTrace: console.log.bind(console) + }; + var TSError = class extends make_error_1.BaseError { + constructor(diagnosticText, diagnosticCodes, diagnostics = []) { + super(`\u2A2F Unable to compile TypeScript: +${diagnosticText}`); + this.diagnosticCodes = diagnosticCodes; + this.name = "TSError"; + Object.defineProperty(this, "diagnosticText", { + configurable: true, + writable: true, + value: diagnosticText + }); + Object.defineProperty(this, "diagnostics", { + configurable: true, + writable: true, + value: diagnostics + }); + } + /** + * @internal + */ + [exports28.INSPECT_CUSTOM]() { + return this.diagnosticText; + } + }; + exports28.TSError = TSError; + var TS_NODE_SERVICE_BRAND = Symbol("TS_NODE_SERVICE_BRAND"); + function register(serviceOrOpts) { + let service = serviceOrOpts; + if (!(serviceOrOpts === null || serviceOrOpts === void 0 ? void 0 : serviceOrOpts[TS_NODE_SERVICE_BRAND])) { + service = create2(serviceOrOpts !== null && serviceOrOpts !== void 0 ? serviceOrOpts : {}); + } + const originalJsHandler = __require.extensions[".js"]; + process[exports28.REGISTER_INSTANCE] = service; + registerExtensions(service.options.preferTsExts, service.extensions.compiled, service, originalJsHandler); + (0, cjs_resolve_hooks_1.installCommonjsResolveHooksIfNecessary)(service); + module_1.Module._preloadModules(service.options.require); + return service; + } + exports28.register = register; + function create2(rawOptions = {}) { + const foundConfigResult = (0, configuration_1.findAndReadConfig)(rawOptions); + return createFromPreloadedConfig(foundConfigResult); + } + exports28.create = create2; + function createFromPreloadedConfig(foundConfigResult) { + var _a3, _b2, _c, _d; + const { configFilePath, cwd: cwd3, options, config: config3, compiler, projectLocalResolveDir, optionBasePaths } = foundConfigResult; + const projectLocalResolveHelper = (0, util_1.createProjectLocalResolveHelper)(projectLocalResolveDir); + const ts = (0, configuration_1.loadCompiler)(compiler); + const targetSupportsTla = config3.options.target >= ts.ScriptTarget.ES2018; + if (options.experimentalReplAwait === true && !targetSupportsTla) { + throw new Error("Experimental REPL await is not compatible with targets lower than ES2018"); + } + const tsVersionSupportsTla = (0, util_1.versionGteLt)(ts.version, "3.8.0"); + if (options.experimentalReplAwait === true && !tsVersionSupportsTla) { + throw new Error("Experimental REPL await is not compatible with TypeScript versions older than 3.8"); + } + const shouldReplAwait = options.experimentalReplAwait !== false && tsVersionSupportsTla && targetSupportsTla; + if (options.swc && !options.typeCheck) { + if (options.transpileOnly === false) { + throw new Error("Cannot enable 'swc' option with 'transpileOnly: false'. 'swc' implies 'transpileOnly'."); + } + if (options.transpiler) { + throw new Error("Cannot specify both 'swc' and 'transpiler' options. 'swc' uses the built-in swc transpiler."); + } + } + const readFile2 = options.readFile || ts.sys.readFile; + const fileExists = options.fileExists || ts.sys.fileExists; + const transpileOnly = (options.transpileOnly === true || options.swc === true) && options.typeCheck !== true; + let transpiler = void 0; + let transpilerBasePath = void 0; + if (options.transpiler) { + transpiler = options.transpiler; + transpilerBasePath = optionBasePaths.transpiler; + } else if (options.swc) { + transpiler = __require.resolve("./transpilers/swc.js"); + transpilerBasePath = optionBasePaths.swc; + } + const transformers = options.transformers || void 0; + const diagnosticFilters = [ + { + appliesToAllFiles: true, + filenamesAbsolute: [], + diagnosticsIgnored: [ + 6059, + 18002, + 18003, + ...options.experimentalTsImportSpecifiers ? [ + 2691 + // "An import path cannot end with a '.ts' extension. Consider importing '' instead." + ] : [], + ...options.ignoreDiagnostics || [] + ].map(Number) + } + ]; + const configDiagnosticList = filterDiagnostics(config3.errors, diagnosticFilters); + const outputCache = /* @__PURE__ */ new Map(); + const configFileDirname = configFilePath ? (0, path_1.dirname)(configFilePath) : null; + const scopeDir = (_c = (_b2 = (_a3 = options.scopeDir) !== null && _a3 !== void 0 ? _a3 : config3.options.rootDir) !== null && _b2 !== void 0 ? _b2 : configFileDirname) !== null && _c !== void 0 ? _c : cwd3; + const ignoreBaseDir = configFileDirname !== null && configFileDirname !== void 0 ? configFileDirname : cwd3; + const isScoped = options.scope ? (fileName) => (0, path_1.relative)(scopeDir, fileName).charAt(0) !== "." : () => true; + const shouldIgnore = createIgnore(ignoreBaseDir, options.skipIgnore ? [] : (options.ignore || ["(?:^|/)node_modules/"]).map((str2) => new RegExp(str2))); + const diagnosticHost = { + getNewLine: () => ts.sys.newLine, + getCurrentDirectory: () => cwd3, + // TODO switch to getCanonicalFileName we already create later in scope + getCanonicalFileName: ts.sys.useCaseSensitiveFileNames ? (x7) => x7 : (x7) => x7.toLowerCase() + }; + if (options.transpileOnly && typeof transformers === "function") { + throw new TypeError('Transformers function is unavailable in "--transpile-only"'); + } + let createTranspiler = initializeTranspilerFactory(); + function initializeTranspilerFactory() { + var _a4; + if (transpiler) { + let createTranspiler2 = function(compilerOptions, nodeModuleEmitKind) { + return transpilerFactory === null || transpilerFactory === void 0 ? void 0 : transpilerFactory({ + service: { + options, + config: { + ...config3, + options: compilerOptions + }, + projectLocalResolveHelper + }, + transpilerConfigLocalResolveHelper, + nodeModuleEmitKind, + ...transpilerOptions + }); + }; + if (!transpileOnly) + throw new Error("Custom transpiler can only be used when transpileOnly is enabled."); + const transpilerName = typeof transpiler === "string" ? transpiler : transpiler[0]; + const transpilerOptions = typeof transpiler === "string" ? {} : (_a4 = transpiler[1]) !== null && _a4 !== void 0 ? _a4 : {}; + const transpilerConfigLocalResolveHelper = transpilerBasePath ? (0, util_1.createProjectLocalResolveHelper)(transpilerBasePath) : projectLocalResolveHelper; + const transpilerPath = transpilerConfigLocalResolveHelper(transpilerName, true); + const transpilerFactory = __require(transpilerPath).create; + return createTranspiler2; + } + } + let experimentalEsmLoader = false; + function enableExperimentalEsmLoaderInterop() { + experimentalEsmLoader = true; + } + installSourceMapSupport(); + function installSourceMapSupport() { + const sourceMapSupport = require_source_map_support2(); + sourceMapSupport.install({ + environment: "node", + retrieveFile(pathOrUrl) { + var _a4; + let path2 = pathOrUrl; + if (experimentalEsmLoader && path2.startsWith("file://")) { + try { + path2 = (0, url_1.fileURLToPath)(path2); + } catch (e10) { + } + } + path2 = (0, util_1.normalizeSlashes)(path2); + return ((_a4 = outputCache.get(path2)) === null || _a4 === void 0 ? void 0 : _a4.content) || ""; + }, + redirectConflictingLibrary: true, + onConflictingLibraryRedirect(request3, parent2, isMain, options2, redirectedRequest) { + (0, exports28.debug)(`Redirected an attempt to require source-map-support to instead receive @cspotcode/source-map-support. "${parent2.filename}" attempted to require or resolve "${request3}" and was redirected to "${redirectedRequest}".`); + } + }); + } + const shouldHavePrettyErrors = options.pretty === void 0 ? process.stdout.isTTY : options.pretty; + const formatDiagnostics = shouldHavePrettyErrors ? ts.formatDiagnosticsWithColorAndContext || ts.formatDiagnostics : ts.formatDiagnostics; + function createTSError(diagnostics) { + const diagnosticText = formatDiagnostics(diagnostics, diagnosticHost); + const diagnosticCodes = diagnostics.map((x7) => x7.code); + return new TSError(diagnosticText, diagnosticCodes, diagnostics); + } + function reportTSError(configDiagnosticList2) { + const error2 = createTSError(configDiagnosticList2); + if (options.logError) { + console.error("\x1B[31m%s\x1B[0m", error2); + } else { + throw error2; + } + } + if (configDiagnosticList.length) + reportTSError(configDiagnosticList); + const jsxEmitPreserve = config3.options.jsx === ts.JsxEmit.Preserve; + function getEmitExtension(path2) { + const lastDotIndex = path2.lastIndexOf("."); + if (lastDotIndex >= 0) { + const ext = path2.slice(lastDotIndex); + switch (ext) { + case ".js": + case ".ts": + return ".js"; + case ".jsx": + case ".tsx": + return jsxEmitPreserve ? ".jsx" : ".js"; + case ".mjs": + case ".mts": + return ".mjs"; + case ".cjs": + case ".cts": + return ".cjs"; + } + } + return ".js"; + } + let getOutput; + let getTypeInfo; + const getCanonicalFileName = ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames); + const moduleTypeClassifier = (0, module_type_classifier_1.createModuleTypeClassifier)({ + basePath: (_d = options.optionBasePaths) === null || _d === void 0 ? void 0 : _d.moduleTypes, + patterns: options.moduleTypes + }); + const extensions6 = (0, file_extensions_1.getExtensions)(config3, options, ts.version); + if (!transpileOnly) { + const fileContents = /* @__PURE__ */ new Map(); + const rootFileNames = new Set(config3.fileNames); + const cachedReadFile = (0, util_1.cachedLookup)(debugFn("readFile", readFile2)); + if (!options.compilerHost) { + let projectVersion = 1; + const fileVersions = new Map(Array.from(rootFileNames).map((fileName) => [fileName, 0])); + const getCustomTransformers = () => { + if (typeof transformers === "function") { + const program = service.getProgram(); + return program ? transformers(program) : void 0; + } + return transformers; + }; + const serviceHost = { + getProjectVersion: () => String(projectVersion), + getScriptFileNames: () => Array.from(rootFileNames), + getScriptVersion: (fileName) => { + const version5 = fileVersions.get(fileName); + return version5 ? version5.toString() : ""; + }, + getScriptSnapshot(fileName) { + let contents = fileContents.get(fileName); + if (contents === void 0) { + contents = cachedReadFile(fileName); + if (contents === void 0) + return; + fileVersions.set(fileName, 1); + fileContents.set(fileName, contents); + projectVersion++; + } + return ts.ScriptSnapshot.fromString(contents); + }, + readFile: cachedReadFile, + readDirectory: ts.sys.readDirectory, + getDirectories: (0, util_1.cachedLookup)(debugFn("getDirectories", ts.sys.getDirectories)), + fileExists: (0, util_1.cachedLookup)(debugFn("fileExists", fileExists)), + directoryExists: (0, util_1.cachedLookup)(debugFn("directoryExists", ts.sys.directoryExists)), + realpath: ts.sys.realpath ? (0, util_1.cachedLookup)(debugFn("realpath", ts.sys.realpath)) : void 0, + getNewLine: () => ts.sys.newLine, + useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames, + getCurrentDirectory: () => cwd3, + getCompilationSettings: () => config3.options, + getDefaultLibFileName: () => ts.getDefaultLibFilePath(config3.options), + getCustomTransformers, + trace: options.tsTrace + }; + const { resolveModuleNames, getResolvedModuleWithFailedLookupLocationsFromCache, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal } = (0, resolver_functions_1.createResolverFunctions)({ + host: serviceHost, + getCanonicalFileName, + ts, + cwd: cwd3, + config: config3, + projectLocalResolveHelper, + options, + extensions: extensions6 + }); + serviceHost.resolveModuleNames = resolveModuleNames; + serviceHost.getResolvedModuleWithFailedLookupLocationsFromCache = getResolvedModuleWithFailedLookupLocationsFromCache; + serviceHost.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives; + const registry = ts.createDocumentRegistry(ts.sys.useCaseSensitiveFileNames, cwd3); + const service = ts.createLanguageService(serviceHost, registry); + const updateMemoryCache = (contents, fileName) => { + if (!rootFileNames.has(fileName) && !isFileKnownToBeInternal(fileName)) { + markBucketOfFilenameInternal(fileName); + rootFileNames.add(fileName); + projectVersion++; + } + const previousVersion = fileVersions.get(fileName) || 0; + const previousContents = fileContents.get(fileName); + if (contents !== previousContents) { + fileVersions.set(fileName, previousVersion + 1); + fileContents.set(fileName, contents); + projectVersion++; + } + }; + let previousProgram = void 0; + getOutput = (code, fileName) => { + updateMemoryCache(code, fileName); + const programBefore = service.getProgram(); + if (programBefore !== previousProgram) { + (0, exports28.debug)(`compiler rebuilt Program instance when getting output for ${fileName}`); + } + const output = service.getEmitOutput(fileName); + const diagnostics = service.getSemanticDiagnostics(fileName).concat(service.getSyntacticDiagnostics(fileName)); + const programAfter = service.getProgram(); + (0, exports28.debug)("invariant: Is service.getProject() identical before and after getting emit output and diagnostics? (should always be true) ", programBefore === programAfter); + previousProgram = programAfter; + const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + if (output.emitSkipped) { + return [void 0, void 0, true]; + } + if (output.outputFiles.length === 0) { + throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd3, fileName)} +This is usually the result of a faulty configuration or import. Make sure there is a \`.js\`, \`.json\` or other executable extension with loader attached before \`ts-node\` available.`); + } + return [output.outputFiles[1].text, output.outputFiles[0].text, false]; + }; + getTypeInfo = (code, fileName, position) => { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + updateMemoryCache(code, normalizedFileName); + const info2 = service.getQuickInfoAtPosition(normalizedFileName, position); + const name2 = ts.displayPartsToString(info2 ? info2.displayParts : []); + const comment = ts.displayPartsToString(info2 ? info2.documentation : []); + return { name: name2, comment }; + }; + } else { + const sys = { + ...ts.sys, + ...diagnosticHost, + readFile: (fileName) => { + const cacheContents = fileContents.get(fileName); + if (cacheContents !== void 0) + return cacheContents; + const contents = cachedReadFile(fileName); + if (contents) + fileContents.set(fileName, contents); + return contents; + }, + readDirectory: ts.sys.readDirectory, + getDirectories: (0, util_1.cachedLookup)(debugFn("getDirectories", ts.sys.getDirectories)), + fileExists: (0, util_1.cachedLookup)(debugFn("fileExists", fileExists)), + directoryExists: (0, util_1.cachedLookup)(debugFn("directoryExists", ts.sys.directoryExists)), + resolvePath: (0, util_1.cachedLookup)(debugFn("resolvePath", ts.sys.resolvePath)), + realpath: ts.sys.realpath ? (0, util_1.cachedLookup)(debugFn("realpath", ts.sys.realpath)) : void 0 + }; + const host = ts.createIncrementalCompilerHost ? ts.createIncrementalCompilerHost(config3.options, sys) : { + ...sys, + getSourceFile: (fileName, languageVersion) => { + const contents = sys.readFile(fileName); + if (contents === void 0) + return; + return ts.createSourceFile(fileName, contents, languageVersion); + }, + getDefaultLibLocation: () => (0, util_1.normalizeSlashes)((0, path_1.dirname)(compiler)), + getDefaultLibFileName: () => (0, util_1.normalizeSlashes)((0, path_1.join)((0, path_1.dirname)(compiler), ts.getDefaultLibFileName(config3.options))), + useCaseSensitiveFileNames: () => sys.useCaseSensitiveFileNames + }; + host.trace = options.tsTrace; + const { resolveModuleNames, resolveTypeReferenceDirectives, isFileKnownToBeInternal, markBucketOfFilenameInternal } = (0, resolver_functions_1.createResolverFunctions)({ + host, + cwd: cwd3, + config: config3, + ts, + getCanonicalFileName, + projectLocalResolveHelper, + options, + extensions: extensions6 + }); + host.resolveModuleNames = resolveModuleNames; + host.resolveTypeReferenceDirectives = resolveTypeReferenceDirectives; + let builderProgram = ts.createIncrementalProgram ? ts.createIncrementalProgram({ + rootNames: Array.from(rootFileNames), + options: config3.options, + host, + configFileParsingDiagnostics: config3.errors, + projectReferences: config3.projectReferences + }) : ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config3.options, host, void 0, config3.errors, config3.projectReferences); + const customTransformers = typeof transformers === "function" ? transformers(builderProgram.getProgram()) : transformers; + const updateMemoryCache = (contents, fileName) => { + const previousContents = fileContents.get(fileName); + const contentsChanged = previousContents !== contents; + if (contentsChanged) { + fileContents.set(fileName, contents); + } + let addedToRootFileNames = false; + if (!rootFileNames.has(fileName) && !isFileKnownToBeInternal(fileName)) { + markBucketOfFilenameInternal(fileName); + rootFileNames.add(fileName); + addedToRootFileNames = true; + } + if (addedToRootFileNames || contentsChanged) { + builderProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram(Array.from(rootFileNames), config3.options, host, builderProgram, config3.errors, config3.projectReferences); + } + }; + getOutput = (code, fileName) => { + let outText = ""; + let outMap = ""; + updateMemoryCache(code, fileName); + const sourceFile = builderProgram.getSourceFile(fileName); + if (!sourceFile) + throw new TypeError(`Unable to read file: ${fileName}`); + const program = builderProgram.getProgram(); + const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile); + const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + const result2 = builderProgram.emit(sourceFile, (path2, file, writeByteOrderMark) => { + if (path2.endsWith(".map")) { + outMap = file; + } else { + outText = file; + } + if (options.emit) + sys.writeFile(path2, file, writeByteOrderMark); + }, void 0, void 0, customTransformers); + if (result2.emitSkipped) { + return [void 0, void 0, true]; + } + if (outText === "") { + if (program.isSourceFileFromExternalLibrary(sourceFile)) { + throw new TypeError(`Unable to compile file from external library: ${(0, path_1.relative)(cwd3, fileName)}`); + } + throw new TypeError(`Unable to require file: ${(0, path_1.relative)(cwd3, fileName)} +This is usually the result of a faulty configuration or import. Make sure there is a \`.js\`, \`.json\` or other executable extension with loader attached before \`ts-node\` available.`); + } + return [outText, outMap, false]; + }; + getTypeInfo = (code, fileName, position) => { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + updateMemoryCache(code, normalizedFileName); + const sourceFile = builderProgram.getSourceFile(normalizedFileName); + if (!sourceFile) + throw new TypeError(`Unable to read file: ${fileName}`); + const node = getTokenAtPosition(ts, sourceFile, position); + const checker = builderProgram.getProgram().getTypeChecker(); + const symbol = checker.getSymbolAtLocation(node); + if (!symbol) + return { name: "", comment: "" }; + const type3 = checker.getTypeOfSymbolAtLocation(symbol, node); + const signatures = [ + ...type3.getConstructSignatures(), + ...type3.getCallSignatures() + ]; + return { + name: signatures.length ? signatures.map((x7) => checker.signatureToString(x7)).join("\n") : checker.typeToString(type3), + comment: ts.displayPartsToString(symbol ? symbol.getDocumentationComment(checker) : []) + }; + }; + if (options.emit && config3.options.incremental) { + process.on("exit", () => { + builderProgram.getProgram().emitBuildInfo(); + }); + } + } + } else { + getTypeInfo = () => { + throw new TypeError('Type information is unavailable in "--transpile-only"'); + }; + } + function createTranspileOnlyGetOutputFunction(overrideModuleType, nodeModuleEmitKind) { + const compilerOptions = { ...config3.options }; + if (overrideModuleType !== void 0) + compilerOptions.module = overrideModuleType; + let customTranspiler = createTranspiler === null || createTranspiler === void 0 ? void 0 : createTranspiler(compilerOptions, nodeModuleEmitKind); + let tsTranspileModule = (0, util_1.versionGteLt)(ts.version, "4.7.0") ? (0, ts_transpile_module_1.createTsTranspileModule)(ts, { + compilerOptions, + reportDiagnostics: true, + transformers + }) : void 0; + return (code, fileName) => { + let result2; + if (customTranspiler) { + result2 = customTranspiler.transpile(code, { + fileName + }); + } else if (tsTranspileModule) { + result2 = tsTranspileModule(code, { + fileName + }, nodeModuleEmitKind === "nodeesm" ? "module" : "commonjs"); + } else { + result2 = ts.transpileModule(code, { + fileName, + compilerOptions, + reportDiagnostics: true, + transformers + }); + } + const diagnosticList = filterDiagnostics(result2.diagnostics || [], diagnosticFilters); + if (diagnosticList.length) + reportTSError(diagnosticList); + return [result2.outputText, result2.sourceMapText, false]; + }; + } + const shouldOverwriteEmitWhenForcingCommonJS = config3.options.module !== ts.ModuleKind.CommonJS; + const shouldOverwriteEmitWhenForcingEsm = !(config3.options.module === ts.ModuleKind.ES2015 || ts.ModuleKind.ES2020 && config3.options.module === ts.ModuleKind.ES2020 || ts.ModuleKind.ES2022 && config3.options.module === ts.ModuleKind.ES2022 || config3.options.module === ts.ModuleKind.ESNext); + const isNodeModuleType = ts.ModuleKind.Node16 && config3.options.module === ts.ModuleKind.Node16 || ts.ModuleKind.NodeNext && config3.options.module === ts.ModuleKind.NodeNext; + const getOutputForceCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.CommonJS); + const getOutputForceNodeCommonJS = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, "nodecjs"); + const getOutputForceNodeESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.NodeNext, "nodeesm"); + const getOutputForceESM = createTranspileOnlyGetOutputFunction(ts.ModuleKind.ES2022 || ts.ModuleKind.ES2020 || ts.ModuleKind.ES2015); + const getOutputTranspileOnly = createTranspileOnlyGetOutputFunction(); + function compile(code, fileName, lineOffset = 0) { + const normalizedFileName = (0, util_1.normalizeSlashes)(fileName); + const classification = moduleTypeClassifier.classifyModuleByModuleTypeOverrides(normalizedFileName); + let value2 = ""; + let sourceMap = ""; + let emitSkipped = true; + if (getOutput) { + [value2, sourceMap, emitSkipped] = getOutput(code, normalizedFileName); + } + if (classification.moduleType === "cjs" && (shouldOverwriteEmitWhenForcingCommonJS || emitSkipped)) { + [value2, sourceMap] = getOutputForceCommonJS(code, normalizedFileName); + } else if (classification.moduleType === "esm" && (shouldOverwriteEmitWhenForcingEsm || emitSkipped)) { + [value2, sourceMap] = getOutputForceESM(code, normalizedFileName); + } else if (emitSkipped) { + const classification2 = (0, node_module_type_classifier_1.classifyModule)(fileName, isNodeModuleType); + [value2, sourceMap] = classification2 === "nodecjs" ? getOutputForceNodeCommonJS(code, normalizedFileName) : classification2 === "nodeesm" ? getOutputForceNodeESM(code, normalizedFileName) : classification2 === "cjs" ? getOutputForceCommonJS(code, normalizedFileName) : classification2 === "esm" ? getOutputForceESM(code, normalizedFileName) : getOutputTranspileOnly(code, normalizedFileName); + } + const output = updateOutput(value2, normalizedFileName, sourceMap, getEmitExtension); + outputCache.set(normalizedFileName, { content: output }); + return output; + } + let active = true; + const enabled = (enabled2) => enabled2 === void 0 ? active : active = !!enabled2; + const ignored = (fileName) => { + if (!active) + return true; + const ext = (0, path_1.extname)(fileName); + if (extensions6.compiled.includes(ext)) { + return !isScoped(fileName) || shouldIgnore(fileName); + } + return true; + }; + function addDiagnosticFilter(filter2) { + diagnosticFilters.push({ + ...filter2, + filenamesAbsolute: filter2.filenamesAbsolute.map((f8) => (0, util_1.normalizeSlashes)(f8)) + }); + } + const getNodeEsmResolver = (0, util_1.once)(() => require_node_internal_modules_esm_resolve().createResolve({ + extensions: extensions6, + preferTsExts: options.preferTsExts, + tsNodeExperimentalSpecifierResolution: options.experimentalSpecifierResolution + })); + const getNodeEsmGetFormat = (0, util_1.once)(() => require_node_internal_modules_esm_get_format().createGetFormat(options.experimentalSpecifierResolution, getNodeEsmResolver())); + const getNodeCjsLoader = (0, util_1.once)(() => require_node_internal_modules_cjs_loader().createCjsLoader({ + extensions: extensions6, + preferTsExts: options.preferTsExts, + nodeEsmResolver: getNodeEsmResolver() + })); + return { + [TS_NODE_SERVICE_BRAND]: true, + ts, + compilerPath: compiler, + config: config3, + compile, + getTypeInfo, + ignored, + enabled, + options, + configFilePath, + moduleTypeClassifier, + shouldReplAwait, + addDiagnosticFilter, + installSourceMapSupport, + enableExperimentalEsmLoaderInterop, + transpileOnly, + projectLocalResolveHelper, + getNodeEsmResolver, + getNodeEsmGetFormat, + getNodeCjsLoader, + extensions: extensions6 + }; + } + exports28.createFromPreloadedConfig = createFromPreloadedConfig; + function createIgnore(ignoreBaseDir, ignore) { + return (fileName) => { + const relname = (0, path_1.relative)(ignoreBaseDir, fileName); + const path2 = (0, util_1.normalizeSlashes)(relname); + return ignore.some((x7) => x7.test(path2)); + }; + } + function registerExtensions(preferTsExts, extensions6, service, originalJsHandler) { + const exts = new Set(extensions6); + for (const cannotAdd of [".mts", ".cts", ".mjs", ".cjs"]) { + if (exts.has(cannotAdd) && !(0, util_1.hasOwnProperty)(__require.extensions, cannotAdd)) { + exts.add(".js"); + exts.delete(cannotAdd); + } + } + for (const ext of exts) { + registerExtension(ext, service, originalJsHandler); + } + if (preferTsExts) { + const preferredExtensions = /* @__PURE__ */ new Set([ + ...exts, + ...Object.keys(__require.extensions) + ]); + for (const ext of preferredExtensions) { + const old = Object.getOwnPropertyDescriptor(__require.extensions, ext); + delete __require.extensions[ext]; + Object.defineProperty(__require.extensions, ext, old); + } + } + } + function registerExtension(ext, service, originalHandler) { + const old = __require.extensions[ext] || originalHandler; + __require.extensions[ext] = function(m7, filename) { + if (service.ignored(filename)) + return old(m7, filename); + assertScriptCanLoadAsCJS(service, m7, filename); + const _compile = m7._compile; + m7._compile = function(code, fileName) { + (0, exports28.debug)("module._compile", fileName); + const result2 = service.compile(code, fileName); + return _compile.call(this, result2, fileName); + }; + return old(m7, filename); + }; + } + function updateOutput(outputText, fileName, sourceMap, getEmitExtension) { + const base64Map = Buffer.from(updateSourceMap(sourceMap, fileName), "utf8").toString("base64"); + const sourceMapContent = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${base64Map}`; + const prefix = "//# sourceMappingURL="; + const prefixLength = prefix.length; + const baseName = ( + /*foo.tsx*/ + (0, path_1.basename)(fileName) + ); + const extName = ( + /*.tsx*/ + (0, path_1.extname)(fileName) + ); + const extension = ( + /*.js*/ + getEmitExtension(fileName) + ); + const sourcemapFilename = baseName.slice(0, -extName.length) + extension + ".map"; + const sourceMapLengthWithoutPercentEncoding = prefixLength + sourcemapFilename.length; + if (outputText.substr(-sourceMapLengthWithoutPercentEncoding, prefixLength) === prefix) { + return outputText.slice(0, -sourceMapLengthWithoutPercentEncoding) + sourceMapContent; + } + const sourceMapLengthWithPercentEncoding = prefixLength + encodeURI(sourcemapFilename).length; + if (outputText.substr(-sourceMapLengthWithPercentEncoding, prefixLength) === prefix) { + return outputText.slice(0, -sourceMapLengthWithPercentEncoding) + sourceMapContent; + } + return `${outputText} +${sourceMapContent}`; + } + function updateSourceMap(sourceMapText, fileName) { + const sourceMap = JSON.parse(sourceMapText); + sourceMap.file = fileName; + sourceMap.sources = [fileName]; + delete sourceMap.sourceRoot; + return JSON.stringify(sourceMap); + } + function filterDiagnostics(diagnostics, filters) { + return diagnostics.filter((d7) => filters.every((f8) => { + var _a3; + return !f8.appliesToAllFiles && f8.filenamesAbsolute.indexOf((_a3 = d7.file) === null || _a3 === void 0 ? void 0 : _a3.fileName) === -1 || f8.diagnosticsIgnored.indexOf(d7.code) === -1; + })); + } + function getTokenAtPosition(ts, sourceFile, position) { + let current = sourceFile; + outer: + while (true) { + for (const child of current.getChildren(sourceFile)) { + const start = child.getFullStart(); + if (start > position) + break; + const end = child.getEnd(); + if (position <= end) { + current = child; + continue outer; + } + } + return current; + } + } + var createEsmHooks = (tsNodeService) => require_esm().createEsmHooks(tsNodeService); + exports28.createEsmHooks = createEsmHooks; + } +}); + +// node_modules/ts-node/register/index.js +var require_register = __commonJS({ + "node_modules/ts-node/register/index.js"() { + init_dirname(); + init_buffer2(); + init_process2(); + require_dist16().register(); + } +}); + +// node_modules/typescript-json-schema/dist/typescript-json-schema.js +var require_typescript_json_schema = __commonJS({ + "node_modules/typescript-json-schema/dist/typescript-json-schema.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __assign16 = exports28 && exports28.__assign || function() { + __assign16 = Object.assign || function(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign16.apply(this, arguments); + }; + var __awaiter60 = exports28 && exports28.__awaiter || function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator10 = exports28 && exports28.__generator || function(thisArg, body) { + var _6 = { label: 0, sent: function() { + if (t8[0] & 1) + throw t8[1]; + return t8[1]; + }, trys: [], ops: [] }, f8, y7, t8, g7; + return g7 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g7[Symbol.iterator] = function() { + return this; + }), g7; + function verb(n7) { + return function(v8) { + return step([n7, v8]); + }; + } + function step(op) { + if (f8) + throw new TypeError("Generator is already executing."); + while (_6) + try { + if (f8 = 1, y7 && (t8 = op[0] & 2 ? y7["return"] : op[0] ? y7["throw"] || ((t8 = y7["return"]) && t8.call(y7), 0) : y7.next) && !(t8 = t8.call(y7, op[1])).done) + return t8; + if (y7 = 0, t8) + op = [op[0] & 2, t8.value]; + switch (op[0]) { + case 0: + case 1: + t8 = op; + break; + case 4: + _6.label++; + return { value: op[1], done: false }; + case 5: + _6.label++; + y7 = op[1]; + op = [0]; + continue; + case 7: + op = _6.ops.pop(); + _6.trys.pop(); + continue; + default: + if (!(t8 = _6.trys, t8 = t8.length > 0 && t8[t8.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _6 = 0; + continue; + } + if (op[0] === 3 && (!t8 || op[1] > t8[0] && op[1] < t8[3])) { + _6.label = op[1]; + break; + } + if (op[0] === 6 && _6.label < t8[1]) { + _6.label = t8[1]; + t8 = op; + break; + } + if (t8 && _6.label < t8[2]) { + _6.label = t8[2]; + _6.ops.push(op); + break; + } + if (t8[2]) + _6.ops.pop(); + _6.trys.pop(); + continue; + } + op = body.call(thisArg, _6); + } catch (e10) { + op = [6, e10]; + y7 = 0; + } finally { + f8 = t8 = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.exec = exports28.programFromConfig = exports28.generateSchema = exports28.buildGenerator = exports28.getProgramFromFiles = exports28.JsonSchemaGenerator = exports28.regexRequire = exports28.getDefaultArgs = void 0; + var glob = require_glob(); + var safe_stable_stringify_1 = require_safe_stable_stringify2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var crypto_1 = (init_crypto(), __toCommonJS(crypto_exports)); + var ts = require_typescript(); + var path_equal_1 = require_cjs2(); + var vm = (init_vm(), __toCommonJS(vm_exports)); + var REGEX_FILE_NAME_OR_SPACE = /(\bimport\(".*?"\)|".*?")\.| /g; + var REGEX_TSCONFIG_NAME = /^.*\.json$/; + var REGEX_TJS_JSDOC = /^-([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; + var REGEX_GROUP_JSDOC = /^[.]?([\w]+)\s+(\S|\S[\s\S]*\S)\s*$/g; + var REGEX_REQUIRE = /^(\s+)?require\((\'@?[a-zA-Z0-9.\/_-]+\'|\"@?[a-zA-Z0-9.\/_-]+\")\)(\.([a-zA-Z0-9_$]+))?(\s+|$)/; + var NUMERIC_INDEX_PATTERN = "^[0-9]+$"; + function getDefaultArgs() { + return { + ref: true, + aliasRef: false, + topRef: false, + titles: false, + defaultProps: false, + noExtraProps: false, + propOrder: false, + typeOfKeyword: false, + required: false, + strictNullChecks: false, + esModuleInterop: false, + skipLibCheck: false, + ignoreErrors: false, + out: "", + validationKeywords: [], + include: [], + excludePrivate: false, + uniqueNames: false, + rejectDateType: false, + id: "", + defaultNumberType: "number", + tsNodeRegister: false + }; + } + exports28.getDefaultArgs = getDefaultArgs; + function extend3(target) { + var _6 = []; + for (var _i = 1; _i < arguments.length; _i++) { + _6[_i - 1] = arguments[_i]; + } + if (target == null) { + throw new TypeError("Cannot convert undefined or null to object"); + } + var to = Object(target); + for (var index4 = 1; index4 < arguments.length; index4++) { + var nextSource = arguments[index4]; + if (nextSource != null) { + for (var nextKey in nextSource) { + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + return to; + } + function unique(arr) { + var temp = {}; + for (var _i = 0, arr_1 = arr; _i < arr_1.length; _i++) { + var e10 = arr_1[_i]; + temp[e10] = true; + } + var r8 = []; + for (var k6 in temp) { + if (Object.prototype.hasOwnProperty.call(temp, k6)) { + r8.push(k6); + } + } + return r8; + } + function resolveRequiredFile(symbol, key, fileName, objectName) { + var sourceFile = getSourceFile(symbol); + var requiredFilePath = /^[.\/]+/.test(fileName) ? fileName === "." ? path2.resolve(sourceFile.fileName) : path2.resolve(path2.dirname(sourceFile.fileName), fileName) : fileName; + var requiredFile = __require(requiredFilePath); + if (!requiredFile) { + throw Error("Required: File couldn't be loaded"); + } + var requiredObject = objectName ? requiredFile[objectName] : requiredFile.default; + if (requiredObject === void 0) { + throw Error("Required: Variable is undefined"); + } + if (typeof requiredObject === "function") { + throw Error("Required: Can't use function as a variable"); + } + if (key === "examples" && !Array.isArray(requiredObject)) { + throw Error("Required: Variable isn't an array"); + } + return requiredObject; + } + function regexRequire(value2) { + return REGEX_REQUIRE.exec(value2); + } + exports28.regexRequire = regexRequire; + function parseValue2(symbol, key, value2) { + var match = regexRequire(value2); + if (match) { + var fileName = match[2].substr(1, match[2].length - 2).trim(); + var objectName = match[4]; + return resolveRequiredFile(symbol, key, fileName, objectName); + } + try { + return JSON.parse(value2); + } catch (error2) { + return value2; + } + } + function extractLiteralValue(typ) { + var str2 = typ.value; + if (str2 === void 0) { + str2 = typ.text; + } + if (typ.flags & ts.TypeFlags.StringLiteral) { + return str2; + } else if (typ.flags & ts.TypeFlags.BooleanLiteral) { + return typ.intrinsicName === "true"; + } else if (typ.flags & ts.TypeFlags.EnumLiteral) { + var num = parseFloat(str2); + return isNaN(num) ? str2 : num; + } else if (typ.flags & ts.TypeFlags.NumberLiteral) { + return parseFloat(str2); + } + return void 0; + } + function resolveTupleType(propertyType) { + if (!propertyType.getSymbol() && propertyType.getFlags() & ts.TypeFlags.Object && propertyType.objectFlags & ts.ObjectFlags.Reference) { + return propertyType.target; + } + if (!(propertyType.getFlags() & ts.TypeFlags.Object && propertyType.objectFlags & ts.ObjectFlags.Tuple)) { + return null; + } + return propertyType; + } + var simpleTypesAllowedProperties = { + type: true, + description: true + }; + function addSimpleType(def, type3) { + for (var k6 in def) { + if (!simpleTypesAllowedProperties[k6]) { + return false; + } + } + if (!def.type) { + def.type = type3; + } else if (typeof def.type !== "string") { + if (!def.type.every(function(val) { + return typeof val === "string"; + })) { + return false; + } + if (def.type.indexOf("null") === -1) { + def.type.push("null"); + } + } else { + if (typeof def.type !== "string") { + return false; + } + if (def.type !== "null") { + def.type = [def.type, "null"]; + } + } + return true; + } + function makeNullable(def) { + if (!addSimpleType(def, "null")) { + var union2 = def.oneOf || def.anyOf; + if (union2) { + union2.push({ type: "null" }); + } else { + var subdef = {}; + for (var k6 in def) { + if (def.hasOwnProperty(k6)) { + subdef[k6] = def[k6]; + delete def[k6]; + } + } + def.anyOf = [subdef, { type: "null" }]; + } + } + return def; + } + function getCanonicalDeclaration(sym) { + var _a2, _b, _c; + if (sym.valueDeclaration !== void 0) { + return sym.valueDeclaration; + } else if (((_a2 = sym.declarations) === null || _a2 === void 0 ? void 0 : _a2.length) === 1) { + return sym.declarations[0]; + } + var declarationCount = (_c = (_b = sym.declarations) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0; + throw new Error('Symbol "'.concat(sym.name, '" has no valueDeclaration and ').concat(declarationCount, " declarations.")); + } + function getSourceFile(sym) { + var currentDecl = getCanonicalDeclaration(sym); + while (currentDecl.kind !== ts.SyntaxKind.SourceFile) { + if (currentDecl.parent === void 0) { + throw new Error('Unable to locate source file for declaration "'.concat(sym.name, '".')); + } + currentDecl = currentDecl.parent; + } + return currentDecl; + } + var validationKeywords = { + multipleOf: true, + maximum: true, + exclusiveMaximum: true, + minimum: true, + exclusiveMinimum: true, + maxLength: true, + minLength: true, + pattern: true, + items: true, + maxItems: true, + minItems: true, + uniqueItems: true, + contains: true, + maxProperties: true, + minProperties: true, + additionalProperties: true, + enum: true, + type: true, + examples: true, + ignore: true, + description: true, + format: true, + default: true, + $ref: true, + id: true, + $id: true, + title: true + }; + var annotationKeywords = { + description: true, + default: true, + examples: true, + title: true, + $ref: true + }; + var subDefinitions = { + items: true, + additionalProperties: true, + contains: true + }; + var JsonSchemaGenerator = function() { + function JsonSchemaGenerator2(symbols, allSymbols, userSymbols, inheritingTypes, tc, args) { + if (args === void 0) { + args = getDefaultArgs(); + } + this.args = args; + this.reffedDefinitions = {}; + this.schemaOverrides = /* @__PURE__ */ new Map(); + this.typeNamesById = {}; + this.typeIdsByName = {}; + this.recursiveTypeRef = /* @__PURE__ */ new Map(); + this.symbols = symbols; + this.allSymbols = allSymbols; + this.userSymbols = userSymbols; + this.inheritingTypes = inheritingTypes; + this.tc = tc; + this.userValidationKeywords = args.validationKeywords.reduce(function(acc, word) { + var _a2; + return __assign16(__assign16({}, acc), (_a2 = {}, _a2[word] = true, _a2)); + }, {}); + } + Object.defineProperty(JsonSchemaGenerator2.prototype, "ReffedDefinitions", { + get: function() { + return this.reffedDefinitions; + }, + enumerable: false, + configurable: true + }); + JsonSchemaGenerator2.prototype.isFromDefaultLib = function(symbol) { + var declarations = symbol.getDeclarations(); + if (declarations && declarations.length > 0 && declarations[0].parent) { + return declarations[0].parent.getSourceFile().hasNoDefaultLib; + } + return false; + }; + JsonSchemaGenerator2.prototype.resetSchemaSpecificProperties = function() { + var _this = this; + this.reffedDefinitions = {}; + this.typeIdsByName = {}; + this.typeNamesById = {}; + this.schemaOverrides.forEach(function(value2, key) { + _this.reffedDefinitions[key] = value2; + }); + }; + JsonSchemaGenerator2.prototype.parseCommentsIntoDefinition = function(symbol, definition, otherAnnotations) { + var _this = this; + if (!symbol) { + return; + } + if (!this.isFromDefaultLib(symbol)) { + var comments = symbol.getDocumentationComment(this.tc); + if (comments.length) { + definition.description = comments.map(function(comment) { + var newlineNormalizedComment = comment.text.replace(/\r\n/g, "\n"); + if (comment.kind === "linkText") { + return newlineNormalizedComment.trim(); + } + return newlineNormalizedComment; + }).join("").trim(); + } + } + var jsdocs = symbol.getJsDocTags(); + jsdocs.forEach(function(doc) { + var _a2, _b; + var name2 = doc.name; + var originalText = doc.text ? doc.text.map(function(t8) { + return t8.text; + }).join("") : ""; + var text = originalText; + if (name2.startsWith("TJS-")) { + name2 = name2.slice(4); + if (!text) { + text = "true"; + } + } else if (name2 === "TJS" && text.startsWith("-")) { + var match = new RegExp(REGEX_TJS_JSDOC).exec(originalText); + if (match) { + name2 = match[1]; + text = match[2]; + } else { + name2 = text.replace(/^[\s\-]+/, ""); + text = "true"; + } + } + if (subDefinitions[name2]) { + var match = new RegExp(REGEX_GROUP_JSDOC).exec(text); + if (match) { + var k6 = match[1]; + var v8 = match[2]; + definition[name2] = __assign16(__assign16({}, definition[name2]), (_a2 = {}, _a2[k6] = v8 ? parseValue2(symbol, k6, v8) : true, _a2)); + return; + } + } + if (name2.includes(".")) { + var parts = name2.split("."); + if (parts.length === 2 && subDefinitions[parts[0]]) { + definition[parts[0]] = __assign16(__assign16({}, definition[parts[0]]), (_b = {}, _b[parts[1]] = text ? parseValue2(symbol, name2, text) : true, _b)); + } + } + if (validationKeywords[name2] || _this.userValidationKeywords[name2]) { + definition[name2] = text === void 0 ? "" : parseValue2(symbol, name2, text); + } else { + otherAnnotations[doc.name] = true; + } + }); + }; + JsonSchemaGenerator2.prototype.getDefinitionForRootType = function(propertyType, reffedType, definition, defaultNumberType, ignoreUndefined) { + var _a2; + var _this = this; + if (defaultNumberType === void 0) { + defaultNumberType = this.args.defaultNumberType; + } + if (ignoreUndefined === void 0) { + ignoreUndefined = false; + } + var tupleType2 = resolveTupleType(propertyType); + if (tupleType2) { + var elemTypes = propertyType.typeArguments; + var fixedTypes = elemTypes.map(function(elType) { + return _this.getTypeDefinition(elType); + }); + definition.type = "array"; + if (fixedTypes.length > 0) { + definition.items = fixedTypes; + } + var targetTupleType = propertyType.target; + definition.minItems = targetTupleType.minLength; + if (targetTupleType.hasRestElement) { + definition.additionalItems = fixedTypes[fixedTypes.length - 1]; + fixedTypes.splice(fixedTypes.length - 1, 1); + } else { + definition.maxItems = targetTupleType.fixedLength; + } + } else { + var propertyTypeString = this.tc.typeToString(propertyType, void 0, ts.TypeFormatFlags.UseFullyQualifiedType); + var flags = propertyType.flags; + var arrayType2 = this.tc.getIndexTypeOfType(propertyType, ts.IndexKind.Number); + if (flags & ts.TypeFlags.String) { + definition.type = "string"; + } else if (flags & ts.TypeFlags.Number) { + var isInteger3 = definition.type === "integer" || (reffedType === null || reffedType === void 0 ? void 0 : reffedType.getName()) === "integer" || defaultNumberType === "integer"; + definition.type = isInteger3 ? "integer" : "number"; + } else if (flags & ts.TypeFlags.Boolean) { + definition.type = "boolean"; + } else if (flags & ts.TypeFlags.ESSymbol) { + definition.type = "object"; + } else if (flags & ts.TypeFlags.Null) { + definition.type = "null"; + } else if (flags & ts.TypeFlags.Undefined || propertyTypeString === "void") { + if (!ignoreUndefined) { + throw new Error("Not supported: root type undefined"); + } + definition.type = "undefined"; + } else if (flags & ts.TypeFlags.Any || flags & ts.TypeFlags.Unknown) { + } else if (propertyTypeString === "Date" && !this.args.rejectDateType) { + definition.type = "string"; + definition.format = definition.format || "date-time"; + } else if (propertyTypeString === "object") { + definition.type = "object"; + definition.properties = {}; + definition.additionalProperties = true; + } else { + var value2 = extractLiteralValue(propertyType); + if (value2 !== void 0) { + var typeofValue = typeof value2; + switch (typeofValue) { + case "string": + case "boolean": + definition.type = typeofValue; + break; + case "number": + definition.type = this.args.defaultNumberType; + break; + case "object": + definition.type = "null"; + break; + default: + throw new Error("Not supported: ".concat(value2, " as a enum value")); + } + definition.const = value2; + } else if (arrayType2 !== void 0) { + if (propertyType.flags & ts.TypeFlags.Object && propertyType.objectFlags & (ts.ObjectFlags.Anonymous | ts.ObjectFlags.Interface | ts.ObjectFlags.Mapped)) { + definition.type = "object"; + definition.additionalProperties = false; + definition.patternProperties = (_a2 = {}, _a2[NUMERIC_INDEX_PATTERN] = this.getTypeDefinition(arrayType2), _a2); + } else { + definition.type = "array"; + if (!definition.items) { + definition.items = this.getTypeDefinition(arrayType2); + } + } + } else { + var error2 = new TypeError("Unsupported type: " + propertyTypeString); + error2.type = propertyType; + throw error2; + } + } + } + return definition; + }; + JsonSchemaGenerator2.prototype.getReferencedTypeSymbol = function(prop) { + var decl = prop.getDeclarations(); + if (decl === null || decl === void 0 ? void 0 : decl.length) { + var type3 = decl[0].type; + if (type3 && type3.kind & ts.SyntaxKind.TypeReference && type3.typeName) { + var symbol = this.tc.getSymbolAtLocation(type3.typeName); + if (symbol && symbol.flags & ts.SymbolFlags.Alias) { + return this.tc.getAliasedSymbol(symbol); + } + return symbol; + } + } + return void 0; + }; + JsonSchemaGenerator2.prototype.getDefinitionForProperty = function(prop, node) { + if (prop.flags & ts.SymbolFlags.Method) { + return null; + } + var propertyName = prop.getName(); + var propertyType = this.tc.getTypeOfSymbolAtLocation(prop, node); + var reffedType = this.getReferencedTypeSymbol(prop); + var definition = this.getTypeDefinition(propertyType, void 0, void 0, prop, reffedType); + if (this.args.titles) { + definition.title = propertyName; + } + if (definition.hasOwnProperty("ignore")) { + return null; + } + var valDecl = prop.valueDeclaration; + if (valDecl === null || valDecl === void 0 ? void 0 : valDecl.initializer) { + var initial2 = valDecl.initializer; + while (ts.isTypeAssertionExpression(initial2)) { + initial2 = initial2.expression; + } + if (initial2.expression) { + console.warn("initializer is expression for property " + propertyName); + } else if (initial2.kind && initial2.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral) { + definition.default = initial2.getText(); + } else { + try { + var sandbox = { sandboxvar: null }; + vm.runInNewContext("sandboxvar=" + initial2.getText(), sandbox); + var val = sandbox.sandboxvar; + if (val === null || typeof val === "string" || typeof val === "number" || typeof val === "boolean" || Object.prototype.toString.call(val) === "[object Array]") { + definition.default = val; + } else if (val) { + console.warn("unknown initializer for property " + propertyName + ": " + val); + } + } catch (e10) { + console.warn("exception evaluating initializer for property " + propertyName); + } + } + } + return definition; + }; + JsonSchemaGenerator2.prototype.getEnumDefinition = function(clazzType, definition) { + var _this = this; + var node = clazzType.getSymbol().getDeclarations()[0]; + var fullName = this.tc.typeToString(clazzType, void 0, ts.TypeFormatFlags.UseFullyQualifiedType); + var members = node.kind === ts.SyntaxKind.EnumDeclaration ? node.members : ts.factory.createNodeArray([node]); + var enumValues = []; + var enumTypes = []; + var addType = function(type3) { + if (enumTypes.indexOf(type3) === -1) { + enumTypes.push(type3); + } + }; + members.forEach(function(member) { + var caseLabel = member.name.text; + var constantValue = _this.tc.getConstantValue(member); + if (constantValue !== void 0) { + enumValues.push(constantValue); + addType(typeof constantValue); + } else { + var initial2 = member.initializer; + if (initial2) { + if (initial2.expression) { + var exp = initial2.expression; + var text = exp.text; + if (text) { + enumValues.push(text); + addType("string"); + } else if (exp.kind === ts.SyntaxKind.TrueKeyword || exp.kind === ts.SyntaxKind.FalseKeyword) { + enumValues.push(exp.kind === ts.SyntaxKind.TrueKeyword); + addType("boolean"); + } else { + console.warn("initializer is expression for enum: " + fullName + "." + caseLabel); + } + } else if (initial2.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral) { + enumValues.push(initial2.getText()); + addType("string"); + } else if (initial2.kind === ts.SyntaxKind.NullKeyword) { + enumValues.push(null); + addType("null"); + } + } + } + }); + if (enumTypes.length) { + definition.type = enumTypes.length === 1 ? enumTypes[0] : enumTypes; + } + if (enumValues.length > 0) { + if (enumValues.length > 1) { + definition.enum = enumValues.sort(); + } else { + definition.const = enumValues[0]; + } + } + return definition; + }; + JsonSchemaGenerator2.prototype.getUnionDefinition = function(unionType2, unionModifier, definition) { + var enumValues = []; + var simpleTypes = []; + var schemas5 = []; + var pushSimpleType = function(type3) { + if (simpleTypes.indexOf(type3) === -1) { + simpleTypes.push(type3); + } + }; + var pushEnumValue = function(val) { + if (enumValues.indexOf(val) === -1) { + enumValues.push(val); + } + }; + for (var _i = 0, _a2 = unionType2.types; _i < _a2.length; _i++) { + var valueType = _a2[_i]; + var value2 = extractLiteralValue(valueType); + if (value2 !== void 0) { + pushEnumValue(value2); + } else { + var symbol = valueType.aliasSymbol; + var def = this.getTypeDefinition(valueType, void 0, void 0, symbol, symbol, void 0, void 0, true); + if (def.type === "undefined") { + continue; + } + var keys2 = Object.keys(def); + if (keys2.length === 1 && keys2[0] === "type") { + if (typeof def.type !== "string") { + console.error("Expected only a simple type."); + } else { + pushSimpleType(def.type); + } + } else { + schemas5.push(def); + } + } + } + if (enumValues.length > 0) { + var isOnlyBooleans = enumValues.length === 2 && typeof enumValues[0] === "boolean" && typeof enumValues[1] === "boolean" && enumValues[0] !== enumValues[1]; + if (isOnlyBooleans) { + pushSimpleType("boolean"); + } else { + var enumSchema = enumValues.length > 1 ? { enum: enumValues.sort() } : { const: enumValues[0] }; + if (enumValues.every(function(x7) { + return typeof x7 === "string"; + })) { + enumSchema.type = "string"; + } else if (enumValues.every(function(x7) { + return typeof x7 === "number"; + })) { + enumSchema.type = "number"; + } else if (enumValues.every(function(x7) { + return typeof x7 === "boolean"; + })) { + enumSchema.type = "boolean"; + } + schemas5.push(enumSchema); + } + } + if (simpleTypes.length > 0) { + schemas5.push({ type: simpleTypes.length === 1 ? simpleTypes[0] : simpleTypes }); + } + if (schemas5.length === 1) { + for (var k6 in schemas5[0]) { + if (schemas5[0].hasOwnProperty(k6) && !definition.hasOwnProperty(k6)) { + definition[k6] = schemas5[0][k6]; + } + } + } else { + definition[unionModifier] = schemas5; + } + return definition; + }; + JsonSchemaGenerator2.prototype.getIntersectionDefinition = function(intersectionType2, definition) { + var simpleTypes = []; + var schemas5 = []; + var pushSimpleType = function(type3) { + if (simpleTypes.indexOf(type3) === -1) { + simpleTypes.push(type3); + } + }; + for (var _i = 0, _a2 = intersectionType2.types; _i < _a2.length; _i++) { + var intersectionMember = _a2[_i]; + var def = this.getTypeDefinition(intersectionMember); + var keys2 = Object.keys(def); + if (keys2.length === 1 && keys2[0] === "type") { + if (typeof def.type !== "string") { + console.error("Expected only a simple type."); + } else { + pushSimpleType(def.type); + } + } else { + schemas5.push(def); + } + } + if (simpleTypes.length > 0) { + schemas5.push({ type: simpleTypes.length === 1 ? simpleTypes[0] : simpleTypes }); + } + if (schemas5.length === 1) { + for (var k6 in schemas5[0]) { + if (schemas5[0].hasOwnProperty(k6)) { + definition[k6] = schemas5[0][k6]; + } + } + } else { + definition.allOf = schemas5; + } + return definition; + }; + JsonSchemaGenerator2.prototype.getClassDefinition = function(clazzType, definition) { + var _this = this; + var _a2, _b; + var node = clazzType.getSymbol().getDeclarations()[0]; + if (!node) { + definition.type = "object"; + return definition; + } + if (this.args.typeOfKeyword && node.kind === ts.SyntaxKind.FunctionType) { + definition.typeof = "function"; + return definition; + } + var clazz = node; + var props = this.tc.getPropertiesOfType(clazzType).filter(function(prop) { + var propertyFlagType = _this.tc.getTypeOfSymbolAtLocation(prop, node).getFlags(); + if (ts.TypeFlags.Never === propertyFlagType || ts.TypeFlags.Undefined === propertyFlagType) { + return false; + } + if (!_this.args.excludePrivate) { + return true; + } + var decls = prop.declarations; + return !(decls && decls.filter(function(decl) { + var mods = decl.modifiers; + return mods && mods.filter(function(mod2) { + return mod2.kind === ts.SyntaxKind.PrivateKeyword; + }).length > 0; + }).length > 0); + }); + var fullName = this.tc.typeToString(clazzType, void 0, ts.TypeFormatFlags.UseFullyQualifiedType); + var modifierFlags = ts.getCombinedModifierFlags(node); + if (modifierFlags & ts.ModifierFlags.Abstract && this.inheritingTypes[fullName]) { + var oneOf = this.inheritingTypes[fullName].map(function(typename) { + return _this.getTypeDefinition(_this.allSymbols[typename]); + }); + definition.oneOf = oneOf; + } else { + if (clazz.members) { + var indexSignatures = clazz.members == null ? [] : clazz.members.filter(function(x7) { + return x7.kind === ts.SyntaxKind.IndexSignature; + }); + if (indexSignatures.length === 1) { + var indexSignature = indexSignatures[0]; + if (indexSignature.parameters.length !== 1) { + throw new Error("Not supported: IndexSignatureDeclaration parameters.length != 1"); + } + var indexSymbol = indexSignature.parameters[0].symbol; + var indexType = this.tc.getTypeOfSymbolAtLocation(indexSymbol, node); + var isStringIndexed = indexType.flags === ts.TypeFlags.String; + if (indexType.flags !== ts.TypeFlags.Number && !isStringIndexed) { + throw new Error("Not supported: IndexSignatureDeclaration with index symbol other than a number or a string"); + } + var typ = this.tc.getTypeAtLocation(indexSignature.type); + var def = void 0; + if (typ.flags & ts.TypeFlags.IndexedAccess) { + var targetName = ts.escapeLeadingUnderscores((_b = (_a2 = clazzType.mapper) === null || _a2 === void 0 ? void 0 : _a2.target) === null || _b === void 0 ? void 0 : _b.value); + var indexedAccessType = typ; + var symbols = indexedAccessType.objectType.members; + var targetSymbol = symbols === null || symbols === void 0 ? void 0 : symbols.get(targetName); + if (targetSymbol) { + var targetNode = targetSymbol.getDeclarations()[0]; + var targetDef = this.getDefinitionForProperty(targetSymbol, targetNode); + if (targetDef) { + def = targetDef; + } + } + } + if (!def) { + def = this.getTypeDefinition(typ, void 0, "anyOf"); + } + if (isStringIndexed) { + definition.type = "object"; + definition.additionalProperties = def; + } else { + definition.type = "array"; + if (!definition.items) { + definition.items = def; + } + } + } + } + var propertyDefinitions = props.reduce(function(all, prop) { + var propertyName = prop.getName(); + var propDef = _this.getDefinitionForProperty(prop, node); + if (propDef != null) { + all[propertyName] = propDef; + } + return all; + }, {}); + if (definition.type === void 0) { + definition.type = "object"; + } + if (definition.type === "object" && Object.keys(propertyDefinitions).length > 0) { + definition.properties = propertyDefinitions; + } + if (this.args.defaultProps) { + definition.defaultProperties = []; + } + if (this.args.noExtraProps && definition.additionalProperties === void 0) { + definition.additionalProperties = false; + } + if (this.args.propOrder) { + var propertyOrder = props.reduce(function(order, prop) { + order.push(prop.getName()); + return order; + }, []); + definition.propertyOrder = propertyOrder; + } + if (this.args.required) { + var requiredProps = props.reduce(function(required, prop) { + var _a3, _b2, _c; + var def2 = {}; + _this.parseCommentsIntoDefinition(prop, def2, {}); + var allUnionTypesFlags = ((_c = (_b2 = (_a3 = prop.type) === null || _a3 === void 0 ? void 0 : _a3.types) === null || _b2 === void 0 ? void 0 : _b2.map) === null || _c === void 0 ? void 0 : _c.call(_b2, function(t8) { + return t8.flags; + })) || []; + if (!(prop.flags & ts.SymbolFlags.Optional) && !(prop.flags & ts.SymbolFlags.Method) && !allUnionTypesFlags.includes(ts.TypeFlags.Undefined) && !allUnionTypesFlags.includes(ts.TypeFlags.Void) && !def2.hasOwnProperty("ignore")) { + required.push(prop.getName()); + } + return required; + }, []); + if (requiredProps.length > 0) { + definition.required = unique(requiredProps).sort(); + } + } + } + return definition; + }; + JsonSchemaGenerator2.prototype.getTypeName = function(typ) { + var id = typ.id; + if (this.typeNamesById[id]) { + return this.typeNamesById[id]; + } + return this.makeTypeNameUnique(typ, this.tc.typeToString(typ, void 0, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.UseFullyQualifiedType).replace(REGEX_FILE_NAME_OR_SPACE, "")); + }; + JsonSchemaGenerator2.prototype.makeTypeNameUnique = function(typ, baseName) { + var id = typ.id; + var name2 = baseName; + for (var i7 = 1; this.typeIdsByName[name2] !== void 0 && this.typeIdsByName[name2] !== id; ++i7) { + name2 = baseName + "_" + i7; + } + this.typeNamesById[id] = name2; + this.typeIdsByName[name2] = id; + return name2; + }; + JsonSchemaGenerator2.prototype.getTypeDefinition = function(typ, asRef, unionModifier, prop, reffedType, pairedSymbol, forceNotRef, ignoreUndefined) { + var _a2; + if (asRef === void 0) { + asRef = this.args.ref; + } + if (unionModifier === void 0) { + unionModifier = "anyOf"; + } + if (forceNotRef === void 0) { + forceNotRef = false; + } + if (ignoreUndefined === void 0) { + ignoreUndefined = false; + } + var definition = {}; + while (typ.aliasSymbol && (typ.aliasSymbol.escapedName === "Readonly" || typ.aliasSymbol.escapedName === "Mutable") && typ.aliasTypeArguments && typ.aliasTypeArguments[0]) { + typ = typ.aliasTypeArguments[0]; + reffedType = void 0; + } + if (this.args.typeOfKeyword && typ.flags & ts.TypeFlags.Object && typ.objectFlags & ts.ObjectFlags.Anonymous) { + definition.typeof = "function"; + return definition; + } + var returnedDefinition = definition; + if (prop) { + var defs = {}; + var others = {}; + this.parseCommentsIntoDefinition(prop, defs, others); + if (defs.hasOwnProperty("ignore") || defs.hasOwnProperty("type")) { + return defs; + } + } + var symbol = typ.getSymbol(); + var isRawType = !symbol || this.tc.getFullyQualifiedName(symbol) !== "Window" && (this.tc.getFullyQualifiedName(symbol) === "Date" || symbol.name === "integer" || this.tc.getIndexInfoOfType(typ, ts.IndexKind.Number) !== void 0); + if (isRawType && ((_a2 = typ.aliasSymbol) === null || _a2 === void 0 ? void 0 : _a2.escapedName) && typ.types) { + isRawType = false; + } + var isStringEnum = false; + if (typ.flags & ts.TypeFlags.Union) { + var unionType2 = typ; + isStringEnum = unionType2.types.every(function(propType) { + return (propType.getFlags() & ts.TypeFlags.StringLiteral) !== 0; + }); + } + var asTypeAliasRef = asRef && reffedType && (this.args.aliasRef || isStringEnum); + if (!asTypeAliasRef) { + if (isRawType || typ.getFlags() & ts.TypeFlags.Object && typ.objectFlags & ts.ObjectFlags.Anonymous) { + asRef = false; + } + } + var fullTypeName = ""; + if (asTypeAliasRef) { + var typeName = this.tc.getFullyQualifiedName(reffedType.getFlags() & ts.SymbolFlags.Alias ? this.tc.getAliasedSymbol(reffedType) : reffedType).replace(REGEX_FILE_NAME_OR_SPACE, ""); + if (this.args.uniqueNames && reffedType) { + var sourceFile = getSourceFile(reffedType); + var relativePath2 = path2.relative(process.cwd(), sourceFile.fileName); + fullTypeName = "".concat(typeName, ".").concat(generateHashOfNode(getCanonicalDeclaration(reffedType), relativePath2)); + } else { + fullTypeName = this.makeTypeNameUnique(typ, typeName); + } + } else { + if (this.args.uniqueNames && typ.symbol) { + var sym = typ.symbol; + var sourceFile = getSourceFile(sym); + var relativePath2 = path2.relative(process.cwd(), sourceFile.fileName); + fullTypeName = "".concat(this.getTypeName(typ), ".").concat(generateHashOfNode(getCanonicalDeclaration(sym), relativePath2)); + } else if (reffedType && this.schemaOverrides.has(reffedType.escapedName)) { + fullTypeName = reffedType.escapedName; + } else { + fullTypeName = this.getTypeName(typ); + } + } + if (!isRawType || !!typ.aliasSymbol) { + if (this.recursiveTypeRef.has(fullTypeName) && !forceNotRef) { + asRef = true; + } else { + this.recursiveTypeRef.set(fullTypeName, definition); + } + } + if (asRef) { + returnedDefinition = { + $ref: "".concat(this.args.id, "#/definitions/") + fullTypeName + }; + } + var otherAnnotations = {}; + this.parseCommentsIntoDefinition(reffedType, definition, otherAnnotations); + this.parseCommentsIntoDefinition(symbol, definition, otherAnnotations); + this.parseCommentsIntoDefinition(typ.aliasSymbol, definition, otherAnnotations); + if (prop) { + this.parseCommentsIntoDefinition(prop, returnedDefinition, otherAnnotations); + } + if (pairedSymbol && symbol && this.isFromDefaultLib(symbol)) { + this.parseCommentsIntoDefinition(pairedSymbol, definition, otherAnnotations); + } + if (!asRef || !this.reffedDefinitions[fullTypeName]) { + if (asRef) { + var reffedDefinition = void 0; + if (asTypeAliasRef && reffedType && typ.symbol !== reffedType && symbol) { + reffedDefinition = this.getTypeDefinition(typ, true, void 0, symbol, symbol); + } else { + reffedDefinition = definition; + } + this.reffedDefinitions[fullTypeName] = reffedDefinition; + if (this.args.titles && fullTypeName) { + definition.title = fullTypeName; + } + } + var node = (symbol === null || symbol === void 0 ? void 0 : symbol.getDeclarations()) !== void 0 ? symbol.getDeclarations()[0] : null; + if (definition.type === void 0) { + if (typ.flags & ts.TypeFlags.Union) { + this.getUnionDefinition(typ, unionModifier, definition); + } else if (typ.flags & ts.TypeFlags.Intersection) { + if (this.args.noExtraProps) { + if (this.args.noExtraProps) { + definition.additionalProperties = false; + } + var types3 = typ.types; + for (var _i = 0, types_1 = types3; _i < types_1.length; _i++) { + var member = types_1[_i]; + var other = this.getTypeDefinition(member, false, void 0, void 0, void 0, void 0, true); + definition.type = other.type; + definition.properties = __assign16(__assign16({}, definition.properties), other.properties); + if (Object.keys(other.default || {}).length > 0) { + definition.default = extend3(definition.default || {}, other.default); + } + if (other.required) { + definition.required = unique((definition.required || []).concat(other.required)).sort(); + } + } + } else { + this.getIntersectionDefinition(typ, definition); + } + } else if (isRawType) { + if (pairedSymbol) { + this.parseCommentsIntoDefinition(pairedSymbol, definition, {}); + } + this.getDefinitionForRootType(typ, reffedType, definition, void 0, ignoreUndefined); + } else if (node && (node.kind === ts.SyntaxKind.EnumDeclaration || node.kind === ts.SyntaxKind.EnumMember)) { + this.getEnumDefinition(typ, definition); + } else if (symbol && symbol.flags & ts.SymbolFlags.TypeLiteral && symbol.members.size === 0 && !(node && node.kind === ts.SyntaxKind.MappedType)) { + definition.type = "object"; + definition.properties = {}; + } else { + this.getClassDefinition(typ, definition); + } + } + } + if (this.recursiveTypeRef.get(fullTypeName) === definition) { + this.recursiveTypeRef.delete(fullTypeName); + if (this.reffedDefinitions[fullTypeName]) { + var annotations = Object.entries(returnedDefinition).reduce(function(acc, _a3) { + var key = _a3[0], value2 = _a3[1]; + if (annotationKeywords[key] && typeof value2 !== void 0) { + acc[key] = value2; + } + return acc; + }, {}); + returnedDefinition = __assign16({ $ref: "".concat(this.args.id, "#/definitions/") + fullTypeName }, annotations); + } + } + if (otherAnnotations["nullable"]) { + makeNullable(returnedDefinition); + } + return returnedDefinition; + }; + JsonSchemaGenerator2.prototype.setSchemaOverride = function(symbolName, schema8) { + this.schemaOverrides.set(symbolName, schema8); + }; + JsonSchemaGenerator2.prototype.getSchemaForSymbol = function(symbolName, includeReffedDefinitions) { + if (includeReffedDefinitions === void 0) { + includeReffedDefinitions = true; + } + if (!this.allSymbols[symbolName]) { + throw new Error("type ".concat(symbolName, " not found")); + } + this.resetSchemaSpecificProperties(); + var def = this.getTypeDefinition(this.allSymbols[symbolName], this.args.topRef, void 0, void 0, void 0, this.userSymbols[symbolName] || void 0); + if (this.args.ref && includeReffedDefinitions && Object.keys(this.reffedDefinitions).length > 0) { + def.definitions = this.reffedDefinitions; + } + def["$schema"] = "http://json-schema.org/draft-07/schema#"; + var id = this.args.id; + if (id) { + def["$id"] = this.args.id; + } + return def; + }; + JsonSchemaGenerator2.prototype.getSchemaForSymbols = function(symbolNames, includeReffedDefinitions) { + if (includeReffedDefinitions === void 0) { + includeReffedDefinitions = true; + } + var root2 = { + $schema: "http://json-schema.org/draft-07/schema#", + definitions: {} + }; + this.resetSchemaSpecificProperties(); + var id = this.args.id; + if (id) { + root2["$id"] = id; + } + for (var _i = 0, symbolNames_1 = symbolNames; _i < symbolNames_1.length; _i++) { + var symbolName = symbolNames_1[_i]; + root2.definitions[symbolName] = this.getTypeDefinition(this.allSymbols[symbolName], this.args.topRef, void 0, void 0, void 0, this.userSymbols[symbolName]); + } + if (this.args.ref && includeReffedDefinitions && Object.keys(this.reffedDefinitions).length > 0) { + root2.definitions = __assign16(__assign16({}, root2.definitions), this.reffedDefinitions); + } + return root2; + }; + JsonSchemaGenerator2.prototype.getSymbols = function(name2) { + if (name2 === void 0) { + return this.symbols; + } + return this.symbols.filter(function(symbol) { + return symbol.typeName === name2; + }); + }; + JsonSchemaGenerator2.prototype.getUserSymbols = function() { + return Object.keys(this.userSymbols); + }; + JsonSchemaGenerator2.prototype.getMainFileSymbols = function(program, onlyIncludeFiles) { + var _this = this; + function includeFile(file) { + if (onlyIncludeFiles === void 0) { + return !file.isDeclarationFile; + } + return onlyIncludeFiles.filter(function(f8) { + return (0, path_equal_1.pathEqual)(f8, file.fileName); + }).length > 0; + } + var files = program.getSourceFiles().filter(includeFile); + if (files.length) { + return Object.keys(this.userSymbols).filter(function(key) { + var symbol = _this.userSymbols[key]; + if (!symbol || !symbol.declarations || !symbol.declarations.length) { + return false; + } + var node = symbol.declarations[0]; + while (node === null || node === void 0 ? void 0 : node.parent) { + node = node.parent; + } + return files.indexOf(node.getSourceFile()) > -1; + }); + } + return []; + }; + return JsonSchemaGenerator2; + }(); + exports28.JsonSchemaGenerator = JsonSchemaGenerator; + function getProgramFromFiles2(files, jsonCompilerOptions, basePath) { + if (jsonCompilerOptions === void 0) { + jsonCompilerOptions = {}; + } + if (basePath === void 0) { + basePath = "./"; + } + var compilerOptions = ts.convertCompilerOptionsFromJson(jsonCompilerOptions, basePath).options; + var options = { + noEmit: true, + emitDecoratorMetadata: true, + experimentalDecorators: true, + target: ts.ScriptTarget.ES5, + module: ts.ModuleKind.CommonJS, + allowUnusedLabels: true + }; + for (var k6 in compilerOptions) { + if (compilerOptions.hasOwnProperty(k6)) { + options[k6] = compilerOptions[k6]; + } + } + return ts.createProgram(files, options); + } + exports28.getProgramFromFiles = getProgramFromFiles2; + function generateHashOfNode(node, relativePath2) { + return (0, crypto_1.createHash)("md5").update(relativePath2).update(node.pos.toString()).digest("hex").substring(0, 8); + } + function buildGenerator2(program, args, onlyIncludeFiles) { + if (args === void 0) { + args = {}; + } + function isUserFile(file) { + if (onlyIncludeFiles === void 0) { + return !file.hasNoDefaultLib; + } + return onlyIncludeFiles.indexOf(file.fileName) >= 0; + } + var settings = getDefaultArgs(); + for (var pref in args) { + if (args.hasOwnProperty(pref)) { + settings[pref] = args[pref]; + } + } + if (args.tsNodeRegister) { + require_register(); + } + var diagnostics = []; + if (!args.ignoreErrors) { + diagnostics = ts.getPreEmitDiagnostics(program); + } + if (diagnostics.length === 0) { + var typeChecker_1 = program.getTypeChecker(); + var symbols_1 = []; + var allSymbols_1 = {}; + var userSymbols_1 = {}; + var inheritingTypes_1 = {}; + var workingDir_1 = program.getCurrentDirectory(); + program.getSourceFiles().forEach(function(sourceFile, _sourceFileIdx) { + var relativePath2 = path2.relative(workingDir_1, sourceFile.fileName); + function inspect2(node, tc) { + if (node.kind === ts.SyntaxKind.ClassDeclaration || node.kind === ts.SyntaxKind.InterfaceDeclaration || node.kind === ts.SyntaxKind.EnumDeclaration || node.kind === ts.SyntaxKind.TypeAliasDeclaration) { + var symbol = node.symbol; + var nodeType = tc.getTypeAtLocation(node); + var fullyQualifiedName = tc.getFullyQualifiedName(symbol); + var typeName = fullyQualifiedName.replace(/".*"\./, ""); + var name_1 = !args.uniqueNames ? typeName : "".concat(typeName, ".").concat(generateHashOfNode(node, relativePath2)); + symbols_1.push({ name: name_1, typeName, fullyQualifiedName, symbol }); + if (!userSymbols_1[name_1]) { + allSymbols_1[name_1] = nodeType; + } + if (isUserFile(sourceFile)) { + userSymbols_1[name_1] = symbol; + } + var baseTypes = nodeType.getBaseTypes() || []; + baseTypes.forEach(function(baseType) { + var baseName = tc.typeToString(baseType, void 0, ts.TypeFormatFlags.UseFullyQualifiedType); + if (!inheritingTypes_1[baseName]) { + inheritingTypes_1[baseName] = []; + } + inheritingTypes_1[baseName].push(name_1); + }); + } else { + ts.forEachChild(node, function(n7) { + return inspect2(n7, tc); + }); + } + } + inspect2(sourceFile, typeChecker_1); + }); + return new JsonSchemaGenerator(symbols_1, allSymbols_1, userSymbols_1, inheritingTypes_1, typeChecker_1, settings); + } else { + diagnostics.forEach(function(diagnostic) { + var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"); + if (diagnostic.file) { + var _a2 = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start), line = _a2.line, character = _a2.character; + console.error("".concat(diagnostic.file.fileName, " (").concat(line + 1, ",").concat(character + 1, "): ").concat(message)); + } else { + console.error(message); + } + }); + return null; + } + } + exports28.buildGenerator = buildGenerator2; + function generateSchema2(program, fullTypeName, args, onlyIncludeFiles, externalGenerator) { + if (args === void 0) { + args = {}; + } + var generator = externalGenerator !== null && externalGenerator !== void 0 ? externalGenerator : buildGenerator2(program, args, onlyIncludeFiles); + if (generator === null) { + return null; + } + if (fullTypeName === "*") { + return generator.getSchemaForSymbols(generator.getMainFileSymbols(program, onlyIncludeFiles)); + } else if (args.uniqueNames) { + var matchingSymbols = generator.getSymbols(fullTypeName); + if (matchingSymbols.length === 1) { + return generator.getSchemaForSymbol(matchingSymbols[0].name); + } else { + throw new Error("".concat(matchingSymbols.length, ' definitions found for requested type "').concat(fullTypeName, '".')); + } + } else { + return generator.getSchemaForSymbol(fullTypeName); + } + } + exports28.generateSchema = generateSchema2; + function programFromConfig(configFileName, onlyIncludeFiles) { + var result2 = ts.parseConfigFileTextToJson(configFileName, ts.sys.readFile(configFileName)); + var configObject = result2.config; + var configParseResult = ts.parseJsonConfigFileContent(configObject, ts.sys, path2.dirname(configFileName), {}, path2.basename(configFileName)); + var options = configParseResult.options; + options.noEmit = true; + delete options.out; + delete options.outDir; + delete options.outFile; + delete options.declaration; + delete options.declarationDir; + delete options.declarationMap; + var program = ts.createProgram({ + rootNames: onlyIncludeFiles || configParseResult.fileNames, + options, + projectReferences: configParseResult.projectReferences + }); + return program; + } + exports28.programFromConfig = programFromConfig; + function normalizeFileName(fn) { + while (fn.substr(0, 2) === "./") { + fn = fn.substr(2); + } + return fn; + } + function exec(filePattern, fullTypeName, args) { + if (args === void 0) { + args = getDefaultArgs(); + } + return __awaiter60(this, void 0, void 0, function() { + var program, onlyIncludeFiles, globs, definition, json2, hasBeenBuffered; + var _a2; + return __generator10(this, function(_b) { + onlyIncludeFiles = void 0; + if (REGEX_TSCONFIG_NAME.test(path2.basename(filePattern))) { + if (args.include && args.include.length > 0) { + globs = args.include.map(function(f8) { + return glob.sync(f8); + }); + onlyIncludeFiles = (_a2 = []).concat.apply(_a2, globs).map(normalizeFileName); + } + program = programFromConfig(filePattern, onlyIncludeFiles); + } else { + onlyIncludeFiles = glob.sync(filePattern); + program = getProgramFromFiles2(onlyIncludeFiles, { + strictNullChecks: args.strictNullChecks, + esModuleInterop: args.esModuleInterop, + skipLibCheck: args.skipLibCheck + }); + onlyIncludeFiles = onlyIncludeFiles.map(normalizeFileName); + } + definition = generateSchema2(program, fullTypeName, args, onlyIncludeFiles); + if (definition === null) { + throw new Error("No output definition. Probably caused by errors prior to this?"); + } + json2 = (0, safe_stable_stringify_1.stringify)(definition, null, 4) + "\n\n"; + if (args.out) { + return [2, new Promise(function(resolve3, reject2) { + var fs = (init_fs(), __toCommonJS(fs_exports)); + fs.mkdir(path2.dirname(args.out), { recursive: true }, function(mkErr) { + if (mkErr) { + return reject2(new Error("Unable to create parent directory for output file: " + mkErr.message)); + } + fs.writeFile(args.out, json2, function(wrErr) { + if (wrErr) { + return reject2(new Error("Unable to write output file: " + wrErr.message)); + } + resolve3(); + }); + }); + })]; + } else { + hasBeenBuffered = process.stdout.write(json2); + if (hasBeenBuffered) { + return [2, new Promise(function(resolve3) { + return process.stdout.on("drain", function() { + return resolve3(); + }); + })]; + } + } + return [2]; + }); + }); + } + exports28.exec = exec; + } +}); + +// node_modules/resolve-from/index.js +var require_resolve_from = __commonJS({ + "node_modules/resolve-from/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var Module = (init_module(), __toCommonJS(module_exports)); + var fs = (init_fs(), __toCommonJS(fs_exports)); + var resolveFrom = (fromDir, moduleId, silent) => { + if (typeof fromDir !== "string") { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``); + } + if (typeof moduleId !== "string") { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + try { + fromDir = fs.realpathSync(fromDir); + } catch (err) { + if (err.code === "ENOENT") { + fromDir = path2.resolve(fromDir); + } else if (silent) { + return null; + } else { + throw err; + } + } + const fromFile2 = path2.join(fromDir, "noop.js"); + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile2, + filename: fromFile2, + paths: Module._nodeModulePaths(fromDir) + }); + if (silent) { + try { + return resolveFileName(); + } catch (err) { + return null; + } + } + return resolveFileName(); + }; + module5.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId); + module5.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true); + } +}); + +// node_modules/callsites/index.js +var require_callsites = __commonJS({ + "node_modules/callsites/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var callsites = () => { + const _prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_6, stack2) => stack2; + const stack = new Error().stack.slice(1); + Error.prepareStackTrace = _prepareStackTrace; + return stack; + }; + module5.exports = callsites; + module5.exports.default = callsites; + } +}); + +// node_modules/parent-module/index.js +var require_parent_module = __commonJS({ + "node_modules/parent-module/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var callsites = require_callsites(); + module5.exports = (filepath) => { + const stacks = callsites(); + if (!filepath) { + return stacks[2].getFileName(); + } + let seenVal = false; + stacks.shift(); + for (const stack of stacks) { + const parentFilepath = stack.getFileName(); + if (typeof parentFilepath !== "string") { + continue; + } + if (parentFilepath === filepath) { + seenVal = true; + continue; + } + if (parentFilepath === "module.js") { + continue; + } + if (seenVal && parentFilepath !== filepath) { + return parentFilepath; + } + } + }; + } +}); + +// node_modules/import-fresh/index.js +var require_import_fresh = __commonJS({ + "node_modules/import-fresh/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var resolveFrom = require_resolve_from(); + var parentModule = require_parent_module(); + module5.exports = (moduleId) => { + if (typeof moduleId !== "string") { + throw new TypeError("Expected a string"); + } + const parentPath = parentModule(__filename); + const cwd3 = parentPath ? path2.dirname(parentPath) : __dirname; + const filePath = resolveFrom(cwd3, moduleId); + const oldModule = __require.cache[filePath]; + if (oldModule && oldModule.parent) { + let i7 = oldModule.parent.children.length; + while (i7--) { + if (oldModule.parent.children[i7].id === filePath) { + oldModule.parent.children.splice(i7, 1); + } + } + } + delete __require.cache[filePath]; + const parent2 = __require.cache[parentPath]; + return parent2 === void 0 ? __require(filePath) : parent2.require(filePath); + }; + } +}); + +// node_modules/is-arrayish/index.js +var require_is_arrayish = __commonJS({ + "node_modules/is-arrayish/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = function isArrayish(obj) { + if (!obj) { + return false; + } + return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && obj.splice instanceof Function; + }; + } +}); + +// node_modules/error-ex/index.js +var require_error_ex = __commonJS({ + "node_modules/error-ex/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var util2 = (init_util2(), __toCommonJS(util_exports)); + var isArrayish = require_is_arrayish(); + var errorEx = function errorEx2(name2, properties) { + if (!name2 || name2.constructor !== String) { + properties = name2 || {}; + name2 = Error.name; + } + var errorExError = function ErrorEXError(message) { + if (!this) { + return new ErrorEXError(message); + } + message = message instanceof Error ? message.message : message || this.message; + Error.call(this, message); + Error.captureStackTrace(this, errorExError); + this.name = name2; + Object.defineProperty(this, "message", { + configurable: true, + enumerable: false, + get: function() { + var newMessage = message.split(/\r?\n/g); + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } + var modifier = properties[key]; + if ("message" in modifier) { + newMessage = modifier.message(this[key], newMessage) || newMessage; + if (!isArrayish(newMessage)) { + newMessage = [newMessage]; + } + } + } + return newMessage.join("\n"); + }, + set: function(v8) { + message = v8; + } + }); + var overwrittenStack = null; + var stackDescriptor = Object.getOwnPropertyDescriptor(this, "stack"); + var stackGetter = stackDescriptor.get; + var stackValue = stackDescriptor.value; + delete stackDescriptor.value; + delete stackDescriptor.writable; + stackDescriptor.set = function(newstack) { + overwrittenStack = newstack; + }; + stackDescriptor.get = function() { + var stack = (overwrittenStack || (stackGetter ? stackGetter.call(this) : stackValue)).split(/\r?\n+/g); + if (!overwrittenStack) { + stack[0] = this.name + ": " + this.message; + } + var lineCount = 1; + for (var key in properties) { + if (!properties.hasOwnProperty(key)) { + continue; + } + var modifier = properties[key]; + if ("line" in modifier) { + var line = modifier.line(this[key]); + if (line) { + stack.splice(lineCount++, 0, " " + line); + } + } + if ("stack" in modifier) { + modifier.stack(this[key], stack); + } + } + return stack.join("\n"); + }; + Object.defineProperty(this, "stack", stackDescriptor); + }; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(errorExError.prototype, Error.prototype); + Object.setPrototypeOf(errorExError, Error); + } else { + util2.inherits(errorExError, Error); + } + return errorExError; + }; + errorEx.append = function(str2, def) { + return { + message: function(v8, message) { + v8 = v8 || def; + if (v8) { + message[0] += " " + str2.replace("%s", v8.toString()); + } + return message; + } + }; + }; + errorEx.line = function(str2, def) { + return { + line: function(v8) { + v8 = v8 || def; + if (v8) { + return str2.replace("%s", v8.toString()); + } + return null; + } + }; + }; + module5.exports = errorEx; + } +}); + +// node_modules/json-parse-even-better-errors/index.js +var require_json_parse_even_better_errors = __commonJS({ + "node_modules/json-parse-even-better-errors/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var hexify = (char) => { + const h8 = char.charCodeAt(0).toString(16).toUpperCase(); + return "0x" + (h8.length % 2 ? "0" : "") + h8; + }; + var parseError = (e10, txt, context2) => { + if (!txt) { + return { + message: e10.message + " while parsing empty string", + position: 0 + }; + } + const badToken = e10.message.match(/^Unexpected token (.) .*position\s+(\d+)/i); + const errIdx = badToken ? +badToken[2] : e10.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null; + const msg = badToken ? e10.message.replace(/^Unexpected token ./, `Unexpected token ${JSON.stringify(badToken[1])} (${hexify(badToken[1])})`) : e10.message; + if (errIdx !== null && errIdx !== void 0) { + const start = errIdx <= context2 ? 0 : errIdx - context2; + const end = errIdx + context2 >= txt.length ? txt.length : errIdx + context2; + const slice2 = (start === 0 ? "" : "...") + txt.slice(start, end) + (end === txt.length ? "" : "..."); + const near = txt === slice2 ? "" : "near "; + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice2)}`, + position: errIdx + }; + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context2 * 2)}'`, + position: 0 + }; + } + }; + var JSONParseError = class extends SyntaxError { + constructor(er, txt, context2, caller) { + context2 = context2 || 20; + const metadata = parseError(er, txt, context2); + super(metadata.message); + Object.assign(this, metadata); + this.code = "EJSONPARSE"; + this.systemError = er; + Error.captureStackTrace(this, caller || this.constructor); + } + get name() { + return this.constructor.name; + } + set name(n7) { + } + get [Symbol.toStringTag]() { + return this.constructor.name; + } + }; + var kIndent = Symbol.for("indent"); + var kNewline = Symbol.for("newline"); + var formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/; + var emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/; + var parseJson = (txt, reviver, context2) => { + const parseText = stripBOM(txt); + context2 = context2 || 20; + try { + const [, newline = "\n", indent = " "] = parseText.match(emptyRE) || parseText.match(formatRE) || [, "", ""]; + const result2 = JSON.parse(parseText, reviver); + if (result2 && typeof result2 === "object") { + result2[kNewline] = newline; + result2[kIndent] = indent; + } + return result2; + } catch (e10) { + if (typeof txt !== "string" && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0; + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? "an empty array" : String(txt)}` + ), { + code: "EJSONPARSE", + systemError: e10 + }); + } + throw new JSONParseError(e10, parseText, context2, parseJson); + } + }; + var stripBOM = (txt) => String(txt).replace(/^\uFEFF/, ""); + module5.exports = parseJson; + parseJson.JSONParseError = JSONParseError; + parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver); + } catch (e10) { + } + }; + } +}); + +// node_modules/lines-and-columns/build/index.js +var require_build = __commonJS({ + "node_modules/lines-and-columns/build/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + exports28.__esModule = true; + exports28.LinesAndColumns = void 0; + var LF = "\n"; + var CR = "\r"; + var LinesAndColumns = ( + /** @class */ + function() { + function LinesAndColumns2(string2) { + this.string = string2; + var offsets = [0]; + for (var offset = 0; offset < string2.length; ) { + switch (string2[offset]) { + case LF: + offset += LF.length; + offsets.push(offset); + break; + case CR: + offset += CR.length; + if (string2[offset] === LF) { + offset += LF.length; + } + offsets.push(offset); + break; + default: + offset++; + break; + } + } + this.offsets = offsets; + } + LinesAndColumns2.prototype.locationForIndex = function(index4) { + if (index4 < 0 || index4 > this.string.length) { + return null; + } + var line = 0; + var offsets = this.offsets; + while (offsets[line + 1] <= index4) { + line++; + } + var column = index4 - offsets[line]; + return { line, column }; + }; + LinesAndColumns2.prototype.indexForLocation = function(location2) { + var line = location2.line, column = location2.column; + if (line < 0 || line >= this.offsets.length) { + return null; + } + if (column < 0 || column > this.lengthOfLine(line)) { + return null; + } + return this.offsets[line] + column; + }; + LinesAndColumns2.prototype.lengthOfLine = function(line) { + var offset = this.offsets[line]; + var nextOffset = line === this.offsets.length - 1 ? this.string.length : this.offsets[line + 1]; + return nextOffset - offset; + }; + return LinesAndColumns2; + }() + ); + exports28.LinesAndColumns = LinesAndColumns; + exports28["default"] = LinesAndColumns; + } +}); + +// node_modules/parse-json/index.js +var require_parse_json = __commonJS({ + "node_modules/parse-json/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var errorEx = require_error_ex(); + var fallback = require_json_parse_even_better_errors(); + var { default: LinesAndColumns } = require_build(); + var { codeFrameColumns } = require_lib2(); + var JSONError = errorEx("JSONError", { + fileName: errorEx.append("in %s"), + codeFrame: errorEx.append("\n\n%s\n") + }); + var parseJson = (string2, reviver, filename) => { + if (typeof reviver === "string") { + filename = reviver; + reviver = null; + } + try { + try { + return JSON.parse(string2, reviver); + } catch (error2) { + fallback(string2, reviver); + throw error2; + } + } catch (error2) { + error2.message = error2.message.replace(/\n/g, ""); + const indexMatch = error2.message.match(/in JSON at position (\d+) while parsing/); + const jsonError2 = new JSONError(error2); + if (filename) { + jsonError2.fileName = filename; + } + if (indexMatch && indexMatch.length > 0) { + const lines = new LinesAndColumns(string2); + const index4 = Number(indexMatch[1]); + const location2 = lines.locationForIndex(index4); + const codeFrame = codeFrameColumns( + string2, + { start: { line: location2.line + 1, column: location2.column + 1 } }, + { highlightCode: true } + ); + jsonError2.codeFrame = codeFrame; + } + throw jsonError2; + } + }; + parseJson.JSONError = JSONError; + module5.exports = parseJson; + } +}); + +// node_modules/js-yaml/lib/common.js +var require_common5 = __commonJS({ + "node_modules/js-yaml/lib/common.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function isNothing2(subject) { + return typeof subject === "undefined" || subject === null; + } + function isObject8(subject) { + return typeof subject === "object" && subject !== null; + } + function toArray3(sequence) { + if (Array.isArray(sequence)) + return sequence; + else if (isNothing2(sequence)) + return []; + return [sequence]; + } + function extend3(target, source) { + var index4, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index4 = 0, length = sourceKeys.length; index4 < length; index4 += 1) { + key = sourceKeys[index4]; + target[key] = source[key]; + } + } + return target; + } + function repeat3(string2, count2) { + var result2 = "", cycle; + for (cycle = 0; cycle < count2; cycle += 1) { + result2 += string2; + } + return result2; + } + function isNegativeZero2(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; + } + module5.exports.isNothing = isNothing2; + module5.exports.isObject = isObject8; + module5.exports.toArray = toArray3; + module5.exports.repeat = repeat3; + module5.exports.isNegativeZero = isNegativeZero2; + module5.exports.extend = extend3; + } +}); + +// node_modules/js-yaml/lib/exception.js +var require_exception3 = __commonJS({ + "node_modules/js-yaml/lib/exception.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + function formatError2(exception2, compact2) { + var where = "", message = exception2.reason || "(unknown reason)"; + if (!exception2.mark) + return message; + if (exception2.mark.name) { + where += 'in "' + exception2.mark.name + '" '; + } + where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; + if (!compact2 && exception2.mark.snippet) { + where += "\n\n" + exception2.mark.snippet; + } + return message + " " + where; + } + function YAMLException2(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError2(this, false); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; + } + } + YAMLException2.prototype = Object.create(Error.prototype); + YAMLException2.prototype.constructor = YAMLException2; + YAMLException2.prototype.toString = function toString3(compact2) { + return this.name + ": " + formatError2(this, compact2); + }; + module5.exports = YAMLException2; + } +}); + +// node_modules/js-yaml/lib/snippet.js +var require_snippet = __commonJS({ + "node_modules/js-yaml/lib/snippet.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common5(); + function getLine2(buffer2, lineStart, lineEnd, position, maxLineLength) { + var head2 = ""; + var tail2 = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head2 = " ... "; + lineStart = position - maxHalfLength + head2.length; + } + if (lineEnd - position > maxHalfLength) { + tail2 = " ..."; + lineEnd = position + maxHalfLength - tail2.length; + } + return { + str: head2 + buffer2.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail2, + pos: position - lineStart + head2.length + // relative position + }; + } + function padStart3(string2, max2) { + return common3.repeat(" ", max2 - string2.length) + string2; + } + function makeSnippet2(mark, options) { + options = Object.create(options || null); + if (!mark.buffer) + return null; + if (!options.maxLength) + options.maxLength = 79; + if (typeof options.indent !== "number") + options.indent = 1; + if (typeof options.linesBefore !== "number") + options.linesBefore = 3; + if (typeof options.linesAfter !== "number") + options.linesAfter = 2; + var re4 = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match; + var foundLineNo = -1; + while (match = re4.exec(mark.buffer)) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + if (foundLineNo < 0) + foundLineNo = lineStarts.length - 1; + var result2 = "", i7, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + for (i7 = 1; i7 <= options.linesBefore; i7++) { + if (foundLineNo - i7 < 0) + break; + line = getLine2( + mark.buffer, + lineStarts[foundLineNo - i7], + lineEnds[foundLineNo - i7], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i7]), + maxLineLength + ); + result2 = common3.repeat(" ", options.indent) + padStart3((mark.line - i7 + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result2; + } + line = getLine2(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result2 += common3.repeat(" ", options.indent) + padStart3((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + result2 += common3.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; + for (i7 = 1; i7 <= options.linesAfter; i7++) { + if (foundLineNo + i7 >= lineEnds.length) + break; + line = getLine2( + mark.buffer, + lineStarts[foundLineNo + i7], + lineEnds[foundLineNo + i7], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i7]), + maxLineLength + ); + result2 += common3.repeat(" ", options.indent) + padStart3((mark.line + i7 + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + } + return result2.replace(/\n$/, ""); + } + module5.exports = makeSnippet2; + } +}); + +// node_modules/js-yaml/lib/type.js +var require_type5 = __commonJS({ + "node_modules/js-yaml/lib/type.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var YAMLException2 = require_exception3(); + var TYPE_CONSTRUCTOR_OPTIONS2 = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" + ]; + var YAML_NODE_KINDS2 = [ + "scalar", + "sequence", + "mapping" + ]; + function compileStyleAliases2(map4) { + var result2 = {}; + if (map4 !== null) { + Object.keys(map4).forEach(function(style) { + map4[style].forEach(function(alias) { + result2[String(alias)] = style; + }); + }); + } + return result2; + } + function Type3(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name2) { + if (TYPE_CONSTRUCTOR_OPTIONS2.indexOf(name2) === -1) { + throw new YAMLException2('Unknown option "' + name2 + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + this.options = options; + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.representName = options["representName"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.multi = options["multi"] || false; + this.styleAliases = compileStyleAliases2(options["styleAliases"] || null); + if (YAML_NODE_KINDS2.indexOf(this.kind) === -1) { + throw new YAMLException2('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } + } + module5.exports = Type3; + } +}); + +// node_modules/js-yaml/lib/schema.js +var require_schema7 = __commonJS({ + "node_modules/js-yaml/lib/schema.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var YAMLException2 = require_exception3(); + var Type3 = require_type5(); + function compileList2(schema8, name2) { + var result2 = []; + schema8[name2].forEach(function(currentType) { + var newIndex = result2.length; + result2.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { + newIndex = previousIndex; + } + }); + result2[newIndex] = currentType; + }); + return result2; + } + function compileMap2() { + var result2 = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index4, length; + function collectType(type3) { + if (type3.multi) { + result2.multi[type3.kind].push(type3); + result2.multi["fallback"].push(type3); + } else { + result2[type3.kind][type3.tag] = result2["fallback"][type3.tag] = type3; + } + } + for (index4 = 0, length = arguments.length; index4 < length; index4 += 1) { + arguments[index4].forEach(collectType); + } + return result2; + } + function Schema9(definition) { + return this.extend(definition); + } + Schema9.prototype.extend = function extend3(definition) { + var implicit = []; + var explicit = []; + if (definition instanceof Type3) { + explicit.push(definition); + } else if (Array.isArray(definition)) { + explicit = explicit.concat(definition); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) + implicit = implicit.concat(definition.implicit); + if (definition.explicit) + explicit = explicit.concat(definition.explicit); + } else { + throw new YAMLException2("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + } + implicit.forEach(function(type3) { + if (!(type3 instanceof Type3)) { + throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + if (type3.loadKind && type3.loadKind !== "scalar") { + throw new YAMLException2("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + if (type3.multi) { + throw new YAMLException2("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + } + }); + explicit.forEach(function(type3) { + if (!(type3 instanceof Type3)) { + throw new YAMLException2("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + }); + var result2 = Object.create(Schema9.prototype); + result2.implicit = (this.implicit || []).concat(implicit); + result2.explicit = (this.explicit || []).concat(explicit); + result2.compiledImplicit = compileList2(result2, "implicit"); + result2.compiledExplicit = compileList2(result2, "explicit"); + result2.compiledTypeMap = compileMap2(result2.compiledImplicit, result2.compiledExplicit); + return result2; + }; + module5.exports = Schema9; + } +}); + +// node_modules/js-yaml/lib/type/str.js +var require_str3 = __commonJS({ + "node_modules/js-yaml/lib/type/str.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + module5.exports = new Type3("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return data !== null ? data : ""; + } + }); + } +}); + +// node_modules/js-yaml/lib/type/seq.js +var require_seq3 = __commonJS({ + "node_modules/js-yaml/lib/type/seq.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + module5.exports = new Type3("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return data !== null ? data : []; + } + }); + } +}); + +// node_modules/js-yaml/lib/type/map.js +var require_map3 = __commonJS({ + "node_modules/js-yaml/lib/type/map.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + module5.exports = new Type3("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return data !== null ? data : {}; + } + }); + } +}); + +// node_modules/js-yaml/lib/schema/failsafe.js +var require_failsafe3 = __commonJS({ + "node_modules/js-yaml/lib/schema/failsafe.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Schema9 = require_schema7(); + module5.exports = new Schema9({ + explicit: [ + require_str3(), + require_seq3(), + require_map3() + ] + }); + } +}); + +// node_modules/js-yaml/lib/type/null.js +var require_null3 = __commonJS({ + "node_modules/js-yaml/lib/type/null.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + function resolveYamlNull2(data) { + if (data === null) + return true; + var max2 = data.length; + return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); + } + function constructYamlNull2() { + return null; + } + function isNull4(object) { + return object === null; + } + module5.exports = new Type3("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull2, + construct: constructYamlNull2, + predicate: isNull4, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + }, + empty: function() { + return ""; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/js-yaml/lib/type/bool.js +var require_bool3 = __commonJS({ + "node_modules/js-yaml/lib/type/bool.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + function resolveYamlBoolean2(data) { + if (data === null) + return false; + var max2 = data.length; + return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); + } + function constructYamlBoolean2(data) { + return data === "true" || data === "True" || data === "TRUE"; + } + function isBoolean4(object) { + return Object.prototype.toString.call(object) === "[object Boolean]"; + } + module5.exports = new Type3("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean2, + construct: constructYamlBoolean2, + predicate: isBoolean4, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/js-yaml/lib/type/int.js +var require_int3 = __commonJS({ + "node_modules/js-yaml/lib/type/int.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common5(); + var Type3 = require_type5(); + function isHexCode2(c7) { + return 48 <= c7 && c7 <= 57 || 65 <= c7 && c7 <= 70 || 97 <= c7 && c7 <= 102; + } + function isOctCode2(c7) { + return 48 <= c7 && c7 <= 55; + } + function isDecCode2(c7) { + return 48 <= c7 && c7 <= 57; + } + function resolveYamlInteger2(data) { + if (data === null) + return false; + var max2 = data.length, index4 = 0, hasDigits = false, ch; + if (!max2) + return false; + ch = data[index4]; + if (ch === "-" || ch === "+") { + ch = data[++index4]; + } + if (ch === "0") { + if (index4 + 1 === max2) + return true; + ch = data[++index4]; + if (ch === "b") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (ch !== "0" && ch !== "1") + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isHexCode2(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "o") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isOctCode2(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + } + if (ch === "_") + return false; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isDecCode2(data.charCodeAt(index4))) { + return false; + } + hasDigits = true; + } + if (!hasDigits || ch === "_") + return false; + return true; + } + function constructYamlInteger2(data) { + var value2 = data, sign = 1, ch; + if (value2.indexOf("_") !== -1) { + value2 = value2.replace(/_/g, ""); + } + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") + sign = -1; + value2 = value2.slice(1); + ch = value2[0]; + } + if (value2 === "0") + return 0; + if (ch === "0") { + if (value2[1] === "b") + return sign * parseInt(value2.slice(2), 2); + if (value2[1] === "x") + return sign * parseInt(value2.slice(2), 16); + if (value2[1] === "o") + return sign * parseInt(value2.slice(2), 8); + } + return sign * parseInt(value2, 10); + } + function isInteger3(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common3.isNegativeZero(object)); + } + module5.exports = new Type3("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger2, + construct: constructYamlInteger2, + predicate: isInteger3, + represent: { + binary: function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, + octal: function(obj) { + return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); + }, + decimal: function(obj) { + return obj.toString(10); + }, + /* eslint-disable max-len */ + hexadecimal: function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } + }); + } +}); + +// node_modules/js-yaml/lib/type/float.js +var require_float4 = __commonJS({ + "node_modules/js-yaml/lib/type/float.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common5(); + var Type3 = require_type5(); + var YAML_FLOAT_PATTERN2 = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" + ); + function resolveYamlFloat2(data) { + if (data === null) + return false; + if (!YAML_FLOAT_PATTERN2.test(data) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === "_") { + return false; + } + return true; + } + function constructYamlFloat2(data) { + var value2, sign; + value2 = data.replace(/_/g, "").toLowerCase(); + sign = value2[0] === "-" ? -1 : 1; + if ("+-".indexOf(value2[0]) >= 0) { + value2 = value2.slice(1); + } + if (value2 === ".inf") { + return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (value2 === ".nan") { + return NaN; + } + return sign * parseFloat(value2, 10); + } + var SCIENTIFIC_WITHOUT_DOT2 = /^[-+]?[0-9]+e/; + function representYamlFloat2(object, style) { + var res; + if (isNaN(object)) { + switch (style) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common3.isNegativeZero(object)) { + return "-0.0"; + } + res = object.toString(10); + return SCIENTIFIC_WITHOUT_DOT2.test(res) ? res.replace("e", ".e") : res; + } + function isFloat2(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common3.isNegativeZero(object)); + } + module5.exports = new Type3("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat2, + construct: constructYamlFloat2, + predicate: isFloat2, + represent: representYamlFloat2, + defaultStyle: "lowercase" + }); + } +}); + +// node_modules/js-yaml/lib/schema/json.js +var require_json5 = __commonJS({ + "node_modules/js-yaml/lib/schema/json.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_failsafe3().extend({ + implicit: [ + require_null3(), + require_bool3(), + require_int3(), + require_float4() + ] + }); + } +}); + +// node_modules/js-yaml/lib/schema/core.js +var require_core9 = __commonJS({ + "node_modules/js-yaml/lib/schema/core.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_json5(); + } +}); + +// node_modules/js-yaml/lib/type/timestamp.js +var require_timestamp3 = __commonJS({ + "node_modules/js-yaml/lib/type/timestamp.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + var YAML_DATE_REGEXP2 = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" + ); + var YAML_TIMESTAMP_REGEXP2 = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" + ); + function resolveYamlTimestamp2(data) { + if (data === null) + return false; + if (YAML_DATE_REGEXP2.exec(data) !== null) + return true; + if (YAML_TIMESTAMP_REGEXP2.exec(data) !== null) + return true; + return false; + } + function constructYamlTimestamp2(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_DATE_REGEXP2.exec(data); + if (match === null) + match = YAML_TIMESTAMP_REGEXP2.exec(data); + if (match === null) + throw new Error("Date resolve error"); + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { + fraction += "0"; + } + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match[9] === "-") + delta = -delta; + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) + date.setTime(date.getTime() - delta); + return date; + } + function representYamlTimestamp2(object) { + return object.toISOString(); + } + module5.exports = new Type3("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp2, + construct: constructYamlTimestamp2, + instanceOf: Date, + represent: representYamlTimestamp2 + }); + } +}); + +// node_modules/js-yaml/lib/type/merge.js +var require_merge3 = __commonJS({ + "node_modules/js-yaml/lib/type/merge.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + function resolveYamlMerge2(data) { + return data === "<<" || data === null; + } + module5.exports = new Type3("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge2 + }); + } +}); + +// node_modules/js-yaml/lib/type/binary.js +var require_binary3 = __commonJS({ + "node_modules/js-yaml/lib/type/binary.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + var BASE64_MAP2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; + function resolveYamlBinary2(data) { + if (data === null) + return false; + var code, idx, bitlen = 0, max2 = data.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + code = map4.indexOf(data.charAt(idx)); + if (code > 64) + continue; + if (code < 0) + return false; + bitlen += 6; + } + return bitlen % 8 === 0; + } + function constructYamlBinary2(data) { + var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map4 = BASE64_MAP2, bits = 0, result2 = []; + for (idx = 0; idx < max2; idx++) { + if (idx % 4 === 0 && idx) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } + bits = bits << 6 | map4.indexOf(input.charAt(idx)); + } + tailbits = max2 % 4 * 6; + if (tailbits === 0) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } else if (tailbits === 18) { + result2.push(bits >> 10 & 255); + result2.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result2.push(bits >> 4 & 255); + } + return new Uint8Array(result2); + } + function representYamlBinary2(object) { + var result2 = "", bits = 0, idx, tail2, max2 = object.length, map4 = BASE64_MAP2; + for (idx = 0; idx < max2; idx++) { + if (idx % 3 === 0 && idx) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail2 = max2 % 3; + if (tail2 === 0) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } else if (tail2 === 2) { + result2 += map4[bits >> 10 & 63]; + result2 += map4[bits >> 4 & 63]; + result2 += map4[bits << 2 & 63]; + result2 += map4[64]; + } else if (tail2 === 1) { + result2 += map4[bits >> 2 & 63]; + result2 += map4[bits << 4 & 63]; + result2 += map4[64]; + result2 += map4[64]; + } + return result2; + } + function isBinary2(obj) { + return Object.prototype.toString.call(obj) === "[object Uint8Array]"; + } + module5.exports = new Type3("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary2, + construct: constructYamlBinary2, + predicate: isBinary2, + represent: representYamlBinary2 + }); + } +}); + +// node_modules/js-yaml/lib/type/omap.js +var require_omap3 = __commonJS({ + "node_modules/js-yaml/lib/type/omap.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var _toString2 = Object.prototype.toString; + function resolveYamlOmap2(data) { + if (data === null) + return true; + var objectKeys = [], index4, length, pair, pairKey, pairHasKey, object = data; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + pairHasKey = false; + if (_toString2.call(pair) !== "[object Object]") + return false; + for (pairKey in pair) { + if (_hasOwnProperty2.call(pair, pairKey)) { + if (!pairHasKey) + pairHasKey = true; + else + return false; + } + } + if (!pairHasKey) + return false; + if (objectKeys.indexOf(pairKey) === -1) + objectKeys.push(pairKey); + else + return false; + } + return true; + } + function constructYamlOmap2(data) { + return data !== null ? data : []; + } + module5.exports = new Type3("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap2, + construct: constructYamlOmap2 + }); + } +}); + +// node_modules/js-yaml/lib/type/pairs.js +var require_pairs3 = __commonJS({ + "node_modules/js-yaml/lib/type/pairs.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + var _toString2 = Object.prototype.toString; + function resolveYamlPairs2(data) { + if (data === null) + return true; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + if (_toString2.call(pair) !== "[object Object]") + return false; + keys2 = Object.keys(pair); + if (keys2.length !== 1) + return false; + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return true; + } + function constructYamlPairs2(data) { + if (data === null) + return []; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + keys2 = Object.keys(pair); + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return result2; + } + module5.exports = new Type3("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs2, + construct: constructYamlPairs2 + }); + } +}); + +// node_modules/js-yaml/lib/type/set.js +var require_set3 = __commonJS({ + "node_modules/js-yaml/lib/type/set.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var Type3 = require_type5(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + function resolveYamlSet2(data) { + if (data === null) + return true; + var key, object = data; + for (key in object) { + if (_hasOwnProperty2.call(object, key)) { + if (object[key] !== null) + return false; + } + } + return true; + } + function constructYamlSet2(data) { + return data !== null ? data : {}; + } + module5.exports = new Type3("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet2, + construct: constructYamlSet2 + }); + } +}); + +// node_modules/js-yaml/lib/schema/default.js +var require_default2 = __commonJS({ + "node_modules/js-yaml/lib/schema/default.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + module5.exports = require_core9().extend({ + implicit: [ + require_timestamp3(), + require_merge3() + ], + explicit: [ + require_binary3(), + require_omap3(), + require_pairs3(), + require_set3() + ] + }); + } +}); + +// node_modules/js-yaml/lib/loader.js +var require_loader3 = __commonJS({ + "node_modules/js-yaml/lib/loader.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common5(); + var YAMLException2 = require_exception3(); + var makeSnippet2 = require_snippet(); + var DEFAULT_SCHEMA2 = require_default2(); + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CONTEXT_FLOW_IN2 = 1; + var CONTEXT_FLOW_OUT2 = 2; + var CONTEXT_BLOCK_IN2 = 3; + var CONTEXT_BLOCK_OUT2 = 4; + var CHOMPING_CLIP2 = 1; + var CHOMPING_STRIP2 = 2; + var CHOMPING_KEEP2 = 3; + var PATTERN_NON_PRINTABLE2 = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + var PATTERN_NON_ASCII_LINE_BREAKS2 = /[\x85\u2028\u2029]/; + var PATTERN_FLOW_INDICATORS2 = /[,\[\]\{\}]/; + var PATTERN_TAG_HANDLE2 = /^(?:!|!!|![a-z\-]+!)$/i; + var PATTERN_TAG_URI2 = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + function _class2(obj) { + return Object.prototype.toString.call(obj); + } + function is_EOL2(c7) { + return c7 === 10 || c7 === 13; + } + function is_WHITE_SPACE2(c7) { + return c7 === 9 || c7 === 32; + } + function is_WS_OR_EOL2(c7) { + return c7 === 9 || c7 === 32 || c7 === 10 || c7 === 13; + } + function is_FLOW_INDICATOR2(c7) { + return c7 === 44 || c7 === 91 || c7 === 93 || c7 === 123 || c7 === 125; + } + function fromHexCode2(c7) { + var lc; + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + lc = c7 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; + } + function escapedHexLen2(c7) { + if (c7 === 120) { + return 2; + } + if (c7 === 117) { + return 4; + } + if (c7 === 85) { + return 8; + } + return 0; + } + function fromDecimalCode2(c7) { + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + return -1; + } + function simpleEscapeSequence2(c7) { + return c7 === 48 ? "\0" : c7 === 97 ? "\x07" : c7 === 98 ? "\b" : c7 === 116 ? " " : c7 === 9 ? " " : c7 === 110 ? "\n" : c7 === 118 ? "\v" : c7 === 102 ? "\f" : c7 === 114 ? "\r" : c7 === 101 ? "\x1B" : c7 === 32 ? " " : c7 === 34 ? '"' : c7 === 47 ? "/" : c7 === 92 ? "\\" : c7 === 78 ? "\x85" : c7 === 95 ? "\xA0" : c7 === 76 ? "\u2028" : c7 === 80 ? "\u2029" : ""; + } + function charFromCodepoint2(c7) { + if (c7 <= 65535) { + return String.fromCharCode(c7); + } + return String.fromCharCode( + (c7 - 65536 >> 10) + 55296, + (c7 - 65536 & 1023) + 56320 + ); + } + function setProperty3(object, key, value2) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value: value2 + }); + } else { + object[key] = value2; + } + } + var simpleEscapeCheck2 = new Array(256); + var simpleEscapeMap2 = new Array(256); + for (i7 = 0; i7 < 256; i7++) { + simpleEscapeCheck2[i7] = simpleEscapeSequence2(i7) ? 1 : 0; + simpleEscapeMap2[i7] = simpleEscapeSequence2(i7); + } + var i7; + function State2(input, options) { + this.input = input; + this.filename = options["filename"] || null; + this.schema = options["schema"] || DEFAULT_SCHEMA2; + this.onWarning = options["onWarning"] || null; + this.legacy = options["legacy"] || false; + this.json = options["json"] || false; + this.listener = options["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.firstTabInLine = -1; + this.documents = []; + } + function generateError2(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), + // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + mark.snippet = makeSnippet2(mark); + return new YAMLException2(message, mark); + } + function throwError2(state, message) { + throw generateError2(state, message); + } + function throwWarning2(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError2(state, message)); + } + } + var directiveHandlers2 = { + YAML: function handleYamlDirective2(state, name2, args) { + var match, major, minor; + if (state.version !== null) { + throwError2(state, "duplication of %YAML directive"); + } + if (args.length !== 1) { + throwError2(state, "YAML directive accepts exactly one argument"); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) { + throwError2(state, "ill-formed argument of the YAML directive"); + } + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (major !== 1) { + throwError2(state, "unacceptable YAML version of the document"); + } + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning2(state, "unsupported YAML version of the document"); + } + }, + TAG: function handleTagDirective2(state, name2, args) { + var handle, prefix; + if (args.length !== 2) { + throwError2(state, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE2.test(handle)) { + throwError2(state, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty2.call(state.tagMap, handle)) { + throwError2(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI2.test(prefix)) { + throwError2(state, "ill-formed tag prefix (second argument) of the TAG directive"); + } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError2(state, "tag prefix is malformed: " + prefix); + } + state.tagMap[handle] = prefix; + } + }; + function captureSegment2(state, start, end, checkJson) { + var _position, _length, _character, _result; + if (start < end) { + _result = state.input.slice(start, end); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { + throwError2(state, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE2.test(_result)) { + throwError2(state, "the stream contains non-printable characters"); + } + state.result += _result; + } + } + function mergeMappings2(state, destination, source, overridableKeys) { + var sourceKeys, key, index4, quantity; + if (!common3.isObject(source)) { + throwError2(state, "cannot merge mappings; the provided source object is unacceptable"); + } + sourceKeys = Object.keys(source); + for (index4 = 0, quantity = sourceKeys.length; index4 < quantity; index4 += 1) { + key = sourceKeys[index4]; + if (!_hasOwnProperty2.call(destination, key)) { + setProperty3(destination, key, source[key]); + overridableKeys[key] = true; + } + } + } + function storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + var index4, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index4 = 0, quantity = keyNode.length; index4 < quantity; index4 += 1) { + if (Array.isArray(keyNode[index4])) { + throwError2(state, "nested arrays are not supported inside keys"); + } + if (typeof keyNode === "object" && _class2(keyNode[index4]) === "[object Object]") { + keyNode[index4] = "[object Object]"; + } + } + } + if (typeof keyNode === "object" && _class2(keyNode) === "[object Object]") { + keyNode = "[object Object]"; + } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; + } + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index4 = 0, quantity = valueNode.length; index4 < quantity; index4 += 1) { + mergeMappings2(state, _result, valueNode[index4], overridableKeys); + } + } else { + mergeMappings2(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && !_hasOwnProperty2.call(overridableKeys, keyNode) && _hasOwnProperty2.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError2(state, "duplicated mapping key"); + } + setProperty3(_result, keyNode, valueNode); + delete overridableKeys[keyNode]; + } + return _result; + } + function readLineBreak2(state) { + var ch; + ch = state.input.charCodeAt(state.position); + if (ch === 10) { + state.position++; + } else if (ch === 13) { + state.position++; + if (state.input.charCodeAt(state.position) === 10) { + state.position++; + } + } else { + throwError2(state, "a line break is expected"); + } + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; + } + function skipSeparationSpace2(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + while (is_WHITE_SPACE2(ch)) { + if (ch === 9 && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); + } + if (is_EOL2(ch)) { + readLineBreak2(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning2(state, "deficient indentation"); + } + return lineBreaks; + } + function testDocumentSeparator2(state) { + var _position = state.position, ch; + ch = state.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL2(ch)) { + return true; + } + } + return false; + } + function writeFoldedLines2(state, count2) { + if (count2 === 1) { + state.result += " "; + } else if (count2 > 1) { + state.result += common3.repeat("\n", count2 - 1); + } + } + function readPlainScalar2(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; + ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL2(ch) || is_FLOW_INDICATOR2(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { + return false; + } + if (ch === 63 || ch === 45) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + return false; + } + } + state.kind = "scalar"; + state.result = ""; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following) || withinFlowCollection && is_FLOW_INDICATOR2(following)) { + break; + } + } else if (ch === 35) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL2(preceding)) { + break; + } + } else if (state.position === state.lineStart && testDocumentSeparator2(state) || withinFlowCollection && is_FLOW_INDICATOR2(ch)) { + break; + } else if (is_EOL2(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace2(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment2(state, captureStart, captureEnd, false); + writeFoldedLines2(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE2(ch)) { + captureEnd = state.position + 1; + } + ch = state.input.charCodeAt(++state.position); + } + captureSegment2(state, captureStart, captureEnd, false); + if (state.result) { + return true; + } + state.kind = _kind; + state.result = _result; + return false; + } + function readSingleQuotedScalar2(state, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state.input.charCodeAt(state.position); + if (ch !== 39) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 39) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (ch === 39) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a single quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError2(state, "unexpected end of the stream within a single quoted scalar"); + } + function readDoubleQuotedScalar2(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 34) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 34) { + captureSegment2(state, captureStart, state.position, true); + state.position++; + return true; + } else if (ch === 92) { + captureSegment2(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL2(ch)) { + skipSeparationSpace2(state, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck2[ch]) { + state.result += simpleEscapeMap2[ch]; + state.position++; + } else if ((tmp = escapedHexLen2(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode2(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError2(state, "expected hexadecimal character"); + } + } + state.result += charFromCodepoint2(hexResult); + state.position++; + } else { + throwError2(state, "unknown escape sequence"); + } + captureStart = captureEnd = state.position; + } else if (is_EOL2(ch)) { + captureSegment2(state, captureStart, captureEnd, true); + writeFoldedLines2(state, skipSeparationSpace2(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator2(state)) { + throwError2(state, "unexpected end of the document within a double quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError2(state, "unexpected end of the stream within a double quoted scalar"); + } + function readFlowCollection2(state, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair2, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(++state.position); + while (ch !== 0) { + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + return true; + } else if (!readNext) { + throwError2(state, "missed comma between flow collection entries"); + } else if (ch === 44) { + throwError2(state, "expected the node content, but found ','"); + } + keyTag = keyNode = valueNode = null; + isPair2 = isExplicitPair = false; + if (ch === 63) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL2(following)) { + isPair2 = isExplicitPair = true; + state.position++; + skipSeparationSpace2(state, true, nodeIndent); + } + } + _line = state.line; + _lineStart = state.lineStart; + _pos = state.position; + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && ch === 58) { + isPair2 = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace2(state, true, nodeIndent); + composeNode3(state, nodeIndent, CONTEXT_FLOW_IN2, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair2) { + _result.push(storeMappingPair2(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + skipSeparationSpace2(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === 44) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + throwError2(state, "unexpected end of the stream within a flow collection"); + } + function readBlockScalar2(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP2, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + state.kind = "scalar"; + state.result = ""; + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP2 === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP2 : CHOMPING_STRIP2; + } else { + throwError2(state, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode2(ch)) >= 0) { + if (tmp === 0) { + throwError2(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError2(state, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE2(ch)) { + do { + ch = state.input.charCodeAt(++state.position); + } while (is_WHITE_SPACE2(ch)); + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (!is_EOL2(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak2(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + if (is_EOL2(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP2) { + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP2) { + if (didReadContent) { + state.result += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE2(ch)) { + atMoreIndented = true; + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common3.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state.result += " "; + } + } else { + state.result += common3.repeat("\n", emptyLines); + } + } else { + state.result += common3.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL2(ch) && ch !== 0) { + ch = state.input.charCodeAt(++state.position); + } + captureSegment2(state, captureStart, state.position, false); + } + return true; + } + function readBlockSequence2(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; + if (state.firstTabInLine !== -1) + return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError2(state, "tab characters must not be used in indentation"); + } + if (ch !== 45) { + break; + } + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL2(following)) { + break; + } + detected = true; + state.position++; + if (skipSeparationSpace2(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode3(state, nodeIndent, CONTEXT_BLOCK_IN2, false, true); + _result.push(state.result); + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError2(state, "bad indentation of a sequence entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + return true; + } + return false; + } + function readBlockMapping2(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state.firstTabInLine !== -1) + return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError2(state, "tab characters must not be used in indentation"); + } + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL2(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else { + throwError2(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + } + state.position += 1; + ch = following; + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + if (!composeNode3(state, flowIndent, CONTEXT_FLOW_OUT2, false, true)) { + break; + } + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 58) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL2(ch)) { + throwError2(state, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (detected) { + throwError2(state, "can not read an implicit mapping pair; a colon is missed"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) { + throwError2(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + if (composeNode3(state, nodeIndent, CONTEXT_BLOCK_OUT2, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + if (!atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError2(state, "bad indentation of a mapping entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair2(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; + } + function readTagProperty2(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 33) + return false; + if (state.tag !== null) { + throwError2(state, "duplication of a tag property"); + } + ch = state.input.charCodeAt(++state.position); + if (ch === 60) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 33) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else { + tagHandle = "!"; + } + _position = state.position; + if (isVerbatim) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && ch !== 62); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError2(state, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + if (ch === 33) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE2.test(tagHandle)) { + throwError2(state, "named tag handle cannot contain such characters"); + } + isNamed = true; + _position = state.position + 1; + } else { + throwError2(state, "tag suffix cannot contain exclamation marks"); + } + } + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS2.test(tagName)) { + throwError2(state, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI2.test(tagName)) { + throwError2(state, "tag name cannot contain such characters: " + tagName); + } + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError2(state, "tag name is malformed: " + tagName); + } + if (isVerbatim) { + state.tag = tagName; + } else if (_hasOwnProperty2.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError2(state, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; + } + function readAnchorProperty2(state) { + var _position, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 38) + return false; + if (state.anchor !== null) { + throwError2(state, "duplication of an anchor property"); + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError2(state, "name of an anchor node must contain at least one character"); + } + state.anchor = state.input.slice(_position, state.position); + return true; + } + function readAlias2(state) { + var _position, alias, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 42) + return false; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch) && !is_FLOW_INDICATOR2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError2(state, "name of an alias node must contain at least one character"); + } + alias = state.input.slice(_position, state.position); + if (!_hasOwnProperty2.call(state.anchorMap, alias)) { + throwError2(state, 'unidentified alias "' + alias + '"'); + } + state.result = state.anchorMap[alias]; + skipSeparationSpace2(state, true, -1); + return true; + } + function composeNode3(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent; + if (state.listener !== null) { + state.listener("open", state); + } + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT2 === nodeContext || CONTEXT_BLOCK_IN2 === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty2(state) || readAnchorProperty2(state)) { + if (skipSeparationSpace2(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (indentStatus === 1 || CONTEXT_BLOCK_OUT2 === nodeContext) { + if (CONTEXT_FLOW_IN2 === nodeContext || CONTEXT_FLOW_OUT2 === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state.position - state.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence2(state, blockIndent) || readBlockMapping2(state, blockIndent, flowIndent)) || readFlowCollection2(state, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar2(state, flowIndent) || readSingleQuotedScalar2(state, flowIndent) || readDoubleQuotedScalar2(state, flowIndent)) { + hasContent = true; + } else if (readAlias2(state)) { + hasContent = true; + if (state.tag !== null || state.anchor !== null) { + throwError2(state, "alias node should not have any properties"); + } + } else if (readPlainScalar2(state, flowIndent, CONTEXT_FLOW_IN2 === nodeContext)) { + hasContent = true; + if (state.tag === null) { + state.tag = "?"; + } + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence2(state, blockIndent); + } + } + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } else if (state.tag === "?") { + if (state.result !== null && state.kind !== "scalar") { + throwError2(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state.implicitTypes[typeIndex]; + if (type3.resolve(state.result)) { + state.result = type3.construct(state.result); + state.tag = type3.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== "!") { + if (_hasOwnProperty2.call(state.typeMap[state.kind || "fallback"], state.tag)) { + type3 = state.typeMap[state.kind || "fallback"][state.tag]; + } else { + type3 = null; + typeList = state.typeMap.multi[state.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type3 = typeList[typeIndex]; + break; + } + } + } + if (!type3) { + throwError2(state, "unknown tag !<" + state.tag + ">"); + } + if (state.result !== null && type3.kind !== state.kind) { + throwError2(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type3.kind + '", not "' + state.kind + '"'); + } + if (!type3.resolve(state.result, state.tag)) { + throwError2(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + } else { + state.result = type3.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + if (state.listener !== null) { + state.listener("close", state); + } + return state.tag !== null || state.anchor !== null || hasContent; + } + function readDocument2(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = /* @__PURE__ */ Object.create(null); + state.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace2(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || ch !== 37) { + break; + } + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError2(state, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && !is_EOL2(ch)); + break; + } + if (is_EOL2(ch)) + break; + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL2(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (ch !== 0) + readLineBreak2(state); + if (_hasOwnProperty2.call(directiveHandlers2, directiveName)) { + directiveHandlers2[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning2(state, 'unknown document directive "' + directiveName + '"'); + } + } + skipSeparationSpace2(state, true, -1); + if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } else if (hasDirectives) { + throwError2(state, "directives end mark is expected"); + } + composeNode3(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT2, false, true); + skipSeparationSpace2(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS2.test(state.input.slice(documentStart, state.position))) { + throwWarning2(state, "non-ASCII line breaks are interpreted as content"); + } + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator2(state)) { + if (state.input.charCodeAt(state.position) === 46) { + state.position += 3; + skipSeparationSpace2(state, true, -1); + } + return; + } + if (state.position < state.length - 1) { + throwError2(state, "end of the stream or a document separator is expected"); + } else { + return; + } + } + function loadDocuments2(input, options) { + input = String(input); + options = options || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state = new State2(input, options); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state.position = nullpos; + throwError2(state, "null byte is not allowed in input"); + } + state.input += "\0"; + while (state.input.charCodeAt(state.position) === 32) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) { + readDocument2(state); + } + return state.documents; + } + function loadAll2(input, iterator, options) { + if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { + options = iterator; + iterator = null; + } + var documents = loadDocuments2(input, options); + if (typeof iterator !== "function") { + return documents; + } + for (var index4 = 0, length = documents.length; index4 < length; index4 += 1) { + iterator(documents[index4]); + } + } + function load2(input, options) { + var documents = loadDocuments2(input, options); + if (documents.length === 0) { + return void 0; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException2("expected a single document in the stream, but found more"); + } + module5.exports.loadAll = loadAll2; + module5.exports.load = load2; + } +}); + +// node_modules/js-yaml/lib/dumper.js +var require_dumper3 = __commonJS({ + "node_modules/js-yaml/lib/dumper.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var common3 = require_common5(); + var YAMLException2 = require_exception3(); + var DEFAULT_SCHEMA2 = require_default2(); + var _toString2 = Object.prototype.toString; + var _hasOwnProperty2 = Object.prototype.hasOwnProperty; + var CHAR_BOM2 = 65279; + var CHAR_TAB2 = 9; + var CHAR_LINE_FEED2 = 10; + var CHAR_CARRIAGE_RETURN2 = 13; + var CHAR_SPACE2 = 32; + var CHAR_EXCLAMATION2 = 33; + var CHAR_DOUBLE_QUOTE2 = 34; + var CHAR_SHARP2 = 35; + var CHAR_PERCENT2 = 37; + var CHAR_AMPERSAND2 = 38; + var CHAR_SINGLE_QUOTE2 = 39; + var CHAR_ASTERISK2 = 42; + var CHAR_COMMA2 = 44; + var CHAR_MINUS2 = 45; + var CHAR_COLON2 = 58; + var CHAR_EQUALS2 = 61; + var CHAR_GREATER_THAN2 = 62; + var CHAR_QUESTION2 = 63; + var CHAR_COMMERCIAL_AT2 = 64; + var CHAR_LEFT_SQUARE_BRACKET2 = 91; + var CHAR_RIGHT_SQUARE_BRACKET2 = 93; + var CHAR_GRAVE_ACCENT2 = 96; + var CHAR_LEFT_CURLY_BRACKET2 = 123; + var CHAR_VERTICAL_LINE2 = 124; + var CHAR_RIGHT_CURLY_BRACKET2 = 125; + var ESCAPE_SEQUENCES2 = {}; + ESCAPE_SEQUENCES2[0] = "\\0"; + ESCAPE_SEQUENCES2[7] = "\\a"; + ESCAPE_SEQUENCES2[8] = "\\b"; + ESCAPE_SEQUENCES2[9] = "\\t"; + ESCAPE_SEQUENCES2[10] = "\\n"; + ESCAPE_SEQUENCES2[11] = "\\v"; + ESCAPE_SEQUENCES2[12] = "\\f"; + ESCAPE_SEQUENCES2[13] = "\\r"; + ESCAPE_SEQUENCES2[27] = "\\e"; + ESCAPE_SEQUENCES2[34] = '\\"'; + ESCAPE_SEQUENCES2[92] = "\\\\"; + ESCAPE_SEQUENCES2[133] = "\\N"; + ESCAPE_SEQUENCES2[160] = "\\_"; + ESCAPE_SEQUENCES2[8232] = "\\L"; + ESCAPE_SEQUENCES2[8233] = "\\P"; + var DEPRECATED_BOOLEANS_SYNTAX2 = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" + ]; + var DEPRECATED_BASE60_SYNTAX2 = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; + function compileStyleMap2(schema8, map4) { + var result2, keys2, index4, length, tag, style, type3; + if (map4 === null) + return {}; + result2 = {}; + keys2 = Object.keys(map4); + for (index4 = 0, length = keys2.length; index4 < length; index4 += 1) { + tag = keys2[index4]; + style = String(map4[tag]); + if (tag.slice(0, 2) === "!!") { + tag = "tag:yaml.org,2002:" + tag.slice(2); + } + type3 = schema8.compiledTypeMap["fallback"][tag]; + if (type3 && _hasOwnProperty2.call(type3.styleAliases, style)) { + style = type3.styleAliases[style]; + } + result2[tag] = style; + } + return result2; + } + function encodeHex2(character) { + var string2, handle, length; + string2 = character.toString(16).toUpperCase(); + if (character <= 255) { + handle = "x"; + length = 2; + } else if (character <= 65535) { + handle = "u"; + length = 4; + } else if (character <= 4294967295) { + handle = "U"; + length = 8; + } else { + throw new YAMLException2("code point within a string may not be greater than 0xFFFFFFFF"); + } + return "\\" + handle + common3.repeat("0", length - string2.length) + string2; + } + var QUOTING_TYPE_SINGLE2 = 1; + var QUOTING_TYPE_DOUBLE2 = 2; + function State2(options) { + this.schema = options["schema"] || DEFAULT_SCHEMA2; + this.indent = Math.max(1, options["indent"] || 2); + this.noArrayIndent = options["noArrayIndent"] || false; + this.skipInvalid = options["skipInvalid"] || false; + this.flowLevel = common3.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; + this.styleMap = compileStyleMap2(this.schema, options["styles"] || null); + this.sortKeys = options["sortKeys"] || false; + this.lineWidth = options["lineWidth"] || 80; + this.noRefs = options["noRefs"] || false; + this.noCompatMode = options["noCompatMode"] || false; + this.condenseFlow = options["condenseFlow"] || false; + this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE2 : QUOTING_TYPE_SINGLE2; + this.forceQuotes = options["forceQuotes"] || false; + this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; + } + function indentString2(string2, spaces) { + var ind = common3.repeat(" ", spaces), position = 0, next = -1, result2 = "", line, length = string2.length; + while (position < length) { + next = string2.indexOf("\n", position); + if (next === -1) { + line = string2.slice(position); + position = length; + } else { + line = string2.slice(position, next + 1); + position = next + 1; + } + if (line.length && line !== "\n") + result2 += ind; + result2 += line; + } + return result2; + } + function generateNextLine2(state, level) { + return "\n" + common3.repeat(" ", state.indent * level); + } + function testImplicitResolving2(state, str2) { + var index4, length, type3; + for (index4 = 0, length = state.implicitTypes.length; index4 < length; index4 += 1) { + type3 = state.implicitTypes[index4]; + if (type3.resolve(str2)) { + return true; + } + } + return false; + } + function isWhitespace2(c7) { + return c7 === CHAR_SPACE2 || c7 === CHAR_TAB2; + } + function isPrintable2(c7) { + return 32 <= c7 && c7 <= 126 || 161 <= c7 && c7 <= 55295 && c7 !== 8232 && c7 !== 8233 || 57344 <= c7 && c7 <= 65533 && c7 !== CHAR_BOM2 || 65536 <= c7 && c7 <= 1114111; + } + function isNsCharOrWhitespace2(c7) { + return isPrintable2(c7) && c7 !== CHAR_BOM2 && c7 !== CHAR_CARRIAGE_RETURN2 && c7 !== CHAR_LINE_FEED2; + } + function isPlainSafe2(c7, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace2(c7); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace2(c7); + return ( + // ns-plain-safe + (inblock ? ( + // c = flow-in + cIsNsCharOrWhitespace + ) : cIsNsCharOrWhitespace && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2) && c7 !== CHAR_SHARP2 && !(prev === CHAR_COLON2 && !cIsNsChar) || isNsCharOrWhitespace2(prev) && !isWhitespace2(prev) && c7 === CHAR_SHARP2 || prev === CHAR_COLON2 && cIsNsChar + ); + } + function isPlainSafeFirst2(c7) { + return isPrintable2(c7) && c7 !== CHAR_BOM2 && !isWhitespace2(c7) && c7 !== CHAR_MINUS2 && c7 !== CHAR_QUESTION2 && c7 !== CHAR_COLON2 && c7 !== CHAR_COMMA2 && c7 !== CHAR_LEFT_SQUARE_BRACKET2 && c7 !== CHAR_RIGHT_SQUARE_BRACKET2 && c7 !== CHAR_LEFT_CURLY_BRACKET2 && c7 !== CHAR_RIGHT_CURLY_BRACKET2 && c7 !== CHAR_SHARP2 && c7 !== CHAR_AMPERSAND2 && c7 !== CHAR_ASTERISK2 && c7 !== CHAR_EXCLAMATION2 && c7 !== CHAR_VERTICAL_LINE2 && c7 !== CHAR_EQUALS2 && c7 !== CHAR_GREATER_THAN2 && c7 !== CHAR_SINGLE_QUOTE2 && c7 !== CHAR_DOUBLE_QUOTE2 && c7 !== CHAR_PERCENT2 && c7 !== CHAR_COMMERCIAL_AT2 && c7 !== CHAR_GRAVE_ACCENT2; + } + function isPlainSafeLast2(c7) { + return !isWhitespace2(c7) && c7 !== CHAR_COLON2; + } + function codePointAt2(string2, pos) { + var first = string2.charCodeAt(pos), second; + if (first >= 55296 && first <= 56319 && pos + 1 < string2.length) { + second = string2.charCodeAt(pos + 1); + if (second >= 56320 && second <= 57343) { + return (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return first; + } + function needIndentIndicator2(string2) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string2); + } + var STYLE_PLAIN2 = 1; + var STYLE_SINGLE2 = 2; + var STYLE_LITERAL2 = 3; + var STYLE_FOLDED2 = 4; + var STYLE_DOUBLE2 = 5; + function chooseScalarStyle2(string2, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) { + var i7; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst2(codePointAt2(string2, 0)) && isPlainSafeLast2(codePointAt2(string2, string2.length - 1)); + if (singleLineOnly || forceQuotes) { + for (i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt2(string2, i7); + if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + plain = plain && isPlainSafe2(char, prevChar, inblock); + prevChar = char; + } + } else { + for (i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt2(string2, i7); + if (char === CHAR_LINE_FEED2) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. + i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "; + previousLineBreak = i7; + } + } else if (!isPrintable2(char)) { + return STYLE_DOUBLE2; + } + plain = plain && isPlainSafe2(char, prevChar, inblock); + prevChar = char; + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "); + } + if (!hasLineBreak && !hasFoldableLine) { + if (plain && !forceQuotes && !testAmbiguousType(string2)) { + return STYLE_PLAIN2; + } + return quotingType === QUOTING_TYPE_DOUBLE2 ? STYLE_DOUBLE2 : STYLE_SINGLE2; + } + if (indentPerLevel > 9 && needIndentIndicator2(string2)) { + return STYLE_DOUBLE2; + } + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED2 : STYLE_LITERAL2; + } + return quotingType === QUOTING_TYPE_DOUBLE2 ? STYLE_DOUBLE2 : STYLE_SINGLE2; + } + function writeScalar2(state, string2, level, iskey, inblock) { + state.dump = function() { + if (string2.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE2 ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX2.indexOf(string2) !== -1 || DEPRECATED_BASE60_SYNTAX2.test(string2)) { + return state.quotingType === QUOTING_TYPE_DOUBLE2 ? '"' + string2 + '"' : "'" + string2 + "'"; + } + } + var indent = state.indent * Math.max(1, level); + var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; + function testAmbiguity(string3) { + return testImplicitResolving2(state, string3); + } + switch (chooseScalarStyle2( + string2, + singleLineOnly, + state.indent, + lineWidth, + testAmbiguity, + state.quotingType, + state.forceQuotes && !iskey, + inblock + )) { + case STYLE_PLAIN2: + return string2; + case STYLE_SINGLE2: + return "'" + string2.replace(/'/g, "''") + "'"; + case STYLE_LITERAL2: + return "|" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(string2, indent)); + case STYLE_FOLDED2: + return ">" + blockHeader2(string2, state.indent) + dropEndingNewline2(indentString2(foldString2(string2, lineWidth), indent)); + case STYLE_DOUBLE2: + return '"' + escapeString2(string2, lineWidth) + '"'; + default: + throw new YAMLException2("impossible error: invalid scalar style"); + } + }(); + } + function blockHeader2(string2, indentPerLevel) { + var indentIndicator = needIndentIndicator2(string2) ? String(indentPerLevel) : ""; + var clip = string2[string2.length - 1] === "\n"; + var keep = clip && (string2[string2.length - 2] === "\n" || string2 === "\n"); + var chomp = keep ? "+" : clip ? "" : "-"; + return indentIndicator + chomp + "\n"; + } + function dropEndingNewline2(string2) { + return string2[string2.length - 1] === "\n" ? string2.slice(0, -1) : string2; + } + function foldString2(string2, width) { + var lineRe = /(\n+)([^\n]*)/g; + var result2 = function() { + var nextLF = string2.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string2.length; + lineRe.lastIndex = nextLF; + return foldLine2(string2.slice(0, nextLF), width); + }(); + var prevMoreIndented = string2[0] === "\n" || string2[0] === " "; + var moreIndented; + var match; + while (match = lineRe.exec(string2)) { + var prefix = match[1], line = match[2]; + moreIndented = line[0] === " "; + result2 += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine2(line, width); + prevMoreIndented = moreIndented; + } + return result2; + } + function foldLine2(line, width) { + if (line === "" || line[0] === " ") + return line; + var breakRe = / [^ ]/g; + var match; + var start = 0, end, curr = 0, next = 0; + var result2 = ""; + while (match = breakRe.exec(line)) { + next = match.index; + if (next - start > width) { + end = curr > start ? curr : next; + result2 += "\n" + line.slice(start, end); + start = end + 1; + } + curr = next; + } + result2 += "\n"; + if (line.length - start > width && curr > start) { + result2 += line.slice(start, curr) + "\n" + line.slice(curr + 1); + } else { + result2 += line.slice(start); + } + return result2.slice(1); + } + function escapeString2(string2) { + var result2 = ""; + var char = 0; + var escapeSeq; + for (var i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt2(string2, i7); + escapeSeq = ESCAPE_SEQUENCES2[char]; + if (!escapeSeq && isPrintable2(char)) { + result2 += string2[i7]; + if (char >= 65536) + result2 += string2[i7 + 1]; + } else { + result2 += escapeSeq || encodeHex2(char); + } + } + return result2; + } + function writeFlowSequence2(state, level, object) { + var _result = "", _tag = state.tag, index4, length, value2; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + value2 = object[index4]; + if (state.replacer) { + value2 = state.replacer.call(object, String(index4), value2); + } + if (writeNode2(state, level, value2, false, false) || typeof value2 === "undefined" && writeNode2(state, level, null, false, false)) { + if (_result !== "") + _result += "," + (!state.condenseFlow ? " " : ""); + _result += state.dump; + } + } + state.tag = _tag; + state.dump = "[" + _result + "]"; + } + function writeBlockSequence2(state, level, object, compact2) { + var _result = "", _tag = state.tag, index4, length, value2; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + value2 = object[index4]; + if (state.replacer) { + value2 = state.replacer.call(object, String(index4), value2); + } + if (writeNode2(state, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode2(state, level + 1, null, true, true, false, true)) { + if (!compact2 || _result !== "") { + _result += generateNextLine2(state, level); + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state.dump; + } + } + state.tag = _tag; + state.dump = _result || "[]"; + } + function writeFlowMapping2(state, level, object) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, pairBuffer; + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (_result !== "") + pairBuffer += ", "; + if (state.condenseFlow) + pairBuffer += '"'; + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode2(state, level, objectKey, false, false)) { + continue; + } + if (state.dump.length > 1024) + pairBuffer += "? "; + pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " "); + if (!writeNode2(state, level, objectValue, false, false)) { + continue; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = "{" + _result + "}"; + } + function writeBlockMapping2(state, level, object, compact2) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, explicitPair, pairBuffer; + if (state.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state.sortKeys === "function") { + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + throw new YAMLException2("sortKeys must be a boolean or a function"); + } + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (!compact2 || _result !== "") { + pairBuffer += generateNextLine2(state, level); + } + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode2(state, level + 1, objectKey, true, true, true)) { + continue; + } + explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; + } + } + pairBuffer += state.dump; + if (explicitPair) { + pairBuffer += generateNextLine2(state, level); + } + if (!writeNode2(state, level + 1, objectValue, true, explicitPair)) { + continue; + } + if (state.dump && CHAR_LINE_FEED2 === state.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = _result || "{}"; + } + function detectType2(state, object, explicit) { + var _result, typeList, index4, length, type3, style; + typeList = explicit ? state.explicitTypes : state.implicitTypes; + for (index4 = 0, length = typeList.length; index4 < length; index4 += 1) { + type3 = typeList[index4]; + if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object === "object" && object instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object))) { + if (explicit) { + if (type3.multi && type3.representName) { + state.tag = type3.representName(object); + } else { + state.tag = type3.tag; + } + } else { + state.tag = "?"; + } + if (type3.represent) { + style = state.styleMap[type3.tag] || type3.defaultStyle; + if (_toString2.call(type3.represent) === "[object Function]") { + _result = type3.represent(object, style); + } else if (_hasOwnProperty2.call(type3.represent, style)) { + _result = type3.represent[style](object, style); + } else { + throw new YAMLException2("!<" + type3.tag + '> tag resolver accepts not "' + style + '" style'); + } + state.dump = _result; + } + return true; + } + } + return false; + } + function writeNode2(state, level, object, block, compact2, iskey, isblockseq) { + state.tag = null; + state.dump = object; + if (!detectType2(state, object, false)) { + detectType2(state, object, true); + } + var type3 = _toString2.call(state.dump); + var inblock = block; + var tagStr; + if (block) { + block = state.flowLevel < 0 || state.flowLevel > level; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block && Object.keys(state.dump).length !== 0) { + writeBlockMapping2(state, level, state.dump, compact2); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowMapping2(state, level, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object Array]") { + if (block && state.dump.length !== 0) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence2(state, level - 1, state.dump, compact2); + } else { + writeBlockSequence2(state, level, state.dump, compact2); + } + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowSequence2(state, level, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object String]") { + if (state.tag !== "?") { + writeScalar2(state, state.dump, level, iskey, inblock); + } + } else if (type3 === "[object Undefined]") { + return false; + } else { + if (state.skipInvalid) + return false; + throw new YAMLException2("unacceptable kind of an object to dump " + type3); + } + if (state.tag !== null && state.tag !== "?") { + tagStr = encodeURI( + state.tag[0] === "!" ? state.tag.slice(1) : state.tag + ).replace(/!/g, "%21"); + if (state.tag[0] === "!") { + tagStr = "!" + tagStr; + } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") { + tagStr = "!!" + tagStr.slice(18); + } else { + tagStr = "!<" + tagStr + ">"; + } + state.dump = tagStr + " " + state.dump; + } + } + return true; + } + function getDuplicateReferences2(object, state) { + var objects = [], duplicatesIndexes = [], index4, length; + inspectNode2(object, objects, duplicatesIndexes); + for (index4 = 0, length = duplicatesIndexes.length; index4 < length; index4 += 1) { + state.duplicates.push(objects[duplicatesIndexes[index4]]); + } + state.usedDuplicates = new Array(length); + } + function inspectNode2(object, objects, duplicatesIndexes) { + var objectKeyList, index4, length; + if (object !== null && typeof object === "object") { + index4 = objects.indexOf(object); + if (index4 !== -1) { + if (duplicatesIndexes.indexOf(index4) === -1) { + duplicatesIndexes.push(index4); + } + } else { + objects.push(object); + if (Array.isArray(object)) { + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + inspectNode2(object[index4], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + inspectNode2(object[objectKeyList[index4]], objects, duplicatesIndexes); + } + } + } + } + } + function dump2(input, options) { + options = options || {}; + var state = new State2(options); + if (!state.noRefs) + getDuplicateReferences2(input, state); + var value2 = input; + if (state.replacer) { + value2 = state.replacer.call({ "": value2 }, "", value2); + } + if (writeNode2(state, 0, value2, true, true)) + return state.dump + "\n"; + return ""; + } + module5.exports.dump = dump2; + } +}); + +// node_modules/js-yaml/index.js +var require_js_yaml3 = __commonJS({ + "node_modules/js-yaml/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var loader2 = require_loader3(); + var dumper2 = require_dumper3(); + function renamed2(from, to) { + return function() { + throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); + }; + } + module5.exports.Type = require_type5(); + module5.exports.Schema = require_schema7(); + module5.exports.FAILSAFE_SCHEMA = require_failsafe3(); + module5.exports.JSON_SCHEMA = require_json5(); + module5.exports.CORE_SCHEMA = require_core9(); + module5.exports.DEFAULT_SCHEMA = require_default2(); + module5.exports.load = loader2.load; + module5.exports.loadAll = loader2.loadAll; + module5.exports.dump = dumper2.dump; + module5.exports.YAMLException = require_exception3(); + module5.exports.types = { + binary: require_binary3(), + float: require_float4(), + map: require_map3(), + null: require_null3(), + pairs: require_pairs3(), + set: require_set3(), + timestamp: require_timestamp3(), + bool: require_bool3(), + int: require_int3(), + merge: require_merge3(), + omap: require_omap3(), + seq: require_seq3(), + str: require_str3() + }; + module5.exports.safeLoad = renamed2("safeLoad", "load"); + module5.exports.safeLoadAll = renamed2("safeLoadAll", "loadAll"); + module5.exports.safeDump = renamed2("safeDump", "dump"); + } +}); + +// node_modules/typescript/lib/typescript.js +var require_typescript2 = __commonJS({ + "node_modules/typescript/lib/typescript.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var ts = (() => { + var __defProp2 = Object.defineProperty; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __esm2 = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res; + }; + var __commonJS2 = (cb, mod2) => function __require2() { + return mod2 || (0, cb[__getOwnPropNames2(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; + }; + var __export2 = (target, all) => { + for (var name2 in all) + __defProp2(target, name2, { get: all[name2], enumerable: true }); + }; + var versionMajorMinor, version5, Comparison; + var init_corePublic = __esm2({ + "src/compiler/corePublic.ts"() { + "use strict"; + versionMajorMinor = "5.4"; + version5 = "5.4.5"; + Comparison = /* @__PURE__ */ ((Comparison3) => { + Comparison3[Comparison3["LessThan"] = -1] = "LessThan"; + Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo"; + Comparison3[Comparison3["GreaterThan"] = 1] = "GreaterThan"; + return Comparison3; + })(Comparison || {}); + } + }); + function length(array) { + return array ? array.length : 0; + } + function forEach4(array, callback) { + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + return void 0; + } + function forEachRight2(array, callback) { + if (array) { + for (let i7 = array.length - 1; i7 >= 0; i7--) { + const result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + return void 0; + } + function firstDefined(array, callback) { + if (array === void 0) { + return void 0; + } + for (let i7 = 0; i7 < array.length; i7++) { + const result2 = callback(array[i7], i7); + if (result2 !== void 0) { + return result2; + } + } + return void 0; + } + function firstDefinedIterator(iter, callback) { + for (const value2 of iter) { + const result2 = callback(value2); + if (result2 !== void 0) { + return result2; + } + } + return void 0; + } + function reduceLeftIterator(iterator, f8, initial2) { + let result2 = initial2; + if (iterator) { + let pos = 0; + for (const value2 of iterator) { + result2 = f8(result2, value2, pos); + pos++; + } + } + return result2; + } + function zipWith2(arrayA, arrayB, callback) { + const result2 = []; + Debug.assertEqual(arrayA.length, arrayB.length); + for (let i7 = 0; i7 < arrayA.length; i7++) { + result2.push(callback(arrayA[i7], arrayB[i7], i7)); + } + return result2; + } + function intersperse(input, element) { + if (input.length <= 1) { + return input; + } + const result2 = []; + for (let i7 = 0, n7 = input.length; i7 < n7; i7++) { + if (i7) + result2.push(element); + result2.push(input[i7]); + } + return result2; + } + function every2(array, callback) { + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + if (!callback(array[i7], i7)) { + return false; + } + } + } + return true; + } + function find2(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (let i7 = startIndex ?? 0; i7 < array.length; i7++) { + const value2 = array[i7]; + if (predicate(value2, i7)) { + return value2; + } + } + return void 0; + } + function findLast2(array, predicate, startIndex) { + if (array === void 0) + return void 0; + for (let i7 = startIndex ?? array.length - 1; i7 >= 0; i7--) { + const value2 = array[i7]; + if (predicate(value2, i7)) { + return value2; + } + } + return void 0; + } + function findIndex2(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (let i7 = startIndex ?? 0; i7 < array.length; i7++) { + if (predicate(array[i7], i7)) { + return i7; + } + } + return -1; + } + function findLastIndex2(array, predicate, startIndex) { + if (array === void 0) + return -1; + for (let i7 = startIndex ?? array.length - 1; i7 >= 0; i7--) { + if (predicate(array[i7], i7)) { + return i7; + } + } + return -1; + } + function findMap(array, callback) { + for (let i7 = 0; i7 < array.length; i7++) { + const result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + return Debug.fail(); + } + function contains2(array, value2, equalityComparer = equateValues) { + if (array) { + for (const v8 of array) { + if (equalityComparer(v8, value2)) { + return true; + } + } + } + return false; + } + function arraysEqual(a7, b8, equalityComparer = equateValues) { + return a7.length === b8.length && a7.every((x7, i7) => equalityComparer(x7, b8[i7])); + } + function indexOfAnyCharCode(text, charCodes, start) { + for (let i7 = start || 0; i7 < text.length; i7++) { + if (contains2(charCodes, text.charCodeAt(i7))) { + return i7; + } + } + return -1; + } + function countWhere(array, predicate) { + let count2 = 0; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const v8 = array[i7]; + if (predicate(v8, i7)) { + count2++; + } + } + } + return count2; + } + function filter2(array, f8) { + if (array) { + const len = array.length; + let i7 = 0; + while (i7 < len && f8(array[i7])) + i7++; + if (i7 < len) { + const result2 = array.slice(0, i7); + i7++; + while (i7 < len) { + const item = array[i7]; + if (f8(item)) { + result2.push(item); + } + i7++; + } + return result2; + } + } + return array; + } + function filterMutate(array, f8) { + let outIndex = 0; + for (let i7 = 0; i7 < array.length; i7++) { + if (f8(array[i7], i7, array)) { + array[outIndex] = array[i7]; + outIndex++; + } + } + array.length = outIndex; + } + function clear2(array) { + array.length = 0; + } + function map4(array, f8) { + let result2; + if (array) { + result2 = []; + for (let i7 = 0; i7 < array.length; i7++) { + result2.push(f8(array[i7], i7)); + } + } + return result2; + } + function* mapIterator(iter, mapFn) { + for (const x7 of iter) { + yield mapFn(x7); + } + } + function sameMap(array, f8) { + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const item = array[i7]; + const mapped = f8(item, i7); + if (item !== mapped) { + const result2 = array.slice(0, i7); + result2.push(mapped); + for (i7++; i7 < array.length; i7++) { + result2.push(f8(array[i7], i7)); + } + return result2; + } + } + } + return array; + } + function flatten2(array) { + const result2 = []; + for (const v8 of array) { + if (v8) { + if (isArray3(v8)) { + addRange(result2, v8); + } else { + result2.push(v8); + } + } + } + return result2; + } + function flatMap2(array, mapfn) { + let result2; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const v8 = mapfn(array[i7], i7); + if (v8) { + if (isArray3(v8)) { + result2 = addRange(result2, v8); + } else { + result2 = append(result2, v8); + } + } + } + } + return result2 || emptyArray; + } + function flatMapToMutable(array, mapfn) { + const result2 = []; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const v8 = mapfn(array[i7], i7); + if (v8) { + if (isArray3(v8)) { + addRange(result2, v8); + } else { + result2.push(v8); + } + } + } + } + return result2; + } + function* flatMapIterator(iter, mapfn) { + for (const x7 of iter) { + const iter2 = mapfn(x7); + if (!iter2) + continue; + yield* iter2; + } + } + function sameFlatMap(array, mapfn) { + let result2; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const item = array[i7]; + const mapped = mapfn(item, i7); + if (result2 || item !== mapped || isArray3(mapped)) { + if (!result2) { + result2 = array.slice(0, i7); + } + if (isArray3(mapped)) { + addRange(result2, mapped); + } else { + result2.push(mapped); + } + } + } + } + return result2 || array; + } + function mapAllOrFail(array, mapFn) { + const result2 = []; + for (let i7 = 0; i7 < array.length; i7++) { + const mapped = mapFn(array[i7], i7); + if (mapped === void 0) { + return void 0; + } + result2.push(mapped); + } + return result2; + } + function mapDefined(array, mapFn) { + const result2 = []; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const mapped = mapFn(array[i7], i7); + if (mapped !== void 0) { + result2.push(mapped); + } + } + } + return result2; + } + function* mapDefinedIterator(iter, mapFn) { + for (const x7 of iter) { + const value2 = mapFn(x7); + if (value2 !== void 0) { + yield value2; + } + } + } + function mapDefinedEntries(map22, f8) { + if (!map22) { + return void 0; + } + const result2 = /* @__PURE__ */ new Map(); + map22.forEach((value2, key) => { + const entry = f8(key, value2); + if (entry !== void 0) { + const [newKey, newValue] = entry; + if (newKey !== void 0 && newValue !== void 0) { + result2.set(newKey, newValue); + } + } + }); + return result2; + } + function getOrUpdate(map22, key, callback) { + if (map22.has(key)) { + return map22.get(key); + } + const value2 = callback(); + map22.set(key, value2); + return value2; + } + function tryAddToSet(set4, value2) { + if (!set4.has(value2)) { + set4.add(value2); + return true; + } + return false; + } + function* singleIterator(value2) { + yield value2; + } + function spanMap(array, keyfn, mapfn) { + let result2; + if (array) { + result2 = []; + const len = array.length; + let previousKey; + let key; + let start = 0; + let pos = 0; + while (start < len) { + while (pos < len) { + const value2 = array[pos]; + key = keyfn(value2, pos); + if (pos === 0) { + previousKey = key; + } else if (key !== previousKey) { + break; + } + pos++; + } + if (start < pos) { + const v8 = mapfn(array.slice(start, pos), previousKey, start, pos); + if (v8) { + result2.push(v8); + } + start = pos; + } + previousKey = key; + pos++; + } + } + return result2; + } + function mapEntries(map22, f8) { + if (!map22) { + return void 0; + } + const result2 = /* @__PURE__ */ new Map(); + map22.forEach((value2, key) => { + const [newKey, newValue] = f8(key, value2); + result2.set(newKey, newValue); + }); + return result2; + } + function some2(array, predicate) { + if (array) { + if (predicate) { + for (const v8 of array) { + if (predicate(v8)) { + return true; + } + } + } else { + return array.length > 0; + } + } + return false; + } + function getRangesWhere(arr, pred, cb) { + let start; + for (let i7 = 0; i7 < arr.length; i7++) { + if (pred(arr[i7])) { + start = start === void 0 ? i7 : start; + } else { + if (start !== void 0) { + cb(start, i7); + start = void 0; + } + } + } + if (start !== void 0) + cb(start, arr.length); + } + function concatenate(array1, array2) { + if (!some2(array2)) + return array1; + if (!some2(array1)) + return array2; + return [...array1, ...array2]; + } + function selectIndex(_6, i7) { + return i7; + } + function indicesOf(array) { + return array.map(selectIndex); + } + function deduplicateRelational(array, equalityComparer, comparer) { + const indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + let last22 = array[indices[0]]; + const deduplicated = [indices[0]]; + for (let i7 = 1; i7 < indices.length; i7++) { + const index4 = indices[i7]; + const item = array[index4]; + if (!equalityComparer(last22, item)) { + deduplicated.push(index4); + last22 = item; + } + } + deduplicated.sort(); + return deduplicated.map((i7) => array[i7]); + } + function deduplicateEquality(array, equalityComparer) { + const result2 = []; + for (const item of array) { + pushIfUnique(result2, item, equalityComparer); + } + return result2; + } + function deduplicate(array, equalityComparer, comparer) { + return array.length === 0 ? [] : array.length === 1 ? array.slice() : comparer ? deduplicateRelational(array, equalityComparer, comparer) : deduplicateEquality(array, equalityComparer); + } + function deduplicateSorted(array, comparer) { + if (array.length === 0) + return emptyArray; + let last22 = array[0]; + const deduplicated = [last22]; + for (let i7 = 1; i7 < array.length; i7++) { + const next = array[i7]; + switch (comparer(next, last22)) { + case true: + case 0: + continue; + case -1: + return Debug.fail("Array is unsorted."); + } + deduplicated.push(last22 = next); + } + return deduplicated; + } + function createSortedArray() { + return []; + } + function insertSorted(array, insert, compare, allowDuplicates) { + if (array.length === 0) { + array.push(insert); + return true; + } + const insertIndex = binarySearch(array, insert, identity2, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + return true; + } + if (allowDuplicates) { + array.splice(insertIndex, 0, insert); + return true; + } + return false; + } + function sortAndDeduplicate(array, comparer, equalityComparer) { + return deduplicateSorted(sort(array, comparer), equalityComparer || comparer || compareStringsCaseSensitive); + } + function arrayIsSorted(array, comparer) { + if (array.length < 2) + return true; + for (let i7 = 1, len = array.length; i7 < len; i7++) { + if (comparer(array[i7 - 1], array[i7]) === 1) { + return false; + } + } + return true; + } + function detectSortCaseSensitivity(array, getString, compareStringsCaseSensitive2, compareStringsCaseInsensitive2) { + let kind = 3; + if (array.length < 2) + return kind; + let prevElement = getString(array[0]); + for (let i7 = 1, len = array.length; i7 < len && kind !== 0; i7++) { + const element = getString(array[i7]); + if (kind & 1 && compareStringsCaseSensitive2(prevElement, element) > 0) { + kind &= ~1; + } + if (kind & 2 && compareStringsCaseInsensitive2(prevElement, element) > 0) { + kind &= ~2; + } + prevElement = element; + } + return kind; + } + function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) { + if (!array1 || !array2) { + return array1 === array2; + } + if (array1.length !== array2.length) { + return false; + } + for (let i7 = 0; i7 < array1.length; i7++) { + if (!equalityComparer(array1[i7], array2[i7], i7)) { + return false; + } + } + return true; + } + function compact2(array) { + let result2; + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + const v8 = array[i7]; + if (result2 || !v8) { + if (!result2) { + result2 = array.slice(0, i7); + } + if (v8) { + result2.push(v8); + } + } + } + } + return result2 || array; + } + function relativeComplement(arrayA, arrayB, comparer) { + if (!arrayB || !arrayA || arrayB.length === 0 || arrayA.length === 0) + return arrayB; + const result2 = []; + loopB: + for (let offsetA = 0, offsetB = 0; offsetB < arrayB.length; offsetB++) { + if (offsetB > 0) { + Debug.assertGreaterThanOrEqual( + comparer(arrayB[offsetB], arrayB[offsetB - 1]), + 0 + /* EqualTo */ + ); + } + loopA: + for (const startA = offsetA; offsetA < arrayA.length; offsetA++) { + if (offsetA > startA) { + Debug.assertGreaterThanOrEqual( + comparer(arrayA[offsetA], arrayA[offsetA - 1]), + 0 + /* EqualTo */ + ); + } + switch (comparer(arrayB[offsetB], arrayA[offsetA])) { + case -1: + result2.push(arrayB[offsetB]); + continue loopB; + case 0: + continue loopB; + case 1: + continue loopA; + } + } + } + return result2; + } + function append(to, value2) { + if (value2 === void 0) + return to; + if (to === void 0) + return [value2]; + to.push(value2); + return to; + } + function combine(xs, ys) { + if (xs === void 0) + return ys; + if (ys === void 0) + return xs; + if (isArray3(xs)) + return isArray3(ys) ? concatenate(xs, ys) : append(xs, ys); + if (isArray3(ys)) + return append(ys, xs); + return [xs, ys]; + } + function toOffset(array, offset) { + return offset < 0 ? array.length + offset : offset; + } + function addRange(to, from, start, end) { + if (from === void 0 || from.length === 0) + return to; + if (to === void 0) + return from.slice(start, end); + start = start === void 0 ? 0 : toOffset(from, start); + end = end === void 0 ? from.length : toOffset(from, end); + for (let i7 = start; i7 < end && i7 < from.length; i7++) { + if (from[i7] !== void 0) { + to.push(from[i7]); + } + } + return to; + } + function pushIfUnique(array, toAdd, equalityComparer) { + if (contains2(array, toAdd, equalityComparer)) { + return false; + } else { + array.push(toAdd); + return true; + } + } + function appendIfUnique(array, toAdd, equalityComparer) { + if (array) { + pushIfUnique(array, toAdd, equalityComparer); + return array; + } else { + return [toAdd]; + } + } + function stableSortIndices(array, indices, comparer) { + indices.sort((x7, y7) => comparer(array[x7], array[y7]) || compareValues(x7, y7)); + } + function sort(array, comparer) { + return array.length === 0 ? array : array.slice().sort(comparer); + } + function* arrayReverseIterator(array) { + for (let i7 = array.length - 1; i7 >= 0; i7--) { + yield array[i7]; + } + } + function stableSort(array, comparer) { + const indices = indicesOf(array); + stableSortIndices(array, indices, comparer); + return indices.map((i7) => array[i7]); + } + function rangeEquals(array1, array2, pos, end) { + while (pos < end) { + if (array1[pos] !== array2[pos]) { + return false; + } + pos++; + } + return true; + } + function firstOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[0]; + } + function firstOrUndefinedIterator(iter) { + if (iter) { + for (const value2 of iter) { + return value2; + } + } + return void 0; + } + function first(array) { + Debug.assert(array.length !== 0); + return array[0]; + } + function firstIterator(iter) { + for (const value2 of iter) { + return value2; + } + Debug.fail("iterator is empty"); + } + function lastOrUndefined(array) { + return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; + } + function last2(array) { + Debug.assert(array.length !== 0); + return array[array.length - 1]; + } + function singleOrUndefined(array) { + return array && array.length === 1 ? array[0] : void 0; + } + function single(array) { + return Debug.checkDefined(singleOrUndefined(array)); + } + function singleOrMany(array) { + return array && array.length === 1 ? array[0] : array; + } + function replaceElement(array, index4, value2) { + const result2 = array.slice(0); + result2[index4] = value2; + return result2; + } + function binarySearch(array, value2, keySelector, keyComparer, offset) { + return binarySearchKey(array, keySelector(value2), keySelector, keyComparer, offset); + } + function binarySearchKey(array, key, keySelector, keyComparer, offset) { + if (!some2(array)) { + return -1; + } + let low = offset || 0; + let high = array.length - 1; + while (low <= high) { + const middle = low + (high - low >> 1); + const midKey = keySelector(array[middle], middle); + switch (keyComparer(midKey, key)) { + case -1: + low = middle + 1; + break; + case 0: + return middle; + case 1: + high = middle - 1; + break; + } + } + return ~low; + } + function reduceLeft(array, f8, initial2, start, count2) { + if (array && array.length > 0) { + const size2 = array.length; + if (size2 > 0) { + let pos = start === void 0 || start < 0 ? 0 : start; + const end = count2 === void 0 || pos + count2 > size2 - 1 ? size2 - 1 : pos + count2; + let result2; + if (arguments.length <= 2) { + result2 = array[pos]; + pos++; + } else { + result2 = initial2; + } + while (pos <= end) { + result2 = f8(result2, array[pos], pos); + pos++; + } + return result2; + } + } + return initial2; + } + function hasProperty(map22, key) { + return hasOwnProperty27.call(map22, key); + } + function getProperty(map22, key) { + return hasOwnProperty27.call(map22, key) ? map22[key] : void 0; + } + function getOwnKeys(map22) { + const keys2 = []; + for (const key in map22) { + if (hasOwnProperty27.call(map22, key)) { + keys2.push(key); + } + } + return keys2; + } + function getAllKeys2(obj) { + const result2 = []; + do { + const names = Object.getOwnPropertyNames(obj); + for (const name2 of names) { + pushIfUnique(result2, name2); + } + } while (obj = Object.getPrototypeOf(obj)); + return result2; + } + function getOwnValues(collection) { + const values2 = []; + for (const key in collection) { + if (hasOwnProperty27.call(collection, key)) { + values2.push(collection[key]); + } + } + return values2; + } + function arrayOf(count2, f8) { + const result2 = new Array(count2); + for (let i7 = 0; i7 < count2; i7++) { + result2[i7] = f8(i7); + } + return result2; + } + function arrayFrom(iterator, map22) { + const result2 = []; + for (const value2 of iterator) { + result2.push(map22 ? map22(value2) : value2); + } + return result2; + } + function assign3(t8, ...args) { + for (const arg of args) { + if (arg === void 0) + continue; + for (const p7 in arg) { + if (hasProperty(arg, p7)) { + t8[p7] = arg[p7]; + } + } + } + return t8; + } + function equalOwnProperties(left, right, equalityComparer = equateValues) { + if (left === right) + return true; + if (!left || !right) + return false; + for (const key in left) { + if (hasOwnProperty27.call(left, key)) { + if (!hasOwnProperty27.call(right, key)) + return false; + if (!equalityComparer(left[key], right[key])) + return false; + } + } + for (const key in right) { + if (hasOwnProperty27.call(right, key)) { + if (!hasOwnProperty27.call(left, key)) + return false; + } + } + return true; + } + function arrayToMap(array, makeKey, makeValue = identity2) { + const result2 = /* @__PURE__ */ new Map(); + for (const value2 of array) { + const key = makeKey(value2); + if (key !== void 0) + result2.set(key, makeValue(value2)); + } + return result2; + } + function arrayToNumericMap(array, makeKey, makeValue = identity2) { + const result2 = []; + for (const value2 of array) { + result2[makeKey(value2)] = makeValue(value2); + } + return result2; + } + function arrayToMultiMap(values2, makeKey, makeValue = identity2) { + const result2 = createMultiMap(); + for (const value2 of values2) { + result2.add(makeKey(value2), makeValue(value2)); + } + return result2; + } + function group2(values2, getGroupId, resultSelector = identity2) { + return arrayFrom(arrayToMultiMap(values2, getGroupId).values(), resultSelector); + } + function groupBy2(values2, keySelector) { + const result2 = {}; + if (values2) { + for (const value2 of values2) { + const key = `${keySelector(value2)}`; + const array = result2[key] ?? (result2[key] = []); + array.push(value2); + } + } + return result2; + } + function clone2(object) { + const result2 = {}; + for (const id in object) { + if (hasOwnProperty27.call(object, id)) { + result2[id] = object[id]; + } + } + return result2; + } + function extend3(first2, second) { + const result2 = {}; + for (const id in second) { + if (hasOwnProperty27.call(second, id)) { + result2[id] = second[id]; + } + } + for (const id in first2) { + if (hasOwnProperty27.call(first2, id)) { + result2[id] = first2[id]; + } + } + return result2; + } + function copyProperties(first2, second) { + for (const id in second) { + if (hasOwnProperty27.call(second, id)) { + first2[id] = second[id]; + } + } + } + function maybeBind(obj, fn) { + return fn ? fn.bind(obj) : void 0; + } + function createMultiMap() { + const map22 = /* @__PURE__ */ new Map(); + map22.add = multiMapAdd; + map22.remove = multiMapRemove; + return map22; + } + function multiMapAdd(key, value2) { + let values2 = this.get(key); + if (values2) { + values2.push(value2); + } else { + this.set(key, values2 = [value2]); + } + return values2; + } + function multiMapRemove(key, value2) { + const values2 = this.get(key); + if (values2) { + unorderedRemoveItem(values2, value2); + if (!values2.length) { + this.delete(key); + } + } + } + function createQueue(items) { + const elements = (items == null ? void 0 : items.slice()) || []; + let headIndex = 0; + function isEmpty4() { + return headIndex === elements.length; + } + function enqueue(...items2) { + elements.push(...items2); + } + function dequeue() { + if (isEmpty4()) { + throw new Error("Queue is empty"); + } + const result2 = elements[headIndex]; + elements[headIndex] = void 0; + headIndex++; + if (headIndex > 100 && headIndex > elements.length >> 1) { + const newLength = elements.length - headIndex; + elements.copyWithin( + /*target*/ + 0, + /*start*/ + headIndex + ); + elements.length = newLength; + headIndex = 0; + } + return result2; + } + return { + enqueue, + dequeue, + isEmpty: isEmpty4 + }; + } + function createSet2(getHashCode, equals) { + const multiMap = /* @__PURE__ */ new Map(); + let size2 = 0; + function* getElementIterator() { + for (const value2 of multiMap.values()) { + if (isArray3(value2)) { + yield* value2; + } else { + yield value2; + } + } + } + const set4 = { + has(element) { + const hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + const candidates = multiMap.get(hash); + if (!isArray3(candidates)) + return equals(candidates, element); + for (const candidate of candidates) { + if (equals(candidate, element)) { + return true; + } + } + return false; + }, + add(element) { + const hash = getHashCode(element); + if (multiMap.has(hash)) { + const values2 = multiMap.get(hash); + if (isArray3(values2)) { + if (!contains2(values2, element, equals)) { + values2.push(element); + size2++; + } + } else { + const value2 = values2; + if (!equals(value2, element)) { + multiMap.set(hash, [value2, element]); + size2++; + } + } + } else { + multiMap.set(hash, element); + size2++; + } + return this; + }, + delete(element) { + const hash = getHashCode(element); + if (!multiMap.has(hash)) + return false; + const candidates = multiMap.get(hash); + if (isArray3(candidates)) { + for (let i7 = 0; i7 < candidates.length; i7++) { + if (equals(candidates[i7], element)) { + if (candidates.length === 1) { + multiMap.delete(hash); + } else if (candidates.length === 2) { + multiMap.set(hash, candidates[1 - i7]); + } else { + unorderedRemoveItemAt(candidates, i7); + } + size2--; + return true; + } + } + } else { + const candidate = candidates; + if (equals(candidate, element)) { + multiMap.delete(hash); + size2--; + return true; + } + } + return false; + }, + clear() { + multiMap.clear(); + size2 = 0; + }, + get size() { + return size2; + }, + forEach(action) { + for (const elements of arrayFrom(multiMap.values())) { + if (isArray3(elements)) { + for (const element of elements) { + action(element, element, set4); + } + } else { + const element = elements; + action(element, element, set4); + } + } + }, + keys() { + return getElementIterator(); + }, + values() { + return getElementIterator(); + }, + *entries() { + for (const value2 of getElementIterator()) { + yield [value2, value2]; + } + }, + [Symbol.iterator]: () => { + return getElementIterator(); + }, + [Symbol.toStringTag]: multiMap[Symbol.toStringTag] + }; + return set4; + } + function isArray3(value2) { + return Array.isArray(value2); + } + function toArray3(value2) { + return isArray3(value2) ? value2 : [value2]; + } + function isString4(text) { + return typeof text === "string"; + } + function isNumber3(x7) { + return typeof x7 === "number"; + } + function tryCast(value2, test) { + return value2 !== void 0 && test(value2) ? value2 : void 0; + } + function cast(value2, test) { + if (value2 !== void 0 && test(value2)) + return value2; + return Debug.fail(`Invalid cast. The supplied value ${value2} did not pass the test '${Debug.getFunctionName(test)}'.`); + } + function noop4(_6) { + } + function returnFalse() { + return false; + } + function returnTrue() { + return true; + } + function returnUndefined() { + return void 0; + } + function identity2(x7) { + return x7; + } + function toLowerCase(x7) { + return x7.toLowerCase(); + } + function toFileNameLowerCase(x7) { + return fileNameLowerCaseRegExp.test(x7) ? x7.replace(fileNameLowerCaseRegExp, toLowerCase) : x7; + } + function notImplemented() { + throw new Error("Not implemented"); + } + function memoize2(callback) { + let value2; + return () => { + if (callback) { + value2 = callback(); + callback = void 0; + } + return value2; + }; + } + function memoizeOne(callback) { + const map22 = /* @__PURE__ */ new Map(); + return (arg) => { + const key = `${typeof arg}:${arg}`; + let value2 = map22.get(key); + if (value2 === void 0 && !map22.has(key)) { + value2 = callback(arg); + map22.set(key, value2); + } + return value2; + }; + } + function memoizeWeak(callback) { + const map22 = /* @__PURE__ */ new WeakMap(); + return (arg) => { + let value2 = map22.get(arg); + if (value2 === void 0 && !map22.has(arg)) { + value2 = callback(arg); + map22.set(arg, value2); + } + return value2; + }; + } + function memoizeCached(callback, cache) { + return (...args) => { + let value2 = cache.get(args); + if (value2 === void 0 && !cache.has(args)) { + value2 = callback(...args); + cache.set(args, value2); + } + return value2; + }; + } + function compose(a7, b8, c7, d7, e10) { + if (!!e10) { + const args = []; + for (let i7 = 0; i7 < arguments.length; i7++) { + args[i7] = arguments[i7]; + } + return (t8) => reduceLeft(args, (u7, f8) => f8(u7), t8); + } else if (d7) { + return (t8) => d7(c7(b8(a7(t8)))); + } else if (c7) { + return (t8) => c7(b8(a7(t8))); + } else if (b8) { + return (t8) => b8(a7(t8)); + } else if (a7) { + return (t8) => a7(t8); + } else { + return (t8) => t8; + } + } + function equateValues(a7, b8) { + return a7 === b8; + } + function equateStringsCaseInsensitive(a7, b8) { + return a7 === b8 || a7 !== void 0 && b8 !== void 0 && a7.toUpperCase() === b8.toUpperCase(); + } + function equateStringsCaseSensitive(a7, b8) { + return equateValues(a7, b8); + } + function compareComparableValues(a7, b8) { + return a7 === b8 ? 0 : a7 === void 0 ? -1 : b8 === void 0 ? 1 : a7 < b8 ? -1 : 1; + } + function compareValues(a7, b8) { + return compareComparableValues(a7, b8); + } + function compareTextSpans(a7, b8) { + return compareValues(a7 == null ? void 0 : a7.start, b8 == null ? void 0 : b8.start) || compareValues(a7 == null ? void 0 : a7.length, b8 == null ? void 0 : b8.length); + } + function min2(items, compare) { + return reduceLeft(items, (x7, y7) => compare(x7, y7) === -1 ? x7 : y7); + } + function compareStringsCaseInsensitive(a7, b8) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + a7 = a7.toUpperCase(); + b8 = b8.toUpperCase(); + return a7 < b8 ? -1 : a7 > b8 ? 1 : 0; + } + function compareStringsCaseInsensitiveEslintCompatible(a7, b8) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + a7 = a7.toLowerCase(); + b8 = b8.toLowerCase(); + return a7 < b8 ? -1 : a7 > b8 ? 1 : 0; + } + function compareStringsCaseSensitive(a7, b8) { + return compareComparableValues(a7, b8); + } + function getStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive; + } + function getUILocale() { + return uiLocale; + } + function setUILocale(value2) { + if (uiLocale !== value2) { + uiLocale = value2; + uiComparerCaseSensitive = void 0; + } + } + function compareStringsCaseSensitiveUI(a7, b8) { + const comparer = uiComparerCaseSensitive || (uiComparerCaseSensitive = createUIStringComparer(uiLocale)); + return comparer(a7, b8); + } + function compareProperties(a7, b8, key, comparer) { + return a7 === b8 ? 0 : a7 === void 0 ? -1 : b8 === void 0 ? 1 : comparer(a7[key], b8[key]); + } + function compareBooleans(a7, b8) { + return compareValues(a7 ? 1 : 0, b8 ? 1 : 0); + } + function getSpellingSuggestion(name2, candidates, getName) { + const maximumLengthDifference = Math.max(2, Math.floor(name2.length * 0.34)); + let bestDistance = Math.floor(name2.length * 0.4) + 1; + let bestCandidate; + for (const candidate of candidates) { + const candidateName = getName(candidate); + if (candidateName !== void 0 && Math.abs(candidateName.length - name2.length) <= maximumLengthDifference) { + if (candidateName === name2) { + continue; + } + if (candidateName.length < 3 && candidateName.toLowerCase() !== name2.toLowerCase()) { + continue; + } + const distance = levenshteinWithMax(name2, candidateName, bestDistance - 0.1); + if (distance === void 0) { + continue; + } + Debug.assert(distance < bestDistance); + bestDistance = distance; + bestCandidate = candidate; + } + } + return bestCandidate; + } + function levenshteinWithMax(s1, s22, max2) { + let previous = new Array(s22.length + 1); + let current = new Array(s22.length + 1); + const big = max2 + 0.01; + for (let i7 = 0; i7 <= s22.length; i7++) { + previous[i7] = i7; + } + for (let i7 = 1; i7 <= s1.length; i7++) { + const c1 = s1.charCodeAt(i7 - 1); + const minJ = Math.ceil(i7 > max2 ? i7 - max2 : 1); + const maxJ = Math.floor(s22.length > max2 + i7 ? max2 + i7 : s22.length); + current[0] = i7; + let colMin = i7; + for (let j6 = 1; j6 < minJ; j6++) { + current[j6] = big; + } + for (let j6 = minJ; j6 <= maxJ; j6++) { + const substitutionDistance = s1[i7 - 1].toLowerCase() === s22[j6 - 1].toLowerCase() ? previous[j6 - 1] + 0.1 : previous[j6 - 1] + 2; + const dist = c1 === s22.charCodeAt(j6 - 1) ? previous[j6 - 1] : Math.min( + /*delete*/ + previous[j6] + 1, + /*insert*/ + current[j6 - 1] + 1, + /*substitute*/ + substitutionDistance + ); + current[j6] = dist; + colMin = Math.min(colMin, dist); + } + for (let j6 = maxJ + 1; j6 <= s22.length; j6++) { + current[j6] = big; + } + if (colMin > max2) { + return void 0; + } + const temp = previous; + previous = current; + current = temp; + } + const res = previous[s22.length]; + return res > max2 ? void 0 : res; + } + function endsWith2(str2, suffix, ignoreCase) { + const expectedPos = str2.length - suffix.length; + return expectedPos >= 0 && (ignoreCase ? equateStringsCaseInsensitive(str2.slice(expectedPos), suffix) : str2.indexOf(suffix, expectedPos) === expectedPos); + } + function removeSuffix(str2, suffix) { + return endsWith2(str2, suffix) ? str2.slice(0, str2.length - suffix.length) : str2; + } + function tryRemoveSuffix(str2, suffix) { + return endsWith2(str2, suffix) ? str2.slice(0, str2.length - suffix.length) : void 0; + } + function removeMinAndVersionNumbers(fileName) { + let end = fileName.length; + for (let pos = end - 1; pos > 0; pos--) { + let ch = fileName.charCodeAt(pos); + if (ch >= 48 && ch <= 57) { + do { + --pos; + ch = fileName.charCodeAt(pos); + } while (pos > 0 && ch >= 48 && ch <= 57); + } else if (pos > 4 && (ch === 110 || ch === 78)) { + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 105 && ch !== 73) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + if (ch !== 109 && ch !== 77) { + break; + } + --pos; + ch = fileName.charCodeAt(pos); + } else { + break; + } + if (ch !== 45 && ch !== 46) { + break; + } + end = pos; + } + return end === fileName.length ? fileName : fileName.slice(0, end); + } + function orderedRemoveItem(array, item) { + for (let i7 = 0; i7 < array.length; i7++) { + if (array[i7] === item) { + orderedRemoveItemAt(array, i7); + return true; + } + } + return false; + } + function orderedRemoveItemAt(array, index4) { + for (let i7 = index4; i7 < array.length - 1; i7++) { + array[i7] = array[i7 + 1]; + } + array.pop(); + } + function unorderedRemoveItemAt(array, index4) { + array[index4] = array[array.length - 1]; + array.pop(); + } + function unorderedRemoveItem(array, item) { + return unorderedRemoveFirstItemWhere(array, (element) => element === item); + } + function unorderedRemoveFirstItemWhere(array, predicate) { + for (let i7 = 0; i7 < array.length; i7++) { + if (predicate(array[i7])) { + unorderedRemoveItemAt(array, i7); + return true; + } + } + return false; + } + function createGetCanonicalFileName(useCaseSensitiveFileNames2) { + return useCaseSensitiveFileNames2 ? identity2 : toFileNameLowerCase; + } + function patternText({ prefix, suffix }) { + return `${prefix}*${suffix}`; + } + function matchedText(pattern5, candidate) { + Debug.assert(isPatternMatch(pattern5, candidate)); + return candidate.substring(pattern5.prefix.length, candidate.length - pattern5.suffix.length); + } + function findBestPatternMatch(values2, getPattern, candidate) { + let matchedValue; + let longestMatchPrefixLength = -1; + for (const v8 of values2) { + const pattern5 = getPattern(v8); + if (isPatternMatch(pattern5, candidate) && pattern5.prefix.length > longestMatchPrefixLength) { + longestMatchPrefixLength = pattern5.prefix.length; + matchedValue = v8; + } + } + return matchedValue; + } + function startsWith2(str2, prefix, ignoreCase) { + return ignoreCase ? equateStringsCaseInsensitive(str2.slice(0, prefix.length), prefix) : str2.lastIndexOf(prefix, 0) === 0; + } + function removePrefix(str2, prefix) { + return startsWith2(str2, prefix) ? str2.substr(prefix.length) : str2; + } + function tryRemovePrefix(str2, prefix, getCanonicalFileName = identity2) { + return startsWith2(getCanonicalFileName(str2), getCanonicalFileName(prefix)) ? str2.substring(prefix.length) : void 0; + } + function isPatternMatch({ prefix, suffix }, candidate) { + return candidate.length >= prefix.length + suffix.length && startsWith2(candidate, prefix) && endsWith2(candidate, suffix); + } + function and(f8, g7) { + return (arg) => f8(arg) && g7(arg); + } + function or(...fs) { + return (...args) => { + let lastResult; + for (const f8 of fs) { + lastResult = f8(...args); + if (lastResult) { + return lastResult; + } + } + return lastResult; + }; + } + function not(fn) { + return (...args) => !fn(...args); + } + function assertType(_6) { + } + function singleElementArray(t8) { + return t8 === void 0 ? void 0 : [t8]; + } + function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { + unchanged = unchanged || noop4; + let newIndex = 0; + let oldIndex = 0; + const newLen = newItems.length; + const oldLen = oldItems.length; + let hasChanges = false; + while (newIndex < newLen && oldIndex < oldLen) { + const newItem = newItems[newIndex]; + const oldItem = oldItems[oldIndex]; + const compareResult = comparer(newItem, oldItem); + if (compareResult === -1) { + inserted(newItem); + newIndex++; + hasChanges = true; + } else if (compareResult === 1) { + deleted(oldItem); + oldIndex++; + hasChanges = true; + } else { + unchanged(oldItem, newItem); + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + hasChanges = true; + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + hasChanges = true; + } + return hasChanges; + } + function cartesianProduct(arrays) { + const result2 = []; + cartesianProductWorker( + arrays, + result2, + /*outer*/ + void 0, + 0 + ); + return result2; + } + function cartesianProductWorker(arrays, result2, outer, index4) { + for (const element of arrays[index4]) { + let inner; + if (outer) { + inner = outer.slice(); + inner.push(element); + } else { + inner = [element]; + } + if (index4 === arrays.length - 1) { + result2.push(inner); + } else { + cartesianProductWorker(arrays, result2, inner, index4 + 1); + } + } + } + function takeWhile2(array, predicate) { + if (array) { + const len = array.length; + let index4 = 0; + while (index4 < len && predicate(array[index4])) { + index4++; + } + return array.slice(0, index4); + } + } + function skipWhile(array, predicate) { + if (array) { + const len = array.length; + let index4 = 0; + while (index4 < len && predicate(array[index4])) { + index4++; + } + return array.slice(index4); + } + } + function isNodeLikeSystem() { + return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module5 === "object"; + } + var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty27, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale; + var init_core = __esm2({ + "src/compiler/core.ts"() { + "use strict"; + init_ts2(); + emptyArray = []; + emptyMap = /* @__PURE__ */ new Map(); + emptySet = /* @__PURE__ */ new Set(); + SortKind = /* @__PURE__ */ ((SortKind2) => { + SortKind2[SortKind2["None"] = 0] = "None"; + SortKind2[SortKind2["CaseSensitive"] = 1] = "CaseSensitive"; + SortKind2[SortKind2["CaseInsensitive"] = 2] = "CaseInsensitive"; + SortKind2[SortKind2["Both"] = 3] = "Both"; + return SortKind2; + })(SortKind || {}); + elementAt = !!Array.prototype.at ? (array, offset) => array == null ? void 0 : array.at(offset) : (array, offset) => { + if (array) { + offset = toOffset(array, offset); + if (offset < array.length) { + return array[offset]; + } + } + return void 0; + }; + hasOwnProperty27 = Object.prototype.hasOwnProperty; + fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_. ]+/g; + AssertionLevel = /* @__PURE__ */ ((AssertionLevel2) => { + AssertionLevel2[AssertionLevel2["None"] = 0] = "None"; + AssertionLevel2[AssertionLevel2["Normal"] = 1] = "Normal"; + AssertionLevel2[AssertionLevel2["Aggressive"] = 2] = "Aggressive"; + AssertionLevel2[AssertionLevel2["VeryAggressive"] = 3] = "VeryAggressive"; + return AssertionLevel2; + })(AssertionLevel || {}); + createUIStringComparer = /* @__PURE__ */ (() => { + return createIntlCollatorStringComparer; + function compareWithCallback(a7, b8, comparer) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + const value2 = comparer(a7, b8); + return value2 < 0 ? -1 : value2 > 0 ? 1 : 0; + } + function createIntlCollatorStringComparer(locale) { + const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare; + return (a7, b8) => compareWithCallback(a7, b8, comparer); + } + })(); + } + }); + var LogLevel, Debug; + var init_debug = __esm2({ + "src/compiler/debug.ts"() { + "use strict"; + init_ts2(); + init_ts2(); + LogLevel = /* @__PURE__ */ ((LogLevel3) => { + LogLevel3[LogLevel3["Off"] = 0] = "Off"; + LogLevel3[LogLevel3["Error"] = 1] = "Error"; + LogLevel3[LogLevel3["Warning"] = 2] = "Warning"; + LogLevel3[LogLevel3["Info"] = 3] = "Info"; + LogLevel3[LogLevel3["Verbose"] = 4] = "Verbose"; + return LogLevel3; + })(LogLevel || {}); + ((Debug2) => { + let currentAssertionLevel = 0; + Debug2.currentLogLevel = 2; + Debug2.isDebugging = false; + function shouldLog(level) { + return Debug2.currentLogLevel <= level; + } + Debug2.shouldLog = shouldLog; + function logMessage(level, s7) { + if (Debug2.loggingHost && shouldLog(level)) { + Debug2.loggingHost.log(level, s7); + } + } + function log3(s7) { + logMessage(3, s7); + } + Debug2.log = log3; + ((_log) => { + function error22(s7) { + logMessage(1, s7); + } + _log.error = error22; + function warn3(s7) { + logMessage(2, s7); + } + _log.warn = warn3; + function log22(s7) { + logMessage(3, s7); + } + _log.log = log22; + function trace22(s7) { + logMessage(4, s7); + } + _log.trace = trace22; + })(log3 = Debug2.log || (Debug2.log = {})); + const assertionCache = {}; + function getAssertionLevel() { + return currentAssertionLevel; + } + Debug2.getAssertionLevel = getAssertionLevel; + function setAssertionLevel(level) { + const prevAssertionLevel = currentAssertionLevel; + currentAssertionLevel = level; + if (level > prevAssertionLevel) { + for (const key of getOwnKeys(assertionCache)) { + const cachedFunc = assertionCache[key]; + if (cachedFunc !== void 0 && Debug2[key] !== cachedFunc.assertion && level >= cachedFunc.level) { + Debug2[key] = cachedFunc; + assertionCache[key] = void 0; + } + } + } + } + Debug2.setAssertionLevel = setAssertionLevel; + function shouldAssert(level) { + return currentAssertionLevel >= level; + } + Debug2.shouldAssert = shouldAssert; + function shouldAssertFunction(level, name2) { + if (!shouldAssert(level)) { + assertionCache[name2] = { level, assertion: Debug2[name2] }; + Debug2[name2] = noop4; + return false; + } + return true; + } + function fail2(message, stackCrawlMark) { + debugger; + const e10 = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); + if (Error.captureStackTrace) { + Error.captureStackTrace(e10, stackCrawlMark || fail2); + } + throw e10; + } + Debug2.fail = fail2; + function failBadSyntaxKind(node, message, stackCrawlMark) { + return fail2( + `${message || "Unexpected node."}\r +Node ${formatSyntaxKind(node.kind)} was unexpected.`, + stackCrawlMark || failBadSyntaxKind + ); + } + Debug2.failBadSyntaxKind = failBadSyntaxKind; + function assert4(expression, message, verboseDebugInfo, stackCrawlMark) { + if (!expression) { + message = message ? `False expression: ${message}` : "False expression."; + if (verboseDebugInfo) { + message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); + } + fail2(message, stackCrawlMark || assert4); + } + } + Debug2.assert = assert4; + function assertEqual(a7, b8, msg, msg2, stackCrawlMark) { + if (a7 !== b8) { + const message = msg ? msg2 ? `${msg} ${msg2}` : msg : ""; + fail2(`Expected ${a7} === ${b8}. ${message}`, stackCrawlMark || assertEqual); + } + } + Debug2.assertEqual = assertEqual; + function assertLessThan(a7, b8, msg, stackCrawlMark) { + if (a7 >= b8) { + fail2(`Expected ${a7} < ${b8}. ${msg || ""}`, stackCrawlMark || assertLessThan); + } + } + Debug2.assertLessThan = assertLessThan; + function assertLessThanOrEqual(a7, b8, stackCrawlMark) { + if (a7 > b8) { + fail2(`Expected ${a7} <= ${b8}`, stackCrawlMark || assertLessThanOrEqual); + } + } + Debug2.assertLessThanOrEqual = assertLessThanOrEqual; + function assertGreaterThanOrEqual(a7, b8, stackCrawlMark) { + if (a7 < b8) { + fail2(`Expected ${a7} >= ${b8}`, stackCrawlMark || assertGreaterThanOrEqual); + } + } + Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual; + function assertIsDefined(value2, message, stackCrawlMark) { + if (value2 === void 0 || value2 === null) { + fail2(message, stackCrawlMark || assertIsDefined); + } + } + Debug2.assertIsDefined = assertIsDefined; + function checkDefined(value2, message, stackCrawlMark) { + assertIsDefined(value2, message, stackCrawlMark || checkDefined); + return value2; + } + Debug2.checkDefined = checkDefined; + function assertEachIsDefined(value2, message, stackCrawlMark) { + for (const v8 of value2) { + assertIsDefined(v8, message, stackCrawlMark || assertEachIsDefined); + } + } + Debug2.assertEachIsDefined = assertEachIsDefined; + function checkEachDefined(value2, message, stackCrawlMark) { + assertEachIsDefined(value2, message, stackCrawlMark || checkEachDefined); + return value2; + } + Debug2.checkEachDefined = checkEachDefined; + function assertNever(member, message = "Illegal value:", stackCrawlMark) { + const detail = typeof member === "object" && hasProperty(member, "kind") && hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); + return fail2(`${message} ${detail}`, stackCrawlMark || assertNever); + } + Debug2.assertNever = assertNever; + function assertEachNode(nodes, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertEachNode")) { + assert4( + test === void 0 || every2(nodes, test), + message || "Unexpected node.", + () => `Node array did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertEachNode + ); + } + } + Debug2.assertEachNode = assertEachNode; + function assertNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertNode")) { + assert4( + node !== void 0 && (test === void 0 || test(node)), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertNode + ); + } + } + Debug2.assertNode = assertNode; + function assertNotNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertNotNode")) { + assert4( + node === void 0 || test === void 0 || !test(node), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node.kind)} should not have passed test '${getFunctionName(test)}'.`, + stackCrawlMark || assertNotNode + ); + } + } + Debug2.assertNotNode = assertNotNode; + function assertOptionalNode(node, test, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertOptionalNode")) { + assert4( + test === void 0 || node === void 0 || test(node), + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, + stackCrawlMark || assertOptionalNode + ); + } + } + Debug2.assertOptionalNode = assertOptionalNode; + function assertOptionalToken(node, kind, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertOptionalToken")) { + assert4( + kind === void 0 || node === void 0 || node.kind === kind, + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} was not a '${formatSyntaxKind(kind)}' token.`, + stackCrawlMark || assertOptionalToken + ); + } + } + Debug2.assertOptionalToken = assertOptionalToken; + function assertMissingNode(node, message, stackCrawlMark) { + if (shouldAssertFunction(1, "assertMissingNode")) { + assert4( + node === void 0, + message || "Unexpected node.", + () => `Node ${formatSyntaxKind(node.kind)} was unexpected'.`, + stackCrawlMark || assertMissingNode + ); + } + } + Debug2.assertMissingNode = assertMissingNode; + function type3(_value) { + } + Debug2.type = type3; + function getFunctionName(func) { + if (typeof func !== "function") { + return ""; + } else if (hasProperty(func, "name")) { + return func.name; + } else { + const text = Function.prototype.toString.call(func); + const match = /^function\s+([\w$]+)\s*\(/.exec(text); + return match ? match[1] : ""; + } + } + Debug2.getFunctionName = getFunctionName; + function formatSymbol(symbol) { + return `{ name: ${unescapeLeadingUnderscores(symbol.escapedName)}; flags: ${formatSymbolFlags(symbol.flags)}; declarations: ${map4(symbol.declarations, (node) => formatSyntaxKind(node.kind))} }`; + } + Debug2.formatSymbol = formatSymbol; + function formatEnum(value2 = 0, enumObject, isFlags) { + const members = getEnumMembers(enumObject); + if (value2 === 0) { + return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; + } + if (isFlags) { + const result2 = []; + let remainingFlags = value2; + for (const [enumValue, enumName] of members) { + if (enumValue > value2) { + break; + } + if (enumValue !== 0 && enumValue & value2) { + result2.push(enumName); + remainingFlags &= ~enumValue; + } + } + if (remainingFlags === 0) { + return result2.join("|"); + } + } else { + for (const [enumValue, enumName] of members) { + if (enumValue === value2) { + return enumName; + } + } + } + return value2.toString(); + } + Debug2.formatEnum = formatEnum; + const enumMemberCache = /* @__PURE__ */ new Map(); + function getEnumMembers(enumObject) { + const existing = enumMemberCache.get(enumObject); + if (existing) { + return existing; + } + const result2 = []; + for (const name2 in enumObject) { + const value2 = enumObject[name2]; + if (typeof value2 === "number") { + result2.push([value2, name2]); + } + } + const sorted = stableSort(result2, (x7, y7) => compareValues(x7[0], y7[0])); + enumMemberCache.set(enumObject, sorted); + return sorted; + } + function formatSyntaxKind(kind) { + return formatEnum( + kind, + SyntaxKind, + /*isFlags*/ + false + ); + } + Debug2.formatSyntaxKind = formatSyntaxKind; + function formatSnippetKind(kind) { + return formatEnum( + kind, + SnippetKind, + /*isFlags*/ + false + ); + } + Debug2.formatSnippetKind = formatSnippetKind; + function formatScriptKind(kind) { + return formatEnum( + kind, + ScriptKind, + /*isFlags*/ + false + ); + } + Debug2.formatScriptKind = formatScriptKind; + function formatNodeFlags(flags) { + return formatEnum( + flags, + NodeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatNodeFlags = formatNodeFlags; + function formatModifierFlags(flags) { + return formatEnum( + flags, + ModifierFlags, + /*isFlags*/ + true + ); + } + Debug2.formatModifierFlags = formatModifierFlags; + function formatTransformFlags(flags) { + return formatEnum( + flags, + TransformFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTransformFlags = formatTransformFlags; + function formatEmitFlags(flags) { + return formatEnum( + flags, + EmitFlags, + /*isFlags*/ + true + ); + } + Debug2.formatEmitFlags = formatEmitFlags; + function formatSymbolFlags(flags) { + return formatEnum( + flags, + SymbolFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSymbolFlags = formatSymbolFlags; + function formatTypeFlags(flags) { + return formatEnum( + flags, + TypeFlags, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFlags = formatTypeFlags; + function formatSignatureFlags(flags) { + return formatEnum( + flags, + SignatureFlags, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureFlags = formatSignatureFlags; + function formatObjectFlags(flags) { + return formatEnum( + flags, + ObjectFlags, + /*isFlags*/ + true + ); + } + Debug2.formatObjectFlags = formatObjectFlags; + function formatFlowFlags(flags) { + return formatEnum( + flags, + FlowFlags, + /*isFlags*/ + true + ); + } + Debug2.formatFlowFlags = formatFlowFlags; + function formatRelationComparisonResult(result2) { + return formatEnum( + result2, + RelationComparisonResult, + /*isFlags*/ + true + ); + } + Debug2.formatRelationComparisonResult = formatRelationComparisonResult; + function formatCheckMode(mode) { + return formatEnum( + mode, + CheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatCheckMode = formatCheckMode; + function formatSignatureCheckMode(mode) { + return formatEnum( + mode, + SignatureCheckMode, + /*isFlags*/ + true + ); + } + Debug2.formatSignatureCheckMode = formatSignatureCheckMode; + function formatTypeFacts(facts) { + return formatEnum( + facts, + TypeFacts, + /*isFlags*/ + true + ); + } + Debug2.formatTypeFacts = formatTypeFacts; + let isDebugInfoEnabled = false; + let flowNodeProto; + function attachFlowNodeDebugInfoWorker(flowNode) { + if (!("__debugFlowFlags" in flowNode)) { + Object.defineProperties(flowNode, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const flowHeader = this.flags & 2 ? "FlowStart" : this.flags & 4 ? "FlowBranchLabel" : this.flags & 8 ? "FlowLoopLabel" : this.flags & 16 ? "FlowAssignment" : this.flags & 32 ? "FlowTrueCondition" : this.flags & 64 ? "FlowFalseCondition" : this.flags & 128 ? "FlowSwitchClause" : this.flags & 256 ? "FlowArrayMutation" : this.flags & 512 ? "FlowCall" : this.flags & 1024 ? "FlowReduceLabel" : this.flags & 1 ? "FlowUnreachable" : "UnknownFlow"; + const remainingFlags = this.flags & ~(2048 - 1); + return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`; + } + }, + __debugFlowFlags: { + get() { + return formatEnum( + this.flags, + FlowFlags, + /*isFlags*/ + true + ); + } + }, + __debugToString: { + value() { + return formatControlFlowGraph(this); + } + } + }); + } + } + function attachFlowNodeDebugInfo(flowNode) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!flowNodeProto) { + flowNodeProto = Object.create(Object.prototype); + attachFlowNodeDebugInfoWorker(flowNodeProto); + } + Object.setPrototypeOf(flowNode, flowNodeProto); + } else { + attachFlowNodeDebugInfoWorker(flowNode); + } + } + } + Debug2.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; + let nodeArrayProto; + function attachNodeArrayDebugInfoWorker(array) { + if (!("__tsDebuggerDisplay" in array)) { + Object.defineProperties(array, { + __tsDebuggerDisplay: { + value(defaultValue) { + defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); + return `NodeArray ${defaultValue}`; + } + } + }); + } + } + function attachNodeArrayDebugInfo(array) { + if (isDebugInfoEnabled) { + if (typeof Object.setPrototypeOf === "function") { + if (!nodeArrayProto) { + nodeArrayProto = Object.create(Array.prototype); + attachNodeArrayDebugInfoWorker(nodeArrayProto); + } + Object.setPrototypeOf(array, nodeArrayProto); + } else { + attachNodeArrayDebugInfoWorker(array); + } + } + } + Debug2.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; + function enableDebugInfo() { + if (isDebugInfoEnabled) + return; + const weakTypeTextMap = /* @__PURE__ */ new WeakMap(); + const weakNodeTextMap = /* @__PURE__ */ new WeakMap(); + Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const symbolHeader = this.flags & 33554432 ? "TransientSymbol" : "Symbol"; + const remainingSymbolFlags = this.flags & ~33554432; + return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`; + } + }, + __debugFlags: { + get() { + return formatSymbolFlags(this.flags); + } + } + }); + Object.defineProperties(objectAllocator.getTypeConstructor().prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const typeHeader = this.flags & 67359327 ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 ? "NullableType" : this.flags & 384 ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 ? "UniqueESSymbolType" : this.flags & 32 ? "EnumType" : this.flags & 1048576 ? "UnionType" : this.flags & 2097152 ? "IntersectionType" : this.flags & 4194304 ? "IndexType" : this.flags & 8388608 ? "IndexedAccessType" : this.flags & 16777216 ? "ConditionalType" : this.flags & 33554432 ? "SubstitutionType" : this.flags & 262144 ? "TypeParameter" : this.flags & 524288 ? this.objectFlags & 3 ? "InterfaceType" : this.objectFlags & 4 ? "TypeReference" : this.objectFlags & 8 ? "TupleType" : this.objectFlags & 16 ? "AnonymousType" : this.objectFlags & 32 ? "MappedType" : this.objectFlags & 1024 ? "ReverseMappedType" : this.objectFlags & 256 ? "EvolvingArrayType" : "ObjectType" : "Type"; + const remainingObjectFlags = this.flags & 524288 ? this.objectFlags & ~1343 : 0; + return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`; + } + }, + __debugFlags: { + get() { + return formatTypeFlags(this.flags); + } + }, + __debugObjectFlags: { + get() { + return this.flags & 524288 ? formatObjectFlags(this.objectFlags) : ""; + } + }, + __debugTypeToString: { + value() { + let text = weakTypeTextMap.get(this); + if (text === void 0) { + text = this.checker.typeToString(this); + weakTypeTextMap.set(this, text); + } + return text; + } + } + }); + Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, { + __debugFlags: { + get() { + return formatSignatureFlags(this.flags); + } + }, + __debugSignatureToString: { + value() { + var _a2; + return (_a2 = this.checker) == null ? void 0 : _a2.signatureToString(this); + } + } + }); + const nodeConstructors = [ + objectAllocator.getNodeConstructor(), + objectAllocator.getIdentifierConstructor(), + objectAllocator.getTokenConstructor(), + objectAllocator.getSourceFileConstructor() + ]; + for (const ctor of nodeConstructors) { + if (!hasProperty(ctor.prototype, "__debugKind")) { + Object.defineProperties(ctor.prototype, { + // for use with vscode-js-debug's new customDescriptionGenerator in launch.json + __tsDebuggerDisplay: { + value() { + const nodeHeader = isGeneratedIdentifier(this) ? "GeneratedIdentifier" : isIdentifier(this) ? `Identifier '${idText(this)}'` : isPrivateIdentifier(this) ? `PrivateIdentifier '${idText(this)}'` : isStringLiteral(this) ? `StringLiteral ${JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")}` : isNumericLiteral(this) ? `NumericLiteral ${this.text}` : isBigIntLiteral(this) ? `BigIntLiteral ${this.text}n` : isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : isParameter(this) ? "ParameterDeclaration" : isConstructorDeclaration(this) ? "ConstructorDeclaration" : isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : isTypePredicateNode(this) ? "TypePredicateNode" : isTypeReferenceNode(this) ? "TypeReferenceNode" : isFunctionTypeNode(this) ? "FunctionTypeNode" : isConstructorTypeNode(this) ? "ConstructorTypeNode" : isTypeQueryNode(this) ? "TypeQueryNode" : isTypeLiteralNode(this) ? "TypeLiteralNode" : isArrayTypeNode(this) ? "ArrayTypeNode" : isTupleTypeNode(this) ? "TupleTypeNode" : isOptionalTypeNode(this) ? "OptionalTypeNode" : isRestTypeNode(this) ? "RestTypeNode" : isUnionTypeNode(this) ? "UnionTypeNode" : isIntersectionTypeNode(this) ? "IntersectionTypeNode" : isConditionalTypeNode(this) ? "ConditionalTypeNode" : isInferTypeNode(this) ? "InferTypeNode" : isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : isThisTypeNode(this) ? "ThisTypeNode" : isTypeOperatorNode(this) ? "TypeOperatorNode" : isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : isMappedTypeNode(this) ? "MappedTypeNode" : isLiteralTypeNode(this) ? "LiteralTypeNode" : isNamedTupleMember(this) ? "NamedTupleMember" : isImportTypeNode(this) ? "ImportTypeNode" : formatSyntaxKind(this.kind); + return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`; + } + }, + __debugKind: { + get() { + return formatSyntaxKind(this.kind); + } + }, + __debugNodeFlags: { + get() { + return formatNodeFlags(this.flags); + } + }, + __debugModifierFlags: { + get() { + return formatModifierFlags(getEffectiveModifierFlagsNoCache(this)); + } + }, + __debugTransformFlags: { + get() { + return formatTransformFlags(this.transformFlags); + } + }, + __debugIsParseTreeNode: { + get() { + return isParseTreeNode(this); + } + }, + __debugEmitFlags: { + get() { + return formatEmitFlags(getEmitFlags(this)); + } + }, + __debugGetText: { + value(includeTrivia) { + if (nodeIsSynthesized(this)) + return ""; + let text = weakNodeTextMap.get(this); + if (text === void 0) { + const parseNode = getParseTreeNode(this); + const sourceFile = parseNode && getSourceFileOfNode(parseNode); + text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; + weakNodeTextMap.set(this, text); + } + return text; + } + } + }); + } + } + isDebugInfoEnabled = true; + } + Debug2.enableDebugInfo = enableDebugInfo; + function formatVariance(varianceFlags) { + const variance = varianceFlags & 7; + let result2 = variance === 0 ? "in out" : variance === 3 ? "[bivariant]" : variance === 2 ? "in" : variance === 1 ? "out" : variance === 4 ? "[independent]" : ""; + if (varianceFlags & 8) { + result2 += " (unmeasurable)"; + } else if (varianceFlags & 16) { + result2 += " (unreliable)"; + } + return result2; + } + Debug2.formatVariance = formatVariance; + class DebugTypeMapper { + __debugToString() { + var _a2; + type3(this); + switch (this.kind) { + case 3: + return ((_a2 = this.debugInfo) == null ? void 0 : _a2.call(this)) || "(function mapper)"; + case 0: + return `${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`; + case 1: + return zipWith2( + this.sources, + this.targets || map4(this.sources, () => "any"), + (s7, t8) => `${s7.__debugTypeToString()} -> ${typeof t8 === "string" ? t8 : t8.__debugTypeToString()}` + ).join(", "); + case 2: + return zipWith2( + this.sources, + this.targets, + (s7, t8) => `${s7.__debugTypeToString()} -> ${t8().__debugTypeToString()}` + ).join(", "); + case 5: + case 4: + return `m1: ${this.mapper1.__debugToString().split("\n").join("\n ")} +m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`; + default: + return assertNever(this); + } + } + } + Debug2.DebugTypeMapper = DebugTypeMapper; + function attachDebugPrototypeIfDebug(mapper) { + if (Debug2.isDebugging) { + return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype); + } + return mapper; + } + Debug2.attachDebugPrototypeIfDebug = attachDebugPrototypeIfDebug; + function printControlFlowGraph(flowNode) { + return console.log(formatControlFlowGraph(flowNode)); + } + Debug2.printControlFlowGraph = printControlFlowGraph; + function formatControlFlowGraph(flowNode) { + let nextDebugFlowId = -1; + function getDebugFlowNodeId(f8) { + if (!f8.id) { + f8.id = nextDebugFlowId; + nextDebugFlowId--; + } + return f8.id; + } + let BoxCharacter; + ((BoxCharacter2) => { + BoxCharacter2["lr"] = "\u2500"; + BoxCharacter2["ud"] = "\u2502"; + BoxCharacter2["dr"] = "\u256D"; + BoxCharacter2["dl"] = "\u256E"; + BoxCharacter2["ul"] = "\u256F"; + BoxCharacter2["ur"] = "\u2570"; + BoxCharacter2["udr"] = "\u251C"; + BoxCharacter2["udl"] = "\u2524"; + BoxCharacter2["dlr"] = "\u252C"; + BoxCharacter2["ulr"] = "\u2534"; + BoxCharacter2["udlr"] = "\u256B"; + })(BoxCharacter || (BoxCharacter = {})); + let Connection; + ((Connection2) => { + Connection2[Connection2["None"] = 0] = "None"; + Connection2[Connection2["Up"] = 1] = "Up"; + Connection2[Connection2["Down"] = 2] = "Down"; + Connection2[Connection2["Left"] = 4] = "Left"; + Connection2[Connection2["Right"] = 8] = "Right"; + Connection2[Connection2["UpDown"] = 3] = "UpDown"; + Connection2[Connection2["LeftRight"] = 12] = "LeftRight"; + Connection2[Connection2["UpLeft"] = 5] = "UpLeft"; + Connection2[Connection2["UpRight"] = 9] = "UpRight"; + Connection2[Connection2["DownLeft"] = 6] = "DownLeft"; + Connection2[Connection2["DownRight"] = 10] = "DownRight"; + Connection2[Connection2["UpDownLeft"] = 7] = "UpDownLeft"; + Connection2[Connection2["UpDownRight"] = 11] = "UpDownRight"; + Connection2[Connection2["UpLeftRight"] = 13] = "UpLeftRight"; + Connection2[Connection2["DownLeftRight"] = 14] = "DownLeftRight"; + Connection2[Connection2["UpDownLeftRight"] = 15] = "UpDownLeftRight"; + Connection2[Connection2["NoChildren"] = 16] = "NoChildren"; + })(Connection || (Connection = {})); + const hasAntecedentFlags = 16 | 96 | 128 | 256 | 512 | 1024; + const hasNodeFlags = 2 | 16 | 512 | 96 | 256; + const links = /* @__PURE__ */ Object.create( + /*o*/ + null + ); + const nodes = []; + const edges = []; + const root2 = buildGraphNode(flowNode, /* @__PURE__ */ new Set()); + for (const node of nodes) { + node.text = renderFlowNode(node.flowNode, node.circular); + computeLevel(node); + } + const height = computeHeight(root2); + const columnWidths = computeColumnWidths(height); + computeLanes(root2, 0); + return renderGraph2(); + function isFlowSwitchClause(f8) { + return !!(f8.flags & 128); + } + function hasAntecedents(f8) { + return !!(f8.flags & 12) && !!f8.antecedents; + } + function hasAntecedent(f8) { + return !!(f8.flags & hasAntecedentFlags); + } + function hasNode(f8) { + return !!(f8.flags & hasNodeFlags); + } + function getChildren(node) { + const children = []; + for (const edge of node.edges) { + if (edge.source === node) { + children.push(edge.target); + } + } + return children; + } + function getParents(node) { + const parents = []; + for (const edge of node.edges) { + if (edge.target === node) { + parents.push(edge.source); + } + } + return parents; + } + function buildGraphNode(flowNode2, seen) { + const id = getDebugFlowNodeId(flowNode2); + let graphNode = links[id]; + if (graphNode && seen.has(flowNode2)) { + graphNode.circular = true; + graphNode = { + id: -1, + flowNode: flowNode2, + edges: [], + text: "", + lane: -1, + endLane: -1, + level: -1, + circular: "circularity" + }; + nodes.push(graphNode); + return graphNode; + } + seen.add(flowNode2); + if (!graphNode) { + links[id] = graphNode = { id, flowNode: flowNode2, edges: [], text: "", lane: -1, endLane: -1, level: -1, circular: false }; + nodes.push(graphNode); + if (hasAntecedents(flowNode2)) { + for (const antecedent of flowNode2.antecedents) { + buildGraphEdge(graphNode, antecedent, seen); + } + } else if (hasAntecedent(flowNode2)) { + buildGraphEdge(graphNode, flowNode2.antecedent, seen); + } + } + seen.delete(flowNode2); + return graphNode; + } + function buildGraphEdge(source, antecedent, seen) { + const target = buildGraphNode(antecedent, seen); + const edge = { source, target }; + edges.push(edge); + source.edges.push(edge); + target.edges.push(edge); + } + function computeLevel(node) { + if (node.level !== -1) { + return node.level; + } + let level = 0; + for (const parent22 of getParents(node)) { + level = Math.max(level, computeLevel(parent22) + 1); + } + return node.level = level; + } + function computeHeight(node) { + let height2 = 0; + for (const child of getChildren(node)) { + height2 = Math.max(height2, computeHeight(child)); + } + return height2 + 1; + } + function computeColumnWidths(height2) { + const columns = fill2(Array(height2), 0); + for (const node of nodes) { + columns[node.level] = Math.max(columns[node.level], node.text.length); + } + return columns; + } + function computeLanes(node, lane) { + if (node.lane === -1) { + node.lane = lane; + node.endLane = lane; + const children = getChildren(node); + for (let i7 = 0; i7 < children.length; i7++) { + if (i7 > 0) + lane++; + const child = children[i7]; + computeLanes(child, lane); + if (child.endLane > node.endLane) { + lane = child.endLane; + } + } + node.endLane = lane; + } + } + function getHeader(flags) { + if (flags & 2) + return "Start"; + if (flags & 4) + return "Branch"; + if (flags & 8) + return "Loop"; + if (flags & 16) + return "Assignment"; + if (flags & 32) + return "True"; + if (flags & 64) + return "False"; + if (flags & 128) + return "SwitchClause"; + if (flags & 256) + return "ArrayMutation"; + if (flags & 512) + return "Call"; + if (flags & 1024) + return "ReduceLabel"; + if (flags & 1) + return "Unreachable"; + throw new Error(); + } + function getNodeText(node) { + const sourceFile = getSourceFileOfNode(node); + return getSourceTextOfNodeFromSourceFile( + sourceFile, + node, + /*includeTrivia*/ + false + ); + } + function renderFlowNode(flowNode2, circular) { + let text = getHeader(flowNode2.flags); + if (circular) { + text = `${text}#${getDebugFlowNodeId(flowNode2)}`; + } + if (hasNode(flowNode2)) { + if (flowNode2.node) { + text += ` (${getNodeText(flowNode2.node)})`; + } + } else if (isFlowSwitchClause(flowNode2)) { + const clauses = []; + for (let i7 = flowNode2.clauseStart; i7 < flowNode2.clauseEnd; i7++) { + const clause = flowNode2.switchStatement.caseBlock.clauses[i7]; + if (isDefaultClause(clause)) { + clauses.push("default"); + } else { + clauses.push(getNodeText(clause.expression)); + } + } + text += ` (${clauses.join(", ")})`; + } + return circular === "circularity" ? `Circular(${text})` : text; + } + function renderGraph2() { + const columnCount = columnWidths.length; + const laneCount = nodes.reduce((x7, n7) => Math.max(x7, n7.lane), 0) + 1; + const lanes = fill2(Array(laneCount), ""); + const grid = columnWidths.map(() => Array(laneCount)); + const connectors = columnWidths.map(() => fill2(Array(laneCount), 0)); + for (const node of nodes) { + grid[node.level][node.lane] = node; + const children = getChildren(node); + for (let i7 = 0; i7 < children.length; i7++) { + const child = children[i7]; + let connector = 8; + if (child.lane === node.lane) + connector |= 4; + if (i7 > 0) + connector |= 1; + if (i7 < children.length - 1) + connector |= 2; + connectors[node.level][child.lane] |= connector; + } + if (children.length === 0) { + connectors[node.level][node.lane] |= 16; + } + const parents = getParents(node); + for (let i7 = 0; i7 < parents.length; i7++) { + const parent22 = parents[i7]; + let connector = 4; + if (i7 > 0) + connector |= 1; + if (i7 < parents.length - 1) + connector |= 2; + connectors[node.level - 1][parent22.lane] |= connector; + } + } + for (let column = 0; column < columnCount; column++) { + for (let lane = 0; lane < laneCount; lane++) { + const left = column > 0 ? connectors[column - 1][lane] : 0; + const above = lane > 0 ? connectors[column][lane - 1] : 0; + let connector = connectors[column][lane]; + if (!connector) { + if (left & 8) + connector |= 12; + if (above & 2) + connector |= 3; + connectors[column][lane] = connector; + } + } + } + for (let column = 0; column < columnCount; column++) { + for (let lane = 0; lane < lanes.length; lane++) { + const connector = connectors[column][lane]; + const fill22 = connector & 4 ? "\u2500" : " "; + const node = grid[column][lane]; + if (!node) { + if (column < columnCount - 1) { + writeLane(lane, repeat3(fill22, columnWidths[column] + 1)); + } + } else { + writeLane(lane, node.text); + if (column < columnCount - 1) { + writeLane(lane, " "); + writeLane(lane, repeat3(fill22, columnWidths[column] - node.text.length)); + } + } + writeLane(lane, getBoxCharacter(connector)); + writeLane(lane, connector & 8 && column < columnCount - 1 && !grid[column + 1][lane] ? "\u2500" : " "); + } + } + return ` +${lanes.join("\n")} +`; + function writeLane(lane, text) { + lanes[lane] += text; + } + } + function getBoxCharacter(connector) { + switch (connector) { + case 3: + return "\u2502"; + case 12: + return "\u2500"; + case 5: + return "\u256F"; + case 9: + return "\u2570"; + case 6: + return "\u256E"; + case 10: + return "\u256D"; + case 7: + return "\u2524"; + case 11: + return "\u251C"; + case 13: + return "\u2534"; + case 14: + return "\u252C"; + case 15: + return "\u256B"; + } + return " "; + } + function fill2(array, value2) { + if (array.fill) { + array.fill(value2); + } else { + for (let i7 = 0; i7 < array.length; i7++) { + array[i7] = value2; + } + } + return array; + } + function repeat3(ch, length2) { + if (ch.repeat) { + return length2 > 0 ? ch.repeat(length2) : ""; + } + let s7 = ""; + while (s7.length < length2) { + s7 += ch; + } + return s7; + } + } + Debug2.formatControlFlowGraph = formatControlFlowGraph; + })(Debug || (Debug = {})); + } + }); + function tryParseComponents(text) { + const match = versionRegExp.exec(text); + if (!match) + return void 0; + const [, major, minor = "0", patch = "0", prerelease = "", build2 = ""] = match; + if (prerelease && !prereleaseRegExp.test(prerelease)) + return void 0; + if (build2 && !buildRegExp.test(build2)) + return void 0; + return { + major: parseInt(major, 10), + minor: parseInt(minor, 10), + patch: parseInt(patch, 10), + prerelease, + build: build2 + }; + } + function comparePrereleaseIdentifiers(left, right) { + if (left === right) + return 0; + if (left.length === 0) + return right.length === 0 ? 0 : 1; + if (right.length === 0) + return -1; + const length2 = Math.min(left.length, right.length); + for (let i7 = 0; i7 < length2; i7++) { + const leftIdentifier = left[i7]; + const rightIdentifier = right[i7]; + if (leftIdentifier === rightIdentifier) + continue; + const leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier); + const rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier); + if (leftIsNumeric || rightIsNumeric) { + if (leftIsNumeric !== rightIsNumeric) + return leftIsNumeric ? -1 : 1; + const result2 = compareValues(+leftIdentifier, +rightIdentifier); + if (result2) + return result2; + } else { + const result2 = compareStringsCaseSensitive(leftIdentifier, rightIdentifier); + if (result2) + return result2; + } + } + return compareValues(left.length, right.length); + } + function parseRange(text) { + const alternatives = []; + for (let range2 of text.trim().split(logicalOrRegExp)) { + if (!range2) + continue; + const comparators = []; + range2 = range2.trim(); + const match = hyphenRegExp.exec(range2); + if (match) { + if (!parseHyphen(match[1], match[2], comparators)) + return void 0; + } else { + for (const simple of range2.split(whitespaceRegExp)) { + const match2 = rangeRegExp.exec(simple.trim()); + if (!match2 || !parseComparator(match2[1], match2[2], comparators)) + return void 0; + } + } + alternatives.push(comparators); + } + return alternatives; + } + function parsePartial(text) { + const match = partialRegExp.exec(text); + if (!match) + return void 0; + const [, major, minor = "*", patch = "*", prerelease, build2] = match; + const version22 = new Version( + isWildcard(major) ? 0 : parseInt(major, 10), + isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), + isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), + prerelease, + build2 + ); + return { version: version22, major, minor, patch }; + } + function parseHyphen(left, right, comparators) { + const leftResult = parsePartial(left); + if (!leftResult) + return false; + const rightResult = parsePartial(right); + if (!rightResult) + return false; + if (!isWildcard(leftResult.major)) { + comparators.push(createComparator(">=", leftResult.version)); + } + if (!isWildcard(rightResult.major)) { + comparators.push( + isWildcard(rightResult.minor) ? createComparator("<", rightResult.version.increment("major")) : isWildcard(rightResult.patch) ? createComparator("<", rightResult.version.increment("minor")) : createComparator("<=", rightResult.version) + ); + } + return true; + } + function parseComparator(operator, text, comparators) { + const result2 = parsePartial(text); + if (!result2) + return false; + const { version: version22, major, minor, patch } = result2; + if (!isWildcard(major)) { + switch (operator) { + case "~": + comparators.push(createComparator(">=", version22)); + comparators.push(createComparator( + "<", + version22.increment( + isWildcard(minor) ? "major" : "minor" + ) + )); + break; + case "^": + comparators.push(createComparator(">=", version22)); + comparators.push(createComparator( + "<", + version22.increment( + version22.major > 0 || isWildcard(minor) ? "major" : version22.minor > 0 || isWildcard(patch) ? "minor" : "patch" + ) + )); + break; + case "<": + case ">=": + comparators.push( + isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version22.with({ prerelease: "0" })) : createComparator(operator, version22) + ); + break; + case "<=": + case ">": + comparators.push( + isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version22.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version22.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version22) + ); + break; + case "=": + case void 0: + if (isWildcard(minor) || isWildcard(patch)) { + comparators.push(createComparator(">=", version22.with({ prerelease: "0" }))); + comparators.push(createComparator("<", version22.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" }))); + } else { + comparators.push(createComparator("=", version22)); + } + break; + default: + return false; + } + } else if (operator === "<" || operator === ">") { + comparators.push(createComparator("<", Version.zero)); + } + return true; + } + function isWildcard(part) { + return part === "*" || part === "x" || part === "X"; + } + function createComparator(operator, operand) { + return { operator, operand }; + } + function testDisjunction(version22, alternatives) { + if (alternatives.length === 0) + return true; + for (const alternative of alternatives) { + if (testAlternative(version22, alternative)) + return true; + } + return false; + } + function testAlternative(version22, comparators) { + for (const comparator of comparators) { + if (!testComparator(version22, comparator.operator, comparator.operand)) + return false; + } + return true; + } + function testComparator(version22, operator, operand) { + const cmp = version22.compareTo(operand); + switch (operator) { + case "<": + return cmp < 0; + case "<=": + return cmp <= 0; + case ">": + return cmp > 0; + case ">=": + return cmp >= 0; + case "=": + return cmp === 0; + default: + return Debug.assertNever(operator); + } + } + function formatDisjunction(alternatives) { + return map4(alternatives, formatAlternative).join(" || ") || "*"; + } + function formatAlternative(comparators) { + return map4(comparators, formatComparator).join(" "); + } + function formatComparator(comparator) { + return `${comparator.operator}${comparator.operand}`; + } + var versionRegExp, prereleaseRegExp, prereleasePartRegExp, buildRegExp, buildPartRegExp, numericIdentifierRegExp, _Version, Version, VersionRange, logicalOrRegExp, whitespaceRegExp, partialRegExp, hyphenRegExp, rangeRegExp; + var init_semver = __esm2({ + "src/compiler/semver.ts"() { + "use strict"; + init_ts2(); + versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; + prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i; + buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i; + buildPartRegExp = /^[a-z0-9-]+$/i; + numericIdentifierRegExp = /^(0|[1-9]\d*)$/; + _Version = class _Version2 { + constructor(major, minor = 0, patch = 0, prerelease = "", build2 = "") { + if (typeof major === "string") { + const result2 = Debug.checkDefined(tryParseComponents(major), "Invalid version"); + ({ major, minor, patch, prerelease, build: build2 } = result2); + } + Debug.assert(major >= 0, "Invalid argument: major"); + Debug.assert(minor >= 0, "Invalid argument: minor"); + Debug.assert(patch >= 0, "Invalid argument: patch"); + const prereleaseArray = prerelease ? isArray3(prerelease) ? prerelease : prerelease.split(".") : emptyArray; + const buildArray = build2 ? isArray3(build2) ? build2 : build2.split(".") : emptyArray; + Debug.assert(every2(prereleaseArray, (s7) => prereleasePartRegExp.test(s7)), "Invalid argument: prerelease"); + Debug.assert(every2(buildArray, (s7) => buildPartRegExp.test(s7)), "Invalid argument: build"); + this.major = major; + this.minor = minor; + this.patch = patch; + this.prerelease = prereleaseArray; + this.build = buildArray; + } + static tryParse(text) { + const result2 = tryParseComponents(text); + if (!result2) + return void 0; + const { major, minor, patch, prerelease, build: build2 } = result2; + return new _Version2(major, minor, patch, prerelease, build2); + } + compareTo(other) { + if (this === other) + return 0; + if (other === void 0) + return 1; + return compareValues(this.major, other.major) || compareValues(this.minor, other.minor) || compareValues(this.patch, other.patch) || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); + } + increment(field) { + switch (field) { + case "major": + return new _Version2(this.major + 1, 0, 0); + case "minor": + return new _Version2(this.major, this.minor + 1, 0); + case "patch": + return new _Version2(this.major, this.minor, this.patch + 1); + default: + return Debug.assertNever(field); + } + } + with(fields) { + const { + major = this.major, + minor = this.minor, + patch = this.patch, + prerelease = this.prerelease, + build: build2 = this.build + } = fields; + return new _Version2(major, minor, patch, prerelease, build2); + } + toString() { + let result2 = `${this.major}.${this.minor}.${this.patch}`; + if (some2(this.prerelease)) + result2 += `-${this.prerelease.join(".")}`; + if (some2(this.build)) + result2 += `+${this.build.join(".")}`; + return result2; + } + }; + _Version.zero = new _Version(0, 0, 0, ["0"]); + Version = _Version; + VersionRange = class _VersionRange { + constructor(spec) { + this._alternatives = spec ? Debug.checkDefined(parseRange(spec), "Invalid range spec.") : emptyArray; + } + static tryParse(text) { + const sets = parseRange(text); + if (sets) { + const range2 = new _VersionRange(""); + range2._alternatives = sets; + return range2; + } + return void 0; + } + /** + * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`. + * in `node-semver`. + */ + test(version22) { + if (typeof version22 === "string") + version22 = new Version(version22); + return testDisjunction(version22, this._alternatives); + } + toString() { + return formatDisjunction(this._alternatives); + } + }; + logicalOrRegExp = /\|\|/g; + whitespaceRegExp = /\s+/g; + partialRegExp = /^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; + hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i; + rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i; + } + }); + function hasRequiredAPI(performance22, PerformanceObserver22) { + return typeof performance22 === "object" && typeof performance22.timeOrigin === "number" && typeof performance22.mark === "function" && typeof performance22.measure === "function" && typeof performance22.now === "function" && typeof performance22.clearMarks === "function" && typeof performance22.clearMeasures === "function" && typeof PerformanceObserver22 === "function"; + } + function tryGetWebPerformanceHooks() { + if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) { + return { + // For now we always write native performance events when running in the browser. We may + // make this conditional in the future if we find that native web performance hooks + // in the browser also slow down compilation. + shouldWriteNativeEvents: true, + performance, + PerformanceObserver + }; + } + } + function tryGetNodePerformanceHooks() { + if (isNodeLikeSystem()) { + try { + const { performance: performance22, PerformanceObserver: PerformanceObserver22 } = (init_perf_hooks(), __toCommonJS(perf_hooks_exports)); + if (hasRequiredAPI(performance22, PerformanceObserver22)) { + return { + // By default, only write native events when generating a cpu profile or using the v8 profiler. + shouldWriteNativeEvents: false, + performance: performance22, + PerformanceObserver: PerformanceObserver22 + }; + } + } catch { + } + } + } + function tryGetNativePerformanceHooks() { + return nativePerformanceHooks; + } + var nativePerformanceHooks, nativePerformance, timestamp3; + var init_performanceCore = __esm2({ + "src/compiler/performanceCore.ts"() { + "use strict"; + init_ts2(); + nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); + nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; + timestamp3 = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date(); + } + }); + var etwModule, perfLogger; + var init_perfLogger = __esm2({ + "src/compiler/perfLogger.ts"() { + "use strict"; + try { + const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw"; + etwModule = __require(etwModulePath); + } catch (e10) { + etwModule = void 0; + } + perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0; + } + }); + function createTimerIf(condition, measureName, startMarkName, endMarkName) { + return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; + } + function createTimer(measureName, startMarkName, endMarkName) { + let enterCount = 0; + return { + enter, + exit: exit3 + }; + function enter() { + if (++enterCount === 1) { + mark(startMarkName); + } + } + function exit3() { + if (--enterCount === 0) { + mark(endMarkName); + measure(measureName, startMarkName, endMarkName); + } else if (enterCount < 0) { + Debug.fail("enter/exit count does not match."); + } + } + } + function mark(markName) { + if (enabled) { + const count2 = counts.get(markName) ?? 0; + counts.set(markName, count2 + 1); + marks.set(markName, timestamp3()); + performanceImpl == null ? void 0 : performanceImpl.mark(markName); + if (typeof onProfilerEvent === "function") { + onProfilerEvent(markName); + } + } + } + function measure(measureName, startMarkName, endMarkName) { + if (enabled) { + const end = (endMarkName !== void 0 ? marks.get(endMarkName) : void 0) ?? timestamp3(); + const start = (startMarkName !== void 0 ? marks.get(startMarkName) : void 0) ?? timeorigin; + const previousDuration = durations.get(measureName) || 0; + durations.set(measureName, previousDuration + (end - start)); + performanceImpl == null ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); + } + } + function getCount(markName) { + return counts.get(markName) || 0; + } + function getDuration(measureName) { + return durations.get(measureName) || 0; + } + function forEachMeasure(cb) { + durations.forEach((duration, measureName) => cb(measureName, duration)); + } + function forEachMark(cb) { + marks.forEach((_time, markName) => cb(markName)); + } + function clearMeasures(name2) { + if (name2 !== void 0) + durations.delete(name2); + else + durations.clear(); + performanceImpl == null ? void 0 : performanceImpl.clearMeasures(name2); + } + function clearMarks(name2) { + if (name2 !== void 0) { + counts.delete(name2); + marks.delete(name2); + } else { + counts.clear(); + marks.clear(); + } + performanceImpl == null ? void 0 : performanceImpl.clearMarks(name2); + } + function isEnabled() { + return enabled; + } + function enable(system = sys) { + var _a2; + if (!enabled) { + enabled = true; + perfHooks || (perfHooks = tryGetNativePerformanceHooks()); + if (perfHooks) { + timeorigin = perfHooks.performance.timeOrigin; + if (perfHooks.shouldWriteNativeEvents || ((_a2 = system == null ? void 0 : system.cpuProfilingEnabled) == null ? void 0 : _a2.call(system)) || (system == null ? void 0 : system.debugMode)) { + performanceImpl = perfHooks.performance; + } + } + } + return true; + } + function disable() { + if (enabled) { + marks.clear(); + counts.clear(); + durations.clear(); + performanceImpl = void 0; + enabled = false; + } + } + var perfHooks, performanceImpl, nullTimer, enabled, timeorigin, marks, counts, durations; + var init_performance = __esm2({ + "src/compiler/performance.ts"() { + "use strict"; + init_ts2(); + nullTimer = { enter: noop4, exit: noop4 }; + enabled = false; + timeorigin = timestamp3(); + marks = /* @__PURE__ */ new Map(); + counts = /* @__PURE__ */ new Map(); + durations = /* @__PURE__ */ new Map(); + } + }); + var ts_performance_exports = {}; + __export2(ts_performance_exports, { + clearMarks: () => clearMarks, + clearMeasures: () => clearMeasures, + createTimer: () => createTimer, + createTimerIf: () => createTimerIf, + disable: () => disable, + enable: () => enable, + forEachMark: () => forEachMark, + forEachMeasure: () => forEachMeasure, + getCount: () => getCount, + getDuration: () => getDuration, + isEnabled: () => isEnabled, + mark: () => mark, + measure: () => measure, + nullTimer: () => nullTimer + }); + var init_ts_performance = __esm2({ + "src/compiler/_namespaces/ts.performance.ts"() { + "use strict"; + init_performance(); + } + }); + var tracing, tracingEnabled, startTracing, dumpTracingLegend; + var init_tracing = __esm2({ + "src/compiler/tracing.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + ((tracingEnabled2) => { + let fs; + let traceCount = 0; + let traceFd = 0; + let mode; + const typeCatalog = []; + let legendPath; + const legend = []; + function startTracing2(tracingMode, traceDir, configFilePath) { + Debug.assert(!tracing, "Tracing already started"); + if (fs === void 0) { + try { + fs = (init_fs(), __toCommonJS(fs_exports)); + } catch (e10) { + throw new Error(`tracing requires having fs +(original error: ${e10.message || e10})`); + } + } + mode = tracingMode; + typeCatalog.length = 0; + if (legendPath === void 0) { + legendPath = combinePaths(traceDir, "legend.json"); + } + if (!fs.existsSync(traceDir)) { + fs.mkdirSync(traceDir, { recursive: true }); + } + const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``; + const tracePath = combinePaths(traceDir, `trace${countPart}.json`); + const typesPath = combinePaths(traceDir, `types${countPart}.json`); + legend.push({ + configFilePath, + tracePath, + typesPath + }); + traceFd = fs.openSync(tracePath, "w"); + tracing = tracingEnabled2; + const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp3(), pid: 1, tid: 1 }; + fs.writeSync( + traceFd, + "[\n" + [{ name: "process_name", args: { name: "tsc" }, ...meta }, { name: "thread_name", args: { name: "Main" }, ...meta }, { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" }].map((v8) => JSON.stringify(v8)).join(",\n") + ); + } + tracingEnabled2.startTracing = startTracing2; + function stopTracing() { + Debug.assert(tracing, "Tracing is not in progress"); + Debug.assert(!!typeCatalog.length === (mode !== "server")); + fs.writeSync(traceFd, ` +] +`); + fs.closeSync(traceFd); + tracing = void 0; + if (typeCatalog.length) { + dumpTypes(typeCatalog); + } else { + legend[legend.length - 1].typesPath = void 0; + } + } + tracingEnabled2.stopTracing = stopTracing; + function recordType2(type3) { + if (mode !== "server") { + typeCatalog.push(type3); + } + } + tracingEnabled2.recordType = recordType2; + let Phase; + ((Phase2) => { + Phase2["Parse"] = "parse"; + Phase2["Program"] = "program"; + Phase2["Bind"] = "bind"; + Phase2["Check"] = "check"; + Phase2["CheckTypes"] = "checkTypes"; + Phase2["Emit"] = "emit"; + Phase2["Session"] = "session"; + })(Phase = tracingEnabled2.Phase || (tracingEnabled2.Phase = {})); + function instant(phase, name2, args) { + writeEvent("I", phase, name2, args, `"s":"g"`); + } + tracingEnabled2.instant = instant; + const eventStack = []; + function push4(phase, name2, args, separateBeginAndEnd = false) { + if (separateBeginAndEnd) { + writeEvent("B", phase, name2, args); + } + eventStack.push({ phase, name: name2, args, time: 1e3 * timestamp3(), separateBeginAndEnd }); + } + tracingEnabled2.push = push4; + function pop(results) { + Debug.assert(eventStack.length > 0); + writeStackEvent(eventStack.length - 1, 1e3 * timestamp3(), results); + eventStack.length--; + } + tracingEnabled2.pop = pop; + function popAll() { + const endTime = 1e3 * timestamp3(); + for (let i7 = eventStack.length - 1; i7 >= 0; i7--) { + writeStackEvent(i7, endTime); + } + eventStack.length = 0; + } + tracingEnabled2.popAll = popAll; + const sampleInterval = 1e3 * 10; + function writeStackEvent(index4, endTime, results) { + const { phase, name: name2, args, time: time2, separateBeginAndEnd } = eventStack[index4]; + if (separateBeginAndEnd) { + Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`"); + writeEvent( + "E", + phase, + name2, + args, + /*extras*/ + void 0, + endTime + ); + } else if (sampleInterval - time2 % sampleInterval <= endTime - time2) { + writeEvent("X", phase, name2, { ...args, results }, `"dur":${endTime - time2}`, time2); + } + } + function writeEvent(eventType, phase, name2, args, extras, time2 = 1e3 * timestamp3()) { + if (mode === "server" && phase === "checkTypes") + return; + mark("beginTracing"); + fs.writeSync(traceFd, `, +{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time2},"name":"${name2}"`); + if (extras) + fs.writeSync(traceFd, `,${extras}`); + if (args) + fs.writeSync(traceFd, `,"args":${JSON.stringify(args)}`); + fs.writeSync(traceFd, `}`); + mark("endTracing"); + measure("Tracing", "beginTracing", "endTracing"); + } + function getLocation2(node) { + const file = getSourceFileOfNode(node); + return !file ? void 0 : { + path: file.path, + start: indexFromOne(getLineAndCharacterOfPosition(file, node.pos)), + end: indexFromOne(getLineAndCharacterOfPosition(file, node.end)) + }; + function indexFromOne(lc) { + return { + line: lc.line + 1, + character: lc.character + 1 + }; + } + } + function dumpTypes(types3) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s; + mark("beginDumpTypes"); + const typesPath = legend[legend.length - 1].typesPath; + const typesFd = fs.openSync(typesPath, "w"); + const recursionIdentityMap = /* @__PURE__ */ new Map(); + fs.writeSync(typesFd, "["); + const numTypes = types3.length; + for (let i7 = 0; i7 < numTypes; i7++) { + const type3 = types3[i7]; + const objectFlags = type3.objectFlags; + const symbol = type3.aliasSymbol ?? type3.symbol; + let display; + if (objectFlags & 16 | type3.flags & 2944) { + try { + display = (_a2 = type3.checker) == null ? void 0 : _a2.typeToString(type3); + } catch { + display = void 0; + } + } + let indexedAccessProperties = {}; + if (type3.flags & 8388608) { + const indexedAccessType = type3; + indexedAccessProperties = { + indexedAccessObjectType: (_b = indexedAccessType.objectType) == null ? void 0 : _b.id, + indexedAccessIndexType: (_c = indexedAccessType.indexType) == null ? void 0 : _c.id + }; + } + let referenceProperties = {}; + if (objectFlags & 4) { + const referenceType = type3; + referenceProperties = { + instantiatedType: (_d = referenceType.target) == null ? void 0 : _d.id, + typeArguments: (_e2 = referenceType.resolvedTypeArguments) == null ? void 0 : _e2.map((t8) => t8.id), + referenceLocation: getLocation2(referenceType.node) + }; + } + let conditionalProperties = {}; + if (type3.flags & 16777216) { + const conditionalType = type3; + conditionalProperties = { + conditionalCheckType: (_f = conditionalType.checkType) == null ? void 0 : _f.id, + conditionalExtendsType: (_g = conditionalType.extendsType) == null ? void 0 : _g.id, + conditionalTrueType: ((_h = conditionalType.resolvedTrueType) == null ? void 0 : _h.id) ?? -1, + conditionalFalseType: ((_i = conditionalType.resolvedFalseType) == null ? void 0 : _i.id) ?? -1 + }; + } + let substitutionProperties = {}; + if (type3.flags & 33554432) { + const substitutionType = type3; + substitutionProperties = { + substitutionBaseType: (_j = substitutionType.baseType) == null ? void 0 : _j.id, + constraintType: (_k = substitutionType.constraint) == null ? void 0 : _k.id + }; + } + let reverseMappedProperties = {}; + if (objectFlags & 1024) { + const reverseMappedType = type3; + reverseMappedProperties = { + reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id, + reverseMappedMappedType: (_m = reverseMappedType.mappedType) == null ? void 0 : _m.id, + reverseMappedConstraintType: (_n = reverseMappedType.constraintType) == null ? void 0 : _n.id + }; + } + let evolvingArrayProperties = {}; + if (objectFlags & 256) { + const evolvingArrayType = type3; + evolvingArrayProperties = { + evolvingArrayElementType: evolvingArrayType.elementType.id, + evolvingArrayFinalType: (_o = evolvingArrayType.finalArrayType) == null ? void 0 : _o.id + }; + } + let recursionToken; + const recursionIdentity = type3.checker.getRecursionIdentity(type3); + if (recursionIdentity) { + recursionToken = recursionIdentityMap.get(recursionIdentity); + if (!recursionToken) { + recursionToken = recursionIdentityMap.size; + recursionIdentityMap.set(recursionIdentity, recursionToken); + } + } + const descriptor = { + id: type3.id, + intrinsicName: type3.intrinsicName, + symbolName: (symbol == null ? void 0 : symbol.escapedName) && unescapeLeadingUnderscores(symbol.escapedName), + recursionId: recursionToken, + isTuple: objectFlags & 8 ? true : void 0, + unionTypes: type3.flags & 1048576 ? (_p = type3.types) == null ? void 0 : _p.map((t8) => t8.id) : void 0, + intersectionTypes: type3.flags & 2097152 ? type3.types.map((t8) => t8.id) : void 0, + aliasTypeArguments: (_q = type3.aliasTypeArguments) == null ? void 0 : _q.map((t8) => t8.id), + keyofType: type3.flags & 4194304 ? (_r = type3.type) == null ? void 0 : _r.id : void 0, + ...indexedAccessProperties, + ...referenceProperties, + ...conditionalProperties, + ...substitutionProperties, + ...reverseMappedProperties, + ...evolvingArrayProperties, + destructuringPattern: getLocation2(type3.pattern), + firstDeclaration: getLocation2((_s = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _s[0]), + flags: Debug.formatTypeFlags(type3.flags).split("|"), + display + }; + fs.writeSync(typesFd, JSON.stringify(descriptor)); + if (i7 < numTypes - 1) { + fs.writeSync(typesFd, ",\n"); + } + } + fs.writeSync(typesFd, "]\n"); + fs.closeSync(typesFd); + mark("endDumpTypes"); + measure("Dump types", "beginDumpTypes", "endDumpTypes"); + } + function dumpLegend() { + if (!legendPath) { + return; + } + fs.writeFileSync(legendPath, JSON.stringify(legend)); + } + tracingEnabled2.dumpLegend = dumpLegend; + })(tracingEnabled || (tracingEnabled = {})); + startTracing = tracingEnabled.startTracing; + dumpTracingLegend = tracingEnabled.dumpLegend; + } + }); + function diagnosticCategoryName(d7, lowerCase3 = true) { + const name2 = DiagnosticCategory[d7.category]; + return lowerCase3 ? name2.toLowerCase() : name2; + } + var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension6, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, JSDocParsingMode; + var init_types = __esm2({ + "src/compiler/types.ts"() { + "use strict"; + SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => { + SyntaxKind5[SyntaxKind5["Unknown"] = 0] = "Unknown"; + SyntaxKind5[SyntaxKind5["EndOfFileToken"] = 1] = "EndOfFileToken"; + SyntaxKind5[SyntaxKind5["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; + SyntaxKind5[SyntaxKind5["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; + SyntaxKind5[SyntaxKind5["NewLineTrivia"] = 4] = "NewLineTrivia"; + SyntaxKind5[SyntaxKind5["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; + SyntaxKind5[SyntaxKind5["ShebangTrivia"] = 6] = "ShebangTrivia"; + SyntaxKind5[SyntaxKind5["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; + SyntaxKind5[SyntaxKind5["NonTextFileMarkerTrivia"] = 8] = "NonTextFileMarkerTrivia"; + SyntaxKind5[SyntaxKind5["NumericLiteral"] = 9] = "NumericLiteral"; + SyntaxKind5[SyntaxKind5["BigIntLiteral"] = 10] = "BigIntLiteral"; + SyntaxKind5[SyntaxKind5["StringLiteral"] = 11] = "StringLiteral"; + SyntaxKind5[SyntaxKind5["JsxText"] = 12] = "JsxText"; + SyntaxKind5[SyntaxKind5["JsxTextAllWhiteSpaces"] = 13] = "JsxTextAllWhiteSpaces"; + SyntaxKind5[SyntaxKind5["RegularExpressionLiteral"] = 14] = "RegularExpressionLiteral"; + SyntaxKind5[SyntaxKind5["NoSubstitutionTemplateLiteral"] = 15] = "NoSubstitutionTemplateLiteral"; + SyntaxKind5[SyntaxKind5["TemplateHead"] = 16] = "TemplateHead"; + SyntaxKind5[SyntaxKind5["TemplateMiddle"] = 17] = "TemplateMiddle"; + SyntaxKind5[SyntaxKind5["TemplateTail"] = 18] = "TemplateTail"; + SyntaxKind5[SyntaxKind5["OpenBraceToken"] = 19] = "OpenBraceToken"; + SyntaxKind5[SyntaxKind5["CloseBraceToken"] = 20] = "CloseBraceToken"; + SyntaxKind5[SyntaxKind5["OpenParenToken"] = 21] = "OpenParenToken"; + SyntaxKind5[SyntaxKind5["CloseParenToken"] = 22] = "CloseParenToken"; + SyntaxKind5[SyntaxKind5["OpenBracketToken"] = 23] = "OpenBracketToken"; + SyntaxKind5[SyntaxKind5["CloseBracketToken"] = 24] = "CloseBracketToken"; + SyntaxKind5[SyntaxKind5["DotToken"] = 25] = "DotToken"; + SyntaxKind5[SyntaxKind5["DotDotDotToken"] = 26] = "DotDotDotToken"; + SyntaxKind5[SyntaxKind5["SemicolonToken"] = 27] = "SemicolonToken"; + SyntaxKind5[SyntaxKind5["CommaToken"] = 28] = "CommaToken"; + SyntaxKind5[SyntaxKind5["QuestionDotToken"] = 29] = "QuestionDotToken"; + SyntaxKind5[SyntaxKind5["LessThanToken"] = 30] = "LessThanToken"; + SyntaxKind5[SyntaxKind5["LessThanSlashToken"] = 31] = "LessThanSlashToken"; + SyntaxKind5[SyntaxKind5["GreaterThanToken"] = 32] = "GreaterThanToken"; + SyntaxKind5[SyntaxKind5["LessThanEqualsToken"] = 33] = "LessThanEqualsToken"; + SyntaxKind5[SyntaxKind5["GreaterThanEqualsToken"] = 34] = "GreaterThanEqualsToken"; + SyntaxKind5[SyntaxKind5["EqualsEqualsToken"] = 35] = "EqualsEqualsToken"; + SyntaxKind5[SyntaxKind5["ExclamationEqualsToken"] = 36] = "ExclamationEqualsToken"; + SyntaxKind5[SyntaxKind5["EqualsEqualsEqualsToken"] = 37] = "EqualsEqualsEqualsToken"; + SyntaxKind5[SyntaxKind5["ExclamationEqualsEqualsToken"] = 38] = "ExclamationEqualsEqualsToken"; + SyntaxKind5[SyntaxKind5["EqualsGreaterThanToken"] = 39] = "EqualsGreaterThanToken"; + SyntaxKind5[SyntaxKind5["PlusToken"] = 40] = "PlusToken"; + SyntaxKind5[SyntaxKind5["MinusToken"] = 41] = "MinusToken"; + SyntaxKind5[SyntaxKind5["AsteriskToken"] = 42] = "AsteriskToken"; + SyntaxKind5[SyntaxKind5["AsteriskAsteriskToken"] = 43] = "AsteriskAsteriskToken"; + SyntaxKind5[SyntaxKind5["SlashToken"] = 44] = "SlashToken"; + SyntaxKind5[SyntaxKind5["PercentToken"] = 45] = "PercentToken"; + SyntaxKind5[SyntaxKind5["PlusPlusToken"] = 46] = "PlusPlusToken"; + SyntaxKind5[SyntaxKind5["MinusMinusToken"] = 47] = "MinusMinusToken"; + SyntaxKind5[SyntaxKind5["LessThanLessThanToken"] = 48] = "LessThanLessThanToken"; + SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanToken"] = 49] = "GreaterThanGreaterThanToken"; + SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanGreaterThanToken"] = 50] = "GreaterThanGreaterThanGreaterThanToken"; + SyntaxKind5[SyntaxKind5["AmpersandToken"] = 51] = "AmpersandToken"; + SyntaxKind5[SyntaxKind5["BarToken"] = 52] = "BarToken"; + SyntaxKind5[SyntaxKind5["CaretToken"] = 53] = "CaretToken"; + SyntaxKind5[SyntaxKind5["ExclamationToken"] = 54] = "ExclamationToken"; + SyntaxKind5[SyntaxKind5["TildeToken"] = 55] = "TildeToken"; + SyntaxKind5[SyntaxKind5["AmpersandAmpersandToken"] = 56] = "AmpersandAmpersandToken"; + SyntaxKind5[SyntaxKind5["BarBarToken"] = 57] = "BarBarToken"; + SyntaxKind5[SyntaxKind5["QuestionToken"] = 58] = "QuestionToken"; + SyntaxKind5[SyntaxKind5["ColonToken"] = 59] = "ColonToken"; + SyntaxKind5[SyntaxKind5["AtToken"] = 60] = "AtToken"; + SyntaxKind5[SyntaxKind5["QuestionQuestionToken"] = 61] = "QuestionQuestionToken"; + SyntaxKind5[SyntaxKind5["BacktickToken"] = 62] = "BacktickToken"; + SyntaxKind5[SyntaxKind5["HashToken"] = 63] = "HashToken"; + SyntaxKind5[SyntaxKind5["EqualsToken"] = 64] = "EqualsToken"; + SyntaxKind5[SyntaxKind5["PlusEqualsToken"] = 65] = "PlusEqualsToken"; + SyntaxKind5[SyntaxKind5["MinusEqualsToken"] = 66] = "MinusEqualsToken"; + SyntaxKind5[SyntaxKind5["AsteriskEqualsToken"] = 67] = "AsteriskEqualsToken"; + SyntaxKind5[SyntaxKind5["AsteriskAsteriskEqualsToken"] = 68] = "AsteriskAsteriskEqualsToken"; + SyntaxKind5[SyntaxKind5["SlashEqualsToken"] = 69] = "SlashEqualsToken"; + SyntaxKind5[SyntaxKind5["PercentEqualsToken"] = 70] = "PercentEqualsToken"; + SyntaxKind5[SyntaxKind5["LessThanLessThanEqualsToken"] = 71] = "LessThanLessThanEqualsToken"; + SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanEqualsToken"; + SyntaxKind5[SyntaxKind5["GreaterThanGreaterThanGreaterThanEqualsToken"] = 73] = "GreaterThanGreaterThanGreaterThanEqualsToken"; + SyntaxKind5[SyntaxKind5["AmpersandEqualsToken"] = 74] = "AmpersandEqualsToken"; + SyntaxKind5[SyntaxKind5["BarEqualsToken"] = 75] = "BarEqualsToken"; + SyntaxKind5[SyntaxKind5["BarBarEqualsToken"] = 76] = "BarBarEqualsToken"; + SyntaxKind5[SyntaxKind5["AmpersandAmpersandEqualsToken"] = 77] = "AmpersandAmpersandEqualsToken"; + SyntaxKind5[SyntaxKind5["QuestionQuestionEqualsToken"] = 78] = "QuestionQuestionEqualsToken"; + SyntaxKind5[SyntaxKind5["CaretEqualsToken"] = 79] = "CaretEqualsToken"; + SyntaxKind5[SyntaxKind5["Identifier"] = 80] = "Identifier"; + SyntaxKind5[SyntaxKind5["PrivateIdentifier"] = 81] = "PrivateIdentifier"; + SyntaxKind5[SyntaxKind5["JSDocCommentTextToken"] = 82] = "JSDocCommentTextToken"; + SyntaxKind5[SyntaxKind5["BreakKeyword"] = 83] = "BreakKeyword"; + SyntaxKind5[SyntaxKind5["CaseKeyword"] = 84] = "CaseKeyword"; + SyntaxKind5[SyntaxKind5["CatchKeyword"] = 85] = "CatchKeyword"; + SyntaxKind5[SyntaxKind5["ClassKeyword"] = 86] = "ClassKeyword"; + SyntaxKind5[SyntaxKind5["ConstKeyword"] = 87] = "ConstKeyword"; + SyntaxKind5[SyntaxKind5["ContinueKeyword"] = 88] = "ContinueKeyword"; + SyntaxKind5[SyntaxKind5["DebuggerKeyword"] = 89] = "DebuggerKeyword"; + SyntaxKind5[SyntaxKind5["DefaultKeyword"] = 90] = "DefaultKeyword"; + SyntaxKind5[SyntaxKind5["DeleteKeyword"] = 91] = "DeleteKeyword"; + SyntaxKind5[SyntaxKind5["DoKeyword"] = 92] = "DoKeyword"; + SyntaxKind5[SyntaxKind5["ElseKeyword"] = 93] = "ElseKeyword"; + SyntaxKind5[SyntaxKind5["EnumKeyword"] = 94] = "EnumKeyword"; + SyntaxKind5[SyntaxKind5["ExportKeyword"] = 95] = "ExportKeyword"; + SyntaxKind5[SyntaxKind5["ExtendsKeyword"] = 96] = "ExtendsKeyword"; + SyntaxKind5[SyntaxKind5["FalseKeyword"] = 97] = "FalseKeyword"; + SyntaxKind5[SyntaxKind5["FinallyKeyword"] = 98] = "FinallyKeyword"; + SyntaxKind5[SyntaxKind5["ForKeyword"] = 99] = "ForKeyword"; + SyntaxKind5[SyntaxKind5["FunctionKeyword"] = 100] = "FunctionKeyword"; + SyntaxKind5[SyntaxKind5["IfKeyword"] = 101] = "IfKeyword"; + SyntaxKind5[SyntaxKind5["ImportKeyword"] = 102] = "ImportKeyword"; + SyntaxKind5[SyntaxKind5["InKeyword"] = 103] = "InKeyword"; + SyntaxKind5[SyntaxKind5["InstanceOfKeyword"] = 104] = "InstanceOfKeyword"; + SyntaxKind5[SyntaxKind5["NewKeyword"] = 105] = "NewKeyword"; + SyntaxKind5[SyntaxKind5["NullKeyword"] = 106] = "NullKeyword"; + SyntaxKind5[SyntaxKind5["ReturnKeyword"] = 107] = "ReturnKeyword"; + SyntaxKind5[SyntaxKind5["SuperKeyword"] = 108] = "SuperKeyword"; + SyntaxKind5[SyntaxKind5["SwitchKeyword"] = 109] = "SwitchKeyword"; + SyntaxKind5[SyntaxKind5["ThisKeyword"] = 110] = "ThisKeyword"; + SyntaxKind5[SyntaxKind5["ThrowKeyword"] = 111] = "ThrowKeyword"; + SyntaxKind5[SyntaxKind5["TrueKeyword"] = 112] = "TrueKeyword"; + SyntaxKind5[SyntaxKind5["TryKeyword"] = 113] = "TryKeyword"; + SyntaxKind5[SyntaxKind5["TypeOfKeyword"] = 114] = "TypeOfKeyword"; + SyntaxKind5[SyntaxKind5["VarKeyword"] = 115] = "VarKeyword"; + SyntaxKind5[SyntaxKind5["VoidKeyword"] = 116] = "VoidKeyword"; + SyntaxKind5[SyntaxKind5["WhileKeyword"] = 117] = "WhileKeyword"; + SyntaxKind5[SyntaxKind5["WithKeyword"] = 118] = "WithKeyword"; + SyntaxKind5[SyntaxKind5["ImplementsKeyword"] = 119] = "ImplementsKeyword"; + SyntaxKind5[SyntaxKind5["InterfaceKeyword"] = 120] = "InterfaceKeyword"; + SyntaxKind5[SyntaxKind5["LetKeyword"] = 121] = "LetKeyword"; + SyntaxKind5[SyntaxKind5["PackageKeyword"] = 122] = "PackageKeyword"; + SyntaxKind5[SyntaxKind5["PrivateKeyword"] = 123] = "PrivateKeyword"; + SyntaxKind5[SyntaxKind5["ProtectedKeyword"] = 124] = "ProtectedKeyword"; + SyntaxKind5[SyntaxKind5["PublicKeyword"] = 125] = "PublicKeyword"; + SyntaxKind5[SyntaxKind5["StaticKeyword"] = 126] = "StaticKeyword"; + SyntaxKind5[SyntaxKind5["YieldKeyword"] = 127] = "YieldKeyword"; + SyntaxKind5[SyntaxKind5["AbstractKeyword"] = 128] = "AbstractKeyword"; + SyntaxKind5[SyntaxKind5["AccessorKeyword"] = 129] = "AccessorKeyword"; + SyntaxKind5[SyntaxKind5["AsKeyword"] = 130] = "AsKeyword"; + SyntaxKind5[SyntaxKind5["AssertsKeyword"] = 131] = "AssertsKeyword"; + SyntaxKind5[SyntaxKind5["AssertKeyword"] = 132] = "AssertKeyword"; + SyntaxKind5[SyntaxKind5["AnyKeyword"] = 133] = "AnyKeyword"; + SyntaxKind5[SyntaxKind5["AsyncKeyword"] = 134] = "AsyncKeyword"; + SyntaxKind5[SyntaxKind5["AwaitKeyword"] = 135] = "AwaitKeyword"; + SyntaxKind5[SyntaxKind5["BooleanKeyword"] = 136] = "BooleanKeyword"; + SyntaxKind5[SyntaxKind5["ConstructorKeyword"] = 137] = "ConstructorKeyword"; + SyntaxKind5[SyntaxKind5["DeclareKeyword"] = 138] = "DeclareKeyword"; + SyntaxKind5[SyntaxKind5["GetKeyword"] = 139] = "GetKeyword"; + SyntaxKind5[SyntaxKind5["InferKeyword"] = 140] = "InferKeyword"; + SyntaxKind5[SyntaxKind5["IntrinsicKeyword"] = 141] = "IntrinsicKeyword"; + SyntaxKind5[SyntaxKind5["IsKeyword"] = 142] = "IsKeyword"; + SyntaxKind5[SyntaxKind5["KeyOfKeyword"] = 143] = "KeyOfKeyword"; + SyntaxKind5[SyntaxKind5["ModuleKeyword"] = 144] = "ModuleKeyword"; + SyntaxKind5[SyntaxKind5["NamespaceKeyword"] = 145] = "NamespaceKeyword"; + SyntaxKind5[SyntaxKind5["NeverKeyword"] = 146] = "NeverKeyword"; + SyntaxKind5[SyntaxKind5["OutKeyword"] = 147] = "OutKeyword"; + SyntaxKind5[SyntaxKind5["ReadonlyKeyword"] = 148] = "ReadonlyKeyword"; + SyntaxKind5[SyntaxKind5["RequireKeyword"] = 149] = "RequireKeyword"; + SyntaxKind5[SyntaxKind5["NumberKeyword"] = 150] = "NumberKeyword"; + SyntaxKind5[SyntaxKind5["ObjectKeyword"] = 151] = "ObjectKeyword"; + SyntaxKind5[SyntaxKind5["SatisfiesKeyword"] = 152] = "SatisfiesKeyword"; + SyntaxKind5[SyntaxKind5["SetKeyword"] = 153] = "SetKeyword"; + SyntaxKind5[SyntaxKind5["StringKeyword"] = 154] = "StringKeyword"; + SyntaxKind5[SyntaxKind5["SymbolKeyword"] = 155] = "SymbolKeyword"; + SyntaxKind5[SyntaxKind5["TypeKeyword"] = 156] = "TypeKeyword"; + SyntaxKind5[SyntaxKind5["UndefinedKeyword"] = 157] = "UndefinedKeyword"; + SyntaxKind5[SyntaxKind5["UniqueKeyword"] = 158] = "UniqueKeyword"; + SyntaxKind5[SyntaxKind5["UnknownKeyword"] = 159] = "UnknownKeyword"; + SyntaxKind5[SyntaxKind5["UsingKeyword"] = 160] = "UsingKeyword"; + SyntaxKind5[SyntaxKind5["FromKeyword"] = 161] = "FromKeyword"; + SyntaxKind5[SyntaxKind5["GlobalKeyword"] = 162] = "GlobalKeyword"; + SyntaxKind5[SyntaxKind5["BigIntKeyword"] = 163] = "BigIntKeyword"; + SyntaxKind5[SyntaxKind5["OverrideKeyword"] = 164] = "OverrideKeyword"; + SyntaxKind5[SyntaxKind5["OfKeyword"] = 165] = "OfKeyword"; + SyntaxKind5[SyntaxKind5["QualifiedName"] = 166] = "QualifiedName"; + SyntaxKind5[SyntaxKind5["ComputedPropertyName"] = 167] = "ComputedPropertyName"; + SyntaxKind5[SyntaxKind5["TypeParameter"] = 168] = "TypeParameter"; + SyntaxKind5[SyntaxKind5["Parameter"] = 169] = "Parameter"; + SyntaxKind5[SyntaxKind5["Decorator"] = 170] = "Decorator"; + SyntaxKind5[SyntaxKind5["PropertySignature"] = 171] = "PropertySignature"; + SyntaxKind5[SyntaxKind5["PropertyDeclaration"] = 172] = "PropertyDeclaration"; + SyntaxKind5[SyntaxKind5["MethodSignature"] = 173] = "MethodSignature"; + SyntaxKind5[SyntaxKind5["MethodDeclaration"] = 174] = "MethodDeclaration"; + SyntaxKind5[SyntaxKind5["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration"; + SyntaxKind5[SyntaxKind5["Constructor"] = 176] = "Constructor"; + SyntaxKind5[SyntaxKind5["GetAccessor"] = 177] = "GetAccessor"; + SyntaxKind5[SyntaxKind5["SetAccessor"] = 178] = "SetAccessor"; + SyntaxKind5[SyntaxKind5["CallSignature"] = 179] = "CallSignature"; + SyntaxKind5[SyntaxKind5["ConstructSignature"] = 180] = "ConstructSignature"; + SyntaxKind5[SyntaxKind5["IndexSignature"] = 181] = "IndexSignature"; + SyntaxKind5[SyntaxKind5["TypePredicate"] = 182] = "TypePredicate"; + SyntaxKind5[SyntaxKind5["TypeReference"] = 183] = "TypeReference"; + SyntaxKind5[SyntaxKind5["FunctionType"] = 184] = "FunctionType"; + SyntaxKind5[SyntaxKind5["ConstructorType"] = 185] = "ConstructorType"; + SyntaxKind5[SyntaxKind5["TypeQuery"] = 186] = "TypeQuery"; + SyntaxKind5[SyntaxKind5["TypeLiteral"] = 187] = "TypeLiteral"; + SyntaxKind5[SyntaxKind5["ArrayType"] = 188] = "ArrayType"; + SyntaxKind5[SyntaxKind5["TupleType"] = 189] = "TupleType"; + SyntaxKind5[SyntaxKind5["OptionalType"] = 190] = "OptionalType"; + SyntaxKind5[SyntaxKind5["RestType"] = 191] = "RestType"; + SyntaxKind5[SyntaxKind5["UnionType"] = 192] = "UnionType"; + SyntaxKind5[SyntaxKind5["IntersectionType"] = 193] = "IntersectionType"; + SyntaxKind5[SyntaxKind5["ConditionalType"] = 194] = "ConditionalType"; + SyntaxKind5[SyntaxKind5["InferType"] = 195] = "InferType"; + SyntaxKind5[SyntaxKind5["ParenthesizedType"] = 196] = "ParenthesizedType"; + SyntaxKind5[SyntaxKind5["ThisType"] = 197] = "ThisType"; + SyntaxKind5[SyntaxKind5["TypeOperator"] = 198] = "TypeOperator"; + SyntaxKind5[SyntaxKind5["IndexedAccessType"] = 199] = "IndexedAccessType"; + SyntaxKind5[SyntaxKind5["MappedType"] = 200] = "MappedType"; + SyntaxKind5[SyntaxKind5["LiteralType"] = 201] = "LiteralType"; + SyntaxKind5[SyntaxKind5["NamedTupleMember"] = 202] = "NamedTupleMember"; + SyntaxKind5[SyntaxKind5["TemplateLiteralType"] = 203] = "TemplateLiteralType"; + SyntaxKind5[SyntaxKind5["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan"; + SyntaxKind5[SyntaxKind5["ImportType"] = 205] = "ImportType"; + SyntaxKind5[SyntaxKind5["ObjectBindingPattern"] = 206] = "ObjectBindingPattern"; + SyntaxKind5[SyntaxKind5["ArrayBindingPattern"] = 207] = "ArrayBindingPattern"; + SyntaxKind5[SyntaxKind5["BindingElement"] = 208] = "BindingElement"; + SyntaxKind5[SyntaxKind5["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression"; + SyntaxKind5[SyntaxKind5["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression"; + SyntaxKind5[SyntaxKind5["PropertyAccessExpression"] = 211] = "PropertyAccessExpression"; + SyntaxKind5[SyntaxKind5["ElementAccessExpression"] = 212] = "ElementAccessExpression"; + SyntaxKind5[SyntaxKind5["CallExpression"] = 213] = "CallExpression"; + SyntaxKind5[SyntaxKind5["NewExpression"] = 214] = "NewExpression"; + SyntaxKind5[SyntaxKind5["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression"; + SyntaxKind5[SyntaxKind5["TypeAssertionExpression"] = 216] = "TypeAssertionExpression"; + SyntaxKind5[SyntaxKind5["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; + SyntaxKind5[SyntaxKind5["FunctionExpression"] = 218] = "FunctionExpression"; + SyntaxKind5[SyntaxKind5["ArrowFunction"] = 219] = "ArrowFunction"; + SyntaxKind5[SyntaxKind5["DeleteExpression"] = 220] = "DeleteExpression"; + SyntaxKind5[SyntaxKind5["TypeOfExpression"] = 221] = "TypeOfExpression"; + SyntaxKind5[SyntaxKind5["VoidExpression"] = 222] = "VoidExpression"; + SyntaxKind5[SyntaxKind5["AwaitExpression"] = 223] = "AwaitExpression"; + SyntaxKind5[SyntaxKind5["PrefixUnaryExpression"] = 224] = "PrefixUnaryExpression"; + SyntaxKind5[SyntaxKind5["PostfixUnaryExpression"] = 225] = "PostfixUnaryExpression"; + SyntaxKind5[SyntaxKind5["BinaryExpression"] = 226] = "BinaryExpression"; + SyntaxKind5[SyntaxKind5["ConditionalExpression"] = 227] = "ConditionalExpression"; + SyntaxKind5[SyntaxKind5["TemplateExpression"] = 228] = "TemplateExpression"; + SyntaxKind5[SyntaxKind5["YieldExpression"] = 229] = "YieldExpression"; + SyntaxKind5[SyntaxKind5["SpreadElement"] = 230] = "SpreadElement"; + SyntaxKind5[SyntaxKind5["ClassExpression"] = 231] = "ClassExpression"; + SyntaxKind5[SyntaxKind5["OmittedExpression"] = 232] = "OmittedExpression"; + SyntaxKind5[SyntaxKind5["ExpressionWithTypeArguments"] = 233] = "ExpressionWithTypeArguments"; + SyntaxKind5[SyntaxKind5["AsExpression"] = 234] = "AsExpression"; + SyntaxKind5[SyntaxKind5["NonNullExpression"] = 235] = "NonNullExpression"; + SyntaxKind5[SyntaxKind5["MetaProperty"] = 236] = "MetaProperty"; + SyntaxKind5[SyntaxKind5["SyntheticExpression"] = 237] = "SyntheticExpression"; + SyntaxKind5[SyntaxKind5["SatisfiesExpression"] = 238] = "SatisfiesExpression"; + SyntaxKind5[SyntaxKind5["TemplateSpan"] = 239] = "TemplateSpan"; + SyntaxKind5[SyntaxKind5["SemicolonClassElement"] = 240] = "SemicolonClassElement"; + SyntaxKind5[SyntaxKind5["Block"] = 241] = "Block"; + SyntaxKind5[SyntaxKind5["EmptyStatement"] = 242] = "EmptyStatement"; + SyntaxKind5[SyntaxKind5["VariableStatement"] = 243] = "VariableStatement"; + SyntaxKind5[SyntaxKind5["ExpressionStatement"] = 244] = "ExpressionStatement"; + SyntaxKind5[SyntaxKind5["IfStatement"] = 245] = "IfStatement"; + SyntaxKind5[SyntaxKind5["DoStatement"] = 246] = "DoStatement"; + SyntaxKind5[SyntaxKind5["WhileStatement"] = 247] = "WhileStatement"; + SyntaxKind5[SyntaxKind5["ForStatement"] = 248] = "ForStatement"; + SyntaxKind5[SyntaxKind5["ForInStatement"] = 249] = "ForInStatement"; + SyntaxKind5[SyntaxKind5["ForOfStatement"] = 250] = "ForOfStatement"; + SyntaxKind5[SyntaxKind5["ContinueStatement"] = 251] = "ContinueStatement"; + SyntaxKind5[SyntaxKind5["BreakStatement"] = 252] = "BreakStatement"; + SyntaxKind5[SyntaxKind5["ReturnStatement"] = 253] = "ReturnStatement"; + SyntaxKind5[SyntaxKind5["WithStatement"] = 254] = "WithStatement"; + SyntaxKind5[SyntaxKind5["SwitchStatement"] = 255] = "SwitchStatement"; + SyntaxKind5[SyntaxKind5["LabeledStatement"] = 256] = "LabeledStatement"; + SyntaxKind5[SyntaxKind5["ThrowStatement"] = 257] = "ThrowStatement"; + SyntaxKind5[SyntaxKind5["TryStatement"] = 258] = "TryStatement"; + SyntaxKind5[SyntaxKind5["DebuggerStatement"] = 259] = "DebuggerStatement"; + SyntaxKind5[SyntaxKind5["VariableDeclaration"] = 260] = "VariableDeclaration"; + SyntaxKind5[SyntaxKind5["VariableDeclarationList"] = 261] = "VariableDeclarationList"; + SyntaxKind5[SyntaxKind5["FunctionDeclaration"] = 262] = "FunctionDeclaration"; + SyntaxKind5[SyntaxKind5["ClassDeclaration"] = 263] = "ClassDeclaration"; + SyntaxKind5[SyntaxKind5["InterfaceDeclaration"] = 264] = "InterfaceDeclaration"; + SyntaxKind5[SyntaxKind5["TypeAliasDeclaration"] = 265] = "TypeAliasDeclaration"; + SyntaxKind5[SyntaxKind5["EnumDeclaration"] = 266] = "EnumDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleDeclaration"] = 267] = "ModuleDeclaration"; + SyntaxKind5[SyntaxKind5["ModuleBlock"] = 268] = "ModuleBlock"; + SyntaxKind5[SyntaxKind5["CaseBlock"] = 269] = "CaseBlock"; + SyntaxKind5[SyntaxKind5["NamespaceExportDeclaration"] = 270] = "NamespaceExportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportEqualsDeclaration"] = 271] = "ImportEqualsDeclaration"; + SyntaxKind5[SyntaxKind5["ImportDeclaration"] = 272] = "ImportDeclaration"; + SyntaxKind5[SyntaxKind5["ImportClause"] = 273] = "ImportClause"; + SyntaxKind5[SyntaxKind5["NamespaceImport"] = 274] = "NamespaceImport"; + SyntaxKind5[SyntaxKind5["NamedImports"] = 275] = "NamedImports"; + SyntaxKind5[SyntaxKind5["ImportSpecifier"] = 276] = "ImportSpecifier"; + SyntaxKind5[SyntaxKind5["ExportAssignment"] = 277] = "ExportAssignment"; + SyntaxKind5[SyntaxKind5["ExportDeclaration"] = 278] = "ExportDeclaration"; + SyntaxKind5[SyntaxKind5["NamedExports"] = 279] = "NamedExports"; + SyntaxKind5[SyntaxKind5["NamespaceExport"] = 280] = "NamespaceExport"; + SyntaxKind5[SyntaxKind5["ExportSpecifier"] = 281] = "ExportSpecifier"; + SyntaxKind5[SyntaxKind5["MissingDeclaration"] = 282] = "MissingDeclaration"; + SyntaxKind5[SyntaxKind5["ExternalModuleReference"] = 283] = "ExternalModuleReference"; + SyntaxKind5[SyntaxKind5["JsxElement"] = 284] = "JsxElement"; + SyntaxKind5[SyntaxKind5["JsxSelfClosingElement"] = 285] = "JsxSelfClosingElement"; + SyntaxKind5[SyntaxKind5["JsxOpeningElement"] = 286] = "JsxOpeningElement"; + SyntaxKind5[SyntaxKind5["JsxClosingElement"] = 287] = "JsxClosingElement"; + SyntaxKind5[SyntaxKind5["JsxFragment"] = 288] = "JsxFragment"; + SyntaxKind5[SyntaxKind5["JsxOpeningFragment"] = 289] = "JsxOpeningFragment"; + SyntaxKind5[SyntaxKind5["JsxClosingFragment"] = 290] = "JsxClosingFragment"; + SyntaxKind5[SyntaxKind5["JsxAttribute"] = 291] = "JsxAttribute"; + SyntaxKind5[SyntaxKind5["JsxAttributes"] = 292] = "JsxAttributes"; + SyntaxKind5[SyntaxKind5["JsxSpreadAttribute"] = 293] = "JsxSpreadAttribute"; + SyntaxKind5[SyntaxKind5["JsxExpression"] = 294] = "JsxExpression"; + SyntaxKind5[SyntaxKind5["JsxNamespacedName"] = 295] = "JsxNamespacedName"; + SyntaxKind5[SyntaxKind5["CaseClause"] = 296] = "CaseClause"; + SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause"; + SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause"; + SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause"; + SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes"; + SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute"; + SyntaxKind5[ + SyntaxKind5["AssertClause"] = 300 + /* ImportAttributes */ + ] = "AssertClause"; + SyntaxKind5[ + SyntaxKind5["AssertEntry"] = 301 + /* ImportAttribute */ + ] = "AssertEntry"; + SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer"; + SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment"; + SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment"; + SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 305] = "SpreadAssignment"; + SyntaxKind5[SyntaxKind5["EnumMember"] = 306] = "EnumMember"; + SyntaxKind5[SyntaxKind5["UnparsedPrologue"] = 307] = "UnparsedPrologue"; + SyntaxKind5[SyntaxKind5["UnparsedPrepend"] = 308] = "UnparsedPrepend"; + SyntaxKind5[SyntaxKind5["UnparsedText"] = 309] = "UnparsedText"; + SyntaxKind5[SyntaxKind5["UnparsedInternalText"] = 310] = "UnparsedInternalText"; + SyntaxKind5[SyntaxKind5["UnparsedSyntheticReference"] = 311] = "UnparsedSyntheticReference"; + SyntaxKind5[SyntaxKind5["SourceFile"] = 312] = "SourceFile"; + SyntaxKind5[SyntaxKind5["Bundle"] = 313] = "Bundle"; + SyntaxKind5[SyntaxKind5["UnparsedSource"] = 314] = "UnparsedSource"; + SyntaxKind5[SyntaxKind5["InputFiles"] = 315] = "InputFiles"; + SyntaxKind5[SyntaxKind5["JSDocTypeExpression"] = 316] = "JSDocTypeExpression"; + SyntaxKind5[SyntaxKind5["JSDocNameReference"] = 317] = "JSDocNameReference"; + SyntaxKind5[SyntaxKind5["JSDocMemberName"] = 318] = "JSDocMemberName"; + SyntaxKind5[SyntaxKind5["JSDocAllType"] = 319] = "JSDocAllType"; + SyntaxKind5[SyntaxKind5["JSDocUnknownType"] = 320] = "JSDocUnknownType"; + SyntaxKind5[SyntaxKind5["JSDocNullableType"] = 321] = "JSDocNullableType"; + SyntaxKind5[SyntaxKind5["JSDocNonNullableType"] = 322] = "JSDocNonNullableType"; + SyntaxKind5[SyntaxKind5["JSDocOptionalType"] = 323] = "JSDocOptionalType"; + SyntaxKind5[SyntaxKind5["JSDocFunctionType"] = 324] = "JSDocFunctionType"; + SyntaxKind5[SyntaxKind5["JSDocVariadicType"] = 325] = "JSDocVariadicType"; + SyntaxKind5[SyntaxKind5["JSDocNamepathType"] = 326] = "JSDocNamepathType"; + SyntaxKind5[SyntaxKind5["JSDoc"] = 327] = "JSDoc"; + SyntaxKind5[ + SyntaxKind5["JSDocComment"] = 327 + /* JSDoc */ + ] = "JSDocComment"; + SyntaxKind5[SyntaxKind5["JSDocText"] = 328] = "JSDocText"; + SyntaxKind5[SyntaxKind5["JSDocTypeLiteral"] = 329] = "JSDocTypeLiteral"; + SyntaxKind5[SyntaxKind5["JSDocSignature"] = 330] = "JSDocSignature"; + SyntaxKind5[SyntaxKind5["JSDocLink"] = 331] = "JSDocLink"; + SyntaxKind5[SyntaxKind5["JSDocLinkCode"] = 332] = "JSDocLinkCode"; + SyntaxKind5[SyntaxKind5["JSDocLinkPlain"] = 333] = "JSDocLinkPlain"; + SyntaxKind5[SyntaxKind5["JSDocTag"] = 334] = "JSDocTag"; + SyntaxKind5[SyntaxKind5["JSDocAugmentsTag"] = 335] = "JSDocAugmentsTag"; + SyntaxKind5[SyntaxKind5["JSDocImplementsTag"] = 336] = "JSDocImplementsTag"; + SyntaxKind5[SyntaxKind5["JSDocAuthorTag"] = 337] = "JSDocAuthorTag"; + SyntaxKind5[SyntaxKind5["JSDocDeprecatedTag"] = 338] = "JSDocDeprecatedTag"; + SyntaxKind5[SyntaxKind5["JSDocClassTag"] = 339] = "JSDocClassTag"; + SyntaxKind5[SyntaxKind5["JSDocPublicTag"] = 340] = "JSDocPublicTag"; + SyntaxKind5[SyntaxKind5["JSDocPrivateTag"] = 341] = "JSDocPrivateTag"; + SyntaxKind5[SyntaxKind5["JSDocProtectedTag"] = 342] = "JSDocProtectedTag"; + SyntaxKind5[SyntaxKind5["JSDocReadonlyTag"] = 343] = "JSDocReadonlyTag"; + SyntaxKind5[SyntaxKind5["JSDocOverrideTag"] = 344] = "JSDocOverrideTag"; + SyntaxKind5[SyntaxKind5["JSDocCallbackTag"] = 345] = "JSDocCallbackTag"; + SyntaxKind5[SyntaxKind5["JSDocOverloadTag"] = 346] = "JSDocOverloadTag"; + SyntaxKind5[SyntaxKind5["JSDocEnumTag"] = 347] = "JSDocEnumTag"; + SyntaxKind5[SyntaxKind5["JSDocParameterTag"] = 348] = "JSDocParameterTag"; + SyntaxKind5[SyntaxKind5["JSDocReturnTag"] = 349] = "JSDocReturnTag"; + SyntaxKind5[SyntaxKind5["JSDocThisTag"] = 350] = "JSDocThisTag"; + SyntaxKind5[SyntaxKind5["JSDocTypeTag"] = 351] = "JSDocTypeTag"; + SyntaxKind5[SyntaxKind5["JSDocTemplateTag"] = 352] = "JSDocTemplateTag"; + SyntaxKind5[SyntaxKind5["JSDocTypedefTag"] = 353] = "JSDocTypedefTag"; + SyntaxKind5[SyntaxKind5["JSDocSeeTag"] = 354] = "JSDocSeeTag"; + SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 355] = "JSDocPropertyTag"; + SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 356] = "JSDocThrowsTag"; + SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag"; + SyntaxKind5[SyntaxKind5["SyntaxList"] = 358] = "SyntaxList"; + SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 359] = "NotEmittedStatement"; + SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 360] = "PartiallyEmittedExpression"; + SyntaxKind5[SyntaxKind5["CommaListExpression"] = 361] = "CommaListExpression"; + SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 362] = "SyntheticReferenceExpression"; + SyntaxKind5[SyntaxKind5["Count"] = 363] = "Count"; + SyntaxKind5[ + SyntaxKind5["FirstAssignment"] = 64 + /* EqualsToken */ + ] = "FirstAssignment"; + SyntaxKind5[ + SyntaxKind5["LastAssignment"] = 79 + /* CaretEqualsToken */ + ] = "LastAssignment"; + SyntaxKind5[ + SyntaxKind5["FirstCompoundAssignment"] = 65 + /* PlusEqualsToken */ + ] = "FirstCompoundAssignment"; + SyntaxKind5[ + SyntaxKind5["LastCompoundAssignment"] = 79 + /* CaretEqualsToken */ + ] = "LastCompoundAssignment"; + SyntaxKind5[ + SyntaxKind5["FirstReservedWord"] = 83 + /* BreakKeyword */ + ] = "FirstReservedWord"; + SyntaxKind5[ + SyntaxKind5["LastReservedWord"] = 118 + /* WithKeyword */ + ] = "LastReservedWord"; + SyntaxKind5[ + SyntaxKind5["FirstKeyword"] = 83 + /* BreakKeyword */ + ] = "FirstKeyword"; + SyntaxKind5[ + SyntaxKind5["LastKeyword"] = 165 + /* OfKeyword */ + ] = "LastKeyword"; + SyntaxKind5[ + SyntaxKind5["FirstFutureReservedWord"] = 119 + /* ImplementsKeyword */ + ] = "FirstFutureReservedWord"; + SyntaxKind5[ + SyntaxKind5["LastFutureReservedWord"] = 127 + /* YieldKeyword */ + ] = "LastFutureReservedWord"; + SyntaxKind5[ + SyntaxKind5["FirstTypeNode"] = 182 + /* TypePredicate */ + ] = "FirstTypeNode"; + SyntaxKind5[ + SyntaxKind5["LastTypeNode"] = 205 + /* ImportType */ + ] = "LastTypeNode"; + SyntaxKind5[ + SyntaxKind5["FirstPunctuation"] = 19 + /* OpenBraceToken */ + ] = "FirstPunctuation"; + SyntaxKind5[ + SyntaxKind5["LastPunctuation"] = 79 + /* CaretEqualsToken */ + ] = "LastPunctuation"; + SyntaxKind5[ + SyntaxKind5["FirstToken"] = 0 + /* Unknown */ + ] = "FirstToken"; + SyntaxKind5[ + SyntaxKind5["LastToken"] = 165 + /* LastKeyword */ + ] = "LastToken"; + SyntaxKind5[ + SyntaxKind5["FirstTriviaToken"] = 2 + /* SingleLineCommentTrivia */ + ] = "FirstTriviaToken"; + SyntaxKind5[ + SyntaxKind5["LastTriviaToken"] = 7 + /* ConflictMarkerTrivia */ + ] = "LastTriviaToken"; + SyntaxKind5[ + SyntaxKind5["FirstLiteralToken"] = 9 + /* NumericLiteral */ + ] = "FirstLiteralToken"; + SyntaxKind5[ + SyntaxKind5["LastLiteralToken"] = 15 + /* NoSubstitutionTemplateLiteral */ + ] = "LastLiteralToken"; + SyntaxKind5[ + SyntaxKind5["FirstTemplateToken"] = 15 + /* NoSubstitutionTemplateLiteral */ + ] = "FirstTemplateToken"; + SyntaxKind5[ + SyntaxKind5["LastTemplateToken"] = 18 + /* TemplateTail */ + ] = "LastTemplateToken"; + SyntaxKind5[ + SyntaxKind5["FirstBinaryOperator"] = 30 + /* LessThanToken */ + ] = "FirstBinaryOperator"; + SyntaxKind5[ + SyntaxKind5["LastBinaryOperator"] = 79 + /* CaretEqualsToken */ + ] = "LastBinaryOperator"; + SyntaxKind5[ + SyntaxKind5["FirstStatement"] = 243 + /* VariableStatement */ + ] = "FirstStatement"; + SyntaxKind5[ + SyntaxKind5["LastStatement"] = 259 + /* DebuggerStatement */ + ] = "LastStatement"; + SyntaxKind5[ + SyntaxKind5["FirstNode"] = 166 + /* QualifiedName */ + ] = "FirstNode"; + SyntaxKind5[ + SyntaxKind5["FirstJSDocNode"] = 316 + /* JSDocTypeExpression */ + ] = "FirstJSDocNode"; + SyntaxKind5[ + SyntaxKind5["LastJSDocNode"] = 357 + /* JSDocSatisfiesTag */ + ] = "LastJSDocNode"; + SyntaxKind5[ + SyntaxKind5["FirstJSDocTagNode"] = 334 + /* JSDocTag */ + ] = "FirstJSDocTagNode"; + SyntaxKind5[ + SyntaxKind5["LastJSDocTagNode"] = 357 + /* JSDocSatisfiesTag */ + ] = "LastJSDocTagNode"; + SyntaxKind5[ + SyntaxKind5["FirstContextualKeyword"] = 128 + /* AbstractKeyword */ + ] = "FirstContextualKeyword"; + SyntaxKind5[ + SyntaxKind5["LastContextualKeyword"] = 165 + /* OfKeyword */ + ] = "LastContextualKeyword"; + return SyntaxKind5; + })(SyntaxKind || {}); + NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { + NodeFlags3[NodeFlags3["None"] = 0] = "None"; + NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; + NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; + NodeFlags3[NodeFlags3["Using"] = 4] = "Using"; + NodeFlags3[NodeFlags3["AwaitUsing"] = 6] = "AwaitUsing"; + NodeFlags3[NodeFlags3["NestedNamespace"] = 8] = "NestedNamespace"; + NodeFlags3[NodeFlags3["Synthesized"] = 16] = "Synthesized"; + NodeFlags3[NodeFlags3["Namespace"] = 32] = "Namespace"; + NodeFlags3[NodeFlags3["OptionalChain"] = 64] = "OptionalChain"; + NodeFlags3[NodeFlags3["ExportContext"] = 128] = "ExportContext"; + NodeFlags3[NodeFlags3["ContainsThis"] = 256] = "ContainsThis"; + NodeFlags3[NodeFlags3["HasImplicitReturn"] = 512] = "HasImplicitReturn"; + NodeFlags3[NodeFlags3["HasExplicitReturn"] = 1024] = "HasExplicitReturn"; + NodeFlags3[NodeFlags3["GlobalAugmentation"] = 2048] = "GlobalAugmentation"; + NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 4096] = "HasAsyncFunctions"; + NodeFlags3[NodeFlags3["DisallowInContext"] = 8192] = "DisallowInContext"; + NodeFlags3[NodeFlags3["YieldContext"] = 16384] = "YieldContext"; + NodeFlags3[NodeFlags3["DecoratorContext"] = 32768] = "DecoratorContext"; + NodeFlags3[NodeFlags3["AwaitContext"] = 65536] = "AwaitContext"; + NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 131072] = "DisallowConditionalTypesContext"; + NodeFlags3[NodeFlags3["ThisNodeHasError"] = 262144] = "ThisNodeHasError"; + NodeFlags3[NodeFlags3["JavaScriptFile"] = 524288] = "JavaScriptFile"; + NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 1048576] = "ThisNodeOrAnySubNodesHasError"; + NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 2097152] = "HasAggregatedChildData"; + NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 4194304] = "PossiblyContainsDynamicImport"; + NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 8388608] = "PossiblyContainsImportMeta"; + NodeFlags3[NodeFlags3["JSDoc"] = 16777216] = "JSDoc"; + NodeFlags3[NodeFlags3["Ambient"] = 33554432] = "Ambient"; + NodeFlags3[NodeFlags3["InWithStatement"] = 67108864] = "InWithStatement"; + NodeFlags3[NodeFlags3["JsonFile"] = 134217728] = "JsonFile"; + NodeFlags3[NodeFlags3["TypeCached"] = 268435456] = "TypeCached"; + NodeFlags3[NodeFlags3["Deprecated"] = 536870912] = "Deprecated"; + NodeFlags3[NodeFlags3["BlockScoped"] = 7] = "BlockScoped"; + NodeFlags3[NodeFlags3["Constant"] = 6] = "Constant"; + NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 1536] = "ReachabilityCheckFlags"; + NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 5632] = "ReachabilityAndEmitFlags"; + NodeFlags3[NodeFlags3["ContextFlags"] = 101441536] = "ContextFlags"; + NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 81920] = "TypeExcludesFlags"; + NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 12582912] = "PermanentlySetIncrementalFlags"; + NodeFlags3[ + NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 256 + /* ContainsThis */ + ] = "IdentifierHasExtendedUnicodeEscape"; + NodeFlags3[ + NodeFlags3["IdentifierIsInJSDocNamespace"] = 4096 + /* HasAsyncFunctions */ + ] = "IdentifierIsInJSDocNamespace"; + return NodeFlags3; + })(NodeFlags || {}); + ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { + ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; + ModifierFlags3[ModifierFlags3["Public"] = 1] = "Public"; + ModifierFlags3[ModifierFlags3["Private"] = 2] = "Private"; + ModifierFlags3[ModifierFlags3["Protected"] = 4] = "Protected"; + ModifierFlags3[ModifierFlags3["Readonly"] = 8] = "Readonly"; + ModifierFlags3[ModifierFlags3["Override"] = 16] = "Override"; + ModifierFlags3[ModifierFlags3["Export"] = 32] = "Export"; + ModifierFlags3[ModifierFlags3["Abstract"] = 64] = "Abstract"; + ModifierFlags3[ModifierFlags3["Ambient"] = 128] = "Ambient"; + ModifierFlags3[ModifierFlags3["Static"] = 256] = "Static"; + ModifierFlags3[ModifierFlags3["Accessor"] = 512] = "Accessor"; + ModifierFlags3[ModifierFlags3["Async"] = 1024] = "Async"; + ModifierFlags3[ModifierFlags3["Default"] = 2048] = "Default"; + ModifierFlags3[ModifierFlags3["Const"] = 4096] = "Const"; + ModifierFlags3[ModifierFlags3["In"] = 8192] = "In"; + ModifierFlags3[ModifierFlags3["Out"] = 16384] = "Out"; + ModifierFlags3[ModifierFlags3["Decorator"] = 32768] = "Decorator"; + ModifierFlags3[ModifierFlags3["Deprecated"] = 65536] = "Deprecated"; + ModifierFlags3[ModifierFlags3["JSDocPublic"] = 8388608] = "JSDocPublic"; + ModifierFlags3[ModifierFlags3["JSDocPrivate"] = 16777216] = "JSDocPrivate"; + ModifierFlags3[ModifierFlags3["JSDocProtected"] = 33554432] = "JSDocProtected"; + ModifierFlags3[ModifierFlags3["JSDocReadonly"] = 67108864] = "JSDocReadonly"; + ModifierFlags3[ModifierFlags3["JSDocOverride"] = 134217728] = "JSDocOverride"; + ModifierFlags3[ModifierFlags3["SyntacticOrJSDocModifiers"] = 31] = "SyntacticOrJSDocModifiers"; + ModifierFlags3[ModifierFlags3["SyntacticOnlyModifiers"] = 65504] = "SyntacticOnlyModifiers"; + ModifierFlags3[ModifierFlags3["SyntacticModifiers"] = 65535] = "SyntacticModifiers"; + ModifierFlags3[ModifierFlags3["JSDocCacheOnlyModifiers"] = 260046848] = "JSDocCacheOnlyModifiers"; + ModifierFlags3[ + ModifierFlags3["JSDocOnlyModifiers"] = 65536 + /* Deprecated */ + ] = "JSDocOnlyModifiers"; + ModifierFlags3[ModifierFlags3["NonCacheOnlyModifiers"] = 131071] = "NonCacheOnlyModifiers"; + ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 268435456] = "HasComputedJSDocModifiers"; + ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags"; + ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 7] = "AccessibilityModifier"; + ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 31] = "ParameterPropertyModifier"; + ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 6] = "NonPublicAccessibilityModifier"; + ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 28895] = "TypeScriptModifier"; + ModifierFlags3[ModifierFlags3["ExportDefault"] = 2080] = "ExportDefault"; + ModifierFlags3[ModifierFlags3["All"] = 131071] = "All"; + ModifierFlags3[ModifierFlags3["Modifier"] = 98303] = "Modifier"; + return ModifierFlags3; + })(ModifierFlags || {}); + JsxFlags = /* @__PURE__ */ ((JsxFlags2) => { + JsxFlags2[JsxFlags2["None"] = 0] = "None"; + JsxFlags2[JsxFlags2["IntrinsicNamedElement"] = 1] = "IntrinsicNamedElement"; + JsxFlags2[JsxFlags2["IntrinsicIndexedElement"] = 2] = "IntrinsicIndexedElement"; + JsxFlags2[JsxFlags2["IntrinsicElement"] = 3] = "IntrinsicElement"; + return JsxFlags2; + })(JsxFlags || {}); + RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => { + RelationComparisonResult3[RelationComparisonResult3["None"] = 0] = "None"; + RelationComparisonResult3[RelationComparisonResult3["Succeeded"] = 1] = "Succeeded"; + RelationComparisonResult3[RelationComparisonResult3["Failed"] = 2] = "Failed"; + RelationComparisonResult3[RelationComparisonResult3["Reported"] = 4] = "Reported"; + RelationComparisonResult3[RelationComparisonResult3["ReportsUnmeasurable"] = 8] = "ReportsUnmeasurable"; + RelationComparisonResult3[RelationComparisonResult3["ReportsUnreliable"] = 16] = "ReportsUnreliable"; + RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask"; + return RelationComparisonResult3; + })(RelationComparisonResult || {}); + GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => { + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; + GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; + return GeneratedIdentifierFlags2; + })(GeneratedIdentifierFlags || {}); + TokenFlags = /* @__PURE__ */ ((TokenFlags2) => { + TokenFlags2[TokenFlags2["None"] = 0] = "None"; + TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak"; + TokenFlags2[TokenFlags2["PrecedingJSDocComment"] = 2] = "PrecedingJSDocComment"; + TokenFlags2[TokenFlags2["Unterminated"] = 4] = "Unterminated"; + TokenFlags2[TokenFlags2["ExtendedUnicodeEscape"] = 8] = "ExtendedUnicodeEscape"; + TokenFlags2[TokenFlags2["Scientific"] = 16] = "Scientific"; + TokenFlags2[TokenFlags2["Octal"] = 32] = "Octal"; + TokenFlags2[TokenFlags2["HexSpecifier"] = 64] = "HexSpecifier"; + TokenFlags2[TokenFlags2["BinarySpecifier"] = 128] = "BinarySpecifier"; + TokenFlags2[TokenFlags2["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags2[TokenFlags2["ContainsSeparator"] = 512] = "ContainsSeparator"; + TokenFlags2[TokenFlags2["UnicodeEscape"] = 1024] = "UnicodeEscape"; + TokenFlags2[TokenFlags2["ContainsInvalidEscape"] = 2048] = "ContainsInvalidEscape"; + TokenFlags2[TokenFlags2["HexEscape"] = 4096] = "HexEscape"; + TokenFlags2[TokenFlags2["ContainsLeadingZero"] = 8192] = "ContainsLeadingZero"; + TokenFlags2[TokenFlags2["ContainsInvalidSeparator"] = 16384] = "ContainsInvalidSeparator"; + TokenFlags2[TokenFlags2["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; + TokenFlags2[TokenFlags2["WithSpecifier"] = 448] = "WithSpecifier"; + TokenFlags2[TokenFlags2["StringLiteralFlags"] = 7176] = "StringLiteralFlags"; + TokenFlags2[TokenFlags2["NumericLiteralFlags"] = 25584] = "NumericLiteralFlags"; + TokenFlags2[TokenFlags2["TemplateLiteralLikeFlags"] = 7176] = "TemplateLiteralLikeFlags"; + TokenFlags2[TokenFlags2["IsInvalid"] = 26656] = "IsInvalid"; + return TokenFlags2; + })(TokenFlags || {}); + FlowFlags = /* @__PURE__ */ ((FlowFlags2) => { + FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; + FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; + FlowFlags2[FlowFlags2["BranchLabel"] = 4] = "BranchLabel"; + FlowFlags2[FlowFlags2["LoopLabel"] = 8] = "LoopLabel"; + FlowFlags2[FlowFlags2["Assignment"] = 16] = "Assignment"; + FlowFlags2[FlowFlags2["TrueCondition"] = 32] = "TrueCondition"; + FlowFlags2[FlowFlags2["FalseCondition"] = 64] = "FalseCondition"; + FlowFlags2[FlowFlags2["SwitchClause"] = 128] = "SwitchClause"; + FlowFlags2[FlowFlags2["ArrayMutation"] = 256] = "ArrayMutation"; + FlowFlags2[FlowFlags2["Call"] = 512] = "Call"; + FlowFlags2[FlowFlags2["ReduceLabel"] = 1024] = "ReduceLabel"; + FlowFlags2[FlowFlags2["Referenced"] = 2048] = "Referenced"; + FlowFlags2[FlowFlags2["Shared"] = 4096] = "Shared"; + FlowFlags2[FlowFlags2["Label"] = 12] = "Label"; + FlowFlags2[FlowFlags2["Condition"] = 96] = "Condition"; + return FlowFlags2; + })(FlowFlags || {}); + CommentDirectiveType = /* @__PURE__ */ ((CommentDirectiveType2) => { + CommentDirectiveType2[CommentDirectiveType2["ExpectError"] = 0] = "ExpectError"; + CommentDirectiveType2[CommentDirectiveType2["Ignore"] = 1] = "Ignore"; + return CommentDirectiveType2; + })(CommentDirectiveType || {}); + OperationCanceledException = class { + }; + FileIncludeKind = /* @__PURE__ */ ((FileIncludeKind2) => { + FileIncludeKind2[FileIncludeKind2["RootFile"] = 0] = "RootFile"; + FileIncludeKind2[FileIncludeKind2["SourceFromProjectReference"] = 1] = "SourceFromProjectReference"; + FileIncludeKind2[FileIncludeKind2["OutputFromProjectReference"] = 2] = "OutputFromProjectReference"; + FileIncludeKind2[FileIncludeKind2["Import"] = 3] = "Import"; + FileIncludeKind2[FileIncludeKind2["ReferenceFile"] = 4] = "ReferenceFile"; + FileIncludeKind2[FileIncludeKind2["TypeReferenceDirective"] = 5] = "TypeReferenceDirective"; + FileIncludeKind2[FileIncludeKind2["LibFile"] = 6] = "LibFile"; + FileIncludeKind2[FileIncludeKind2["LibReferenceDirective"] = 7] = "LibReferenceDirective"; + FileIncludeKind2[FileIncludeKind2["AutomaticTypeDirectiveFile"] = 8] = "AutomaticTypeDirectiveFile"; + return FileIncludeKind2; + })(FileIncludeKind || {}); + FilePreprocessingDiagnosticsKind = /* @__PURE__ */ ((FilePreprocessingDiagnosticsKind2) => { + FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingReferencedDiagnostic"] = 0] = "FilePreprocessingReferencedDiagnostic"; + FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingFileExplainingDiagnostic"] = 1] = "FilePreprocessingFileExplainingDiagnostic"; + FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["ResolutionDiagnostics"] = 2] = "ResolutionDiagnostics"; + return FilePreprocessingDiagnosticsKind2; + })(FilePreprocessingDiagnosticsKind || {}); + EmitOnly = /* @__PURE__ */ ((EmitOnly4) => { + EmitOnly4[EmitOnly4["Js"] = 0] = "Js"; + EmitOnly4[EmitOnly4["Dts"] = 1] = "Dts"; + return EmitOnly4; + })(EmitOnly || {}); + StructureIsReused = /* @__PURE__ */ ((StructureIsReused2) => { + StructureIsReused2[StructureIsReused2["Not"] = 0] = "Not"; + StructureIsReused2[StructureIsReused2["SafeModules"] = 1] = "SafeModules"; + StructureIsReused2[StructureIsReused2["Completely"] = 2] = "Completely"; + return StructureIsReused2; + })(StructureIsReused || {}); + ExitStatus = /* @__PURE__ */ ((ExitStatus2) => { + ExitStatus2[ExitStatus2["Success"] = 0] = "Success"; + ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; + ExitStatus2[ExitStatus2["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; + ExitStatus2[ExitStatus2["InvalidProject_OutputsSkipped"] = 3] = "InvalidProject_OutputsSkipped"; + ExitStatus2[ExitStatus2["ProjectReferenceCycle_OutputsSkipped"] = 4] = "ProjectReferenceCycle_OutputsSkipped"; + return ExitStatus2; + })(ExitStatus || {}); + MemberOverrideStatus = /* @__PURE__ */ ((MemberOverrideStatus2) => { + MemberOverrideStatus2[MemberOverrideStatus2["Ok"] = 0] = "Ok"; + MemberOverrideStatus2[MemberOverrideStatus2["NeedsOverride"] = 1] = "NeedsOverride"; + MemberOverrideStatus2[MemberOverrideStatus2["HasInvalidOverride"] = 2] = "HasInvalidOverride"; + return MemberOverrideStatus2; + })(MemberOverrideStatus || {}); + UnionReduction = /* @__PURE__ */ ((UnionReduction2) => { + UnionReduction2[UnionReduction2["None"] = 0] = "None"; + UnionReduction2[UnionReduction2["Literal"] = 1] = "Literal"; + UnionReduction2[UnionReduction2["Subtype"] = 2] = "Subtype"; + return UnionReduction2; + })(UnionReduction || {}); + ContextFlags = /* @__PURE__ */ ((ContextFlags3) => { + ContextFlags3[ContextFlags3["None"] = 0] = "None"; + ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature"; + ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints"; + ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions"; + ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns"; + return ContextFlags3; + })(ContextFlags || {}); + NodeBuilderFlags = /* @__PURE__ */ ((NodeBuilderFlags2) => { + NodeBuilderFlags2[NodeBuilderFlags2["None"] = 0] = "None"; + NodeBuilderFlags2[NodeBuilderFlags2["NoTruncation"] = 1] = "NoTruncation"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + NodeBuilderFlags2[NodeBuilderFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams"; + NodeBuilderFlags2[NodeBuilderFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + NodeBuilderFlags2[NodeBuilderFlags2["ForbidIndexedAccessSymbolReferences"] = 16] = "ForbidIndexedAccessSymbolReferences"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + NodeBuilderFlags2[NodeBuilderFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags2[NodeBuilderFlags2["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; + NodeBuilderFlags2[NodeBuilderFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; + NodeBuilderFlags2[NodeBuilderFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags2[NodeBuilderFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags2[NodeBuilderFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + NodeBuilderFlags2[NodeBuilderFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; + NodeBuilderFlags2[NodeBuilderFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; + NodeBuilderFlags2[NodeBuilderFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowQualifiedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifiedNameInPlaceOfIdentifier"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags2[NodeBuilderFlags2["WriteComputedProps"] = 1073741824] = "WriteComputedProps"; + NodeBuilderFlags2[NodeBuilderFlags2["AllowNodeModulesRelativePaths"] = 67108864] = "AllowNodeModulesRelativePaths"; + NodeBuilderFlags2[NodeBuilderFlags2["DoNotIncludeSymbolChain"] = 134217728] = "DoNotIncludeSymbolChain"; + NodeBuilderFlags2[NodeBuilderFlags2["IgnoreErrors"] = 70221824] = "IgnoreErrors"; + NodeBuilderFlags2[NodeBuilderFlags2["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; + NodeBuilderFlags2[NodeBuilderFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags2[NodeBuilderFlags2["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + return NodeBuilderFlags2; + })(NodeBuilderFlags || {}); + TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => { + TypeFormatFlags2[TypeFormatFlags2["None"] = 0] = "None"; + TypeFormatFlags2[TypeFormatFlags2["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags2[TypeFormatFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + TypeFormatFlags2[TypeFormatFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams"; + TypeFormatFlags2[TypeFormatFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + TypeFormatFlags2[TypeFormatFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags2[TypeFormatFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + TypeFormatFlags2[TypeFormatFlags2["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + TypeFormatFlags2[TypeFormatFlags2["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags2[TypeFormatFlags2["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags2[TypeFormatFlags2["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags2[TypeFormatFlags2["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags2[TypeFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags2[TypeFormatFlags2["UseSingleQuotesForStringLiteralType"] = 268435456] = "UseSingleQuotesForStringLiteralType"; + TypeFormatFlags2[TypeFormatFlags2["NoTypeReduction"] = 536870912] = "NoTypeReduction"; + TypeFormatFlags2[TypeFormatFlags2["OmitThisParameter"] = 33554432] = "OmitThisParameter"; + TypeFormatFlags2[TypeFormatFlags2["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + TypeFormatFlags2[TypeFormatFlags2["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags2[TypeFormatFlags2["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + TypeFormatFlags2[TypeFormatFlags2["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias"; + TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330095] = "NodeBuilderFlagsMask"; + return TypeFormatFlags2; + })(TypeFormatFlags || {}); + SymbolFormatFlags = /* @__PURE__ */ ((SymbolFormatFlags2) => { + SymbolFormatFlags2[SymbolFormatFlags2["None"] = 0] = "None"; + SymbolFormatFlags2[SymbolFormatFlags2["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; + SymbolFormatFlags2[SymbolFormatFlags2["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + SymbolFormatFlags2[SymbolFormatFlags2["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + SymbolFormatFlags2[SymbolFormatFlags2["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; + SymbolFormatFlags2[SymbolFormatFlags2["WriteComputedProps"] = 16] = "WriteComputedProps"; + SymbolFormatFlags2[SymbolFormatFlags2["DoNotIncludeSymbolChain"] = 32] = "DoNotIncludeSymbolChain"; + return SymbolFormatFlags2; + })(SymbolFormatFlags || {}); + SymbolAccessibility = /* @__PURE__ */ ((SymbolAccessibility2) => { + SymbolAccessibility2[SymbolAccessibility2["Accessible"] = 0] = "Accessible"; + SymbolAccessibility2[SymbolAccessibility2["NotAccessible"] = 1] = "NotAccessible"; + SymbolAccessibility2[SymbolAccessibility2["CannotBeNamed"] = 2] = "CannotBeNamed"; + return SymbolAccessibility2; + })(SymbolAccessibility || {}); + SyntheticSymbolKind = /* @__PURE__ */ ((SyntheticSymbolKind2) => { + SyntheticSymbolKind2[SyntheticSymbolKind2["UnionOrIntersection"] = 0] = "UnionOrIntersection"; + SyntheticSymbolKind2[SyntheticSymbolKind2["Spread"] = 1] = "Spread"; + return SyntheticSymbolKind2; + })(SyntheticSymbolKind || {}); + TypePredicateKind = /* @__PURE__ */ ((TypePredicateKind2) => { + TypePredicateKind2[TypePredicateKind2["This"] = 0] = "This"; + TypePredicateKind2[TypePredicateKind2["Identifier"] = 1] = "Identifier"; + TypePredicateKind2[TypePredicateKind2["AssertsThis"] = 2] = "AssertsThis"; + TypePredicateKind2[TypePredicateKind2["AssertsIdentifier"] = 3] = "AssertsIdentifier"; + return TypePredicateKind2; + })(TypePredicateKind || {}); + TypeReferenceSerializationKind = /* @__PURE__ */ ((TypeReferenceSerializationKind2) => { + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Unknown"] = 0] = "Unknown"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithConstructSignatureAndValue"] = 1] = "TypeWithConstructSignatureAndValue"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["VoidNullableOrNeverType"] = 2] = "VoidNullableOrNeverType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["NumberLikeType"] = 3] = "NumberLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BigIntLikeType"] = 4] = "BigIntLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["StringLikeType"] = 5] = "StringLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["BooleanType"] = 6] = "BooleanType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ArrayLikeType"] = 7] = "ArrayLikeType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ESSymbolType"] = 8] = "ESSymbolType"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["Promise"] = 9] = "Promise"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["TypeWithCallSignature"] = 10] = "TypeWithCallSignature"; + TypeReferenceSerializationKind2[TypeReferenceSerializationKind2["ObjectType"] = 11] = "ObjectType"; + return TypeReferenceSerializationKind2; + })(TypeReferenceSerializationKind || {}); + SymbolFlags = /* @__PURE__ */ ((SymbolFlags3) => { + SymbolFlags3[SymbolFlags3["None"] = 0] = "None"; + SymbolFlags3[SymbolFlags3["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; + SymbolFlags3[SymbolFlags3["BlockScopedVariable"] = 2] = "BlockScopedVariable"; + SymbolFlags3[SymbolFlags3["Property"] = 4] = "Property"; + SymbolFlags3[SymbolFlags3["EnumMember"] = 8] = "EnumMember"; + SymbolFlags3[SymbolFlags3["Function"] = 16] = "Function"; + SymbolFlags3[SymbolFlags3["Class"] = 32] = "Class"; + SymbolFlags3[SymbolFlags3["Interface"] = 64] = "Interface"; + SymbolFlags3[SymbolFlags3["ConstEnum"] = 128] = "ConstEnum"; + SymbolFlags3[SymbolFlags3["RegularEnum"] = 256] = "RegularEnum"; + SymbolFlags3[SymbolFlags3["ValueModule"] = 512] = "ValueModule"; + SymbolFlags3[SymbolFlags3["NamespaceModule"] = 1024] = "NamespaceModule"; + SymbolFlags3[SymbolFlags3["TypeLiteral"] = 2048] = "TypeLiteral"; + SymbolFlags3[SymbolFlags3["ObjectLiteral"] = 4096] = "ObjectLiteral"; + SymbolFlags3[SymbolFlags3["Method"] = 8192] = "Method"; + SymbolFlags3[SymbolFlags3["Constructor"] = 16384] = "Constructor"; + SymbolFlags3[SymbolFlags3["GetAccessor"] = 32768] = "GetAccessor"; + SymbolFlags3[SymbolFlags3["SetAccessor"] = 65536] = "SetAccessor"; + SymbolFlags3[SymbolFlags3["Signature"] = 131072] = "Signature"; + SymbolFlags3[SymbolFlags3["TypeParameter"] = 262144] = "TypeParameter"; + SymbolFlags3[SymbolFlags3["TypeAlias"] = 524288] = "TypeAlias"; + SymbolFlags3[SymbolFlags3["ExportValue"] = 1048576] = "ExportValue"; + SymbolFlags3[SymbolFlags3["Alias"] = 2097152] = "Alias"; + SymbolFlags3[SymbolFlags3["Prototype"] = 4194304] = "Prototype"; + SymbolFlags3[SymbolFlags3["ExportStar"] = 8388608] = "ExportStar"; + SymbolFlags3[SymbolFlags3["Optional"] = 16777216] = "Optional"; + SymbolFlags3[SymbolFlags3["Transient"] = 33554432] = "Transient"; + SymbolFlags3[SymbolFlags3["Assignment"] = 67108864] = "Assignment"; + SymbolFlags3[SymbolFlags3["ModuleExports"] = 134217728] = "ModuleExports"; + SymbolFlags3[SymbolFlags3["All"] = -1] = "All"; + SymbolFlags3[SymbolFlags3["Enum"] = 384] = "Enum"; + SymbolFlags3[SymbolFlags3["Variable"] = 3] = "Variable"; + SymbolFlags3[SymbolFlags3["Value"] = 111551] = "Value"; + SymbolFlags3[SymbolFlags3["Type"] = 788968] = "Type"; + SymbolFlags3[SymbolFlags3["Namespace"] = 1920] = "Namespace"; + SymbolFlags3[SymbolFlags3["Module"] = 1536] = "Module"; + SymbolFlags3[SymbolFlags3["Accessor"] = 98304] = "Accessor"; + SymbolFlags3[SymbolFlags3["FunctionScopedVariableExcludes"] = 111550] = "FunctionScopedVariableExcludes"; + SymbolFlags3[ + SymbolFlags3["BlockScopedVariableExcludes"] = 111551 + /* Value */ + ] = "BlockScopedVariableExcludes"; + SymbolFlags3[ + SymbolFlags3["ParameterExcludes"] = 111551 + /* Value */ + ] = "ParameterExcludes"; + SymbolFlags3[ + SymbolFlags3["PropertyExcludes"] = 0 + /* None */ + ] = "PropertyExcludes"; + SymbolFlags3[SymbolFlags3["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; + SymbolFlags3[SymbolFlags3["FunctionExcludes"] = 110991] = "FunctionExcludes"; + SymbolFlags3[SymbolFlags3["ClassExcludes"] = 899503] = "ClassExcludes"; + SymbolFlags3[SymbolFlags3["InterfaceExcludes"] = 788872] = "InterfaceExcludes"; + SymbolFlags3[SymbolFlags3["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; + SymbolFlags3[SymbolFlags3["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; + SymbolFlags3[SymbolFlags3["ValueModuleExcludes"] = 110735] = "ValueModuleExcludes"; + SymbolFlags3[SymbolFlags3["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; + SymbolFlags3[SymbolFlags3["MethodExcludes"] = 103359] = "MethodExcludes"; + SymbolFlags3[SymbolFlags3["GetAccessorExcludes"] = 46015] = "GetAccessorExcludes"; + SymbolFlags3[SymbolFlags3["SetAccessorExcludes"] = 78783] = "SetAccessorExcludes"; + SymbolFlags3[SymbolFlags3["AccessorExcludes"] = 13247] = "AccessorExcludes"; + SymbolFlags3[SymbolFlags3["TypeParameterExcludes"] = 526824] = "TypeParameterExcludes"; + SymbolFlags3[ + SymbolFlags3["TypeAliasExcludes"] = 788968 + /* Type */ + ] = "TypeAliasExcludes"; + SymbolFlags3[ + SymbolFlags3["AliasExcludes"] = 2097152 + /* Alias */ + ] = "AliasExcludes"; + SymbolFlags3[SymbolFlags3["ModuleMember"] = 2623475] = "ModuleMember"; + SymbolFlags3[SymbolFlags3["ExportHasLocal"] = 944] = "ExportHasLocal"; + SymbolFlags3[SymbolFlags3["BlockScoped"] = 418] = "BlockScoped"; + SymbolFlags3[SymbolFlags3["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; + SymbolFlags3[SymbolFlags3["ClassMember"] = 106500] = "ClassMember"; + SymbolFlags3[SymbolFlags3["ExportSupportsDefaultModifier"] = 112] = "ExportSupportsDefaultModifier"; + SymbolFlags3[SymbolFlags3["ExportDoesNotSupportDefaultModifier"] = -113] = "ExportDoesNotSupportDefaultModifier"; + SymbolFlags3[SymbolFlags3["Classifiable"] = 2885600] = "Classifiable"; + SymbolFlags3[SymbolFlags3["LateBindingContainer"] = 6256] = "LateBindingContainer"; + return SymbolFlags3; + })(SymbolFlags || {}); + EnumKind = /* @__PURE__ */ ((EnumKind2) => { + EnumKind2[EnumKind2["Numeric"] = 0] = "Numeric"; + EnumKind2[EnumKind2["Literal"] = 1] = "Literal"; + return EnumKind2; + })(EnumKind || {}); + CheckFlags = /* @__PURE__ */ ((CheckFlags2) => { + CheckFlags2[CheckFlags2["None"] = 0] = "None"; + CheckFlags2[CheckFlags2["Instantiated"] = 1] = "Instantiated"; + CheckFlags2[CheckFlags2["SyntheticProperty"] = 2] = "SyntheticProperty"; + CheckFlags2[CheckFlags2["SyntheticMethod"] = 4] = "SyntheticMethod"; + CheckFlags2[CheckFlags2["Readonly"] = 8] = "Readonly"; + CheckFlags2[CheckFlags2["ReadPartial"] = 16] = "ReadPartial"; + CheckFlags2[CheckFlags2["WritePartial"] = 32] = "WritePartial"; + CheckFlags2[CheckFlags2["HasNonUniformType"] = 64] = "HasNonUniformType"; + CheckFlags2[CheckFlags2["HasLiteralType"] = 128] = "HasLiteralType"; + CheckFlags2[CheckFlags2["ContainsPublic"] = 256] = "ContainsPublic"; + CheckFlags2[CheckFlags2["ContainsProtected"] = 512] = "ContainsProtected"; + CheckFlags2[CheckFlags2["ContainsPrivate"] = 1024] = "ContainsPrivate"; + CheckFlags2[CheckFlags2["ContainsStatic"] = 2048] = "ContainsStatic"; + CheckFlags2[CheckFlags2["Late"] = 4096] = "Late"; + CheckFlags2[CheckFlags2["ReverseMapped"] = 8192] = "ReverseMapped"; + CheckFlags2[CheckFlags2["OptionalParameter"] = 16384] = "OptionalParameter"; + CheckFlags2[CheckFlags2["RestParameter"] = 32768] = "RestParameter"; + CheckFlags2[CheckFlags2["DeferredType"] = 65536] = "DeferredType"; + CheckFlags2[CheckFlags2["HasNeverType"] = 131072] = "HasNeverType"; + CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped"; + CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional"; + CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved"; + CheckFlags2[CheckFlags2["Synthetic"] = 6] = "Synthetic"; + CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant"; + CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial"; + return CheckFlags2; + })(CheckFlags || {}); + InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => { + InternalSymbolName2["Call"] = "__call"; + InternalSymbolName2["Constructor"] = "__constructor"; + InternalSymbolName2["New"] = "__new"; + InternalSymbolName2["Index"] = "__index"; + InternalSymbolName2["ExportStar"] = "__export"; + InternalSymbolName2["Global"] = "__global"; + InternalSymbolName2["Missing"] = "__missing"; + InternalSymbolName2["Type"] = "__type"; + InternalSymbolName2["Object"] = "__object"; + InternalSymbolName2["JSXAttributes"] = "__jsxAttributes"; + InternalSymbolName2["Class"] = "__class"; + InternalSymbolName2["Function"] = "__function"; + InternalSymbolName2["Computed"] = "__computed"; + InternalSymbolName2["Resolving"] = "__resolving__"; + InternalSymbolName2["ExportEquals"] = "export="; + InternalSymbolName2["Default"] = "default"; + InternalSymbolName2["This"] = "this"; + InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression"; + InternalSymbolName2["ImportAttributes"] = "__importAttributes"; + return InternalSymbolName2; + })(InternalSymbolName || {}); + NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => { + NodeCheckFlags2[NodeCheckFlags2["None"] = 0] = "None"; + NodeCheckFlags2[NodeCheckFlags2["TypeChecked"] = 1] = "TypeChecked"; + NodeCheckFlags2[NodeCheckFlags2["LexicalThis"] = 2] = "LexicalThis"; + NodeCheckFlags2[NodeCheckFlags2["CaptureThis"] = 4] = "CaptureThis"; + NodeCheckFlags2[NodeCheckFlags2["CaptureNewTarget"] = 8] = "CaptureNewTarget"; + NodeCheckFlags2[NodeCheckFlags2["SuperInstance"] = 16] = "SuperInstance"; + NodeCheckFlags2[NodeCheckFlags2["SuperStatic"] = 32] = "SuperStatic"; + NodeCheckFlags2[NodeCheckFlags2["ContextChecked"] = 64] = "ContextChecked"; + NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync"; + NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync"; + NodeCheckFlags2[NodeCheckFlags2["CaptureArguments"] = 512] = "CaptureArguments"; + NodeCheckFlags2[NodeCheckFlags2["EnumValuesComputed"] = 1024] = "EnumValuesComputed"; + NodeCheckFlags2[NodeCheckFlags2["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass"; + NodeCheckFlags2[NodeCheckFlags2["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding"; + NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding"; + NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding"; + NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop"; + NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter"; + NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 131072] = "AssignmentsMarked"; + NodeCheckFlags2[NodeCheckFlags2["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference"; + NodeCheckFlags2[NodeCheckFlags2["ConstructorReference"] = 536870912] = "ConstructorReference"; + NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers"; + NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer"; + NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 4194304] = "InCheckIdentifier"; + return NodeCheckFlags2; + })(NodeCheckFlags || {}); + TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { + TypeFlags2[TypeFlags2["Any"] = 1] = "Any"; + TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown"; + TypeFlags2[TypeFlags2["String"] = 4] = "String"; + TypeFlags2[TypeFlags2["Number"] = 8] = "Number"; + TypeFlags2[TypeFlags2["Boolean"] = 16] = "Boolean"; + TypeFlags2[TypeFlags2["Enum"] = 32] = "Enum"; + TypeFlags2[TypeFlags2["BigInt"] = 64] = "BigInt"; + TypeFlags2[TypeFlags2["StringLiteral"] = 128] = "StringLiteral"; + TypeFlags2[TypeFlags2["NumberLiteral"] = 256] = "NumberLiteral"; + TypeFlags2[TypeFlags2["BooleanLiteral"] = 512] = "BooleanLiteral"; + TypeFlags2[TypeFlags2["EnumLiteral"] = 1024] = "EnumLiteral"; + TypeFlags2[TypeFlags2["BigIntLiteral"] = 2048] = "BigIntLiteral"; + TypeFlags2[TypeFlags2["ESSymbol"] = 4096] = "ESSymbol"; + TypeFlags2[TypeFlags2["UniqueESSymbol"] = 8192] = "UniqueESSymbol"; + TypeFlags2[TypeFlags2["Void"] = 16384] = "Void"; + TypeFlags2[TypeFlags2["Undefined"] = 32768] = "Undefined"; + TypeFlags2[TypeFlags2["Null"] = 65536] = "Null"; + TypeFlags2[TypeFlags2["Never"] = 131072] = "Never"; + TypeFlags2[TypeFlags2["TypeParameter"] = 262144] = "TypeParameter"; + TypeFlags2[TypeFlags2["Object"] = 524288] = "Object"; + TypeFlags2[TypeFlags2["Union"] = 1048576] = "Union"; + TypeFlags2[TypeFlags2["Intersection"] = 2097152] = "Intersection"; + TypeFlags2[TypeFlags2["Index"] = 4194304] = "Index"; + TypeFlags2[TypeFlags2["IndexedAccess"] = 8388608] = "IndexedAccess"; + TypeFlags2[TypeFlags2["Conditional"] = 16777216] = "Conditional"; + TypeFlags2[TypeFlags2["Substitution"] = 33554432] = "Substitution"; + TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive"; + TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral"; + TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping"; + TypeFlags2[TypeFlags2["Reserved1"] = 536870912] = "Reserved1"; + TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; + TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; + TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; + TypeFlags2[TypeFlags2["Unit"] = 109472] = "Unit"; + TypeFlags2[TypeFlags2["Freshable"] = 2976] = "Freshable"; + TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; + TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; + TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; + TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; + TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; + TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; + TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; + TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; + TypeFlags2[TypeFlags2["BooleanLike"] = 528] = "BooleanLike"; + TypeFlags2[TypeFlags2["EnumLike"] = 1056] = "EnumLike"; + TypeFlags2[TypeFlags2["ESSymbolLike"] = 12288] = "ESSymbolLike"; + TypeFlags2[TypeFlags2["VoidLike"] = 49152] = "VoidLike"; + TypeFlags2[TypeFlags2["Primitive"] = 402784252] = "Primitive"; + TypeFlags2[TypeFlags2["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable"; + TypeFlags2[TypeFlags2["DisjointDomains"] = 469892092] = "DisjointDomains"; + TypeFlags2[TypeFlags2["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; + TypeFlags2[TypeFlags2["StructuredType"] = 3670016] = "StructuredType"; + TypeFlags2[TypeFlags2["TypeVariable"] = 8650752] = "TypeVariable"; + TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; + TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; + TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable"; + TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; + TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; + TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable"; + TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton"; + TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable"; + TypeFlags2[TypeFlags2["IncludesMask"] = 473694207] = "IncludesMask"; + TypeFlags2[ + TypeFlags2["IncludesMissingType"] = 262144 + /* TypeParameter */ + ] = "IncludesMissingType"; + TypeFlags2[ + TypeFlags2["IncludesNonWideningType"] = 4194304 + /* Index */ + ] = "IncludesNonWideningType"; + TypeFlags2[ + TypeFlags2["IncludesWildcard"] = 8388608 + /* IndexedAccess */ + ] = "IncludesWildcard"; + TypeFlags2[ + TypeFlags2["IncludesEmptyObject"] = 16777216 + /* Conditional */ + ] = "IncludesEmptyObject"; + TypeFlags2[ + TypeFlags2["IncludesInstantiable"] = 33554432 + /* Substitution */ + ] = "IncludesInstantiable"; + TypeFlags2[ + TypeFlags2["IncludesConstrainedTypeVariable"] = 536870912 + /* Reserved1 */ + ] = "IncludesConstrainedTypeVariable"; + TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion"; + return TypeFlags2; + })(TypeFlags || {}); + ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { + ObjectFlags3[ObjectFlags3["None"] = 0] = "None"; + ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class"; + ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface"; + ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference"; + ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple"; + ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous"; + ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped"; + ObjectFlags3[ObjectFlags3["Instantiated"] = 64] = "Instantiated"; + ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 128] = "ObjectLiteral"; + ObjectFlags3[ObjectFlags3["EvolvingArray"] = 256] = "EvolvingArray"; + ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; + ObjectFlags3[ObjectFlags3["ReverseMapped"] = 1024] = "ReverseMapped"; + ObjectFlags3[ObjectFlags3["JsxAttributes"] = 2048] = "JsxAttributes"; + ObjectFlags3[ObjectFlags3["JSLiteral"] = 4096] = "JSLiteral"; + ObjectFlags3[ObjectFlags3["FreshLiteral"] = 8192] = "FreshLiteral"; + ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 16384] = "ArrayLiteral"; + ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 32768] = "PrimitiveUnion"; + ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 65536] = "ContainsWideningType"; + ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral"; + ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType"; + ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; + ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; + ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface"; + ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening"; + ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags"; + ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 96] = "InstantiatedMapped"; + ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask"; + ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread"; + ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType"; + ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; + ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; + ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; + ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; + ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed"; + ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType"; + ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType"; + ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType"; + ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections"; + ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed"; + ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion"; + ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed"; + ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection"; + ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 67108864] = "IsConstrainedTypeVariable"; + return ObjectFlags3; + })(ObjectFlags || {}); + VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => { + VarianceFlags2[VarianceFlags2["Invariant"] = 0] = "Invariant"; + VarianceFlags2[VarianceFlags2["Covariant"] = 1] = "Covariant"; + VarianceFlags2[VarianceFlags2["Contravariant"] = 2] = "Contravariant"; + VarianceFlags2[VarianceFlags2["Bivariant"] = 3] = "Bivariant"; + VarianceFlags2[VarianceFlags2["Independent"] = 4] = "Independent"; + VarianceFlags2[VarianceFlags2["VarianceMask"] = 7] = "VarianceMask"; + VarianceFlags2[VarianceFlags2["Unmeasurable"] = 8] = "Unmeasurable"; + VarianceFlags2[VarianceFlags2["Unreliable"] = 16] = "Unreliable"; + VarianceFlags2[VarianceFlags2["AllowsStructuralFallback"] = 24] = "AllowsStructuralFallback"; + return VarianceFlags2; + })(VarianceFlags || {}); + ElementFlags = /* @__PURE__ */ ((ElementFlags2) => { + ElementFlags2[ElementFlags2["Required"] = 1] = "Required"; + ElementFlags2[ElementFlags2["Optional"] = 2] = "Optional"; + ElementFlags2[ElementFlags2["Rest"] = 4] = "Rest"; + ElementFlags2[ElementFlags2["Variadic"] = 8] = "Variadic"; + ElementFlags2[ElementFlags2["Fixed"] = 3] = "Fixed"; + ElementFlags2[ElementFlags2["Variable"] = 12] = "Variable"; + ElementFlags2[ElementFlags2["NonRequired"] = 14] = "NonRequired"; + ElementFlags2[ElementFlags2["NonRest"] = 11] = "NonRest"; + return ElementFlags2; + })(ElementFlags || {}); + AccessFlags = /* @__PURE__ */ ((AccessFlags2) => { + AccessFlags2[AccessFlags2["None"] = 0] = "None"; + AccessFlags2[AccessFlags2["IncludeUndefined"] = 1] = "IncludeUndefined"; + AccessFlags2[AccessFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures"; + AccessFlags2[AccessFlags2["Writing"] = 4] = "Writing"; + AccessFlags2[AccessFlags2["CacheSymbol"] = 8] = "CacheSymbol"; + AccessFlags2[AccessFlags2["NoTupleBoundsCheck"] = 16] = "NoTupleBoundsCheck"; + AccessFlags2[AccessFlags2["ExpressionPosition"] = 32] = "ExpressionPosition"; + AccessFlags2[AccessFlags2["ReportDeprecated"] = 64] = "ReportDeprecated"; + AccessFlags2[AccessFlags2["SuppressNoImplicitAnyError"] = 128] = "SuppressNoImplicitAnyError"; + AccessFlags2[AccessFlags2["Contextual"] = 256] = "Contextual"; + AccessFlags2[ + AccessFlags2["Persistent"] = 1 + /* IncludeUndefined */ + ] = "Persistent"; + return AccessFlags2; + })(AccessFlags || {}); + IndexFlags = /* @__PURE__ */ ((IndexFlags2) => { + IndexFlags2[IndexFlags2["None"] = 0] = "None"; + IndexFlags2[IndexFlags2["StringsOnly"] = 1] = "StringsOnly"; + IndexFlags2[IndexFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures"; + IndexFlags2[IndexFlags2["NoReducibleCheck"] = 4] = "NoReducibleCheck"; + return IndexFlags2; + })(IndexFlags || {}); + JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => { + JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component"; + JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function"; + JsxReferenceKind2[JsxReferenceKind2["Mixed"] = 2] = "Mixed"; + return JsxReferenceKind2; + })(JsxReferenceKind || {}); + SignatureKind = /* @__PURE__ */ ((SignatureKind2) => { + SignatureKind2[SignatureKind2["Call"] = 0] = "Call"; + SignatureKind2[SignatureKind2["Construct"] = 1] = "Construct"; + return SignatureKind2; + })(SignatureKind || {}); + SignatureFlags = /* @__PURE__ */ ((SignatureFlags5) => { + SignatureFlags5[SignatureFlags5["None"] = 0] = "None"; + SignatureFlags5[SignatureFlags5["HasRestParameter"] = 1] = "HasRestParameter"; + SignatureFlags5[SignatureFlags5["HasLiteralTypes"] = 2] = "HasLiteralTypes"; + SignatureFlags5[SignatureFlags5["Abstract"] = 4] = "Abstract"; + SignatureFlags5[SignatureFlags5["IsInnerCallChain"] = 8] = "IsInnerCallChain"; + SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain"; + SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile"; + SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable"; + SignatureFlags5[SignatureFlags5["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure"; + SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 167] = "PropagatingFlags"; + SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags"; + return SignatureFlags5; + })(SignatureFlags || {}); + IndexKind = /* @__PURE__ */ ((IndexKind2) => { + IndexKind2[IndexKind2["String"] = 0] = "String"; + IndexKind2[IndexKind2["Number"] = 1] = "Number"; + return IndexKind2; + })(IndexKind || {}); + TypeMapKind = /* @__PURE__ */ ((TypeMapKind2) => { + TypeMapKind2[TypeMapKind2["Simple"] = 0] = "Simple"; + TypeMapKind2[TypeMapKind2["Array"] = 1] = "Array"; + TypeMapKind2[TypeMapKind2["Deferred"] = 2] = "Deferred"; + TypeMapKind2[TypeMapKind2["Function"] = 3] = "Function"; + TypeMapKind2[TypeMapKind2["Composite"] = 4] = "Composite"; + TypeMapKind2[TypeMapKind2["Merged"] = 5] = "Merged"; + return TypeMapKind2; + })(TypeMapKind || {}); + InferencePriority = /* @__PURE__ */ ((InferencePriority2) => { + InferencePriority2[InferencePriority2["None"] = 0] = "None"; + InferencePriority2[InferencePriority2["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority2[InferencePriority2["SpeculativeTuple"] = 2] = "SpeculativeTuple"; + InferencePriority2[InferencePriority2["SubstituteSource"] = 4] = "SubstituteSource"; + InferencePriority2[InferencePriority2["HomomorphicMappedType"] = 8] = "HomomorphicMappedType"; + InferencePriority2[InferencePriority2["PartialHomomorphicMappedType"] = 16] = "PartialHomomorphicMappedType"; + InferencePriority2[InferencePriority2["MappedTypeConstraint"] = 32] = "MappedTypeConstraint"; + InferencePriority2[InferencePriority2["ContravariantConditional"] = 64] = "ContravariantConditional"; + InferencePriority2[InferencePriority2["ReturnType"] = 128] = "ReturnType"; + InferencePriority2[InferencePriority2["LiteralKeyof"] = 256] = "LiteralKeyof"; + InferencePriority2[InferencePriority2["NoConstraints"] = 512] = "NoConstraints"; + InferencePriority2[InferencePriority2["AlwaysStrict"] = 1024] = "AlwaysStrict"; + InferencePriority2[InferencePriority2["MaxValue"] = 2048] = "MaxValue"; + InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 416] = "PriorityImpliesCombination"; + InferencePriority2[InferencePriority2["Circularity"] = -1] = "Circularity"; + return InferencePriority2; + })(InferencePriority || {}); + InferenceFlags = /* @__PURE__ */ ((InferenceFlags2) => { + InferenceFlags2[InferenceFlags2["None"] = 0] = "None"; + InferenceFlags2[InferenceFlags2["NoDefault"] = 1] = "NoDefault"; + InferenceFlags2[InferenceFlags2["AnyDefault"] = 2] = "AnyDefault"; + InferenceFlags2[InferenceFlags2["SkippedGenericFunction"] = 4] = "SkippedGenericFunction"; + return InferenceFlags2; + })(InferenceFlags || {}); + Ternary = /* @__PURE__ */ ((Ternary2) => { + Ternary2[Ternary2["False"] = 0] = "False"; + Ternary2[Ternary2["Unknown"] = 1] = "Unknown"; + Ternary2[Ternary2["Maybe"] = 3] = "Maybe"; + Ternary2[Ternary2["True"] = -1] = "True"; + return Ternary2; + })(Ternary || {}); + AssignmentDeclarationKind = /* @__PURE__ */ ((AssignmentDeclarationKind2) => { + AssignmentDeclarationKind2[AssignmentDeclarationKind2["None"] = 0] = "None"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ExportsProperty"] = 1] = "ExportsProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ModuleExports"] = 2] = "ModuleExports"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["PrototypeProperty"] = 3] = "PrototypeProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ThisProperty"] = 4] = "ThisProperty"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["Property"] = 5] = "Property"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["Prototype"] = 6] = "Prototype"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyValue"] = 7] = "ObjectDefinePropertyValue"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePropertyExports"] = 8] = "ObjectDefinePropertyExports"; + AssignmentDeclarationKind2[AssignmentDeclarationKind2["ObjectDefinePrototypeProperty"] = 9] = "ObjectDefinePrototypeProperty"; + return AssignmentDeclarationKind2; + })(AssignmentDeclarationKind || {}); + DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => { + DiagnosticCategory2[DiagnosticCategory2["Warning"] = 0] = "Warning"; + DiagnosticCategory2[DiagnosticCategory2["Error"] = 1] = "Error"; + DiagnosticCategory2[DiagnosticCategory2["Suggestion"] = 2] = "Suggestion"; + DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message"; + return DiagnosticCategory2; + })(DiagnosticCategory || {}); + ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => { + ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeJs"] = 2] = "NodeJs"; + ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10"; + ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16"; + ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext"; + ModuleResolutionKind3[ModuleResolutionKind3["Bundler"] = 100] = "Bundler"; + return ModuleResolutionKind3; + })(ModuleResolutionKind || {}); + ModuleDetectionKind = /* @__PURE__ */ ((ModuleDetectionKind2) => { + ModuleDetectionKind2[ModuleDetectionKind2["Legacy"] = 1] = "Legacy"; + ModuleDetectionKind2[ModuleDetectionKind2["Auto"] = 2] = "Auto"; + ModuleDetectionKind2[ModuleDetectionKind2["Force"] = 3] = "Force"; + return ModuleDetectionKind2; + })(ModuleDetectionKind || {}); + WatchFileKind = /* @__PURE__ */ ((WatchFileKind3) => { + WatchFileKind3[WatchFileKind3["FixedPollingInterval"] = 0] = "FixedPollingInterval"; + WatchFileKind3[WatchFileKind3["PriorityPollingInterval"] = 1] = "PriorityPollingInterval"; + WatchFileKind3[WatchFileKind3["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchFileKind3[WatchFileKind3["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + WatchFileKind3[WatchFileKind3["UseFsEvents"] = 4] = "UseFsEvents"; + WatchFileKind3[WatchFileKind3["UseFsEventsOnParentDirectory"] = 5] = "UseFsEventsOnParentDirectory"; + return WatchFileKind3; + })(WatchFileKind || {}); + WatchDirectoryKind = /* @__PURE__ */ ((WatchDirectoryKind3) => { + WatchDirectoryKind3[WatchDirectoryKind3["UseFsEvents"] = 0] = "UseFsEvents"; + WatchDirectoryKind3[WatchDirectoryKind3["FixedPollingInterval"] = 1] = "FixedPollingInterval"; + WatchDirectoryKind3[WatchDirectoryKind3["DynamicPriorityPolling"] = 2] = "DynamicPriorityPolling"; + WatchDirectoryKind3[WatchDirectoryKind3["FixedChunkSizePolling"] = 3] = "FixedChunkSizePolling"; + return WatchDirectoryKind3; + })(WatchDirectoryKind || {}); + PollingWatchKind = /* @__PURE__ */ ((PollingWatchKind3) => { + PollingWatchKind3[PollingWatchKind3["FixedInterval"] = 0] = "FixedInterval"; + PollingWatchKind3[PollingWatchKind3["PriorityInterval"] = 1] = "PriorityInterval"; + PollingWatchKind3[PollingWatchKind3["DynamicPriority"] = 2] = "DynamicPriority"; + PollingWatchKind3[PollingWatchKind3["FixedChunkSize"] = 3] = "FixedChunkSize"; + return PollingWatchKind3; + })(PollingWatchKind || {}); + ModuleKind = /* @__PURE__ */ ((ModuleKind3) => { + ModuleKind3[ModuleKind3["None"] = 0] = "None"; + ModuleKind3[ModuleKind3["CommonJS"] = 1] = "CommonJS"; + ModuleKind3[ModuleKind3["AMD"] = 2] = "AMD"; + ModuleKind3[ModuleKind3["UMD"] = 3] = "UMD"; + ModuleKind3[ModuleKind3["System"] = 4] = "System"; + ModuleKind3[ModuleKind3["ES2015"] = 5] = "ES2015"; + ModuleKind3[ModuleKind3["ES2020"] = 6] = "ES2020"; + ModuleKind3[ModuleKind3["ES2022"] = 7] = "ES2022"; + ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext"; + ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16"; + ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext"; + ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve"; + return ModuleKind3; + })(ModuleKind || {}); + JsxEmit = /* @__PURE__ */ ((JsxEmit3) => { + JsxEmit3[JsxEmit3["None"] = 0] = "None"; + JsxEmit3[JsxEmit3["Preserve"] = 1] = "Preserve"; + JsxEmit3[JsxEmit3["React"] = 2] = "React"; + JsxEmit3[JsxEmit3["ReactNative"] = 3] = "ReactNative"; + JsxEmit3[JsxEmit3["ReactJSX"] = 4] = "ReactJSX"; + JsxEmit3[JsxEmit3["ReactJSXDev"] = 5] = "ReactJSXDev"; + return JsxEmit3; + })(JsxEmit || {}); + ImportsNotUsedAsValues = /* @__PURE__ */ ((ImportsNotUsedAsValues2) => { + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Remove"] = 0] = "Remove"; + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Preserve"] = 1] = "Preserve"; + ImportsNotUsedAsValues2[ImportsNotUsedAsValues2["Error"] = 2] = "Error"; + return ImportsNotUsedAsValues2; + })(ImportsNotUsedAsValues || {}); + NewLineKind = /* @__PURE__ */ ((NewLineKind3) => { + NewLineKind3[NewLineKind3["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; + NewLineKind3[NewLineKind3["LineFeed"] = 1] = "LineFeed"; + return NewLineKind3; + })(NewLineKind || {}); + ScriptKind = /* @__PURE__ */ ((ScriptKind7) => { + ScriptKind7[ScriptKind7["Unknown"] = 0] = "Unknown"; + ScriptKind7[ScriptKind7["JS"] = 1] = "JS"; + ScriptKind7[ScriptKind7["JSX"] = 2] = "JSX"; + ScriptKind7[ScriptKind7["TS"] = 3] = "TS"; + ScriptKind7[ScriptKind7["TSX"] = 4] = "TSX"; + ScriptKind7[ScriptKind7["External"] = 5] = "External"; + ScriptKind7[ScriptKind7["JSON"] = 6] = "JSON"; + ScriptKind7[ScriptKind7["Deferred"] = 7] = "Deferred"; + return ScriptKind7; + })(ScriptKind || {}); + ScriptTarget = /* @__PURE__ */ ((ScriptTarget11) => { + ScriptTarget11[ScriptTarget11["ES3"] = 0] = "ES3"; + ScriptTarget11[ScriptTarget11["ES5"] = 1] = "ES5"; + ScriptTarget11[ScriptTarget11["ES2015"] = 2] = "ES2015"; + ScriptTarget11[ScriptTarget11["ES2016"] = 3] = "ES2016"; + ScriptTarget11[ScriptTarget11["ES2017"] = 4] = "ES2017"; + ScriptTarget11[ScriptTarget11["ES2018"] = 5] = "ES2018"; + ScriptTarget11[ScriptTarget11["ES2019"] = 6] = "ES2019"; + ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020"; + ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021"; + ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022"; + ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext"; + ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON"; + ScriptTarget11[ + ScriptTarget11["Latest"] = 99 + /* ESNext */ + ] = "Latest"; + return ScriptTarget11; + })(ScriptTarget || {}); + LanguageVariant = /* @__PURE__ */ ((LanguageVariant4) => { + LanguageVariant4[LanguageVariant4["Standard"] = 0] = "Standard"; + LanguageVariant4[LanguageVariant4["JSX"] = 1] = "JSX"; + return LanguageVariant4; + })(LanguageVariant || {}); + WatchDirectoryFlags = /* @__PURE__ */ ((WatchDirectoryFlags3) => { + WatchDirectoryFlags3[WatchDirectoryFlags3["None"] = 0] = "None"; + WatchDirectoryFlags3[WatchDirectoryFlags3["Recursive"] = 1] = "Recursive"; + return WatchDirectoryFlags3; + })(WatchDirectoryFlags || {}); + CharacterCodes = /* @__PURE__ */ ((CharacterCodes2) => { + CharacterCodes2[CharacterCodes2["nullCharacter"] = 0] = "nullCharacter"; + CharacterCodes2[CharacterCodes2["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; + CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed"; + CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn"; + CharacterCodes2[CharacterCodes2["lineSeparator"] = 8232] = "lineSeparator"; + CharacterCodes2[CharacterCodes2["paragraphSeparator"] = 8233] = "paragraphSeparator"; + CharacterCodes2[CharacterCodes2["nextLine"] = 133] = "nextLine"; + CharacterCodes2[CharacterCodes2["space"] = 32] = "space"; + CharacterCodes2[CharacterCodes2["nonBreakingSpace"] = 160] = "nonBreakingSpace"; + CharacterCodes2[CharacterCodes2["enQuad"] = 8192] = "enQuad"; + CharacterCodes2[CharacterCodes2["emQuad"] = 8193] = "emQuad"; + CharacterCodes2[CharacterCodes2["enSpace"] = 8194] = "enSpace"; + CharacterCodes2[CharacterCodes2["emSpace"] = 8195] = "emSpace"; + CharacterCodes2[CharacterCodes2["threePerEmSpace"] = 8196] = "threePerEmSpace"; + CharacterCodes2[CharacterCodes2["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; + CharacterCodes2[CharacterCodes2["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; + CharacterCodes2[CharacterCodes2["figureSpace"] = 8199] = "figureSpace"; + CharacterCodes2[CharacterCodes2["punctuationSpace"] = 8200] = "punctuationSpace"; + CharacterCodes2[CharacterCodes2["thinSpace"] = 8201] = "thinSpace"; + CharacterCodes2[CharacterCodes2["hairSpace"] = 8202] = "hairSpace"; + CharacterCodes2[CharacterCodes2["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; + CharacterCodes2[CharacterCodes2["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; + CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace"; + CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace"; + CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham"; + CharacterCodes2[CharacterCodes2["_"] = 95] = "_"; + CharacterCodes2[CharacterCodes2["$"] = 36] = "$"; + CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0"; + CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1"; + CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2"; + CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3"; + CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4"; + CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5"; + CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6"; + CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7"; + CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8"; + CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9"; + CharacterCodes2[CharacterCodes2["a"] = 97] = "a"; + CharacterCodes2[CharacterCodes2["b"] = 98] = "b"; + CharacterCodes2[CharacterCodes2["c"] = 99] = "c"; + CharacterCodes2[CharacterCodes2["d"] = 100] = "d"; + CharacterCodes2[CharacterCodes2["e"] = 101] = "e"; + CharacterCodes2[CharacterCodes2["f"] = 102] = "f"; + CharacterCodes2[CharacterCodes2["g"] = 103] = "g"; + CharacterCodes2[CharacterCodes2["h"] = 104] = "h"; + CharacterCodes2[CharacterCodes2["i"] = 105] = "i"; + CharacterCodes2[CharacterCodes2["j"] = 106] = "j"; + CharacterCodes2[CharacterCodes2["k"] = 107] = "k"; + CharacterCodes2[CharacterCodes2["l"] = 108] = "l"; + CharacterCodes2[CharacterCodes2["m"] = 109] = "m"; + CharacterCodes2[CharacterCodes2["n"] = 110] = "n"; + CharacterCodes2[CharacterCodes2["o"] = 111] = "o"; + CharacterCodes2[CharacterCodes2["p"] = 112] = "p"; + CharacterCodes2[CharacterCodes2["q"] = 113] = "q"; + CharacterCodes2[CharacterCodes2["r"] = 114] = "r"; + CharacterCodes2[CharacterCodes2["s"] = 115] = "s"; + CharacterCodes2[CharacterCodes2["t"] = 116] = "t"; + CharacterCodes2[CharacterCodes2["u"] = 117] = "u"; + CharacterCodes2[CharacterCodes2["v"] = 118] = "v"; + CharacterCodes2[CharacterCodes2["w"] = 119] = "w"; + CharacterCodes2[CharacterCodes2["x"] = 120] = "x"; + CharacterCodes2[CharacterCodes2["y"] = 121] = "y"; + CharacterCodes2[CharacterCodes2["z"] = 122] = "z"; + CharacterCodes2[CharacterCodes2["A"] = 65] = "A"; + CharacterCodes2[CharacterCodes2["B"] = 66] = "B"; + CharacterCodes2[CharacterCodes2["C"] = 67] = "C"; + CharacterCodes2[CharacterCodes2["D"] = 68] = "D"; + CharacterCodes2[CharacterCodes2["E"] = 69] = "E"; + CharacterCodes2[CharacterCodes2["F"] = 70] = "F"; + CharacterCodes2[CharacterCodes2["G"] = 71] = "G"; + CharacterCodes2[CharacterCodes2["H"] = 72] = "H"; + CharacterCodes2[CharacterCodes2["I"] = 73] = "I"; + CharacterCodes2[CharacterCodes2["J"] = 74] = "J"; + CharacterCodes2[CharacterCodes2["K"] = 75] = "K"; + CharacterCodes2[CharacterCodes2["L"] = 76] = "L"; + CharacterCodes2[CharacterCodes2["M"] = 77] = "M"; + CharacterCodes2[CharacterCodes2["N"] = 78] = "N"; + CharacterCodes2[CharacterCodes2["O"] = 79] = "O"; + CharacterCodes2[CharacterCodes2["P"] = 80] = "P"; + CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q"; + CharacterCodes2[CharacterCodes2["R"] = 82] = "R"; + CharacterCodes2[CharacterCodes2["S"] = 83] = "S"; + CharacterCodes2[CharacterCodes2["T"] = 84] = "T"; + CharacterCodes2[CharacterCodes2["U"] = 85] = "U"; + CharacterCodes2[CharacterCodes2["V"] = 86] = "V"; + CharacterCodes2[CharacterCodes2["W"] = 87] = "W"; + CharacterCodes2[CharacterCodes2["X"] = 88] = "X"; + CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y"; + CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z"; + CharacterCodes2[CharacterCodes2["ampersand"] = 38] = "ampersand"; + CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk"; + CharacterCodes2[CharacterCodes2["at"] = 64] = "at"; + CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash"; + CharacterCodes2[CharacterCodes2["backtick"] = 96] = "backtick"; + CharacterCodes2[CharacterCodes2["bar"] = 124] = "bar"; + CharacterCodes2[CharacterCodes2["caret"] = 94] = "caret"; + CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace"; + CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket"; + CharacterCodes2[CharacterCodes2["closeParen"] = 41] = "closeParen"; + CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon"; + CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma"; + CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot"; + CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote"; + CharacterCodes2[CharacterCodes2["equals"] = 61] = "equals"; + CharacterCodes2[CharacterCodes2["exclamation"] = 33] = "exclamation"; + CharacterCodes2[CharacterCodes2["greaterThan"] = 62] = "greaterThan"; + CharacterCodes2[CharacterCodes2["hash"] = 35] = "hash"; + CharacterCodes2[CharacterCodes2["lessThan"] = 60] = "lessThan"; + CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus"; + CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace"; + CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket"; + CharacterCodes2[CharacterCodes2["openParen"] = 40] = "openParen"; + CharacterCodes2[CharacterCodes2["percent"] = 37] = "percent"; + CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus"; + CharacterCodes2[CharacterCodes2["question"] = 63] = "question"; + CharacterCodes2[CharacterCodes2["semicolon"] = 59] = "semicolon"; + CharacterCodes2[CharacterCodes2["singleQuote"] = 39] = "singleQuote"; + CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash"; + CharacterCodes2[CharacterCodes2["tilde"] = 126] = "tilde"; + CharacterCodes2[CharacterCodes2["backspace"] = 8] = "backspace"; + CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed"; + CharacterCodes2[CharacterCodes2["byteOrderMark"] = 65279] = "byteOrderMark"; + CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab"; + CharacterCodes2[CharacterCodes2["verticalTab"] = 11] = "verticalTab"; + return CharacterCodes2; + })(CharacterCodes || {}); + Extension6 = /* @__PURE__ */ ((Extension22) => { + Extension22["Ts"] = ".ts"; + Extension22["Tsx"] = ".tsx"; + Extension22["Dts"] = ".d.ts"; + Extension22["Js"] = ".js"; + Extension22["Jsx"] = ".jsx"; + Extension22["Json"] = ".json"; + Extension22["TsBuildInfo"] = ".tsbuildinfo"; + Extension22["Mjs"] = ".mjs"; + Extension22["Mts"] = ".mts"; + Extension22["Dmts"] = ".d.mts"; + Extension22["Cjs"] = ".cjs"; + Extension22["Cts"] = ".cts"; + Extension22["Dcts"] = ".d.cts"; + return Extension22; + })(Extension6 || {}); + TransformFlags = /* @__PURE__ */ ((TransformFlags3) => { + TransformFlags3[TransformFlags3["None"] = 0] = "None"; + TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript"; + TransformFlags3[TransformFlags3["ContainsJsx"] = 2] = "ContainsJsx"; + TransformFlags3[TransformFlags3["ContainsESNext"] = 4] = "ContainsESNext"; + TransformFlags3[TransformFlags3["ContainsES2022"] = 8] = "ContainsES2022"; + TransformFlags3[TransformFlags3["ContainsES2021"] = 16] = "ContainsES2021"; + TransformFlags3[TransformFlags3["ContainsES2020"] = 32] = "ContainsES2020"; + TransformFlags3[TransformFlags3["ContainsES2019"] = 64] = "ContainsES2019"; + TransformFlags3[TransformFlags3["ContainsES2018"] = 128] = "ContainsES2018"; + TransformFlags3[TransformFlags3["ContainsES2017"] = 256] = "ContainsES2017"; + TransformFlags3[TransformFlags3["ContainsES2016"] = 512] = "ContainsES2016"; + TransformFlags3[TransformFlags3["ContainsES2015"] = 1024] = "ContainsES2015"; + TransformFlags3[TransformFlags3["ContainsGenerator"] = 2048] = "ContainsGenerator"; + TransformFlags3[TransformFlags3["ContainsDestructuringAssignment"] = 4096] = "ContainsDestructuringAssignment"; + TransformFlags3[TransformFlags3["ContainsTypeScriptClassSyntax"] = 8192] = "ContainsTypeScriptClassSyntax"; + TransformFlags3[TransformFlags3["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; + TransformFlags3[TransformFlags3["ContainsRestOrSpread"] = 32768] = "ContainsRestOrSpread"; + TransformFlags3[TransformFlags3["ContainsObjectRestOrSpread"] = 65536] = "ContainsObjectRestOrSpread"; + TransformFlags3[TransformFlags3["ContainsComputedPropertyName"] = 131072] = "ContainsComputedPropertyName"; + TransformFlags3[TransformFlags3["ContainsBlockScopedBinding"] = 262144] = "ContainsBlockScopedBinding"; + TransformFlags3[TransformFlags3["ContainsBindingPattern"] = 524288] = "ContainsBindingPattern"; + TransformFlags3[TransformFlags3["ContainsYield"] = 1048576] = "ContainsYield"; + TransformFlags3[TransformFlags3["ContainsAwait"] = 2097152] = "ContainsAwait"; + TransformFlags3[TransformFlags3["ContainsHoistedDeclarationOrCompletion"] = 4194304] = "ContainsHoistedDeclarationOrCompletion"; + TransformFlags3[TransformFlags3["ContainsDynamicImport"] = 8388608] = "ContainsDynamicImport"; + TransformFlags3[TransformFlags3["ContainsClassFields"] = 16777216] = "ContainsClassFields"; + TransformFlags3[TransformFlags3["ContainsDecorators"] = 33554432] = "ContainsDecorators"; + TransformFlags3[TransformFlags3["ContainsPossibleTopLevelAwait"] = 67108864] = "ContainsPossibleTopLevelAwait"; + TransformFlags3[TransformFlags3["ContainsLexicalSuper"] = 134217728] = "ContainsLexicalSuper"; + TransformFlags3[TransformFlags3["ContainsUpdateExpressionForIdentifier"] = 268435456] = "ContainsUpdateExpressionForIdentifier"; + TransformFlags3[TransformFlags3["ContainsPrivateIdentifierInExpression"] = 536870912] = "ContainsPrivateIdentifierInExpression"; + TransformFlags3[TransformFlags3["HasComputedFlags"] = -2147483648] = "HasComputedFlags"; + TransformFlags3[ + TransformFlags3["AssertTypeScript"] = 1 + /* ContainsTypeScript */ + ] = "AssertTypeScript"; + TransformFlags3[ + TransformFlags3["AssertJsx"] = 2 + /* ContainsJsx */ + ] = "AssertJsx"; + TransformFlags3[ + TransformFlags3["AssertESNext"] = 4 + /* ContainsESNext */ + ] = "AssertESNext"; + TransformFlags3[ + TransformFlags3["AssertES2022"] = 8 + /* ContainsES2022 */ + ] = "AssertES2022"; + TransformFlags3[ + TransformFlags3["AssertES2021"] = 16 + /* ContainsES2021 */ + ] = "AssertES2021"; + TransformFlags3[ + TransformFlags3["AssertES2020"] = 32 + /* ContainsES2020 */ + ] = "AssertES2020"; + TransformFlags3[ + TransformFlags3["AssertES2019"] = 64 + /* ContainsES2019 */ + ] = "AssertES2019"; + TransformFlags3[ + TransformFlags3["AssertES2018"] = 128 + /* ContainsES2018 */ + ] = "AssertES2018"; + TransformFlags3[ + TransformFlags3["AssertES2017"] = 256 + /* ContainsES2017 */ + ] = "AssertES2017"; + TransformFlags3[ + TransformFlags3["AssertES2016"] = 512 + /* ContainsES2016 */ + ] = "AssertES2016"; + TransformFlags3[ + TransformFlags3["AssertES2015"] = 1024 + /* ContainsES2015 */ + ] = "AssertES2015"; + TransformFlags3[ + TransformFlags3["AssertGenerator"] = 2048 + /* ContainsGenerator */ + ] = "AssertGenerator"; + TransformFlags3[ + TransformFlags3["AssertDestructuringAssignment"] = 4096 + /* ContainsDestructuringAssignment */ + ] = "AssertDestructuringAssignment"; + TransformFlags3[ + TransformFlags3["OuterExpressionExcludes"] = -2147483648 + /* HasComputedFlags */ + ] = "OuterExpressionExcludes"; + TransformFlags3[ + TransformFlags3["PropertyAccessExcludes"] = -2147483648 + /* OuterExpressionExcludes */ + ] = "PropertyAccessExcludes"; + TransformFlags3[ + TransformFlags3["NodeExcludes"] = -2147483648 + /* PropertyAccessExcludes */ + ] = "NodeExcludes"; + TransformFlags3[TransformFlags3["ArrowFunctionExcludes"] = -2072174592] = "ArrowFunctionExcludes"; + TransformFlags3[TransformFlags3["FunctionExcludes"] = -1937940480] = "FunctionExcludes"; + TransformFlags3[TransformFlags3["ConstructorExcludes"] = -1937948672] = "ConstructorExcludes"; + TransformFlags3[TransformFlags3["MethodOrAccessorExcludes"] = -2005057536] = "MethodOrAccessorExcludes"; + TransformFlags3[TransformFlags3["PropertyExcludes"] = -2013249536] = "PropertyExcludes"; + TransformFlags3[TransformFlags3["ClassExcludes"] = -2147344384] = "ClassExcludes"; + TransformFlags3[TransformFlags3["ModuleExcludes"] = -1941676032] = "ModuleExcludes"; + TransformFlags3[TransformFlags3["TypeExcludes"] = -2] = "TypeExcludes"; + TransformFlags3[TransformFlags3["ObjectLiteralExcludes"] = -2147278848] = "ObjectLiteralExcludes"; + TransformFlags3[TransformFlags3["ArrayLiteralOrCallOrNewExcludes"] = -2147450880] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags3[TransformFlags3["VariableDeclarationListExcludes"] = -2146893824] = "VariableDeclarationListExcludes"; + TransformFlags3[ + TransformFlags3["ParameterExcludes"] = -2147483648 + /* NodeExcludes */ + ] = "ParameterExcludes"; + TransformFlags3[TransformFlags3["CatchClauseExcludes"] = -2147418112] = "CatchClauseExcludes"; + TransformFlags3[TransformFlags3["BindingPatternExcludes"] = -2147450880] = "BindingPatternExcludes"; + TransformFlags3[TransformFlags3["ContainsLexicalThisOrSuper"] = 134234112] = "ContainsLexicalThisOrSuper"; + TransformFlags3[TransformFlags3["PropertyNamePropagatingFlags"] = 134234112] = "PropertyNamePropagatingFlags"; + return TransformFlags3; + })(TransformFlags || {}); + SnippetKind = /* @__PURE__ */ ((SnippetKind3) => { + SnippetKind3[SnippetKind3["TabStop"] = 0] = "TabStop"; + SnippetKind3[SnippetKind3["Placeholder"] = 1] = "Placeholder"; + SnippetKind3[SnippetKind3["Choice"] = 2] = "Choice"; + SnippetKind3[SnippetKind3["Variable"] = 3] = "Variable"; + return SnippetKind3; + })(SnippetKind || {}); + EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { + EmitFlags3[EmitFlags3["None"] = 0] = "None"; + EmitFlags3[EmitFlags3["SingleLine"] = 1] = "SingleLine"; + EmitFlags3[EmitFlags3["MultiLine"] = 2] = "MultiLine"; + EmitFlags3[EmitFlags3["AdviseOnEmitNode"] = 4] = "AdviseOnEmitNode"; + EmitFlags3[EmitFlags3["NoSubstitution"] = 8] = "NoSubstitution"; + EmitFlags3[EmitFlags3["CapturesThis"] = 16] = "CapturesThis"; + EmitFlags3[EmitFlags3["NoLeadingSourceMap"] = 32] = "NoLeadingSourceMap"; + EmitFlags3[EmitFlags3["NoTrailingSourceMap"] = 64] = "NoTrailingSourceMap"; + EmitFlags3[EmitFlags3["NoSourceMap"] = 96] = "NoSourceMap"; + EmitFlags3[EmitFlags3["NoNestedSourceMaps"] = 128] = "NoNestedSourceMaps"; + EmitFlags3[EmitFlags3["NoTokenLeadingSourceMaps"] = 256] = "NoTokenLeadingSourceMaps"; + EmitFlags3[EmitFlags3["NoTokenTrailingSourceMaps"] = 512] = "NoTokenTrailingSourceMaps"; + EmitFlags3[EmitFlags3["NoTokenSourceMaps"] = 768] = "NoTokenSourceMaps"; + EmitFlags3[EmitFlags3["NoLeadingComments"] = 1024] = "NoLeadingComments"; + EmitFlags3[EmitFlags3["NoTrailingComments"] = 2048] = "NoTrailingComments"; + EmitFlags3[EmitFlags3["NoComments"] = 3072] = "NoComments"; + EmitFlags3[EmitFlags3["NoNestedComments"] = 4096] = "NoNestedComments"; + EmitFlags3[EmitFlags3["HelperName"] = 8192] = "HelperName"; + EmitFlags3[EmitFlags3["ExportName"] = 16384] = "ExportName"; + EmitFlags3[EmitFlags3["LocalName"] = 32768] = "LocalName"; + EmitFlags3[EmitFlags3["InternalName"] = 65536] = "InternalName"; + EmitFlags3[EmitFlags3["Indented"] = 131072] = "Indented"; + EmitFlags3[EmitFlags3["NoIndentation"] = 262144] = "NoIndentation"; + EmitFlags3[EmitFlags3["AsyncFunctionBody"] = 524288] = "AsyncFunctionBody"; + EmitFlags3[EmitFlags3["ReuseTempVariableScope"] = 1048576] = "ReuseTempVariableScope"; + EmitFlags3[EmitFlags3["CustomPrologue"] = 2097152] = "CustomPrologue"; + EmitFlags3[EmitFlags3["NoHoisting"] = 4194304] = "NoHoisting"; + EmitFlags3[EmitFlags3["Iterator"] = 8388608] = "Iterator"; + EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; + return EmitFlags3; + })(EmitFlags || {}); + InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => { + InternalEmitFlags3[InternalEmitFlags3["None"] = 0] = "None"; + InternalEmitFlags3[InternalEmitFlags3["TypeScriptClassWrapper"] = 1] = "TypeScriptClassWrapper"; + InternalEmitFlags3[InternalEmitFlags3["NeverApplyImportHelper"] = 2] = "NeverApplyImportHelper"; + InternalEmitFlags3[InternalEmitFlags3["IgnoreSourceNewlines"] = 4] = "IgnoreSourceNewlines"; + InternalEmitFlags3[InternalEmitFlags3["Immutable"] = 8] = "Immutable"; + InternalEmitFlags3[InternalEmitFlags3["IndirectCall"] = 16] = "IndirectCall"; + InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements"; + return InternalEmitFlags3; + })(InternalEmitFlags || {}); + ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => { + ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Rest"] = 4] = "Rest"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Decorate"] = 8] = "Decorate"; + ExternalEmitHelpers2[ + ExternalEmitHelpers2["ESDecorateAndRunInitializers"] = 8 + /* Decorate */ + ] = "ESDecorateAndRunInitializers"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Metadata"] = 16] = "Metadata"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Param"] = 32] = "Param"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Awaiter"] = 64] = "Awaiter"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Generator"] = 128] = "Generator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Values"] = 256] = "Values"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Read"] = 512] = "Read"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadArray"] = 1024] = "SpreadArray"; + ExternalEmitHelpers2[ExternalEmitHelpers2["Await"] = 2048] = "Await"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGenerator"] = 4096] = "AsyncGenerator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegator"] = 8192] = "AsyncDelegator"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncValues"] = 16384] = "AsyncValues"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ExportStar"] = 32768] = "ExportStar"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ImportStar"] = 65536] = "ImportStar"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ImportDefault"] = 131072] = "ImportDefault"; + ExternalEmitHelpers2[ExternalEmitHelpers2["MakeTemplateObject"] = 262144] = "MakeTemplateObject"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldGet"] = 524288] = "ClassPrivateFieldGet"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldSet"] = 1048576] = "ClassPrivateFieldSet"; + ExternalEmitHelpers2[ExternalEmitHelpers2["ClassPrivateFieldIn"] = 2097152] = "ClassPrivateFieldIn"; + ExternalEmitHelpers2[ExternalEmitHelpers2["CreateBinding"] = 4194304] = "CreateBinding"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SetFunctionName"] = 8388608] = "SetFunctionName"; + ExternalEmitHelpers2[ExternalEmitHelpers2["PropKey"] = 16777216] = "PropKey"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AddDisposableResourceAndDisposeResources"] = 33554432] = "AddDisposableResourceAndDisposeResources"; + ExternalEmitHelpers2[ + ExternalEmitHelpers2["FirstEmitHelper"] = 1 + /* Extends */ + ] = "FirstEmitHelper"; + ExternalEmitHelpers2[ + ExternalEmitHelpers2["LastEmitHelper"] = 33554432 + /* AddDisposableResourceAndDisposeResources */ + ] = "LastEmitHelper"; + ExternalEmitHelpers2[ + ExternalEmitHelpers2["ForOfIncludes"] = 256 + /* Values */ + ] = "ForOfIncludes"; + ExternalEmitHelpers2[ + ExternalEmitHelpers2["ForAwaitOfIncludes"] = 16384 + /* AsyncValues */ + ] = "ForAwaitOfIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncGeneratorIncludes"] = 6144] = "AsyncGeneratorIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["AsyncDelegatorIncludes"] = 26624] = "AsyncDelegatorIncludes"; + ExternalEmitHelpers2[ExternalEmitHelpers2["SpreadIncludes"] = 1536] = "SpreadIncludes"; + return ExternalEmitHelpers2; + })(ExternalEmitHelpers || {}); + EmitHint = /* @__PURE__ */ ((EmitHint6) => { + EmitHint6[EmitHint6["SourceFile"] = 0] = "SourceFile"; + EmitHint6[EmitHint6["Expression"] = 1] = "Expression"; + EmitHint6[EmitHint6["IdentifierName"] = 2] = "IdentifierName"; + EmitHint6[EmitHint6["MappedTypeParameter"] = 3] = "MappedTypeParameter"; + EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified"; + EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement"; + EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue"; + EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes"; + return EmitHint6; + })(EmitHint || {}); + OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => { + OuterExpressionKinds2[OuterExpressionKinds2["Parentheses"] = 1] = "Parentheses"; + OuterExpressionKinds2[OuterExpressionKinds2["TypeAssertions"] = 2] = "TypeAssertions"; + OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions"; + OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions"; + OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 6] = "Assertions"; + OuterExpressionKinds2[OuterExpressionKinds2["All"] = 15] = "All"; + OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = 16] = "ExcludeJSDocTypeAssertion"; + return OuterExpressionKinds2; + })(OuterExpressionKinds || {}); + LexicalEnvironmentFlags = /* @__PURE__ */ ((LexicalEnvironmentFlags2) => { + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["None"] = 0] = "None"; + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["InParameters"] = 1] = "InParameters"; + LexicalEnvironmentFlags2[LexicalEnvironmentFlags2["VariablesHoistedInParameters"] = 2] = "VariablesHoistedInParameters"; + return LexicalEnvironmentFlags2; + })(LexicalEnvironmentFlags || {}); + BundleFileSectionKind = /* @__PURE__ */ ((BundleFileSectionKind2) => { + BundleFileSectionKind2["Prologue"] = "prologue"; + BundleFileSectionKind2["EmitHelpers"] = "emitHelpers"; + BundleFileSectionKind2["NoDefaultLib"] = "no-default-lib"; + BundleFileSectionKind2["Reference"] = "reference"; + BundleFileSectionKind2["Type"] = "type"; + BundleFileSectionKind2["TypeResolutionModeRequire"] = "type-require"; + BundleFileSectionKind2["TypeResolutionModeImport"] = "type-import"; + BundleFileSectionKind2["Lib"] = "lib"; + BundleFileSectionKind2["Prepend"] = "prepend"; + BundleFileSectionKind2["Text"] = "text"; + BundleFileSectionKind2["Internal"] = "internal"; + return BundleFileSectionKind2; + })(BundleFileSectionKind || {}); + ListFormat = /* @__PURE__ */ ((ListFormat2) => { + ListFormat2[ListFormat2["None"] = 0] = "None"; + ListFormat2[ListFormat2["SingleLine"] = 0] = "SingleLine"; + ListFormat2[ListFormat2["MultiLine"] = 1] = "MultiLine"; + ListFormat2[ListFormat2["PreserveLines"] = 2] = "PreserveLines"; + ListFormat2[ListFormat2["LinesMask"] = 3] = "LinesMask"; + ListFormat2[ListFormat2["NotDelimited"] = 0] = "NotDelimited"; + ListFormat2[ListFormat2["BarDelimited"] = 4] = "BarDelimited"; + ListFormat2[ListFormat2["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat2[ListFormat2["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat2[ListFormat2["AsteriskDelimited"] = 32] = "AsteriskDelimited"; + ListFormat2[ListFormat2["DelimitersMask"] = 60] = "DelimitersMask"; + ListFormat2[ListFormat2["AllowTrailingComma"] = 64] = "AllowTrailingComma"; + ListFormat2[ListFormat2["Indented"] = 128] = "Indented"; + ListFormat2[ListFormat2["SpaceBetweenBraces"] = 256] = "SpaceBetweenBraces"; + ListFormat2[ListFormat2["SpaceBetweenSiblings"] = 512] = "SpaceBetweenSiblings"; + ListFormat2[ListFormat2["Braces"] = 1024] = "Braces"; + ListFormat2[ListFormat2["Parenthesis"] = 2048] = "Parenthesis"; + ListFormat2[ListFormat2["AngleBrackets"] = 4096] = "AngleBrackets"; + ListFormat2[ListFormat2["SquareBrackets"] = 8192] = "SquareBrackets"; + ListFormat2[ListFormat2["BracketsMask"] = 15360] = "BracketsMask"; + ListFormat2[ListFormat2["OptionalIfUndefined"] = 16384] = "OptionalIfUndefined"; + ListFormat2[ListFormat2["OptionalIfEmpty"] = 32768] = "OptionalIfEmpty"; + ListFormat2[ListFormat2["Optional"] = 49152] = "Optional"; + ListFormat2[ListFormat2["PreferNewLine"] = 65536] = "PreferNewLine"; + ListFormat2[ListFormat2["NoTrailingNewLine"] = 131072] = "NoTrailingNewLine"; + ListFormat2[ListFormat2["NoInterveningComments"] = 262144] = "NoInterveningComments"; + ListFormat2[ListFormat2["NoSpaceIfEmpty"] = 524288] = "NoSpaceIfEmpty"; + ListFormat2[ListFormat2["SingleElement"] = 1048576] = "SingleElement"; + ListFormat2[ListFormat2["SpaceAfterList"] = 2097152] = "SpaceAfterList"; + ListFormat2[ListFormat2["Modifiers"] = 2359808] = "Modifiers"; + ListFormat2[ListFormat2["HeritageClauses"] = 512] = "HeritageClauses"; + ListFormat2[ListFormat2["SingleLineTypeLiteralMembers"] = 768] = "SingleLineTypeLiteralMembers"; + ListFormat2[ListFormat2["MultiLineTypeLiteralMembers"] = 32897] = "MultiLineTypeLiteralMembers"; + ListFormat2[ListFormat2["SingleLineTupleTypeElements"] = 528] = "SingleLineTupleTypeElements"; + ListFormat2[ListFormat2["MultiLineTupleTypeElements"] = 657] = "MultiLineTupleTypeElements"; + ListFormat2[ListFormat2["UnionTypeConstituents"] = 516] = "UnionTypeConstituents"; + ListFormat2[ListFormat2["IntersectionTypeConstituents"] = 520] = "IntersectionTypeConstituents"; + ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements"; + ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements"; + ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties"; + ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes"; + ListFormat2[ + ListFormat2["ImportClauseEntries"] = 526226 + /* ImportAttributes */ + ] = "ImportClauseEntries"; + ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements"; + ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements"; + ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments"; + ListFormat2[ListFormat2["NewExpressionArguments"] = 18960] = "NewExpressionArguments"; + ListFormat2[ListFormat2["TemplateExpressionSpans"] = 262144] = "TemplateExpressionSpans"; + ListFormat2[ListFormat2["SingleLineBlockStatements"] = 768] = "SingleLineBlockStatements"; + ListFormat2[ListFormat2["MultiLineBlockStatements"] = 129] = "MultiLineBlockStatements"; + ListFormat2[ListFormat2["VariableDeclarationList"] = 528] = "VariableDeclarationList"; + ListFormat2[ListFormat2["SingleLineFunctionBodyStatements"] = 768] = "SingleLineFunctionBodyStatements"; + ListFormat2[ + ListFormat2["MultiLineFunctionBodyStatements"] = 1 + /* MultiLine */ + ] = "MultiLineFunctionBodyStatements"; + ListFormat2[ + ListFormat2["ClassHeritageClauses"] = 0 + /* SingleLine */ + ] = "ClassHeritageClauses"; + ListFormat2[ListFormat2["ClassMembers"] = 129] = "ClassMembers"; + ListFormat2[ListFormat2["InterfaceMembers"] = 129] = "InterfaceMembers"; + ListFormat2[ListFormat2["EnumMembers"] = 145] = "EnumMembers"; + ListFormat2[ListFormat2["CaseBlockClauses"] = 129] = "CaseBlockClauses"; + ListFormat2[ListFormat2["NamedImportsOrExportsElements"] = 525136] = "NamedImportsOrExportsElements"; + ListFormat2[ListFormat2["JsxElementOrFragmentChildren"] = 262144] = "JsxElementOrFragmentChildren"; + ListFormat2[ListFormat2["JsxElementAttributes"] = 262656] = "JsxElementAttributes"; + ListFormat2[ListFormat2["CaseOrDefaultClauseStatements"] = 163969] = "CaseOrDefaultClauseStatements"; + ListFormat2[ListFormat2["HeritageClauseTypes"] = 528] = "HeritageClauseTypes"; + ListFormat2[ListFormat2["SourceFileStatements"] = 131073] = "SourceFileStatements"; + ListFormat2[ListFormat2["Decorators"] = 2146305] = "Decorators"; + ListFormat2[ListFormat2["TypeArguments"] = 53776] = "TypeArguments"; + ListFormat2[ListFormat2["TypeParameters"] = 53776] = "TypeParameters"; + ListFormat2[ListFormat2["Parameters"] = 2576] = "Parameters"; + ListFormat2[ListFormat2["IndexSignatureParameters"] = 8848] = "IndexSignatureParameters"; + ListFormat2[ListFormat2["JSDocComment"] = 33] = "JSDocComment"; + return ListFormat2; + })(ListFormat || {}); + PragmaKindFlags = /* @__PURE__ */ ((PragmaKindFlags2) => { + PragmaKindFlags2[PragmaKindFlags2["None"] = 0] = "None"; + PragmaKindFlags2[PragmaKindFlags2["TripleSlashXML"] = 1] = "TripleSlashXML"; + PragmaKindFlags2[PragmaKindFlags2["SingleLine"] = 2] = "SingleLine"; + PragmaKindFlags2[PragmaKindFlags2["MultiLine"] = 4] = "MultiLine"; + PragmaKindFlags2[PragmaKindFlags2["All"] = 7] = "All"; + PragmaKindFlags2[ + PragmaKindFlags2["Default"] = 7 + /* All */ + ] = "Default"; + return PragmaKindFlags2; + })(PragmaKindFlags || {}); + commentPragmas = { + "reference": { + args: [ + { name: "types", optional: true, captureSpan: true }, + { name: "lib", optional: true, captureSpan: true }, + { name: "path", optional: true, captureSpan: true }, + { name: "no-default-lib", optional: true }, + { name: "resolution-mode", optional: true } + ], + kind: 1 + /* TripleSlashXML */ + }, + "amd-dependency": { + args: [{ name: "path" }, { name: "name", optional: true }], + kind: 1 + /* TripleSlashXML */ + }, + "amd-module": { + args: [{ name: "name" }], + kind: 1 + /* TripleSlashXML */ + }, + "ts-check": { + kind: 2 + /* SingleLine */ + }, + "ts-nocheck": { + kind: 2 + /* SingleLine */ + }, + "jsx": { + args: [{ name: "factory" }], + kind: 4 + /* MultiLine */ + }, + "jsxfrag": { + args: [{ name: "factory" }], + kind: 4 + /* MultiLine */ + }, + "jsximportsource": { + args: [{ name: "factory" }], + kind: 4 + /* MultiLine */ + }, + "jsxruntime": { + args: [{ name: "factory" }], + kind: 4 + /* MultiLine */ + } + }; + JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode6) => { + JSDocParsingMode6[JSDocParsingMode6["ParseAll"] = 0] = "ParseAll"; + JSDocParsingMode6[JSDocParsingMode6["ParseNone"] = 1] = "ParseNone"; + JSDocParsingMode6[JSDocParsingMode6["ParseForTypeErrors"] = 2] = "ParseForTypeErrors"; + JSDocParsingMode6[JSDocParsingMode6["ParseForTypeInfo"] = 3] = "ParseForTypeInfo"; + return JSDocParsingMode6; + })(JSDocParsingMode || {}); + } + }); + function generateDjb2Hash(data) { + let acc = 5381; + for (let i7 = 0; i7 < data.length; i7++) { + acc = (acc << 5) + acc + data.charCodeAt(i7); + } + return acc.toString(); + } + function setStackTraceLimit() { + if (Error.stackTraceLimit < 100) { + Error.stackTraceLimit = 100; + } + } + function getModifiedTime(host, fileName) { + return host.getModifiedTime(fileName) || missingFileModifiedTime; + } + function createPollingIntervalBasedLevels(levels) { + return { + [ + 250 + /* Low */ + ]: levels.Low, + [ + 500 + /* Medium */ + ]: levels.Medium, + [ + 2e3 + /* High */ + ]: levels.High + }; + } + function setCustomPollingValues(system) { + if (!system.getEnvironmentVariable) { + return; + } + const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); + pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; + unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds; + function getLevel(envVar, level) { + return system.getEnvironmentVariable(`${envVar}_${level.toUpperCase()}`); + } + function getCustomLevels(baseVariable) { + let customLevels; + setCustomLevel("Low"); + setCustomLevel("Medium"); + setCustomLevel("High"); + return customLevels; + function setCustomLevel(level) { + const customLevel = getLevel(baseVariable, level); + if (customLevel) { + (customLevels || (customLevels = {}))[level] = Number(customLevel); + } + } + } + function setCustomLevels(baseVariable, levels) { + const customLevels = getCustomLevels(baseVariable); + if (customLevels) { + setLevel("Low"); + setLevel("Medium"); + setLevel("High"); + return true; + } + return false; + function setLevel(level) { + levels[level] = customLevels[level] || levels[level]; + } + } + function getCustomPollingBasedLevels(baseVariable, defaultLevels) { + const customLevels = getCustomLevels(baseVariable); + return (pollingIntervalChanged || customLevels) && createPollingIntervalBasedLevels(customLevels ? { ...defaultLevels, ...customLevels } : defaultLevels); + } + } + function pollWatchedFileQueue(host, queue3, pollIndex, chunkSize, callbackOnWatchFileStat) { + let definedValueCopyToIndex = pollIndex; + for (let canVisit = queue3.length; chunkSize && canVisit; nextPollIndex(), canVisit--) { + const watchedFile = queue3[pollIndex]; + if (!watchedFile) { + continue; + } else if (watchedFile.isClosed) { + queue3[pollIndex] = void 0; + continue; + } + chunkSize--; + const fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(host, watchedFile.fileName)); + if (watchedFile.isClosed) { + queue3[pollIndex] = void 0; + continue; + } + callbackOnWatchFileStat == null ? void 0 : callbackOnWatchFileStat(watchedFile, pollIndex, fileChanged); + if (queue3[pollIndex]) { + if (definedValueCopyToIndex < pollIndex) { + queue3[definedValueCopyToIndex] = watchedFile; + queue3[pollIndex] = void 0; + } + definedValueCopyToIndex++; + } + } + return pollIndex; + function nextPollIndex() { + pollIndex++; + if (pollIndex === queue3.length) { + if (definedValueCopyToIndex < pollIndex) { + queue3.length = definedValueCopyToIndex; + } + pollIndex = 0; + definedValueCopyToIndex = 0; + } + } + } + function createDynamicPriorityPollingWatchFile(host) { + const watchedFiles = []; + const changedFilesInLastPoll = []; + const lowPollingIntervalQueue = createPollingIntervalQueue( + 250 + /* Low */ + ); + const mediumPollingIntervalQueue = createPollingIntervalQueue( + 500 + /* Medium */ + ); + const highPollingIntervalQueue = createPollingIntervalQueue( + 2e3 + /* High */ + ); + return watchFile2; + function watchFile2(fileName, callback, defaultPollingInterval) { + const file = { + fileName, + callback, + unchangedPolls: 0, + mtime: getModifiedTime(host, fileName) + }; + watchedFiles.push(file); + addToPollingIntervalQueue(file, defaultPollingInterval); + return { + close: () => { + file.isClosed = true; + unorderedRemoveItem(watchedFiles, file); + } + }; + } + function createPollingIntervalQueue(pollingInterval) { + const queue3 = []; + queue3.pollingInterval = pollingInterval; + queue3.pollIndex = 0; + queue3.pollScheduled = false; + return queue3; + } + function pollPollingIntervalQueue(_timeoutType, queue3) { + queue3.pollIndex = pollQueue(queue3, queue3.pollingInterval, queue3.pollIndex, pollingChunkSize[queue3.pollingInterval]); + if (queue3.length) { + scheduleNextPoll(queue3.pollingInterval); + } else { + Debug.assert(queue3.pollIndex === 0); + queue3.pollScheduled = false; + } + } + function pollLowPollingIntervalQueue(_timeoutType, queue3) { + pollQueue( + changedFilesInLastPoll, + 250, + /*pollIndex*/ + 0, + changedFilesInLastPoll.length + ); + pollPollingIntervalQueue(_timeoutType, queue3); + if (!queue3.pollScheduled && changedFilesInLastPoll.length) { + scheduleNextPoll( + 250 + /* Low */ + ); + } + } + function pollQueue(queue3, pollingInterval, pollIndex, chunkSize) { + return pollWatchedFileQueue( + host, + queue3, + pollIndex, + chunkSize, + onWatchFileStat + ); + function onWatchFileStat(watchedFile, pollIndex2, fileChanged) { + if (fileChanged) { + watchedFile.unchangedPolls = 0; + if (queue3 !== changedFilesInLastPoll) { + queue3[pollIndex2] = void 0; + addChangedFileToLowPollingIntervalQueue(watchedFile); + } + } else if (watchedFile.unchangedPolls !== unchangedPollThresholds[pollingInterval]) { + watchedFile.unchangedPolls++; + } else if (queue3 === changedFilesInLastPoll) { + watchedFile.unchangedPolls = 1; + queue3[pollIndex2] = void 0; + addToPollingIntervalQueue( + watchedFile, + 250 + /* Low */ + ); + } else if (pollingInterval !== 2e3) { + watchedFile.unchangedPolls++; + queue3[pollIndex2] = void 0; + addToPollingIntervalQueue( + watchedFile, + pollingInterval === 250 ? 500 : 2e3 + /* High */ + ); + } + } + } + function pollingIntervalQueue(pollingInterval) { + switch (pollingInterval) { + case 250: + return lowPollingIntervalQueue; + case 500: + return mediumPollingIntervalQueue; + case 2e3: + return highPollingIntervalQueue; + } + } + function addToPollingIntervalQueue(file, pollingInterval) { + pollingIntervalQueue(pollingInterval).push(file); + scheduleNextPollIfNotAlreadyScheduled(pollingInterval); + } + function addChangedFileToLowPollingIntervalQueue(file) { + changedFilesInLastPoll.push(file); + scheduleNextPollIfNotAlreadyScheduled( + 250 + /* Low */ + ); + } + function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { + if (!pollingIntervalQueue(pollingInterval).pollScheduled) { + scheduleNextPoll(pollingInterval); + } + } + function scheduleNextPoll(pollingInterval) { + pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval)); + } + } + function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp) { + const fileWatcherCallbacks = createMultiMap(); + const fileTimestamps = fsWatchWithTimestamp ? /* @__PURE__ */ new Map() : void 0; + const dirWatchers = /* @__PURE__ */ new Map(); + const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + return nonPollingWatchFile; + function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) { + const filePath = toCanonicalName(fileName); + if (fileWatcherCallbacks.add(filePath, callback).length === 1 && fileTimestamps) { + fileTimestamps.set(filePath, getModifiedTime3(fileName) || missingFileModifiedTime); + } + const dirPath = getDirectoryPath(filePath) || "."; + const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions); + watcher.referenceCount++; + return { + close: () => { + if (watcher.referenceCount === 1) { + watcher.close(); + dirWatchers.delete(dirPath); + } else { + watcher.referenceCount--; + } + fileWatcherCallbacks.remove(filePath, callback); + } + }; + } + function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { + const watcher = fsWatch( + dirName, + 1, + (eventName, relativeFileName) => { + if (!isString4(relativeFileName)) + return; + const fileName = getNormalizedAbsolutePath(relativeFileName, dirName); + const filePath = toCanonicalName(fileName); + const callbacks = fileName && fileWatcherCallbacks.get(filePath); + if (callbacks) { + let currentModifiedTime; + let eventKind = 1; + if (fileTimestamps) { + const existingTime = fileTimestamps.get(filePath); + if (eventName === "change") { + currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime; + if (currentModifiedTime.getTime() === existingTime.getTime()) + return; + } + currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime); + fileTimestamps.set(filePath, currentModifiedTime); + if (existingTime === missingFileModifiedTime) + eventKind = 0; + else if (currentModifiedTime === missingFileModifiedTime) + eventKind = 2; + } + for (const fileCallback of callbacks) { + fileCallback(fileName, eventKind, currentModifiedTime); + } + } + }, + /*recursive*/ + false, + 500, + fallbackOptions + ); + watcher.referenceCount = 0; + dirWatchers.set(dirPath, watcher); + return watcher; + } + } + function createFixedChunkSizePollingWatchFile(host) { + const watchedFiles = []; + let pollIndex = 0; + let pollScheduled; + return watchFile2; + function watchFile2(fileName, callback) { + const file = { + fileName, + callback, + mtime: getModifiedTime(host, fileName) + }; + watchedFiles.push(file); + scheduleNextPoll(); + return { + close: () => { + file.isClosed = true; + unorderedRemoveItem(watchedFiles, file); + } + }; + } + function pollQueue() { + pollScheduled = void 0; + pollIndex = pollWatchedFileQueue(host, watchedFiles, pollIndex, pollingChunkSize[ + 250 + /* Low */ + ]); + scheduleNextPoll(); + } + function scheduleNextPoll() { + if (!watchedFiles.length || pollScheduled) + return; + pollScheduled = host.setTimeout(pollQueue, 2e3, "pollQueue"); + } + } + function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name2, callback, createWatcher) { + const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + const path2 = toCanonicalFileName(name2); + const existing = cache.get(path2); + if (existing) { + existing.callbacks.push(callback); + } else { + cache.set(path2, { + watcher: createWatcher( + // Cant infer types correctly so lets satisfy checker + (param1, param2, param3) => { + var _a2; + return (_a2 = cache.get(path2)) == null ? void 0 : _a2.callbacks.slice().forEach((cb) => cb(param1, param2, param3)); + } + ), + callbacks: [callback] + }); + } + return { + close: () => { + const watcher = cache.get(path2); + if (!watcher) + return; + if (!orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length) + return; + cache.delete(path2); + closeFileWatcherOf(watcher); + } + }; + } + function onWatchedFileStat(watchedFile, modifiedTime) { + const oldTime = watchedFile.mtime.getTime(); + const newTime = modifiedTime.getTime(); + if (oldTime !== newTime) { + watchedFile.mtime = modifiedTime; + watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime); + return true; + } + return false; + } + function getFileWatcherEventKind(oldTime, newTime) { + return oldTime === 0 ? 0 : newTime === 0 ? 2 : 1; + } + function sysLog(s7) { + return curSysLog(s7); + } + function setSysLog(logger) { + curSysLog = logger; + } + function createDirectoryWatcherSupportingRecursive({ + watchDirectory, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + getCurrentDirectory, + getAccessibleSortedChildDirectories, + fileSystemEntryExists, + realpath: realpath2, + setTimeout: setTimeout2, + clearTimeout: clearTimeout2 + }) { + const cache = /* @__PURE__ */ new Map(); + const callbackCache = createMultiMap(); + const cacheToUpdateChildWatches = /* @__PURE__ */ new Map(); + let timerToUpdateChildWatches; + const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2); + const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2); + return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options); + function createDirectoryWatcher(dirName, options, callback) { + const dirPath = toCanonicalFilePath(dirName); + let directoryWatcher = cache.get(dirPath); + if (directoryWatcher) { + directoryWatcher.refCount++; + } else { + directoryWatcher = { + watcher: watchDirectory( + dirName, + (fileName) => { + if (isIgnoredPath(fileName, options)) + return; + if (options == null ? void 0 : options.synchronousWatchDirectory) { + invokeCallbacks(dirPath, fileName); + updateChildWatches(dirName, dirPath, options); + } else { + nonSyncUpdateChildWatches(dirName, dirPath, fileName, options); + } + }, + /*recursive*/ + false, + options + ), + refCount: 1, + childWatches: emptyArray + }; + cache.set(dirPath, directoryWatcher); + updateChildWatches(dirName, dirPath, options); + } + const callbackToAdd = callback && { dirName, callback }; + if (callbackToAdd) { + callbackCache.add(dirPath, callbackToAdd); + } + return { + dirName, + close: () => { + const directoryWatcher2 = Debug.checkDefined(cache.get(dirPath)); + if (callbackToAdd) + callbackCache.remove(dirPath, callbackToAdd); + directoryWatcher2.refCount--; + if (directoryWatcher2.refCount) + return; + cache.delete(dirPath); + closeFileWatcherOf(directoryWatcher2); + directoryWatcher2.childWatches.forEach(closeFileWatcher); + } + }; + } + function invokeCallbacks(dirPath, fileNameOrInvokeMap, fileNames) { + let fileName; + let invokeMap2; + if (isString4(fileNameOrInvokeMap)) { + fileName = fileNameOrInvokeMap; + } else { + invokeMap2 = fileNameOrInvokeMap; + } + callbackCache.forEach((callbacks, rootDirName) => { + if (invokeMap2 && invokeMap2.get(rootDirName) === true) + return; + if (rootDirName === dirPath || startsWith2(dirPath, rootDirName) && dirPath[rootDirName.length] === directorySeparator) { + if (invokeMap2) { + if (fileNames) { + const existing = invokeMap2.get(rootDirName); + if (existing) { + existing.push(...fileNames); + } else { + invokeMap2.set(rootDirName, fileNames.slice()); + } + } else { + invokeMap2.set(rootDirName, true); + } + } else { + callbacks.forEach(({ callback }) => callback(fileName)); + } + } + }); + } + function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { + const parentWatcher = cache.get(dirPath); + if (parentWatcher && fileSystemEntryExists( + dirName, + 1 + /* Directory */ + )) { + scheduleUpdateChildWatches(dirName, dirPath, fileName, options); + return; + } + invokeCallbacks(dirPath, fileName); + removeChildWatches(parentWatcher); + } + function scheduleUpdateChildWatches(dirName, dirPath, fileName, options) { + const existing = cacheToUpdateChildWatches.get(dirPath); + if (existing) { + existing.fileNames.push(fileName); + } else { + cacheToUpdateChildWatches.set(dirPath, { dirName, options, fileNames: [fileName] }); + } + if (timerToUpdateChildWatches) { + clearTimeout2(timerToUpdateChildWatches); + timerToUpdateChildWatches = void 0; + } + timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3, "timerToUpdateChildWatches"); + } + function onTimerToUpdateChildWatches() { + timerToUpdateChildWatches = void 0; + sysLog(`sysLog:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size}`); + const start = timestamp3(); + const invokeMap2 = /* @__PURE__ */ new Map(); + while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { + const result2 = cacheToUpdateChildWatches.entries().next(); + Debug.assert(!result2.done); + const { value: [dirPath, { dirName, options, fileNames }] } = result2; + cacheToUpdateChildWatches.delete(dirPath); + const hasChanges = updateChildWatches(dirName, dirPath, options); + invokeCallbacks(dirPath, invokeMap2, hasChanges ? void 0 : fileNames); + } + sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${timestamp3() - start}ms:: ${cacheToUpdateChildWatches.size}`); + callbackCache.forEach((callbacks, rootDirName) => { + const existing = invokeMap2.get(rootDirName); + if (existing) { + callbacks.forEach(({ callback, dirName }) => { + if (isArray3(existing)) { + existing.forEach(callback); + } else { + callback(dirName); + } + }); + } + }); + const elapsed = timestamp3() - start; + sysLog(`sysLog:: Elapsed:: ${elapsed}ms:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size} ${timerToUpdateChildWatches}`); + } + function removeChildWatches(parentWatcher) { + if (!parentWatcher) + return; + const existingChildWatches = parentWatcher.childWatches; + parentWatcher.childWatches = emptyArray; + for (const childWatcher of existingChildWatches) { + childWatcher.close(); + removeChildWatches(cache.get(toCanonicalFilePath(childWatcher.dirName))); + } + } + function updateChildWatches(parentDir, parentDirPath, options) { + const parentWatcher = cache.get(parentDirPath); + if (!parentWatcher) + return false; + let newChildWatches; + const hasChanges = enumerateInsertsAndDeletes( + fileSystemEntryExists( + parentDir, + 1 + /* Directory */ + ) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { + const childFullName = getNormalizedAbsolutePath(child, parentDir); + return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath2(childFullName))) === 0 ? childFullName : void 0; + }) : emptyArray, + parentWatcher.childWatches, + (child, childWatcher) => filePathComparer(child, childWatcher.dirName), + createAndAddChildDirectoryWatcher, + closeFileWatcher, + addChildDirectoryWatcher + ); + parentWatcher.childWatches = newChildWatches || emptyArray; + return hasChanges; + function createAndAddChildDirectoryWatcher(childName) { + const result2 = createDirectoryWatcher(childName, options); + addChildDirectoryWatcher(result2); + } + function addChildDirectoryWatcher(childWatcher) { + (newChildWatches || (newChildWatches = [])).push(childWatcher); + } + } + function isIgnoredPath(path2, options) { + return some2(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames2, getCurrentDirectory); + } + function isInPath(path2, searchPath) { + if (path2.includes(searchPath)) + return true; + if (useCaseSensitiveFileNames2) + return false; + return toCanonicalFilePath(path2).includes(searchPath); + } + } + function createFileWatcherCallback(callback) { + return (_fileName, eventKind, modifiedTime) => callback(eventKind === 1 ? "change" : "rename", "", modifiedTime); + } + function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime3) { + return (eventName, _relativeFileName, modifiedTime) => { + if (eventName === "rename") { + modifiedTime || (modifiedTime = getModifiedTime3(fileName) || missingFileModifiedTime); + callback(fileName, modifiedTime !== missingFileModifiedTime ? 0 : 2, modifiedTime); + } else { + callback(fileName, 1, modifiedTime); + } + }; + } + function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) { + return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory())); + } + function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) { + return (eventName, relativeFileName) => { + if (eventName === "rename") { + const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName)); + if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) { + callback(fileName); + } + } + }; + } + function createSystemWatchFunctions({ + pollingWatchFileWorker, + getModifiedTime: getModifiedTime3, + setTimeout: setTimeout2, + clearTimeout: clearTimeout2, + fsWatchWorker, + fileSystemEntryExists, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + getCurrentDirectory, + fsSupportsRecursiveFsWatch, + getAccessibleSortedChildDirectories, + realpath: realpath2, + tscWatchFile, + useNonPollingWatchers, + tscWatchDirectory, + inodeWatching, + fsWatchWithTimestamp, + sysLog: sysLog2 + }) { + const pollingWatches = /* @__PURE__ */ new Map(); + const fsWatches = /* @__PURE__ */ new Map(); + const fsWatchesRecursive = /* @__PURE__ */ new Map(); + let dynamicPollingWatchFile; + let fixedChunkSizePollingWatchFile; + let nonPollingWatchFile; + let hostRecursiveDirectoryWatcher; + let hitSystemWatcherLimit = false; + return { + watchFile: watchFile2, + watchDirectory + }; + function watchFile2(fileName, callback, pollingInterval, options) { + options = updateOptionsForWatchFile(options, useNonPollingWatchers); + const watchFileKind = Debug.checkDefined(options.watchFile); + switch (watchFileKind) { + case 0: + return pollingWatchFile( + fileName, + callback, + 250, + /*options*/ + void 0 + ); + case 1: + return pollingWatchFile( + fileName, + callback, + pollingInterval, + /*options*/ + void 0 + ); + case 2: + return ensureDynamicPollingWatchFile()( + fileName, + callback, + pollingInterval, + /*options*/ + void 0 + ); + case 3: + return ensureFixedChunkSizePollingWatchFile()( + fileName, + callback, + /* pollingInterval */ + void 0, + /*options*/ + void 0 + ); + case 4: + return fsWatch( + fileName, + 0, + createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime3), + /*recursive*/ + false, + pollingInterval, + getFallbackOptions(options) + ); + case 5: + if (!nonPollingWatchFile) { + nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2, getModifiedTime3, fsWatchWithTimestamp); + } + return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options)); + default: + Debug.assertNever(watchFileKind); + } + } + function ensureDynamicPollingWatchFile() { + return dynamicPollingWatchFile || (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime3, setTimeout: setTimeout2 })); + } + function ensureFixedChunkSizePollingWatchFile() { + return fixedChunkSizePollingWatchFile || (fixedChunkSizePollingWatchFile = createFixedChunkSizePollingWatchFile({ getModifiedTime: getModifiedTime3, setTimeout: setTimeout2 })); + } + function updateOptionsForWatchFile(options, useNonPollingWatchers2) { + if (options && options.watchFile !== void 0) + return options; + switch (tscWatchFile) { + case "PriorityPollingInterval": + return { + watchFile: 1 + /* PriorityPollingInterval */ + }; + case "DynamicPriorityPolling": + return { + watchFile: 2 + /* DynamicPriorityPolling */ + }; + case "UseFsEvents": + return generateWatchFileOptions(4, 1, options); + case "UseFsEventsWithFallbackDynamicPolling": + return generateWatchFileOptions(4, 2, options); + case "UseFsEventsOnParentDirectory": + useNonPollingWatchers2 = true; + default: + return useNonPollingWatchers2 ? ( + // Use notifications from FS to watch with falling back to fs.watchFile + generateWatchFileOptions(5, 1, options) + ) : ( + // Default to using fs events + { + watchFile: 4 + /* UseFsEvents */ + } + ); + } + } + function generateWatchFileOptions(watchFile3, fallbackPolling, options) { + const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; + return { + watchFile: watchFile3, + fallbackPolling: defaultFallbackPolling === void 0 ? fallbackPolling : defaultFallbackPolling + }; + } + function watchDirectory(directoryName, callback, recursive, options) { + if (fsSupportsRecursiveFsWatch) { + return fsWatch( + directoryName, + 1, + createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), + recursive, + 500, + getFallbackOptions(options) + ); + } + if (!hostRecursiveDirectoryWatcher) { + hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({ + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + getCurrentDirectory, + fileSystemEntryExists, + getAccessibleSortedChildDirectories, + watchDirectory: nonRecursiveWatchDirectory, + realpath: realpath2, + setTimeout: setTimeout2, + clearTimeout: clearTimeout2 + }); + } + return hostRecursiveDirectoryWatcher(directoryName, callback, recursive, options); + } + function nonRecursiveWatchDirectory(directoryName, callback, recursive, options) { + Debug.assert(!recursive); + const watchDirectoryOptions = updateOptionsForWatchDirectory(options); + const watchDirectoryKind = Debug.checkDefined(watchDirectoryOptions.watchDirectory); + switch (watchDirectoryKind) { + case 1: + return pollingWatchFile( + directoryName, + () => callback(directoryName), + 500, + /*options*/ + void 0 + ); + case 2: + return ensureDynamicPollingWatchFile()( + directoryName, + () => callback(directoryName), + 500, + /*options*/ + void 0 + ); + case 3: + return ensureFixedChunkSizePollingWatchFile()( + directoryName, + () => callback(directoryName), + /* pollingInterval */ + void 0, + /*options*/ + void 0 + ); + case 0: + return fsWatch( + directoryName, + 1, + createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory), + recursive, + 500, + getFallbackOptions(watchDirectoryOptions) + ); + default: + Debug.assertNever(watchDirectoryKind); + } + } + function updateOptionsForWatchDirectory(options) { + if (options && options.watchDirectory !== void 0) + return options; + switch (tscWatchDirectory) { + case "RecursiveDirectoryUsingFsWatchFile": + return { + watchDirectory: 1 + /* FixedPollingInterval */ + }; + case "RecursiveDirectoryUsingDynamicPriorityPolling": + return { + watchDirectory: 2 + /* DynamicPriorityPolling */ + }; + default: + const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; + return { + watchDirectory: 0, + fallbackPolling: defaultFallbackPolling !== void 0 ? defaultFallbackPolling : void 0 + }; + } + } + function pollingWatchFile(fileName, callback, pollingInterval, options) { + return createSingleWatcherPerName( + pollingWatches, + useCaseSensitiveFileNames2, + fileName, + callback, + (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options) + ); + } + function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { + return createSingleWatcherPerName( + recursive ? fsWatchesRecursive : fsWatches, + useCaseSensitiveFileNames2, + fileOrDirectory, + callback, + (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions) + ); + } + function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { + let lastDirectoryPartWithDirectorySeparator; + let lastDirectoryPart; + if (inodeWatching) { + lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(directorySeparator)); + lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(directorySeparator.length); + } + let watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry() : watchPresentFileSystemEntry(); + return { + close: () => { + if (watcher) { + watcher.close(); + watcher = void 0; + } + } + }; + function updateWatcher(createWatcher) { + if (watcher) { + sysLog2(`sysLog:: ${fileOrDirectory}:: Changing watcher to ${createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing"}FileSystemEntryWatcher`); + watcher.close(); + watcher = createWatcher(); + } + } + function watchPresentFileSystemEntry() { + if (hitSystemWatcherLimit) { + sysLog2(`sysLog:: ${fileOrDirectory}:: Defaulting to watchFile`); + return watchPresentFileSystemEntryWithFsWatchFile(); + } + try { + const presentWatcher = (entryKind === 1 || !fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)( + fileOrDirectory, + recursive, + inodeWatching ? callbackChangingToMissingFileSystemEntry : callback + ); + presentWatcher.on("error", () => { + callback("rename", ""); + updateWatcher(watchMissingFileSystemEntry); + }); + return presentWatcher; + } catch (e10) { + hitSystemWatcherLimit || (hitSystemWatcherLimit = e10.code === "ENOSPC"); + sysLog2(`sysLog:: ${fileOrDirectory}:: Changing to watchFile`); + return watchPresentFileSystemEntryWithFsWatchFile(); + } + } + function callbackChangingToMissingFileSystemEntry(event, relativeName) { + let originalRelativeName; + if (relativeName && endsWith2(relativeName, "~")) { + originalRelativeName = relativeName; + relativeName = relativeName.slice(0, relativeName.length - 1); + } + if (event === "rename" && (!relativeName || relativeName === lastDirectoryPart || endsWith2(relativeName, lastDirectoryPartWithDirectorySeparator))) { + const modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime; + if (originalRelativeName) + callback(event, originalRelativeName, modifiedTime); + callback(event, relativeName, modifiedTime); + if (inodeWatching) { + updateWatcher(modifiedTime === missingFileModifiedTime ? watchMissingFileSystemEntry : watchPresentFileSystemEntry); + } else if (modifiedTime === missingFileModifiedTime) { + updateWatcher(watchMissingFileSystemEntry); + } + } else { + if (originalRelativeName) + callback(event, originalRelativeName); + callback(event, relativeName); + } + } + function watchPresentFileSystemEntryWithFsWatchFile() { + return watchFile2( + fileOrDirectory, + createFileWatcherCallback(callback), + fallbackPollingInterval, + fallbackOptions + ); + } + function watchMissingFileSystemEntry() { + return watchFile2( + fileOrDirectory, + (_fileName, eventKind, modifiedTime) => { + if (eventKind === 0) { + modifiedTime || (modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime); + if (modifiedTime !== missingFileModifiedTime) { + callback("rename", "", modifiedTime); + updateWatcher(watchPresentFileSystemEntry); + } + } + }, + fallbackPollingInterval, + fallbackOptions + ); + } + } + function fsWatchWorkerHandlingTimestamp(fileOrDirectory, recursive, callback) { + let modifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime; + return fsWatchWorker(fileOrDirectory, recursive, (eventName, relativeFileName, currentModifiedTime) => { + if (eventName === "change") { + currentModifiedTime || (currentModifiedTime = getModifiedTime3(fileOrDirectory) || missingFileModifiedTime); + if (currentModifiedTime.getTime() === modifiedTime.getTime()) + return; + } + modifiedTime = currentModifiedTime || getModifiedTime3(fileOrDirectory) || missingFileModifiedTime; + callback(eventName, relativeFileName, modifiedTime); + }); + } + } + function patchWriteFileEnsuringDirectory(sys2) { + const originalWriteFile = sys2.writeFile; + sys2.writeFile = (path2, data, writeBom) => writeFileEnsuringDirectories( + path2, + data, + !!writeBom, + (path22, data2, writeByteOrderMark) => originalWriteFile.call(sys2, path22, data2, writeByteOrderMark), + (path22) => sys2.createDirectory(path22), + (path22) => sys2.directoryExists(path22) + ); + } + function setSys(s7) { + sys = s7; + } + var FileWatcherEventKind, PollingInterval, missingFileModifiedTime, defaultChunkLevels, pollingChunkSize, unchangedPollThresholds, ignoredPaths, curSysLog, FileSystemEntryKind, sys; + var init_sys = __esm2({ + "src/compiler/sys.ts"() { + "use strict"; + init_ts2(); + FileWatcherEventKind = /* @__PURE__ */ ((FileWatcherEventKind2) => { + FileWatcherEventKind2[FileWatcherEventKind2["Created"] = 0] = "Created"; + FileWatcherEventKind2[FileWatcherEventKind2["Changed"] = 1] = "Changed"; + FileWatcherEventKind2[FileWatcherEventKind2["Deleted"] = 2] = "Deleted"; + return FileWatcherEventKind2; + })(FileWatcherEventKind || {}); + PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { + PollingInterval3[PollingInterval3["High"] = 2e3] = "High"; + PollingInterval3[PollingInterval3["Medium"] = 500] = "Medium"; + PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; + return PollingInterval3; + })(PollingInterval || {}); + missingFileModifiedTime = /* @__PURE__ */ new Date(0); + defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; + pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); + unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); + ignoredPaths = ["/node_modules/.", "/.git", "/.#"]; + curSysLog = noop4; + FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => { + FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; + FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; + return FileSystemEntryKind2; + })(FileSystemEntryKind || {}); + sys = (() => { + const byteOrderMarkIndicator = "\uFEFF"; + function getNodeSystem() { + const nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/; + const _fs = (init_fs(), __toCommonJS(fs_exports)); + const _path = (init_path(), __toCommonJS(path_exports)); + const _os = (init_os(), __toCommonJS(os_exports)); + let _crypto; + try { + _crypto = (init_crypto(), __toCommonJS(crypto_exports)); + } catch { + _crypto = void 0; + } + let activeSession; + let profilePath = "./profile.cpuprofile"; + const Buffer22 = (init_buffer(), __toCommonJS(buffer_exports)).Buffer; + const isMacOs = process.platform === "darwin"; + const isLinuxOrMacOs = process.platform === "linux" || isMacOs; + const platform4 = _os.platform(); + const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive(); + const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; + const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; + const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs; + const getCurrentDirectory = memoize2(() => process.cwd()); + const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({ + pollingWatchFileWorker: fsWatchFileWorker, + getModifiedTime: getModifiedTime3, + setTimeout, + clearTimeout, + fsWatchWorker, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + getCurrentDirectory, + fileSystemEntryExists, + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) + fsSupportsRecursiveFsWatch, + getAccessibleSortedChildDirectories: (path2) => getAccessibleFileSystemEntries(path2).directories, + realpath: realpath2, + tscWatchFile: process.env.TSC_WATCHFILE, + useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER, + tscWatchDirectory: process.env.TSC_WATCHDIRECTORY, + inodeWatching: isLinuxOrMacOs, + fsWatchWithTimestamp: isMacOs, + sysLog + }); + const nodeSystem = { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + write(s7) { + process.stdout.write(s7); + }, + getWidthOfTerminal() { + return process.stdout.columns; + }, + writeOutputIsTTY() { + return process.stdout.isTTY; + }, + readFile: readFile2, + writeFile: writeFile22, + watchFile: watchFile2, + watchDirectory, + resolvePath: (path2) => _path.resolve(path2), + fileExists, + directoryExists, + getAccessibleFileSystemEntries, + createDirectory(directoryName) { + if (!nodeSystem.directoryExists(directoryName)) { + try { + _fs.mkdirSync(directoryName); + } catch (e10) { + if (e10.code !== "EEXIST") { + throw e10; + } + } + } + }, + getExecutingFilePath() { + return executingFilePath; + }, + getCurrentDirectory, + getDirectories, + getEnvironmentVariable(name2) { + return process.env[name2] || ""; + }, + readDirectory, + getModifiedTime: getModifiedTime3, + setModifiedTime, + deleteFile, + createHash: _crypto ? createSHA256Hash : generateDjb2Hash, + createSHA256Hash: _crypto ? createSHA256Hash : void 0, + getMemoryUsage() { + if (globalThis.gc) { + globalThis.gc(); + } + return process.memoryUsage().heapUsed; + }, + getFileSize(path2) { + try { + const stat2 = statSync2(path2); + if (stat2 == null ? void 0 : stat2.isFile()) { + return stat2.size; + } + } catch { + } + return 0; + }, + exit(exitCode) { + disableCPUProfiler(() => process.exit(exitCode)); + }, + enableCPUProfiler, + disableCPUProfiler, + cpuProfilingEnabled: () => !!activeSession || contains2(process.execArgv, "--cpu-prof") || contains2(process.execArgv, "--prof"), + realpath: realpath2, + debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some2(process.execArgv, (arg) => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)) || !!process.recordreplay, + tryEnableSourceMapsForHost() { + try { + require_source_map_support().install(); + } catch { + } + }, + setTimeout, + clearTimeout, + clearScreen: () => { + process.stdout.write("\x1Bc"); + }, + setBlocking: () => { + var _a2; + const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle; + if (handle && handle.setBlocking) { + handle.setBlocking(true); + } + }, + bufferFrom, + base64decode: (input) => bufferFrom(input, "base64").toString("utf8"), + base64encode: (input) => bufferFrom(input).toString("base64"), + require: (baseDir, moduleName3) => { + try { + const modulePath = resolveJSModule(moduleName3, baseDir, nodeSystem); + return { module: __require(modulePath), modulePath, error: void 0 }; + } catch (error22) { + return { module: void 0, modulePath: void 0, error: error22 }; + } + } + }; + return nodeSystem; + function statSync2(path2) { + return _fs.statSync(path2, { throwIfNoEntry: false }); + } + function enableCPUProfiler(path2, cb) { + if (activeSession) { + cb(); + return false; + } + const inspector = __require("inspector"); + if (!inspector || !inspector.Session) { + cb(); + return false; + } + const session = new inspector.Session(); + session.connect(); + session.post("Profiler.enable", () => { + session.post("Profiler.start", () => { + activeSession = session; + profilePath = path2; + cb(); + }); + }); + return true; + } + function cleanupPaths(profile2) { + let externalFileCounter = 0; + const remappedPaths = /* @__PURE__ */ new Map(); + const normalizedDir = normalizeSlashes(_path.dirname(executingFilePath)); + const fileUrlRoot = `file://${getRootLength(normalizedDir) === 1 ? "" : "/"}${normalizedDir}`; + for (const node of profile2.nodes) { + if (node.callFrame.url) { + const url = normalizeSlashes(node.callFrame.url); + if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) { + node.callFrame.url = getRelativePathToDirectoryOrUrl( + fileUrlRoot, + url, + fileUrlRoot, + createGetCanonicalFileName(useCaseSensitiveFileNames2), + /*isAbsolutePathAnUrl*/ + true + ); + } else if (!nativePattern.test(url)) { + node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, `external${externalFileCounter}.js`)).get(url); + externalFileCounter++; + } + } + } + return profile2; + } + function disableCPUProfiler(cb) { + if (activeSession && activeSession !== "stopping") { + const s7 = activeSession; + activeSession.post("Profiler.stop", (err, { profile: profile2 }) => { + var _a2; + if (!err) { + try { + if ((_a2 = statSync2(profilePath)) == null ? void 0 : _a2.isDirectory()) { + profilePath = _path.join(profilePath, `${(/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); + } + } catch { + } + try { + _fs.mkdirSync(_path.dirname(profilePath), { recursive: true }); + } catch { + } + _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile2))); + } + activeSession = void 0; + s7.disconnect(); + cb(); + }); + activeSession = "stopping"; + return true; + } else { + cb(); + return false; + } + } + function bufferFrom(input, encoding) { + return Buffer22.from && Buffer22.from !== Int8Array.from ? Buffer22.from(input, encoding) : new Buffer22(input, encoding); + } + function isFileSystemCaseSensitive() { + if (platform4 === "win32" || platform4 === "win64") { + return false; + } + return !fileExists(swapCase(__filename)); + } + function swapCase(s7) { + return s7.replace(/\w/g, (ch) => { + const up = ch.toUpperCase(); + return ch === up ? ch.toLowerCase() : up; + }); + } + function fsWatchFileWorker(fileName, callback, pollingInterval) { + _fs.watchFile(fileName, { persistent: true, interval: pollingInterval }, fileChanged); + let eventKind; + return { + close: () => _fs.unwatchFile(fileName, fileChanged) + }; + function fileChanged(curr, prev) { + const isPreviouslyDeleted = +prev.mtime === 0 || eventKind === 2; + if (+curr.mtime === 0) { + if (isPreviouslyDeleted) { + return; + } + eventKind = 2; + } else if (isPreviouslyDeleted) { + eventKind = 0; + } else if (+curr.mtime === +prev.mtime) { + return; + } else { + eventKind = 1; + } + callback(fileName, eventKind, curr.mtime); + } + } + function fsWatchWorker(fileOrDirectory, recursive, callback) { + return _fs.watch( + fileOrDirectory, + fsSupportsRecursiveFsWatch ? { persistent: true, recursive: !!recursive } : { persistent: true }, + callback + ); + } + function readFileWorker(fileName, _encoding) { + let buffer2; + try { + buffer2 = _fs.readFileSync(fileName); + } catch (e10) { + return void 0; + } + let len = buffer2.length; + if (len >= 2 && buffer2[0] === 254 && buffer2[1] === 255) { + len &= ~1; + for (let i7 = 0; i7 < len; i7 += 2) { + const temp = buffer2[i7]; + buffer2[i7] = buffer2[i7 + 1]; + buffer2[i7 + 1] = temp; + } + return buffer2.toString("utf16le", 2); + } + if (len >= 2 && buffer2[0] === 255 && buffer2[1] === 254) { + return buffer2.toString("utf16le", 2); + } + if (len >= 3 && buffer2[0] === 239 && buffer2[1] === 187 && buffer2[2] === 191) { + return buffer2.toString("utf8", 3); + } + return buffer2.toString("utf8"); + } + function readFile2(fileName, _encoding) { + var _a2, _b; + (_a2 = perfLogger) == null ? void 0 : _a2.logStartReadFile(fileName); + const file = readFileWorker(fileName, _encoding); + (_b = perfLogger) == null ? void 0 : _b.logStopReadFile(); + return file; + } + function writeFile22(fileName, data, writeByteOrderMark) { + var _a2; + (_a2 = perfLogger) == null ? void 0 : _a2.logEvent("WriteFile: " + fileName); + if (writeByteOrderMark) { + data = byteOrderMarkIndicator + data; + } + let fd; + try { + fd = _fs.openSync(fileName, "w"); + _fs.writeSync( + fd, + data, + /*position*/ + void 0, + "utf8" + ); + } finally { + if (fd !== void 0) { + _fs.closeSync(fd); + } + } + } + function getAccessibleFileSystemEntries(path2) { + var _a2; + (_a2 = perfLogger) == null ? void 0 : _a2.logEvent("ReadDir: " + (path2 || ".")); + try { + const entries = _fs.readdirSync(path2 || ".", { withFileTypes: true }); + const files = []; + const directories = []; + for (const dirent of entries) { + const entry = typeof dirent === "string" ? dirent : dirent.name; + if (entry === "." || entry === "..") { + continue; + } + let stat2; + if (typeof dirent === "string" || dirent.isSymbolicLink()) { + const name2 = combinePaths(path2, entry); + try { + stat2 = statSync2(name2); + if (!stat2) { + continue; + } + } catch (e10) { + continue; + } + } else { + stat2 = dirent; + } + if (stat2.isFile()) { + files.push(entry); + } else if (stat2.isDirectory()) { + directories.push(entry); + } + } + files.sort(); + directories.sort(); + return { files, directories }; + } catch (e10) { + return emptyFileSystemEntries; + } + } + function readDirectory(path2, extensions6, excludes, includes2, depth) { + return matchFiles(path2, extensions6, excludes, includes2, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath2); + } + function fileSystemEntryExists(path2, entryKind) { + const originalStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + try { + const stat2 = statSync2(path2); + if (!stat2) { + return false; + } + switch (entryKind) { + case 0: + return stat2.isFile(); + case 1: + return stat2.isDirectory(); + default: + return false; + } + } catch (e10) { + return false; + } finally { + Error.stackTraceLimit = originalStackTraceLimit; + } + } + function fileExists(path2) { + return fileSystemEntryExists( + path2, + 0 + /* File */ + ); + } + function directoryExists(path2) { + return fileSystemEntryExists( + path2, + 1 + /* Directory */ + ); + } + function getDirectories(path2) { + return getAccessibleFileSystemEntries(path2).directories.slice(); + } + function fsRealPathHandlingLongPath(path2) { + return path2.length < 260 ? _fs.realpathSync.native(path2) : _fs.realpathSync(path2); + } + function realpath2(path2) { + try { + return fsRealpath(path2); + } catch { + return path2; + } + } + function getModifiedTime3(path2) { + var _a2; + const originalStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = 0; + try { + return (_a2 = statSync2(path2)) == null ? void 0 : _a2.mtime; + } catch (e10) { + return void 0; + } finally { + Error.stackTraceLimit = originalStackTraceLimit; + } + } + function setModifiedTime(path2, time2) { + try { + _fs.utimesSync(path2, time2, time2); + } catch (e10) { + return; + } + } + function deleteFile(path2) { + try { + return _fs.unlinkSync(path2); + } catch (e10) { + return; + } + } + function createSHA256Hash(data) { + const hash = _crypto.createHash("sha256"); + hash.update(data); + return hash.digest("hex"); + } + } + let sys2; + if (isNodeLikeSystem()) { + sys2 = getNodeSystem(); + } + if (sys2) { + patchWriteFileEnsuringDirectory(sys2); + } + return sys2; + })(); + if (sys && sys.getEnvironmentVariable) { + setCustomPollingValues(sys); + Debug.setAssertionLevel( + /^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 : 0 + /* None */ + ); + } + if (sys && sys.debugMode) { + Debug.isDebugging = true; + } + } + }); + function isAnyDirectorySeparator(charCode) { + return charCode === 47 || charCode === 92; + } + function isUrl(path2) { + return getEncodedRootLength(path2) < 0; + } + function isRootedDiskPath(path2) { + return getEncodedRootLength(path2) > 0; + } + function isDiskPathRoot(path2) { + const rootLength = getEncodedRootLength(path2); + return rootLength > 0 && rootLength === path2.length; + } + function pathIsAbsolute(path2) { + return getEncodedRootLength(path2) !== 0; + } + function pathIsRelative(path2) { + return /^\.\.?($|[\\/])/.test(path2); + } + function pathIsBareSpecifier(path2) { + return !pathIsAbsolute(path2) && !pathIsRelative(path2); + } + function hasExtension(fileName) { + return getBaseFileName(fileName).includes("."); + } + function fileExtensionIs(path2, extension) { + return path2.length > extension.length && endsWith2(path2, extension); + } + function fileExtensionIsOneOf(path2, extensions6) { + for (const extension of extensions6) { + if (fileExtensionIs(path2, extension)) { + return true; + } + } + return false; + } + function hasTrailingDirectorySeparator(path2) { + return path2.length > 0 && isAnyDirectorySeparator(path2.charCodeAt(path2.length - 1)); + } + function isVolumeCharacter(charCode) { + return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90; + } + function getFileUrlVolumeSeparatorEnd(url, start) { + const ch0 = url.charCodeAt(start); + if (ch0 === 58) + return start + 1; + if (ch0 === 37 && url.charCodeAt(start + 1) === 51) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === 97 || ch2 === 65) + return start + 3; + } + return -1; + } + function getEncodedRootLength(path2) { + if (!path2) + return 0; + const ch0 = path2.charCodeAt(0); + if (ch0 === 47 || ch0 === 92) { + if (path2.charCodeAt(1) !== ch0) + return 1; + const p1 = path2.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2); + if (p1 < 0) + return path2.length; + return p1 + 1; + } + if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58) { + const ch2 = path2.charCodeAt(2); + if (ch2 === 47 || ch2 === 92) + return 3; + if (path2.length === 2) + return 2; + } + const schemeEnd = path2.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path2.indexOf(directorySeparator, authorityStart); + if (authorityEnd !== -1) { + const scheme = path2.slice(0, schemeEnd); + const authority = path2.slice(authorityStart, authorityEnd); + if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path2.charCodeAt(volumeSeparatorEnd) === 47) { + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path2.length) { + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); + } + return ~path2.length; + } + return 0; + } + function getRootLength(path2) { + const rootLength = getEncodedRootLength(path2); + return rootLength < 0 ? ~rootLength : rootLength; + } + function getDirectoryPath(path2) { + path2 = normalizeSlashes(path2); + const rootLength = getRootLength(path2); + if (rootLength === path2.length) + return path2; + path2 = removeTrailingDirectorySeparator(path2); + return path2.slice(0, Math.max(rootLength, path2.lastIndexOf(directorySeparator))); + } + function getBaseFileName(path2, extensions6, ignoreCase) { + path2 = normalizeSlashes(path2); + const rootLength = getRootLength(path2); + if (rootLength === path2.length) + return ""; + path2 = removeTrailingDirectorySeparator(path2); + const name2 = path2.slice(Math.max(getRootLength(path2), path2.lastIndexOf(directorySeparator) + 1)); + const extension = extensions6 !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name2, extensions6, ignoreCase) : void 0; + return extension ? name2.slice(0, name2.length - extension.length) : name2; + } + function tryGetExtensionFromPath(path2, extension, stringEqualityComparer) { + if (!startsWith2(extension, ".")) + extension = "." + extension; + if (path2.length >= extension.length && path2.charCodeAt(path2.length - extension.length) === 46) { + const pathExtension = path2.slice(path2.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } + } + } + function getAnyExtensionFromPathWorker(path2, extensions6, stringEqualityComparer) { + if (typeof extensions6 === "string") { + return tryGetExtensionFromPath(path2, extensions6, stringEqualityComparer) || ""; + } + for (const extension of extensions6) { + const result2 = tryGetExtensionFromPath(path2, extension, stringEqualityComparer); + if (result2) + return result2; + } + return ""; + } + function getAnyExtensionFromPath(path2, extensions6, ignoreCase) { + if (extensions6) { + return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path2), extensions6, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive); + } + const baseFileName = getBaseFileName(path2); + const extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex); + } + return ""; + } + function pathComponents(path2, rootLength) { + const root2 = path2.substring(0, rootLength); + const rest2 = path2.substring(rootLength).split(directorySeparator); + if (rest2.length && !lastOrUndefined(rest2)) + rest2.pop(); + return [root2, ...rest2]; + } + function getPathComponents(path2, currentDirectory = "") { + path2 = combinePaths(currentDirectory, path2); + return pathComponents(path2, getRootLength(path2)); + } + function getPathFromPathComponents(pathComponents2, length2) { + if (pathComponents2.length === 0) + return ""; + const root2 = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]); + return root2 + pathComponents2.slice(1, length2).join(directorySeparator); + } + function normalizeSlashes(path2) { + return path2.includes("\\") ? path2.replace(backslashRegExp, directorySeparator) : path2; + } + function reducePathComponents(components) { + if (!some2(components)) + return []; + const reduced = [components[0]]; + for (let i7 = 1; i7 < components.length; i7++) { + const component = components[i7]; + if (!component) + continue; + if (component === ".") + continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) + continue; + } + reduced.push(component); + } + return reduced; + } + function combinePaths(path2, ...paths) { + if (path2) + path2 = normalizeSlashes(path2); + for (let relativePath2 of paths) { + if (!relativePath2) + continue; + relativePath2 = normalizeSlashes(relativePath2); + if (!path2 || getRootLength(relativePath2) !== 0) { + path2 = relativePath2; + } else { + path2 = ensureTrailingDirectorySeparator(path2) + relativePath2; + } + } + return path2; + } + function resolvePath(path2, ...paths) { + return normalizePath(some2(paths) ? combinePaths(path2, ...paths) : normalizeSlashes(path2)); + } + function getNormalizedPathComponents(path2, currentDirectory) { + return reducePathComponents(getPathComponents(path2, currentDirectory)); + } + function getNormalizedAbsolutePath(fileName, currentDirectory) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); + } + function normalizePath(path2) { + path2 = normalizeSlashes(path2); + if (!relativePathSegmentRegExp.test(path2)) { + return path2; + } + const simplified = path2.replace(/\/\.\//g, "/").replace(/^\.\//, ""); + if (simplified !== path2) { + path2 = simplified; + if (!relativePathSegmentRegExp.test(path2)) { + return path2; + } + } + const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path2))); + return normalized && hasTrailingDirectorySeparator(path2) ? ensureTrailingDirectorySeparator(normalized) : normalized; + } + function getPathWithoutRoot(pathComponents2) { + if (pathComponents2.length === 0) + return ""; + return pathComponents2.slice(1).join(directorySeparator); + } + function getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); + } + function toPath2(fileName, basePath, getCanonicalFileName) { + const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath); + return getCanonicalFileName(nonCanonicalizedPath); + } + function removeTrailingDirectorySeparator(path2) { + if (hasTrailingDirectorySeparator(path2)) { + return path2.substr(0, path2.length - 1); + } + return path2; + } + function ensureTrailingDirectorySeparator(path2) { + if (!hasTrailingDirectorySeparator(path2)) { + return path2 + directorySeparator; + } + return path2; + } + function ensurePathIsNonModuleName(path2) { + return !pathIsAbsolute(path2) && !pathIsRelative(path2) ? "./" + path2 : path2; + } + function changeAnyExtension(path2, ext, extensions6, ignoreCase) { + const pathext = extensions6 !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path2, extensions6, ignoreCase) : getAnyExtensionFromPath(path2); + return pathext ? path2.slice(0, path2.length - pathext.length) + (startsWith2(ext, ".") ? ext : "." + ext) : path2; + } + function changeFullExtension(path2, newExtension) { + const declarationExtension = getDeclarationFileExtension(path2); + if (declarationExtension) { + return path2.slice(0, path2.length - declarationExtension.length) + (startsWith2(newExtension, ".") ? newExtension : "." + newExtension); + } + return changeAnyExtension(path2, newExtension); + } + function comparePathsWorker(a7, b8, componentComparer) { + if (a7 === b8) + return 0; + if (a7 === void 0) + return -1; + if (b8 === void 0) + return 1; + const aRoot = a7.substring(0, getRootLength(a7)); + const bRoot = b8.substring(0, getRootLength(b8)); + const result2 = compareStringsCaseInsensitive(aRoot, bRoot); + if (result2 !== 0) { + return result2; + } + const aRest = a7.substring(aRoot.length); + const bRest = b8.substring(bRoot.length); + if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { + return componentComparer(aRest, bRest); + } + const aComponents = reducePathComponents(getPathComponents(a7)); + const bComponents = reducePathComponents(getPathComponents(b8)); + const sharedLength = Math.min(aComponents.length, bComponents.length); + for (let i7 = 1; i7 < sharedLength; i7++) { + const result22 = componentComparer(aComponents[i7], bComponents[i7]); + if (result22 !== 0) { + return result22; + } + } + return compareValues(aComponents.length, bComponents.length); + } + function comparePathsCaseSensitive(a7, b8) { + return comparePathsWorker(a7, b8, compareStringsCaseSensitive); + } + function comparePathsCaseInsensitive(a7, b8) { + return comparePathsWorker(a7, b8, compareStringsCaseInsensitive); + } + function comparePaths(a7, b8, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + a7 = combinePaths(currentDirectory, a7); + b8 = combinePaths(currentDirectory, b8); + } else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + return comparePathsWorker(a7, b8, getStringComparer(ignoreCase)); + } + function containsPath(parent22, child, currentDirectory, ignoreCase) { + if (typeof currentDirectory === "string") { + parent22 = combinePaths(currentDirectory, parent22); + child = combinePaths(currentDirectory, child); + } else if (typeof currentDirectory === "boolean") { + ignoreCase = currentDirectory; + } + if (parent22 === void 0 || child === void 0) + return false; + if (parent22 === child) + return true; + const parentComponents = reducePathComponents(getPathComponents(parent22)); + const childComponents = reducePathComponents(getPathComponents(child)); + if (childComponents.length < parentComponents.length) { + return false; + } + const componentEqualityComparer = ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive; + for (let i7 = 0; i7 < parentComponents.length; i7++) { + const equalityComparer = i7 === 0 ? equateStringsCaseInsensitive : componentEqualityComparer; + if (!equalityComparer(parentComponents[i7], childComponents[i7])) { + return false; + } + } + return true; + } + function startsWithDirectory(fileName, directoryName, getCanonicalFileName) { + const canonicalFileName = getCanonicalFileName(fileName); + const canonicalDirectoryName = getCanonicalFileName(directoryName); + return startsWith2(canonicalFileName, canonicalDirectoryName + "/") || startsWith2(canonicalFileName, canonicalDirectoryName + "\\"); + } + function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { + const fromComponents = reducePathComponents(getPathComponents(from)); + const toComponents = reducePathComponents(getPathComponents(to)); + let start; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + const fromComponent = getCanonicalFileName(fromComponents[start]); + const toComponent = getCanonicalFileName(toComponents[start]); + const comparer = start === 0 ? equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) + break; + } + if (start === 0) { + return toComponents; + } + const components = toComponents.slice(start); + const relative2 = []; + for (; start < fromComponents.length; start++) { + relative2.push(".."); + } + return ["", ...relative2, ...components]; + } + function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { + Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative"); + const getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : identity2; + const ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; + const pathComponents2 = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive, getCanonicalFileName); + return getPathFromPathComponents(pathComponents2); + } + function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) { + return !isRootedDiskPath(absoluteOrRelativePath) ? absoluteOrRelativePath : getRelativePathToDirectoryOrUrl( + basePath, + absoluteOrRelativePath, + basePath, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + } + function getRelativePathFromFile(from, to, getCanonicalFileName) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(getDirectoryPath(from), to, getCanonicalFileName)); + } + function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { + const pathComponents2 = getPathComponentsRelativeTo( + resolvePath(currentDirectory, directoryPathOrUrl), + resolvePath(currentDirectory, relativeOrAbsolutePath), + equateStringsCaseSensitive, + getCanonicalFileName + ); + const firstComponent = pathComponents2[0]; + if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { + const prefix = firstComponent.charAt(0) === directorySeparator ? "file://" : "file:///"; + pathComponents2[0] = prefix + firstComponent; + } + return getPathFromPathComponents(pathComponents2); + } + function forEachAncestorDirectory(directory, callback) { + while (true) { + const result2 = callback(directory); + if (result2 !== void 0) { + return result2; + } + const parentPath = getDirectoryPath(directory); + if (parentPath === directory) { + return void 0; + } + directory = parentPath; + } + } + function isNodeModulesDirectory(dirPath) { + return endsWith2(dirPath, "/node_modules"); + } + var directorySeparator, altDirectorySeparator, urlSchemeSeparator, backslashRegExp, relativePathSegmentRegExp; + var init_path2 = __esm2({ + "src/compiler/path.ts"() { + "use strict"; + init_ts2(); + directorySeparator = "/"; + altDirectorySeparator = "\\"; + urlSchemeSeparator = "://"; + backslashRegExp = /\\/g; + relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/; + } + }); + function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) { + return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated }; + } + var Diagnostics; + var init_diagnosticInformationMap_generated = __esm2({ + "src/compiler/diagnosticInformationMap.generated.ts"() { + "use strict"; + init_types(); + Diagnostics = { + Unterminated_string_literal: diag(1002, 1, "Unterminated_string_literal_1002", "Unterminated string literal."), + Identifier_expected: diag(1003, 1, "Identifier_expected_1003", "Identifier expected."), + _0_expected: diag(1005, 1, "_0_expected_1005", "'{0}' expected."), + A_file_cannot_have_a_reference_to_itself: diag(1006, 1, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."), + The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."), + Trailing_comma_not_allowed: diag(1009, 1, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."), + Asterisk_Slash_expected: diag(1010, 1, "Asterisk_Slash_expected_1010", "'*/' expected."), + An_element_access_expression_should_take_an_argument: diag(1011, 1, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."), + Unexpected_token: diag(1012, 1, "Unexpected_token_1012", "Unexpected token."), + A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: diag(1013, 1, "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013", "A rest parameter or binding pattern may not have a trailing comma."), + A_rest_parameter_must_be_last_in_a_parameter_list: diag(1014, 1, "A_rest_parameter_must_be_last_in_a_parameter_list_1014", "A rest parameter must be last in a parameter list."), + Parameter_cannot_have_question_mark_and_initializer: diag(1015, 1, "Parameter_cannot_have_question_mark_and_initializer_1015", "Parameter cannot have question mark and initializer."), + A_required_parameter_cannot_follow_an_optional_parameter: diag(1016, 1, "A_required_parameter_cannot_follow_an_optional_parameter_1016", "A required parameter cannot follow an optional parameter."), + An_index_signature_cannot_have_a_rest_parameter: diag(1017, 1, "An_index_signature_cannot_have_a_rest_parameter_1017", "An index signature cannot have a rest parameter."), + An_index_signature_parameter_cannot_have_an_accessibility_modifier: diag(1018, 1, "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018", "An index signature parameter cannot have an accessibility modifier."), + An_index_signature_parameter_cannot_have_a_question_mark: diag(1019, 1, "An_index_signature_parameter_cannot_have_a_question_mark_1019", "An index signature parameter cannot have a question mark."), + An_index_signature_parameter_cannot_have_an_initializer: diag(1020, 1, "An_index_signature_parameter_cannot_have_an_initializer_1020", "An index signature parameter cannot have an initializer."), + An_index_signature_must_have_a_type_annotation: diag(1021, 1, "An_index_signature_must_have_a_type_annotation_1021", "An index signature must have a type annotation."), + An_index_signature_parameter_must_have_a_type_annotation: diag(1022, 1, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."), + readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, 1, "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024", "'readonly' modifier can only appear on a property declaration or index signature."), + An_index_signature_cannot_have_a_trailing_comma: diag(1025, 1, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."), + Accessibility_modifier_already_seen: diag(1028, 1, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), + _0_modifier_must_precede_1_modifier: diag(1029, 1, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), + _0_modifier_already_seen: diag(1030, 1, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), + _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, 1, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), + super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, 1, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), + Only_ambient_modules_can_use_quoted_names: diag(1035, 1, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), + Statements_are_not_allowed_in_ambient_contexts: diag(1036, 1, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), + A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, 1, "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038", "A 'declare' modifier cannot be used in an already ambient context."), + Initializers_are_not_allowed_in_ambient_contexts: diag(1039, 1, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."), + _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, 1, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."), + _0_modifier_cannot_be_used_here: diag(1042, 1, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."), + _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, 1, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."), + Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, 1, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."), + A_rest_parameter_cannot_be_optional: diag(1047, 1, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."), + A_rest_parameter_cannot_have_an_initializer: diag(1048, 1, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."), + A_set_accessor_must_have_exactly_one_parameter: diag(1049, 1, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."), + A_set_accessor_cannot_have_an_optional_parameter: diag(1051, 1, "A_set_accessor_cannot_have_an_optional_parameter_1051", "A 'set' accessor cannot have an optional parameter."), + A_set_accessor_parameter_cannot_have_an_initializer: diag(1052, 1, "A_set_accessor_parameter_cannot_have_an_initializer_1052", "A 'set' accessor parameter cannot have an initializer."), + A_set_accessor_cannot_have_rest_parameter: diag(1053, 1, "A_set_accessor_cannot_have_rest_parameter_1053", "A 'set' accessor cannot have rest parameter."), + A_get_accessor_cannot_have_parameters: diag(1054, 1, "A_get_accessor_cannot_have_parameters_1054", "A 'get' accessor cannot have parameters."), + Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, 1, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."), + Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, 1, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."), + The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, 1, "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", "The return type of an async function must either be a valid promise or must not contain a callable 'then' member."), + A_promise_must_have_a_then_method: diag(1059, 1, "A_promise_must_have_a_then_method_1059", "A promise must have a 'then' method."), + The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: diag(1060, 1, "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", "The first parameter of the 'then' method of a promise must be a callback."), + Enum_member_must_have_initializer: diag(1061, 1, "Enum_member_must_have_initializer_1061", "Enum member must have initializer."), + Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, 1, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."), + An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, 1, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."), + The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, 1, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise type. Did you mean to write 'Promise<{0}>'?"), + The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: diag(1065, 1, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1065", "The return type of an async function or method must be the global Promise type."), + In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, 1, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."), + Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, 1, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."), + Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, 1, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."), + _0_modifier_cannot_appear_on_a_type_member: diag(1070, 1, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."), + _0_modifier_cannot_appear_on_an_index_signature: diag(1071, 1, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."), + A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, 1, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."), + Invalid_reference_directive_syntax: diag(1084, 1, "Invalid_reference_directive_syntax_1084", "Invalid 'reference' directive syntax."), + _0_modifier_cannot_appear_on_a_constructor_declaration: diag(1089, 1, "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", "'{0}' modifier cannot appear on a constructor declaration."), + _0_modifier_cannot_appear_on_a_parameter: diag(1090, 1, "_0_modifier_cannot_appear_on_a_parameter_1090", "'{0}' modifier cannot appear on a parameter."), + Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: diag(1091, 1, "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091", "Only a single variable declaration is allowed in a 'for...in' statement."), + Type_parameters_cannot_appear_on_a_constructor_declaration: diag(1092, 1, "Type_parameters_cannot_appear_on_a_constructor_declaration_1092", "Type parameters cannot appear on a constructor declaration."), + Type_annotation_cannot_appear_on_a_constructor_declaration: diag(1093, 1, "Type_annotation_cannot_appear_on_a_constructor_declaration_1093", "Type annotation cannot appear on a constructor declaration."), + An_accessor_cannot_have_type_parameters: diag(1094, 1, "An_accessor_cannot_have_type_parameters_1094", "An accessor cannot have type parameters."), + A_set_accessor_cannot_have_a_return_type_annotation: diag(1095, 1, "A_set_accessor_cannot_have_a_return_type_annotation_1095", "A 'set' accessor cannot have a return type annotation."), + An_index_signature_must_have_exactly_one_parameter: diag(1096, 1, "An_index_signature_must_have_exactly_one_parameter_1096", "An index signature must have exactly one parameter."), + _0_list_cannot_be_empty: diag(1097, 1, "_0_list_cannot_be_empty_1097", "'{0}' list cannot be empty."), + Type_parameter_list_cannot_be_empty: diag(1098, 1, "Type_parameter_list_cannot_be_empty_1098", "Type parameter list cannot be empty."), + Type_argument_list_cannot_be_empty: diag(1099, 1, "Type_argument_list_cannot_be_empty_1099", "Type argument list cannot be empty."), + Invalid_use_of_0_in_strict_mode: diag(1100, 1, "Invalid_use_of_0_in_strict_mode_1100", "Invalid use of '{0}' in strict mode."), + with_statements_are_not_allowed_in_strict_mode: diag(1101, 1, "with_statements_are_not_allowed_in_strict_mode_1101", "'with' statements are not allowed in strict mode."), + delete_cannot_be_called_on_an_identifier_in_strict_mode: diag(1102, 1, "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", "'delete' cannot be called on an identifier in strict mode."), + for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, 1, "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103", "'for await' loops are only allowed within async functions and at the top levels of modules."), + A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: diag(1104, 1, "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", "A 'continue' statement can only be used within an enclosing iteration statement."), + A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: diag(1105, 1, "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", "A 'break' statement can only be used within an enclosing iteration or switch statement."), + The_left_hand_side_of_a_for_of_statement_may_not_be_async: diag(1106, 1, "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106", "The left-hand side of a 'for...of' statement may not be 'async'."), + Jump_target_cannot_cross_function_boundary: diag(1107, 1, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."), + A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."), + Expression_expected: diag(1109, 1, "Expression_expected_1109", "Expression expected."), + Type_expected: diag(1110, 1, "Type_expected_1110", "Type expected."), + Private_field_0_must_be_declared_in_an_enclosing_class: diag(1111, 1, "Private_field_0_must_be_declared_in_an_enclosing_class_1111", "Private field '{0}' must be declared in an enclosing class."), + A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."), + Duplicate_label_0: diag(1114, 1, "Duplicate_label_0_1114", "Duplicate label '{0}'."), + A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."), + A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, 1, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."), + An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, 1, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."), + An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, 1, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."), + An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, 1, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."), + An_export_assignment_cannot_have_modifiers: diag(1120, 1, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."), + Octal_literals_are_not_allowed_Use_the_syntax_0: diag(1121, 1, "Octal_literals_are_not_allowed_Use_the_syntax_0_1121", "Octal literals are not allowed. Use the syntax '{0}'."), + Variable_declaration_list_cannot_be_empty: diag(1123, 1, "Variable_declaration_list_cannot_be_empty_1123", "Variable declaration list cannot be empty."), + Digit_expected: diag(1124, 1, "Digit_expected_1124", "Digit expected."), + Hexadecimal_digit_expected: diag(1125, 1, "Hexadecimal_digit_expected_1125", "Hexadecimal digit expected."), + Unexpected_end_of_text: diag(1126, 1, "Unexpected_end_of_text_1126", "Unexpected end of text."), + Invalid_character: diag(1127, 1, "Invalid_character_1127", "Invalid character."), + Declaration_or_statement_expected: diag(1128, 1, "Declaration_or_statement_expected_1128", "Declaration or statement expected."), + Statement_expected: diag(1129, 1, "Statement_expected_1129", "Statement expected."), + case_or_default_expected: diag(1130, 1, "case_or_default_expected_1130", "'case' or 'default' expected."), + Property_or_signature_expected: diag(1131, 1, "Property_or_signature_expected_1131", "Property or signature expected."), + Enum_member_expected: diag(1132, 1, "Enum_member_expected_1132", "Enum member expected."), + Variable_declaration_expected: diag(1134, 1, "Variable_declaration_expected_1134", "Variable declaration expected."), + Argument_expression_expected: diag(1135, 1, "Argument_expression_expected_1135", "Argument expression expected."), + Property_assignment_expected: diag(1136, 1, "Property_assignment_expected_1136", "Property assignment expected."), + Expression_or_comma_expected: diag(1137, 1, "Expression_or_comma_expected_1137", "Expression or comma expected."), + Parameter_declaration_expected: diag(1138, 1, "Parameter_declaration_expected_1138", "Parameter declaration expected."), + Type_parameter_declaration_expected: diag(1139, 1, "Type_parameter_declaration_expected_1139", "Type parameter declaration expected."), + Type_argument_expected: diag(1140, 1, "Type_argument_expected_1140", "Type argument expected."), + String_literal_expected: diag(1141, 1, "String_literal_expected_1141", "String literal expected."), + Line_break_not_permitted_here: diag(1142, 1, "Line_break_not_permitted_here_1142", "Line break not permitted here."), + or_expected: diag(1144, 1, "or_expected_1144", "'{' or ';' expected."), + or_JSX_element_expected: diag(1145, 1, "or_JSX_element_expected_1145", "'{' or JSX element expected."), + Declaration_expected: diag(1146, 1, "Declaration_expected_1146", "Declaration expected."), + Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, 1, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."), + Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, 1, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."), + File_name_0_differs_from_already_included_file_name_1_only_in_casing: diag(1149, 1, "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", "File name '{0}' differs from already included file name '{1}' only in casing."), + _0_declarations_must_be_initialized: diag(1155, 1, "_0_declarations_must_be_initialized_1155", "'{0}' declarations must be initialized."), + _0_declarations_can_only_be_declared_inside_a_block: diag(1156, 1, "_0_declarations_can_only_be_declared_inside_a_block_1156", "'{0}' declarations can only be declared inside a block."), + Unterminated_template_literal: diag(1160, 1, "Unterminated_template_literal_1160", "Unterminated template literal."), + Unterminated_regular_expression_literal: diag(1161, 1, "Unterminated_regular_expression_literal_1161", "Unterminated regular expression literal."), + An_object_member_cannot_be_declared_optional: diag(1162, 1, "An_object_member_cannot_be_declared_optional_1162", "An object member cannot be declared optional."), + A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, 1, "A_yield_expression_is_only_allowed_in_a_generator_body_1163", "A 'yield' expression is only allowed in a generator body."), + Computed_property_names_are_not_allowed_in_enums: diag(1164, 1, "Computed_property_names_are_not_allowed_in_enums_1164", "Computed property names are not allowed in enums."), + A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1165, 1, "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165", "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type: diag(1166, 1, "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166", "A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1168, 1, "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168", "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1169, 1, "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169", "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1170, 1, "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170", "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."), + A_comma_expression_is_not_allowed_in_a_computed_property_name: diag(1171, 1, "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171", "A comma expression is not allowed in a computed property name."), + extends_clause_already_seen: diag(1172, 1, "extends_clause_already_seen_1172", "'extends' clause already seen."), + extends_clause_must_precede_implements_clause: diag(1173, 1, "extends_clause_must_precede_implements_clause_1173", "'extends' clause must precede 'implements' clause."), + Classes_can_only_extend_a_single_class: diag(1174, 1, "Classes_can_only_extend_a_single_class_1174", "Classes can only extend a single class."), + implements_clause_already_seen: diag(1175, 1, "implements_clause_already_seen_1175", "'implements' clause already seen."), + Interface_declaration_cannot_have_implements_clause: diag(1176, 1, "Interface_declaration_cannot_have_implements_clause_1176", "Interface declaration cannot have 'implements' clause."), + Binary_digit_expected: diag(1177, 1, "Binary_digit_expected_1177", "Binary digit expected."), + Octal_digit_expected: diag(1178, 1, "Octal_digit_expected_1178", "Octal digit expected."), + Unexpected_token_expected: diag(1179, 1, "Unexpected_token_expected_1179", "Unexpected token. '{' expected."), + Property_destructuring_pattern_expected: diag(1180, 1, "Property_destructuring_pattern_expected_1180", "Property destructuring pattern expected."), + Array_element_destructuring_pattern_expected: diag(1181, 1, "Array_element_destructuring_pattern_expected_1181", "Array element destructuring pattern expected."), + A_destructuring_declaration_must_have_an_initializer: diag(1182, 1, "A_destructuring_declaration_must_have_an_initializer_1182", "A destructuring declaration must have an initializer."), + An_implementation_cannot_be_declared_in_ambient_contexts: diag(1183, 1, "An_implementation_cannot_be_declared_in_ambient_contexts_1183", "An implementation cannot be declared in ambient contexts."), + Modifiers_cannot_appear_here: diag(1184, 1, "Modifiers_cannot_appear_here_1184", "Modifiers cannot appear here."), + Merge_conflict_marker_encountered: diag(1185, 1, "Merge_conflict_marker_encountered_1185", "Merge conflict marker encountered."), + A_rest_element_cannot_have_an_initializer: diag(1186, 1, "A_rest_element_cannot_have_an_initializer_1186", "A rest element cannot have an initializer."), + A_parameter_property_may_not_be_declared_using_a_binding_pattern: diag(1187, 1, "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187", "A parameter property may not be declared using a binding pattern."), + Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: diag(1188, 1, "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188", "Only a single variable declaration is allowed in a 'for...of' statement."), + The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: diag(1189, 1, "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189", "The variable declaration of a 'for...in' statement cannot have an initializer."), + The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: diag(1190, 1, "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190", "The variable declaration of a 'for...of' statement cannot have an initializer."), + An_import_declaration_cannot_have_modifiers: diag(1191, 1, "An_import_declaration_cannot_have_modifiers_1191", "An import declaration cannot have modifiers."), + Module_0_has_no_default_export: diag(1192, 1, "Module_0_has_no_default_export_1192", "Module '{0}' has no default export."), + An_export_declaration_cannot_have_modifiers: diag(1193, 1, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."), + Export_declarations_are_not_permitted_in_a_namespace: diag(1194, 1, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."), + export_Asterisk_does_not_re_export_a_default: diag(1195, 1, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."), + Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, 1, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."), + Catch_clause_variable_cannot_have_an_initializer: diag(1197, 1, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."), + An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, 1, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."), + Unterminated_Unicode_escape_sequence: diag(1199, 1, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."), + Line_terminator_not_permitted_before_arrow: diag(1200, 1, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), + Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), + Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), + Re_exporting_a_type_when_0_is_enabled_requires_using_export_type: diag(1205, 1, "Re_exporting_a_type_when_0_is_enabled_requires_using_export_type_1205", "Re-exporting a type when '{0}' is enabled requires using 'export type'."), + Decorators_are_not_valid_here: diag(1206, 1, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), + Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), + Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), + Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), + A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."), + Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: diag(1214, 1, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."), + Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), + Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), + Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), + Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), + An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), + _0_tag_already_specified: diag(1223, 1, "_0_tag_already_specified_1223", "'{0}' tag already specified."), + Signature_0_must_be_a_type_predicate: diag(1224, 1, "Signature_0_must_be_a_type_predicate_1224", "Signature '{0}' must be a type predicate."), + Cannot_find_parameter_0: diag(1225, 1, "Cannot_find_parameter_0_1225", "Cannot find parameter '{0}'."), + Type_predicate_0_is_not_assignable_to_1: diag(1226, 1, "Type_predicate_0_is_not_assignable_to_1_1226", "Type predicate '{0}' is not assignable to '{1}'."), + Parameter_0_is_not_in_the_same_position_as_parameter_1: diag(1227, 1, "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", "Parameter '{0}' is not in the same position as parameter '{1}'."), + A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, 1, "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", "A type predicate is only allowed in return type position for functions and methods."), + A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, 1, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."), + A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, 1, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."), + An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, 1, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."), + An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, 1, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."), + An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, 1, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."), + An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, 1, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."), + A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, 1, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."), + The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, 1, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."), + The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, 1, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."), + Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, 1, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."), + Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: diag(1239, 1, "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239", "Unable to resolve signature of parameter decorator when called as an expression."), + Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: diag(1240, 1, "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240", "Unable to resolve signature of property decorator when called as an expression."), + Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: diag(1241, 1, "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241", "Unable to resolve signature of method decorator when called as an expression."), + abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: diag(1242, 1, "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242", "'abstract' modifier can only appear on a class, method, or property declaration."), + _0_modifier_cannot_be_used_with_1_modifier: diag(1243, 1, "_0_modifier_cannot_be_used_with_1_modifier_1243", "'{0}' modifier cannot be used with '{1}' modifier."), + Abstract_methods_can_only_appear_within_an_abstract_class: diag(1244, 1, "Abstract_methods_can_only_appear_within_an_abstract_class_1244", "Abstract methods can only appear within an abstract class."), + Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: diag(1245, 1, "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", "Method '{0}' cannot have an implementation because it is marked abstract."), + An_interface_property_cannot_have_an_initializer: diag(1246, 1, "An_interface_property_cannot_have_an_initializer_1246", "An interface property cannot have an initializer."), + A_type_literal_property_cannot_have_an_initializer: diag(1247, 1, "A_type_literal_property_cannot_have_an_initializer_1247", "A type literal property cannot have an initializer."), + A_class_member_cannot_have_the_0_keyword: diag(1248, 1, "A_class_member_cannot_have_the_0_keyword_1248", "A class member cannot have the '{0}' keyword."), + A_decorator_can_only_decorate_a_method_implementation_not_an_overload: diag(1249, 1, "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", "A decorator can only decorate a method implementation, not an overload."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."), + Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."), + Abstract_properties_can_only_appear_within_an_abstract_class: diag(1253, 1, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."), + A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."), + A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), + A_required_element_cannot_follow_an_optional_element: diag(1257, 1, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), + A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1258, 1, "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258", "A default export must be at the top level of a file or module declaration."), + Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), + Keywords_cannot_contain_escape_characters: diag(1260, 1, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), + Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), + Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), + Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), + Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), + A_rest_element_cannot_follow_another_rest_element: diag(1265, 1, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."), + An_optional_element_cannot_follow_a_rest_element: diag(1266, 1, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), + Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), + An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), + Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled: diag(1269, 1, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled_1269", "Cannot use 'export import' on a type or type-only namespace when '{0}' is enabled."), + Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), + Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), + A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), + _0_modifier_cannot_appear_on_a_type_parameter: diag(1273, 1, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"), + _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, 1, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"), + accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), + An_accessor_property_cannot_be_declared_optional: diag(1276, 1, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), + _0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class: diag(1277, 1, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class_1277", "'{0}' modifier can only appear on a type parameter of a function, method or class"), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0: diag(1278, 1, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0_1278", "The runtime will invoke the decorator with {1} arguments, but the decorator expects {0}."), + The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0: diag(1279, 1, "The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0_1279", "The runtime will invoke the decorator with {1} arguments, but the decorator expects at least {0}."), + Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement: diag(1280, 1, "Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to__1280", "Namespaces are not allowed in global script files when '{0}' is enabled. If this file is not intended to be a global script, set 'moduleDetection' to 'force' or add an empty 'export {}' statement."), + Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead: diag(1281, 1, "Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead_1281", "Cannot access '{0}' from another file without qualification when '{1}' is enabled. Use '{2}' instead."), + An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1282, 1, "An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers__1282", "An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."), + An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."), + ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."), + An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."), + _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."), + _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."), + _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."), + with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), + await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), + The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), + Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, 1, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), + The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, 1, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."), + Global_module_exports_may_only_appear_in_module_files: diag(1314, 1, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."), + Global_module_exports_may_only_appear_in_declaration_files: diag(1315, 1, "Global_module_exports_may_only_appear_in_declaration_files_1315", "Global module exports may only appear in declaration files."), + Global_module_exports_may_only_appear_at_top_level: diag(1316, 1, "Global_module_exports_may_only_appear_at_top_level_1316", "Global module exports may only appear at top level."), + A_parameter_property_cannot_be_declared_using_a_rest_parameter: diag(1317, 1, "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", "A parameter property cannot be declared using a rest parameter."), + An_abstract_accessor_cannot_have_an_implementation: diag(1318, 1, "An_abstract_accessor_cannot_have_an_implementation_1318", "An abstract accessor cannot have an implementation."), + A_default_export_can_only_be_used_in_an_ECMAScript_style_module: diag(1319, 1, "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", "A default export can only be used in an ECMAScript-style module."), + Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), + Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), + Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), + Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."), + Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."), + Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), + This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), + String_literal_with_double_quotes_expected: diag(1327, 1, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), + Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, 1, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), + _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, 1, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), + A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: diag(1330, 1, "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330", "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."), + A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: diag(1331, 1, "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331", "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."), + A_variable_whose_type_is_a_unique_symbol_type_must_be_const: diag(1332, 1, "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332", "A variable whose type is a 'unique symbol' type must be 'const'."), + unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, 1, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), + unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, 1, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), + unique_symbol_types_are_not_allowed_here: diag(1335, 1, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, 1, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, 1, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), + Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), + Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), + Class_constructor_may_not_be_an_accessor: diag(1341, 1, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), + The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), + A_label_is_not_allowed_here: diag(1344, 1, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), + An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), + This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), + use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, 1, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), + Non_simple_parameter_declared_here: diag(1348, 1, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), + use_strict_directive_used_here: diag(1349, 1, "use_strict_directive_used_here_1349", "'use strict' directive used here."), + Print_the_final_configuration_instead_of_building: diag(1350, 3, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), + An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, 1, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), + A_bigint_literal_cannot_use_exponential_notation: diag(1352, 1, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), + A_bigint_literal_must_be_an_integer: diag(1353, 1, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), + readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, 1, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."), + A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, 1, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."), + Did_you_mean_to_mark_this_function_as_async: diag(1356, 1, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"), + An_enum_member_name_must_be_followed_by_a_or: diag(1357, 1, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."), + Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, 1, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."), + Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, 1, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."), + Type_0_does_not_satisfy_the_expected_type_1: diag(1360, 1, "Type_0_does_not_satisfy_the_expected_type_1_1360", "Type '{0}' does not satisfy the expected type '{1}'."), + _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, 1, "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361", "'{0}' cannot be used as a value because it was imported using 'import type'."), + _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: diag(1362, 1, "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362", "'{0}' cannot be used as a value because it was exported using 'export type'."), + A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: diag(1363, 1, "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363", "A type-only import can specify a default import or named bindings, but not both."), + Convert_to_type_only_export: diag(1364, 3, "Convert_to_type_only_export_1364", "Convert to type-only export"), + Convert_all_re_exported_types_to_type_only_exports: diag(1365, 3, "Convert_all_re_exported_types_to_type_only_exports_1365", "Convert all re-exported types to type-only exports"), + Split_into_two_separate_import_declarations: diag(1366, 3, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"), + Split_all_invalid_type_only_imports: diag(1367, 3, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"), + Class_constructor_may_not_be_a_generator: diag(1368, 1, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."), + Did_you_mean_0: diag(1369, 3, "Did_you_mean_0_1369", "Did you mean '{0}'?"), + This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."), + await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), + _0_was_imported_here: diag(1376, 3, "_0_was_imported_here_1376", "'{0}' was imported here."), + _0_was_exported_here: diag(1377, 3, "_0_was_exported_here_1377", "'{0}' was exported here."), + Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."), + An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), + Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), + Unexpected_token_Did_you_mean_or_gt: diag(1382, 1, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), + Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), + Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), + Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), + Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, 1, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), + _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, 1, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), + _0_is_not_allowed_as_a_parameter_name: diag(1390, 1, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."), + An_import_alias_cannot_use_import_type: diag(1392, 1, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"), + Imported_via_0_from_file_1: diag(1393, 3, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"), + Imported_via_0_from_file_1_with_packageId_2: diag(1394, 3, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"), + Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: diag(1395, 3, "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395", "Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"), + Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, 3, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"), + Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, 3, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"), + Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, 3, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"), + File_is_included_via_import_here: diag(1399, 3, "File_is_included_via_import_here_1399", "File is included via import here."), + Referenced_via_0_from_file_1: diag(1400, 3, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"), + File_is_included_via_reference_here: diag(1401, 3, "File_is_included_via_reference_here_1401", "File is included via reference here."), + Type_library_referenced_via_0_from_file_1: diag(1402, 3, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"), + Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, 3, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"), + File_is_included_via_type_library_reference_here: diag(1404, 3, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."), + Library_referenced_via_0_from_file_1: diag(1405, 3, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"), + File_is_included_via_library_reference_here: diag(1406, 3, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."), + Matched_by_include_pattern_0_in_1: diag(1407, 3, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"), + File_is_matched_by_include_pattern_specified_here: diag(1408, 3, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."), + Part_of_files_list_in_tsconfig_json: diag(1409, 3, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"), + File_is_matched_by_files_list_specified_here: diag(1410, 3, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."), + Output_from_referenced_project_0_included_because_1_specified: diag(1411, 3, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"), + Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, 3, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"), + File_is_output_from_referenced_project_specified_here: diag(1413, 3, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."), + Source_from_referenced_project_0_included_because_1_specified: diag(1414, 3, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"), + Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, 3, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"), + File_is_source_from_referenced_project_specified_here: diag(1416, 3, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."), + Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, 3, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"), + Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, 3, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"), + File_is_entry_point_of_type_library_specified_here: diag(1419, 3, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."), + Entry_point_for_implicit_type_library_0: diag(1420, 3, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"), + Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, 3, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"), + Library_0_specified_in_compilerOptions: diag(1422, 3, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"), + File_is_library_specified_here: diag(1423, 3, "File_is_library_specified_here_1423", "File is library specified here."), + Default_library: diag(1424, 3, "Default_library_1424", "Default library"), + Default_library_for_target_0: diag(1425, 3, "Default_library_for_target_0_1425", "Default library for target '{0}'"), + File_is_default_library_for_target_specified_here: diag(1426, 3, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."), + Root_file_specified_for_compilation: diag(1427, 3, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"), + File_is_output_of_project_reference_source_0: diag(1428, 3, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"), + File_redirects_to_file_0: diag(1429, 3, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"), + The_file_is_in_the_program_because_Colon: diag(1430, 3, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), + for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), + Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."), + Unexpected_keyword_or_identifier: diag(1434, 1, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), + Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), + Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), + Namespace_must_be_given_a_name: diag(1437, 1, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."), + Interface_must_be_given_a_name: diag(1438, 1, "Interface_must_be_given_a_name_1438", "Interface must be given a name."), + Type_alias_must_be_given_a_name: diag(1439, 1, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."), + Variable_declaration_not_allowed_at_this_location: diag(1440, 1, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."), + Cannot_start_a_function_call_in_a_type_annotation: diag(1441, 1, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."), + Expected_for_property_initializer: diag(1442, 1, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."), + Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."), + Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), + Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"), + Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), + resolution_mode_should_be_either_require_or_import: diag(1453, 1, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."), + resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."), + resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."), + Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, 1, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."), + Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, 3, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"), + File_is_ECMAScript_module_because_0_has_field_type_with_value_module: diag(1458, 3, "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458", `File is ECMAScript module because '{0}' has field "type" with value "module"`), + File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`), + File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`), + File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"), + resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "'resolution-mode' is the only valid key for type import attributes."), + Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."), + The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."), + Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."), + catch_or_finally_expected: diag(1472, 1, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."), + An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, 1, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."), + An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, 1, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."), + Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, 3, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."), + auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, 3, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", '"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'), + An_instantiation_expression_cannot_be_followed_by_a_property_access: diag(1477, 1, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."), + Identifier_or_string_literal_expected: diag(1478, 1, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."), + The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead: diag(1479, 1, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", `The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.`), + To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: diag(1480, 3, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", 'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'), + To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), + To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), + To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), + _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."), + Decorator_used_before_export_here: diag(1486, 1, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."), + Octal_escape_sequences_are_not_allowed_Use_the_syntax_0: diag(1487, 1, "Octal_escape_sequences_are_not_allowed_Use_the_syntax_0_1487", "Octal escape sequences are not allowed. Use the syntax '{0}'."), + Escape_sequence_0_is_not_allowed: diag(1488, 1, "Escape_sequence_0_is_not_allowed_1488", "Escape sequence '{0}' is not allowed."), + Decimals_with_leading_zeros_are_not_allowed: diag(1489, 1, "Decimals_with_leading_zeros_are_not_allowed_1489", "Decimals with leading zeros are not allowed."), + File_appears_to_be_binary: diag(1490, 1, "File_appears_to_be_binary_1490", "File appears to be binary."), + _0_modifier_cannot_appear_on_a_using_declaration: diag(1491, 1, "_0_modifier_cannot_appear_on_a_using_declaration_1491", "'{0}' modifier cannot appear on a 'using' declaration."), + _0_declarations_may_not_have_binding_patterns: diag(1492, 1, "_0_declarations_may_not_have_binding_patterns_1492", "'{0}' declarations may not have binding patterns."), + The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."), + The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."), + _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."), + Identifier_string_literal_or_number_literal_expected: diag(1496, 1, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."), + The_types_of_0_are_incompatible_between_these_types: diag(2200, 1, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), + The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), + Call_signature_return_types_0_and_1_are_incompatible: diag( + 2202, + 1, + "Call_signature_return_types_0_and_1_are_incompatible_2202", + "Call signature return types '{0}' and '{1}' are incompatible.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Construct_signature_return_types_0_and_1_are_incompatible: diag( + 2203, + 1, + "Construct_signature_return_types_0_and_1_are_incompatible_2203", + "Construct signature return types '{0}' and '{1}' are incompatible.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( + 2204, + 1, + "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", + "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag( + 2205, + 1, + "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", + "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + true + ), + The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, 1, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."), + The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, 1, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."), + This_type_parameter_might_need_an_extends_0_constraint: diag(2208, 1, "This_type_parameter_might_need_an_extends_0_constraint_2208", "This type parameter might need an `extends {0}` constraint."), + The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, 1, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), + The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), + Add_extends_constraint: diag(2211, 3, "Add_extends_constraint_2211", "Add `extends` constraint."), + Add_extends_constraint_to_all_type_parameters: diag(2212, 3, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"), + Duplicate_identifier_0: diag(2300, 1, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), + Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), + Static_members_cannot_reference_class_type_parameters: diag(2302, 1, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), + Circular_definition_of_import_alias_0: diag(2303, 1, "Circular_definition_of_import_alias_0_2303", "Circular definition of import alias '{0}'."), + Cannot_find_name_0: diag(2304, 1, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), + Module_0_has_no_exported_member_1: diag(2305, 1, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), + File_0_is_not_a_module: diag(2306, 1, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), + Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, 1, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), + Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, 1, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), + An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, 1, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), + Type_0_recursively_references_itself_as_a_base_type: diag(2310, 1, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), + Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, 1, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"), + An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, 1, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), + Type_parameter_0_has_a_circular_constraint: diag(2313, 1, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), + Generic_type_0_requires_1_type_argument_s: diag(2314, 1, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), + Type_0_is_not_generic: diag(2315, 1, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), + Global_type_0_must_be_a_class_or_interface_type: diag(2316, 1, "Global_type_0_must_be_a_class_or_interface_type_2316", "Global type '{0}' must be a class or interface type."), + Global_type_0_must_have_1_type_parameter_s: diag(2317, 1, "Global_type_0_must_have_1_type_parameter_s_2317", "Global type '{0}' must have {1} type parameter(s)."), + Cannot_find_global_type_0: diag(2318, 1, "Cannot_find_global_type_0_2318", "Cannot find global type '{0}'."), + Named_property_0_of_types_1_and_2_are_not_identical: diag(2319, 1, "Named_property_0_of_types_1_and_2_are_not_identical_2319", "Named property '{0}' of types '{1}' and '{2}' are not identical."), + Interface_0_cannot_simultaneously_extend_types_1_and_2: diag(2320, 1, "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."), + Excessive_stack_depth_comparing_types_0_and_1: diag(2321, 1, "Excessive_stack_depth_comparing_types_0_and_1_2321", "Excessive stack depth comparing types '{0}' and '{1}'."), + Type_0_is_not_assignable_to_type_1: diag(2322, 1, "Type_0_is_not_assignable_to_type_1_2322", "Type '{0}' is not assignable to type '{1}'."), + Cannot_redeclare_exported_variable_0: diag(2323, 1, "Cannot_redeclare_exported_variable_0_2323", "Cannot redeclare exported variable '{0}'."), + Property_0_is_missing_in_type_1: diag(2324, 1, "Property_0_is_missing_in_type_1_2324", "Property '{0}' is missing in type '{1}'."), + Property_0_is_private_in_type_1_but_not_in_type_2: diag(2325, 1, "Property_0_is_private_in_type_1_but_not_in_type_2_2325", "Property '{0}' is private in type '{1}' but not in type '{2}'."), + Types_of_property_0_are_incompatible: diag(2326, 1, "Types_of_property_0_are_incompatible_2326", "Types of property '{0}' are incompatible."), + Property_0_is_optional_in_type_1_but_required_in_type_2: diag(2327, 1, "Property_0_is_optional_in_type_1_but_required_in_type_2_2327", "Property '{0}' is optional in type '{1}' but required in type '{2}'."), + Types_of_parameters_0_and_1_are_incompatible: diag(2328, 1, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."), + Index_signature_for_type_0_is_missing_in_type_1: diag(2329, 1, "Index_signature_for_type_0_is_missing_in_type_1_2329", "Index signature for type '{0}' is missing in type '{1}'."), + _0_and_1_index_signatures_are_incompatible: diag(2330, 1, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."), + this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, 1, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."), + this_cannot_be_referenced_in_current_location: diag(2332, 1, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."), + this_cannot_be_referenced_in_constructor_arguments: diag(2333, 1, "this_cannot_be_referenced_in_constructor_arguments_2333", "'this' cannot be referenced in constructor arguments."), + this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, 1, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."), + super_can_only_be_referenced_in_a_derived_class: diag(2335, 1, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."), + super_cannot_be_referenced_in_constructor_arguments: diag(2336, 1, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."), + Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: diag(2337, 1, "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337", "Super calls are not permitted outside constructors or in nested functions inside constructors."), + super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: diag(2338, 1, "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338", "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."), + Property_0_does_not_exist_on_type_1: diag(2339, 1, "Property_0_does_not_exist_on_type_1_2339", "Property '{0}' does not exist on type '{1}'."), + Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: diag(2340, 1, "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", "Only public and protected methods of the base class are accessible via the 'super' keyword."), + Property_0_is_private_and_only_accessible_within_class_1: diag(2341, 1, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."), + This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), + Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), + Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), + Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), + This_expression_is_not_callable: diag(2349, 1, "This_expression_is_not_callable_2349", "This expression is not callable."), + Only_a_void_function_can_be_called_with_the_new_keyword: diag(2350, 1, "Only_a_void_function_can_be_called_with_the_new_keyword_2350", "Only a void function can be called with the 'new' keyword."), + This_expression_is_not_constructable: diag(2351, 1, "This_expression_is_not_constructable_2351", "This expression is not constructable."), + Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: diag(2352, 1, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."), + Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, 1, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."), + This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, 1, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."), + A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value: diag(2355, 1, "A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value."), + An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, 1, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."), + The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, 1, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."), + The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, 1, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."), + The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method: diag(2359, 1, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_2359", "The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."), + The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, 1, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), + The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, 1, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), + The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, 1, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."), + Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, 1, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."), + Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, 1, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."), + This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap: diag(2367, 1, "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367", "This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."), + Type_parameter_name_cannot_be_0: diag(2368, 1, "Type_parameter_name_cannot_be_0_2368", "Type parameter name cannot be '{0}'."), + A_parameter_property_is_only_allowed_in_a_constructor_implementation: diag(2369, 1, "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", "A parameter property is only allowed in a constructor implementation."), + A_rest_parameter_must_be_of_an_array_type: diag(2370, 1, "A_rest_parameter_must_be_of_an_array_type_2370", "A rest parameter must be of an array type."), + A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, 1, "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", "A parameter initializer is only allowed in a function or constructor implementation."), + Parameter_0_cannot_reference_itself: diag(2372, 1, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."), + Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, 1, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."), + Duplicate_index_signature_for_type_0: diag(2374, 1, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."), + Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, 1, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), + A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, 1, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."), + Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, 1, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."), + A_get_accessor_must_return_a_value: diag(2378, 1, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."), + Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, 1, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), + Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, 1, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."), + Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, 1, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."), + Overload_signatures_must_all_be_public_private_or_protected: diag(2385, 1, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."), + Overload_signatures_must_all_be_optional_or_required: diag(2386, 1, "Overload_signatures_must_all_be_optional_or_required_2386", "Overload signatures must all be optional or required."), + Function_overload_must_be_static: diag(2387, 1, "Function_overload_must_be_static_2387", "Function overload must be static."), + Function_overload_must_not_be_static: diag(2388, 1, "Function_overload_must_not_be_static_2388", "Function overload must not be static."), + Function_implementation_name_must_be_0: diag(2389, 1, "Function_implementation_name_must_be_0_2389", "Function implementation name must be '{0}'."), + Constructor_implementation_is_missing: diag(2390, 1, "Constructor_implementation_is_missing_2390", "Constructor implementation is missing."), + Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, 1, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."), + Multiple_constructor_implementations_are_not_allowed: diag(2392, 1, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."), + Duplicate_function_implementation: diag(2393, 1, "Duplicate_function_implementation_2393", "Duplicate function implementation."), + This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, 1, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."), + Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, 1, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."), + Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, 1, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."), + Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, 1, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."), + constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, 1, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."), + Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, 1, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."), + Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, 1, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."), + A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2401, 1, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."), + Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, 1, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."), + Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, 1, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."), + The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, 1, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."), + The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: diag(2405, 1, "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405", "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."), + The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: diag(2406, 1, "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", "The left-hand side of a 'for...in' statement must be a variable or a property access."), + The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: diag(2407, 1, "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407", "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."), + Setters_cannot_return_a_value: diag(2408, 1, "Setters_cannot_return_a_value_2408", "Setters cannot return a value."), + Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: diag(2409, 1, "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", "Return type of constructor signature must be assignable to the instance type of the class."), + The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: diag(2410, 1, "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."), + Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: diag(2412, 1, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."), + Property_0_of_type_1_is_not_assignable_to_2_index_type_3: diag(2411, 1, "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411", "Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."), + _0_index_type_1_is_not_assignable_to_2_index_type_3: diag(2413, 1, "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413", "'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."), + Class_name_cannot_be_0: diag(2414, 1, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), + Class_0_incorrectly_extends_base_class_1: diag(2415, 1, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, 1, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), + Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, 1, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), + Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, 1, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), + Types_of_construct_signatures_are_incompatible: diag(2419, 1, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), + Class_0_incorrectly_implements_interface_1: diag(2420, 1, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), + A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, 1, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), + Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, 1, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), + Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, 1, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), + Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2426, 1, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."), + Interface_name_cannot_be_0: diag(2427, 1, "Interface_name_cannot_be_0_2427", "Interface name cannot be '{0}'."), + All_declarations_of_0_must_have_identical_type_parameters: diag(2428, 1, "All_declarations_of_0_must_have_identical_type_parameters_2428", "All declarations of '{0}' must have identical type parameters."), + Interface_0_incorrectly_extends_interface_1: diag(2430, 1, "Interface_0_incorrectly_extends_interface_1_2430", "Interface '{0}' incorrectly extends interface '{1}'."), + Enum_name_cannot_be_0: diag(2431, 1, "Enum_name_cannot_be_0_2431", "Enum name cannot be '{0}'."), + In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: diag(2432, 1, "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."), + A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: diag(2433, 1, "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", "A namespace declaration cannot be in a different file from a class or function with which it is merged."), + A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: diag(2434, 1, "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", "A namespace declaration cannot be located prior to a class or function with which it is merged."), + Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: diag(2435, 1, "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", "Ambient modules cannot be nested in other modules or namespaces."), + Ambient_module_declaration_cannot_specify_relative_module_name: diag(2436, 1, "Ambient_module_declaration_cannot_specify_relative_module_name_2436", "Ambient module declaration cannot specify relative module name."), + Module_0_is_hidden_by_a_local_declaration_with_the_same_name: diag(2437, 1, "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", "Module '{0}' is hidden by a local declaration with the same name."), + Import_name_cannot_be_0: diag(2438, 1, "Import_name_cannot_be_0_2438", "Import name cannot be '{0}'."), + Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: diag(2439, 1, "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", "Import or export declaration in an ambient module declaration cannot reference module through relative module name."), + Import_declaration_conflicts_with_local_declaration_of_0: diag(2440, 1, "Import_declaration_conflicts_with_local_declaration_of_0_2440", "Import declaration conflicts with local declaration of '{0}'."), + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: diag(2441, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."), + Types_have_separate_declarations_of_a_private_property_0: diag(2442, 1, "Types_have_separate_declarations_of_a_private_property_0_2442", "Types have separate declarations of a private property '{0}'."), + Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, 1, "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."), + Property_0_is_protected_in_type_1_but_public_in_type_2: diag(2444, 1, "Property_0_is_protected_in_type_1_but_public_in_type_2_2444", "Property '{0}' is protected in type '{1}' but public in type '{2}'."), + Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: diag(2445, 1, "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."), + Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: diag(2446, 1, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."), + The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: diag(2447, 1, "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."), + Block_scoped_variable_0_used_before_its_declaration: diag(2448, 1, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."), + Class_0_used_before_its_declaration: diag(2449, 1, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."), + Enum_0_used_before_its_declaration: diag(2450, 1, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."), + Cannot_redeclare_block_scoped_variable_0: diag(2451, 1, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."), + An_enum_member_cannot_have_a_numeric_name: diag(2452, 1, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."), + Variable_0_is_used_before_being_assigned: diag(2454, 1, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."), + Type_alias_0_circularly_references_itself: diag(2456, 1, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), + Type_alias_name_cannot_be_0: diag(2457, 1, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), + An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, 1, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), + Module_0_declares_1_locally_but_it_is_not_exported: diag(2459, 1, "Module_0_declares_1_locally_but_it_is_not_exported_2459", "Module '{0}' declares '{1}' locally, but it is not exported."), + Module_0_declares_1_locally_but_it_is_exported_as_2: diag(2460, 1, "Module_0_declares_1_locally_but_it_is_exported_as_2_2460", "Module '{0}' declares '{1}' locally, but it is exported as '{2}'."), + Type_0_is_not_an_array_type: diag(2461, 1, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), + A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, 1, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), + A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, 1, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), + A_computed_property_name_must_be_of_type_string_number_symbol_or_any: diag(2464, 1, "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", "A computed property name must be of type 'string', 'number', 'symbol', or 'any'."), + this_cannot_be_referenced_in_a_computed_property_name: diag(2465, 1, "this_cannot_be_referenced_in_a_computed_property_name_2465", "'this' cannot be referenced in a computed property name."), + super_cannot_be_referenced_in_a_computed_property_name: diag(2466, 1, "super_cannot_be_referenced_in_a_computed_property_name_2466", "'super' cannot be referenced in a computed property name."), + A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, 1, "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467", "A computed property name cannot reference a type parameter from its containing type."), + Cannot_find_global_value_0: diag(2468, 1, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."), + The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, 1, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."), + Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, 1, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), + Enum_declarations_must_all_be_const_or_non_const: diag(2473, 1, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), + const_enum_member_initializers_must_be_constant_expressions: diag(2474, 1, "const_enum_member_initializers_must_be_constant_expressions_2474", "const enum member initializers must be constant expressions."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, 1, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), + A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, 1, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), + const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, 1, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), + const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, 1, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), + let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, 1, "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", "'let' is not allowed to be used as a name in 'let' or 'const' declarations."), + Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: diag(2481, 1, "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."), + The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: diag(2483, 1, "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", "The left-hand side of a 'for...of' statement cannot use a type annotation."), + Export_declaration_conflicts_with_exported_declaration_of_0: diag(2484, 1, "Export_declaration_conflicts_with_exported_declaration_of_0_2484", "Export declaration conflicts with exported declaration of '{0}'."), + The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: diag(2487, 1, "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", "The left-hand side of a 'for...of' statement must be a variable or a property access."), + Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2488, 1, "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."), + An_iterator_must_have_a_next_method: diag(2489, 1, "An_iterator_must_have_a_next_method_2489", "An iterator must have a 'next()' method."), + The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: diag(2490, 1, "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the '{0}()' method of an iterator must have a 'value' property."), + The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, 1, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), + Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, 1, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), + Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, 1, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), + Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, 1, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), + Type_0_is_not_an_array_type_or_a_string_type: diag(2495, 1, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), + The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, 1, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496", "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."), + This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, 1, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), + Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, 1, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), + An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, 1, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), + A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, 1, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), + A_rest_element_cannot_contain_a_binding_pattern: diag(2501, 1, "A_rest_element_cannot_contain_a_binding_pattern_2501", "A rest element cannot contain a binding pattern."), + _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: diag(2502, 1, "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", "'{0}' is referenced directly or indirectly in its own type annotation."), + Cannot_find_namespace_0: diag(2503, 1, "Cannot_find_namespace_0_2503", "Cannot find namespace '{0}'."), + Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: diag(2504, 1, "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."), + A_generator_cannot_have_a_void_type_annotation: diag(2505, 1, "A_generator_cannot_have_a_void_type_annotation_2505", "A generator cannot have a 'void' type annotation."), + _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, 1, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), + Type_0_is_not_a_constructor_function_type: diag(2507, 1, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), + No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, 1, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), + Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, 1, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), + Base_constructors_must_all_have_the_same_return_type: diag(2510, 1, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), + Cannot_create_an_instance_of_an_abstract_class: diag(2511, 1, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), + Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, 1, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), + Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, 1, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."), + A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, 1, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."), + Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."), + All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, 1, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."), + Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, 1, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."), + A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, 1, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."), + An_async_iterator_must_have_a_next_method: diag(2519, 1, "An_async_iterator_must_have_a_next_method_2519", "An async iterator must have a 'next()' method."), + Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: diag(2520, 1, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."), + The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: diag(2522, 1, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."), + yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, 1, "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523", "'yield' expressions cannot be used in a parameter initializer."), + await_expressions_cannot_be_used_in_a_parameter_initializer: diag(2524, 1, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."), + Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: diag(2525, 1, "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525", "Initializer provides no value for this binding element and the binding element has no default value."), + A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: diag(2526, 1, "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", "A 'this' type is available only in a non-static member of a class or interface."), + The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: diag(2527, 1, "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527", "The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."), + A_module_cannot_have_multiple_default_exports: diag(2528, 1, "A_module_cannot_have_multiple_default_exports_2528", "A module cannot have multiple default exports."), + Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: diag(2529, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."), + Property_0_is_incompatible_with_index_signature: diag(2530, 1, "Property_0_is_incompatible_with_index_signature_2530", "Property '{0}' is incompatible with index signature."), + Object_is_possibly_null: diag(2531, 1, "Object_is_possibly_null_2531", "Object is possibly 'null'."), + Object_is_possibly_undefined: diag(2532, 1, "Object_is_possibly_undefined_2532", "Object is possibly 'undefined'."), + Object_is_possibly_null_or_undefined: diag(2533, 1, "Object_is_possibly_null_or_undefined_2533", "Object is possibly 'null' or 'undefined'."), + A_function_returning_never_cannot_have_a_reachable_end_point: diag(2534, 1, "A_function_returning_never_cannot_have_a_reachable_end_point_2534", "A function returning 'never' cannot have a reachable end point."), + Type_0_cannot_be_used_to_index_type_1: diag(2536, 1, "Type_0_cannot_be_used_to_index_type_1_2536", "Type '{0}' cannot be used to index type '{1}'."), + Type_0_has_no_matching_index_signature_for_type_1: diag(2537, 1, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), + Type_0_cannot_be_used_as_an_index_type: diag(2538, 1, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), + Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, 1, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), + Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, 1, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), + Index_signature_in_type_0_only_permits_reading: diag(2542, 1, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), + Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, 1, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), + Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: diag(2544, 1, "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."), + A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: diag(2545, 1, "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", "A mixin class must have a constructor with a single rest parameter of type 'any[]'."), + The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, 1, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), + Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, 1, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), + Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, 1, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), + Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, 1, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."), + Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, 1, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), + Cannot_find_name_0_Did_you_mean_1: diag(2552, 1, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), + Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, 1, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), + Expected_0_arguments_but_got_1: diag(2554, 1, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."), + Expected_at_least_0_arguments_but_got_1: diag(2555, 1, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."), + A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: diag(2556, 1, "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556", "A spread argument must either have a tuple type or be passed to a rest parameter."), + Expected_0_type_arguments_but_got_1: diag(2558, 1, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), + Type_0_has_no_properties_in_common_with_type_1: diag(2559, 1, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), + Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, 1, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), + Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: diag(2561, 1, "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561", "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"), + Base_class_expressions_cannot_reference_class_type_parameters: diag(2562, 1, "Base_class_expressions_cannot_reference_class_type_parameters_2562", "Base class expressions cannot reference class type parameters."), + The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, 1, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), + Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, 1, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), + Property_0_is_used_before_being_assigned: diag(2565, 1, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, 1, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, 1, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), + Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, 1, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"), + Could_not_find_name_0_Did_you_mean_1: diag(2570, 1, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"), + Object_is_of_type_unknown: diag(2571, 1, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), + A_rest_element_type_must_be_an_array_type: diag(2574, 1, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), + No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, 1, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), + Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: diag(2576, 1, "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576", "Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"), + Return_type_annotation_circularly_references_itself: diag(2577, 1, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), + Unused_ts_expect_error_directive: diag(2578, 1, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, 1, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."), + Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, 1, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."), + Cannot_assign_to_0_because_it_is_a_constant: diag(2588, 1, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), + Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, 1, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), + Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, 1, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."), + This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, 1, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."), + _0_can_only_be_imported_by_using_a_default_import: diag(2595, 1, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), + _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, 1, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), + _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, 1, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."), + _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2598, 1, "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598", "'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."), + JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, 1, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), + Property_0_in_type_1_is_not_assignable_to_type_2: diag(2603, 1, "Property_0_in_type_1_is_not_assignable_to_type_2_2603", "Property '{0}' in type '{1}' is not assignable to type '{2}'."), + JSX_element_type_0_does_not_have_any_construct_or_call_signatures: diag(2604, 1, "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", "JSX element type '{0}' does not have any construct or call signatures."), + Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, 1, "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", "Property '{0}' of JSX spread attribute is not assignable to target property."), + JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: diag(2607, 1, "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", "JSX element class does not support attributes because it does not have a '{0}' property."), + The_global_type_JSX_0_may_not_have_more_than_one_property: diag(2608, 1, "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", "The global type 'JSX.{0}' may not have more than one property."), + JSX_spread_child_must_be_an_array_type: diag(2609, 1, "JSX_spread_child_must_be_an_array_type_2609", "JSX spread child must be an array type."), + _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: diag(2610, 1, "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610", "'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."), + _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: diag(2611, 1, "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611", "'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."), + Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, 1, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."), + Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, 1, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"), + Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, 1, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"), + Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, 1, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."), + _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: diag(2616, 1, "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616", "'{0}' can only be imported by using 'import {1} = require({2})' or a default import."), + _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2617, 1, "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617", "'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."), + Source_has_0_element_s_but_target_requires_1: diag(2618, 1, "Source_has_0_element_s_but_target_requires_1_2618", "Source has {0} element(s) but target requires {1}."), + Source_has_0_element_s_but_target_allows_only_1: diag(2619, 1, "Source_has_0_element_s_but_target_allows_only_1_2619", "Source has {0} element(s) but target allows only {1}."), + Target_requires_0_element_s_but_source_may_have_fewer: diag(2620, 1, "Target_requires_0_element_s_but_source_may_have_fewer_2620", "Target requires {0} element(s) but source may have fewer."), + Target_allows_only_0_element_s_but_source_may_have_more: diag(2621, 1, "Target_allows_only_0_element_s_but_source_may_have_more_2621", "Target allows only {0} element(s) but source may have more."), + Source_provides_no_match_for_required_element_at_position_0_in_target: diag(2623, 1, "Source_provides_no_match_for_required_element_at_position_0_in_target_2623", "Source provides no match for required element at position {0} in target."), + Source_provides_no_match_for_variadic_element_at_position_0_in_target: diag(2624, 1, "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624", "Source provides no match for variadic element at position {0} in target."), + Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, 1, "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625", "Variadic element at position {0} in source does not match element at position {1} in target."), + Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: diag(2626, 1, "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626", "Type at position {0} in source is not compatible with type at position {1} in target."), + Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: diag(2627, 1, "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627", "Type at positions {0} through {1} in source is not compatible with type at position {2} in target."), + Cannot_assign_to_0_because_it_is_an_enum: diag(2628, 1, "Cannot_assign_to_0_because_it_is_an_enum_2628", "Cannot assign to '{0}' because it is an enum."), + Cannot_assign_to_0_because_it_is_a_class: diag(2629, 1, "Cannot_assign_to_0_because_it_is_a_class_2629", "Cannot assign to '{0}' because it is a class."), + Cannot_assign_to_0_because_it_is_a_function: diag(2630, 1, "Cannot_assign_to_0_because_it_is_a_function_2630", "Cannot assign to '{0}' because it is a function."), + Cannot_assign_to_0_because_it_is_a_namespace: diag(2631, 1, "Cannot_assign_to_0_because_it_is_a_namespace_2631", "Cannot assign to '{0}' because it is a namespace."), + Cannot_assign_to_0_because_it_is_an_import: diag(2632, 1, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."), + JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, 1, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"), + _0_index_signatures_are_incompatible: diag(2634, 1, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."), + Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, 1, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."), + Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, 1, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."), + Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, 1, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."), + Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, 1, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."), + React_components_cannot_include_JSX_namespace_names: diag(2639, 1, "React_components_cannot_include_JSX_namespace_names_2639", "React components cannot include JSX namespace names"), + Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, 1, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."), + A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, 1, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."), + Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, 1, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."), + Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, 1, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."), + JSX_expressions_must_have_one_parent_element: diag(2657, 1, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."), + Type_0_provides_no_match_for_the_signature_1: diag(2658, 1, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."), + super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, 1, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."), + super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: diag(2660, 1, "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", "'super' can only be referenced in members of derived classes or object literal expressions."), + Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: diag(2661, 1, "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", "Cannot export '{0}'. Only local declarations can be exported from a module."), + Cannot_find_name_0_Did_you_mean_the_static_member_1_0: diag(2662, 1, "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"), + Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: diag(2663, 1, "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"), + Invalid_module_name_in_augmentation_module_0_cannot_be_found: diag(2664, 1, "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", "Invalid module name in augmentation, module '{0}' cannot be found."), + Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: diag(2665, 1, "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665", "Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."), + Exports_and_export_assignments_are_not_permitted_in_module_augmentations: diag(2666, 1, "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", "Exports and export assignments are not permitted in module augmentations."), + Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: diag(2667, 1, "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."), + export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: diag(2668, 1, "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."), + Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: diag(2669, 1, "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."), + Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: diag(2670, 1, "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."), + Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: diag(2671, 1, "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671", "Cannot augment module '{0}' because it resolves to a non-module entity."), + Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: diag(2672, 1, "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672", "Cannot assign a '{0}' constructor type to a '{1}' constructor type."), + Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: diag(2673, 1, "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673", "Constructor of class '{0}' is private and only accessible within the class declaration."), + Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: diag(2674, 1, "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674", "Constructor of class '{0}' is protected and only accessible within the class declaration."), + Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: diag(2675, 1, "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675", "Cannot extend a class '{0}'. Class constructor is marked as private."), + Accessors_must_both_be_abstract_or_non_abstract: diag(2676, 1, "Accessors_must_both_be_abstract_or_non_abstract_2676", "Accessors must both be abstract or non-abstract."), + A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: diag(2677, 1, "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677", "A type predicate's type must be assignable to its parameter's type."), + Type_0_is_not_comparable_to_type_1: diag(2678, 1, "Type_0_is_not_comparable_to_type_1_2678", "Type '{0}' is not comparable to type '{1}'."), + A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, 1, "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679", "A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."), + A_0_parameter_must_be_the_first_parameter: diag(2680, 1, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."), + A_constructor_cannot_have_a_this_parameter: diag(2681, 1, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."), + this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, 1, "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", "'this' implicitly has type 'any' because it does not have a type annotation."), + The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: diag(2684, 1, "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."), + The_this_types_of_each_signature_are_incompatible: diag(2685, 1, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."), + _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: diag(2686, 1, "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686", "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."), + All_declarations_of_0_must_have_identical_modifiers: diag(2687, 1, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), + Cannot_find_type_definition_file_for_0: diag(2688, 1, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), + Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), + _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), + _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), + Namespace_0_has_no_exported_member_1: diag(2694, 1, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), + Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag( + 2695, + 1, + "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", + "Left side of comma operator is unused and has no side effects.", + /*reportsUnnecessary*/ + true + ), + The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, 1, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"), + An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, 1, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), + Spread_types_may_only_be_created_from_object_types: diag(2698, 1, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."), + Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, 1, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."), + Rest_types_may_only_be_created_from_object_types: diag(2700, 1, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."), + The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, 1, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."), + _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, 1, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."), + The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, 1, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."), + The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, 1, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."), + An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, 1, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), + Required_type_parameters_may_not_follow_optional_type_parameters: diag(2706, 1, "Required_type_parameters_may_not_follow_optional_type_parameters_2706", "Required type parameters may not follow optional type parameters."), + Generic_type_0_requires_between_1_and_2_type_arguments: diag(2707, 1, "Generic_type_0_requires_between_1_and_2_type_arguments_2707", "Generic type '{0}' requires between {1} and {2} type arguments."), + Cannot_use_namespace_0_as_a_value: diag(2708, 1, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."), + Cannot_use_namespace_0_as_a_type: diag(2709, 1, "Cannot_use_namespace_0_as_a_type_2709", "Cannot use namespace '{0}' as a type."), + _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: diag(2710, 1, "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", "'{0}' are specified twice. The attribute named '{0}' will be overwritten."), + A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, 1, "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711", "A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), + A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, 1, "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712", "A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), + Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: diag(2713, 1, "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713", `Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`), + The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: diag(2714, 1, "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714", "The expression of an export assignment must be an identifier or qualified name in an ambient context."), + Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, 1, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), + Type_parameter_0_has_a_circular_default: diag(2716, 1, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), + Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, 1, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), + Duplicate_property_0: diag(2718, 1, "Duplicate_property_0_2718", "Duplicate property '{0}'."), + Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, 1, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, 1, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, 1, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), + _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), + Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), + Cannot_find_lib_definition_for_0: diag(2726, 1, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), + Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), + _0_is_declared_here: diag(2728, 3, "_0_is_declared_here_2728", "'{0}' is declared here."), + Property_0_is_used_before_its_initialization: diag(2729, 1, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), + An_arrow_function_cannot_have_a_this_parameter: diag(2730, 1, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), + Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, 1, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), + Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, 1, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), + Property_0_was_also_declared_here: diag(2733, 1, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), + Are_you_missing_a_semicolon: diag(2734, 1, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), + Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, 1, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), + Operator_0_cannot_be_applied_to_type_1: diag(2736, 1, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), + BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: diag(2737, 1, "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737", "BigInt literals are not available when targeting lower than ES2020."), + An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, 3, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."), + Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, 1, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), + Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, 1, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), + Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, 1, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), + The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, 1, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), + No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, 1, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), + Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, 1, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), + This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), + This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), + _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), + Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."), + _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), + The_implementation_signature_is_declared_here: diag(2750, 1, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), + Circularity_originates_in_type_at_this_location: diag(2751, 1, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), + The_first_export_default_is_here: diag(2752, 1, "The_first_export_default_is_here_2752", "The first export default is here."), + Another_export_default_is_here: diag(2753, 1, "Another_export_default_is_here_2753", "Another export default is here."), + super_may_not_use_type_arguments: diag(2754, 1, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."), + No_constituent_of_type_0_is_callable: diag(2755, 1, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."), + Not_all_constituents_of_type_0_are_callable: diag(2756, 1, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."), + Type_0_has_no_call_signatures: diag(2757, 1, "Type_0_has_no_call_signatures_2757", "Type '{0}' has no call signatures."), + Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2758, 1, "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758", "Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."), + No_constituent_of_type_0_is_constructable: diag(2759, 1, "No_constituent_of_type_0_is_constructable_2759", "No constituent of type '{0}' is constructable."), + Not_all_constituents_of_type_0_are_constructable: diag(2760, 1, "Not_all_constituents_of_type_0_are_constructable_2760", "Not all constituents of type '{0}' are constructable."), + Type_0_has_no_construct_signatures: diag(2761, 1, "Type_0_has_no_construct_signatures_2761", "Type '{0}' has no construct signatures."), + Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2762, 1, "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762", "Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: diag(2763, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: diag(2764, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."), + Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: diag(2765, 1, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."), + Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: diag(2766, 1, "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766", "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."), + The_0_property_of_an_iterator_must_be_a_method: diag(2767, 1, "The_0_property_of_an_iterator_must_be_a_method_2767", "The '{0}' property of an iterator must be a method."), + The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, 1, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."), + No_overload_matches_this_call: diag(2769, 1, "No_overload_matches_this_call_2769", "No overload matches this call."), + The_last_overload_gave_the_following_error: diag(2770, 1, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."), + The_last_overload_is_declared_here: diag(2771, 1, "The_last_overload_is_declared_here_2771", "The last overload is declared here."), + Overload_0_of_1_2_gave_the_following_error: diag(2772, 1, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."), + Did_you_forget_to_use_await: diag(2773, 1, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"), + This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, 1, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"), + Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: diag(2775, 1, "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775", "Assertions require every name in the call target to be declared with an explicit type annotation."), + Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: diag(2776, 1, "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776", "Assertions require the call target to be an identifier or qualified name."), + The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: diag(2777, 1, "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777", "The operand of an increment or decrement operator may not be an optional property access."), + The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: diag(2778, 1, "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778", "The target of an object rest assignment may not be an optional property access."), + The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: diag(2779, 1, "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779", "The left-hand side of an assignment expression may not be an optional property access."), + The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: diag(2780, 1, "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780", "The left-hand side of a 'for...in' statement may not be an optional property access."), + The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, 1, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), + _0_needs_an_explicit_type_annotation: diag(2782, 3, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), + _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, 1, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), + get_and_set_accessors_cannot_declare_this_parameters: diag(2784, 1, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), + This_spread_always_overwrites_this_property: diag(2785, 1, "This_spread_always_overwrites_this_property_2785", "This spread always overwrites this property."), + _0_cannot_be_used_as_a_JSX_component: diag(2786, 1, "_0_cannot_be_used_as_a_JSX_component_2786", "'{0}' cannot be used as a JSX component."), + Its_return_type_0_is_not_a_valid_JSX_element: diag(2787, 1, "Its_return_type_0_is_not_a_valid_JSX_element_2787", "Its return type '{0}' is not a valid JSX element."), + Its_instance_type_0_is_not_a_valid_JSX_element: diag(2788, 1, "Its_instance_type_0_is_not_a_valid_JSX_element_2788", "Its instance type '{0}' is not a valid JSX element."), + Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, 1, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."), + The_operand_of_a_delete_operator_must_be_optional: diag(2790, 1, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), + Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, 1, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), + Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option: diag(2792, 1, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"), + The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, 1, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), + Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, 1, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), + The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), + It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, 1, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), + A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, 1, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."), + The_declaration_was_marked_as_deprecated_here: diag(2798, 1, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."), + Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, 1, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."), + Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, 1, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."), + This_condition_will_always_return_true_since_this_0_is_always_defined: diag(2801, 1, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."), + Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, 1, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."), + Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, 1, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."), + Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, 1, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."), + Private_accessor_was_defined_without_a_getter: diag(2806, 1, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), + This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), + A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), + Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses: diag(2809, 1, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the whole assignment in parentheses."), + Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), + Initializer_for_property_0: diag(2811, 1, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), + Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), + Class_declaration_cannot_implement_overload_list_for_0: diag(2813, 1, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), + Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, 1, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), + arguments_cannot_be_referenced_in_property_initializers: diag(2815, 1, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."), + Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, 1, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), + Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, 1, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), + Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."), + Namespace_name_cannot_be_0: diag(2819, 1, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."), + Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"), + Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."), + Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."), + Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."), + Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"), + Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."), + Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"), + Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2836, 1, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."), + Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."), + All_declarations_of_0_must_have_identical_constraints: diag(2838, 1, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."), + This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."), + An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types: diag(2840, 1, "An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types_2840", "An interface cannot extend a primitive type like '{0}'. It can only extend other named object types."), + _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"), + We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."), + Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), + This_condition_will_always_return_0: diag(2845, 1, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."), + A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead: diag(2846, 1, "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846", "A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"), + The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression: diag(2848, 1, "The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression_2848", "The right-hand side of an 'instanceof' expression must not be an instantiation expression."), + Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1: diag(2849, 1, "Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1_2849", "Target signature provides too few arguments. Expected {0} or more, but got {1}."), + The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined: diag(2850, 1, "The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_n_2850", "The initializer of a 'using' declaration must be either an object with a '[Symbol.dispose]()' method, or be 'null' or 'undefined'."), + The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."), + await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."), + await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), + Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."), + Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."), + Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."), + Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."), + Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."), + Excessive_complexity_comparing_types_0_and_1: diag(2859, 1, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."), + The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2860, 1, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2860", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."), + An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2861, 1, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2861", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."), + Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."), + A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."), + A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."), + Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."), + Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2866, 1, "Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_w_2866", "Import '{0}' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun: diag(2867, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2867", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun`."), + Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig: diag(2868, 1, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_2868", "Cannot find name '{0}'. Do you need to install type definitions for Bun? Try `npm i --save-dev @types/bun` and then add 'bun' to the types field in your tsconfig."), + Import_declaration_0_is_using_private_name_1: diag(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), + Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), + Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), + Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4006, 1, "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006", "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4008, 1, "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008", "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4010, 1, "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010", "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."), + Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4012, 1, "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012", "Type parameter '{0}' of public method from exported class has or is using private name '{1}'."), + Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4014, 1, "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", "Type parameter '{0}' of method from exported interface has or is using private name '{1}'."), + Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4016, 1, "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", "Type parameter '{0}' of exported function has or is using private name '{1}'."), + Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4019, 1, "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", "Implements clause of exported class '{0}' has or is using private name '{1}'."), + extends_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4020, 1, "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", "'extends' clause of exported class '{0}' has or is using private name '{1}'."), + extends_clause_of_exported_class_has_or_is_using_private_name_0: diag(4021, 1, "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021", "'extends' clause of exported class has or is using private name '{0}'."), + extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: diag(4022, 1, "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", "'extends' clause of exported interface '{0}' has or is using private name '{1}'."), + Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4023, 1, "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."), + Exported_variable_0_has_or_is_using_name_1_from_private_module_2: diag(4024, 1, "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", "Exported variable '{0}' has or is using name '{1}' from private module '{2}'."), + Exported_variable_0_has_or_is_using_private_name_1: diag(4025, 1, "Exported_variable_0_has_or_is_using_private_name_1_4025", "Exported variable '{0}' has or is using private name '{1}'."), + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4026, 1, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026", "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4027, 1, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027", "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4028, 1, "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028", "Public static property '{0}' of exported class has or is using private name '{1}'."), + Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4029, 1, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029", "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4030, 1, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030", "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4031, 1, "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031", "Public property '{0}' of exported class has or is using private name '{1}'."), + Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4032, 1, "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032", "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), + Property_0_of_exported_interface_has_or_is_using_private_name_1: diag(4033, 1, "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033", "Property '{0}' of exported interface has or is using private name '{1}'."), + Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4034, 1, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034", "Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4035, 1, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035", "Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."), + Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4036, 1, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036", "Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4037, 1, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037", "Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4038, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4039, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4040, 1, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040", "Return type of public static getter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4041, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041", "Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4042, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042", "Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), + Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4043, 1, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043", "Return type of public getter '{0}' from exported class has or is using private name '{1}'."), + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4044, 1, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044", "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4045, 1, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045", "Return type of constructor signature from exported interface has or is using private name '{0}'."), + Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4046, 1, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046", "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4047, 1, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047", "Return type of call signature from exported interface has or is using private name '{0}'."), + Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4048, 1, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048", "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4049, 1, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049", "Return type of index signature from exported interface has or is using private name '{0}'."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4050, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050", "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4051, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051", "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."), + Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: diag(4052, 1, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052", "Return type of public static method from exported class has or is using private name '{0}'."), + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4053, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053", "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4054, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054", "Return type of public method from exported class has or is using name '{0}' from private module '{1}'."), + Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: diag(4055, 1, "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055", "Return type of public method from exported class has or is using private name '{0}'."), + Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4056, 1, "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056", "Return type of method from exported interface has or is using name '{0}' from private module '{1}'."), + Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: diag(4057, 1, "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057", "Return type of method from exported interface has or is using private name '{0}'."), + Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4058, 1, "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058", "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."), + Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: diag(4059, 1, "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059", "Return type of exported function has or is using name '{0}' from private module '{1}'."), + Return_type_of_exported_function_has_or_is_using_private_name_0: diag(4060, 1, "Return_type_of_exported_function_has_or_is_using_private_name_0_4060", "Return type of exported function has or is using private name '{0}'."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4061, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4062, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: diag(4063, 1, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063", "Parameter '{0}' of constructor from exported class has or is using private name '{1}'."), + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4064, 1, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064", "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4065, 1, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065", "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4066, 1, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066", "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4067, 1, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067", "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4068, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4069, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4070, 1, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070", "Parameter '{0}' of public static method from exported class has or is using private name '{1}'."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4071, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071", "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4072, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072", "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4073, 1, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073", "Parameter '{0}' of public method from exported class has or is using private name '{1}'."), + Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4074, 1, "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074", "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4075, 1, "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075", "Parameter '{0}' of method from exported interface has or is using private name '{1}'."), + Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4076, 1, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076", "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."), + Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: diag(4077, 1, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077", "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4078, 1, "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078", "Parameter '{0}' of exported function has or is using private name '{1}'."), + Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, 1, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), + Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), + Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), + Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."), + Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1: diag(4085, 1, "Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1_4085", "Extends clause for inferred type '{0}' has or is using private name '{1}'."), + Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), + Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, 1, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."), + Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, 1, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, 1, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, 1, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."), + Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4098, 1, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098", "Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), + Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4099, 1, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099", "Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), + Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, 1, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."), + Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, 1, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), + Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, 1, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."), + Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, 1, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."), + The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, 1, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."), + Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: diag(4105, 1, "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105", "Private or protected member '{0}' cannot be accessed on a type parameter."), + Parameter_0_of_accessor_has_or_is_using_private_name_1: diag(4106, 1, "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106", "Parameter '{0}' of accessor has or is using private name '{1}'."), + Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: diag(4107, 1, "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107", "Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."), + Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4108, 1, "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108", "Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."), + Type_arguments_for_0_circularly_reference_themselves: diag(4109, 1, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."), + Tuple_type_arguments_circularly_reference_themselves: diag(4110, 1, "Tuple_type_arguments_circularly_reference_themselves_4110", "Tuple type arguments circularly reference themselves."), + Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: diag(4111, 1, "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111", "Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."), + This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class: diag(4112, 1, "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112", "This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."), + This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0: diag(4113, 1, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."), + This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0: diag(4114, 1, "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114", "This member must have an 'override' modifier because it overrides a member in the base class '{0}'."), + This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0: diag(4115, 1, "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115", "This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."), + This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, 1, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."), + This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, 1, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"), + The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, 1, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."), + This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, 1, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), + This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, 1, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."), + This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"), + Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), + Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."), + One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."), + The_current_host_does_not_support_the_0_option: diag(5001, 1, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), + Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), + File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), + Cannot_read_file_0_Colon_1: diag(5012, 1, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), + Failed_to_parse_file_0_Colon_1: diag(5014, 1, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), + Unknown_compiler_option_0: diag(5023, 1, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), + Compiler_option_0_requires_a_value_of_type_1: diag(5024, 1, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."), + Unknown_compiler_option_0_Did_you_mean_1: diag(5025, 1, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"), + Could_not_write_file_0_Colon_1: diag(5033, 1, "Could_not_write_file_0_Colon_1_5033", "Could not write file '{0}': {1}."), + Option_project_cannot_be_mixed_with_source_files_on_a_command_line: diag(5042, 1, "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", "Option 'project' cannot be mixed with source files on a command line."), + Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: diag(5047, 1, "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."), + Option_0_cannot_be_specified_when_option_target_is_ES3: diag(5048, 1, "Option_0_cannot_be_specified_when_option_target_is_ES3_5048", "Option '{0}' cannot be specified when option 'target' is 'ES3'."), + Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: diag(5051, 1, "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."), + Option_0_cannot_be_specified_without_specifying_option_1: diag(5052, 1, "Option_0_cannot_be_specified_without_specifying_option_1_5052", "Option '{0}' cannot be specified without specifying option '{1}'."), + Option_0_cannot_be_specified_with_option_1: diag(5053, 1, "Option_0_cannot_be_specified_with_option_1_5053", "Option '{0}' cannot be specified with option '{1}'."), + A_tsconfig_json_file_is_already_defined_at_Colon_0: diag(5054, 1, "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", "A 'tsconfig.json' file is already defined at: '{0}'."), + Cannot_write_file_0_because_it_would_overwrite_input_file: diag(5055, 1, "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", "Cannot write file '{0}' because it would overwrite input file."), + Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: diag(5056, 1, "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", "Cannot write file '{0}' because it would be overwritten by multiple input files."), + Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, 1, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), + The_specified_path_does_not_exist_Colon_0: diag(5058, 1, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), + Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, 1, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), + Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, 1, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), + Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, 1, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), + Substitutions_for_pattern_0_should_be_an_array: diag(5063, 1, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), + Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, 1, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."), + File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, 1, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."), + Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: diag(5066, 1, "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066", "Substitutions for pattern '{0}' shouldn't be an empty array."), + Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, 1, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."), + Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."), + Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."), + Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."), + Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd: diag(5071, 1, "Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd_5071", "Option '--resolveJsonModule' cannot be specified when 'module' is set to 'none', 'system', or 'umd'."), + Unknown_build_option_0: diag(5072, 1, "Unknown_build_option_0_5072", "Unknown build option '{0}'."), + Build_option_0_requires_a_value_of_type_1: diag(5073, 1, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."), + Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, 1, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."), + _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, 1, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."), + _0_and_1_operations_cannot_be_mixed_without_parentheses: diag(5076, 1, "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076", "'{0}' and '{1}' operations cannot be mixed without parentheses."), + Unknown_build_option_0_Did_you_mean_1: diag(5077, 1, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"), + Unknown_watch_option_0: diag(5078, 1, "Unknown_watch_option_0_5078", "Unknown watch option '{0}'."), + Unknown_watch_option_0_Did_you_mean_1: diag(5079, 1, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), + Watch_option_0_requires_a_value_of_type_1: diag(5080, 1, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), + Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, 1, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), + _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, 1, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), + Cannot_read_file_0: diag(5083, 1, "Cannot_read_file_0_5083", "Cannot read file '{0}'."), + A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, 1, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."), + A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, 1, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), + A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, 1, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."), + The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), + Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), + Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), + Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled: diag(5091, 1, "Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when '{0}' is enabled."), + The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), + Compiler_option_0_may_only_be_used_with_build: diag(5093, 1, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), + Compiler_option_0_may_not_be_used_with_build: diag(5094, 1, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), + Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: diag(5095, 1, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."), + Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."), + An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."), + Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."), + Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`), + Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."), + Invalid_value_for_ignoreDeprecations: diag(5103, 1, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."), + Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."), + Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."), + Use_0_instead: diag(5106, 3, "Use_0_instead_5106", "Use '{0}' instead."), + Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`), + Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."), + Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: diag(5109, 1, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."), + Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: diag(5110, 1, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."), + Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), + Concatenate_and_emit_output_to_single_file: diag(6001, 3, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), + Generates_corresponding_d_ts_file: diag(6002, 3, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), + Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, 3, "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004", "Specify the location where debugger should locate TypeScript files instead of source locations."), + Watch_input_files: diag(6005, 3, "Watch_input_files_6005", "Watch input files."), + Redirect_output_structure_to_the_directory: diag(6006, 3, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."), + Do_not_erase_const_enum_declarations_in_generated_code: diag(6007, 3, "Do_not_erase_const_enum_declarations_in_generated_code_6007", "Do not erase const enum declarations in generated code."), + Do_not_emit_outputs_if_any_errors_were_reported: diag(6008, 3, "Do_not_emit_outputs_if_any_errors_were_reported_6008", "Do not emit outputs if any errors were reported."), + Do_not_emit_comments_to_output: diag(6009, 3, "Do_not_emit_comments_to_output_6009", "Do not emit comments to output."), + Do_not_emit_outputs: diag(6010, 3, "Do_not_emit_outputs_6010", "Do not emit outputs."), + Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, 3, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), + Skip_type_checking_of_declaration_files: diag(6012, 3, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), + Do_not_resolve_the_real_path_of_symlinks: diag(6013, 3, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, 3, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), + Specify_ECMAScript_target_version: diag(6015, 3, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."), + Specify_module_code_generation: diag(6016, 3, "Specify_module_code_generation_6016", "Specify module code generation."), + Print_this_message: diag(6017, 3, "Print_this_message_6017", "Print this message."), + Print_the_compiler_s_version: diag(6019, 3, "Print_the_compiler_s_version_6019", "Print the compiler's version."), + Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: diag(6020, 3, "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."), + Syntax_Colon_0: diag(6023, 3, "Syntax_Colon_0_6023", "Syntax: {0}"), + options: diag(6024, 3, "options_6024", "options"), + file: diag(6025, 3, "file_6025", "file"), + Examples_Colon_0: diag(6026, 3, "Examples_Colon_0_6026", "Examples: {0}"), + Options_Colon: diag(6027, 3, "Options_Colon_6027", "Options:"), + Version_0: diag(6029, 3, "Version_0_6029", "Version {0}"), + Insert_command_line_options_and_files_from_a_file: diag(6030, 3, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, 3, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), + File_change_detected_Starting_incremental_compilation: diag(6032, 3, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), + KIND: diag(6034, 3, "KIND_6034", "KIND"), + FILE: diag(6035, 3, "FILE_6035", "FILE"), + VERSION: diag(6036, 3, "VERSION_6036", "VERSION"), + LOCATION: diag(6037, 3, "LOCATION_6037", "LOCATION"), + DIRECTORY: diag(6038, 3, "DIRECTORY_6038", "DIRECTORY"), + STRATEGY: diag(6039, 3, "STRATEGY_6039", "STRATEGY"), + FILE_OR_DIRECTORY: diag(6040, 3, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"), + Errors_Files: diag(6041, 3, "Errors_Files_6041", "Errors Files"), + Generates_corresponding_map_file: diag(6043, 3, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."), + Compiler_option_0_expects_an_argument: diag(6044, 1, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."), + Unterminated_quoted_string_in_response_file_0: diag(6045, 1, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."), + Argument_for_0_option_must_be_Colon_1: diag(6046, 1, "Argument_for_0_option_must_be_Colon_1_6046", "Argument for '{0}' option must be: {1}."), + Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: diag(6048, 1, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form or -. For example '{0}' or '{1}'."), + Unable_to_open_file_0: diag(6050, 1, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."), + Corrupted_locale_file_0: diag(6051, 1, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."), + Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, 3, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."), + File_0_not_found: diag(6053, 1, "File_0_not_found_6053", "File '{0}' not found."), + File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: diag(6054, 1, "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054", "File '{0}' has an unsupported extension. The only supported extensions are {1}."), + Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: diag(6055, 3, "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055", "Suppress noImplicitAny errors for indexing objects lacking index signatures."), + Do_not_emit_declarations_for_code_that_has_an_internal_annotation: diag(6056, 3, "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056", "Do not emit declarations for code that has an '@internal' annotation."), + Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: diag(6058, 3, "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058", "Specify the root directory of input files. Use to control the output directory structure with --outDir."), + File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: diag(6059, 1, "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059", "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."), + Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: diag(6060, 3, "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060", "Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."), + NEWLINE: diag(6061, 3, "NEWLINE_6061", "NEWLINE"), + Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, 1, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."), + Enables_experimental_support_for_ES7_decorators: diag(6065, 3, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."), + Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, 3, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."), + Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, 3, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."), + Successfully_created_a_tsconfig_json_file: diag(6071, 3, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."), + Suppress_excess_property_checks_for_object_literals: diag(6072, 3, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."), + Stylize_errors_and_messages_using_color_and_context_experimental: diag(6073, 3, "Stylize_errors_and_messages_using_color_and_context_experimental_6073", "Stylize errors and messages using color and context (experimental)."), + Do_not_report_errors_on_unused_labels: diag(6074, 3, "Do_not_report_errors_on_unused_labels_6074", "Do not report errors on unused labels."), + Report_error_when_not_all_code_paths_in_function_return_a_value: diag(6075, 3, "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", "Report error when not all code paths in function return a value."), + Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, 3, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), + Do_not_report_errors_on_unreachable_code: diag(6077, 3, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), + Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), + Specify_JSX_code_generation: diag(6080, 3, "Specify_JSX_code_generation_6080", "Specify JSX code generation."), + Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), + Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."), + Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"), + Enable_tracing_of_the_name_resolution_process: diag(6085, 3, "Enable_tracing_of_the_name_resolution_process_6085", "Enable tracing of the name resolution process."), + Resolving_module_0_from_1: diag(6086, 3, "Resolving_module_0_from_1_6086", "======== Resolving module '{0}' from '{1}'. ========"), + Explicitly_specified_module_resolution_kind_Colon_0: diag(6087, 3, "Explicitly_specified_module_resolution_kind_Colon_0_6087", "Explicitly specified module resolution kind: '{0}'."), + Module_resolution_kind_is_not_specified_using_0: diag(6088, 3, "Module_resolution_kind_is_not_specified_using_0_6088", "Module resolution kind is not specified, using '{0}'."), + Module_name_0_was_successfully_resolved_to_1: diag(6089, 3, "Module_name_0_was_successfully_resolved_to_1_6089", "======== Module name '{0}' was successfully resolved to '{1}'. ========"), + Module_name_0_was_not_resolved: diag(6090, 3, "Module_name_0_was_not_resolved_6090", "======== Module name '{0}' was not resolved. ========"), + paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: diag(6091, 3, "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091", "'paths' option is specified, looking for a pattern to match module name '{0}'."), + Module_name_0_matched_pattern_1: diag(6092, 3, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."), + Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, 3, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."), + Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), + Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1: diag(6095, 3, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1_6095", "Loading module as file / folder, candidate module location '{0}', target file types: {1}."), + File_0_does_not_exist: diag(6096, 3, "File_0_does_not_exist_6096", "File '{0}' does not exist."), + File_0_exists_use_it_as_a_name_resolution_result: diag(6097, 3, "File_0_exists_use_it_as_a_name_resolution_result_6097", "File '{0}' exists - use it as a name resolution result."), + Loading_module_0_from_node_modules_folder_target_file_types_Colon_1: diag(6098, 3, "Loading_module_0_from_node_modules_folder_target_file_types_Colon_1_6098", "Loading module '{0}' from 'node_modules' folder, target file types: {1}."), + Found_package_json_at_0: diag(6099, 3, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), + package_json_does_not_have_a_0_field: diag(6100, 3, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), + package_json_has_0_field_1_that_references_2: diag(6101, 3, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."), + Allow_javascript_files_to_be_compiled: diag(6102, 3, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."), + Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, 3, "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."), + Expected_type_of_0_field_in_package_json_to_be_1_got_2: diag(6105, 3, "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105", "Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."), + baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: diag(6106, 3, "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."), + rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: diag(6107, 3, "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", "'rootDirs' option is set, using it to resolve relative module name '{0}'."), + Longest_matching_prefix_for_0_is_1: diag(6108, 3, "Longest_matching_prefix_for_0_is_1_6108", "Longest matching prefix for '{0}' is '{1}'."), + Loading_0_from_the_root_dir_1_candidate_location_2: diag(6109, 3, "Loading_0_from_the_root_dir_1_candidate_location_2_6109", "Loading '{0}' from the root dir '{1}', candidate location '{2}'."), + Trying_other_entries_in_rootDirs: diag(6110, 3, "Trying_other_entries_in_rootDirs_6110", "Trying other entries in 'rootDirs'."), + Module_resolution_using_rootDirs_has_failed: diag(6111, 3, "Module_resolution_using_rootDirs_has_failed_6111", "Module resolution using 'rootDirs' has failed."), + Do_not_emit_use_strict_directives_in_module_output: diag(6112, 3, "Do_not_emit_use_strict_directives_in_module_output_6112", "Do not emit 'use strict' directives in module output."), + Enable_strict_null_checks: diag(6113, 3, "Enable_strict_null_checks_6113", "Enable strict null checks."), + Unknown_option_excludes_Did_you_mean_exclude: diag(6114, 1, "Unknown_option_excludes_Did_you_mean_exclude_6114", "Unknown option 'excludes'. Did you mean 'exclude'?"), + Raise_error_on_this_expressions_with_an_implied_any_type: diag(6115, 3, "Raise_error_on_this_expressions_with_an_implied_any_type_6115", "Raise error on 'this' expressions with an implied 'any' type."), + Resolving_type_reference_directive_0_containing_file_1_root_directory_2: diag(6116, 3, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"), + Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, 3, "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"), + Type_reference_directive_0_was_not_resolved: diag(6120, 3, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"), + Resolving_with_primary_search_path_0: diag(6121, 3, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."), + Root_directory_cannot_be_determined_skipping_primary_search_paths: diag(6122, 3, "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", "Root directory cannot be determined, skipping primary search paths."), + Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: diag(6123, 3, "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"), + Type_declaration_files_to_be_included_in_compilation: diag(6124, 3, "Type_declaration_files_to_be_included_in_compilation_6124", "Type declaration files to be included in compilation."), + Looking_up_in_node_modules_folder_initial_location_0: diag(6125, 3, "Looking_up_in_node_modules_folder_initial_location_0_6125", "Looking up in 'node_modules' folder, initial location '{0}'."), + Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: diag(6126, 3, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."), + Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: diag(6127, 3, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"), + Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: diag(6128, 3, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"), + Resolving_real_path_for_0_result_1: diag(6130, 3, "Resolving_real_path_for_0_result_1_6130", "Resolving real path for '{0}', result '{1}'."), + Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: diag(6131, 1, "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."), + File_name_0_has_a_1_extension_stripping_it: diag(6132, 3, "File_name_0_has_a_1_extension_stripping_it_6132", "File name '{0}' has a '{1}' extension - stripping it."), + _0_is_declared_but_its_value_is_never_read: diag( + 6133, + 1, + "_0_is_declared_but_its_value_is_never_read_6133", + "'{0}' is declared but its value is never read.", + /*reportsUnnecessary*/ + true + ), + Report_errors_on_unused_locals: diag(6134, 3, "Report_errors_on_unused_locals_6134", "Report errors on unused locals."), + Report_errors_on_unused_parameters: diag(6135, 3, "Report_errors_on_unused_parameters_6135", "Report errors on unused parameters."), + The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: diag(6136, 3, "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", "The maximum dependency depth to search under node_modules and load JavaScript files."), + Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: diag(6137, 1, "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137", "Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."), + Property_0_is_declared_but_its_value_is_never_read: diag( + 6138, + 1, + "Property_0_is_declared_but_its_value_is_never_read_6138", + "Property '{0}' is declared but its value is never read.", + /*reportsUnnecessary*/ + true + ), + Import_emit_helpers_from_tslib: diag(6139, 3, "Import_emit_helpers_from_tslib_6139", "Import emit helpers from 'tslib'."), + Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: diag(6140, 1, "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."), + Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: diag(6141, 3, "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", 'Parse in strict mode and emit "use strict" for each source file.'), + Module_0_was_resolved_to_1_but_jsx_is_not_set: diag(6142, 1, "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", "Module '{0}' was resolved to '{1}', but '--jsx' is not set."), + Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, 3, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), + Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, 3, "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."), + Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, 3, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), + Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, 3, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), + Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, 3, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), + Show_diagnostic_information: diag(6149, 3, "Show_diagnostic_information_6149", "Show diagnostic information."), + Show_verbose_diagnostic_information: diag(6150, 3, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), + Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: diag(6151, 3, "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", "Emit a single file with source maps instead of having a separate file."), + Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: diag(6152, 3, "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."), + Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: diag(6153, 3, "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", "Transpile each file as a separate module (similar to 'ts.transpileModule')."), + Print_names_of_generated_files_part_of_the_compilation: diag(6154, 3, "Print_names_of_generated_files_part_of_the_compilation_6154", "Print names of generated files part of the compilation."), + Print_names_of_files_part_of_the_compilation: diag(6155, 3, "Print_names_of_files_part_of_the_compilation_6155", "Print names of files part of the compilation."), + The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: diag(6156, 3, "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", "The locale used when displaying messages to the user (e.g. 'en-us')"), + Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: diag(6157, 3, "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", "Do not generate custom helper functions like '__extends' in compiled output."), + Do_not_include_the_default_library_file_lib_d_ts: diag(6158, 3, "Do_not_include_the_default_library_file_lib_d_ts_6158", "Do not include the default library file (lib.d.ts)."), + Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: diag(6159, 3, "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", "Do not add triple-slash references or imported modules to the list of compiled files."), + Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: diag(6160, 3, "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."), + List_of_folders_to_include_type_definitions_from: diag(6161, 3, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."), + Disable_size_limitations_on_JavaScript_projects: diag(6162, 3, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."), + The_character_set_of_the_input_files: diag(6163, 3, "The_character_set_of_the_input_files_6163", "The character set of the input files."), + Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1: diag(6164, 3, "Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1_6164", "Skipping module '{0}' that looks like an absolute URI, target file types: {1}."), + Do_not_truncate_error_messages: diag(6165, 3, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."), + Output_directory_for_generated_declaration_files: diag(6166, 3, "Output_directory_for_generated_declaration_files_6166", "Output directory for generated declaration files."), + A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: diag(6167, 3, "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."), + List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: diag(6168, 3, "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", "List of root folders whose combined content represents the structure of the project at runtime."), + Show_all_compiler_options: diag(6169, 3, "Show_all_compiler_options_6169", "Show all compiler options."), + Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, 3, "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"), + Command_line_Options: diag(6171, 3, "Command_line_Options_6171", "Command-line Options"), + Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, 3, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."), + Enable_all_strict_type_checking_options: diag(6180, 3, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."), + Scoped_package_detected_looking_in_0: diag(6182, 3, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), + Enable_strict_checking_of_function_types: diag(6186, 3, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), + Enable_strict_checking_of_property_initialization_in_classes: diag(6187, 3, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, 1, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, 1, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, 3, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), + All_imports_in_import_declaration_are_unused: diag( + 6192, + 1, + "All_imports_in_import_declaration_are_unused_6192", + "All imports in import declaration are unused.", + /*reportsUnnecessary*/ + true + ), + Found_1_error_Watching_for_file_changes: diag(6193, 3, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."), + Found_0_errors_Watching_for_file_changes: diag(6194, 3, "Found_0_errors_Watching_for_file_changes_6194", "Found {0} errors. Watching for file changes."), + Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: diag(6195, 3, "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195", "Resolve 'keyof' to string valued property names only (no numbers or symbols)."), + _0_is_declared_but_never_used: diag( + 6196, + 1, + "_0_is_declared_but_never_used_6196", + "'{0}' is declared but never used.", + /*reportsUnnecessary*/ + true + ), + Include_modules_imported_with_json_extension: diag(6197, 3, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"), + All_destructured_elements_are_unused: diag( + 6198, + 1, + "All_destructured_elements_are_unused_6198", + "All destructured elements are unused.", + /*reportsUnnecessary*/ + true + ), + All_variables_are_unused: diag( + 6199, + 1, + "All_variables_are_unused_6199", + "All variables are unused.", + /*reportsUnnecessary*/ + true + ), + Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, 1, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"), + Conflicts_are_in_this_file: diag(6201, 3, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."), + Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, 1, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), + _0_was_also_declared_here: diag(6203, 3, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), + and_here: diag(6204, 3, "and_here_6204", "and here."), + All_type_parameters_are_unused: diag(6205, 1, "All_type_parameters_are_unused_6205", "All type parameters are unused."), + package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, 3, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), + package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, 3, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), + package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, 3, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), + package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: diag(6209, 3, "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209", "'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."), + An_argument_for_0_was_not_provided: diag(6210, 3, "An_argument_for_0_was_not_provided_6210", "An argument for '{0}' was not provided."), + An_argument_matching_this_binding_pattern_was_not_provided: diag(6211, 3, "An_argument_matching_this_binding_pattern_was_not_provided_6211", "An argument matching this binding pattern was not provided."), + Did_you_mean_to_call_this_expression: diag(6212, 3, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"), + Did_you_mean_to_use_new_with_this_expression: diag(6213, 3, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"), + Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, 3, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."), + Using_compiler_options_of_project_reference_redirect_0: diag(6215, 3, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."), + Found_1_error: diag(6216, 3, "Found_1_error_6216", "Found 1 error."), + Found_0_errors: diag(6217, 3, "Found_0_errors_6217", "Found {0} errors."), + Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, 3, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"), + Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, 3, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"), + package_json_had_a_falsy_0_field: diag(6220, 3, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."), + Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: diag(6221, 3, "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221", "Disable use of source files instead of declaration files from referenced projects."), + Emit_class_fields_with_Define_instead_of_Set: diag(6222, 3, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."), + Generates_a_CPU_profile: diag(6223, 3, "Generates_a_CPU_profile_6223", "Generates a CPU profile."), + Disable_solution_searching_for_this_project: diag(6224, 3, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."), + Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, 3, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."), + Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling: diag(6226, 3, "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226", "Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."), + Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize: diag(6227, 3, "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227", "Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."), + Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: diag(6229, 1, "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229", "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."), + Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: diag(6230, 1, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."), + Could_not_resolve_the_path_0_with_the_extensions_Colon_1: diag(6231, 1, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."), + Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: diag(6232, 1, "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232", "Declaration augments declaration in another file. This cannot be serialized."), + This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: diag(6233, 1, "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233", "This is the declaration being augmented. Consider moving the augmenting declaration into the same file."), + This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, 1, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), + Disable_loading_referenced_projects: diag(6235, 3, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), + Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, 1, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), + Generates_an_event_trace_and_a_list_of_types: diag(6237, 3, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), + Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, 1, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"), + File_0_exists_according_to_earlier_cached_lookups: diag(6239, 3, "File_0_exists_according_to_earlier_cached_lookups_6239", "File '{0}' exists according to earlier cached lookups."), + File_0_does_not_exist_according_to_earlier_cached_lookups: diag(6240, 3, "File_0_does_not_exist_according_to_earlier_cached_lookups_6240", "File '{0}' does not exist according to earlier cached lookups."), + Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1: diag(6241, 3, "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241", "Resolution for type reference directive '{0}' was found in cache from location '{1}'."), + Resolving_type_reference_directive_0_containing_file_1: diag(6242, 3, "Resolving_type_reference_directive_0_containing_file_1_6242", "======== Resolving type reference directive '{0}', containing file '{1}'. ========"), + Interpret_optional_property_types_as_written_rather_than_adding_undefined: diag(6243, 3, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."), + Modules: diag(6244, 3, "Modules_6244", "Modules"), + File_Management: diag(6245, 3, "File_Management_6245", "File Management"), + Emit: diag(6246, 3, "Emit_6246", "Emit"), + JavaScript_Support: diag(6247, 3, "JavaScript_Support_6247", "JavaScript Support"), + Type_Checking: diag(6248, 3, "Type_Checking_6248", "Type Checking"), + Editor_Support: diag(6249, 3, "Editor_Support_6249", "Editor Support"), + Watch_and_Build_Modes: diag(6250, 3, "Watch_and_Build_Modes_6250", "Watch and Build Modes"), + Compiler_Diagnostics: diag(6251, 3, "Compiler_Diagnostics_6251", "Compiler Diagnostics"), + Interop_Constraints: diag(6252, 3, "Interop_Constraints_6252", "Interop Constraints"), + Backwards_Compatibility: diag(6253, 3, "Backwards_Compatibility_6253", "Backwards Compatibility"), + Language_and_Environment: diag(6254, 3, "Language_and_Environment_6254", "Language and Environment"), + Projects: diag(6255, 3, "Projects_6255", "Projects"), + Output_Formatting: diag(6256, 3, "Output_Formatting_6256", "Output Formatting"), + Completeness: diag(6257, 3, "Completeness_6257", "Completeness"), + _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, 1, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"), + Found_1_error_in_0: diag(6259, 3, "Found_1_error_in_0_6259", "Found 1 error in {0}"), + Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, 3, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"), + Found_0_errors_in_1_files: diag(6261, 3, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."), + File_name_0_has_a_1_extension_looking_up_2_instead: diag(6262, 3, "File_name_0_has_a_1_extension_looking_up_2_instead_6262", "File name '{0}' has a '{1}' extension - looking up '{2}' instead."), + Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set: diag(6263, 1, "Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set_6263", "Module '{0}' was resolved to '{1}', but '--allowArbitraryExtensions' is not set."), + Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present: diag(6264, 3, "Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present_6264", "Enable importing files with any extension, provided a declaration file is present."), + Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder: diag(6265, 3, "Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_no_6265", "Resolving type reference directive for program that specifies custom typeRoots, skipping lookup in 'node_modules' folder."), + Option_0_can_only_be_specified_on_command_line: diag(6266, 1, "Option_0_can_only_be_specified_on_command_line_6266", "Option '{0}' can only be specified on command line."), + Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, 3, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."), + Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, 3, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."), + Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, 3, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."), + package_json_scope_0_has_no_imports_defined: diag(6273, 3, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."), + package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), + package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), + Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), + Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`), + Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update: diag(6279, 3, "Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_ne_6279", "Resolution of non-relative name failed; trying with '--moduleResolution bundler' to see if project may need configuration update."), + There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler: diag(6280, 3, "There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setti_6280", "There are types at '{0}', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'."), + Enable_project_compilation: diag(6302, 3, "Enable_project_compilation_6302", "Enable project compilation"), + Composite_projects_may_not_disable_declaration_emit: diag(6304, 1, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), + Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), + Referenced_project_0_must_have_setting_composite_Colon_true: diag(6306, 1, "Referenced_project_0_must_have_setting_composite_Colon_true_6306", `Referenced project '{0}' must have setting "composite": true.`), + File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: diag(6307, 1, "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307", "File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."), + Cannot_prepend_project_0_because_it_does_not_have_outFile_set: diag(6308, 1, "Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308", "Cannot prepend project '{0}' because it does not have 'outFile' set"), + Output_file_0_from_project_1_does_not_exist: diag(6309, 1, "Output_file_0_from_project_1_does_not_exist_6309", "Output file '{0}' from project '{1}' does not exist"), + Referenced_project_0_may_not_disable_emit: diag(6310, 1, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."), + Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, 3, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"), + Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, 3, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"), + Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, 3, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"), + Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, 3, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"), + Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, 3, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"), + Projects_in_this_build_Colon_0: diag(6355, 3, "Projects_in_this_build_Colon_0_6355", "Projects in this build: {0}"), + A_non_dry_build_would_delete_the_following_files_Colon_0: diag(6356, 3, "A_non_dry_build_would_delete_the_following_files_Colon_0_6356", "A non-dry build would delete the following files: {0}"), + A_non_dry_build_would_build_project_0: diag(6357, 3, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"), + Building_project_0: diag(6358, 3, "Building_project_0_6358", "Building project '{0}'..."), + Updating_output_timestamps_of_project_0: diag(6359, 3, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."), + Project_0_is_up_to_date: diag(6361, 3, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"), + Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, 3, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"), + Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, 3, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"), + Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, 3, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"), + Delete_the_outputs_of_all_projects: diag(6365, 3, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."), + Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, 3, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"), + Option_build_must_be_the_first_command_line_argument: diag(6369, 1, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), + Options_0_and_1_cannot_be_combined: diag(6370, 1, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), + Updating_unchanged_output_timestamps_of_project_0: diag(6371, 3, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), + Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed: diag(6372, 3, "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372", "Project '{0}' is out of date because output of its dependency '{1}' has changed"), + Updating_output_of_project_0: diag(6373, 3, "Updating_output_of_project_0_6373", "Updating output of project '{0}'..."), + A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, 3, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"), + A_non_dry_build_would_update_output_of_project_0: diag(6375, 3, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"), + Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, 3, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"), + Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, 1, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"), + Composite_projects_may_not_disable_incremental_compilation: diag(6379, 1, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."), + Specify_file_to_store_incremental_compilation_information: diag(6380, 3, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"), + Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, 3, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"), + Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, 3, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"), + Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, 3, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), + Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, 3, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), + _0_is_deprecated: diag( + 6385, + 2, + "_0_is_deprecated_6385", + "'{0}' is deprecated.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + void 0, + /*reportsDeprecated*/ + true + ), + Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, 3, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), + The_signature_0_of_1_is_deprecated: diag( + 6387, + 2, + "The_signature_0_of_1_is_deprecated_6387", + "The signature '{0}' of '{1}' is deprecated.", + /*reportsUnnecessary*/ + void 0, + /*elidedInCompatabilityPyramid*/ + void 0, + /*reportsDeprecated*/ + true + ), + Project_0_is_being_forcibly_rebuilt: diag(6388, 3, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"), + Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: diag(6389, 3, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6390, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6391, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved: diag(6392, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6393, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6394, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), + Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6395, 3, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6396, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6397, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), + Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, 3, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"), + Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, 3, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"), + Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, 3, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"), + Resolving_in_0_mode_with_conditions_1: diag(6402, 3, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."), + Matched_0_condition_1: diag(6403, 3, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."), + Using_0_subpath_1_with_target_2: diag(6404, 3, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."), + Saw_non_matching_condition_0: diag(6405, 3, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions: diag(6406, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406", "Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"), + Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set: diag(6407, 3, "Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407", "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."), + Use_the_package_json_exports_field_when_resolving_package_imports: diag(6408, 3, "Use_the_package_json_exports_field_when_resolving_package_imports_6408", "Use the package.json 'exports' field when resolving package imports."), + Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."), + Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."), + true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."), + Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."), + Entering_conditional_exports: diag(6413, 3, "Entering_conditional_exports_6413", "Entering conditional exports."), + Resolved_under_condition_0: diag(6414, 3, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."), + Failed_to_resolve_under_condition_0: diag(6415, 3, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."), + Exiting_conditional_exports: diag(6416, 3, "Exiting_conditional_exports_6416", "Exiting conditional exports."), + Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."), + Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."), + The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), + The_expected_type_comes_from_this_index_signature: diag(6501, 3, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), + The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), + Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, 3, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), + File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), + Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), + Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), + Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, 3, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."), + Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), + Allow_accessing_UMD_globals_from_modules: diag(6602, 3, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), + Disable_error_reporting_for_unreachable_code: diag(6603, 3, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), + Disable_error_reporting_for_unused_labels: diag(6604, 3, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."), + Ensure_use_strict_is_always_emitted: diag(6605, 3, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."), + Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, 3, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."), + Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, 3, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."), + No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, 3, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."), + Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, 3, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."), + Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references: diag(6611, 3, "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611", "Enable constraints that allow a TypeScript project to be used with project references."), + Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project: diag(6612, 3, "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612", "Generate .d.ts files from TypeScript and JavaScript files in your project."), + Specify_the_output_directory_for_generated_declaration_files: diag(6613, 3, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."), + Create_sourcemaps_for_d_ts_files: diag(6614, 3, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."), + Output_compiler_performance_information_after_building: diag(6615, 3, "Output_compiler_performance_information_after_building_6615", "Output compiler performance information after building."), + Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project: diag(6616, 3, "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616", "Disables inference for type acquisition by looking at filenames in a project."), + Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, 3, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."), + Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, 3, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."), + Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, 3, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."), + Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, 3, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."), + Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, 3, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."), + Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, 3, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."), + Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, 3, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."), + Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, 3, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."), + Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, 3, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"), + Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, 3, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."), + Filters_results_from_the_include_option: diag(6627, 3, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), + Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), + Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), + Enable_experimental_support_for_legacy_experimental_decorators: diag(6630, 3, "Enable_experimental_support_for_legacy_experimental_decorators_6630", "Enable experimental support for legacy experimental decorators."), + Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), + Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), + Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), + Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, 3, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."), + Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, 3, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."), + Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, 3, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."), + Ensure_that_casing_is_correct_in_imports: diag(6637, 3, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."), + Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, 3, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."), + Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, 3, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."), + Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: diag(6641, 3, "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641", "Specify a list of glob patterns that match files to be included in compilation."), + Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects: diag(6642, 3, "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642", "Save .tsbuildinfo files to allow for incremental compilation of projects."), + Include_sourcemap_files_inside_the_emitted_JavaScript: diag(6643, 3, "Include_sourcemap_files_inside_the_emitted_JavaScript_6643", "Include sourcemap files inside the emitted JavaScript."), + Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, 3, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."), + Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, 3, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."), + Specify_what_JSX_code_is_generated: diag(6646, 3, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."), + Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, 3, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."), + Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, 3, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."), + Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, 3, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."), + Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, 3, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."), + Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, 3, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."), + Print_the_names_of_emitted_files_after_a_compilation: diag(6652, 3, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."), + Print_all_of_the_files_read_during_the_compilation: diag(6653, 3, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."), + Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, 3, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."), + Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, 3, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."), + Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, 3, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."), + Specify_what_module_code_is_generated: diag(6657, 3, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."), + Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, 3, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."), + Set_the_newline_character_for_emitting_files: diag(6659, 3, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."), + Disable_emitting_files_from_a_compilation: diag(6660, 3, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."), + Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, 3, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."), + Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, 3, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."), + Disable_truncating_types_in_error_messages: diag(6663, 3, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."), + Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, 3, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."), + Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, 3, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."), + Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, 3, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."), + Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, 3, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."), + Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, 3, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."), + Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, 3, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."), + Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, 3, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."), + Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, 3, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."), + Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, 3, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project."), + Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, 3, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."), + Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, 3, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."), + Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, 3, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."), + Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, 3, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."), + Deprecated_setting_Use_outFile_instead: diag(6677, 3, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."), + Specify_an_output_folder_for_all_emitted_files: diag(6678, 3, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."), + Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, 3, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."), + Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, 3, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."), + Specify_a_list_of_language_service_plugins_to_include: diag(6681, 3, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."), + Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, 3, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."), + Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, 3, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."), + Disable_wiping_the_console_in_watch_mode: diag(6684, 3, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."), + Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, 3, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."), + Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, 3, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."), + Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, 3, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."), + Disable_emitting_comments: diag(6688, 3, "Disable_emitting_comments_6688", "Disable emitting comments."), + Enable_importing_json_files: diag(6689, 3, "Enable_importing_json_files_6689", "Enable importing .json files."), + Specify_the_root_folder_within_your_source_files: diag(6690, 3, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."), + Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, 3, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."), + Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, 3, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."), + Skip_type_checking_all_d_ts_files: diag(6693, 3, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."), + Create_source_map_files_for_emitted_JavaScript_files: diag(6694, 3, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."), + Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, 3, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."), + Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, 3, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."), + When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, 3, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."), + When_type_checking_take_into_account_null_and_undefined: diag(6699, 3, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."), + Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, 3, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."), + Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, 3, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."), + Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, 3, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."), + Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, 3, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."), + Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, 3, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."), + Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, 3, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."), + Log_paths_used_during_the_moduleResolution_process: diag(6706, 3, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."), + Specify_the_path_to_tsbuildinfo_incremental_compilation_file: diag(6707, 3, "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707", "Specify the path to .tsbuildinfo incremental compilation file."), + Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, 3, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."), + Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, 3, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."), + Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, 3, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."), + Emit_ECMAScript_standard_compliant_class_fields: diag(6712, 3, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."), + Enable_verbose_logging: diag(6713, 3, "Enable_verbose_logging_6713", "Enable verbose logging."), + Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, 3, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."), + Specify_how_the_TypeScript_watch_mode_works: diag(6715, 3, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."), + Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), + Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), + Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), + Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."), + one_of_Colon: diag(6900, 3, "one_of_Colon_6900", "one of:"), + one_or_more_Colon: diag(6901, 3, "one_or_more_Colon_6901", "one or more:"), + type_Colon: diag(6902, 3, "type_Colon_6902", "type:"), + default_Colon: diag(6903, 3, "default_Colon_6903", "default:"), + module_system_or_esModuleInterop: diag(6904, 3, "module_system_or_esModuleInterop_6904", 'module === "system" or esModuleInterop'), + false_unless_strict_is_set: diag(6905, 3, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"), + false_unless_composite_is_set: diag(6906, 3, "false_unless_composite_is_set_6906", "`false`, unless `composite` is set"), + node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified: diag(6907, 3, "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907", '`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'), + if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk: diag(6908, 3, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", '`[]` if `files` is specified, otherwise `["**/*"]`'), + true_if_composite_false_otherwise: diag(6909, 3, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"), + module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: diag(69010, 3, "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010", "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"), + Computed_from_the_list_of_input_files: diag(6911, 3, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"), + Platform_specific: diag(6912, 3, "Platform_specific_6912", "Platform specific"), + You_can_learn_about_all_of_the_compiler_options_at_0: diag(6913, 3, "You_can_learn_about_all_of_the_compiler_options_at_0_6913", "You can learn about all of the compiler options at {0}"), + Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon: diag(6914, 3, "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914", "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"), + Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0: diag(6915, 3, "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915", "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"), + COMMON_COMMANDS: diag(6916, 3, "COMMON_COMMANDS_6916", "COMMON COMMANDS"), + ALL_COMPILER_OPTIONS: diag(6917, 3, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"), + WATCH_OPTIONS: diag(6918, 3, "WATCH_OPTIONS_6918", "WATCH OPTIONS"), + BUILD_OPTIONS: diag(6919, 3, "BUILD_OPTIONS_6919", "BUILD OPTIONS"), + COMMON_COMPILER_OPTIONS: diag(6920, 3, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"), + COMMAND_LINE_FLAGS: diag(6921, 3, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"), + tsc_Colon_The_TypeScript_Compiler: diag(6922, 3, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"), + Compiles_the_current_project_tsconfig_json_in_the_working_directory: diag(6923, 3, "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923", "Compiles the current project (tsconfig.json in the working directory.)"), + Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options: diag(6924, 3, "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924", "Ignoring tsconfig.json, compiles the specified files with default compiler options."), + Build_a_composite_project_in_the_working_directory: diag(6925, 3, "Build_a_composite_project_in_the_working_directory_6925", "Build a composite project in the working directory."), + Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory: diag(6926, 3, "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926", "Creates a tsconfig.json with the recommended settings in the working directory."), + Compiles_the_TypeScript_project_located_at_the_specified_path: diag(6927, 3, "Compiles_the_TypeScript_project_located_at_the_specified_path_6927", "Compiles the TypeScript project located at the specified path."), + An_expanded_version_of_this_information_showing_all_possible_compiler_options: diag(6928, 3, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"), + Compiles_the_current_project_with_additional_settings: diag(6929, 3, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."), + true_for_ES2022_and_above_including_ESNext: diag(6930, 3, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."), + List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."), + Variable_0_implicitly_has_an_1_type: diag(7005, 1, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), + Parameter_0_implicitly_has_an_1_type: diag(7006, 1, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), + Member_0_implicitly_has_an_1_type: diag(7008, 1, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), + new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), + _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), + Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), + This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation: diag(7012, 1, "This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation_7012", "This overload implicitly returns the type '{0}' because it lacks a return type annotation."), + Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), + Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), + Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), + Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, 1, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."), + Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, 1, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."), + Object_literal_s_property_0_implicitly_has_an_1_type: diag(7018, 1, "Object_literal_s_property_0_implicitly_has_an_1_type_7018", "Object literal's property '{0}' implicitly has an '{1}' type."), + Rest_parameter_0_implicitly_has_an_any_type: diag(7019, 1, "Rest_parameter_0_implicitly_has_an_any_type_7019", "Rest parameter '{0}' implicitly has an 'any[]' type."), + Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7020, 1, "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020", "Call signature, which lacks return-type annotation, implicitly has an 'any' return type."), + _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: diag(7022, 1, "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022", "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."), + _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7023, 1, "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), + Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7024, 1, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), + Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation: diag(7025, 1, "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025", "Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."), + JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, 1, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."), + Unreachable_code_detected: diag( + 7027, + 1, + "Unreachable_code_detected_7027", + "Unreachable code detected.", + /*reportsUnnecessary*/ + true + ), + Unused_label: diag( + 7028, + 1, + "Unused_label_7028", + "Unused label.", + /*reportsUnnecessary*/ + true + ), + Fallthrough_case_in_switch: diag(7029, 1, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."), + Not_all_code_paths_return_a_value: diag(7030, 1, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."), + Binding_element_0_implicitly_has_an_1_type: diag(7031, 1, "Binding_element_0_implicitly_has_an_1_type_7031", "Binding element '{0}' implicitly has an '{1}' type."), + Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, 1, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), + Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, 1, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), + Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, 1, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), + Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, 1, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), + Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, 1, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, 3, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, 3, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, 1, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), + If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, 1, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"), + The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, 1, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."), + Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, 1, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."), + Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, 2, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, 2, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, 2, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), + Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, 2, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."), + Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, 2, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."), + Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, 2, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), + Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, 2, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), + _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, 2, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), + Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, 1, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), + Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, 1, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"), + Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, 1, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), + No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, 1, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), + _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, 1, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), + The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, 1, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), + yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, 1, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."), + If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: diag(7058, 1, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"), + This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, 1, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."), + This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, 1, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."), + A_mapped_type_may_not_declare_properties_or_methods: diag(7061, 1, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."), + You_cannot_rename_this_element: diag(8e3, 1, "You_cannot_rename_this_element_8000", "You cannot rename this element."), + You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, 1, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), + import_can_only_be_used_in_TypeScript_files: diag(8002, 1, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), + export_can_only_be_used_in_TypeScript_files: diag(8003, 1, "export_can_only_be_used_in_TypeScript_files_8003", "'export =' can only be used in TypeScript files."), + Type_parameter_declarations_can_only_be_used_in_TypeScript_files: diag(8004, 1, "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004", "Type parameter declarations can only be used in TypeScript files."), + implements_clauses_can_only_be_used_in_TypeScript_files: diag(8005, 1, "implements_clauses_can_only_be_used_in_TypeScript_files_8005", "'implements' clauses can only be used in TypeScript files."), + _0_declarations_can_only_be_used_in_TypeScript_files: diag(8006, 1, "_0_declarations_can_only_be_used_in_TypeScript_files_8006", "'{0}' declarations can only be used in TypeScript files."), + Type_aliases_can_only_be_used_in_TypeScript_files: diag(8008, 1, "Type_aliases_can_only_be_used_in_TypeScript_files_8008", "Type aliases can only be used in TypeScript files."), + The_0_modifier_can_only_be_used_in_TypeScript_files: diag(8009, 1, "The_0_modifier_can_only_be_used_in_TypeScript_files_8009", "The '{0}' modifier can only be used in TypeScript files."), + Type_annotations_can_only_be_used_in_TypeScript_files: diag(8010, 1, "Type_annotations_can_only_be_used_in_TypeScript_files_8010", "Type annotations can only be used in TypeScript files."), + Type_arguments_can_only_be_used_in_TypeScript_files: diag(8011, 1, "Type_arguments_can_only_be_used_in_TypeScript_files_8011", "Type arguments can only be used in TypeScript files."), + Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."), + Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."), + Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."), + Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."), + Report_errors_in_js_files: diag(8019, 3, "Report_errors_in_js_files_8019", "Report errors in .js files."), + JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."), + JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."), + JSDoc_0_is_not_attached_to_a_class: diag(8022, 1, "JSDoc_0_is_not_attached_to_a_class_8022", "JSDoc '@{0}' is not attached to a class."), + JSDoc_0_1_does_not_match_the_extends_2_clause: diag(8023, 1, "JSDoc_0_1_does_not_match_the_extends_2_clause_8023", "JSDoc '@{0} {1}' does not match the 'extends {2}' clause."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: diag(8024, 1, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name."), + Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, 1, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one '@augments' or '@extends' tag."), + Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, 1, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), + Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, 1, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), + JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, 1, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, 1, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), + The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, 1, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), + You_cannot_rename_a_module_via_a_global_import: diag(8031, 1, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), + Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, 1, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), + A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, 1, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."), + The_tag_was_first_specified_here: diag(8034, 1, "The_tag_was_first_specified_here_8034", "The tag was first specified here."), + You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), + You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), + Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), + Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."), + A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"), + Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), + Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), + JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), + JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, 1, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."), + Expected_corresponding_JSX_closing_tag_for_0: diag(17002, 1, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."), + Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, 1, "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", "Cannot use JSX unless the '--jsx' flag is provided."), + A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: diag(17005, 1, "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", "A constructor cannot contain a 'super' call when its class extends 'null'."), + An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17006, 1, "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), + A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17007, 1, "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), + JSX_element_0_has_no_corresponding_closing_tag: diag(17008, 1, "JSX_element_0_has_no_corresponding_closing_tag_17008", "JSX element '{0}' has no corresponding closing tag."), + super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: diag(17009, 1, "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", "'super' must be called before accessing 'this' in the constructor of a derived class."), + Unknown_type_acquisition_option_0: diag(17010, 1, "Unknown_type_acquisition_option_0_17010", "Unknown type acquisition option '{0}'."), + super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: diag(17011, 1, "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", "'super' must be called before accessing a property of 'super' in the constructor of a derived class."), + _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: diag(17012, 1, "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"), + Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: diag(17013, 1, "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."), + JSX_fragment_has_no_corresponding_closing_tag: diag(17014, 1, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), + Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, 1, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), + The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: diag(17016, 1, "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016", "The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."), + An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, 1, "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017", "An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."), + Unknown_type_acquisition_option_0_Did_you_mean_1: diag(17018, 1, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"), + _0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: diag(17019, 1, "_0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17019", "'{0}' at the end of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"), + _0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1: diag(17020, 1, "_0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1_17020", "'{0}' at the start of a type is not valid TypeScript syntax. Did you mean to write '{1}'?"), + Unicode_escape_sequence_cannot_appear_here: diag(17021, 1, "Unicode_escape_sequence_cannot_appear_here_17021", "Unicode escape sequence cannot appear here."), + Circularity_detected_while_resolving_configuration_Colon_0: diag(18e3, 1, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), + The_files_list_in_config_file_0_is_empty: diag(18002, 1, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), + No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, 1, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), + File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, 2, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."), + This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, 2, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), + Import_may_be_converted_to_a_default_import: diag(80003, 2, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), + JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, 2, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), + require_call_may_be_converted_to_an_import: diag(80005, 2, "require_call_may_be_converted_to_an_import_80005", "'require' call may be converted to an import."), + This_may_be_converted_to_an_async_function: diag(80006, 2, "This_may_be_converted_to_an_async_function_80006", "This may be converted to an async function."), + await_has_no_effect_on_the_type_of_this_expression: diag(80007, 2, "await_has_no_effect_on_the_type_of_this_expression_80007", "'await' has no effect on the type of this expression."), + Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: diag(80008, 2, "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008", "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."), + JSDoc_typedef_may_be_converted_to_TypeScript_type: diag(80009, 2, "JSDoc_typedef_may_be_converted_to_TypeScript_type_80009", "JSDoc typedef may be converted to TypeScript type."), + JSDoc_typedefs_may_be_converted_to_TypeScript_types: diag(80010, 2, "JSDoc_typedefs_may_be_converted_to_TypeScript_types_80010", "JSDoc typedefs may be converted to TypeScript types."), + Add_missing_super_call: diag(90001, 3, "Add_missing_super_call_90001", "Add missing 'super()' call"), + Make_super_call_the_first_statement_in_the_constructor: diag(90002, 3, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), + Change_extends_to_implements: diag(90003, 3, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), + Remove_unused_declaration_for_Colon_0: diag(90004, 3, "Remove_unused_declaration_for_Colon_0_90004", "Remove unused declaration for: '{0}'"), + Remove_import_from_0: diag(90005, 3, "Remove_import_from_0_90005", "Remove import from '{0}'"), + Implement_interface_0: diag(90006, 3, "Implement_interface_0_90006", "Implement interface '{0}'"), + Implement_inherited_abstract_class: diag(90007, 3, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), + Add_0_to_unresolved_variable: diag(90008, 3, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"), + Remove_variable_statement: diag(90010, 3, "Remove_variable_statement_90010", "Remove variable statement"), + Remove_template_tag: diag(90011, 3, "Remove_template_tag_90011", "Remove template tag"), + Remove_type_parameters: diag(90012, 3, "Remove_type_parameters_90012", "Remove type parameters"), + Import_0_from_1: diag(90013, 3, "Import_0_from_1_90013", `Import '{0}' from "{1}"`), + Change_0_to_1: diag(90014, 3, "Change_0_to_1_90014", "Change '{0}' to '{1}'"), + Declare_property_0: diag(90016, 3, "Declare_property_0_90016", "Declare property '{0}'"), + Add_index_signature_for_property_0: diag(90017, 3, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"), + Disable_checking_for_this_file: diag(90018, 3, "Disable_checking_for_this_file_90018", "Disable checking for this file"), + Ignore_this_error_message: diag(90019, 3, "Ignore_this_error_message_90019", "Ignore this error message"), + Initialize_property_0_in_the_constructor: diag(90020, 3, "Initialize_property_0_in_the_constructor_90020", "Initialize property '{0}' in the constructor"), + Initialize_static_property_0: diag(90021, 3, "Initialize_static_property_0_90021", "Initialize static property '{0}'"), + Change_spelling_to_0: diag(90022, 3, "Change_spelling_to_0_90022", "Change spelling to '{0}'"), + Declare_method_0: diag(90023, 3, "Declare_method_0_90023", "Declare method '{0}'"), + Declare_static_method_0: diag(90024, 3, "Declare_static_method_0_90024", "Declare static method '{0}'"), + Prefix_0_with_an_underscore: diag(90025, 3, "Prefix_0_with_an_underscore_90025", "Prefix '{0}' with an underscore"), + Rewrite_as_the_indexed_access_type_0: diag(90026, 3, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), + Declare_static_property_0: diag(90027, 3, "Declare_static_property_0_90027", "Declare static property '{0}'"), + Call_decorator_expression: diag(90028, 3, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, 3, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), + Replace_infer_0_with_unknown: diag(90030, 3, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"), + Replace_all_unused_infer_with_unknown: diag(90031, 3, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), + Add_parameter_name: diag(90034, 3, "Add_parameter_name_90034", "Add parameter name"), + Declare_private_property_0: diag(90035, 3, "Declare_private_property_0_90035", "Declare private property '{0}'"), + Replace_0_with_Promise_1: diag(90036, 3, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"), + Fix_all_incorrect_return_type_of_an_async_functions: diag(90037, 3, "Fix_all_incorrect_return_type_of_an_async_functions_90037", "Fix all incorrect return type of an async functions"), + Declare_private_method_0: diag(90038, 3, "Declare_private_method_0_90038", "Declare private method '{0}'"), + Remove_unused_destructuring_declaration: diag(90039, 3, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"), + Remove_unused_declarations_for_Colon_0: diag(90041, 3, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"), + Declare_a_private_field_named_0: diag(90053, 3, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), + Includes_imports_of_types_referenced_by_0: diag(90054, 3, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"), + Remove_type_from_import_declaration_from_0: diag(90055, 3, "Remove_type_from_import_declaration_from_0_90055", `Remove 'type' from import declaration from "{0}"`), + Remove_type_from_import_of_0_from_1: diag(90056, 3, "Remove_type_from_import_of_0_from_1_90056", `Remove 'type' from import of '{0}' from "{1}"`), + Add_import_from_0: diag(90057, 3, "Add_import_from_0_90057", 'Add import from "{0}"'), + Update_import_from_0: diag(90058, 3, "Update_import_from_0_90058", 'Update import from "{0}"'), + Export_0_from_module_1: diag(90059, 3, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"), + Export_all_referenced_locals: diag(90060, 3, "Export_all_referenced_locals_90060", "Export all referenced locals"), + Convert_function_to_an_ES2015_class: diag(95001, 3, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), + Convert_0_to_1_in_0: diag(95003, 3, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), + Extract_to_0_in_1: diag(95004, 3, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), + Extract_function: diag(95005, 3, "Extract_function_95005", "Extract function"), + Extract_constant: diag(95006, 3, "Extract_constant_95006", "Extract constant"), + Extract_to_0_in_enclosing_scope: diag(95007, 3, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"), + Extract_to_0_in_1_scope: diag(95008, 3, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"), + Annotate_with_type_from_JSDoc: diag(95009, 3, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"), + Infer_type_of_0_from_usage: diag(95011, 3, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"), + Infer_parameter_types_from_usage: diag(95012, 3, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), + Convert_to_default_import: diag(95013, 3, "Convert_to_default_import_95013", "Convert to default import"), + Install_0: diag(95014, 3, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, 3, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, 3, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES_module: diag(95017, 3, "Convert_to_ES_module_95017", "Convert to ES module"), + Add_undefined_type_to_property_0: diag(95018, 3, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), + Add_initializer_to_property_0: diag(95019, 3, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), + Add_definite_assignment_assertion_to_property_0: diag(95020, 3, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), + Convert_all_type_literals_to_mapped_type: diag(95021, 3, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), + Add_all_missing_members: diag(95022, 3, "Add_all_missing_members_95022", "Add all missing members"), + Infer_all_types_from_usage: diag(95023, 3, "Infer_all_types_from_usage_95023", "Infer all types from usage"), + Delete_all_unused_declarations: diag(95024, 3, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), + Prefix_all_unused_declarations_with_where_possible: diag(95025, 3, "Prefix_all_unused_declarations_with_where_possible_95025", "Prefix all unused declarations with '_' where possible"), + Fix_all_detected_spelling_errors: diag(95026, 3, "Fix_all_detected_spelling_errors_95026", "Fix all detected spelling errors"), + Add_initializers_to_all_uninitialized_properties: diag(95027, 3, "Add_initializers_to_all_uninitialized_properties_95027", "Add initializers to all uninitialized properties"), + Add_definite_assignment_assertions_to_all_uninitialized_properties: diag(95028, 3, "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028", "Add definite assignment assertions to all uninitialized properties"), + Add_undefined_type_to_all_uninitialized_properties: diag(95029, 3, "Add_undefined_type_to_all_uninitialized_properties_95029", "Add undefined type to all uninitialized properties"), + Change_all_jsdoc_style_types_to_TypeScript: diag(95030, 3, "Change_all_jsdoc_style_types_to_TypeScript_95030", "Change all jsdoc-style types to TypeScript"), + Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: diag(95031, 3, "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031", "Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"), + Implement_all_unimplemented_interfaces: diag(95032, 3, "Implement_all_unimplemented_interfaces_95032", "Implement all unimplemented interfaces"), + Install_all_missing_types_packages: diag(95033, 3, "Install_all_missing_types_packages_95033", "Install all missing types packages"), + Rewrite_all_as_indexed_access_types: diag(95034, 3, "Rewrite_all_as_indexed_access_types_95034", "Rewrite all as indexed access types"), + Convert_all_to_default_imports: diag(95035, 3, "Convert_all_to_default_imports_95035", "Convert all to default imports"), + Make_all_super_calls_the_first_statement_in_their_constructor: diag(95036, 3, "Make_all_super_calls_the_first_statement_in_their_constructor_95036", "Make all 'super()' calls the first statement in their constructor"), + Add_qualifier_to_all_unresolved_variables_matching_a_member_name: diag(95037, 3, "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037", "Add qualifier to all unresolved variables matching a member name"), + Change_all_extended_interfaces_to_implements: diag(95038, 3, "Change_all_extended_interfaces_to_implements_95038", "Change all extended interfaces to 'implements'"), + Add_all_missing_super_calls: diag(95039, 3, "Add_all_missing_super_calls_95039", "Add all missing super calls"), + Implement_all_inherited_abstract_classes: diag(95040, 3, "Implement_all_inherited_abstract_classes_95040", "Implement all inherited abstract classes"), + Add_all_missing_async_modifiers: diag(95041, 3, "Add_all_missing_async_modifiers_95041", "Add all missing 'async' modifiers"), + Add_ts_ignore_to_all_error_messages: diag(95042, 3, "Add_ts_ignore_to_all_error_messages_95042", "Add '@ts-ignore' to all error messages"), + Annotate_everything_with_types_from_JSDoc: diag(95043, 3, "Annotate_everything_with_types_from_JSDoc_95043", "Annotate everything with types from JSDoc"), + Add_to_all_uncalled_decorators: diag(95044, 3, "Add_to_all_uncalled_decorators_95044", "Add '()' to all uncalled decorators"), + Convert_all_constructor_functions_to_classes: diag(95045, 3, "Convert_all_constructor_functions_to_classes_95045", "Convert all constructor functions to classes"), + Generate_get_and_set_accessors: diag(95046, 3, "Generate_get_and_set_accessors_95046", "Generate 'get' and 'set' accessors"), + Convert_require_to_import: diag(95047, 3, "Convert_require_to_import_95047", "Convert 'require' to 'import'"), + Convert_all_require_to_import: diag(95048, 3, "Convert_all_require_to_import_95048", "Convert all 'require' to 'import'"), + Move_to_a_new_file: diag(95049, 3, "Move_to_a_new_file_95049", "Move to a new file"), + Remove_unreachable_code: diag(95050, 3, "Remove_unreachable_code_95050", "Remove unreachable code"), + Remove_all_unreachable_code: diag(95051, 3, "Remove_all_unreachable_code_95051", "Remove all unreachable code"), + Add_missing_typeof: diag(95052, 3, "Add_missing_typeof_95052", "Add missing 'typeof'"), + Remove_unused_label: diag(95053, 3, "Remove_unused_label_95053", "Remove unused label"), + Remove_all_unused_labels: diag(95054, 3, "Remove_all_unused_labels_95054", "Remove all unused labels"), + Convert_0_to_mapped_object_type: diag(95055, 3, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"), + Convert_namespace_import_to_named_imports: diag(95056, 3, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"), + Convert_named_imports_to_namespace_import: diag(95057, 3, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"), + Add_or_remove_braces_in_an_arrow_function: diag(95058, 3, "Add_or_remove_braces_in_an_arrow_function_95058", "Add or remove braces in an arrow function"), + Add_braces_to_arrow_function: diag(95059, 3, "Add_braces_to_arrow_function_95059", "Add braces to arrow function"), + Remove_braces_from_arrow_function: diag(95060, 3, "Remove_braces_from_arrow_function_95060", "Remove braces from arrow function"), + Convert_default_export_to_named_export: diag(95061, 3, "Convert_default_export_to_named_export_95061", "Convert default export to named export"), + Convert_named_export_to_default_export: diag(95062, 3, "Convert_named_export_to_default_export_95062", "Convert named export to default export"), + Add_missing_enum_member_0: diag(95063, 3, "Add_missing_enum_member_0_95063", "Add missing enum member '{0}'"), + Add_all_missing_imports: diag(95064, 3, "Add_all_missing_imports_95064", "Add all missing imports"), + Convert_to_async_function: diag(95065, 3, "Convert_to_async_function_95065", "Convert to async function"), + Convert_all_to_async_functions: diag(95066, 3, "Convert_all_to_async_functions_95066", "Convert all to async functions"), + Add_missing_call_parentheses: diag(95067, 3, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), + Add_all_missing_call_parentheses: diag(95068, 3, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), + Add_unknown_conversion_for_non_overlapping_types: diag(95069, 3, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), + Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, 3, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), + Add_missing_new_operator_to_call: diag(95071, 3, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), + Add_missing_new_operator_to_all_calls: diag(95072, 3, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), + Add_names_to_all_parameters_without_names: diag(95073, 3, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), + Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, 3, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), + Convert_parameters_to_destructured_object: diag(95075, 3, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"), + Extract_type: diag(95077, 3, "Extract_type_95077", "Extract type"), + Extract_to_type_alias: diag(95078, 3, "Extract_to_type_alias_95078", "Extract to type alias"), + Extract_to_typedef: diag(95079, 3, "Extract_to_typedef_95079", "Extract to typedef"), + Infer_this_type_of_0_from_usage: diag(95080, 3, "Infer_this_type_of_0_from_usage_95080", "Infer 'this' type of '{0}' from usage"), + Add_const_to_unresolved_variable: diag(95081, 3, "Add_const_to_unresolved_variable_95081", "Add 'const' to unresolved variable"), + Add_const_to_all_unresolved_variables: diag(95082, 3, "Add_const_to_all_unresolved_variables_95082", "Add 'const' to all unresolved variables"), + Add_await: diag(95083, 3, "Add_await_95083", "Add 'await'"), + Add_await_to_initializer_for_0: diag(95084, 3, "Add_await_to_initializer_for_0_95084", "Add 'await' to initializer for '{0}'"), + Fix_all_expressions_possibly_missing_await: diag(95085, 3, "Fix_all_expressions_possibly_missing_await_95085", "Fix all expressions possibly missing 'await'"), + Remove_unnecessary_await: diag(95086, 3, "Remove_unnecessary_await_95086", "Remove unnecessary 'await'"), + Remove_all_unnecessary_uses_of_await: diag(95087, 3, "Remove_all_unnecessary_uses_of_await_95087", "Remove all unnecessary uses of 'await'"), + Enable_the_jsx_flag_in_your_configuration_file: diag(95088, 3, "Enable_the_jsx_flag_in_your_configuration_file_95088", "Enable the '--jsx' flag in your configuration file"), + Add_await_to_initializers: diag(95089, 3, "Add_await_to_initializers_95089", "Add 'await' to initializers"), + Extract_to_interface: diag(95090, 3, "Extract_to_interface_95090", "Extract to interface"), + Convert_to_a_bigint_numeric_literal: diag(95091, 3, "Convert_to_a_bigint_numeric_literal_95091", "Convert to a bigint numeric literal"), + Convert_all_to_bigint_numeric_literals: diag(95092, 3, "Convert_all_to_bigint_numeric_literals_95092", "Convert all to bigint numeric literals"), + Convert_const_to_let: diag(95093, 3, "Convert_const_to_let_95093", "Convert 'const' to 'let'"), + Prefix_with_declare: diag(95094, 3, "Prefix_with_declare_95094", "Prefix with 'declare'"), + Prefix_all_incorrect_property_declarations_with_declare: diag(95095, 3, "Prefix_all_incorrect_property_declarations_with_declare_95095", "Prefix all incorrect property declarations with 'declare'"), + Convert_to_template_string: diag(95096, 3, "Convert_to_template_string_95096", "Convert to template string"), + Add_export_to_make_this_file_into_a_module: diag(95097, 3, "Add_export_to_make_this_file_into_a_module_95097", "Add 'export {}' to make this file into a module"), + Set_the_target_option_in_your_configuration_file_to_0: diag(95098, 3, "Set_the_target_option_in_your_configuration_file_to_0_95098", "Set the 'target' option in your configuration file to '{0}'"), + Set_the_module_option_in_your_configuration_file_to_0: diag(95099, 3, "Set_the_module_option_in_your_configuration_file_to_0_95099", "Set the 'module' option in your configuration file to '{0}'"), + Convert_invalid_character_to_its_html_entity_code: diag(95100, 3, "Convert_invalid_character_to_its_html_entity_code_95100", "Convert invalid character to its html entity code"), + Convert_all_invalid_characters_to_HTML_entity_code: diag(95101, 3, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"), + Convert_all_const_to_let: diag(95102, 3, "Convert_all_const_to_let_95102", "Convert all 'const' to 'let'"), + Convert_function_expression_0_to_arrow_function: diag(95105, 3, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"), + Convert_function_declaration_0_to_arrow_function: diag(95106, 3, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"), + Fix_all_implicit_this_errors: diag(95107, 3, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"), + Wrap_invalid_character_in_an_expression_container: diag(95108, 3, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"), + Wrap_all_invalid_characters_in_an_expression_container: diag(95109, 3, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"), + Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: diag(95110, 3, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"), + Add_a_return_statement: diag(95111, 3, "Add_a_return_statement_95111", "Add a return statement"), + Remove_braces_from_arrow_function_body: diag(95112, 3, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"), + Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, 3, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"), + Add_all_missing_return_statement: diag(95114, 3, "Add_all_missing_return_statement_95114", "Add all missing return statement"), + Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: diag(95115, 3, "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115", "Remove braces from all arrow function bodies with relevant issues"), + Wrap_all_object_literal_with_parentheses: diag(95116, 3, "Wrap_all_object_literal_with_parentheses_95116", "Wrap all object literal with parentheses"), + Move_labeled_tuple_element_modifiers_to_labels: diag(95117, 3, "Move_labeled_tuple_element_modifiers_to_labels_95117", "Move labeled tuple element modifiers to labels"), + Convert_overload_list_to_single_signature: diag(95118, 3, "Convert_overload_list_to_single_signature_95118", "Convert overload list to single signature"), + Generate_get_and_set_accessors_for_all_overriding_properties: diag(95119, 3, "Generate_get_and_set_accessors_for_all_overriding_properties_95119", "Generate 'get' and 'set' accessors for all overriding properties"), + Wrap_in_JSX_fragment: diag(95120, 3, "Wrap_in_JSX_fragment_95120", "Wrap in JSX fragment"), + Wrap_all_unparented_JSX_in_JSX_fragment: diag(95121, 3, "Wrap_all_unparented_JSX_in_JSX_fragment_95121", "Wrap all unparented JSX in JSX fragment"), + Convert_arrow_function_or_function_expression: diag(95122, 3, "Convert_arrow_function_or_function_expression_95122", "Convert arrow function or function expression"), + Convert_to_anonymous_function: diag(95123, 3, "Convert_to_anonymous_function_95123", "Convert to anonymous function"), + Convert_to_named_function: diag(95124, 3, "Convert_to_named_function_95124", "Convert to named function"), + Convert_to_arrow_function: diag(95125, 3, "Convert_to_arrow_function_95125", "Convert to arrow function"), + Remove_parentheses: diag(95126, 3, "Remove_parentheses_95126", "Remove parentheses"), + Could_not_find_a_containing_arrow_function: diag(95127, 3, "Could_not_find_a_containing_arrow_function_95127", "Could not find a containing arrow function"), + Containing_function_is_not_an_arrow_function: diag(95128, 3, "Containing_function_is_not_an_arrow_function_95128", "Containing function is not an arrow function"), + Could_not_find_export_statement: diag(95129, 3, "Could_not_find_export_statement_95129", "Could not find export statement"), + This_file_already_has_a_default_export: diag(95130, 3, "This_file_already_has_a_default_export_95130", "This file already has a default export"), + Could_not_find_import_clause: diag(95131, 3, "Could_not_find_import_clause_95131", "Could not find import clause"), + Could_not_find_namespace_import_or_named_imports: diag(95132, 3, "Could_not_find_namespace_import_or_named_imports_95132", "Could not find namespace import or named imports"), + Selection_is_not_a_valid_type_node: diag(95133, 3, "Selection_is_not_a_valid_type_node_95133", "Selection is not a valid type node"), + No_type_could_be_extracted_from_this_type_node: diag(95134, 3, "No_type_could_be_extracted_from_this_type_node_95134", "No type could be extracted from this type node"), + Could_not_find_property_for_which_to_generate_accessor: diag(95135, 3, "Could_not_find_property_for_which_to_generate_accessor_95135", "Could not find property for which to generate accessor"), + Name_is_not_valid: diag(95136, 3, "Name_is_not_valid_95136", "Name is not valid"), + Can_only_convert_property_with_modifier: diag(95137, 3, "Can_only_convert_property_with_modifier_95137", "Can only convert property with modifier"), + Switch_each_misused_0_to_1: diag(95138, 3, "Switch_each_misused_0_to_1_95138", "Switch each misused '{0}' to '{1}'"), + Convert_to_optional_chain_expression: diag(95139, 3, "Convert_to_optional_chain_expression_95139", "Convert to optional chain expression"), + Could_not_find_convertible_access_expression: diag(95140, 3, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), + Could_not_find_matching_access_expressions: diag(95141, 3, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), + Can_only_convert_logical_AND_access_chains: diag(95142, 3, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), + Add_void_to_Promise_resolved_without_a_value: diag(95143, 3, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), + Add_void_to_all_Promises_resolved_without_a_value: diag(95144, 3, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), + Use_element_access_for_0: diag(95145, 3, "Use_element_access_for_0_95145", "Use element access for '{0}'"), + Use_element_access_for_all_undeclared_properties: diag(95146, 3, "Use_element_access_for_all_undeclared_properties_95146", "Use element access for all undeclared properties."), + Delete_all_unused_imports: diag(95147, 3, "Delete_all_unused_imports_95147", "Delete all unused imports"), + Infer_function_return_type: diag(95148, 3, "Infer_function_return_type_95148", "Infer function return type"), + Return_type_must_be_inferred_from_a_function: diag(95149, 3, "Return_type_must_be_inferred_from_a_function_95149", "Return type must be inferred from a function"), + Could_not_determine_function_return_type: diag(95150, 3, "Could_not_determine_function_return_type_95150", "Could not determine function return type"), + Could_not_convert_to_arrow_function: diag(95151, 3, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"), + Could_not_convert_to_named_function: diag(95152, 3, "Could_not_convert_to_named_function_95152", "Could not convert to named function"), + Could_not_convert_to_anonymous_function: diag(95153, 3, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"), + Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"), + Selection_is_not_a_valid_statement_or_statements: diag(95155, 3, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"), + Add_missing_function_declaration_0: diag(95156, 3, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"), + Add_all_missing_function_declarations: diag(95157, 3, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"), + Method_not_implemented: diag(95158, 3, "Method_not_implemented_95158", "Method not implemented."), + Function_not_implemented: diag(95159, 3, "Function_not_implemented_95159", "Function not implemented."), + Add_override_modifier: diag(95160, 3, "Add_override_modifier_95160", "Add 'override' modifier"), + Remove_override_modifier: diag(95161, 3, "Remove_override_modifier_95161", "Remove 'override' modifier"), + Add_all_missing_override_modifiers: diag(95162, 3, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"), + Remove_all_unnecessary_override_modifiers: diag(95163, 3, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"), + Can_only_convert_named_export: diag(95164, 3, "Can_only_convert_named_export_95164", "Can only convert named export"), + Add_missing_properties: diag(95165, 3, "Add_missing_properties_95165", "Add missing properties"), + Add_all_missing_properties: diag(95166, 3, "Add_all_missing_properties_95166", "Add all missing properties"), + Add_missing_attributes: diag(95167, 3, "Add_missing_attributes_95167", "Add missing attributes"), + Add_all_missing_attributes: diag(95168, 3, "Add_all_missing_attributes_95168", "Add all missing attributes"), + Add_undefined_to_optional_property_type: diag(95169, 3, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"), + Convert_named_imports_to_default_import: diag(95170, 3, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"), + Delete_unused_param_tag_0: diag(95171, 3, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"), + Delete_all_unused_param_tags: diag(95172, 3, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"), + Rename_param_tag_name_0_to_1: diag(95173, 3, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"), + Use_0: diag(95174, 3, "Use_0_95174", "Use `{0}`."), + Use_Number_isNaN_in_all_conditions: diag(95175, 3, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."), + Convert_typedef_to_TypeScript_type: diag(95176, 3, "Convert_typedef_to_TypeScript_type_95176", "Convert typedef to TypeScript type."), + Convert_all_typedef_to_TypeScript_types: diag(95177, 3, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."), + Move_to_file: diag(95178, 3, "Move_to_file_95178", "Move to file"), + Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"), + Use_import_type: diag(95180, 3, "Use_import_type_95180", "Use 'import type'"), + Use_type_0: diag(95181, 3, "Use_type_0_95181", "Use 'type {0}'"), + Fix_all_with_type_only_imports: diag(95182, 3, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"), + Cannot_move_statements_to_the_selected_file: diag(95183, 3, "Cannot_move_statements_to_the_selected_file_95183", "Cannot move statements to the selected file"), + Inline_variable: diag(95184, 3, "Inline_variable_95184", "Inline variable"), + Could_not_find_variable_to_inline: diag(95185, 3, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."), + Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."), + Add_missing_comma_for_object_member_completion_0: diag(95187, 3, "Add_missing_comma_for_object_member_completion_0_95187", "Add missing comma for object member completion '{0}'."), + Add_missing_parameter_to_0: diag(95188, 3, "Add_missing_parameter_to_0_95188", "Add missing parameter to '{0}'"), + Add_missing_parameters_to_0: diag(95189, 3, "Add_missing_parameters_to_0_95189", "Add missing parameters to '{0}'"), + Add_all_missing_parameters: diag(95190, 3, "Add_all_missing_parameters_95190", "Add all missing parameters"), + Add_optional_parameter_to_0: diag(95191, 3, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"), + Add_optional_parameters_to_0: diag(95192, 3, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"), + Add_all_optional_parameters: diag(95193, 3, "Add_all_optional_parameters_95193", "Add all optional parameters"), + No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), + Classes_may_not_have_a_field_named_constructor: diag(18006, 1, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), + JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), + Private_identifiers_cannot_be_used_as_parameters: diag(18009, 1, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), + An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, 1, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), + The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, 1, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), + constructor_is_a_reserved_word: diag(18012, 1, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), + Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: diag(18013, 1, "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013", "Property '{0}' is not accessible outside class '{1}' because it has a private identifier."), + The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: diag(18014, 1, "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014", "The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."), + Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: diag(18015, 1, "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015", "Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."), + Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, 1, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), + The_shadowing_declaration_of_0_is_defined_here: diag(18017, 1, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), + The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, 1, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), + _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, 1, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), + An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, 1, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), + can_only_be_used_at_the_start_of_a_file: diag(18026, 1, "can_only_be_used_at_the_start_of_a_file_18026", "'#!' can only be used at the start of a file."), + Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: diag(18027, 1, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."), + Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18028, 1, "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028", "Private identifiers are only available when targeting ECMAScript 2015 and higher."), + Private_identifiers_are_not_allowed_in_variable_declarations: diag(18029, 1, "Private_identifiers_are_not_allowed_in_variable_declarations_18029", "Private identifiers are not allowed in variable declarations."), + An_optional_chain_cannot_contain_private_identifiers: diag(18030, 1, "An_optional_chain_cannot_contain_private_identifiers_18030", "An optional chain cannot contain private identifiers."), + The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: diag(18031, 1, "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031", "The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."), + The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: diag(18032, 1, "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032", "The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."), + Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values: diag(18033, 1, "Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values_18033", "Type '{0}' is not assignable to type '{1}' as required for computed enum member values."), + Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, 3, "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034", "Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."), + Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(18035, 1, "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035", "Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."), + Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator: diag(18036, 1, "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036", "Class decorators can't be used with static private identifier. Consider removing the experimental decorator."), + await_expression_cannot_be_used_inside_a_class_static_block: diag(18037, 1, "await_expression_cannot_be_used_inside_a_class_static_block_18037", "'await' expression cannot be used inside a class static block."), + for_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, 1, "for_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'for await' loops cannot be used inside a class static block."), + Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, 1, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."), + A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, 1, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."), + _0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, 1, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."), + Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, 1, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."), + _0_is_automatically_exported_here: diag(18044, 3, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."), + Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18045, 1, "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045", "Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."), + _0_is_of_type_unknown: diag(18046, 1, "_0_is_of_type_unknown_18046", "'{0}' is of type 'unknown'."), + _0_is_possibly_null: diag(18047, 1, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), + _0_is_possibly_undefined: diag(18048, 1, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), + _0_is_possibly_null_or_undefined: diag(18049, 1, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), + The_value_0_cannot_be_used_here: diag(18050, 1, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), + Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."), + Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"), + Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."), + await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.") + }; + } + }); + function tokenIsIdentifierOrKeyword(token) { + return token >= 80; + } + function tokenIsIdentifierOrKeywordOrGreaterThan(token) { + return token === 32 || tokenIsIdentifierOrKeyword(token); + } + function lookupInUnicodeMap(code, map22) { + if (code < map22[0]) { + return false; + } + let lo = 0; + let hi = map22.length; + let mid; + while (lo + 1 < hi) { + mid = lo + (hi - lo) / 2; + mid -= mid % 2; + if (map22[mid] <= code && code <= map22[mid + 1]) { + return true; + } + if (code < map22[mid]) { + hi = mid; + } else { + lo = mid + 2; + } + } + return false; + } + function isUnicodeIdentifierStart(code, languageVersion) { + return languageVersion >= 2 ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : languageVersion === 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); + } + function isUnicodeIdentifierPart(code, languageVersion) { + return languageVersion >= 2 ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : languageVersion === 1 ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); + } + function makeReverseMap(source) { + const result2 = []; + source.forEach((value2, name2) => { + result2[value2] = name2; + }); + return result2; + } + function tokenToString(t8) { + return tokenStrings[t8]; + } + function stringToToken(s7) { + return textToToken.get(s7); + } + function computeLineStarts(text) { + const result2 = []; + let pos = 0; + let lineStart = 0; + while (pos < text.length) { + const ch = text.charCodeAt(pos); + pos++; + switch (ch) { + case 13: + if (text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + result2.push(lineStart); + lineStart = pos; + break; + default: + if (ch > 127 && isLineBreak2(ch)) { + result2.push(lineStart); + lineStart = pos; + } + break; + } + } + result2.push(lineStart); + return result2; + } + function getPositionOfLineAndCharacter(sourceFile, line, character, allowEdits) { + return sourceFile.getPositionOfLineAndCharacter ? sourceFile.getPositionOfLineAndCharacter(line, character, allowEdits) : computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character, sourceFile.text, allowEdits); + } + function computePositionOfLineAndCharacter(lineStarts, line, character, debugText, allowEdits) { + if (line < 0 || line >= lineStarts.length) { + if (allowEdits) { + line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line; + } else { + Debug.fail(`Bad line number. Line: ${line}, lineStarts.length: ${lineStarts.length} , line map is correct? ${debugText !== void 0 ? arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"}`); + } + } + const res = lineStarts[line] + character; + if (allowEdits) { + return res > lineStarts[line + 1] ? lineStarts[line + 1] : typeof debugText === "string" && res > debugText.length ? debugText.length : res; + } + if (line < lineStarts.length - 1) { + Debug.assert(res < lineStarts[line + 1]); + } else if (debugText !== void 0) { + Debug.assert(res <= debugText.length); + } + return res; + } + function getLineStarts(sourceFile) { + return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); + } + function computeLineAndCharacterOfPosition(lineStarts, position) { + const lineNumber = computeLineOfPosition(lineStarts, position); + return { + line: lineNumber, + character: position - lineStarts[lineNumber] + }; + } + function computeLineOfPosition(lineStarts, position, lowerBound) { + let lineNumber = binarySearch(lineStarts, position, identity2, compareValues, lowerBound); + if (lineNumber < 0) { + lineNumber = ~lineNumber - 1; + Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file"); + } + return lineNumber; + } + function getLinesBetweenPositions(sourceFile, pos1, pos2) { + if (pos1 === pos2) + return 0; + const lineStarts = getLineStarts(sourceFile); + const lower = Math.min(pos1, pos2); + const isNegative = lower === pos2; + const upper = isNegative ? pos1 : pos2; + const lowerLine = computeLineOfPosition(lineStarts, lower); + const upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); + return isNegative ? lowerLine - upperLine : upperLine - lowerLine; + } + function getLineAndCharacterOfPosition(sourceFile, position) { + return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); + } + function isWhiteSpaceLike(ch) { + return isWhiteSpaceSingleLine(ch) || isLineBreak2(ch); + } + function isWhiteSpaceSingleLine(ch) { + return ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 133 || ch === 5760 || ch >= 8192 && ch <= 8203 || ch === 8239 || ch === 8287 || ch === 12288 || ch === 65279; + } + function isLineBreak2(ch) { + return ch === 10 || ch === 13 || ch === 8232 || ch === 8233; + } + function isDigit2(ch) { + return ch >= 48 && ch <= 57; + } + function isHexDigit(ch) { + return isDigit2(ch) || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102; + } + function isCodePoint(code) { + return code <= 1114111; + } + function isOctalDigit(ch) { + return ch >= 48 && ch <= 55; + } + function couldStartTrivia(text, pos) { + const ch = text.charCodeAt(pos); + switch (ch) { + case 13: + case 10: + case 9: + case 11: + case 12: + case 32: + case 47: + case 60: + case 124: + case 61: + case 62: + return true; + case 35: + return pos === 0; + default: + return ch > 127; + } + } + function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) { + if (positionIsSynthesized(pos)) { + return pos; + } + let canConsumeStar = false; + while (true) { + const ch = text.charCodeAt(pos); + switch (ch) { + case 13: + if (text.charCodeAt(pos + 1) === 10) { + pos++; + } + case 10: + pos++; + if (stopAfterLineBreak) { + return pos; + } + canConsumeStar = !!inJSDoc; + continue; + case 9: + case 11: + case 12: + case 32: + pos++; + continue; + case 47: + if (stopAtComments) { + break; + } + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + while (pos < text.length) { + if (isLineBreak2(text.charCodeAt(pos))) { + break; + } + pos++; + } + canConsumeStar = false; + continue; + } + if (text.charCodeAt(pos + 1) === 42) { + pos += 2; + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + break; + } + pos++; + } + canConsumeStar = false; + continue; + } + break; + case 60: + case 124: + case 61: + case 62: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos); + canConsumeStar = false; + continue; + } + break; + case 35: + if (pos === 0 && isShebangTrivia(text, pos)) { + pos = scanShebangTrivia(text, pos); + canConsumeStar = false; + continue; + } + break; + case 42: + if (canConsumeStar) { + pos++; + canConsumeStar = false; + continue; + } + break; + default: + if (ch > 127 && isWhiteSpaceLike(ch)) { + pos++; + continue; + } + break; + } + return pos; + } + } + function isConflictMarkerTrivia(text, pos) { + Debug.assert(pos >= 0); + if (pos === 0 || isLineBreak2(text.charCodeAt(pos - 1))) { + const ch = text.charCodeAt(pos); + if (pos + mergeConflictMarkerLength < text.length) { + for (let i7 = 0; i7 < mergeConflictMarkerLength; i7++) { + if (text.charCodeAt(pos + i7) !== ch) { + return false; + } + } + return ch === 61 || text.charCodeAt(pos + mergeConflictMarkerLength) === 32; + } + } + return false; + } + function scanConflictMarkerTrivia(text, pos, error22) { + if (error22) { + error22(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); + } + const ch = text.charCodeAt(pos); + const len = text.length; + if (ch === 60 || ch === 62) { + while (pos < len && !isLineBreak2(text.charCodeAt(pos))) { + pos++; + } + } else { + Debug.assert( + ch === 124 || ch === 61 + /* equals */ + ); + while (pos < len) { + const currentChar = text.charCodeAt(pos); + if ((currentChar === 61 || currentChar === 62) && currentChar !== ch && isConflictMarkerTrivia(text, pos)) { + break; + } + pos++; + } + } + return pos; + } + function isShebangTrivia(text, pos) { + Debug.assert(pos === 0); + return shebangTriviaRegex.test(text); + } + function scanShebangTrivia(text, pos) { + const shebang = shebangTriviaRegex.exec(text)[0]; + pos = pos + shebang.length; + return pos; + } + function iterateCommentRanges(reduce2, text, pos, trailing, cb, state, initial2) { + let pendingPos; + let pendingEnd; + let pendingKind; + let pendingHasTrailingNewLine; + let hasPendingCommentRange = false; + let collecting = trailing; + let accumulator = initial2; + if (pos === 0) { + collecting = true; + const shebang = getShebang(text); + if (shebang) { + pos = shebang.length; + } + } + scan: + while (pos >= 0 && pos < text.length) { + const ch = text.charCodeAt(pos); + switch (ch) { + case 13: + if (text.charCodeAt(pos + 1) === 10) { + pos++; + } + case 10: + pos++; + if (trailing) { + break scan; + } + collecting = true; + if (hasPendingCommentRange) { + pendingHasTrailingNewLine = true; + } + continue; + case 9: + case 11: + case 12: + case 32: + pos++; + continue; + case 47: + const nextChar = text.charCodeAt(pos + 1); + let hasTrailingNewLine = false; + if (nextChar === 47 || nextChar === 42) { + const kind = nextChar === 47 ? 2 : 3; + const startPos = pos; + pos += 2; + if (nextChar === 47) { + while (pos < text.length) { + if (isLineBreak2(text.charCodeAt(pos))) { + hasTrailingNewLine = true; + break; + } + pos++; + } + } else { + while (pos < text.length) { + if (text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + break; + } + pos++; + } + } + if (collecting) { + if (hasPendingCommentRange) { + accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); + if (!reduce2 && accumulator) { + return accumulator; + } + } + pendingPos = startPos; + pendingEnd = pos; + pendingKind = kind; + pendingHasTrailingNewLine = hasTrailingNewLine; + hasPendingCommentRange = true; + } + continue; + } + break scan; + default: + if (ch > 127 && isWhiteSpaceLike(ch)) { + if (hasPendingCommentRange && isLineBreak2(ch)) { + pendingHasTrailingNewLine = true; + } + pos++; + continue; + } + break scan; + } + } + if (hasPendingCommentRange) { + accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); + } + return accumulator; + } + function forEachLeadingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + false, + cb, + state + ); + } + function forEachTrailingCommentRange(text, pos, cb, state) { + return iterateCommentRanges( + /*reduce*/ + false, + text, + pos, + /*trailing*/ + true, + cb, + state + ); + } + function reduceEachLeadingCommentRange(text, pos, cb, state, initial2) { + return iterateCommentRanges( + /*reduce*/ + true, + text, + pos, + /*trailing*/ + false, + cb, + state, + initial2 + ); + } + function reduceEachTrailingCommentRange(text, pos, cb, state, initial2) { + return iterateCommentRanges( + /*reduce*/ + true, + text, + pos, + /*trailing*/ + true, + cb, + state, + initial2 + ); + } + function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments = []) { + comments.push({ kind, pos, end, hasTrailingNewLine }); + return comments; + } + function getLeadingCommentRanges(text, pos) { + return reduceEachLeadingCommentRange( + text, + pos, + appendCommentRange, + /*state*/ + void 0, + /*initial*/ + void 0 + ); + } + function getTrailingCommentRanges(text, pos) { + return reduceEachTrailingCommentRange( + text, + pos, + appendCommentRange, + /*state*/ + void 0, + /*initial*/ + void 0 + ); + } + function getShebang(text) { + const match = shebangTriviaRegex.exec(text); + if (match) { + return match[0]; + } + } + function isIdentifierStart(ch, languageVersion) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch === 36 || ch === 95 || ch > 127 && isUnicodeIdentifierStart(ch, languageVersion); + } + function isIdentifierPart(ch, languageVersion, identifierVariant) { + return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch === 36 || ch === 95 || // "-" and ":" are valid in JSX Identifiers + (identifierVariant === 1 ? ch === 45 || ch === 58 : false) || ch > 127 && isUnicodeIdentifierPart(ch, languageVersion); + } + function isIdentifierText(name2, languageVersion, identifierVariant) { + let ch = codePointAt2(name2, 0); + if (!isIdentifierStart(ch, languageVersion)) { + return false; + } + for (let i7 = charSize(ch); i7 < name2.length; i7 += charSize(ch)) { + if (!isIdentifierPart(ch = codePointAt2(name2, i7), languageVersion, identifierVariant)) { + return false; + } + } + return true; + } + function createScanner3(languageVersion, skipTrivia2, languageVariant = 0, textInitial, onError, start, length2) { + var text = textInitial; + var pos; + var end; + var fullStartPos; + var tokenStart; + var token; + var tokenValue; + var tokenFlags; + var commentDirectives; + var inJSDocType = 0; + var scriptKind = 0; + var jsDocParsingMode = 0; + setText(text, start, length2); + var scanner2 = { + getTokenFullStart: () => fullStartPos, + getStartPos: () => fullStartPos, + getTokenEnd: () => pos, + getTextPos: () => pos, + getToken: () => token, + getTokenStart: () => tokenStart, + getTokenPos: () => tokenStart, + getTokenText: () => text.substring(tokenStart, pos), + getTokenValue: () => tokenValue, + hasUnicodeEscape: () => (tokenFlags & 1024) !== 0, + hasExtendedUnicodeEscape: () => (tokenFlags & 8) !== 0, + hasPrecedingLineBreak: () => (tokenFlags & 1) !== 0, + hasPrecedingJSDocComment: () => (tokenFlags & 2) !== 0, + isIdentifier: () => token === 80 || token > 118, + isReservedWord: () => token >= 83 && token <= 118, + isUnterminated: () => (tokenFlags & 4) !== 0, + getCommentDirectives: () => commentDirectives, + getNumericLiteralFlags: () => tokenFlags & 25584, + getTokenFlags: () => tokenFlags, + reScanGreaterToken, + reScanAsteriskEqualsToken, + reScanSlashToken, + reScanTemplateToken, + reScanTemplateHeadOrNoSubstitutionTemplate, + scanJsxIdentifier, + scanJsxAttributeValue, + reScanJsxAttributeValue, + reScanJsxToken, + reScanLessThanToken, + reScanHashToken, + reScanQuestionToken, + reScanInvalidIdentifier, + scanJsxToken, + scanJsDocToken, + scanJSDocCommentTextToken, + scan, + getText, + clearCommentDirectives, + setText, + setScriptTarget, + setLanguageVariant, + setScriptKind, + setJSDocParsingMode, + setOnError, + resetTokenState, + setTextPos: resetTokenState, + setInJSDocType, + tryScan, + lookAhead, + scanRange + }; + if (Debug.isDebugging) { + Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", { + get: () => { + const text2 = scanner2.getText(); + return text2.slice(0, scanner2.getTokenFullStart()) + "\u2551" + text2.slice(scanner2.getTokenFullStart()); + } + }); + } + return scanner2; + function error22(message, errPos = pos, length3, arg0) { + if (onError) { + const oldPos = pos; + pos = errPos; + onError(message, length3 || 0, arg0); + pos = oldPos; + } + } + function scanNumberFragment() { + let start2 = pos; + let allowSeparator = false; + let isPreviousTokenSeparator = false; + let result2 = ""; + while (true) { + const ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result2 += text.substring(start2, pos); + } else { + tokenFlags |= 16384; + if (isPreviousTokenSeparator) { + error22(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + } + pos++; + start2 = pos; + continue; + } + if (isDigit2(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95) { + tokenFlags |= 16384; + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result2 + text.substring(start2, pos); + } + function scanNumber() { + let start2 = pos; + let mainFragment; + if (text.charCodeAt(pos) === 48) { + pos++; + if (text.charCodeAt(pos) === 95) { + tokenFlags |= 512 | 16384; + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + pos--; + mainFragment = scanNumberFragment(); + } else if (!scanDigits()) { + tokenFlags |= 8192; + mainFragment = "" + +tokenValue; + } else if (!tokenValue) { + mainFragment = "0"; + } else { + tokenValue = "" + parseInt(tokenValue, 8); + tokenFlags |= 32; + const withMinus = token === 41; + const literal = (withMinus ? "-" : "") + "0o" + (+tokenValue).toString(8); + if (withMinus) + start2--; + error22(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal); + return 9; + } + } else { + mainFragment = scanNumberFragment(); + } + let decimalFragment; + let scientificFragment; + if (text.charCodeAt(pos) === 46) { + pos++; + decimalFragment = scanNumberFragment(); + } + let end2 = pos; + if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { + pos++; + tokenFlags |= 16; + if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) + pos++; + const preNumericPart = pos; + const finalFragment = scanNumberFragment(); + if (!finalFragment) { + error22(Diagnostics.Digit_expected); + } else { + scientificFragment = text.substring(end2, preNumericPart) + finalFragment; + end2 = pos; + } + } + let result2; + if (tokenFlags & 512) { + result2 = mainFragment; + if (decimalFragment) { + result2 += "." + decimalFragment; + } + if (scientificFragment) { + result2 += scientificFragment; + } + } else { + result2 = text.substring(start2, end2); + } + if (tokenFlags & 8192) { + error22(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2); + tokenValue = "" + +result2; + return 9; + } + if (decimalFragment !== void 0 || tokenFlags & 16) { + checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16)); + tokenValue = "" + +result2; + return 9; + } else { + tokenValue = result2; + const type3 = checkBigIntSuffix(); + checkForIdentifierStartAfterNumericLiteral(start2); + return type3; + } + } + function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { + if (!isIdentifierStart(codePointAt2(text, pos), languageVersion)) { + return; + } + const identifierStart = pos; + const { length: length3 } = scanIdentifierParts(); + if (length3 === 1 && text[identifierStart] === "n") { + if (isScientific) { + error22(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); + } else { + error22(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); + } + } else { + error22(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length3); + pos = identifierStart; + } + } + function scanDigits() { + const start2 = pos; + let isOctal = true; + while (isDigit2(text.charCodeAt(pos))) { + if (!isOctalDigit(text.charCodeAt(pos))) { + isOctal = false; + } + pos++; + } + tokenValue = text.substring(start2, pos); + return isOctal; + } + function scanExactNumberOfHexDigits(count2, canHaveSeparators) { + const valueString = scanHexDigits( + /*minCount*/ + count2, + /*scanAsManyAsPossible*/ + false, + canHaveSeparators + ); + return valueString ? parseInt(valueString, 16) : -1; + } + function scanMinimumNumberOfHexDigits(count2, canHaveSeparators) { + return scanHexDigits( + /*minCount*/ + count2, + /*scanAsManyAsPossible*/ + true, + canHaveSeparators + ); + } + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { + let valueChars = []; + let allowSeparator = false; + let isPreviousTokenSeparator = false; + while (valueChars.length < minCount || scanAsManyAsPossible) { + let ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } else if (isPreviousTokenSeparator) { + error22(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; + if (ch >= 65 && ch <= 70) { + ch += 97 - 65; + } else if (!(ch >= 48 && ch <= 57 || ch >= 97 && ch <= 102)) { + break; + } + valueChars.push(ch); + pos++; + isPreviousTokenSeparator = false; + } + if (valueChars.length < minCount) { + valueChars = []; + } + if (text.charCodeAt(pos - 1) === 95) { + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return String.fromCharCode(...valueChars); + } + function scanString(jsxAttributeString = false) { + const quote2 = text.charCodeAt(pos); + pos++; + let result2 = ""; + let start2 = pos; + while (true) { + if (pos >= end) { + result2 += text.substring(start2, pos); + tokenFlags |= 4; + error22(Diagnostics.Unterminated_string_literal); + break; + } + const ch = text.charCodeAt(pos); + if (ch === quote2) { + result2 += text.substring(start2, pos); + pos++; + break; + } + if (ch === 92 && !jsxAttributeString) { + result2 += text.substring(start2, pos); + result2 += scanEscapeSequence( + /*shouldEmitInvalidEscapeError*/ + true + ); + start2 = pos; + continue; + } + if ((ch === 10 || ch === 13) && !jsxAttributeString) { + result2 += text.substring(start2, pos); + tokenFlags |= 4; + error22(Diagnostics.Unterminated_string_literal); + break; + } + pos++; + } + return result2; + } + function scanTemplateAndSetTokenValue(shouldEmitInvalidEscapeError) { + const startedWithBacktick = text.charCodeAt(pos) === 96; + pos++; + let start2 = pos; + let contents = ""; + let resultingToken; + while (true) { + if (pos >= end) { + contents += text.substring(start2, pos); + tokenFlags |= 4; + error22(Diagnostics.Unterminated_template_literal); + resultingToken = startedWithBacktick ? 15 : 18; + break; + } + const currChar = text.charCodeAt(pos); + if (currChar === 96) { + contents += text.substring(start2, pos); + pos++; + resultingToken = startedWithBacktick ? 15 : 18; + break; + } + if (currChar === 36 && pos + 1 < end && text.charCodeAt(pos + 1) === 123) { + contents += text.substring(start2, pos); + pos += 2; + resultingToken = startedWithBacktick ? 16 : 17; + break; + } + if (currChar === 92) { + contents += text.substring(start2, pos); + contents += scanEscapeSequence(shouldEmitInvalidEscapeError); + start2 = pos; + continue; + } + if (currChar === 13) { + contents += text.substring(start2, pos); + pos++; + if (pos < end && text.charCodeAt(pos) === 10) { + pos++; + } + contents += "\n"; + start2 = pos; + continue; + } + pos++; + } + Debug.assert(resultingToken !== void 0); + tokenValue = contents; + return resultingToken; + } + function scanEscapeSequence(shouldEmitInvalidEscapeError) { + const start2 = pos; + pos++; + if (pos >= end) { + error22(Diagnostics.Unexpected_end_of_text); + return ""; + } + const ch = text.charCodeAt(pos); + pos++; + switch (ch) { + case 48: + if (pos >= end || !isDigit2(text.charCodeAt(pos))) { + return "\0"; + } + case 49: + case 50: + case 51: + if (pos < end && isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + case 52: + case 53: + case 54: + case 55: + if (pos < end && isOctalDigit(text.charCodeAt(pos))) { + pos++; + } + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + const code = parseInt(text.substring(start2 + 1, pos), 8); + error22(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0")); + return String.fromCharCode(code); + } + return text.substring(start2, pos); + case 56: + case 57: + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos)); + return String.fromCharCode(ch); + } + return text.substring(start2, pos); + case 98: + return "\b"; + case 116: + return " "; + case 110: + return "\n"; + case 118: + return "\v"; + case 102: + return "\f"; + case 114: + return "\r"; + case 39: + return "'"; + case 34: + return '"'; + case 117: + if (pos < end && text.charCodeAt(pos) === 123) { + pos++; + const escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + if (escapedValue < 0) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Hexadecimal_digit_expected); + } + return text.substring(start2, pos); + } + if (!isCodePoint(escapedValue)) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); + } + return text.substring(start2, pos); + } + if (pos >= end) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Unexpected_end_of_text); + } + return text.substring(start2, pos); + } + if (text.charCodeAt(pos) !== 125) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Unterminated_Unicode_escape_sequence); + } + return text.substring(start2, pos); + } + pos++; + tokenFlags |= 8; + return utf16EncodeAsString(escapedValue); + } + for (; pos < start2 + 6; pos++) { + if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Hexadecimal_digit_expected); + } + return text.substring(start2, pos); + } + } + tokenFlags |= 1024; + return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16)); + case 120: + for (; pos < start2 + 4; pos++) { + if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) { + tokenFlags |= 2048; + if (shouldEmitInvalidEscapeError) { + error22(Diagnostics.Hexadecimal_digit_expected); + } + return text.substring(start2, pos); + } + } + tokenFlags |= 4096; + return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16)); + case 13: + if (pos < end && text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + case 8232: + case 8233: + return ""; + default: + return String.fromCharCode(ch); + } + } + function scanExtendedUnicodeEscape() { + const escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + let isInvalidExtendedEscape = false; + if (escapedValue < 0) { + error22(Diagnostics.Hexadecimal_digit_expected); + isInvalidExtendedEscape = true; + } else if (escapedValue > 1114111) { + error22(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); + isInvalidExtendedEscape = true; + } + if (pos >= end) { + error22(Diagnostics.Unexpected_end_of_text); + isInvalidExtendedEscape = true; + } else if (text.charCodeAt(pos) === 125) { + pos++; + } else { + error22(Diagnostics.Unterminated_Unicode_escape_sequence); + isInvalidExtendedEscape = true; + } + if (isInvalidExtendedEscape) { + return ""; + } + return utf16EncodeAsString(escapedValue); + } + function peekUnicodeEscape() { + if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { + const start2 = pos; + pos += 2; + const value2 = scanExactNumberOfHexDigits( + 4, + /*canHaveSeparators*/ + false + ); + pos = start2; + return value2; + } + return -1; + } + function peekExtendedUnicodeEscape() { + if (codePointAt2(text, pos + 1) === 117 && codePointAt2(text, pos + 2) === 123) { + const start2 = pos; + pos += 3; + const escapedValueString = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + false + ); + const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; + pos = start2; + return escapedValue; + } + return -1; + } + function scanIdentifierParts() { + let result2 = ""; + let start2 = pos; + while (pos < end) { + let ch = codePointAt2(text, pos); + if (isIdentifierPart(ch, languageVersion)) { + pos += charSize(ch); + } else if (ch === 92) { + ch = peekExtendedUnicodeEscape(); + if (ch >= 0 && isIdentifierPart(ch, languageVersion)) { + pos += 3; + tokenFlags |= 8; + result2 += scanExtendedUnicodeEscape(); + start2 = pos; + continue; + } + ch = peekUnicodeEscape(); + if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) { + break; + } + tokenFlags |= 1024; + result2 += text.substring(start2, pos); + result2 += utf16EncodeAsString(ch); + pos += 6; + start2 = pos; + } else { + break; + } + } + result2 += text.substring(start2, pos); + return result2; + } + function getIdentifierToken() { + const len = tokenValue.length; + if (len >= 2 && len <= 12) { + const ch = tokenValue.charCodeAt(0); + if (ch >= 97 && ch <= 122) { + const keyword = textToKeyword.get(tokenValue); + if (keyword !== void 0) { + return token = keyword; + } + } + } + return token = 80; + } + function scanBinaryOrOctalDigits(base) { + let value2 = ""; + let separatorAllowed = false; + let isPreviousTokenSeparator = false; + while (true) { + const ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } else if (isPreviousTokenSeparator) { + error22(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } else { + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; + if (!isDigit2(ch) || ch - 48 >= base) { + break; + } + value2 += text[pos]; + pos++; + isPreviousTokenSeparator = false; + } + if (text.charCodeAt(pos - 1) === 95) { + error22(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return value2; + } + function checkBigIntSuffix() { + if (text.charCodeAt(pos) === 110) { + tokenValue += "n"; + if (tokenFlags & 384) { + tokenValue = parsePseudoBigInt(tokenValue) + "n"; + } + pos++; + return 10; + } else { + const numericValue = tokenFlags & 128 ? parseInt(tokenValue.slice(2), 2) : tokenFlags & 256 ? parseInt(tokenValue.slice(2), 8) : +tokenValue; + tokenValue = "" + numericValue; + return 9; + } + } + function scan() { + fullStartPos = pos; + tokenFlags = 0; + let asteriskSeen = false; + while (true) { + tokenStart = pos; + if (pos >= end) { + return token = 1; + } + const ch = codePointAt2(text, pos); + if (pos === 0) { + if (text.slice(0, 256).includes("\uFFFD")) { + error22(Diagnostics.File_appears_to_be_binary); + pos = end; + return token = 8; + } + if (ch === 35 && isShebangTrivia(text, pos)) { + pos = scanShebangTrivia(text, pos); + if (skipTrivia2) { + continue; + } else { + return token = 6; + } + } + } + switch (ch) { + case 10: + case 13: + tokenFlags |= 1; + if (skipTrivia2) { + pos++; + continue; + } else { + if (ch === 13 && pos + 1 < end && text.charCodeAt(pos + 1) === 10) { + pos += 2; + } else { + pos++; + } + return token = 4; + } + case 9: + case 11: + case 12: + case 32: + case 160: + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8203: + case 8239: + case 8287: + case 12288: + case 65279: + if (skipTrivia2) { + pos++; + continue; + } else { + while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { + pos++; + } + return token = 5; + } + case 33: + if (text.charCodeAt(pos + 1) === 61) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 38; + } + return pos += 2, token = 36; + } + pos++; + return token = 54; + case 34: + case 39: + tokenValue = scanString(); + return token = 11; + case 96: + return token = scanTemplateAndSetTokenValue( + /*shouldEmitInvalidEscapeError*/ + false + ); + case 37: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 70; + } + pos++; + return token = 45; + case 38: + if (text.charCodeAt(pos + 1) === 38) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 77; + } + return pos += 2, token = 56; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 74; + } + pos++; + return token = 51; + case 40: + pos++; + return token = 21; + case 41: + pos++; + return token = 22; + case 42: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 67; + } + if (text.charCodeAt(pos + 1) === 42) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 68; + } + return pos += 2, token = 43; + } + pos++; + if (inJSDocType && !asteriskSeen && tokenFlags & 1) { + asteriskSeen = true; + continue; + } + return token = 42; + case 43: + if (text.charCodeAt(pos + 1) === 43) { + return pos += 2, token = 46; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 65; + } + pos++; + return token = 40; + case 44: + pos++; + return token = 28; + case 45: + if (text.charCodeAt(pos + 1) === 45) { + return pos += 2, token = 47; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 66; + } + pos++; + return token = 41; + case 46: + if (isDigit2(text.charCodeAt(pos + 1))) { + scanNumber(); + return token = 9; + } + if (text.charCodeAt(pos + 1) === 46 && text.charCodeAt(pos + 2) === 46) { + return pos += 3, token = 26; + } + pos++; + return token = 25; + case 47: + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + while (pos < end) { + if (isLineBreak2(text.charCodeAt(pos))) { + break; + } + pos++; + } + commentDirectives = appendIfCommentDirective( + commentDirectives, + text.slice(tokenStart, pos), + commentDirectiveRegExSingleLine, + tokenStart + ); + if (skipTrivia2) { + continue; + } else { + return token = 2; + } + } + if (text.charCodeAt(pos + 1) === 42) { + pos += 2; + const isJSDoc2 = text.charCodeAt(pos) === 42 && text.charCodeAt(pos + 1) !== 47; + let commentClosed = false; + let lastLineStart = tokenStart; + while (pos < end) { + const ch2 = text.charCodeAt(pos); + if (ch2 === 42 && text.charCodeAt(pos + 1) === 47) { + pos += 2; + commentClosed = true; + break; + } + pos++; + if (isLineBreak2(ch2)) { + lastLineStart = pos; + tokenFlags |= 1; + } + } + if (isJSDoc2 && shouldParseJSDoc()) { + tokenFlags |= 2; + } + commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart); + if (!commentClosed) { + error22(Diagnostics.Asterisk_Slash_expected); + } + if (skipTrivia2) { + continue; + } else { + if (!commentClosed) { + tokenFlags |= 4; + } + return token = 3; + } + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 69; + } + pos++; + return token = 44; + case 48: + if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { + pos += 2; + tokenValue = scanMinimumNumberOfHexDigits( + 1, + /*canHaveSeparators*/ + true + ); + if (!tokenValue) { + error22(Diagnostics.Hexadecimal_digit_expected); + tokenValue = "0"; + } + tokenValue = "0x" + tokenValue; + tokenFlags |= 64; + return token = checkBigIntSuffix(); + } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 || text.charCodeAt(pos + 1) === 98)) { + pos += 2; + tokenValue = scanBinaryOrOctalDigits( + /* base */ + 2 + ); + if (!tokenValue) { + error22(Diagnostics.Binary_digit_expected); + tokenValue = "0"; + } + tokenValue = "0b" + tokenValue; + tokenFlags |= 128; + return token = checkBigIntSuffix(); + } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 || text.charCodeAt(pos + 1) === 111)) { + pos += 2; + tokenValue = scanBinaryOrOctalDigits( + /* base */ + 8 + ); + if (!tokenValue) { + error22(Diagnostics.Octal_digit_expected); + tokenValue = "0"; + } + tokenValue = "0o" + tokenValue; + tokenFlags |= 256; + return token = checkBigIntSuffix(); + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return token = scanNumber(); + case 58: + pos++; + return token = 59; + case 59: + pos++; + return token = 27; + case 60: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error22); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 60) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 71; + } + return pos += 2, token = 48; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 33; + } + if (languageVariant === 1 && text.charCodeAt(pos + 1) === 47 && text.charCodeAt(pos + 2) !== 42) { + return pos += 2, token = 31; + } + pos++; + return token = 30; + case 61: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error22); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 61) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 37; + } + return pos += 2, token = 35; + } + if (text.charCodeAt(pos + 1) === 62) { + return pos += 2, token = 39; + } + pos++; + return token = 64; + case 62: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error22); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + pos++; + return token = 32; + case 63: + if (text.charCodeAt(pos + 1) === 46 && !isDigit2(text.charCodeAt(pos + 2))) { + return pos += 2, token = 29; + } + if (text.charCodeAt(pos + 1) === 63) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 78; + } + return pos += 2, token = 61; + } + pos++; + return token = 58; + case 91: + pos++; + return token = 23; + case 93: + pos++; + return token = 24; + case 94: + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 79; + } + pos++; + return token = 53; + case 123: + pos++; + return token = 19; + case 124: + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error22); + if (skipTrivia2) { + continue; + } else { + return token = 7; + } + } + if (text.charCodeAt(pos + 1) === 124) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 76; + } + return pos += 2, token = 57; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 75; + } + pos++; + return token = 52; + case 125: + pos++; + return token = 20; + case 126: + pos++; + return token = 55; + case 64: + pos++; + return token = 60; + case 92: + const extendedCookedChar = peekExtendedUnicodeEscape(); + if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = getIdentifierToken(); + } + const cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + error22(Diagnostics.Invalid_character); + pos++; + return token = 0; + case 35: + if (pos !== 0 && text[pos + 1] === "!") { + error22(Diagnostics.can_only_be_used_at_the_start_of_a_file); + pos++; + return token = 0; + } + const charAfterHash = codePointAt2(text, pos + 1); + if (charAfterHash === 92) { + pos++; + const extendedCookedChar2 = peekExtendedUnicodeEscape(); + if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = 81; + } + const cookedChar2 = peekUnicodeEscape(); + if (cookedChar2 >= 0 && isIdentifierStart(cookedChar2, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = "#" + String.fromCharCode(cookedChar2) + scanIdentifierParts(); + return token = 81; + } + pos--; + } + if (isIdentifierStart(charAfterHash, languageVersion)) { + pos++; + scanIdentifier(charAfterHash, languageVersion); + } else { + tokenValue = "#"; + error22(Diagnostics.Invalid_character, pos++, charSize(ch)); + } + return token = 81; + default: + const identifierKind = scanIdentifier(ch, languageVersion); + if (identifierKind) { + return token = identifierKind; + } else if (isWhiteSpaceSingleLine(ch)) { + pos += charSize(ch); + continue; + } else if (isLineBreak2(ch)) { + tokenFlags |= 1; + pos += charSize(ch); + continue; + } + const size2 = charSize(ch); + error22(Diagnostics.Invalid_character, pos, size2); + pos += size2; + return token = 0; + } + } + } + function shouldParseJSDoc() { + switch (jsDocParsingMode) { + case 0: + return true; + case 1: + return false; + } + if (scriptKind !== 3 && scriptKind !== 4) { + return true; + } + if (jsDocParsingMode === 3) { + return false; + } + return jsDocSeeOrLink.test(text.slice(fullStartPos, pos)); + } + function reScanInvalidIdentifier() { + Debug.assert(token === 0, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."); + pos = tokenStart = fullStartPos; + tokenFlags = 0; + const ch = codePointAt2(text, pos); + const identifierKind = scanIdentifier( + ch, + 99 + /* ESNext */ + ); + if (identifierKind) { + return token = identifierKind; + } + pos += charSize(ch); + return token; + } + function scanIdentifier(startCharacter, languageVersion2) { + let ch = startCharacter; + if (isIdentifierStart(ch, languageVersion2)) { + pos += charSize(ch); + while (pos < end && isIdentifierPart(ch = codePointAt2(text, pos), languageVersion2)) + pos += charSize(ch); + tokenValue = text.substring(tokenStart, pos); + if (ch === 92) { + tokenValue += scanIdentifierParts(); + } + return getIdentifierToken(); + } + } + function reScanGreaterToken() { + if (token === 32) { + if (text.charCodeAt(pos) === 62) { + if (text.charCodeAt(pos + 1) === 62) { + if (text.charCodeAt(pos + 2) === 61) { + return pos += 3, token = 73; + } + return pos += 2, token = 50; + } + if (text.charCodeAt(pos + 1) === 61) { + return pos += 2, token = 72; + } + pos++; + return token = 49; + } + if (text.charCodeAt(pos) === 61) { + pos++; + return token = 34; + } + } + return token; + } + function reScanAsteriskEqualsToken() { + Debug.assert(token === 67, "'reScanAsteriskEqualsToken' should only be called on a '*='"); + pos = tokenStart + 1; + return token = 64; + } + function reScanSlashToken() { + if (token === 44 || token === 69) { + let p7 = tokenStart + 1; + let inEscape = false; + let inCharacterClass = false; + while (true) { + if (p7 >= end) { + tokenFlags |= 4; + error22(Diagnostics.Unterminated_regular_expression_literal); + break; + } + const ch = text.charCodeAt(p7); + if (isLineBreak2(ch)) { + tokenFlags |= 4; + error22(Diagnostics.Unterminated_regular_expression_literal); + break; + } + if (inEscape) { + inEscape = false; + } else if (ch === 47 && !inCharacterClass) { + p7++; + break; + } else if (ch === 91) { + inCharacterClass = true; + } else if (ch === 92) { + inEscape = true; + } else if (ch === 93) { + inCharacterClass = false; + } + p7++; + } + while (p7 < end && isIdentifierPart(text.charCodeAt(p7), languageVersion)) { + p7++; + } + pos = p7; + tokenValue = text.substring(tokenStart, pos); + token = 14; + } + return token; + } + function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) { + const type3 = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx); + if (type3 === void 0) { + return commentDirectives2; + } + return append( + commentDirectives2, + { + range: { pos: lineStart, end: pos }, + type: type3 + } + ); + } + function getDirectiveFromComment(text2, commentDirectiveRegEx) { + const match = commentDirectiveRegEx.exec(text2); + if (!match) { + return void 0; + } + switch (match[1]) { + case "ts-expect-error": + return 0; + case "ts-ignore": + return 1; + } + return void 0; + } + function reScanTemplateToken(isTaggedTemplate) { + pos = tokenStart; + return token = scanTemplateAndSetTokenValue(!isTaggedTemplate); + } + function reScanTemplateHeadOrNoSubstitutionTemplate() { + pos = tokenStart; + return token = scanTemplateAndSetTokenValue( + /*shouldEmitInvalidEscapeError*/ + true + ); + } + function reScanJsxToken(allowMultilineJsxText = true) { + pos = tokenStart = fullStartPos; + return token = scanJsxToken(allowMultilineJsxText); + } + function reScanLessThanToken() { + if (token === 48) { + pos = tokenStart + 1; + return token = 30; + } + return token; + } + function reScanHashToken() { + if (token === 81) { + pos = tokenStart + 1; + return token = 63; + } + return token; + } + function reScanQuestionToken() { + Debug.assert(token === 61, "'reScanQuestionToken' should only be called on a '??'"); + pos = tokenStart + 1; + return token = 58; + } + function scanJsxToken(allowMultilineJsxText = true) { + fullStartPos = tokenStart = pos; + if (pos >= end) { + return token = 1; + } + let char = text.charCodeAt(pos); + if (char === 60) { + if (text.charCodeAt(pos + 1) === 47) { + pos += 2; + return token = 31; + } + pos++; + return token = 30; + } + if (char === 123) { + pos++; + return token = 19; + } + let firstNonWhitespace = 0; + while (pos < end) { + char = text.charCodeAt(pos); + if (char === 123) { + break; + } + if (char === 60) { + if (isConflictMarkerTrivia(text, pos)) { + pos = scanConflictMarkerTrivia(text, pos, error22); + return token = 7; + } + break; + } + if (char === 62) { + error22(Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); + } + if (char === 125) { + error22(Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); + } + if (isLineBreak2(char) && firstNonWhitespace === 0) { + firstNonWhitespace = -1; + } else if (!allowMultilineJsxText && isLineBreak2(char) && firstNonWhitespace > 0) { + break; + } else if (!isWhiteSpaceLike(char)) { + firstNonWhitespace = pos; + } + pos++; + } + tokenValue = text.substring(fullStartPos, pos); + return firstNonWhitespace === -1 ? 13 : 12; + } + function scanJsxIdentifier() { + if (tokenIsIdentifierOrKeyword(token)) { + while (pos < end) { + const ch = text.charCodeAt(pos); + if (ch === 45) { + tokenValue += "-"; + pos++; + continue; + } + const oldPos = pos; + tokenValue += scanIdentifierParts(); + if (pos === oldPos) { + break; + } + } + return getIdentifierToken(); + } + return token; + } + function scanJsxAttributeValue() { + fullStartPos = pos; + switch (text.charCodeAt(pos)) { + case 34: + case 39: + tokenValue = scanString( + /*jsxAttributeString*/ + true + ); + return token = 11; + default: + return scan(); + } + } + function reScanJsxAttributeValue() { + pos = tokenStart = fullStartPos; + return scanJsxAttributeValue(); + } + function scanJSDocCommentTextToken(inBackticks) { + fullStartPos = tokenStart = pos; + tokenFlags = 0; + if (pos >= end) { + return token = 1; + } + for (let ch = text.charCodeAt(pos); pos < end && (!isLineBreak2(ch) && ch !== 96); ch = codePointAt2(text, ++pos)) { + if (!inBackticks) { + if (ch === 123) { + break; + } else if (ch === 64 && pos - 1 >= 0 && isWhiteSpaceSingleLine(text.charCodeAt(pos - 1)) && !(pos + 1 < end && isWhiteSpaceLike(text.charCodeAt(pos + 1)))) { + break; + } + } + } + if (pos === tokenStart) { + return scanJsDocToken(); + } + tokenValue = text.substring(tokenStart, pos); + return token = 82; + } + function scanJsDocToken() { + fullStartPos = tokenStart = pos; + tokenFlags = 0; + if (pos >= end) { + return token = 1; + } + const ch = codePointAt2(text, pos); + pos += charSize(ch); + switch (ch) { + case 9: + case 11: + case 12: + case 32: + while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { + pos++; + } + return token = 5; + case 64: + return token = 60; + case 13: + if (text.charCodeAt(pos) === 10) { + pos++; + } + case 10: + tokenFlags |= 1; + return token = 4; + case 42: + return token = 42; + case 123: + return token = 19; + case 125: + return token = 20; + case 91: + return token = 23; + case 93: + return token = 24; + case 60: + return token = 30; + case 62: + return token = 32; + case 61: + return token = 64; + case 44: + return token = 28; + case 46: + return token = 25; + case 96: + return token = 62; + case 35: + return token = 63; + case 92: + pos--; + const extendedCookedChar = peekExtendedUnicodeEscape(); + if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { + pos += 3; + tokenFlags |= 8; + tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); + return token = getIdentifierToken(); + } + const cookedChar = peekUnicodeEscape(); + if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { + pos += 6; + tokenFlags |= 1024; + tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); + return token = getIdentifierToken(); + } + pos++; + return token = 0; + } + if (isIdentifierStart(ch, languageVersion)) { + let char = ch; + while (pos < end && isIdentifierPart(char = codePointAt2(text, pos), languageVersion) || text.charCodeAt(pos) === 45) + pos += charSize(char); + tokenValue = text.substring(tokenStart, pos); + if (char === 92) { + tokenValue += scanIdentifierParts(); + } + return token = getIdentifierToken(); + } else { + return token = 0; + } + } + function speculationHelper(callback, isLookahead) { + const savePos = pos; + const saveStartPos = fullStartPos; + const saveTokenPos = tokenStart; + const saveToken = token; + const saveTokenValue = tokenValue; + const saveTokenFlags = tokenFlags; + const result2 = callback(); + if (!result2 || isLookahead) { + pos = savePos; + fullStartPos = saveStartPos; + tokenStart = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + tokenFlags = saveTokenFlags; + } + return result2; + } + function scanRange(start2, length3, callback) { + const saveEnd = end; + const savePos = pos; + const saveStartPos = fullStartPos; + const saveTokenPos = tokenStart; + const saveToken = token; + const saveTokenValue = tokenValue; + const saveTokenFlags = tokenFlags; + const saveErrorExpectations = commentDirectives; + setText(text, start2, length3); + const result2 = callback(); + end = saveEnd; + pos = savePos; + fullStartPos = saveStartPos; + tokenStart = saveTokenPos; + token = saveToken; + tokenValue = saveTokenValue; + tokenFlags = saveTokenFlags; + commentDirectives = saveErrorExpectations; + return result2; + } + function lookAhead(callback) { + return speculationHelper( + callback, + /*isLookahead*/ + true + ); + } + function tryScan(callback) { + return speculationHelper( + callback, + /*isLookahead*/ + false + ); + } + function getText() { + return text; + } + function clearCommentDirectives() { + commentDirectives = void 0; + } + function setText(newText, start2, length3) { + text = newText || ""; + end = length3 === void 0 ? text.length : start2 + length3; + resetTokenState(start2 || 0); + } + function setOnError(errorCallback) { + onError = errorCallback; + } + function setScriptTarget(scriptTarget) { + languageVersion = scriptTarget; + } + function setLanguageVariant(variant) { + languageVariant = variant; + } + function setScriptKind(kind) { + scriptKind = kind; + } + function setJSDocParsingMode(kind) { + jsDocParsingMode = kind; + } + function resetTokenState(position) { + Debug.assert(position >= 0); + pos = position; + fullStartPos = position; + tokenStart = position; + token = 0; + tokenValue = void 0; + tokenFlags = 0; + } + function setInJSDocType(inType) { + inJSDocType += inType ? 1 : -1; + } + } + function codePointAt2(s7, i7) { + return s7.codePointAt(i7); + } + function charSize(ch) { + if (ch >= 65536) { + return 2; + } + return 1; + } + function utf16EncodeAsStringFallback(codePoint) { + Debug.assert(0 <= codePoint && codePoint <= 1114111); + if (codePoint <= 65535) { + return String.fromCharCode(codePoint); + } + const codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 55296; + const codeUnit2 = (codePoint - 65536) % 1024 + 56320; + return String.fromCharCode(codeUnit1, codeUnit2); + } + function utf16EncodeAsString(codePoint) { + return utf16EncodeAsStringWorker(codePoint); + } + var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker; + var init_scanner2 = __esm2({ + "src/compiler/scanner.ts"() { + "use strict"; + init_ts2(); + textToKeywordObj = { + abstract: 128, + accessor: 129, + any: 133, + as: 130, + asserts: 131, + assert: 132, + bigint: 163, + boolean: 136, + break: 83, + case: 84, + catch: 85, + class: 86, + continue: 88, + const: 87, + ["constructor"]: 137, + debugger: 89, + declare: 138, + default: 90, + delete: 91, + do: 92, + else: 93, + enum: 94, + export: 95, + extends: 96, + false: 97, + finally: 98, + for: 99, + from: 161, + function: 100, + get: 139, + if: 101, + implements: 119, + import: 102, + in: 103, + infer: 140, + instanceof: 104, + interface: 120, + intrinsic: 141, + is: 142, + keyof: 143, + let: 121, + module: 144, + namespace: 145, + never: 146, + new: 105, + null: 106, + number: 150, + object: 151, + package: 122, + private: 123, + protected: 124, + public: 125, + override: 164, + out: 147, + readonly: 148, + require: 149, + global: 162, + return: 107, + satisfies: 152, + set: 153, + static: 126, + string: 154, + super: 108, + switch: 109, + symbol: 155, + this: 110, + throw: 111, + true: 112, + try: 113, + type: 156, + typeof: 114, + undefined: 157, + unique: 158, + unknown: 159, + using: 160, + var: 115, + void: 116, + while: 117, + with: 118, + yield: 127, + async: 134, + await: 135, + of: 165 + /* OfKeyword */ + }; + textToKeyword = new Map(Object.entries(textToKeywordObj)); + textToToken = new Map(Object.entries({ + ...textToKeywordObj, + "{": 19, + "}": 20, + "(": 21, + ")": 22, + "[": 23, + "]": 24, + ".": 25, + "...": 26, + ";": 27, + ",": 28, + "<": 30, + ">": 32, + "<=": 33, + ">=": 34, + "==": 35, + "!=": 36, + "===": 37, + "!==": 38, + "=>": 39, + "+": 40, + "-": 41, + "**": 43, + "*": 42, + "/": 44, + "%": 45, + "++": 46, + "--": 47, + "<<": 48, + ">": 49, + ">>>": 50, + "&": 51, + "|": 52, + "^": 53, + "!": 54, + "~": 55, + "&&": 56, + "||": 57, + "?": 58, + "??": 61, + "?.": 29, + ":": 59, + "=": 64, + "+=": 65, + "-=": 66, + "*=": 67, + "**=": 68, + "/=": 69, + "%=": 70, + "<<=": 71, + ">>=": 72, + ">>>=": 73, + "&=": 74, + "|=": 75, + "^=": 79, + "||=": 76, + "&&=": 77, + "??=": 78, + "@": 60, + "#": 63, + "`": 62 + /* BacktickToken */ + })); + unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; + unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; + unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; + commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/; + commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/; + jsDocSeeOrLink = /@(?:see|link)/i; + tokenStrings = makeReverseMap(textToToken); + mergeConflictMarkerLength = "<<<<<<<".length; + shebangTriviaRegex = /^#!.*/; + utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback; + } + }); + function isExternalModuleNameRelative(moduleName3) { + return pathIsRelative(moduleName3) || isRootedDiskPath(moduleName3); + } + function sortAndDeduplicateDiagnostics(diagnostics) { + return sortAndDeduplicate(diagnostics, compareDiagnostics); + } + function getDefaultLibFileName(options) { + switch (getEmitScriptTarget(options)) { + case 99: + return "lib.esnext.full.d.ts"; + case 9: + return "lib.es2022.full.d.ts"; + case 8: + return "lib.es2021.full.d.ts"; + case 7: + return "lib.es2020.full.d.ts"; + case 6: + return "lib.es2019.full.d.ts"; + case 5: + return "lib.es2018.full.d.ts"; + case 4: + return "lib.es2017.full.d.ts"; + case 3: + return "lib.es2016.full.d.ts"; + case 2: + return "lib.es6.d.ts"; + default: + return "lib.d.ts"; + } + } + function textSpanEnd(span) { + return span.start + span.length; + } + function textSpanIsEmpty(span) { + return span.length === 0; + } + function textSpanContainsPosition(span, position) { + return position >= span.start && position < textSpanEnd(span); + } + function textRangeContainsPositionInclusive(span, position) { + return position >= span.pos && position <= span.end; + } + function textSpanContainsTextSpan(span, other) { + return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); + } + function textSpanOverlapsWith(span, other) { + return textSpanOverlap(span, other) !== void 0; + } + function textSpanOverlap(span1, span2) { + const overlap = textSpanIntersection(span1, span2); + return overlap && overlap.length === 0 ? void 0 : overlap; + } + function textSpanIntersectsWithTextSpan(span, other) { + return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); + } + function textSpanIntersectsWith(span, start, length2) { + return decodedTextSpanIntersectsWith(span.start, span.length, start, length2); + } + function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { + const end1 = start1 + length1; + const end2 = start2 + length2; + return start2 <= end1 && end2 >= start1; + } + function textSpanIntersectsWithPosition(span, position) { + return position <= textSpanEnd(span) && position >= span.start; + } + function textSpanIntersection(span1, span2) { + const start = Math.max(span1.start, span2.start); + const end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + return start <= end ? createTextSpanFromBounds(start, end) : void 0; + } + function createTextSpan(start, length2) { + if (start < 0) { + throw new Error("start < 0"); + } + if (length2 < 0) { + throw new Error("length < 0"); + } + return { start, length: length2 }; + } + function createTextSpanFromBounds(start, end) { + return createTextSpan(start, end - start); + } + function textChangeRangeNewSpan(range2) { + return createTextSpan(range2.span.start, range2.newLength); + } + function textChangeRangeIsUnchanged(range2) { + return textSpanIsEmpty(range2.span) && range2.newLength === 0; + } + function createTextChangeRange(span, newLength) { + if (newLength < 0) { + throw new Error("newLength < 0"); + } + return { span, newLength }; + } + function collapseTextChangeRangesAcrossMultipleVersions(changes) { + if (changes.length === 0) { + return unchangedTextChangeRange; + } + if (changes.length === 1) { + return changes[0]; + } + const change0 = changes[0]; + let oldStartN = change0.span.start; + let oldEndN = textSpanEnd(change0.span); + let newEndN = oldStartN + change0.newLength; + for (let i7 = 1; i7 < changes.length; i7++) { + const nextChange = changes[i7]; + const oldStart1 = oldStartN; + const oldEnd1 = oldEndN; + const newEnd1 = newEndN; + const oldStart2 = nextChange.span.start; + const oldEnd2 = textSpanEnd(nextChange.span); + const newEnd2 = oldStart2 + nextChange.newLength; + oldStartN = Math.min(oldStart1, oldStart2); + oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); + newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); + } + return createTextChangeRange( + createTextSpanFromBounds(oldStartN, oldEndN), + /*newLength*/ + newEndN - oldStartN + ); + } + function getTypeParameterOwner(d7) { + if (d7 && d7.kind === 168) { + for (let current = d7; current; current = current.parent) { + if (isFunctionLike(current) || isClassLike(current) || current.kind === 264) { + return current; + } + } + } + } + function isParameterPropertyDeclaration(node, parent22) { + return isParameter(node) && hasSyntacticModifier( + node, + 31 + /* ParameterPropertyModifier */ + ) && parent22.kind === 176; + } + function isEmptyBindingPattern(node) { + if (isBindingPattern(node)) { + return every2(node.elements, isEmptyBindingElement); + } + return false; + } + function isEmptyBindingElement(node) { + if (isOmittedExpression(node)) { + return true; + } + return isEmptyBindingPattern(node.name); + } + function walkUpBindingElementsAndPatterns(binding3) { + let node = binding3.parent; + while (isBindingElement(node.parent)) { + node = node.parent.parent; + } + return node.parent; + } + function getCombinedFlags(node, getFlags) { + if (isBindingElement(node)) { + node = walkUpBindingElementsAndPatterns(node); + } + let flags = getFlags(node); + if (node.kind === 260) { + node = node.parent; + } + if (node && node.kind === 261) { + flags |= getFlags(node); + node = node.parent; + } + if (node && node.kind === 243) { + flags |= getFlags(node); + } + return flags; + } + function getCombinedModifierFlags(node) { + return getCombinedFlags(node, getEffectiveModifierFlags); + } + function getCombinedNodeFlagsAlwaysIncludeJSDoc(node) { + return getCombinedFlags(node, getEffectiveModifierFlagsAlwaysIncludeJSDoc); + } + function getCombinedNodeFlags(node) { + return getCombinedFlags(node, getNodeFlags); + } + function getNodeFlags(node) { + return node.flags; + } + function validateLocaleAndSetLanguage(locale, sys2, errors) { + const lowerCaseLocale = locale.toLowerCase(); + const matchResult = /^([a-z]+)([_-]([a-z]+))?$/.exec(lowerCaseLocale); + if (!matchResult) { + if (errors) { + errors.push(createCompilerDiagnostic(Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, "en", "ja-jp")); + } + return; + } + const language = matchResult[1]; + const territory = matchResult[3]; + if (contains2(supportedLocaleDirectories, lowerCaseLocale) && !trySetLanguageAndTerritory(language, territory, errors)) { + trySetLanguageAndTerritory( + language, + /*territory*/ + void 0, + errors + ); + } + setUILocale(locale); + function trySetLanguageAndTerritory(language2, territory2, errors2) { + const compilerFilePath = normalizePath(sys2.getExecutingFilePath()); + const containingDirectoryPath = getDirectoryPath(compilerFilePath); + let filePath = combinePaths(containingDirectoryPath, language2); + if (territory2) { + filePath = filePath + "-" + territory2; + } + filePath = sys2.resolvePath(combinePaths(filePath, "diagnosticMessages.generated.json")); + if (!sys2.fileExists(filePath)) { + return false; + } + let fileContents = ""; + try { + fileContents = sys2.readFile(filePath); + } catch (e10) { + if (errors2) { + errors2.push(createCompilerDiagnostic(Diagnostics.Unable_to_open_file_0, filePath)); + } + return false; + } + try { + setLocalizedDiagnosticMessages(JSON.parse(fileContents)); + } catch { + if (errors2) { + errors2.push(createCompilerDiagnostic(Diagnostics.Corrupted_locale_file_0, filePath)); + } + return false; + } + return true; + } + } + function getOriginalNode(node, nodeTest) { + if (node) { + while (node.original !== void 0) { + node = node.original; + } + } + if (!node || !nodeTest) { + return node; + } + return nodeTest(node) ? node : void 0; + } + function findAncestor(node, callback) { + while (node) { + const result2 = callback(node); + if (result2 === "quit") { + return void 0; + } else if (result2) { + return node; + } + node = node.parent; + } + return void 0; + } + function isParseTreeNode(node) { + return (node.flags & 16) === 0; + } + function getParseTreeNode(node, nodeTest) { + if (node === void 0 || isParseTreeNode(node)) { + return node; + } + node = node.original; + while (node) { + if (isParseTreeNode(node)) { + return !nodeTest || nodeTest(node) ? node : void 0; + } + node = node.original; + } + } + function escapeLeadingUnderscores(identifier) { + return identifier.length >= 2 && identifier.charCodeAt(0) === 95 && identifier.charCodeAt(1) === 95 ? "_" + identifier : identifier; + } + function unescapeLeadingUnderscores(identifier) { + const id = identifier; + return id.length >= 3 && id.charCodeAt(0) === 95 && id.charCodeAt(1) === 95 && id.charCodeAt(2) === 95 ? id.substr(1) : id; + } + function idText(identifierOrPrivateName) { + return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); + } + function identifierToKeywordKind(node) { + const token = stringToToken(node.escapedText); + return token ? tryCast(token, isKeyword) : void 0; + } + function symbolName(symbol) { + if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { + return idText(symbol.valueDeclaration.name); + } + return unescapeLeadingUnderscores(symbol.escapedName); + } + function nameForNamelessJSDocTypedef(declaration) { + const hostNode = declaration.parent.parent; + if (!hostNode) { + return void 0; + } + if (isDeclaration(hostNode)) { + return getDeclarationIdentifier(hostNode); + } + switch (hostNode.kind) { + case 243: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { + return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); + } + break; + case 244: + let expr = hostNode.expression; + if (expr.kind === 226 && expr.operatorToken.kind === 64) { + expr = expr.left; + } + switch (expr.kind) { + case 211: + return expr.name; + case 212: + const arg = expr.argumentExpression; + if (isIdentifier(arg)) { + return arg; + } + } + break; + case 217: { + return getDeclarationIdentifier(hostNode.expression); + } + case 256: { + if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { + return getDeclarationIdentifier(hostNode.statement); + } + break; + } + } + } + function getDeclarationIdentifier(node) { + const name2 = getNameOfDeclaration(node); + return name2 && isIdentifier(name2) ? name2 : void 0; + } + function nodeHasName(statement, name2) { + if (isNamedDeclaration(statement) && isIdentifier(statement.name) && idText(statement.name) === idText(name2)) { + return true; + } + if (isVariableStatement(statement) && some2(statement.declarationList.declarations, (d7) => nodeHasName(d7, name2))) { + return true; + } + return false; + } + function getNameOfJSDocTypedef(declaration) { + return declaration.name || nameForNamelessJSDocTypedef(declaration); + } + function isNamedDeclaration(node) { + return !!node.name; + } + function getNonAssignedNameOfDeclaration(declaration) { + switch (declaration.kind) { + case 80: + return declaration; + case 355: + case 348: { + const { name: name2 } = declaration; + if (name2.kind === 166) { + return name2.right; + } + break; + } + case 213: + case 226: { + const expr2 = declaration; + switch (getAssignmentDeclarationKind(expr2)) { + case 1: + case 4: + case 5: + case 3: + return getElementOrPropertyAccessArgumentExpressionOrName(expr2.left); + case 7: + case 8: + case 9: + return expr2.arguments[1]; + default: + return void 0; + } + } + case 353: + return getNameOfJSDocTypedef(declaration); + case 347: + return nameForNamelessJSDocTypedef(declaration); + case 277: { + const { expression } = declaration; + return isIdentifier(expression) ? expression : void 0; + } + case 212: + const expr = declaration; + if (isBindableStaticElementAccessExpression(expr)) { + return expr.argumentExpression; + } + } + return declaration.name; + } + function getNameOfDeclaration(declaration) { + if (declaration === void 0) + return void 0; + return getNonAssignedNameOfDeclaration(declaration) || (isFunctionExpression(declaration) || isArrowFunction(declaration) || isClassExpression(declaration) ? getAssignedName(declaration) : void 0); + } + function getAssignedName(node) { + if (!node.parent) { + return void 0; + } else if (isPropertyAssignment(node.parent) || isBindingElement(node.parent)) { + return node.parent.name; + } else if (isBinaryExpression(node.parent) && node === node.parent.right) { + if (isIdentifier(node.parent.left)) { + return node.parent.left; + } else if (isAccessExpression(node.parent.left)) { + return getElementOrPropertyAccessArgumentExpressionOrName(node.parent.left); + } + } else if (isVariableDeclaration(node.parent) && isIdentifier(node.parent.name)) { + return node.parent.name; + } + } + function getDecorators(node) { + if (hasDecorators(node)) { + return filter2(node.modifiers, isDecorator); + } + } + function getModifiers(node) { + if (hasSyntacticModifier( + node, + 98303 + /* Modifier */ + )) { + return filter2(node.modifiers, isModifier); + } + } + function getJSDocParameterTagsWorker(param, noCache) { + if (param.name) { + if (isIdentifier(param.name)) { + const name2 = param.name.escapedText; + return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name2); + } else { + const i7 = param.parent.parameters.indexOf(param); + Debug.assert(i7 > -1, "Parameters should always be in their parents' parameter list"); + const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag); + if (i7 < paramTags.length) { + return [paramTags[i7]]; + } + } + } + return emptyArray; + } + function getJSDocParameterTags(param) { + return getJSDocParameterTagsWorker( + param, + /*noCache*/ + false + ); + } + function getJSDocParameterTagsNoCache(param) { + return getJSDocParameterTagsWorker( + param, + /*noCache*/ + true + ); + } + function getJSDocTypeParameterTagsWorker(param, noCache) { + const name2 = param.name.escapedText; + return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocTemplateTag(tag) && tag.typeParameters.some((tp) => tp.name.escapedText === name2)); + } + function getJSDocTypeParameterTags(param) { + return getJSDocTypeParameterTagsWorker( + param, + /*noCache*/ + false + ); + } + function getJSDocTypeParameterTagsNoCache(param) { + return getJSDocTypeParameterTagsWorker( + param, + /*noCache*/ + true + ); + } + function hasJSDocParameterTags(node) { + return !!getFirstJSDocTag(node, isJSDocParameterTag); + } + function getJSDocAugmentsTag(node) { + return getFirstJSDocTag(node, isJSDocAugmentsTag); + } + function getJSDocImplementsTags(node) { + return getAllJSDocTags(node, isJSDocImplementsTag); + } + function getJSDocClassTag(node) { + return getFirstJSDocTag(node, isJSDocClassTag); + } + function getJSDocPublicTag(node) { + return getFirstJSDocTag(node, isJSDocPublicTag); + } + function getJSDocPublicTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocPublicTag, + /*noCache*/ + true + ); + } + function getJSDocPrivateTag(node) { + return getFirstJSDocTag(node, isJSDocPrivateTag); + } + function getJSDocPrivateTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocPrivateTag, + /*noCache*/ + true + ); + } + function getJSDocProtectedTag(node) { + return getFirstJSDocTag(node, isJSDocProtectedTag); + } + function getJSDocProtectedTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocProtectedTag, + /*noCache*/ + true + ); + } + function getJSDocReadonlyTag(node) { + return getFirstJSDocTag(node, isJSDocReadonlyTag); + } + function getJSDocReadonlyTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocReadonlyTag, + /*noCache*/ + true + ); + } + function getJSDocOverrideTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocOverrideTag, + /*noCache*/ + true + ); + } + function getJSDocDeprecatedTag(node) { + return getFirstJSDocTag(node, isJSDocDeprecatedTag); + } + function getJSDocDeprecatedTagNoCache(node) { + return getFirstJSDocTag( + node, + isJSDocDeprecatedTag, + /*noCache*/ + true + ); + } + function getJSDocEnumTag(node) { + return getFirstJSDocTag(node, isJSDocEnumTag); + } + function getJSDocThisTag(node) { + return getFirstJSDocTag(node, isJSDocThisTag); + } + function getJSDocReturnTag(node) { + return getFirstJSDocTag(node, isJSDocReturnTag); + } + function getJSDocTemplateTag(node) { + return getFirstJSDocTag(node, isJSDocTemplateTag); + } + function getJSDocSatisfiesTag(node) { + return getFirstJSDocTag(node, isJSDocSatisfiesTag); + } + function getJSDocTypeTag(node) { + const tag = getFirstJSDocTag(node, isJSDocTypeTag); + if (tag && tag.typeExpression && tag.typeExpression.type) { + return tag; + } + return void 0; + } + function getJSDocType(node) { + let tag = getFirstJSDocTag(node, isJSDocTypeTag); + if (!tag && isParameter(node)) { + tag = find2(getJSDocParameterTags(node), (tag2) => !!tag2.typeExpression); + } + return tag && tag.typeExpression && tag.typeExpression.type; + } + function getJSDocReturnType(node) { + const returnTag = getJSDocReturnTag(node); + if (returnTag && returnTag.typeExpression) { + return returnTag.typeExpression.type; + } + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression) { + const type3 = typeTag.typeExpression.type; + if (isTypeLiteralNode(type3)) { + const sig = find2(type3.members, isCallSignatureDeclaration); + return sig && sig.type; + } + if (isFunctionTypeNode(type3) || isJSDocFunctionType(type3)) { + return type3.type; + } + } + } + function getJSDocTagsWorker(node, noCache) { + var _a2; + if (!canHaveJSDoc(node)) + return emptyArray; + let tags6 = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache; + if (tags6 === void 0 || noCache) { + const comments = getJSDocCommentsAndTags(node, noCache); + Debug.assert(comments.length < 2 || comments[0] !== comments[1]); + tags6 = flatMap2(comments, (j6) => isJSDoc(j6) ? j6.tags : j6); + if (!noCache) { + node.jsDoc ?? (node.jsDoc = []); + node.jsDoc.jsDocCache = tags6; + } + } + return tags6; + } + function getJSDocTags(node) { + return getJSDocTagsWorker( + node, + /*noCache*/ + false + ); + } + function getJSDocTagsNoCache(node) { + return getJSDocTagsWorker( + node, + /*noCache*/ + true + ); + } + function getFirstJSDocTag(node, predicate, noCache) { + return find2(getJSDocTagsWorker(node, noCache), predicate); + } + function getAllJSDocTags(node, predicate) { + return getJSDocTags(node).filter(predicate); + } + function getAllJSDocTagsOfKind(node, kind) { + return getJSDocTags(node).filter((doc) => doc.kind === kind); + } + function getTextOfJSDocComment(comment) { + return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c7) => c7.kind === 328 ? c7.text : formatJSDocLink(c7)).join(""); + } + function formatJSDocLink(link2) { + const kind = link2.kind === 331 ? "link" : link2.kind === 332 ? "linkcode" : "linkplain"; + const name2 = link2.name ? entityNameToString(link2.name) : ""; + const space = link2.name && link2.text.startsWith("://") ? "" : " "; + return `{@${kind} ${name2}${space}${link2.text}}`; + } + function getEffectiveTypeParameterDeclarations(node) { + if (isJSDocSignature(node)) { + if (isJSDocOverloadTag(node.parent)) { + const jsDoc = getJSDocRoot(node.parent); + if (jsDoc && length(jsDoc.tags)) { + return flatMap2(jsDoc.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); + } + } + return emptyArray; + } + if (isJSDocTypeAlias(node)) { + Debug.assert( + node.parent.kind === 327 + /* JSDoc */ + ); + return flatMap2(node.parent.tags, (tag) => isJSDocTemplateTag(tag) ? tag.typeParameters : void 0); + } + if (node.typeParameters) { + return node.typeParameters; + } + if (canHaveIllegalTypeParameters(node) && node.typeParameters) { + return node.typeParameters; + } + if (isInJSFile(node)) { + const decls = getJSDocTypeParameterDeclarations(node); + if (decls.length) { + return decls; + } + const typeTag = getJSDocType(node); + if (typeTag && isFunctionTypeNode(typeTag) && typeTag.typeParameters) { + return typeTag.typeParameters; + } + } + return emptyArray; + } + function getEffectiveConstraintOfTypeParameter(node) { + return node.constraint ? node.constraint : isJSDocTemplateTag(node.parent) && node === node.parent.typeParameters[0] ? node.parent.constraint : void 0; + } + function isMemberName(node) { + return node.kind === 80 || node.kind === 81; + } + function isGetOrSetAccessorDeclaration(node) { + return node.kind === 178 || node.kind === 177; + } + function isPropertyAccessChain(node) { + return isPropertyAccessExpression(node) && !!(node.flags & 64); + } + function isElementAccessChain(node) { + return isElementAccessExpression(node) && !!(node.flags & 64); + } + function isCallChain(node) { + return isCallExpression(node) && !!(node.flags & 64); + } + function isOptionalChain(node) { + const kind = node.kind; + return !!(node.flags & 64) && (kind === 211 || kind === 212 || kind === 213 || kind === 235); + } + function isOptionalChainRoot(node) { + return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; + } + function isExpressionOfOptionalChainRoot(node) { + return isOptionalChainRoot(node.parent) && node.parent.expression === node; + } + function isOutermostOptionalChain(node) { + return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; + } + function isNullishCoalesce(node) { + return node.kind === 226 && node.operatorToken.kind === 61; + } + function isConstTypeReference(node) { + return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "const" && !node.typeArguments; + } + function skipPartiallyEmittedExpressions(node) { + return skipOuterExpressions( + node, + 8 + /* PartiallyEmittedExpressions */ + ); + } + function isNonNullChain(node) { + return isNonNullExpression(node) && !!(node.flags & 64); + } + function isBreakOrContinueStatement(node) { + return node.kind === 252 || node.kind === 251; + } + function isNamedExportBindings(node) { + return node.kind === 280 || node.kind === 279; + } + function isUnparsedTextLike(node) { + switch (node.kind) { + case 309: + case 310: + return true; + default: + return false; + } + } + function isUnparsedNode(node) { + return isUnparsedTextLike(node) || node.kind === 307 || node.kind === 311; + } + function isJSDocPropertyLikeTag(node) { + return node.kind === 355 || node.kind === 348; + } + function isNode2(node) { + return isNodeKind(node.kind); + } + function isNodeKind(kind) { + return kind >= 166; + } + function isTokenKind(kind) { + return kind >= 0 && kind <= 165; + } + function isToken(n7) { + return isTokenKind(n7.kind); + } + function isNodeArray(array) { + return hasProperty(array, "pos") && hasProperty(array, "end"); + } + function isLiteralKind(kind) { + return 9 <= kind && kind <= 15; + } + function isLiteralExpression(node) { + return isLiteralKind(node.kind); + } + function isLiteralExpressionOfObject(node) { + switch (node.kind) { + case 210: + case 209: + case 14: + case 218: + case 231: + return true; + } + return false; + } + function isTemplateLiteralKind(kind) { + return 15 <= kind && kind <= 18; + } + function isTemplateLiteralToken(node) { + return isTemplateLiteralKind(node.kind); + } + function isTemplateMiddleOrTemplateTail(node) { + const kind = node.kind; + return kind === 17 || kind === 18; + } + function isImportOrExportSpecifier(node) { + return isImportSpecifier(node) || isExportSpecifier(node); + } + function isTypeOnlyImportDeclaration(node) { + switch (node.kind) { + case 276: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 274: + return node.parent.isTypeOnly; + case 273: + case 271: + return node.isTypeOnly; + } + return false; + } + function isTypeOnlyExportDeclaration(node) { + switch (node.kind) { + case 281: + return node.isTypeOnly || node.parent.parent.isTypeOnly; + case 278: + return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause; + case 280: + return node.parent.isTypeOnly; + } + return false; + } + function isTypeOnlyImportOrExportDeclaration(node) { + return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); + } + function isStringTextContainingNode(node) { + return node.kind === 11 || isTemplateLiteralKind(node.kind); + } + function isImportAttributeName(node) { + return isStringLiteral(node) || isIdentifier(node); + } + function isGeneratedIdentifier(node) { + var _a2; + return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; + } + function isGeneratedPrivateIdentifier(node) { + var _a2; + return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0; + } + function isFileLevelReservedGeneratedIdentifier(node) { + const flags = node.emitNode.autoGenerate.flags; + return !!(flags & 32) && !!(flags & 16) && !!(flags & 8); + } + function isPrivateIdentifierClassElementDeclaration(node) { + return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); + } + function isPrivateIdentifierPropertyAccessExpression(node) { + return isPropertyAccessExpression(node) && isPrivateIdentifier(node.name); + } + function isModifierKind(token) { + switch (token) { + case 128: + case 129: + case 134: + case 87: + case 138: + case 90: + case 95: + case 103: + case 125: + case 123: + case 124: + case 148: + case 126: + case 147: + case 164: + return true; + } + return false; + } + function isParameterPropertyModifier(kind) { + return !!(modifierToFlag(kind) & 31); + } + function isClassMemberModifier(idToken) { + return isParameterPropertyModifier(idToken) || idToken === 126 || idToken === 164 || idToken === 129; + } + function isModifier(node) { + return isModifierKind(node.kind); + } + function isEntityName(node) { + const kind = node.kind; + return kind === 166 || kind === 80; + } + function isPropertyName(node) { + const kind = node.kind; + return kind === 80 || kind === 81 || kind === 11 || kind === 9 || kind === 167; + } + function isBindingName(node) { + const kind = node.kind; + return kind === 80 || kind === 206 || kind === 207; + } + function isFunctionLike(node) { + return !!node && isFunctionLikeKind(node.kind); + } + function isFunctionLikeOrClassStaticBlockDeclaration(node) { + return !!node && (isFunctionLikeKind(node.kind) || isClassStaticBlockDeclaration(node)); + } + function isFunctionLikeDeclaration(node) { + return node && isFunctionLikeDeclarationKind(node.kind); + } + function isBooleanLiteral(node) { + return node.kind === 112 || node.kind === 97; + } + function isFunctionLikeDeclarationKind(kind) { + switch (kind) { + case 262: + case 174: + case 176: + case 177: + case 178: + case 218: + case 219: + return true; + default: + return false; + } + } + function isFunctionLikeKind(kind) { + switch (kind) { + case 173: + case 179: + case 330: + case 180: + case 181: + case 184: + case 324: + case 185: + return true; + default: + return isFunctionLikeDeclarationKind(kind); + } + } + function isFunctionOrModuleBlock(node) { + return isSourceFile(node) || isModuleBlock(node) || isBlock2(node) && isFunctionLike(node.parent); + } + function isClassElement(node) { + const kind = node.kind; + return kind === 176 || kind === 172 || kind === 174 || kind === 177 || kind === 178 || kind === 181 || kind === 175 || kind === 240; + } + function isClassLike(node) { + return node && (node.kind === 263 || node.kind === 231); + } + function isAccessor(node) { + return node && (node.kind === 177 || node.kind === 178); + } + function isAutoAccessorPropertyDeclaration(node) { + return isPropertyDeclaration(node) && hasAccessorModifier(node); + } + function isClassInstanceProperty(node) { + if (isInJSFile(node) && isExpandoPropertyDeclaration(node)) { + return (!isBindableStaticAccessExpression(node) || !isPrototypeAccess(node.expression)) && !isBindableStaticNameExpression( + node, + /*excludeThisKeyword*/ + true + ); + } + return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node); + } + function isMethodOrAccessor(node) { + switch (node.kind) { + case 174: + case 177: + case 178: + return true; + default: + return false; + } + } + function isNamedClassElement(node) { + switch (node.kind) { + case 174: + case 177: + case 178: + case 172: + return true; + default: + return false; + } + } + function isModifierLike(node) { + return isModifier(node) || isDecorator(node); + } + function isTypeElement(node) { + const kind = node.kind; + return kind === 180 || kind === 179 || kind === 171 || kind === 173 || kind === 181 || kind === 177 || kind === 178; + } + function isClassOrTypeElement(node) { + return isTypeElement(node) || isClassElement(node); + } + function isObjectLiteralElementLike(node) { + const kind = node.kind; + return kind === 303 || kind === 304 || kind === 305 || kind === 174 || kind === 177 || kind === 178; + } + function isTypeNode(node) { + return isTypeNodeKind(node.kind); + } + function isFunctionOrConstructorTypeNode(node) { + switch (node.kind) { + case 184: + case 185: + return true; + } + return false; + } + function isBindingPattern(node) { + if (node) { + const kind = node.kind; + return kind === 207 || kind === 206; + } + return false; + } + function isAssignmentPattern(node) { + const kind = node.kind; + return kind === 209 || kind === 210; + } + function isArrayBindingElement(node) { + const kind = node.kind; + return kind === 208 || kind === 232; + } + function isDeclarationBindingElement(bindingElement) { + switch (bindingElement.kind) { + case 260: + case 169: + case 208: + return true; + } + return false; + } + function isBindingOrAssignmentElement(node) { + return isVariableDeclaration(node) || isParameter(node) || isObjectBindingOrAssignmentElement(node) || isArrayBindingOrAssignmentElement(node); + } + function isBindingOrAssignmentPattern(node) { + return isObjectBindingOrAssignmentPattern(node) || isArrayBindingOrAssignmentPattern(node); + } + function isObjectBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 206: + case 210: + return true; + } + return false; + } + function isObjectBindingOrAssignmentElement(node) { + switch (node.kind) { + case 208: + case 303: + case 304: + case 305: + return true; + } + return false; + } + function isArrayBindingOrAssignmentPattern(node) { + switch (node.kind) { + case 207: + case 209: + return true; + } + return false; + } + function isArrayBindingOrAssignmentElement(node) { + switch (node.kind) { + case 208: + case 232: + case 230: + case 209: + case 210: + case 80: + case 211: + case 212: + return true; + } + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ); + } + function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) { + const kind = node.kind; + return kind === 211 || kind === 166 || kind === 205; + } + function isPropertyAccessOrQualifiedName(node) { + const kind = node.kind; + return kind === 211 || kind === 166; + } + function isCallLikeOrFunctionLikeExpression(node) { + return isCallLikeExpression(node) || isFunctionExpressionOrArrowFunction(node); + } + function isCallLikeExpression(node) { + switch (node.kind) { + case 286: + case 285: + case 213: + case 214: + case 215: + case 170: + return true; + default: + return false; + } + } + function isCallOrNewExpression(node) { + return node.kind === 213 || node.kind === 214; + } + function isTemplateLiteral(node) { + const kind = node.kind; + return kind === 228 || kind === 15; + } + function isLeftHandSideExpression(node) { + return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + function isLeftHandSideExpressionKind(kind) { + switch (kind) { + case 211: + case 212: + case 214: + case 213: + case 284: + case 285: + case 288: + case 215: + case 209: + case 217: + case 210: + case 231: + case 218: + case 80: + case 81: + case 14: + case 9: + case 10: + case 11: + case 15: + case 228: + case 97: + case 106: + case 110: + case 112: + case 108: + case 235: + case 233: + case 236: + case 102: + case 282: + return true; + default: + return false; + } + } + function isUnaryExpression(node) { + return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + function isUnaryExpressionKind(kind) { + switch (kind) { + case 224: + case 225: + case 220: + case 221: + case 222: + case 223: + case 216: + return true; + default: + return isLeftHandSideExpressionKind(kind); + } + } + function isUnaryExpressionWithWrite(expr) { + switch (expr.kind) { + case 225: + return true; + case 224: + return expr.operator === 46 || expr.operator === 47; + default: + return false; + } + } + function isLiteralTypeLiteral(node) { + switch (node.kind) { + case 106: + case 112: + case 97: + case 224: + return true; + default: + return isLiteralExpression(node); + } + } + function isExpression(node) { + return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); + } + function isExpressionKind(kind) { + switch (kind) { + case 227: + case 229: + case 219: + case 226: + case 230: + case 234: + case 232: + case 361: + case 360: + case 238: + return true; + default: + return isUnaryExpressionKind(kind); + } + } + function isAssertionExpression(node) { + const kind = node.kind; + return kind === 216 || kind === 234; + } + function isNotEmittedOrPartiallyEmittedNode(node) { + return isNotEmittedStatement(node) || isPartiallyEmittedExpression(node); + } + function isIterationStatement(node, lookInLabeledStatements) { + switch (node.kind) { + case 248: + case 249: + case 250: + case 246: + case 247: + return true; + case 256: + return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); + } + return false; + } + function isScopeMarker(node) { + return isExportAssignment(node) || isExportDeclaration(node); + } + function hasScopeMarker(statements) { + return some2(statements, isScopeMarker); + } + function needsScopeMarker(result2) { + return !isAnyImportOrReExport(result2) && !isExportAssignment(result2) && !hasSyntacticModifier( + result2, + 32 + /* Export */ + ) && !isAmbientModule(result2); + } + function isExternalModuleIndicator(result2) { + return isAnyImportOrReExport(result2) || isExportAssignment(result2) || hasSyntacticModifier( + result2, + 32 + /* Export */ + ); + } + function isForInOrOfStatement(node) { + return node.kind === 249 || node.kind === 250; + } + function isConciseBody(node) { + return isBlock2(node) || isExpression(node); + } + function isFunctionBody(node) { + return isBlock2(node); + } + function isForInitializer(node) { + return isVariableDeclarationList(node) || isExpression(node); + } + function isModuleBody(node) { + const kind = node.kind; + return kind === 268 || kind === 267 || kind === 80; + } + function isNamespaceBody(node) { + const kind = node.kind; + return kind === 268 || kind === 267; + } + function isJSDocNamespaceBody(node) { + const kind = node.kind; + return kind === 80 || kind === 267; + } + function isNamedImportBindings(node) { + const kind = node.kind; + return kind === 275 || kind === 274; + } + function isModuleOrEnumDeclaration(node) { + return node.kind === 267 || node.kind === 266; + } + function canHaveSymbol(node) { + switch (node.kind) { + case 219: + case 226: + case 208: + case 213: + case 179: + case 263: + case 231: + case 175: + case 176: + case 185: + case 180: + case 212: + case 266: + case 306: + case 277: + case 278: + case 281: + case 262: + case 218: + case 184: + case 177: + case 80: + case 273: + case 271: + case 276: + case 181: + case 264: + case 345: + case 347: + case 324: + case 348: + case 355: + case 330: + case 353: + case 329: + case 291: + case 292: + case 293: + case 200: + case 174: + case 173: + case 267: + case 202: + case 280: + case 270: + case 274: + case 214: + case 15: + case 9: + case 210: + case 169: + case 211: + case 303: + case 172: + case 171: + case 178: + case 304: + case 312: + case 305: + case 11: + case 265: + case 187: + case 168: + case 260: + return true; + default: + return false; + } + } + function canHaveLocals(node) { + switch (node.kind) { + case 219: + case 241: + case 179: + case 269: + case 299: + case 175: + case 194: + case 176: + case 185: + case 180: + case 248: + case 249: + case 250: + case 262: + case 218: + case 184: + case 177: + case 181: + case 345: + case 347: + case 324: + case 330: + case 353: + case 200: + case 174: + case 173: + case 267: + case 178: + case 312: + case 265: + return true; + default: + return false; + } + } + function isDeclarationKind(kind) { + return kind === 219 || kind === 208 || kind === 263 || kind === 231 || kind === 175 || kind === 176 || kind === 266 || kind === 306 || kind === 281 || kind === 262 || kind === 218 || kind === 177 || kind === 273 || kind === 271 || kind === 276 || kind === 264 || kind === 291 || kind === 174 || kind === 173 || kind === 267 || kind === 270 || kind === 274 || kind === 280 || kind === 169 || kind === 303 || kind === 172 || kind === 171 || kind === 178 || kind === 304 || kind === 265 || kind === 168 || kind === 260 || kind === 353 || kind === 345 || kind === 355; + } + function isDeclarationStatementKind(kind) { + return kind === 262 || kind === 282 || kind === 263 || kind === 264 || kind === 265 || kind === 266 || kind === 267 || kind === 272 || kind === 271 || kind === 278 || kind === 277 || kind === 270; + } + function isStatementKindButNotDeclarationKind(kind) { + return kind === 252 || kind === 251 || kind === 259 || kind === 246 || kind === 244 || kind === 242 || kind === 249 || kind === 250 || kind === 248 || kind === 245 || kind === 256 || kind === 253 || kind === 255 || kind === 257 || kind === 258 || kind === 243 || kind === 247 || kind === 254 || kind === 359; + } + function isDeclaration(node) { + if (node.kind === 168) { + return node.parent && node.parent.kind !== 352 || isInJSFile(node); + } + return isDeclarationKind(node.kind); + } + function isDeclarationStatement(node) { + return isDeclarationStatementKind(node.kind); + } + function isStatementButNotDeclaration(node) { + return isStatementKindButNotDeclarationKind(node.kind); + } + function isStatement(node) { + const kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); + } + function isBlockStatement(node) { + if (node.kind !== 241) + return false; + if (node.parent !== void 0) { + if (node.parent.kind === 258 || node.parent.kind === 299) { + return false; + } + } + return !isFunctionBlock(node); + } + function isStatementOrBlock(node) { + const kind = node.kind; + return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 241; + } + function isModuleReference(node) { + const kind = node.kind; + return kind === 283 || kind === 166 || kind === 80; + } + function isJsxTagNameExpression(node) { + const kind = node.kind; + return kind === 110 || kind === 80 || kind === 211 || kind === 295; + } + function isJsxChild(node) { + const kind = node.kind; + return kind === 284 || kind === 294 || kind === 285 || kind === 12 || kind === 288; + } + function isJsxAttributeLike(node) { + const kind = node.kind; + return kind === 291 || kind === 293; + } + function isStringLiteralOrJsxExpression(node) { + const kind = node.kind; + return kind === 11 || kind === 294; + } + function isJsxOpeningLikeElement(node) { + const kind = node.kind; + return kind === 286 || kind === 285; + } + function isCaseOrDefaultClause(node) { + const kind = node.kind; + return kind === 296 || kind === 297; + } + function isJSDocNode(node) { + return node.kind >= 316 && node.kind <= 357; + } + function isJSDocCommentContainingNode(node) { + return node.kind === 327 || node.kind === 326 || node.kind === 328 || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node); + } + function isJSDocTag(node) { + return node.kind >= 334 && node.kind <= 357; + } + function isSetAccessor(node) { + return node.kind === 178; + } + function isGetAccessor(node) { + return node.kind === 177; + } + function hasJSDocNodes(node) { + if (!canHaveJSDoc(node)) + return false; + const { jsDoc } = node; + return !!jsDoc && jsDoc.length > 0; + } + function hasType(node) { + return !!node.type; + } + function hasInitializer(node) { + return !!node.initializer; + } + function hasOnlyExpressionInitializer(node) { + switch (node.kind) { + case 260: + case 169: + case 208: + case 172: + case 303: + case 306: + return true; + default: + return false; + } + } + function isObjectLiteralElement(node) { + return node.kind === 291 || node.kind === 293 || isObjectLiteralElementLike(node); + } + function isTypeReferenceType(node) { + return node.kind === 183 || node.kind === 233; + } + function guessIndentation(lines) { + let indentation = MAX_SMI_X86; + for (const line of lines) { + if (!line.length) { + continue; + } + let i7 = 0; + for (; i7 < line.length && i7 < indentation; i7++) { + if (!isWhiteSpaceLike(line.charCodeAt(i7))) { + break; + } + } + if (i7 < indentation) { + indentation = i7; + } + if (indentation === 0) { + return 0; + } + } + return indentation === MAX_SMI_X86 ? void 0 : indentation; + } + function isStringLiteralLike(node) { + return node.kind === 11 || node.kind === 15; + } + function isJSDocLinkLike(node) { + return node.kind === 331 || node.kind === 332 || node.kind === 333; + } + function hasRestParameter(s7) { + const last22 = lastOrUndefined(s7.parameters); + return !!last22 && isRestParameter(last22); + } + function isRestParameter(node) { + const type3 = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type; + return node.dotDotDotToken !== void 0 || !!type3 && type3.kind === 325; + } + function hasInternalAnnotation(range2, sourceFile) { + const comment = sourceFile.text.substring(range2.pos, range2.end); + return comment.includes("@internal"); + } + function isInternalDeclaration(node, sourceFile) { + sourceFile ?? (sourceFile = getSourceFileOfNode(node)); + const parseTreeNode = getParseTreeNode(node); + if (parseTreeNode && parseTreeNode.kind === 169) { + const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); + const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; + const text = sourceFile.text; + const commentRanges = previousSibling ? concatenate( + // to handle + // ... parameters, /** @internal */ + // public param: string + getTrailingCommentRanges(text, skipTrivia( + text, + previousSibling.end + 1, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + )), + getLeadingCommentRanges(text, node.pos) + ) : getTrailingCommentRanges(text, skipTrivia( + text, + node.pos, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + )); + return some2(commentRanges) && hasInternalAnnotation(last2(commentRanges), sourceFile); + } + const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile); + return !!forEach4(leadingCommentRanges, (range2) => { + return hasInternalAnnotation(range2, sourceFile); + }); + } + var unchangedTextChangeRange, supportedLocaleDirectories, MAX_SMI_X86; + var init_utilitiesPublic = __esm2({ + "src/compiler/utilitiesPublic.ts"() { + "use strict"; + init_ts2(); + unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); + supportedLocaleDirectories = ["cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-br", "ru", "tr", "zh-cn", "zh-tw"]; + MAX_SMI_X86 = 1073741823; + } + }); + function getDeclarationOfKind(symbol, kind) { + const declarations = symbol.declarations; + if (declarations) { + for (const declaration of declarations) { + if (declaration.kind === kind) { + return declaration; + } + } + } + return void 0; + } + function getDeclarationsOfKind(symbol, kind) { + return filter2(symbol.declarations || emptyArray, (d7) => d7.kind === kind); + } + function createSymbolTable(symbols) { + const result2 = /* @__PURE__ */ new Map(); + if (symbols) { + for (const symbol of symbols) { + result2.set(symbol.escapedName, symbol); + } + } + return result2; + } + function isTransientSymbol(symbol) { + return (symbol.flags & 33554432) !== 0; + } + function createSingleLineStringWriter() { + var str2 = ""; + const writeText = (text) => str2 += text; + return { + getText: () => str2, + write: writeText, + rawWrite: writeText, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: (s7, _6) => writeText(s7), + writeTrailingSemicolon: writeText, + writeComment: writeText, + getTextPos: () => str2.length, + getLine: () => 0, + getColumn: () => 0, + getIndent: () => 0, + isAtStartOfLine: () => false, + hasTrailingComment: () => false, + hasTrailingWhitespace: () => !!str2.length && isWhiteSpaceLike(str2.charCodeAt(str2.length - 1)), + // Completely ignore indentation for string writers. And map newlines to + // a single space. + writeLine: () => str2 += " ", + increaseIndent: noop4, + decreaseIndent: noop4, + clear: () => str2 = "" + }; + } + function changesAffectModuleResolution(oldOptions, newOptions) { + return oldOptions.configFilePath !== newOptions.configFilePath || optionsHaveModuleResolutionChanges(oldOptions, newOptions); + } + function optionsHaveModuleResolutionChanges(oldOptions, newOptions) { + return optionsHaveChanges(oldOptions, newOptions, moduleResolutionOptionDeclarations); + } + function changesAffectingProgramStructure(oldOptions, newOptions) { + return optionsHaveChanges(oldOptions, newOptions, optionsAffectingProgramStructure); + } + function optionsHaveChanges(oldOptions, newOptions, optionDeclarations2) { + return oldOptions !== newOptions && optionDeclarations2.some((o7) => !isJsonEqual(getCompilerOptionValue(oldOptions, o7), getCompilerOptionValue(newOptions, o7))); + } + function forEachAncestor(node, callback) { + while (true) { + const res = callback(node); + if (res === "quit") + return void 0; + if (res !== void 0) + return res; + if (isSourceFile(node)) + return void 0; + node = node.parent; + } + } + function forEachEntry(map22, callback) { + const iterator = map22.entries(); + for (const [key, value2] of iterator) { + const result2 = callback(value2, key); + if (result2) { + return result2; + } + } + return void 0; + } + function forEachKey(map22, callback) { + const iterator = map22.keys(); + for (const key of iterator) { + const result2 = callback(key); + if (result2) { + return result2; + } + } + return void 0; + } + function copyEntries(source, target) { + source.forEach((value2, key) => { + target.set(key, value2); + }); + } + function usingSingleLineStringWriter(action) { + const oldString = stringWriter.getText(); + try { + action(stringWriter); + return stringWriter.getText(); + } finally { + stringWriter.clear(); + stringWriter.writeKeyword(oldString); + } + } + function getFullWidth(node) { + return node.end - node.pos; + } + function projectReferenceIsEqualTo(oldRef, newRef) { + return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular; + } + function moduleResolutionIsEqualTo(oldResolution, newResolution) { + return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.alternateResult === newResolution.alternateResult; + } + function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) { + var _a2; + const alternateResult = (_a2 = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a2.alternateResult; + const alternateResultMessage = alternateResult && (getEmitModuleResolutionKind(host.getCompilerOptions()) === 2 ? [Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_under_your_current_moduleResolution_setting_Consider_updating_to_node16_nodenext_or_bundler, [alternateResult]] : [ + Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings, + [alternateResult, alternateResult.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName] + ]); + const result2 = alternateResultMessage ? chainDiagnosticMessages( + /*details*/ + void 0, + alternateResultMessage[0], + ...alternateResultMessage[1] + ) : host.typesPackageExists(packageName) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1, + packageName, + mangleScopedPackageName(packageName) + ) : host.packageBundlesTypes(packageName) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1, + packageName, + moduleReference + ) : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + moduleReference, + mangleScopedPackageName(packageName) + ); + if (result2) + result2.repopulateInfo = () => ({ moduleReference, mode, packageName: packageName === moduleReference ? void 0 : packageName }); + return result2; + } + function packageIdIsEqual(a7, b8) { + return a7 === b8 || !!a7 && !!b8 && a7.name === b8.name && a7.subModuleName === b8.subModuleName && a7.version === b8.version; + } + function packageIdToPackageName({ name: name2, subModuleName }) { + return subModuleName ? `${name2}/${subModuleName}` : name2; + } + function packageIdToString(packageId) { + return `${packageIdToPackageName(packageId)}@${packageId.version}`; + } + function typeDirectiveIsEqualTo(oldResolution, newResolution) { + return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath; + } + function hasChangesInResolutions(names, newResolutions, getOldResolution, comparer) { + Debug.assert(names.length === newResolutions.length); + for (let i7 = 0; i7 < names.length; i7++) { + const newResolution = newResolutions[i7]; + const entry = names[i7]; + const oldResolution = getOldResolution(entry); + const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution; + if (changed) { + return true; + } + } + return false; + } + function containsParseError(node) { + aggregateChildData(node); + return (node.flags & 1048576) !== 0; + } + function aggregateChildData(node) { + if (!(node.flags & 2097152)) { + const thisNodeOrAnySubNodesHasError = (node.flags & 262144) !== 0 || forEachChild(node, containsParseError); + if (thisNodeOrAnySubNodesHasError) { + node.flags |= 1048576; + } + node.flags |= 2097152; + } + } + function getSourceFileOfNode(node) { + while (node && node.kind !== 312) { + node = node.parent; + } + return node; + } + function getSourceFileOfModule(module22) { + return getSourceFileOfNode(module22.valueDeclaration || getNonAugmentationDeclaration(module22)); + } + function isPlainJsFile(file, checkJs) { + return !!file && (file.scriptKind === 1 || file.scriptKind === 2) && !file.checkJsDirective && checkJs === void 0; + } + function isStatementWithLocals(node) { + switch (node.kind) { + case 241: + case 269: + case 248: + case 249: + case 250: + return true; + } + return false; + } + function getStartPositionOfLine(line, sourceFile) { + Debug.assert(line >= 0); + return getLineStarts(sourceFile)[line]; + } + function nodePosToString(node) { + const file = getSourceFileOfNode(node); + const loc = getLineAndCharacterOfPosition(file, node.pos); + return `${file.fileName}(${loc.line + 1},${loc.character + 1})`; + } + function getEndLinePosition(line, sourceFile) { + Debug.assert(line >= 0); + const lineStarts = getLineStarts(sourceFile); + const lineIndex = line; + const sourceText = sourceFile.text; + if (lineIndex + 1 === lineStarts.length) { + return sourceText.length - 1; + } else { + const start = lineStarts[lineIndex]; + let pos = lineStarts[lineIndex + 1] - 1; + Debug.assert(isLineBreak2(sourceText.charCodeAt(pos))); + while (start <= pos && isLineBreak2(sourceText.charCodeAt(pos))) { + pos--; + } + return pos; + } + } + function isFileLevelUniqueName(sourceFile, name2, hasGlobalName) { + return !(hasGlobalName && hasGlobalName(name2)) && !sourceFile.identifiers.has(name2); + } + function nodeIsMissing(node) { + if (node === void 0) { + return true; + } + return node.pos === node.end && node.pos >= 0 && node.kind !== 1; + } + function nodeIsPresent(node) { + return !nodeIsMissing(node); + } + function isGrammarError(parent22, child) { + if (isTypeParameterDeclaration(parent22)) + return child === parent22.expression; + if (isClassStaticBlockDeclaration(parent22)) + return child === parent22.modifiers; + if (isPropertySignature(parent22)) + return child === parent22.initializer; + if (isPropertyDeclaration(parent22)) + return child === parent22.questionToken && isAutoAccessorPropertyDeclaration(parent22); + if (isPropertyAssignment(parent22)) + return child === parent22.modifiers || child === parent22.questionToken || child === parent22.exclamationToken || isGrammarErrorElement(parent22.modifiers, child, isModifierLike); + if (isShorthandPropertyAssignment(parent22)) + return child === parent22.equalsToken || child === parent22.modifiers || child === parent22.questionToken || child === parent22.exclamationToken || isGrammarErrorElement(parent22.modifiers, child, isModifierLike); + if (isMethodDeclaration(parent22)) + return child === parent22.exclamationToken; + if (isConstructorDeclaration(parent22)) + return child === parent22.typeParameters || child === parent22.type || isGrammarErrorElement(parent22.typeParameters, child, isTypeParameterDeclaration); + if (isGetAccessorDeclaration(parent22)) + return child === parent22.typeParameters || isGrammarErrorElement(parent22.typeParameters, child, isTypeParameterDeclaration); + if (isSetAccessorDeclaration(parent22)) + return child === parent22.typeParameters || child === parent22.type || isGrammarErrorElement(parent22.typeParameters, child, isTypeParameterDeclaration); + if (isNamespaceExportDeclaration(parent22)) + return child === parent22.modifiers || isGrammarErrorElement(parent22.modifiers, child, isModifierLike); + return false; + } + function isGrammarErrorElement(nodeArray, child, isElement2) { + if (!nodeArray || isArray3(child) || !isElement2(child)) + return false; + return contains2(nodeArray, child); + } + function insertStatementsAfterPrologue(to, from, isPrologueDirective2) { + if (from === void 0 || from.length === 0) + return to; + let statementIndex = 0; + for (; statementIndex < to.length; ++statementIndex) { + if (!isPrologueDirective2(to[statementIndex])) { + break; + } + } + to.splice(statementIndex, 0, ...from); + return to; + } + function insertStatementAfterPrologue(to, statement, isPrologueDirective2) { + if (statement === void 0) + return to; + let statementIndex = 0; + for (; statementIndex < to.length; ++statementIndex) { + if (!isPrologueDirective2(to[statementIndex])) { + break; + } + } + to.splice(statementIndex, 0, statement); + return to; + } + function isAnyPrologueDirective(node) { + return isPrologueDirective(node) || !!(getEmitFlags(node) & 2097152); + } + function insertStatementsAfterStandardPrologue(to, from) { + return insertStatementsAfterPrologue(to, from, isPrologueDirective); + } + function insertStatementsAfterCustomPrologue(to, from) { + return insertStatementsAfterPrologue(to, from, isAnyPrologueDirective); + } + function insertStatementAfterStandardPrologue(to, statement) { + return insertStatementAfterPrologue(to, statement, isPrologueDirective); + } + function insertStatementAfterCustomPrologue(to, statement) { + return insertStatementAfterPrologue(to, statement, isAnyPrologueDirective); + } + function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { + if (text.charCodeAt(commentPos + 1) === 47 && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47) { + const textSubStr = text.substring(commentPos, commentEnd); + return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDModuleRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || fullTripleSlashLibReferenceRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; + } + return false; + } + function isPinnedComment(text, start) { + return text.charCodeAt(start + 1) === 42 && text.charCodeAt(start + 2) === 33; + } + function createCommentDirectivesMap(sourceFile, commentDirectives) { + const directivesByLine = new Map( + commentDirectives.map((commentDirective) => [ + `${getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line}`, + commentDirective + ]) + ); + const usedLines = /* @__PURE__ */ new Map(); + return { getUnusedExpectations, markUsed }; + function getUnusedExpectations() { + return arrayFrom(directivesByLine.entries()).filter(([line, directive]) => directive.type === 0 && !usedLines.get(line)).map(([_6, directive]) => directive); + } + function markUsed(line) { + if (!directivesByLine.has(`${line}`)) { + return false; + } + usedLines.set(`${line}`, true); + return true; + } + } + function getTokenPosOfNode(node, sourceFile, includeJsDoc) { + if (nodeIsMissing(node)) { + return node.pos; + } + if (isJSDocNode(node) || node.kind === 12) { + return skipTrivia( + (sourceFile || getSourceFileOfNode(node)).text, + node.pos, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + if (includeJsDoc && hasJSDocNodes(node)) { + return getTokenPosOfNode(node.jsDoc[0], sourceFile); + } + if (node.kind === 358 && node._children.length > 0) { + return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); + } + return skipTrivia( + (sourceFile || getSourceFileOfNode(node)).text, + node.pos, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + false, + isInJSDoc(node) + ); + } + function getNonDecoratorTokenPosOfNode(node, sourceFile) { + const lastDecorator = !nodeIsMissing(node) && canHaveModifiers(node) ? findLast2(node.modifiers, isDecorator) : void 0; + if (!lastDecorator) { + return getTokenPosOfNode(node, sourceFile); + } + return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end); + } + function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) { + return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); + } + function isJSDocTypeExpressionOrChild(node) { + return !!findAncestor(node, isJSDocTypeExpression); + } + function isExportNamespaceAsDefaultDeclaration(node) { + return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default"); + } + function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) { + if (nodeIsMissing(node)) { + return ""; + } + let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end); + if (isJSDocTypeExpressionOrChild(node)) { + text = text.split(/\r\n|\n|\r/).map((line) => line.replace(/^\s*\*/, "").trimStart()).join("\n"); + } + return text; + } + function getTextOfNode(node, includeTrivia = false) { + return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); + } + function getPos(range2) { + return range2.pos; + } + function indexOfNode(nodeArray, node) { + return binarySearch(nodeArray, node, getPos, compareValues); + } + function getEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.flags || 0; + } + function getInternalEmitFlags(node) { + const emitNode = node.emitNode; + return emitNode && emitNode.internalFlags || 0; + } + function getLiteralText(node, sourceFile, flags) { + if (sourceFile && canUseOriginalText(node, flags)) { + return getSourceTextOfNodeFromSourceFile(sourceFile, node); + } + switch (node.kind) { + case 11: { + const escapeText = flags & 2 ? escapeJsxAttributeString : flags & 1 || getEmitFlags(node) & 16777216 ? escapeString2 : escapeNonAsciiString; + if (node.singleQuote) { + return "'" + escapeText( + node.text, + 39 + /* singleQuote */ + ) + "'"; + } else { + return '"' + escapeText( + node.text, + 34 + /* doubleQuote */ + ) + '"'; + } + } + case 15: + case 16: + case 17: + case 18: { + const escapeText = flags & 1 || getEmitFlags(node) & 16777216 ? escapeString2 : escapeNonAsciiString; + const rawText = node.rawText ?? escapeTemplateSubstitution(escapeText( + node.text, + 96 + /* backtick */ + )); + switch (node.kind) { + case 15: + return "`" + rawText + "`"; + case 16: + return "`" + rawText + "${"; + case 17: + return "}" + rawText + "${"; + case 18: + return "}" + rawText + "`"; + } + break; + } + case 9: + case 10: + return node.text; + case 14: + if (flags & 4 && node.isUnterminated) { + return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 ? " /" : "/"); + } + return node.text; + } + return Debug.fail(`Literal kind '${node.kind}' not accounted for.`); + } + function canUseOriginalText(node, flags) { + if (nodeIsSynthesized(node) || !node.parent || flags & 4 && node.isUnterminated) { + return false; + } + if (isNumericLiteral(node)) { + if (node.numericLiteralFlags & 26656) { + return false; + } + if (node.numericLiteralFlags & 512) { + return !!(flags & 8); + } + } + return !isBigIntLiteral(node); + } + function getTextOfConstantValue(value2) { + return isString4(value2) ? '"' + escapeNonAsciiString(value2) + '"' : "" + value2; + } + function makeIdentifierFromModuleName(moduleName3) { + return getBaseFileName(moduleName3).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); + } + function isBlockOrCatchScoped(declaration) { + return (getCombinedNodeFlags(declaration) & 7) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); + } + function isCatchClauseVariableDeclarationOrBindingElement(declaration) { + const node = getRootDeclaration(declaration); + return node.kind === 260 && node.parent.kind === 299; + } + function isAmbientModule(node) { + return isModuleDeclaration(node) && (node.name.kind === 11 || isGlobalScopeAugmentation(node)); + } + function isModuleWithStringLiteralName(node) { + return isModuleDeclaration(node) && node.name.kind === 11; + } + function isNonGlobalAmbientModule(node) { + return isModuleDeclaration(node) && isStringLiteral(node.name); + } + function isEffectiveModuleDeclaration(node) { + return isModuleDeclaration(node) || isIdentifier(node); + } + function isShorthandAmbientModuleSymbol(moduleSymbol) { + return isShorthandAmbientModule(moduleSymbol.valueDeclaration); + } + function isShorthandAmbientModule(node) { + return !!node && node.kind === 267 && !node.body; + } + function isBlockScopedContainerTopLevel(node) { + return node.kind === 312 || node.kind === 267 || isFunctionLikeOrClassStaticBlockDeclaration(node); + } + function isGlobalScopeAugmentation(module22) { + return !!(module22.flags & 2048); + } + function isExternalModuleAugmentation(node) { + return isAmbientModule(node) && isModuleAugmentationExternal(node); + } + function isModuleAugmentationExternal(node) { + switch (node.parent.kind) { + case 312: + return isExternalModule(node.parent); + case 268: + return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); + } + return false; + } + function getNonAugmentationDeclaration(symbol) { + var _a2; + return (_a2 = symbol.declarations) == null ? void 0 : _a2.find((d7) => !isExternalModuleAugmentation(d7) && !(isModuleDeclaration(d7) && isGlobalScopeAugmentation(d7))); + } + function isCommonJSContainingModuleKind(kind) { + return kind === 1 || kind === 100 || kind === 199; + } + function isEffectiveExternalModule(node, compilerOptions) { + return isExternalModule(node) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator; + } + function isEffectiveStrictModeSourceFile(node, compilerOptions) { + switch (node.scriptKind) { + case 1: + case 3: + case 2: + case 4: + break; + default: + return false; + } + if (node.isDeclarationFile) { + return false; + } + if (getStrictOptionValue(compilerOptions, "alwaysStrict")) { + return true; + } + if (startsWithUseStrict(node.statements)) { + return true; + } + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { + if (getEmitModuleKind(compilerOptions) >= 5) { + return true; + } + return !compilerOptions.noImplicitUseStrict; + } + return false; + } + function isAmbientPropertyDeclaration(node) { + return !!(node.flags & 33554432) || hasSyntacticModifier( + node, + 128 + /* Ambient */ + ); + } + function isBlockScope(node, parentNode) { + switch (node.kind) { + case 312: + case 269: + case 299: + case 267: + case 248: + case 249: + case 250: + case 176: + case 174: + case 177: + case 178: + case 262: + case 218: + case 219: + case 172: + case 175: + return true; + case 241: + return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); + } + return false; + } + function isDeclarationWithTypeParameters(node) { + Debug.type(node); + switch (node.kind) { + case 345: + case 353: + case 330: + return true; + default: + assertType(node); + return isDeclarationWithTypeParameterChildren(node); + } + } + function isDeclarationWithTypeParameterChildren(node) { + Debug.type(node); + switch (node.kind) { + case 179: + case 180: + case 173: + case 181: + case 184: + case 185: + case 324: + case 263: + case 231: + case 264: + case 265: + case 352: + case 262: + case 174: + case 176: + case 177: + case 178: + case 218: + case 219: + return true; + default: + assertType(node); + return false; + } + } + function isAnyImportSyntax(node) { + switch (node.kind) { + case 272: + case 271: + return true; + default: + return false; + } + } + function isAnyImportOrBareOrAccessedRequire(node) { + return isAnyImportSyntax(node) || isVariableDeclarationInitializedToBareOrAccessedRequire(node); + } + function isLateVisibilityPaintedStatement(node) { + switch (node.kind) { + case 272: + case 271: + case 243: + case 263: + case 262: + case 267: + case 265: + case 264: + case 266: + return true; + default: + return false; + } + } + function hasPossibleExternalModuleReference(node) { + return isAnyImportOrReExport(node) || isModuleDeclaration(node) || isImportTypeNode(node) || isImportCall(node); + } + function isAnyImportOrReExport(node) { + return isAnyImportSyntax(node) || isExportDeclaration(node); + } + function getEnclosingContainer(node) { + return findAncestor(node.parent, (n7) => !!(getContainerFlags(n7) & 1)); + } + function getEnclosingBlockScopeContainer(node) { + return findAncestor(node.parent, (current) => isBlockScope(current, current.parent)); + } + function forEachEnclosingBlockScopeContainer(node, cb) { + let container = getEnclosingBlockScopeContainer(node); + while (container) { + cb(container); + container = getEnclosingBlockScopeContainer(container); + } + } + function declarationNameToString(name2) { + return !name2 || getFullWidth(name2) === 0 ? "(Missing)" : getTextOfNode(name2); + } + function getNameFromIndexInfo(info2) { + return info2.declaration ? declarationNameToString(info2.declaration.parameters[0].name) : void 0; + } + function isComputedNonLiteralName(name2) { + return name2.kind === 167 && !isStringOrNumericLiteralLike(name2.expression); + } + function tryGetTextOfPropertyName(name2) { + var _a2; + switch (name2.kind) { + case 80: + case 81: + return ((_a2 = name2.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name2.escapedText; + case 11: + case 9: + case 15: + return escapeLeadingUnderscores(name2.text); + case 167: + if (isStringOrNumericLiteralLike(name2.expression)) + return escapeLeadingUnderscores(name2.expression.text); + return void 0; + case 295: + return getEscapedTextOfJsxNamespacedName(name2); + default: + return Debug.assertNever(name2); + } + } + function getTextOfPropertyName(name2) { + return Debug.checkDefined(tryGetTextOfPropertyName(name2)); + } + function entityNameToString(name2) { + switch (name2.kind) { + case 110: + return "this"; + case 81: + case 80: + return getFullWidth(name2) === 0 ? idText(name2) : getTextOfNode(name2); + case 166: + return entityNameToString(name2.left) + "." + entityNameToString(name2.right); + case 211: + if (isIdentifier(name2.name) || isPrivateIdentifier(name2.name)) { + return entityNameToString(name2.expression) + "." + entityNameToString(name2.name); + } else { + return Debug.assertNever(name2.name); + } + case 318: + return entityNameToString(name2.left) + entityNameToString(name2.right); + case 295: + return entityNameToString(name2.namespace) + ":" + entityNameToString(name2.name); + default: + return Debug.assertNever(name2); + } + } + function createDiagnosticForNode(node, message, ...args) { + const sourceFile = getSourceFileOfNode(node); + return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args); + } + function createDiagnosticForNodeArray(sourceFile, nodes, message, ...args) { + const start = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnostic(sourceFile, start, nodes.end - start, message, ...args); + } + function createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args) { + const span = getErrorSpanForNode(sourceFile, node); + return createFileDiagnostic(sourceFile, span.start, span.length, message, ...args); + } + function createDiagnosticForNodeFromMessageChain(sourceFile, node, messageChain, relatedInformation) { + const span = getErrorSpanForNode(sourceFile, node); + return createFileDiagnosticFromMessageChain(sourceFile, span.start, span.length, messageChain, relatedInformation); + } + function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, messageChain, relatedInformation) { + const start = skipTrivia(sourceFile.text, nodes.pos); + return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation); + } + function assertDiagnosticLocation(sourceText, start, length2) { + Debug.assertGreaterThanOrEqual(start, 0); + Debug.assertGreaterThanOrEqual(length2, 0); + Debug.assertLessThanOrEqual(start, sourceText.length); + Debug.assertLessThanOrEqual(start + length2, sourceText.length); + } + function createFileDiagnosticFromMessageChain(file, start, length2, messageChain, relatedInformation) { + assertDiagnosticLocation(file.text, start, length2); + return { + file, + start, + length: length2, + code: messageChain.code, + category: messageChain.category, + messageText: messageChain.next ? messageChain : messageChain.messageText, + relatedInformation + }; + } + function createDiagnosticForFileFromMessageChain(sourceFile, messageChain, relatedInformation) { + return { + file: sourceFile, + start: 0, + length: 0, + code: messageChain.code, + category: messageChain.category, + messageText: messageChain.next ? messageChain : messageChain.messageText, + relatedInformation + }; + } + function createDiagnosticMessageChainFromDiagnostic(diagnostic) { + return typeof diagnostic.messageText === "string" ? { + code: diagnostic.code, + category: diagnostic.category, + messageText: diagnostic.messageText, + next: diagnostic.next + } : diagnostic.messageText; + } + function createDiagnosticForRange(sourceFile, range2, message) { + return { + file: sourceFile, + start: range2.pos, + length: range2.end - range2.pos, + code: message.code, + category: message.category, + messageText: message.message + }; + } + function getSpanOfTokenAtPosition(sourceFile, pos) { + const scanner2 = createScanner3( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError*/ + void 0, + pos + ); + scanner2.scan(); + const start = scanner2.getTokenStart(); + return createTextSpanFromBounds(start, scanner2.getTokenEnd()); + } + function scanTokenAtPosition(sourceFile, pos) { + const scanner2 = createScanner3( + sourceFile.languageVersion, + /*skipTrivia*/ + true, + sourceFile.languageVariant, + sourceFile.text, + /*onError*/ + void 0, + pos + ); + scanner2.scan(); + return scanner2.getToken(); + } + function getErrorSpanForArrowFunction(sourceFile, node) { + const pos = skipTrivia(sourceFile.text, node.pos); + if (node.body && node.body.kind === 241) { + const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); + const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); + if (startLine < endLine) { + return createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); + } + } + return createTextSpanFromBounds(pos, node.end); + } + function getErrorSpanForNode(sourceFile, node) { + let errorNode = node; + switch (node.kind) { + case 312: { + const pos2 = skipTrivia( + sourceFile.text, + 0, + /*stopAfterLineBreak*/ + false + ); + if (pos2 === sourceFile.text.length) { + return createTextSpan(0, 0); + } + return getSpanOfTokenAtPosition(sourceFile, pos2); + } + case 260: + case 208: + case 263: + case 231: + case 264: + case 267: + case 266: + case 306: + case 262: + case 218: + case 174: + case 177: + case 178: + case 265: + case 172: + case 171: + case 274: + errorNode = node.name; + break; + case 219: + return getErrorSpanForArrowFunction(sourceFile, node); + case 296: + case 297: { + const start = skipTrivia(sourceFile.text, node.pos); + const end = node.statements.length > 0 ? node.statements[0].pos : node.end; + return createTextSpanFromBounds(start, end); + } + case 253: + case 229: { + const pos2 = skipTrivia(sourceFile.text, node.pos); + return getSpanOfTokenAtPosition(sourceFile, pos2); + } + case 238: { + const pos2 = skipTrivia(sourceFile.text, node.expression.end); + return getSpanOfTokenAtPosition(sourceFile, pos2); + } + case 357: { + const pos2 = skipTrivia(sourceFile.text, node.tagName.pos); + return getSpanOfTokenAtPosition(sourceFile, pos2); + } + } + if (errorNode === void 0) { + return getSpanOfTokenAtPosition(sourceFile, node.pos); + } + Debug.assert(!isJSDoc(errorNode)); + const isMissing = nodeIsMissing(errorNode); + const pos = isMissing || isJsxText(node) ? errorNode.pos : skipTrivia(sourceFile.text, errorNode.pos); + if (isMissing) { + Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } else { + Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + return createTextSpanFromBounds(pos, errorNode.end); + } + function isExternalOrCommonJsModule(file) { + return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; + } + function isJsonSourceFile(file) { + return file.scriptKind === 6; + } + function isEnumConst(node) { + return !!(getCombinedModifierFlags(node) & 4096); + } + function isDeclarationReadonly(declaration) { + return !!(getCombinedModifierFlags(declaration) & 8 && !isParameterPropertyDeclaration(declaration, declaration.parent)); + } + function isVarAwaitUsing(node) { + return (getCombinedNodeFlags(node) & 7) === 6; + } + function isVarUsing(node) { + return (getCombinedNodeFlags(node) & 7) === 4; + } + function isVarConst(node) { + return (getCombinedNodeFlags(node) & 7) === 2; + } + function isLet(node) { + return (getCombinedNodeFlags(node) & 7) === 1; + } + function isSuperCall(n7) { + return n7.kind === 213 && n7.expression.kind === 108; + } + function isImportCall(n7) { + return n7.kind === 213 && n7.expression.kind === 102; + } + function isImportMeta(n7) { + return isMetaProperty(n7) && n7.keywordToken === 102 && n7.name.escapedText === "meta"; + } + function isLiteralImportTypeNode(n7) { + return isImportTypeNode(n7) && isLiteralTypeNode(n7.argument) && isStringLiteral(n7.argument.literal); + } + function isPrologueDirective(node) { + return node.kind === 244 && node.expression.kind === 11; + } + function isCustomPrologue(node) { + return !!(getEmitFlags(node) & 2097152); + } + function isHoistedFunction(node) { + return isCustomPrologue(node) && isFunctionDeclaration(node); + } + function isHoistedVariable(node) { + return isIdentifier(node.name) && !node.initializer; + } + function isHoistedVariableStatement(node) { + return isCustomPrologue(node) && isVariableStatement(node) && every2(node.declarationList.declarations, isHoistedVariable); + } + function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { + return node.kind !== 12 ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; + } + function getJSDocCommentRanges(node, text) { + const commentRanges = node.kind === 169 || node.kind === 168 || node.kind === 218 || node.kind === 219 || node.kind === 217 || node.kind === 260 || node.kind === 281 ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); + return filter2( + commentRanges, + (comment) => text.charCodeAt(comment.pos + 1) === 42 && text.charCodeAt(comment.pos + 2) === 42 && text.charCodeAt(comment.pos + 3) !== 47 + /* slash */ + ); + } + function isPartOfTypeNode(node) { + if (182 <= node.kind && node.kind <= 205) { + return true; + } + switch (node.kind) { + case 133: + case 159: + case 150: + case 163: + case 154: + case 136: + case 155: + case 151: + case 157: + case 106: + case 146: + return true; + case 116: + return node.parent.kind !== 222; + case 233: + return isPartOfTypeExpressionWithTypeArguments(node); + case 168: + return node.parent.kind === 200 || node.parent.kind === 195; + case 80: + if (node.parent.kind === 166 && node.parent.right === node) { + node = node.parent; + } else if (node.parent.kind === 211 && node.parent.name === node) { + node = node.parent; + } + Debug.assert(node.kind === 80 || node.kind === 166 || node.kind === 211, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 166: + case 211: + case 110: { + const { parent: parent22 } = node; + if (parent22.kind === 186) { + return false; + } + if (parent22.kind === 205) { + return !parent22.isTypeOf; + } + if (182 <= parent22.kind && parent22.kind <= 205) { + return true; + } + switch (parent22.kind) { + case 233: + return isPartOfTypeExpressionWithTypeArguments(parent22); + case 168: + return node === parent22.constraint; + case 352: + return node === parent22.constraint; + case 172: + case 171: + case 169: + case 260: + return node === parent22.type; + case 262: + case 218: + case 219: + case 176: + case 174: + case 173: + case 177: + case 178: + return node === parent22.type; + case 179: + case 180: + case 181: + return node === parent22.type; + case 216: + return node === parent22.type; + case 213: + case 214: + case 215: + return contains2(parent22.typeArguments, node); + } + } + } + return false; + } + function isPartOfTypeExpressionWithTypeArguments(node) { + return isJSDocImplementsTag(node.parent) || isJSDocAugmentsTag(node.parent) || isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node); + } + function isChildOfNodeWithKind(node, kind) { + while (node) { + if (node.kind === kind) { + return true; + } + node = node.parent; + } + return false; + } + function forEachReturnStatement(body, visitor) { + return traverse4(body); + function traverse4(node) { + switch (node.kind) { + case 253: + return visitor(node); + case 269: + case 241: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 254: + case 255: + case 296: + case 297: + case 256: + case 258: + case 299: + return forEachChild(node, traverse4); + } + } + } + function forEachYieldExpression(body, visitor) { + return traverse4(body); + function traverse4(node) { + switch (node.kind) { + case 229: + visitor(node); + const operand = node.expression; + if (operand) { + traverse4(operand); + } + return; + case 266: + case 264: + case 267: + case 265: + return; + default: + if (isFunctionLike(node)) { + if (node.name && node.name.kind === 167) { + traverse4(node.name.expression); + return; + } + } else if (!isPartOfTypeNode(node)) { + forEachChild(node, traverse4); + } + } + } + } + function getRestParameterElementType(node) { + if (node && node.kind === 188) { + return node.elementType; + } else if (node && node.kind === 183) { + return singleOrUndefined(node.typeArguments); + } else { + return void 0; + } + } + function getMembersOfDeclaration(node) { + switch (node.kind) { + case 264: + case 263: + case 231: + case 187: + return node.members; + case 210: + return node.properties; + } + } + function isVariableLike(node) { + if (node) { + switch (node.kind) { + case 208: + case 306: + case 169: + case 303: + case 172: + case 171: + case 304: + case 260: + return true; + } + } + return false; + } + function isVariableLikeOrAccessor(node) { + return isVariableLike(node) || isAccessor(node); + } + function isVariableDeclarationInVariableStatement(node) { + return node.parent.kind === 261 && node.parent.parent.kind === 243; + } + function isCommonJsExportedExpression(node) { + if (!isInJSFile(node)) + return false; + return isObjectLiteralExpression(node.parent) && isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 || isCommonJsExportPropertyAssignment(node.parent); + } + function isCommonJsExportPropertyAssignment(node) { + if (!isInJSFile(node)) + return false; + return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1; + } + function isValidESSymbolDeclaration(node) { + return (isVariableDeclaration(node) ? isVarConst(node) && isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) : isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) : isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node); + } + function introducesArgumentsExoticObject(node) { + switch (node.kind) { + case 174: + case 173: + case 176: + case 177: + case 178: + case 262: + case 218: + return true; + } + return false; + } + function unwrapInnermostStatementOfLabel(node, beforeUnwrapLabelCallback) { + while (true) { + if (beforeUnwrapLabelCallback) { + beforeUnwrapLabelCallback(node); + } + if (node.statement.kind !== 256) { + return node.statement; + } + node = node.statement; + } + } + function isFunctionBlock(node) { + return node && node.kind === 241 && isFunctionLike(node.parent); + } + function isObjectLiteralMethod(node) { + return node && node.kind === 174 && node.parent.kind === 210; + } + function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { + return (node.kind === 174 || node.kind === 177 || node.kind === 178) && (node.parent.kind === 210 || node.parent.kind === 231); + } + function isIdentifierTypePredicate(predicate) { + return predicate && predicate.kind === 1; + } + function isThisTypePredicate(predicate) { + return predicate && predicate.kind === 0; + } + function forEachPropertyAssignment(objectLiteral, key, callback, key2) { + return forEach4(objectLiteral == null ? void 0 : objectLiteral.properties, (property2) => { + if (!isPropertyAssignment(property2)) + return void 0; + const propName2 = tryGetTextOfPropertyName(property2.name); + return key === propName2 || key2 && key2 === propName2 ? callback(property2) : void 0; + }); + } + function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) { + return forEachPropertyAssignment(objectLiteral, propKey, (property2) => isArrayLiteralExpression(property2.initializer) ? find2(property2.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0); + } + function getTsConfigObjectLiteralExpression(tsConfigSourceFile) { + if (tsConfigSourceFile && tsConfigSourceFile.statements.length) { + const expression = tsConfigSourceFile.statements[0].expression; + return tryCast(expression, isObjectLiteralExpression); + } + } + function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) { + return forEachTsConfigPropArray(tsConfigSourceFile, propKey, (property2) => isArrayLiteralExpression(property2.initializer) ? find2(property2.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0); + } + function forEachTsConfigPropArray(tsConfigSourceFile, propKey, callback) { + return forEachPropertyAssignment(getTsConfigObjectLiteralExpression(tsConfigSourceFile), propKey, callback); + } + function getContainingFunction(node) { + return findAncestor(node.parent, isFunctionLike); + } + function getContainingFunctionDeclaration(node) { + return findAncestor(node.parent, isFunctionLikeDeclaration); + } + function getContainingClass(node) { + return findAncestor(node.parent, isClassLike); + } + function getContainingClassStaticBlock(node) { + return findAncestor(node.parent, (n7) => { + if (isClassLike(n7) || isFunctionLike(n7)) { + return "quit"; + } + return isClassStaticBlockDeclaration(n7); + }); + } + function getContainingFunctionOrClassStaticBlock(node) { + return findAncestor(node.parent, isFunctionLikeOrClassStaticBlockDeclaration); + } + function getContainingClassExcludingClassDecorators(node) { + const decorator = findAncestor(node.parent, (n7) => isClassLike(n7) ? "quit" : isDecorator(n7)); + return decorator && isClassLike(decorator.parent) ? getContainingClass(decorator.parent) : getContainingClass(decorator ?? node); + } + function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) { + Debug.assert( + node.kind !== 312 + /* SourceFile */ + ); + while (true) { + node = node.parent; + if (!node) { + return Debug.fail(); + } + switch (node.kind) { + case 167: + if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) { + return node; + } + node = node.parent.parent; + break; + case 170: + if (node.parent.kind === 169 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } else if (isClassElement(node.parent)) { + node = node.parent; + } + break; + case 219: + if (!includeArrowFunctions) { + continue; + } + case 262: + case 218: + case 267: + case 175: + case 172: + case 171: + case 174: + case 173: + case 176: + case 177: + case 178: + case 179: + case 180: + case 181: + case 266: + case 312: + return node; + } + } + } + function isThisContainerOrFunctionBlock(node) { + switch (node.kind) { + case 219: + case 262: + case 218: + case 172: + return true; + case 241: + switch (node.parent.kind) { + case 176: + case 174: + case 177: + case 178: + return true; + default: + return false; + } + default: + return false; + } + } + function isInTopLevelContext(node) { + if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) { + node = node.parent; + } + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + true, + /*includeClassComputedPropertyName*/ + false + ); + return isSourceFile(container); + } + function getNewTargetContainer(node) { + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (container) { + switch (container.kind) { + case 176: + case 262: + case 218: + return container; + } + } + return void 0; + } + function getSuperContainer(node, stopOnFunctions) { + while (true) { + node = node.parent; + if (!node) { + return void 0; + } + switch (node.kind) { + case 167: + node = node.parent; + break; + case 262: + case 218: + case 219: + if (!stopOnFunctions) { + continue; + } + case 172: + case 171: + case 174: + case 173: + case 176: + case 177: + case 178: + case 175: + return node; + case 170: + if (node.parent.kind === 169 && isClassElement(node.parent.parent)) { + node = node.parent.parent; + } else if (isClassElement(node.parent)) { + node = node.parent; + } + break; + } + } + } + function getImmediatelyInvokedFunctionExpression(func) { + if (func.kind === 218 || func.kind === 219) { + let prev = func; + let parent22 = func.parent; + while (parent22.kind === 217) { + prev = parent22; + parent22 = parent22.parent; + } + if (parent22.kind === 213 && parent22.expression === prev) { + return parent22; + } + } + } + function isSuperOrSuperProperty(node) { + return node.kind === 108 || isSuperProperty(node); + } + function isSuperProperty(node) { + const kind = node.kind; + return (kind === 211 || kind === 212) && node.expression.kind === 108; + } + function isThisProperty(node) { + const kind = node.kind; + return (kind === 211 || kind === 212) && node.expression.kind === 110; + } + function isThisInitializedDeclaration(node) { + var _a2; + return !!node && isVariableDeclaration(node) && ((_a2 = node.initializer) == null ? void 0 : _a2.kind) === 110; + } + function isThisInitializedObjectBindingExpression(node) { + return !!node && (isShorthandPropertyAssignment(node) || isPropertyAssignment(node)) && isBinaryExpression(node.parent.parent) && node.parent.parent.operatorToken.kind === 64 && node.parent.parent.right.kind === 110; + } + function getEntityNameFromTypeNode(node) { + switch (node.kind) { + case 183: + return node.typeName; + case 233: + return isEntityNameExpression(node.expression) ? node.expression : void 0; + case 80: + case 166: + return node; + } + return void 0; + } + function getInvokedExpression(node) { + switch (node.kind) { + case 215: + return node.tag; + case 286: + case 285: + return node.tagName; + case 226: + return node.right; + default: + return node.expression; + } + } + function nodeCanBeDecorated(useLegacyDecorators, node, parent22, grandparent) { + if (useLegacyDecorators && isNamedDeclaration(node) && isPrivateIdentifier(node.name)) { + return false; + } + switch (node.kind) { + case 263: + return true; + case 231: + return !useLegacyDecorators; + case 172: + return parent22 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent22) : isClassLike(parent22) && !hasAbstractModifier(node) && !hasAmbientModifier(node)); + case 177: + case 178: + case 174: + return node.body !== void 0 && parent22 !== void 0 && (useLegacyDecorators ? isClassDeclaration(parent22) : isClassLike(parent22)); + case 169: + if (!useLegacyDecorators) + return false; + return parent22 !== void 0 && parent22.body !== void 0 && (parent22.kind === 176 || parent22.kind === 174 || parent22.kind === 178) && getThisParameter(parent22) !== node && grandparent !== void 0 && grandparent.kind === 263; + } + return false; + } + function nodeIsDecorated(useLegacyDecorators, node, parent22, grandparent) { + return hasDecorators(node) && nodeCanBeDecorated(useLegacyDecorators, node, parent22, grandparent); + } + function nodeOrChildIsDecorated(useLegacyDecorators, node, parent22, grandparent) { + return nodeIsDecorated(useLegacyDecorators, node, parent22, grandparent) || childIsDecorated(useLegacyDecorators, node, parent22); + } + function childIsDecorated(useLegacyDecorators, node, parent22) { + switch (node.kind) { + case 263: + return some2(node.members, (m7) => nodeOrChildIsDecorated(useLegacyDecorators, m7, node, parent22)); + case 231: + return !useLegacyDecorators && some2(node.members, (m7) => nodeOrChildIsDecorated(useLegacyDecorators, m7, node, parent22)); + case 174: + case 178: + case 176: + return some2(node.parameters, (p7) => nodeIsDecorated(useLegacyDecorators, p7, node, parent22)); + default: + return false; + } + } + function classOrConstructorParameterIsDecorated(useLegacyDecorators, node) { + if (nodeIsDecorated(useLegacyDecorators, node)) + return true; + const constructor = getFirstConstructorWithBody(node); + return !!constructor && childIsDecorated(useLegacyDecorators, constructor, node); + } + function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent22) { + let parameters; + if (isAccessor(node)) { + const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent22.members, node); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) { + return false; + } + parameters = setAccessor == null ? void 0 : setAccessor.parameters; + } else if (isMethodDeclaration(node)) { + parameters = node.parameters; + } + if (nodeIsDecorated(useLegacyDecorators, node, parent22)) { + return true; + } + if (parameters) { + for (const parameter of parameters) { + if (parameterIsThisKeyword(parameter)) + continue; + if (nodeIsDecorated(useLegacyDecorators, parameter, node, parent22)) + return true; + } + } + return false; + } + function isEmptyStringLiteral(node) { + if (node.textSourceNode) { + switch (node.textSourceNode.kind) { + case 11: + return isEmptyStringLiteral(node.textSourceNode); + case 15: + return node.text === ""; + } + return false; + } + return node.text === ""; + } + function isJSXTagName(node) { + const { parent: parent22 } = node; + if (parent22.kind === 286 || parent22.kind === 285 || parent22.kind === 287) { + return parent22.tagName === node; + } + return false; + } + function isExpressionNode(node) { + switch (node.kind) { + case 108: + case 106: + case 112: + case 97: + case 14: + case 209: + case 210: + case 211: + case 212: + case 213: + case 214: + case 215: + case 234: + case 216: + case 238: + case 235: + case 217: + case 218: + case 231: + case 219: + case 222: + case 220: + case 221: + case 224: + case 225: + case 226: + case 227: + case 230: + case 228: + case 232: + case 284: + case 285: + case 288: + case 229: + case 223: + case 236: + return true; + case 233: + return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent); + case 166: + while (node.parent.kind === 166) { + node = node.parent; + } + return node.parent.kind === 186 || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + case 318: + while (isJSDocMemberName(node.parent)) { + node = node.parent; + } + return node.parent.kind === 186 || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node); + case 81: + return isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 103; + case 80: + if (node.parent.kind === 186 || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) { + return true; + } + case 9: + case 10: + case 11: + case 15: + case 110: + return isInExpressionContext(node); + default: + return false; + } + } + function isInExpressionContext(node) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 260: + case 169: + case 172: + case 171: + case 306: + case 303: + case 208: + return parent22.initializer === node; + case 244: + case 245: + case 246: + case 247: + case 253: + case 254: + case 255: + case 296: + case 257: + return parent22.expression === node; + case 248: + const forStatement = parent22; + return forStatement.initializer === node && forStatement.initializer.kind !== 261 || forStatement.condition === node || forStatement.incrementor === node; + case 249: + case 250: + const forInOrOfStatement = parent22; + return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 || forInOrOfStatement.expression === node; + case 216: + case 234: + return node === parent22.expression; + case 239: + return node === parent22.expression; + case 167: + return node === parent22.expression; + case 170: + case 294: + case 293: + case 305: + return true; + case 233: + return parent22.expression === node && !isPartOfTypeNode(parent22); + case 304: + return parent22.objectAssignmentInitializer === node; + case 238: + return node === parent22.expression; + default: + return isExpressionNode(parent22); + } + } + function isPartOfTypeQuery(node) { + while (node.kind === 166 || node.kind === 80) { + node = node.parent; + } + return node.kind === 186; + } + function isNamespaceReexportDeclaration(node) { + return isNamespaceExport(node) && !!node.parent.moduleSpecifier; + } + function isExternalModuleImportEqualsDeclaration(node) { + return node.kind === 271 && node.moduleReference.kind === 283; + } + function getExternalModuleImportEqualsDeclarationExpression(node) { + Debug.assert(isExternalModuleImportEqualsDeclaration(node)); + return node.moduleReference.expression; + } + function getExternalModuleRequireArgument(node) { + return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0]; + } + function isInternalModuleImportEqualsDeclaration(node) { + return node.kind === 271 && node.moduleReference.kind !== 283; + } + function isSourceFileJS(file) { + return isInJSFile(file); + } + function isSourceFileNotJS(file) { + return !isInJSFile(file); + } + function isInJSFile(node) { + return !!node && !!(node.flags & 524288); + } + function isInJsonFile(node) { + return !!node && !!(node.flags & 134217728); + } + function isSourceFileNotJson(file) { + return !isJsonSourceFile(file); + } + function isInJSDoc(node) { + return !!node && !!(node.flags & 16777216); + } + function isJSDocIndexSignature(node) { + return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && (node.typeArguments[0].kind === 154 || node.typeArguments[0].kind === 150); + } + function isRequireCall(callExpression, requireStringLiteralLikeArgument) { + if (callExpression.kind !== 213) { + return false; + } + const { expression, arguments: args } = callExpression; + if (expression.kind !== 80 || expression.escapedText !== "require") { + return false; + } + if (args.length !== 1) { + return false; + } + const arg = args[0]; + return !requireStringLiteralLikeArgument || isStringLiteralLike(arg); + } + function isVariableDeclarationInitializedToRequire(node) { + return isVariableDeclarationInitializedWithRequireHelper( + node, + /*allowAccessedRequire*/ + false + ); + } + function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { + return isVariableDeclarationInitializedWithRequireHelper( + node, + /*allowAccessedRequire*/ + true + ); + } + function isBindingElementOfBareOrAccessedRequire(node) { + return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + } + function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { + return isVariableDeclaration(node) && !!node.initializer && isRequireCall( + allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, + /*requireStringLiteralLikeArgument*/ + true + ); + } + function isRequireVariableStatement(node) { + return isVariableStatement(node) && node.declarationList.declarations.length > 0 && every2(node.declarationList.declarations, (decl) => isVariableDeclarationInitializedToRequire(decl)); + } + function isSingleOrDoubleQuote(charCode) { + return charCode === 39 || charCode === 34; + } + function isStringDoubleQuoted(str2, sourceFile) { + return getSourceTextOfNodeFromSourceFile(sourceFile, str2).charCodeAt(0) === 34; + } + function isAssignmentDeclaration(decl) { + return isBinaryExpression(decl) || isAccessExpression(decl) || isIdentifier(decl) || isCallExpression(decl); + } + function getEffectiveInitializer(node) { + if (isInJSFile(node) && node.initializer && isBinaryExpression(node.initializer) && (node.initializer.operatorToken.kind === 57 || node.initializer.operatorToken.kind === 61) && node.name && isEntityNameExpression(node.name) && isSameEntityName(node.name, node.initializer.left)) { + return node.initializer.right; + } + return node.initializer; + } + function getDeclaredExpandoInitializer(node) { + const init2 = getEffectiveInitializer(node); + return init2 && getExpandoInitializer(init2, isPrototypeAccess(node.name)); + } + function hasExpandoValueProperty(node, isPrototypeAssignment) { + return forEach4(node.properties, (p7) => isPropertyAssignment(p7) && isIdentifier(p7.name) && p7.name.escapedText === "value" && p7.initializer && getExpandoInitializer(p7.initializer, isPrototypeAssignment)); + } + function getAssignedExpandoInitializer(node) { + if (node && node.parent && isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 64) { + const isPrototypeAssignment = isPrototypeAccess(node.parent.left); + return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); + } + if (node && isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) { + const result2 = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype"); + if (result2) { + return result2; + } + } + } + function getExpandoInitializer(initializer, isPrototypeAssignment) { + if (isCallExpression(initializer)) { + const e10 = skipParentheses(initializer.expression); + return e10.kind === 218 || e10.kind === 219 ? initializer : void 0; + } + if (initializer.kind === 218 || initializer.kind === 231 || initializer.kind === 219) { + return initializer; + } + if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { + return initializer; + } + } + function getDefaultedExpandoInitializer(name2, initializer, isPrototypeAssignment) { + const e10 = isBinaryExpression(initializer) && (initializer.operatorToken.kind === 57 || initializer.operatorToken.kind === 61) && getExpandoInitializer(initializer.right, isPrototypeAssignment); + if (e10 && isSameEntityName(name2, initializer.left)) { + return e10; + } + } + function isDefaultedExpandoInitializer(node) { + const name2 = isVariableDeclaration(node.parent) ? node.parent.name : isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 64 ? node.parent.left : void 0; + return name2 && getExpandoInitializer(node.right, isPrototypeAccess(name2)) && isEntityNameExpression(name2) && isSameEntityName(name2, node.left); + } + function getNameOfExpando(node) { + if (isBinaryExpression(node.parent)) { + const parent22 = (node.parent.operatorToken.kind === 57 || node.parent.operatorToken.kind === 61) && isBinaryExpression(node.parent.parent) ? node.parent.parent : node.parent; + if (parent22.operatorToken.kind === 64 && isIdentifier(parent22.left)) { + return parent22.left; + } + } else if (isVariableDeclaration(node.parent)) { + return node.parent.name; + } + } + function isSameEntityName(name2, initializer) { + if (isPropertyNameLiteral(name2) && isPropertyNameLiteral(initializer)) { + return getTextOfIdentifierOrLiteral(name2) === getTextOfIdentifierOrLiteral(initializer); + } + if (isMemberName(name2) && isLiteralLikeAccess(initializer) && (initializer.expression.kind === 110 || isIdentifier(initializer.expression) && (initializer.expression.escapedText === "window" || initializer.expression.escapedText === "self" || initializer.expression.escapedText === "global"))) { + return isSameEntityName(name2, getNameOrArgument(initializer)); + } + if (isLiteralLikeAccess(name2) && isLiteralLikeAccess(initializer)) { + return getElementOrPropertyAccessName(name2) === getElementOrPropertyAccessName(initializer) && isSameEntityName(name2.expression, initializer.expression); + } + return false; + } + function getRightMostAssignedExpression(node) { + while (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + node = node.right; + } + return node; + } + function isExportsIdentifier(node) { + return isIdentifier(node) && node.escapedText === "exports"; + } + function isModuleIdentifier(node) { + return isIdentifier(node) && node.escapedText === "module"; + } + function isModuleExportsAccessExpression(node) { + return (isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node)) && isModuleIdentifier(node.expression) && getElementOrPropertyAccessName(node) === "exports"; + } + function getAssignmentDeclarationKind(expr) { + const special = getAssignmentDeclarationKindWorker(expr); + return special === 5 || isInJSFile(expr) ? special : 0; + } + function isBindableObjectDefinePropertyCall(expr) { + return length(expr.arguments) === 3 && isPropertyAccessExpression(expr.expression) && isIdentifier(expr.expression.expression) && idText(expr.expression.expression) === "Object" && idText(expr.expression.name) === "defineProperty" && isStringOrNumericLiteralLike(expr.arguments[1]) && isBindableStaticNameExpression( + expr.arguments[0], + /*excludeThisKeyword*/ + true + ); + } + function isLiteralLikeAccess(node) { + return isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node); + } + function isLiteralLikeElementAccess(node) { + return isElementAccessExpression(node) && isStringOrNumericLiteralLike(node.argumentExpression); + } + function isBindableStaticAccessExpression(node, excludeThisKeyword) { + return isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 110 || isIdentifier(node.name) && isBindableStaticNameExpression( + node.expression, + /*excludeThisKeyword*/ + true + )) || isBindableStaticElementAccessExpression(node, excludeThisKeyword); + } + function isBindableStaticElementAccessExpression(node, excludeThisKeyword) { + return isLiteralLikeElementAccess(node) && (!excludeThisKeyword && node.expression.kind === 110 || isEntityNameExpression(node.expression) || isBindableStaticAccessExpression( + node.expression, + /*excludeThisKeyword*/ + true + )); + } + function isBindableStaticNameExpression(node, excludeThisKeyword) { + return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword); + } + function getNameOrArgument(expr) { + if (isPropertyAccessExpression(expr)) { + return expr.name; + } + return expr.argumentExpression; + } + function getAssignmentDeclarationKindWorker(expr) { + if (isCallExpression(expr)) { + if (!isBindableObjectDefinePropertyCall(expr)) { + return 0; + } + const entityName = expr.arguments[0]; + if (isExportsIdentifier(entityName) || isModuleExportsAccessExpression(entityName)) { + return 8; + } + if (isBindableStaticAccessExpression(entityName) && getElementOrPropertyAccessName(entityName) === "prototype") { + return 9; + } + return 7; + } + if (expr.operatorToken.kind !== 64 || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) { + return 0; + } + if (isBindableStaticNameExpression( + expr.left.expression, + /*excludeThisKeyword*/ + true + ) && getElementOrPropertyAccessName(expr.left) === "prototype" && isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) { + return 6; + } + return getAssignmentDeclarationPropertyAccessKind(expr.left); + } + function isVoidZero(node) { + return isVoidExpression(node) && isNumericLiteral(node.expression) && node.expression.text === "0"; + } + function getElementOrPropertyAccessArgumentExpressionOrName(node) { + if (isPropertyAccessExpression(node)) { + return node.name; + } + const arg = skipParentheses(node.argumentExpression); + if (isNumericLiteral(arg) || isStringLiteralLike(arg)) { + return arg; + } + return node; + } + function getElementOrPropertyAccessName(node) { + const name2 = getElementOrPropertyAccessArgumentExpressionOrName(node); + if (name2) { + if (isIdentifier(name2)) { + return name2.escapedText; + } + if (isStringLiteralLike(name2) || isNumericLiteral(name2)) { + return escapeLeadingUnderscores(name2.text); + } + } + return void 0; + } + function getAssignmentDeclarationPropertyAccessKind(lhs) { + if (lhs.expression.kind === 110) { + return 4; + } else if (isModuleExportsAccessExpression(lhs)) { + return 2; + } else if (isBindableStaticNameExpression( + lhs.expression, + /*excludeThisKeyword*/ + true + )) { + if (isPrototypeAccess(lhs.expression)) { + return 3; + } + let nextToLast = lhs; + while (!isIdentifier(nextToLast.expression)) { + nextToLast = nextToLast.expression; + } + const id = nextToLast.expression; + if ((id.escapedText === "exports" || id.escapedText === "module" && getElementOrPropertyAccessName(nextToLast) === "exports") && // ExportsProperty does not support binding with computed names + isBindableStaticAccessExpression(lhs)) { + return 1; + } + if (isBindableStaticNameExpression( + lhs, + /*excludeThisKeyword*/ + true + ) || isElementAccessExpression(lhs) && isDynamicName(lhs)) { + return 5; + } + } + return 0; + } + function getInitializerOfBinaryExpression(expr) { + while (isBinaryExpression(expr.right)) { + expr = expr.right; + } + return expr.right; + } + function isPrototypePropertyAssignment(node) { + return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 3; + } + function isSpecialPropertyDeclaration(expr) { + return isInJSFile(expr) && expr.parent && expr.parent.kind === 244 && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); + } + function setValueDeclaration(symbol, node) { + const { valueDeclaration } = symbol; + if (!valueDeclaration || !(node.flags & 33554432 && !isInJSFile(node) && !(valueDeclaration.flags & 33554432)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { + symbol.valueDeclaration = node; + } + } + function isFunctionSymbol(symbol) { + if (!symbol || !symbol.valueDeclaration) { + return false; + } + const decl = symbol.valueDeclaration; + return decl.kind === 262 || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); + } + function tryGetModuleSpecifierFromDeclaration(node) { + var _a2, _b; + switch (node.kind) { + case 260: + case 208: + return (_a2 = findAncestor(node.initializer, (node2) => isRequireCall( + node2, + /*requireStringLiteralLikeArgument*/ + true + ))) == null ? void 0 : _a2.arguments[0]; + case 272: + case 278: + return tryCast(node.moduleSpecifier, isStringLiteralLike); + case 271: + return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike); + case 273: + case 280: + return tryCast(node.parent.moduleSpecifier, isStringLiteralLike); + case 274: + case 281: + return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike); + case 276: + return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike); + case 205: + return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; + default: + Debug.assertNever(node); + } + } + function importFromModuleSpecifier(node) { + return tryGetImportFromModuleSpecifier(node) || Debug.failBadSyntaxKind(node.parent); + } + function tryGetImportFromModuleSpecifier(node) { + switch (node.parent.kind) { + case 272: + case 278: + return node.parent; + case 283: + return node.parent.parent; + case 213: + return isImportCall(node.parent) || isRequireCall( + node.parent, + /*requireStringLiteralLikeArgument*/ + false + ) ? node.parent : void 0; + case 201: + Debug.assert(isStringLiteral(node)); + return tryCast(node.parent.parent, isImportTypeNode); + default: + return void 0; + } + } + function getExternalModuleName(node) { + switch (node.kind) { + case 272: + case 278: + return node.moduleSpecifier; + case 271: + return node.moduleReference.kind === 283 ? node.moduleReference.expression : void 0; + case 205: + return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; + case 213: + return node.arguments[0]; + case 267: + return node.name.kind === 11 ? node.name : void 0; + default: + return Debug.assertNever(node); + } + } + function getNamespaceDeclarationNode(node) { + switch (node.kind) { + case 272: + return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); + case 271: + return node; + case 278: + return node.exportClause && tryCast(node.exportClause, isNamespaceExport); + default: + return Debug.assertNever(node); + } + } + function isDefaultImport(node) { + return node.kind === 272 && !!node.importClause && !!node.importClause.name; + } + function forEachImportClauseDeclaration(node, action) { + if (node.name) { + const result2 = action(node); + if (result2) + return result2; + } + if (node.namedBindings) { + const result2 = isNamespaceImport(node.namedBindings) ? action(node.namedBindings) : forEach4(node.namedBindings.elements, action); + if (result2) + return result2; + } + } + function hasQuestionToken(node) { + if (node) { + switch (node.kind) { + case 169: + case 174: + case 173: + case 304: + case 303: + case 172: + case 171: + return node.questionToken !== void 0; + } + } + return false; + } + function isJSDocConstructSignature(node) { + const param = isJSDocFunctionType(node) ? firstOrUndefined(node.parameters) : void 0; + const name2 = tryCast(param && param.name, isIdentifier); + return !!name2 && name2.escapedText === "new"; + } + function isJSDocTypeAlias(node) { + return node.kind === 353 || node.kind === 345 || node.kind === 347; + } + function isTypeAlias(node) { + return isJSDocTypeAlias(node) || isTypeAliasDeclaration(node); + } + function getSourceOfAssignment(node) { + return isExpressionStatement(node) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 64 ? getRightMostAssignedExpression(node.expression) : void 0; + } + function getSourceOfDefaultedAssignment(node) { + return isExpressionStatement(node) && isBinaryExpression(node.expression) && getAssignmentDeclarationKind(node.expression) !== 0 && isBinaryExpression(node.expression.right) && (node.expression.right.operatorToken.kind === 57 || node.expression.right.operatorToken.kind === 61) ? node.expression.right.right : void 0; + } + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 243: + const v8 = getSingleVariableOfVariableStatement(node); + return v8 && v8.initializer; + case 172: + return node.initializer; + case 303: + return node.initializer; + } + } + function getSingleVariableOfVariableStatement(node) { + return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; + } + function getNestedModuleDeclaration(node) { + return isModuleDeclaration(node) && node.body && node.body.kind === 267 ? node.body : void 0; + } + function canHaveFlowNode(node) { + if (node.kind >= 243 && node.kind <= 259) { + return true; + } + switch (node.kind) { + case 80: + case 110: + case 108: + case 166: + case 236: + case 212: + case 211: + case 208: + case 218: + case 219: + case 174: + case 177: + case 178: + return true; + default: + return false; + } + } + function canHaveJSDoc(node) { + switch (node.kind) { + case 219: + case 226: + case 241: + case 252: + case 179: + case 296: + case 263: + case 231: + case 175: + case 176: + case 185: + case 180: + case 251: + case 259: + case 246: + case 212: + case 242: + case 1: + case 266: + case 306: + case 277: + case 278: + case 281: + case 244: + case 249: + case 250: + case 248: + case 262: + case 218: + case 184: + case 177: + case 80: + case 245: + case 272: + case 271: + case 181: + case 264: + case 324: + case 330: + case 256: + case 174: + case 173: + case 267: + case 202: + case 270: + case 210: + case 169: + case 217: + case 211: + case 303: + case 172: + case 171: + case 253: + case 240: + case 178: + case 304: + case 305: + case 255: + case 257: + case 258: + case 265: + case 168: + case 260: + case 243: + case 247: + case 254: + return true; + default: + return false; + } + } + function getJSDocCommentsAndTags(hostNode, noCache) { + let result2; + if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) { + result2 = addRange(result2, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc)); + } + let node = hostNode; + while (node && node.parent) { + if (hasJSDocNodes(node)) { + result2 = addRange(result2, filterOwnedJSDocTags(hostNode, node.jsDoc)); + } + if (node.kind === 169) { + result2 = addRange(result2, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); + break; + } + if (node.kind === 168) { + result2 = addRange(result2, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); + break; + } + node = getNextJSDocCommentLocation(node); + } + return result2 || emptyArray; + } + function filterOwnedJSDocTags(hostNode, comments) { + const lastJsDoc = last2(comments); + return flatMap2(comments, (jsDoc) => { + if (jsDoc === lastJsDoc) { + const ownedTags = filter2(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag)); + return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags; + } else { + return filter2(jsDoc.tags, isJSDocOverloadTag); + } + }); + } + function ownsJSDocTag(hostNode, tag) { + return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; + } + function getNextJSDocCommentLocation(node) { + const parent22 = node.parent; + if (parent22.kind === 303 || parent22.kind === 277 || parent22.kind === 172 || parent22.kind === 244 && node.kind === 211 || parent22.kind === 253 || getNestedModuleDeclaration(parent22) || isAssignmentExpression(node)) { + return parent22; + } else if (parent22.parent && (getSingleVariableOfVariableStatement(parent22.parent) === node || isAssignmentExpression(parent22))) { + return parent22.parent; + } else if (parent22.parent && parent22.parent.parent && (getSingleVariableOfVariableStatement(parent22.parent.parent) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent22.parent.parent) === node || getSourceOfDefaultedAssignment(parent22.parent.parent))) { + return parent22.parent.parent; + } + } + function getParameterSymbolFromJSDoc(node) { + if (node.symbol) { + return node.symbol; + } + if (!isIdentifier(node.name)) { + return void 0; + } + const name2 = node.name.escapedText; + const decl = getHostSignatureFromJSDoc(node); + if (!decl) { + return void 0; + } + const parameter = find2(decl.parameters, (p7) => p7.name.kind === 80 && p7.name.escapedText === name2); + return parameter && parameter.symbol; + } + function getEffectiveContainerForJSDocTemplateTag(node) { + if (isJSDoc(node.parent) && node.parent.tags) { + const typeAlias = find2(node.parent.tags, isJSDocTypeAlias); + if (typeAlias) { + return typeAlias; + } + } + return getHostSignatureFromJSDoc(node); + } + function getJSDocOverloadTags(node) { + return getAllJSDocTags(node, isJSDocOverloadTag); + } + function getHostSignatureFromJSDoc(node) { + const host = getEffectiveJSDocHost(node); + if (host) { + return isPropertySignature(host) && host.type && isFunctionLike(host.type) ? host.type : isFunctionLike(host) ? host : void 0; + } + return void 0; + } + function getEffectiveJSDocHost(node) { + const host = getJSDocHost(node); + if (host) { + return getSourceOfDefaultedAssignment(host) || getSourceOfAssignment(host) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; + } + } + function getJSDocHost(node) { + const jsDoc = getJSDocRoot(node); + if (!jsDoc) { + return void 0; + } + const host = jsDoc.parent; + if (host && host.jsDoc && jsDoc === lastOrUndefined(host.jsDoc)) { + return host; + } + } + function getJSDocRoot(node) { + return findAncestor(node.parent, isJSDoc); + } + function getTypeParameterFromJsDoc(node) { + const name2 = node.name.escapedText; + const { typeParameters } = node.parent.parent.parent; + return typeParameters && find2(typeParameters, (p7) => p7.name.escapedText === name2); + } + function hasTypeArguments(node) { + return !!node.typeArguments; + } + function getAssignmentTarget(node) { + let parent22 = node.parent; + while (true) { + switch (parent22.kind) { + case 226: + const binaryExpression = parent22; + const binaryOperator = binaryExpression.operatorToken.kind; + return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0; + case 224: + case 225: + const unaryExpression = parent22; + const unaryOperator = unaryExpression.operator; + return unaryOperator === 46 || unaryOperator === 47 ? unaryExpression : void 0; + case 249: + case 250: + const forInOrOfStatement = parent22; + return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0; + case 217: + case 209: + case 230: + case 235: + node = parent22; + break; + case 305: + node = parent22.parent; + break; + case 304: + if (parent22.name !== node) { + return void 0; + } + node = parent22.parent; + break; + case 303: + if (parent22.name === node) { + return void 0; + } + node = parent22.parent; + break; + default: + return void 0; + } + parent22 = node.parent; + } + } + function getAssignmentTargetKind(node) { + const target = getAssignmentTarget(node); + if (!target) { + return 0; + } + switch (target.kind) { + case 226: + const binaryOperator = target.operatorToken.kind; + return binaryOperator === 64 || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 : 2; + case 224: + case 225: + return 2; + case 249: + case 250: + return 1; + } + } + function isAssignmentTarget(node) { + return !!getAssignmentTarget(node); + } + function isCompoundLikeAssignment(assignment) { + const right = skipParentheses(assignment.right); + return right.kind === 226 && isShiftOperatorOrHigher(right.operatorToken.kind); + } + function isInCompoundLikeAssignment(node) { + const target = getAssignmentTarget(node); + return !!target && isAssignmentExpression( + target, + /*excludeCompoundAssignment*/ + true + ) && isCompoundLikeAssignment(target); + } + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 241: + case 243: + case 254: + case 245: + case 255: + case 269: + case 296: + case 297: + case 256: + case 248: + case 249: + case 250: + case 246: + case 247: + case 258: + case 299: + return true; + } + return false; + } + function isValueSignatureDeclaration(node) { + return isFunctionExpression(node) || isArrowFunction(node) || isMethodOrAccessor(node) || isFunctionDeclaration(node) || isConstructorDeclaration(node); + } + function walkUp(node, kind) { + while (node && node.kind === kind) { + node = node.parent; + } + return node; + } + function walkUpParenthesizedTypes(node) { + return walkUp( + node, + 196 + /* ParenthesizedType */ + ); + } + function walkUpParenthesizedExpressions(node) { + return walkUp( + node, + 217 + /* ParenthesizedExpression */ + ); + } + function walkUpParenthesizedTypesAndGetParentAndChild(node) { + let child; + while (node && node.kind === 196) { + child = node; + node = node.parent; + } + return [child, node]; + } + function skipTypeParentheses(node) { + while (isParenthesizedTypeNode(node)) + node = node.type; + return node; + } + function skipParentheses(node, excludeJSDocTypeAssertions) { + const flags = excludeJSDocTypeAssertions ? 1 | 16 : 1; + return skipOuterExpressions(node, flags); + } + function isDeleteTarget(node) { + if (node.kind !== 211 && node.kind !== 212) { + return false; + } + node = walkUpParenthesizedExpressions(node.parent); + return node && node.kind === 220; + } + function isNodeDescendantOf(node, ancestor) { + while (node) { + if (node === ancestor) + return true; + node = node.parent; + } + return false; + } + function isDeclarationName(name2) { + return !isSourceFile(name2) && !isBindingPattern(name2) && isDeclaration(name2.parent) && name2.parent.name === name2; + } + function getDeclarationFromName(name2) { + const parent22 = name2.parent; + switch (name2.kind) { + case 11: + case 15: + case 9: + if (isComputedPropertyName(parent22)) + return parent22.parent; + case 80: + if (isDeclaration(parent22)) { + return parent22.name === name2 ? parent22 : void 0; + } else if (isQualifiedName(parent22)) { + const tag = parent22.parent; + return isJSDocParameterTag(tag) && tag.name === parent22 ? tag : void 0; + } else { + const binExp = parent22.parent; + return isBinaryExpression(binExp) && getAssignmentDeclarationKind(binExp) !== 0 && (binExp.left.symbol || binExp.symbol) && getNameOfDeclaration(binExp) === name2 ? binExp : void 0; + } + case 81: + return isDeclaration(parent22) && parent22.name === name2 ? parent22 : void 0; + default: + return void 0; + } + } + function isLiteralComputedPropertyDeclarationName(node) { + return isStringOrNumericLiteralLike(node) && node.parent.kind === 167 && isDeclaration(node.parent.parent); + } + function isIdentifierName(node) { + const parent22 = node.parent; + switch (parent22.kind) { + case 172: + case 171: + case 174: + case 173: + case 177: + case 178: + case 306: + case 303: + case 211: + return parent22.name === node; + case 166: + return parent22.right === node; + case 208: + case 276: + return parent22.propertyName === node; + case 281: + case 291: + case 285: + case 286: + case 287: + return true; + } + return false; + } + function isAliasSymbolDeclaration(node) { + if (node.kind === 271 || node.kind === 270 || node.kind === 273 && !!node.name || node.kind === 274 || node.kind === 280 || node.kind === 276 || node.kind === 281 || node.kind === 277 && exportAssignmentIsAlias(node)) { + return true; + } + return isInJSFile(node) && (isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || isPropertyAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 && isAliasableExpression(node.parent.right)); + } + function getAliasDeclarationFromName(node) { + switch (node.parent.kind) { + case 273: + case 276: + case 274: + case 281: + case 277: + case 271: + case 280: + return node.parent; + case 166: + do { + node = node.parent; + } while (node.parent.kind === 166); + return getAliasDeclarationFromName(node); + } + } + function isAliasableExpression(e10) { + return isEntityNameExpression(e10) || isClassExpression(e10); + } + function exportAssignmentIsAlias(node) { + const e10 = getExportAssignmentExpression(node); + return isAliasableExpression(e10); + } + function getExportAssignmentExpression(node) { + return isExportAssignment(node) ? node.expression : node.right; + } + function getPropertyAssignmentAliasLikeExpression(node) { + return node.kind === 304 ? node.name : node.kind === 303 ? node.initializer : node.parent.right; + } + function getEffectiveBaseTypeNode(node) { + const baseType = getClassExtendsHeritageElement(node); + if (baseType && isInJSFile(node)) { + const tag = getJSDocAugmentsTag(node); + if (tag) { + return tag.class; + } + } + return baseType; + } + function getClassExtendsHeritageElement(node) { + const heritageClause = getHeritageClause( + node.heritageClauses, + 96 + /* ExtendsKeyword */ + ); + return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : void 0; + } + function getEffectiveImplementsTypeNodes(node) { + if (isInJSFile(node)) { + return getJSDocImplementsTags(node).map((n7) => n7.class); + } else { + const heritageClause = getHeritageClause( + node.heritageClauses, + 119 + /* ImplementsKeyword */ + ); + return heritageClause == null ? void 0 : heritageClause.types; + } + } + function getAllSuperTypeNodes(node) { + return isInterfaceDeclaration(node) ? getInterfaceBaseTypeNodes(node) || emptyArray : isClassLike(node) ? concatenate(singleElementArray(getEffectiveBaseTypeNode(node)), getEffectiveImplementsTypeNodes(node)) || emptyArray : emptyArray; + } + function getInterfaceBaseTypeNodes(node) { + const heritageClause = getHeritageClause( + node.heritageClauses, + 96 + /* ExtendsKeyword */ + ); + return heritageClause ? heritageClause.types : void 0; + } + function getHeritageClause(clauses, kind) { + if (clauses) { + for (const clause of clauses) { + if (clause.token === kind) { + return clause; + } + } + } + return void 0; + } + function getAncestor(node, kind) { + while (node) { + if (node.kind === kind) { + return node; + } + node = node.parent; + } + return void 0; + } + function isKeyword(token) { + return 83 <= token && token <= 165; + } + function isPunctuation(token) { + return 19 <= token && token <= 79; + } + function isKeywordOrPunctuation(token) { + return isKeyword(token) || isPunctuation(token); + } + function isContextualKeyword(token) { + return 128 <= token && token <= 165; + } + function isNonContextualKeyword(token) { + return isKeyword(token) && !isContextualKeyword(token); + } + function isFutureReservedKeyword(token) { + return 119 <= token && token <= 127; + } + function isStringANonContextualKeyword(name2) { + const token = stringToToken(name2); + return token !== void 0 && isNonContextualKeyword(token); + } + function isStringAKeyword(name2) { + const token = stringToToken(name2); + return token !== void 0 && isKeyword(token); + } + function isIdentifierANonContextualKeyword(node) { + const originalKeywordKind = identifierToKeywordKind(node); + return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind); + } + function isTrivia(token) { + return 2 <= token && token <= 7; + } + function getFunctionFlags(node) { + if (!node) { + return 4; + } + let flags = 0; + switch (node.kind) { + case 262: + case 218: + case 174: + if (node.asteriskToken) { + flags |= 1; + } + case 219: + if (hasSyntacticModifier( + node, + 1024 + /* Async */ + )) { + flags |= 2; + } + break; + } + if (!node.body) { + flags |= 4; + } + return flags; + } + function isAsyncFunction(node) { + switch (node.kind) { + case 262: + case 218: + case 219: + case 174: + return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier( + node, + 1024 + /* Async */ + ); + } + return false; + } + function isStringOrNumericLiteralLike(node) { + return isStringLiteralLike(node) || isNumericLiteral(node); + } + function isSignedNumericLiteral(node) { + return isPrefixUnaryExpression(node) && (node.operator === 40 || node.operator === 41) && isNumericLiteral(node.operand); + } + function hasDynamicName(declaration) { + const name2 = getNameOfDeclaration(declaration); + return !!name2 && isDynamicName(name2); + } + function isDynamicName(name2) { + if (!(name2.kind === 167 || name2.kind === 212)) { + return false; + } + const expr = isElementAccessExpression(name2) ? skipParentheses(name2.argumentExpression) : name2.expression; + return !isStringOrNumericLiteralLike(expr) && !isSignedNumericLiteral(expr); + } + function getPropertyNameForPropertyNameNode(name2) { + switch (name2.kind) { + case 80: + case 81: + return name2.escapedText; + case 11: + case 15: + case 9: + return escapeLeadingUnderscores(name2.text); + case 167: + const nameExpression = name2.expression; + if (isStringOrNumericLiteralLike(nameExpression)) { + return escapeLeadingUnderscores(nameExpression.text); + } else if (isSignedNumericLiteral(nameExpression)) { + if (nameExpression.operator === 41) { + return tokenToString(nameExpression.operator) + nameExpression.operand.text; + } + return nameExpression.operand.text; + } + return void 0; + case 295: + return getEscapedTextOfJsxNamespacedName(name2); + default: + return Debug.assertNever(name2); + } + } + function isPropertyNameLiteral(node) { + switch (node.kind) { + case 80: + case 11: + case 15: + case 9: + return true; + default: + return false; + } + } + function getTextOfIdentifierOrLiteral(node) { + return isMemberName(node) ? idText(node) : isJsxNamespacedName(node) ? getTextOfJsxNamespacedName(node) : node.text; + } + function getEscapedTextOfIdentifierOrLiteral(node) { + return isMemberName(node) ? node.escapedText : isJsxNamespacedName(node) ? getEscapedTextOfJsxNamespacedName(node) : escapeLeadingUnderscores(node.text); + } + function getPropertyNameForUniqueESSymbol(symbol) { + return `__@${getSymbolId(symbol)}@${symbol.escapedName}`; + } + function getSymbolNameForPrivateIdentifier(containingClassSymbol, description32) { + return `__#${getSymbolId(containingClassSymbol)}@${description32}`; + } + function isKnownSymbol(symbol) { + return startsWith2(symbol.escapedName, "__@"); + } + function isPrivateIdentifierSymbol(symbol) { + return startsWith2(symbol.escapedName, "__#"); + } + function isESSymbolIdentifier(node) { + return node.kind === 80 && node.escapedText === "Symbol"; + } + function isProtoSetter(node) { + return isIdentifier(node) ? idText(node) === "__proto__" : isStringLiteral(node) && node.text === "__proto__"; + } + function isAnonymousFunctionDefinition(node, cb) { + node = skipOuterExpressions(node); + switch (node.kind) { + case 231: + if (classHasDeclaredOrExplicitlyAssignedName(node)) { + return false; + } + break; + case 218: + if (node.name) { + return false; + } + break; + case 219: + break; + default: + return false; + } + return typeof cb === "function" ? cb(node) : true; + } + function isNamedEvaluationSource(node) { + switch (node.kind) { + case 303: + return !isProtoSetter(node.name); + case 304: + return !!node.objectAssignmentInitializer; + case 260: + return isIdentifier(node.name) && !!node.initializer; + case 169: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 208: + return isIdentifier(node.name) && !!node.initializer && !node.dotDotDotToken; + case 172: + return !!node.initializer; + case 226: + switch (node.operatorToken.kind) { + case 64: + case 77: + case 76: + case 78: + return isIdentifier(node.left); + } + break; + case 277: + return true; + } + return false; + } + function isNamedEvaluation(node, cb) { + if (!isNamedEvaluationSource(node)) + return false; + switch (node.kind) { + case 303: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 304: + return isAnonymousFunctionDefinition(node.objectAssignmentInitializer, cb); + case 260: + case 169: + case 208: + case 172: + return isAnonymousFunctionDefinition(node.initializer, cb); + case 226: + return isAnonymousFunctionDefinition(node.right, cb); + case 277: + return isAnonymousFunctionDefinition(node.expression, cb); + } + } + function isPushOrUnshiftIdentifier(node) { + return node.escapedText === "push" || node.escapedText === "unshift"; + } + function isParameterDeclaration(node) { + const root2 = getRootDeclaration(node); + return root2.kind === 169; + } + function getRootDeclaration(node) { + while (node.kind === 208) { + node = node.parent.parent; + } + return node; + } + function nodeStartsNewLexicalEnvironment(node) { + const kind = node.kind; + return kind === 176 || kind === 218 || kind === 262 || kind === 219 || kind === 174 || kind === 177 || kind === 178 || kind === 267 || kind === 312; + } + function nodeIsSynthesized(range2) { + return positionIsSynthesized(range2.pos) || positionIsSynthesized(range2.end); + } + function getOriginalSourceFile(sourceFile) { + return getParseTreeNode(sourceFile, isSourceFile) || sourceFile; + } + function getExpressionAssociativity(expression) { + const operator = getOperator(expression); + const hasArguments = expression.kind === 214 && expression.arguments !== void 0; + return getOperatorAssociativity(expression.kind, operator, hasArguments); + } + function getOperatorAssociativity(kind, operator, hasArguments) { + switch (kind) { + case 214: + return hasArguments ? 0 : 1; + case 224: + case 221: + case 222: + case 220: + case 223: + case 227: + case 229: + return 1; + case 226: + switch (operator) { + case 43: + case 64: + case 65: + case 66: + case 68: + case 67: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 79: + case 75: + case 76: + case 77: + case 78: + return 1; + } + } + return 0; + } + function getExpressionPrecedence(expression) { + const operator = getOperator(expression); + const hasArguments = expression.kind === 214 && expression.arguments !== void 0; + return getOperatorPrecedence(expression.kind, operator, hasArguments); + } + function getOperator(expression) { + if (expression.kind === 226) { + return expression.operatorToken.kind; + } else if (expression.kind === 224 || expression.kind === 225) { + return expression.operator; + } else { + return expression.kind; + } + } + function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { + switch (nodeKind) { + case 361: + return 0; + case 230: + return 1; + case 229: + return 2; + case 227: + return 4; + case 226: + switch (operatorKind) { + case 28: + return 0; + case 64: + case 65: + case 66: + case 68: + case 67: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 79: + case 75: + case 76: + case 77: + case 78: + return 3; + default: + return getBinaryOperatorPrecedence(operatorKind); + } + case 216: + case 235: + case 224: + case 221: + case 222: + case 220: + case 223: + return 16; + case 225: + return 17; + case 213: + return 18; + case 214: + return hasArguments ? 19 : 18; + case 215: + case 211: + case 212: + case 236: + return 19; + case 234: + case 238: + return 11; + case 110: + case 108: + case 80: + case 81: + case 106: + case 112: + case 97: + case 9: + case 10: + case 11: + case 209: + case 210: + case 218: + case 219: + case 231: + case 14: + case 15: + case 228: + case 217: + case 232: + case 284: + case 285: + case 288: + return 20; + default: + return -1; + } + } + function getBinaryOperatorPrecedence(kind) { + switch (kind) { + case 61: + return 4; + case 57: + return 5; + case 56: + return 6; + case 52: + return 7; + case 53: + return 8; + case 51: + return 9; + case 35: + case 36: + case 37: + case 38: + return 10; + case 30: + case 32: + case 33: + case 34: + case 104: + case 103: + case 130: + case 152: + return 11; + case 48: + case 49: + case 50: + return 12; + case 40: + case 41: + return 13; + case 42: + case 44: + case 45: + return 14; + case 43: + return 15; + } + return -1; + } + function getSemanticJsxChildren(children) { + return filter2(children, (i7) => { + switch (i7.kind) { + case 294: + return !!i7.expression; + case 12: + return !i7.containsOnlyTriviaWhiteSpaces; + default: + return true; + } + }); + } + function createDiagnosticCollection() { + let nonFileDiagnostics = []; + const filesWithDiagnostics = []; + const fileDiagnostics = /* @__PURE__ */ new Map(); + let hasReadNonFileDiagnostics = false; + return { + add: add2, + lookup, + getGlobalDiagnostics, + getDiagnostics: getDiagnostics2 + }; + function lookup(diagnostic) { + let diagnostics; + if (diagnostic.file) { + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); + } else { + diagnostics = nonFileDiagnostics; + } + if (!diagnostics) { + return void 0; + } + const result2 = binarySearch(diagnostics, diagnostic, identity2, compareDiagnosticsSkipRelatedInformation); + if (result2 >= 0) { + return diagnostics[result2]; + } + return void 0; + } + function add2(diagnostic) { + let diagnostics; + if (diagnostic.file) { + diagnostics = fileDiagnostics.get(diagnostic.file.fileName); + if (!diagnostics) { + diagnostics = []; + fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + insertSorted(filesWithDiagnostics, diagnostic.file.fileName, compareStringsCaseSensitive); + } + } else { + if (hasReadNonFileDiagnostics) { + hasReadNonFileDiagnostics = false; + nonFileDiagnostics = nonFileDiagnostics.slice(); + } + diagnostics = nonFileDiagnostics; + } + insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation); + } + function getGlobalDiagnostics() { + hasReadNonFileDiagnostics = true; + return nonFileDiagnostics; + } + function getDiagnostics2(fileName) { + if (fileName) { + return fileDiagnostics.get(fileName) || []; + } + const fileDiags = flatMapToMutable(filesWithDiagnostics, (f8) => fileDiagnostics.get(f8)); + if (!nonFileDiagnostics.length) { + return fileDiags; + } + fileDiags.unshift(...nonFileDiagnostics); + return fileDiags; + } + } + function escapeTemplateSubstitution(str2) { + return str2.replace(templateSubstitutionRegExp, "\\${"); + } + function containsInvalidEscapeFlag(node) { + return !!((node.templateFlags || 0) & 2048); + } + function hasInvalidEscape(template2) { + return template2 && !!(isNoSubstitutionTemplateLiteral(template2) ? containsInvalidEscapeFlag(template2) : containsInvalidEscapeFlag(template2.head) || some2(template2.templateSpans, (span) => containsInvalidEscapeFlag(span.literal))); + } + function encodeUtf16EscapeSequence(charCode) { + const hexCharCode = charCode.toString(16).toUpperCase(); + const paddedHexCode = ("0000" + hexCharCode).slice(-4); + return "\\u" + paddedHexCode; + } + function getReplacement(c7, offset, input) { + if (c7.charCodeAt(0) === 0) { + const lookAhead = input.charCodeAt(offset + c7.length); + if (lookAhead >= 48 && lookAhead <= 57) { + return "\\x00"; + } + return "\\0"; + } + return escapedCharsMap.get(c7) || encodeUtf16EscapeSequence(c7.charCodeAt(0)); + } + function escapeString2(s7, quoteChar) { + const escapedCharsRegExp = quoteChar === 96 ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; + return s7.replace(escapedCharsRegExp, getReplacement); + } + function escapeNonAsciiString(s7, quoteChar) { + s7 = escapeString2(s7, quoteChar); + return nonAsciiCharacters.test(s7) ? s7.replace(nonAsciiCharacters, (c7) => encodeUtf16EscapeSequence(c7.charCodeAt(0))) : s7; + } + function encodeJsxCharacterEntity(charCode) { + const hexCharCode = charCode.toString(16).toUpperCase(); + return "&#x" + hexCharCode + ";"; + } + function getJsxAttributeStringReplacement(c7) { + if (c7.charCodeAt(0) === 0) { + return "�"; + } + return jsxEscapedCharsMap.get(c7) || encodeJsxCharacterEntity(c7.charCodeAt(0)); + } + function escapeJsxAttributeString(s7, quoteChar) { + const escapedCharsRegExp = quoteChar === 39 ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; + return s7.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); + } + function stripQuotes(name2) { + const length2 = name2.length; + if (length2 >= 2 && name2.charCodeAt(0) === name2.charCodeAt(length2 - 1) && isQuoteOrBacktick(name2.charCodeAt(0))) { + return name2.substring(1, length2 - 1); + } + return name2; + } + function isQuoteOrBacktick(charCode) { + return charCode === 39 || charCode === 34 || charCode === 96; + } + function isIntrinsicJsxName(name2) { + const ch = name2.charCodeAt(0); + return ch >= 97 && ch <= 122 || name2.includes("-"); + } + function getIndentString(level) { + const singleLevel = indentStrings[1]; + for (let current = indentStrings.length; current <= level; current++) { + indentStrings.push(indentStrings[current - 1] + singleLevel); + } + return indentStrings[level]; + } + function getIndentSize() { + return indentStrings[1].length; + } + function createTextWriter(newLine) { + var output; + var indent3; + var lineStart; + var lineCount; + var linePos; + var hasTrailingComment = false; + function updateLineCountAndPosFor(s7) { + const lineStartsOfS = computeLineStarts(s7); + if (lineStartsOfS.length > 1) { + lineCount = lineCount + lineStartsOfS.length - 1; + linePos = output.length - s7.length + last2(lineStartsOfS); + lineStart = linePos - output.length === 0; + } else { + lineStart = false; + } + } + function writeText(s7) { + if (s7 && s7.length) { + if (lineStart) { + s7 = getIndentString(indent3) + s7; + lineStart = false; + } + output += s7; + updateLineCountAndPosFor(s7); + } + } + function write(s7) { + if (s7) + hasTrailingComment = false; + writeText(s7); + } + function writeComment(s7) { + if (s7) + hasTrailingComment = true; + writeText(s7); + } + function reset2() { + output = ""; + indent3 = 0; + lineStart = true; + lineCount = 0; + linePos = 0; + hasTrailingComment = false; + } + function rawWrite(s7) { + if (s7 !== void 0) { + output += s7; + updateLineCountAndPosFor(s7); + hasTrailingComment = false; + } + } + function writeLiteral(s7) { + if (s7 && s7.length) { + write(s7); + } + } + function writeLine(force) { + if (!lineStart || force) { + output += newLine; + lineCount++; + linePos = output.length; + lineStart = true; + hasTrailingComment = false; + } + } + function getTextPosWithWriteLine() { + return lineStart ? output.length : output.length + newLine.length; + } + reset2(); + return { + write, + rawWrite, + writeLiteral, + writeLine, + increaseIndent: () => { + indent3++; + }, + decreaseIndent: () => { + indent3--; + }, + getIndent: () => indent3, + getTextPos: () => output.length, + getLine: () => lineCount, + getColumn: () => lineStart ? indent3 * getIndentSize() : output.length - linePos, + getText: () => output, + isAtStartOfLine: () => lineStart, + hasTrailingComment: () => hasTrailingComment, + hasTrailingWhitespace: () => !!output.length && isWhiteSpaceLike(output.charCodeAt(output.length - 1)), + clear: reset2, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: (s7, _6) => write(s7), + writeTrailingSemicolon: write, + writeComment, + getTextPosWithWriteLine + }; + } + function getTrailingSemicolonDeferringWriter(writer) { + let pendingTrailingSemicolon = false; + function commitPendingTrailingSemicolon() { + if (pendingTrailingSemicolon) { + writer.writeTrailingSemicolon(";"); + pendingTrailingSemicolon = false; + } + } + return { + ...writer, + writeTrailingSemicolon() { + pendingTrailingSemicolon = true; + }, + writeLiteral(s7) { + commitPendingTrailingSemicolon(); + writer.writeLiteral(s7); + }, + writeStringLiteral(s7) { + commitPendingTrailingSemicolon(); + writer.writeStringLiteral(s7); + }, + writeSymbol(s7, sym) { + commitPendingTrailingSemicolon(); + writer.writeSymbol(s7, sym); + }, + writePunctuation(s7) { + commitPendingTrailingSemicolon(); + writer.writePunctuation(s7); + }, + writeKeyword(s7) { + commitPendingTrailingSemicolon(); + writer.writeKeyword(s7); + }, + writeOperator(s7) { + commitPendingTrailingSemicolon(); + writer.writeOperator(s7); + }, + writeParameter(s7) { + commitPendingTrailingSemicolon(); + writer.writeParameter(s7); + }, + writeSpace(s7) { + commitPendingTrailingSemicolon(); + writer.writeSpace(s7); + }, + writeProperty(s7) { + commitPendingTrailingSemicolon(); + writer.writeProperty(s7); + }, + writeComment(s7) { + commitPendingTrailingSemicolon(); + writer.writeComment(s7); + }, + writeLine() { + commitPendingTrailingSemicolon(); + writer.writeLine(); + }, + increaseIndent() { + commitPendingTrailingSemicolon(); + writer.increaseIndent(); + }, + decreaseIndent() { + commitPendingTrailingSemicolon(); + writer.decreaseIndent(); + } + }; + } + function hostUsesCaseSensitiveFileNames(host) { + return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; + } + function hostGetCanonicalFileName(host) { + return createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host)); + } + function getResolvedExternalModuleName(host, file, referenceFile) { + return file.moduleName || getExternalModuleNameFromPath(host, file.fileName, referenceFile && referenceFile.fileName); + } + function getCanonicalAbsolutePath(host, path2) { + return host.getCanonicalFileName(getNormalizedAbsolutePath(path2, host.getCurrentDirectory())); + } + function getExternalModuleNameFromDeclaration(host, resolver, declaration) { + const file = resolver.getExternalModuleFileFromDeclaration(declaration); + if (!file || file.isDeclarationFile) { + return void 0; + } + const specifier = getExternalModuleName(declaration); + if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) { + return void 0; + } + return getResolvedExternalModuleName(host, file); + } + function getExternalModuleNameFromPath(host, fileName, referencePath) { + const getCanonicalFileName = (f8) => host.getCanonicalFileName(f8); + const dir2 = toPath2(referencePath ? getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName); + const filePath = getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); + const relativePath2 = getRelativePathToDirectoryOrUrl( + dir2, + filePath, + dir2, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + const extensionless = removeFileExtension(relativePath2); + return referencePath ? ensurePathIsNonModuleName(extensionless) : extensionless; + } + function getOwnEmitOutputFilePath(fileName, host, extension) { + const compilerOptions = host.getCompilerOptions(); + let emitOutputFilePathWithoutExtension; + if (compilerOptions.outDir) { + emitOutputFilePathWithoutExtension = removeFileExtension(getSourceFilePathInNewDir(fileName, host, compilerOptions.outDir)); + } else { + emitOutputFilePathWithoutExtension = removeFileExtension(fileName); + } + return emitOutputFilePathWithoutExtension + extension; + } + function getDeclarationEmitOutputFilePath(fileName, host) { + return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f8) => host.getCanonicalFileName(f8)); + } + function getDeclarationEmitOutputFilePathWorker(fileName, options, currentDirectory, commonSourceDirectory, getCanonicalFileName) { + const outputDir = options.declarationDir || options.outDir; + const path2 = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, currentDirectory, commonSourceDirectory, getCanonicalFileName) : fileName; + const declarationExtension = getDeclarationEmitExtensionForPath(path2); + return removeFileExtension(path2) + declarationExtension; + } + function getDeclarationEmitExtensionForPath(path2) { + return fileExtensionIsOneOf(path2, [ + ".mjs", + ".mts" + /* Mts */ + ]) ? ".d.mts" : fileExtensionIsOneOf(path2, [ + ".cjs", + ".cts" + /* Cts */ + ]) ? ".d.cts" : fileExtensionIsOneOf(path2, [ + ".json" + /* Json */ + ]) ? `.d.json.ts` : ( + // Drive-by redefinition of json declaration file output name so if it's ever enabled, it behaves well + ".d.ts" + ); + } + function getPossibleOriginalInputExtensionForExtension(path2) { + return fileExtensionIsOneOf(path2, [ + ".d.mts", + ".mjs", + ".mts" + /* Mts */ + ]) ? [ + ".mts", + ".mjs" + /* Mjs */ + ] : fileExtensionIsOneOf(path2, [ + ".d.cts", + ".cjs", + ".cts" + /* Cts */ + ]) ? [ + ".cts", + ".cjs" + /* Cjs */ + ] : fileExtensionIsOneOf(path2, [`.d.json.ts`]) ? [ + ".json" + /* Json */ + ] : [ + ".tsx", + ".ts", + ".jsx", + ".js" + /* Js */ + ]; + } + function outFile(options) { + return options.outFile || options.out; + } + function getPathsBasePath(options, host) { + var _a2; + if (!options.paths) + return void 0; + return options.baseUrl ?? Debug.checkDefined(options.pathsBasePath || ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); + } + function getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit) { + const options = host.getCompilerOptions(); + if (outFile(options)) { + const moduleKind = getEmitModuleKind(options); + const moduleEmitEnabled = options.emitDeclarationOnly || moduleKind === 2 || moduleKind === 4; + return filter2( + host.getSourceFiles(), + (sourceFile) => (moduleEmitEnabled || !isExternalModule(sourceFile)) && sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) + ); + } else { + const sourceFiles = targetSourceFile === void 0 ? host.getSourceFiles() : [targetSourceFile]; + return filter2( + sourceFiles, + (sourceFile) => sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) + ); + } + } + function sourceFileMayBeEmitted(sourceFile, host, forceDtsEmit) { + const options = host.getCompilerOptions(); + if (options.noEmitForJsFiles && isSourceFileJS(sourceFile)) + return false; + if (sourceFile.isDeclarationFile) + return false; + if (host.isSourceFileFromExternalLibrary(sourceFile)) + return false; + if (forceDtsEmit) + return true; + if (host.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) + return false; + if (!isJsonSourceFile(sourceFile)) + return true; + if (host.getResolvedProjectReferenceToRedirect(sourceFile.fileName)) + return false; + if (outFile(options)) + return true; + if (!options.outDir) + return false; + if (options.rootDir || options.composite && options.configFilePath) { + const commonDir = getNormalizedAbsolutePath(getCommonSourceDirectory(options, () => [], host.getCurrentDirectory(), host.getCanonicalFileName), host.getCurrentDirectory()); + const outputPath = getSourceFilePathInNewDirWorker(sourceFile.fileName, options.outDir, host.getCurrentDirectory(), commonDir, host.getCanonicalFileName); + if (comparePaths(sourceFile.fileName, outputPath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0) + return false; + } + return true; + } + function getSourceFilePathInNewDir(fileName, host, newDirPath) { + return getSourceFilePathInNewDirWorker(fileName, newDirPath, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f8) => host.getCanonicalFileName(f8)); + } + function getSourceFilePathInNewDirWorker(fileName, newDirPath, currentDirectory, commonSourceDirectory, getCanonicalFileName) { + let sourceFilePath = getNormalizedAbsolutePath(fileName, currentDirectory); + const isSourceFileInCommonSourceDirectory = getCanonicalFileName(sourceFilePath).indexOf(getCanonicalFileName(commonSourceDirectory)) === 0; + sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath; + return combinePaths(newDirPath, sourceFilePath); + } + function writeFile2(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) { + host.writeFile( + fileName, + text, + writeByteOrderMark, + (hostErrorMessage) => { + diagnostics.add(createCompilerDiagnostic(Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); + }, + sourceFiles, + data + ); + } + function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) { + if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { + const parentDirectory = getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory, createDirectory, directoryExists); + createDirectory(directoryPath); + } + } + function writeFileEnsuringDirectories(path2, data, writeByteOrderMark, writeFile22, createDirectory, directoryExists) { + try { + writeFile22(path2, data, writeByteOrderMark); + } catch { + ensureDirectoriesExist(getDirectoryPath(normalizePath(path2)), createDirectory, directoryExists); + writeFile22(path2, data, writeByteOrderMark); + } + } + function getLineOfLocalPosition(sourceFile, pos) { + const lineStarts = getLineStarts(sourceFile); + return computeLineOfPosition(lineStarts, pos); + } + function getLineOfLocalPositionFromLineMap(lineMap, pos) { + return computeLineOfPosition(lineMap, pos); + } + function getFirstConstructorWithBody(node) { + return find2(node.members, (member) => isConstructorDeclaration(member) && nodeIsPresent(member.body)); + } + function getSetAccessorValueParameter(accessor) { + if (accessor && accessor.parameters.length > 0) { + const hasThis = accessor.parameters.length === 2 && parameterIsThisKeyword(accessor.parameters[0]); + return accessor.parameters[hasThis ? 1 : 0]; + } + } + function getSetAccessorTypeAnnotationNode(accessor) { + const parameter = getSetAccessorValueParameter(accessor); + return parameter && parameter.type; + } + function getThisParameter(signature) { + if (signature.parameters.length && !isJSDocSignature(signature)) { + const thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + } + function parameterIsThisKeyword(parameter) { + return isThisIdentifier(parameter.name); + } + function isThisIdentifier(node) { + return !!node && node.kind === 80 && identifierIsThisKeyword(node); + } + function isInTypeQuery(node) { + return !!findAncestor( + node, + (n7) => n7.kind === 186 ? true : n7.kind === 80 || n7.kind === 166 ? false : "quit" + ); + } + function isThisInTypeQuery(node) { + if (!isThisIdentifier(node)) { + return false; + } + while (isQualifiedName(node.parent) && node.parent.left === node) { + node = node.parent; + } + return node.parent.kind === 186; + } + function identifierIsThisKeyword(id) { + return id.escapedText === "this"; + } + function getAllAccessorDeclarations(declarations, accessor) { + let firstAccessor; + let secondAccessor; + let getAccessor; + let setAccessor; + if (hasDynamicName(accessor)) { + firstAccessor = accessor; + if (accessor.kind === 177) { + getAccessor = accessor; + } else if (accessor.kind === 178) { + setAccessor = accessor; + } else { + Debug.fail("Accessor has wrong kind"); + } + } else { + forEach4(declarations, (member) => { + if (isAccessor(member) && isStatic(member) === isStatic(accessor)) { + const memberName = getPropertyNameForPropertyNameNode(member.name); + const accessorName = getPropertyNameForPropertyNameNode(accessor.name); + if (memberName === accessorName) { + if (!firstAccessor) { + firstAccessor = member; + } else if (!secondAccessor) { + secondAccessor = member; + } + if (member.kind === 177 && !getAccessor) { + getAccessor = member; + } + if (member.kind === 178 && !setAccessor) { + setAccessor = member; + } + } + } + }); + } + return { + firstAccessor, + secondAccessor, + getAccessor, + setAccessor + }; + } + function getEffectiveTypeAnnotationNode(node) { + if (!isInJSFile(node) && isFunctionDeclaration(node)) + return void 0; + const type3 = node.type; + if (type3 || !isInJSFile(node)) + return type3; + return isJSDocPropertyLikeTag(node) ? node.typeExpression && node.typeExpression.type : getJSDocType(node); + } + function getTypeAnnotationNode(node) { + return node.type; + } + function getEffectiveReturnTypeNode(node) { + return isJSDocSignature(node) ? node.type && node.type.typeExpression && node.type.typeExpression.type : node.type || (isInJSFile(node) ? getJSDocReturnType(node) : void 0); + } + function getJSDocTypeParameterDeclarations(node) { + return flatMap2(getJSDocTags(node), (tag) => isNonTypeAliasTemplate(tag) ? tag.typeParameters : void 0); + } + function isNonTypeAliasTemplate(tag) { + return isJSDocTemplateTag(tag) && !(tag.parent.kind === 327 && (tag.parent.tags.some(isJSDocTypeAlias) || tag.parent.tags.some(isJSDocOverloadTag))); + } + function getEffectiveSetAccessorTypeAnnotationNode(node) { + const parameter = getSetAccessorValueParameter(node); + return parameter && getEffectiveTypeAnnotationNode(parameter); + } + function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { + emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); + } + function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { + if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { + writer.writeLine(); + } + } + function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { + if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { + writer.writeLine(); + } + } + function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { + if (comments && comments.length > 0) { + if (leadingSeparator) { + writer.writeSpace(" "); + } + let emitInterveningSeparator = false; + for (const comment of comments) { + if (emitInterveningSeparator) { + writer.writeSpace(" "); + emitInterveningSeparator = false; + } + writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } else { + emitInterveningSeparator = true; + } + } + if (emitInterveningSeparator && trailingSeparator) { + writer.writeSpace(" "); + } + } + } + function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { + let leadingComments; + let currentDetachedCommentInfo; + if (removeComments) { + if (node.pos === 0) { + leadingComments = filter2(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); + } + } else { + leadingComments = getLeadingCommentRanges(text, node.pos); + } + if (leadingComments) { + const detachedComments = []; + let lastComment; + for (const comment of leadingComments) { + if (lastComment) { + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); + const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); + if (commentLine >= lastCommentLine + 2) { + break; + } + } + detachedComments.push(comment); + lastComment = comment; + } + if (detachedComments.length) { + const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, last2(detachedComments).end); + const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, skipTrivia(text, node.pos)); + if (nodeLine >= lastCommentLine + 2) { + emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); + emitComments( + text, + lineMap, + writer, + detachedComments, + /*leadingSeparator*/ + false, + /*trailingSeparator*/ + true, + newLine, + writeComment + ); + currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: last2(detachedComments).end }; + } + } + } + return currentDetachedCommentInfo; + function isPinnedCommentLocal(comment) { + return isPinnedComment(text, comment.pos); + } + } + function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { + if (text.charCodeAt(commentPos + 1) === 42) { + const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, commentPos); + const lineCount = lineMap.length; + let firstCommentLineIndent; + for (let pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { + const nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; + if (pos !== commentPos) { + if (firstCommentLineIndent === void 0) { + firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); + } + const currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); + const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); + if (spacesToEmit > 0) { + let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); + const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); + writer.rawWrite(indentSizeSpaceString); + while (numberOfSingleSpacesToEmit) { + writer.rawWrite(" "); + numberOfSingleSpacesToEmit--; + } + } else { + writer.rawWrite(""); + } + } + writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); + pos = nextLineStart; + } + } else { + writer.writeComment(text.substring(commentPos, commentEnd)); + } + } + function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { + const end = Math.min(commentEnd, nextLineStart - 1); + const currentLineText = text.substring(pos, end).trim(); + if (currentLineText) { + writer.writeComment(currentLineText); + if (end !== commentEnd) { + writer.writeLine(); + } + } else { + writer.rawWrite(newLine); + } + } + function calculateIndent(text, pos, end) { + let currentLineIndent = 0; + for (; pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { + if (text.charCodeAt(pos) === 9) { + currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); + } else { + currentLineIndent++; + } + } + return currentLineIndent; + } + function hasEffectiveModifiers(node) { + return getEffectiveModifierFlags(node) !== 0; + } + function hasSyntacticModifiers(node) { + return getSyntacticModifierFlags(node) !== 0; + } + function hasEffectiveModifier(node, flags) { + return !!getSelectedEffectiveModifierFlags(node, flags); + } + function hasSyntacticModifier(node, flags) { + return !!getSelectedSyntacticModifierFlags(node, flags); + } + function isStatic(node) { + return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node); + } + function hasStaticModifier(node) { + return hasSyntacticModifier( + node, + 256 + /* Static */ + ); + } + function hasOverrideModifier(node) { + return hasEffectiveModifier( + node, + 16 + /* Override */ + ); + } + function hasAbstractModifier(node) { + return hasSyntacticModifier( + node, + 64 + /* Abstract */ + ); + } + function hasAmbientModifier(node) { + return hasSyntacticModifier( + node, + 128 + /* Ambient */ + ); + } + function hasAccessorModifier(node) { + return hasSyntacticModifier( + node, + 512 + /* Accessor */ + ); + } + function hasEffectiveReadonlyModifier(node) { + return hasEffectiveModifier( + node, + 8 + /* Readonly */ + ); + } + function hasDecorators(node) { + return hasSyntacticModifier( + node, + 32768 + /* Decorator */ + ); + } + function getSelectedEffectiveModifierFlags(node, flags) { + return getEffectiveModifierFlags(node) & flags; + } + function getSelectedSyntacticModifierFlags(node, flags) { + return getSyntacticModifierFlags(node) & flags; + } + function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { + if (node.kind >= 0 && node.kind <= 165) { + return 0; + } + if (!(node.modifierFlagsCache & 536870912)) { + node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912; + } + if (alwaysIncludeJSDoc || includeJSDoc && isInJSFile(node)) { + if (!(node.modifierFlagsCache & 268435456) && node.parent) { + node.modifierFlagsCache |= getRawJSDocModifierFlagsNoCache(node) | 268435456; + } + return selectEffectiveModifierFlags(node.modifierFlagsCache); + } + return selectSyntacticModifierFlags(node.modifierFlagsCache); + } + function getEffectiveModifierFlags(node) { + return getModifierFlagsWorker( + node, + /*includeJSDoc*/ + true + ); + } + function getEffectiveModifierFlagsAlwaysIncludeJSDoc(node) { + return getModifierFlagsWorker( + node, + /*includeJSDoc*/ + true, + /*alwaysIncludeJSDoc*/ + true + ); + } + function getSyntacticModifierFlags(node) { + return getModifierFlagsWorker( + node, + /*includeJSDoc*/ + false + ); + } + function getRawJSDocModifierFlagsNoCache(node) { + let flags = 0; + if (!!node.parent && !isParameter(node)) { + if (isInJSFile(node)) { + if (getJSDocPublicTagNoCache(node)) + flags |= 8388608; + if (getJSDocPrivateTagNoCache(node)) + flags |= 16777216; + if (getJSDocProtectedTagNoCache(node)) + flags |= 33554432; + if (getJSDocReadonlyTagNoCache(node)) + flags |= 67108864; + if (getJSDocOverrideTagNoCache(node)) + flags |= 134217728; + } + if (getJSDocDeprecatedTagNoCache(node)) + flags |= 65536; + } + return flags; + } + function selectSyntacticModifierFlags(flags) { + return flags & 65535; + } + function selectEffectiveModifierFlags(flags) { + return flags & 131071 | (flags & 260046848) >>> 23; + } + function getJSDocModifierFlagsNoCache(node) { + return selectEffectiveModifierFlags(getRawJSDocModifierFlagsNoCache(node)); + } + function getEffectiveModifierFlagsNoCache(node) { + return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node); + } + function getSyntacticModifierFlagsNoCache(node) { + let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0; + if (node.flags & 8 || node.kind === 80 && node.flags & 4096) { + flags |= 32; + } + return flags; + } + function modifiersToFlags(modifiers) { + let flags = 0; + if (modifiers) { + for (const modifier of modifiers) { + flags |= modifierToFlag(modifier.kind); + } + } + return flags; + } + function modifierToFlag(token) { + switch (token) { + case 126: + return 256; + case 125: + return 1; + case 124: + return 4; + case 123: + return 2; + case 128: + return 64; + case 129: + return 512; + case 95: + return 32; + case 138: + return 128; + case 87: + return 4096; + case 90: + return 2048; + case 134: + return 1024; + case 148: + return 8; + case 164: + return 16; + case 103: + return 8192; + case 147: + return 16384; + case 170: + return 32768; + } + return 0; + } + function isBinaryLogicalOperator(token) { + return token === 57 || token === 56; + } + function isLogicalOperator(token) { + return isBinaryLogicalOperator(token) || token === 54; + } + function isLogicalOrCoalescingAssignmentOperator(token) { + return token === 76 || token === 77 || token === 78; + } + function isLogicalOrCoalescingAssignmentExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingAssignmentOperator(expr.operatorToken.kind); + } + function isLogicalOrCoalescingBinaryOperator(token) { + return isBinaryLogicalOperator(token) || token === 61; + } + function isLogicalOrCoalescingBinaryExpression(expr) { + return isBinaryExpression(expr) && isLogicalOrCoalescingBinaryOperator(expr.operatorToken.kind); + } + function isAssignmentOperator(token) { + return token >= 64 && token <= 79; + } + function tryGetClassExtendingExpressionWithTypeArguments(node) { + const cls = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + return cls && !cls.isImplements ? cls.class : void 0; + } + function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node) { + if (isExpressionWithTypeArguments(node)) { + if (isHeritageClause(node.parent) && isClassLike(node.parent.parent)) { + return { + class: node.parent.parent, + isImplements: node.parent.token === 119 + /* ImplementsKeyword */ + }; + } + if (isJSDocAugmentsTag(node.parent)) { + const host = getEffectiveJSDocHost(node.parent); + if (host && isClassLike(host)) { + return { class: host, isImplements: false }; + } + } + } + return void 0; + } + function isAssignmentExpression(node, excludeCompoundAssignment) { + return isBinaryExpression(node) && (excludeCompoundAssignment ? node.operatorToken.kind === 64 : isAssignmentOperator(node.operatorToken.kind)) && isLeftHandSideExpression(node.left); + } + function isLeftHandSideOfAssignment(node) { + return isAssignmentExpression(node.parent) && node.parent.left === node; + } + function isDestructuringAssignment(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const kind = node.left.kind; + return kind === 210 || kind === 209; + } + return false; + } + function isExpressionWithTypeArgumentsInClassExtendsClause(node) { + return tryGetClassExtendingExpressionWithTypeArguments(node) !== void 0; + } + function isEntityNameExpression(node) { + return node.kind === 80 || isPropertyAccessEntityNameExpression(node); + } + function getFirstIdentifier(node) { + switch (node.kind) { + case 80: + return node; + case 166: + do { + node = node.left; + } while (node.kind !== 80); + return node; + case 211: + do { + node = node.expression; + } while (node.kind !== 80); + return node; + } + } + function isDottedName(node) { + return node.kind === 80 || node.kind === 110 || node.kind === 108 || node.kind === 236 || node.kind === 211 && isDottedName(node.expression) || node.kind === 217 && isDottedName(node.expression); + } + function isPropertyAccessEntityNameExpression(node) { + return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); + } + function tryGetPropertyAccessOrIdentifierToString(expr) { + if (isPropertyAccessExpression(expr)) { + const baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (baseStr !== void 0) { + return baseStr + "." + entityNameToString(expr.name); + } + } else if (isElementAccessExpression(expr)) { + const baseStr = tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (baseStr !== void 0 && isPropertyName(expr.argumentExpression)) { + return baseStr + "." + getPropertyNameForPropertyNameNode(expr.argumentExpression); + } + } else if (isIdentifier(expr)) { + return unescapeLeadingUnderscores(expr.escapedText); + } else if (isJsxNamespacedName(expr)) { + return getTextOfJsxNamespacedName(expr); + } + return void 0; + } + function isPrototypeAccess(node) { + return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; + } + function isRightSideOfQualifiedNameOrPropertyAccess(node) { + return node.parent.kind === 166 && node.parent.right === node || node.parent.kind === 211 && node.parent.name === node || node.parent.kind === 236 && node.parent.name === node; + } + function isRightSideOfAccessExpression(node) { + return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node); + } + function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) { + return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node; + } + function isInstanceOfExpression(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 104; + } + function isRightSideOfInstanceofExpression(node) { + return isInstanceOfExpression(node.parent) && node === node.parent.right; + } + function isEmptyObjectLiteral(expression) { + return expression.kind === 210 && expression.properties.length === 0; + } + function isEmptyArrayLiteral(expression) { + return expression.kind === 209 && expression.elements.length === 0; + } + function getLocalSymbolForExportDefault(symbol) { + if (!isExportDefaultSymbol(symbol) || !symbol.declarations) + return void 0; + for (const decl of symbol.declarations) { + if (decl.localSymbol) + return decl.localSymbol; + } + return void 0; + } + function isExportDefaultSymbol(symbol) { + return symbol && length(symbol.declarations) > 0 && hasSyntacticModifier( + symbol.declarations[0], + 2048 + /* Default */ + ); + } + function tryExtractTSExtension(fileName) { + return find2(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension)); + } + function getExpandedCharCodes(input) { + const output = []; + const length2 = input.length; + for (let i7 = 0; i7 < length2; i7++) { + const charCode = input.charCodeAt(i7); + if (charCode < 128) { + output.push(charCode); + } else if (charCode < 2048) { + output.push(charCode >> 6 | 192); + output.push(charCode & 63 | 128); + } else if (charCode < 65536) { + output.push(charCode >> 12 | 224); + output.push(charCode >> 6 & 63 | 128); + output.push(charCode & 63 | 128); + } else if (charCode < 131072) { + output.push(charCode >> 18 | 240); + output.push(charCode >> 12 & 63 | 128); + output.push(charCode >> 6 & 63 | 128); + output.push(charCode & 63 | 128); + } else { + Debug.assert(false, "Unexpected code point"); + } + } + return output; + } + function convertToBase64(input) { + let result2 = ""; + const charCodes = getExpandedCharCodes(input); + let i7 = 0; + const length2 = charCodes.length; + let byte1, byte2, byte3, byte4; + while (i7 < length2) { + byte1 = charCodes[i7] >> 2; + byte2 = (charCodes[i7] & 3) << 4 | charCodes[i7 + 1] >> 4; + byte3 = (charCodes[i7 + 1] & 15) << 2 | charCodes[i7 + 2] >> 6; + byte4 = charCodes[i7 + 2] & 63; + if (i7 + 1 >= length2) { + byte3 = byte4 = 64; + } else if (i7 + 2 >= length2) { + byte4 = 64; + } + result2 += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); + i7 += 3; + } + return result2; + } + function getStringFromExpandedCharCodes(codes2) { + let output = ""; + let i7 = 0; + const length2 = codes2.length; + while (i7 < length2) { + const charCode = codes2[i7]; + if (charCode < 128) { + output += String.fromCharCode(charCode); + i7++; + } else if ((charCode & 192) === 192) { + let value2 = charCode & 63; + i7++; + let nextCode = codes2[i7]; + while ((nextCode & 192) === 128) { + value2 = value2 << 6 | nextCode & 63; + i7++; + nextCode = codes2[i7]; + } + output += String.fromCharCode(value2); + } else { + output += String.fromCharCode(charCode); + i7++; + } + } + return output; + } + function base64encode(host, input) { + if (host && host.base64encode) { + return host.base64encode(input); + } + return convertToBase64(input); + } + function base64decode(host, input) { + if (host && host.base64decode) { + return host.base64decode(input); + } + const length2 = input.length; + const expandedCharCodes = []; + let i7 = 0; + while (i7 < length2) { + if (input.charCodeAt(i7) === base64Digits.charCodeAt(64)) { + break; + } + const ch1 = base64Digits.indexOf(input[i7]); + const ch2 = base64Digits.indexOf(input[i7 + 1]); + const ch3 = base64Digits.indexOf(input[i7 + 2]); + const ch4 = base64Digits.indexOf(input[i7 + 3]); + const code1 = (ch1 & 63) << 2 | ch2 >> 4 & 3; + const code2 = (ch2 & 15) << 4 | ch3 >> 2 & 15; + const code3 = (ch3 & 3) << 6 | ch4 & 63; + if (code2 === 0 && ch3 !== 0) { + expandedCharCodes.push(code1); + } else if (code3 === 0 && ch4 !== 0) { + expandedCharCodes.push(code1, code2); + } else { + expandedCharCodes.push(code1, code2, code3); + } + i7 += 4; + } + return getStringFromExpandedCharCodes(expandedCharCodes); + } + function readJsonOrUndefined(path2, hostOrText) { + const jsonText = isString4(hostOrText) ? hostOrText : hostOrText.readFile(path2); + if (!jsonText) + return void 0; + const result2 = parseConfigFileTextToJson(path2, jsonText); + return !result2.error ? result2.config : void 0; + } + function readJson(path2, host) { + return readJsonOrUndefined(path2, host) || {}; + } + function tryParseJson(text) { + try { + return JSON.parse(text); + } catch { + return void 0; + } + } + function directoryProbablyExists(directoryName, host) { + return !host.directoryExists || host.directoryExists(directoryName); + } + function getNewLineCharacter(options) { + switch (options.newLine) { + case 0: + return carriageReturnLineFeed; + case 1: + case void 0: + return lineFeed; + } + } + function createRange2(pos, end = pos) { + Debug.assert(end >= pos || end === -1); + return { pos, end }; + } + function moveRangeEnd(range2, end) { + return createRange2(range2.pos, end); + } + function moveRangePos(range2, pos) { + return createRange2(pos, range2.end); + } + function moveRangePastDecorators(node) { + const lastDecorator = canHaveModifiers(node) ? findLast2(node.modifiers, isDecorator) : void 0; + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? moveRangePos(node, lastDecorator.end) : node; + } + function moveRangePastModifiers(node) { + if (isPropertyDeclaration(node) || isMethodDeclaration(node)) { + return moveRangePos(node, node.name.pos); + } + const lastModifier = canHaveModifiers(node) ? lastOrUndefined(node.modifiers) : void 0; + return lastModifier && !positionIsSynthesized(lastModifier.end) ? moveRangePos(node, lastModifier.end) : moveRangePastDecorators(node); + } + function isCollapsedRange(range2) { + return range2.pos === range2.end; + } + function createTokenRange(pos, token) { + return createRange2(pos, pos + tokenToString(token).length); + } + function rangeIsOnSingleLine(range2, sourceFile) { + return rangeStartIsOnSameLineAsRangeEnd(range2, range2, sourceFile); + } + function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine( + getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), + getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), + sourceFile + ); + } + function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, range2.end, sourceFile); + } + function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { + return positionsAreOnSameLine(getStartPositionOfRange( + range1, + sourceFile, + /*includeComments*/ + false + ), range2.end, sourceFile); + } + function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { + return positionsAreOnSameLine(range1.end, getStartPositionOfRange( + range2, + sourceFile, + /*includeComments*/ + false + ), sourceFile); + } + function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { + const range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); + return getLinesBetweenPositions(sourceFile, range1.end, range2Start); + } + function getLinesBetweenRangeEndPositions(range1, range2, sourceFile) { + return getLinesBetweenPositions(sourceFile, range1.end, range2.end); + } + function isNodeArrayMultiLine(list, sourceFile) { + return !positionsAreOnSameLine(list.pos, list.end, sourceFile); + } + function positionsAreOnSameLine(pos1, pos2, sourceFile) { + return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; + } + function getStartPositionOfRange(range2, sourceFile, includeComments) { + return positionIsSynthesized(range2.pos) ? -1 : skipTrivia( + sourceFile.text, + range2.pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + } + function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + const startPos = skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + const prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); + return getLinesBetweenPositions(sourceFile, prevPos ?? stopPos, startPos); + } + function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { + const nextPos = skipTrivia( + sourceFile.text, + pos, + /*stopAfterLineBreak*/ + false, + includeComments + ); + return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); + } + function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) { + while (pos-- > stopPos) { + if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { + return pos; + } + } + } + function isDeclarationNameOfEnumOrNamespace(node) { + const parseNode = getParseTreeNode(node); + if (parseNode) { + switch (parseNode.parent.kind) { + case 266: + case 267: + return parseNode === parseNode.parent.name; + } + } + return false; + } + function getInitializedVariables(node) { + return filter2(node.declarations, isInitializedVariable); + } + function isInitializedVariable(node) { + return isVariableDeclaration(node) && node.initializer !== void 0; + } + function isWatchSet(options) { + return options.watch && hasProperty(options, "watch"); + } + function closeFileWatcher(watcher) { + watcher.close(); + } + function getCheckFlags(symbol) { + return symbol.flags & 33554432 ? symbol.links.checkFlags : 0; + } + function getDeclarationModifierFlagsFromSymbol(s7, isWrite = false) { + if (s7.valueDeclaration) { + const declaration = isWrite && s7.declarations && find2(s7.declarations, isSetAccessorDeclaration) || s7.flags & 32768 && find2(s7.declarations, isGetAccessorDeclaration) || s7.valueDeclaration; + const flags = getCombinedModifierFlags(declaration); + return s7.parent && s7.parent.flags & 32 ? flags : flags & ~7; + } + if (getCheckFlags(s7) & 6) { + const checkFlags = s7.links.checkFlags; + const accessModifier = checkFlags & 1024 ? 2 : checkFlags & 256 ? 1 : 4; + const staticModifier = checkFlags & 2048 ? 256 : 0; + return accessModifier | staticModifier; + } + if (s7.flags & 4194304) { + return 1 | 256; + } + return 0; + } + function skipAlias(symbol, checker) { + return symbol.flags & 2097152 ? checker.getAliasedSymbol(symbol) : symbol; + } + function getCombinedLocalAndExportSymbolFlags(symbol) { + return symbol.exportSymbol ? symbol.exportSymbol.flags | symbol.flags : symbol.flags; + } + function isWriteOnlyAccess(node) { + return accessKind(node) === 1; + } + function isWriteAccess(node) { + return accessKind(node) !== 0; + } + function accessKind(node) { + const { parent: parent22 } = node; + switch (parent22 == null ? void 0 : parent22.kind) { + case 217: + return accessKind(parent22); + case 225: + case 224: + const { operator } = parent22; + return operator === 46 || operator === 47 ? 2 : 0; + case 226: + const { left, operatorToken } = parent22; + return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 64 ? 1 : 2 : 0; + case 211: + return parent22.name !== node ? 0 : accessKind(parent22); + case 303: { + const parentAccess = accessKind(parent22.parent); + return node === parent22.name ? reverseAccessKind(parentAccess) : parentAccess; + } + case 304: + return node === parent22.objectAssignmentInitializer ? 0 : accessKind(parent22.parent); + case 209: + return accessKind(parent22); + default: + return 0; + } + } + function reverseAccessKind(a7) { + switch (a7) { + case 0: + return 1; + case 1: + return 0; + case 2: + return 2; + default: + return Debug.assertNever(a7); + } + } + function compareDataObjects(dst, src) { + if (!dst || !src || Object.keys(dst).length !== Object.keys(src).length) { + return false; + } + for (const e10 in dst) { + if (typeof dst[e10] === "object") { + if (!compareDataObjects(dst[e10], src[e10])) { + return false; + } + } else if (typeof dst[e10] !== "function") { + if (dst[e10] !== src[e10]) { + return false; + } + } + } + return true; + } + function clearMap(map22, onDeleteValue) { + map22.forEach(onDeleteValue); + map22.clear(); + } + function mutateMapSkippingNewValues(map22, newMap, options) { + const { onDeleteValue, onExistingValue } = options; + map22.forEach((existingValue, key) => { + var _a2; + if (!(newMap == null ? void 0 : newMap.has(key))) { + map22.delete(key); + onDeleteValue(existingValue, key); + } else if (onExistingValue) { + onExistingValue(existingValue, (_a2 = newMap.get) == null ? void 0 : _a2.call(newMap, key), key); + } + }); + } + function mutateMap(map22, newMap, options) { + mutateMapSkippingNewValues(map22, newMap, options); + const { createNewValue } = options; + newMap == null ? void 0 : newMap.forEach((valueInNewMap, key) => { + if (!map22.has(key)) { + map22.set(key, createNewValue(key, valueInNewMap)); + } + }); + } + function isAbstractConstructorSymbol(symbol) { + if (symbol.flags & 32) { + const declaration = getClassLikeDeclarationOfSymbol(symbol); + return !!declaration && hasSyntacticModifier( + declaration, + 64 + /* Abstract */ + ); + } + return false; + } + function getClassLikeDeclarationOfSymbol(symbol) { + var _a2; + return (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isClassLike); + } + function getObjectFlags(type3) { + return type3.flags & 3899393 ? type3.objectFlags : 0; + } + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, (d7) => callback(d7) ? true : void 0); + } + function isUMDExportSymbol(symbol) { + return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]); + } + function showModuleSpecifier({ moduleSpecifier }) { + return isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier); + } + function getLastChild(node) { + let lastChild; + forEachChild(node, (child) => { + if (nodeIsPresent(child)) + lastChild = child; + }, (children) => { + for (let i7 = children.length - 1; i7 >= 0; i7--) { + if (nodeIsPresent(children[i7])) { + lastChild = children[i7]; + break; + } + } + }); + return lastChild; + } + function addToSeen(seen, key, value2 = true) { + if (seen.has(key)) { + return false; + } + seen.set(key, value2); + return true; + } + function isObjectTypeDeclaration(node) { + return isClassLike(node) || isInterfaceDeclaration(node) || isTypeLiteralNode(node); + } + function isTypeNodeKind(kind) { + return kind >= 182 && kind <= 205 || kind === 133 || kind === 159 || kind === 150 || kind === 163 || kind === 151 || kind === 136 || kind === 154 || kind === 155 || kind === 116 || kind === 157 || kind === 146 || kind === 141 || kind === 233 || kind === 319 || kind === 320 || kind === 321 || kind === 322 || kind === 323 || kind === 324 || kind === 325; + } + function isAccessExpression(node) { + return node.kind === 211 || node.kind === 212; + } + function getNameOfAccessExpression(node) { + if (node.kind === 211) { + return node.name; + } + Debug.assert( + node.kind === 212 + /* ElementAccessExpression */ + ); + return node.argumentExpression; + } + function isBundleFileTextLike(section) { + switch (section.kind) { + case "text": + case "internal": + return true; + default: + return false; + } + } + function isNamedImportsOrExports(node) { + return node.kind === 275 || node.kind === 279; + } + function getLeftmostAccessExpression(expr) { + while (isAccessExpression(expr)) { + expr = expr.expression; + } + return expr; + } + function forEachNameInAccessChainWalkingLeft(name2, action) { + if (isAccessExpression(name2.parent) && isRightSideOfAccessExpression(name2)) { + return walkAccessExpression(name2.parent); + } + function walkAccessExpression(access2) { + if (access2.kind === 211) { + const res = action(access2.name); + if (res !== void 0) { + return res; + } + } else if (access2.kind === 212) { + if (isIdentifier(access2.argumentExpression) || isStringLiteralLike(access2.argumentExpression)) { + const res = action(access2.argumentExpression); + if (res !== void 0) { + return res; + } + } else { + return void 0; + } + } + if (isAccessExpression(access2.expression)) { + return walkAccessExpression(access2.expression); + } + if (isIdentifier(access2.expression)) { + return action(access2.expression); + } + return void 0; + } + } + function getLeftmostExpression(node, stopAtCallExpressions) { + while (true) { + switch (node.kind) { + case 225: + node = node.operand; + continue; + case 226: + node = node.left; + continue; + case 227: + node = node.condition; + continue; + case 215: + node = node.tag; + continue; + case 213: + if (stopAtCallExpressions) { + return node; + } + case 234: + case 212: + case 211: + case 235: + case 360: + case 238: + node = node.expression; + continue; + } + return node; + } + } + function Symbol4(flags, name2) { + this.flags = flags; + this.escapedName = name2; + this.declarations = void 0; + this.valueDeclaration = void 0; + this.id = 0; + this.mergeId = 0; + this.parent = void 0; + this.members = void 0; + this.exports = void 0; + this.exportSymbol = void 0; + this.constEnumOnlyModule = void 0; + this.isReferenced = void 0; + this.lastAssignmentPos = void 0; + this.links = void 0; + } + function Type3(checker, flags) { + this.flags = flags; + if (Debug.isDebugging || tracing) { + this.checker = checker; + } + } + function Signature2(checker, flags) { + this.flags = flags; + if (Debug.isDebugging) { + this.checker = checker; + } + } + function Node4(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + this.original = void 0; + this.emitNode = void 0; + } + function Token(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.transformFlags = 0; + this.parent = void 0; + this.emitNode = void 0; + } + function Identifier2(kind, pos, end) { + this.pos = pos; + this.end = end; + this.kind = kind; + this.id = 0; + this.flags = 0; + this.transformFlags = 0; + this.parent = void 0; + this.original = void 0; + this.emitNode = void 0; + } + function SourceMapSource(fileName, text, skipTrivia2) { + this.fileName = fileName; + this.text = text; + this.skipTrivia = skipTrivia2 || ((pos) => pos); + } + function addObjectAllocatorPatcher(fn) { + objectAllocatorPatchers.push(fn); + fn(objectAllocator); + } + function setObjectAllocator(alloc) { + Object.assign(objectAllocator, alloc); + forEach4(objectAllocatorPatchers, (fn) => fn(objectAllocator)); + } + function formatStringFromArgs(text, args) { + return text.replace(/{(\d+)}/g, (_match, index4) => "" + Debug.checkDefined(args[+index4])); + } + function setLocalizedDiagnosticMessages(messages) { + localizedDiagnosticMessages = messages; + } + function maybeSetLocalizedDiagnosticMessages(getMessages) { + if (!localizedDiagnosticMessages && getMessages) { + localizedDiagnosticMessages = getMessages(); + } + } + function getLocaleSpecificMessage(message) { + return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message; + } + function createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args) { + if (start + length2 > sourceText.length) { + length2 = sourceText.length - start; + } + assertDiagnosticLocation(sourceText, start, length2); + let text = getLocaleSpecificMessage(message); + if (some2(args)) { + text = formatStringFromArgs(text, args); + } + return { + file: void 0, + start, + length: length2, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + fileName + }; + } + function isDiagnosticWithDetachedLocation(diagnostic) { + return diagnostic.file === void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0 && typeof diagnostic.fileName === "string"; + } + function attachFileToDiagnostic(diagnostic, file) { + const fileName = file.fileName || ""; + const length2 = file.text.length; + Debug.assertEqual(diagnostic.fileName, fileName); + Debug.assertLessThanOrEqual(diagnostic.start, length2); + Debug.assertLessThanOrEqual(diagnostic.start + diagnostic.length, length2); + const diagnosticWithLocation = { + file, + start: diagnostic.start, + length: diagnostic.length, + messageText: diagnostic.messageText, + category: diagnostic.category, + code: diagnostic.code, + reportsUnnecessary: diagnostic.reportsUnnecessary + }; + if (diagnostic.relatedInformation) { + diagnosticWithLocation.relatedInformation = []; + for (const related of diagnostic.relatedInformation) { + if (isDiagnosticWithDetachedLocation(related) && related.fileName === fileName) { + Debug.assertLessThanOrEqual(related.start, length2); + Debug.assertLessThanOrEqual(related.start + related.length, length2); + diagnosticWithLocation.relatedInformation.push(attachFileToDiagnostic(related, file)); + } else { + diagnosticWithLocation.relatedInformation.push(related); + } + } + } + return diagnosticWithLocation; + } + function attachFileToDiagnostics(diagnostics, file) { + const diagnosticsWithLocation = []; + for (const diagnostic of diagnostics) { + diagnosticsWithLocation.push(attachFileToDiagnostic(diagnostic, file)); + } + return diagnosticsWithLocation; + } + function createFileDiagnostic(file, start, length2, message, ...args) { + assertDiagnosticLocation(file.text, start, length2); + let text = getLocaleSpecificMessage(message); + if (some2(args)) { + text = formatStringFromArgs(text, args); + } + return { + file, + start, + length: length2, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + reportsDeprecated: message.reportsDeprecated + }; + } + function formatMessage(message, ...args) { + let text = getLocaleSpecificMessage(message); + if (some2(args)) { + text = formatStringFromArgs(text, args); + } + return text; + } + function createCompilerDiagnostic(message, ...args) { + let text = getLocaleSpecificMessage(message); + if (some2(args)) { + text = formatStringFromArgs(text, args); + } + return { + file: void 0, + start: void 0, + length: void 0, + messageText: text, + category: message.category, + code: message.code, + reportsUnnecessary: message.reportsUnnecessary, + reportsDeprecated: message.reportsDeprecated + }; + } + function createCompilerDiagnosticFromMessageChain(chain3, relatedInformation) { + return { + file: void 0, + start: void 0, + length: void 0, + code: chain3.code, + category: chain3.category, + messageText: chain3.next ? chain3 : chain3.messageText, + relatedInformation + }; + } + function chainDiagnosticMessages(details, message, ...args) { + let text = getLocaleSpecificMessage(message); + if (some2(args)) { + text = formatStringFromArgs(text, args); + } + return { + messageText: text, + category: message.category, + code: message.code, + next: details === void 0 || Array.isArray(details) ? details : [details] + }; + } + function concatenateDiagnosticMessageChains(headChain, tailChain) { + let lastChain = headChain; + while (lastChain.next) { + lastChain = lastChain.next[0]; + } + lastChain.next = [tailChain]; + } + function getDiagnosticFilePath(diagnostic) { + return diagnostic.file ? diagnostic.file.path : void 0; + } + function compareDiagnostics(d1, d22) { + return compareDiagnosticsSkipRelatedInformation(d1, d22) || compareRelatedInformation(d1, d22) || 0; + } + function compareDiagnosticsSkipRelatedInformation(d1, d22) { + return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d22)) || compareValues(d1.start, d22.start) || compareValues(d1.length, d22.length) || compareValues(d1.code, d22.code) || compareMessageText(d1.messageText, d22.messageText) || 0; + } + function compareRelatedInformation(d1, d22) { + if (!d1.relatedInformation && !d22.relatedInformation) { + return 0; + } + if (d1.relatedInformation && d22.relatedInformation) { + return compareValues(d1.relatedInformation.length, d22.relatedInformation.length) || forEach4(d1.relatedInformation, (d1i, index4) => { + const d2i = d22.relatedInformation[index4]; + return compareDiagnostics(d1i, d2i); + }) || 0; + } + return d1.relatedInformation ? -1 : 1; + } + function compareMessageText(t1, t22) { + if (typeof t1 === "string" && typeof t22 === "string") { + return compareStringsCaseSensitive(t1, t22); + } else if (typeof t1 === "string") { + return -1; + } else if (typeof t22 === "string") { + return 1; + } + let res = compareStringsCaseSensitive(t1.messageText, t22.messageText); + if (res) { + return res; + } + if (!t1.next && !t22.next) { + return 0; + } + if (!t1.next) { + return -1; + } + if (!t22.next) { + return 1; + } + const len = Math.min(t1.next.length, t22.next.length); + for (let i7 = 0; i7 < len; i7++) { + res = compareMessageText(t1.next[i7], t22.next[i7]); + if (res) { + return res; + } + } + if (t1.next.length < t22.next.length) { + return -1; + } else if (t1.next.length > t22.next.length) { + return 1; + } + return 0; + } + function getLanguageVariant(scriptKind) { + return scriptKind === 4 || scriptKind === 2 || scriptKind === 1 || scriptKind === 6 ? 1 : 0; + } + function walkTreeForJSXTags(node) { + if (!(node.transformFlags & 2)) + return void 0; + return isJsxOpeningLikeElement(node) || isJsxFragment(node) ? node : forEachChild(node, walkTreeForJSXTags); + } + function isFileModuleFromUsingJSXTag(file) { + return !file.isDeclarationFile ? walkTreeForJSXTags(file) : void 0; + } + function isFileForcedToBeModuleByFormat(file) { + return (file.impliedNodeFormat === 99 || fileExtensionIsOneOf(file.fileName, [ + ".cjs", + ".cts", + ".mjs", + ".mts" + /* Mts */ + ])) && !file.isDeclarationFile ? true : void 0; + } + function getSetExternalModuleIndicator(options) { + switch (getEmitModuleDetectionKind(options)) { + case 3: + return (file) => { + file.externalModuleIndicator = isFileProbablyExternalModule(file) || !file.isDeclarationFile || void 0; + }; + case 1: + return (file) => { + file.externalModuleIndicator = isFileProbablyExternalModule(file); + }; + case 2: + const checks = [isFileProbablyExternalModule]; + if (options.jsx === 4 || options.jsx === 5) { + checks.push(isFileModuleFromUsingJSXTag); + } + checks.push(isFileForcedToBeModuleByFormat); + const combined = or(...checks); + const callback = (file) => void (file.externalModuleIndicator = combined(file)); + return callback; + } + } + function createComputedCompilerOptions(options) { + return options; + } + function emitModuleKindIsNonNodeESM(moduleKind) { + return moduleKind >= 5 && moduleKind <= 99; + } + function hasJsonModuleEmitEnabled(options) { + switch (getEmitModuleKind(options)) { + case 0: + case 4: + case 3: + return false; + } + return true; + } + function importNameElisionDisabled(options) { + return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports; + } + function unreachableCodeIsError(options) { + return options.allowUnreachableCode === false; + } + function unusedLabelIsError(options) { + return options.allowUnusedLabels === false; + } + function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) { + return moduleResolution >= 3 && moduleResolution <= 99 || moduleResolution === 100; + } + function getStrictOptionValue(compilerOptions, flag) { + return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag]; + } + function getEmitStandardClassFields(compilerOptions) { + return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9; + } + function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, semanticDiagnosticsOptionDeclarations); + } + function compilerOptionsAffectEmit(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, affectsEmitOptionDeclarations); + } + function compilerOptionsAffectDeclarationPath(newOptions, oldOptions) { + return optionsHaveChanges(oldOptions, newOptions, affectsDeclarationPathOptionDeclarations); + } + function getCompilerOptionValue(options, option) { + return option.strictFlag ? getStrictOptionValue(options, option.name) : option.allowJsFlag ? getAllowJSCompilerOption(options) : options[option.name]; + } + function getJSXTransformEnabled(options) { + const jsx = options.jsx; + return jsx === 2 || jsx === 4 || jsx === 5; + } + function getJSXImplicitImportBase(compilerOptions, file) { + const jsxImportSourcePragmas = file == null ? void 0 : file.pragmas.get("jsximportsource"); + const jsxImportSourcePragma = isArray3(jsxImportSourcePragmas) ? jsxImportSourcePragmas[jsxImportSourcePragmas.length - 1] : jsxImportSourcePragmas; + return compilerOptions.jsx === 4 || compilerOptions.jsx === 5 || compilerOptions.jsxImportSource || jsxImportSourcePragma ? (jsxImportSourcePragma == null ? void 0 : jsxImportSourcePragma.arguments.factory) || compilerOptions.jsxImportSource || "react" : void 0; + } + function getJSXRuntimeImport(base, options) { + return base ? `${base}/${options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime"}` : void 0; + } + function hasZeroOrOneAsteriskCharacter(str2) { + let seenAsterisk = false; + for (let i7 = 0; i7 < str2.length; i7++) { + if (str2.charCodeAt(i7) === 42) { + if (!seenAsterisk) { + seenAsterisk = true; + } else { + return false; + } + } + } + return true; + } + function createSymlinkCache(cwd3, getCanonicalFileName) { + let symlinkedDirectories; + let symlinkedDirectoriesByRealpath; + let symlinkedFiles; + let hasProcessedResolutions = false; + return { + getSymlinkedFiles: () => symlinkedFiles, + getSymlinkedDirectories: () => symlinkedDirectories, + getSymlinkedDirectoriesByRealpath: () => symlinkedDirectoriesByRealpath, + setSymlinkedFile: (path2, real) => (symlinkedFiles || (symlinkedFiles = /* @__PURE__ */ new Map())).set(path2, real), + setSymlinkedDirectory: (symlink2, real) => { + let symlinkPath = toPath2(symlink2, cwd3, getCanonicalFileName); + if (!containsIgnoredPath(symlinkPath)) { + symlinkPath = ensureTrailingDirectorySeparator(symlinkPath); + if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) { + (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink2); + } + (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real); + } + }, + setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) { + Debug.assert(!hasProcessedResolutions); + hasProcessedResolutions = true; + forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule)); + forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); + typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)); + }, + hasProcessedResolutions: () => hasProcessedResolutions + }; + function processResolution(cache, resolution) { + if (!resolution || !resolution.originalPath || !resolution.resolvedFileName) + return; + const { resolvedFileName, originalPath } = resolution; + cache.setSymlinkedFile(toPath2(originalPath, cwd3, getCanonicalFileName), resolvedFileName); + const [commonResolved, commonOriginal] = guessDirectorySymlink(resolvedFileName, originalPath, cwd3, getCanonicalFileName) || emptyArray; + if (commonResolved && commonOriginal) { + cache.setSymlinkedDirectory( + commonOriginal, + { + real: ensureTrailingDirectorySeparator(commonResolved), + realPath: ensureTrailingDirectorySeparator(toPath2(commonResolved, cwd3, getCanonicalFileName)) + } + ); + } + } + } + function guessDirectorySymlink(a7, b8, cwd3, getCanonicalFileName) { + const aParts = getPathComponents(getNormalizedAbsolutePath(a7, cwd3)); + const bParts = getPathComponents(getNormalizedAbsolutePath(b8, cwd3)); + let isDirectory = false; + while (aParts.length >= 2 && bParts.length >= 2 && !isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) && !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) && getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) { + aParts.pop(); + bParts.pop(); + isDirectory = true; + } + return isDirectory ? [getPathFromPathComponents(aParts), getPathFromPathComponents(bParts)] : void 0; + } + function isNodeModulesOrScopedPackageDirectory(s7, getCanonicalFileName) { + return s7 !== void 0 && (getCanonicalFileName(s7) === "node_modules" || startsWith2(s7, "@")); + } + function stripLeadingDirectorySeparator(s7) { + return isAnyDirectorySeparator(s7.charCodeAt(0)) ? s7.slice(1) : void 0; + } + function tryRemoveDirectoryPrefix(path2, dirPath, getCanonicalFileName) { + const withoutPrefix = tryRemovePrefix(path2, dirPath, getCanonicalFileName); + return withoutPrefix === void 0 ? void 0 : stripLeadingDirectorySeparator(withoutPrefix); + } + function regExpEscape(text) { + return text.replace(reservedCharacterPattern, escapeRegExpCharacter); + } + function escapeRegExpCharacter(match) { + return "\\" + match; + } + function getRegularExpressionForWildcard(specs10, basePath, usage) { + const patterns = getRegularExpressionsForWildcards(specs10, basePath, usage); + if (!patterns || !patterns.length) { + return void 0; + } + const pattern5 = patterns.map((pattern22) => `(${pattern22})`).join("|"); + const terminator = usage === "exclude" ? "($|/)" : "$"; + return `^(${pattern5})${terminator}`; + } + function getRegularExpressionsForWildcards(specs10, basePath, usage) { + if (specs10 === void 0 || specs10.length === 0) { + return void 0; + } + return flatMap2(specs10, (spec) => spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage])); + } + function isImplicitGlob(lastPathComponent) { + return !/[.*?]/.test(lastPathComponent); + } + function getPatternFromSpec(spec, basePath, usage) { + const pattern5 = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]); + return pattern5 && `^(${pattern5})${usage === "exclude" ? "($|/)" : "$"}`; + } + function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) { + let subpattern = ""; + let hasWrittenComponent = false; + const components = getNormalizedPathComponents(spec, basePath); + const lastComponent = last2(components); + if (usage !== "exclude" && lastComponent === "**") { + return void 0; + } + components[0] = removeTrailingDirectorySeparator(components[0]); + if (isImplicitGlob(lastComponent)) { + components.push("**", "*"); + } + let optionalCount = 0; + for (let component of components) { + if (component === "**") { + subpattern += doubleAsteriskRegexFragment; + } else { + if (usage === "directories") { + subpattern += "("; + optionalCount++; + } + if (hasWrittenComponent) { + subpattern += directorySeparator; + } + if (usage !== "exclude") { + let componentPattern = ""; + if (component.charCodeAt(0) === 42) { + componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; + component = component.substr(1); + } else if (component.charCodeAt(0) === 63) { + componentPattern += "[^./]"; + component = component.substr(1); + } + componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); + if (componentPattern !== component) { + subpattern += implicitExcludePathRegexPattern; + } + subpattern += componentPattern; + } else { + subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); + } + } + hasWrittenComponent = true; + } + while (optionalCount > 0) { + subpattern += ")?"; + optionalCount--; + } + return subpattern; + } + function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { + return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; + } + function getFileMatcherPatterns(path2, excludes, includes2, useCaseSensitiveFileNames2, currentDirectory) { + path2 = normalizePath(path2); + currentDirectory = normalizePath(currentDirectory); + const absolutePath = combinePaths(currentDirectory, path2); + return { + includeFilePatterns: map4(getRegularExpressionsForWildcards(includes2, absolutePath, "files"), (pattern5) => `^${pattern5}$`), + includeFilePattern: getRegularExpressionForWildcard(includes2, absolutePath, "files"), + includeDirectoryPattern: getRegularExpressionForWildcard(includes2, absolutePath, "directories"), + excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), + basePaths: getBasePaths(path2, includes2, useCaseSensitiveFileNames2) + }; + } + function getRegexFromPattern(pattern5, useCaseSensitiveFileNames2) { + return new RegExp(pattern5, useCaseSensitiveFileNames2 ? "" : "i"); + } + function matchFiles(path2, extensions6, excludes, includes2, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath2) { + path2 = normalizePath(path2); + currentDirectory = normalizePath(currentDirectory); + const patterns = getFileMatcherPatterns(path2, excludes, includes2, useCaseSensitiveFileNames2, currentDirectory); + const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern5) => getRegexFromPattern(pattern5, useCaseSensitiveFileNames2)); + const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2); + const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2); + const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]]; + const visited = /* @__PURE__ */ new Map(); + const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2); + for (const basePath of patterns.basePaths) { + visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); + } + return flatten2(results); + function visitDirectory(path22, absolutePath, depth2) { + const canonicalPath = toCanonical(realpath2(absolutePath)); + if (visited.has(canonicalPath)) + return; + visited.set(canonicalPath, true); + const { files, directories } = getFileSystemEntries(path22); + for (const current of sort(files, compareStringsCaseSensitive)) { + const name2 = combinePaths(path22, current); + const absoluteName = combinePaths(absolutePath, current); + if (extensions6 && !fileExtensionIsOneOf(name2, extensions6)) + continue; + if (excludeRegex && excludeRegex.test(absoluteName)) + continue; + if (!includeFileRegexes) { + results[0].push(name2); + } else { + const includeIndex = findIndex2(includeFileRegexes, (re4) => re4.test(absoluteName)); + if (includeIndex !== -1) { + results[includeIndex].push(name2); + } + } + } + if (depth2 !== void 0) { + depth2--; + if (depth2 === 0) { + return; + } + } + for (const current of sort(directories, compareStringsCaseSensitive)) { + const name2 = combinePaths(path22, current); + const absoluteName = combinePaths(absolutePath, current); + if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { + visitDirectory(name2, absoluteName, depth2); + } + } + } + } + function getBasePaths(path2, includes2, useCaseSensitiveFileNames2) { + const basePaths = [path2]; + if (includes2) { + const includeBasePaths = []; + for (const include of includes2) { + const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path2, include)); + includeBasePaths.push(getIncludeBasePath(absolute)); + } + includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2)); + for (const includeBasePath of includeBasePaths) { + if (every2(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path2, !useCaseSensitiveFileNames2))) { + basePaths.push(includeBasePath); + } + } + } + return basePaths; + } + function getIncludeBasePath(absolute) { + const wildcardOffset = indexOfAnyCharCode(absolute, wildcardCharCodes); + if (wildcardOffset < 0) { + return !hasExtension(absolute) ? absolute : removeTrailingDirectorySeparator(getDirectoryPath(absolute)); + } + return absolute.substring(0, absolute.lastIndexOf(directorySeparator, wildcardOffset)); + } + function ensureScriptKind(fileName, scriptKind) { + return scriptKind || getScriptKindFromFileName(fileName) || 3; + } + function getScriptKindFromFileName(fileName) { + const ext = fileName.substr(fileName.lastIndexOf(".")); + switch (ext.toLowerCase()) { + case ".js": + case ".cjs": + case ".mjs": + return 1; + case ".jsx": + return 2; + case ".ts": + case ".cts": + case ".mts": + return 3; + case ".tsx": + return 4; + case ".json": + return 6; + default: + return 0; + } + } + function getSupportedExtensions(options, extraFileExtensions) { + const needJsExtensions = options && getAllowJSCompilerOption(options); + if (!extraFileExtensions || extraFileExtensions.length === 0) { + return needJsExtensions ? allSupportedExtensions : supportedTSExtensions; + } + const builtins = needJsExtensions ? allSupportedExtensions : supportedTSExtensions; + const flatBuiltins = flatten2(builtins); + const extensions6 = [ + ...builtins, + ...mapDefined(extraFileExtensions, (x7) => x7.scriptKind === 7 || needJsExtensions && isJSLike(x7.scriptKind) && !flatBuiltins.includes(x7.extension) ? [x7.extension] : void 0) + ]; + return extensions6; + } + function getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions) { + if (!options || !getResolveJsonModule(options)) + return supportedExtensions; + if (supportedExtensions === allSupportedExtensions) + return allSupportedExtensionsWithJson; + if (supportedExtensions === supportedTSExtensions) + return supportedTSExtensionsWithJson; + return [...supportedExtensions, [ + ".json" + /* Json */ + ]]; + } + function isJSLike(scriptKind) { + return scriptKind === 1 || scriptKind === 2; + } + function hasJSFileExtension(fileName) { + return some2(supportedJSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); + } + function hasTSFileExtension(fileName) { + return some2(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); + } + function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) { + return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false; + } + function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) { + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + const moduleResolutionIsNodeNext = 3 <= moduleResolution && moduleResolution <= 99; + if (preference === "js" || resolutionMode === 99 && moduleResolutionIsNodeNext) { + if (!shouldAllowImportingTsExtension(compilerOptions)) { + return 2; + } + return inferPreference() !== 2 ? 3 : 2; + } + if (preference === "minimal") { + return 0; + } + if (preference === "index") { + return 1; + } + if (!shouldAllowImportingTsExtension(compilerOptions)) { + return usesExtensionsOnImports(sourceFile) ? 2 : 0; + } + return inferPreference(); + function inferPreference() { + let usesJsExtensions = false; + const specifiers = sourceFile.imports.length ? sourceFile.imports : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r8) => r8.arguments[0]) : emptyArray; + for (const specifier of specifiers) { + if (pathIsRelative(specifier.text)) { + if (moduleResolutionIsNodeNext && resolutionMode === 1 && getModeForUsageLocation(sourceFile, specifier, compilerOptions) === 99) { + continue; + } + if (fileExtensionIsOneOf(specifier.text, extensionsNotSupportingExtensionlessResolution)) { + continue; + } + if (hasTSFileExtension(specifier.text)) { + return 3; + } + if (hasJSFileExtension(specifier.text)) { + usesJsExtensions = true; + } + } + } + return usesJsExtensions ? 2 : 0; + } + } + function getRequiresAtTopOfFile(sourceFile) { + let nonRequireStatementCount = 0; + let requires; + for (const statement of sourceFile.statements) { + if (nonRequireStatementCount > 3) { + break; + } + if (isRequireVariableStatement(statement)) { + requires = concatenate(requires, statement.declarationList.declarations.map((d7) => d7.initializer)); + } else if (isExpressionStatement(statement) && isRequireCall( + statement.expression, + /*requireStringLiteralLikeArgument*/ + true + )) { + requires = append(requires, statement.expression); + } else { + nonRequireStatementCount++; + } + } + return requires || emptyArray; + } + function isSupportedSourceFileName(fileName, compilerOptions, extraFileExtensions) { + if (!fileName) + return false; + const supportedExtensions = getSupportedExtensions(compilerOptions, extraFileExtensions); + for (const extension of flatten2(getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, supportedExtensions))) { + if (fileExtensionIs(fileName, extension)) { + return true; + } + } + return false; + } + function numberOfDirectorySeparators(str2) { + const match = str2.match(/\//g); + return match ? match.length : 0; + } + function compareNumberOfDirectorySeparators(path1, path2) { + return compareValues( + numberOfDirectorySeparators(path1), + numberOfDirectorySeparators(path2) + ); + } + function removeFileExtension(path2) { + for (const ext of extensionsToRemove) { + const extensionless = tryRemoveExtension(path2, ext); + if (extensionless !== void 0) { + return extensionless; + } + } + return path2; + } + function tryRemoveExtension(path2, extension) { + return fileExtensionIs(path2, extension) ? removeExtension(path2, extension) : void 0; + } + function removeExtension(path2, extension) { + return path2.substring(0, path2.length - extension.length); + } + function changeExtension(path2, newExtension) { + return changeAnyExtension( + path2, + newExtension, + extensionsToRemove, + /*ignoreCase*/ + false + ); + } + function tryParsePattern(pattern5) { + const indexOfStar = pattern5.indexOf("*"); + if (indexOfStar === -1) { + return pattern5; + } + return pattern5.indexOf("*", indexOfStar + 1) !== -1 ? void 0 : { + prefix: pattern5.substr(0, indexOfStar), + suffix: pattern5.substr(indexOfStar + 1) + }; + } + function tryParsePatterns(paths) { + return mapDefined(getOwnKeys(paths), (path2) => tryParsePattern(path2)); + } + function positionIsSynthesized(pos) { + return !(pos >= 0); + } + function extensionIsTS(ext) { + return ext === ".ts" || ext === ".tsx" || ext === ".d.ts" || ext === ".cts" || ext === ".mts" || ext === ".d.mts" || ext === ".d.cts" || startsWith2(ext, ".d.") && endsWith2(ext, ".ts"); + } + function resolutionExtensionIsTSOrJson(ext) { + return extensionIsTS(ext) || ext === ".json"; + } + function extensionFromPath(path2) { + const ext = tryGetExtensionFromPath2(path2); + return ext !== void 0 ? ext : Debug.fail(`File ${path2} has unknown extension.`); + } + function isAnySupportedFileExtension(path2) { + return tryGetExtensionFromPath2(path2) !== void 0; + } + function tryGetExtensionFromPath2(path2) { + return find2(extensionsToRemove, (e10) => fileExtensionIs(path2, e10)); + } + function isCheckJsEnabledForFile(sourceFile, compilerOptions) { + return sourceFile.checkJsDirective ? sourceFile.checkJsDirective.enabled : compilerOptions.checkJs; + } + function matchPatternOrExact(patternOrStrings, candidate) { + const patterns = []; + for (const patternOrString of patternOrStrings) { + if (patternOrString === candidate) { + return candidate; + } + if (!isString4(patternOrString)) { + patterns.push(patternOrString); + } + } + return findBestPatternMatch(patterns, (_6) => _6, candidate); + } + function sliceAfter(arr, value2) { + const index4 = arr.indexOf(value2); + Debug.assert(index4 !== -1); + return arr.slice(index4); + } + function addRelatedInfo(diagnostic, ...relatedInformation) { + if (!relatedInformation.length) { + return diagnostic; + } + if (!diagnostic.relatedInformation) { + diagnostic.relatedInformation = []; + } + Debug.assert(diagnostic.relatedInformation !== emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); + diagnostic.relatedInformation.push(...relatedInformation); + return diagnostic; + } + function minAndMax(arr, getValue2) { + Debug.assert(arr.length !== 0); + let min22 = getValue2(arr[0]); + let max2 = min22; + for (let i7 = 1; i7 < arr.length; i7++) { + const value2 = getValue2(arr[i7]); + if (value2 < min22) { + min22 = value2; + } else if (value2 > max2) { + max2 = value2; + } + } + return { min: min22, max: max2 }; + } + function rangeOfNode(node) { + return { pos: getTokenPosOfNode(node), end: node.end }; + } + function rangeOfTypeParameters(sourceFile, typeParameters) { + const pos = typeParameters.pos - 1; + const end = Math.min(sourceFile.text.length, skipTrivia(sourceFile.text, typeParameters.end) + 1); + return { pos, end }; + } + function skipTypeChecking(sourceFile, options, host) { + return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName); + } + function isJsonEqual(a7, b8) { + return a7 === b8 || typeof a7 === "object" && a7 !== null && typeof b8 === "object" && b8 !== null && equalOwnProperties(a7, b8, isJsonEqual); + } + function parsePseudoBigInt(stringValue) { + let log2Base; + switch (stringValue.charCodeAt(1)) { + case 98: + case 66: + log2Base = 1; + break; + case 111: + case 79: + log2Base = 3; + break; + case 120: + case 88: + log2Base = 4; + break; + default: + const nIndex = stringValue.length - 1; + let nonZeroStart = 0; + while (stringValue.charCodeAt(nonZeroStart) === 48) { + nonZeroStart++; + } + return stringValue.slice(nonZeroStart, nIndex) || "0"; + } + const startIndex = 2, endIndex = stringValue.length - 1; + const bitsNeeded = (endIndex - startIndex) * log2Base; + const segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0)); + for (let i7 = endIndex - 1, bitOffset = 0; i7 >= startIndex; i7--, bitOffset += log2Base) { + const segment = bitOffset >>> 4; + const digitChar = stringValue.charCodeAt(i7); + const digit = digitChar <= 57 ? digitChar - 48 : 10 + digitChar - (digitChar <= 70 ? 65 : 97); + const shiftedDigit = digit << (bitOffset & 15); + segments[segment] |= shiftedDigit; + const residual = shiftedDigit >>> 16; + if (residual) + segments[segment + 1] |= residual; + } + let base10Value = ""; + let firstNonzeroSegment = segments.length - 1; + let segmentsRemaining = true; + while (segmentsRemaining) { + let mod10 = 0; + segmentsRemaining = false; + for (let segment = firstNonzeroSegment; segment >= 0; segment--) { + const newSegment = mod10 << 16 | segments[segment]; + const segmentValue = newSegment / 10 | 0; + segments[segment] = segmentValue; + mod10 = newSegment - segmentValue * 10; + if (segmentValue && !segmentsRemaining) { + firstNonzeroSegment = segment; + segmentsRemaining = true; + } + } + base10Value = mod10 + base10Value; + } + return base10Value; + } + function pseudoBigIntToString({ negative, base10Value }) { + return (negative && base10Value !== "0" ? "-" : "") + base10Value; + } + function parseBigInt(text) { + if (!isValidBigIntString( + text, + /*roundTripOnly*/ + false + )) { + return void 0; + } + return parseValidBigInt(text); + } + function parseValidBigInt(text) { + const negative = text.startsWith("-"); + const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`); + return { negative, base10Value }; + } + function isValidBigIntString(s7, roundTripOnly) { + if (s7 === "") + return false; + const scanner2 = createScanner3( + 99, + /*skipTrivia*/ + false + ); + let success = true; + scanner2.setOnError(() => success = false); + scanner2.setText(s7 + "n"); + let result2 = scanner2.scan(); + const negative = result2 === 41; + if (negative) { + result2 = scanner2.scan(); + } + const flags = scanner2.getTokenFlags(); + return success && result2 === 10 && scanner2.getTokenEnd() === s7.length + 1 && !(flags & 512) && (!roundTripOnly || s7 === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) })); + } + function isValidTypeOnlyAliasUseSite(useSite) { + return !!(useSite.flags & 33554432) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite)); + } + function isShorthandPropertyNameUseSite(useSite) { + return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite; + } + function isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(node) { + while (node.kind === 80 || node.kind === 211) { + node = node.parent; + } + if (node.kind !== 167) { + return false; + } + if (hasSyntacticModifier( + node.parent, + 64 + /* Abstract */ + )) { + return true; + } + const containerKind = node.parent.parent.kind; + return containerKind === 264 || containerKind === 187; + } + function isIdentifierInNonEmittingHeritageClause(node) { + if (node.kind !== 80) + return false; + const heritageClause = findAncestor(node.parent, (parent22) => { + switch (parent22.kind) { + case 298: + return true; + case 211: + case 233: + return false; + default: + return "quit"; + } + }); + return (heritageClause == null ? void 0 : heritageClause.token) === 119 || (heritageClause == null ? void 0 : heritageClause.parent.kind) === 264; + } + function isIdentifierTypeReference(node) { + return isTypeReferenceNode(node) && isIdentifier(node.typeName); + } + function arrayIsHomogeneous(array, comparer = equateValues) { + if (array.length < 2) + return true; + const first2 = array[0]; + for (let i7 = 1, length2 = array.length; i7 < length2; i7++) { + const target = array[i7]; + if (!comparer(first2, target)) + return false; + } + return true; + } + function setTextRangePos(range2, pos) { + range2.pos = pos; + return range2; + } + function setTextRangeEnd(range2, end) { + range2.end = end; + return range2; + } + function setTextRangePosEnd(range2, pos, end) { + return setTextRangeEnd(setTextRangePos(range2, pos), end); + } + function setTextRangePosWidth(range2, pos, width) { + return setTextRangePosEnd(range2, pos, pos + width); + } + function setNodeFlags(node, newFlags) { + if (node) { + node.flags = newFlags; + } + return node; + } + function setParent(child, parent22) { + if (child && parent22) { + child.parent = parent22; + } + return child; + } + function setEachParent(children, parent22) { + if (children) { + for (const child of children) { + setParent(child, parent22); + } + } + return children; + } + function setParentRecursive(rootNode, incremental) { + if (!rootNode) + return rootNode; + forEachChildRecursively(rootNode, isJSDocNode(rootNode) ? bindParentToChildIgnoringJSDoc : bindParentToChild); + return rootNode; + function bindParentToChildIgnoringJSDoc(child, parent22) { + if (incremental && child.parent === parent22) { + return "skip"; + } + setParent(child, parent22); + } + function bindJSDoc(child) { + if (hasJSDocNodes(child)) { + for (const doc of child.jsDoc) { + bindParentToChildIgnoringJSDoc(doc, child); + forEachChildRecursively(doc, bindParentToChildIgnoringJSDoc); + } + } + } + function bindParentToChild(child, parent22) { + return bindParentToChildIgnoringJSDoc(child, parent22) || bindJSDoc(child); + } + } + function isPackedElement(node) { + return !isOmittedExpression(node); + } + function isPackedArrayLiteral(node) { + return isArrayLiteralExpression(node) && every2(node.elements, isPackedElement); + } + function expressionResultIsUnused(node) { + Debug.assertIsDefined(node.parent); + while (true) { + const parent22 = node.parent; + if (isParenthesizedExpression(parent22)) { + node = parent22; + continue; + } + if (isExpressionStatement(parent22) || isVoidExpression(parent22) || isForStatement(parent22) && (parent22.initializer === node || parent22.incrementor === node)) { + return true; + } + if (isCommaListExpression(parent22)) { + if (node !== last2(parent22.elements)) + return true; + node = parent22; + continue; + } + if (isBinaryExpression(parent22) && parent22.operatorToken.kind === 28) { + if (node === parent22.left) + return true; + node = parent22; + continue; + } + return false; + } + } + function containsIgnoredPath(path2) { + return some2(ignoredPaths, (p7) => path2.includes(p7)); + } + function getContainingNodeArray(node) { + if (!node.parent) + return void 0; + switch (node.kind) { + case 168: + const { parent: parent3 } = node; + return parent3.kind === 195 ? void 0 : parent3.typeParameters; + case 169: + return node.parent.parameters; + case 204: + return node.parent.templateSpans; + case 239: + return node.parent.templateSpans; + case 170: { + const { parent: parent4 } = node; + return canHaveDecorators(parent4) ? parent4.modifiers : void 0; + } + case 298: + return node.parent.heritageClauses; + } + const { parent: parent22 } = node; + if (isJSDocTag(node)) { + return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; + } + switch (parent22.kind) { + case 187: + case 264: + return isTypeElement(node) ? parent22.members : void 0; + case 192: + case 193: + return parent22.types; + case 189: + case 209: + case 361: + case 275: + case 279: + return parent22.elements; + case 210: + case 292: + return parent22.properties; + case 213: + case 214: + return isTypeNode(node) ? parent22.typeArguments : parent22.expression === node ? void 0 : parent22.arguments; + case 284: + case 288: + return isJsxChild(node) ? parent22.children : void 0; + case 286: + case 285: + return isTypeNode(node) ? parent22.typeArguments : void 0; + case 241: + case 296: + case 297: + case 268: + return parent22.statements; + case 269: + return parent22.clauses; + case 263: + case 231: + return isClassElement(node) ? parent22.members : void 0; + case 266: + return isEnumMember(node) ? parent22.members : void 0; + case 312: + return parent22.statements; + } + } + function hasContextSensitiveParameters(node) { + if (!node.typeParameters) { + if (some2(node.parameters, (p7) => !getEffectiveTypeAnnotationNode(p7))) { + return true; + } + if (node.kind !== 219) { + const parameter = firstOrUndefined(node.parameters); + if (!(parameter && parameterIsThisKeyword(parameter))) { + return true; + } + } + } + return false; + } + function isInfinityOrNaNString(name2) { + return name2 === "Infinity" || name2 === "-Infinity" || name2 === "NaN"; + } + function isCatchClauseVariableDeclaration(node) { + return node.kind === 260 && node.parent.kind === 299; + } + function isFunctionExpressionOrArrowFunction(node) { + return node.kind === 218 || node.kind === 219; + } + function escapeSnippetText(text) { + return text.replace(/\$/gm, () => "\\$"); + } + function isNumericLiteralName(name2) { + return (+name2).toString() === name2; + } + function createPropertyNameNodeForIdentifierOrLiteral(name2, target, singleQuote2, stringNamed, isMethod) { + const isMethodNamedNew = isMethod && name2 === "new"; + return !isMethodNamedNew && isIdentifierText(name2, target) ? factory.createIdentifier(name2) : !stringNamed && !isMethodNamedNew && isNumericLiteralName(name2) && +name2 >= 0 ? factory.createNumericLiteral(+name2) : factory.createStringLiteral(name2, !!singleQuote2); + } + function isThisTypeParameter(type3) { + return !!(type3.flags & 262144 && type3.isThisType); + } + function getNodeModulePathParts(fullPath) { + let topLevelNodeModulesIndex = 0; + let topLevelPackageNameIndex = 0; + let packageRootIndex = 0; + let fileNameIndex = 0; + let States; + ((States2) => { + States2[States2["BeforeNodeModules"] = 0] = "BeforeNodeModules"; + States2[States2["NodeModules"] = 1] = "NodeModules"; + States2[States2["Scope"] = 2] = "Scope"; + States2[States2["PackageContent"] = 3] = "PackageContent"; + })(States || (States = {})); + let partStart = 0; + let partEnd = 0; + let state = 0; + while (partEnd >= 0) { + partStart = partEnd; + partEnd = fullPath.indexOf("/", partStart + 1); + switch (state) { + case 0: + if (fullPath.indexOf(nodeModulesPathPart, partStart) === partStart) { + topLevelNodeModulesIndex = partStart; + topLevelPackageNameIndex = partEnd; + state = 1; + } + break; + case 1: + case 2: + if (state === 1 && fullPath.charAt(partStart + 1) === "@") { + state = 2; + } else { + packageRootIndex = partEnd; + state = 3; + } + break; + case 3: + if (fullPath.indexOf(nodeModulesPathPart, partStart) === partStart) { + state = 1; + } else { + state = 3; + } + break; + } + } + fileNameIndex = partStart; + return state > 1 ? { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex, fileNameIndex } : void 0; + } + function getParameterTypeNode(parameter) { + var _a2; + return parameter.kind === 348 ? (_a2 = parameter.typeExpression) == null ? void 0 : _a2.type : parameter.type; + } + function isTypeDeclaration(node) { + switch (node.kind) { + case 168: + case 263: + case 264: + case 265: + case 266: + case 353: + case 345: + case 347: + return true; + case 273: + return node.isTypeOnly; + case 276: + case 281: + return node.parent.parent.isTypeOnly; + default: + return false; + } + } + function canHaveExportModifier(node) { + return isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isTypeDeclaration(node) || isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node); + } + function isOptionalJSDocPropertyLikeTag(node) { + if (!isJSDocPropertyLikeTag(node)) { + return false; + } + const { isBracketed, typeExpression } = node; + return isBracketed || !!typeExpression && typeExpression.type.kind === 323; + } + function canUsePropertyAccess(name2, languageVersion) { + if (name2.length === 0) { + return false; + } + const firstChar = name2.charCodeAt(0); + return firstChar === 35 ? name2.length > 1 && isIdentifierStart(name2.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion); + } + function hasTabstop(node) { + var _a2; + return ((_a2 = getSnippetElement(node)) == null ? void 0 : _a2.kind) === 0; + } + function isJSDocOptionalParameter(node) { + return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType + (node.type && node.type.kind === 323 || getJSDocParameterTags(node).some( + ({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 323 + /* JSDocOptionalType */ + )); + } + function isOptionalDeclaration(declaration) { + switch (declaration.kind) { + case 172: + case 171: + return !!declaration.questionToken; + case 169: + return !!declaration.questionToken || isJSDocOptionalParameter(declaration); + case 355: + case 348: + return isOptionalJSDocPropertyLikeTag(declaration); + default: + return false; + } + } + function isNonNullAccess(node) { + const kind = node.kind; + return (kind === 211 || kind === 212) && isNonNullExpression(node.expression); + } + function isJSDocSatisfiesExpression(node) { + return isInJSFile(node) && isParenthesizedExpression(node) && hasJSDocNodes(node) && !!getJSDocSatisfiesTag(node); + } + function getJSDocSatisfiesExpressionType(node) { + return Debug.checkDefined(tryGetJSDocSatisfiesTypeNode(node)); + } + function tryGetJSDocSatisfiesTypeNode(node) { + const tag = getJSDocSatisfiesTag(node); + return tag && tag.typeExpression && tag.typeExpression.type; + } + function getEscapedTextOfJsxAttributeName(node) { + return isIdentifier(node) ? node.escapedText : getEscapedTextOfJsxNamespacedName(node); + } + function getTextOfJsxAttributeName(node) { + return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node); + } + function isJsxAttributeName(node) { + const kind = node.kind; + return kind === 80 || kind === 295; + } + function getEscapedTextOfJsxNamespacedName(node) { + return `${node.namespace.escapedText}:${idText(node.name)}`; + } + function getTextOfJsxNamespacedName(node) { + return `${idText(node.namespace)}:${idText(node.name)}`; + } + function intrinsicTagNameToString(node) { + return isIdentifier(node) ? idText(node) : getTextOfJsxNamespacedName(node); + } + function isTypeUsableAsPropertyName(type3) { + return !!(type3.flags & 8576); + } + function getPropertyNameFromType(type3) { + if (type3.flags & 8192) { + return type3.escapedName; + } + if (type3.flags & (128 | 256)) { + return escapeLeadingUnderscores("" + type3.value); + } + return Debug.fail(); + } + function isExpandoPropertyDeclaration(declaration) { + return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration)); + } + function hasResolutionModeOverride(node) { + if (node === void 0) { + return false; + } + return !!getResolutionModeOverride(node.attributes); + } + function replaceFirstStar(s7, replacement) { + return stringReplace.call(s7, "*", replacement); + } + function getNameFromImportAttribute(node) { + return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text); + } + var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, computedOptions, getEmitScriptTarget, getEmitModuleKind, getEmitModuleResolutionKind, getEmitModuleDetectionKind, getIsolatedModules, getESModuleInterop, getAllowSyntheticDefaultImports, getResolvePackageJsonExports, getResolvePackageJsonImports, getResolveJsonModule, getEmitDeclarations, shouldPreserveConstEnums, isIncrementalCompilation, getAreDeclarationMapsEnabled, getAllowJSCompilerOption, getUseDefineForClassFields, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries, stringReplace; + var init_utilities = __esm2({ + "src/compiler/utilities.ts"() { + "use strict"; + init_ts2(); + resolvingEmptyArray = []; + externalHelpersModuleNameText = "tslib"; + defaultMaximumTruncationLength = 160; + noTruncationMaximumTruncationLength = 1e6; + stringWriter = createSingleLineStringWriter(); + getScriptTargetFeatures = /* @__PURE__ */ memoize2( + () => new Map(Object.entries({ + Array: new Map(Object.entries({ + es2015: [ + "find", + "findIndex", + "fill", + "copyWithin", + "entries", + "keys", + "values" + ], + es2016: [ + "includes" + ], + es2019: [ + "flat", + "flatMap" + ], + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Iterator: new Map(Object.entries({ + es2015: emptyArray + })), + AsyncIterator: new Map(Object.entries({ + es2015: emptyArray + })), + Atomics: new Map(Object.entries({ + es2017: emptyArray + })), + SharedArrayBuffer: new Map(Object.entries({ + es2017: emptyArray + })), + AsyncIterable: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncIterableIterator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGenerator: new Map(Object.entries({ + es2018: emptyArray + })), + AsyncGeneratorFunction: new Map(Object.entries({ + es2018: emptyArray + })), + RegExp: new Map(Object.entries({ + es2015: [ + "flags", + "sticky", + "unicode" + ], + es2018: [ + "dotAll" + ] + })), + Reflect: new Map(Object.entries({ + es2015: [ + "apply", + "construct", + "defineProperty", + "deleteProperty", + "get", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "has", + "isExtensible", + "ownKeys", + "preventExtensions", + "set", + "setPrototypeOf" + ] + })), + ArrayConstructor: new Map(Object.entries({ + es2015: [ + "from", + "of" + ] + })), + ObjectConstructor: new Map(Object.entries({ + es2015: [ + "assign", + "getOwnPropertySymbols", + "keys", + "is", + "setPrototypeOf" + ], + es2017: [ + "values", + "entries", + "getOwnPropertyDescriptors" + ], + es2019: [ + "fromEntries" + ], + es2022: [ + "hasOwn" + ] + })), + NumberConstructor: new Map(Object.entries({ + es2015: [ + "isFinite", + "isInteger", + "isNaN", + "isSafeInteger", + "parseFloat", + "parseInt" + ] + })), + Math: new Map(Object.entries({ + es2015: [ + "clz32", + "imul", + "sign", + "log10", + "log2", + "log1p", + "expm1", + "cosh", + "sinh", + "tanh", + "acosh", + "asinh", + "atanh", + "hypot", + "trunc", + "fround", + "cbrt" + ] + })), + Map: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + Set: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + PromiseConstructor: new Map(Object.entries({ + es2015: [ + "all", + "race", + "reject", + "resolve" + ], + es2020: [ + "allSettled" + ], + es2021: [ + "any" + ] + })), + Symbol: new Map(Object.entries({ + es2015: [ + "for", + "keyFor" + ], + es2019: [ + "description" + ] + })), + WeakMap: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + WeakSet: new Map(Object.entries({ + es2015: [ + "entries", + "keys", + "values" + ] + })), + String: new Map(Object.entries({ + es2015: [ + "codePointAt", + "includes", + "endsWith", + "normalize", + "repeat", + "startsWith", + "anchor", + "big", + "blink", + "bold", + "fixed", + "fontcolor", + "fontsize", + "italics", + "link", + "small", + "strike", + "sub", + "sup" + ], + es2017: [ + "padStart", + "padEnd" + ], + es2019: [ + "trimStart", + "trimEnd", + "trimLeft", + "trimRight" + ], + es2020: [ + "matchAll" + ], + es2021: [ + "replaceAll" + ], + es2022: [ + "at" + ] + })), + StringConstructor: new Map(Object.entries({ + es2015: [ + "fromCodePoint", + "raw" + ] + })), + DateTimeFormat: new Map(Object.entries({ + es2017: [ + "formatToParts" + ] + })), + Promise: new Map(Object.entries({ + es2015: emptyArray, + es2018: [ + "finally" + ] + })), + RegExpMatchArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + RegExpExecArray: new Map(Object.entries({ + es2018: [ + "groups" + ] + })), + Intl: new Map(Object.entries({ + es2018: [ + "PluralRules" + ] + })), + NumberFormat: new Map(Object.entries({ + es2018: [ + "formatToParts" + ] + })), + SymbolConstructor: new Map(Object.entries({ + es2020: [ + "matchAll" + ] + })), + DataView: new Map(Object.entries({ + es2020: [ + "setBigInt64", + "setBigUint64", + "getBigInt64", + "getBigUint64" + ] + })), + BigInt: new Map(Object.entries({ + es2020: emptyArray + })), + RelativeTimeFormat: new Map(Object.entries({ + es2020: [ + "format", + "formatToParts", + "resolvedOptions" + ] + })), + Int8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint8ClampedArray: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint16Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Int32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Uint32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float32Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Float64Array: new Map(Object.entries({ + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigInt64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + BigUint64Array: new Map(Object.entries({ + es2020: emptyArray, + es2022: [ + "at" + ], + es2023: [ + "findLastIndex", + "findLast" + ] + })), + Error: new Map(Object.entries({ + es2022: [ + "cause" + ] + })) + })) + ); + GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => { + GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None"; + GetLiteralTextFlags2[GetLiteralTextFlags2["NeverAsciiEscape"] = 1] = "NeverAsciiEscape"; + GetLiteralTextFlags2[GetLiteralTextFlags2["JsxAttributeEscape"] = 2] = "JsxAttributeEscape"; + GetLiteralTextFlags2[GetLiteralTextFlags2["TerminateUnterminatedLiterals"] = 4] = "TerminateUnterminatedLiterals"; + GetLiteralTextFlags2[GetLiteralTextFlags2["AllowNumericSeparator"] = 8] = "AllowNumericSeparator"; + return GetLiteralTextFlags2; + })(GetLiteralTextFlags || {}); + fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; + fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*/; + fullTripleSlashLibReferenceRegEx = /^(\/\/\/\s*/; + fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; + fullTripleSlashAMDModuleRegEx = /^\/\/\/\s*/; + defaultLibReferenceRegEx = /^(\/\/\/\s*/; + AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => { + AssignmentKind2[AssignmentKind2["None"] = 0] = "None"; + AssignmentKind2[AssignmentKind2["Definite"] = 1] = "Definite"; + AssignmentKind2[AssignmentKind2["Compound"] = 2] = "Compound"; + return AssignmentKind2; + })(AssignmentKind || {}); + FunctionFlags = /* @__PURE__ */ ((FunctionFlags2) => { + FunctionFlags2[FunctionFlags2["Normal"] = 0] = "Normal"; + FunctionFlags2[FunctionFlags2["Generator"] = 1] = "Generator"; + FunctionFlags2[FunctionFlags2["Async"] = 2] = "Async"; + FunctionFlags2[FunctionFlags2["Invalid"] = 4] = "Invalid"; + FunctionFlags2[FunctionFlags2["AsyncGenerator"] = 3] = "AsyncGenerator"; + return FunctionFlags2; + })(FunctionFlags || {}); + Associativity = /* @__PURE__ */ ((Associativity2) => { + Associativity2[Associativity2["Left"] = 0] = "Left"; + Associativity2[Associativity2["Right"] = 1] = "Right"; + return Associativity2; + })(Associativity || {}); + OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => { + OperatorPrecedence2[OperatorPrecedence2["Comma"] = 0] = "Comma"; + OperatorPrecedence2[OperatorPrecedence2["Spread"] = 1] = "Spread"; + OperatorPrecedence2[OperatorPrecedence2["Yield"] = 2] = "Yield"; + OperatorPrecedence2[OperatorPrecedence2["Assignment"] = 3] = "Assignment"; + OperatorPrecedence2[OperatorPrecedence2["Conditional"] = 4] = "Conditional"; + OperatorPrecedence2[ + OperatorPrecedence2["Coalesce"] = 4 + /* Conditional */ + ] = "Coalesce"; + OperatorPrecedence2[OperatorPrecedence2["LogicalOR"] = 5] = "LogicalOR"; + OperatorPrecedence2[OperatorPrecedence2["LogicalAND"] = 6] = "LogicalAND"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseOR"] = 7] = "BitwiseOR"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseXOR"] = 8] = "BitwiseXOR"; + OperatorPrecedence2[OperatorPrecedence2["BitwiseAND"] = 9] = "BitwiseAND"; + OperatorPrecedence2[OperatorPrecedence2["Equality"] = 10] = "Equality"; + OperatorPrecedence2[OperatorPrecedence2["Relational"] = 11] = "Relational"; + OperatorPrecedence2[OperatorPrecedence2["Shift"] = 12] = "Shift"; + OperatorPrecedence2[OperatorPrecedence2["Additive"] = 13] = "Additive"; + OperatorPrecedence2[OperatorPrecedence2["Multiplicative"] = 14] = "Multiplicative"; + OperatorPrecedence2[OperatorPrecedence2["Exponentiation"] = 15] = "Exponentiation"; + OperatorPrecedence2[OperatorPrecedence2["Unary"] = 16] = "Unary"; + OperatorPrecedence2[OperatorPrecedence2["Update"] = 17] = "Update"; + OperatorPrecedence2[OperatorPrecedence2["LeftHandSide"] = 18] = "LeftHandSide"; + OperatorPrecedence2[OperatorPrecedence2["Member"] = 19] = "Member"; + OperatorPrecedence2[OperatorPrecedence2["Primary"] = 20] = "Primary"; + OperatorPrecedence2[ + OperatorPrecedence2["Highest"] = 20 + /* Primary */ + ] = "Highest"; + OperatorPrecedence2[ + OperatorPrecedence2["Lowest"] = 0 + /* Comma */ + ] = "Lowest"; + OperatorPrecedence2[OperatorPrecedence2["Invalid"] = -1] = "Invalid"; + return OperatorPrecedence2; + })(OperatorPrecedence || {}); + templateSubstitutionRegExp = /\$\{/g; + doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; + backtickQuoteEscapedCharsRegExp = /\r\n|[\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; + escapedCharsMap = new Map(Object.entries({ + " ": "\\t", + "\v": "\\v", + "\f": "\\f", + "\b": "\\b", + "\r": "\\r", + "\n": "\\n", + "\\": "\\\\", + '"': '\\"', + "'": "\\'", + "`": "\\`", + "\u2028": "\\u2028", + // lineSeparator + "\u2029": "\\u2029", + // paragraphSeparator + "\x85": "\\u0085", + // nextLine + "\r\n": "\\r\\n" + // special case for CRLFs in backticks + })); + nonAsciiCharacters = /[^\u0000-\u007F]/g; + jsxDoubleQuoteEscapedCharsRegExp = /["\u0000-\u001f\u2028\u2029\u0085]/g; + jsxSingleQuoteEscapedCharsRegExp = /['\u0000-\u001f\u2028\u2029\u0085]/g; + jsxEscapedCharsMap = new Map(Object.entries({ + '"': """, + "'": "'" + })); + indentStrings = ["", " "]; + base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + carriageReturnLineFeed = "\r\n"; + lineFeed = "\n"; + objectAllocator = { + getNodeConstructor: () => Node4, + getTokenConstructor: () => Token, + getIdentifierConstructor: () => Identifier2, + getPrivateIdentifierConstructor: () => Node4, + getSourceFileConstructor: () => Node4, + getSymbolConstructor: () => Symbol4, + getTypeConstructor: () => Type3, + getSignatureConstructor: () => Signature2, + getSourceMapSourceConstructor: () => SourceMapSource + }; + objectAllocatorPatchers = []; + computedOptions = createComputedCompilerOptions({ + target: { + dependencies: ["module"], + computeValue: (compilerOptions) => { + return compilerOptions.target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 199 && 99 || 1); + } + }, + module: { + dependencies: ["target"], + computeValue: (compilerOptions) => { + return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 ? 5 : 1; + } + }, + moduleResolution: { + dependencies: ["module", "target"], + computeValue: (compilerOptions) => { + let moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === void 0) { + switch (computedOptions.module.computeValue(compilerOptions)) { + case 1: + moduleResolution = 2; + break; + case 100: + moduleResolution = 3; + break; + case 199: + moduleResolution = 99; + break; + case 200: + moduleResolution = 100; + break; + default: + moduleResolution = 1; + break; + } + } + return moduleResolution; + } + }, + moduleDetection: { + dependencies: ["module", "target"], + computeValue: (compilerOptions) => { + return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 || computedOptions.module.computeValue(compilerOptions) === 199 ? 3 : 2); + } + }, + isolatedModules: { + dependencies: ["verbatimModuleSyntax"], + computeValue: (compilerOptions) => { + return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax); + } + }, + esModuleInterop: { + dependencies: ["module", "target"], + computeValue: (compilerOptions) => { + if (compilerOptions.esModuleInterop !== void 0) { + return compilerOptions.esModuleInterop; + } + switch (computedOptions.module.computeValue(compilerOptions)) { + case 100: + case 199: + case 200: + return true; + } + return false; + } + }, + allowSyntheticDefaultImports: { + dependencies: ["module", "target", "moduleResolution"], + computeValue: (compilerOptions) => { + if (compilerOptions.allowSyntheticDefaultImports !== void 0) { + return compilerOptions.allowSyntheticDefaultImports; + } + return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 || computedOptions.moduleResolution.computeValue(compilerOptions) === 100; + } + }, + resolvePackageJsonExports: { + dependencies: ["moduleResolution"], + computeValue: (compilerOptions) => { + const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions); + if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + return false; + } + if (compilerOptions.resolvePackageJsonExports !== void 0) { + return compilerOptions.resolvePackageJsonExports; + } + switch (moduleResolution) { + case 3: + case 99: + case 100: + return true; + } + return false; + } + }, + resolvePackageJsonImports: { + dependencies: ["moduleResolution", "resolvePackageJsonExports"], + computeValue: (compilerOptions) => { + const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions); + if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + return false; + } + if (compilerOptions.resolvePackageJsonExports !== void 0) { + return compilerOptions.resolvePackageJsonExports; + } + switch (moduleResolution) { + case 3: + case 99: + case 100: + return true; + } + return false; + } + }, + resolveJsonModule: { + dependencies: ["moduleResolution", "module", "target"], + computeValue: (compilerOptions) => { + if (compilerOptions.resolveJsonModule !== void 0) { + return compilerOptions.resolveJsonModule; + } + return computedOptions.moduleResolution.computeValue(compilerOptions) === 100; + } + }, + declaration: { + dependencies: ["composite"], + computeValue: (compilerOptions) => { + return !!(compilerOptions.declaration || compilerOptions.composite); + } + }, + preserveConstEnums: { + dependencies: ["isolatedModules", "verbatimModuleSyntax"], + computeValue: (compilerOptions) => { + return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions)); + } + }, + incremental: { + dependencies: ["composite"], + computeValue: (compilerOptions) => { + return !!(compilerOptions.incremental || compilerOptions.composite); + } + }, + declarationMap: { + dependencies: ["declaration", "composite"], + computeValue: (compilerOptions) => { + return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions)); + } + }, + allowJs: { + dependencies: ["checkJs"], + computeValue: (compilerOptions) => { + return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs; + } + }, + useDefineForClassFields: { + dependencies: ["target", "module"], + computeValue: (compilerOptions) => { + return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 : compilerOptions.useDefineForClassFields; + } + }, + noImplicitAny: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "noImplicitAny"); + } + }, + noImplicitThis: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "noImplicitThis"); + } + }, + strictNullChecks: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "strictNullChecks"); + } + }, + strictFunctionTypes: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + } + }, + strictBindCallApply: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "strictBindCallApply"); + } + }, + strictPropertyInitialization: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + } + }, + alwaysStrict: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "alwaysStrict"); + } + }, + useUnknownInCatchVariables: { + dependencies: ["strict"], + computeValue: (compilerOptions) => { + return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + } + } + }); + getEmitScriptTarget = computedOptions.target.computeValue; + getEmitModuleKind = computedOptions.module.computeValue; + getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue; + getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue; + getIsolatedModules = computedOptions.isolatedModules.computeValue; + getESModuleInterop = computedOptions.esModuleInterop.computeValue; + getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue; + getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue; + getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue; + getResolveJsonModule = computedOptions.resolveJsonModule.computeValue; + getEmitDeclarations = computedOptions.declaration.computeValue; + shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue; + isIncrementalCompilation = computedOptions.incremental.computeValue; + getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue; + getAllowJSCompilerOption = computedOptions.allowJs.computeValue; + getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue; + reservedCharacterPattern = /[^\w\s/]/g; + wildcardCharCodes = [ + 42, + 63 + /* question */ + ]; + commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"]; + implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; + filesMatcher = { + /** + * Matches any single directory segment unless it is the last segment and a .min.js file + * Breakdown: + * [^./] # matches everything up to the first . character (excluding directory separators) + * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension + */ + singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) + }; + directoriesMatcher = { + singleAsteriskRegexFragment: "[^/]*", + /** + * Regex for the ** wildcard. Matches any number of subdirectories. When used for including + * files or directories, does not match subdirectories that start with a . character + */ + doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) + }; + excludeMatcher = { + singleAsteriskRegexFragment: "[^/]*", + doubleAsteriskRegexFragment: "(/.+?)?", + replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) + }; + wildcardMatchers = { + files: filesMatcher, + directories: directoriesMatcher, + exclude: excludeMatcher + }; + supportedTSExtensions = [[ + ".ts", + ".tsx", + ".d.ts" + /* Dts */ + ], [ + ".cts", + ".d.cts" + /* Dcts */ + ], [ + ".mts", + ".d.mts" + /* Dmts */ + ]]; + supportedTSExtensionsFlat = flatten2(supportedTSExtensions); + supportedTSExtensionsWithJson = [...supportedTSExtensions, [ + ".json" + /* Json */ + ]]; + supportedTSExtensionsForExtractExtension = [ + ".d.ts", + ".d.cts", + ".d.mts", + ".cts", + ".mts", + ".ts", + ".tsx" + /* Tsx */ + ]; + supportedJSExtensions = [[ + ".js", + ".jsx" + /* Jsx */ + ], [ + ".mjs" + /* Mjs */ + ], [ + ".cjs" + /* Cjs */ + ]]; + supportedJSExtensionsFlat = flatten2(supportedJSExtensions); + allSupportedExtensions = [[ + ".ts", + ".tsx", + ".d.ts", + ".js", + ".jsx" + /* Jsx */ + ], [ + ".cts", + ".d.cts", + ".cjs" + /* Cjs */ + ], [ + ".mts", + ".d.mts", + ".mjs" + /* Mjs */ + ]]; + allSupportedExtensionsWithJson = [...allSupportedExtensions, [ + ".json" + /* Json */ + ]]; + supportedDeclarationExtensions = [ + ".d.ts", + ".d.cts", + ".d.mts" + /* Dmts */ + ]; + supportedTSImplementationExtensions = [ + ".ts", + ".cts", + ".mts", + ".tsx" + /* Tsx */ + ]; + extensionsNotSupportingExtensionlessResolution = [ + ".mts", + ".d.mts", + ".mjs", + ".cts", + ".d.cts", + ".cjs" + /* Cjs */ + ]; + ModuleSpecifierEnding = /* @__PURE__ */ ((ModuleSpecifierEnding2) => { + ModuleSpecifierEnding2[ModuleSpecifierEnding2["Minimal"] = 0] = "Minimal"; + ModuleSpecifierEnding2[ModuleSpecifierEnding2["Index"] = 1] = "Index"; + ModuleSpecifierEnding2[ModuleSpecifierEnding2["JsExtension"] = 2] = "JsExtension"; + ModuleSpecifierEnding2[ModuleSpecifierEnding2["TsExtension"] = 3] = "TsExtension"; + return ModuleSpecifierEnding2; + })(ModuleSpecifierEnding || {}); + extensionsToRemove = [ + ".d.ts", + ".d.mts", + ".d.cts", + ".mjs", + ".mts", + ".cjs", + ".cts", + ".ts", + ".js", + ".tsx", + ".jsx", + ".json" + /* Json */ + ]; + emptyFileSystemEntries = { + files: emptyArray, + directories: emptyArray + }; + stringReplace = String.prototype.replace; + } + }); + function createBaseNodeFactory() { + let NodeConstructor2; + let TokenConstructor2; + let IdentifierConstructor2; + let PrivateIdentifierConstructor2; + let SourceFileConstructor2; + return { + createBaseSourceFileNode, + createBaseIdentifierNode, + createBasePrivateIdentifierNode, + createBaseTokenNode, + createBaseNode + }; + function createBaseSourceFileNode(kind) { + return new (SourceFileConstructor2 || (SourceFileConstructor2 = objectAllocator.getSourceFileConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseIdentifierNode(kind) { + return new (IdentifierConstructor2 || (IdentifierConstructor2 = objectAllocator.getIdentifierConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBasePrivateIdentifierNode(kind) { + return new (PrivateIdentifierConstructor2 || (PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseTokenNode(kind) { + return new (TokenConstructor2 || (TokenConstructor2 = objectAllocator.getTokenConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + function createBaseNode(kind) { + return new (NodeConstructor2 || (NodeConstructor2 = objectAllocator.getNodeConstructor()))( + kind, + /*pos*/ + -1, + /*end*/ + -1 + ); + } + } + var init_baseNodeFactory = __esm2({ + "src/compiler/factory/baseNodeFactory.ts"() { + "use strict"; + init_ts2(); + } + }); + function createParenthesizerRules(factory2) { + let binaryLeftOperandParenthesizerCache; + let binaryRightOperandParenthesizerCache; + return { + getParenthesizeLeftSideOfBinaryForOperator, + getParenthesizeRightSideOfBinaryForOperator, + parenthesizeLeftSideOfBinary, + parenthesizeRightSideOfBinary, + parenthesizeExpressionOfComputedPropertyName, + parenthesizeConditionOfConditionalExpression, + parenthesizeBranchOfConditionalExpression, + parenthesizeExpressionOfExportDefault, + parenthesizeExpressionOfNew, + parenthesizeLeftSideOfAccess, + parenthesizeOperandOfPostfixUnary, + parenthesizeOperandOfPrefixUnary, + parenthesizeExpressionsOfCommaDelimitedList, + parenthesizeExpressionForDisallowedComma, + parenthesizeExpressionOfExpressionStatement, + parenthesizeConciseBodyOfArrowFunction, + parenthesizeCheckTypeOfConditionalType, + parenthesizeExtendsTypeOfConditionalType, + parenthesizeConstituentTypesOfUnionType, + parenthesizeConstituentTypeOfUnionType, + parenthesizeConstituentTypesOfIntersectionType, + parenthesizeConstituentTypeOfIntersectionType, + parenthesizeOperandOfTypeOperator, + parenthesizeOperandOfReadonlyTypeOperator, + parenthesizeNonArrayTypeOfPostfixType, + parenthesizeElementTypesOfTupleType, + parenthesizeElementTypeOfTupleType, + parenthesizeTypeOfOptionalType, + parenthesizeTypeArguments, + parenthesizeLeadingTypeArgument + }; + function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) { + binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = /* @__PURE__ */ new Map()); + let parenthesizerRule = binaryLeftOperandParenthesizerCache.get(operatorKind); + if (!parenthesizerRule) { + parenthesizerRule = (node) => parenthesizeLeftSideOfBinary(operatorKind, node); + binaryLeftOperandParenthesizerCache.set(operatorKind, parenthesizerRule); + } + return parenthesizerRule; + } + function getParenthesizeRightSideOfBinaryForOperator(operatorKind) { + binaryRightOperandParenthesizerCache || (binaryRightOperandParenthesizerCache = /* @__PURE__ */ new Map()); + let parenthesizerRule = binaryRightOperandParenthesizerCache.get(operatorKind); + if (!parenthesizerRule) { + parenthesizerRule = (node) => parenthesizeRightSideOfBinary( + operatorKind, + /*leftSide*/ + void 0, + node + ); + binaryRightOperandParenthesizerCache.set(operatorKind, parenthesizerRule); + } + return parenthesizerRule; + } + function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + const binaryOperatorPrecedence = getOperatorPrecedence(226, binaryOperator); + const binaryOperatorAssociativity = getOperatorAssociativity(226, binaryOperator); + const emittedOperand = skipPartiallyEmittedExpressions(operand); + if (!isLeftSideOfBinary && operand.kind === 219 && binaryOperatorPrecedence > 3) { + return true; + } + const operandPrecedence = getExpressionPrecedence(emittedOperand); + switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { + case -1: + if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 && operand.kind === 229) { + return false; + } + return true; + case 1: + return false; + case 0: + if (isLeftSideOfBinary) { + return binaryOperatorAssociativity === 1; + } else { + if (isBinaryExpression(emittedOperand) && emittedOperand.operatorToken.kind === binaryOperator) { + if (operatorHasAssociativeProperty(binaryOperator)) { + return false; + } + if (binaryOperator === 40) { + const leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0; + if (isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { + return false; + } + } + } + const operandAssociativity = getExpressionAssociativity(emittedOperand); + return operandAssociativity === 0; + } + } + } + function operatorHasAssociativeProperty(binaryOperator) { + return binaryOperator === 42 || binaryOperator === 52 || binaryOperator === 51 || binaryOperator === 53 || binaryOperator === 28; + } + function getLiteralKindOfBinaryPlusOperand(node) { + node = skipPartiallyEmittedExpressions(node); + if (isLiteralKind(node.kind)) { + return node.kind; + } + if (node.kind === 226 && node.operatorToken.kind === 40) { + if (node.cachedLiteralKind !== void 0) { + return node.cachedLiteralKind; + } + const leftKind = getLiteralKindOfBinaryPlusOperand(node.left); + const literalKind = isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) ? leftKind : 0; + node.cachedLiteralKind = literalKind; + return literalKind; + } + return 0; + } + function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { + const skipped = skipPartiallyEmittedExpressions(operand); + if (skipped.kind === 217) { + return operand; + } + return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; + } + function parenthesizeLeftSideOfBinary(binaryOperator, leftSide) { + return parenthesizeBinaryOperand( + binaryOperator, + leftSide, + /*isLeftSideOfBinary*/ + true + ); + } + function parenthesizeRightSideOfBinary(binaryOperator, leftSide, rightSide) { + return parenthesizeBinaryOperand( + binaryOperator, + rightSide, + /*isLeftSideOfBinary*/ + false, + leftSide + ); + } + function parenthesizeExpressionOfComputedPropertyName(expression) { + return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; + } + function parenthesizeConditionOfConditionalExpression(condition) { + const conditionalPrecedence = getOperatorPrecedence( + 227, + 58 + /* QuestionToken */ + ); + const emittedCondition = skipPartiallyEmittedExpressions(condition); + const conditionPrecedence = getExpressionPrecedence(emittedCondition); + if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1) { + return factory2.createParenthesizedExpression(condition); + } + return condition; + } + function parenthesizeBranchOfConditionalExpression(branch) { + const emittedExpression = skipPartiallyEmittedExpressions(branch); + return isCommaSequence(emittedExpression) ? factory2.createParenthesizedExpression(branch) : branch; + } + function parenthesizeExpressionOfExportDefault(expression) { + const check = skipPartiallyEmittedExpressions(expression); + let needsParens = isCommaSequence(check); + if (!needsParens) { + switch (getLeftmostExpression( + check, + /*stopAtCallExpressions*/ + false + ).kind) { + case 231: + case 218: + needsParens = true; + } + } + return needsParens ? factory2.createParenthesizedExpression(expression) : expression; + } + function parenthesizeExpressionOfNew(expression) { + const leftmostExpr = getLeftmostExpression( + expression, + /*stopAtCallExpressions*/ + true + ); + switch (leftmostExpr.kind) { + case 213: + return factory2.createParenthesizedExpression(expression); + case 214: + return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; + } + return parenthesizeLeftSideOfAccess(expression); + } + function parenthesizeLeftSideOfAccess(expression, optionalChain) { + const emittedExpression = skipPartiallyEmittedExpressions(expression); + if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { + return expression; + } + return setTextRange(factory2.createParenthesizedExpression(expression), expression); + } + function parenthesizeOperandOfPostfixUnary(operand) { + return isLeftHandSideExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); + } + function parenthesizeOperandOfPrefixUnary(operand) { + return isUnaryExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); + } + function parenthesizeExpressionsOfCommaDelimitedList(elements) { + const result2 = sameMap(elements, parenthesizeExpressionForDisallowedComma); + return setTextRange(factory2.createNodeArray(result2, elements.hasTrailingComma), elements); + } + function parenthesizeExpressionForDisallowedComma(expression) { + const emittedExpression = skipPartiallyEmittedExpressions(expression); + const expressionPrecedence = getExpressionPrecedence(emittedExpression); + const commaPrecedence = getOperatorPrecedence( + 226, + 28 + /* CommaToken */ + ); + return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); + } + function parenthesizeExpressionOfExpressionStatement(expression) { + const emittedExpression = skipPartiallyEmittedExpressions(expression); + if (isCallExpression(emittedExpression)) { + const callee = emittedExpression.expression; + const kind = skipPartiallyEmittedExpressions(callee).kind; + if (kind === 218 || kind === 219) { + const updated = factory2.updateCallExpression( + emittedExpression, + setTextRange(factory2.createParenthesizedExpression(callee), callee), + emittedExpression.typeArguments, + emittedExpression.arguments + ); + return factory2.restoreOuterExpressions( + expression, + updated, + 8 + /* PartiallyEmittedExpressions */ + ); + } + } + const leftmostExpressionKind = getLeftmostExpression( + emittedExpression, + /*stopAtCallExpressions*/ + false + ).kind; + if (leftmostExpressionKind === 210 || leftmostExpressionKind === 218) { + return setTextRange(factory2.createParenthesizedExpression(expression), expression); + } + return expression; + } + function parenthesizeConciseBodyOfArrowFunction(body) { + if (!isBlock2(body) && (isCommaSequence(body) || getLeftmostExpression( + body, + /*stopAtCallExpressions*/ + false + ).kind === 210)) { + return setTextRange(factory2.createParenthesizedExpression(body), body); + } + return body; + } + function parenthesizeCheckTypeOfConditionalType(checkType) { + switch (checkType.kind) { + case 184: + case 185: + case 194: + return factory2.createParenthesizedType(checkType); + } + return checkType; + } + function parenthesizeExtendsTypeOfConditionalType(extendsType) { + switch (extendsType.kind) { + case 194: + return factory2.createParenthesizedType(extendsType); + } + return extendsType; + } + function parenthesizeConstituentTypeOfUnionType(type3) { + switch (type3.kind) { + case 192: + case 193: + return factory2.createParenthesizedType(type3); + } + return parenthesizeCheckTypeOfConditionalType(type3); + } + function parenthesizeConstituentTypesOfUnionType(members) { + return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfUnionType)); + } + function parenthesizeConstituentTypeOfIntersectionType(type3) { + switch (type3.kind) { + case 192: + case 193: + return factory2.createParenthesizedType(type3); + } + return parenthesizeConstituentTypeOfUnionType(type3); + } + function parenthesizeConstituentTypesOfIntersectionType(members) { + return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfIntersectionType)); + } + function parenthesizeOperandOfTypeOperator(type3) { + switch (type3.kind) { + case 193: + return factory2.createParenthesizedType(type3); + } + return parenthesizeConstituentTypeOfIntersectionType(type3); + } + function parenthesizeOperandOfReadonlyTypeOperator(type3) { + switch (type3.kind) { + case 198: + return factory2.createParenthesizedType(type3); + } + return parenthesizeOperandOfTypeOperator(type3); + } + function parenthesizeNonArrayTypeOfPostfixType(type3) { + switch (type3.kind) { + case 195: + case 198: + case 186: + return factory2.createParenthesizedType(type3); + } + return parenthesizeOperandOfTypeOperator(type3); + } + function parenthesizeElementTypesOfTupleType(types3) { + return factory2.createNodeArray(sameMap(types3, parenthesizeElementTypeOfTupleType)); + } + function parenthesizeElementTypeOfTupleType(type3) { + if (hasJSDocPostfixQuestion(type3)) + return factory2.createParenthesizedType(type3); + return type3; + } + function hasJSDocPostfixQuestion(type3) { + if (isJSDocNullableType(type3)) + return type3.postfix; + if (isNamedTupleMember(type3)) + return hasJSDocPostfixQuestion(type3.type); + if (isFunctionTypeNode(type3) || isConstructorTypeNode(type3) || isTypeOperatorNode(type3)) + return hasJSDocPostfixQuestion(type3.type); + if (isConditionalTypeNode(type3)) + return hasJSDocPostfixQuestion(type3.falseType); + if (isUnionTypeNode(type3)) + return hasJSDocPostfixQuestion(last2(type3.types)); + if (isIntersectionTypeNode(type3)) + return hasJSDocPostfixQuestion(last2(type3.types)); + if (isInferTypeNode(type3)) + return !!type3.typeParameter.constraint && hasJSDocPostfixQuestion(type3.typeParameter.constraint); + return false; + } + function parenthesizeTypeOfOptionalType(type3) { + if (hasJSDocPostfixQuestion(type3)) + return factory2.createParenthesizedType(type3); + return parenthesizeNonArrayTypeOfPostfixType(type3); + } + function parenthesizeLeadingTypeArgument(node) { + return isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory2.createParenthesizedType(node) : node; + } + function parenthesizeOrdinalTypeArgument(node, i7) { + return i7 === 0 ? parenthesizeLeadingTypeArgument(node) : node; + } + function parenthesizeTypeArguments(typeArguments) { + if (some2(typeArguments)) { + return factory2.createNodeArray(sameMap(typeArguments, parenthesizeOrdinalTypeArgument)); + } + } + } + var nullParenthesizerRules; + var init_parenthesizerRules = __esm2({ + "src/compiler/factory/parenthesizerRules.ts"() { + "use strict"; + init_ts2(); + nullParenthesizerRules = { + getParenthesizeLeftSideOfBinaryForOperator: (_6) => identity2, + getParenthesizeRightSideOfBinaryForOperator: (_6) => identity2, + parenthesizeLeftSideOfBinary: (_binaryOperator, leftSide) => leftSide, + parenthesizeRightSideOfBinary: (_binaryOperator, _leftSide, rightSide) => rightSide, + parenthesizeExpressionOfComputedPropertyName: identity2, + parenthesizeConditionOfConditionalExpression: identity2, + parenthesizeBranchOfConditionalExpression: identity2, + parenthesizeExpressionOfExportDefault: identity2, + parenthesizeExpressionOfNew: (expression) => cast(expression, isLeftHandSideExpression), + parenthesizeLeftSideOfAccess: (expression) => cast(expression, isLeftHandSideExpression), + parenthesizeOperandOfPostfixUnary: (operand) => cast(operand, isLeftHandSideExpression), + parenthesizeOperandOfPrefixUnary: (operand) => cast(operand, isUnaryExpression), + parenthesizeExpressionsOfCommaDelimitedList: (nodes) => cast(nodes, isNodeArray), + parenthesizeExpressionForDisallowedComma: identity2, + parenthesizeExpressionOfExpressionStatement: identity2, + parenthesizeConciseBodyOfArrowFunction: identity2, + parenthesizeCheckTypeOfConditionalType: identity2, + parenthesizeExtendsTypeOfConditionalType: identity2, + parenthesizeConstituentTypesOfUnionType: (nodes) => cast(nodes, isNodeArray), + parenthesizeConstituentTypeOfUnionType: identity2, + parenthesizeConstituentTypesOfIntersectionType: (nodes) => cast(nodes, isNodeArray), + parenthesizeConstituentTypeOfIntersectionType: identity2, + parenthesizeOperandOfTypeOperator: identity2, + parenthesizeOperandOfReadonlyTypeOperator: identity2, + parenthesizeNonArrayTypeOfPostfixType: identity2, + parenthesizeElementTypesOfTupleType: (nodes) => cast(nodes, isNodeArray), + parenthesizeElementTypeOfTupleType: identity2, + parenthesizeTypeOfOptionalType: identity2, + parenthesizeTypeArguments: (nodes) => nodes && cast(nodes, isNodeArray), + parenthesizeLeadingTypeArgument: identity2 + }; + } + }); + function createNodeConverters(factory2) { + return { + convertToFunctionBlock, + convertToFunctionExpression, + convertToClassExpression, + convertToArrayAssignmentElement, + convertToObjectAssignmentElement, + convertToAssignmentPattern, + convertToObjectAssignmentPattern, + convertToArrayAssignmentPattern, + convertToAssignmentElementTarget + }; + function convertToFunctionBlock(node, multiLine) { + if (isBlock2(node)) + return node; + const returnStatement = factory2.createReturnStatement(node); + setTextRange(returnStatement, node); + const body = factory2.createBlock([returnStatement], multiLine); + setTextRange(body, node); + return body; + } + function convertToFunctionExpression(node) { + var _a2; + if (!node.body) + return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); + const updated = factory2.createFunctionExpression( + (_a2 = getModifiers(node)) == null ? void 0 : _a2.filter((modifier) => !isExportModifier(modifier) && !isDefaultModifier(modifier)), + node.asteriskToken, + node.name, + node.typeParameters, + node.parameters, + node.type, + node.body + ); + setOriginalNode(updated, node); + setTextRange(updated, node); + if (getStartsOnNewLine(node)) { + setStartsOnNewLine( + updated, + /*newLine*/ + true + ); + } + return updated; + } + function convertToClassExpression(node) { + var _a2; + const updated = factory2.createClassExpression( + (_a2 = node.modifiers) == null ? void 0 : _a2.filter((modifier) => !isExportModifier(modifier) && !isDefaultModifier(modifier)), + node.name, + node.typeParameters, + node.heritageClauses, + node.members + ); + setOriginalNode(updated, node); + setTextRange(updated, node); + if (getStartsOnNewLine(node)) { + setStartsOnNewLine( + updated, + /*newLine*/ + true + ); + } + return updated; + } + function convertToArrayAssignmentElement(element) { + if (isBindingElement(element)) { + if (element.dotDotDotToken) { + Debug.assertNode(element.name, isIdentifier); + return setOriginalNode(setTextRange(factory2.createSpreadElement(element.name), element), element); + } + const expression = convertToAssignmentElementTarget(element.name); + return element.initializer ? setOriginalNode( + setTextRange( + factory2.createAssignment(expression, element.initializer), + element + ), + element + ) : expression; + } + return cast(element, isExpression); + } + function convertToObjectAssignmentElement(element) { + if (isBindingElement(element)) { + if (element.dotDotDotToken) { + Debug.assertNode(element.name, isIdentifier); + return setOriginalNode(setTextRange(factory2.createSpreadAssignment(element.name), element), element); + } + if (element.propertyName) { + const expression = convertToAssignmentElementTarget(element.name); + return setOriginalNode(setTextRange(factory2.createPropertyAssignment(element.propertyName, element.initializer ? factory2.createAssignment(expression, element.initializer) : expression), element), element); + } + Debug.assertNode(element.name, isIdentifier); + return setOriginalNode(setTextRange(factory2.createShorthandPropertyAssignment(element.name, element.initializer), element), element); + } + return cast(element, isObjectLiteralElementLike); + } + function convertToAssignmentPattern(node) { + switch (node.kind) { + case 207: + case 209: + return convertToArrayAssignmentPattern(node); + case 206: + case 210: + return convertToObjectAssignmentPattern(node); + } + } + function convertToObjectAssignmentPattern(node) { + if (isObjectBindingPattern(node)) { + return setOriginalNode( + setTextRange( + factory2.createObjectLiteralExpression(map4(node.elements, convertToObjectAssignmentElement)), + node + ), + node + ); + } + return cast(node, isObjectLiteralExpression); + } + function convertToArrayAssignmentPattern(node) { + if (isArrayBindingPattern(node)) { + return setOriginalNode( + setTextRange( + factory2.createArrayLiteralExpression(map4(node.elements, convertToArrayAssignmentElement)), + node + ), + node + ); + } + return cast(node, isArrayLiteralExpression); + } + function convertToAssignmentElementTarget(node) { + if (isBindingPattern(node)) { + return convertToAssignmentPattern(node); + } + return cast(node, isExpression); + } + } + var nullNodeConverters; + var init_nodeConverters = __esm2({ + "src/compiler/factory/nodeConverters.ts"() { + "use strict"; + init_ts2(); + nullNodeConverters = { + convertToFunctionBlock: notImplemented, + convertToFunctionExpression: notImplemented, + convertToClassExpression: notImplemented, + convertToArrayAssignmentElement: notImplemented, + convertToObjectAssignmentElement: notImplemented, + convertToAssignmentPattern: notImplemented, + convertToObjectAssignmentPattern: notImplemented, + convertToArrayAssignmentPattern: notImplemented, + convertToAssignmentElementTarget: notImplemented + }; + } + }); + function addNodeFactoryPatcher(fn) { + nodeFactoryPatchers.push(fn); + } + function createNodeFactory(flags, baseFactory2) { + const setOriginal = flags & 8 ? identity2 : setOriginalNode; + const parenthesizerRules = memoize2(() => flags & 1 ? nullParenthesizerRules : createParenthesizerRules(factory2)); + const converters = memoize2(() => flags & 2 ? nullNodeConverters : createNodeConverters(factory2)); + const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right)); + const getPrefixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPrefixUnaryExpression(operator, operand)); + const getPostfixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPostfixUnaryExpression(operand, operator)); + const getJSDocPrimaryTypeCreateFunction = memoizeOne((kind) => () => createJSDocPrimaryTypeWorker(kind)); + const getJSDocUnaryTypeCreateFunction = memoizeOne((kind) => (type3) => createJSDocUnaryTypeWorker(kind, type3)); + const getJSDocUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type3) => updateJSDocUnaryTypeWorker(kind, node, type3)); + const getJSDocPrePostfixUnaryTypeCreateFunction = memoizeOne((kind) => (type3, postfix) => createJSDocPrePostfixUnaryTypeWorker(kind, type3, postfix)); + const getJSDocPrePostfixUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type3) => updateJSDocPrePostfixUnaryTypeWorker(kind, node, type3)); + const getJSDocSimpleTagCreateFunction = memoizeOne((kind) => (tagName, comment) => createJSDocSimpleTagWorker(kind, tagName, comment)); + const getJSDocSimpleTagUpdateFunction = memoizeOne((kind) => (node, tagName, comment) => updateJSDocSimpleTagWorker(kind, node, tagName, comment)); + const getJSDocTypeLikeTagCreateFunction = memoizeOne((kind) => (tagName, typeExpression, comment) => createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment)); + const getJSDocTypeLikeTagUpdateFunction = memoizeOne((kind) => (node, tagName, typeExpression, comment) => updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment)); + const factory2 = { + get parenthesizer() { + return parenthesizerRules(); + }, + get converters() { + return converters(); + }, + baseFactory: baseFactory2, + flags, + createNodeArray, + createNumericLiteral, + createBigIntLiteral, + createStringLiteral, + createStringLiteralFromNode, + createRegularExpressionLiteral, + createLiteralLikeNode, + createIdentifier, + createTempVariable, + createLoopVariable, + createUniqueName, + getGeneratedNameForNode, + createPrivateIdentifier, + createUniquePrivateName, + getGeneratedPrivateNameForNode, + createToken, + createSuper, + createThis, + createNull, + createTrue, + createFalse, + createModifier, + createModifiersFromModifierFlags, + createQualifiedName, + updateQualifiedName, + createComputedPropertyName, + updateComputedPropertyName, + createTypeParameterDeclaration, + updateTypeParameterDeclaration, + createParameterDeclaration, + updateParameterDeclaration, + createDecorator, + updateDecorator, + createPropertySignature, + updatePropertySignature, + createPropertyDeclaration, + updatePropertyDeclaration: updatePropertyDeclaration2, + createMethodSignature, + updateMethodSignature, + createMethodDeclaration, + updateMethodDeclaration, + createConstructorDeclaration, + updateConstructorDeclaration, + createGetAccessorDeclaration, + updateGetAccessorDeclaration, + createSetAccessorDeclaration, + updateSetAccessorDeclaration, + createCallSignature, + updateCallSignature, + createConstructSignature, + updateConstructSignature, + createIndexSignature, + updateIndexSignature, + createClassStaticBlockDeclaration, + updateClassStaticBlockDeclaration, + createTemplateLiteralTypeSpan, + updateTemplateLiteralTypeSpan, + createKeywordTypeNode, + createTypePredicateNode, + updateTypePredicateNode, + createTypeReferenceNode, + updateTypeReferenceNode, + createFunctionTypeNode, + updateFunctionTypeNode, + createConstructorTypeNode, + updateConstructorTypeNode, + createTypeQueryNode, + updateTypeQueryNode, + createTypeLiteralNode, + updateTypeLiteralNode, + createArrayTypeNode, + updateArrayTypeNode, + createTupleTypeNode, + updateTupleTypeNode, + createNamedTupleMember, + updateNamedTupleMember, + createOptionalTypeNode, + updateOptionalTypeNode, + createRestTypeNode, + updateRestTypeNode, + createUnionTypeNode, + updateUnionTypeNode, + createIntersectionTypeNode, + updateIntersectionTypeNode, + createConditionalTypeNode, + updateConditionalTypeNode, + createInferTypeNode, + updateInferTypeNode, + createImportTypeNode, + updateImportTypeNode, + createParenthesizedType, + updateParenthesizedType, + createThisTypeNode, + createTypeOperatorNode, + updateTypeOperatorNode, + createIndexedAccessTypeNode, + updateIndexedAccessTypeNode, + createMappedTypeNode, + updateMappedTypeNode, + createLiteralTypeNode, + updateLiteralTypeNode, + createTemplateLiteralType, + updateTemplateLiteralType, + createObjectBindingPattern, + updateObjectBindingPattern, + createArrayBindingPattern, + updateArrayBindingPattern, + createBindingElement, + updateBindingElement, + createArrayLiteralExpression, + updateArrayLiteralExpression, + createObjectLiteralExpression, + updateObjectLiteralExpression, + createPropertyAccessExpression: flags & 4 ? (expression, name2) => setEmitFlags( + createPropertyAccessExpression(expression, name2), + 262144 + /* NoIndentation */ + ) : createPropertyAccessExpression, + updatePropertyAccessExpression, + createPropertyAccessChain: flags & 4 ? (expression, questionDotToken, name2) => setEmitFlags( + createPropertyAccessChain(expression, questionDotToken, name2), + 262144 + /* NoIndentation */ + ) : createPropertyAccessChain, + updatePropertyAccessChain, + createElementAccessExpression, + updateElementAccessExpression, + createElementAccessChain, + updateElementAccessChain, + createCallExpression, + updateCallExpression, + createCallChain, + updateCallChain, + createNewExpression, + updateNewExpression, + createTaggedTemplateExpression, + updateTaggedTemplateExpression, + createTypeAssertion, + updateTypeAssertion, + createParenthesizedExpression, + updateParenthesizedExpression, + createFunctionExpression, + updateFunctionExpression, + createArrowFunction, + updateArrowFunction, + createDeleteExpression, + updateDeleteExpression, + createTypeOfExpression, + updateTypeOfExpression, + createVoidExpression, + updateVoidExpression, + createAwaitExpression, + updateAwaitExpression, + createPrefixUnaryExpression, + updatePrefixUnaryExpression, + createPostfixUnaryExpression, + updatePostfixUnaryExpression, + createBinaryExpression, + updateBinaryExpression, + createConditionalExpression, + updateConditionalExpression, + createTemplateExpression, + updateTemplateExpression, + createTemplateHead, + createTemplateMiddle, + createTemplateTail, + createNoSubstitutionTemplateLiteral, + createTemplateLiteralLikeNode, + createYieldExpression, + updateYieldExpression, + createSpreadElement, + updateSpreadElement, + createClassExpression, + updateClassExpression, + createOmittedExpression, + createExpressionWithTypeArguments, + updateExpressionWithTypeArguments, + createAsExpression, + updateAsExpression, + createNonNullExpression, + updateNonNullExpression, + createSatisfiesExpression, + updateSatisfiesExpression, + createNonNullChain, + updateNonNullChain, + createMetaProperty, + updateMetaProperty, + createTemplateSpan, + updateTemplateSpan, + createSemicolonClassElement, + createBlock, + updateBlock, + createVariableStatement, + updateVariableStatement, + createEmptyStatement, + createExpressionStatement, + updateExpressionStatement, + createIfStatement, + updateIfStatement, + createDoStatement, + updateDoStatement, + createWhileStatement, + updateWhileStatement, + createForStatement, + updateForStatement, + createForInStatement, + updateForInStatement, + createForOfStatement, + updateForOfStatement, + createContinueStatement, + updateContinueStatement, + createBreakStatement, + updateBreakStatement, + createReturnStatement, + updateReturnStatement, + createWithStatement, + updateWithStatement, + createSwitchStatement, + updateSwitchStatement, + createLabeledStatement, + updateLabeledStatement, + createThrowStatement, + updateThrowStatement, + createTryStatement, + updateTryStatement, + createDebuggerStatement, + createVariableDeclaration, + updateVariableDeclaration, + createVariableDeclarationList, + updateVariableDeclarationList, + createFunctionDeclaration, + updateFunctionDeclaration, + createClassDeclaration, + updateClassDeclaration, + createInterfaceDeclaration, + updateInterfaceDeclaration, + createTypeAliasDeclaration, + updateTypeAliasDeclaration, + createEnumDeclaration, + updateEnumDeclaration, + createModuleDeclaration, + updateModuleDeclaration, + createModuleBlock, + updateModuleBlock, + createCaseBlock, + updateCaseBlock, + createNamespaceExportDeclaration, + updateNamespaceExportDeclaration, + createImportEqualsDeclaration, + updateImportEqualsDeclaration, + createImportDeclaration, + updateImportDeclaration, + createImportClause, + updateImportClause, + createAssertClause, + updateAssertClause, + createAssertEntry, + updateAssertEntry, + createImportTypeAssertionContainer, + updateImportTypeAssertionContainer, + createImportAttributes, + updateImportAttributes, + createImportAttribute, + updateImportAttribute, + createNamespaceImport, + updateNamespaceImport, + createNamespaceExport, + updateNamespaceExport, + createNamedImports, + updateNamedImports, + createImportSpecifier, + updateImportSpecifier, + createExportAssignment: createExportAssignment2, + updateExportAssignment, + createExportDeclaration, + updateExportDeclaration, + createNamedExports, + updateNamedExports, + createExportSpecifier, + updateExportSpecifier, + createMissingDeclaration, + createExternalModuleReference, + updateExternalModuleReference, + // lazily load factory members for JSDoc types with similar structure + get createJSDocAllType() { + return getJSDocPrimaryTypeCreateFunction( + 319 + /* JSDocAllType */ + ); + }, + get createJSDocUnknownType() { + return getJSDocPrimaryTypeCreateFunction( + 320 + /* JSDocUnknownType */ + ); + }, + get createJSDocNonNullableType() { + return getJSDocPrePostfixUnaryTypeCreateFunction( + 322 + /* JSDocNonNullableType */ + ); + }, + get updateJSDocNonNullableType() { + return getJSDocPrePostfixUnaryTypeUpdateFunction( + 322 + /* JSDocNonNullableType */ + ); + }, + get createJSDocNullableType() { + return getJSDocPrePostfixUnaryTypeCreateFunction( + 321 + /* JSDocNullableType */ + ); + }, + get updateJSDocNullableType() { + return getJSDocPrePostfixUnaryTypeUpdateFunction( + 321 + /* JSDocNullableType */ + ); + }, + get createJSDocOptionalType() { + return getJSDocUnaryTypeCreateFunction( + 323 + /* JSDocOptionalType */ + ); + }, + get updateJSDocOptionalType() { + return getJSDocUnaryTypeUpdateFunction( + 323 + /* JSDocOptionalType */ + ); + }, + get createJSDocVariadicType() { + return getJSDocUnaryTypeCreateFunction( + 325 + /* JSDocVariadicType */ + ); + }, + get updateJSDocVariadicType() { + return getJSDocUnaryTypeUpdateFunction( + 325 + /* JSDocVariadicType */ + ); + }, + get createJSDocNamepathType() { + return getJSDocUnaryTypeCreateFunction( + 326 + /* JSDocNamepathType */ + ); + }, + get updateJSDocNamepathType() { + return getJSDocUnaryTypeUpdateFunction( + 326 + /* JSDocNamepathType */ + ); + }, + createJSDocFunctionType, + updateJSDocFunctionType, + createJSDocTypeLiteral, + updateJSDocTypeLiteral, + createJSDocTypeExpression, + updateJSDocTypeExpression, + createJSDocSignature, + updateJSDocSignature, + createJSDocTemplateTag, + updateJSDocTemplateTag, + createJSDocTypedefTag, + updateJSDocTypedefTag, + createJSDocParameterTag, + updateJSDocParameterTag, + createJSDocPropertyTag, + updateJSDocPropertyTag, + createJSDocCallbackTag, + updateJSDocCallbackTag, + createJSDocOverloadTag, + updateJSDocOverloadTag, + createJSDocAugmentsTag, + updateJSDocAugmentsTag, + createJSDocImplementsTag, + updateJSDocImplementsTag, + createJSDocSeeTag, + updateJSDocSeeTag, + createJSDocNameReference, + updateJSDocNameReference, + createJSDocMemberName, + updateJSDocMemberName, + createJSDocLink, + updateJSDocLink, + createJSDocLinkCode, + updateJSDocLinkCode, + createJSDocLinkPlain, + updateJSDocLinkPlain, + // lazily load factory members for JSDoc tags with similar structure + get createJSDocTypeTag() { + return getJSDocTypeLikeTagCreateFunction( + 351 + /* JSDocTypeTag */ + ); + }, + get updateJSDocTypeTag() { + return getJSDocTypeLikeTagUpdateFunction( + 351 + /* JSDocTypeTag */ + ); + }, + get createJSDocReturnTag() { + return getJSDocTypeLikeTagCreateFunction( + 349 + /* JSDocReturnTag */ + ); + }, + get updateJSDocReturnTag() { + return getJSDocTypeLikeTagUpdateFunction( + 349 + /* JSDocReturnTag */ + ); + }, + get createJSDocThisTag() { + return getJSDocTypeLikeTagCreateFunction( + 350 + /* JSDocThisTag */ + ); + }, + get updateJSDocThisTag() { + return getJSDocTypeLikeTagUpdateFunction( + 350 + /* JSDocThisTag */ + ); + }, + get createJSDocAuthorTag() { + return getJSDocSimpleTagCreateFunction( + 337 + /* JSDocAuthorTag */ + ); + }, + get updateJSDocAuthorTag() { + return getJSDocSimpleTagUpdateFunction( + 337 + /* JSDocAuthorTag */ + ); + }, + get createJSDocClassTag() { + return getJSDocSimpleTagCreateFunction( + 339 + /* JSDocClassTag */ + ); + }, + get updateJSDocClassTag() { + return getJSDocSimpleTagUpdateFunction( + 339 + /* JSDocClassTag */ + ); + }, + get createJSDocPublicTag() { + return getJSDocSimpleTagCreateFunction( + 340 + /* JSDocPublicTag */ + ); + }, + get updateJSDocPublicTag() { + return getJSDocSimpleTagUpdateFunction( + 340 + /* JSDocPublicTag */ + ); + }, + get createJSDocPrivateTag() { + return getJSDocSimpleTagCreateFunction( + 341 + /* JSDocPrivateTag */ + ); + }, + get updateJSDocPrivateTag() { + return getJSDocSimpleTagUpdateFunction( + 341 + /* JSDocPrivateTag */ + ); + }, + get createJSDocProtectedTag() { + return getJSDocSimpleTagCreateFunction( + 342 + /* JSDocProtectedTag */ + ); + }, + get updateJSDocProtectedTag() { + return getJSDocSimpleTagUpdateFunction( + 342 + /* JSDocProtectedTag */ + ); + }, + get createJSDocReadonlyTag() { + return getJSDocSimpleTagCreateFunction( + 343 + /* JSDocReadonlyTag */ + ); + }, + get updateJSDocReadonlyTag() { + return getJSDocSimpleTagUpdateFunction( + 343 + /* JSDocReadonlyTag */ + ); + }, + get createJSDocOverrideTag() { + return getJSDocSimpleTagCreateFunction( + 344 + /* JSDocOverrideTag */ + ); + }, + get updateJSDocOverrideTag() { + return getJSDocSimpleTagUpdateFunction( + 344 + /* JSDocOverrideTag */ + ); + }, + get createJSDocDeprecatedTag() { + return getJSDocSimpleTagCreateFunction( + 338 + /* JSDocDeprecatedTag */ + ); + }, + get updateJSDocDeprecatedTag() { + return getJSDocSimpleTagUpdateFunction( + 338 + /* JSDocDeprecatedTag */ + ); + }, + get createJSDocThrowsTag() { + return getJSDocTypeLikeTagCreateFunction( + 356 + /* JSDocThrowsTag */ + ); + }, + get updateJSDocThrowsTag() { + return getJSDocTypeLikeTagUpdateFunction( + 356 + /* JSDocThrowsTag */ + ); + }, + get createJSDocSatisfiesTag() { + return getJSDocTypeLikeTagCreateFunction( + 357 + /* JSDocSatisfiesTag */ + ); + }, + get updateJSDocSatisfiesTag() { + return getJSDocTypeLikeTagUpdateFunction( + 357 + /* JSDocSatisfiesTag */ + ); + }, + createJSDocEnumTag, + updateJSDocEnumTag, + createJSDocUnknownTag, + updateJSDocUnknownTag, + createJSDocText, + updateJSDocText, + createJSDocComment, + updateJSDocComment, + createJsxElement, + updateJsxElement, + createJsxSelfClosingElement, + updateJsxSelfClosingElement, + createJsxOpeningElement, + updateJsxOpeningElement, + createJsxClosingElement, + updateJsxClosingElement, + createJsxFragment, + createJsxText, + updateJsxText, + createJsxOpeningFragment, + createJsxJsxClosingFragment, + updateJsxFragment, + createJsxAttribute, + updateJsxAttribute, + createJsxAttributes, + updateJsxAttributes, + createJsxSpreadAttribute, + updateJsxSpreadAttribute, + createJsxExpression, + updateJsxExpression, + createJsxNamespacedName, + updateJsxNamespacedName, + createCaseClause, + updateCaseClause, + createDefaultClause, + updateDefaultClause, + createHeritageClause, + updateHeritageClause, + createCatchClause, + updateCatchClause, + createPropertyAssignment, + updatePropertyAssignment, + createShorthandPropertyAssignment, + updateShorthandPropertyAssignment, + createSpreadAssignment, + updateSpreadAssignment, + createEnumMember, + updateEnumMember, + createSourceFile: createSourceFile2, + updateSourceFile: updateSourceFile2, + createRedirectedSourceFile, + createBundle, + updateBundle, + createUnparsedSource, + createUnparsedPrologue, + createUnparsedPrepend, + createUnparsedTextLike, + createUnparsedSyntheticReference, + createInputFiles: createInputFiles2, + createSyntheticExpression, + createSyntaxList: createSyntaxList3, + createNotEmittedStatement, + createPartiallyEmittedExpression, + updatePartiallyEmittedExpression, + createCommaListExpression, + updateCommaListExpression, + createSyntheticReferenceExpression, + updateSyntheticReferenceExpression, + cloneNode, + // Lazily load factory methods for common operator factories and utilities + get createComma() { + return getBinaryCreateFunction( + 28 + /* CommaToken */ + ); + }, + get createAssignment() { + return getBinaryCreateFunction( + 64 + /* EqualsToken */ + ); + }, + get createLogicalOr() { + return getBinaryCreateFunction( + 57 + /* BarBarToken */ + ); + }, + get createLogicalAnd() { + return getBinaryCreateFunction( + 56 + /* AmpersandAmpersandToken */ + ); + }, + get createBitwiseOr() { + return getBinaryCreateFunction( + 52 + /* BarToken */ + ); + }, + get createBitwiseXor() { + return getBinaryCreateFunction( + 53 + /* CaretToken */ + ); + }, + get createBitwiseAnd() { + return getBinaryCreateFunction( + 51 + /* AmpersandToken */ + ); + }, + get createStrictEquality() { + return getBinaryCreateFunction( + 37 + /* EqualsEqualsEqualsToken */ + ); + }, + get createStrictInequality() { + return getBinaryCreateFunction( + 38 + /* ExclamationEqualsEqualsToken */ + ); + }, + get createEquality() { + return getBinaryCreateFunction( + 35 + /* EqualsEqualsToken */ + ); + }, + get createInequality() { + return getBinaryCreateFunction( + 36 + /* ExclamationEqualsToken */ + ); + }, + get createLessThan() { + return getBinaryCreateFunction( + 30 + /* LessThanToken */ + ); + }, + get createLessThanEquals() { + return getBinaryCreateFunction( + 33 + /* LessThanEqualsToken */ + ); + }, + get createGreaterThan() { + return getBinaryCreateFunction( + 32 + /* GreaterThanToken */ + ); + }, + get createGreaterThanEquals() { + return getBinaryCreateFunction( + 34 + /* GreaterThanEqualsToken */ + ); + }, + get createLeftShift() { + return getBinaryCreateFunction( + 48 + /* LessThanLessThanToken */ + ); + }, + get createRightShift() { + return getBinaryCreateFunction( + 49 + /* GreaterThanGreaterThanToken */ + ); + }, + get createUnsignedRightShift() { + return getBinaryCreateFunction( + 50 + /* GreaterThanGreaterThanGreaterThanToken */ + ); + }, + get createAdd() { + return getBinaryCreateFunction( + 40 + /* PlusToken */ + ); + }, + get createSubtract() { + return getBinaryCreateFunction( + 41 + /* MinusToken */ + ); + }, + get createMultiply() { + return getBinaryCreateFunction( + 42 + /* AsteriskToken */ + ); + }, + get createDivide() { + return getBinaryCreateFunction( + 44 + /* SlashToken */ + ); + }, + get createModulo() { + return getBinaryCreateFunction( + 45 + /* PercentToken */ + ); + }, + get createExponent() { + return getBinaryCreateFunction( + 43 + /* AsteriskAsteriskToken */ + ); + }, + get createPrefixPlus() { + return getPrefixUnaryCreateFunction( + 40 + /* PlusToken */ + ); + }, + get createPrefixMinus() { + return getPrefixUnaryCreateFunction( + 41 + /* MinusToken */ + ); + }, + get createPrefixIncrement() { + return getPrefixUnaryCreateFunction( + 46 + /* PlusPlusToken */ + ); + }, + get createPrefixDecrement() { + return getPrefixUnaryCreateFunction( + 47 + /* MinusMinusToken */ + ); + }, + get createBitwiseNot() { + return getPrefixUnaryCreateFunction( + 55 + /* TildeToken */ + ); + }, + get createLogicalNot() { + return getPrefixUnaryCreateFunction( + 54 + /* ExclamationToken */ + ); + }, + get createPostfixIncrement() { + return getPostfixUnaryCreateFunction( + 46 + /* PlusPlusToken */ + ); + }, + get createPostfixDecrement() { + return getPostfixUnaryCreateFunction( + 47 + /* MinusMinusToken */ + ); + }, + // Compound nodes + createImmediatelyInvokedFunctionExpression, + createImmediatelyInvokedArrowFunction, + createVoidZero, + createExportDefault, + createExternalModuleExport, + createTypeCheck, + createIsNotTypeCheck, + createMethodCall, + createGlobalMethodCall, + createFunctionBindCall, + createFunctionCallCall, + createFunctionApplyCall, + createArraySliceCall, + createArrayConcatCall, + createObjectDefinePropertyCall, + createObjectGetOwnPropertyDescriptorCall, + createReflectGetCall, + createReflectSetCall, + createPropertyDescriptor, + createCallBinding, + createAssignmentTargetWrapper, + // Utilities + inlineExpressions, + getInternalName, + getLocalName, + getExportName, + getDeclarationName, + getNamespaceMemberName, + getExternalModuleOrNamespaceExportName, + restoreOuterExpressions, + restoreEnclosingLabel, + createUseStrictPrologue, + copyPrologue, + copyStandardPrologue, + copyCustomPrologue, + ensureUseStrict, + liftToBlock, + mergeLexicalEnvironment, + replaceModifiers, + replaceDecoratorsAndModifiers, + replacePropertyName + }; + forEach4(nodeFactoryPatchers, (fn) => fn(factory2)); + return factory2; + function createNodeArray(elements, hasTrailingComma) { + if (elements === void 0 || elements === emptyArray) { + elements = []; + } else if (isNodeArray(elements)) { + if (hasTrailingComma === void 0 || elements.hasTrailingComma === hasTrailingComma) { + if (elements.transformFlags === void 0) { + aggregateChildrenFlags(elements); + } + Debug.attachNodeArrayDebugInfo(elements); + return elements; + } + const array2 = elements.slice(); + array2.pos = elements.pos; + array2.end = elements.end; + array2.hasTrailingComma = hasTrailingComma; + array2.transformFlags = elements.transformFlags; + Debug.attachNodeArrayDebugInfo(array2); + return array2; + } + const length2 = elements.length; + const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements; + array.pos = -1; + array.end = -1; + array.hasTrailingComma = !!hasTrailingComma; + array.transformFlags = 0; + aggregateChildrenFlags(array); + Debug.attachNodeArrayDebugInfo(array); + return array; + } + function createBaseNode(kind) { + return baseFactory2.createBaseNode(kind); + } + function createBaseDeclaration(kind) { + const node = createBaseNode(kind); + node.symbol = void 0; + node.localSymbol = void 0; + return node; + } + function finishUpdateBaseSignatureDeclaration(updated, original) { + if (updated !== original) { + updated.typeArguments = original.typeArguments; + } + return update2(updated, original); + } + function createNumericLiteral(value2, numericLiteralFlags = 0) { + const text = typeof value2 === "number" ? value2 + "" : value2; + Debug.assert(text.charCodeAt(0) !== 45, "Negative numbers should be created in combination with createPrefixUnaryExpression"); + const node = createBaseDeclaration( + 9 + /* NumericLiteral */ + ); + node.text = text; + node.numericLiteralFlags = numericLiteralFlags; + if (numericLiteralFlags & 384) + node.transformFlags |= 1024; + return node; + } + function createBigIntLiteral(value2) { + const node = createBaseToken( + 10 + /* BigIntLiteral */ + ); + node.text = typeof value2 === "string" ? value2 : pseudoBigIntToString(value2) + "n"; + node.transformFlags |= 32; + return node; + } + function createBaseStringLiteral(text, isSingleQuote) { + const node = createBaseDeclaration( + 11 + /* StringLiteral */ + ); + node.text = text; + node.singleQuote = isSingleQuote; + return node; + } + function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { + const node = createBaseStringLiteral(text, isSingleQuote); + node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; + if (hasExtendedUnicodeEscape) + node.transformFlags |= 1024; + return node; + } + function createStringLiteralFromNode(sourceNode) { + const node = createBaseStringLiteral( + getTextOfIdentifierOrLiteral(sourceNode), + /*isSingleQuote*/ + void 0 + ); + node.textSourceNode = sourceNode; + return node; + } + function createRegularExpressionLiteral(text) { + const node = createBaseToken( + 14 + /* RegularExpressionLiteral */ + ); + node.text = text; + return node; + } + function createLiteralLikeNode(kind, text) { + switch (kind) { + case 9: + return createNumericLiteral( + text, + /*numericLiteralFlags*/ + 0 + ); + case 10: + return createBigIntLiteral(text); + case 11: + return createStringLiteral( + text, + /*isSingleQuote*/ + void 0 + ); + case 12: + return createJsxText( + text, + /*containsOnlyTriviaWhiteSpaces*/ + false + ); + case 13: + return createJsxText( + text, + /*containsOnlyTriviaWhiteSpaces*/ + true + ); + case 14: + return createRegularExpressionLiteral(text); + case 15: + return createTemplateLiteralLikeNode( + kind, + text, + /*rawText*/ + void 0, + /*templateFlags*/ + 0 + ); + } + } + function createBaseIdentifier(escapedText) { + const node = baseFactory2.createBaseIdentifierNode( + 80 + /* Identifier */ + ); + node.escapedText = escapedText; + node.jsDoc = void 0; + node.flowNode = void 0; + node.symbol = void 0; + return node; + } + function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { + flags: autoGenerateFlags, + id: nextAutoGenerateId, + prefix, + suffix + }); + nextAutoGenerateId++; + return node; + } + function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) { + if (originalKeywordKind === void 0 && text) { + originalKeywordKind = stringToToken(text); + } + if (originalKeywordKind === 80) { + originalKeywordKind = void 0; + } + const node = createBaseIdentifier(escapeLeadingUnderscores(text)); + if (hasExtendedUnicodeEscape) + node.flags |= 256; + if (node.escapedText === "await") { + node.transformFlags |= 67108864; + } + if (node.flags & 256) { + node.transformFlags |= 1024; + } + return node; + } + function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { + let flags2 = 1; + if (reservedInNestedScopes) + flags2 |= 8; + const name2 = createBaseGeneratedIdentifier("", flags2, prefix, suffix); + if (recordTempVariable) { + recordTempVariable(name2); + } + return name2; + } + function createLoopVariable(reservedInNestedScopes) { + let flags2 = 2; + if (reservedInNestedScopes) + flags2 |= 8; + return createBaseGeneratedIdentifier( + "", + flags2, + /*prefix*/ + void 0, + /*suffix*/ + void 0 + ); + } + function createUniqueName(text, flags2 = 0, prefix, suffix) { + Debug.assert(!(flags2 & 7), "Argument out of range: flags"); + Debug.assert((flags2 & (16 | 32)) !== 32, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); + return createBaseGeneratedIdentifier(text, 3 | flags2, prefix, suffix); + } + function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { + Debug.assert(!(flags2 & 7), "Argument out of range: flags"); + const text = !node ? "" : isMemberName(node) ? formatGeneratedName( + /*privateName*/ + false, + prefix, + node, + suffix, + idText + ) : `generated@${getNodeId(node)}`; + if (prefix || suffix) + flags2 |= 16; + const name2 = createBaseGeneratedIdentifier(text, 4 | flags2, prefix, suffix); + name2.original = node; + return name2; + } + function createBasePrivateIdentifier(escapedText) { + const node = baseFactory2.createBasePrivateIdentifierNode( + 81 + /* PrivateIdentifier */ + ); + node.escapedText = escapedText; + node.transformFlags |= 16777216; + return node; + } + function createPrivateIdentifier(text) { + if (!startsWith2(text, "#")) + Debug.fail("First character of private identifier must be #: " + text); + return createBasePrivateIdentifier(escapeLeadingUnderscores(text)); + } + function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { + const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text)); + setIdentifierAutoGenerate(node, { + flags: autoGenerateFlags, + id: nextAutoGenerateId, + prefix, + suffix + }); + nextAutoGenerateId++; + return node; + } + function createUniquePrivateName(text, prefix, suffix) { + if (text && !startsWith2(text, "#")) + Debug.fail("First character of private identifier must be #: " + text); + const autoGenerateFlags = 8 | (text ? 3 : 1); + return createBaseGeneratedPrivateIdentifier(text ?? "", autoGenerateFlags, prefix, suffix); + } + function getGeneratedPrivateNameForNode(node, prefix, suffix) { + const text = isMemberName(node) ? formatGeneratedName( + /*privateName*/ + true, + prefix, + node, + suffix, + idText + ) : `#generated@${getNodeId(node)}`; + const flags2 = prefix || suffix ? 16 : 0; + const name2 = createBaseGeneratedPrivateIdentifier(text, 4 | flags2, prefix, suffix); + name2.original = node; + return name2; + } + function createBaseToken(kind) { + return baseFactory2.createBaseTokenNode(kind); + } + function createToken(token) { + Debug.assert(token >= 0 && token <= 165, "Invalid token"); + Debug.assert(token <= 15 || token >= 18, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); + Debug.assert(token <= 9 || token >= 15, "Invalid token. Use 'createLiteralLikeNode' to create literals."); + Debug.assert(token !== 80, "Invalid token. Use 'createIdentifier' to create identifiers"); + const node = createBaseToken(token); + let transformFlags = 0; + switch (token) { + case 134: + transformFlags = 256 | 128; + break; + case 160: + transformFlags = 4; + break; + case 125: + case 123: + case 124: + case 148: + case 128: + case 138: + case 87: + case 133: + case 150: + case 163: + case 146: + case 151: + case 103: + case 147: + case 164: + case 154: + case 136: + case 155: + case 116: + case 159: + case 157: + transformFlags = 1; + break; + case 108: + transformFlags = 1024 | 134217728; + node.flowNode = void 0; + break; + case 126: + transformFlags = 1024; + break; + case 129: + transformFlags = 16777216; + break; + case 110: + transformFlags = 16384; + node.flowNode = void 0; + break; + } + if (transformFlags) { + node.transformFlags |= transformFlags; + } + return node; + } + function createSuper() { + return createToken( + 108 + /* SuperKeyword */ + ); + } + function createThis() { + return createToken( + 110 + /* ThisKeyword */ + ); + } + function createNull() { + return createToken( + 106 + /* NullKeyword */ + ); + } + function createTrue() { + return createToken( + 112 + /* TrueKeyword */ + ); + } + function createFalse() { + return createToken( + 97 + /* FalseKeyword */ + ); + } + function createModifier(kind) { + return createToken(kind); + } + function createModifiersFromModifierFlags(flags2) { + const result2 = []; + if (flags2 & 32) + result2.push(createModifier( + 95 + /* ExportKeyword */ + )); + if (flags2 & 128) + result2.push(createModifier( + 138 + /* DeclareKeyword */ + )); + if (flags2 & 2048) + result2.push(createModifier( + 90 + /* DefaultKeyword */ + )); + if (flags2 & 4096) + result2.push(createModifier( + 87 + /* ConstKeyword */ + )); + if (flags2 & 1) + result2.push(createModifier( + 125 + /* PublicKeyword */ + )); + if (flags2 & 2) + result2.push(createModifier( + 123 + /* PrivateKeyword */ + )); + if (flags2 & 4) + result2.push(createModifier( + 124 + /* ProtectedKeyword */ + )); + if (flags2 & 64) + result2.push(createModifier( + 128 + /* AbstractKeyword */ + )); + if (flags2 & 256) + result2.push(createModifier( + 126 + /* StaticKeyword */ + )); + if (flags2 & 16) + result2.push(createModifier( + 164 + /* OverrideKeyword */ + )); + if (flags2 & 8) + result2.push(createModifier( + 148 + /* ReadonlyKeyword */ + )); + if (flags2 & 512) + result2.push(createModifier( + 129 + /* AccessorKeyword */ + )); + if (flags2 & 1024) + result2.push(createModifier( + 134 + /* AsyncKeyword */ + )); + if (flags2 & 8192) + result2.push(createModifier( + 103 + /* InKeyword */ + )); + if (flags2 & 16384) + result2.push(createModifier( + 147 + /* OutKeyword */ + )); + return result2.length ? result2 : void 0; + } + function createQualifiedName(left, right) { + const node = createBaseNode( + 166 + /* QualifiedName */ + ); + node.left = left; + node.right = asName(right); + node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); + node.flowNode = void 0; + return node; + } + function updateQualifiedName(node, left, right) { + return node.left !== left || node.right !== right ? update2(createQualifiedName(left, right), node) : node; + } + function createComputedPropertyName(expression) { + const node = createBaseNode( + 167 + /* ComputedPropertyName */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 1024 | 131072; + return node; + } + function updateComputedPropertyName(node, expression) { + return node.expression !== expression ? update2(createComputedPropertyName(expression), node) : node; + } + function createTypeParameterDeclaration(modifiers, name2, constraint, defaultType) { + const node = createBaseDeclaration( + 168 + /* TypeParameter */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.constraint = constraint; + node.default = defaultType; + node.transformFlags = 1; + node.expression = void 0; + node.jsDoc = void 0; + return node; + } + function updateTypeParameterDeclaration(node, modifiers, name2, constraint, defaultType) { + return node.modifiers !== modifiers || node.name !== name2 || node.constraint !== constraint || node.default !== defaultType ? update2(createTypeParameterDeclaration(modifiers, name2, constraint, defaultType), node) : node; + } + function createParameterDeclaration(modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + const node = createBaseDeclaration( + 169 + /* Parameter */ + ); + node.modifiers = asNodeArray(modifiers); + node.dotDotDotToken = dotDotDotToken; + node.name = asName(name2); + node.questionToken = questionToken; + node.type = type3; + node.initializer = asInitializer(initializer); + if (isThisIdentifier(node.name)) { + node.transformFlags = 1; + } else { + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (node.questionToken ?? node.type ? 1 : 0) | (node.dotDotDotToken ?? node.initializer ? 1024 : 0) | (modifiersToFlags(node.modifiers) & 31 ? 8192 : 0); + } + node.jsDoc = void 0; + return node; + } + function updateParameterDeclaration(node, modifiers, dotDotDotToken, name2, questionToken, type3, initializer) { + return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 || node.initializer !== initializer ? update2(createParameterDeclaration(modifiers, dotDotDotToken, name2, questionToken, type3, initializer), node) : node; + } + function createDecorator(expression) { + const node = createBaseNode( + 170 + /* Decorator */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1 | 8192 | 33554432; + return node; + } + function updateDecorator(node, expression) { + return node.expression !== expression ? update2(createDecorator(expression), node) : node; + } + function createPropertySignature(modifiers, name2, questionToken, type3) { + const node = createBaseDeclaration( + 171 + /* PropertySignature */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.type = type3; + node.questionToken = questionToken; + node.transformFlags = 1; + node.initializer = void 0; + node.jsDoc = void 0; + return node; + } + function updatePropertySignature(node, modifiers, name2, questionToken, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 ? finishUpdatePropertySignature(createPropertySignature(modifiers, name2, questionToken, type3), node) : node; + } + function finishUpdatePropertySignature(updated, original) { + if (updated !== original) { + updated.initializer = original.initializer; + } + return update2(updated, original); + } + function createPropertyDeclaration(modifiers, name2, questionOrExclamationToken, type3, initializer) { + const node = createBaseDeclaration( + 172 + /* PropertyDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; + node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; + node.type = type3; + node.initializer = asInitializer(initializer); + const isAmbient = node.flags & 33554432 || modifiersToFlags(node.modifiers) & 128; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 : 0) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 256 && node.initializer ? 8192 : 0) | 16777216; + node.jsDoc = void 0; + return node; + } + function updatePropertyDeclaration2(node, modifiers, name2, questionOrExclamationToken, type3, initializer) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type3 || node.initializer !== initializer ? update2(createPropertyDeclaration(modifiers, name2, questionOrExclamationToken, type3, initializer), node) : node; + } + function createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 173 + /* MethodSignature */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.questionToken = questionToken; + node.typeParameters = asNodeArray(typeParameters); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateMethodSignature(node, modifiers, name2, questionToken, typeParameters, parameters, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3), node) : node; + } + function createMethodDeclaration(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + const node = createBaseDeclaration( + 174 + /* MethodDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.asteriskToken = asteriskToken; + node.name = asName(name2); + node.questionToken = questionToken; + node.exclamationToken = void 0; + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.body = body; + if (!node.body) { + node.transformFlags = 1; + } else { + const isAsync2 = modifiersToFlags(node.modifiers) & 1024; + const isGenerator = !!node.asteriskToken; + const isAsyncGenerator = isAsync2 && isGenerator; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 | (isAsyncGenerator ? 128 : isAsync2 ? 256 : isGenerator ? 2048 : 0) | (node.questionToken || node.typeParameters || node.type ? 1 : 0) | 1024; + } + node.typeArguments = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateMethodDeclaration(node, modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name2 || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateMethodDeclaration(createMethodDeclaration(modifiers, asteriskToken, name2, questionToken, typeParameters, parameters, type3, body), node) : node; + } + function finishUpdateMethodDeclaration(updated, original) { + if (updated !== original) { + updated.exclamationToken = original.exclamationToken; + } + return update2(updated, original); + } + function createClassStaticBlockDeclaration(body) { + const node = createBaseDeclaration( + 175 + /* ClassStaticBlockDeclaration */ + ); + node.body = body; + node.transformFlags = propagateChildFlags(body) | 16777216; + node.modifiers = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateClassStaticBlockDeclaration(node, body) { + return node.body !== body ? finishUpdateClassStaticBlockDeclaration(createClassStaticBlockDeclaration(body), node) : node; + } + function finishUpdateClassStaticBlockDeclaration(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + } + return update2(updated, original); + } + function createConstructorDeclaration(modifiers, parameters, body) { + const node = createBaseDeclaration( + 176 + /* Constructor */ + ); + node.modifiers = asNodeArray(modifiers); + node.parameters = createNodeArray(parameters); + node.body = body; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 | 1024; + node.typeParameters = void 0; + node.type = void 0; + node.typeArguments = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateConstructorDeclaration(node, modifiers, parameters, body) { + return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node; + } + function finishUpdateConstructorDeclaration(updated, original) { + if (updated !== original) { + updated.typeParameters = original.typeParameters; + updated.type = original.type; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createGetAccessorDeclaration(modifiers, name2, parameters, type3, body) { + const node = createBaseDeclaration( + 177 + /* GetAccessor */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.body = body; + if (!node.body) { + node.transformFlags = 1; + } else { + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 | (node.type ? 1 : 0); + } + node.typeArguments = void 0; + node.typeParameters = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateGetAccessorDeclaration(node, modifiers, name2, parameters, type3, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateGetAccessorDeclaration(createGetAccessorDeclaration(modifiers, name2, parameters, type3, body), node) : node; + } + function finishUpdateGetAccessorDeclaration(updated, original) { + if (updated !== original) { + updated.typeParameters = original.typeParameters; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createSetAccessorDeclaration(modifiers, name2, parameters, body) { + const node = createBaseDeclaration( + 178 + /* SetAccessor */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.parameters = createNodeArray(parameters); + node.body = body; + if (!node.body) { + node.transformFlags = 1; + } else { + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 | (node.type ? 1 : 0); + } + node.typeArguments = void 0; + node.typeParameters = void 0; + node.type = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateSetAccessorDeclaration(node, modifiers, name2, parameters, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.parameters !== parameters || node.body !== body ? finishUpdateSetAccessorDeclaration(createSetAccessorDeclaration(modifiers, name2, parameters, body), node) : node; + } + function finishUpdateSetAccessorDeclaration(updated, original) { + if (updated !== original) { + updated.typeParameters = original.typeParameters; + updated.type = original.type; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createCallSignature(typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 179 + /* CallSignature */ + ); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateCallSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type3), node) : node; + } + function createConstructSignature(typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 180 + /* ConstructSignature */ + ); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateConstructSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type3), node) : node; + } + function createIndexSignature(modifiers, parameters, type3) { + const node = createBaseDeclaration( + 181 + /* IndexSignature */ + ); + node.modifiers = asNodeArray(modifiers); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateIndexSignature(node, modifiers, parameters, type3) { + return node.parameters !== parameters || node.type !== type3 || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type3), node) : node; + } + function createTemplateLiteralTypeSpan(type3, literal) { + const node = createBaseNode( + 204 + /* TemplateLiteralTypeSpan */ + ); + node.type = type3; + node.literal = literal; + node.transformFlags = 1; + return node; + } + function updateTemplateLiteralTypeSpan(node, type3, literal) { + return node.type !== type3 || node.literal !== literal ? update2(createTemplateLiteralTypeSpan(type3, literal), node) : node; + } + function createKeywordTypeNode(kind) { + return createToken(kind); + } + function createTypePredicateNode(assertsModifier, parameterName, type3) { + const node = createBaseNode( + 182 + /* TypePredicate */ + ); + node.assertsModifier = assertsModifier; + node.parameterName = asName(parameterName); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateTypePredicateNode(node, assertsModifier, parameterName, type3) { + return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type3 ? update2(createTypePredicateNode(assertsModifier, parameterName, type3), node) : node; + } + function createTypeReferenceNode(typeName, typeArguments) { + const node = createBaseNode( + 183 + /* TypeReference */ + ); + node.typeName = asName(typeName); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); + node.transformFlags = 1; + return node; + } + function updateTypeReferenceNode(node, typeName, typeArguments) { + return node.typeName !== typeName || node.typeArguments !== typeArguments ? update2(createTypeReferenceNode(typeName, typeArguments), node) : node; + } + function createFunctionTypeNode(typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 184 + /* FunctionType */ + ); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.modifiers = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateFunctionTypeNode(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type3), node) : node; + } + function finishUpdateFunctionTypeNode(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createConstructorTypeNode(...args) { + return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); + } + function createConstructorTypeNode1(modifiers, typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 185 + /* ConstructorType */ + ); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function createConstructorTypeNode2(typeParameters, parameters, type3) { + return createConstructorTypeNode1( + /*modifiers*/ + void 0, + typeParameters, + parameters, + type3 + ); + } + function updateConstructorTypeNode(...args) { + return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); + } + function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type3) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type3), node) : node; + } + function updateConstructorTypeNode2(node, typeParameters, parameters, type3) { + return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type3); + } + function createTypeQueryNode(exprName, typeArguments) { + const node = createBaseNode( + 186 + /* TypeQuery */ + ); + node.exprName = exprName; + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.transformFlags = 1; + return node; + } + function updateTypeQueryNode(node, exprName, typeArguments) { + return node.exprName !== exprName || node.typeArguments !== typeArguments ? update2(createTypeQueryNode(exprName, typeArguments), node) : node; + } + function createTypeLiteralNode(members) { + const node = createBaseDeclaration( + 187 + /* TypeLiteral */ + ); + node.members = createNodeArray(members); + node.transformFlags = 1; + return node; + } + function updateTypeLiteralNode(node, members) { + return node.members !== members ? update2(createTypeLiteralNode(members), node) : node; + } + function createArrayTypeNode(elementType) { + const node = createBaseNode( + 188 + /* ArrayType */ + ); + node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); + node.transformFlags = 1; + return node; + } + function updateArrayTypeNode(node, elementType) { + return node.elementType !== elementType ? update2(createArrayTypeNode(elementType), node) : node; + } + function createTupleTypeNode(elements) { + const node = createBaseNode( + 189 + /* TupleType */ + ); + node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); + node.transformFlags = 1; + return node; + } + function updateTupleTypeNode(node, elements) { + return node.elements !== elements ? update2(createTupleTypeNode(elements), node) : node; + } + function createNamedTupleMember(dotDotDotToken, name2, questionToken, type3) { + const node = createBaseDeclaration( + 202 + /* NamedTupleMember */ + ); + node.dotDotDotToken = dotDotDotToken; + node.name = name2; + node.questionToken = questionToken; + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + return node; + } + function updateNamedTupleMember(node, dotDotDotToken, name2, questionToken, type3) { + return node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.questionToken !== questionToken || node.type !== type3 ? update2(createNamedTupleMember(dotDotDotToken, name2, questionToken, type3), node) : node; + } + function createOptionalTypeNode(type3) { + const node = createBaseNode( + 190 + /* OptionalType */ + ); + node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type3); + node.transformFlags = 1; + return node; + } + function updateOptionalTypeNode(node, type3) { + return node.type !== type3 ? update2(createOptionalTypeNode(type3), node) : node; + } + function createRestTypeNode(type3) { + const node = createBaseNode( + 191 + /* RestType */ + ); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateRestTypeNode(node, type3) { + return node.type !== type3 ? update2(createRestTypeNode(type3), node) : node; + } + function createUnionOrIntersectionTypeNode(kind, types3, parenthesize) { + const node = createBaseNode(kind); + node.types = factory2.createNodeArray(parenthesize(types3)); + node.transformFlags = 1; + return node; + } + function updateUnionOrIntersectionTypeNode(node, types3, parenthesize) { + return node.types !== types3 ? update2(createUnionOrIntersectionTypeNode(node.kind, types3, parenthesize), node) : node; + } + function createUnionTypeNode(types3) { + return createUnionOrIntersectionTypeNode(192, types3, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + } + function updateUnionTypeNode(node, types3) { + return updateUnionOrIntersectionTypeNode(node, types3, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); + } + function createIntersectionTypeNode(types3) { + return createUnionOrIntersectionTypeNode(193, types3, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + } + function updateIntersectionTypeNode(node, types3) { + return updateUnionOrIntersectionTypeNode(node, types3, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); + } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + const node = createBaseNode( + 194 + /* ConditionalType */ + ); + node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); + node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); + node.trueType = trueType; + node.falseType = falseType; + node.transformFlags = 1; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update2(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; + } + function createInferTypeNode(typeParameter) { + const node = createBaseNode( + 195 + /* InferType */ + ); + node.typeParameter = typeParameter; + node.transformFlags = 1; + return node; + } + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter ? update2(createInferTypeNode(typeParameter), node) : node; + } + function createTemplateLiteralType(head2, templateSpans) { + const node = createBaseNode( + 203 + /* TemplateLiteralType */ + ); + node.head = head2; + node.templateSpans = createNodeArray(templateSpans); + node.transformFlags = 1; + return node; + } + function updateTemplateLiteralType(node, head2, templateSpans) { + return node.head !== head2 || node.templateSpans !== templateSpans ? update2(createTemplateLiteralType(head2, templateSpans), node) : node; + } + function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) { + const node = createBaseNode( + 205 + /* ImportType */ + ); + node.argument = argument; + node.attributes = attributes; + if (node.assertions && node.assertions.assertClause && node.attributes) { + node.assertions.assertClause = node.attributes; + } + node.qualifier = qualifier; + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.isTypeOf = isTypeOf; + node.transformFlags = 1; + return node; + } + function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) { + return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update2(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node; + } + function createParenthesizedType(type3) { + const node = createBaseNode( + 196 + /* ParenthesizedType */ + ); + node.type = type3; + node.transformFlags = 1; + return node; + } + function updateParenthesizedType(node, type3) { + return node.type !== type3 ? update2(createParenthesizedType(type3), node) : node; + } + function createThisTypeNode() { + const node = createBaseNode( + 197 + /* ThisType */ + ); + node.transformFlags = 1; + return node; + } + function createTypeOperatorNode(operator, type3) { + const node = createBaseNode( + 198 + /* TypeOperator */ + ); + node.operator = operator; + node.type = operator === 148 ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type3) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type3); + node.transformFlags = 1; + return node; + } + function updateTypeOperatorNode(node, type3) { + return node.type !== type3 ? update2(createTypeOperatorNode(node.operator, type3), node) : node; + } + function createIndexedAccessTypeNode(objectType2, indexType) { + const node = createBaseNode( + 199 + /* IndexedAccessType */ + ); + node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType2); + node.indexType = indexType; + node.transformFlags = 1; + return node; + } + function updateIndexedAccessTypeNode(node, objectType2, indexType) { + return node.objectType !== objectType2 || node.indexType !== indexType ? update2(createIndexedAccessTypeNode(objectType2, indexType), node) : node; + } + function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members) { + const node = createBaseDeclaration( + 200 + /* MappedType */ + ); + node.readonlyToken = readonlyToken; + node.typeParameter = typeParameter; + node.nameType = nameType; + node.questionToken = questionToken; + node.type = type3; + node.members = members && createNodeArray(members); + node.transformFlags = 1; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type3, members) { + return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type3 || node.members !== members ? update2(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members), node) : node; + } + function createLiteralTypeNode(literal) { + const node = createBaseNode( + 201 + /* LiteralType */ + ); + node.literal = literal; + node.transformFlags = 1; + return node; + } + function updateLiteralTypeNode(node, literal) { + return node.literal !== literal ? update2(createLiteralTypeNode(literal), node) : node; + } + function createObjectBindingPattern(elements) { + const node = createBaseNode( + 206 + /* ObjectBindingPattern */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 | 524288; + if (node.transformFlags & 32768) { + node.transformFlags |= 128 | 65536; + } + return node; + } + function updateObjectBindingPattern(node, elements) { + return node.elements !== elements ? update2(createObjectBindingPattern(elements), node) : node; + } + function createArrayBindingPattern(elements) { + const node = createBaseNode( + 207 + /* ArrayBindingPattern */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 | 524288; + return node; + } + function updateArrayBindingPattern(node, elements) { + return node.elements !== elements ? update2(createArrayBindingPattern(elements), node) : node; + } + function createBindingElement(dotDotDotToken, propertyName, name2, initializer) { + const node = createBaseDeclaration( + 208 + /* BindingElement */ + ); + node.dotDotDotToken = dotDotDotToken; + node.propertyName = asName(propertyName); + node.name = asName(name2); + node.initializer = asInitializer(initializer); + node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.propertyName) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.dotDotDotToken ? 32768 : 0) | 1024; + node.flowNode = void 0; + return node; + } + function updateBindingElement(node, dotDotDotToken, propertyName, name2, initializer) { + return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name2 || node.initializer !== initializer ? update2(createBindingElement(dotDotDotToken, propertyName, name2, initializer), node) : node; + } + function createArrayLiteralExpression(elements, multiLine) { + const node = createBaseNode( + 209 + /* ArrayLiteralExpression */ + ); + const lastElement = elements && lastOrUndefined(elements); + const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); + node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.elements); + return node; + } + function updateArrayLiteralExpression(node, elements) { + return node.elements !== elements ? update2(createArrayLiteralExpression(elements, node.multiLine), node) : node; + } + function createObjectLiteralExpression(properties, multiLine) { + const node = createBaseDeclaration( + 210 + /* ObjectLiteralExpression */ + ); + node.properties = createNodeArray(properties); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.properties); + node.jsDoc = void 0; + return node; + } + function updateObjectLiteralExpression(node, properties) { + return node.properties !== properties ? update2(createObjectLiteralExpression(properties, node.multiLine), node) : node; + } + function createBasePropertyAccessExpression(expression, questionDotToken, name2) { + const node = createBaseDeclaration( + 211 + /* PropertyAccessExpression */ + ); + node.expression = expression; + node.questionDotToken = questionDotToken; + node.name = name2; + node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function createPropertyAccessExpression(expression, name2) { + const node = createBasePropertyAccessExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ), + /*questionDotToken*/ + void 0, + asName(name2) + ); + if (isSuperKeyword(expression)) { + node.transformFlags |= 256 | 128; + } + return node; + } + function updatePropertyAccessExpression(node, expression, name2) { + if (isPropertyAccessChain(node)) { + return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name2, isIdentifier)); + } + return node.expression !== expression || node.name !== name2 ? update2(createPropertyAccessExpression(expression, name2), node) : node; + } + function createPropertyAccessChain(expression, questionDotToken, name2) { + const node = createBasePropertyAccessExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ), + questionDotToken, + asName(name2) + ); + node.flags |= 64; + node.transformFlags |= 32; + return node; + } + function updatePropertyAccessChain(node, expression, questionDotToken, name2) { + Debug.assert(!!(node.flags & 64), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name2 ? update2(createPropertyAccessChain(expression, questionDotToken, name2), node) : node; + } + function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) { + const node = createBaseDeclaration( + 212 + /* ElementAccessExpression */ + ); + node.expression = expression; + node.questionDotToken = questionDotToken; + node.argumentExpression = argumentExpression; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function createElementAccessExpression(expression, index4) { + const node = createBaseElementAccessExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ), + /*questionDotToken*/ + void 0, + asExpression(index4) + ); + if (isSuperKeyword(expression)) { + node.transformFlags |= 256 | 128; + } + return node; + } + function updateElementAccessExpression(node, expression, argumentExpression) { + if (isElementAccessChain(node)) { + return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); + } + return node.expression !== expression || node.argumentExpression !== argumentExpression ? update2(createElementAccessExpression(expression, argumentExpression), node) : node; + } + function createElementAccessChain(expression, questionDotToken, index4) { + const node = createBaseElementAccessExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ), + questionDotToken, + asExpression(index4) + ); + node.flags |= 64; + node.transformFlags |= 32; + return node; + } + function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { + Debug.assert(!!(node.flags & 64), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update2(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; + } + function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) { + const node = createBaseDeclaration( + 213 + /* CallExpression */ + ); + node.expression = expression; + node.questionDotToken = questionDotToken; + node.typeArguments = typeArguments; + node.arguments = argumentsArray; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments); + if (node.typeArguments) { + node.transformFlags |= 1; + } + if (isSuperProperty(node.expression)) { + node.transformFlags |= 16384; + } + return node; + } + function createCallExpression(expression, typeArguments, argumentsArray) { + const node = createBaseCallExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ), + /*questionDotToken*/ + void 0, + asNodeArray(typeArguments), + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) + ); + if (isImportKeyword(node.expression)) { + node.transformFlags |= 8388608; + } + return node; + } + function updateCallExpression(node, expression, typeArguments, argumentsArray) { + if (isCallChain(node)) { + return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); + } + return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createCallExpression(expression, typeArguments, argumentsArray), node) : node; + } + function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { + const node = createBaseCallExpression( + parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ), + questionDotToken, + asNodeArray(typeArguments), + parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)) + ); + node.flags |= 64; + node.transformFlags |= 32; + return node; + } + function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { + Debug.assert(!!(node.flags & 64), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); + return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; + } + function createNewExpression(expression, typeArguments, argumentsArray) { + const node = createBaseDeclaration( + 214 + /* NewExpression */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); + node.typeArguments = asNodeArray(typeArguments); + node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32; + if (node.typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateNewExpression(node, expression, typeArguments, argumentsArray) { + return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update2(createNewExpression(expression, typeArguments, argumentsArray), node) : node; + } + function createTaggedTemplateExpression(tag, typeArguments, template2) { + const node = createBaseNode( + 215 + /* TaggedTemplateExpression */ + ); + node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess( + tag, + /*optionalChain*/ + false + ); + node.typeArguments = asNodeArray(typeArguments); + node.template = template2; + node.transformFlags |= propagateChildFlags(node.tag) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.template) | 1024; + if (node.typeArguments) { + node.transformFlags |= 1; + } + if (hasInvalidEscape(node.template)) { + node.transformFlags |= 128; + } + return node; + } + function updateTaggedTemplateExpression(node, tag, typeArguments, template2) { + return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template2 ? update2(createTaggedTemplateExpression(tag, typeArguments, template2), node) : node; + } + function createTypeAssertion(type3, expression) { + const node = createBaseNode( + 216 + /* TypeAssertionExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateTypeAssertion(node, type3, expression) { + return node.type !== type3 || node.expression !== expression ? update2(createTypeAssertion(type3, expression), node) : node; + } + function createParenthesizedExpression(expression) { + const node = createBaseNode( + 217 + /* ParenthesizedExpression */ + ); + node.expression = expression; + node.transformFlags = propagateChildFlags(node.expression); + node.jsDoc = void 0; + return node; + } + function updateParenthesizedExpression(node, expression) { + return node.expression !== expression ? update2(createParenthesizedExpression(expression), node) : node; + } + function createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + const node = createBaseDeclaration( + 218 + /* FunctionExpression */ + ); + node.modifiers = asNodeArray(modifiers); + node.asteriskToken = asteriskToken; + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.body = body; + const isAsync2 = modifiersToFlags(node.modifiers) & 1024; + const isGenerator = !!node.asteriskToken; + const isAsyncGenerator = isAsync2 && isGenerator; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 | (isAsyncGenerator ? 128 : isAsync2 ? 256 : isGenerator ? 2048 : 0) | (node.typeParameters || node.type ? 1 : 0) | 4194304; + node.typeArguments = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateFunctionExpression(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return node.name !== name2 || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body), node) : node; + } + function createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body) { + const node = createBaseDeclaration( + 219 + /* ArrowFunction */ + ); + node.modifiers = asNodeArray(modifiers); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.equalsGreaterThanToken = equalsGreaterThanToken ?? createToken( + 39 + /* EqualsGreaterThanToken */ + ); + node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body); + const isAsync2 = modifiersToFlags(node.modifiers) & 1024; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 | (node.typeParameters || node.type ? 1 : 0) | (isAsync2 ? 256 | 16384 : 0) | 1024; + node.typeArguments = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateArrowFunction(node, modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body) { + return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body), node) : node; + } + function createDeleteExpression(expression) { + const node = createBaseNode( + 220 + /* DeleteExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateDeleteExpression(node, expression) { + return node.expression !== expression ? update2(createDeleteExpression(expression), node) : node; + } + function createTypeOfExpression(expression) { + const node = createBaseNode( + 221 + /* TypeOfExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateTypeOfExpression(node, expression) { + return node.expression !== expression ? update2(createTypeOfExpression(expression), node) : node; + } + function createVoidExpression(expression) { + const node = createBaseNode( + 222 + /* VoidExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression); + return node; + } + function updateVoidExpression(node, expression) { + return node.expression !== expression ? update2(createVoidExpression(expression), node) : node; + } + function createAwaitExpression(expression) { + const node = createBaseNode( + 223 + /* AwaitExpression */ + ); + node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 256 | 128 | 2097152; + return node; + } + function updateAwaitExpression(node, expression) { + return node.expression !== expression ? update2(createAwaitExpression(expression), node) : node; + } + function createPrefixUnaryExpression(operator, operand) { + const node = createBaseNode( + 224 + /* PrefixUnaryExpression */ + ); + node.operator = operator; + node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); + node.transformFlags |= propagateChildFlags(node.operand); + if ((operator === 46 || operator === 47) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { + node.transformFlags |= 268435456; + } + return node; + } + function updatePrefixUnaryExpression(node, operand) { + return node.operand !== operand ? update2(createPrefixUnaryExpression(node.operator, operand), node) : node; + } + function createPostfixUnaryExpression(operand, operator) { + const node = createBaseNode( + 225 + /* PostfixUnaryExpression */ + ); + node.operator = operator; + node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); + node.transformFlags |= propagateChildFlags(node.operand); + if (isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { + node.transformFlags |= 268435456; + } + return node; + } + function updatePostfixUnaryExpression(node, operand) { + return node.operand !== operand ? update2(createPostfixUnaryExpression(operand, node.operator), node) : node; + } + function createBinaryExpression(left, operator, right) { + const node = createBaseDeclaration( + 226 + /* BinaryExpression */ + ); + const operatorToken = asToken(operator); + const operatorKind = operatorToken.kind; + node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); + node.operatorToken = operatorToken; + node.right = parenthesizerRules().parenthesizeRightSideOfBinary(operatorKind, node.left, right); + node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.operatorToken) | propagateChildFlags(node.right); + if (operatorKind === 61) { + node.transformFlags |= 32; + } else if (operatorKind === 64) { + if (isObjectLiteralExpression(node.left)) { + node.transformFlags |= 1024 | 128 | 4096 | propagateAssignmentPatternFlags(node.left); + } else if (isArrayLiteralExpression(node.left)) { + node.transformFlags |= 1024 | 4096 | propagateAssignmentPatternFlags(node.left); + } + } else if (operatorKind === 43 || operatorKind === 68) { + node.transformFlags |= 512; + } else if (isLogicalOrCoalescingAssignmentOperator(operatorKind)) { + node.transformFlags |= 16; + } + if (operatorKind === 103 && isPrivateIdentifier(node.left)) { + node.transformFlags |= 536870912; + } + node.jsDoc = void 0; + return node; + } + function propagateAssignmentPatternFlags(node) { + return containsObjectRestOrSpread(node) ? 65536 : 0; + } + function updateBinaryExpression(node, left, operator, right) { + return node.left !== left || node.operatorToken !== operator || node.right !== right ? update2(createBinaryExpression(left, operator, right), node) : node; + } + function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { + const node = createBaseNode( + 227 + /* ConditionalExpression */ + ); + node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); + node.questionToken = questionToken ?? createToken( + 58 + /* QuestionToken */ + ); + node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); + node.colonToken = colonToken ?? createToken( + 59 + /* ColonToken */ + ); + node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); + node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); + return node; + } + function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { + return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update2(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; + } + function createTemplateExpression(head2, templateSpans) { + const node = createBaseNode( + 228 + /* TemplateExpression */ + ); + node.head = head2; + node.templateSpans = createNodeArray(templateSpans); + node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024; + return node; + } + function updateTemplateExpression(node, head2, templateSpans) { + return node.head !== head2 || node.templateSpans !== templateSpans ? update2(createTemplateExpression(head2, templateSpans), node) : node; + } + function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0) { + Debug.assert(!(templateFlags & ~7176), "Unsupported template flags."); + let cooked = void 0; + if (rawText !== void 0 && rawText !== text) { + cooked = getCookedText(kind, rawText); + if (typeof cooked === "object") { + return Debug.fail("Invalid raw text"); + } + } + if (text === void 0) { + if (cooked === void 0) { + return Debug.fail("Arguments 'text' and 'rawText' may not both be undefined."); + } + text = cooked; + } else if (cooked !== void 0) { + Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'."); + } + return text; + } + function getTransformFlagsOfTemplateLiteralLike(templateFlags) { + let transformFlags = 1024; + if (templateFlags) { + transformFlags |= 128; + } + return transformFlags; + } + function createTemplateLiteralLikeToken(kind, text, rawText, templateFlags) { + const node = createBaseToken(kind); + node.text = text; + node.rawText = rawText; + node.templateFlags = templateFlags & 7176; + node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags); + return node; + } + function createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags) { + const node = createBaseDeclaration(kind); + node.text = text; + node.rawText = rawText; + node.templateFlags = templateFlags & 7176; + node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags); + return node; + } + function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) { + if (kind === 15) { + return createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags); + } + return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags); + } + function createTemplateHead(text, rawText, templateFlags) { + text = checkTemplateLiteralLikeNode(16, text, rawText, templateFlags); + return createTemplateLiteralLikeNode(16, text, rawText, templateFlags); + } + function createTemplateMiddle(text, rawText, templateFlags) { + text = checkTemplateLiteralLikeNode(16, text, rawText, templateFlags); + return createTemplateLiteralLikeNode(17, text, rawText, templateFlags); + } + function createTemplateTail(text, rawText, templateFlags) { + text = checkTemplateLiteralLikeNode(16, text, rawText, templateFlags); + return createTemplateLiteralLikeNode(18, text, rawText, templateFlags); + } + function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { + text = checkTemplateLiteralLikeNode(16, text, rawText, templateFlags); + return createTemplateLiteralLikeDeclaration(15, text, rawText, templateFlags); + } + function createYieldExpression(asteriskToken, expression) { + Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); + const node = createBaseNode( + 229 + /* YieldExpression */ + ); + node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.asteriskToken = asteriskToken; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 | 128 | 1048576; + return node; + } + function updateYieldExpression(node, asteriskToken, expression) { + return node.expression !== expression || node.asteriskToken !== asteriskToken ? update2(createYieldExpression(asteriskToken, expression), node) : node; + } + function createSpreadElement(expression) { + const node = createBaseNode( + 230 + /* SpreadElement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 1024 | 32768; + return node; + } + function updateSpreadElement(node, expression) { + return node.expression !== expression ? update2(createSpreadElement(expression), node) : node; + } + function createClassExpression(modifiers, name2, typeParameters, heritageClauses, members) { + const node = createBaseDeclaration( + 231 + /* ClassExpression */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); + node.members = createNodeArray(members); + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 : 0) | 1024; + node.jsDoc = void 0; + return node; + } + function updateClassExpression(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update2(createClassExpression(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function createOmittedExpression() { + return createBaseNode( + 232 + /* OmittedExpression */ + ); + } + function createExpressionWithTypeArguments(expression, typeArguments) { + const node = createBaseNode( + 233 + /* ExpressionWithTypeArguments */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024; + return node; + } + function updateExpressionWithTypeArguments(node, expression, typeArguments) { + return node.expression !== expression || node.typeArguments !== typeArguments ? update2(createExpressionWithTypeArguments(expression, typeArguments), node) : node; + } + function createAsExpression(expression, type3) { + const node = createBaseNode( + 234 + /* AsExpression */ + ); + node.expression = expression; + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateAsExpression(node, expression, type3) { + return node.expression !== expression || node.type !== type3 ? update2(createAsExpression(expression, type3), node) : node; + } + function createNonNullExpression(expression) { + const node = createBaseNode( + 235 + /* NonNullExpression */ + ); + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1; + return node; + } + function updateNonNullExpression(node, expression) { + if (isNonNullChain(node)) { + return updateNonNullChain(node, expression); + } + return node.expression !== expression ? update2(createNonNullExpression(expression), node) : node; + } + function createSatisfiesExpression(expression, type3) { + const node = createBaseNode( + 238 + /* SatisfiesExpression */ + ); + node.expression = expression; + node.type = type3; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1; + return node; + } + function updateSatisfiesExpression(node, expression, type3) { + return node.expression !== expression || node.type !== type3 ? update2(createSatisfiesExpression(expression, type3), node) : node; + } + function createNonNullChain(expression) { + const node = createBaseNode( + 235 + /* NonNullExpression */ + ); + node.flags |= 64; + node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + true + ); + node.transformFlags |= propagateChildFlags(node.expression) | 1; + return node; + } + function updateNonNullChain(node, expression) { + Debug.assert(!!(node.flags & 64), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); + return node.expression !== expression ? update2(createNonNullChain(expression), node) : node; + } + function createMetaProperty(keywordToken, name2) { + const node = createBaseNode( + 236 + /* MetaProperty */ + ); + node.keywordToken = keywordToken; + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name); + switch (keywordToken) { + case 105: + node.transformFlags |= 1024; + break; + case 102: + node.transformFlags |= 32; + break; + default: + return Debug.assertNever(keywordToken); + } + node.flowNode = void 0; + return node; + } + function updateMetaProperty(node, name2) { + return node.name !== name2 ? update2(createMetaProperty(node.keywordToken, name2), node) : node; + } + function createTemplateSpan(expression, literal) { + const node = createBaseNode( + 239 + /* TemplateSpan */ + ); + node.expression = expression; + node.literal = literal; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024; + return node; + } + function updateTemplateSpan(node, expression, literal) { + return node.expression !== expression || node.literal !== literal ? update2(createTemplateSpan(expression, literal), node) : node; + } + function createSemicolonClassElement() { + const node = createBaseNode( + 240 + /* SemicolonClassElement */ + ); + node.transformFlags |= 1024; + return node; + } + function createBlock(statements, multiLine) { + const node = createBaseNode( + 241 + /* Block */ + ); + node.statements = createNodeArray(statements); + node.multiLine = multiLine; + node.transformFlags |= propagateChildrenFlags(node.statements); + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateBlock(node, statements) { + return node.statements !== statements ? update2(createBlock(statements, node.multiLine), node) : node; + } + function createVariableStatement(modifiers, declarationList) { + const node = createBaseNode( + 243 + /* VariableStatement */ + ); + node.modifiers = asNodeArray(modifiers); + node.declarationList = isArray3(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); + if (modifiersToFlags(node.modifiers) & 128) { + node.transformFlags = 1; + } + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateVariableStatement(node, modifiers, declarationList) { + return node.modifiers !== modifiers || node.declarationList !== declarationList ? update2(createVariableStatement(modifiers, declarationList), node) : node; + } + function createEmptyStatement() { + const node = createBaseNode( + 242 + /* EmptyStatement */ + ); + node.jsDoc = void 0; + return node; + } + function createExpressionStatement(expression) { + const node = createBaseNode( + 244 + /* ExpressionStatement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); + node.transformFlags |= propagateChildFlags(node.expression); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateExpressionStatement(node, expression) { + return node.expression !== expression ? update2(createExpressionStatement(expression), node) : node; + } + function createIfStatement(expression, thenStatement, elseStatement) { + const node = createBaseNode( + 245 + /* IfStatement */ + ); + node.expression = expression; + node.thenStatement = asEmbeddedStatement(thenStatement); + node.elseStatement = asEmbeddedStatement(elseStatement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateIfStatement(node, expression, thenStatement, elseStatement) { + return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update2(createIfStatement(expression, thenStatement, elseStatement), node) : node; + } + function createDoStatement(statement, expression) { + const node = createBaseNode( + 246 + /* DoStatement */ + ); + node.statement = asEmbeddedStatement(statement); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateDoStatement(node, statement, expression) { + return node.statement !== statement || node.expression !== expression ? update2(createDoStatement(statement, expression), node) : node; + } + function createWhileStatement(expression, statement) { + const node = createBaseNode( + 247 + /* WhileStatement */ + ); + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateWhileStatement(node, expression, statement) { + return node.expression !== expression || node.statement !== statement ? update2(createWhileStatement(expression, statement), node) : node; + } + function createForStatement(initializer, condition, incrementor, statement) { + const node = createBaseNode( + 248 + /* ForStatement */ + ); + node.initializer = initializer; + node.condition = condition; + node.incrementor = incrementor; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + return node; + } + function updateForStatement(node, initializer, condition, incrementor, statement) { + return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update2(createForStatement(initializer, condition, incrementor, statement), node) : node; + } + function createForInStatement(initializer, expression, statement) { + const node = createBaseNode( + 249 + /* ForInStatement */ + ); + node.initializer = initializer; + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + return node; + } + function updateForInStatement(node, initializer, expression, statement) { + return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update2(createForInStatement(initializer, expression, statement), node) : node; + } + function createForOfStatement(awaitModifier, initializer, expression, statement) { + const node = createBaseNode( + 250 + /* ForOfStatement */ + ); + node.awaitModifier = awaitModifier; + node.initializer = initializer; + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024; + if (awaitModifier) + node.transformFlags |= 128; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.flowNode = void 0; + return node; + } + function updateForOfStatement(node, awaitModifier, initializer, expression, statement) { + return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update2(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; + } + function createContinueStatement(label) { + const node = createBaseNode( + 251 + /* ContinueStatement */ + ); + node.label = asName(label); + node.transformFlags |= propagateChildFlags(node.label) | 4194304; + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateContinueStatement(node, label) { + return node.label !== label ? update2(createContinueStatement(label), node) : node; + } + function createBreakStatement(label) { + const node = createBaseNode( + 252 + /* BreakStatement */ + ); + node.label = asName(label); + node.transformFlags |= propagateChildFlags(node.label) | 4194304; + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateBreakStatement(node, label) { + return node.label !== label ? update2(createBreakStatement(label), node) : node; + } + function createReturnStatement(expression) { + const node = createBaseNode( + 253 + /* ReturnStatement */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression) | 128 | 4194304; + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateReturnStatement(node, expression) { + return node.expression !== expression ? update2(createReturnStatement(expression), node) : node; + } + function createWithStatement(expression, statement) { + const node = createBaseNode( + 254 + /* WithStatement */ + ); + node.expression = expression; + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateWithStatement(node, expression, statement) { + return node.expression !== expression || node.statement !== statement ? update2(createWithStatement(expression, statement), node) : node; + } + function createSwitchStatement(expression, caseBlock) { + const node = createBaseNode( + 255 + /* SwitchStatement */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.caseBlock = caseBlock; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); + node.jsDoc = void 0; + node.flowNode = void 0; + node.possiblyExhaustive = false; + return node; + } + function updateSwitchStatement(node, expression, caseBlock) { + return node.expression !== expression || node.caseBlock !== caseBlock ? update2(createSwitchStatement(expression, caseBlock), node) : node; + } + function createLabeledStatement(label, statement) { + const node = createBaseNode( + 256 + /* LabeledStatement */ + ); + node.label = asName(label); + node.statement = asEmbeddedStatement(statement); + node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateLabeledStatement(node, label, statement) { + return node.label !== label || node.statement !== statement ? update2(createLabeledStatement(label, statement), node) : node; + } + function createThrowStatement(expression) { + const node = createBaseNode( + 257 + /* ThrowStatement */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateThrowStatement(node, expression) { + return node.expression !== expression ? update2(createThrowStatement(expression), node) : node; + } + function createTryStatement(tryBlock, catchClause, finallyBlock) { + const node = createBaseNode( + 258 + /* TryStatement */ + ); + node.tryBlock = tryBlock; + node.catchClause = catchClause; + node.finallyBlock = finallyBlock; + node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { + return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update2(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; + } + function createDebuggerStatement() { + const node = createBaseNode( + 259 + /* DebuggerStatement */ + ); + node.jsDoc = void 0; + node.flowNode = void 0; + return node; + } + function createVariableDeclaration(name2, exclamationToken, type3, initializer) { + const node = createBaseDeclaration( + 260 + /* VariableDeclaration */ + ); + node.name = asName(name2); + node.exclamationToken = exclamationToken; + node.type = type3; + node.initializer = asInitializer(initializer); + node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.exclamationToken ?? node.type ? 1 : 0); + node.jsDoc = void 0; + return node; + } + function updateVariableDeclaration(node, name2, exclamationToken, type3, initializer) { + return node.name !== name2 || node.type !== type3 || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update2(createVariableDeclaration(name2, exclamationToken, type3, initializer), node) : node; + } + function createVariableDeclarationList(declarations, flags2 = 0) { + const node = createBaseNode( + 261 + /* VariableDeclarationList */ + ); + node.flags |= flags2 & 7; + node.declarations = createNodeArray(declarations); + node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304; + if (flags2 & 7) { + node.transformFlags |= 1024 | 262144; + } + if (flags2 & 4) { + node.transformFlags |= 4; + } + return node; + } + function updateVariableDeclarationList(node, declarations) { + return node.declarations !== declarations ? update2(createVariableDeclarationList(declarations, node.flags), node) : node; + } + function createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + const node = createBaseDeclaration( + 262 + /* FunctionDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.asteriskToken = asteriskToken; + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.body = body; + if (!node.body || modifiersToFlags(node.modifiers) & 128) { + node.transformFlags = 1; + } else { + const isAsync2 = modifiersToFlags(node.modifiers) & 1024; + const isGenerator = !!node.asteriskToken; + const isAsyncGenerator = isAsync2 && isGenerator; + node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 | (isAsyncGenerator ? 128 : isAsync2 ? 256 : isGenerator ? 2048 : 0) | (node.typeParameters || node.type ? 1 : 0) | 4194304; + } + node.typeArguments = void 0; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.endFlowNode = void 0; + node.returnFlowNode = void 0; + return node; + } + function updateFunctionDeclaration(node, modifiers, asteriskToken, name2, typeParameters, parameters, type3, body) { + return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name2 || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body), node) : node; + } + function finishUpdateFunctionDeclaration(updated, original) { + if (updated !== original) { + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } + } + return finishUpdateBaseSignatureDeclaration(updated, original); + } + function createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members) { + const node = createBaseDeclaration( + 263 + /* ClassDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); + node.members = createNodeArray(members); + if (modifiersToFlags(node.modifiers) & 128) { + node.transformFlags = 1; + } else { + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 : 0) | 1024; + if (node.transformFlags & 8192) { + node.transformFlags |= 1; + } + } + node.jsDoc = void 0; + return node; + } + function updateClassDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update2(createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members) { + const node = createBaseDeclaration( + 264 + /* InterfaceDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.heritageClauses = asNodeArray(heritageClauses); + node.members = createNodeArray(members); + node.transformFlags = 1; + node.jsDoc = void 0; + return node; + } + function updateInterfaceDeclaration(node, modifiers, name2, typeParameters, heritageClauses, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update2(createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members), node) : node; + } + function createTypeAliasDeclaration(modifiers, name2, typeParameters, type3) { + const node = createBaseDeclaration( + 265 + /* TypeAliasDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.typeParameters = asNodeArray(typeParameters); + node.type = type3; + node.transformFlags = 1; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateTypeAliasDeclaration(node, modifiers, name2, typeParameters, type3) { + return node.modifiers !== modifiers || node.name !== name2 || node.typeParameters !== typeParameters || node.type !== type3 ? update2(createTypeAliasDeclaration(modifiers, name2, typeParameters, type3), node) : node; + } + function createEnumDeclaration(modifiers, name2, members) { + const node = createBaseDeclaration( + 266 + /* EnumDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.members = createNodeArray(members); + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1; + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateEnumDeclaration(node, modifiers, name2, members) { + return node.modifiers !== modifiers || node.name !== name2 || node.members !== members ? update2(createEnumDeclaration(modifiers, name2, members), node) : node; + } + function createModuleDeclaration(modifiers, name2, body, flags2 = 0) { + const node = createBaseDeclaration( + 267 + /* ModuleDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.flags |= flags2 & (32 | 8 | 2048); + node.name = name2; + node.body = body; + if (modifiersToFlags(node.modifiers) & 128) { + node.transformFlags = 1; + } else { + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1; + } + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateModuleDeclaration(node, modifiers, name2, body) { + return node.modifiers !== modifiers || node.name !== name2 || node.body !== body ? update2(createModuleDeclaration(modifiers, name2, body, node.flags), node) : node; + } + function createModuleBlock(statements) { + const node = createBaseNode( + 268 + /* ModuleBlock */ + ); + node.statements = createNodeArray(statements); + node.transformFlags |= propagateChildrenFlags(node.statements); + node.jsDoc = void 0; + return node; + } + function updateModuleBlock(node, statements) { + return node.statements !== statements ? update2(createModuleBlock(statements), node) : node; + } + function createCaseBlock(clauses) { + const node = createBaseNode( + 269 + /* CaseBlock */ + ); + node.clauses = createNodeArray(clauses); + node.transformFlags |= propagateChildrenFlags(node.clauses); + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateCaseBlock(node, clauses) { + return node.clauses !== clauses ? update2(createCaseBlock(clauses), node) : node; + } + function createNamespaceExportDeclaration(name2) { + const node = createBaseDeclaration( + 270 + /* NamespaceExportDeclaration */ + ); + node.name = asName(name2); + node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1; + node.modifiers = void 0; + node.jsDoc = void 0; + return node; + } + function updateNamespaceExportDeclaration(node, name2) { + return node.name !== name2 ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name2), node) : node; + } + function finishUpdateNamespaceExportDeclaration(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + } + return update2(updated, original); + } + function createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference) { + const node = createBaseDeclaration( + 271 + /* ImportEqualsDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.name = asName(name2); + node.isTypeOnly = isTypeOnly; + node.moduleReference = moduleReference; + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.moduleReference); + if (!isExternalModuleReference(node.moduleReference)) { + node.transformFlags |= 1; + } + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name2, moduleReference) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name2 || node.moduleReference !== moduleReference ? update2(createImportEqualsDeclaration(modifiers, isTypeOnly, name2, moduleReference), node) : node; + } + function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) { + const node = createBaseNode( + 272 + /* ImportDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.importClause = importClause; + node.moduleSpecifier = moduleSpecifier; + node.attributes = node.assertClause = attributes; + node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) { + return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update2(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; + } + function createImportClause(isTypeOnly, name2, namedBindings) { + const node = createBaseDeclaration( + 273 + /* ImportClause */ + ); + node.isTypeOnly = isTypeOnly; + node.name = name2; + node.namedBindings = namedBindings; + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); + if (isTypeOnly) { + node.transformFlags |= 1; + } + node.transformFlags &= ~67108864; + return node; + } + function updateImportClause(node, isTypeOnly, name2, namedBindings) { + return node.isTypeOnly !== isTypeOnly || node.name !== name2 || node.namedBindings !== namedBindings ? update2(createImportClause(isTypeOnly, name2, namedBindings), node) : node; + } + function createAssertClause(elements, multiLine) { + const node = createBaseNode( + 300 + /* AssertClause */ + ); + node.elements = createNodeArray(elements); + node.multiLine = multiLine; + node.token = 132; + node.transformFlags |= 4; + return node; + } + function updateAssertClause(node, elements, multiLine) { + return node.elements !== elements || node.multiLine !== multiLine ? update2(createAssertClause(elements, multiLine), node) : node; + } + function createAssertEntry(name2, value2) { + const node = createBaseNode( + 301 + /* AssertEntry */ + ); + node.name = name2; + node.value = value2; + node.transformFlags |= 4; + return node; + } + function updateAssertEntry(node, name2, value2) { + return node.name !== name2 || node.value !== value2 ? update2(createAssertEntry(name2, value2), node) : node; + } + function createImportTypeAssertionContainer(clause, multiLine) { + const node = createBaseNode( + 302 + /* ImportTypeAssertionContainer */ + ); + node.assertClause = clause; + node.multiLine = multiLine; + return node; + } + function updateImportTypeAssertionContainer(node, clause, multiLine) { + return node.assertClause !== clause || node.multiLine !== multiLine ? update2(createImportTypeAssertionContainer(clause, multiLine), node) : node; + } + function createImportAttributes(elements, multiLine, token) { + const node = createBaseNode( + 300 + /* ImportAttributes */ + ); + node.token = token ?? 118; + node.elements = createNodeArray(elements); + node.multiLine = multiLine; + node.transformFlags |= 4; + return node; + } + function updateImportAttributes(node, elements, multiLine) { + return node.elements !== elements || node.multiLine !== multiLine ? update2(createImportAttributes(elements, multiLine, node.token), node) : node; + } + function createImportAttribute(name2, value2) { + const node = createBaseNode( + 301 + /* ImportAttribute */ + ); + node.name = name2; + node.value = value2; + node.transformFlags |= 4; + return node; + } + function updateImportAttribute(node, name2, value2) { + return node.name !== name2 || node.value !== value2 ? update2(createImportAttribute(name2, value2), node) : node; + } + function createNamespaceImport(name2) { + const node = createBaseDeclaration( + 274 + /* NamespaceImport */ + ); + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + return node; + } + function updateNamespaceImport(node, name2) { + return node.name !== name2 ? update2(createNamespaceImport(name2), node) : node; + } + function createNamespaceExport(name2) { + const node = createBaseDeclaration( + 280 + /* NamespaceExport */ + ); + node.name = name2; + node.transformFlags |= propagateChildFlags(node.name) | 32; + node.transformFlags &= ~67108864; + return node; + } + function updateNamespaceExport(node, name2) { + return node.name !== name2 ? update2(createNamespaceExport(name2), node) : node; + } + function createNamedImports(elements) { + const node = createBaseNode( + 275 + /* NamedImports */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements); + node.transformFlags &= ~67108864; + return node; + } + function updateNamedImports(node, elements) { + return node.elements !== elements ? update2(createNamedImports(elements), node) : node; + } + function createImportSpecifier(isTypeOnly, propertyName, name2) { + const node = createBaseDeclaration( + 276 + /* ImportSpecifier */ + ); + node.isTypeOnly = isTypeOnly; + node.propertyName = propertyName; + node.name = name2; + node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + return node; + } + function updateImportSpecifier(node, isTypeOnly, propertyName, name2) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name2 ? update2(createImportSpecifier(isTypeOnly, propertyName, name2), node) : node; + } + function createExportAssignment2(modifiers, isExportEquals, expression) { + const node = createBaseDeclaration( + 277 + /* ExportAssignment */ + ); + node.modifiers = asNodeArray(modifiers); + node.isExportEquals = isExportEquals; + node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary( + 64, + /*leftSide*/ + void 0, + expression + ) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateExportAssignment(node, modifiers, expression) { + return node.modifiers !== modifiers || node.expression !== expression ? update2(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node; + } + function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { + const node = createBaseDeclaration( + 278 + /* ExportDeclaration */ + ); + node.modifiers = asNodeArray(modifiers); + node.isTypeOnly = isTypeOnly; + node.exportClause = exportClause; + node.moduleSpecifier = moduleSpecifier; + node.attributes = node.assertClause = attributes; + node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) { + return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node; + } + function finishUpdateExportDeclaration(updated, original) { + if (updated !== original) { + if (updated.modifiers === original.modifiers) { + updated.modifiers = original.modifiers; + } + } + return update2(updated, original); + } + function createNamedExports(elements) { + const node = createBaseNode( + 279 + /* NamedExports */ + ); + node.elements = createNodeArray(elements); + node.transformFlags |= propagateChildrenFlags(node.elements); + node.transformFlags &= ~67108864; + return node; + } + function updateNamedExports(node, elements) { + return node.elements !== elements ? update2(createNamedExports(elements), node) : node; + } + function createExportSpecifier(isTypeOnly, propertyName, name2) { + const node = createBaseNode( + 281 + /* ExportSpecifier */ + ); + node.isTypeOnly = isTypeOnly; + node.propertyName = asName(propertyName); + node.name = asName(name2); + node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); + node.transformFlags &= ~67108864; + node.jsDoc = void 0; + return node; + } + function updateExportSpecifier(node, isTypeOnly, propertyName, name2) { + return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name2 ? update2(createExportSpecifier(isTypeOnly, propertyName, name2), node) : node; + } + function createMissingDeclaration() { + const node = createBaseDeclaration( + 282 + /* MissingDeclaration */ + ); + node.jsDoc = void 0; + return node; + } + function createExternalModuleReference(expression) { + const node = createBaseNode( + 283 + /* ExternalModuleReference */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression); + node.transformFlags &= ~67108864; + return node; + } + function updateExternalModuleReference(node, expression) { + return node.expression !== expression ? update2(createExternalModuleReference(expression), node) : node; + } + function createJSDocPrimaryTypeWorker(kind) { + return createBaseNode(kind); + } + function createJSDocPrePostfixUnaryTypeWorker(kind, type3, postfix = false) { + const node = createJSDocUnaryTypeWorker( + kind, + postfix ? type3 && parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(type3) : type3 + ); + node.postfix = postfix; + return node; + } + function createJSDocUnaryTypeWorker(kind, type3) { + const node = createBaseNode(kind); + node.type = type3; + return node; + } + function updateJSDocPrePostfixUnaryTypeWorker(kind, node, type3) { + return node.type !== type3 ? update2(createJSDocPrePostfixUnaryTypeWorker(kind, type3, node.postfix), node) : node; + } + function updateJSDocUnaryTypeWorker(kind, node, type3) { + return node.type !== type3 ? update2(createJSDocUnaryTypeWorker(kind, type3), node) : node; + } + function createJSDocFunctionType(parameters, type3) { + const node = createBaseDeclaration( + 324 + /* JSDocFunctionType */ + ); + node.parameters = asNodeArray(parameters); + node.type = type3; + node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 : 0); + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + node.typeArguments = void 0; + return node; + } + function updateJSDocFunctionType(node, parameters, type3) { + return node.parameters !== parameters || node.type !== type3 ? update2(createJSDocFunctionType(parameters, type3), node) : node; + } + function createJSDocTypeLiteral(propertyTags, isArrayType = false) { + const node = createBaseDeclaration( + 329 + /* JSDocTypeLiteral */ + ); + node.jsDocPropertyTags = asNodeArray(propertyTags); + node.isArrayType = isArrayType; + return node; + } + function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { + return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update2(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; + } + function createJSDocTypeExpression(type3) { + const node = createBaseNode( + 316 + /* JSDocTypeExpression */ + ); + node.type = type3; + return node; + } + function updateJSDocTypeExpression(node, type3) { + return node.type !== type3 ? update2(createJSDocTypeExpression(type3), node) : node; + } + function createJSDocSignature(typeParameters, parameters, type3) { + const node = createBaseDeclaration( + 330 + /* JSDocSignature */ + ); + node.typeParameters = asNodeArray(typeParameters); + node.parameters = createNodeArray(parameters); + node.type = type3; + node.jsDoc = void 0; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateJSDocSignature(node, typeParameters, parameters, type3) { + return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type3 ? update2(createJSDocSignature(typeParameters, parameters, type3), node) : node; + } + function getDefaultTagName(node) { + const defaultTagName = getDefaultTagNameForKind(node.kind); + return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); + } + function createBaseJSDocTag(kind, tagName, comment) { + const node = createBaseNode(kind); + node.tagName = tagName; + node.comment = comment; + return node; + } + function createBaseJSDocTagDeclaration(kind, tagName, comment) { + const node = createBaseDeclaration(kind); + node.tagName = tagName; + node.comment = comment; + return node; + } + function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { + const node = createBaseJSDocTag(352, tagName ?? createIdentifier("template"), comment); + node.constraint = constraint; + node.typeParameters = createNodeArray(typeParameters); + return node; + } + function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { + return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update2(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; + } + function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(353, tagName ?? createIdentifier("typedef"), comment); + node.typeExpression = typeExpression; + node.fullName = fullName; + node.name = getJSDocTypeAliasName(fullName); + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update2(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; + } + function createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(348, tagName ?? createIdentifier("param"), comment); + node.typeExpression = typeExpression; + node.name = name2; + node.isNameFirst = !!isNameFirst; + node.isBracketed = isBracketed; + return node; + } + function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name2, isBracketed, typeExpression, isNameFirst, comment) { + return node.tagName !== tagName || node.name !== name2 || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update2(createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment), node) : node; + } + function createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) { + const node = createBaseJSDocTagDeclaration(355, tagName ?? createIdentifier("prop"), comment); + node.typeExpression = typeExpression; + node.name = name2; + node.isNameFirst = !!isNameFirst; + node.isBracketed = isBracketed; + return node; + } + function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name2, isBracketed, typeExpression, isNameFirst, comment) { + return node.tagName !== tagName || node.name !== name2 || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update2(createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment), node) : node; + } + function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { + const node = createBaseJSDocTagDeclaration(345, tagName ?? createIdentifier("callback"), comment); + node.typeExpression = typeExpression; + node.fullName = fullName; + node.name = getJSDocTypeAliasName(fullName); + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update2(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; + } + function createJSDocOverloadTag(tagName, typeExpression, comment) { + const node = createBaseJSDocTag(346, tagName ?? createIdentifier("overload"), comment); + node.typeExpression = typeExpression; + return node; + } + function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update2(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node; + } + function createJSDocAugmentsTag(tagName, className, comment) { + const node = createBaseJSDocTag(335, tagName ?? createIdentifier("augments"), comment); + node.class = className; + return node; + } + function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update2(createJSDocAugmentsTag(tagName, className, comment), node) : node; + } + function createJSDocImplementsTag(tagName, className, comment) { + const node = createBaseJSDocTag(336, tagName ?? createIdentifier("implements"), comment); + node.class = className; + return node; + } + function createJSDocSeeTag(tagName, name2, comment) { + const node = createBaseJSDocTag(354, tagName ?? createIdentifier("see"), comment); + node.name = name2; + return node; + } + function updateJSDocSeeTag(node, tagName, name2, comment) { + return node.tagName !== tagName || node.name !== name2 || node.comment !== comment ? update2(createJSDocSeeTag(tagName, name2, comment), node) : node; + } + function createJSDocNameReference(name2) { + const node = createBaseNode( + 317 + /* JSDocNameReference */ + ); + node.name = name2; + return node; + } + function updateJSDocNameReference(node, name2) { + return node.name !== name2 ? update2(createJSDocNameReference(name2), node) : node; + } + function createJSDocMemberName(left, right) { + const node = createBaseNode( + 318 + /* JSDocMemberName */ + ); + node.left = left; + node.right = right; + node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); + return node; + } + function updateJSDocMemberName(node, left, right) { + return node.left !== left || node.right !== right ? update2(createJSDocMemberName(left, right), node) : node; + } + function createJSDocLink(name2, text) { + const node = createBaseNode( + 331 + /* JSDocLink */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLink(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLink(name2, text), node) : node; + } + function createJSDocLinkCode(name2, text) { + const node = createBaseNode( + 332 + /* JSDocLinkCode */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLinkCode(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLinkCode(name2, text), node) : node; + } + function createJSDocLinkPlain(name2, text) { + const node = createBaseNode( + 333 + /* JSDocLinkPlain */ + ); + node.name = name2; + node.text = text; + return node; + } + function updateJSDocLinkPlain(node, name2, text) { + return node.name !== name2 ? update2(createJSDocLinkPlain(name2, text), node) : node; + } + function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { + return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update2(createJSDocImplementsTag(tagName, className, comment), node) : node; + } + function createJSDocSimpleTagWorker(kind, tagName, comment) { + const node = createBaseJSDocTag(kind, tagName ?? createIdentifier(getDefaultTagNameForKind(kind)), comment); + return node; + } + function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { + return node.tagName !== tagName || node.comment !== comment ? update2(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; + } + function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { + const node = createBaseJSDocTag(kind, tagName ?? createIdentifier(getDefaultTagNameForKind(kind)), comment); + node.typeExpression = typeExpression; + return node; + } + function updateJSDocTypeLikeTagWorker(kind, node, tagName = getDefaultTagName(node), typeExpression, comment) { + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update2(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; + } + function createJSDocUnknownTag(tagName, comment) { + const node = createBaseJSDocTag(334, tagName, comment); + return node; + } + function updateJSDocUnknownTag(node, tagName, comment) { + return node.tagName !== tagName || node.comment !== comment ? update2(createJSDocUnknownTag(tagName, comment), node) : node; + } + function createJSDocEnumTag(tagName, typeExpression, comment) { + const node = createBaseJSDocTagDeclaration(347, tagName ?? createIdentifier(getDefaultTagNameForKind( + 347 + /* JSDocEnumTag */ + )), comment); + node.typeExpression = typeExpression; + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) { + return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update2(createJSDocEnumTag(tagName, typeExpression, comment), node) : node; + } + function createJSDocText(text) { + const node = createBaseNode( + 328 + /* JSDocText */ + ); + node.text = text; + return node; + } + function updateJSDocText(node, text) { + return node.text !== text ? update2(createJSDocText(text), node) : node; + } + function createJSDocComment(comment, tags6) { + const node = createBaseNode( + 327 + /* JSDoc */ + ); + node.comment = comment; + node.tags = asNodeArray(tags6); + return node; + } + function updateJSDocComment(node, comment, tags6) { + return node.comment !== comment || node.tags !== tags6 ? update2(createJSDocComment(comment, tags6), node) : node; + } + function createJsxElement(openingElement, children, closingElement) { + const node = createBaseNode( + 284 + /* JsxElement */ + ); + node.openingElement = openingElement; + node.children = createNodeArray(children); + node.closingElement = closingElement; + node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2; + return node; + } + function updateJsxElement(node, openingElement, children, closingElement) { + return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update2(createJsxElement(openingElement, children, closingElement), node) : node; + } + function createJsxSelfClosingElement(tagName, typeArguments, attributes) { + const node = createBaseNode( + 285 + /* JsxSelfClosingElement */ + ); + node.tagName = tagName; + node.typeArguments = asNodeArray(typeArguments); + node.attributes = attributes; + node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2; + if (node.typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update2(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; + } + function createJsxOpeningElement(tagName, typeArguments, attributes) { + const node = createBaseNode( + 286 + /* JsxOpeningElement */ + ); + node.tagName = tagName; + node.typeArguments = asNodeArray(typeArguments); + node.attributes = attributes; + node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2; + if (typeArguments) { + node.transformFlags |= 1; + } + return node; + } + function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { + return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update2(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; + } + function createJsxClosingElement(tagName) { + const node = createBaseNode( + 287 + /* JsxClosingElement */ + ); + node.tagName = tagName; + node.transformFlags |= propagateChildFlags(node.tagName) | 2; + return node; + } + function updateJsxClosingElement(node, tagName) { + return node.tagName !== tagName ? update2(createJsxClosingElement(tagName), node) : node; + } + function createJsxFragment(openingFragment, children, closingFragment) { + const node = createBaseNode( + 288 + /* JsxFragment */ + ); + node.openingFragment = openingFragment; + node.children = createNodeArray(children); + node.closingFragment = closingFragment; + node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2; + return node; + } + function updateJsxFragment(node, openingFragment, children, closingFragment) { + return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update2(createJsxFragment(openingFragment, children, closingFragment), node) : node; + } + function createJsxText(text, containsOnlyTriviaWhiteSpaces) { + const node = createBaseNode( + 12 + /* JsxText */ + ); + node.text = text; + node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; + node.transformFlags |= 2; + return node; + } + function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { + return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update2(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; + } + function createJsxOpeningFragment() { + const node = createBaseNode( + 289 + /* JsxOpeningFragment */ + ); + node.transformFlags |= 2; + return node; + } + function createJsxJsxClosingFragment() { + const node = createBaseNode( + 290 + /* JsxClosingFragment */ + ); + node.transformFlags |= 2; + return node; + } + function createJsxAttribute(name2, initializer) { + const node = createBaseDeclaration( + 291 + /* JsxAttribute */ + ); + node.name = name2; + node.initializer = initializer; + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2; + return node; + } + function updateJsxAttribute(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? update2(createJsxAttribute(name2, initializer), node) : node; + } + function createJsxAttributes(properties) { + const node = createBaseDeclaration( + 292 + /* JsxAttributes */ + ); + node.properties = createNodeArray(properties); + node.transformFlags |= propagateChildrenFlags(node.properties) | 2; + return node; + } + function updateJsxAttributes(node, properties) { + return node.properties !== properties ? update2(createJsxAttributes(properties), node) : node; + } + function createJsxSpreadAttribute(expression) { + const node = createBaseNode( + 293 + /* JsxSpreadAttribute */ + ); + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.expression) | 2; + return node; + } + function updateJsxSpreadAttribute(node, expression) { + return node.expression !== expression ? update2(createJsxSpreadAttribute(expression), node) : node; + } + function createJsxExpression(dotDotDotToken, expression) { + const node = createBaseNode( + 294 + /* JsxExpression */ + ); + node.dotDotDotToken = dotDotDotToken; + node.expression = expression; + node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2; + return node; + } + function updateJsxExpression(node, expression) { + return node.expression !== expression ? update2(createJsxExpression(node.dotDotDotToken, expression), node) : node; + } + function createJsxNamespacedName(namespace, name2) { + const node = createBaseNode( + 295 + /* JsxNamespacedName */ + ); + node.namespace = namespace; + node.name = name2; + node.transformFlags |= propagateChildFlags(node.namespace) | propagateChildFlags(node.name) | 2; + return node; + } + function updateJsxNamespacedName(node, namespace, name2) { + return node.namespace !== namespace || node.name !== name2 ? update2(createJsxNamespacedName(namespace, name2), node) : node; + } + function createCaseClause(expression, statements) { + const node = createBaseNode( + 296 + /* CaseClause */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.statements = createNodeArray(statements); + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); + node.jsDoc = void 0; + return node; + } + function updateCaseClause(node, expression, statements) { + return node.expression !== expression || node.statements !== statements ? update2(createCaseClause(expression, statements), node) : node; + } + function createDefaultClause(statements) { + const node = createBaseNode( + 297 + /* DefaultClause */ + ); + node.statements = createNodeArray(statements); + node.transformFlags = propagateChildrenFlags(node.statements); + return node; + } + function updateDefaultClause(node, statements) { + return node.statements !== statements ? update2(createDefaultClause(statements), node) : node; + } + function createHeritageClause(token, types3) { + const node = createBaseNode( + 298 + /* HeritageClause */ + ); + node.token = token; + node.types = createNodeArray(types3); + node.transformFlags |= propagateChildrenFlags(node.types); + switch (token) { + case 96: + node.transformFlags |= 1024; + break; + case 119: + node.transformFlags |= 1; + break; + default: + return Debug.assertNever(token); + } + return node; + } + function updateHeritageClause(node, types3) { + return node.types !== types3 ? update2(createHeritageClause(node.token, types3), node) : node; + } + function createCatchClause(variableDeclaration, block) { + const node = createBaseNode( + 299 + /* CatchClause */ + ); + node.variableDeclaration = asVariableDeclaration(variableDeclaration); + node.block = block; + node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 : 0); + node.locals = void 0; + node.nextContainer = void 0; + return node; + } + function updateCatchClause(node, variableDeclaration, block) { + return node.variableDeclaration !== variableDeclaration || node.block !== block ? update2(createCatchClause(variableDeclaration, block), node) : node; + } + function createPropertyAssignment(name2, initializer) { + const node = createBaseDeclaration( + 303 + /* PropertyAssignment */ + ); + node.name = asName(name2); + node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); + node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer); + node.modifiers = void 0; + node.questionToken = void 0; + node.exclamationToken = void 0; + node.jsDoc = void 0; + return node; + } + function updatePropertyAssignment(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name2, initializer), node) : node; + } + function finishUpdatePropertyAssignment(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + updated.questionToken = original.questionToken; + updated.exclamationToken = original.exclamationToken; + } + return update2(updated, original); + } + function createShorthandPropertyAssignment(name2, objectAssignmentInitializer) { + const node = createBaseDeclaration( + 304 + /* ShorthandPropertyAssignment */ + ); + node.name = asName(name2); + node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); + node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024; + node.equalsToken = void 0; + node.modifiers = void 0; + node.questionToken = void 0; + node.exclamationToken = void 0; + node.jsDoc = void 0; + return node; + } + function updateShorthandPropertyAssignment(node, name2, objectAssignmentInitializer) { + return node.name !== name2 || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name2, objectAssignmentInitializer), node) : node; + } + function finishUpdateShorthandPropertyAssignment(updated, original) { + if (updated !== original) { + updated.modifiers = original.modifiers; + updated.questionToken = original.questionToken; + updated.exclamationToken = original.exclamationToken; + updated.equalsToken = original.equalsToken; + } + return update2(updated, original); + } + function createSpreadAssignment(expression) { + const node = createBaseDeclaration( + 305 + /* SpreadAssignment */ + ); + node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); + node.transformFlags |= propagateChildFlags(node.expression) | 128 | 65536; + node.jsDoc = void 0; + return node; + } + function updateSpreadAssignment(node, expression) { + return node.expression !== expression ? update2(createSpreadAssignment(expression), node) : node; + } + function createEnumMember(name2, initializer) { + const node = createBaseDeclaration( + 306 + /* EnumMember */ + ); + node.name = asName(name2); + node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); + node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1; + node.jsDoc = void 0; + return node; + } + function updateEnumMember(node, name2, initializer) { + return node.name !== name2 || node.initializer !== initializer ? update2(createEnumMember(name2, initializer), node) : node; + } + function createSourceFile2(statements, endOfFileToken, flags2) { + const node = baseFactory2.createBaseSourceFileNode( + 312 + /* SourceFile */ + ); + node.statements = createNodeArray(statements); + node.endOfFileToken = endOfFileToken; + node.flags |= flags2; + node.text = ""; + node.fileName = ""; + node.path = ""; + node.resolvedPath = ""; + node.originalFileName = ""; + node.languageVersion = 0; + node.languageVariant = 0; + node.scriptKind = 0; + node.isDeclarationFile = false; + node.hasNoDefaultLib = false; + node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); + node.locals = void 0; + node.nextContainer = void 0; + node.endFlowNode = void 0; + node.nodeCount = 0; + node.identifierCount = 0; + node.symbolCount = 0; + node.parseDiagnostics = void 0; + node.bindDiagnostics = void 0; + node.bindSuggestionDiagnostics = void 0; + node.lineMap = void 0; + node.externalModuleIndicator = void 0; + node.setExternalModuleIndicator = void 0; + node.pragmas = void 0; + node.checkJsDirective = void 0; + node.referencedFiles = void 0; + node.typeReferenceDirectives = void 0; + node.libReferenceDirectives = void 0; + node.amdDependencies = void 0; + node.commentDirectives = void 0; + node.identifiers = void 0; + node.packageJsonLocations = void 0; + node.packageJsonScope = void 0; + node.imports = void 0; + node.moduleAugmentations = void 0; + node.ambientModuleNames = void 0; + node.classifiableNames = void 0; + node.impliedNodeFormat = void 0; + return node; + } + function createRedirectedSourceFile(redirectInfo) { + const node = Object.create(redirectInfo.redirectTarget); + Object.defineProperties(node, { + id: { + get() { + return this.redirectInfo.redirectTarget.id; + }, + set(value2) { + this.redirectInfo.redirectTarget.id = value2; + } + }, + symbol: { + get() { + return this.redirectInfo.redirectTarget.symbol; + }, + set(value2) { + this.redirectInfo.redirectTarget.symbol = value2; + } + } + }); + node.redirectInfo = redirectInfo; + return node; + } + function cloneRedirectedSourceFile(source) { + const node = createRedirectedSourceFile(source.redirectInfo); + node.flags |= source.flags & ~16; + node.fileName = source.fileName; + node.path = source.path; + node.resolvedPath = source.resolvedPath; + node.originalFileName = source.originalFileName; + node.packageJsonLocations = source.packageJsonLocations; + node.packageJsonScope = source.packageJsonScope; + node.emitNode = void 0; + return node; + } + function cloneSourceFileWorker(source) { + const node = baseFactory2.createBaseSourceFileNode( + 312 + /* SourceFile */ + ); + node.flags |= source.flags & ~16; + for (const p7 in source) { + if (hasProperty(node, p7) || !hasProperty(source, p7)) { + continue; + } + if (p7 === "emitNode") { + node.emitNode = void 0; + continue; + } + node[p7] = source[p7]; + } + return node; + } + function cloneSourceFile(source) { + const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source); + setOriginal(node, source); + return node; + } + function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { + const node = cloneSourceFile(source); + node.statements = createNodeArray(statements); + node.isDeclarationFile = isDeclarationFile; + node.referencedFiles = referencedFiles; + node.typeReferenceDirectives = typeReferences; + node.hasNoDefaultLib = hasNoDefaultLib; + node.libReferenceDirectives = libReferences; + node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); + return node; + } + function updateSourceFile2(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { + return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update2(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; + } + function createBundle(sourceFiles, prepends = emptyArray) { + const node = createBaseNode( + 313 + /* Bundle */ + ); + node.prepends = prepends; + node.sourceFiles = sourceFiles; + node.syntheticFileReferences = void 0; + node.syntheticTypeReferences = void 0; + node.syntheticLibReferences = void 0; + node.hasNoDefaultLib = void 0; + return node; + } + function updateBundle(node, sourceFiles, prepends = emptyArray) { + return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update2(createBundle(sourceFiles, prepends), node) : node; + } + function createUnparsedSource(prologues, syntheticReferences, texts) { + const node = createBaseNode( + 314 + /* UnparsedSource */ + ); + node.prologues = prologues; + node.syntheticReferences = syntheticReferences; + node.texts = texts; + node.fileName = ""; + node.text = ""; + node.referencedFiles = emptyArray; + node.libReferenceDirectives = emptyArray; + node.getLineAndCharacterOfPosition = (pos) => getLineAndCharacterOfPosition(node, pos); + return node; + } + function createBaseUnparsedNode(kind, data) { + const node = createBaseNode(kind); + node.data = data; + return node; + } + function createUnparsedPrologue(data) { + return createBaseUnparsedNode(307, data); + } + function createUnparsedPrepend(data, texts) { + const node = createBaseUnparsedNode(308, data); + node.texts = texts; + return node; + } + function createUnparsedTextLike(data, internal4) { + return createBaseUnparsedNode(internal4 ? 310 : 309, data); + } + function createUnparsedSyntheticReference(section) { + const node = createBaseNode( + 311 + /* UnparsedSyntheticReference */ + ); + node.data = section.data; + node.section = section; + return node; + } + function createInputFiles2() { + const node = createBaseNode( + 315 + /* InputFiles */ + ); + node.javascriptText = ""; + node.declarationText = ""; + return node; + } + function createSyntheticExpression(type3, isSpread = false, tupleNameSource) { + const node = createBaseNode( + 237 + /* SyntheticExpression */ + ); + node.type = type3; + node.isSpread = isSpread; + node.tupleNameSource = tupleNameSource; + return node; + } + function createSyntaxList3(children) { + const node = createBaseNode( + 358 + /* SyntaxList */ + ); + node._children = children; + return node; + } + function createNotEmittedStatement(original) { + const node = createBaseNode( + 359 + /* NotEmittedStatement */ + ); + node.original = original; + setTextRange(node, original); + return node; + } + function createPartiallyEmittedExpression(expression, original) { + const node = createBaseNode( + 360 + /* PartiallyEmittedExpression */ + ); + node.expression = expression; + node.original = original; + node.transformFlags |= propagateChildFlags(node.expression) | 1; + setTextRange(node, original); + return node; + } + function updatePartiallyEmittedExpression(node, expression) { + return node.expression !== expression ? update2(createPartiallyEmittedExpression(expression, node.original), node) : node; + } + function flattenCommaElements(node) { + if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { + if (isCommaListExpression(node)) { + return node.elements; + } + if (isBinaryExpression(node) && isCommaToken(node.operatorToken)) { + return [node.left, node.right]; + } + } + return node; + } + function createCommaListExpression(elements) { + const node = createBaseNode( + 361 + /* CommaListExpression */ + ); + node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); + node.transformFlags |= propagateChildrenFlags(node.elements); + return node; + } + function updateCommaListExpression(node, elements) { + return node.elements !== elements ? update2(createCommaListExpression(elements), node) : node; + } + function createSyntheticReferenceExpression(expression, thisArg) { + const node = createBaseNode( + 362 + /* SyntheticReferenceExpression */ + ); + node.expression = expression; + node.thisArg = thisArg; + node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); + return node; + } + function updateSyntheticReferenceExpression(node, expression, thisArg) { + return node.expression !== expression || node.thisArg !== thisArg ? update2(createSyntheticReferenceExpression(expression, thisArg), node) : node; + } + function cloneGeneratedIdentifier(node) { + const clone22 = createBaseIdentifier(node.escapedText); + clone22.flags |= node.flags & ~16; + clone22.transformFlags = node.transformFlags; + setOriginal(clone22, node); + setIdentifierAutoGenerate(clone22, { ...node.emitNode.autoGenerate }); + return clone22; + } + function cloneIdentifier(node) { + const clone22 = createBaseIdentifier(node.escapedText); + clone22.flags |= node.flags & ~16; + clone22.jsDoc = node.jsDoc; + clone22.flowNode = node.flowNode; + clone22.symbol = node.symbol; + clone22.transformFlags = node.transformFlags; + setOriginal(clone22, node); + const typeArguments = getIdentifierTypeArguments(node); + if (typeArguments) + setIdentifierTypeArguments(clone22, typeArguments); + return clone22; + } + function cloneGeneratedPrivateIdentifier(node) { + const clone22 = createBasePrivateIdentifier(node.escapedText); + clone22.flags |= node.flags & ~16; + clone22.transformFlags = node.transformFlags; + setOriginal(clone22, node); + setIdentifierAutoGenerate(clone22, { ...node.emitNode.autoGenerate }); + return clone22; + } + function clonePrivateIdentifier(node) { + const clone22 = createBasePrivateIdentifier(node.escapedText); + clone22.flags |= node.flags & ~16; + clone22.transformFlags = node.transformFlags; + setOriginal(clone22, node); + return clone22; + } + function cloneNode(node) { + if (node === void 0) { + return node; + } + if (isSourceFile(node)) { + return cloneSourceFile(node); + } + if (isGeneratedIdentifier(node)) { + return cloneGeneratedIdentifier(node); + } + if (isIdentifier(node)) { + return cloneIdentifier(node); + } + if (isGeneratedPrivateIdentifier(node)) { + return cloneGeneratedPrivateIdentifier(node); + } + if (isPrivateIdentifier(node)) { + return clonePrivateIdentifier(node); + } + const clone22 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind); + clone22.flags |= node.flags & ~16; + clone22.transformFlags = node.transformFlags; + setOriginal(clone22, node); + for (const key in node) { + if (hasProperty(clone22, key) || !hasProperty(node, key)) { + continue; + } + clone22[key] = node[key]; + } + return clone22; + } + function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { + return createCallExpression( + createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + param ? [param] : [], + /*type*/ + void 0, + createBlock( + statements, + /*multiLine*/ + true + ) + ), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + paramValue ? [paramValue] : [] + ); + } + function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { + return createCallExpression( + createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + param ? [param] : [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + createBlock( + statements, + /*multiLine*/ + true + ) + ), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + paramValue ? [paramValue] : [] + ); + } + function createVoidZero() { + return createVoidExpression(createNumericLiteral("0")); + } + function createExportDefault(expression) { + return createExportAssignment2( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + expression + ); + } + function createExternalModuleExport(exportName) { + return createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + createNamedExports([ + createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + exportName + ) + ]) + ); + } + function createTypeCheck(value2, tag) { + return tag === "null" ? factory2.createStrictEquality(value2, createNull()) : tag === "undefined" ? factory2.createStrictEquality(value2, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value2), createStringLiteral(tag)); + } + function createIsNotTypeCheck(value2, tag) { + return tag === "null" ? factory2.createStrictInequality(value2, createNull()) : tag === "undefined" ? factory2.createStrictInequality(value2, createVoidZero()) : factory2.createStrictInequality(createTypeOfExpression(value2), createStringLiteral(tag)); + } + function createMethodCall(object, methodName, argumentsList) { + if (isCallChain(object)) { + return createCallChain( + createPropertyAccessChain( + object, + /*questionDotToken*/ + void 0, + methodName + ), + /*questionDotToken*/ + void 0, + /*typeArguments*/ + void 0, + argumentsList + ); + } + return createCallExpression( + createPropertyAccessExpression(object, methodName), + /*typeArguments*/ + void 0, + argumentsList + ); + } + function createFunctionBindCall(target, thisArg, argumentsList) { + return createMethodCall(target, "bind", [thisArg, ...argumentsList]); + } + function createFunctionCallCall(target, thisArg, argumentsList) { + return createMethodCall(target, "call", [thisArg, ...argumentsList]); + } + function createFunctionApplyCall(target, thisArg, argumentsExpression) { + return createMethodCall(target, "apply", [thisArg, argumentsExpression]); + } + function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { + return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); + } + function createArraySliceCall(array, start) { + return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); + } + function createArrayConcatCall(array, argumentsList) { + return createMethodCall(array, "concat", argumentsList); + } + function createObjectDefinePropertyCall(target, propertyName, attributes) { + return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); + } + function createObjectGetOwnPropertyDescriptorCall(target, propertyName) { + return createGlobalMethodCall("Object", "getOwnPropertyDescriptor", [target, asExpression(propertyName)]); + } + function createReflectGetCall(target, propertyKey, receiver) { + return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); + } + function createReflectSetCall(target, propertyKey, value2, receiver) { + return createGlobalMethodCall("Reflect", "set", receiver ? [target, propertyKey, value2, receiver] : [target, propertyKey, value2]); + } + function tryAddPropertyAssignment(properties, propertyName, expression) { + if (expression) { + properties.push(createPropertyAssignment(propertyName, expression)); + return true; + } + return false; + } + function createPropertyDescriptor(attributes, singleLine) { + const properties = []; + tryAddPropertyAssignment(properties, "enumerable", asExpression(attributes.enumerable)); + tryAddPropertyAssignment(properties, "configurable", asExpression(attributes.configurable)); + let isData = tryAddPropertyAssignment(properties, "writable", asExpression(attributes.writable)); + isData = tryAddPropertyAssignment(properties, "value", attributes.value) || isData; + let isAccessor2 = tryAddPropertyAssignment(properties, "get", attributes.get); + isAccessor2 = tryAddPropertyAssignment(properties, "set", attributes.set) || isAccessor2; + Debug.assert(!(isData && isAccessor2), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."); + return createObjectLiteralExpression(properties, !singleLine); + } + function updateOuterExpression(outerExpression, expression) { + switch (outerExpression.kind) { + case 217: + return updateParenthesizedExpression(outerExpression, expression); + case 216: + return updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 234: + return updateAsExpression(outerExpression, expression, outerExpression.type); + case 238: + return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); + case 235: + return updateNonNullExpression(outerExpression, expression); + case 360: + return updatePartiallyEmittedExpression(outerExpression, expression); + } + } + function isIgnorableParen(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some2(getSyntheticLeadingComments(node)) && !some2(getSyntheticTrailingComments(node)); + } + function restoreOuterExpressions(outerExpression, innerExpression, kinds = 15) { + if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { + return updateOuterExpression( + outerExpression, + restoreOuterExpressions(outerExpression.expression, innerExpression) + ); + } + return innerExpression; + } + function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { + if (!outermostLabeledStatement) { + return node; + } + const updated = updateLabeledStatement( + outermostLabeledStatement, + outermostLabeledStatement.label, + isLabeledStatement(outermostLabeledStatement.statement) ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node + ); + if (afterRestoreLabelCallback) { + afterRestoreLabelCallback(outermostLabeledStatement); + } + return updated; + } + function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { + const target = skipParentheses(node); + switch (target.kind) { + case 80: + return cacheIdentifiers; + case 110: + case 9: + case 10: + case 11: + return false; + case 209: + const elements = target.elements; + if (elements.length === 0) { + return false; + } + return true; + case 210: + return target.properties.length > 0; + default: + return true; + } + } + function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) { + const callee = skipOuterExpressions( + expression, + 15 + /* All */ + ); + let thisArg; + let target; + if (isSuperProperty(callee)) { + thisArg = createThis(); + target = callee; + } else if (isSuperKeyword(callee)) { + thisArg = createThis(); + target = languageVersion !== void 0 && languageVersion < 2 ? setTextRange(createIdentifier("_super"), callee) : callee; + } else if (getEmitFlags(callee) & 8192) { + thisArg = createVoidZero(); + target = parenthesizerRules().parenthesizeLeftSideOfAccess( + callee, + /*optionalChain*/ + false + ); + } else if (isPropertyAccessExpression(callee)) { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = createTempVariable(recordTempVariable); + target = createPropertyAccessExpression( + setTextRange( + factory2.createAssignment( + thisArg, + callee.expression + ), + callee.expression + ), + callee.name + ); + setTextRange(target, callee); + } else { + thisArg = callee.expression; + target = callee; + } + } else if (isElementAccessExpression(callee)) { + if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { + thisArg = createTempVariable(recordTempVariable); + target = createElementAccessExpression( + setTextRange( + factory2.createAssignment( + thisArg, + callee.expression + ), + callee.expression + ), + callee.argumentExpression + ); + setTextRange(target, callee); + } else { + thisArg = callee.expression; + target = callee; + } + } else { + thisArg = createVoidZero(); + target = parenthesizerRules().parenthesizeLeftSideOfAccess( + expression, + /*optionalChain*/ + false + ); + } + return { target, thisArg }; + } + function createAssignmentTargetWrapper(paramName, expression) { + return createPropertyAccessExpression( + // Explicit parens required because of v8 regression (https://bugs.chromium.org/p/v8/issues/detail?id=9560) + createParenthesizedExpression( + createObjectLiteralExpression([ + createSetAccessorDeclaration( + /*modifiers*/ + void 0, + "value", + [createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + paramName, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )], + createBlock([ + createExpressionStatement(expression) + ]) + ) + ]) + ), + "value" + ); + } + function inlineExpressions(expressions) { + return expressions.length > 10 ? createCommaListExpression(expressions) : reduceLeft(expressions, factory2.createComma); + } + function getName(node, allowComments, allowSourceMaps, emitFlags = 0, ignoreAssignedName) { + const nodeName = ignoreAssignedName ? node && getNonAssignedNameOfDeclaration(node) : getNameOfDeclaration(node); + if (nodeName && isIdentifier(nodeName) && !isGeneratedIdentifier(nodeName)) { + const name2 = setParent(setTextRange(cloneNode(nodeName), nodeName), nodeName.parent); + emitFlags |= getEmitFlags(nodeName); + if (!allowSourceMaps) + emitFlags |= 96; + if (!allowComments) + emitFlags |= 3072; + if (emitFlags) + setEmitFlags(name2, emitFlags); + return name2; + } + return getGeneratedNameForNode(node); + } + function getInternalName(node, allowComments, allowSourceMaps) { + return getName( + node, + allowComments, + allowSourceMaps, + 32768 | 65536 + /* InternalName */ + ); + } + function getLocalName(node, allowComments, allowSourceMaps, ignoreAssignedName) { + return getName(node, allowComments, allowSourceMaps, 32768, ignoreAssignedName); + } + function getExportName(node, allowComments, allowSourceMaps) { + return getName( + node, + allowComments, + allowSourceMaps, + 16384 + /* ExportName */ + ); + } + function getDeclarationName(node, allowComments, allowSourceMaps) { + return getName(node, allowComments, allowSourceMaps); + } + function getNamespaceMemberName(ns, name2, allowComments, allowSourceMaps) { + const qualifiedName = createPropertyAccessExpression(ns, nodeIsSynthesized(name2) ? name2 : cloneNode(name2)); + setTextRange(qualifiedName, name2); + let emitFlags = 0; + if (!allowSourceMaps) + emitFlags |= 96; + if (!allowComments) + emitFlags |= 3072; + if (emitFlags) + setEmitFlags(qualifiedName, emitFlags); + return qualifiedName; + } + function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { + if (ns && hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); + } + return getExportName(node, allowComments, allowSourceMaps); + } + function copyPrologue(source, target, ensureUseStrict2, visitor) { + const offset = copyStandardPrologue(source, target, 0, ensureUseStrict2); + return copyCustomPrologue(source, target, offset, visitor); + } + function isUseStrictPrologue2(node) { + return isStringLiteral(node.expression) && node.expression.text === "use strict"; + } + function createUseStrictPrologue() { + return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); + } + function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { + Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); + let foundUseStrict = false; + const numStatements = source.length; + while (statementOffset < numStatements) { + const statement = source[statementOffset]; + if (isPrologueDirective(statement)) { + if (isUseStrictPrologue2(statement)) { + foundUseStrict = true; + } + target.push(statement); + } else { + break; + } + statementOffset++; + } + if (ensureUseStrict2 && !foundUseStrict) { + target.push(createUseStrictPrologue()); + } + return statementOffset; + } + function copyCustomPrologue(source, target, statementOffset, visitor, filter22 = returnTrue) { + const numStatements = source.length; + while (statementOffset !== void 0 && statementOffset < numStatements) { + const statement = source[statementOffset]; + if (getEmitFlags(statement) & 2097152 && filter22(statement)) { + append(target, visitor ? visitNode(statement, visitor, isStatement) : statement); + } else { + break; + } + statementOffset++; + } + return statementOffset; + } + function ensureUseStrict(statements) { + const foundUseStrict = findUseStrictPrologue(statements); + if (!foundUseStrict) { + return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); + } + return statements; + } + function liftToBlock(nodes) { + Debug.assert(every2(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); + return singleOrUndefined(nodes) || createBlock(nodes); + } + function findSpanEnd(array, test, start) { + let i7 = start; + while (i7 < array.length && test(array[i7])) { + i7++; + } + return i7; + } + function mergeLexicalEnvironment(statements, declarations) { + if (!some2(declarations)) { + return statements; + } + const leftStandardPrologueEnd = findSpanEnd(statements, isPrologueDirective, 0); + const leftHoistedFunctionsEnd = findSpanEnd(statements, isHoistedFunction, leftStandardPrologueEnd); + const leftHoistedVariablesEnd = findSpanEnd(statements, isHoistedVariableStatement, leftHoistedFunctionsEnd); + const rightStandardPrologueEnd = findSpanEnd(declarations, isPrologueDirective, 0); + const rightHoistedFunctionsEnd = findSpanEnd(declarations, isHoistedFunction, rightStandardPrologueEnd); + const rightHoistedVariablesEnd = findSpanEnd(declarations, isHoistedVariableStatement, rightHoistedFunctionsEnd); + const rightCustomPrologueEnd = findSpanEnd(declarations, isCustomPrologue, rightHoistedVariablesEnd); + Debug.assert(rightCustomPrologueEnd === declarations.length, "Expected declarations to be valid standard or custom prologues"); + const left = isNodeArray(statements) ? statements.slice() : statements; + if (rightCustomPrologueEnd > rightHoistedVariablesEnd) { + left.splice(leftHoistedVariablesEnd, 0, ...declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd)); + } + if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) { + left.splice(leftHoistedFunctionsEnd, 0, ...declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd)); + } + if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) { + left.splice(leftStandardPrologueEnd, 0, ...declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd)); + } + if (rightStandardPrologueEnd > 0) { + if (leftStandardPrologueEnd === 0) { + left.splice(0, 0, ...declarations.slice(0, rightStandardPrologueEnd)); + } else { + const leftPrologues = /* @__PURE__ */ new Map(); + for (let i7 = 0; i7 < leftStandardPrologueEnd; i7++) { + const leftPrologue = statements[i7]; + leftPrologues.set(leftPrologue.expression.text, true); + } + for (let i7 = rightStandardPrologueEnd - 1; i7 >= 0; i7--) { + const rightPrologue = declarations[i7]; + if (!leftPrologues.has(rightPrologue.expression.text)) { + left.unshift(rightPrologue); + } + } + } + } + if (isNodeArray(statements)) { + return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); + } + return statements; + } + function replaceModifiers(node, modifiers) { + let modifierArray; + if (typeof modifiers === "number") { + modifierArray = createModifiersFromModifierFlags(modifiers); + } else { + modifierArray = modifiers; + } + return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node); + } + function replaceDecoratorsAndModifiers(node, modifierArray) { + return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node); + } + function replacePropertyName(node, name2) { + switch (node.kind) { + case 177: + return updateGetAccessorDeclaration(node, node.modifiers, name2, node.parameters, node.type, node.body); + case 178: + return updateSetAccessorDeclaration(node, node.modifiers, name2, node.parameters, node.body); + case 174: + return updateMethodDeclaration(node, node.modifiers, node.asteriskToken, name2, node.questionToken, node.typeParameters, node.parameters, node.type, node.body); + case 173: + return updateMethodSignature(node, node.modifiers, name2, node.questionToken, node.typeParameters, node.parameters, node.type); + case 172: + return updatePropertyDeclaration2(node, node.modifiers, name2, node.questionToken ?? node.exclamationToken, node.type, node.initializer); + case 171: + return updatePropertySignature(node, node.modifiers, name2, node.questionToken, node.type); + case 303: + return updatePropertyAssignment(node, name2, node.initializer); + } + } + function asNodeArray(array) { + return array ? createNodeArray(array) : void 0; + } + function asName(name2) { + return typeof name2 === "string" ? createIdentifier(name2) : name2; + } + function asExpression(value2) { + return typeof value2 === "string" ? createStringLiteral(value2) : typeof value2 === "number" ? createNumericLiteral(value2) : typeof value2 === "boolean" ? value2 ? createTrue() : createFalse() : value2; + } + function asInitializer(node) { + return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node); + } + function asToken(value2) { + return typeof value2 === "number" ? createToken(value2) : value2; + } + function asEmbeddedStatement(statement) { + return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement; + } + function asVariableDeclaration(variableDeclaration) { + if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { + return createVariableDeclaration( + variableDeclaration, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + return variableDeclaration; + } + function update2(updated, original) { + if (updated !== original) { + setOriginal(updated, original); + setTextRange(updated, original); + } + return updated; + } + } + function getDefaultTagNameForKind(kind) { + switch (kind) { + case 351: + return "type"; + case 349: + return "returns"; + case 350: + return "this"; + case 347: + return "enum"; + case 337: + return "author"; + case 339: + return "class"; + case 340: + return "public"; + case 341: + return "private"; + case 342: + return "protected"; + case 343: + return "readonly"; + case 344: + return "override"; + case 352: + return "template"; + case 353: + return "typedef"; + case 348: + return "param"; + case 355: + return "prop"; + case 345: + return "callback"; + case 346: + return "overload"; + case 335: + return "augments"; + case 336: + return "implements"; + default: + return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); + } + } + function getCookedText(kind, rawText) { + if (!rawTextScanner) { + rawTextScanner = createScanner3( + 99, + /*skipTrivia*/ + false, + 0 + /* Standard */ + ); + } + switch (kind) { + case 15: + rawTextScanner.setText("`" + rawText + "`"); + break; + case 16: + rawTextScanner.setText("`" + rawText + "${"); + break; + case 17: + rawTextScanner.setText("}" + rawText + "${"); + break; + case 18: + rawTextScanner.setText("}" + rawText + "`"); + break; + } + let token = rawTextScanner.scan(); + if (token === 20) { + token = rawTextScanner.reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + } + if (rawTextScanner.isUnterminated()) { + rawTextScanner.setText(void 0); + return invalidValueSentinel; + } + let tokenValue; + switch (token) { + case 15: + case 16: + case 17: + case 18: + tokenValue = rawTextScanner.getTokenValue(); + break; + } + if (tokenValue === void 0 || rawTextScanner.scan() !== 1) { + rawTextScanner.setText(void 0); + return invalidValueSentinel; + } + rawTextScanner.setText(void 0); + return tokenValue; + } + function propagateNameFlags(node) { + return node && isIdentifier(node) ? propagateIdentifierNameFlags(node) : propagateChildFlags(node); + } + function propagateIdentifierNameFlags(node) { + return propagateChildFlags(node) & ~67108864; + } + function propagatePropertyNameFlagsOfChild(node, transformFlags) { + return transformFlags | node.transformFlags & 134234112; + } + function propagateChildFlags(child) { + if (!child) + return 0; + const childFlags = child.transformFlags & ~getTransformFlagsSubtreeExclusions(child.kind); + return isNamedDeclaration(child) && isPropertyName(child.name) ? propagatePropertyNameFlagsOfChild(child.name, childFlags) : childFlags; + } + function propagateChildrenFlags(children) { + return children ? children.transformFlags : 0; + } + function aggregateChildrenFlags(children) { + let subtreeFlags = 0; + for (const child of children) { + subtreeFlags |= propagateChildFlags(child); + } + children.transformFlags = subtreeFlags; + } + function getTransformFlagsSubtreeExclusions(kind) { + if (kind >= 182 && kind <= 205) { + return -2; + } + switch (kind) { + case 213: + case 214: + case 209: + return -2147450880; + case 267: + return -1941676032; + case 169: + return -2147483648; + case 219: + return -2072174592; + case 218: + case 262: + return -1937940480; + case 261: + return -2146893824; + case 263: + case 231: + return -2147344384; + case 176: + return -1937948672; + case 172: + return -2013249536; + case 174: + case 177: + case 178: + return -2005057536; + case 133: + case 150: + case 163: + case 146: + case 154: + case 151: + case 136: + case 155: + case 116: + case 168: + case 171: + case 173: + case 179: + case 180: + case 181: + case 264: + case 265: + return -2; + case 210: + return -2147278848; + case 299: + return -2147418112; + case 206: + case 207: + return -2147450880; + case 216: + case 238: + case 234: + case 360: + case 217: + case 108: + return -2147483648; + case 211: + case 212: + return -2147483648; + default: + return -2147483648; + } + } + function makeSynthetic(node) { + node.flags |= 16; + return node; + } + function createUnparsedSourceFile(textOrInputFiles, mapPathOrType, mapTextOrStripInternal) { + let stripInternal; + let bundleFileInfo; + let fileName; + let text; + let length2; + let sourceMapPath; + let sourceMapText; + let getText; + let getSourceMapText; + let oldFileOfCurrentEmit; + if (!isString4(textOrInputFiles)) { + Debug.assert(mapPathOrType === "js" || mapPathOrType === "dts"); + fileName = (mapPathOrType === "js" ? textOrInputFiles.javascriptPath : textOrInputFiles.declarationPath) || ""; + sourceMapPath = mapPathOrType === "js" ? textOrInputFiles.javascriptMapPath : textOrInputFiles.declarationMapPath; + getText = () => mapPathOrType === "js" ? textOrInputFiles.javascriptText : textOrInputFiles.declarationText; + getSourceMapText = () => mapPathOrType === "js" ? textOrInputFiles.javascriptMapText : textOrInputFiles.declarationMapText; + length2 = () => getText().length; + if (textOrInputFiles.buildInfo && textOrInputFiles.buildInfo.bundle) { + Debug.assert(mapTextOrStripInternal === void 0 || typeof mapTextOrStripInternal === "boolean"); + stripInternal = mapTextOrStripInternal; + bundleFileInfo = mapPathOrType === "js" ? textOrInputFiles.buildInfo.bundle.js : textOrInputFiles.buildInfo.bundle.dts; + oldFileOfCurrentEmit = textOrInputFiles.oldFileOfCurrentEmit; + } + } else { + fileName = ""; + text = textOrInputFiles; + length2 = textOrInputFiles.length; + sourceMapPath = mapPathOrType; + sourceMapText = mapTextOrStripInternal; + } + const node = oldFileOfCurrentEmit ? parseOldFileOfCurrentEmit(Debug.checkDefined(bundleFileInfo)) : parseUnparsedSourceFile(bundleFileInfo, stripInternal, length2); + node.fileName = fileName; + node.sourceMapPath = sourceMapPath; + node.oldFileOfCurrentEmit = oldFileOfCurrentEmit; + if (getText && getSourceMapText) { + Object.defineProperty(node, "text", { get: getText }); + Object.defineProperty(node, "sourceMapText", { get: getSourceMapText }); + } else { + Debug.assert(!oldFileOfCurrentEmit); + node.text = text ?? ""; + node.sourceMapText = sourceMapText; + } + return node; + } + function parseUnparsedSourceFile(bundleFileInfo, stripInternal, length2) { + let prologues; + let helpers; + let referencedFiles; + let typeReferenceDirectives; + let libReferenceDirectives; + let prependChildren; + let texts; + let hasNoDefaultLib; + for (const section of bundleFileInfo ? bundleFileInfo.sections : emptyArray) { + switch (section.kind) { + case "prologue": + prologues = append(prologues, setTextRange(factory.createUnparsedPrologue(section.data), section)); + break; + case "emitHelpers": + helpers = append(helpers, getAllUnscopedEmitHelpers().get(section.data)); + break; + case "no-default-lib": + hasNoDefaultLib = true; + break; + case "reference": + referencedFiles = append(referencedFiles, { pos: -1, end: -1, fileName: section.data }); + break; + case "type": + typeReferenceDirectives = append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data }); + break; + case "type-import": + typeReferenceDirectives = append(typeReferenceDirectives, { + pos: -1, + end: -1, + fileName: section.data, + resolutionMode: 99 + /* ESNext */ + }); + break; + case "type-require": + typeReferenceDirectives = append(typeReferenceDirectives, { + pos: -1, + end: -1, + fileName: section.data, + resolutionMode: 1 + /* CommonJS */ + }); + break; + case "lib": + libReferenceDirectives = append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data }); + break; + case "prepend": + let prependTexts; + for (const text of section.texts) { + if (!stripInternal || text.kind !== "internal") { + prependTexts = append(prependTexts, setTextRange(factory.createUnparsedTextLike( + text.data, + text.kind === "internal" + /* Internal */ + ), text)); + } + } + prependChildren = addRange(prependChildren, prependTexts); + texts = append(texts, factory.createUnparsedPrepend(section.data, prependTexts ?? emptyArray)); + break; + case "internal": + if (stripInternal) { + if (!texts) + texts = []; + break; + } + case "text": + texts = append(texts, setTextRange(factory.createUnparsedTextLike( + section.data, + section.kind === "internal" + /* Internal */ + ), section)); + break; + default: + Debug.assertNever(section); + } + } + if (!texts) { + const textNode = factory.createUnparsedTextLike( + /*data*/ + void 0, + /*internal*/ + false + ); + setTextRangePosWidth(textNode, 0, typeof length2 === "function" ? length2() : length2); + texts = [textNode]; + } + const node = parseNodeFactory.createUnparsedSource( + prologues ?? emptyArray, + /*syntheticReferences*/ + void 0, + texts + ); + setEachParent(prologues, node); + setEachParent(texts, node); + setEachParent(prependChildren, node); + node.hasNoDefaultLib = hasNoDefaultLib; + node.helpers = helpers; + node.referencedFiles = referencedFiles || emptyArray; + node.typeReferenceDirectives = typeReferenceDirectives; + node.libReferenceDirectives = libReferenceDirectives || emptyArray; + return node; + } + function parseOldFileOfCurrentEmit(bundleFileInfo) { + let texts; + let syntheticReferences; + for (const section of bundleFileInfo.sections) { + switch (section.kind) { + case "internal": + case "text": + texts = append(texts, setTextRange(factory.createUnparsedTextLike( + section.data, + section.kind === "internal" + /* Internal */ + ), section)); + break; + case "no-default-lib": + case "reference": + case "type": + case "type-import": + case "type-require": + case "lib": + syntheticReferences = append(syntheticReferences, setTextRange(factory.createUnparsedSyntheticReference(section), section)); + break; + case "prologue": + case "emitHelpers": + case "prepend": + break; + default: + Debug.assertNever(section); + } + } + const node = factory.createUnparsedSource(emptyArray, syntheticReferences, texts ?? emptyArray); + setEachParent(syntheticReferences, node); + setEachParent(texts, node); + node.helpers = map4(bundleFileInfo.sources && bundleFileInfo.sources.helpers, (name2) => getAllUnscopedEmitHelpers().get(name2)); + return node; + } + function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath) { + return !isString4(javascriptTextOrReadFileText) ? createInputFilesWithFilePaths( + javascriptTextOrReadFileText, + declarationTextOrJavascriptPath, + javascriptMapPath, + javascriptMapTextOrDeclarationPath, + declarationMapPath, + declarationMapTextOrBuildInfoPath + ) : createInputFilesWithFileTexts( + /*javascriptPath*/ + void 0, + javascriptTextOrReadFileText, + javascriptMapPath, + javascriptMapTextOrDeclarationPath, + /*declarationPath*/ + void 0, + declarationTextOrJavascriptPath, + declarationMapPath, + declarationMapTextOrBuildInfoPath + ); + } + function createInputFilesWithFilePaths(readFileText, javascriptPath, javascriptMapPath, declarationPath, declarationMapPath, buildInfoPath, host, options) { + const node = parseNodeFactory.createInputFiles(); + node.javascriptPath = javascriptPath; + node.javascriptMapPath = javascriptMapPath; + node.declarationPath = declarationPath; + node.declarationMapPath = declarationMapPath; + node.buildInfoPath = buildInfoPath; + const cache = /* @__PURE__ */ new Map(); + const textGetter = (path2) => { + if (path2 === void 0) + return void 0; + let value2 = cache.get(path2); + if (value2 === void 0) { + value2 = readFileText(path2); + cache.set(path2, value2 !== void 0 ? value2 : false); + } + return value2 !== false ? value2 : void 0; + }; + const definedTextGetter = (path2) => { + const result2 = textGetter(path2); + return result2 !== void 0 ? result2 : `/* Input file ${path2} was missing */\r +`; + }; + let buildInfo; + const getAndCacheBuildInfo = () => { + if (buildInfo === void 0 && buildInfoPath) { + if (host == null ? void 0 : host.getBuildInfo) { + buildInfo = host.getBuildInfo(buildInfoPath, options.configFilePath) ?? false; + } else { + const result2 = textGetter(buildInfoPath); + buildInfo = result2 !== void 0 ? getBuildInfo(buildInfoPath, result2) ?? false : false; + } + } + return buildInfo || void 0; + }; + Object.defineProperties(node, { + javascriptText: { get: () => definedTextGetter(javascriptPath) }, + javascriptMapText: { get: () => textGetter(javascriptMapPath) }, + // TODO:: if there is inline sourceMap in jsFile, use that + declarationText: { get: () => definedTextGetter(Debug.checkDefined(declarationPath)) }, + declarationMapText: { get: () => textGetter(declarationMapPath) }, + // TODO:: if there is inline sourceMap in dtsFile, use that + buildInfo: { get: getAndCacheBuildInfo } + }); + return node; + } + function createInputFilesWithFileTexts(javascriptPath, javascriptText, javascriptMapPath, javascriptMapText, declarationPath, declarationText, declarationMapPath, declarationMapText, buildInfoPath, buildInfo, oldFileOfCurrentEmit) { + const node = parseNodeFactory.createInputFiles(); + node.javascriptPath = javascriptPath; + node.javascriptText = javascriptText; + node.javascriptMapPath = javascriptMapPath; + node.javascriptMapText = javascriptMapText; + node.declarationPath = declarationPath; + node.declarationText = declarationText; + node.declarationMapPath = declarationMapPath; + node.declarationMapText = declarationMapText; + node.buildInfoPath = buildInfoPath; + node.buildInfo = buildInfo; + node.oldFileOfCurrentEmit = oldFileOfCurrentEmit; + return node; + } + function createSourceMapSource(fileName, text, skipTrivia2) { + return new (SourceMapSource2 || (SourceMapSource2 = objectAllocator.getSourceMapSourceConstructor()))(fileName, text, skipTrivia2); + } + function setOriginalNode(node, original) { + if (node.original !== original) { + node.original = original; + if (original) { + const emitNode = original.emitNode; + if (emitNode) + node.emitNode = mergeEmitNode(emitNode, node.emitNode); + } + } + return node; + } + function mergeEmitNode(sourceEmitNode, destEmitNode) { + const { + flags, + internalFlags, + leadingComments, + trailingComments, + commentRange, + sourceMapRange, + tokenSourceMapRanges, + constantValue, + helpers, + startsOnNewLine, + snippetElement, + classThis, + assignedName + } = sourceEmitNode; + if (!destEmitNode) + destEmitNode = {}; + if (flags) { + destEmitNode.flags = flags; + } + if (internalFlags) { + destEmitNode.internalFlags = internalFlags & ~8; + } + if (leadingComments) { + destEmitNode.leadingComments = addRange(leadingComments.slice(), destEmitNode.leadingComments); + } + if (trailingComments) { + destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); + } + if (commentRange) { + destEmitNode.commentRange = commentRange; + } + if (sourceMapRange) { + destEmitNode.sourceMapRange = sourceMapRange; + } + if (tokenSourceMapRanges) { + destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); + } + if (constantValue !== void 0) { + destEmitNode.constantValue = constantValue; + } + if (helpers) { + for (const helper of helpers) { + destEmitNode.helpers = appendIfUnique(destEmitNode.helpers, helper); + } + } + if (startsOnNewLine !== void 0) { + destEmitNode.startsOnNewLine = startsOnNewLine; + } + if (snippetElement !== void 0) { + destEmitNode.snippetElement = snippetElement; + } + if (classThis) { + destEmitNode.classThis = classThis; + } + if (assignedName) { + destEmitNode.assignedName = assignedName; + } + return destEmitNode; + } + function mergeTokenSourceMapRanges(sourceRanges, destRanges) { + if (!destRanges) + destRanges = []; + for (const key in sourceRanges) { + destRanges[key] = sourceRanges[key]; + } + return destRanges; + } + var nextAutoGenerateId, NodeFactoryFlags, nodeFactoryPatchers, rawTextScanner, invalidValueSentinel, baseFactory, syntheticFactory, factory, SourceMapSource2; + var init_nodeFactory = __esm2({ + "src/compiler/factory/nodeFactory.ts"() { + "use strict"; + init_ts2(); + nextAutoGenerateId = 0; + NodeFactoryFlags = /* @__PURE__ */ ((NodeFactoryFlags2) => { + NodeFactoryFlags2[NodeFactoryFlags2["None"] = 0] = "None"; + NodeFactoryFlags2[NodeFactoryFlags2["NoParenthesizerRules"] = 1] = "NoParenthesizerRules"; + NodeFactoryFlags2[NodeFactoryFlags2["NoNodeConverters"] = 2] = "NoNodeConverters"; + NodeFactoryFlags2[NodeFactoryFlags2["NoIndentationOnFreshPropertyAccess"] = 4] = "NoIndentationOnFreshPropertyAccess"; + NodeFactoryFlags2[NodeFactoryFlags2["NoOriginalNode"] = 8] = "NoOriginalNode"; + return NodeFactoryFlags2; + })(NodeFactoryFlags || {}); + nodeFactoryPatchers = []; + invalidValueSentinel = {}; + baseFactory = createBaseNodeFactory(); + syntheticFactory = { + createBaseSourceFileNode: (kind) => makeSynthetic(baseFactory.createBaseSourceFileNode(kind)), + createBaseIdentifierNode: (kind) => makeSynthetic(baseFactory.createBaseIdentifierNode(kind)), + createBasePrivateIdentifierNode: (kind) => makeSynthetic(baseFactory.createBasePrivateIdentifierNode(kind)), + createBaseTokenNode: (kind) => makeSynthetic(baseFactory.createBaseTokenNode(kind)), + createBaseNode: (kind) => makeSynthetic(baseFactory.createBaseNode(kind)) + }; + factory = createNodeFactory(4, syntheticFactory); + } + }); + function getOrCreateEmitNode(node) { + if (!node.emitNode) { + if (isParseTreeNode(node)) { + if (node.kind === 312) { + return node.emitNode = { annotatedNodes: [node] }; + } + const sourceFile = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node))) ?? Debug.fail("Could not determine parsed source file."); + getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); + } + node.emitNode = {}; + } else { + Debug.assert(!(node.emitNode.internalFlags & 8), "Invalid attempt to mutate an immutable node."); + } + return node.emitNode; + } + function disposeEmitNodes(sourceFile) { + var _a2, _b; + const annotatedNodes = (_b = (_a2 = getSourceFileOfNode(getParseTreeNode(sourceFile))) == null ? void 0 : _a2.emitNode) == null ? void 0 : _b.annotatedNodes; + if (annotatedNodes) { + for (const node of annotatedNodes) { + node.emitNode = void 0; + } + } + } + function removeAllComments(node) { + const emitNode = getOrCreateEmitNode(node); + emitNode.flags |= 3072; + emitNode.leadingComments = void 0; + emitNode.trailingComments = void 0; + return node; + } + function setEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).flags = emitFlags; + return node; + } + function addEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.flags = emitNode.flags | emitFlags; + return node; + } + function setInternalEmitFlags(node, emitFlags) { + getOrCreateEmitNode(node).internalFlags = emitFlags; + return node; + } + function addInternalEmitFlags(node, emitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.internalFlags = emitNode.internalFlags | emitFlags; + return node; + } + function getSourceMapRange(node) { + var _a2; + return ((_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) ?? node; + } + function setSourceMapRange(node, range2) { + getOrCreateEmitNode(node).sourceMapRange = range2; + return node; + } + function getTokenSourceMapRange(node, token) { + var _a2, _b; + return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.tokenSourceMapRanges) == null ? void 0 : _b[token]; + } + function setTokenSourceMapRange(node, token, range2) { + const emitNode = getOrCreateEmitNode(node); + const tokenSourceMapRanges = emitNode.tokenSourceMapRanges ?? (emitNode.tokenSourceMapRanges = []); + tokenSourceMapRanges[token] = range2; + return node; + } + function getStartsOnNewLine(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.startsOnNewLine; + } + function setStartsOnNewLine(node, newLine) { + getOrCreateEmitNode(node).startsOnNewLine = newLine; + return node; + } + function getCommentRange(node) { + var _a2; + return ((_a2 = node.emitNode) == null ? void 0 : _a2.commentRange) ?? node; + } + function setCommentRange(node, range2) { + getOrCreateEmitNode(node).commentRange = range2; + return node; + } + function getSyntheticLeadingComments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.leadingComments; + } + function setSyntheticLeadingComments(node, comments) { + getOrCreateEmitNode(node).leadingComments = comments; + return node; + } + function addSyntheticLeadingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticLeadingComments(node, append(getSyntheticLeadingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + } + function getSyntheticTrailingComments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.trailingComments; + } + function setSyntheticTrailingComments(node, comments) { + getOrCreateEmitNode(node).trailingComments = comments; + return node; + } + function addSyntheticTrailingComment(node, kind, text, hasTrailingNewLine) { + return setSyntheticTrailingComments(node, append(getSyntheticTrailingComments(node), { kind, pos: -1, end: -1, hasTrailingNewLine, text })); + } + function moveSyntheticComments(node, original) { + setSyntheticLeadingComments(node, getSyntheticLeadingComments(original)); + setSyntheticTrailingComments(node, getSyntheticTrailingComments(original)); + const emit3 = getOrCreateEmitNode(original); + emit3.leadingComments = void 0; + emit3.trailingComments = void 0; + return node; + } + function getConstantValue(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.constantValue; + } + function setConstantValue(node, value2) { + const emitNode = getOrCreateEmitNode(node); + emitNode.constantValue = value2; + return node; + } + function addEmitHelper(node, helper) { + const emitNode = getOrCreateEmitNode(node); + emitNode.helpers = append(emitNode.helpers, helper); + return node; + } + function addEmitHelpers(node, helpers) { + if (some2(helpers)) { + const emitNode = getOrCreateEmitNode(node); + for (const helper of helpers) { + emitNode.helpers = appendIfUnique(emitNode.helpers, helper); + } + } + return node; + } + function removeEmitHelper(node, helper) { + var _a2; + const helpers = (_a2 = node.emitNode) == null ? void 0 : _a2.helpers; + if (helpers) { + return orderedRemoveItem(helpers, helper); + } + return false; + } + function getEmitHelpers(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.helpers; + } + function moveEmitHelpers(source, target, predicate) { + const sourceEmitNode = source.emitNode; + const sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers; + if (!some2(sourceEmitHelpers)) + return; + const targetEmitNode = getOrCreateEmitNode(target); + let helpersRemoved = 0; + for (let i7 = 0; i7 < sourceEmitHelpers.length; i7++) { + const helper = sourceEmitHelpers[i7]; + if (predicate(helper)) { + helpersRemoved++; + targetEmitNode.helpers = appendIfUnique(targetEmitNode.helpers, helper); + } else if (helpersRemoved > 0) { + sourceEmitHelpers[i7 - helpersRemoved] = helper; + } + } + if (helpersRemoved > 0) { + sourceEmitHelpers.length -= helpersRemoved; + } + } + function getSnippetElement(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.snippetElement; + } + function setSnippetElement(node, snippet2) { + const emitNode = getOrCreateEmitNode(node); + emitNode.snippetElement = snippet2; + return node; + } + function ignoreSourceNewlines(node) { + getOrCreateEmitNode(node).internalFlags |= 4; + return node; + } + function setTypeNode(node, type3) { + const emitNode = getOrCreateEmitNode(node); + emitNode.typeNode = type3; + return node; + } + function getTypeNode(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; + } + function setIdentifierTypeArguments(node, typeArguments) { + getOrCreateEmitNode(node).identifierTypeArguments = typeArguments; + return node; + } + function getIdentifierTypeArguments(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments; + } + function setIdentifierAutoGenerate(node, autoGenerate) { + getOrCreateEmitNode(node).autoGenerate = autoGenerate; + return node; + } + function getIdentifierAutoGenerate(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + } + function setIdentifierGeneratedImportReference(node, value2) { + getOrCreateEmitNode(node).generatedImportReference = value2; + return node; + } + function getIdentifierGeneratedImportReference(node) { + var _a2; + return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference; + } + var init_emitNode = __esm2({ + "src/compiler/factory/emitNode.ts"() { + "use strict"; + init_ts2(); + } + }); + function createEmitHelperFactory(context2) { + const factory2 = context2.factory; + const immutableTrue = memoize2(() => setInternalEmitFlags( + factory2.createTrue(), + 8 + /* Immutable */ + )); + const immutableFalse = memoize2(() => setInternalEmitFlags( + factory2.createFalse(), + 8 + /* Immutable */ + )); + return { + getUnscopedHelperName, + // TypeScript Helpers + createDecorateHelper, + createMetadataHelper, + createParamHelper, + // ES Decorators Helpers + createESDecorateHelper, + createRunInitializersHelper, + // ES2018 Helpers + createAssignHelper, + createAwaitHelper, + createAsyncGeneratorHelper, + createAsyncDelegatorHelper, + createAsyncValuesHelper, + // ES2018 Destructuring Helpers + createRestHelper, + // ES2017 Helpers + createAwaiterHelper, + // ES2015 Helpers + createExtendsHelper, + createTemplateObjectHelper, + createSpreadArrayHelper, + createPropKeyHelper, + createSetFunctionNameHelper, + // ES2015 Destructuring Helpers + createValuesHelper, + createReadHelper, + // ES2015 Generator Helpers + createGeneratorHelper, + // ES Module Helpers + createCreateBindingHelper, + createImportStarHelper, + createImportStarCallbackHelper, + createImportDefaultHelper, + createExportStarHelper, + // Class Fields Helpers + createClassPrivateFieldGetHelper, + createClassPrivateFieldSetHelper, + createClassPrivateFieldInHelper, + // 'using' helpers + createAddDisposableResourceHelper, + createDisposeResourcesHelper + }; + function getUnscopedHelperName(name2) { + return setEmitFlags( + factory2.createIdentifier(name2), + 8192 | 4 + /* AdviseOnEmitNode */ + ); + } + function createDecorateHelper(decoratorExpressions, target, memberName, descriptor) { + context2.requestEmitHelper(decorateHelper); + const argumentsArray = []; + argumentsArray.push(factory2.createArrayLiteralExpression( + decoratorExpressions, + /*multiLine*/ + true + )); + argumentsArray.push(target); + if (memberName) { + argumentsArray.push(memberName); + if (descriptor) { + argumentsArray.push(descriptor); + } + } + return factory2.createCallExpression( + getUnscopedHelperName("__decorate"), + /*typeArguments*/ + void 0, + argumentsArray + ); + } + function createMetadataHelper(metadataKey, metadataValue) { + context2.requestEmitHelper(metadataHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__metadata"), + /*typeArguments*/ + void 0, + [ + factory2.createStringLiteral(metadataKey), + metadataValue + ] + ); + } + function createParamHelper(expression, parameterOffset, location2) { + context2.requestEmitHelper(paramHelper); + return setTextRange( + factory2.createCallExpression( + getUnscopedHelperName("__param"), + /*typeArguments*/ + void 0, + [ + factory2.createNumericLiteral(parameterOffset + ""), + expression + ] + ), + location2 + ); + } + function createESDecorateClassContextObject(contextIn) { + const properties = [ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral("class")), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name), + factory2.createPropertyAssignment(factory2.createIdentifier("metadata"), contextIn.metadata) + ]; + return factory2.createObjectLiteralExpression(properties); + } + function createESDecorateClassElementAccessGetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + accessor + ) + ); + } + function createESDecorateClassElementAccessSetMethod(elementName) { + const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name); + return factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("value") + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + accessor, + factory2.createIdentifier("value") + ) + ) + ]) + ) + ); + } + function createESDecorateClassElementAccessHasMethod(elementName) { + const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name; + return factory2.createPropertyAssignment( + "has", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.createIdentifier("obj") + )], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBinaryExpression( + propertyName, + 103, + factory2.createIdentifier("obj") + ) + ) + ); + } + function createESDecorateClassElementAccessObject(name2, access2) { + const properties = []; + properties.push(createESDecorateClassElementAccessHasMethod(name2)); + if (access2.get) + properties.push(createESDecorateClassElementAccessGetMethod(name2)); + if (access2.set) + properties.push(createESDecorateClassElementAccessSetMethod(name2)); + return factory2.createObjectLiteralExpression(properties); + } + function createESDecorateClassElementContextObject(contextIn) { + const properties = [ + factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)), + factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)), + factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()), + factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access)), + factory2.createPropertyAssignment(factory2.createIdentifier("metadata"), contextIn.metadata) + ]; + return factory2.createObjectLiteralExpression(properties); + } + function createESDecorateContextObject(contextIn) { + return contextIn.kind === "class" ? createESDecorateClassContextObject(contextIn) : createESDecorateClassElementContextObject(contextIn); + } + function createESDecorateHelper(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + context2.requestEmitHelper(esDecorateHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__esDecorate"), + /*typeArguments*/ + void 0, + [ + ctor ?? factory2.createNull(), + descriptorIn ?? factory2.createNull(), + decorators, + createESDecorateContextObject(contextIn), + initializers, + extraInitializers + ] + ); + } + function createRunInitializersHelper(thisArg, initializers, value2) { + context2.requestEmitHelper(runInitializersHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__runInitializers"), + /*typeArguments*/ + void 0, + value2 ? [thisArg, initializers, value2] : [thisArg, initializers] + ); + } + function createAssignHelper(attributesSegments) { + if (getEmitScriptTarget(context2.getCompilerOptions()) >= 2) { + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "assign"), + /*typeArguments*/ + void 0, + attributesSegments + ); + } + context2.requestEmitHelper(assignHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__assign"), + /*typeArguments*/ + void 0, + attributesSegments + ); + } + function createAwaitHelper(expression) { + context2.requestEmitHelper(awaitHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__await"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createAsyncGeneratorHelper(generatorFunc, hasLexicalThis) { + context2.requestEmitHelper(awaitHelper); + context2.requestEmitHelper(asyncGeneratorHelper); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 | 1048576; + return factory2.createCallExpression( + getUnscopedHelperName("__asyncGenerator"), + /*typeArguments*/ + void 0, + [ + hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(), + factory2.createIdentifier("arguments"), + generatorFunc + ] + ); + } + function createAsyncDelegatorHelper(expression) { + context2.requestEmitHelper(awaitHelper); + context2.requestEmitHelper(asyncDelegator); + return factory2.createCallExpression( + getUnscopedHelperName("__asyncDelegator"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createAsyncValuesHelper(expression) { + context2.requestEmitHelper(asyncValues); + return factory2.createCallExpression( + getUnscopedHelperName("__asyncValues"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createRestHelper(value2, elements, computedTempVariables, location2) { + context2.requestEmitHelper(restHelper); + const propertyNames = []; + let computedTempVariableOffset = 0; + for (let i7 = 0; i7 < elements.length - 1; i7++) { + const propertyName = getPropertyNameOfBindingOrAssignmentElement(elements[i7]); + if (propertyName) { + if (isComputedPropertyName(propertyName)) { + Debug.assertIsDefined(computedTempVariables, "Encountered computed property name but 'computedTempVariables' argument was not provided."); + const temp = computedTempVariables[computedTempVariableOffset]; + computedTempVariableOffset++; + propertyNames.push( + factory2.createConditionalExpression( + factory2.createTypeCheck(temp, "symbol"), + /*questionToken*/ + void 0, + temp, + /*colonToken*/ + void 0, + factory2.createAdd(temp, factory2.createStringLiteral("")) + ) + ); + } else { + propertyNames.push(factory2.createStringLiteralFromNode(propertyName)); + } + } + } + return factory2.createCallExpression( + getUnscopedHelperName("__rest"), + /*typeArguments*/ + void 0, + [ + value2, + setTextRange( + factory2.createArrayLiteralExpression(propertyNames), + location2 + ) + ] + ); + } + function createAwaiterHelper(hasLexicalThis, argumentsExpression, promiseConstructor, parameters, body) { + context2.requestEmitHelper(awaiterHelper); + const generatorFunc = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + factory2.createToken( + 42 + /* AsteriskToken */ + ), + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters ?? [], + /*type*/ + void 0, + body + ); + (generatorFunc.emitNode || (generatorFunc.emitNode = {})).flags |= 524288 | 1048576; + return factory2.createCallExpression( + getUnscopedHelperName("__awaiter"), + /*typeArguments*/ + void 0, + [ + hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(), + argumentsExpression ?? factory2.createVoidZero(), + promiseConstructor ? createExpressionFromEntityName(factory2, promiseConstructor) : factory2.createVoidZero(), + generatorFunc + ] + ); + } + function createExtendsHelper(name2) { + context2.requestEmitHelper(extendsHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__extends"), + /*typeArguments*/ + void 0, + [name2, factory2.createUniqueName( + "_super", + 16 | 32 + /* FileLevel */ + )] + ); + } + function createTemplateObjectHelper(cooked, raw) { + context2.requestEmitHelper(templateObjectHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__makeTemplateObject"), + /*typeArguments*/ + void 0, + [cooked, raw] + ); + } + function createSpreadArrayHelper(to, from, packFrom) { + context2.requestEmitHelper(spreadArrayHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__spreadArray"), + /*typeArguments*/ + void 0, + [to, from, packFrom ? immutableTrue() : immutableFalse()] + ); + } + function createPropKeyHelper(expr) { + context2.requestEmitHelper(propKeyHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__propKey"), + /*typeArguments*/ + void 0, + [expr] + ); + } + function createSetFunctionNameHelper(f8, name2, prefix) { + context2.requestEmitHelper(setFunctionNameHelper); + return context2.factory.createCallExpression( + getUnscopedHelperName("__setFunctionName"), + /*typeArguments*/ + void 0, + prefix ? [f8, name2, context2.factory.createStringLiteral(prefix)] : [f8, name2] + ); + } + function createValuesHelper(expression) { + context2.requestEmitHelper(valuesHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__values"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createReadHelper(iteratorRecord, count2) { + context2.requestEmitHelper(readHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__read"), + /*typeArguments*/ + void 0, + count2 !== void 0 ? [iteratorRecord, factory2.createNumericLiteral(count2 + "")] : [iteratorRecord] + ); + } + function createGeneratorHelper(body) { + context2.requestEmitHelper(generatorHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__generator"), + /*typeArguments*/ + void 0, + [factory2.createThis(), body] + ); + } + function createCreateBindingHelper(module22, inputName, outputName) { + context2.requestEmitHelper(createBindingHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__createBinding"), + /*typeArguments*/ + void 0, + [factory2.createIdentifier("exports"), module22, inputName, ...outputName ? [outputName] : []] + ); + } + function createImportStarHelper(expression) { + context2.requestEmitHelper(importStarHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__importStar"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createImportStarCallbackHelper() { + context2.requestEmitHelper(importStarHelper); + return getUnscopedHelperName("__importStar"); + } + function createImportDefaultHelper(expression) { + context2.requestEmitHelper(importDefaultHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__importDefault"), + /*typeArguments*/ + void 0, + [expression] + ); + } + function createExportStarHelper(moduleExpression, exportsExpression = factory2.createIdentifier("exports")) { + context2.requestEmitHelper(exportStarHelper); + context2.requestEmitHelper(createBindingHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__exportStar"), + /*typeArguments*/ + void 0, + [moduleExpression, exportsExpression] + ); + } + function createClassPrivateFieldGetHelper(receiver, state, kind, f8) { + context2.requestEmitHelper(classPrivateFieldGetHelper); + let args; + if (!f8) { + args = [receiver, state, factory2.createStringLiteral(kind)]; + } else { + args = [receiver, state, factory2.createStringLiteral(kind), f8]; + } + return factory2.createCallExpression( + getUnscopedHelperName("__classPrivateFieldGet"), + /*typeArguments*/ + void 0, + args + ); + } + function createClassPrivateFieldSetHelper(receiver, state, value2, kind, f8) { + context2.requestEmitHelper(classPrivateFieldSetHelper); + let args; + if (!f8) { + args = [receiver, state, value2, factory2.createStringLiteral(kind)]; + } else { + args = [receiver, state, value2, factory2.createStringLiteral(kind), f8]; + } + return factory2.createCallExpression( + getUnscopedHelperName("__classPrivateFieldSet"), + /*typeArguments*/ + void 0, + args + ); + } + function createClassPrivateFieldInHelper(state, receiver) { + context2.requestEmitHelper(classPrivateFieldInHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__classPrivateFieldIn"), + /*typeArguments*/ + void 0, + [state, receiver] + ); + } + function createAddDisposableResourceHelper(envBinding, value2, async) { + context2.requestEmitHelper(addDisposableResourceHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__addDisposableResource"), + /*typeArguments*/ + void 0, + [envBinding, value2, async ? factory2.createTrue() : factory2.createFalse()] + ); + } + function createDisposeResourcesHelper(envBinding) { + context2.requestEmitHelper(disposeResourcesHelper); + return factory2.createCallExpression( + getUnscopedHelperName("__disposeResources"), + /*typeArguments*/ + void 0, + [envBinding] + ); + } + } + function compareEmitHelpers(x7, y7) { + if (x7 === y7) + return 0; + if (x7.priority === y7.priority) + return 0; + if (x7.priority === void 0) + return 1; + if (y7.priority === void 0) + return -1; + return compareValues(x7.priority, y7.priority); + } + function helperString(input, ...args) { + return (uniqueName) => { + let result2 = ""; + for (let i7 = 0; i7 < args.length; i7++) { + result2 += input[i7]; + result2 += uniqueName(args[i7]); + } + result2 += input[input.length - 1]; + return result2; + }; + } + function getAllUnscopedEmitHelpers() { + return allUnscopedEmitHelpers || (allUnscopedEmitHelpers = arrayToMap([ + decorateHelper, + metadataHelper, + paramHelper, + esDecorateHelper, + runInitializersHelper, + assignHelper, + awaitHelper, + asyncGeneratorHelper, + asyncDelegator, + asyncValues, + restHelper, + awaiterHelper, + extendsHelper, + templateObjectHelper, + spreadArrayHelper, + valuesHelper, + readHelper, + propKeyHelper, + setFunctionNameHelper, + generatorHelper, + importStarHelper, + importDefaultHelper, + exportStarHelper, + classPrivateFieldGetHelper, + classPrivateFieldSetHelper, + classPrivateFieldInHelper, + createBindingHelper, + setModuleDefaultHelper, + addDisposableResourceHelper, + disposeResourcesHelper + ], (helper) => helper.name)); + } + function isCallToHelper(firstSegment, helperName) { + return isCallExpression(firstSegment) && isIdentifier(firstSegment.expression) && (getEmitFlags(firstSegment.expression) & 8192) !== 0 && firstSegment.expression.escapedText === helperName; + } + var PrivateIdentifierKind, decorateHelper, metadataHelper, paramHelper, esDecorateHelper, runInitializersHelper, assignHelper, awaitHelper, asyncGeneratorHelper, asyncDelegator, asyncValues, restHelper, awaiterHelper, extendsHelper, templateObjectHelper, readHelper, spreadArrayHelper, propKeyHelper, setFunctionNameHelper, valuesHelper, generatorHelper, createBindingHelper, setModuleDefaultHelper, importStarHelper, importDefaultHelper, exportStarHelper, classPrivateFieldGetHelper, classPrivateFieldSetHelper, classPrivateFieldInHelper, addDisposableResourceHelper, disposeResourcesHelper, allUnscopedEmitHelpers, asyncSuperHelper, advancedAsyncSuperHelper; + var init_emitHelpers = __esm2({ + "src/compiler/factory/emitHelpers.ts"() { + "use strict"; + init_ts2(); + PrivateIdentifierKind = /* @__PURE__ */ ((PrivateIdentifierKind2) => { + PrivateIdentifierKind2["Field"] = "f"; + PrivateIdentifierKind2["Method"] = "m"; + PrivateIdentifierKind2["Accessor"] = "a"; + return PrivateIdentifierKind2; + })(PrivateIdentifierKind || {}); + decorateHelper = { + name: "typescript:decorate", + importName: "__decorate", + scoped: false, + priority: 2, + text: ` + var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 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 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; + return c > 3 && r && Object.defineProperty(target, key, r), r; + };` + }; + metadataHelper = { + name: "typescript:metadata", + importName: "__metadata", + scoped: false, + priority: 3, + text: ` + var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + };` + }; + paramHelper = { + name: "typescript:param", + importName: "__param", + scoped: false, + priority: 4, + text: ` + var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + };` + }; + esDecorateHelper = { + name: "typescript:esDecorate", + importName: "__esDecorate", + scoped: false, + priority: 2, + text: ` + var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { if (f !== void 0 && 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 i = decorators.length - 1; i >= 0; i--) { + 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 result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } + else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; + };` + }; + runInitializersHelper = { + name: "typescript:runInitializers", + importName: "__runInitializers", + scoped: false, + priority: 2, + text: ` + var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) { + value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + } + return useValue ? value : void 0; + };` + }; + assignHelper = { + name: "typescript:assign", + importName: "__assign", + scoped: false, + priority: 1, + text: ` + var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + };` + }; + awaitHelper = { + name: "typescript:await", + importName: "__await", + scoped: false, + text: ` + var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }` + }; + asyncGeneratorHelper = { + name: "typescript:asyncGenerator", + importName: "__asyncGenerator", + scoped: false, + dependencies: [awaitHelper], + text: ` + var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + 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]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + };` + }; + asyncDelegator = { + name: "typescript:asyncDelegator", + importName: "__asyncDelegator", + scoped: false, + dependencies: [awaitHelper], + text: ` + var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + 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; } + };` + }; + asyncValues = { + name: "typescript:asyncValues", + importName: "__asyncValues", + scoped: false, + text: ` + var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + 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); + 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); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + };` + }; + restHelper = { + name: "typescript:rest", + importName: "__rest", + scoped: false, + text: ` + var __rest = (this && this.__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 i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + };` + }; + awaiterHelper = { + name: "typescript:awaiter", + importName: "__awaiter", + scoped: false, + priority: 5, + text: ` + var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + };` + }; + extendsHelper = { + name: "typescript:extends", + importName: "__extends", + scoped: false, + priority: 0, + text: ` + var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + 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]; }; + return extendStatics(d, b); + }; + + return 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 __()); + }; + })();` + }; + templateObjectHelper = { + name: "typescript:makeTemplateObject", + importName: "__makeTemplateObject", + scoped: false, + priority: 0, + text: ` + var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + };` + }; + readHelper = { + name: "typescript:read", + importName: "__read", + scoped: false, + text: ` + var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + };` + }; + spreadArrayHelper = { + name: "typescript:spreadArray", + importName: "__spreadArray", + scoped: false, + text: ` + var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); + };` + }; + propKeyHelper = { + name: "typescript:propKey", + importName: "__propKey", + scoped: false, + text: ` + var __propKey = (this && this.__propKey) || function (x) { + return typeof x === "symbol" ? x : "".concat(x); + };` + }; + setFunctionNameHelper = { + name: "typescript:setFunctionName", + importName: "__setFunctionName", + scoped: false, + text: ` + var __setFunctionName = (this && this.__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 }); + };` + }; + valuesHelper = { + name: "typescript:values", + importName: "__values", + scoped: false, + text: ` + var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + };` + }; + generatorHelper = { + name: "typescript:generator", + importName: "__generator", + scoped: false, + priority: 6, + text: ` + var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + 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; + if (y = 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++; y = 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]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + };` + }; + createBindingHelper = { + name: "typescript:commonjscreatebinding", + importName: "__createBinding", + scoped: false, + priority: 1, + text: ` + var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, 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(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }));` + }; + setModuleDefaultHelper = { + name: "typescript:commonjscreatevalue", + importName: "__setModuleDefault", + scoped: false, + priority: 1, + text: ` + var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + });` + }; + importStarHelper = { + name: "typescript:commonjsimportstar", + importName: "__importStar", + scoped: false, + dependencies: [createBindingHelper, setModuleDefaultHelper], + priority: 2, + text: ` + var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + };` + }; + importDefaultHelper = { + name: "typescript:commonjsimportdefault", + importName: "__importDefault", + scoped: false, + text: ` + var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + };` + }; + exportStarHelper = { + name: "typescript:export-star", + importName: "__exportStar", + scoped: false, + dependencies: [createBindingHelper], + priority: 2, + text: ` + var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + };` + }; + classPrivateFieldGetHelper = { + name: "typescript:classPrivateFieldGet", + importName: "__classPrivateFieldGet", + scoped: false, + text: ` + var __classPrivateFieldGet = (this && this.__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); + };` + }; + classPrivateFieldSetHelper = { + name: "typescript:classPrivateFieldSet", + importName: "__classPrivateFieldSet", + scoped: false, + text: ` + var __classPrivateFieldSet = (this && this.__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; + };` + }; + classPrivateFieldInHelper = { + name: "typescript:classPrivateFieldIn", + importName: "__classPrivateFieldIn", + scoped: false, + text: ` + var __classPrivateFieldIn = (this && this.__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); + };` + }; + addDisposableResourceHelper = { + name: "typescript:addDisposableResource", + importName: "__addDisposableResource", + scoped: false, + text: ` + var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + env.stack.push({ value: value, dispose: dispose, async: async }); + } + else if (async) { + env.stack.push({ async: true }); + } + return value; + };` + }; + disposeResourcesHelper = { + name: "typescript:disposeResources", + importName: "__disposeResources", + scoped: false, + text: ` + var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) { + return function (env) { + function fail(e) { + env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + function next() { + while (env.stack.length) { + var rec = env.stack.pop(); + try { + var result = rec.dispose && rec.dispose.call(rec.value); + if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); + } + catch (e) { + fail(e); + } + } + if (env.hasError) throw env.error; + } + return next(); + }; + })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + });` + }; + asyncSuperHelper = { + name: "typescript:async-super", + scoped: true, + text: helperString` + const ${"_superIndex"} = name => super[name];` + }; + advancedAsyncSuperHelper = { + name: "typescript:advanced-async-super", + scoped: true, + text: helperString` + const ${"_superIndex"} = (function (geti, seti) { + const cache = Object.create(null); + return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); + })(name => super[name], (name, value) => super[name] = value);` + }; + } + }); + function isNumericLiteral(node) { + return node.kind === 9; + } + function isBigIntLiteral(node) { + return node.kind === 10; + } + function isStringLiteral(node) { + return node.kind === 11; + } + function isJsxText(node) { + return node.kind === 12; + } + function isRegularExpressionLiteral(node) { + return node.kind === 14; + } + function isNoSubstitutionTemplateLiteral(node) { + return node.kind === 15; + } + function isTemplateHead(node) { + return node.kind === 16; + } + function isTemplateMiddle(node) { + return node.kind === 17; + } + function isTemplateTail(node) { + return node.kind === 18; + } + function isDotDotDotToken(node) { + return node.kind === 26; + } + function isCommaToken(node) { + return node.kind === 28; + } + function isPlusToken(node) { + return node.kind === 40; + } + function isMinusToken(node) { + return node.kind === 41; + } + function isAsteriskToken(node) { + return node.kind === 42; + } + function isExclamationToken(node) { + return node.kind === 54; + } + function isQuestionToken(node) { + return node.kind === 58; + } + function isColonToken(node) { + return node.kind === 59; + } + function isQuestionDotToken(node) { + return node.kind === 29; + } + function isEqualsGreaterThanToken(node) { + return node.kind === 39; + } + function isIdentifier(node) { + return node.kind === 80; + } + function isPrivateIdentifier(node) { + return node.kind === 81; + } + function isExportModifier(node) { + return node.kind === 95; + } + function isDefaultModifier(node) { + return node.kind === 90; + } + function isAsyncModifier(node) { + return node.kind === 134; + } + function isAssertsKeyword(node) { + return node.kind === 131; + } + function isAwaitKeyword(node) { + return node.kind === 135; + } + function isReadonlyKeyword(node) { + return node.kind === 148; + } + function isStaticModifier(node) { + return node.kind === 126; + } + function isAbstractModifier(node) { + return node.kind === 128; + } + function isOverrideModifier(node) { + return node.kind === 164; + } + function isAccessorModifier(node) { + return node.kind === 129; + } + function isSuperKeyword(node) { + return node.kind === 108; + } + function isImportKeyword(node) { + return node.kind === 102; + } + function isCaseKeyword(node) { + return node.kind === 84; + } + function isQualifiedName(node) { + return node.kind === 166; + } + function isComputedPropertyName(node) { + return node.kind === 167; + } + function isTypeParameterDeclaration(node) { + return node.kind === 168; + } + function isParameter(node) { + return node.kind === 169; + } + function isDecorator(node) { + return node.kind === 170; + } + function isPropertySignature(node) { + return node.kind === 171; + } + function isPropertyDeclaration(node) { + return node.kind === 172; + } + function isMethodSignature(node) { + return node.kind === 173; + } + function isMethodDeclaration(node) { + return node.kind === 174; + } + function isClassStaticBlockDeclaration(node) { + return node.kind === 175; + } + function isConstructorDeclaration(node) { + return node.kind === 176; + } + function isGetAccessorDeclaration(node) { + return node.kind === 177; + } + function isSetAccessorDeclaration(node) { + return node.kind === 178; + } + function isCallSignatureDeclaration(node) { + return node.kind === 179; + } + function isConstructSignatureDeclaration(node) { + return node.kind === 180; + } + function isIndexSignatureDeclaration(node) { + return node.kind === 181; + } + function isTypePredicateNode(node) { + return node.kind === 182; + } + function isTypeReferenceNode(node) { + return node.kind === 183; + } + function isFunctionTypeNode(node) { + return node.kind === 184; + } + function isConstructorTypeNode(node) { + return node.kind === 185; + } + function isTypeQueryNode(node) { + return node.kind === 186; + } + function isTypeLiteralNode(node) { + return node.kind === 187; + } + function isArrayTypeNode(node) { + return node.kind === 188; + } + function isTupleTypeNode(node) { + return node.kind === 189; + } + function isNamedTupleMember(node) { + return node.kind === 202; + } + function isOptionalTypeNode(node) { + return node.kind === 190; + } + function isRestTypeNode(node) { + return node.kind === 191; + } + function isUnionTypeNode(node) { + return node.kind === 192; + } + function isIntersectionTypeNode(node) { + return node.kind === 193; + } + function isConditionalTypeNode(node) { + return node.kind === 194; + } + function isInferTypeNode(node) { + return node.kind === 195; + } + function isParenthesizedTypeNode(node) { + return node.kind === 196; + } + function isThisTypeNode(node) { + return node.kind === 197; + } + function isTypeOperatorNode(node) { + return node.kind === 198; + } + function isIndexedAccessTypeNode(node) { + return node.kind === 199; + } + function isMappedTypeNode(node) { + return node.kind === 200; + } + function isLiteralTypeNode(node) { + return node.kind === 201; + } + function isImportTypeNode(node) { + return node.kind === 205; + } + function isTemplateLiteralTypeSpan(node) { + return node.kind === 204; + } + function isTemplateLiteralTypeNode(node) { + return node.kind === 203; + } + function isObjectBindingPattern(node) { + return node.kind === 206; + } + function isArrayBindingPattern(node) { + return node.kind === 207; + } + function isBindingElement(node) { + return node.kind === 208; + } + function isArrayLiteralExpression(node) { + return node.kind === 209; + } + function isObjectLiteralExpression(node) { + return node.kind === 210; + } + function isPropertyAccessExpression(node) { + return node.kind === 211; + } + function isElementAccessExpression(node) { + return node.kind === 212; + } + function isCallExpression(node) { + return node.kind === 213; + } + function isNewExpression(node) { + return node.kind === 214; + } + function isTaggedTemplateExpression(node) { + return node.kind === 215; + } + function isTypeAssertionExpression(node) { + return node.kind === 216; + } + function isParenthesizedExpression(node) { + return node.kind === 217; + } + function isFunctionExpression(node) { + return node.kind === 218; + } + function isArrowFunction(node) { + return node.kind === 219; + } + function isDeleteExpression(node) { + return node.kind === 220; + } + function isTypeOfExpression(node) { + return node.kind === 221; + } + function isVoidExpression(node) { + return node.kind === 222; + } + function isAwaitExpression(node) { + return node.kind === 223; + } + function isPrefixUnaryExpression(node) { + return node.kind === 224; + } + function isPostfixUnaryExpression(node) { + return node.kind === 225; + } + function isBinaryExpression(node) { + return node.kind === 226; + } + function isConditionalExpression(node) { + return node.kind === 227; + } + function isTemplateExpression(node) { + return node.kind === 228; + } + function isYieldExpression(node) { + return node.kind === 229; + } + function isSpreadElement(node) { + return node.kind === 230; + } + function isClassExpression(node) { + return node.kind === 231; + } + function isOmittedExpression(node) { + return node.kind === 232; + } + function isExpressionWithTypeArguments(node) { + return node.kind === 233; + } + function isAsExpression(node) { + return node.kind === 234; + } + function isSatisfiesExpression(node) { + return node.kind === 238; + } + function isNonNullExpression(node) { + return node.kind === 235; + } + function isMetaProperty(node) { + return node.kind === 236; + } + function isSyntheticExpression(node) { + return node.kind === 237; + } + function isPartiallyEmittedExpression(node) { + return node.kind === 360; + } + function isCommaListExpression(node) { + return node.kind === 361; + } + function isTemplateSpan(node) { + return node.kind === 239; + } + function isSemicolonClassElement(node) { + return node.kind === 240; + } + function isBlock2(node) { + return node.kind === 241; + } + function isVariableStatement(node) { + return node.kind === 243; + } + function isEmptyStatement(node) { + return node.kind === 242; + } + function isExpressionStatement(node) { + return node.kind === 244; + } + function isIfStatement(node) { + return node.kind === 245; + } + function isDoStatement(node) { + return node.kind === 246; + } + function isWhileStatement(node) { + return node.kind === 247; + } + function isForStatement(node) { + return node.kind === 248; + } + function isForInStatement(node) { + return node.kind === 249; + } + function isForOfStatement(node) { + return node.kind === 250; + } + function isContinueStatement(node) { + return node.kind === 251; + } + function isBreakStatement(node) { + return node.kind === 252; + } + function isReturnStatement(node) { + return node.kind === 253; + } + function isWithStatement(node) { + return node.kind === 254; + } + function isSwitchStatement(node) { + return node.kind === 255; + } + function isLabeledStatement(node) { + return node.kind === 256; + } + function isThrowStatement(node) { + return node.kind === 257; + } + function isTryStatement(node) { + return node.kind === 258; + } + function isDebuggerStatement(node) { + return node.kind === 259; + } + function isVariableDeclaration(node) { + return node.kind === 260; + } + function isVariableDeclarationList(node) { + return node.kind === 261; + } + function isFunctionDeclaration(node) { + return node.kind === 262; + } + function isClassDeclaration(node) { + return node.kind === 263; + } + function isInterfaceDeclaration(node) { + return node.kind === 264; + } + function isTypeAliasDeclaration(node) { + return node.kind === 265; + } + function isEnumDeclaration(node) { + return node.kind === 266; + } + function isModuleDeclaration(node) { + return node.kind === 267; + } + function isModuleBlock(node) { + return node.kind === 268; + } + function isCaseBlock(node) { + return node.kind === 269; + } + function isNamespaceExportDeclaration(node) { + return node.kind === 270; + } + function isImportEqualsDeclaration(node) { + return node.kind === 271; + } + function isImportDeclaration(node) { + return node.kind === 272; + } + function isImportClause(node) { + return node.kind === 273; + } + function isImportTypeAssertionContainer(node) { + return node.kind === 302; + } + function isAssertClause(node) { + return node.kind === 300; + } + function isAssertEntry(node) { + return node.kind === 301; + } + function isImportAttributes(node) { + return node.kind === 300; + } + function isImportAttribute(node) { + return node.kind === 301; + } + function isNamespaceImport(node) { + return node.kind === 274; + } + function isNamespaceExport(node) { + return node.kind === 280; + } + function isNamedImports(node) { + return node.kind === 275; + } + function isImportSpecifier(node) { + return node.kind === 276; + } + function isExportAssignment(node) { + return node.kind === 277; + } + function isExportDeclaration(node) { + return node.kind === 278; + } + function isNamedExports(node) { + return node.kind === 279; + } + function isExportSpecifier(node) { + return node.kind === 281; + } + function isMissingDeclaration(node) { + return node.kind === 282; + } + function isNotEmittedStatement(node) { + return node.kind === 359; + } + function isSyntheticReference(node) { + return node.kind === 362; + } + function isExternalModuleReference(node) { + return node.kind === 283; + } + function isJsxElement(node) { + return node.kind === 284; + } + function isJsxSelfClosingElement(node) { + return node.kind === 285; + } + function isJsxOpeningElement(node) { + return node.kind === 286; + } + function isJsxClosingElement(node) { + return node.kind === 287; + } + function isJsxFragment(node) { + return node.kind === 288; + } + function isJsxOpeningFragment(node) { + return node.kind === 289; + } + function isJsxClosingFragment(node) { + return node.kind === 290; + } + function isJsxAttribute(node) { + return node.kind === 291; + } + function isJsxAttributes(node) { + return node.kind === 292; + } + function isJsxSpreadAttribute(node) { + return node.kind === 293; + } + function isJsxExpression(node) { + return node.kind === 294; + } + function isJsxNamespacedName(node) { + return node.kind === 295; + } + function isCaseClause(node) { + return node.kind === 296; + } + function isDefaultClause(node) { + return node.kind === 297; + } + function isHeritageClause(node) { + return node.kind === 298; + } + function isCatchClause(node) { + return node.kind === 299; + } + function isPropertyAssignment(node) { + return node.kind === 303; + } + function isShorthandPropertyAssignment(node) { + return node.kind === 304; + } + function isSpreadAssignment(node) { + return node.kind === 305; + } + function isEnumMember(node) { + return node.kind === 306; + } + function isUnparsedPrepend(node) { + return node.kind === 308; + } + function isSourceFile(node) { + return node.kind === 312; + } + function isBundle(node) { + return node.kind === 313; + } + function isUnparsedSource(node) { + return node.kind === 314; + } + function isJSDocTypeExpression(node) { + return node.kind === 316; + } + function isJSDocNameReference(node) { + return node.kind === 317; + } + function isJSDocMemberName(node) { + return node.kind === 318; + } + function isJSDocLink(node) { + return node.kind === 331; + } + function isJSDocLinkCode(node) { + return node.kind === 332; + } + function isJSDocLinkPlain(node) { + return node.kind === 333; + } + function isJSDocAllType(node) { + return node.kind === 319; + } + function isJSDocUnknownType(node) { + return node.kind === 320; + } + function isJSDocNullableType(node) { + return node.kind === 321; + } + function isJSDocNonNullableType(node) { + return node.kind === 322; + } + function isJSDocOptionalType(node) { + return node.kind === 323; + } + function isJSDocFunctionType(node) { + return node.kind === 324; + } + function isJSDocVariadicType(node) { + return node.kind === 325; + } + function isJSDocNamepathType(node) { + return node.kind === 326; + } + function isJSDoc(node) { + return node.kind === 327; + } + function isJSDocTypeLiteral(node) { + return node.kind === 329; + } + function isJSDocSignature(node) { + return node.kind === 330; + } + function isJSDocAugmentsTag(node) { + return node.kind === 335; + } + function isJSDocAuthorTag(node) { + return node.kind === 337; + } + function isJSDocClassTag(node) { + return node.kind === 339; + } + function isJSDocCallbackTag(node) { + return node.kind === 345; + } + function isJSDocPublicTag(node) { + return node.kind === 340; + } + function isJSDocPrivateTag(node) { + return node.kind === 341; + } + function isJSDocProtectedTag(node) { + return node.kind === 342; + } + function isJSDocReadonlyTag(node) { + return node.kind === 343; + } + function isJSDocOverrideTag(node) { + return node.kind === 344; + } + function isJSDocOverloadTag(node) { + return node.kind === 346; + } + function isJSDocDeprecatedTag(node) { + return node.kind === 338; + } + function isJSDocSeeTag(node) { + return node.kind === 354; + } + function isJSDocEnumTag(node) { + return node.kind === 347; + } + function isJSDocParameterTag(node) { + return node.kind === 348; + } + function isJSDocReturnTag(node) { + return node.kind === 349; + } + function isJSDocThisTag(node) { + return node.kind === 350; + } + function isJSDocTypeTag(node) { + return node.kind === 351; + } + function isJSDocTemplateTag(node) { + return node.kind === 352; + } + function isJSDocTypedefTag(node) { + return node.kind === 353; + } + function isJSDocUnknownTag(node) { + return node.kind === 334; + } + function isJSDocPropertyTag(node) { + return node.kind === 355; + } + function isJSDocImplementsTag(node) { + return node.kind === 336; + } + function isJSDocSatisfiesTag(node) { + return node.kind === 357; + } + function isJSDocThrowsTag(node) { + return node.kind === 356; + } + function isSyntaxList(n7) { + return n7.kind === 358; + } + var init_nodeTests = __esm2({ + "src/compiler/factory/nodeTests.ts"() { + "use strict"; + init_ts2(); + } + }); + function createEmptyExports(factory2) { + return factory2.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory2.createNamedExports([]), + /*moduleSpecifier*/ + void 0 + ); + } + function createMemberAccessForPropertyName(factory2, target, memberName, location2) { + if (isComputedPropertyName(memberName)) { + return setTextRange(factory2.createElementAccessExpression(target, memberName.expression), location2); + } else { + const expression = setTextRange( + isMemberName(memberName) ? factory2.createPropertyAccessExpression(target, memberName) : factory2.createElementAccessExpression(target, memberName), + memberName + ); + addEmitFlags( + expression, + 128 + /* NoNestedSourceMaps */ + ); + return expression; + } + } + function createReactNamespace(reactNamespace, parent22) { + const react = parseNodeFactory.createIdentifier(reactNamespace || "React"); + setParent(react, getParseTreeNode(parent22)); + return react; + } + function createJsxFactoryExpressionFromEntityName(factory2, jsxFactory, parent22) { + if (isQualifiedName(jsxFactory)) { + const left = createJsxFactoryExpressionFromEntityName(factory2, jsxFactory.left, parent22); + const right = factory2.createIdentifier(idText(jsxFactory.right)); + right.escapedText = jsxFactory.right.escapedText; + return factory2.createPropertyAccessExpression(left, right); + } else { + return createReactNamespace(idText(jsxFactory), parent22); + } + } + function createJsxFactoryExpression(factory2, jsxFactoryEntity, reactNamespace, parent22) { + return jsxFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory2, jsxFactoryEntity, parent22) : factory2.createPropertyAccessExpression( + createReactNamespace(reactNamespace, parent22), + "createElement" + ); + } + function createJsxFragmentFactoryExpression(factory2, jsxFragmentFactoryEntity, reactNamespace, parent22) { + return jsxFragmentFactoryEntity ? createJsxFactoryExpressionFromEntityName(factory2, jsxFragmentFactoryEntity, parent22) : factory2.createPropertyAccessExpression( + createReactNamespace(reactNamespace, parent22), + "Fragment" + ); + } + function createExpressionForJsxElement(factory2, callee, tagName, props, children, location2) { + const argumentsList = [tagName]; + if (props) { + argumentsList.push(props); + } + if (children && children.length > 0) { + if (!props) { + argumentsList.push(factory2.createNull()); + } + if (children.length > 1) { + for (const child of children) { + startOnNewLine(child); + argumentsList.push(child); + } + } else { + argumentsList.push(children[0]); + } + } + return setTextRange( + factory2.createCallExpression( + callee, + /*typeArguments*/ + void 0, + argumentsList + ), + location2 + ); + } + function createExpressionForJsxFragment(factory2, jsxFactoryEntity, jsxFragmentFactoryEntity, reactNamespace, children, parentElement, location2) { + const tagName = createJsxFragmentFactoryExpression(factory2, jsxFragmentFactoryEntity, reactNamespace, parentElement); + const argumentsList = [tagName, factory2.createNull()]; + if (children && children.length > 0) { + if (children.length > 1) { + for (const child of children) { + startOnNewLine(child); + argumentsList.push(child); + } + } else { + argumentsList.push(children[0]); + } + } + return setTextRange( + factory2.createCallExpression( + createJsxFactoryExpression(factory2, jsxFactoryEntity, reactNamespace, parentElement), + /*typeArguments*/ + void 0, + argumentsList + ), + location2 + ); + } + function createForOfBindingStatement(factory2, node, boundValue) { + if (isVariableDeclarationList(node)) { + const firstDeclaration = first(node.declarations); + const updatedDeclaration = factory2.updateVariableDeclaration( + firstDeclaration, + firstDeclaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + boundValue + ); + return setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.updateVariableDeclarationList(node, [updatedDeclaration]) + ), + /*location*/ + node + ); + } else { + const updatedExpression = setTextRange( + factory2.createAssignment(node, boundValue), + /*location*/ + node + ); + return setTextRange( + factory2.createExpressionStatement(updatedExpression), + /*location*/ + node + ); + } + } + function insertLeadingStatement(factory2, dest, source) { + if (isBlock2(dest)) { + return factory2.updateBlock(dest, setTextRange(factory2.createNodeArray([source, ...dest.statements]), dest.statements)); + } else { + return factory2.createBlock( + factory2.createNodeArray([dest, source]), + /*multiLine*/ + true + ); + } + } + function createExpressionFromEntityName(factory2, node) { + if (isQualifiedName(node)) { + const left = createExpressionFromEntityName(factory2, node.left); + const right = setParent(setTextRange(factory2.cloneNode(node.right), node.right), node.right.parent); + return setTextRange(factory2.createPropertyAccessExpression(left, right), node); + } else { + return setParent(setTextRange(factory2.cloneNode(node), node), node.parent); + } + } + function createExpressionForPropertyName(factory2, memberName) { + if (isIdentifier(memberName)) { + return factory2.createStringLiteralFromNode(memberName); + } else if (isComputedPropertyName(memberName)) { + return setParent(setTextRange(factory2.cloneNode(memberName.expression), memberName.expression), memberName.expression.parent); + } else { + return setParent(setTextRange(factory2.cloneNode(memberName), memberName), memberName.parent); + } + } + function createExpressionForAccessorDeclaration(factory2, properties, property2, receiver, multiLine) { + const { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(properties, property2); + if (property2 === firstAccessor) { + return setTextRange( + factory2.createObjectDefinePropertyCall( + receiver, + createExpressionForPropertyName(factory2, property2.name), + factory2.createPropertyDescriptor({ + enumerable: factory2.createFalse(), + configurable: true, + get: getAccessor && setTextRange( + setOriginalNode( + factory2.createFunctionExpression( + getModifiers(getAccessor), + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + getAccessor.parameters, + /*type*/ + void 0, + getAccessor.body + // TODO: GH#18217 + ), + getAccessor + ), + getAccessor + ), + set: setAccessor && setTextRange( + setOriginalNode( + factory2.createFunctionExpression( + getModifiers(setAccessor), + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + setAccessor.parameters, + /*type*/ + void 0, + setAccessor.body + // TODO: GH#18217 + ), + setAccessor + ), + setAccessor + ) + }, !multiLine) + ), + firstAccessor + ); + } + return void 0; + } + function createExpressionForPropertyAssignment(factory2, property2, receiver) { + return setOriginalNode( + setTextRange( + factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + property2.name, + /*location*/ + property2.name + ), + property2.initializer + ), + property2 + ), + property2 + ); + } + function createExpressionForShorthandPropertyAssignment(factory2, property2, receiver) { + return setOriginalNode( + setTextRange( + factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + property2.name, + /*location*/ + property2.name + ), + factory2.cloneNode(property2.name) + ), + /*location*/ + property2 + ), + /*original*/ + property2 + ); + } + function createExpressionForMethodDeclaration(factory2, method2, receiver) { + return setOriginalNode( + setTextRange( + factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + method2.name, + /*location*/ + method2.name + ), + setOriginalNode( + setTextRange( + factory2.createFunctionExpression( + getModifiers(method2), + method2.asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + method2.parameters, + /*type*/ + void 0, + method2.body + // TODO: GH#18217 + ), + /*location*/ + method2 + ), + /*original*/ + method2 + ) + ), + /*location*/ + method2 + ), + /*original*/ + method2 + ); + } + function createExpressionForObjectLiteralElementLike(factory2, node, property2, receiver) { + if (property2.name && isPrivateIdentifier(property2.name)) { + Debug.failBadSyntaxKind(property2.name, "Private identifiers are not allowed in object literals."); + } + switch (property2.kind) { + case 177: + case 178: + return createExpressionForAccessorDeclaration(factory2, node.properties, property2, receiver, !!node.multiLine); + case 303: + return createExpressionForPropertyAssignment(factory2, property2, receiver); + case 304: + return createExpressionForShorthandPropertyAssignment(factory2, property2, receiver); + case 174: + return createExpressionForMethodDeclaration(factory2, property2, receiver); + } + } + function expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, recordTempVariable, resultVariable) { + const operator = node.operator; + Debug.assert(operator === 46 || operator === 47, "Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression"); + const temp = factory2.createTempVariable(recordTempVariable); + expression = factory2.createAssignment(temp, expression); + setTextRange(expression, node.operand); + let operation = isPrefixUnaryExpression(node) ? factory2.createPrefixUnaryExpression(operator, temp) : factory2.createPostfixUnaryExpression(temp, operator); + setTextRange(operation, node); + if (resultVariable) { + operation = factory2.createAssignment(resultVariable, operation); + setTextRange(operation, node); + } + expression = factory2.createComma(expression, operation); + setTextRange(expression, node); + if (isPostfixUnaryExpression(node)) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + function isInternalName(node) { + return (getEmitFlags(node) & 65536) !== 0; + } + function isLocalName(node) { + return (getEmitFlags(node) & 32768) !== 0; + } + function isExportName(node) { + return (getEmitFlags(node) & 16384) !== 0; + } + function isUseStrictPrologue(node) { + return isStringLiteral(node.expression) && node.expression.text === "use strict"; + } + function findUseStrictPrologue(statements) { + for (const statement of statements) { + if (isPrologueDirective(statement)) { + if (isUseStrictPrologue(statement)) { + return statement; + } + } else { + break; + } + } + return void 0; + } + function startsWithUseStrict(statements) { + const firstStatement = firstOrUndefined(statements); + return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement); + } + function isCommaExpression(node) { + return node.kind === 226 && node.operatorToken.kind === 28; + } + function isCommaSequence(node) { + return isCommaExpression(node) || isCommaListExpression(node); + } + function isJSDocTypeAssertion(node) { + return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); + } + function getJSDocTypeAssertionType(node) { + const type3 = getJSDocType(node); + Debug.assertIsDefined(type3); + return type3; + } + function isOuterExpression(node, kinds = 15) { + switch (node.kind) { + case 217: + if (kinds & 16 && isJSDocTypeAssertion(node)) { + return false; + } + return (kinds & 1) !== 0; + case 216: + case 234: + case 233: + case 238: + return (kinds & 2) !== 0; + case 235: + return (kinds & 4) !== 0; + case 360: + return (kinds & 8) !== 0; + } + return false; + } + function skipOuterExpressions(node, kinds = 15) { + while (isOuterExpression(node, kinds)) { + node = node.expression; + } + return node; + } + function walkUpOuterExpressions(node, kinds = 15) { + let parent22 = node.parent; + while (isOuterExpression(parent22, kinds)) { + parent22 = parent22.parent; + Debug.assert(parent22); + } + return parent22; + } + function skipAssertions(node) { + return skipOuterExpressions( + node, + 6 + /* Assertions */ + ); + } + function startOnNewLine(node) { + return setStartsOnNewLine( + node, + /*newLine*/ + true + ); + } + function getExternalHelpersModuleName(node) { + const parseNode = getOriginalNode(node, isSourceFile); + const emitNode = parseNode && parseNode.emitNode; + return emitNode && emitNode.externalHelpersModuleName; + } + function hasRecordedExternalHelpers(sourceFile) { + const parseNode = getOriginalNode(sourceFile, isSourceFile); + const emitNode = parseNode && parseNode.emitNode; + return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); + } + function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) { + if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) { + let namedBindings; + const moduleKind = getEmitModuleKind(compilerOptions); + if (moduleKind >= 5 && moduleKind <= 99 || sourceFile.impliedNodeFormat === 99) { + const helpers = getEmitHelpers(sourceFile); + if (helpers) { + const helperNames = []; + for (const helper of helpers) { + if (!helper.scoped) { + const importName = helper.importName; + if (importName) { + pushIfUnique(helperNames, importName); + } + } + } + if (some2(helperNames)) { + helperNames.sort(compareStringsCaseSensitive); + namedBindings = nodeFactory.createNamedImports( + map4(helperNames, (name2) => isFileLevelUniqueName(sourceFile, name2) ? nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + nodeFactory.createIdentifier(name2) + ) : nodeFactory.createImportSpecifier( + /*isTypeOnly*/ + false, + nodeFactory.createIdentifier(name2), + helperFactory.getUnscopedHelperName(name2) + )) + ); + const parseNode = getOriginalNode(sourceFile, isSourceFile); + const emitNode = getOrCreateEmitNode(parseNode); + emitNode.externalHelpers = true; + } + } + } else { + const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault); + if (externalHelpersModuleName) { + namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName); + } + } + if (namedBindings) { + const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration( + /*modifiers*/ + void 0, + nodeFactory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + namedBindings + ), + nodeFactory.createStringLiteral(externalHelpersModuleNameText), + /*attributes*/ + void 0 + ); + addInternalEmitFlags( + externalHelpersImportDeclaration, + 2 + /* NeverApplyImportHelper */ + ); + return externalHelpersImportDeclaration; + } + } + } + function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { + if (compilerOptions.importHelpers && isEffectiveExternalModule(node, compilerOptions)) { + const externalHelpersModuleName = getExternalHelpersModuleName(node); + if (externalHelpersModuleName) { + return externalHelpersModuleName; + } + const moduleKind = getEmitModuleKind(compilerOptions); + let create2 = (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && moduleKind !== 4 && (moduleKind < 5 || node.impliedNodeFormat === 1); + if (!create2) { + const helpers = getEmitHelpers(node); + if (helpers) { + for (const helper of helpers) { + if (!helper.scoped) { + create2 = true; + break; + } + } + } + } + if (create2) { + const parseNode = getOriginalNode(node, isSourceFile); + const emitNode = getOrCreateEmitNode(parseNode); + return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText)); + } + } + } + function getLocalNameForExternalImport(factory2, node, sourceFile) { + const namespaceDeclaration = getNamespaceDeclarationNode(node); + if (namespaceDeclaration && !isDefaultImport(node) && !isExportNamespaceAsDefaultDeclaration(node)) { + const name2 = namespaceDeclaration.name; + return isGeneratedIdentifier(name2) ? name2 : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name2) || idText(name2)); + } + if (node.kind === 272 && node.importClause) { + return factory2.getGeneratedNameForNode(node); + } + if (node.kind === 278 && node.moduleSpecifier) { + return factory2.getGeneratedNameForNode(node); + } + return void 0; + } + function getExternalModuleNameLiteral(factory2, importNode, sourceFile, host, resolver, compilerOptions) { + const moduleName3 = getExternalModuleName(importNode); + if (moduleName3 && isStringLiteral(moduleName3)) { + return tryGetModuleNameFromDeclaration(importNode, host, factory2, resolver, compilerOptions) || tryRenameExternalModule(factory2, moduleName3, sourceFile) || factory2.cloneNode(moduleName3); + } + return void 0; + } + function tryRenameExternalModule(factory2, moduleName3, sourceFile) { + const rename2 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName3.text); + return rename2 ? factory2.createStringLiteral(rename2) : void 0; + } + function tryGetModuleNameFromFile(factory2, file, host, options) { + if (!file) { + return void 0; + } + if (file.moduleName) { + return factory2.createStringLiteral(file.moduleName); + } + if (!file.isDeclarationFile && outFile(options)) { + return factory2.createStringLiteral(getExternalModuleNameFromPath(host, file.fileName)); + } + return void 0; + } + function tryGetModuleNameFromDeclaration(declaration, host, factory2, resolver, compilerOptions) { + return tryGetModuleNameFromFile(factory2, resolver.getExternalModuleFileFromDeclaration(declaration), host, compilerOptions); + } + function getInitializerOfBindingOrAssignmentElement(bindingElement) { + if (isDeclarationBindingElement(bindingElement)) { + return bindingElement.initializer; + } + if (isPropertyAssignment(bindingElement)) { + const initializer = bindingElement.initializer; + return isAssignmentExpression( + initializer, + /*excludeCompoundAssignment*/ + true + ) ? initializer.right : void 0; + } + if (isShorthandPropertyAssignment(bindingElement)) { + return bindingElement.objectAssignmentInitializer; + } + if (isAssignmentExpression( + bindingElement, + /*excludeCompoundAssignment*/ + true + )) { + return bindingElement.right; + } + if (isSpreadElement(bindingElement)) { + return getInitializerOfBindingOrAssignmentElement(bindingElement.expression); + } + } + function getTargetOfBindingOrAssignmentElement(bindingElement) { + if (isDeclarationBindingElement(bindingElement)) { + return bindingElement.name; + } + if (isObjectLiteralElementLike(bindingElement)) { + switch (bindingElement.kind) { + case 303: + return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); + case 304: + return bindingElement.name; + case 305: + return getTargetOfBindingOrAssignmentElement(bindingElement.expression); + } + return void 0; + } + if (isAssignmentExpression( + bindingElement, + /*excludeCompoundAssignment*/ + true + )) { + return getTargetOfBindingOrAssignmentElement(bindingElement.left); + } + if (isSpreadElement(bindingElement)) { + return getTargetOfBindingOrAssignmentElement(bindingElement.expression); + } + return bindingElement; + } + function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { + switch (bindingElement.kind) { + case 169: + case 208: + return bindingElement.dotDotDotToken; + case 230: + case 305: + return bindingElement; + } + return void 0; + } + function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { + const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement); + Debug.assert(!!propertyName || isSpreadAssignment(bindingElement), "Invalid property name for binding element."); + return propertyName; + } + function tryGetPropertyNameOfBindingOrAssignmentElement(bindingElement) { + switch (bindingElement.kind) { + case 208: + if (bindingElement.propertyName) { + const propertyName = bindingElement.propertyName; + if (isPrivateIdentifier(propertyName)) { + return Debug.failBadSyntaxKind(propertyName); + } + return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; + } + break; + case 303: + if (bindingElement.name) { + const propertyName = bindingElement.name; + if (isPrivateIdentifier(propertyName)) { + return Debug.failBadSyntaxKind(propertyName); + } + return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; + } + break; + case 305: + if (bindingElement.name && isPrivateIdentifier(bindingElement.name)) { + return Debug.failBadSyntaxKind(bindingElement.name); + } + return bindingElement.name; + } + const target = getTargetOfBindingOrAssignmentElement(bindingElement); + if (target && isPropertyName(target)) { + return target; + } + } + function isStringOrNumericLiteral(node) { + const kind = node.kind; + return kind === 11 || kind === 9; + } + function getElementsOfBindingOrAssignmentPattern(name2) { + switch (name2.kind) { + case 206: + case 207: + case 209: + return name2.elements; + case 210: + return name2.properties; + } + } + function getJSDocTypeAliasName(fullName) { + if (fullName) { + let rightNode = fullName; + while (true) { + if (isIdentifier(rightNode) || !rightNode.body) { + return isIdentifier(rightNode) ? rightNode : rightNode.name; + } + rightNode = rightNode.body; + } + } + } + function canHaveIllegalType(node) { + const kind = node.kind; + return kind === 176 || kind === 178; + } + function canHaveIllegalTypeParameters(node) { + const kind = node.kind; + return kind === 176 || kind === 177 || kind === 178; + } + function canHaveIllegalDecorators(node) { + const kind = node.kind; + return kind === 303 || kind === 304 || kind === 262 || kind === 176 || kind === 181 || kind === 175 || kind === 282 || kind === 243 || kind === 264 || kind === 265 || kind === 266 || kind === 267 || kind === 271 || kind === 272 || kind === 270 || kind === 278 || kind === 277; + } + function canHaveIllegalModifiers(node) { + const kind = node.kind; + return kind === 175 || kind === 303 || kind === 304 || kind === 282 || kind === 270; + } + function isQuestionOrExclamationToken(node) { + return isQuestionToken(node) || isExclamationToken(node); + } + function isIdentifierOrThisTypeNode(node) { + return isIdentifier(node) || isThisTypeNode(node); + } + function isReadonlyKeywordOrPlusOrMinusToken(node) { + return isReadonlyKeyword(node) || isPlusToken(node) || isMinusToken(node); + } + function isQuestionOrPlusOrMinusToken(node) { + return isQuestionToken(node) || isPlusToken(node) || isMinusToken(node); + } + function isModuleName(node) { + return isIdentifier(node) || isStringLiteral(node); + } + function isLiteralTypeLikeExpression(node) { + const kind = node.kind; + return kind === 106 || kind === 112 || kind === 97 || isLiteralExpression(node) || isPrefixUnaryExpression(node); + } + function isExponentiationOperator(kind) { + return kind === 43; + } + function isMultiplicativeOperator(kind) { + return kind === 42 || kind === 44 || kind === 45; + } + function isMultiplicativeOperatorOrHigher(kind) { + return isExponentiationOperator(kind) || isMultiplicativeOperator(kind); + } + function isAdditiveOperator(kind) { + return kind === 40 || kind === 41; + } + function isAdditiveOperatorOrHigher(kind) { + return isAdditiveOperator(kind) || isMultiplicativeOperatorOrHigher(kind); + } + function isShiftOperator(kind) { + return kind === 48 || kind === 49 || kind === 50; + } + function isShiftOperatorOrHigher(kind) { + return isShiftOperator(kind) || isAdditiveOperatorOrHigher(kind); + } + function isRelationalOperator(kind) { + return kind === 30 || kind === 33 || kind === 32 || kind === 34 || kind === 104 || kind === 103; + } + function isRelationalOperatorOrHigher(kind) { + return isRelationalOperator(kind) || isShiftOperatorOrHigher(kind); + } + function isEqualityOperator(kind) { + return kind === 35 || kind === 37 || kind === 36 || kind === 38; + } + function isEqualityOperatorOrHigher(kind) { + return isEqualityOperator(kind) || isRelationalOperatorOrHigher(kind); + } + function isBitwiseOperator(kind) { + return kind === 51 || kind === 52 || kind === 53; + } + function isBitwiseOperatorOrHigher(kind) { + return isBitwiseOperator(kind) || isEqualityOperatorOrHigher(kind); + } + function isLogicalOperator2(kind) { + return kind === 56 || kind === 57; + } + function isLogicalOperatorOrHigher(kind) { + return isLogicalOperator2(kind) || isBitwiseOperatorOrHigher(kind); + } + function isAssignmentOperatorOrHigher(kind) { + return kind === 61 || isLogicalOperatorOrHigher(kind) || isAssignmentOperator(kind); + } + function isBinaryOperator(kind) { + return isAssignmentOperatorOrHigher(kind) || kind === 28; + } + function isBinaryOperatorToken(node) { + return isBinaryOperator(node.kind); + } + function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState) { + const machine = new BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState); + return trampoline; + function trampoline(node, outerState) { + const resultHolder = { value: void 0 }; + const stateStack = [BinaryExpressionState.enter]; + const nodeStack = [node]; + const userStateStack = [void 0]; + let stackIndex = 0; + while (stateStack[stackIndex] !== BinaryExpressionState.done) { + stackIndex = stateStack[stackIndex](machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, outerState); + } + Debug.assertEqual(stackIndex, 0); + return resultHolder.value; + } + } + function isExportOrDefaultKeywordKind(kind) { + return kind === 95 || kind === 90; + } + function isExportOrDefaultModifier(node) { + const kind = node.kind; + return isExportOrDefaultKeywordKind(kind); + } + function isNonExportDefaultModifier(node) { + const kind = node.kind; + return isModifierKind(kind) && !isExportOrDefaultKeywordKind(kind); + } + function elideNodes(factory2, nodes) { + if (nodes === void 0) + return void 0; + if (nodes.length === 0) + return nodes; + return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes); + } + function getNodeForGeneratedName(name2) { + var _a2; + const autoGenerate = name2.emitNode.autoGenerate; + if (autoGenerate.flags & 4) { + const autoGenerateId = autoGenerate.id; + let node = name2; + let original = node.original; + while (original) { + node = original; + const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate; + if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4) && autoGenerate2.id !== autoGenerateId)) { + break; + } + original = node.original; + } + return node; + } + return name2; + } + function formatGeneratedNamePart(part, generateName) { + return typeof part === "object" ? formatGeneratedName( + /*privateName*/ + false, + part.prefix, + part.node, + part.suffix, + generateName + ) : typeof part === "string" ? part.length > 0 && part.charCodeAt(0) === 35 ? part.slice(1) : part : ""; + } + function formatIdentifier(name2, generateName) { + return typeof name2 === "string" ? name2 : formatIdentifierWorker(name2, Debug.checkDefined(generateName)); + } + function formatIdentifierWorker(node, generateName) { + return isGeneratedPrivateIdentifier(node) ? generateName(node).slice(1) : isGeneratedIdentifier(node) ? generateName(node) : isPrivateIdentifier(node) ? node.escapedText.slice(1) : idText(node); + } + function formatGeneratedName(privateName, prefix, baseName, suffix, generateName) { + prefix = formatGeneratedNamePart(prefix, generateName); + suffix = formatGeneratedNamePart(suffix, generateName); + baseName = formatIdentifier(baseName, generateName); + return `${privateName ? "#" : ""}${prefix}${baseName}${suffix}`; + } + function createAccessorPropertyBackingField(factory2, node, modifiers, initializer) { + return factory2.updatePropertyDeclaration( + node, + modifiers, + factory2.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + ), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + function createAccessorPropertyGetRedirector(factory2, node, modifiers, name2, receiver = factory2.createThis()) { + return factory2.createGetAccessorDeclaration( + modifiers, + name2, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + receiver, + factory2.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + ) + ) + ) + ]) + ); + } + function createAccessorPropertySetRedirector(factory2, node, modifiers, name2, receiver = factory2.createThis()) { + return factory2.createSetAccessorDeclaration( + modifiers, + name2, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + receiver, + factory2.getGeneratedPrivateNameForNode( + node.name, + /*prefix*/ + void 0, + "_accessor_storage" + ) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ); + } + function findComputedPropertyNameCacheAssignment(name2) { + let node = name2.expression; + while (true) { + node = skipOuterExpressions(node); + if (isCommaListExpression(node)) { + node = last2(node.elements); + continue; + } + if (isCommaExpression(node)) { + node = node.right; + continue; + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isGeneratedIdentifier(node.left)) { + return node; + } + break; + } + } + function isSyntheticParenthesizedExpression(node) { + return isParenthesizedExpression(node) && nodeIsSynthesized(node) && !node.emitNode; + } + function flattenCommaListWorker(node, expressions) { + if (isSyntheticParenthesizedExpression(node)) { + flattenCommaListWorker(node.expression, expressions); + } else if (isCommaExpression(node)) { + flattenCommaListWorker(node.left, expressions); + flattenCommaListWorker(node.right, expressions); + } else if (isCommaListExpression(node)) { + for (const child of node.elements) { + flattenCommaListWorker(child, expressions); + } + } else { + expressions.push(node); + } + } + function flattenCommaList(node) { + const expressions = []; + flattenCommaListWorker(node, expressions); + return expressions; + } + function containsObjectRestOrSpread(node) { + if (node.transformFlags & 65536) + return true; + if (node.transformFlags & 128) { + for (const element of getElementsOfBindingOrAssignmentPattern(node)) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (target && isAssignmentPattern(target)) { + if (target.transformFlags & 65536) { + return true; + } + if (target.transformFlags & 128) { + if (containsObjectRestOrSpread(target)) + return true; + } + } + } + } + return false; + } + var BinaryExpressionState, BinaryExpressionStateMachine; + var init_utilities2 = __esm2({ + "src/compiler/factory/utilities.ts"() { + "use strict"; + init_ts2(); + ((BinaryExpressionState2) => { + function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { + const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; + Debug.assertEqual(stateStack[stackIndex], enter); + userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState); + stateStack[stackIndex] = nextState(machine, enter); + return stackIndex; + } + BinaryExpressionState2.enter = enter; + function left(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + Debug.assertEqual(stateStack[stackIndex], left); + Debug.assertIsDefined(machine.onLeft); + stateStack[stackIndex] = nextState(machine, left); + const nextNode = machine.onLeft(nodeStack[stackIndex].left, userStateStack[stackIndex], nodeStack[stackIndex]); + if (nextNode) { + checkCircularity(stackIndex, nodeStack, nextNode); + return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); + } + return stackIndex; + } + BinaryExpressionState2.left = left; + function operator(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + Debug.assertEqual(stateStack[stackIndex], operator); + Debug.assertIsDefined(machine.onOperator); + stateStack[stackIndex] = nextState(machine, operator); + machine.onOperator(nodeStack[stackIndex].operatorToken, userStateStack[stackIndex], nodeStack[stackIndex]); + return stackIndex; + } + BinaryExpressionState2.operator = operator; + function right(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { + Debug.assertEqual(stateStack[stackIndex], right); + Debug.assertIsDefined(machine.onRight); + stateStack[stackIndex] = nextState(machine, right); + const nextNode = machine.onRight(nodeStack[stackIndex].right, userStateStack[stackIndex], nodeStack[stackIndex]); + if (nextNode) { + checkCircularity(stackIndex, nodeStack, nextNode); + return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); + } + return stackIndex; + } + BinaryExpressionState2.right = right; + function exit3(machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, _outerState) { + Debug.assertEqual(stateStack[stackIndex], exit3); + stateStack[stackIndex] = nextState(machine, exit3); + const result2 = machine.onExit(nodeStack[stackIndex], userStateStack[stackIndex]); + if (stackIndex > 0) { + stackIndex--; + if (machine.foldState) { + const side = stateStack[stackIndex] === exit3 ? "right" : "left"; + userStateStack[stackIndex] = machine.foldState(userStateStack[stackIndex], result2, side); + } + } else { + resultHolder.value = result2; + } + return stackIndex; + } + BinaryExpressionState2.exit = exit3; + function done(_machine, stackIndex, stateStack, _nodeStack, _userStateStack, _resultHolder, _outerState) { + Debug.assertEqual(stateStack[stackIndex], done); + return stackIndex; + } + BinaryExpressionState2.done = done; + function nextState(machine, currentState) { + switch (currentState) { + case enter: + if (machine.onLeft) + return left; + case left: + if (machine.onOperator) + return operator; + case operator: + if (machine.onRight) + return right; + case right: + return exit3; + case exit3: + return done; + case done: + return done; + default: + Debug.fail("Invalid state"); + } + } + BinaryExpressionState2.nextState = nextState; + function pushStack(stackIndex, stateStack, nodeStack, userStateStack, node) { + stackIndex++; + stateStack[stackIndex] = enter; + nodeStack[stackIndex] = node; + userStateStack[stackIndex] = void 0; + return stackIndex; + } + function checkCircularity(stackIndex, nodeStack, node) { + if (Debug.shouldAssert( + 2 + /* Aggressive */ + )) { + while (stackIndex >= 0) { + Debug.assert(nodeStack[stackIndex] !== node, "Circular traversal detected."); + stackIndex--; + } + } + } + })(BinaryExpressionState || (BinaryExpressionState = {})); + BinaryExpressionStateMachine = class { + constructor(onEnter, onLeft, onOperator, onRight, onExit, foldState) { + this.onEnter = onEnter; + this.onLeft = onLeft; + this.onOperator = onOperator; + this.onRight = onRight; + this.onExit = onExit; + this.foldState = foldState; + } + }; + } + }); + function setTextRange(range2, location2) { + return location2 ? setTextRangePosEnd(range2, location2.pos, location2.end) : range2; + } + function canHaveModifiers(node) { + const kind = node.kind; + return kind === 168 || kind === 169 || kind === 171 || kind === 172 || kind === 173 || kind === 174 || kind === 176 || kind === 177 || kind === 178 || kind === 181 || kind === 185 || kind === 218 || kind === 219 || kind === 231 || kind === 243 || kind === 262 || kind === 263 || kind === 264 || kind === 265 || kind === 266 || kind === 267 || kind === 271 || kind === 272 || kind === 277 || kind === 278; + } + function canHaveDecorators(node) { + const kind = node.kind; + return kind === 169 || kind === 172 || kind === 174 || kind === 177 || kind === 178 || kind === 231 || kind === 263; + } + var init_utilitiesPublic2 = __esm2({ + "src/compiler/factory/utilitiesPublic.ts"() { + "use strict"; + init_ts2(); + } + }); + function visitNode2(cbNode, node) { + return node && cbNode(node); + } + function visitNodes(cbNode, cbNodes, nodes) { + if (nodes) { + if (cbNodes) { + return cbNodes(nodes); + } + for (const node of nodes) { + const result2 = cbNode(node); + if (result2) { + return result2; + } + } + } + } + function isJSDocLikeText(text, start) { + return text.charCodeAt(start + 1) === 42 && text.charCodeAt(start + 2) === 42 && text.charCodeAt(start + 3) !== 47; + } + function isFileProbablyExternalModule(sourceFile) { + return forEach4(sourceFile.statements, isAnExternalModuleIndicatorNode) || getImportMetaIfNecessary(sourceFile); + } + function isAnExternalModuleIndicatorNode(node) { + return canHaveModifiers(node) && hasModifierOfKind( + node, + 95 + /* ExportKeyword */ + ) || isImportEqualsDeclaration(node) && isExternalModuleReference(node.moduleReference) || isImportDeclaration(node) || isExportAssignment(node) || isExportDeclaration(node) ? node : void 0; + } + function getImportMetaIfNecessary(sourceFile) { + return sourceFile.flags & 8388608 ? walkTreeForImportMeta(sourceFile) : void 0; + } + function walkTreeForImportMeta(node) { + return isImportMeta2(node) ? node : forEachChild(node, walkTreeForImportMeta); + } + function hasModifierOfKind(node, kind) { + return some2(node.modifiers, (m7) => m7.kind === kind); + } + function isImportMeta2(node) { + return isMetaProperty(node) && node.keywordToken === 102 && node.name.escapedText === "meta"; + } + function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + } + function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.types); + } + function forEachChildInParenthesizedTypeOrTypeOperator(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.type); + } + function forEachChildInObjectOrArrayBindingPattern(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + } + function forEachChildInCallOrNewExpression(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.expression) || // TODO: should we separate these branches out? + visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); + } + function forEachChildInBlock(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements); + } + function forEachChildInContinueOrBreakStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.label); + } + function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + } + function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + } + function forEachChildInImportOrExportSpecifier(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name); + } + function forEachChildInJsxOpeningOrSelfClosingElement(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.attributes); + } + function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.type); + } + function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInJSDocTypeLikeTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name); + } + function forEachChildInJSDocTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + } + function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + } + function forEachChild(node, cbNode, cbNodes) { + if (node === void 0 || node.kind <= 165) { + return; + } + const fn = forEachChildTable[node.kind]; + return fn === void 0 ? void 0 : fn(node, cbNode, cbNodes); + } + function forEachChildRecursively(rootNode, cbNode, cbNodes) { + const queue3 = gatherPossibleChildren(rootNode); + const parents = []; + while (parents.length < queue3.length) { + parents.push(rootNode); + } + while (queue3.length !== 0) { + const current = queue3.pop(); + const parent22 = parents.pop(); + if (isArray3(current)) { + if (cbNodes) { + const res = cbNodes(current, parent22); + if (res) { + if (res === "skip") + continue; + return res; + } + } + for (let i7 = current.length - 1; i7 >= 0; --i7) { + queue3.push(current[i7]); + parents.push(parent22); + } + } else { + const res = cbNode(current, parent22); + if (res) { + if (res === "skip") + continue; + return res; + } + if (current.kind >= 166) { + for (const child of gatherPossibleChildren(current)) { + queue3.push(child); + parents.push(current); + } + } + } + } + } + function gatherPossibleChildren(node) { + const children = []; + forEachChild(node, addWorkItem, addWorkItem); + return children; + function addWorkItem(n7) { + children.unshift(n7); + } + } + function setExternalModuleIndicator(sourceFile) { + sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile); + } + function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) { + var _a2, _b, _c, _d; + (_a2 = tracing) == null ? void 0 : _a2.push( + tracing.Phase.Parse, + "createSourceFile", + { path: fileName }, + /*separateBeginAndEnd*/ + true + ); + mark("beforeParse"); + let result2; + (_b = perfLogger) == null ? void 0 : _b.logStartParseSourceFile(fileName); + const { + languageVersion, + setExternalModuleIndicator: overrideSetExternalModuleIndicator, + impliedNodeFormat: format5, + jsDocParsingMode + } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions }; + if (languageVersion === 100) { + result2 = Parser7.parseSourceFile( + fileName, + sourceText, + languageVersion, + /*syntaxCursor*/ + void 0, + setParentNodes, + 6, + noop4, + jsDocParsingMode + ); + } else { + const setIndicator = format5 === void 0 ? overrideSetExternalModuleIndicator : (file) => { + file.impliedNodeFormat = format5; + return (overrideSetExternalModuleIndicator || setExternalModuleIndicator)(file); + }; + result2 = Parser7.parseSourceFile( + fileName, + sourceText, + languageVersion, + /*syntaxCursor*/ + void 0, + setParentNodes, + scriptKind, + setIndicator, + jsDocParsingMode + ); + } + (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile(); + mark("afterParse"); + measure("Parse", "beforeParse", "afterParse"); + (_d = tracing) == null ? void 0 : _d.pop(); + return result2; + } + function parseIsolatedEntityName(text, languageVersion) { + return Parser7.parseIsolatedEntityName(text, languageVersion); + } + function parseJsonText(fileName, sourceText) { + return Parser7.parseJsonText(fileName, sourceText); + } + function isExternalModule(file) { + return file.externalModuleIndicator !== void 0; + } + function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks = false) { + const newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + newSourceFile.flags |= sourceFile.flags & 12582912; + return newSourceFile; + } + function parseIsolatedJSDocComment(content, start, length2) { + const result2 = Parser7.JSDocParser.parseIsolatedJSDocComment(content, start, length2); + if (result2 && result2.jsDoc) { + Parser7.fixupParentReferences(result2.jsDoc); + } + return result2; + } + function parseJSDocTypeExpressionForTests(content, start, length2) { + return Parser7.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2); + } + function isDeclarationFileName(fileName) { + return getDeclarationFileExtension(fileName) !== void 0; + } + function getDeclarationFileExtension(fileName) { + const standardExtension = getAnyExtensionFromPath( + fileName, + supportedDeclarationExtensions, + /*ignoreCase*/ + false + ); + if (standardExtension) { + return standardExtension; + } + if (fileExtensionIs( + fileName, + ".ts" + /* Ts */ + )) { + const index4 = getBaseFileName(fileName).lastIndexOf(".d."); + if (index4 >= 0) { + return fileName.substring(index4); + } + } + return void 0; + } + function parseResolutionMode(mode, pos, end, reportDiagnostic) { + if (!mode) { + return void 0; + } + if (mode === "import") { + return 99; + } + if (mode === "require") { + return 1; + } + reportDiagnostic(pos, end - pos, Diagnostics.resolution_mode_should_be_either_require_or_import); + return void 0; + } + function processCommentPragmas(context2, sourceText) { + const pragmas = []; + for (const range2 of getLeadingCommentRanges(sourceText, 0) || emptyArray) { + const comment = sourceText.substring(range2.pos, range2.end); + extractPragmas(pragmas, range2, comment); + } + context2.pragmas = /* @__PURE__ */ new Map(); + for (const pragma of pragmas) { + if (context2.pragmas.has(pragma.name)) { + const currentValue = context2.pragmas.get(pragma.name); + if (currentValue instanceof Array) { + currentValue.push(pragma.args); + } else { + context2.pragmas.set(pragma.name, [currentValue, pragma.args]); + } + continue; + } + context2.pragmas.set(pragma.name, pragma.args); + } + } + function processPragmasIntoFields(context2, reportDiagnostic) { + context2.checkJsDirective = void 0; + context2.referencedFiles = []; + context2.typeReferenceDirectives = []; + context2.libReferenceDirectives = []; + context2.amdDependencies = []; + context2.hasNoDefaultLib = false; + context2.pragmas.forEach((entryOrList, key) => { + switch (key) { + case "reference": { + const referencedFiles = context2.referencedFiles; + const typeReferenceDirectives = context2.typeReferenceDirectives; + const libReferenceDirectives = context2.libReferenceDirectives; + forEach4(toArray3(entryOrList), (arg) => { + const { types: types3, lib: lib2, path: path2, ["resolution-mode"]: res } = arg.arguments; + if (arg.arguments["no-default-lib"]) { + context2.hasNoDefaultLib = true; + } else if (types3) { + const parsed = parseResolutionMode(res, types3.pos, types3.end, reportDiagnostic); + typeReferenceDirectives.push({ pos: types3.pos, end: types3.end, fileName: types3.value, ...parsed ? { resolutionMode: parsed } : {} }); + } else if (lib2) { + libReferenceDirectives.push({ pos: lib2.pos, end: lib2.end, fileName: lib2.value }); + } else if (path2) { + referencedFiles.push({ pos: path2.pos, end: path2.end, fileName: path2.value }); + } else { + reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax); + } + }); + break; + } + case "amd-dependency": { + context2.amdDependencies = map4( + toArray3(entryOrList), + (x7) => ({ name: x7.arguments.name, path: x7.arguments.path }) + ); + break; + } + case "amd-module": { + if (entryOrList instanceof Array) { + for (const entry of entryOrList) { + if (context2.moduleName) { + reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); + } + context2.moduleName = entry.arguments.name; + } + } else { + context2.moduleName = entryOrList.arguments.name; + } + break; + } + case "ts-nocheck": + case "ts-check": { + forEach4(toArray3(entryOrList), (entry) => { + if (!context2.checkJsDirective || entry.range.pos > context2.checkJsDirective.pos) { + context2.checkJsDirective = { + enabled: key === "ts-check", + end: entry.range.end, + pos: entry.range.pos + }; + } + }); + break; + } + case "jsx": + case "jsxfrag": + case "jsximportsource": + case "jsxruntime": + return; + default: + Debug.fail("Unhandled pragma kind"); + } + }); + } + function getNamedArgRegEx(name2) { + if (namedArgRegExCache.has(name2)) { + return namedArgRegExCache.get(name2); + } + const result2 = new RegExp(`(\\s${name2}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`, "im"); + namedArgRegExCache.set(name2, result2); + return result2; + } + function extractPragmas(pragmas, range2, text) { + const tripleSlash = range2.kind === 2 && tripleSlashXMLCommentStartRegEx.exec(text); + if (tripleSlash) { + const name2 = tripleSlash[1].toLowerCase(); + const pragma = commentPragmas[name2]; + if (!pragma || !(pragma.kind & 1)) { + return; + } + if (pragma.args) { + const argument = {}; + for (const arg of pragma.args) { + const matcher = getNamedArgRegEx(arg.name); + const matchResult = matcher.exec(text); + if (!matchResult && !arg.optional) { + return; + } else if (matchResult) { + const value2 = matchResult[2] || matchResult[3]; + if (arg.captureSpan) { + const startPos = range2.pos + matchResult.index + matchResult[1].length + 1; + argument[arg.name] = { + value: value2, + pos: startPos, + end: startPos + value2.length + }; + } else { + argument[arg.name] = value2; + } + } + } + pragmas.push({ name: name2, args: { arguments: argument, range: range2 } }); + } else { + pragmas.push({ name: name2, args: { arguments: {}, range: range2 } }); + } + return; + } + const singleLine = range2.kind === 2 && singleLinePragmaRegEx.exec(text); + if (singleLine) { + return addPragmaForMatch(pragmas, range2, 2, singleLine); + } + if (range2.kind === 3) { + const multiLinePragmaRegEx = /@(\S+)(\s+.*)?$/gim; + let multiLineMatch; + while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { + addPragmaForMatch(pragmas, range2, 4, multiLineMatch); + } + } + } + function addPragmaForMatch(pragmas, range2, kind, match) { + if (!match) + return; + const name2 = match[1].toLowerCase(); + const pragma = commentPragmas[name2]; + if (!pragma || !(pragma.kind & kind)) { + return; + } + const args = match[2]; + const argument = getNamedPragmaArguments(pragma, args); + if (argument === "fail") + return; + pragmas.push({ name: name2, args: { arguments: argument, range: range2 } }); + return; + } + function getNamedPragmaArguments(pragma, text) { + if (!text) + return {}; + if (!pragma.args) + return {}; + const args = text.trim().split(/\s+/); + const argMap = {}; + for (let i7 = 0; i7 < pragma.args.length; i7++) { + const argument = pragma.args[i7]; + if (!args[i7] && !argument.optional) { + return "fail"; + } + if (argument.captureSpan) { + return Debug.fail("Capture spans not yet implemented for non-xml pragmas"); + } + argMap[argument.name] = args[i7]; + } + return argMap; + } + function tagNamesAreEquivalent(lhs, rhs) { + if (lhs.kind !== rhs.kind) { + return false; + } + if (lhs.kind === 80) { + return lhs.escapedText === rhs.escapedText; + } + if (lhs.kind === 110) { + return true; + } + if (lhs.kind === 295) { + return lhs.namespace.escapedText === rhs.namespace.escapedText && lhs.name.escapedText === rhs.name.escapedText; + } + return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); + } + var NodeConstructor, TokenConstructor, IdentifierConstructor, PrivateIdentifierConstructor, SourceFileConstructor, parseBaseNodeFactory, parseNodeFactory, forEachChildTable, Parser7, IncrementalParser, namedArgRegExCache, tripleSlashXMLCommentStartRegEx, singleLinePragmaRegEx; + var init_parser4 = __esm2({ + "src/compiler/parser.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + parseBaseNodeFactory = { + createBaseSourceFileNode: (kind) => new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, -1, -1), + createBaseIdentifierNode: (kind) => new (IdentifierConstructor || (IdentifierConstructor = objectAllocator.getIdentifierConstructor()))(kind, -1, -1), + createBasePrivateIdentifierNode: (kind) => new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1), + createBaseTokenNode: (kind) => new (TokenConstructor || (TokenConstructor = objectAllocator.getTokenConstructor()))(kind, -1, -1), + createBaseNode: (kind) => new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, -1, -1) + }; + parseNodeFactory = createNodeFactory(1, parseBaseNodeFactory); + forEachChildTable = { + [ + 166 + /* QualifiedName */ + ]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); + }, + [ + 168 + /* TypeParameter */ + ]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); + }, + [ + 304 + /* ShorthandPropertyAssignment */ + ]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); + }, + [ + 305 + /* SpreadAssignment */ + ]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 169 + /* Parameter */ + ]: function forEachChildInParameter(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); + }, + [ + 172 + /* PropertyDeclaration */ + ]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); + }, + [ + 171 + /* PropertySignature */ + ]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); + }, + [ + 303 + /* PropertyAssignment */ + ]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); + }, + [ + 260 + /* VariableDeclaration */ + ]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); + }, + [ + 208 + /* BindingElement */ + ]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); + }, + [ + 181 + /* IndexSignature */ + ]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + }, + [ + 185 + /* ConstructorType */ + ]: function forEachChildInConstructorType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + }, + [ + 184 + /* FunctionType */ + ]: function forEachChildInFunctionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + }, + [ + 179 + /* CallSignature */ + ]: forEachChildInCallOrConstructSignature, + [ + 180 + /* ConstructSignature */ + ]: forEachChildInCallOrConstructSignature, + [ + 174 + /* MethodDeclaration */ + ]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 173 + /* MethodSignature */ + ]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + }, + [ + 176 + /* Constructor */ + ]: function forEachChildInConstructor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 177 + /* GetAccessor */ + ]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 178 + /* SetAccessor */ + ]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 262 + /* FunctionDeclaration */ + ]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 218 + /* FunctionExpression */ + ]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); + }, + [ + 219 + /* ArrowFunction */ + ]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); + }, + [ + 175 + /* ClassStaticBlockDeclaration */ + ]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); + }, + [ + 183 + /* TypeReference */ + ]: function forEachChildInTypeReference(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, + [ + 182 + /* TypePredicate */ + ]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); + }, + [ + 186 + /* TypeQuery */ + ]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, + [ + 187 + /* TypeLiteral */ + ]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.members); + }, + [ + 188 + /* ArrayType */ + ]: function forEachChildInArrayType(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.elementType); + }, + [ + 189 + /* TupleType */ + ]: function forEachChildInTupleType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, + [ + 192 + /* UnionType */ + ]: forEachChildInUnionOrIntersectionType, + [ + 193 + /* IntersectionType */ + ]: forEachChildInUnionOrIntersectionType, + [ + 194 + /* ConditionalType */ + ]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); + }, + [ + 195 + /* InferType */ + ]: function forEachChildInInferType(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.typeParameter); + }, + [ + 205 + /* ImportType */ + ]: function forEachChildInImportType(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, + [ + 302 + /* ImportTypeAssertionContainer */ + ]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.assertClause); + }, + [ + 196 + /* ParenthesizedType */ + ]: forEachChildInParenthesizedTypeOrTypeOperator, + [ + 198 + /* TypeOperator */ + ]: forEachChildInParenthesizedTypeOrTypeOperator, + [ + 199 + /* IndexedAccessType */ + ]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); + }, + [ + 200 + /* MappedType */ + ]: function forEachChildInMappedType(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); + }, + [ + 201 + /* LiteralType */ + ]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.literal); + }, + [ + 202 + /* NamedTupleMember */ + ]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); + }, + [ + 206 + /* ObjectBindingPattern */ + ]: forEachChildInObjectOrArrayBindingPattern, + [ + 207 + /* ArrayBindingPattern */ + ]: forEachChildInObjectOrArrayBindingPattern, + [ + 209 + /* ArrayLiteralExpression */ + ]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, + [ + 210 + /* ObjectLiteralExpression */ + ]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.properties); + }, + [ + 211 + /* PropertyAccessExpression */ + ]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); + }, + [ + 212 + /* ElementAccessExpression */ + ]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); + }, + [ + 213 + /* CallExpression */ + ]: forEachChildInCallOrNewExpression, + [ + 214 + /* NewExpression */ + ]: forEachChildInCallOrNewExpression, + [ + 215 + /* TaggedTemplateExpression */ + ]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); + }, + [ + 216 + /* TypeAssertionExpression */ + ]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); + }, + [ + 217 + /* ParenthesizedExpression */ + ]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 220 + /* DeleteExpression */ + ]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 221 + /* TypeOfExpression */ + ]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 222 + /* VoidExpression */ + ]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 224 + /* PrefixUnaryExpression */ + ]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.operand); + }, + [ + 229 + /* YieldExpression */ + ]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); + }, + [ + 223 + /* AwaitExpression */ + ]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 225 + /* PostfixUnaryExpression */ + ]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.operand); + }, + [ + 226 + /* BinaryExpression */ + ]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); + }, + [ + 234 + /* AsExpression */ + ]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); + }, + [ + 235 + /* NonNullExpression */ + ]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 238 + /* SatisfiesExpression */ + ]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); + }, + [ + 236 + /* MetaProperty */ + ]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name); + }, + [ + 227 + /* ConditionalExpression */ + ]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse); + }, + [ + 230 + /* SpreadElement */ + ]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 241 + /* Block */ + ]: forEachChildInBlock, + [ + 268 + /* ModuleBlock */ + ]: forEachChildInBlock, + [ + 312 + /* SourceFile */ + ]: function forEachChildInSourceFile(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); + }, + [ + 243 + /* VariableStatement */ + ]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); + }, + [ + 261 + /* VariableDeclarationList */ + ]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.declarations); + }, + [ + 244 + /* ExpressionStatement */ + ]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 245 + /* IfStatement */ + ]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); + }, + [ + 246 + /* DoStatement */ + ]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); + }, + [ + 247 + /* WhileStatement */ + ]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); + }, + [ + 248 + /* ForStatement */ + ]: function forEachChildInForStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); + }, + [ + 249 + /* ForInStatement */ + ]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); + }, + [ + 250 + /* ForOfStatement */ + ]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); + }, + [ + 251 + /* ContinueStatement */ + ]: forEachChildInContinueOrBreakStatement, + [ + 252 + /* BreakStatement */ + ]: forEachChildInContinueOrBreakStatement, + [ + 253 + /* ReturnStatement */ + ]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 254 + /* WithStatement */ + ]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); + }, + [ + 255 + /* SwitchStatement */ + ]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); + }, + [ + 269 + /* CaseBlock */ + ]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.clauses); + }, + [ + 296 + /* CaseClause */ + ]: function forEachChildInCaseClause(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); + }, + [ + 297 + /* DefaultClause */ + ]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.statements); + }, + [ + 256 + /* LabeledStatement */ + ]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); + }, + [ + 257 + /* ThrowStatement */ + ]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 258 + /* TryStatement */ + ]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); + }, + [ + 299 + /* CatchClause */ + ]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); + }, + [ + 170 + /* Decorator */ + ]: function forEachChildInDecorator(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 263 + /* ClassDeclaration */ + ]: forEachChildInClassDeclarationOrExpression, + [ + 231 + /* ClassExpression */ + ]: forEachChildInClassDeclarationOrExpression, + [ + 264 + /* InterfaceDeclaration */ + ]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); + }, + [ + 265 + /* TypeAliasDeclaration */ + ]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); + }, + [ + 266 + /* EnumDeclaration */ + ]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); + }, + [ + 306 + /* EnumMember */ + ]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); + }, + [ + 267 + /* ModuleDeclaration */ + ]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); + }, + [ + 271 + /* ImportEqualsDeclaration */ + ]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); + }, + [ + 272 + /* ImportDeclaration */ + ]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); + }, + [ + 273 + /* ImportClause */ + ]: function forEachChildInImportClause(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); + }, + [ + 300 + /* ImportAttributes */ + ]: function forEachChildInImportAttributes(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, + [ + 301 + /* ImportAttribute */ + ]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); + }, + [ + 270 + /* NamespaceExportDeclaration */ + ]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name); + }, + [ + 274 + /* NamespaceImport */ + ]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name); + }, + [ + 280 + /* NamespaceExport */ + ]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name); + }, + [ + 275 + /* NamedImports */ + ]: forEachChildInNamedImportsOrExports, + [ + 279 + /* NamedExports */ + ]: forEachChildInNamedImportsOrExports, + [ + 278 + /* ExportDeclaration */ + ]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes); + }, + [ + 276 + /* ImportSpecifier */ + ]: forEachChildInImportOrExportSpecifier, + [ + 281 + /* ExportSpecifier */ + ]: forEachChildInImportOrExportSpecifier, + [ + 277 + /* ExportAssignment */ + ]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); + }, + [ + 228 + /* TemplateExpression */ + ]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); + }, + [ + 239 + /* TemplateSpan */ + ]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); + }, + [ + 203 + /* TemplateLiteralType */ + ]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); + }, + [ + 204 + /* TemplateLiteralTypeSpan */ + ]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); + }, + [ + 167 + /* ComputedPropertyName */ + ]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 298 + /* HeritageClause */ + ]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.types); + }, + [ + 233 + /* ExpressionWithTypeArguments */ + ]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); + }, + [ + 283 + /* ExternalModuleReference */ + ]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 282 + /* MissingDeclaration */ + ]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.modifiers); + }, + [ + 361 + /* CommaListExpression */ + ]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.elements); + }, + [ + 284 + /* JsxElement */ + ]: function forEachChildInJsxElement(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); + }, + [ + 288 + /* JsxFragment */ + ]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); + }, + [ + 285 + /* JsxSelfClosingElement */ + ]: forEachChildInJsxOpeningOrSelfClosingElement, + [ + 286 + /* JsxOpeningElement */ + ]: forEachChildInJsxOpeningOrSelfClosingElement, + [ + 292 + /* JsxAttributes */ + ]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.properties); + }, + [ + 291 + /* JsxAttribute */ + ]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); + }, + [ + 293 + /* JsxSpreadAttribute */ + ]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.expression); + }, + [ + 294 + /* JsxExpression */ + ]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); + }, + [ + 287 + /* JsxClosingElement */ + ]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.tagName); + }, + [ + 295 + /* JsxNamespacedName */ + ]: function forEachChildInJsxNamespacedName(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.namespace) || visitNode2(cbNode, node.name); + }, + [ + 190 + /* OptionalType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 191 + /* RestType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 316 + /* JSDocTypeExpression */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 322 + /* JSDocNonNullableType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 321 + /* JSDocNullableType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 323 + /* JSDocOptionalType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 325 + /* JSDocVariadicType */ + ]: forEachChildInOptionalRestOrJSDocParameterModifier, + [ + 324 + /* JSDocFunctionType */ + ]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { + return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); + }, + [ + 327 + /* JSDoc */ + ]: function forEachChildInJSDoc(node, cbNode, cbNodes) { + return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); + }, + [ + 354 + /* JSDocSeeTag */ + ]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 317 + /* JSDocNameReference */ + ]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.name); + }, + [ + 318 + /* JSDocMemberName */ + ]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { + return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); + }, + [ + 348 + /* JSDocParameterTag */ + ]: forEachChildInJSDocParameterOrPropertyTag, + [ + 355 + /* JSDocPropertyTag */ + ]: forEachChildInJSDocParameterOrPropertyTag, + [ + 337 + /* JSDocAuthorTag */ + ]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 336 + /* JSDocImplementsTag */ + ]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 335 + /* JSDocAugmentsTag */ + ]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 352 + /* JSDocTemplateTag */ + ]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 353 + /* JSDocTypedefTag */ + ]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 316 ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); + }, + [ + 345 + /* JSDocCallbackTag */ + ]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { + return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); + }, + [ + 349 + /* JSDocReturnTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 351 + /* JSDocTypeTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 350 + /* JSDocThisTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 347 + /* JSDocEnumTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 357 + /* JSDocSatisfiesTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 356 + /* JSDocThrowsTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 346 + /* JSDocOverloadTag */ + ]: forEachChildInJSDocTypeLikeTag, + [ + 330 + /* JSDocSignature */ + ]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { + return forEach4(node.typeParameters, cbNode) || forEach4(node.parameters, cbNode) || visitNode2(cbNode, node.type); + }, + [ + 331 + /* JSDocLink */ + ]: forEachChildInJSDocLinkCodeOrPlain, + [ + 332 + /* JSDocLinkCode */ + ]: forEachChildInJSDocLinkCodeOrPlain, + [ + 333 + /* JSDocLinkPlain */ + ]: forEachChildInJSDocLinkCodeOrPlain, + [ + 329 + /* JSDocTypeLiteral */ + ]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { + return forEach4(node.jsDocPropertyTags, cbNode); + }, + [ + 334 + /* JSDocTag */ + ]: forEachChildInJSDocTag, + [ + 339 + /* JSDocClassTag */ + ]: forEachChildInJSDocTag, + [ + 340 + /* JSDocPublicTag */ + ]: forEachChildInJSDocTag, + [ + 341 + /* JSDocPrivateTag */ + ]: forEachChildInJSDocTag, + [ + 342 + /* JSDocProtectedTag */ + ]: forEachChildInJSDocTag, + [ + 343 + /* JSDocReadonlyTag */ + ]: forEachChildInJSDocTag, + [ + 338 + /* JSDocDeprecatedTag */ + ]: forEachChildInJSDocTag, + [ + 344 + /* JSDocOverrideTag */ + ]: forEachChildInJSDocTag, + [ + 360 + /* PartiallyEmittedExpression */ + ]: forEachChildInPartiallyEmittedExpression + }; + ((Parser22) => { + var scanner2 = createScanner3( + 99, + /*skipTrivia*/ + true + ); + var disallowInAndDecoratorContext = 8192 | 32768; + var NodeConstructor2; + var TokenConstructor2; + var IdentifierConstructor2; + var PrivateIdentifierConstructor2; + var SourceFileConstructor2; + function countNode(node) { + nodeCount++; + return node; + } + var baseNodeFactory = { + createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )), + createBaseIdentifierNode: (kind) => countNode(new IdentifierConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )), + createBasePrivateIdentifierNode: (kind) => countNode(new PrivateIdentifierConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )), + createBaseTokenNode: (kind) => countNode(new TokenConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )), + createBaseNode: (kind) => countNode(new NodeConstructor2( + kind, + /*pos*/ + 0, + /*end*/ + 0 + )) + }; + var factory2 = createNodeFactory(1 | 2 | 8, baseNodeFactory); + var { + createNodeArray: factoryCreateNodeArray, + createNumericLiteral: factoryCreateNumericLiteral, + createStringLiteral: factoryCreateStringLiteral, + createLiteralLikeNode: factoryCreateLiteralLikeNode, + createIdentifier: factoryCreateIdentifier, + createPrivateIdentifier: factoryCreatePrivateIdentifier, + createToken: factoryCreateToken, + createArrayLiteralExpression: factoryCreateArrayLiteralExpression, + createObjectLiteralExpression: factoryCreateObjectLiteralExpression, + createPropertyAccessExpression: factoryCreatePropertyAccessExpression, + createPropertyAccessChain: factoryCreatePropertyAccessChain, + createElementAccessExpression: factoryCreateElementAccessExpression, + createElementAccessChain: factoryCreateElementAccessChain, + createCallExpression: factoryCreateCallExpression, + createCallChain: factoryCreateCallChain, + createNewExpression: factoryCreateNewExpression, + createParenthesizedExpression: factoryCreateParenthesizedExpression, + createBlock: factoryCreateBlock, + createVariableStatement: factoryCreateVariableStatement, + createExpressionStatement: factoryCreateExpressionStatement, + createIfStatement: factoryCreateIfStatement, + createWhileStatement: factoryCreateWhileStatement, + createForStatement: factoryCreateForStatement, + createForOfStatement: factoryCreateForOfStatement, + createVariableDeclaration: factoryCreateVariableDeclaration, + createVariableDeclarationList: factoryCreateVariableDeclarationList + } = factory2; + var fileName; + var sourceFlags; + var sourceText; + var languageVersion; + var scriptKind; + var languageVariant; + var parseDiagnostics; + var jsDocDiagnostics; + var syntaxCursor; + var currentToken; + var nodeCount; + var identifiers; + var identifierCount; + var parsingContext; + var notParenthesizedArrow; + var contextFlags; + var topLevel = true; + var parseErrorBeforeNextFinishedNode = false; + function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0) { + var _a2; + scriptKind2 = ensureScriptKind(fileName2, scriptKind2); + if (scriptKind2 === 6) { + const result22 = parseJsonText2(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes); + convertToJson( + result22, + (_a2 = result22.statements[0]) == null ? void 0 : _a2.expression, + result22.parseDiagnostics, + /*returnValue*/ + false, + /*jsonConversionNotifier*/ + void 0 + ); + result22.referencedFiles = emptyArray; + result22.typeReferenceDirectives = emptyArray; + result22.libReferenceDirectives = emptyArray; + result22.amdDependencies = emptyArray; + result22.hasNoDefaultLib = false; + result22.pragmas = emptyMap; + return result22; + } + initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode); + const result2 = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode); + clearState(); + return result2; + } + Parser22.parseSourceFile = parseSourceFile; + function parseIsolatedEntityName2(content, languageVersion2) { + initializeState( + "", + content, + languageVersion2, + /*syntaxCursor*/ + void 0, + 1, + 0 + /* ParseAll */ + ); + nextToken(); + const entityName = parseEntityName( + /*allowReservedWords*/ + true + ); + const isValid2 = token() === 1 && !parseDiagnostics.length; + clearState(); + return isValid2 ? entityName : void 0; + } + Parser22.parseIsolatedEntityName = parseIsolatedEntityName2; + function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2, syntaxCursor2, setParentNodes = false) { + initializeState( + fileName2, + sourceText2, + languageVersion2, + syntaxCursor2, + 6, + 0 + /* ParseAll */ + ); + sourceFlags = contextFlags; + nextToken(); + const pos = getNodePos(); + let statements, endOfFileToken; + if (token() === 1) { + statements = createNodeArray([], pos, pos); + endOfFileToken = parseTokenNode(); + } else { + let expressions; + while (token() !== 1) { + let expression2; + switch (token()) { + case 23: + expression2 = parseArrayLiteralExpression(); + break; + case 112: + case 97: + case 106: + expression2 = parseTokenNode(); + break; + case 41: + if (lookAhead( + () => nextToken() === 9 && nextToken() !== 59 + /* ColonToken */ + )) { + expression2 = parsePrefixUnaryExpression(); + } else { + expression2 = parseObjectLiteralExpression(); + } + break; + case 9: + case 11: + if (lookAhead( + () => nextToken() !== 59 + /* ColonToken */ + )) { + expression2 = parseLiteralNode(); + break; + } + default: + expression2 = parseObjectLiteralExpression(); + break; + } + if (expressions && isArray3(expressions)) { + expressions.push(expression2); + } else if (expressions) { + expressions = [expressions, expression2]; + } else { + expressions = expression2; + if (token() !== 1) { + parseErrorAtCurrentToken(Diagnostics.Unexpected_token); + } + } + } + const expression = isArray3(expressions) ? finishNode(factoryCreateArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); + const statement = factoryCreateExpressionStatement(expression); + finishNode(statement, pos); + statements = createNodeArray([statement], pos); + endOfFileToken = parseExpectedToken(1, Diagnostics.Unexpected_token); + } + const sourceFile = createSourceFile2( + fileName2, + 2, + 6, + /*isDeclarationFile*/ + false, + statements, + endOfFileToken, + sourceFlags, + noop4 + ); + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + const result2 = sourceFile; + clearState(); + return result2; + } + Parser22.parseJsonText = parseJsonText2; + function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) { + NodeConstructor2 = objectAllocator.getNodeConstructor(); + TokenConstructor2 = objectAllocator.getTokenConstructor(); + IdentifierConstructor2 = objectAllocator.getIdentifierConstructor(); + PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor(); + SourceFileConstructor2 = objectAllocator.getSourceFileConstructor(); + fileName = normalizePath(_fileName); + sourceText = _sourceText; + languageVersion = _languageVersion; + syntaxCursor = _syntaxCursor; + scriptKind = _scriptKind; + languageVariant = getLanguageVariant(_scriptKind); + parseDiagnostics = []; + parsingContext = 0; + identifiers = /* @__PURE__ */ new Map(); + identifierCount = 0; + nodeCount = 0; + sourceFlags = 0; + topLevel = true; + switch (scriptKind) { + case 1: + case 2: + contextFlags = 524288; + break; + case 6: + contextFlags = 524288 | 134217728; + break; + default: + contextFlags = 0; + break; + } + parseErrorBeforeNextFinishedNode = false; + scanner2.setText(sourceText); + scanner2.setOnError(scanError); + scanner2.setScriptTarget(languageVersion); + scanner2.setLanguageVariant(languageVariant); + scanner2.setScriptKind(scriptKind); + scanner2.setJSDocParsingMode(_jsDocParsingMode); + } + function clearState() { + scanner2.clearCommentDirectives(); + scanner2.setText(""); + scanner2.setOnError(void 0); + scanner2.setScriptKind( + 0 + /* Unknown */ + ); + scanner2.setJSDocParsingMode( + 0 + /* ParseAll */ + ); + sourceText = void 0; + languageVersion = void 0; + syntaxCursor = void 0; + scriptKind = void 0; + languageVariant = void 0; + sourceFlags = 0; + parseDiagnostics = void 0; + jsDocDiagnostics = void 0; + parsingContext = 0; + identifiers = void 0; + notParenthesizedArrow = void 0; + topLevel = true; + } + function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) { + const isDeclarationFile = isDeclarationFileName(fileName); + if (isDeclarationFile) { + contextFlags |= 33554432; + } + sourceFlags = contextFlags; + nextToken(); + const statements = parseList(0, parseStatement); + Debug.assert( + token() === 1 + /* EndOfFileToken */ + ); + const endHasJSDoc = hasPrecedingJSDocComment(); + const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc); + const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); + processCommentPragmas(sourceFile, sourceText); + processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); + sourceFile.commentDirectives = scanner2.getCommentDirectives(); + sourceFile.nodeCount = nodeCount; + sourceFile.identifierCount = identifierCount; + sourceFile.identifiers = identifiers; + sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); + sourceFile.jsDocParsingMode = jsDocParsingMode; + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + if (setParentNodes) { + fixupParentReferences(sourceFile); + } + return sourceFile; + function reportPragmaDiagnostic(pos, end, diagnostic) { + parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic)); + } + } + let hasDeprecatedTag = false; + function withJSDoc(node, hasJSDoc) { + if (!hasJSDoc) { + return node; + } + Debug.assert(!node.jsDoc); + const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); + if (jsDoc.length) + node.jsDoc = jsDoc; + if (hasDeprecatedTag) { + hasDeprecatedTag = false; + node.flags |= 536870912; + } + return node; + } + function reparseTopLevelAwait(sourceFile) { + const savedSyntaxCursor = syntaxCursor; + const baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile); + syntaxCursor = { currentNode: currentNode2 }; + const statements = []; + const savedParseDiagnostics = parseDiagnostics; + parseDiagnostics = []; + let pos = 0; + let start = findNextStatementWithAwait(sourceFile.statements, 0); + while (start !== -1) { + const prevStatement = sourceFile.statements[pos]; + const nextStatement = sourceFile.statements[start]; + addRange(statements, sourceFile.statements, pos, start); + pos = findNextStatementWithoutAwait(sourceFile.statements, start); + const diagnosticStart = findIndex2(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); + const diagnosticEnd = diagnosticStart >= 0 ? findIndex2(savedParseDiagnostics, (diagnostic) => diagnostic.start >= nextStatement.pos, diagnosticStart) : -1; + if (diagnosticStart >= 0) { + addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart, diagnosticEnd >= 0 ? diagnosticEnd : void 0); + } + speculationHelper( + () => { + const savedContextFlags = contextFlags; + contextFlags |= 65536; + scanner2.resetTokenState(nextStatement.pos); + nextToken(); + while (token() !== 1) { + const startPos = scanner2.getTokenFullStart(); + const statement = parseListElement(0, parseStatement); + statements.push(statement); + if (startPos === scanner2.getTokenFullStart()) { + nextToken(); + } + if (pos >= 0) { + const nonAwaitStatement = sourceFile.statements[pos]; + if (statement.end === nonAwaitStatement.pos) { + break; + } + if (statement.end > nonAwaitStatement.pos) { + pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1); + } + } + } + contextFlags = savedContextFlags; + }, + 2 + /* Reparse */ + ); + start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1; + } + if (pos >= 0) { + const prevStatement = sourceFile.statements[pos]; + addRange(statements, sourceFile.statements, pos); + const diagnosticStart = findIndex2(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); + if (diagnosticStart >= 0) { + addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart); + } + } + syntaxCursor = savedSyntaxCursor; + return factory2.updateSourceFile(sourceFile, setTextRange(factoryCreateNodeArray(statements), sourceFile.statements)); + function containsPossibleTopLevelAwait(node) { + return !(node.flags & 65536) && !!(node.transformFlags & 67108864); + } + function findNextStatementWithAwait(statements2, start2) { + for (let i7 = start2; i7 < statements2.length; i7++) { + if (containsPossibleTopLevelAwait(statements2[i7])) { + return i7; + } + } + return -1; + } + function findNextStatementWithoutAwait(statements2, start2) { + for (let i7 = start2; i7 < statements2.length; i7++) { + if (!containsPossibleTopLevelAwait(statements2[i7])) { + return i7; + } + } + return -1; + } + function currentNode2(position) { + const node = baseSyntaxCursor.currentNode(position); + if (topLevel && node && containsPossibleTopLevelAwait(node)) { + node.intersectsChange = true; + } + return node; + } + } + function fixupParentReferences(rootNode) { + setParentRecursive( + rootNode, + /*incremental*/ + true + ); + } + Parser22.fixupParentReferences = fixupParentReferences; + function createSourceFile2(fileName2, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator2) { + let sourceFile = factory2.createSourceFile(statements, endOfFileToken, flags); + setTextRangePosWidth(sourceFile, 0, sourceText.length); + setFields(sourceFile); + if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864) { + const oldSourceFile = sourceFile; + sourceFile = reparseTopLevelAwait(sourceFile); + if (oldSourceFile !== sourceFile) + setFields(sourceFile); + } + return sourceFile; + function setFields(sourceFile2) { + sourceFile2.text = sourceText; + sourceFile2.bindDiagnostics = []; + sourceFile2.bindSuggestionDiagnostics = void 0; + sourceFile2.languageVersion = languageVersion2; + sourceFile2.fileName = fileName2; + sourceFile2.languageVariant = getLanguageVariant(scriptKind2); + sourceFile2.isDeclarationFile = isDeclarationFile; + sourceFile2.scriptKind = scriptKind2; + setExternalModuleIndicator2(sourceFile2); + sourceFile2.setExternalModuleIndicator = setExternalModuleIndicator2; + } + } + function setContextFlag(val, flag) { + if (val) { + contextFlags |= flag; + } else { + contextFlags &= ~flag; + } + } + function setDisallowInContext(val) { + setContextFlag( + val, + 8192 + /* DisallowInContext */ + ); + } + function setYieldContext(val) { + setContextFlag( + val, + 16384 + /* YieldContext */ + ); + } + function setDecoratorContext(val) { + setContextFlag( + val, + 32768 + /* DecoratorContext */ + ); + } + function setAwaitContext(val) { + setContextFlag( + val, + 65536 + /* AwaitContext */ + ); + } + function doOutsideOfContext(context2, func) { + const contextFlagsToClear = context2 & contextFlags; + if (contextFlagsToClear) { + setContextFlag( + /*val*/ + false, + contextFlagsToClear + ); + const result2 = func(); + setContextFlag( + /*val*/ + true, + contextFlagsToClear + ); + return result2; + } + return func(); + } + function doInsideOfContext(context2, func) { + const contextFlagsToSet = context2 & ~contextFlags; + if (contextFlagsToSet) { + setContextFlag( + /*val*/ + true, + contextFlagsToSet + ); + const result2 = func(); + setContextFlag( + /*val*/ + false, + contextFlagsToSet + ); + return result2; + } + return func(); + } + function allowInAnd(func) { + return doOutsideOfContext(8192, func); + } + function disallowInAnd(func) { + return doInsideOfContext(8192, func); + } + function allowConditionalTypesAnd(func) { + return doOutsideOfContext(131072, func); + } + function disallowConditionalTypesAnd(func) { + return doInsideOfContext(131072, func); + } + function doInYieldContext(func) { + return doInsideOfContext(16384, func); + } + function doInDecoratorContext(func) { + return doInsideOfContext(32768, func); + } + function doInAwaitContext(func) { + return doInsideOfContext(65536, func); + } + function doOutsideOfAwaitContext(func) { + return doOutsideOfContext(65536, func); + } + function doInYieldAndAwaitContext(func) { + return doInsideOfContext(16384 | 65536, func); + } + function doOutsideOfYieldAndAwaitContext(func) { + return doOutsideOfContext(16384 | 65536, func); + } + function inContext(flags) { + return (contextFlags & flags) !== 0; + } + function inYieldContext() { + return inContext( + 16384 + /* YieldContext */ + ); + } + function inDisallowInContext() { + return inContext( + 8192 + /* DisallowInContext */ + ); + } + function inDisallowConditionalTypesContext() { + return inContext( + 131072 + /* DisallowConditionalTypesContext */ + ); + } + function inDecoratorContext() { + return inContext( + 32768 + /* DecoratorContext */ + ); + } + function inAwaitContext() { + return inContext( + 65536 + /* AwaitContext */ + ); + } + function parseErrorAtCurrentToken(message, ...args) { + return parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), message, ...args); + } + function parseErrorAtPosition(start, length2, message, ...args) { + const lastError = lastOrUndefined(parseDiagnostics); + let result2; + if (!lastError || start !== lastError.start) { + result2 = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args); + parseDiagnostics.push(result2); + } + parseErrorBeforeNextFinishedNode = true; + return result2; + } + function parseErrorAt(start, end, message, ...args) { + return parseErrorAtPosition(start, end - start, message, ...args); + } + function parseErrorAtRange(range2, message, ...args) { + parseErrorAt(range2.pos, range2.end, message, ...args); + } + function scanError(message, length2, arg0) { + parseErrorAtPosition(scanner2.getTokenEnd(), length2, message, arg0); + } + function getNodePos() { + return scanner2.getTokenFullStart(); + } + function hasPrecedingJSDocComment() { + return scanner2.hasPrecedingJSDocComment(); + } + function token() { + return currentToken; + } + function nextTokenWithoutCheck() { + return currentToken = scanner2.scan(); + } + function nextTokenAnd(func) { + nextToken(); + return func(); + } + function nextToken() { + if (isKeyword(currentToken) && (scanner2.hasUnicodeEscape() || scanner2.hasExtendedUnicodeEscape())) { + parseErrorAt(scanner2.getTokenStart(), scanner2.getTokenEnd(), Diagnostics.Keywords_cannot_contain_escape_characters); + } + return nextTokenWithoutCheck(); + } + function nextTokenJSDoc() { + return currentToken = scanner2.scanJsDocToken(); + } + function nextJSDocCommentTextToken(inBackticks) { + return currentToken = scanner2.scanJSDocCommentTextToken(inBackticks); + } + function reScanGreaterToken() { + return currentToken = scanner2.reScanGreaterToken(); + } + function reScanSlashToken() { + return currentToken = scanner2.reScanSlashToken(); + } + function reScanTemplateToken(isTaggedTemplate) { + return currentToken = scanner2.reScanTemplateToken(isTaggedTemplate); + } + function reScanLessThanToken() { + return currentToken = scanner2.reScanLessThanToken(); + } + function reScanHashToken() { + return currentToken = scanner2.reScanHashToken(); + } + function scanJsxIdentifier() { + return currentToken = scanner2.scanJsxIdentifier(); + } + function scanJsxText() { + return currentToken = scanner2.scanJsxToken(); + } + function scanJsxAttributeValue() { + return currentToken = scanner2.scanJsxAttributeValue(); + } + function speculationHelper(callback, speculationKind) { + const saveToken = currentToken; + const saveParseDiagnosticsLength = parseDiagnostics.length; + const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + const saveContextFlags = contextFlags; + const result2 = speculationKind !== 0 ? scanner2.lookAhead(callback) : scanner2.tryScan(callback); + Debug.assert(saveContextFlags === contextFlags); + if (!result2 || speculationKind !== 0) { + currentToken = saveToken; + if (speculationKind !== 2) { + parseDiagnostics.length = saveParseDiagnosticsLength; + } + parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; + } + return result2; + } + function lookAhead(callback) { + return speculationHelper( + callback, + 1 + /* Lookahead */ + ); + } + function tryParse(callback) { + return speculationHelper( + callback, + 0 + /* TryParse */ + ); + } + function isBindingIdentifier() { + if (token() === 80) { + return true; + } + return token() > 118; + } + function isIdentifier2() { + if (token() === 80) { + return true; + } + if (token() === 127 && inYieldContext()) { + return false; + } + if (token() === 135 && inAwaitContext()) { + return false; + } + return token() > 118; + } + function parseExpected(kind, diagnosticMessage, shouldAdvance = true) { + if (token() === kind) { + if (shouldAdvance) { + nextToken(); + } + return true; + } + if (diagnosticMessage) { + parseErrorAtCurrentToken(diagnosticMessage); + } else { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); + } + return false; + } + const viableKeywordSuggestions = Object.keys(textToKeywordObj).filter((keyword) => keyword.length > 2); + function parseErrorForMissingSemicolonAfter(node) { + if (isTaggedTemplateExpression(node)) { + parseErrorAt(skipTrivia(sourceText, node.template.pos), node.template.end, Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings); + return; + } + const expressionText = isIdentifier(node) ? idText(node) : void 0; + if (!expressionText || !isIdentifierText(expressionText, languageVersion)) { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 27 + /* SemicolonToken */ + )); + return; + } + const pos = skipTrivia(sourceText, node.pos); + switch (expressionText) { + case "const": + case "let": + case "var": + parseErrorAt(pos, node.end, Diagnostics.Variable_declaration_not_allowed_at_this_location); + return; + case "declare": + return; + case "interface": + parseErrorForInvalidName( + Diagnostics.Interface_name_cannot_be_0, + Diagnostics.Interface_must_be_given_a_name, + 19 + /* OpenBraceToken */ + ); + return; + case "is": + parseErrorAt(pos, scanner2.getTokenStart(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + return; + case "module": + case "namespace": + parseErrorForInvalidName( + Diagnostics.Namespace_name_cannot_be_0, + Diagnostics.Namespace_must_be_given_a_name, + 19 + /* OpenBraceToken */ + ); + return; + case "type": + parseErrorForInvalidName( + Diagnostics.Type_alias_name_cannot_be_0, + Diagnostics.Type_alias_must_be_given_a_name, + 64 + /* EqualsToken */ + ); + return; + } + const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n7) => n7) ?? getSpaceSuggestion(expressionText); + if (suggestion) { + parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion); + return; + } + if (token() === 0) { + return; + } + parseErrorAt(pos, node.end, Diagnostics.Unexpected_keyword_or_identifier); + } + function parseErrorForInvalidName(nameDiagnostic, blankDiagnostic, tokenIfBlankName) { + if (token() === tokenIfBlankName) { + parseErrorAtCurrentToken(blankDiagnostic); + } else { + parseErrorAtCurrentToken(nameDiagnostic, scanner2.getTokenValue()); + } + } + function getSpaceSuggestion(expressionText) { + for (const keyword of viableKeywordSuggestions) { + if (expressionText.length > keyword.length + 2 && startsWith2(expressionText, keyword)) { + return `${keyword} ${expressionText.slice(keyword.length)}`; + } + } + return void 0; + } + function parseSemicolonAfterPropertyName(name2, type3, initializer) { + if (token() === 60 && !scanner2.hasPrecedingLineBreak()) { + parseErrorAtCurrentToken(Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations); + return; + } + if (token() === 21) { + parseErrorAtCurrentToken(Diagnostics.Cannot_start_a_function_call_in_a_type_annotation); + nextToken(); + return; + } + if (type3 && !canParseSemicolon()) { + if (initializer) { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 27 + /* SemicolonToken */ + )); + } else { + parseErrorAtCurrentToken(Diagnostics.Expected_for_property_initializer); + } + return; + } + if (tryParseSemicolon()) { + return; + } + if (initializer) { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 27 + /* SemicolonToken */ + )); + return; + } + parseErrorForMissingSemicolonAfter(name2); + } + function parseExpectedJSDoc(kind) { + if (token() === kind) { + nextTokenJSDoc(); + return true; + } + Debug.assert(isKeywordOrPunctuation(kind)); + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); + return false; + } + function parseExpectedMatchingBrackets(openKind, closeKind, openParsed, openPosition) { + if (token() === closeKind) { + nextToken(); + return; + } + const lastError = parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(closeKind)); + if (!openParsed) { + return; + } + if (lastError) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) + ); + } + } + function parseOptional(t8) { + if (token() === t8) { + nextToken(); + return true; + } + return false; + } + function parseOptionalToken(t8) { + if (token() === t8) { + return parseTokenNode(); + } + return void 0; + } + function parseOptionalTokenJSDoc(t8) { + if (token() === t8) { + return parseTokenNodeJSDoc(); + } + return void 0; + } + function parseExpectedToken(t8, diagnosticMessage, arg0) { + return parseOptionalToken(t8) || createMissingNode( + t8, + /*reportAtCurrentPosition*/ + false, + diagnosticMessage || Diagnostics._0_expected, + arg0 || tokenToString(t8) + ); + } + function parseExpectedTokenJSDoc(t8) { + const optional = parseOptionalTokenJSDoc(t8); + if (optional) + return optional; + Debug.assert(isKeywordOrPunctuation(t8)); + return createMissingNode( + t8, + /*reportAtCurrentPosition*/ + false, + Diagnostics._0_expected, + tokenToString(t8) + ); + } + function parseTokenNode() { + const pos = getNodePos(); + const kind = token(); + nextToken(); + return finishNode(factoryCreateToken(kind), pos); + } + function parseTokenNodeJSDoc() { + const pos = getNodePos(); + const kind = token(); + nextTokenJSDoc(); + return finishNode(factoryCreateToken(kind), pos); + } + function canParseSemicolon() { + if (token() === 27) { + return true; + } + return token() === 20 || token() === 1 || scanner2.hasPrecedingLineBreak(); + } + function tryParseSemicolon() { + if (!canParseSemicolon()) { + return false; + } + if (token() === 27) { + nextToken(); + } + return true; + } + function parseSemicolon() { + return tryParseSemicolon() || parseExpected( + 27 + /* SemicolonToken */ + ); + } + function createNodeArray(elements, pos, end, hasTrailingComma) { + const array = factoryCreateNodeArray(elements, hasTrailingComma); + setTextRangePosEnd(array, pos, end ?? scanner2.getTokenFullStart()); + return array; + } + function finishNode(node, pos, end) { + setTextRangePosEnd(node, pos, end ?? scanner2.getTokenFullStart()); + if (contextFlags) { + node.flags |= contextFlags; + } + if (parseErrorBeforeNextFinishedNode) { + parseErrorBeforeNextFinishedNode = false; + node.flags |= 262144; + } + return node; + } + function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, ...args) { + if (reportAtCurrentPosition) { + parseErrorAtPosition(scanner2.getTokenFullStart(), 0, diagnosticMessage, ...args); + } else if (diagnosticMessage) { + parseErrorAtCurrentToken(diagnosticMessage, ...args); + } + const pos = getNodePos(); + const result2 = kind === 80 ? factoryCreateIdentifier( + "", + /*originalKeywordKind*/ + void 0 + ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( + kind, + "", + "", + /*templateFlags*/ + void 0 + ) : kind === 9 ? factoryCreateNumericLiteral( + "", + /*numericLiteralFlags*/ + void 0 + ) : kind === 11 ? factoryCreateStringLiteral( + "", + /*isSingleQuote*/ + void 0 + ) : kind === 282 ? factory2.createMissingDeclaration() : factoryCreateToken(kind); + return finishNode(result2, pos); + } + function internIdentifier(text) { + let identifier = identifiers.get(text); + if (identifier === void 0) { + identifiers.set(text, identifier = text); + } + return identifier; + } + function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { + if (isIdentifier3) { + identifierCount++; + const pos = getNodePos(); + const originalKeywordKind = token(); + const text = internIdentifier(scanner2.getTokenValue()); + const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape(); + nextTokenWithoutCheck(); + return finishNode(factoryCreateIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos); + } + if (token() === 81) { + parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + return createIdentifier( + /*isIdentifier*/ + true + ); + } + if (token() === 0 && scanner2.tryScan( + () => scanner2.reScanInvalidIdentifier() === 80 + /* Identifier */ + )) { + return createIdentifier( + /*isIdentifier*/ + true + ); + } + identifierCount++; + const reportAtCurrentPosition = token() === 1; + const isReservedWord = scanner2.isReservedWord(); + const msgArg = scanner2.getTokenText(); + const defaultMessage = isReservedWord ? Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here : Diagnostics.Identifier_expected; + return createMissingNode(80, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); + } + function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { + return createIdentifier( + isBindingIdentifier(), + /*diagnosticMessage*/ + void 0, + privateIdentifierDiagnosticMessage + ); + } + function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { + return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); + } + function parseIdentifierName(diagnosticMessage) { + return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); + } + function parseIdentifierNameErrorOnUnicodeEscapeSequence() { + if (scanner2.hasUnicodeEscape() || scanner2.hasExtendedUnicodeEscape()) { + parseErrorAtCurrentToken(Diagnostics.Unicode_escape_sequence_cannot_appear_here); + } + return createIdentifier(tokenIsIdentifierOrKeyword(token())); + } + function isLiteralPropertyName() { + return tokenIsIdentifierOrKeyword(token()) || token() === 11 || token() === 9; + } + function isImportAttributeName2() { + return tokenIsIdentifierOrKeyword(token()) || token() === 11; + } + function parsePropertyNameWorker(allowComputedPropertyNames) { + if (token() === 11 || token() === 9) { + const node = parseLiteralNode(); + node.text = internIdentifier(node.text); + return node; + } + if (allowComputedPropertyNames && token() === 23) { + return parseComputedPropertyName(); + } + if (token() === 81) { + return parsePrivateIdentifier(); + } + return parseIdentifierName(); + } + function parsePropertyName() { + return parsePropertyNameWorker( + /*allowComputedPropertyNames*/ + true + ); + } + function parseComputedPropertyName() { + const pos = getNodePos(); + parseExpected( + 23 + /* OpenBracketToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpected( + 24 + /* CloseBracketToken */ + ); + return finishNode(factory2.createComputedPropertyName(expression), pos); + } + function parsePrivateIdentifier() { + const pos = getNodePos(); + const node = factoryCreatePrivateIdentifier(internIdentifier(scanner2.getTokenValue())); + nextToken(); + return finishNode(node, pos); + } + function parseContextualModifier(t8) { + return token() === t8 && tryParse(nextTokenCanFollowModifier); + } + function nextTokenIsOnSameLineAndCanFollowModifier() { + nextToken(); + if (scanner2.hasPrecedingLineBreak()) { + return false; + } + return canFollowModifier(); + } + function nextTokenCanFollowModifier() { + switch (token()) { + case 87: + return nextToken() === 94; + case 95: + nextToken(); + if (token() === 90) { + return lookAhead(nextTokenCanFollowDefaultKeyword); + } + if (token() === 156) { + return lookAhead(nextTokenCanFollowExportModifier); + } + return canFollowExportModifier(); + case 90: + return nextTokenCanFollowDefaultKeyword(); + case 126: + case 139: + case 153: + nextToken(); + return canFollowModifier(); + default: + return nextTokenIsOnSameLineAndCanFollowModifier(); + } + } + function canFollowExportModifier() { + return token() === 60 || token() !== 42 && token() !== 130 && token() !== 19 && canFollowModifier(); + } + function nextTokenCanFollowExportModifier() { + nextToken(); + return canFollowExportModifier(); + } + function parseAnyContextualModifier() { + return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier); + } + function canFollowModifier() { + return token() === 23 || token() === 19 || token() === 42 || token() === 26 || isLiteralPropertyName(); + } + function nextTokenCanFollowDefaultKeyword() { + nextToken(); + return token() === 86 || token() === 100 || token() === 120 || token() === 60 || token() === 128 && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 134 && lookAhead(nextTokenIsFunctionKeywordOnSameLine); + } + function isListElement2(parsingContext2, inErrorRecovery) { + const node = currentNode(parsingContext2); + if (node) { + return true; + } + switch (parsingContext2) { + case 0: + case 1: + case 3: + return !(token() === 27 && inErrorRecovery) && isStartOfStatement(); + case 2: + return token() === 84 || token() === 90; + case 4: + return lookAhead(isTypeMemberStart); + case 5: + return lookAhead(isClassMemberStart) || token() === 27 && !inErrorRecovery; + case 6: + return token() === 23 || isLiteralPropertyName(); + case 12: + switch (token()) { + case 23: + case 42: + case 26: + case 25: + return true; + default: + return isLiteralPropertyName(); + } + case 18: + return isLiteralPropertyName(); + case 9: + return token() === 23 || token() === 26 || isLiteralPropertyName(); + case 24: + return isImportAttributeName2(); + case 7: + if (token() === 19) { + return lookAhead(isValidHeritageClauseObjectLiteral); + } + if (!inErrorRecovery) { + return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); + } else { + return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); + } + case 8: + return isBindingIdentifierOrPrivateIdentifierOrPattern(); + case 10: + return token() === 28 || token() === 26 || isBindingIdentifierOrPrivateIdentifierOrPattern(); + case 19: + return token() === 103 || token() === 87 || isIdentifier2(); + case 15: + switch (token()) { + case 28: + case 25: + return true; + } + case 11: + return token() === 26 || isStartOfExpression(); + case 16: + return isStartOfParameter( + /*isJSDocParameter*/ + false + ); + case 17: + return isStartOfParameter( + /*isJSDocParameter*/ + true + ); + case 20: + case 21: + return token() === 28 || isStartOfType(); + case 22: + return isHeritageClause2(); + case 23: + if (token() === 161 && lookAhead(nextTokenIsStringLiteral)) { + return false; + } + return tokenIsIdentifierOrKeyword(token()); + case 13: + return tokenIsIdentifierOrKeyword(token()) || token() === 19; + case 14: + return true; + case 25: + return true; + case 26: + return Debug.fail("ParsingContext.Count used as a context"); + default: + Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'."); + } + } + function isValidHeritageClauseObjectLiteral() { + Debug.assert( + token() === 19 + /* OpenBraceToken */ + ); + if (nextToken() === 20) { + const next = nextToken(); + return next === 28 || next === 19 || next === 96 || next === 119; + } + return true; + } + function nextTokenIsIdentifier() { + nextToken(); + return isIdentifier2(); + } + function nextTokenIsIdentifierOrKeyword() { + nextToken(); + return tokenIsIdentifierOrKeyword(token()); + } + function nextTokenIsIdentifierOrKeywordOrGreaterThan() { + nextToken(); + return tokenIsIdentifierOrKeywordOrGreaterThan(token()); + } + function isHeritageClauseExtendsOrImplementsKeyword() { + if (token() === 119 || token() === 96) { + return lookAhead(nextTokenIsStartOfExpression); + } + return false; + } + function nextTokenIsStartOfExpression() { + nextToken(); + return isStartOfExpression(); + } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } + function isListTerminator(kind) { + if (token() === 1) { + return true; + } + switch (kind) { + case 1: + case 2: + case 4: + case 5: + case 6: + case 12: + case 9: + case 23: + case 24: + return token() === 20; + case 3: + return token() === 20 || token() === 84 || token() === 90; + case 7: + return token() === 19 || token() === 96 || token() === 119; + case 8: + return isVariableDeclaratorListTerminator(); + case 19: + return token() === 32 || token() === 21 || token() === 19 || token() === 96 || token() === 119; + case 11: + return token() === 22 || token() === 27; + case 15: + case 21: + case 10: + return token() === 24; + case 17: + case 16: + case 18: + return token() === 22 || token() === 24; + case 20: + return token() !== 28; + case 22: + return token() === 19 || token() === 20; + case 13: + return token() === 32 || token() === 44; + case 14: + return token() === 30 && lookAhead(nextTokenIsSlash); + default: + return false; + } + } + function isVariableDeclaratorListTerminator() { + if (canParseSemicolon()) { + return true; + } + if (isInOrOfKeyword(token())) { + return true; + } + if (token() === 39) { + return true; + } + return false; + } + function isInSomeParsingContext() { + Debug.assert(parsingContext, "Missing parsing context"); + for (let kind = 0; kind < 26; kind++) { + if (parsingContext & 1 << kind) { + if (isListElement2( + kind, + /*inErrorRecovery*/ + true + ) || isListTerminator(kind)) { + return true; + } + } + } + return false; + } + function parseList(kind, parseElement) { + const saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + const list = []; + const listPos = getNodePos(); + while (!isListTerminator(kind)) { + if (isListElement2( + kind, + /*inErrorRecovery*/ + false + )) { + list.push(parseListElement(kind, parseElement)); + continue; + } + if (abortParsingListOrMoveToNextToken(kind)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray(list, listPos); + } + function parseListElement(parsingContext2, parseElement) { + const node = currentNode(parsingContext2); + if (node) { + return consumeNode(node); + } + return parseElement(); + } + function currentNode(parsingContext2, pos) { + var _a2; + if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { + return void 0; + } + const node = syntaxCursor.currentNode(pos ?? scanner2.getTokenFullStart()); + if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) { + return void 0; + } + const nodeContextFlags = node.flags & 101441536; + if (nodeContextFlags !== contextFlags) { + return void 0; + } + if (!canReuseNode(node, parsingContext2)) { + return void 0; + } + if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) { + node.jsDoc.jsDocCache = void 0; + } + return node; + } + function consumeNode(node) { + scanner2.resetTokenState(node.end); + nextToken(); + return node; + } + function isReusableParsingContext(parsingContext2) { + switch (parsingContext2) { + case 5: + case 2: + case 0: + case 1: + case 3: + case 6: + case 4: + case 8: + case 17: + case 16: + return true; + } + return false; + } + function canReuseNode(node, parsingContext2) { + switch (parsingContext2) { + case 5: + return isReusableClassMember(node); + case 2: + return isReusableSwitchClause(node); + case 0: + case 1: + case 3: + return isReusableStatement(node); + case 6: + return isReusableEnumMember(node); + case 4: + return isReusableTypeMember(node); + case 8: + return isReusableVariableDeclaration(node); + case 17: + case 16: + return isReusableParameter(node); + } + return false; + } + function isReusableClassMember(node) { + if (node) { + switch (node.kind) { + case 176: + case 181: + case 177: + case 178: + case 172: + case 240: + return true; + case 174: + const methodDeclaration = node; + const nameIsConstructor = methodDeclaration.name.kind === 80 && methodDeclaration.name.escapedText === "constructor"; + return !nameIsConstructor; + } + } + return false; + } + function isReusableSwitchClause(node) { + if (node) { + switch (node.kind) { + case 296: + case 297: + return true; + } + } + return false; + } + function isReusableStatement(node) { + if (node) { + switch (node.kind) { + case 262: + case 243: + case 241: + case 245: + case 244: + case 257: + case 253: + case 255: + case 252: + case 251: + case 249: + case 250: + case 248: + case 247: + case 254: + case 242: + case 258: + case 256: + case 246: + case 259: + case 272: + case 271: + case 278: + case 277: + case 267: + case 263: + case 264: + case 266: + case 265: + return true; + } + } + return false; + } + function isReusableEnumMember(node) { + return node.kind === 306; + } + function isReusableTypeMember(node) { + if (node) { + switch (node.kind) { + case 180: + case 173: + case 181: + case 171: + case 179: + return true; + } + } + return false; + } + function isReusableVariableDeclaration(node) { + if (node.kind !== 260) { + return false; + } + const variableDeclarator = node; + return variableDeclarator.initializer === void 0; + } + function isReusableParameter(node) { + if (node.kind !== 169) { + return false; + } + const parameter = node; + return parameter.initializer === void 0; + } + function abortParsingListOrMoveToNextToken(kind) { + parsingContextErrors(kind); + if (isInSomeParsingContext()) { + return true; + } + nextToken(); + return false; + } + function parsingContextErrors(context2) { + switch (context2) { + case 0: + return token() === 90 ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 95 + /* ExportKeyword */ + )) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); + case 1: + return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); + case 2: + return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); + case 3: + return parseErrorAtCurrentToken(Diagnostics.Statement_expected); + case 18: + case 4: + return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); + case 5: + return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); + case 6: + return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); + case 7: + return parseErrorAtCurrentToken(Diagnostics.Expression_expected); + case 8: + return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); + case 9: + return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); + case 10: + return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); + case 11: + return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); + case 12: + return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); + case 15: + return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); + case 17: + return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); + case 16: + return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); + case 19: + return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); + case 20: + return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); + case 21: + return parseErrorAtCurrentToken(Diagnostics.Type_expected); + case 22: + return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); + case 23: + if (token() === 161) { + return parseErrorAtCurrentToken(Diagnostics._0_expected, "}"); + } + return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); + case 13: + return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); + case 14: + return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); + case 24: + return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); + case 25: + return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); + case 26: + return Debug.fail("ParsingContext.Count used as a context"); + default: + Debug.assertNever(context2); + } + } + function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { + const saveParsingContext = parsingContext; + parsingContext |= 1 << kind; + const list = []; + const listPos = getNodePos(); + let commaStart = -1; + while (true) { + if (isListElement2( + kind, + /*inErrorRecovery*/ + false + )) { + const startPos = scanner2.getTokenFullStart(); + const result2 = parseListElement(kind, parseElement); + if (!result2) { + parsingContext = saveParsingContext; + return void 0; + } + list.push(result2); + commaStart = scanner2.getTokenStart(); + if (parseOptional( + 28 + /* CommaToken */ + )) { + continue; + } + commaStart = -1; + if (isListTerminator(kind)) { + break; + } + parseExpected(28, getExpectedCommaDiagnostic(kind)); + if (considerSemicolonAsDelimiter && token() === 27 && !scanner2.hasPrecedingLineBreak()) { + nextToken(); + } + if (startPos === scanner2.getTokenFullStart()) { + nextToken(); + } + continue; + } + if (isListTerminator(kind)) { + break; + } + if (abortParsingListOrMoveToNextToken(kind)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray( + list, + listPos, + /*end*/ + void 0, + commaStart >= 0 + ); + } + function getExpectedCommaDiagnostic(kind) { + return kind === 6 ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; + } + function createMissingList() { + const list = createNodeArray([], getNodePos()); + list.isMissingList = true; + return list; + } + function isMissingList(arr) { + return !!arr.isMissingList; + } + function parseBracketedList(kind, parseElement, open2, close) { + if (parseExpected(open2)) { + const result2 = parseDelimitedList(kind, parseElement); + parseExpected(close); + return result2; + } + return createMissingList(); + } + function parseEntityName(allowReservedWords, diagnosticMessage) { + const pos = getNodePos(); + let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); + while (parseOptional( + 25 + /* DotToken */ + )) { + if (token() === 30) { + break; + } + entity = finishNode( + factory2.createQualifiedName( + entity, + parseRightSideOfDot( + allowReservedWords, + /*allowPrivateIdentifiers*/ + false, + /*allowUnicodeEscapeSequenceInIdentifierName*/ + true + ) + ), + pos + ); + } + return entity; + } + function createQualifiedName(entity, name2) { + return finishNode(factory2.createQualifiedName(entity, name2), entity.pos); + } + function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers, allowUnicodeEscapeSequenceInIdentifierName) { + if (scanner2.hasPrecedingLineBreak() && tokenIsIdentifierOrKeyword(token())) { + const matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); + if (matchesPattern) { + return createMissingNode( + 80, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Identifier_expected + ); + } + } + if (token() === 81) { + const node = parsePrivateIdentifier(); + return allowPrivateIdentifiers ? node : createMissingNode( + 80, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Identifier_expected + ); + } + if (allowIdentifierNames) { + return allowUnicodeEscapeSequenceInIdentifierName ? parseIdentifierName() : parseIdentifierNameErrorOnUnicodeEscapeSequence(); + } + return parseIdentifier(); + } + function parseTemplateSpans(isTaggedTemplate) { + const pos = getNodePos(); + const list = []; + let node; + do { + node = parseTemplateSpan(isTaggedTemplate); + list.push(node); + } while (node.literal.kind === 17); + return createNodeArray(list, pos); + } + function parseTemplateExpression(isTaggedTemplate) { + const pos = getNodePos(); + return finishNode( + factory2.createTemplateExpression( + parseTemplateHead(isTaggedTemplate), + parseTemplateSpans(isTaggedTemplate) + ), + pos + ); + } + function parseTemplateType() { + const pos = getNodePos(); + return finishNode( + factory2.createTemplateLiteralType( + parseTemplateHead( + /*isTaggedTemplate*/ + false + ), + parseTemplateTypeSpans() + ), + pos + ); + } + function parseTemplateTypeSpans() { + const pos = getNodePos(); + const list = []; + let node; + do { + node = parseTemplateTypeSpan(); + list.push(node); + } while (node.literal.kind === 17); + return createNodeArray(list, pos); + } + function parseTemplateTypeSpan() { + const pos = getNodePos(); + return finishNode( + factory2.createTemplateLiteralTypeSpan( + parseType(), + parseLiteralOfTemplateSpan( + /*isTaggedTemplate*/ + false + ) + ), + pos + ); + } + function parseLiteralOfTemplateSpan(isTaggedTemplate) { + if (token() === 20) { + reScanTemplateToken(isTaggedTemplate); + return parseTemplateMiddleOrTemplateTail(); + } else { + return parseExpectedToken(18, Diagnostics._0_expected, tokenToString( + 20 + /* CloseBraceToken */ + )); + } + } + function parseTemplateSpan(isTaggedTemplate) { + const pos = getNodePos(); + return finishNode( + factory2.createTemplateSpan( + allowInAnd(parseExpression), + parseLiteralOfTemplateSpan(isTaggedTemplate) + ), + pos + ); + } + function parseLiteralNode() { + return parseLiteralLikeNode(token()); + } + function parseTemplateHead(isTaggedTemplate) { + if (!isTaggedTemplate && scanner2.getTokenFlags() & 26656) { + reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + } + const fragment = parseLiteralLikeNode(token()); + Debug.assert(fragment.kind === 16, "Template head has wrong token kind"); + return fragment; + } + function parseTemplateMiddleOrTemplateTail() { + const fragment = parseLiteralLikeNode(token()); + Debug.assert(fragment.kind === 17 || fragment.kind === 18, "Template fragment has wrong token kind"); + return fragment; + } + function getTemplateLiteralRawText(kind) { + const isLast = kind === 15 || kind === 18; + const tokenText = scanner2.getTokenText(); + return tokenText.substring(1, tokenText.length - (scanner2.isUnterminated() ? 0 : isLast ? 1 : 2)); + } + function parseLiteralLikeNode(kind) { + const pos = getNodePos(); + const node = isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode( + kind, + scanner2.getTokenValue(), + getTemplateLiteralRawText(kind), + scanner2.getTokenFlags() & 7176 + /* TemplateLiteralLikeFlags */ + ) : ( + // Note that theoretically the following condition would hold true literals like 009, + // which is not octal. But because of how the scanner separates the tokens, we would + // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. + // We also do not need to check for negatives because any prefix operator would be part of a + // parent unary expression. + kind === 9 ? factoryCreateNumericLiteral(scanner2.getTokenValue(), scanner2.getNumericLiteralFlags()) : kind === 11 ? factoryCreateStringLiteral( + scanner2.getTokenValue(), + /*isSingleQuote*/ + void 0, + scanner2.hasExtendedUnicodeEscape() + ) : isLiteralKind(kind) ? factoryCreateLiteralLikeNode(kind, scanner2.getTokenValue()) : Debug.fail() + ); + if (scanner2.hasExtendedUnicodeEscape()) { + node.hasExtendedUnicodeEscape = true; + } + if (scanner2.isUnterminated()) { + node.isUnterminated = true; + } + nextToken(); + return finishNode(node, pos); + } + function parseEntityNameOfTypeReference() { + return parseEntityName( + /*allowReservedWords*/ + true, + Diagnostics.Type_expected + ); + } + function parseTypeArgumentsOfTypeReference() { + if (!scanner2.hasPrecedingLineBreak() && reScanLessThanToken() === 30) { + return parseBracketedList( + 20, + parseType, + 30, + 32 + /* GreaterThanToken */ + ); + } + } + function parseTypeReference() { + const pos = getNodePos(); + return finishNode( + factory2.createTypeReferenceNode( + parseEntityNameOfTypeReference(), + parseTypeArgumentsOfTypeReference() + ), + pos + ); + } + function typeHasArrowFunctionBlockingParseError(node) { + switch (node.kind) { + case 183: + return nodeIsMissing(node.typeName); + case 184: + case 185: { + const { parameters, type: type3 } = node; + return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type3); + } + case 196: + return typeHasArrowFunctionBlockingParseError(node.type); + default: + return false; + } + } + function parseThisTypePredicate(lhs) { + nextToken(); + return finishNode(factory2.createTypePredicateNode( + /*assertsModifier*/ + void 0, + lhs, + parseType() + ), lhs.pos); + } + function parseThisTypeNode() { + const pos = getNodePos(); + nextToken(); + return finishNode(factory2.createThisTypeNode(), pos); + } + function parseJSDocAllType() { + const pos = getNodePos(); + nextToken(); + return finishNode(factory2.createJSDocAllType(), pos); + } + function parseJSDocNonNullableType() { + const pos = getNodePos(); + nextToken(); + return finishNode(factory2.createJSDocNonNullableType( + parseNonArrayType(), + /*postfix*/ + false + ), pos); + } + function parseJSDocUnknownOrNullableType() { + const pos = getNodePos(); + nextToken(); + if (token() === 28 || token() === 20 || token() === 22 || token() === 32 || token() === 64 || token() === 52) { + return finishNode(factory2.createJSDocUnknownType(), pos); + } else { + return finishNode(factory2.createJSDocNullableType( + parseType(), + /*postfix*/ + false + ), pos); + } + } + function parseJSDocFunctionType() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + if (tryParse(nextTokenIsOpenParen)) { + const parameters = parseParameters( + 4 | 32 + /* JSDoc */ + ); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + return withJSDoc(finishNode(factory2.createJSDocFunctionType(parameters, type3), pos), hasJSDoc); + } + return finishNode(factory2.createTypeReferenceNode( + parseIdentifierName(), + /*typeArguments*/ + void 0 + ), pos); + } + function parseJSDocParameter() { + const pos = getNodePos(); + let name2; + if (token() === 110 || token() === 105) { + name2 = parseIdentifierName(); + parseExpected( + 59 + /* ColonToken */ + ); + } + return finishNode( + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + // TODO(rbuckton): JSDoc parameters don't have names (except `this`/`new`), should we manufacture an empty identifier? + name2, + /*questionToken*/ + void 0, + parseJSDocType(), + /*initializer*/ + void 0 + ), + pos + ); + } + function parseJSDocType() { + scanner2.setInJSDocType(true); + const pos = getNodePos(); + if (parseOptional( + 144 + /* ModuleKeyword */ + )) { + const moduleTag = factory2.createJSDocNamepathType( + /*type*/ + void 0 + ); + terminate: + while (true) { + switch (token()) { + case 20: + case 1: + case 28: + case 5: + break terminate; + default: + nextTokenJSDoc(); + } + } + scanner2.setInJSDocType(false); + return finishNode(moduleTag, pos); + } + const hasDotDotDot = parseOptional( + 26 + /* DotDotDotToken */ + ); + let type3 = parseTypeOrTypePredicate(); + scanner2.setInJSDocType(false); + if (hasDotDotDot) { + type3 = finishNode(factory2.createJSDocVariadicType(type3), pos); + } + if (token() === 64) { + nextToken(); + return finishNode(factory2.createJSDocOptionalType(type3), pos); + } + return type3; + } + function parseTypeQuery() { + const pos = getNodePos(); + parseExpected( + 114 + /* TypeOfKeyword */ + ); + const entityName = parseEntityName( + /*allowReservedWords*/ + true + ); + const typeArguments = !scanner2.hasPrecedingLineBreak() ? tryParseTypeArguments() : void 0; + return finishNode(factory2.createTypeQueryNode(entityName, typeArguments), pos); + } + function parseTypeParameter() { + const pos = getNodePos(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false, + /*permitConstAsModifier*/ + true + ); + const name2 = parseIdentifier(); + let constraint; + let expression; + if (parseOptional( + 96 + /* ExtendsKeyword */ + )) { + if (isStartOfType() || !isStartOfExpression()) { + constraint = parseType(); + } else { + expression = parseUnaryExpressionOrHigher(); + } + } + const defaultType = parseOptional( + 64 + /* EqualsToken */ + ) ? parseType() : void 0; + const node = factory2.createTypeParameterDeclaration(modifiers, name2, constraint, defaultType); + node.expression = expression; + return finishNode(node, pos); + } + function parseTypeParameters() { + if (token() === 30) { + return parseBracketedList( + 19, + parseTypeParameter, + 30, + 32 + /* GreaterThanToken */ + ); + } + } + function isStartOfParameter(isJSDocParameter) { + return token() === 26 || isBindingIdentifierOrPrivateIdentifierOrPattern() || isModifierKind(token()) || token() === 60 || isStartOfType( + /*inStartOfParameter*/ + !isJSDocParameter + ); + } + function parseNameOfParameter(modifiers) { + const name2 = parseIdentifierOrPattern(Diagnostics.Private_identifiers_cannot_be_used_as_parameters); + if (getFullWidth(name2) === 0 && !some2(modifiers) && isModifierKind(token())) { + nextToken(); + } + return name2; + } + function isParameterNameStart() { + return isBindingIdentifier() || token() === 23 || token() === 19; + } + function parseParameter(inOuterAwaitContext) { + return parseParameterWorker(inOuterAwaitContext); + } + function parseParameterForSpeculation(inOuterAwaitContext) { + return parseParameterWorker( + inOuterAwaitContext, + /*allowAmbiguity*/ + false + ); + } + function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = inOuterAwaitContext ? doInAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )) : doOutsideOfAwaitContext(() => parseModifiers( + /*allowDecorators*/ + true + )); + if (token() === 110) { + const node2 = factory2.createParameterDeclaration( + modifiers, + /*dotDotDotToken*/ + void 0, + createIdentifier( + /*isIdentifier*/ + true + ), + /*questionToken*/ + void 0, + parseTypeAnnotation(), + /*initializer*/ + void 0 + ); + const modifier = firstOrUndefined(modifiers); + if (modifier) { + parseErrorAtRange(modifier, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + return withJSDoc(finishNode(node2, pos), hasJSDoc); + } + const savedTopLevel = topLevel; + topLevel = false; + const dotDotDotToken = parseOptionalToken( + 26 + /* DotDotDotToken */ + ); + if (!allowAmbiguity && !isParameterNameStart()) { + return void 0; + } + const node = withJSDoc( + finishNode( + factory2.createParameterDeclaration( + modifiers, + dotDotDotToken, + parseNameOfParameter(modifiers), + parseOptionalToken( + 58 + /* QuestionToken */ + ), + parseTypeAnnotation(), + parseInitializer() + ), + pos + ), + hasJSDoc + ); + topLevel = savedTopLevel; + return node; + } + function parseReturnType(returnToken, isType) { + if (shouldParseReturnType(returnToken, isType)) { + return allowConditionalTypesAnd(parseTypeOrTypePredicate); + } + } + function shouldParseReturnType(returnToken, isType) { + if (returnToken === 39) { + parseExpected(returnToken); + return true; + } else if (parseOptional( + 59 + /* ColonToken */ + )) { + return true; + } else if (isType && token() === 39) { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 59 + /* ColonToken */ + )); + nextToken(); + return true; + } + return false; + } + function parseParametersWorker(flags, allowAmbiguity) { + const savedYieldContext = inYieldContext(); + const savedAwaitContext = inAwaitContext(); + setYieldContext(!!(flags & 1)); + setAwaitContext(!!(flags & 2)); + const parameters = flags & 32 ? parseDelimitedList(17, parseJSDocParameter) : parseDelimitedList(16, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return parameters; + } + function parseParameters(flags) { + if (!parseExpected( + 21 + /* OpenParenToken */ + )) { + return createMissingList(); + } + const parameters = parseParametersWorker( + flags, + /*allowAmbiguity*/ + true + ); + parseExpected( + 22 + /* CloseParenToken */ + ); + return parameters; + } + function parseTypeMemberSemicolon() { + if (parseOptional( + 28 + /* CommaToken */ + )) { + return; + } + parseSemicolon(); + } + function parseSignatureMember(kind) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + if (kind === 180) { + parseExpected( + 105 + /* NewKeyword */ + ); + } + const typeParameters = parseTypeParameters(); + const parameters = parseParameters( + 4 + /* Type */ + ); + const type3 = parseReturnType( + 59, + /*isType*/ + true + ); + parseTypeMemberSemicolon(); + const node = kind === 179 ? factory2.createCallSignature(typeParameters, parameters, type3) : factory2.createConstructSignature(typeParameters, parameters, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isIndexSignature() { + return token() === 23 && lookAhead(isUnambiguouslyIndexSignature); + } + function isUnambiguouslyIndexSignature() { + nextToken(); + if (token() === 26 || token() === 24) { + return true; + } + if (isModifierKind(token())) { + nextToken(); + if (isIdentifier2()) { + return true; + } + } else if (!isIdentifier2()) { + return false; + } else { + nextToken(); + } + if (token() === 59 || token() === 28) { + return true; + } + if (token() !== 58) { + return false; + } + nextToken(); + return token() === 59 || token() === 28 || token() === 24; + } + function parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers) { + const parameters = parseBracketedList( + 16, + () => parseParameter( + /*inOuterAwaitContext*/ + false + ), + 23, + 24 + /* CloseBracketToken */ + ); + const type3 = parseTypeAnnotation(); + parseTypeMemberSemicolon(); + const node = factory2.createIndexSignature(modifiers, parameters, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { + const name2 = parsePropertyName(); + const questionToken = parseOptionalToken( + 58 + /* QuestionToken */ + ); + let node; + if (token() === 21 || token() === 30) { + const typeParameters = parseTypeParameters(); + const parameters = parseParameters( + 4 + /* Type */ + ); + const type3 = parseReturnType( + 59, + /*isType*/ + true + ); + node = factory2.createMethodSignature(modifiers, name2, questionToken, typeParameters, parameters, type3); + } else { + const type3 = parseTypeAnnotation(); + node = factory2.createPropertySignature(modifiers, name2, questionToken, type3); + if (token() === 64) + node.initializer = parseInitializer(); + } + parseTypeMemberSemicolon(); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isTypeMemberStart() { + if (token() === 21 || token() === 30 || token() === 139 || token() === 153) { + return true; + } + let idToken = false; + while (isModifierKind(token())) { + idToken = true; + nextToken(); + } + if (token() === 23) { + return true; + } + if (isLiteralPropertyName()) { + idToken = true; + nextToken(); + } + if (idToken) { + return token() === 21 || token() === 30 || token() === 58 || token() === 59 || token() === 28 || canParseSemicolon(); + } + return false; + } + function parseTypeMember() { + if (token() === 21 || token() === 30) { + return parseSignatureMember( + 179 + /* CallSignature */ + ); + } + if (token() === 105 && lookAhead(nextTokenIsOpenParenOrLessThan)) { + return parseSignatureMember( + 180 + /* ConstructSignature */ + ); + } + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); + if (parseContextualModifier( + 139 + /* GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 177, + 4 + /* Type */ + ); + } + if (parseContextualModifier( + 153 + /* SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 178, + 4 + /* Type */ + ); + } + if (isIndexSignature()) { + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); + } + return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); + } + function nextTokenIsOpenParenOrLessThan() { + nextToken(); + return token() === 21 || token() === 30; + } + function nextTokenIsDot() { + return nextToken() === 25; + } + function nextTokenIsOpenParenOrLessThanOrDot() { + switch (nextToken()) { + case 21: + case 30: + case 25: + return true; + } + return false; + } + function parseTypeLiteral() { + const pos = getNodePos(); + return finishNode(factory2.createTypeLiteralNode(parseObjectTypeMembers()), pos); + } + function parseObjectTypeMembers() { + let members; + if (parseExpected( + 19 + /* OpenBraceToken */ + )) { + members = parseList(4, parseTypeMember); + parseExpected( + 20 + /* CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + return members; + } + function isStartOfMappedType() { + nextToken(); + if (token() === 40 || token() === 41) { + return nextToken() === 148; + } + if (token() === 148) { + nextToken(); + } + return token() === 23 && nextTokenIsIdentifier() && nextToken() === 103; + } + function parseMappedTypeParameter() { + const pos = getNodePos(); + const name2 = parseIdentifierName(); + parseExpected( + 103 + /* InKeyword */ + ); + const type3 = parseType(); + return finishNode(factory2.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + type3, + /*defaultType*/ + void 0 + ), pos); + } + function parseMappedType() { + const pos = getNodePos(); + parseExpected( + 19 + /* OpenBraceToken */ + ); + let readonlyToken; + if (token() === 148 || token() === 40 || token() === 41) { + readonlyToken = parseTokenNode(); + if (readonlyToken.kind !== 148) { + parseExpected( + 148 + /* ReadonlyKeyword */ + ); + } + } + parseExpected( + 23 + /* OpenBracketToken */ + ); + const typeParameter = parseMappedTypeParameter(); + const nameType = parseOptional( + 130 + /* AsKeyword */ + ) ? parseType() : void 0; + parseExpected( + 24 + /* CloseBracketToken */ + ); + let questionToken; + if (token() === 58 || token() === 40 || token() === 41) { + questionToken = parseTokenNode(); + if (questionToken.kind !== 58) { + parseExpected( + 58 + /* QuestionToken */ + ); + } + } + const type3 = parseTypeAnnotation(); + parseSemicolon(); + const members = parseList(4, parseTypeMember); + parseExpected( + 20 + /* CloseBraceToken */ + ); + return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type3, members), pos); + } + function parseTupleElementType() { + const pos = getNodePos(); + if (parseOptional( + 26 + /* DotDotDotToken */ + )) { + return finishNode(factory2.createRestTypeNode(parseType()), pos); + } + const type3 = parseType(); + if (isJSDocNullableType(type3) && type3.pos === type3.type.pos) { + const node = factory2.createOptionalTypeNode(type3.type); + setTextRange(node, type3); + node.flags = type3.flags; + return node; + } + return type3; + } + function isNextTokenColonOrQuestionColon() { + return nextToken() === 59 || token() === 58 && nextToken() === 59; + } + function isTupleElementName() { + if (token() === 26) { + return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon(); + } + return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon(); + } + function parseTupleElementNameOrTupleElementType() { + if (lookAhead(isTupleElementName)) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const dotDotDotToken = parseOptionalToken( + 26 + /* DotDotDotToken */ + ); + const name2 = parseIdentifierName(); + const questionToken = parseOptionalToken( + 58 + /* QuestionToken */ + ); + parseExpected( + 59 + /* ColonToken */ + ); + const type3 = parseTupleElementType(); + const node = factory2.createNamedTupleMember(dotDotDotToken, name2, questionToken, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + return parseTupleElementType(); + } + function parseTupleType() { + const pos = getNodePos(); + return finishNode( + factory2.createTupleTypeNode( + parseBracketedList( + 21, + parseTupleElementNameOrTupleElementType, + 23, + 24 + /* CloseBracketToken */ + ) + ), + pos + ); + } + function parseParenthesizedType() { + const pos = getNodePos(); + parseExpected( + 21 + /* OpenParenToken */ + ); + const type3 = parseType(); + parseExpected( + 22 + /* CloseParenToken */ + ); + return finishNode(factory2.createParenthesizedType(type3), pos); + } + function parseModifiersForConstructorType() { + let modifiers; + if (token() === 128) { + const pos = getNodePos(); + nextToken(); + const modifier = finishNode(factoryCreateToken( + 128 + /* AbstractKeyword */ + ), pos); + modifiers = createNodeArray([modifier], pos); + } + return modifiers; + } + function parseFunctionOrConstructorType() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiersForConstructorType(); + const isConstructorType = parseOptional( + 105 + /* NewKeyword */ + ); + Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers."); + const typeParameters = parseTypeParameters(); + const parameters = parseParameters( + 4 + /* Type */ + ); + const type3 = parseReturnType( + 39, + /*isType*/ + false + ); + const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type3) : factory2.createFunctionTypeNode(typeParameters, parameters, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseKeywordAndNoDot() { + const node = parseTokenNode(); + return token() === 25 ? void 0 : node; + } + function parseLiteralTypeNode(negative) { + const pos = getNodePos(); + if (negative) { + nextToken(); + } + let expression = token() === 112 || token() === 97 || token() === 106 ? parseTokenNode() : parseLiteralLikeNode(token()); + if (negative) { + expression = finishNode(factory2.createPrefixUnaryExpression(41, expression), pos); + } + return finishNode(factory2.createLiteralTypeNode(expression), pos); + } + function isStartOfTypeOfImportType() { + nextToken(); + return token() === 102; + } + function parseImportType() { + sourceFlags |= 4194304; + const pos = getNodePos(); + const isTypeOf = parseOptional( + 114 + /* TypeOfKeyword */ + ); + parseExpected( + 102 + /* ImportKeyword */ + ); + parseExpected( + 21 + /* OpenParenToken */ + ); + const type3 = parseType(); + let attributes; + if (parseOptional( + 28 + /* CommaToken */ + )) { + const openBracePosition = scanner2.getTokenStart(); + parseExpected( + 19 + /* OpenBraceToken */ + ); + const currentToken2 = token(); + if (currentToken2 === 118 || currentToken2 === 132) { + nextToken(); + } else { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString( + 118 + /* WithKeyword */ + )); + } + parseExpected( + 59 + /* ColonToken */ + ); + attributes = parseImportAttributes( + currentToken2, + /*skipKeyword*/ + true + ); + if (!parseExpected( + 20 + /* CloseBraceToken */ + )) { + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === Diagnostics._0_expected.code) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") + ); + } + } + } + parseExpected( + 22 + /* CloseParenToken */ + ); + const qualifier = parseOptional( + 25 + /* DotToken */ + ) ? parseEntityNameOfTypeReference() : void 0; + const typeArguments = parseTypeArgumentsOfTypeReference(); + return finishNode(factory2.createImportTypeNode(type3, attributes, qualifier, typeArguments, isTypeOf), pos); + } + function nextTokenIsNumericOrBigIntLiteral() { + nextToken(); + return token() === 9 || token() === 10; + } + function parseNonArrayType() { + switch (token()) { + case 133: + case 159: + case 154: + case 150: + case 163: + case 155: + case 136: + case 157: + case 146: + case 151: + return tryParse(parseKeywordAndNoDot) || parseTypeReference(); + case 67: + scanner2.reScanAsteriskEqualsToken(); + case 42: + return parseJSDocAllType(); + case 61: + scanner2.reScanQuestionToken(); + case 58: + return parseJSDocUnknownOrNullableType(); + case 100: + return parseJSDocFunctionType(); + case 54: + return parseJSDocNonNullableType(); + case 15: + case 11: + case 9: + case 10: + case 112: + case 97: + case 106: + return parseLiteralTypeNode(); + case 41: + return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode( + /*negative*/ + true + ) : parseTypeReference(); + case 116: + return parseTokenNode(); + case 110: { + const thisKeyword = parseThisTypeNode(); + if (token() === 142 && !scanner2.hasPrecedingLineBreak()) { + return parseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + case 114: + return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery(); + case 19: + return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); + case 23: + return parseTupleType(); + case 21: + return parseParenthesizedType(); + case 102: + return parseImportType(); + case 131: + return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); + case 16: + return parseTemplateType(); + default: + return parseTypeReference(); + } + } + function isStartOfType(inStartOfParameter) { + switch (token()) { + case 133: + case 159: + case 154: + case 150: + case 163: + case 136: + case 148: + case 155: + case 158: + case 116: + case 157: + case 106: + case 110: + case 114: + case 146: + case 19: + case 23: + case 30: + case 52: + case 51: + case 105: + case 11: + case 9: + case 10: + case 112: + case 97: + case 151: + case 42: + case 58: + case 54: + case 26: + case 140: + case 102: + case 131: + case 15: + case 16: + return true; + case 100: + return !inStartOfParameter; + case 41: + return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral); + case 21: + return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType); + default: + return isIdentifier2(); + } + } + function isStartOfParenthesizedOrFunctionType() { + nextToken(); + return token() === 22 || isStartOfParameter( + /*isJSDocParameter*/ + false + ) || isStartOfType(); + } + function parsePostfixTypeOrHigher() { + const pos = getNodePos(); + let type3 = parseNonArrayType(); + while (!scanner2.hasPrecedingLineBreak()) { + switch (token()) { + case 54: + nextToken(); + type3 = finishNode(factory2.createJSDocNonNullableType( + type3, + /*postfix*/ + true + ), pos); + break; + case 58: + if (lookAhead(nextTokenIsStartOfType)) { + return type3; + } + nextToken(); + type3 = finishNode(factory2.createJSDocNullableType( + type3, + /*postfix*/ + true + ), pos); + break; + case 23: + parseExpected( + 23 + /* OpenBracketToken */ + ); + if (isStartOfType()) { + const indexType = parseType(); + parseExpected( + 24 + /* CloseBracketToken */ + ); + type3 = finishNode(factory2.createIndexedAccessTypeNode(type3, indexType), pos); + } else { + parseExpected( + 24 + /* CloseBracketToken */ + ); + type3 = finishNode(factory2.createArrayTypeNode(type3), pos); + } + break; + default: + return type3; + } + } + return type3; + } + function parseTypeOperator(operator) { + const pos = getNodePos(); + parseExpected(operator); + return finishNode(factory2.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos); + } + function tryParseConstraintOfInferType() { + if (parseOptional( + 96 + /* ExtendsKeyword */ + )) { + const constraint = disallowConditionalTypesAnd(parseType); + if (inDisallowConditionalTypesContext() || token() !== 58) { + return constraint; + } + } + } + function parseTypeParameterOfInferType() { + const pos = getNodePos(); + const name2 = parseIdentifier(); + const constraint = tryParse(tryParseConstraintOfInferType); + const node = factory2.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + constraint + ); + return finishNode(node, pos); + } + function parseInferType() { + const pos = getNodePos(); + parseExpected( + 140 + /* InferKeyword */ + ); + return finishNode(factory2.createInferTypeNode(parseTypeParameterOfInferType()), pos); + } + function parseTypeOperatorOrHigher() { + const operator = token(); + switch (operator) { + case 143: + case 158: + case 148: + return parseTypeOperator(operator); + case 140: + return parseInferType(); + } + return allowConditionalTypesAnd(parsePostfixTypeOrHigher); + } + function parseFunctionOrConstructorTypeToError(isInUnionType) { + if (isStartOfFunctionTypeOrConstructorType()) { + const type3 = parseFunctionOrConstructorType(); + let diagnostic; + if (isFunctionTypeNode(type3)) { + diagnostic = isInUnionType ? Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; + } else { + diagnostic = isInUnionType ? Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; + } + parseErrorAtRange(type3, diagnostic); + return type3; + } + return void 0; + } + function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) { + const pos = getNodePos(); + const isUnionType = operator === 52; + const hasLeadingOperator = parseOptional(operator); + let type3 = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType(); + if (token() === operator || hasLeadingOperator) { + const types3 = [type3]; + while (parseOptional(operator)) { + types3.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); + } + type3 = finishNode(createTypeNode(createNodeArray(types3, pos)), pos); + } + return type3; + } + function parseIntersectionTypeOrHigher() { + return parseUnionOrIntersectionType(51, parseTypeOperatorOrHigher, factory2.createIntersectionTypeNode); + } + function parseUnionTypeOrHigher() { + return parseUnionOrIntersectionType(52, parseIntersectionTypeOrHigher, factory2.createUnionTypeNode); + } + function nextTokenIsNewKeyword() { + nextToken(); + return token() === 105; + } + function isStartOfFunctionTypeOrConstructorType() { + if (token() === 30) { + return true; + } + if (token() === 21 && lookAhead(isUnambiguouslyStartOfFunctionType)) { + return true; + } + return token() === 105 || token() === 128 && lookAhead(nextTokenIsNewKeyword); + } + function skipParameterStart() { + if (isModifierKind(token())) { + parseModifiers( + /*allowDecorators*/ + false + ); + } + if (isIdentifier2() || token() === 110) { + nextToken(); + return true; + } + if (token() === 23 || token() === 19) { + const previousErrorCount = parseDiagnostics.length; + parseIdentifierOrPattern(); + return previousErrorCount === parseDiagnostics.length; + } + return false; + } + function isUnambiguouslyStartOfFunctionType() { + nextToken(); + if (token() === 22 || token() === 26) { + return true; + } + if (skipParameterStart()) { + if (token() === 59 || token() === 28 || token() === 58 || token() === 64) { + return true; + } + if (token() === 22) { + nextToken(); + if (token() === 39) { + return true; + } + } + } + return false; + } + function parseTypeOrTypePredicate() { + const pos = getNodePos(); + const typePredicateVariable = isIdentifier2() && tryParse(parseTypePredicatePrefix); + const type3 = parseType(); + if (typePredicateVariable) { + return finishNode(factory2.createTypePredicateNode( + /*assertsModifier*/ + void 0, + typePredicateVariable, + type3 + ), pos); + } else { + return type3; + } + } + function parseTypePredicatePrefix() { + const id = parseIdentifier(); + if (token() === 142 && !scanner2.hasPrecedingLineBreak()) { + nextToken(); + return id; + } + } + function parseAssertsTypePredicate() { + const pos = getNodePos(); + const assertsModifier = parseExpectedToken( + 131 + /* AssertsKeyword */ + ); + const parameterName = token() === 110 ? parseThisTypeNode() : parseIdentifier(); + const type3 = parseOptional( + 142 + /* IsKeyword */ + ) ? parseType() : void 0; + return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type3), pos); + } + function parseType() { + if (contextFlags & 81920) { + return doOutsideOfContext(81920, parseType); + } + if (isStartOfFunctionTypeOrConstructorType()) { + return parseFunctionOrConstructorType(); + } + const pos = getNodePos(); + const type3 = parseUnionTypeOrHigher(); + if (!inDisallowConditionalTypesContext() && !scanner2.hasPrecedingLineBreak() && parseOptional( + 96 + /* ExtendsKeyword */ + )) { + const extendsType = disallowConditionalTypesAnd(parseType); + parseExpected( + 58 + /* QuestionToken */ + ); + const trueType = allowConditionalTypesAnd(parseType); + parseExpected( + 59 + /* ColonToken */ + ); + const falseType = allowConditionalTypesAnd(parseType); + return finishNode(factory2.createConditionalTypeNode(type3, extendsType, trueType, falseType), pos); + } + return type3; + } + function parseTypeAnnotation() { + return parseOptional( + 59 + /* ColonToken */ + ) ? parseType() : void 0; + } + function isStartOfLeftHandSideExpression() { + switch (token()) { + case 110: + case 108: + case 106: + case 112: + case 97: + case 9: + case 10: + case 11: + case 15: + case 16: + case 21: + case 23: + case 19: + case 100: + case 86: + case 105: + case 44: + case 69: + case 80: + return true; + case 102: + return lookAhead(nextTokenIsOpenParenOrLessThanOrDot); + default: + return isIdentifier2(); + } + } + function isStartOfExpression() { + if (isStartOfLeftHandSideExpression()) { + return true; + } + switch (token()) { + case 40: + case 41: + case 55: + case 54: + case 91: + case 114: + case 116: + case 46: + case 47: + case 30: + case 135: + case 127: + case 81: + case 60: + return true; + default: + if (isBinaryOperator2()) { + return true; + } + return isIdentifier2(); + } + } + function isStartOfExpressionStatement() { + return token() !== 19 && token() !== 100 && token() !== 86 && token() !== 60 && isStartOfExpression(); + } + function parseExpression() { + const saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + false + ); + } + const pos = getNodePos(); + let expr = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + let operatorToken; + while (operatorToken = parseOptionalToken( + 28 + /* CommaToken */ + )) { + expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ), pos); + } + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + true + ); + } + return expr; + } + function parseInitializer() { + return parseOptional( + 64 + /* EqualsToken */ + ) ? parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ) : void 0; + } + function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) { + if (isYieldExpression2()) { + return parseYieldExpression(); + } + const arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction); + if (arrowExpression) { + return arrowExpression; + } + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const expr = parseBinaryExpressionOrHigher( + 0 + /* Lowest */ + ); + if (expr.kind === 80 && token() === 39) { + return parseSimpleArrowFunctionExpression( + pos, + expr, + allowReturnTypeInArrowFunction, + hasJSDoc, + /*asyncModifier*/ + void 0 + ); + } + if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { + return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos); + } + return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction); + } + function isYieldExpression2() { + if (token() === 127) { + if (inYieldContext()) { + return true; + } + return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); + } + return false; + } + function nextTokenIsIdentifierOnSameLine() { + nextToken(); + return !scanner2.hasPrecedingLineBreak() && isIdentifier2(); + } + function parseYieldExpression() { + const pos = getNodePos(); + nextToken(); + if (!scanner2.hasPrecedingLineBreak() && (token() === 42 || isStartOfExpression())) { + return finishNode( + factory2.createYieldExpression( + parseOptionalToken( + 42 + /* AsteriskToken */ + ), + parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ) + ), + pos + ); + } else { + return finishNode(factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + /*expression*/ + void 0 + ), pos); + } + } + function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) { + Debug.assert(token() === 39, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); + const parameter = factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + identifier, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + finishNode(parameter, identifier.pos); + const parameters = createNodeArray([parameter], parameter.pos, parameter.end); + const equalsGreaterThanToken = parseExpectedToken( + 39 + /* EqualsGreaterThanToken */ + ); + const body = parseArrowFunctionExpressionBody( + /*isAsync*/ + !!asyncModifier, + allowReturnTypeInArrowFunction + ); + const node = factory2.createArrowFunction( + asyncModifier, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + equalsGreaterThanToken, + body + ); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { + const triState = isParenthesizedArrowFunctionExpression(); + if (triState === 0) { + return void 0; + } + return triState === 1 ? parseParenthesizedArrowFunctionExpression( + /*allowAmbiguity*/ + true, + /*allowReturnTypeInArrowFunction*/ + true + ) : tryParse(() => parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction)); + } + function isParenthesizedArrowFunctionExpression() { + if (token() === 21 || token() === 30 || token() === 134) { + return lookAhead(isParenthesizedArrowFunctionExpressionWorker); + } + if (token() === 39) { + return 1; + } + return 0; + } + function isParenthesizedArrowFunctionExpressionWorker() { + if (token() === 134) { + nextToken(); + if (scanner2.hasPrecedingLineBreak()) { + return 0; + } + if (token() !== 21 && token() !== 30) { + return 0; + } + } + const first2 = token(); + const second = nextToken(); + if (first2 === 21) { + if (second === 22) { + const third = nextToken(); + switch (third) { + case 39: + case 59: + case 19: + return 1; + default: + return 0; + } + } + if (second === 23 || second === 19) { + return 2; + } + if (second === 26) { + return 1; + } + if (isModifierKind(second) && second !== 134 && lookAhead(nextTokenIsIdentifier)) { + if (nextToken() === 130) { + return 0; + } + return 1; + } + if (!isIdentifier2() && second !== 110) { + return 0; + } + switch (nextToken()) { + case 59: + return 1; + case 58: + nextToken(); + if (token() === 59 || token() === 28 || token() === 64 || token() === 22) { + return 1; + } + return 0; + case 28: + case 64: + case 22: + return 2; + } + return 0; + } else { + Debug.assert( + first2 === 30 + /* LessThanToken */ + ); + if (!isIdentifier2() && token() !== 87) { + return 0; + } + if (languageVariant === 1) { + const isArrowFunctionInJsx = lookAhead(() => { + parseOptional( + 87 + /* ConstKeyword */ + ); + const third = nextToken(); + if (third === 96) { + const fourth = nextToken(); + switch (fourth) { + case 64: + case 32: + case 44: + return false; + default: + return true; + } + } else if (third === 28 || third === 64) { + return true; + } + return false; + }); + if (isArrowFunctionInJsx) { + return 1; + } + return 0; + } + return 2; + } + } + function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { + const tokenPos = scanner2.getTokenStart(); + if (notParenthesizedArrow == null ? void 0 : notParenthesizedArrow.has(tokenPos)) { + return void 0; + } + const result2 = parseParenthesizedArrowFunctionExpression( + /*allowAmbiguity*/ + false, + allowReturnTypeInArrowFunction + ); + if (!result2) { + (notParenthesizedArrow || (notParenthesizedArrow = /* @__PURE__ */ new Set())).add(tokenPos); + } + return result2; + } + function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { + if (token() === 134) { + if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const asyncModifier = parseModifiersForArrowFunction(); + const expr = parseBinaryExpressionOrHigher( + 0 + /* Lowest */ + ); + return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier); + } + } + return void 0; + } + function isUnParenthesizedAsyncArrowFunctionWorker() { + if (token() === 134) { + nextToken(); + if (scanner2.hasPrecedingLineBreak() || token() === 39) { + return 0; + } + const expr = parseBinaryExpressionOrHigher( + 0 + /* Lowest */ + ); + if (!scanner2.hasPrecedingLineBreak() && expr.kind === 80 && token() === 39) { + return 1; + } + } + return 0; + } + function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiersForArrowFunction(); + const isAsync2 = some2(modifiers, isAsyncModifier) ? 2 : 0; + const typeParameters = parseTypeParameters(); + let parameters; + if (!parseExpected( + 21 + /* OpenParenToken */ + )) { + if (!allowAmbiguity) { + return void 0; + } + parameters = createMissingList(); + } else { + if (!allowAmbiguity) { + const maybeParameters = parseParametersWorker(isAsync2, allowAmbiguity); + if (!maybeParameters) { + return void 0; + } + parameters = maybeParameters; + } else { + parameters = parseParametersWorker(isAsync2, allowAmbiguity); + } + if (!parseExpected( + 22 + /* CloseParenToken */ + ) && !allowAmbiguity) { + return void 0; + } + } + const hasReturnColon = token() === 59; + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + if (type3 && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type3)) { + return void 0; + } + let unwrappedType = type3; + while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196) { + unwrappedType = unwrappedType.type; + } + const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); + if (!allowAmbiguity && token() !== 39 && (hasJSDocFunctionType || token() !== 19)) { + return void 0; + } + const lastToken = token(); + const equalsGreaterThanToken = parseExpectedToken( + 39 + /* EqualsGreaterThanToken */ + ); + const body = lastToken === 39 || lastToken === 19 ? parseArrowFunctionExpressionBody(some2(modifiers, isAsyncModifier), allowReturnTypeInArrowFunction) : parseIdentifier(); + if (!allowReturnTypeInArrowFunction && hasReturnColon) { + if (token() !== 59) { + return void 0; + } + } + const node = factory2.createArrowFunction(modifiers, typeParameters, parameters, type3, equalsGreaterThanToken, body); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseArrowFunctionExpressionBody(isAsync2, allowReturnTypeInArrowFunction) { + if (token() === 19) { + return parseFunctionBlock( + isAsync2 ? 2 : 0 + /* None */ + ); + } + if (token() !== 27 && token() !== 100 && token() !== 86 && isStartOfStatement() && !isStartOfExpressionStatement()) { + return parseFunctionBlock(16 | (isAsync2 ? 2 : 0)); + } + const savedTopLevel = topLevel; + topLevel = false; + const node = isAsync2 ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)); + topLevel = savedTopLevel; + return node; + } + function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { + const questionToken = parseOptionalToken( + 58 + /* QuestionToken */ + ); + if (!questionToken) { + return leftOperand; + } + let colonToken; + return finishNode( + factory2.createConditionalExpression( + leftOperand, + questionToken, + doOutsideOfContext(disallowInAndDecoratorContext, () => parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + false + )), + colonToken = parseExpectedToken( + 59 + /* ColonToken */ + ), + nodeIsPresent(colonToken) ? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) : createMissingNode( + 80, + /*reportAtCurrentPosition*/ + false, + Diagnostics._0_expected, + tokenToString( + 59 + /* ColonToken */ + ) + ) + ), + pos + ); + } + function parseBinaryExpressionOrHigher(precedence) { + const pos = getNodePos(); + const leftOperand = parseUnaryExpressionOrHigher(); + return parseBinaryExpressionRest(precedence, leftOperand, pos); + } + function isInOrOfKeyword(t8) { + return t8 === 103 || t8 === 165; + } + function parseBinaryExpressionRest(precedence, leftOperand, pos) { + while (true) { + reScanGreaterToken(); + const newPrecedence = getBinaryOperatorPrecedence(token()); + const consumeCurrentOperator = token() === 43 ? newPrecedence >= precedence : newPrecedence > precedence; + if (!consumeCurrentOperator) { + break; + } + if (token() === 103 && inDisallowInContext()) { + break; + } + if (token() === 130 || token() === 152) { + if (scanner2.hasPrecedingLineBreak()) { + break; + } else { + const keywordKind = token(); + nextToken(); + leftOperand = keywordKind === 152 ? makeSatisfiesExpression(leftOperand, parseType()) : makeAsExpression(leftOperand, parseType()); + } + } else { + leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence), pos); + } + } + return leftOperand; + } + function isBinaryOperator2() { + if (inDisallowInContext() && token() === 103) { + return false; + } + return getBinaryOperatorPrecedence(token()) > 0; + } + function makeSatisfiesExpression(left, right) { + return finishNode(factory2.createSatisfiesExpression(left, right), left.pos); + } + function makeBinaryExpression(left, operatorToken, right, pos) { + return finishNode(factory2.createBinaryExpression(left, operatorToken, right), pos); + } + function makeAsExpression(left, right) { + return finishNode(factory2.createAsExpression(left, right), left.pos); + } + function parsePrefixUnaryExpression() { + const pos = getNodePos(); + return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseDeleteExpression() { + const pos = getNodePos(); + return finishNode(factory2.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseTypeOfExpression() { + const pos = getNodePos(); + return finishNode(factory2.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseVoidExpression() { + const pos = getNodePos(); + return finishNode(factory2.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function isAwaitExpression2() { + if (token() === 135) { + if (inAwaitContext()) { + return true; + } + return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); + } + return false; + } + function parseAwaitExpression() { + const pos = getNodePos(); + return finishNode(factory2.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); + } + function parseUnaryExpressionOrHigher() { + if (isUpdateExpression()) { + const pos = getNodePos(); + const updateExpression = parseUpdateExpression(); + return token() === 43 ? parseBinaryExpressionRest(getBinaryOperatorPrecedence(token()), updateExpression, pos) : updateExpression; + } + const unaryOperator = token(); + const simpleUnaryExpression = parseSimpleUnaryExpression(); + if (token() === 43) { + const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); + const { end } = simpleUnaryExpression; + if (simpleUnaryExpression.kind === 216) { + parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); + } else { + Debug.assert(isKeywordOrPunctuation(unaryOperator)); + parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); + } + } + return simpleUnaryExpression; + } + function parseSimpleUnaryExpression() { + switch (token()) { + case 40: + case 41: + case 55: + case 54: + return parsePrefixUnaryExpression(); + case 91: + return parseDeleteExpression(); + case 114: + return parseTypeOfExpression(); + case 116: + return parseVoidExpression(); + case 30: + if (languageVariant === 1) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true, + /*topInvalidNodePosition*/ + void 0, + /*openingTag*/ + void 0, + /*mustBeUnary*/ + true + ); + } + return parseTypeAssertion(); + case 135: + if (isAwaitExpression2()) { + return parseAwaitExpression(); + } + default: + return parseUpdateExpression(); + } + } + function isUpdateExpression() { + switch (token()) { + case 40: + case 41: + case 55: + case 54: + case 91: + case 114: + case 116: + case 135: + return false; + case 30: + if (languageVariant !== 1) { + return false; + } + default: + return true; + } + } + function parseUpdateExpression() { + if (token() === 46 || token() === 47) { + const pos = getNodePos(); + return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseLeftHandSideExpressionOrHigher)), pos); + } else if (languageVariant === 1 && token() === 30 && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } + const expression = parseLeftHandSideExpressionOrHigher(); + Debug.assert(isLeftHandSideExpression(expression)); + if ((token() === 46 || token() === 47) && !scanner2.hasPrecedingLineBreak()) { + const operator = token(); + nextToken(); + return finishNode(factory2.createPostfixUnaryExpression(expression, operator), expression.pos); + } + return expression; + } + function parseLeftHandSideExpressionOrHigher() { + const pos = getNodePos(); + let expression; + if (token() === 102) { + if (lookAhead(nextTokenIsOpenParenOrLessThan)) { + sourceFlags |= 4194304; + expression = parseTokenNode(); + } else if (lookAhead(nextTokenIsDot)) { + nextToken(); + nextToken(); + expression = finishNode(factory2.createMetaProperty(102, parseIdentifierName()), pos); + sourceFlags |= 8388608; + } else { + expression = parseMemberExpressionOrHigher(); + } + } else { + expression = token() === 108 ? parseSuperExpression() : parseMemberExpressionOrHigher(); + } + return parseCallExpressionRest(pos, expression); + } + function parseMemberExpressionOrHigher() { + const pos = getNodePos(); + const expression = parsePrimaryExpression(); + return parseMemberExpressionRest( + pos, + expression, + /*allowOptionalChain*/ + true + ); + } + function parseSuperExpression() { + const pos = getNodePos(); + let expression = parseTokenNode(); + if (token() === 30) { + const startPos = getNodePos(); + const typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments !== void 0) { + parseErrorAt(startPos, getNodePos(), Diagnostics.super_may_not_use_type_arguments); + if (!isTemplateStartOfTaggedTemplate()) { + expression = factory2.createExpressionWithTypeArguments(expression, typeArguments); + } + } + } + if (token() === 21 || token() === 25 || token() === 23) { + return expression; + } + parseExpectedToken(25, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + return finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + true, + /*allowUnicodeEscapeSequenceInIdentifierName*/ + true + )), pos); + } + function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag, mustBeUnary = false) { + const pos = getNodePos(); + const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); + let result2; + if (opening.kind === 286) { + let children = parseJsxChildren(opening); + let closingElement; + const lastChild = children[children.length - 1]; + if ((lastChild == null ? void 0 : lastChild.kind) === 284 && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { + const end = lastChild.children.end; + const newLast = finishNode( + factory2.createJsxElement( + lastChild.openingElement, + lastChild.children, + finishNode(factory2.createJsxClosingElement(finishNode(factoryCreateIdentifier(""), end, end)), end, end) + ), + lastChild.openingElement.pos, + end + ); + children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); + closingElement = lastChild.closingElement; + } else { + closingElement = parseJsxClosingElement(opening, inExpressionContext); + if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { + if (openingTag && isJsxOpeningElement(openingTag) && tagNamesAreEquivalent(closingElement.tagName, openingTag.tagName)) { + parseErrorAtRange(opening.tagName, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, opening.tagName)); + } else { + parseErrorAtRange(closingElement.tagName, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, opening.tagName)); + } + } + } + result2 = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); + } else if (opening.kind === 289) { + result2 = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); + } else { + Debug.assert( + opening.kind === 285 + /* JsxSelfClosingElement */ + ); + result2 = opening; + } + if (!mustBeUnary && inExpressionContext && token() === 30) { + const topBadPos = typeof topInvalidNodePosition === "undefined" ? result2.pos : topInvalidNodePosition; + const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true, + topBadPos + )); + if (invalidElement) { + const operatorToken = createMissingNode( + 28, + /*reportAtCurrentPosition*/ + false + ); + setTextRangePosWidth(operatorToken, invalidElement.pos, 0); + parseErrorAt(skipTrivia(sourceText, topBadPos), invalidElement.end, Diagnostics.JSX_expressions_must_have_one_parent_element); + return finishNode(factory2.createBinaryExpression(result2, operatorToken, invalidElement), pos); + } + } + return result2; + } + function parseJsxText() { + const pos = getNodePos(); + const node = factory2.createJsxText( + scanner2.getTokenValue(), + currentToken === 13 + /* JsxTextAllWhiteSpaces */ + ); + currentToken = scanner2.scanJsxToken(); + return finishNode(node, pos); + } + function parseJsxChild(openingTag, token2) { + switch (token2) { + case 1: + if (isJsxOpeningFragment(openingTag)) { + parseErrorAtRange(openingTag, Diagnostics.JSX_fragment_has_no_corresponding_closing_tag); + } else { + const tag = openingTag.tagName; + const start = Math.min(skipTrivia(sourceText, tag.pos), tag.end); + parseErrorAt(start, tag.end, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTag.tagName)); + } + return void 0; + case 31: + case 7: + return void 0; + case 12: + case 13: + return parseJsxText(); + case 19: + return parseJsxExpression( + /*inExpressionContext*/ + false + ); + case 30: + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + false, + /*topInvalidNodePosition*/ + void 0, + openingTag + ); + default: + return Debug.assertNever(token2); + } + } + function parseJsxChildren(openingTag) { + const list = []; + const listPos = getNodePos(); + const saveParsingContext = parsingContext; + parsingContext |= 1 << 14; + while (true) { + const child = parseJsxChild(openingTag, currentToken = scanner2.reScanJsxToken()); + if (!child) + break; + list.push(child); + if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 284 && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { + break; + } + } + parsingContext = saveParsingContext; + return createNodeArray(list, listPos); + } + function parseJsxAttributes() { + const pos = getNodePos(); + return finishNode(factory2.createJsxAttributes(parseList(13, parseJsxAttribute)), pos); + } + function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { + const pos = getNodePos(); + parseExpected( + 30 + /* LessThanToken */ + ); + if (token() === 32) { + scanJsxText(); + return finishNode(factory2.createJsxOpeningFragment(), pos); + } + const tagName = parseJsxElementName(); + const typeArguments = (contextFlags & 524288) === 0 ? tryParseTypeArguments() : void 0; + const attributes = parseJsxAttributes(); + let node; + if (token() === 32) { + scanJsxText(); + node = factory2.createJsxOpeningElement(tagName, typeArguments, attributes); + } else { + parseExpected( + 44 + /* SlashToken */ + ); + if (parseExpected( + 32, + /*diagnosticMessage*/ + void 0, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext) { + nextToken(); + } else { + scanJsxText(); + } + } + node = factory2.createJsxSelfClosingElement(tagName, typeArguments, attributes); + } + return finishNode(node, pos); + } + function parseJsxElementName() { + const pos = getNodePos(); + const initialExpression = parseJsxTagName(); + if (isJsxNamespacedName(initialExpression)) { + return initialExpression; + } + let expression = initialExpression; + while (parseOptional( + 25 + /* DotToken */ + )) { + expression = finishNode(factoryCreatePropertyAccessExpression(expression, parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + false, + /*allowUnicodeEscapeSequenceInIdentifierName*/ + false + )), pos); + } + return expression; + } + function parseJsxTagName() { + const pos = getNodePos(); + scanJsxIdentifier(); + const isThis2 = token() === 110; + const tagName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); + if (parseOptional( + 59 + /* ColonToken */ + )) { + scanJsxIdentifier(); + return finishNode(factory2.createJsxNamespacedName(tagName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); + } + return isThis2 ? finishNode(factory2.createToken( + 110 + /* ThisKeyword */ + ), pos) : tagName; + } + function parseJsxExpression(inExpressionContext) { + const pos = getNodePos(); + if (!parseExpected( + 19 + /* OpenBraceToken */ + )) { + return void 0; + } + let dotDotDotToken; + let expression; + if (token() !== 20) { + if (!inExpressionContext) { + dotDotDotToken = parseOptionalToken( + 26 + /* DotDotDotToken */ + ); + } + expression = parseExpression(); + } + if (inExpressionContext) { + parseExpected( + 20 + /* CloseBraceToken */ + ); + } else { + if (parseExpected( + 20, + /*diagnosticMessage*/ + void 0, + /*shouldAdvance*/ + false + )) { + scanJsxText(); + } + } + return finishNode(factory2.createJsxExpression(dotDotDotToken, expression), pos); + } + function parseJsxAttribute() { + if (token() === 19) { + return parseJsxSpreadAttribute(); + } + const pos = getNodePos(); + return finishNode(factory2.createJsxAttribute(parseJsxAttributeName(), parseJsxAttributeValue()), pos); + } + function parseJsxAttributeValue() { + if (token() === 64) { + if (scanJsxAttributeValue() === 11) { + return parseLiteralNode(); + } + if (token() === 19) { + return parseJsxExpression( + /*inExpressionContext*/ + true + ); + } + if (token() === 30) { + return parseJsxElementOrSelfClosingElementOrFragment( + /*inExpressionContext*/ + true + ); + } + parseErrorAtCurrentToken(Diagnostics.or_JSX_element_expected); + } + return void 0; + } + function parseJsxAttributeName() { + const pos = getNodePos(); + scanJsxIdentifier(); + const attrName = parseIdentifierNameErrorOnUnicodeEscapeSequence(); + if (parseOptional( + 59 + /* ColonToken */ + )) { + scanJsxIdentifier(); + return finishNode(factory2.createJsxNamespacedName(attrName, parseIdentifierNameErrorOnUnicodeEscapeSequence()), pos); + } + return attrName; + } + function parseJsxSpreadAttribute() { + const pos = getNodePos(); + parseExpected( + 19 + /* OpenBraceToken */ + ); + parseExpected( + 26 + /* DotDotDotToken */ + ); + const expression = parseExpression(); + parseExpected( + 20 + /* CloseBraceToken */ + ); + return finishNode(factory2.createJsxSpreadAttribute(expression), pos); + } + function parseJsxClosingElement(open2, inExpressionContext) { + const pos = getNodePos(); + parseExpected( + 31 + /* LessThanSlashToken */ + ); + const tagName = parseJsxElementName(); + if (parseExpected( + 32, + /*diagnosticMessage*/ + void 0, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext || !tagNamesAreEquivalent(open2.tagName, tagName)) { + nextToken(); + } else { + scanJsxText(); + } + } + return finishNode(factory2.createJsxClosingElement(tagName), pos); + } + function parseJsxClosingFragment(inExpressionContext) { + const pos = getNodePos(); + parseExpected( + 31 + /* LessThanSlashToken */ + ); + if (parseExpected( + 32, + Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment, + /*shouldAdvance*/ + false + )) { + if (inExpressionContext) { + nextToken(); + } else { + scanJsxText(); + } + } + return finishNode(factory2.createJsxJsxClosingFragment(), pos); + } + function parseTypeAssertion() { + Debug.assert(languageVariant !== 1, "Type assertions should never be parsed in JSX; they should be parsed as comparisons or JSX elements/fragments."); + const pos = getNodePos(); + parseExpected( + 30 + /* LessThanToken */ + ); + const type3 = parseType(); + parseExpected( + 32 + /* GreaterThanToken */ + ); + const expression = parseSimpleUnaryExpression(); + return finishNode(factory2.createTypeAssertion(type3, expression), pos); + } + function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate() { + nextToken(); + return tokenIsIdentifierOrKeyword(token()) || token() === 23 || isTemplateStartOfTaggedTemplate(); + } + function isStartOfOptionalPropertyOrElementAccessChain() { + return token() === 29 && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); + } + function tryReparseOptionalChain(node) { + if (node.flags & 64) { + return true; + } + if (isNonNullExpression(node)) { + let expr = node.expression; + while (isNonNullExpression(expr) && !(expr.flags & 64)) { + expr = expr.expression; + } + if (expr.flags & 64) { + while (isNonNullExpression(node)) { + node.flags |= 64; + node = node.expression; + } + return true; + } + } + return false; + } + function parsePropertyAccessExpressionRest(pos, expression, questionDotToken) { + const name2 = parseRightSideOfDot( + /*allowIdentifierNames*/ + true, + /*allowPrivateIdentifiers*/ + true, + /*allowUnicodeEscapeSequenceInIdentifierName*/ + true + ); + const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); + const propertyAccess = isOptionalChain2 ? factoryCreatePropertyAccessChain(expression, questionDotToken, name2) : factoryCreatePropertyAccessExpression(expression, name2); + if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { + parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); + } + if (isExpressionWithTypeArguments(expression) && expression.typeArguments) { + const pos2 = expression.typeArguments.pos - 1; + const end = skipTrivia(sourceText, expression.typeArguments.end) + 1; + parseErrorAt(pos2, end, Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access); + } + return finishNode(propertyAccess, pos); + } + function parseElementAccessExpressionRest(pos, expression, questionDotToken) { + let argumentExpression; + if (token() === 24) { + argumentExpression = createMissingNode( + 80, + /*reportAtCurrentPosition*/ + true, + Diagnostics.An_element_access_expression_should_take_an_argument + ); + } else { + const argument = allowInAnd(parseExpression); + if (isStringOrNumericLiteralLike(argument)) { + argument.text = internIdentifier(argument.text); + } + argumentExpression = argument; + } + parseExpected( + 24 + /* CloseBracketToken */ + ); + const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateElementAccessChain(expression, questionDotToken, argumentExpression) : factoryCreateElementAccessExpression(expression, argumentExpression); + return finishNode(indexedAccess, pos); + } + function parseMemberExpressionRest(pos, expression, allowOptionalChain) { + while (true) { + let questionDotToken; + let isPropertyAccess = false; + if (allowOptionalChain && isStartOfOptionalPropertyOrElementAccessChain()) { + questionDotToken = parseExpectedToken( + 29 + /* QuestionDotToken */ + ); + isPropertyAccess = tokenIsIdentifierOrKeyword(token()); + } else { + isPropertyAccess = parseOptional( + 25 + /* DotToken */ + ); + } + if (isPropertyAccess) { + expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken); + continue; + } + if ((questionDotToken || !inDecoratorContext()) && parseOptional( + 23 + /* OpenBracketToken */ + )) { + expression = parseElementAccessExpressionRest(pos, expression, questionDotToken); + continue; + } + if (isTemplateStartOfTaggedTemplate()) { + expression = !questionDotToken && expression.kind === 233 ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest( + pos, + expression, + questionDotToken, + /*typeArguments*/ + void 0 + ); + continue; + } + if (!questionDotToken) { + if (token() === 54 && !scanner2.hasPrecedingLineBreak()) { + nextToken(); + expression = finishNode(factory2.createNonNullExpression(expression), pos); + continue; + } + const typeArguments = tryParse(parseTypeArgumentsInExpression); + if (typeArguments) { + expression = finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); + continue; + } + } + return expression; + } + } + function isTemplateStartOfTaggedTemplate() { + return token() === 15 || token() === 16; + } + function parseTaggedTemplateRest(pos, tag, questionDotToken, typeArguments) { + const tagExpression = factory2.createTaggedTemplateExpression( + tag, + typeArguments, + token() === 15 ? (reScanTemplateToken( + /*isTaggedTemplate*/ + true + ), parseLiteralNode()) : parseTemplateExpression( + /*isTaggedTemplate*/ + true + ) + ); + if (questionDotToken || tag.flags & 64) { + tagExpression.flags |= 64; + } + tagExpression.questionDotToken = questionDotToken; + return finishNode(tagExpression, pos); + } + function parseCallExpressionRest(pos, expression) { + while (true) { + expression = parseMemberExpressionRest( + pos, + expression, + /*allowOptionalChain*/ + true + ); + let typeArguments; + const questionDotToken = parseOptionalToken( + 29 + /* QuestionDotToken */ + ); + if (questionDotToken) { + typeArguments = tryParse(parseTypeArgumentsInExpression); + if (isTemplateStartOfTaggedTemplate()) { + expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments); + continue; + } + } + if (typeArguments || token() === 21) { + if (!questionDotToken && expression.kind === 233) { + typeArguments = expression.typeArguments; + expression = expression.expression; + } + const argumentList = parseArgumentList(); + const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factoryCreateCallChain(expression, questionDotToken, typeArguments, argumentList) : factoryCreateCallExpression(expression, typeArguments, argumentList); + expression = finishNode(callExpr, pos); + continue; + } + if (questionDotToken) { + const name2 = createMissingNode( + 80, + /*reportAtCurrentPosition*/ + false, + Diagnostics.Identifier_expected + ); + expression = finishNode(factoryCreatePropertyAccessChain(expression, questionDotToken, name2), pos); + } + break; + } + return expression; + } + function parseArgumentList() { + parseExpected( + 21 + /* OpenParenToken */ + ); + const result2 = parseDelimitedList(11, parseArgumentExpression); + parseExpected( + 22 + /* CloseParenToken */ + ); + return result2; + } + function parseTypeArgumentsInExpression() { + if ((contextFlags & 524288) !== 0) { + return void 0; + } + if (reScanLessThanToken() !== 30) { + return void 0; + } + nextToken(); + const typeArguments = parseDelimitedList(20, parseType); + if (reScanGreaterToken() !== 32) { + return void 0; + } + nextToken(); + return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : void 0; + } + function canFollowTypeArgumentsInExpression() { + switch (token()) { + case 21: + case 15: + case 16: + return true; + case 30: + case 32: + case 40: + case 41: + return false; + } + return scanner2.hasPrecedingLineBreak() || isBinaryOperator2() || !isStartOfExpression(); + } + function parsePrimaryExpression() { + switch (token()) { + case 15: + if (scanner2.getTokenFlags() & 26656) { + reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + } + case 9: + case 10: + case 11: + return parseLiteralNode(); + case 110: + case 108: + case 106: + case 112: + case 97: + return parseTokenNode(); + case 21: + return parseParenthesizedExpression(); + case 23: + return parseArrayLiteralExpression(); + case 19: + return parseObjectLiteralExpression(); + case 134: + if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) { + break; + } + return parseFunctionExpression(); + case 60: + return parseDecoratedExpression(); + case 86: + return parseClassExpression(); + case 100: + return parseFunctionExpression(); + case 105: + return parseNewExpressionOrNewDotTarget(); + case 44: + case 69: + if (reScanSlashToken() === 14) { + return parseLiteralNode(); + } + break; + case 16: + return parseTemplateExpression( + /*isTaggedTemplate*/ + false + ); + case 81: + return parsePrivateIdentifier(); + } + return parseIdentifier(Diagnostics.Expression_expected); + } + function parseParenthesizedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpected( + 22 + /* CloseParenToken */ + ); + return withJSDoc(finishNode(factoryCreateParenthesizedExpression(expression), pos), hasJSDoc); + } + function parseSpreadElement() { + const pos = getNodePos(); + parseExpected( + 26 + /* DotDotDotToken */ + ); + const expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return finishNode(factory2.createSpreadElement(expression), pos); + } + function parseArgumentOrArrayLiteralElement() { + return token() === 26 ? parseSpreadElement() : token() === 28 ? finishNode(factory2.createOmittedExpression(), getNodePos()) : parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + } + function parseArgumentExpression() { + return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); + } + function parseArrayLiteralExpression() { + const pos = getNodePos(); + const openBracketPosition = scanner2.getTokenStart(); + const openBracketParsed = parseExpected( + 23 + /* OpenBracketToken */ + ); + const multiLine = scanner2.hasPrecedingLineBreak(); + const elements = parseDelimitedList(15, parseArgumentOrArrayLiteralElement); + parseExpectedMatchingBrackets(23, 24, openBracketParsed, openBracketPosition); + return finishNode(factoryCreateArrayLiteralExpression(elements, multiLine), pos); + } + function parseObjectLiteralElement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + if (parseOptionalToken( + 26 + /* DotDotDotToken */ + )) { + const expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); + } + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (parseContextualModifier( + 139 + /* GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 177, + 0 + /* None */ + ); + } + if (parseContextualModifier( + 153 + /* SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 178, + 0 + /* None */ + ); + } + const asteriskToken = parseOptionalToken( + 42 + /* AsteriskToken */ + ); + const tokenIsIdentifier = isIdentifier2(); + const name2 = parsePropertyName(); + const questionToken = parseOptionalToken( + 58 + /* QuestionToken */ + ); + const exclamationToken = parseOptionalToken( + 54 + /* ExclamationToken */ + ); + if (asteriskToken || token() === 21 || token() === 30) { + return parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name2, questionToken, exclamationToken); + } + let node; + const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 59; + if (isShorthandPropertyAssignment2) { + const equalsToken = parseOptionalToken( + 64 + /* EqualsToken */ + ); + const objectAssignmentInitializer = equalsToken ? allowInAnd(() => parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + )) : void 0; + node = factory2.createShorthandPropertyAssignment(name2, objectAssignmentInitializer); + node.equalsToken = equalsToken; + } else { + parseExpected( + 59 + /* ColonToken */ + ); + const initializer = allowInAnd(() => parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + )); + node = factory2.createPropertyAssignment(name2, initializer); + } + node.modifiers = modifiers; + node.questionToken = questionToken; + node.exclamationToken = exclamationToken; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseObjectLiteralExpression() { + const pos = getNodePos(); + const openBracePosition = scanner2.getTokenStart(); + const openBraceParsed = parseExpected( + 19 + /* OpenBraceToken */ + ); + const multiLine = scanner2.hasPrecedingLineBreak(); + const properties = parseDelimitedList( + 12, + parseObjectLiteralElement, + /*considerSemicolonAsDelimiter*/ + true + ); + parseExpectedMatchingBrackets(19, 20, openBraceParsed, openBracePosition); + return finishNode(factoryCreateObjectLiteralExpression(properties, multiLine), pos); + } + function parseFunctionExpression() { + const savedDecoratorContext = inDecoratorContext(); + setDecoratorContext( + /*val*/ + false + ); + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + false + ); + parseExpected( + 100 + /* FunctionKeyword */ + ); + const asteriskToken = parseOptionalToken( + 42 + /* AsteriskToken */ + ); + const isGenerator = asteriskToken ? 1 : 0; + const isAsync2 = some2(modifiers, isAsyncModifier) ? 2 : 0; + const name2 = isGenerator && isAsync2 ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) : isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) : isAsync2 ? doInAwaitContext(parseOptionalBindingIdentifier) : parseOptionalBindingIdentifier(); + const typeParameters = parseTypeParameters(); + const parameters = parseParameters(isGenerator | isAsync2); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + const body = parseFunctionBlock(isGenerator | isAsync2); + setDecoratorContext(savedDecoratorContext); + const node = factory2.createFunctionExpression(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseOptionalBindingIdentifier() { + return isBindingIdentifier() ? parseBindingIdentifier() : void 0; + } + function parseNewExpressionOrNewDotTarget() { + const pos = getNodePos(); + parseExpected( + 105 + /* NewKeyword */ + ); + if (parseOptional( + 25 + /* DotToken */ + )) { + const name2 = parseIdentifierName(); + return finishNode(factory2.createMetaProperty(105, name2), pos); + } + const expressionPos = getNodePos(); + let expression = parseMemberExpressionRest( + expressionPos, + parsePrimaryExpression(), + /*allowOptionalChain*/ + false + ); + let typeArguments; + if (expression.kind === 233) { + typeArguments = expression.typeArguments; + expression = expression.expression; + } + if (token() === 29) { + parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); + } + const argumentList = token() === 21 ? parseArgumentList() : void 0; + return finishNode(factoryCreateNewExpression(expression, typeArguments, argumentList), pos); + } + function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const openBracePosition = scanner2.getTokenStart(); + const openBraceParsed = parseExpected(19, diagnosticMessage); + if (openBraceParsed || ignoreMissingOpenBrace) { + const multiLine = scanner2.hasPrecedingLineBreak(); + const statements = parseList(1, parseStatement); + parseExpectedMatchingBrackets(19, 20, openBraceParsed, openBracePosition); + const result2 = withJSDoc(finishNode(factoryCreateBlock(statements, multiLine), pos), hasJSDoc); + if (token() === 64) { + parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_whole_assignment_in_parentheses); + nextToken(); + } + return result2; + } else { + const statements = createMissingList(); + return withJSDoc(finishNode(factoryCreateBlock( + statements, + /*multiLine*/ + void 0 + ), pos), hasJSDoc); + } + } + function parseFunctionBlock(flags, diagnosticMessage) { + const savedYieldContext = inYieldContext(); + setYieldContext(!!(flags & 1)); + const savedAwaitContext = inAwaitContext(); + setAwaitContext(!!(flags & 2)); + const savedTopLevel = topLevel; + topLevel = false; + const saveDecoratorContext = inDecoratorContext(); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + false + ); + } + const block = parseBlock(!!(flags & 16), diagnosticMessage); + if (saveDecoratorContext) { + setDecoratorContext( + /*val*/ + true + ); + } + topLevel = savedTopLevel; + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return block; + } + function parseEmptyStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 27 + /* SemicolonToken */ + ); + return withJSDoc(finishNode(factory2.createEmptyStatement(), pos), hasJSDoc); + } + function parseIfStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 101 + /* IfKeyword */ + ); + const openParenPosition = scanner2.getTokenStart(); + const openParenParsed = parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(21, 22, openParenParsed, openParenPosition); + const thenStatement = parseStatement(); + const elseStatement = parseOptional( + 93 + /* ElseKeyword */ + ) ? parseStatement() : void 0; + return withJSDoc(finishNode(factoryCreateIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); + } + function parseDoStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 92 + /* DoKeyword */ + ); + const statement = parseStatement(); + parseExpected( + 117 + /* WhileKeyword */ + ); + const openParenPosition = scanner2.getTokenStart(); + const openParenParsed = parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(21, 22, openParenParsed, openParenPosition); + parseOptional( + 27 + /* SemicolonToken */ + ); + return withJSDoc(finishNode(factory2.createDoStatement(statement, expression), pos), hasJSDoc); + } + function parseWhileStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 117 + /* WhileKeyword */ + ); + const openParenPosition = scanner2.getTokenStart(); + const openParenParsed = parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(21, 22, openParenParsed, openParenPosition); + const statement = parseStatement(); + return withJSDoc(finishNode(factoryCreateWhileStatement(expression, statement), pos), hasJSDoc); + } + function parseForOrForInOrForOfStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 99 + /* ForKeyword */ + ); + const awaitToken = parseOptionalToken( + 135 + /* AwaitKeyword */ + ); + parseExpected( + 21 + /* OpenParenToken */ + ); + let initializer; + if (token() !== 27) { + if (token() === 115 || token() === 121 || token() === 87 || token() === 160 && lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf) || // this one is meant to allow of + token() === 135 && lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine)) { + initializer = parseVariableDeclarationList( + /*inForStatementInitializer*/ + true + ); + } else { + initializer = disallowInAnd(parseExpression); + } + } + let node; + if (awaitToken ? parseExpected( + 165 + /* OfKeyword */ + ) : parseOptional( + 165 + /* OfKeyword */ + )) { + const expression = allowInAnd(() => parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + )); + parseExpected( + 22 + /* CloseParenToken */ + ); + node = factoryCreateForOfStatement(awaitToken, initializer, expression, parseStatement()); + } else if (parseOptional( + 103 + /* InKeyword */ + )) { + const expression = allowInAnd(parseExpression); + parseExpected( + 22 + /* CloseParenToken */ + ); + node = factory2.createForInStatement(initializer, expression, parseStatement()); + } else { + parseExpected( + 27 + /* SemicolonToken */ + ); + const condition = token() !== 27 && token() !== 22 ? allowInAnd(parseExpression) : void 0; + parseExpected( + 27 + /* SemicolonToken */ + ); + const incrementor = token() !== 22 ? allowInAnd(parseExpression) : void 0; + parseExpected( + 22 + /* CloseParenToken */ + ); + node = factoryCreateForStatement(initializer, condition, incrementor, parseStatement()); + } + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseBreakOrContinueStatement(kind) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + kind === 252 ? 83 : 88 + /* ContinueKeyword */ + ); + const label = canParseSemicolon() ? void 0 : parseIdentifier(); + parseSemicolon(); + const node = kind === 252 ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseReturnStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 107 + /* ReturnKeyword */ + ); + const expression = canParseSemicolon() ? void 0 : allowInAnd(parseExpression); + parseSemicolon(); + return withJSDoc(finishNode(factory2.createReturnStatement(expression), pos), hasJSDoc); + } + function parseWithStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 118 + /* WithKeyword */ + ); + const openParenPosition = scanner2.getTokenStart(); + const openParenParsed = parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpectedMatchingBrackets(21, 22, openParenParsed, openParenPosition); + const statement = doInsideOfContext(67108864, parseStatement); + return withJSDoc(finishNode(factory2.createWithStatement(expression, statement), pos), hasJSDoc); + } + function parseCaseClause() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 84 + /* CaseKeyword */ + ); + const expression = allowInAnd(parseExpression); + parseExpected( + 59 + /* ColonToken */ + ); + const statements = parseList(3, parseStatement); + return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); + } + function parseDefaultClause() { + const pos = getNodePos(); + parseExpected( + 90 + /* DefaultKeyword */ + ); + parseExpected( + 59 + /* ColonToken */ + ); + const statements = parseList(3, parseStatement); + return finishNode(factory2.createDefaultClause(statements), pos); + } + function parseCaseOrDefaultClause() { + return token() === 84 ? parseCaseClause() : parseDefaultClause(); + } + function parseCaseBlock() { + const pos = getNodePos(); + parseExpected( + 19 + /* OpenBraceToken */ + ); + const clauses = parseList(2, parseCaseOrDefaultClause); + parseExpected( + 20 + /* CloseBraceToken */ + ); + return finishNode(factory2.createCaseBlock(clauses), pos); + } + function parseSwitchStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 109 + /* SwitchKeyword */ + ); + parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = allowInAnd(parseExpression); + parseExpected( + 22 + /* CloseParenToken */ + ); + const caseBlock = parseCaseBlock(); + return withJSDoc(finishNode(factory2.createSwitchStatement(expression, caseBlock), pos), hasJSDoc); + } + function parseThrowStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 111 + /* ThrowKeyword */ + ); + let expression = scanner2.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); + if (expression === void 0) { + identifierCount++; + expression = finishNode(factoryCreateIdentifier(""), getNodePos()); + } + if (!tryParseSemicolon()) { + parseErrorForMissingSemicolonAfter(expression); + } + return withJSDoc(finishNode(factory2.createThrowStatement(expression), pos), hasJSDoc); + } + function parseTryStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 113 + /* TryKeyword */ + ); + const tryBlock = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + const catchClause = token() === 85 ? parseCatchClause() : void 0; + let finallyBlock; + if (!catchClause || token() === 98) { + parseExpected(98, Diagnostics.catch_or_finally_expected); + finallyBlock = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + } + return withJSDoc(finishNode(factory2.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc); + } + function parseCatchClause() { + const pos = getNodePos(); + parseExpected( + 85 + /* CatchKeyword */ + ); + let variableDeclaration; + if (parseOptional( + 21 + /* OpenParenToken */ + )) { + variableDeclaration = parseVariableDeclaration(); + parseExpected( + 22 + /* CloseParenToken */ + ); + } else { + variableDeclaration = void 0; + } + const block = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + return finishNode(factory2.createCatchClause(variableDeclaration, block), pos); + } + function parseDebuggerStatement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + parseExpected( + 89 + /* DebuggerKeyword */ + ); + parseSemicolon(); + return withJSDoc(finishNode(factory2.createDebuggerStatement(), pos), hasJSDoc); + } + function parseExpressionOrLabeledStatement() { + const pos = getNodePos(); + let hasJSDoc = hasPrecedingJSDocComment(); + let node; + const hasParen = token() === 21; + const expression = allowInAnd(parseExpression); + if (isIdentifier(expression) && parseOptional( + 59 + /* ColonToken */ + )) { + node = factory2.createLabeledStatement(expression, parseStatement()); + } else { + if (!tryParseSemicolon()) { + parseErrorForMissingSemicolonAfter(expression); + } + node = factoryCreateExpressionStatement(expression); + if (hasParen) { + hasJSDoc = false; + } + } + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function nextTokenIsIdentifierOrKeywordOnSameLine() { + nextToken(); + return tokenIsIdentifierOrKeyword(token()) && !scanner2.hasPrecedingLineBreak(); + } + function nextTokenIsClassKeywordOnSameLine() { + nextToken(); + return token() === 86 && !scanner2.hasPrecedingLineBreak(); + } + function nextTokenIsFunctionKeywordOnSameLine() { + nextToken(); + return token() === 100 && !scanner2.hasPrecedingLineBreak(); + } + function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() { + nextToken(); + return (tokenIsIdentifierOrKeyword(token()) || token() === 9 || token() === 10 || token() === 11) && !scanner2.hasPrecedingLineBreak(); + } + function isDeclaration2() { + while (true) { + switch (token()) { + case 115: + case 121: + case 87: + case 100: + case 86: + case 94: + return true; + case 160: + return isUsingDeclaration(); + case 135: + return isAwaitUsingDeclaration(); + case 120: + case 156: + return nextTokenIsIdentifierOnSameLine(); + case 144: + case 145: + return nextTokenIsIdentifierOrStringLiteralOnSameLine(); + case 128: + case 129: + case 134: + case 138: + case 123: + case 124: + case 125: + case 148: + const previousToken = token(); + nextToken(); + if (scanner2.hasPrecedingLineBreak()) { + return false; + } + if (previousToken === 138 && token() === 156) { + return true; + } + continue; + case 162: + nextToken(); + return token() === 19 || token() === 80 || token() === 95; + case 102: + nextToken(); + return token() === 11 || token() === 42 || token() === 19 || tokenIsIdentifierOrKeyword(token()); + case 95: + let currentToken2 = nextToken(); + if (currentToken2 === 156) { + currentToken2 = lookAhead(nextToken); + } + if (currentToken2 === 64 || currentToken2 === 42 || currentToken2 === 19 || currentToken2 === 90 || currentToken2 === 130 || currentToken2 === 60) { + return true; + } + continue; + case 126: + nextToken(); + continue; + default: + return false; + } + } + } + function isStartOfDeclaration() { + return lookAhead(isDeclaration2); + } + function isStartOfStatement() { + switch (token()) { + case 60: + case 27: + case 19: + case 115: + case 121: + case 160: + case 100: + case 86: + case 94: + case 101: + case 92: + case 117: + case 99: + case 88: + case 83: + case 107: + case 118: + case 109: + case 111: + case 113: + case 89: + case 85: + case 98: + return true; + case 102: + return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot); + case 87: + case 95: + return isStartOfDeclaration(); + case 134: + case 138: + case 120: + case 144: + case 145: + case 156: + case 162: + return true; + case 129: + case 125: + case 123: + case 124: + case 126: + case 148: + return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); + default: + return isStartOfExpression(); + } + } + function nextTokenIsBindingIdentifierOrStartOfDestructuring() { + nextToken(); + return isBindingIdentifier() || token() === 19 || token() === 23; + } + function isLetDeclaration() { + return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring); + } + function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLineDisallowOf() { + return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine( + /*disallowOf*/ + true + ); + } + function nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf) { + nextToken(); + if (disallowOf && token() === 165) + return false; + return (isBindingIdentifier() || token() === 19) && !scanner2.hasPrecedingLineBreak(); + } + function isUsingDeclaration() { + return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine); + } + function nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine(disallowOf) { + if (nextToken() === 160) { + return nextTokenIsBindingIdentifierOrStartOfDestructuringOnSameLine(disallowOf); + } + return false; + } + function isAwaitUsingDeclaration() { + return lookAhead(nextTokenIsUsingKeywordThenBindingIdentifierOrStartOfObjectDestructuringOnSameLine); + } + function parseStatement() { + switch (token()) { + case 27: + return parseEmptyStatement(); + case 19: + return parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + case 115: + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + case 121: + if (isLetDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + } + break; + case 135: + if (isAwaitUsingDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + } + break; + case 160: + if (isUsingDeclaration()) { + return parseVariableStatement( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + } + break; + case 100: + return parseFunctionDeclaration( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + case 86: + return parseClassDeclaration( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0 + ); + case 101: + return parseIfStatement(); + case 92: + return parseDoStatement(); + case 117: + return parseWhileStatement(); + case 99: + return parseForOrForInOrForOfStatement(); + case 88: + return parseBreakOrContinueStatement( + 251 + /* ContinueStatement */ + ); + case 83: + return parseBreakOrContinueStatement( + 252 + /* BreakStatement */ + ); + case 107: + return parseReturnStatement(); + case 118: + return parseWithStatement(); + case 109: + return parseSwitchStatement(); + case 111: + return parseThrowStatement(); + case 113: + case 85: + case 98: + return parseTryStatement(); + case 89: + return parseDebuggerStatement(); + case 60: + return parseDeclaration(); + case 134: + case 120: + case 156: + case 144: + case 145: + case 138: + case 87: + case 94: + case 95: + case 102: + case 123: + case 124: + case 125: + case 128: + case 129: + case 126: + case 148: + case 162: + if (isStartOfDeclaration()) { + return parseDeclaration(); + } + break; + } + return parseExpressionOrLabeledStatement(); + } + function isDeclareModifier(modifier) { + return modifier.kind === 138; + } + function parseDeclaration() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + const isAmbient = some2(modifiers, isDeclareModifier); + if (isAmbient) { + const node = tryReuseAmbientDeclaration(pos); + if (node) { + return node; + } + for (const m7 of modifiers) { + m7.flags |= 33554432; + } + return doInsideOfContext(33554432, () => parseDeclarationWorker(pos, hasJSDoc, modifiers)); + } else { + return parseDeclarationWorker(pos, hasJSDoc, modifiers); + } + } + function tryReuseAmbientDeclaration(pos) { + return doInsideOfContext(33554432, () => { + const node = currentNode(parsingContext, pos); + if (node) { + return consumeNode(node); + } + }); + } + function parseDeclarationWorker(pos, hasJSDoc, modifiersIn) { + switch (token()) { + case 115: + case 121: + case 87: + case 160: + case 135: + return parseVariableStatement(pos, hasJSDoc, modifiersIn); + case 100: + return parseFunctionDeclaration(pos, hasJSDoc, modifiersIn); + case 86: + return parseClassDeclaration(pos, hasJSDoc, modifiersIn); + case 120: + return parseInterfaceDeclaration(pos, hasJSDoc, modifiersIn); + case 156: + return parseTypeAliasDeclaration(pos, hasJSDoc, modifiersIn); + case 94: + return parseEnumDeclaration(pos, hasJSDoc, modifiersIn); + case 162: + case 144: + case 145: + return parseModuleDeclaration(pos, hasJSDoc, modifiersIn); + case 102: + return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiersIn); + case 95: + nextToken(); + switch (token()) { + case 90: + case 64: + return parseExportAssignment(pos, hasJSDoc, modifiersIn); + case 130: + return parseNamespaceExportDeclaration(pos, hasJSDoc, modifiersIn); + default: + return parseExportDeclaration(pos, hasJSDoc, modifiersIn); + } + default: + if (modifiersIn) { + const missing = createMissingNode( + 282, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Declaration_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiersIn; + return missing; + } + return void 0; + } + } + function nextTokenIsStringLiteral() { + return nextToken() === 11; + } + function nextTokenIsFromKeywordOrEqualsToken() { + nextToken(); + return token() === 161 || token() === 64; + } + function nextTokenIsIdentifierOrStringLiteralOnSameLine() { + nextToken(); + return !scanner2.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11); + } + function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) { + if (token() !== 19) { + if (flags & 4) { + parseTypeMemberSemicolon(); + return; + } + if (canParseSemicolon()) { + parseSemicolon(); + return; + } + } + return parseFunctionBlock(flags, diagnosticMessage); + } + function parseArrayBindingElement() { + const pos = getNodePos(); + if (token() === 28) { + return finishNode(factory2.createOmittedExpression(), pos); + } + const dotDotDotToken = parseOptionalToken( + 26 + /* DotDotDotToken */ + ); + const name2 = parseIdentifierOrPattern(); + const initializer = parseInitializer(); + return finishNode(factory2.createBindingElement( + dotDotDotToken, + /*propertyName*/ + void 0, + name2, + initializer + ), pos); + } + function parseObjectBindingElement() { + const pos = getNodePos(); + const dotDotDotToken = parseOptionalToken( + 26 + /* DotDotDotToken */ + ); + const tokenIsIdentifier = isBindingIdentifier(); + let propertyName = parsePropertyName(); + let name2; + if (tokenIsIdentifier && token() !== 59) { + name2 = propertyName; + propertyName = void 0; + } else { + parseExpected( + 59 + /* ColonToken */ + ); + name2 = parseIdentifierOrPattern(); + } + const initializer = parseInitializer(); + return finishNode(factory2.createBindingElement(dotDotDotToken, propertyName, name2, initializer), pos); + } + function parseObjectBindingPattern() { + const pos = getNodePos(); + parseExpected( + 19 + /* OpenBraceToken */ + ); + const elements = allowInAnd(() => parseDelimitedList(9, parseObjectBindingElement)); + parseExpected( + 20 + /* CloseBraceToken */ + ); + return finishNode(factory2.createObjectBindingPattern(elements), pos); + } + function parseArrayBindingPattern() { + const pos = getNodePos(); + parseExpected( + 23 + /* OpenBracketToken */ + ); + const elements = allowInAnd(() => parseDelimitedList(10, parseArrayBindingElement)); + parseExpected( + 24 + /* CloseBracketToken */ + ); + return finishNode(factory2.createArrayBindingPattern(elements), pos); + } + function isBindingIdentifierOrPrivateIdentifierOrPattern() { + return token() === 19 || token() === 23 || token() === 81 || isBindingIdentifier(); + } + function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) { + if (token() === 23) { + return parseArrayBindingPattern(); + } + if (token() === 19) { + return parseObjectBindingPattern(); + } + return parseBindingIdentifier(privateIdentifierDiagnosticMessage); + } + function parseVariableDeclarationAllowExclamation() { + return parseVariableDeclaration( + /*allowExclamation*/ + true + ); + } + function parseVariableDeclaration(allowExclamation) { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const name2 = parseIdentifierOrPattern(Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); + let exclamationToken; + if (allowExclamation && name2.kind === 80 && token() === 54 && !scanner2.hasPrecedingLineBreak()) { + exclamationToken = parseTokenNode(); + } + const type3 = parseTypeAnnotation(); + const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); + const node = factoryCreateVariableDeclaration(name2, exclamationToken, type3, initializer); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseVariableDeclarationList(inForStatementInitializer) { + const pos = getNodePos(); + let flags = 0; + switch (token()) { + case 115: + break; + case 121: + flags |= 1; + break; + case 87: + flags |= 2; + break; + case 160: + flags |= 4; + break; + case 135: + Debug.assert(isAwaitUsingDeclaration()); + flags |= 6; + nextToken(); + break; + default: + Debug.fail(); + } + nextToken(); + let declarations; + if (token() === 165 && lookAhead(canFollowContextualOfKeyword)) { + declarations = createMissingList(); + } else { + const savedDisallowIn = inDisallowInContext(); + setDisallowInContext(inForStatementInitializer); + declarations = parseDelimitedList( + 8, + inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation + ); + setDisallowInContext(savedDisallowIn); + } + return finishNode(factoryCreateVariableDeclarationList(declarations, flags), pos); + } + function canFollowContextualOfKeyword() { + return nextTokenIsIdentifier() && nextToken() === 22; + } + function parseVariableStatement(pos, hasJSDoc, modifiers) { + const declarationList = parseVariableDeclarationList( + /*inForStatementInitializer*/ + false + ); + parseSemicolon(); + const node = factoryCreateVariableStatement(modifiers, declarationList); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseFunctionDeclaration(pos, hasJSDoc, modifiers) { + const savedAwaitContext = inAwaitContext(); + const modifierFlags = modifiersToFlags(modifiers); + parseExpected( + 100 + /* FunctionKeyword */ + ); + const asteriskToken = parseOptionalToken( + 42 + /* AsteriskToken */ + ); + const name2 = modifierFlags & 2048 ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); + const isGenerator = asteriskToken ? 1 : 0; + const isAsync2 = modifierFlags & 1024 ? 2 : 0; + const typeParameters = parseTypeParameters(); + if (modifierFlags & 32) + setAwaitContext( + /*value*/ + true + ); + const parameters = parseParameters(isGenerator | isAsync2); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync2, Diagnostics.or_expected); + setAwaitContext(savedAwaitContext); + const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name2, typeParameters, parameters, type3, body); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseConstructorName() { + if (token() === 137) { + return parseExpected( + 137 + /* ConstructorKeyword */ + ); + } + if (token() === 11 && lookAhead(nextToken) === 21) { + return tryParse(() => { + const literalNode = parseLiteralNode(); + return literalNode.text === "constructor" ? literalNode : void 0; + }); + } + } + function tryParseConstructorDeclaration(pos, hasJSDoc, modifiers) { + return tryParse(() => { + if (parseConstructorName()) { + const typeParameters = parseTypeParameters(); + const parameters = parseParameters( + 0 + /* None */ + ); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + const body = parseFunctionBlockOrSemicolon(0, Diagnostics.or_expected); + const node = factory2.createConstructorDeclaration(modifiers, parameters, body); + node.typeParameters = typeParameters; + node.type = type3; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + }); + } + function parseMethodDeclaration(pos, hasJSDoc, modifiers, asteriskToken, name2, questionToken, exclamationToken, diagnosticMessage) { + const isGenerator = asteriskToken ? 1 : 0; + const isAsync2 = some2(modifiers, isAsyncModifier) ? 2 : 0; + const typeParameters = parseTypeParameters(); + const parameters = parseParameters(isGenerator | isAsync2); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync2, diagnosticMessage); + const node = factory2.createMethodDeclaration( + modifiers, + asteriskToken, + name2, + questionToken, + typeParameters, + parameters, + type3, + body + ); + node.exclamationToken = exclamationToken; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyDeclaration(pos, hasJSDoc, modifiers, name2, questionToken) { + const exclamationToken = !questionToken && !scanner2.hasPrecedingLineBreak() ? parseOptionalToken( + 54 + /* ExclamationToken */ + ) : void 0; + const type3 = parseTypeAnnotation(); + const initializer = doOutsideOfContext(16384 | 65536 | 8192, parseInitializer); + parseSemicolonAfterPropertyName(name2, type3, initializer); + const node = factory2.createPropertyDeclaration( + modifiers, + name2, + questionToken || exclamationToken, + type3, + initializer + ); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers) { + const asteriskToken = parseOptionalToken( + 42 + /* AsteriskToken */ + ); + const name2 = parsePropertyName(); + const questionToken = parseOptionalToken( + 58 + /* QuestionToken */ + ); + if (asteriskToken || token() === 21 || token() === 30) { + return parseMethodDeclaration( + pos, + hasJSDoc, + modifiers, + asteriskToken, + name2, + questionToken, + /*exclamationToken*/ + void 0, + Diagnostics.or_expected + ); + } + return parsePropertyDeclaration(pos, hasJSDoc, modifiers, name2, questionToken); + } + function parseAccessorDeclaration(pos, hasJSDoc, modifiers, kind, flags) { + const name2 = parsePropertyName(); + const typeParameters = parseTypeParameters(); + const parameters = parseParameters( + 0 + /* None */ + ); + const type3 = parseReturnType( + 59, + /*isType*/ + false + ); + const body = parseFunctionBlockOrSemicolon(flags); + const node = kind === 177 ? factory2.createGetAccessorDeclaration(modifiers, name2, parameters, type3, body) : factory2.createSetAccessorDeclaration(modifiers, name2, parameters, body); + node.typeParameters = typeParameters; + if (isSetAccessorDeclaration(node)) + node.type = type3; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function isClassMemberStart() { + let idToken; + if (token() === 60) { + return true; + } + while (isModifierKind(token())) { + idToken = token(); + if (isClassMemberModifier(idToken)) { + return true; + } + nextToken(); + } + if (token() === 42) { + return true; + } + if (isLiteralPropertyName()) { + idToken = token(); + nextToken(); + } + if (token() === 23) { + return true; + } + if (idToken !== void 0) { + if (!isKeyword(idToken) || idToken === 153 || idToken === 139) { + return true; + } + switch (token()) { + case 21: + case 30: + case 54: + case 59: + case 64: + case 58: + return true; + default: + return canParseSemicolon(); + } + } + return false; + } + function parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers) { + parseExpectedToken( + 126 + /* StaticKeyword */ + ); + const body = parseClassStaticBlockBody(); + const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); + node.modifiers = modifiers; + return node; + } + function parseClassStaticBlockBody() { + const savedYieldContext = inYieldContext(); + const savedAwaitContext = inAwaitContext(); + setYieldContext(false); + setAwaitContext(true); + const body = parseBlock( + /*ignoreMissingOpenBrace*/ + false + ); + setYieldContext(savedYieldContext); + setAwaitContext(savedAwaitContext); + return body; + } + function parseDecoratorExpression() { + if (inAwaitContext() && token() === 135) { + const pos = getNodePos(); + const awaitExpression = parseIdentifier(Diagnostics.Expression_expected); + nextToken(); + const memberExpression = parseMemberExpressionRest( + pos, + awaitExpression, + /*allowOptionalChain*/ + true + ); + return parseCallExpressionRest(pos, memberExpression); + } + return parseLeftHandSideExpressionOrHigher(); + } + function tryParseDecorator() { + const pos = getNodePos(); + if (!parseOptional( + 60 + /* AtToken */ + )) { + return void 0; + } + const expression = doInDecoratorContext(parseDecoratorExpression); + return finishNode(factory2.createDecorator(expression), pos); + } + function tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock) { + const pos = getNodePos(); + const kind = token(); + if (token() === 87 && permitConstAsModifier) { + if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { + return void 0; + } + } else if (stopOnStartOfClassStaticBlock && token() === 126 && lookAhead(nextTokenIsOpenBrace)) { + return void 0; + } else if (hasSeenStaticModifier && token() === 126) { + return void 0; + } else { + if (!parseAnyContextualModifier()) { + return void 0; + } + } + return finishNode(factoryCreateToken(kind), pos); + } + function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) { + const pos = getNodePos(); + let list; + let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false; + if (allowDecorators && token() === 60) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + } + } + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 126) + hasSeenStaticModifier = true; + list = append(list, modifier); + hasLeadingModifier = true; + } + if (hasLeadingModifier && allowDecorators && token() === 60) { + while (decorator = tryParseDecorator()) { + list = append(list, decorator); + hasTrailingDecorator = true; + } + } + if (hasTrailingDecorator) { + while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) { + if (modifier.kind === 126) + hasSeenStaticModifier = true; + list = append(list, modifier); + } + } + return list && createNodeArray(list, pos); + } + function parseModifiersForArrowFunction() { + let modifiers; + if (token() === 134) { + const pos = getNodePos(); + nextToken(); + const modifier = finishNode(factoryCreateToken( + 134 + /* AsyncKeyword */ + ), pos); + modifiers = createNodeArray([modifier], pos); + } + return modifiers; + } + function parseClassElement() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + if (token() === 27) { + nextToken(); + return withJSDoc(finishNode(factory2.createSemicolonClassElement(), pos), hasJSDoc); + } + const modifiers = parseModifiers( + /*allowDecorators*/ + true, + /*permitConstAsModifier*/ + true, + /*stopOnStartOfClassStaticBlock*/ + true + ); + if (token() === 126 && lookAhead(nextTokenIsOpenBrace)) { + return parseClassStaticBlockDeclaration(pos, hasJSDoc, modifiers); + } + if (parseContextualModifier( + 139 + /* GetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 177, + 0 + /* None */ + ); + } + if (parseContextualModifier( + 153 + /* SetKeyword */ + )) { + return parseAccessorDeclaration( + pos, + hasJSDoc, + modifiers, + 178, + 0 + /* None */ + ); + } + if (token() === 137 || token() === 11) { + const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, modifiers); + if (constructorDeclaration) { + return constructorDeclaration; + } + } + if (isIndexSignature()) { + return parseIndexSignatureDeclaration(pos, hasJSDoc, modifiers); + } + if (tokenIsIdentifierOrKeyword(token()) || token() === 11 || token() === 9 || token() === 42 || token() === 23) { + const isAmbient = some2(modifiers, isDeclareModifier); + if (isAmbient) { + for (const m7 of modifiers) { + m7.flags |= 33554432; + } + return doInsideOfContext(33554432, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers)); + } else { + return parsePropertyOrMethodDeclaration(pos, hasJSDoc, modifiers); + } + } + if (modifiers) { + const name2 = createMissingNode( + 80, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Declaration_expected + ); + return parsePropertyDeclaration( + pos, + hasJSDoc, + modifiers, + name2, + /*questionToken*/ + void 0 + ); + } + return Debug.fail("Should not have attempted to parse class member declaration."); + } + function parseDecoratedExpression() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const modifiers = parseModifiers( + /*allowDecorators*/ + true + ); + if (token() === 86) { + return parseClassDeclarationOrExpression( + pos, + hasJSDoc, + modifiers, + 231 + /* ClassExpression */ + ); + } + const missing = createMissingNode( + 282, + /*reportAtCurrentPosition*/ + true, + Diagnostics.Expression_expected + ); + setTextRangePos(missing, pos); + missing.modifiers = modifiers; + return missing; + } + function parseClassExpression() { + return parseClassDeclarationOrExpression( + getNodePos(), + hasPrecedingJSDocComment(), + /*modifiers*/ + void 0, + 231 + /* ClassExpression */ + ); + } + function parseClassDeclaration(pos, hasJSDoc, modifiers) { + return parseClassDeclarationOrExpression( + pos, + hasJSDoc, + modifiers, + 263 + /* ClassDeclaration */ + ); + } + function parseClassDeclarationOrExpression(pos, hasJSDoc, modifiers, kind) { + const savedAwaitContext = inAwaitContext(); + parseExpected( + 86 + /* ClassKeyword */ + ); + const name2 = parseNameOfClassDeclarationOrExpression(); + const typeParameters = parseTypeParameters(); + if (some2(modifiers, isExportModifier)) + setAwaitContext( + /*value*/ + true + ); + const heritageClauses = parseHeritageClauses(); + let members; + if (parseExpected( + 19 + /* OpenBraceToken */ + )) { + members = parseClassMembers(); + parseExpected( + 20 + /* CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + setAwaitContext(savedAwaitContext); + const node = kind === 263 ? factory2.createClassDeclaration(modifiers, name2, typeParameters, heritageClauses, members) : factory2.createClassExpression(modifiers, name2, typeParameters, heritageClauses, members); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseNameOfClassDeclarationOrExpression() { + return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; + } + function isImplementsClause() { + return token() === 119 && lookAhead(nextTokenIsIdentifierOrKeyword); + } + function parseHeritageClauses() { + if (isHeritageClause2()) { + return parseList(22, parseHeritageClause); + } + return void 0; + } + function parseHeritageClause() { + const pos = getNodePos(); + const tok = token(); + Debug.assert( + tok === 96 || tok === 119 + /* ImplementsKeyword */ + ); + nextToken(); + const types3 = parseDelimitedList(7, parseExpressionWithTypeArguments); + return finishNode(factory2.createHeritageClause(tok, types3), pos); + } + function parseExpressionWithTypeArguments() { + const pos = getNodePos(); + const expression = parseLeftHandSideExpressionOrHigher(); + if (expression.kind === 233) { + return expression; + } + const typeArguments = tryParseTypeArguments(); + return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); + } + function tryParseTypeArguments() { + return token() === 30 ? parseBracketedList( + 20, + parseType, + 30, + 32 + /* GreaterThanToken */ + ) : void 0; + } + function isHeritageClause2() { + return token() === 96 || token() === 119; + } + function parseClassMembers() { + return parseList(5, parseClassElement); + } + function parseInterfaceDeclaration(pos, hasJSDoc, modifiers) { + parseExpected( + 120 + /* InterfaceKeyword */ + ); + const name2 = parseIdentifier(); + const typeParameters = parseTypeParameters(); + const heritageClauses = parseHeritageClauses(); + const members = parseObjectTypeMembers(); + const node = factory2.createInterfaceDeclaration(modifiers, name2, typeParameters, heritageClauses, members); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseTypeAliasDeclaration(pos, hasJSDoc, modifiers) { + parseExpected( + 156 + /* TypeKeyword */ + ); + if (scanner2.hasPrecedingLineBreak()) { + parseErrorAtCurrentToken(Diagnostics.Line_break_not_permitted_here); + } + const name2 = parseIdentifier(); + const typeParameters = parseTypeParameters(); + parseExpected( + 64 + /* EqualsToken */ + ); + const type3 = token() === 141 && tryParse(parseKeywordAndNoDot) || parseType(); + parseSemicolon(); + const node = factory2.createTypeAliasDeclaration(modifiers, name2, typeParameters, type3); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseEnumMember() { + const pos = getNodePos(); + const hasJSDoc = hasPrecedingJSDocComment(); + const name2 = parsePropertyName(); + const initializer = allowInAnd(parseInitializer); + return withJSDoc(finishNode(factory2.createEnumMember(name2, initializer), pos), hasJSDoc); + } + function parseEnumDeclaration(pos, hasJSDoc, modifiers) { + parseExpected( + 94 + /* EnumKeyword */ + ); + const name2 = parseIdentifier(); + let members; + if (parseExpected( + 19 + /* OpenBraceToken */ + )) { + members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(6, parseEnumMember)); + parseExpected( + 20 + /* CloseBraceToken */ + ); + } else { + members = createMissingList(); + } + const node = factory2.createEnumDeclaration(modifiers, name2, members); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseModuleBlock() { + const pos = getNodePos(); + let statements; + if (parseExpected( + 19 + /* OpenBraceToken */ + )) { + statements = parseList(1, parseStatement); + parseExpected( + 20 + /* CloseBraceToken */ + ); + } else { + statements = createMissingList(); + } + return finishNode(factory2.createModuleBlock(statements), pos); + } + function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiers, flags) { + const namespaceFlag = flags & 32; + const name2 = flags & 8 ? parseIdentifierName() : parseIdentifier(); + const body = parseOptional( + 25 + /* DotToken */ + ) ? parseModuleOrNamespaceDeclaration( + getNodePos(), + /*hasJSDoc*/ + false, + /*modifiers*/ + void 0, + 8 | namespaceFlag + ) : parseModuleBlock(); + const node = factory2.createModuleDeclaration(modifiers, name2, body, flags); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn) { + let flags = 0; + let name2; + if (token() === 162) { + name2 = parseIdentifier(); + flags |= 2048; + } else { + name2 = parseLiteralNode(); + name2.text = internIdentifier(name2.text); + } + let body; + if (token() === 19) { + body = parseModuleBlock(); + } else { + parseSemicolon(); + } + const node = factory2.createModuleDeclaration(modifiersIn, name2, body, flags); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseModuleDeclaration(pos, hasJSDoc, modifiersIn) { + let flags = 0; + if (token() === 162) { + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); + } else if (parseOptional( + 145 + /* NamespaceKeyword */ + )) { + flags |= 32; + } else { + parseExpected( + 144 + /* ModuleKeyword */ + ); + if (token() === 11) { + return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, modifiersIn); + } + } + return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, modifiersIn, flags); + } + function isExternalModuleReference2() { + return token() === 149 && lookAhead(nextTokenIsOpenParen); + } + function nextTokenIsOpenParen() { + return nextToken() === 21; + } + function nextTokenIsOpenBrace() { + return nextToken() === 19; + } + function nextTokenIsSlash() { + return nextToken() === 44; + } + function parseNamespaceExportDeclaration(pos, hasJSDoc, modifiers) { + parseExpected( + 130 + /* AsKeyword */ + ); + parseExpected( + 145 + /* NamespaceKeyword */ + ); + const name2 = parseIdentifier(); + parseSemicolon(); + const node = factory2.createNamespaceExportDeclaration(name2); + node.modifiers = modifiers; + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, modifiers) { + parseExpected( + 102 + /* ImportKeyword */ + ); + const afterImportPos = scanner2.getTokenFullStart(); + let identifier; + if (isIdentifier2()) { + identifier = parseIdentifier(); + } + let isTypeOnly = false; + if ((identifier == null ? void 0 : identifier.escapedText) === "type" && (token() !== 161 || isIdentifier2() && lookAhead(nextTokenIsFromKeywordOrEqualsToken)) && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) { + isTypeOnly = true; + identifier = isIdentifier2() ? parseIdentifier() : void 0; + } + if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { + return parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly); + } + let importClause; + if (identifier || // import id + token() === 42 || // import * + token() === 19) { + importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); + parseExpected( + 161 + /* FromKeyword */ + ); + } + const moduleSpecifier = parseModuleSpecifier(); + const currentToken2 = token(); + let attributes; + if ((currentToken2 === 118 || currentToken2 === 132) && !scanner2.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken2); + } + parseSemicolon(); + const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseImportAttribute() { + const pos = getNodePos(); + const name2 = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode( + 11 + /* StringLiteral */ + ); + parseExpected( + 59 + /* ColonToken */ + ); + const value2 = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + return finishNode(factory2.createImportAttribute(name2, value2), pos); + } + function parseImportAttributes(token2, skipKeyword) { + const pos = getNodePos(); + if (!skipKeyword) { + parseExpected(token2); + } + const openBracePosition = scanner2.getTokenStart(); + if (parseExpected( + 19 + /* OpenBraceToken */ + )) { + const multiLine = scanner2.hasPrecedingLineBreak(); + const elements = parseDelimitedList( + 24, + parseImportAttribute, + /*considerSemicolonAsDelimiter*/ + true + ); + if (!parseExpected( + 20 + /* CloseBraceToken */ + )) { + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === Diagnostics._0_expected.code) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") + ); + } + } + return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos); + } else { + const elements = createNodeArray( + [], + getNodePos(), + /*end*/ + void 0, + /*hasTrailingComma*/ + false + ); + return finishNode(factory2.createImportAttributes( + elements, + /*multiLine*/ + false, + token2 + ), pos); + } + } + function tokenAfterImportDefinitelyProducesImportDeclaration() { + return token() === 42 || token() === 19; + } + function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { + return token() === 28 || token() === 161; + } + function parseImportEqualsDeclaration(pos, hasJSDoc, modifiers, identifier, isTypeOnly) { + parseExpected( + 64 + /* EqualsToken */ + ); + const moduleReference = parseModuleReference(); + parseSemicolon(); + const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); + const finished2 = withJSDoc(finishNode(node, pos), hasJSDoc); + return finished2; + } + function parseImportClause(identifier, pos, isTypeOnly) { + let namedBindings; + if (!identifier || parseOptional( + 28 + /* CommaToken */ + )) { + namedBindings = token() === 42 ? parseNamespaceImport() : parseNamedImportsOrExports( + 275 + /* NamedImports */ + ); + } + return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos); + } + function parseModuleReference() { + return isExternalModuleReference2() ? parseExternalModuleReference() : parseEntityName( + /*allowReservedWords*/ + false + ); + } + function parseExternalModuleReference() { + const pos = getNodePos(); + parseExpected( + 149 + /* RequireKeyword */ + ); + parseExpected( + 21 + /* OpenParenToken */ + ); + const expression = parseModuleSpecifier(); + parseExpected( + 22 + /* CloseParenToken */ + ); + return finishNode(factory2.createExternalModuleReference(expression), pos); + } + function parseModuleSpecifier() { + if (token() === 11) { + const result2 = parseLiteralNode(); + result2.text = internIdentifier(result2.text); + return result2; + } else { + return parseExpression(); + } + } + function parseNamespaceImport() { + const pos = getNodePos(); + parseExpected( + 42 + /* AsteriskToken */ + ); + parseExpected( + 130 + /* AsKeyword */ + ); + const name2 = parseIdentifier(); + return finishNode(factory2.createNamespaceImport(name2), pos); + } + function parseNamedImportsOrExports(kind) { + const pos = getNodePos(); + const node = kind === 275 ? factory2.createNamedImports(parseBracketedList( + 23, + parseImportSpecifier, + 19, + 20 + /* CloseBraceToken */ + )) : factory2.createNamedExports(parseBracketedList( + 23, + parseExportSpecifier, + 19, + 20 + /* CloseBraceToken */ + )); + return finishNode(node, pos); + } + function parseExportSpecifier() { + const hasJSDoc = hasPrecedingJSDocComment(); + return withJSDoc(parseImportOrExportSpecifier( + 281 + /* ExportSpecifier */ + ), hasJSDoc); + } + function parseImportSpecifier() { + return parseImportOrExportSpecifier( + 276 + /* ImportSpecifier */ + ); + } + function parseImportOrExportSpecifier(kind) { + const pos = getNodePos(); + let checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); + let checkIdentifierStart = scanner2.getTokenStart(); + let checkIdentifierEnd = scanner2.getTokenEnd(); + let isTypeOnly = false; + let propertyName; + let canParseAsKeyword = true; + let name2 = parseIdentifierName(); + if (name2.escapedText === "type") { + if (token() === 130) { + const firstAs = parseIdentifierName(); + if (token() === 130) { + const secondAs = parseIdentifierName(); + if (tokenIsIdentifierOrKeyword(token())) { + isTypeOnly = true; + propertyName = firstAs; + name2 = parseNameWithKeywordCheck(); + canParseAsKeyword = false; + } else { + propertyName = name2; + name2 = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsIdentifierOrKeyword(token())) { + propertyName = name2; + canParseAsKeyword = false; + name2 = parseNameWithKeywordCheck(); + } else { + isTypeOnly = true; + name2 = firstAs; + } + } else if (tokenIsIdentifierOrKeyword(token())) { + isTypeOnly = true; + name2 = parseNameWithKeywordCheck(); + } + } + if (canParseAsKeyword && token() === 130) { + propertyName = name2; + parseExpected( + 130 + /* AsKeyword */ + ); + name2 = parseNameWithKeywordCheck(); + } + if (kind === 276 && checkIdentifierIsKeyword) { + parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); + } + const node = kind === 276 ? factory2.createImportSpecifier(isTypeOnly, propertyName, name2) : factory2.createExportSpecifier(isTypeOnly, propertyName, name2); + return finishNode(node, pos); + function parseNameWithKeywordCheck() { + checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); + checkIdentifierStart = scanner2.getTokenStart(); + checkIdentifierEnd = scanner2.getTokenEnd(); + return parseIdentifierName(); + } + } + function parseNamespaceExport(pos) { + return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); + } + function parseExportDeclaration(pos, hasJSDoc, modifiers) { + const savedAwaitContext = inAwaitContext(); + setAwaitContext( + /*value*/ + true + ); + let exportClause; + let moduleSpecifier; + let attributes; + const isTypeOnly = parseOptional( + 156 + /* TypeKeyword */ + ); + const namespaceExportPos = getNodePos(); + if (parseOptional( + 42 + /* AsteriskToken */ + )) { + if (parseOptional( + 130 + /* AsKeyword */ + )) { + exportClause = parseNamespaceExport(namespaceExportPos); + } + parseExpected( + 161 + /* FromKeyword */ + ); + moduleSpecifier = parseModuleSpecifier(); + } else { + exportClause = parseNamedImportsOrExports( + 279 + /* NamedExports */ + ); + if (token() === 161 || token() === 11 && !scanner2.hasPrecedingLineBreak()) { + parseExpected( + 161 + /* FromKeyword */ + ); + moduleSpecifier = parseModuleSpecifier(); + } + } + const currentToken2 = token(); + if (moduleSpecifier && (currentToken2 === 118 || currentToken2 === 132) && !scanner2.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken2); + } + parseSemicolon(); + setAwaitContext(savedAwaitContext); + const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + function parseExportAssignment(pos, hasJSDoc, modifiers) { + const savedAwaitContext = inAwaitContext(); + setAwaitContext( + /*value*/ + true + ); + let isExportEquals; + if (parseOptional( + 64 + /* EqualsToken */ + )) { + isExportEquals = true; + } else { + parseExpected( + 90 + /* DefaultKeyword */ + ); + } + const expression = parseAssignmentExpressionOrHigher( + /*allowReturnTypeInArrowFunction*/ + true + ); + parseSemicolon(); + setAwaitContext(savedAwaitContext); + const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); + return withJSDoc(finishNode(node, pos), hasJSDoc); + } + let ParsingContext; + ((ParsingContext2) => { + ParsingContext2[ParsingContext2["SourceElements"] = 0] = "SourceElements"; + ParsingContext2[ParsingContext2["BlockStatements"] = 1] = "BlockStatements"; + ParsingContext2[ParsingContext2["SwitchClauses"] = 2] = "SwitchClauses"; + ParsingContext2[ParsingContext2["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; + ParsingContext2[ParsingContext2["TypeMembers"] = 4] = "TypeMembers"; + ParsingContext2[ParsingContext2["ClassMembers"] = 5] = "ClassMembers"; + ParsingContext2[ParsingContext2["EnumMembers"] = 6] = "EnumMembers"; + ParsingContext2[ParsingContext2["HeritageClauseElement"] = 7] = "HeritageClauseElement"; + ParsingContext2[ParsingContext2["VariableDeclarations"] = 8] = "VariableDeclarations"; + ParsingContext2[ParsingContext2["ObjectBindingElements"] = 9] = "ObjectBindingElements"; + ParsingContext2[ParsingContext2["ArrayBindingElements"] = 10] = "ArrayBindingElements"; + ParsingContext2[ParsingContext2["ArgumentExpressions"] = 11] = "ArgumentExpressions"; + ParsingContext2[ParsingContext2["ObjectLiteralMembers"] = 12] = "ObjectLiteralMembers"; + ParsingContext2[ParsingContext2["JsxAttributes"] = 13] = "JsxAttributes"; + ParsingContext2[ParsingContext2["JsxChildren"] = 14] = "JsxChildren"; + ParsingContext2[ParsingContext2["ArrayLiteralMembers"] = 15] = "ArrayLiteralMembers"; + ParsingContext2[ParsingContext2["Parameters"] = 16] = "Parameters"; + ParsingContext2[ParsingContext2["JSDocParameters"] = 17] = "JSDocParameters"; + ParsingContext2[ParsingContext2["RestProperties"] = 18] = "RestProperties"; + ParsingContext2[ParsingContext2["TypeParameters"] = 19] = "TypeParameters"; + ParsingContext2[ParsingContext2["TypeArguments"] = 20] = "TypeArguments"; + ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes"; + ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses"; + ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers"; + ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes"; + ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment"; + ParsingContext2[ParsingContext2["Count"] = 26] = "Count"; + })(ParsingContext || (ParsingContext = {})); + let Tristate; + ((Tristate2) => { + Tristate2[Tristate2["False"] = 0] = "False"; + Tristate2[Tristate2["True"] = 1] = "True"; + Tristate2[Tristate2["Unknown"] = 2] = "Unknown"; + })(Tristate || (Tristate = {})); + let JSDocParser; + ((JSDocParser2) => { + function parseJSDocTypeExpressionForTests2(content, start, length2) { + initializeState( + "file.js", + content, + 99, + /*syntaxCursor*/ + void 0, + 1, + 0 + /* ParseAll */ + ); + scanner2.setText(content, start, length2); + currentToken = scanner2.scan(); + const jsDocTypeExpression = parseJSDocTypeExpression(); + const sourceFile = createSourceFile2( + "file.js", + 99, + 1, + /*isDeclarationFile*/ + false, + [], + factoryCreateToken( + 1 + /* EndOfFileToken */ + ), + 0, + noop4 + ); + const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); + if (jsDocDiagnostics) { + sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); + } + clearState(); + return jsDocTypeExpression ? { jsDocTypeExpression, diagnostics } : void 0; + } + JSDocParser2.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests2; + function parseJSDocTypeExpression(mayOmitBraces) { + const pos = getNodePos(); + const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)( + 19 + /* OpenBraceToken */ + ); + const type3 = doInsideOfContext(16777216, parseJSDocType); + if (!mayOmitBraces || hasBrace) { + parseExpectedJSDoc( + 20 + /* CloseBraceToken */ + ); + } + const result2 = factory2.createJSDocTypeExpression(type3); + fixupParentReferences(result2); + return finishNode(result2, pos); + } + JSDocParser2.parseJSDocTypeExpression = parseJSDocTypeExpression; + function parseJSDocNameReference() { + const pos = getNodePos(); + const hasBrace = parseOptional( + 19 + /* OpenBraceToken */ + ); + const p22 = getNodePos(); + let entityName = parseEntityName( + /*allowReservedWords*/ + false + ); + while (token() === 81) { + reScanHashToken(); + nextTokenJSDoc(); + entityName = finishNode(factory2.createJSDocMemberName(entityName, parseIdentifier()), p22); + } + if (hasBrace) { + parseExpectedJSDoc( + 20 + /* CloseBraceToken */ + ); + } + const result2 = factory2.createJSDocNameReference(entityName); + fixupParentReferences(result2); + return finishNode(result2, pos); + } + JSDocParser2.parseJSDocNameReference = parseJSDocNameReference; + function parseIsolatedJSDocComment2(content, start, length2) { + initializeState( + "", + content, + 99, + /*syntaxCursor*/ + void 0, + 1, + 0 + /* ParseAll */ + ); + const jsDoc = doInsideOfContext(16777216, () => parseJSDocCommentWorker(start, length2)); + const sourceFile = { languageVariant: 0, text: content }; + const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); + clearState(); + return jsDoc ? { jsDoc, diagnostics } : void 0; + } + JSDocParser2.parseIsolatedJSDocComment = parseIsolatedJSDocComment2; + function parseJSDocComment(parent22, start, length2) { + const saveToken = currentToken; + const saveParseDiagnosticsLength = parseDiagnostics.length; + const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; + const comment = doInsideOfContext(16777216, () => parseJSDocCommentWorker(start, length2)); + setParent(comment, parent22); + if (contextFlags & 524288) { + if (!jsDocDiagnostics) { + jsDocDiagnostics = []; + } + addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength); + } + currentToken = saveToken; + parseDiagnostics.length = saveParseDiagnosticsLength; + parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; + return comment; + } + JSDocParser2.parseJSDocComment = parseJSDocComment; + let JSDocState; + ((JSDocState2) => { + JSDocState2[JSDocState2["BeginningOfLine"] = 0] = "BeginningOfLine"; + JSDocState2[JSDocState2["SawAsterisk"] = 1] = "SawAsterisk"; + JSDocState2[JSDocState2["SavingComments"] = 2] = "SavingComments"; + JSDocState2[JSDocState2["SavingBackticks"] = 3] = "SavingBackticks"; + })(JSDocState || (JSDocState = {})); + let PropertyLikeParse; + ((PropertyLikeParse2) => { + PropertyLikeParse2[PropertyLikeParse2["Property"] = 1] = "Property"; + PropertyLikeParse2[PropertyLikeParse2["Parameter"] = 2] = "Parameter"; + PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter"; + })(PropertyLikeParse || (PropertyLikeParse = {})); + function parseJSDocCommentWorker(start = 0, length2) { + const content = sourceText; + const end = length2 === void 0 ? content.length : start + length2; + length2 = end - start; + Debug.assert(start >= 0); + Debug.assert(start <= end); + Debug.assert(end <= content.length); + if (!isJSDocLikeText(content, start)) { + return void 0; + } + let tags6; + let tagsPos; + let tagsEnd; + let linkEnd; + let commentsPos; + let comments = []; + const parts = []; + const saveParsingContext = parsingContext; + parsingContext |= 1 << 25; + const result2 = scanner2.scanRange(start + 3, length2 - 5, doJSDocScan); + parsingContext = saveParsingContext; + return result2; + function doJSDocScan() { + let state = 1; + let margin; + let indent3 = start - (content.lastIndexOf("\n", start) + 1) + 4; + function pushComment(text) { + if (!margin) { + margin = indent3; + } + comments.push(text); + indent3 += text.length; + } + nextTokenJSDoc(); + while (parseOptionalJsdoc( + 5 + /* WhitespaceTrivia */ + )) + ; + if (parseOptionalJsdoc( + 4 + /* NewLineTrivia */ + )) { + state = 0; + indent3 = 0; + } + loop: + while (true) { + switch (token()) { + case 60: + removeTrailingWhitespace(comments); + if (!commentsPos) + commentsPos = getNodePos(); + addTag(parseTag(indent3)); + state = 0; + margin = void 0; + break; + case 4: + comments.push(scanner2.getTokenText()); + state = 0; + indent3 = 0; + break; + case 42: + const asterisk = scanner2.getTokenText(); + if (state === 1) { + state = 2; + pushComment(asterisk); + } else { + Debug.assert( + state === 0 + /* BeginningOfLine */ + ); + state = 1; + indent3 += asterisk.length; + } + break; + case 5: + Debug.assert(state !== 2, "whitespace shouldn't come from the scanner while saving top-level comment text"); + const whitespace = scanner2.getTokenText(); + if (margin !== void 0 && indent3 + whitespace.length > margin) { + comments.push(whitespace.slice(margin - indent3)); + } + indent3 += whitespace.length; + break; + case 1: + break loop; + case 82: + state = 2; + pushComment(scanner2.getTokenValue()); + break; + case 19: + state = 2; + const commentEnd = scanner2.getTokenFullStart(); + const linkStart = scanner2.getTokenEnd() - 1; + const link2 = parseJSDocLink(linkStart); + if (link2) { + if (!linkEnd) { + removeLeadingNewlines(comments); + } + parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd ?? start, commentEnd)); + parts.push(link2); + comments = []; + linkEnd = scanner2.getTokenEnd(); + break; + } + default: + state = 2; + pushComment(scanner2.getTokenText()); + break; + } + if (state === 2) { + nextJSDocCommentTextToken( + /*inBackticks*/ + false + ); + } else { + nextTokenJSDoc(); + } + } + const trimmedComments = comments.join("").trimEnd(); + if (parts.length && trimmedComments.length) { + parts.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd ?? start, commentsPos)); + } + if (parts.length && tags6) + Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); + const tagsArray = tags6 && createNodeArray(tags6, tagsPos, tagsEnd); + return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end); + } + function removeLeadingNewlines(comments2) { + while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { + comments2.shift(); + } + } + function removeTrailingWhitespace(comments2) { + while (comments2.length) { + const trimmed = comments2[comments2.length - 1].trimEnd(); + if (trimmed === "") { + comments2.pop(); + } else if (trimmed.length < comments2[comments2.length - 1].length) { + comments2[comments2.length - 1] = trimmed; + break; + } else { + break; + } + } + } + function isNextNonwhitespaceTokenEndOfFile() { + while (true) { + nextTokenJSDoc(); + if (token() === 1) { + return true; + } + if (!(token() === 5 || token() === 4)) { + return false; + } + } + } + function skipWhitespace2() { + if (token() === 5 || token() === 4) { + if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { + return; + } + } + while (token() === 5 || token() === 4) { + nextTokenJSDoc(); + } + } + function skipWhitespaceOrAsterisk() { + if (token() === 5 || token() === 4) { + if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { + return ""; + } + } + let precedingLineBreak = scanner2.hasPrecedingLineBreak(); + let seenLineBreak = false; + let indentText = ""; + while (precedingLineBreak && token() === 42 || token() === 5 || token() === 4) { + indentText += scanner2.getTokenText(); + if (token() === 4) { + precedingLineBreak = true; + seenLineBreak = true; + indentText = ""; + } else if (token() === 42) { + precedingLineBreak = false; + } + nextTokenJSDoc(); + } + return seenLineBreak ? indentText : ""; + } + function parseTag(margin) { + Debug.assert( + token() === 60 + /* AtToken */ + ); + const start2 = scanner2.getTokenStart(); + nextTokenJSDoc(); + const tagName = parseJSDocIdentifierName( + /*message*/ + void 0 + ); + const indentText = skipWhitespaceOrAsterisk(); + let tag; + switch (tagName.escapedText) { + case "author": + tag = parseAuthorTag(start2, tagName, margin, indentText); + break; + case "implements": + tag = parseImplementsTag(start2, tagName, margin, indentText); + break; + case "augments": + case "extends": + tag = parseAugmentsTag(start2, tagName, margin, indentText); + break; + case "class": + case "constructor": + tag = parseSimpleTag(start2, factory2.createJSDocClassTag, tagName, margin, indentText); + break; + case "public": + tag = parseSimpleTag(start2, factory2.createJSDocPublicTag, tagName, margin, indentText); + break; + case "private": + tag = parseSimpleTag(start2, factory2.createJSDocPrivateTag, tagName, margin, indentText); + break; + case "protected": + tag = parseSimpleTag(start2, factory2.createJSDocProtectedTag, tagName, margin, indentText); + break; + case "readonly": + tag = parseSimpleTag(start2, factory2.createJSDocReadonlyTag, tagName, margin, indentText); + break; + case "override": + tag = parseSimpleTag(start2, factory2.createJSDocOverrideTag, tagName, margin, indentText); + break; + case "deprecated": + hasDeprecatedTag = true; + tag = parseSimpleTag(start2, factory2.createJSDocDeprecatedTag, tagName, margin, indentText); + break; + case "this": + tag = parseThisTag(start2, tagName, margin, indentText); + break; + case "enum": + tag = parseEnumTag(start2, tagName, margin, indentText); + break; + case "arg": + case "argument": + case "param": + return parseParameterOrPropertyTag(start2, tagName, 2, margin); + case "return": + case "returns": + tag = parseReturnTag(start2, tagName, margin, indentText); + break; + case "template": + tag = parseTemplateTag(start2, tagName, margin, indentText); + break; + case "type": + tag = parseTypeTag(start2, tagName, margin, indentText); + break; + case "typedef": + tag = parseTypedefTag(start2, tagName, margin, indentText); + break; + case "callback": + tag = parseCallbackTag(start2, tagName, margin, indentText); + break; + case "overload": + tag = parseOverloadTag(start2, tagName, margin, indentText); + break; + case "satisfies": + tag = parseSatisfiesTag(start2, tagName, margin, indentText); + break; + case "see": + tag = parseSeeTag(start2, tagName, margin, indentText); + break; + case "exception": + case "throws": + tag = parseThrowsTag(start2, tagName, margin, indentText); + break; + default: + tag = parseUnknownTag(start2, tagName, margin, indentText); + break; + } + return tag; + } + function parseTrailingTagComments(pos, end2, margin, indentText) { + if (!indentText) { + margin += end2 - pos; + } + return parseTagComments(margin, indentText.slice(margin)); + } + function parseTagComments(indent3, initialMargin) { + const commentsPos2 = getNodePos(); + let comments2 = []; + const parts2 = []; + let linkEnd2; + let state = 0; + let margin; + function pushComment(text) { + if (!margin) { + margin = indent3; + } + comments2.push(text); + indent3 += text.length; + } + if (initialMargin !== void 0) { + if (initialMargin !== "") { + pushComment(initialMargin); + } + state = 1; + } + let tok = token(); + loop: + while (true) { + switch (tok) { + case 4: + state = 0; + comments2.push(scanner2.getTokenText()); + indent3 = 0; + break; + case 60: + scanner2.resetTokenState(scanner2.getTokenEnd() - 1); + break loop; + case 1: + break loop; + case 5: + Debug.assert(state !== 2 && state !== 3, "whitespace shouldn't come from the scanner while saving comment text"); + const whitespace = scanner2.getTokenText(); + if (margin !== void 0 && indent3 + whitespace.length > margin) { + comments2.push(whitespace.slice(margin - indent3)); + state = 2; + } + indent3 += whitespace.length; + break; + case 19: + state = 2; + const commentEnd = scanner2.getTokenFullStart(); + const linkStart = scanner2.getTokenEnd() - 1; + const link2 = parseJSDocLink(linkStart); + if (link2) { + parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 ?? commentsPos2, commentEnd)); + parts2.push(link2); + comments2 = []; + linkEnd2 = scanner2.getTokenEnd(); + } else { + pushComment(scanner2.getTokenText()); + } + break; + case 62: + if (state === 3) { + state = 2; + } else { + state = 3; + } + pushComment(scanner2.getTokenText()); + break; + case 82: + if (state !== 3) { + state = 2; + } + pushComment(scanner2.getTokenValue()); + break; + case 42: + if (state === 0) { + state = 1; + indent3 += 1; + break; + } + default: + if (state !== 3) { + state = 2; + } + pushComment(scanner2.getTokenText()); + break; + } + if (state === 2 || state === 3) { + tok = nextJSDocCommentTextToken( + state === 3 + /* SavingBackticks */ + ); + } else { + tok = nextTokenJSDoc(); + } + } + removeLeadingNewlines(comments2); + const trimmedComments = comments2.join("").trimEnd(); + if (parts2.length) { + if (trimmedComments.length) { + parts2.push(finishNode(factory2.createJSDocText(trimmedComments), linkEnd2 ?? commentsPos2)); + } + return createNodeArray(parts2, commentsPos2, scanner2.getTokenEnd()); + } else if (trimmedComments.length) { + return trimmedComments; + } + } + function parseJSDocLink(start2) { + const linkType = tryParse(parseJSDocLinkPrefix); + if (!linkType) { + return void 0; + } + nextTokenJSDoc(); + skipWhitespace2(); + const name2 = parseJSDocLinkName(); + const text = []; + while (token() !== 20 && token() !== 4 && token() !== 1) { + text.push(scanner2.getTokenText()); + nextTokenJSDoc(); + } + const create2 = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain; + return finishNode(create2(name2, text.join("")), start2, scanner2.getTokenEnd()); + } + function parseJSDocLinkName() { + if (tokenIsIdentifierOrKeyword(token())) { + const pos = getNodePos(); + let name2 = parseIdentifierName(); + while (parseOptional( + 25 + /* DotToken */ + )) { + name2 = finishNode(factory2.createQualifiedName(name2, token() === 81 ? createMissingNode( + 80, + /*reportAtCurrentPosition*/ + false + ) : parseIdentifier()), pos); + } + while (token() === 81) { + reScanHashToken(); + nextTokenJSDoc(); + name2 = finishNode(factory2.createJSDocMemberName(name2, parseIdentifier()), pos); + } + return name2; + } + return void 0; + } + function parseJSDocLinkPrefix() { + skipWhitespaceOrAsterisk(); + if (token() === 19 && nextTokenJSDoc() === 60 && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) { + const kind = scanner2.getTokenValue(); + if (isJSDocLinkTag(kind)) + return kind; + } + } + function isJSDocLinkTag(kind) { + return kind === "link" || kind === "linkcode" || kind === "linkplain"; + } + function parseUnknownTag(start2, tagName, indent3, indentText) { + return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); + } + function addTag(tag) { + if (!tag) { + return; + } + if (!tags6) { + tags6 = [tag]; + tagsPos = tag.pos; + } else { + tags6.push(tag); + } + tagsEnd = tag.end; + } + function tryParseTypeExpression() { + skipWhitespaceOrAsterisk(); + return token() === 19 ? parseJSDocTypeExpression() : void 0; + } + function parseBracketNameInPropertyAndParamTag() { + const isBracketed = parseOptionalJsdoc( + 23 + /* OpenBracketToken */ + ); + if (isBracketed) { + skipWhitespace2(); + } + const isBackquoted = parseOptionalJsdoc( + 62 + /* BacktickToken */ + ); + const name2 = parseJSDocEntityName(); + if (isBackquoted) { + parseExpectedTokenJSDoc( + 62 + /* BacktickToken */ + ); + } + if (isBracketed) { + skipWhitespace2(); + if (parseOptionalToken( + 64 + /* EqualsToken */ + )) { + parseExpression(); + } + parseExpected( + 24 + /* CloseBracketToken */ + ); + } + return { name: name2, isBracketed }; + } + function isObjectOrObjectArrayTypeReference(node) { + switch (node.kind) { + case 151: + return true; + case 188: + return isObjectOrObjectArrayTypeReference(node.elementType); + default: + return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; + } + } + function parseParameterOrPropertyTag(start2, tagName, target, indent3) { + let typeExpression = tryParseTypeExpression(); + let isNameFirst = !typeExpression; + skipWhitespaceOrAsterisk(); + const { name: name2, isBracketed } = parseBracketNameInPropertyAndParamTag(); + const indentText = skipWhitespaceOrAsterisk(); + if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) { + typeExpression = tryParseTypeExpression(); + } + const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); + const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name2, target, indent3); + if (nestedTypeLiteral) { + typeExpression = nestedTypeLiteral; + isNameFirst = true; + } + const result22 = target === 1 ? factory2.createJSDocPropertyTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name2, isBracketed, typeExpression, isNameFirst, comment); + return finishNode(result22, start2); + } + function parseNestedTypeLiteral(typeExpression, name2, target, indent3) { + if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { + const pos = getNodePos(); + let child; + let children; + while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name2))) { + if (child.kind === 348 || child.kind === 355) { + children = append(children, child); + } else if (child.kind === 352) { + parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); + } + } + if (children) { + const literal = finishNode(factory2.createJSDocTypeLiteral( + children, + typeExpression.type.kind === 188 + /* ArrayType */ + ), pos); + return finishNode(factory2.createJSDocTypeExpression(literal), pos); + } + } + } + function parseReturnTag(start2, tagName, indent3, indentText) { + if (some2(tags6, isJSDocReturnTag)) { + parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText)); + } + const typeExpression = tryParseTypeExpression(); + return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); + } + function parseTypeTag(start2, tagName, indent3, indentText) { + if (some2(tags6, isJSDocTypeTag)) { + parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText)); + } + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0; + return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2); + } + function parseSeeTag(start2, tagName, indent3, indentText) { + const isMarkdownOrJSDocLink = token() === 23 || lookAhead(() => nextTokenJSDoc() === 60 && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner2.getTokenValue())); + const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference(); + const comments2 = indent3 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent3, indentText) : void 0; + return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2); + } + function parseThrowsTag(start2, tagName, indent3, indentText) { + const typeExpression = tryParseTypeExpression(); + const comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); + return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2); + } + function parseAuthorTag(start2, tagName, indent3, indentText) { + const commentStart = getNodePos(); + const textOnly = parseAuthorNameAndEmail(); + let commentEnd = scanner2.getTokenFullStart(); + const comments2 = parseTrailingTagComments(start2, commentEnd, indent3, indentText); + if (!comments2) { + commentEnd = scanner2.getTokenFullStart(); + } + const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; + return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2); + } + function parseAuthorNameAndEmail() { + const comments2 = []; + let inEmail = false; + let token2 = scanner2.getToken(); + while (token2 !== 1 && token2 !== 4) { + if (token2 === 30) { + inEmail = true; + } else if (token2 === 60 && !inEmail) { + break; + } else if (token2 === 32 && inEmail) { + comments2.push(scanner2.getTokenText()); + scanner2.resetTokenState(scanner2.getTokenEnd()); + break; + } + comments2.push(scanner2.getTokenText()); + token2 = nextTokenJSDoc(); + } + return factory2.createJSDocText(comments2.join("")); + } + function parseImplementsTag(start2, tagName, margin, indentText) { + const className = parseExpressionWithTypeArgumentsForAugments(); + return finishNode(factory2.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseAugmentsTag(start2, tagName, margin, indentText) { + const className = parseExpressionWithTypeArgumentsForAugments(); + return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseSatisfiesTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + false + ); + const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0; + return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2); + } + function parseExpressionWithTypeArgumentsForAugments() { + const usedBrace = parseOptional( + 19 + /* OpenBraceToken */ + ); + const pos = getNodePos(); + const expression = parsePropertyAccessEntityNameExpression(); + scanner2.setInJSDocType(true); + const typeArguments = tryParseTypeArguments(); + scanner2.setInJSDocType(false); + const node = factory2.createExpressionWithTypeArguments(expression, typeArguments); + const res = finishNode(node, pos); + if (usedBrace) { + parseExpected( + 20 + /* CloseBraceToken */ + ); + } + return res; + } + function parsePropertyAccessEntityNameExpression() { + const pos = getNodePos(); + let node = parseJSDocIdentifierName(); + while (parseOptional( + 25 + /* DotToken */ + )) { + const name2 = parseJSDocIdentifierName(); + node = finishNode(factoryCreatePropertyAccessExpression(node, name2), pos); + } + return node; + } + function parseSimpleTag(start2, createTag, tagName, margin, indentText) { + return finishNode(createTag(tagName, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseThisTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + skipWhitespace2(); + return finishNode(factory2.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseEnumTag(start2, tagName, margin, indentText) { + const typeExpression = parseJSDocTypeExpression( + /*mayOmitBraces*/ + true + ); + skipWhitespace2(); + return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); + } + function parseTypedefTag(start2, tagName, indent3, indentText) { + let typeExpression = tryParseTypeExpression(); + skipWhitespaceOrAsterisk(); + const fullName = parseJSDocTypeNameWithNamespace(); + skipWhitespace2(); + let comment = parseTagComments(indent3); + let end2; + if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) { + let child; + let childTypeTag; + let jsDocPropertyTags; + let hasChildren = false; + while (child = tryParse(() => parseChildPropertyTag(indent3))) { + if (child.kind === 352) { + break; + } + hasChildren = true; + if (child.kind === 351) { + if (childTypeTag) { + const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); + if (lastError) { + addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here)); + } + break; + } else { + childTypeTag = child; + } + } else { + jsDocPropertyTags = append(jsDocPropertyTags, child); + } + } + if (hasChildren) { + const isArrayType = typeExpression && typeExpression.type.kind === 188; + const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); + typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); + end2 = typeExpression.end; + } + } + end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end; + if (!comment) { + comment = parseTrailingTagComments(start2, end2, indent3, indentText); + } + const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment); + return finishNode(typedefTag, start2, end2); + } + function parseJSDocTypeNameWithNamespace(nested) { + const start2 = scanner2.getTokenStart(); + if (!tokenIsIdentifierOrKeyword(token())) { + return void 0; + } + const typeNameOrNamespaceName = parseJSDocIdentifierName(); + if (parseOptional( + 25 + /* DotToken */ + )) { + const body = parseJSDocTypeNameWithNamespace( + /*nested*/ + true + ); + const jsDocNamespaceNode = factory2.createModuleDeclaration( + /*modifiers*/ + void 0, + typeNameOrNamespaceName, + body, + nested ? 8 : void 0 + ); + return finishNode(jsDocNamespaceNode, start2); + } + if (nested) { + typeNameOrNamespaceName.flags |= 4096; + } + return typeNameOrNamespaceName; + } + function parseCallbackTagParameters(indent3) { + const pos = getNodePos(); + let child; + let parameters; + while (child = tryParse(() => parseChildParameterOrPropertyTag(4, indent3))) { + if (child.kind === 352) { + parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag); + break; + } + parameters = append(parameters, child); + } + return createNodeArray(parameters || [], pos); + } + function parseJSDocSignature(start2, indent3) { + const parameters = parseCallbackTagParameters(indent3); + const returnTag = tryParse(() => { + if (parseOptionalJsdoc( + 60 + /* AtToken */ + )) { + const tag = parseTag(indent3); + if (tag && tag.kind === 349) { + return tag; + } + } + }); + return finishNode(factory2.createJSDocSignature( + /*typeParameters*/ + void 0, + parameters, + returnTag + ), start2); + } + function parseCallbackTag(start2, tagName, indent3, indentText) { + const fullName = parseJSDocTypeNameWithNamespace(); + skipWhitespace2(); + let comment = parseTagComments(indent3); + const typeExpression = parseJSDocSignature(start2, indent3); + if (!comment) { + comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); + } + const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; + return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2); + } + function parseOverloadTag(start2, tagName, indent3, indentText) { + skipWhitespace2(); + let comment = parseTagComments(indent3); + const typeExpression = parseJSDocSignature(start2, indent3); + if (!comment) { + comment = parseTrailingTagComments(start2, getNodePos(), indent3, indentText); + } + const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; + return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2); + } + function escapedTextsEqual(a7, b8) { + while (!isIdentifier(a7) || !isIdentifier(b8)) { + if (!isIdentifier(a7) && !isIdentifier(b8) && a7.right.escapedText === b8.right.escapedText) { + a7 = a7.left; + b8 = b8.left; + } else { + return false; + } + } + return a7.escapedText === b8.escapedText; + } + function parseChildPropertyTag(indent3) { + return parseChildParameterOrPropertyTag(1, indent3); + } + function parseChildParameterOrPropertyTag(target, indent3, name2) { + let canParseTag = true; + let seenAsterisk = false; + while (true) { + switch (nextTokenJSDoc()) { + case 60: + if (canParseTag) { + const child = tryParseChildTag(target, indent3); + if (child && (child.kind === 348 || child.kind === 355) && name2 && (isIdentifier(child.name) || !escapedTextsEqual(name2, child.name.left))) { + return false; + } + return child; + } + seenAsterisk = false; + break; + case 4: + canParseTag = true; + seenAsterisk = false; + break; + case 42: + if (seenAsterisk) { + canParseTag = false; + } + seenAsterisk = true; + break; + case 80: + canParseTag = false; + break; + case 1: + return false; + } + } + } + function tryParseChildTag(target, indent3) { + Debug.assert( + token() === 60 + /* AtToken */ + ); + const start2 = scanner2.getTokenFullStart(); + nextTokenJSDoc(); + const tagName = parseJSDocIdentifierName(); + const indentText = skipWhitespaceOrAsterisk(); + let t8; + switch (tagName.escapedText) { + case "type": + return target === 1 && parseTypeTag(start2, tagName); + case "prop": + case "property": + t8 = 1; + break; + case "arg": + case "argument": + case "param": + t8 = 2 | 4; + break; + case "template": + return parseTemplateTag(start2, tagName, indent3, indentText); + case "this": + return parseThisTag(start2, tagName, indent3, indentText); + default: + return false; + } + if (!(target & t8)) { + return false; + } + return parseParameterOrPropertyTag(start2, tagName, target, indent3); + } + function parseTemplateTagTypeParameter() { + const typeParameterPos = getNodePos(); + const isBracketed = parseOptionalJsdoc( + 23 + /* OpenBracketToken */ + ); + if (isBracketed) { + skipWhitespace2(); + } + const modifiers = parseModifiers( + /*allowDecorators*/ + false, + /*permitConstAsModifier*/ + true + ); + const name2 = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); + let defaultType; + if (isBracketed) { + skipWhitespace2(); + parseExpected( + 64 + /* EqualsToken */ + ); + defaultType = doInsideOfContext(16777216, parseJSDocType); + parseExpected( + 24 + /* CloseBracketToken */ + ); + } + if (nodeIsMissing(name2)) { + return void 0; + } + return finishNode(factory2.createTypeParameterDeclaration( + modifiers, + name2, + /*constraint*/ + void 0, + defaultType + ), typeParameterPos); + } + function parseTemplateTagTypeParameters() { + const pos = getNodePos(); + const typeParameters = []; + do { + skipWhitespace2(); + const node = parseTemplateTagTypeParameter(); + if (node !== void 0) { + typeParameters.push(node); + } + skipWhitespaceOrAsterisk(); + } while (parseOptionalJsdoc( + 28 + /* CommaToken */ + )); + return createNodeArray(typeParameters, pos); + } + function parseTemplateTag(start2, tagName, indent3, indentText) { + const constraint = token() === 19 ? parseJSDocTypeExpression() : void 0; + const typeParameters = parseTemplateTagTypeParameters(); + return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent3, indentText)), start2); + } + function parseOptionalJsdoc(t8) { + if (token() === t8) { + nextTokenJSDoc(); + return true; + } + return false; + } + function parseJSDocEntityName() { + let entity = parseJSDocIdentifierName(); + if (parseOptional( + 23 + /* OpenBracketToken */ + )) { + parseExpected( + 24 + /* CloseBracketToken */ + ); + } + while (parseOptional( + 25 + /* DotToken */ + )) { + const name2 = parseJSDocIdentifierName(); + if (parseOptional( + 23 + /* OpenBracketToken */ + )) { + parseExpected( + 24 + /* CloseBracketToken */ + ); + } + entity = createQualifiedName(entity, name2); + } + return entity; + } + function parseJSDocIdentifierName(message) { + if (!tokenIsIdentifierOrKeyword(token())) { + return createMissingNode( + 80, + /*reportAtCurrentPosition*/ + !message, + message || Diagnostics.Identifier_expected + ); + } + identifierCount++; + const start2 = scanner2.getTokenStart(); + const end2 = scanner2.getTokenEnd(); + const originalKeywordKind = token(); + const text = internIdentifier(scanner2.getTokenValue()); + const result22 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2); + nextTokenJSDoc(); + return result22; + } + } + })(JSDocParser = Parser22.JSDocParser || (Parser22.JSDocParser = {})); + })(Parser7 || (Parser7 = {})); + ((IncrementalParser2) => { + function updateSourceFile2(sourceFile, newText, textChangeRange, aggressiveChecks) { + aggressiveChecks = aggressiveChecks || Debug.shouldAssert( + 2 + /* Aggressive */ + ); + checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); + if (textChangeRangeIsUnchanged(textChangeRange)) { + return sourceFile; + } + if (sourceFile.statements.length === 0) { + return Parser7.parseSourceFile( + sourceFile.fileName, + newText, + sourceFile.languageVersion, + /*syntaxCursor*/ + void 0, + /*setParentNodes*/ + true, + sourceFile.scriptKind, + sourceFile.setExternalModuleIndicator, + sourceFile.jsDocParsingMode + ); + } + const incrementalSourceFile = sourceFile; + Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); + incrementalSourceFile.hasBeenIncrementallyParsed = true; + Parser7.fixupParentReferences(incrementalSourceFile); + const oldText = sourceFile.text; + const syntaxCursor = createSyntaxCursor(sourceFile); + const changeRange = extendToAffectedRange(sourceFile, textChangeRange); + checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); + Debug.assert(changeRange.span.start <= textChangeRange.span.start); + Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); + Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); + const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; + updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, textSpanEnd(changeRange.span), textSpanEnd(textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); + const result2 = Parser7.parseSourceFile( + sourceFile.fileName, + newText, + sourceFile.languageVersion, + syntaxCursor, + /*setParentNodes*/ + true, + sourceFile.scriptKind, + sourceFile.setExternalModuleIndicator, + sourceFile.jsDocParsingMode + ); + result2.commentDirectives = getNewCommentDirectives( + sourceFile.commentDirectives, + result2.commentDirectives, + changeRange.span.start, + textSpanEnd(changeRange.span), + delta, + oldText, + newText, + aggressiveChecks + ); + result2.impliedNodeFormat = sourceFile.impliedNodeFormat; + return result2; + } + IncrementalParser2.updateSourceFile = updateSourceFile2; + function getNewCommentDirectives(oldDirectives, newDirectives, changeStart, changeRangeOldEnd, delta, oldText, newText, aggressiveChecks) { + if (!oldDirectives) + return newDirectives; + let commentDirectives; + let addedNewlyScannedDirectives = false; + for (const directive of oldDirectives) { + const { range: range2, type: type3 } = directive; + if (range2.end < changeStart) { + commentDirectives = append(commentDirectives, directive); + } else if (range2.pos > changeRangeOldEnd) { + addNewlyScannedDirectives(); + const updatedDirective = { + range: { pos: range2.pos + delta, end: range2.end + delta }, + type: type3 + }; + commentDirectives = append(commentDirectives, updatedDirective); + if (aggressiveChecks) { + Debug.assert(oldText.substring(range2.pos, range2.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end)); + } + } + } + addNewlyScannedDirectives(); + return commentDirectives; + function addNewlyScannedDirectives() { + if (addedNewlyScannedDirectives) + return; + addedNewlyScannedDirectives = true; + if (!commentDirectives) { + commentDirectives = newDirectives; + } else if (newDirectives) { + commentDirectives.push(...newDirectives); + } + } + } + function moveElementEntirelyPastChangeRange(element, isArray22, delta, oldText, newText, aggressiveChecks) { + if (isArray22) { + visitArray2(element); + } else { + visitNode3(element); + } + return; + function visitNode3(node) { + let text = ""; + if (aggressiveChecks && shouldCheckNode(node)) { + text = oldText.substring(node.pos, node.end); + } + if (node._children) { + node._children = void 0; + } + setTextRangePosEnd(node, node.pos + delta, node.end + delta); + if (aggressiveChecks && shouldCheckNode(node)) { + Debug.assert(text === newText.substring(node.pos, node.end)); + } + forEachChild(node, visitNode3, visitArray2); + if (hasJSDocNodes(node)) { + for (const jsDocComment of node.jsDoc) { + visitNode3(jsDocComment); + } + } + checkNodePositions(node, aggressiveChecks); + } + function visitArray2(array) { + array._children = void 0; + setTextRangePosEnd(array, array.pos + delta, array.end + delta); + for (const node of array) { + visitNode3(node); + } + } + } + function shouldCheckNode(node) { + switch (node.kind) { + case 11: + case 9: + case 80: + return true; + } + return false; + } + function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { + Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); + Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); + Debug.assert(element.pos <= element.end); + const pos = Math.min(element.pos, changeRangeNewEnd); + const end = element.end >= changeRangeOldEnd ? ( + // Element ends after the change range. Always adjust the end pos. + element.end + delta + ) : ( + // Element ends in the change range. The element will keep its position if + // possible. Or Move backward to the new-end if it's in the 'Y' range. + Math.min(element.end, changeRangeNewEnd) + ); + Debug.assert(pos <= end); + if (element.parent) { + Debug.assertGreaterThanOrEqual(pos, element.parent.pos); + Debug.assertLessThanOrEqual(end, element.parent.end); + } + setTextRangePosEnd(element, pos, end); + } + function checkNodePositions(node, aggressiveChecks) { + if (aggressiveChecks) { + let pos = node.pos; + const visitNode3 = (child) => { + Debug.assert(child.pos >= pos); + pos = child.end; + }; + if (hasJSDocNodes(node)) { + for (const jsDocComment of node.jsDoc) { + visitNode3(jsDocComment); + } + } + forEachChild(node, visitNode3); + Debug.assert(pos <= node.end); + } + } + function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { + visitNode3(sourceFile); + return; + function visitNode3(child) { + Debug.assert(child.pos <= child.end); + if (child.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange( + child, + /*isArray*/ + false, + delta, + oldText, + newText, + aggressiveChecks + ); + return; + } + const fullEnd = child.end; + if (fullEnd >= changeStart) { + child.intersectsChange = true; + child._children = void 0; + adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + forEachChild(child, visitNode3, visitArray2); + if (hasJSDocNodes(child)) { + for (const jsDocComment of child.jsDoc) { + visitNode3(jsDocComment); + } + } + checkNodePositions(child, aggressiveChecks); + return; + } + Debug.assert(fullEnd < changeStart); + } + function visitArray2(array) { + Debug.assert(array.pos <= array.end); + if (array.pos > changeRangeOldEnd) { + moveElementEntirelyPastChangeRange( + array, + /*isArray*/ + true, + delta, + oldText, + newText, + aggressiveChecks + ); + return; + } + const fullEnd = array.end; + if (fullEnd >= changeStart) { + array.intersectsChange = true; + array._children = void 0; + adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); + for (const node of array) { + visitNode3(node); + } + return; + } + Debug.assert(fullEnd < changeStart); + } + } + function extendToAffectedRange(sourceFile, changeRange) { + const maxLookahead = 1; + let start = changeRange.span.start; + for (let i7 = 0; start > 0 && i7 <= maxLookahead; i7++) { + const nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); + Debug.assert(nearestNode.pos <= start); + const position = nearestNode.pos; + start = Math.max(0, position - 1); + } + const finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span)); + const finalLength = changeRange.newLength + (changeRange.span.start - start); + return createTextChangeRange(finalSpan, finalLength); + } + function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { + let bestResult = sourceFile; + let lastNodeEntirelyBeforePosition; + forEachChild(sourceFile, visit7); + if (lastNodeEntirelyBeforePosition) { + const lastChildOfLastEntireNodeBeforePosition = getLastDescendant(lastNodeEntirelyBeforePosition); + if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { + bestResult = lastChildOfLastEntireNodeBeforePosition; + } + } + return bestResult; + function getLastDescendant(node) { + while (true) { + const lastChild = getLastChild(node); + if (lastChild) { + node = lastChild; + } else { + return node; + } + } + } + function visit7(child) { + if (nodeIsMissing(child)) { + return; + } + if (child.pos <= position) { + if (child.pos >= bestResult.pos) { + bestResult = child; + } + if (position < child.end) { + forEachChild(child, visit7); + return true; + } else { + Debug.assert(child.end <= position); + lastNodeEntirelyBeforePosition = child; + } + } else { + Debug.assert(child.pos > position); + return true; + } + } + } + function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { + const oldText = sourceFile.text; + if (textChangeRange) { + Debug.assert(oldText.length - textChangeRange.span.length + textChangeRange.newLength === newText.length); + if (aggressiveChecks || Debug.shouldAssert( + 3 + /* VeryAggressive */ + )) { + const oldTextPrefix = oldText.substr(0, textChangeRange.span.start); + const newTextPrefix = newText.substr(0, textChangeRange.span.start); + Debug.assert(oldTextPrefix === newTextPrefix); + const oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length); + const newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length); + Debug.assert(oldTextSuffix === newTextSuffix); + } + } + } + function createSyntaxCursor(sourceFile) { + let currentArray = sourceFile.statements; + let currentArrayIndex = 0; + Debug.assert(currentArrayIndex < currentArray.length); + let current = currentArray[currentArrayIndex]; + let lastQueriedPosition = -1; + return { + currentNode(position) { + if (position !== lastQueriedPosition) { + if (current && current.end === position && currentArrayIndex < currentArray.length - 1) { + currentArrayIndex++; + current = currentArray[currentArrayIndex]; + } + if (!current || current.pos !== position) { + findHighestListElementThatStartsAtPosition(position); + } + } + lastQueriedPosition = position; + Debug.assert(!current || current.pos === position); + return current; + } + }; + function findHighestListElementThatStartsAtPosition(position) { + currentArray = void 0; + currentArrayIndex = -1; + current = void 0; + forEachChild(sourceFile, visitNode3, visitArray2); + return; + function visitNode3(node) { + if (position >= node.pos && position < node.end) { + forEachChild(node, visitNode3, visitArray2); + return true; + } + return false; + } + function visitArray2(array) { + if (position >= array.pos && position < array.end) { + for (let i7 = 0; i7 < array.length; i7++) { + const child = array[i7]; + if (child) { + if (child.pos === position) { + currentArray = array; + currentArrayIndex = i7; + current = child; + return true; + } else { + if (child.pos < position && position < child.end) { + forEachChild(child, visitNode3, visitArray2); + return true; + } + } + } + } + } + return false; + } + } + } + IncrementalParser2.createSyntaxCursor = createSyntaxCursor; + let InvalidPosition; + ((InvalidPosition2) => { + InvalidPosition2[InvalidPosition2["Value"] = -1] = "Value"; + })(InvalidPosition || (InvalidPosition = {})); + })(IncrementalParser || (IncrementalParser = {})); + namedArgRegExCache = /* @__PURE__ */ new Map(); + tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; + singleLinePragmaRegEx = /^\/\/\/?\s*@([^\s:]+)(.*)\s*$/im; + } + }); + function createOptionNameMap(optionDeclarations2) { + const optionsNameMap = /* @__PURE__ */ new Map(); + const shortOptionNames = /* @__PURE__ */ new Map(); + forEach4(optionDeclarations2, (option) => { + optionsNameMap.set(option.name.toLowerCase(), option); + if (option.shortName) { + shortOptionNames.set(option.shortName, option.name); + } + }); + return { optionsNameMap, shortOptionNames }; + } + function getOptionsNameMap() { + return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(optionDeclarations)); + } + function createCompilerDiagnosticForInvalidCustomType(opt) { + return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic); + } + function createDiagnosticForInvalidCustomType(opt, createDiagnostic) { + const namesOfType = arrayFrom(opt.type.keys()); + const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k6) => !opt.deprecatedKeys.has(k6)) : namesOfType).map((key) => `'${key}'`).join(", "); + return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames); + } + function parseCustomTypeOption(opt, value2, errors) { + return convertJsonOptionOfCustomType(opt, (value2 ?? "").trim(), errors); + } + function parseListTypeOption(opt, value2 = "", errors) { + value2 = value2.trim(); + if (startsWith2(value2, "-")) { + return void 0; + } + if (opt.type === "listOrElement" && !value2.includes(",")) { + return validateJsonOptionValue(opt, value2, errors); + } + if (value2 === "") { + return []; + } + const values2 = value2.split(","); + switch (opt.element.type) { + case "number": + return mapDefined(values2, (v8) => validateJsonOptionValue(opt.element, parseInt(v8), errors)); + case "string": + return mapDefined(values2, (v8) => validateJsonOptionValue(opt.element, v8 || "", errors)); + case "boolean": + case "object": + return Debug.fail(`List of ${opt.element.type} is not yet supported.`); + default: + return mapDefined(values2, (v8) => parseCustomTypeOption(opt.element, v8, errors)); + } + } + function getOptionName(option) { + return option.name; + } + function createUnknownOptionError(unknownOption, diagnostics, unknownOptionErrorText, node, sourceFile) { + var _a2; + if ((_a2 = diagnostics.alternateMode) == null ? void 0 : _a2.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) { + return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.alternateMode.diagnostic, unknownOption); + } + const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName); + return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption); + } + function parseCommandLineWorker(diagnostics, commandLine, readFile2) { + const options = {}; + let watchOptions; + const fileNames = []; + const errors = []; + parseStrings(commandLine); + return { + options, + watchOptions, + fileNames, + errors + }; + function parseStrings(args) { + let i7 = 0; + while (i7 < args.length) { + const s7 = args[i7]; + i7++; + if (s7.charCodeAt(0) === 64) { + parseResponseFile(s7.slice(1)); + } else if (s7.charCodeAt(0) === 45) { + const inputOptionName = s7.slice(s7.charCodeAt(1) === 45 ? 2 : 1); + const opt = getOptionDeclarationFromName( + diagnostics.getOptionsNameMap, + inputOptionName, + /*allowShort*/ + true + ); + if (opt) { + i7 = parseOptionValue(args, i7, diagnostics, opt, options, errors); + } else { + const watchOpt = getOptionDeclarationFromName( + watchOptionsDidYouMeanDiagnostics.getOptionsNameMap, + inputOptionName, + /*allowShort*/ + true + ); + if (watchOpt) { + i7 = parseOptionValue(args, i7, watchOptionsDidYouMeanDiagnostics, watchOpt, watchOptions || (watchOptions = {}), errors); + } else { + errors.push(createUnknownOptionError(inputOptionName, diagnostics, s7)); + } + } + } else { + fileNames.push(s7); + } + } + } + function parseResponseFile(fileName) { + const text = tryReadFile(fileName, readFile2 || ((fileName2) => sys.readFile(fileName2))); + if (!isString4(text)) { + errors.push(text); + return; + } + const args = []; + let pos = 0; + while (true) { + while (pos < text.length && text.charCodeAt(pos) <= 32) + pos++; + if (pos >= text.length) + break; + const start = pos; + if (text.charCodeAt(start) === 34) { + pos++; + while (pos < text.length && text.charCodeAt(pos) !== 34) + pos++; + if (pos < text.length) { + args.push(text.substring(start + 1, pos)); + pos++; + } else { + errors.push(createCompilerDiagnostic(Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); + } + } else { + while (text.charCodeAt(pos) > 32) + pos++; + args.push(text.substring(start, pos)); + } + } + parseStrings(args); + } + } + function parseOptionValue(args, i7, diagnostics, opt, options, errors) { + if (opt.isTSConfigOnly) { + const optValue = args[i7]; + if (optValue === "null") { + options[opt.name] = void 0; + i7++; + } else if (opt.type === "boolean") { + if (optValue === "false") { + options[opt.name] = validateJsonOptionValue( + opt, + /*value*/ + false, + errors + ); + i7++; + } else { + if (optValue === "true") + i7++; + errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line, opt.name)); + } + } else { + errors.push(createCompilerDiagnostic(Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line, opt.name)); + if (optValue && !startsWith2(optValue, "-")) + i7++; + } + } else { + if (!args[i7] && opt.type !== "boolean") { + errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt))); + } + if (args[i7] !== "null") { + switch (opt.type) { + case "number": + options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i7]), errors); + i7++; + break; + case "boolean": + const optValue = args[i7]; + options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors); + if (optValue === "false" || optValue === "true") { + i7++; + } + break; + case "string": + options[opt.name] = validateJsonOptionValue(opt, args[i7] || "", errors); + i7++; + break; + case "list": + const result2 = parseListTypeOption(opt, args[i7], errors); + options[opt.name] = result2 || []; + if (result2) { + i7++; + } + break; + case "listOrElement": + Debug.fail("listOrElement not supported here"); + break; + default: + options[opt.name] = parseCustomTypeOption(opt, args[i7], errors); + i7++; + break; + } + } else { + options[opt.name] = void 0; + i7++; + } + } + return i7; + } + function parseCommandLine(commandLine, readFile2) { + return parseCommandLineWorker(compilerOptionsDidYouMeanDiagnostics, commandLine, readFile2); + } + function getOptionFromName(optionName, allowShort) { + return getOptionDeclarationFromName(getOptionsNameMap, optionName, allowShort); + } + function getOptionDeclarationFromName(getOptionNameMap, optionName, allowShort = false) { + optionName = optionName.toLowerCase(); + const { optionsNameMap, shortOptionNames } = getOptionNameMap(); + if (allowShort) { + const short = shortOptionNames.get(optionName); + if (short !== void 0) { + optionName = short; + } + } + return optionsNameMap.get(optionName); + } + function getBuildOptionsNameMap() { + return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(buildOpts)); + } + function parseBuildCommand(args) { + const { options, watchOptions, fileNames: projects, errors } = parseCommandLineWorker( + buildOptionsDidYouMeanDiagnostics, + args + ); + const buildOptions2 = options; + if (projects.length === 0) { + projects.push("."); + } + if (buildOptions2.clean && buildOptions2.force) { + errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "force")); + } + if (buildOptions2.clean && buildOptions2.verbose) { + errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "verbose")); + } + if (buildOptions2.clean && buildOptions2.watch) { + errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "clean", "watch")); + } + if (buildOptions2.watch && buildOptions2.dry) { + errors.push(createCompilerDiagnostic(Diagnostics.Options_0_and_1_cannot_be_combined, "watch", "dry")); + } + return { buildOptions: buildOptions2, watchOptions, projects, errors }; + } + function getDiagnosticText(message, ...args) { + return cast(createCompilerDiagnostic(message, ...args).messageText, isString4); + } + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend, extraFileExtensions) { + const configFileText = tryReadFile(configFileName, (fileName) => host.readFile(fileName)); + if (!isString4(configFileText)) { + host.onUnRecoverableConfigFileDiagnostic(configFileText); + return void 0; + } + const result2 = parseJsonText(configFileName, configFileText); + const cwd3 = host.getCurrentDirectory(); + result2.path = toPath2(configFileName, cwd3, createGetCanonicalFileName(host.useCaseSensitiveFileNames)); + result2.resolvedPath = result2.path; + result2.originalFileName = result2.fileName; + return parseJsonSourceFileConfigFileContent( + result2, + host, + getNormalizedAbsolutePath(getDirectoryPath(configFileName), cwd3), + optionsToExtend, + getNormalizedAbsolutePath(configFileName, cwd3), + /*resolutionStack*/ + void 0, + extraFileExtensions, + extendedConfigCache, + watchOptionsToExtend + ); + } + function readConfigFile(fileName, readFile2) { + const textOrDiagnostic = tryReadFile(fileName, readFile2); + return isString4(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic }; + } + function parseConfigFileTextToJson(fileName, jsonText) { + const jsonSourceFile = parseJsonText(fileName, jsonText); + return { + config: convertConfigFileToObject( + jsonSourceFile, + jsonSourceFile.parseDiagnostics, + /*jsonConversionNotifier*/ + void 0 + ), + error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0 + }; + } + function readJsonConfigFile(fileName, readFile2) { + const textOrDiagnostic = tryReadFile(fileName, readFile2); + return isString4(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : { fileName, parseDiagnostics: [textOrDiagnostic] }; + } + function tryReadFile(fileName, readFile2) { + let text; + try { + text = readFile2(fileName); + } catch (e10) { + return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e10.message); + } + return text === void 0 ? createCompilerDiagnostic(Diagnostics.Cannot_read_file_0, fileName) : text; + } + function commandLineOptionsToMap(options) { + return arrayToMap(options, getOptionName); + } + function getWatchOptionsNameMap() { + return watchOptionsNameMapCache || (watchOptionsNameMapCache = createOptionNameMap(optionsForWatch)); + } + function getCommandLineCompilerOptionsMap() { + return commandLineCompilerOptionsMapCache || (commandLineCompilerOptionsMapCache = commandLineOptionsToMap(optionDeclarations)); + } + function getCommandLineWatchOptionsMap() { + return commandLineWatchOptionsMapCache || (commandLineWatchOptionsMapCache = commandLineOptionsToMap(optionsForWatch)); + } + function getCommandLineTypeAcquisitionMap() { + return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations)); + } + function getTsconfigRootOptionsMap() { + if (_tsconfigRootOptions === void 0) { + _tsconfigRootOptions = { + name: void 0, + // should never be needed since this is root + type: "object", + elementOptions: commandLineOptionsToMap([ + compilerOptionsDeclaration, + watchOptionsDeclaration, + typeAcquisitionDeclaration, + extendsOptionDeclaration, + { + name: "references", + type: "list", + element: { + name: "references", + type: "object" + }, + category: Diagnostics.Projects + }, + { + name: "files", + type: "list", + element: { + name: "files", + type: "string" + }, + category: Diagnostics.File_Management + }, + { + name: "include", + type: "list", + element: { + name: "include", + type: "string" + }, + category: Diagnostics.File_Management, + defaultValueDescription: Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk + }, + { + name: "exclude", + type: "list", + element: { + name: "exclude", + type: "string" + }, + category: Diagnostics.File_Management, + defaultValueDescription: Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified + }, + compileOnSaveCommandLineOption + ]) + }; + } + return _tsconfigRootOptions; + } + function convertConfigFileToObject(sourceFile, errors, jsonConversionNotifier) { + var _a2; + const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression; + if (rootExpression && rootExpression.kind !== 210) { + errors.push(createDiagnosticForNodeInSourceFile( + sourceFile, + rootExpression, + Diagnostics.The_root_value_of_a_0_file_must_be_an_object, + getBaseFileName(sourceFile.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json" + )); + if (isArrayLiteralExpression(rootExpression)) { + const firstObject = find2(rootExpression.elements, isObjectLiteralExpression); + if (firstObject) { + return convertToJson( + sourceFile, + firstObject, + errors, + /*returnValue*/ + true, + jsonConversionNotifier + ); + } + } + return {}; + } + return convertToJson( + sourceFile, + rootExpression, + errors, + /*returnValue*/ + true, + jsonConversionNotifier + ); + } + function convertToObject(sourceFile, errors) { + var _a2; + return convertToJson( + sourceFile, + (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression, + errors, + /*returnValue*/ + true, + /*jsonConversionNotifier*/ + void 0 + ); + } + function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConversionNotifier) { + if (!rootExpression) { + return returnValue ? {} : void 0; + } + return convertPropertyValueToJson(rootExpression, jsonConversionNotifier == null ? void 0 : jsonConversionNotifier.rootOptions); + function convertObjectLiteralExpressionToJson(node, objectOption) { + var _a2; + const result2 = returnValue ? {} : void 0; + for (const element of node.properties) { + if (element.kind !== 303) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); + continue; + } + if (element.questionToken) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); + } + if (!isDoubleQuotedString(element.name)) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, Diagnostics.String_literal_with_double_quotes_expected)); + } + const textOfKey = isComputedNonLiteralName(element.name) ? void 0 : getTextOfPropertyName(element.name); + const keyText = textOfKey && unescapeLeadingUnderscores(textOfKey); + const option = keyText ? (_a2 = objectOption == null ? void 0 : objectOption.elementOptions) == null ? void 0 : _a2.get(keyText) : void 0; + const value2 = convertPropertyValueToJson(element.initializer, option); + if (typeof keyText !== "undefined") { + if (returnValue) { + result2[keyText] = value2; + } + jsonConversionNotifier == null ? void 0 : jsonConversionNotifier.onPropertySet(keyText, value2, element, objectOption, option); + } + } + return result2; + } + function convertArrayLiteralExpressionToJson(elements, elementOption) { + if (!returnValue) { + elements.forEach((element) => convertPropertyValueToJson(element, elementOption)); + return void 0; + } + return filter2(elements.map((element) => convertPropertyValueToJson(element, elementOption)), (v8) => v8 !== void 0); + } + function convertPropertyValueToJson(valueExpression, option) { + switch (valueExpression.kind) { + case 112: + return true; + case 97: + return false; + case 106: + return null; + case 11: + if (!isDoubleQuotedString(valueExpression)) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected)); + } + return valueExpression.text; + case 9: + return Number(valueExpression.text); + case 224: + if (valueExpression.operator !== 41 || valueExpression.operand.kind !== 9) { + break; + } + return -Number(valueExpression.operand.text); + case 210: + const objectLiteralExpression = valueExpression; + return convertObjectLiteralExpressionToJson(objectLiteralExpression, option); + case 209: + return convertArrayLiteralExpressionToJson( + valueExpression.elements, + option && option.element + ); + } + if (option) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Compiler_option_0_requires_a_value_of_type_1, option.name, getCompilerOptionValueTypeString(option))); + } else { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)); + } + return void 0; + } + function isDoubleQuotedString(node) { + return isStringLiteral(node) && isStringDoubleQuoted(node, sourceFile); + } + } + function getCompilerOptionValueTypeString(option) { + return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString4(option.type) ? option.type : "string"; + } + function isCompilerOptionsValue(option, value2) { + if (option) { + if (isNullOrUndefined2(value2)) + return !option.disallowNullOrUndefined; + if (option.type === "list") { + return isArray3(value2); + } + if (option.type === "listOrElement") { + return isArray3(value2) || isCompilerOptionsValue(option.element, value2); + } + const expectedType = isString4(option.type) ? option.type : "string"; + return typeof value2 === expectedType; + } + return false; + } + function convertToTSConfig(configParseResult, configFileName, host) { + var _a2, _b, _c; + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); + const files = map4( + filter2( + configParseResult.fileNames, + !((_b = (_a2 = configParseResult.options.configFile) == null ? void 0 : _a2.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs) ? returnTrue : matchesSpecs( + configFileName, + configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs, + configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs, + host + ) + ), + (f8) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f8, host.getCurrentDirectory()), getCanonicalFileName) + ); + const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames }; + const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions); + const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions); + const config3 = { + compilerOptions: { + ...optionMapToObject(optionMap), + showConfig: void 0, + configFile: void 0, + configFilePath: void 0, + help: void 0, + init: void 0, + listFiles: void 0, + listEmittedFiles: void 0, + project: void 0, + build: void 0, + version: void 0 + }, + watchOptions: watchOptionMap && optionMapToObject(watchOptionMap), + references: map4(configParseResult.projectReferences, (r8) => ({ ...r8, path: r8.originalPath ? r8.originalPath : "", originalPath: void 0 })), + files: length(files) ? files : void 0, + ...((_c = configParseResult.options.configFile) == null ? void 0 : _c.configFileSpecs) ? { + include: filterSameAsDefaultInclude(configParseResult.options.configFile.configFileSpecs.validatedIncludeSpecs), + exclude: configParseResult.options.configFile.configFileSpecs.validatedExcludeSpecs + } : {}, + compileOnSave: !!configParseResult.compileOnSave ? true : void 0 + }; + const providedKeys = new Set(optionMap.keys()); + const impliedCompilerOptions = {}; + for (const option in computedOptions) { + if (!providedKeys.has(option) && some2(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) { + const implied = computedOptions[option].computeValue(configParseResult.options); + const defaultValue = computedOptions[option].computeValue({}); + if (implied !== defaultValue) { + impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options); + } + } + } + assign3(config3.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions))); + return config3; + } + function optionMapToObject(optionMap) { + return { + ...arrayFrom(optionMap.entries()).reduce((prev, cur) => ({ ...prev, [cur[0]]: cur[1] }), {}) + }; + } + function filterSameAsDefaultInclude(specs10) { + if (!length(specs10)) + return void 0; + if (length(specs10) !== 1) + return specs10; + if (specs10[0] === defaultIncludeSpec) + return void 0; + return specs10; + } + function matchesSpecs(path2, includeSpecs, excludeSpecs, host) { + if (!includeSpecs) + return returnTrue; + const patterns = getFileMatcherPatterns(path2, excludeSpecs, includeSpecs, host.useCaseSensitiveFileNames, host.getCurrentDirectory()); + const excludeRe = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, host.useCaseSensitiveFileNames); + const includeRe = patterns.includeFilePattern && getRegexFromPattern(patterns.includeFilePattern, host.useCaseSensitiveFileNames); + if (includeRe) { + if (excludeRe) { + return (path22) => !(includeRe.test(path22) && !excludeRe.test(path22)); + } + return (path22) => !includeRe.test(path22); + } + if (excludeRe) { + return (path22) => excludeRe.test(path22); + } + return returnTrue; + } + function getCustomTypeMapOfCommandLineOption(optionDefinition) { + switch (optionDefinition.type) { + case "string": + case "number": + case "boolean": + case "object": + return void 0; + case "list": + case "listOrElement": + return getCustomTypeMapOfCommandLineOption(optionDefinition.element); + default: + return optionDefinition.type; + } + } + function getNameOfCompilerOptionValue(value2, customTypeMap) { + return forEachEntry(customTypeMap, (mapValue, key) => { + if (mapValue === value2) { + return key; + } + }); + } + function serializeCompilerOptions(options, pathOptions) { + return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions); + } + function serializeWatchOptions(options) { + return serializeOptionBaseObject(options, getWatchOptionsNameMap()); + } + function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) { + const result2 = /* @__PURE__ */ new Map(); + const getCanonicalFileName = pathOptions && createGetCanonicalFileName(pathOptions.useCaseSensitiveFileNames); + for (const name2 in options) { + if (hasProperty(options, name2)) { + if (optionsNameMap.has(name2) && (optionsNameMap.get(name2).category === Diagnostics.Command_line_Options || optionsNameMap.get(name2).category === Diagnostics.Output_Formatting)) { + continue; + } + const value2 = options[name2]; + const optionDefinition = optionsNameMap.get(name2.toLowerCase()); + if (optionDefinition) { + Debug.assert(optionDefinition.type !== "listOrElement"); + const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition); + if (!customTypeMap) { + if (pathOptions && optionDefinition.isFilePath) { + result2.set(name2, getRelativePathFromFile(pathOptions.configFilePath, getNormalizedAbsolutePath(value2, getDirectoryPath(pathOptions.configFilePath)), getCanonicalFileName)); + } else { + result2.set(name2, value2); + } + } else { + if (optionDefinition.type === "list") { + result2.set(name2, value2.map((element) => getNameOfCompilerOptionValue(element, customTypeMap))); + } else { + result2.set(name2, getNameOfCompilerOptionValue(value2, customTypeMap)); + } + } + } + } + } + return result2; + } + function getCompilerOptionsDiffValue(options, newLine) { + const compilerOptionsMap = getSerializedCompilerOption(options); + return getOverwrittenDefaultOptions(); + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function getOverwrittenDefaultOptions() { + const result2 = []; + const tab = makePadding(2); + commandOptionsWithoutBuild.forEach((cmd) => { + if (!compilerOptionsMap.has(cmd.name)) { + return; + } + const newValue = compilerOptionsMap.get(cmd.name); + const defaultValue = getDefaultValueForOption(cmd); + if (newValue !== defaultValue) { + result2.push(`${tab}${cmd.name}: ${newValue}`); + } else if (hasProperty(defaultInitCompilerOptions, cmd.name)) { + result2.push(`${tab}${cmd.name}: ${defaultValue}`); + } + }); + return result2.join(newLine) + newLine; + } + } + function getSerializedCompilerOption(options) { + const compilerOptions = extend3(options, defaultInitCompilerOptions); + return serializeCompilerOptions(compilerOptions); + } + function generateTSConfig(options, fileNames, newLine) { + const compilerOptionsMap = getSerializedCompilerOption(options); + return writeConfigurations(); + function makePadding(paddingLength) { + return Array(paddingLength + 1).join(" "); + } + function isAllowedOptionForOutput({ category, name: name2, isCommandLineOnly }) { + const categoriesToSkip = [Diagnostics.Command_line_Options, Diagnostics.Editor_Support, Diagnostics.Compiler_Diagnostics, Diagnostics.Backwards_Compatibility, Diagnostics.Watch_and_Build_Modes, Diagnostics.Output_Formatting]; + return !isCommandLineOnly && category !== void 0 && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name2)); + } + function writeConfigurations() { + const categorizedOptions = /* @__PURE__ */ new Map(); + categorizedOptions.set(Diagnostics.Projects, []); + categorizedOptions.set(Diagnostics.Language_and_Environment, []); + categorizedOptions.set(Diagnostics.Modules, []); + categorizedOptions.set(Diagnostics.JavaScript_Support, []); + categorizedOptions.set(Diagnostics.Emit, []); + categorizedOptions.set(Diagnostics.Interop_Constraints, []); + categorizedOptions.set(Diagnostics.Type_Checking, []); + categorizedOptions.set(Diagnostics.Completeness, []); + for (const option of optionDeclarations) { + if (isAllowedOptionForOutput(option)) { + let listForCategory = categorizedOptions.get(option.category); + if (!listForCategory) + categorizedOptions.set(option.category, listForCategory = []); + listForCategory.push(option); + } + } + let marginLength = 0; + let seenKnownKeys = 0; + const entries = []; + categorizedOptions.forEach((options2, category) => { + if (entries.length !== 0) { + entries.push({ value: "" }); + } + entries.push({ value: `/* ${getLocaleSpecificMessage(category)} */` }); + for (const option of options2) { + let optionName; + if (compilerOptionsMap.has(option.name)) { + optionName = `"${option.name}": ${JSON.stringify(compilerOptionsMap.get(option.name))}${(seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ","}`; + } else { + optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`; + } + entries.push({ + value: optionName, + description: `/* ${option.description && getLocaleSpecificMessage(option.description) || option.name} */` + }); + marginLength = Math.max(optionName.length, marginLength); + } + }); + const tab = makePadding(2); + const result2 = []; + result2.push(`{`); + result2.push(`${tab}"compilerOptions": {`); + result2.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`); + result2.push(""); + for (const entry of entries) { + const { value: value2, description: description32 = "" } = entry; + result2.push(value2 && `${tab}${tab}${value2}${description32 && makePadding(marginLength - value2.length + 2) + description32}`); + } + if (fileNames.length) { + result2.push(`${tab}},`); + result2.push(`${tab}"files": [`); + for (let i7 = 0; i7 < fileNames.length; i7++) { + result2.push(`${tab}${tab}${JSON.stringify(fileNames[i7])}${i7 === fileNames.length - 1 ? "" : ","}`); + } + result2.push(`${tab}]`); + } else { + result2.push(`${tab}}`); + } + result2.push(`}`); + return result2.join(newLine) + newLine; + } + } + function convertToOptionsWithAbsolutePaths(options, toAbsolutePath) { + const result2 = {}; + const optionsNameMap = getOptionsNameMap().optionsNameMap; + for (const name2 in options) { + if (hasProperty(options, name2)) { + result2[name2] = convertToOptionValueWithAbsolutePaths( + optionsNameMap.get(name2.toLowerCase()), + options[name2], + toAbsolutePath + ); + } + } + if (result2.configFilePath) { + result2.configFilePath = toAbsolutePath(result2.configFilePath); + } + return result2; + } + function convertToOptionValueWithAbsolutePaths(option, value2, toAbsolutePath) { + if (option && !isNullOrUndefined2(value2)) { + if (option.type === "list") { + const values2 = value2; + if (option.element.isFilePath && values2.length) { + return values2.map(toAbsolutePath); + } + } else if (option.isFilePath) { + return toAbsolutePath(value2); + } + Debug.assert(option.type !== "listOrElement"); + } + return value2; + } + function parseJsonConfigFileContent(json2, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { + return parseJsonConfigFileContentWorker( + json2, + /*sourceFile*/ + void 0, + host, + basePath, + existingOptions, + existingWatchOptions, + configFileName, + resolutionStack, + extraFileExtensions, + extendedConfigCache + ); + } + function parseJsonSourceFileConfigFileContent(sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions, extendedConfigCache, existingWatchOptions) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Parse, "parseJsonSourceFileConfigFileContent", { path: sourceFile.fileName }); + const result2 = parseJsonConfigFileContentWorker( + /*json*/ + void 0, + sourceFile, + host, + basePath, + existingOptions, + existingWatchOptions, + configFileName, + resolutionStack, + extraFileExtensions, + extendedConfigCache + ); + (_b = tracing) == null ? void 0 : _b.pop(); + return result2; + } + function setConfigFileInOptions(options, configFile) { + if (configFile) { + Object.defineProperty(options, "configFile", { enumerable: false, writable: false, value: configFile }); + } + } + function isNullOrUndefined2(x7) { + return x7 === void 0 || x7 === null; + } + function directoryOfCombinedPath(fileName, basePath) { + return getDirectoryPath(getNormalizedAbsolutePath(fileName, basePath)); + } + function parseJsonConfigFileContentWorker(json2, sourceFile, host, basePath, existingOptions = {}, existingWatchOptions, configFileName, resolutionStack = [], extraFileExtensions = [], extendedConfigCache) { + Debug.assert(json2 === void 0 && sourceFile !== void 0 || json2 !== void 0 && sourceFile === void 0); + const errors = []; + const parsedConfig = parseConfig2(json2, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache); + const { raw } = parsedConfig; + const options = extend3(existingOptions, parsedConfig.options || {}); + const watchOptions = existingWatchOptions && parsedConfig.watchOptions ? extend3(existingWatchOptions, parsedConfig.watchOptions) : parsedConfig.watchOptions || existingWatchOptions; + options.configFilePath = configFileName && normalizeSlashes(configFileName); + const configFileSpecs = getConfigFileSpecs(); + if (sourceFile) + sourceFile.configFileSpecs = configFileSpecs; + setConfigFileInOptions(options, sourceFile); + const basePathForFileNames = normalizePath(configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath); + return { + options, + watchOptions, + fileNames: getFileNames(basePathForFileNames), + projectReferences: getProjectReferences(basePathForFileNames), + typeAcquisition: parsedConfig.typeAcquisition || getDefaultTypeAcquisition(), + raw, + errors, + // Wildcard directories (provided as part of a wildcard path) are stored in a + // file map that marks whether it was a regular wildcard match (with a `*` or `?` token), + // or a recursive directory. This information is used by filesystem watchers to monitor for + // new entries in these paths. + wildcardDirectories: getWildcardDirectories(configFileSpecs, basePathForFileNames, host.useCaseSensitiveFileNames), + compileOnSave: !!raw.compileOnSave + }; + function getConfigFileSpecs() { + const referencesOfRaw = getPropFromRaw("references", (element) => typeof element === "object", "object"); + const filesSpecs = toPropValue(getSpecsFromRaw("files")); + if (filesSpecs) { + const hasZeroOrNoReferences = referencesOfRaw === "no-prop" || isArray3(referencesOfRaw) && referencesOfRaw.length === 0; + const hasExtends = hasProperty(raw, "extends"); + if (filesSpecs.length === 0 && hasZeroOrNoReferences && !hasExtends) { + if (sourceFile) { + const fileName = configFileName || "tsconfig.json"; + const diagnosticMessage = Diagnostics.The_files_list_in_config_file_0_is_empty; + const nodeValue = forEachTsConfigPropArray(sourceFile, "files", (property2) => property2.initializer); + const error22 = createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, nodeValue, diagnosticMessage, fileName); + errors.push(error22); + } else { + createCompilerDiagnosticOnlyIfJson(Diagnostics.The_files_list_in_config_file_0_is_empty, configFileName || "tsconfig.json"); + } + } + } + let includeSpecs = toPropValue(getSpecsFromRaw("include")); + const excludeOfRaw = getSpecsFromRaw("exclude"); + let isDefaultIncludeSpec = false; + let excludeSpecs = toPropValue(excludeOfRaw); + if (excludeOfRaw === "no-prop" && raw.compilerOptions) { + const outDir = raw.compilerOptions.outDir; + const declarationDir = raw.compilerOptions.declarationDir; + if (outDir || declarationDir) { + excludeSpecs = [outDir, declarationDir].filter((d7) => !!d7); + } + } + if (filesSpecs === void 0 && includeSpecs === void 0) { + includeSpecs = [defaultIncludeSpec]; + isDefaultIncludeSpec = true; + } + let validatedIncludeSpecs, validatedExcludeSpecs; + if (includeSpecs) { + validatedIncludeSpecs = validateSpecs( + includeSpecs, + errors, + /*disallowTrailingRecursion*/ + true, + sourceFile, + "include" + ); + } + if (excludeSpecs) { + validatedExcludeSpecs = validateSpecs( + excludeSpecs, + errors, + /*disallowTrailingRecursion*/ + false, + sourceFile, + "exclude" + ); + } + return { + filesSpecs, + includeSpecs, + excludeSpecs, + validatedFilesSpec: filter2(filesSpecs, isString4), + validatedIncludeSpecs, + validatedExcludeSpecs, + pathPatterns: void 0, + // Initialized on first use + isDefaultIncludeSpec + }; + } + function getFileNames(basePath2) { + const fileNames = getFileNamesFromConfigSpecs(configFileSpecs, basePath2, options, host, extraFileExtensions); + if (shouldReportNoInputFiles(fileNames, canJsonReportNoInputFiles(raw), resolutionStack)) { + errors.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); + } + return fileNames; + } + function getProjectReferences(basePath2) { + let projectReferences; + const referencesOfRaw = getPropFromRaw("references", (element) => typeof element === "object", "object"); + if (isArray3(referencesOfRaw)) { + for (const ref of referencesOfRaw) { + if (typeof ref.path !== "string") { + createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "reference.path", "string"); + } else { + (projectReferences || (projectReferences = [])).push({ + path: getNormalizedAbsolutePath(ref.path, basePath2), + originalPath: ref.path, + prepend: ref.prepend, + circular: ref.circular + }); + } + } + } + return projectReferences; + } + function toPropValue(specResult) { + return isArray3(specResult) ? specResult : void 0; + } + function getSpecsFromRaw(prop) { + return getPropFromRaw(prop, isString4, "string"); + } + function getPropFromRaw(prop, validateElement, elementTypeName) { + if (hasProperty(raw, prop) && !isNullOrUndefined2(raw[prop])) { + if (isArray3(raw[prop])) { + const result2 = raw[prop]; + if (!sourceFile && !every2(result2, validateElement)) { + errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, elementTypeName)); + } + return result2; + } else { + createCompilerDiagnosticOnlyIfJson(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, prop, "Array"); + return "not-array"; + } + } + return "no-prop"; + } + function createCompilerDiagnosticOnlyIfJson(message, ...args) { + if (!sourceFile) { + errors.push(createCompilerDiagnostic(message, ...args)); + } + } + } + function isErrorNoInputFiles(error22) { + return error22.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; + } + function getErrorForNoInputFiles({ includeSpecs, excludeSpecs }, configFileName) { + return createCompilerDiagnostic( + Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + configFileName || "tsconfig.json", + JSON.stringify(includeSpecs || []), + JSON.stringify(excludeSpecs || []) + ); + } + function shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles, resolutionStack) { + return fileNames.length === 0 && canJsonReportNoInutFiles && (!resolutionStack || resolutionStack.length === 0); + } + function canJsonReportNoInputFiles(raw) { + return !hasProperty(raw, "files") && !hasProperty(raw, "references"); + } + function updateErrorForNoInputFiles(fileNames, configFileName, configFileSpecs, configParseDiagnostics, canJsonReportNoInutFiles) { + const existingErrors = configParseDiagnostics.length; + if (shouldReportNoInputFiles(fileNames, canJsonReportNoInutFiles)) { + configParseDiagnostics.push(getErrorForNoInputFiles(configFileSpecs, configFileName)); + } else { + filterMutate(configParseDiagnostics, (error22) => !isErrorNoInputFiles(error22)); + } + return existingErrors !== configParseDiagnostics.length; + } + function isSuccessfulParsedTsconfig(value2) { + return !!value2.options; + } + function parseConfig2(json2, sourceFile, host, basePath, configFileName, resolutionStack, errors, extendedConfigCache) { + var _a2; + basePath = normalizeSlashes(basePath); + const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath); + if (resolutionStack.includes(resolvedPath)) { + errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> "))); + return { raw: json2 || convertToObject(sourceFile, errors) }; + } + const ownConfig = json2 ? parseOwnConfigOfJson(json2, host, basePath, configFileName, errors) : parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); + if ((_a2 = ownConfig.options) == null ? void 0 : _a2.paths) { + ownConfig.options.pathsBasePath = basePath; + } + if (ownConfig.extendedConfigPath) { + resolutionStack = resolutionStack.concat([resolvedPath]); + const result2 = { options: {} }; + if (isString4(ownConfig.extendedConfigPath)) { + applyExtendedConfig(result2, ownConfig.extendedConfigPath); + } else { + ownConfig.extendedConfigPath.forEach((extendedConfigPath) => applyExtendedConfig(result2, extendedConfigPath)); + } + if (!ownConfig.raw.include && result2.include) + ownConfig.raw.include = result2.include; + if (!ownConfig.raw.exclude && result2.exclude) + ownConfig.raw.exclude = result2.exclude; + if (!ownConfig.raw.files && result2.files) + ownConfig.raw.files = result2.files; + if (ownConfig.raw.compileOnSave === void 0 && result2.compileOnSave) + ownConfig.raw.compileOnSave = result2.compileOnSave; + if (sourceFile && result2.extendedSourceFiles) + sourceFile.extendedSourceFiles = arrayFrom(result2.extendedSourceFiles.keys()); + ownConfig.options = assign3(result2.options, ownConfig.options); + ownConfig.watchOptions = ownConfig.watchOptions && result2.watchOptions ? assign3(result2.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result2.watchOptions; + } + return ownConfig; + function applyExtendedConfig(result2, extendedConfigPath) { + const extendedConfig = getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result2); + if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { + const extendsRaw = extendedConfig.raw; + let relativeDifference; + const setPropertyInResultIfNotUndefined = (propertyName) => { + if (extendsRaw[propertyName]) { + result2[propertyName] = map4(extendsRaw[propertyName], (path2) => isRootedDiskPath(path2) ? path2 : combinePaths( + relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))), + path2 + )); + } + }; + setPropertyInResultIfNotUndefined("include"); + setPropertyInResultIfNotUndefined("exclude"); + setPropertyInResultIfNotUndefined("files"); + if (extendsRaw.compileOnSave !== void 0) { + result2.compileOnSave = extendsRaw.compileOnSave; + } + assign3(result2.options, extendedConfig.options); + result2.watchOptions = result2.watchOptions && extendedConfig.watchOptions ? assign3({}, result2.watchOptions, extendedConfig.watchOptions) : result2.watchOptions || extendedConfig.watchOptions; + } + } + } + function parseOwnConfigOfJson(json2, host, basePath, configFileName, errors) { + if (hasProperty(json2, "excludes")) { + errors.push(createCompilerDiagnostic(Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); + } + const options = convertCompilerOptionsFromJsonWorker(json2.compilerOptions, basePath, errors, configFileName); + const typeAcquisition = convertTypeAcquisitionFromJsonWorker(json2.typeAcquisition, basePath, errors, configFileName); + const watchOptions = convertWatchOptionsFromJsonWorker(json2.watchOptions, basePath, errors); + json2.compileOnSave = convertCompileOnSaveOptionFromJson(json2, basePath, errors); + const extendedConfigPath = json2.extends || json2.extends === "" ? getExtendsConfigPathOrArray(json2.extends, host, basePath, configFileName, errors) : void 0; + return { raw: json2, options, watchOptions, typeAcquisition, extendedConfigPath }; + } + function getExtendsConfigPathOrArray(value2, host, basePath, configFileName, errors, propertyAssignment, valueExpression, sourceFile) { + let extendedConfigPath; + const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; + if (isString4(value2)) { + extendedConfigPath = getExtendsConfigPath( + value2, + host, + newBase, + errors, + valueExpression, + sourceFile + ); + } else if (isArray3(value2)) { + extendedConfigPath = []; + for (let index4 = 0; index4 < value2.length; index4++) { + const fileName = value2[index4]; + if (isString4(fileName)) { + extendedConfigPath = append( + extendedConfigPath, + getExtendsConfigPath( + fileName, + host, + newBase, + errors, + valueExpression == null ? void 0 : valueExpression.elements[index4], + sourceFile + ) + ); + } else { + convertJsonOption(extendsOptionDeclaration.element, value2, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index4], sourceFile); + } + } + } else { + convertJsonOption(extendsOptionDeclaration, value2, basePath, errors, propertyAssignment, valueExpression, sourceFile); + } + return extendedConfigPath; + } + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { + const options = getDefaultCompilerOptions(configFileName); + let typeAcquisition; + let watchOptions; + let extendedConfigPath; + let rootCompilerOptions; + const rootOptions = getTsconfigRootOptionsMap(); + const json2 = convertConfigFileToObject( + sourceFile, + errors, + { rootOptions, onPropertySet } + ); + if (!typeAcquisition) { + typeAcquisition = getDefaultTypeAcquisition(configFileName); + } + if (rootCompilerOptions && json2 && json2.compilerOptions === void 0) { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, rootCompilerOptions[0], Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file, getTextOfPropertyName(rootCompilerOptions[0]))); + } + return { raw: json2, options, watchOptions, typeAcquisition, extendedConfigPath }; + function onPropertySet(keyText, value2, propertyAssignment, parentOption, option) { + if (option && option !== extendsOptionDeclaration) + value2 = convertJsonOption(option, value2, basePath, errors, propertyAssignment, propertyAssignment.initializer, sourceFile); + if (parentOption == null ? void 0 : parentOption.name) { + if (option) { + let currentOption; + if (parentOption === compilerOptionsDeclaration) + currentOption = options; + else if (parentOption === watchOptionsDeclaration) + currentOption = watchOptions ?? (watchOptions = {}); + else if (parentOption === typeAcquisitionDeclaration) + currentOption = typeAcquisition ?? (typeAcquisition = getDefaultTypeAcquisition(configFileName)); + else + Debug.fail("Unknown option"); + currentOption[option.name] = value2; + } else if (keyText && (parentOption == null ? void 0 : parentOption.extraKeyDiagnostics)) { + if (parentOption.elementOptions) { + errors.push(createUnknownOptionError( + keyText, + parentOption.extraKeyDiagnostics, + /*unknownOptionErrorText*/ + void 0, + propertyAssignment.name, + sourceFile + )); + } else { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, propertyAssignment.name, parentOption.extraKeyDiagnostics.unknownOptionDiagnostic, keyText)); + } + } + } else if (parentOption === rootOptions) { + if (option === extendsOptionDeclaration) { + extendedConfigPath = getExtendsConfigPathOrArray(value2, host, basePath, configFileName, errors, propertyAssignment, propertyAssignment.initializer, sourceFile); + } else if (!option) { + if (keyText === "excludes") { + errors.push(createDiagnosticForNodeInSourceFile(sourceFile, propertyAssignment.name, Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); + } + if (find2(commandOptionsWithoutBuild, (opt) => opt.name === keyText)) { + rootCompilerOptions = append(rootCompilerOptions, propertyAssignment.name); + } + } + } + } + } + function getExtendsConfigPath(extendedConfig, host, basePath, errors, valueExpression, sourceFile) { + extendedConfig = normalizeSlashes(extendedConfig); + if (isRootedDiskPath(extendedConfig) || startsWith2(extendedConfig, "./") || startsWith2(extendedConfig, "../")) { + let extendedConfigPath = getNormalizedAbsolutePath(extendedConfig, basePath); + if (!host.fileExists(extendedConfigPath) && !endsWith2( + extendedConfigPath, + ".json" + /* Json */ + )) { + extendedConfigPath = `${extendedConfigPath}.json`; + if (!host.fileExists(extendedConfigPath)) { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.File_0_not_found, extendedConfig)); + return void 0; + } + } + return extendedConfigPath; + } + const resolved = nodeNextJsonConfigResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), host); + if (resolved.resolvedModule) { + return resolved.resolvedModule.resolvedFileName; + } + if (extendedConfig === "") { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.Compiler_option_0_cannot_be_given_an_empty_string, "extends")); + } else { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.File_0_not_found, extendedConfig)); + } + return void 0; + } + function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result2) { + const path2 = host.useCaseSensitiveFileNames ? extendedConfigPath : toFileNameLowerCase(extendedConfigPath); + let value2; + let extendedResult; + let extendedConfig; + if (extendedConfigCache && (value2 = extendedConfigCache.get(path2))) { + ({ extendedResult, extendedConfig } = value2); + } else { + extendedResult = readJsonConfigFile(extendedConfigPath, (path22) => host.readFile(path22)); + if (!extendedResult.parseDiagnostics.length) { + extendedConfig = parseConfig2( + /*json*/ + void 0, + extendedResult, + host, + getDirectoryPath(extendedConfigPath), + getBaseFileName(extendedConfigPath), + resolutionStack, + errors, + extendedConfigCache + ); + } + if (extendedConfigCache) { + extendedConfigCache.set(path2, { extendedResult, extendedConfig }); + } + } + if (sourceFile) { + (result2.extendedSourceFiles ?? (result2.extendedSourceFiles = /* @__PURE__ */ new Set())).add(extendedResult.fileName); + if (extendedResult.extendedSourceFiles) { + for (const extenedSourceFile of extendedResult.extendedSourceFiles) { + result2.extendedSourceFiles.add(extenedSourceFile); + } + } + } + if (extendedResult.parseDiagnostics.length) { + errors.push(...extendedResult.parseDiagnostics); + return void 0; + } + return extendedConfig; + } + function convertCompileOnSaveOptionFromJson(jsonOption, basePath, errors) { + if (!hasProperty(jsonOption, compileOnSaveCommandLineOption.name)) { + return false; + } + const result2 = convertJsonOption(compileOnSaveCommandLineOption, jsonOption.compileOnSave, basePath, errors); + return typeof result2 === "boolean" && result2; + } + function convertCompilerOptionsFromJson(jsonOptions, basePath, configFileName) { + const errors = []; + const options = convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options, errors }; + } + function convertTypeAcquisitionFromJson(jsonOptions, basePath, configFileName) { + const errors = []; + const options = convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName); + return { options, errors }; + } + function getDefaultCompilerOptions(configFileName) { + const options = configFileName && getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; + return options; + } + function convertCompilerOptionsFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + const options = getDefaultCompilerOptions(configFileName); + convertOptionsFromJson(getCommandLineCompilerOptionsMap(), jsonOptions, basePath, options, compilerOptionsDidYouMeanDiagnostics, errors); + if (configFileName) { + options.configFilePath = normalizeSlashes(configFileName); + } + return options; + } + function getDefaultTypeAcquisition(configFileName) { + return { enable: !!configFileName && getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; + } + function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { + const options = getDefaultTypeAcquisition(configFileName); + convertOptionsFromJson(getCommandLineTypeAcquisitionMap(), jsonOptions, basePath, options, typeAcquisitionDidYouMeanDiagnostics, errors); + return options; + } + function convertWatchOptionsFromJsonWorker(jsonOptions, basePath, errors) { + return convertOptionsFromJson( + getCommandLineWatchOptionsMap(), + jsonOptions, + basePath, + /*defaultOptions*/ + void 0, + watchOptionsDidYouMeanDiagnostics, + errors + ); + } + function convertOptionsFromJson(optionsNameMap, jsonOptions, basePath, defaultOptions9, diagnostics, errors) { + if (!jsonOptions) { + return; + } + for (const id in jsonOptions) { + const opt = optionsNameMap.get(id); + if (opt) { + (defaultOptions9 || (defaultOptions9 = {}))[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); + } else { + errors.push(createUnknownOptionError(id, diagnostics)); + } + } + return defaultOptions9; + } + function createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, message, ...args) { + return sourceFile && node ? createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args) : createCompilerDiagnostic(message, ...args); + } + function convertJsonOption(opt, value2, basePath, errors, propertyAssignment, valueExpression, sourceFile) { + if (opt.isCommandLineOnly) { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, propertyAssignment == null ? void 0 : propertyAssignment.name, Diagnostics.Option_0_can_only_be_specified_on_command_line, opt.name)); + return void 0; + } + if (isCompilerOptionsValue(opt, value2)) { + const optType = opt.type; + if (optType === "list" && isArray3(value2)) { + return convertJsonOptionOfListType(opt, value2, basePath, errors, propertyAssignment, valueExpression, sourceFile); + } else if (optType === "listOrElement") { + return isArray3(value2) ? convertJsonOptionOfListType(opt, value2, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value2, basePath, errors, propertyAssignment, valueExpression, sourceFile); + } else if (!isString4(opt.type)) { + return convertJsonOptionOfCustomType(opt, value2, errors, valueExpression, sourceFile); + } + const validatedValue = validateJsonOptionValue(opt, value2, errors, valueExpression, sourceFile); + return isNullOrUndefined2(validatedValue) ? validatedValue : normalizeNonListOptionValue(opt, basePath, validatedValue); + } else { + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, Diagnostics.Compiler_option_0_requires_a_value_of_type_1, opt.name, getCompilerOptionValueTypeString(opt))); + } + } + function normalizeNonListOptionValue(option, basePath, value2) { + if (option.isFilePath) { + value2 = getNormalizedAbsolutePath(value2, basePath); + if (value2 === "") { + value2 = "."; + } + } + return value2; + } + function validateJsonOptionValue(opt, value2, errors, valueExpression, sourceFile) { + var _a2; + if (isNullOrUndefined2(value2)) + return void 0; + const d7 = (_a2 = opt.extraValidation) == null ? void 0 : _a2.call(opt, value2); + if (!d7) + return value2; + errors.push(createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, ...d7)); + return void 0; + } + function convertJsonOptionOfCustomType(opt, value2, errors, valueExpression, sourceFile) { + if (isNullOrUndefined2(value2)) + return void 0; + const key = value2.toLowerCase(); + const val = opt.type.get(key); + if (val !== void 0) { + return validateJsonOptionValue(opt, val, errors, valueExpression, sourceFile); + } else { + errors.push(createDiagnosticForInvalidCustomType(opt, (message, ...args) => createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, valueExpression, message, ...args))); + } + } + function convertJsonOptionOfListType(option, values2, basePath, errors, propertyAssignment, valueExpression, sourceFile) { + return filter2(map4(values2, (v8, index4) => convertJsonOption(option.element, v8, basePath, errors, propertyAssignment, valueExpression == null ? void 0 : valueExpression.elements[index4], sourceFile)), (v8) => option.listPreserveFalsyValues ? true : !!v8); + } + function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, extraFileExtensions = emptyArray) { + basePath = normalizePath(basePath); + const keyMapper = createGetCanonicalFileName(host.useCaseSensitiveFileNames); + const literalFileMap = /* @__PURE__ */ new Map(); + const wildcardFileMap = /* @__PURE__ */ new Map(); + const wildCardJsonFileMap = /* @__PURE__ */ new Map(); + const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = configFileSpecs; + const supportedExtensions = getSupportedExtensions(options, extraFileExtensions); + const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); + if (validatedFilesSpec) { + for (const fileName of validatedFilesSpec) { + const file = getNormalizedAbsolutePath(fileName, basePath); + literalFileMap.set(keyMapper(file), file); + } + } + let jsonOnlyIncludeRegexes; + if (validatedIncludeSpecs && validatedIncludeSpecs.length > 0) { + for (const file of host.readDirectory( + basePath, + flatten2(supportedExtensionsWithJsonIfResolveJsonModule), + validatedExcludeSpecs, + validatedIncludeSpecs, + /*depth*/ + void 0 + )) { + if (fileExtensionIs( + file, + ".json" + /* Json */ + )) { + if (!jsonOnlyIncludeRegexes) { + const includes2 = validatedIncludeSpecs.filter((s7) => endsWith2( + s7, + ".json" + /* Json */ + )); + const includeFilePatterns = map4(getRegularExpressionsForWildcards(includes2, basePath, "files"), (pattern5) => `^${pattern5}$`); + jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map((pattern5) => getRegexFromPattern(pattern5, host.useCaseSensitiveFileNames)) : emptyArray; + } + const includeIndex = findIndex2(jsonOnlyIncludeRegexes, (re4) => re4.test(file)); + if (includeIndex !== -1) { + const key2 = keyMapper(file); + if (!literalFileMap.has(key2) && !wildCardJsonFileMap.has(key2)) { + wildCardJsonFileMap.set(key2, file); + } + } + continue; + } + if (hasFileWithHigherPriorityExtension(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { + continue; + } + removeWildcardFilesWithLowerPriorityExtension(file, wildcardFileMap, supportedExtensions, keyMapper); + const key = keyMapper(file); + if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { + wildcardFileMap.set(key, file); + } + } + } + const literalFiles = arrayFrom(literalFileMap.values()); + const wildcardFiles = arrayFrom(wildcardFileMap.values()); + return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values())); + } + function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) { + const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec; + if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs)) + return false; + basePath = normalizePath(basePath); + const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2); + if (validatedFilesSpec) { + for (const fileName of validatedFilesSpec) { + if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck) + return false; + } + } + return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath); + } + function invalidDotDotAfterRecursiveWildcard(s7) { + const wildcardIndex = startsWith2(s7, "**/") ? 0 : s7.indexOf("/**/"); + if (wildcardIndex === -1) { + return false; + } + const lastDotIndex = endsWith2(s7, "/..") ? s7.length : s7.lastIndexOf("/../"); + return lastDotIndex > wildcardIndex; + } + function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) { + return matchesExcludeWorker( + pathToCheck, + filter2(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)), + useCaseSensitiveFileNames2, + currentDirectory + ); + } + function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) { + const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude"); + const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2); + if (!excludeRegex) + return false; + if (excludeRegex.test(pathToCheck)) + return true; + return !hasExtension(pathToCheck) && excludeRegex.test(ensureTrailingDirectorySeparator(pathToCheck)); + } + function validateSpecs(specs10, errors, disallowTrailingRecursion, jsonSourceFile, specKey) { + return specs10.filter((spec) => { + if (!isString4(spec)) + return false; + const diag2 = specToDiagnostic(spec, disallowTrailingRecursion); + if (diag2 !== void 0) { + errors.push(createDiagnostic(...diag2)); + } + return diag2 === void 0; + }); + function createDiagnostic(message, spec) { + const element = getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec); + return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(jsonSourceFile, element, message, spec); + } + } + function specToDiagnostic(spec, disallowTrailingRecursion) { + Debug.assert(typeof spec === "string"); + if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { + return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; + } else if (invalidDotDotAfterRecursiveWildcard(spec)) { + return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; + } + } + function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, basePath, useCaseSensitiveFileNames2) { + const rawExcludeRegex = getRegularExpressionForWildcard(exclude, basePath, "exclude"); + const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i"); + const wildcardDirectories = {}; + const wildCardKeyToPath = /* @__PURE__ */ new Map(); + if (include !== void 0) { + const recursiveKeys = []; + for (const file of include) { + const spec = normalizePath(combinePaths(basePath, file)); + if (excludeRegex && excludeRegex.test(spec)) { + continue; + } + const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2); + if (match) { + const { key, path: path2, flags } = match; + const existingPath = wildCardKeyToPath.get(key); + const existingFlags = existingPath !== void 0 ? wildcardDirectories[existingPath] : void 0; + if (existingFlags === void 0 || existingFlags < flags) { + wildcardDirectories[existingPath !== void 0 ? existingPath : path2] = flags; + if (existingPath === void 0) + wildCardKeyToPath.set(key, path2); + if (flags === 1) { + recursiveKeys.push(key); + } + } + } + } + for (const path2 in wildcardDirectories) { + if (hasProperty(wildcardDirectories, path2)) { + for (const recursiveKey of recursiveKeys) { + const key = toCanonicalKey(path2, useCaseSensitiveFileNames2); + if (key !== recursiveKey && containsPath(recursiveKey, key, basePath, !useCaseSensitiveFileNames2)) { + delete wildcardDirectories[path2]; + } + } + } + } + } + return wildcardDirectories; + } + function toCanonicalKey(path2, useCaseSensitiveFileNames2) { + return useCaseSensitiveFileNames2 ? path2 : toFileNameLowerCase(path2); + } + function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) { + const match = wildcardDirectoryPattern.exec(spec); + if (match) { + const questionWildcardIndex = spec.indexOf("?"); + const starWildcardIndex = spec.indexOf("*"); + const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator); + return { + key: toCanonicalKey(match[0], useCaseSensitiveFileNames2), + path: match[0], + flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 : 0 + /* None */ + }; + } + if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) { + const path2 = removeTrailingDirectorySeparator(spec); + return { + key: toCanonicalKey(path2, useCaseSensitiveFileNames2), + path: path2, + flags: 1 + /* Recursive */ + }; + } + return void 0; + } + function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions6, keyMapper) { + const extensionGroup = forEach4(extensions6, (group22) => fileExtensionIsOneOf(file, group22) ? group22 : void 0); + if (!extensionGroup) { + return false; + } + for (const ext of extensionGroup) { + if (fileExtensionIs(file, ext) && (ext !== ".ts" || !fileExtensionIs( + file, + ".d.ts" + /* Dts */ + ))) { + return false; + } + const higherPriorityPath = keyMapper(changeExtension(file, ext)); + if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { + if (ext === ".d.ts" && (fileExtensionIs( + file, + ".js" + /* Js */ + ) || fileExtensionIs( + file, + ".jsx" + /* Jsx */ + ))) { + continue; + } + return true; + } + } + return false; + } + function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions6, keyMapper) { + const extensionGroup = forEach4(extensions6, (group22) => fileExtensionIsOneOf(file, group22) ? group22 : void 0); + if (!extensionGroup) { + return; + } + for (let i7 = extensionGroup.length - 1; i7 >= 0; i7--) { + const ext = extensionGroup[i7]; + if (fileExtensionIs(file, ext)) { + return; + } + const lowerPriorityPath = keyMapper(changeExtension(file, ext)); + wildcardFiles.delete(lowerPriorityPath); + } + } + function convertCompilerOptionsForTelemetry(opts) { + const out = {}; + for (const key in opts) { + if (hasProperty(opts, key)) { + const type3 = getOptionFromName(key); + if (type3 !== void 0) { + out[key] = getOptionValueWithEmptyStrings(opts[key], type3); + } + } + } + return out; + } + function getOptionValueWithEmptyStrings(value2, option) { + if (value2 === void 0) + return value2; + switch (option.type) { + case "object": + return ""; + case "string": + return ""; + case "number": + return typeof value2 === "number" ? value2 : ""; + case "boolean": + return typeof value2 === "boolean" ? value2 : ""; + case "listOrElement": + if (!isArray3(value2)) + return getOptionValueWithEmptyStrings(value2, option.element); + case "list": + const elementType = option.element; + return isArray3(value2) ? mapDefined(value2, (v8) => getOptionValueWithEmptyStrings(v8, elementType)) : ""; + default: + return forEachEntry(option.type, (optionEnumValue, optionStringValue) => { + if (optionEnumValue === value2) { + return optionStringValue; + } + }); + } + } + function getDefaultValueForOption(option) { + switch (option.type) { + case "number": + return 1; + case "boolean": + return true; + case "string": + const defaultValue = option.defaultValueDescription; + return option.isFilePath ? `./${defaultValue && typeof defaultValue === "string" ? defaultValue : ""}` : ""; + case "list": + return []; + case "listOrElement": + return getDefaultValueForOption(option.element); + case "object": + return {}; + default: + const value2 = firstOrUndefinedIterator(option.type.keys()); + if (value2 !== void 0) + return value2; + return Debug.fail("Expected 'option.type' to have entries."); + } + } + var compileOnSaveCommandLineOption, jsxOptionMap, inverseJsxOptionMap, libEntries, libs, libMap, optionsForWatch, commonOptionsWithBuild, targetOptionDeclaration, moduleOptionDeclaration, commandOptionsWithoutBuild, optionDeclarations, semanticDiagnosticsOptionDeclarations, affectsEmitOptionDeclarations, affectsDeclarationPathOptionDeclarations, moduleResolutionOptionDeclarations, sourceFileAffectingCompilerOptions, optionsAffectingProgramStructure, transpileOptionValueCompilerOptions, optionsForBuild, buildOpts, typeAcquisitionDeclarations, optionsNameMapCache, compilerOptionsAlternateMode, defaultInitCompilerOptions, compilerOptionsDidYouMeanDiagnostics, buildOptionsNameMapCache, buildOptionsAlternateMode, buildOptionsDidYouMeanDiagnostics, typeAcquisitionDidYouMeanDiagnostics, watchOptionsNameMapCache, watchOptionsDidYouMeanDiagnostics, commandLineCompilerOptionsMapCache, commandLineWatchOptionsMapCache, commandLineTypeAcquisitionMapCache, extendsOptionDeclaration, compilerOptionsDeclaration, watchOptionsDeclaration, typeAcquisitionDeclaration, _tsconfigRootOptions, defaultIncludeSpec, invalidTrailingRecursionPattern, wildcardDirectoryPattern; + var init_commandLineParser = __esm2({ + "src/compiler/commandLineParser.ts"() { + "use strict"; + init_ts2(); + compileOnSaveCommandLineOption = { + name: "compileOnSave", + type: "boolean", + defaultValueDescription: false + }; + jsxOptionMap = new Map(Object.entries({ + "preserve": 1, + "react-native": 3, + "react": 2, + "react-jsx": 4, + "react-jsxdev": 5 + /* ReactJSXDev */ + })); + inverseJsxOptionMap = new Map(mapIterator(jsxOptionMap.entries(), ([key, value2]) => ["" + value2, key])); + libEntries = [ + // JavaScript only + ["es5", "lib.es5.d.ts"], + ["es6", "lib.es2015.d.ts"], + ["es2015", "lib.es2015.d.ts"], + ["es7", "lib.es2016.d.ts"], + ["es2016", "lib.es2016.d.ts"], + ["es2017", "lib.es2017.d.ts"], + ["es2018", "lib.es2018.d.ts"], + ["es2019", "lib.es2019.d.ts"], + ["es2020", "lib.es2020.d.ts"], + ["es2021", "lib.es2021.d.ts"], + ["es2022", "lib.es2022.d.ts"], + ["es2023", "lib.es2023.d.ts"], + ["esnext", "lib.esnext.d.ts"], + // Host only + ["dom", "lib.dom.d.ts"], + ["dom.iterable", "lib.dom.iterable.d.ts"], + ["dom.asynciterable", "lib.dom.asynciterable.d.ts"], + ["webworker", "lib.webworker.d.ts"], + ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], + ["webworker.iterable", "lib.webworker.iterable.d.ts"], + ["webworker.asynciterable", "lib.webworker.asynciterable.d.ts"], + ["scripthost", "lib.scripthost.d.ts"], + // ES2015 Or ESNext By-feature options + ["es2015.core", "lib.es2015.core.d.ts"], + ["es2015.collection", "lib.es2015.collection.d.ts"], + ["es2015.generator", "lib.es2015.generator.d.ts"], + ["es2015.iterable", "lib.es2015.iterable.d.ts"], + ["es2015.promise", "lib.es2015.promise.d.ts"], + ["es2015.proxy", "lib.es2015.proxy.d.ts"], + ["es2015.reflect", "lib.es2015.reflect.d.ts"], + ["es2015.symbol", "lib.es2015.symbol.d.ts"], + ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"], + ["es2016.array.include", "lib.es2016.array.include.d.ts"], + ["es2016.intl", "lib.es2016.intl.d.ts"], + ["es2017.date", "lib.es2017.date.d.ts"], + ["es2017.object", "lib.es2017.object.d.ts"], + ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"], + ["es2017.string", "lib.es2017.string.d.ts"], + ["es2017.intl", "lib.es2017.intl.d.ts"], + ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], + ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"], + ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"], + ["es2018.intl", "lib.es2018.intl.d.ts"], + ["es2018.promise", "lib.es2018.promise.d.ts"], + ["es2018.regexp", "lib.es2018.regexp.d.ts"], + ["es2019.array", "lib.es2019.array.d.ts"], + ["es2019.object", "lib.es2019.object.d.ts"], + ["es2019.string", "lib.es2019.string.d.ts"], + ["es2019.symbol", "lib.es2019.symbol.d.ts"], + ["es2019.intl", "lib.es2019.intl.d.ts"], + ["es2020.bigint", "lib.es2020.bigint.d.ts"], + ["es2020.date", "lib.es2020.date.d.ts"], + ["es2020.promise", "lib.es2020.promise.d.ts"], + ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], + ["es2020.string", "lib.es2020.string.d.ts"], + ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], + ["es2020.intl", "lib.es2020.intl.d.ts"], + ["es2020.number", "lib.es2020.number.d.ts"], + ["es2021.promise", "lib.es2021.promise.d.ts"], + ["es2021.string", "lib.es2021.string.d.ts"], + ["es2021.weakref", "lib.es2021.weakref.d.ts"], + ["es2021.intl", "lib.es2021.intl.d.ts"], + ["es2022.array", "lib.es2022.array.d.ts"], + ["es2022.error", "lib.es2022.error.d.ts"], + ["es2022.intl", "lib.es2022.intl.d.ts"], + ["es2022.object", "lib.es2022.object.d.ts"], + ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], + ["es2022.string", "lib.es2022.string.d.ts"], + ["es2022.regexp", "lib.es2022.regexp.d.ts"], + ["es2023.array", "lib.es2023.array.d.ts"], + ["es2023.collection", "lib.es2023.collection.d.ts"], + ["esnext.array", "lib.es2023.array.d.ts"], + ["esnext.collection", "lib.esnext.collection.d.ts"], + ["esnext.symbol", "lib.es2019.symbol.d.ts"], + ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], + ["esnext.intl", "lib.esnext.intl.d.ts"], + ["esnext.disposable", "lib.esnext.disposable.d.ts"], + ["esnext.bigint", "lib.es2020.bigint.d.ts"], + ["esnext.string", "lib.es2022.string.d.ts"], + ["esnext.promise", "lib.esnext.promise.d.ts"], + ["esnext.weakref", "lib.es2021.weakref.d.ts"], + ["esnext.decorators", "lib.esnext.decorators.d.ts"], + ["esnext.object", "lib.esnext.object.d.ts"], + ["decorators", "lib.decorators.d.ts"], + ["decorators.legacy", "lib.decorators.legacy.d.ts"] + ]; + libs = libEntries.map((entry) => entry[0]); + libMap = new Map(libEntries); + optionsForWatch = [ + { + name: "watchFile", + type: new Map(Object.entries({ + fixedpollinginterval: 0, + prioritypollinginterval: 1, + dynamicprioritypolling: 2, + fixedchunksizepolling: 3, + usefsevents: 4, + usefseventsonparentdirectory: 5 + /* UseFsEventsOnParentDirectory */ + })), + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Specify_how_the_TypeScript_watch_mode_works, + defaultValueDescription: 4 + /* UseFsEvents */ + }, + { + name: "watchDirectory", + type: new Map(Object.entries({ + usefsevents: 0, + fixedpollinginterval: 1, + dynamicprioritypolling: 2, + fixedchunksizepolling: 3 + /* FixedChunkSizePolling */ + })), + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality, + defaultValueDescription: 0 + /* UseFsEvents */ + }, + { + name: "fallbackPolling", + type: new Map(Object.entries({ + fixedinterval: 0, + priorityinterval: 1, + dynamicpriority: 2, + fixedchunksize: 3 + /* FixedChunkSize */ + })), + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers, + defaultValueDescription: 1 + /* PriorityInterval */ + }, + { + name: "synchronousWatchDirectory", + type: "boolean", + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, + defaultValueDescription: false + }, + { + name: "excludeDirectories", + type: "list", + element: { + name: "excludeDirectory", + type: "string", + isFilePath: true, + extraValidation: specToDiagnostic + }, + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Remove_a_list_of_directories_from_the_watch_process + }, + { + name: "excludeFiles", + type: "list", + element: { + name: "excludeFile", + type: "string", + isFilePath: true, + extraValidation: specToDiagnostic + }, + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing + } + ]; + commonOptionsWithBuild = [ + { + name: "help", + shortName: "h", + type: "boolean", + showInSimplifiedHelpView: true, + isCommandLineOnly: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Print_this_message, + defaultValueDescription: false + }, + { + name: "help", + shortName: "?", + type: "boolean", + isCommandLineOnly: true, + category: Diagnostics.Command_line_Options, + defaultValueDescription: false + }, + { + name: "watch", + shortName: "w", + type: "boolean", + showInSimplifiedHelpView: true, + isCommandLineOnly: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Watch_input_files, + defaultValueDescription: false + }, + { + name: "preserveWatchOutput", + type: "boolean", + showInSimplifiedHelpView: false, + category: Diagnostics.Output_Formatting, + description: Diagnostics.Disable_wiping_the_console_in_watch_mode, + defaultValueDescription: false + }, + { + name: "listFiles", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Print_all_of_the_files_read_during_the_compilation, + defaultValueDescription: false + }, + { + name: "explainFiles", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included, + defaultValueDescription: false + }, + { + name: "listEmittedFiles", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation, + defaultValueDescription: false + }, + { + name: "pretty", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Output_Formatting, + description: Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read, + defaultValueDescription: true + }, + { + name: "traceResolution", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Log_paths_used_during_the_moduleResolution_process, + defaultValueDescription: false + }, + { + name: "diagnostics", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Output_compiler_performance_information_after_building, + defaultValueDescription: false + }, + { + name: "extendedDiagnostics", + type: "boolean", + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building, + defaultValueDescription: false + }, + { + name: "generateCpuProfile", + type: "string", + isFilePath: true, + paramType: Diagnostics.FILE_OR_DIRECTORY, + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging, + defaultValueDescription: "profile.cpuprofile" + }, + { + name: "generateTrace", + type: "string", + isFilePath: true, + isCommandLineOnly: true, + paramType: Diagnostics.DIRECTORY, + category: Diagnostics.Compiler_Diagnostics, + description: Diagnostics.Generates_an_event_trace_and_a_list_of_types + }, + { + name: "incremental", + shortName: "i", + type: "boolean", + category: Diagnostics.Projects, + description: Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects, + transpileOptionValue: void 0, + defaultValueDescription: Diagnostics.false_unless_composite_is_set + }, + { + name: "declaration", + shortName: "d", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + transpileOptionValue: void 0, + description: Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project, + defaultValueDescription: Diagnostics.false_unless_composite_is_set + }, + { + name: "declarationMap", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + transpileOptionValue: void 0, + defaultValueDescription: false, + description: Diagnostics.Create_sourcemaps_for_d_ts_files + }, + { + name: "emitDeclarationOnly", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files, + transpileOptionValue: void 0, + defaultValueDescription: false + }, + { + name: "sourceMap", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + defaultValueDescription: false, + description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files + }, + { + name: "inlineSourceMap", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript, + defaultValueDescription: false + }, + { + name: "assumeChangesOnlyAffectDirectDependencies", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Watch_and_Build_Modes, + description: Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it, + defaultValueDescription: false + }, + { + name: "locale", + type: "string", + category: Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, + defaultValueDescription: Diagnostics.Platform_specific + } + ]; + targetOptionDeclaration = { + name: "target", + shortName: "t", + type: new Map(Object.entries({ + es3: 0, + es5: 1, + es6: 2, + es2015: 2, + es2016: 3, + es2017: 4, + es2018: 5, + es2019: 6, + es2020: 7, + es2021: 8, + es2022: 9, + esnext: 99 + /* ESNext */ + })), + affectsSourceFile: true, + affectsModuleResolution: true, + affectsEmit: true, + affectsBuildInfo: true, + deprecatedKeys: /* @__PURE__ */ new Set(["es3"]), + paramType: Diagnostics.VERSION, + showInSimplifiedHelpView: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations, + defaultValueDescription: 1 + /* ES5 */ + }; + moduleOptionDeclaration = { + name: "module", + shortName: "m", + type: new Map(Object.entries({ + none: 0, + commonjs: 1, + amd: 2, + system: 4, + umd: 3, + es6: 5, + es2015: 5, + es2020: 6, + es2022: 7, + esnext: 99, + node16: 100, + nodenext: 199, + preserve: 200 + /* Preserve */ + })), + affectsSourceFile: true, + affectsModuleResolution: true, + affectsEmit: true, + affectsBuildInfo: true, + paramType: Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: Diagnostics.Modules, + description: Diagnostics.Specify_what_module_code_is_generated, + defaultValueDescription: void 0 + }; + commandOptionsWithoutBuild = [ + // CommandLine only options + { + name: "all", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Show_all_compiler_options, + defaultValueDescription: false + }, + { + name: "version", + shortName: "v", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Print_the_compiler_s_version, + defaultValueDescription: false + }, + { + name: "init", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, + defaultValueDescription: false + }, + { + name: "project", + shortName: "p", + type: "string", + isFilePath: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + paramType: Diagnostics.FILE_OR_DIRECTORY, + description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json + }, + { + name: "build", + type: "boolean", + shortName: "b", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date, + defaultValueDescription: false + }, + { + name: "showConfig", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: Diagnostics.Print_the_final_configuration_instead_of_building, + defaultValueDescription: false + }, + { + name: "listFilesOnly", + type: "boolean", + category: Diagnostics.Command_line_Options, + isCommandLineOnly: true, + description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing, + defaultValueDescription: false + }, + // Basic + targetOptionDeclaration, + moduleOptionDeclaration, + { + name: "lib", + type: "list", + element: { + name: "lib", + type: libMap, + defaultValueDescription: void 0 + }, + affectsProgramStructure: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment, + transpileOptionValue: void 0 + }, + { + name: "allowJs", + type: "boolean", + allowJsFlag: true, + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.JavaScript_Support, + description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, + defaultValueDescription: false + }, + { + name: "checkJs", + type: "boolean", + affectsModuleResolution: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.JavaScript_Support, + description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files, + defaultValueDescription: false + }, + { + name: "jsx", + type: jsxOptionMap, + affectsSourceFile: true, + affectsEmit: true, + affectsBuildInfo: true, + affectsModuleResolution: true, + // The checker emits an error when it sees JSX but this option is not set in compilerOptions. + // This is effectively a semantic error, so mark this option as affecting semantic diagnostics + // so we know to refresh errors when this option is changed. + affectsSemanticDiagnostics: true, + paramType: Diagnostics.KIND, + showInSimplifiedHelpView: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_what_JSX_code_is_generated, + defaultValueDescription: void 0 + }, + { + name: "outFile", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: Diagnostics.FILE, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output, + transpileOptionValue: void 0 + }, + { + name: "outDir", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: Diagnostics.DIRECTORY, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Specify_an_output_folder_for_all_emitted_files + }, + { + name: "rootDir", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: Diagnostics.LOCATION, + category: Diagnostics.Modules, + description: Diagnostics.Specify_the_root_folder_within_your_source_files, + defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files + }, + { + name: "composite", + type: "boolean", + // Not setting affectsEmit because we calculate this flag might not affect full emit + affectsBuildInfo: true, + isTSConfigOnly: true, + category: Diagnostics.Projects, + transpileOptionValue: void 0, + defaultValueDescription: false, + description: Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references + }, + { + name: "tsBuildInfoFile", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + isFilePath: true, + paramType: Diagnostics.FILE, + category: Diagnostics.Projects, + transpileOptionValue: void 0, + defaultValueDescription: ".tsbuildinfo", + description: Diagnostics.Specify_the_path_to_tsbuildinfo_incremental_compilation_file + }, + { + name: "removeComments", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + defaultValueDescription: false, + description: Diagnostics.Disable_emitting_comments + }, + { + name: "noEmit", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_emitting_files_from_a_compilation, + transpileOptionValue: void 0, + defaultValueDescription: false + }, + { + name: "importHelpers", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file, + defaultValueDescription: false + }, + { + name: "importsNotUsedAsValues", + type: new Map(Object.entries({ + remove: 0, + preserve: 1, + error: 2 + /* Error */ + })), + affectsEmit: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types, + defaultValueDescription: 0 + /* Remove */ + }, + { + name: "downlevelIteration", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration, + defaultValueDescription: false + }, + { + name: "isolatedModules", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports, + transpileOptionValue: true, + defaultValueDescription: false + }, + { + name: "verbatimModuleSyntax", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting, + defaultValueDescription: false + }, + // Strict Type Checks + { + name: "strict", + type: "boolean", + // Though this affects semantic diagnostics, affectsSemanticDiagnostics is not set here + // The value of each strictFlag depends on own strictFlag value or this and never accessed directly. + // But we need to store `strict` in builf info, even though it won't be examined directly, so that the + // flags it controls (e.g. `strictNullChecks`) will be retrieved correctly + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_all_strict_type_checking_options, + defaultValueDescription: false + }, + { + name: "noImplicitAny", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "strictNullChecks", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.When_type_checking_take_into_account_null_and_undefined, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "strictFunctionTypes", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "strictBindCallApply", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "strictPropertyInitialization", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "noImplicitThis", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "useUnknownInCatchVariables", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + { + name: "alwaysStrict", + type: "boolean", + affectsSourceFile: true, + affectsEmit: true, + affectsBuildInfo: true, + strictFlag: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Ensure_use_strict_is_always_emitted, + defaultValueDescription: Diagnostics.false_unless_strict_is_set + }, + // Additional Checks + { + name: "noUnusedLocals", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read, + defaultValueDescription: false + }, + { + name: "noUnusedParameters", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read, + defaultValueDescription: false + }, + { + name: "exactOptionalPropertyTypes", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined, + defaultValueDescription: false + }, + { + name: "noImplicitReturns", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function, + defaultValueDescription: false + }, + { + name: "noFallthroughCasesInSwitch", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements, + defaultValueDescription: false + }, + { + name: "noUncheckedIndexedAccess", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index, + defaultValueDescription: false + }, + { + name: "noImplicitOverride", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier, + defaultValueDescription: false + }, + { + name: "noPropertyAccessFromIndexSignature", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + showInSimplifiedHelpView: false, + category: Diagnostics.Type_Checking, + description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type, + defaultValueDescription: false + }, + // Module Resolution + { + name: "moduleResolution", + type: new Map(Object.entries({ + // N.B. The first entry specifies the value shown in `tsc --init` + node10: 2, + node: 2, + classic: 1, + node16: 3, + nodenext: 99, + bundler: 100 + /* Bundler */ + })), + deprecatedKeys: /* @__PURE__ */ new Set(["node"]), + affectsSourceFile: true, + affectsModuleResolution: true, + paramType: Diagnostics.STRATEGY, + category: Diagnostics.Modules, + description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier, + defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node + }, + { + name: "baseUrl", + type: "string", + affectsModuleResolution: true, + isFilePath: true, + category: Diagnostics.Modules, + description: Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "paths", + type: "object", + affectsModuleResolution: true, + isTSConfigOnly: true, + category: Diagnostics.Modules, + description: Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations, + transpileOptionValue: void 0 + }, + { + // this option can only be specified in tsconfig.json + // use type = object to copy the value as-is + name: "rootDirs", + type: "list", + isTSConfigOnly: true, + element: { + name: "rootDirs", + type: "string", + isFilePath: true + }, + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, + transpileOptionValue: void 0, + defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files + }, + { + name: "typeRoots", + type: "list", + element: { + name: "typeRoots", + type: "string", + isFilePath: true + }, + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types + }, + { + name: "types", + type: "list", + element: { + name: "types", + type: "string" + }, + affectsProgramStructure: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Modules, + description: Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file, + transpileOptionValue: void 0 + }, + { + name: "allowSyntheticDefaultImports", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export, + defaultValueDescription: Diagnostics.module_system_or_esModuleInterop + }, + { + name: "esModuleInterop", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsBuildInfo: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility, + defaultValueDescription: false + }, + { + name: "preserveSymlinks", + type: "boolean", + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node, + defaultValueDescription: false + }, + { + name: "allowUmdGlobalAccess", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Modules, + description: Diagnostics.Allow_accessing_UMD_globals_from_modules, + defaultValueDescription: false + }, + { + name: "moduleSuffixes", + type: "list", + element: { + name: "suffix", + type: "string" + }, + listPreserveFalsyValues: true, + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module + }, + { + name: "allowImportingTsExtensions", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Modules, + description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set, + defaultValueDescription: false, + transpileOptionValue: void 0 + }, + { + name: "resolvePackageJsonExports", + type: "boolean", + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Use_the_package_json_exports_field_when_resolving_package_imports, + defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false + }, + { + name: "resolvePackageJsonImports", + type: "boolean", + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Use_the_package_json_imports_field_when_resolving_imports, + defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false + }, + { + name: "customConditions", + type: "list", + element: { + name: "condition", + type: "string" + }, + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports + }, + // Source Maps + { + name: "sourceRoot", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + paramType: Diagnostics.LOCATION, + category: Diagnostics.Emit, + description: Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code + }, + { + name: "mapRoot", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + paramType: Diagnostics.LOCATION, + category: Diagnostics.Emit, + description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations + }, + { + name: "inlineSources", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript, + defaultValueDescription: false + }, + // Experimental + { + name: "experimentalDecorators", + type: "boolean", + affectsEmit: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Enable_experimental_support_for_legacy_experimental_decorators, + defaultValueDescription: false + }, + { + name: "emitDecoratorMetadata", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files, + defaultValueDescription: false + }, + // Advanced + { + name: "jsxFactory", + type: "string", + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h, + defaultValueDescription: "`React.createElement`" + }, + { + name: "jsxFragmentFactory", + type: "string", + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment, + defaultValueDescription: "React.Fragment" + }, + { + name: "jsxImportSource", + type: "string", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsBuildInfo: true, + affectsModuleResolution: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk, + defaultValueDescription: "react" + }, + { + name: "resolveJsonModule", + type: "boolean", + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Enable_importing_json_files, + defaultValueDescription: false + }, + { + name: "allowArbitraryExtensions", + type: "boolean", + affectsProgramStructure: true, + category: Diagnostics.Modules, + description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present, + defaultValueDescription: false + }, + { + name: "out", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: false, + // This is intentionally broken to support compatibility with existing tsconfig files + // for correct behaviour, please use outFile + category: Diagnostics.Backwards_Compatibility, + paramType: Diagnostics.FILE, + transpileOptionValue: void 0, + description: Diagnostics.Deprecated_setting_Use_outFile_instead + }, + { + name: "reactNamespace", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit, + defaultValueDescription: "`React`" + }, + { + name: "skipDefaultLibCheck", + type: "boolean", + // We need to store these to determine whether `lib` files need to be rechecked + affectsBuildInfo: true, + category: Diagnostics.Completeness, + description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript, + defaultValueDescription: false + }, + { + name: "charset", + type: "string", + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files, + defaultValueDescription: "utf8" + }, + { + name: "emitBOM", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files, + defaultValueDescription: false + }, + { + name: "newLine", + type: new Map(Object.entries({ + crlf: 0, + lf: 1 + /* LineFeed */ + })), + affectsEmit: true, + affectsBuildInfo: true, + paramType: Diagnostics.NEWLINE, + category: Diagnostics.Emit, + description: Diagnostics.Set_the_newline_character_for_emitting_files, + defaultValueDescription: "lf" + }, + { + name: "noErrorTruncation", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Output_Formatting, + description: Diagnostics.Disable_truncating_types_in_error_messages, + defaultValueDescription: false + }, + { + name: "noLib", + type: "boolean", + category: Diagnostics.Language_and_Environment, + affectsProgramStructure: true, + description: Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts, + // We are not returning a sourceFile for lib file when asked by the program, + // so pass --noLib to avoid reporting a file not found error. + transpileOptionValue: true, + defaultValueDescription: false + }, + { + name: "noResolve", + type: "boolean", + affectsModuleResolution: true, + category: Diagnostics.Modules, + description: Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project, + // We are not doing a full typecheck, we are not resolving the whole context, + // so pass --noResolve to avoid reporting missing file errors. + transpileOptionValue: true, + defaultValueDescription: false + }, + { + name: "stripInternal", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments, + defaultValueDescription: false + }, + { + name: "disableSizeLimit", + type: "boolean", + affectsProgramStructure: true, + category: Diagnostics.Editor_Support, + description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server, + defaultValueDescription: false + }, + { + name: "disableSourceOfProjectReferenceRedirect", + type: "boolean", + isTSConfigOnly: true, + category: Diagnostics.Projects, + description: Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects, + defaultValueDescription: false + }, + { + name: "disableSolutionSearching", + type: "boolean", + isTSConfigOnly: true, + category: Diagnostics.Projects, + description: Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing, + defaultValueDescription: false + }, + { + name: "disableReferencedProjectLoad", + type: "boolean", + isTSConfigOnly: true, + category: Diagnostics.Projects, + description: Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript, + defaultValueDescription: false + }, + { + name: "noImplicitUseStrict", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files, + defaultValueDescription: false + }, + { + name: "noEmitHelpers", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output, + defaultValueDescription: false + }, + { + name: "noEmitOnError", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + transpileOptionValue: void 0, + description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported, + defaultValueDescription: false + }, + { + name: "preserveConstEnums", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code, + defaultValueDescription: false + }, + { + name: "declarationDir", + type: "string", + affectsEmit: true, + affectsBuildInfo: true, + affectsDeclarationPath: true, + isFilePath: true, + paramType: Diagnostics.DIRECTORY, + category: Diagnostics.Emit, + transpileOptionValue: void 0, + description: Diagnostics.Specify_the_output_directory_for_generated_declaration_files + }, + { + name: "skipLibCheck", + type: "boolean", + // We need to store these to determine whether `lib` files need to be rechecked + affectsBuildInfo: true, + category: Diagnostics.Completeness, + description: Diagnostics.Skip_type_checking_all_d_ts_files, + defaultValueDescription: false + }, + { + name: "allowUnusedLabels", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Disable_error_reporting_for_unused_labels, + defaultValueDescription: void 0 + }, + { + name: "allowUnreachableCode", + type: "boolean", + affectsBindDiagnostics: true, + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Type_Checking, + description: Diagnostics.Disable_error_reporting_for_unreachable_code, + defaultValueDescription: void 0 + }, + { + name: "suppressExcessPropertyErrors", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals, + defaultValueDescription: false + }, + { + name: "suppressImplicitAnyIndexErrors", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures, + defaultValueDescription: false + }, + { + name: "forceConsistentCasingInFileNames", + type: "boolean", + affectsModuleResolution: true, + category: Diagnostics.Interop_Constraints, + description: Diagnostics.Ensure_that_casing_is_correct_in_imports, + defaultValueDescription: true + }, + { + name: "maxNodeModuleJsDepth", + type: "number", + affectsModuleResolution: true, + category: Diagnostics.JavaScript_Support, + description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs, + defaultValueDescription: 0 + }, + { + name: "noStrictGenericChecks", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsBuildInfo: true, + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types, + defaultValueDescription: false + }, + { + name: "useDefineForClassFields", + type: "boolean", + affectsSemanticDiagnostics: true, + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Language_and_Environment, + description: Diagnostics.Emit_ECMAScript_standard_compliant_class_fields, + defaultValueDescription: Diagnostics.true_for_ES2022_and_above_including_ESNext + }, + { + name: "preserveValueImports", + type: "boolean", + affectsEmit: true, + affectsBuildInfo: true, + category: Diagnostics.Emit, + description: Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed, + defaultValueDescription: false + }, + { + name: "keyofStringsOnly", + type: "boolean", + category: Diagnostics.Backwards_Compatibility, + description: Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option, + defaultValueDescription: false + }, + { + // A list of plugins to load in the language service + name: "plugins", + type: "list", + isTSConfigOnly: true, + element: { + name: "plugin", + type: "object" + }, + description: Diagnostics.Specify_a_list_of_language_service_plugins_to_include, + category: Diagnostics.Editor_Support + }, + { + name: "moduleDetection", + type: new Map(Object.entries({ + auto: 2, + legacy: 1, + force: 3 + /* Force */ + })), + affectsSourceFile: true, + affectsModuleResolution: true, + description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files, + category: Diagnostics.Language_and_Environment, + defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules + }, + { + name: "ignoreDeprecations", + type: "string", + defaultValueDescription: void 0 + } + ]; + optionDeclarations = [ + ...commonOptionsWithBuild, + ...commandOptionsWithoutBuild + ]; + semanticDiagnosticsOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsSemanticDiagnostics); + affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit); + affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath); + moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution); + sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics); + optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure); + transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue")); + optionsForBuild = [ + { + name: "verbose", + shortName: "v", + category: Diagnostics.Command_line_Options, + description: Diagnostics.Enable_verbose_logging, + type: "boolean", + defaultValueDescription: false + }, + { + name: "dry", + shortName: "d", + category: Diagnostics.Command_line_Options, + description: Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean, + type: "boolean", + defaultValueDescription: false + }, + { + name: "force", + shortName: "f", + category: Diagnostics.Command_line_Options, + description: Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date, + type: "boolean", + defaultValueDescription: false + }, + { + name: "clean", + category: Diagnostics.Command_line_Options, + description: Diagnostics.Delete_the_outputs_of_all_projects, + type: "boolean", + defaultValueDescription: false + } + ]; + buildOpts = [ + ...commonOptionsWithBuild, + ...optionsForBuild + ]; + typeAcquisitionDeclarations = [ + { + name: "enable", + type: "boolean", + defaultValueDescription: false + }, + { + name: "include", + type: "list", + element: { + name: "include", + type: "string" + } + }, + { + name: "exclude", + type: "list", + element: { + name: "exclude", + type: "string" + } + }, + { + name: "disableFilenameBasedTypeAcquisition", + type: "boolean", + defaultValueDescription: false + } + ]; + compilerOptionsAlternateMode = { + diagnostic: Diagnostics.Compiler_option_0_may_only_be_used_with_build, + getOptionsNameMap: getBuildOptionsNameMap + }; + defaultInitCompilerOptions = { + module: 1, + target: 3, + strict: true, + esModuleInterop: true, + forceConsistentCasingInFileNames: true, + skipLibCheck: true + }; + compilerOptionsDidYouMeanDiagnostics = { + alternateMode: compilerOptionsAlternateMode, + getOptionsNameMap, + optionDeclarations, + unknownOptionDiagnostic: Diagnostics.Unknown_compiler_option_0, + unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument + }; + buildOptionsAlternateMode = { + diagnostic: Diagnostics.Compiler_option_0_may_not_be_used_with_build, + getOptionsNameMap + }; + buildOptionsDidYouMeanDiagnostics = { + alternateMode: buildOptionsAlternateMode, + getOptionsNameMap: getBuildOptionsNameMap, + optionDeclarations: buildOpts, + unknownOptionDiagnostic: Diagnostics.Unknown_build_option_0, + unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1 + }; + typeAcquisitionDidYouMeanDiagnostics = { + optionDeclarations: typeAcquisitionDeclarations, + unknownOptionDiagnostic: Diagnostics.Unknown_type_acquisition_option_0, + unknownDidYouMeanDiagnostic: Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1 + }; + watchOptionsDidYouMeanDiagnostics = { + getOptionsNameMap: getWatchOptionsNameMap, + optionDeclarations: optionsForWatch, + unknownOptionDiagnostic: Diagnostics.Unknown_watch_option_0, + unknownDidYouMeanDiagnostic: Diagnostics.Unknown_watch_option_0_Did_you_mean_1, + optionTypeMismatchDiagnostic: Diagnostics.Watch_option_0_requires_a_value_of_type_1 + }; + extendsOptionDeclaration = { + name: "extends", + type: "listOrElement", + element: { + name: "extends", + type: "string" + }, + category: Diagnostics.File_Management, + disallowNullOrUndefined: true + }; + compilerOptionsDeclaration = { + name: "compilerOptions", + type: "object", + elementOptions: getCommandLineCompilerOptionsMap(), + extraKeyDiagnostics: compilerOptionsDidYouMeanDiagnostics + }; + watchOptionsDeclaration = { + name: "watchOptions", + type: "object", + elementOptions: getCommandLineWatchOptionsMap(), + extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics + }; + typeAcquisitionDeclaration = { + name: "typeAcquisition", + type: "object", + elementOptions: getCommandLineTypeAcquisitionMap(), + extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics + }; + defaultIncludeSpec = "**/*"; + invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; + wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; + } + }); + function trace2(host, message, ...args) { + host.trace(formatMessage(message, ...args)); + } + function isTraceEnabled(compilerOptions, host) { + return !!compilerOptions.traceResolution && host.trace !== void 0; + } + function withPackageId(packageInfo, r8) { + let packageId; + if (r8 && packageInfo) { + const packageJsonContent = packageInfo.contents.packageJsonContent; + if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") { + packageId = { + name: packageJsonContent.name, + subModuleName: r8.path.slice(packageInfo.packageDirectory.length + directorySeparator.length), + version: packageJsonContent.version + }; + } + } + return r8 && { path: r8.path, extension: r8.ext, packageId, resolvedUsingTsExtension: r8.resolvedUsingTsExtension }; + } + function noPackageId(r8) { + return withPackageId( + /*packageInfo*/ + void 0, + r8 + ); + } + function removeIgnoredPackageId(r8) { + if (r8) { + Debug.assert(r8.packageId === void 0); + return { path: r8.path, ext: r8.extension, resolvedUsingTsExtension: r8.resolvedUsingTsExtension }; + } + } + function formatExtensions(extensions6) { + const result2 = []; + if (extensions6 & 1) + result2.push("TypeScript"); + if (extensions6 & 2) + result2.push("JavaScript"); + if (extensions6 & 4) + result2.push("Declaration"); + if (extensions6 & 8) + result2.push("JSON"); + return result2.join(", "); + } + function extensionsToExtensionsArray(extensions6) { + const result2 = []; + if (extensions6 & 1) + result2.push(...supportedTSImplementationExtensions); + if (extensions6 & 2) + result2.push(...supportedJSExtensionsFlat); + if (extensions6 & 4) + result2.push(...supportedDeclarationExtensions); + if (extensions6 & 8) + result2.push( + ".json" + /* Json */ + ); + return result2; + } + function resolvedTypeScriptOnly(resolved) { + if (!resolved) { + return void 0; + } + Debug.assert(extensionIsTS(resolved.extension)); + return { fileName: resolved.path, packageId: resolved.packageId }; + } + function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName3, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, alternateResult) { + if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName3)) { + const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled); + if (originalPath) + resolved = { ...resolved, path: resolvedFileName, originalPath }; + } + return createResolvedModuleWithFailedLookupLocations( + resolved, + isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + cache, + alternateResult + ); + } + function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, alternateResult) { + if (resultFromCache) { + if (!(cache == null ? void 0 : cache.isReadonly)) { + resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations); + resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations); + resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics); + return resultFromCache; + } else { + return { + ...resultFromCache, + failedLookupLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.failedLookupLocations, failedLookupLocations), + affectingLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.affectingLocations, affectingLocations), + resolutionDiagnostics: initializeResolutionFieldForReadonlyCache(resultFromCache.resolutionDiagnostics, diagnostics) + }; + } + } + return { + resolvedModule: resolved && { + resolvedFileName: resolved.path, + originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, + extension: resolved.extension, + isExternalLibraryImport, + packageId: resolved.packageId, + resolvedUsingTsExtension: !!resolved.resolvedUsingTsExtension + }, + failedLookupLocations: initializeResolutionField(failedLookupLocations), + affectingLocations: initializeResolutionField(affectingLocations), + resolutionDiagnostics: initializeResolutionField(diagnostics), + alternateResult + }; + } + function initializeResolutionField(value2) { + return value2.length ? value2 : void 0; + } + function updateResolutionField(to, value2) { + if (!(value2 == null ? void 0 : value2.length)) + return to; + if (!(to == null ? void 0 : to.length)) + return value2; + to.push(...value2); + return to; + } + function initializeResolutionFieldForReadonlyCache(fromCache, value2) { + if (!(fromCache == null ? void 0 : fromCache.length)) + return initializeResolutionField(value2); + if (!value2.length) + return fromCache.slice(); + return [...fromCache, ...value2]; + } + function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) { + if (!hasProperty(jsonContent, fieldName)) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_does_not_have_a_0_field, fieldName); + } + return; + } + const value2 = jsonContent[fieldName]; + if (typeof value2 !== typeOfTag || value2 === null) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, typeOfTag, value2 === null ? "null" : typeof value2); + } + return; + } + return value2; + } + function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { + const fileName = readPackageJsonField(jsonContent, fieldName, "string", state); + if (fileName === void 0) { + return; + } + if (!fileName) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_had_a_falsy_0_field, fieldName); + } + return; + } + const path2 = normalizePath(combinePaths(baseDirectory, fileName)); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_has_0_field_1_that_references_2, fieldName, fileName, path2); + } + return path2; + } + function readPackageJsonTypesFields(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) || readPackageJsonPathField(jsonContent, "types", baseDirectory, state); + } + function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "tsconfig", baseDirectory, state); + } + function readPackageJsonMainField(jsonContent, baseDirectory, state) { + return readPackageJsonPathField(jsonContent, "main", baseDirectory, state); + } + function readPackageJsonTypesVersionsField(jsonContent, state) { + const typesVersions = readPackageJsonField(jsonContent, "typesVersions", "object", state); + if (typesVersions === void 0) + return; + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings); + } + return typesVersions; + } + function readPackageJsonTypesVersionPaths(jsonContent, state) { + const typesVersions = readPackageJsonTypesVersionsField(jsonContent, state); + if (typesVersions === void 0) + return; + if (state.traceEnabled) { + for (const key in typesVersions) { + if (hasProperty(typesVersions, key) && !VersionRange.tryParse(key)) { + trace2(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, key); + } + } + } + const result2 = getPackageJsonTypesVersionsPaths(typesVersions); + if (!result2) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, versionMajorMinor); + } + return; + } + const { version: bestVersionKey, paths: bestVersionPaths } = result2; + if (typeof bestVersionPaths !== "object") { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, `typesVersions['${bestVersionKey}']`, "object", typeof bestVersionPaths); + } + return; + } + return result2; + } + function getPackageJsonTypesVersionsPaths(typesVersions) { + if (!typeScriptVersion) + typeScriptVersion = new Version(version5); + for (const key in typesVersions) { + if (!hasProperty(typesVersions, key)) + continue; + const keyRange = VersionRange.tryParse(key); + if (keyRange === void 0) { + continue; + } + if (keyRange.test(typeScriptVersion)) { + return { version: key, paths: typesVersions[key] }; + } + } + } + function getEffectiveTypeRoots(options, host) { + if (options.typeRoots) { + return options.typeRoots; + } + let currentDirectory; + if (options.configFilePath) { + currentDirectory = getDirectoryPath(options.configFilePath); + } else if (host.getCurrentDirectory) { + currentDirectory = host.getCurrentDirectory(); + } + if (currentDirectory !== void 0) { + return getDefaultTypeRoots(currentDirectory); + } + } + function getDefaultTypeRoots(currentDirectory) { + let typeRoots; + forEachAncestorDirectory(normalizePath(currentDirectory), (directory) => { + const atTypes = combinePaths(directory, nodeModulesAtTypes); + (typeRoots ?? (typeRoots = [])).push(atTypes); + }); + return typeRoots; + } + function arePathsEqual(path1, path2, host) { + const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; + return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0; + } + function getOriginalAndResolvedFileName(fileName, host, traceEnabled) { + const resolvedFileName = realPath(fileName, host, traceEnabled); + const pathsAreEqual = arePathsEqual(fileName, resolvedFileName, host); + return { + // If the fileName and realpath are differing only in casing prefer fileName so that we can issue correct errors for casing under forceConsistentCasingInFileNames + resolvedFileName: pathsAreEqual ? fileName : resolvedFileName, + originalPath: pathsAreEqual ? void 0 : fileName + }; + } + function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) { + const nameForLookup = endsWith2(typeRoot, "/node_modules/@types") || endsWith2(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName; + return combinePaths(typeRoot, nameForLookup); + } + function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) { + Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself."); + const traceEnabled = isTraceEnabled(options, host); + if (redirectedReference) { + options = redirectedReference.commandLine.options; + } + const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0; + let result2 = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0; + if (!result2 && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) { + result2 = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference); + } + if (result2) { + if (traceEnabled) { + trace2(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile); + if (redirectedReference) + trace2(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + trace2(host, Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1, typeReferenceDirectiveName, containingDirectory); + traceResult(result2); + } + return result2; + } + const typeRoots = getEffectiveTypeRoots(options, host); + if (traceEnabled) { + if (containingFile === void 0) { + if (typeRoots === void 0) { + trace2(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set, typeReferenceDirectiveName); + } else { + trace2(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1, typeReferenceDirectiveName, typeRoots); + } + } else { + if (typeRoots === void 0) { + trace2(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set, typeReferenceDirectiveName, containingFile); + } else { + trace2(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2, typeReferenceDirectiveName, containingFile, typeRoots); + } + } + if (redirectedReference) { + trace2(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + } + } + const failedLookupLocations = []; + const affectingLocations = []; + let features3 = getNodeResolutionFeatures(options); + if (resolutionMode !== void 0) { + features3 |= 30; + } + const moduleResolution = getEmitModuleResolutionKind(options); + if (resolutionMode === 99 && (3 <= moduleResolution && moduleResolution <= 99)) { + features3 |= 32; + } + const conditions = features3 & 8 ? getConditions(options, resolutionMode) : []; + const diagnostics = []; + const moduleResolutionState = { + compilerOptions: options, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: features3, + conditions, + requestContainingDirectory: containingDirectory, + reportDiagnostic: (diag2) => void diagnostics.push(diag2), + isConfigLookup: false, + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false + }; + let resolved = primaryLookup(); + let primary = true; + if (!resolved) { + resolved = secondaryLookup(); + primary = false; + } + let resolvedTypeReferenceDirective; + if (resolved) { + const { fileName, packageId } = resolved; + let resolvedFileName = fileName, originalPath; + if (!options.preserveSymlinks) + ({ resolvedFileName, originalPath } = getOriginalAndResolvedFileName(fileName, host, traceEnabled)); + resolvedTypeReferenceDirective = { + primary, + resolvedFileName, + originalPath, + packageId, + isExternalLibraryImport: pathContainsNodeModules(fileName) + }; + } + result2 = { + resolvedTypeReferenceDirective, + failedLookupLocations: initializeResolutionField(failedLookupLocations), + affectingLocations: initializeResolutionField(affectingLocations), + resolutionDiagnostics: initializeResolutionField(diagnostics) + }; + if (containingDirectory && cache && !cache.isReadonly) { + cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set( + typeReferenceDirectiveName, + /*mode*/ + resolutionMode, + result2 + ); + if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { + cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result2); + } + } + if (traceEnabled) + traceResult(result2); + return result2; + function traceResult(result22) { + var _a2; + if (!((_a2 = result22.resolvedTypeReferenceDirective) == null ? void 0 : _a2.resolvedFileName)) { + trace2(host, Diagnostics.Type_reference_directive_0_was_not_resolved, typeReferenceDirectiveName); + } else if (result22.resolvedTypeReferenceDirective.packageId) { + trace2(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3, typeReferenceDirectiveName, result22.resolvedTypeReferenceDirective.resolvedFileName, packageIdToString(result22.resolvedTypeReferenceDirective.packageId), result22.resolvedTypeReferenceDirective.primary); + } else { + trace2(host, Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2, typeReferenceDirectiveName, result22.resolvedTypeReferenceDirective.resolvedFileName, result22.resolvedTypeReferenceDirective.primary); + } + } + function primaryLookup() { + if (typeRoots && typeRoots.length) { + if (traceEnabled) { + trace2(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", ")); + } + return firstDefined(typeRoots, (typeRoot) => { + const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState); + const directoryExists = directoryProbablyExists(typeRoot, host); + if (!directoryExists && traceEnabled) { + trace2(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot); + } + if (options.typeRoots) { + const resolvedFromFile = loadModuleFromFile(4, candidate, !directoryExists, moduleResolutionState); + if (resolvedFromFile) { + const packageDirectory = parseNodeModuleFromPath(resolvedFromFile.path); + const packageInfo = packageDirectory ? getPackageJsonInfo( + packageDirectory, + /*onlyRecordFailures*/ + false, + moduleResolutionState + ) : void 0; + return resolvedTypeScriptOnly(withPackageId(packageInfo, resolvedFromFile)); + } + } + return resolvedTypeScriptOnly( + loadNodeModuleFromDirectory(4, candidate, !directoryExists, moduleResolutionState) + ); + }); + } else { + if (traceEnabled) { + trace2(host, Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths); + } + } + } + function secondaryLookup() { + const initialLocationForSecondaryLookup = containingFile && getDirectoryPath(containingFile); + if (initialLocationForSecondaryLookup !== void 0) { + let result22; + if (!options.typeRoots || !endsWith2(containingFile, inferredTypesContainingFile)) { + if (traceEnabled) { + trace2(host, Diagnostics.Looking_up_in_node_modules_folder_initial_location_0, initialLocationForSecondaryLookup); + } + if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) { + const searchResult = loadModuleFromNearestNodeModulesDirectory( + 4, + typeReferenceDirectiveName, + initialLocationForSecondaryLookup, + moduleResolutionState, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + result22 = searchResult && searchResult.value; + } else { + const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName); + result22 = nodeLoadModuleByRelativeName( + 4, + candidate, + /*onlyRecordFailures*/ + false, + moduleResolutionState, + /*considerPackageJson*/ + true + ); + } + } else if (traceEnabled) { + trace2(host, Diagnostics.Resolving_type_reference_directive_for_program_that_specifies_custom_typeRoots_skipping_lookup_in_node_modules_folder); + } + return resolvedTypeScriptOnly(result22); + } else { + if (traceEnabled) { + trace2(host, Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder); + } + } + } + } + function getNodeResolutionFeatures(options) { + let features3 = 0; + switch (getEmitModuleResolutionKind(options)) { + case 3: + features3 = 30; + break; + case 99: + features3 = 30; + break; + case 100: + features3 = 30; + break; + } + if (options.resolvePackageJsonExports) { + features3 |= 8; + } else if (options.resolvePackageJsonExports === false) { + features3 &= ~8; + } + if (options.resolvePackageJsonImports) { + features3 |= 2; + } else if (options.resolvePackageJsonImports === false) { + features3 &= ~2; + } + return features3; + } + function getConditions(options, resolutionMode) { + const moduleResolution = getEmitModuleResolutionKind(options); + if (resolutionMode === void 0) { + if (moduleResolution === 100) { + resolutionMode = 99; + } else if (moduleResolution === 2) { + return []; + } + } + const conditions = resolutionMode === 99 ? ["import"] : ["require"]; + if (!options.noDtsResolution) { + conditions.push("types"); + } + if (moduleResolution !== 100) { + conditions.push("node"); + } + return concatenate(conditions, options.customConditions); + } + function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) { + const moduleResolutionState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options); + return forEachAncestorDirectory(containingDirectory, (ancestorDirectory) => { + if (getBaseFileName(ancestorDirectory) !== "node_modules") { + const nodeModulesFolder = combinePaths(ancestorDirectory, "node_modules"); + const candidate = combinePaths(nodeModulesFolder, packageName); + return getPackageJsonInfo( + candidate, + /*onlyRecordFailures*/ + false, + moduleResolutionState + ); + } + }); + } + function getAutomaticTypeDirectiveNames(options, host) { + if (options.types) { + return options.types; + } + const result2 = []; + if (host.directoryExists && host.getDirectories) { + const typeRoots = getEffectiveTypeRoots(options, host); + if (typeRoots) { + for (const root2 of typeRoots) { + if (host.directoryExists(root2)) { + for (const typeDirectivePath of host.getDirectories(root2)) { + const normalized = normalizePath(typeDirectivePath); + const packageJsonPath = combinePaths(root2, normalized, "package.json"); + const isNotNeededPackage = host.fileExists(packageJsonPath) && readJson(packageJsonPath, host).typings === null; + if (!isNotNeededPackage) { + const baseFileName = getBaseFileName(normalized); + if (baseFileName.charCodeAt(0) !== 46) { + result2.push(baseFileName); + } + } + } + } + } + } + } + return result2; + } + function isPackageJsonInfo(entry) { + return !!(entry == null ? void 0 : entry.contents); + } + function isMissingPackageJsonInfo(entry) { + return !!entry && !entry.contents; + } + function compilerOptionValueToString(value2) { + var _a2; + if (value2 === null || typeof value2 !== "object") { + return "" + value2; + } + if (isArray3(value2)) { + return `[${(_a2 = value2.map((e10) => compilerOptionValueToString(e10))) == null ? void 0 : _a2.join(",")}]`; + } + let str2 = "{"; + for (const key in value2) { + if (hasProperty(value2, key)) { + str2 += `${key}: ${compilerOptionValueToString(value2[key])}`; + } + } + return str2 + "}"; + } + function getKeyForCompilerOptions(options, affectingOptionDeclarations) { + return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`; + } + function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) { + const redirectsMap = /* @__PURE__ */ new Map(); + const redirectsKeyToMap = /* @__PURE__ */ new Map(); + let ownMap = /* @__PURE__ */ new Map(); + if (ownOptions) + redirectsMap.set(ownOptions, ownMap); + return { + getMapOfCacheRedirects, + getOrCreateMapOfCacheRedirects, + update: update2, + clear: clear22, + getOwnMap: () => ownMap + }; + function getMapOfCacheRedirects(redirectedReference) { + return redirectedReference ? getOrCreateMap( + redirectedReference.commandLine.options, + /*create*/ + false + ) : ownMap; + } + function getOrCreateMapOfCacheRedirects(redirectedReference) { + return redirectedReference ? getOrCreateMap( + redirectedReference.commandLine.options, + /*create*/ + true + ) : ownMap; + } + function update2(newOptions) { + if (ownOptions !== newOptions) { + if (ownOptions) + ownMap = getOrCreateMap( + newOptions, + /*create*/ + true + ); + else + redirectsMap.set(newOptions, ownMap); + ownOptions = newOptions; + } + } + function getOrCreateMap(redirectOptions, create2) { + let result2 = redirectsMap.get(redirectOptions); + if (result2) + return result2; + const key = getRedirectsCacheKey(redirectOptions); + result2 = redirectsKeyToMap.get(key); + if (!result2) { + if (ownOptions) { + const ownKey = getRedirectsCacheKey(ownOptions); + if (ownKey === key) + result2 = ownMap; + else if (!redirectsKeyToMap.has(ownKey)) + redirectsKeyToMap.set(ownKey, ownMap); + } + if (create2) + result2 ?? (result2 = /* @__PURE__ */ new Map()); + if (result2) + redirectsKeyToMap.set(key, result2); + } + if (result2) + redirectsMap.set(redirectOptions, result2); + return result2; + } + function clear22() { + const ownKey = ownOptions && optionsToRedirectsKey.get(ownOptions); + ownMap.clear(); + redirectsMap.clear(); + optionsToRedirectsKey.clear(); + redirectsKeyToMap.clear(); + if (ownOptions) { + if (ownKey) + optionsToRedirectsKey.set(ownOptions, ownKey); + redirectsMap.set(ownOptions, ownMap); + } + } + function getRedirectsCacheKey(options) { + let result2 = optionsToRedirectsKey.get(options); + if (!result2) { + optionsToRedirectsKey.set(options, result2 = getKeyForCompilerOptions(options, moduleResolutionOptionDeclarations)); + } + return result2; + } + } + function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) { + let cache; + return { getPackageJsonInfo: getPackageJsonInfo2, setPackageJsonInfo, clear: clear22, getInternalMap }; + function getPackageJsonInfo2(packageJsonPath) { + return cache == null ? void 0 : cache.get(toPath2(packageJsonPath, currentDirectory, getCanonicalFileName)); + } + function setPackageJsonInfo(packageJsonPath, info2) { + (cache || (cache = /* @__PURE__ */ new Map())).set(toPath2(packageJsonPath, currentDirectory, getCanonicalFileName), info2); + } + function clear22() { + cache = void 0; + } + function getInternalMap() { + return cache; + } + } + function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create2) { + const cache = cacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference); + let result2 = cache.get(key); + if (!result2) { + result2 = create2(); + cache.set(key, result2); + } + return result2; + } + function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options, optionsToRedirectsKey) { + const directoryToModuleNameMap = createCacheWithRedirects(options, optionsToRedirectsKey); + return { + getFromDirectoryCache, + getOrCreateCacheForDirectory, + clear: clear22, + update: update2, + directoryToModuleNameMap + }; + function clear22() { + directoryToModuleNameMap.clear(); + } + function update2(options2) { + directoryToModuleNameMap.update(options2); + } + function getOrCreateCacheForDirectory(directoryName, redirectedReference) { + const path2 = toPath2(directoryName, currentDirectory, getCanonicalFileName); + return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path2, () => createModeAwareCache()); + } + function getFromDirectoryCache(name2, mode, directoryName, redirectedReference) { + var _a2, _b; + const path2 = toPath2(directoryName, currentDirectory, getCanonicalFileName); + return (_b = (_a2 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(path2)) == null ? void 0 : _b.get(name2, mode); + } + } + function createModeAwareCacheKey(specifier, mode) { + return mode === void 0 ? specifier : `${mode}|${specifier}`; + } + function createModeAwareCache() { + const underlying = /* @__PURE__ */ new Map(); + const memoizedReverseKeys = /* @__PURE__ */ new Map(); + const cache = { + get(specifier, mode) { + return underlying.get(getUnderlyingCacheKey(specifier, mode)); + }, + set(specifier, mode, value2) { + underlying.set(getUnderlyingCacheKey(specifier, mode), value2); + return cache; + }, + delete(specifier, mode) { + underlying.delete(getUnderlyingCacheKey(specifier, mode)); + return cache; + }, + has(specifier, mode) { + return underlying.has(getUnderlyingCacheKey(specifier, mode)); + }, + forEach(cb) { + return underlying.forEach((elem, key) => { + const [specifier, mode] = memoizedReverseKeys.get(key); + return cb(elem, specifier, mode); + }); + }, + size() { + return underlying.size; + } + }; + return cache; + function getUnderlyingCacheKey(specifier, mode) { + const result2 = createModeAwareCacheKey(specifier, mode); + memoizedReverseKeys.set(result2, [specifier, mode]); + return result2; + } + } + function getOriginalOrResolvedModuleFileName(result2) { + return result2.resolvedModule && (result2.resolvedModule.originalPath || result2.resolvedModule.resolvedFileName); + } + function getOriginalOrResolvedTypeReferenceFileName(result2) { + return result2.resolvedTypeReferenceDirective && (result2.resolvedTypeReferenceDirective.originalPath || result2.resolvedTypeReferenceDirective.resolvedFileName); + } + function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName, optionsToRedirectsKey) { + const moduleNameToDirectoryMap = createCacheWithRedirects(options, optionsToRedirectsKey); + return { + getFromNonRelativeNameCache, + getOrCreateCacheForNonRelativeName, + clear: clear22, + update: update2 + }; + function clear22() { + moduleNameToDirectoryMap.clear(); + } + function update2(options2) { + moduleNameToDirectoryMap.update(options2); + } + function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) { + var _a2, _b; + Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); + return (_b = (_a2 = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName); + } + function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) { + Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName)); + return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache); + } + function createPerModuleNameCache() { + const directoryPathMap = /* @__PURE__ */ new Map(); + return { get: get4, set: set4 }; + function get4(directory) { + return directoryPathMap.get(toPath2(directory, currentDirectory, getCanonicalFileName)); + } + function set4(directory, result2) { + const path2 = toPath2(directory, currentDirectory, getCanonicalFileName); + if (directoryPathMap.has(path2)) { + return; + } + directoryPathMap.set(path2, result2); + const resolvedFileName = getResolvedFileName(result2); + const commonPrefix = resolvedFileName && getCommonPrefix(path2, resolvedFileName); + let current = path2; + while (current !== commonPrefix) { + const parent22 = getDirectoryPath(current); + if (parent22 === current || directoryPathMap.has(parent22)) { + break; + } + directoryPathMap.set(parent22, result2); + current = parent22; + } + } + function getCommonPrefix(directory, resolution) { + const resolutionDirectory = toPath2(getDirectoryPath(resolution), currentDirectory, getCanonicalFileName); + let i7 = 0; + const limit = Math.min(directory.length, resolutionDirectory.length); + while (i7 < limit && directory.charCodeAt(i7) === resolutionDirectory.charCodeAt(i7)) { + i7++; + } + if (i7 === directory.length && (resolutionDirectory.length === i7 || resolutionDirectory[i7] === directorySeparator)) { + return directory; + } + const rootLength = getRootLength(directory); + if (i7 < rootLength) { + return void 0; + } + const sep2 = directory.lastIndexOf(directorySeparator, i7 - 1); + if (sep2 === -1) { + return void 0; + } + return directory.substr(0, Math.max(sep2, rootLength)); + } + } + } + function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName, optionsToRedirectsKey) { + optionsToRedirectsKey ?? (optionsToRedirectsKey = /* @__PURE__ */ new Map()); + const perDirectoryResolutionCache = createPerDirectoryResolutionCache( + currentDirectory, + getCanonicalFileName, + options, + optionsToRedirectsKey + ); + const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache( + currentDirectory, + getCanonicalFileName, + options, + getResolvedFileName, + optionsToRedirectsKey + ); + packageJsonInfoCache ?? (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName)); + return { + ...packageJsonInfoCache, + ...perDirectoryResolutionCache, + ...nonRelativeNameResolutionCache, + clear: clear22, + update: update2, + getPackageJsonInfoCache: () => packageJsonInfoCache, + clearAllExceptPackageJsonInfoCache, + optionsToRedirectsKey + }; + function clear22() { + clearAllExceptPackageJsonInfoCache(); + packageJsonInfoCache.clear(); + } + function clearAllExceptPackageJsonInfoCache() { + perDirectoryResolutionCache.clear(); + nonRelativeNameResolutionCache.clear(); + } + function update2(options2) { + perDirectoryResolutionCache.update(options2); + nonRelativeNameResolutionCache.update(options2); + } + } + function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { + const result2 = createModuleOrTypeReferenceResolutionCache( + currentDirectory, + getCanonicalFileName, + options, + packageJsonInfoCache, + getOriginalOrResolvedModuleFileName, + optionsToRedirectsKey + ); + result2.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result2.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference); + return result2; + } + function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) { + return createModuleOrTypeReferenceResolutionCache( + currentDirectory, + getCanonicalFileName, + options, + packageJsonInfoCache, + getOriginalOrResolvedTypeReferenceFileName, + optionsToRedirectsKey + ); + } + function getOptionsForLibraryResolution(options) { + return { moduleResolution: 2, traceResolution: options.traceResolution }; + } + function resolveLibrary(libraryName, resolveFrom, compilerOptions, host, cache) { + return resolveModuleName(libraryName, resolveFrom, getOptionsForLibraryResolution(compilerOptions), host, cache); + } + function resolveModuleNameFromCache(moduleName3, containingFile, cache, mode) { + const containingDirectory = getDirectoryPath(containingFile); + return cache.getFromDirectoryCache( + moduleName3, + mode, + containingDirectory, + /*redirectedReference*/ + void 0 + ); + } + function resolveModuleName(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + var _a2, _b, _c; + const traceEnabled = isTraceEnabled(compilerOptions, host); + if (redirectedReference) { + compilerOptions = redirectedReference.commandLine.options; + } + if (traceEnabled) { + trace2(host, Diagnostics.Resolving_module_0_from_1, moduleName3, containingFile); + if (redirectedReference) { + trace2(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); + } + } + const containingDirectory = getDirectoryPath(containingFile); + let result2 = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName3, resolutionMode, containingDirectory, redirectedReference); + if (result2) { + if (traceEnabled) { + trace2(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName3, containingDirectory); + } + } else { + let moduleResolution = compilerOptions.moduleResolution; + if (moduleResolution === void 0) { + moduleResolution = getEmitModuleResolutionKind(compilerOptions); + if (traceEnabled) { + trace2(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]); + } + } else { + if (traceEnabled) { + trace2(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]); + } + } + (_a2 = perfLogger) == null ? void 0 : _a2.logStartResolveModule(moduleName3); + switch (moduleResolution) { + case 3: + result2 = node16ModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + break; + case 99: + result2 = nodeNextModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + break; + case 2: + result2 = nodeModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0); + break; + case 1: + result2 = classicNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference); + break; + case 100: + result2 = bundlerModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode) : void 0); + break; + default: + return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`); + } + if (result2 && result2.resolvedModule) + (_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName3}" resolved to "${result2.resolvedModule.resolvedFileName}"`); + (_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result2 && result2.resolvedModule ? "" + result2.resolvedModule.resolvedFileName : "null"); + if (cache && !cache.isReadonly) { + cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName3, resolutionMode, result2); + if (!isExternalModuleNameRelative(moduleName3)) { + cache.getOrCreateCacheForNonRelativeName(moduleName3, resolutionMode, redirectedReference).set(containingDirectory, result2); + } + } + } + if (traceEnabled) { + if (result2.resolvedModule) { + if (result2.resolvedModule.packageId) { + trace2(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName3, result2.resolvedModule.resolvedFileName, packageIdToString(result2.resolvedModule.packageId)); + } else { + trace2(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName3, result2.resolvedModule.resolvedFileName); + } + } else { + trace2(host, Diagnostics.Module_name_0_was_not_resolved, moduleName3); + } + } + return result2; + } + function tryLoadModuleUsingOptionalResolutionSettings(extensions6, moduleName3, containingDirectory, loader2, state) { + const resolved = tryLoadModuleUsingPathsIfEligible(extensions6, moduleName3, loader2, state); + if (resolved) + return resolved.value; + if (!isExternalModuleNameRelative(moduleName3)) { + return tryLoadModuleUsingBaseUrl(extensions6, moduleName3, loader2, state); + } else { + return tryLoadModuleUsingRootDirs(extensions6, moduleName3, containingDirectory, loader2, state); + } + } + function tryLoadModuleUsingPathsIfEligible(extensions6, moduleName3, loader2, state) { + var _a2; + const { baseUrl, paths, configFile } = state.compilerOptions; + if (paths && !pathIsRelative(moduleName3)) { + if (state.traceEnabled) { + if (baseUrl) { + trace2(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName3); + } + trace2(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName3); + } + const baseDirectory = getPathsBasePath(state.compilerOptions, state.host); + const pathPatterns = (configFile == null ? void 0 : configFile.configFileSpecs) ? (_a2 = configFile.configFileSpecs).pathPatterns || (_a2.pathPatterns = tryParsePatterns(paths)) : void 0; + return tryLoadModuleUsingPaths( + extensions6, + moduleName3, + baseDirectory, + paths, + pathPatterns, + loader2, + /*onlyRecordFailures*/ + false, + state + ); + } + } + function tryLoadModuleUsingRootDirs(extensions6, moduleName3, containingDirectory, loader2, state) { + if (!state.compilerOptions.rootDirs) { + return void 0; + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName3); + } + const candidate = normalizePath(combinePaths(containingDirectory, moduleName3)); + let matchedRootDir; + let matchedNormalizedPrefix; + for (const rootDir of state.compilerOptions.rootDirs) { + let normalizedRoot = normalizePath(rootDir); + if (!endsWith2(normalizedRoot, directorySeparator)) { + normalizedRoot += directorySeparator; + } + const isLongestMatchingPrefix = startsWith2(candidate, normalizedRoot) && (matchedNormalizedPrefix === void 0 || matchedNormalizedPrefix.length < normalizedRoot.length); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); + } + if (isLongestMatchingPrefix) { + matchedNormalizedPrefix = normalizedRoot; + matchedRootDir = rootDir; + } + } + if (matchedNormalizedPrefix) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); + } + const suffix = candidate.substr(matchedNormalizedPrefix.length); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); + } + const resolvedFileName = loader2(extensions6, candidate, !directoryProbablyExists(containingDirectory, state.host), state); + if (resolvedFileName) { + return resolvedFileName; + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Trying_other_entries_in_rootDirs); + } + for (const rootDir of state.compilerOptions.rootDirs) { + if (rootDir === matchedRootDir) { + continue; + } + const candidate2 = combinePaths(normalizePath(rootDir), suffix); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate2); + } + const baseDirectory = getDirectoryPath(candidate2); + const resolvedFileName2 = loader2(extensions6, candidate2, !directoryProbablyExists(baseDirectory, state.host), state); + if (resolvedFileName2) { + return resolvedFileName2; + } + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Module_resolution_using_rootDirs_has_failed); + } + } + return void 0; + } + function tryLoadModuleUsingBaseUrl(extensions6, moduleName3, loader2, state) { + const { baseUrl } = state.compilerOptions; + if (!baseUrl) { + return void 0; + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName3); + } + const candidate = normalizePath(combinePaths(baseUrl, moduleName3)); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName3, baseUrl, candidate); + } + return loader2(extensions6, candidate, !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); + } + function resolveJSModule(moduleName3, initialDir, host) { + const { resolvedModule, failedLookupLocations } = tryResolveJSModuleWorker(moduleName3, initialDir, host); + if (!resolvedModule) { + throw new Error(`Could not resolve JS module '${moduleName3}' starting at '${initialDir}'. Looked in: ${failedLookupLocations == null ? void 0 : failedLookupLocations.join(", ")}`); + } + return resolvedModule.resolvedFileName; + } + function node16ModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + return nodeNextModuleNameResolverWorker( + 30, + moduleName3, + containingFile, + compilerOptions, + host, + cache, + redirectedReference, + resolutionMode + ); + } + function nodeNextModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { + return nodeNextModuleNameResolverWorker( + 30, + moduleName3, + containingFile, + compilerOptions, + host, + cache, + redirectedReference, + resolutionMode + ); + } + function nodeNextModuleNameResolverWorker(features3, moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) { + const containingDirectory = getDirectoryPath(containingFile); + const esmMode = resolutionMode === 99 ? 32 : 0; + let extensions6 = compilerOptions.noDtsResolution ? 3 : 1 | 2 | 4; + if (getResolveJsonModule(compilerOptions)) { + extensions6 |= 8; + } + return nodeModuleNameResolverWorker( + features3 | esmMode, + moduleName3, + containingDirectory, + compilerOptions, + host, + cache, + extensions6, + /*isConfigLookup*/ + false, + redirectedReference, + conditions + ); + } + function tryResolveJSModuleWorker(moduleName3, initialDir, host) { + return nodeModuleNameResolverWorker( + 0, + moduleName3, + initialDir, + { moduleResolution: 2, allowJs: true }, + host, + /*cache*/ + void 0, + 2, + /*isConfigLookup*/ + false, + /*redirectedReference*/ + void 0, + /*conditions*/ + void 0 + ); + } + function bundlerModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, conditions) { + const containingDirectory = getDirectoryPath(containingFile); + let extensions6 = compilerOptions.noDtsResolution ? 3 : 1 | 2 | 4; + if (getResolveJsonModule(compilerOptions)) { + extensions6 |= 8; + } + return nodeModuleNameResolverWorker( + getNodeResolutionFeatures(compilerOptions), + moduleName3, + containingDirectory, + compilerOptions, + host, + cache, + extensions6, + /*isConfigLookup*/ + false, + redirectedReference, + conditions + ); + } + function nodeModuleNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) { + let extensions6; + if (isConfigLookup) { + extensions6 = 8; + } else if (compilerOptions.noDtsResolution) { + extensions6 = 3; + if (getResolveJsonModule(compilerOptions)) + extensions6 |= 8; + } else { + extensions6 = getResolveJsonModule(compilerOptions) ? 1 | 2 | 4 | 8 : 1 | 2 | 4; + } + return nodeModuleNameResolverWorker(conditions ? 30 : 0, moduleName3, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions6, !!isConfigLookup, redirectedReference, conditions); + } + function nodeNextJsonConfigResolver(moduleName3, containingFile, host) { + return nodeModuleNameResolverWorker( + 30, + moduleName3, + getDirectoryPath(containingFile), + { + moduleResolution: 99 + /* NodeNext */ + }, + host, + /*cache*/ + void 0, + 8, + /*isConfigLookup*/ + true, + /*redirectedReference*/ + void 0, + /*conditions*/ + void 0 + ); + } + function nodeModuleNameResolverWorker(features3, moduleName3, containingDirectory, compilerOptions, host, cache, extensions6, isConfigLookup, redirectedReference, conditions) { + var _a2, _b, _c, _d, _e2; + const traceEnabled = isTraceEnabled(compilerOptions, host); + const failedLookupLocations = []; + const affectingLocations = []; + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + conditions ?? (conditions = getConditions( + compilerOptions, + moduleResolution === 100 || moduleResolution === 2 ? void 0 : features3 & 32 ? 99 : 1 + /* CommonJS */ + )); + const diagnostics = []; + const state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: features3, + conditions: conditions ?? emptyArray, + requestContainingDirectory: containingDirectory, + reportDiagnostic: (diag2) => void diagnostics.push(diag2), + isConfigLookup, + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false + }; + if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + trace2(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features3 & 32 ? "ESM" : "CJS", state.conditions.map((c7) => `'${c7}'`).join(", ")); + } + let result2; + if (moduleResolution === 2) { + const priorityExtensions = extensions6 & (1 | 4); + const secondaryExtensions = extensions6 & ~(1 | 4); + result2 = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0; + } else { + result2 = tryResolve(extensions6, state); + } + let alternateResult; + if (state.resolvedPackageDirectory && !isConfigLookup && !isExternalModuleNameRelative(moduleName3)) { + const wantedTypesButGotJs = (result2 == null ? void 0 : result2.value) && extensions6 & (1 | 4) && !extensionIsOk(1 | 4, result2.value.resolved.extension); + if (((_a2 = result2 == null ? void 0 : result2.value) == null ? void 0 : _a2.isExternalLibraryImport) && wantedTypesButGotJs && features3 & 8 && (conditions == null ? void 0 : conditions.includes("import"))) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update); + const diagnosticState = { + ...state, + features: state.features & ~8, + reportDiagnostic: noop4 + }; + const diagnosticResult = tryResolve(extensions6 & (1 | 4), diagnosticState); + if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) { + alternateResult = diagnosticResult.value.resolved.path; + } + } else if ((!(result2 == null ? void 0 : result2.value) || wantedTypesButGotJs) && moduleResolution === 2) { + traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_moduleResolution_bundler_to_see_if_project_may_need_configuration_update); + const diagnosticsCompilerOptions = { + ...state.compilerOptions, + moduleResolution: 100 + /* Bundler */ + }; + const diagnosticState = { + ...state, + compilerOptions: diagnosticsCompilerOptions, + features: 30, + conditions: getConditions(diagnosticsCompilerOptions), + reportDiagnostic: noop4 + }; + const diagnosticResult = tryResolve(extensions6 & (1 | 4), diagnosticState); + if ((_c = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _c.isExternalLibraryImport) { + alternateResult = diagnosticResult.value.resolved.path; + } + } + } + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName3, + (_d = result2 == null ? void 0 : result2.value) == null ? void 0 : _d.resolved, + (_e2 = result2 == null ? void 0 : result2.value) == null ? void 0 : _e2.isExternalLibraryImport, + failedLookupLocations, + affectingLocations, + diagnostics, + state, + cache, + alternateResult + ); + function tryResolve(extensions22, state2) { + const loader2 = (extensions32, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName( + extensions32, + candidate, + onlyRecordFailures, + state3, + /*considerPackageJson*/ + true + ); + const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions22, moduleName3, containingDirectory, loader2, state2); + if (resolved) { + return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) }); + } + if (!isExternalModuleNameRelative(moduleName3)) { + let resolved2; + if (features3 & 2 && startsWith2(moduleName3, "#")) { + resolved2 = loadModuleFromImports(extensions22, moduleName3, containingDirectory, state2, cache, redirectedReference); + } + if (!resolved2 && features3 & 4) { + resolved2 = loadModuleFromSelfNameReference(extensions22, moduleName3, containingDirectory, state2, cache, redirectedReference); + } + if (!resolved2) { + if (moduleName3.includes(":")) { + if (traceEnabled) { + trace2(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName3, formatExtensions(extensions22)); + } + return void 0; + } + if (traceEnabled) { + trace2(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName3, formatExtensions(extensions22)); + } + resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions22, moduleName3, containingDirectory, state2, cache, redirectedReference); + } + if (extensions22 & 4) { + resolved2 ?? (resolved2 = resolveFromTypeRoot(moduleName3, state2)); + } + return resolved2 && { value: resolved2.value && { resolved: resolved2.value, isExternalLibraryImport: true } }; + } else { + const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName3); + const resolved2 = nodeLoadModuleByRelativeName( + extensions22, + candidate, + /*onlyRecordFailures*/ + false, + state2, + /*considerPackageJson*/ + true + ); + return resolved2 && toSearchResult({ resolved: resolved2, isExternalLibraryImport: contains2(parts, "node_modules") }); + } + } + } + function normalizePathForCJSResolution(containingDirectory, moduleName3) { + const combined = combinePaths(containingDirectory, moduleName3); + const parts = getPathComponents(combined); + const lastPart = lastOrUndefined(parts); + const path2 = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath(combined)) : normalizePath(combined); + return { path: path2, parts }; + } + function realPath(path2, host, traceEnabled) { + if (!host.realpath) { + return path2; + } + const real = normalizePath(host.realpath(path2)); + if (traceEnabled) { + trace2(host, Diagnostics.Resolving_real_path_for_0_result_1, path2, real); + } + return real; + } + function nodeLoadModuleByRelativeName(extensions6, candidate, onlyRecordFailures, state, considerPackageJson) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_types_Colon_1, candidate, formatExtensions(extensions6)); + } + if (!hasTrailingDirectorySeparator(candidate)) { + if (!onlyRecordFailures) { + const parentOfCandidate = getDirectoryPath(candidate); + if (!directoryProbablyExists(parentOfCandidate, state.host)) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); + } + onlyRecordFailures = true; + } + } + const resolvedFromFile = loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state); + if (resolvedFromFile) { + const packageDirectory = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile.path) : void 0; + const packageInfo = packageDirectory ? getPackageJsonInfo( + packageDirectory, + /*onlyRecordFailures*/ + false, + state + ) : void 0; + return withPackageId(packageInfo, resolvedFromFile); + } + } + if (!onlyRecordFailures) { + const candidateExists = directoryProbablyExists(candidate, state.host); + if (!candidateExists) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); + } + onlyRecordFailures = true; + } + } + if (!(state.features & 32)) { + return loadNodeModuleFromDirectory(extensions6, candidate, onlyRecordFailures, state, considerPackageJson); + } + return void 0; + } + function pathContainsNodeModules(path2) { + return path2.includes(nodeModulesPathPart); + } + function parseNodeModuleFromPath(resolved, isFolder) { + const path2 = normalizePath(resolved); + const idx = path2.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return void 0; + } + const indexAfterNodeModules = idx + nodeModulesPathPart.length; + let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterNodeModules, isFolder); + if (path2.charCodeAt(indexAfterNodeModules) === 64) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterPackageName, isFolder); + } + return path2.slice(0, indexAfterPackageName); + } + function moveToNextDirectorySeparatorIfAvailable(path2, prevSeparatorIndex, isFolder) { + const nextSeparatorIndex = path2.indexOf(directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? isFolder ? path2.length : prevSeparatorIndex : nextSeparatorIndex; + } + function loadModuleFromFileNoPackageId(extensions6, candidate, onlyRecordFailures, state) { + return noPackageId(loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state)); + } + function loadModuleFromFile(extensions6, candidate, onlyRecordFailures, state) { + const resolvedByReplacingExtension = loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state); + if (resolvedByReplacingExtension) { + return resolvedByReplacingExtension; + } + if (!(state.features & 32)) { + const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions6, "", onlyRecordFailures, state); + if (resolvedByAddingExtension) { + return resolvedByAddingExtension; + } + } + } + function loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state) { + const filename = getBaseFileName(candidate); + if (!filename.includes(".")) { + return void 0; + } + let extensionless = removeFileExtension(candidate); + if (extensionless === candidate) { + extensionless = candidate.substring(0, candidate.lastIndexOf(".")); + } + const extension = candidate.substring(extensionless.length); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); + } + return tryAddingExtensions(extensionless, extensions6, extension, onlyRecordFailures, state); + } + function loadFileNameFromPackageJsonField(extensions6, candidate, onlyRecordFailures, state) { + if (extensions6 & 1 && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions6 & 4 && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) { + const result2 = tryFile(candidate, onlyRecordFailures, state); + return result2 !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0; + } + if (state.isConfigLookup && extensions6 === 8 && fileExtensionIs( + candidate, + ".json" + /* Json */ + )) { + const result2 = tryFile(candidate, onlyRecordFailures, state); + return result2 !== void 0 ? { path: candidate, ext: ".json", resolvedUsingTsExtension: void 0 } : void 0; + } + return loadModuleFromFileNoImplicitExtensions(extensions6, candidate, onlyRecordFailures, state); + } + function tryAddingExtensions(candidate, extensions6, originalExtension, onlyRecordFailures, state) { + if (!onlyRecordFailures) { + const directory = getDirectoryPath(candidate); + if (directory) { + onlyRecordFailures = !directoryProbablyExists(directory, state.host); + } + } + switch (originalExtension) { + case ".mjs": + case ".mts": + case ".d.mts": + return extensions6 & 1 && tryExtension( + ".mts", + originalExtension === ".mts" || originalExtension === ".d.mts" + /* Dmts */ + ) || extensions6 & 4 && tryExtension( + ".d.mts", + originalExtension === ".mts" || originalExtension === ".d.mts" + /* Dmts */ + ) || extensions6 & 2 && tryExtension( + ".mjs" + /* Mjs */ + ) || void 0; + case ".cjs": + case ".cts": + case ".d.cts": + return extensions6 & 1 && tryExtension( + ".cts", + originalExtension === ".cts" || originalExtension === ".d.cts" + /* Dcts */ + ) || extensions6 & 4 && tryExtension( + ".d.cts", + originalExtension === ".cts" || originalExtension === ".d.cts" + /* Dcts */ + ) || extensions6 & 2 && tryExtension( + ".cjs" + /* Cjs */ + ) || void 0; + case ".json": + return extensions6 & 4 && tryExtension(".d.json.ts") || extensions6 & 8 && tryExtension( + ".json" + /* Json */ + ) || void 0; + case ".tsx": + case ".jsx": + return extensions6 & 1 && (tryExtension( + ".tsx", + originalExtension === ".tsx" + /* Tsx */ + ) || tryExtension( + ".ts", + originalExtension === ".tsx" + /* Tsx */ + )) || extensions6 & 4 && tryExtension( + ".d.ts", + originalExtension === ".tsx" + /* Tsx */ + ) || extensions6 & 2 && (tryExtension( + ".jsx" + /* Jsx */ + ) || tryExtension( + ".js" + /* Js */ + )) || void 0; + case ".ts": + case ".d.ts": + case ".js": + case "": + return extensions6 & 1 && (tryExtension( + ".ts", + originalExtension === ".ts" || originalExtension === ".d.ts" + /* Dts */ + ) || tryExtension( + ".tsx", + originalExtension === ".ts" || originalExtension === ".d.ts" + /* Dts */ + )) || extensions6 & 4 && tryExtension( + ".d.ts", + originalExtension === ".ts" || originalExtension === ".d.ts" + /* Dts */ + ) || extensions6 & 2 && (tryExtension( + ".js" + /* Js */ + ) || tryExtension( + ".jsx" + /* Jsx */ + )) || state.isConfigLookup && tryExtension( + ".json" + /* Json */ + ) || void 0; + default: + return extensions6 & 4 && !isDeclarationFileName(candidate + originalExtension) && tryExtension(`.d${originalExtension}.ts`) || void 0; + } + function tryExtension(ext, resolvedUsingTsExtension) { + const path2 = tryFile(candidate + ext, onlyRecordFailures, state); + return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension: !state.candidateIsFromPackageJsonField && resolvedUsingTsExtension }; + } + } + function tryFile(fileName, onlyRecordFailures, state) { + var _a2; + if (!((_a2 = state.compilerOptions.moduleSuffixes) == null ? void 0 : _a2.length)) { + return tryFileLookup(fileName, onlyRecordFailures, state); + } + const ext = tryGetExtensionFromPath2(fileName) ?? ""; + const fileNameNoExtension = ext ? removeExtension(fileName, ext) : fileName; + return forEach4(state.compilerOptions.moduleSuffixes, (suffix) => tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state)); + } + function tryFileLookup(fileName, onlyRecordFailures, state) { + var _a2; + if (!onlyRecordFailures) { + if (state.host.fileExists(fileName)) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.File_0_exists_use_it_as_a_name_resolution_result, fileName); + } + return fileName; + } else { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.File_0_does_not_exist, fileName); + } + } + } + (_a2 = state.failedLookupLocations) == null ? void 0 : _a2.push(fileName); + return void 0; + } + function loadNodeModuleFromDirectory(extensions6, candidate, onlyRecordFailures, state, considerPackageJson = true) { + const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0; + const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent; + const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state); + return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions6, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)); + } + function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) { + if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) { + return packageJsonInfo.contents.resolvedEntrypoints; + } + let entrypoints; + const extensions6 = 1 | 4 | (resolveJs ? 2 : 0); + const features3 = getNodeResolutionFeatures(options); + const loadPackageJsonMainState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options); + loadPackageJsonMainState.conditions = getConditions(options); + loadPackageJsonMainState.requestContainingDirectory = packageJsonInfo.packageDirectory; + const mainResolution = loadNodeModuleFromDirectoryWorker( + extensions6, + packageJsonInfo.packageDirectory, + /*onlyRecordFailures*/ + false, + loadPackageJsonMainState, + packageJsonInfo.contents.packageJsonContent, + getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState) + ); + entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path); + if (features3 & 8 && packageJsonInfo.contents.packageJsonContent.exports) { + const conditionSets = deduplicate( + [getConditions( + options, + 99 + /* ESNext */ + ), getConditions( + options, + 1 + /* CommonJS */ + )], + arrayIsEqualTo + ); + for (const conditions of conditionSets) { + const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host }; + const exportResolutions = loadEntrypointsFromExportMap( + packageJsonInfo, + packageJsonInfo.contents.packageJsonContent.exports, + loadPackageJsonExportsState, + extensions6 + ); + if (exportResolutions) { + for (const resolution of exportResolutions) { + entrypoints = appendIfUnique(entrypoints, resolution.path); + } + } + } + } + return packageJsonInfo.contents.resolvedEntrypoints = entrypoints || false; + } + function loadEntrypointsFromExportMap(scope, exports29, state, extensions6) { + let entrypoints; + if (isArray3(exports29)) { + for (const target of exports29) { + loadEntrypointsFromTargetExports(target); + } + } else if (typeof exports29 === "object" && exports29 !== null && allKeysStartWithDot(exports29)) { + for (const key in exports29) { + loadEntrypointsFromTargetExports(exports29[key]); + } + } else { + loadEntrypointsFromTargetExports(exports29); + } + return entrypoints; + function loadEntrypointsFromTargetExports(target) { + var _a2, _b; + if (typeof target === "string" && startsWith2(target, "./")) { + if (target.includes("*") && state.host.readDirectory) { + if (target.indexOf("*") !== target.lastIndexOf("*")) { + return false; + } + state.host.readDirectory( + scope.packageDirectory, + extensionsToExtensionsArray(extensions6), + /*excludes*/ + void 0, + [ + changeFullExtension(replaceFirstStar(target, "**/*"), ".*") + ] + ).forEach((entry) => { + entrypoints = appendIfUnique(entrypoints, { + path: entry, + ext: getAnyExtensionFromPath(entry), + resolvedUsingTsExtension: void 0 + }); + }); + } else { + const partsAfterFirst = getPathComponents(target).slice(2); + if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) { + return false; + } + const resolvedTarget = combinePaths(scope.packageDirectory, target); + const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); + const result2 = loadFileNameFromPackageJsonField( + extensions6, + finalPath, + /*onlyRecordFailures*/ + false, + state + ); + if (result2) { + entrypoints = appendIfUnique(entrypoints, result2, (a7, b8) => a7.path === b8.path); + return true; + } + } + } else if (Array.isArray(target)) { + for (const t8 of target) { + const success = loadEntrypointsFromTargetExports(t8); + if (success) { + return true; + } + } + } else if (typeof target === "object" && target !== null) { + return forEach4(getOwnKeys(target), (key) => { + if (key === "default" || contains2(state.conditions, key) || isApplicableVersionedTypesKey(state.conditions, key)) { + loadEntrypointsFromTargetExports(target[key]); + return true; + } + }); + } + } + } + function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) { + return { + host, + compilerOptions: options, + traceEnabled: isTraceEnabled(options, host), + failedLookupLocations: void 0, + affectingLocations: void 0, + packageJsonInfoCache, + features: 0, + conditions: emptyArray, + requestContainingDirectory: void 0, + reportDiagnostic: noop4, + isConfigLookup: false, + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false + }; + } + function getPackageScopeForPath(fileName, state) { + const parts = getPathComponents(fileName); + parts.pop(); + while (parts.length > 0) { + const pkg = getPackageJsonInfo( + getPathFromPathComponents(parts), + /*onlyRecordFailures*/ + false, + state + ); + if (pkg) { + return pkg; + } + parts.pop(); + } + return void 0; + } + function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) { + if (packageJsonInfo.contents.versionPaths === void 0) { + packageJsonInfo.contents.versionPaths = readPackageJsonTypesVersionPaths(packageJsonInfo.contents.packageJsonContent, state) || false; + } + return packageJsonInfo.contents.versionPaths || void 0; + } + function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { + var _a2, _b, _c, _d, _e2, _f; + const { host, traceEnabled } = state; + const packageJsonPath = combinePaths(packageDirectory, "package.json"); + if (onlyRecordFailures) { + (_a2 = state.failedLookupLocations) == null ? void 0 : _a2.push(packageJsonPath); + return void 0; + } + const existing = (_b = state.packageJsonInfoCache) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath); + if (existing !== void 0) { + if (isPackageJsonInfo(existing)) { + if (traceEnabled) + trace2(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath); + (_c = state.affectingLocations) == null ? void 0 : _c.push(packageJsonPath); + return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents }; + } else { + if (existing.directoryExists && traceEnabled) + trace2(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath); + (_d = state.failedLookupLocations) == null ? void 0 : _d.push(packageJsonPath); + return void 0; + } + } + const directoryExists = directoryProbablyExists(packageDirectory, host); + if (directoryExists && host.fileExists(packageJsonPath)) { + const packageJsonContent = readJson(packageJsonPath, host); + if (traceEnabled) { + trace2(host, Diagnostics.Found_package_json_at_0, packageJsonPath); + } + const result2 = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } }; + if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly) + state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result2); + (_e2 = state.affectingLocations) == null ? void 0 : _e2.push(packageJsonPath); + return result2; + } else { + if (directoryExists && traceEnabled) { + trace2(host, Diagnostics.File_0_does_not_exist, packageJsonPath); + } + if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly) + state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, { packageDirectory, directoryExists }); + (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath); + } + } + function loadNodeModuleFromDirectoryWorker(extensions6, candidate, onlyRecordFailures, state, jsonContent, versionPaths) { + let packageFile; + if (jsonContent) { + if (state.isConfigLookup) { + packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); + } else { + packageFile = extensions6 & 4 && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions6 & (3 | 4) && readPackageJsonMainField(jsonContent, candidate, state) || void 0; + } + } + const loader2 = (extensions22, candidate2, onlyRecordFailures2, state2) => { + const fromFile2 = loadFileNameFromPackageJsonField(extensions22, candidate2, onlyRecordFailures2, state2); + if (fromFile2) { + return noPackageId(fromFile2); + } + const expandedExtensions = extensions22 === 4 ? 1 | 4 : extensions22; + const features3 = state2.features; + const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField; + state2.candidateIsFromPackageJsonField = true; + if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") { + state2.features &= ~32; + } + const result2 = nodeLoadModuleByRelativeName( + expandedExtensions, + candidate2, + onlyRecordFailures2, + state2, + /*considerPackageJson*/ + false + ); + state2.features = features3; + state2.candidateIsFromPackageJsonField = candidateIsFromPackageJsonField; + return result2; + }; + const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0; + const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host); + const indexPath = combinePaths(candidate, state.isConfigLookup ? "tsconfig" : "index"); + if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) { + const moduleName3 = getRelativePathFromDirectory( + candidate, + packageFile || indexPath, + /*ignoreCase*/ + false + ); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version5, moduleName3); + } + const result2 = tryLoadModuleUsingPaths( + extensions6, + moduleName3, + candidate, + versionPaths.paths, + /*pathPatterns*/ + void 0, + loader2, + onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, + state + ); + if (result2) { + return removeIgnoredPackageId(result2.value); + } + } + const packageFileResult = packageFile && removeIgnoredPackageId(loader2(extensions6, packageFile, onlyRecordFailuresForPackageFile, state)); + if (packageFileResult) + return packageFileResult; + if (!(state.features & 32)) { + return loadModuleFromFile(extensions6, indexPath, onlyRecordFailuresForIndex, state); + } + } + function extensionIsOk(extensions6, extension) { + return extensions6 & 2 && (extension === ".js" || extension === ".jsx" || extension === ".mjs" || extension === ".cjs") || extensions6 & 1 && (extension === ".ts" || extension === ".tsx" || extension === ".mts" || extension === ".cts") || extensions6 & 4 && (extension === ".d.ts" || extension === ".d.mts" || extension === ".d.cts") || extensions6 & 8 && extension === ".json" || false; + } + function parsePackageName(moduleName3) { + let idx = moduleName3.indexOf(directorySeparator); + if (moduleName3[0] === "@") { + idx = moduleName3.indexOf(directorySeparator, idx + 1); + } + return idx === -1 ? { packageName: moduleName3, rest: "" } : { packageName: moduleName3.slice(0, idx), rest: moduleName3.slice(idx + 1) }; + } + function allKeysStartWithDot(obj) { + return every2(getOwnKeys(obj), (k6) => startsWith2(k6, ".")); + } + function noKeyStartsWithDot(obj) { + return !some2(getOwnKeys(obj), (k6) => startsWith2(k6, ".")); + } + function loadModuleFromSelfNameReference(extensions6, moduleName3, directory, state, cache, redirectedReference) { + var _a2, _b; + const directoryPath = getNormalizedAbsolutePath(combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); + const scope = getPackageScopeForPath(directoryPath, state); + if (!scope || !scope.contents.packageJsonContent.exports) { + return void 0; + } + if (typeof scope.contents.packageJsonContent.name !== "string") { + return void 0; + } + const parts = getPathComponents(moduleName3); + const nameParts = getPathComponents(scope.contents.packageJsonContent.name); + if (!every2(nameParts, (p7, i7) => parts[i7] === p7)) { + return void 0; + } + const trailingParts = parts.slice(nameParts.length); + const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`; + if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) { + return loadModuleFromExports(scope, extensions6, subpath, state, cache, redirectedReference); + } + const priorityExtensions = extensions6 & (1 | 4); + const secondaryExtensions = extensions6 & ~(1 | 4); + return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference); + } + function loadModuleFromExports(scope, extensions6, subpath, state, cache, redirectedReference) { + if (!scope.contents.packageJsonContent.exports) { + return void 0; + } + if (subpath === ".") { + let mainExport; + if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports)) { + mainExport = scope.contents.packageJsonContent.exports; + } else if (hasProperty(scope.contents.packageJsonContent.exports, ".")) { + mainExport = scope.contents.packageJsonContent.exports["."]; + } + if (mainExport) { + const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport( + extensions6, + state, + cache, + redirectedReference, + subpath, + scope, + /*isImports*/ + false + ); + return loadModuleFromTargetImportOrExport( + mainExport, + "", + /*pattern*/ + false, + "." + ); + } + } else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) { + if (typeof scope.contents.packageJsonContent.exports !== "object") { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + const result2 = loadModuleFromImportsOrExports( + extensions6, + state, + cache, + redirectedReference, + subpath, + scope.contents.packageJsonContent.exports, + scope, + /*isImports*/ + false + ); + if (result2) { + return result2; + } + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + function loadModuleFromImports(extensions6, moduleName3, directory, state, cache, redirectedReference) { + var _a2, _b; + if (moduleName3 === "#" || startsWith2(moduleName3, "#/")) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + const directoryPath = getNormalizedAbsolutePath(combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); + const scope = getPackageScopeForPath(directoryPath, state); + if (!scope) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (!scope.contents.packageJsonContent.imports) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + const result2 = loadModuleFromImportsOrExports( + extensions6, + state, + cache, + redirectedReference, + moduleName3, + scope.contents.packageJsonContent.imports, + scope, + /*isImports*/ + true + ); + if (result2) { + return result2; + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName3, scope.packageDirectory); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + function comparePatternKeys(a7, b8) { + const aPatternIndex = a7.indexOf("*"); + const bPatternIndex = b8.indexOf("*"); + const baseLenA = aPatternIndex === -1 ? a7.length : aPatternIndex + 1; + const baseLenB = bPatternIndex === -1 ? b8.length : bPatternIndex + 1; + if (baseLenA > baseLenB) + return -1; + if (baseLenB > baseLenA) + return 1; + if (aPatternIndex === -1) + return 1; + if (bPatternIndex === -1) + return -1; + if (a7.length > b8.length) + return -1; + if (b8.length > a7.length) + return 1; + return 0; + } + function loadModuleFromImportsOrExports(extensions6, state, cache, redirectedReference, moduleName3, lookupTable, scope, isImports) { + const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions6, state, cache, redirectedReference, moduleName3, scope, isImports); + if (!endsWith2(moduleName3, directorySeparator) && !moduleName3.includes("*") && hasProperty(lookupTable, moduleName3)) { + const target = lookupTable[moduleName3]; + return loadModuleFromTargetImportOrExport( + target, + /*subpath*/ + "", + /*pattern*/ + false, + moduleName3 + ); + } + const expandingKeys = sort(filter2(getOwnKeys(lookupTable), (k6) => k6.includes("*") || endsWith2(k6, "/")), comparePatternKeys); + for (const potentialTarget of expandingKeys) { + if (state.features & 16 && matchesPatternWithTrailer(potentialTarget, moduleName3)) { + const target = lookupTable[potentialTarget]; + const starPos = potentialTarget.indexOf("*"); + const subpath = moduleName3.substring(potentialTarget.substring(0, starPos).length, moduleName3.length - (potentialTarget.length - 1 - starPos)); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + true, + potentialTarget + ); + } else if (endsWith2(potentialTarget, "*") && startsWith2(moduleName3, potentialTarget.substring(0, potentialTarget.length - 1))) { + const target = lookupTable[potentialTarget]; + const subpath = moduleName3.substring(potentialTarget.length - 1); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + true, + potentialTarget + ); + } else if (startsWith2(moduleName3, potentialTarget)) { + const target = lookupTable[potentialTarget]; + const subpath = moduleName3.substring(potentialTarget.length); + return loadModuleFromTargetImportOrExport( + target, + subpath, + /*pattern*/ + false, + potentialTarget + ); + } + } + function matchesPatternWithTrailer(target, name2) { + if (endsWith2(target, "*")) + return false; + const starPos = target.indexOf("*"); + if (starPos === -1) + return false; + return startsWith2(name2, target.substring(0, starPos)) && endsWith2(name2, target.substring(starPos + 1)); + } + } + function getLoadModuleFromTargetImportOrExport(extensions6, state, cache, redirectedReference, moduleName3, scope, isImports) { + return loadModuleFromTargetImportOrExport; + function loadModuleFromTargetImportOrExport(target, subpath, pattern5, key) { + if (typeof target === "string") { + if (!pattern5 && subpath.length > 0 && !endsWith2(target, "/")) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (!startsWith2(target, "./")) { + if (isImports && !startsWith2(target, "../") && !startsWith2(target, "/") && !isRootedDiskPath(target)) { + const combinedLookup = pattern5 ? target.replace(/\*/g, subpath) : target + subpath; + traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup); + traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/"); + const result2 = nodeModuleNameResolverWorker( + state.features, + combinedLookup, + scope.packageDirectory + "/", + state.compilerOptions, + state.host, + cache, + extensions6, + /*isConfigLookup*/ + false, + redirectedReference, + state.conditions + ); + return toSearchResult( + result2.resolvedModule ? { + path: result2.resolvedModule.resolvedFileName, + extension: result2.resolvedModule.extension, + packageId: result2.resolvedModule.packageId, + originalPath: result2.resolvedModule.originalPath, + resolvedUsingTsExtension: result2.resolvedModule.resolvedUsingTsExtension + } : void 0 + ); + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target); + const partsAfterFirst = parts.slice(1); + if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + const resolvedTarget = combinePaths(scope.packageDirectory, target); + const subpathParts = getPathComponents(subpath); + if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern5 ? target.replace(/\*/g, subpath) : target + subpath); + } + const finalPath = toAbsolutePath(pattern5 ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); + const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports); + if (inputLink) + return inputLink; + return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField( + extensions6, + finalPath, + /*onlyRecordFailures*/ + false, + state + ))); + } else if (typeof target === "object" && target !== null) { + if (!Array.isArray(target)) { + traceIfEnabled(state, Diagnostics.Entering_conditional_exports); + for (const condition of getOwnKeys(target)) { + if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) { + traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); + const subTarget = target[condition]; + const result2 = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern5, key); + if (result2) { + traceIfEnabled(state, Diagnostics.Resolved_under_condition_0, condition); + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); + return result2; + } else { + traceIfEnabled(state, Diagnostics.Failed_to_resolve_under_condition_0, condition); + } + } else { + traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); + } + } + traceIfEnabled(state, Diagnostics.Exiting_conditional_exports); + return void 0; + } else { + if (!length(target)) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + for (const elem of target) { + const result2 = loadModuleFromTargetImportOrExport(elem, subpath, pattern5, key); + if (result2) { + return result2; + } + } + } + } else if (target === null) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + } + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName3); + } + return toSearchResult( + /*value*/ + void 0 + ); + function toAbsolutePath(path2) { + var _a2, _b; + if (path2 === void 0) + return path2; + return getNormalizedAbsolutePath(path2, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); + } + function combineDirectoryPath(root2, dir2) { + return ensureTrailingDirectorySeparator(combinePaths(root2, dir2)); + } + function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) { + var _a2, _b, _c, _d; + if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) { + const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) }); + const commonSourceDirGuesses = []; + if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) { + const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)) || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + } else if (state.requestContainingDirectory) { + const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts")); + const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [requestingFile, toAbsolutePath(packagePath)], ((_d = (_c = state.host).getCurrentDirectory) == null ? void 0 : _d.call(_c)) || "", getCanonicalFileName)); + commonSourceDirGuesses.push(commonDir); + let fragment = ensureTrailingDirectorySeparator(commonDir); + while (fragment && fragment.length > 1) { + const parts = getPathComponents(fragment); + parts.pop(); + const commonDir2 = getPathFromPathComponents(parts); + commonSourceDirGuesses.unshift(commonDir2); + fragment = ensureTrailingDirectorySeparator(commonDir2); + } + } + if (commonSourceDirGuesses.length > 1) { + state.reportDiagnostic(createCompilerDiagnostic( + isImports2 ? Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate : Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, + entry === "" ? "." : entry, + // replace empty string with `.` - the reverse of the operation done when entries are built - so main entrypoint errors don't look weird + packagePath + )); + } + for (const commonSourceDirGuess of commonSourceDirGuesses) { + const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); + for (const candidateDir of candidateDirectories) { + if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) { + const pathFragment = finalPath.slice(candidateDir.length + 1); + const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment); + const jsAndDtsExtensions = [ + ".mjs", + ".cjs", + ".js", + ".json", + ".d.mts", + ".d.cts", + ".d.ts" + /* Dts */ + ]; + for (const ext of jsAndDtsExtensions) { + if (fileExtensionIs(possibleInputBase, ext)) { + const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase); + for (const possibleExt of inputExts) { + if (!extensionIsOk(extensions6, possibleExt)) + continue; + const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state)); + if (state.host.fileExists(possibleInputWithInputExtension)) { + return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField( + extensions6, + possibleInputWithInputExtension, + /*onlyRecordFailures*/ + false, + state + ))); + } + } + } + } + } + } + } + } + return void 0; + function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) { + var _a22, _b2; + const currentDir = state.compilerOptions.configFile ? ((_b2 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a22)) || "" : commonSourceDirGuess; + const candidateDirectories = []; + if (state.compilerOptions.declarationDir) { + candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir))); + } + if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) { + candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir))); + } + return candidateDirectories; + } + } + } + } + function isApplicableVersionedTypesKey(conditions, key) { + if (!conditions.includes("types")) + return false; + if (!startsWith2(key, "types@")) + return false; + const range2 = VersionRange.tryParse(key.substring("types@".length)); + if (!range2) + return false; + return range2.test(version5); + } + function loadModuleFromNearestNodeModulesDirectory(extensions6, moduleName3, directory, state, cache, redirectedReference) { + return loadModuleFromNearestNodeModulesDirectoryWorker( + extensions6, + moduleName3, + directory, + state, + /*typesScopeOnly*/ + false, + cache, + redirectedReference + ); + } + function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName3, directory, state) { + return loadModuleFromNearestNodeModulesDirectoryWorker( + 4, + moduleName3, + directory, + state, + /*typesScopeOnly*/ + true, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + } + function loadModuleFromNearestNodeModulesDirectoryWorker(extensions6, moduleName3, directory, state, typesScopeOnly, cache, redirectedReference) { + const mode = state.features === 0 ? void 0 : state.features & 32 ? 99 : 1; + const priorityExtensions = extensions6 & (1 | 4); + const secondaryExtensions = extensions6 & ~(1 | 4); + if (priorityExtensions) { + traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, formatExtensions(priorityExtensions)); + const result2 = lookup(priorityExtensions); + if (result2) + return result2; + } + if (secondaryExtensions && !typesScopeOnly) { + traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, formatExtensions(secondaryExtensions)); + return lookup(secondaryExtensions); + } + function lookup(extensions22) { + return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => { + if (getBaseFileName(ancestorDirectory) !== "node_modules") { + const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName3, mode, ancestorDirectory, redirectedReference, state); + if (resolutionFromCache) { + return resolutionFromCache; + } + return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions22, moduleName3, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); + } + }); + } + } + function loadModuleFromImmediateNodeModulesDirectory(extensions6, moduleName3, directory, state, typesScopeOnly, cache, redirectedReference) { + const nodeModulesFolder = combinePaths(directory, "node_modules"); + const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); + if (!nodeModulesFolderExists && state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); + } + if (!typesScopeOnly) { + const packageResult = loadModuleFromSpecificNodeModulesDirectory(extensions6, moduleName3, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); + if (packageResult) { + return packageResult; + } + } + if (extensions6 & 4) { + const nodeModulesAtTypes2 = combinePaths(nodeModulesFolder, "@types"); + let nodeModulesAtTypesExists = nodeModulesFolderExists; + if (nodeModulesFolderExists && !directoryProbablyExists(nodeModulesAtTypes2, state.host)) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesAtTypes2); + } + nodeModulesAtTypesExists = false; + } + return loadModuleFromSpecificNodeModulesDirectory(4, mangleScopedPackageNameWithTrace(moduleName3, state), nodeModulesAtTypes2, nodeModulesAtTypesExists, state, cache, redirectedReference); + } + } + function loadModuleFromSpecificNodeModulesDirectory(extensions6, moduleName3, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) { + var _a2, _b; + const candidate = normalizePath(combinePaths(nodeModulesDirectory, moduleName3)); + const { packageName, rest: rest2 } = parsePackageName(moduleName3); + const packageDirectory = combinePaths(nodeModulesDirectory, packageName); + let rootPackageInfo; + let packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state); + if (rest2 !== "" && packageInfo && (!(state.features & 8) || !hasProperty(((_a2 = rootPackageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state)) == null ? void 0 : _a2.contents.packageJsonContent) ?? emptyArray, "exports"))) { + const fromFile2 = loadModuleFromFile(extensions6, candidate, !nodeModulesDirectoryExists, state); + if (fromFile2) { + return noPackageId(fromFile2); + } + const fromDirectory = loadNodeModuleFromDirectoryWorker( + extensions6, + candidate, + !nodeModulesDirectoryExists, + state, + packageInfo.contents.packageJsonContent, + getVersionPathsOfPackageJsonInfo(packageInfo, state) + ); + return withPackageId(packageInfo, fromDirectory); + } + const loader2 = (extensions22, candidate2, onlyRecordFailures, state2) => { + let pathAndExtension = (rest2 || !(state2.features & 32)) && loadModuleFromFile(extensions22, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker( + extensions22, + candidate2, + onlyRecordFailures, + state2, + packageInfo && packageInfo.contents.packageJsonContent, + packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2) + ); + if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) { + pathAndExtension = loadModuleFromFile(extensions22, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2); + } + return withPackageId(packageInfo, pathAndExtension); + }; + if (rest2 !== "") { + packageInfo = rootPackageInfo ?? getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state); + } + if (packageInfo) { + state.resolvedPackageDirectory = true; + } + if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8) { + return (_b = loadModuleFromExports(packageInfo, extensions6, combinePaths(".", rest2), state, cache, redirectedReference)) == null ? void 0 : _b.value; + } + const versionPaths = rest2 !== "" && packageInfo ? getVersionPathsOfPackageJsonInfo(packageInfo, state) : void 0; + if (versionPaths) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version5, rest2); + } + const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host); + const fromPaths = tryLoadModuleUsingPaths( + extensions6, + rest2, + packageDirectory, + versionPaths.paths, + /*pathPatterns*/ + void 0, + loader2, + !packageDirectoryExists, + state + ); + if (fromPaths) { + return fromPaths.value; + } + } + return loader2(extensions6, candidate, !nodeModulesDirectoryExists, state); + } + function tryLoadModuleUsingPaths(extensions6, moduleName3, baseDirectory, paths, pathPatterns, loader2, onlyRecordFailures, state) { + pathPatterns || (pathPatterns = tryParsePatterns(paths)); + const matchedPattern = matchPatternOrExact(pathPatterns, moduleName3); + if (matchedPattern) { + const matchedStar = isString4(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName3); + const matchedPatternText = isString4(matchedPattern) ? matchedPattern : patternText(matchedPattern); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName3, matchedPatternText); + } + const resolved = forEach4(paths[matchedPatternText], (subst) => { + const path2 = matchedStar ? replaceFirstStar(subst, matchedStar) : subst; + const candidate = normalizePath(combinePaths(baseDirectory, path2)); + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path2); + } + const extension = tryGetExtensionFromPath2(subst); + if (extension !== void 0) { + const path22 = tryFile(candidate, onlyRecordFailures, state); + if (path22 !== void 0) { + return noPackageId({ path: path22, ext: extension, resolvedUsingTsExtension: void 0 }); + } + } + return loader2(extensions6, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); + }); + return { value: resolved }; + } + } + function mangleScopedPackageNameWithTrace(packageName, state) { + const mangled = mangleScopedPackageName(packageName); + if (state.traceEnabled && mangled !== packageName) { + trace2(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled); + } + return mangled; + } + function getTypesPackageName(packageName) { + return `@types/${mangleScopedPackageName(packageName)}`; + } + function mangleScopedPackageName(packageName) { + if (startsWith2(packageName, "@")) { + const replaceSlash = packageName.replace(directorySeparator, mangledScopedPackageSeparator); + if (replaceSlash !== packageName) { + return replaceSlash.slice(1); + } + } + return packageName; + } + function getPackageNameFromTypesPackageName(mangledName) { + const withoutAtTypePrefix = removePrefix(mangledName, "@types/"); + if (withoutAtTypePrefix !== mangledName) { + return unmangleScopedPackageName(withoutAtTypePrefix); + } + return mangledName; + } + function unmangleScopedPackageName(typesPackageName) { + return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName; + } + function tryFindNonRelativeModuleNameInCache(cache, moduleName3, mode, containingDirectory, redirectedReference, state) { + const result2 = cache && cache.getFromNonRelativeNameCache(moduleName3, mode, containingDirectory, redirectedReference); + if (result2) { + if (state.traceEnabled) { + trace2(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName3, containingDirectory); + } + state.resultFromCache = result2; + return { + value: result2.resolvedModule && { + path: result2.resolvedModule.resolvedFileName, + originalPath: result2.resolvedModule.originalPath || true, + extension: result2.resolvedModule.extension, + packageId: result2.resolvedModule.packageId, + resolvedUsingTsExtension: result2.resolvedModule.resolvedUsingTsExtension + } + }; + } + } + function classicNameResolver(moduleName3, containingFile, compilerOptions, host, cache, redirectedReference) { + const traceEnabled = isTraceEnabled(compilerOptions, host); + const failedLookupLocations = []; + const affectingLocations = []; + const containingDirectory = getDirectoryPath(containingFile); + const diagnostics = []; + const state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache: cache, + features: 0, + conditions: [], + requestContainingDirectory: containingDirectory, + reportDiagnostic: (diag2) => void diagnostics.push(diag2), + isConfigLookup: false, + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false + }; + const resolved = tryResolve( + 1 | 4 + /* Declaration */ + ) || tryResolve(2 | (compilerOptions.resolveJsonModule ? 8 : 0)); + return createResolvedModuleWithFailedLookupLocationsHandlingSymlink( + moduleName3, + resolved && resolved.value, + (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path), + failedLookupLocations, + affectingLocations, + diagnostics, + state, + cache + ); + function tryResolve(extensions6) { + const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions6, moduleName3, containingDirectory, loadModuleFromFileNoPackageId, state); + if (resolvedUsingSettings) { + return { value: resolvedUsingSettings }; + } + if (!isExternalModuleNameRelative(moduleName3)) { + const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => { + const resolutionFromCache = tryFindNonRelativeModuleNameInCache( + cache, + moduleName3, + /*mode*/ + void 0, + directory, + redirectedReference, + state + ); + if (resolutionFromCache) { + return resolutionFromCache; + } + const searchName = normalizePath(combinePaths(directory, moduleName3)); + return toSearchResult(loadModuleFromFileNoPackageId( + extensions6, + searchName, + /*onlyRecordFailures*/ + false, + state + )); + }); + if (resolved2) + return resolved2; + if (extensions6 & (1 | 4)) { + let resolved3 = loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName3, containingDirectory, state); + if (extensions6 & 4) + resolved3 ?? (resolved3 = resolveFromTypeRoot(moduleName3, state)); + return resolved3; + } + } else { + const candidate = normalizePath(combinePaths(containingDirectory, moduleName3)); + return toSearchResult(loadModuleFromFileNoPackageId( + extensions6, + candidate, + /*onlyRecordFailures*/ + false, + state + )); + } + } + } + function resolveFromTypeRoot(moduleName3, state) { + if (!state.compilerOptions.typeRoots) + return; + for (const typeRoot of state.compilerOptions.typeRoots) { + const candidate = getCandidateFromTypeRoot(typeRoot, moduleName3, state); + const directoryExists = directoryProbablyExists(typeRoot, state.host); + if (!directoryExists && state.traceEnabled) { + trace2(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot); + } + const resolvedFromFile = loadModuleFromFile(4, candidate, !directoryExists, state); + if (resolvedFromFile) { + const packageDirectory = parseNodeModuleFromPath(resolvedFromFile.path); + const packageInfo = packageDirectory ? getPackageJsonInfo( + packageDirectory, + /*onlyRecordFailures*/ + false, + state + ) : void 0; + return toSearchResult(withPackageId(packageInfo, resolvedFromFile)); + } + const resolved = loadNodeModuleFromDirectory(4, candidate, !directoryExists, state); + if (resolved) + return toSearchResult(resolved); + } + } + function shouldAllowImportingTsExtension(compilerOptions, fromFileName) { + return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName); + } + function loadModuleFromGlobalCache(moduleName3, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) { + const traceEnabled = isTraceEnabled(compilerOptions, host); + if (traceEnabled) { + trace2(host, Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2, projectName, moduleName3, globalCache); + } + const failedLookupLocations = []; + const affectingLocations = []; + const diagnostics = []; + const state = { + compilerOptions, + host, + traceEnabled, + failedLookupLocations, + affectingLocations, + packageJsonInfoCache, + features: 0, + conditions: [], + requestContainingDirectory: void 0, + reportDiagnostic: (diag2) => void diagnostics.push(diag2), + isConfigLookup: false, + candidateIsFromPackageJsonField: false, + resolvedPackageDirectory: false + }; + const resolved = loadModuleFromImmediateNodeModulesDirectory( + 4, + moduleName3, + globalCache, + state, + /*typesScopeOnly*/ + false, + /*cache*/ + void 0, + /*redirectedReference*/ + void 0 + ); + return createResolvedModuleWithFailedLookupLocations( + resolved, + /*isExternalLibraryImport*/ + true, + failedLookupLocations, + affectingLocations, + diagnostics, + state.resultFromCache, + /*cache*/ + void 0 + ); + } + function toSearchResult(value2) { + return value2 !== void 0 ? { value: value2 } : void 0; + } + function traceIfEnabled(state, diagnostic, ...args) { + if (state.traceEnabled) { + trace2(state.host, diagnostic, ...args); + } + } + function useCaseSensitiveFileNames(state) { + return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); + } + var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator; + var init_moduleNameResolver = __esm2({ + "src/compiler/moduleNameResolver.ts"() { + "use strict"; + init_ts2(); + nodeModulesAtTypes = combinePaths("node_modules", "@types"); + NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => { + NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports"; + NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports"; + NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; + NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default"; + NodeResolutionFeatures2[ + NodeResolutionFeatures2["NodeNextDefault"] = 30 + /* AllFeatures */ + ] = "NodeNextDefault"; + NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault"; + NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode"; + return NodeResolutionFeatures2; + })(NodeResolutionFeatures || {}); + nodeModulesPathPart = "/node_modules/"; + mangledScopedPackageSeparator = "__"; + } + }); + function getModuleInstanceState(node, visited) { + if (node.body && !node.body.parent) { + setParent(node.body, node); + setParentRecursive( + node.body, + /*incremental*/ + false + ); + } + return node.body ? getModuleInstanceStateCached(node.body, visited) : 1; + } + function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map()) { + const nodeId = getNodeId(node); + if (visited.has(nodeId)) { + return visited.get(nodeId) || 0; + } + visited.set(nodeId, void 0); + const result2 = getModuleInstanceStateWorker(node, visited); + visited.set(nodeId, result2); + return result2; + } + function getModuleInstanceStateWorker(node, visited) { + switch (node.kind) { + case 264: + case 265: + return 0; + case 266: + if (isEnumConst(node)) { + return 2; + } + break; + case 272: + case 271: + if (!hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + return 0; + } + break; + case 278: + const exportDeclaration = node; + if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279) { + let state = 0; + for (const specifier of exportDeclaration.exportClause.elements) { + const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); + if (specifierState > state) { + state = specifierState; + } + if (state === 1) { + return state; + } + } + return state; + } + break; + case 268: { + let state = 0; + forEachChild(node, (n7) => { + const childState = getModuleInstanceStateCached(n7, visited); + switch (childState) { + case 0: + return; + case 2: + state = 2; + return; + case 1: + state = 1; + return true; + default: + Debug.assertNever(childState); + } + }); + return state; + } + case 267: + return getModuleInstanceState(node, visited); + case 80: + if (node.flags & 4096) { + return 0; + } + } + return 1; + } + function getModuleInstanceStateForAliasTarget(specifier, visited) { + const name2 = specifier.propertyName || specifier.name; + let p7 = specifier.parent; + while (p7) { + if (isBlock2(p7) || isModuleBlock(p7) || isSourceFile(p7)) { + const statements = p7.statements; + let found; + for (const statement of statements) { + if (nodeHasName(statement, name2)) { + if (!statement.parent) { + setParent(statement, p7); + setParentRecursive( + statement, + /*incremental*/ + false + ); + } + const state = getModuleInstanceStateCached(statement, visited); + if (found === void 0 || state > found) { + found = state; + } + if (found === 1) { + return found; + } + if (statement.kind === 271) { + found = 1; + } + } + } + if (found !== void 0) { + return found; + } + } + p7 = p7.parent; + } + return 1; + } + function initFlowNode(node) { + Debug.attachFlowNodeDebugInfo(node); + return node; + } + function bindSourceFile(file, options) { + var _a2, _b; + mark("beforeBind"); + (_a2 = perfLogger) == null ? void 0 : _a2.logStartBindFile("" + file.fileName); + binder(file, options); + (_b = perfLogger) == null ? void 0 : _b.logStopBindFile(); + mark("afterBind"); + measure("Bind", "beforeBind", "afterBind"); + } + function createBinder() { + var file; + var options; + var languageVersion; + var parent22; + var container; + var thisParentContainer; + var blockScopeContainer; + var lastContainer; + var delayedTypeAliases; + var seenThisKeyword; + var currentFlow; + var currentBreakTarget; + var currentContinueTarget; + var currentReturnTarget; + var currentTrueTarget; + var currentFalseTarget; + var currentExceptionTarget; + var preSwitchCaseFlow; + var activeLabelList; + var hasExplicitReturn; + var emitFlags; + var inStrictMode; + var inAssignmentPattern = false; + var symbolCount = 0; + var Symbol47; + var classifiableNames; + var unreachableFlow = { + flags: 1 + /* Unreachable */ + }; + var reportedUnreachableFlow = { + flags: 1 + /* Unreachable */ + }; + var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); + return bindSourceFile2; + function createDiagnosticForNode2(node, message, ...args) { + return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, ...args); + } + function bindSourceFile2(f8, opts) { + var _a2, _b; + file = f8; + options = opts; + languageVersion = getEmitScriptTarget(options); + inStrictMode = bindInStrictMode(file, opts); + classifiableNames = /* @__PURE__ */ new Set(); + symbolCount = 0; + Symbol47 = objectAllocator.getSymbolConstructor(); + Debug.attachFlowNodeDebugInfo(unreachableFlow); + Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow); + if (!file.locals) { + (_a2 = tracing) == null ? void 0 : _a2.push( + tracing.Phase.Bind, + "bindSourceFile", + { path: file.path }, + /*separateBeginAndEnd*/ + true + ); + bind2(file); + (_b = tracing) == null ? void 0 : _b.pop(); + file.symbolCount = symbolCount; + file.classifiableNames = classifiableNames; + delayedBindJSDocTypedefTag(); + } + file = void 0; + options = void 0; + languageVersion = void 0; + parent22 = void 0; + container = void 0; + thisParentContainer = void 0; + blockScopeContainer = void 0; + lastContainer = void 0; + delayedTypeAliases = void 0; + seenThisKeyword = false; + currentFlow = void 0; + currentBreakTarget = void 0; + currentContinueTarget = void 0; + currentReturnTarget = void 0; + currentTrueTarget = void 0; + currentFalseTarget = void 0; + currentExceptionTarget = void 0; + activeLabelList = void 0; + hasExplicitReturn = false; + inAssignmentPattern = false; + emitFlags = 0; + } + function bindInStrictMode(file2, opts) { + if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { + return true; + } else { + return !!file2.externalModuleIndicator; + } + } + function createSymbol(flags, name2) { + symbolCount++; + return new Symbol47(flags, name2); + } + function addDeclarationToSymbol(symbol, node, symbolFlags) { + symbol.flags |= symbolFlags; + node.symbol = symbol; + symbol.declarations = appendIfUnique(symbol.declarations, node); + if (symbolFlags & (32 | 384 | 1536 | 3) && !symbol.exports) { + symbol.exports = createSymbolTable(); + } + if (symbolFlags & (32 | 64 | 2048 | 4096) && !symbol.members) { + symbol.members = createSymbolTable(); + } + if (symbol.constEnumOnlyModule && symbol.flags & (16 | 32 | 256)) { + symbol.constEnumOnlyModule = false; + } + if (symbolFlags & 111551) { + setValueDeclaration(symbol, node); + } + } + function getDeclarationName(node) { + if (node.kind === 277) { + return node.isExportEquals ? "export=" : "default"; + } + const name2 = getNameOfDeclaration(node); + if (name2) { + if (isAmbientModule(node)) { + const moduleName3 = getTextOfIdentifierOrLiteral(name2); + return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName3}"`; + } + if (name2.kind === 167) { + const nameExpression = name2.expression; + if (isStringOrNumericLiteralLike(nameExpression)) { + return escapeLeadingUnderscores(nameExpression.text); + } + if (isSignedNumericLiteral(nameExpression)) { + return tokenToString(nameExpression.operator) + nameExpression.operand.text; + } else { + Debug.fail("Only computed properties with literal names have declaration names"); + } + } + if (isPrivateIdentifier(name2)) { + const containingClass = getContainingClass(node); + if (!containingClass) { + return void 0; + } + const containingClassSymbol = containingClass.symbol; + return getSymbolNameForPrivateIdentifier(containingClassSymbol, name2.escapedText); + } + if (isJsxNamespacedName(name2)) { + return getEscapedTextOfJsxNamespacedName(name2); + } + return isPropertyNameLiteral(name2) ? getEscapedTextOfIdentifierOrLiteral(name2) : void 0; + } + switch (node.kind) { + case 176: + return "__constructor"; + case 184: + case 179: + case 330: + return "__call"; + case 185: + case 180: + return "__new"; + case 181: + return "__index"; + case 278: + return "__export"; + case 312: + return "export="; + case 226: + if (getAssignmentDeclarationKind(node) === 2) { + return "export="; + } + Debug.fail("Unknown binary declaration kind"); + break; + case 324: + return isJSDocConstructSignature(node) ? "__new" : "__call"; + case 169: + Debug.assert(node.parent.kind === 324, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); + const functionType2 = node.parent; + const index4 = functionType2.parameters.indexOf(node); + return "arg" + index4; + } + } + function getDisplayName(node) { + return isNamedDeclaration(node) ? declarationNameToString(node.name) : unescapeLeadingUnderscores(Debug.checkDefined(getDeclarationName(node))); + } + function declareSymbol(symbolTable, parent3, node, includes2, excludes, isReplaceableByMethod, isComputedName) { + Debug.assert(isComputedName || !hasDynamicName(node)); + const isDefaultExport = hasSyntacticModifier( + node, + 2048 + /* Default */ + ) || isExportSpecifier(node) && node.name.escapedText === "default"; + const name2 = isComputedName ? "__computed" : isDefaultExport && parent3 ? "default" : getDeclarationName(node); + let symbol; + if (name2 === void 0) { + symbol = createSymbol( + 0, + "__missing" + /* Missing */ + ); + } else { + symbol = symbolTable.get(name2); + if (includes2 & 2885600) { + classifiableNames.add(name2); + } + if (!symbol) { + symbolTable.set(name2, symbol = createSymbol(0, name2)); + if (isReplaceableByMethod) + symbol.isReplaceableByMethod = true; + } else if (isReplaceableByMethod && !symbol.isReplaceableByMethod) { + return symbol; + } else if (symbol.flags & excludes) { + if (symbol.isReplaceableByMethod) { + symbolTable.set(name2, symbol = createSymbol(0, name2)); + } else if (!(includes2 & 3 && symbol.flags & 67108864)) { + if (isNamedDeclaration(node)) { + setParent(node.name, node); + } + let message = symbol.flags & 2 ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; + let messageNeedsName = true; + if (symbol.flags & 384 || includes2 & 384) { + message = Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + messageNeedsName = false; + } + let multipleDefaultExports = false; + if (length(symbol.declarations)) { + if (isDefaultExport) { + message = Diagnostics.A_module_cannot_have_multiple_default_exports; + messageNeedsName = false; + multipleDefaultExports = true; + } else { + if (symbol.declarations && symbol.declarations.length && (node.kind === 277 && !node.isExportEquals)) { + message = Diagnostics.A_module_cannot_have_multiple_default_exports; + messageNeedsName = false; + multipleDefaultExports = true; + } + } + } + const relatedInformation = []; + if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier( + node, + 32 + /* Export */ + ) && symbol.flags & (2097152 | 788968 | 1920)) { + relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`)); + } + const declarationName = getNameOfDeclaration(node) || node; + forEach4(symbol.declarations, (declaration, index4) => { + const decl = getNameOfDeclaration(declaration) || declaration; + const diag3 = messageNeedsName ? createDiagnosticForNode2(decl, message, getDisplayName(declaration)) : createDiagnosticForNode2(decl, message); + file.bindDiagnostics.push( + multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index4 === 0 ? Diagnostics.Another_export_default_is_here : Diagnostics.and_here)) : diag3 + ); + if (multipleDefaultExports) { + relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here)); + } + }); + const diag2 = messageNeedsName ? createDiagnosticForNode2(declarationName, message, getDisplayName(node)) : createDiagnosticForNode2(declarationName, message); + file.bindDiagnostics.push(addRelatedInfo(diag2, ...relatedInformation)); + symbol = createSymbol(0, name2); + } + } + } + addDeclarationToSymbol(symbol, node, includes2); + if (symbol.parent) { + Debug.assert(symbol.parent === parent3, "Existing symbol parent should match new one"); + } else { + symbol.parent = parent3; + } + return symbol; + } + function declareModuleMember(node, symbolFlags, symbolExcludes) { + const hasExportModifier = !!(getCombinedModifierFlags(node) & 32) || jsdocTreatAsExported(node); + if (symbolFlags & 2097152) { + if (node.kind === 281 || node.kind === 271 && hasExportModifier) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } else { + Debug.assertNode(container, canHaveLocals); + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } else { + if (isJSDocTypeAlias(node)) + Debug.assert(isInJSFile(node)); + if (!isAmbientModule(node) && (hasExportModifier || container.flags & 128)) { + if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier( + node, + 2048 + /* Default */ + ) && !getDeclarationName(node)) { + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + } + const exportKind = symbolFlags & 111551 ? 1048576 : 0; + const local = declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + exportKind, + symbolExcludes + ); + local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + node.localSymbol = local; + return local; + } else { + Debug.assertNode(container, canHaveLocals); + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + } + function jsdocTreatAsExported(node) { + if (node.parent && isModuleDeclaration(node)) { + node = node.parent; + } + if (!isJSDocTypeAlias(node)) + return false; + if (!isJSDocEnumTag(node) && !!node.fullName) + return true; + const declName = getNameOfDeclaration(node); + if (!declName) + return false; + if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) + return true; + if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 32) + return true; + return false; + } + function bindContainer(node, containerFlags) { + const saveContainer = container; + const saveThisParentContainer = thisParentContainer; + const savedBlockScopeContainer = blockScopeContainer; + if (containerFlags & 1) { + if (node.kind !== 219) { + thisParentContainer = container; + } + container = blockScopeContainer = node; + if (containerFlags & 32) { + container.locals = createSymbolTable(); + addToContainerChain(container); + } + } else if (containerFlags & 2) { + blockScopeContainer = node; + if (containerFlags & 32) { + blockScopeContainer.locals = void 0; + } + } + if (containerFlags & 4) { + const saveCurrentFlow = currentFlow; + const saveBreakTarget = currentBreakTarget; + const saveContinueTarget = currentContinueTarget; + const saveReturnTarget = currentReturnTarget; + const saveExceptionTarget = currentExceptionTarget; + const saveActiveLabelList = activeLabelList; + const saveHasExplicitReturn = hasExplicitReturn; + const isImmediatelyInvoked = containerFlags & 16 && !hasSyntacticModifier( + node, + 1024 + /* Async */ + ) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175; + if (!isImmediatelyInvoked) { + currentFlow = initFlowNode({ + flags: 2 + /* Start */ + }); + if (containerFlags & (16 | 128)) { + currentFlow.node = node; + } + } + currentReturnTarget = isImmediatelyInvoked || node.kind === 176 || isInJSFile(node) && (node.kind === 262 || node.kind === 218) ? createBranchLabel() : void 0; + currentExceptionTarget = void 0; + currentBreakTarget = void 0; + currentContinueTarget = void 0; + activeLabelList = void 0; + hasExplicitReturn = false; + bindChildren(node); + node.flags &= ~5632; + if (!(currentFlow.flags & 1) && containerFlags & 8 && nodeIsPresent(node.body)) { + node.flags |= 512; + if (hasExplicitReturn) + node.flags |= 1024; + node.endFlowNode = currentFlow; + } + if (node.kind === 312) { + node.flags |= emitFlags; + node.endFlowNode = currentFlow; + } + if (currentReturnTarget) { + addAntecedent(currentReturnTarget, currentFlow); + currentFlow = finishFlowLabel(currentReturnTarget); + if (node.kind === 176 || node.kind === 175 || isInJSFile(node) && (node.kind === 262 || node.kind === 218)) { + node.returnFlowNode = currentFlow; + } + } + if (!isImmediatelyInvoked) { + currentFlow = saveCurrentFlow; + } + currentBreakTarget = saveBreakTarget; + currentContinueTarget = saveContinueTarget; + currentReturnTarget = saveReturnTarget; + currentExceptionTarget = saveExceptionTarget; + activeLabelList = saveActiveLabelList; + hasExplicitReturn = saveHasExplicitReturn; + } else if (containerFlags & 64) { + seenThisKeyword = false; + bindChildren(node); + Debug.assertNotNode(node, isIdentifier); + node.flags = seenThisKeyword ? node.flags | 256 : node.flags & ~256; + } else { + bindChildren(node); + } + container = saveContainer; + thisParentContainer = saveThisParentContainer; + blockScopeContainer = savedBlockScopeContainer; + } + function bindEachFunctionsFirst(nodes) { + bindEach(nodes, (n7) => n7.kind === 262 ? bind2(n7) : void 0); + bindEach(nodes, (n7) => n7.kind !== 262 ? bind2(n7) : void 0); + } + function bindEach(nodes, bindFunction = bind2) { + if (nodes === void 0) { + return; + } + forEach4(nodes, bindFunction); + } + function bindEachChild(node) { + forEachChild(node, bind2, bindEach); + } + function bindChildren(node) { + const saveInAssignmentPattern = inAssignmentPattern; + inAssignmentPattern = false; + if (checkUnreachable(node)) { + bindEachChild(node); + bindJSDoc(node); + inAssignmentPattern = saveInAssignmentPattern; + return; + } + if (node.kind >= 243 && node.kind <= 259 && !options.allowUnreachableCode) { + node.flowNode = currentFlow; + } + switch (node.kind) { + case 247: + bindWhileStatement(node); + break; + case 246: + bindDoStatement(node); + break; + case 248: + bindForStatement(node); + break; + case 249: + case 250: + bindForInOrForOfStatement(node); + break; + case 245: + bindIfStatement(node); + break; + case 253: + case 257: + bindReturnOrThrow(node); + break; + case 252: + case 251: + bindBreakOrContinueStatement(node); + break; + case 258: + bindTryStatement(node); + break; + case 255: + bindSwitchStatement(node); + break; + case 269: + bindCaseBlock(node); + break; + case 296: + bindCaseClause(node); + break; + case 244: + bindExpressionStatement(node); + break; + case 256: + bindLabeledStatement(node); + break; + case 224: + bindPrefixUnaryExpressionFlow(node); + break; + case 225: + bindPostfixUnaryExpressionFlow(node); + break; + case 226: + if (isDestructuringAssignment(node)) { + inAssignmentPattern = saveInAssignmentPattern; + bindDestructuringAssignmentFlow(node); + return; + } + bindBinaryExpressionFlow(node); + break; + case 220: + bindDeleteExpressionFlow(node); + break; + case 227: + bindConditionalExpressionFlow(node); + break; + case 260: + bindVariableDeclarationFlow(node); + break; + case 211: + case 212: + bindAccessExpressionFlow(node); + break; + case 213: + bindCallExpressionFlow(node); + break; + case 235: + bindNonNullExpressionFlow(node); + break; + case 353: + case 345: + case 347: + bindJSDocTypeAlias(node); + break; + case 312: { + bindEachFunctionsFirst(node.statements); + bind2(node.endOfFileToken); + break; + } + case 241: + case 268: + bindEachFunctionsFirst(node.statements); + break; + case 208: + bindBindingElementFlow(node); + break; + case 169: + bindParameterFlow(node); + break; + case 210: + case 209: + case 303: + case 230: + inAssignmentPattern = saveInAssignmentPattern; + default: + bindEachChild(node); + break; + } + bindJSDoc(node); + inAssignmentPattern = saveInAssignmentPattern; + } + function isNarrowingExpression(expr) { + switch (expr.kind) { + case 80: + case 81: + case 110: + case 211: + case 212: + return containsNarrowableReference(expr); + case 213: + return hasNarrowableArgument(expr); + case 217: + if (isJSDocTypeAssertion(expr)) { + return false; + } + case 235: + return isNarrowingExpression(expr.expression); + case 226: + return isNarrowingBinaryExpression(expr); + case 224: + return expr.operator === 54 && isNarrowingExpression(expr.operand); + case 221: + return isNarrowingExpression(expr.expression); + } + return false; + } + function isNarrowableReference(expr) { + return isDottedName(expr) || (isPropertyAccessExpression(expr) || isNonNullExpression(expr) || isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || isBinaryExpression(expr) && expr.operatorToken.kind === 28 && isNarrowableReference(expr.right) || isElementAccessExpression(expr) && (isStringOrNumericLiteralLike(expr.argumentExpression) || isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression) || isAssignmentExpression(expr) && isNarrowableReference(expr.left); + } + function containsNarrowableReference(expr) { + return isNarrowableReference(expr) || isOptionalChain(expr) && containsNarrowableReference(expr.expression); + } + function hasNarrowableArgument(expr) { + if (expr.arguments) { + for (const argument of expr.arguments) { + if (containsNarrowableReference(argument)) { + return true; + } + } + } + if (expr.expression.kind === 211 && containsNarrowableReference(expr.expression.expression)) { + return true; + } + return false; + } + function isNarrowingTypeofOperands(expr1, expr2) { + return isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && isStringLiteralLike(expr2); + } + function isNarrowingBinaryExpression(expr) { + switch (expr.operatorToken.kind) { + case 64: + case 76: + case 77: + case 78: + return containsNarrowableReference(expr.left); + case 35: + case 36: + case 37: + case 38: + return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right)); + case 104: + return isNarrowableOperand(expr.left); + case 103: + return isNarrowingExpression(expr.right); + case 28: + return isNarrowingExpression(expr.right); + } + return false; + } + function isNarrowableOperand(expr) { + switch (expr.kind) { + case 217: + return isNarrowableOperand(expr.expression); + case 226: + switch (expr.operatorToken.kind) { + case 64: + return isNarrowableOperand(expr.left); + case 28: + return isNarrowableOperand(expr.right); + } + } + return containsNarrowableReference(expr); + } + function createBranchLabel() { + return initFlowNode({ flags: 4, antecedents: void 0 }); + } + function createLoopLabel() { + return initFlowNode({ flags: 8, antecedents: void 0 }); + } + function createReduceLabel(target, antecedents, antecedent) { + return initFlowNode({ flags: 1024, target, antecedents, antecedent }); + } + function setFlowNodeReferenced(flow2) { + flow2.flags |= flow2.flags & 2048 ? 4096 : 2048; + } + function addAntecedent(label, antecedent) { + if (!(antecedent.flags & 1) && !contains2(label.antecedents, antecedent)) { + (label.antecedents || (label.antecedents = [])).push(antecedent); + setFlowNodeReferenced(antecedent); + } + } + function createFlowCondition(flags, antecedent, expression) { + if (antecedent.flags & 1) { + return antecedent; + } + if (!expression) { + return flags & 32 ? antecedent : unreachableFlow; + } + if ((expression.kind === 112 && flags & 64 || expression.kind === 97 && flags & 32) && !isExpressionOfOptionalChainRoot(expression) && !isNullishCoalesce(expression.parent)) { + return unreachableFlow; + } + if (!isNarrowingExpression(expression)) { + return antecedent; + } + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags, antecedent, node: expression }); + } + function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags: 128, antecedent, switchStatement, clauseStart, clauseEnd }); + } + function createFlowMutation(flags, antecedent, node) { + setFlowNodeReferenced(antecedent); + const result2 = initFlowNode({ flags, antecedent, node }); + if (currentExceptionTarget) { + addAntecedent(currentExceptionTarget, result2); + } + return result2; + } + function createFlowCall(antecedent, node) { + setFlowNodeReferenced(antecedent); + return initFlowNode({ flags: 512, antecedent, node }); + } + function finishFlowLabel(flow2) { + const antecedents = flow2.antecedents; + if (!antecedents) { + return unreachableFlow; + } + if (antecedents.length === 1) { + return antecedents[0]; + } + return flow2; + } + function isStatementCondition(node) { + const parent3 = node.parent; + switch (parent3.kind) { + case 245: + case 247: + case 246: + return parent3.expression === node; + case 248: + case 227: + return parent3.condition === node; + } + return false; + } + function isLogicalExpression(node) { + while (true) { + if (node.kind === 217) { + node = node.expression; + } else if (node.kind === 224 && node.operator === 54) { + node = node.operand; + } else { + return isLogicalOrCoalescingBinaryExpression(node); + } + } + } + function isLogicalAssignmentExpression(node) { + return isLogicalOrCoalescingAssignmentExpression(skipParentheses(node)); + } + function isTopLevelLogicalExpression(node) { + while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 54) { + node = node.parent; + } + return !isStatementCondition(node) && !isLogicalExpression(node.parent) && !(isOptionalChain(node.parent) && node.parent.expression === node); + } + function doWithConditionalBranches(action, value2, trueTarget, falseTarget) { + const savedTrueTarget = currentTrueTarget; + const savedFalseTarget = currentFalseTarget; + currentTrueTarget = trueTarget; + currentFalseTarget = falseTarget; + action(value2); + currentTrueTarget = savedTrueTarget; + currentFalseTarget = savedFalseTarget; + } + function bindCondition(node, trueTarget, falseTarget) { + doWithConditionalBranches(bind2, node, trueTarget, falseTarget); + if (!node || !isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(isOptionalChain(node) && isOutermostOptionalChain(node))) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindIterativeStatement(node, breakTarget, continueTarget) { + const saveBreakTarget = currentBreakTarget; + const saveContinueTarget = currentContinueTarget; + currentBreakTarget = breakTarget; + currentContinueTarget = continueTarget; + bind2(node); + currentBreakTarget = saveBreakTarget; + currentContinueTarget = saveContinueTarget; + } + function setContinueTarget(node, target) { + let label = activeLabelList; + while (label && node.parent.kind === 256) { + label.continueTarget = target; + label = label.next; + node = node.parent; + } + return target; + } + function bindWhileStatement(node) { + const preWhileLabel = setContinueTarget(node, createLoopLabel()); + const preBodyLabel = createBranchLabel(); + const postWhileLabel = createBranchLabel(); + addAntecedent(preWhileLabel, currentFlow); + currentFlow = preWhileLabel; + bindCondition(node.expression, preBodyLabel, postWhileLabel); + currentFlow = finishFlowLabel(preBodyLabel); + bindIterativeStatement(node.statement, postWhileLabel, preWhileLabel); + addAntecedent(preWhileLabel, currentFlow); + currentFlow = finishFlowLabel(postWhileLabel); + } + function bindDoStatement(node) { + const preDoLabel = createLoopLabel(); + const preConditionLabel = setContinueTarget(node, createBranchLabel()); + const postDoLabel = createBranchLabel(); + addAntecedent(preDoLabel, currentFlow); + currentFlow = preDoLabel; + bindIterativeStatement(node.statement, postDoLabel, preConditionLabel); + addAntecedent(preConditionLabel, currentFlow); + currentFlow = finishFlowLabel(preConditionLabel); + bindCondition(node.expression, preDoLabel, postDoLabel); + currentFlow = finishFlowLabel(postDoLabel); + } + function bindForStatement(node) { + const preLoopLabel = setContinueTarget(node, createLoopLabel()); + const preBodyLabel = createBranchLabel(); + const postLoopLabel = createBranchLabel(); + bind2(node.initializer); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = preLoopLabel; + bindCondition(node.condition, preBodyLabel, postLoopLabel); + currentFlow = finishFlowLabel(preBodyLabel); + bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); + bind2(node.incrementor); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = finishFlowLabel(postLoopLabel); + } + function bindForInOrForOfStatement(node) { + const preLoopLabel = setContinueTarget(node, createLoopLabel()); + const postLoopLabel = createBranchLabel(); + bind2(node.expression); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = preLoopLabel; + if (node.kind === 250) { + bind2(node.awaitModifier); + } + addAntecedent(postLoopLabel, currentFlow); + bind2(node.initializer); + if (node.initializer.kind !== 261) { + bindAssignmentTargetFlow(node.initializer); + } + bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); + addAntecedent(preLoopLabel, currentFlow); + currentFlow = finishFlowLabel(postLoopLabel); + } + function bindIfStatement(node) { + const thenLabel = createBranchLabel(); + const elseLabel = createBranchLabel(); + const postIfLabel = createBranchLabel(); + bindCondition(node.expression, thenLabel, elseLabel); + currentFlow = finishFlowLabel(thenLabel); + bind2(node.thenStatement); + addAntecedent(postIfLabel, currentFlow); + currentFlow = finishFlowLabel(elseLabel); + bind2(node.elseStatement); + addAntecedent(postIfLabel, currentFlow); + currentFlow = finishFlowLabel(postIfLabel); + } + function bindReturnOrThrow(node) { + bind2(node.expression); + if (node.kind === 253) { + hasExplicitReturn = true; + if (currentReturnTarget) { + addAntecedent(currentReturnTarget, currentFlow); + } + } + currentFlow = unreachableFlow; + } + function findActiveLabel(name2) { + for (let label = activeLabelList; label; label = label.next) { + if (label.name === name2) { + return label; + } + } + return void 0; + } + function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { + const flowLabel = node.kind === 252 ? breakTarget : continueTarget; + if (flowLabel) { + addAntecedent(flowLabel, currentFlow); + currentFlow = unreachableFlow; + } + } + function bindBreakOrContinueStatement(node) { + bind2(node.label); + if (node.label) { + const activeLabel = findActiveLabel(node.label.escapedText); + if (activeLabel) { + activeLabel.referenced = true; + bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget); + } + } else { + bindBreakOrContinueFlow(node, currentBreakTarget, currentContinueTarget); + } + } + function bindTryStatement(node) { + const saveReturnTarget = currentReturnTarget; + const saveExceptionTarget = currentExceptionTarget; + const normalExitLabel = createBranchLabel(); + const returnLabel = createBranchLabel(); + let exceptionLabel = createBranchLabel(); + if (node.finallyBlock) { + currentReturnTarget = returnLabel; + } + addAntecedent(exceptionLabel, currentFlow); + currentExceptionTarget = exceptionLabel; + bind2(node.tryBlock); + addAntecedent(normalExitLabel, currentFlow); + if (node.catchClause) { + currentFlow = finishFlowLabel(exceptionLabel); + exceptionLabel = createBranchLabel(); + addAntecedent(exceptionLabel, currentFlow); + currentExceptionTarget = exceptionLabel; + bind2(node.catchClause); + addAntecedent(normalExitLabel, currentFlow); + } + currentReturnTarget = saveReturnTarget; + currentExceptionTarget = saveExceptionTarget; + if (node.finallyBlock) { + const finallyLabel = createBranchLabel(); + finallyLabel.antecedents = concatenate(concatenate(normalExitLabel.antecedents, exceptionLabel.antecedents), returnLabel.antecedents); + currentFlow = finallyLabel; + bind2(node.finallyBlock); + if (currentFlow.flags & 1) { + currentFlow = unreachableFlow; + } else { + if (currentReturnTarget && returnLabel.antecedents) { + addAntecedent(currentReturnTarget, createReduceLabel(finallyLabel, returnLabel.antecedents, currentFlow)); + } + if (currentExceptionTarget && exceptionLabel.antecedents) { + addAntecedent(currentExceptionTarget, createReduceLabel(finallyLabel, exceptionLabel.antecedents, currentFlow)); + } + currentFlow = normalExitLabel.antecedents ? createReduceLabel(finallyLabel, normalExitLabel.antecedents, currentFlow) : unreachableFlow; + } + } else { + currentFlow = finishFlowLabel(normalExitLabel); + } + } + function bindSwitchStatement(node) { + const postSwitchLabel = createBranchLabel(); + bind2(node.expression); + const saveBreakTarget = currentBreakTarget; + const savePreSwitchCaseFlow = preSwitchCaseFlow; + currentBreakTarget = postSwitchLabel; + preSwitchCaseFlow = currentFlow; + bind2(node.caseBlock); + addAntecedent(postSwitchLabel, currentFlow); + const hasDefault = forEach4( + node.caseBlock.clauses, + (c7) => c7.kind === 297 + /* DefaultClause */ + ); + node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; + if (!hasDefault) { + addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); + } + currentBreakTarget = saveBreakTarget; + preSwitchCaseFlow = savePreSwitchCaseFlow; + currentFlow = finishFlowLabel(postSwitchLabel); + } + function bindCaseBlock(node) { + const clauses = node.clauses; + const isNarrowingSwitch = node.parent.expression.kind === 112 || isNarrowingExpression(node.parent.expression); + let fallthroughFlow = unreachableFlow; + for (let i7 = 0; i7 < clauses.length; i7++) { + const clauseStart = i7; + while (!clauses[i7].statements.length && i7 + 1 < clauses.length) { + if (fallthroughFlow === unreachableFlow) { + currentFlow = preSwitchCaseFlow; + } + bind2(clauses[i7]); + i7++; + } + const preCaseLabel = createBranchLabel(); + addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i7 + 1) : preSwitchCaseFlow); + addAntecedent(preCaseLabel, fallthroughFlow); + currentFlow = finishFlowLabel(preCaseLabel); + const clause = clauses[i7]; + bind2(clause); + fallthroughFlow = currentFlow; + if (!(currentFlow.flags & 1) && i7 !== clauses.length - 1 && options.noFallthroughCasesInSwitch) { + clause.fallthroughFlowNode = currentFlow; + } + } + } + function bindCaseClause(node) { + const saveCurrentFlow = currentFlow; + currentFlow = preSwitchCaseFlow; + bind2(node.expression); + currentFlow = saveCurrentFlow; + bindEach(node.statements); + } + function bindExpressionStatement(node) { + bind2(node.expression); + maybeBindExpressionFlowIfCall(node.expression); + } + function maybeBindExpressionFlowIfCall(node) { + if (node.kind === 213) { + const call = node; + if (call.expression.kind !== 108 && isDottedName(call.expression)) { + currentFlow = createFlowCall(currentFlow, call); + } + } + } + function bindLabeledStatement(node) { + const postStatementLabel = createBranchLabel(); + activeLabelList = { + next: activeLabelList, + name: node.label.escapedText, + breakTarget: postStatementLabel, + continueTarget: void 0, + referenced: false + }; + bind2(node.label); + bind2(node.statement); + if (!activeLabelList.referenced && !options.allowUnusedLabels) { + errorOrSuggestionOnNode(unusedLabelIsError(options), node.label, Diagnostics.Unused_label); + } + activeLabelList = activeLabelList.next; + addAntecedent(postStatementLabel, currentFlow); + currentFlow = finishFlowLabel(postStatementLabel); + } + function bindDestructuringTargetFlow(node) { + if (node.kind === 226 && node.operatorToken.kind === 64) { + bindAssignmentTargetFlow(node.left); + } else { + bindAssignmentTargetFlow(node); + } + } + function bindAssignmentTargetFlow(node) { + if (isNarrowableReference(node)) { + currentFlow = createFlowMutation(16, currentFlow, node); + } else if (node.kind === 209) { + for (const e10 of node.elements) { + if (e10.kind === 230) { + bindAssignmentTargetFlow(e10.expression); + } else { + bindDestructuringTargetFlow(e10); + } + } + } else if (node.kind === 210) { + for (const p7 of node.properties) { + if (p7.kind === 303) { + bindDestructuringTargetFlow(p7.initializer); + } else if (p7.kind === 304) { + bindAssignmentTargetFlow(p7.name); + } else if (p7.kind === 305) { + bindAssignmentTargetFlow(p7.expression); + } + } + } + } + function bindLogicalLikeExpression(node, trueTarget, falseTarget) { + const preRightLabel = createBranchLabel(); + if (node.operatorToken.kind === 56 || node.operatorToken.kind === 77) { + bindCondition(node.left, preRightLabel, falseTarget); + } else { + bindCondition(node.left, trueTarget, preRightLabel); + } + currentFlow = finishFlowLabel(preRightLabel); + bind2(node.operatorToken); + if (isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) { + doWithConditionalBranches(bind2, node.right, trueTarget, falseTarget); + bindAssignmentTargetFlow(node.left); + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } else { + bindCondition(node.right, trueTarget, falseTarget); + } + } + function bindPrefixUnaryExpressionFlow(node) { + if (node.operator === 54) { + const saveTrueTarget = currentTrueTarget; + currentTrueTarget = currentFalseTarget; + currentFalseTarget = saveTrueTarget; + bindEachChild(node); + currentFalseTarget = currentTrueTarget; + currentTrueTarget = saveTrueTarget; + } else { + bindEachChild(node); + if (node.operator === 46 || node.operator === 47) { + bindAssignmentTargetFlow(node.operand); + } + } + } + function bindPostfixUnaryExpressionFlow(node) { + bindEachChild(node); + if (node.operator === 46 || node.operator === 47) { + bindAssignmentTargetFlow(node.operand); + } + } + function bindDestructuringAssignmentFlow(node) { + if (inAssignmentPattern) { + inAssignmentPattern = false; + bind2(node.operatorToken); + bind2(node.right); + inAssignmentPattern = true; + bind2(node.left); + } else { + inAssignmentPattern = true; + bind2(node.left); + inAssignmentPattern = false; + bind2(node.operatorToken); + bind2(node.right); + } + bindAssignmentTargetFlow(node.left); + } + function createBindBinaryExpressionFlow() { + return createBinaryExpressionTrampoline( + onEnter, + onLeft, + onOperator, + onRight, + onExit, + /*foldState*/ + void 0 + ); + function onEnter(node, state) { + if (state) { + state.stackIndex++; + setParent(node, parent22); + const saveInStrictMode = inStrictMode; + bindWorker(node); + const saveParent = parent22; + parent22 = node; + state.skip = false; + state.inStrictModeStack[state.stackIndex] = saveInStrictMode; + state.parentStack[state.stackIndex] = saveParent; + } else { + state = { + stackIndex: 0, + skip: false, + inStrictModeStack: [void 0], + parentStack: [void 0] + }; + } + const operator = node.operatorToken.kind; + if (isLogicalOrCoalescingBinaryOperator(operator) || isLogicalOrCoalescingAssignmentOperator(operator)) { + if (isTopLevelLogicalExpression(node)) { + const postExpressionLabel = createBranchLabel(); + bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); + currentFlow = finishFlowLabel(postExpressionLabel); + } else { + bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget); + } + state.skip = true; + } + return state; + } + function onLeft(left, state, node) { + if (!state.skip) { + const maybeBound = maybeBind2(left); + if (node.operatorToken.kind === 28) { + maybeBindExpressionFlowIfCall(left); + } + return maybeBound; + } + } + function onOperator(operatorToken, state, _node) { + if (!state.skip) { + bind2(operatorToken); + } + } + function onRight(right, state, node) { + if (!state.skip) { + const maybeBound = maybeBind2(right); + if (node.operatorToken.kind === 28) { + maybeBindExpressionFlowIfCall(right); + } + return maybeBound; + } + } + function onExit(node, state) { + if (!state.skip) { + const operator = node.operatorToken.kind; + if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { + bindAssignmentTargetFlow(node.left); + if (operator === 64 && node.left.kind === 212) { + const elementAccess = node.left; + if (isNarrowableOperand(elementAccess.expression)) { + currentFlow = createFlowMutation(256, currentFlow, node); + } + } + } + } + const savedInStrictMode = state.inStrictModeStack[state.stackIndex]; + const savedParent = state.parentStack[state.stackIndex]; + if (savedInStrictMode !== void 0) { + inStrictMode = savedInStrictMode; + } + if (savedParent !== void 0) { + parent22 = savedParent; + } + state.skip = false; + state.stackIndex--; + } + function maybeBind2(node) { + if (node && isBinaryExpression(node) && !isDestructuringAssignment(node)) { + return node; + } + bind2(node); + } + } + function bindDeleteExpressionFlow(node) { + bindEachChild(node); + if (node.expression.kind === 211) { + bindAssignmentTargetFlow(node.expression); + } + } + function bindConditionalExpressionFlow(node) { + const trueLabel = createBranchLabel(); + const falseLabel = createBranchLabel(); + const postExpressionLabel = createBranchLabel(); + bindCondition(node.condition, trueLabel, falseLabel); + currentFlow = finishFlowLabel(trueLabel); + bind2(node.questionToken); + bind2(node.whenTrue); + addAntecedent(postExpressionLabel, currentFlow); + currentFlow = finishFlowLabel(falseLabel); + bind2(node.colonToken); + bind2(node.whenFalse); + addAntecedent(postExpressionLabel, currentFlow); + currentFlow = finishFlowLabel(postExpressionLabel); + } + function bindInitializedVariableFlow(node) { + const name2 = !isOmittedExpression(node) ? node.name : void 0; + if (isBindingPattern(name2)) { + for (const child of name2.elements) { + bindInitializedVariableFlow(child); + } + } else { + currentFlow = createFlowMutation(16, currentFlow, node); + } + } + function bindVariableDeclarationFlow(node) { + bindEachChild(node); + if (node.initializer || isForInOrOfStatement(node.parent.parent)) { + bindInitializedVariableFlow(node); + } + } + function bindBindingElementFlow(node) { + bind2(node.dotDotDotToken); + bind2(node.propertyName); + bindInitializer(node.initializer); + bind2(node.name); + } + function bindParameterFlow(node) { + bindEach(node.modifiers); + bind2(node.dotDotDotToken); + bind2(node.questionToken); + bind2(node.type); + bindInitializer(node.initializer); + bind2(node.name); + } + function bindInitializer(node) { + if (!node) { + return; + } + const entryFlow = currentFlow; + bind2(node); + if (entryFlow === unreachableFlow || entryFlow === currentFlow) { + return; + } + const exitFlow = createBranchLabel(); + addAntecedent(exitFlow, entryFlow); + addAntecedent(exitFlow, currentFlow); + currentFlow = finishFlowLabel(exitFlow); + } + function bindJSDocTypeAlias(node) { + bind2(node.tagName); + if (node.kind !== 347 && node.fullName) { + setParent(node.fullName, node); + setParentRecursive( + node.fullName, + /*incremental*/ + false + ); + } + if (typeof node.comment !== "string") { + bindEach(node.comment); + } + } + function bindJSDocClassTag(node) { + bindEachChild(node); + const host = getHostSignatureFromJSDoc(node); + if (host && host.kind !== 174) { + addDeclarationToSymbol( + host.symbol, + host, + 32 + /* Class */ + ); + } + } + function bindOptionalExpression(node, trueTarget, falseTarget) { + doWithConditionalBranches(bind2, node, trueTarget, falseTarget); + if (!isOptionalChain(node) || isOutermostOptionalChain(node)) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindOptionalChainRest(node) { + switch (node.kind) { + case 211: + bind2(node.questionDotToken); + bind2(node.name); + break; + case 212: + bind2(node.questionDotToken); + bind2(node.argumentExpression); + break; + case 213: + bind2(node.questionDotToken); + bindEach(node.typeArguments); + bindEach(node.arguments); + break; + } + } + function bindOptionalChain(node, trueTarget, falseTarget) { + const preChainLabel = isOptionalChainRoot(node) ? createBranchLabel() : void 0; + bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); + if (preChainLabel) { + currentFlow = finishFlowLabel(preChainLabel); + } + doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget); + if (isOutermostOptionalChain(node)) { + addAntecedent(trueTarget, createFlowCondition(32, currentFlow, node)); + addAntecedent(falseTarget, createFlowCondition(64, currentFlow, node)); + } + } + function bindOptionalChainFlow(node) { + if (isTopLevelLogicalExpression(node)) { + const postExpressionLabel = createBranchLabel(); + bindOptionalChain(node, postExpressionLabel, postExpressionLabel); + currentFlow = finishFlowLabel(postExpressionLabel); + } else { + bindOptionalChain(node, currentTrueTarget, currentFalseTarget); + } + } + function bindNonNullExpressionFlow(node) { + if (isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + bindEachChild(node); + } + } + function bindAccessExpressionFlow(node) { + if (isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + bindEachChild(node); + } + } + function bindCallExpressionFlow(node) { + if (isOptionalChain(node)) { + bindOptionalChainFlow(node); + } else { + const expr = skipParentheses(node.expression); + if (expr.kind === 218 || expr.kind === 219) { + bindEach(node.typeArguments); + bindEach(node.arguments); + bind2(node.expression); + } else { + bindEachChild(node); + if (node.expression.kind === 108) { + currentFlow = createFlowCall(currentFlow, node); + } + } + } + if (node.expression.kind === 211) { + const propertyAccess = node.expression; + if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { + currentFlow = createFlowMutation(256, currentFlow, node); + } + } + } + function addToContainerChain(next) { + if (lastContainer) { + lastContainer.nextContainer = next; + } + lastContainer = next; + } + function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { + switch (container.kind) { + case 267: + return declareModuleMember(node, symbolFlags, symbolExcludes); + case 312: + return declareSourceFileMember(node, symbolFlags, symbolExcludes); + case 231: + case 263: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 266: + return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); + case 187: + case 329: + case 210: + case 264: + case 292: + return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + case 184: + case 185: + case 179: + case 180: + case 330: + case 181: + case 174: + case 173: + case 176: + case 177: + case 178: + case 262: + case 218: + case 219: + case 324: + case 175: + case 265: + case 200: + if (container.locals) + Debug.assertNode(container, canHaveLocals); + return declareSymbol( + container.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + function declareClassMember(node, symbolFlags, symbolExcludes) { + return isStatic(node) ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); + } + function declareSourceFileMember(node, symbolFlags, symbolExcludes) { + return isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) : declareSymbol( + file.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + function hasExportDeclarations(node) { + const body = isSourceFile(node) ? node : tryCast(node.body, isModuleBlock); + return !!body && body.statements.some((s7) => isExportDeclaration(s7) || isExportAssignment(s7)); + } + function setExportContextFlag(node) { + if (node.flags & 33554432 && !hasExportDeclarations(node)) { + node.flags |= 128; + } else { + node.flags &= ~128; + } + } + function bindModuleDeclaration(node) { + setExportContextFlag(node); + if (isAmbientModule(node)) { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); + } + if (isModuleAugmentationExternal(node)) { + declareModuleSymbol(node); + } else { + let pattern5; + if (node.name.kind === 11) { + const { text } = node.name; + pattern5 = tryParsePattern(text); + if (pattern5 === void 0) { + errorOnFirstToken(node.name, Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); + } + } + const symbol = declareSymbolAndAddToSymbolTable( + node, + 512, + 110735 + /* ValueModuleExcludes */ + ); + file.patternAmbientModules = append(file.patternAmbientModules, pattern5 && !isString4(pattern5) ? { pattern: pattern5, symbol } : void 0); + } + } else { + const state = declareModuleSymbol(node); + if (state !== 0) { + const { symbol } = node; + symbol.constEnumOnlyModule = !(symbol.flags & (16 | 32 | 256)) && state === 2 && symbol.constEnumOnlyModule !== false; + } + } + } + function declareModuleSymbol(node) { + const state = getModuleInstanceState(node); + const instantiated = state !== 0; + declareSymbolAndAddToSymbolTable( + node, + instantiated ? 512 : 1024, + instantiated ? 110735 : 0 + /* NamespaceModuleExcludes */ + ); + return state; + } + function bindFunctionOrConstructorType(node) { + const symbol = createSymbol(131072, getDeclarationName(node)); + addDeclarationToSymbol( + symbol, + node, + 131072 + /* Signature */ + ); + const typeLiteralSymbol = createSymbol( + 2048, + "__type" + /* Type */ + ); + addDeclarationToSymbol( + typeLiteralSymbol, + node, + 2048 + /* TypeLiteral */ + ); + typeLiteralSymbol.members = createSymbolTable(); + typeLiteralSymbol.members.set(symbol.escapedName, symbol); + } + function bindObjectLiteralExpression(node) { + return bindAnonymousDeclaration( + node, + 4096, + "__object" + /* Object */ + ); + } + function bindJsxAttributes(node) { + return bindAnonymousDeclaration( + node, + 4096, + "__jsxAttributes" + /* JSXAttributes */ + ); + } + function bindJsxAttribute(node, symbolFlags, symbolExcludes) { + return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + function bindAnonymousDeclaration(node, symbolFlags, name2) { + const symbol = createSymbol(symbolFlags, name2); + if (symbolFlags & (8 | 106500)) { + symbol.parent = container.symbol; + } + addDeclarationToSymbol(symbol, node, symbolFlags); + return symbol; + } + function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { + switch (blockScopeContainer.kind) { + case 267: + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + case 312: + if (isExternalOrCommonJsModule(container)) { + declareModuleMember(node, symbolFlags, symbolExcludes); + break; + } + default: + Debug.assertNode(blockScopeContainer, canHaveLocals); + if (!blockScopeContainer.locals) { + blockScopeContainer.locals = createSymbolTable(); + addToContainerChain(blockScopeContainer); + } + declareSymbol( + blockScopeContainer.locals, + /*parent*/ + void 0, + node, + symbolFlags, + symbolExcludes + ); + } + } + function delayedBindJSDocTypedefTag() { + if (!delayedTypeAliases) { + return; + } + const saveContainer = container; + const saveLastContainer = lastContainer; + const saveBlockScopeContainer = blockScopeContainer; + const saveParent = parent22; + const saveCurrentFlow = currentFlow; + for (const typeAlias of delayedTypeAliases) { + const host = typeAlias.parent.parent; + container = getEnclosingContainer(host) || file; + blockScopeContainer = getEnclosingBlockScopeContainer(host) || file; + currentFlow = initFlowNode({ + flags: 2 + /* Start */ + }); + parent22 = typeAlias; + bind2(typeAlias.typeExpression); + const declName = getNameOfDeclaration(typeAlias); + if ((isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && isPropertyAccessEntityNameExpression(declName.parent)) { + const isTopLevel = isTopLevelNamespaceAssignment(declName.parent); + if (isTopLevel) { + bindPotentiallyMissingNamespaces( + file.symbol, + declName.parent, + isTopLevel, + !!findAncestor(declName, (d7) => isPropertyAccessExpression(d7) && d7.name.escapedText === "prototype"), + /*containerIsClass*/ + false + ); + const oldContainer = container; + switch (getAssignmentDeclarationPropertyAccessKind(declName.parent)) { + case 1: + case 2: + if (!isExternalOrCommonJsModule(file)) { + container = void 0; + } else { + container = file; + } + break; + case 4: + container = declName.parent.expression; + break; + case 3: + container = declName.parent.expression.name; + break; + case 5: + container = isExportsOrModuleExportsOrAlias(file, declName.parent.expression) ? file : isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; + break; + case 0: + return Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration"); + } + if (container) { + declareModuleMember( + typeAlias, + 524288, + 788968 + /* TypeAliasExcludes */ + ); + } + container = oldContainer; + } + } else if (isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 80) { + parent22 = typeAlias.parent; + bindBlockScopedDeclaration( + typeAlias, + 524288, + 788968 + /* TypeAliasExcludes */ + ); + } else { + bind2(typeAlias.fullName); + } + } + container = saveContainer; + lastContainer = saveLastContainer; + blockScopeContainer = saveBlockScopeContainer; + parent22 = saveParent; + currentFlow = saveCurrentFlow; + } + function checkContextualIdentifier(node) { + if (!file.parseDiagnostics.length && !(node.flags & 33554432) && !(node.flags & 16777216) && !isIdentifierName(node)) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind === void 0) { + return; + } + if (inStrictMode && originalKeywordKind >= 119 && originalKeywordKind <= 127) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node))); + } else if (originalKeywordKind === 135) { + if (isExternalModule(file) && isInTopLevelContext(node)) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node))); + } else if (node.flags & 65536) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); + } + } else if (originalKeywordKind === 127 && node.flags & 16384) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node))); + } + } + } + function getStrictModeIdentifierMessage(node) { + if (getContainingClass(node)) { + return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; + } + return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; + } + function checkPrivateIdentifier(node) { + if (node.escapedText === "#constructor") { + if (!file.parseDiagnostics.length) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.constructor_is_a_reserved_word, declarationNameToString(node))); + } + } + } + function checkStrictModeBinaryExpression(node) { + if (inStrictMode && isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operatorToken.kind)) { + checkStrictModeEvalOrArguments(node, node.left); + } + } + function checkStrictModeCatchClause(node) { + if (inStrictMode && node.variableDeclaration) { + checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); + } + } + function checkStrictModeDeleteExpression(node) { + if (inStrictMode && node.expression.kind === 80) { + const span = getErrorSpanForNode(file, node.expression); + file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); + } + } + function isEvalOrArgumentsIdentifier(node) { + return isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments"); + } + function checkStrictModeEvalOrArguments(contextNode, name2) { + if (name2 && name2.kind === 80) { + const identifier = name2; + if (isEvalOrArgumentsIdentifier(identifier)) { + const span = getErrorSpanForNode(file, name2); + file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, getStrictModeEvalOrArgumentsMessage(contextNode), idText(identifier))); + } + } + } + function getStrictModeEvalOrArgumentsMessage(node) { + if (getContainingClass(node)) { + return Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode; + } + if (file.externalModuleIndicator) { + return Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; + } + return Diagnostics.Invalid_use_of_0_in_strict_mode; + } + function checkStrictModeFunctionName(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + } + function getStrictModeBlockScopeFunctionDeclarationMessage(node) { + if (getContainingClass(node)) { + return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode; + } + if (file.externalModuleIndicator) { + return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode; + } + return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5; + } + function checkStrictModeFunctionDeclaration(node) { + if (languageVersion < 2) { + if (blockScopeContainer.kind !== 312 && blockScopeContainer.kind !== 267 && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { + const errorSpan = getErrorSpanForNode(file, node); + file.bindDiagnostics.push(createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); + } + } + } + function checkStrictModePostfixUnaryExpression(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + function checkStrictModePrefixUnaryExpression(node) { + if (inStrictMode) { + if (node.operator === 46 || node.operator === 47) { + checkStrictModeEvalOrArguments(node, node.operand); + } + } + } + function checkStrictModeWithStatement(node) { + if (inStrictMode) { + errorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); + } + } + function checkStrictModeLabeledStatement(node) { + if (inStrictMode && getEmitScriptTarget(options) >= 2) { + if (isDeclarationStatement(node.statement) || isVariableStatement(node.statement)) { + errorOnFirstToken(node.label, Diagnostics.A_label_is_not_allowed_here); + } + } + } + function errorOnFirstToken(node, message, ...args) { + const span = getSpanOfTokenAtPosition(file, node.pos); + file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, ...args)); + } + function errorOrSuggestionOnNode(isError3, node, message) { + errorOrSuggestionOnRange(isError3, node, node, message); + } + function errorOrSuggestionOnRange(isError3, startNode2, endNode2, message) { + addErrorOrSuggestionDiagnostic(isError3, { pos: getTokenPosOfNode(startNode2, file), end: endNode2.end }, message); + } + function addErrorOrSuggestionDiagnostic(isError3, range2, message) { + const diag2 = createFileDiagnostic(file, range2.pos, range2.end - range2.pos, message); + if (isError3) { + file.bindDiagnostics.push(diag2); + } else { + file.bindSuggestionDiagnostics = append(file.bindSuggestionDiagnostics, { + ...diag2, + category: 2 + /* Suggestion */ + }); + } + } + function bind2(node) { + if (!node) { + return; + } + setParent(node, parent22); + if (tracing) + node.tracingPath = file.path; + const saveInStrictMode = inStrictMode; + bindWorker(node); + if (node.kind > 165) { + const saveParent = parent22; + parent22 = node; + const containerFlags = getContainerFlags(node); + if (containerFlags === 0) { + bindChildren(node); + } else { + bindContainer(node, containerFlags); + } + parent22 = saveParent; + } else { + const saveParent = parent22; + if (node.kind === 1) + parent22 = node; + bindJSDoc(node); + parent22 = saveParent; + } + inStrictMode = saveInStrictMode; + } + function bindJSDoc(node) { + if (hasJSDocNodes(node)) { + if (isInJSFile(node)) { + for (const j6 of node.jsDoc) { + bind2(j6); + } + } else { + for (const j6 of node.jsDoc) { + setParent(j6, node); + setParentRecursive( + j6, + /*incremental*/ + false + ); + } + } + } + } + function updateStrictModeStatementList(statements) { + if (!inStrictMode) { + for (const statement of statements) { + if (!isPrologueDirective(statement)) { + return; + } + if (isUseStrictPrologueDirective(statement)) { + inStrictMode = true; + return; + } + } + } + } + function isUseStrictPrologueDirective(node) { + const nodeText2 = getSourceTextOfNodeFromSourceFile(file, node.expression); + return nodeText2 === '"use strict"' || nodeText2 === "'use strict'"; + } + function bindWorker(node) { + switch (node.kind) { + case 80: + if (node.flags & 4096) { + let parentNode = node.parent; + while (parentNode && !isJSDocTypeAlias(parentNode)) { + parentNode = parentNode.parent; + } + bindBlockScopedDeclaration( + parentNode, + 524288, + 788968 + /* TypeAliasExcludes */ + ); + break; + } + case 110: + if (currentFlow && (isExpression(node) || parent22.kind === 304)) { + node.flowNode = currentFlow; + } + return checkContextualIdentifier(node); + case 166: + if (currentFlow && isPartOfTypeQuery(node)) { + node.flowNode = currentFlow; + } + break; + case 236: + case 108: + node.flowNode = currentFlow; + break; + case 81: + return checkPrivateIdentifier(node); + case 211: + case 212: + const expr = node; + if (currentFlow && isNarrowableReference(expr)) { + expr.flowNode = currentFlow; + } + if (isSpecialPropertyDeclaration(expr)) { + bindSpecialPropertyDeclaration(expr); + } + if (isInJSFile(expr) && file.commonJsModuleIndicator && isModuleExportsAccessExpression(expr) && !lookupSymbolForName(blockScopeContainer, "module")) { + declareSymbol( + file.locals, + /*parent*/ + void 0, + expr.expression, + 1 | 134217728, + 111550 + /* FunctionScopedVariableExcludes */ + ); + } + break; + case 226: + const specialKind = getAssignmentDeclarationKind(node); + switch (specialKind) { + case 1: + bindExportsPropertyAssignment(node); + break; + case 2: + bindModuleExportsAssignment(node); + break; + case 3: + bindPrototypePropertyAssignment(node.left, node); + break; + case 6: + bindPrototypeAssignment(node); + break; + case 4: + bindThisPropertyAssignment(node); + break; + case 5: + const expression = node.left.expression; + if (isInJSFile(node) && isIdentifier(expression)) { + const symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); + if (isThisInitializedDeclaration(symbol == null ? void 0 : symbol.valueDeclaration)) { + bindThisPropertyAssignment(node); + break; + } + } + bindSpecialPropertyAssignment(node); + break; + case 0: + break; + default: + Debug.fail("Unknown binary expression special property assignment kind"); + } + return checkStrictModeBinaryExpression(node); + case 299: + return checkStrictModeCatchClause(node); + case 220: + return checkStrictModeDeleteExpression(node); + case 225: + return checkStrictModePostfixUnaryExpression(node); + case 224: + return checkStrictModePrefixUnaryExpression(node); + case 254: + return checkStrictModeWithStatement(node); + case 256: + return checkStrictModeLabeledStatement(node); + case 197: + seenThisKeyword = true; + return; + case 182: + break; + case 168: + return bindTypeParameter(node); + case 169: + return bindParameter(node); + case 260: + return bindVariableDeclarationOrBindingElement(node); + case 208: + node.flowNode = currentFlow; + return bindVariableDeclarationOrBindingElement(node); + case 172: + case 171: + return bindPropertyWorker(node); + case 303: + case 304: + return bindPropertyOrMethodOrAccessor( + node, + 4, + 0 + /* PropertyExcludes */ + ); + case 306: + return bindPropertyOrMethodOrAccessor( + node, + 8, + 900095 + /* EnumMemberExcludes */ + ); + case 179: + case 180: + case 181: + return declareSymbolAndAddToSymbolTable( + node, + 131072, + 0 + /* None */ + ); + case 174: + case 173: + return bindPropertyOrMethodOrAccessor( + node, + 8192 | (node.questionToken ? 16777216 : 0), + isObjectLiteralMethod(node) ? 0 : 103359 + /* MethodExcludes */ + ); + case 262: + return bindFunctionDeclaration(node); + case 176: + return declareSymbolAndAddToSymbolTable( + node, + 16384, + /*symbolExcludes:*/ + 0 + /* None */ + ); + case 177: + return bindPropertyOrMethodOrAccessor( + node, + 32768, + 46015 + /* GetAccessorExcludes */ + ); + case 178: + return bindPropertyOrMethodOrAccessor( + node, + 65536, + 78783 + /* SetAccessorExcludes */ + ); + case 184: + case 324: + case 330: + case 185: + return bindFunctionOrConstructorType(node); + case 187: + case 329: + case 200: + return bindAnonymousTypeWorker(node); + case 339: + return bindJSDocClassTag(node); + case 210: + return bindObjectLiteralExpression(node); + case 218: + case 219: + return bindFunctionExpression(node); + case 213: + const assignmentKind = getAssignmentDeclarationKind(node); + switch (assignmentKind) { + case 7: + return bindObjectDefinePropertyAssignment(node); + case 8: + return bindObjectDefinePropertyExport(node); + case 9: + return bindObjectDefinePrototypeProperty(node); + case 0: + break; + default: + return Debug.fail("Unknown call expression assignment declaration kind"); + } + if (isInJSFile(node)) { + bindCallExpression(node); + } + break; + case 231: + case 263: + inStrictMode = true; + return bindClassLikeDeclaration(node); + case 264: + return bindBlockScopedDeclaration( + node, + 64, + 788872 + /* InterfaceExcludes */ + ); + case 265: + return bindBlockScopedDeclaration( + node, + 524288, + 788968 + /* TypeAliasExcludes */ + ); + case 266: + return bindEnumDeclaration(node); + case 267: + return bindModuleDeclaration(node); + case 292: + return bindJsxAttributes(node); + case 291: + return bindJsxAttribute( + node, + 4, + 0 + /* PropertyExcludes */ + ); + case 271: + case 274: + case 276: + case 281: + return declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* AliasExcludes */ + ); + case 270: + return bindNamespaceExportDeclaration(node); + case 273: + return bindImportClause(node); + case 278: + return bindExportDeclaration(node); + case 277: + return bindExportAssignment(node); + case 312: + updateStrictModeStatementList(node.statements); + return bindSourceFileIfExternalModule(); + case 241: + if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { + return; + } + case 268: + return updateStrictModeStatementList(node.statements); + case 348: + if (node.parent.kind === 330) { + return bindParameter(node); + } + if (node.parent.kind !== 329) { + break; + } + case 355: + const propTag = node; + const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 323 ? 4 | 16777216 : 4; + return declareSymbolAndAddToSymbolTable( + propTag, + flags, + 0 + /* PropertyExcludes */ + ); + case 353: + case 345: + case 347: + return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); + case 346: + return bind2(node.typeExpression); + } + } + function bindPropertyWorker(node) { + const isAutoAccessor = isAutoAccessorPropertyDeclaration(node); + const includes2 = isAutoAccessor ? 98304 : 4; + const excludes = isAutoAccessor ? 13247 : 0; + return bindPropertyOrMethodOrAccessor(node, includes2 | (node.questionToken ? 16777216 : 0), excludes); + } + function bindAnonymousTypeWorker(node) { + return bindAnonymousDeclaration( + node, + 2048, + "__type" + /* Type */ + ); + } + function bindSourceFileIfExternalModule() { + setExportContextFlag(file); + if (isExternalModule(file)) { + bindSourceFileAsExternalModule(); + } else if (isJsonSourceFile(file)) { + bindSourceFileAsExternalModule(); + const originalSymbol = file.symbol; + declareSymbol( + file.symbol.exports, + file.symbol, + file, + 4, + -1 + /* All */ + ); + file.symbol = originalSymbol; + } + } + function bindSourceFileAsExternalModule() { + bindAnonymousDeclaration(file, 512, `"${removeFileExtension(file.fileName)}"`); + } + function bindExportAssignment(node) { + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 111551, getDeclarationName(node)); + } else { + const flags = exportAssignmentIsAlias(node) ? 2097152 : 4; + const symbol = declareSymbol( + container.symbol.exports, + container.symbol, + node, + flags, + -1 + /* All */ + ); + if (node.isExportEquals) { + setValueDeclaration(symbol, node); + } + } + } + function bindNamespaceExportDeclaration(node) { + if (some2(node.modifiers)) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Modifiers_cannot_appear_here)); + } + const diag2 = !isSourceFile(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_at_top_level : !isExternalModule(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_in_module_files : !node.parent.isDeclarationFile ? Diagnostics.Global_module_exports_may_only_appear_in_declaration_files : void 0; + if (diag2) { + file.bindDiagnostics.push(createDiagnosticForNode2(node, diag2)); + } else { + file.symbol.globalExports = file.symbol.globalExports || createSymbolTable(); + declareSymbol( + file.symbol.globalExports, + file.symbol, + node, + 2097152, + 2097152 + /* AliasExcludes */ + ); + } + } + function bindExportDeclaration(node) { + if (!container.symbol || !container.symbol.exports) { + bindAnonymousDeclaration(node, 8388608, getDeclarationName(node)); + } else if (!node.exportClause) { + declareSymbol( + container.symbol.exports, + container.symbol, + node, + 8388608, + 0 + /* None */ + ); + } else if (isNamespaceExport(node.exportClause)) { + setParent(node.exportClause, node); + declareSymbol( + container.symbol.exports, + container.symbol, + node.exportClause, + 2097152, + 2097152 + /* AliasExcludes */ + ); + } + } + function bindImportClause(node) { + if (node.name) { + declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* AliasExcludes */ + ); + } + } + function setCommonJsModuleIndicator(node) { + if (file.externalModuleIndicator && file.externalModuleIndicator !== true) { + return false; + } + if (!file.commonJsModuleIndicator) { + file.commonJsModuleIndicator = node; + if (!file.externalModuleIndicator) { + bindSourceFileAsExternalModule(); + } + } + return true; + } + function bindObjectDefinePropertyExport(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + const symbol = forEachIdentifierInEntityName( + node.arguments[0], + /*parent*/ + void 0, + (id, symbol2) => { + if (symbol2) { + addDeclarationToSymbol( + symbol2, + id, + 1536 | 67108864 + /* Assignment */ + ); + } + return symbol2; + } + ); + if (symbol) { + const flags = 4 | 1048576; + declareSymbol( + symbol.exports, + symbol, + node, + flags, + 0 + /* None */ + ); + } + } + function bindExportsPropertyAssignment(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + const symbol = forEachIdentifierInEntityName( + node.left.expression, + /*parent*/ + void 0, + (id, symbol2) => { + if (symbol2) { + addDeclarationToSymbol( + symbol2, + id, + 1536 | 67108864 + /* Assignment */ + ); + } + return symbol2; + } + ); + if (symbol) { + const isAlias2 = isAliasableExpression(node.right) && (isExportsIdentifier(node.left.expression) || isModuleExportsAccessExpression(node.left.expression)); + const flags = isAlias2 ? 2097152 : 4 | 1048576; + setParent(node.left, node); + declareSymbol( + symbol.exports, + symbol, + node.left, + flags, + 0 + /* None */ + ); + } + } + function bindModuleExportsAssignment(node) { + if (!setCommonJsModuleIndicator(node)) { + return; + } + const assignedExpression = getRightMostAssignedExpression(node.right); + if (isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { + return; + } + if (isObjectLiteralExpression(assignedExpression) && every2(assignedExpression.properties, isShorthandPropertyAssignment)) { + forEach4(assignedExpression.properties, bindExportAssignedObjectMemberAlias); + return; + } + const flags = exportAssignmentIsAlias(node) ? 2097152 : 4 | 1048576 | 512; + const symbol = declareSymbol( + file.symbol.exports, + file.symbol, + node, + flags | 67108864, + 0 + /* None */ + ); + setValueDeclaration(symbol, node); + } + function bindExportAssignedObjectMemberAlias(node) { + declareSymbol( + file.symbol.exports, + file.symbol, + node, + 2097152 | 67108864, + 0 + /* None */ + ); + } + function bindThisPropertyAssignment(node) { + Debug.assert(isInJSFile(node)); + const hasPrivateIdentifier = isBinaryExpression(node) && isPropertyAccessExpression(node.left) && isPrivateIdentifier(node.left.name) || isPropertyAccessExpression(node) && isPrivateIdentifier(node.name); + if (hasPrivateIdentifier) { + return; + } + const thisContainer = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + switch (thisContainer.kind) { + case 262: + case 218: + let constructorSymbol = thisContainer.symbol; + if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 64) { + const l7 = thisContainer.parent.left; + if (isBindableStaticAccessExpression(l7) && isPrototypeAccess(l7.expression)) { + constructorSymbol = lookupSymbolForPropertyAccess(l7.expression.expression, thisParentContainer); + } + } + if (constructorSymbol && constructorSymbol.valueDeclaration) { + constructorSymbol.members = constructorSymbol.members || createSymbolTable(); + if (hasDynamicName(node)) { + bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol, constructorSymbol.members); + } else { + declareSymbol( + constructorSymbol.members, + constructorSymbol, + node, + 4 | 67108864, + 0 & ~4 + /* Property */ + ); + } + addDeclarationToSymbol( + constructorSymbol, + constructorSymbol.valueDeclaration, + 32 + /* Class */ + ); + } + break; + case 176: + case 172: + case 174: + case 177: + case 178: + case 175: + const containingClass = thisContainer.parent; + const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; + if (hasDynamicName(node)) { + bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol, symbolTable); + } else { + declareSymbol( + symbolTable, + containingClass.symbol, + node, + 4 | 67108864, + 0, + /*isReplaceableByMethod*/ + true + ); + } + break; + case 312: + if (hasDynamicName(node)) { + break; + } else if (thisContainer.commonJsModuleIndicator) { + declareSymbol( + thisContainer.symbol.exports, + thisContainer.symbol, + node, + 4 | 1048576, + 0 + /* None */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111550 + /* FunctionScopedVariableExcludes */ + ); + } + break; + case 267: + break; + default: + Debug.failBadSyntaxKind(thisContainer); + } + } + function bindDynamicallyNamedThisPropertyAssignment(node, symbol, symbolTable) { + declareSymbol( + symbolTable, + symbol, + node, + 4, + 0, + /*isReplaceableByMethod*/ + true, + /*isComputedName*/ + true + ); + addLateBoundAssignmentDeclarationToSymbol(node, symbol); + } + function addLateBoundAssignmentDeclarationToSymbol(node, symbol) { + if (symbol) { + (symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = /* @__PURE__ */ new Map())).set(getNodeId(node), node); + } + } + function bindSpecialPropertyDeclaration(node) { + if (node.expression.kind === 110) { + bindThisPropertyAssignment(node); + } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 312) { + if (isPrototypeAccess(node.expression)) { + bindPrototypePropertyAssignment(node, node.parent); + } else { + bindStaticPropertyAssignment(node); + } + } + } + function bindPrototypeAssignment(node) { + setParent(node.left, node); + setParent(node.right, node); + bindPropertyAssignment( + node.left.expression, + node.left, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + true + ); + } + function bindObjectDefinePrototypeProperty(node) { + const namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression); + if (namespaceSymbol && namespaceSymbol.valueDeclaration) { + addDeclarationToSymbol( + namespaceSymbol, + namespaceSymbol.valueDeclaration, + 32 + /* Class */ + ); + } + bindPotentiallyNewExpandoMemberToNamespace( + node, + namespaceSymbol, + /*isPrototypeProperty*/ + true + ); + } + function bindPrototypePropertyAssignment(lhs, parent3) { + const classPrototype = lhs.expression; + const constructorFunction = classPrototype.expression; + setParent(constructorFunction, classPrototype); + setParent(classPrototype, lhs); + setParent(lhs, parent3); + bindPropertyAssignment( + constructorFunction, + lhs, + /*isPrototypeProperty*/ + true, + /*containerIsClass*/ + true + ); + } + function bindObjectDefinePropertyAssignment(node) { + let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); + const isToplevel = node.parent.parent.kind === 312; + namespaceSymbol = bindPotentiallyMissingNamespaces( + namespaceSymbol, + node.arguments[0], + isToplevel, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + false + ); + bindPotentiallyNewExpandoMemberToNamespace( + node, + namespaceSymbol, + /*isPrototypeProperty*/ + false + ); + } + function bindSpecialPropertyAssignment(node) { + var _a2; + const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer) || lookupSymbolForPropertyAccess(node.left.expression, container); + if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) { + return; + } + const rootExpr = getLeftmostAccessExpression(node.left); + if (isIdentifier(rootExpr) && ((_a2 = lookupSymbolForName(container, rootExpr.escapedText)) == null ? void 0 : _a2.flags) & 2097152) { + return; + } + setParent(node.left, node); + setParent(node.right, node); + if (isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) { + bindExportsPropertyAssignment(node); + } else if (hasDynamicName(node)) { + bindAnonymousDeclaration( + node, + 4 | 67108864, + "__computed" + /* Computed */ + ); + const sym = bindPotentiallyMissingNamespaces( + parentSymbol, + node.left.expression, + isTopLevelNamespaceAssignment(node.left), + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + false + ); + addLateBoundAssignmentDeclarationToSymbol(node, sym); + } else { + bindStaticPropertyAssignment(cast(node.left, isBindableStaticNameExpression)); + } + } + function bindStaticPropertyAssignment(node) { + Debug.assert(!isIdentifier(node)); + setParent(node.expression, node); + bindPropertyAssignment( + node.expression, + node, + /*isPrototypeProperty*/ + false, + /*containerIsClass*/ + false + ); + } + function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty, containerIsClass) { + if ((namespaceSymbol == null ? void 0 : namespaceSymbol.flags) & 2097152) { + return namespaceSymbol; + } + if (isToplevel && !isPrototypeProperty) { + const flags = 1536 | 67108864; + const excludeFlags = 110735 & ~67108864; + namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, (id, symbol, parent3) => { + if (symbol) { + addDeclarationToSymbol(symbol, id, flags); + return symbol; + } else { + const table2 = parent3 ? parent3.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = createSymbolTable()); + return declareSymbol(table2, parent3, id, flags, excludeFlags); + } + }); + } + if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) { + addDeclarationToSymbol( + namespaceSymbol, + namespaceSymbol.valueDeclaration, + 32 + /* Class */ + ); + } + return namespaceSymbol; + } + function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) { + if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) { + return; + } + const symbolTable = isPrototypeProperty ? namespaceSymbol.members || (namespaceSymbol.members = createSymbolTable()) : namespaceSymbol.exports || (namespaceSymbol.exports = createSymbolTable()); + let includes2 = 0; + let excludes = 0; + if (isFunctionLikeDeclaration(getAssignedExpandoInitializer(declaration))) { + includes2 = 8192; + excludes = 103359; + } else if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { + if (some2(declaration.arguments[2].properties, (p7) => { + const id = getNameOfDeclaration(p7); + return !!id && isIdentifier(id) && idText(id) === "set"; + })) { + includes2 |= 65536 | 4; + excludes |= 78783; + } + if (some2(declaration.arguments[2].properties, (p7) => { + const id = getNameOfDeclaration(p7); + return !!id && isIdentifier(id) && idText(id) === "get"; + })) { + includes2 |= 32768 | 4; + excludes |= 46015; + } + } + if (includes2 === 0) { + includes2 = 4; + excludes = 0; + } + declareSymbol( + symbolTable, + namespaceSymbol, + declaration, + includes2 | 67108864, + excludes & ~67108864 + /* Assignment */ + ); + } + function isTopLevelNamespaceAssignment(propertyAccess) { + return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 312 : propertyAccess.parent.parent.kind === 312; + } + function bindPropertyAssignment(name2, propertyAccess, isPrototypeProperty, containerIsClass) { + let namespaceSymbol = lookupSymbolForPropertyAccess(name2, blockScopeContainer) || lookupSymbolForPropertyAccess(name2, container); + const isToplevel = isTopLevelNamespaceAssignment(propertyAccess); + namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass); + bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty); + } + function isExpandoSymbol(symbol) { + if (symbol.flags & (16 | 32 | 1024)) { + return true; + } + const node = symbol.valueDeclaration; + if (node && isCallExpression(node)) { + return !!getAssignedExpandoInitializer(node); + } + let init2 = !node ? void 0 : isVariableDeclaration(node) ? node.initializer : isBinaryExpression(node) ? node.right : isPropertyAccessExpression(node) && isBinaryExpression(node.parent) ? node.parent.right : void 0; + init2 = init2 && getRightMostAssignedExpression(init2); + if (init2) { + const isPrototypeAssignment = isPrototypeAccess(isVariableDeclaration(node) ? node.name : isBinaryExpression(node) ? node.left : node); + return !!getExpandoInitializer(isBinaryExpression(init2) && (init2.operatorToken.kind === 57 || init2.operatorToken.kind === 61) ? init2.right : init2, isPrototypeAssignment); + } + return false; + } + function getParentOfBinaryExpression(expr) { + while (isBinaryExpression(expr.parent)) { + expr = expr.parent; + } + return expr.parent; + } + function lookupSymbolForPropertyAccess(node, lookupContainer = container) { + if (isIdentifier(node)) { + return lookupSymbolForName(lookupContainer, node.escapedText); + } else { + const symbol = lookupSymbolForPropertyAccess(node.expression); + return symbol && symbol.exports && symbol.exports.get(getElementOrPropertyAccessName(node)); + } + } + function forEachIdentifierInEntityName(e10, parent3, action) { + if (isExportsOrModuleExportsOrAlias(file, e10)) { + return file.symbol; + } else if (isIdentifier(e10)) { + return action(e10, lookupSymbolForPropertyAccess(e10), parent3); + } else { + const s7 = forEachIdentifierInEntityName(e10.expression, parent3, action); + const name2 = getNameOrArgument(e10); + if (isPrivateIdentifier(name2)) { + Debug.fail("unexpected PrivateIdentifier"); + } + return action(name2, s7 && s7.exports && s7.exports.get(getElementOrPropertyAccessName(e10)), s7); + } + } + function bindCallExpression(node) { + if (!file.commonJsModuleIndicator && isRequireCall( + node, + /*requireStringLiteralLikeArgument*/ + false + )) { + setCommonJsModuleIndicator(node); + } + } + function bindClassLikeDeclaration(node) { + if (node.kind === 263) { + bindBlockScopedDeclaration( + node, + 32, + 899503 + /* ClassExcludes */ + ); + } else { + const bindingName = node.name ? node.name.escapedText : "__class"; + bindAnonymousDeclaration(node, 32, bindingName); + if (node.name) { + classifiableNames.add(node.name.escapedText); + } + } + const { symbol } = node; + const prototypeSymbol = createSymbol(4 | 4194304, "prototype"); + const symbolExport = symbol.exports.get(prototypeSymbol.escapedName); + if (symbolExport) { + if (node.name) { + setParent(node.name, node); + } + file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol))); + } + symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol); + prototypeSymbol.parent = symbol; + } + function bindEnumDeclaration(node) { + return isEnumConst(node) ? bindBlockScopedDeclaration( + node, + 128, + 899967 + /* ConstEnumExcludes */ + ) : bindBlockScopedDeclaration( + node, + 256, + 899327 + /* RegularEnumExcludes */ + ); + } + function bindVariableDeclarationOrBindingElement(node) { + if (inStrictMode) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (!isBindingPattern(node.name)) { + const possibleVariableDecl = node.kind === 260 ? node : node.parent.parent; + if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 32)) { + declareSymbolAndAddToSymbolTable( + node, + 2097152, + 2097152 + /* AliasExcludes */ + ); + } else if (isBlockOrCatchScoped(node)) { + bindBlockScopedDeclaration( + node, + 2, + 111551 + /* BlockScopedVariableExcludes */ + ); + } else if (isParameterDeclaration(node)) { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111551 + /* ParameterExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111550 + /* FunctionScopedVariableExcludes */ + ); + } + } + } + function bindParameter(node) { + if (node.kind === 348 && container.kind !== 330) { + return; + } + if (inStrictMode && !(node.flags & 33554432)) { + checkStrictModeEvalOrArguments(node, node.name); + } + if (isBindingPattern(node.name)) { + bindAnonymousDeclaration(node, 1, "__" + node.parent.parameters.indexOf(node)); + } else { + declareSymbolAndAddToSymbolTable( + node, + 1, + 111551 + /* ParameterExcludes */ + ); + } + if (isParameterPropertyDeclaration(node, node.parent)) { + const classDeclaration = node.parent.parent; + declareSymbol( + classDeclaration.symbol.members, + classDeclaration.symbol, + node, + 4 | (node.questionToken ? 16777216 : 0), + 0 + /* PropertyExcludes */ + ); + } + } + function bindFunctionDeclaration(node) { + if (!file.isDeclarationFile && !(node.flags & 33554432)) { + if (isAsyncFunction(node)) { + emitFlags |= 4096; + } + } + checkStrictModeFunctionName(node); + if (inStrictMode) { + checkStrictModeFunctionDeclaration(node); + bindBlockScopedDeclaration( + node, + 16, + 110991 + /* FunctionExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 16, + 110991 + /* FunctionExcludes */ + ); + } + } + function bindFunctionExpression(node) { + if (!file.isDeclarationFile && !(node.flags & 33554432)) { + if (isAsyncFunction(node)) { + emitFlags |= 4096; + } + } + if (currentFlow) { + node.flowNode = currentFlow; + } + checkStrictModeFunctionName(node); + const bindingName = node.name ? node.name.escapedText : "__function"; + return bindAnonymousDeclaration(node, 16, bindingName); + } + function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { + if (!file.isDeclarationFile && !(node.flags & 33554432) && isAsyncFunction(node)) { + emitFlags |= 4096; + } + if (currentFlow && isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { + node.flowNode = currentFlow; + } + return hasDynamicName(node) ? bindAnonymousDeclaration( + node, + symbolFlags, + "__computed" + /* Computed */ + ) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); + } + function getInferTypeContainer(node) { + const extendsType = findAncestor(node, (n7) => n7.parent && isConditionalTypeNode(n7.parent) && n7.parent.extendsType === n7); + return extendsType && extendsType.parent; + } + function bindTypeParameter(node) { + if (isJSDocTemplateTag(node.parent)) { + const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent); + if (container2) { + Debug.assertNode(container2, canHaveLocals); + container2.locals ?? (container2.locals = createSymbolTable()); + declareSymbol( + container2.locals, + /*parent*/ + void 0, + node, + 262144, + 526824 + /* TypeParameterExcludes */ + ); + } else { + declareSymbolAndAddToSymbolTable( + node, + 262144, + 526824 + /* TypeParameterExcludes */ + ); + } + } else if (node.parent.kind === 195) { + const container2 = getInferTypeContainer(node.parent); + if (container2) { + Debug.assertNode(container2, canHaveLocals); + container2.locals ?? (container2.locals = createSymbolTable()); + declareSymbol( + container2.locals, + /*parent*/ + void 0, + node, + 262144, + 526824 + /* TypeParameterExcludes */ + ); + } else { + bindAnonymousDeclaration(node, 262144, getDeclarationName(node)); + } + } else { + declareSymbolAndAddToSymbolTable( + node, + 262144, + 526824 + /* TypeParameterExcludes */ + ); + } + } + function shouldReportErrorOnModuleDeclaration(node) { + const instanceState = getModuleInstanceState(node); + return instanceState === 1 || instanceState === 2 && shouldPreserveConstEnums(options); + } + function checkUnreachable(node) { + if (!(currentFlow.flags & 1)) { + return false; + } + if (currentFlow === unreachableFlow) { + const reportError = ( + // report error on all statements except empty ones + isStatementButNotDeclaration(node) && node.kind !== 242 || // report error on class declarations + node.kind === 263 || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set + node.kind === 267 && shouldReportErrorOnModuleDeclaration(node) + ); + if (reportError) { + currentFlow = reportedUnreachableFlow; + if (!options.allowUnreachableCode) { + const isError3 = unreachableCodeIsError(options) && !(node.flags & 33554432) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 7) || node.declarationList.declarations.some((d7) => !!d7.initializer)); + eachUnreachableRange(node, (start, end) => errorOrSuggestionOnRange(isError3, start, end, Diagnostics.Unreachable_code_detected)); + } + } + } + return true; + } + } + function eachUnreachableRange(node, cb) { + if (isStatement(node) && isExecutableStatement(node) && isBlock2(node.parent)) { + const { statements } = node.parent; + const slice2 = sliceAfter(statements, node); + getRangesWhere(slice2, isExecutableStatement, (start, afterEnd) => cb(slice2[start], slice2[afterEnd - 1])); + } else { + cb(node, node); + } + } + function isExecutableStatement(s7) { + return !isFunctionDeclaration(s7) && !isPurelyTypeDeclaration(s7) && !isEnumDeclaration(s7) && // `var x;` may declare a variable used above + !(isVariableStatement(s7) && !(getCombinedNodeFlags(s7) & 7) && s7.declarationList.declarations.some((d7) => !d7.initializer)); + } + function isPurelyTypeDeclaration(s7) { + switch (s7.kind) { + case 264: + case 265: + return true; + case 267: + return getModuleInstanceState(s7) !== 1; + case 266: + return hasSyntacticModifier( + s7, + 4096 + /* Const */ + ); + default: + return false; + } + } + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + let i7 = 0; + const q5 = createQueue(); + q5.enqueue(node); + while (!q5.isEmpty() && i7 < 100) { + i7++; + node = q5.dequeue(); + if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) { + return true; + } else if (isIdentifier(node)) { + const symbol = lookupSymbolForName(sourceFile, node.escapedText); + if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { + const init2 = symbol.valueDeclaration.initializer; + q5.enqueue(init2); + if (isAssignmentExpression( + init2, + /*excludeCompoundAssignment*/ + true + )) { + q5.enqueue(init2.left); + q5.enqueue(init2.right); + } + } + } + } + return false; + } + function getContainerFlags(node) { + switch (node.kind) { + case 231: + case 263: + case 266: + case 210: + case 187: + case 329: + case 292: + return 1; + case 264: + return 1 | 64; + case 267: + case 265: + case 200: + case 181: + return 1 | 32; + case 312: + return 1 | 4 | 32; + case 177: + case 178: + case 174: + if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { + return 1 | 4 | 32 | 8 | 128; + } + case 176: + case 262: + case 173: + case 179: + case 330: + case 324: + case 184: + case 180: + case 185: + case 175: + return 1 | 4 | 32 | 8; + case 218: + case 219: + return 1 | 4 | 32 | 8 | 16; + case 268: + return 4; + case 172: + return node.initializer ? 4 : 0; + case 299: + case 248: + case 249: + case 250: + case 269: + return 2 | 32; + case 241: + return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 : 2 | 32; + } + return 0; + } + function lookupSymbolForName(container, name2) { + var _a2, _b, _c, _d; + const local = (_b = (_a2 = tryCast(container, canHaveLocals)) == null ? void 0 : _a2.locals) == null ? void 0 : _b.get(name2); + if (local) { + return local.exportSymbol ?? local; + } + if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name2)) { + return container.jsGlobalAugmentations.get(name2); + } + if (canHaveSymbol(container)) { + return (_d = (_c = container.symbol) == null ? void 0 : _c.exports) == null ? void 0 : _d.get(name2); + } + } + var ModuleInstanceState, ContainerFlags, binder; + var init_binder = __esm2({ + "src/compiler/binder.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + ModuleInstanceState = /* @__PURE__ */ ((ModuleInstanceState2) => { + ModuleInstanceState2[ModuleInstanceState2["NonInstantiated"] = 0] = "NonInstantiated"; + ModuleInstanceState2[ModuleInstanceState2["Instantiated"] = 1] = "Instantiated"; + ModuleInstanceState2[ModuleInstanceState2["ConstEnumOnly"] = 2] = "ConstEnumOnly"; + return ModuleInstanceState2; + })(ModuleInstanceState || {}); + ContainerFlags = /* @__PURE__ */ ((ContainerFlags2) => { + ContainerFlags2[ContainerFlags2["None"] = 0] = "None"; + ContainerFlags2[ContainerFlags2["IsContainer"] = 1] = "IsContainer"; + ContainerFlags2[ContainerFlags2["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; + ContainerFlags2[ContainerFlags2["IsControlFlowContainer"] = 4] = "IsControlFlowContainer"; + ContainerFlags2[ContainerFlags2["IsFunctionLike"] = 8] = "IsFunctionLike"; + ContainerFlags2[ContainerFlags2["IsFunctionExpression"] = 16] = "IsFunctionExpression"; + ContainerFlags2[ContainerFlags2["HasLocals"] = 32] = "HasLocals"; + ContainerFlags2[ContainerFlags2["IsInterface"] = 64] = "IsInterface"; + ContainerFlags2[ContainerFlags2["IsObjectLiteralOrClassExpressionMethodOrAccessor"] = 128] = "IsObjectLiteralOrClassExpressionMethodOrAccessor"; + return ContainerFlags2; + })(ContainerFlags || {}); + binder = /* @__PURE__ */ createBinder(); + } + }); + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getConstraintOfTypeParameter, getFirstIdentifier2, getTypeArguments) { + return getSymbolWalker; + function getSymbolWalker(accept = () => true) { + const visitedTypes = []; + const visitedSymbols = []; + return { + walkType: (type3) => { + try { + visitType(type3); + return { visitedTypes: getOwnValues(visitedTypes), visitedSymbols: getOwnValues(visitedSymbols) }; + } finally { + clear2(visitedTypes); + clear2(visitedSymbols); + } + }, + walkSymbol: (symbol) => { + try { + visitSymbol(symbol); + return { visitedTypes: getOwnValues(visitedTypes), visitedSymbols: getOwnValues(visitedSymbols) }; + } finally { + clear2(visitedTypes); + clear2(visitedSymbols); + } + } + }; + function visitType(type3) { + if (!type3) { + return; + } + if (visitedTypes[type3.id]) { + return; + } + visitedTypes[type3.id] = type3; + const shouldBail = visitSymbol(type3.symbol); + if (shouldBail) + return; + if (type3.flags & 524288) { + const objectType2 = type3; + const objectFlags = objectType2.objectFlags; + if (objectFlags & 4) { + visitTypeReference(type3); + } + if (objectFlags & 32) { + visitMappedType(type3); + } + if (objectFlags & (1 | 2)) { + visitInterfaceType(type3); + } + if (objectFlags & (8 | 16)) { + visitObjectType(objectType2); + } + } + if (type3.flags & 262144) { + visitTypeParameter(type3); + } + if (type3.flags & 3145728) { + visitUnionOrIntersectionType(type3); + } + if (type3.flags & 4194304) { + visitIndexType(type3); + } + if (type3.flags & 8388608) { + visitIndexedAccessType(type3); + } + } + function visitTypeReference(type3) { + visitType(type3.target); + forEach4(getTypeArguments(type3), visitType); + } + function visitTypeParameter(type3) { + visitType(getConstraintOfTypeParameter(type3)); + } + function visitUnionOrIntersectionType(type3) { + forEach4(type3.types, visitType); + } + function visitIndexType(type3) { + visitType(type3.type); + } + function visitIndexedAccessType(type3) { + visitType(type3.objectType); + visitType(type3.indexType); + visitType(type3.constraint); + } + function visitMappedType(type3) { + visitType(type3.typeParameter); + visitType(type3.constraintType); + visitType(type3.templateType); + visitType(type3.modifiersType); + } + function visitSignature(signature) { + const typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); + } + forEach4(signature.typeParameters, visitType); + for (const parameter of signature.parameters) { + visitSymbol(parameter); + } + visitType(getRestTypeOfSignature(signature)); + visitType(getReturnTypeOfSignature(signature)); + } + function visitInterfaceType(interfaceT) { + visitObjectType(interfaceT); + forEach4(interfaceT.typeParameters, visitType); + forEach4(getBaseTypes(interfaceT), visitType); + visitType(interfaceT.thisType); + } + function visitObjectType(type3) { + const resolved = resolveStructuredTypeMembers(type3); + for (const info2 of resolved.indexInfos) { + visitType(info2.keyType); + visitType(info2.type); + } + for (const signature of resolved.callSignatures) { + visitSignature(signature); + } + for (const signature of resolved.constructSignatures) { + visitSignature(signature); + } + for (const p7 of resolved.properties) { + visitSymbol(p7); + } + } + function visitSymbol(symbol) { + if (!symbol) { + return false; + } + const symbolId = getSymbolId(symbol); + if (visitedSymbols[symbolId]) { + return false; + } + visitedSymbols[symbolId] = symbol; + if (!accept(symbol)) { + return true; + } + const t8 = getTypeOfSymbol(symbol); + visitType(t8); + if (symbol.exports) { + symbol.exports.forEach(visitSymbol); + } + forEach4(symbol.declarations, (d7) => { + if (d7.type && d7.type.kind === 186) { + const query = d7.type; + const entity = getResolvedSymbol(getFirstIdentifier2(query.exprName)); + visitSymbol(entity); + } + }); + return false; + } + } + } + var init_symbolWalker = __esm2({ + "src/compiler/symbolWalker.ts"() { + "use strict"; + init_ts2(); + } + }); + function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) { + const filePreferredEnding = getPreferredEnding(); + return { + relativePreference: oldImportSpecifier !== void 0 ? isExternalModuleNameRelative(oldImportSpecifier) ? 0 : 1 : importModuleSpecifierPreference === "relative" ? 0 : importModuleSpecifierPreference === "non-relative" ? 1 : importModuleSpecifierPreference === "project-relative" ? 3 : 2, + getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => { + const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding; + if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99) { + if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) { + return [ + 3, + 2 + /* JsExtension */ + ]; + } + return [ + 2 + /* JsExtension */ + ]; + } + if (getEmitModuleResolutionKind(compilerOptions) === 1) { + return preferredEnding === 2 ? [ + 2, + 1 + /* Index */ + ] : [ + 1, + 2 + /* JsExtension */ + ]; + } + const allowImportingTsExtension = shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName); + switch (preferredEnding) { + case 2: + return allowImportingTsExtension ? [ + 2, + 3, + 0, + 1 + /* Index */ + ] : [ + 2, + 0, + 1 + /* Index */ + ]; + case 3: + return [ + 3, + 0, + 2, + 1 + /* Index */ + ]; + case 1: + return allowImportingTsExtension ? [ + 1, + 0, + 3, + 2 + /* JsExtension */ + ] : [ + 1, + 0, + 2 + /* JsExtension */ + ]; + case 0: + return allowImportingTsExtension ? [ + 0, + 1, + 3, + 2 + /* JsExtension */ + ] : [ + 0, + 1, + 2 + /* JsExtension */ + ]; + default: + Debug.assertNever(preferredEnding); + } + } + }; + function getPreferredEnding(resolutionMode) { + if (oldImportSpecifier !== void 0) { + if (hasJSFileExtension(oldImportSpecifier)) + return 2; + if (endsWith2(oldImportSpecifier, "/index")) + return 1; + } + return getModuleSpecifierEndingPreference( + importModuleSpecifierEnding, + resolutionMode ?? importingSourceFile.impliedNodeFormat, + compilerOptions, + importingSourceFile + ); + } + } + function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, oldImportSpecifier, options = {}) { + const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile, oldImportSpecifier), {}, options); + if (res === oldImportSpecifier) + return void 0; + return res; + } + function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) { + return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options); + } + function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) { + const info2 = getInfo(importingSourceFile.fileName, host); + const modulePaths = getAllModulePaths(info2, nodeModulesFileName, host, preferences, options); + return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + preferences, + /*packageNameOnly*/ + true, + options.overrideImportMode + )); + } + function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) { + const info2 = getInfo(importingSourceFileName, host); + const modulePaths = getAllModulePaths(info2, toFileName2, host, userPreferences, options); + return firstDefined(modulePaths, (modulePath) => tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + userPreferences, + /*packageNameOnly*/ + void 0, + options.overrideImportMode + )) || getLocalModuleSpecifier(toFileName2, info2, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences); + } + function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options = {}) { + return tryGetModuleSpecifiersFromCacheWorker( + moduleSymbol, + importingSourceFile, + host, + userPreferences, + options + )[0]; + } + function tryGetModuleSpecifiersFromCacheWorker(moduleSymbol, importingSourceFile, host, userPreferences, options = {}) { + var _a2; + const moduleSourceFile = getSourceFileOfModule(moduleSymbol); + if (!moduleSourceFile) { + return emptyArray; + } + const cache = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host); + const cached = cache == null ? void 0 : cache.get(importingSourceFile.path, moduleSourceFile.path, userPreferences, options); + return [cached == null ? void 0 : cached.moduleSpecifiers, moduleSourceFile, cached == null ? void 0 : cached.modulePaths, cache]; + } + function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) { + return getModuleSpecifiersWithCacheInfo( + moduleSymbol, + checker, + compilerOptions, + importingSourceFile, + host, + userPreferences, + options, + /*forAutoImport*/ + false + ).moduleSpecifiers; + } + function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { + let computedWithoutCache = false; + const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker); + if (ambient) + return { moduleSpecifiers: [ambient], computedWithoutCache }; + let [specifiers, moduleSourceFile, modulePaths, cache] = tryGetModuleSpecifiersFromCacheWorker( + moduleSymbol, + importingSourceFile, + host, + userPreferences, + options + ); + if (specifiers) + return { moduleSpecifiers: specifiers, computedWithoutCache }; + if (!moduleSourceFile) + return { moduleSpecifiers: emptyArray, computedWithoutCache }; + computedWithoutCache = true; + modulePaths || (modulePaths = getAllModulePathsWorker(getInfo(importingSourceFile.fileName, host), moduleSourceFile.originalFileName, host)); + const result2 = computeModuleSpecifiers( + modulePaths, + compilerOptions, + importingSourceFile, + host, + userPreferences, + options, + forAutoImport + ); + cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result2); + return { moduleSpecifiers: result2, computedWithoutCache }; + } + function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) { + const info2 = getInfo(importingSourceFile.fileName, host); + const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile); + const existingSpecifier = forEach4(modulePaths, (modulePath) => forEach4( + host.getFileIncludeReasons().get(toPath2(modulePath.path, host.getCurrentDirectory(), info2.getCanonicalFileName)), + (reason) => { + if (reason.kind !== 3 || reason.file !== importingSourceFile.path) + return void 0; + if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index, compilerOptions)) + return void 0; + const specifier = getModuleNameStringLiteralAt(importingSourceFile, reason.index).text; + return preferences.relativePreference !== 1 || !pathIsRelative(specifier) ? specifier : void 0; + } + )); + if (existingSpecifier) { + const moduleSpecifiers = [existingSpecifier]; + return moduleSpecifiers; + } + const importedFileIsInNodeModules = some2(modulePaths, (p7) => p7.isInNodeModules); + let nodeModulesSpecifiers; + let pathsSpecifiers; + let redirectPathsSpecifiers; + let relativeSpecifiers; + for (const modulePath of modulePaths) { + const specifier = modulePath.isInNodeModules ? tryGetModuleNameAsNodeModule( + modulePath, + info2, + importingSourceFile, + host, + compilerOptions, + userPreferences, + /*packageNameOnly*/ + void 0, + options.overrideImportMode + ) : void 0; + nodeModulesSpecifiers = append(nodeModulesSpecifiers, specifier); + if (specifier && modulePath.isRedirect) { + return nodeModulesSpecifiers; + } + if (!specifier) { + const local = getLocalModuleSpecifier( + modulePath.path, + info2, + compilerOptions, + host, + options.overrideImportMode || importingSourceFile.impliedNodeFormat, + preferences, + /*pathsOnly*/ + modulePath.isRedirect + ); + if (!local) { + continue; + } + if (modulePath.isRedirect) { + redirectPathsSpecifiers = append(redirectPathsSpecifiers, local); + } else if (pathIsBareSpecifier(local)) { + if (pathContainsNodeModules(local)) { + relativeSpecifiers = append(relativeSpecifiers, local); + } else { + pathsSpecifiers = append(pathsSpecifiers, local); + } + } else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) { + relativeSpecifiers = append(relativeSpecifiers, local); + } + } + } + return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? pathsSpecifiers : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? redirectPathsSpecifiers : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? nodeModulesSpecifiers : Debug.checkDefined(relativeSpecifiers); + } + function getInfo(importingSourceFileName, host) { + importingSourceFileName = getNormalizedAbsolutePath(importingSourceFileName, host.getCurrentDirectory()); + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : true); + const sourceDirectory = getDirectoryPath(importingSourceFileName); + return { + getCanonicalFileName, + importingSourceFileName, + sourceDirectory, + canonicalSourceDirectory: getCanonicalFileName(sourceDirectory) + }; + } + function getLocalModuleSpecifier(moduleFileName, info2, compilerOptions, host, importMode, { getAllowedEndingsInPreferredOrder: getAllowedEndingsInPrefererredOrder, relativePreference }, pathsOnly) { + const { baseUrl, paths, rootDirs } = compilerOptions; + if (pathsOnly && !paths) { + return void 0; + } + const { sourceDirectory, canonicalSourceDirectory, getCanonicalFileName } = info2; + const allowedEndings = getAllowedEndingsInPrefererredOrder(importMode); + const relativePath2 = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) || processEnding(ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceDirectory, moduleFileName, getCanonicalFileName)), allowedEndings, compilerOptions); + if (!baseUrl && !paths && !getResolvePackageJsonImports(compilerOptions) || relativePreference === 0) { + return pathsOnly ? void 0 : relativePath2; + } + const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory()); + const relativeToBaseUrl = getRelativePathIfInSameVolume(moduleFileName, baseDirectory, getCanonicalFileName); + if (!relativeToBaseUrl) { + return pathsOnly ? void 0 : relativePath2; + } + const fromPackageJsonImports = pathsOnly ? void 0 : tryGetModuleNameFromPackageJsonImports(moduleFileName, sourceDirectory, compilerOptions, host, importMode); + const fromPaths = pathsOnly || fromPackageJsonImports === void 0 ? paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) : void 0; + if (pathsOnly) { + return fromPaths; + } + const maybeNonRelative = fromPackageJsonImports ?? (fromPaths === void 0 && baseUrl !== void 0 ? processEnding(relativeToBaseUrl, allowedEndings, compilerOptions) : fromPaths); + if (!maybeNonRelative) { + return relativePath2; + } + if (relativePreference === 1 && !pathIsRelative(maybeNonRelative)) { + return maybeNonRelative; + } + if (relativePreference === 3 && !pathIsRelative(maybeNonRelative)) { + const projectDirectory = compilerOptions.configFilePath ? toPath2(getDirectoryPath(compilerOptions.configFilePath), host.getCurrentDirectory(), info2.getCanonicalFileName) : info2.getCanonicalFileName(host.getCurrentDirectory()); + const modulePath = toPath2(moduleFileName, projectDirectory, getCanonicalFileName); + const sourceIsInternal = startsWith2(canonicalSourceDirectory, projectDirectory); + const targetIsInternal = startsWith2(modulePath, projectDirectory); + if (sourceIsInternal && !targetIsInternal || !sourceIsInternal && targetIsInternal) { + return maybeNonRelative; + } + const nearestTargetPackageJson = getNearestAncestorDirectoryWithPackageJson(host, getDirectoryPath(modulePath)); + const nearestSourcePackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory); + const ignoreCase = !hostUsesCaseSensitiveFileNames(host); + if (!packageJsonPathsAreEqual(nearestTargetPackageJson, nearestSourcePackageJson, ignoreCase)) { + return maybeNonRelative; + } + return relativePath2; + } + return isPathRelativeToParent(maybeNonRelative) || countPathComponents(relativePath2) < countPathComponents(maybeNonRelative) ? relativePath2 : maybeNonRelative; + } + function packageJsonPathsAreEqual(a7, b8, ignoreCase) { + if (a7 === b8) + return true; + if (a7 === void 0 || b8 === void 0) + return false; + return comparePaths(a7, b8, ignoreCase) === 0; + } + function countPathComponents(path2) { + let count2 = 0; + for (let i7 = startsWith2(path2, "./") ? 2 : 0; i7 < path2.length; i7++) { + if (path2.charCodeAt(i7) === 47) + count2++; + } + return count2; + } + function comparePathsByRedirectAndNumberOfDirectorySeparators(a7, b8) { + return compareBooleans(b8.isRedirect, a7.isRedirect) || compareNumberOfDirectorySeparators(a7.path, b8.path); + } + function getNearestAncestorDirectoryWithPackageJson(host, fileName) { + if (host.getNearestAncestorDirectoryWithPackageJson) { + return host.getNearestAncestorDirectoryWithPackageJson(fileName); + } + return forEachAncestorDirectory(fileName, (directory) => { + return host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0; + }); + } + function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) { + var _a2; + const getCanonicalFileName = hostGetCanonicalFileName(host); + const cwd3 = host.getCurrentDirectory(); + const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : void 0; + const importedPath = toPath2(importedFileName, cwd3, getCanonicalFileName); + const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray; + const importedFileNames = [...referenceRedirect ? [referenceRedirect] : emptyArray, importedFileName, ...redirects]; + const targets = importedFileNames.map((f8) => getNormalizedAbsolutePath(f8, cwd3)); + let shouldFilterIgnoredPaths = !every2(targets, containsIgnoredPath); + if (!preferSymlinks) { + const result22 = forEach4(targets, (p7) => !(shouldFilterIgnoredPaths && containsIgnoredPath(p7)) && cb(p7, referenceRedirect === p7)); + if (result22) + return result22; + } + const symlinkedDirectories = (_a2 = host.getSymlinkCache) == null ? void 0 : _a2.call(host).getSymlinkedDirectoriesByRealpath(); + const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd3); + const result2 = symlinkedDirectories && forEachAncestorDirectory(getDirectoryPath(fullImportedFileName), (realPathDirectory) => { + const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath2(realPathDirectory, cwd3, getCanonicalFileName))); + if (!symlinkDirectories) + return void 0; + if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) { + return false; + } + return forEach4(targets, (target) => { + if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) { + return; + } + const relative2 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName); + for (const symlinkDirectory of symlinkDirectories) { + const option = resolvePath(symlinkDirectory, relative2); + const result22 = cb(option, target === referenceRedirect); + shouldFilterIgnoredPaths = true; + if (result22) + return result22; + } + }); + }); + return result2 || (preferSymlinks ? forEach4(targets, (p7) => shouldFilterIgnoredPaths && containsIgnoredPath(p7) ? void 0 : cb(p7, p7 === referenceRedirect)) : void 0); + } + function getAllModulePaths(info2, importedFileName, host, preferences, options = {}) { + var _a2; + const importingFilePath = toPath2(info2.importingSourceFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)); + const importedFilePath = toPath2(importedFileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)); + const cache = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host); + if (cache) { + const cached = cache.get(importingFilePath, importedFilePath, preferences, options); + if (cached == null ? void 0 : cached.modulePaths) + return cached.modulePaths; + } + const modulePaths = getAllModulePathsWorker(info2, importedFileName, host); + if (cache) { + cache.setModulePaths(importingFilePath, importedFilePath, preferences, options, modulePaths); + } + return modulePaths; + } + function getAllModulePathsWorker(info2, importedFileName, host) { + const allFileNames = /* @__PURE__ */ new Map(); + let importedFileFromNodeModules = false; + forEachFileNameOfModule( + info2.importingSourceFileName, + importedFileName, + host, + /*preferSymlinks*/ + true, + (path2, isRedirect) => { + const isInNodeModules = pathContainsNodeModules(path2); + allFileNames.set(path2, { path: info2.getCanonicalFileName(path2), isRedirect, isInNodeModules }); + importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules; + } + ); + const sortedPaths = []; + for (let directory = info2.canonicalSourceDirectory; allFileNames.size !== 0; ) { + const directoryStart = ensureTrailingDirectorySeparator(directory); + let pathsInDirectory; + allFileNames.forEach(({ path: path2, isRedirect, isInNodeModules }, fileName) => { + if (startsWith2(path2, directoryStart)) { + (pathsInDirectory || (pathsInDirectory = [])).push({ path: fileName, isRedirect, isInNodeModules }); + allFileNames.delete(fileName); + } + }); + if (pathsInDirectory) { + if (pathsInDirectory.length > 1) { + pathsInDirectory.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + } + sortedPaths.push(...pathsInDirectory); + } + const newDirectory = getDirectoryPath(directory); + if (newDirectory === directory) + break; + directory = newDirectory; + } + if (allFileNames.size) { + const remainingPaths = arrayFrom( + allFileNames.entries(), + ([fileName, { isRedirect, isInNodeModules }]) => ({ path: fileName, isRedirect, isInNodeModules }) + ); + if (remainingPaths.length > 1) + remainingPaths.sort(comparePathsByRedirectAndNumberOfDirectorySeparators); + sortedPaths.push(...remainingPaths); + } + return sortedPaths; + } + function tryGetModuleNameFromAmbientModule(moduleSymbol, checker) { + var _a2; + const decl = (_a2 = moduleSymbol.declarations) == null ? void 0 : _a2.find( + (d7) => isNonGlobalAmbientModule(d7) && (!isExternalModuleAugmentation(d7) || !isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(d7.name))) + ); + if (decl) { + return decl.name.text; + } + const ambientModuleDeclareCandidates = mapDefined(moduleSymbol.declarations, (d7) => { + var _a22, _b, _c, _d; + if (!isModuleDeclaration(d7)) + return; + const topNamespace = getTopNamespace(d7); + if (!(((_a22 = topNamespace == null ? void 0 : topNamespace.parent) == null ? void 0 : _a22.parent) && isModuleBlock(topNamespace.parent) && isAmbientModule(topNamespace.parent.parent) && isSourceFile(topNamespace.parent.parent.parent))) + return; + const exportAssignment = (_d = (_c = (_b = topNamespace.parent.parent.symbol.exports) == null ? void 0 : _b.get("export=")) == null ? void 0 : _c.valueDeclaration) == null ? void 0 : _d.expression; + if (!exportAssignment) + return; + const exportSymbol = checker.getSymbolAtLocation(exportAssignment); + if (!exportSymbol) + return; + const originalExportSymbol = (exportSymbol == null ? void 0 : exportSymbol.flags) & 2097152 ? checker.getAliasedSymbol(exportSymbol) : exportSymbol; + if (originalExportSymbol === d7.symbol) + return topNamespace.parent.parent; + function getTopNamespace(namespaceDeclaration) { + while (namespaceDeclaration.flags & 8) { + namespaceDeclaration = namespaceDeclaration.parent; + } + return namespaceDeclaration; + } + }); + const ambientModuleDeclare = ambientModuleDeclareCandidates[0]; + if (ambientModuleDeclare) { + return ambientModuleDeclare.name.text; + } + } + function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) { + for (const key in paths) { + for (const patternText2 of paths[key]) { + const pattern5 = normalizePath(patternText2); + const indexOfStar = pattern5.indexOf("*"); + const candidates = allowedEndings.map((ending) => ({ + ending, + value: processEnding(relativeToBaseUrl, [ending], compilerOptions) + })); + if (tryGetExtensionFromPath2(pattern5)) { + candidates.push({ ending: void 0, value: relativeToBaseUrl }); + } + if (indexOfStar !== -1) { + const prefix = pattern5.substring(0, indexOfStar); + const suffix = pattern5.substring(indexOfStar + 1); + for (const { ending, value: value2 } of candidates) { + if (value2.length >= prefix.length + suffix.length && startsWith2(value2, prefix) && endsWith2(value2, suffix) && validateEnding({ ending, value: value2 })) { + const matchedStar = value2.substring(prefix.length, value2.length - suffix.length); + if (!pathIsRelative(matchedStar)) { + return replaceFirstStar(key, matchedStar); + } + } + } + } else if (some2(candidates, (c7) => c7.ending !== 0 && pattern5 === c7.value) || some2(candidates, (c7) => c7.ending === 0 && pattern5 === c7.value && validateEnding(c7))) { + return key; + } + } + } + function validateEnding({ ending, value: value2 }) { + return ending !== 0 || value2 === processEnding(relativeToBaseUrl, [ending], compilerOptions, host); + } + } + function tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, exports29, conditions, mode, isImports) { + if (typeof exports29 === "string") { + const ignoreCase = !hostUsesCaseSensitiveFileNames(host); + const getCommonSourceDirectory2 = () => host.getCommonSourceDirectory(); + const outputFile = isImports && getOutputJSFileNameWorker(targetFilePath, options, ignoreCase, getCommonSourceDirectory2); + const declarationFile = isImports && getOutputDeclarationFileNameWorker(targetFilePath, options, ignoreCase, getCommonSourceDirectory2); + const pathOrPattern = getNormalizedAbsolutePath( + combinePaths(packageDirectory, exports29), + /*currentDirectory*/ + void 0 + ); + const extensionSwappedTarget = hasTSFileExtension(targetFilePath) ? removeFileExtension(targetFilePath) + tryGetJSExtensionForFile(targetFilePath, options) : void 0; + switch (mode) { + case 0: + if (extensionSwappedTarget && comparePaths(extensionSwappedTarget, pathOrPattern, ignoreCase) === 0 || comparePaths(targetFilePath, pathOrPattern, ignoreCase) === 0 || outputFile && comparePaths(outputFile, pathOrPattern, ignoreCase) === 0 || declarationFile && comparePaths(declarationFile, pathOrPattern, ignoreCase) === 0) { + return { moduleFileToTry: packageName }; + } + break; + case 1: + if (extensionSwappedTarget && containsPath(pathOrPattern, extensionSwappedTarget, ignoreCase)) { + const fragment = getRelativePathFromDirectory( + pathOrPattern, + extensionSwappedTarget, + /*ignoreCase*/ + false + ); + return { moduleFileToTry: getNormalizedAbsolutePath( + combinePaths(combinePaths(packageName, exports29), fragment), + /*currentDirectory*/ + void 0 + ) }; + } + if (containsPath(pathOrPattern, targetFilePath, ignoreCase)) { + const fragment = getRelativePathFromDirectory( + pathOrPattern, + targetFilePath, + /*ignoreCase*/ + false + ); + return { moduleFileToTry: getNormalizedAbsolutePath( + combinePaths(combinePaths(packageName, exports29), fragment), + /*currentDirectory*/ + void 0 + ) }; + } + if (outputFile && containsPath(pathOrPattern, outputFile, ignoreCase)) { + const fragment = getRelativePathFromDirectory( + pathOrPattern, + outputFile, + /*ignoreCase*/ + false + ); + return { moduleFileToTry: combinePaths(packageName, fragment) }; + } + if (declarationFile && containsPath(pathOrPattern, declarationFile, ignoreCase)) { + const fragment = getRelativePathFromDirectory( + pathOrPattern, + declarationFile, + /*ignoreCase*/ + false + ); + return { moduleFileToTry: combinePaths(packageName, fragment) }; + } + break; + case 2: + const starPos = pathOrPattern.indexOf("*"); + const leadingSlice = pathOrPattern.slice(0, starPos); + const trailingSlice = pathOrPattern.slice(starPos + 1); + if (extensionSwappedTarget && startsWith2(extensionSwappedTarget, leadingSlice, ignoreCase) && endsWith2(extensionSwappedTarget, trailingSlice, ignoreCase)) { + const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length); + return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) }; + } + if (startsWith2(targetFilePath, leadingSlice, ignoreCase) && endsWith2(targetFilePath, trailingSlice, ignoreCase)) { + const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length); + return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) }; + } + if (outputFile && startsWith2(outputFile, leadingSlice, ignoreCase) && endsWith2(outputFile, trailingSlice, ignoreCase)) { + const starReplacement = outputFile.slice(leadingSlice.length, outputFile.length - trailingSlice.length); + return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) }; + } + if (declarationFile && startsWith2(declarationFile, leadingSlice, ignoreCase) && endsWith2(declarationFile, trailingSlice, ignoreCase)) { + const starReplacement = declarationFile.slice(leadingSlice.length, declarationFile.length - trailingSlice.length); + return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) }; + } + break; + } + } else if (Array.isArray(exports29)) { + return forEach4(exports29, (e10) => tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, e10, conditions, mode, isImports)); + } else if (typeof exports29 === "object" && exports29 !== null) { + for (const key of getOwnKeys(exports29)) { + if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) { + const subTarget = exports29[key]; + const result2 = tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode, isImports); + if (result2) { + return result2; + } + } + } + } + return void 0; + } + function tryGetModuleNameFromExports(options, host, targetFilePath, packageDirectory, packageName, exports29, conditions) { + if (typeof exports29 === "object" && exports29 !== null && !Array.isArray(exports29) && allKeysStartWithDot(exports29)) { + return forEach4(getOwnKeys(exports29), (k6) => { + const subPackageName = getNormalizedAbsolutePath( + combinePaths(packageName, k6), + /*currentDirectory*/ + void 0 + ); + const mode = endsWith2(k6, "/") ? 1 : k6.includes("*") ? 2 : 0; + return tryGetModuleNameFromExportsOrImports( + options, + host, + targetFilePath, + packageDirectory, + subPackageName, + exports29[k6], + conditions, + mode, + /*isImports*/ + false + ); + }); + } + return tryGetModuleNameFromExportsOrImports( + options, + host, + targetFilePath, + packageDirectory, + packageName, + exports29, + conditions, + 0, + /*isImports*/ + false + ); + } + function tryGetModuleNameFromPackageJsonImports(moduleFileName, sourceDirectory, options, host, importMode) { + var _a2, _b, _c; + if (!host.readFile || !getResolvePackageJsonImports(options)) { + return void 0; + } + const ancestorDirectoryWithPackageJson = getNearestAncestorDirectoryWithPackageJson(host, sourceDirectory); + if (!ancestorDirectoryWithPackageJson) { + return void 0; + } + const packageJsonPath = combinePaths(ancestorDirectoryWithPackageJson, "package.json"); + const cachedPackageJson = (_b = (_a2 = host.getPackageJsonInfoCache) == null ? void 0 : _a2.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath); + if (isMissingPackageJsonInfo(cachedPackageJson) || !host.fileExists(packageJsonPath)) { + return void 0; + } + const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath)); + const imports = packageJsonContent == null ? void 0 : packageJsonContent.imports; + if (!imports) { + return void 0; + } + const conditions = getConditions(options, importMode); + return (_c = forEach4(getOwnKeys(imports), (k6) => { + if (!startsWith2(k6, "#") || k6 === "#" || startsWith2(k6, "#/")) + return void 0; + const mode = endsWith2(k6, "/") ? 1 : k6.includes("*") ? 2 : 0; + return tryGetModuleNameFromExportsOrImports( + options, + host, + moduleFileName, + ancestorDirectoryWithPackageJson, + k6, + imports[k6], + conditions, + mode, + /*isImports*/ + true + ); + })) == null ? void 0 : _c.moduleFileToTry; + } + function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, allowedEndings, compilerOptions) { + const normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName); + if (normalizedTargetPaths === void 0) { + return void 0; + } + const normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName); + const relativePaths = flatMap2(normalizedSourcePaths, (sourcePath) => { + return map4(normalizedTargetPaths, (targetPath) => ensurePathIsNonModuleName(getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName))); + }); + const shortest = min2(relativePaths, compareNumberOfDirectorySeparators); + if (!shortest) { + return void 0; + } + return processEnding(shortest, allowedEndings, compilerOptions); + } + function tryGetModuleNameAsNodeModule({ path: path2, isRedirect }, { getCanonicalFileName, canonicalSourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) { + if (!host.fileExists || !host.readFile) { + return void 0; + } + const parts = getNodeModulePathParts(path2); + if (!parts) { + return void 0; + } + const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile); + const allowedEndings = preferences.getAllowedEndingsInPreferredOrder(); + let moduleSpecifier = path2; + let isPackageRootPath = false; + if (!packageNameOnly) { + let packageRootIndex = parts.packageRootIndex; + let moduleFileName; + while (true) { + const { moduleFileToTry, packageRootPath, blockedByExports, verbatimFromExports } = tryDirectoryWithPackageJson(packageRootIndex); + if (getEmitModuleResolutionKind(options) !== 1) { + if (blockedByExports) { + return void 0; + } + if (verbatimFromExports) { + return moduleFileToTry; + } + } + if (packageRootPath) { + moduleSpecifier = packageRootPath; + isPackageRootPath = true; + break; + } + if (!moduleFileName) + moduleFileName = moduleFileToTry; + packageRootIndex = path2.indexOf(directorySeparator, packageRootIndex + 1); + if (packageRootIndex === -1) { + moduleSpecifier = processEnding(moduleFileName, allowedEndings, options, host); + break; + } + } + } + if (isRedirect && !isPackageRootPath) { + return void 0; + } + const globalTypingsCacheLocation = host.getGlobalTypingsCacheLocation && host.getGlobalTypingsCacheLocation(); + const pathToTopLevelNodeModules = getCanonicalFileName(moduleSpecifier.substring(0, parts.topLevelNodeModulesIndex)); + if (!(startsWith2(canonicalSourceDirectory, pathToTopLevelNodeModules) || globalTypingsCacheLocation && startsWith2(getCanonicalFileName(globalTypingsCacheLocation), pathToTopLevelNodeModules))) { + return void 0; + } + const nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1); + const packageName = getPackageNameFromTypesPackageName(nodeModulesDirectoryName); + return getEmitModuleResolutionKind(options) === 1 && packageName === nodeModulesDirectoryName ? void 0 : packageName; + function tryDirectoryWithPackageJson(packageRootIndex) { + var _a2, _b; + const packageRootPath = path2.substring(0, packageRootIndex); + const packageJsonPath = combinePaths(packageRootPath, "package.json"); + let moduleFileToTry = path2; + let maybeBlockedByTypesVersions = false; + const cachedPackageJson = (_b = (_a2 = host.getPackageJsonInfoCache) == null ? void 0 : _a2.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath); + if (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) { + const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath)); + const importMode = overrideMode || importingSourceFile.impliedNodeFormat; + if (getResolvePackageJsonExports(options)) { + const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1); + const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2); + const conditions = getConditions(options, importMode); + const fromExports = (packageJsonContent == null ? void 0 : packageJsonContent.exports) ? tryGetModuleNameFromExports(options, host, path2, packageRootPath, packageName2, packageJsonContent.exports, conditions) : void 0; + if (fromExports) { + return { ...fromExports, verbatimFromExports: true }; + } + if (packageJsonContent == null ? void 0 : packageJsonContent.exports) { + return { moduleFileToTry: path2, blockedByExports: true }; + } + } + const versionPaths = (packageJsonContent == null ? void 0 : packageJsonContent.typesVersions) ? getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions) : void 0; + if (versionPaths) { + const subModuleName = path2.slice(packageRootPath.length + 1); + const fromPaths = tryGetModuleNameFromPaths( + subModuleName, + versionPaths.paths, + allowedEndings, + host, + options + ); + if (fromPaths === void 0) { + maybeBlockedByTypesVersions = true; + } else { + moduleFileToTry = combinePaths(packageRootPath, fromPaths); + } + } + const mainFileRelative = (packageJsonContent == null ? void 0 : packageJsonContent.typings) || (packageJsonContent == null ? void 0 : packageJsonContent.types) || (packageJsonContent == null ? void 0 : packageJsonContent.main) || "index.js"; + if (isString4(mainFileRelative) && !(maybeBlockedByTypesVersions && matchPatternOrExact(tryParsePatterns(versionPaths.paths), mainFileRelative))) { + const mainExportFile = toPath2(mainFileRelative, packageRootPath, getCanonicalFileName); + const canonicalModuleFileToTry = getCanonicalFileName(moduleFileToTry); + if (removeFileExtension(mainExportFile) === removeFileExtension(canonicalModuleFileToTry)) { + return { packageRootPath, moduleFileToTry }; + } else if ((packageJsonContent == null ? void 0 : packageJsonContent.type) !== "module" && !fileExtensionIsOneOf(canonicalModuleFileToTry, extensionsNotSupportingExtensionlessResolution) && startsWith2(canonicalModuleFileToTry, mainExportFile) && getDirectoryPath(canonicalModuleFileToTry) === removeTrailingDirectorySeparator(mainExportFile) && removeFileExtension(getBaseFileName(canonicalModuleFileToTry)) === "index") { + return { packageRootPath, moduleFileToTry }; + } + } + } else { + const fileName = getCanonicalFileName(moduleFileToTry.substring(parts.packageRootIndex + 1)); + if (fileName === "index.d.ts" || fileName === "index.js" || fileName === "index.ts" || fileName === "index.tsx") { + return { moduleFileToTry, packageRootPath }; + } + } + return { moduleFileToTry }; + } + } + function tryGetAnyFileFromPath(host, path2) { + if (!host.fileExists) + return; + const extensions6 = flatten2(getSupportedExtensions({ allowJs: true }, [{ extension: "node", isMixedContent: false }, { + extension: "json", + isMixedContent: false, + scriptKind: 6 + /* JSON */ + }])); + for (const e10 of extensions6) { + const fullPath = path2 + e10; + if (host.fileExists(fullPath)) { + return fullPath; + } + } + } + function getPathsRelativeToRootDirs(path2, rootDirs, getCanonicalFileName) { + return mapDefined(rootDirs, (rootDir) => { + const relativePath2 = getRelativePathIfInSameVolume(path2, rootDir, getCanonicalFileName); + return relativePath2 !== void 0 && isPathRelativeToParent(relativePath2) ? void 0 : relativePath2; + }); + } + function processEnding(fileName, allowedEndings, options, host) { + if (fileExtensionIsOneOf(fileName, [ + ".json", + ".mjs", + ".cjs" + /* Cjs */ + ])) { + return fileName; + } + const noExtension = removeFileExtension(fileName); + if (fileName === noExtension) { + return fileName; + } + const jsPriority = allowedEndings.indexOf( + 2 + /* JsExtension */ + ); + const tsPriority = allowedEndings.indexOf( + 3 + /* TsExtension */ + ); + if (fileExtensionIsOneOf(fileName, [ + ".mts", + ".cts" + /* Cts */ + ]) && tsPriority !== -1 && tsPriority < jsPriority) { + return fileName; + } else if (fileExtensionIsOneOf(fileName, [ + ".d.mts", + ".mts", + ".d.cts", + ".cts" + /* Cts */ + ])) { + return noExtension + getJSExtensionForFile(fileName, options); + } else if (!fileExtensionIsOneOf(fileName, [ + ".d.ts" + /* Dts */ + ]) && fileExtensionIsOneOf(fileName, [ + ".ts" + /* Ts */ + ]) && fileName.includes(".d.")) { + return tryGetRealFileNameForNonJsDeclarationFileName(fileName); + } + switch (allowedEndings[0]) { + case 0: + const withoutIndex = removeSuffix(noExtension, "/index"); + if (host && withoutIndex !== noExtension && tryGetAnyFileFromPath(host, withoutIndex)) { + return noExtension; + } + return withoutIndex; + case 1: + return noExtension; + case 2: + return noExtension + getJSExtensionForFile(fileName, options); + case 3: + if (isDeclarationFileName(fileName)) { + const extensionlessPriority = allowedEndings.findIndex( + (e10) => e10 === 0 || e10 === 1 + /* Index */ + ); + return extensionlessPriority !== -1 && extensionlessPriority < jsPriority ? noExtension : noExtension + getJSExtensionForFile(fileName, options); + } + return fileName; + default: + return Debug.assertNever(allowedEndings[0]); + } + } + function tryGetRealFileNameForNonJsDeclarationFileName(fileName) { + const baseName = getBaseFileName(fileName); + if (!endsWith2( + fileName, + ".ts" + /* Ts */ + ) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [ + ".d.ts" + /* Dts */ + ])) + return void 0; + const noExtension = removeExtension( + fileName, + ".ts" + /* Ts */ + ); + const ext = noExtension.substring(noExtension.lastIndexOf(".")); + return noExtension.substring(0, noExtension.indexOf(".d.")) + ext; + } + function getJSExtensionForFile(fileName, options) { + return tryGetJSExtensionForFile(fileName, options) ?? Debug.fail(`Extension ${extensionFromPath(fileName)} is unsupported:: FileName:: ${fileName}`); + } + function tryGetJSExtensionForFile(fileName, options) { + const ext = tryGetExtensionFromPath2(fileName); + switch (ext) { + case ".ts": + case ".d.ts": + return ".js"; + case ".tsx": + return options.jsx === 1 ? ".jsx" : ".js"; + case ".js": + case ".jsx": + case ".json": + return ext; + case ".d.mts": + case ".mts": + case ".mjs": + return ".mjs"; + case ".d.cts": + case ".cts": + case ".cjs": + return ".cjs"; + default: + return void 0; + } + } + function getRelativePathIfInSameVolume(path2, directoryPath, getCanonicalFileName) { + const relativePath2 = getRelativePathToDirectoryOrUrl( + directoryPath, + path2, + directoryPath, + getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + return isRootedDiskPath(relativePath2) ? void 0 : relativePath2; + } + function isPathRelativeToParent(path2) { + return startsWith2(path2, ".."); + } + var RelativePreference; + var init_moduleSpecifiers = __esm2({ + "src/compiler/moduleSpecifiers.ts"() { + "use strict"; + init_ts2(); + RelativePreference = /* @__PURE__ */ ((RelativePreference2) => { + RelativePreference2[RelativePreference2["Relative"] = 0] = "Relative"; + RelativePreference2[RelativePreference2["NonRelative"] = 1] = "NonRelative"; + RelativePreference2[RelativePreference2["Shortest"] = 2] = "Shortest"; + RelativePreference2[RelativePreference2["ExternalNonRelative"] = 3] = "ExternalNonRelative"; + return RelativePreference2; + })(RelativePreference || {}); + } + }); + var ts_moduleSpecifiers_exports = {}; + __export2(ts_moduleSpecifiers_exports, { + RelativePreference: () => RelativePreference, + countPathComponents: () => countPathComponents, + forEachFileNameOfModule: () => forEachFileNameOfModule, + getModuleSpecifier: () => getModuleSpecifier, + getModuleSpecifierPreferences: () => getModuleSpecifierPreferences, + getModuleSpecifiers: () => getModuleSpecifiers, + getModuleSpecifiersWithCacheInfo: () => getModuleSpecifiersWithCacheInfo, + getNodeModulesPackageName: () => getNodeModulesPackageName, + tryGetJSExtensionForFile: () => tryGetJSExtensionForFile, + tryGetModuleSpecifiersFromCache: () => tryGetModuleSpecifiersFromCache, + tryGetRealFileNameForNonJsDeclarationFileName: () => tryGetRealFileNameForNonJsDeclarationFileName, + updateModuleSpecifier: () => updateModuleSpecifier + }); + var init_ts_moduleSpecifiers = __esm2({ + "src/compiler/_namespaces/ts.moduleSpecifiers.ts"() { + "use strict"; + init_moduleSpecifiers(); + } + }); + function NodeLinks() { + this.flags = 0; + } + function getNodeId(node) { + if (!node.id) { + node.id = nextNodeId; + nextNodeId++; + } + return node.id; + } + function getSymbolId(symbol) { + if (!symbol.id) { + symbol.id = nextSymbolId; + nextSymbolId++; + } + return symbol.id; + } + function isInstantiatedModule(node, preserveConstEnums) { + const moduleState = getModuleInstanceState(node); + return moduleState === 1 || preserveConstEnums && moduleState === 2; + } + function createTypeChecker(host) { + var deferredDiagnosticsCallbacks = []; + var addLazyDiagnostic = (arg) => { + deferredDiagnosticsCallbacks.push(arg); + }; + var cancellationToken; + var requestedExternalEmitHelperNames = /* @__PURE__ */ new Set(); + var requestedExternalEmitHelpers; + var externalHelpersModule; + var Symbol47 = objectAllocator.getSymbolConstructor(); + var Type28 = objectAllocator.getTypeConstructor(); + var Signature14 = objectAllocator.getSignatureConstructor(); + var typeCount = 0; + var symbolCount = 0; + var totalInstantiationCount = 0; + var instantiationCount = 0; + var instantiationDepth = 0; + var inlineLevel = 0; + var currentNode; + var varianceTypeParameter; + var isInferencePartiallyBlocked = false; + var emptySymbols = createSymbolTable(); + var arrayVariances = [ + 1 + /* Covariant */ + ]; + var compilerOptions = host.getCompilerOptions(); + var languageVersion = getEmitScriptTarget(compilerOptions); + var moduleKind = getEmitModuleKind(compilerOptions); + var legacyDecorators = !!compilerOptions.experimentalDecorators; + var useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + var emitStandardClassFields = getEmitStandardClassFields(compilerOptions); + var allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); + var strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + var strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + var strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); + var strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); + var noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); + var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); + var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables"); + var keyofStringsOnly = !!compilerOptions.keyofStringsOnly; + var defaultIndexFlags = keyofStringsOnly ? 1 : 0; + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192; + var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes; + var checkBinaryExpression = createCheckBinaryExpression(); + var emitResolver = createResolver4(); + var nodeBuilder = createNodeBuilder(); + var globals3 = createSymbolTable(); + var undefinedSymbol = createSymbol(4, "undefined"); + undefinedSymbol.declarations = []; + var globalThisSymbol = createSymbol( + 1536, + "globalThis", + 8 + /* Readonly */ + ); + globalThisSymbol.exports = globals3; + globalThisSymbol.declarations = []; + globals3.set(globalThisSymbol.escapedName, globalThisSymbol); + var argumentsSymbol = createSymbol(4, "arguments"); + var requireSymbol = createSymbol(4, "require"); + var isolatedModulesLikeFlagName = compilerOptions.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"; + var canCollectSymbolAliasAccessabilityData = !compilerOptions.verbatimModuleSyntax || !!compilerOptions.importsNotUsedAsValues; + var apparentArgumentCount; + var lastGetCombinedNodeFlagsNode; + var lastGetCombinedNodeFlagsResult = 0; + var lastGetCombinedModifierFlagsNode; + var lastGetCombinedModifierFlagsResult = 0; + const checker = { + getNodeCount: () => reduceLeft(host.getSourceFiles(), (n7, s7) => n7 + s7.nodeCount, 0), + getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n7, s7) => n7 + s7.identifierCount, 0), + getSymbolCount: () => reduceLeft(host.getSourceFiles(), (n7, s7) => n7 + s7.symbolCount, symbolCount), + getTypeCount: () => typeCount, + getInstantiationCount: () => totalInstantiationCount, + getRelationCacheSizes: () => ({ + assignable: assignableRelation.size, + identity: identityRelation.size, + subtype: subtypeRelation.size, + strictSubtype: strictSubtypeRelation.size + }), + isUndefinedSymbol: (symbol) => symbol === undefinedSymbol, + isArgumentsSymbol: (symbol) => symbol === argumentsSymbol, + isUnknownSymbol: (symbol) => symbol === unknownSymbol, + getMergedSymbol, + getDiagnostics: getDiagnostics2, + getGlobalDiagnostics, + getRecursionIdentity, + getUnmatchedProperties, + getTypeOfSymbolAtLocation: (symbol, locationIn) => { + const location2 = getParseTreeNode(locationIn); + return location2 ? getTypeOfSymbolAtLocation(symbol, location2) : errorType; + }, + getTypeOfSymbol, + getSymbolsOfParameterPropertyDeclaration: (parameterIn, parameterName) => { + const parameter = getParseTreeNode(parameterIn, isParameter); + if (parameter === void 0) + return Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."); + Debug.assert(isParameterPropertyDeclaration(parameter, parameter.parent)); + return getSymbolsOfParameterPropertyDeclaration(parameter, escapeLeadingUnderscores(parameterName)); + }, + getDeclaredTypeOfSymbol, + getPropertiesOfType, + getPropertyOfType: (type3, name2) => getPropertyOfType(type3, escapeLeadingUnderscores(name2)), + getPrivateIdentifierPropertyOfType: (leftType, name2, location2) => { + const node = getParseTreeNode(location2); + if (!node) { + return void 0; + } + const propName2 = escapeLeadingUnderscores(name2); + const lexicallyScopedIdentifier = lookupSymbolForPrivateIdentifierDeclaration(propName2, node); + return lexicallyScopedIdentifier ? getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) : void 0; + }, + getTypeOfPropertyOfType: (type3, name2) => getTypeOfPropertyOfType(type3, escapeLeadingUnderscores(name2)), + getIndexInfoOfType: (type3, kind) => getIndexInfoOfType(type3, kind === 0 ? stringType2 : numberType2), + getIndexInfosOfType, + getIndexInfosOfIndexSymbol, + getSignaturesOfType, + getIndexTypeOfType: (type3, kind) => getIndexTypeOfType(type3, kind === 0 ? stringType2 : numberType2), + getIndexType: (type3) => getIndexType(type3), + getBaseTypes, + getBaseTypeOfLiteralType, + getWidenedType, + getTypeFromTypeNode: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isTypeNode); + return node ? getTypeFromTypeNode(node) : errorType; + }, + getParameterType: getTypeAtPosition, + getParameterIdentifierInfoAtPosition, + getPromisedTypeOfPromise, + getAwaitedType: (type3) => getAwaitedType(type3), + getReturnTypeOfSignature, + isNullableType, + getNullableType, + getNonNullableType, + getNonOptionalType: removeOptionalTypeMarker, + getTypeArguments, + typeToTypeNode: nodeBuilder.typeToTypeNode, + indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, + signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToNode: nodeBuilder.symbolToNode, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, + getSymbolsInScope: (locationIn, meaning) => { + const location2 = getParseTreeNode(locationIn); + return location2 ? getSymbolsInScope(location2, meaning) : []; + }, + getSymbolAtLocation: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node ? getSymbolAtLocation( + node, + /*ignoreErrors*/ + true + ) : void 0; + }, + getIndexInfosAtLocation: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node ? getIndexInfosAtLocation(node) : void 0; + }, + getShorthandAssignmentValueSymbol: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node ? getShorthandAssignmentValueSymbol(node) : void 0; + }, + getExportSpecifierLocalTargetSymbol: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isExportSpecifier); + return node ? getExportSpecifierLocalTargetSymbol(node) : void 0; + }, + getExportSymbolOfSymbol(symbol) { + return getMergedSymbol(symbol.exportSymbol || symbol); + }, + getTypeAtLocation: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node ? getTypeOfNode(node) : errorType; + }, + getTypeOfAssignmentPattern: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isAssignmentPattern); + return node && getTypeOfAssignmentPattern(node) || errorType; + }, + getPropertySymbolOfDestructuringAssignment: (locationIn) => { + const location2 = getParseTreeNode(locationIn, isIdentifier); + return location2 ? getPropertySymbolOfDestructuringAssignment(location2) : void 0; + }, + signatureToString: (signature, enclosingDeclaration, flags, kind) => { + return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind); + }, + typeToString: (type3, enclosingDeclaration, flags) => { + return typeToString(type3, getParseTreeNode(enclosingDeclaration), flags); + }, + symbolToString: (symbol, enclosingDeclaration, meaning, flags) => { + return symbolToString2(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags); + }, + typePredicateToString: (predicate, enclosingDeclaration, flags) => { + return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: (signature, enclosingDeclaration, flags, kind, writer) => { + return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: (type3, enclosingDeclaration, flags, writer) => { + return typeToString(type3, getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => { + return symbolToString2(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: (predicate, enclosingDeclaration, flags, writer) => { + return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getAugmentedPropertiesOfType, + getRootSymbols, + getSymbolOfExpando, + getContextualType: (nodeIn, contextFlags) => { + const node = getParseTreeNode(nodeIn, isExpression); + if (!node) { + return void 0; + } + if (contextFlags & 4) { + return runWithInferenceBlockedFromSourceNode(node, () => getContextualType2(node, contextFlags)); + } + return getContextualType2(node, contextFlags); + }, + getContextualTypeForObjectLiteralElement: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isObjectLiteralElementLike); + return node ? getContextualTypeForObjectLiteralElement( + node, + /*contextFlags*/ + void 0 + ) : void 0; + }, + getContextualTypeForArgumentAtIndex: (nodeIn, argIndex) => { + const node = getParseTreeNode(nodeIn, isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute( + node, + /*contextFlags*/ + void 0 + ); + }, + isContextSensitive, + getTypeOfPropertyOfContextualType, + getFullyQualifiedName: getFullyQualifiedName2, + getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker( + node, + candidatesOutArray, + argumentCount, + 0 + /* Normal */ + ), + getCandidateSignaturesForStringLiteralCompletions, + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker( + node, + candidatesOutArray, + argumentCount, + 16 + /* IsForSignatureHelp */ + )), + getExpandedParameters, + hasEffectiveRestParameter, + containsArgumentsReference, + getConstantValue: (nodeIn) => { + const node = getParseTreeNode(nodeIn, canHaveConstantValue); + return node ? getConstantValue2(node) : void 0; + }, + isValidPropertyAccess: (nodeIn, propertyName) => { + const node = getParseTreeNode(nodeIn, isPropertyAccessOrQualifiedNameOrImportTypeNode); + return !!node && isValidPropertyAccess(node, escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: (nodeIn, type3, property2) => { + const node = getParseTreeNode(nodeIn, isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type3, property2); + }, + getSignatureFromDeclaration: (declarationIn) => { + const declaration = getParseTreeNode(declarationIn, isFunctionLike); + return declaration ? getSignatureFromDeclaration(declaration) : void 0; + }, + isImplementationOfOverload: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isFunctionLike); + return node ? isImplementationOfOverload(node) : void 0; + }, + getImmediateAliasedSymbol, + getAliasedSymbol: resolveAlias, + getEmitResolver, + getExportsOfModule: getExportsOfModuleAsArray, + getExportsAndPropertiesOfModule, + forEachExportAndPropertyOfModule, + getSymbolWalker: createGetSymbolWalker( + getRestTypeOfSignature, + getTypePredicateOfSignature, + getReturnTypeOfSignature, + getBaseTypes, + resolveStructuredTypeMembers, + getTypeOfSymbol, + getResolvedSymbol, + getConstraintOfTypeParameter, + getFirstIdentifier, + getTypeArguments + ), + getAmbientModules, + getJsxIntrinsicTagNamesAt, + isOptionalParameter: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isParameter); + return node ? isOptionalParameter(node) : false; + }, + tryGetMemberInModuleExports: (name2, symbol) => tryGetMemberInModuleExports(escapeLeadingUnderscores(name2), symbol), + tryGetMemberInModuleExportsAndProperties: (name2, symbol) => tryGetMemberInModuleExportsAndProperties(escapeLeadingUnderscores(name2), symbol), + tryFindAmbientModule: (moduleName3) => tryFindAmbientModule( + moduleName3, + /*withAugmentations*/ + true + ), + tryFindAmbientModuleWithoutAugmentations: (moduleName3) => { + return tryFindAmbientModule( + moduleName3, + /*withAugmentations*/ + false + ); + }, + getApparentType, + getUnionType, + isTypeAssignableTo, + createAnonymousType, + createSignature, + createSymbol, + createIndexInfo, + getAnyType: () => anyType2, + getStringType: () => stringType2, + getStringLiteralType, + getNumberType: () => numberType2, + getNumberLiteralType, + getBigIntType: () => bigintType, + createPromiseType, + createArrayType, + getElementTypeOfArrayType, + getBooleanType: () => booleanType2, + getFalseType: (fresh) => fresh ? falseType : regularFalseType, + getTrueType: (fresh) => fresh ? trueType : regularTrueType, + getVoidType: () => voidType2, + getUndefinedType: () => undefinedType2, + getNullType: () => nullType2, + getESSymbolType: () => esSymbolType, + getNeverType: () => neverType2, + getOptionalType: () => optionalType2, + getPromiseType: () => getGlobalPromiseType( + /*reportErrors*/ + false + ), + getPromiseLikeType: () => getGlobalPromiseLikeType( + /*reportErrors*/ + false + ), + getAsyncIterableType: () => { + const type3 = getGlobalAsyncIterableType( + /*reportErrors*/ + false + ); + if (type3 === emptyGenericType) + return void 0; + return type3; + }, + isSymbolAccessible, + isArrayType, + isTupleType, + isArrayLikeType, + isEmptyAnonymousObjectType, + isTypeInvalidDueToUnionDiscriminant, + getExactOptionalProperties, + getAllPossiblePropertiesOfTypes, + getSuggestedSymbolForNonexistentProperty, + getSuggestionForNonexistentProperty, + getSuggestedSymbolForNonexistentJSXAttribute, + getSuggestedSymbolForNonexistentSymbol: (location2, name2, meaning) => getSuggestedSymbolForNonexistentSymbol(location2, escapeLeadingUnderscores(name2), meaning), + getSuggestionForNonexistentSymbol: (location2, name2, meaning) => getSuggestionForNonexistentSymbol(location2, escapeLeadingUnderscores(name2), meaning), + getSuggestedSymbolForNonexistentModule, + getSuggestionForNonexistentExport, + getSuggestedSymbolForNonexistentClassMember, + getBaseConstraintOfType, + getDefaultFromTypeParameter: (type3) => type3 && type3.flags & 262144 ? getDefaultFromTypeParameter(type3) : void 0, + resolveName(name2, location2, meaning, excludeGlobals) { + return resolveName( + location2, + escapeLeadingUnderscores(name2), + meaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false, + excludeGlobals + ); + }, + getJsxNamespace: (n7) => unescapeLeadingUnderscores(getJsxNamespace(n7)), + getJsxFragmentFactory: (n7) => { + const jsxFragmentFactory = getJsxFragmentFactoryEntity(n7); + return jsxFragmentFactory && unescapeLeadingUnderscores(getFirstIdentifier(jsxFragmentFactory).escapedText); + }, + getAccessibleSymbolChain, + getTypePredicateOfSignature, + resolveExternalModuleName: (moduleSpecifierIn) => { + const moduleSpecifier = getParseTreeNode(moduleSpecifierIn, isExpression); + return moduleSpecifier && resolveExternalModuleName( + moduleSpecifier, + moduleSpecifier, + /*ignoreErrors*/ + true + ); + }, + resolveExternalModuleSymbol, + tryGetThisTypeAt: (nodeIn, includeGlobalThis, container) => { + const node = getParseTreeNode(nodeIn); + return node && tryGetThisTypeAt(node, includeGlobalThis, container); + }, + getTypeArgumentConstraint: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isTypeNode); + return node && getTypeArgumentConstraint(node); + }, + getSuggestionDiagnostics: (fileIn, ct) => { + const file = getParseTreeNode(fileIn, isSourceFile) || Debug.fail("Could not determine parsed source file."); + if (skipTypeChecking(file, compilerOptions, host)) { + return emptyArray; + } + let diagnostics2; + try { + cancellationToken = ct; + checkSourceFileWithEagerDiagnostics(file); + Debug.assert(!!(getNodeLinks(file).flags & 1)); + diagnostics2 = addRange(diagnostics2, suggestionDiagnostics.getDiagnostics(file.fileName)); + checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(file), (containingNode, kind, diag2) => { + if (!containsParseError(containingNode) && !unusedIsError(kind, !!(containingNode.flags & 33554432))) { + (diagnostics2 || (diagnostics2 = [])).push({ + ...diag2, + category: 2 + /* Suggestion */ + }); + } + }); + return diagnostics2 || emptyArray; + } finally { + cancellationToken = void 0; + } + }, + runWithCancellationToken: (token, callback) => { + try { + cancellationToken = token; + return callback(checker); + } finally { + cancellationToken = void 0; + } + }, + getLocalTypeParametersOfClassOrInterfaceOrTypeAlias, + isDeclarationVisible, + isPropertyAccessible, + getTypeOnlyAliasDeclaration, + getMemberOverrideModifierStatus, + isTypeParameterPossiblyReferenced, + typeHasCallOrConstructSignatures + }; + function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) { + const candidatesSet = /* @__PURE__ */ new Set(); + const candidates = []; + runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker( + call, + candidates, + /*argumentCount*/ + void 0, + 0 + /* Normal */ + )); + for (const candidate of candidates) { + candidatesSet.add(candidate); + } + candidates.length = 0; + runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker( + call, + candidates, + /*argumentCount*/ + void 0, + 0 + /* Normal */ + )); + for (const candidate of candidates) { + candidatesSet.add(candidate); + } + return arrayFrom(candidatesSet); + } + function runWithoutResolvedSignatureCaching(node, fn) { + node = findAncestor(node, isCallLikeOrFunctionLikeExpression); + if (node) { + const cachedResolvedSignatures = []; + const cachedTypes2 = []; + while (node) { + const nodeLinks2 = getNodeLinks(node); + cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]); + nodeLinks2.resolvedSignature = void 0; + if (isFunctionExpressionOrArrowFunction(node)) { + const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node)); + const type3 = symbolLinks2.type; + cachedTypes2.push([symbolLinks2, type3]); + symbolLinks2.type = void 0; + } + node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression); + } + const result2 = fn(); + for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) { + nodeLinks2.resolvedSignature = resolvedSignature; + } + for (const [symbolLinks2, type3] of cachedTypes2) { + symbolLinks2.type = type3; + } + return result2; + } + return fn(); + } + function runWithInferenceBlockedFromSourceNode(node, fn) { + const containingCall = findAncestor(node, isCallLikeExpression); + if (containingCall) { + let toMarkSkip = node; + do { + getNodeLinks(toMarkSkip).skipDirectInference = true; + toMarkSkip = toMarkSkip.parent; + } while (toMarkSkip && toMarkSkip !== containingCall); + } + isInferencePartiallyBlocked = true; + const result2 = runWithoutResolvedSignatureCaching(node, fn); + isInferencePartiallyBlocked = false; + if (containingCall) { + let toMarkSkip = node; + do { + getNodeLinks(toMarkSkip).skipDirectInference = void 0; + toMarkSkip = toMarkSkip.parent; + } while (toMarkSkip && toMarkSkip !== containingCall); + } + return result2; + } + function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) { + const node = getParseTreeNode(nodeIn, isCallLikeExpression); + apparentArgumentCount = argumentCount; + const res = !node ? void 0 : getResolvedSignature(node, candidatesOutArray, checkMode); + apparentArgumentCount = void 0; + return res; + } + var tupleTypes = /* @__PURE__ */ new Map(); + var unionTypes = /* @__PURE__ */ new Map(); + var unionOfUnionTypes = /* @__PURE__ */ new Map(); + var intersectionTypes = /* @__PURE__ */ new Map(); + var stringLiteralTypes = /* @__PURE__ */ new Map(); + var numberLiteralTypes = /* @__PURE__ */ new Map(); + var bigIntLiteralTypes = /* @__PURE__ */ new Map(); + var enumLiteralTypes = /* @__PURE__ */ new Map(); + var indexedAccessTypes = /* @__PURE__ */ new Map(); + var templateLiteralTypes = /* @__PURE__ */ new Map(); + var stringMappingTypes = /* @__PURE__ */ new Map(); + var substitutionTypes = /* @__PURE__ */ new Map(); + var subtypeReductionCache = /* @__PURE__ */ new Map(); + var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map(); + var cachedTypes = /* @__PURE__ */ new Map(); + var evolvingArrayTypes = []; + var undefinedProperties = /* @__PURE__ */ new Map(); + var markerTypes = /* @__PURE__ */ new Set(); + var unknownSymbol = createSymbol(4, "unknown"); + var resolvingSymbol = createSymbol( + 0, + "__resolving__" + /* Resolving */ + ); + var unresolvedSymbols = /* @__PURE__ */ new Map(); + var errorTypes = /* @__PURE__ */ new Map(); + var seenIntrinsicNames = /* @__PURE__ */ new Set(); + var anyType2 = createIntrinsicType(1, "any"); + var autoType = createIntrinsicType(1, "any", 262144, "auto"); + var wildcardType = createIntrinsicType( + 1, + "any", + /*objectFlags*/ + void 0, + "wildcard" + ); + var blockedStringType = createIntrinsicType( + 1, + "any", + /*objectFlags*/ + void 0, + "blocked string" + ); + var errorType = createIntrinsicType(1, "error"); + var unresolvedType = createIntrinsicType(1, "unresolved"); + var nonInferrableAnyType = createIntrinsicType(1, "any", 65536, "non-inferrable"); + var intrinsicMarkerType = createIntrinsicType(1, "intrinsic"); + var unknownType2 = createIntrinsicType(2, "unknown"); + var nonNullUnknownType = createIntrinsicType( + 2, + "unknown", + /*objectFlags*/ + void 0, + "non-null" + ); + var undefinedType2 = createIntrinsicType(32768, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType2 : createIntrinsicType(32768, "undefined", 65536, "widening"); + var missingType = createIntrinsicType( + 32768, + "undefined", + /*objectFlags*/ + void 0, + "missing" + ); + var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType2; + var optionalType2 = createIntrinsicType( + 32768, + "undefined", + /*objectFlags*/ + void 0, + "optional" + ); + var nullType2 = createIntrinsicType(65536, "null"); + var nullWideningType = strictNullChecks ? nullType2 : createIntrinsicType(65536, "null", 65536, "widening"); + var stringType2 = createIntrinsicType(4, "string"); + var numberType2 = createIntrinsicType(8, "number"); + var bigintType = createIntrinsicType(64, "bigint"); + var falseType = createIntrinsicType( + 512, + "false", + /*objectFlags*/ + void 0, + "fresh" + ); + var regularFalseType = createIntrinsicType(512, "false"); + var trueType = createIntrinsicType( + 512, + "true", + /*objectFlags*/ + void 0, + "fresh" + ); + var regularTrueType = createIntrinsicType(512, "true"); + trueType.regularType = regularTrueType; + trueType.freshType = trueType; + regularTrueType.regularType = regularTrueType; + regularTrueType.freshType = trueType; + falseType.regularType = regularFalseType; + falseType.freshType = falseType; + regularFalseType.regularType = regularFalseType; + regularFalseType.freshType = falseType; + var booleanType2 = getUnionType([regularFalseType, regularTrueType]); + var esSymbolType = createIntrinsicType(4096, "symbol"); + var voidType2 = createIntrinsicType(16384, "void"); + var neverType2 = createIntrinsicType(131072, "never"); + var silentNeverType = createIntrinsicType(131072, "never", 262144, "silent"); + var implicitNeverType = createIntrinsicType( + 131072, + "never", + /*objectFlags*/ + void 0, + "implicit" + ); + var unreachableNeverType = createIntrinsicType( + 131072, + "never", + /*objectFlags*/ + void 0, + "unreachable" + ); + var nonPrimitiveType = createIntrinsicType(67108864, "object"); + var stringOrNumberType = getUnionType([stringType2, numberType2]); + var stringNumberSymbolType = getUnionType([stringType2, numberType2, esSymbolType]); + var keyofConstraintType = keyofStringsOnly ? stringType2 : stringNumberSymbolType; + var numberOrBigIntType = getUnionType([numberType2, bigintType]); + var templateConstraintType = getUnionType([stringType2, numberType2, booleanType2, bigintType, nullType2, undefinedType2]); + var numericStringType = getTemplateLiteralType(["", ""], [numberType2]); + var restrictiveMapper = makeFunctionTypeMapper((t8) => t8.flags & 262144 ? getRestrictiveTypeParameter(t8) : t8, () => "(restrictive mapper)"); + var permissiveMapper = makeFunctionTypeMapper((t8) => t8.flags & 262144 ? wildcardType : t8, () => "(permissive mapper)"); + var uniqueLiteralType = createIntrinsicType( + 131072, + "never", + /*objectFlags*/ + void 0, + "unique literal" + ); + var uniqueLiteralMapper = makeFunctionTypeMapper((t8) => t8.flags & 262144 ? uniqueLiteralType : t8, () => "(unique literal mapper)"); + var outofbandVarianceMarkerHandler; + var reportUnreliableMapper = makeFunctionTypeMapper((t8) => { + if (outofbandVarianceMarkerHandler && (t8 === markerSuperType || t8 === markerSubType || t8 === markerOtherType)) { + outofbandVarianceMarkerHandler( + /*onlyUnreliable*/ + true + ); + } + return t8; + }, () => "(unmeasurable reporter)"); + var reportUnmeasurableMapper = makeFunctionTypeMapper((t8) => { + if (outofbandVarianceMarkerHandler && (t8 === markerSuperType || t8 === markerSubType || t8 === markerOtherType)) { + outofbandVarianceMarkerHandler( + /*onlyUnreliable*/ + false + ); + } + return t8; + }, () => "(unreliable reporter)"); + var emptyObjectType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + var emptyJsxObjectType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + emptyJsxObjectType.objectFlags |= 2048; + var emptyTypeLiteralSymbol = createSymbol( + 2048, + "__type" + /* Type */ + ); + emptyTypeLiteralSymbol.members = createSymbolTable(); + var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray); + var unknownEmptyObjectType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + var unknownUnionType = strictNullChecks ? getUnionType([undefinedType2, nullType2, unknownEmptyObjectType]) : unknownType2; + var emptyGenericType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + emptyGenericType.instantiations = /* @__PURE__ */ new Map(); + var anyFunctionType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + anyFunctionType.objectFlags |= 262144; + var noConstraintType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + var circularConstraintType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + var resolvingDefaultType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + var markerSuperType = createTypeParameter(); + var markerSubType = createTypeParameter(); + markerSubType.constraint = markerSuperType; + var markerOtherType = createTypeParameter(); + var markerSuperTypeForCheck = createTypeParameter(); + var markerSubTypeForCheck = createTypeParameter(); + markerSubTypeForCheck.constraint = markerSuperTypeForCheck; + var noTypePredicate = createTypePredicate(1, "<>", 0, anyType2); + var anySignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + anyType2, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* None */ + ); + var unknownSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + errorType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* None */ + ); + var resolvingSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + anyType2, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* None */ + ); + var silentNeverSignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + silentNeverType, + /*resolvedTypePredicate*/ + void 0, + 0, + 0 + /* None */ + ); + var enumNumberIndexInfo = createIndexInfo( + numberType2, + stringType2, + /*isReadonly*/ + true + ); + var iterationTypesCache = /* @__PURE__ */ new Map(); + var noIterationTypes = { + get yieldType() { + return Debug.fail("Not supported"); + }, + get returnType() { + return Debug.fail("Not supported"); + }, + get nextType() { + return Debug.fail("Not supported"); + } + }; + var anyIterationTypes = createIterationTypes(anyType2, anyType2, anyType2); + var anyIterationTypesExceptNext = createIterationTypes(anyType2, anyType2, unknownType2); + var defaultIterationTypes = createIterationTypes(neverType2, anyType2, undefinedType2); + var asyncIterationTypesResolver = { + iterableCacheKey: "iterationTypesOfAsyncIterable", + iteratorCacheKey: "iterationTypesOfAsyncIterator", + iteratorSymbolName: "asyncIterator", + getGlobalIteratorType: getGlobalAsyncIteratorType, + getGlobalIterableType: getGlobalAsyncIterableType, + getGlobalIterableIteratorType: getGlobalAsyncIterableIteratorType, + getGlobalGeneratorType: getGlobalAsyncGeneratorType, + resolveIterationType: (type3, errorNode) => getAwaitedType(type3, errorNode, Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member), + mustHaveANextMethodDiagnostic: Diagnostics.An_async_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method, + mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property + }; + var syncIterationTypesResolver = { + iterableCacheKey: "iterationTypesOfIterable", + iteratorCacheKey: "iterationTypesOfIterator", + iteratorSymbolName: "iterator", + getGlobalIteratorType, + getGlobalIterableType, + getGlobalIterableIteratorType, + getGlobalGeneratorType, + resolveIterationType: (type3, _errorNode) => type3, + mustHaveANextMethodDiagnostic: Diagnostics.An_iterator_must_have_a_next_method, + mustBeAMethodDiagnostic: Diagnostics.The_0_property_of_an_iterator_must_be_a_method, + mustHaveAValueDiagnostic: Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property + }; + var amalgamatedDuplicates; + var reverseMappedCache = /* @__PURE__ */ new Map(); + var homomorphicMappedTypeInferenceStack = []; + var ambientModulesCache; + var patternAmbientModules; + var patternAmbientModuleAugmentations; + var globalObjectType; + var globalFunctionType; + var globalCallableFunctionType; + var globalNewableFunctionType; + var globalArrayType; + var globalReadonlyArrayType; + var globalStringType; + var globalNumberType; + var globalBooleanType; + var globalRegExpType; + var globalThisType; + var anyArrayType; + var autoArrayType; + var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; + var deferredGlobalESSymbolConstructorSymbol; + var deferredGlobalESSymbolConstructorTypeSymbol; + var deferredGlobalESSymbolType; + var deferredGlobalTypedPropertyDescriptorType; + var deferredGlobalPromiseType; + var deferredGlobalPromiseLikeType; + var deferredGlobalPromiseConstructorSymbol; + var deferredGlobalPromiseConstructorLikeType; + var deferredGlobalIterableType; + var deferredGlobalIteratorType; + var deferredGlobalIterableIteratorType; + var deferredGlobalGeneratorType; + var deferredGlobalIteratorYieldResultType; + var deferredGlobalIteratorReturnResultType; + var deferredGlobalAsyncIterableType; + var deferredGlobalAsyncIteratorType; + var deferredGlobalAsyncIterableIteratorType; + var deferredGlobalAsyncGeneratorType; + var deferredGlobalTemplateStringsArrayType; + var deferredGlobalImportMetaType; + var deferredGlobalImportMetaExpressionType; + var deferredGlobalImportCallOptionsType; + var deferredGlobalImportAttributesType; + var deferredGlobalDisposableType; + var deferredGlobalAsyncDisposableType; + var deferredGlobalExtractSymbol; + var deferredGlobalOmitSymbol; + var deferredGlobalAwaitedSymbol; + var deferredGlobalBigIntType; + var deferredGlobalNaNSymbol; + var deferredGlobalRecordSymbol; + var deferredGlobalClassDecoratorContextType; + var deferredGlobalClassMethodDecoratorContextType; + var deferredGlobalClassGetterDecoratorContextType; + var deferredGlobalClassSetterDecoratorContextType; + var deferredGlobalClassAccessorDecoratorContextType; + var deferredGlobalClassAccessorDecoratorTargetType; + var deferredGlobalClassAccessorDecoratorResultType; + var deferredGlobalClassFieldDecoratorContextType; + var allPotentiallyUnusedIdentifiers = /* @__PURE__ */ new Map(); + var flowLoopStart = 0; + var flowLoopCount = 0; + var sharedFlowCount = 0; + var flowAnalysisDisabled = false; + var flowInvocationCount = 0; + var lastFlowNode; + var lastFlowNodeReachable; + var flowTypeCache; + var contextualTypeNodes = []; + var contextualTypes = []; + var contextualIsCache = []; + var contextualTypeCount = 0; + var inferenceContextNodes = []; + var inferenceContexts = []; + var inferenceContextCount = 0; + var emptyStringType = getStringLiteralType(""); + var zeroType = getNumberLiteralType(0); + var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" }); + var resolutionTargets = []; + var resolutionResults = []; + var resolutionPropertyNames = []; + var resolutionStart = 0; + var inVarianceComputation = false; + var suggestionCount = 0; + var maximumSuggestionCount = 10; + var mergedSymbols = []; + var symbolLinks = []; + var nodeLinks = []; + var flowLoopCaches = []; + var flowLoopNodes = []; + var flowLoopKeys = []; + var flowLoopTypes = []; + var sharedFlowNodes = []; + var sharedFlowTypes = []; + var flowNodeReachable = []; + var flowNodePostSuper = []; + var potentialThisCollisions = []; + var potentialNewTargetCollisions = []; + var potentialWeakMapSetCollisions = []; + var potentialReflectCollisions = []; + var potentialUnusedRenamedBindingElementsInTypes = []; + var awaitedTypeStack = []; + var diagnostics = createDiagnosticCollection(); + var suggestionDiagnostics = createDiagnosticCollection(); + var typeofType = createTypeofType(); + var _jsxNamespace; + var _jsxFactoryEntity; + var subtypeRelation = /* @__PURE__ */ new Map(); + var strictSubtypeRelation = /* @__PURE__ */ new Map(); + var assignableRelation = /* @__PURE__ */ new Map(); + var comparableRelation = /* @__PURE__ */ new Map(); + var identityRelation = /* @__PURE__ */ new Map(); + var enumRelation = /* @__PURE__ */ new Map(); + var builtinGlobals = createSymbolTable(); + builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); + var suggestedExtensions = [ + [".mts", ".mjs"], + [".ts", ".js"], + [".cts", ".cjs"], + [".mjs", ".mjs"], + [".js", ".js"], + [".cjs", ".cjs"], + [".tsx", compilerOptions.jsx === 1 ? ".jsx" : ".js"], + [".jsx", ".jsx"], + [".json", ".json"] + ]; + initializeTypeChecker(); + return checker; + function getCachedType(key) { + return key ? cachedTypes.get(key) : void 0; + } + function setCachedType(key, type3) { + if (key) + cachedTypes.set(key, type3); + return type3; + } + function getJsxNamespace(location2) { + if (location2) { + const file = getSourceFileOfNode(location2); + if (file) { + if (isJsxOpeningFragment(location2)) { + if (file.localJsxFragmentNamespace) { + return file.localJsxFragmentNamespace; + } + const jsxFragmentPragma = file.pragmas.get("jsxfrag"); + if (jsxFragmentPragma) { + const chosenPragma = isArray3(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma; + file.localJsxFragmentFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); + visitNode(file.localJsxFragmentFactory, markAsSynthetic, isEntityName); + if (file.localJsxFragmentFactory) { + return file.localJsxFragmentNamespace = getFirstIdentifier(file.localJsxFragmentFactory).escapedText; + } + } + const entity = getJsxFragmentFactoryEntity(location2); + if (entity) { + file.localJsxFragmentFactory = entity; + return file.localJsxFragmentNamespace = getFirstIdentifier(entity).escapedText; + } + } else { + const localJsxNamespace = getLocalJsxNamespace(file); + if (localJsxNamespace) { + return file.localJsxNamespace = localJsxNamespace; + } + } + } + } + if (!_jsxNamespace) { + _jsxNamespace = "React"; + if (compilerOptions.jsxFactory) { + _jsxFactoryEntity = parseIsolatedEntityName(compilerOptions.jsxFactory, languageVersion); + visitNode(_jsxFactoryEntity, markAsSynthetic); + if (_jsxFactoryEntity) { + _jsxNamespace = getFirstIdentifier(_jsxFactoryEntity).escapedText; + } + } else if (compilerOptions.reactNamespace) { + _jsxNamespace = escapeLeadingUnderscores(compilerOptions.reactNamespace); + } + } + if (!_jsxFactoryEntity) { + _jsxFactoryEntity = factory.createQualifiedName(factory.createIdentifier(unescapeLeadingUnderscores(_jsxNamespace)), "createElement"); + } + return _jsxNamespace; + } + function getLocalJsxNamespace(file) { + if (file.localJsxNamespace) { + return file.localJsxNamespace; + } + const jsxPragma = file.pragmas.get("jsx"); + if (jsxPragma) { + const chosenPragma = isArray3(jsxPragma) ? jsxPragma[0] : jsxPragma; + file.localJsxFactory = parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion); + visitNode(file.localJsxFactory, markAsSynthetic, isEntityName); + if (file.localJsxFactory) { + return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; + } + } + } + function markAsSynthetic(node) { + setTextRangePosEnd(node, -1, -1); + return visitEachChild( + node, + markAsSynthetic, + /*context*/ + void 0 + ); + } + function getEmitResolver(sourceFile, cancellationToken2) { + getDiagnostics2(sourceFile, cancellationToken2); + return emitResolver; + } + function lookupOrIssueError(location2, message, ...args) { + const diagnostic = location2 ? createDiagnosticForNode(location2, message, ...args) : createCompilerDiagnostic(message, ...args); + const existing = diagnostics.lookup(diagnostic); + if (existing) { + return existing; + } else { + diagnostics.add(diagnostic); + return diagnostic; + } + } + function errorSkippedOn(key, location2, message, ...args) { + const diagnostic = error22(location2, message, ...args); + diagnostic.skippedOn = key; + return diagnostic; + } + function createError(location2, message, ...args) { + return location2 ? createDiagnosticForNode(location2, message, ...args) : createCompilerDiagnostic(message, ...args); + } + function error22(location2, message, ...args) { + const diagnostic = createError(location2, message, ...args); + diagnostics.add(diagnostic); + return diagnostic; + } + function addErrorOrSuggestion(isError3, diagnostic) { + if (isError3) { + diagnostics.add(diagnostic); + } else { + suggestionDiagnostics.add({ + ...diagnostic, + category: 2 + /* Suggestion */ + }); + } + } + function errorOrSuggestion(isError3, location2, message, ...args) { + if (location2.pos < 0 || location2.end < 0) { + if (!isError3) { + return; + } + const file = getSourceFileOfNode(location2); + addErrorOrSuggestion(isError3, "message" in message ? createFileDiagnostic(file, 0, 0, message, ...args) : createDiagnosticForFileFromMessageChain(file, message)); + return; + } + addErrorOrSuggestion(isError3, "message" in message ? createDiagnosticForNode(location2, message, ...args) : createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(location2), location2, message)); + } + function errorAndMaybeSuggestAwait(location2, maybeMissingAwait, message, ...args) { + const diagnostic = error22(location2, message, ...args); + if (maybeMissingAwait) { + const related = createDiagnosticForNode(location2, Diagnostics.Did_you_forget_to_use_await); + addRelatedInfo(diagnostic, related); + } + return diagnostic; + } + function addDeprecatedSuggestionWorker(declarations, diagnostic) { + const deprecatedTag = Array.isArray(declarations) ? forEach4(declarations, getJSDocDeprecatedTag) : getJSDocDeprecatedTag(declarations); + if (deprecatedTag) { + addRelatedInfo( + diagnostic, + createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here) + ); + } + suggestionDiagnostics.add(diagnostic); + return diagnostic; + } + function isDeprecatedSymbol(symbol) { + const parentSymbol = getParentOfSymbol(symbol); + if (parentSymbol && length(symbol.declarations) > 1) { + return parentSymbol.flags & 64 ? some2(symbol.declarations, isDeprecatedDeclaration2) : every2(symbol.declarations, isDeprecatedDeclaration2); + } + return !!symbol.valueDeclaration && isDeprecatedDeclaration2(symbol.valueDeclaration) || length(symbol.declarations) && every2(symbol.declarations, isDeprecatedDeclaration2); + } + function isDeprecatedDeclaration2(declaration) { + return !!(getCombinedNodeFlagsCached(declaration) & 536870912); + } + function addDeprecatedSuggestion(location2, declarations, deprecatedEntity) { + const diagnostic = createDiagnosticForNode(location2, Diagnostics._0_is_deprecated, deprecatedEntity); + return addDeprecatedSuggestionWorker(declarations, diagnostic); + } + function addDeprecatedSuggestionWithSignature(location2, declaration, deprecatedEntity, signatureString) { + const diagnostic = deprecatedEntity ? createDiagnosticForNode(location2, Diagnostics.The_signature_0_of_1_is_deprecated, signatureString, deprecatedEntity) : createDiagnosticForNode(location2, Diagnostics._0_is_deprecated, signatureString); + return addDeprecatedSuggestionWorker(declaration, diagnostic); + } + function createSymbol(flags, name2, checkFlags) { + symbolCount++; + const symbol = new Symbol47(flags | 33554432, name2); + symbol.links = new SymbolLinks(); + symbol.links.checkFlags = checkFlags || 0; + return symbol; + } + function createParameter2(name2, type3) { + const symbol = createSymbol(1, name2); + symbol.links.type = type3; + return symbol; + } + function createProperty(name2, type3) { + const symbol = createSymbol(4, name2); + symbol.links.type = type3; + return symbol; + } + function getExcludedSymbolFlags(flags) { + let result2 = 0; + if (flags & 2) + result2 |= 111551; + if (flags & 1) + result2 |= 111550; + if (flags & 4) + result2 |= 0; + if (flags & 8) + result2 |= 900095; + if (flags & 16) + result2 |= 110991; + if (flags & 32) + result2 |= 899503; + if (flags & 64) + result2 |= 788872; + if (flags & 256) + result2 |= 899327; + if (flags & 128) + result2 |= 899967; + if (flags & 512) + result2 |= 110735; + if (flags & 8192) + result2 |= 103359; + if (flags & 32768) + result2 |= 46015; + if (flags & 65536) + result2 |= 78783; + if (flags & 262144) + result2 |= 526824; + if (flags & 524288) + result2 |= 788968; + if (flags & 2097152) + result2 |= 2097152; + return result2; + } + function recordMergedSymbol(target, source) { + if (!source.mergeId) { + source.mergeId = nextMergeId; + nextMergeId++; + } + mergedSymbols[source.mergeId] = target; + } + function cloneSymbol2(symbol) { + const result2 = createSymbol(symbol.flags, symbol.escapedName); + result2.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result2.parent = symbol.parent; + if (symbol.valueDeclaration) + result2.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result2.constEnumOnlyModule = true; + if (symbol.members) + result2.members = new Map(symbol.members); + if (symbol.exports) + result2.exports = new Map(symbol.exports); + recordMergedSymbol(result2, symbol); + return result2; + } + function mergeSymbol(target, source, unidirectional = false) { + if (!(target.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | target.flags) & 67108864) { + if (source === target) { + return target; + } + if (!(target.flags & 33554432)) { + const resolvedTarget = resolveSymbol(target); + if (resolvedTarget === unknownSymbol) { + return source; + } + target = cloneSymbol2(resolvedTarget); + } + if (source.flags & 512 && target.flags & 512 && target.constEnumOnlyModule && !source.constEnumOnlyModule) { + target.constEnumOnlyModule = false; + } + target.flags |= source.flags; + if (source.valueDeclaration) { + setValueDeclaration(target, source.valueDeclaration); + } + addRange(target.declarations, source.declarations); + if (source.members) { + if (!target.members) + target.members = createSymbolTable(); + mergeSymbolTable(target.members, source.members, unidirectional); + } + if (source.exports) { + if (!target.exports) + target.exports = createSymbolTable(); + mergeSymbolTable(target.exports, source.exports, unidirectional); + } + if (!unidirectional) { + recordMergedSymbol(target, source); + } + } else if (target.flags & 1024) { + if (target !== globalThisSymbol) { + error22( + source.declarations && getNameOfDeclaration(source.declarations[0]), + Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, + symbolToString2(target) + ); + } + } else { + const isEitherEnum = !!(target.flags & 384 || source.flags & 384); + const isEitherBlockScoped = !!(target.flags & 2 || source.flags & 2); + const message = isEitherEnum ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : isEitherBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; + const sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]); + const targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]); + const isSourcePlainJs = isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs); + const isTargetPlainJs = isPlainJsFile(targetSymbolFile, compilerOptions.checkJs); + const symbolName2 = symbolToString2(source); + if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) { + const firstFile = comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 ? sourceSymbolFile : targetSymbolFile; + const secondFile = firstFile === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile; + const filesDuplicates = getOrUpdate(amalgamatedDuplicates, `${firstFile.path}|${secondFile.path}`, () => ({ firstFile, secondFile, conflictingSymbols: /* @__PURE__ */ new Map() })); + const conflictingSymbolInfo = getOrUpdate(filesDuplicates.conflictingSymbols, symbolName2, () => ({ isBlockScoped: isEitherBlockScoped, firstFileLocations: [], secondFileLocations: [] })); + if (!isSourcePlainJs) + addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source); + if (!isTargetPlainJs) + addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target); + } else { + if (!isSourcePlainJs) + addDuplicateDeclarationErrorsForSymbols(source, message, symbolName2, target); + if (!isTargetPlainJs) + addDuplicateDeclarationErrorsForSymbols(target, message, symbolName2, source); + } + } + return target; + function addDuplicateLocations(locs, symbol) { + if (symbol.declarations) { + for (const decl of symbol.declarations) { + pushIfUnique(locs, decl); + } + } + } + } + function addDuplicateDeclarationErrorsForSymbols(target, message, symbolName2, source) { + forEach4(target.declarations, (node) => { + addDuplicateDeclarationError(node, message, symbolName2, source.declarations); + }); + } + function addDuplicateDeclarationError(node, message, symbolName2, relatedNodes) { + const errorNode = (getExpandoInitializer( + node, + /*isPrototypeAssignment*/ + false + ) ? getNameOfExpando(node) : getNameOfDeclaration(node)) || node; + const err = lookupOrIssueError(errorNode, message, symbolName2); + for (const relatedNode of relatedNodes || emptyArray) { + const adjustedNode = (getExpandoInitializer( + relatedNode, + /*isPrototypeAssignment*/ + false + ) ? getNameOfExpando(relatedNode) : getNameOfDeclaration(relatedNode)) || relatedNode; + if (adjustedNode === errorNode) + continue; + err.relatedInformation = err.relatedInformation || []; + const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics._0_was_also_declared_here, symbolName2); + const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.and_here); + if (length(err.relatedInformation) >= 5 || some2( + err.relatedInformation, + (r8) => compareDiagnostics(r8, followOnMessage) === 0 || compareDiagnostics(r8, leadingMessage) === 0 + /* EqualTo */ + )) + continue; + addRelatedInfo(err, !length(err.relatedInformation) ? leadingMessage : followOnMessage); + } + } + function combineSymbolTables(first2, second) { + if (!(first2 == null ? void 0 : first2.size)) + return second; + if (!(second == null ? void 0 : second.size)) + return first2; + const combined = createSymbolTable(); + mergeSymbolTable(combined, first2); + mergeSymbolTable(combined, second); + return combined; + } + function mergeSymbolTable(target, source, unidirectional = false) { + source.forEach((sourceSymbol, id) => { + const targetSymbol = target.get(id); + target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol)); + }); + } + function mergeModuleAugmentation(moduleName3) { + var _a2, _b, _c; + const moduleAugmentation = moduleName3.parent; + if (((_a2 = moduleAugmentation.symbol.declarations) == null ? void 0 : _a2[0]) !== moduleAugmentation) { + Debug.assert(moduleAugmentation.symbol.declarations.length > 1); + return; + } + if (isGlobalScopeAugmentation(moduleAugmentation)) { + mergeSymbolTable(globals3, moduleAugmentation.symbol.exports); + } else { + const moduleNotFoundError = !(moduleName3.parent.parent.flags & 33554432) ? Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found : void 0; + let mainModule = resolveExternalModuleNameWorker( + moduleName3, + moduleName3, + moduleNotFoundError, + /*isForAugmentation*/ + true + ); + if (!mainModule) { + return; + } + mainModule = resolveExternalModuleSymbol(mainModule); + if (mainModule.flags & 1920) { + if (some2(patternAmbientModules, (module22) => mainModule === module22.symbol)) { + const merged = mergeSymbol( + moduleAugmentation.symbol, + mainModule, + /*unidirectional*/ + true + ); + if (!patternAmbientModuleAugmentations) { + patternAmbientModuleAugmentations = /* @__PURE__ */ new Map(); + } + patternAmbientModuleAugmentations.set(moduleName3.text, merged); + } else { + if (((_b = mainModule.exports) == null ? void 0 : _b.get( + "__export" + /* ExportStar */ + )) && ((_c = moduleAugmentation.symbol.exports) == null ? void 0 : _c.size)) { + const resolvedExports = getResolvedMembersOrExportsOfSymbol( + mainModule, + "resolvedExports" + /* resolvedExports */ + ); + for (const [key, value2] of arrayFrom(moduleAugmentation.symbol.exports.entries())) { + if (resolvedExports.has(key) && !mainModule.exports.has(key)) { + mergeSymbol(resolvedExports.get(key), value2); + } + } + } + mergeSymbol(mainModule, moduleAugmentation.symbol); + } + } else { + error22(moduleName3, Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity, moduleName3.text); + } + } + } + function addToSymbolTable(target, source, message) { + source.forEach((sourceSymbol, id) => { + const targetSymbol = target.get(id); + if (targetSymbol) { + forEach4(targetSymbol.declarations, addDeclarationDiagnostic(unescapeLeadingUnderscores(id), message)); + } else { + target.set(id, sourceSymbol); + } + }); + function addDeclarationDiagnostic(id, message2) { + return (declaration) => diagnostics.add(createDiagnosticForNode(declaration, message2, id)); + } + } + function getSymbolLinks(symbol) { + if (symbol.flags & 33554432) + return symbol.links; + const id = getSymbolId(symbol); + return symbolLinks[id] ?? (symbolLinks[id] = new SymbolLinks()); + } + function getNodeLinks(node) { + const nodeId = getNodeId(node); + return nodeLinks[nodeId] || (nodeLinks[nodeId] = new NodeLinks()); + } + function isGlobalSourceFile(node) { + return node.kind === 312 && !isExternalOrCommonJsModule(node); + } + function getSymbol2(symbols, name2, meaning) { + if (meaning) { + const symbol = getMergedSymbol(symbols.get(name2)); + if (symbol) { + Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); + if (symbol.flags & meaning) { + return symbol; + } + if (symbol.flags & 2097152) { + const targetFlags = getSymbolFlags(symbol); + if (targetFlags & meaning) { + return symbol; + } + } + } + } + } + function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { + const constructorDeclaration = parameter.parent; + const classDeclaration = parameter.parent.parent; + const parameterSymbol = getSymbol2( + constructorDeclaration.locals, + parameterName, + 111551 + /* Value */ + ); + const propertySymbol = getSymbol2( + getMembersOfSymbol(classDeclaration.symbol), + parameterName, + 111551 + /* Value */ + ); + if (parameterSymbol && propertySymbol) { + return [parameterSymbol, propertySymbol]; + } + return Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration"); + } + function isBlockScopedNameDeclaredBeforeUse(declaration, usage) { + const declarationFile = getSourceFileOfNode(declaration); + const useFile = getSourceFileOfNode(usage); + const declContainer = getEnclosingBlockScopeContainer(declaration); + if (declarationFile !== useFile) { + if (moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator) || !outFile(compilerOptions) || isInTypeQuery(usage) || declaration.flags & 33554432) { + return true; + } + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { + return true; + } + const sourceFiles = host.getSourceFiles(); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); + } + if (!!(usage.flags & 16777216) || isInTypeQuery(usage) || isInAmbientOrTypeNode(usage)) { + return true; + } + if (declaration.pos <= usage.pos && !(isPropertyDeclaration(declaration) && isThisProperty(usage.parent) && !declaration.initializer && !declaration.exclamationToken)) { + if (declaration.kind === 208) { + const errorBindingElement = getAncestor( + usage, + 208 + /* BindingElement */ + ); + if (errorBindingElement) { + return findAncestor(errorBindingElement, isBindingElement) !== findAncestor(declaration, isBindingElement) || declaration.pos < errorBindingElement.pos; + } + return isBlockScopedNameDeclaredBeforeUse(getAncestor( + declaration, + 260 + /* VariableDeclaration */ + ), usage); + } else if (declaration.kind === 260) { + return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); + } else if (isClassLike(declaration)) { + return !findAncestor(usage, (n7) => isComputedPropertyName(n7) && n7.parent.parent === declaration); + } else if (isPropertyDeclaration(declaration)) { + return !isPropertyImmediatelyReferencedWithinDeclaration( + declaration, + usage, + /*stopAtAnyPropertyDeclaration*/ + false + ); + } else if (isParameterPropertyDeclaration(declaration, declaration.parent)) { + return !(emitStandardClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration)); + } + return true; + } + if (usage.parent.kind === 281 || usage.parent.kind === 277 && usage.parent.isExportEquals) { + return true; + } + if (usage.kind === 277 && usage.isExportEquals) { + return true; + } + if (isUsedInFunctionOrInstanceProperty(usage, declaration)) { + if (emitStandardClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) { + return !isPropertyImmediatelyReferencedWithinDeclaration( + declaration, + usage, + /*stopAtAnyPropertyDeclaration*/ + true + ); + } else { + return true; + } + } + return false; + function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration2, usage2) { + switch (declaration2.parent.parent.kind) { + case 243: + case 248: + case 250: + if (isSameScopeDescendentOf(usage2, declaration2, declContainer)) { + return true; + } + break; + } + const grandparent = declaration2.parent.parent; + return isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer); + } + function isUsedInFunctionOrInstanceProperty(usage2, declaration2) { + return !!findAncestor(usage2, (current) => { + if (current === declContainer) { + return "quit"; + } + if (isFunctionLike(current)) { + return true; + } + if (isClassStaticBlockDeclaration(current)) { + return declaration2.pos < usage2.pos; + } + const propertyDeclaration = tryCast(current.parent, isPropertyDeclaration); + if (propertyDeclaration) { + const initializerOfProperty = propertyDeclaration.initializer === current; + if (initializerOfProperty) { + if (isStatic(current.parent)) { + if (declaration2.kind === 174) { + return true; + } + if (isPropertyDeclaration(declaration2) && getContainingClass(usage2) === getContainingClass(declaration2)) { + const propName2 = declaration2.name; + if (isIdentifier(propName2) || isPrivateIdentifier(propName2)) { + const type3 = getTypeOfSymbol(getSymbolOfDeclaration(declaration2)); + const staticBlocks = filter2(declaration2.parent.members, isClassStaticBlockDeclaration); + if (isPropertyInitializedInStaticBlocks(propName2, type3, staticBlocks, declaration2.parent.pos, current.pos)) { + return true; + } + } + } + } else { + const isDeclarationInstanceProperty = declaration2.kind === 172 && !isStatic(declaration2); + if (!isDeclarationInstanceProperty || getContainingClass(usage2) !== getContainingClass(declaration2)) { + return true; + } + } + } + } + return false; + }); + } + function isPropertyImmediatelyReferencedWithinDeclaration(declaration2, usage2, stopAtAnyPropertyDeclaration) { + if (usage2.end > declaration2.end) { + return false; + } + const ancestorChangingReferenceScope = findAncestor(usage2, (node) => { + if (node === declaration2) { + return "quit"; + } + switch (node.kind) { + case 219: + return true; + case 172: + return stopAtAnyPropertyDeclaration && (isPropertyDeclaration(declaration2) && node.parent === declaration2.parent || isParameterPropertyDeclaration(declaration2, declaration2.parent) && node.parent === declaration2.parent.parent) ? "quit" : true; + case 241: + switch (node.parent.kind) { + case 177: + case 174: + case 178: + return true; + default: + return false; + } + default: + return false; + } + }); + return ancestorChangingReferenceScope === void 0; + } + } + function useOuterVariableScopeInParameter(result2, location2, lastLocation) { + const target = getEmitScriptTarget(compilerOptions); + const functionLocation = location2; + if (isParameter(lastLocation) && functionLocation.body && result2.valueDeclaration && result2.valueDeclaration.pos >= functionLocation.body.pos && result2.valueDeclaration.end <= functionLocation.body.end) { + if (target >= 2) { + const links = getNodeLinks(functionLocation); + if (links.declarationRequiresScopeChange === void 0) { + links.declarationRequiresScopeChange = forEach4(functionLocation.parameters, requiresScopeChange) || false; + } + return !links.declarationRequiresScopeChange; + } + } + return false; + function requiresScopeChange(node) { + return requiresScopeChangeWorker(node.name) || !!node.initializer && requiresScopeChangeWorker(node.initializer); + } + function requiresScopeChangeWorker(node) { + switch (node.kind) { + case 219: + case 218: + case 262: + case 176: + return false; + case 174: + case 177: + case 178: + case 303: + return requiresScopeChangeWorker(node.name); + case 172: + if (hasStaticModifier(node)) { + return !emitStandardClassFields; + } + return requiresScopeChangeWorker(node.name); + default: + if (isNullishCoalesce(node) || isOptionalChain(node)) { + return target < 7; + } + if (isBindingElement(node) && node.dotDotDotToken && isObjectBindingPattern(node.parent)) { + return target < 4; + } + if (isTypeNode(node)) + return false; + return forEachChild(node, requiresScopeChangeWorker) || false; + } + } + } + function isConstAssertion(location2) { + return isAssertionExpression(location2) && isConstTypeReference(location2.type) || isJSDocTypeTag(location2) && isConstTypeReference(location2.typeExpression); + } + function resolveName(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals = false, getSpellingSuggestions = true) { + return resolveNameHelper(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol2); + } + function resolveNameHelper(location2, name2, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { + var _a2, _b, _c; + const originalLocation = location2; + let result2; + let lastLocation; + let lastSelfReferenceLocation; + let propertyWithInvalidInitializer; + let associatedDeclarationForContainingInitializerOrBindingName; + let withinDeferredContext = false; + const errorLocation = location2; + let grandparent; + let isInExternalModule = false; + loop: + while (location2) { + if (name2 === "const" && isConstAssertion(location2)) { + return void 0; + } + if (isModuleOrEnumDeclaration(location2) && lastLocation && location2.name === lastLocation) { + lastLocation = location2; + location2 = location2.parent; + } + if (canHaveLocals(location2) && location2.locals && !isGlobalSourceFile(location2)) { + if (result2 = lookup(location2.locals, name2, meaning)) { + let useResult = true; + if (isFunctionLike(location2) && lastLocation && lastLocation !== location2.body) { + if (meaning & result2.flags & 788968 && lastLocation.kind !== 327) { + useResult = result2.flags & 262144 ? lastLocation === location2.type || lastLocation.kind === 169 || lastLocation.kind === 348 || lastLocation.kind === 349 || lastLocation.kind === 168 : false; + } + if (meaning & result2.flags & 3) { + if (useOuterVariableScopeInParameter(result2, location2, lastLocation)) { + useResult = false; + } else if (result2.flags & 1) { + useResult = lastLocation.kind === 169 || lastLocation === location2.type && !!findAncestor(result2.valueDeclaration, isParameter); + } + } + } else if (location2.kind === 194) { + useResult = lastLocation === location2.trueType; + } + if (useResult) { + break loop; + } else { + result2 = void 0; + } + } + } + withinDeferredContext = withinDeferredContext || getIsDeferredContext(location2, lastLocation); + switch (location2.kind) { + case 312: + if (!isExternalOrCommonJsModule(location2)) + break; + isInExternalModule = true; + case 267: + const moduleExports4 = ((_a2 = getSymbolOfDeclaration(location2)) == null ? void 0 : _a2.exports) || emptySymbols; + if (location2.kind === 312 || isModuleDeclaration(location2) && location2.flags & 33554432 && !isGlobalScopeAugmentation(location2)) { + if (result2 = moduleExports4.get( + "default" + /* Default */ + )) { + const localSymbol = getLocalSymbolForExportDefault(result2); + if (localSymbol && result2.flags & meaning && localSymbol.escapedName === name2) { + break loop; + } + result2 = void 0; + } + const moduleExport = moduleExports4.get(name2); + if (moduleExport && moduleExport.flags === 2097152 && (getDeclarationOfKind( + moduleExport, + 281 + /* ExportSpecifier */ + ) || getDeclarationOfKind( + moduleExport, + 280 + /* NamespaceExport */ + ))) { + break; + } + } + if (name2 !== "default" && (result2 = lookup( + moduleExports4, + name2, + meaning & 2623475 + /* ModuleMember */ + ))) { + if (isSourceFile(location2) && location2.commonJsModuleIndicator && !((_b = result2.declarations) == null ? void 0 : _b.some(isJSDocTypeAlias))) { + result2 = void 0; + } else { + break loop; + } + } + break; + case 266: + if (result2 = lookup( + ((_c = getSymbolOfDeclaration(location2)) == null ? void 0 : _c.exports) || emptySymbols, + name2, + meaning & 8 + /* EnumMember */ + )) { + if (nameNotFoundMessage && getIsolatedModules(compilerOptions) && !(location2.flags & 33554432) && getSourceFileOfNode(location2) !== getSourceFileOfNode(result2.valueDeclaration)) { + error22( + errorLocation, + Diagnostics.Cannot_access_0_from_another_file_without_qualification_when_1_is_enabled_Use_2_instead, + unescapeLeadingUnderscores(name2), + isolatedModulesLikeFlagName, + `${unescapeLeadingUnderscores(getSymbolOfNode(location2).escapedName)}.${unescapeLeadingUnderscores(name2)}` + ); + } + break loop; + } + break; + case 172: + if (!isStatic(location2)) { + const ctor = findConstructorDeclaration(location2.parent); + if (ctor && ctor.locals) { + if (lookup( + ctor.locals, + name2, + meaning & 111551 + /* Value */ + )) { + Debug.assertNode(location2, isPropertyDeclaration); + propertyWithInvalidInitializer = location2; + } + } + } + break; + case 263: + case 231: + case 264: + if (result2 = lookup( + getSymbolOfDeclaration(location2).members || emptySymbols, + name2, + meaning & 788968 + /* Type */ + )) { + if (!isTypeParameterSymbolDeclaredInContainer(result2, location2)) { + result2 = void 0; + break; + } + if (lastLocation && isStatic(lastLocation)) { + if (nameNotFoundMessage) { + error22(errorLocation, Diagnostics.Static_members_cannot_reference_class_type_parameters); + } + return void 0; + } + break loop; + } + if (isClassExpression(location2) && meaning & 32) { + const className = location2.name; + if (className && name2 === className.escapedText) { + result2 = location2.symbol; + break loop; + } + } + break; + case 233: + if (lastLocation === location2.expression && location2.parent.token === 96) { + const container = location2.parent.parent; + if (isClassLike(container) && (result2 = lookup( + getSymbolOfDeclaration(container).members, + name2, + meaning & 788968 + /* Type */ + ))) { + if (nameNotFoundMessage) { + error22(errorLocation, Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); + } + return void 0; + } + } + break; + case 167: + grandparent = location2.parent.parent; + if (isClassLike(grandparent) || grandparent.kind === 264) { + if (result2 = lookup( + getSymbolOfDeclaration(grandparent).members, + name2, + meaning & 788968 + /* Type */ + )) { + if (nameNotFoundMessage) { + error22(errorLocation, Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); + } + return void 0; + } + } + break; + case 219: + if (getEmitScriptTarget(compilerOptions) >= 2) { + break; + } + case 174: + case 176: + case 177: + case 178: + case 262: + if (meaning & 3 && name2 === "arguments") { + result2 = argumentsSymbol; + break loop; + } + break; + case 218: + if (meaning & 3 && name2 === "arguments") { + result2 = argumentsSymbol; + break loop; + } + if (meaning & 16) { + const functionName = location2.name; + if (functionName && name2 === functionName.escapedText) { + result2 = location2.symbol; + break loop; + } + } + break; + case 170: + if (location2.parent && location2.parent.kind === 169) { + location2 = location2.parent; + } + if (location2.parent && (isClassElement(location2.parent) || location2.parent.kind === 263)) { + location2 = location2.parent; + } + break; + case 353: + case 345: + case 347: + const root2 = getJSDocRoot(location2); + if (root2) { + location2 = root2.parent; + } + break; + case 169: + if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && isBindingPattern(lastLocation))) { + if (!associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location2; + } + } + break; + case 208: + if (lastLocation && (lastLocation === location2.initializer || lastLocation === location2.name && isBindingPattern(lastLocation))) { + if (isParameterDeclaration(location2) && !associatedDeclarationForContainingInitializerOrBindingName) { + associatedDeclarationForContainingInitializerOrBindingName = location2; + } + } + break; + case 195: + if (meaning & 262144) { + const parameterName = location2.typeParameter.name; + if (parameterName && name2 === parameterName.escapedText) { + result2 = location2.typeParameter.symbol; + break loop; + } + } + break; + case 281: + if (lastLocation && lastLocation === location2.propertyName && location2.parent.parent.moduleSpecifier) { + location2 = location2.parent.parent.parent; + } + break; + } + if (isSelfReferenceLocation(location2)) { + lastSelfReferenceLocation = location2; + } + lastLocation = location2; + location2 = isJSDocTemplateTag(location2) ? getEffectiveContainerForJSDocTemplateTag(location2) || location2.parent : isJSDocParameterTag(location2) || isJSDocReturnTag(location2) ? getHostSignatureFromJSDoc(location2) || location2.parent : location2.parent; + } + if (isUse && result2 && (!lastSelfReferenceLocation || result2 !== lastSelfReferenceLocation.symbol)) { + result2.isReferenced |= meaning; + } + if (!result2) { + if (lastLocation) { + Debug.assertNode(lastLocation, isSourceFile); + if (lastLocation.commonJsModuleIndicator && name2 === "exports" && meaning & lastLocation.symbol.flags) { + return lastLocation.symbol; + } + } + if (!excludeGlobals) { + result2 = lookup(globals3, name2, meaning); + } + } + if (!result2) { + if (originalLocation && isInJSFile(originalLocation) && originalLocation.parent) { + if (isRequireCall( + originalLocation.parent, + /*requireStringLiteralLikeArgument*/ + false + )) { + return requireSymbol; + } + } + } + function checkAndReportErrorForInvalidInitializer() { + if (propertyWithInvalidInitializer && !emitStandardClassFields) { + error22( + errorLocation, + errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, + declarationNameToString(propertyWithInvalidInitializer.name), + diagnosticName(nameArg) + ); + return true; + } + return false; + } + if (!result2) { + if (nameNotFoundMessage) { + addLazyDiagnostic(() => { + if (!errorLocation || errorLocation.parent.kind !== 331 && !checkAndReportErrorForMissingPrefix(errorLocation, name2, nameArg) && // TODO: GH#18217 + !checkAndReportErrorForInvalidInitializer() && !checkAndReportErrorForExtendingInterface(errorLocation) && !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name2, meaning) && !checkAndReportErrorForExportingPrimitiveType(errorLocation, name2) && !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name2, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name2, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name2, meaning)) { + let suggestion; + let suggestedLib; + if (nameArg) { + suggestedLib = getSuggestedLibForNonExistentName(nameArg); + if (suggestedLib) { + error22(errorLocation, nameNotFoundMessage, diagnosticName(nameArg), suggestedLib); + } + } + if (!suggestedLib && getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { + suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name2, meaning); + const isGlobalScopeAugmentationDeclaration = (suggestion == null ? void 0 : suggestion.valueDeclaration) && isAmbientModule(suggestion.valueDeclaration) && isGlobalScopeAugmentation(suggestion.valueDeclaration); + if (isGlobalScopeAugmentationDeclaration) { + suggestion = void 0; + } + if (suggestion) { + const suggestionName = symbolToString2(suggestion); + const isUncheckedJS = isUncheckedJSSuggestion( + originalLocation, + suggestion, + /*excludeClasses*/ + false + ); + const message = meaning === 1920 || nameArg && typeof nameArg !== "string" && nodeIsSynthesized(nameArg) ? Diagnostics.Cannot_find_namespace_0_Did_you_mean_1 : isUncheckedJS ? Diagnostics.Could_not_find_name_0_Did_you_mean_1 : Diagnostics.Cannot_find_name_0_Did_you_mean_1; + const diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName); + addErrorOrSuggestion(!isUncheckedJS, diagnostic); + if (suggestion.valueDeclaration) { + addRelatedInfo( + diagnostic, + createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName) + ); + } + } + } + if (!suggestion && !suggestedLib && nameArg) { + error22(errorLocation, nameNotFoundMessage, diagnosticName(nameArg)); + } + suggestionCount++; + } + }); + } + return void 0; + } else if (nameNotFoundMessage && checkAndReportErrorForInvalidInitializer()) { + return void 0; + } + if (nameNotFoundMessage) { + addLazyDiagnostic(() => { + var _a22; + if (errorLocation && (meaning & 2 || (meaning & 32 || meaning & 384) && (meaning & 111551) === 111551)) { + const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result2); + if (exportOrLocalSymbol.flags & 2 || exportOrLocalSymbol.flags & 32 || exportOrLocalSymbol.flags & 384) { + checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); + } + } + if (result2 && isInExternalModule && (meaning & 111551) === 111551 && !(originalLocation.flags & 16777216)) { + const merged = getMergedSymbol(result2); + if (length(merged.declarations) && every2(merged.declarations, (d7) => isNamespaceExportDeclaration(d7) || isSourceFile(d7) && !!d7.symbol.globalExports)) { + errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, unescapeLeadingUnderscores(name2)); + } + } + if (result2 && associatedDeclarationForContainingInitializerOrBindingName && !withinDeferredContext && (meaning & 111551) === 111551) { + const candidate = getMergedSymbol(getLateBoundSymbol(result2)); + const root2 = getRootDeclaration(associatedDeclarationForContainingInitializerOrBindingName); + if (candidate === getSymbolOfDeclaration(associatedDeclarationForContainingInitializerOrBindingName)) { + error22(errorLocation, Diagnostics.Parameter_0_cannot_reference_itself, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name)); + } else if (candidate.valueDeclaration && candidate.valueDeclaration.pos > associatedDeclarationForContainingInitializerOrBindingName.pos && root2.parent.locals && lookup(root2.parent.locals, candidate.escapedName, meaning) === candidate) { + error22(errorLocation, Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), declarationNameToString(errorLocation)); + } + } + if (result2 && errorLocation && meaning & 111551 && result2.flags & 2097152 && !(result2.flags & 111551) && !isValidTypeOnlyAliasUseSite(errorLocation)) { + const typeOnlyDeclaration = getTypeOnlyAliasDeclaration( + result2, + 111551 + /* Value */ + ); + if (typeOnlyDeclaration) { + const message = typeOnlyDeclaration.kind === 281 || typeOnlyDeclaration.kind === 278 || typeOnlyDeclaration.kind === 280 ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type; + const unescapedName = unescapeLeadingUnderscores(name2); + addTypeOnlyDeclarationRelatedInfo( + error22(errorLocation, message, unescapedName), + typeOnlyDeclaration, + unescapedName + ); + } + } + if (compilerOptions.isolatedModules && result2 && isInExternalModule && (meaning & 111551) === 111551) { + const isGlobal = lookup(globals3, name2, meaning) === result2; + const nonValueSymbol = isGlobal && isSourceFile(lastLocation) && lastLocation.locals && lookup( + lastLocation.locals, + name2, + ~111551 + /* Value */ + ); + if (nonValueSymbol) { + const importDecl = (_a22 = nonValueSymbol.declarations) == null ? void 0 : _a22.find( + (d7) => d7.kind === 276 || d7.kind === 273 || d7.kind === 274 || d7.kind === 271 + /* ImportEqualsDeclaration */ + ); + if (importDecl && !isTypeOnlyImportDeclaration(importDecl)) { + error22(importDecl, Diagnostics.Import_0_conflicts_with_global_value_used_in_this_file_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, unescapeLeadingUnderscores(name2)); + } + } + } + }); + } + return result2; + } + function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) { + if (!typeOnlyDeclaration) + return diagnostic; + return addRelatedInfo( + diagnostic, + createDiagnosticForNode( + typeOnlyDeclaration, + typeOnlyDeclaration.kind === 281 || typeOnlyDeclaration.kind === 278 || typeOnlyDeclaration.kind === 280 ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here, + unescapedName + ) + ); + } + function getIsDeferredContext(location2, lastLocation) { + if (location2.kind !== 219 && location2.kind !== 218) { + return isTypeQueryNode(location2) || (isFunctionLikeDeclaration(location2) || location2.kind === 172 && !isStatic(location2)) && (!lastLocation || lastLocation !== location2.name); + } + if (lastLocation && lastLocation === location2.name) { + return false; + } + if (location2.asteriskToken || hasSyntacticModifier( + location2, + 1024 + /* Async */ + )) { + return true; + } + return !getImmediatelyInvokedFunctionExpression(location2); + } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 262: + case 263: + case 264: + case 266: + case 265: + case 267: + return true; + default: + return false; + } + } + function diagnosticName(nameArg) { + return isString4(nameArg) ? unescapeLeadingUnderscores(nameArg) : declarationNameToString(nameArg); + } + function isTypeParameterSymbolDeclaredInContainer(symbol, container) { + if (symbol.declarations) { + for (const decl of symbol.declarations) { + if (decl.kind === 168) { + const parent22 = isJSDocTemplateTag(decl.parent) ? getJSDocHost(decl.parent) : decl.parent; + if (parent22 === container) { + return !(isJSDocTemplateTag(decl.parent) && find2(decl.parent.parent.tags, isJSDocTypeAlias)); + } + } + } + } + return false; + } + function checkAndReportErrorForMissingPrefix(errorLocation, name2, nameArg) { + if (!isIdentifier(errorLocation) || errorLocation.escapedText !== name2 || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { + return false; + } + const container = getThisContainer( + errorLocation, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + let location2 = container; + while (location2) { + if (isClassLike(location2.parent)) { + const classSymbol = getSymbolOfDeclaration(location2.parent); + if (!classSymbol) { + break; + } + const constructorType = getTypeOfSymbol(classSymbol); + if (getPropertyOfType(constructorType, name2)) { + error22(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0, diagnosticName(nameArg), symbolToString2(classSymbol)); + return true; + } + if (location2 === container && !isStatic(location2)) { + const instanceType = getDeclaredTypeOfSymbol(classSymbol).thisType; + if (getPropertyOfType(instanceType, name2)) { + error22(errorLocation, Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0, diagnosticName(nameArg)); + return true; + } + } + } + location2 = location2.parent; + } + return false; + } + function checkAndReportErrorForExtendingInterface(errorLocation) { + const expression = getEntityNameForExtendingInterface(errorLocation); + if (expression && resolveEntityName( + expression, + 64, + /*ignoreErrors*/ + true + )) { + error22(errorLocation, Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements, getTextOfNode(expression)); + return true; + } + return false; + } + function getEntityNameForExtendingInterface(node) { + switch (node.kind) { + case 80: + case 211: + return node.parent ? getEntityNameForExtendingInterface(node.parent) : void 0; + case 233: + if (isEntityNameExpression(node.expression)) { + return node.expression; + } + default: + return void 0; + } + } + function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name2, meaning) { + const namespaceMeaning = 1920 | (isInJSFile(errorLocation) ? 111551 : 0); + if (meaning === namespaceMeaning) { + const symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 788968 & ~namespaceMeaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + const parent22 = errorLocation.parent; + if (symbol) { + if (isQualifiedName(parent22)) { + Debug.assert(parent22.left === errorLocation, "Should only be resolving left side of qualified name as a namespace"); + const propName2 = parent22.right.escapedText; + const propType = getPropertyOfType(getDeclaredTypeOfSymbol(symbol), propName2); + if (propType) { + error22( + parent22, + Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, + unescapeLeadingUnderscores(name2), + unescapeLeadingUnderscores(propName2) + ); + return true; + } + } + error22(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function checkAndReportErrorForUsingValueAsType(errorLocation, name2, meaning) { + if (meaning & (788968 & ~1920)) { + const symbol = resolveSymbol(resolveName( + errorLocation, + name2, + ~788968 & 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol && !(symbol.flags & 1920)) { + error22(errorLocation, Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function isPrimitiveTypeName(name2) { + return name2 === "any" || name2 === "string" || name2 === "number" || name2 === "boolean" || name2 === "never" || name2 === "unknown"; + } + function checkAndReportErrorForExportingPrimitiveType(errorLocation, name2) { + if (isPrimitiveTypeName(name2) && errorLocation.parent.kind === 281) { + error22(errorLocation, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, name2); + return true; + } + return false; + } + function checkAndReportErrorForUsingTypeAsValue(errorLocation, name2, meaning) { + if (meaning & 111551) { + if (isPrimitiveTypeName(name2)) { + const grandparent = errorLocation.parent.parent; + if (grandparent && grandparent.parent && isHeritageClause(grandparent)) { + const heritageKind = grandparent.token; + const containerKind = grandparent.parent.kind; + if (containerKind === 264 && heritageKind === 96) { + error22(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name2)); + } else if (containerKind === 263 && heritageKind === 96) { + error22(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name2)); + } else if (containerKind === 263 && heritageKind === 119) { + error22(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name2)); + } + } else { + error22(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name2)); + } + return true; + } + const symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 788968 & ~111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + const allFlags = symbol && getSymbolFlags(symbol); + if (symbol && allFlags !== void 0 && !(allFlags & 111551)) { + const rawName = unescapeLeadingUnderscores(name2); + if (isES2015OrLaterConstructorName(name2)) { + error22(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName); + } else if (maybeMappedType(errorLocation, symbol)) { + error22(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K"); + } else { + error22(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName); + } + return true; + } + } + return false; + } + function maybeMappedType(node, symbol) { + const container = findAncestor(node.parent, (n7) => isComputedPropertyName(n7) || isPropertySignature(n7) ? false : isTypeLiteralNode(n7) || "quit"); + if (container && container.members.length === 1) { + const type3 = getDeclaredTypeOfSymbol(symbol); + return !!(type3.flags & 1048576) && allTypesAssignableToKind( + type3, + 384, + /*strict*/ + true + ); + } + return false; + } + function isES2015OrLaterConstructorName(n7) { + switch (n7) { + case "Promise": + case "Symbol": + case "Map": + case "WeakMap": + case "Set": + case "WeakSet": + return true; + } + return false; + } + function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name2, meaning) { + if (meaning & (111551 & ~788968)) { + const symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 1024, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol) { + error22( + errorLocation, + Diagnostics.Cannot_use_namespace_0_as_a_value, + unescapeLeadingUnderscores(name2) + ); + return true; + } + } else if (meaning & (788968 & ~111551)) { + const symbol = resolveSymbol(resolveName( + errorLocation, + name2, + 1536, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )); + if (symbol) { + error22(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, unescapeLeadingUnderscores(name2)); + return true; + } + } + return false; + } + function checkResolvedBlockScopedVariable(result2, errorLocation) { + var _a2; + Debug.assert(!!(result2.flags & 2 || result2.flags & 32 || result2.flags & 384)); + if (result2.flags & (16 | 1 | 67108864) && result2.flags & 32) { + return; + } + const declaration = (_a2 = result2.declarations) == null ? void 0 : _a2.find( + (d7) => isBlockOrCatchScoped(d7) || isClassLike(d7) || d7.kind === 266 + /* EnumDeclaration */ + ); + if (declaration === void 0) + return Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration"); + if (!(declaration.flags & 33554432) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { + let diagnosticMessage; + const declarationName = declarationNameToString(getNameOfDeclaration(declaration)); + if (result2.flags & 2) { + diagnosticMessage = error22(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationName); + } else if (result2.flags & 32) { + diagnosticMessage = error22(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName); + } else if (result2.flags & 256) { + diagnosticMessage = error22(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName); + } else { + Debug.assert(!!(result2.flags & 128)); + if (getIsolatedModules(compilerOptions)) { + diagnosticMessage = error22(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName); + } + } + if (diagnosticMessage) { + addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName)); + } + } + } + function isSameScopeDescendentOf(initial2, parent22, stopAt) { + return !!parent22 && !!findAncestor(initial2, (n7) => n7 === parent22 || (n7 === stopAt || isFunctionLike(n7) && (!getImmediatelyInvokedFunctionExpression(n7) || getFunctionFlags(n7) & 3) ? "quit" : false)); + } + function getAnyImportSyntax(node) { + switch (node.kind) { + case 271: + return node; + case 273: + return node.parent; + case 274: + return node.parent.parent; + case 276: + return node.parent.parent.parent; + default: + return void 0; + } + } + function getDeclarationOfAliasSymbol(symbol) { + return symbol.declarations && findLast2(symbol.declarations, isAliasSymbolDeclaration2); + } + function isAliasSymbolDeclaration2(node) { + return node.kind === 271 || node.kind === 270 || node.kind === 273 && !!node.name || node.kind === 274 || node.kind === 280 || node.kind === 276 || node.kind === 281 || node.kind === 277 && exportAssignmentIsAlias(node) || isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 && exportAssignmentIsAlias(node) || isAccessExpression(node) && isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64 && isAliasableOrJsExpression(node.parent.right) || node.kind === 304 || node.kind === 303 && isAliasableOrJsExpression(node.initializer) || node.kind === 260 && isVariableDeclarationInitializedToBareOrAccessedRequire(node) || node.kind === 208 && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent); + } + function isAliasableOrJsExpression(e10) { + return isAliasableExpression(e10) || isFunctionExpression(e10) && isJSConstructor(e10); + } + function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { + const commonJSPropertyAccess = getCommonJSPropertyAccess(node); + if (commonJSPropertyAccess) { + const name2 = getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0]; + return isIdentifier(commonJSPropertyAccess.name) ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name2), commonJSPropertyAccess.name.escapedText)) : void 0; + } + if (isVariableDeclaration(node) || node.moduleReference.kind === 283) { + const immediate = resolveExternalModuleName( + node, + getExternalModuleRequireArgument(node) || getExternalModuleImportEqualsDeclarationExpression(node) + ); + const resolved2 = resolveExternalModuleSymbol(immediate); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved2, + /*overwriteEmpty*/ + false + ); + return resolved2; + } + const resolved = getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); + checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved); + return resolved; + } + function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) { + if (markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ) && !node.isTypeOnly) { + const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node)); + const isExport = typeOnlyDeclaration.kind === 281 || typeOnlyDeclaration.kind === 278; + const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type; + const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here; + const name2 = typeOnlyDeclaration.kind === 278 ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText); + addRelatedInfo(error22(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name2)); + } + } + function resolveExportByName(moduleSymbol, name2, sourceNode, dontResolveAlias) { + const exportValue = moduleSymbol.exports.get( + "export=" + /* ExportEquals */ + ); + const exportSymbol = exportValue ? getPropertyOfType( + getTypeOfSymbol(exportValue), + name2, + /*skipObjectFunctionPropertyAugment*/ + true + ) : moduleSymbol.exports.get(name2); + const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + sourceNode, + exportSymbol, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function isSyntacticDefault(node) { + return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier( + node, + 2048 + /* Default */ + ) || isExportSpecifier(node) || isNamespaceExport(node); + } + function getUsageModeForExpression(usage) { + return isStringLiteralLike(usage) ? host.getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0; + } + function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) { + return usageMode === 99 && targetMode === 1; + } + function isOnlyImportedAsDefault(usage) { + const usageMode = getUsageModeForExpression(usage); + return usageMode === 99 && endsWith2( + usage.text, + ".json" + /* Json */ + ); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) { + const usageMode = file && getUsageModeForExpression(usage); + if (file && usageMode !== void 0 && 100 <= moduleKind && moduleKind <= 199) { + const result2 = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat); + if (usageMode === 99 || result2) { + return result2; + } + } + if (!allowSyntheticDefaultImports) { + return false; + } + if (!file || file.isDeclarationFile) { + const defaultExportSymbol = resolveExportByName( + moduleSymbol, + "default", + /*sourceNode*/ + void 0, + /*dontResolveAlias*/ + true + ); + if (defaultExportSymbol && some2(defaultExportSymbol.declarations, isSyntacticDefault)) { + return false; + } + if (resolveExportByName( + moduleSymbol, + escapeLeadingUnderscores("__esModule"), + /*sourceNode*/ + void 0, + dontResolveAlias + )) { + return false; + } + return true; + } + if (!isSourceFileJS(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + return typeof file.externalModuleIndicator !== "object" && !resolveExportByName( + moduleSymbol, + escapeLeadingUnderscores("__esModule"), + /*sourceNode*/ + void 0, + dontResolveAlias + ); + } + function getTargetOfImportClause(node, dontResolveAlias) { + const moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); + } + } + function getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias) { + var _a2; + let exportDefaultSymbol; + if (isShorthandAmbientModuleSymbol(moduleSymbol)) { + exportDefaultSymbol = moduleSymbol; + } else { + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias); + } + const file = (_a2 = moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile); + const specifier = getModuleSpecifierForImportOrExport(node); + if (!specifier) { + return exportDefaultSymbol; + } + const hasDefaultOnly = isOnlyImportedAsDefault(specifier); + const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier); + if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) { + if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) { + const compilerOptionName = moduleKind >= 5 ? "allowSyntheticDefaultImports" : "esModuleInterop"; + const exportEqualsSymbol = moduleSymbol.exports.get( + "export=" + /* ExportEquals */ + ); + const exportAssignment = exportEqualsSymbol.valueDeclaration; + const err = error22(node.name, Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag, symbolToString2(moduleSymbol), compilerOptionName); + if (exportAssignment) { + addRelatedInfo( + err, + createDiagnosticForNode( + exportAssignment, + Diagnostics.This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag, + compilerOptionName + ) + ); + } + } else if (isImportClause(node)) { + reportNonDefaultExport(moduleSymbol, node); + } else { + errorNoModuleMemberSymbol(moduleSymbol, moduleSymbol, node, isImportOrExportSpecifier(node) && node.propertyName || node.name); + } + } else if (hasSyntheticDefault || hasDefaultOnly) { + const resolved = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + moduleSymbol, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + exportDefaultSymbol, + /*finalTarget*/ + void 0, + /*overwriteEmpty*/ + false + ); + return exportDefaultSymbol; + } + function getModuleSpecifierForImportOrExport(node) { + switch (node.kind) { + case 273: + return node.parent.moduleSpecifier; + case 271: + return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : void 0; + case 274: + return node.parent.parent.moduleSpecifier; + case 276: + return node.parent.parent.parent.moduleSpecifier; + case 281: + return node.parent.parent.moduleSpecifier; + default: + return Debug.assertNever(node); + } + } + function reportNonDefaultExport(moduleSymbol, node) { + var _a2, _b, _c; + if ((_a2 = moduleSymbol.exports) == null ? void 0 : _a2.has(node.symbol.escapedName)) { + error22( + node.name, + Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead, + symbolToString2(moduleSymbol), + symbolToString2(node.symbol) + ); + } else { + const diagnostic = error22(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString2(moduleSymbol)); + const exportStar = (_b = moduleSymbol.exports) == null ? void 0 : _b.get( + "__export" + /* ExportStar */ + ); + if (exportStar) { + const defaultExport = (_c = exportStar.declarations) == null ? void 0 : _c.find( + (decl) => { + var _a22, _b2; + return !!(isExportDeclaration(decl) && decl.moduleSpecifier && ((_b2 = (_a22 = resolveExternalModuleName(decl, decl.moduleSpecifier)) == null ? void 0 : _a22.exports) == null ? void 0 : _b2.has( + "default" + /* Default */ + ))); + } + ); + if (defaultExport) { + addRelatedInfo(diagnostic, createDiagnosticForNode(defaultExport, Diagnostics.export_Asterisk_does_not_re_export_a_default)); + } + } + } + } + function getTargetOfNamespaceImport(node, dontResolveAlias) { + const moduleSpecifier = node.parent.parent.moduleSpecifier; + const immediate = resolveExternalModuleName(node, moduleSpecifier); + const resolved = resolveESModuleSymbol( + immediate, + moduleSpecifier, + dontResolveAlias, + /*suppressInteropError*/ + false + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfNamespaceExport(node, dontResolveAlias) { + const moduleSpecifier = node.parent.moduleSpecifier; + const immediate = moduleSpecifier && resolveExternalModuleName(node, moduleSpecifier); + const resolved = moduleSpecifier && resolveESModuleSymbol( + immediate, + moduleSpecifier, + dontResolveAlias, + /*suppressInteropError*/ + false + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + immediate, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { + if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) { + return unknownSymbol; + } + if (valueSymbol.flags & (788968 | 1920)) { + return valueSymbol; + } + const result2 = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); + Debug.assert(valueSymbol.declarations || typeSymbol.declarations); + result2.declarations = deduplicate(concatenate(valueSymbol.declarations, typeSymbol.declarations), equateValues); + result2.parent = valueSymbol.parent || typeSymbol.parent; + if (valueSymbol.valueDeclaration) + result2.valueDeclaration = valueSymbol.valueDeclaration; + if (typeSymbol.members) + result2.members = new Map(typeSymbol.members); + if (valueSymbol.exports) + result2.exports = new Map(valueSymbol.exports); + return result2; + } + function getExportOfModule(symbol, name2, specifier, dontResolveAlias) { + var _a2; + if (symbol.flags & 1536) { + const exportSymbol = getExportsOfSymbol(symbol).get(name2.escapedText); + const resolved = resolveSymbol(exportSymbol, dontResolveAlias); + const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name2.escapedText); + markSymbolOfAliasDeclarationIfTypeOnly( + specifier, + exportSymbol, + resolved, + /*overwriteEmpty*/ + false, + exportStarDeclaration, + name2.escapedText + ); + return resolved; + } + } + function getPropertyOfVariable(symbol, name2) { + if (symbol.flags & 3) { + const typeAnnotation = symbol.valueDeclaration.type; + if (typeAnnotation) { + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name2)); + } + } + } + function getExternalModuleMember(node, specifier, dontResolveAlias = false) { + var _a2; + const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier; + const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier); + const name2 = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name; + if (!isIdentifier(name2)) { + return void 0; + } + const suppressInteropError = name2.escapedText === "default" && allowSyntheticDefaultImports; + const targetSymbol = resolveESModuleSymbol( + moduleSymbol, + moduleSpecifier, + /*dontResolveAlias*/ + false, + suppressInteropError + ); + if (targetSymbol) { + if (name2.escapedText) { + if (isShorthandAmbientModuleSymbol(moduleSymbol)) { + return moduleSymbol; + } + let symbolFromVariable; + if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get( + "export=" + /* ExportEquals */ + )) { + symbolFromVariable = getPropertyOfType( + getTypeOfSymbol(targetSymbol), + name2.escapedText, + /*skipObjectFunctionPropertyAugment*/ + true + ); + } else { + symbolFromVariable = getPropertyOfVariable(targetSymbol, name2.escapedText); + } + symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); + let symbolFromModule = getExportOfModule(targetSymbol, name2, specifier, dontResolveAlias); + if (symbolFromModule === void 0 && name2.escapedText === "default") { + const file = (_a2 = moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile); + if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) { + symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); + } + } + const symbol = symbolFromModule && symbolFromVariable && symbolFromModule !== symbolFromVariable ? combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; + if (!symbol) { + errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name2); + } + return symbol; + } + } + } + function errorNoModuleMemberSymbol(moduleSymbol, targetSymbol, node, name2) { + var _a2; + const moduleName3 = getFullyQualifiedName2(moduleSymbol, node); + const declarationName = declarationNameToString(name2); + const suggestion = getSuggestedSymbolForNonexistentModule(name2, targetSymbol); + if (suggestion !== void 0) { + const suggestionName = symbolToString2(suggestion); + const diagnostic = error22(name2, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName3, declarationName, suggestionName); + if (suggestion.valueDeclaration) { + addRelatedInfo(diagnostic, createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName)); + } + } else { + if ((_a2 = moduleSymbol.exports) == null ? void 0 : _a2.has( + "default" + /* Default */ + )) { + error22( + name2, + Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead, + moduleName3, + declarationName + ); + } else { + reportNonExportedMember(node, name2, declarationName, moduleSymbol, moduleName3); + } + } + } + function reportNonExportedMember(node, name2, declarationName, moduleSymbol, moduleName3) { + var _a2, _b; + const localSymbol = (_b = (_a2 = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a2.locals) == null ? void 0 : _b.get(name2.escapedText); + const exports29 = moduleSymbol.exports; + if (localSymbol) { + const exportedEqualsSymbol = exports29 == null ? void 0 : exports29.get( + "export=" + /* ExportEquals */ + ); + if (exportedEqualsSymbol) { + getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name2, declarationName, moduleName3) : error22(name2, Diagnostics.Module_0_has_no_exported_member_1, moduleName3, declarationName); + } else { + const exportedSymbol = exports29 ? find2(symbolsToArray(exports29), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0; + const diagnostic = exportedSymbol ? error22(name2, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName3, declarationName, symbolToString2(exportedSymbol)) : error22(name2, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName3, declarationName); + if (localSymbol.declarations) { + addRelatedInfo(diagnostic, ...map4(localSymbol.declarations, (decl, index4) => createDiagnosticForNode(decl, index4 === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName))); + } + } + } else { + error22(name2, Diagnostics.Module_0_has_no_exported_member_1, moduleName3, declarationName); + } + } + function reportInvalidImportEqualsExportMember(node, name2, declarationName, moduleName3) { + if (moduleKind >= 5) { + const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_a_default_import : Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error22(name2, message, declarationName); + } else { + if (isInJSFile(node)) { + const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import : Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error22(name2, message, declarationName); + } else { + const message = getESModuleInterop(compilerOptions) ? Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import : Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import; + error22(name2, message, declarationName, declarationName, moduleName3); + } + } + } + function getTargetOfImportSpecifier(node, dontResolveAlias) { + if (isImportSpecifier(node) && idText(node.propertyName || node.name) === "default") { + const specifier = getModuleSpecifierForImportOrExport(node); + const moduleSymbol = specifier && resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias); + } + } + const root2 = isBindingElement(node) ? getRootDeclaration(node) : node.parent.parent.parent; + const commonJSPropertyAccess = getCommonJSPropertyAccess(root2); + const resolved = getExternalModuleMember(root2, commonJSPropertyAccess || node, dontResolveAlias); + const name2 = node.propertyName || node.name; + if (commonJSPropertyAccess && resolved && isIdentifier(name2)) { + return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name2.escapedText), dontResolveAlias); + } + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getCommonJSPropertyAccess(node) { + if (isVariableDeclaration(node) && node.initializer && isPropertyAccessExpression(node.initializer)) { + return node.initializer; + } + } + function getTargetOfNamespaceExportDeclaration(node, dontResolveAlias) { + if (canHaveSymbol(node.parent)) { + const resolved = resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + } + function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) { + if (idText(node.propertyName || node.name) === "default") { + const specifier = getModuleSpecifierForImportOrExport(node); + const moduleSymbol = specifier && resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias); + } + } + const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : resolveEntityName( + node.propertyName || node.name, + meaning, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfExportAssignment(node, dontResolveAlias) { + const expression = isExportAssignment(node) ? node.expression : node.right; + const resolved = getTargetOfAliasLikeExpression(expression, dontResolveAlias); + markSymbolOfAliasDeclarationIfTypeOnly( + node, + /*immediateTarget*/ + void 0, + resolved, + /*overwriteEmpty*/ + false + ); + return resolved; + } + function getTargetOfAliasLikeExpression(expression, dontResolveAlias) { + if (isClassExpression(expression)) { + return checkExpressionCached(expression).symbol; + } + if (!isEntityName(expression) && !isEntityNameExpression(expression)) { + return void 0; + } + const aliasLike = resolveEntityName( + expression, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + true, + dontResolveAlias + ); + if (aliasLike) { + return aliasLike; + } + checkExpressionCached(expression); + return getNodeLinks(expression).resolvedSymbol; + } + function getTargetOfAccessExpression(node, dontRecursivelyResolve) { + if (!(isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 64)) { + return void 0; + } + return getTargetOfAliasLikeExpression(node.parent.right, dontRecursivelyResolve); + } + function getTargetOfAliasDeclaration(node, dontRecursivelyResolve = false) { + switch (node.kind) { + case 271: + case 260: + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); + case 273: + return getTargetOfImportClause(node, dontRecursivelyResolve); + case 274: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 280: + return getTargetOfNamespaceExport(node, dontRecursivelyResolve); + case 276: + case 208: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 281: + return getTargetOfExportSpecifier(node, 111551 | 788968 | 1920, dontRecursivelyResolve); + case 277: + case 226: + return getTargetOfExportAssignment(node, dontRecursivelyResolve); + case 270: + return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); + case 304: + return resolveEntityName( + node.name, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + true, + dontRecursivelyResolve + ); + case 303: + return getTargetOfAliasLikeExpression(node.initializer, dontRecursivelyResolve); + case 212: + case 211: + return getTargetOfAccessExpression(node, dontRecursivelyResolve); + default: + return Debug.fail(); + } + } + function isNonLocalAlias(symbol, excludes = 111551 | 788968 | 1920) { + if (!symbol) + return false; + return (symbol.flags & (2097152 | excludes)) === 2097152 || !!(symbol.flags & 2097152 && symbol.flags & 67108864); + } + function resolveSymbol(symbol, dontResolveAlias) { + return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol; + } + function resolveAlias(symbol) { + Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); + const links = getSymbolLinks(symbol); + if (!links.aliasTarget) { + links.aliasTarget = resolvingSymbol; + const node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return Debug.fail(); + const target = getTargetOfAliasDeclaration(node); + if (links.aliasTarget === resolvingSymbol) { + links.aliasTarget = target || unknownSymbol; + } else { + error22(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString2(symbol)); + } + } else if (links.aliasTarget === resolvingSymbol) { + links.aliasTarget = unknownSymbol; + } + return links.aliasTarget; + } + function tryResolveAlias(symbol) { + const links = getSymbolLinks(symbol); + if (links.aliasTarget !== resolvingSymbol) { + return resolveAlias(symbol); + } + return void 0; + } + function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) { + const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol); + const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration); + const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName( + typeOnlyDeclaration.moduleSpecifier, + typeOnlyDeclaration.moduleSpecifier, + /*ignoreErrors*/ + true + ) : resolveAlias(typeOnlyDeclaration.symbol)); + const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0; + let flags = excludeLocalMeanings ? 0 : symbol.flags; + let seenSymbols; + while (symbol.flags & 2097152) { + const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); + if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) { + break; + } + if (target === unknownSymbol) { + return -1; + } + if (target === symbol || (seenSymbols == null ? void 0 : seenSymbols.has(target))) { + break; + } + if (target.flags & 2097152) { + if (seenSymbols) { + seenSymbols.add(target); + } else { + seenSymbols = /* @__PURE__ */ new Set([symbol, target]); + } + } + flags |= target.flags; + symbol = target; + } + return flags; + } + function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) { + if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration)) + return false; + const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration); + if (isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = aliasDeclaration; + return true; + } + if (exportStarDeclaration) { + const links2 = getSymbolLinks(sourceSymbol); + links2.typeOnlyDeclaration = exportStarDeclaration; + if (sourceSymbol.escapedName !== exportStarName) { + links2.typeOnlyExportStarName = exportStarName; + } + return true; + } + const links = getSymbolLinks(sourceSymbol); + return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty); + } + function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) { + var _a2; + if (target && (aliasDeclarationLinks.typeOnlyDeclaration === void 0 || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) { + const exportSymbol = ((_a2 = target.exports) == null ? void 0 : _a2.get( + "export=" + /* ExportEquals */ + )) ?? target; + const typeOnly = exportSymbol.declarations && find2(exportSymbol.declarations, isTypeOnlyImportOrExportDeclaration); + aliasDeclarationLinks.typeOnlyDeclaration = typeOnly ?? getSymbolLinks(exportSymbol).typeOnlyDeclaration ?? false; + } + return !!aliasDeclarationLinks.typeOnlyDeclaration; + } + function getTypeOnlyAliasDeclaration(symbol, include) { + if (!(symbol.flags & 2097152)) { + return void 0; + } + const links = getSymbolLinks(symbol); + if (include === void 0) { + return links.typeOnlyDeclaration || void 0; + } + if (links.typeOnlyDeclaration) { + const resolved = links.typeOnlyDeclaration.kind === 278 ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol); + return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0; + } + return void 0; + } + function markExportAsReferenced(node) { + if (!canCollectSymbolAliasAccessabilityData) { + return; + } + const symbol = getSymbolOfDeclaration(node); + const target = resolveAlias(symbol); + if (target) { + const markAlias = target === unknownSymbol || getSymbolFlags( + symbol, + /*excludeTypeOnlyMeanings*/ + true + ) & 111551 && !isConstEnumOrConstEnumOnlyModule(target); + if (markAlias) { + markAliasSymbolAsReferenced(symbol); + } + } + } + function markAliasSymbolAsReferenced(symbol) { + Debug.assert(canCollectSymbolAliasAccessabilityData); + const links = getSymbolLinks(symbol); + if (!links.referenced) { + links.referenced = true; + const node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return Debug.fail(); + if (isInternalModuleImportEqualsDeclaration(node)) { + if (getSymbolFlags(resolveSymbol(symbol)) & 111551) { + checkExpressionCached(node.moduleReference); + } + } + } + } + function markConstEnumAliasAsReferenced(symbol) { + const links = getSymbolLinks(symbol); + if (!links.constEnumReferenced) { + links.constEnumReferenced = true; + } + } + function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, dontResolveAlias) { + if (entityName.kind === 80 && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { + entityName = entityName.parent; + } + if (entityName.kind === 80 || entityName.parent.kind === 166) { + return resolveEntityName( + entityName, + 1920, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + } else { + Debug.assert( + entityName.parent.kind === 271 + /* ImportEqualsDeclaration */ + ); + return resolveEntityName( + entityName, + 111551 | 788968 | 1920, + /*ignoreErrors*/ + false, + dontResolveAlias + ); + } + } + function getFullyQualifiedName2(symbol, containingLocation) { + return symbol.parent ? getFullyQualifiedName2(symbol.parent, containingLocation) + "." + symbolToString2(symbol) : symbolToString2( + symbol, + containingLocation, + /*meaning*/ + void 0, + 32 | 4 + /* AllowAnyNodeKind */ + ); + } + function getContainingQualifiedNameNode(node) { + while (isQualifiedName(node.parent)) { + node = node.parent; + } + return node; + } + function tryGetQualifiedNameAsValue(node) { + let left = getFirstIdentifier(node); + let symbol = resolveName( + left, + left.escapedText, + 111551, + /*nameNotFoundMessage*/ + void 0, + left, + /*isUse*/ + true + ); + if (!symbol) { + return void 0; + } + while (isQualifiedName(left.parent)) { + const type3 = getTypeOfSymbol(symbol); + symbol = getPropertyOfType(type3, left.parent.right.escapedText); + if (!symbol) { + return void 0; + } + left = left.parent; + } + return symbol; + } + function resolveEntityName(name2, meaning, ignoreErrors, dontResolveAlias, location2) { + if (nodeIsMissing(name2)) { + return void 0; + } + const namespaceMeaning = 1920 | (isInJSFile(name2) ? meaning & 111551 : 0); + let symbol; + if (name2.kind === 80) { + const message = meaning === namespaceMeaning || nodeIsSynthesized(name2) ? Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name2)); + const symbolFromJSPrototype = isInJSFile(name2) && !nodeIsSynthesized(name2) ? resolveEntityNameFromAssignmentDeclaration(name2, meaning) : void 0; + symbol = getMergedSymbol(resolveName( + location2 || name2, + name2.escapedText, + meaning, + ignoreErrors || symbolFromJSPrototype ? void 0 : message, + name2, + /*isUse*/ + true, + /*excludeGlobals*/ + false + )); + if (!symbol) { + return getMergedSymbol(symbolFromJSPrototype); + } + } else if (name2.kind === 166 || name2.kind === 211) { + const left = name2.kind === 166 ? name2.left : name2.expression; + const right = name2.kind === 166 ? name2.right : name2.name; + let namespace = resolveEntityName( + left, + namespaceMeaning, + ignoreErrors, + /*dontResolveAlias*/ + false, + location2 + ); + if (!namespace || nodeIsMissing(right)) { + return void 0; + } else if (namespace === unknownSymbol) { + return namespace; + } + if (namespace.valueDeclaration && isInJSFile(namespace.valueDeclaration) && getEmitModuleResolutionKind(compilerOptions) !== 100 && isVariableDeclaration(namespace.valueDeclaration) && namespace.valueDeclaration.initializer && isCommonJsRequire(namespace.valueDeclaration.initializer)) { + const moduleName3 = namespace.valueDeclaration.initializer.arguments[0]; + const moduleSym = resolveExternalModuleName(moduleName3, moduleName3); + if (moduleSym) { + const resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + namespace = resolvedModuleSymbol; + } + } + } + symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(namespace), right.escapedText, meaning)); + if (!symbol && namespace.flags & 2097152) { + symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(resolveAlias(namespace)), right.escapedText, meaning)); + } + if (!symbol) { + if (!ignoreErrors) { + const namespaceName = getFullyQualifiedName2(namespace); + const declarationName = declarationNameToString(right); + const suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace); + if (suggestionForNonexistentModule) { + error22(right, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString2(suggestionForNonexistentModule)); + return void 0; + } + const containingQualifiedName = isQualifiedName(name2) && getContainingQualifiedNameNode(name2); + const canSuggestTypeof = globalObjectType && meaning & 788968 && containingQualifiedName && !isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName); + if (canSuggestTypeof) { + error22( + containingQualifiedName, + Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, + entityNameToString(containingQualifiedName) + ); + return void 0; + } + if (meaning & 1920 && isQualifiedName(name2.parent)) { + const exportedTypeSymbol = getMergedSymbol(getSymbol2( + getExportsOfSymbol(namespace), + right.escapedText, + 788968 + /* Type */ + )); + if (exportedTypeSymbol) { + error22( + name2.parent.right, + Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, + symbolToString2(exportedTypeSymbol), + unescapeLeadingUnderscores(name2.parent.right.escapedText) + ); + return void 0; + } + } + error22(right, Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName); + } + return void 0; + } + } else { + Debug.assertNever(name2, "Unknown entity name kind."); + } + Debug.assert((getCheckFlags(symbol) & 1) === 0, "Should never get an instantiated symbol here."); + if (!nodeIsSynthesized(name2) && isEntityName(name2) && (symbol.flags & 2097152 || name2.parent.kind === 277)) { + markSymbolOfAliasDeclarationIfTypeOnly( + getAliasDeclarationFromName(name2), + symbol, + /*finalTarget*/ + void 0, + /*overwriteEmpty*/ + true + ); + } + return symbol.flags & meaning || dontResolveAlias ? symbol : resolveAlias(symbol); + } + function resolveEntityNameFromAssignmentDeclaration(name2, meaning) { + if (isJSDocTypeReference(name2.parent)) { + const secondaryLocation = getAssignmentDeclarationLocation(name2.parent); + if (secondaryLocation) { + return resolveName( + secondaryLocation, + name2.escapedText, + meaning, + /*nameNotFoundMessage*/ + void 0, + name2, + /*isUse*/ + true + ); + } + } + } + function getAssignmentDeclarationLocation(node) { + const typeAlias = findAncestor(node, (node2) => !(isJSDocNode(node2) || node2.flags & 16777216) ? "quit" : isJSDocTypeAlias(node2)); + if (typeAlias) { + return; + } + const host2 = getJSDocHost(node); + if (host2 && isExpressionStatement(host2) && isPrototypePropertyAssignment(host2.expression)) { + const symbol = getSymbolOfDeclaration(host2.expression.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + if (host2 && isFunctionExpression(host2) && isPrototypePropertyAssignment(host2.parent) && isExpressionStatement(host2.parent.parent)) { + const symbol = getSymbolOfDeclaration(host2.parent.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + if (host2 && (isObjectLiteralMethod(host2) || isPropertyAssignment(host2)) && isBinaryExpression(host2.parent.parent) && getAssignmentDeclarationKind(host2.parent.parent) === 6) { + const symbol = getSymbolOfDeclaration(host2.parent.parent.left); + if (symbol) { + return getDeclarationOfJSPrototypeContainer(symbol); + } + } + const sig = getEffectiveJSDocHost(node); + if (sig && isFunctionLike(sig)) { + const symbol = getSymbolOfDeclaration(sig); + return symbol && symbol.valueDeclaration; + } + } + function getDeclarationOfJSPrototypeContainer(symbol) { + const decl = symbol.parent.valueDeclaration; + if (!decl) { + return void 0; + } + const initializer = isAssignmentDeclaration(decl) ? getAssignedExpandoInitializer(decl) : hasOnlyExpressionInitializer(decl) ? getDeclaredExpandoInitializer(decl) : void 0; + return initializer || decl; + } + function getExpandoSymbol(symbol) { + const decl = symbol.valueDeclaration; + if (!decl || !isInJSFile(decl) || symbol.flags & 524288 || getExpandoInitializer( + decl, + /*isPrototypeAssignment*/ + false + )) { + return void 0; + } + const init2 = isVariableDeclaration(decl) ? getDeclaredExpandoInitializer(decl) : getAssignedExpandoInitializer(decl); + if (init2) { + const initSymbol = getSymbolOfNode(init2); + if (initSymbol) { + return mergeJSSymbols(initSymbol, symbol); + } + } + } + function resolveExternalModuleName(location2, moduleReferenceExpression, ignoreErrors) { + const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1; + const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; + return resolveExternalModuleNameWorker(location2, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage); + } + function resolveExternalModuleNameWorker(location2, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) { + return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location2, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0; + } + function resolveExternalModule(location2, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k; + if (startsWith2(moduleReference, "@types/")) { + const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1; + const withoutAtTypePrefix = removePrefix(moduleReference, "@types/"); + error22(errorNode, diag2, withoutAtTypePrefix, moduleReference); + } + const ambientModule = tryFindAmbientModule( + moduleReference, + /*withAugmentations*/ + true + ); + if (ambientModule) { + return ambientModule; + } + const currentSourceFile = getSourceFileOfNode(location2); + const contextSpecifier = isStringLiteralLike(location2) ? location2 : ((_a2 = isModuleDeclaration(location2) ? location2 : location2.parent && isModuleDeclaration(location2.parent) && location2.parent.name === location2 ? location2.parent : void 0) == null ? void 0 : _a2.name) || ((_b = isLiteralImportTypeNode(location2) ? location2 : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location2) && location2.initializer && isRequireCall( + location2.initializer, + /*requireStringLiteralLikeArgument*/ + true + ) ? location2.initializer.arguments[0] : void 0) || ((_c = findAncestor(location2, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location2, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e2 = findAncestor(location2, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e2.moduleReference.expression) || ((_f = findAncestor(location2, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier); + const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat; + const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions); + const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule; + const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile); + const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName); + if (sourceFile) { + if (resolutionDiagnostic) { + error22(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + } + if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) { + const importOrExport = ((_h = findAncestor(location2, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location2, or(isImportEqualsDeclaration, isExportDeclaration)); + if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location2, isImportCall)) { + error22( + errorNode, + Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead, + getSuggestedImportSource(Debug.checkDefined(tryExtractTSExtension(moduleReference))) + ); + } + } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) { + const importOrExport = ((_i = findAncestor(location2, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location2, or(isImportEqualsDeclaration, isExportDeclaration)); + if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location2, isImportTypeNode))) { + const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference)); + error22(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension); + } + } + if (sourceFile.symbol) { + if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) { + errorOnImplicitAnyModule( + /*isError*/ + false, + errorNode, + currentSourceFile, + mode, + resolvedModule, + moduleReference + ); + } + if (moduleResolutionKind === 3 || moduleResolutionKind === 99) { + const isSyncImport = currentSourceFile.impliedNodeFormat === 1 && !findAncestor(location2, isImportCall) || !!findAncestor(location2, isImportEqualsDeclaration); + const overrideHost = findAncestor(location2, (l7) => isImportTypeNode(l7) || isExportDeclaration(l7) || isImportDeclaration(l7)); + if (isSyncImport && sourceFile.impliedNodeFormat === 99 && !hasResolutionModeOverride(overrideHost)) { + if (findAncestor(location2, isImportEqualsDeclaration)) { + error22(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference); + } else { + let diagnosticDetails; + const ext = tryGetExtensionFromPath2(currentSourceFile.fileName); + if (ext === ".ts" || ext === ".js" || ext === ".tsx" || ext === ".jsx") { + const scope = currentSourceFile.packageJsonScope; + const targetExt = ext === ".ts" ? ".mts" : ext === ".js" ? ".mjs" : void 0; + if (scope && !scope.contents.packageJsonContent.type) { + if (targetExt) { + diagnosticDetails = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1, + targetExt, + combinePaths(scope.packageDirectory, "package.json") + ); + } else { + diagnosticDetails = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0, + combinePaths(scope.packageDirectory, "package.json") + ); + } + } else { + if (targetExt) { + diagnosticDetails = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module, + targetExt + ); + } else { + diagnosticDetails = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module + ); + } + } + } + diagnostics.add(createDiagnosticForNodeFromMessageChain( + getSourceFileOfNode(errorNode), + errorNode, + chainDiagnosticMessages( + diagnosticDetails, + Diagnostics.The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_referenced_file_is_an_ECMAScript_module_and_cannot_be_imported_with_require_Consider_writing_a_dynamic_import_0_call_instead, + moduleReference + ) + )); + } + } + } + return getMergedSymbol(sourceFile.symbol); + } + if (moduleNotFoundError) { + error22(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName); + } + return void 0; + } + if (patternAmbientModules) { + const pattern5 = findBestPatternMatch(patternAmbientModules, (_6) => _6.pattern, moduleReference); + if (pattern5) { + const augmentation = patternAmbientModuleAugmentations && patternAmbientModuleAugmentations.get(moduleReference); + if (augmentation) { + return getMergedSymbol(augmentation); + } + return getMergedSymbol(pattern5.symbol); + } + } + if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) { + if (isForAugmentation) { + const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; + error22(errorNode, diag2, moduleReference, resolvedModule.resolvedFileName); + } else { + errorOnImplicitAnyModule( + /*isError*/ + noImplicitAny && !!moduleNotFoundError, + errorNode, + currentSourceFile, + mode, + resolvedModule, + moduleReference + ); + } + return void 0; + } + if (moduleNotFoundError) { + if (resolvedModule) { + const redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName); + if (redirect) { + error22(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName); + return void 0; + } + } + if (resolutionDiagnostic) { + error22(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName); + } else { + const isExtensionlessRelativePathImport = pathIsRelative(moduleReference) && !hasExtension(moduleReference); + const resolutionIsNode16OrNext = moduleResolutionKind === 3 || moduleResolutionKind === 99; + if (!getResolveJsonModule(compilerOptions) && fileExtensionIs( + moduleReference, + ".json" + /* Json */ + ) && moduleResolutionKind !== 1 && hasJsonModuleEmitEnabled(compilerOptions)) { + error22(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference); + } else if (mode === 99 && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) { + const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path)); + const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1]; + if (suggestedExt) { + error22(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt); + } else { + error22(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path); + } + } else { + if ((_k = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _k.alternateResult) { + const errorInfo = createModuleNotFoundChain(currentSourceFile, host, moduleReference, mode, moduleReference); + errorOrSuggestion( + /*isError*/ + true, + errorNode, + chainDiagnosticMessages(errorInfo, moduleNotFoundError, moduleReference) + ); + } else { + error22(errorNode, moduleNotFoundError, moduleReference); + } + } + } + } + return void 0; + function getSuggestedImportSource(tsExtension) { + const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension); + if (emitModuleKindIsNonNodeESM(moduleKind) || mode === 99) { + const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions); + const ext = tsExtension === ".mts" || tsExtension === ".d.mts" ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" || tsExtension === ".d.mts" ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js"; + return importSourceWithoutExtension + ext; + } + return importSourceWithoutExtension; + } + } + function errorOnImplicitAnyModule(isError3, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) { + let errorInfo; + if (!isExternalModuleNameRelative(moduleReference) && packageId) { + errorInfo = createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageId.name); + } + errorOrSuggestion( + isError3, + errorNode, + chainDiagnosticMessages( + errorInfo, + Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, + moduleReference, + resolvedFileName + ) + ); + } + function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { + if (moduleSymbol == null ? void 0 : moduleSymbol.exports) { + const exportEquals = resolveSymbol(moduleSymbol.exports.get( + "export=" + /* ExportEquals */ + ), dontResolveAlias); + const exported = getCommonJsExportEquals(getMergedSymbol(exportEquals), getMergedSymbol(moduleSymbol)); + return getMergedSymbol(exported) || moduleSymbol; + } + return void 0; + } + function getCommonJsExportEquals(exported, moduleSymbol) { + if (!exported || exported === unknownSymbol || exported === moduleSymbol || moduleSymbol.exports.size === 1 || exported.flags & 2097152) { + return exported; + } + const links = getSymbolLinks(exported); + if (links.cjsExportMerged) { + return links.cjsExportMerged; + } + const merged = exported.flags & 33554432 ? exported : cloneSymbol2(exported); + merged.flags = merged.flags | 512; + if (merged.exports === void 0) { + merged.exports = createSymbolTable(); + } + moduleSymbol.exports.forEach((s7, name2) => { + if (name2 === "export=") + return; + merged.exports.set(name2, merged.exports.has(name2) ? mergeSymbol(merged.exports.get(name2), s7) : s7); + }); + if (merged === exported) { + getSymbolLinks(merged).resolvedExports = void 0; + getSymbolLinks(merged).resolvedMembers = void 0; + } + getSymbolLinks(merged).cjsExportMerged = merged; + return links.cjsExportMerged = merged; + } + function resolveESModuleSymbol(moduleSymbol, referencingLocation, dontResolveAlias, suppressInteropError) { + var _a2; + const symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); + if (!dontResolveAlias && symbol) { + if (!suppressInteropError && !(symbol.flags & (1536 | 3)) && !getDeclarationOfKind( + symbol, + 312 + /* SourceFile */ + )) { + const compilerOptionName = moduleKind >= 5 ? "allowSyntheticDefaultImports" : "esModuleInterop"; + error22(referencingLocation, Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export, compilerOptionName); + return symbol; + } + const referenceParent = referencingLocation.parent; + if (isImportDeclaration(referenceParent) && getNamespaceDeclarationNode(referenceParent) || isImportCall(referenceParent)) { + const reference = isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier; + const type3 = getTypeOfSymbol(symbol); + const defaultOnlyType = getTypeWithSyntheticDefaultOnly(type3, symbol, moduleSymbol, reference); + if (defaultOnlyType) { + return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent); + } + const targetFile = (_a2 = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile); + const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getUsageModeForExpression(reference), targetFile.impliedNodeFormat); + if (getESModuleInterop(compilerOptions) || isEsmCjsRef) { + let sigs = getSignaturesOfStructuredType( + type3, + 0 + /* Call */ + ); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType( + type3, + 1 + /* Construct */ + ); + } + if (sigs && sigs.length || getPropertyOfType( + type3, + "default", + /*skipObjectFunctionPropertyAugment*/ + true + ) || isEsmCjsRef) { + const moduleType = type3.flags & 3670016 ? getTypeWithSyntheticDefaultImportType(type3, symbol, moduleSymbol, reference) : createDefaultPropertyWrapperForModule(symbol, symbol.parent); + return cloneTypeAsModuleType(symbol, moduleType, referenceParent); + } + } + } + } + return symbol; + } + function cloneTypeAsModuleType(symbol, moduleType, referenceParent) { + const result2 = createSymbol(symbol.flags, symbol.escapedName); + result2.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result2.parent = symbol.parent; + result2.links.target = symbol; + result2.links.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result2.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result2.constEnumOnlyModule = true; + if (symbol.members) + result2.members = new Map(symbol.members); + if (symbol.exports) + result2.exports = new Map(symbol.exports); + const resolvedModuleType = resolveStructuredTypeMembers(moduleType); + result2.links.type = createAnonymousType(result2, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos); + return result2; + } + function hasExportAssignmentSymbol(moduleSymbol) { + return moduleSymbol.exports.get( + "export=" + /* ExportEquals */ + ) !== void 0; + } + function getExportsOfModuleAsArray(moduleSymbol) { + return symbolsToArray(getExportsOfModule(moduleSymbol)); + } + function getExportsAndPropertiesOfModule(moduleSymbol) { + const exports29 = getExportsOfModuleAsArray(moduleSymbol); + const exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + const type3 = getTypeOfSymbol(exportEquals); + if (shouldTreatPropertiesOfExternalModuleAsExports(type3)) { + addRange(exports29, getPropertiesOfType(type3)); + } + } + return exports29; + } + function forEachExportAndPropertyOfModule(moduleSymbol, cb) { + const exports29 = getExportsOfModule(moduleSymbol); + exports29.forEach((symbol, key) => { + if (!isReservedMemberName(key)) { + cb(symbol, key); + } + }); + const exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) { + const type3 = getTypeOfSymbol(exportEquals); + if (shouldTreatPropertiesOfExternalModuleAsExports(type3)) { + forEachPropertyOfType(type3, (symbol, escapedName) => { + cb(symbol, escapedName); + }); + } + } + } + function tryGetMemberInModuleExports(memberName, moduleSymbol) { + const symbolTable = getExportsOfModule(moduleSymbol); + if (symbolTable) { + return symbolTable.get(memberName); + } + } + function tryGetMemberInModuleExportsAndProperties(memberName, moduleSymbol) { + const symbol = tryGetMemberInModuleExports(memberName, moduleSymbol); + if (symbol) { + return symbol; + } + const exportEquals = resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals === moduleSymbol) { + return void 0; + } + const type3 = getTypeOfSymbol(exportEquals); + return shouldTreatPropertiesOfExternalModuleAsExports(type3) ? getPropertyOfType(type3, memberName) : void 0; + } + function shouldTreatPropertiesOfExternalModuleAsExports(resolvedExternalModuleType) { + return !(resolvedExternalModuleType.flags & 402784252 || getObjectFlags(resolvedExternalModuleType) & 1 || // `isArrayOrTupleLikeType` is too expensive to use in this auto-imports hot path + isArrayType(resolvedExternalModuleType) || isTupleType(resolvedExternalModuleType)); + } + function getExportsOfSymbol(symbol) { + return symbol.flags & 6256 ? getResolvedMembersOrExportsOfSymbol( + symbol, + "resolvedExports" + /* resolvedExports */ + ) : symbol.flags & 1536 ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; + } + function getExportsOfModule(moduleSymbol) { + const links = getSymbolLinks(moduleSymbol); + if (!links.resolvedExports) { + const { exports: exports29, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol); + links.resolvedExports = exports29; + links.typeOnlyExportStarMap = typeOnlyExportStarMap; + } + return links.resolvedExports; + } + function extendExportSymbols(target, source, lookupTable, exportNode) { + if (!source) + return; + source.forEach((sourceSymbol, id) => { + if (id === "default") + return; + const targetSymbol = target.get(id); + if (!targetSymbol) { + target.set(id, sourceSymbol); + if (lookupTable && exportNode) { + lookupTable.set(id, { + specifierText: getTextOfNode(exportNode.moduleSpecifier) + }); + } + } else if (lookupTable && exportNode && targetSymbol && resolveSymbol(targetSymbol) !== resolveSymbol(sourceSymbol)) { + const collisionTracker = lookupTable.get(id); + if (!collisionTracker.exportsWithDuplicate) { + collisionTracker.exportsWithDuplicate = [exportNode]; + } else { + collisionTracker.exportsWithDuplicate.push(exportNode); + } + } + }); + } + function getExportsOfModuleWorker(moduleSymbol) { + const visitedSymbols = []; + let typeOnlyExportStarMap; + const nonTypeOnlyNames = /* @__PURE__ */ new Set(); + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + const exports29 = visit7(moduleSymbol) || emptySymbols; + if (typeOnlyExportStarMap) { + nonTypeOnlyNames.forEach((name2) => typeOnlyExportStarMap.delete(name2)); + } + return { + exports: exports29, + typeOnlyExportStarMap + }; + function visit7(symbol, exportStar, isTypeOnly) { + if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) { + symbol.exports.forEach((_6, name2) => nonTypeOnlyNames.add(name2)); + } + if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) { + return; + } + const symbols = new Map(symbol.exports); + const exportStars = symbol.exports.get( + "__export" + /* ExportStar */ + ); + if (exportStars) { + const nestedSymbols = createSymbolTable(); + const lookupTable = /* @__PURE__ */ new Map(); + if (exportStars.declarations) { + for (const node of exportStars.declarations) { + const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + const exportedSymbols = visit7(resolvedModule, node, isTypeOnly || node.isTypeOnly); + extendExportSymbols( + nestedSymbols, + exportedSymbols, + lookupTable, + node + ); + } + } + lookupTable.forEach(({ exportsWithDuplicate }, id) => { + if (id === "export=" || !(exportsWithDuplicate && exportsWithDuplicate.length) || symbols.has(id)) { + return; + } + for (const node of exportsWithDuplicate) { + diagnostics.add(createDiagnosticForNode( + node, + Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity, + lookupTable.get(id).specifierText, + unescapeLeadingUnderscores(id) + )); + } + }); + extendExportSymbols(symbols, nestedSymbols); + } + if (exportStar == null ? void 0 : exportStar.isTypeOnly) { + typeOnlyExportStarMap ?? (typeOnlyExportStarMap = /* @__PURE__ */ new Map()); + symbols.forEach( + (_6, escapedName) => typeOnlyExportStarMap.set( + escapedName, + exportStar + ) + ); + } + return symbols; + } + } + function getMergedSymbol(symbol) { + let merged; + return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; + } + function getSymbolOfDeclaration(node) { + return getMergedSymbol(node.symbol && getLateBoundSymbol(node.symbol)); + } + function getSymbolOfNode(node) { + return canHaveSymbol(node) ? getSymbolOfDeclaration(node) : void 0; + } + function getParentOfSymbol(symbol) { + return getMergedSymbol(symbol.parent && getLateBoundSymbol(symbol.parent)); + } + function getFunctionExpressionParentSymbolOrSymbol(symbol) { + var _a2, _b; + return ((_a2 = symbol.valueDeclaration) == null ? void 0 : _a2.kind) === 219 || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 ? getSymbolOfNode(symbol.valueDeclaration.parent) || symbol : symbol; + } + function getAlternativeContainingModules(symbol, enclosingDeclaration) { + const containingFile = getSourceFileOfNode(enclosingDeclaration); + const id = getNodeId(containingFile); + const links = getSymbolLinks(symbol); + let results; + if (links.extendedContainersByFile && (results = links.extendedContainersByFile.get(id))) { + return results; + } + if (containingFile && containingFile.imports) { + for (const importRef of containingFile.imports) { + if (nodeIsSynthesized(importRef)) + continue; + const resolvedModule = resolveExternalModuleName( + enclosingDeclaration, + importRef, + /*ignoreErrors*/ + true + ); + if (!resolvedModule) + continue; + const ref = getAliasForSymbolInContainer(resolvedModule, symbol); + if (!ref) + continue; + results = append(results, resolvedModule); + } + if (length(results)) { + (links.extendedContainersByFile || (links.extendedContainersByFile = /* @__PURE__ */ new Map())).set(id, results); + return results; + } + } + if (links.extendedContainers) { + return links.extendedContainers; + } + const otherFiles = host.getSourceFiles(); + for (const file of otherFiles) { + if (!isExternalModule(file)) + continue; + const sym = getSymbolOfDeclaration(file); + const ref = getAliasForSymbolInContainer(sym, symbol); + if (!ref) + continue; + results = append(results, sym); + } + return links.extendedContainers = results || emptyArray; + } + function getContainersOfSymbol(symbol, enclosingDeclaration, meaning) { + const container = getParentOfSymbol(symbol); + if (container && !(symbol.flags & 262144)) { + return getWithAlternativeContainers(container); + } + const candidates = mapDefined(symbol.declarations, (d7) => { + if (!isAmbientModule(d7) && d7.parent) { + if (hasNonGlobalAugmentationExternalModuleSymbol(d7.parent)) { + return getSymbolOfDeclaration(d7.parent); + } + if (isModuleBlock(d7.parent) && d7.parent.parent && resolveExternalModuleSymbol(getSymbolOfDeclaration(d7.parent.parent)) === symbol) { + return getSymbolOfDeclaration(d7.parent.parent); + } + } + if (isClassExpression(d7) && isBinaryExpression(d7.parent) && d7.parent.operatorToken.kind === 64 && isAccessExpression(d7.parent.left) && isEntityNameExpression(d7.parent.left.expression)) { + if (isModuleExportsAccessExpression(d7.parent.left) || isExportsIdentifier(d7.parent.left.expression)) { + return getSymbolOfDeclaration(getSourceFileOfNode(d7)); + } + checkExpressionCached(d7.parent.left.expression); + return getNodeLinks(d7.parent.left.expression).resolvedSymbol; + } + }); + if (!length(candidates)) { + return void 0; + } + const containers = mapDefined(candidates, (candidate) => getAliasForSymbolInContainer(candidate, symbol) ? candidate : void 0); + let bestContainers = []; + let alternativeContainers = []; + for (const container2 of containers) { + const [bestMatch, ...rest2] = getWithAlternativeContainers(container2); + bestContainers = append(bestContainers, bestMatch); + alternativeContainers = addRange(alternativeContainers, rest2); + } + return concatenate(bestContainers, alternativeContainers); + function getWithAlternativeContainers(container2) { + const additionalContainers = mapDefined(container2.declarations, fileSymbolIfFileSymbolExportEqualsContainer); + const reexportContainers = enclosingDeclaration && getAlternativeContainingModules(symbol, enclosingDeclaration); + const objectLiteralContainer = getVariableDeclarationOfObjectLiteral(container2, meaning); + if (enclosingDeclaration && container2.flags & getQualifiedLeftMeaning(meaning) && getAccessibleSymbolChain( + container2, + enclosingDeclaration, + 1920, + /*useOnlyExternalAliasing*/ + false + )) { + return append(concatenate(concatenate([container2], additionalContainers), reexportContainers), objectLiteralContainer); + } + const firstVariableMatch = !(container2.flags & getQualifiedLeftMeaning(meaning)) && container2.flags & 788968 && getDeclaredTypeOfSymbol(container2).flags & 524288 && meaning === 111551 ? forEachSymbolTableInScope(enclosingDeclaration, (t8) => { + return forEachEntry(t8, (s7) => { + if (s7.flags & getQualifiedLeftMeaning(meaning) && getTypeOfSymbol(s7) === getDeclaredTypeOfSymbol(container2)) { + return s7; + } + }); + }) : void 0; + let res = firstVariableMatch ? [firstVariableMatch, ...additionalContainers, container2] : [...additionalContainers, container2]; + res = append(res, objectLiteralContainer); + res = addRange(res, reexportContainers); + return res; + } + function fileSymbolIfFileSymbolExportEqualsContainer(d7) { + return container && getFileSymbolIfFileSymbolExportEqualsContainer(d7, container); + } + } + function getVariableDeclarationOfObjectLiteral(symbol, meaning) { + const firstDecl = !!length(symbol.declarations) && first(symbol.declarations); + if (meaning & 111551 && firstDecl && firstDecl.parent && isVariableDeclaration(firstDecl.parent)) { + if (isObjectLiteralExpression(firstDecl) && firstDecl === firstDecl.parent.initializer || isTypeLiteralNode(firstDecl) && firstDecl === firstDecl.parent.type) { + return getSymbolOfDeclaration(firstDecl.parent); + } + } + } + function getFileSymbolIfFileSymbolExportEqualsContainer(d7, container) { + const fileSymbol = getExternalModuleContainer(d7); + const exported = fileSymbol && fileSymbol.exports && fileSymbol.exports.get( + "export=" + /* ExportEquals */ + ); + return exported && getSymbolIfSameReference(exported, container) ? fileSymbol : void 0; + } + function getAliasForSymbolInContainer(container, symbol) { + if (container === getParentOfSymbol(symbol)) { + return symbol; + } + const exportEquals = container.exports && container.exports.get( + "export=" + /* ExportEquals */ + ); + if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) { + return container; + } + const exports29 = getExportsOfSymbol(container); + const quick = exports29.get(symbol.escapedName); + if (quick && getSymbolIfSameReference(quick, symbol)) { + return quick; + } + return forEachEntry(exports29, (exported) => { + if (getSymbolIfSameReference(exported, symbol)) { + return exported; + } + }); + } + function getSymbolIfSameReference(s1, s22) { + if (getMergedSymbol(resolveSymbol(getMergedSymbol(s1))) === getMergedSymbol(resolveSymbol(getMergedSymbol(s22)))) { + return s1; + } + } + function getExportSymbolOfValueSymbolIfExported(symbol) { + return getMergedSymbol(symbol && (symbol.flags & 1048576) !== 0 && symbol.exportSymbol || symbol); + } + function symbolIsValue(symbol, includeTypeOnlyMembers) { + return !!(symbol.flags & 111551 || symbol.flags & 2097152 && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551); + } + function findConstructorDeclaration(node) { + const members = node.members; + for (const member of members) { + if (member.kind === 176 && nodeIsPresent(member.body)) { + return member; + } + } + } + function createType(flags) { + var _a2; + const result2 = new Type28(checker, flags); + typeCount++; + result2.id = typeCount; + (_a2 = tracing) == null ? void 0 : _a2.recordType(result2); + return result2; + } + function createTypeWithSymbol(flags, symbol) { + const result2 = createType(flags); + result2.symbol = symbol; + return result2; + } + function createOriginType(flags) { + return new Type28(checker, flags); + } + function createIntrinsicType(kind, intrinsicName, objectFlags = 0, debugIntrinsicName) { + checkIntrinsicName(intrinsicName, debugIntrinsicName); + const type3 = createType(kind); + type3.intrinsicName = intrinsicName; + type3.debugIntrinsicName = debugIntrinsicName; + type3.objectFlags = objectFlags | 524288 | 2097152 | 33554432 | 16777216; + return type3; + } + function checkIntrinsicName(name2, debug2) { + const key = `${name2},${debug2 ?? ""}`; + if (seenIntrinsicNames.has(key)) { + Debug.fail(`Duplicate intrinsic type name ${name2}${debug2 ? ` (${debug2})` : ""}; you may need to pass a name to createIntrinsicType.`); + } + seenIntrinsicNames.add(key); + } + function createObjectType(objectFlags, symbol) { + const type3 = createTypeWithSymbol(524288, symbol); + type3.objectFlags = objectFlags; + type3.members = void 0; + type3.properties = void 0; + type3.callSignatures = void 0; + type3.constructSignatures = void 0; + type3.indexInfos = void 0; + return type3; + } + function createTypeofType() { + return getUnionType(arrayFrom(typeofNEFacts.keys(), getStringLiteralType)); + } + function createTypeParameter(symbol) { + return createTypeWithSymbol(262144, symbol); + } + function isReservedMemberName(name2) { + return name2.charCodeAt(0) === 95 && name2.charCodeAt(1) === 95 && name2.charCodeAt(2) !== 95 && name2.charCodeAt(2) !== 64 && name2.charCodeAt(2) !== 35; + } + function getNamedMembers(members) { + let result2; + members.forEach((symbol, id) => { + if (isNamedMember(symbol, id)) { + (result2 || (result2 = [])).push(symbol); + } + }); + return result2 || emptyArray; + } + function isNamedMember(member, escapedName) { + return !isReservedMemberName(escapedName) && symbolIsValue(member); + } + function getNamedOrIndexSignatureMembers(members) { + const result2 = getNamedMembers(members); + const index4 = getIndexSymbolFromSymbolTable(members); + return index4 ? concatenate(result2, [index4]) : result2; + } + function setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos) { + const resolved = type3; + resolved.members = members; + resolved.properties = emptyArray; + resolved.callSignatures = callSignatures; + resolved.constructSignatures = constructSignatures; + resolved.indexInfos = indexInfos; + if (members !== emptySymbols) + resolved.properties = getNamedMembers(members); + return resolved; + } + function createAnonymousType(symbol, members, callSignatures, constructSignatures, indexInfos) { + return setStructuredTypeMembers(createObjectType(16, symbol), members, callSignatures, constructSignatures, indexInfos); + } + function getResolvedTypeWithoutAbstractConstructSignatures(type3) { + if (type3.constructSignatures.length === 0) + return type3; + if (type3.objectTypeWithoutAbstractConstructSignatures) + return type3.objectTypeWithoutAbstractConstructSignatures; + const constructSignatures = filter2(type3.constructSignatures, (signature) => !(signature.flags & 4)); + if (type3.constructSignatures === constructSignatures) + return type3; + const typeCopy = createAnonymousType( + type3.symbol, + type3.members, + type3.callSignatures, + some2(constructSignatures) ? constructSignatures : emptyArray, + type3.indexInfos + ); + type3.objectTypeWithoutAbstractConstructSignatures = typeCopy; + typeCopy.objectTypeWithoutAbstractConstructSignatures = typeCopy; + return typeCopy; + } + function forEachSymbolTableInScope(enclosingDeclaration, callback) { + let result2; + for (let location2 = enclosingDeclaration; location2; location2 = location2.parent) { + if (canHaveLocals(location2) && location2.locals && !isGlobalSourceFile(location2)) { + if (result2 = callback( + location2.locals, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true, + location2 + )) { + return result2; + } + } + switch (location2.kind) { + case 312: + if (!isExternalOrCommonJsModule(location2)) { + break; + } + case 267: + const sym = getSymbolOfDeclaration(location2); + if (result2 = callback( + (sym == null ? void 0 : sym.exports) || emptySymbols, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true, + location2 + )) { + return result2; + } + break; + case 263: + case 231: + case 264: + let table2; + (getSymbolOfDeclaration(location2).members || emptySymbols).forEach((memberSymbol, key) => { + if (memberSymbol.flags & (788968 & ~67108864)) { + (table2 || (table2 = createSymbolTable())).set(key, memberSymbol); + } + }); + if (table2 && (result2 = callback( + table2, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + false, + location2 + ))) { + return result2; + } + break; + } + } + return callback( + globals3, + /*ignoreQualification*/ + void 0, + /*isLocalNameLookup*/ + true + ); + } + function getQualifiedLeftMeaning(rightMeaning) { + return rightMeaning === 111551 ? 111551 : 1920; + } + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap = /* @__PURE__ */ new Map()) { + if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { + return void 0; + } + const links = getSymbolLinks(symbol); + const cache = links.accessibleChainCache || (links.accessibleChainCache = /* @__PURE__ */ new Map()); + const firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, (_6, __, ___, node) => node); + const key = `${useOnlyExternalAliasing ? 0 : 1}|${firstRelevantLocation && getNodeId(firstRelevantLocation)}|${meaning}`; + if (cache.has(key)) { + return cache.get(key); + } + const id = getSymbolId(symbol); + let visitedSymbolTables = visitedSymbolTablesMap.get(id); + if (!visitedSymbolTables) { + visitedSymbolTablesMap.set(id, visitedSymbolTables = []); + } + const result2 = forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); + cache.set(key, result2); + return result2; + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification, isLocalNameLookup) { + if (!pushIfUnique(visitedSymbolTables, symbols)) { + return void 0; + } + const result22 = trySymbolTable(symbols, ignoreQualification, isLocalNameLookup); + visitedSymbolTables.pop(); + return result22; + } + function canQualifySymbol(symbolFromSymbolTable, meaning2) { + return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning2) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too + !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning2), useOnlyExternalAliasing, visitedSymbolTablesMap); + } + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { + return (symbol === (resolvedAliasSymbol || symbolFromSymbolTable) || getMergedSymbol(symbol) === getMergedSymbol(resolvedAliasSymbol || symbolFromSymbolTable)) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) + // and if symbolFromSymbolTable or alias resolution matches the symbol, + // check the symbol can be qualified, it is only then this symbol is accessible + !some2(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) && (ignoreQualification || canQualifySymbol(getMergedSymbol(symbolFromSymbolTable), meaning)); + } + function trySymbolTable(symbols, ignoreQualification, isLocalNameLookup) { + if (isAccessible( + symbols.get(symbol.escapedName), + /*resolvedAliasSymbol*/ + void 0, + ignoreQualification + )) { + return [symbol]; + } + const result22 = forEachEntry(symbols, (symbolFromSymbolTable) => { + if (symbolFromSymbolTable.flags & 2097152 && symbolFromSymbolTable.escapedName !== "export=" && symbolFromSymbolTable.escapedName !== "default" && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || some2(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) && (isLocalNameLookup ? !some2(symbolFromSymbolTable.declarations, isNamespaceReexportDeclaration) : true) && (ignoreQualification || !getDeclarationOfKind( + symbolFromSymbolTable, + 281 + /* ExportSpecifier */ + ))) { + const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); + const candidate = getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification); + if (candidate) { + return candidate; + } + } + if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) { + if (isAccessible( + getMergedSymbol(symbolFromSymbolTable.exportSymbol), + /*resolvedAliasSymbol*/ + void 0, + ignoreQualification + )) { + return [symbol]; + } + } + }); + return result22 || (symbols === globals3 ? getCandidateListForSymbol(globalThisSymbol, globalThisSymbol, ignoreQualification) : void 0); + } + function getCandidateListForSymbol(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { + return [symbolFromSymbolTable]; + } + const candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + const accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable( + candidateTable, + /*ignoreQualification*/ + true + ); + if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { + return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); + } + } + } + function needsQualification(symbol, enclosingDeclaration, meaning) { + let qualify = false; + forEachSymbolTableInScope(enclosingDeclaration, (symbolTable) => { + let symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName)); + if (!symbolFromSymbolTable) { + return false; + } + if (symbolFromSymbolTable === symbol) { + return true; + } + const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 && !getDeclarationOfKind( + symbolFromSymbolTable, + 281 + /* ExportSpecifier */ + ); + symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags; + if (flags & meaning) { + qualify = true; + return true; + } + return false; + }); + return qualify; + } + function isPropertyOrMethodDeclarationSymbol(symbol) { + if (symbol.declarations && symbol.declarations.length) { + for (const declaration of symbol.declarations) { + switch (declaration.kind) { + case 172: + case 174: + case 177: + case 178: + continue; + default: + return false; + } + } + return true; + } + return false; + } + function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { + const access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + 788968, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + true + ); + return access2.accessibility === 0; + } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + const access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + 111551, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + true + ); + return access2.accessibility === 0; + } + function isSymbolAccessibleByFlags(typeSymbol, enclosingDeclaration, flags) { + const access2 = isSymbolAccessibleWorker( + typeSymbol, + enclosingDeclaration, + flags, + /*shouldComputeAliasesToMakeVisible*/ + false, + /*allowModules*/ + false + ); + return access2.accessibility === 0; + } + function isAnySymbolAccessible(symbols, enclosingDeclaration, initialSymbol, meaning, shouldComputeAliasesToMakeVisible, allowModules) { + if (!length(symbols)) + return; + let hadAccessibleChain; + let earlyModuleBail = false; + for (const symbol of symbols) { + const accessibleSymbolChain = getAccessibleSymbolChain( + symbol, + enclosingDeclaration, + meaning, + /*useOnlyExternalAliasing*/ + false + ); + if (accessibleSymbolChain) { + hadAccessibleChain = symbol; + const hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0], shouldComputeAliasesToMakeVisible); + if (hasAccessibleDeclarations) { + return hasAccessibleDeclarations; + } + } + if (allowModules) { + if (some2(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + if (shouldComputeAliasesToMakeVisible) { + earlyModuleBail = true; + continue; + } + return { + accessibility: 0 + /* Accessible */ + }; + } + } + const containers = getContainersOfSymbol(symbol, enclosingDeclaration, meaning); + const parentResult = isAnySymbolAccessible(containers, enclosingDeclaration, initialSymbol, initialSymbol === symbol ? getQualifiedLeftMeaning(meaning) : meaning, shouldComputeAliasesToMakeVisible, allowModules); + if (parentResult) { + return parentResult; + } + } + if (earlyModuleBail) { + return { + accessibility: 0 + /* Accessible */ + }; + } + if (hadAccessibleChain) { + return { + accessibility: 1, + errorSymbolName: symbolToString2(initialSymbol, enclosingDeclaration, meaning), + errorModuleName: hadAccessibleChain !== initialSymbol ? symbolToString2( + hadAccessibleChain, + enclosingDeclaration, + 1920 + /* Namespace */ + ) : void 0 + }; + } + } + function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { + return isSymbolAccessibleWorker( + symbol, + enclosingDeclaration, + meaning, + shouldComputeAliasesToMakeVisible, + /*allowModules*/ + true + ); + } + function isSymbolAccessibleWorker(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible, allowModules) { + if (symbol && enclosingDeclaration) { + const result2 = isAnySymbolAccessible([symbol], enclosingDeclaration, symbol, meaning, shouldComputeAliasesToMakeVisible, allowModules); + if (result2) { + return result2; + } + const symbolExternalModule = forEach4(symbol.declarations, getExternalModuleContainer); + if (symbolExternalModule) { + const enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); + if (symbolExternalModule !== enclosingExternalModule) { + return { + accessibility: 2, + errorSymbolName: symbolToString2(symbol, enclosingDeclaration, meaning), + errorModuleName: symbolToString2(symbolExternalModule), + errorNode: isInJSFile(enclosingDeclaration) ? enclosingDeclaration : void 0 + }; + } + } + return { + accessibility: 1, + errorSymbolName: symbolToString2(symbol, enclosingDeclaration, meaning) + }; + } + return { + accessibility: 0 + /* Accessible */ + }; + } + function getExternalModuleContainer(declaration) { + const node = findAncestor(declaration, hasExternalModuleSymbol); + return node && getSymbolOfDeclaration(node); + } + function hasExternalModuleSymbol(declaration) { + return isAmbientModule(declaration) || declaration.kind === 312 && isExternalOrCommonJsModule(declaration); + } + function hasNonGlobalAugmentationExternalModuleSymbol(declaration) { + return isModuleWithStringLiteralName(declaration) || declaration.kind === 312 && isExternalOrCommonJsModule(declaration); + } + function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { + let aliasesToMakeVisible; + if (!every2(filter2( + symbol.declarations, + (d7) => d7.kind !== 80 + /* Identifier */ + ), getIsDeclarationVisible)) { + return void 0; + } + return { accessibility: 0, aliasesToMakeVisible }; + function getIsDeclarationVisible(declaration) { + var _a2, _b; + if (!isDeclarationVisible(declaration)) { + const anyImportSyntax = getAnyImportSyntax(declaration); + if (anyImportSyntax && !hasSyntacticModifier( + anyImportSyntax, + 32 + /* Export */ + ) && // import clause without export + isDeclarationVisible(anyImportSyntax.parent)) { + return addVisibleAlias(declaration, anyImportSyntax); + } else if (isVariableDeclaration(declaration) && isVariableStatement(declaration.parent.parent) && !hasSyntacticModifier( + declaration.parent.parent, + 32 + /* Export */ + ) && // unexported variable statement + isDeclarationVisible(declaration.parent.parent.parent)) { + return addVisibleAlias(declaration, declaration.parent.parent); + } else if (isLateVisibilityPaintedStatement(declaration) && !hasSyntacticModifier( + declaration, + 32 + /* Export */ + ) && isDeclarationVisible(declaration.parent)) { + return addVisibleAlias(declaration, declaration); + } else if (isBindingElement(declaration)) { + if (symbol.flags & 2097152 && isInJSFile(declaration) && ((_a2 = declaration.parent) == null ? void 0 : _a2.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier( + declaration.parent.parent.parent.parent, + 32 + /* Export */ + ) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) { + return addVisibleAlias(declaration, declaration.parent.parent.parent.parent); + } else if (symbol.flags & 2) { + const variableStatement = findAncestor(declaration, isVariableStatement); + if (hasSyntacticModifier( + variableStatement, + 32 + /* Export */ + )) { + return true; + } + if (!isDeclarationVisible(variableStatement.parent)) { + return false; + } + return addVisibleAlias(declaration, variableStatement); + } + } + return false; + } + return true; + } + function addVisibleAlias(declaration, aliasingStatement) { + if (shouldComputeAliasToMakeVisible) { + getNodeLinks(declaration).isVisible = true; + aliasesToMakeVisible = appendIfUnique(aliasesToMakeVisible, aliasingStatement); + } + return true; + } + } + function getMeaningOfEntityNameReference(entityName) { + let meaning; + if (entityName.parent.kind === 186 || entityName.parent.kind === 233 && !isPartOfTypeNode(entityName.parent) || entityName.parent.kind === 167) { + meaning = 111551 | 1048576; + } else if (entityName.kind === 166 || entityName.kind === 211 || entityName.parent.kind === 271 || entityName.parent.kind === 166 && entityName.parent.left === entityName || entityName.parent.kind === 211 && entityName.parent.expression === entityName || entityName.parent.kind === 212 && entityName.parent.expression === entityName) { + meaning = 1920; + } else { + meaning = 788968; + } + return meaning; + } + function isEntityNameVisible(entityName, enclosingDeclaration) { + const meaning = getMeaningOfEntityNameReference(entityName); + const firstIdentifier = getFirstIdentifier(entityName); + const symbol = resolveName( + enclosingDeclaration, + firstIdentifier.escapedText, + meaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + if (symbol && symbol.flags & 262144 && meaning & 788968) { + return { + accessibility: 0 + /* Accessible */ + }; + } + if (!symbol && isThisIdentifier(firstIdentifier) && isSymbolAccessible( + getSymbolOfDeclaration(getThisContainer( + firstIdentifier, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + )), + firstIdentifier, + meaning, + /*shouldComputeAliasesToMakeVisible*/ + false + ).accessibility === 0) { + return { + accessibility: 0 + /* Accessible */ + }; + } + return symbol && hasVisibleDeclarations( + symbol, + /*shouldComputeAliasToMakeVisible*/ + true + ) || { + accessibility: 1, + errorSymbolName: getTextOfNode(firstIdentifier), + errorNode: firstIdentifier + }; + } + function symbolToString2(symbol, enclosingDeclaration, meaning, flags = 4, writer) { + let nodeFlags = 70221824; + if (flags & 2) { + nodeFlags |= 128; + } + if (flags & 1) { + nodeFlags |= 512; + } + if (flags & 8) { + nodeFlags |= 16384; + } + if (flags & 32) { + nodeFlags |= 134217728; + } + if (flags & 16) { + nodeFlags |= 1073741824; + } + const builder = flags & 4 ? nodeBuilder.symbolToNode : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer2) { + const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 312 ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments(); + const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + entity, + /*sourceFile*/ + sourceFile, + writer2 + ); + return writer2; + } + } + function signatureToString(signature, enclosingDeclaration, flags = 0, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer2) { + let sigOutput; + if (flags & 262144) { + sigOutput = kind === 1 ? 185 : 184; + } else { + sigOutput = kind === 1 ? 180 : 179; + } + const sig = nodeBuilder.signatureToSignatureDeclaration( + signature, + sigOutput, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 | 512 + /* WriteTypeParametersInQualifiedName */ + ); + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); + const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + sig, + /*sourceFile*/ + sourceFile, + getTrailingSemicolonDeferringWriter(writer2) + ); + return writer2; + } + } + function typeToString(type3, enclosingDeclaration, flags = 1048576 | 16384, writer = createTextWriter("")) { + const noTruncation = compilerOptions.noErrorTruncation || flags & 1; + const typeNode = nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | (noTruncation ? 1 : 0)); + if (typeNode === void 0) + return Debug.fail("should always get typenode"); + const printer = type3 !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults(); + const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + typeNode, + /*sourceFile*/ + sourceFile, + writer + ); + const result2 = writer.getText(); + const maxLength2 = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2; + if (maxLength2 && result2 && result2.length >= maxLength2) { + return result2.substr(0, maxLength2 - "...".length) + "..."; + } + return result2; + } + function getTypeNamesForErrorDisplay(left, right) { + let leftStr = symbolValueDeclarationIsContextSensitive(left.symbol) ? typeToString(left, left.symbol.valueDeclaration) : typeToString(left); + let rightStr = symbolValueDeclarationIsContextSensitive(right.symbol) ? typeToString(right, right.symbol.valueDeclaration) : typeToString(right); + if (leftStr === rightStr) { + leftStr = getTypeNameForErrorDisplay(left); + rightStr = getTypeNameForErrorDisplay(right); + } + return [leftStr, rightStr]; + } + function getTypeNameForErrorDisplay(type3) { + return typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 64 + /* UseFullyQualifiedType */ + ); + } + function symbolValueDeclarationIsContextSensitive(symbol) { + return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration); + } + function toNodeBuilderFlags(flags = 0) { + return flags & 848330095; + } + function isClassInstanceSide(type3) { + return !!type3.symbol && !!(type3.symbol.flags & 32) && (type3 === getDeclaredTypeOfClassOrInterface(type3.symbol) || !!(type3.flags & 524288) && !!(getObjectFlags(type3) & 16777216)); + } + function createNodeBuilder() { + return { + typeToTypeNode: (type3, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => typeToTypeNodeHelper(type3, context2)), + indexInfoToIndexSignatureDeclaration: (indexInfo, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => indexInfoToIndexSignatureDeclarationHelper( + indexInfo, + context2, + /*typeNode*/ + void 0 + )), + signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => signatureToSignatureDeclarationHelper(signature, kind, context2)), + symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => symbolToName( + symbol, + context2, + meaning, + /*expectsIdentifier*/ + false + )), + symbolToExpression: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => symbolToExpression(symbol, context2, meaning)), + symbolToTypeParameterDeclarations: (symbol, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => typeParametersToTypeParameterDeclarations(symbol, context2)), + symbolToParameterDeclaration: (symbol, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => symbolToParameterDeclaration(symbol, context2)), + typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => typeParameterToDeclaration(parameter, context2)), + symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, tracker, bundled) => withContext(enclosingDeclaration, flags, tracker, (context2) => symbolTableToDeclarationStatements(symbolTable, context2, bundled)), + symbolToNode: (symbol, meaning, enclosingDeclaration, flags, tracker) => withContext(enclosingDeclaration, flags, tracker, (context2) => symbolToNode(symbol, context2, meaning)) + }; + function symbolToNode(symbol, context2, meaning) { + if (context2.flags & 1073741824) { + if (symbol.valueDeclaration) { + const name2 = getNameOfDeclaration(symbol.valueDeclaration); + if (name2 && isComputedPropertyName(name2)) + return name2; + } + const nameType = getSymbolLinks(symbol).nameType; + if (nameType && nameType.flags & (1024 | 8192)) { + context2.enclosingDeclaration = nameType.symbol.valueDeclaration; + return factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context2, meaning)); + } + } + return symbolToExpression(symbol, context2, meaning); + } + function withContext(enclosingDeclaration, flags, tracker, cb) { + Debug.assert(enclosingDeclaration === void 0 || (enclosingDeclaration.flags & 16) === 0); + const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : flags & 134217728 ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0; + const context2 = { + enclosingDeclaration, + flags: flags || 0, + tracker: void 0, + encounteredError: false, + reportedDiagnostic: false, + visitedTypes: void 0, + symbolDepth: void 0, + inferTypeParameters: void 0, + approximateLength: 0, + trackedSymbols: void 0 + }; + context2.tracker = new SymbolTrackerImpl(context2, tracker, moduleResolverHost); + const resultingNode = cb(context2); + if (context2.truncating && context2.flags & 1) { + context2.tracker.reportTruncationError(); + } + return context2.encounteredError ? void 0 : resultingNode; + } + function checkTruncationLength(context2) { + if (context2.truncating) + return context2.truncating; + return context2.truncating = context2.approximateLength > (context2.flags & 1 ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength); + } + function typeToTypeNodeHelper(type3, context2) { + const savedFlags = context2.flags; + const typeNode = typeToTypeNodeWorker(type3, context2); + context2.flags = savedFlags; + return typeNode; + } + function typeToTypeNodeWorker(type3, context2) { + var _a2, _b; + if (cancellationToken && cancellationToken.throwIfCancellationRequested) { + cancellationToken.throwIfCancellationRequested(); + } + const inTypeAlias = context2.flags & 8388608; + context2.flags &= ~8388608; + if (!type3) { + if (!(context2.flags & 262144)) { + context2.encounteredError = true; + return void 0; + } + context2.approximateLength += 3; + return factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + if (!(context2.flags & 536870912)) { + type3 = getReducedType(type3); + } + if (type3.flags & 1) { + if (type3.aliasSymbol) { + return factory.createTypeReferenceNode(symbolToEntityNameNode(type3.aliasSymbol), mapToTypeNodes(type3.aliasTypeArguments, context2)); + } + if (type3 === unresolvedType) { + return addSyntheticLeadingComment(factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ), 3, "unresolved"); + } + context2.approximateLength += 3; + return factory.createKeywordTypeNode( + type3 === intrinsicMarkerType ? 141 : 133 + /* AnyKeyword */ + ); + } + if (type3.flags & 2) { + return factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ); + } + if (type3.flags & 4) { + context2.approximateLength += 6; + return factory.createKeywordTypeNode( + 154 + /* StringKeyword */ + ); + } + if (type3.flags & 8) { + context2.approximateLength += 6; + return factory.createKeywordTypeNode( + 150 + /* NumberKeyword */ + ); + } + if (type3.flags & 64) { + context2.approximateLength += 6; + return factory.createKeywordTypeNode( + 163 + /* BigIntKeyword */ + ); + } + if (type3.flags & 16 && !type3.aliasSymbol) { + context2.approximateLength += 7; + return factory.createKeywordTypeNode( + 136 + /* BooleanKeyword */ + ); + } + if (type3.flags & 1056) { + if (type3.symbol.flags & 8) { + const parentSymbol = getParentOfSymbol(type3.symbol); + const parentName = symbolToTypeNode( + parentSymbol, + context2, + 788968 + /* Type */ + ); + if (getDeclaredTypeOfSymbol(parentSymbol) === type3) { + return parentName; + } + const memberName = symbolName(type3.symbol); + if (isIdentifierText( + memberName, + 0 + /* ES3 */ + )) { + return appendReferenceToType( + parentName, + factory.createTypeReferenceNode( + memberName, + /*typeArguments*/ + void 0 + ) + ); + } + if (isImportTypeNode(parentName)) { + parentName.isTypeOf = true; + return factory.createIndexedAccessTypeNode(parentName, factory.createLiteralTypeNode(factory.createStringLiteral(memberName))); + } else if (isTypeReferenceNode(parentName)) { + return factory.createIndexedAccessTypeNode(factory.createTypeQueryNode(parentName.typeName), factory.createLiteralTypeNode(factory.createStringLiteral(memberName))); + } else { + return Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`."); + } + } + return symbolToTypeNode( + type3.symbol, + context2, + 788968 + /* Type */ + ); + } + if (type3.flags & 128) { + context2.approximateLength += type3.value.length + 2; + return factory.createLiteralTypeNode(setEmitFlags( + factory.createStringLiteral(type3.value, !!(context2.flags & 268435456)), + 16777216 + /* NoAsciiEscaping */ + )); + } + if (type3.flags & 256) { + const value2 = type3.value; + context2.approximateLength += ("" + value2).length; + return factory.createLiteralTypeNode(value2 < 0 ? factory.createPrefixUnaryExpression(41, factory.createNumericLiteral(-value2)) : factory.createNumericLiteral(value2)); + } + if (type3.flags & 2048) { + context2.approximateLength += pseudoBigIntToString(type3.value).length + 1; + return factory.createLiteralTypeNode(factory.createBigIntLiteral(type3.value)); + } + if (type3.flags & 512) { + context2.approximateLength += type3.intrinsicName.length; + return factory.createLiteralTypeNode(type3.intrinsicName === "true" ? factory.createTrue() : factory.createFalse()); + } + if (type3.flags & 8192) { + if (!(context2.flags & 1048576)) { + if (isValueSymbolAccessible(type3.symbol, context2.enclosingDeclaration)) { + context2.approximateLength += 6; + return symbolToTypeNode( + type3.symbol, + context2, + 111551 + /* Value */ + ); + } + if (context2.tracker.reportInaccessibleUniqueSymbolError) { + context2.tracker.reportInaccessibleUniqueSymbolError(); + } + } + context2.approximateLength += 13; + return factory.createTypeOperatorNode(158, factory.createKeywordTypeNode( + 155 + /* SymbolKeyword */ + )); + } + if (type3.flags & 16384) { + context2.approximateLength += 4; + return factory.createKeywordTypeNode( + 116 + /* VoidKeyword */ + ); + } + if (type3.flags & 32768) { + context2.approximateLength += 9; + return factory.createKeywordTypeNode( + 157 + /* UndefinedKeyword */ + ); + } + if (type3.flags & 65536) { + context2.approximateLength += 4; + return factory.createLiteralTypeNode(factory.createNull()); + } + if (type3.flags & 131072) { + context2.approximateLength += 5; + return factory.createKeywordTypeNode( + 146 + /* NeverKeyword */ + ); + } + if (type3.flags & 4096) { + context2.approximateLength += 6; + return factory.createKeywordTypeNode( + 155 + /* SymbolKeyword */ + ); + } + if (type3.flags & 67108864) { + context2.approximateLength += 6; + return factory.createKeywordTypeNode( + 151 + /* ObjectKeyword */ + ); + } + if (isThisTypeParameter(type3)) { + if (context2.flags & 4194304) { + if (!context2.encounteredError && !(context2.flags & 32768)) { + context2.encounteredError = true; + } + (_b = (_a2 = context2.tracker).reportInaccessibleThisError) == null ? void 0 : _b.call(_a2); + } + context2.approximateLength += 4; + return factory.createThisTypeNode(); + } + if (!inTypeAlias && type3.aliasSymbol && (context2.flags & 16384 || isTypeSymbolAccessible(type3.aliasSymbol, context2.enclosingDeclaration))) { + const typeArgumentNodes = mapToTypeNodes(type3.aliasTypeArguments, context2); + if (isReservedMemberName(type3.aliasSymbol.escapedName) && !(type3.aliasSymbol.flags & 32)) + return factory.createTypeReferenceNode(factory.createIdentifier(""), typeArgumentNodes); + if (length(typeArgumentNodes) === 1 && type3.aliasSymbol === globalArrayType.symbol) { + return factory.createArrayTypeNode(typeArgumentNodes[0]); + } + return symbolToTypeNode(type3.aliasSymbol, context2, 788968, typeArgumentNodes); + } + const objectFlags = getObjectFlags(type3); + if (objectFlags & 4) { + Debug.assert(!!(type3.flags & 524288)); + return type3.node ? visitAndTransformType(type3, typeReferenceToTypeNode) : typeReferenceToTypeNode(type3); + } + if (type3.flags & 262144 || objectFlags & 3) { + if (type3.flags & 262144 && contains2(context2.inferTypeParameters, type3)) { + context2.approximateLength += symbolName(type3.symbol).length + 6; + let constraintNode; + const constraint = getConstraintOfTypeParameter(type3); + if (constraint) { + const inferredConstraint = getInferredTypeParameterConstraint( + type3, + /*omitTypeReferences*/ + true + ); + if (!(inferredConstraint && isTypeIdenticalTo(constraint, inferredConstraint))) { + context2.approximateLength += 9; + constraintNode = constraint && typeToTypeNodeHelper(constraint, context2); + } + } + return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type3, context2, constraintNode)); + } + if (context2.flags & 4 && type3.flags & 262144) { + const name22 = typeParameterToName(type3, context2); + context2.approximateLength += idText(name22).length; + return factory.createTypeReferenceNode( + factory.createIdentifier(idText(name22)), + /*typeArguments*/ + void 0 + ); + } + if (type3.symbol) { + return symbolToTypeNode( + type3.symbol, + context2, + 788968 + /* Type */ + ); + } + const name2 = (type3 === markerSuperTypeForCheck || type3 === markerSubTypeForCheck) && varianceTypeParameter && varianceTypeParameter.symbol ? (type3 === markerSubTypeForCheck ? "sub-" : "super-") + symbolName(varianceTypeParameter.symbol) : "?"; + return factory.createTypeReferenceNode( + factory.createIdentifier(name2), + /*typeArguments*/ + void 0 + ); + } + if (type3.flags & 1048576 && type3.origin) { + type3 = type3.origin; + } + if (type3.flags & (1048576 | 2097152)) { + const types3 = type3.flags & 1048576 ? formatUnionTypes(type3.types) : type3.types; + if (length(types3) === 1) { + return typeToTypeNodeHelper(types3[0], context2); + } + const typeNodes = mapToTypeNodes( + types3, + context2, + /*isBareList*/ + true + ); + if (typeNodes && typeNodes.length > 0) { + return type3.flags & 1048576 ? factory.createUnionTypeNode(typeNodes) : factory.createIntersectionTypeNode(typeNodes); + } else { + if (!context2.encounteredError && !(context2.flags & 262144)) { + context2.encounteredError = true; + } + return void 0; + } + } + if (objectFlags & (16 | 32)) { + Debug.assert(!!(type3.flags & 524288)); + return createAnonymousTypeNode(type3); + } + if (type3.flags & 4194304) { + const indexedType = type3.type; + context2.approximateLength += 6; + const indexTypeNode = typeToTypeNodeHelper(indexedType, context2); + return factory.createTypeOperatorNode(143, indexTypeNode); + } + if (type3.flags & 134217728) { + const texts = type3.texts; + const types3 = type3.types; + const templateHead = factory.createTemplateHead(texts[0]); + const templateSpans = factory.createNodeArray( + map4(types3, (t8, i7) => factory.createTemplateLiteralTypeSpan( + typeToTypeNodeHelper(t8, context2), + (i7 < types3.length - 1 ? factory.createTemplateMiddle : factory.createTemplateTail)(texts[i7 + 1]) + )) + ); + context2.approximateLength += 2; + return factory.createTemplateLiteralType(templateHead, templateSpans); + } + if (type3.flags & 268435456) { + const typeNode = typeToTypeNodeHelper(type3.type, context2); + return symbolToTypeNode(type3.symbol, context2, 788968, [typeNode]); + } + if (type3.flags & 8388608) { + const objectTypeNode = typeToTypeNodeHelper(type3.objectType, context2); + const indexTypeNode = typeToTypeNodeHelper(type3.indexType, context2); + context2.approximateLength += 2; + return factory.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); + } + if (type3.flags & 16777216) { + return visitAndTransformType(type3, (type22) => conditionalTypeToTypeNode(type22)); + } + if (type3.flags & 33554432) { + const typeNode = typeToTypeNodeHelper(type3.baseType, context2); + const noInferSymbol = isNoInferType(type3) && getGlobalTypeSymbol( + "NoInfer", + /*reportErrors*/ + false + ); + return noInferSymbol ? symbolToTypeNode(noInferSymbol, context2, 788968, [typeNode]) : typeNode; + } + return Debug.fail("Should be unreachable."); + function conditionalTypeToTypeNode(type22) { + const checkTypeNode = typeToTypeNodeHelper(type22.checkType, context2); + context2.approximateLength += 15; + if (context2.flags & 4 && type22.root.isDistributive && !(type22.checkType.flags & 262144)) { + const newParam = createTypeParameter(createSymbol(262144, "T")); + const name2 = typeParameterToName(newParam, context2); + const newTypeVariable = factory.createTypeReferenceNode(name2); + context2.approximateLength += 37; + const newMapper = prependTypeMapping(type22.root.checkType, newParam, type22.mapper); + const saveInferTypeParameters2 = context2.inferTypeParameters; + context2.inferTypeParameters = type22.root.inferTypeParameters; + const extendsTypeNode2 = typeToTypeNodeHelper(instantiateType(type22.root.extendsType, newMapper), context2); + context2.inferTypeParameters = saveInferTypeParameters2; + const trueTypeNode2 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type22.root.node.trueType), newMapper)); + const falseTypeNode2 = typeToTypeNodeOrCircularityElision(instantiateType(getTypeFromTypeNode(type22.root.node.falseType), newMapper)); + return factory.createConditionalTypeNode( + checkTypeNode, + factory.createInferTypeNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + factory.cloneNode(newTypeVariable.typeName) + )), + factory.createConditionalTypeNode( + factory.createTypeReferenceNode(factory.cloneNode(name2)), + typeToTypeNodeHelper(type22.checkType, context2), + factory.createConditionalTypeNode(newTypeVariable, extendsTypeNode2, trueTypeNode2, falseTypeNode2), + factory.createKeywordTypeNode( + 146 + /* NeverKeyword */ + ) + ), + factory.createKeywordTypeNode( + 146 + /* NeverKeyword */ + ) + ); + } + const saveInferTypeParameters = context2.inferTypeParameters; + context2.inferTypeParameters = type22.root.inferTypeParameters; + const extendsTypeNode = typeToTypeNodeHelper(type22.extendsType, context2); + context2.inferTypeParameters = saveInferTypeParameters; + const trueTypeNode = typeToTypeNodeOrCircularityElision(getTrueTypeFromConditionalType(type22)); + const falseTypeNode = typeToTypeNodeOrCircularityElision(getFalseTypeFromConditionalType(type22)); + return factory.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + function typeToTypeNodeOrCircularityElision(type22) { + var _a22, _b2, _c; + if (type22.flags & 1048576) { + if ((_a22 = context2.visitedTypes) == null ? void 0 : _a22.has(getTypeId(type22))) { + if (!(context2.flags & 131072)) { + context2.encounteredError = true; + (_c = (_b2 = context2.tracker) == null ? void 0 : _b2.reportCyclicStructureError) == null ? void 0 : _c.call(_b2); + } + return createElidedInformationPlaceholder(context2); + } + return visitAndTransformType(type22, (type32) => typeToTypeNodeHelper(type32, context2)); + } + return typeToTypeNodeHelper(type22, context2); + } + function isMappedTypeHomomorphic(type22) { + return !!getHomomorphicTypeVariable(type22); + } + function isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type22) { + return !!type22.target && isMappedTypeHomomorphic(type22.target) && !isMappedTypeHomomorphic(type22); + } + function createMappedTypeNodeFromType(type22) { + var _a22; + Debug.assert(!!(type22.flags & 524288)); + const readonlyToken = type22.declaration.readonlyToken ? factory.createToken(type22.declaration.readonlyToken.kind) : void 0; + const questionToken = type22.declaration.questionToken ? factory.createToken(type22.declaration.questionToken.kind) : void 0; + let appropriateConstraintTypeNode; + let newTypeVariable; + const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type22) && !(getModifiersTypeFromMappedType(type22).flags & 2) && context2.flags & 4 && !(getConstraintTypeFromMappedType(type22).flags & 262144 && ((_a22 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type22))) == null ? void 0 : _a22.flags) & 4194304); + if (isMappedTypeWithKeyofConstraintDeclaration(type22)) { + if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type22) && context2.flags & 4) { + const newParam = createTypeParameter(createSymbol(262144, "T")); + const name2 = typeParameterToName(newParam, context2); + newTypeVariable = factory.createTypeReferenceNode(name2); + } + appropriateConstraintTypeNode = factory.createTypeOperatorNode(143, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type22), context2)); + } else if (needsModifierPreservingWrapper) { + const newParam = createTypeParameter(createSymbol(262144, "T")); + const name2 = typeParameterToName(newParam, context2); + newTypeVariable = factory.createTypeReferenceNode(name2); + appropriateConstraintTypeNode = newTypeVariable; + } else { + appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type22), context2); + } + const typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type22), context2, appropriateConstraintTypeNode); + const nameTypeNode = type22.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type22), context2) : void 0; + const templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type22), !!(getMappedTypeModifiers(type22) & 4)), context2); + const mappedTypeNode = factory.createMappedTypeNode( + readonlyToken, + typeParameterNode, + nameTypeNode, + questionToken, + templateTypeNode, + /*members*/ + void 0 + ); + context2.approximateLength += 10; + const result2 = setEmitFlags( + mappedTypeNode, + 1 + /* SingleLine */ + ); + if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type22) && context2.flags & 4) { + const originalConstraint = instantiateType(getConstraintOfTypeParameter(getTypeFromTypeNode(type22.declaration.typeParameter.constraint.type)) || unknownType2, type22.mapper); + return factory.createConditionalTypeNode( + typeToTypeNodeHelper(getModifiersTypeFromMappedType(type22), context2), + factory.createInferTypeNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + factory.cloneNode(newTypeVariable.typeName), + originalConstraint.flags & 2 ? void 0 : typeToTypeNodeHelper(originalConstraint, context2) + )), + result2, + factory.createKeywordTypeNode( + 146 + /* NeverKeyword */ + ) + ); + } else if (needsModifierPreservingWrapper) { + return factory.createConditionalTypeNode( + typeToTypeNodeHelper(getConstraintTypeFromMappedType(type22), context2), + factory.createInferTypeNode(factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + factory.cloneNode(newTypeVariable.typeName), + factory.createTypeOperatorNode(143, typeToTypeNodeHelper(getModifiersTypeFromMappedType(type22), context2)) + )), + result2, + factory.createKeywordTypeNode( + 146 + /* NeverKeyword */ + ) + ); + } + return result2; + } + function createAnonymousTypeNode(type22) { + var _a22, _b2; + const typeId = type22.id; + const symbol = type22.symbol; + if (symbol) { + const isInstantiationExpressionType = !!(getObjectFlags(type22) & 8388608); + if (isInstantiationExpressionType) { + const instantiationExpressionType = type22; + const existing = instantiationExpressionType.node; + if (isTypeQueryNode(existing) && getTypeFromTypeNode(existing) === type22) { + const typeNode = serializeExistingTypeNode(context2, existing); + if (typeNode) { + return typeNode; + } + } + if ((_a22 = context2.visitedTypes) == null ? void 0 : _a22.has(typeId)) { + return createElidedInformationPlaceholder(context2); + } + return visitAndTransformType(type22, createTypeNodeFromObjectType); + } + const isInstanceType = isClassInstanceSide(type22) ? 788968 : 111551; + if (isJSConstructor(symbol.valueDeclaration)) { + return symbolToTypeNode(symbol, context2, isInstanceType); + } else if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration && isClassLike(symbol.valueDeclaration) && context2.flags & 2048 && (!isClassDeclaration(symbol.valueDeclaration) || isSymbolAccessible( + symbol, + context2.enclosingDeclaration, + isInstanceType, + /*shouldComputeAliasesToMakeVisible*/ + false + ).accessibility !== 0)) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { + return symbolToTypeNode(symbol, context2, isInstanceType); + } else if ((_b2 = context2.visitedTypes) == null ? void 0 : _b2.has(typeId)) { + const typeAlias = getTypeAliasForTypeLiteral(type22); + if (typeAlias) { + return symbolToTypeNode( + typeAlias, + context2, + 788968 + /* Type */ + ); + } else { + return createElidedInformationPlaceholder(context2); + } + } else { + return visitAndTransformType(type22, createTypeNodeFromObjectType); + } + } else { + return createTypeNodeFromObjectType(type22); + } + function shouldWriteTypeOfFunctionSymbol() { + var _a3; + const isStaticMethodSymbol = !!(symbol.flags & 8192) && // typeof static method + some2(symbol.declarations, (declaration) => isStatic(declaration)); + const isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || // is exported function symbol + forEach4( + symbol.declarations, + (declaration) => declaration.parent.kind === 312 || declaration.parent.kind === 268 + /* ModuleBlock */ + )); + if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { + return (!!(context2.flags & 4096) || ((_a3 = context2.visitedTypes) == null ? void 0 : _a3.has(typeId))) && // it is type of the symbol uses itself recursively + (!(context2.flags & 8) || isValueSymbolAccessible(symbol, context2.enclosingDeclaration)); + } + } + } + function visitAndTransformType(type22, transform22) { + var _a22, _b2, _c; + const typeId = type22.id; + const isConstructorObject = getObjectFlags(type22) & 16 && type22.symbol && type22.symbol.flags & 32; + const id = getObjectFlags(type22) & 4 && type22.node ? "N" + getNodeId(type22.node) : type22.flags & 16777216 ? "N" + getNodeId(type22.root.node) : type22.symbol ? (isConstructorObject ? "+" : "") + getSymbolId(type22.symbol) : void 0; + if (!context2.visitedTypes) { + context2.visitedTypes = /* @__PURE__ */ new Set(); + } + if (id && !context2.symbolDepth) { + context2.symbolDepth = /* @__PURE__ */ new Map(); + } + const links = context2.enclosingDeclaration && getNodeLinks(context2.enclosingDeclaration); + const key = `${getTypeId(type22)}|${context2.flags}`; + if (links) { + links.serializedTypes || (links.serializedTypes = /* @__PURE__ */ new Map()); + } + const cachedResult = (_a22 = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _a22.get(key); + if (cachedResult) { + (_b2 = cachedResult.trackedSymbols) == null ? void 0 : _b2.forEach( + ([symbol, enclosingDeclaration, meaning]) => context2.tracker.trackSymbol( + symbol, + enclosingDeclaration, + meaning + ) + ); + if (cachedResult.truncating) { + context2.truncating = true; + } + context2.approximateLength += cachedResult.addedLength; + return deepCloneOrReuseNode(cachedResult.node); + } + let depth; + if (id) { + depth = context2.symbolDepth.get(id) || 0; + if (depth > 10) { + return createElidedInformationPlaceholder(context2); + } + context2.symbolDepth.set(id, depth + 1); + } + context2.visitedTypes.add(typeId); + const prevTrackedSymbols = context2.trackedSymbols; + context2.trackedSymbols = void 0; + const startLength = context2.approximateLength; + const result2 = transform22(type22); + const addedLength = context2.approximateLength - startLength; + if (!context2.reportedDiagnostic && !context2.encounteredError) { + (_c = links == null ? void 0 : links.serializedTypes) == null ? void 0 : _c.set(key, { + node: result2, + truncating: context2.truncating, + addedLength, + trackedSymbols: context2.trackedSymbols + }); + } + context2.visitedTypes.delete(typeId); + if (id) { + context2.symbolDepth.set(id, depth); + } + context2.trackedSymbols = prevTrackedSymbols; + return result2; + function deepCloneOrReuseNode(node) { + if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) { + return node; + } + return setTextRange(factory.cloneNode(visitEachChild( + node, + deepCloneOrReuseNode, + /*context*/ + void 0, + deepCloneOrReuseNodes + )), node); + } + function deepCloneOrReuseNodes(nodes, visitor, test, start, count2) { + if (nodes && nodes.length === 0) { + return setTextRange(factory.createNodeArray( + /*elements*/ + void 0, + nodes.hasTrailingComma + ), nodes); + } + return visitNodes2(nodes, visitor, test, start, count2); + } + } + function createTypeNodeFromObjectType(type22) { + if (isGenericMappedType(type22) || type22.containsError) { + return createMappedTypeNodeFromType(type22); + } + const resolved = resolveStructuredTypeMembers(type22); + if (!resolved.properties.length && !resolved.indexInfos.length) { + if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + context2.approximateLength += 2; + return setEmitFlags( + factory.createTypeLiteralNode( + /*members*/ + void 0 + ), + 1 + /* SingleLine */ + ); + } + if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { + const signature = resolved.callSignatures[0]; + const signatureNode = signatureToSignatureDeclarationHelper(signature, 184, context2); + return signatureNode; + } + if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { + const signature = resolved.constructSignatures[0]; + const signatureNode = signatureToSignatureDeclarationHelper(signature, 185, context2); + return signatureNode; + } + } + const abstractSignatures = filter2(resolved.constructSignatures, (signature) => !!(signature.flags & 4)); + if (some2(abstractSignatures)) { + const types3 = map4(abstractSignatures, getOrCreateTypeFromSignature); + const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per + // the logic in `createTypeNodesFromResolvedType`. + (context2.flags & 2048 ? countWhere(resolved.properties, (p7) => !(p7.flags & 4194304)) : length(resolved.properties)); + if (typeElementCount) { + types3.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved)); + } + return typeToTypeNodeHelper(getIntersectionType(types3), context2); + } + const savedFlags = context2.flags; + context2.flags |= 4194304; + const members = createTypeNodesFromResolvedType(resolved); + context2.flags = savedFlags; + const typeLiteralNode = factory.createTypeLiteralNode(members); + context2.approximateLength += 2; + setEmitFlags( + typeLiteralNode, + context2.flags & 1024 ? 0 : 1 + /* SingleLine */ + ); + return typeLiteralNode; + } + function typeReferenceToTypeNode(type22) { + let typeArguments = getTypeArguments(type22); + if (type22.target === globalArrayType || type22.target === globalReadonlyArrayType) { + if (context2.flags & 2) { + const typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context2); + return factory.createTypeReferenceNode(type22.target === globalArrayType ? "Array" : "ReadonlyArray", [typeArgumentNode]); + } + const elementType = typeToTypeNodeHelper(typeArguments[0], context2); + const arrayType2 = factory.createArrayTypeNode(elementType); + return type22.target === globalArrayType ? arrayType2 : factory.createTypeOperatorNode(148, arrayType2); + } else if (type22.target.objectFlags & 8) { + typeArguments = sameMap(typeArguments, (t8, i7) => removeMissingType(t8, !!(type22.target.elementFlags[i7] & 2))); + if (typeArguments.length > 0) { + const arity = getTypeReferenceArity(type22); + const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context2); + if (tupleConstituentNodes) { + const { labeledElementDeclarations } = type22.target; + for (let i7 = 0; i7 < tupleConstituentNodes.length; i7++) { + const flags = type22.target.elementFlags[i7]; + const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i7]; + if (labeledElementDeclaration) { + tupleConstituentNodes[i7] = factory.createNamedTupleMember( + flags & 12 ? factory.createToken( + 26 + /* DotDotDotToken */ + ) : void 0, + factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))), + flags & 2 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + flags & 4 ? factory.createArrayTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7] + ); + } else { + tupleConstituentNodes[i7] = flags & 12 ? factory.createRestTypeNode(flags & 4 ? factory.createArrayTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7]) : flags & 2 ? factory.createOptionalTypeNode(tupleConstituentNodes[i7]) : tupleConstituentNodes[i7]; + } + } + const tupleTypeNode = setEmitFlags( + factory.createTupleTypeNode(tupleConstituentNodes), + 1 + /* SingleLine */ + ); + return type22.target.readonly ? factory.createTypeOperatorNode(148, tupleTypeNode) : tupleTypeNode; + } + } + if (context2.encounteredError || context2.flags & 524288) { + const tupleTypeNode = setEmitFlags( + factory.createTupleTypeNode([]), + 1 + /* SingleLine */ + ); + return type22.target.readonly ? factory.createTypeOperatorNode(148, tupleTypeNode) : tupleTypeNode; + } + context2.encounteredError = true; + return void 0; + } else if (context2.flags & 2048 && type22.symbol.valueDeclaration && isClassLike(type22.symbol.valueDeclaration) && !isValueSymbolAccessible(type22.symbol, context2.enclosingDeclaration)) { + return createAnonymousTypeNode(type22); + } else { + const outerTypeParameters = type22.target.outerTypeParameters; + let i7 = 0; + let resultType; + if (outerTypeParameters) { + const length2 = outerTypeParameters.length; + while (i7 < length2) { + const start = i7; + const parent22 = getParentSymbolOfTypeParameter(outerTypeParameters[i7]); + do { + i7++; + } while (i7 < length2 && getParentSymbolOfTypeParameter(outerTypeParameters[i7]) === parent22); + if (!rangeEquals(outerTypeParameters, typeArguments, start, i7)) { + const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i7), context2); + const flags2 = context2.flags; + context2.flags |= 16; + const ref = symbolToTypeNode(parent22, context2, 788968, typeArgumentSlice); + context2.flags = flags2; + resultType = !resultType ? ref : appendReferenceToType(resultType, ref); + } + } + } + let typeArgumentNodes; + if (typeArguments.length > 0) { + const typeParameterCount = (type22.target.typeParameters || emptyArray).length; + typeArgumentNodes = mapToTypeNodes(typeArguments.slice(i7, typeParameterCount), context2); + } + const flags = context2.flags; + context2.flags |= 16; + const finalRef = symbolToTypeNode(type22.symbol, context2, 788968, typeArgumentNodes); + context2.flags = flags; + return !resultType ? finalRef : appendReferenceToType(resultType, finalRef); + } + } + function appendReferenceToType(root2, ref) { + if (isImportTypeNode(root2)) { + let typeArguments = root2.typeArguments; + let qualifier = root2.qualifier; + if (qualifier) { + if (isIdentifier(qualifier)) { + if (typeArguments !== getIdentifierTypeArguments(qualifier)) { + qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments); + } + } else { + if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) { + qualifier = factory.updateQualifiedName(qualifier, qualifier.left, setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)); + } + } + } + typeArguments = ref.typeArguments; + const ids = getAccessStack(ref); + for (const id of ids) { + qualifier = qualifier ? factory.createQualifiedName(qualifier, id) : id; + } + return factory.updateImportTypeNode( + root2, + root2.argument, + root2.attributes, + qualifier, + typeArguments, + root2.isTypeOf + ); + } else { + let typeArguments = root2.typeArguments; + let typeName = root2.typeName; + if (isIdentifier(typeName)) { + if (typeArguments !== getIdentifierTypeArguments(typeName)) { + typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments); + } + } else { + if (typeArguments !== getIdentifierTypeArguments(typeName.right)) { + typeName = factory.updateQualifiedName(typeName, typeName.left, setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)); + } + } + typeArguments = ref.typeArguments; + const ids = getAccessStack(ref); + for (const id of ids) { + typeName = factory.createQualifiedName(typeName, id); + } + return factory.updateTypeReferenceNode( + root2, + typeName, + typeArguments + ); + } + } + function getAccessStack(ref) { + let state = ref.typeName; + const ids = []; + while (!isIdentifier(state)) { + ids.unshift(state.right); + state = state.left; + } + ids.unshift(state); + return ids; + } + function createTypeNodesFromResolvedType(resolvedType) { + if (checkTruncationLength(context2)) { + return [factory.createPropertySignature( + /*modifiers*/ + void 0, + "...", + /*questionToken*/ + void 0, + /*type*/ + void 0 + )]; + } + const typeElements = []; + for (const signature of resolvedType.callSignatures) { + typeElements.push(signatureToSignatureDeclarationHelper(signature, 179, context2)); + } + for (const signature of resolvedType.constructSignatures) { + if (signature.flags & 4) + continue; + typeElements.push(signatureToSignatureDeclarationHelper(signature, 180, context2)); + } + for (const info2 of resolvedType.indexInfos) { + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info2, context2, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context2) : void 0)); + } + const properties = resolvedType.properties; + if (!properties) { + return typeElements; + } + let i7 = 0; + for (const propertySymbol of properties) { + i7++; + if (context2.flags & 2048) { + if (propertySymbol.flags & 4194304) { + continue; + } + if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 | 4) && context2.tracker.reportPrivateInBaseOfClassExpression) { + context2.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + if (checkTruncationLength(context2) && i7 + 2 < properties.length - 1) { + typeElements.push(factory.createPropertySignature( + /*modifiers*/ + void 0, + `... ${properties.length - i7} more ...`, + /*questionToken*/ + void 0, + /*type*/ + void 0 + )); + addPropertyToElementList(properties[properties.length - 1], context2, typeElements); + break; + } + addPropertyToElementList(propertySymbol, context2, typeElements); + } + return typeElements.length ? typeElements : void 0; + } + } + function createElidedInformationPlaceholder(context2) { + context2.approximateLength += 3; + if (!(context2.flags & 1)) { + return factory.createTypeReferenceNode( + factory.createIdentifier("..."), + /*typeArguments*/ + void 0 + ); + } + return factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + function shouldUsePlaceholderForProperty(propertySymbol, context2) { + var _a2; + return !!(getCheckFlags(propertySymbol) & 8192) && (contains2(context2.reverseMappedStack, propertySymbol) || ((_a2 = context2.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last2(context2.reverseMappedStack).links.propertyType) & 16)); + } + function addPropertyToElementList(propertySymbol, context2, typeElements) { + var _a2; + const propertyIsReverseMapped = !!(getCheckFlags(propertySymbol) & 8192); + const propertyType = shouldUsePlaceholderForProperty(propertySymbol, context2) ? anyType2 : getNonMissingTypeOfSymbol(propertySymbol); + const saveEnclosingDeclaration = context2.enclosingDeclaration; + context2.enclosingDeclaration = void 0; + if (context2.tracker.canTrackSymbol && isLateBoundName(propertySymbol.escapedName)) { + if (propertySymbol.declarations) { + const decl = first(propertySymbol.declarations); + if (hasLateBindableName(decl)) { + if (isBinaryExpression(decl)) { + const name2 = getNameOfDeclaration(decl); + if (name2 && isElementAccessExpression(name2) && isPropertyAccessEntityNameExpression(name2.argumentExpression)) { + trackComputedName(name2.argumentExpression, saveEnclosingDeclaration, context2); + } + } else { + trackComputedName(decl.name.expression, saveEnclosingDeclaration, context2); + } + } + } else { + context2.tracker.reportNonSerializableProperty(symbolToString2(propertySymbol)); + } + } + context2.enclosingDeclaration = propertySymbol.valueDeclaration || ((_a2 = propertySymbol.declarations) == null ? void 0 : _a2[0]) || saveEnclosingDeclaration; + const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context2); + context2.enclosingDeclaration = saveEnclosingDeclaration; + context2.approximateLength += symbolName(propertySymbol).length + 1; + if (propertySymbol.flags & 98304) { + const writeType = getWriteTypeOfSymbol(propertySymbol); + if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) { + const getterDeclaration = getDeclarationOfKind( + propertySymbol, + 177 + /* GetAccessor */ + ); + const getterSignature = getSignatureFromDeclaration(getterDeclaration); + typeElements.push( + setCommentRange( + signatureToSignatureDeclarationHelper(getterSignature, 177, context2, { name: propertyName }), + getterDeclaration + ) + ); + const setterDeclaration = getDeclarationOfKind( + propertySymbol, + 178 + /* SetAccessor */ + ); + const setterSignature = getSignatureFromDeclaration(setterDeclaration); + typeElements.push( + setCommentRange( + signatureToSignatureDeclarationHelper(setterSignature, 178, context2, { name: propertyName }), + setterDeclaration + ) + ); + return; + } + } + const optionalToken = propertySymbol.flags & 16777216 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0; + if (propertySymbol.flags & (16 | 8192) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) { + const signatures = getSignaturesOfType( + filterType(propertyType, (t8) => !(t8.flags & 32768)), + 0 + /* Call */ + ); + for (const signature of signatures) { + const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173, context2, { name: propertyName, questionToken: optionalToken }); + typeElements.push(preserveCommentsOn(methodDeclaration)); + } + if (signatures.length || !optionalToken) { + return; + } + } + let propertyTypeNode; + if (shouldUsePlaceholderForProperty(propertySymbol, context2)) { + propertyTypeNode = createElidedInformationPlaceholder(context2); + } else { + if (propertyIsReverseMapped) { + context2.reverseMappedStack || (context2.reverseMappedStack = []); + context2.reverseMappedStack.push(propertySymbol); + } + propertyTypeNode = propertyType ? serializeTypeForDeclaration(context2, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + if (propertyIsReverseMapped) { + context2.reverseMappedStack.pop(); + } + } + const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken( + 148 + /* ReadonlyKeyword */ + )] : void 0; + if (modifiers) { + context2.approximateLength += 9; + } + const propertySignature = factory.createPropertySignature( + modifiers, + propertyName, + optionalToken, + propertyTypeNode + ); + typeElements.push(preserveCommentsOn(propertySignature)); + function preserveCommentsOn(node) { + var _a22; + const jsdocPropertyTag = (_a22 = propertySymbol.declarations) == null ? void 0 : _a22.find( + (d7) => d7.kind === 355 + /* JSDocPropertyTag */ + ); + if (jsdocPropertyTag) { + const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment); + if (commentText) { + setSyntheticLeadingComments(node, [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]); + } + } else if (propertySymbol.valueDeclaration) { + setCommentRange(node, propertySymbol.valueDeclaration); + } + return node; + } + } + function mapToTypeNodes(types3, context2, isBareList) { + if (some2(types3)) { + if (checkTruncationLength(context2)) { + if (!isBareList) { + return [factory.createTypeReferenceNode( + "...", + /*typeArguments*/ + void 0 + )]; + } else if (types3.length > 2) { + return [ + typeToTypeNodeHelper(types3[0], context2), + factory.createTypeReferenceNode( + `... ${types3.length - 2} more ...`, + /*typeArguments*/ + void 0 + ), + typeToTypeNodeHelper(types3[types3.length - 1], context2) + ]; + } + } + const mayHaveNameCollisions = !(context2.flags & 64); + const seenNames = mayHaveNameCollisions ? createMultiMap() : void 0; + const result2 = []; + let i7 = 0; + for (const type3 of types3) { + i7++; + if (checkTruncationLength(context2) && i7 + 2 < types3.length - 1) { + result2.push(factory.createTypeReferenceNode( + `... ${types3.length - i7} more ...`, + /*typeArguments*/ + void 0 + )); + const typeNode2 = typeToTypeNodeHelper(types3[types3.length - 1], context2); + if (typeNode2) { + result2.push(typeNode2); + } + break; + } + context2.approximateLength += 2; + const typeNode = typeToTypeNodeHelper(type3, context2); + if (typeNode) { + result2.push(typeNode); + if (seenNames && isIdentifierTypeReference(typeNode)) { + seenNames.add(typeNode.typeName.escapedText, [type3, result2.length - 1]); + } + } + } + if (seenNames) { + const saveContextFlags = context2.flags; + context2.flags |= 64; + seenNames.forEach((types22) => { + if (!arrayIsHomogeneous(types22, ([a7], [b8]) => typesAreSameReference(a7, b8))) { + for (const [type3, resultIndex] of types22) { + result2[resultIndex] = typeToTypeNodeHelper(type3, context2); + } + } + }); + context2.flags = saveContextFlags; + } + return result2; + } + } + function typesAreSameReference(a7, b8) { + return a7 === b8 || !!a7.symbol && a7.symbol === b8.symbol || !!a7.aliasSymbol && a7.aliasSymbol === b8.aliasSymbol; + } + function indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode) { + const name2 = getNameFromIndexInfo(indexInfo) || "x"; + const indexerTypeNode = typeToTypeNodeHelper(indexInfo.keyType, context2); + const indexingParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + indexerTypeNode, + /*initializer*/ + void 0 + ); + if (!typeNode) { + typeNode = typeToTypeNodeHelper(indexInfo.type || anyType2, context2); + } + if (!indexInfo.type && !(context2.flags & 2097152)) { + context2.encounteredError = true; + } + context2.approximateLength += name2.length + 4; + return factory.createIndexSignature( + indexInfo.isReadonly ? [factory.createToken( + 148 + /* ReadonlyKeyword */ + )] : void 0, + [indexingParameter], + typeNode + ); + } + function signatureToSignatureDeclarationHelper(signature, kind, context2, options) { + var _a2; + const suppressAny = context2.flags & 256; + if (suppressAny) + context2.flags &= ~256; + context2.approximateLength += 3; + let typeParameters; + let typeArguments; + if (context2.flags & 32 && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map((parameter) => typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context2)); + } else { + typeParameters = signature.typeParameters && signature.typeParameters.map((parameter) => typeParameterToDeclaration(parameter, context2)); + } + const expandedParams = getExpandedParameters( + signature, + /*skipUnionExpanding*/ + true + )[0]; + let cleanup; + if (context2.enclosingDeclaration && signature.declaration && signature.declaration !== context2.enclosingDeclaration && !isInJSFile(signature.declaration) && (some2(expandedParams) || some2(signature.typeParameters))) { + let pushFakeScope2 = function(kind2, addAll) { + Debug.assert(context2.enclosingDeclaration); + let existingFakeScope; + if (getNodeLinks(context2.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) { + existingFakeScope = context2.enclosingDeclaration; + } else if (context2.enclosingDeclaration.parent && getNodeLinks(context2.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) { + existingFakeScope = context2.enclosingDeclaration.parent; + } + Debug.assertOptionalNode(existingFakeScope, isBlock2); + const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable(); + let newLocals; + addAll((name2, symbol) => { + if (!locals.has(name2)) { + newLocals = append(newLocals, name2); + locals.set(name2, symbol); + } + }); + if (!newLocals) + return; + const oldCleanup = cleanup; + function undo() { + forEach4(newLocals, (s7) => locals.delete(s7)); + oldCleanup == null ? void 0 : oldCleanup(); + } + if (existingFakeScope) { + cleanup = undo; + } else { + const fakeScope = parseNodeFactory.createBlock(emptyArray); + getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2; + fakeScope.locals = locals; + const saveEnclosingDeclaration = context2.enclosingDeclaration; + setParent(fakeScope, saveEnclosingDeclaration); + context2.enclosingDeclaration = fakeScope; + cleanup = () => { + context2.enclosingDeclaration = saveEnclosingDeclaration; + undo(); + }; + } + }; + var pushFakeScope = pushFakeScope2; + pushFakeScope2( + "params", + (add2) => { + for (const param of expandedParams) { + add2(param.escapedName, param); + } + } + ); + if (context2.flags & 4) { + pushFakeScope2( + "typeParams", + (add2) => { + for (const typeParam of signature.typeParameters ?? emptyArray) { + const typeParamName = typeParameterToName(typeParam, context2).escapedText; + add2(typeParamName, typeParam.symbol); + } + } + ); + } + } + const parameters = (some2(expandedParams, (p7) => p7 !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p7) & 32768)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context2, kind === 176, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports)); + const thisParameter = context2.flags & 33554432 ? void 0 : tryGetThisParameterDeclaration(signature, context2); + if (thisParameter) { + parameters.unshift(thisParameter); + } + let returnTypeNode; + const typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + const assertsModifier = typePredicate.kind === 2 || typePredicate.kind === 3 ? factory.createToken( + 131 + /* AssertsKeyword */ + ) : void 0; + const parameterName = typePredicate.kind === 1 || typePredicate.kind === 3 ? setEmitFlags( + factory.createIdentifier(typePredicate.parameterName), + 16777216 + /* NoAsciiEscaping */ + ) : factory.createThisTypeNode(); + const typeNode = typePredicate.type && typeToTypeNodeHelper(typePredicate.type, context2); + returnTypeNode = factory.createTypePredicateNode(assertsModifier, parameterName, typeNode); + } else { + const returnType = getReturnTypeOfSignature(signature); + if (returnType && !(suppressAny && isTypeAny(returnType))) { + returnTypeNode = serializeReturnTypeForSignature(context2, returnType, signature, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports); + } else if (!suppressAny) { + returnTypeNode = factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + } + let modifiers = options == null ? void 0 : options.modifiers; + if (kind === 185 && signature.flags & 4) { + const flags = modifiersToFlags(modifiers); + modifiers = factory.createModifiersFromModifierFlags( + flags | 64 + /* Abstract */ + ); + } + const node = kind === 179 ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 180 ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 173 ? factory.createMethodSignature(modifiers, (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 174 ? factory.createMethodDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), + /*questionToken*/ + void 0, + typeParameters, + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 176 ? factory.createConstructorDeclaration( + modifiers, + parameters, + /*body*/ + void 0 + ) : kind === 177 ? factory.createGetAccessorDeclaration( + modifiers, + (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 178 ? factory.createSetAccessorDeclaration( + modifiers, + (options == null ? void 0 : options.name) ?? factory.createIdentifier(""), + parameters, + /*body*/ + void 0 + ) : kind === 181 ? factory.createIndexSignature(modifiers, parameters, returnTypeNode) : kind === 324 ? factory.createJSDocFunctionType(parameters, returnTypeNode) : kind === 184 ? factory.createFunctionTypeNode(typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 185 ? factory.createConstructorTypeNode(modifiers, typeParameters, parameters, returnTypeNode ?? factory.createTypeReferenceNode(factory.createIdentifier(""))) : kind === 262 ? factory.createFunctionDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), + typeParameters, + parameters, + returnTypeNode, + /*body*/ + void 0 + ) : kind === 218 ? factory.createFunctionExpression( + modifiers, + /*asteriskToken*/ + void 0, + (options == null ? void 0 : options.name) ? cast(options.name, isIdentifier) : factory.createIdentifier(""), + typeParameters, + parameters, + returnTypeNode, + factory.createBlock([]) + ) : kind === 219 ? factory.createArrowFunction( + modifiers, + typeParameters, + parameters, + returnTypeNode, + /*equalsGreaterThanToken*/ + void 0, + factory.createBlock([]) + ) : Debug.assertNever(kind); + if (typeArguments) { + node.typeArguments = factory.createNodeArray(typeArguments); + } + if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 330 && signature.declaration.parent.kind === 346) { + const comment = getTextOfNode( + signature.declaration.parent.parent, + /*includeTrivia*/ + true + ).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n"); + addSyntheticLeadingComment( + node, + 3, + comment, + /*hasTrailingNewLine*/ + true + ); + } + cleanup == null ? void 0 : cleanup(); + return node; + } + function tryGetThisParameterDeclaration(signature, context2) { + if (signature.thisParameter) { + return symbolToParameterDeclaration(signature.thisParameter, context2); + } + if (signature.declaration && isInJSFile(signature.declaration)) { + const thisTag = getJSDocThisTag(signature.declaration); + if (thisTag && thisTag.typeExpression) { + return factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "this", + /*questionToken*/ + void 0, + typeToTypeNodeHelper(getTypeFromTypeNode(thisTag.typeExpression), context2) + ); + } + } + } + function typeParameterToDeclarationWithConstraint(type3, context2, constraintNode) { + const savedContextFlags = context2.flags; + context2.flags &= ~512; + const modifiers = factory.createModifiersFromModifierFlags(getTypeParameterModifiers(type3)); + const name2 = typeParameterToName(type3, context2); + const defaultParameter = getDefaultFromTypeParameter(type3); + const defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context2); + context2.flags = savedContextFlags; + return factory.createTypeParameterDeclaration(modifiers, name2, constraintNode, defaultParameterNode); + } + function typeParameterToDeclaration(type3, context2, constraint = getConstraintOfTypeParameter(type3)) { + const constraintNode = constraint && typeToTypeNodeHelper(constraint, context2); + return typeParameterToDeclarationWithConstraint(type3, context2, constraintNode); + } + function getEffectiveParameterDeclaration(parameterSymbol) { + const parameterDeclaration = getDeclarationOfKind( + parameterSymbol, + 169 + /* Parameter */ + ); + if (parameterDeclaration) { + return parameterDeclaration; + } + if (!isTransientSymbol(parameterSymbol)) { + return getDeclarationOfKind( + parameterSymbol, + 348 + /* JSDocParameterTag */ + ); + } + } + function symbolToParameterDeclaration(parameterSymbol, context2, preserveModifierFlags, privateSymbolVisitor, bundledImports) { + const parameterDeclaration = getEffectiveParameterDeclaration(parameterSymbol); + let parameterType = getTypeOfSymbol(parameterSymbol); + if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { + parameterType = getOptionalType(parameterType); + } + const parameterTypeNode = serializeTypeForDeclaration(context2, parameterType, parameterSymbol, context2.enclosingDeclaration, privateSymbolVisitor, bundledImports); + const modifiers = !(context2.flags & 8192) && preserveModifierFlags && parameterDeclaration && canHaveModifiers(parameterDeclaration) ? map4(getModifiers(parameterDeclaration), factory.cloneNode) : void 0; + const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 32768; + const dotDotDotToken = isRest ? factory.createToken( + 26 + /* DotDotDotToken */ + ) : void 0; + const name2 = parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context2); + const isOptional2 = parameterDeclaration && isOptionalParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & 16384; + const questionToken = isOptional2 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0; + const parameterNode = factory.createParameterDeclaration( + modifiers, + dotDotDotToken, + name2, + questionToken, + parameterTypeNode, + /*initializer*/ + void 0 + ); + context2.approximateLength += symbolName(parameterSymbol).length + 3; + return parameterNode; + } + function parameterToParameterDeclarationName(parameterSymbol, parameterDeclaration, context2) { + return parameterDeclaration ? parameterDeclaration.name ? parameterDeclaration.name.kind === 80 ? setEmitFlags( + factory.cloneNode(parameterDeclaration.name), + 16777216 + /* NoAsciiEscaping */ + ) : parameterDeclaration.name.kind === 166 ? setEmitFlags( + factory.cloneNode(parameterDeclaration.name.right), + 16777216 + /* NoAsciiEscaping */ + ) : cloneBindingName(parameterDeclaration.name) : symbolName(parameterSymbol) : symbolName(parameterSymbol); + function cloneBindingName(node) { + return elideInitializerAndSetEmitFlags(node); + function elideInitializerAndSetEmitFlags(node2) { + if (context2.tracker.canTrackSymbol && isComputedPropertyName(node2) && isLateBindableName(node2)) { + trackComputedName(node2.expression, context2.enclosingDeclaration, context2); + } + let visited = visitEachChild( + node2, + elideInitializerAndSetEmitFlags, + /*context*/ + void 0, + /*nodesVisitor*/ + void 0, + elideInitializerAndSetEmitFlags + ); + if (isBindingElement(visited)) { + visited = factory.updateBindingElement( + visited, + visited.dotDotDotToken, + visited.propertyName, + visited.name, + /*initializer*/ + void 0 + ); + } + if (!nodeIsSynthesized(visited)) { + visited = factory.cloneNode(visited); + } + return setEmitFlags( + visited, + 1 | 16777216 + /* NoAsciiEscaping */ + ); + } + } + } + function trackComputedName(accessExpression, enclosingDeclaration, context2) { + if (!context2.tracker.canTrackSymbol) + return; + const firstIdentifier = getFirstIdentifier(accessExpression); + const name2 = resolveName( + firstIdentifier, + firstIdentifier.escapedText, + 111551 | 1048576, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (name2) { + context2.tracker.trackSymbol( + name2, + enclosingDeclaration, + 111551 + /* Value */ + ); + } + } + function lookupSymbolChain(symbol, context2, meaning, yieldModuleSymbol) { + context2.tracker.trackSymbol(symbol, context2.enclosingDeclaration, meaning); + return lookupSymbolChainWorker(symbol, context2, meaning, yieldModuleSymbol); + } + function lookupSymbolChainWorker(symbol, context2, meaning, yieldModuleSymbol) { + let chain3; + const isTypeParameter = symbol.flags & 262144; + if (!isTypeParameter && (context2.enclosingDeclaration || context2.flags & 64) && !(context2.flags & 134217728)) { + chain3 = Debug.checkDefined(getSymbolChain( + symbol, + meaning, + /*endOfChain*/ + true + )); + Debug.assert(chain3 && chain3.length > 0); + } else { + chain3 = [symbol]; + } + return chain3; + function getSymbolChain(symbol2, meaning2, endOfChain) { + let accessibleSymbolChain = getAccessibleSymbolChain(symbol2, context2.enclosingDeclaration, meaning2, !!(context2.flags & 128)); + let parentSpecifiers; + if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context2.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning2 : getQualifiedLeftMeaning(meaning2))) { + const parents = getContainersOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol2, context2.enclosingDeclaration, meaning2); + if (length(parents)) { + parentSpecifiers = parents.map( + (symbol3) => some2(symbol3.declarations, hasNonGlobalAugmentationExternalModuleSymbol) ? getSpecifierForModuleSymbol(symbol3, context2) : void 0 + ); + const indices = parents.map((_6, i7) => i7); + indices.sort(sortByBestName); + const sortedParents = indices.map((i7) => parents[i7]); + for (const parent22 of sortedParents) { + const parentChain = getSymbolChain( + parent22, + getQualifiedLeftMeaning(meaning2), + /*endOfChain*/ + false + ); + if (parentChain) { + if (parent22.exports && parent22.exports.get( + "export=" + /* ExportEquals */ + ) && getSymbolIfSameReference(parent22.exports.get( + "export=" + /* ExportEquals */ + ), symbol2)) { + accessibleSymbolChain = parentChain; + break; + } + accessibleSymbolChain = parentChain.concat(accessibleSymbolChain || [getAliasForSymbolInContainer(parent22, symbol2) || symbol2]); + break; + } + } + } + } + if (accessibleSymbolChain) { + return accessibleSymbolChain; + } + if ( + // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. + endOfChain || // If a parent symbol is an anonymous type, don't write it. + !(symbol2.flags & (2048 | 4096)) + ) { + if (!endOfChain && !yieldModuleSymbol && !!forEach4(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + return; + } + return [symbol2]; + } + function sortByBestName(a7, b8) { + const specifierA = parentSpecifiers[a7]; + const specifierB = parentSpecifiers[b8]; + if (specifierA && specifierB) { + const isBRelative = pathIsRelative(specifierB); + if (pathIsRelative(specifierA) === isBRelative) { + return countPathComponents(specifierA) - countPathComponents(specifierB); + } + if (isBRelative) { + return -1; + } + return 1; + } + return 0; + } + } + } + function typeParametersToTypeParameterDeclarations(symbol, context2) { + let typeParameterNodes; + const targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameterNodes = factory.createNodeArray(map4(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), (tp) => typeParameterToDeclaration(tp, context2))); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain3, index4, context2) { + var _a2; + Debug.assert(chain3 && 0 <= index4 && index4 < chain3.length); + const symbol = chain3[index4]; + const symbolId = getSymbolId(symbol); + if ((_a2 = context2.typeParameterSymbolList) == null ? void 0 : _a2.has(symbolId)) { + return void 0; + } + (context2.typeParameterSymbolList || (context2.typeParameterSymbolList = /* @__PURE__ */ new Set())).add(symbolId); + let typeParameterNodes; + if (context2.flags & 512 && index4 < chain3.length - 1) { + const parentSymbol = symbol; + const nextSymbol = chain3[index4 + 1]; + if (getCheckFlags(nextSymbol) & 1) { + const params = getTypeParametersOfClassOrInterface( + parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol + ); + typeParameterNodes = mapToTypeNodes(map4(params, (t8) => getMappedType(t8, nextSymbol.links.mapper)), context2); + } else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context2); + } + } + return typeParameterNodes; + } + function getTopmostIndexedAccessType(top) { + if (isIndexedAccessTypeNode(top.objectType)) { + return getTopmostIndexedAccessType(top.objectType); + } + return top; + } + function getSpecifierForModuleSymbol(symbol, context2, overrideImportMode) { + let file = getDeclarationOfKind( + symbol, + 312 + /* SourceFile */ + ); + if (!file) { + const equivalentFileSymbol = firstDefined(symbol.declarations, (d7) => getFileSymbolIfFileSymbolExportEqualsContainer(d7, symbol)); + if (equivalentFileSymbol) { + file = getDeclarationOfKind( + equivalentFileSymbol, + 312 + /* SourceFile */ + ); + } + } + if (file && file.moduleName !== void 0) { + return file.moduleName; + } + if (!file) { + if (context2.tracker.trackReferencedAmbientModule) { + const ambientDecls = filter2(symbol.declarations, isAmbientModule); + if (length(ambientDecls)) { + for (const decl of ambientDecls) { + context2.tracker.trackReferencedAmbientModule(decl, symbol); + } + } + } + if (ambientModuleSymbolRegex.test(symbol.escapedName)) { + return symbol.escapedName.substring(1, symbol.escapedName.length - 1); + } + } + if (!context2.enclosingDeclaration || !context2.tracker.moduleResolverHost) { + if (ambientModuleSymbolRegex.test(symbol.escapedName)) { + return symbol.escapedName.substring(1, symbol.escapedName.length - 1); + } + return getSourceFileOfNode(getNonAugmentationDeclaration(symbol)).fileName; + } + const contextFile = getSourceFileOfNode(getOriginalNode(context2.enclosingDeclaration)); + const resolutionMode = overrideImportMode || (contextFile == null ? void 0 : contextFile.impliedNodeFormat); + const cacheKey = createModeAwareCacheKey(contextFile.path, resolutionMode); + const links = getSymbolLinks(symbol); + let specifier = links.specifierCache && links.specifierCache.get(cacheKey); + if (!specifier) { + const isBundle2 = !!outFile(compilerOptions); + const { moduleResolverHost } = context2.tracker; + const specifierCompilerOptions = isBundle2 ? { ...compilerOptions, baseUrl: moduleResolverHost.getCommonSourceDirectory() } : compilerOptions; + specifier = first(getModuleSpecifiers( + symbol, + checker, + specifierCompilerOptions, + contextFile, + moduleResolverHost, + { + importModuleSpecifierPreference: isBundle2 ? "non-relative" : "project-relative", + importModuleSpecifierEnding: isBundle2 ? "minimal" : resolutionMode === 99 ? "js" : void 0 + }, + { overrideImportMode } + )); + links.specifierCache ?? (links.specifierCache = /* @__PURE__ */ new Map()); + links.specifierCache.set(cacheKey, specifier); + } + return specifier; + } + function symbolToEntityNameNode(symbol) { + const identifier = factory.createIdentifier(unescapeLeadingUnderscores(symbol.escapedName)); + return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier; + } + function symbolToTypeNode(symbol, context2, meaning, overrideTypeArguments) { + const chain3 = lookupSymbolChain(symbol, context2, meaning, !(context2.flags & 16384)); + const isTypeOf = meaning === 111551; + if (some2(chain3[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + const nonRootParts = chain3.length > 1 ? createAccessFromSymbolChain(chain3, chain3.length - 1, 1) : void 0; + const typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain3, 0, context2); + const contextFile = getSourceFileOfNode(getOriginalNode(context2.enclosingDeclaration)); + const targetFile = getSourceFileOfModule(chain3[0]); + let specifier; + let attributes; + if (getEmitModuleResolutionKind(compilerOptions) === 3 || getEmitModuleResolutionKind(compilerOptions) === 99) { + if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) { + specifier = getSpecifierForModuleSymbol( + chain3[0], + context2, + 99 + /* ESNext */ + ); + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral("import") + ) + ]) + ); + } + } + if (!specifier) { + specifier = getSpecifierForModuleSymbol(chain3[0], context2); + } + if (!(context2.flags & 67108864) && getEmitModuleResolutionKind(compilerOptions) !== 1 && specifier.includes("/node_modules/")) { + const oldSpecifier = specifier; + if (getEmitModuleResolutionKind(compilerOptions) === 3 || getEmitModuleResolutionKind(compilerOptions) === 99) { + const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 ? 1 : 99; + specifier = getSpecifierForModuleSymbol(chain3[0], context2, swappedMode); + if (specifier.includes("/node_modules/")) { + specifier = oldSpecifier; + } else { + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral(swappedMode === 99 ? "import" : "require") + ) + ]) + ); + } + } + if (!attributes) { + context2.encounteredError = true; + if (context2.tracker.reportLikelyUnsafeImportRequiredError) { + context2.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier); + } + } + } + const lit = factory.createLiteralTypeNode(factory.createStringLiteral(specifier)); + if (context2.tracker.trackExternalModuleSymbolOfImportTypeNode) + context2.tracker.trackExternalModuleSymbolOfImportTypeNode(chain3[0]); + context2.approximateLength += specifier.length + 10; + if (!nonRootParts || isEntityName(nonRootParts)) { + if (nonRootParts) { + const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); + } + return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf); + } else { + const splitNode = getTopmostIndexedAccessType(nonRootParts); + const qualifier = splitNode.objectType.typeName; + return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType); + } + } + const entityName = createAccessFromSymbolChain(chain3, chain3.length - 1, 0); + if (isIndexedAccessTypeNode(entityName)) { + return entityName; + } + if (isTypeOf) { + return factory.createTypeQueryNode(entityName); + } else { + const lastId = isIdentifier(entityName) ? entityName : entityName.right; + const lastTypeArgs = getIdentifierTypeArguments(lastId); + setIdentifierTypeArguments( + lastId, + /*typeArguments*/ + void 0 + ); + return factory.createTypeReferenceNode(entityName, lastTypeArgs); + } + function createAccessFromSymbolChain(chain22, index4, stopper) { + const typeParameterNodes = index4 === chain22.length - 1 ? overrideTypeArguments : lookupTypeParameterNodes(chain22, index4, context2); + const symbol2 = chain22[index4]; + const parent22 = chain22[index4 - 1]; + let symbolName2; + if (index4 === 0) { + context2.flags |= 16777216; + symbolName2 = getNameOfSymbolAsWritten(symbol2, context2); + context2.approximateLength += (symbolName2 ? symbolName2.length : 0) + 1; + context2.flags ^= 16777216; + } else { + if (parent22 && getExportsOfSymbol(parent22)) { + const exports29 = getExportsOfSymbol(parent22); + forEachEntry(exports29, (ex, name2) => { + if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name2) && name2 !== "export=") { + symbolName2 = unescapeLeadingUnderscores(name2); + return true; + } + }); + } + } + if (symbolName2 === void 0) { + const name2 = firstDefined(symbol2.declarations, getNameOfDeclaration); + if (name2 && isComputedPropertyName(name2) && isEntityName(name2.expression)) { + const LHS = createAccessFromSymbolChain(chain22, index4 - 1, stopper); + if (isEntityName(LHS)) { + return factory.createIndexedAccessTypeNode(factory.createParenthesizedType(factory.createTypeQueryNode(LHS)), factory.createTypeQueryNode(name2.expression)); + } + return LHS; + } + symbolName2 = getNameOfSymbolAsWritten(symbol2, context2); + } + context2.approximateLength += symbolName2.length + 1; + if (!(context2.flags & 16) && parent22 && getMembersOfSymbol(parent22) && getMembersOfSymbol(parent22).get(symbol2.escapedName) && getSymbolIfSameReference(getMembersOfSymbol(parent22).get(symbol2.escapedName), symbol2)) { + const LHS = createAccessFromSymbolChain(chain22, index4 - 1, stopper); + if (isIndexedAccessTypeNode(LHS)) { + return factory.createIndexedAccessTypeNode(LHS, factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); + } else { + return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2))); + } + } + const identifier = setEmitFlags( + factory.createIdentifier(symbolName2), + 16777216 + /* NoAsciiEscaping */ + ); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + if (index4 > stopper) { + const LHS = createAccessFromSymbolChain(chain22, index4 - 1, stopper); + if (!isEntityName(LHS)) { + return Debug.fail("Impossible construct - an export of an indexed access cannot be reachable"); + } + return factory.createQualifiedName(LHS, identifier); + } + return identifier; + } + } + function typeParameterShadowsOtherTypeParameterInScope(escapedName, context2, type3) { + const result2 = resolveName( + context2.enclosingDeclaration, + escapedName, + 788968, + /*nameNotFoundMessage*/ + void 0, + escapedName, + /*isUse*/ + false + ); + if (result2 && result2.flags & 262144) { + return result2 !== type3.symbol; + } + return false; + } + function typeParameterToName(type3, context2) { + var _a2, _b; + if (context2.flags & 4 && context2.typeParameterNames) { + const cached = context2.typeParameterNames.get(getTypeId(type3)); + if (cached) { + return cached; + } + } + let result2 = symbolToName( + type3.symbol, + context2, + 788968, + /*expectsIdentifier*/ + true + ); + if (!(result2.kind & 80)) { + return factory.createIdentifier("(Missing type parameter)"); + } + if (context2.flags & 4) { + const rawtext = result2.escapedText; + let i7 = ((_a2 = context2.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a2.get(rawtext)) || 0; + let text = rawtext; + while (((_b = context2.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context2, type3)) { + i7++; + text = `${rawtext}_${i7}`; + } + if (text !== rawtext) { + const typeArguments = getIdentifierTypeArguments(result2); + result2 = factory.createIdentifier(text); + setIdentifierTypeArguments(result2, typeArguments); + } + (context2.typeParameterNamesByTextNextNameCount || (context2.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i7); + (context2.typeParameterNames || (context2.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type3), result2); + (context2.typeParameterNamesByText || (context2.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(text); + } + return result2; + } + function symbolToName(symbol, context2, meaning, expectsIdentifier) { + const chain3 = lookupSymbolChain(symbol, context2, meaning); + if (expectsIdentifier && chain3.length !== 1 && !context2.encounteredError && !(context2.flags & 65536)) { + context2.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain3, chain3.length - 1); + function createEntityNameFromSymbolChain(chain22, index4) { + const typeParameterNodes = lookupTypeParameterNodes(chain22, index4, context2); + const symbol2 = chain22[index4]; + if (index4 === 0) { + context2.flags |= 16777216; + } + const symbolName2 = getNameOfSymbolAsWritten(symbol2, context2); + if (index4 === 0) { + context2.flags ^= 16777216; + } + const identifier = setEmitFlags( + factory.createIdentifier(symbolName2), + 16777216 + /* NoAsciiEscaping */ + ); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + return index4 > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain22, index4 - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context2, meaning) { + const chain3 = lookupSymbolChain(symbol, context2, meaning); + return createExpressionFromSymbolChain(chain3, chain3.length - 1); + function createExpressionFromSymbolChain(chain22, index4) { + const typeParameterNodes = lookupTypeParameterNodes(chain22, index4, context2); + const symbol2 = chain22[index4]; + if (index4 === 0) { + context2.flags |= 16777216; + } + let symbolName2 = getNameOfSymbolAsWritten(symbol2, context2); + if (index4 === 0) { + context2.flags ^= 16777216; + } + let firstChar = symbolName2.charCodeAt(0); + if (isSingleOrDoubleQuote(firstChar) && some2(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) { + return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context2)); + } + if (index4 === 0 || canUsePropertyAccess(symbolName2, languageVersion)) { + const identifier = setEmitFlags( + factory.createIdentifier(symbolName2), + 16777216 + /* NoAsciiEscaping */ + ); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + return index4 > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain22, index4 - 1), identifier) : identifier; + } else { + if (firstChar === 91) { + symbolName2 = symbolName2.substring(1, symbolName2.length - 1); + firstChar = symbolName2.charCodeAt(0); + } + let expression; + if (isSingleOrDoubleQuote(firstChar) && !(symbol2.flags & 8)) { + expression = factory.createStringLiteral( + stripQuotes(symbolName2).replace(/\\./g, (s7) => s7.substring(1)), + firstChar === 39 + /* singleQuote */ + ); + } else if ("" + +symbolName2 === symbolName2) { + expression = factory.createNumericLiteral(+symbolName2); + } + if (!expression) { + const identifier = setEmitFlags( + factory.createIdentifier(symbolName2), + 16777216 + /* NoAsciiEscaping */ + ); + if (typeParameterNodes) + setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes)); + identifier.symbol = symbol2; + expression = identifier; + } + return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain22, index4 - 1), expression); + } + } + } + function isStringNamed(d7) { + const name2 = getNameOfDeclaration(d7); + if (!name2) { + return false; + } + if (isComputedPropertyName(name2)) { + const type3 = checkExpression(name2.expression); + return !!(type3.flags & 402653316); + } + if (isElementAccessExpression(name2)) { + const type3 = checkExpression(name2.argumentExpression); + return !!(type3.flags & 402653316); + } + return isStringLiteral(name2); + } + function isSingleQuotedStringNamed(d7) { + const name2 = getNameOfDeclaration(d7); + return !!(name2 && isStringLiteral(name2) && (name2.singleQuote || !nodeIsSynthesized(name2) && startsWith2(getTextOfNode( + name2, + /*includeTrivia*/ + false + ), "'"))); + } + function getPropertyNameNodeForSymbol(symbol, context2) { + const stringNamed = !!length(symbol.declarations) && every2(symbol.declarations, isStringNamed); + const singleQuote2 = !!length(symbol.declarations) && every2(symbol.declarations, isSingleQuotedStringNamed); + const isMethod = !!(symbol.flags & 8192); + const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context2, singleQuote2, stringNamed, isMethod); + if (fromNameType) { + return fromNameType; + } + const rawName = unescapeLeadingUnderscores(symbol.escapedName); + return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote2, stringNamed, isMethod); + } + function getPropertyNameNodeForSymbolFromNameType(symbol, context2, singleQuote2, stringNamed, isMethod) { + const nameType = getSymbolLinks(symbol).nameType; + if (nameType) { + if (nameType.flags & 384) { + const name2 = "" + nameType.value; + if (!isIdentifierText(name2, getEmitScriptTarget(compilerOptions)) && (stringNamed || !isNumericLiteralName(name2))) { + return factory.createStringLiteral(name2, !!singleQuote2); + } + if (isNumericLiteralName(name2) && startsWith2(name2, "-")) { + return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41, factory.createNumericLiteral(-name2))); + } + return createPropertyNameNodeForIdentifierOrLiteral(name2, getEmitScriptTarget(compilerOptions), singleQuote2, stringNamed, isMethod); + } + if (nameType.flags & 8192) { + return factory.createComputedPropertyName(symbolToExpression( + nameType.symbol, + context2, + 111551 + /* Value */ + )); + } + } + } + function cloneNodeBuilderContext(context2) { + const initial2 = { ...context2 }; + if (initial2.typeParameterNames) { + initial2.typeParameterNames = new Map(initial2.typeParameterNames); + } + if (initial2.typeParameterNamesByText) { + initial2.typeParameterNamesByText = new Set(initial2.typeParameterNamesByText); + } + if (initial2.typeParameterSymbolList) { + initial2.typeParameterSymbolList = new Set(initial2.typeParameterSymbolList); + } + initial2.tracker = new SymbolTrackerImpl(initial2, initial2.tracker.inner, initial2.tracker.moduleResolverHost); + return initial2; + } + function getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration) { + return symbol.declarations && find2(symbol.declarations, (s7) => !!getEffectiveTypeAnnotationNode(s7) && (!enclosingDeclaration || !!findAncestor(s7, (n7) => n7 === enclosingDeclaration))); + } + function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type3) { + return !(getObjectFlags(type3) & 4) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type3.target.typeParameters); + } + function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) { + while (getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration) { + enclosingDeclaration = enclosingDeclaration.parent; + } + return enclosingDeclaration; + } + function serializeTypeForDeclaration(context2, type3, symbol, enclosingDeclaration, includePrivateSymbol, bundled) { + if (!isErrorType(type3) && enclosingDeclaration) { + const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration)); + if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) { + const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation); + if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type3) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type3)) { + const result22 = serializeExistingTypeNode(context2, existing, includePrivateSymbol, bundled); + if (result22) { + return result22; + } + } + } + } + const oldFlags = context2.flags; + if (type3.flags & 8192 && type3.symbol === symbol && (!context2.enclosingDeclaration || some2(symbol.declarations, (d7) => getSourceFileOfNode(d7) === getSourceFileOfNode(context2.enclosingDeclaration)))) { + context2.flags |= 1048576; + } + const result2 = typeToTypeNodeHelper(type3, context2); + context2.flags = oldFlags; + return result2; + } + function typeNodeIsEquivalentToType(typeNode, annotatedDeclaration, type3) { + const typeFromTypeNode = getTypeFromTypeNode(typeNode); + if (typeFromTypeNode === type3) { + return true; + } + if (isParameter(annotatedDeclaration) && annotatedDeclaration.questionToken) { + return getTypeWithFacts( + type3, + 524288 + /* NEUndefined */ + ) === typeFromTypeNode; + } + return false; + } + function serializeReturnTypeForSignature(context2, type3, signature, includePrivateSymbol, bundled) { + if (!isErrorType(type3) && context2.enclosingDeclaration) { + const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); + const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context2.enclosingDeclaration); + if (!!findAncestor(annotation, (n7) => n7 === enclosingDeclarationIgnoringFakeScope) && annotation) { + const annotated = getTypeFromTypeNode(annotation); + const thisInstantiated = annotated.flags & 262144 && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated; + if (thisInstantiated === type3 && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type3)) { + const result2 = serializeExistingTypeNode(context2, annotation, includePrivateSymbol, bundled); + if (result2) { + return result2; + } + } + } + } + return typeToTypeNodeHelper(type3, context2); + } + function trackExistingEntityName(node, context2, includePrivateSymbol) { + let introducesError = false; + const leftmost = getFirstIdentifier(node); + if (isInJSFile(node) && (isExportsIdentifier(leftmost) || isModuleExportsAccessExpression(leftmost.parent) || isQualifiedName(leftmost.parent) && isModuleIdentifier(leftmost.parent.left) && isExportsIdentifier(leftmost.parent.right))) { + introducesError = true; + return { introducesError, node }; + } + const meaning = getMeaningOfEntityNameReference(node); + const sym = resolveEntityName( + leftmost, + meaning, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true + ); + if (sym) { + if (isSymbolAccessible( + sym, + context2.enclosingDeclaration, + meaning, + /*shouldComputeAliasesToMakeVisible*/ + false + ).accessibility !== 0) { + introducesError = true; + } else { + context2.tracker.trackSymbol(sym, context2.enclosingDeclaration, meaning); + includePrivateSymbol == null ? void 0 : includePrivateSymbol(sym); + } + if (isIdentifier(node)) { + const type3 = getDeclaredTypeOfSymbol(sym); + const name2 = sym.flags & 262144 ? typeParameterToName(type3, context2) : factory.cloneNode(node); + name2.symbol = sym; + return { introducesError, node: setEmitFlags( + setOriginalNode(name2, node), + 16777216 + /* NoAsciiEscaping */ + ) }; + } + } + return { introducesError, node }; + } + function serializeExistingTypeNode(context2, existing, includePrivateSymbol, bundled) { + if (cancellationToken && cancellationToken.throwIfCancellationRequested) { + cancellationToken.throwIfCancellationRequested(); + } + let hadError = false; + const file = getSourceFileOfNode(existing); + const transformed = visitNode(existing, visitExistingNodeTreeSymbols, isTypeNode); + if (hadError) { + return void 0; + } + return transformed === existing ? setTextRange(factory.cloneNode(existing), existing) : transformed; + function visitExistingNodeTreeSymbols(node) { + if (isJSDocAllType(node) || node.kind === 326) { + return factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + if (isJSDocUnknownType(node)) { + return factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ); + } + if (isJSDocNullableType(node)) { + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createLiteralTypeNode(factory.createNull())]); + } + if (isJSDocOptionalType(node)) { + return factory.createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode), factory.createKeywordTypeNode( + 157 + /* UndefinedKeyword */ + )]); + } + if (isJSDocNonNullableType(node)) { + return visitNode(node.type, visitExistingNodeTreeSymbols); + } + if (isJSDocVariadicType(node)) { + return factory.createArrayTypeNode(visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode)); + } + if (isJSDocTypeLiteral(node)) { + return factory.createTypeLiteralNode(map4(node.jsDocPropertyTags, (t8) => { + const name2 = isIdentifier(t8.name) ? t8.name : t8.name.right; + const typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name2.escapedText); + const overrideTypeNode = typeViaParent && t8.typeExpression && getTypeFromTypeNode(t8.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context2) : void 0; + return factory.createPropertySignature( + /*modifiers*/ + void 0, + name2, + t8.isBracketed || t8.typeExpression && isJSDocOptionalType(t8.typeExpression.type) ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + overrideTypeNode || t8.typeExpression && visitNode(t8.typeExpression.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ); + })); + } + if (isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "") { + return setOriginalNode(factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ), node); + } + if ((isExpressionWithTypeArguments(node) || isTypeReferenceNode(node)) && isJSDocIndexSignature(node)) { + return factory.createTypeLiteralNode([factory.createIndexSignature( + /*modifiers*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "x", + /*questionToken*/ + void 0, + visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, isTypeNode) + )], + visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols, isTypeNode) + )]); + } + if (isJSDocFunctionType(node)) { + if (isJSDocConstructSignature(node)) { + let newTypeNode; + return factory.createConstructorTypeNode( + /*modifiers*/ + void 0, + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), + mapDefined(node.parameters, (p7, i7) => p7.name && isIdentifier(p7.name) && p7.name.escapedText === "new" ? (newTypeNode = p7.type, void 0) : factory.createParameterDeclaration( + /*modifiers*/ + void 0, + getEffectiveDotDotDotForParameter(p7), + getNameForJSDocFunctionParameter(p7, i7), + p7.questionToken, + visitNode(p7.type, visitExistingNodeTreeSymbols, isTypeNode), + /*initializer*/ + void 0 + )), + visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ); + } else { + return factory.createFunctionTypeNode( + visitNodes2(node.typeParameters, visitExistingNodeTreeSymbols, isTypeParameterDeclaration), + map4(node.parameters, (p7, i7) => factory.createParameterDeclaration( + /*modifiers*/ + void 0, + getEffectiveDotDotDotForParameter(p7), + getNameForJSDocFunctionParameter(p7, i7), + p7.questionToken, + visitNode(p7.type, visitExistingNodeTreeSymbols, isTypeNode), + /*initializer*/ + void 0 + )), + visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode) || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ); + } + } + if (isTypeReferenceNode(node) && isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName( + node, + 788968, + /*ignoreErrors*/ + true + ))) { + return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context2), node); + } + if (isLiteralImportTypeNode(node)) { + const nodeSymbol = getNodeLinks(node).resolvedSymbol; + if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic + (!node.isTypeOf && !(nodeSymbol.flags & 788968) || // The import type had type arguments autofilled by js fallback logic + !(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) { + return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context2), node); + } + return factory.updateImportTypeNode( + node, + factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), + node.attributes, + node.qualifier, + visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), + node.isTypeOf + ); + } + if (isEntityName(node) || isEntityNameExpression(node)) { + const { introducesError, node: result2 } = trackExistingEntityName(node, context2, includePrivateSymbol); + hadError = hadError || introducesError; + if (result2 !== node) { + return result2; + } + } + if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) { + setEmitFlags( + node, + 1 + /* SingleLine */ + ); + } + return visitEachChild( + node, + visitExistingNodeTreeSymbols, + /*context*/ + void 0 + ); + function getEffectiveDotDotDotForParameter(p7) { + return p7.dotDotDotToken || (p7.type && isJSDocVariadicType(p7.type) ? factory.createToken( + 26 + /* DotDotDotToken */ + ) : void 0); + } + function getNameForJSDocFunctionParameter(p7, index4) { + return p7.name && isIdentifier(p7.name) && p7.name.escapedText === "this" ? "this" : getEffectiveDotDotDotForParameter(p7) ? `args` : `arg${index4}`; + } + function rewriteModuleSpecifier(parent22, lit) { + if (bundled) { + if (context2.tracker && context2.tracker.moduleResolverHost) { + const targetFile = getExternalModuleFileFromDeclaration(parent22); + if (targetFile) { + const getCanonicalFileName = createGetCanonicalFileName(!!host.useCaseSensitiveFileNames); + const resolverHost = { + getCanonicalFileName, + getCurrentDirectory: () => context2.tracker.moduleResolverHost.getCurrentDirectory(), + getCommonSourceDirectory: () => context2.tracker.moduleResolverHost.getCommonSourceDirectory() + }; + const newName = getResolvedExternalModuleName(resolverHost, targetFile); + return factory.createStringLiteral(newName); + } + } + } else { + if (context2.tracker && context2.tracker.trackExternalModuleSymbolOfImportTypeNode) { + const moduleSym = resolveExternalModuleNameWorker( + lit, + lit, + /*moduleNotFoundError*/ + void 0 + ); + if (moduleSym) { + context2.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym); + } + } + } + return lit; + } + } + } + function symbolTableToDeclarationStatements(symbolTable, context2, bundled) { + var _a2; + const serializePropertySymbolForClass = makeSerializePropertySymbol( + factory.createPropertyDeclaration, + 174, + /*useAccessors*/ + true + ); + const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol( + (mods, name2, question, type3) => factory.createPropertySignature(mods, name2, question, type3), + 173, + /*useAccessors*/ + false + ); + const enclosingDeclaration = context2.enclosingDeclaration; + let results = []; + const visitedSymbols = /* @__PURE__ */ new Set(); + const deferredPrivatesStack = []; + const oldcontext = context2; + context2 = { + ...oldcontext, + usedSymbolNames: new Set(oldcontext.usedSymbolNames), + remappedSymbolNames: /* @__PURE__ */ new Map(), + remappedSymbolReferences: new Map((_a2 = oldcontext.remappedSymbolReferences) == null ? void 0 : _a2.entries()), + tracker: void 0 + }; + const tracker = { + ...oldcontext.tracker.inner, + trackSymbol: (sym, decl, meaning) => { + var _a22, _b; + if ((_a22 = context2.remappedSymbolNames) == null ? void 0 : _a22.has(getSymbolId(sym))) + return false; + const accessibleResult = isSymbolAccessible( + sym, + decl, + meaning, + /*shouldComputeAliasesToMakeVisible*/ + false + ); + if (accessibleResult.accessibility === 0) { + const chain3 = lookupSymbolChainWorker(sym, context2, meaning); + if (!(sym.flags & 4)) { + const root2 = chain3[0]; + const contextFile = getSourceFileOfNode(oldcontext.enclosingDeclaration); + if (some2(root2.declarations, (d7) => getSourceFileOfNode(d7) === contextFile)) { + includePrivateSymbol(root2); + } + } + } else if ((_b = oldcontext.tracker.inner) == null ? void 0 : _b.trackSymbol) { + return oldcontext.tracker.inner.trackSymbol(sym, decl, meaning); + } + return false; + } + }; + context2.tracker = new SymbolTrackerImpl(context2, tracker, oldcontext.tracker.moduleResolverHost); + forEachEntry(symbolTable, (symbol, name2) => { + const baseName = unescapeLeadingUnderscores(name2); + void getInternalSymbolName(symbol, baseName); + }); + let addingDeclare = !bundled; + const exportEquals = symbolTable.get( + "export=" + /* ExportEquals */ + ); + if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 | 1536)) { + symbolTable = createSymbolTable(); + symbolTable.set("export=", exportEquals); + } + visitSymbolTable(symbolTable); + return mergeRedundantStatements(results); + function isIdentifierAndNotUndefined(node) { + return !!node && node.kind === 80; + } + function getNamesOfDeclaration(statement) { + if (isVariableStatement(statement)) { + return filter2(map4(statement.declarationList.declarations, getNameOfDeclaration), isIdentifierAndNotUndefined); + } + return filter2([getNameOfDeclaration(statement)], isIdentifierAndNotUndefined); + } + function flattenExportAssignedNamespace(statements) { + const exportAssignment = find2(statements, isExportAssignment); + const nsIndex = findIndex2(statements, isModuleDeclaration); + let ns = nsIndex !== -1 ? statements[nsIndex] : void 0; + if (ns && exportAssignment && exportAssignment.isExportEquals && isIdentifier(exportAssignment.expression) && isIdentifier(ns.name) && idText(ns.name) === idText(exportAssignment.expression) && ns.body && isModuleBlock(ns.body)) { + const excessExports = filter2(statements, (s7) => !!(getEffectiveModifierFlags(s7) & 32)); + const name2 = ns.name; + let body = ns.body; + if (length(excessExports)) { + ns = factory.updateModuleDeclaration( + ns, + ns.modifiers, + ns.name, + body = factory.updateModuleBlock( + body, + factory.createNodeArray([ + ...ns.body.statements, + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(map4(flatMap2(excessExports, (e10) => getNamesOfDeclaration(e10)), (id) => factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + id + ))), + /*moduleSpecifier*/ + void 0 + ) + ]) + ) + ); + statements = [...statements.slice(0, nsIndex), ns, ...statements.slice(nsIndex + 1)]; + } + if (!find2(statements, (s7) => s7 !== ns && nodeHasName(s7, name2))) { + results = []; + const mixinExportFlag = !some2(body.statements, (s7) => hasSyntacticModifier( + s7, + 32 + /* Export */ + ) || isExportAssignment(s7) || isExportDeclaration(s7)); + forEach4(body.statements, (s7) => { + addResult( + s7, + mixinExportFlag ? 32 : 0 + /* None */ + ); + }); + statements = [...filter2(statements, (s7) => s7 !== ns && s7 !== exportAssignment), ...results]; + } + } + return statements; + } + function mergeExportDeclarations(statements) { + const exports29 = filter2(statements, (d7) => isExportDeclaration(d7) && !d7.moduleSpecifier && !!d7.exportClause && isNamedExports(d7.exportClause)); + if (length(exports29) > 1) { + const nonExports = filter2(statements, (d7) => !isExportDeclaration(d7) || !!d7.moduleSpecifier || !d7.exportClause); + statements = [ + ...nonExports, + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(flatMap2(exports29, (e10) => cast(e10.exportClause, isNamedExports).elements)), + /*moduleSpecifier*/ + void 0 + ) + ]; + } + const reexports = filter2(statements, (d7) => isExportDeclaration(d7) && !!d7.moduleSpecifier && !!d7.exportClause && isNamedExports(d7.exportClause)); + if (length(reexports) > 1) { + const groups = group2(reexports, (decl) => isStringLiteral(decl.moduleSpecifier) ? ">" + decl.moduleSpecifier.text : ">"); + if (groups.length !== reexports.length) { + for (const group22 of groups) { + if (group22.length > 1) { + statements = [ + ...filter2(statements, (s7) => !group22.includes(s7)), + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(flatMap2(group22, (e10) => cast(e10.exportClause, isNamedExports).elements)), + group22[0].moduleSpecifier + ) + ]; + } + } + } + } + return statements; + } + function inlineExportModifiers(statements) { + const index4 = findIndex2(statements, (d7) => isExportDeclaration(d7) && !d7.moduleSpecifier && !d7.attributes && !!d7.exportClause && isNamedExports(d7.exportClause)); + if (index4 >= 0) { + const exportDecl = statements[index4]; + const replacements = mapDefined(exportDecl.exportClause.elements, (e10) => { + if (!e10.propertyName) { + const indices = indicesOf(statements); + const associatedIndices = filter2(indices, (i7) => nodeHasName(statements[i7], e10.name)); + if (length(associatedIndices) && every2(associatedIndices, (i7) => canHaveExportModifier(statements[i7]))) { + for (const index22 of associatedIndices) { + statements[index22] = addExportModifier(statements[index22]); + } + return void 0; + } + } + return e10; + }); + if (!length(replacements)) { + orderedRemoveItemAt(statements, index4); + } else { + statements[index4] = factory.updateExportDeclaration( + exportDecl, + exportDecl.modifiers, + exportDecl.isTypeOnly, + factory.updateNamedExports( + exportDecl.exportClause, + replacements + ), + exportDecl.moduleSpecifier, + exportDecl.attributes + ); + } + } + return statements; + } + function mergeRedundantStatements(statements) { + statements = flattenExportAssignedNamespace(statements); + statements = mergeExportDeclarations(statements); + statements = inlineExportModifiers(statements); + if (enclosingDeclaration && (isSourceFile(enclosingDeclaration) && isExternalOrCommonJsModule(enclosingDeclaration) || isModuleDeclaration(enclosingDeclaration)) && (!some2(statements, isExternalModuleIndicator) || !hasScopeMarker(statements) && some2(statements, needsScopeMarker))) { + statements.push(createEmptyExports(factory)); + } + return statements; + } + function addExportModifier(node) { + const flags = (getEffectiveModifierFlags(node) | 32) & ~128; + return factory.replaceModifiers(node, flags); + } + function removeExportModifier(node) { + const flags = getEffectiveModifierFlags(node) & ~32; + return factory.replaceModifiers(node, flags); + } + function visitSymbolTable(symbolTable2, suppressNewPrivateContext, propertyAsAlias) { + if (!suppressNewPrivateContext) { + deferredPrivatesStack.push(/* @__PURE__ */ new Map()); + } + symbolTable2.forEach((symbol) => { + serializeSymbol( + symbol, + /*isPrivate*/ + false, + !!propertyAsAlias + ); + }); + if (!suppressNewPrivateContext) { + deferredPrivatesStack[deferredPrivatesStack.length - 1].forEach((symbol) => { + serializeSymbol( + symbol, + /*isPrivate*/ + true, + !!propertyAsAlias + ); + }); + deferredPrivatesStack.pop(); + } + } + function serializeSymbol(symbol, isPrivate, propertyAsAlias) { + const visitedSym = getMergedSymbol(symbol); + if (visitedSymbols.has(getSymbolId(visitedSym))) { + return; + } + visitedSymbols.add(getSymbolId(visitedSym)); + const skipMembershipCheck = !isPrivate; + if (skipMembershipCheck || !!length(symbol.declarations) && some2(symbol.declarations, (d7) => !!findAncestor(d7, (n7) => n7 === enclosingDeclaration))) { + const oldContext = context2; + context2 = cloneNodeBuilderContext(context2); + serializeSymbolWorker(symbol, isPrivate, propertyAsAlias); + if (context2.reportedDiagnostic) { + oldcontext.reportedDiagnostic = context2.reportedDiagnostic; + } + if (context2.trackedSymbols) { + if (!oldContext.trackedSymbols) + oldContext.trackedSymbols = context2.trackedSymbols; + else + Debug.assert(context2.trackedSymbols === oldContext.trackedSymbols); + } + context2 = oldContext; + } + } + function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias, escapedSymbolName = symbol.escapedName) { + var _a22, _b, _c, _d, _e2, _f; + const symbolName2 = unescapeLeadingUnderscores(escapedSymbolName); + const isDefault = escapedSymbolName === "default"; + if (isPrivate && !(context2.flags & 131072) && isStringANonContextualKeyword(symbolName2) && !isDefault) { + context2.encounteredError = true; + return; + } + let needsPostExportDefault = isDefault && !!(symbol.flags & -113 || symbol.flags & 16 && length(getPropertiesOfType(getTypeOfSymbol(symbol)))) && !(symbol.flags & 2097152); + let needsExportDeclaration = !needsPostExportDefault && !isPrivate && isStringANonContextualKeyword(symbolName2) && !isDefault; + if (needsPostExportDefault || needsExportDeclaration) { + isPrivate = true; + } + const modifierFlags = (!isPrivate ? 32 : 0) | (isDefault && !needsPostExportDefault ? 2048 : 0); + const isConstMergedWithNS = symbol.flags & 1536 && symbol.flags & (2 | 1 | 4) && escapedSymbolName !== "export="; + const isConstMergedWithNSPrintableAsSignatureMerge = isConstMergedWithNS && isTypeRepresentableAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol); + if (symbol.flags & (16 | 8192) || isConstMergedWithNSPrintableAsSignatureMerge) { + serializeAsFunctionNamespaceMerge(getTypeOfSymbol(symbol), symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); + } + if (symbol.flags & 524288) { + serializeTypeAlias(symbol, symbolName2, modifierFlags); + } + if (symbol.flags & (2 | 1 | 4 | 98304) && escapedSymbolName !== "export=" && !(symbol.flags & 4194304) && !(symbol.flags & 32) && !(symbol.flags & 8192) && !isConstMergedWithNSPrintableAsSignatureMerge) { + if (propertyAsAlias) { + const createdExport = serializeMaybeAliasAssignment(symbol); + if (createdExport) { + needsExportDeclaration = false; + needsPostExportDefault = false; + } + } else { + const type3 = getTypeOfSymbol(symbol); + const localName = getInternalSymbolName(symbol, symbolName2); + if (type3.symbol && type3.symbol !== symbol && type3.symbol.flags & 16 && some2(type3.symbol.declarations, isFunctionExpressionOrArrowFunction) && (((_a22 = type3.symbol.members) == null ? void 0 : _a22.size) || ((_b = type3.symbol.exports) == null ? void 0 : _b.size))) { + if (!context2.remappedSymbolReferences) { + context2.remappedSymbolReferences = /* @__PURE__ */ new Map(); + } + context2.remappedSymbolReferences.set(getSymbolId(type3.symbol), symbol); + serializeSymbolWorker(type3.symbol, isPrivate, propertyAsAlias, escapedSymbolName); + context2.remappedSymbolReferences.delete(getSymbolId(type3.symbol)); + } else if (!(symbol.flags & 16) && isTypeRepresentableAsFunctionNamespaceMerge(type3, symbol)) { + serializeAsFunctionNamespaceMerge(type3, symbol, localName, modifierFlags); + } else { + const flags = !(symbol.flags & 2) ? ((_c = symbol.parent) == null ? void 0 : _c.valueDeclaration) && isSourceFile((_d = symbol.parent) == null ? void 0 : _d.valueDeclaration) ? 2 : void 0 : isConstantVariable(symbol) ? 2 : 1; + const name2 = needsPostExportDefault || !(symbol.flags & 4) ? localName : getUnusedName(localName, symbol); + let textRange = symbol.declarations && find2(symbol.declarations, (d7) => isVariableDeclaration(d7)); + if (textRange && isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) { + textRange = textRange.parent.parent; + } + const propertyAccessRequire = (_e2 = symbol.declarations) == null ? void 0 : _e2.find(isPropertyAccessExpression); + if (propertyAccessRequire && isBinaryExpression(propertyAccessRequire.parent) && isIdentifier(propertyAccessRequire.parent.right) && ((_f = type3.symbol) == null ? void 0 : _f.valueDeclaration) && isSourceFile(type3.symbol.valueDeclaration)) { + const alias = localName === propertyAccessRequire.parent.right.escapedText ? void 0 : propertyAccessRequire.parent.right; + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + alias, + localName + )]) + ), + 0 + /* None */ + ); + context2.tracker.trackSymbol( + type3.symbol, + context2.enclosingDeclaration, + 111551 + /* Value */ + ); + } else { + const statement = setTextRange( + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + serializeTypeForDeclaration(context2, type3, symbol, enclosingDeclaration, includePrivateSymbol, bundled) + ) + ], flags) + ), + textRange + ); + addResult(statement, name2 !== localName ? modifierFlags & ~32 : modifierFlags); + if (name2 !== localName && !isPrivate) { + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + name2, + localName + )]) + ), + 0 + /* None */ + ); + needsExportDeclaration = false; + needsPostExportDefault = false; + } + } + } + } + } + if (symbol.flags & 384) { + serializeEnum(symbol, symbolName2, modifierFlags); + } + if (symbol.flags & 32) { + if (symbol.flags & 4 && symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration.parent) && isClassExpression(symbol.valueDeclaration.parent.right)) { + serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); + } else { + serializeAsClass(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); + } + } + if (symbol.flags & (512 | 1024) && (!isConstMergedWithNS || isTypeOnlyNamespace(symbol)) || isConstMergedWithNSPrintableAsSignatureMerge) { + serializeModule(symbol, symbolName2, modifierFlags); + } + if (symbol.flags & 64 && !(symbol.flags & 32)) { + serializeInterface(symbol, symbolName2, modifierFlags); + } + if (symbol.flags & 2097152) { + serializeAsAlias(symbol, getInternalSymbolName(symbol, symbolName2), modifierFlags); + } + if (symbol.flags & 4 && symbol.escapedName === "export=") { + serializeMaybeAliasAssignment(symbol); + } + if (symbol.flags & 8388608) { + if (symbol.declarations) { + for (const node of symbol.declarations) { + const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier); + if (!resolvedModule) + continue; + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + node.isTypeOnly, + /*exportClause*/ + void 0, + factory.createStringLiteral(getSpecifierForModuleSymbol(resolvedModule, context2)) + ), + 0 + /* None */ + ); + } + } + } + if (needsPostExportDefault) { + addResult( + factory.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + factory.createIdentifier(getInternalSymbolName(symbol, symbolName2)) + ), + 0 + /* None */ + ); + } else if (needsExportDeclaration) { + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + getInternalSymbolName(symbol, symbolName2), + symbolName2 + )]) + ), + 0 + /* None */ + ); + } + } + function includePrivateSymbol(symbol) { + if (some2(symbol.declarations, isParameterDeclaration)) + return; + Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]); + getUnusedName(unescapeLeadingUnderscores(symbol.escapedName), symbol); + const isExternalImportAlias = !!(symbol.flags & 2097152) && !some2(symbol.declarations, (d7) => !!findAncestor(d7, isExportDeclaration) || isNamespaceExport(d7) || isImportEqualsDeclaration(d7) && !isExternalModuleReference(d7.moduleReference)); + deferredPrivatesStack[isExternalImportAlias ? 0 : deferredPrivatesStack.length - 1].set(getSymbolId(symbol), symbol); + } + function isExportingScope(enclosingDeclaration2) { + return isSourceFile(enclosingDeclaration2) && (isExternalOrCommonJsModule(enclosingDeclaration2) || isJsonSourceFile(enclosingDeclaration2)) || isAmbientModule(enclosingDeclaration2) && !isGlobalScopeAugmentation(enclosingDeclaration2); + } + function addResult(node, additionalModifierFlags) { + if (canHaveModifiers(node)) { + let newModifierFlags = 0; + const enclosingDeclaration2 = context2.enclosingDeclaration && (isJSDocTypeAlias(context2.enclosingDeclaration) ? getSourceFileOfNode(context2.enclosingDeclaration) : context2.enclosingDeclaration); + if (additionalModifierFlags & 32 && enclosingDeclaration2 && (isExportingScope(enclosingDeclaration2) || isModuleDeclaration(enclosingDeclaration2)) && canHaveExportModifier(node)) { + newModifierFlags |= 32; + } + if (addingDeclare && !(newModifierFlags & 32) && (!enclosingDeclaration2 || !(enclosingDeclaration2.flags & 33554432)) && (isEnumDeclaration(node) || isVariableStatement(node) || isFunctionDeclaration(node) || isClassDeclaration(node) || isModuleDeclaration(node))) { + newModifierFlags |= 128; + } + if (additionalModifierFlags & 2048 && (isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionDeclaration(node))) { + newModifierFlags |= 2048; + } + if (newModifierFlags) { + node = factory.replaceModifiers(node, newModifierFlags | getEffectiveModifierFlags(node)); + } + } + results.push(node); + } + function serializeTypeAlias(symbol, symbolName2, modifierFlags) { + var _a22; + const aliasType = getDeclaredTypeOfTypeAlias(symbol); + const typeParams = getSymbolLinks(symbol).typeParameters; + const typeParamDecls = map4(typeParams, (p7) => typeParameterToDeclaration(p7, context2)); + const jsdocAliasDecl = (_a22 = symbol.declarations) == null ? void 0 : _a22.find(isJSDocTypeAlias); + const commentText = getTextOfJSDocComment(jsdocAliasDecl ? jsdocAliasDecl.comment || jsdocAliasDecl.parent.comment : void 0); + const oldFlags = context2.flags; + context2.flags |= 8388608; + const oldEnclosingDecl = context2.enclosingDeclaration; + context2.enclosingDeclaration = jsdocAliasDecl; + const typeNode = jsdocAliasDecl && jsdocAliasDecl.typeExpression && isJSDocTypeExpression(jsdocAliasDecl.typeExpression) && serializeExistingTypeNode(context2, jsdocAliasDecl.typeExpression.type, includePrivateSymbol, bundled) || typeToTypeNodeHelper(aliasType, context2); + addResult( + setSyntheticLeadingComments( + factory.createTypeAliasDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName2), + typeParamDecls, + typeNode + ), + !commentText ? [] : [{ kind: 3, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }] + ), + modifierFlags + ); + context2.flags = oldFlags; + context2.enclosingDeclaration = oldEnclosingDecl; + } + function serializeInterface(symbol, symbolName2, modifierFlags) { + const interfaceType = getDeclaredTypeOfClassOrInterface(symbol); + const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + const typeParamDecls = map4(localParams, (p7) => typeParameterToDeclaration(p7, context2)); + const baseTypes = getBaseTypes(interfaceType); + const baseType = length(baseTypes) ? getIntersectionType(baseTypes) : void 0; + const members = flatMap2(getPropertiesOfType(interfaceType), (p7) => serializePropertySymbolForInterface(p7, baseType)); + const callSignatures = serializeSignatures( + 0, + interfaceType, + baseType, + 179 + /* CallSignature */ + ); + const constructSignatures = serializeSignatures( + 1, + interfaceType, + baseType, + 180 + /* ConstructSignature */ + ); + const indexSignatures = serializeIndexSignatures(interfaceType, baseType); + const heritageClauses = !length(baseTypes) ? void 0 : [factory.createHeritageClause(96, mapDefined(baseTypes, (b8) => trySerializeAsTypeReference( + b8, + 111551 + /* Value */ + )))]; + addResult( + factory.createInterfaceDeclaration( + /*modifiers*/ + void 0, + getInternalSymbolName(symbol, symbolName2), + typeParamDecls, + heritageClauses, + [...indexSignatures, ...constructSignatures, ...callSignatures, ...members] + ), + modifierFlags + ); + } + function getNamespaceMembersForSerialization(symbol) { + let exports29 = arrayFrom(getExportsOfSymbol(symbol).values()); + const merged = getMergedSymbol(symbol); + if (merged !== symbol) { + const membersSet = new Set(exports29); + for (const exported of getExportsOfSymbol(merged).values()) { + if (!(getSymbolFlags(resolveSymbol(exported)) & 111551)) { + membersSet.add(exported); + } + } + exports29 = arrayFrom(membersSet); + } + return filter2(exports29, (m7) => isNamespaceMember(m7) && isIdentifierText( + m7.escapedName, + 99 + /* ESNext */ + )); + } + function isTypeOnlyNamespace(symbol) { + return every2(getNamespaceMembersForSerialization(symbol), (m7) => !(getSymbolFlags(resolveSymbol(m7)) & 111551)); + } + function serializeModule(symbol, symbolName2, modifierFlags) { + const members = getNamespaceMembersForSerialization(symbol); + const locationMap = arrayToMultiMap(members, (m7) => m7.parent && m7.parent === symbol ? "real" : "merged"); + const realMembers = locationMap.get("real") || emptyArray; + const mergedMembers = locationMap.get("merged") || emptyArray; + if (length(realMembers)) { + const localName = getInternalSymbolName(symbol, symbolName2); + serializeAsNamespaceDeclaration(realMembers, localName, modifierFlags, !!(symbol.flags & (16 | 67108864))); + } + if (length(mergedMembers)) { + const containingFile = getSourceFileOfNode(context2.enclosingDeclaration); + const localName = getInternalSymbolName(symbol, symbolName2); + const nsBody = factory.createModuleBlock([factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(mapDefined(filter2( + mergedMembers, + (n7) => n7.escapedName !== "export=" + /* ExportEquals */ + ), (s7) => { + var _a22, _b; + const name2 = unescapeLeadingUnderscores(s7.escapedName); + const localName2 = getInternalSymbolName(s7, name2); + const aliasDecl = s7.declarations && getDeclarationOfAliasSymbol(s7); + if (containingFile && (aliasDecl ? containingFile !== getSourceFileOfNode(aliasDecl) : !some2(s7.declarations, (d7) => getSourceFileOfNode(d7) === containingFile))) { + (_b = (_a22 = context2.tracker) == null ? void 0 : _a22.reportNonlocalAugmentation) == null ? void 0 : _b.call(_a22, containingFile, symbol, s7); + return void 0; + } + const target = aliasDecl && getTargetOfAliasDeclaration( + aliasDecl, + /*dontRecursivelyResolve*/ + true + ); + includePrivateSymbol(target || s7); + const targetName = target ? getInternalSymbolName(target, unescapeLeadingUnderscores(target.escapedName)) : localName2; + return factory.createExportSpecifier( + /*isTypeOnly*/ + false, + name2 === targetName ? void 0 : targetName, + name2 + ); + })) + )]); + addResult( + factory.createModuleDeclaration( + /*modifiers*/ + void 0, + factory.createIdentifier(localName), + nsBody, + 32 + /* Namespace */ + ), + 0 + /* None */ + ); + } + } + function serializeEnum(symbol, symbolName2, modifierFlags) { + addResult( + factory.createEnumDeclaration( + factory.createModifiersFromModifierFlags(isConstEnumSymbol(symbol) ? 4096 : 0), + getInternalSymbolName(symbol, symbolName2), + map4(filter2(getPropertiesOfType(getTypeOfSymbol(symbol)), (p7) => !!(p7.flags & 8)), (p7) => { + const initializedValue = p7.declarations && p7.declarations[0] && isEnumMember(p7.declarations[0]) ? getConstantValue2(p7.declarations[0]) : void 0; + return factory.createEnumMember( + unescapeLeadingUnderscores(p7.escapedName), + initializedValue === void 0 ? void 0 : typeof initializedValue === "string" ? factory.createStringLiteral(initializedValue) : factory.createNumericLiteral(initializedValue) + ); + }) + ), + modifierFlags + ); + } + function serializeAsFunctionNamespaceMerge(type3, symbol, localName, modifierFlags) { + const signatures = getSignaturesOfType( + type3, + 0 + /* Call */ + ); + for (const sig of signatures) { + const decl = signatureToSignatureDeclarationHelper(sig, 262, context2, { name: factory.createIdentifier(localName), privateSymbolVisitor: includePrivateSymbol, bundledImports: bundled }); + addResult(setTextRange(decl, getSignatureTextRangeLocation(sig)), modifierFlags); + } + if (!(symbol.flags & (512 | 1024) && !!symbol.exports && !!symbol.exports.size)) { + const props = filter2(getPropertiesOfType(type3), isNamespaceMember); + serializeAsNamespaceDeclaration( + props, + localName, + modifierFlags, + /*suppressNewPrivateContext*/ + true + ); + } + } + function getSignatureTextRangeLocation(signature) { + if (signature.declaration && signature.declaration.parent) { + if (isBinaryExpression(signature.declaration.parent) && getAssignmentDeclarationKind(signature.declaration.parent) === 5) { + return signature.declaration.parent; + } + if (isVariableDeclaration(signature.declaration.parent) && signature.declaration.parent.parent) { + return signature.declaration.parent.parent; + } + } + return signature.declaration; + } + function serializeAsNamespaceDeclaration(props, localName, modifierFlags, suppressNewPrivateContext) { + if (length(props)) { + const localVsRemoteMap = arrayToMultiMap(props, (p7) => !length(p7.declarations) || some2(p7.declarations, (d7) => getSourceFileOfNode(d7) === getSourceFileOfNode(context2.enclosingDeclaration)) ? "local" : "remote"); + const localProps = localVsRemoteMap.get("local") || emptyArray; + let fakespace = parseNodeFactory.createModuleDeclaration( + /*modifiers*/ + void 0, + factory.createIdentifier(localName), + factory.createModuleBlock([]), + 32 + /* Namespace */ + ); + setParent(fakespace, enclosingDeclaration); + fakespace.locals = createSymbolTable(props); + fakespace.symbol = props[0].parent; + const oldResults = results; + results = []; + const oldAddingDeclare = addingDeclare; + addingDeclare = false; + const subcontext = { ...context2, enclosingDeclaration: fakespace }; + const oldContext = context2; + context2 = subcontext; + visitSymbolTable( + createSymbolTable(localProps), + suppressNewPrivateContext, + /*propertyAsAlias*/ + true + ); + context2 = oldContext; + addingDeclare = oldAddingDeclare; + const declarations = results; + results = oldResults; + const defaultReplaced = map4(declarations, (d7) => isExportAssignment(d7) && !d7.isExportEquals && isIdentifier(d7.expression) ? factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + d7.expression, + factory.createIdentifier( + "default" + /* Default */ + ) + )]) + ) : d7); + const exportModifierStripped = every2(defaultReplaced, (d7) => hasSyntacticModifier( + d7, + 32 + /* Export */ + )) ? map4(defaultReplaced, removeExportModifier) : defaultReplaced; + fakespace = factory.updateModuleDeclaration( + fakespace, + fakespace.modifiers, + fakespace.name, + factory.createModuleBlock(exportModifierStripped) + ); + addResult(fakespace, modifierFlags); + } + } + function isNamespaceMember(p7) { + return !!(p7.flags & (788968 | 1920 | 2097152)) || !(p7.flags & 4194304 || p7.escapedName === "prototype" || p7.valueDeclaration && isStatic(p7.valueDeclaration) && isClassLike(p7.valueDeclaration.parent)); + } + function sanitizeJSDocImplements(clauses) { + const result2 = mapDefined(clauses, (e10) => { + const oldEnclosing = context2.enclosingDeclaration; + context2.enclosingDeclaration = e10; + let expr = e10.expression; + if (isEntityNameExpression(expr)) { + if (isIdentifier(expr) && idText(expr) === "") { + return cleanup( + /*result*/ + void 0 + ); + } + let introducesError; + ({ introducesError, node: expr } = trackExistingEntityName(expr, context2, includePrivateSymbol)); + if (introducesError) { + return cleanup( + /*result*/ + void 0 + ); + } + } + return cleanup(factory.createExpressionWithTypeArguments( + expr, + map4(e10.typeArguments, (a7) => serializeExistingTypeNode(context2, a7, includePrivateSymbol, bundled) || typeToTypeNodeHelper(getTypeFromTypeNode(a7), context2)) + )); + function cleanup(result22) { + context2.enclosingDeclaration = oldEnclosing; + return result22; + } + }); + if (result2.length === clauses.length) { + return result2; + } + return void 0; + } + function serializeAsClass(symbol, localName, modifierFlags) { + var _a22, _b; + const originalDecl = (_a22 = symbol.declarations) == null ? void 0 : _a22.find(isClassLike); + const oldEnclosing = context2.enclosingDeclaration; + context2.enclosingDeclaration = originalDecl || oldEnclosing; + const localParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + const typeParamDecls = map4(localParams, (p7) => typeParameterToDeclaration(p7, context2)); + const classType = getTypeWithThisArgument(getDeclaredTypeOfClassOrInterface(symbol)); + const baseTypes = getBaseTypes(classType); + const originalImplements = originalDecl && getEffectiveImplementsTypeNodes(originalDecl); + const implementsExpressions = originalImplements && sanitizeJSDocImplements(originalImplements) || mapDefined(getImplementsTypes(classType), serializeImplementedType); + const staticType = getTypeOfSymbol(symbol); + const isClass3 = !!((_b = staticType.symbol) == null ? void 0 : _b.valueDeclaration) && isClassLike(staticType.symbol.valueDeclaration); + const staticBaseType = isClass3 ? getBaseConstructorTypeOfClass(staticType) : anyType2; + const heritageClauses = [ + ...!length(baseTypes) ? [] : [factory.createHeritageClause(96, map4(baseTypes, (b8) => serializeBaseType(b8, staticBaseType, localName)))], + ...!length(implementsExpressions) ? [] : [factory.createHeritageClause(119, implementsExpressions)] + ]; + const symbolProps = getNonInheritedProperties(classType, baseTypes, getPropertiesOfType(classType)); + const publicSymbolProps = filter2(symbolProps, (s7) => { + const valueDecl = s7.valueDeclaration; + return !!valueDecl && !(isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name)); + }); + const hasPrivateIdentifier = some2(symbolProps, (s7) => { + const valueDecl = s7.valueDeclaration; + return !!valueDecl && isNamedDeclaration(valueDecl) && isPrivateIdentifier(valueDecl.name); + }); + const privateProperties = hasPrivateIdentifier ? [factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + factory.createPrivateIdentifier("#private"), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )] : emptyArray; + const publicProperties = flatMap2(publicSymbolProps, (p7) => serializePropertySymbolForClass( + p7, + /*isStatic*/ + false, + baseTypes[0] + )); + const staticMembers = flatMap2( + filter2(getPropertiesOfType(staticType), (p7) => !(p7.flags & 4194304) && p7.escapedName !== "prototype" && !isNamespaceMember(p7)), + (p7) => serializePropertySymbolForClass( + p7, + /*isStatic*/ + true, + staticBaseType + ) + ); + const isNonConstructableClassLikeInJsFile = !isClass3 && !!symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && !some2(getSignaturesOfType( + staticType, + 1 + /* Construct */ + )); + const constructors = isNonConstructableClassLikeInJsFile ? [factory.createConstructorDeclaration( + factory.createModifiersFromModifierFlags( + 2 + /* Private */ + ), + [], + /*body*/ + void 0 + )] : serializeSignatures( + 1, + staticType, + staticBaseType, + 176 + /* Constructor */ + ); + const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); + context2.enclosingDeclaration = oldEnclosing; + addResult( + setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + localName, + typeParamDecls, + heritageClauses, + [...indexSignatures, ...staticMembers, ...constructors, ...publicProperties, ...privateProperties] + ), + symbol.declarations && filter2(symbol.declarations, (d7) => isClassDeclaration(d7) || isClassExpression(d7))[0] + ), + modifierFlags + ); + } + function getSomeTargetNameFromDeclarations(declarations) { + return firstDefined(declarations, (d7) => { + if (isImportSpecifier(d7) || isExportSpecifier(d7)) { + return idText(d7.propertyName || d7.name); + } + if (isBinaryExpression(d7) || isExportAssignment(d7)) { + const expression = isExportAssignment(d7) ? d7.expression : d7.right; + if (isPropertyAccessExpression(expression)) { + return idText(expression.name); + } + } + if (isAliasSymbolDeclaration2(d7)) { + const name2 = getNameOfDeclaration(d7); + if (name2 && isIdentifier(name2)) { + return idText(name2); + } + } + return void 0; + }); + } + function serializeAsAlias(symbol, localName, modifierFlags) { + var _a22, _b, _c, _d, _e2, _f; + const node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return Debug.fail(); + const target = getMergedSymbol(getTargetOfAliasDeclaration( + node, + /*dontRecursivelyResolve*/ + true + )); + if (!target) { + return; + } + let verbatimTargetName = isShorthandAmbientModuleSymbol(target) && getSomeTargetNameFromDeclarations(symbol.declarations) || unescapeLeadingUnderscores(target.escapedName); + if (verbatimTargetName === "export=" && allowSyntheticDefaultImports) { + verbatimTargetName = "default"; + } + const targetName = getInternalSymbolName(target, verbatimTargetName); + includePrivateSymbol(target); + switch (node.kind) { + case 208: + if (((_b = (_a22 = node.parent) == null ? void 0 : _a22.parent) == null ? void 0 : _b.kind) === 260) { + const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context2); + const { propertyName } = node; + addResult( + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamedImports([factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName && isIdentifier(propertyName) ? factory.createIdentifier(idText(propertyName)) : void 0, + factory.createIdentifier(localName) + )]) + ), + factory.createStringLiteral(specifier2), + /*attributes*/ + void 0 + ), + 0 + /* None */ + ); + break; + } + Debug.failBadSyntaxKind(((_c = node.parent) == null ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization"); + break; + case 304: + if (((_e2 = (_d = node.parent) == null ? void 0 : _d.parent) == null ? void 0 : _e2.kind) === 226) { + serializeExportSpecifier( + unescapeLeadingUnderscores(symbol.escapedName), + targetName + ); + } + break; + case 260: + if (isPropertyAccessExpression(node.initializer)) { + const initializer = node.initializer; + const uniqueName = factory.createUniqueName(localName); + const specifier2 = getSpecifierForModuleSymbol(target.parent || target, context2); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + uniqueName, + factory.createExternalModuleReference(factory.createStringLiteral(specifier2)) + ), + 0 + /* None */ + ); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + factory.createQualifiedName(uniqueName, initializer.name) + ), + modifierFlags + ); + break; + } + case 271: + if (target.escapedName === "export=" && some2(target.declarations, (d7) => isSourceFile(d7) && isJsonSourceFile(d7))) { + serializeMaybeAliasAssignment(symbol); + break; + } + const isLocalImport = !(target.flags & 512) && !isVariableDeclaration(node); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + isLocalImport ? symbolToName( + target, + context2, + -1, + /*expectsIdentifier*/ + false + ) : factory.createExternalModuleReference(factory.createStringLiteral(getSpecifierForModuleSymbol(target, context2))) + ), + isLocalImport ? modifierFlags : 0 + /* None */ + ); + break; + case 270: + addResult( + factory.createNamespaceExportDeclaration(idText(node.name)), + 0 + /* None */ + ); + break; + case 273: { + const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context2); + const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier; + addResult( + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + factory.createIdentifier(localName), + /*namedBindings*/ + void 0 + ), + specifier2, + node.parent.attributes + ), + 0 + /* None */ + ); + break; + } + case 274: { + const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context2); + const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier; + addResult( + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamespaceImport(factory.createIdentifier(localName)) + ), + specifier2, + node.parent.attributes + ), + 0 + /* None */ + ); + break; + } + case 280: + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamespaceExport(factory.createIdentifier(localName)), + factory.createStringLiteral(getSpecifierForModuleSymbol(target, context2)) + ), + 0 + /* None */ + ); + break; + case 276: { + const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context2); + const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier; + addResult( + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamedImports([ + factory.createImportSpecifier( + /*isTypeOnly*/ + false, + localName !== verbatimTargetName ? factory.createIdentifier(verbatimTargetName) : void 0, + factory.createIdentifier(localName) + ) + ]) + ), + specifier2, + node.parent.parent.parent.attributes + ), + 0 + /* None */ + ); + break; + } + case 281: + const specifier = node.parent.parent.moduleSpecifier; + if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default") { + verbatimTargetName = "default"; + } + serializeExportSpecifier( + unescapeLeadingUnderscores(symbol.escapedName), + specifier ? verbatimTargetName : targetName, + specifier && isStringLiteralLike(specifier) ? factory.createStringLiteral(specifier.text) : void 0 + ); + break; + case 277: + serializeMaybeAliasAssignment(symbol); + break; + case 226: + case 211: + case 212: + if (symbol.escapedName === "default" || symbol.escapedName === "export=") { + serializeMaybeAliasAssignment(symbol); + } else { + serializeExportSpecifier(localName, targetName); + } + break; + default: + return Debug.failBadSyntaxKind(node, "Unhandled alias declaration kind in symbol serializer!"); + } + } + function serializeExportSpecifier(localName, targetName, specifier) { + addResult( + factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + localName !== targetName ? targetName : void 0, + localName + )]), + specifier + ), + 0 + /* None */ + ); + } + function serializeMaybeAliasAssignment(symbol) { + var _a22; + if (symbol.flags & 4194304) { + return false; + } + const name2 = unescapeLeadingUnderscores(symbol.escapedName); + const isExportEquals = name2 === "export="; + const isDefault = name2 === "default"; + const isExportAssignmentCompatibleSymbolName = isExportEquals || isDefault; + const aliasDecl = symbol.declarations && getDeclarationOfAliasSymbol(symbol); + const target = aliasDecl && getTargetOfAliasDeclaration( + aliasDecl, + /*dontRecursivelyResolve*/ + true + ); + if (target && length(target.declarations) && some2(target.declarations, (d7) => getSourceFileOfNode(d7) === getSourceFileOfNode(enclosingDeclaration))) { + const expr = aliasDecl && (isExportAssignment(aliasDecl) || isBinaryExpression(aliasDecl) ? getExportAssignmentExpression(aliasDecl) : getPropertyAssignmentAliasLikeExpression(aliasDecl)); + const first2 = expr && isEntityNameExpression(expr) ? getFirstNonModuleExportsIdentifier(expr) : void 0; + const referenced = first2 && resolveEntityName( + first2, + -1, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + enclosingDeclaration + ); + if (referenced || target) { + includePrivateSymbol(referenced || target); + } + const prevDisableTrackSymbol = context2.tracker.disableTrackSymbol; + context2.tracker.disableTrackSymbol = true; + if (isExportAssignmentCompatibleSymbolName) { + results.push(factory.createExportAssignment( + /*modifiers*/ + void 0, + isExportEquals, + symbolToExpression( + target, + context2, + -1 + /* All */ + ) + )); + } else { + if (first2 === expr && first2) { + serializeExportSpecifier(name2, idText(first2)); + } else if (expr && isClassExpression(expr)) { + serializeExportSpecifier(name2, getInternalSymbolName(target, symbolName(target))); + } else { + const varName = getUnusedName(name2, symbol); + addResult( + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createIdentifier(varName), + symbolToName( + target, + context2, + -1, + /*expectsIdentifier*/ + false + ) + ), + 0 + /* None */ + ); + serializeExportSpecifier(name2, varName); + } + } + context2.tracker.disableTrackSymbol = prevDisableTrackSymbol; + return true; + } else { + const varName = getUnusedName(name2, symbol); + const typeToSerialize = getWidenedType(getTypeOfSymbol(getMergedSymbol(symbol))); + if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) { + serializeAsFunctionNamespaceMerge( + typeToSerialize, + symbol, + varName, + isExportAssignmentCompatibleSymbolName ? 0 : 32 + /* Export */ + ); + } else { + const flags = ((_a22 = context2.enclosingDeclaration) == null ? void 0 : _a22.kind) === 267 && (!(symbol.flags & 98304) || symbol.flags & 65536) ? 1 : 2; + const statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([ + factory.createVariableDeclaration( + varName, + /*exclamationToken*/ + void 0, + serializeTypeForDeclaration(context2, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled) + ) + ], flags) + ); + addResult( + statement, + target && target.flags & 4 && target.escapedName === "export=" ? 128 : name2 === varName ? 32 : 0 + /* None */ + ); + } + if (isExportAssignmentCompatibleSymbolName) { + results.push(factory.createExportAssignment( + /*modifiers*/ + void 0, + isExportEquals, + factory.createIdentifier(varName) + )); + return true; + } else if (name2 !== varName) { + serializeExportSpecifier(name2, varName); + return true; + } + return false; + } + } + function isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, hostSymbol) { + const ctxSrc = getSourceFileOfNode(context2.enclosingDeclaration); + return getObjectFlags(typeToSerialize) & (16 | 32) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class + !!(length(filter2(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType( + typeToSerialize, + 0 + /* Call */ + ))) && !length(getSignaturesOfType( + typeToSerialize, + 1 + /* Construct */ + )) && // TODO: could probably serialize as function + ns + class, now that that's OK + !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some2(typeToSerialize.symbol.declarations, (d7) => getSourceFileOfNode(d7) !== ctxSrc)) && !some2(getPropertiesOfType(typeToSerialize), (p7) => isLateBoundName(p7.escapedName)) && !some2(getPropertiesOfType(typeToSerialize), (p7) => some2(p7.declarations, (d7) => getSourceFileOfNode(d7) !== ctxSrc)) && every2(getPropertiesOfType(typeToSerialize), (p7) => { + if (!isIdentifierText(symbolName(p7), languageVersion)) { + return false; + } + if (!(p7.flags & 98304)) { + return true; + } + return getNonMissingTypeOfSymbol(p7) === getWriteTypeOfSymbol(p7); + }); + } + function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) { + return function serializePropertySymbol(p7, isStatic2, baseType) { + var _a22, _b, _c, _d, _e2; + const modifierFlags = getDeclarationModifierFlagsFromSymbol(p7); + const isPrivate = !!(modifierFlags & 2); + if (isStatic2 && p7.flags & (788968 | 1920 | 2097152)) { + return []; + } + if (p7.flags & 4194304 || p7.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p7.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p7.escapedName)) === isReadonlySymbol(p7) && (p7.flags & 16777216) === (getPropertyOfType(baseType, p7.escapedName).flags & 16777216) && isTypeIdenticalTo(getTypeOfSymbol(p7), getTypeOfPropertyOfType(baseType, p7.escapedName))) { + return []; + } + const flag = modifierFlags & ~1024 | (isStatic2 ? 256 : 0); + const name2 = getPropertyNameNodeForSymbol(p7, context2); + const firstPropertyLikeDecl = (_a22 = p7.declarations) == null ? void 0 : _a22.find(or(isPropertyDeclaration, isAccessor, isVariableDeclaration, isPropertySignature, isBinaryExpression, isPropertyAccessExpression)); + if (p7.flags & 98304 && useAccessors) { + const result2 = []; + if (p7.flags & 65536) { + const setter = p7.declarations && forEach4(p7.declarations, (d7) => { + if (d7.kind === 178) { + return d7; + } + if (isCallExpression(d7) && isBindableObjectDefinePropertyCall(d7)) { + return forEach4(d7.arguments[2].properties, (propDecl) => { + const id = getNameOfDeclaration(propDecl); + if (!!id && isIdentifier(id) && idText(id) === "set") { + return propDecl; + } + }); + } + }); + Debug.assert(!!setter); + const paramSymbol = isFunctionLikeDeclaration(setter) ? getSignatureFromDeclaration(setter).parameters[0] : void 0; + result2.push(setTextRange( + factory.createSetAccessorDeclaration( + factory.createModifiersFromModifierFlags(flag), + name2, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + paramSymbol ? parameterToParameterDeclarationName(paramSymbol, getEffectiveParameterDeclaration(paramSymbol), context2) : "value", + /*questionToken*/ + void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context2, getTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled) + )], + /*body*/ + void 0 + ), + ((_b = p7.declarations) == null ? void 0 : _b.find(isSetAccessor)) || firstPropertyLikeDecl + )); + } + if (p7.flags & 32768) { + const isPrivate2 = modifierFlags & 2; + result2.push(setTextRange( + factory.createGetAccessorDeclaration( + factory.createModifiersFromModifierFlags(flag), + name2, + [], + isPrivate2 ? void 0 : serializeTypeForDeclaration(context2, getTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled), + /*body*/ + void 0 + ), + ((_c = p7.declarations) == null ? void 0 : _c.find(isGetAccessor)) || firstPropertyLikeDecl + )); + } + return result2; + } else if (p7.flags & (4 | 3 | 98304)) { + return setTextRange( + createProperty2( + factory.createModifiersFromModifierFlags((isReadonlySymbol(p7) ? 8 : 0) | flag), + name2, + p7.flags & 16777216 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + isPrivate ? void 0 : serializeTypeForDeclaration(context2, getWriteTypeOfSymbol(p7), p7, enclosingDeclaration, includePrivateSymbol, bundled), + // TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357 + // interface members can't have initializers, however class members _can_ + /*initializer*/ + void 0 + ), + ((_d = p7.declarations) == null ? void 0 : _d.find(or(isPropertyDeclaration, isVariableDeclaration))) || firstPropertyLikeDecl + ); + } + if (p7.flags & (8192 | 16)) { + const type3 = getTypeOfSymbol(p7); + const signatures = getSignaturesOfType( + type3, + 0 + /* Call */ + ); + if (flag & 2) { + return setTextRange( + createProperty2( + factory.createModifiersFromModifierFlags((isReadonlySymbol(p7) ? 8 : 0) | flag), + name2, + p7.flags & 16777216 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + ((_e2 = p7.declarations) == null ? void 0 : _e2.find(isFunctionLikeDeclaration)) || signatures[0] && signatures[0].declaration || p7.declarations && p7.declarations[0] + ); + } + const results2 = []; + for (const sig of signatures) { + const decl = signatureToSignatureDeclarationHelper( + sig, + methodKind, + context2, + { + name: name2, + questionToken: p7.flags & 16777216 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + modifiers: flag ? factory.createModifiersFromModifierFlags(flag) : void 0 + } + ); + const location2 = sig.declaration && isPrototypePropertyAssignment(sig.declaration.parent) ? sig.declaration.parent : sig.declaration; + results2.push(setTextRange(decl, location2)); + } + return results2; + } + return Debug.fail(`Unhandled class member kind! ${p7.__debugFlags || p7.flags}`); + }; + } + function serializePropertySymbolForInterface(p7, baseType) { + return serializePropertySymbolForInterfaceWorker( + p7, + /*isStatic*/ + false, + baseType + ); + } + function serializeSignatures(kind, input, baseType, outputKind) { + const signatures = getSignaturesOfType(input, kind); + if (kind === 1) { + if (!baseType && every2(signatures, (s7) => length(s7.parameters) === 0)) { + return []; + } + if (baseType) { + const baseSigs = getSignaturesOfType( + baseType, + 1 + /* Construct */ + ); + if (!length(baseSigs) && every2(signatures, (s7) => length(s7.parameters) === 0)) { + return []; + } + if (baseSigs.length === signatures.length) { + let failed = false; + for (let i7 = 0; i7 < baseSigs.length; i7++) { + if (!compareSignaturesIdentical( + signatures[i7], + baseSigs[i7], + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true, + compareTypesIdentical + )) { + failed = true; + break; + } + } + if (!failed) { + return []; + } + } + } + let privateProtected = 0; + for (const s7 of signatures) { + if (s7.declaration) { + privateProtected |= getSelectedEffectiveModifierFlags( + s7.declaration, + 2 | 4 + /* Protected */ + ); + } + } + if (privateProtected) { + return [setTextRange( + factory.createConstructorDeclaration( + factory.createModifiersFromModifierFlags(privateProtected), + /*parameters*/ + [], + /*body*/ + void 0 + ), + signatures[0].declaration + )]; + } + } + const results2 = []; + for (const sig of signatures) { + const decl = signatureToSignatureDeclarationHelper(sig, outputKind, context2); + results2.push(setTextRange(decl, sig.declaration)); + } + return results2; + } + function serializeIndexSignatures(input, baseType) { + const results2 = []; + for (const info2 of getIndexInfosOfType(input)) { + if (baseType) { + const baseInfo = getIndexInfoOfType(baseType, info2.keyType); + if (baseInfo) { + if (isTypeIdenticalTo(info2.type, baseInfo.type)) { + continue; + } + } + } + results2.push(indexInfoToIndexSignatureDeclarationHelper( + info2, + context2, + /*typeNode*/ + void 0 + )); + } + return results2; + } + function serializeBaseType(t8, staticType, rootName) { + const ref = trySerializeAsTypeReference( + t8, + 111551 + /* Value */ + ); + if (ref) { + return ref; + } + const tempName = getUnusedName(`${rootName}_base`); + const statement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + tempName, + /*exclamationToken*/ + void 0, + typeToTypeNodeHelper(staticType, context2) + ) + ], + 2 + /* Const */ + ) + ); + addResult( + statement, + 0 + /* None */ + ); + return factory.createExpressionWithTypeArguments( + factory.createIdentifier(tempName), + /*typeArguments*/ + void 0 + ); + } + function trySerializeAsTypeReference(t8, flags) { + let typeArgs; + let reference; + if (t8.target && isSymbolAccessibleByFlags(t8.target.symbol, enclosingDeclaration, flags)) { + typeArgs = map4(getTypeArguments(t8), (t22) => typeToTypeNodeHelper(t22, context2)); + reference = symbolToExpression( + t8.target.symbol, + context2, + 788968 + /* Type */ + ); + } else if (t8.symbol && isSymbolAccessibleByFlags(t8.symbol, enclosingDeclaration, flags)) { + reference = symbolToExpression( + t8.symbol, + context2, + 788968 + /* Type */ + ); + } + if (reference) { + return factory.createExpressionWithTypeArguments(reference, typeArgs); + } + } + function serializeImplementedType(t8) { + const ref = trySerializeAsTypeReference( + t8, + 788968 + /* Type */ + ); + if (ref) { + return ref; + } + if (t8.symbol) { + return factory.createExpressionWithTypeArguments( + symbolToExpression( + t8.symbol, + context2, + 788968 + /* Type */ + ), + /*typeArguments*/ + void 0 + ); + } + } + function getUnusedName(input, symbol) { + var _a22, _b; + const id = symbol ? getSymbolId(symbol) : void 0; + if (id) { + if (context2.remappedSymbolNames.has(id)) { + return context2.remappedSymbolNames.get(id); + } + } + if (symbol) { + input = getNameCandidateWorker(symbol, input); + } + let i7 = 0; + const original = input; + while ((_a22 = context2.usedSymbolNames) == null ? void 0 : _a22.has(input)) { + i7++; + input = `${original}_${i7}`; + } + (_b = context2.usedSymbolNames) == null ? void 0 : _b.add(input); + if (id) { + context2.remappedSymbolNames.set(id, input); + } + return input; + } + function getNameCandidateWorker(symbol, localName) { + if (localName === "default" || localName === "__class" || localName === "__function") { + const flags = context2.flags; + context2.flags |= 16777216; + const nameCandidate = getNameOfSymbolAsWritten(symbol, context2); + context2.flags = flags; + localName = nameCandidate.length > 0 && isSingleOrDoubleQuote(nameCandidate.charCodeAt(0)) ? stripQuotes(nameCandidate) : nameCandidate; + } + if (localName === "default") { + localName = "_default"; + } else if (localName === "export=") { + localName = "_exports"; + } + localName = isIdentifierText(localName, languageVersion) && !isStringANonContextualKeyword(localName) ? localName : "_" + localName.replace(/[^a-zA-Z0-9]/g, "_"); + return localName; + } + function getInternalSymbolName(symbol, localName) { + const id = getSymbolId(symbol); + if (context2.remappedSymbolNames.has(id)) { + return context2.remappedSymbolNames.get(id); + } + localName = getNameCandidateWorker(symbol, localName); + context2.remappedSymbolNames.set(id, localName); + return localName; + } + } + } + function typePredicateToString(typePredicate, enclosingDeclaration, flags = 16384, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer2) { + const predicate = factory.createTypePredicateNode( + typePredicate.kind === 2 || typePredicate.kind === 3 ? factory.createToken( + 131 + /* AssertsKeyword */ + ) : void 0, + typePredicate.kind === 1 || typePredicate.kind === 3 ? factory.createIdentifier(typePredicate.parameterName) : factory.createThisTypeNode(), + typePredicate.type && nodeBuilder.typeToTypeNode( + typePredicate.type, + enclosingDeclaration, + toNodeBuilderFlags(flags) | 70221824 | 512 + /* WriteTypeParametersInQualifiedName */ + ) + // TODO: GH#18217 + ); + const printer = createPrinterWithRemoveComments(); + const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration); + printer.writeNode( + 4, + predicate, + /*sourceFile*/ + sourceFile, + writer2 + ); + return writer2; + } + } + function formatUnionTypes(types3) { + const result2 = []; + let flags = 0; + for (let i7 = 0; i7 < types3.length; i7++) { + const t8 = types3[i7]; + flags |= t8.flags; + if (!(t8.flags & 98304)) { + if (t8.flags & (512 | 1056)) { + const baseType = t8.flags & 512 ? booleanType2 : getBaseTypeOfEnumLikeType(t8); + if (baseType.flags & 1048576) { + const count2 = baseType.types.length; + if (i7 + count2 <= types3.length && getRegularTypeOfLiteralType(types3[i7 + count2 - 1]) === getRegularTypeOfLiteralType(baseType.types[count2 - 1])) { + result2.push(baseType); + i7 += count2 - 1; + continue; + } + } + } + result2.push(t8); + } + } + if (flags & 65536) + result2.push(nullType2); + if (flags & 32768) + result2.push(undefinedType2); + return result2 || types3; + } + function visibilityToString(flags) { + if (flags === 2) { + return "private"; + } + if (flags === 4) { + return "protected"; + } + return "public"; + } + function getTypeAliasForTypeLiteral(type3) { + if (type3.symbol && type3.symbol.flags & 2048 && type3.symbol.declarations) { + const node = walkUpParenthesizedTypes(type3.symbol.declarations[0].parent); + if (isTypeAliasDeclaration(node)) { + return getSymbolOfDeclaration(node); + } + } + return void 0; + } + function isTopLevelInExternalModuleAugmentation(node) { + return node && node.parent && node.parent.kind === 268 && isExternalModuleAugmentation(node.parent.parent); + } + function isDefaultBindingContext(location2) { + return location2.kind === 312 || isAmbientModule(location2); + } + function getNameOfSymbolFromNameType(symbol, context2) { + const nameType = getSymbolLinks(symbol).nameType; + if (nameType) { + if (nameType.flags & 384) { + const name2 = "" + nameType.value; + if (!isIdentifierText(name2, getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name2)) { + return `"${escapeString2( + name2, + 34 + /* doubleQuote */ + )}"`; + } + if (isNumericLiteralName(name2) && startsWith2(name2, "-")) { + return `[${name2}]`; + } + return name2; + } + if (nameType.flags & 8192) { + return `[${getNameOfSymbolAsWritten(nameType.symbol, context2)}]`; + } + } + } + function getNameOfSymbolAsWritten(symbol, context2) { + var _a2; + if ((_a2 = context2 == null ? void 0 : context2.remappedSymbolReferences) == null ? void 0 : _a2.has(getSymbolId(symbol))) { + symbol = context2.remappedSymbolReferences.get(getSymbolId(symbol)); + } + if (context2 && symbol.escapedName === "default" && !(context2.flags & 16384) && // If it's not the first part of an entity name, it must print as `default` + (!(context2.flags & 16777216) || // if the symbol is synthesized, it will only be referenced externally it must print as `default` + !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default` + context2.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context2.enclosingDeclaration, isDefaultBindingContext))) { + return "default"; + } + if (symbol.declarations && symbol.declarations.length) { + let declaration = firstDefined(symbol.declarations, (d7) => getNameOfDeclaration(d7) ? d7 : void 0); + const name22 = declaration && getNameOfDeclaration(declaration); + if (declaration && name22) { + if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { + return symbolName(symbol); + } + if (isComputedPropertyName(name22) && !(getCheckFlags(symbol) & 4096)) { + const nameType = getSymbolLinks(symbol).nameType; + if (nameType && nameType.flags & 384) { + const result2 = getNameOfSymbolFromNameType(symbol, context2); + if (result2 !== void 0) { + return result2; + } + } + } + return declarationNameToString(name22); + } + if (!declaration) { + declaration = symbol.declarations[0]; + } + if (declaration.parent && declaration.parent.kind === 260) { + return declarationNameToString(declaration.parent.name); + } + switch (declaration.kind) { + case 231: + case 218: + case 219: + if (context2 && !context2.encounteredError && !(context2.flags & 131072)) { + context2.encounteredError = true; + } + return declaration.kind === 231 ? "(Anonymous class)" : "(Anonymous function)"; + } + } + const name2 = getNameOfSymbolFromNameType(symbol, context2); + return name2 !== void 0 ? name2 : symbolName(symbol); + } + function isDeclarationVisible(node) { + if (node) { + const links = getNodeLinks(node); + if (links.isVisible === void 0) { + links.isVisible = !!determineIfDeclarationIsVisible(); + } + return links.isVisible; + } + return false; + function determineIfDeclarationIsVisible() { + switch (node.kind) { + case 345: + case 353: + case 347: + return !!(node.parent && node.parent.parent && node.parent.parent.parent && isSourceFile(node.parent.parent.parent)); + case 208: + return isDeclarationVisible(node.parent.parent); + case 260: + if (isBindingPattern(node.name) && !node.name.elements.length) { + return false; + } + case 267: + case 263: + case 264: + case 265: + case 262: + case 266: + case 271: + if (isExternalModuleAugmentation(node)) { + return true; + } + const parent22 = getDeclarationContainer(node); + if (!(getCombinedModifierFlagsCached(node) & 32) && !(node.kind !== 271 && parent22.kind !== 312 && parent22.flags & 33554432)) { + return isGlobalSourceFile(parent22); + } + return isDeclarationVisible(parent22); + case 172: + case 171: + case 177: + case 178: + case 174: + case 173: + if (hasEffectiveModifier( + node, + 2 | 4 + /* Protected */ + )) { + return false; + } + case 176: + case 180: + case 179: + case 181: + case 169: + case 268: + case 184: + case 185: + case 187: + case 183: + case 188: + case 189: + case 192: + case 193: + case 196: + case 202: + return isDeclarationVisible(node.parent); + case 273: + case 274: + case 276: + return false; + case 168: + case 312: + case 270: + return true; + case 277: + return false; + default: + return false; + } + } + } + function collectLinkedAliases(node, setVisibility) { + let exportSymbol; + if (node.parent && node.parent.kind === 277) { + exportSymbol = resolveName( + node, + node.escapedText, + 111551 | 788968 | 1920 | 2097152, + /*nameNotFoundMessage*/ + void 0, + node, + /*isUse*/ + false + ); + } else if (node.parent.kind === 281) { + exportSymbol = getTargetOfExportSpecifier( + node.parent, + 111551 | 788968 | 1920 | 2097152 + /* Alias */ + ); + } + let result2; + let visited; + if (exportSymbol) { + visited = /* @__PURE__ */ new Set(); + visited.add(getSymbolId(exportSymbol)); + buildVisibleNodeList(exportSymbol.declarations); + } + return result2; + function buildVisibleNodeList(declarations) { + forEach4(declarations, (declaration) => { + const resultNode = getAnyImportSyntax(declaration) || declaration; + if (setVisibility) { + getNodeLinks(declaration).isVisible = true; + } else { + result2 = result2 || []; + pushIfUnique(result2, resultNode); + } + if (isInternalModuleImportEqualsDeclaration(declaration)) { + const internalModuleReference = declaration.moduleReference; + const firstIdentifier = getFirstIdentifier(internalModuleReference); + const importSymbol = resolveName( + declaration, + firstIdentifier.escapedText, + 111551 | 788968 | 1920, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + if (importSymbol && visited) { + if (tryAddToSet(visited, getSymbolId(importSymbol))) { + buildVisibleNodeList(importSymbol.declarations); + } + } + } + }); + } + } + function pushTypeResolution(target, propertyName) { + const resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); + if (resolutionCycleStartIndex >= 0) { + const { length: length2 } = resolutionTargets; + for (let i7 = resolutionCycleStartIndex; i7 < length2; i7++) { + resolutionResults[i7] = false; + } + return false; + } + resolutionTargets.push(target); + resolutionResults.push( + /*items*/ + true + ); + resolutionPropertyNames.push(propertyName); + return true; + } + function findResolutionCycleStartIndex(target, propertyName) { + for (let i7 = resolutionTargets.length - 1; i7 >= resolutionStart; i7--) { + if (resolutionTargetHasProperty(resolutionTargets[i7], resolutionPropertyNames[i7])) { + return -1; + } + if (resolutionTargets[i7] === target && resolutionPropertyNames[i7] === propertyName) { + return i7; + } + } + return -1; + } + function resolutionTargetHasProperty(target, propertyName) { + switch (propertyName) { + case 0: + return !!getSymbolLinks(target).type; + case 5: + return !!getNodeLinks(target).resolvedEnumType; + case 2: + return !!getSymbolLinks(target).declaredType; + case 1: + return !!target.resolvedBaseConstructorType; + case 3: + return !!target.resolvedReturnType; + case 4: + return !!target.immediateBaseConstraint; + case 6: + return !!target.resolvedTypeArguments; + case 7: + return !!target.baseTypesResolved; + case 8: + return !!getSymbolLinks(target).writeType; + case 9: + return getNodeLinks(target).parameterInitializerContainsUndefined !== void 0; + } + return Debug.assertNever(propertyName); + } + function popTypeResolution() { + resolutionTargets.pop(); + resolutionPropertyNames.pop(); + return resolutionResults.pop(); + } + function getDeclarationContainer(node) { + return findAncestor(getRootDeclaration(node), (node2) => { + switch (node2.kind) { + case 260: + case 261: + case 276: + case 275: + case 274: + case 273: + return false; + default: + return true; + } + }).parent; + } + function getTypeOfPrototypeProperty(prototype) { + const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)); + return classType.typeParameters ? createTypeReference(classType, map4(classType.typeParameters, (_6) => anyType2)) : classType; + } + function getTypeOfPropertyOfType(type3, name2) { + const prop = getPropertyOfType(type3, name2); + return prop ? getTypeOfSymbol(prop) : void 0; + } + function getTypeOfPropertyOrIndexSignatureOfType(type3, name2) { + var _a2; + let propType; + return getTypeOfPropertyOfType(type3, name2) || (propType = (_a2 = getApplicableIndexInfoForName(type3, name2)) == null ? void 0 : _a2.type) && addOptionality( + propType, + /*isProperty*/ + true, + /*isOptional*/ + true + ); + } + function isTypeAny(type3) { + return type3 && (type3.flags & 1) !== 0; + } + function isErrorType(type3) { + return type3 === errorType || !!(type3.flags & 1 && type3.aliasSymbol); + } + function getTypeForBindingElementParent(node, checkMode) { + if (checkMode !== 0) { + return getTypeForVariableLikeDeclaration( + node, + /*includeOptionality*/ + false, + checkMode + ); + } + const symbol = getSymbolOfDeclaration(node); + return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration( + node, + /*includeOptionality*/ + false, + checkMode + ); + } + function getRestType(source, properties, symbol) { + source = filterType(source, (t8) => !(t8.flags & 98304)); + if (source.flags & 131072) { + return emptyObjectType; + } + if (source.flags & 1048576) { + return mapType2(source, (t8) => getRestType(t8, properties, symbol)); + } + let omitKeyType = getUnionType(map4(properties, getLiteralTypeFromPropertyName)); + const spreadableProperties = []; + const unspreadableToRestKeys = []; + for (const prop of getPropertiesOfType(source)) { + const literalTypeFromProperty = getLiteralTypeFromProperty( + prop, + 8576 + /* StringOrNumberLiteralOrUnique */ + ); + if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType) && !(getDeclarationModifierFlagsFromSymbol(prop) & (2 | 4)) && isSpreadableProperty(prop)) { + spreadableProperties.push(prop); + } else { + unspreadableToRestKeys.push(literalTypeFromProperty); + } + } + if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) { + if (unspreadableToRestKeys.length) { + omitKeyType = getUnionType([omitKeyType, ...unspreadableToRestKeys]); + } + if (omitKeyType.flags & 131072) { + return source; + } + const omitTypeAlias = getGlobalOmitSymbol(); + if (!omitTypeAlias) { + return errorType; + } + return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]); + } + const members = createSymbolTable(); + for (const prop of spreadableProperties) { + members.set(prop.escapedName, getSpreadSymbol( + prop, + /*readonly*/ + false + )); + } + const result2 = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source)); + result2.objectFlags |= 4194304; + return result2; + } + function isGenericTypeWithUndefinedConstraint(type3) { + return !!(type3.flags & 465829888) && maybeTypeOfKind( + getBaseConstraintOfType(type3) || unknownType2, + 32768 + /* Undefined */ + ); + } + function getNonUndefinedType(type3) { + const typeOrConstraint = someType(type3, isGenericTypeWithUndefinedConstraint) ? mapType2(type3, (t8) => t8.flags & 465829888 ? getBaseConstraintOrType(t8) : t8) : type3; + return getTypeWithFacts( + typeOrConstraint, + 524288 + /* NEUndefined */ + ); + } + function getFlowTypeOfDestructuring(node, declaredType) { + const reference = getSyntheticElementAccess(node); + return reference ? getFlowTypeOfReference(reference, declaredType) : declaredType; + } + function getSyntheticElementAccess(node) { + const parentAccess = getParentElementAccess(node); + if (parentAccess && canHaveFlowNode(parentAccess) && parentAccess.flowNode) { + const propName2 = getDestructuringPropertyName(node); + if (propName2) { + const literal = setTextRange(parseNodeFactory.createStringLiteral(propName2), node); + const lhsExpr = isLeftHandSideExpression(parentAccess) ? parentAccess : parseNodeFactory.createParenthesizedExpression(parentAccess); + const result2 = setTextRange(parseNodeFactory.createElementAccessExpression(lhsExpr, literal), node); + setParent(literal, result2); + setParent(result2, node); + if (lhsExpr !== parentAccess) { + setParent(lhsExpr, result2); + } + result2.flowNode = parentAccess.flowNode; + return result2; + } + } + } + function getParentElementAccess(node) { + const ancestor = node.parent.parent; + switch (ancestor.kind) { + case 208: + case 303: + return getSyntheticElementAccess(ancestor); + case 209: + return getSyntheticElementAccess(node.parent); + case 260: + return ancestor.initializer; + case 226: + return ancestor.right; + } + } + function getDestructuringPropertyName(node) { + const parent22 = node.parent; + if (node.kind === 208 && parent22.kind === 206) { + return getLiteralPropertyNameText(node.propertyName || node.name); + } + if (node.kind === 303 || node.kind === 304) { + return getLiteralPropertyNameText(node.name); + } + return "" + parent22.elements.indexOf(node); + } + function getLiteralPropertyNameText(name2) { + const type3 = getLiteralTypeFromPropertyName(name2); + return type3.flags & (128 | 256) ? "" + type3.value : void 0; + } + function getTypeForBindingElement(declaration) { + const checkMode = declaration.dotDotDotToken ? 32 : 0; + const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode); + return parentType && getBindingElementTypeFromParentType( + declaration, + parentType, + /*noTupleBoundsCheck*/ + false + ); + } + function getBindingElementTypeFromParentType(declaration, parentType, noTupleBoundsCheck) { + if (isTypeAny(parentType)) { + return parentType; + } + const pattern5 = declaration.parent; + if (strictNullChecks && declaration.flags & 33554432 && isParameterDeclaration(declaration)) { + parentType = getNonNullableType(parentType); + } else if (strictNullChecks && pattern5.parent.initializer && !hasTypeFacts( + getTypeOfInitializer(pattern5.parent.initializer), + 65536 + /* EQUndefined */ + )) { + parentType = getTypeWithFacts( + parentType, + 524288 + /* NEUndefined */ + ); + } + let type3; + if (pattern5.kind === 206) { + if (declaration.dotDotDotToken) { + parentType = getReducedType(parentType); + if (parentType.flags & 2 || !isValidSpreadType(parentType)) { + error22(declaration, Diagnostics.Rest_types_may_only_be_created_from_object_types); + return errorType; + } + const literalMembers = []; + for (const element of pattern5.elements) { + if (!element.dotDotDotToken) { + literalMembers.push(element.propertyName || element.name); + } + } + type3 = getRestType(parentType, literalMembers, declaration.symbol); + } else { + const name2 = declaration.propertyName || declaration.name; + const indexType = getLiteralTypeFromPropertyName(name2); + const declaredType = getIndexedAccessType(parentType, indexType, 32, name2); + type3 = getFlowTypeOfDestructuring(declaration, declaredType); + } + } else { + const elementType = checkIteratedTypeOrElementType(65 | (declaration.dotDotDotToken ? 0 : 128), parentType, undefinedType2, pattern5); + const index4 = pattern5.elements.indexOf(declaration); + if (declaration.dotDotDotToken) { + const baseConstraint = mapType2(parentType, (t8) => t8.flags & 58982400 ? getBaseConstraintOrType(t8) : t8); + type3 = everyType(baseConstraint, isTupleType) ? mapType2(baseConstraint, (t8) => sliceTupleType(t8, index4)) : createArrayType(elementType); + } else if (isArrayLikeType(parentType)) { + const indexType = getNumberLiteralType(index4); + const accessFlags = 32 | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 : 0); + const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType; + type3 = getFlowTypeOfDestructuring(declaration, declaredType); + } else { + type3 = elementType; + } + } + if (!declaration.initializer) { + return type3; + } + if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) { + return strictNullChecks && !hasTypeFacts( + checkDeclarationInitializer( + declaration, + 0 + /* Normal */ + ), + 16777216 + /* IsUndefined */ + ) ? getNonUndefinedType(type3) : type3; + } + return widenTypeInferredFromInitializer(declaration, getUnionType( + [getNonUndefinedType(type3), checkDeclarationInitializer( + declaration, + 0 + /* Normal */ + )], + 2 + /* Subtype */ + )); + } + function getTypeForDeclarationFromJSDocComment(declaration) { + const jsdocType = getJSDocType(declaration); + if (jsdocType) { + return getTypeFromTypeNode(jsdocType); + } + return void 0; + } + function isNullOrUndefined3(node) { + const expr = skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return expr.kind === 106 || expr.kind === 80 && getResolvedSymbol(expr) === undefinedSymbol; + } + function isEmptyArrayLiteral2(node) { + const expr = skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return expr.kind === 209 && expr.elements.length === 0; + } + function addOptionality(type3, isProperty = false, isOptional2 = true) { + return strictNullChecks && isOptional2 ? getOptionalType(type3, isProperty) : type3; + } + function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) { + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 249) { + const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression( + declaration.parent.parent.expression, + /*checkMode*/ + checkMode + ))); + return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType2; + } + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250) { + const forOfStatement = declaration.parent.parent; + return checkRightHandSideOfForOf(forOfStatement) || anyType2; + } + if (isBindingPattern(declaration.parent)) { + return getTypeForBindingElement(declaration); + } + const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration); + const isOptional2 = includeOptionality && isOptionalDeclaration(declaration); + const declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + if (declaredType) { + return isTypeAny(declaredType) || declaredType === unknownType2 ? declaredType : errorType; + } + return useUnknownInCatchVariables ? unknownType2 : anyType2; + } + if (declaredType) { + return addOptionality(declaredType, isProperty, isOptional2); + } + if ((noImplicitAny || isInJSFile(declaration)) && isVariableDeclaration(declaration) && !isBindingPattern(declaration.name) && !(getCombinedModifierFlagsCached(declaration) & 32) && !(declaration.flags & 33554432)) { + if (!(getCombinedNodeFlagsCached(declaration) & 6) && (!declaration.initializer || isNullOrUndefined3(declaration.initializer))) { + return autoType; + } + if (declaration.initializer && isEmptyArrayLiteral2(declaration.initializer)) { + return autoArrayType; + } + } + if (isParameter(declaration)) { + const func = declaration.parent; + if (func.kind === 178 && hasBindableName(func)) { + const getter = getDeclarationOfKind( + getSymbolOfDeclaration(declaration.parent), + 177 + /* GetAccessor */ + ); + if (getter) { + const getterSignature = getSignatureFromDeclaration(getter); + const thisParameter = getAccessorThisParameter(func); + if (thisParameter && declaration === thisParameter) { + Debug.assert(!thisParameter.type); + return getTypeOfSymbol(getterSignature.thisParameter); + } + return getReturnTypeOfSignature(getterSignature); + } + } + const parameterTypeOfTypeTag = getParameterTypeOfTypeTag(func, declaration); + if (parameterTypeOfTypeTag) + return parameterTypeOfTypeTag; + const type3 = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration); + if (type3) { + return addOptionality( + type3, + /*isProperty*/ + false, + isOptional2 + ); + } + } + if (hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) { + if (isInJSFile(declaration) && !isParameter(declaration)) { + const containerObjectType = getJSContainerObjectType(declaration, getSymbolOfDeclaration(declaration), getDeclaredExpandoInitializer(declaration)); + if (containerObjectType) { + return containerObjectType; + } + } + const type3 = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode)); + return addOptionality(type3, isProperty, isOptional2); + } + if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) { + if (!hasStaticModifier(declaration)) { + const constructor = findConstructorDeclaration(declaration.parent); + const type3 = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & 128 ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + return type3 && addOptionality( + type3, + /*isProperty*/ + true, + isOptional2 + ); + } else { + const staticBlocks = filter2(declaration.parent.members, isClassStaticBlockDeclaration); + const type3 = staticBlocks.length ? getFlowTypeInStaticBlocks(declaration.symbol, staticBlocks) : getEffectiveModifierFlags(declaration) & 128 ? getTypeOfPropertyInBaseClass(declaration.symbol) : void 0; + return type3 && addOptionality( + type3, + /*isProperty*/ + true, + isOptional2 + ); + } + } + if (isJsxAttribute(declaration)) { + return trueType; + } + if (isBindingPattern(declaration.name)) { + return getTypeFromBindingPattern( + declaration.name, + /*includePatternInType*/ + false, + /*reportErrors*/ + true + ); + } + return void 0; + } + function isConstructorDeclaredProperty(symbol) { + if (symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration)) { + const links = getSymbolLinks(symbol); + if (links.isConstructorDeclaredProperty === void 0) { + links.isConstructorDeclaredProperty = false; + links.isConstructorDeclaredProperty = !!getDeclaringConstructor(symbol) && every2(symbol.declarations, (declaration) => isBinaryExpression(declaration) && isPossiblyAliasedThisProperty(declaration) && (declaration.left.kind !== 212 || isStringOrNumericLiteralLike(declaration.left.argumentExpression)) && !getAnnotatedTypeForAssignmentDeclaration( + /*declaredType*/ + void 0, + declaration, + symbol, + declaration + )); + } + return links.isConstructorDeclaredProperty; + } + return false; + } + function isAutoTypedProperty(symbol) { + const declaration = symbol.valueDeclaration; + return declaration && isPropertyDeclaration(declaration) && !getEffectiveTypeAnnotationNode(declaration) && !declaration.initializer && (noImplicitAny || isInJSFile(declaration)); + } + function getDeclaringConstructor(symbol) { + if (!symbol.declarations) { + return; + } + for (const declaration of symbol.declarations) { + const container = getThisContainer( + declaration, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (container && (container.kind === 176 || isJSConstructor(container))) { + return container; + } + } + } + function getFlowTypeFromCommonJSExport(symbol) { + const file = getSourceFileOfNode(symbol.declarations[0]); + const accessName = unescapeLeadingUnderscores(symbol.escapedName); + const areAllModuleExports = symbol.declarations.every((d7) => isInJSFile(d7) && isAccessExpression(d7) && isModuleExportsAccessExpression(d7.expression)); + const reference = areAllModuleExports ? factory.createPropertyAccessExpression(factory.createPropertyAccessExpression(factory.createIdentifier("module"), factory.createIdentifier("exports")), accessName) : factory.createPropertyAccessExpression(factory.createIdentifier("exports"), accessName); + if (areAllModuleExports) { + setParent(reference.expression.expression, reference.expression); + } + setParent(reference.expression, reference); + setParent(reference, file); + reference.flowNode = file.endFlowNode; + return getFlowTypeOfReference(reference, autoType, undefinedType2); + } + function getFlowTypeInStaticBlocks(symbol, staticBlocks) { + const accessName = startsWith2(symbol.escapedName, "__#") ? factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : unescapeLeadingUnderscores(symbol.escapedName); + for (const staticBlock of staticBlocks) { + const reference = factory.createPropertyAccessExpression(factory.createThis(), accessName); + setParent(reference.expression, reference); + setParent(reference, staticBlock); + reference.flowNode = staticBlock.returnFlowNode; + const flowType = getFlowTypeOfProperty(reference, symbol); + if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { + error22(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + if (everyType(flowType, isNullableType)) { + continue; + } + return convertAutoToAny(flowType); + } + } + function getFlowTypeInConstructor(symbol, constructor) { + const accessName = startsWith2(symbol.escapedName, "__#") ? factory.createPrivateIdentifier(symbol.escapedName.split("@")[1]) : unescapeLeadingUnderscores(symbol.escapedName); + const reference = factory.createPropertyAccessExpression(factory.createThis(), accessName); + setParent(reference.expression, reference); + setParent(reference, constructor); + reference.flowNode = constructor.returnFlowNode; + const flowType = getFlowTypeOfProperty(reference, symbol); + if (noImplicitAny && (flowType === autoType || flowType === autoArrayType)) { + error22(symbol.valueDeclaration, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + return everyType(flowType, isNullableType) ? void 0 : convertAutoToAny(flowType); + } + function getFlowTypeOfProperty(reference, prop) { + const initialType = (prop == null ? void 0 : prop.valueDeclaration) && (!isAutoTypedProperty(prop) || getEffectiveModifierFlags(prop.valueDeclaration) & 128) && getTypeOfPropertyInBaseClass(prop) || undefinedType2; + return getFlowTypeOfReference(reference, autoType, initialType); + } + function getWidenedTypeForAssignmentDeclaration(symbol, resolvedSymbol) { + const container = getAssignedExpandoInitializer(symbol.valueDeclaration); + if (container) { + const tag = isInJSFile(container) ? getJSDocTypeTag(container) : void 0; + if (tag && tag.typeExpression) { + return getTypeFromTypeNode(tag.typeExpression); + } + const containerObjectType = symbol.valueDeclaration && getJSContainerObjectType(symbol.valueDeclaration, symbol, container); + return containerObjectType || getWidenedLiteralType(checkExpressionCached(container)); + } + let type3; + let definedInConstructor = false; + let definedInMethod = false; + if (isConstructorDeclaredProperty(symbol)) { + type3 = getFlowTypeInConstructor(symbol, getDeclaringConstructor(symbol)); + } + if (!type3) { + let types3; + if (symbol.declarations) { + let jsdocType; + for (const declaration of symbol.declarations) { + const expression = isBinaryExpression(declaration) || isCallExpression(declaration) ? declaration : isAccessExpression(declaration) ? isBinaryExpression(declaration.parent) ? declaration.parent : declaration : void 0; + if (!expression) { + continue; + } + const kind = isAccessExpression(expression) ? getAssignmentDeclarationPropertyAccessKind(expression) : getAssignmentDeclarationKind(expression); + if (kind === 4 || isBinaryExpression(expression) && isPossiblyAliasedThisProperty(expression, kind)) { + if (isDeclarationInConstructor(expression)) { + definedInConstructor = true; + } else { + definedInMethod = true; + } + } + if (!isCallExpression(expression)) { + jsdocType = getAnnotatedTypeForAssignmentDeclaration(jsdocType, expression, symbol, declaration); + } + if (!jsdocType) { + (types3 || (types3 = [])).push(isBinaryExpression(expression) || isCallExpression(expression) ? getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) : neverType2); + } + } + type3 = jsdocType; + } + if (!type3) { + if (!length(types3)) { + return errorType; + } + let constructorTypes = definedInConstructor && symbol.declarations ? getConstructorDefinedThisAssignmentTypes(types3, symbol.declarations) : void 0; + if (definedInMethod) { + const propType = getTypeOfPropertyInBaseClass(symbol); + if (propType) { + (constructorTypes || (constructorTypes = [])).push(propType); + definedInConstructor = true; + } + } + const sourceTypes = some2(constructorTypes, (t8) => !!(t8.flags & ~98304)) ? constructorTypes : types3; + type3 = getUnionType(sourceTypes); + } + } + const widened = getWidenedType(addOptionality( + type3, + /*isProperty*/ + false, + definedInMethod && !definedInConstructor + )); + if (symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && filterType(widened, (t8) => !!(t8.flags & ~98304)) === neverType2) { + reportImplicitAny(symbol.valueDeclaration, anyType2); + return anyType2; + } + return widened; + } + function getJSContainerObjectType(decl, symbol, init2) { + var _a2, _b; + if (!isInJSFile(decl) || !init2 || !isObjectLiteralExpression(init2) || init2.properties.length) { + return void 0; + } + const exports29 = createSymbolTable(); + while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) { + const s22 = getSymbolOfNode(decl); + if ((_a2 = s22 == null ? void 0 : s22.exports) == null ? void 0 : _a2.size) { + mergeSymbolTable(exports29, s22.exports); + } + decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent; + } + const s7 = getSymbolOfNode(decl); + if ((_b = s7 == null ? void 0 : s7.exports) == null ? void 0 : _b.size) { + mergeSymbolTable(exports29, s7.exports); + } + const type3 = createAnonymousType(symbol, exports29, emptyArray, emptyArray, emptyArray); + type3.objectFlags |= 4096; + return type3; + } + function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) { + var _a2; + const typeNode = getEffectiveTypeAnnotationNode(expression.parent); + if (typeNode) { + const type3 = getWidenedType(getTypeFromTypeNode(typeNode)); + if (!declaredType) { + return type3; + } else if (!isErrorType(declaredType) && !isErrorType(type3) && !isTypeIdenticalTo(declaredType, type3)) { + errorNextVariableOrPropertyDeclarationMustHaveSameType( + /*firstDeclaration*/ + void 0, + declaredType, + declaration, + type3 + ); + } + } + if ((_a2 = symbol.parent) == null ? void 0 : _a2.valueDeclaration) { + const possiblyAnnotatedSymbol = getFunctionExpressionParentSymbolOrSymbol(symbol.parent); + if (possiblyAnnotatedSymbol.valueDeclaration) { + const typeNode2 = getEffectiveTypeAnnotationNode(possiblyAnnotatedSymbol.valueDeclaration); + if (typeNode2) { + const annotationSymbol = getPropertyOfType(getTypeFromTypeNode(typeNode2), symbol.escapedName); + if (annotationSymbol) { + return getNonMissingTypeOfSymbol(annotationSymbol); + } + } + } + } + return declaredType; + } + function getInitializerTypeFromAssignmentDeclaration(symbol, resolvedSymbol, expression, kind) { + if (isCallExpression(expression)) { + if (resolvedSymbol) { + return getTypeOfSymbol(resolvedSymbol); + } + const objectLitType = checkExpressionCached(expression.arguments[2]); + const valueType = getTypeOfPropertyOfType(objectLitType, "value"); + if (valueType) { + return valueType; + } + const getFunc = getTypeOfPropertyOfType(objectLitType, "get"); + if (getFunc) { + const getSig = getSingleCallSignature(getFunc); + if (getSig) { + return getReturnTypeOfSignature(getSig); + } + } + const setFunc = getTypeOfPropertyOfType(objectLitType, "set"); + if (setFunc) { + const setSig = getSingleCallSignature(setFunc); + if (setSig) { + return getTypeOfFirstParameterOfSignature(setSig); + } + } + return anyType2; + } + if (containsSameNamedThisProperty(expression.left, expression.right)) { + return anyType2; + } + const isDirectExport = kind === 1 && (isPropertyAccessExpression(expression.left) || isElementAccessExpression(expression.left)) && (isModuleExportsAccessExpression(expression.left.expression) || isIdentifier(expression.left.expression) && isExportsIdentifier(expression.left.expression)); + const type3 = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol) : isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right)) : getWidenedLiteralType(checkExpressionCached(expression.right)); + if (type3.flags & 524288 && kind === 2 && symbol.escapedName === "export=") { + const exportedType = resolveStructuredTypeMembers(type3); + const members = createSymbolTable(); + copyEntries(exportedType.members, members); + const initialSize = members.size; + if (resolvedSymbol && !resolvedSymbol.exports) { + resolvedSymbol.exports = createSymbolTable(); + } + (resolvedSymbol || symbol).exports.forEach((s7, name2) => { + var _a2; + const exportedMember = members.get(name2); + if (exportedMember && exportedMember !== s7 && !(s7.flags & 2097152)) { + if (s7.flags & 111551 && exportedMember.flags & 111551) { + if (s7.valueDeclaration && exportedMember.valueDeclaration && getSourceFileOfNode(s7.valueDeclaration) !== getSourceFileOfNode(exportedMember.valueDeclaration)) { + const unescapedName = unescapeLeadingUnderscores(s7.escapedName); + const exportedMemberName = ((_a2 = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a2.name) || exportedMember.valueDeclaration; + addRelatedInfo( + error22(s7.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName), + createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName) + ); + addRelatedInfo( + error22(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName), + createDiagnosticForNode(s7.valueDeclaration, Diagnostics._0_was_also_declared_here, unescapedName) + ); + } + const union2 = createSymbol(s7.flags | exportedMember.flags, name2); + union2.links.type = getUnionType([getTypeOfSymbol(s7), getTypeOfSymbol(exportedMember)]); + union2.valueDeclaration = exportedMember.valueDeclaration; + union2.declarations = concatenate(exportedMember.declarations, s7.declarations); + members.set(name2, union2); + } else { + members.set(name2, mergeSymbol(s7, exportedMember)); + } + } else { + members.set(name2, s7); + } + }); + const result2 = createAnonymousType( + initialSize !== members.size ? void 0 : exportedType.symbol, + // Only set the type's symbol if it looks to be the same as the original type + members, + exportedType.callSignatures, + exportedType.constructSignatures, + exportedType.indexInfos + ); + if (initialSize === members.size) { + if (type3.aliasSymbol) { + result2.aliasSymbol = type3.aliasSymbol; + result2.aliasTypeArguments = type3.aliasTypeArguments; + } + if (getObjectFlags(type3) & 4) { + result2.aliasSymbol = type3.symbol; + const args = getTypeArguments(type3); + result2.aliasTypeArguments = length(args) ? args : void 0; + } + } + result2.objectFlags |= getObjectFlags(type3) & 4096; + if (result2.symbol && result2.symbol.flags & 32 && type3 === getDeclaredTypeOfClassOrInterface(result2.symbol)) { + result2.objectFlags |= 16777216; + } + return result2; + } + if (isEmptyArrayLiteralType(type3)) { + reportImplicitAny(expression, anyArrayType); + return anyArrayType; + } + return type3; + } + function containsSameNamedThisProperty(thisProperty, expression) { + return isPropertyAccessExpression(thisProperty) && thisProperty.expression.kind === 110 && forEachChildRecursively(expression, (n7) => isMatchingReference(thisProperty, n7)); + } + function isDeclarationInConstructor(expression) { + const thisContainer = getThisContainer( + expression, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + return thisContainer.kind === 176 || thisContainer.kind === 262 || thisContainer.kind === 218 && !isPrototypePropertyAssignment(thisContainer.parent); + } + function getConstructorDefinedThisAssignmentTypes(types3, declarations) { + Debug.assert(types3.length === declarations.length); + return types3.filter((_6, i7) => { + const declaration = declarations[i7]; + const expression = isBinaryExpression(declaration) ? declaration : isBinaryExpression(declaration.parent) ? declaration.parent : void 0; + return expression && isDeclarationInConstructor(expression); + }); + } + function getTypeFromBindingElement(element, includePatternInType, reportErrors2) { + if (element.initializer) { + const contextualType = isBindingPattern(element.name) ? getTypeFromBindingPattern( + element.name, + /*includePatternInType*/ + true, + /*reportErrors*/ + false + ) : unknownType2; + return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, reportErrors2 ? 0 : 1, contextualType))); + } + if (isBindingPattern(element.name)) { + return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors2); + } + if (reportErrors2 && !declarationBelongsToPrivateAmbientMember(element)) { + reportImplicitAny(element, anyType2); + } + return includePatternInType ? nonInferrableAnyType : anyType2; + } + function getTypeFromObjectBindingPattern(pattern5, includePatternInType, reportErrors2) { + const members = createSymbolTable(); + let stringIndexInfo; + let objectFlags = 128 | 131072; + forEach4(pattern5.elements, (e10) => { + const name2 = e10.propertyName || e10.name; + if (e10.dotDotDotToken) { + stringIndexInfo = createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + ); + return; + } + const exprType = getLiteralTypeFromPropertyName(name2); + if (!isTypeUsableAsPropertyName(exprType)) { + objectFlags |= 512; + return; + } + const text = getPropertyNameFromType(exprType); + const flags = 4 | (e10.initializer ? 16777216 : 0); + const symbol = createSymbol(flags, text); + symbol.links.type = getTypeFromBindingElement(e10, includePatternInType, reportErrors2); + symbol.links.bindingElement = e10; + members.set(symbol.escapedName, symbol); + }); + const result2 = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + stringIndexInfo ? [stringIndexInfo] : emptyArray + ); + result2.objectFlags |= objectFlags; + if (includePatternInType) { + result2.pattern = pattern5; + result2.objectFlags |= 131072; + } + return result2; + } + function getTypeFromArrayBindingPattern(pattern5, includePatternInType, reportErrors2) { + const elements = pattern5.elements; + const lastElement = lastOrUndefined(elements); + const restElement = lastElement && lastElement.kind === 208 && lastElement.dotDotDotToken ? lastElement : void 0; + if (elements.length === 0 || elements.length === 1 && restElement) { + return languageVersion >= 2 ? createIterableType(anyType2) : anyArrayType; + } + const elementTypes = map4(elements, (e10) => isOmittedExpression(e10) ? anyType2 : getTypeFromBindingElement(e10, includePatternInType, reportErrors2)); + const minLength = findLastIndex2(elements, (e10) => !(e10 === restElement || isOmittedExpression(e10) || hasDefaultValue(e10)), elements.length - 1) + 1; + const elementFlags = map4( + elements, + (e10, i7) => e10 === restElement ? 4 : i7 >= minLength ? 2 : 1 + /* Required */ + ); + let result2 = createTupleType(elementTypes, elementFlags); + if (includePatternInType) { + result2 = cloneTypeReference(result2); + result2.pattern = pattern5; + result2.objectFlags |= 131072; + } + return result2; + } + function getTypeFromBindingPattern(pattern5, includePatternInType = false, reportErrors2 = false) { + return pattern5.kind === 206 ? getTypeFromObjectBindingPattern(pattern5, includePatternInType, reportErrors2) : getTypeFromArrayBindingPattern(pattern5, includePatternInType, reportErrors2); + } + function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors2) { + return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration( + declaration, + /*includeOptionality*/ + true, + 0 + /* Normal */ + ), declaration, reportErrors2); + } + function getTypeFromImportAttributes(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const symbol = createSymbol( + 4096, + "__importAttributes" + /* ImportAttributes */ + ); + const members = createSymbolTable(); + forEach4(node.elements, (attr) => { + const member = createSymbol(4, getNameFromImportAttribute(attr)); + member.parent = symbol; + member.links.type = checkImportAttribute(attr); + member.links.target = member; + members.set(member.escapedName, member); + }); + const type3 = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); + type3.objectFlags |= 128 | 262144; + links.resolvedType = type3; + } + return links.resolvedType; + } + function isGlobalSymbolConstructor(node) { + const symbol = getSymbolOfNode(node); + const globalSymbol = getGlobalESSymbolConstructorTypeSymbol( + /*reportErrors*/ + false + ); + return globalSymbol && symbol && symbol === globalSymbol; + } + function widenTypeForVariableLikeDeclaration(type3, declaration, reportErrors2) { + if (type3) { + if (type3.flags & 4096 && isGlobalSymbolConstructor(declaration.parent)) { + type3 = getESSymbolLikeTypeForNode(declaration); + } + if (reportErrors2) { + reportErrorsFromWidening(declaration, type3); + } + if (type3.flags & 8192 && (isBindingElement(declaration) || !declaration.type) && type3.symbol !== getSymbolOfDeclaration(declaration)) { + type3 = esSymbolType; + } + return getWidenedType(type3); + } + type3 = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType2; + if (reportErrors2) { + if (!declarationBelongsToPrivateAmbientMember(declaration)) { + reportImplicitAny(declaration, type3); + } + } + return type3; + } + function declarationBelongsToPrivateAmbientMember(declaration) { + const root2 = getRootDeclaration(declaration); + const memberDeclaration = root2.kind === 169 ? root2.parent : root2; + return isPrivateWithinAmbient(memberDeclaration); + } + function tryGetTypeFromEffectiveTypeNode(node) { + const typeNode = getEffectiveTypeAnnotationNode(node); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } + function isParameterOfContextSensitiveSignature(symbol) { + let decl = symbol.valueDeclaration; + if (!decl) { + return false; + } + if (isBindingElement(decl)) { + decl = walkUpBindingElementsAndPatterns(decl); + } + if (isParameter(decl)) { + return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent); + } + return false; + } + function getTypeOfVariableOrParameterOrProperty(symbol, checkMode) { + const links = getSymbolLinks(symbol); + if (!links.type) { + const type3 = getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode); + if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !checkMode) { + links.type = type3; + } + return type3; + } + return links.type; + } + function getTypeOfVariableOrParameterOrPropertyWorker(symbol, checkMode) { + if (symbol.flags & 4194304) { + return getTypeOfPrototypeProperty(symbol); + } + if (symbol === requireSymbol) { + return anyType2; + } + if (symbol.flags & 134217728 && symbol.valueDeclaration) { + const fileSymbol = getSymbolOfDeclaration(getSourceFileOfNode(symbol.valueDeclaration)); + const result2 = createSymbol(fileSymbol.flags, "exports"); + result2.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : []; + result2.parent = symbol; + result2.links.target = fileSymbol; + if (fileSymbol.valueDeclaration) + result2.valueDeclaration = fileSymbol.valueDeclaration; + if (fileSymbol.members) + result2.members = new Map(fileSymbol.members); + if (fileSymbol.exports) + result2.exports = new Map(fileSymbol.exports); + const members = createSymbolTable(); + members.set("exports", result2); + return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); + } + Debug.assertIsDefined(symbol.valueDeclaration); + const declaration = symbol.valueDeclaration; + if (isSourceFile(declaration) && isJsonSourceFile(declaration)) { + if (!declaration.statements.length) { + return emptyObjectType; + } + return getWidenedType(getWidenedLiteralType(checkExpression(declaration.statements[0].expression))); + } + if (isAccessor(declaration)) { + return getTypeOfAccessors(symbol); + } + if (!pushTypeResolution( + symbol, + 0 + /* Type */ + )) { + if (symbol.flags & 512 && !(symbol.flags & 67108864)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (isBindingElement(declaration) && checkMode === 1) { + return errorType; + } + return reportCircularityError(symbol); + } + let type3; + if (declaration.kind === 277) { + type3 = widenTypeForVariableLikeDeclaration(tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionCached(declaration.expression), declaration); + } else if (isBinaryExpression(declaration) || isInJSFile(declaration) && (isCallExpression(declaration) || (isPropertyAccessExpression(declaration) || isBindableStaticElementAccessExpression(declaration)) && isBinaryExpression(declaration.parent))) { + type3 = getWidenedTypeForAssignmentDeclaration(symbol); + } else if (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isIdentifier(declaration) || isStringLiteralLike(declaration) || isNumericLiteral(declaration) || isClassDeclaration(declaration) || isFunctionDeclaration(declaration) || isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration) || isMethodSignature(declaration) || isSourceFile(declaration)) { + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type3 = isBinaryExpression(declaration.parent) ? getWidenedTypeForAssignmentDeclaration(symbol) : tryGetTypeFromEffectiveTypeNode(declaration) || anyType2; + } else if (isPropertyAssignment(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } else if (isJsxAttribute(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } else if (isShorthandPropertyAssignment(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation( + declaration.name, + 0 + /* Normal */ + ); + } else if (isObjectLiteralMethod(declaration)) { + type3 = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod( + declaration, + 0 + /* Normal */ + ); + } else if (isParameter(declaration) || isPropertyDeclaration(declaration) || isPropertySignature(declaration) || isVariableDeclaration(declaration) || isBindingElement(declaration) || isJSDocPropertyLikeTag(declaration)) { + type3 = getWidenedTypeForVariableLikeDeclaration( + declaration, + /*reportErrors*/ + true + ); + } else if (isEnumDeclaration(declaration)) { + type3 = getTypeOfFuncClassEnumModule(symbol); + } else if (isEnumMember(declaration)) { + type3 = getTypeOfEnumMember(symbol); + } else { + return Debug.fail("Unhandled declaration kind! " + Debug.formatSyntaxKind(declaration.kind) + " for " + Debug.formatSymbol(symbol)); + } + if (!popTypeResolution()) { + if (symbol.flags & 512 && !(symbol.flags & 67108864)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (isBindingElement(declaration) && checkMode === 1) { + return type3; + } + return reportCircularityError(symbol); + } + return type3; + } + function getAnnotatedAccessorTypeNode(accessor) { + if (accessor) { + switch (accessor.kind) { + case 177: + const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); + return getterTypeAnnotation; + case 178: + const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); + return setterTypeAnnotation; + case 172: + Debug.assert(hasAccessorModifier(accessor)); + const accessorTypeAnnotation = getEffectiveTypeAnnotationNode(accessor); + return accessorTypeAnnotation; + } + } + return void 0; + } + function getAnnotatedAccessorType(accessor) { + const node = getAnnotatedAccessorTypeNode(accessor); + return node && getTypeFromTypeNode(node); + } + function getAnnotatedAccessorThisParameter(accessor) { + const parameter = getAccessorThisParameter(accessor); + return parameter && parameter.symbol; + } + function getThisTypeOfDeclaration(declaration) { + return getThisTypeOfSignature(getSignatureFromDeclaration(declaration)); + } + function getTypeOfAccessors(symbol) { + const links = getSymbolLinks(symbol); + if (!links.type) { + if (!pushTypeResolution( + symbol, + 0 + /* Type */ + )) { + return errorType; + } + const getter = getDeclarationOfKind( + symbol, + 177 + /* GetAccessor */ + ); + const setter = getDeclarationOfKind( + symbol, + 178 + /* SetAccessor */ + ); + const accessor = tryCast(getDeclarationOfKind( + symbol, + 172 + /* PropertyDeclaration */ + ), isAutoAccessorPropertyDeclaration); + let type3 = getter && isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) || getAnnotatedAccessorType(getter) || getAnnotatedAccessorType(setter) || getAnnotatedAccessorType(accessor) || getter && getter.body && getReturnTypeFromBody(getter) || accessor && accessor.initializer && getWidenedTypeForVariableLikeDeclaration( + accessor, + /*reportErrors*/ + true + ); + if (!type3) { + if (setter && !isPrivateWithinAmbient(setter)) { + errorOrSuggestion(noImplicitAny, setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString2(symbol)); + } else if (getter && !isPrivateWithinAmbient(getter)) { + errorOrSuggestion(noImplicitAny, getter, Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString2(symbol)); + } else if (accessor && !isPrivateWithinAmbient(accessor)) { + errorOrSuggestion(noImplicitAny, accessor, Diagnostics.Member_0_implicitly_has_an_1_type, symbolToString2(symbol), "any"); + } + type3 = anyType2; + } + if (!popTypeResolution()) { + if (getAnnotatedAccessorTypeNode(getter)) { + error22(getter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getAnnotatedAccessorTypeNode(setter)) { + error22(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getAnnotatedAccessorTypeNode(accessor)) { + error22(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } else if (getter && noImplicitAny) { + error22(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString2(symbol)); + } + type3 = anyType2; + } + links.type = type3; + } + return links.type; + } + function getWriteTypeOfAccessors(symbol) { + const links = getSymbolLinks(symbol); + if (!links.writeType) { + if (!pushTypeResolution( + symbol, + 8 + /* WriteType */ + )) { + return errorType; + } + const setter = getDeclarationOfKind( + symbol, + 178 + /* SetAccessor */ + ) ?? tryCast(getDeclarationOfKind( + symbol, + 172 + /* PropertyDeclaration */ + ), isAutoAccessorPropertyDeclaration); + let writeType = getAnnotatedAccessorType(setter); + if (!popTypeResolution()) { + if (getAnnotatedAccessorTypeNode(setter)) { + error22(setter, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + } + writeType = anyType2; + } + links.writeType = writeType || getTypeOfAccessors(symbol); + } + return links.writeType; + } + function getBaseTypeVariableOfClass(symbol) { + const baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol)); + return baseConstructorType.flags & 8650752 ? baseConstructorType : baseConstructorType.flags & 2097152 ? find2(baseConstructorType.types, (t8) => !!(t8.flags & 8650752)) : void 0; + } + function getTypeOfFuncClassEnumModule(symbol) { + let links = getSymbolLinks(symbol); + const originalLinks = links; + if (!links.type) { + const expando = symbol.valueDeclaration && getSymbolOfExpando( + symbol.valueDeclaration, + /*allowDeclaration*/ + false + ); + if (expando) { + const merged = mergeJSSymbols(symbol, expando); + if (merged) { + symbol = merged; + links = merged.links; + } + } + originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol); + } + return links.type; + } + function getTypeOfFuncClassEnumModuleWorker(symbol) { + const declaration = symbol.valueDeclaration; + if (symbol.flags & 1536 && isShorthandAmbientModuleSymbol(symbol)) { + return anyType2; + } else if (declaration && (declaration.kind === 226 || isAccessExpression(declaration) && declaration.parent.kind === 226)) { + return getWidenedTypeForAssignmentDeclaration(symbol); + } else if (symbol.flags & 512 && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { + const resolvedModule = resolveExternalModuleSymbol(symbol); + if (resolvedModule !== symbol) { + if (!pushTypeResolution( + symbol, + 0 + /* Type */ + )) { + return errorType; + } + const exportEquals = getMergedSymbol(symbol.exports.get( + "export=" + /* ExportEquals */ + )); + const type22 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? void 0 : resolvedModule); + if (!popTypeResolution()) { + return reportCircularityError(symbol); + } + return type22; + } + } + const type3 = createObjectType(16, symbol); + if (symbol.flags & 32) { + const baseTypeVariable = getBaseTypeVariableOfClass(symbol); + return baseTypeVariable ? getIntersectionType([type3, baseTypeVariable]) : type3; + } else { + return strictNullChecks && symbol.flags & 16777216 ? getOptionalType( + type3, + /*isProperty*/ + true + ) : type3; + } + } + function getTypeOfEnumMember(symbol) { + const links = getSymbolLinks(symbol); + return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol)); + } + function getTypeOfAlias(symbol) { + const links = getSymbolLinks(symbol); + if (!links.type) { + if (!pushTypeResolution( + symbol, + 0 + /* Type */ + )) { + return errorType; + } + const targetSymbol = resolveAlias(symbol); + const exportSymbol = symbol.declarations && getTargetOfAliasDeclaration( + getDeclarationOfAliasSymbol(symbol), + /*dontRecursivelyResolve*/ + true + ); + const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d7) => isExportAssignment(d7) ? tryGetTypeFromEffectiveTypeNode(d7) : void 0); + links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 ? getTypeOfSymbol(targetSymbol) : errorType; + if (!popTypeResolution()) { + reportCircularityError(exportSymbol ?? symbol); + return links.type = errorType; + } + } + return links.type; + } + function getTypeOfInstantiatedSymbol(symbol) { + const links = getSymbolLinks(symbol); + return links.type || (links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper)); + } + function getWriteTypeOfInstantiatedSymbol(symbol) { + const links = getSymbolLinks(symbol); + return links.writeType || (links.writeType = instantiateType(getWriteTypeOfSymbol(links.target), links.mapper)); + } + function reportCircularityError(symbol) { + const declaration = symbol.valueDeclaration; + if (declaration) { + if (getEffectiveTypeAnnotationNode(declaration)) { + error22(symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString2(symbol)); + return errorType; + } + if (noImplicitAny && (declaration.kind !== 169 || declaration.initializer)) { + error22(symbol.valueDeclaration, Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString2(symbol)); + } + } else if (symbol.flags & 2097152) { + const node = getDeclarationOfAliasSymbol(symbol); + if (node) { + error22(node, Diagnostics.Circular_definition_of_import_alias_0, symbolToString2(symbol)); + } + } + return anyType2; + } + function getTypeOfSymbolWithDeferredType(symbol) { + const links = getSymbolLinks(symbol); + if (!links.type) { + Debug.assertIsDefined(links.deferralParent); + Debug.assertIsDefined(links.deferralConstituents); + links.type = links.deferralParent.flags & 1048576 ? getUnionType(links.deferralConstituents) : getIntersectionType(links.deferralConstituents); + } + return links.type; + } + function getWriteTypeOfSymbolWithDeferredType(symbol) { + const links = getSymbolLinks(symbol); + if (!links.writeType && links.deferralWriteConstituents) { + Debug.assertIsDefined(links.deferralParent); + Debug.assertIsDefined(links.deferralConstituents); + links.writeType = links.deferralParent.flags & 1048576 ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents); + } + return links.writeType; + } + function getWriteTypeOfSymbol(symbol) { + const checkFlags = getCheckFlags(symbol); + if (symbol.flags & 4) { + return checkFlags & 2 ? checkFlags & 65536 ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : ( + // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty + symbol.links.writeType || symbol.links.type + ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216)); + } + if (symbol.flags & 98304) { + return checkFlags & 1 ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol); + } + return getTypeOfSymbol(symbol); + } + function getTypeOfSymbol(symbol, checkMode) { + const checkFlags = getCheckFlags(symbol); + if (checkFlags & 65536) { + return getTypeOfSymbolWithDeferredType(symbol); + } + if (checkFlags & 1) { + return getTypeOfInstantiatedSymbol(symbol); + } + if (checkFlags & 262144) { + return getTypeOfMappedSymbol(symbol); + } + if (checkFlags & 8192) { + return getTypeOfReverseMappedSymbol(symbol); + } + if (symbol.flags & (3 | 4)) { + return getTypeOfVariableOrParameterOrProperty(symbol, checkMode); + } + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + if (symbol.flags & 8) { + return getTypeOfEnumMember(symbol); + } + if (symbol.flags & 98304) { + return getTypeOfAccessors(symbol); + } + if (symbol.flags & 2097152) { + return getTypeOfAlias(symbol); + } + return errorType; + } + function getNonMissingTypeOfSymbol(symbol) { + return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216)); + } + function isReferenceToType2(type3, target) { + return type3 !== void 0 && target !== void 0 && (getObjectFlags(type3) & 4) !== 0 && type3.target === target; + } + function getTargetType(type3) { + return getObjectFlags(type3) & 4 ? type3.target : type3; + } + function hasBaseType(type3, checkBase) { + return check(type3); + function check(type22) { + if (getObjectFlags(type22) & (3 | 4)) { + const target = getTargetType(type22); + return target === checkBase || some2(getBaseTypes(target), check); + } else if (type22.flags & 2097152) { + return some2(type22.types, check); + } + return false; + } + } + function appendTypeParameters(typeParameters, declarations) { + for (const declaration of declarations) { + typeParameters = appendIfUnique(typeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(declaration))); + } + return typeParameters; + } + function getOuterTypeParameters(node, includeThisTypes) { + while (true) { + node = node.parent; + if (node && isBinaryExpression(node)) { + const assignmentKind = getAssignmentDeclarationKind(node); + if (assignmentKind === 6 || assignmentKind === 3) { + const symbol = getSymbolOfDeclaration(node.left); + if (symbol && symbol.parent && !findAncestor(symbol.parent.valueDeclaration, (d7) => node === d7)) { + node = symbol.parent.valueDeclaration; + } + } + } + if (!node) { + return void 0; + } + switch (node.kind) { + case 263: + case 231: + case 264: + case 179: + case 180: + case 173: + case 184: + case 185: + case 324: + case 262: + case 174: + case 218: + case 219: + case 265: + case 352: + case 353: + case 347: + case 345: + case 200: + case 194: { + const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); + if (node.kind === 200) { + return append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))); + } else if (node.kind === 194) { + return concatenate(outerTypeParameters, getInferTypeParameters(node)); + } + const outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, getEffectiveTypeParameterDeclarations(node)); + const thisType = includeThisTypes && (node.kind === 263 || node.kind === 231 || node.kind === 264 || isJSConstructor(node)) && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node)).thisType; + return thisType ? append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; + } + case 348: + const paramSymbol = getParameterSymbolFromJSDoc(node); + if (paramSymbol) { + node = paramSymbol.valueDeclaration; + } + break; + case 327: { + const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); + return node.tags ? appendTypeParameters(outerTypeParameters, flatMap2(node.tags, (t8) => isJSDocTemplateTag(t8) ? t8.typeParameters : void 0)) : outerTypeParameters; + } + } + } + } + function getOuterTypeParametersOfClassOrInterface(symbol) { + var _a2; + const declaration = symbol.flags & 32 || symbol.flags & 16 ? symbol.valueDeclaration : (_a2 = symbol.declarations) == null ? void 0 : _a2.find((decl) => { + if (decl.kind === 264) { + return true; + } + if (decl.kind !== 260) { + return false; + } + const initializer = decl.initializer; + return !!initializer && (initializer.kind === 218 || initializer.kind === 219); + }); + Debug.assert(!!declaration, "Class was missing valueDeclaration -OR- non-class had no interface declarations"); + return getOuterTypeParameters(declaration); + } + function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { + if (!symbol.declarations) { + return; + } + let result2; + for (const node of symbol.declarations) { + if (node.kind === 264 || node.kind === 263 || node.kind === 231 || isJSConstructor(node) || isTypeAlias(node)) { + const declaration = node; + result2 = appendTypeParameters(result2, getEffectiveTypeParameterDeclarations(declaration)); + } + } + return result2; + } + function getTypeParametersOfClassOrInterface(symbol) { + return concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); + } + function isMixinConstructorType(type3) { + const signatures = getSignaturesOfType( + type3, + 1 + /* Construct */ + ); + if (signatures.length === 1) { + const s7 = signatures[0]; + if (!s7.typeParameters && s7.parameters.length === 1 && signatureHasRestParameter(s7)) { + const paramType = getTypeOfParameter(s7.parameters[0]); + return isTypeAny(paramType) || getElementTypeOfArrayType(paramType) === anyType2; + } + } + return false; + } + function isConstructorType(type3) { + if (getSignaturesOfType( + type3, + 1 + /* Construct */ + ).length > 0) { + return true; + } + if (type3.flags & 8650752) { + const constraint = getBaseConstraintOfType(type3); + return !!constraint && isMixinConstructorType(constraint); + } + return false; + } + function getBaseTypeNodeOfClass(type3) { + const decl = getClassLikeDeclarationOfSymbol(type3.symbol); + return decl && getEffectiveBaseTypeNode(decl); + } + function getConstructorsForTypeArguments(type3, typeArgumentNodes, location2) { + const typeArgCount = length(typeArgumentNodes); + const isJavascript = isInJSFile(location2); + return filter2(getSignaturesOfType( + type3, + 1 + /* Construct */ + ), (sig) => (isJavascript || typeArgCount >= getMinTypeArgumentCount(sig.typeParameters)) && typeArgCount <= length(sig.typeParameters)); + } + function getInstantiatedConstructorsForTypeArguments(type3, typeArgumentNodes, location2) { + const signatures = getConstructorsForTypeArguments(type3, typeArgumentNodes, location2); + const typeArguments = map4(typeArgumentNodes, getTypeFromTypeNode); + return sameMap(signatures, (sig) => some2(sig.typeParameters) ? getSignatureInstantiation(sig, typeArguments, isInJSFile(location2)) : sig); + } + function getBaseConstructorTypeOfClass(type3) { + if (!type3.resolvedBaseConstructorType) { + const decl = getClassLikeDeclarationOfSymbol(type3.symbol); + const extended = decl && getEffectiveBaseTypeNode(decl); + const baseTypeNode = getBaseTypeNodeOfClass(type3); + if (!baseTypeNode) { + return type3.resolvedBaseConstructorType = undefinedType2; + } + if (!pushTypeResolution( + type3, + 1 + /* ResolvedBaseConstructorType */ + )) { + return errorType; + } + const baseConstructorType = checkExpression(baseTypeNode.expression); + if (extended && baseTypeNode !== extended) { + Debug.assert(!extended.typeArguments); + checkExpression(extended.expression); + } + if (baseConstructorType.flags & (524288 | 2097152)) { + resolveStructuredTypeMembers(baseConstructorType); + } + if (!popTypeResolution()) { + error22(type3.symbol.valueDeclaration, Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression, symbolToString2(type3.symbol)); + return type3.resolvedBaseConstructorType = errorType; + } + if (!(baseConstructorType.flags & 1) && baseConstructorType !== nullWideningType && !isConstructorType(baseConstructorType)) { + const err = error22(baseTypeNode.expression, Diagnostics.Type_0_is_not_a_constructor_function_type, typeToString(baseConstructorType)); + if (baseConstructorType.flags & 262144) { + const constraint = getConstraintFromTypeParameter(baseConstructorType); + let ctorReturn = unknownType2; + if (constraint) { + const ctorSig = getSignaturesOfType( + constraint, + 1 + /* Construct */ + ); + if (ctorSig[0]) { + ctorReturn = getReturnTypeOfSignature(ctorSig[0]); + } + } + if (baseConstructorType.symbol.declarations) { + addRelatedInfo(err, createDiagnosticForNode(baseConstructorType.symbol.declarations[0], Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1, symbolToString2(baseConstructorType.symbol), typeToString(ctorReturn))); + } + } + return type3.resolvedBaseConstructorType = errorType; + } + type3.resolvedBaseConstructorType = baseConstructorType; + } + return type3.resolvedBaseConstructorType; + } + function getImplementsTypes(type3) { + let resolvedImplementsTypes = emptyArray; + if (type3.symbol.declarations) { + for (const declaration of type3.symbol.declarations) { + const implementsTypeNodes = getEffectiveImplementsTypeNodes(declaration); + if (!implementsTypeNodes) + continue; + for (const node of implementsTypeNodes) { + const implementsType = getTypeFromTypeNode(node); + if (!isErrorType(implementsType)) { + if (resolvedImplementsTypes === emptyArray) { + resolvedImplementsTypes = [implementsType]; + } else { + resolvedImplementsTypes.push(implementsType); + } + } + } + } + } + return resolvedImplementsTypes; + } + function reportCircularBaseType(node, type3) { + error22(node, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* WriteArrayAsGenericType */ + )); + } + function getBaseTypes(type3) { + if (!type3.baseTypesResolved) { + if (pushTypeResolution( + type3, + 7 + /* ResolvedBaseTypes */ + )) { + if (type3.objectFlags & 8) { + type3.resolvedBaseTypes = [getTupleBaseType(type3)]; + } else if (type3.symbol.flags & (32 | 64)) { + if (type3.symbol.flags & 32) { + resolveBaseTypesOfClass(type3); + } + if (type3.symbol.flags & 64) { + resolveBaseTypesOfInterface(type3); + } + } else { + Debug.fail("type must be class or interface"); + } + if (!popTypeResolution() && type3.symbol.declarations) { + for (const declaration of type3.symbol.declarations) { + if (declaration.kind === 263 || declaration.kind === 264) { + reportCircularBaseType(declaration, type3); + } + } + } + } + type3.baseTypesResolved = true; + } + return type3.resolvedBaseTypes; + } + function getTupleBaseType(type3) { + const elementTypes = sameMap(type3.typeParameters, (t8, i7) => type3.elementFlags[i7] & 8 ? getIndexedAccessType(t8, numberType2) : t8); + return createArrayType(getUnionType(elementTypes || emptyArray), type3.readonly); + } + function resolveBaseTypesOfClass(type3) { + type3.resolvedBaseTypes = resolvingEmptyArray; + const baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type3)); + if (!(baseConstructorType.flags & (524288 | 2097152 | 1))) { + return type3.resolvedBaseTypes = emptyArray; + } + const baseTypeNode = getBaseTypeNodeOfClass(type3); + let baseType; + const originalBaseType = baseConstructorType.symbol ? getDeclaredTypeOfSymbol(baseConstructorType.symbol) : void 0; + if (baseConstructorType.symbol && baseConstructorType.symbol.flags & 32 && areAllOuterTypeParametersApplied(originalBaseType)) { + baseType = getTypeFromClassOrInterfaceReference(baseTypeNode, baseConstructorType.symbol); + } else if (baseConstructorType.flags & 1) { + baseType = baseConstructorType; + } else { + const constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); + if (!constructors.length) { + error22(baseTypeNode.expression, Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); + return type3.resolvedBaseTypes = emptyArray; + } + baseType = getReturnTypeOfSignature(constructors[0]); + } + if (isErrorType(baseType)) { + return type3.resolvedBaseTypes = emptyArray; + } + const reducedBaseType = getReducedType(baseType); + if (!isValidBaseType(reducedBaseType)) { + const elaboration = elaborateNeverIntersection( + /*errorInfo*/ + void 0, + baseType + ); + const diagnostic = chainDiagnosticMessages(elaboration, Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members, typeToString(reducedBaseType)); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(baseTypeNode.expression), baseTypeNode.expression, diagnostic)); + return type3.resolvedBaseTypes = emptyArray; + } + if (type3 === reducedBaseType || hasBaseType(reducedBaseType, type3)) { + error22(type3.symbol.valueDeclaration, Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* WriteArrayAsGenericType */ + )); + return type3.resolvedBaseTypes = emptyArray; + } + if (type3.resolvedBaseTypes === resolvingEmptyArray) { + type3.members = void 0; + } + return type3.resolvedBaseTypes = [reducedBaseType]; + } + function areAllOuterTypeParametersApplied(type3) { + const outerTypeParameters = type3.outerTypeParameters; + if (outerTypeParameters) { + const last22 = outerTypeParameters.length - 1; + const typeArguments = getTypeArguments(type3); + return outerTypeParameters[last22].symbol !== typeArguments[last22].symbol; + } + return true; + } + function isValidBaseType(type3) { + if (type3.flags & 262144) { + const constraint = getBaseConstraintOfType(type3); + if (constraint) { + return isValidBaseType(constraint); + } + } + return !!(type3.flags & (524288 | 67108864 | 1) && !isGenericMappedType(type3) || type3.flags & 2097152 && every2(type3.types, isValidBaseType)); + } + function resolveBaseTypesOfInterface(type3) { + type3.resolvedBaseTypes = type3.resolvedBaseTypes || emptyArray; + if (type3.symbol.declarations) { + for (const declaration of type3.symbol.declarations) { + if (declaration.kind === 264 && getInterfaceBaseTypeNodes(declaration)) { + for (const node of getInterfaceBaseTypeNodes(declaration)) { + const baseType = getReducedType(getTypeFromTypeNode(node)); + if (!isErrorType(baseType)) { + if (isValidBaseType(baseType)) { + if (type3 !== baseType && !hasBaseType(baseType, type3)) { + if (type3.resolvedBaseTypes === emptyArray) { + type3.resolvedBaseTypes = [baseType]; + } else { + type3.resolvedBaseTypes.push(baseType); + } + } else { + reportCircularBaseType(declaration, type3); + } + } else { + error22(node, Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members); + } + } + } + } + } + } + } + function isThislessInterface(symbol) { + if (!symbol.declarations) { + return true; + } + for (const declaration of symbol.declarations) { + if (declaration.kind === 264) { + if (declaration.flags & 256) { + return false; + } + const baseTypeNodes = getInterfaceBaseTypeNodes(declaration); + if (baseTypeNodes) { + for (const node of baseTypeNodes) { + if (isEntityNameExpression(node.expression)) { + const baseSymbol = resolveEntityName( + node.expression, + 788968, + /*ignoreErrors*/ + true + ); + if (!baseSymbol || !(baseSymbol.flags & 64) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) { + return false; + } + } + } + } + } + } + return true; + } + function getDeclaredTypeOfClassOrInterface(symbol) { + let links = getSymbolLinks(symbol); + const originalLinks = links; + if (!links.declaredType) { + const kind = symbol.flags & 32 ? 1 : 2; + const merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration)); + if (merged) { + symbol = merged; + links = merged.links; + } + const type3 = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol); + const outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol); + const localTypeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (outerTypeParameters || localTypeParameters || kind === 1 || !isThislessInterface(symbol)) { + type3.objectFlags |= 4; + type3.typeParameters = concatenate(outerTypeParameters, localTypeParameters); + type3.outerTypeParameters = outerTypeParameters; + type3.localTypeParameters = localTypeParameters; + type3.instantiations = /* @__PURE__ */ new Map(); + type3.instantiations.set(getTypeListId(type3.typeParameters), type3); + type3.target = type3; + type3.resolvedTypeArguments = type3.typeParameters; + type3.thisType = createTypeParameter(symbol); + type3.thisType.isThisType = true; + type3.thisType.constraint = type3; + } + } + return links.declaredType; + } + function getDeclaredTypeOfTypeAlias(symbol) { + var _a2; + const links = getSymbolLinks(symbol); + if (!links.declaredType) { + if (!pushTypeResolution( + symbol, + 2 + /* DeclaredType */ + )) { + return errorType; + } + const declaration = Debug.checkDefined((_a2 = symbol.declarations) == null ? void 0 : _a2.find(isTypeAlias), "Type alias symbol with no valid declaration found"); + const typeNode = isJSDocTypeAlias(declaration) ? declaration.typeExpression : declaration.type; + let type3 = typeNode ? getTypeFromTypeNode(typeNode) : errorType; + if (popTypeResolution()) { + const typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (typeParameters) { + links.typeParameters = typeParameters; + links.instantiations = /* @__PURE__ */ new Map(); + links.instantiations.set(getTypeListId(typeParameters), type3); + } + } else { + type3 = errorType; + if (declaration.kind === 347) { + error22(declaration.typeExpression.type, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString2(symbol)); + } else { + error22(isNamedDeclaration(declaration) ? declaration.name || declaration : declaration, Diagnostics.Type_alias_0_circularly_references_itself, symbolToString2(symbol)); + } + } + links.declaredType = type3; + } + return links.declaredType; + } + function getBaseTypeOfEnumLikeType(type3) { + return type3.flags & 1056 && type3.symbol.flags & 8 ? getDeclaredTypeOfSymbol(getParentOfSymbol(type3.symbol)) : type3; + } + function getDeclaredTypeOfEnum(symbol) { + const links = getSymbolLinks(symbol); + if (!links.declaredType) { + const memberTypeList = []; + if (symbol.declarations) { + for (const declaration of symbol.declarations) { + if (declaration.kind === 266) { + for (const member of declaration.members) { + if (hasBindableName(member)) { + const memberSymbol = getSymbolOfDeclaration(member); + const value2 = getEnumMemberValue(member); + const memberType = getFreshTypeOfLiteralType( + value2 !== void 0 ? getEnumLiteralType(value2, getSymbolId(symbol), memberSymbol) : createComputedEnumType(memberSymbol) + ); + getSymbolLinks(memberSymbol).declaredType = memberType; + memberTypeList.push(getRegularTypeOfLiteralType(memberType)); + } + } + } + } + } + const enumType2 = memberTypeList.length ? getUnionType( + memberTypeList, + 1, + symbol, + /*aliasTypeArguments*/ + void 0 + ) : createComputedEnumType(symbol); + if (enumType2.flags & 1048576) { + enumType2.flags |= 1024; + enumType2.symbol = symbol; + } + links.declaredType = enumType2; + } + return links.declaredType; + } + function createComputedEnumType(symbol) { + const regularType = createTypeWithSymbol(32, symbol); + const freshType = createTypeWithSymbol(32, symbol); + regularType.regularType = regularType; + regularType.freshType = freshType; + freshType.regularType = regularType; + freshType.freshType = freshType; + return regularType; + } + function getDeclaredTypeOfEnumMember(symbol) { + const links = getSymbolLinks(symbol); + if (!links.declaredType) { + const enumType2 = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); + if (!links.declaredType) { + links.declaredType = enumType2; + } + } + return links.declaredType; + } + function getDeclaredTypeOfTypeParameter(symbol) { + const links = getSymbolLinks(symbol); + return links.declaredType || (links.declaredType = createTypeParameter(symbol)); + } + function getDeclaredTypeOfAlias(symbol) { + const links = getSymbolLinks(symbol); + return links.declaredType || (links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol))); + } + function getDeclaredTypeOfSymbol(symbol) { + return tryGetDeclaredTypeOfSymbol(symbol) || errorType; + } + function tryGetDeclaredTypeOfSymbol(symbol) { + if (symbol.flags & (32 | 64)) { + return getDeclaredTypeOfClassOrInterface(symbol); + } + if (symbol.flags & 524288) { + return getDeclaredTypeOfTypeAlias(symbol); + } + if (symbol.flags & 262144) { + return getDeclaredTypeOfTypeParameter(symbol); + } + if (symbol.flags & 384) { + return getDeclaredTypeOfEnum(symbol); + } + if (symbol.flags & 8) { + return getDeclaredTypeOfEnumMember(symbol); + } + if (symbol.flags & 2097152) { + return getDeclaredTypeOfAlias(symbol); + } + return void 0; + } + function isThislessType(node) { + switch (node.kind) { + case 133: + case 159: + case 154: + case 150: + case 163: + case 136: + case 155: + case 151: + case 116: + case 157: + case 146: + case 201: + return true; + case 188: + return isThislessType(node.elementType); + case 183: + return !node.typeArguments || node.typeArguments.every(isThislessType); + } + return false; + } + function isThislessTypeParameter(node) { + const constraint = getEffectiveConstraintOfTypeParameter(node); + return !constraint || isThislessType(constraint); + } + function isThislessVariableLikeDeclaration(node) { + const typeNode = getEffectiveTypeAnnotationNode(node); + return typeNode ? isThislessType(typeNode) : !hasInitializer(node); + } + function isThislessFunctionLikeDeclaration(node) { + const returnType = getEffectiveReturnTypeNode(node); + const typeParameters = getEffectiveTypeParameterDeclarations(node); + return (node.kind === 176 || !!returnType && isThislessType(returnType)) && node.parameters.every(isThislessVariableLikeDeclaration) && typeParameters.every(isThislessTypeParameter); + } + function isThisless(symbol) { + if (symbol.declarations && symbol.declarations.length === 1) { + const declaration = symbol.declarations[0]; + if (declaration) { + switch (declaration.kind) { + case 172: + case 171: + return isThislessVariableLikeDeclaration(declaration); + case 174: + case 173: + case 176: + case 177: + case 178: + return isThislessFunctionLikeDeclaration(declaration); + } + } + } + return false; + } + function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) { + const result2 = createSymbolTable(); + for (const symbol of symbols) { + result2.set(symbol.escapedName, mappingThisOnly && isThisless(symbol) ? symbol : instantiateSymbol(symbol, mapper)); + } + return result2; + } + function addInheritedMembers(symbols, baseSymbols) { + for (const base of baseSymbols) { + if (isStaticPrivateIdentifierProperty(base)) { + continue; + } + const derived = symbols.get(base.escapedName); + if (!derived || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration) && !isConstructorDeclaredProperty(derived) && !getContainingClassStaticBlock(derived.valueDeclaration)) { + symbols.set(base.escapedName, base); + symbols.set(base.escapedName, base); + } + } + } + function isStaticPrivateIdentifierProperty(s7) { + return !!s7.valueDeclaration && isPrivateIdentifierClassElementDeclaration(s7.valueDeclaration) && isStatic(s7.valueDeclaration); + } + function resolveDeclaredMembers(type3) { + if (!type3.declaredProperties) { + const symbol = type3.symbol; + const members = getMembersOfSymbol(symbol); + type3.declaredProperties = getNamedMembers(members); + type3.declaredCallSignatures = emptyArray; + type3.declaredConstructSignatures = emptyArray; + type3.declaredIndexInfos = emptyArray; + type3.declaredCallSignatures = getSignaturesOfSymbol(members.get( + "__call" + /* Call */ + )); + type3.declaredConstructSignatures = getSignaturesOfSymbol(members.get( + "__new" + /* New */ + )); + type3.declaredIndexInfos = getIndexInfosOfSymbol(symbol); + } + return type3; + } + function isLateBindableName(node) { + if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) { + return false; + } + const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression; + return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr)); + } + function isLateBoundName(name2) { + return name2.charCodeAt(0) === 95 && name2.charCodeAt(1) === 95 && name2.charCodeAt(2) === 64; + } + function hasLateBindableName(node) { + const name2 = getNameOfDeclaration(node); + return !!name2 && isLateBindableName(name2); + } + function hasBindableName(node) { + return !hasDynamicName(node) || hasLateBindableName(node); + } + function isNonBindableDynamicName(node) { + return isDynamicName(node) && !isLateBindableName(node); + } + function addDeclarationToLateBoundSymbol(symbol, member, symbolFlags) { + Debug.assert(!!(getCheckFlags(symbol) & 4096), "Expected a late-bound symbol."); + symbol.flags |= symbolFlags; + getSymbolLinks(member.symbol).lateSymbol = symbol; + if (!symbol.declarations) { + symbol.declarations = [member]; + } else if (!member.symbol.isReplaceableByMethod) { + symbol.declarations.push(member); + } + if (symbolFlags & 111551) { + if (!symbol.valueDeclaration || symbol.valueDeclaration.kind !== member.kind) { + symbol.valueDeclaration = member; + } + } + } + function lateBindMember(parent22, earlySymbols, lateSymbols, decl) { + Debug.assert(!!decl.symbol, "The member is expected to have a symbol."); + const links = getNodeLinks(decl); + if (!links.resolvedSymbol) { + links.resolvedSymbol = decl.symbol; + const declName = isBinaryExpression(decl) ? decl.left : decl.name; + const type3 = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName); + if (isTypeUsableAsPropertyName(type3)) { + const memberName = getPropertyNameFromType(type3); + const symbolFlags = decl.symbol.flags; + let lateSymbol = lateSymbols.get(memberName); + if (!lateSymbol) + lateSymbols.set(memberName, lateSymbol = createSymbol( + 0, + memberName, + 4096 + /* Late */ + )); + const earlySymbol = earlySymbols && earlySymbols.get(memberName); + if (!(parent22.flags & 32) && (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol)) { + const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; + const name2 = !(type3.flags & 8192) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName); + forEach4(declarations, (declaration) => error22(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name2)); + error22(declName || decl, Diagnostics.Duplicate_property_0, name2); + lateSymbol = createSymbol( + 0, + memberName, + 4096 + /* Late */ + ); + } + lateSymbol.links.nameType = type3; + addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); + if (lateSymbol.parent) { + Debug.assert(lateSymbol.parent === parent22, "Existing symbol parent should match new one"); + } else { + lateSymbol.parent = parent22; + } + return links.resolvedSymbol = lateSymbol; + } + } + return links.resolvedSymbol; + } + function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) { + const links = getSymbolLinks(symbol); + if (!links[resolutionKind]) { + const isStatic2 = resolutionKind === "resolvedExports"; + const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 ? getExportsOfModuleWorker(symbol).exports : symbol.exports; + links[resolutionKind] = earlySymbols || emptySymbols; + const lateSymbols = createSymbolTable(); + for (const decl of symbol.declarations || emptyArray) { + const members = getMembersOfDeclaration(decl); + if (members) { + for (const member of members) { + if (isStatic2 === hasStaticModifier(member)) { + if (hasLateBindableName(member)) { + lateBindMember(symbol, earlySymbols, lateSymbols, member); + } + } + } + } + } + const assignments = getFunctionExpressionParentSymbolOrSymbol(symbol).assignmentDeclarationMembers; + if (assignments) { + const decls = arrayFrom(assignments.values()); + for (const member of decls) { + const assignmentKind = getAssignmentDeclarationKind(member); + const isInstanceMember = assignmentKind === 3 || isBinaryExpression(member) && isPossiblyAliasedThisProperty(member, assignmentKind) || assignmentKind === 9 || assignmentKind === 6; + if (isStatic2 === !isInstanceMember) { + if (hasLateBindableName(member)) { + lateBindMember(symbol, earlySymbols, lateSymbols, member); + } + } + } + } + let resolved = combineSymbolTables(earlySymbols, lateSymbols); + if (symbol.flags & 33554432 && links.cjsExportMerged && symbol.declarations) { + for (const decl of symbol.declarations) { + const original = getSymbolLinks(decl.symbol)[resolutionKind]; + if (!resolved) { + resolved = original; + continue; + } + if (!original) + continue; + original.forEach((s7, name2) => { + const existing = resolved.get(name2); + if (!existing) + resolved.set(name2, s7); + else if (existing === s7) + return; + else + resolved.set(name2, mergeSymbol(existing, s7)); + }); + } + } + links[resolutionKind] = resolved || emptySymbols; + } + return links[resolutionKind]; + } + function getMembersOfSymbol(symbol) { + return symbol.flags & 6256 ? getResolvedMembersOrExportsOfSymbol( + symbol, + "resolvedMembers" + /* resolvedMembers */ + ) : symbol.members || emptySymbols; + } + function getLateBoundSymbol(symbol) { + if (symbol.flags & 106500 && symbol.escapedName === "__computed") { + const links = getSymbolLinks(symbol); + if (!links.lateSymbol && some2(symbol.declarations, hasLateBindableName)) { + const parent22 = getMergedSymbol(symbol.parent); + if (some2(symbol.declarations, hasStaticModifier)) { + getExportsOfSymbol(parent22); + } else { + getMembersOfSymbol(parent22); + } + } + return links.lateSymbol || (links.lateSymbol = symbol); + } + return symbol; + } + function getTypeWithThisArgument(type3, thisArgument, needApparentType) { + if (getObjectFlags(type3) & 4) { + const target = type3.target; + const typeArguments = getTypeArguments(type3); + return length(target.typeParameters) === length(typeArguments) ? createTypeReference(target, concatenate(typeArguments, [thisArgument || target.thisType])) : type3; + } else if (type3.flags & 2097152) { + const types3 = sameMap(type3.types, (t8) => getTypeWithThisArgument(t8, thisArgument, needApparentType)); + return types3 !== type3.types ? getIntersectionType(types3) : type3; + } + return needApparentType ? getApparentType(type3) : type3; + } + function resolveObjectTypeMembers(type3, source, typeParameters, typeArguments) { + let mapper; + let members; + let callSignatures; + let constructSignatures; + let indexInfos; + if (rangeEquals(typeParameters, typeArguments, 0, typeParameters.length)) { + members = source.symbol ? getMembersOfSymbol(source.symbol) : createSymbolTable(source.declaredProperties); + callSignatures = source.declaredCallSignatures; + constructSignatures = source.declaredConstructSignatures; + indexInfos = source.declaredIndexInfos; + } else { + mapper = createTypeMapper(typeParameters, typeArguments); + members = createInstantiatedSymbolTable( + source.declaredProperties, + mapper, + /*mappingThisOnly*/ + typeParameters.length === 1 + ); + callSignatures = instantiateSignatures(source.declaredCallSignatures, mapper); + constructSignatures = instantiateSignatures(source.declaredConstructSignatures, mapper); + indexInfos = instantiateIndexInfos(source.declaredIndexInfos, mapper); + } + const baseTypes = getBaseTypes(source); + if (baseTypes.length) { + if (source.symbol && members === getMembersOfSymbol(source.symbol)) { + const symbolTable = createSymbolTable(source.declaredProperties); + const sourceIndex = getIndexSymbol(source.symbol); + if (sourceIndex) { + symbolTable.set("__index", sourceIndex); + } + members = symbolTable; + } + setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos); + const thisArgument = lastOrUndefined(typeArguments); + for (const baseType of baseTypes) { + const instantiatedBaseType = thisArgument ? getTypeWithThisArgument(instantiateType(baseType, mapper), thisArgument) : baseType; + addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); + callSignatures = concatenate(callSignatures, getSignaturesOfType( + instantiatedBaseType, + 0 + /* Call */ + )); + constructSignatures = concatenate(constructSignatures, getSignaturesOfType( + instantiatedBaseType, + 1 + /* Construct */ + )); + const inheritedIndexInfos = instantiatedBaseType !== anyType2 ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + )]; + indexInfos = concatenate(indexInfos, filter2(inheritedIndexInfos, (info2) => !findIndexInfo(indexInfos, info2.keyType))); + } + } + setStructuredTypeMembers(type3, members, callSignatures, constructSignatures, indexInfos); + } + function resolveClassOrInterfaceMembers(type3) { + resolveObjectTypeMembers(type3, resolveDeclaredMembers(type3), emptyArray, emptyArray); + } + function resolveTypeReferenceMembers(type3) { + const source = resolveDeclaredMembers(type3.target); + const typeParameters = concatenate(source.typeParameters, [source.thisType]); + const typeArguments = getTypeArguments(type3); + const paddedTypeArguments = typeArguments.length === typeParameters.length ? typeArguments : concatenate(typeArguments, [type3]); + resolveObjectTypeMembers(type3, source, typeParameters, paddedTypeArguments); + } + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) { + const sig = new Signature14(checker, flags); + sig.declaration = declaration; + sig.typeParameters = typeParameters; + sig.parameters = parameters; + sig.thisParameter = thisParameter; + sig.resolvedReturnType = resolvedReturnType; + sig.resolvedTypePredicate = resolvedTypePredicate; + sig.minArgumentCount = minArgumentCount; + sig.resolvedMinArgumentCount = void 0; + sig.target = void 0; + sig.mapper = void 0; + sig.compositeSignatures = void 0; + sig.compositeKind = void 0; + return sig; + } + function cloneSignature(sig) { + const result2 = createSignature( + sig.declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags & 167 + /* PropagatingFlags */ + ); + result2.target = sig.target; + result2.mapper = sig.mapper; + result2.compositeSignatures = sig.compositeSignatures; + result2.compositeKind = sig.compositeKind; + return result2; + } + function createUnionSignature(signature, unionSignatures) { + const result2 = cloneSignature(signature); + result2.compositeSignatures = unionSignatures; + result2.compositeKind = 1048576; + result2.target = void 0; + result2.mapper = void 0; + return result2; + } + function getOptionalCallSignature(signature, callChainFlags) { + if ((signature.flags & 24) === callChainFlags) { + return signature; + } + if (!signature.optionalCallSignatureCache) { + signature.optionalCallSignatureCache = {}; + } + const key = callChainFlags === 8 ? "inner" : "outer"; + return signature.optionalCallSignatureCache[key] || (signature.optionalCallSignatureCache[key] = createOptionalCallSignature(signature, callChainFlags)); + } + function createOptionalCallSignature(signature, callChainFlags) { + Debug.assert(callChainFlags === 8 || callChainFlags === 16, "An optional call signature can either be for an inner call chain or an outer call chain, but not both."); + const result2 = cloneSignature(signature); + result2.flags |= callChainFlags; + return result2; + } + function getExpandedParameters(sig, skipUnionExpanding) { + if (signatureHasRestParameter(sig)) { + const restIndex = sig.parameters.length - 1; + const restName = sig.parameters[restIndex].escapedName; + const restType = getTypeOfSymbol(sig.parameters[restIndex]); + if (isTupleType(restType)) { + return [expandSignatureParametersWithTupleMembers(restType, restIndex, restName)]; + } else if (!skipUnionExpanding && restType.flags & 1048576 && every2(restType.types, isTupleType)) { + return map4(restType.types, (t8) => expandSignatureParametersWithTupleMembers(t8, restIndex, restName)); + } + } + return [sig.parameters]; + function expandSignatureParametersWithTupleMembers(restType, restIndex, restName) { + const elementTypes = getTypeArguments(restType); + const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restName); + const restParams = map4(elementTypes, (t8, i7) => { + const name2 = associatedNames && associatedNames[i7] ? associatedNames[i7] : getParameterNameAtPosition(sig, restIndex + i7, restType); + const flags = restType.target.elementFlags[i7]; + const checkFlags = flags & 12 ? 32768 : flags & 2 ? 16384 : 0; + const symbol = createSymbol(1, name2, checkFlags); + symbol.links.type = flags & 4 ? createArrayType(t8) : t8; + return symbol; + }); + return concatenate(sig.parameters.slice(0, restIndex), restParams); + } + function getUniqAssociatedNamesFromTupleType(type3, restName) { + const associatedNamesMap = /* @__PURE__ */ new Map(); + return map4(type3.target.labeledElementDeclarations, (labeledElement, i7) => { + const name2 = getTupleElementLabel(labeledElement, i7, restName); + const prevCounter = associatedNamesMap.get(name2); + if (prevCounter === void 0) { + associatedNamesMap.set(name2, 1); + return name2; + } else { + associatedNamesMap.set(name2, prevCounter + 1); + return `${name2}_${prevCounter}`; + } + }); + } + } + function getDefaultConstructSignatures(classType) { + const baseConstructorType = getBaseConstructorTypeOfClass(classType); + const baseSignatures = getSignaturesOfType( + baseConstructorType, + 1 + /* Construct */ + ); + const declaration = getClassLikeDeclarationOfSymbol(classType.symbol); + const isAbstract = !!declaration && hasSyntacticModifier( + declaration, + 64 + /* Abstract */ + ); + if (baseSignatures.length === 0) { + return [createSignature( + /*declaration*/ + void 0, + classType.localTypeParameters, + /*thisParameter*/ + void 0, + emptyArray, + classType, + /*resolvedTypePredicate*/ + void 0, + 0, + isAbstract ? 4 : 0 + /* None */ + )]; + } + const baseTypeNode = getBaseTypeNodeOfClass(classType); + const isJavaScript = isInJSFile(baseTypeNode); + const typeArguments = typeArgumentsFromTypeReferenceNode(baseTypeNode); + const typeArgCount = length(typeArguments); + const result2 = []; + for (const baseSig of baseSignatures) { + const minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); + const typeParamCount = length(baseSig.typeParameters); + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { + const sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); + sig.typeParameters = classType.localTypeParameters; + sig.resolvedReturnType = classType; + sig.flags = isAbstract ? sig.flags | 4 : sig.flags & ~4; + result2.push(sig); + } + } + return result2; + } + function findMatchingSignature(signatureList, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes) { + for (const s7 of signatureList) { + if (compareSignaturesIdentical(s7, signature, partialMatch, ignoreThisTypes, ignoreReturnTypes, partialMatch ? compareTypesSubtypeOf : compareTypesIdentical)) { + return s7; + } + } + } + function findMatchingSignatures(signatureLists, signature, listIndex) { + if (signature.typeParameters) { + if (listIndex > 0) { + return void 0; + } + for (let i7 = 1; i7 < signatureLists.length; i7++) { + if (!findMatchingSignature( + signatureLists[i7], + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false + )) { + return void 0; + } + } + return [signature]; + } + let result2; + for (let i7 = 0; i7 < signatureLists.length; i7++) { + const match = i7 === listIndex ? signature : findMatchingSignature( + signatureLists[i7], + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true + ) || findMatchingSignature( + signatureLists[i7], + signature, + /*partialMatch*/ + true, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true + ); + if (!match) { + return void 0; + } + result2 = appendIfUnique(result2, match); + } + return result2; + } + function getUnionSignatures(signatureLists) { + let result2; + let indexWithLengthOverOne; + for (let i7 = 0; i7 < signatureLists.length; i7++) { + if (signatureLists[i7].length === 0) + return emptyArray; + if (signatureLists[i7].length > 1) { + indexWithLengthOverOne = indexWithLengthOverOne === void 0 ? i7 : -1; + } + for (const signature of signatureLists[i7]) { + if (!result2 || !findMatchingSignature( + result2, + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + true + )) { + const unionSignatures = findMatchingSignatures(signatureLists, signature, i7); + if (unionSignatures) { + let s7 = signature; + if (unionSignatures.length > 1) { + let thisParameter = signature.thisParameter; + const firstThisParameterOfUnionSignatures = forEach4(unionSignatures, (sig) => sig.thisParameter); + if (firstThisParameterOfUnionSignatures) { + const thisType = getIntersectionType(mapDefined(unionSignatures, (sig) => sig.thisParameter && getTypeOfSymbol(sig.thisParameter))); + thisParameter = createSymbolWithType(firstThisParameterOfUnionSignatures, thisType); + } + s7 = createUnionSignature(signature, unionSignatures); + s7.thisParameter = thisParameter; + } + (result2 || (result2 = [])).push(s7); + } + } + } + } + if (!length(result2) && indexWithLengthOverOne !== -1) { + const masterList = signatureLists[indexWithLengthOverOne !== void 0 ? indexWithLengthOverOne : 0]; + let results = masterList.slice(); + for (const signatures of signatureLists) { + if (signatures !== masterList) { + const signature = signatures[0]; + Debug.assert(!!signature, "getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"); + results = !!signature.typeParameters && some2(results, (s7) => !!s7.typeParameters && !compareTypeParametersIdentical(signature.typeParameters, s7.typeParameters)) ? void 0 : map4(results, (sig) => combineSignaturesOfUnionMembers(sig, signature)); + if (!results) { + break; + } + } + } + result2 = results; + } + return result2 || emptyArray; + } + function compareTypeParametersIdentical(sourceParams, targetParams) { + if (length(sourceParams) !== length(targetParams)) { + return false; + } + if (!sourceParams || !targetParams) { + return true; + } + const mapper = createTypeMapper(targetParams, sourceParams); + for (let i7 = 0; i7 < sourceParams.length; i7++) { + const source = sourceParams[i7]; + const target = targetParams[i7]; + if (source === target) + continue; + if (!isTypeIdenticalTo(getConstraintFromTypeParameter(source) || unknownType2, instantiateType(getConstraintFromTypeParameter(target) || unknownType2, mapper))) + return false; + } + return true; + } + function combineUnionThisParam(left, right, mapper) { + if (!left || !right) { + return left || right; + } + const thisType = getIntersectionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); + return createSymbolWithType(left, thisType); + } + function combineUnionParameters(left, right, mapper) { + const leftCount = getParameterCount(left); + const rightCount = getParameterCount(right); + const longest = leftCount >= rightCount ? left : right; + const shorter = longest === left ? right : left; + const longestCount = longest === left ? leftCount : rightCount; + const eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); + const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + const params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (let i7 = 0; i7 < longestCount; i7++) { + let longestParamType = tryGetTypeAtPosition(longest, i7); + if (longest === right) { + longestParamType = instantiateType(longestParamType, mapper); + } + let shorterParamType = tryGetTypeAtPosition(shorter, i7) || unknownType2; + if (shorter === right) { + shorterParamType = instantiateType(shorterParamType, mapper); + } + const unionParamType = getIntersectionType([longestParamType, shorterParamType]); + const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i7 === longestCount - 1; + const isOptional2 = i7 >= getMinArgumentCount(longest) && i7 >= getMinArgumentCount(shorter); + const leftName = i7 >= leftCount ? void 0 : getParameterNameAtPosition(left, i7); + const rightName = i7 >= rightCount ? void 0 : getParameterNameAtPosition(right, i7); + const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; + const paramSymbol = createSymbol( + 1 | (isOptional2 && !isRestParam ? 16777216 : 0), + paramName || `arg${i7}`, + isRestParam ? 32768 : isOptional2 ? 16384 : 0 + ); + paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i7] = paramSymbol; + } + if (needsExtraRestElement) { + const restParamSymbol = createSymbol( + 1, + "args", + 32768 + /* RestParameter */ + ); + restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + if (shorter === right) { + restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper); + } + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfUnionMembers(left, right) { + const typeParams = left.typeParameters || right.typeParameters; + let paramMapper; + if (left.typeParameters && right.typeParameters) { + paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); + } + const declaration = left.declaration; + const params = combineUnionParameters(left, right, paramMapper); + const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper); + const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + const result2 = createSignature( + declaration, + typeParams, + thisParam, + params, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgCount, + (left.flags | right.flags) & 167 + /* PropagatingFlags */ + ); + result2.compositeKind = 1048576; + result2.compositeSignatures = concatenate(left.compositeKind !== 2097152 && left.compositeSignatures || [left], [right]); + if (paramMapper) { + result2.mapper = left.compositeKind !== 2097152 && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper; + } else if (left.compositeKind !== 2097152 && left.mapper && left.compositeSignatures) { + result2.mapper = left.mapper; + } + return result2; + } + function getUnionIndexInfos(types3) { + const sourceInfos = getIndexInfosOfType(types3[0]); + if (sourceInfos) { + const result2 = []; + for (const info2 of sourceInfos) { + const indexType = info2.keyType; + if (every2(types3, (t8) => !!getIndexInfoOfType(t8, indexType))) { + result2.push(createIndexInfo(indexType, getUnionType(map4(types3, (t8) => getIndexTypeOfType(t8, indexType))), some2(types3, (t8) => getIndexInfoOfType(t8, indexType).isReadonly))); + } + } + return result2; + } + return emptyArray; + } + function resolveUnionTypeMembers(type3) { + const callSignatures = getUnionSignatures(map4(type3.types, (t8) => t8 === globalFunctionType ? [unknownSignature] : getSignaturesOfType( + t8, + 0 + /* Call */ + ))); + const constructSignatures = getUnionSignatures(map4(type3.types, (t8) => getSignaturesOfType( + t8, + 1 + /* Construct */ + ))); + const indexInfos = getUnionIndexInfos(type3.types); + setStructuredTypeMembers(type3, emptySymbols, callSignatures, constructSignatures, indexInfos); + } + function intersectTypes(type1, type22) { + return !type1 ? type22 : !type22 ? type1 : getIntersectionType([type1, type22]); + } + function findMixins(types3) { + const constructorTypeCount = countWhere(types3, (t8) => getSignaturesOfType( + t8, + 1 + /* Construct */ + ).length > 0); + const mixinFlags = map4(types3, isMixinConstructorType); + if (constructorTypeCount > 0 && constructorTypeCount === countWhere(mixinFlags, (b8) => b8)) { + const firstMixinIndex = mixinFlags.indexOf( + /*searchElement*/ + true + ); + mixinFlags[firstMixinIndex] = false; + } + return mixinFlags; + } + function includeMixinType(type3, types3, mixinFlags, index4) { + const mixedTypes = []; + for (let i7 = 0; i7 < types3.length; i7++) { + if (i7 === index4) { + mixedTypes.push(type3); + } else if (mixinFlags[i7]) { + mixedTypes.push(getReturnTypeOfSignature(getSignaturesOfType( + types3[i7], + 1 + /* Construct */ + )[0])); + } + } + return getIntersectionType(mixedTypes); + } + function resolveIntersectionTypeMembers(type3) { + let callSignatures; + let constructSignatures; + let indexInfos; + const types3 = type3.types; + const mixinFlags = findMixins(types3); + const mixinCount = countWhere(mixinFlags, (b8) => b8); + for (let i7 = 0; i7 < types3.length; i7++) { + const t8 = type3.types[i7]; + if (!mixinFlags[i7]) { + let signatures = getSignaturesOfType( + t8, + 1 + /* Construct */ + ); + if (signatures.length && mixinCount > 0) { + signatures = map4(signatures, (s7) => { + const clone22 = cloneSignature(s7); + clone22.resolvedReturnType = includeMixinType(getReturnTypeOfSignature(s7), types3, mixinFlags, i7); + return clone22; + }); + } + constructSignatures = appendSignatures(constructSignatures, signatures); + } + callSignatures = appendSignatures(callSignatures, getSignaturesOfType( + t8, + 0 + /* Call */ + )); + indexInfos = reduceLeft(getIndexInfosOfType(t8), (infos, newInfo) => appendIndexInfo( + infos, + newInfo, + /*union*/ + false + ), indexInfos); + } + setStructuredTypeMembers(type3, emptySymbols, callSignatures || emptyArray, constructSignatures || emptyArray, indexInfos || emptyArray); + } + function appendSignatures(signatures, newSignatures) { + for (const sig of newSignatures) { + if (!signatures || every2(signatures, (s7) => !compareSignaturesIdentical( + s7, + sig, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false, + compareTypesIdentical + ))) { + signatures = append(signatures, sig); + } + } + return signatures; + } + function appendIndexInfo(indexInfos, newInfo, union2) { + if (indexInfos) { + for (let i7 = 0; i7 < indexInfos.length; i7++) { + const info2 = indexInfos[i7]; + if (info2.keyType === newInfo.keyType) { + indexInfos[i7] = createIndexInfo(info2.keyType, union2 ? getUnionType([info2.type, newInfo.type]) : getIntersectionType([info2.type, newInfo.type]), union2 ? info2.isReadonly || newInfo.isReadonly : info2.isReadonly && newInfo.isReadonly); + return indexInfos; + } + } + } + return append(indexInfos, newInfo); + } + function resolveAnonymousTypeMembers(type3) { + if (type3.target) { + setStructuredTypeMembers(type3, emptySymbols, emptyArray, emptyArray, emptyArray); + const members2 = createInstantiatedSymbolTable( + getPropertiesOfObjectType(type3.target), + type3.mapper, + /*mappingThisOnly*/ + false + ); + const callSignatures = instantiateSignatures(getSignaturesOfType( + type3.target, + 0 + /* Call */ + ), type3.mapper); + const constructSignatures = instantiateSignatures(getSignaturesOfType( + type3.target, + 1 + /* Construct */ + ), type3.mapper); + const indexInfos2 = instantiateIndexInfos(getIndexInfosOfType(type3.target), type3.mapper); + setStructuredTypeMembers(type3, members2, callSignatures, constructSignatures, indexInfos2); + return; + } + const symbol = getMergedSymbol(type3.symbol); + if (symbol.flags & 2048) { + setStructuredTypeMembers(type3, emptySymbols, emptyArray, emptyArray, emptyArray); + const members2 = getMembersOfSymbol(symbol); + const callSignatures = getSignaturesOfSymbol(members2.get( + "__call" + /* Call */ + )); + const constructSignatures = getSignaturesOfSymbol(members2.get( + "__new" + /* New */ + )); + const indexInfos2 = getIndexInfosOfSymbol(symbol); + setStructuredTypeMembers(type3, members2, callSignatures, constructSignatures, indexInfos2); + return; + } + let members = getExportsOfSymbol(symbol); + let indexInfos; + if (symbol === globalThisSymbol) { + const varsOnly = /* @__PURE__ */ new Map(); + members.forEach((p7) => { + var _a2; + if (!(p7.flags & 418) && !(p7.flags & 512 && ((_a2 = p7.declarations) == null ? void 0 : _a2.length) && every2(p7.declarations, isAmbientModule))) { + varsOnly.set(p7.escapedName, p7); + } + }); + members = varsOnly; + } + let baseConstructorIndexInfo; + setStructuredTypeMembers(type3, members, emptyArray, emptyArray, emptyArray); + if (symbol.flags & 32) { + const classType = getDeclaredTypeOfClassOrInterface(symbol); + const baseConstructorType = getBaseConstructorTypeOfClass(classType); + if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) { + members = createSymbolTable(getNamedOrIndexSignatureMembers(members)); + addInheritedMembers(members, getPropertiesOfType(baseConstructorType)); + } else if (baseConstructorType === anyType2) { + baseConstructorIndexInfo = createIndexInfo( + stringType2, + anyType2, + /*isReadonly*/ + false + ); + } + } + const indexSymbol = getIndexSymbolFromSymbolTable(members); + if (indexSymbol) { + indexInfos = getIndexInfosOfIndexSymbol(indexSymbol); + } else { + if (baseConstructorIndexInfo) { + indexInfos = append(indexInfos, baseConstructorIndexInfo); + } + if (symbol.flags & 384 && (getDeclaredTypeOfSymbol(symbol).flags & 32 || some2(type3.properties, (prop) => !!(getTypeOfSymbol(prop).flags & 296)))) { + indexInfos = append(indexInfos, enumNumberIndexInfo); + } + } + setStructuredTypeMembers(type3, members, emptyArray, emptyArray, indexInfos || emptyArray); + if (symbol.flags & (16 | 8192)) { + type3.callSignatures = getSignaturesOfSymbol(symbol); + } + if (symbol.flags & 32) { + const classType = getDeclaredTypeOfClassOrInterface(symbol); + let constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get( + "__constructor" + /* Constructor */ + )) : emptyArray; + if (symbol.flags & 16) { + constructSignatures = addRange( + constructSignatures.slice(), + mapDefined( + type3.callSignatures, + (sig) => isJSConstructor(sig.declaration) ? createSignature( + sig.declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + classType, + /*resolvedTypePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags & 167 + /* PropagatingFlags */ + ) : void 0 + ) + ); + } + if (!constructSignatures.length) { + constructSignatures = getDefaultConstructSignatures(classType); + } + type3.constructSignatures = constructSignatures; + } + } + function replaceIndexedAccess(instantiable, type3, replacement) { + return instantiateType(instantiable, createTypeMapper([type3.indexType, type3.objectType], [getNumberLiteralType(0), createTupleType([replacement])])); + } + function getLimitedConstraint(type3) { + const constraint = getConstraintTypeFromMappedType(type3.mappedType); + if (!(constraint.flags & 1048576 || constraint.flags & 2097152)) { + return; + } + const origin = constraint.flags & 1048576 ? constraint.origin : constraint; + if (!origin || !(origin.flags & 2097152)) { + return; + } + const limitedConstraint = getIntersectionType(origin.types.filter((t8) => t8 !== type3.constraintType)); + return limitedConstraint !== neverType2 ? limitedConstraint : void 0; + } + function resolveReverseMappedTypeMembers(type3) { + const indexInfo = getIndexInfoOfType(type3.source, stringType2); + const modifiers = getMappedTypeModifiers(type3.mappedType); + const readonlyMask = modifiers & 1 ? false : true; + const optionalMask = modifiers & 4 ? 0 : 16777216; + const indexInfos = indexInfo ? [createIndexInfo(stringType2, inferReverseMappedType(indexInfo.type, type3.mappedType, type3.constraintType), readonlyMask && indexInfo.isReadonly)] : emptyArray; + const members = createSymbolTable(); + const limitedConstraint = getLimitedConstraint(type3); + for (const prop of getPropertiesOfType(type3.source)) { + if (limitedConstraint) { + const propertyNameType = getLiteralTypeFromProperty( + prop, + 8576 + /* StringOrNumberLiteralOrUnique */ + ); + if (!isTypeAssignableTo(propertyNameType, limitedConstraint)) { + continue; + } + } + const checkFlags = 8192 | (readonlyMask && isReadonlySymbol(prop) ? 8 : 0); + const inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.links.nameType = getSymbolLinks(prop).nameType; + inferredProp.links.propertyType = getTypeOfSymbol(prop); + if (type3.constraintType.type.flags & 8388608 && type3.constraintType.type.objectType.flags & 262144 && type3.constraintType.type.indexType.flags & 262144) { + const newTypeParam = type3.constraintType.type.objectType; + const newMappedType = replaceIndexedAccess(type3.mappedType, type3.constraintType.type, newTypeParam); + inferredProp.links.mappedType = newMappedType; + inferredProp.links.constraintType = getIndexType(newTypeParam); + } else { + inferredProp.links.mappedType = type3.mappedType; + inferredProp.links.constraintType = type3.constraintType; + } + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type3, members, emptyArray, emptyArray, indexInfos); + } + function getLowerBoundOfKeyType(type3) { + if (type3.flags & 4194304) { + const t8 = getApparentType(type3.type); + return isGenericTupleType(t8) ? getKnownKeysOfTupleType(t8) : getIndexType(t8); + } + if (type3.flags & 16777216) { + if (type3.root.isDistributive) { + const checkType = type3.checkType; + const constraint = getLowerBoundOfKeyType(checkType); + if (constraint !== checkType) { + return getConditionalTypeInstantiation( + type3, + prependTypeMapping(type3.root.checkType, constraint, type3.mapper), + /*forConstraint*/ + false + ); + } + } + return type3; + } + if (type3.flags & 1048576) { + return mapType2( + type3, + getLowerBoundOfKeyType, + /*noReductions*/ + true + ); + } + if (type3.flags & 2097152) { + const types3 = type3.types; + if (types3.length === 2 && !!(types3[0].flags & (4 | 8 | 64)) && types3[1] === emptyTypeLiteralType) { + return type3; + } + return getIntersectionType(sameMap(type3.types, getLowerBoundOfKeyType)); + } + return type3; + } + function getIsLateCheckFlag(s7) { + return getCheckFlags(s7) & 4096; + } + function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type3, include, stringsOnly, cb) { + for (const prop of getPropertiesOfType(type3)) { + cb(getLiteralTypeFromProperty(prop, include)); + } + if (type3.flags & 1) { + cb(stringType2); + } else { + for (const info2 of getIndexInfosOfType(type3)) { + if (!stringsOnly || info2.keyType.flags & (4 | 134217728)) { + cb(info2.keyType); + } + } + } + } + function resolveMappedTypeMembers(type3) { + const members = createSymbolTable(); + let indexInfos; + setStructuredTypeMembers(type3, emptySymbols, emptyArray, emptyArray, emptyArray); + const typeParameter = getTypeParameterFromMappedType(type3); + const constraintType = getConstraintTypeFromMappedType(type3); + const mappedType = type3.target || type3; + const nameType = getNameTypeFromMappedType(mappedType); + const shouldLinkPropDeclarations = getMappedTypeNameTypeKind(mappedType) !== 2; + const templateType = getTemplateTypeFromMappedType(mappedType); + const modifiersType = getApparentType(getModifiersTypeFromMappedType(type3)); + const templateModifiers = getMappedTypeModifiers(type3); + const include = keyofStringsOnly ? 128 : 8576; + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType); + } else { + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); + } + setStructuredTypeMembers(type3, members, emptyArray, emptyArray, indexInfos || emptyArray); + function addMemberForKeyType(keyType) { + const propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type3.mapper, typeParameter, keyType)) : keyType; + forEachType(propNameType, (t8) => addMemberForKeyTypeWorker(keyType, t8)); + } + function addMemberForKeyTypeWorker(keyType, propNameType) { + if (isTypeUsableAsPropertyName(propNameType)) { + const propName2 = getPropertyNameFromType(propNameType); + const existingProp = members.get(propName2); + if (existingProp) { + existingProp.links.nameType = getUnionType([existingProp.links.nameType, propNameType]); + existingProp.links.keyType = getUnionType([existingProp.links.keyType, keyType]); + } else { + const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0; + const isOptional2 = !!(templateModifiers & 4 || !(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216); + const isReadonly = !!(templateModifiers & 1 || !(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp)); + const stripOptional = strictNullChecks && !isOptional2 && modifiersProp && modifiersProp.flags & 16777216; + const lateFlag = modifiersProp ? getIsLateCheckFlag(modifiersProp) : 0; + const prop = createSymbol(4 | (isOptional2 ? 16777216 : 0), propName2, lateFlag | 262144 | (isReadonly ? 8 : 0) | (stripOptional ? 524288 : 0)); + prop.links.mappedType = type3; + prop.links.nameType = propNameType; + prop.links.keyType = keyType; + if (modifiersProp) { + prop.links.syntheticOrigin = modifiersProp; + prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0; + } + members.set(propName2, prop); + } + } else if (isValidIndexKeyType(propNameType) || propNameType.flags & (1 | 32)) { + const indexKeyType = propNameType.flags & (1 | 4) ? stringType2 : propNameType.flags & (8 | 32) ? numberType2 : propNameType; + const propType = instantiateType(templateType, appendTypeMapping(type3.mapper, typeParameter, keyType)); + const modifiersIndexInfo = getApplicableIndexInfo(modifiersType, propNameType); + const isReadonly = !!(templateModifiers & 1 || !(templateModifiers & 2) && (modifiersIndexInfo == null ? void 0 : modifiersIndexInfo.isReadonly)); + const indexInfo = createIndexInfo(indexKeyType, propType, isReadonly); + indexInfos = appendIndexInfo( + indexInfos, + indexInfo, + /*union*/ + true + ); + } + } + } + function getTypeOfMappedSymbol(symbol) { + if (!symbol.links.type) { + const mappedType = symbol.links.mappedType; + if (!pushTypeResolution( + symbol, + 0 + /* Type */ + )) { + mappedType.containsError = true; + return errorType; + } + const templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType); + const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.links.keyType); + const propType = instantiateType(templateType, mapper); + let type3 = strictNullChecks && symbol.flags & 16777216 && !maybeTypeOfKind( + propType, + 32768 | 16384 + /* Void */ + ) ? getOptionalType( + propType, + /*isProperty*/ + true + ) : symbol.links.checkFlags & 524288 ? removeMissingOrUndefinedType(propType) : propType; + if (!popTypeResolution()) { + error22(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString2(symbol), typeToString(mappedType)); + type3 = errorType; + } + symbol.links.type = type3; + } + return symbol.links.type; + } + function getTypeParameterFromMappedType(type3) { + return type3.typeParameter || (type3.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type3.declaration.typeParameter))); + } + function getConstraintTypeFromMappedType(type3) { + return type3.constraintType || (type3.constraintType = getConstraintOfTypeParameter(getTypeParameterFromMappedType(type3)) || errorType); + } + function getNameTypeFromMappedType(type3) { + return type3.declaration.nameType ? type3.nameType || (type3.nameType = instantiateType(getTypeFromTypeNode(type3.declaration.nameType), type3.mapper)) : void 0; + } + function getTemplateTypeFromMappedType(type3) { + return type3.templateType || (type3.templateType = type3.declaration.type ? instantiateType(addOptionality( + getTypeFromTypeNode(type3.declaration.type), + /*isProperty*/ + true, + !!(getMappedTypeModifiers(type3) & 4) + ), type3.mapper) : errorType); + } + function getConstraintDeclarationForMappedType(type3) { + return getEffectiveConstraintOfTypeParameter(type3.declaration.typeParameter); + } + function isMappedTypeWithKeyofConstraintDeclaration(type3) { + const constraintDeclaration = getConstraintDeclarationForMappedType(type3); + return constraintDeclaration.kind === 198 && constraintDeclaration.operator === 143; + } + function getModifiersTypeFromMappedType(type3) { + if (!type3.modifiersType) { + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + type3.modifiersType = instantiateType(getTypeFromTypeNode(getConstraintDeclarationForMappedType(type3).type), type3.mapper); + } else { + const declaredType = getTypeFromMappedTypeNode(type3.declaration); + const constraint = getConstraintTypeFromMappedType(declaredType); + const extendedConstraint = constraint && constraint.flags & 262144 ? getConstraintOfTypeParameter(constraint) : constraint; + type3.modifiersType = extendedConstraint && extendedConstraint.flags & 4194304 ? instantiateType(extendedConstraint.type, type3.mapper) : unknownType2; + } + } + return type3.modifiersType; + } + function getMappedTypeModifiers(type3) { + const declaration = type3.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 41 ? 2 : 1 : 0) | (declaration.questionToken ? declaration.questionToken.kind === 41 ? 8 : 4 : 0); + } + function getMappedTypeOptionality(type3) { + const modifiers = getMappedTypeModifiers(type3); + return modifiers & 8 ? -1 : modifiers & 4 ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type3) { + const optionality = getMappedTypeOptionality(type3); + const modifiersType = getModifiersTypeFromMappedType(type3); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); + } + function isPartialMappedType(type3) { + return !!(getObjectFlags(type3) & 32 && getMappedTypeModifiers(type3) & 4); + } + function isGenericMappedType(type3) { + if (getObjectFlags(type3) & 32) { + const constraint = getConstraintTypeFromMappedType(type3); + if (isGenericIndexType(constraint)) { + return true; + } + const nameType = getNameTypeFromMappedType(type3); + if (nameType && isGenericIndexType(instantiateType(nameType, makeUnaryTypeMapper(getTypeParameterFromMappedType(type3), constraint)))) { + return true; + } + } + return false; + } + function getMappedTypeNameTypeKind(type3) { + const nameType = getNameTypeFromMappedType(type3); + if (!nameType) { + return 0; + } + return isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type3)) ? 1 : 2; + } + function resolveStructuredTypeMembers(type3) { + if (!type3.members) { + if (type3.flags & 524288) { + if (type3.objectFlags & 4) { + resolveTypeReferenceMembers(type3); + } else if (type3.objectFlags & 3) { + resolveClassOrInterfaceMembers(type3); + } else if (type3.objectFlags & 1024) { + resolveReverseMappedTypeMembers(type3); + } else if (type3.objectFlags & 16) { + resolveAnonymousTypeMembers(type3); + } else if (type3.objectFlags & 32) { + resolveMappedTypeMembers(type3); + } else { + Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type3.objectFlags)); + } + } else if (type3.flags & 1048576) { + resolveUnionTypeMembers(type3); + } else if (type3.flags & 2097152) { + resolveIntersectionTypeMembers(type3); + } else { + Debug.fail("Unhandled type " + Debug.formatTypeFlags(type3.flags)); + } + } + return type3; + } + function getPropertiesOfObjectType(type3) { + if (type3.flags & 524288) { + return resolveStructuredTypeMembers(type3).properties; + } + return emptyArray; + } + function getPropertyOfObjectType(type3, name2) { + if (type3.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type3); + const symbol = resolved.members.get(name2); + if (symbol && symbolIsValue(symbol)) { + return symbol; + } + } + } + function getPropertiesOfUnionOrIntersectionType(type3) { + if (!type3.resolvedProperties) { + const members = createSymbolTable(); + for (const current of type3.types) { + for (const prop of getPropertiesOfType(current)) { + if (!members.has(prop.escapedName)) { + const combinedProp = getPropertyOfUnionOrIntersectionType( + type3, + prop.escapedName, + /*skipObjectFunctionPropertyAugment*/ + !!(type3.flags & 2097152) + ); + if (combinedProp) { + members.set(prop.escapedName, combinedProp); + } + } + } + if (type3.flags & 1048576 && getIndexInfosOfType(current).length === 0) { + break; + } + } + type3.resolvedProperties = getNamedMembers(members); + } + return type3.resolvedProperties; + } + function getPropertiesOfType(type3) { + type3 = getReducedApparentType(type3); + return type3.flags & 3145728 ? getPropertiesOfUnionOrIntersectionType(type3) : getPropertiesOfObjectType(type3); + } + function forEachPropertyOfType(type3, action) { + type3 = getReducedApparentType(type3); + if (type3.flags & 3670016) { + resolveStructuredTypeMembers(type3).members.forEach((symbol, escapedName) => { + if (isNamedMember(symbol, escapedName)) { + action(symbol, escapedName); + } + }); + } + } + function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) { + const list = obj.properties; + return list.some((property2) => { + const nameType = property2.name && (isJsxNamespacedName(property2.name) ? getStringLiteralType(getTextOfJsxAttributeName(property2.name)) : getLiteralTypeFromPropertyName(property2.name)); + const name2 = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; + const expected = name2 === void 0 ? void 0 : getTypeOfPropertyOfType(contextualType, name2); + return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property2), expected); + }); + } + function getAllPossiblePropertiesOfTypes(types3) { + const unionType2 = getUnionType(types3); + if (!(unionType2.flags & 1048576)) { + return getAugmentedPropertiesOfType(unionType2); + } + const props = createSymbolTable(); + for (const memberType of types3) { + for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) { + if (!props.has(escapedName)) { + const prop = createUnionOrIntersectionProperty(unionType2, escapedName); + if (prop) + props.set(escapedName, prop); + } + } + } + return arrayFrom(props.values()); + } + function getConstraintOfType(type3) { + return type3.flags & 262144 ? getConstraintOfTypeParameter(type3) : type3.flags & 8388608 ? getConstraintOfIndexedAccess(type3) : type3.flags & 16777216 ? getConstraintOfConditionalType(type3) : getBaseConstraintOfType(type3); + } + function getConstraintOfTypeParameter(typeParameter) { + return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0; + } + function isConstMappedType(type3, depth) { + const typeVariable = getHomomorphicTypeVariable(type3); + return !!typeVariable && isConstTypeVariable(typeVariable, depth); + } + function isConstTypeVariable(type3, depth = 0) { + var _a2; + return depth < 5 && !!(type3 && (type3.flags & 262144 && some2((_a2 = type3.symbol) == null ? void 0 : _a2.declarations, (d7) => hasSyntacticModifier( + d7, + 4096 + /* Const */ + )) || type3.flags & 3145728 && some2(type3.types, (t8) => isConstTypeVariable(t8, depth)) || type3.flags & 8388608 && isConstTypeVariable(type3.objectType, depth + 1) || type3.flags & 16777216 && isConstTypeVariable(getConstraintOfConditionalType(type3), depth + 1) || type3.flags & 33554432 && isConstTypeVariable(type3.baseType, depth) || getObjectFlags(type3) & 32 && isConstMappedType(type3, depth) || isGenericTupleType(type3) && findIndex2(getElementTypes(type3), (t8, i7) => !!(type3.target.elementFlags[i7] & 8) && isConstTypeVariable(t8, depth)) >= 0)); + } + function getConstraintOfIndexedAccess(type3) { + return hasNonCircularBaseConstraint(type3) ? getConstraintFromIndexedAccess(type3) : void 0; + } + function getSimplifiedTypeOrConstraint(type3) { + const simplified = getSimplifiedType( + type3, + /*writing*/ + false + ); + return simplified !== type3 ? simplified : getConstraintOfType(type3); + } + function getConstraintFromIndexedAccess(type3) { + if (isMappedTypeGenericIndexedAccess(type3)) { + return substituteIndexedMappedType(type3.objectType, type3.indexType); + } + const indexConstraint = getSimplifiedTypeOrConstraint(type3.indexType); + if (indexConstraint && indexConstraint !== type3.indexType) { + const indexedAccess = getIndexedAccessTypeOrUndefined(type3.objectType, indexConstraint, type3.accessFlags); + if (indexedAccess) { + return indexedAccess; + } + } + const objectConstraint = getSimplifiedTypeOrConstraint(type3.objectType); + if (objectConstraint && objectConstraint !== type3.objectType) { + return getIndexedAccessTypeOrUndefined(objectConstraint, type3.indexType, type3.accessFlags); + } + return void 0; + } + function getDefaultConstraintOfConditionalType(type3) { + if (!type3.resolvedDefaultConstraint) { + const trueConstraint = getInferredTrueTypeFromConditionalType(type3); + const falseConstraint = getFalseTypeFromConditionalType(type3); + type3.resolvedDefaultConstraint = isTypeAny(trueConstraint) ? falseConstraint : isTypeAny(falseConstraint) ? trueConstraint : getUnionType([trueConstraint, falseConstraint]); + } + return type3.resolvedDefaultConstraint; + } + function getConstraintOfDistributiveConditionalType(type3) { + if (type3.resolvedConstraintOfDistributive !== void 0) { + return type3.resolvedConstraintOfDistributive || void 0; + } + if (type3.root.isDistributive && type3.restrictiveInstantiation !== type3) { + const simplified = getSimplifiedType( + type3.checkType, + /*writing*/ + false + ); + const constraint = simplified === type3.checkType ? getConstraintOfType(simplified) : simplified; + if (constraint && constraint !== type3.checkType) { + const instantiated = getConditionalTypeInstantiation( + type3, + prependTypeMapping(type3.root.checkType, constraint, type3.mapper), + /*forConstraint*/ + true + ); + if (!(instantiated.flags & 131072)) { + type3.resolvedConstraintOfDistributive = instantiated; + return instantiated; + } + } + } + type3.resolvedConstraintOfDistributive = false; + return void 0; + } + function getConstraintFromConditionalType(type3) { + return getConstraintOfDistributiveConditionalType(type3) || getDefaultConstraintOfConditionalType(type3); + } + function getConstraintOfConditionalType(type3) { + return hasNonCircularBaseConstraint(type3) ? getConstraintFromConditionalType(type3) : void 0; + } + function getEffectiveConstraintOfIntersection(types3, targetIsUnion) { + let constraints; + let hasDisjointDomainType = false; + for (const t8 of types3) { + if (t8.flags & 465829888) { + let constraint = getConstraintOfType(t8); + while (constraint && constraint.flags & (262144 | 4194304 | 16777216)) { + constraint = getConstraintOfType(constraint); + } + if (constraint) { + constraints = append(constraints, constraint); + if (targetIsUnion) { + constraints = append(constraints, t8); + } + } + } else if (t8.flags & 469892092 || isEmptyAnonymousObjectType(t8)) { + hasDisjointDomainType = true; + } + } + if (constraints && (targetIsUnion || hasDisjointDomainType)) { + if (hasDisjointDomainType) { + for (const t8 of types3) { + if (t8.flags & 469892092 || isEmptyAnonymousObjectType(t8)) { + constraints = append(constraints, t8); + } + } + } + return getNormalizedType( + getIntersectionType(constraints), + /*writing*/ + false + ); + } + return void 0; + } + function getBaseConstraintOfType(type3) { + if (type3.flags & (58982400 | 3145728 | 134217728 | 268435456) || isGenericTupleType(type3)) { + const constraint = getResolvedBaseConstraint(type3); + return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : void 0; + } + return type3.flags & 4194304 ? keyofConstraintType : void 0; + } + function getBaseConstraintOrType(type3) { + return getBaseConstraintOfType(type3) || type3; + } + function hasNonCircularBaseConstraint(type3) { + return getResolvedBaseConstraint(type3) !== circularConstraintType; + } + function getResolvedBaseConstraint(type3) { + if (type3.resolvedBaseConstraint) { + return type3.resolvedBaseConstraint; + } + const stack = []; + return type3.resolvedBaseConstraint = getImmediateBaseConstraint(type3); + function getImmediateBaseConstraint(t8) { + if (!t8.immediateBaseConstraint) { + if (!pushTypeResolution( + t8, + 4 + /* ImmediateBaseConstraint */ + )) { + return circularConstraintType; + } + let result2; + const identity22 = getRecursionIdentity(t8); + if (stack.length < 10 || stack.length < 50 && !contains2(stack, identity22)) { + stack.push(identity22); + result2 = computeBaseConstraint(getSimplifiedType( + t8, + /*writing*/ + false + )); + stack.pop(); + } + if (!popTypeResolution()) { + if (t8.flags & 262144) { + const errorNode = getConstraintDeclaration(t8); + if (errorNode) { + const diagnostic = error22(errorNode, Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(t8)); + if (currentNode && !isNodeDescendantOf(errorNode, currentNode) && !isNodeDescendantOf(currentNode, errorNode)) { + addRelatedInfo(diagnostic, createDiagnosticForNode(currentNode, Diagnostics.Circularity_originates_in_type_at_this_location)); + } + } + } + result2 = circularConstraintType; + } + t8.immediateBaseConstraint = result2 || noConstraintType; + } + return t8.immediateBaseConstraint; + } + function getBaseConstraint(t8) { + const c7 = getImmediateBaseConstraint(t8); + return c7 !== noConstraintType && c7 !== circularConstraintType ? c7 : void 0; + } + function computeBaseConstraint(t8) { + if (t8.flags & 262144) { + const constraint = getConstraintFromTypeParameter(t8); + return t8.isThisType || !constraint ? constraint : getBaseConstraint(constraint); + } + if (t8.flags & 3145728) { + const types3 = t8.types; + const baseTypes = []; + let different = false; + for (const type22 of types3) { + const baseType = getBaseConstraint(type22); + if (baseType) { + if (baseType !== type22) { + different = true; + } + baseTypes.push(baseType); + } else { + different = true; + } + } + if (!different) { + return t8; + } + return t8.flags & 1048576 && baseTypes.length === types3.length ? getUnionType(baseTypes) : t8.flags & 2097152 && baseTypes.length ? getIntersectionType(baseTypes) : void 0; + } + if (t8.flags & 4194304) { + return keyofConstraintType; + } + if (t8.flags & 134217728) { + const types3 = t8.types; + const constraints = mapDefined(types3, getBaseConstraint); + return constraints.length === types3.length ? getTemplateLiteralType(t8.texts, constraints) : stringType2; + } + if (t8.flags & 268435456) { + const constraint = getBaseConstraint(t8.type); + return constraint && constraint !== t8.type ? getStringMappingType(t8.symbol, constraint) : stringType2; + } + if (t8.flags & 8388608) { + if (isMappedTypeGenericIndexedAccess(t8)) { + return getBaseConstraint(substituteIndexedMappedType(t8.objectType, t8.indexType)); + } + const baseObjectType = getBaseConstraint(t8.objectType); + const baseIndexType = getBaseConstraint(t8.indexType); + const baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t8.accessFlags); + return baseIndexedAccess && getBaseConstraint(baseIndexedAccess); + } + if (t8.flags & 16777216) { + const constraint = getConstraintFromConditionalType(t8); + return constraint && getBaseConstraint(constraint); + } + if (t8.flags & 33554432) { + return getBaseConstraint(getSubstitutionIntersection(t8)); + } + if (isGenericTupleType(t8)) { + const newElements = map4(getElementTypes(t8), (v8, i7) => { + const constraint = v8.flags & 262144 && t8.target.elementFlags[i7] & 8 && getBaseConstraint(v8) || v8; + return constraint !== v8 && everyType(constraint, (c7) => isArrayOrTupleType(c7) && !isGenericTupleType(c7)) ? constraint : v8; + }); + return createTupleType(newElements, t8.target.elementFlags, t8.target.readonly, t8.target.labeledElementDeclarations); + } + return t8; + } + } + function getApparentTypeOfIntersectionType(type3, thisArgument) { + return type3.resolvedApparentType || (type3.resolvedApparentType = getTypeWithThisArgument( + type3, + thisArgument, + /*needApparentType*/ + true + )); + } + function getResolvedTypeParameterDefault(typeParameter) { + if (!typeParameter.default) { + if (typeParameter.target) { + const targetDefault = getResolvedTypeParameterDefault(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } else { + typeParameter.default = resolvingDefaultType; + const defaultDeclaration = typeParameter.symbol && forEach4(typeParameter.symbol.declarations, (decl) => isTypeParameterDeclaration(decl) && decl.default); + const defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + if (typeParameter.default === resolvingDefaultType) { + typeParameter.default = defaultType; + } + } + } else if (typeParameter.default === resolvingDefaultType) { + typeParameter.default = circularConstraintType; + } + return typeParameter.default; + } + function getDefaultFromTypeParameter(typeParameter) { + const defaultType = getResolvedTypeParameterDefault(typeParameter); + return defaultType !== noConstraintType && defaultType !== circularConstraintType ? defaultType : void 0; + } + function hasNonCircularTypeParameterDefault(typeParameter) { + return getResolvedTypeParameterDefault(typeParameter) !== circularConstraintType; + } + function hasTypeParameterDefault(typeParameter) { + return !!(typeParameter.symbol && forEach4(typeParameter.symbol.declarations, (decl) => isTypeParameterDeclaration(decl) && decl.default)); + } + function getApparentTypeOfMappedType(type3) { + return type3.resolvedApparentType || (type3.resolvedApparentType = getResolvedApparentTypeOfMappedType(type3)); + } + function getResolvedApparentTypeOfMappedType(type3) { + const target = type3.target ?? type3; + const typeVariable = getHomomorphicTypeVariable(target); + if (typeVariable && !target.declaration.nameType) { + const modifiersType = getModifiersTypeFromMappedType(type3); + const baseConstraint = isGenericMappedType(modifiersType) ? getApparentTypeOfMappedType(modifiersType) : getBaseConstraintOfType(modifiersType); + if (baseConstraint && everyType(baseConstraint, (t8) => isArrayOrTupleType(t8) || isArrayOrTupleOrIntersection(t8))) { + return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type3.mapper)); + } + } + return type3; + } + function isArrayOrTupleOrIntersection(type3) { + return !!(type3.flags & 2097152) && every2(type3.types, isArrayOrTupleType); + } + function isMappedTypeGenericIndexedAccess(type3) { + let objectType2; + return !!(type3.flags & 8388608 && getObjectFlags(objectType2 = type3.objectType) & 32 && !isGenericMappedType(objectType2) && isGenericIndexType(type3.indexType) && !(getMappedTypeModifiers(objectType2) & 8) && !objectType2.declaration.nameType); + } + function getApparentType(type3) { + const t8 = type3.flags & 465829888 ? getBaseConstraintOfType(type3) || unknownType2 : type3; + const objectFlags = getObjectFlags(t8); + return objectFlags & 32 ? getApparentTypeOfMappedType(t8) : objectFlags & 4 && t8 !== type3 ? getTypeWithThisArgument(t8, type3) : t8.flags & 2097152 ? getApparentTypeOfIntersectionType(t8, type3) : t8.flags & 402653316 ? globalStringType : t8.flags & 296 ? globalNumberType : t8.flags & 2112 ? getGlobalBigIntType() : t8.flags & 528 ? globalBooleanType : t8.flags & 12288 ? getGlobalESSymbolType() : t8.flags & 67108864 ? emptyObjectType : t8.flags & 4194304 ? keyofConstraintType : t8.flags & 2 && !strictNullChecks ? emptyObjectType : t8; + } + function getReducedApparentType(type3) { + return getReducedType(getApparentType(getReducedType(type3))); + } + function createUnionOrIntersectionProperty(containingType, name2, skipObjectFunctionPropertyAugment) { + var _a2, _b, _c; + let singleProp; + let propSet; + let indexTypes; + const isUnion = containingType.flags & 1048576; + let optionalFlag; + let syntheticFlag = 4; + let checkFlags = isUnion ? 0 : 8; + let mergedInstantiations = false; + for (const current of containingType.types) { + const type3 = getApparentType(current); + if (!(isErrorType(type3) || type3.flags & 131072)) { + const prop = getPropertyOfType(type3, name2, skipObjectFunctionPropertyAugment); + const modifiers = prop ? getDeclarationModifierFlagsFromSymbol(prop) : 0; + if (prop) { + if (prop.flags & 106500) { + optionalFlag ?? (optionalFlag = isUnion ? 0 : 16777216); + if (isUnion) { + optionalFlag |= prop.flags & 16777216; + } else { + optionalFlag &= prop.flags; + } + } + if (!singleProp) { + singleProp = prop; + } else if (prop !== singleProp) { + const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp); + if (isInstantiation && compareProperties2( + singleProp, + prop, + (a7, b8) => a7 === b8 ? -1 : 0 + /* False */ + ) === -1) { + mergedInstantiations = !!singleProp.parent && !!length(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(singleProp.parent)); + } else { + if (!propSet) { + propSet = /* @__PURE__ */ new Map(); + propSet.set(getSymbolId(singleProp), singleProp); + } + const id = getSymbolId(prop); + if (!propSet.has(id)) { + propSet.set(id, prop); + } + } + } + if (isUnion && isReadonlySymbol(prop)) { + checkFlags |= 8; + } else if (!isUnion && !isReadonlySymbol(prop)) { + checkFlags &= ~8; + } + checkFlags |= (!(modifiers & 6) ? 256 : 0) | (modifiers & 4 ? 512 : 0) | (modifiers & 2 ? 1024 : 0) | (modifiers & 256 ? 2048 : 0); + if (!isPrototypeProperty(prop)) { + syntheticFlag = 2; + } + } else if (isUnion) { + const indexInfo = !isLateBoundName(name2) && getApplicableIndexInfoForName(type3, name2); + if (indexInfo) { + checkFlags |= 32 | (indexInfo.isReadonly ? 8 : 0); + indexTypes = append(indexTypes, isTupleType(type3) ? getRestTypeOfTupleType(type3) || undefinedType2 : indexInfo.type); + } else if (isObjectLiteralType2(type3) && !(getObjectFlags(type3) & 2097152)) { + checkFlags |= 32; + indexTypes = append(indexTypes, undefinedType2); + } else { + checkFlags |= 16; + } + } + } + } + if (!singleProp || isUnion && (propSet || checkFlags & 48) && checkFlags & (1024 | 512) && !(propSet && getCommonDeclarationsOfSymbols(propSet.values()))) { + return void 0; + } + if (!propSet && !(checkFlags & 16) && !indexTypes) { + if (mergedInstantiations) { + const links = (_a2 = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a2.links; + const clone22 = createSymbolWithType(singleProp, links == null ? void 0 : links.type); + clone22.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent; + clone22.links.containingType = containingType; + clone22.links.mapper = links == null ? void 0 : links.mapper; + clone22.links.writeType = getWriteTypeOfSymbol(singleProp); + return clone22; + } else { + return singleProp; + } + } + const props = propSet ? arrayFrom(propSet.values()) : [singleProp]; + let declarations; + let firstType; + let nameType; + const propTypes = []; + let writeTypes; + let firstValueDeclaration; + let hasNonUniformValueDeclaration = false; + for (const prop of props) { + if (!firstValueDeclaration) { + firstValueDeclaration = prop.valueDeclaration; + } else if (prop.valueDeclaration && prop.valueDeclaration !== firstValueDeclaration) { + hasNonUniformValueDeclaration = true; + } + declarations = addRange(declarations, prop.declarations); + const type3 = getTypeOfSymbol(prop); + if (!firstType) { + firstType = type3; + nameType = getSymbolLinks(prop).nameType; + } + const writeType = getWriteTypeOfSymbol(prop); + if (writeTypes || writeType !== type3) { + writeTypes = append(!writeTypes ? propTypes.slice() : writeTypes, writeType); + } + if (type3 !== firstType) { + checkFlags |= 64; + } + if (isLiteralType(type3) || isPatternLiteralType(type3)) { + checkFlags |= 128; + } + if (type3.flags & 131072 && type3 !== uniqueLiteralType) { + checkFlags |= 131072; + } + propTypes.push(type3); + } + addRange(propTypes, indexTypes); + const result2 = createSymbol(4 | (optionalFlag ?? 0), name2, syntheticFlag | checkFlags); + result2.links.containingType = containingType; + if (!hasNonUniformValueDeclaration && firstValueDeclaration) { + result2.valueDeclaration = firstValueDeclaration; + if (firstValueDeclaration.symbol.parent) { + result2.parent = firstValueDeclaration.symbol.parent; + } + } + result2.declarations = declarations; + result2.links.nameType = nameType; + if (propTypes.length > 2) { + result2.links.checkFlags |= 65536; + result2.links.deferralParent = containingType; + result2.links.deferralConstituents = propTypes; + result2.links.deferralWriteConstituents = writeTypes; + } else { + result2.links.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes); + if (writeTypes) { + result2.links.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes); + } + } + return result2; + } + function getUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment) { + var _a2, _b, _c; + let property2 = skipObjectFunctionPropertyAugment ? (_a2 = type3.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? void 0 : _a2.get(name2) : (_b = type3.propertyCache) == null ? void 0 : _b.get(name2); + if (!property2) { + property2 = createUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment); + if (property2) { + const properties = skipObjectFunctionPropertyAugment ? type3.propertyCacheWithoutObjectFunctionPropertyAugment || (type3.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type3.propertyCache || (type3.propertyCache = createSymbolTable()); + properties.set(name2, property2); + if (skipObjectFunctionPropertyAugment && !(getCheckFlags(property2) & 48) && !((_c = type3.propertyCache) == null ? void 0 : _c.get(name2))) { + const properties2 = type3.propertyCache || (type3.propertyCache = createSymbolTable()); + properties2.set(name2, property2); + } + } + } + return property2; + } + function getCommonDeclarationsOfSymbols(symbols) { + let commonDeclarations; + for (const symbol of symbols) { + if (!symbol.declarations) { + return void 0; + } + if (!commonDeclarations) { + commonDeclarations = new Set(symbol.declarations); + continue; + } + commonDeclarations.forEach((declaration) => { + if (!contains2(symbol.declarations, declaration)) { + commonDeclarations.delete(declaration); + } + }); + if (commonDeclarations.size === 0) { + return void 0; + } + } + return commonDeclarations; + } + function getPropertyOfUnionOrIntersectionType(type3, name2, skipObjectFunctionPropertyAugment) { + const property2 = getUnionOrIntersectionProperty(type3, name2, skipObjectFunctionPropertyAugment); + return property2 && !(getCheckFlags(property2) & 16) ? property2 : void 0; + } + function getReducedType(type3) { + if (type3.flags & 1048576 && type3.objectFlags & 16777216) { + return type3.resolvedReducedType || (type3.resolvedReducedType = getReducedUnionType(type3)); + } else if (type3.flags & 2097152) { + if (!(type3.objectFlags & 16777216)) { + type3.objectFlags |= 16777216 | (some2(getPropertiesOfUnionOrIntersectionType(type3), isNeverReducedProperty) ? 33554432 : 0); + } + return type3.objectFlags & 33554432 ? neverType2 : type3; + } + return type3; + } + function getReducedUnionType(unionType2) { + const reducedTypes = sameMap(unionType2.types, getReducedType); + if (reducedTypes === unionType2.types) { + return unionType2; + } + const reduced = getUnionType(reducedTypes); + if (reduced.flags & 1048576) { + reduced.resolvedReducedType = reduced; + } + return reduced; + } + function isNeverReducedProperty(prop) { + return isDiscriminantWithNeverType(prop) || isConflictingPrivateProperty(prop); + } + function isDiscriminantWithNeverType(prop) { + return !(prop.flags & 16777216) && (getCheckFlags(prop) & (192 | 131072)) === 192 && !!(getTypeOfSymbol(prop).flags & 131072); + } + function isConflictingPrivateProperty(prop) { + return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024); + } + function isGenericReducibleType(type3) { + return !!(type3.flags & 1048576 && type3.objectFlags & 16777216 && some2(type3.types, isGenericReducibleType) || type3.flags & 2097152 && isReducibleIntersection(type3)); + } + function isReducibleIntersection(type3) { + const uniqueFilled = type3.uniqueLiteralFilledInstantiation || (type3.uniqueLiteralFilledInstantiation = instantiateType(type3, uniqueLiteralMapper)); + return getReducedType(uniqueFilled) !== uniqueFilled; + } + function elaborateNeverIntersection(errorInfo, type3) { + if (type3.flags & 2097152 && getObjectFlags(type3) & 33554432) { + const neverProp = find2(getPropertiesOfUnionOrIntersectionType(type3), isDiscriminantWithNeverType); + if (neverProp) { + return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 536870912 + /* NoTypeReduction */ + ), symbolToString2(neverProp)); + } + const privateProp = find2(getPropertiesOfUnionOrIntersectionType(type3), isConflictingPrivateProperty); + if (privateProp) { + return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some, typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 536870912 + /* NoTypeReduction */ + ), symbolToString2(privateProp)); + } + } + return errorInfo; + } + function getPropertyOfType(type3, name2, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) { + var _a2, _b; + type3 = getReducedApparentType(type3); + if (type3.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type3); + const symbol = resolved.members.get(name2); + if (symbol && !includeTypeOnlyMembers && ((_a2 = type3.symbol) == null ? void 0 : _a2.flags) & 512 && ((_b = getSymbolLinks(type3.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name2))) { + return void 0; + } + if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) { + return symbol; + } + if (skipObjectFunctionPropertyAugment) + return void 0; + const functionType2 = resolved === anyFunctionType ? globalFunctionType : resolved.callSignatures.length ? globalCallableFunctionType : resolved.constructSignatures.length ? globalNewableFunctionType : void 0; + if (functionType2) { + const symbol2 = getPropertyOfObjectType(functionType2, name2); + if (symbol2) { + return symbol2; + } + } + return getPropertyOfObjectType(globalObjectType, name2); + } + if (type3.flags & 2097152) { + const prop = getPropertyOfUnionOrIntersectionType( + type3, + name2, + /*skipObjectFunctionPropertyAugment*/ + true + ); + if (prop) { + return prop; + } + if (!skipObjectFunctionPropertyAugment) { + return getPropertyOfUnionOrIntersectionType(type3, name2, skipObjectFunctionPropertyAugment); + } + return void 0; + } + if (type3.flags & 1048576) { + return getPropertyOfUnionOrIntersectionType(type3, name2, skipObjectFunctionPropertyAugment); + } + return void 0; + } + function getSignaturesOfStructuredType(type3, kind) { + if (type3.flags & 3670016) { + const resolved = resolveStructuredTypeMembers(type3); + return kind === 0 ? resolved.callSignatures : resolved.constructSignatures; + } + return emptyArray; + } + function getSignaturesOfType(type3, kind) { + const result2 = getSignaturesOfStructuredType(getReducedApparentType(type3), kind); + if (kind === 0 && !length(result2) && type3.flags & 1048576) { + if (type3.arrayFallbackSignatures) { + return type3.arrayFallbackSignatures; + } + let memberName; + if (everyType(type3, (t8) => { + var _a2; + return !!((_a2 = t8.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t8.symbol.parent) && (!memberName ? (memberName = t8.symbol.escapedName, true) : memberName === t8.symbol.escapedName); + })) { + const arrayArg = mapType2(type3, (t8) => getMappedType((isReadonlyArraySymbol(t8.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t8.mapper)); + const arrayType2 = createArrayType(arrayArg, someType(type3, (t8) => isReadonlyArraySymbol(t8.symbol.parent))); + return type3.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType2, memberName), kind); + } + type3.arrayFallbackSignatures = result2; + } + return result2; + } + function isArrayOrTupleSymbol(symbol) { + if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) { + return false; + } + return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol); + } + function isReadonlyArraySymbol(symbol) { + if (!symbol || !globalReadonlyArrayType.symbol) { + return false; + } + return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol); + } + function findIndexInfo(indexInfos, keyType) { + return find2(indexInfos, (info2) => info2.keyType === keyType); + } + function findApplicableIndexInfo(indexInfos, keyType) { + let stringIndexInfo; + let applicableInfo; + let applicableInfos; + for (const info2 of indexInfos) { + if (info2.keyType === stringType2) { + stringIndexInfo = info2; + } else if (isApplicableIndexType(keyType, info2.keyType)) { + if (!applicableInfo) { + applicableInfo = info2; + } else { + (applicableInfos || (applicableInfos = [applicableInfo])).push(info2); + } + } + } + return applicableInfos ? createIndexInfo(unknownType2, getIntersectionType(map4(applicableInfos, (info2) => info2.type)), reduceLeft( + applicableInfos, + (isReadonly, info2) => isReadonly && info2.isReadonly, + /*initial*/ + true + )) : applicableInfo ? applicableInfo : stringIndexInfo && isApplicableIndexType(keyType, stringType2) ? stringIndexInfo : void 0; + } + function isApplicableIndexType(source, target) { + return isTypeAssignableTo(source, target) || target === stringType2 && isTypeAssignableTo(source, numberType2) || target === numberType2 && (source === numericStringType || !!(source.flags & 128) && isNumericLiteralName(source.value)); + } + function getIndexInfosOfStructuredType(type3) { + if (type3.flags & 3670016) { + const resolved = resolveStructuredTypeMembers(type3); + return resolved.indexInfos; + } + return emptyArray; + } + function getIndexInfosOfType(type3) { + return getIndexInfosOfStructuredType(getReducedApparentType(type3)); + } + function getIndexInfoOfType(type3, keyType) { + return findIndexInfo(getIndexInfosOfType(type3), keyType); + } + function getIndexTypeOfType(type3, keyType) { + var _a2; + return (_a2 = getIndexInfoOfType(type3, keyType)) == null ? void 0 : _a2.type; + } + function getApplicableIndexInfos(type3, keyType) { + return getIndexInfosOfType(type3).filter((info2) => isApplicableIndexType(keyType, info2.keyType)); + } + function getApplicableIndexInfo(type3, keyType) { + return findApplicableIndexInfo(getIndexInfosOfType(type3), keyType); + } + function getApplicableIndexInfoForName(type3, name2) { + return getApplicableIndexInfo(type3, isLateBoundName(name2) ? esSymbolType : getStringLiteralType(unescapeLeadingUnderscores(name2))); + } + function getTypeParametersFromDeclaration(declaration) { + var _a2; + let result2; + for (const node of getEffectiveTypeParameterDeclarations(declaration)) { + result2 = appendIfUnique(result2, getDeclaredTypeOfTypeParameter(node.symbol)); + } + return (result2 == null ? void 0 : result2.length) ? result2 : isFunctionDeclaration(declaration) ? (_a2 = getSignatureOfTypeTag(declaration)) == null ? void 0 : _a2.typeParameters : void 0; + } + function symbolsToArray(symbols) { + const result2 = []; + symbols.forEach((symbol, id) => { + if (!isReservedMemberName(id)) { + result2.push(symbol); + } + }); + return result2; + } + function tryFindAmbientModule(moduleName3, withAugmentations) { + if (isExternalModuleNameRelative(moduleName3)) { + return void 0; + } + const symbol = getSymbol2( + globals3, + '"' + moduleName3 + '"', + 512 + /* ValueModule */ + ); + return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol; + } + function isOptionalParameter(node) { + if (hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isJSDocOptionalParameter(node)) { + return true; + } + if (node.initializer) { + const signature = getSignatureFromDeclaration(node.parent); + const parameterIndex = node.parent.parameters.indexOf(node); + Debug.assert(parameterIndex >= 0); + return parameterIndex >= getMinArgumentCount( + signature, + 1 | 2 + /* VoidIsNonOptional */ + ); + } + const iife = getImmediatelyInvokedFunctionExpression(node.parent); + if (iife) { + return !node.type && !node.dotDotDotToken && node.parent.parameters.indexOf(node) >= getEffectiveCallArguments(iife).length; + } + return false; + } + function isOptionalPropertyDeclaration(node) { + return isPropertyDeclaration(node) && !hasAccessorModifier(node) && node.questionToken; + } + function createTypePredicate(kind, parameterName, parameterIndex, type3) { + return { kind, parameterName, parameterIndex, type: type3 }; + } + function getMinTypeArgumentCount(typeParameters) { + let minTypeArgumentCount = 0; + if (typeParameters) { + for (let i7 = 0; i7 < typeParameters.length; i7++) { + if (!hasTypeParameterDefault(typeParameters[i7])) { + minTypeArgumentCount = i7 + 1; + } + } + } + return minTypeArgumentCount; + } + function fillMissingTypeArguments(typeArguments, typeParameters, minTypeArgumentCount, isJavaScriptImplicitAny) { + const numTypeParameters = length(typeParameters); + if (!numTypeParameters) { + return []; + } + const numTypeArguments = length(typeArguments); + if (isJavaScriptImplicitAny || numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters) { + const result2 = typeArguments ? typeArguments.slice() : []; + for (let i7 = numTypeArguments; i7 < numTypeParameters; i7++) { + result2[i7] = errorType; + } + const baseDefaultType = getDefaultTypeArgumentType(isJavaScriptImplicitAny); + for (let i7 = numTypeArguments; i7 < numTypeParameters; i7++) { + let defaultType = getDefaultFromTypeParameter(typeParameters[i7]); + if (isJavaScriptImplicitAny && defaultType && (isTypeIdenticalTo(defaultType, unknownType2) || isTypeIdenticalTo(defaultType, emptyObjectType))) { + defaultType = anyType2; + } + result2[i7] = defaultType ? instantiateType(defaultType, createTypeMapper(typeParameters, result2)) : baseDefaultType; + } + result2.length = typeParameters.length; + return result2; + } + return typeArguments && typeArguments.slice(); + } + function getSignatureFromDeclaration(declaration) { + const links = getNodeLinks(declaration); + if (!links.resolvedSignature) { + const parameters = []; + let flags = 0; + let minArgumentCount = 0; + let thisParameter; + let thisTag = isInJSFile(declaration) ? getJSDocThisTag(declaration) : void 0; + let hasThisParameter2 = false; + const iife = getImmediatelyInvokedFunctionExpression(declaration); + const isJSConstructSignature = isJSDocConstructSignature(declaration); + const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration); + if (isUntypedSignatureInJSFile) { + flags |= 32; + } + for (let i7 = isJSConstructSignature ? 1 : 0; i7 < declaration.parameters.length; i7++) { + const param = declaration.parameters[i7]; + if (isInJSFile(param) && isJSDocThisTag(param)) { + thisTag = param; + continue; + } + let paramSymbol = param.symbol; + const type3 = isJSDocParameterTag(param) ? param.typeExpression && param.typeExpression.type : param.type; + if (paramSymbol && !!(paramSymbol.flags & 4) && !isBindingPattern(param.name)) { + const resolvedSymbol = resolveName( + param, + paramSymbol.escapedName, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + paramSymbol = resolvedSymbol; + } + if (i7 === 0 && paramSymbol.escapedName === "this") { + hasThisParameter2 = true; + thisParameter = param.symbol; + } else { + parameters.push(paramSymbol); + } + if (type3 && type3.kind === 201) { + flags |= 2; + } + const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type3 || isJSDocOptionalParameter(param); + if (!isOptionalParameter2) { + minArgumentCount = parameters.length; + } + } + if ((declaration.kind === 177 || declaration.kind === 178) && hasBindableName(declaration) && (!hasThisParameter2 || !thisParameter)) { + const otherKind = declaration.kind === 177 ? 178 : 177; + const other = getDeclarationOfKind(getSymbolOfDeclaration(declaration), otherKind); + if (other) { + thisParameter = getAnnotatedAccessorThisParameter(other); + } + } + if (thisTag && thisTag.typeExpression) { + thisParameter = createSymbolWithType(createSymbol( + 1, + "this" + /* This */ + ), getTypeFromTypeNode(thisTag.typeExpression)); + } + const hostDeclaration = isJSDocSignature(declaration) ? getEffectiveJSDocHost(declaration) : declaration; + const classType = hostDeclaration && isConstructorDeclaration(hostDeclaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(hostDeclaration.parent.symbol)) : void 0; + const typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); + if (hasRestParameter(declaration) || isInJSFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters)) { + flags |= 1; + } + if (isConstructorTypeNode(declaration) && hasSyntacticModifier( + declaration, + 64 + /* Abstract */ + ) || isConstructorDeclaration(declaration) && hasSyntacticModifier( + declaration.parent, + 64 + /* Abstract */ + )) { + flags |= 4; + } + links.resolvedSignature = createSignature( + declaration, + typeParameters, + thisParameter, + parameters, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgumentCount, + flags + ); + } + return links.resolvedSignature; + } + function maybeAddJsSyntheticRestParameter(declaration, parameters) { + if (isJSDocSignature(declaration) || !containsArgumentsReference(declaration)) { + return false; + } + const lastParam = lastOrUndefined(declaration.parameters); + const lastParamTags = lastParam ? getJSDocParameterTags(lastParam) : getJSDocTags(declaration).filter(isJSDocParameterTag); + const lastParamVariadicType = firstDefined(lastParamTags, (p7) => p7.typeExpression && isJSDocVariadicType(p7.typeExpression.type) ? p7.typeExpression.type : void 0); + const syntheticArgsSymbol = createSymbol( + 3, + "args", + 32768 + /* RestParameter */ + ); + if (lastParamVariadicType) { + syntheticArgsSymbol.links.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)); + } else { + syntheticArgsSymbol.links.checkFlags |= 65536; + syntheticArgsSymbol.links.deferralParent = neverType2; + syntheticArgsSymbol.links.deferralConstituents = [anyArrayType]; + syntheticArgsSymbol.links.deferralWriteConstituents = [anyArrayType]; + } + if (lastParamVariadicType) { + parameters.pop(); + } + parameters.push(syntheticArgsSymbol); + return true; + } + function getSignatureOfTypeTag(node) { + if (!(isInJSFile(node) && isFunctionLikeDeclaration(node))) + return void 0; + const typeTag = getJSDocTypeTag(node); + return (typeTag == null ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression)); + } + function getParameterTypeOfTypeTag(func, parameter) { + const signature = getSignatureOfTypeTag(func); + if (!signature) + return void 0; + const pos = func.parameters.indexOf(parameter); + return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos); + } + function getReturnTypeOfTypeTag(node) { + const signature = getSignatureOfTypeTag(node); + return signature && getReturnTypeOfSignature(signature); + } + function containsArgumentsReference(declaration) { + const links = getNodeLinks(declaration); + if (links.containsArgumentsReference === void 0) { + if (links.flags & 512) { + links.containsArgumentsReference = true; + } else { + links.containsArgumentsReference = traverse4(declaration.body); + } + } + return links.containsArgumentsReference; + function traverse4(node) { + if (!node) + return false; + switch (node.kind) { + case 80: + return node.escapedText === argumentsSymbol.escapedName && getReferencedValueSymbol(node) === argumentsSymbol; + case 172: + case 174: + case 177: + case 178: + return node.name.kind === 167 && traverse4(node.name); + case 211: + case 212: + return traverse4(node.expression); + case 303: + return traverse4(node.initializer); + default: + return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse4); + } + } + } + function getSignaturesOfSymbol(symbol) { + if (!symbol || !symbol.declarations) + return emptyArray; + const result2 = []; + for (let i7 = 0; i7 < symbol.declarations.length; i7++) { + const decl = symbol.declarations[i7]; + if (!isFunctionLike(decl)) + continue; + if (i7 > 0 && decl.body) { + const previous = symbol.declarations[i7 - 1]; + if (decl.parent === previous.parent && decl.kind === previous.kind && decl.pos === previous.end) { + continue; + } + } + if (isInJSFile(decl) && decl.jsDoc) { + const tags6 = getJSDocOverloadTags(decl); + if (length(tags6)) { + for (const tag of tags6) { + const jsDocSignature = tag.typeExpression; + if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) { + reportImplicitAny(jsDocSignature, anyType2); + } + result2.push(getSignatureFromDeclaration(jsDocSignature)); + } + continue; + } + } + result2.push( + !isFunctionExpressionOrArrowFunction(decl) && !isObjectLiteralMethod(decl) && getSignatureOfTypeTag(decl) || getSignatureFromDeclaration(decl) + ); + } + return result2; + } + function resolveExternalModuleTypeByLiteral(name2) { + const moduleSym = resolveExternalModuleName(name2, name2); + if (moduleSym) { + const resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + return getTypeOfSymbol(resolvedModuleSymbol); + } + } + return anyType2; + } + function getThisTypeOfSignature(signature) { + if (signature.thisParameter) { + return getTypeOfSymbol(signature.thisParameter); + } + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + const targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } else if (signature.compositeSignatures) { + signature.resolvedTypePredicate = getUnionOrIntersectionTypePredicate(signature.compositeSignatures, signature.compositeKind) || noTypePredicate; + } else { + const type3 = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); + let jsdocPredicate; + if (!type3) { + const jsdocSignature = getSignatureOfTypeTag(signature.declaration); + if (jsdocSignature && signature !== jsdocSignature) { + jsdocPredicate = getTypePredicateOfSignature(jsdocSignature); + } + } + signature.resolvedTypePredicate = type3 && isTypePredicateNode(type3) ? createTypePredicateFromTypePredicateNode(type3, signature) : jsdocPredicate || noTypePredicate; + } + Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? void 0 : signature.resolvedTypePredicate; + } + function createTypePredicateFromTypePredicateNode(node, signature) { + const parameterName = node.parameterName; + const type3 = node.type && getTypeFromTypeNode(node.type); + return parameterName.kind === 197 ? createTypePredicate( + node.assertsModifier ? 2 : 0, + /*parameterName*/ + void 0, + /*parameterIndex*/ + void 0, + type3 + ) : createTypePredicate(node.assertsModifier ? 3 : 1, parameterName.escapedText, findIndex2(signature.parameters, (p7) => p7.escapedName === parameterName.escapedText), type3); + } + function getUnionOrIntersectionType(types3, kind, unionReduction) { + return kind !== 2097152 ? getUnionType(types3, unionReduction) : getIntersectionType(types3); + } + function getReturnTypeOfSignature(signature) { + if (!signature.resolvedReturnType) { + if (!pushTypeResolution( + signature, + 3 + /* ResolvedReturnType */ + )) { + return errorType; + } + let type3 = signature.target ? instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper) : signature.compositeSignatures ? instantiateType(getUnionOrIntersectionType( + map4(signature.compositeSignatures, getReturnTypeOfSignature), + signature.compositeKind, + 2 + /* Subtype */ + ), signature.mapper) : getReturnTypeFromAnnotation(signature.declaration) || (nodeIsMissing(signature.declaration.body) ? anyType2 : getReturnTypeFromBody(signature.declaration)); + if (signature.flags & 8) { + type3 = addOptionalTypeMarker(type3); + } else if (signature.flags & 16) { + type3 = getOptionalType(type3); + } + if (!popTypeResolution()) { + if (signature.declaration) { + const typeNode = getEffectiveReturnTypeNode(signature.declaration); + if (typeNode) { + error22(typeNode, Diagnostics.Return_type_annotation_circularly_references_itself); + } else if (noImplicitAny) { + const declaration = signature.declaration; + const name2 = getNameOfDeclaration(declaration); + if (name2) { + error22(name2, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(name2)); + } else { + error22(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); + } + } + } + type3 = anyType2; + } + signature.resolvedReturnType = type3; + } + return signature.resolvedReturnType; + } + function getReturnTypeFromAnnotation(declaration) { + if (declaration.kind === 176) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)); + } + const typeNode = getEffectiveReturnTypeNode(declaration); + if (isJSDocSignature(declaration)) { + const root2 = getJSDocRoot(declaration); + if (root2 && isConstructorDeclaration(root2.parent) && !typeNode) { + return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root2.parent.parent.symbol)); + } + } + if (isJSDocConstructSignature(declaration)) { + return getTypeFromTypeNode(declaration.parameters[0].type); + } + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + if (declaration.kind === 177 && hasBindableName(declaration)) { + const jsDocType = isInJSFile(declaration) && getTypeForDeclarationFromJSDocComment(declaration); + if (jsDocType) { + return jsDocType; + } + const setter = getDeclarationOfKind( + getSymbolOfDeclaration(declaration), + 178 + /* SetAccessor */ + ); + const setterType = getAnnotatedAccessorType(setter); + if (setterType) { + return setterType; + } + } + return getReturnTypeOfTypeTag(declaration); + } + function isResolvingReturnTypeOfSignature(signature) { + return signature.compositeSignatures && some2(signature.compositeSignatures, isResolvingReturnTypeOfSignature) || !signature.resolvedReturnType && findResolutionCycleStartIndex( + signature, + 3 + /* ResolvedReturnType */ + ) >= 0; + } + function getRestTypeOfSignature(signature) { + return tryGetRestTypeOfSignature(signature) || anyType2; + } + function tryGetRestTypeOfSignature(signature) { + if (signatureHasRestParameter(signature)) { + const sigRestType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + const restType = isTupleType(sigRestType) ? getRestTypeOfTupleType(sigRestType) : sigRestType; + return restType && getIndexTypeOfType(restType, numberType2); + } + return void 0; + } + function getSignatureInstantiation(signature, typeArguments, isJavascript, inferredTypeParameters) { + const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters), isJavascript)); + if (inferredTypeParameters) { + const returnSignature = getSingleCallOrConstructSignature(getReturnTypeOfSignature(instantiatedSignature)); + if (returnSignature) { + const newReturnSignature = cloneSignature(returnSignature); + newReturnSignature.typeParameters = inferredTypeParameters; + const newInstantiatedSignature = cloneSignature(instantiatedSignature); + newInstantiatedSignature.resolvedReturnType = getOrCreateTypeFromSignature(newReturnSignature); + return newInstantiatedSignature; + } + } + return instantiatedSignature; + } + function getSignatureInstantiationWithoutFillingInTypeArguments(signature, typeArguments) { + const instantiations = signature.instantiations || (signature.instantiations = /* @__PURE__ */ new Map()); + const id = getTypeListId(typeArguments); + let instantiation = instantiations.get(id); + if (!instantiation) { + instantiations.set(id, instantiation = createSignatureInstantiation(signature, typeArguments)); + } + return instantiation; + } + function createSignatureInstantiation(signature, typeArguments) { + return instantiateSignature( + signature, + createSignatureTypeMapper(signature, typeArguments), + /*eraseTypeParameters*/ + true + ); + } + function createSignatureTypeMapper(signature, typeArguments) { + return createTypeMapper(signature.typeParameters, typeArguments); + } + function getErasedSignature(signature) { + return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature; + } + function createErasedSignature(signature) { + return instantiateSignature( + signature, + createTypeEraser(signature.typeParameters), + /*eraseTypeParameters*/ + true + ); + } + function getCanonicalSignature(signature) { + return signature.typeParameters ? signature.canonicalSignatureCache || (signature.canonicalSignatureCache = createCanonicalSignature(signature)) : signature; + } + function createCanonicalSignature(signature) { + return getSignatureInstantiation( + signature, + map4(signature.typeParameters, (tp) => tp.target && !getConstraintOfTypeParameter(tp.target) ? tp.target : tp), + isInJSFile(signature.declaration) + ); + } + function getBaseSignature(signature) { + const typeParameters = signature.typeParameters; + if (typeParameters) { + if (signature.baseSignatureCache) { + return signature.baseSignatureCache; + } + const typeEraser = createTypeEraser(typeParameters); + const baseConstraintMapper = createTypeMapper(typeParameters, map4(typeParameters, (tp) => getConstraintOfTypeParameter(tp) || unknownType2)); + let baseConstraints = map4(typeParameters, (tp) => instantiateType(tp, baseConstraintMapper) || unknownType2); + for (let i7 = 0; i7 < typeParameters.length - 1; i7++) { + baseConstraints = instantiateTypes(baseConstraints, baseConstraintMapper); + } + baseConstraints = instantiateTypes(baseConstraints, typeEraser); + return signature.baseSignatureCache = instantiateSignature( + signature, + createTypeMapper(typeParameters, baseConstraints), + /*eraseTypeParameters*/ + true + ); + } + return signature; + } + function getOrCreateTypeFromSignature(signature) { + var _a2; + if (!signature.isolatedSignatureType) { + const kind = (_a2 = signature.declaration) == null ? void 0 : _a2.kind; + const isConstructor = kind === void 0 || kind === 176 || kind === 180 || kind === 185; + const type3 = createObjectType( + 16 + /* Anonymous */ + ); + type3.members = emptySymbols; + type3.properties = emptyArray; + type3.callSignatures = !isConstructor ? [signature] : emptyArray; + type3.constructSignatures = isConstructor ? [signature] : emptyArray; + type3.indexInfos = emptyArray; + signature.isolatedSignatureType = type3; + } + return signature.isolatedSignatureType; + } + function getIndexSymbol(symbol) { + return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0; + } + function getIndexSymbolFromSymbolTable(symbolTable) { + return symbolTable.get( + "__index" + /* Index */ + ); + } + function createIndexInfo(keyType, type3, isReadonly, declaration) { + return { keyType, type: type3, isReadonly, declaration }; + } + function getIndexInfosOfSymbol(symbol) { + const indexSymbol = getIndexSymbol(symbol); + return indexSymbol ? getIndexInfosOfIndexSymbol(indexSymbol) : emptyArray; + } + function getIndexInfosOfIndexSymbol(indexSymbol) { + if (indexSymbol.declarations) { + const indexInfos = []; + for (const declaration of indexSymbol.declarations) { + if (declaration.parameters.length === 1) { + const parameter = declaration.parameters[0]; + if (parameter.type) { + forEachType(getTypeFromTypeNode(parameter.type), (keyType) => { + if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) { + indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType2, hasEffectiveModifier( + declaration, + 8 + /* Readonly */ + ), declaration)); + } + }); + } + } + } + return indexInfos; + } + return emptyArray; + } + function isValidIndexKeyType(type3) { + return !!(type3.flags & (4 | 8 | 4096)) || isPatternLiteralType(type3) || !!(type3.flags & 2097152) && !isGenericType(type3) && some2(type3.types, isValidIndexKeyType); + } + function getConstraintDeclaration(type3) { + return mapDefined(filter2(type3.symbol && type3.symbol.declarations, isTypeParameterDeclaration), getEffectiveConstraintOfTypeParameter)[0]; + } + function getInferredTypeParameterConstraint(typeParameter, omitTypeReferences) { + var _a2; + let inferences; + if ((_a2 = typeParameter.symbol) == null ? void 0 : _a2.declarations) { + for (const declaration of typeParameter.symbol.declarations) { + if (declaration.parent.kind === 195) { + const [childTypeParameter = declaration.parent, grandParent] = walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent); + if (grandParent.kind === 183 && !omitTypeReferences) { + const typeReference = grandParent; + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReference); + if (typeParameters) { + const index4 = typeReference.typeArguments.indexOf(childTypeParameter); + if (index4 < typeParameters.length) { + const declaredConstraint = getConstraintOfTypeParameter(typeParameters[index4]); + if (declaredConstraint) { + const mapper = makeDeferredTypeMapper( + typeParameters, + typeParameters.map((_6, index22) => () => { + return getEffectiveTypeArgumentAtIndex(typeReference, typeParameters, index22); + }) + ); + const constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = append(inferences, constraint); + } + } + } + } + } else if (grandParent.kind === 169 && grandParent.dotDotDotToken || grandParent.kind === 191 || grandParent.kind === 202 && grandParent.dotDotDotToken) { + inferences = append(inferences, createArrayType(unknownType2)); + } else if (grandParent.kind === 204) { + inferences = append(inferences, stringType2); + } else if (grandParent.kind === 168 && grandParent.parent.kind === 200) { + inferences = append(inferences, keyofConstraintType); + } else if (grandParent.kind === 200 && grandParent.type && skipParentheses(grandParent.type) === declaration.parent && grandParent.parent.kind === 194 && grandParent.parent.extendsType === grandParent && grandParent.parent.checkType.kind === 200 && grandParent.parent.checkType.type) { + const checkMappedType2 = grandParent.parent.checkType; + const nodeType = getTypeFromTypeNode(checkMappedType2.type); + inferences = append(inferences, instantiateType(nodeType, makeUnaryTypeMapper(getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(checkMappedType2.typeParameter)), checkMappedType2.typeParameter.constraint ? getTypeFromTypeNode(checkMappedType2.typeParameter.constraint) : keyofConstraintType))); + } + } + } + } + return inferences && getIntersectionType(inferences); + } + function getConstraintFromTypeParameter(typeParameter) { + if (!typeParameter.constraint) { + if (typeParameter.target) { + const targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; + } else { + const constraintDeclaration = getConstraintDeclaration(typeParameter); + if (!constraintDeclaration) { + typeParameter.constraint = getInferredTypeParameterConstraint(typeParameter) || noConstraintType; + } else { + let type3 = getTypeFromTypeNode(constraintDeclaration); + if (type3.flags & 1 && !isErrorType(type3)) { + type3 = constraintDeclaration.parent.parent.kind === 200 ? keyofConstraintType : unknownType2; + } + typeParameter.constraint = type3; + } + } + } + return typeParameter.constraint === noConstraintType ? void 0 : typeParameter.constraint; + } + function getParentSymbolOfTypeParameter(typeParameter) { + const tp = getDeclarationOfKind( + typeParameter.symbol, + 168 + /* TypeParameter */ + ); + const host2 = isJSDocTemplateTag(tp.parent) ? getEffectiveContainerForJSDocTemplateTag(tp.parent) : tp.parent; + return host2 && getSymbolOfNode(host2); + } + function getTypeListId(types3) { + let result2 = ""; + if (types3) { + const length2 = types3.length; + let i7 = 0; + while (i7 < length2) { + const startId = types3[i7].id; + let count2 = 1; + while (i7 + count2 < length2 && types3[i7 + count2].id === startId + count2) { + count2++; + } + if (result2.length) { + result2 += ","; + } + result2 += startId; + if (count2 > 1) { + result2 += ":" + count2; + } + i7 += count2; + } + } + return result2; + } + function getAliasId(aliasSymbol, aliasTypeArguments) { + return aliasSymbol ? `@${getSymbolId(aliasSymbol)}` + (aliasTypeArguments ? `:${getTypeListId(aliasTypeArguments)}` : "") : ""; + } + function getPropagatingFlagsOfTypes(types3, excludeKinds) { + let result2 = 0; + for (const type3 of types3) { + if (excludeKinds === void 0 || !(type3.flags & excludeKinds)) { + result2 |= getObjectFlags(type3); + } + } + return result2 & 458752; + } + function tryCreateTypeReference(target, typeArguments) { + if (some2(typeArguments) && target === emptyGenericType) { + return unknownType2; + } + return createTypeReference(target, typeArguments); + } + function createTypeReference(target, typeArguments) { + const id = getTypeListId(typeArguments); + let type3 = target.instantiations.get(id); + if (!type3) { + type3 = createObjectType(4, target.symbol); + target.instantiations.set(id, type3); + type3.objectFlags |= typeArguments ? getPropagatingFlagsOfTypes(typeArguments) : 0; + type3.target = target; + type3.resolvedTypeArguments = typeArguments; + } + return type3; + } + function cloneTypeReference(source) { + const type3 = createTypeWithSymbol(source.flags, source.symbol); + type3.objectFlags = source.objectFlags; + type3.target = source.target; + type3.resolvedTypeArguments = source.resolvedTypeArguments; + return type3; + } + function createDeferredTypeReference(target, node, mapper, aliasSymbol, aliasTypeArguments) { + if (!aliasSymbol) { + aliasSymbol = getAliasSymbolForTypeNode(node); + const localAliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + aliasTypeArguments = mapper ? instantiateTypes(localAliasTypeArguments, mapper) : localAliasTypeArguments; + } + const type3 = createObjectType(4, target.symbol); + type3.target = target; + type3.node = node; + type3.mapper = mapper; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + return type3; + } + function getTypeArguments(type3) { + var _a2, _b; + if (!type3.resolvedTypeArguments) { + if (!pushTypeResolution( + type3, + 6 + /* ResolvedTypeArguments */ + )) { + return ((_a2 = type3.target.localTypeParameters) == null ? void 0 : _a2.map(() => errorType)) || emptyArray; + } + const node = type3.node; + const typeArguments = !node ? emptyArray : node.kind === 183 ? concatenate(type3.target.outerTypeParameters, getEffectiveTypeArguments2(node, type3.target.localTypeParameters)) : node.kind === 188 ? [getTypeFromTypeNode(node.elementType)] : map4(node.elements, getTypeFromTypeNode); + if (popTypeResolution()) { + type3.resolvedTypeArguments = type3.mapper ? instantiateTypes(typeArguments, type3.mapper) : typeArguments; + } else { + type3.resolvedTypeArguments = ((_b = type3.target.localTypeParameters) == null ? void 0 : _b.map(() => errorType)) || emptyArray; + error22( + type3.node || currentNode, + type3.target.symbol ? Diagnostics.Type_arguments_for_0_circularly_reference_themselves : Diagnostics.Tuple_type_arguments_circularly_reference_themselves, + type3.target.symbol && symbolToString2(type3.target.symbol) + ); + } + } + return type3.resolvedTypeArguments; + } + function getTypeReferenceArity(type3) { + return length(type3.target.typeParameters); + } + function getTypeFromClassOrInterfaceReference(node, symbol) { + const type3 = getDeclaredTypeOfSymbol(getMergedSymbol(symbol)); + const typeParameters = type3.localTypeParameters; + if (typeParameters) { + const numTypeArguments = length(node.typeArguments); + const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + const isJs = isInJSFile(node); + const isJsImplicitAny = !noImplicitAny && isJs; + if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { + const missingAugmentsTag = isJs && isExpressionWithTypeArguments(node) && !isJSDocAugmentsTag(node.parent); + const diag2 = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag : Diagnostics.Generic_type_0_requires_1_type_argument_s : missingAugmentsTag ? Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; + const typeStr = typeToString( + type3, + /*enclosingDeclaration*/ + void 0, + 2 + /* WriteArrayAsGenericType */ + ); + error22(node, diag2, typeStr, minTypeArgumentCount, typeParameters.length); + if (!isJs) { + return errorType; + } + } + if (node.kind === 183 && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) { + return createDeferredTypeReference( + type3, + node, + /*mapper*/ + void 0 + ); + } + const typeArguments = concatenate(type3.outerTypeParameters, fillMissingTypeArguments(typeArgumentsFromTypeReferenceNode(node), typeParameters, minTypeArgumentCount, isJs)); + return createTypeReference(type3, typeArguments); + } + return checkNoTypeArguments(node, symbol) ? type3 : errorType; + } + function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) { + const type3 = getDeclaredTypeOfSymbol(symbol); + if (type3 === intrinsicMarkerType) { + const typeKind = intrinsicTypeKinds.get(symbol.escapedName); + if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) { + return typeKind === 4 ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]); + } + } + const links = getSymbolLinks(symbol); + const typeParameters = links.typeParameters; + const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments); + let instantiation = links.instantiations.get(id); + if (!instantiation) { + links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type3, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments)); + } + return instantiation; + } + function getTypeFromTypeAliasReference(node, symbol) { + if (getCheckFlags(symbol) & 1048576) { + const typeArguments = typeArgumentsFromTypeReferenceNode(node); + const id = getAliasId(symbol, typeArguments); + let errorType2 = errorTypes.get(id); + if (!errorType2) { + errorType2 = createIntrinsicType( + 1, + "error", + /*objectFlags*/ + void 0, + `alias ${id}` + ); + errorType2.aliasSymbol = symbol; + errorType2.aliasTypeArguments = typeArguments; + errorTypes.set(id, errorType2); + } + return errorType2; + } + const type3 = getDeclaredTypeOfSymbol(symbol); + const typeParameters = getSymbolLinks(symbol).typeParameters; + if (typeParameters) { + const numTypeArguments = length(node.typeArguments); + const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + error22( + node, + minTypeArgumentCount === typeParameters.length ? Diagnostics.Generic_type_0_requires_1_type_argument_s : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, + symbolToString2(symbol), + minTypeArgumentCount, + typeParameters.length + ); + return errorType; + } + const aliasSymbol = getAliasSymbolForTypeNode(node); + let newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : void 0; + let aliasTypeArguments; + if (newAliasSymbol) { + aliasTypeArguments = getTypeArgumentsForAliasSymbol(newAliasSymbol); + } else if (isTypeReferenceType(node)) { + const aliasSymbol2 = resolveTypeReferenceName( + node, + 2097152, + /*ignoreErrors*/ + true + ); + if (aliasSymbol2 && aliasSymbol2 !== unknownSymbol) { + const resolved = resolveAlias(aliasSymbol2); + if (resolved && resolved.flags & 524288) { + newAliasSymbol = resolved; + aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) || (typeParameters ? [] : void 0); + } + } + } + return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments); + } + return checkNoTypeArguments(node, symbol) ? type3 : errorType; + } + function isLocalTypeAlias(symbol) { + var _a2; + const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2.find(isTypeAlias); + return !!(declaration && getContainingFunction(declaration)); + } + function getTypeReferenceName(node) { + switch (node.kind) { + case 183: + return node.typeName; + case 233: + const expr = node.expression; + if (isEntityNameExpression(expr)) { + return expr; + } + } + return void 0; + } + function getSymbolPath(symbol) { + return symbol.parent ? `${getSymbolPath(symbol.parent)}.${symbol.escapedName}` : symbol.escapedName; + } + function getUnresolvedSymbolForEntityName(name2) { + const identifier = name2.kind === 166 ? name2.right : name2.kind === 211 ? name2.name : name2; + const text = identifier.escapedText; + if (text) { + const parentSymbol = name2.kind === 166 ? getUnresolvedSymbolForEntityName(name2.left) : name2.kind === 211 ? getUnresolvedSymbolForEntityName(name2.expression) : void 0; + const path2 = parentSymbol ? `${getSymbolPath(parentSymbol)}.${text}` : text; + let result2 = unresolvedSymbols.get(path2); + if (!result2) { + unresolvedSymbols.set(path2, result2 = createSymbol( + 524288, + text, + 1048576 + /* Unresolved */ + )); + result2.parent = parentSymbol; + result2.links.declaredType = unresolvedType; + } + return result2; + } + return unknownSymbol; + } + function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) { + const name2 = getTypeReferenceName(typeReference); + if (!name2) { + return unknownSymbol; + } + const symbol = resolveEntityName(name2, meaning, ignoreErrors); + return symbol && symbol !== unknownSymbol ? symbol : ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name2); + } + function getTypeReferenceType(node, symbol) { + if (symbol === unknownSymbol) { + return errorType; + } + symbol = getExpandoSymbol(symbol) || symbol; + if (symbol.flags & (32 | 64)) { + return getTypeFromClassOrInterfaceReference(node, symbol); + } + if (symbol.flags & 524288) { + return getTypeFromTypeAliasReference(node, symbol); + } + const res = tryGetDeclaredTypeOfSymbol(symbol); + if (res) { + return checkNoTypeArguments(node, symbol) ? getRegularTypeOfLiteralType(res) : errorType; + } + if (symbol.flags & 111551 && isJSDocTypeReference(node)) { + const jsdocType = getTypeFromJSDocValueReference(node, symbol); + if (jsdocType) { + return jsdocType; + } else { + resolveTypeReferenceName( + node, + 788968 + /* Type */ + ); + return getTypeOfSymbol(symbol); + } + } + return errorType; + } + function getTypeFromJSDocValueReference(node, symbol) { + const links = getNodeLinks(node); + if (!links.resolvedJSDocType) { + const valueType = getTypeOfSymbol(symbol); + let typeType = valueType; + if (symbol.valueDeclaration) { + const isImportTypeWithQualifier = node.kind === 205 && node.qualifier; + if (valueType.symbol && valueType.symbol !== symbol && isImportTypeWithQualifier) { + typeType = getTypeReferenceType(node, valueType.symbol); + } + } + links.resolvedJSDocType = typeType; + } + return links.resolvedJSDocType; + } + function getNoInferType(type3) { + return isNoInferTargetType(type3) ? getOrCreateSubstitutionType(type3, unknownType2) : type3; + } + function isNoInferTargetType(type3) { + return !!(type3.flags & 3145728 && some2(type3.types, isNoInferTargetType) || type3.flags & 33554432 && !isNoInferType(type3) && isNoInferTargetType(type3.baseType) || type3.flags & 524288 && !isEmptyAnonymousObjectType(type3) || type3.flags & (465829888 & ~33554432) && !isPatternLiteralType(type3)); + } + function isNoInferType(type3) { + return !!(type3.flags & 33554432 && type3.constraint.flags & 2); + } + function getSubstitutionType(baseType, constraint) { + return constraint.flags & 3 || constraint === baseType || baseType.flags & 1 ? baseType : getOrCreateSubstitutionType(baseType, constraint); + } + function getOrCreateSubstitutionType(baseType, constraint) { + const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`; + const cached = substitutionTypes.get(id); + if (cached) { + return cached; + } + const result2 = createType( + 33554432 + /* Substitution */ + ); + result2.baseType = baseType; + result2.constraint = constraint; + substitutionTypes.set(id, result2); + return result2; + } + function getSubstitutionIntersection(substitutionType) { + return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]); + } + function isUnaryTupleTypeNode(node) { + return node.kind === 189 && node.elements.length === 1; + } + function getImpliedConstraint(type3, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type3, checkNode.elements[0], extendsNode.elements[0]) : getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type3) ? getTypeFromTypeNode(extendsNode) : void 0; + } + function getConditionalFlowTypeOfType(type3, node) { + let constraints; + let covariant = true; + while (node && !isStatement(node) && node.kind !== 327) { + const parent22 = node.parent; + if (parent22.kind === 169) { + covariant = !covariant; + } + if ((covariant || type3.flags & 8650752) && parent22.kind === 194 && node === parent22.trueType) { + const constraint = getImpliedConstraint(type3, parent22.checkType, parent22.extendsType); + if (constraint) { + constraints = append(constraints, constraint); + } + } else if (type3.flags & 262144 && parent22.kind === 200 && !parent22.nameType && node === parent22.type) { + const mappedType = getTypeFromTypeNode(parent22); + if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type3)) { + const typeParameter = getHomomorphicTypeVariable(mappedType); + if (typeParameter) { + const constraint = getConstraintOfTypeParameter(typeParameter); + if (constraint && everyType(constraint, isArrayOrTupleType)) { + constraints = append(constraints, getUnionType([numberType2, numericStringType])); + } + } + } + } + node = parent22; + } + return constraints ? getSubstitutionType(type3, getIntersectionType(constraints)) : type3; + } + function isJSDocTypeReference(node) { + return !!(node.flags & 16777216) && (node.kind === 183 || node.kind === 205); + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error22(node, Diagnostics.Type_0_is_not_generic, symbol ? symbolToString2(symbol) : node.typeName ? declarationNameToString(node.typeName) : anon); + return false; + } + return true; + } + function getIntendedTypeFromJSDocTypeReference(node) { + if (isIdentifier(node.typeName)) { + const typeArgs = node.typeArguments; + switch (node.typeName.escapedText) { + case "String": + checkNoTypeArguments(node); + return stringType2; + case "Number": + checkNoTypeArguments(node); + return numberType2; + case "Boolean": + checkNoTypeArguments(node); + return booleanType2; + case "Void": + checkNoTypeArguments(node); + return voidType2; + case "Undefined": + checkNoTypeArguments(node); + return undefinedType2; + case "Null": + checkNoTypeArguments(node); + return nullType2; + case "Function": + case "function": + checkNoTypeArguments(node); + return globalFunctionType; + case "array": + return (!typeArgs || !typeArgs.length) && !noImplicitAny ? anyArrayType : void 0; + case "promise": + return (!typeArgs || !typeArgs.length) && !noImplicitAny ? createPromiseType(anyType2) : void 0; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (isJSDocIndexSignature(node)) { + const indexed = getTypeFromTypeNode(typeArgs[0]); + const target = getTypeFromTypeNode(typeArgs[1]); + const indexInfo = indexed === stringType2 || indexed === numberType2 ? [createIndexInfo( + indexed, + target, + /*isReadonly*/ + false + )] : emptyArray; + return createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + indexInfo + ); + } + return anyType2; + } + checkNoTypeArguments(node); + return !noImplicitAny ? anyType2 : void 0; + } + } + } + function getTypeFromJSDocNullableTypeNode(node) { + const type3 = getTypeFromTypeNode(node.type); + return strictNullChecks ? getNullableType( + type3, + 65536 + /* Null */ + ) : type3; + } + function getTypeFromTypeReference(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + if (isConstTypeReference(node) && isAssertionExpression(node.parent)) { + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = checkExpressionCached(node.parent.expression); + } + let symbol; + let type3; + const meaning = 788968; + if (isJSDocTypeReference(node)) { + type3 = getIntendedTypeFromJSDocTypeReference(node); + if (!type3) { + symbol = resolveTypeReferenceName( + node, + meaning, + /*ignoreErrors*/ + true + ); + if (symbol === unknownSymbol) { + symbol = resolveTypeReferenceName( + node, + meaning | 111551 + /* Value */ + ); + } else { + resolveTypeReferenceName(node, meaning); + } + type3 = getTypeReferenceType(node, symbol); + } + } + if (!type3) { + symbol = resolveTypeReferenceName(node, meaning); + type3 = getTypeReferenceType(node, symbol); + } + links.resolvedSymbol = symbol; + links.resolvedType = type3; + } + return links.resolvedType; + } + function typeArgumentsFromTypeReferenceNode(node) { + return map4(node.typeArguments, getTypeFromTypeNode); + } + function getTypeFromTypeQueryNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const type3 = checkExpressionWithTypeArguments(node); + links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type3)); + } + return links.resolvedType; + } + function getTypeOfGlobalSymbol(symbol, arity) { + function getTypeDeclaration(symbol2) { + const declarations = symbol2.declarations; + if (declarations) { + for (const declaration of declarations) { + switch (declaration.kind) { + case 263: + case 264: + case 266: + return declaration; + } + } + } + } + if (!symbol) { + return arity ? emptyGenericType : emptyObjectType; + } + const type3 = getDeclaredTypeOfSymbol(symbol); + if (!(type3.flags & 524288)) { + error22(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbolName(symbol)); + return arity ? emptyGenericType : emptyObjectType; + } + if (length(type3.typeParameters) !== arity) { + error22(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); + return arity ? emptyGenericType : emptyObjectType; + } + return type3; + } + function getGlobalValueSymbol(name2, reportErrors2) { + return getGlobalSymbol(name2, 111551, reportErrors2 ? Diagnostics.Cannot_find_global_value_0 : void 0); + } + function getGlobalTypeSymbol(name2, reportErrors2) { + return getGlobalSymbol(name2, 788968, reportErrors2 ? Diagnostics.Cannot_find_global_type_0 : void 0); + } + function getGlobalTypeAliasSymbol(name2, arity, reportErrors2) { + const symbol = getGlobalSymbol(name2, 788968, reportErrors2 ? Diagnostics.Cannot_find_global_type_0 : void 0); + if (symbol) { + getDeclaredTypeOfSymbol(symbol); + if (length(getSymbolLinks(symbol).typeParameters) !== arity) { + const decl = symbol.declarations && find2(symbol.declarations, isTypeAliasDeclaration); + error22(decl, Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbolName(symbol), arity); + return void 0; + } + } + return symbol; + } + function getGlobalSymbol(name2, meaning, diagnostic) { + return resolveName( + /*location*/ + void 0, + name2, + meaning, + diagnostic, + name2, + /*isUse*/ + false, + /*excludeGlobals*/ + false, + /*getSpellingSuggestions*/ + false + ); + } + function getGlobalType(name2, arity, reportErrors2) { + const symbol = getGlobalTypeSymbol(name2, reportErrors2); + return symbol || reportErrors2 ? getTypeOfGlobalSymbol(symbol, arity) : void 0; + } + function getGlobalTypedPropertyDescriptorType() { + return deferredGlobalTypedPropertyDescriptorType || (deferredGlobalTypedPropertyDescriptorType = getGlobalType( + "TypedPropertyDescriptor", + /*arity*/ + 1, + /*reportErrors*/ + true + ) || emptyGenericType); + } + function getGlobalTemplateStringsArrayType() { + return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType( + "TemplateStringsArray", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || emptyObjectType); + } + function getGlobalImportMetaType() { + return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType( + "ImportMeta", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || emptyObjectType); + } + function getGlobalImportMetaExpressionType() { + if (!deferredGlobalImportMetaExpressionType) { + const symbol = createSymbol(0, "ImportMetaExpression"); + const importMetaType = getGlobalImportMetaType(); + const metaPropertySymbol = createSymbol( + 4, + "meta", + 8 + /* Readonly */ + ); + metaPropertySymbol.parent = symbol; + metaPropertySymbol.links.type = importMetaType; + const members = createSymbolTable([metaPropertySymbol]); + symbol.members = members; + deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); + } + return deferredGlobalImportMetaExpressionType; + } + function getGlobalImportCallOptionsType(reportErrors2) { + return deferredGlobalImportCallOptionsType || (deferredGlobalImportCallOptionsType = getGlobalType( + "ImportCallOptions", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalImportAttributesType(reportErrors2) { + return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType( + "ImportAttributes", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalESSymbolConstructorSymbol(reportErrors2) { + return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2)); + } + function getGlobalESSymbolConstructorTypeSymbol(reportErrors2) { + return deferredGlobalESSymbolConstructorTypeSymbol || (deferredGlobalESSymbolConstructorTypeSymbol = getGlobalTypeSymbol("SymbolConstructor", reportErrors2)); + } + function getGlobalESSymbolType() { + return deferredGlobalESSymbolType || (deferredGlobalESSymbolType = getGlobalType( + "Symbol", + /*arity*/ + 0, + /*reportErrors*/ + false + )) || emptyObjectType; + } + function getGlobalPromiseType(reportErrors2) { + return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType( + "Promise", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalPromiseLikeType(reportErrors2) { + return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType( + "PromiseLike", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors2) { + return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise", reportErrors2)); + } + function getGlobalPromiseConstructorLikeType(reportErrors2) { + return deferredGlobalPromiseConstructorLikeType || (deferredGlobalPromiseConstructorLikeType = getGlobalType( + "PromiseConstructorLike", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalAsyncIterableType(reportErrors2) { + return deferredGlobalAsyncIterableType || (deferredGlobalAsyncIterableType = getGlobalType( + "AsyncIterable", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalAsyncIteratorType(reportErrors2) { + return deferredGlobalAsyncIteratorType || (deferredGlobalAsyncIteratorType = getGlobalType( + "AsyncIterator", + /*arity*/ + 3, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalAsyncIterableIteratorType(reportErrors2) { + return deferredGlobalAsyncIterableIteratorType || (deferredGlobalAsyncIterableIteratorType = getGlobalType( + "AsyncIterableIterator", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalAsyncGeneratorType(reportErrors2) { + return deferredGlobalAsyncGeneratorType || (deferredGlobalAsyncGeneratorType = getGlobalType( + "AsyncGenerator", + /*arity*/ + 3, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalIterableType(reportErrors2) { + return deferredGlobalIterableType || (deferredGlobalIterableType = getGlobalType( + "Iterable", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalIteratorType(reportErrors2) { + return deferredGlobalIteratorType || (deferredGlobalIteratorType = getGlobalType( + "Iterator", + /*arity*/ + 3, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalIterableIteratorType(reportErrors2) { + return deferredGlobalIterableIteratorType || (deferredGlobalIterableIteratorType = getGlobalType( + "IterableIterator", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalGeneratorType(reportErrors2) { + return deferredGlobalGeneratorType || (deferredGlobalGeneratorType = getGlobalType( + "Generator", + /*arity*/ + 3, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalIteratorYieldResultType(reportErrors2) { + return deferredGlobalIteratorYieldResultType || (deferredGlobalIteratorYieldResultType = getGlobalType( + "IteratorYieldResult", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalIteratorReturnResultType(reportErrors2) { + return deferredGlobalIteratorReturnResultType || (deferredGlobalIteratorReturnResultType = getGlobalType( + "IteratorReturnResult", + /*arity*/ + 1, + reportErrors2 + )) || emptyGenericType; + } + function getGlobalDisposableType(reportErrors2) { + return deferredGlobalDisposableType || (deferredGlobalDisposableType = getGlobalType( + "Disposable", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalAsyncDisposableType(reportErrors2) { + return deferredGlobalAsyncDisposableType || (deferredGlobalAsyncDisposableType = getGlobalType( + "AsyncDisposable", + /*arity*/ + 0, + reportErrors2 + )) || emptyObjectType; + } + function getGlobalTypeOrUndefined(name2, arity = 0) { + const symbol = getGlobalSymbol( + name2, + 788968, + /*diagnostic*/ + void 0 + ); + return symbol && getTypeOfGlobalSymbol(symbol, arity); + } + function getGlobalExtractSymbol() { + deferredGlobalExtractSymbol || (deferredGlobalExtractSymbol = getGlobalTypeAliasSymbol( + "Extract", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalExtractSymbol === unknownSymbol ? void 0 : deferredGlobalExtractSymbol; + } + function getGlobalOmitSymbol() { + deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol( + "Omit", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalOmitSymbol === unknownSymbol ? void 0 : deferredGlobalOmitSymbol; + } + function getGlobalAwaitedSymbol(reportErrors2) { + deferredGlobalAwaitedSymbol || (deferredGlobalAwaitedSymbol = getGlobalTypeAliasSymbol( + "Awaited", + /*arity*/ + 1, + reportErrors2 + ) || (reportErrors2 ? unknownSymbol : void 0)); + return deferredGlobalAwaitedSymbol === unknownSymbol ? void 0 : deferredGlobalAwaitedSymbol; + } + function getGlobalBigIntType() { + return deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType( + "BigInt", + /*arity*/ + 0, + /*reportErrors*/ + false + )) || emptyObjectType; + } + function getGlobalClassDecoratorContextType(reportErrors2) { + return deferredGlobalClassDecoratorContextType ?? (deferredGlobalClassDecoratorContextType = getGlobalType( + "ClassDecoratorContext", + /*arity*/ + 1, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassMethodDecoratorContextType(reportErrors2) { + return deferredGlobalClassMethodDecoratorContextType ?? (deferredGlobalClassMethodDecoratorContextType = getGlobalType( + "ClassMethodDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassGetterDecoratorContextType(reportErrors2) { + return deferredGlobalClassGetterDecoratorContextType ?? (deferredGlobalClassGetterDecoratorContextType = getGlobalType( + "ClassGetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassSetterDecoratorContextType(reportErrors2) { + return deferredGlobalClassSetterDecoratorContextType ?? (deferredGlobalClassSetterDecoratorContextType = getGlobalType( + "ClassSetterDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassAccessorDecoratorContextType(reportErrors2) { + return deferredGlobalClassAccessorDecoratorContextType ?? (deferredGlobalClassAccessorDecoratorContextType = getGlobalType( + "ClassAccessorDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassAccessorDecoratorTargetType(reportErrors2) { + return deferredGlobalClassAccessorDecoratorTargetType ?? (deferredGlobalClassAccessorDecoratorTargetType = getGlobalType( + "ClassAccessorDecoratorTarget", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassAccessorDecoratorResultType(reportErrors2) { + return deferredGlobalClassAccessorDecoratorResultType ?? (deferredGlobalClassAccessorDecoratorResultType = getGlobalType( + "ClassAccessorDecoratorResult", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalClassFieldDecoratorContextType(reportErrors2) { + return deferredGlobalClassFieldDecoratorContextType ?? (deferredGlobalClassFieldDecoratorContextType = getGlobalType( + "ClassFieldDecoratorContext", + /*arity*/ + 2, + reportErrors2 + )) ?? emptyGenericType; + } + function getGlobalNaNSymbol() { + return deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol( + "NaN", + /*reportErrors*/ + false + )); + } + function getGlobalRecordSymbol() { + deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol( + "Record", + /*arity*/ + 2, + /*reportErrors*/ + true + ) || unknownSymbol); + return deferredGlobalRecordSymbol === unknownSymbol ? void 0 : deferredGlobalRecordSymbol; + } + function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) { + return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType; + } + function createTypedPropertyDescriptorType(propertyType) { + return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]); + } + function createIterableType(iteratedType) { + return createTypeFromGenericGlobalType(getGlobalIterableType( + /*reportErrors*/ + true + ), [iteratedType]); + } + function createArrayType(elementType, readonly) { + return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]); + } + function getTupleElementFlags(node) { + switch (node.kind) { + case 190: + return 2; + case 191: + return getRestTypeElementFlags(node); + case 202: + return node.questionToken ? 2 : node.dotDotDotToken ? getRestTypeElementFlags(node) : 1; + default: + return 1; + } + } + function getRestTypeElementFlags(node) { + return getArrayElementTypeNode(node.type) ? 4 : 8; + } + function getArrayOrTupleTargetType(node) { + const readonly = isReadonlyTypeOperator(node.parent); + const elementType = getArrayElementTypeNode(node); + if (elementType) { + return readonly ? globalReadonlyArrayType : globalArrayType; + } + const elementFlags = map4(node.elements, getTupleElementFlags); + return getTupleTargetType(elementFlags, readonly, map4(node.elements, memberIfLabeledElementDeclaration)); + } + function memberIfLabeledElementDeclaration(member) { + return isNamedTupleMember(member) || isParameter(member) ? member : void 0; + } + function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) { + return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 ? mayResolveTypeAlias(node.elementType) : node.kind === 189 ? some2(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some2(node.typeArguments, mayResolveTypeAlias)); + } + function isResolvedByTypeAlias(node) { + const parent22 = node.parent; + switch (parent22.kind) { + case 196: + case 202: + case 183: + case 192: + case 193: + case 199: + case 194: + case 198: + case 188: + case 189: + return isResolvedByTypeAlias(parent22); + case 265: + return true; + } + return false; + } + function mayResolveTypeAlias(node) { + switch (node.kind) { + case 183: + return isJSDocTypeReference(node) || !!(resolveTypeReferenceName( + node, + 788968 + /* Type */ + ).flags & 524288); + case 186: + return true; + case 198: + return node.operator !== 158 && mayResolveTypeAlias(node.type); + case 196: + case 190: + case 202: + case 323: + case 321: + case 322: + case 316: + return mayResolveTypeAlias(node.type); + case 191: + return node.type.kind !== 188 || mayResolveTypeAlias(node.type.elementType); + case 192: + case 193: + return some2(node.types, mayResolveTypeAlias); + case 199: + return mayResolveTypeAlias(node.objectType) || mayResolveTypeAlias(node.indexType); + case 194: + return mayResolveTypeAlias(node.checkType) || mayResolveTypeAlias(node.extendsType) || mayResolveTypeAlias(node.trueType) || mayResolveTypeAlias(node.falseType); + } + return false; + } + function getTypeFromArrayOrTupleTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const target = getArrayOrTupleTargetType(node); + if (target === emptyGenericType) { + links.resolvedType = emptyObjectType; + } else if (!(node.kind === 189 && some2(node.elements, (e10) => !!(getTupleElementFlags(e10) & 8))) && isDeferredTypeReferenceNode(node)) { + links.resolvedType = node.kind === 189 && node.elements.length === 0 ? target : createDeferredTypeReference( + target, + node, + /*mapper*/ + void 0 + ); + } else { + const elementTypes = node.kind === 188 ? [getTypeFromTypeNode(node.elementType)] : map4(node.elements, getTypeFromTypeNode); + links.resolvedType = createNormalizedTypeReference(target, elementTypes); + } + } + return links.resolvedType; + } + function isReadonlyTypeOperator(node) { + return isTypeOperatorNode(node) && node.operator === 148; + } + function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations = []) { + const tupleTarget = getTupleTargetType(elementFlags || map4( + elementTypes, + (_6) => 1 + /* Required */ + ), readonly, namedMemberDeclarations); + return tupleTarget === emptyGenericType ? emptyObjectType : elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) : tupleTarget; + } + function getTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { + if (elementFlags.length === 1 && elementFlags[0] & 4) { + return readonly ? globalReadonlyArrayType : globalArrayType; + } + const key = map4(elementFlags, (f8) => f8 & 1 ? "#" : f8 & 2 ? "?" : f8 & 4 ? "." : "*").join() + (readonly ? "R" : "") + (some2(namedMemberDeclarations, (node) => !!node) ? "," + map4(namedMemberDeclarations, (node) => node ? getNodeId(node) : "_").join(",") : ""); + let type3 = tupleTypes.get(key); + if (!type3) { + tupleTypes.set(key, type3 = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations)); + } + return type3; + } + function createTupleTargetType(elementFlags, readonly, namedMemberDeclarations) { + const arity = elementFlags.length; + const minLength = countWhere(elementFlags, (f8) => !!(f8 & (1 | 8))); + let typeParameters; + const properties = []; + let combinedFlags = 0; + if (arity) { + typeParameters = new Array(arity); + for (let i7 = 0; i7 < arity; i7++) { + const typeParameter = typeParameters[i7] = createTypeParameter(); + const flags = elementFlags[i7]; + combinedFlags |= flags; + if (!(combinedFlags & 12)) { + const property2 = createSymbol(4 | (flags & 2 ? 16777216 : 0), "" + i7, readonly ? 8 : 0); + property2.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i7]; + property2.links.type = typeParameter; + properties.push(property2); + } + } + } + const fixedLength = properties.length; + const lengthSymbol = createSymbol(4, "length", readonly ? 8 : 0); + if (combinedFlags & 12) { + lengthSymbol.links.type = numberType2; + } else { + const literalTypes = []; + for (let i7 = minLength; i7 <= arity; i7++) + literalTypes.push(getNumberLiteralType(i7)); + lengthSymbol.links.type = getUnionType(literalTypes); + } + properties.push(lengthSymbol); + const type3 = createObjectType( + 8 | 4 + /* Reference */ + ); + type3.typeParameters = typeParameters; + type3.outerTypeParameters = void 0; + type3.localTypeParameters = typeParameters; + type3.instantiations = /* @__PURE__ */ new Map(); + type3.instantiations.set(getTypeListId(type3.typeParameters), type3); + type3.target = type3; + type3.resolvedTypeArguments = type3.typeParameters; + type3.thisType = createTypeParameter(); + type3.thisType.isThisType = true; + type3.thisType.constraint = type3; + type3.declaredProperties = properties; + type3.declaredCallSignatures = emptyArray; + type3.declaredConstructSignatures = emptyArray; + type3.declaredIndexInfos = emptyArray; + type3.elementFlags = elementFlags; + type3.minLength = minLength; + type3.fixedLength = fixedLength; + type3.hasRestElement = !!(combinedFlags & 12); + type3.combinedFlags = combinedFlags; + type3.readonly = readonly; + type3.labeledElementDeclarations = namedMemberDeclarations; + return type3; + } + function createNormalizedTypeReference(target, typeArguments) { + return target.objectFlags & 8 ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments); + } + function createNormalizedTupleType(target, elementTypes) { + var _a2, _b, _c, _d; + if (!(target.combinedFlags & 14)) { + return createTypeReference(target, elementTypes); + } + if (target.combinedFlags & 8) { + const unionIndex = findIndex2(elementTypes, (t8, i7) => !!(target.elementFlags[i7] & 8 && t8.flags & (131072 | 1048576))); + if (unionIndex >= 0) { + return checkCrossProductUnion(map4(elementTypes, (t8, i7) => target.elementFlags[i7] & 8 ? t8 : unknownType2)) ? mapType2(elementTypes[unionIndex], (t8) => createNormalizedTupleType(target, replaceElement(elementTypes, unionIndex, t8))) : errorType; + } + } + const expandedTypes = []; + const expandedFlags = []; + const expandedDeclarations = []; + let lastRequiredIndex = -1; + let firstRestIndex = -1; + let lastOptionalOrRestIndex = -1; + for (let i7 = 0; i7 < elementTypes.length; i7++) { + const type3 = elementTypes[i7]; + const flags = target.elementFlags[i7]; + if (flags & 8) { + if (type3.flags & 1) { + addElement(type3, 4, (_a2 = target.labeledElementDeclarations) == null ? void 0 : _a2[i7]); + } else if (type3.flags & 58982400 || isGenericMappedType(type3)) { + addElement(type3, 8, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i7]); + } else if (isTupleType(type3)) { + const elements = getElementTypes(type3); + if (elements.length + expandedTypes.length >= 1e4) { + error22( + currentNode, + isPartOfTypeNode(currentNode) ? Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent : Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent + ); + return errorType; + } + forEach4(elements, (t8, n7) => { + var _a22; + return addElement(t8, type3.target.elementFlags[n7], (_a22 = type3.target.labeledElementDeclarations) == null ? void 0 : _a22[n7]); + }); + } else { + addElement(isArrayLikeType(type3) && getIndexTypeOfType(type3, numberType2) || errorType, 4, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i7]); + } + } else { + addElement(type3, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i7]); + } + } + for (let i7 = 0; i7 < lastRequiredIndex; i7++) { + if (expandedFlags[i7] & 2) + expandedFlags[i7] = 1; + } + if (firstRestIndex >= 0 && firstRestIndex < lastOptionalOrRestIndex) { + expandedTypes[firstRestIndex] = getUnionType(sameMap(expandedTypes.slice(firstRestIndex, lastOptionalOrRestIndex + 1), (t8, i7) => expandedFlags[firstRestIndex + i7] & 8 ? getIndexedAccessType(t8, numberType2) : t8)); + expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex); + } + const tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations); + return tupleTarget === emptyGenericType ? emptyObjectType : expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) : tupleTarget; + function addElement(type3, flags, declaration) { + if (flags & 1) { + lastRequiredIndex = expandedFlags.length; + } + if (flags & 4 && firstRestIndex < 0) { + firstRestIndex = expandedFlags.length; + } + if (flags & (2 | 4)) { + lastOptionalOrRestIndex = expandedFlags.length; + } + expandedTypes.push(flags & 2 ? addOptionality( + type3, + /*isProperty*/ + true + ) : type3); + expandedFlags.push(flags); + expandedDeclarations.push(declaration); + } + } + function sliceTupleType(type3, index4, endSkipCount = 0) { + const target = type3.target; + const endIndex = getTypeReferenceArity(type3) - endSkipCount; + return index4 > target.fixedLength ? getRestArrayTypeOfTupleType(type3) || createTupleType(emptyArray) : createTupleType( + getTypeArguments(type3).slice(index4, endIndex), + target.elementFlags.slice(index4, endIndex), + /*readonly*/ + false, + target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index4, endIndex) + ); + } + function getKnownKeysOfTupleType(type3) { + return getUnionType(append(arrayOf(type3.target.fixedLength, (i7) => getStringLiteralType("" + i7)), getIndexType(type3.target.readonly ? globalReadonlyArrayType : globalArrayType))); + } + function getStartElementCount(type3, flags) { + const index4 = findIndex2(type3.elementFlags, (f8) => !(f8 & flags)); + return index4 >= 0 ? index4 : type3.elementFlags.length; + } + function getEndElementCount(type3, flags) { + return type3.elementFlags.length - findLastIndex2(type3.elementFlags, (f8) => !(f8 & flags)) - 1; + } + function getTotalFixedElementCount(type3) { + return type3.fixedLength + getEndElementCount( + type3, + 3 + /* Fixed */ + ); + } + function getElementTypes(type3) { + const typeArguments = getTypeArguments(type3); + const arity = getTypeReferenceArity(type3); + return typeArguments.length === arity ? typeArguments : typeArguments.slice(0, arity); + } + function getTypeFromOptionalTypeNode(node) { + return addOptionality( + getTypeFromTypeNode(node.type), + /*isProperty*/ + true + ); + } + function getTypeId(type3) { + return type3.id; + } + function containsType(types3, type3) { + return binarySearch(types3, type3, getTypeId, compareValues) >= 0; + } + function insertType(types3, type3) { + const index4 = binarySearch(types3, type3, getTypeId, compareValues); + if (index4 < 0) { + types3.splice(~index4, 0, type3); + return true; + } + return false; + } + function addTypeToUnion(typeSet, includes2, type3) { + const flags = type3.flags; + if (!(flags & 131072)) { + includes2 |= flags & 473694207; + if (flags & 465829888) + includes2 |= 33554432; + if (flags & 2097152 && getObjectFlags(type3) & 67108864) + includes2 |= 536870912; + if (type3 === wildcardType) + includes2 |= 8388608; + if (!strictNullChecks && flags & 98304) { + if (!(getObjectFlags(type3) & 65536)) + includes2 |= 4194304; + } else { + const len = typeSet.length; + const index4 = len && type3.id > typeSet[len - 1].id ? ~len : binarySearch(typeSet, type3, getTypeId, compareValues); + if (index4 < 0) { + typeSet.splice(~index4, 0, type3); + } + } + } + return includes2; + } + function addTypesToUnion(typeSet, includes2, types3) { + let lastType; + for (const type3 of types3) { + if (type3 !== lastType) { + includes2 = type3.flags & 1048576 ? addTypesToUnion(typeSet, includes2 | (isNamedUnionType(type3) ? 1048576 : 0), type3.types) : addTypeToUnion(typeSet, includes2, type3); + lastType = type3; + } + } + return includes2; + } + function removeSubtypes(types3, hasObjectTypes) { + var _a2; + if (types3.length < 2) { + return types3; + } + const id = getTypeListId(types3); + const match = subtypeReductionCache.get(id); + if (match) { + return match; + } + const hasEmptyObject = hasObjectTypes && some2(types3, (t8) => !!(t8.flags & 524288) && !isGenericMappedType(t8) && isEmptyResolvedType(resolveStructuredTypeMembers(t8))); + const len = types3.length; + let i7 = len; + let count2 = 0; + while (i7 > 0) { + i7--; + const source = types3[i7]; + if (hasEmptyObject || source.flags & 469499904) { + if (source.flags & 262144 && getBaseConstraintOrType(source).flags & 1048576) { + if (isTypeRelatedTo(source, getUnionType(map4(types3, (t8) => t8 === source ? neverType2 : t8)), strictSubtypeRelation)) { + orderedRemoveItemAt(types3, i7); + } + continue; + } + const keyProperty = source.flags & (524288 | 2097152 | 58982400) ? find2(getPropertiesOfType(source), (p7) => isUnitType(getTypeOfSymbol(p7))) : void 0; + const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty)); + for (const target of types3) { + if (source !== target) { + if (count2 === 1e5) { + const estimatedCount = count2 / (len - i7) * len; + if (estimatedCount > 1e6) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "removeSubtypes_DepthLimit", { typeIds: types3.map((t8) => t8.id) }); + error22(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + return void 0; + } + } + count2++; + if (keyProperty && target.flags & (524288 | 2097152 | 58982400)) { + const t8 = getTypeOfPropertyOfType(target, keyProperty.escapedName); + if (t8 && isUnitType(t8) && getRegularTypeOfLiteralType(t8) !== keyPropertyType) { + continue; + } + } + if (isTypeRelatedTo(source, target, strictSubtypeRelation) && (!(getObjectFlags(getTargetType(source)) & 1) || !(getObjectFlags(getTargetType(target)) & 1) || isTypeDerivedFrom(source, target))) { + orderedRemoveItemAt(types3, i7); + break; + } + } + } + } + } + subtypeReductionCache.set(id, types3); + return types3; + } + function removeRedundantLiteralTypes(types3, includes2, reduceVoidUndefined) { + let i7 = types3.length; + while (i7 > 0) { + i7--; + const t8 = types3[i7]; + const flags = t8.flags; + const remove2 = flags & (128 | 134217728 | 268435456) && includes2 & 4 || flags & 256 && includes2 & 8 || flags & 2048 && includes2 & 64 || flags & 8192 && includes2 & 4096 || reduceVoidUndefined && flags & 32768 && includes2 & 16384 || isFreshLiteralType(t8) && containsType(types3, t8.regularType); + if (remove2) { + orderedRemoveItemAt(types3, i7); + } + } + } + function removeStringLiteralsMatchedByTemplateLiterals(types3) { + const templates = filter2(types3, isPatternLiteralType); + if (templates.length) { + let i7 = types3.length; + while (i7 > 0) { + i7--; + const t8 = types3[i7]; + if (t8.flags & 128 && some2(templates, (template2) => isTypeMatchedByTemplateLiteralOrStringMapping(t8, template2))) { + orderedRemoveItemAt(types3, i7); + } + } + } + } + function isTypeMatchedByTemplateLiteralOrStringMapping(type3, template2) { + return template2.flags & 134217728 ? isTypeMatchedByTemplateLiteralType(type3, template2) : isMemberOfStringMapping(type3, template2); + } + function removeConstrainedTypeVariables(types3) { + const typeVariables = []; + for (const type3 of types3) { + if (type3.flags & 2097152 && getObjectFlags(type3) & 67108864) { + const index4 = type3.types[0].flags & 8650752 ? 0 : 1; + pushIfUnique(typeVariables, type3.types[index4]); + } + } + for (const typeVariable of typeVariables) { + const primitives = []; + for (const type3 of types3) { + if (type3.flags & 2097152 && getObjectFlags(type3) & 67108864) { + const index4 = type3.types[0].flags & 8650752 ? 0 : 1; + if (type3.types[index4] === typeVariable) { + insertType(primitives, type3.types[1 - index4]); + } + } + } + const constraint = getBaseConstraintOfType(typeVariable); + if (everyType(constraint, (t8) => containsType(primitives, t8))) { + let i7 = types3.length; + while (i7 > 0) { + i7--; + const type3 = types3[i7]; + if (type3.flags & 2097152 && getObjectFlags(type3) & 67108864) { + const index4 = type3.types[0].flags & 8650752 ? 0 : 1; + if (type3.types[index4] === typeVariable && containsType(primitives, type3.types[1 - index4])) { + orderedRemoveItemAt(types3, i7); + } + } + } + insertType(types3, typeVariable); + } + } + } + function isNamedUnionType(type3) { + return !!(type3.flags & 1048576 && (type3.aliasSymbol || type3.origin)); + } + function addNamedUnions(namedUnions, types3) { + for (const t8 of types3) { + if (t8.flags & 1048576) { + const origin = t8.origin; + if (t8.aliasSymbol || origin && !(origin.flags & 1048576)) { + pushIfUnique(namedUnions, t8); + } else if (origin && origin.flags & 1048576) { + addNamedUnions(namedUnions, origin.types); + } + } + } + } + function createOriginUnionOrIntersectionType(flags, types3) { + const result2 = createOriginType(flags); + result2.types = types3; + return result2; + } + function getUnionType(types3, unionReduction = 1, aliasSymbol, aliasTypeArguments, origin) { + if (types3.length === 0) { + return neverType2; + } + if (types3.length === 1) { + return types3[0]; + } + if (types3.length === 2 && !origin && (types3[0].flags & 1048576 || types3[1].flags & 1048576)) { + const infix = unionReduction === 0 ? "N" : unionReduction === 2 ? "S" : "L"; + const index4 = types3[0].id < types3[1].id ? 0 : 1; + const id = types3[index4].id + infix + types3[1 - index4].id + getAliasId(aliasSymbol, aliasTypeArguments); + let type3 = unionOfUnionTypes.get(id); + if (!type3) { + type3 = getUnionTypeWorker( + types3, + unionReduction, + aliasSymbol, + aliasTypeArguments, + /*origin*/ + void 0 + ); + unionOfUnionTypes.set(id, type3); + } + return type3; + } + return getUnionTypeWorker(types3, unionReduction, aliasSymbol, aliasTypeArguments, origin); + } + function getUnionTypeWorker(types3, unionReduction, aliasSymbol, aliasTypeArguments, origin) { + let typeSet = []; + const includes2 = addTypesToUnion(typeSet, 0, types3); + if (unionReduction !== 0) { + if (includes2 & 3) { + return includes2 & 1 ? includes2 & 8388608 ? wildcardType : anyType2 : includes2 & 65536 || containsType(typeSet, unknownType2) ? unknownType2 : nonNullUnknownType; + } + if (includes2 & 32768) { + if (typeSet.length >= 2 && typeSet[0] === undefinedType2 && typeSet[1] === missingType) { + orderedRemoveItemAt(typeSet, 1); + } + } + if (includes2 & (32 | 2944 | 8192 | 134217728 | 268435456) || includes2 & 16384 && includes2 & 32768) { + removeRedundantLiteralTypes(typeSet, includes2, !!(unionReduction & 2)); + } + if (includes2 & 128 && includes2 & (134217728 | 268435456)) { + removeStringLiteralsMatchedByTemplateLiterals(typeSet); + } + if (includes2 & 536870912) { + removeConstrainedTypeVariables(typeSet); + } + if (unionReduction === 2) { + typeSet = removeSubtypes(typeSet, !!(includes2 & 524288)); + if (!typeSet) { + return errorType; + } + } + if (typeSet.length === 0) { + return includes2 & 65536 ? includes2 & 4194304 ? nullType2 : nullWideningType : includes2 & 32768 ? includes2 & 4194304 ? undefinedType2 : undefinedWideningType : neverType2; + } + } + if (!origin && includes2 & 1048576) { + const namedUnions = []; + addNamedUnions(namedUnions, types3); + const reducedTypes = []; + for (const t8 of typeSet) { + if (!some2(namedUnions, (union2) => containsType(union2.types, t8))) { + reducedTypes.push(t8); + } + } + if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) { + return namedUnions[0]; + } + const namedTypesCount = reduceLeft(namedUnions, (sum2, union2) => sum2 + union2.types.length, 0); + if (namedTypesCount + reducedTypes.length === typeSet.length) { + for (const t8 of namedUnions) { + insertType(reducedTypes, t8); + } + origin = createOriginUnionOrIntersectionType(1048576, reducedTypes); + } + } + const objectFlags = (includes2 & 36323331 ? 0 : 32768) | (includes2 & 2097152 ? 16777216 : 0); + return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin); + } + function getUnionOrIntersectionTypePredicate(signatures, kind) { + let last22; + const types3 = []; + for (const sig of signatures) { + const pred = getTypePredicateOfSignature(sig); + if (pred) { + if (pred.kind !== 0 && pred.kind !== 1 || last22 && !typePredicateKindsMatch(last22, pred)) { + return void 0; + } + last22 = pred; + types3.push(pred.type); + } else { + const returnType = kind !== 2097152 ? getReturnTypeOfSignature(sig) : void 0; + if (returnType !== falseType && returnType !== regularFalseType) { + return void 0; + } + } + } + if (!last22) { + return void 0; + } + const compositeType = getUnionOrIntersectionType(types3, kind); + return createTypePredicate(last22.kind, last22.parameterName, last22.parameterIndex, compositeType); + } + function typePredicateKindsMatch(a7, b8) { + return a7.kind === b8.kind && a7.parameterIndex === b8.parameterIndex; + } + function getUnionTypeFromSortedList(types3, precomputedObjectFlags, aliasSymbol, aliasTypeArguments, origin) { + if (types3.length === 0) { + return neverType2; + } + if (types3.length === 1) { + return types3[0]; + } + const typeKey = !origin ? getTypeListId(types3) : origin.flags & 1048576 ? `|${getTypeListId(origin.types)}` : origin.flags & 2097152 ? `&${getTypeListId(origin.types)}` : `#${origin.type.id}|${getTypeListId(types3)}`; + const id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments); + let type3 = unionTypes.get(id); + if (!type3) { + type3 = createType( + 1048576 + /* Union */ + ); + type3.objectFlags = precomputedObjectFlags | getPropagatingFlagsOfTypes( + types3, + /*excludeKinds*/ + 98304 + /* Nullable */ + ); + type3.types = types3; + type3.origin = origin; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + if (types3.length === 2 && types3[0].flags & 512 && types3[1].flags & 512) { + type3.flags |= 16; + type3.intrinsicName = "boolean"; + } + unionTypes.set(id, type3); + } + return type3; + } + function getTypeFromUnionTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const aliasSymbol = getAliasSymbolForTypeNode(node); + links.resolvedType = getUnionType(map4(node.types, getTypeFromTypeNode), 1, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol)); + } + return links.resolvedType; + } + function addTypeToIntersection(typeSet, includes2, type3) { + const flags = type3.flags; + if (flags & 2097152) { + return addTypesToIntersection(typeSet, includes2, type3.types); + } + if (isEmptyAnonymousObjectType(type3)) { + if (!(includes2 & 16777216)) { + includes2 |= 16777216; + typeSet.set(type3.id.toString(), type3); + } + } else { + if (flags & 3) { + if (type3 === wildcardType) + includes2 |= 8388608; + } else if (strictNullChecks || !(flags & 98304)) { + if (type3 === missingType) { + includes2 |= 262144; + type3 = undefinedType2; + } + if (!typeSet.has(type3.id.toString())) { + if (type3.flags & 109472 && includes2 & 109472) { + includes2 |= 67108864; + } + typeSet.set(type3.id.toString(), type3); + } + } + includes2 |= flags & 473694207; + } + return includes2; + } + function addTypesToIntersection(typeSet, includes2, types3) { + for (const type3 of types3) { + includes2 = addTypeToIntersection(typeSet, includes2, getRegularTypeOfLiteralType(type3)); + } + return includes2; + } + function removeRedundantSupertypes(types3, includes2) { + let i7 = types3.length; + while (i7 > 0) { + i7--; + const t8 = types3[i7]; + const remove2 = t8.flags & 4 && includes2 & (128 | 134217728 | 268435456) || t8.flags & 8 && includes2 & 256 || t8.flags & 64 && includes2 & 2048 || t8.flags & 4096 && includes2 & 8192 || t8.flags & 16384 && includes2 & 32768 || isEmptyAnonymousObjectType(t8) && includes2 & 470302716; + if (remove2) { + orderedRemoveItemAt(types3, i7); + } + } + } + function eachUnionContains(unionTypes2, type3) { + for (const u7 of unionTypes2) { + if (!containsType(u7.types, type3)) { + const primitive = type3.flags & 128 ? stringType2 : type3.flags & (32 | 256) ? numberType2 : type3.flags & 2048 ? bigintType : type3.flags & 8192 ? esSymbolType : void 0; + if (!primitive || !containsType(u7.types, primitive)) { + return false; + } + } + } + return true; + } + function extractRedundantTemplateLiterals(types3) { + let i7 = types3.length; + const literals = filter2(types3, (t8) => !!(t8.flags & 128)); + while (i7 > 0) { + i7--; + const t8 = types3[i7]; + if (!(t8.flags & (134217728 | 268435456))) + continue; + for (const t22 of literals) { + if (isTypeSubtypeOf(t22, t8)) { + orderedRemoveItemAt(types3, i7); + break; + } else if (isPatternLiteralType(t8)) { + return true; + } + } + } + return false; + } + function removeFromEach(types3, flag) { + for (let i7 = 0; i7 < types3.length; i7++) { + types3[i7] = filterType(types3[i7], (t8) => !(t8.flags & flag)); + } + } + function intersectUnionsOfPrimitiveTypes(types3) { + let unionTypes2; + const index4 = findIndex2(types3, (t8) => !!(getObjectFlags(t8) & 32768)); + if (index4 < 0) { + return false; + } + let i7 = index4 + 1; + while (i7 < types3.length) { + const t8 = types3[i7]; + if (getObjectFlags(t8) & 32768) { + (unionTypes2 || (unionTypes2 = [types3[index4]])).push(t8); + orderedRemoveItemAt(types3, i7); + } else { + i7++; + } + } + if (!unionTypes2) { + return false; + } + const checked = []; + const result2 = []; + for (const u7 of unionTypes2) { + for (const t8 of u7.types) { + if (insertType(checked, t8)) { + if (eachUnionContains(unionTypes2, t8)) { + insertType(result2, t8); + } + } + } + } + types3[index4] = getUnionTypeFromSortedList( + result2, + 32768 + /* PrimitiveUnion */ + ); + return true; + } + function createIntersectionType(types3, objectFlags, aliasSymbol, aliasTypeArguments) { + const result2 = createType( + 2097152 + /* Intersection */ + ); + result2.objectFlags = objectFlags | getPropagatingFlagsOfTypes( + types3, + /*excludeKinds*/ + 98304 + /* Nullable */ + ); + result2.types = types3; + result2.aliasSymbol = aliasSymbol; + result2.aliasTypeArguments = aliasTypeArguments; + return result2; + } + function getIntersectionType(types3, aliasSymbol, aliasTypeArguments, noSupertypeReduction) { + const typeMembershipMap = /* @__PURE__ */ new Map(); + const includes2 = addTypesToIntersection(typeMembershipMap, 0, types3); + const typeSet = arrayFrom(typeMembershipMap.values()); + let objectFlags = 0; + if (includes2 & 131072) { + return contains2(typeSet, silentNeverType) ? silentNeverType : neverType2; + } + if (strictNullChecks && includes2 & 98304 && includes2 & (524288 | 67108864 | 16777216) || includes2 & 67108864 && includes2 & (469892092 & ~67108864) || includes2 & 402653316 && includes2 & (469892092 & ~402653316) || includes2 & 296 && includes2 & (469892092 & ~296) || includes2 & 2112 && includes2 & (469892092 & ~2112) || includes2 & 12288 && includes2 & (469892092 & ~12288) || includes2 & 49152 && includes2 & (469892092 & ~49152)) { + return neverType2; + } + if (includes2 & (134217728 | 268435456) && includes2 & 128 && extractRedundantTemplateLiterals(typeSet)) { + return neverType2; + } + if (includes2 & 1) { + return includes2 & 8388608 ? wildcardType : anyType2; + } + if (!strictNullChecks && includes2 & 98304) { + return includes2 & 16777216 ? neverType2 : includes2 & 32768 ? undefinedType2 : nullType2; + } + if (includes2 & 4 && includes2 & (128 | 134217728 | 268435456) || includes2 & 8 && includes2 & 256 || includes2 & 64 && includes2 & 2048 || includes2 & 4096 && includes2 & 8192 || includes2 & 16384 && includes2 & 32768 || includes2 & 16777216 && includes2 & 470302716) { + if (!noSupertypeReduction) + removeRedundantSupertypes(typeSet, includes2); + } + if (includes2 & 262144) { + typeSet[typeSet.indexOf(undefinedType2)] = missingType; + } + if (typeSet.length === 0) { + return unknownType2; + } + if (typeSet.length === 1) { + return typeSet[0]; + } + if (typeSet.length === 2) { + const typeVarIndex = typeSet[0].flags & 8650752 ? 0 : 1; + const typeVariable = typeSet[typeVarIndex]; + const primitiveType = typeSet[1 - typeVarIndex]; + if (typeVariable.flags & 8650752 && (primitiveType.flags & (402784252 | 67108864) && !isGenericStringLikeType(primitiveType) || includes2 & 16777216)) { + const constraint = getBaseConstraintOfType(typeVariable); + if (constraint && everyType(constraint, (t8) => !!(t8.flags & (402784252 | 67108864)) || isEmptyAnonymousObjectType(t8))) { + if (isTypeStrictSubtypeOf(constraint, primitiveType)) { + return typeVariable; + } + if (!(constraint.flags & 1048576 && someType(constraint, (c7) => isTypeStrictSubtypeOf(c7, primitiveType)))) { + if (!isTypeStrictSubtypeOf(primitiveType, constraint)) { + return neverType2; + } + } + objectFlags = 67108864; + } + } + } + const id = getTypeListId(typeSet) + getAliasId(aliasSymbol, aliasTypeArguments); + let result2 = intersectionTypes.get(id); + if (!result2) { + if (includes2 & 1048576) { + if (intersectUnionsOfPrimitiveTypes(typeSet)) { + result2 = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments); + } else if (every2(typeSet, (t8) => !!(t8.flags & 1048576 && t8.types[0].flags & 32768))) { + const containedUndefinedType = some2(typeSet, containsMissingType) ? missingType : undefinedType2; + removeFromEach( + typeSet, + 32768 + /* Undefined */ + ); + result2 = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1, aliasSymbol, aliasTypeArguments); + } else if (every2(typeSet, (t8) => !!(t8.flags & 1048576 && (t8.types[0].flags & 65536 || t8.types[1].flags & 65536)))) { + removeFromEach( + typeSet, + 65536 + /* Null */ + ); + result2 = getUnionType([getIntersectionType(typeSet), nullType2], 1, aliasSymbol, aliasTypeArguments); + } else if (typeSet.length >= 4) { + const middle = Math.floor(typeSet.length / 2); + result2 = getIntersectionType([getIntersectionType(typeSet.slice(0, middle)), getIntersectionType(typeSet.slice(middle))], aliasSymbol, aliasTypeArguments); + } else { + if (!checkCrossProductUnion(typeSet)) { + return errorType; + } + const constituents = getCrossProductIntersections(typeSet); + const origin = some2(constituents, (t8) => !!(t8.flags & 2097152)) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152, typeSet) : void 0; + result2 = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin); + } + } else { + result2 = createIntersectionType(typeSet, objectFlags, aliasSymbol, aliasTypeArguments); + } + intersectionTypes.set(id, result2); + } + return result2; + } + function getCrossProductUnionSize(types3) { + return reduceLeft(types3, (n7, t8) => t8.flags & 1048576 ? n7 * t8.types.length : t8.flags & 131072 ? 0 : n7, 1); + } + function checkCrossProductUnion(types3) { + var _a2; + const size2 = getCrossProductUnionSize(types3); + if (size2 >= 1e5) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "checkCrossProductUnion_DepthLimit", { typeIds: types3.map((t8) => t8.id), size: size2 }); + error22(currentNode, Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent); + return false; + } + return true; + } + function getCrossProductIntersections(types3) { + const count2 = getCrossProductUnionSize(types3); + const intersections = []; + for (let i7 = 0; i7 < count2; i7++) { + const constituents = types3.slice(); + let n7 = i7; + for (let j6 = types3.length - 1; j6 >= 0; j6--) { + if (types3[j6].flags & 1048576) { + const sourceTypes = types3[j6].types; + const length2 = sourceTypes.length; + constituents[j6] = sourceTypes[n7 % length2]; + n7 = Math.floor(n7 / length2); + } + } + const t8 = getIntersectionType(constituents); + if (!(t8.flags & 131072)) + intersections.push(t8); + } + return intersections; + } + function getConstituentCount(type3) { + return !(type3.flags & 3145728) || type3.aliasSymbol ? 1 : type3.flags & 1048576 && type3.origin ? getConstituentCount(type3.origin) : getConstituentCountOfTypes(type3.types); + } + function getConstituentCountOfTypes(types3) { + return reduceLeft(types3, (n7, t8) => n7 + getConstituentCount(t8), 0); + } + function getTypeFromIntersectionTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const aliasSymbol = getAliasSymbolForTypeNode(node); + const types3 = map4(node.types, getTypeFromTypeNode); + const emptyIndex = types3.length === 2 ? types3.indexOf(emptyTypeLiteralType) : -1; + const t8 = emptyIndex >= 0 ? types3[1 - emptyIndex] : unknownType2; + const noSupertypeReduction = !!(t8.flags & (4 | 8 | 64) || t8.flags & 134217728 && isPatternLiteralType(t8)); + links.resolvedType = getIntersectionType(types3, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction); + } + return links.resolvedType; + } + function createIndexType(type3, indexFlags) { + const result2 = createType( + 4194304 + /* Index */ + ); + result2.type = type3; + result2.indexFlags = indexFlags; + return result2; + } + function createOriginIndexType(type3) { + const result2 = createOriginType( + 4194304 + /* Index */ + ); + result2.type = type3; + return result2; + } + function getIndexTypeForGenericType(type3, indexFlags) { + return indexFlags & 1 ? type3.resolvedStringIndexType || (type3.resolvedStringIndexType = createIndexType( + type3, + 1 + /* StringsOnly */ + )) : type3.resolvedIndexType || (type3.resolvedIndexType = createIndexType( + type3, + 0 + /* None */ + )); + } + function getIndexTypeForMappedType(type3, indexFlags) { + const typeParameter = getTypeParameterFromMappedType(type3); + const constraintType = getConstraintTypeFromMappedType(type3); + const nameType = getNameTypeFromMappedType(type3.target || type3); + if (!nameType && !(indexFlags & 2)) { + return constraintType; + } + const keyTypes = []; + if (isGenericIndexType(constraintType)) { + if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + return getIndexTypeForGenericType(type3, indexFlags); + } + forEachType(constraintType, addMemberForKeyType); + } else if (isMappedTypeWithKeyofConstraintDeclaration(type3)) { + const modifiersType = getApparentType(getModifiersTypeFromMappedType(type3)); + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, !!(indexFlags & 1), addMemberForKeyType); + } else { + forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType); + } + const result2 = indexFlags & 2 ? filterType(getUnionType(keyTypes), (t8) => !(t8.flags & (1 | 4))) : getUnionType(keyTypes); + if (result2.flags & 1048576 && constraintType.flags & 1048576 && getTypeListId(result2.types) === getTypeListId(constraintType.types)) { + return constraintType; + } + return result2; + function addMemberForKeyType(keyType) { + const propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type3.mapper, typeParameter, keyType)) : keyType; + keyTypes.push(propNameType === stringType2 ? stringOrNumberType : propNameType); + } + } + function hasDistributiveNameType(mappedType) { + const typeVariable = getTypeParameterFromMappedType(mappedType); + return isDistributive(getNameTypeFromMappedType(mappedType) || typeVariable); + function isDistributive(type3) { + return type3.flags & (3 | 402784252 | 131072 | 262144 | 524288 | 67108864) ? true : type3.flags & 16777216 ? type3.root.isDistributive && type3.checkType === typeVariable : type3.flags & (3145728 | 134217728) ? every2(type3.types, isDistributive) : type3.flags & 8388608 ? isDistributive(type3.objectType) && isDistributive(type3.indexType) : type3.flags & 33554432 ? isDistributive(type3.baseType) && isDistributive(type3.constraint) : type3.flags & 268435456 ? isDistributive(type3.type) : false; + } + } + function getLiteralTypeFromPropertyName(name2) { + if (isPrivateIdentifier(name2)) { + return neverType2; + } + if (isNumericLiteral(name2)) { + return getRegularTypeOfLiteralType(checkExpression(name2)); + } + if (isComputedPropertyName(name2)) { + return getRegularTypeOfLiteralType(checkComputedPropertyName(name2)); + } + const propertyName = getPropertyNameForPropertyNameNode(name2); + if (propertyName !== void 0) { + return getStringLiteralType(unescapeLeadingUnderscores(propertyName)); + } + if (isExpression(name2)) { + return getRegularTypeOfLiteralType(checkExpression(name2)); + } + return neverType2; + } + function getLiteralTypeFromProperty(prop, include, includeNonPublic) { + if (includeNonPublic || !(getDeclarationModifierFlagsFromSymbol(prop) & 6)) { + let type3 = getSymbolLinks(getLateBoundSymbol(prop)).nameType; + if (!type3) { + const name2 = getNameOfDeclaration(prop.valueDeclaration); + type3 = prop.escapedName === "default" ? getStringLiteralType("default") : name2 && getLiteralTypeFromPropertyName(name2) || (!isKnownSymbol(prop) ? getStringLiteralType(symbolName(prop)) : void 0); + } + if (type3 && type3.flags & include) { + return type3; + } + } + return neverType2; + } + function isKeyTypeIncluded(keyType, include) { + return !!(keyType.flags & include || keyType.flags & 2097152 && some2(keyType.types, (t8) => isKeyTypeIncluded(t8, include))); + } + function getLiteralTypeFromProperties(type3, include, includeOrigin) { + const origin = includeOrigin && (getObjectFlags(type3) & (3 | 4) || type3.aliasSymbol) ? createOriginIndexType(type3) : void 0; + const propertyTypes = map4(getPropertiesOfType(type3), (prop) => getLiteralTypeFromProperty(prop, include)); + const indexKeyTypes = map4(getIndexInfosOfType(type3), (info2) => info2 !== enumNumberIndexInfo && isKeyTypeIncluded(info2.keyType, include) ? info2.keyType === stringType2 && include & 8 ? stringOrNumberType : info2.keyType : neverType2); + return getUnionType( + concatenate(propertyTypes, indexKeyTypes), + 1, + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0, + origin + ); + } + function shouldDeferIndexType(type3, indexFlags = 0) { + return !!(type3.flags & 58982400 || isGenericTupleType(type3) || isGenericMappedType(type3) && (!hasDistributiveNameType(type3) || getMappedTypeNameTypeKind(type3) === 2) || type3.flags & 1048576 && !(indexFlags & 4) && isGenericReducibleType(type3) || type3.flags & 2097152 && maybeTypeOfKind( + type3, + 465829888 + /* Instantiable */ + ) && some2(type3.types, isEmptyAnonymousObjectType)); + } + function getIndexType(type3, indexFlags = defaultIndexFlags) { + type3 = getReducedType(type3); + return isNoInferType(type3) ? getNoInferType(getIndexType(type3.baseType, indexFlags)) : shouldDeferIndexType(type3, indexFlags) ? getIndexTypeForGenericType(type3, indexFlags) : type3.flags & 1048576 ? getIntersectionType(map4(type3.types, (t8) => getIndexType(t8, indexFlags))) : type3.flags & 2097152 ? getUnionType(map4(type3.types, (t8) => getIndexType(t8, indexFlags))) : getObjectFlags(type3) & 32 ? getIndexTypeForMappedType(type3, indexFlags) : type3 === wildcardType ? wildcardType : type3.flags & 2 ? neverType2 : type3.flags & (1 | 131072) ? keyofConstraintType : getLiteralTypeFromProperties(type3, (indexFlags & 2 ? 128 : 402653316) | (indexFlags & 1 ? 0 : 296 | 12288), indexFlags === defaultIndexFlags); + } + function getExtractStringType(type3) { + if (keyofStringsOnly) { + return type3; + } + const extractTypeAlias = getGlobalExtractSymbol(); + return extractTypeAlias ? getTypeAliasInstantiation(extractTypeAlias, [type3, stringType2]) : stringType2; + } + function getIndexTypeOrString(type3) { + const indexType = getExtractStringType(getIndexType(type3)); + return indexType.flags & 131072 ? stringType2 : indexType; + } + function getTypeFromTypeOperatorNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + switch (node.operator) { + case 143: + links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); + break; + case 158: + links.resolvedType = node.type.kind === 155 ? getESSymbolLikeTypeForNode(walkUpParenthesizedTypes(node.parent)) : errorType; + break; + case 148: + links.resolvedType = getTypeFromTypeNode(node.type); + break; + default: + Debug.assertNever(node.operator); + } + } + return links.resolvedType; + } + function getTypeFromTemplateTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getTemplateLiteralType( + [node.head.text, ...map4(node.templateSpans, (span) => span.literal.text)], + map4(node.templateSpans, (span) => getTypeFromTypeNode(span.type)) + ); + } + return links.resolvedType; + } + function getTemplateLiteralType(texts, types3) { + const unionIndex = findIndex2(types3, (t8) => !!(t8.flags & (131072 | 1048576))); + if (unionIndex >= 0) { + return checkCrossProductUnion(types3) ? mapType2(types3[unionIndex], (t8) => getTemplateLiteralType(texts, replaceElement(types3, unionIndex, t8))) : errorType; + } + if (contains2(types3, wildcardType)) { + return wildcardType; + } + const newTypes = []; + const newTexts = []; + let text = texts[0]; + if (!addSpans(texts, types3)) { + return stringType2; + } + if (newTypes.length === 0) { + return getStringLiteralType(text); + } + newTexts.push(text); + if (every2(newTexts, (t8) => t8 === "")) { + if (every2(newTypes, (t8) => !!(t8.flags & 4))) { + return stringType2; + } + if (newTypes.length === 1 && isPatternLiteralType(newTypes[0])) { + return newTypes[0]; + } + } + const id = `${getTypeListId(newTypes)}|${map4(newTexts, (t8) => t8.length).join(",")}|${newTexts.join("")}`; + let type3 = templateLiteralTypes.get(id); + if (!type3) { + templateLiteralTypes.set(id, type3 = createTemplateLiteralType(newTexts, newTypes)); + } + return type3; + function addSpans(texts2, types22) { + for (let i7 = 0; i7 < types22.length; i7++) { + const t8 = types22[i7]; + if (t8.flags & (2944 | 65536 | 32768)) { + text += getTemplateStringForType(t8) || ""; + text += texts2[i7 + 1]; + } else if (t8.flags & 134217728) { + text += t8.texts[0]; + if (!addSpans(t8.texts, t8.types)) + return false; + text += texts2[i7 + 1]; + } else if (isGenericIndexType(t8) || isPatternLiteralPlaceholderType(t8)) { + newTypes.push(t8); + newTexts.push(text); + text = texts2[i7 + 1]; + } else { + return false; + } + } + return true; + } + } + function getTemplateStringForType(type3) { + return type3.flags & 128 ? type3.value : type3.flags & 256 ? "" + type3.value : type3.flags & 2048 ? pseudoBigIntToString(type3.value) : type3.flags & (512 | 98304) ? type3.intrinsicName : void 0; + } + function createTemplateLiteralType(texts, types3) { + const type3 = createType( + 134217728 + /* TemplateLiteral */ + ); + type3.texts = texts; + type3.types = types3; + return type3; + } + function getStringMappingType(symbol, type3) { + return type3.flags & (1048576 | 131072) ? mapType2(type3, (t8) => getStringMappingType(symbol, t8)) : type3.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type3.value)) : type3.flags & 134217728 ? getTemplateLiteralType(...applyTemplateStringMapping(symbol, type3.texts, type3.types)) : ( + // Mapping> === Mapping + type3.flags & 268435456 && symbol === type3.symbol ? type3 : type3.flags & (1 | 4 | 268435456) || isGenericIndexType(type3) ? getStringMappingTypeForGenericType(symbol, type3) : ( + // This handles Mapping<`${number}`> and Mapping<`${bigint}`> + isPatternLiteralPlaceholderType(type3) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type3])) : type3 + ) + ); + } + function applyStringMapping(symbol, str2) { + switch (intrinsicTypeKinds.get(symbol.escapedName)) { + case 0: + return str2.toUpperCase(); + case 1: + return str2.toLowerCase(); + case 2: + return str2.charAt(0).toUpperCase() + str2.slice(1); + case 3: + return str2.charAt(0).toLowerCase() + str2.slice(1); + } + return str2; + } + function applyTemplateStringMapping(symbol, texts, types3) { + switch (intrinsicTypeKinds.get(symbol.escapedName)) { + case 0: + return [texts.map((t8) => t8.toUpperCase()), types3.map((t8) => getStringMappingType(symbol, t8))]; + case 1: + return [texts.map((t8) => t8.toLowerCase()), types3.map((t8) => getStringMappingType(symbol, t8))]; + case 2: + return [texts[0] === "" ? texts : [texts[0].charAt(0).toUpperCase() + texts[0].slice(1), ...texts.slice(1)], texts[0] === "" ? [getStringMappingType(symbol, types3[0]), ...types3.slice(1)] : types3]; + case 3: + return [texts[0] === "" ? texts : [texts[0].charAt(0).toLowerCase() + texts[0].slice(1), ...texts.slice(1)], texts[0] === "" ? [getStringMappingType(symbol, types3[0]), ...types3.slice(1)] : types3]; + } + return [texts, types3]; + } + function getStringMappingTypeForGenericType(symbol, type3) { + const id = `${getSymbolId(symbol)},${getTypeId(type3)}`; + let result2 = stringMappingTypes.get(id); + if (!result2) { + stringMappingTypes.set(id, result2 = createStringMappingType(symbol, type3)); + } + return result2; + } + function createStringMappingType(symbol, type3) { + const result2 = createTypeWithSymbol(268435456, symbol); + result2.type = type3; + return result2; + } + function createIndexedAccessType(objectType2, indexType, accessFlags, aliasSymbol, aliasTypeArguments) { + const type3 = createType( + 8388608 + /* IndexedAccess */ + ); + type3.objectType = objectType2; + type3.indexType = indexType; + type3.accessFlags = accessFlags; + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = aliasTypeArguments; + return type3; + } + function isJSLiteralType(type3) { + if (noImplicitAny) { + return false; + } + if (getObjectFlags(type3) & 4096) { + return true; + } + if (type3.flags & 1048576) { + return every2(type3.types, isJSLiteralType); + } + if (type3.flags & 2097152) { + return some2(type3.types, isJSLiteralType); + } + if (type3.flags & 465829888) { + const constraint = getResolvedBaseConstraint(type3); + return constraint !== type3 && isJSLiteralType(constraint); + } + return false; + } + function getPropertyNameFromIndex(indexType, accessNode) { + return isTypeUsableAsPropertyName(indexType) ? getPropertyNameFromType(indexType) : accessNode && isPropertyName(accessNode) ? ( + // late bound names are handled in the first branch, so here we only need to handle normal names + getPropertyNameForPropertyNameNode(accessNode) + ) : void 0; + } + function isUncalledFunctionReference(node, symbol) { + if (symbol.flags & (16 | 8192)) { + const parent22 = findAncestor(node.parent, (n7) => !isAccessExpression(n7)) || node.parent; + if (isCallLikeExpression(parent22)) { + return isCallOrNewExpression(parent22) && isIdentifier(node) && hasMatchingArgument(parent22, node); + } + return every2(symbol.declarations, (d7) => !isFunctionLike(d7) || isDeprecatedDeclaration2(d7)); + } + return true; + } + function getPropertyTypeForIndexType(originalObjectType, objectType2, indexType, fullIndexType, accessNode, accessFlags) { + const accessExpression = accessNode && accessNode.kind === 212 ? accessNode : void 0; + const propName2 = accessNode && isPrivateIdentifier(accessNode) ? void 0 : getPropertyNameFromIndex(indexType, accessNode); + if (propName2 !== void 0) { + if (accessFlags & 256) { + return getTypeOfPropertyOfContextualType(objectType2, propName2) || anyType2; + } + const prop = getPropertyOfType(objectType2, propName2); + if (prop) { + if (accessFlags & 64 && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) { + const deprecatedNode = (accessExpression == null ? void 0 : accessExpression.argumentExpression) ?? (isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode); + addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName2); + } + if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, isSelfTypeAccess(accessExpression.expression, objectType2.symbol)); + if (isAssignmentToReadonlyEntity(accessExpression, prop, getAssignmentTargetKind(accessExpression))) { + error22(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString2(prop)); + return void 0; + } + if (accessFlags & 8) { + getNodeLinks(accessNode).resolvedSymbol = prop; + } + if (isThisPropertyAccessInConstructor(accessExpression, prop)) { + return autoType; + } + } + const propType = accessFlags & 4 ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop); + return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType2]) : propType; + } + if (everyType(objectType2, isTupleType) && isNumericLiteralName(propName2)) { + const index4 = +propName2; + if (accessNode && everyType(objectType2, (t8) => !t8.target.hasRestElement) && !(accessFlags & 16)) { + const indexNode = getIndexNodeForAccessExpression(accessNode); + if (isTupleType(objectType2)) { + if (index4 < 0) { + error22(indexNode, Diagnostics.A_tuple_type_cannot_be_indexed_with_a_negative_value); + return undefinedType2; + } + error22(indexNode, Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2, typeToString(objectType2), getTypeReferenceArity(objectType2), unescapeLeadingUnderscores(propName2)); + } else { + error22(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName2), typeToString(objectType2)); + } + } + if (index4 >= 0) { + errorIfWritingToReadonlyIndex(getIndexInfoOfType(objectType2, numberType2)); + return getTupleElementTypeOutOfStartCount(objectType2, index4, accessFlags & 1 ? missingType : void 0); + } + } + } + if (!(indexType.flags & 98304) && isTypeAssignableToKind( + indexType, + 402653316 | 296 | 12288 + /* ESSymbolLike */ + )) { + if (objectType2.flags & (1 | 131072)) { + return objectType2; + } + const indexInfo = getApplicableIndexInfo(objectType2, indexType) || getIndexInfoOfType(objectType2, stringType2); + if (indexInfo) { + if (accessFlags & 2 && indexInfo.keyType !== numberType2) { + if (accessExpression) { + if (accessFlags & 4) { + error22(accessExpression, Diagnostics.Type_0_is_generic_and_can_only_be_indexed_for_reading, typeToString(originalObjectType)); + } else { + error22(accessExpression, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(originalObjectType)); + } + } + return void 0; + } + if (accessNode && indexInfo.keyType === stringType2 && !isTypeAssignableToKind( + indexType, + 4 | 8 + /* Number */ + )) { + const indexNode = getIndexNodeForAccessExpression(accessNode); + error22(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + return accessFlags & 1 ? getUnionType([indexInfo.type, missingType]) : indexInfo.type; + } + errorIfWritingToReadonlyIndex(indexInfo); + if (accessFlags & 1 && !(objectType2.symbol && objectType2.symbol.flags & (256 | 128) && (indexType.symbol && indexType.flags & 1024 && getParentOfSymbol(indexType.symbol) === objectType2.symbol))) { + return getUnionType([indexInfo.type, missingType]); + } + return indexInfo.type; + } + if (indexType.flags & 131072) { + return neverType2; + } + if (isJSLiteralType(objectType2)) { + return anyType2; + } + if (accessExpression && !isConstEnumObjectType(objectType2)) { + if (isObjectLiteralType2(objectType2)) { + if (noImplicitAny && indexType.flags & (128 | 256)) { + diagnostics.add(createDiagnosticForNode(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType2))); + return undefinedType2; + } else if (indexType.flags & (8 | 4)) { + const types3 = map4(objectType2.properties, (property2) => { + return getTypeOfSymbol(property2); + }); + return getUnionType(append(types3, undefinedType2)); + } + } + if (objectType2.symbol === globalThisSymbol && propName2 !== void 0 && globalThisSymbol.exports.has(propName2) && globalThisSymbol.exports.get(propName2).flags & 418) { + error22(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(propName2), typeToString(objectType2)); + } else if (noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !(accessFlags & 128)) { + if (propName2 !== void 0 && typeHasStaticProperty(propName2, objectType2)) { + const typeName = typeToString(objectType2); + error22(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName2, typeName, typeName + "[" + getTextOfNode(accessExpression.argumentExpression) + "]"); + } else if (getIndexTypeOfType(objectType2, numberType2)) { + error22(accessExpression.argumentExpression, Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number); + } else { + let suggestion; + if (propName2 !== void 0 && (suggestion = getSuggestionForNonexistentProperty(propName2, objectType2))) { + if (suggestion !== void 0) { + error22(accessExpression.argumentExpression, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName2, typeToString(objectType2), suggestion); + } + } else { + const suggestion2 = getSuggestionForNonexistentIndexSignature(objectType2, accessExpression, indexType); + if (suggestion2 !== void 0) { + error22(accessExpression, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1, typeToString(objectType2), suggestion2); + } else { + let errorInfo; + if (indexType.flags & 1024) { + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Property_0_does_not_exist_on_type_1, + "[" + typeToString(indexType) + "]", + typeToString(objectType2) + ); + } else if (indexType.flags & 8192) { + const symbolName2 = getFullyQualifiedName2(indexType.symbol, accessExpression); + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Property_0_does_not_exist_on_type_1, + "[" + symbolName2 + "]", + typeToString(objectType2) + ); + } else if (indexType.flags & 128) { + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Property_0_does_not_exist_on_type_1, + indexType.value, + typeToString(objectType2) + ); + } else if (indexType.flags & 256) { + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Property_0_does_not_exist_on_type_1, + indexType.value, + typeToString(objectType2) + ); + } else if (indexType.flags & (8 | 4)) { + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1, + typeToString(indexType), + typeToString(objectType2) + ); + } + errorInfo = chainDiagnosticMessages( + errorInfo, + Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1, + typeToString(fullIndexType), + typeToString(objectType2) + ); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(accessExpression), accessExpression, errorInfo)); + } + } + } + } + return void 0; + } + } + if (isJSLiteralType(objectType2)) { + return anyType2; + } + if (accessNode) { + const indexNode = getIndexNodeForAccessExpression(accessNode); + if (indexType.flags & (128 | 256)) { + error22(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType2)); + } else if (indexType.flags & (4 | 8)) { + error22(indexNode, Diagnostics.Type_0_has_no_matching_index_signature_for_type_1, typeToString(objectType2), typeToString(indexType)); + } else { + error22(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType)); + } + } + if (isTypeAny(indexType)) { + return indexType; + } + return void 0; + function errorIfWritingToReadonlyIndex(indexInfo) { + if (indexInfo && indexInfo.isReadonly && accessExpression && (isAssignmentTarget(accessExpression) || isDeleteTarget(accessExpression))) { + error22(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType2)); + } + } + } + function getIndexNodeForAccessExpression(accessNode) { + return accessNode.kind === 212 ? accessNode.argumentExpression : accessNode.kind === 199 ? accessNode.indexType : accessNode.kind === 167 ? accessNode.expression : accessNode; + } + function isPatternLiteralPlaceholderType(type3) { + if (type3.flags & 2097152) { + let seenPlaceholder = false; + for (const t8 of type3.types) { + if (t8.flags & (2944 | 98304) || isPatternLiteralPlaceholderType(t8)) { + seenPlaceholder = true; + } else if (!(t8.flags & 524288)) { + return false; + } + } + return seenPlaceholder; + } + return !!(type3.flags & (1 | 4 | 8 | 64)) || isPatternLiteralType(type3); + } + function isPatternLiteralType(type3) { + return !!(type3.flags & 134217728) && every2(type3.types, isPatternLiteralPlaceholderType) || !!(type3.flags & 268435456) && isPatternLiteralPlaceholderType(type3.type); + } + function isGenericStringLikeType(type3) { + return !!(type3.flags & (134217728 | 268435456)) && !isPatternLiteralType(type3); + } + function isGenericType(type3) { + return !!getGenericObjectFlags(type3); + } + function isGenericObjectType(type3) { + return !!(getGenericObjectFlags(type3) & 4194304); + } + function isGenericIndexType(type3) { + return !!(getGenericObjectFlags(type3) & 8388608); + } + function getGenericObjectFlags(type3) { + if (type3.flags & 3145728) { + if (!(type3.objectFlags & 2097152)) { + type3.objectFlags |= 2097152 | reduceLeft(type3.types, (flags, t8) => flags | getGenericObjectFlags(t8), 0); + } + return type3.objectFlags & 12582912; + } + if (type3.flags & 33554432) { + if (!(type3.objectFlags & 2097152)) { + type3.objectFlags |= 2097152 | getGenericObjectFlags(type3.baseType) | getGenericObjectFlags(type3.constraint); + } + return type3.objectFlags & 12582912; + } + return (type3.flags & 58982400 || isGenericMappedType(type3) || isGenericTupleType(type3) ? 4194304 : 0) | (type3.flags & (58982400 | 4194304) || isGenericStringLikeType(type3) ? 8388608 : 0); + } + function getSimplifiedType(type3, writing) { + return type3.flags & 8388608 ? getSimplifiedIndexedAccessType(type3, writing) : type3.flags & 16777216 ? getSimplifiedConditionalType(type3, writing) : type3; + } + function distributeIndexOverObjectType(objectType2, indexType, writing) { + if (objectType2.flags & 1048576 || objectType2.flags & 2097152 && !shouldDeferIndexType(objectType2)) { + const types3 = map4(objectType2.types, (t8) => getSimplifiedType(getIndexedAccessType(t8, indexType), writing)); + return objectType2.flags & 2097152 || writing ? getIntersectionType(types3) : getUnionType(types3); + } + } + function distributeObjectOverIndexType(objectType2, indexType, writing) { + if (indexType.flags & 1048576) { + const types3 = map4(indexType.types, (t8) => getSimplifiedType(getIndexedAccessType(objectType2, t8), writing)); + return writing ? getIntersectionType(types3) : getUnionType(types3); + } + } + function getSimplifiedIndexedAccessType(type3, writing) { + const cache = writing ? "simplifiedForWriting" : "simplifiedForReading"; + if (type3[cache]) { + return type3[cache] === circularConstraintType ? type3 : type3[cache]; + } + type3[cache] = circularConstraintType; + const objectType2 = getSimplifiedType(type3.objectType, writing); + const indexType = getSimplifiedType(type3.indexType, writing); + const distributedOverIndex = distributeObjectOverIndexType(objectType2, indexType, writing); + if (distributedOverIndex) { + return type3[cache] = distributedOverIndex; + } + if (!(indexType.flags & 465829888)) { + const distributedOverObject = distributeIndexOverObjectType(objectType2, indexType, writing); + if (distributedOverObject) { + return type3[cache] = distributedOverObject; + } + } + if (isGenericTupleType(objectType2) && indexType.flags & 296) { + const elementType = getElementTypeOfSliceOfTupleType( + objectType2, + indexType.flags & 8 ? 0 : objectType2.target.fixedLength, + /*endSkipCount*/ + 0, + writing + ); + if (elementType) { + return type3[cache] = elementType; + } + } + if (isGenericMappedType(objectType2)) { + if (getMappedTypeNameTypeKind(objectType2) !== 2) { + return type3[cache] = mapType2(substituteIndexedMappedType(objectType2, type3.indexType), (t8) => getSimplifiedType(t8, writing)); + } + } + return type3[cache] = type3; + } + function getSimplifiedConditionalType(type3, writing) { + const checkType = type3.checkType; + const extendsType = type3.extendsType; + const trueType2 = getTrueTypeFromConditionalType(type3); + const falseType2 = getFalseTypeFromConditionalType(type3); + if (falseType2.flags & 131072 && getActualTypeVariable(trueType2) === getActualTypeVariable(checkType)) { + if (checkType.flags & 1 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { + return getSimplifiedType(trueType2, writing); + } else if (isIntersectionEmpty(checkType, extendsType)) { + return neverType2; + } + } else if (trueType2.flags & 131072 && getActualTypeVariable(falseType2) === getActualTypeVariable(checkType)) { + if (!(checkType.flags & 1) && isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(extendsType))) { + return neverType2; + } else if (checkType.flags & 1 || isIntersectionEmpty(checkType, extendsType)) { + return getSimplifiedType(falseType2, writing); + } + } + return type3; + } + function isIntersectionEmpty(type1, type22) { + return !!(getUnionType([intersectTypes(type1, type22), neverType2]).flags & 131072); + } + function substituteIndexedMappedType(objectType2, index4) { + const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType2)], [index4]); + const templateMapper = combineTypeMappers(objectType2.mapper, mapper); + return instantiateType(getTemplateTypeFromMappedType(objectType2.target || objectType2), templateMapper); + } + function getIndexedAccessType(objectType2, indexType, accessFlags = 0, accessNode, aliasSymbol, aliasTypeArguments) { + return getIndexedAccessTypeOrUndefined(objectType2, indexType, accessFlags, accessNode, aliasSymbol, aliasTypeArguments) || (accessNode ? errorType : unknownType2); + } + function indexTypeLessThan(indexType, limit) { + return everyType(indexType, (t8) => { + if (t8.flags & 384) { + const propName2 = getPropertyNameFromType(t8); + if (isNumericLiteralName(propName2)) { + const index4 = +propName2; + return index4 >= 0 && index4 < limit; + } + } + return false; + }); + } + function getIndexedAccessTypeOrUndefined(objectType2, indexType, accessFlags = 0, accessNode, aliasSymbol, aliasTypeArguments) { + if (objectType2 === wildcardType || indexType === wildcardType) { + return wildcardType; + } + objectType2 = getReducedType(objectType2); + if (isStringIndexSignatureOnlyType(objectType2) && !(indexType.flags & 98304) && isTypeAssignableToKind( + indexType, + 4 | 8 + /* Number */ + )) { + indexType = stringType2; + } + if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32) + accessFlags |= 1; + if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 199 ? isGenericTupleType(objectType2) && !indexTypeLessThan(indexType, getTotalFixedElementCount(objectType2.target)) : isGenericObjectType(objectType2) && !(isTupleType(objectType2) && indexTypeLessThan(indexType, getTotalFixedElementCount(objectType2.target))) || isGenericReducibleType(objectType2))) { + if (objectType2.flags & 3) { + return objectType2; + } + const persistentAccessFlags = accessFlags & 1; + const id = objectType2.id + "," + indexType.id + "," + persistentAccessFlags + getAliasId(aliasSymbol, aliasTypeArguments); + let type3 = indexedAccessTypes.get(id); + if (!type3) { + indexedAccessTypes.set(id, type3 = createIndexedAccessType(objectType2, indexType, persistentAccessFlags, aliasSymbol, aliasTypeArguments)); + } + return type3; + } + const apparentObjectType = getReducedApparentType(objectType2); + if (indexType.flags & 1048576 && !(indexType.flags & 16)) { + const propTypes = []; + let wasMissingProp = false; + for (const t8 of indexType.types) { + const propType = getPropertyTypeForIndexType(objectType2, apparentObjectType, t8, indexType, accessNode, accessFlags | (wasMissingProp ? 128 : 0)); + if (propType) { + propTypes.push(propType); + } else if (!accessNode) { + return void 0; + } else { + wasMissingProp = true; + } + } + if (wasMissingProp) { + return void 0; + } + return accessFlags & 4 ? getIntersectionType(propTypes, aliasSymbol, aliasTypeArguments) : getUnionType(propTypes, 1, aliasSymbol, aliasTypeArguments); + } + return getPropertyTypeForIndexType( + objectType2, + apparentObjectType, + indexType, + indexType, + accessNode, + accessFlags | 8 | 64 + /* ReportDeprecated */ + ); + } + function getTypeFromIndexedAccessTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const objectType2 = getTypeFromTypeNode(node.objectType); + const indexType = getTypeFromTypeNode(node.indexType); + const potentialAlias = getAliasSymbolForTypeNode(node); + links.resolvedType = getIndexedAccessType(objectType2, indexType, 0, node, potentialAlias, getTypeArgumentsForAliasSymbol(potentialAlias)); + } + return links.resolvedType; + } + function getTypeFromMappedTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const type3 = createObjectType(32, node.symbol); + type3.declaration = node; + type3.aliasSymbol = getAliasSymbolForTypeNode(node); + type3.aliasTypeArguments = getTypeArgumentsForAliasSymbol(type3.aliasSymbol); + links.resolvedType = type3; + getConstraintTypeFromMappedType(type3); + } + return links.resolvedType; + } + function getActualTypeVariable(type3) { + if (type3.flags & 33554432) { + return getActualTypeVariable(type3.baseType); + } + if (type3.flags & 8388608 && (type3.objectType.flags & 33554432 || type3.indexType.flags & 33554432)) { + return getIndexedAccessType(getActualTypeVariable(type3.objectType), getActualTypeVariable(type3.indexType)); + } + return type3; + } + function isSimpleTupleType(node) { + return isTupleTypeNode(node) && length(node.elements) > 0 && !some2(node.elements, (e10) => isOptionalTypeNode(e10) || isRestTypeNode(e10) || isNamedTupleMember(e10) && !!(e10.questionToken || e10.dotDotDotToken)); + } + function isDeferredType(type3, checkTuples) { + return isGenericType(type3) || checkTuples && isTupleType(type3) && some2(getElementTypes(type3), isGenericType); + } + function getConditionalType(root2, mapper, forConstraint, aliasSymbol, aliasTypeArguments) { + let result2; + let extraTypes; + let tailCount = 0; + while (true) { + if (tailCount === 1e3) { + error22(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + return errorType; + } + const checkType = instantiateType(getActualTypeVariable(root2.checkType), mapper); + const extendsType = instantiateType(root2.extendsType, mapper); + if (checkType === errorType || extendsType === errorType) { + return errorType; + } + if (checkType === wildcardType || extendsType === wildcardType) { + return wildcardType; + } + const checkTypeNode = skipTypeParentheses(root2.node.checkType); + const extendsTypeNode = skipTypeParentheses(root2.node.extendsType); + const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements); + const checkTypeDeferred = isDeferredType(checkType, checkTuples); + let combinedMapper; + if (root2.inferTypeParameters) { + const context2 = createInferenceContext( + root2.inferTypeParameters, + /*signature*/ + void 0, + 0 + /* None */ + ); + if (mapper) { + context2.nonFixingMapper = combineTypeMappers(context2.nonFixingMapper, mapper); + } + if (!checkTypeDeferred) { + inferTypes( + context2.inferences, + checkType, + extendsType, + 512 | 1024 + /* AlwaysStrict */ + ); + } + combinedMapper = mapper ? combineTypeMappers(context2.mapper, mapper) : context2.mapper; + } + const inferredExtendsType = combinedMapper ? instantiateType(root2.extendsType, combinedMapper) : extendsType; + if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) { + if (!(inferredExtendsType.flags & 3) && (checkType.flags & 1 || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) { + if (checkType.flags & 1 || forConstraint && !(inferredExtendsType.flags & 131072) && someType(getPermissiveInstantiation(inferredExtendsType), (t8) => isTypeAssignableTo(t8, getPermissiveInstantiation(checkType)))) { + (extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root2.node.trueType), combinedMapper || mapper)); + } + const falseType2 = getTypeFromTypeNode(root2.node.falseType); + if (falseType2.flags & 16777216) { + const newRoot = falseType2.root; + if (newRoot.node.parent === root2.node && (!newRoot.isDistributive || newRoot.checkType === root2.checkType)) { + root2 = newRoot; + continue; + } + if (canTailRecurse(falseType2, mapper)) { + continue; + } + } + result2 = instantiateType(falseType2, mapper); + break; + } + if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) { + const trueType2 = getTypeFromTypeNode(root2.node.trueType); + const trueMapper = combinedMapper || mapper; + if (canTailRecurse(trueType2, trueMapper)) { + continue; + } + result2 = instantiateType(trueType2, trueMapper); + break; + } + } + result2 = createType( + 16777216 + /* Conditional */ + ); + result2.root = root2; + result2.checkType = instantiateType(root2.checkType, mapper); + result2.extendsType = instantiateType(root2.extendsType, mapper); + result2.mapper = mapper; + result2.combinedMapper = combinedMapper; + result2.aliasSymbol = aliasSymbol || root2.aliasSymbol; + result2.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root2.aliasTypeArguments, mapper); + break; + } + return extraTypes ? getUnionType(append(extraTypes, result2)) : result2; + function canTailRecurse(newType, newMapper) { + if (newType.flags & 16777216 && newMapper) { + const newRoot = newType.root; + if (newRoot.outerTypeParameters) { + const typeParamMapper = combineTypeMappers(newType.mapper, newMapper); + const typeArguments = map4(newRoot.outerTypeParameters, (t8) => getMappedType(t8, typeParamMapper)); + const newRootMapper = createTypeMapper(newRoot.outerTypeParameters, typeArguments); + const newCheckType = newRoot.isDistributive ? getMappedType(newRoot.checkType, newRootMapper) : void 0; + if (!newCheckType || newCheckType === newRoot.checkType || !(newCheckType.flags & (1048576 | 131072))) { + root2 = newRoot; + mapper = newRootMapper; + aliasSymbol = void 0; + aliasTypeArguments = void 0; + if (newRoot.aliasSymbol) { + tailCount++; + } + return true; + } + } + } + return false; + } + } + function getTrueTypeFromConditionalType(type3) { + return type3.resolvedTrueType || (type3.resolvedTrueType = instantiateType(getTypeFromTypeNode(type3.root.node.trueType), type3.mapper)); + } + function getFalseTypeFromConditionalType(type3) { + return type3.resolvedFalseType || (type3.resolvedFalseType = instantiateType(getTypeFromTypeNode(type3.root.node.falseType), type3.mapper)); + } + function getInferredTrueTypeFromConditionalType(type3) { + return type3.resolvedInferredTrueType || (type3.resolvedInferredTrueType = type3.combinedMapper ? instantiateType(getTypeFromTypeNode(type3.root.node.trueType), type3.combinedMapper) : getTrueTypeFromConditionalType(type3)); + } + function getInferTypeParameters(node) { + let result2; + if (node.locals) { + node.locals.forEach((symbol) => { + if (symbol.flags & 262144) { + result2 = append(result2, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result2; + } + function isDistributionDependent(root2) { + return root2.isDistributive && (isTypeParameterPossiblyReferenced(root2.checkType, root2.node.trueType) || isTypeParameterPossiblyReferenced(root2.checkType, root2.node.falseType)); + } + function getTypeFromConditionalTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const checkType = getTypeFromTypeNode(node.checkType); + const aliasSymbol = getAliasSymbolForTypeNode(node); + const aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + const allOuterTypeParameters = getOuterTypeParameters( + node, + /*includeThisTypes*/ + true + ); + const outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : filter2(allOuterTypeParameters, (tp) => isTypeParameterPossiblyReferenced(tp, node)); + const root2 = { + node, + checkType, + extendsType: getTypeFromTypeNode(node.extendsType), + isDistributive: !!(checkType.flags & 262144), + inferTypeParameters: getInferTypeParameters(node), + outerTypeParameters, + instantiations: void 0, + aliasSymbol, + aliasTypeArguments + }; + links.resolvedType = getConditionalType( + root2, + /*mapper*/ + void 0, + /*forConstraint*/ + false + ); + if (outerTypeParameters) { + root2.instantiations = /* @__PURE__ */ new Map(); + root2.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); + } + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter)); + } + return links.resolvedType; + } + function getIdentifierChain(node) { + if (isIdentifier(node)) { + return [node]; + } else { + return append(getIdentifierChain(node.left), node.right); + } + } + function getTypeFromImportTypeNode(node) { + var _a2; + const links = getNodeLinks(node); + if (!links.resolvedType) { + if (!isLiteralImportTypeNode(node)) { + error22(node.argument, Diagnostics.String_literal_expected); + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = errorType; + } + const targetMeaning = node.isTypeOf ? 111551 : node.flags & 16777216 ? 111551 | 788968 : 788968; + const innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal); + if (!innerModuleSymbol) { + links.resolvedSymbol = unknownSymbol; + return links.resolvedType = errorType; + } + const isExportEquals = !!((_a2 = innerModuleSymbol.exports) == null ? void 0 : _a2.get( + "export=" + /* ExportEquals */ + )); + const moduleSymbol = resolveExternalModuleSymbol( + innerModuleSymbol, + /*dontResolveAlias*/ + false + ); + if (!nodeIsMissing(node.qualifier)) { + const nameStack = getIdentifierChain(node.qualifier); + let currentNamespace = moduleSymbol; + let current; + while (current = nameStack.shift()) { + const meaning = nameStack.length ? 1920 : targetMeaning; + const mergedResolvedSymbol = getMergedSymbol(resolveSymbol(currentNamespace)); + const symbolFromVariable = node.isTypeOf || isInJSFile(node) && isExportEquals ? getPropertyOfType( + getTypeOfSymbol(mergedResolvedSymbol), + current.escapedText, + /*skipObjectFunctionPropertyAugment*/ + false, + /*includeTypeOnlyMembers*/ + true + ) : void 0; + const symbolFromModule = node.isTypeOf ? void 0 : getSymbol2(getExportsOfSymbol(mergedResolvedSymbol), current.escapedText, meaning); + const next = symbolFromModule ?? symbolFromVariable; + if (!next) { + error22(current, Diagnostics.Namespace_0_has_no_exported_member_1, getFullyQualifiedName2(currentNamespace), declarationNameToString(current)); + return links.resolvedType = errorType; + } + getNodeLinks(current).resolvedSymbol = next; + getNodeLinks(current.parent).resolvedSymbol = next; + currentNamespace = next; + } + links.resolvedType = resolveImportSymbolType(node, links, currentNamespace, targetMeaning); + } else { + if (moduleSymbol.flags & targetMeaning) { + links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning); + } else { + const errorMessage = targetMeaning === 111551 ? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0; + error22(node, errorMessage, node.argument.literal.text); + links.resolvedSymbol = unknownSymbol; + links.resolvedType = errorType; + } + } + } + return links.resolvedType; + } + function resolveImportSymbolType(node, links, symbol, meaning) { + const resolvedSymbol = resolveSymbol(symbol); + links.resolvedSymbol = resolvedSymbol; + if (meaning === 111551) { + return getInstantiationExpressionType(getTypeOfSymbol(symbol), node); + } else { + return getTypeReferenceType(node, resolvedSymbol); + } + } + function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + const aliasSymbol = getAliasSymbolForTypeNode(node); + if (getMembersOfSymbol(node.symbol).size === 0 && !aliasSymbol) { + links.resolvedType = emptyTypeLiteralType; + } else { + let type3 = createObjectType(16, node.symbol); + type3.aliasSymbol = aliasSymbol; + type3.aliasTypeArguments = getTypeArgumentsForAliasSymbol(aliasSymbol); + if (isJSDocTypeLiteral(node) && node.isArrayType) { + type3 = createArrayType(type3); + } + links.resolvedType = type3; + } + } + return links.resolvedType; + } + function getAliasSymbolForTypeNode(node) { + let host2 = node.parent; + while (isParenthesizedTypeNode(host2) || isJSDocTypeExpression(host2) || isTypeOperatorNode(host2) && host2.operator === 148) { + host2 = host2.parent; + } + return isTypeAlias(host2) ? getSymbolOfDeclaration(host2) : void 0; + } + function getTypeArgumentsForAliasSymbol(symbol) { + return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : void 0; + } + function isNonGenericObjectType(type3) { + return !!(type3.flags & 524288) && !isGenericMappedType(type3); + } + function isEmptyObjectTypeOrSpreadsIntoEmptyObject(type3) { + return isEmptyObjectType(type3) || !!(type3.flags & (65536 | 32768 | 528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)); + } + function tryMergeUnionOfObjectTypeAndEmptyObject(type3, readonly) { + if (!(type3.flags & 1048576)) { + return type3; + } + if (every2(type3.types, isEmptyObjectTypeOrSpreadsIntoEmptyObject)) { + return find2(type3.types, isEmptyObjectType) || emptyObjectType; + } + const firstType = find2(type3.types, (t8) => !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t8)); + if (!firstType) { + return type3; + } + const secondType = find2(type3.types, (t8) => t8 !== firstType && !isEmptyObjectTypeOrSpreadsIntoEmptyObject(t8)); + if (secondType) { + return type3; + } + return getAnonymousPartialType(firstType); + function getAnonymousPartialType(type22) { + const members = createSymbolTable(); + for (const prop of getPropertiesOfType(type22)) { + if (getDeclarationModifierFlagsFromSymbol(prop) & (2 | 4)) { + } else if (isSpreadableProperty(prop)) { + const isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); + const flags = 4 | 16777216; + const result2 = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0)); + result2.links.type = isSetonlyAccessor ? undefinedType2 : addOptionality( + getTypeOfSymbol(prop), + /*isProperty*/ + true + ); + result2.declarations = prop.declarations; + result2.links.nameType = getSymbolLinks(prop).nameType; + result2.links.syntheticOrigin = prop; + members.set(prop.escapedName, result2); + } + } + const spread2 = createAnonymousType(type22.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type22)); + spread2.objectFlags |= 128 | 131072; + return spread2; + } + } + function getSpreadType(left, right, symbol, objectFlags, readonly) { + if (left.flags & 1 || right.flags & 1) { + return anyType2; + } + if (left.flags & 2 || right.flags & 2) { + return unknownType2; + } + if (left.flags & 131072) { + return right; + } + if (right.flags & 131072) { + return left; + } + left = tryMergeUnionOfObjectTypeAndEmptyObject(left, readonly); + if (left.flags & 1048576) { + return checkCrossProductUnion([left, right]) ? mapType2(left, (t8) => getSpreadType(t8, right, symbol, objectFlags, readonly)) : errorType; + } + right = tryMergeUnionOfObjectTypeAndEmptyObject(right, readonly); + if (right.flags & 1048576) { + return checkCrossProductUnion([left, right]) ? mapType2(right, (t8) => getSpreadType(left, t8, symbol, objectFlags, readonly)) : errorType; + } + if (right.flags & (528 | 296 | 2112 | 402653316 | 1056 | 67108864 | 4194304)) { + return left; + } + if (isGenericObjectType(left) || isGenericObjectType(right)) { + if (isEmptyObjectType(left)) { + return right; + } + if (left.flags & 2097152) { + const types3 = left.types; + const lastLeft = types3[types3.length - 1]; + if (isNonGenericObjectType(lastLeft) && isNonGenericObjectType(right)) { + return getIntersectionType(concatenate(types3.slice(0, types3.length - 1), [getSpreadType(lastLeft, right, symbol, objectFlags, readonly)])); + } + } + return getIntersectionType([left, right]); + } + const members = createSymbolTable(); + const skippedPrivateMembers = /* @__PURE__ */ new Set(); + const indexInfos = left === emptyObjectType ? getIndexInfosOfType(right) : getUnionIndexInfos([left, right]); + for (const rightProp of getPropertiesOfType(right)) { + if (getDeclarationModifierFlagsFromSymbol(rightProp) & (2 | 4)) { + skippedPrivateMembers.add(rightProp.escapedName); + } else if (isSpreadableProperty(rightProp)) { + members.set(rightProp.escapedName, getSpreadSymbol(rightProp, readonly)); + } + } + for (const leftProp of getPropertiesOfType(left)) { + if (skippedPrivateMembers.has(leftProp.escapedName) || !isSpreadableProperty(leftProp)) { + continue; + } + if (members.has(leftProp.escapedName)) { + const rightProp = members.get(leftProp.escapedName); + const rightType = getTypeOfSymbol(rightProp); + if (rightProp.flags & 16777216) { + const declarations = concatenate(leftProp.declarations, rightProp.declarations); + const flags = 4 | leftProp.flags & 16777216; + const result2 = createSymbol(flags, leftProp.escapedName); + const leftType = getTypeOfSymbol(leftProp); + const leftTypeWithoutUndefined = removeMissingOrUndefinedType(leftType); + const rightTypeWithoutUndefined = removeMissingOrUndefinedType(rightType); + result2.links.type = leftTypeWithoutUndefined === rightTypeWithoutUndefined ? leftType : getUnionType( + [leftType, rightTypeWithoutUndefined], + 2 + /* Subtype */ + ); + result2.links.leftSpread = leftProp; + result2.links.rightSpread = rightProp; + result2.declarations = declarations; + result2.links.nameType = getSymbolLinks(leftProp).nameType; + members.set(leftProp.escapedName, result2); + } + } else { + members.set(leftProp.escapedName, getSpreadSymbol(leftProp, readonly)); + } + } + const spread2 = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info2) => getIndexInfoWithReadonly(info2, readonly))); + spread2.objectFlags |= 128 | 131072 | 2097152 | objectFlags; + return spread2; + } + function isSpreadableProperty(prop) { + var _a2; + return !some2(prop.declarations, isPrivateIdentifierClassElementDeclaration) && (!(prop.flags & (8192 | 32768 | 65536)) || !((_a2 = prop.declarations) == null ? void 0 : _a2.some((decl) => isClassLike(decl.parent)))); + } + function getSpreadSymbol(prop, readonly) { + const isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); + if (!isSetonlyAccessor && readonly === isReadonlySymbol(prop)) { + return prop; + } + const flags = 4 | prop.flags & 16777216; + const result2 = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 : 0)); + result2.links.type = isSetonlyAccessor ? undefinedType2 : getTypeOfSymbol(prop); + result2.declarations = prop.declarations; + result2.links.nameType = getSymbolLinks(prop).nameType; + result2.links.syntheticOrigin = prop; + return result2; + } + function getIndexInfoWithReadonly(info2, readonly) { + return info2.isReadonly !== readonly ? createIndexInfo(info2.keyType, info2.type, readonly, info2.declaration) : info2; + } + function createLiteralType(flags, value2, symbol, regularType) { + const type3 = createTypeWithSymbol(flags, symbol); + type3.value = value2; + type3.regularType = regularType || type3; + return type3; + } + function getFreshTypeOfLiteralType(type3) { + if (type3.flags & 2976) { + if (!type3.freshType) { + const freshType = createLiteralType(type3.flags, type3.value, type3.symbol, type3); + freshType.freshType = freshType; + type3.freshType = freshType; + } + return type3.freshType; + } + return type3; + } + function getRegularTypeOfLiteralType(type3) { + return type3.flags & 2976 ? type3.regularType : type3.flags & 1048576 ? type3.regularType || (type3.regularType = mapType2(type3, getRegularTypeOfLiteralType)) : type3; + } + function isFreshLiteralType(type3) { + return !!(type3.flags & 2976) && type3.freshType === type3; + } + function getStringLiteralType(value2) { + let type3; + return stringLiteralTypes.get(value2) || (stringLiteralTypes.set(value2, type3 = createLiteralType(128, value2)), type3); + } + function getNumberLiteralType(value2) { + let type3; + return numberLiteralTypes.get(value2) || (numberLiteralTypes.set(value2, type3 = createLiteralType(256, value2)), type3); + } + function getBigIntLiteralType(value2) { + let type3; + const key = pseudoBigIntToString(value2); + return bigIntLiteralTypes.get(key) || (bigIntLiteralTypes.set(key, type3 = createLiteralType(2048, value2)), type3); + } + function getEnumLiteralType(value2, enumId, symbol) { + let type3; + const key = `${enumId}${typeof value2 === "string" ? "@" : "#"}${value2}`; + const flags = 1024 | (typeof value2 === "string" ? 128 : 256); + return enumLiteralTypes.get(key) || (enumLiteralTypes.set(key, type3 = createLiteralType(flags, value2, symbol)), type3); + } + function getTypeFromLiteralTypeNode(node) { + if (node.literal.kind === 106) { + return nullType2; + } + const links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getRegularTypeOfLiteralType(checkExpression(node.literal)); + } + return links.resolvedType; + } + function createUniqueESSymbolType(symbol) { + const type3 = createTypeWithSymbol(8192, symbol); + type3.escapedName = `__@${type3.symbol.escapedName}@${getSymbolId(type3.symbol)}`; + return type3; + } + function getESSymbolLikeTypeForNode(node) { + if (isInJSFile(node) && isJSDocTypeExpression(node)) { + const host2 = getJSDocHost(node); + if (host2) { + node = getSingleVariableOfVariableStatement(host2) || host2; + } + } + if (isValidESSymbolDeclaration(node)) { + const symbol = isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node); + if (symbol) { + const links = getSymbolLinks(symbol); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); + } + } + return esSymbolType; + } + function getThisType(node) { + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + const parent22 = container && container.parent; + if (parent22 && (isClassLike(parent22) || parent22.kind === 264)) { + if (!isStatic(container) && (!isConstructorDeclaration(container) || isNodeDescendantOf(node, container.body))) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(parent22)).thisType; + } + } + if (parent22 && isObjectLiteralExpression(parent22) && isBinaryExpression(parent22.parent) && getAssignmentDeclarationKind(parent22.parent) === 6) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent22.parent.left).parent).thisType; + } + const host2 = node.flags & 16777216 ? getHostSignatureFromJSDoc(node) : void 0; + if (host2 && isFunctionExpression(host2) && isBinaryExpression(host2.parent) && getAssignmentDeclarationKind(host2.parent) === 3) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(host2.parent.left).parent).thisType; + } + if (isJSConstructor(container) && isNodeDescendantOf(node, container.body)) { + return getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(container)).thisType; + } + error22(node, Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface); + return errorType; + } + function getTypeFromThisTypeNode(node) { + const links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getThisType(node); + } + return links.resolvedType; + } + function getTypeFromRestTypeNode(node) { + return getTypeFromTypeNode(getArrayElementTypeNode(node.type) || node.type); + } + function getArrayElementTypeNode(node) { + switch (node.kind) { + case 196: + return getArrayElementTypeNode(node.type); + case 189: + if (node.elements.length === 1) { + node = node.elements[0]; + if (node.kind === 191 || node.kind === 202 && node.dotDotDotToken) { + return getArrayElementTypeNode(node.type); + } + } + break; + case 188: + return node.elementType; + } + return void 0; + } + function getTypeFromNamedTupleTypeNode(node) { + const links = getNodeLinks(node); + return links.resolvedType || (links.resolvedType = node.dotDotDotToken ? getTypeFromRestTypeNode(node) : addOptionality( + getTypeFromTypeNode(node.type), + /*isProperty*/ + true, + !!node.questionToken + )); + } + function getTypeFromTypeNode(node) { + return getConditionalFlowTypeOfType(getTypeFromTypeNodeWorker(node), node); + } + function getTypeFromTypeNodeWorker(node) { + switch (node.kind) { + case 133: + case 319: + case 320: + return anyType2; + case 159: + return unknownType2; + case 154: + return stringType2; + case 150: + return numberType2; + case 163: + return bigintType; + case 136: + return booleanType2; + case 155: + return esSymbolType; + case 116: + return voidType2; + case 157: + return undefinedType2; + case 106: + return nullType2; + case 146: + return neverType2; + case 151: + return node.flags & 524288 && !noImplicitAny ? anyType2 : nonPrimitiveType; + case 141: + return intrinsicMarkerType; + case 197: + case 110: + return getTypeFromThisTypeNode(node); + case 201: + return getTypeFromLiteralTypeNode(node); + case 183: + return getTypeFromTypeReference(node); + case 182: + return node.assertsModifier ? voidType2 : booleanType2; + case 233: + return getTypeFromTypeReference(node); + case 186: + return getTypeFromTypeQueryNode(node); + case 188: + case 189: + return getTypeFromArrayOrTupleTypeNode(node); + case 190: + return getTypeFromOptionalTypeNode(node); + case 192: + return getTypeFromUnionTypeNode(node); + case 193: + return getTypeFromIntersectionTypeNode(node); + case 321: + return getTypeFromJSDocNullableTypeNode(node); + case 323: + return addOptionality(getTypeFromTypeNode(node.type)); + case 202: + return getTypeFromNamedTupleTypeNode(node); + case 196: + case 322: + case 316: + return getTypeFromTypeNode(node.type); + case 191: + return getTypeFromRestTypeNode(node); + case 325: + return getTypeFromJSDocVariadicType(node); + case 184: + case 185: + case 187: + case 329: + case 324: + case 330: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 198: + return getTypeFromTypeOperatorNode(node); + case 199: + return getTypeFromIndexedAccessTypeNode(node); + case 200: + return getTypeFromMappedTypeNode(node); + case 194: + return getTypeFromConditionalTypeNode(node); + case 195: + return getTypeFromInferTypeNode(node); + case 203: + return getTypeFromTemplateTypeNode(node); + case 205: + return getTypeFromImportTypeNode(node); + case 80: + case 166: + case 211: + const symbol = getSymbolAtLocation(node); + return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; + default: + return errorType; + } + } + function instantiateList(items, mapper, instantiator) { + if (items && items.length) { + for (let i7 = 0; i7 < items.length; i7++) { + const item = items[i7]; + const mapped = instantiator(item, mapper); + if (item !== mapped) { + const result2 = i7 === 0 ? [] : items.slice(0, i7); + result2.push(mapped); + for (i7++; i7 < items.length; i7++) { + result2.push(instantiator(items[i7], mapper)); + } + return result2; + } + } + } + return items; + } + function instantiateTypes(types3, mapper) { + return instantiateList(types3, mapper, instantiateType); + } + function instantiateSignatures(signatures, mapper) { + return instantiateList(signatures, mapper, instantiateSignature); + } + function instantiateIndexInfos(indexInfos, mapper) { + return instantiateList(indexInfos, mapper, instantiateIndexInfo); + } + function createTypeMapper(sources, targets) { + return sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType2) : makeArrayTypeMapper(sources, targets); + } + function getMappedType(type3, mapper) { + switch (mapper.kind) { + case 0: + return type3 === mapper.source ? mapper.target : type3; + case 1: { + const sources = mapper.sources; + const targets = mapper.targets; + for (let i7 = 0; i7 < sources.length; i7++) { + if (type3 === sources[i7]) { + return targets ? targets[i7] : anyType2; + } + } + return type3; + } + case 2: { + const sources = mapper.sources; + const targets = mapper.targets; + for (let i7 = 0; i7 < sources.length; i7++) { + if (type3 === sources[i7]) { + return targets[i7](); + } + } + return type3; + } + case 3: + return mapper.func(type3); + case 4: + case 5: + const t1 = getMappedType(type3, mapper.mapper1); + return t1 !== type3 && mapper.kind === 4 ? instantiateType(t1, mapper.mapper2) : getMappedType(t1, mapper.mapper2); + } + } + function makeUnaryTypeMapper(source, target) { + return Debug.attachDebugPrototypeIfDebug({ kind: 0, source, target }); + } + function makeArrayTypeMapper(sources, targets) { + return Debug.attachDebugPrototypeIfDebug({ kind: 1, sources, targets }); + } + function makeFunctionTypeMapper(func, debugInfo) { + return Debug.attachDebugPrototypeIfDebug({ kind: 3, func, debugInfo: Debug.isDebugging ? debugInfo : void 0 }); + } + function makeDeferredTypeMapper(sources, targets) { + return Debug.attachDebugPrototypeIfDebug({ kind: 2, sources, targets }); + } + function makeCompositeTypeMapper(kind, mapper1, mapper2) { + return Debug.attachDebugPrototypeIfDebug({ kind, mapper1, mapper2 }); + } + function createTypeEraser(sources) { + return createTypeMapper( + sources, + /*targets*/ + void 0 + ); + } + function createBackreferenceMapper(context2, index4) { + const forwardInferences = context2.inferences.slice(index4); + return createTypeMapper(map4(forwardInferences, (i7) => i7.typeParameter), map4(forwardInferences, () => unknownType2)); + } + function combineTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(4, mapper1, mapper2) : mapper2; + } + function mergeTypeMappers(mapper1, mapper2) { + return mapper1 ? makeCompositeTypeMapper(5, mapper1, mapper2) : mapper2; + } + function prependTypeMapping(source, target, mapper) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, makeUnaryTypeMapper(source, target), mapper); + } + function appendTypeMapping(mapper, source, target) { + return !mapper ? makeUnaryTypeMapper(source, target) : makeCompositeTypeMapper(5, mapper, makeUnaryTypeMapper(source, target)); + } + function getRestrictiveTypeParameter(tp) { + return !tp.constraint && !getConstraintDeclaration(tp) || tp.constraint === noConstraintType ? tp : tp.restrictiveInstantiation || (tp.restrictiveInstantiation = createTypeParameter(tp.symbol), tp.restrictiveInstantiation.constraint = noConstraintType, tp.restrictiveInstantiation); + } + function cloneTypeParameter(typeParameter) { + const result2 = createTypeParameter(typeParameter.symbol); + result2.target = typeParameter; + return result2; + } + function instantiateTypePredicate(predicate, mapper) { + return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper)); + } + function instantiateSignature(signature, mapper, eraseTypeParameters) { + let freshTypeParameters; + if (signature.typeParameters && !eraseTypeParameters) { + freshTypeParameters = map4(signature.typeParameters, cloneTypeParameter); + mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (const tp of freshTypeParameters) { + tp.mapper = mapper; + } + } + const result2 = createSignature( + signature.declaration, + freshTypeParameters, + signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), + instantiateList(signature.parameters, mapper, instantiateSymbol), + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + signature.minArgumentCount, + signature.flags & 167 + /* PropagatingFlags */ + ); + result2.target = signature; + result2.mapper = mapper; + return result2; + } + function instantiateSymbol(symbol, mapper) { + const links = getSymbolLinks(symbol); + if (links.type && !couldContainTypeVariables(links.type)) { + if (!(symbol.flags & 65536)) { + return symbol; + } + if (links.writeType && !couldContainTypeVariables(links.writeType)) { + return symbol; + } + } + if (getCheckFlags(symbol) & 1) { + symbol = links.target; + mapper = combineTypeMappers(links.mapper, mapper); + } + const result2 = createSymbol(symbol.flags, symbol.escapedName, 1 | getCheckFlags(symbol) & (8 | 4096 | 16384 | 32768)); + result2.declarations = symbol.declarations; + result2.parent = symbol.parent; + result2.links.target = symbol; + result2.links.mapper = mapper; + if (symbol.valueDeclaration) { + result2.valueDeclaration = symbol.valueDeclaration; + } + if (links.nameType) { + result2.links.nameType = links.nameType; + } + return result2; + } + function getObjectTypeInstantiation(type3, mapper, aliasSymbol, aliasTypeArguments) { + const declaration = type3.objectFlags & 4 ? type3.node : type3.objectFlags & 8388608 ? type3.node : type3.symbol.declarations[0]; + const links = getNodeLinks(declaration); + const target = type3.objectFlags & 4 ? links.resolvedType : type3.objectFlags & 64 ? type3.target : type3; + let typeParameters = links.outerTypeParameters; + if (!typeParameters) { + let outerTypeParameters = getOuterTypeParameters( + declaration, + /*includeThisTypes*/ + true + ); + if (isJSConstructor(declaration)) { + const templateTagParameters = getTypeParametersFromDeclaration(declaration); + outerTypeParameters = addRange(outerTypeParameters, templateTagParameters); + } + typeParameters = outerTypeParameters || emptyArray; + const allDeclarations = type3.objectFlags & (4 | 8388608) ? [declaration] : type3.symbol.declarations; + typeParameters = (target.objectFlags & (4 | 8388608) || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ? filter2(typeParameters, (tp) => some2(allDeclarations, (d7) => isTypeParameterPossiblyReferenced(tp, d7))) : typeParameters; + links.outerTypeParameters = typeParameters; + } + if (typeParameters.length) { + const combinedMapper = combineTypeMappers(type3.mapper, mapper); + const typeArguments = map4(typeParameters, (t8) => getMappedType(t8, combinedMapper)); + const newAliasSymbol = aliasSymbol || type3.aliasSymbol; + const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + const id = getTypeListId(typeArguments) + getAliasId(newAliasSymbol, newAliasTypeArguments); + if (!target.instantiations) { + target.instantiations = /* @__PURE__ */ new Map(); + target.instantiations.set(getTypeListId(typeParameters) + getAliasId(target.aliasSymbol, target.aliasTypeArguments), target); + } + let result2 = target.instantiations.get(id); + if (!result2) { + const newMapper = createTypeMapper(typeParameters, typeArguments); + result2 = target.objectFlags & 4 ? createDeferredTypeReference(type3.target, type3.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments); + target.instantiations.set(id, result2); + const resultObjectFlags = getObjectFlags(result2); + if (result2.flags & 3899393 && !(resultObjectFlags & 524288)) { + const resultCouldContainTypeVariables = some2(typeArguments, couldContainTypeVariables); + if (!(getObjectFlags(result2) & 524288)) { + if (resultObjectFlags & (32 | 16 | 4)) { + result2.objectFlags |= 524288 | (resultCouldContainTypeVariables ? 1048576 : 0); + } else { + result2.objectFlags |= !resultCouldContainTypeVariables ? 524288 : 0; + } + } + } + } + return result2; + } + return type3; + } + function maybeTypeParameterReference(node) { + return !(node.parent.kind === 183 && node.parent.typeArguments && node === node.parent.typeName || node.parent.kind === 205 && node.parent.typeArguments && node === node.parent.qualifier); + } + function isTypeParameterPossiblyReferenced(tp, node) { + if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { + const container = tp.symbol.declarations[0].parent; + for (let n7 = node; n7 !== container; n7 = n7.parent) { + if (!n7 || n7.kind === 241 || n7.kind === 194 && forEachChild(n7.extendsType, containsReference)) { + return true; + } + } + return containsReference(node); + } + return true; + function containsReference(node2) { + switch (node2.kind) { + case 197: + return !!tp.isThisType; + case 80: + return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp; + case 186: + const entityName = node2.exprName; + const firstIdentifier = getFirstIdentifier(entityName); + if (!isThisIdentifier(firstIdentifier)) { + const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier); + const tpDeclaration = tp.symbol.declarations[0]; + const tpScope = tpDeclaration.kind === 168 ? tpDeclaration.parent : ( + // Type parameter is a regular type parameter, e.g. foo + tp.isThisType ? tpDeclaration : ( + // Type parameter is the this type, and its declaration is the class declaration. + void 0 + ) + ); + if (firstIdentifierSymbol.declarations && tpScope) { + return some2(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some2(node2.typeArguments, containsReference); + } + } + return true; + case 174: + case 173: + return !node2.type && !!node2.body || some2(node2.typeParameters, containsReference) || some2(node2.parameters, containsReference) || !!node2.type && containsReference(node2.type); + } + return !!forEachChild(node2, containsReference); + } + } + function getHomomorphicTypeVariable(type3) { + const constraintType = getConstraintTypeFromMappedType(type3); + if (constraintType.flags & 4194304) { + const typeVariable = getActualTypeVariable(constraintType.type); + if (typeVariable.flags & 262144) { + return typeVariable; + } + } + return void 0; + } + function instantiateMappedType(type3, mapper, aliasSymbol, aliasTypeArguments) { + const typeVariable = getHomomorphicTypeVariable(type3); + if (typeVariable) { + const mappedTypeVariable = instantiateType(typeVariable, mapper); + if (typeVariable !== mappedTypeVariable) { + return mapTypeWithAlias(getReducedType(mappedTypeVariable), instantiateConstituent, aliasSymbol, aliasTypeArguments); + } + } + return instantiateType(getConstraintTypeFromMappedType(type3), mapper) === wildcardType ? wildcardType : instantiateAnonymousType(type3, mapper, aliasSymbol, aliasTypeArguments); + function instantiateConstituent(t8) { + if (t8.flags & (3 | 58982400 | 524288 | 2097152) && t8 !== wildcardType && !isErrorType(t8)) { + if (!type3.declaration.nameType) { + let constraint; + if (isArrayType(t8) || t8.flags & 1 && findResolutionCycleStartIndex( + typeVariable, + 4 + /* ImmediateBaseConstraint */ + ) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) { + return instantiateMappedArrayType(t8, type3, prependTypeMapping(typeVariable, t8, mapper)); + } + if (isTupleType(t8)) { + return instantiateMappedTupleType(t8, type3, typeVariable, mapper); + } + if (isArrayOrTupleOrIntersection(t8)) { + return getIntersectionType(map4(t8.types, instantiateConstituent)); + } + } + return instantiateAnonymousType(type3, prependTypeMapping(typeVariable, t8, mapper)); + } + return t8; + } + } + function getModifiedReadonlyState(state, modifiers) { + return modifiers & 1 ? true : modifiers & 2 ? false : state; + } + function instantiateMappedTupleType(tupleType2, mappedType, typeVariable, mapper) { + const elementFlags = tupleType2.target.elementFlags; + const fixedLength = tupleType2.target.fixedLength; + const fixedMapper = fixedLength ? prependTypeMapping(typeVariable, tupleType2, mapper) : mapper; + const newElementTypes = map4(getElementTypes(tupleType2), (type3, i7) => { + const flags = elementFlags[i7]; + return i7 < fixedLength ? instantiateMappedTypeTemplate(mappedType, getStringLiteralType("" + i7), !!(flags & 2), fixedMapper) : flags & 8 ? instantiateType(mappedType, prependTypeMapping(typeVariable, type3, mapper)) : getElementTypeOfArrayType(instantiateType(mappedType, prependTypeMapping(typeVariable, createArrayType(type3), mapper))) ?? unknownType2; + }); + const modifiers = getMappedTypeModifiers(mappedType); + const newElementFlags = modifiers & 4 ? map4(elementFlags, (f8) => f8 & 1 ? 2 : f8) : modifiers & 8 ? map4(elementFlags, (f8) => f8 & 2 ? 1 : f8) : elementFlags; + const newReadonly = getModifiedReadonlyState(tupleType2.target.readonly, getMappedTypeModifiers(mappedType)); + return contains2(newElementTypes, errorType) ? errorType : createTupleType(newElementTypes, newElementFlags, newReadonly, tupleType2.target.labeledElementDeclarations); + } + function instantiateMappedArrayType(arrayType2, mappedType, mapper) { + const elementType = instantiateMappedTypeTemplate( + mappedType, + numberType2, + /*isOptional*/ + true, + mapper + ); + return isErrorType(elementType) ? errorType : createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType2), getMappedTypeModifiers(mappedType))); + } + function instantiateMappedTypeTemplate(type3, key, isOptional2, mapper) { + const templateMapper = appendTypeMapping(mapper, getTypeParameterFromMappedType(type3), key); + const propType = instantiateType(getTemplateTypeFromMappedType(type3.target || type3), templateMapper); + const modifiers = getMappedTypeModifiers(type3); + return strictNullChecks && modifiers & 4 && !maybeTypeOfKind( + propType, + 32768 | 16384 + /* Void */ + ) ? getOptionalType( + propType, + /*isProperty*/ + true + ) : strictNullChecks && modifiers & 8 && isOptional2 ? getTypeWithFacts( + propType, + 524288 + /* NEUndefined */ + ) : propType; + } + function instantiateAnonymousType(type3, mapper, aliasSymbol, aliasTypeArguments) { + Debug.assert(type3.symbol, "anonymous type must have symbol to be instantiated"); + const result2 = createObjectType(type3.objectFlags & ~(524288 | 1048576) | 64, type3.symbol); + if (type3.objectFlags & 32) { + result2.declaration = type3.declaration; + const origTypeParameter = getTypeParameterFromMappedType(type3); + const freshTypeParameter = cloneTypeParameter(origTypeParameter); + result2.typeParameter = freshTypeParameter; + mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper); + freshTypeParameter.mapper = mapper; + } + if (type3.objectFlags & 8388608) { + result2.node = type3.node; + } + result2.target = type3; + result2.mapper = mapper; + result2.aliasSymbol = aliasSymbol || type3.aliasSymbol; + result2.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + result2.objectFlags |= result2.aliasTypeArguments ? getPropagatingFlagsOfTypes(result2.aliasTypeArguments) : 0; + return result2; + } + function getConditionalTypeInstantiation(type3, mapper, forConstraint, aliasSymbol, aliasTypeArguments) { + const root2 = type3.root; + if (root2.outerTypeParameters) { + const typeArguments = map4(root2.outerTypeParameters, (t8) => getMappedType(t8, mapper)); + const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments); + let result2 = root2.instantiations.get(id); + if (!result2) { + const newMapper = createTypeMapper(root2.outerTypeParameters, typeArguments); + const checkType = root2.checkType; + const distributionType = root2.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0; + result2 = distributionType && checkType !== distributionType && distributionType.flags & (1048576 | 131072) ? mapTypeWithAlias(distributionType, (t8) => getConditionalType(root2, prependTypeMapping(checkType, t8, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root2, newMapper, forConstraint, aliasSymbol, aliasTypeArguments); + root2.instantiations.set(id, result2); + } + return result2; + } + return type3; + } + function instantiateType(type3, mapper) { + return type3 && mapper ? instantiateTypeWithAlias( + type3, + mapper, + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0 + ) : type3; + } + function instantiateTypeWithAlias(type3, mapper, aliasSymbol, aliasTypeArguments) { + var _a2; + if (!couldContainTypeVariables(type3)) { + return type3; + } + if (instantiationDepth === 100 || instantiationCount >= 5e6) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "instantiateType_DepthLimit", { typeId: type3.id, instantiationDepth, instantiationCount }); + error22(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite); + return errorType; + } + totalInstantiationCount++; + instantiationCount++; + instantiationDepth++; + const result2 = instantiateTypeWorker(type3, mapper, aliasSymbol, aliasTypeArguments); + instantiationDepth--; + return result2; + } + function instantiateTypeWorker(type3, mapper, aliasSymbol, aliasTypeArguments) { + const flags = type3.flags; + if (flags & 262144) { + return getMappedType(type3, mapper); + } + if (flags & 524288) { + const objectFlags = type3.objectFlags; + if (objectFlags & (4 | 16 | 32)) { + if (objectFlags & 4 && !type3.node) { + const resolvedTypeArguments = type3.resolvedTypeArguments; + const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper); + return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type3.target, newTypeArguments) : type3; + } + if (objectFlags & 1024) { + return instantiateReverseMappedType(type3, mapper); + } + return getObjectTypeInstantiation(type3, mapper, aliasSymbol, aliasTypeArguments); + } + return type3; + } + if (flags & 3145728) { + const origin = type3.flags & 1048576 ? type3.origin : void 0; + const types3 = origin && origin.flags & 3145728 ? origin.types : type3.types; + const newTypes = instantiateTypes(types3, mapper); + if (newTypes === types3 && aliasSymbol === type3.aliasSymbol) { + return type3; + } + const newAliasSymbol = aliasSymbol || type3.aliasSymbol; + const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + return flags & 2097152 || origin && origin.flags & 2097152 ? getIntersectionType(newTypes, newAliasSymbol, newAliasTypeArguments) : getUnionType(newTypes, 1, newAliasSymbol, newAliasTypeArguments); + } + if (flags & 4194304) { + return getIndexType(instantiateType(type3.type, mapper)); + } + if (flags & 134217728) { + return getTemplateLiteralType(type3.texts, instantiateTypes(type3.types, mapper)); + } + if (flags & 268435456) { + return getStringMappingType(type3.symbol, instantiateType(type3.type, mapper)); + } + if (flags & 8388608) { + const newAliasSymbol = aliasSymbol || type3.aliasSymbol; + const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type3.aliasTypeArguments, mapper); + return getIndexedAccessType( + instantiateType(type3.objectType, mapper), + instantiateType(type3.indexType, mapper), + type3.accessFlags, + /*accessNode*/ + void 0, + newAliasSymbol, + newAliasTypeArguments + ); + } + if (flags & 16777216) { + return getConditionalTypeInstantiation( + type3, + combineTypeMappers(type3.mapper, mapper), + /*forConstraint*/ + false, + aliasSymbol, + aliasTypeArguments + ); + } + if (flags & 33554432) { + const newBaseType = instantiateType(type3.baseType, mapper); + if (isNoInferType(type3)) { + return getNoInferType(newBaseType); + } + const newConstraint = instantiateType(type3.constraint, mapper); + if (newBaseType.flags & 8650752 && isGenericType(newConstraint)) { + return getSubstitutionType(newBaseType, newConstraint); + } + if (newConstraint.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(newBaseType), getRestrictiveInstantiation(newConstraint))) { + return newBaseType; + } + return newBaseType.flags & 8650752 ? getSubstitutionType(newBaseType, newConstraint) : getIntersectionType([newConstraint, newBaseType]); + } + return type3; + } + function instantiateReverseMappedType(type3, mapper) { + const innerMappedType = instantiateType(type3.mappedType, mapper); + if (!(getObjectFlags(innerMappedType) & 32)) { + return type3; + } + const innerIndexType = instantiateType(type3.constraintType, mapper); + if (!(innerIndexType.flags & 4194304)) { + return type3; + } + const instantiated = inferTypeForHomomorphicMappedType( + instantiateType(type3.source, mapper), + innerMappedType, + innerIndexType + ); + if (instantiated) { + return instantiated; + } + return type3; + } + function getPermissiveInstantiation(type3) { + return type3.flags & (402784252 | 3 | 131072) ? type3 : type3.permissiveInstantiation || (type3.permissiveInstantiation = instantiateType(type3, permissiveMapper)); + } + function getRestrictiveInstantiation(type3) { + if (type3.flags & (402784252 | 3 | 131072)) { + return type3; + } + if (type3.restrictiveInstantiation) { + return type3.restrictiveInstantiation; + } + type3.restrictiveInstantiation = instantiateType(type3, restrictiveMapper); + type3.restrictiveInstantiation.restrictiveInstantiation = type3.restrictiveInstantiation; + return type3.restrictiveInstantiation; + } + function instantiateIndexInfo(info2, mapper) { + return createIndexInfo(info2.keyType, instantiateType(info2.type, mapper), info2.isReadonly, info2.declaration); + } + function isContextSensitive(node) { + Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node)); + switch (node.kind) { + case 218: + case 219: + case 174: + case 262: + return isContextSensitiveFunctionLikeDeclaration(node); + case 210: + return some2(node.properties, isContextSensitive); + case 209: + return some2(node.elements, isContextSensitive); + case 227: + return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); + case 226: + return (node.operatorToken.kind === 57 || node.operatorToken.kind === 61) && (isContextSensitive(node.left) || isContextSensitive(node.right)); + case 303: + return isContextSensitive(node.initializer); + case 217: + return isContextSensitive(node.expression); + case 292: + return some2(node.properties, isContextSensitive) || isJsxOpeningElement(node.parent) && some2(node.parent.parent.children, isContextSensitive); + case 291: { + const { initializer } = node; + return !!initializer && isContextSensitive(initializer); + } + case 294: { + const { expression } = node; + return !!expression && isContextSensitive(expression); + } + } + return false; + } + function isContextSensitiveFunctionLikeDeclaration(node) { + return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node); + } + function hasContextSensitiveReturnExpression(node) { + if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) { + return false; + } + if (node.body.kind !== 241) { + return isContextSensitive(node.body); + } + return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression)); + } + function isContextSensitiveFunctionOrObjectLiteralMethod(func) { + return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); + } + function getTypeWithoutSignatures(type3) { + if (type3.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type3); + if (resolved.constructSignatures.length || resolved.callSignatures.length) { + const result2 = createObjectType(16, type3.symbol); + result2.members = resolved.members; + result2.properties = resolved.properties; + result2.callSignatures = emptyArray; + result2.constructSignatures = emptyArray; + result2.indexInfos = emptyArray; + return result2; + } + } else if (type3.flags & 2097152) { + return getIntersectionType(map4(type3.types, getTypeWithoutSignatures)); + } + return type3; + } + function isTypeIdenticalTo(source, target) { + return isTypeRelatedTo(source, target, identityRelation); + } + function compareTypesIdentical(source, target) { + return isTypeRelatedTo(source, target, identityRelation) ? -1 : 0; + } + function compareTypesAssignable(source, target) { + return isTypeRelatedTo(source, target, assignableRelation) ? -1 : 0; + } + function compareTypesSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, subtypeRelation) ? -1 : 0; + } + function isTypeSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, subtypeRelation); + } + function isTypeStrictSubtypeOf(source, target) { + return isTypeRelatedTo(source, target, strictSubtypeRelation); + } + function isTypeAssignableTo(source, target) { + return isTypeRelatedTo(source, target, assignableRelation); + } + function isTypeDerivedFrom(source, target) { + return source.flags & 1048576 ? every2(source.types, (t8) => isTypeDerivedFrom(t8, target)) : target.flags & 1048576 ? some2(target.types, (t8) => isTypeDerivedFrom(source, t8)) : source.flags & 2097152 ? some2(source.types, (t8) => isTypeDerivedFrom(t8, target)) : source.flags & 58982400 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType2, target) : isEmptyAnonymousObjectType(target) ? !!(source.flags & (524288 | 67108864)) : target === globalObjectType ? !!(source.flags & (524288 | 67108864)) && !isEmptyAnonymousObjectType(source) : target === globalFunctionType ? !!(source.flags & 524288) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType); + } + function isTypeComparableTo(source, target) { + return isTypeRelatedTo(source, target, comparableRelation); + } + function areTypesComparable(type1, type22) { + return isTypeComparableTo(type1, type22) || isTypeComparableTo(type22, type1); + } + function checkTypeAssignableTo(source, target, errorNode, headMessage, containingMessageChain, errorOutputObject) { + return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain, errorOutputObject); + } + function checkTypeAssignableToAndOptionallyElaborate(source, target, errorNode, expr, headMessage, containingMessageChain) { + return checkTypeRelatedToAndOptionallyElaborate( + source, + target, + assignableRelation, + errorNode, + expr, + headMessage, + containingMessageChain, + /*errorOutputContainer*/ + void 0 + ); + } + function checkTypeRelatedToAndOptionallyElaborate(source, target, relation, errorNode, expr, headMessage, containingMessageChain, errorOutputContainer) { + if (isTypeRelatedTo(source, target, relation)) + return true; + if (!errorNode || !elaborateError(expr, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { + return checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer); + } + return false; + } + function isOrHasGenericConditional(type3) { + return !!(type3.flags & 16777216 || type3.flags & 2097152 && some2(type3.types, isOrHasGenericConditional)); + } + function elaborateError(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { + if (!node || isOrHasGenericConditional(target)) + return false; + if (!checkTypeRelatedTo( + source, + target, + relation, + /*errorNode*/ + void 0 + ) && elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer)) { + return true; + } + switch (node.kind) { + case 234: + if (!isConstAssertion(node)) { + break; + } + case 294: + case 217: + return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); + case 226: + switch (node.operatorToken.kind) { + case 64: + case 28: + return elaborateError(node.right, source, target, relation, headMessage, containingMessageChain, errorOutputContainer); + } + break; + case 210: + return elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 209: + return elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 292: + return elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer); + case 219: + return elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer); + } + return false; + } + function elaborateDidYouMeanToCallOrConstruct(node, source, target, relation, headMessage, containingMessageChain, errorOutputContainer) { + const callSignatures = getSignaturesOfType( + source, + 0 + /* Call */ + ); + const constructSignatures = getSignaturesOfType( + source, + 1 + /* Construct */ + ); + for (const signatures of [constructSignatures, callSignatures]) { + if (some2(signatures, (s7) => { + const returnType = getReturnTypeOfSignature(s7); + return !(returnType.flags & (1 | 131072)) && checkTypeRelatedTo( + returnType, + target, + relation, + /*errorNode*/ + void 0 + ); + })) { + const resultObj = errorOutputContainer || {}; + checkTypeAssignableTo(source, target, node, headMessage, containingMessageChain, resultObj); + const diagnostic = resultObj.errors[resultObj.errors.length - 1]; + addRelatedInfo( + diagnostic, + createDiagnosticForNode( + node, + signatures === constructSignatures ? Diagnostics.Did_you_mean_to_use_new_with_this_expression : Diagnostics.Did_you_mean_to_call_this_expression + ) + ); + return true; + } + } + return false; + } + function elaborateArrowFunction(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (isBlock2(node.body)) { + return false; + } + if (some2(node.parameters, hasType)) { + return false; + } + const sourceSig = getSingleCallSignature(source); + if (!sourceSig) { + return false; + } + const targetSignatures = getSignaturesOfType( + target, + 0 + /* Call */ + ); + if (!length(targetSignatures)) { + return false; + } + const returnExpression = node.body; + const sourceReturn = getReturnTypeOfSignature(sourceSig); + const targetReturn = getUnionType(map4(targetSignatures, getReturnTypeOfSignature)); + if (!checkTypeRelatedTo( + sourceReturn, + targetReturn, + relation, + /*errorNode*/ + void 0 + )) { + const elaborated = returnExpression && elaborateError( + returnExpression, + sourceReturn, + targetReturn, + relation, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + if (elaborated) { + return elaborated; + } + const resultObj = errorOutputContainer || {}; + checkTypeRelatedTo( + sourceReturn, + targetReturn, + relation, + returnExpression, + /*headMessage*/ + void 0, + containingMessageChain, + resultObj + ); + if (resultObj.errors) { + if (target.symbol && length(target.symbol.declarations)) { + addRelatedInfo( + resultObj.errors[resultObj.errors.length - 1], + createDiagnosticForNode( + target.symbol.declarations[0], + Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature + ) + ); + } + if ((getFunctionFlags(node) & 2) === 0 && !getTypeOfPropertyOfType(sourceReturn, "then") && checkTypeRelatedTo( + createPromiseType(sourceReturn), + targetReturn, + relation, + /*errorNode*/ + void 0 + )) { + addRelatedInfo( + resultObj.errors[resultObj.errors.length - 1], + createDiagnosticForNode( + node, + Diagnostics.Did_you_mean_to_mark_this_function_as_async + ) + ); + } + return true; + } + } + return false; + } + function getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType) { + const idx = getIndexedAccessTypeOrUndefined(target, nameType); + if (idx) { + return idx; + } + if (target.flags & 1048576) { + const best = getBestMatchingType(source, target); + if (best) { + return getIndexedAccessTypeOrUndefined(best, nameType); + } + } + } + function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) { + pushContextualType( + next, + sourcePropType, + /*isCache*/ + false + ); + const result2 = checkExpressionForMutableLocation( + next, + 1 + /* Contextual */ + ); + popContextualType(); + return result2; + } + function elaborateElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) { + let reportedError = false; + for (const value2 of iterator) { + const { errorNode: prop, innerExpression: next, nameType, errorMessage } = value2; + let targetPropType = getBestMatchIndexedAccessTypeOrUndefined(source, target, nameType); + if (!targetPropType || targetPropType.flags & 8388608) + continue; + let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); + if (!sourcePropType) + continue; + const propName2 = getPropertyNameFromIndex( + nameType, + /*accessNode*/ + void 0 + ); + if (!checkTypeRelatedTo( + sourcePropType, + targetPropType, + relation, + /*errorNode*/ + void 0 + )) { + const elaborated = next && elaborateError( + next, + sourcePropType, + targetPropType, + relation, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + reportedError = true; + if (!elaborated) { + const resultObj = errorOutputContainer || {}; + const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType; + if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) { + const diag2 = createDiagnosticForNode(prop, Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType)); + diagnostics.add(diag2); + resultObj.errors = [diag2]; + } else { + const targetIsOptional = !!(propName2 && (getPropertyOfType(target, propName2) || unknownSymbol).flags & 16777216); + const sourceIsOptional = !!(propName2 && (getPropertyOfType(source, propName2) || unknownSymbol).flags & 16777216); + targetPropType = removeMissingType(targetPropType, targetIsOptional); + sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional); + const result2 = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + if (result2 && specificSource !== sourcePropType) { + checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + } + } + if (resultObj.errors) { + const reportedDiag = resultObj.errors[resultObj.errors.length - 1]; + const propertyName = isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : void 0; + const targetProp = propertyName !== void 0 ? getPropertyOfType(target, propertyName) : void 0; + let issuedElaboration = false; + if (!targetProp) { + const indexInfo = getApplicableIndexInfo(target, nameType); + if (indexInfo && indexInfo.declaration && !getSourceFileOfNode(indexInfo.declaration).hasNoDefaultLib) { + issuedElaboration = true; + addRelatedInfo(reportedDiag, createDiagnosticForNode(indexInfo.declaration, Diagnostics.The_expected_type_comes_from_this_index_signature)); + } + } + if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) { + const targetNode = targetProp && length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0]; + if (!getSourceFileOfNode(targetNode).hasNoDefaultLib) { + addRelatedInfo( + reportedDiag, + createDiagnosticForNode( + targetNode, + Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, + propertyName && !(nameType.flags & 8192) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType), + typeToString(target) + ) + ); + } + } + } + } + } + } + return reportedError; + } + function elaborateIterableOrArrayLikeTargetElementwise(iterator, source, target, relation, containingMessageChain, errorOutputContainer) { + const tupleOrArrayLikeTargetParts = filterType(target, isArrayOrTupleLikeType); + const nonTupleOrArrayLikeTargetParts = filterType(target, (t8) => !isArrayOrTupleLikeType(t8)); + const iterationType = nonTupleOrArrayLikeTargetParts !== neverType2 ? getIterationTypeOfIterable( + 13, + 0, + nonTupleOrArrayLikeTargetParts, + /*errorNode*/ + void 0 + ) : void 0; + let reportedError = false; + for (let status = iterator.next(); !status.done; status = iterator.next()) { + const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value; + let targetPropType = iterationType; + const targetIndexedPropType = tupleOrArrayLikeTargetParts !== neverType2 ? getBestMatchIndexedAccessTypeOrUndefined(source, tupleOrArrayLikeTargetParts, nameType) : void 0; + if (targetIndexedPropType && !(targetIndexedPropType.flags & 8388608)) { + targetPropType = iterationType ? getUnionType([iterationType, targetIndexedPropType]) : targetIndexedPropType; + } + if (!targetPropType) + continue; + let sourcePropType = getIndexedAccessTypeOrUndefined(source, nameType); + if (!sourcePropType) + continue; + const propName2 = getPropertyNameFromIndex( + nameType, + /*accessNode*/ + void 0 + ); + if (!checkTypeRelatedTo( + sourcePropType, + targetPropType, + relation, + /*errorNode*/ + void 0 + )) { + const elaborated = next && elaborateError( + next, + sourcePropType, + targetPropType, + relation, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + reportedError = true; + if (!elaborated) { + const resultObj = errorOutputContainer || {}; + const specificSource = next ? checkExpressionForMutableLocationWithContextualType(next, sourcePropType) : sourcePropType; + if (exactOptionalPropertyTypes && isExactOptionalPropertyMismatch(specificSource, targetPropType)) { + const diag2 = createDiagnosticForNode(prop, Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target, typeToString(specificSource), typeToString(targetPropType)); + diagnostics.add(diag2); + resultObj.errors = [diag2]; + } else { + const targetIsOptional = !!(propName2 && (getPropertyOfType(tupleOrArrayLikeTargetParts, propName2) || unknownSymbol).flags & 16777216); + const sourceIsOptional = !!(propName2 && (getPropertyOfType(source, propName2) || unknownSymbol).flags & 16777216); + targetPropType = removeMissingType(targetPropType, targetIsOptional); + sourcePropType = removeMissingType(sourcePropType, targetIsOptional && sourceIsOptional); + const result2 = checkTypeRelatedTo(specificSource, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + if (result2 && specificSource !== sourcePropType) { + checkTypeRelatedTo(sourcePropType, targetPropType, relation, prop, errorMessage, containingMessageChain, resultObj); + } + } + } + } + } + return reportedError; + } + function* generateJsxAttributes(node) { + if (!length(node.properties)) + return; + for (const prop of node.properties) { + if (isJsxSpreadAttribute(prop) || isHyphenatedJsxName(getTextOfJsxAttributeName(prop.name))) + continue; + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: getStringLiteralType(getTextOfJsxAttributeName(prop.name)) }; + } + } + function* generateJsxChildren(node, getInvalidTextDiagnostic) { + if (!length(node.children)) + return; + let memberOffset = 0; + for (let i7 = 0; i7 < node.children.length; i7++) { + const child = node.children[i7]; + const nameType = getNumberLiteralType(i7 - memberOffset); + const elem = getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic); + if (elem) { + yield elem; + } else { + memberOffset++; + } + } + } + function getElaborationElementForJsxChild(child, nameType, getInvalidTextDiagnostic) { + switch (child.kind) { + case 294: + return { errorNode: child, innerExpression: child.expression, nameType }; + case 12: + if (child.containsOnlyTriviaWhiteSpaces) { + break; + } + return { errorNode: child, innerExpression: void 0, nameType, errorMessage: getInvalidTextDiagnostic() }; + case 284: + case 285: + case 288: + return { errorNode: child, innerExpression: child, nameType }; + default: + return Debug.assertNever(child, "Found invalid jsx child"); + } + } + function elaborateJsxComponents(node, source, target, relation, containingMessageChain, errorOutputContainer) { + let result2 = elaborateElementwise(generateJsxAttributes(node), source, target, relation, containingMessageChain, errorOutputContainer); + let invalidTextDiagnostic; + if (isJsxOpeningElement(node.parent) && isJsxElement(node.parent.parent)) { + const containingElement = node.parent.parent; + const childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + const childrenPropName = childPropName === void 0 ? "children" : unescapeLeadingUnderscores(childPropName); + const childrenNameType = getStringLiteralType(childrenPropName); + const childrenTargetType = getIndexedAccessType(target, childrenNameType); + const validChildren = getSemanticJsxChildren(containingElement.children); + if (!length(validChildren)) { + return result2; + } + const moreThanOneRealChildren = length(validChildren) > 1; + let arrayLikeTargetParts; + let nonArrayLikeTargetParts; + const iterableType = getGlobalIterableType( + /*reportErrors*/ + false + ); + if (iterableType !== emptyGenericType) { + const anyIterable = createIterableType(anyType2); + arrayLikeTargetParts = filterType(childrenTargetType, (t8) => isTypeAssignableTo(t8, anyIterable)); + nonArrayLikeTargetParts = filterType(childrenTargetType, (t8) => !isTypeAssignableTo(t8, anyIterable)); + } else { + arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType); + nonArrayLikeTargetParts = filterType(childrenTargetType, (t8) => !isArrayOrTupleLikeType(t8)); + } + if (moreThanOneRealChildren) { + if (arrayLikeTargetParts !== neverType2) { + const realSource = createTupleType(checkJsxChildren( + containingElement, + 0 + /* Normal */ + )); + const children = generateJsxChildren(containingElement, getInvalidTextualChildDiagnostic); + result2 = elaborateIterableOrArrayLikeTargetElementwise(children, realSource, arrayLikeTargetParts, relation, containingMessageChain, errorOutputContainer) || result2; + } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + result2 = true; + const diag2 = error22( + containingElement.openingElement.tagName, + Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided, + childrenPropName, + typeToString(childrenTargetType) + ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); + } + } + } else { + if (nonArrayLikeTargetParts !== neverType2) { + const child = validChildren[0]; + const elem = getElaborationElementForJsxChild(child, childrenNameType, getInvalidTextualChildDiagnostic); + if (elem) { + result2 = elaborateElementwise( + function* () { + yield elem; + }(), + source, + target, + relation, + containingMessageChain, + errorOutputContainer + ) || result2; + } + } else if (!isTypeRelatedTo(getIndexedAccessType(source, childrenNameType), childrenTargetType, relation)) { + result2 = true; + const diag2 = error22( + containingElement.openingElement.tagName, + Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided, + childrenPropName, + typeToString(childrenTargetType) + ); + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); + } + } + } + } + return result2; + function getInvalidTextualChildDiagnostic() { + if (!invalidTextDiagnostic) { + const tagNameText = getTextOfNode(node.parent.tagName); + const childPropName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + const childrenPropName = childPropName === void 0 ? "children" : unescapeLeadingUnderscores(childPropName); + const childrenTargetType = getIndexedAccessType(target, getStringLiteralType(childrenPropName)); + const diagnostic = Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2; + invalidTextDiagnostic = { ...diagnostic, key: "!!ALREADY FORMATTED!!", message: formatMessage(diagnostic, tagNameText, childrenPropName, typeToString(childrenTargetType)) }; + } + return invalidTextDiagnostic; + } + } + function* generateLimitedTupleElements(node, target) { + const len = length(node.elements); + if (!len) + return; + for (let i7 = 0; i7 < len; i7++) { + if (isTupleLikeType(target) && !getPropertyOfType(target, "" + i7)) + continue; + const elem = node.elements[i7]; + if (isOmittedExpression(elem)) + continue; + const nameType = getNumberLiteralType(i7); + const checkNode = getEffectiveCheckNode(elem); + yield { errorNode: checkNode, innerExpression: checkNode, nameType }; + } + } + function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (target.flags & (402784252 | 131072)) + return false; + if (isTupleLikeType(source)) { + return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer); + } + pushContextualType( + node, + target, + /*isCache*/ + false + ); + const tupleizedType = checkArrayLiteral( + node, + 1, + /*forceTuple*/ + true + ); + popContextualType(); + if (isTupleLikeType(tupleizedType)) { + return elaborateElementwise(generateLimitedTupleElements(node, target), tupleizedType, target, relation, containingMessageChain, errorOutputContainer); + } + return false; + } + function* generateObjectLiteralElements(node) { + if (!length(node.properties)) + return; + for (const prop of node.properties) { + if (isSpreadAssignment(prop)) + continue; + const type3 = getLiteralTypeFromProperty( + getSymbolOfDeclaration(prop), + 8576 + /* StringOrNumberLiteralOrUnique */ + ); + if (!type3 || type3.flags & 131072) { + continue; + } + switch (prop.kind) { + case 178: + case 177: + case 174: + case 304: + yield { errorNode: prop.name, innerExpression: void 0, nameType: type3 }; + break; + case 303: + yield { errorNode: prop.name, innerExpression: prop.initializer, nameType: type3, errorMessage: isComputedNonLiteralName(prop.name) ? Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1 : void 0 }; + break; + default: + Debug.assertNever(prop); + } + } + } + function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) { + if (target.flags & (402784252 | 131072)) + return false; + return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer); + } + function checkTypeComparableTo(source, target, errorNode, headMessage, containingMessageChain) { + return checkTypeRelatedTo(source, target, comparableRelation, errorNode, headMessage, containingMessageChain); + } + function isSignatureAssignableTo(source, target, ignoreReturnTypes) { + return compareSignaturesRelated( + source, + target, + ignoreReturnTypes ? 4 : 0, + /*reportErrors*/ + false, + /*errorReporter*/ + void 0, + /*incompatibleErrorReporter*/ + void 0, + compareTypesAssignable, + /*reportUnreliableMarkers*/ + void 0 + ) !== 0; + } + function isTopSignature(s7) { + if (!s7.typeParameters && (!s7.thisParameter || isTypeAny(getTypeOfParameter(s7.thisParameter))) && s7.parameters.length === 1 && signatureHasRestParameter(s7)) { + const paramType = getTypeOfParameter(s7.parameters[0]); + const restType = isArrayType(paramType) ? getTypeArguments(paramType)[0] : paramType; + return !!(restType.flags & (1 | 131072) && getReturnTypeOfSignature(s7).flags & 3); + } + return false; + } + function compareSignaturesRelated(source, target, checkMode, reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) { + if (source === target) { + return -1; + } + if (!(checkMode & 16 && isTopSignature(source)) && isTopSignature(target)) { + return -1; + } + if (checkMode & 16 && isTopSignature(source) && !isTopSignature(target)) { + return 0; + } + const targetCount = getParameterCount(target); + const sourceHasMoreParameters = !hasEffectiveRestParameter(target) && (checkMode & 8 ? hasEffectiveRestParameter(source) || getParameterCount(source) > targetCount : getMinArgumentCount(source) > targetCount); + if (sourceHasMoreParameters) { + if (reportErrors2 && !(checkMode & 8)) { + errorReporter(Diagnostics.Target_signature_provides_too_few_arguments_Expected_0_or_more_but_got_1, getMinArgumentCount(source), targetCount); + } + return 0; + } + if (source.typeParameters && source.typeParameters !== target.typeParameters) { + target = getCanonicalSignature(target); + source = instantiateSignatureInContextOf( + source, + target, + /*inferenceContext*/ + void 0, + compareTypes + ); + } + const sourceCount = getParameterCount(source); + const sourceRestType = getNonArrayRestType(source); + const targetRestType = getNonArrayRestType(target); + if (sourceRestType || targetRestType) { + void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers); + } + const kind = target.declaration ? target.declaration.kind : 0; + const strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 174 && kind !== 173 && kind !== 176; + let result2 = -1; + const sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType && sourceThisType !== voidType2) { + const targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + const related = !strictVariance && compareTypes( + sourceThisType, + targetThisType, + /*reportErrors*/ + false + ) || compareTypes(targetThisType, sourceThisType, reportErrors2); + if (!related) { + if (reportErrors2) { + errorReporter(Diagnostics.The_this_types_of_each_signature_are_incompatible); + } + return 0; + } + result2 &= related; + } + } + const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount); + const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1; + for (let i7 = 0; i7 < paramCount; i7++) { + const sourceType = i7 === restIndex ? getRestOrAnyTypeAtPosition(source, i7) : tryGetTypeAtPosition(source, i7); + const targetType = i7 === restIndex ? getRestOrAnyTypeAtPosition(target, i7) : tryGetTypeAtPosition(target, i7); + if (sourceType && targetType) { + const sourceSig = checkMode & 3 || isInstantiatedGenericParameter(source, i7) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType)); + const targetSig = checkMode & 3 || isInstantiatedGenericParameter(target, i7) ? void 0 : getSingleCallSignature(getNonNullableType(targetType)); + const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts( + sourceType, + 50331648 + /* IsUndefinedOrNull */ + ) === getTypeFacts( + targetType, + 50331648 + /* IsUndefinedOrNull */ + ); + let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 | (strictVariance ? 2 : 1), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3) && !strictVariance && compareTypes( + sourceType, + targetType, + /*reportErrors*/ + false + ) || compareTypes(targetType, sourceType, reportErrors2); + if (related && checkMode & 8 && i7 >= getMinArgumentCount(source) && i7 < getMinArgumentCount(target) && compareTypes( + sourceType, + targetType, + /*reportErrors*/ + false + )) { + related = 0; + } + if (!related) { + if (reportErrors2) { + errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, unescapeLeadingUnderscores(getParameterNameAtPosition(source, i7)), unescapeLeadingUnderscores(getParameterNameAtPosition(target, i7))); + } + return 0; + } + result2 &= related; + } + } + if (!(checkMode & 4)) { + const targetReturnType = isResolvingReturnTypeOfSignature(target) ? anyType2 : target.declaration && isJSConstructor(target.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(target.declaration.symbol)) : getReturnTypeOfSignature(target); + if (targetReturnType === voidType2 || targetReturnType === anyType2) { + return result2; + } + const sourceReturnType = isResolvingReturnTypeOfSignature(source) ? anyType2 : source.declaration && isJSConstructor(source.declaration) ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(source.declaration.symbol)) : getReturnTypeOfSignature(source); + const targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + const sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result2 &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, reportErrors2, errorReporter, compareTypes); + } else if (isIdentifierTypePredicate(targetTypePredicate)) { + if (reportErrors2) { + errorReporter(Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); + } + return 0; + } + } else { + result2 &= checkMode & 1 && compareTypes( + targetReturnType, + sourceReturnType, + /*reportErrors*/ + false + ) || compareTypes(sourceReturnType, targetReturnType, reportErrors2); + if (!result2 && reportErrors2 && incompatibleErrorReporter) { + incompatibleErrorReporter(sourceReturnType, targetReturnType); + } + } + } + return result2; + } + function compareTypePredicateRelatedTo(source, target, reportErrors2, errorReporter, compareTypes) { + if (source.kind !== target.kind) { + if (reportErrors2) { + errorReporter(Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard); + errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return 0; + } + if (source.kind === 1 || source.kind === 3) { + if (source.parameterIndex !== target.parameterIndex) { + if (reportErrors2) { + errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, target.parameterName); + errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return 0; + } + } + const related = source.type === target.type ? -1 : source.type && target.type ? compareTypes(source.type, target.type, reportErrors2) : 0; + if (related === 0 && reportErrors2) { + errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); + } + return related; + } + function isImplementationCompatibleWithOverload(implementation, overload) { + const erasedSource = getErasedSignature(implementation); + const erasedTarget = getErasedSignature(overload); + const sourceReturnType = getReturnTypeOfSignature(erasedSource); + const targetReturnType = getReturnTypeOfSignature(erasedTarget); + if (targetReturnType === voidType2 || isTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation) || isTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation)) { + return isSignatureAssignableTo( + erasedSource, + erasedTarget, + /*ignoreReturnTypes*/ + true + ); + } + return false; + } + function isEmptyResolvedType(t8) { + return t8 !== anyFunctionType && t8.properties.length === 0 && t8.callSignatures.length === 0 && t8.constructSignatures.length === 0 && t8.indexInfos.length === 0; + } + function isEmptyObjectType(type3) { + return type3.flags & 524288 ? !isGenericMappedType(type3) && isEmptyResolvedType(resolveStructuredTypeMembers(type3)) : type3.flags & 67108864 ? true : type3.flags & 1048576 ? some2(type3.types, isEmptyObjectType) : type3.flags & 2097152 ? every2(type3.types, isEmptyObjectType) : false; + } + function isEmptyAnonymousObjectType(type3) { + return !!(getObjectFlags(type3) & 16 && (type3.members && isEmptyResolvedType(type3) || type3.symbol && type3.symbol.flags & 2048 && getMembersOfSymbol(type3.symbol).size === 0)); + } + function isUnknownLikeUnionType(type3) { + if (strictNullChecks && type3.flags & 1048576) { + if (!(type3.objectFlags & 33554432)) { + const types3 = type3.types; + type3.objectFlags |= 33554432 | (types3.length >= 3 && types3[0].flags & 32768 && types3[1].flags & 65536 && some2(types3, isEmptyAnonymousObjectType) ? 67108864 : 0); + } + return !!(type3.objectFlags & 67108864); + } + return false; + } + function containsUndefinedType(type3) { + return !!((type3.flags & 1048576 ? type3.types[0] : type3).flags & 32768); + } + function isStringIndexSignatureOnlyType(type3) { + return type3.flags & 524288 && !isGenericMappedType(type3) && getPropertiesOfType(type3).length === 0 && getIndexInfosOfType(type3).length === 1 && !!getIndexInfoOfType(type3, stringType2) || type3.flags & 3145728 && every2(type3.types, isStringIndexSignatureOnlyType) || false; + } + function isEnumTypeRelatedTo(source, target, errorReporter) { + const sourceSymbol = source.flags & 8 ? getParentOfSymbol(source) : source; + const targetSymbol = target.flags & 8 ? getParentOfSymbol(target) : target; + if (sourceSymbol === targetSymbol) { + return true; + } + if (sourceSymbol.escapedName !== targetSymbol.escapedName || !(sourceSymbol.flags & 256) || !(targetSymbol.flags & 256)) { + return false; + } + const id = getSymbolId(sourceSymbol) + "," + getSymbolId(targetSymbol); + const entry = enumRelation.get(id); + if (entry !== void 0 && !(!(entry & 4) && entry & 2 && errorReporter)) { + return !!(entry & 1); + } + const targetEnumType = getTypeOfSymbol(targetSymbol); + for (const sourceProperty of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) { + if (sourceProperty.flags & 8) { + const targetProperty = getPropertyOfType(targetEnumType, sourceProperty.escapedName); + if (!targetProperty || !(targetProperty.flags & 8)) { + if (errorReporter) { + errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(sourceProperty), typeToString( + getDeclaredTypeOfSymbol(targetSymbol), + /*enclosingDeclaration*/ + void 0, + 64 + /* UseFullyQualifiedType */ + )); + enumRelation.set( + id, + 2 | 4 + /* Reported */ + ); + } else { + enumRelation.set( + id, + 2 + /* Failed */ + ); + } + return false; + } + const sourceValue = getEnumMemberValue(getDeclarationOfKind( + sourceProperty, + 306 + /* EnumMember */ + )); + const targetValue = getEnumMemberValue(getDeclarationOfKind( + targetProperty, + 306 + /* EnumMember */ + )); + if (sourceValue !== targetValue) { + const sourceIsString = typeof sourceValue === "string"; + const targetIsString = typeof targetValue === "string"; + if (sourceValue !== void 0 && targetValue !== void 0) { + if (!errorReporter) { + enumRelation.set( + id, + 2 + /* Failed */ + ); + } else { + const escapedSource = sourceIsString ? `"${escapeString2(sourceValue)}"` : sourceValue; + const escapedTarget = targetIsString ? `"${escapeString2(targetValue)}"` : targetValue; + errorReporter(Diagnostics.Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given, symbolName(targetSymbol), symbolName(targetProperty), escapedTarget, escapedSource); + enumRelation.set( + id, + 2 | 4 + /* Reported */ + ); + } + return false; + } + if (sourceIsString || targetIsString) { + if (!errorReporter) { + enumRelation.set( + id, + 2 + /* Failed */ + ); + } else { + const knownStringValue = sourceValue ?? targetValue; + Debug.assert(typeof knownStringValue === "string"); + const escapedValue = `"${escapeString2(knownStringValue)}"`; + errorReporter(Diagnostics.One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value, symbolName(targetSymbol), symbolName(targetProperty), escapedValue); + enumRelation.set( + id, + 2 | 4 + /* Reported */ + ); + } + return false; + } + } + } + } + enumRelation.set( + id, + 1 + /* Succeeded */ + ); + return true; + } + function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { + const s7 = source.flags; + const t8 = target.flags; + if (t8 & 1 || s7 & 131072 || source === wildcardType) + return true; + if (t8 & 2 && !(relation === strictSubtypeRelation && s7 & 1)) + return true; + if (t8 & 131072) + return false; + if (s7 & 402653316 && t8 & 4) + return true; + if (s7 & 128 && s7 & 1024 && t8 & 128 && !(t8 & 1024) && source.value === target.value) + return true; + if (s7 & 296 && t8 & 8) + return true; + if (s7 & 256 && s7 & 1024 && t8 & 256 && !(t8 & 1024) && source.value === target.value) + return true; + if (s7 & 2112 && t8 & 64) + return true; + if (s7 & 528 && t8 & 16) + return true; + if (s7 & 12288 && t8 & 4096) + return true; + if (s7 & 32 && t8 & 32 && source.symbol.escapedName === target.symbol.escapedName && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) + return true; + if (s7 & 1024 && t8 & 1024) { + if (s7 & 1048576 && t8 & 1048576 && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) + return true; + if (s7 & 2944 && t8 & 2944 && source.value === target.value && isEnumTypeRelatedTo(source.symbol, target.symbol, errorReporter)) + return true; + } + if (s7 & 32768 && (!strictNullChecks && !(t8 & 3145728) || t8 & (32768 | 16384))) + return true; + if (s7 & 65536 && (!strictNullChecks && !(t8 & 3145728) || t8 & 65536)) + return true; + if (s7 & 524288 && t8 & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 8192))) + return true; + if (relation === assignableRelation || relation === comparableRelation) { + if (s7 & 1) + return true; + if (s7 & 8 && (t8 & 32 || t8 & 256 && t8 & 1024)) + return true; + if (s7 & 256 && !(s7 & 1024) && (t8 & 32 || t8 & 256 && t8 & 1024 && source.value === target.value)) + return true; + if (isUnknownLikeUnionType(target)) + return true; + } + return false; + } + function isTypeRelatedTo(source, target, relation) { + if (isFreshLiteralType(source)) { + source = source.regularType; + } + if (isFreshLiteralType(target)) { + target = target.regularType; + } + if (source === target) { + return true; + } + if (relation !== identityRelation) { + if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation)) { + return true; + } + } else if (!((source.flags | target.flags) & (3145728 | 8388608 | 16777216 | 33554432))) { + if (source.flags !== target.flags) + return false; + if (source.flags & 67358815) + return true; + } + if (source.flags & 524288 && target.flags & 524288) { + const related = relation.get(getRelationKey( + source, + target, + 0, + relation, + /*ignoreConstraints*/ + false + )); + if (related !== void 0) { + return !!(related & 1); + } + } + if (source.flags & 469499904 || target.flags & 469499904) { + return checkTypeRelatedTo( + source, + target, + relation, + /*errorNode*/ + void 0 + ); + } + return false; + } + function isIgnoredJsxProperty(source, sourceProp) { + return getObjectFlags(source) & 2048 && isHyphenatedJsxName(sourceProp.escapedName); + } + function getNormalizedType(type3, writing) { + while (true) { + const t8 = isFreshLiteralType(type3) ? type3.regularType : isGenericTupleType(type3) ? getNormalizedTupleType(type3, writing) : getObjectFlags(type3) & 4 ? type3.node ? createTypeReference(type3.target, getTypeArguments(type3)) : getSingleBaseForNonAugmentingSubtype(type3) || type3 : type3.flags & 3145728 ? getNormalizedUnionOrIntersectionType(type3, writing) : type3.flags & 33554432 ? writing ? type3.baseType : getSubstitutionIntersection(type3) : type3.flags & 25165824 ? getSimplifiedType(type3, writing) : type3; + if (t8 === type3) + return t8; + type3 = t8; + } + } + function getNormalizedUnionOrIntersectionType(type3, writing) { + const reduced = getReducedType(type3); + if (reduced !== type3) { + return reduced; + } + if (type3.flags & 2097152 && some2(type3.types, isEmptyAnonymousObjectType)) { + const normalizedTypes = sameMap(type3.types, (t8) => getNormalizedType(t8, writing)); + if (normalizedTypes !== type3.types) { + return getIntersectionType(normalizedTypes); + } + } + return type3; + } + function getNormalizedTupleType(type3, writing) { + const elements = getElementTypes(type3); + const normalizedElements = sameMap(elements, (t8) => t8.flags & 25165824 ? getSimplifiedType(t8, writing) : t8); + return elements !== normalizedElements ? createNormalizedTupleType(type3.target, normalizedElements) : type3; + } + function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) { + var _a2; + let errorInfo; + let relatedInfo; + let maybeKeys; + let maybeKeysSet; + let sourceStack; + let targetStack; + let maybeCount = 0; + let sourceDepth = 0; + let targetDepth = 0; + let expandingFlags = 0; + let overflow = false; + let overrideNextErrorInfo = 0; + let skipParentCounter = 0; + let lastSkippedInfo; + let incompatibleStack; + let relationCount = 16e6 - relation.size >> 3; + Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); + const result2 = isRelatedTo( + source, + target, + 3, + /*reportErrors*/ + !!errorNode, + headMessage + ); + if (incompatibleStack) { + reportIncompatibleStack(); + } + if (overflow) { + const id = getRelationKey( + source, + target, + /*intersectionState*/ + 0, + relation, + /*ignoreConstraints*/ + false + ); + relation.set( + id, + 4 | 2 + /* Failed */ + ); + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth }); + const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1; + const diag2 = error22(errorNode || currentNode, message, typeToString(source), typeToString(target)); + if (errorOutputContainer) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); + } + } else if (errorInfo) { + if (containingMessageChain) { + const chain3 = containingMessageChain(); + if (chain3) { + concatenateDiagnosticMessageChains(chain3, errorInfo); + errorInfo = chain3; + } + } + let relatedInformation; + if (headMessage && errorNode && !result2 && source.symbol) { + const links = getSymbolLinks(source.symbol); + if (links.originatingImport && !isImportCall(links.originatingImport)) { + const helpfulRetry = checkTypeRelatedTo( + getTypeOfSymbol(links.target), + target, + relation, + /*errorNode*/ + void 0 + ); + if (helpfulRetry) { + const diag3 = createDiagnosticForNode(links.originatingImport, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead); + relatedInformation = append(relatedInformation, diag3); + } + } + } + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, errorInfo, relatedInformation); + if (relatedInfo) { + addRelatedInfo(diag2, ...relatedInfo); + } + if (errorOutputContainer) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); + } + if (!errorOutputContainer || !errorOutputContainer.skipLogging) { + diagnostics.add(diag2); + } + } + if (errorNode && errorOutputContainer && errorOutputContainer.skipLogging && result2 === 0) { + Debug.assert(!!errorOutputContainer.errors, "missed opportunity to interact with error."); + } + return result2 !== 0; + function resetErrorInfo(saved) { + errorInfo = saved.errorInfo; + lastSkippedInfo = saved.lastSkippedInfo; + incompatibleStack = saved.incompatibleStack; + overrideNextErrorInfo = saved.overrideNextErrorInfo; + skipParentCounter = saved.skipParentCounter; + relatedInfo = saved.relatedInfo; + } + function captureErrorCalculationState() { + return { + errorInfo, + lastSkippedInfo, + incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(), + overrideNextErrorInfo, + skipParentCounter, + relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice() + }; + } + function reportIncompatibleError(message, ...args) { + overrideNextErrorInfo++; + lastSkippedInfo = void 0; + (incompatibleStack || (incompatibleStack = [])).push([message, ...args]); + } + function reportIncompatibleStack() { + const stack = incompatibleStack || []; + incompatibleStack = void 0; + const info2 = lastSkippedInfo; + lastSkippedInfo = void 0; + if (stack.length === 1) { + reportError(...stack[0]); + if (info2) { + reportRelationError( + /*message*/ + void 0, + ...info2 + ); + } + return; + } + let path2 = ""; + const secondaryRootErrors = []; + while (stack.length) { + const [msg, ...args] = stack.pop(); + switch (msg.code) { + case Diagnostics.Types_of_property_0_are_incompatible.code: { + if (path2.indexOf("new ") === 0) { + path2 = `(${path2})`; + } + const str2 = "" + args[0]; + if (path2.length === 0) { + path2 = `${str2}`; + } else if (isIdentifierText(str2, getEmitScriptTarget(compilerOptions))) { + path2 = `${path2}.${str2}`; + } else if (str2[0] === "[" && str2[str2.length - 1] === "]") { + path2 = `${path2}${str2}`; + } else { + path2 = `${path2}[${str2}]`; + } + break; + } + case Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code: + case Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code: + case Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: + case Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code: { + if (path2.length === 0) { + let mappedMsg = msg; + if (msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { + mappedMsg = Diagnostics.Call_signature_return_types_0_and_1_are_incompatible; + } else if (msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code) { + mappedMsg = Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible; + } + secondaryRootErrors.unshift([mappedMsg, args[0], args[1]]); + } else { + const prefix = msg.code === Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "new " : ""; + const params = msg.code === Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code || msg.code === Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code ? "" : "..."; + path2 = `${prefix}${path2}(${params})`; + } + break; + } + case Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code: { + secondaryRootErrors.unshift([Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, args[0], args[1]]); + break; + } + case Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code: { + secondaryRootErrors.unshift([Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, args[0], args[1], args[2]]); + break; + } + default: + return Debug.fail(`Unhandled Diagnostic: ${msg.code}`); + } + } + if (path2) { + reportError( + path2[path2.length - 1] === ")" ? Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types : Diagnostics.The_types_of_0_are_incompatible_between_these_types, + path2 + ); + } else { + secondaryRootErrors.shift(); + } + for (const [msg, ...args] of secondaryRootErrors) { + const originalValue = msg.elidedInCompatabilityPyramid; + msg.elidedInCompatabilityPyramid = false; + reportError(msg, ...args); + msg.elidedInCompatabilityPyramid = originalValue; + } + if (info2) { + reportRelationError( + /*message*/ + void 0, + ...info2 + ); + } + } + function reportError(message, ...args) { + Debug.assert(!!errorNode); + if (incompatibleStack) + reportIncompatibleStack(); + if (message.elidedInCompatabilityPyramid) + return; + if (skipParentCounter === 0) { + errorInfo = chainDiagnosticMessages(errorInfo, message, ...args); + } else { + skipParentCounter--; + } + } + function reportParentSkippedError(message, ...args) { + reportError(message, ...args); + skipParentCounter++; + } + function associateRelatedInfo(info2) { + Debug.assert(!!errorInfo); + if (!relatedInfo) { + relatedInfo = [info2]; + } else { + relatedInfo.push(info2); + } + } + function reportRelationError(message, source2, target2) { + if (incompatibleStack) + reportIncompatibleStack(); + const [sourceType, targetType] = getTypeNamesForErrorDisplay(source2, target2); + let generalizedSource = source2; + let generalizedSourceType = sourceType; + if (isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) { + generalizedSource = getBaseTypeOfLiteralType(source2); + Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable"); + generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource); + } + const targetFlags = target2.flags & 8388608 && !(source2.flags & 8388608) ? target2.objectType.flags : target2.flags; + if (targetFlags & 262144 && target2 !== markerSuperTypeForCheck && target2 !== markerSubTypeForCheck) { + const constraint = getBaseConstraintOfType(target2); + let needsOriginalSource; + if (constraint && (isTypeAssignableTo(generalizedSource, constraint) || (needsOriginalSource = isTypeAssignableTo(source2, constraint)))) { + reportError( + Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2, + needsOriginalSource ? sourceType : generalizedSourceType, + targetType, + typeToString(constraint) + ); + } else { + errorInfo = void 0; + reportError( + Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1, + targetType, + generalizedSourceType + ); + } + } + if (!message) { + if (relation === comparableRelation) { + message = Diagnostics.Type_0_is_not_comparable_to_type_1; + } else if (sourceType === targetType) { + message = Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated; + } else if (exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { + message = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; + } else { + if (source2.flags & 128 && target2.flags & 1048576) { + const suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source2, target2); + if (suggestedType) { + reportError(Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType)); + return; + } + } + message = Diagnostics.Type_0_is_not_assignable_to_type_1; + } + } else if (message === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1 && exactOptionalPropertyTypes && getExactOptionalUnassignableProperties(source2, target2).length) { + message = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties; + } + reportError(message, generalizedSourceType, targetType); + } + function tryElaborateErrorsForPrimitivesAndObjects(source2, target2) { + const sourceType = symbolValueDeclarationIsContextSensitive(source2.symbol) ? typeToString(source2, source2.symbol.valueDeclaration) : typeToString(source2); + const targetType = symbolValueDeclarationIsContextSensitive(target2.symbol) ? typeToString(target2, target2.symbol.valueDeclaration) : typeToString(target2); + if (globalStringType === source2 && stringType2 === target2 || globalNumberType === source2 && numberType2 === target2 || globalBooleanType === source2 && booleanType2 === target2 || getGlobalESSymbolType() === source2 && esSymbolType === target2) { + reportError(Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible, targetType, sourceType); + } + } + function tryElaborateArrayLikeErrors(source2, target2, reportErrors2) { + if (isTupleType(source2)) { + if (source2.target.readonly && isMutableArrayOrTuple(target2)) { + if (reportErrors2) { + reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); + } + return false; + } + return isArrayOrTupleType(target2); + } + if (isReadonlyArrayType(source2) && isMutableArrayOrTuple(target2)) { + if (reportErrors2) { + reportError(Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1, typeToString(source2), typeToString(target2)); + } + return false; + } + if (isTupleType(target2)) { + return isArrayType(source2); + } + return true; + } + function isRelatedToWorker(source2, target2, reportErrors2) { + return isRelatedTo(source2, target2, 3, reportErrors2); + } + function isRelatedTo(originalSource, originalTarget, recursionFlags = 3, reportErrors2 = false, headMessage2, intersectionState = 0) { + if (originalSource === originalTarget) + return -1; + if (originalSource.flags & 524288 && originalTarget.flags & 402784252) { + if (relation === comparableRelation && !(originalTarget.flags & 131072) && isSimpleTypeRelatedTo(originalTarget, originalSource, relation) || isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors2 ? reportError : void 0)) { + return -1; + } + if (reportErrors2) { + reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage2); + } + return 0; + } + const source2 = getNormalizedType( + originalSource, + /*writing*/ + false + ); + let target2 = getNormalizedType( + originalTarget, + /*writing*/ + true + ); + if (source2 === target2) + return -1; + if (relation === identityRelation) { + if (source2.flags !== target2.flags) + return 0; + if (source2.flags & 67358815) + return -1; + traceUnionsOrIntersectionsTooLarge(source2, target2); + return recursiveTypeRelatedTo( + source2, + target2, + /*reportErrors*/ + false, + 0, + recursionFlags + ); + } + if (source2.flags & 262144 && getConstraintOfType(source2) === target2) { + return -1; + } + if (source2.flags & 470302716 && target2.flags & 1048576) { + const types3 = target2.types; + const candidate = types3.length === 2 && types3[0].flags & 98304 ? types3[1] : types3.length === 3 && types3[0].flags & 98304 && types3[1].flags & 98304 ? types3[2] : void 0; + if (candidate && !(candidate.flags & 98304)) { + target2 = getNormalizedType( + candidate, + /*writing*/ + true + ); + if (source2 === target2) + return -1; + } + } + if (relation === comparableRelation && !(target2.flags & 131072) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0)) + return -1; + if (source2.flags & 469499904 || target2.flags & 469499904) { + const isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192); + if (isPerformingExcessPropertyChecks) { + if (hasExcessProperties(source2, target2, reportErrors2)) { + if (reportErrors2) { + reportRelationError(headMessage2, source2, originalTarget.aliasSymbol ? originalTarget : target2); + } + return 0; + } + } + const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2) && source2.flags & (402784252 | 524288 | 2097152) && source2 !== globalObjectType && target2.flags & (524288 | 2097152) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2)); + const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048); + if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) { + if (reportErrors2) { + const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2); + const targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target2); + const calls = getSignaturesOfType( + source2, + 0 + /* Call */ + ); + const constructs = getSignaturesOfType( + source2, + 1 + /* Construct */ + ); + if (calls.length > 0 && isRelatedTo( + getReturnTypeOfSignature(calls[0]), + target2, + 1, + /*reportErrors*/ + false + ) || constructs.length > 0 && isRelatedTo( + getReturnTypeOfSignature(constructs[0]), + target2, + 1, + /*reportErrors*/ + false + )) { + reportError(Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString); + } else { + reportError(Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString); + } + } + return 0; + } + traceUnionsOrIntersectionsTooLarge(source2, target2); + const skipCaching = source2.flags & 1048576 && source2.types.length < 4 && !(target2.flags & 1048576) || target2.flags & 1048576 && target2.types.length < 4 && !(source2.flags & 469499904); + const result22 = skipCaching ? unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) : recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags); + if (result22) { + return result22; + } + } + if (reportErrors2) { + reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2); + } + return 0; + } + function reportErrorResults(originalSource, originalTarget, source2, target2, headMessage2) { + var _a22, _b; + const sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource); + const targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget); + source2 = originalSource.aliasSymbol || sourceHasBase ? originalSource : source2; + target2 = originalTarget.aliasSymbol || targetHasBase ? originalTarget : target2; + let maybeSuppress = overrideNextErrorInfo > 0; + if (maybeSuppress) { + overrideNextErrorInfo--; + } + if (source2.flags & 524288 && target2.flags & 524288) { + const currentError = errorInfo; + tryElaborateArrayLikeErrors( + source2, + target2, + /*reportErrors*/ + true + ); + if (errorInfo !== currentError) { + maybeSuppress = !!errorInfo; + } + } + if (source2.flags & 524288 && target2.flags & 402784252) { + tryElaborateErrorsForPrimitivesAndObjects(source2, target2); + } else if (source2.symbol && source2.flags & 524288 && globalObjectType === source2) { + reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead); + } else if (getObjectFlags(source2) & 2048 && target2.flags & 2097152) { + const targetTypes = target2.types; + const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode); + const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode); + if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) && (contains2(targetTypes, intrinsicAttributes) || contains2(targetTypes, intrinsicClassAttributes))) { + return; + } + } else { + errorInfo = elaborateNeverIntersection(errorInfo, originalTarget); + } + if (!headMessage2 && maybeSuppress) { + lastSkippedInfo = [source2, target2]; + return; + } + reportRelationError(headMessage2, source2, target2); + if (source2.flags & 262144 && ((_b = (_a22 = source2.symbol) == null ? void 0 : _a22.declarations) == null ? void 0 : _b[0]) && !getConstraintOfType(source2)) { + const syntheticParam = cloneTypeParameter(source2); + syntheticParam.constraint = instantiateType(target2, makeUnaryTypeMapper(source2, syntheticParam)); + if (hasNonCircularBaseConstraint(syntheticParam)) { + const targetConstraintString = typeToString(target2, source2.symbol.declarations[0]); + associateRelatedInfo(createDiagnosticForNode(source2.symbol.declarations[0], Diagnostics.This_type_parameter_might_need_an_extends_0_constraint, targetConstraintString)); + } + } + } + function traceUnionsOrIntersectionsTooLarge(source2, target2) { + if (!tracing) { + return; + } + if (source2.flags & 3145728 && target2.flags & 3145728) { + const sourceUnionOrIntersection = source2; + const targetUnionOrIntersection = target2; + if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768) { + return; + } + const sourceSize = sourceUnionOrIntersection.types.length; + const targetSize = targetUnionOrIntersection.types.length; + if (sourceSize * targetSize > 1e6) { + tracing.instant(tracing.Phase.CheckTypes, "traceUnionsOrIntersectionsTooLarge_DepthLimit", { + sourceId: source2.id, + sourceSize, + targetId: target2.id, + targetSize, + pos: errorNode == null ? void 0 : errorNode.pos, + end: errorNode == null ? void 0 : errorNode.end + }); + } + } + } + function getTypeOfPropertyInTypes(types3, name2) { + const appendPropType = (propTypes, type3) => { + var _a22; + type3 = getApparentType(type3); + const prop = type3.flags & 3145728 ? getPropertyOfUnionOrIntersectionType(type3, name2) : getPropertyOfObjectType(type3, name2); + const propType = prop && getTypeOfSymbol(prop) || ((_a22 = getApplicableIndexInfoForName(type3, name2)) == null ? void 0 : _a22.type) || undefinedType2; + return append(propTypes, propType); + }; + return getUnionType(reduceLeft( + types3, + appendPropType, + /*initial*/ + void 0 + ) || emptyArray); + } + function hasExcessProperties(source2, target2, reportErrors2) { + var _a22; + if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 4096) { + return false; + } + const isComparingJsxAttributes = !!(getObjectFlags(source2) & 2048); + if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) { + return false; + } + let reducedTarget = target2; + let checkTypes; + if (target2.flags & 1048576) { + reducedTarget = findMatchingDiscriminantType(source2, target2, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target2); + checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget]; + } + for (const prop of getPropertiesOfType(source2)) { + if (shouldCheckAsExcessProperty(prop, source2.symbol) && !isIgnoredJsxProperty(source2, prop)) { + if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) { + if (reportErrors2) { + const errorTarget = filterType(reducedTarget, isExcessPropertyCheckTarget); + if (!errorNode) + return Debug.fail(); + if (isJsxAttributes(errorNode) || isJsxOpeningLikeElement(errorNode) || isJsxOpeningLikeElement(errorNode.parent)) { + if (prop.valueDeclaration && isJsxAttribute(prop.valueDeclaration) && getSourceFileOfNode(errorNode) === getSourceFileOfNode(prop.valueDeclaration.name)) { + errorNode = prop.valueDeclaration.name; + } + const propName2 = symbolToString2(prop); + const suggestionSymbol = getSuggestedSymbolForNonexistentJSXAttribute(propName2, errorTarget); + const suggestion = suggestionSymbol ? symbolToString2(suggestionSymbol) : void 0; + if (suggestion) { + reportError(Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, propName2, typeToString(errorTarget), suggestion); + } else { + reportError(Diagnostics.Property_0_does_not_exist_on_type_1, propName2, typeToString(errorTarget)); + } + } else { + const objectLiteralDeclaration = ((_a22 = source2.symbol) == null ? void 0 : _a22.declarations) && firstOrUndefined(source2.symbol.declarations); + let suggestion; + if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, (d7) => d7 === objectLiteralDeclaration) && getSourceFileOfNode(objectLiteralDeclaration) === getSourceFileOfNode(errorNode)) { + const propDeclaration = prop.valueDeclaration; + Debug.assertNode(propDeclaration, isObjectLiteralElementLike); + const name2 = propDeclaration.name; + errorNode = name2; + if (isIdentifier(name2)) { + suggestion = getSuggestionForNonexistentProperty(name2, errorTarget); + } + } + if (suggestion !== void 0) { + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2, symbolToString2(prop), typeToString(errorTarget), suggestion); + } else { + reportParentSkippedError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString2(prop), typeToString(errorTarget)); + } + } + } + return true; + } + if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3, reportErrors2)) { + if (reportErrors2) { + reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString2(prop)); + } + return true; + } + } + } + return false; + } + function shouldCheckAsExcessProperty(prop, container) { + return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration; + } + function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) { + if (source2.flags & 1048576) { + if (target2.flags & 1048576) { + const sourceOrigin = source2.origin; + if (sourceOrigin && sourceOrigin.flags & 2097152 && target2.aliasSymbol && contains2(sourceOrigin.types, target2)) { + return -1; + } + const targetOrigin = target2.origin; + if (targetOrigin && targetOrigin.flags & 1048576 && source2.aliasSymbol && contains2(targetOrigin.types, source2)) { + return -1; + } + } + return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252), intersectionState); + } + if (target2.flags & 1048576) { + return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252) && !(target2.flags & 402784252), intersectionState); + } + if (target2.flags & 2097152) { + return typeRelatedToEachType( + source2, + target2, + reportErrors2, + 2 + /* Target */ + ); + } + if (relation === comparableRelation && target2.flags & 402784252) { + const constraints = sameMap(source2.types, (t8) => t8.flags & 465829888 ? getBaseConstraintOfType(t8) || unknownType2 : t8); + if (constraints !== source2.types) { + source2 = getIntersectionType(constraints); + if (source2.flags & 131072) { + return 0; + } + if (!(source2.flags & 2097152)) { + return isRelatedTo( + source2, + target2, + 1, + /*reportErrors*/ + false + ) || isRelatedTo( + target2, + source2, + 1, + /*reportErrors*/ + false + ); + } + } + } + return someTypeRelatedToType( + source2, + target2, + /*reportErrors*/ + false, + 1 + /* Source */ + ); + } + function eachTypeRelatedToSomeType(source2, target2) { + let result22 = -1; + const sourceTypes = source2.types; + for (const sourceType of sourceTypes) { + const related = typeRelatedToSomeType( + sourceType, + target2, + /*reportErrors*/ + false, + 0 + /* None */ + ); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function typeRelatedToSomeType(source2, target2, reportErrors2, intersectionState) { + const targetTypes = target2.types; + if (target2.flags & 1048576) { + if (containsType(targetTypes, source2)) { + return -1; + } + if (relation !== comparableRelation && getObjectFlags(target2) & 32768 && !(source2.flags & 1024) && (source2.flags & (128 | 512 | 2048) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256)) { + const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType; + const primitive = source2.flags & 128 ? stringType2 : source2.flags & 256 ? numberType2 : source2.flags & 2048 ? bigintType : void 0; + return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 : 0; + } + const match = getMatchingUnionConstituentForType(target2, source2); + if (match) { + const related = isRelatedTo( + source2, + match, + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + return related; + } + } + } + for (const type3 of targetTypes) { + const related = isRelatedTo( + source2, + type3, + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + return related; + } + } + if (reportErrors2) { + const bestMatchingType = getBestMatchingType(source2, target2, isRelatedTo); + if (bestMatchingType) { + isRelatedTo( + source2, + bestMatchingType, + 2, + /*reportErrors*/ + true, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + return 0; + } + function typeRelatedToEachType(source2, target2, reportErrors2, intersectionState) { + let result22 = -1; + const targetTypes = target2.types; + for (const targetType of targetTypes) { + const related = isRelatedTo( + source2, + targetType, + 2, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function someTypeRelatedToType(source2, target2, reportErrors2, intersectionState) { + const sourceTypes = source2.types; + if (source2.flags & 1048576 && containsType(sourceTypes, target2)) { + return -1; + } + const len = sourceTypes.length; + for (let i7 = 0; i7 < len; i7++) { + const related = isRelatedTo( + sourceTypes[i7], + target2, + 1, + reportErrors2 && i7 === len - 1, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + return related; + } + } + return 0; + } + function getUndefinedStrippedTargetIfNeeded(source2, target2) { + if (source2.flags & 1048576 && target2.flags & 1048576 && !(source2.types[0].flags & 32768) && target2.types[0].flags & 32768) { + return extractTypesOfKind( + target2, + ~32768 + /* Undefined */ + ); + } + return target2; + } + function eachTypeRelatedToType(source2, target2, reportErrors2, intersectionState) { + let result22 = -1; + const sourceTypes = source2.types; + const undefinedStrippedTarget = getUndefinedStrippedTargetIfNeeded(source2, target2); + for (let i7 = 0; i7 < sourceTypes.length; i7++) { + const sourceType = sourceTypes[i7]; + if (undefinedStrippedTarget.flags & 1048576 && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) { + const related2 = isRelatedTo( + sourceType, + undefinedStrippedTarget.types[i7 % undefinedStrippedTarget.types.length], + 3, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (related2) { + result22 &= related2; + continue; + } + } + const related = isRelatedTo( + sourceType, + target2, + 1, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function typeArgumentsRelatedTo(sources = emptyArray, targets = emptyArray, variances = emptyArray, reportErrors2, intersectionState) { + if (sources.length !== targets.length && relation === identityRelation) { + return 0; + } + const length2 = sources.length <= targets.length ? sources.length : targets.length; + let result22 = -1; + for (let i7 = 0; i7 < length2; i7++) { + const varianceFlags = i7 < variances.length ? variances[i7] : 1; + const variance = varianceFlags & 7; + if (variance !== 4) { + const s7 = sources[i7]; + const t8 = targets[i7]; + let related = -1; + if (varianceFlags & 8) { + related = relation === identityRelation ? isRelatedTo( + s7, + t8, + 3, + /*reportErrors*/ + false + ) : compareTypesIdentical(s7, t8); + } else if (variance === 1) { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + } else if (variance === 2) { + related = isRelatedTo( + t8, + s7, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + } else if (variance === 3) { + related = isRelatedTo( + t8, + s7, + 3, + /*reportErrors*/ + false + ); + if (!related) { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + } + } else { + related = isRelatedTo( + s7, + t8, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (related) { + related &= isRelatedTo( + t8, + s7, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + if (!related) { + return 0; + } + result22 &= related; + } + } + return result22; + } + function recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags) { + var _a22, _b, _c; + if (overflow) { + return 0; + } + const id = getRelationKey( + source2, + target2, + intersectionState, + relation, + /*ignoreConstraints*/ + false + ); + const entry = relation.get(id); + if (entry !== void 0) { + if (reportErrors2 && entry & 2 && !(entry & 4)) { + } else { + if (outofbandVarianceMarkerHandler) { + const saved = entry & 24; + if (saved & 8) { + instantiateType(source2, reportUnmeasurableMapper); + } + if (saved & 16) { + instantiateType(source2, reportUnreliableMapper); + } + } + return entry & 1 ? -1 : 0; + } + } + if (relationCount <= 0) { + overflow = true; + return 0; + } + if (!maybeKeys) { + maybeKeys = []; + maybeKeysSet = /* @__PURE__ */ new Set(); + sourceStack = []; + targetStack = []; + } else { + if (maybeKeysSet.has(id)) { + return 3; + } + const broadestEquivalentId = id.startsWith("*") ? getRelationKey( + source2, + target2, + intersectionState, + relation, + /*ignoreConstraints*/ + true + ) : void 0; + if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) { + return 3; + } + if (sourceDepth === 100 || targetDepth === 100) { + overflow = true; + return 0; + } + } + const maybeStart = maybeCount; + maybeKeys[maybeCount] = id; + maybeKeysSet.add(id); + maybeCount++; + const saveExpandingFlags = expandingFlags; + if (recursionFlags & 1) { + sourceStack[sourceDepth] = source2; + sourceDepth++; + if (!(expandingFlags & 1) && isDeeplyNestedType(source2, sourceStack, sourceDepth)) + expandingFlags |= 1; + } + if (recursionFlags & 2) { + targetStack[targetDepth] = target2; + targetDepth++; + if (!(expandingFlags & 2) && isDeeplyNestedType(target2, targetStack, targetDepth)) + expandingFlags |= 2; + } + let originalHandler; + let propagatingVarianceFlags = 0; + if (outofbandVarianceMarkerHandler) { + originalHandler = outofbandVarianceMarkerHandler; + outofbandVarianceMarkerHandler = (onlyUnreliable) => { + propagatingVarianceFlags |= onlyUnreliable ? 16 : 8; + return originalHandler(onlyUnreliable); + }; + } + let result22; + if (expandingFlags === 3) { + (_a22 = tracing) == null ? void 0 : _a22.instant(tracing.Phase.CheckTypes, "recursiveTypeRelatedTo_DepthLimit", { + sourceId: source2.id, + sourceIdStack: sourceStack.map((t8) => t8.id), + targetId: target2.id, + targetIdStack: targetStack.map((t8) => t8.id), + depth: sourceDepth, + targetDepth + }); + result22 = 3; + } else { + (_b = tracing) == null ? void 0 : _b.push(tracing.Phase.CheckTypes, "structuredTypeRelatedTo", { sourceId: source2.id, targetId: target2.id }); + result22 = structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState); + (_c = tracing) == null ? void 0 : _c.pop(); + } + if (outofbandVarianceMarkerHandler) { + outofbandVarianceMarkerHandler = originalHandler; + } + if (recursionFlags & 1) { + sourceDepth--; + } + if (recursionFlags & 2) { + targetDepth--; + } + expandingFlags = saveExpandingFlags; + if (result22) { + if (result22 === -1 || sourceDepth === 0 && targetDepth === 0) { + if (result22 === -1 || result22 === 3) { + resetMaybeStack( + /*markAllAsSucceeded*/ + true + ); + } else { + resetMaybeStack( + /*markAllAsSucceeded*/ + false + ); + } + } + } else { + relation.set(id, (reportErrors2 ? 4 : 0) | 2 | propagatingVarianceFlags); + relationCount--; + resetMaybeStack( + /*markAllAsSucceeded*/ + false + ); + } + return result22; + function resetMaybeStack(markAllAsSucceeded) { + for (let i7 = maybeStart; i7 < maybeCount; i7++) { + maybeKeysSet.delete(maybeKeys[i7]); + if (markAllAsSucceeded) { + relation.set(maybeKeys[i7], 1 | propagatingVarianceFlags); + relationCount--; + } + } + maybeCount = maybeStart; + } + } + function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) { + const saveErrorInfo = captureErrorCalculationState(); + let result22 = structuredTypeRelatedToWorker(source2, target2, reportErrors2, intersectionState, saveErrorInfo); + if (relation !== identityRelation) { + if (!result22 && (source2.flags & 2097152 || source2.flags & 262144 && target2.flags & 1048576)) { + const constraint = getEffectiveConstraintOfIntersection(source2.flags & 2097152 ? source2.types : [source2], !!(target2.flags & 1048576)); + if (constraint && everyType(constraint, (c7) => c7 !== source2)) { + result22 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + if (result22 && !(intersectionState & 2) && target2.flags & 2097152 && !isGenericObjectType(target2) && source2.flags & (524288 | 2097152)) { + result22 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + false, + 0 + /* None */ + ); + if (result22 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192) { + result22 &= indexSignaturesRelatedTo( + source2, + target2, + /*sourceIsPrimitive*/ + false, + reportErrors2, + 0 + /* None */ + ); + } + } else if (result22 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 && getApparentType(source2).flags & 3670016 && !some2(source2.types, (t8) => t8 === target2 || !!(getObjectFlags(t8) & 262144))) { + result22 &= propertiesRelatedTo( + source2, + target2, + reportErrors2, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + true, + intersectionState + ); + } + } + if (result22) { + resetErrorInfo(saveErrorInfo); + } + return result22; + } + function getApparentMappedTypeKeys(nameType, targetType) { + const modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType)); + const mappedKeys = []; + forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType( + modifiersType, + 8576, + /*stringsOnly*/ + false, + (t8) => void mappedKeys.push(instantiateType(nameType, appendTypeMapping(targetType.mapper, getTypeParameterFromMappedType(targetType), t8))) + ); + return getUnionType(mappedKeys); + } + function structuredTypeRelatedToWorker(source2, target2, reportErrors2, intersectionState, saveErrorInfo) { + let result22; + let originalErrorInfo; + let varianceCheckFailed = false; + let sourceFlags = source2.flags; + const targetFlags = target2.flags; + if (relation === identityRelation) { + if (sourceFlags & 3145728) { + let result3 = eachTypeRelatedToSomeType(source2, target2); + if (result3) { + result3 &= eachTypeRelatedToSomeType(target2, source2); + } + return result3; + } + if (sourceFlags & 4194304) { + return isRelatedTo( + source2.type, + target2.type, + 3, + /*reportErrors*/ + false + ); + } + if (sourceFlags & 8388608) { + if (result22 = isRelatedTo( + source2.objectType, + target2.objectType, + 3, + /*reportErrors*/ + false + )) { + if (result22 &= isRelatedTo( + source2.indexType, + target2.indexType, + 3, + /*reportErrors*/ + false + )) { + return result22; + } + } + } + if (sourceFlags & 16777216) { + if (source2.root.isDistributive === target2.root.isDistributive) { + if (result22 = isRelatedTo( + source2.checkType, + target2.checkType, + 3, + /*reportErrors*/ + false + )) { + if (result22 &= isRelatedTo( + source2.extendsType, + target2.extendsType, + 3, + /*reportErrors*/ + false + )) { + if (result22 &= isRelatedTo( + getTrueTypeFromConditionalType(source2), + getTrueTypeFromConditionalType(target2), + 3, + /*reportErrors*/ + false + )) { + if (result22 &= isRelatedTo( + getFalseTypeFromConditionalType(source2), + getFalseTypeFromConditionalType(target2), + 3, + /*reportErrors*/ + false + )) { + return result22; + } + } + } + } + } + } + if (sourceFlags & 33554432) { + if (result22 = isRelatedTo( + source2.baseType, + target2.baseType, + 3, + /*reportErrors*/ + false + )) { + if (result22 &= isRelatedTo( + source2.constraint, + target2.constraint, + 3, + /*reportErrors*/ + false + )) { + return result22; + } + } + } + if (!(sourceFlags & 524288)) { + return 0; + } + } else if (sourceFlags & 3145728 || targetFlags & 3145728) { + if (result22 = unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState)) { + return result22; + } + if (!(sourceFlags & 465829888 || sourceFlags & 524288 && targetFlags & 1048576 || sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) { + return 0; + } + } + if (sourceFlags & (524288 | 16777216) && source2.aliasSymbol && source2.aliasTypeArguments && source2.aliasSymbol === target2.aliasSymbol && !(isMarkerType(source2) || isMarkerType(target2))) { + const variances = getAliasVariances(source2.aliasSymbol); + if (variances === emptyArray) { + return 1; + } + const params = getSymbolLinks(source2.aliasSymbol).typeParameters; + const minParams = getMinTypeArgumentCount(params); + const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration)); + const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration)); + const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState); + if (varianceResult !== void 0) { + return varianceResult; + } + } + if (isSingleElementGenericTupleType(source2) && !source2.target.readonly && (result22 = isRelatedTo( + getTypeArguments(source2)[0], + target2, + 1 + /* Source */ + )) || isSingleElementGenericTupleType(target2) && (target2.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source2) || source2)) && (result22 = isRelatedTo( + source2, + getTypeArguments(target2)[0], + 2 + /* Target */ + ))) { + return result22; + } + if (targetFlags & 262144) { + if (getObjectFlags(source2) & 32 && !source2.declaration.nameType && isRelatedTo( + getIndexType(target2), + getConstraintTypeFromMappedType(source2), + 3 + /* Both */ + )) { + if (!(getMappedTypeModifiers(source2) & 4)) { + const templateType = getTemplateTypeFromMappedType(source2); + const indexedAccessType = getIndexedAccessType(target2, getTypeParameterFromMappedType(source2)); + if (result22 = isRelatedTo(templateType, indexedAccessType, 3, reportErrors2)) { + return result22; + } + } + } + if (relation === comparableRelation && sourceFlags & 262144) { + let constraint = getConstraintOfTypeParameter(source2); + if (constraint) { + while (constraint && someType(constraint, (c7) => !!(c7.flags & 262144))) { + if (result22 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false + )) { + return result22; + } + constraint = getConstraintOfTypeParameter(constraint); + } + } + return 0; + } + } else if (targetFlags & 4194304) { + const targetType = target2.type; + if (sourceFlags & 4194304) { + if (result22 = isRelatedTo( + targetType, + source2.type, + 3, + /*reportErrors*/ + false + )) { + return result22; + } + } + if (isTupleType(targetType)) { + if (result22 = isRelatedTo(source2, getKnownKeysOfTupleType(targetType), 2, reportErrors2)) { + return result22; + } + } else { + const constraint = getSimplifiedTypeOrConstraint(targetType); + if (constraint) { + if (isRelatedTo(source2, getIndexType( + constraint, + target2.indexFlags | 4 + /* NoReducibleCheck */ + ), 2, reportErrors2) === -1) { + return -1; + } + } else if (isGenericMappedType(targetType)) { + const nameType = getNameTypeFromMappedType(targetType); + const constraintType = getConstraintTypeFromMappedType(targetType); + let targetKeys; + if (nameType && isMappedTypeWithKeyofConstraintDeclaration(targetType)) { + const mappedKeys = getApparentMappedTypeKeys(nameType, targetType); + targetKeys = getUnionType([mappedKeys, nameType]); + } else { + targetKeys = nameType || constraintType; + } + if (isRelatedTo(source2, targetKeys, 2, reportErrors2) === -1) { + return -1; + } + } + } + } else if (targetFlags & 8388608) { + if (sourceFlags & 8388608) { + if (result22 = isRelatedTo(source2.objectType, target2.objectType, 3, reportErrors2)) { + result22 &= isRelatedTo(source2.indexType, target2.indexType, 3, reportErrors2); + } + if (result22) { + return result22; + } + if (reportErrors2) { + originalErrorInfo = errorInfo; + } + } + if (relation === assignableRelation || relation === comparableRelation) { + const objectType2 = target2.objectType; + const indexType = target2.indexType; + const baseObjectType = getBaseConstraintOfType(objectType2) || objectType2; + const baseIndexType = getBaseConstraintOfType(indexType) || indexType; + if (!isGenericObjectType(baseObjectType) && !isGenericIndexType(baseIndexType)) { + const accessFlags = 4 | (baseObjectType !== objectType2 ? 2 : 0); + const constraint = getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, accessFlags); + if (constraint) { + if (reportErrors2 && originalErrorInfo) { + resetErrorInfo(saveErrorInfo); + } + if (result22 = isRelatedTo( + source2, + constraint, + 2, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + )) { + return result22; + } + if (reportErrors2 && originalErrorInfo && errorInfo) { + errorInfo = countMessageChainBreadth([originalErrorInfo]) <= countMessageChainBreadth([errorInfo]) ? originalErrorInfo : errorInfo; + } + } + } + } + if (reportErrors2) { + originalErrorInfo = void 0; + } + } else if (isGenericMappedType(target2) && relation !== identityRelation) { + const keysRemapped = !!target2.declaration.nameType; + const templateType = getTemplateTypeFromMappedType(target2); + const modifiers = getMappedTypeModifiers(target2); + if (!(modifiers & 8)) { + if (!keysRemapped && templateType.flags & 8388608 && templateType.objectType === source2 && templateType.indexType === getTypeParameterFromMappedType(target2)) { + return -1; + } + if (!isGenericMappedType(source2)) { + const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2); + const sourceKeys = getIndexType( + source2, + 2 + /* NoIndexSignatures */ + ); + const includeOptional = modifiers & 4; + const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0; + if (includeOptional ? !(filteredByApplicability.flags & 131072) : isRelatedTo( + targetKeys, + sourceKeys, + 3 + /* Both */ + )) { + const templateType2 = getTemplateTypeFromMappedType(target2); + const typeParameter = getTypeParameterFromMappedType(target2); + const nonNullComponent = extractTypesOfKind( + templateType2, + ~98304 + /* Nullable */ + ); + if (!keysRemapped && nonNullComponent.flags & 8388608 && nonNullComponent.indexType === typeParameter) { + if (result22 = isRelatedTo(source2, nonNullComponent.objectType, 2, reportErrors2)) { + return result22; + } + } else { + const indexingType = keysRemapped ? filteredByApplicability || targetKeys : filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter; + const indexedAccessType = getIndexedAccessType(source2, indexingType); + if (result22 = isRelatedTo(indexedAccessType, templateType2, 3, reportErrors2)) { + return result22; + } + } + } + originalErrorInfo = errorInfo; + resetErrorInfo(saveErrorInfo); + } + } + } else if (targetFlags & 16777216) { + if (isDeeplyNestedType(target2, targetStack, targetDepth, 10)) { + return 3; + } + const c7 = target2; + if (!c7.root.inferTypeParameters && !isDistributionDependent(c7.root) && !(source2.flags & 16777216 && source2.root === c7.root)) { + const skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c7.checkType), getPermissiveInstantiation(c7.extendsType)); + const skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c7.checkType), getRestrictiveInstantiation(c7.extendsType)); + if (result22 = skipTrue ? -1 : isRelatedTo( + source2, + getTrueTypeFromConditionalType(c7), + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + )) { + result22 &= skipFalse ? -1 : isRelatedTo( + source2, + getFalseTypeFromConditionalType(c7), + 2, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + ); + if (result22) { + return result22; + } + } + } + } else if (targetFlags & 134217728) { + if (sourceFlags & 134217728) { + if (relation === comparableRelation) { + return templateLiteralTypesDefinitelyUnrelated(source2, target2) ? 0 : -1; + } + instantiateType(source2, reportUnreliableMapper); + } + if (isTypeMatchedByTemplateLiteralType(source2, target2)) { + return -1; + } + } else if (target2.flags & 268435456) { + if (!(source2.flags & 268435456)) { + if (isMemberOfStringMapping(source2, target2)) { + return -1; + } + } + } + if (sourceFlags & 8650752) { + if (!(sourceFlags & 8388608 && targetFlags & 8388608)) { + const constraint = getConstraintOfType(source2) || unknownType2; + if (result22 = isRelatedTo( + constraint, + target2, + 1, + /*reportErrors*/ + false, + /*headMessage*/ + void 0, + intersectionState + )) { + return result22; + } else if (result22 = isRelatedTo( + getTypeWithThisArgument(constraint, source2), + target2, + 1, + reportErrors2 && constraint !== unknownType2 && !(targetFlags & sourceFlags & 262144), + /*headMessage*/ + void 0, + intersectionState + )) { + return result22; + } + if (isMappedTypeGenericIndexedAccess(source2)) { + const indexConstraint = getConstraintOfType(source2.indexType); + if (indexConstraint) { + if (result22 = isRelatedTo(getIndexedAccessType(source2.objectType, indexConstraint), target2, 1, reportErrors2)) { + return result22; + } + } + } + } + } else if (sourceFlags & 4194304) { + const isDeferredMappedIndex = shouldDeferIndexType(source2.type, source2.indexFlags) && getObjectFlags(source2.type) & 32; + if (result22 = isRelatedTo(keyofConstraintType, target2, 1, reportErrors2 && !isDeferredMappedIndex)) { + return result22; + } + if (isDeferredMappedIndex) { + const mappedType = source2.type; + const nameType = getNameTypeFromMappedType(mappedType); + const sourceMappedKeys = nameType && isMappedTypeWithKeyofConstraintDeclaration(mappedType) ? getApparentMappedTypeKeys(nameType, mappedType) : nameType || getConstraintTypeFromMappedType(mappedType); + if (result22 = isRelatedTo(sourceMappedKeys, target2, 1, reportErrors2)) { + return result22; + } + } + } else if (sourceFlags & 134217728 && !(targetFlags & 524288)) { + if (!(targetFlags & 134217728)) { + const constraint = getBaseConstraintOfType(source2); + if (constraint && constraint !== source2 && (result22 = isRelatedTo(constraint, target2, 1, reportErrors2))) { + return result22; + } + } + } else if (sourceFlags & 268435456) { + if (targetFlags & 268435456) { + if (source2.symbol !== target2.symbol) { + return 0; + } + if (result22 = isRelatedTo(source2.type, target2.type, 3, reportErrors2)) { + return result22; + } + } else { + const constraint = getBaseConstraintOfType(source2); + if (constraint && (result22 = isRelatedTo(constraint, target2, 1, reportErrors2))) { + return result22; + } + } + } else if (sourceFlags & 16777216) { + if (isDeeplyNestedType(source2, sourceStack, sourceDepth, 10)) { + return 3; + } + if (targetFlags & 16777216) { + const sourceParams = source2.root.inferTypeParameters; + let sourceExtends = source2.extendsType; + let mapper; + if (sourceParams) { + const ctx = createInferenceContext( + sourceParams, + /*signature*/ + void 0, + 0, + isRelatedToWorker + ); + inferTypes( + ctx.inferences, + target2.extendsType, + sourceExtends, + 512 | 1024 + /* AlwaysStrict */ + ); + sourceExtends = instantiateType(sourceExtends, ctx.mapper); + mapper = ctx.mapper; + } + if (isTypeIdenticalTo(sourceExtends, target2.extendsType) && (isRelatedTo( + source2.checkType, + target2.checkType, + 3 + /* Both */ + ) || isRelatedTo( + target2.checkType, + source2.checkType, + 3 + /* Both */ + ))) { + if (result22 = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source2), mapper), getTrueTypeFromConditionalType(target2), 3, reportErrors2)) { + result22 &= isRelatedTo(getFalseTypeFromConditionalType(source2), getFalseTypeFromConditionalType(target2), 3, reportErrors2); + } + if (result22) { + return result22; + } + } + } + const defaultConstraint = getDefaultConstraintOfConditionalType(source2); + if (defaultConstraint) { + if (result22 = isRelatedTo(defaultConstraint, target2, 1, reportErrors2)) { + return result22; + } + } + const distributiveConstraint = !(targetFlags & 16777216) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0; + if (distributiveConstraint) { + resetErrorInfo(saveErrorInfo); + if (result22 = isRelatedTo(distributiveConstraint, target2, 1, reportErrors2)) { + return result22; + } + } + } else { + if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) { + return -1; + } + if (isGenericMappedType(target2)) { + if (isGenericMappedType(source2)) { + if (result22 = mappedTypeRelatedTo(source2, target2, reportErrors2)) { + return result22; + } + } + return 0; + } + const sourceIsPrimitive = !!(sourceFlags & 402784252); + if (relation !== identityRelation) { + source2 = getApparentType(source2); + sourceFlags = source2.flags; + } else if (isGenericMappedType(source2)) { + return 0; + } + if (getObjectFlags(source2) & 4 && getObjectFlags(target2) & 4 && source2.target === target2.target && !isTupleType(source2) && !(isMarkerType(source2) || isMarkerType(target2))) { + if (isEmptyArrayLiteralType(source2)) { + return -1; + } + const variances = getVariances(source2.target); + if (variances === emptyArray) { + return 1; + } + const varianceResult = relateVariances(getTypeArguments(source2), getTypeArguments(target2), variances, intersectionState); + if (varianceResult !== void 0) { + return varianceResult; + } + } else if (isReadonlyArrayType(target2) ? everyType(source2, isArrayOrTupleType) : isArrayType(target2) && everyType(source2, (t8) => isTupleType(t8) && !t8.target.readonly)) { + if (relation !== identityRelation) { + return isRelatedTo(getIndexTypeOfType(source2, numberType2) || anyType2, getIndexTypeOfType(target2, numberType2) || anyType2, 3, reportErrors2); + } else { + return 0; + } + } else if (isGenericTupleType(source2) && isTupleType(target2) && !isGenericTupleType(target2)) { + const constraint = getBaseConstraintOrType(source2); + if (constraint !== source2) { + return isRelatedTo(constraint, target2, 1, reportErrors2); + } + } else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 8192 && !isEmptyObjectType(source2)) { + return 0; + } + if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) { + const reportStructuralErrors = reportErrors2 && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive; + result22 = propertiesRelatedTo( + source2, + target2, + reportStructuralErrors, + /*excludedProperties*/ + void 0, + /*optionalsOnly*/ + false, + intersectionState + ); + if (result22) { + result22 &= signaturesRelatedTo(source2, target2, 0, reportStructuralErrors, intersectionState); + if (result22) { + result22 &= signaturesRelatedTo(source2, target2, 1, reportStructuralErrors, intersectionState); + if (result22) { + result22 &= indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportStructuralErrors, intersectionState); + } + } + } + if (varianceCheckFailed && result22) { + errorInfo = originalErrorInfo || errorInfo || saveErrorInfo.errorInfo; + } else if (result22) { + return result22; + } + } + if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) { + const objectOnlyTarget = extractTypesOfKind( + target2, + 524288 | 2097152 | 33554432 + /* Substitution */ + ); + if (objectOnlyTarget.flags & 1048576) { + const result3 = typeRelatedToDiscriminatedType(source2, objectOnlyTarget); + if (result3) { + return result3; + } + } + } + } + return 0; + function countMessageChainBreadth(info2) { + if (!info2) + return 0; + return reduceLeft(info2, (value2, chain3) => value2 + 1 + countMessageChainBreadth(chain3.next), 0); + } + function relateVariances(sourceTypeArguments, targetTypeArguments, variances, intersectionState2) { + if (result22 = typeArgumentsRelatedTo(sourceTypeArguments, targetTypeArguments, variances, reportErrors2, intersectionState2)) { + return result22; + } + if (some2(variances, (v8) => !!(v8 & 24))) { + originalErrorInfo = void 0; + resetErrorInfo(saveErrorInfo); + return void 0; + } + const allowStructuralFallback = targetTypeArguments && hasCovariantVoidArgument(targetTypeArguments, variances); + varianceCheckFailed = !allowStructuralFallback; + if (variances !== emptyArray && !allowStructuralFallback) { + if (varianceCheckFailed && !(reportErrors2 && some2( + variances, + (v8) => (v8 & 7) === 0 + /* Invariant */ + ))) { + return 0; + } + originalErrorInfo = errorInfo; + resetErrorInfo(saveErrorInfo); + } + } + } + function mappedTypeRelatedTo(source2, target2, reportErrors2) { + const modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source2) === getMappedTypeModifiers(target2) : getCombinedMappedTypeOptionality(source2) <= getCombinedMappedTypeOptionality(target2)); + if (modifiersRelated) { + let result22; + const targetConstraint = getConstraintTypeFromMappedType(target2); + const sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source2), getCombinedMappedTypeOptionality(source2) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper); + if (result22 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors2)) { + const mapper = createTypeMapper([getTypeParameterFromMappedType(source2)], [getTypeParameterFromMappedType(target2)]); + if (instantiateType(getNameTypeFromMappedType(source2), mapper) === instantiateType(getNameTypeFromMappedType(target2), mapper)) { + return result22 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source2), mapper), getTemplateTypeFromMappedType(target2), 3, reportErrors2); + } + } + } + return 0; + } + function typeRelatedToDiscriminatedType(source2, target2) { + var _a22; + const sourceProperties = getPropertiesOfType(source2); + const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target2); + if (!sourcePropertiesFiltered) + return 0; + let numCombinations = 1; + for (const sourceProperty of sourcePropertiesFiltered) { + numCombinations *= countTypes(getNonMissingTypeOfSymbol(sourceProperty)); + if (numCombinations > 25) { + (_a22 = tracing) == null ? void 0 : _a22.instant(tracing.Phase.CheckTypes, "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source2.id, targetId: target2.id, numCombinations }); + return 0; + } + } + const sourceDiscriminantTypes = new Array(sourcePropertiesFiltered.length); + const excludedProperties = /* @__PURE__ */ new Set(); + for (let i7 = 0; i7 < sourcePropertiesFiltered.length; i7++) { + const sourceProperty = sourcePropertiesFiltered[i7]; + const sourcePropertyType = getNonMissingTypeOfSymbol(sourceProperty); + sourceDiscriminantTypes[i7] = sourcePropertyType.flags & 1048576 ? sourcePropertyType.types : [sourcePropertyType]; + excludedProperties.add(sourceProperty.escapedName); + } + const discriminantCombinations = cartesianProduct(sourceDiscriminantTypes); + const matchingTypes = []; + for (const combination of discriminantCombinations) { + let hasMatch = false; + outer: + for (const type3 of target2.types) { + for (let i7 = 0; i7 < sourcePropertiesFiltered.length; i7++) { + const sourceProperty = sourcePropertiesFiltered[i7]; + const targetProperty = getPropertyOfType(type3, sourceProperty.escapedName); + if (!targetProperty) + continue outer; + if (sourceProperty === targetProperty) + continue; + const related = propertyRelatedTo( + source2, + target2, + sourceProperty, + targetProperty, + (_6) => combination[i7], + /*reportErrors*/ + false, + 0, + /*skipOptional*/ + strictNullChecks || relation === comparableRelation + ); + if (!related) { + continue outer; + } + } + pushIfUnique(matchingTypes, type3, equateValues); + hasMatch = true; + } + if (!hasMatch) { + return 0; + } + } + let result22 = -1; + for (const type3 of matchingTypes) { + result22 &= propertiesRelatedTo( + source2, + type3, + /*reportErrors*/ + false, + excludedProperties, + /*optionalsOnly*/ + false, + 0 + /* None */ + ); + if (result22) { + result22 &= signaturesRelatedTo( + source2, + type3, + 0, + /*reportErrors*/ + false, + 0 + /* None */ + ); + if (result22) { + result22 &= signaturesRelatedTo( + source2, + type3, + 1, + /*reportErrors*/ + false, + 0 + /* None */ + ); + if (result22 && !(isTupleType(source2) && isTupleType(type3))) { + result22 &= indexSignaturesRelatedTo( + source2, + type3, + /*sourceIsPrimitive*/ + false, + /*reportErrors*/ + false, + 0 + /* None */ + ); + } + } + } + if (!result22) { + return result22; + } + } + return result22; + } + function excludeProperties(properties, excludedProperties) { + if (!excludedProperties || properties.length === 0) + return properties; + let result22; + for (let i7 = 0; i7 < properties.length; i7++) { + if (!excludedProperties.has(properties[i7].escapedName)) { + if (result22) { + result22.push(properties[i7]); + } + } else if (!result22) { + result22 = properties.slice(0, i7); + } + } + return result22 || properties; + } + function isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState) { + const targetIsOptional = strictNullChecks && !!(getCheckFlags(targetProp) & 48); + const effectiveTarget = addOptionality( + getNonMissingTypeOfSymbol(targetProp), + /*isProperty*/ + false, + targetIsOptional + ); + const effectiveSource = getTypeOfSourceProperty(sourceProp); + return isRelatedTo( + effectiveSource, + effectiveTarget, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + } + function propertyRelatedTo(source2, target2, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState, skipOptional) { + const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp); + const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp); + if (sourcePropFlags & 2 || targetPropFlags & 2) { + if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { + if (reportErrors2) { + if (sourcePropFlags & 2 && targetPropFlags & 2) { + reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString2(targetProp)); + } else { + reportError(Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString2(targetProp), typeToString(sourcePropFlags & 2 ? source2 : target2), typeToString(sourcePropFlags & 2 ? target2 : source2)); + } + } + return 0; + } + } else if (targetPropFlags & 4) { + if (!isValidOverrideOf(sourceProp, targetProp)) { + if (reportErrors2) { + reportError(Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString2(targetProp), typeToString(getDeclaringClass(sourceProp) || source2), typeToString(getDeclaringClass(targetProp) || target2)); + } + return 0; + } + } else if (sourcePropFlags & 4) { + if (reportErrors2) { + reportError(Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString2(targetProp), typeToString(source2), typeToString(target2)); + } + return 0; + } + if (relation === strictSubtypeRelation && isReadonlySymbol(sourceProp) && !isReadonlySymbol(targetProp)) { + return 0; + } + const related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors2, intersectionState); + if (!related) { + if (reportErrors2) { + reportIncompatibleError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString2(targetProp)); + } + return 0; + } + if (!skipOptional && sourceProp.flags & 16777216 && targetProp.flags & 106500 && !(targetProp.flags & 16777216)) { + if (reportErrors2) { + reportError(Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString2(targetProp), typeToString(source2), typeToString(target2)); + } + return 0; + } + return related; + } + function reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties) { + let shouldSkipElaboration = false; + if (unmatchedProperty.valueDeclaration && isNamedDeclaration(unmatchedProperty.valueDeclaration) && isPrivateIdentifier(unmatchedProperty.valueDeclaration.name) && source2.symbol && source2.symbol.flags & 32) { + const privateIdentifierDescription = unmatchedProperty.valueDeclaration.name.escapedText; + const symbolTableKey = getSymbolNameForPrivateIdentifier(source2.symbol, privateIdentifierDescription); + if (symbolTableKey && getPropertyOfType(source2, symbolTableKey)) { + const sourceName = factory.getDeclarationName(source2.symbol.valueDeclaration); + const targetName = factory.getDeclarationName(target2.symbol.valueDeclaration); + reportError( + Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2, + diagnosticName(privateIdentifierDescription), + diagnosticName(sourceName.escapedText === "" ? anon : sourceName), + diagnosticName(targetName.escapedText === "" ? anon : targetName) + ); + return; + } + } + const props = arrayFrom(getUnmatchedProperties( + source2, + target2, + requireOptionalProperties, + /*matchDiscriminantProperties*/ + false + )); + if (!headMessage || headMessage.code !== Diagnostics.Class_0_incorrectly_implements_interface_1.code && headMessage.code !== Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code) { + shouldSkipElaboration = true; + } + if (props.length === 1) { + const propName2 = symbolToString2( + unmatchedProperty, + /*enclosingDeclaration*/ + void 0, + 0, + 4 | 16 + /* WriteComputedProps */ + ); + reportError(Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName2, ...getTypeNamesForErrorDisplay(source2, target2)); + if (length(unmatchedProperty.declarations)) { + associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here, propName2)); + } + if (shouldSkipElaboration && errorInfo) { + overrideNextErrorInfo++; + } + } else if (tryElaborateArrayLikeErrors( + source2, + target2, + /*reportErrors*/ + false + )) { + if (props.length > 5) { + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source2), typeToString(target2), map4(props.slice(0, 4), (p7) => symbolToString2(p7)).join(", "), props.length - 4); + } else { + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source2), typeToString(target2), map4(props, (p7) => symbolToString2(p7)).join(", ")); + } + if (shouldSkipElaboration && errorInfo) { + overrideNextErrorInfo++; + } + } + } + function propertiesRelatedTo(source2, target2, reportErrors2, excludedProperties, optionalsOnly, intersectionState) { + if (relation === identityRelation) { + return propertiesIdenticalTo(source2, target2, excludedProperties); + } + let result22 = -1; + if (isTupleType(target2)) { + if (isArrayOrTupleType(source2)) { + if (!target2.target.readonly && (isReadonlyArrayType(source2) || isTupleType(source2) && source2.target.readonly)) { + return 0; + } + const sourceArity = getTypeReferenceArity(source2); + const targetArity = getTypeReferenceArity(target2); + const sourceRestFlag = isTupleType(source2) ? source2.target.combinedFlags & 4 : 4; + const targetRestFlag = target2.target.combinedFlags & 4; + const sourceMinLength = isTupleType(source2) ? source2.target.minLength : 0; + const targetMinLength = target2.target.minLength; + if (!sourceRestFlag && sourceArity < targetMinLength) { + if (reportErrors2) { + reportError(Diagnostics.Source_has_0_element_s_but_target_requires_1, sourceArity, targetMinLength); + } + return 0; + } + if (!targetRestFlag && targetArity < sourceMinLength) { + if (reportErrors2) { + reportError(Diagnostics.Source_has_0_element_s_but_target_allows_only_1, sourceMinLength, targetArity); + } + return 0; + } + if (!targetRestFlag && (sourceRestFlag || targetArity < sourceArity)) { + if (reportErrors2) { + if (sourceMinLength < targetMinLength) { + reportError(Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer, targetMinLength); + } else { + reportError(Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more, targetArity); + } + } + return 0; + } + const sourceTypeArguments = getTypeArguments(source2); + const targetTypeArguments = getTypeArguments(target2); + const targetStartCount = getStartElementCount( + target2.target, + 11 + /* NonRest */ + ); + const targetEndCount = getEndElementCount( + target2.target, + 11 + /* NonRest */ + ); + const targetHasRestElement = target2.target.hasRestElement; + let canExcludeDiscriminants = !!excludedProperties; + for (let sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) { + const sourceFlags = isTupleType(source2) ? source2.target.elementFlags[sourcePosition] : 4; + const sourcePositionFromEnd = sourceArity - 1 - sourcePosition; + const targetPosition = targetHasRestElement && sourcePosition >= targetStartCount ? targetArity - 1 - Math.min(sourcePositionFromEnd, targetEndCount) : sourcePosition; + const targetFlags = target2.target.elementFlags[targetPosition]; + if (targetFlags & 8 && !(sourceFlags & 8)) { + if (reportErrors2) { + reportError(Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target, targetPosition); + } + return 0; + } + if (sourceFlags & 8 && !(targetFlags & 12)) { + if (reportErrors2) { + reportError(Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target, sourcePosition, targetPosition); + } + return 0; + } + if (targetFlags & 1 && !(sourceFlags & 1)) { + if (reportErrors2) { + reportError(Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target, targetPosition); + } + return 0; + } + if (canExcludeDiscriminants) { + if (sourceFlags & 12 || targetFlags & 12) { + canExcludeDiscriminants = false; + } + if (canExcludeDiscriminants && (excludedProperties == null ? void 0 : excludedProperties.has("" + sourcePosition))) { + continue; + } + } + const sourceType = removeMissingType(sourceTypeArguments[sourcePosition], !!(sourceFlags & targetFlags & 2)); + const targetType = targetTypeArguments[targetPosition]; + const targetCheckType = sourceFlags & 8 && targetFlags & 4 ? createArrayType(targetType) : removeMissingType(targetType, !!(targetFlags & 2)); + const related = isRelatedTo( + sourceType, + targetCheckType, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + if (reportErrors2 && (targetArity > 1 || sourceArity > 1)) { + if (targetHasRestElement && sourcePosition >= targetStartCount && sourcePositionFromEnd >= targetEndCount && targetStartCount !== sourceArity - targetEndCount - 1) { + reportIncompatibleError(Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target, targetStartCount, sourceArity - targetEndCount - 1, targetPosition); + } else { + reportIncompatibleError(Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target, sourcePosition, targetPosition); + } + } + return 0; + } + result22 &= related; + } + return result22; + } + if (target2.target.combinedFlags & 12) { + return 0; + } + } + const requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType2(source2) && !isEmptyArrayLiteralType(source2) && !isTupleType(source2); + const unmatchedProperty = getUnmatchedProperty( + source2, + target2, + requireOptionalProperties, + /*matchDiscriminantProperties*/ + false + ); + if (unmatchedProperty) { + if (reportErrors2 && shouldReportUnmatchedPropertyError(source2, target2)) { + reportUnmatchedProperty(source2, target2, unmatchedProperty, requireOptionalProperties); + } + return 0; + } + if (isObjectLiteralType2(target2)) { + for (const sourceProp of excludeProperties(getPropertiesOfType(source2), excludedProperties)) { + if (!getPropertyOfObjectType(target2, sourceProp.escapedName)) { + const sourceType = getTypeOfSymbol(sourceProp); + if (!(sourceType.flags & 32768)) { + if (reportErrors2) { + reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString2(sourceProp), typeToString(target2)); + } + return 0; + } + } + } + } + const properties = getPropertiesOfType(target2); + const numericNamesOnly = isTupleType(source2) && isTupleType(target2); + for (const targetProp of excludeProperties(properties, excludedProperties)) { + const name2 = targetProp.escapedName; + if (!(targetProp.flags & 4194304) && (!numericNamesOnly || isNumericLiteralName(name2) || name2 === "length") && (!optionalsOnly || targetProp.flags & 16777216)) { + const sourceProp = getPropertyOfType(source2, name2); + if (sourceProp && sourceProp !== targetProp) { + const related = propertyRelatedTo(source2, target2, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors2, intersectionState, relation === comparableRelation); + if (!related) { + return 0; + } + result22 &= related; + } + } + } + return result22; + } + function propertiesIdenticalTo(source2, target2, excludedProperties) { + if (!(source2.flags & 524288 && target2.flags & 524288)) { + return 0; + } + const sourceProperties = excludeProperties(getPropertiesOfObjectType(source2), excludedProperties); + const targetProperties = excludeProperties(getPropertiesOfObjectType(target2), excludedProperties); + if (sourceProperties.length !== targetProperties.length) { + return 0; + } + let result22 = -1; + for (const sourceProp of sourceProperties) { + const targetProp = getPropertyOfObjectType(target2, sourceProp.escapedName); + if (!targetProp) { + return 0; + } + const related = compareProperties2(sourceProp, targetProp, isRelatedTo); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function signaturesRelatedTo(source2, target2, kind, reportErrors2, intersectionState) { + var _a22, _b; + if (relation === identityRelation) { + return signaturesIdenticalTo(source2, target2, kind); + } + if (target2 === anyFunctionType || source2 === anyFunctionType) { + return -1; + } + const sourceIsJSConstructor = source2.symbol && isJSConstructor(source2.symbol.valueDeclaration); + const targetIsJSConstructor = target2.symbol && isJSConstructor(target2.symbol.valueDeclaration); + const sourceSignatures = getSignaturesOfType( + source2, + sourceIsJSConstructor && kind === 1 ? 0 : kind + ); + const targetSignatures = getSignaturesOfType( + target2, + targetIsJSConstructor && kind === 1 ? 0 : kind + ); + if (kind === 1 && sourceSignatures.length && targetSignatures.length) { + const sourceIsAbstract = !!(sourceSignatures[0].flags & 4); + const targetIsAbstract = !!(targetSignatures[0].flags & 4); + if (sourceIsAbstract && !targetIsAbstract) { + if (reportErrors2) { + reportError(Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type); + } + return 0; + } + if (!constructorVisibilitiesAreCompatible(sourceSignatures[0], targetSignatures[0], reportErrors2)) { + return 0; + } + } + let result22 = -1; + const incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn; + const sourceObjectFlags = getObjectFlags(source2); + const targetObjectFlags = getObjectFlags(target2); + if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source2.symbol === target2.symbol || sourceObjectFlags & 4 && targetObjectFlags & 4 && source2.target === target2.target) { + Debug.assertEqual(sourceSignatures.length, targetSignatures.length); + for (let i7 = 0; i7 < targetSignatures.length; i7++) { + const related = signatureRelatedTo( + sourceSignatures[i7], + targetSignatures[i7], + /*erase*/ + true, + reportErrors2, + intersectionState, + incompatibleReporter(sourceSignatures[i7], targetSignatures[i7]) + ); + if (!related) { + return 0; + } + result22 &= related; + } + } else if (sourceSignatures.length === 1 && targetSignatures.length === 1) { + const eraseGenerics = relation === comparableRelation || !!compilerOptions.noStrictGenericChecks; + const sourceSignature = first(sourceSignatures); + const targetSignature = first(targetSignatures); + result22 = signatureRelatedTo(sourceSignature, targetSignature, eraseGenerics, reportErrors2, intersectionState, incompatibleReporter(sourceSignature, targetSignature)); + if (!result22 && reportErrors2 && kind === 1 && sourceObjectFlags & targetObjectFlags && (((_a22 = targetSignature.declaration) == null ? void 0 : _a22.kind) === 176 || ((_b = sourceSignature.declaration) == null ? void 0 : _b.kind) === 176)) { + const constructSignatureToString = (signature) => signatureToString( + signature, + /*enclosingDeclaration*/ + void 0, + 262144, + kind + ); + reportError(Diagnostics.Type_0_is_not_assignable_to_type_1, constructSignatureToString(sourceSignature), constructSignatureToString(targetSignature)); + reportError(Diagnostics.Types_of_construct_signatures_are_incompatible); + return result22; + } + } else { + outer: + for (const t8 of targetSignatures) { + const saveErrorInfo = captureErrorCalculationState(); + let shouldElaborateErrors = reportErrors2; + for (const s7 of sourceSignatures) { + const related = signatureRelatedTo( + s7, + t8, + /*erase*/ + true, + shouldElaborateErrors, + intersectionState, + incompatibleReporter(s7, t8) + ); + if (related) { + result22 &= related; + resetErrorInfo(saveErrorInfo); + continue outer; + } + shouldElaborateErrors = false; + } + if (shouldElaborateErrors) { + reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source2), signatureToString( + t8, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0, + kind + )); + } + return 0; + } + } + return result22; + } + function shouldReportUnmatchedPropertyError(source2, target2) { + const typeCallSignatures = getSignaturesOfStructuredType( + source2, + 0 + /* Call */ + ); + const typeConstructSignatures = getSignaturesOfStructuredType( + source2, + 1 + /* Construct */ + ); + const typeProperties = getPropertiesOfObjectType(source2); + if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) { + if (getSignaturesOfType( + target2, + 0 + /* Call */ + ).length && typeCallSignatures.length || getSignaturesOfType( + target2, + 1 + /* Construct */ + ).length && typeConstructSignatures.length) { + return true; + } + return false; + } + return true; + } + function reportIncompatibleCallSignatureReturn(siga, sigb) { + if (siga.parameters.length === 0 && sigb.parameters.length === 0) { + return (source2, target2) => reportIncompatibleError(Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); + } + return (source2, target2) => reportIncompatibleError(Diagnostics.Call_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); + } + function reportIncompatibleConstructSignatureReturn(siga, sigb) { + if (siga.parameters.length === 0 && sigb.parameters.length === 0) { + return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source2), typeToString(target2)); + } + return (source2, target2) => reportIncompatibleError(Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source2), typeToString(target2)); + } + function signatureRelatedTo(source2, target2, erase, reportErrors2, intersectionState, incompatibleReporter) { + const checkMode = relation === subtypeRelation ? 16 : relation === strictSubtypeRelation ? 16 | 8 : 0; + return compareSignaturesRelated(erase ? getErasedSignature(source2) : source2, erase ? getErasedSignature(target2) : target2, checkMode, reportErrors2, reportError, incompatibleReporter, isRelatedToWorker2, reportUnreliableMapper); + function isRelatedToWorker2(source3, target3, reportErrors3) { + return isRelatedTo( + source3, + target3, + 3, + reportErrors3, + /*headMessage*/ + void 0, + intersectionState + ); + } + } + function signaturesIdenticalTo(source2, target2, kind) { + const sourceSignatures = getSignaturesOfType(source2, kind); + const targetSignatures = getSignaturesOfType(target2, kind); + if (sourceSignatures.length !== targetSignatures.length) { + return 0; + } + let result22 = -1; + for (let i7 = 0; i7 < sourceSignatures.length; i7++) { + const related = compareSignaturesIdentical( + sourceSignatures[i7], + targetSignatures[i7], + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + false, + /*ignoreReturnTypes*/ + false, + isRelatedTo + ); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { + let result22 = -1; + const keyType = targetInfo.keyType; + const props = source2.flags & 2097152 ? getPropertiesOfUnionOrIntersectionType(source2) : getPropertiesOfObjectType(source2); + for (const prop of props) { + if (isIgnoredJsxProperty(source2, prop)) { + continue; + } + if (isApplicableIndexType(getLiteralTypeFromProperty( + prop, + 8576 + /* StringOrNumberLiteralOrUnique */ + ), keyType)) { + const propType = getNonMissingTypeOfSymbol(prop); + const type3 = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType2 || !(prop.flags & 16777216) ? propType : getTypeWithFacts( + propType, + 524288 + /* NEUndefined */ + ); + const related = isRelatedTo( + type3, + targetInfo.type, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related) { + if (reportErrors2) { + reportError(Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString2(prop)); + } + return 0; + } + result22 &= related; + } + } + for (const info2 of getIndexInfosOfType(source2)) { + if (isApplicableIndexType(info2.keyType, keyType)) { + const related = indexInfoRelatedTo(info2, targetInfo, reportErrors2, intersectionState); + if (!related) { + return 0; + } + result22 &= related; + } + } + return result22; + } + function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState) { + const related = isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3, + reportErrors2, + /*headMessage*/ + void 0, + intersectionState + ); + if (!related && reportErrors2) { + if (sourceInfo.keyType === targetInfo.keyType) { + reportError(Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType)); + } else { + reportError(Diagnostics._0_and_1_index_signatures_are_incompatible, typeToString(sourceInfo.keyType), typeToString(targetInfo.keyType)); + } + } + return related; + } + function indexSignaturesRelatedTo(source2, target2, sourceIsPrimitive, reportErrors2, intersectionState) { + if (relation === identityRelation) { + return indexSignaturesIdenticalTo(source2, target2); + } + const indexInfos = getIndexInfosOfType(target2); + const targetHasStringIndex = some2(indexInfos, (info2) => info2.keyType === stringType2); + let result22 = -1; + for (const targetInfo of indexInfos) { + const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + if (!related) { + return 0; + } + result22 &= related; + } + return result22; + } + function typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState) { + const sourceInfo = getApplicableIndexInfo(source2, targetInfo.keyType); + if (sourceInfo) { + return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState); + } + if (!(intersectionState & 1) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 8192) && isObjectTypeWithInferableIndex(source2)) { + return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState); + } + if (reportErrors2) { + reportError(Diagnostics.Index_signature_for_type_0_is_missing_in_type_1, typeToString(targetInfo.keyType), typeToString(source2)); + } + return 0; + } + function indexSignaturesIdenticalTo(source2, target2) { + const sourceInfos = getIndexInfosOfType(source2); + const targetInfos = getIndexInfosOfType(target2); + if (sourceInfos.length !== targetInfos.length) { + return 0; + } + for (const targetInfo of targetInfos) { + const sourceInfo = getIndexInfoOfType(source2, targetInfo.keyType); + if (!(sourceInfo && isRelatedTo( + sourceInfo.type, + targetInfo.type, + 3 + /* Both */ + ) && sourceInfo.isReadonly === targetInfo.isReadonly)) { + return 0; + } + } + return -1; + } + function constructorVisibilitiesAreCompatible(sourceSignature, targetSignature, reportErrors2) { + if (!sourceSignature.declaration || !targetSignature.declaration) { + return true; + } + const sourceAccessibility = getSelectedEffectiveModifierFlags( + sourceSignature.declaration, + 6 + /* NonPublicAccessibilityModifier */ + ); + const targetAccessibility = getSelectedEffectiveModifierFlags( + targetSignature.declaration, + 6 + /* NonPublicAccessibilityModifier */ + ); + if (targetAccessibility === 2) { + return true; + } + if (targetAccessibility === 4 && sourceAccessibility !== 2) { + return true; + } + if (targetAccessibility !== 4 && !sourceAccessibility) { + return true; + } + if (reportErrors2) { + reportError(Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type, visibilityToString(sourceAccessibility), visibilityToString(targetAccessibility)); + } + return false; + } + } + function typeCouldHaveTopLevelSingletonTypes(type3) { + if (type3.flags & 16) { + return false; + } + if (type3.flags & 3145728) { + return !!forEach4(type3.types, typeCouldHaveTopLevelSingletonTypes); + } + if (type3.flags & 465829888) { + const constraint = getConstraintOfType(type3); + if (constraint && constraint !== type3) { + return typeCouldHaveTopLevelSingletonTypes(constraint); + } + } + return isUnitType(type3) || !!(type3.flags & 134217728) || !!(type3.flags & 268435456); + } + function getExactOptionalUnassignableProperties(source, target) { + if (isTupleType(source) && isTupleType(target)) + return emptyArray; + return getPropertiesOfType(target).filter((targetProp) => isExactOptionalPropertyMismatch(getTypeOfPropertyOfType(source, targetProp.escapedName), getTypeOfSymbol(targetProp))); + } + function isExactOptionalPropertyMismatch(source, target) { + return !!source && !!target && maybeTypeOfKind( + source, + 32768 + /* Undefined */ + ) && !!containsMissingType(target); + } + function getExactOptionalProperties(type3) { + return getPropertiesOfType(type3).filter((targetProp) => containsMissingType(getTypeOfSymbol(targetProp))); + } + function getBestMatchingType(source, target, isRelatedTo = compareTypesAssignable) { + return findMatchingDiscriminantType(source, target, isRelatedTo) || findMatchingTypeReferenceOrTypeAliasReference(source, target) || findBestTypeForObjectLiteral(source, target) || findBestTypeForInvokable(source, target) || findMostOverlappyType(source, target); + } + function discriminateTypeByDiscriminableItems(target, discriminators, related) { + const types3 = target.types; + const include = types3.map( + (t8) => t8.flags & 402784252 ? 0 : -1 + /* True */ + ); + for (const [getDiscriminatingType, propertyName] of discriminators) { + let matched = false; + for (let i7 = 0; i7 < types3.length; i7++) { + if (include[i7]) { + const targetType = getTypeOfPropertyOrIndexSignatureOfType(types3[i7], propertyName); + if (targetType && related(getDiscriminatingType(), targetType)) { + matched = true; + } else { + include[i7] = 3; + } + } + } + for (let i7 = 0; i7 < types3.length; i7++) { + if (include[i7] === 3) { + include[i7] = matched ? 0 : -1; + } + } + } + const filtered = contains2( + include, + 0 + /* False */ + ) ? getUnionType( + types3.filter((_6, i7) => include[i7]), + 0 + /* None */ + ) : target; + return filtered.flags & 131072 ? target : filtered; + } + function isWeakType(type3) { + if (type3.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type3); + return resolved.callSignatures.length === 0 && resolved.constructSignatures.length === 0 && resolved.indexInfos.length === 0 && resolved.properties.length > 0 && every2(resolved.properties, (p7) => !!(p7.flags & 16777216)); + } + if (type3.flags & 2097152) { + return every2(type3.types, isWeakType); + } + return false; + } + function hasCommonProperties(source, target, isComparingJsxAttributes) { + for (const prop of getPropertiesOfType(source)) { + if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { + return true; + } + } + return false; + } + function getVariances(type3) { + return type3 === globalArrayType || type3 === globalReadonlyArrayType || type3.objectFlags & 8 ? arrayVariances : getVariancesWorker(type3.symbol, type3.typeParameters); + } + function getAliasVariances(symbol) { + return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters); + } + function getVariancesWorker(symbol, typeParameters = emptyArray) { + var _a2, _b; + const links = getSymbolLinks(symbol); + if (!links.variances) { + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) }); + const oldVarianceComputation = inVarianceComputation; + if (!inVarianceComputation) { + inVarianceComputation = true; + resolutionStart = resolutionTargets.length; + } + links.variances = emptyArray; + const variances = []; + for (const tp of typeParameters) { + const modifiers = getTypeParameterModifiers(tp); + let variance = modifiers & 16384 ? modifiers & 8192 ? 0 : 1 : modifiers & 8192 ? 2 : void 0; + if (variance === void 0) { + let unmeasurable = false; + let unreliable = false; + const oldHandler = outofbandVarianceMarkerHandler; + outofbandVarianceMarkerHandler = (onlyUnreliable) => onlyUnreliable ? unreliable = true : unmeasurable = true; + const typeWithSuper = createMarkerType(symbol, tp, markerSuperType); + const typeWithSub = createMarkerType(symbol, tp, markerSubType); + variance = (isTypeAssignableTo(typeWithSub, typeWithSuper) ? 1 : 0) | (isTypeAssignableTo(typeWithSuper, typeWithSub) ? 2 : 0); + if (variance === 3 && isTypeAssignableTo(createMarkerType(symbol, tp, markerOtherType), typeWithSuper)) { + variance = 4; + } + outofbandVarianceMarkerHandler = oldHandler; + if (unmeasurable || unreliable) { + if (unmeasurable) { + variance |= 8; + } + if (unreliable) { + variance |= 16; + } + } + } + variances.push(variance); + } + if (!oldVarianceComputation) { + inVarianceComputation = false; + resolutionStart = 0; + } + links.variances = variances; + (_b = tracing) == null ? void 0 : _b.pop({ variances: variances.map(Debug.formatVariance) }); + } + return links.variances; + } + function createMarkerType(symbol, source, target) { + const mapper = makeUnaryTypeMapper(source, target); + const type3 = getDeclaredTypeOfSymbol(symbol); + if (isErrorType(type3)) { + return type3; + } + const result2 = symbol.flags & 524288 ? getTypeAliasInstantiation(symbol, instantiateTypes(getSymbolLinks(symbol).typeParameters, mapper)) : createTypeReference(type3, instantiateTypes(type3.typeParameters, mapper)); + markerTypes.add(getTypeId(result2)); + return result2; + } + function isMarkerType(type3) { + return markerTypes.has(getTypeId(type3)); + } + function getTypeParameterModifiers(tp) { + var _a2; + return reduceLeft( + (_a2 = tp.symbol) == null ? void 0 : _a2.declarations, + (modifiers, d7) => modifiers | getEffectiveModifierFlags(d7), + 0 + /* None */ + ) & (8192 | 16384 | 4096); + } + function hasCovariantVoidArgument(typeArguments, variances) { + for (let i7 = 0; i7 < variances.length; i7++) { + if ((variances[i7] & 7) === 1 && typeArguments[i7].flags & 16384) { + return true; + } + } + return false; + } + function isUnconstrainedTypeParameter(type3) { + return type3.flags & 262144 && !getConstraintOfTypeParameter(type3); + } + function isNonDeferredTypeReference(type3) { + return !!(getObjectFlags(type3) & 4) && !type3.node; + } + function isTypeReferenceWithGenericArguments(type3) { + return isNonDeferredTypeReference(type3) && some2(getTypeArguments(type3), (t8) => !!(t8.flags & 262144) || isTypeReferenceWithGenericArguments(t8)); + } + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + const typeParameters = []; + let constraintMarker = ""; + const sourceId = getTypeReferenceId(source, 0); + const targetId = getTypeReferenceId(target, 0); + return `${constraintMarker}${sourceId},${targetId}${postFix}`; + function getTypeReferenceId(type3, depth = 0) { + let result2 = "" + type3.target.id; + for (const t8 of getTypeArguments(type3)) { + if (t8.flags & 262144) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t8)) { + let index4 = typeParameters.indexOf(t8); + if (index4 < 0) { + index4 = typeParameters.length; + typeParameters.push(t8); + } + result2 += "=" + index4; + continue; + } + constraintMarker = "*"; + } else if (depth < 4 && isTypeReferenceWithGenericArguments(t8)) { + result2 += "<" + getTypeReferenceId(t8, depth + 1) + ">"; + continue; + } + result2 += "-" + t8.id; + } + return result2; + } + } + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { + if (relation === identityRelation && source.id > target.id) { + const temp = source; + source = target; + target = temp; + } + const postFix = intersectionState ? ":" + intersectionState : ""; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : `${source.id},${target.id}${postFix}`; + } + function forEachProperty2(prop, callback) { + if (getCheckFlags(prop) & 6) { + for (const t8 of prop.links.containingType.types) { + const p7 = getPropertyOfType(t8, prop.escapedName); + const result2 = p7 && forEachProperty2(p7, callback); + if (result2) { + return result2; + } + } + return void 0; + } + return callback(prop); + } + function getDeclaringClass(prop) { + return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : void 0; + } + function getTypeOfPropertyInBaseClass(property2) { + const classType = getDeclaringClass(property2); + const baseClassType = classType && getBaseTypes(classType)[0]; + return baseClassType && getTypeOfPropertyOfType(baseClassType, property2.escapedName); + } + function isPropertyInClassDerivedFrom(prop, baseClass) { + return forEachProperty2(prop, (sp) => { + const sourceClass = getDeclaringClass(sp); + return sourceClass ? hasBaseType(sourceClass, baseClass) : false; + }); + } + function isValidOverrideOf(sourceProp, targetProp) { + return !forEachProperty2(targetProp, (tp) => getDeclarationModifierFlagsFromSymbol(tp) & 4 ? !isPropertyInClassDerivedFrom(sourceProp, getDeclaringClass(tp)) : false); + } + function isClassDerivedFromDeclaringClasses(checkClass, prop, writing) { + return forEachProperty2(prop, (p7) => getDeclarationModifierFlagsFromSymbol(p7, writing) & 4 ? !hasBaseType(checkClass, getDeclaringClass(p7)) : false) ? void 0 : checkClass; + } + function isDeeplyNestedType(type3, stack, depth, maxDepth = 3) { + if (depth >= maxDepth) { + if ((getObjectFlags(type3) & 96) === 96) { + type3 = getMappedTargetWithSymbol(type3); + } + if (type3.flags & 2097152) { + return some2(type3.types, (t8) => isDeeplyNestedType(t8, stack, depth, maxDepth)); + } + const identity22 = getRecursionIdentity(type3); + let count2 = 0; + let lastTypeId = 0; + for (let i7 = 0; i7 < depth; i7++) { + const t8 = stack[i7]; + if (hasMatchingRecursionIdentity(t8, identity22)) { + if (t8.id >= lastTypeId) { + count2++; + if (count2 >= maxDepth) { + return true; + } + } + lastTypeId = t8.id; + } + } + } + return false; + } + function getMappedTargetWithSymbol(type3) { + let target; + while ((getObjectFlags(type3) & 96) === 96 && (target = getModifiersTypeFromMappedType(type3)) && (target.symbol || target.flags & 2097152 && some2(target.types, (t8) => !!t8.symbol))) { + type3 = target; + } + return type3; + } + function hasMatchingRecursionIdentity(type3, identity22) { + if ((getObjectFlags(type3) & 96) === 96) { + type3 = getMappedTargetWithSymbol(type3); + } + if (type3.flags & 2097152) { + return some2(type3.types, (t8) => hasMatchingRecursionIdentity(t8, identity22)); + } + return getRecursionIdentity(type3) === identity22; + } + function getRecursionIdentity(type3) { + if (type3.flags & 524288 && !isObjectOrArrayLiteralType(type3)) { + if (getObjectFlags(type3) & 4 && type3.node) { + return type3.node; + } + if (type3.symbol && !(getObjectFlags(type3) & 16 && type3.symbol.flags & 32)) { + return type3.symbol; + } + if (isTupleType(type3)) { + return type3.target; + } + } + if (type3.flags & 262144) { + return type3.symbol; + } + if (type3.flags & 8388608) { + do { + type3 = type3.objectType; + } while (type3.flags & 8388608); + return type3; + } + if (type3.flags & 16777216) { + return type3.root; + } + return type3; + } + function isPropertyIdenticalTo(sourceProp, targetProp) { + return compareProperties2(sourceProp, targetProp, compareTypesIdentical) !== 0; + } + function compareProperties2(sourceProp, targetProp, compareTypes) { + if (sourceProp === targetProp) { + return -1; + } + const sourcePropAccessibility = getDeclarationModifierFlagsFromSymbol(sourceProp) & 6; + const targetPropAccessibility = getDeclarationModifierFlagsFromSymbol(targetProp) & 6; + if (sourcePropAccessibility !== targetPropAccessibility) { + return 0; + } + if (sourcePropAccessibility) { + if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { + return 0; + } + } else { + if ((sourceProp.flags & 16777216) !== (targetProp.flags & 16777216)) { + return 0; + } + } + if (isReadonlySymbol(sourceProp) !== isReadonlySymbol(targetProp)) { + return 0; + } + return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + function isMatchingSignature(source, target, partialMatch) { + const sourceParameterCount = getParameterCount(source); + const targetParameterCount = getParameterCount(target); + const sourceMinArgumentCount = getMinArgumentCount(source); + const targetMinArgumentCount = getMinArgumentCount(target); + const sourceHasRestParameter = hasEffectiveRestParameter(source); + const targetHasRestParameter = hasEffectiveRestParameter(target); + if (sourceParameterCount === targetParameterCount && sourceMinArgumentCount === targetMinArgumentCount && sourceHasRestParameter === targetHasRestParameter) { + return true; + } + if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) { + return true; + } + return false; + } + function compareSignaturesIdentical(source, target, partialMatch, ignoreThisTypes, ignoreReturnTypes, compareTypes) { + if (source === target) { + return -1; + } + if (!isMatchingSignature(source, target, partialMatch)) { + return 0; + } + if (length(source.typeParameters) !== length(target.typeParameters)) { + return 0; + } + if (target.typeParameters) { + const mapper = createTypeMapper(source.typeParameters, target.typeParameters); + for (let i7 = 0; i7 < target.typeParameters.length; i7++) { + const s7 = source.typeParameters[i7]; + const t8 = target.typeParameters[i7]; + if (!(s7 === t8 || compareTypes(instantiateType(getConstraintFromTypeParameter(s7), mapper) || unknownType2, getConstraintFromTypeParameter(t8) || unknownType2) && compareTypes(instantiateType(getDefaultFromTypeParameter(s7), mapper) || unknownType2, getDefaultFromTypeParameter(t8) || unknownType2))) { + return 0; + } + } + source = instantiateSignature( + source, + mapper, + /*eraseTypeParameters*/ + true + ); + } + let result2 = -1; + if (!ignoreThisTypes) { + const sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType) { + const targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + const related = compareTypes(sourceThisType, targetThisType); + if (!related) { + return 0; + } + result2 &= related; + } + } + } + const targetLen = getParameterCount(target); + for (let i7 = 0; i7 < targetLen; i7++) { + const s7 = getTypeAtPosition(source, i7); + const t8 = getTypeAtPosition(target, i7); + const related = compareTypes(t8, s7); + if (!related) { + return 0; + } + result2 &= related; + } + if (!ignoreReturnTypes) { + const sourceTypePredicate = getTypePredicateOfSignature(source); + const targetTypePredicate = getTypePredicateOfSignature(target); + result2 &= sourceTypePredicate || targetTypePredicate ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + return result2; + } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return !(source && target && typePredicateKindsMatch(source, target)) ? 0 : source.type === target.type ? -1 : source.type && target.type ? compareTypes(source.type, target.type) : 0; + } + function literalTypesWithSameBaseType(types3) { + let commonBaseType; + for (const t8 of types3) { + if (!(t8.flags & 131072)) { + const baseType = getBaseTypeOfLiteralType(t8); + commonBaseType ?? (commonBaseType = baseType); + if (baseType === t8 || baseType !== commonBaseType) { + return false; + } + } + } + return true; + } + function getCombinedTypeFlags(types3) { + return reduceLeft(types3, (flags, t8) => flags | (t8.flags & 1048576 ? getCombinedTypeFlags(t8.types) : t8.flags), 0); + } + function getCommonSupertype(types3) { + if (types3.length === 1) { + return types3[0]; + } + const primaryTypes = strictNullChecks ? sameMap(types3, (t8) => filterType(t8, (u7) => !(u7.flags & 98304))) : types3; + const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s7, t8) => isTypeSubtypeOf(s7, t8) ? t8 : s7); + return primaryTypes === types3 ? superTypeOrUnion : getNullableType( + superTypeOrUnion, + getCombinedTypeFlags(types3) & 98304 + /* Nullable */ + ); + } + function getCommonSubtype(types3) { + return reduceLeft(types3, (s7, t8) => isTypeSubtypeOf(t8, s7) ? t8 : s7); + } + function isArrayType(type3) { + return !!(getObjectFlags(type3) & 4) && (type3.target === globalArrayType || type3.target === globalReadonlyArrayType); + } + function isReadonlyArrayType(type3) { + return !!(getObjectFlags(type3) & 4) && type3.target === globalReadonlyArrayType; + } + function isArrayOrTupleType(type3) { + return isArrayType(type3) || isTupleType(type3); + } + function isMutableArrayOrTuple(type3) { + return isArrayType(type3) && !isReadonlyArrayType(type3) || isTupleType(type3) && !type3.target.readonly; + } + function getElementTypeOfArrayType(type3) { + return isArrayType(type3) ? getTypeArguments(type3)[0] : void 0; + } + function isArrayLikeType(type3) { + return isArrayType(type3) || !(type3.flags & 98304) && isTypeAssignableTo(type3, anyReadonlyArrayType); + } + function isMutableArrayLikeType(type3) { + return isMutableArrayOrTuple(type3) || !(type3.flags & (1 | 98304)) && isTypeAssignableTo(type3, anyArrayType); + } + function getSingleBaseForNonAugmentingSubtype(type3) { + if (!(getObjectFlags(type3) & 4) || !(getObjectFlags(type3.target) & 3)) { + return void 0; + } + if (getObjectFlags(type3) & 33554432) { + return getObjectFlags(type3) & 67108864 ? type3.cachedEquivalentBaseType : void 0; + } + type3.objectFlags |= 33554432; + const target = type3.target; + if (getObjectFlags(target) & 1) { + const baseTypeNode = getBaseTypeNodeOfClass(target); + if (baseTypeNode && baseTypeNode.expression.kind !== 80 && baseTypeNode.expression.kind !== 211) { + return void 0; + } + } + const bases = getBaseTypes(target); + if (bases.length !== 1) { + return void 0; + } + if (getMembersOfSymbol(type3.symbol).size) { + return void 0; + } + let instantiatedBase = !length(target.typeParameters) ? bases[0] : instantiateType(bases[0], createTypeMapper(target.typeParameters, getTypeArguments(type3).slice(0, target.typeParameters.length))); + if (length(getTypeArguments(type3)) > length(target.typeParameters)) { + instantiatedBase = getTypeWithThisArgument(instantiatedBase, last2(getTypeArguments(type3))); + } + type3.objectFlags |= 67108864; + return type3.cachedEquivalentBaseType = instantiatedBase; + } + function isEmptyLiteralType(type3) { + return strictNullChecks ? type3 === implicitNeverType : type3 === undefinedWideningType; + } + function isEmptyArrayLiteralType(type3) { + const elementType = getElementTypeOfArrayType(type3); + return !!elementType && isEmptyLiteralType(elementType); + } + function isTupleLikeType(type3) { + let lengthType; + return isTupleType(type3) || !!getPropertyOfType(type3, "0") || isArrayLikeType(type3) && !!(lengthType = getTypeOfPropertyOfType(type3, "length")) && everyType(lengthType, (t8) => !!(t8.flags & 256)); + } + function isArrayOrTupleLikeType(type3) { + return isArrayLikeType(type3) || isTupleLikeType(type3); + } + function getTupleElementType(type3, index4) { + const propType = getTypeOfPropertyOfType(type3, "" + index4); + if (propType) { + return propType; + } + if (everyType(type3, isTupleType)) { + return getTupleElementTypeOutOfStartCount(type3, index4, compilerOptions.noUncheckedIndexedAccess ? undefinedType2 : void 0); + } + return void 0; + } + function isNeitherUnitTypeNorNever(type3) { + return !(type3.flags & (109472 | 131072)); + } + function isUnitType(type3) { + return !!(type3.flags & 109472); + } + function isUnitLikeType(type3) { + const t8 = getBaseConstraintOrType(type3); + return t8.flags & 2097152 ? some2(t8.types, isUnitType) : isUnitType(t8); + } + function extractUnitType(type3) { + return type3.flags & 2097152 ? find2(type3.types, isUnitType) || type3 : type3; + } + function isLiteralType(type3) { + return type3.flags & 16 ? true : type3.flags & 1048576 ? type3.flags & 1024 ? true : every2(type3.types, isUnitType) : isUnitType(type3); + } + function getBaseTypeOfLiteralType(type3) { + return type3.flags & 1056 ? getBaseTypeOfEnumLikeType(type3) : type3.flags & (128 | 134217728 | 268435456) ? stringType2 : type3.flags & 256 ? numberType2 : type3.flags & 2048 ? bigintType : type3.flags & 512 ? booleanType2 : type3.flags & 1048576 ? getBaseTypeOfLiteralTypeUnion(type3) : type3; + } + function getBaseTypeOfLiteralTypeUnion(type3) { + const key = `B${getTypeId(type3)}`; + return getCachedType(key) ?? setCachedType(key, mapType2(type3, getBaseTypeOfLiteralType)); + } + function getBaseTypeOfLiteralTypeForComparison(type3) { + return type3.flags & (128 | 134217728 | 268435456) ? stringType2 : type3.flags & (256 | 32) ? numberType2 : type3.flags & 2048 ? bigintType : type3.flags & 512 ? booleanType2 : type3.flags & 1048576 ? mapType2(type3, getBaseTypeOfLiteralTypeForComparison) : type3; + } + function getWidenedLiteralType(type3) { + return type3.flags & 1056 && isFreshLiteralType(type3) ? getBaseTypeOfEnumLikeType(type3) : type3.flags & 128 && isFreshLiteralType(type3) ? stringType2 : type3.flags & 256 && isFreshLiteralType(type3) ? numberType2 : type3.flags & 2048 && isFreshLiteralType(type3) ? bigintType : type3.flags & 512 && isFreshLiteralType(type3) ? booleanType2 : type3.flags & 1048576 ? mapType2(type3, getWidenedLiteralType) : type3; + } + function getWidenedUniqueESSymbolType(type3) { + return type3.flags & 8192 ? esSymbolType : type3.flags & 1048576 ? mapType2(type3, getWidenedUniqueESSymbolType) : type3; + } + function getWidenedLiteralLikeTypeForContextualType(type3, contextualType) { + if (!isLiteralOfContextualType(type3, contextualType)) { + type3 = getWidenedUniqueESSymbolType(getWidenedLiteralType(type3)); + } + return getRegularTypeOfLiteralType(type3); + } + function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type3, contextualSignatureReturnType, isAsync2) { + if (type3 && isUnitType(type3)) { + const contextualType = !contextualSignatureReturnType ? void 0 : isAsync2 ? getPromisedTypeOfPromise(contextualSignatureReturnType) : contextualSignatureReturnType; + type3 = getWidenedLiteralLikeTypeForContextualType(type3, contextualType); + } + return type3; + } + function getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(type3, contextualSignatureReturnType, kind, isAsyncGenerator) { + if (type3 && isUnitType(type3)) { + const contextualType = !contextualSignatureReturnType ? void 0 : getIterationTypeOfGeneratorFunctionReturnType(kind, contextualSignatureReturnType, isAsyncGenerator); + type3 = getWidenedLiteralLikeTypeForContextualType(type3, contextualType); + } + return type3; + } + function isTupleType(type3) { + return !!(getObjectFlags(type3) & 4 && type3.target.objectFlags & 8); + } + function isGenericTupleType(type3) { + return isTupleType(type3) && !!(type3.target.combinedFlags & 8); + } + function isSingleElementGenericTupleType(type3) { + return isGenericTupleType(type3) && type3.target.elementFlags.length === 1; + } + function getRestTypeOfTupleType(type3) { + return getElementTypeOfSliceOfTupleType(type3, type3.target.fixedLength); + } + function getTupleElementTypeOutOfStartCount(type3, index4, undefinedOrMissingType2) { + return mapType2(type3, (t8) => { + const tupleType2 = t8; + const restType = getRestTypeOfTupleType(tupleType2); + if (!restType) { + return undefinedType2; + } + if (undefinedOrMissingType2 && index4 >= getTotalFixedElementCount(tupleType2.target)) { + return getUnionType([restType, undefinedOrMissingType2]); + } + return restType; + }); + } + function getRestArrayTypeOfTupleType(type3) { + const restType = getRestTypeOfTupleType(type3); + return restType && createArrayType(restType); + } + function getElementTypeOfSliceOfTupleType(type3, index4, endSkipCount = 0, writing = false, noReductions = false) { + const length2 = getTypeReferenceArity(type3) - endSkipCount; + if (index4 < length2) { + const typeArguments = getTypeArguments(type3); + const elementTypes = []; + for (let i7 = index4; i7 < length2; i7++) { + const t8 = typeArguments[i7]; + elementTypes.push(type3.target.elementFlags[i7] & 8 ? getIndexedAccessType(t8, numberType2) : t8); + } + return writing ? getIntersectionType(elementTypes) : getUnionType( + elementTypes, + noReductions ? 0 : 1 + /* Literal */ + ); + } + return void 0; + } + function isTupleTypeStructureMatching(t1, t22) { + return getTypeReferenceArity(t1) === getTypeReferenceArity(t22) && every2(t1.target.elementFlags, (f8, i7) => (f8 & 12) === (t22.target.elementFlags[i7] & 12)); + } + function isZeroBigInt({ value: value2 }) { + return value2.base10Value === "0"; + } + function removeDefinitelyFalsyTypes(type3) { + return filterType(type3, (t8) => hasTypeFacts( + t8, + 4194304 + /* Truthy */ + )); + } + function extractDefinitelyFalsyTypes(type3) { + return mapType2(type3, getDefinitelyFalsyPartOfType); + } + function getDefinitelyFalsyPartOfType(type3) { + return type3.flags & 4 ? emptyStringType : type3.flags & 8 ? zeroType : type3.flags & 64 ? zeroBigIntType : type3 === regularFalseType || type3 === falseType || type3.flags & (16384 | 32768 | 65536 | 3) || type3.flags & 128 && type3.value === "" || type3.flags & 256 && type3.value === 0 || type3.flags & 2048 && isZeroBigInt(type3) ? type3 : neverType2; + } + function getNullableType(type3, flags) { + const missing = flags & ~type3.flags & (32768 | 65536); + return missing === 0 ? type3 : missing === 32768 ? getUnionType([type3, undefinedType2]) : missing === 65536 ? getUnionType([type3, nullType2]) : getUnionType([type3, undefinedType2, nullType2]); + } + function getOptionalType(type3, isProperty = false) { + Debug.assert(strictNullChecks); + const missingOrUndefined = isProperty ? undefinedOrMissingType : undefinedType2; + return type3 === missingOrUndefined || type3.flags & 1048576 && type3.types[0] === missingOrUndefined ? type3 : getUnionType([type3, missingOrUndefined]); + } + function getGlobalNonNullableTypeInstantiation(type3) { + if (!deferredGlobalNonNullableTypeAlias) { + deferredGlobalNonNullableTypeAlias = getGlobalSymbol( + "NonNullable", + 524288, + /*diagnostic*/ + void 0 + ) || unknownSymbol; + } + return deferredGlobalNonNullableTypeAlias !== unknownSymbol ? getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type3]) : getIntersectionType([type3, emptyObjectType]); + } + function getNonNullableType(type3) { + return strictNullChecks ? getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ) : type3; + } + function addOptionalTypeMarker(type3) { + return strictNullChecks ? getUnionType([type3, optionalType2]) : type3; + } + function removeOptionalTypeMarker(type3) { + return strictNullChecks ? removeType(type3, optionalType2) : type3; + } + function propagateOptionalTypeMarker(type3, node, wasOptional) { + return wasOptional ? isOutermostOptionalChain(node) ? getOptionalType(type3) : addOptionalTypeMarker(type3) : type3; + } + function getOptionalExpressionType(exprType, expression) { + return isExpressionOfOptionalChainRoot(expression) ? getNonNullableType(exprType) : isOptionalChain(expression) ? removeOptionalTypeMarker(exprType) : exprType; + } + function removeMissingType(type3, isOptional2) { + return exactOptionalPropertyTypes && isOptional2 ? removeType(type3, missingType) : type3; + } + function containsMissingType(type3) { + return type3 === missingType || !!(type3.flags & 1048576) && type3.types[0] === missingType; + } + function removeMissingOrUndefinedType(type3) { + return exactOptionalPropertyTypes ? removeType(type3, missingType) : getTypeWithFacts( + type3, + 524288 + /* NEUndefined */ + ); + } + function isCoercibleUnderDoubleEquals(source, target) { + return (source.flags & (8 | 4 | 512)) !== 0 && (target.flags & (8 | 4 | 16)) !== 0; + } + function isObjectTypeWithInferableIndex(type3) { + const objectFlags = getObjectFlags(type3); + return type3.flags & 2097152 ? every2(type3.types, isObjectTypeWithInferableIndex) : !!(type3.symbol && (type3.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0 && !(type3.symbol.flags & 32) && !typeHasCallOrConstructSignatures(type3)) || !!(objectFlags & 4194304) || !!(objectFlags & 1024 && isObjectTypeWithInferableIndex(type3.source)); + } + function createSymbolWithType(source, type3) { + const symbol = createSymbol( + source.flags, + source.escapedName, + getCheckFlags(source) & 8 + /* Readonly */ + ); + symbol.declarations = source.declarations; + symbol.parent = source.parent; + symbol.links.type = type3; + symbol.links.target = source; + if (source.valueDeclaration) { + symbol.valueDeclaration = source.valueDeclaration; + } + const nameType = getSymbolLinks(source).nameType; + if (nameType) { + symbol.links.nameType = nameType; + } + return symbol; + } + function transformTypeOfMembers(type3, f8) { + const members = createSymbolTable(); + for (const property2 of getPropertiesOfObjectType(type3)) { + const original = getTypeOfSymbol(property2); + const updated = f8(original); + members.set(property2.escapedName, updated === original ? property2 : createSymbolWithType(property2, updated)); + } + return members; + } + function getRegularTypeOfObjectLiteral(type3) { + if (!(isObjectLiteralType2(type3) && getObjectFlags(type3) & 8192)) { + return type3; + } + const regularType = type3.regularType; + if (regularType) { + return regularType; + } + const resolved = type3; + const members = transformTypeOfMembers(type3, getRegularTypeOfObjectLiteral); + const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos); + regularNew.flags = resolved.flags; + regularNew.objectFlags |= resolved.objectFlags & ~8192; + type3.regularType = regularNew; + return regularNew; + } + function createWideningContext(parent22, propertyName, siblings) { + return { parent: parent22, propertyName, siblings, resolvedProperties: void 0 }; + } + function getSiblingsOfContext(context2) { + if (!context2.siblings) { + const siblings = []; + for (const type3 of getSiblingsOfContext(context2.parent)) { + if (isObjectLiteralType2(type3)) { + const prop = getPropertyOfObjectType(type3, context2.propertyName); + if (prop) { + forEachType(getTypeOfSymbol(prop), (t8) => { + siblings.push(t8); + }); + } + } + } + context2.siblings = siblings; + } + return context2.siblings; + } + function getPropertiesOfContext(context2) { + if (!context2.resolvedProperties) { + const names = /* @__PURE__ */ new Map(); + for (const t8 of getSiblingsOfContext(context2)) { + if (isObjectLiteralType2(t8) && !(getObjectFlags(t8) & 2097152)) { + for (const prop of getPropertiesOfType(t8)) { + names.set(prop.escapedName, prop); + } + } + } + context2.resolvedProperties = arrayFrom(names.values()); + } + return context2.resolvedProperties; + } + function getWidenedProperty(prop, context2) { + if (!(prop.flags & 4)) { + return prop; + } + const original = getTypeOfSymbol(prop); + const propContext = context2 && createWideningContext( + context2, + prop.escapedName, + /*siblings*/ + void 0 + ); + const widened = getWidenedTypeWithContext(original, propContext); + return widened === original ? prop : createSymbolWithType(prop, widened); + } + function getUndefinedProperty(prop) { + const cached = undefinedProperties.get(prop.escapedName); + if (cached) { + return cached; + } + const result2 = createSymbolWithType(prop, undefinedOrMissingType); + result2.flags |= 16777216; + undefinedProperties.set(prop.escapedName, result2); + return result2; + } + function getWidenedTypeOfObjectLiteral(type3, context2) { + const members = createSymbolTable(); + for (const prop of getPropertiesOfObjectType(type3)) { + members.set(prop.escapedName, getWidenedProperty(prop, context2)); + } + if (context2) { + for (const prop of getPropertiesOfContext(context2)) { + if (!members.has(prop.escapedName)) { + members.set(prop.escapedName, getUndefinedProperty(prop)); + } + } + } + const result2 = createAnonymousType(type3.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type3), (info2) => createIndexInfo(info2.keyType, getWidenedType(info2.type), info2.isReadonly))); + result2.objectFlags |= getObjectFlags(type3) & (4096 | 262144); + return result2; + } + function getWidenedType(type3) { + return getWidenedTypeWithContext( + type3, + /*context*/ + void 0 + ); + } + function getWidenedTypeWithContext(type3, context2) { + if (getObjectFlags(type3) & 196608) { + if (context2 === void 0 && type3.widened) { + return type3.widened; + } + let result2; + if (type3.flags & (1 | 98304)) { + result2 = anyType2; + } else if (isObjectLiteralType2(type3)) { + result2 = getWidenedTypeOfObjectLiteral(type3, context2); + } else if (type3.flags & 1048576) { + const unionContext = context2 || createWideningContext( + /*parent*/ + void 0, + /*propertyName*/ + void 0, + type3.types + ); + const widenedTypes = sameMap(type3.types, (t8) => t8.flags & 98304 ? t8 : getWidenedTypeWithContext(t8, unionContext)); + result2 = getUnionType( + widenedTypes, + some2(widenedTypes, isEmptyObjectType) ? 2 : 1 + /* Literal */ + ); + } else if (type3.flags & 2097152) { + result2 = getIntersectionType(sameMap(type3.types, getWidenedType)); + } else if (isArrayOrTupleType(type3)) { + result2 = createTypeReference(type3.target, sameMap(getTypeArguments(type3), getWidenedType)); + } + if (result2 && context2 === void 0) { + type3.widened = result2; + } + return result2 || type3; + } + return type3; + } + function reportWideningErrorsInType(type3) { + let errorReported = false; + if (getObjectFlags(type3) & 65536) { + if (type3.flags & 1048576) { + if (some2(type3.types, isEmptyObjectType)) { + errorReported = true; + } else { + for (const t8 of type3.types) { + if (reportWideningErrorsInType(t8)) { + errorReported = true; + } + } + } + } + if (isArrayOrTupleType(type3)) { + for (const t8 of getTypeArguments(type3)) { + if (reportWideningErrorsInType(t8)) { + errorReported = true; + } + } + } + if (isObjectLiteralType2(type3)) { + for (const p7 of getPropertiesOfObjectType(type3)) { + const t8 = getTypeOfSymbol(p7); + if (getObjectFlags(t8) & 65536) { + if (!reportWideningErrorsInType(t8)) { + error22(p7.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString2(p7), typeToString(getWidenedType(t8))); + } + errorReported = true; + } + } + } + } + return errorReported; + } + function reportImplicitAny(declaration, type3, wideningKind) { + const typeAsString = typeToString(getWidenedType(type3)); + if (isInJSFile(declaration) && !isCheckJsEnabledForFile(getSourceFileOfNode(declaration), compilerOptions)) { + return; + } + let diagnostic; + switch (declaration.kind) { + case 226: + case 172: + case 171: + diagnostic = noImplicitAny ? Diagnostics.Member_0_implicitly_has_an_1_type : Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + break; + case 169: + const param = declaration; + if (isIdentifier(param.name)) { + const originalKeywordKind = identifierToKeywordKind(param.name); + if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName( + param, + param.name.escapedText, + 788968, + /*nameNotFoundMessage*/ + void 0, + param.name.escapedText, + /*isUse*/ + true + ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) { + const newName = "arg" + param.parent.parameters.indexOf(param); + const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : ""); + errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName); + return; + } + } + diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + break; + case 208: + diagnostic = Diagnostics.Binding_element_0_implicitly_has_an_1_type; + if (!noImplicitAny) { + return; + } + break; + case 324: + error22(declaration, Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + return; + case 330: + if (noImplicitAny && isJSDocOverloadTag(declaration.parent)) { + error22(declaration.parent.tagName, Diagnostics.This_overload_implicitly_returns_the_type_0_because_it_lacks_a_return_type_annotation, typeAsString); + } + return; + case 262: + case 174: + case 173: + case 177: + case 178: + case 218: + case 219: + if (noImplicitAny && !declaration.name) { + if (wideningKind === 3) { + error22(declaration, Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation, typeAsString); + } else { + error22(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); + } + return; + } + diagnostic = !noImplicitAny ? Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage : wideningKind === 3 ? Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type : Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; + break; + case 200: + if (noImplicitAny) { + error22(declaration, Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + } + return; + default: + diagnostic = noImplicitAny ? Diagnostics.Variable_0_implicitly_has_an_1_type : Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage; + } + errorOrSuggestion(noImplicitAny, declaration, diagnostic, declarationNameToString(getNameOfDeclaration(declaration)), typeAsString); + } + function reportErrorsFromWidening(declaration, type3, wideningKind) { + addLazyDiagnostic(() => { + if (noImplicitAny && getObjectFlags(type3) & 65536 && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) { + if (!reportWideningErrorsInType(type3)) { + reportImplicitAny(declaration, type3, wideningKind); + } + } + }); + } + function applyToParameterTypes(source, target, callback) { + const sourceCount = getParameterCount(source); + const targetCount = getParameterCount(target); + const sourceRestType = getEffectiveRestType(source); + const targetRestType = getEffectiveRestType(target); + const targetNonRestCount = targetRestType ? targetCount - 1 : targetCount; + const paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount); + const sourceThisType = getThisTypeOfSignature(source); + if (sourceThisType) { + const targetThisType = getThisTypeOfSignature(target); + if (targetThisType) { + callback(sourceThisType, targetThisType); + } + } + for (let i7 = 0; i7 < paramCount; i7++) { + callback(getTypeAtPosition(source, i7), getTypeAtPosition(target, i7)); + } + if (targetRestType) { + callback(getRestTypeAtPosition( + source, + paramCount, + /*readonly*/ + isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType) + ), targetRestType); + } + } + function applyToReturnTypes(source, target, callback) { + const sourceTypePredicate = getTypePredicateOfSignature(source); + const targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && typePredicateKindsMatch(sourceTypePredicate, targetTypePredicate) && sourceTypePredicate.type && targetTypePredicate.type) { + callback(sourceTypePredicate.type, targetTypePredicate.type); + } else { + callback(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + } + } + function createInferenceContext(typeParameters, signature, flags, compareTypes) { + return createInferenceContextWorker(typeParameters.map(createInferenceInfo), signature, flags, compareTypes || compareTypesAssignable); + } + function cloneInferenceContext(context2, extraFlags = 0) { + return context2 && createInferenceContextWorker(map4(context2.inferences, cloneInferenceInfo), context2.signature, context2.flags | extraFlags, context2.compareTypes); + } + function createInferenceContextWorker(inferences, signature, flags, compareTypes) { + const context2 = { + inferences, + signature, + flags, + compareTypes, + mapper: reportUnmeasurableMapper, + // initialize to a noop mapper so the context object is available, but the underlying object shape is right upon construction + nonFixingMapper: reportUnmeasurableMapper + }; + context2.mapper = makeFixingMapperForContext(context2); + context2.nonFixingMapper = makeNonFixingMapperForContext(context2); + return context2; + } + function makeFixingMapperForContext(context2) { + return makeDeferredTypeMapper( + map4(context2.inferences, (i7) => i7.typeParameter), + map4(context2.inferences, (inference, i7) => () => { + if (!inference.isFixed) { + inferFromIntraExpressionSites(context2); + clearCachedInferences(context2.inferences); + inference.isFixed = true; + } + return getInferredType(context2, i7); + }) + ); + } + function makeNonFixingMapperForContext(context2) { + return makeDeferredTypeMapper( + map4(context2.inferences, (i7) => i7.typeParameter), + map4(context2.inferences, (_6, i7) => () => { + return getInferredType(context2, i7); + }) + ); + } + function clearCachedInferences(inferences) { + for (const inference of inferences) { + if (!inference.isFixed) { + inference.inferredType = void 0; + } + } + } + function addIntraExpressionInferenceSite(context2, node, type3) { + (context2.intraExpressionInferenceSites ?? (context2.intraExpressionInferenceSites = [])).push({ node, type: type3 }); + } + function inferFromIntraExpressionSites(context2) { + if (context2.intraExpressionInferenceSites) { + for (const { node, type: type3 } of context2.intraExpressionInferenceSites) { + const contextualType = node.kind === 174 ? getContextualTypeForObjectLiteralMethod( + node, + 2 + /* NoConstraints */ + ) : getContextualType2( + node, + 2 + /* NoConstraints */ + ); + if (contextualType) { + inferTypes(context2.inferences, type3, contextualType); + } + } + context2.intraExpressionInferenceSites = void 0; + } + } + function createInferenceInfo(typeParameter) { + return { + typeParameter, + candidates: void 0, + contraCandidates: void 0, + inferredType: void 0, + priority: void 0, + topLevel: true, + isFixed: false, + impliedArity: void 0 + }; + } + function cloneInferenceInfo(inference) { + return { + typeParameter: inference.typeParameter, + candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), + inferredType: inference.inferredType, + priority: inference.priority, + topLevel: inference.topLevel, + isFixed: inference.isFixed, + impliedArity: inference.impliedArity + }; + } + function cloneInferredPartOfContext(context2) { + const inferences = filter2(context2.inferences, hasInferenceCandidates); + return inferences.length ? createInferenceContextWorker(map4(inferences, cloneInferenceInfo), context2.signature, context2.flags, context2.compareTypes) : void 0; + } + function getMapperFromContext(context2) { + return context2 && context2.mapper; + } + function couldContainTypeVariables(type3) { + const objectFlags = getObjectFlags(type3); + if (objectFlags & 524288) { + return !!(objectFlags & 1048576); + } + const result2 = !!(type3.flags & 465829888 || type3.flags & 524288 && !isNonGenericTopLevelType(type3) && (objectFlags & 4 && (type3.node || some2(getTypeArguments(type3), couldContainTypeVariables)) || objectFlags & 16 && type3.symbol && type3.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type3.symbol.declarations || objectFlags & (32 | 1024 | 4194304 | 8388608)) || type3.flags & 3145728 && !(type3.flags & 1024) && !isNonGenericTopLevelType(type3) && some2(type3.types, couldContainTypeVariables)); + if (type3.flags & 3899393) { + type3.objectFlags |= 524288 | (result2 ? 1048576 : 0); + } + return result2; + } + function isNonGenericTopLevelType(type3) { + if (type3.aliasSymbol && !type3.aliasTypeArguments) { + const declaration = getDeclarationOfKind( + type3.aliasSymbol, + 265 + /* TypeAliasDeclaration */ + ); + return !!(declaration && findAncestor(declaration.parent, (n7) => n7.kind === 312 ? true : n7.kind === 267 ? false : "quit")); + } + return false; + } + function isTypeParameterAtTopLevel(type3, tp, depth = 0) { + return !!(type3 === tp || type3.flags & 3145728 && some2(type3.types, (t8) => isTypeParameterAtTopLevel(t8, tp, depth)) || depth < 3 && type3.flags & 16777216 && (isTypeParameterAtTopLevel(getTrueTypeFromConditionalType(type3), tp, depth + 1) || isTypeParameterAtTopLevel(getFalseTypeFromConditionalType(type3), tp, depth + 1))); + } + function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) { + const typePredicate = getTypePredicateOfSignature(signature); + return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter); + } + function createEmptyObjectTypeFromStringLiteral(type3) { + const members = createSymbolTable(); + forEachType(type3, (t8) => { + if (!(t8.flags & 128)) { + return; + } + const name2 = escapeLeadingUnderscores(t8.value); + const literalProp = createSymbol(4, name2); + literalProp.links.type = anyType2; + if (t8.symbol) { + literalProp.declarations = t8.symbol.declarations; + literalProp.valueDeclaration = t8.symbol.valueDeclaration; + } + members.set(name2, literalProp); + }); + const indexInfos = type3.flags & 4 ? [createIndexInfo( + stringType2, + emptyObjectType, + /*isReadonly*/ + false + )] : emptyArray; + return createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + indexInfos + ); + } + function inferTypeForHomomorphicMappedType(source, target, constraint) { + const cacheKey = source.id + "," + target.id + "," + constraint.id; + if (reverseMappedCache.has(cacheKey)) { + return reverseMappedCache.get(cacheKey); + } + const recursionKey = source.id + "," + (target.target || target).id; + if (contains2(homomorphicMappedTypeInferenceStack, recursionKey)) { + return void 0; + } + homomorphicMappedTypeInferenceStack.push(recursionKey); + const type3 = createReverseMappedType(source, target, constraint); + homomorphicMappedTypeInferenceStack.pop(); + reverseMappedCache.set(cacheKey, type3); + return type3; + } + function isPartiallyInferableType(type3) { + return !(getObjectFlags(type3) & 262144) || isObjectLiteralType2(type3) && some2(getPropertiesOfType(type3), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type3) && some2(getElementTypes(type3), isPartiallyInferableType); + } + function createReverseMappedType(source, target, constraint) { + if (!(getIndexInfoOfType(source, stringType2) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) { + return void 0; + } + if (isArrayType(source)) { + return createArrayType(inferReverseMappedType(getTypeArguments(source)[0], target, constraint), isReadonlyArrayType(source)); + } + if (isTupleType(source)) { + const elementTypes = map4(getElementTypes(source), (t8) => inferReverseMappedType(t8, target, constraint)); + const elementFlags = getMappedTypeModifiers(target) & 4 ? sameMap(source.target.elementFlags, (f8) => f8 & 2 ? 1 : f8) : source.target.elementFlags; + return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations); + } + const reversed = createObjectType( + 1024 | 16, + /*symbol*/ + void 0 + ); + reversed.source = source; + reversed.mappedType = target; + reversed.constraintType = constraint; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + const links = getSymbolLinks(symbol); + if (!links.type) { + links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType); + } + return links.type; + } + function inferReverseMappedType(sourceType, target, constraint) { + const typeParameter = getIndexedAccessType(constraint.type, getTypeParameterFromMappedType(target)); + const templateType = getTemplateTypeFromMappedType(target); + const inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || unknownType2; + } + function* getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) { + const properties = getPropertiesOfType(target); + for (const targetProp of properties) { + if (isStaticPrivateIdentifierProperty(targetProp)) { + continue; + } + if (requireOptionalProperties || !(targetProp.flags & 16777216 || getCheckFlags(targetProp) & 48)) { + const sourceProp = getPropertyOfType(source, targetProp.escapedName); + if (!sourceProp) { + yield targetProp; + } else if (matchDiscriminantProperties) { + const targetType = getTypeOfSymbol(targetProp); + if (targetType.flags & 109472) { + const sourceType = getTypeOfSymbol(sourceProp); + if (!(sourceType.flags & 1 || getRegularTypeOfLiteralType(sourceType) === getRegularTypeOfLiteralType(targetType))) { + yield targetProp; + } + } + } + } + } + } + function getUnmatchedProperty(source, target, requireOptionalProperties, matchDiscriminantProperties) { + return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties)); + } + function tupleTypesDefinitelyUnrelated(source, target) { + return !(target.target.combinedFlags & 8) && target.target.minLength > source.target.minLength || !target.target.hasRestElement && (source.target.hasRestElement || target.target.fixedLength < source.target.fixedLength); + } + function typesDefinitelyUnrelated(source, target) { + return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty( + source, + target, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + true + ) && !!getUnmatchedProperty( + target, + source, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + false + ); + } + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType( + inference.candidates, + 2 + /* Subtype */ + ) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : void 0; + } + function hasSkipDirectInferenceFlag(node) { + return !!getNodeLinks(node).skipDirectInference; + } + function isFromInferenceBlockedSource(type3) { + return !!(type3.symbol && some2(type3.symbol.declarations, hasSkipDirectInferenceFlag)); + } + function templateLiteralTypesDefinitelyUnrelated(source, target) { + const sourceStart = source.texts[0]; + const targetStart = target.texts[0]; + const sourceEnd = source.texts[source.texts.length - 1]; + const targetEnd = target.texts[target.texts.length - 1]; + const startLen = Math.min(sourceStart.length, targetStart.length); + const endLen = Math.min(sourceEnd.length, targetEnd.length); + return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) || sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen); + } + function isValidNumberString(s7, roundTripOnly) { + if (s7 === "") + return false; + const n7 = +s7; + return isFinite(n7) && (!roundTripOnly || "" + n7 === s7); + } + function parseBigIntLiteralType(text) { + return getBigIntLiteralType(parseValidBigInt(text)); + } + function isMemberOfStringMapping(source, target) { + if (target.flags & 1) { + return true; + } + if (target.flags & (4 | 134217728)) { + return isTypeAssignableTo(source, target); + } + if (target.flags & 268435456) { + const mappingStack = []; + while (target.flags & 268435456) { + mappingStack.unshift(target.symbol); + target = target.type; + } + const mappedSource = reduceLeft(mappingStack, (memo, value2) => getStringMappingType(value2, memo), source); + return mappedSource === source && isMemberOfStringMapping(source, target); + } + return false; + } + function isValidTypeForTemplateLiteralPlaceholder(source, target) { + if (target.flags & 2097152) { + return every2(target.types, (t8) => t8 === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t8)); + } + if (target.flags & 4 || isTypeAssignableTo(source, target)) { + return true; + } + if (source.flags & 128) { + const value2 = source.value; + return !!(target.flags & 8 && isValidNumberString( + value2, + /*roundTripOnly*/ + false + ) || target.flags & 64 && isValidBigIntString( + value2, + /*roundTripOnly*/ + false + ) || target.flags & (512 | 98304) && value2 === target.intrinsicName || target.flags & 268435456 && isMemberOfStringMapping(getStringLiteralType(value2), target) || target.flags & 134217728 && isTypeMatchedByTemplateLiteralType(source, target)); + } + if (source.flags & 134217728) { + const texts = source.texts; + return texts.length === 2 && texts[0] === "" && texts[1] === "" && isTypeAssignableTo(source.types[0], target); + } + return false; + } + function inferTypesFromTemplateLiteralType(source, target) { + return source.flags & 128 ? inferFromLiteralPartsToTemplateLiteral([source.value], emptyArray, target) : source.flags & 134217728 ? arraysEqual(source.texts, target.texts) ? map4(source.types, getStringLikeTypeForType) : inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) : void 0; + } + function isTypeMatchedByTemplateLiteralType(source, target) { + const inferences = inferTypesFromTemplateLiteralType(source, target); + return !!inferences && every2(inferences, (r8, i7) => isValidTypeForTemplateLiteralPlaceholder(r8, target.types[i7])); + } + function getStringLikeTypeForType(type3) { + return type3.flags & (1 | 402653316) ? type3 : getTemplateLiteralType(["", ""], [type3]); + } + function inferFromLiteralPartsToTemplateLiteral(sourceTexts, sourceTypes, target) { + const lastSourceIndex = sourceTexts.length - 1; + const sourceStartText = sourceTexts[0]; + const sourceEndText = sourceTexts[lastSourceIndex]; + const targetTexts = target.texts; + const lastTargetIndex = targetTexts.length - 1; + const targetStartText = targetTexts[0]; + const targetEndText = targetTexts[lastTargetIndex]; + if (lastSourceIndex === 0 && sourceStartText.length < targetStartText.length + targetEndText.length || !sourceStartText.startsWith(targetStartText) || !sourceEndText.endsWith(targetEndText)) + return void 0; + const remainingEndText = sourceEndText.slice(0, sourceEndText.length - targetEndText.length); + const matches2 = []; + let seg = 0; + let pos = targetStartText.length; + for (let i7 = 1; i7 < lastTargetIndex; i7++) { + const delim = targetTexts[i7]; + if (delim.length > 0) { + let s7 = seg; + let p7 = pos; + while (true) { + p7 = getSourceText(s7).indexOf(delim, p7); + if (p7 >= 0) + break; + s7++; + if (s7 === sourceTexts.length) + return void 0; + p7 = 0; + } + addMatch(s7, p7); + pos += delim.length; + } else if (pos < getSourceText(seg).length) { + addMatch(seg, pos + 1); + } else if (seg < lastSourceIndex) { + addMatch(seg + 1, 0); + } else { + return void 0; + } + } + addMatch(lastSourceIndex, getSourceText(lastSourceIndex).length); + return matches2; + function getSourceText(index4) { + return index4 < lastSourceIndex ? sourceTexts[index4] : remainingEndText; + } + function addMatch(s7, p7) { + const matchType = s7 === seg ? getStringLiteralType(getSourceText(s7).slice(pos, p7)) : getTemplateLiteralType( + [sourceTexts[seg].slice(pos), ...sourceTexts.slice(seg + 1, s7), getSourceText(s7).slice(0, p7)], + sourceTypes.slice(seg, s7) + ); + matches2.push(matchType); + seg = s7; + pos = p7; + } + } + function inferTypes(inferences, originalSource, originalTarget, priority = 0, contravariant = false) { + let bivariant = false; + let propagationType; + let inferencePriority = 2048; + let visited; + let sourceStack; + let targetStack; + let expandingFlags = 0; + inferFromTypes(originalSource, originalTarget); + function inferFromTypes(source, target) { + if (!couldContainTypeVariables(target) || isNoInferType(target)) { + return; + } + if (source === wildcardType || source === blockedStringType) { + const savePropagationType = propagationType; + propagationType = source; + inferFromTypes(target, target); + propagationType = savePropagationType; + return; + } + if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) { + if (source.aliasTypeArguments) { + const params = getSymbolLinks(source.aliasSymbol).typeParameters; + const minParams = getMinTypeArgumentCount(params); + const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration)); + const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration)); + inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol)); + } + return; + } + if (source === target && source.flags & 3145728) { + for (const t8 of source.types) { + inferFromTypes(t8, t8); + } + return; + } + if (target.flags & 1048576) { + const [tempSources, tempTargets] = inferFromMatchingTypes(source.flags & 1048576 ? source.types : [source], target.types, isTypeOrBaseIdenticalTo); + const [sources, targets] = inferFromMatchingTypes(tempSources, tempTargets, isTypeCloselyMatchedBy); + if (targets.length === 0) { + return; + } + target = getUnionType(targets); + if (sources.length === 0) { + inferWithPriority( + source, + target, + 1 + /* NakedTypeVariable */ + ); + return; + } + source = getUnionType(sources); + } else if (target.flags & 2097152 && !every2(target.types, isNonGenericObjectType)) { + if (!(source.flags & 1048576)) { + const [sources, targets] = inferFromMatchingTypes(source.flags & 2097152 ? source.types : [source], target.types, isTypeIdenticalTo); + if (sources.length === 0 || targets.length === 0) { + return; + } + source = getIntersectionType(sources); + target = getIntersectionType(targets); + } + } + if (target.flags & (8388608 | 33554432)) { + if (isNoInferType(target)) { + return; + } + target = getActualTypeVariable(target); + } + if (target.flags & 8650752) { + if (isFromInferenceBlockedSource(source)) { + return; + } + const inference = getInferenceInfoForType(target); + if (inference) { + if (getObjectFlags(source) & 262144 || source === nonInferrableAnyType) { + return; + } + if (!inference.isFixed) { + const candidate = propagationType || source; + if (candidate === blockedStringType) { + return; + } + if (inference.priority === void 0 || priority < inference.priority) { + inference.candidates = void 0; + inference.contraCandidates = void 0; + inference.topLevel = true; + inference.priority = priority; + } + if (priority === inference.priority) { + if (contravariant && !bivariant) { + if (!contains2(inference.contraCandidates, candidate)) { + inference.contraCandidates = append(inference.contraCandidates, candidate); + clearCachedInferences(inferences); + } + } else if (!contains2(inference.candidates, candidate)) { + inference.candidates = append(inference.candidates, candidate); + clearCachedInferences(inferences); + } + } + if (!(priority & 128) && target.flags & 262144 && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, target)) { + inference.topLevel = false; + clearCachedInferences(inferences); + } + } + inferencePriority = Math.min(inferencePriority, priority); + return; + } + const simplified = getSimplifiedType( + target, + /*writing*/ + false + ); + if (simplified !== target) { + inferFromTypes(source, simplified); + } else if (target.flags & 8388608) { + const indexType = getSimplifiedType( + target.indexType, + /*writing*/ + false + ); + if (indexType.flags & 465829888) { + const simplified2 = distributeIndexOverObjectType( + getSimplifiedType( + target.objectType, + /*writing*/ + false + ), + indexType, + /*writing*/ + false + ); + if (simplified2 && simplified2 !== target) { + inferFromTypes(source, simplified2); + } + } + } + } + if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && (source.target === target.target || isArrayType(source) && isArrayType(target)) && !(source.node && target.node)) { + inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); + } else if (source.flags & 4194304 && target.flags & 4194304) { + inferFromContravariantTypes(source.type, target.type); + } else if ((isLiteralType(source) || source.flags & 4) && target.flags & 4194304) { + const empty2 = createEmptyObjectTypeFromStringLiteral(source); + inferFromContravariantTypesWithPriority( + empty2, + target.type, + 256 + /* LiteralKeyof */ + ); + } else if (source.flags & 8388608 && target.flags & 8388608) { + inferFromTypes(source.objectType, target.objectType); + inferFromTypes(source.indexType, target.indexType); + } else if (source.flags & 268435456 && target.flags & 268435456) { + if (source.symbol === target.symbol) { + inferFromTypes(source.type, target.type); + } + } else if (source.flags & 33554432) { + inferFromTypes(source.baseType, target); + inferWithPriority( + getSubstitutionIntersection(source), + target, + 4 + /* SubstituteSource */ + ); + } else if (target.flags & 16777216) { + invokeOnce(source, target, inferToConditionalType); + } else if (target.flags & 3145728) { + inferToMultipleTypes(source, target.types, target.flags); + } else if (source.flags & 1048576) { + const sourceTypes = source.types; + for (const sourceType of sourceTypes) { + inferFromTypes(sourceType, target); + } + } else if (target.flags & 134217728) { + inferToTemplateLiteralType(source, target); + } else { + source = getReducedType(source); + if (isGenericMappedType(source) && isGenericMappedType(target)) { + invokeOnce(source, target, inferFromGenericMappedTypes); + } + if (!(priority & 512 && source.flags & (2097152 | 465829888))) { + const apparentSource = getApparentType(source); + if (apparentSource !== source && !(apparentSource.flags & (524288 | 2097152))) { + return inferFromTypes(apparentSource, target); + } + source = apparentSource; + } + if (source.flags & (524288 | 2097152)) { + invokeOnce(source, target, inferFromObjectTypes); + } + } + } + function inferWithPriority(source, target, newPriority) { + const savePriority = priority; + priority |= newPriority; + inferFromTypes(source, target); + priority = savePriority; + } + function inferFromContravariantTypesWithPriority(source, target, newPriority) { + const savePriority = priority; + priority |= newPriority; + inferFromContravariantTypes(source, target); + priority = savePriority; + } + function inferToMultipleTypesWithPriority(source, targets, targetFlags, newPriority) { + const savePriority = priority; + priority |= newPriority; + inferToMultipleTypes(source, targets, targetFlags); + priority = savePriority; + } + function invokeOnce(source, target, action) { + const key = source.id + "," + target.id; + const status = visited && visited.get(key); + if (status !== void 0) { + inferencePriority = Math.min(inferencePriority, status); + return; + } + (visited || (visited = /* @__PURE__ */ new Map())).set( + key, + -1 + /* Circularity */ + ); + const saveInferencePriority = inferencePriority; + inferencePriority = 2048; + const saveExpandingFlags = expandingFlags; + (sourceStack ?? (sourceStack = [])).push(source); + (targetStack ?? (targetStack = [])).push(target); + if (isDeeplyNestedType(source, sourceStack, sourceStack.length, 2)) + expandingFlags |= 1; + if (isDeeplyNestedType(target, targetStack, targetStack.length, 2)) + expandingFlags |= 2; + if (expandingFlags !== 3) { + action(source, target); + } else { + inferencePriority = -1; + } + targetStack.pop(); + sourceStack.pop(); + expandingFlags = saveExpandingFlags; + visited.set(key, inferencePriority); + inferencePriority = Math.min(inferencePriority, saveInferencePriority); + } + function inferFromMatchingTypes(sources, targets, matches2) { + let matchedSources; + let matchedTargets; + for (const t8 of targets) { + for (const s7 of sources) { + if (matches2(s7, t8)) { + inferFromTypes(s7, t8); + matchedSources = appendIfUnique(matchedSources, s7); + matchedTargets = appendIfUnique(matchedTargets, t8); + } + } + } + return [ + matchedSources ? filter2(sources, (t8) => !contains2(matchedSources, t8)) : sources, + matchedTargets ? filter2(targets, (t8) => !contains2(matchedTargets, t8)) : targets + ]; + } + function inferFromTypeArguments(sourceTypes, targetTypes, variances) { + const count2 = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; + for (let i7 = 0; i7 < count2; i7++) { + if (i7 < variances.length && (variances[i7] & 7) === 2) { + inferFromContravariantTypes(sourceTypes[i7], targetTypes[i7]); + } else { + inferFromTypes(sourceTypes[i7], targetTypes[i7]); + } + } + } + function inferFromContravariantTypes(source, target) { + contravariant = !contravariant; + inferFromTypes(source, target); + contravariant = !contravariant; + } + function inferFromContravariantTypesIfStrictFunctionTypes(source, target) { + if (strictFunctionTypes || priority & 1024) { + inferFromContravariantTypes(source, target); + } else { + inferFromTypes(source, target); + } + } + function getInferenceInfoForType(type3) { + if (type3.flags & 8650752) { + for (const inference of inferences) { + if (type3 === inference.typeParameter) { + return inference; + } + } + } + return void 0; + } + function getSingleTypeVariableFromIntersectionTypes(types3) { + let typeVariable; + for (const type3 of types3) { + const t8 = type3.flags & 2097152 && find2(type3.types, (t22) => !!getInferenceInfoForType(t22)); + if (!t8 || typeVariable && t8 !== typeVariable) { + return void 0; + } + typeVariable = t8; + } + return typeVariable; + } + function inferToMultipleTypes(source, targets, targetFlags) { + let typeVariableCount = 0; + if (targetFlags & 1048576) { + let nakedTypeVariable; + const sources = source.flags & 1048576 ? source.types : [source]; + const matched = new Array(sources.length); + let inferenceCircularity = false; + for (const t8 of targets) { + if (getInferenceInfoForType(t8)) { + nakedTypeVariable = t8; + typeVariableCount++; + } else { + for (let i7 = 0; i7 < sources.length; i7++) { + const saveInferencePriority = inferencePriority; + inferencePriority = 2048; + inferFromTypes(sources[i7], t8); + if (inferencePriority === priority) + matched[i7] = true; + inferenceCircularity = inferenceCircularity || inferencePriority === -1; + inferencePriority = Math.min(inferencePriority, saveInferencePriority); + } + } + } + if (typeVariableCount === 0) { + const intersectionTypeVariable = getSingleTypeVariableFromIntersectionTypes(targets); + if (intersectionTypeVariable) { + inferWithPriority( + source, + intersectionTypeVariable, + 1 + /* NakedTypeVariable */ + ); + } + return; + } + if (typeVariableCount === 1 && !inferenceCircularity) { + const unmatched = flatMap2(sources, (s7, i7) => matched[i7] ? void 0 : s7); + if (unmatched.length) { + inferFromTypes(getUnionType(unmatched), nakedTypeVariable); + return; + } + } + } else { + for (const t8 of targets) { + if (getInferenceInfoForType(t8)) { + typeVariableCount++; + } else { + inferFromTypes(source, t8); + } + } + } + if (targetFlags & 2097152 ? typeVariableCount === 1 : typeVariableCount > 0) { + for (const t8 of targets) { + if (getInferenceInfoForType(t8)) { + inferWithPriority( + source, + t8, + 1 + /* NakedTypeVariable */ + ); + } + } + } + } + function inferToMappedType(source, target, constraintType) { + if (constraintType.flags & 1048576 || constraintType.flags & 2097152) { + let result2 = false; + for (const type3 of constraintType.types) { + result2 = inferToMappedType(source, target, type3) || result2; + } + return result2; + } + if (constraintType.flags & 4194304) { + const inference = getInferenceInfoForType(constraintType.type); + if (inference && !inference.isFixed && !isFromInferenceBlockedSource(source)) { + const inferredType = inferTypeForHomomorphicMappedType(source, target, constraintType); + if (inferredType) { + inferWithPriority( + inferredType, + inference.typeParameter, + getObjectFlags(source) & 262144 ? 16 : 8 + /* HomomorphicMappedType */ + ); + } + } + return true; + } + if (constraintType.flags & 262144) { + inferWithPriority( + getIndexType( + source, + /*indexFlags*/ + !!source.pattern ? 2 : 0 + /* None */ + ), + constraintType, + 32 + /* MappedTypeConstraint */ + ); + const extendedConstraint = getConstraintOfType(constraintType); + if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) { + return true; + } + const propTypes = map4(getPropertiesOfType(source), getTypeOfSymbol); + const indexTypes = map4(getIndexInfosOfType(source), (info2) => info2 !== enumNumberIndexInfo ? info2.type : neverType2); + inferFromTypes(getUnionType(concatenate(propTypes, indexTypes)), getTemplateTypeFromMappedType(target)); + return true; + } + return false; + } + function inferToConditionalType(source, target) { + if (source.flags & 16777216) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + } else { + const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)]; + inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 : 0); + } + } + function inferToTemplateLiteralType(source, target) { + const matches2 = inferTypesFromTemplateLiteralType(source, target); + const types3 = target.types; + if (matches2 || every2(target.texts, (s7) => s7.length === 0)) { + for (let i7 = 0; i7 < types3.length; i7++) { + const source2 = matches2 ? matches2[i7] : neverType2; + const target2 = types3[i7]; + if (source2.flags & 128 && target2.flags & 8650752) { + const inferenceContext = getInferenceInfoForType(target2); + const constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : void 0; + if (constraint && !isTypeAny(constraint)) { + const constraintTypes = constraint.flags & 1048576 ? constraint.types : [constraint]; + let allTypeFlags = reduceLeft(constraintTypes, (flags, t8) => flags | t8.flags, 0); + if (!(allTypeFlags & 4)) { + const str2 = source2.value; + if (allTypeFlags & 296 && !isValidNumberString( + str2, + /*roundTripOnly*/ + true + )) { + allTypeFlags &= ~296; + } + if (allTypeFlags & 2112 && !isValidBigIntString( + str2, + /*roundTripOnly*/ + true + )) { + allTypeFlags &= ~2112; + } + const matchingType = reduceLeft(constraintTypes, (left, right) => !(right.flags & allTypeFlags) ? left : left.flags & 4 ? left : right.flags & 4 ? source2 : left.flags & 134217728 ? left : right.flags & 134217728 && isTypeMatchedByTemplateLiteralType(source2, right) ? source2 : left.flags & 268435456 ? left : right.flags & 268435456 && str2 === applyStringMapping(right.symbol, str2) ? source2 : left.flags & 128 ? left : right.flags & 128 && right.value === str2 ? right : left.flags & 8 ? left : right.flags & 8 ? getNumberLiteralType(+str2) : left.flags & 32 ? left : right.flags & 32 ? getNumberLiteralType(+str2) : left.flags & 256 ? left : right.flags & 256 && right.value === +str2 ? right : left.flags & 64 ? left : right.flags & 64 ? parseBigIntLiteralType(str2) : left.flags & 2048 ? left : right.flags & 2048 && pseudoBigIntToString(right.value) === str2 ? right : left.flags & 16 ? left : right.flags & 16 ? str2 === "true" ? trueType : str2 === "false" ? falseType : booleanType2 : left.flags & 512 ? left : right.flags & 512 && right.intrinsicName === str2 ? right : left.flags & 32768 ? left : right.flags & 32768 && right.intrinsicName === str2 ? right : left.flags & 65536 ? left : right.flags & 65536 && right.intrinsicName === str2 ? right : left, neverType2); + if (!(matchingType.flags & 131072)) { + inferFromTypes(matchingType, target2); + continue; + } + } + } + } + inferFromTypes(source2, target2); + } + } + } + function inferFromGenericMappedTypes(source, target) { + inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); + inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + const sourceNameType = getNameTypeFromMappedType(source); + const targetNameType = getNameTypeFromMappedType(target); + if (sourceNameType && targetNameType) + inferFromTypes(sourceNameType, targetNameType); + } + function inferFromObjectTypes(source, target) { + var _a2, _b; + if (getObjectFlags(source) & 4 && getObjectFlags(target) & 4 && (source.target === target.target || isArrayType(source) && isArrayType(target))) { + inferFromTypeArguments(getTypeArguments(source), getTypeArguments(target), getVariances(source.target)); + return; + } + if (isGenericMappedType(source) && isGenericMappedType(target)) { + inferFromGenericMappedTypes(source, target); + } + if (getObjectFlags(target) & 32 && !target.declaration.nameType) { + const constraintType = getConstraintTypeFromMappedType(target); + if (inferToMappedType(source, target, constraintType)) { + return; + } + } + if (!typesDefinitelyUnrelated(source, target)) { + if (isArrayOrTupleType(source)) { + if (isTupleType(target)) { + const sourceArity = getTypeReferenceArity(source); + const targetArity = getTypeReferenceArity(target); + const elementTypes = getTypeArguments(target); + const elementFlags = target.target.elementFlags; + if (isTupleType(source) && isTupleTypeStructureMatching(source, target)) { + for (let i7 = 0; i7 < targetArity; i7++) { + inferFromTypes(getTypeArguments(source)[i7], elementTypes[i7]); + } + return; + } + const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0; + const endLength = Math.min(isTupleType(source) ? getEndElementCount( + source.target, + 3 + /* Fixed */ + ) : 0, target.target.hasRestElement ? getEndElementCount( + target.target, + 3 + /* Fixed */ + ) : 0); + for (let i7 = 0; i7 < startLength; i7++) { + inferFromTypes(getTypeArguments(source)[i7], elementTypes[i7]); + } + if (!isTupleType(source) || sourceArity - startLength - endLength === 1 && source.target.elementFlags[startLength] & 4) { + const restType = getTypeArguments(source)[startLength]; + for (let i7 = startLength; i7 < targetArity - endLength; i7++) { + inferFromTypes(elementFlags[i7] & 8 ? createArrayType(restType) : restType, elementTypes[i7]); + } + } else { + const middleLength = targetArity - startLength - endLength; + if (middleLength === 2) { + if (elementFlags[startLength] & elementFlags[startLength + 1] & 8) { + const targetInfo = getInferenceInfoForType(elementTypes[startLength]); + if (targetInfo && targetInfo.impliedArity !== void 0) { + inferFromTypes(sliceTupleType(source, startLength, endLength + sourceArity - targetInfo.impliedArity), elementTypes[startLength]); + inferFromTypes(sliceTupleType(source, startLength + targetInfo.impliedArity, endLength), elementTypes[startLength + 1]); + } + } else if (elementFlags[startLength] & 8 && elementFlags[startLength + 1] & 4) { + const param = (_a2 = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a2.typeParameter; + const constraint = param && getBaseConstraintOfType(param); + if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { + const impliedArity = constraint.target.fixedLength; + inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]); + inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]); + } + } else if (elementFlags[startLength] & 4 && elementFlags[startLength + 1] & 8) { + const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter; + const constraint = param && getBaseConstraintOfType(param); + if (constraint && isTupleType(constraint) && !constraint.target.hasRestElement) { + const impliedArity = constraint.target.fixedLength; + const endIndex = sourceArity - getEndElementCount( + target.target, + 3 + /* Fixed */ + ); + const startIndex = endIndex - impliedArity; + const trailingSlice = createTupleType( + getTypeArguments(source).slice(startIndex, endIndex), + source.target.elementFlags.slice(startIndex, endIndex), + /*readonly*/ + false, + source.target.labeledElementDeclarations && source.target.labeledElementDeclarations.slice(startIndex, endIndex) + ); + inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength, endLength + impliedArity), elementTypes[startLength]); + inferFromTypes(trailingSlice, elementTypes[startLength + 1]); + } + } + } else if (middleLength === 1 && elementFlags[startLength] & 8) { + const endsInOptional = target.target.elementFlags[targetArity - 1] & 2; + const sourceSlice = sliceTupleType(source, startLength, endLength); + inferWithPriority(sourceSlice, elementTypes[startLength], endsInOptional ? 2 : 0); + } else if (middleLength === 1 && elementFlags[startLength] & 4) { + const restType = getElementTypeOfSliceOfTupleType(source, startLength, endLength); + if (restType) { + inferFromTypes(restType, elementTypes[startLength]); + } + } + } + for (let i7 = 0; i7 < endLength; i7++) { + inferFromTypes(getTypeArguments(source)[sourceArity - i7 - 1], elementTypes[targetArity - i7 - 1]); + } + return; + } + if (isArrayType(target)) { + inferFromIndexTypes(source, target); + return; + } + } + inferFromProperties(source, target); + inferFromSignatures( + source, + target, + 0 + /* Call */ + ); + inferFromSignatures( + source, + target, + 1 + /* Construct */ + ); + inferFromIndexTypes(source, target); + } + } + function inferFromProperties(source, target) { + const properties = getPropertiesOfObjectType(target); + for (const targetProp of properties) { + const sourceProp = getPropertyOfType(source, targetProp.escapedName); + if (sourceProp && !some2(sourceProp.declarations, hasSkipDirectInferenceFlag)) { + inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); + } + } + } + function inferFromSignatures(source, target, kind) { + const sourceSignatures = getSignaturesOfType(source, kind); + const sourceLen = sourceSignatures.length; + if (sourceLen > 0) { + const targetSignatures = getSignaturesOfType(target, kind); + const targetLen = targetSignatures.length; + for (let i7 = 0; i7 < targetLen; i7++) { + const sourceIndex = Math.max(sourceLen - targetLen + i7, 0); + inferFromSignature(getBaseSignature(sourceSignatures[sourceIndex]), getErasedSignature(targetSignatures[i7])); + } + } + } + function inferFromSignature(source, target) { + if (!(source.flags & 64)) { + const saveBivariant = bivariant; + const kind = target.declaration ? target.declaration.kind : 0; + bivariant = bivariant || kind === 174 || kind === 173 || kind === 176; + applyToParameterTypes(source, target, inferFromContravariantTypesIfStrictFunctionTypes); + bivariant = saveBivariant; + } + applyToReturnTypes(source, target, inferFromTypes); + } + function inferFromIndexTypes(source, target) { + const priority2 = getObjectFlags(source) & getObjectFlags(target) & 32 ? 8 : 0; + const indexInfos = getIndexInfosOfType(target); + if (isObjectTypeWithInferableIndex(source)) { + for (const targetInfo of indexInfos) { + const propTypes = []; + for (const prop of getPropertiesOfType(source)) { + if (isApplicableIndexType(getLiteralTypeFromProperty( + prop, + 8576 + /* StringOrNumberLiteralOrUnique */ + ), targetInfo.keyType)) { + const propType = getTypeOfSymbol(prop); + propTypes.push(prop.flags & 16777216 ? removeMissingOrUndefinedType(propType) : propType); + } + } + for (const info2 of getIndexInfosOfType(source)) { + if (isApplicableIndexType(info2.keyType, targetInfo.keyType)) { + propTypes.push(info2.type); + } + } + if (propTypes.length) { + inferWithPriority(getUnionType(propTypes), targetInfo.type, priority2); + } + } + } + for (const targetInfo of indexInfos) { + const sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType); + if (sourceInfo) { + inferWithPriority(sourceInfo.type, targetInfo.type, priority2); + } + } + } + } + function isTypeOrBaseIdenticalTo(s7, t8) { + return t8 === missingType ? s7 === t8 : isTypeIdenticalTo(s7, t8) || !!(t8.flags & 4 && s7.flags & 128 || t8.flags & 8 && s7.flags & 256); + } + function isTypeCloselyMatchedBy(s7, t8) { + return !!(s7.flags & 524288 && t8.flags & 524288 && s7.symbol && s7.symbol === t8.symbol || s7.aliasSymbol && s7.aliasTypeArguments && s7.aliasSymbol === t8.aliasSymbol); + } + function hasPrimitiveConstraint(type3) { + const constraint = getConstraintOfTypeParameter(type3); + return !!constraint && maybeTypeOfKind( + constraint.flags & 16777216 ? getDefaultConstraintOfConditionalType(constraint) : constraint, + 402784252 | 4194304 | 134217728 | 268435456 + /* StringMapping */ + ); + } + function isObjectLiteralType2(type3) { + return !!(getObjectFlags(type3) & 128); + } + function isObjectOrArrayLiteralType(type3) { + return !!(getObjectFlags(type3) & (128 | 16384)); + } + function unionObjectAndArrayLiteralCandidates(candidates) { + if (candidates.length > 1) { + const objectLiterals = filter2(candidates, isObjectOrArrayLiteralType); + if (objectLiterals.length) { + const literalsType = getUnionType( + objectLiterals, + 2 + /* Subtype */ + ); + return concatenate(filter2(candidates, (t8) => !isObjectOrArrayLiteralType(t8)), [literalsType]); + } + } + return candidates; + } + function getContravariantInference(inference) { + return inference.priority & 416 ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); + } + function getCovariantInference(inference, signature) { + const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates); + const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter); + const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter)); + const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; + const unwidenedType = inference.priority & 416 ? getUnionType( + baseCandidates, + 2 + /* Subtype */ + ) : getCommonSupertype(baseCandidates); + return getWidenedType(unwidenedType); + } + function getInferredType(context2, index4) { + const inference = context2.inferences[index4]; + if (!inference.inferredType) { + let inferredType; + let fallbackType; + if (context2.signature) { + const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context2.signature) : void 0; + const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0; + if (inferredCovariantType || inferredContravariantType) { + const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072) && some2(inference.contraCandidates, (t8) => isTypeSubtypeOf(inferredCovariantType, t8)) && every2(context2.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every2(other.candidates, (t8) => isTypeSubtypeOf(t8, inferredCovariantType)))); + inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType; + fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType; + } else if (context2.flags & 1) { + inferredType = silentNeverType; + } else { + const defaultType = getDefaultFromTypeParameter(inference.typeParameter); + if (defaultType) { + inferredType = instantiateType(defaultType, mergeTypeMappers(createBackreferenceMapper(context2, index4), context2.nonFixingMapper)); + } + } + } else { + inferredType = getTypeFromInference(inference); + } + inference.inferredType = inferredType || getDefaultTypeArgumentType(!!(context2.flags & 2)); + const constraint = getConstraintOfTypeParameter(inference.typeParameter); + if (constraint) { + const instantiatedConstraint = instantiateType(constraint, context2.nonFixingMapper); + if (!inferredType || !context2.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + inference.inferredType = fallbackType && context2.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint; + } + } + } + return inference.inferredType; + } + function getDefaultTypeArgumentType(isInJavaScriptFile) { + return isInJavaScriptFile ? anyType2 : unknownType2; + } + function getInferredTypes(context2) { + const result2 = []; + for (let i7 = 0; i7 < context2.inferences.length; i7++) { + result2.push(getInferredType(context2, i7)); + } + return result2; + } + function getCannotFindNameDiagnosticForName(node) { + switch (node.escapedText) { + case "document": + case "console": + return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom; + case "$": + return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery; + case "describe": + case "suite": + case "it": + case "test": + return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha; + case "process": + case "require": + case "Buffer": + case "module": + return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode; + case "Bun": + return compilerOptions.types ? Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun_and_then_add_bun_to_the_types_field_in_your_tsconfig : Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_Bun_Try_npm_i_save_dev_types_Slashbun; + case "Map": + case "Set": + case "Promise": + case "Symbol": + case "WeakMap": + case "WeakSet": + case "Iterator": + case "AsyncIterator": + case "SharedArrayBuffer": + case "Atomics": + case "AsyncIterable": + case "AsyncIterableIterator": + case "AsyncGenerator": + case "AsyncGeneratorFunction": + case "BigInt": + case "Reflect": + case "BigInt64Array": + case "BigUint64Array": + return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later; + case "await": + if (isCallExpression(node.parent)) { + return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function; + } + default: + if (node.parent.kind === 304) { + return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer; + } else { + return Diagnostics.Cannot_find_name_0; + } + } + } + function getResolvedSymbol(node) { + const links = getNodeLinks(node); + if (!links.resolvedSymbol) { + links.resolvedSymbol = !nodeIsMissing(node) && resolveName( + node, + node.escapedText, + 111551 | 1048576, + getCannotFindNameDiagnosticForName(node), + node, + !isWriteOnlyAccess(node), + /*excludeGlobals*/ + false + ) || unknownSymbol; + } + return links.resolvedSymbol; + } + function isInAmbientOrTypeNode(node) { + return !!(node.flags & 33554432 || findAncestor(node, (n7) => isInterfaceDeclaration(n7) || isTypeAliasDeclaration(n7) || isTypeLiteralNode(n7))); + } + function getFlowCacheKey(node, declaredType, initialType, flowContainer) { + switch (node.kind) { + case 80: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return symbol !== unknownSymbol ? `${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}|${getSymbolId(symbol)}` : void 0; + } + case 110: + return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`; + case 235: + case 217: + return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + case 166: + const left = getFlowCacheKey(node.left, declaredType, initialType, flowContainer); + return left && left + "." + node.right.escapedText; + case 211: + case 212: + const propName2 = getAccessedPropertyName(node); + if (propName2 !== void 0) { + const key = getFlowCacheKey(node.expression, declaredType, initialType, flowContainer); + return key && key + "." + propName2; + } + break; + case 206: + case 207: + case 262: + case 218: + case 219: + case 174: + return `${getNodeId(node)}#${getTypeId(declaredType)}`; + } + return void 0; + } + function isMatchingReference(source, target) { + switch (target.kind) { + case 217: + case 235: + return isMatchingReference(source, target.expression); + case 226: + return isAssignmentExpression(target) && isMatchingReference(source, target.left) || isBinaryExpression(target) && target.operatorToken.kind === 28 && isMatchingReference(source, target.right); + } + switch (source.kind) { + case 236: + return target.kind === 236 && source.keywordToken === target.keywordToken && source.name.escapedText === target.name.escapedText; + case 80: + case 81: + return isThisInTypeQuery(source) ? target.kind === 110 : target.kind === 80 && getResolvedSymbol(source) === getResolvedSymbol(target) || (isVariableDeclaration(target) || isBindingElement(target)) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfDeclaration(target); + case 110: + return target.kind === 110; + case 108: + return target.kind === 108; + case 235: + case 217: + return isMatchingReference(source.expression, target); + case 211: + case 212: + const sourcePropertyName = getAccessedPropertyName(source); + const targetPropertyName = isAccessExpression(target) ? getAccessedPropertyName(target) : void 0; + return sourcePropertyName !== void 0 && targetPropertyName !== void 0 && targetPropertyName === sourcePropertyName && isMatchingReference(source.expression, target.expression); + case 166: + return isAccessExpression(target) && source.right.escapedText === getAccessedPropertyName(target) && isMatchingReference(source.left, target.expression); + case 226: + return isBinaryExpression(source) && source.operatorToken.kind === 28 && isMatchingReference(source.right, target); + } + return false; + } + function getAccessedPropertyName(access2) { + if (isPropertyAccessExpression(access2)) { + return access2.name.escapedText; + } + if (isElementAccessExpression(access2)) { + return tryGetElementAccessExpressionName(access2); + } + if (isBindingElement(access2)) { + const name2 = getDestructuringPropertyName(access2); + return name2 ? escapeLeadingUnderscores(name2) : void 0; + } + if (isParameter(access2)) { + return "" + access2.parent.parameters.indexOf(access2); + } + return void 0; + } + function tryGetNameFromType(type3) { + return type3.flags & 8192 ? type3.escapedName : type3.flags & 384 ? escapeLeadingUnderscores("" + type3.value) : void 0; + } + function tryGetElementAccessExpressionName(node) { + return isStringOrNumericLiteralLike(node.argumentExpression) ? escapeLeadingUnderscores(node.argumentExpression.text) : isEntityNameExpression(node.argumentExpression) ? tryGetNameFromEntityNameExpression(node.argumentExpression) : void 0; + } + function tryGetNameFromEntityNameExpression(node) { + const symbol = resolveEntityName( + node, + 111551, + /*ignoreErrors*/ + true + ); + if (!symbol || !(isConstantVariable(symbol) || symbol.flags & 8)) + return void 0; + const declaration = symbol.valueDeclaration; + if (declaration === void 0) + return void 0; + const type3 = tryGetTypeFromEffectiveTypeNode(declaration); + if (type3) { + const name2 = tryGetNameFromType(type3); + if (name2 !== void 0) { + return name2; + } + } + if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) { + const initializer = getEffectiveInitializer(declaration); + if (initializer) { + const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer); + return initializerType && tryGetNameFromType(initializerType); + } + if (isEnumMember(declaration)) { + return getTextOfPropertyName(declaration.name); + } + } + return void 0; + } + function containsMatchingReference(source, target) { + while (isAccessExpression(source)) { + source = source.expression; + if (isMatchingReference(source, target)) { + return true; + } + } + return false; + } + function optionalChainContainsReference(source, target) { + while (isOptionalChain(source)) { + source = source.expression; + if (isMatchingReference(source, target)) { + return true; + } + } + return false; + } + function isDiscriminantProperty(type3, name2) { + if (type3 && type3.flags & 1048576) { + const prop = getUnionOrIntersectionProperty(type3, name2); + if (prop && getCheckFlags(prop) & 2) { + if (prop.links.isDiscriminantProperty === void 0) { + prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192) === 192 && !isGenericType(getTypeOfSymbol(prop)); + } + return !!prop.links.isDiscriminantProperty; + } + } + return false; + } + function findDiscriminantProperties(sourceProperties, target) { + let result2; + for (const sourceProperty of sourceProperties) { + if (isDiscriminantProperty(target, sourceProperty.escapedName)) { + if (result2) { + result2.push(sourceProperty); + continue; + } + result2 = [sourceProperty]; + } + } + return result2; + } + function mapTypesByKeyProperty(types3, name2) { + const map22 = /* @__PURE__ */ new Map(); + let count2 = 0; + for (const type3 of types3) { + if (type3.flags & (524288 | 2097152 | 58982400)) { + const discriminant = getTypeOfPropertyOfType(type3, name2); + if (discriminant) { + if (!isLiteralType(discriminant)) { + return void 0; + } + let duplicate = false; + forEachType(discriminant, (t8) => { + const id = getTypeId(getRegularTypeOfLiteralType(t8)); + const existing = map22.get(id); + if (!existing) { + map22.set(id, type3); + } else if (existing !== unknownType2) { + map22.set(id, unknownType2); + duplicate = true; + } + }); + if (!duplicate) + count2++; + } + } + } + return count2 >= 10 && count2 * 2 >= types3.length ? map22 : void 0; + } + function getKeyPropertyName(unionType2) { + const types3 = unionType2.types; + if (types3.length < 10 || getObjectFlags(unionType2) & 32768 || countWhere(types3, (t8) => !!(t8.flags & (524288 | 58982400))) < 10) { + return void 0; + } + if (unionType2.keyPropertyName === void 0) { + const keyPropertyName = forEach4(types3, (t8) => t8.flags & (524288 | 58982400) ? forEach4(getPropertiesOfType(t8), (p7) => isUnitType(getTypeOfSymbol(p7)) ? p7.escapedName : void 0) : void 0); + const mapByKeyProperty = keyPropertyName && mapTypesByKeyProperty(types3, keyPropertyName); + unionType2.keyPropertyName = mapByKeyProperty ? keyPropertyName : ""; + unionType2.constituentMap = mapByKeyProperty; + } + return unionType2.keyPropertyName.length ? unionType2.keyPropertyName : void 0; + } + function getConstituentTypeForKeyType(unionType2, keyType) { + var _a2; + const result2 = (_a2 = unionType2.constituentMap) == null ? void 0 : _a2.get(getTypeId(getRegularTypeOfLiteralType(keyType))); + return result2 !== unknownType2 ? result2 : void 0; + } + function getMatchingUnionConstituentForType(unionType2, type3) { + const keyPropertyName = getKeyPropertyName(unionType2); + const propType = keyPropertyName && getTypeOfPropertyOfType(type3, keyPropertyName); + return propType && getConstituentTypeForKeyType(unionType2, propType); + } + function getMatchingUnionConstituentForObjectLiteral(unionType2, node) { + const keyPropertyName = getKeyPropertyName(unionType2); + const propNode = keyPropertyName && find2(node.properties, (p7) => p7.symbol && p7.kind === 303 && p7.symbol.escapedName === keyPropertyName && isPossiblyDiscriminantValue(p7.initializer)); + const propType = propNode && getContextFreeTypeOfExpression(propNode.initializer); + return propType && getConstituentTypeForKeyType(unionType2, propType); + } + function isOrContainsMatchingReference(source, target) { + return isMatchingReference(source, target) || containsMatchingReference(source, target); + } + function hasMatchingArgument(expression, reference) { + if (expression.arguments) { + for (const argument of expression.arguments) { + if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) { + return true; + } + } + } + if (expression.expression.kind === 211 && isOrContainsMatchingReference(reference, expression.expression.expression)) { + return true; + } + return false; + } + function getFlowNodeId(flow2) { + if (!flow2.id || flow2.id < 0) { + flow2.id = nextFlowId; + nextFlowId++; + } + return flow2.id; + } + function typeMaybeAssignableTo(source, target) { + if (!(source.flags & 1048576)) { + return isTypeAssignableTo(source, target); + } + for (const t8 of source.types) { + if (isTypeAssignableTo(t8, target)) { + return true; + } + } + return false; + } + function getAssignmentReducedType(declaredType, assignedType) { + if (declaredType === assignedType) { + return declaredType; + } + if (assignedType.flags & 131072) { + return assignedType; + } + const key = `A${getTypeId(declaredType)},${getTypeId(assignedType)}`; + return getCachedType(key) ?? setCachedType(key, getAssignmentReducedTypeWorker(declaredType, assignedType)); + } + function getAssignmentReducedTypeWorker(declaredType, assignedType) { + const filteredType = filterType(declaredType, (t8) => typeMaybeAssignableTo(assignedType, t8)); + const reducedType = assignedType.flags & 512 && isFreshLiteralType(assignedType) ? mapType2(filteredType, getFreshTypeOfLiteralType) : filteredType; + return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType; + } + function isFunctionObjectType(type3) { + const resolved = resolveStructuredTypeMembers(type3); + return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type3, globalFunctionType)); + } + function getTypeFacts(type3, mask2) { + return getTypeFactsWorker(type3, mask2) & mask2; + } + function hasTypeFacts(type3, mask2) { + return getTypeFacts(type3, mask2) !== 0; + } + function getTypeFactsWorker(type3, callerOnlyNeeds) { + if (type3.flags & (2097152 | 465829888)) { + type3 = getBaseConstraintOfType(type3) || unknownType2; + } + const flags = type3.flags; + if (flags & (4 | 268435456)) { + return strictNullChecks ? 16317953 : 16776705; + } + if (flags & (128 | 134217728)) { + const isEmpty4 = flags & 128 && type3.value === ""; + return strictNullChecks ? isEmpty4 ? 12123649 : 7929345 : isEmpty4 ? 12582401 : 16776705; + } + if (flags & (8 | 32)) { + return strictNullChecks ? 16317698 : 16776450; + } + if (flags & 256) { + const isZero = type3.value === 0; + return strictNullChecks ? isZero ? 12123394 : 7929090 : isZero ? 12582146 : 16776450; + } + if (flags & 64) { + return strictNullChecks ? 16317188 : 16775940; + } + if (flags & 2048) { + const isZero = isZeroBigInt(type3); + return strictNullChecks ? isZero ? 12122884 : 7928580 : isZero ? 12581636 : 16775940; + } + if (flags & 16) { + return strictNullChecks ? 16316168 : 16774920; + } + if (flags & 528) { + return strictNullChecks ? type3 === falseType || type3 === regularFalseType ? 12121864 : 7927560 : type3 === falseType || type3 === regularFalseType ? 12580616 : 16774920; + } + if (flags & 524288) { + const possibleFacts = strictNullChecks ? 83427327 | 7880640 | 7888800 : 83886079 | 16728e3 | 16736160; + if ((callerOnlyNeeds & possibleFacts) === 0) { + return 0; + } + return getObjectFlags(type3) & 16 && isEmptyObjectType(type3) ? strictNullChecks ? 83427327 : 83886079 : isFunctionObjectType(type3) ? strictNullChecks ? 7880640 : 16728e3 : strictNullChecks ? 7888800 : 16736160; + } + if (flags & 16384) { + return 9830144; + } + if (flags & 32768) { + return 26607360; + } + if (flags & 65536) { + return 42917664; + } + if (flags & 12288) { + return strictNullChecks ? 7925520 : 16772880; + } + if (flags & 67108864) { + return strictNullChecks ? 7888800 : 16736160; + } + if (flags & 131072) { + return 0; + } + if (flags & 1048576) { + return reduceLeft( + type3.types, + (facts, t8) => facts | getTypeFactsWorker(t8, callerOnlyNeeds), + 0 + /* None */ + ); + } + if (flags & 2097152) { + return getIntersectionTypeFacts(type3, callerOnlyNeeds); + } + return 83886079; + } + function getIntersectionTypeFacts(type3, callerOnlyNeeds) { + const ignoreObjects = maybeTypeOfKind( + type3, + 402784252 + /* Primitive */ + ); + let oredFacts = 0; + let andedFacts = 134217727; + for (const t8 of type3.types) { + if (!(ignoreObjects && t8.flags & 524288)) { + const f8 = getTypeFactsWorker(t8, callerOnlyNeeds); + oredFacts |= f8; + andedFacts &= f8; + } + } + return oredFacts & 8256 | andedFacts & 134209471; + } + function getTypeWithFacts(type3, include) { + return filterType(type3, (t8) => hasTypeFacts(t8, include)); + } + function getAdjustedTypeWithFacts(type3, facts) { + const reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type3.flags & 2 ? unknownUnionType : type3, facts)); + if (strictNullChecks) { + switch (facts) { + case 524288: + return mapType2(reduced, (t8) => hasTypeFacts( + t8, + 65536 + /* EQUndefined */ + ) ? getIntersectionType([t8, hasTypeFacts( + t8, + 131072 + /* EQNull */ + ) && !maybeTypeOfKind( + reduced, + 65536 + /* Null */ + ) ? getUnionType([emptyObjectType, nullType2]) : emptyObjectType]) : t8); + case 1048576: + return mapType2(reduced, (t8) => hasTypeFacts( + t8, + 131072 + /* EQNull */ + ) ? getIntersectionType([t8, hasTypeFacts( + t8, + 65536 + /* EQUndefined */ + ) && !maybeTypeOfKind( + reduced, + 32768 + /* Undefined */ + ) ? getUnionType([emptyObjectType, undefinedType2]) : emptyObjectType]) : t8); + case 2097152: + case 4194304: + return mapType2(reduced, (t8) => hasTypeFacts( + t8, + 262144 + /* EQUndefinedOrNull */ + ) ? getGlobalNonNullableTypeInstantiation(t8) : t8); + } + } + return reduced; + } + function recombineUnknownType(type3) { + return type3 === unknownUnionType ? unknownType2 : type3; + } + function getTypeWithDefault(type3, defaultExpression) { + return defaultExpression ? getUnionType([getNonUndefinedType(type3), getTypeOfExpression(defaultExpression)]) : type3; + } + function getTypeOfDestructuredProperty(type3, name2) { + var _a2; + const nameType = getLiteralTypeFromPropertyName(name2); + if (!isTypeUsableAsPropertyName(nameType)) + return errorType; + const text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(type3, text) || includeUndefinedInIndexSignature((_a2 = getApplicableIndexInfoForName(type3, text)) == null ? void 0 : _a2.type) || errorType; + } + function getTypeOfDestructuredArrayElement(type3, index4) { + return everyType(type3, isTupleLikeType) && getTupleElementType(type3, index4) || includeUndefinedInIndexSignature(checkIteratedTypeOrElementType( + 65, + type3, + undefinedType2, + /*errorNode*/ + void 0 + )) || errorType; + } + function includeUndefinedInIndexSignature(type3) { + if (!type3) + return type3; + return compilerOptions.noUncheckedIndexedAccess ? getUnionType([type3, missingType]) : type3; + } + function getTypeOfDestructuredSpreadExpression(type3) { + return createArrayType(checkIteratedTypeOrElementType( + 65, + type3, + undefinedType2, + /*errorNode*/ + void 0 + ) || errorType); + } + function getAssignedTypeOfBinaryExpression(node) { + const isDestructuringDefaultAssignment = node.parent.kind === 209 && isDestructuringAssignmentTarget(node.parent) || node.parent.kind === 303 && isDestructuringAssignmentTarget(node.parent.parent); + return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); + } + function isDestructuringAssignmentTarget(parent22) { + return parent22.parent.kind === 226 && parent22.parent.left === parent22 || parent22.parent.kind === 250 && parent22.parent.initializer === parent22; + } + function getAssignedTypeOfArrayLiteralElement(node, element) { + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); + } + function getAssignedTypeOfSpreadExpression(node) { + return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); + } + function getAssignedTypeOfPropertyAssignment(node) { + return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name); + } + function getAssignedTypeOfShorthandPropertyAssignment(node) { + return getTypeWithDefault(getAssignedTypeOfPropertyAssignment(node), node.objectAssignmentInitializer); + } + function getAssignedType(node) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 249: + return stringType2; + case 250: + return checkRightHandSideOfForOf(parent22) || errorType; + case 226: + return getAssignedTypeOfBinaryExpression(parent22); + case 220: + return undefinedType2; + case 209: + return getAssignedTypeOfArrayLiteralElement(parent22, node); + case 230: + return getAssignedTypeOfSpreadExpression(parent22); + case 303: + return getAssignedTypeOfPropertyAssignment(parent22); + case 304: + return getAssignedTypeOfShorthandPropertyAssignment(parent22); + } + return errorType; + } + function getInitialTypeOfBindingElement(node) { + const pattern5 = node.parent; + const parentType = getInitialType(pattern5.parent); + const type3 = pattern5.kind === 206 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern5.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); + return getTypeWithDefault(type3, node.initializer); + } + function getTypeOfInitializer(node) { + const links = getNodeLinks(node); + return links.resolvedType || getTypeOfExpression(node); + } + function getInitialTypeOfVariableDeclaration(node) { + if (node.initializer) { + return getTypeOfInitializer(node.initializer); + } + if (node.parent.parent.kind === 249) { + return stringType2; + } + if (node.parent.parent.kind === 250) { + return checkRightHandSideOfForOf(node.parent.parent) || errorType; + } + return errorType; + } + function getInitialType(node) { + return node.kind === 260 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); + } + function isEmptyArrayAssignment(node) { + return node.kind === 260 && node.initializer && isEmptyArrayLiteral2(node.initializer) || node.kind !== 208 && node.parent.kind === 226 && isEmptyArrayLiteral2(node.parent.right); + } + function getReferenceCandidate(node) { + switch (node.kind) { + case 217: + return getReferenceCandidate(node.expression); + case 226: + switch (node.operatorToken.kind) { + case 64: + case 76: + case 77: + case 78: + return getReferenceCandidate(node.left); + case 28: + return getReferenceCandidate(node.right); + } + } + return node; + } + function getReferenceRoot(node) { + const { parent: parent22 } = node; + return parent22.kind === 217 || parent22.kind === 226 && parent22.operatorToken.kind === 64 && parent22.left === node || parent22.kind === 226 && parent22.operatorToken.kind === 28 && parent22.right === node ? getReferenceRoot(parent22) : node; + } + function getTypeOfSwitchClause(clause) { + if (clause.kind === 296) { + return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); + } + return neverType2; + } + function getSwitchClauseTypes(switchStatement) { + const links = getNodeLinks(switchStatement); + if (!links.switchTypes) { + links.switchTypes = []; + for (const clause of switchStatement.caseBlock.clauses) { + links.switchTypes.push(getTypeOfSwitchClause(clause)); + } + } + return links.switchTypes; + } + function getSwitchClauseTypeOfWitnesses(switchStatement) { + if (some2(switchStatement.caseBlock.clauses, (clause) => clause.kind === 296 && !isStringLiteralLike(clause.expression))) { + return void 0; + } + const witnesses = []; + for (const clause of switchStatement.caseBlock.clauses) { + const text = clause.kind === 296 ? clause.expression.text : void 0; + witnesses.push(text && !contains2(witnesses, text) ? text : void 0); + } + return witnesses; + } + function eachTypeContainedIn(source, types3) { + return source.flags & 1048576 ? !forEach4(source.types, (t8) => !contains2(types3, t8)) : contains2(types3, source); + } + function isTypeSubsetOf(source, target) { + return !!(source === target || source.flags & 131072 || target.flags & 1048576 && isTypeSubsetOfUnion(source, target)); + } + function isTypeSubsetOfUnion(source, target) { + if (source.flags & 1048576) { + for (const t8 of source.types) { + if (!containsType(target.types, t8)) { + return false; + } + } + return true; + } + if (source.flags & 1056 && getBaseTypeOfEnumLikeType(source) === target) { + return true; + } + return containsType(target.types, source); + } + function forEachType(type3, f8) { + return type3.flags & 1048576 ? forEach4(type3.types, f8) : f8(type3); + } + function someType(type3, f8) { + return type3.flags & 1048576 ? some2(type3.types, f8) : f8(type3); + } + function everyType(type3, f8) { + return type3.flags & 1048576 ? every2(type3.types, f8) : f8(type3); + } + function everyContainedType(type3, f8) { + return type3.flags & 3145728 ? every2(type3.types, f8) : f8(type3); + } + function filterType(type3, f8) { + if (type3.flags & 1048576) { + const types3 = type3.types; + const filtered = filter2(types3, f8); + if (filtered === types3) { + return type3; + } + const origin = type3.origin; + let newOrigin; + if (origin && origin.flags & 1048576) { + const originTypes = origin.types; + const originFiltered = filter2(originTypes, (t8) => !!(t8.flags & 1048576) || f8(t8)); + if (originTypes.length - originFiltered.length === types3.length - filtered.length) { + if (originFiltered.length === 1) { + return originFiltered[0]; + } + newOrigin = createOriginUnionOrIntersectionType(1048576, originFiltered); + } + } + return getUnionTypeFromSortedList( + filtered, + type3.objectFlags & (32768 | 16777216), + /*aliasSymbol*/ + void 0, + /*aliasTypeArguments*/ + void 0, + newOrigin + ); + } + return type3.flags & 131072 || f8(type3) ? type3 : neverType2; + } + function removeType(type3, targetType) { + return filterType(type3, (t8) => t8 !== targetType); + } + function countTypes(type3) { + return type3.flags & 1048576 ? type3.types.length : 1; + } + function mapType2(type3, mapper, noReductions) { + if (type3.flags & 131072) { + return type3; + } + if (!(type3.flags & 1048576)) { + return mapper(type3); + } + const origin = type3.origin; + const types3 = origin && origin.flags & 1048576 ? origin.types : type3.types; + let mappedTypes; + let changed = false; + for (const t8 of types3) { + const mapped = t8.flags & 1048576 ? mapType2(t8, mapper, noReductions) : mapper(t8); + changed || (changed = t8 !== mapped); + if (mapped) { + if (!mappedTypes) { + mappedTypes = [mapped]; + } else { + mappedTypes.push(mapped); + } + } + } + return changed ? mappedTypes && getUnionType( + mappedTypes, + noReductions ? 0 : 1 + /* Literal */ + ) : type3; + } + function mapTypeWithAlias(type3, mapper, aliasSymbol, aliasTypeArguments) { + return type3.flags & 1048576 && aliasSymbol ? getUnionType(map4(type3.types, mapper), 1, aliasSymbol, aliasTypeArguments) : mapType2(type3, mapper); + } + function extractTypesOfKind(type3, kind) { + return filterType(type3, (t8) => (t8.flags & kind) !== 0); + } + function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) { + if (maybeTypeOfKind( + typeWithPrimitives, + 4 | 134217728 | 8 | 64 + /* BigInt */ + ) && maybeTypeOfKind( + typeWithLiterals, + 128 | 134217728 | 268435456 | 256 | 2048 + /* BigIntLiteral */ + )) { + return mapType2(typeWithPrimitives, (t8) => t8.flags & 4 ? extractTypesOfKind( + typeWithLiterals, + 4 | 128 | 134217728 | 268435456 + /* StringMapping */ + ) : isPatternLiteralType(t8) && !maybeTypeOfKind( + typeWithLiterals, + 4 | 134217728 | 268435456 + /* StringMapping */ + ) ? extractTypesOfKind( + typeWithLiterals, + 128 + /* StringLiteral */ + ) : t8.flags & 8 ? extractTypesOfKind( + typeWithLiterals, + 8 | 256 + /* NumberLiteral */ + ) : t8.flags & 64 ? extractTypesOfKind( + typeWithLiterals, + 64 | 2048 + /* BigIntLiteral */ + ) : t8); + } + return typeWithPrimitives; + } + function isIncomplete(flowType) { + return flowType.flags === 0; + } + function getTypeFromFlowType(flowType) { + return flowType.flags === 0 ? flowType.type : flowType; + } + function createFlowType(type3, incomplete) { + return incomplete ? { flags: 0, type: type3.flags & 131072 ? silentNeverType : type3 } : type3; + } + function createEvolvingArrayType(elementType) { + const result2 = createObjectType( + 256 + /* EvolvingArray */ + ); + result2.elementType = elementType; + return result2; + } + function getEvolvingArrayType(elementType) { + return evolvingArrayTypes[elementType.id] || (evolvingArrayTypes[elementType.id] = createEvolvingArrayType(elementType)); + } + function addEvolvingArrayElementType(evolvingArrayType, node) { + const elementType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node))); + return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType])); + } + function createFinalArrayType(elementType) { + return elementType.flags & 131072 ? autoArrayType : createArrayType( + elementType.flags & 1048576 ? getUnionType( + elementType.types, + 2 + /* Subtype */ + ) : elementType + ); + } + function getFinalArrayType(evolvingArrayType) { + return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType)); + } + function finalizeEvolvingArrayType(type3) { + return getObjectFlags(type3) & 256 ? getFinalArrayType(type3) : type3; + } + function getElementTypeOfEvolvingArrayType(type3) { + return getObjectFlags(type3) & 256 ? type3.elementType : neverType2; + } + function isEvolvingArrayTypeList(types3) { + let hasEvolvingArrayType = false; + for (const t8 of types3) { + if (!(t8.flags & 131072)) { + if (!(getObjectFlags(t8) & 256)) { + return false; + } + hasEvolvingArrayType = true; + } + } + return hasEvolvingArrayType; + } + function isEvolvingArrayOperationTarget(node) { + const root2 = getReferenceRoot(node); + const parent22 = root2.parent; + const isLengthPushOrUnshift = isPropertyAccessExpression(parent22) && (parent22.name.escapedText === "length" || parent22.parent.kind === 213 && isIdentifier(parent22.name) && isPushOrUnshiftIdentifier(parent22.name)); + const isElementAssignment = parent22.kind === 212 && parent22.expression === root2 && parent22.parent.kind === 226 && parent22.parent.operatorToken.kind === 64 && parent22.parent.left === parent22 && !isAssignmentTarget(parent22.parent) && isTypeAssignableToKind( + getTypeOfExpression(parent22.argumentExpression), + 296 + /* NumberLike */ + ); + return isLengthPushOrUnshift || isElementAssignment; + } + function isDeclarationWithExplicitTypeAnnotation(node) { + return (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isParameter(node)) && !!(getEffectiveTypeAnnotationNode(node) || isInJSFile(node) && hasInitializer(node) && node.initializer && isFunctionExpressionOrArrowFunction(node.initializer) && getEffectiveReturnTypeNode(node.initializer)); + } + function getExplicitTypeOfSymbol(symbol, diagnostic) { + symbol = resolveSymbol(symbol); + if (symbol.flags & (16 | 8192 | 32 | 512)) { + return getTypeOfSymbol(symbol); + } + if (symbol.flags & (3 | 4)) { + if (getCheckFlags(symbol) & 262144) { + const origin = symbol.links.syntheticOrigin; + if (origin && getExplicitTypeOfSymbol(origin)) { + return getTypeOfSymbol(symbol); + } + } + const declaration = symbol.valueDeclaration; + if (declaration) { + if (isDeclarationWithExplicitTypeAnnotation(declaration)) { + return getTypeOfSymbol(symbol); + } + if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === 250) { + const statement = declaration.parent.parent; + const expressionType = getTypeOfDottedName( + statement.expression, + /*diagnostic*/ + void 0 + ); + if (expressionType) { + const use = statement.awaitModifier ? 15 : 13; + return checkIteratedTypeOrElementType( + use, + expressionType, + undefinedType2, + /*errorNode*/ + void 0 + ); + } + } + if (diagnostic) { + addRelatedInfo(diagnostic, createDiagnosticForNode(declaration, Diagnostics._0_needs_an_explicit_type_annotation, symbolToString2(symbol))); + } + } + } + } + function getTypeOfDottedName(node, diagnostic) { + if (!(node.flags & 67108864)) { + switch (node.kind) { + case 80: + const symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node)); + return getExplicitTypeOfSymbol(symbol, diagnostic); + case 110: + return getExplicitThisType(node); + case 108: + return checkSuperExpression(node); + case 211: { + const type3 = getTypeOfDottedName(node.expression, diagnostic); + if (type3) { + const name2 = node.name; + let prop; + if (isPrivateIdentifier(name2)) { + if (!type3.symbol) { + return void 0; + } + prop = getPropertyOfType(type3, getSymbolNameForPrivateIdentifier(type3.symbol, name2.escapedText)); + } else { + prop = getPropertyOfType(type3, name2.escapedText); + } + return prop && getExplicitTypeOfSymbol(prop, diagnostic); + } + return void 0; + } + case 217: + return getTypeOfDottedName(node.expression, diagnostic); + } + } + } + function getEffectsSignature(node) { + const links = getNodeLinks(node); + let signature = links.effectsSignature; + if (signature === void 0) { + let funcType; + if (isBinaryExpression(node)) { + const rightType = checkNonNullExpression(node.right); + funcType = getSymbolHasInstanceMethodOfObjectType(rightType); + } else if (node.parent.kind === 244) { + funcType = getTypeOfDottedName( + node.expression, + /*diagnostic*/ + void 0 + ); + } else if (node.expression.kind !== 108) { + if (isOptionalChain(node)) { + funcType = checkNonNullType( + getOptionalExpressionType(checkExpression(node.expression), node.expression), + node.expression + ); + } else { + funcType = checkNonNullExpression(node.expression); + } + } + const signatures = getSignaturesOfType( + funcType && getApparentType(funcType) || unknownType2, + 0 + /* Call */ + ); + const candidate = signatures.length === 1 && !signatures[0].typeParameters ? signatures[0] : some2(signatures, hasTypePredicateOrNeverReturnType) ? getResolvedSignature(node) : void 0; + signature = links.effectsSignature = candidate && hasTypePredicateOrNeverReturnType(candidate) ? candidate : unknownSignature; + } + return signature === unknownSignature ? void 0 : signature; + } + function hasTypePredicateOrNeverReturnType(signature) { + return !!(getTypePredicateOfSignature(signature) || signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType2).flags & 131072); + } + function getTypePredicateArgument(predicate, callExpression) { + if (predicate.kind === 1 || predicate.kind === 3) { + return callExpression.arguments[predicate.parameterIndex]; + } + const invokedExpression = skipParentheses(callExpression.expression); + return isAccessExpression(invokedExpression) ? skipParentheses(invokedExpression.expression) : void 0; + } + function reportFlowControlError(node) { + const block = findAncestor(node, isFunctionOrModuleBlock); + const sourceFile = getSourceFileOfNode(node); + const span = getSpanOfTokenAtPosition(sourceFile, block.statements.pos); + diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)); + } + function isReachableFlowNode(flow2) { + const result2 = isReachableFlowNodeWorker( + flow2, + /*noCacheCheck*/ + false + ); + lastFlowNode = flow2; + lastFlowNodeReachable = result2; + return result2; + } + function isFalseExpression(expr) { + const node = skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + return node.kind === 97 || node.kind === 226 && (node.operatorToken.kind === 56 && (isFalseExpression(node.left) || isFalseExpression(node.right)) || node.operatorToken.kind === 57 && isFalseExpression(node.left) && isFalseExpression(node.right)); + } + function isReachableFlowNodeWorker(flow2, noCacheCheck) { + while (true) { + if (flow2 === lastFlowNode) { + return lastFlowNodeReachable; + } + const flags = flow2.flags; + if (flags & 4096) { + if (!noCacheCheck) { + const id = getFlowNodeId(flow2); + const reachable = flowNodeReachable[id]; + return reachable !== void 0 ? reachable : flowNodeReachable[id] = isReachableFlowNodeWorker( + flow2, + /*noCacheCheck*/ + true + ); + } + noCacheCheck = false; + } + if (flags & (16 | 96 | 256)) { + flow2 = flow2.antecedent; + } else if (flags & 512) { + const signature = getEffectsSignature(flow2.node); + if (signature) { + const predicate = getTypePredicateOfSignature(signature); + if (predicate && predicate.kind === 3 && !predicate.type) { + const predicateArgument = flow2.node.arguments[predicate.parameterIndex]; + if (predicateArgument && isFalseExpression(predicateArgument)) { + return false; + } + } + if (getReturnTypeOfSignature(signature).flags & 131072) { + return false; + } + } + flow2 = flow2.antecedent; + } else if (flags & 4) { + return some2(flow2.antecedents, (f8) => isReachableFlowNodeWorker( + f8, + /*noCacheCheck*/ + false + )); + } else if (flags & 8) { + const antecedents = flow2.antecedents; + if (antecedents === void 0 || antecedents.length === 0) { + return false; + } + flow2 = antecedents[0]; + } else if (flags & 128) { + if (flow2.clauseStart === flow2.clauseEnd && isExhaustiveSwitchStatement(flow2.switchStatement)) { + return false; + } + flow2 = flow2.antecedent; + } else if (flags & 1024) { + lastFlowNode = void 0; + const target = flow2.target; + const saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + const result2 = isReachableFlowNodeWorker( + flow2.antecedent, + /*noCacheCheck*/ + false + ); + target.antecedents = saveAntecedents; + return result2; + } else { + return !(flags & 1); + } + } + } + function isPostSuperFlowNode(flow2, noCacheCheck) { + while (true) { + const flags = flow2.flags; + if (flags & 4096) { + if (!noCacheCheck) { + const id = getFlowNodeId(flow2); + const postSuper = flowNodePostSuper[id]; + return postSuper !== void 0 ? postSuper : flowNodePostSuper[id] = isPostSuperFlowNode( + flow2, + /*noCacheCheck*/ + true + ); + } + noCacheCheck = false; + } + if (flags & (16 | 96 | 256 | 128)) { + flow2 = flow2.antecedent; + } else if (flags & 512) { + if (flow2.node.expression.kind === 108) { + return true; + } + flow2 = flow2.antecedent; + } else if (flags & 4) { + return every2(flow2.antecedents, (f8) => isPostSuperFlowNode( + f8, + /*noCacheCheck*/ + false + )); + } else if (flags & 8) { + flow2 = flow2.antecedents[0]; + } else if (flags & 1024) { + const target = flow2.target; + const saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + const result2 = isPostSuperFlowNode( + flow2.antecedent, + /*noCacheCheck*/ + false + ); + target.antecedents = saveAntecedents; + return result2; + } else { + return !!(flags & 1); + } + } + } + function isConstantReference(node) { + switch (node.kind) { + case 110: + return true; + case 80: + if (!isThisInTypeQuery(node)) { + const symbol = getResolvedSymbol(node); + return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol); + } + break; + case 211: + case 212: + return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol); + case 206: + case 207: + const rootDeclaration = getRootDeclaration(node.parent); + return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration) ? !isSomeSymbolAssigned(rootDeclaration) : isVariableDeclaration(rootDeclaration) && isVarConstLike(rootDeclaration); + } + return false; + } + function getFlowTypeOfReference(reference, declaredType, initialType = declaredType, flowContainer, flowNode = ((_a2) => (_a2 = tryCast(reference, canHaveFlowNode)) == null ? void 0 : _a2.flowNode)()) { + let key; + let isKeySet = false; + let flowDepth = 0; + if (flowAnalysisDisabled) { + return errorType; + } + if (!flowNode) { + return declaredType; + } + flowInvocationCount++; + const sharedFlowStart = sharedFlowCount; + const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode)); + sharedFlowCount = sharedFlowStart; + const resultType = getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType); + if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 && !(resultType.flags & 131072) && getTypeWithFacts( + resultType, + 2097152 + /* NEUndefinedOrNull */ + ).flags & 131072) { + return declaredType; + } + return resultType === nonNullUnknownType ? unknownType2 : resultType; + function getOrSetCacheKey() { + if (isKeySet) { + return key; + } + isKeySet = true; + return key = getFlowCacheKey(reference, declaredType, initialType, flowContainer); + } + function getTypeAtFlowNode(flow2) { + var _a2; + if (flowDepth === 2e3) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.CheckTypes, "getTypeAtFlowNode_DepthLimit", { flowId: flow2.id }); + flowAnalysisDisabled = true; + reportFlowControlError(reference); + return errorType; + } + flowDepth++; + let sharedFlow; + while (true) { + const flags = flow2.flags; + if (flags & 4096) { + for (let i7 = sharedFlowStart; i7 < sharedFlowCount; i7++) { + if (sharedFlowNodes[i7] === flow2) { + flowDepth--; + return sharedFlowTypes[i7]; + } + } + sharedFlow = flow2; + } + let type3; + if (flags & 16) { + type3 = getTypeAtFlowAssignment(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 512) { + type3 = getTypeAtFlowCall(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 96) { + type3 = getTypeAtFlowCondition(flow2); + } else if (flags & 128) { + type3 = getTypeAtSwitchClause(flow2); + } else if (flags & 12) { + if (flow2.antecedents.length === 1) { + flow2 = flow2.antecedents[0]; + continue; + } + type3 = flags & 4 ? getTypeAtFlowBranchLabel(flow2) : getTypeAtFlowLoopLabel(flow2); + } else if (flags & 256) { + type3 = getTypeAtFlowArrayMutation(flow2); + if (!type3) { + flow2 = flow2.antecedent; + continue; + } + } else if (flags & 1024) { + const target = flow2.target; + const saveAntecedents = target.antecedents; + target.antecedents = flow2.antecedents; + type3 = getTypeAtFlowNode(flow2.antecedent); + target.antecedents = saveAntecedents; + } else if (flags & 2) { + const container = flow2.node; + if (container && container !== flowContainer && reference.kind !== 211 && reference.kind !== 212 && !(reference.kind === 110 && container.kind !== 219)) { + flow2 = container.flowNode; + continue; + } + type3 = initialType; + } else { + type3 = convertAutoToAny(declaredType); + } + if (sharedFlow) { + sharedFlowNodes[sharedFlowCount] = sharedFlow; + sharedFlowTypes[sharedFlowCount] = type3; + sharedFlowCount++; + } + flowDepth--; + return type3; + } + } + function getInitialOrAssignedType(flow2) { + const node = flow2.node; + return getNarrowableTypeForReference( + node.kind === 260 || node.kind === 208 ? getInitialType(node) : getAssignedType(node), + reference + ); + } + function getTypeAtFlowAssignment(flow2) { + const node = flow2.node; + if (isMatchingReference(reference, node)) { + if (!isReachableFlowNode(flow2)) { + return unreachableNeverType; + } + if (getAssignmentTargetKind(node) === 2) { + const flowType = getTypeAtFlowNode(flow2.antecedent); + return createFlowType(getBaseTypeOfLiteralType(getTypeFromFlowType(flowType)), isIncomplete(flowType)); + } + if (declaredType === autoType || declaredType === autoArrayType) { + if (isEmptyArrayAssignment(node)) { + return getEvolvingArrayType(neverType2); + } + const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow2)); + return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType; + } + const t8 = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType; + if (t8.flags & 1048576) { + return getAssignmentReducedType(t8, getInitialOrAssignedType(flow2)); + } + return t8; + } + if (containsMatchingReference(reference, node)) { + if (!isReachableFlowNode(flow2)) { + return unreachableNeverType; + } + if (isVariableDeclaration(node) && (isInJSFile(node) || isVarConstLike(node))) { + const init2 = getDeclaredExpandoInitializer(node); + if (init2 && (init2.kind === 218 || init2.kind === 219)) { + return getTypeAtFlowNode(flow2.antecedent); + } + } + return declaredType; + } + if (isVariableDeclaration(node) && node.parent.parent.kind === 249 && (isMatchingReference(reference, node.parent.parent.expression) || optionalChainContainsReference(node.parent.parent.expression, reference))) { + return getNonNullableTypeIfNeeded(finalizeEvolvingArrayType(getTypeFromFlowType(getTypeAtFlowNode(flow2.antecedent)))); + } + return void 0; + } + function narrowTypeByAssertion(type3, expr) { + const node = skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + if (node.kind === 97) { + return unreachableNeverType; + } + if (node.kind === 226) { + if (node.operatorToken.kind === 56) { + return narrowTypeByAssertion(narrowTypeByAssertion(type3, node.left), node.right); + } + if (node.operatorToken.kind === 57) { + return getUnionType([narrowTypeByAssertion(type3, node.left), narrowTypeByAssertion(type3, node.right)]); + } + } + return narrowType( + type3, + node, + /*assumeTrue*/ + true + ); + } + function getTypeAtFlowCall(flow2) { + const signature = getEffectsSignature(flow2.node); + if (signature) { + const predicate = getTypePredicateOfSignature(signature); + if (predicate && (predicate.kind === 2 || predicate.kind === 3)) { + const flowType = getTypeAtFlowNode(flow2.antecedent); + const type3 = finalizeEvolvingArrayType(getTypeFromFlowType(flowType)); + const narrowedType = predicate.type ? narrowTypeByTypePredicate( + type3, + predicate, + flow2.node, + /*assumeTrue*/ + true + ) : predicate.kind === 3 && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow2.node.arguments.length ? narrowTypeByAssertion(type3, flow2.node.arguments[predicate.parameterIndex]) : type3; + return narrowedType === type3 ? flowType : createFlowType(narrowedType, isIncomplete(flowType)); + } + if (getReturnTypeOfSignature(signature).flags & 131072) { + return unreachableNeverType; + } + } + return void 0; + } + function getTypeAtFlowArrayMutation(flow2) { + if (declaredType === autoType || declaredType === autoArrayType) { + const node = flow2.node; + const expr = node.kind === 213 ? node.expression.expression : node.left.expression; + if (isMatchingReference(reference, getReferenceCandidate(expr))) { + const flowType = getTypeAtFlowNode(flow2.antecedent); + const type3 = getTypeFromFlowType(flowType); + if (getObjectFlags(type3) & 256) { + let evolvedType2 = type3; + if (node.kind === 213) { + for (const arg of node.arguments) { + evolvedType2 = addEvolvingArrayElementType(evolvedType2, arg); + } + } else { + const indexType = getContextFreeTypeOfExpression(node.left.argumentExpression); + if (isTypeAssignableToKind( + indexType, + 296 + /* NumberLike */ + )) { + evolvedType2 = addEvolvingArrayElementType(evolvedType2, node.right); + } + } + return evolvedType2 === type3 ? flowType : createFlowType(evolvedType2, isIncomplete(flowType)); + } + return flowType; + } + } + return void 0; + } + function getTypeAtFlowCondition(flow2) { + const flowType = getTypeAtFlowNode(flow2.antecedent); + const type3 = getTypeFromFlowType(flowType); + if (type3.flags & 131072) { + return flowType; + } + const assumeTrue = (flow2.flags & 32) !== 0; + const nonEvolvingType = finalizeEvolvingArrayType(type3); + const narrowedType = narrowType(nonEvolvingType, flow2.node, assumeTrue); + if (narrowedType === nonEvolvingType) { + return flowType; + } + return createFlowType(narrowedType, isIncomplete(flowType)); + } + function getTypeAtSwitchClause(flow2) { + const expr = skipParentheses(flow2.switchStatement.expression); + const flowType = getTypeAtFlowNode(flow2.antecedent); + let type3 = getTypeFromFlowType(flowType); + if (isMatchingReference(reference, expr)) { + type3 = narrowTypeBySwitchOnDiscriminant(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } else if (expr.kind === 221 && isMatchingReference(reference, expr.expression)) { + type3 = narrowTypeBySwitchOnTypeOf(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } else if (expr.kind === 112) { + type3 = narrowTypeBySwitchOnTrue(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } else { + if (strictNullChecks) { + if (optionalChainContainsReference(expr, reference)) { + type3 = narrowTypeBySwitchOptionalChainContainment(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd, (t8) => !(t8.flags & (32768 | 131072))); + } else if (expr.kind === 221 && optionalChainContainsReference(expr.expression, reference)) { + type3 = narrowTypeBySwitchOptionalChainContainment(type3, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd, (t8) => !(t8.flags & 131072 || t8.flags & 128 && t8.value === "undefined")); + } + } + const access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + type3 = narrowTypeBySwitchOnDiscriminantProperty(type3, access2, flow2.switchStatement, flow2.clauseStart, flow2.clauseEnd); + } + } + return createFlowType(type3, isIncomplete(flowType)); + } + function getTypeAtFlowBranchLabel(flow2) { + const antecedentTypes = []; + let subtypeReduction = false; + let seenIncomplete = false; + let bypassFlow; + for (const antecedent of flow2.antecedents) { + if (!bypassFlow && antecedent.flags & 128 && antecedent.clauseStart === antecedent.clauseEnd) { + bypassFlow = antecedent; + continue; + } + const flowType = getTypeAtFlowNode(antecedent); + const type3 = getTypeFromFlowType(flowType); + if (type3 === declaredType && declaredType === initialType) { + return type3; + } + pushIfUnique(antecedentTypes, type3); + if (!isTypeSubsetOf(type3, initialType)) { + subtypeReduction = true; + } + if (isIncomplete(flowType)) { + seenIncomplete = true; + } + } + if (bypassFlow) { + const flowType = getTypeAtFlowNode(bypassFlow); + const type3 = getTypeFromFlowType(flowType); + if (!(type3.flags & 131072) && !contains2(antecedentTypes, type3) && !isExhaustiveSwitchStatement(bypassFlow.switchStatement)) { + if (type3 === declaredType && declaredType === initialType) { + return type3; + } + antecedentTypes.push(type3); + if (!isTypeSubsetOf(type3, initialType)) { + subtypeReduction = true; + } + if (isIncomplete(flowType)) { + seenIncomplete = true; + } + } + } + return createFlowType(getUnionOrEvolvingArrayType( + antecedentTypes, + subtypeReduction ? 2 : 1 + /* Literal */ + ), seenIncomplete); + } + function getTypeAtFlowLoopLabel(flow2) { + const id = getFlowNodeId(flow2); + const cache = flowLoopCaches[id] || (flowLoopCaches[id] = /* @__PURE__ */ new Map()); + const key2 = getOrSetCacheKey(); + if (!key2) { + return declaredType; + } + const cached = cache.get(key2); + if (cached) { + return cached; + } + for (let i7 = flowLoopStart; i7 < flowLoopCount; i7++) { + if (flowLoopNodes[i7] === flow2 && flowLoopKeys[i7] === key2 && flowLoopTypes[i7].length) { + return createFlowType( + getUnionOrEvolvingArrayType( + flowLoopTypes[i7], + 1 + /* Literal */ + ), + /*incomplete*/ + true + ); + } + } + const antecedentTypes = []; + let subtypeReduction = false; + let firstAntecedentType; + for (const antecedent of flow2.antecedents) { + let flowType; + if (!firstAntecedentType) { + flowType = firstAntecedentType = getTypeAtFlowNode(antecedent); + } else { + flowLoopNodes[flowLoopCount] = flow2; + flowLoopKeys[flowLoopCount] = key2; + flowLoopTypes[flowLoopCount] = antecedentTypes; + flowLoopCount++; + const saveFlowTypeCache = flowTypeCache; + flowTypeCache = void 0; + flowType = getTypeAtFlowNode(antecedent); + flowTypeCache = saveFlowTypeCache; + flowLoopCount--; + const cached2 = cache.get(key2); + if (cached2) { + return cached2; + } + } + const type3 = getTypeFromFlowType(flowType); + pushIfUnique(antecedentTypes, type3); + if (!isTypeSubsetOf(type3, initialType)) { + subtypeReduction = true; + } + if (type3 === declaredType) { + break; + } + } + const result2 = getUnionOrEvolvingArrayType( + antecedentTypes, + subtypeReduction ? 2 : 1 + /* Literal */ + ); + if (isIncomplete(firstAntecedentType)) { + return createFlowType( + result2, + /*incomplete*/ + true + ); + } + cache.set(key2, result2); + return result2; + } + function getUnionOrEvolvingArrayType(types3, subtypeReduction) { + if (isEvolvingArrayTypeList(types3)) { + return getEvolvingArrayType(getUnionType(map4(types3, getElementTypeOfEvolvingArrayType))); + } + const result2 = recombineUnknownType(getUnionType(sameMap(types3, finalizeEvolvingArrayType), subtypeReduction)); + if (result2 !== declaredType && result2.flags & declaredType.flags & 1048576 && arraysEqual(result2.types, declaredType.types)) { + return declaredType; + } + return result2; + } + function getCandidateDiscriminantPropertyAccess(expr) { + if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) { + if (isIdentifier(expr)) { + const symbol = getResolvedSymbol(expr); + const declaration = symbol.valueDeclaration; + if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) { + return declaration; + } + } + } else if (isAccessExpression(expr)) { + if (isMatchingReference(reference, expr.expression)) { + return expr; + } + } else if (isIdentifier(expr)) { + const symbol = getResolvedSymbol(expr); + if (isConstantVariable(symbol)) { + const declaration = symbol.valueDeclaration; + if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) { + return declaration.initializer; + } + if (isBindingElement(declaration) && !declaration.initializer) { + const parent22 = declaration.parent.parent; + if (isVariableDeclaration(parent22) && !parent22.type && parent22.initializer && (isIdentifier(parent22.initializer) || isAccessExpression(parent22.initializer)) && isMatchingReference(reference, parent22.initializer)) { + return declaration; + } + } + } + } + return void 0; + } + function getDiscriminantPropertyAccess(expr, computedType) { + if (declaredType.flags & 1048576 || computedType.flags & 1048576) { + const access2 = getCandidateDiscriminantPropertyAccess(expr); + if (access2) { + const name2 = getAccessedPropertyName(access2); + if (name2) { + const type3 = declaredType.flags & 1048576 && isTypeSubsetOf(computedType, declaredType) ? declaredType : computedType; + if (isDiscriminantProperty(type3, name2)) { + return access2; + } + } + } + } + return void 0; + } + function narrowTypeByDiscriminant(type3, access2, narrowType2) { + const propName2 = getAccessedPropertyName(access2); + if (propName2 === void 0) { + return type3; + } + const optionalChain = isOptionalChain(access2); + const removeNullable = strictNullChecks && (optionalChain || isNonNullAccess(access2)) && maybeTypeOfKind( + type3, + 98304 + /* Nullable */ + ); + let propType = getTypeOfPropertyOfType(removeNullable ? getTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ) : type3, propName2); + if (!propType) { + return type3; + } + propType = removeNullable && optionalChain ? getOptionalType(propType) : propType; + const narrowedPropType = narrowType2(propType); + return filterType(type3, (t8) => { + const discriminantType = getTypeOfPropertyOrIndexSignatureOfType(t8, propName2) || unknownType2; + return !(discriminantType.flags & 131072) && !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType); + }); + } + function narrowTypeByDiscriminantProperty(type3, access2, operator, value2, assumeTrue) { + if ((operator === 37 || operator === 38) && type3.flags & 1048576) { + const keyPropertyName = getKeyPropertyName(type3); + if (keyPropertyName && keyPropertyName === getAccessedPropertyName(access2)) { + const candidate = getConstituentTypeForKeyType(type3, getTypeOfExpression(value2)); + if (candidate) { + return operator === (assumeTrue ? 37 : 38) ? candidate : isUnitType(getTypeOfPropertyOfType(candidate, keyPropertyName) || unknownType2) ? removeType(type3, candidate) : type3; + } + } + } + return narrowTypeByDiscriminant(type3, access2, (t8) => narrowTypeByEquality(t8, operator, value2, assumeTrue)); + } + function narrowTypeBySwitchOnDiscriminantProperty(type3, access2, switchStatement, clauseStart, clauseEnd) { + if (clauseStart < clauseEnd && type3.flags & 1048576 && getKeyPropertyName(type3) === getAccessedPropertyName(access2)) { + const clauseTypes = getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd); + const candidate = getUnionType(map4(clauseTypes, (t8) => getConstituentTypeForKeyType(type3, t8) || unknownType2)); + if (candidate !== unknownType2) { + return candidate; + } + } + return narrowTypeByDiscriminant(type3, access2, (t8) => narrowTypeBySwitchOnDiscriminant(t8, switchStatement, clauseStart, clauseEnd)); + } + function narrowTypeByTruthiness(type3, expr, assumeTrue) { + if (isMatchingReference(reference, expr)) { + return getAdjustedTypeWithFacts( + type3, + assumeTrue ? 4194304 : 8388608 + /* Falsy */ + ); + } + if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) { + type3 = getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ); + } + const access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, (t8) => getTypeWithFacts( + t8, + assumeTrue ? 4194304 : 8388608 + /* Falsy */ + )); + } + return type3; + } + function isTypePresencePossible(type3, propName2, assumeTrue) { + const prop = getPropertyOfType(type3, propName2); + return prop ? !!(prop.flags & 16777216 || getCheckFlags(prop) & 48) || assumeTrue : !!getApplicableIndexInfoForName(type3, propName2) || !assumeTrue; + } + function narrowTypeByInKeyword(type3, nameType, assumeTrue) { + const name2 = getPropertyNameFromType(nameType); + const isKnownProperty2 = someType(type3, (t8) => isTypePresencePossible( + t8, + name2, + /*assumeTrue*/ + true + )); + if (isKnownProperty2) { + return filterType(type3, (t8) => isTypePresencePossible(t8, name2, assumeTrue)); + } + if (assumeTrue) { + const recordSymbol = getGlobalRecordSymbol(); + if (recordSymbol) { + return getIntersectionType([type3, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType2])]); + } + } + return type3; + } + function narrowTypeByBooleanComparison(type3, expr, bool2, operator, assumeTrue) { + assumeTrue = assumeTrue !== (bool2.kind === 112) !== (operator !== 38 && operator !== 36); + return narrowType(type3, expr, assumeTrue); + } + function narrowTypeByBinaryExpression(type3, expr, assumeTrue) { + switch (expr.operatorToken.kind) { + case 64: + case 76: + case 77: + case 78: + return narrowTypeByTruthiness(narrowType(type3, expr.right, assumeTrue), expr.left, assumeTrue); + case 35: + case 36: + case 37: + case 38: + const operator = expr.operatorToken.kind; + const left = getReferenceCandidate(expr.left); + const right = getReferenceCandidate(expr.right); + if (left.kind === 221 && isStringLiteralLike(right)) { + return narrowTypeByTypeof(type3, left, operator, right, assumeTrue); + } + if (right.kind === 221 && isStringLiteralLike(left)) { + return narrowTypeByTypeof(type3, right, operator, left, assumeTrue); + } + if (isMatchingReference(reference, left)) { + return narrowTypeByEquality(type3, operator, right, assumeTrue); + } + if (isMatchingReference(reference, right)) { + return narrowTypeByEquality(type3, operator, left, assumeTrue); + } + if (strictNullChecks) { + if (optionalChainContainsReference(left, reference)) { + type3 = narrowTypeByOptionalChainContainment(type3, operator, right, assumeTrue); + } else if (optionalChainContainsReference(right, reference)) { + type3 = narrowTypeByOptionalChainContainment(type3, operator, left, assumeTrue); + } + } + const leftAccess = getDiscriminantPropertyAccess(left, type3); + if (leftAccess) { + return narrowTypeByDiscriminantProperty(type3, leftAccess, operator, right, assumeTrue); + } + const rightAccess = getDiscriminantPropertyAccess(right, type3); + if (rightAccess) { + return narrowTypeByDiscriminantProperty(type3, rightAccess, operator, left, assumeTrue); + } + if (isMatchingConstructorReference(left)) { + return narrowTypeByConstructor(type3, operator, right, assumeTrue); + } + if (isMatchingConstructorReference(right)) { + return narrowTypeByConstructor(type3, operator, left, assumeTrue); + } + if (isBooleanLiteral(right) && !isAccessExpression(left)) { + return narrowTypeByBooleanComparison(type3, left, right, operator, assumeTrue); + } + if (isBooleanLiteral(left) && !isAccessExpression(right)) { + return narrowTypeByBooleanComparison(type3, right, left, operator, assumeTrue); + } + break; + case 104: + return narrowTypeByInstanceof(type3, expr, assumeTrue); + case 103: + if (isPrivateIdentifier(expr.left)) { + return narrowTypeByPrivateIdentifierInInExpression(type3, expr, assumeTrue); + } + const target = getReferenceCandidate(expr.right); + if (containsMissingType(type3) && isAccessExpression(reference) && isMatchingReference(reference.expression, target)) { + const leftType = getTypeOfExpression(expr.left); + if (isTypeUsableAsPropertyName(leftType) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) { + return getTypeWithFacts( + type3, + assumeTrue ? 524288 : 65536 + /* EQUndefined */ + ); + } + } + if (isMatchingReference(reference, target)) { + const leftType = getTypeOfExpression(expr.left); + if (isTypeUsableAsPropertyName(leftType)) { + return narrowTypeByInKeyword(type3, leftType, assumeTrue); + } + } + break; + case 28: + return narrowType(type3, expr.right, assumeTrue); + case 56: + return assumeTrue ? narrowType( + narrowType( + type3, + expr.left, + /*assumeTrue*/ + true + ), + expr.right, + /*assumeTrue*/ + true + ) : getUnionType([narrowType( + type3, + expr.left, + /*assumeTrue*/ + false + ), narrowType( + type3, + expr.right, + /*assumeTrue*/ + false + )]); + case 57: + return assumeTrue ? getUnionType([narrowType( + type3, + expr.left, + /*assumeTrue*/ + true + ), narrowType( + type3, + expr.right, + /*assumeTrue*/ + true + )]) : narrowType( + narrowType( + type3, + expr.left, + /*assumeTrue*/ + false + ), + expr.right, + /*assumeTrue*/ + false + ); + } + return type3; + } + function narrowTypeByPrivateIdentifierInInExpression(type3, expr, assumeTrue) { + const target = getReferenceCandidate(expr.right); + if (!isMatchingReference(reference, target)) { + return type3; + } + Debug.assertNode(expr.left, isPrivateIdentifier); + const symbol = getSymbolForPrivateIdentifierExpression(expr.left); + if (symbol === void 0) { + return type3; + } + const classSymbol = symbol.parent; + const targetType = hasStaticModifier(Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration")) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); + return getNarrowedType( + type3, + targetType, + assumeTrue, + /*checkDerived*/ + true + ); + } + function narrowTypeByOptionalChainContainment(type3, operator, value2, assumeTrue) { + const equalsOperator = operator === 35 || operator === 37; + const nullableFlags = operator === 35 || operator === 36 ? 98304 : 32768; + const valueType = getTypeOfExpression(value2); + const removeNullable = equalsOperator !== assumeTrue && everyType(valueType, (t8) => !!(t8.flags & nullableFlags)) || equalsOperator === assumeTrue && everyType(valueType, (t8) => !(t8.flags & (3 | nullableFlags))); + return removeNullable ? getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ) : type3; + } + function narrowTypeByEquality(type3, operator, value2, assumeTrue) { + if (type3.flags & 1) { + return type3; + } + if (operator === 36 || operator === 38) { + assumeTrue = !assumeTrue; + } + const valueType = getTypeOfExpression(value2); + const doubleEquals = operator === 35 || operator === 36; + if (valueType.flags & 98304) { + if (!strictNullChecks) { + return type3; + } + const facts = doubleEquals ? assumeTrue ? 262144 : 2097152 : valueType.flags & 65536 ? assumeTrue ? 131072 : 1048576 : assumeTrue ? 65536 : 524288; + return getAdjustedTypeWithFacts(type3, facts); + } + if (assumeTrue) { + if (!doubleEquals && (type3.flags & 2 || someType(type3, isEmptyAnonymousObjectType))) { + if (valueType.flags & (402784252 | 67108864) || isEmptyAnonymousObjectType(valueType)) { + return valueType; + } + if (valueType.flags & 524288) { + return nonPrimitiveType; + } + } + const filteredType = filterType(type3, (t8) => areTypesComparable(t8, valueType) || doubleEquals && isCoercibleUnderDoubleEquals(t8, valueType)); + return replacePrimitivesWithLiterals(filteredType, valueType); + } + if (isUnitType(valueType)) { + return filterType(type3, (t8) => !(isUnitLikeType(t8) && areTypesComparable(t8, valueType))); + } + return type3; + } + function narrowTypeByTypeof(type3, typeOfExpr, operator, literal, assumeTrue) { + if (operator === 36 || operator === 38) { + assumeTrue = !assumeTrue; + } + const target = getReferenceCandidate(typeOfExpr.expression); + if (!isMatchingReference(reference, target)) { + if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) { + type3 = getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ); + } + const propertyAccess = getDiscriminantPropertyAccess(target, type3); + if (propertyAccess) { + return narrowTypeByDiscriminant(type3, propertyAccess, (t8) => narrowTypeByLiteralExpression(t8, literal, assumeTrue)); + } + return type3; + } + return narrowTypeByLiteralExpression(type3, literal, assumeTrue); + } + function narrowTypeByLiteralExpression(type3, literal, assumeTrue) { + return assumeTrue ? narrowTypeByTypeName(type3, literal.text) : getAdjustedTypeWithFacts( + type3, + typeofNEFacts.get(literal.text) || 32768 + /* TypeofNEHostObject */ + ); + } + function narrowTypeBySwitchOptionalChainContainment(type3, switchStatement, clauseStart, clauseEnd, clauseCheck) { + const everyClauseChecks = clauseStart !== clauseEnd && every2(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck); + return everyClauseChecks ? getTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ) : type3; + } + function narrowTypeBySwitchOnDiscriminant(type3, switchStatement, clauseStart, clauseEnd) { + const switchTypes = getSwitchClauseTypes(switchStatement); + if (!switchTypes.length) { + return type3; + } + const clauseTypes = switchTypes.slice(clauseStart, clauseEnd); + const hasDefaultClause = clauseStart === clauseEnd || contains2(clauseTypes, neverType2); + if (type3.flags & 2 && !hasDefaultClause) { + let groundClauseTypes; + for (let i7 = 0; i7 < clauseTypes.length; i7 += 1) { + const t8 = clauseTypes[i7]; + if (t8.flags & (402784252 | 67108864)) { + if (groundClauseTypes !== void 0) { + groundClauseTypes.push(t8); + } + } else if (t8.flags & 524288) { + if (groundClauseTypes === void 0) { + groundClauseTypes = clauseTypes.slice(0, i7); + } + groundClauseTypes.push(nonPrimitiveType); + } else { + return type3; + } + } + return getUnionType(groundClauseTypes === void 0 ? clauseTypes : groundClauseTypes); + } + const discriminantType = getUnionType(clauseTypes); + const caseType = discriminantType.flags & 131072 ? neverType2 : replacePrimitivesWithLiterals(filterType(type3, (t8) => areTypesComparable(discriminantType, t8)), discriminantType); + if (!hasDefaultClause) { + return caseType; + } + const defaultType = filterType(type3, (t8) => !(isUnitLikeType(t8) && contains2(switchTypes, getRegularTypeOfLiteralType(extractUnitType(t8))))); + return caseType.flags & 131072 ? defaultType : getUnionType([caseType, defaultType]); + } + function narrowTypeByTypeName(type3, typeName) { + switch (typeName) { + case "string": + return narrowTypeByTypeFacts( + type3, + stringType2, + 1 + /* TypeofEQString */ + ); + case "number": + return narrowTypeByTypeFacts( + type3, + numberType2, + 2 + /* TypeofEQNumber */ + ); + case "bigint": + return narrowTypeByTypeFacts( + type3, + bigintType, + 4 + /* TypeofEQBigInt */ + ); + case "boolean": + return narrowTypeByTypeFacts( + type3, + booleanType2, + 8 + /* TypeofEQBoolean */ + ); + case "symbol": + return narrowTypeByTypeFacts( + type3, + esSymbolType, + 16 + /* TypeofEQSymbol */ + ); + case "object": + return type3.flags & 1 ? type3 : getUnionType([narrowTypeByTypeFacts( + type3, + nonPrimitiveType, + 32 + /* TypeofEQObject */ + ), narrowTypeByTypeFacts( + type3, + nullType2, + 131072 + /* EQNull */ + )]); + case "function": + return type3.flags & 1 ? type3 : narrowTypeByTypeFacts( + type3, + globalFunctionType, + 64 + /* TypeofEQFunction */ + ); + case "undefined": + return narrowTypeByTypeFacts( + type3, + undefinedType2, + 65536 + /* EQUndefined */ + ); + } + return narrowTypeByTypeFacts( + type3, + nonPrimitiveType, + 128 + /* TypeofEQHostObject */ + ); + } + function narrowTypeByTypeFacts(type3, impliedType, facts) { + return mapType2(type3, (t8) => ( + // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate + // the constituent based on its type facts. We use the strict subtype relation because it treats `object` + // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`, + // but are classified as "function" according to `typeof`. + isTypeRelatedTo(t8, impliedType, strictSubtypeRelation) ? hasTypeFacts(t8, facts) ? t8 : neverType2 : ( + // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied + // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`. + isTypeSubtypeOf(impliedType, t8) ? impliedType : ( + // Neither the constituent nor the implied type is a subtype of the other, however their domains may still + // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate + // possible overlap, we form an intersection. Otherwise, we eliminate the constituent. + hasTypeFacts(t8, facts) ? getIntersectionType([t8, impliedType]) : neverType2 + ) + ) + )); + } + function narrowTypeBySwitchOnTypeOf(type3, switchStatement, clauseStart, clauseEnd) { + const witnesses = getSwitchClauseTypeOfWitnesses(switchStatement); + if (!witnesses) { + return type3; + } + const defaultIndex = findIndex2( + switchStatement.caseBlock.clauses, + (clause) => clause.kind === 297 + /* DefaultClause */ + ); + const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; + if (hasDefaultClause) { + const notEqualFacts = getNotEqualFactsFromTypeofSwitch(clauseStart, clauseEnd, witnesses); + return filterType(type3, (t8) => getTypeFacts(t8, notEqualFacts) === notEqualFacts); + } + const clauseWitnesses = witnesses.slice(clauseStart, clauseEnd); + return getUnionType(map4(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type3, text) : neverType2)); + } + function narrowTypeBySwitchOnTrue(type3, switchStatement, clauseStart, clauseEnd) { + const defaultIndex = findIndex2( + switchStatement.caseBlock.clauses, + (clause) => clause.kind === 297 + /* DefaultClause */ + ); + const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd; + for (let i7 = 0; i7 < clauseStart; i7++) { + const clause = switchStatement.caseBlock.clauses[i7]; + if (clause.kind === 296) { + type3 = narrowType( + type3, + clause.expression, + /*assumeTrue*/ + false + ); + } + } + if (hasDefaultClause) { + for (let i7 = clauseEnd; i7 < switchStatement.caseBlock.clauses.length; i7++) { + const clause = switchStatement.caseBlock.clauses[i7]; + if (clause.kind === 296) { + type3 = narrowType( + type3, + clause.expression, + /*assumeTrue*/ + false + ); + } + } + return type3; + } + const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd); + return getUnionType(map4(clauses, (clause) => clause.kind === 296 ? narrowType( + type3, + clause.expression, + /*assumeTrue*/ + true + ) : neverType2)); + } + function isMatchingConstructorReference(expr) { + return (isPropertyAccessExpression(expr) && idText(expr.name) === "constructor" || isElementAccessExpression(expr) && isStringLiteralLike(expr.argumentExpression) && expr.argumentExpression.text === "constructor") && isMatchingReference(reference, expr.expression); + } + function narrowTypeByConstructor(type3, operator, identifier, assumeTrue) { + if (assumeTrue ? operator !== 35 && operator !== 37 : operator !== 36 && operator !== 38) { + return type3; + } + const identifierType = getTypeOfExpression(identifier); + if (!isFunctionType(identifierType) && !isConstructorType(identifierType)) { + return type3; + } + const prototypeProperty = getPropertyOfType(identifierType, "prototype"); + if (!prototypeProperty) { + return type3; + } + const prototypeType = getTypeOfSymbol(prototypeProperty); + const candidate = !isTypeAny(prototypeType) ? prototypeType : void 0; + if (!candidate || candidate === globalObjectType || candidate === globalFunctionType) { + return type3; + } + if (isTypeAny(type3)) { + return candidate; + } + return filterType(type3, (t8) => isConstructedBy(t8, candidate)); + function isConstructedBy(source, target) { + if (source.flags & 524288 && getObjectFlags(source) & 1 || target.flags & 524288 && getObjectFlags(target) & 1) { + return source.symbol === target.symbol; + } + return isTypeSubtypeOf(source, target); + } + } + function narrowTypeByInstanceof(type3, expr, assumeTrue) { + const left = getReferenceCandidate(expr.left); + if (!isMatchingReference(reference, left)) { + if (assumeTrue && strictNullChecks && optionalChainContainsReference(left, reference)) { + return getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ); + } + return type3; + } + const right = expr.right; + const rightType = getTypeOfExpression(right); + if (!isTypeDerivedFrom(rightType, globalObjectType)) { + return type3; + } + const signature = getEffectsSignature(expr); + const predicate = signature && getTypePredicateOfSignature(signature); + if (predicate && predicate.kind === 1 && predicate.parameterIndex === 0) { + return getNarrowedType( + type3, + predicate.type, + assumeTrue, + /*checkDerived*/ + true + ); + } + if (!isTypeDerivedFrom(rightType, globalFunctionType)) { + return type3; + } + const instanceType = mapType2(rightType, getInstanceType); + if (isTypeAny(type3) && (instanceType === globalObjectType || instanceType === globalFunctionType) || !assumeTrue && !(instanceType.flags & 524288 && !isEmptyAnonymousObjectType(instanceType))) { + return type3; + } + return getNarrowedType( + type3, + instanceType, + assumeTrue, + /*checkDerived*/ + true + ); + } + function getInstanceType(constructorType) { + const prototypePropertyType = getTypeOfPropertyOfType(constructorType, "prototype"); + if (prototypePropertyType && !isTypeAny(prototypePropertyType)) { + return prototypePropertyType; + } + const constructSignatures = getSignaturesOfType( + constructorType, + 1 + /* Construct */ + ); + if (constructSignatures.length) { + return getUnionType(map4(constructSignatures, (signature) => getReturnTypeOfSignature(getErasedSignature(signature)))); + } + return emptyObjectType; + } + function getNarrowedType(type3, candidate, assumeTrue, checkDerived) { + const key2 = type3.flags & 1048576 ? `N${getTypeId(type3)},${getTypeId(candidate)},${(assumeTrue ? 1 : 0) | (checkDerived ? 2 : 0)}` : void 0; + return getCachedType(key2) ?? setCachedType(key2, getNarrowedTypeWorker(type3, candidate, assumeTrue, checkDerived)); + } + function getNarrowedTypeWorker(type3, candidate, assumeTrue, checkDerived) { + if (!assumeTrue) { + if (type3 === candidate) { + return neverType2; + } + if (checkDerived) { + return filterType(type3, (t8) => !isTypeDerivedFrom(t8, candidate)); + } + const trueType2 = getNarrowedType( + type3, + candidate, + /*assumeTrue*/ + true, + /*checkDerived*/ + false + ); + return filterType(type3, (t8) => !isTypeSubsetOf(t8, trueType2)); + } + if (type3.flags & 3) { + return candidate; + } + if (type3 === candidate) { + return candidate; + } + const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf; + const keyPropertyName = type3.flags & 1048576 ? getKeyPropertyName(type3) : void 0; + const narrowedType = mapType2(candidate, (c7) => { + const discriminant = keyPropertyName && getTypeOfPropertyOfType(c7, keyPropertyName); + const matching = discriminant && getConstituentTypeForKeyType(type3, discriminant); + const directlyRelated = mapType2( + matching || type3, + checkDerived ? (t8) => isTypeDerivedFrom(t8, c7) ? t8 : isTypeDerivedFrom(c7, t8) ? c7 : neverType2 : (t8) => isTypeStrictSubtypeOf(t8, c7) ? t8 : isTypeStrictSubtypeOf(c7, t8) ? c7 : isTypeSubtypeOf(t8, c7) ? t8 : isTypeSubtypeOf(c7, t8) ? c7 : neverType2 + ); + return directlyRelated.flags & 131072 ? mapType2(type3, (t8) => maybeTypeOfKind( + t8, + 465829888 + /* Instantiable */ + ) && isRelated(c7, getBaseConstraintOfType(t8) || unknownType2) ? getIntersectionType([t8, c7]) : neverType2) : directlyRelated; + }); + return !(narrowedType.flags & 131072) ? narrowedType : isTypeSubtypeOf(candidate, type3) ? candidate : isTypeAssignableTo(type3, candidate) ? type3 : isTypeAssignableTo(candidate, type3) ? candidate : getIntersectionType([type3, candidate]); + } + function narrowTypeByCallExpression(type3, callExpression, assumeTrue) { + if (hasMatchingArgument(callExpression, reference)) { + const signature = assumeTrue || !isCallChain(callExpression) ? getEffectsSignature(callExpression) : void 0; + const predicate = signature && getTypePredicateOfSignature(signature); + if (predicate && (predicate.kind === 0 || predicate.kind === 1)) { + return narrowTypeByTypePredicate(type3, predicate, callExpression, assumeTrue); + } + } + if (containsMissingType(type3) && isAccessExpression(reference) && isPropertyAccessExpression(callExpression.expression)) { + const callAccess = callExpression.expression; + if (isMatchingReference(reference.expression, getReferenceCandidate(callAccess.expression)) && isIdentifier(callAccess.name) && callAccess.name.escapedText === "hasOwnProperty" && callExpression.arguments.length === 1) { + const argument = callExpression.arguments[0]; + if (isStringLiteralLike(argument) && getAccessedPropertyName(reference) === escapeLeadingUnderscores(argument.text)) { + return getTypeWithFacts( + type3, + assumeTrue ? 524288 : 65536 + /* EQUndefined */ + ); + } + } + } + return type3; + } + function narrowTypeByTypePredicate(type3, predicate, callExpression, assumeTrue) { + if (predicate.type && !(isTypeAny(type3) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) { + const predicateArgument = getTypePredicateArgument(predicate, callExpression); + if (predicateArgument) { + if (isMatchingReference(reference, predicateArgument)) { + return getNarrowedType( + type3, + predicate.type, + assumeTrue, + /*checkDerived*/ + false + ); + } + if (strictNullChecks && optionalChainContainsReference(predicateArgument, reference) && (assumeTrue && !hasTypeFacts( + predicate.type, + 65536 + /* EQUndefined */ + ) || !assumeTrue && everyType(predicate.type, isNullableType))) { + type3 = getAdjustedTypeWithFacts( + type3, + 2097152 + /* NEUndefinedOrNull */ + ); + } + const access2 = getDiscriminantPropertyAccess(predicateArgument, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, (t8) => getNarrowedType( + t8, + predicate.type, + assumeTrue, + /*checkDerived*/ + false + )); + } + } + } + return type3; + } + function narrowType(type3, expr, assumeTrue) { + if (isExpressionOfOptionalChainRoot(expr) || isBinaryExpression(expr.parent) && (expr.parent.operatorToken.kind === 61 || expr.parent.operatorToken.kind === 78) && expr.parent.left === expr) { + return narrowTypeByOptionality(type3, expr, assumeTrue); + } + switch (expr.kind) { + case 80: + if (!isMatchingReference(reference, expr) && inlineLevel < 5) { + const symbol = getResolvedSymbol(expr); + if (isConstantVariable(symbol)) { + const declaration = symbol.valueDeclaration; + if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isConstantReference(reference)) { + inlineLevel++; + const result2 = narrowType(type3, declaration.initializer, assumeTrue); + inlineLevel--; + return result2; + } + } + } + case 110: + case 108: + case 211: + case 212: + return narrowTypeByTruthiness(type3, expr, assumeTrue); + case 213: + return narrowTypeByCallExpression(type3, expr, assumeTrue); + case 217: + case 235: + return narrowType(type3, expr.expression, assumeTrue); + case 226: + return narrowTypeByBinaryExpression(type3, expr, assumeTrue); + case 224: + if (expr.operator === 54) { + return narrowType(type3, expr.operand, !assumeTrue); + } + break; + } + return type3; + } + function narrowTypeByOptionality(type3, expr, assumePresent) { + if (isMatchingReference(reference, expr)) { + return getAdjustedTypeWithFacts( + type3, + assumePresent ? 2097152 : 262144 + /* EQUndefinedOrNull */ + ); + } + const access2 = getDiscriminantPropertyAccess(expr, type3); + if (access2) { + return narrowTypeByDiscriminant(type3, access2, (t8) => getTypeWithFacts( + t8, + assumePresent ? 2097152 : 262144 + /* EQUndefinedOrNull */ + )); + } + return type3; + } + } + function getTypeOfSymbolAtLocation(symbol, location2) { + symbol = getExportSymbolOfValueSymbolIfExported(symbol); + if (location2.kind === 80 || location2.kind === 81) { + if (isRightSideOfQualifiedNameOrPropertyAccess(location2)) { + location2 = location2.parent; + } + if (isExpressionNode(location2) && (!isAssignmentTarget(location2) || isWriteAccess(location2))) { + const type3 = removeOptionalTypeMarker( + isWriteAccess(location2) && location2.kind === 211 ? checkPropertyAccessExpression( + location2, + /*checkMode*/ + void 0, + /*writeOnly*/ + true + ) : getTypeOfExpression(location2) + ); + if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location2).resolvedSymbol) === symbol) { + return type3; + } + } + } + if (isDeclarationName(location2) && isSetAccessor(location2.parent) && getAnnotatedAccessorTypeNode(location2.parent)) { + return getWriteTypeOfAccessors(location2.parent.symbol); + } + return isRightSideOfAccessExpression(location2) && isWriteAccess(location2.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol); + } + function getControlFlowContainer(node) { + return findAncestor( + node.parent, + (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 || node2.kind === 312 || node2.kind === 172 + /* PropertyDeclaration */ + ); + } + function isSymbolAssigned(symbol) { + return !isPastLastAssignment( + symbol, + /*location*/ + void 0 + ); + } + function isPastLastAssignment(symbol, location2) { + const parent22 = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile); + if (!parent22) { + return false; + } + const links = getNodeLinks(parent22); + if (!(links.flags & 131072)) { + links.flags |= 131072; + if (!hasParentWithAssignmentsMarked(parent22)) { + markNodeAssignments(parent22); + } + } + return !symbol.lastAssignmentPos || location2 && symbol.lastAssignmentPos < location2.pos; + } + function isSomeSymbolAssigned(rootDeclaration) { + Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration)); + return isSomeSymbolAssignedWorker(rootDeclaration.name); + } + function isSomeSymbolAssignedWorker(node) { + if (node.kind === 80) { + return isSymbolAssigned(getSymbolOfDeclaration(node.parent)); + } + return some2(node.elements, (e10) => e10.kind !== 232 && isSomeSymbolAssignedWorker(e10.name)); + } + function hasParentWithAssignmentsMarked(node) { + return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072)); + } + function isFunctionOrSourceFile(node) { + return isFunctionLikeDeclaration(node) || isSourceFile(node); + } + function markNodeAssignments(node) { + switch (node.kind) { + case 80: + if (isAssignmentTarget(node)) { + const symbol = getResolvedSymbol(node); + if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) { + const referencingFunction = findAncestor(node, isFunctionOrSourceFile); + const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile); + symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE; + } + } + return; + case 281: + const exportDeclaration = node.parent.parent; + if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) { + const symbol = resolveEntityName( + node.propertyName || node.name, + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true + ); + if (symbol && isParameterOrMutableLocalVariable(symbol)) { + symbol.lastAssignmentPos = Number.MAX_VALUE; + } + } + return; + case 264: + case 265: + case 266: + return; + } + if (isTypeNode(node)) { + return; + } + forEachChild(node, markNodeAssignments); + } + function extendAssignmentPosition(node, declaration) { + let pos = node.pos; + while (node && node.pos > declaration.pos) { + switch (node.kind) { + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 254: + case 255: + case 258: + case 263: + pos = node.end; + } + node = node.parent; + } + return pos; + } + function isConstantVariable(symbol) { + return symbol.flags & 3 && (getDeclarationNodeFlagsFromSymbol(symbol) & 6) !== 0; + } + function isParameterOrMutableLocalVariable(symbol) { + const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration); + return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration))); + } + function isMutableLocalVariableDeclaration(declaration) { + return !!(declaration.parent.flags & 1) && !(getCombinedModifierFlags(declaration) & 32 || declaration.parent.parent.kind === 243 && isGlobalSourceFile(declaration.parent.parent.parent)); + } + function parameterInitializerContainsUndefined(declaration) { + const links = getNodeLinks(declaration); + if (links.parameterInitializerContainsUndefined === void 0) { + if (!pushTypeResolution( + declaration, + 9 + /* ParameterInitializerContainsUndefined */ + )) { + reportCircularityError(declaration.symbol); + return true; + } + const containsUndefined = !!hasTypeFacts( + checkDeclarationInitializer( + declaration, + 0 + /* Normal */ + ), + 16777216 + /* IsUndefined */ + ); + if (!popTypeResolution()) { + reportCircularityError(declaration.symbol); + return true; + } + links.parameterInitializerContainsUndefined = containsUndefined; + } + return links.parameterInitializerContainsUndefined; + } + function removeOptionalityFromDeclaredType(declaredType, declaration) { + const removeUndefined = strictNullChecks && declaration.kind === 169 && declaration.initializer && hasTypeFacts( + declaredType, + 16777216 + /* IsUndefined */ + ) && !parameterInitializerContainsUndefined(declaration); + return removeUndefined ? getTypeWithFacts( + declaredType, + 524288 + /* NEUndefined */ + ) : declaredType; + } + function isConstraintPosition(type3, node) { + const parent22 = node.parent; + return parent22.kind === 211 || parent22.kind === 166 || parent22.kind === 213 && parent22.expression === node || parent22.kind === 212 && parent22.expression === node && !(someType(type3, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent22.argumentExpression))); + } + function isGenericTypeWithUnionConstraint(type3) { + return type3.flags & 2097152 ? some2(type3.types, isGenericTypeWithUnionConstraint) : !!(type3.flags & 465829888 && getBaseConstraintOrType(type3).flags & (98304 | 1048576)); + } + function isGenericTypeWithoutNullableConstraint(type3) { + return type3.flags & 2097152 ? some2(type3.types, isGenericTypeWithoutNullableConstraint) : !!(type3.flags & 465829888 && !maybeTypeOfKind( + getBaseConstraintOrType(type3), + 98304 + /* Nullable */ + )); + } + function hasContextualTypeWithNoGenericTypes(node, checkMode) { + const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 32 ? getContextualType2( + node, + 8 + /* SkipBindingPatterns */ + ) : getContextualType2( + node, + /*contextFlags*/ + void 0 + )); + return contextualType && !isGenericType(contextualType); + } + function getNarrowableTypeForReference(type3, reference, checkMode) { + const substituteConstraints = !(checkMode && checkMode & 2) && someType(type3, isGenericTypeWithUnionConstraint) && (isConstraintPosition(type3, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode)); + return substituteConstraints ? mapType2(type3, getBaseConstraintOrType) : type3; + } + function isExportOrExportExpression(location2) { + return !!findAncestor(location2, (n7) => { + const parent22 = n7.parent; + if (parent22 === void 0) { + return "quit"; + } + if (isExportAssignment(parent22)) { + return parent22.expression === n7 && isEntityNameExpression(n7); + } + if (isExportSpecifier(parent22)) { + return parent22.name === n7 || parent22.propertyName === n7; + } + return false; + }); + } + function markAliasReferenced(symbol, location2) { + if (!canCollectSymbolAliasAccessabilityData) { + return; + } + if (isNonLocalAlias( + symbol, + /*excludes*/ + 111551 + /* Value */ + ) && !isInTypeQuery(location2)) { + const target = resolveAlias(symbol); + if (getSymbolFlags( + symbol, + /*excludeTypeOnlyMeanings*/ + true + ) & (111551 | 1048576)) { + if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location2) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) { + markAliasSymbolAsReferenced(symbol); + } else { + markConstEnumAliasAsReferenced(symbol); + } + } + } + } + function getNarrowedTypeOfSymbol(symbol, location2, checkMode) { + var _a2; + const type3 = getTypeOfSymbol(symbol, checkMode); + const declaration = symbol.valueDeclaration; + if (declaration) { + if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) { + const parent22 = declaration.parent.parent; + const rootDeclaration = getRootDeclaration(parent22); + if (rootDeclaration.kind === 260 && getCombinedNodeFlagsCached(rootDeclaration) & 6 || rootDeclaration.kind === 169) { + const links = getNodeLinks(parent22); + if (!(links.flags & 4194304)) { + links.flags |= 4194304; + const parentType = getTypeForBindingElementParent( + parent22, + 0 + /* Normal */ + ); + const parentTypeConstraint = parentType && mapType2(parentType, getBaseConstraintOrType); + links.flags &= ~4194304; + if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 && !(rootDeclaration.kind === 169 && isSomeSymbolAssigned(rootDeclaration))) { + const pattern5 = declaration.parent; + const narrowedType = getFlowTypeOfReference( + pattern5, + parentTypeConstraint, + parentTypeConstraint, + /*flowContainer*/ + void 0, + location2.flowNode + ); + if (narrowedType.flags & 131072) { + return neverType2; + } + return getBindingElementTypeFromParentType( + declaration, + narrowedType, + /*noTupleBoundsCheck*/ + true + ); + } + } + } + } + if (isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) { + const func = declaration.parent; + if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + const contextualSignature = getContextualSignature(func); + if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) { + const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a2 = getInferenceContext(func)) == null ? void 0 : _a2.nonFixingMapper)); + if (restType.flags & 1048576 && everyType(restType, isTupleType) && !some2(func.parameters, isSomeSymbolAssigned)) { + const narrowedType = getFlowTypeOfReference( + func, + restType, + restType, + /*flowContainer*/ + void 0, + location2.flowNode + ); + const index4 = func.parameters.indexOf(declaration) - (getThisParameter(func) ? 1 : 0); + return getIndexedAccessType(narrowedType, getNumberLiteralType(index4)); + } + } + } + } + } + return type3; + } + function checkIdentifier(node, checkMode) { + if (isThisInTypeQuery(node)) { + return checkThisExpression(node); + } + const symbol = getResolvedSymbol(node); + if (symbol === unknownSymbol) { + return errorType; + } + if (symbol === argumentsSymbol) { + if (isInPropertyInitializerOrClassStaticBlock(node)) { + error22(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers); + return errorType; + } + let container = getContainingFunction(node); + if (container) { + if (languageVersion < 2) { + if (container.kind === 219) { + error22(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); + } else if (hasSyntacticModifier( + container, + 1024 + /* Async */ + )) { + error22(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method); + } + } + getNodeLinks(container).flags |= 512; + while (container && isArrowFunction(container)) { + container = getContainingFunction(container); + if (container) { + getNodeLinks(container).flags |= 512; + } + } + } + return getTypeOfSymbol(symbol); + } + if (shouldMarkIdentifierAliasReferenced(node)) { + markAliasReferenced(symbol, node); + } + const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); + const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node); + if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) { + addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText); + } + let declaration = localOrExportSymbol.valueDeclaration; + if (declaration && localOrExportSymbol.flags & 32) { + if (isClassLike(declaration) && declaration.name !== node) { + let container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + while (container.kind !== 312 && container.parent !== declaration) { + container = getThisContainer( + container, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + } + if (container.kind !== 312) { + getNodeLinks(declaration).flags |= 262144; + getNodeLinks(container).flags |= 262144; + getNodeLinks(node).flags |= 536870912; + } + } + } + checkNestedBlockScopedBinding(node, symbol); + let type3 = getNarrowedTypeOfSymbol(localOrExportSymbol, node, checkMode); + const assignmentKind = getAssignmentTargetKind(node); + if (assignmentKind) { + if (!(localOrExportSymbol.flags & 3) && !(isInJSFile(node) && localOrExportSymbol.flags & 512)) { + const assignmentError = localOrExportSymbol.flags & 384 ? Diagnostics.Cannot_assign_to_0_because_it_is_an_enum : localOrExportSymbol.flags & 32 ? Diagnostics.Cannot_assign_to_0_because_it_is_a_class : localOrExportSymbol.flags & 1536 ? Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace : localOrExportSymbol.flags & 16 ? Diagnostics.Cannot_assign_to_0_because_it_is_a_function : localOrExportSymbol.flags & 2097152 ? Diagnostics.Cannot_assign_to_0_because_it_is_an_import : Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable; + error22(node, assignmentError, symbolToString2(symbol)); + return errorType; + } + if (isReadonlySymbol(localOrExportSymbol)) { + if (localOrExportSymbol.flags & 3) { + error22(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString2(symbol)); + } else { + error22(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString2(symbol)); + } + return errorType; + } + } + const isAlias2 = localOrExportSymbol.flags & 2097152; + if (localOrExportSymbol.flags & 3) { + if (assignmentKind === 1) { + return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type3) : type3; + } + } else if (isAlias2) { + declaration = getDeclarationOfAliasSymbol(symbol); + } else { + return type3; + } + if (!declaration) { + return type3; + } + type3 = getNarrowableTypeForReference(type3, node, checkMode); + const isParameter2 = getRootDeclaration(declaration).kind === 169; + const declarationContainer = getControlFlowContainer(declaration); + let flowContainer = getControlFlowContainer(node); + const isOuterVariable = flowContainer !== declarationContainer; + const isSpreadDestructuringAssignmentTarget = node.parent && node.parent.parent && isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); + const isModuleExports = symbol.flags & 134217728; + const typeIsAutomatic = type3 === autoType || type3 === autoArrayType; + const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235; + while (flowContainer !== declarationContainer && (flowContainer.kind === 218 || flowContainer.kind === 219 || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type3 !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) { + flowContainer = getControlFlowContainer(flowContainer); + } + const assumeInitialized = isParameter2 || isAlias2 || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type3 !== autoType && type3 !== autoArrayType && (!strictNullChecks || (type3.flags & (3 | 16384)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281) || node.parent.kind === 235 || declaration.kind === 260 && declaration.exclamationToken || declaration.flags & 33554432; + const initialType = isAutomaticTypeInNonNull ? undefinedType2 : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type3, declaration) : type3 : typeIsAutomatic ? undefinedType2 : getOptionalType(type3); + const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type3, initialType, flowContainer)) : getFlowTypeOfReference(node, type3, initialType, flowContainer); + if (!isEvolvingArrayOperationTarget(node) && (type3 === autoType || type3 === autoArrayType)) { + if (flowType === autoType || flowType === autoArrayType) { + if (noImplicitAny) { + error22(getNameOfDeclaration(declaration), Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString2(symbol), typeToString(flowType)); + error22(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString2(symbol), typeToString(flowType)); + } + return convertAutoToAny(flowType); + } + } else if (!assumeInitialized && !containsUndefinedType(type3) && containsUndefinedType(flowType)) { + error22(node, Diagnostics.Variable_0_is_used_before_being_assigned, symbolToString2(symbol)); + return type3; + } + return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; + } + function isSameScopedBindingElement(node, declaration) { + if (isBindingElement(declaration)) { + const bindingElement = findAncestor(node, isBindingElement); + return bindingElement && getRootDeclaration(bindingElement) === getRootDeclaration(declaration); + } + } + function shouldMarkIdentifierAliasReferenced(node) { + var _a2; + const parent22 = node.parent; + if (parent22) { + if (isPropertyAccessExpression(parent22) && parent22.expression === node) { + return false; + } + if (isExportSpecifier(parent22) && parent22.isTypeOnly) { + return false; + } + const greatGrandparent = (_a2 = parent22.parent) == null ? void 0 : _a2.parent; + if (greatGrandparent && isExportDeclaration(greatGrandparent) && greatGrandparent.isTypeOnly) { + return false; + } + } + return true; + } + function isInsideFunctionOrInstancePropertyInitializer(node, threshold) { + return !!findAncestor(node, (n7) => n7 === threshold ? "quit" : isFunctionLike(n7) || n7.parent && isPropertyDeclaration(n7.parent) && !hasStaticModifier(n7.parent) && n7.parent.initializer === n7); + } + function getPartOfForStatementContainingNode(node, container) { + return findAncestor(node, (n7) => n7 === container ? "quit" : n7 === container.initializer || n7 === container.condition || n7 === container.incrementor || n7 === container.statement); + } + function getEnclosingIterationStatement(node) { + return findAncestor(node, (n7) => !n7 || nodeStartsNewLexicalEnvironment(n7) ? "quit" : isIterationStatement( + n7, + /*lookInLabeledStatements*/ + false + )); + } + function checkNestedBlockScopedBinding(node, symbol) { + if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || !symbol.valueDeclaration || isSourceFile(symbol.valueDeclaration) || symbol.valueDeclaration.parent.kind === 299) { + return; + } + const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); + const isCaptured = isInsideFunctionOrInstancePropertyInitializer(node, container); + const enclosingIterationStatement = getEnclosingIterationStatement(container); + if (enclosingIterationStatement) { + if (isCaptured) { + let capturesBlockScopeBindingInLoopBody = true; + if (isForStatement(container)) { + const varDeclList = getAncestor( + symbol.valueDeclaration, + 261 + /* VariableDeclarationList */ + ); + if (varDeclList && varDeclList.parent === container) { + const part = getPartOfForStatementContainingNode(node.parent, container); + if (part) { + const links = getNodeLinks(part); + links.flags |= 8192; + const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []); + pushIfUnique(capturedBindings, symbol); + if (part === container.initializer) { + capturesBlockScopeBindingInLoopBody = false; + } + } + } + } + if (capturesBlockScopeBindingInLoopBody) { + getNodeLinks(enclosingIterationStatement).flags |= 4096; + } + } + if (isForStatement(container)) { + const varDeclList = getAncestor( + symbol.valueDeclaration, + 261 + /* VariableDeclarationList */ + ); + if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) { + getNodeLinks(symbol.valueDeclaration).flags |= 65536; + } + } + getNodeLinks(symbol.valueDeclaration).flags |= 32768; + } + if (isCaptured) { + getNodeLinks(symbol.valueDeclaration).flags |= 16384; + } + } + function isBindingCapturedByNode(node, decl) { + const links = getNodeLinks(node); + return !!links && contains2(links.capturedBlockScopeBindings, getSymbolOfDeclaration(decl)); + } + function isAssignedInBodyOfForStatement(node, container) { + let current = node; + while (current.parent.kind === 217) { + current = current.parent; + } + let isAssigned = false; + if (isAssignmentTarget(current)) { + isAssigned = true; + } else if (current.parent.kind === 224 || current.parent.kind === 225) { + const expr = current.parent; + isAssigned = expr.operator === 46 || expr.operator === 47; + } + if (!isAssigned) { + return false; + } + return !!findAncestor(current, (n7) => n7 === container ? "quit" : n7 === container.statement); + } + function captureLexicalThis(node, container) { + getNodeLinks(node).flags |= 2; + if (container.kind === 172 || container.kind === 176) { + const classNode = container.parent; + getNodeLinks(classNode).flags |= 4; + } else { + getNodeLinks(container).flags |= 4; + } + } + function findFirstSuperCall(node) { + return isSuperCall(node) ? node : isFunctionLike(node) ? void 0 : forEachChild(node, findFirstSuperCall); + } + function classDeclarationExtendsNull(classDecl) { + const classSymbol = getSymbolOfDeclaration(classDecl); + const classInstanceType = getDeclaredTypeOfSymbol(classSymbol); + const baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); + return baseConstructorType === nullWideningType; + } + function checkThisBeforeSuper(node, container, diagnosticMessage) { + const containingClassDecl = container.parent; + const baseTypeNode = getClassExtendsHeritageElement(containingClassDecl); + if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) { + if (canHaveFlowNode(node) && node.flowNode && !isPostSuperFlowNode( + node.flowNode, + /*noCacheCheck*/ + false + )) { + error22(node, diagnosticMessage); + } + } + } + function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) { + if (isPropertyDeclaration(container) && hasStaticModifier(container) && legacyDecorators && container.initializer && textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && hasDecorators(container.parent)) { + error22(thisExpression, Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class); + } + } + function checkThisExpression(node) { + const isNodeInTypeQuery = isInTypeQuery(node); + let container = getThisContainer( + node, + /*includeArrowFunctions*/ + true, + /*includeClassComputedPropertyName*/ + true + ); + let capturedByArrowFunction = false; + let thisInComputedPropertyName = false; + if (container.kind === 176) { + checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); + } + while (true) { + if (container.kind === 219) { + container = getThisContainer( + container, + /*includeArrowFunctions*/ + false, + !thisInComputedPropertyName + ); + capturedByArrowFunction = true; + } + if (container.kind === 167) { + container = getThisContainer( + container, + !capturedByArrowFunction, + /*includeClassComputedPropertyName*/ + false + ); + thisInComputedPropertyName = true; + continue; + } + break; + } + checkThisInStaticClassFieldInitializerInDecoratedClass(node, container); + if (thisInComputedPropertyName) { + error22(node, Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); + } else { + switch (container.kind) { + case 267: + error22(node, Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); + break; + case 266: + error22(node, Diagnostics.this_cannot_be_referenced_in_current_location); + break; + case 176: + if (isInConstructorArgumentInitializer(node, container)) { + error22(node, Diagnostics.this_cannot_be_referenced_in_constructor_arguments); + } + break; + } + } + if (!isNodeInTypeQuery && capturedByArrowFunction && languageVersion < 2) { + captureLexicalThis(node, container); + } + const type3 = tryGetThisTypeAt( + node, + /*includeGlobalThis*/ + true, + container + ); + if (noImplicitThis) { + const globalThisType2 = getTypeOfSymbol(globalThisSymbol); + if (type3 === globalThisType2 && capturedByArrowFunction) { + error22(node, Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this); + } else if (!type3) { + const diag2 = error22(node, Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + if (!isSourceFile(container)) { + const outsideThis = tryGetThisTypeAt(container); + if (outsideThis && outsideThis !== globalThisType2) { + addRelatedInfo(diag2, createDiagnosticForNode(container, Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container)); + } + } + } + } + return type3 || anyType2; + } + function tryGetThisTypeAt(node, includeGlobalThis = true, container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + )) { + const isInJS = isInJSFile(node); + if (isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || getThisParameter(container))) { + let thisType = getThisTypeOfDeclaration(container) || isInJS && getTypeForThisExpressionFromJSDoc(container); + if (!thisType) { + const className = getClassNameFromPrototypeMethod(container); + if (isInJS && className) { + const classSymbol = checkExpression(className).symbol; + if (classSymbol && classSymbol.members && classSymbol.flags & 16) { + thisType = getDeclaredTypeOfSymbol(classSymbol).thisType; + } + } else if (isJSConstructor(container)) { + thisType = getDeclaredTypeOfSymbol(getMergedSymbol(container.symbol)).thisType; + } + thisType || (thisType = getContextualThisParameterType(container)); + } + if (thisType) { + return getFlowTypeOfReference(node, thisType); + } + } + if (isClassLike(container.parent)) { + const symbol = getSymbolOfDeclaration(container.parent); + const type3 = isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; + return getFlowTypeOfReference(node, type3); + } + if (isSourceFile(container)) { + if (container.commonJsModuleIndicator) { + const fileSymbol = getSymbolOfDeclaration(container); + return fileSymbol && getTypeOfSymbol(fileSymbol); + } else if (container.externalModuleIndicator) { + return undefinedType2; + } else if (includeGlobalThis) { + return getTypeOfSymbol(globalThisSymbol); + } + } + } + function getExplicitThisType(node) { + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (isFunctionLike(container)) { + const signature = getSignatureFromDeclaration(container); + if (signature.thisParameter) { + return getExplicitTypeOfSymbol(signature.thisParameter); + } + } + if (isClassLike(container.parent)) { + const symbol = getSymbolOfDeclaration(container.parent); + return isStatic(container) ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol).thisType; + } + } + function getClassNameFromPrototypeMethod(container) { + if (container.kind === 218 && isBinaryExpression(container.parent) && getAssignmentDeclarationKind(container.parent) === 3) { + return container.parent.left.expression.expression; + } else if (container.kind === 174 && container.parent.kind === 210 && isBinaryExpression(container.parent.parent) && getAssignmentDeclarationKind(container.parent.parent) === 6) { + return container.parent.parent.left.expression; + } else if (container.kind === 218 && container.parent.kind === 303 && container.parent.parent.kind === 210 && isBinaryExpression(container.parent.parent.parent) && getAssignmentDeclarationKind(container.parent.parent.parent) === 6) { + return container.parent.parent.parent.left.expression; + } else if (container.kind === 218 && isPropertyAssignment(container.parent) && isIdentifier(container.parent.name) && (container.parent.name.escapedText === "value" || container.parent.name.escapedText === "get" || container.parent.name.escapedText === "set") && isObjectLiteralExpression(container.parent.parent) && isCallExpression(container.parent.parent.parent) && container.parent.parent.parent.arguments[2] === container.parent.parent && getAssignmentDeclarationKind(container.parent.parent.parent) === 9) { + return container.parent.parent.parent.arguments[0].expression; + } else if (isMethodDeclaration(container) && isIdentifier(container.name) && (container.name.escapedText === "value" || container.name.escapedText === "get" || container.name.escapedText === "set") && isObjectLiteralExpression(container.parent) && isCallExpression(container.parent.parent) && container.parent.parent.arguments[2] === container.parent && getAssignmentDeclarationKind(container.parent.parent) === 9) { + return container.parent.parent.arguments[0].expression; + } + } + function getTypeForThisExpressionFromJSDoc(node) { + const thisTag = getJSDocThisTag(node); + if (thisTag && thisTag.typeExpression) { + return getTypeFromTypeNode(thisTag.typeExpression); + } + const signature = getSignatureOfTypeTag(node); + if (signature) { + return getThisTypeOfSignature(signature); + } + } + function isInConstructorArgumentInitializer(node, constructorDecl) { + return !!findAncestor(node, (n7) => isFunctionLikeDeclaration(n7) ? "quit" : n7.kind === 169 && n7.parent === constructorDecl); + } + function checkSuperExpression(node) { + const isCallExpression2 = node.parent.kind === 213 && node.parent.expression === node; + const immediateContainer = getSuperContainer( + node, + /*stopOnFunctions*/ + true + ); + let container = immediateContainer; + let needToCaptureLexicalThis = false; + let inAsyncFunction = false; + if (!isCallExpression2) { + while (container && container.kind === 219) { + if (hasSyntacticModifier( + container, + 1024 + /* Async */ + )) + inAsyncFunction = true; + container = getSuperContainer( + container, + /*stopOnFunctions*/ + true + ); + needToCaptureLexicalThis = languageVersion < 2; + } + if (container && hasSyntacticModifier( + container, + 1024 + /* Async */ + )) + inAsyncFunction = true; + } + let nodeCheckFlag = 0; + if (!container || !isLegalUsageOfSuperExpression(container)) { + const current = findAncestor( + node, + (n7) => n7 === container ? "quit" : n7.kind === 167 + /* ComputedPropertyName */ + ); + if (current && current.kind === 167) { + error22(node, Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); + } else if (isCallExpression2) { + error22(node, Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); + } else if (!container || !container.parent || !(isClassLike(container.parent) || container.parent.kind === 210)) { + error22(node, Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); + } else { + error22(node, Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); + } + return errorType; + } + if (!isCallExpression2 && immediateContainer.kind === 176) { + checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); + } + if (isStatic(container) || isCallExpression2) { + nodeCheckFlag = 32; + if (!isCallExpression2 && languageVersion >= 2 && languageVersion <= 8 && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) { + forEachEnclosingBlockScopeContainer(node.parent, (current) => { + if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) { + getNodeLinks(current).flags |= 2097152; + } + }); + } + } else { + nodeCheckFlag = 16; + } + getNodeLinks(node).flags |= nodeCheckFlag; + if (container.kind === 174 && inAsyncFunction) { + if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) { + getNodeLinks(container).flags |= 256; + } else { + getNodeLinks(container).flags |= 128; + } + } + if (needToCaptureLexicalThis) { + captureLexicalThis(node.parent, container); + } + if (container.parent.kind === 210) { + if (languageVersion < 2) { + error22(node, Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); + return errorType; + } else { + return anyType2; + } + } + const classLikeDeclaration = container.parent; + if (!getClassExtendsHeritageElement(classLikeDeclaration)) { + error22(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class); + return errorType; + } + if (classDeclarationExtendsNull(classLikeDeclaration)) { + return isCallExpression2 ? errorType : nullWideningType; + } + const classType = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(classLikeDeclaration)); + const baseClassType = classType && getBaseTypes(classType)[0]; + if (!baseClassType) { + return errorType; + } + if (container.kind === 176 && isInConstructorArgumentInitializer(node, container)) { + error22(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments); + return errorType; + } + return nodeCheckFlag === 32 ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType); + function isLegalUsageOfSuperExpression(container2) { + if (isCallExpression2) { + return container2.kind === 176; + } else { + if (isClassLike(container2.parent) || container2.parent.kind === 210) { + if (isStatic(container2)) { + return container2.kind === 174 || container2.kind === 173 || container2.kind === 177 || container2.kind === 178 || container2.kind === 172 || container2.kind === 175; + } else { + return container2.kind === 174 || container2.kind === 173 || container2.kind === 177 || container2.kind === 178 || container2.kind === 172 || container2.kind === 171 || container2.kind === 176; + } + } + } + return false; + } + } + function getContainingObjectLiteral(func) { + return (func.kind === 174 || func.kind === 177 || func.kind === 178) && func.parent.kind === 210 ? func.parent : func.kind === 218 && func.parent.kind === 303 ? func.parent.parent : void 0; + } + function getThisTypeArgument(type3) { + return getObjectFlags(type3) & 4 && type3.target === globalThisType ? getTypeArguments(type3)[0] : void 0; + } + function getThisTypeFromContextualType(type3) { + return mapType2(type3, (t8) => { + return t8.flags & 2097152 ? forEach4(t8.types, getThisTypeArgument) : getThisTypeArgument(t8); + }); + } + function getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType) { + let literal = containingLiteral; + let type3 = contextualType; + while (type3) { + const thisType = getThisTypeFromContextualType(type3); + if (thisType) { + return thisType; + } + if (literal.parent.kind !== 303) { + break; + } + literal = literal.parent.parent; + type3 = getApparentTypeOfContextualType( + literal, + /*contextFlags*/ + void 0 + ); + } + } + function getContextualThisParameterType(func) { + if (func.kind === 219) { + return void 0; + } + if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + const contextualSignature = getContextualSignature(func); + if (contextualSignature) { + const thisParameter = contextualSignature.thisParameter; + if (thisParameter) { + return getTypeOfSymbol(thisParameter); + } + } + } + const inJs = isInJSFile(func); + if (noImplicitThis || inJs) { + const containingLiteral = getContainingObjectLiteral(func); + if (containingLiteral) { + const contextualType = getApparentTypeOfContextualType( + containingLiteral, + /*contextFlags*/ + void 0 + ); + const thisType = getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType); + if (thisType) { + return instantiateType(thisType, getMapperFromContext(getInferenceContext(containingLiteral))); + } + return getWidenedType(contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral)); + } + const parent22 = walkUpParenthesizedExpressions(func.parent); + if (isAssignmentExpression(parent22)) { + const target = parent22.left; + if (isAccessExpression(target)) { + const { expression } = target; + if (inJs && isIdentifier(expression)) { + const sourceFile = getSourceFileOfNode(parent22); + if (sourceFile.commonJsModuleIndicator && getResolvedSymbol(expression) === sourceFile.symbol) { + return void 0; + } + } + return getWidenedType(checkExpressionCached(expression)); + } + } + } + return void 0; + } + function getContextuallyTypedParameterType(parameter) { + const func = parameter.parent; + if (!isContextSensitiveFunctionOrObjectLiteralMethod(func)) { + return void 0; + } + const iife = getImmediatelyInvokedFunctionExpression(func); + if (iife && iife.arguments) { + const args = getEffectiveCallArguments(iife); + const indexOfParameter = func.parameters.indexOf(parameter); + if (parameter.dotDotDotToken) { + return getSpreadArgumentType( + args, + indexOfParameter, + args.length, + anyType2, + /*context*/ + void 0, + 0 + /* Normal */ + ); + } + const links = getNodeLinks(iife); + const cached = links.resolvedSignature; + links.resolvedSignature = anySignature; + const type3 = indexOfParameter < args.length ? getWidenedLiteralType(checkExpression(args[indexOfParameter])) : parameter.initializer ? void 0 : undefinedWideningType; + links.resolvedSignature = cached; + return type3; + } + const contextualSignature = getContextualSignature(func); + if (contextualSignature) { + const index4 = func.parameters.indexOf(parameter) - (getThisParameter(func) ? 1 : 0); + return parameter.dotDotDotToken && lastOrUndefined(func.parameters) === parameter ? getRestTypeAtPosition(contextualSignature, index4) : tryGetTypeAtPosition(contextualSignature, index4); + } + } + function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) { + const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? tryGetJSDocSatisfiesTypeNode(declaration) : void 0); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + switch (declaration.kind) { + case 169: + return getContextuallyTypedParameterType(declaration); + case 208: + return getContextualTypeForBindingElement(declaration, contextFlags); + case 172: + if (isStatic(declaration)) { + return getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags); + } + } + } + function getContextualTypeForBindingElement(declaration, contextFlags) { + const parent22 = declaration.parent.parent; + const name2 = declaration.propertyName || declaration.name; + const parentType = getContextualTypeForVariableLikeDeclaration(parent22, contextFlags) || parent22.kind !== 208 && parent22.initializer && checkDeclarationInitializer( + parent22, + declaration.dotDotDotToken ? 32 : 0 + /* Normal */ + ); + if (!parentType || isBindingPattern(name2) || isComputedNonLiteralName(name2)) + return void 0; + if (parent22.name.kind === 207) { + const index4 = indexOfNode(declaration.parent.elements, declaration); + if (index4 < 0) + return void 0; + return getContextualTypeForElementExpression(parentType, index4); + } + const nameType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(nameType)) { + const text = getPropertyNameFromType(nameType); + return getTypeOfPropertyOfType(parentType, text); + } + } + function getContextualTypeForStaticPropertyDeclaration(declaration, contextFlags) { + const parentType = isExpression(declaration.parent) && getContextualType2(declaration.parent, contextFlags); + if (!parentType) + return void 0; + return getTypeOfPropertyOfContextualType(parentType, getSymbolOfDeclaration(declaration).escapedName); + } + function getContextualTypeForInitializerExpression(node, contextFlags) { + const declaration = node.parent; + if (hasInitializer(declaration) && node === declaration.initializer) { + const result2 = getContextualTypeForVariableLikeDeclaration(declaration, contextFlags); + if (result2) { + return result2; + } + if (!(contextFlags & 8) && isBindingPattern(declaration.name) && declaration.name.elements.length > 0) { + return getTypeFromBindingPattern( + declaration.name, + /*includePatternInType*/ + true, + /*reportErrors*/ + false + ); + } + } + return void 0; + } + function getContextualTypeForReturnExpression(node, contextFlags) { + const func = getContainingFunction(node); + if (func) { + let contextualReturnType = getContextualReturnType(func, contextFlags); + if (contextualReturnType) { + const functionFlags = getFunctionFlags(func); + if (functionFlags & 1) { + const isAsyncGenerator = (functionFlags & 2) !== 0; + if (contextualReturnType.flags & 1048576) { + contextualReturnType = filterType(contextualReturnType, (type3) => !!getIterationTypeOfGeneratorFunctionReturnType(1, type3, isAsyncGenerator)); + } + const iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, contextualReturnType, (functionFlags & 2) !== 0); + if (!iterationReturnType) { + return void 0; + } + contextualReturnType = iterationReturnType; + } + if (functionFlags & 2) { + const contextualAwaitedType = mapType2(contextualReturnType, getAwaitedTypeNoAlias); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return contextualReturnType; + } + } + return void 0; + } + function getContextualTypeForAwaitOperand(node, contextFlags) { + const contextualType = getContextualType2(node, contextFlags); + if (contextualType) { + const contextualAwaitedType = getAwaitedTypeNoAlias(contextualType); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return void 0; + } + function getContextualTypeForYieldOperand(node, contextFlags) { + const func = getContainingFunction(node); + if (func) { + const functionFlags = getFunctionFlags(func); + let contextualReturnType = getContextualReturnType(func, contextFlags); + if (contextualReturnType) { + const isAsyncGenerator = (functionFlags & 2) !== 0; + if (!node.asteriskToken && contextualReturnType.flags & 1048576) { + contextualReturnType = filterType(contextualReturnType, (type3) => !!getIterationTypeOfGeneratorFunctionReturnType(1, type3, isAsyncGenerator)); + } + return node.asteriskToken ? contextualReturnType : getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType, isAsyncGenerator); + } + } + return void 0; + } + function isInParameterInitializerBeforeContainingFunction(node) { + let inBindingInitializer = false; + while (node.parent && !isFunctionLike(node.parent)) { + if (isParameter(node.parent) && (inBindingInitializer || node.parent.initializer === node)) { + return true; + } + if (isBindingElement(node.parent) && node.parent.initializer === node) { + inBindingInitializer = true; + } + node = node.parent; + } + return false; + } + function getContextualIterationType(kind, functionDecl) { + const isAsync2 = !!(getFunctionFlags(functionDecl) & 2); + const contextualReturnType = getContextualReturnType( + functionDecl, + /*contextFlags*/ + void 0 + ); + if (contextualReturnType) { + return getIterationTypeOfGeneratorFunctionReturnType(kind, contextualReturnType, isAsync2) || void 0; + } + return void 0; + } + function getContextualReturnType(functionDecl, contextFlags) { + const returnType = getReturnTypeFromAnnotation(functionDecl); + if (returnType) { + return returnType; + } + const signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); + if (signature && !isResolvingReturnTypeOfSignature(signature)) { + const returnType2 = getReturnTypeOfSignature(signature); + const functionFlags = getFunctionFlags(functionDecl); + if (functionFlags & 1) { + return filterType(returnType2, (t8) => { + return !!(t8.flags & (3 | 16384 | 58982400)) || checkGeneratorInstantiationAssignabilityToReturnType( + t8, + functionFlags, + /*errorNode*/ + void 0 + ); + }); + } + if (functionFlags & 2) { + return filterType(returnType2, (t8) => { + return !!(t8.flags & (3 | 16384 | 58982400)) || !!getAwaitedTypeOfPromise(t8); + }); + } + return returnType2; + } + const iife = getImmediatelyInvokedFunctionExpression(functionDecl); + if (iife) { + return getContextualType2(iife, contextFlags); + } + return void 0; + } + function getContextualTypeForArgument(callTarget, arg) { + const args = getEffectiveCallArguments(callTarget); + const argIndex = args.indexOf(arg); + return argIndex === -1 ? void 0 : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + if (isImportCall(callTarget)) { + return argIndex === 0 ? stringType2 : argIndex === 1 ? getGlobalImportCallOptionsType( + /*reportErrors*/ + false + ) : anyType2; + } + const signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + if (isJsxOpeningLikeElement(callTarget) && argIndex === 0) { + return getEffectiveFirstArgumentForJsxSignature(signature, callTarget); + } + const restIndex = signature.parameters.length - 1; + return signatureHasRestParameter(signature) && argIndex >= restIndex ? getIndexedAccessType( + getTypeOfSymbol(signature.parameters[restIndex]), + getNumberLiteralType(argIndex - restIndex), + 256 + /* Contextual */ + ) : getTypeAtPosition(signature, argIndex); + } + function getContextualTypeForDecorator(decorator) { + const signature = getDecoratorCallSignature(decorator); + return signature ? getOrCreateTypeFromSignature(signature) : void 0; + } + function getContextualTypeForSubstitutionExpression(template2, substitutionExpression) { + if (template2.parent.kind === 215) { + return getContextualTypeForArgument(template2.parent, substitutionExpression); + } + return void 0; + } + function getContextualTypeForBinaryOperand(node, contextFlags) { + const binaryExpression = node.parent; + const { left, operatorToken, right } = binaryExpression; + switch (operatorToken.kind) { + case 64: + case 77: + case 76: + case 78: + return node === right ? getContextualTypeForAssignmentDeclaration(binaryExpression) : void 0; + case 57: + case 61: + const type3 = getContextualType2(binaryExpression, contextFlags); + return node === right && (type3 && type3.pattern || !type3 && !isDefaultedExpandoInitializer(binaryExpression)) ? getTypeOfExpression(left) : type3; + case 56: + case 28: + return node === right ? getContextualType2(binaryExpression, contextFlags) : void 0; + default: + return void 0; + } + } + function getSymbolForExpression(e10) { + if (canHaveSymbol(e10) && e10.symbol) { + return e10.symbol; + } + if (isIdentifier(e10)) { + return getResolvedSymbol(e10); + } + if (isPropertyAccessExpression(e10)) { + const lhsType = getTypeOfExpression(e10.expression); + return isPrivateIdentifier(e10.name) ? tryGetPrivateIdentifierPropertyOfType(lhsType, e10.name) : getPropertyOfType(lhsType, e10.name.escapedText); + } + if (isElementAccessExpression(e10)) { + const propType = checkExpressionCached(e10.argumentExpression); + if (!isTypeUsableAsPropertyName(propType)) { + return void 0; + } + const lhsType = getTypeOfExpression(e10.expression); + return getPropertyOfType(lhsType, getPropertyNameFromType(propType)); + } + return void 0; + function tryGetPrivateIdentifierPropertyOfType(type3, id) { + const lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(id.escapedText, id); + return lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(type3, lexicallyScopedSymbol); + } + } + function getContextualTypeForAssignmentDeclaration(binaryExpression) { + var _a2, _b; + const kind = getAssignmentDeclarationKind(binaryExpression); + switch (kind) { + case 0: + case 4: + const lhsSymbol = getSymbolForExpression(binaryExpression.left); + const decl = lhsSymbol && lhsSymbol.valueDeclaration; + if (decl && (isPropertyDeclaration(decl) || isPropertySignature(decl))) { + const overallAnnotation = getEffectiveTypeAnnotationNode(decl); + return overallAnnotation && instantiateType(getTypeFromTypeNode(overallAnnotation), getSymbolLinks(lhsSymbol).mapper) || (isPropertyDeclaration(decl) ? decl.initializer && getTypeOfExpression(binaryExpression.left) : void 0); + } + if (kind === 0) { + return getTypeOfExpression(binaryExpression.left); + } + return getContextualTypeForThisPropertyAssignment(binaryExpression); + case 5: + if (isPossiblyAliasedThisProperty(binaryExpression, kind)) { + return getContextualTypeForThisPropertyAssignment(binaryExpression); + } else if (!canHaveSymbol(binaryExpression.left) || !binaryExpression.left.symbol) { + return getTypeOfExpression(binaryExpression.left); + } else { + const decl2 = binaryExpression.left.symbol.valueDeclaration; + if (!decl2) { + return void 0; + } + const lhs = cast(binaryExpression.left, isAccessExpression); + const overallAnnotation = getEffectiveTypeAnnotationNode(decl2); + if (overallAnnotation) { + return getTypeFromTypeNode(overallAnnotation); + } else if (isIdentifier(lhs.expression)) { + const id = lhs.expression; + const parentSymbol = resolveName( + id, + id.escapedText, + 111551, + /*nameNotFoundMessage*/ + void 0, + id.escapedText, + /*isUse*/ + true + ); + if (parentSymbol) { + const annotated2 = parentSymbol.valueDeclaration && getEffectiveTypeAnnotationNode(parentSymbol.valueDeclaration); + if (annotated2) { + const nameStr = getElementOrPropertyAccessName(lhs); + if (nameStr !== void 0) { + return getTypeOfPropertyOfContextualType(getTypeFromTypeNode(annotated2), nameStr); + } + } + return void 0; + } + } + return isInJSFile(decl2) || decl2 === binaryExpression.left ? void 0 : getTypeOfExpression(binaryExpression.left); + } + case 1: + case 6: + case 3: + case 2: + let valueDeclaration; + if (kind !== 2) { + valueDeclaration = canHaveSymbol(binaryExpression.left) ? (_a2 = binaryExpression.left.symbol) == null ? void 0 : _a2.valueDeclaration : void 0; + } + valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) == null ? void 0 : _b.valueDeclaration); + const annotated = valueDeclaration && getEffectiveTypeAnnotationNode(valueDeclaration); + return annotated ? getTypeFromTypeNode(annotated) : void 0; + case 7: + case 8: + case 9: + return Debug.fail("Does not apply"); + default: + return Debug.assertNever(kind); + } + } + function isPossiblyAliasedThisProperty(declaration, kind = getAssignmentDeclarationKind(declaration)) { + if (kind === 4) { + return true; + } + if (!isInJSFile(declaration) || kind !== 5 || !isIdentifier(declaration.left.expression)) { + return false; + } + const name2 = declaration.left.expression.escapedText; + const symbol = resolveName( + declaration.left, + name2, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true, + /*excludeGlobals*/ + true + ); + return isThisInitializedDeclaration(symbol == null ? void 0 : symbol.valueDeclaration); + } + function getContextualTypeForThisPropertyAssignment(binaryExpression) { + if (!binaryExpression.symbol) + return getTypeOfExpression(binaryExpression.left); + if (binaryExpression.symbol.valueDeclaration) { + const annotated = getEffectiveTypeAnnotationNode(binaryExpression.symbol.valueDeclaration); + if (annotated) { + const type3 = getTypeFromTypeNode(annotated); + if (type3) { + return type3; + } + } + } + const thisAccess = cast(binaryExpression.left, isAccessExpression); + if (!isObjectLiteralMethod(getThisContainer( + thisAccess.expression, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ))) { + return void 0; + } + const thisType = checkThisExpression(thisAccess.expression); + const nameStr = getElementOrPropertyAccessName(thisAccess); + return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0; + } + function isCircularMappedProperty(symbol) { + return !!(getCheckFlags(symbol) & 262144 && !symbol.links.type && findResolutionCycleStartIndex( + symbol, + 0 + /* Type */ + ) >= 0); + } + function getTypeOfPropertyOfContextualType(type3, name2, nameType) { + return mapType2( + type3, + (t8) => { + var _a2; + if (isGenericMappedType(t8) && !t8.declaration.nameType) { + const constraint = getConstraintTypeFromMappedType(t8); + const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint; + const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name2)); + if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) { + return substituteIndexedMappedType(t8, propertyNameType); + } + } else if (t8.flags & 3670016) { + const prop = getPropertyOfType(t8, name2); + if (prop) { + return isCircularMappedProperty(prop) ? void 0 : removeMissingType(getTypeOfSymbol(prop), !!(prop && prop.flags & 16777216)); + } + if (isTupleType(t8) && isNumericLiteralName(name2) && +name2 >= 0) { + const restType = getElementTypeOfSliceOfTupleType( + t8, + t8.target.fixedLength, + /*endSkipCount*/ + 0, + /*writing*/ + false, + /*noReductions*/ + true + ); + if (restType) { + return restType; + } + } + return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t8), nameType || getStringLiteralType(unescapeLeadingUnderscores(name2)))) == null ? void 0 : _a2.type; + } + return void 0; + }, + /*noReductions*/ + true + ); + } + function getContextualTypeForObjectLiteralMethod(node, contextFlags) { + Debug.assert(isObjectLiteralMethod(node)); + if (node.flags & 67108864) { + return void 0; + } + return getContextualTypeForObjectLiteralElement(node, contextFlags); + } + function getContextualTypeForObjectLiteralElement(element, contextFlags) { + const objectLiteral = element.parent; + const propertyAssignmentType = isPropertyAssignment(element) && getContextualTypeForVariableLikeDeclaration(element, contextFlags); + if (propertyAssignmentType) { + return propertyAssignmentType; + } + const type3 = getApparentTypeOfContextualType(objectLiteral, contextFlags); + if (type3) { + if (hasBindableName(element)) { + const symbol = getSymbolOfDeclaration(element); + return getTypeOfPropertyOfContextualType(type3, symbol.escapedName, getSymbolLinks(symbol).nameType); + } + if (hasDynamicName(element)) { + const name2 = getNameOfDeclaration(element); + if (name2 && isComputedPropertyName(name2)) { + const exprType = checkExpression(name2.expression); + const propType = isTypeUsableAsPropertyName(exprType) && getTypeOfPropertyOfContextualType(type3, getPropertyNameFromType(exprType)); + if (propType) { + return propType; + } + } + } + if (element.name) { + const nameType = getLiteralTypeFromPropertyName(element.name); + return mapType2( + type3, + (t8) => { + var _a2; + return (_a2 = findApplicableIndexInfo(getIndexInfosOfStructuredType(t8), nameType)) == null ? void 0 : _a2.type; + }, + /*noReductions*/ + true + ); + } + } + return void 0; + } + function getSpreadIndices(elements) { + let first2, last22; + for (let i7 = 0; i7 < elements.length; i7++) { + if (isSpreadElement(elements[i7])) { + first2 ?? (first2 = i7); + last22 = i7; + } + } + return { first: first2, last: last22 }; + } + function getContextualTypeForElementExpression(type3, index4, length2, firstSpreadIndex, lastSpreadIndex) { + return type3 && mapType2( + type3, + (t8) => { + if (isTupleType(t8)) { + if ((firstSpreadIndex === void 0 || index4 < firstSpreadIndex) && index4 < t8.target.fixedLength) { + return removeMissingType(getTypeArguments(t8)[index4], !!(t8.target.elementFlags[index4] && 2)); + } + const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index4 > lastSpreadIndex) ? length2 - index4 : 0; + const fixedEndLength = offset > 0 && t8.target.hasRestElement ? getEndElementCount( + t8.target, + 3 + /* Fixed */ + ) : 0; + if (offset > 0 && offset <= fixedEndLength) { + return getTypeArguments(t8)[getTypeReferenceArity(t8) - offset]; + } + return getElementTypeOfSliceOfTupleType( + t8, + firstSpreadIndex === void 0 ? t8.target.fixedLength : Math.min(t8.target.fixedLength, firstSpreadIndex), + length2 === void 0 || lastSpreadIndex === void 0 ? fixedEndLength : Math.min(fixedEndLength, length2 - lastSpreadIndex), + /*writing*/ + false, + /*noReductions*/ + true + ); + } + return (!firstSpreadIndex || index4 < firstSpreadIndex) && getTypeOfPropertyOfContextualType(t8, "" + index4) || getIteratedTypeOrElementType( + 1, + t8, + undefinedType2, + /*errorNode*/ + void 0, + /*checkAssignability*/ + false + ); + }, + /*noReductions*/ + true + ); + } + function getContextualTypeForConditionalOperand(node, contextFlags) { + const conditional = node.parent; + return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0; + } + function getContextualTypeForChildJsxExpression(node, child, contextFlags) { + const attributesType = getApparentTypeOfContextualType(node.openingElement.attributes, contextFlags); + const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) { + return void 0; + } + const realChildren = getSemanticJsxChildren(node.children); + const childIndex = realChildren.indexOf(child); + const childFieldType = getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName); + return childFieldType && (realChildren.length === 1 ? childFieldType : mapType2( + childFieldType, + (t8) => { + if (isArrayLikeType(t8)) { + return getIndexedAccessType(t8, getNumberLiteralType(childIndex)); + } else { + return t8; + } + }, + /*noReductions*/ + true + )); + } + function getContextualTypeForJsxExpression(node, contextFlags) { + const exprParent = node.parent; + return isJsxAttributeLike(exprParent) ? getContextualType2(node, contextFlags) : isJsxElement(exprParent) ? getContextualTypeForChildJsxExpression(exprParent, node, contextFlags) : void 0; + } + function getContextualTypeForJsxAttribute(attribute, contextFlags) { + if (isJsxAttribute(attribute)) { + const attributesType = getApparentTypeOfContextualType(attribute.parent, contextFlags); + if (!attributesType || isTypeAny(attributesType)) { + return void 0; + } + return getTypeOfPropertyOfContextualType(attributesType, getEscapedTextOfJsxAttributeName(attribute.name)); + } else { + return getContextualType2(attribute.parent, contextFlags); + } + } + function isPossiblyDiscriminantValue(node) { + switch (node.kind) { + case 11: + case 9: + case 10: + case 15: + case 228: + case 112: + case 97: + case 106: + case 80: + case 157: + return true; + case 211: + case 217: + return isPossiblyDiscriminantValue(node.expression); + case 294: + return !node.expression || isPossiblyDiscriminantValue(node.expression); + } + return false; + } + function discriminateContextualTypeByObjectMembers(node, contextualType) { + return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems( + contextualType, + concatenate( + map4( + filter2(node.properties, (p7) => { + if (!p7.symbol) { + return false; + } + if (p7.kind === 303) { + return isPossiblyDiscriminantValue(p7.initializer) && isDiscriminantProperty(contextualType, p7.symbol.escapedName); + } + if (p7.kind === 304) { + return isDiscriminantProperty(contextualType, p7.symbol.escapedName); + } + return false; + }), + (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 ? prop.initializer : prop.name), prop.symbol.escapedName] + ), + map4( + filter2(getPropertiesOfType(contextualType), (s7) => { + var _a2; + return !!(s7.flags & 16777216) && !!((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members) && !node.symbol.members.has(s7.escapedName) && isDiscriminantProperty(contextualType, s7.escapedName); + }), + (s7) => [() => undefinedType2, s7.escapedName] + ) + ), + isTypeAssignableTo + ); + } + function discriminateContextualTypeByJSXAttributes(node, contextualType) { + const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); + return discriminateTypeByDiscriminableItems( + contextualType, + concatenate( + map4( + filter2(node.properties, (p7) => !!p7.symbol && p7.kind === 291 && isDiscriminantProperty(contextualType, p7.symbol.escapedName) && (!p7.initializer || isPossiblyDiscriminantValue(p7.initializer))), + (prop) => [!prop.initializer ? () => trueType : () => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName] + ), + map4( + filter2(getPropertiesOfType(contextualType), (s7) => { + var _a2; + if (!(s7.flags & 16777216) || !((_a2 = node == null ? void 0 : node.symbol) == null ? void 0 : _a2.members)) { + return false; + } + const element = node.parent.parent; + if (s7.escapedName === jsxChildrenPropertyName && isJsxElement(element) && getSemanticJsxChildren(element.children).length) { + return false; + } + return !node.symbol.members.has(s7.escapedName) && isDiscriminantProperty(contextualType, s7.escapedName); + }), + (s7) => [() => undefinedType2, s7.escapedName] + ) + ), + isTypeAssignableTo + ); + } + function getApparentTypeOfContextualType(node, contextFlags) { + const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags); + const instantiatedType = instantiateContextualType(contextualType, node, contextFlags); + if (instantiatedType && !(contextFlags && contextFlags & 2 && instantiatedType.flags & 8650752)) { + const apparentType = mapType2( + instantiatedType, + // When obtaining apparent type of *contextual* type we don't want to get apparent type of mapped types. + // That would evaluate mapped types with array or tuple type constraints too eagerly + // and thus it would prevent `getTypeOfPropertyOfContextualType` from obtaining per-position contextual type for elements of array literal expressions. + // Apparent type of other mapped types is already the mapped type itself so we can just avoid calling `getApparentType` here for all mapped types. + (t8) => getObjectFlags(t8) & 32 ? t8 : getApparentType(t8), + /*noReductions*/ + true + ); + return apparentType.flags & 1048576 && isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) : apparentType.flags & 1048576 && isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) : apparentType; + } + } + function instantiateContextualType(contextualType, node, contextFlags) { + if (contextualType && maybeTypeOfKind( + contextualType, + 465829888 + /* Instantiable */ + )) { + const inferenceContext = getInferenceContext(node); + if (inferenceContext && contextFlags & 1 && some2(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) { + return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper); + } + if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) { + const type3 = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper); + return type3.flags & 1048576 && containsType(type3.types, regularFalseType) && containsType(type3.types, regularTrueType) ? filterType(type3, (t8) => t8 !== regularFalseType && t8 !== regularTrueType) : type3; + } + } + return contextualType; + } + function instantiateInstantiableTypes(type3, mapper) { + if (type3.flags & 465829888) { + return instantiateType(type3, mapper); + } + if (type3.flags & 1048576) { + return getUnionType( + map4(type3.types, (t8) => instantiateInstantiableTypes(t8, mapper)), + 0 + /* None */ + ); + } + if (type3.flags & 2097152) { + return getIntersectionType(map4(type3.types, (t8) => instantiateInstantiableTypes(t8, mapper))); + } + return type3; + } + function getContextualType2(node, contextFlags) { + var _a2; + if (node.flags & 67108864) { + return void 0; + } + const index4 = findContextualNode( + node, + /*includeCaches*/ + !contextFlags + ); + if (index4 >= 0) { + return contextualTypes[index4]; + } + const { parent: parent22 } = node; + switch (parent22.kind) { + case 260: + case 169: + case 172: + case 171: + case 208: + return getContextualTypeForInitializerExpression(node, contextFlags); + case 219: + case 253: + return getContextualTypeForReturnExpression(node, contextFlags); + case 229: + return getContextualTypeForYieldOperand(parent22, contextFlags); + case 223: + return getContextualTypeForAwaitOperand(parent22, contextFlags); + case 213: + case 214: + return getContextualTypeForArgument(parent22, node); + case 170: + return getContextualTypeForDecorator(parent22); + case 216: + case 234: + return isConstTypeReference(parent22.type) ? getContextualType2(parent22, contextFlags) : getTypeFromTypeNode(parent22.type); + case 226: + return getContextualTypeForBinaryOperand(node, contextFlags); + case 303: + case 304: + return getContextualTypeForObjectLiteralElement(parent22, contextFlags); + case 305: + return getContextualType2(parent22.parent, contextFlags); + case 209: { + const arrayLiteral = parent22; + const type3 = getApparentTypeOfContextualType(arrayLiteral, contextFlags); + const elementIndex = indexOfNode(arrayLiteral.elements, node); + const spreadIndices = (_a2 = getNodeLinks(arrayLiteral)).spreadIndices ?? (_a2.spreadIndices = getSpreadIndices(arrayLiteral.elements)); + return getContextualTypeForElementExpression(type3, elementIndex, arrayLiteral.elements.length, spreadIndices.first, spreadIndices.last); + } + case 227: + return getContextualTypeForConditionalOperand(node, contextFlags); + case 239: + Debug.assert( + parent22.parent.kind === 228 + /* TemplateExpression */ + ); + return getContextualTypeForSubstitutionExpression(parent22.parent, node); + case 217: { + if (isInJSFile(parent22)) { + if (isJSDocSatisfiesExpression(parent22)) { + return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent22)); + } + const typeTag = getJSDocTypeTag(parent22); + if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) { + return getTypeFromTypeNode(typeTag.typeExpression.type); + } + } + return getContextualType2(parent22, contextFlags); + } + case 235: + return getContextualType2(parent22, contextFlags); + case 238: + return getTypeFromTypeNode(parent22.type); + case 277: + return tryGetTypeFromEffectiveTypeNode(parent22); + case 294: + return getContextualTypeForJsxExpression(parent22, contextFlags); + case 291: + case 293: + return getContextualTypeForJsxAttribute(parent22, contextFlags); + case 286: + case 285: + return getContextualJsxElementAttributesType(parent22, contextFlags); + case 301: + return getContextualImportAttributeType(parent22); + } + return void 0; + } + function pushCachedContextualType(node) { + pushContextualType( + node, + getContextualType2( + node, + /*contextFlags*/ + void 0 + ), + /*isCache*/ + true + ); + } + function pushContextualType(node, type3, isCache) { + contextualTypeNodes[contextualTypeCount] = node; + contextualTypes[contextualTypeCount] = type3; + contextualIsCache[contextualTypeCount] = isCache; + contextualTypeCount++; + } + function popContextualType() { + contextualTypeCount--; + } + function findContextualNode(node, includeCaches) { + for (let i7 = contextualTypeCount - 1; i7 >= 0; i7--) { + if (node === contextualTypeNodes[i7] && (includeCaches || !contextualIsCache[i7])) { + return i7; + } + } + return -1; + } + function pushInferenceContext(node, inferenceContext) { + inferenceContextNodes[inferenceContextCount] = node; + inferenceContexts[inferenceContextCount] = inferenceContext; + inferenceContextCount++; + } + function popInferenceContext() { + inferenceContextCount--; + } + function getInferenceContext(node) { + for (let i7 = inferenceContextCount - 1; i7 >= 0; i7--) { + if (isNodeDescendantOf(node, inferenceContextNodes[i7])) { + return inferenceContexts[i7]; + } + } + } + function getContextualImportAttributeType(node) { + return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType( + /*reportErrors*/ + false + ), getNameFromImportAttribute(node)); + } + function getContextualJsxElementAttributesType(node, contextFlags) { + if (isJsxOpeningElement(node) && contextFlags !== 4) { + const index4 = findContextualNode( + node.parent, + /*includeCaches*/ + !contextFlags + ); + if (index4 >= 0) { + return contextualTypes[index4]; + } + } + return getContextualTypeForArgumentAtIndex(node, 0); + } + function getEffectiveFirstArgumentForJsxSignature(signature, node) { + return getJsxReferenceKind(node) !== 0 ? getJsxPropsTypeFromCallSignature(signature, node) : getJsxPropsTypeFromClassType(signature, node); + } + function getJsxPropsTypeFromCallSignature(sig, context2) { + let propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType2); + propsType = getJsxManagedAttributesFromLocatedAttributes(context2, getJsxNamespaceAt(context2), propsType); + const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context2); + if (!isErrorType(intrinsicAttribs)) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation) { + if (sig.compositeSignatures) { + const results = []; + for (const signature of sig.compositeSignatures) { + const instance = getReturnTypeOfSignature(signature); + if (isTypeAny(instance)) { + return instance; + } + const propType = getTypeOfPropertyOfType(instance, forcedLookupLocation); + if (!propType) { + return; + } + results.push(propType); + } + return getIntersectionType(results); + } + const instanceType = getReturnTypeOfSignature(sig); + return isTypeAny(instanceType) ? instanceType : getTypeOfPropertyOfType(instanceType, forcedLookupLocation); + } + function getStaticTypeOfReferencedJsxConstructor(context2) { + if (isJsxIntrinsicTagName(context2.tagName)) { + const result2 = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(context2); + const fakeSignature = createSignatureForJSXIntrinsic(context2, result2); + return getOrCreateTypeFromSignature(fakeSignature); + } + const tagType = checkExpressionCached(context2.tagName); + if (tagType.flags & 128) { + const result2 = getIntrinsicAttributesTypeFromStringLiteralType(tagType, context2); + if (!result2) { + return errorType; + } + const fakeSignature = createSignatureForJSXIntrinsic(context2, result2); + return getOrCreateTypeFromSignature(fakeSignature); + } + return tagType; + } + function getJsxManagedAttributesFromLocatedAttributes(context2, ns, attributesType) { + const managedSym = getJsxLibraryManagedAttributes(ns); + if (managedSym) { + const ctorType = getStaticTypeOfReferencedJsxConstructor(context2); + const result2 = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context2), ctorType, attributesType); + if (result2) { + return result2; + } + } + return attributesType; + } + function getJsxPropsTypeFromClassType(sig, context2) { + const ns = getJsxNamespaceAt(context2); + const forcedLookupLocation = getJsxElementPropertiesName(ns); + let attributesType = forcedLookupLocation === void 0 ? getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType2) : forcedLookupLocation === "" ? getReturnTypeOfSignature(sig) : getJsxPropsTypeForSignatureFromMember(sig, forcedLookupLocation); + if (!attributesType) { + if (!!forcedLookupLocation && !!length(context2.attributes.properties)) { + error22(context2, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(forcedLookupLocation)); + } + return unknownType2; + } + attributesType = getJsxManagedAttributesFromLocatedAttributes(context2, ns, attributesType); + if (isTypeAny(attributesType)) { + return attributesType; + } else { + let apparentAttributesType = attributesType; + const intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context2); + if (!isErrorType(intrinsicClassAttribs)) { + const typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + const hostClassType = getReturnTypeOfSignature(sig); + let libraryManagedAttributeType; + if (typeParams) { + const inferredArgs = fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isInJSFile(context2)); + libraryManagedAttributeType = instantiateType(intrinsicClassAttribs, createTypeMapper(typeParams, inferredArgs)); + } else + libraryManagedAttributeType = intrinsicClassAttribs; + apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType); + } + const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context2); + if (!isErrorType(intrinsicAttribs)) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + function getIntersectedSignatures(signatures) { + return getStrictOptionValue(compilerOptions, "noImplicitAny") ? reduceLeft( + signatures, + (left, right) => left === right || !left ? left : compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right) : void 0 + ) : void 0; + } + function combineIntersectionThisParam(left, right, mapper) { + if (!left || !right) { + return left || right; + } + const thisType = getUnionType([getTypeOfSymbol(left), instantiateType(getTypeOfSymbol(right), mapper)]); + return createSymbolWithType(left, thisType); + } + function combineIntersectionParameters(left, right, mapper) { + const leftCount = getParameterCount(left); + const rightCount = getParameterCount(right); + const longest = leftCount >= rightCount ? left : right; + const shorter = longest === left ? right : left; + const longestCount = longest === left ? leftCount : rightCount; + const eitherHasEffectiveRest = hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right); + const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest); + const params = new Array(longestCount + (needsExtraRestElement ? 1 : 0)); + for (let i7 = 0; i7 < longestCount; i7++) { + let longestParamType = tryGetTypeAtPosition(longest, i7); + if (longest === right) { + longestParamType = instantiateType(longestParamType, mapper); + } + let shorterParamType = tryGetTypeAtPosition(shorter, i7) || unknownType2; + if (shorter === right) { + shorterParamType = instantiateType(shorterParamType, mapper); + } + const unionParamType = getUnionType([longestParamType, shorterParamType]); + const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i7 === longestCount - 1; + const isOptional2 = i7 >= getMinArgumentCount(longest) && i7 >= getMinArgumentCount(shorter); + const leftName = i7 >= leftCount ? void 0 : getParameterNameAtPosition(left, i7); + const rightName = i7 >= rightCount ? void 0 : getParameterNameAtPosition(right, i7); + const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0; + const paramSymbol = createSymbol( + 1 | (isOptional2 && !isRestParam ? 16777216 : 0), + paramName || `arg${i7}` + ); + paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType; + params[i7] = paramSymbol; + } + if (needsExtraRestElement) { + const restParamSymbol = createSymbol(1, "args"); + restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount)); + if (shorter === right) { + restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper); + } + params[longestCount] = restParamSymbol; + } + return params; + } + function combineSignaturesOfIntersectionMembers(left, right) { + const typeParams = left.typeParameters || right.typeParameters; + let paramMapper; + if (left.typeParameters && right.typeParameters) { + paramMapper = createTypeMapper(right.typeParameters, left.typeParameters); + } + const declaration = left.declaration; + const params = combineIntersectionParameters(left, right, paramMapper); + const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper); + const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount); + const result2 = createSignature( + declaration, + typeParams, + thisParam, + params, + /*resolvedReturnType*/ + void 0, + /*resolvedTypePredicate*/ + void 0, + minArgCount, + (left.flags | right.flags) & 167 + /* PropagatingFlags */ + ); + result2.compositeKind = 2097152; + result2.compositeSignatures = concatenate(left.compositeKind === 2097152 && left.compositeSignatures || [left], [right]); + if (paramMapper) { + result2.mapper = left.compositeKind === 2097152 && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper; + } + return result2; + } + function getContextualCallSignature(type3, node) { + const signatures = getSignaturesOfType( + type3, + 0 + /* Call */ + ); + const applicableByArity = filter2(signatures, (s7) => !isAritySmaller(s7, node)); + return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity); + } + function isAritySmaller(signature, target) { + let targetParameterCount = 0; + for (; targetParameterCount < target.parameters.length; targetParameterCount++) { + const param = target.parameters[targetParameterCount]; + if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) { + break; + } + } + if (target.parameters.length && parameterIsThisKeyword(target.parameters[0])) { + targetParameterCount--; + } + return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount; + } + function getContextualSignatureForFunctionLikeDeclaration(node) { + return isFunctionExpressionOrArrowFunction(node) || isObjectLiteralMethod(node) ? getContextualSignature(node) : void 0; + } + function getContextualSignature(node) { + Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node)); + const typeTagSignature = getSignatureOfTypeTag(node); + if (typeTagSignature) { + return typeTagSignature; + } + const type3 = getApparentTypeOfContextualType( + node, + 1 + /* Signature */ + ); + if (!type3) { + return void 0; + } + if (!(type3.flags & 1048576)) { + return getContextualCallSignature(type3, node); + } + let signatureList; + const types3 = type3.types; + for (const current of types3) { + const signature = getContextualCallSignature(current, node); + if (signature) { + if (!signatureList) { + signatureList = [signature]; + } else if (!compareSignaturesIdentical( + signatureList[0], + signature, + /*partialMatch*/ + false, + /*ignoreThisTypes*/ + true, + /*ignoreReturnTypes*/ + true, + compareTypesIdentical + )) { + return void 0; + } else { + signatureList.push(signature); + } + } + } + if (signatureList) { + return signatureList.length === 1 ? signatureList[0] : createUnionSignature(signatureList[0], signatureList); + } + } + function checkSpreadExpression(node, checkMode) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + node, + compilerOptions.downlevelIteration ? 1536 : 1024 + /* SpreadArray */ + ); + } + const arrayOrIterableType = checkExpression(node.expression, checkMode); + return checkIteratedTypeOrElementType(33, arrayOrIterableType, undefinedType2, node.expression); + } + function checkSyntheticExpression(node) { + return node.isSpread ? getIndexedAccessType(node.type, numberType2) : node.type; + } + function hasDefaultValue(node) { + return node.kind === 208 && !!node.initializer || node.kind === 226 && node.operatorToken.kind === 64; + } + function isSpreadIntoCallOrNew(node) { + const parent22 = walkUpParenthesizedExpressions(node.parent); + return isSpreadElement(parent22) && isCallOrNewExpression(parent22.parent); + } + function checkArrayLiteral(node, checkMode, forceTuple) { + const elements = node.elements; + const elementCount = elements.length; + const elementTypes = []; + const elementFlags = []; + pushCachedContextualType(node); + const inDestructuringPattern = isAssignmentTarget(node); + const inConstContext = isConstContext(node); + const contextualType = getApparentTypeOfContextualType( + node, + /*contextFlags*/ + void 0 + ); + const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, (t8) => isTupleLikeType(t8) || isGenericMappedType(t8) && !t8.nameType && !!getHomomorphicTypeVariable(t8.target || t8)); + let hasOmittedExpression = false; + for (let i7 = 0; i7 < elementCount; i7++) { + const e10 = elements[i7]; + if (e10.kind === 230) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + e10, + compilerOptions.downlevelIteration ? 1536 : 1024 + /* SpreadArray */ + ); + } + const spreadType = checkExpression(e10.expression, checkMode, forceTuple); + if (isArrayLikeType(spreadType)) { + elementTypes.push(spreadType); + elementFlags.push( + 8 + /* Variadic */ + ); + } else if (inDestructuringPattern) { + const restElementType = getIndexTypeOfType(spreadType, numberType2) || getIteratedTypeOrElementType( + 65, + spreadType, + undefinedType2, + /*errorNode*/ + void 0, + /*checkAssignability*/ + false + ) || unknownType2; + elementTypes.push(restElementType); + elementFlags.push( + 4 + /* Rest */ + ); + } else { + elementTypes.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType2, e10.expression)); + elementFlags.push( + 4 + /* Rest */ + ); + } + } else if (exactOptionalPropertyTypes && e10.kind === 232) { + hasOmittedExpression = true; + elementTypes.push(undefinedOrMissingType); + elementFlags.push( + 2 + /* Optional */ + ); + } else { + const type3 = checkExpressionForMutableLocation(e10, checkMode, forceTuple); + elementTypes.push(addOptionality( + type3, + /*isProperty*/ + true, + hasOmittedExpression + )); + elementFlags.push( + hasOmittedExpression ? 2 : 1 + /* Required */ + ); + if (inTupleContext && checkMode && checkMode & 2 && !(checkMode & 4) && isContextSensitive(e10)) { + const inferenceContext = getInferenceContext(node); + Debug.assert(inferenceContext); + addIntraExpressionInferenceSite(inferenceContext, e10, type3); + } + } + } + popContextualType(); + if (inDestructuringPattern) { + return createTupleType(elementTypes, elementFlags); + } + if (forceTuple || inConstContext || inTupleContext) { + return createArrayLiteralType(createTupleType( + elementTypes, + elementFlags, + /*readonly*/ + inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType)) + )); + } + return createArrayLiteralType(createArrayType( + elementTypes.length ? getUnionType( + sameMap(elementTypes, (t8, i7) => elementFlags[i7] & 8 ? getIndexedAccessTypeOrUndefined(t8, numberType2) || anyType2 : t8), + 2 + /* Subtype */ + ) : strictNullChecks ? implicitNeverType : undefinedWideningType, + inConstContext + )); + } + function createArrayLiteralType(type3) { + if (!(getObjectFlags(type3) & 4)) { + return type3; + } + let literalType2 = type3.literalType; + if (!literalType2) { + literalType2 = type3.literalType = cloneTypeReference(type3); + literalType2.objectFlags |= 16384 | 131072; + } + return literalType2; + } + function isNumericName(name2) { + switch (name2.kind) { + case 167: + return isNumericComputedName(name2); + case 80: + return isNumericLiteralName(name2.escapedText); + case 9: + case 11: + return isNumericLiteralName(name2.text); + default: + return false; + } + } + function isNumericComputedName(name2) { + return isTypeAssignableToKind( + checkComputedPropertyName(name2), + 296 + /* NumberLike */ + ); + } + function checkComputedPropertyName(node) { + const links = getNodeLinks(node.expression); + if (!links.resolvedType) { + if ((isTypeLiteralNode(node.parent.parent) || isClassLike(node.parent.parent) || isInterfaceDeclaration(node.parent.parent)) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 103 && node.parent.kind !== 177 && node.parent.kind !== 178) { + return links.resolvedType = errorType; + } + links.resolvedType = checkExpression(node.expression); + if (isPropertyDeclaration(node.parent) && !hasStaticModifier(node.parent) && isClassExpression(node.parent.parent)) { + const container = getEnclosingBlockScopeContainer(node.parent.parent); + const enclosingIterationStatement = getEnclosingIterationStatement(container); + if (enclosingIterationStatement) { + getNodeLinks(enclosingIterationStatement).flags |= 4096; + getNodeLinks(node).flags |= 32768; + getNodeLinks(node.parent.parent).flags |= 32768; + } + } + if (links.resolvedType.flags & 98304 || !isTypeAssignableToKind( + links.resolvedType, + 402653316 | 296 | 12288 + /* ESSymbolLike */ + ) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) { + error22(node, Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); + } + } + return links.resolvedType; + } + function isSymbolWithNumericName(symbol) { + var _a2; + const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0]; + return isNumericLiteralName(symbol.escapedName) || firstDecl && isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name); + } + function isSymbolWithSymbolName(symbol) { + var _a2; + const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0]; + return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind( + checkComputedPropertyName(firstDecl.name), + 4096 + /* ESSymbol */ + ); + } + function getObjectLiteralIndexInfo(node, offset, properties, keyType) { + const propTypes = []; + for (let i7 = offset; i7 < properties.length; i7++) { + const prop = properties[i7]; + if (keyType === stringType2 && !isSymbolWithSymbolName(prop) || keyType === numberType2 && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) { + propTypes.push(getTypeOfSymbol(properties[i7])); + } + } + const unionType2 = propTypes.length ? getUnionType( + propTypes, + 2 + /* Subtype */ + ) : undefinedType2; + return createIndexInfo(keyType, unionType2, isConstContext(node)); + } + function getImmediateAliasedSymbol(symbol) { + Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here."); + const links = getSymbolLinks(symbol); + if (!links.immediateTarget) { + const node = getDeclarationOfAliasSymbol(symbol); + if (!node) + return Debug.fail(); + links.immediateTarget = getTargetOfAliasDeclaration( + node, + /*dontRecursivelyResolve*/ + true + ); + } + return links.immediateTarget; + } + function checkObjectLiteral(node, checkMode = 0) { + var _a2; + const inDestructuringPattern = isAssignmentTarget(node); + checkGrammarObjectLiteralExpression(node, inDestructuringPattern); + const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0; + let propertiesTable = createSymbolTable(); + let propertiesArray = []; + let spread2 = emptyObjectType; + pushCachedContextualType(node); + const contextualType = getApparentTypeOfContextualType( + node, + /*contextFlags*/ + void 0 + ); + const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === 206 || contextualType.pattern.kind === 210); + const inConstContext = isConstContext(node); + const checkFlags = inConstContext ? 8 : 0; + const isInJavascript = isInJSFile(node) && !isInJsonFile(node); + const enumTag = isInJavascript ? getJSDocEnumTag(node) : void 0; + const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag; + let objectFlags = freshObjectLiteralFlag; + let patternWithComputedProperties = false; + let hasComputedStringProperty = false; + let hasComputedNumberProperty = false; + let hasComputedSymbolProperty = false; + for (const elem of node.properties) { + if (elem.name && isComputedPropertyName(elem.name)) { + checkComputedPropertyName(elem.name); + } + } + let offset = 0; + for (const memberDecl of node.properties) { + let member = getSymbolOfDeclaration(memberDecl); + const computedNameType = memberDecl.name && memberDecl.name.kind === 167 ? checkComputedPropertyName(memberDecl.name) : void 0; + if (memberDecl.kind === 303 || memberDecl.kind === 304 || isObjectLiteralMethod(memberDecl)) { + let type3 = memberDecl.kind === 303 ? checkPropertyAssignment(memberDecl, checkMode) : ( + // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring + // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`. + // we don't want to say "could not find 'a'". + memberDecl.kind === 304 ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode) + ); + if (isInJavascript) { + const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl); + if (jsDocType) { + checkTypeAssignableTo(type3, jsDocType, memberDecl); + type3 = jsDocType; + } else if (enumTag && enumTag.typeExpression) { + checkTypeAssignableTo(type3, getTypeFromTypeNode(enumTag.typeExpression), memberDecl); + } + } + objectFlags |= getObjectFlags(type3) & 458752; + const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0; + const prop = nameType ? createSymbol( + 4 | member.flags, + getPropertyNameFromType(nameType), + checkFlags | 4096 + /* Late */ + ) : createSymbol(4 | member.flags, member.escapedName, checkFlags); + if (nameType) { + prop.links.nameType = nameType; + } + if (inDestructuringPattern) { + const isOptional2 = memberDecl.kind === 303 && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 304 && memberDecl.objectAssignmentInitializer; + if (isOptional2) { + prop.flags |= 16777216; + } + } else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 512)) { + const impliedProp = getPropertyOfType(contextualType, member.escapedName); + if (impliedProp) { + prop.flags |= impliedProp.flags & 16777216; + } else if (!compilerOptions.suppressExcessPropertyErrors && !getIndexInfoOfType(contextualType, stringType2)) { + error22(memberDecl.name, Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString2(member), typeToString(contextualType)); + } + } + prop.declarations = member.declarations; + prop.parent = member.parent; + if (member.valueDeclaration) { + prop.valueDeclaration = member.valueDeclaration; + } + prop.links.type = type3; + prop.links.target = member; + member = prop; + allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop); + if (contextualType && checkMode & 2 && !(checkMode & 4) && (memberDecl.kind === 303 || memberDecl.kind === 174) && isContextSensitive(memberDecl)) { + const inferenceContext = getInferenceContext(node); + Debug.assert(inferenceContext); + const inferenceNode = memberDecl.kind === 303 ? memberDecl.initializer : memberDecl; + addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type3); + } + } else if (memberDecl.kind === 305) { + if (languageVersion < 2) { + checkExternalEmitHelpers( + memberDecl, + 2 + /* Assign */ + ); + } + if (propertiesArray.length > 0) { + spread2 = getSpreadType(spread2, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); + propertiesArray = []; + propertiesTable = createSymbolTable(); + hasComputedStringProperty = false; + hasComputedNumberProperty = false; + hasComputedSymbolProperty = false; + } + const type3 = getReducedType(checkExpression( + memberDecl.expression, + checkMode & 2 + /* Inferential */ + )); + if (isValidSpreadType(type3)) { + const mergedType = tryMergeUnionOfObjectTypeAndEmptyObject(type3, inConstContext); + if (allPropertiesTable) { + checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl); + } + offset = propertiesArray.length; + if (isErrorType(spread2)) { + continue; + } + spread2 = getSpreadType(spread2, mergedType, node.symbol, objectFlags, inConstContext); + } else { + error22(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); + spread2 = errorType; + } + continue; + } else { + Debug.assert( + memberDecl.kind === 177 || memberDecl.kind === 178 + /* SetAccessor */ + ); + checkNodeDeferred(memberDecl); + } + if (computedNameType && !(computedNameType.flags & 8576)) { + if (isTypeAssignableTo(computedNameType, stringNumberSymbolType)) { + if (isTypeAssignableTo(computedNameType, numberType2)) { + hasComputedNumberProperty = true; + } else if (isTypeAssignableTo(computedNameType, esSymbolType)) { + hasComputedSymbolProperty = true; + } else { + hasComputedStringProperty = true; + } + if (inDestructuringPattern) { + patternWithComputedProperties = true; + } + } + } else { + propertiesTable.set(member.escapedName, member); + } + propertiesArray.push(member); + } + popContextualType(); + if (contextualTypeHasPattern) { + const rootPatternParent = findAncestor( + contextualType.pattern.parent, + (n7) => n7.kind === 260 || n7.kind === 226 || n7.kind === 169 + /* Parameter */ + ); + const spreadOrOutsideRootObject = findAncestor( + node, + (n7) => n7 === rootPatternParent || n7.kind === 305 + /* SpreadAssignment */ + ); + if (spreadOrOutsideRootObject.kind !== 305) { + for (const prop of getPropertiesOfType(contextualType)) { + if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread2, prop.escapedName)) { + if (!(prop.flags & 16777216)) { + error22(prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement), Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); + } + propertiesTable.set(prop.escapedName, prop); + propertiesArray.push(prop); + } + } + } + } + if (isErrorType(spread2)) { + return errorType; + } + if (spread2 !== emptyObjectType) { + if (propertiesArray.length > 0) { + spread2 = getSpreadType(spread2, createObjectLiteralType(), node.symbol, objectFlags, inConstContext); + propertiesArray = []; + propertiesTable = createSymbolTable(); + hasComputedStringProperty = false; + hasComputedNumberProperty = false; + } + return mapType2(spread2, (t8) => t8 === emptyObjectType ? createObjectLiteralType() : t8); + } + return createObjectLiteralType(); + function createObjectLiteralType() { + const indexInfos = []; + if (hasComputedStringProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, stringType2)); + if (hasComputedNumberProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, numberType2)); + if (hasComputedSymbolProperty) + indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType)); + const result2 = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos); + result2.objectFlags |= objectFlags | 128 | 131072; + if (isJSObjectLiteral) { + result2.objectFlags |= 4096; + } + if (patternWithComputedProperties) { + result2.objectFlags |= 512; + } + if (inDestructuringPattern) { + result2.pattern = node; + } + return result2; + } + } + function isValidSpreadType(type3) { + const t8 = removeDefinitelyFalsyTypes(mapType2(type3, getBaseConstraintOrType)); + return !!(t8.flags & (1 | 67108864 | 524288 | 58982400) || t8.flags & 3145728 && every2(t8.types, isValidSpreadType)); + } + function checkJsxSelfClosingElementDeferred(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node); + } + function checkJsxSelfClosingElement(node, _checkMode) { + checkNodeDeferred(node); + return getJsxElementTypeAt(node) || anyType2; + } + function checkJsxElementDeferred(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + if (isJsxIntrinsicTagName(node.closingElement.tagName)) { + getIntrinsicTagSymbol(node.closingElement); + } else { + checkExpression(node.closingElement.tagName); + } + checkJsxChildren(node); + } + function checkJsxElement(node, _checkMode) { + checkNodeDeferred(node); + return getJsxElementTypeAt(node) || anyType2; + } + function checkJsxFragment(node) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + const nodeSourceFile = getSourceFileOfNode(node); + if (getJSXTransformEnabled(compilerOptions) && (compilerOptions.jsxFactory || nodeSourceFile.pragmas.has("jsx")) && !compilerOptions.jsxFragmentFactory && !nodeSourceFile.pragmas.has("jsxfrag")) { + error22( + node, + compilerOptions.jsxFactory ? Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option : Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments + ); + } + checkJsxChildren(node); + return getJsxElementTypeAt(node) || anyType2; + } + function isHyphenatedJsxName(name2) { + return name2.includes("-"); + } + function isJsxIntrinsicTagName(tagName) { + return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName); + } + function checkJsxAttribute(node, checkMode) { + return node.initializer ? checkExpressionForMutableLocation(node.initializer, checkMode) : trueType; + } + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode = 0) { + const attributes = openingLikeElement.attributes; + const contextualType = getContextualType2( + attributes, + 0 + /* None */ + ); + const allAttributesTable = strictNullChecks ? createSymbolTable() : void 0; + let attributesTable = createSymbolTable(); + let spread2 = emptyJsxObjectType; + let hasSpreadAnyType = false; + let typeToIntersect; + let explicitlySpecifyChildrenAttribute = false; + let objectFlags = 2048; + const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); + for (const attributeDecl of attributes.properties) { + const member = attributeDecl.symbol; + if (isJsxAttribute(attributeDecl)) { + const exprType = checkJsxAttribute(attributeDecl, checkMode); + objectFlags |= getObjectFlags(exprType) & 458752; + const attributeSymbol = createSymbol(4 | member.flags, member.escapedName); + attributeSymbol.declarations = member.declarations; + attributeSymbol.parent = member.parent; + if (member.valueDeclaration) { + attributeSymbol.valueDeclaration = member.valueDeclaration; + } + attributeSymbol.links.type = exprType; + attributeSymbol.links.target = member; + attributesTable.set(attributeSymbol.escapedName, attributeSymbol); + allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol); + if (getEscapedTextOfJsxAttributeName(attributeDecl.name) === jsxChildrenPropertyName) { + explicitlySpecifyChildrenAttribute = true; + } + if (contextualType) { + const prop = getPropertyOfType(contextualType, member.escapedName); + if (prop && prop.declarations && isDeprecatedSymbol(prop) && isIdentifier(attributeDecl.name)) { + addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText); + } + } + if (contextualType && checkMode & 2 && !(checkMode & 4) && isContextSensitive(attributeDecl)) { + const inferenceContext = getInferenceContext(attributes); + Debug.assert(inferenceContext); + const inferenceNode = attributeDecl.initializer.expression; + addIntraExpressionInferenceSite(inferenceContext, inferenceNode, exprType); + } + } else { + Debug.assert( + attributeDecl.kind === 293 + /* JsxSpreadAttribute */ + ); + if (attributesTable.size > 0) { + spread2 = getSpreadType( + spread2, + createJsxAttributesType(), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + attributesTable = createSymbolTable(); + } + const exprType = getReducedType(checkExpression( + attributeDecl.expression, + checkMode & 2 + /* Inferential */ + )); + if (isTypeAny(exprType)) { + hasSpreadAnyType = true; + } + if (isValidSpreadType(exprType)) { + spread2 = getSpreadType( + spread2, + exprType, + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + if (allAttributesTable) { + checkSpreadPropOverrides(exprType, allAttributesTable, attributeDecl); + } + } else { + error22(attributeDecl.expression, Diagnostics.Spread_types_may_only_be_created_from_object_types); + typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; + } + } + } + if (!hasSpreadAnyType) { + if (attributesTable.size > 0) { + spread2 = getSpreadType( + spread2, + createJsxAttributesType(), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + } + } + const parent22 = openingLikeElement.parent.kind === 284 ? openingLikeElement.parent : void 0; + if (parent22 && parent22.openingElement === openingLikeElement && getSemanticJsxChildren(parent22.children).length > 0) { + const childrenTypes = checkJsxChildren(parent22, checkMode); + if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { + if (explicitlySpecifyChildrenAttribute) { + error22(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, unescapeLeadingUnderscores(jsxChildrenPropertyName)); + } + const contextualType2 = getApparentTypeOfContextualType( + openingLikeElement.attributes, + /*contextFlags*/ + void 0 + ); + const childrenContextualType = contextualType2 && getTypeOfPropertyOfContextualType(contextualType2, jsxChildrenPropertyName); + const childrenPropSymbol = createSymbol(4, jsxChildrenPropertyName); + childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes)); + childrenPropSymbol.valueDeclaration = factory.createPropertySignature( + /*modifiers*/ + void 0, + unescapeLeadingUnderscores(jsxChildrenPropertyName), + /*questionToken*/ + void 0, + /*type*/ + void 0 + ); + setParent(childrenPropSymbol.valueDeclaration, attributes); + childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol; + const childPropMap = createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread2 = getSpreadType( + spread2, + createAnonymousType(attributes.symbol, childPropMap, emptyArray, emptyArray, emptyArray), + attributes.symbol, + objectFlags, + /*readonly*/ + false + ); + } + } + if (hasSpreadAnyType) { + return anyType2; + } + if (typeToIntersect && spread2 !== emptyJsxObjectType) { + return getIntersectionType([typeToIntersect, spread2]); + } + return typeToIntersect || (spread2 === emptyJsxObjectType ? createJsxAttributesType() : spread2); + function createJsxAttributesType() { + objectFlags |= freshObjectLiteralFlag; + const result2 = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray); + result2.objectFlags |= objectFlags | 128 | 131072; + return result2; + } + } + function checkJsxChildren(node, checkMode) { + const childrenTypes = []; + for (const child of node.children) { + if (child.kind === 12) { + if (!child.containsOnlyTriviaWhiteSpaces) { + childrenTypes.push(stringType2); + } + } else if (child.kind === 294 && !child.expression) { + continue; + } else { + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); + } + } + return childrenTypes; + } + function checkSpreadPropOverrides(type3, props, spread2) { + for (const right of getPropertiesOfType(type3)) { + if (!(right.flags & 16777216)) { + const left = props.get(right.escapedName); + if (left) { + const diagnostic = error22(left.valueDeclaration, Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, unescapeLeadingUnderscores(left.escapedName)); + addRelatedInfo(diagnostic, createDiagnosticForNode(spread2, Diagnostics.This_spread_always_overwrites_this_property)); + } + } + } + } + function checkJsxAttributes(node, checkMode) { + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); + } + function getJsxType(name2, location2) { + const namespace = getJsxNamespaceAt(location2); + const exports29 = namespace && getExportsOfSymbol(namespace); + const typeSymbol = exports29 && getSymbol2( + exports29, + name2, + 788968 + /* Type */ + ); + return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType; + } + function getIntrinsicTagSymbol(node) { + const links = getNodeLinks(node); + if (!links.resolvedSymbol) { + const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); + if (!isErrorType(intrinsicElementsType)) { + if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName)) + return Debug.fail(); + const propName2 = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText; + const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName2); + if (intrinsicProp) { + links.jsxFlags |= 1; + return links.resolvedSymbol = intrinsicProp; + } + const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName2))); + if (indexSymbol) { + links.jsxFlags |= 2; + return links.resolvedSymbol = indexSymbol; + } + if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName2)) { + links.jsxFlags |= 2; + return links.resolvedSymbol = intrinsicElementsType.symbol; + } + error22(node, Diagnostics.Property_0_does_not_exist_on_type_1, intrinsicTagNameToString(node.tagName), "JSX." + JsxNames.IntrinsicElements); + return links.resolvedSymbol = unknownSymbol; + } else { + if (noImplicitAny) { + error22(node, Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists, unescapeLeadingUnderscores(JsxNames.IntrinsicElements)); + } + return links.resolvedSymbol = unknownSymbol; + } + } + return links.resolvedSymbol; + } + function getJsxNamespaceContainerForImplicitImport(location2) { + const file = location2 && getSourceFileOfNode(location2); + const links = file && getNodeLinks(file); + if (links && links.jsxImplicitImportContainer === false) { + return void 0; + } + if (links && links.jsxImplicitImportContainer) { + return links.jsxImplicitImportContainer; + } + const runtimeImportSpecifier = getJSXRuntimeImport(getJSXImplicitImportBase(compilerOptions, file), compilerOptions); + if (!runtimeImportSpecifier) { + return void 0; + } + const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1; + const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations; + const jsxImportIndex = compilerOptions.importHelpers ? 1 : 0; + const specifier = file == null ? void 0 : file.imports[jsxImportIndex]; + if (specifier) { + Debug.assert(nodeIsSynthesized(specifier) && specifier.text === runtimeImportSpecifier, `Expected sourceFile.imports[${jsxImportIndex}] to be the synthesized JSX runtime import`); + } + const mod2 = resolveExternalModule(specifier || location2, runtimeImportSpecifier, errorMessage, location2); + const result2 = mod2 && mod2 !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod2)) : void 0; + if (links) { + links.jsxImplicitImportContainer = result2 || false; + } + return result2; + } + function getJsxNamespaceAt(location2) { + const links = location2 && getNodeLinks(location2); + if (links && links.jsxNamespace) { + return links.jsxNamespace; + } + if (!links || links.jsxNamespace !== false) { + let resolvedNamespace = getJsxNamespaceContainerForImplicitImport(location2); + if (!resolvedNamespace || resolvedNamespace === unknownSymbol) { + const namespaceName = getJsxNamespace(location2); + resolvedNamespace = resolveName( + location2, + namespaceName, + 1920, + /*nameNotFoundMessage*/ + void 0, + namespaceName, + /*isUse*/ + false + ); + } + if (resolvedNamespace) { + const candidate = resolveSymbol(getSymbol2( + getExportsOfSymbol(resolveSymbol(resolvedNamespace)), + JsxNames.JSX, + 1920 + /* Namespace */ + )); + if (candidate && candidate !== unknownSymbol) { + if (links) { + links.jsxNamespace = candidate; + } + return candidate; + } + } + if (links) { + links.jsxNamespace = false; + } + } + const s7 = resolveSymbol(getGlobalSymbol( + JsxNames.JSX, + 1920, + /*diagnostic*/ + void 0 + )); + if (s7 === unknownSymbol) { + return void 0; + } + return s7; + } + function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { + const jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol2( + jsxNamespace.exports, + nameOfAttribPropContainer, + 788968 + /* Type */ + ); + const jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); + const propertiesOfJsxElementAttribPropInterface = jsxElementAttribPropInterfaceType && getPropertiesOfType(jsxElementAttribPropInterfaceType); + if (propertiesOfJsxElementAttribPropInterface) { + if (propertiesOfJsxElementAttribPropInterface.length === 0) { + return ""; + } else if (propertiesOfJsxElementAttribPropInterface.length === 1) { + return propertiesOfJsxElementAttribPropInterface[0].escapedName; + } else if (propertiesOfJsxElementAttribPropInterface.length > 1 && jsxElementAttribPropInterfaceSym.declarations) { + error22(jsxElementAttribPropInterfaceSym.declarations[0], Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property, unescapeLeadingUnderscores(nameOfAttribPropContainer)); + } + } + return void 0; + } + function getJsxLibraryManagedAttributes(jsxNamespace) { + return jsxNamespace && getSymbol2( + jsxNamespace.exports, + JsxNames.LibraryManagedAttributes, + 788968 + /* Type */ + ); + } + function getJsxElementTypeSymbol(jsxNamespace) { + return jsxNamespace && getSymbol2( + jsxNamespace.exports, + JsxNames.ElementType, + 788968 + /* Type */ + ); + } + function getJsxElementPropertiesName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); + } + function getJsxElementChildrenPropertyName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); + } + function getUninstantiatedJsxSignaturesOfType(elementType, caller) { + if (elementType.flags & 4) { + return [anySignature]; + } else if (elementType.flags & 128) { + const intrinsicType = getIntrinsicAttributesTypeFromStringLiteralType(elementType, caller); + if (!intrinsicType) { + error22(caller, Diagnostics.Property_0_does_not_exist_on_type_1, elementType.value, "JSX." + JsxNames.IntrinsicElements); + return emptyArray; + } else { + const fakeSignature = createSignatureForJSXIntrinsic(caller, intrinsicType); + return [fakeSignature]; + } + } + const apparentElemType = getApparentType(elementType); + let signatures = getSignaturesOfType( + apparentElemType, + 1 + /* Construct */ + ); + if (signatures.length === 0) { + signatures = getSignaturesOfType( + apparentElemType, + 0 + /* Call */ + ); + } + if (signatures.length === 0 && apparentElemType.flags & 1048576) { + signatures = getUnionSignatures(map4(apparentElemType.types, (t8) => getUninstantiatedJsxSignaturesOfType(t8, caller))); + } + return signatures; + } + function getIntrinsicAttributesTypeFromStringLiteralType(type3, location2) { + const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location2); + if (!isErrorType(intrinsicElementsType)) { + const stringLiteralTypeName = type3.value; + const intrinsicProp = getPropertyOfType(intrinsicElementsType, escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType2); + if (indexSignatureType) { + return indexSignatureType; + } + return void 0; + } + return anyType2; + } + function checkJsxReturnAssignableToAppropriateBound(refKind, elemInstanceType, openingLikeElement) { + if (refKind === 1) { + const sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); + if (sfcReturnConstraint) { + checkTypeRelatedTo(elemInstanceType, sfcReturnConstraint, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + } else if (refKind === 0) { + const classConstraint = getJsxElementClassTypeAt(openingLikeElement); + if (classConstraint) { + checkTypeRelatedTo(elemInstanceType, classConstraint, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + } else { + const sfcReturnConstraint = getJsxStatelessElementTypeAt(openingLikeElement); + const classConstraint = getJsxElementClassTypeAt(openingLikeElement); + if (!sfcReturnConstraint || !classConstraint) { + return; + } + const combined = getUnionType([sfcReturnConstraint, classConstraint]); + checkTypeRelatedTo(elemInstanceType, combined, assignableRelation, openingLikeElement.tagName, Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element, generateInitialErrorChain); + } + function generateInitialErrorChain() { + const componentName = getTextOfNode(openingLikeElement.tagName); + return chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics._0_cannot_be_used_as_a_JSX_component, + componentName + ); + } + } + function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { + var _a2; + Debug.assert(isJsxIntrinsicTagName(node.tagName)); + const links = getNodeLinks(node); + if (!links.resolvedJsxElementAttributesType) { + const symbol = getIntrinsicTagSymbol(node); + if (links.jsxFlags & 1) { + return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType; + } else if (links.jsxFlags & 2) { + const propName2 = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText; + return links.resolvedJsxElementAttributesType = ((_a2 = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName2)) == null ? void 0 : _a2.type) || errorType; + } else { + return links.resolvedJsxElementAttributesType = errorType; + } + } + return links.resolvedJsxElementAttributesType; + } + function getJsxElementClassTypeAt(location2) { + const type3 = getJsxType(JsxNames.ElementClass, location2); + if (isErrorType(type3)) + return void 0; + return type3; + } + function getJsxElementTypeAt(location2) { + return getJsxType(JsxNames.Element, location2); + } + function getJsxStatelessElementTypeAt(location2) { + const jsxElementType = getJsxElementTypeAt(location2); + if (jsxElementType) { + return getUnionType([jsxElementType, nullType2]); + } + } + function getJsxElementTypeTypeAt(location2) { + const ns = getJsxNamespaceAt(location2); + if (!ns) + return void 0; + const sym = getJsxElementTypeSymbol(ns); + if (!sym) + return void 0; + const type3 = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location2)); + if (!type3 || isErrorType(type3)) + return void 0; + return type3; + } + function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) { + const declaredManagedType = getDeclaredTypeOfSymbol(managedSym); + if (managedSym.flags & 524288) { + const params = getSymbolLinks(managedSym).typeParameters; + if (length(params) >= typeArguments.length) { + const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs); + return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args); + } + } + if (length(declaredManagedType.typeParameters) >= typeArguments.length) { + const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs); + return createTypeReference(declaredManagedType, args); + } + return void 0; + } + function getJsxIntrinsicTagNamesAt(location2) { + const intrinsics = getJsxType(JsxNames.IntrinsicElements, location2); + return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; + } + function checkJsxPreconditions(errorNode) { + if ((compilerOptions.jsx || 0) === 0) { + error22(errorNode, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); + } + if (getJsxElementTypeAt(errorNode) === void 0) { + if (noImplicitAny) { + error22(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); + } + } + } + function checkJsxOpeningLikeElementOrOpeningFragment(node) { + const isNodeOpeningLikeElement = isJsxOpeningLikeElement(node); + if (isNodeOpeningLikeElement) { + checkGrammarJsxElement(node); + } + checkJsxPreconditions(node); + if (!getJsxNamespaceContainerForImplicitImport(node)) { + const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 ? Diagnostics.Cannot_find_name_0 : void 0; + const jsxFactoryNamespace = getJsxNamespace(node); + const jsxFactoryLocation = isNodeOpeningLikeElement ? node.tagName : node; + let jsxFactorySym; + if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) { + jsxFactorySym = resolveName( + jsxFactoryLocation, + jsxFactoryNamespace, + 111551, + jsxFactoryRefErr, + jsxFactoryNamespace, + /*isUse*/ + true + ); + } + if (jsxFactorySym) { + jsxFactorySym.isReferenced = -1; + if (canCollectSymbolAliasAccessabilityData && jsxFactorySym.flags & 2097152 && !getTypeOnlyAliasDeclaration(jsxFactorySym)) { + markAliasSymbolAsReferenced(jsxFactorySym); + } + } + if (isJsxOpeningFragment(node)) { + const file = getSourceFileOfNode(node); + const localJsxNamespace = getLocalJsxNamespace(file); + if (localJsxNamespace) { + resolveName( + jsxFactoryLocation, + localJsxNamespace, + 111551, + jsxFactoryRefErr, + localJsxNamespace, + /*isUse*/ + true + ); + } + } + } + if (isNodeOpeningLikeElement) { + const jsxOpeningLikeNode = node; + const sig = getResolvedSignature(jsxOpeningLikeNode); + checkDeprecatedSignature(sig, node); + const elementTypeConstraint = getJsxElementTypeTypeAt(jsxOpeningLikeNode); + if (elementTypeConstraint !== void 0) { + const tagName = jsxOpeningLikeNode.tagName; + const tagType = isJsxIntrinsicTagName(tagName) ? getStringLiteralType(intrinsicTagNameToString(tagName)) : checkExpression(tagName); + checkTypeRelatedTo(tagType, elementTypeConstraint, assignableRelation, tagName, Diagnostics.Its_type_0_is_not_a_valid_JSX_element_type, () => { + const componentName = getTextOfNode(tagName); + return chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics._0_cannot_be_used_as_a_JSX_component, + componentName + ); + }); + } else { + checkJsxReturnAssignableToAppropriateBound(getJsxReferenceKind(jsxOpeningLikeNode), getReturnTypeOfSignature(sig), jsxOpeningLikeNode); + } + } + } + function isKnownProperty(targetType, name2, isComparingJsxAttributes) { + if (targetType.flags & 524288) { + if (getPropertyOfObjectType(targetType, name2) || getApplicableIndexInfoForName(targetType, name2) || isLateBoundName(name2) && getIndexInfoOfType(targetType, stringType2) || isComparingJsxAttributes && isHyphenatedJsxName(name2)) { + return true; + } + } else if (targetType.flags & 3145728 && isExcessPropertyCheckTarget(targetType)) { + for (const t8 of targetType.types) { + if (isKnownProperty(t8, name2, isComparingJsxAttributes)) { + return true; + } + } + } + return false; + } + function isExcessPropertyCheckTarget(type3) { + return !!(type3.flags & 524288 && !(getObjectFlags(type3) & 512) || type3.flags & 67108864 || type3.flags & 1048576 && some2(type3.types, isExcessPropertyCheckTarget) || type3.flags & 2097152 && every2(type3.types, isExcessPropertyCheckTarget)); + } + function checkJsxExpression(node, checkMode) { + checkGrammarJsxExpression(node); + if (node.expression) { + const type3 = checkExpression(node.expression, checkMode); + if (node.dotDotDotToken && type3 !== anyType2 && !isArrayType(type3)) { + error22(node, Diagnostics.JSX_spread_child_must_be_an_array_type); + } + return type3; + } else { + return errorType; + } + } + function getDeclarationNodeFlagsFromSymbol(s7) { + return s7.valueDeclaration ? getCombinedNodeFlagsCached(s7.valueDeclaration) : 0; + } + function isPrototypeProperty(symbol) { + if (symbol.flags & 8192 || getCheckFlags(symbol) & 4) { + return true; + } + if (isInJSFile(symbol.valueDeclaration)) { + const parent22 = symbol.valueDeclaration.parent; + return parent22 && isBinaryExpression(parent22) && getAssignmentDeclarationKind(parent22) === 3; + } + } + function checkPropertyAccessibility(node, isSuper, writing, type3, prop, reportError = true) { + const errorNode = !reportError ? void 0 : node.kind === 166 ? node.right : node.kind === 205 ? node : node.kind === 208 && node.propertyName ? node.propertyName : node.name; + return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type3, prop, errorNode); + } + function checkPropertyAccessibilityAtLocation(location2, isSuper, writing, containingType, prop, errorNode) { + var _a2; + const flags = getDeclarationModifierFlagsFromSymbol(prop, writing); + if (isSuper) { + if (languageVersion < 2) { + if (symbolHasNonMethodDeclaration(prop)) { + if (errorNode) { + error22(errorNode, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); + } + return false; + } + } + if (flags & 64) { + if (errorNode) { + error22(errorNode, Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression, symbolToString2(prop), typeToString(getDeclaringClass(prop))); + } + return false; + } + if (!(flags & 256) && ((_a2 = prop.declarations) == null ? void 0 : _a2.some(isClassInstanceProperty))) { + if (errorNode) { + error22(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString2(prop)); + } + return false; + } + } + if (flags & 64 && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location2) || isThisInitializedObjectBindingExpression(location2) || isObjectBindingPattern(location2.parent) && isThisInitializedDeclaration(location2.parent.parent))) { + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + if (declaringClassDeclaration && isNodeUsedDuringClassInitialization(location2)) { + if (errorNode) { + error22(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString2(prop), getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); + } + return false; + } + } + if (!(flags & 6)) { + return true; + } + if (flags & 2) { + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + if (!isNodeWithinClass(location2, declaringClassDeclaration)) { + if (errorNode) { + error22(errorNode, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString2(prop), typeToString(getDeclaringClass(prop))); + } + return false; + } + return true; + } + if (isSuper) { + return true; + } + let enclosingClass = forEachEnclosingClass(location2, (enclosingDeclaration) => { + const enclosingClass2 = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(enclosingDeclaration)); + return isClassDerivedFromDeclaringClasses(enclosingClass2, prop, writing); + }); + if (!enclosingClass) { + enclosingClass = getEnclosingClassFromThisParameter(location2); + enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing); + if (flags & 256 || !enclosingClass) { + if (errorNode) { + error22(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString2(prop), typeToString(getDeclaringClass(prop) || containingType)); + } + return false; + } + } + if (flags & 256) { + return true; + } + if (containingType.flags & 262144) { + containingType = containingType.isThisType ? getConstraintOfTypeParameter(containingType) : getBaseConstraintOfType(containingType); + } + if (!containingType || !hasBaseType(containingType, enclosingClass)) { + if (errorNode) { + error22(errorNode, Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2, symbolToString2(prop), typeToString(enclosingClass), typeToString(containingType)); + } + return false; + } + return true; + } + function getEnclosingClassFromThisParameter(node) { + const thisParameter = getThisParameterFromNodeContext(node); + let thisType = (thisParameter == null ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type); + if (thisType && thisType.flags & 262144) { + thisType = getConstraintOfTypeParameter(thisType); + } + if (thisType && getObjectFlags(thisType) & (3 | 4)) { + return getTargetType(thisType); + } + return void 0; + } + function getThisParameterFromNodeContext(node) { + const thisContainer = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + return thisContainer && isFunctionLike(thisContainer) ? getThisParameter(thisContainer) : void 0; + } + function symbolHasNonMethodDeclaration(symbol) { + return !!forEachProperty2(symbol, (prop) => !(prop.flags & 8192)); + } + function checkNonNullExpression(node) { + return checkNonNullType(checkExpression(node), node); + } + function isNullableType(type3) { + return hasTypeFacts( + type3, + 50331648 + /* IsUndefinedOrNull */ + ); + } + function getNonNullableTypeIfNeeded(type3) { + return isNullableType(type3) ? getNonNullableType(type3) : type3; + } + function reportObjectPossiblyNullOrUndefinedError(node, facts) { + const nodeText2 = isEntityNameExpression(node) ? entityNameToString(node) : void 0; + if (node.kind === 106) { + error22(node, Diagnostics.The_value_0_cannot_be_used_here, "null"); + return; + } + if (nodeText2 !== void 0 && nodeText2.length < 100) { + if (isIdentifier(node) && nodeText2 === "undefined") { + error22(node, Diagnostics.The_value_0_cannot_be_used_here, "undefined"); + return; + } + error22( + node, + facts & 16777216 ? facts & 33554432 ? Diagnostics._0_is_possibly_null_or_undefined : Diagnostics._0_is_possibly_undefined : Diagnostics._0_is_possibly_null, + nodeText2 + ); + } else { + error22( + node, + facts & 16777216 ? facts & 33554432 ? Diagnostics.Object_is_possibly_null_or_undefined : Diagnostics.Object_is_possibly_undefined : Diagnostics.Object_is_possibly_null + ); + } + } + function reportCannotInvokePossiblyNullOrUndefinedError(node, facts) { + error22( + node, + facts & 16777216 ? facts & 33554432 ? Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined : Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined : Diagnostics.Cannot_invoke_an_object_which_is_possibly_null + ); + } + function checkNonNullTypeWithReporter(type3, node, reportError) { + if (strictNullChecks && type3.flags & 2) { + if (isEntityNameExpression(node)) { + const nodeText2 = entityNameToString(node); + if (nodeText2.length < 100) { + error22(node, Diagnostics._0_is_of_type_unknown, nodeText2); + return errorType; + } + } + error22(node, Diagnostics.Object_is_of_type_unknown); + return errorType; + } + const facts = getTypeFacts( + type3, + 50331648 + /* IsUndefinedOrNull */ + ); + if (facts & 50331648) { + reportError(node, facts); + const t8 = getNonNullableType(type3); + return t8.flags & (98304 | 131072) ? errorType : t8; + } + return type3; + } + function checkNonNullType(type3, node) { + return checkNonNullTypeWithReporter(type3, node, reportObjectPossiblyNullOrUndefinedError); + } + function checkNonNullNonVoidType(type3, node) { + const nonNullType = checkNonNullType(type3, node); + if (nonNullType.flags & 16384) { + if (isEntityNameExpression(node)) { + const nodeText2 = entityNameToString(node); + if (isIdentifier(node) && nodeText2 === "undefined") { + error22(node, Diagnostics.The_value_0_cannot_be_used_here, nodeText2); + return nonNullType; + } + if (nodeText2.length < 100) { + error22(node, Diagnostics._0_is_possibly_undefined, nodeText2); + return nonNullType; + } + } + error22(node, Diagnostics.Object_is_possibly_undefined); + } + return nonNullType; + } + function checkPropertyAccessExpression(node, checkMode, writeOnly) { + return node.flags & 64 ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode, writeOnly); + } + function checkPropertyAccessChain(node, checkMode) { + const leftType = checkExpression(node.expression); + const nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullType(nonOptionalType, node.expression), node.name, checkMode), node, nonOptionalType !== leftType); + } + function checkQualifiedName(node, checkMode) { + const leftType = isPartOfTypeQuery(node) && isThisIdentifier(node.left) ? checkNonNullType(checkThisExpression(node.left), node.left) : checkNonNullExpression(node.left); + return checkPropertyAccessExpressionOrQualifiedName(node, node.left, leftType, node.right, checkMode); + } + function isMethodAccessForCall(node) { + while (node.parent.kind === 217) { + node = node.parent; + } + return isCallOrNewExpression(node.parent) && node.parent.expression === node; + } + function lookupSymbolForPrivateIdentifierDeclaration(propName2, location2) { + for (let containingClass = getContainingClassExcludingClassDecorators(location2); !!containingClass; containingClass = getContainingClass(containingClass)) { + const { symbol } = containingClass; + const name2 = getSymbolNameForPrivateIdentifier(symbol, propName2); + const prop = symbol.members && symbol.members.get(name2) || symbol.exports && symbol.exports.get(name2); + if (prop) { + return prop; + } + } + } + function checkGrammarPrivateIdentifierExpression(privId) { + if (!getContainingClass(privId)) { + return grammarErrorOnNode(privId, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + if (!isForInStatement(privId.parent)) { + if (!isExpressionNode(privId)) { + return grammarErrorOnNode(privId, Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression); + } + const isInOperation = isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 103; + if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) { + return grammarErrorOnNode(privId, Diagnostics.Cannot_find_name_0, idText(privId)); + } + } + return false; + } + function checkPrivateIdentifierExpression(privId) { + checkGrammarPrivateIdentifierExpression(privId); + const symbol = getSymbolForPrivateIdentifierExpression(privId); + if (symbol) { + markPropertyAsReferenced( + symbol, + /*nodeForCheckWriteOnly*/ + void 0, + /*isSelfTypeAccess*/ + false + ); + } + return anyType2; + } + function getSymbolForPrivateIdentifierExpression(privId) { + if (!isExpressionNode(privId)) { + return void 0; + } + const links = getNodeLinks(privId); + if (links.resolvedSymbol === void 0) { + links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId); + } + return links.resolvedSymbol; + } + function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) { + return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName); + } + function checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedIdentifier) { + let propertyOnType; + const properties = getPropertiesOfType(leftType); + if (properties) { + forEach4(properties, (symbol) => { + const decl = symbol.valueDeclaration; + if (decl && isNamedDeclaration(decl) && isPrivateIdentifier(decl.name) && decl.name.escapedText === right.escapedText) { + propertyOnType = symbol; + return true; + } + }); + } + const diagName = diagnosticName(right); + if (propertyOnType) { + const typeValueDecl = Debug.checkDefined(propertyOnType.valueDeclaration); + const typeClass = Debug.checkDefined(getContainingClass(typeValueDecl)); + if (lexicallyScopedIdentifier == null ? void 0 : lexicallyScopedIdentifier.valueDeclaration) { + const lexicalValueDecl = lexicallyScopedIdentifier.valueDeclaration; + const lexicalClass = getContainingClass(lexicalValueDecl); + Debug.assert(!!lexicalClass); + if (findAncestor(lexicalClass, (n7) => typeClass === n7)) { + const diagnostic = error22( + right, + Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling, + diagName, + typeToString(leftType) + ); + addRelatedInfo( + diagnostic, + createDiagnosticForNode( + lexicalValueDecl, + Diagnostics.The_shadowing_declaration_of_0_is_defined_here, + diagName + ), + createDiagnosticForNode( + typeValueDecl, + Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here, + diagName + ) + ); + return true; + } + } + error22( + right, + Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier, + diagName, + diagnosticName(typeClass.name || anon) + ); + return true; + } + return false; + } + function isThisPropertyAccessInConstructor(node, prop) { + return (isConstructorDeclaredProperty(prop) || isThisProperty(node) && isAutoTypedProperty(prop)) && getThisContainer( + node, + /*includeArrowFunctions*/ + true, + /*includeClassComputedPropertyName*/ + false + ) === getDeclaringConstructor(prop); + } + function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode, writeOnly) { + const parentSymbol = getNodeLinks(left).resolvedSymbol; + const assignmentKind = getAssignmentTargetKind(node); + const apparentType = getApparentType(assignmentKind !== 0 || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType); + const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType; + let prop; + if (isPrivateIdentifier(right)) { + if (languageVersion < 99) { + if (assignmentKind !== 0) { + checkExternalEmitHelpers( + node, + 1048576 + /* ClassPrivateFieldSet */ + ); + } + if (assignmentKind !== 1) { + checkExternalEmitHelpers( + node, + 524288 + /* ClassPrivateFieldGet */ + ); + } + } + const lexicallyScopedSymbol = lookupSymbolForPrivateIdentifierDeclaration(right.escapedText, right); + if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) { + grammarErrorOnNode(right, Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, idText(right)); + } + if (isAnyLike) { + if (lexicallyScopedSymbol) { + return isErrorType(apparentType) ? errorType : apparentType; + } + if (getContainingClassExcludingClassDecorators(right) === void 0) { + grammarErrorOnNode(right, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + return anyType2; + } + } + prop = lexicallyScopedSymbol && getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedSymbol); + if (prop === void 0) { + if (checkPrivateIdentifierPropertyAccess(leftType, right, lexicallyScopedSymbol)) { + return errorType; + } + const containingClass = getContainingClassExcludingClassDecorators(right); + if (containingClass && isPlainJsFile(getSourceFileOfNode(containingClass), compilerOptions.checkJs)) { + grammarErrorOnNode(right, Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class, idText(right)); + } + } else { + const isSetonlyAccessor = prop.flags & 65536 && !(prop.flags & 32768); + if (isSetonlyAccessor && assignmentKind !== 1) { + error22(node, Diagnostics.Private_accessor_was_defined_without_a_getter); + } + } + } else { + if (isAnyLike) { + if (isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } + return isErrorType(apparentType) ? errorType : apparentType; + } + prop = getPropertyOfType( + apparentType, + right.escapedText, + /*skipObjectFunctionPropertyAugment*/ + isConstEnumObjectType(apparentType), + /*includeTypeOnlyMembers*/ + node.kind === 166 + /* QualifiedName */ + ); + } + if (isIdentifier(left) && parentSymbol && (getIsolatedModules(compilerOptions) || !(prop && (isConstEnumOrConstEnumOnlyModule(prop) || prop.flags & 8 && node.parent.kind === 306)) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(node))) { + markAliasReferenced(parentSymbol, node); + } + let propType; + if (!prop) { + const indexInfo = !isPrivateIdentifier(right) && (assignmentKind === 0 || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ? getApplicableIndexInfoForName(apparentType, right.escapedText) : void 0; + if (!(indexInfo && indexInfo.type)) { + const isUncheckedJS = isUncheckedJSSuggestion( + node, + leftType.symbol, + /*excludeClasses*/ + true + ); + if (!isUncheckedJS && isJSLiteralType(leftType)) { + return anyType2; + } + if (leftType.symbol === globalThisSymbol) { + if (globalThisSymbol.exports.has(right.escapedText) && globalThisSymbol.exports.get(right.escapedText).flags & 418) { + error22(right, Diagnostics.Property_0_does_not_exist_on_type_1, unescapeLeadingUnderscores(right.escapedText), typeToString(leftType)); + } else if (noImplicitAny) { + error22(right, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(leftType)); + } + return anyType2; + } + if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) { + reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS); + } + return errorType; + } + if (indexInfo.isReadonly && (isAssignmentTarget(node) || isDeleteTarget(node))) { + error22(node, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(apparentType)); + } + propType = compilerOptions.noUncheckedIndexedAccess && !isAssignmentTarget(node) ? getUnionType([indexInfo.type, missingType]) : indexInfo.type; + if (compilerOptions.noPropertyAccessFromIndexSignature && isPropertyAccessExpression(node)) { + error22(right, Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, unescapeLeadingUnderscores(right.escapedText)); + } + if (indexInfo.declaration && isDeprecatedDeclaration2(indexInfo.declaration)) { + addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText); + } + } else { + const targetPropSymbol = resolveAliasWithDeprecationCheck(prop, right); + if (isDeprecatedSymbol(targetPropSymbol) && isUncalledFunctionReference(node, targetPropSymbol) && targetPropSymbol.declarations) { + addDeprecatedSuggestion(right, targetPropSymbol.declarations, right.escapedText); + } + checkPropertyNotUsedBeforeDeclaration(prop, node, right); + markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol)); + getNodeLinks(node).resolvedSymbol = prop; + checkPropertyAccessibility(node, left.kind === 108, isWriteAccess(node), apparentType, prop); + if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) { + error22(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right)); + return errorType; + } + propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writeOnly || isWriteOnlyAccess(node) ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop); + } + return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode); + } + function isUncheckedJSSuggestion(node, suggestion, excludeClasses) { + var _a2; + const file = getSourceFileOfNode(node); + if (file) { + if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 || file.scriptKind === 2)) { + const declarationFile = forEach4(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode); + const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a2 = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a2.length) || classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + suggestion.valueDeclaration + ); + return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 && suggestionHasNoExtendsOrDecorators); + } + } + return false; + } + function getFlowTypeOfAccessExpression(node, prop, propType, errorNode, checkMode) { + const assignmentKind = getAssignmentTargetKind(node); + if (assignmentKind === 1) { + return removeMissingType(propType, !!(prop && prop.flags & 16777216)); + } + if (prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 1048576) && !isDuplicatedCommonJSExport(prop.declarations)) { + return propType; + } + if (propType === autoType) { + return getFlowTypeOfProperty(node, prop); + } + propType = getNarrowableTypeForReference(propType, node, checkMode); + let assumeUninitialized = false; + if (strictNullChecks && strictPropertyInitialization && isAccessExpression(node) && node.expression.kind === 110) { + const declaration = prop && prop.valueDeclaration; + if (declaration && isPropertyWithoutInitializer(declaration)) { + if (!isStatic(declaration)) { + const flowContainer = getControlFlowContainer(node); + if (flowContainer.kind === 176 && flowContainer.parent === declaration.parent && !(declaration.flags & 33554432)) { + assumeUninitialized = true; + } + } + } + } else if (strictNullChecks && prop && prop.valueDeclaration && isPropertyAccessExpression(prop.valueDeclaration) && getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) && getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) { + assumeUninitialized = true; + } + const flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType); + if (assumeUninitialized && !containsUndefinedType(propType) && containsUndefinedType(flowType)) { + error22(errorNode, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString2(prop)); + return propType; + } + return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType; + } + function checkPropertyNotUsedBeforeDeclaration(prop, node, right) { + const { valueDeclaration } = prop; + if (!valueDeclaration || getSourceFileOfNode(node).isDeclarationFile) { + return; + } + let diagnosticMessage; + const declarationName = idText(right); + if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 256) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) { + diagnosticMessage = error22(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName); + } else if (valueDeclaration.kind === 263 && node.parent.kind !== 183 && !(valueDeclaration.flags & 33554432) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { + diagnosticMessage = error22(right, Diagnostics.Class_0_used_before_its_declaration, declarationName); + } + if (diagnosticMessage) { + addRelatedInfo(diagnosticMessage, createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)); + } + } + function isInPropertyInitializerOrClassStaticBlock(node) { + return !!findAncestor(node, (node2) => { + switch (node2.kind) { + case 172: + return true; + case 303: + case 174: + case 177: + case 178: + case 305: + case 167: + case 239: + case 294: + case 291: + case 292: + case 293: + case 286: + case 233: + case 298: + return false; + case 219: + case 244: + return isBlock2(node2.parent) && isClassStaticBlockDeclaration(node2.parent.parent) ? true : "quit"; + default: + return isExpressionNode(node2) ? false : "quit"; + } + }); + } + function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32)) { + return false; + } + let classType = getTypeOfSymbol(prop.parent); + while (true) { + classType = classType.symbol && getSuperClass(classType); + if (!classType) { + return false; + } + const superProperty = getPropertyOfType(classType, prop.escapedName); + if (superProperty && superProperty.valueDeclaration) { + return true; + } + } + } + function getSuperClass(classType) { + const x7 = getBaseTypes(classType); + if (x7.length === 0) { + return void 0; + } + return getIntersectionType(x7); + } + function reportNonexistentProperty(propNode, containingType, isUncheckedJS) { + let errorInfo; + let relatedInfo; + if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 && !(containingType.flags & 402784252)) { + for (const subtype of containingType.types) { + if (!getPropertyOfType(subtype, propNode.escapedText) && !getApplicableIndexInfoForName(subtype, propNode.escapedText)) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(subtype)); + break; + } + } + } + if (typeHasStaticProperty(propNode.escapedText, containingType)) { + const propName2 = declarationNameToString(propNode); + const typeName = typeToString(containingType); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead, propName2, typeName, typeName + "." + propName2); + } else { + const promisedType = getPromisedTypeOfPromise(containingType); + if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); + relatedInfo = createDiagnosticForNode(propNode, Diagnostics.Did_you_forget_to_use_await); + } else { + const missingProperty = declarationNameToString(propNode); + const container = typeToString(containingType); + const libSuggestion = getSuggestedLibForNonExistentProperty(missingProperty, containingType); + if (libSuggestion !== void 0) { + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later, missingProperty, container, libSuggestion); + } else { + const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); + if (suggestion !== void 0) { + const suggestedName = symbolName(suggestion); + const message = isUncheckedJS ? Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2; + errorInfo = chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName); + relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestedName); + } else { + const diagnostic = containerSeemsToBeEmptyDomElement(containingType) ? Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom : Diagnostics.Property_0_does_not_exist_on_type_1; + errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container); + } + } + } + } + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(propNode), propNode, errorInfo); + if (relatedInfo) { + addRelatedInfo(resultDiagnostic, relatedInfo); + } + addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic); + } + function containerSeemsToBeEmptyDomElement(containingType) { + return compilerOptions.lib && !compilerOptions.lib.includes("dom") && everyContainedType(containingType, (type3) => type3.symbol && /^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(unescapeLeadingUnderscores(type3.symbol.escapedName))) && isEmptyObjectType(containingType); + } + function typeHasStaticProperty(propName2, containingType) { + const prop = containingType.symbol && getPropertyOfType(getTypeOfSymbol(containingType.symbol), propName2); + return prop !== void 0 && !!prop.valueDeclaration && isStatic(prop.valueDeclaration); + } + function getSuggestedLibForNonExistentName(name2) { + const missingName = diagnosticName(name2); + const allFeatures = getScriptTargetFeatures(); + const typeFeatures = allFeatures.get(missingName); + return typeFeatures && firstIterator(typeFeatures.keys()); + } + function getSuggestedLibForNonExistentProperty(missingProperty, containingType) { + const container = getApparentType(containingType).symbol; + if (!container) { + return void 0; + } + const containingTypeName = symbolName(container); + const allFeatures = getScriptTargetFeatures(); + const typeFeatures = allFeatures.get(containingTypeName); + if (typeFeatures) { + for (const [libTarget, featuresOfType] of typeFeatures) { + if (contains2(featuresOfType, missingProperty)) { + return libTarget; + } + } + } + } + function getSuggestedSymbolForNonexistentClassMember(name2, baseType) { + return getSpellingSuggestionForName( + name2, + getPropertiesOfType(baseType), + 106500 + /* ClassMember */ + ); + } + function getSuggestedSymbolForNonexistentProperty(name2, containingType) { + let props = getPropertiesOfType(containingType); + if (typeof name2 !== "string") { + const parent22 = name2.parent; + if (isPropertyAccessExpression(parent22)) { + props = filter2(props, (prop) => isValidPropertyAccessForCompletions(parent22, containingType, prop)); + } + name2 = idText(name2); + } + return getSpellingSuggestionForName( + name2, + props, + 111551 + /* Value */ + ); + } + function getSuggestedSymbolForNonexistentJSXAttribute(name2, containingType) { + const strName = isString4(name2) ? name2 : idText(name2); + const properties = getPropertiesOfType(containingType); + const jsxSpecific = strName === "for" ? find2(properties, (x7) => symbolName(x7) === "htmlFor") : strName === "class" ? find2(properties, (x7) => symbolName(x7) === "className") : void 0; + return jsxSpecific ?? getSpellingSuggestionForName( + strName, + properties, + 111551 + /* Value */ + ); + } + function getSuggestionForNonexistentProperty(name2, containingType) { + const suggestion = getSuggestedSymbolForNonexistentProperty(name2, containingType); + return suggestion && symbolName(suggestion); + } + function getSuggestedSymbolForNonexistentSymbol(location2, outerName, meaning) { + Debug.assert(outerName !== void 0, "outername should always be defined"); + const result2 = resolveNameHelper( + location2, + outerName, + meaning, + /*nameNotFoundMessage*/ + void 0, + outerName, + /*isUse*/ + false, + /*excludeGlobals*/ + false, + /*getSpellingSuggestions*/ + true, + (symbols, name2, meaning2) => { + Debug.assertEqual(outerName, name2, "name should equal outerName"); + const symbol = getSymbol2(symbols, name2, meaning2); + if (symbol) + return symbol; + let candidates; + if (symbols === globals3) { + const primitives = mapDefined( + ["string", "number", "boolean", "object", "bigint", "symbol"], + (s7) => symbols.has(s7.charAt(0).toUpperCase() + s7.slice(1)) ? createSymbol(524288, s7) : void 0 + ); + candidates = primitives.concat(arrayFrom(symbols.values())); + } else { + candidates = arrayFrom(symbols.values()); + } + return getSpellingSuggestionForName(unescapeLeadingUnderscores(name2), candidates, meaning2); + } + ); + return result2; + } + function getSuggestionForNonexistentSymbol(location2, outerName, meaning) { + const symbolResult = getSuggestedSymbolForNonexistentSymbol(location2, outerName, meaning); + return symbolResult && symbolName(symbolResult); + } + function getSuggestedSymbolForNonexistentModule(name2, targetModule) { + return targetModule.exports && getSpellingSuggestionForName( + idText(name2), + getExportsOfModuleAsArray(targetModule), + 2623475 + /* ModuleMember */ + ); + } + function getSuggestionForNonexistentExport(name2, targetModule) { + const suggestion = getSuggestedSymbolForNonexistentModule(name2, targetModule); + return suggestion && symbolName(suggestion); + } + function getSuggestionForNonexistentIndexSignature(objectType2, expr, keyedType) { + function hasProp(name2) { + const prop = getPropertyOfObjectType(objectType2, name2); + if (prop) { + const s7 = getSingleCallSignature(getTypeOfSymbol(prop)); + return !!s7 && getMinArgumentCount(s7) >= 1 && isTypeAssignableTo(keyedType, getTypeAtPosition(s7, 0)); + } + return false; + } + const suggestedMethod = isAssignmentTarget(expr) ? "set" : "get"; + if (!hasProp(suggestedMethod)) { + return void 0; + } + let suggestion = tryGetPropertyAccessOrIdentifierToString(expr.expression); + if (suggestion === void 0) { + suggestion = suggestedMethod; + } else { + suggestion += "." + suggestedMethod; + } + return suggestion; + } + function getSuggestedTypeForNonexistentStringLiteralType(source, target) { + const candidates = target.types.filter((type3) => !!(type3.flags & 128)); + return getSpellingSuggestion(source.value, candidates, (type3) => type3.value); + } + function getSpellingSuggestionForName(name2, symbols, meaning) { + return getSpellingSuggestion(name2, symbols, getCandidateName); + function getCandidateName(candidate) { + const candidateName = symbolName(candidate); + if (startsWith2(candidateName, '"')) { + return void 0; + } + if (candidate.flags & meaning) { + return candidateName; + } + if (candidate.flags & 2097152) { + const alias = tryResolveAlias(candidate); + if (alias && alias.flags & meaning) { + return candidateName; + } + } + return void 0; + } + } + function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isSelfTypeAccess2) { + const valueDeclaration = prop && prop.flags & 106500 && prop.valueDeclaration; + if (!valueDeclaration) { + return; + } + const hasPrivateModifier = hasEffectiveModifier( + valueDeclaration, + 2 + /* Private */ + ); + const hasPrivateIdentifier = prop.valueDeclaration && isNamedDeclaration(prop.valueDeclaration) && isPrivateIdentifier(prop.valueDeclaration.name); + if (!hasPrivateModifier && !hasPrivateIdentifier) { + return; + } + if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536)) { + return; + } + if (isSelfTypeAccess2) { + const containingMethod = findAncestor(nodeForCheckWriteOnly, isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; + } + } + (getCheckFlags(prop) & 1 ? getSymbolLinks(prop).target : prop).isReferenced = -1; + } + function isSelfTypeAccess(name2, parent22) { + return name2.kind === 110 || !!parent22 && isEntityNameExpression(name2) && parent22 === getResolvedSymbol(getFirstIdentifier(name2)); + } + function isValidPropertyAccess(node, propertyName) { + switch (node.kind) { + case 211: + return isValidPropertyAccessWithType(node, node.expression.kind === 108, propertyName, getWidenedType(checkExpression(node.expression))); + case 166: + return isValidPropertyAccessWithType( + node, + /*isSuper*/ + false, + propertyName, + getWidenedType(checkExpression(node.left)) + ); + case 205: + return isValidPropertyAccessWithType( + node, + /*isSuper*/ + false, + propertyName, + getTypeFromTypeNode(node) + ); + } + } + function isValidPropertyAccessForCompletions(node, type3, property2) { + return isPropertyAccessible( + node, + node.kind === 211 && node.expression.kind === 108, + /*isWrite*/ + false, + type3, + property2 + ); + } + function isValidPropertyAccessWithType(node, isSuper, propertyName, type3) { + if (isTypeAny(type3)) { + return true; + } + const prop = getPropertyOfType(type3, propertyName); + return !!prop && isPropertyAccessible( + node, + isSuper, + /*isWrite*/ + false, + type3, + prop + ); + } + function isPropertyAccessible(node, isSuper, isWrite, containingType, property2) { + if (isTypeAny(containingType)) { + return true; + } + if (property2.valueDeclaration && isPrivateIdentifierClassElementDeclaration(property2.valueDeclaration)) { + const declClass = getContainingClass(property2.valueDeclaration); + return !isOptionalChain(node) && !!findAncestor(node, (parent22) => parent22 === declClass); + } + return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType, property2); + } + function getForInVariableSymbol(node) { + const initializer = node.initializer; + if (initializer.kind === 261) { + const variable = initializer.declarations[0]; + if (variable && !isBindingPattern(variable.name)) { + return getSymbolOfDeclaration(variable); + } + } else if (initializer.kind === 80) { + return getResolvedSymbol(initializer); + } + return void 0; + } + function hasNumericPropertyNames(type3) { + return getIndexInfosOfType(type3).length === 1 && !!getIndexInfoOfType(type3, numberType2); + } + function isForInVariableForNumericPropertyNames(expr) { + const e10 = skipParentheses(expr); + if (e10.kind === 80) { + const symbol = getResolvedSymbol(e10); + if (symbol.flags & 3) { + let child = expr; + let node = expr.parent; + while (node) { + if (node.kind === 249 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { + return true; + } + child = node; + node = node.parent; + } + } + } + return false; + } + function checkIndexedAccess(node, checkMode) { + return node.flags & 64 ? checkElementAccessChain(node, checkMode) : checkElementAccessExpression(node, checkNonNullExpression(node.expression), checkMode); + } + function checkElementAccessChain(node, checkMode) { + const exprType = checkExpression(node.expression); + const nonOptionalType = getOptionalExpressionType(exprType, node.expression); + return propagateOptionalTypeMarker(checkElementAccessExpression(node, checkNonNullType(nonOptionalType, node.expression), checkMode), node, nonOptionalType !== exprType); + } + function checkElementAccessExpression(node, exprType, checkMode) { + const objectType2 = getAssignmentTargetKind(node) !== 0 || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType; + const indexExpression = node.argumentExpression; + const indexType = checkExpression(indexExpression); + if (isErrorType(objectType2) || objectType2 === silentNeverType) { + return objectType2; + } + if (isConstEnumObjectType(objectType2) && !isStringLiteralLike(indexExpression)) { + error22(indexExpression, Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); + return errorType; + } + const effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType2 : indexType; + const accessFlags = isAssignmentTarget(node) ? 4 | (isGenericObjectType(objectType2) && !isThisTypeParameter(objectType2) ? 2 : 0) : 32; + const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType2, effectiveIndexType, accessFlags, node) || errorType; + return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node); + } + function callLikeExpressionMayHaveTypeArguments(node) { + return isCallOrNewExpression(node) || isTaggedTemplateExpression(node) || isJsxOpeningLikeElement(node); + } + function resolveUntypedCall(node) { + if (callLikeExpressionMayHaveTypeArguments(node)) { + forEach4(node.typeArguments, checkSourceElement); + } + if (node.kind === 215) { + checkExpression(node.template); + } else if (isJsxOpeningLikeElement(node)) { + checkExpression(node.attributes); + } else if (isBinaryExpression(node)) { + checkExpression(node.left); + } else if (isCallOrNewExpression(node)) { + forEach4(node.arguments, (argument) => { + checkExpression(argument); + }); + } + return anySignature; + } + function resolveErrorCall(node) { + resolveUntypedCall(node); + return unknownSignature; + } + function reorderCandidates(signatures, result2, callChainFlags) { + let lastParent; + let lastSymbol; + let cutoffIndex = 0; + let index4; + let specializedIndex = -1; + let spliceIndex; + Debug.assert(!result2.length); + for (const signature of signatures) { + const symbol = signature.declaration && getSymbolOfDeclaration(signature.declaration); + const parent22 = signature.declaration && signature.declaration.parent; + if (!lastSymbol || symbol === lastSymbol) { + if (lastParent && parent22 === lastParent) { + index4 = index4 + 1; + } else { + lastParent = parent22; + index4 = cutoffIndex; + } + } else { + index4 = cutoffIndex = result2.length; + lastParent = parent22; + } + lastSymbol = symbol; + if (signatureHasLiteralTypes(signature)) { + specializedIndex++; + spliceIndex = specializedIndex; + cutoffIndex++; + } else { + spliceIndex = index4; + } + result2.splice(spliceIndex, 0, callChainFlags ? getOptionalCallSignature(signature, callChainFlags) : signature); + } + } + function isSpreadArgument(arg) { + return !!arg && (arg.kind === 230 || arg.kind === 237 && arg.isSpread); + } + function getSpreadArgumentIndex(args) { + return findIndex2(args, isSpreadArgument); + } + function acceptsVoid(t8) { + return !!(t8.flags & 16384); + } + function acceptsVoidUndefinedUnknownOrAny(t8) { + return !!(t8.flags & (16384 | 32768 | 2 | 1)); + } + function hasCorrectArity(node, args, signature, signatureHelpTrailingComma = false) { + let argCount; + let callIsIncomplete = false; + let effectiveParameterCount = getParameterCount(signature); + let effectiveMinimumArguments = getMinArgumentCount(signature); + if (node.kind === 215) { + argCount = args.length; + if (node.template.kind === 228) { + const lastSpan = last2(node.template.templateSpans); + callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; + } else { + const templateLiteral = node.template; + Debug.assert( + templateLiteral.kind === 15 + /* NoSubstitutionTemplateLiteral */ + ); + callIsIncomplete = !!templateLiteral.isUnterminated; + } + } else if (node.kind === 170) { + argCount = getDecoratorArgumentCount(node, signature); + } else if (node.kind === 226) { + argCount = 1; + } else if (isJsxOpeningLikeElement(node)) { + callIsIncomplete = node.attributes.end === node.end; + if (callIsIncomplete) { + return true; + } + argCount = effectiveMinimumArguments === 0 ? args.length : 1; + effectiveParameterCount = args.length === 0 ? effectiveParameterCount : 1; + effectiveMinimumArguments = Math.min(effectiveMinimumArguments, 1); + } else if (!node.arguments) { + Debug.assert( + node.kind === 214 + /* NewExpression */ + ); + return getMinArgumentCount(signature) === 0; + } else { + argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; + callIsIncomplete = node.arguments.end === node.end; + const spreadArgIndex = getSpreadArgumentIndex(args); + if (spreadArgIndex >= 0) { + return spreadArgIndex >= getMinArgumentCount(signature) && (hasEffectiveRestParameter(signature) || spreadArgIndex < getParameterCount(signature)); + } + } + if (!hasEffectiveRestParameter(signature) && argCount > effectiveParameterCount) { + return false; + } + if (callIsIncomplete || argCount >= effectiveMinimumArguments) { + return true; + } + for (let i7 = argCount; i7 < effectiveMinimumArguments; i7++) { + const type3 = getTypeAtPosition(signature, i7); + if (filterType(type3, isInJSFile(node) && !strictNullChecks ? acceptsVoidUndefinedUnknownOrAny : acceptsVoid).flags & 131072) { + return false; + } + } + return true; + } + function hasCorrectTypeArgumentArity(signature, typeArguments) { + const numTypeParameters = length(signature.typeParameters); + const minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters); + return !some2(typeArguments) || typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters; + } + function isInstantiatedGenericParameter(signature, pos) { + let type3; + return !!(signature.target && (type3 = tryGetTypeAtPosition(signature.target, pos)) && isGenericType(type3)); + } + function getSingleCallSignature(type3) { + return getSingleSignature( + type3, + 0, + /*allowMembers*/ + false + ); + } + function getSingleCallOrConstructSignature(type3) { + return getSingleSignature( + type3, + 0, + /*allowMembers*/ + false + ) || getSingleSignature( + type3, + 1, + /*allowMembers*/ + false + ); + } + function getSingleSignature(type3, kind, allowMembers) { + if (type3.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type3); + if (allowMembers || resolved.properties.length === 0 && resolved.indexInfos.length === 0) { + if (kind === 0 && resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0) { + return resolved.callSignatures[0]; + } + if (kind === 1 && resolved.constructSignatures.length === 1 && resolved.callSignatures.length === 0) { + return resolved.constructSignatures[0]; + } + } + } + return void 0; + } + function instantiateSignatureInContextOf(signature, contextualSignature, inferenceContext, compareTypes) { + const context2 = createInferenceContext(signature.typeParameters, signature, 0, compareTypes); + const restType = getEffectiveRestType(contextualSignature); + const mapper = inferenceContext && (restType && restType.flags & 262144 ? inferenceContext.nonFixingMapper : inferenceContext.mapper); + const sourceSignature = mapper ? instantiateSignature(contextualSignature, mapper) : contextualSignature; + applyToParameterTypes(sourceSignature, signature, (source, target) => { + inferTypes(context2.inferences, source, target); + }); + if (!inferenceContext) { + applyToReturnTypes(contextualSignature, signature, (source, target) => { + inferTypes( + context2.inferences, + source, + target, + 128 + /* ReturnType */ + ); + }); + } + return getSignatureInstantiation(signature, getInferredTypes(context2), isInJSFile(contextualSignature.declaration)); + } + function inferJsxTypeArguments(node, signature, checkMode, context2) { + const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); + const checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context2, checkMode); + inferTypes(context2.inferences, checkAttrType, paramType); + return getInferredTypes(context2); + } + function getThisArgumentType(thisArgumentNode) { + if (!thisArgumentNode) { + return voidType2; + } + const thisArgumentType = checkExpression(thisArgumentNode); + return isRightSideOfInstanceofExpression(thisArgumentNode) ? thisArgumentType : isOptionalChainRoot(thisArgumentNode.parent) ? getNonNullableType(thisArgumentType) : isOptionalChain(thisArgumentNode.parent) ? removeOptionalTypeMarker(thisArgumentType) : thisArgumentType; + } + function inferTypeArguments(node, signature, args, checkMode, context2) { + if (isJsxOpeningLikeElement(node)) { + return inferJsxTypeArguments(node, signature, checkMode, context2); + } + if (node.kind !== 170 && node.kind !== 226) { + const skipBindingPatterns = every2(signature.typeParameters, (p7) => !!getDefaultFromTypeParameter(p7)); + const contextualType = getContextualType2( + node, + skipBindingPatterns ? 8 : 0 + /* None */ + ); + if (contextualType) { + const inferenceTargetType = getReturnTypeOfSignature(signature); + if (couldContainTypeVariables(inferenceTargetType)) { + const outerContext = getInferenceContext(node); + const isFromBindingPattern = !skipBindingPatterns && getContextualType2( + node, + 8 + /* SkipBindingPatterns */ + ) !== contextualType; + if (!isFromBindingPattern) { + const outerMapper = getMapperFromContext(cloneInferenceContext( + outerContext, + 1 + /* NoDefault */ + )); + const instantiatedType = instantiateType(contextualType, outerMapper); + const contextualSignature = getSingleCallSignature(instantiatedType); + const inferenceSourceType = contextualSignature && contextualSignature.typeParameters ? getOrCreateTypeFromSignature(getSignatureInstantiationWithoutFillingInTypeArguments(contextualSignature, contextualSignature.typeParameters)) : instantiatedType; + inferTypes( + context2.inferences, + inferenceSourceType, + inferenceTargetType, + 128 + /* ReturnType */ + ); + } + const returnContext = createInferenceContext(signature.typeParameters, signature, context2.flags); + const returnSourceType = instantiateType(contextualType, outerContext && outerContext.returnMapper); + inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType); + context2.returnMapper = some2(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0; + } + } + } + const restType = getNonArrayRestType(signature); + const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; + if (restType && restType.flags & 262144) { + const info2 = find2(context2.inferences, (info22) => info22.typeParameter === restType); + if (info2) { + info2.impliedArity = findIndex2(args, isSpreadArgument, argCount) < 0 ? args.length - argCount : void 0; + } + } + const thisType = getThisTypeOfSignature(signature); + if (thisType && couldContainTypeVariables(thisType)) { + const thisArgumentNode = getThisArgumentOfCall(node); + inferTypes(context2.inferences, getThisArgumentType(thisArgumentNode), thisType); + } + for (let i7 = 0; i7 < argCount; i7++) { + const arg = args[i7]; + if (arg.kind !== 232) { + const paramType = getTypeAtPosition(signature, i7); + if (couldContainTypeVariables(paramType)) { + const argType = checkExpressionWithContextualType(arg, paramType, context2, checkMode); + inferTypes(context2.inferences, argType, paramType); + } + } + } + if (restType && couldContainTypeVariables(restType)) { + const spreadType = getSpreadArgumentType(args, argCount, args.length, restType, context2, checkMode); + inferTypes(context2.inferences, spreadType, restType); + } + return getInferredTypes(context2); + } + function getMutableArrayOrTupleType(type3) { + return type3.flags & 1048576 ? mapType2(type3, getMutableArrayOrTupleType) : type3.flags & 1 || isMutableArrayOrTuple(getBaseConstraintOfType(type3) || type3) ? type3 : isTupleType(type3) ? createTupleType( + getElementTypes(type3), + type3.target.elementFlags, + /*readonly*/ + false, + type3.target.labeledElementDeclarations + ) : createTupleType([type3], [ + 8 + /* Variadic */ + ]); + } + function getSpreadArgumentType(args, index4, argCount, restType, context2, checkMode) { + const inConstContext = isConstTypeVariable(restType); + if (index4 >= argCount - 1) { + const arg = args[argCount - 1]; + if (isSpreadArgument(arg)) { + const spreadType = arg.kind === 237 ? arg.type : checkExpressionWithContextualType(arg.expression, restType, context2, checkMode); + if (isArrayLikeType(spreadType)) { + return getMutableArrayOrTupleType(spreadType); + } + return createArrayType(checkIteratedTypeOrElementType(33, spreadType, undefinedType2, arg.kind === 230 ? arg.expression : arg), inConstContext); + } + } + const types3 = []; + const flags = []; + const names = []; + for (let i7 = index4; i7 < argCount; i7++) { + const arg = args[i7]; + if (isSpreadArgument(arg)) { + const spreadType = arg.kind === 237 ? arg.type : checkExpression(arg.expression); + if (isArrayLikeType(spreadType)) { + types3.push(spreadType); + flags.push( + 8 + /* Variadic */ + ); + } else { + types3.push(checkIteratedTypeOrElementType(33, spreadType, undefinedType2, arg.kind === 230 ? arg.expression : arg)); + flags.push( + 4 + /* Rest */ + ); + } + } else { + const contextualType = isTupleType(restType) ? getContextualTypeForElementExpression(restType, i7 - index4, argCount - index4) || unknownType2 : getIndexedAccessType( + restType, + getNumberLiteralType(i7 - index4), + 256 + /* Contextual */ + ); + const argType = checkExpressionWithContextualType(arg, contextualType, context2, checkMode); + const hasPrimitiveContextualType = inConstContext || maybeTypeOfKind( + contextualType, + 402784252 | 4194304 | 134217728 | 268435456 + /* StringMapping */ + ); + types3.push(hasPrimitiveContextualType ? getRegularTypeOfLiteralType(argType) : getWidenedLiteralType(argType)); + flags.push( + 1 + /* Required */ + ); + } + if (arg.kind === 237 && arg.tupleNameSource) { + names.push(arg.tupleNameSource); + } else { + names.push(void 0); + } + } + return createTupleType(types3, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names); + } + function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) { + const isJavascript = isInJSFile(signature.declaration); + const typeParameters = signature.typeParameters; + const typeArgumentTypes = fillMissingTypeArguments(map4(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); + let mapper; + for (let i7 = 0; i7 < typeArgumentNodes.length; i7++) { + Debug.assert(typeParameters[i7] !== void 0, "Should not call checkTypeArguments with too many type arguments"); + const constraint = getConstraintOfTypeParameter(typeParameters[i7]); + if (constraint) { + const errorInfo = reportErrors2 && headMessage ? () => chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Type_0_does_not_satisfy_the_constraint_1 + ) : void 0; + const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1; + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + const typeArgument = typeArgumentTypes[i7]; + if (!checkTypeAssignableTo( + typeArgument, + getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), + reportErrors2 ? typeArgumentNodes[i7] : void 0, + typeArgumentHeadMessage, + errorInfo + )) { + return void 0; + } + } + } + return typeArgumentTypes; + } + function getJsxReferenceKind(node) { + if (isJsxIntrinsicTagName(node.tagName)) { + return 2; + } + const tagType = getApparentType(checkExpression(node.tagName)); + if (length(getSignaturesOfType( + tagType, + 1 + /* Construct */ + ))) { + return 0; + } + if (length(getSignaturesOfType( + tagType, + 0 + /* Call */ + ))) { + return 1; + } + return 2; + } + function checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer) { + const paramType = getEffectiveFirstArgumentForJsxSignature(signature, node); + const attributesType = checkExpressionWithContextualType( + node.attributes, + paramType, + /*inferenceContext*/ + void 0, + checkMode + ); + const checkAttributesType = checkMode & 4 ? getRegularTypeOfObjectLiteral(attributesType) : attributesType; + return checkTagNameDoesNotExpectTooManyArguments() && checkTypeRelatedToAndOptionallyElaborate( + checkAttributesType, + paramType, + relation, + reportErrors2 ? node.tagName : void 0, + node.attributes, + /*headMessage*/ + void 0, + containingMessageChain, + errorOutputContainer + ); + function checkTagNameDoesNotExpectTooManyArguments() { + var _a2; + if (getJsxNamespaceContainerForImplicitImport(node)) { + return true; + } + const tagType = (isJsxOpeningElement(node) || isJsxSelfClosingElement(node)) && !(isJsxIntrinsicTagName(node.tagName) || isJsxNamespacedName(node.tagName)) ? checkExpression(node.tagName) : void 0; + if (!tagType) { + return true; + } + const tagCallSignatures = getSignaturesOfType( + tagType, + 0 + /* Call */ + ); + if (!length(tagCallSignatures)) { + return true; + } + const factory2 = getJsxFactoryEntity(node); + if (!factory2) { + return true; + } + const factorySymbol = resolveEntityName( + factory2, + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + false, + node + ); + if (!factorySymbol) { + return true; + } + const factoryType = getTypeOfSymbol(factorySymbol); + const callSignatures = getSignaturesOfType( + factoryType, + 0 + /* Call */ + ); + if (!length(callSignatures)) { + return true; + } + let hasFirstParamSignatures = false; + let maxParamCount = 0; + for (const sig of callSignatures) { + const firstparam = getTypeAtPosition(sig, 0); + const signaturesOfParam = getSignaturesOfType( + firstparam, + 0 + /* Call */ + ); + if (!length(signaturesOfParam)) + continue; + for (const paramSig of signaturesOfParam) { + hasFirstParamSignatures = true; + if (hasEffectiveRestParameter(paramSig)) { + return true; + } + const paramCount = getParameterCount(paramSig); + if (paramCount > maxParamCount) { + maxParamCount = paramCount; + } + } + } + if (!hasFirstParamSignatures) { + return true; + } + let absoluteMinArgCount = Infinity; + for (const tagSig of tagCallSignatures) { + const tagRequiredArgCount = getMinArgumentCount(tagSig); + if (tagRequiredArgCount < absoluteMinArgCount) { + absoluteMinArgCount = tagRequiredArgCount; + } + } + if (absoluteMinArgCount <= maxParamCount) { + return true; + } + if (reportErrors2) { + const diag2 = createDiagnosticForNode(node.tagName, Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, entityNameToString(node.tagName), absoluteMinArgCount, entityNameToString(factory2), maxParamCount); + const tagNameDeclaration = (_a2 = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a2.valueDeclaration; + if (tagNameDeclaration) { + addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(node.tagName))); + } + if (errorOutputContainer && errorOutputContainer.skipLogging) { + (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2); + } + if (!errorOutputContainer.skipLogging) { + diagnostics.add(diag2); + } + } + return false; + } + } + function getEffectiveCheckNode(argument) { + argument = skipParentheses(argument); + return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument; + } + function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) { + const errorOutputContainer = { errors: void 0, skipLogging: true }; + if (isJsxOpeningLikeElement(node)) { + if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "jsx should have errors when reporting errors"); + return errorOutputContainer.errors || emptyArray; + } + return void 0; + } + const thisType = getThisTypeOfSignature(signature); + if (thisType && thisType !== voidType2 && !(isNewExpression(node) || isCallExpression(node) && isSuperProperty(node.expression))) { + const thisArgumentNode = getThisArgumentOfCall(node); + const thisArgumentType = getThisArgumentType(thisArgumentNode); + const errorNode = reportErrors2 ? thisArgumentNode || node : void 0; + const headMessage2 = Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1; + if (!checkTypeRelatedTo(thisArgumentType, thisType, relation, errorNode, headMessage2, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "this parameter should have errors when reporting errors"); + return errorOutputContainer.errors || emptyArray; + } + } + const headMessage = Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1; + const restType = getNonArrayRestType(signature); + const argCount = restType ? Math.min(getParameterCount(signature) - 1, args.length) : args.length; + for (let i7 = 0; i7 < argCount; i7++) { + const arg = args[i7]; + if (arg.kind !== 232) { + const paramType = getTypeAtPosition(signature, i7); + const argType = checkExpressionWithContextualType( + arg, + paramType, + /*inferenceContext*/ + void 0, + checkMode + ); + const checkArgType = checkMode & 4 ? getRegularTypeOfObjectLiteral(argType) : argType; + const effectiveCheckArgumentNode = getEffectiveCheckNode(arg); + if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) { + Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(arg, checkArgType, paramType); + return errorOutputContainer.errors || emptyArray; + } + } + } + if (restType) { + const spreadType = getSpreadArgumentType( + args, + argCount, + args.length, + restType, + /*context*/ + void 0, + checkMode + ); + const restArgCount = args.length - argCount; + const errorNode = !reportErrors2 ? void 0 : restArgCount === 0 ? node : restArgCount === 1 ? getEffectiveCheckNode(args[argCount]) : setTextRangePosEnd(createSyntheticExpression(node, spreadType), args[argCount].pos, args[args.length - 1].end); + if (!checkTypeRelatedTo( + spreadType, + restType, + relation, + errorNode, + headMessage, + /*containingMessageChain*/ + void 0, + errorOutputContainer + )) { + Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "rest parameter should have errors when reporting errors"); + maybeAddMissingAwaitInfo(errorNode, spreadType, restType); + return errorOutputContainer.errors || emptyArray; + } + } + return void 0; + function maybeAddMissingAwaitInfo(errorNode, source, target) { + if (errorNode && reportErrors2 && errorOutputContainer.errors && errorOutputContainer.errors.length) { + if (getAwaitedTypeOfPromise(target)) { + return; + } + const awaitedTypeOfSource = getAwaitedTypeOfPromise(source); + if (awaitedTypeOfSource && isTypeRelatedTo(awaitedTypeOfSource, target, relation)) { + addRelatedInfo(errorOutputContainer.errors[0], createDiagnosticForNode(errorNode, Diagnostics.Did_you_forget_to_use_await)); + } + } + } + } + function getThisArgumentOfCall(node) { + if (node.kind === 226) { + return node.right; + } + const expression = node.kind === 213 ? node.expression : node.kind === 215 ? node.tag : node.kind === 170 && !legacyDecorators ? node.expression : void 0; + if (expression) { + const callee = skipOuterExpressions(expression); + if (isAccessExpression(callee)) { + return callee.expression; + } + } + } + function createSyntheticExpression(parent22, type3, isSpread, tupleNameSource) { + const result2 = parseNodeFactory.createSyntheticExpression(type3, isSpread, tupleNameSource); + setTextRange(result2, parent22); + setParent(result2, parent22); + return result2; + } + function getEffectiveCallArguments(node) { + if (node.kind === 215) { + const template2 = node.template; + const args2 = [createSyntheticExpression(template2, getGlobalTemplateStringsArrayType())]; + if (template2.kind === 228) { + forEach4(template2.templateSpans, (span) => { + args2.push(span.expression); + }); + } + return args2; + } + if (node.kind === 170) { + return getEffectiveDecoratorArguments(node); + } + if (node.kind === 226) { + return [node.left]; + } + if (isJsxOpeningLikeElement(node)) { + return node.attributes.properties.length > 0 || isJsxOpeningElement(node) && node.parent.children.length > 0 ? [node.attributes] : emptyArray; + } + const args = node.arguments || emptyArray; + const spreadIndex = getSpreadArgumentIndex(args); + if (spreadIndex >= 0) { + const effectiveArgs = args.slice(0, spreadIndex); + for (let i7 = spreadIndex; i7 < args.length; i7++) { + const arg = args[i7]; + const spreadType = arg.kind === 230 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression)); + if (spreadType && isTupleType(spreadType)) { + forEach4(getElementTypes(spreadType), (t8, i22) => { + var _a2; + const flags = spreadType.target.elementFlags[i22]; + const syntheticArg = createSyntheticExpression(arg, flags & 4 ? createArrayType(t8) : t8, !!(flags & 12), (_a2 = spreadType.target.labeledElementDeclarations) == null ? void 0 : _a2[i22]); + effectiveArgs.push(syntheticArg); + }); + } else { + effectiveArgs.push(arg); + } + } + return effectiveArgs; + } + return args; + } + function getEffectiveDecoratorArguments(node) { + const expr = node.expression; + const signature = getDecoratorCallSignature(node); + if (signature) { + const args = []; + for (const param of signature.parameters) { + const type3 = getTypeOfSymbol(param); + args.push(createSyntheticExpression(expr, type3)); + } + return args; + } + return Debug.fail(); + } + function getDecoratorArgumentCount(node, signature) { + return compilerOptions.experimentalDecorators ? getLegacyDecoratorArgumentCount(node, signature) : 2; + } + function getLegacyDecoratorArgumentCount(node, signature) { + switch (node.parent.kind) { + case 263: + case 231: + return 1; + case 172: + return hasAccessorModifier(node.parent) ? 3 : 2; + case 174: + case 177: + case 178: + return languageVersion === 0 || signature.parameters.length <= 2 ? 2 : 3; + case 169: + return 3; + default: + return Debug.fail(); + } + } + function getDiagnosticSpanForCallNode(node) { + const sourceFile = getSourceFileOfNode(node); + const { start, length: length2 } = getErrorSpanForNode(sourceFile, isPropertyAccessExpression(node.expression) ? node.expression.name : node.expression); + return { start, length: length2, sourceFile }; + } + function getDiagnosticForCallNode(node, message, ...args) { + if (isCallExpression(node)) { + const { sourceFile, start, length: length2 } = getDiagnosticSpanForCallNode(node); + if ("message" in message) { + return createFileDiagnostic(sourceFile, start, length2, message, ...args); + } + return createDiagnosticForFileFromMessageChain(sourceFile, message); + } else { + if ("message" in message) { + return createDiagnosticForNode(node, message, ...args); + } + return createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), node, message); + } + } + function getErrorNodeForCallNode(callLike) { + if (isCallOrNewExpression(callLike)) { + return isPropertyAccessExpression(callLike.expression) ? callLike.expression.name : callLike.expression; + } + if (isTaggedTemplateExpression(callLike)) { + return isPropertyAccessExpression(callLike.tag) ? callLike.tag.name : callLike.tag; + } + if (isJsxOpeningLikeElement(callLike)) { + return callLike.tagName; + } + return callLike; + } + function isPromiseResolveArityError(node) { + if (!isCallExpression(node) || !isIdentifier(node.expression)) + return false; + const symbol = resolveName( + node.expression, + node.expression.escapedText, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + const decl = symbol == null ? void 0 : symbol.valueDeclaration; + if (!decl || !isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !isNewExpression(decl.parent.parent) || !isIdentifier(decl.parent.parent.expression)) { + return false; + } + const globalPromiseSymbol = getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + false + ); + if (!globalPromiseSymbol) + return false; + const constructorSymbol = getSymbolAtLocation( + decl.parent.parent.expression, + /*ignoreErrors*/ + true + ); + return constructorSymbol === globalPromiseSymbol; + } + function getArgumentArityError(node, signatures, args, headMessage) { + var _a2; + const spreadIndex = getSpreadArgumentIndex(args); + if (spreadIndex > -1) { + return createDiagnosticForNode(args[spreadIndex], Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter); + } + let min22 = Number.POSITIVE_INFINITY; + let max2 = Number.NEGATIVE_INFINITY; + let maxBelow = Number.NEGATIVE_INFINITY; + let minAbove = Number.POSITIVE_INFINITY; + let closestSignature; + for (const sig of signatures) { + const minParameter = getMinArgumentCount(sig); + const maxParameter = getParameterCount(sig); + if (minParameter < min22) { + min22 = minParameter; + closestSignature = sig; + } + max2 = Math.max(max2, maxParameter); + if (minParameter < args.length && minParameter > maxBelow) + maxBelow = minParameter; + if (args.length < maxParameter && maxParameter < minAbove) + minAbove = maxParameter; + } + const hasRestParameter2 = some2(signatures, hasEffectiveRestParameter); + const parameterRange = hasRestParameter2 ? min22 : min22 < max2 ? min22 + "-" + max2 : min22; + const isVoidPromiseError = !hasRestParameter2 && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node); + if (isVoidPromiseError && isInJSFile(node)) { + return getDiagnosticForCallNode(node, Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments); + } + const error3 = isDecorator(node) ? hasRestParameter2 ? Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_at_least_0 : Diagnostics.The_runtime_will_invoke_the_decorator_with_1_arguments_but_the_decorator_expects_0 : hasRestParameter2 ? Diagnostics.Expected_at_least_0_arguments_but_got_1 : isVoidPromiseError ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise : Diagnostics.Expected_0_arguments_but_got_1; + if (min22 < args.length && args.length < max2) { + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, + args.length, + maxBelow, + minAbove + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + return getDiagnosticForCallNode(node, chain3); + } + return getDiagnosticForCallNode(node, Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove); + } else if (args.length < min22) { + let diagnostic; + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + error3, + parameterRange, + args.length + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + diagnostic = getDiagnosticForCallNode(node, chain3); + } else { + diagnostic = getDiagnosticForCallNode(node, error3, parameterRange, args.length); + } + const parameter = (_a2 = closestSignature == null ? void 0 : closestSignature.declaration) == null ? void 0 : _a2.parameters[closestSignature.thisParameter ? args.length + 1 : args.length]; + if (parameter) { + const messageAndArgs = isBindingPattern(parameter.name) ? [Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided] : isRestParameter(parameter) ? [Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided, idText(getFirstIdentifier(parameter.name))] : [Diagnostics.An_argument_for_0_was_not_provided, !parameter.name ? args.length : idText(getFirstIdentifier(parameter.name))]; + const parameterError = createDiagnosticForNode(parameter, ...messageAndArgs); + return addRelatedInfo(diagnostic, parameterError); + } + return diagnostic; + } else { + const errorSpan = factory.createNodeArray(args.slice(max2)); + const pos = first(errorSpan).pos; + let end = last2(errorSpan).end; + if (end === pos) { + end++; + } + setTextRangePosEnd(errorSpan, pos, end); + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + error3, + parameterRange, + args.length + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), errorSpan, chain3); + } + return createDiagnosticForNodeArray(getSourceFileOfNode(node), errorSpan, error3, parameterRange, args.length); + } + } + function getTypeArgumentArityError(node, signatures, typeArguments, headMessage) { + const argCount = typeArguments.length; + if (signatures.length === 1) { + const sig = signatures[0]; + const min22 = getMinTypeArgumentCount(sig.typeParameters); + const max2 = length(sig.typeParameters); + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + min22 < max2 ? min22 + "-" + max2 : min22, + argCount + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain3); + } + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, min22 < max2 ? min22 + "-" + max2 : min22, argCount); + } + let belowArgCount = -Infinity; + let aboveArgCount = Infinity; + for (const sig of signatures) { + const min22 = getMinTypeArgumentCount(sig.typeParameters); + const max2 = length(sig.typeParameters); + if (min22 > argCount) { + aboveArgCount = Math.min(aboveArgCount, min22); + } else if (max2 < argCount) { + belowArgCount = Math.max(belowArgCount, max2); + } + } + if (belowArgCount !== -Infinity && aboveArgCount !== Infinity) { + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, + argCount, + belowArgCount, + aboveArgCount + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain3); + } + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments, argCount, belowArgCount, aboveArgCount); + } + if (headMessage) { + let chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Expected_0_type_arguments_but_got_1, + belowArgCount === -Infinity ? aboveArgCount : belowArgCount, + argCount + ); + chain3 = chainDiagnosticMessages(chain3, headMessage); + return createDiagnosticForNodeArrayFromMessageChain(getSourceFileOfNode(node), typeArguments, chain3); + } + return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount); + } + function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) { + const isTaggedTemplate = node.kind === 215; + const isDecorator2 = node.kind === 170; + const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); + const isInstanceof = node.kind === 226; + const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray; + let typeArguments; + if (!isDecorator2 && !isInstanceof && !isSuperCall(node)) { + typeArguments = node.typeArguments; + if (isTaggedTemplate || isJsxOpeningOrSelfClosingElement || node.expression.kind !== 108) { + forEach4(typeArguments, checkSourceElement); + } + } + const candidates = candidatesOutArray || []; + reorderCandidates(signatures, candidates, callChainFlags); + Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this"); + const args = getEffectiveCallArguments(node); + const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters; + let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some2(args, isContextSensitive) ? 4 : 0; + let candidatesForArgumentError; + let candidateForArgumentArityError; + let candidateForTypeArgumentError; + let result2; + const signatureHelpTrailingComma = !!(checkMode & 16) && node.kind === 213 && node.arguments.hasTrailingComma; + if (candidates.length > 1) { + result2 = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + } + if (!result2) { + result2 = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma); + } + if (result2) { + return result2; + } + result2 = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode); + getNodeLinks(node).resolvedSignature = result2; + if (reportErrors2) { + if (!headMessage && isInstanceof) { + headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method; + } + if (candidatesForArgumentError) { + if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) { + const last22 = candidatesForArgumentError[candidatesForArgumentError.length - 1]; + let chain3; + if (candidatesForArgumentError.length > 3) { + chain3 = chainDiagnosticMessages(chain3, Diagnostics.The_last_overload_gave_the_following_error); + chain3 = chainDiagnosticMessages(chain3, Diagnostics.No_overload_matches_this_call); + } + if (headMessage) { + chain3 = chainDiagnosticMessages(chain3, headMessage); + } + const diags = getSignatureApplicabilityError( + node, + args, + last22, + assignableRelation, + 0, + /*reportErrors*/ + true, + () => chain3 + ); + if (diags) { + for (const d7 of diags) { + if (last22.declaration && candidatesForArgumentError.length > 3) { + addRelatedInfo(d7, createDiagnosticForNode(last22.declaration, Diagnostics.The_last_overload_is_declared_here)); + } + addImplementationSuccessElaboration(last22, d7); + diagnostics.add(d7); + } + } else { + Debug.fail("No error for last overload signature"); + } + } else { + const allDiagnostics = []; + let max2 = 0; + let min22 = Number.MAX_VALUE; + let minIndex = 0; + let i7 = 0; + for (const c7 of candidatesForArgumentError) { + const chain22 = () => chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Overload_0_of_1_2_gave_the_following_error, + i7 + 1, + candidates.length, + signatureToString(c7) + ); + const diags2 = getSignatureApplicabilityError( + node, + args, + c7, + assignableRelation, + 0, + /*reportErrors*/ + true, + chain22 + ); + if (diags2) { + if (diags2.length <= min22) { + min22 = diags2.length; + minIndex = i7; + } + max2 = Math.max(max2, diags2.length); + allDiagnostics.push(diags2); + } else { + Debug.fail("No error for 3 or fewer overload signatures"); + } + i7++; + } + const diags = max2 > 1 ? allDiagnostics[minIndex] : flatten2(allDiagnostics); + Debug.assert(diags.length > 0, "No errors reported for 3 or fewer overload signatures"); + let chain3 = chainDiagnosticMessages( + map4(diags, createDiagnosticMessageChainFromDiagnostic), + Diagnostics.No_overload_matches_this_call + ); + if (headMessage) { + chain3 = chainDiagnosticMessages(chain3, headMessage); + } + const related = [...flatMap2(diags, (d7) => d7.relatedInformation)]; + let diag2; + if (every2(diags, (d7) => d7.start === diags[0].start && d7.length === diags[0].length && d7.file === diags[0].file)) { + const { file, start, length: length2 } = diags[0]; + diag2 = { file, start, length: length2, code: chain3.code, category: chain3.category, messageText: chain3, relatedInformation: related }; + } else { + diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node), getErrorNodeForCallNode(node), chain3, related); + } + addImplementationSuccessElaboration(candidatesForArgumentError[0], diag2); + diagnostics.add(diag2); + } + } else if (candidateForArgumentArityError) { + diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage)); + } else if (candidateForTypeArgumentError) { + checkTypeArguments( + candidateForTypeArgumentError, + node.typeArguments, + /*reportErrors*/ + true, + headMessage + ); + } else { + const signaturesWithCorrectTypeArgumentArity = filter2(signatures, (s7) => hasCorrectTypeArgumentArity(s7, typeArguments)); + if (signaturesWithCorrectTypeArgumentArity.length === 0) { + diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage)); + } else { + diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage)); + } + } + } + return result2; + function addImplementationSuccessElaboration(failed, diagnostic) { + var _a2, _b; + const oldCandidatesForArgumentError = candidatesForArgumentError; + const oldCandidateForArgumentArityError = candidateForArgumentArityError; + const oldCandidateForTypeArgumentError = candidateForTypeArgumentError; + const failedSignatureDeclarations = ((_b = (_a2 = failed.declaration) == null ? void 0 : _a2.symbol) == null ? void 0 : _b.declarations) || emptyArray; + const isOverload2 = failedSignatureDeclarations.length > 1; + const implDecl = isOverload2 ? find2(failedSignatureDeclarations, (d7) => isFunctionLikeDeclaration(d7) && nodeIsPresent(d7.body)) : void 0; + if (implDecl) { + const candidate = getSignatureFromDeclaration(implDecl); + const isSingleNonGenericCandidate2 = !candidate.typeParameters; + if (chooseOverload([candidate], assignableRelation, isSingleNonGenericCandidate2)) { + addRelatedInfo(diagnostic, createDiagnosticForNode(implDecl, Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible)); + } + } + candidatesForArgumentError = oldCandidatesForArgumentError; + candidateForArgumentArityError = oldCandidateForArgumentArityError; + candidateForTypeArgumentError = oldCandidateForTypeArgumentError; + } + function chooseOverload(candidates2, relation, isSingleNonGenericCandidate2, signatureHelpTrailingComma2 = false) { + candidatesForArgumentError = void 0; + candidateForArgumentArityError = void 0; + candidateForTypeArgumentError = void 0; + if (isSingleNonGenericCandidate2) { + const candidate = candidates2[0]; + if (some2(typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { + return void 0; + } + if (getSignatureApplicabilityError( + node, + args, + candidate, + relation, + 0, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + candidatesForArgumentError = [candidate]; + return void 0; + } + return candidate; + } + for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) { + const candidate = candidates2[candidateIndex]; + if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) { + continue; + } + let checkCandidate; + let inferenceContext; + if (candidate.typeParameters) { + let typeArgumentTypes; + if (some2(typeArguments)) { + typeArgumentTypes = checkTypeArguments( + candidate, + typeArguments, + /*reportErrors*/ + false + ); + if (!typeArgumentTypes) { + candidateForTypeArgumentError = candidate; + continue; + } + } else { + inferenceContext = createInferenceContext( + candidate.typeParameters, + candidate, + /*flags*/ + isInJSFile(node) ? 2 : 0 + /* None */ + ); + typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8, inferenceContext); + argCheckMode |= inferenceContext.flags & 4 ? 8 : 0; + } + checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters); + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { + candidateForArgumentArityError = checkCandidate; + continue; + } + } else { + checkCandidate = candidate; + } + if (getSignatureApplicabilityError( + node, + args, + checkCandidate, + relation, + argCheckMode, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); + continue; + } + if (argCheckMode) { + argCheckMode = 0; + if (inferenceContext) { + const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext); + checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters); + if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) { + candidateForArgumentArityError = checkCandidate; + continue; + } + } + if (getSignatureApplicabilityError( + node, + args, + checkCandidate, + relation, + argCheckMode, + /*reportErrors*/ + false, + /*containingMessageChain*/ + void 0 + )) { + (candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate); + continue; + } + } + candidates2[candidateIndex] = checkCandidate; + return checkCandidate; + } + return void 0; + } + } + function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray, checkMode) { + Debug.assert(candidates.length > 0); + checkNodeDeferred(node); + return hasCandidatesOutArray || candidates.length === 1 || candidates.some((c7) => !!c7.typeParameters) ? pickLongestCandidateSignature(node, candidates, args, checkMode) : createUnionOfSignaturesForOverloadFailure(candidates); + } + function createUnionOfSignaturesForOverloadFailure(candidates) { + const thisParameters = mapDefined(candidates, (c7) => c7.thisParameter); + let thisParameter; + if (thisParameters.length) { + thisParameter = createCombinedSymbolFromTypes(thisParameters, thisParameters.map(getTypeOfParameter)); + } + const { min: minArgumentCount, max: maxNonRestParam } = minAndMax(candidates, getNumNonRestParameters); + const parameters = []; + for (let i7 = 0; i7 < maxNonRestParam; i7++) { + const symbols = mapDefined(candidates, (s7) => signatureHasRestParameter(s7) ? i7 < s7.parameters.length - 1 ? s7.parameters[i7] : last2(s7.parameters) : i7 < s7.parameters.length ? s7.parameters[i7] : void 0); + Debug.assert(symbols.length !== 0); + parameters.push(createCombinedSymbolFromTypes(symbols, mapDefined(candidates, (candidate) => tryGetTypeAtPosition(candidate, i7)))); + } + const restParameterSymbols = mapDefined(candidates, (c7) => signatureHasRestParameter(c7) ? last2(c7.parameters) : void 0); + let flags = 128; + if (restParameterSymbols.length !== 0) { + const type3 = createArrayType(getUnionType( + mapDefined(candidates, tryGetRestTypeOfSignature), + 2 + /* Subtype */ + )); + parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type3)); + flags |= 1; + } + if (candidates.some(signatureHasLiteralTypes)) { + flags |= 2; + } + return createSignature( + candidates[0].declaration, + /*typeParameters*/ + void 0, + // Before calling this we tested for `!candidates.some(c => !!c.typeParameters)`. + thisParameter, + parameters, + /*resolvedReturnType*/ + getIntersectionType(candidates.map(getReturnTypeOfSignature)), + /*resolvedTypePredicate*/ + void 0, + minArgumentCount, + flags + ); + } + function getNumNonRestParameters(signature) { + const numParams = signature.parameters.length; + return signatureHasRestParameter(signature) ? numParams - 1 : numParams; + } + function createCombinedSymbolFromTypes(sources, types3) { + return createCombinedSymbolForOverloadFailure(sources, getUnionType( + types3, + 2 + /* Subtype */ + )); + } + function createCombinedSymbolForOverloadFailure(sources, type3) { + return createSymbolWithType(first(sources), type3); + } + function pickLongestCandidateSignature(node, candidates, args, checkMode) { + const bestIndex = getLongestCandidateIndex(candidates, apparentArgumentCount === void 0 ? args.length : apparentArgumentCount); + const candidate = candidates[bestIndex]; + const { typeParameters } = candidate; + if (!typeParameters) { + return candidate; + } + const typeArgumentNodes = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : void 0; + const instantiated = typeArgumentNodes ? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isInJSFile(node))) : inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode); + candidates[bestIndex] = instantiated; + return instantiated; + } + function getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isJs) { + const typeArguments = typeArgumentNodes.map(getTypeOfNode); + while (typeArguments.length > typeParameters.length) { + typeArguments.pop(); + } + while (typeArguments.length < typeParameters.length) { + typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs)); + } + return typeArguments; + } + function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode) { + const inferenceContext = createInferenceContext( + typeParameters, + candidate, + /*flags*/ + isInJSFile(node) ? 2 : 0 + /* None */ + ); + const typeArgumentTypes = inferTypeArguments(node, candidate, args, checkMode | 4 | 8, inferenceContext); + return createSignatureInstantiation(candidate, typeArgumentTypes); + } + function getLongestCandidateIndex(candidates, argsCount) { + let maxParamsIndex = -1; + let maxParams = -1; + for (let i7 = 0; i7 < candidates.length; i7++) { + const candidate = candidates[i7]; + const paramCount = getParameterCount(candidate); + if (hasEffectiveRestParameter(candidate) || paramCount >= argsCount) { + return i7; + } + if (paramCount > maxParams) { + maxParams = paramCount; + maxParamsIndex = i7; + } + } + return maxParamsIndex; + } + function resolveCallExpression(node, candidatesOutArray, checkMode) { + if (node.expression.kind === 108) { + const superType = checkSuperExpression(node.expression); + if (isTypeAny(superType)) { + for (const arg of node.arguments) { + checkExpression(arg); + } + return anySignature; + } + if (!isErrorType(superType)) { + const baseTypeNode = getEffectiveBaseTypeNode(getContainingClass(node)); + if (baseTypeNode) { + const baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); + return resolveCall( + node, + baseConstructors, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + } + } + return resolveUntypedCall(node); + } + let callChainFlags; + let funcType = checkExpression(node.expression); + if (isCallChain(node)) { + const nonOptionalType = getOptionalExpressionType(funcType, node.expression); + callChainFlags = nonOptionalType === funcType ? 0 : isOutermostOptionalChain(node) ? 16 : 8; + funcType = nonOptionalType; + } else { + callChainFlags = 0; + } + funcType = checkNonNullTypeWithReporter( + funcType, + node.expression, + reportCannotInvokePossiblyNullOrUndefinedError + ); + if (funcType === silentNeverType) { + return silentNeverSignature; + } + const apparentType = getApparentType(funcType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const callSignatures = getSignaturesOfType( + apparentType, + 0 + /* Call */ + ); + const numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* Construct */ + ).length; + if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { + if (!isErrorType(funcType) && node.typeArguments) { + error22(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + if (numConstructSignatures) { + error22(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + } else { + let relatedInformation; + if (node.arguments.length === 1) { + const text = getSourceFileOfNode(node).text; + if (isLineBreak2(text.charCodeAt(skipTrivia( + text, + node.expression.end, + /*stopAfterLineBreak*/ + true + ) - 1))) { + relatedInformation = createDiagnosticForNode(node.expression, Diagnostics.Are_you_missing_a_semicolon); + } + } + invocationError(node.expression, apparentType, 0, relatedInformation); + } + return resolveErrorCall(node); + } + if (checkMode & 8 && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) { + skippedGenericFunction(node, checkMode); + return resolvingSignature; + } + if (callSignatures.some((sig) => isInJSFile(sig.declaration) && !!getJSDocClassTag(sig.declaration))) { + error22(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags); + } + function isGenericFunctionReturningFunction(signature) { + return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature))); + } + function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) { + return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576) && !(getReducedType(apparentFuncType).flags & 131072) && isTypeAssignableTo(funcType, globalFunctionType); + } + function resolveNewExpression(node, candidatesOutArray, checkMode) { + if (node.arguments && languageVersion < 1) { + const spreadIndex = getSpreadArgumentIndex(node.arguments); + if (spreadIndex >= 0) { + error22(node.arguments[spreadIndex], Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher); + } + } + let expressionType = checkNonNullExpression(node.expression); + if (expressionType === silentNeverType) { + return silentNeverSignature; + } + expressionType = getApparentType(expressionType); + if (isErrorType(expressionType)) { + return resolveErrorCall(node); + } + if (isTypeAny(expressionType)) { + if (node.typeArguments) { + error22(node, Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); + } + return resolveUntypedCall(node); + } + const constructSignatures = getSignaturesOfType( + expressionType, + 1 + /* Construct */ + ); + if (constructSignatures.length) { + if (!isConstructorAccessible(node, constructSignatures[0])) { + return resolveErrorCall(node); + } + if (someSignature(constructSignatures, (signature) => !!(signature.flags & 4))) { + error22(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + return resolveErrorCall(node); + } + const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol); + if (valueDecl && hasSyntacticModifier( + valueDecl, + 64 + /* Abstract */ + )) { + error22(node, Diagnostics.Cannot_create_an_instance_of_an_abstract_class); + return resolveErrorCall(node); + } + return resolveCall( + node, + constructSignatures, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + } + const callSignatures = getSignaturesOfType( + expressionType, + 0 + /* Call */ + ); + if (callSignatures.length) { + const signature = resolveCall( + node, + callSignatures, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + if (!noImplicitAny) { + if (signature.declaration && !isJSConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType2) { + error22(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); + } + if (getThisTypeOfSignature(signature) === voidType2) { + error22(node, Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void); + } + } + return signature; + } + invocationError( + node.expression, + expressionType, + 1 + /* Construct */ + ); + return resolveErrorCall(node); + } + function someSignature(signatures, f8) { + if (isArray3(signatures)) { + return some2(signatures, (signature) => someSignature(signature, f8)); + } + return signatures.compositeKind === 1048576 ? some2(signatures.compositeSignatures, f8) : f8(signatures); + } + function typeHasProtectedAccessibleBase(target, type3) { + const baseTypes = getBaseTypes(type3); + if (!length(baseTypes)) { + return false; + } + const firstBase = baseTypes[0]; + if (firstBase.flags & 2097152) { + const types3 = firstBase.types; + const mixinFlags = findMixins(types3); + let i7 = 0; + for (const intersectionMember of firstBase.types) { + if (!mixinFlags[i7]) { + if (getObjectFlags(intersectionMember) & (1 | 2)) { + if (intersectionMember.symbol === target) { + return true; + } + if (typeHasProtectedAccessibleBase(target, intersectionMember)) { + return true; + } + } + } + i7++; + } + return false; + } + if (firstBase.symbol === target) { + return true; + } + return typeHasProtectedAccessibleBase(target, firstBase); + } + function isConstructorAccessible(node, signature) { + if (!signature || !signature.declaration) { + return true; + } + const declaration = signature.declaration; + const modifiers = getSelectedEffectiveModifierFlags( + declaration, + 6 + /* NonPublicAccessibilityModifier */ + ); + if (!modifiers || declaration.kind !== 176) { + return true; + } + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); + const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol); + if (!isNodeWithinClass(node, declaringClassDeclaration)) { + const containingClass = getContainingClass(node); + if (containingClass && modifiers & 4) { + const containingType = getTypeOfNode(containingClass); + if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType)) { + return true; + } + } + if (modifiers & 2) { + error22(node, Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + } + if (modifiers & 4) { + error22(node, Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration, typeToString(declaringClass)); + } + return false; + } + return true; + } + function invocationErrorDetails(errorTarget, apparentType, kind) { + let errorInfo; + const isCall = kind === 0; + const awaitedType = getAwaitedType(apparentType); + const maybeMissingAwait = awaitedType && getSignaturesOfType(awaitedType, kind).length > 0; + if (apparentType.flags & 1048576) { + const types3 = apparentType.types; + let hasSignatures = false; + for (const constituent of types3) { + const signatures = getSignaturesOfType(constituent, kind); + if (signatures.length !== 0) { + hasSignatures = true; + if (errorInfo) { + break; + } + } else { + if (!errorInfo) { + errorInfo = chainDiagnosticMessages( + errorInfo, + isCall ? Diagnostics.Type_0_has_no_call_signatures : Diagnostics.Type_0_has_no_construct_signatures, + typeToString(constituent) + ); + errorInfo = chainDiagnosticMessages( + errorInfo, + isCall ? Diagnostics.Not_all_constituents_of_type_0_are_callable : Diagnostics.Not_all_constituents_of_type_0_are_constructable, + typeToString(apparentType) + ); + } + if (hasSignatures) { + break; + } + } + } + if (!hasSignatures) { + errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + isCall ? Diagnostics.No_constituent_of_type_0_is_callable : Diagnostics.No_constituent_of_type_0_is_constructable, + typeToString(apparentType) + ); + } + if (!errorInfo) { + errorInfo = chainDiagnosticMessages( + errorInfo, + isCall ? Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other : Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other, + typeToString(apparentType) + ); + } + } else { + errorInfo = chainDiagnosticMessages( + errorInfo, + isCall ? Diagnostics.Type_0_has_no_call_signatures : Diagnostics.Type_0_has_no_construct_signatures, + typeToString(apparentType) + ); + } + let headMessage = isCall ? Diagnostics.This_expression_is_not_callable : Diagnostics.This_expression_is_not_constructable; + if (isCallExpression(errorTarget.parent) && errorTarget.parent.arguments.length === 0) { + const { resolvedSymbol } = getNodeLinks(errorTarget); + if (resolvedSymbol && resolvedSymbol.flags & 32768) { + headMessage = Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without; + } + } + return { + messageChain: chainDiagnosticMessages(errorInfo, headMessage), + relatedMessage: maybeMissingAwait ? Diagnostics.Did_you_forget_to_use_await : void 0 + }; + } + function invocationError(errorTarget, apparentType, kind, relatedInformation) { + const { messageChain, relatedMessage: relatedInfo } = invocationErrorDetails(errorTarget, apparentType, kind); + const diagnostic = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorTarget), errorTarget, messageChain); + if (relatedInfo) { + addRelatedInfo(diagnostic, createDiagnosticForNode(errorTarget, relatedInfo)); + } + if (isCallExpression(errorTarget.parent)) { + const { start, length: length2 } = getDiagnosticSpanForCallNode(errorTarget.parent); + diagnostic.start = start; + diagnostic.length = length2; + } + diagnostics.add(diagnostic); + invocationErrorRecovery(apparentType, kind, relatedInformation ? addRelatedInfo(diagnostic, relatedInformation) : diagnostic); + } + function invocationErrorRecovery(apparentType, kind, diagnostic) { + if (!apparentType.symbol) { + return; + } + const importNode = getSymbolLinks(apparentType.symbol).originatingImport; + if (importNode && !isImportCall(importNode)) { + const sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + addRelatedInfo(diagnostic, createDiagnosticForNode(importNode, Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead)); + } + } + function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) { + const tagType = checkExpression(node.tag); + const apparentType = getApparentType(tagType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const callSignatures = getSignaturesOfType( + apparentType, + 0 + /* Call */ + ); + const numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* Construct */ + ).length; + if (isUntypedFunctionCall(tagType, apparentType, callSignatures.length, numConstructSignatures)) { + return resolveUntypedCall(node); + } + if (!callSignatures.length) { + if (isArrayLiteralExpression(node.parent)) { + const diagnostic = createDiagnosticForNode(node.tag, Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked); + diagnostics.add(diagnostic); + return resolveErrorCall(node); + } + invocationError( + node.tag, + apparentType, + 0 + /* Call */ + ); + return resolveErrorCall(node); + } + return resolveCall( + node, + callSignatures, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + } + function getDiagnosticHeadMessageForDecoratorResolution(node) { + switch (node.parent.kind) { + case 263: + case 231: + return Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; + case 169: + return Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; + case 172: + return Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; + case 174: + case 177: + case 178: + return Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; + default: + return Debug.fail(); + } + } + function resolveDecorator(node, candidatesOutArray, checkMode) { + const funcType = checkExpression(node.expression); + const apparentType = getApparentType(funcType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const callSignatures = getSignaturesOfType( + apparentType, + 0 + /* Call */ + ); + const numConstructSignatures = getSignaturesOfType( + apparentType, + 1 + /* Construct */ + ).length; + if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) { + return resolveUntypedCall(node); + } + if (isPotentiallyUncalledDecorator(node, callSignatures) && !isParenthesizedExpression(node.expression)) { + const nodeStr = getTextOfNode( + node.expression, + /*includeTrivia*/ + false + ); + error22(node, Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); + return resolveErrorCall(node); + } + const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); + if (!callSignatures.length) { + const errorDetails = invocationErrorDetails( + node.expression, + apparentType, + 0 + /* Call */ + ); + const messageChain = chainDiagnosticMessages(errorDetails.messageChain, headMessage); + const diag2 = createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(node.expression), node.expression, messageChain); + if (errorDetails.relatedMessage) { + addRelatedInfo(diag2, createDiagnosticForNode(node.expression, errorDetails.relatedMessage)); + } + diagnostics.add(diag2); + invocationErrorRecovery(apparentType, 0, diag2); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0, headMessage); + } + function createSignatureForJSXIntrinsic(node, result2) { + const namespace = getJsxNamespaceAt(node); + const exports29 = namespace && getExportsOfSymbol(namespace); + const typeSymbol = exports29 && getSymbol2( + exports29, + JsxNames.Element, + 788968 + /* Type */ + ); + const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968, node); + const declaration = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "props", + /*questionToken*/ + void 0, + nodeBuilder.typeToTypeNode(result2, node) + )], + returnNode ? factory.createTypeReferenceNode( + returnNode, + /*typeArguments*/ + void 0 + ) : factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ); + const parameterSymbol = createSymbol(1, "props"); + parameterSymbol.links.type = result2; + return createSignature( + declaration, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [parameterSymbol], + typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType, + /*resolvedTypePredicate*/ + void 0, + 1, + 0 + /* None */ + ); + } + function resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode) { + if (isJsxIntrinsicTagName(node.tagName)) { + const result2 = getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + const fakeSignature = createSignatureForJSXIntrinsic(node, result2); + checkTypeAssignableToAndOptionallyElaborate(checkExpressionWithContextualType( + node.attributes, + getEffectiveFirstArgumentForJsxSignature(fakeSignature, node), + /*inferenceContext*/ + void 0, + 0 + /* Normal */ + ), result2, node.tagName, node.attributes); + if (length(node.typeArguments)) { + forEach4(node.typeArguments, checkSourceElement); + diagnostics.add(createDiagnosticForNodeArray(getSourceFileOfNode(node), node.typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, 0, length(node.typeArguments))); + } + return fakeSignature; + } + const exprTypes = checkExpression(node.tagName); + const apparentType = getApparentType(exprTypes); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node); + if (isUntypedFunctionCall( + exprTypes, + apparentType, + signatures.length, + /*constructSignatures*/ + 0 + )) { + return resolveUntypedCall(node); + } + if (signatures.length === 0) { + error22(node.tagName, Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures, getTextOfNode(node.tagName)); + return resolveErrorCall(node); + } + return resolveCall( + node, + signatures, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + } + function resolveInstanceofExpression(node, candidatesOutArray, checkMode) { + const rightType = checkExpression(node.right); + if (!isTypeAny(rightType)) { + const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(rightType); + if (hasInstanceMethodType) { + const apparentType = getApparentType(hasInstanceMethodType); + if (isErrorType(apparentType)) { + return resolveErrorCall(node); + } + const callSignatures = getSignaturesOfType( + apparentType, + 0 + /* Call */ + ); + const constructSignatures = getSignaturesOfType( + apparentType, + 1 + /* Construct */ + ); + if (isUntypedFunctionCall(hasInstanceMethodType, apparentType, callSignatures.length, constructSignatures.length)) { + return resolveUntypedCall(node); + } + if (callSignatures.length) { + return resolveCall( + node, + callSignatures, + candidatesOutArray, + checkMode, + 0 + /* None */ + ); + } + } else if (!(typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { + error22(node.right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_a_class_function_or_other_type_assignable_to_the_Function_interface_type_or_an_object_type_with_a_Symbol_hasInstance_method); + return resolveErrorCall(node); + } + } + return anySignature; + } + function isPotentiallyUncalledDecorator(decorator, signatures) { + return signatures.length && every2(signatures, (signature) => signature.minArgumentCount === 0 && !signatureHasRestParameter(signature) && signature.parameters.length < getDecoratorArgumentCount(decorator, signature)); + } + function resolveSignature(node, candidatesOutArray, checkMode) { + switch (node.kind) { + case 213: + return resolveCallExpression(node, candidatesOutArray, checkMode); + case 214: + return resolveNewExpression(node, candidatesOutArray, checkMode); + case 215: + return resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode); + case 170: + return resolveDecorator(node, candidatesOutArray, checkMode); + case 286: + case 285: + return resolveJsxOpeningLikeElement(node, candidatesOutArray, checkMode); + case 226: + return resolveInstanceofExpression(node, candidatesOutArray, checkMode); + } + Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); + } + function getResolvedSignature(node, candidatesOutArray, checkMode) { + const links = getNodeLinks(node); + const cached = links.resolvedSignature; + if (cached && cached !== resolvingSignature && !candidatesOutArray) { + return cached; + } + links.resolvedSignature = resolvingSignature; + let result2 = resolveSignature( + node, + candidatesOutArray, + checkMode || 0 + /* Normal */ + ); + if (result2 !== resolvingSignature) { + if (links.resolvedSignature !== resolvingSignature) { + result2 = links.resolvedSignature; + } + links.resolvedSignature = flowLoopStart === flowLoopCount ? result2 : cached; + } + return result2; + } + function isJSConstructor(node) { + var _a2; + if (!node || !isInJSFile(node)) { + return false; + } + const func = isFunctionDeclaration(node) || isFunctionExpression(node) ? node : (isVariableDeclaration(node) || isPropertyAssignment(node)) && node.initializer && isFunctionExpression(node.initializer) ? node.initializer : void 0; + if (func) { + if (getJSDocClassTag(node)) + return true; + if (isPropertyAssignment(walkUpParenthesizedExpressions(func.parent))) + return false; + const symbol = getSymbolOfDeclaration(func); + return !!((_a2 = symbol == null ? void 0 : symbol.members) == null ? void 0 : _a2.size); + } + return false; + } + function mergeJSSymbols(target, source) { + var _a2, _b; + if (source) { + const links = getSymbolLinks(source); + if (!links.inferredClassSymbol || !links.inferredClassSymbol.has(getSymbolId(target))) { + const inferred = isTransientSymbol(target) ? target : cloneSymbol2(target); + inferred.exports = inferred.exports || createSymbolTable(); + inferred.members = inferred.members || createSymbolTable(); + inferred.flags |= source.flags & 32; + if ((_a2 = source.exports) == null ? void 0 : _a2.size) { + mergeSymbolTable(inferred.exports, source.exports); + } + if ((_b = source.members) == null ? void 0 : _b.size) { + mergeSymbolTable(inferred.members, source.members); + } + (links.inferredClassSymbol || (links.inferredClassSymbol = /* @__PURE__ */ new Map())).set(getSymbolId(inferred), inferred); + return inferred; + } + return links.inferredClassSymbol.get(getSymbolId(target)); + } + } + function getAssignedClassSymbol(decl) { + var _a2; + const assignmentSymbol = decl && getSymbolOfExpando( + decl, + /*allowDeclaration*/ + true + ); + const prototype = (_a2 = assignmentSymbol == null ? void 0 : assignmentSymbol.exports) == null ? void 0 : _a2.get("prototype"); + const init2 = (prototype == null ? void 0 : prototype.valueDeclaration) && getAssignedJSPrototype(prototype.valueDeclaration); + return init2 ? getSymbolOfDeclaration(init2) : void 0; + } + function getSymbolOfExpando(node, allowDeclaration) { + if (!node.parent) { + return void 0; + } + let name2; + let decl; + if (isVariableDeclaration(node.parent) && node.parent.initializer === node) { + if (!isInJSFile(node) && !(isVarConstLike(node.parent) && isFunctionLikeDeclaration(node))) { + return void 0; + } + name2 = node.parent.name; + decl = node.parent; + } else if (isBinaryExpression(node.parent)) { + const parentNode = node.parent; + const parentNodeOperator = node.parent.operatorToken.kind; + if (parentNodeOperator === 64 && (allowDeclaration || parentNode.right === node)) { + name2 = parentNode.left; + decl = name2; + } else if (parentNodeOperator === 57 || parentNodeOperator === 61) { + if (isVariableDeclaration(parentNode.parent) && parentNode.parent.initializer === parentNode) { + name2 = parentNode.parent.name; + decl = parentNode.parent; + } else if (isBinaryExpression(parentNode.parent) && parentNode.parent.operatorToken.kind === 64 && (allowDeclaration || parentNode.parent.right === parentNode)) { + name2 = parentNode.parent.left; + decl = name2; + } + if (!name2 || !isBindableStaticNameExpression(name2) || !isSameEntityName(name2, parentNode.left)) { + return void 0; + } + } + } else if (allowDeclaration && isFunctionDeclaration(node)) { + name2 = node.name; + decl = node; + } + if (!decl || !name2 || !allowDeclaration && !getExpandoInitializer(node, isPrototypeAccess(name2))) { + return void 0; + } + return getSymbolOfNode(decl); + } + function getAssignedJSPrototype(node) { + if (!node.parent) { + return false; + } + let parent22 = node.parent; + while (parent22 && parent22.kind === 211) { + parent22 = parent22.parent; + } + if (parent22 && isBinaryExpression(parent22) && isPrototypeAccess(parent22.left) && parent22.operatorToken.kind === 64) { + const right = getInitializerOfBinaryExpression(parent22); + return isObjectLiteralExpression(right) && right; + } + } + function checkCallExpression(node, checkMode) { + var _a2, _b, _c; + checkGrammarTypeArguments(node, node.typeArguments); + const signature = getResolvedSignature( + node, + /*candidatesOutArray*/ + void 0, + checkMode + ); + if (signature === resolvingSignature) { + return silentNeverType; + } + checkDeprecatedSignature(signature, node); + if (node.expression.kind === 108) { + return voidType2; + } + if (node.kind === 214) { + const declaration = signature.declaration; + if (declaration && declaration.kind !== 176 && declaration.kind !== 180 && declaration.kind !== 185 && !(isJSDocSignature(declaration) && ((_b = (_a2 = getJSDocRoot(declaration)) == null ? void 0 : _a2.parent) == null ? void 0 : _b.kind) === 176) && !isJSDocConstructSignature(declaration) && !isJSConstructor(declaration)) { + if (noImplicitAny) { + error22(node, Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); + } + return anyType2; + } + } + if (isInJSFile(node) && isCommonJsRequire(node)) { + return resolveExternalModuleTypeByLiteral(node.arguments[0]); + } + const returnType = getReturnTypeOfSignature(signature); + if (returnType.flags & 12288 && isSymbolOrSymbolForCall(node)) { + return getESSymbolLikeTypeForNode(walkUpParenthesizedExpressions(node.parent)); + } + if (node.kind === 213 && !node.questionDotToken && node.parent.kind === 244 && returnType.flags & 16384 && getTypePredicateOfSignature(signature)) { + if (!isDottedName(node.expression)) { + error22(node.expression, Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name); + } else if (!getEffectsSignature(node)) { + const diagnostic = error22(node.expression, Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation); + getTypeOfDottedName(node.expression, diagnostic); + } + } + if (isInJSFile(node)) { + const jsSymbol = getSymbolOfExpando( + node, + /*allowDeclaration*/ + false + ); + if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) { + const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray); + jsAssignmentType.objectFlags |= 4096; + return getIntersectionType([returnType, jsAssignmentType]); + } + } + return returnType; + } + function checkDeprecatedSignature(signature, node) { + if (signature.flags & 128) + return; + if (signature.declaration && signature.declaration.flags & 536870912) { + const suggestionNode = getDeprecatedSuggestionNode(node); + const name2 = tryGetPropertyAccessOrIdentifierToString(getInvokedExpression(node)); + addDeprecatedSuggestionWithSignature(suggestionNode, signature.declaration, name2, signatureToString(signature)); + } + } + function getDeprecatedSuggestionNode(node) { + node = skipParentheses(node); + switch (node.kind) { + case 213: + case 170: + case 214: + return getDeprecatedSuggestionNode(node.expression); + case 215: + return getDeprecatedSuggestionNode(node.tag); + case 286: + case 285: + return getDeprecatedSuggestionNode(node.tagName); + case 212: + return node.argumentExpression; + case 211: + return node.name; + case 183: + const typeReference = node; + return isQualifiedName(typeReference.typeName) ? typeReference.typeName.right : typeReference; + default: + return node; + } + } + function isSymbolOrSymbolForCall(node) { + if (!isCallExpression(node)) + return false; + let left = node.expression; + if (isPropertyAccessExpression(left) && left.name.escapedText === "for") { + left = left.expression; + } + if (!isIdentifier(left) || left.escapedText !== "Symbol") { + return false; + } + const globalESSymbol = getGlobalESSymbolConstructorSymbol( + /*reportErrors*/ + false + ); + if (!globalESSymbol) { + return false; + } + return globalESSymbol === resolveName( + left, + "Symbol", + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + } + function checkImportCallExpression(node) { + checkGrammarImportCallExpression(node); + if (node.arguments.length === 0) { + return createPromiseReturnType(node, anyType2); + } + const specifier = node.arguments[0]; + const specifierType = checkExpressionCached(specifier); + const optionsType = node.arguments.length > 1 ? checkExpressionCached(node.arguments[1]) : void 0; + for (let i7 = 2; i7 < node.arguments.length; ++i7) { + checkExpressionCached(node.arguments[i7]); + } + if (specifierType.flags & 32768 || specifierType.flags & 65536 || !isTypeAssignableTo(specifierType, stringType2)) { + error22(specifier, Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0, typeToString(specifierType)); + } + if (optionsType) { + const importCallOptionsType = getGlobalImportCallOptionsType( + /*reportErrors*/ + true + ); + if (importCallOptionsType !== emptyObjectType) { + checkTypeAssignableTo(optionsType, getNullableType( + importCallOptionsType, + 32768 + /* Undefined */ + ), node.arguments[1]); + } + } + const moduleSymbol = resolveExternalModuleName(node, specifier); + if (moduleSymbol) { + const esModuleSymbol = resolveESModuleSymbol( + moduleSymbol, + specifier, + /*dontResolveAlias*/ + true, + /*suppressInteropError*/ + false + ); + if (esModuleSymbol) { + return createPromiseReturnType( + node, + getTypeWithSyntheticDefaultOnly(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) || getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier) + ); + } + } + return createPromiseReturnType(node, anyType2); + } + function createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol) { + const memberTable = createSymbolTable(); + const newSymbol = createSymbol( + 2097152, + "default" + /* Default */ + ); + newSymbol.parent = originalSymbol; + newSymbol.links.nameType = getStringLiteralType("default"); + newSymbol.links.aliasTarget = resolveSymbol(symbol); + memberTable.set("default", newSymbol); + return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray); + } + function getTypeWithSyntheticDefaultOnly(type3, symbol, originalSymbol, moduleSpecifier) { + const hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier); + if (hasDefaultOnly && type3 && !isErrorType(type3)) { + const synthType = type3; + if (!synthType.defaultOnlyType) { + const type22 = createDefaultPropertyWrapperForModule(symbol, originalSymbol); + synthType.defaultOnlyType = type22; + } + return synthType.defaultOnlyType; + } + return void 0; + } + function getTypeWithSyntheticDefaultImportType(type3, symbol, originalSymbol, moduleSpecifier) { + var _a2; + if (allowSyntheticDefaultImports && type3 && !isErrorType(type3)) { + const synthType = type3; + if (!synthType.syntheticType) { + const file = (_a2 = originalSymbol.declarations) == null ? void 0 : _a2.find(isSourceFile); + const hasSyntheticDefault = canHaveSyntheticDefault( + file, + originalSymbol, + /*dontResolveAlias*/ + false, + moduleSpecifier + ); + if (hasSyntheticDefault) { + const anonymousSymbol = createSymbol( + 2048, + "__type" + /* Type */ + ); + const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol); + anonymousSymbol.links.type = defaultContainingObject; + synthType.syntheticType = isValidSpreadType(type3) ? getSpreadType( + type3, + defaultContainingObject, + anonymousSymbol, + /*objectFlags*/ + 0, + /*readonly*/ + false + ) : defaultContainingObject; + } else { + synthType.syntheticType = type3; + } + } + return synthType.syntheticType; + } + return type3; + } + function isCommonJsRequire(node) { + if (!isRequireCall( + node, + /*requireStringLiteralLikeArgument*/ + true + )) { + return false; + } + if (!isIdentifier(node.expression)) + return Debug.fail(); + const resolvedRequire = resolveName( + node.expression, + node.expression.escapedText, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (resolvedRequire === requireSymbol) { + return true; + } + if (resolvedRequire.flags & 2097152) { + return false; + } + const targetDeclarationKind = resolvedRequire.flags & 16 ? 262 : resolvedRequire.flags & 3 ? 260 : 0; + if (targetDeclarationKind !== 0) { + const decl = getDeclarationOfKind(resolvedRequire, targetDeclarationKind); + return !!decl && !!(decl.flags & 33554432); + } + return false; + } + function checkTaggedTemplateExpression(node) { + if (!checkGrammarTaggedTemplateChain(node)) + checkGrammarTypeArguments(node, node.typeArguments); + if (languageVersion < 2) { + checkExternalEmitHelpers( + node, + 262144 + /* MakeTemplateObject */ + ); + } + const signature = getResolvedSignature(node); + checkDeprecatedSignature(signature, node); + return getReturnTypeOfSignature(signature); + } + function checkAssertion(node, checkMode) { + if (node.kind === 216) { + const file = getSourceFileOfNode(node); + if (file && fileExtensionIsOneOf(file.fileName, [ + ".cts", + ".mts" + /* Mts */ + ])) { + grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead); + } + } + return checkAssertionWorker(node, checkMode); + } + function isValidConstAssertionArgument(node) { + switch (node.kind) { + case 11: + case 15: + case 9: + case 10: + case 112: + case 97: + case 209: + case 210: + case 228: + return true; + case 217: + return isValidConstAssertionArgument(node.expression); + case 224: + const op = node.operator; + const arg = node.operand; + return op === 41 && (arg.kind === 9 || arg.kind === 10) || op === 40 && arg.kind === 9; + case 211: + case 212: + const expr = skipParentheses(node.expression); + const symbol = isEntityNameExpression(expr) ? resolveEntityName( + expr, + 111551, + /*ignoreErrors*/ + true + ) : void 0; + return !!(symbol && symbol.flags & 384); + } + return false; + } + function checkAssertionWorker(node, checkMode) { + const { type: type3, expression } = getAssertionTypeAndExpression(node); + const exprType = checkExpression(expression, checkMode); + if (isConstTypeReference(type3)) { + if (!isValidConstAssertionArgument(expression)) { + error22(expression, Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals); + } + return getRegularTypeOfLiteralType(exprType); + } + const links = getNodeLinks(node); + links.assertionExpressionType = exprType; + checkSourceElement(type3); + checkNodeDeferred(node); + return getTypeFromTypeNode(type3); + } + function getAssertionTypeAndExpression(node) { + let type3; + let expression; + switch (node.kind) { + case 234: + case 216: + type3 = node.type; + expression = node.expression; + break; + case 217: + type3 = getJSDocTypeAssertionType(node); + expression = node.expression; + break; + } + return { type: type3, expression }; + } + function checkAssertionDeferred(node) { + const { type: type3 } = getAssertionTypeAndExpression(node); + const errNode = isParenthesizedExpression(node) ? type3 : node; + const links = getNodeLinks(node); + Debug.assertIsDefined(links.assertionExpressionType); + const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(links.assertionExpressionType)); + const targetType = getTypeFromTypeNode(type3); + if (!isErrorType(targetType)) { + addLazyDiagnostic(() => { + const widenedType = getWidenedType(exprType); + if (!isTypeComparableTo(targetType, widenedType)) { + checkTypeComparableTo(exprType, targetType, errNode, Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first); + } + }); + } + } + function checkNonNullChain(node) { + const leftType = checkExpression(node.expression); + const nonOptionalType = getOptionalExpressionType(leftType, node.expression); + return propagateOptionalTypeMarker(getNonNullableType(nonOptionalType), node, nonOptionalType !== leftType); + } + function checkNonNullAssertion(node) { + return node.flags & 64 ? checkNonNullChain(node) : getNonNullableType(checkExpression(node.expression)); + } + function checkExpressionWithTypeArguments(node) { + checkGrammarExpressionWithTypeArguments(node); + forEach4(node.typeArguments, checkSourceElement); + if (node.kind === 233) { + const parent22 = walkUpParenthesizedExpressions(node.parent); + if (parent22.kind === 226 && parent22.operatorToken.kind === 104 && isNodeDescendantOf(node, parent22.right)) { + error22(node, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_not_be_an_instantiation_expression); + } + } + const exprType = node.kind === 233 ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName); + return getInstantiationExpressionType(exprType, node); + } + function getInstantiationExpressionType(exprType, node) { + const typeArguments = node.typeArguments; + if (exprType === silentNeverType || isErrorType(exprType) || !some2(typeArguments)) { + return exprType; + } + let hasSomeApplicableSignature = false; + let nonApplicableType; + const result2 = getInstantiatedType(exprType); + const errorType2 = hasSomeApplicableSignature ? nonApplicableType : exprType; + if (errorType2) { + diagnostics.add(createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType2))); + } + return result2; + function getInstantiatedType(type3) { + let hasSignatures = false; + let hasApplicableSignature = false; + const result22 = getInstantiatedTypePart(type3); + hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); + if (hasSignatures && !hasApplicableSignature) { + nonApplicableType ?? (nonApplicableType = type3); + } + return result22; + function getInstantiatedTypePart(type22) { + if (type22.flags & 524288) { + const resolved = resolveStructuredTypeMembers(type22); + const callSignatures = getInstantiatedSignatures(resolved.callSignatures); + const constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); + hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); + hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0); + if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) { + const result3 = createAnonymousType(createSymbol( + 0, + "__instantiationExpression" + /* InstantiationExpression */ + ), resolved.members, callSignatures, constructSignatures, resolved.indexInfos); + result3.objectFlags |= 8388608; + result3.node = node; + return result3; + } + } else if (type22.flags & 58982400) { + const constraint = getBaseConstraintOfType(type22); + if (constraint) { + const instantiated = getInstantiatedTypePart(constraint); + if (instantiated !== constraint) { + return instantiated; + } + } + } else if (type22.flags & 1048576) { + return mapType2(type22, getInstantiatedType); + } else if (type22.flags & 2097152) { + return getIntersectionType(sameMap(type22.types, getInstantiatedTypePart)); + } + return type22; + } + } + function getInstantiatedSignatures(signatures) { + const applicableSignatures = filter2(signatures, (sig) => !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments)); + return sameMap(applicableSignatures, (sig) => { + const typeArgumentTypes = checkTypeArguments( + sig, + typeArguments, + /*reportErrors*/ + true + ); + return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, isInJSFile(sig.declaration)) : sig; + }); + } + } + function checkSatisfiesExpression(node) { + checkSourceElement(node.type); + return checkSatisfiesExpressionWorker(node.expression, node.type); + } + function checkSatisfiesExpressionWorker(expression, target, checkMode) { + const exprType = checkExpression(expression, checkMode); + const targetType = getTypeFromTypeNode(target); + if (isErrorType(targetType)) { + return targetType; + } + const errorNode = findAncestor( + target.parent, + (n7) => n7.kind === 238 || n7.kind === 357 + /* JSDocSatisfiesTag */ + ); + checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, errorNode, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1); + return exprType; + } + function checkMetaProperty(node) { + checkGrammarMetaProperty(node); + if (node.keywordToken === 105) { + return checkNewTargetMetaProperty(node); + } + if (node.keywordToken === 102) { + return checkImportMetaProperty(node); + } + return Debug.assertNever(node.keywordToken); + } + function checkMetaPropertyKeyword(node) { + switch (node.keywordToken) { + case 102: + return getGlobalImportMetaExpressionType(); + case 105: + const type3 = checkNewTargetMetaProperty(node); + return isErrorType(type3) ? errorType : createNewTargetExpressionType(type3); + default: + Debug.assertNever(node.keywordToken); + } + } + function checkNewTargetMetaProperty(node) { + const container = getNewTargetContainer(node); + if (!container) { + error22(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); + return errorType; + } else if (container.kind === 176) { + const symbol = getSymbolOfDeclaration(container.parent); + return getTypeOfSymbol(symbol); + } else { + const symbol = getSymbolOfDeclaration(container); + return getTypeOfSymbol(symbol); + } + } + function checkImportMetaProperty(node) { + if (moduleKind === 100 || moduleKind === 199) { + if (getSourceFileOfNode(node).impliedNodeFormat !== 99) { + error22(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output); + } + } else if (moduleKind < 6 && moduleKind !== 4) { + error22(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext); + } + const file = getSourceFileOfNode(node); + Debug.assert(!!(file.flags & 8388608), "Containing file is missing import meta node flag."); + return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType; + } + function getTypeOfParameter(symbol) { + const declaration = symbol.valueDeclaration; + return addOptionality( + getTypeOfSymbol(symbol), + /*isProperty*/ + false, + /*isOptional*/ + !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration)) + ); + } + function getTupleElementLabel(d7, index4, restParameterName = "arg") { + if (!d7) { + return `${restParameterName}_${index4}`; + } + Debug.assert(isIdentifier(d7.name)); + return d7.name.escapedText; + } + function getParameterNameAtPosition(signature, pos, overrideRestType) { + const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + return signature.parameters[pos].escapedName; + } + const restParameter = signature.parameters[paramCount] || unknownSymbol; + const restType = overrideRestType || getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + const associatedNames = restType.target.labeledElementDeclarations; + const index4 = pos - paramCount; + return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index4], index4, restParameter.escapedName); + } + return restParameter.escapedName; + } + function getParameterIdentifierInfoAtPosition(signature, pos) { + var _a2; + if (((_a2 = signature.declaration) == null ? void 0 : _a2.kind) === 324) { + return void 0; + } + const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + const param = signature.parameters[pos]; + const paramIdent = getParameterDeclarationIdentifier(param); + return paramIdent ? { + parameter: paramIdent, + parameterName: param.escapedName, + isRestParameter: false + } : void 0; + } + const restParameter = signature.parameters[paramCount] || unknownSymbol; + const restIdent = getParameterDeclarationIdentifier(restParameter); + if (!restIdent) { + return void 0; + } + const restType = getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + const associatedNames = restType.target.labeledElementDeclarations; + const index4 = pos - paramCount; + const associatedName = associatedNames == null ? void 0 : associatedNames[index4]; + const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken); + if (associatedName) { + Debug.assert(isIdentifier(associatedName.name)); + return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement }; + } + return void 0; + } + if (pos === paramCount) { + return { parameter: restIdent, parameterName: restParameter.escapedName, isRestParameter: true }; + } + return void 0; + } + function getParameterDeclarationIdentifier(symbol) { + return symbol.valueDeclaration && isParameter(symbol.valueDeclaration) && isIdentifier(symbol.valueDeclaration.name) && symbol.valueDeclaration.name; + } + function isValidDeclarationForTupleLabel(d7) { + return d7.kind === 202 || isParameter(d7) && d7.name && isIdentifier(d7.name); + } + function getNameableDeclarationAtPosition(signature, pos) { + const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + const decl = signature.parameters[pos].valueDeclaration; + return decl && isValidDeclarationForTupleLabel(decl) ? decl : void 0; + } + const restParameter = signature.parameters[paramCount] || unknownSymbol; + const restType = getTypeOfSymbol(restParameter); + if (isTupleType(restType)) { + const associatedNames = restType.target.labeledElementDeclarations; + const index4 = pos - paramCount; + return associatedNames && associatedNames[index4]; + } + return restParameter.valueDeclaration && isValidDeclarationForTupleLabel(restParameter.valueDeclaration) ? restParameter.valueDeclaration : void 0; + } + function getTypeAtPosition(signature, pos) { + return tryGetTypeAtPosition(signature, pos) || anyType2; + } + function tryGetTypeAtPosition(signature, pos) { + const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + if (pos < paramCount) { + return getTypeOfParameter(signature.parameters[pos]); + } + if (signatureHasRestParameter(signature)) { + const restType = getTypeOfSymbol(signature.parameters[paramCount]); + const index4 = pos - paramCount; + if (!isTupleType(restType) || restType.target.hasRestElement || index4 < restType.target.fixedLength) { + return getIndexedAccessType(restType, getNumberLiteralType(index4)); + } + } + return void 0; + } + function getRestTypeAtPosition(source, pos, readonly) { + const parameterCount = getParameterCount(source); + const minArgumentCount = getMinArgumentCount(source); + const restType = getEffectiveRestType(source); + if (restType && pos >= parameterCount - 1) { + return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType2)); + } + const types3 = []; + const flags = []; + const names = []; + for (let i7 = pos; i7 < parameterCount; i7++) { + if (!restType || i7 < parameterCount - 1) { + types3.push(getTypeAtPosition(source, i7)); + flags.push( + i7 < minArgumentCount ? 1 : 2 + /* Optional */ + ); + } else { + types3.push(restType); + flags.push( + 8 + /* Variadic */ + ); + } + names.push(getNameableDeclarationAtPosition(source, i7)); + } + return createTupleType(types3, flags, readonly, names); + } + function getRestOrAnyTypeAtPosition(source, pos) { + const restType = getRestTypeAtPosition(source, pos); + const elementType = restType && getElementTypeOfArrayType(restType); + return elementType && isTypeAny(elementType) ? anyType2 : restType; + } + function getParameterCount(signature) { + const length2 = signature.parameters.length; + if (signatureHasRestParameter(signature)) { + const restType = getTypeOfSymbol(signature.parameters[length2 - 1]); + if (isTupleType(restType)) { + return length2 + restType.target.fixedLength - (restType.target.hasRestElement ? 0 : 1); + } + } + return length2; + } + function getMinArgumentCount(signature, flags) { + const strongArityForUntypedJS = flags & 1; + const voidIsNonOptional = flags & 2; + if (voidIsNonOptional || signature.resolvedMinArgumentCount === void 0) { + let minArgumentCount; + if (signatureHasRestParameter(signature)) { + const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (isTupleType(restType)) { + const firstOptionalIndex = findIndex2(restType.target.elementFlags, (f8) => !(f8 & 1)); + const requiredCount = firstOptionalIndex < 0 ? restType.target.fixedLength : firstOptionalIndex; + if (requiredCount > 0) { + minArgumentCount = signature.parameters.length - 1 + requiredCount; + } + } + } + if (minArgumentCount === void 0) { + if (!strongArityForUntypedJS && signature.flags & 32) { + return 0; + } + minArgumentCount = signature.minArgumentCount; + } + if (voidIsNonOptional) { + return minArgumentCount; + } + for (let i7 = minArgumentCount - 1; i7 >= 0; i7--) { + const type3 = getTypeAtPosition(signature, i7); + if (filterType(type3, acceptsVoid).flags & 131072) { + break; + } + minArgumentCount = i7; + } + signature.resolvedMinArgumentCount = minArgumentCount; + } + return signature.resolvedMinArgumentCount; + } + function hasEffectiveRestParameter(signature) { + if (signatureHasRestParameter(signature)) { + const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + return !isTupleType(restType) || restType.target.hasRestElement; + } + return false; + } + function getEffectiveRestType(signature) { + if (signatureHasRestParameter(signature)) { + const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); + if (!isTupleType(restType)) { + return isTypeAny(restType) ? anyArrayType : restType; + } + if (restType.target.hasRestElement) { + return sliceTupleType(restType, restType.target.fixedLength); + } + } + return void 0; + } + function getNonArrayRestType(signature) { + const restType = getEffectiveRestType(signature); + return restType && !isArrayType(restType) && !isTypeAny(restType) ? restType : void 0; + } + function getTypeOfFirstParameterOfSignature(signature) { + return getTypeOfFirstParameterOfSignatureWithFallback(signature, neverType2); + } + function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) { + return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType; + } + function inferFromAnnotatedParameters(signature, context2, inferenceContext) { + const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + for (let i7 = 0; i7 < len; i7++) { + const declaration = signature.parameters[i7].valueDeclaration; + const typeNode = getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + const source = addOptionality( + getTypeFromTypeNode(typeNode), + /*isProperty*/ + false, + isOptionalDeclaration(declaration) + ); + const target = getTypeAtPosition(context2, i7); + inferTypes(inferenceContext.inferences, source, target); + } + } + } + function assignContextualParameterTypes(signature, context2) { + if (context2.typeParameters) { + if (!signature.typeParameters) { + signature.typeParameters = context2.typeParameters; + } else { + return; + } + } + if (context2.thisParameter) { + const parameter = signature.thisParameter; + if (!parameter || parameter.valueDeclaration && !parameter.valueDeclaration.type) { + if (!parameter) { + signature.thisParameter = createSymbolWithType( + context2.thisParameter, + /*type*/ + void 0 + ); + } + assignParameterType(signature.thisParameter, getTypeOfSymbol(context2.thisParameter)); + } + } + const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0); + for (let i7 = 0; i7 < len; i7++) { + const parameter = signature.parameters[i7]; + const declaration = parameter.valueDeclaration; + if (!getEffectiveTypeAnnotationNode(declaration)) { + let type3 = tryGetTypeAtPosition(context2, i7); + if (type3 && declaration.initializer) { + let initializerType = checkDeclarationInitializer( + declaration, + 0 + /* Normal */ + ); + if (!isTypeAssignableTo(initializerType, type3) && isTypeAssignableTo(type3, initializerType = widenTypeInferredFromInitializer(declaration, initializerType))) { + type3 = initializerType; + } + } + assignParameterType(parameter, type3); + } + } + if (signatureHasRestParameter(signature)) { + const parameter = last2(signature.parameters); + if (parameter.valueDeclaration ? !getEffectiveTypeAnnotationNode(parameter.valueDeclaration) : !!(getCheckFlags(parameter) & 65536)) { + const contextualParameterType = getRestTypeAtPosition(context2, len); + assignParameterType(parameter, contextualParameterType); + } + } + } + function assignNonContextualParameterTypes(signature) { + if (signature.thisParameter) { + assignParameterType(signature.thisParameter); + } + for (const parameter of signature.parameters) { + assignParameterType(parameter); + } + } + function assignParameterType(parameter, contextualType) { + const links = getSymbolLinks(parameter); + if (!links.type) { + const declaration = parameter.valueDeclaration; + links.type = addOptionality( + contextualType || (declaration ? getWidenedTypeForVariableLikeDeclaration( + declaration, + /*reportErrors*/ + true + ) : getTypeOfSymbol(parameter)), + /*isProperty*/ + false, + /*isOptional*/ + !!declaration && !declaration.initializer && isOptionalDeclaration(declaration) + ); + if (declaration && declaration.name.kind !== 80) { + if (links.type === unknownType2) { + links.type = getTypeFromBindingPattern(declaration.name); + } + assignBindingElementTypes(declaration.name, links.type); + } + } else if (contextualType) { + Debug.assertEqual(links.type, contextualType, "Parameter symbol already has a cached type which differs from newly assigned type"); + } + } + function assignBindingElementTypes(pattern5, parentType) { + for (const element of pattern5.elements) { + if (!isOmittedExpression(element)) { + const type3 = getBindingElementTypeFromParentType( + element, + parentType, + /*noTupleBoundsCheck*/ + false + ); + if (element.name.kind === 80) { + getSymbolLinks(getSymbolOfDeclaration(element)).type = type3; + } else { + assignBindingElementTypes(element.name, type3); + } + } + } + } + function createClassDecoratorContextType(classType) { + return tryCreateTypeReference(getGlobalClassDecoratorContextType( + /*reportErrors*/ + true + ), [classType]); + } + function createClassMethodDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassMethodDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassGetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassGetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassSetterDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassSetterDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorContextType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassFieldDecoratorContextType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2) { + const key = `${isPrivate ? "p" : "P"}${isStatic2 ? "s" : "S"}${nameType.id}`; + let overrideType = decoratorContextOverrideTypeCache.get(key); + if (!overrideType) { + const members = createSymbolTable(); + members.set("name", createProperty("name", nameType)); + members.set("private", createProperty("private", isPrivate ? trueType : falseType)); + members.set("static", createProperty("static", isStatic2 ? trueType : falseType)); + overrideType = createAnonymousType( + /*symbol*/ + void 0, + members, + emptyArray, + emptyArray, + emptyArray + ); + decoratorContextOverrideTypeCache.set(key, overrideType); + } + return overrideType; + } + function createClassMemberDecoratorContextTypeForNode(node, thisType, valueType) { + const isStatic2 = hasStaticModifier(node); + const isPrivate = isPrivateIdentifier(node.name); + const nameType = isPrivate ? getStringLiteralType(idText(node.name)) : getLiteralTypeFromPropertyName(node.name); + const contextType = isMethodDeclaration(node) ? createClassMethodDecoratorContextType(thisType, valueType) : isGetAccessorDeclaration(node) ? createClassGetterDecoratorContextType(thisType, valueType) : isSetAccessorDeclaration(node) ? createClassSetterDecoratorContextType(thisType, valueType) : isAutoAccessorPropertyDeclaration(node) ? createClassAccessorDecoratorContextType(thisType, valueType) : isPropertyDeclaration(node) ? createClassFieldDecoratorContextType(thisType, valueType) : Debug.failBadSyntaxKind(node); + const overrideType = getClassMemberDecoratorContextOverrideType(nameType, isPrivate, isStatic2); + return getIntersectionType([contextType, overrideType]); + } + function createClassAccessorDecoratorTargetType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorTargetType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassAccessorDecoratorResultType(thisType, valueType) { + return tryCreateTypeReference(getGlobalClassAccessorDecoratorResultType( + /*reportErrors*/ + true + ), [thisType, valueType]); + } + function createClassFieldDecoratorInitializerMutatorType(thisType, valueType) { + const thisParam = createParameter2("this", thisType); + const valueParam = createParameter2("value", valueType); + return createFunctionType( + /*typeParameters*/ + void 0, + thisParam, + [valueParam], + valueType, + /*typePredicate*/ + void 0, + 1 + ); + } + function createESDecoratorCallSignature(targetType, contextType, nonOptionalReturnType) { + const targetParam = createParameter2("target", targetType); + const contextParam = createParameter2("context", contextType); + const returnType = getUnionType([nonOptionalReturnType, voidType2]); + return createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, contextParam], + returnType + ); + } + function getESDecoratorCallSignature(decorator) { + const { parent: parent22 } = decorator; + const links = getNodeLinks(parent22); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent22.kind) { + case 263: + case 231: { + const node = parent22; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const contextType = createClassDecoratorContextType(targetType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, targetType); + break; + } + case 174: + case 177: + case 178: { + const node = parent22; + if (!isClassLike(node.parent)) + break; + const valueType = isMethodDeclaration(node) ? getOrCreateTypeFromSignature(getSignatureFromDeclaration(node)) : getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = isGetAccessorDeclaration(node) ? createGetterFunctionType(valueType) : isSetAccessorDeclaration(node) ? createSetterFunctionType(valueType) : valueType; + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + case 172: { + const node = parent22; + if (!isClassLike(node.parent)) + break; + const valueType = getTypeOfNode(node); + const thisType = hasStaticModifier(node) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent)) : getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(node.parent)); + const targetType = hasAccessorModifier(node) ? createClassAccessorDecoratorTargetType(thisType, valueType) : undefinedType2; + const contextType = createClassMemberDecoratorContextTypeForNode(node, thisType, valueType); + const returnType = hasAccessorModifier(node) ? createClassAccessorDecoratorResultType(thisType, valueType) : createClassFieldDecoratorInitializerMutatorType(thisType, valueType); + links.decoratorSignature = createESDecoratorCallSignature(targetType, contextType, returnType); + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getLegacyDecoratorCallSignature(decorator) { + const { parent: parent22 } = decorator; + const links = getNodeLinks(parent22); + if (!links.decoratorSignature) { + links.decoratorSignature = anySignature; + switch (parent22.kind) { + case 263: + case 231: { + const node = parent22; + const targetType = getTypeOfSymbol(getSymbolOfDeclaration(node)); + const targetParam = createParameter2("target", targetType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam], + getUnionType([targetType, voidType2]) + ); + break; + } + case 169: { + const node = parent22; + if (!isConstructorDeclaration(node.parent) && !(isMethodDeclaration(node.parent) || isSetAccessorDeclaration(node.parent) && isClassLike(node.parent.parent))) { + break; + } + if (getThisParameter(node.parent) === node) { + break; + } + const index4 = getThisParameter(node.parent) ? node.parent.parameters.indexOf(node) - 1 : node.parent.parameters.indexOf(node); + Debug.assert(index4 >= 0); + const targetType = isConstructorDeclaration(node.parent) ? getTypeOfSymbol(getSymbolOfDeclaration(node.parent.parent)) : getParentTypeOfClassElement(node.parent); + const keyType = isConstructorDeclaration(node.parent) ? undefinedType2 : getClassElementPropertyKeyType(node.parent); + const indexType = getNumberLiteralType(index4); + const targetParam = createParameter2("target", targetType); + const keyParam = createParameter2("propertyKey", keyType); + const indexParam = createParameter2("parameterIndex", indexType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, indexParam], + voidType2 + ); + break; + } + case 174: + case 177: + case 178: + case 172: { + const node = parent22; + if (!isClassLike(node.parent)) + break; + const targetType = getParentTypeOfClassElement(node); + const targetParam = createParameter2("target", targetType); + const keyType = getClassElementPropertyKeyType(node); + const keyParam = createParameter2("propertyKey", keyType); + const returnType = isPropertyDeclaration(node) ? voidType2 : createTypedPropertyDescriptorType(getTypeOfNode(node)); + const hasPropDesc = languageVersion !== 0 && (!isPropertyDeclaration(parent22) || hasAccessorModifier(parent22)); + if (hasPropDesc) { + const descriptorType = createTypedPropertyDescriptorType(getTypeOfNode(node)); + const descriptorParam = createParameter2("descriptor", descriptorType); + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam, descriptorParam], + getUnionType([returnType, voidType2]) + ); + } else { + links.decoratorSignature = createCallSignature( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [targetParam, keyParam], + getUnionType([returnType, voidType2]) + ); + } + break; + } + } + } + return links.decoratorSignature === anySignature ? void 0 : links.decoratorSignature; + } + function getDecoratorCallSignature(decorator) { + return legacyDecorators ? getLegacyDecoratorCallSignature(decorator) : getESDecoratorCallSignature(decorator); + } + function createPromiseType(promisedType) { + const globalPromiseType = getGlobalPromiseType( + /*reportErrors*/ + true + ); + if (globalPromiseType !== emptyGenericType) { + promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType2; + return createTypeReference(globalPromiseType, [promisedType]); + } + return unknownType2; + } + function createPromiseLikeType(promisedType) { + const globalPromiseLikeType = getGlobalPromiseLikeType( + /*reportErrors*/ + true + ); + if (globalPromiseLikeType !== emptyGenericType) { + promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType2; + return createTypeReference(globalPromiseLikeType, [promisedType]); + } + return unknownType2; + } + function createPromiseReturnType(func, promisedType) { + const promiseType2 = createPromiseType(promisedType); + if (promiseType2 === unknownType2) { + error22( + func, + isImportCall(func) ? Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option + ); + return errorType; + } else if (!getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + true + )) { + error22( + func, + isImportCall(func) ? Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option : Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option + ); + } + return promiseType2; + } + function createNewTargetExpressionType(targetType) { + const symbol = createSymbol(0, "NewTargetExpression"); + const targetPropertySymbol = createSymbol( + 4, + "target", + 8 + /* Readonly */ + ); + targetPropertySymbol.parent = symbol; + targetPropertySymbol.links.type = targetType; + const members = createSymbolTable([targetPropertySymbol]); + symbol.members = members; + return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray); + } + function getReturnTypeFromBody(func, checkMode) { + if (!func.body) { + return errorType; + } + const functionFlags = getFunctionFlags(func); + const isAsync2 = (functionFlags & 2) !== 0; + const isGenerator = (functionFlags & 1) !== 0; + let returnType; + let yieldType; + let nextType; + let fallbackReturnType = voidType2; + if (func.body.kind !== 241) { + returnType = checkExpressionCached( + func.body, + checkMode && checkMode & ~8 + /* SkipGenericFunctions */ + ); + if (isAsync2) { + returnType = unwrapAwaitedType(checkAwaitedType( + returnType, + /*withAlias*/ + false, + /*errorNode*/ + func, + Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + )); + } + } else if (isGenerator) { + const returnTypes = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!returnTypes) { + fallbackReturnType = neverType2; + } else if (returnTypes.length > 0) { + returnType = getUnionType( + returnTypes, + 2 + /* Subtype */ + ); + } + const { yieldTypes, nextTypes } = checkAndAggregateYieldOperandTypes(func, checkMode); + yieldType = some2(yieldTypes) ? getUnionType( + yieldTypes, + 2 + /* Subtype */ + ) : void 0; + nextType = some2(nextTypes) ? getIntersectionType(nextTypes) : void 0; + } else { + const types3 = checkAndAggregateReturnExpressionTypes(func, checkMode); + if (!types3) { + return functionFlags & 2 ? createPromiseReturnType(func, neverType2) : neverType2; + } + if (types3.length === 0) { + const contextualReturnType = getContextualReturnType( + func, + /*contextFlags*/ + void 0 + ); + const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType2).flags & 32768 ? undefinedType2 : voidType2; + return functionFlags & 2 ? createPromiseReturnType(func, returnType2) : ( + // Async function + returnType2 + ); + } + returnType = getUnionType( + types3, + 2 + /* Subtype */ + ); + } + if (returnType || yieldType || nextType) { + if (yieldType) + reportErrorsFromWidening( + func, + yieldType, + 3 + /* GeneratorYield */ + ); + if (returnType) + reportErrorsFromWidening( + func, + returnType, + 1 + /* FunctionReturn */ + ); + if (nextType) + reportErrorsFromWidening( + func, + nextType, + 2 + /* GeneratorNext */ + ); + if (returnType && isUnitType(returnType) || yieldType && isUnitType(yieldType) || nextType && isUnitType(nextType)) { + const contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); + const contextualType = !contextualSignature ? void 0 : contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? void 0 : returnType : instantiateContextualType( + getReturnTypeOfSignature(contextualSignature), + func, + /*contextFlags*/ + void 0 + ); + if (isGenerator) { + yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, 0, isAsync2); + returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, 1, isAsync2); + nextType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(nextType, contextualType, 2, isAsync2); + } else { + returnType = getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(returnType, contextualType, isAsync2); + } + } + if (yieldType) + yieldType = getWidenedType(yieldType); + if (returnType) + returnType = getWidenedType(returnType); + if (nextType) + nextType = getWidenedType(nextType); + } + if (isGenerator) { + return createGeneratorReturnType( + yieldType || neverType2, + returnType || fallbackReturnType, + nextType || getContextualIterationType(2, func) || unknownType2, + isAsync2 + ); + } else { + return isAsync2 ? createPromiseType(returnType || fallbackReturnType) : returnType || fallbackReturnType; + } + } + function createGeneratorReturnType(yieldType, returnType, nextType, isAsyncGenerator) { + const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; + const globalGeneratorType = resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ); + yieldType = resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || unknownType2; + returnType = resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || unknownType2; + nextType = resolver.resolveIterationType( + nextType, + /*errorNode*/ + void 0 + ) || unknownType2; + if (globalGeneratorType === emptyGenericType) { + const globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ); + const iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : void 0; + const iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType2; + const iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType2; + if (isTypeAssignableTo(returnType, iterableIteratorReturnType) && isTypeAssignableTo(iterableIteratorNextType, nextType)) { + if (globalType !== emptyGenericType) { + return createTypeFromGenericGlobalType(globalType, [yieldType]); + } + resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + true + ); + return emptyObjectType; + } + resolver.getGlobalGeneratorType( + /*reportErrors*/ + true + ); + return emptyObjectType; + } + return createTypeFromGenericGlobalType(globalGeneratorType, [yieldType, returnType, nextType]); + } + function checkAndAggregateYieldOperandTypes(func, checkMode) { + const yieldTypes = []; + const nextTypes = []; + const isAsync2 = (getFunctionFlags(func) & 2) !== 0; + forEachYieldExpression(func.body, (yieldExpression) => { + const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType; + pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType2, isAsync2)); + let nextType; + if (yieldExpression.asteriskToken) { + const iterationTypes = getIterationTypesOfIterable( + yieldExpressionType, + isAsync2 ? 19 : 17, + yieldExpression.expression + ); + nextType = iterationTypes && iterationTypes.nextType; + } else { + nextType = getContextualType2( + yieldExpression, + /*contextFlags*/ + void 0 + ); + } + if (nextType) + pushIfUnique(nextTypes, nextType); + }); + return { yieldTypes, nextTypes }; + } + function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync2) { + const errorNode = node.expression || node; + const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync2 ? 19 : 17, expressionType, sentType, errorNode) : expressionType; + return !isAsync2 ? yieldedType : getAwaitedType( + yieldedType, + errorNode, + node.asteriskToken ? Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member : Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + } + function getNotEqualFactsFromTypeofSwitch(start, end, witnesses) { + let facts = 0; + for (let i7 = 0; i7 < witnesses.length; i7++) { + const witness = i7 < start || i7 >= end ? witnesses[i7] : void 0; + facts |= witness !== void 0 ? typeofNEFacts.get(witness) || 32768 : 0; + } + return facts; + } + function isExhaustiveSwitchStatement(node) { + const links = getNodeLinks(node); + if (links.isExhaustive === void 0) { + links.isExhaustive = 0; + const exhaustive = computeExhaustiveSwitchStatement(node); + if (links.isExhaustive === 0) { + links.isExhaustive = exhaustive; + } + } else if (links.isExhaustive === 0) { + links.isExhaustive = false; + } + return links.isExhaustive; + } + function computeExhaustiveSwitchStatement(node) { + if (node.expression.kind === 221) { + const witnesses = getSwitchClauseTypeOfWitnesses(node); + if (!witnesses) { + return false; + } + const operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression)); + const notEqualFacts = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses); + if (operandConstraint.flags & 3) { + return (556800 & notEqualFacts) === 556800; + } + return !someType(operandConstraint, (t8) => getTypeFacts(t8, notEqualFacts) === notEqualFacts); + } + const type3 = checkExpressionCached(node.expression); + if (!isLiteralType(type3)) { + return false; + } + const switchTypes = getSwitchClauseTypes(node); + if (!switchTypes.length || some2(switchTypes, isNeitherUnitTypeNorNever)) { + return false; + } + return eachTypeContainedIn(mapType2(type3, getRegularTypeOfLiteralType), switchTypes); + } + function functionHasImplicitReturn(func) { + return func.endFlowNode && isReachableFlowNode(func.endFlowNode); + } + function checkAndAggregateReturnExpressionTypes(func, checkMode) { + const functionFlags = getFunctionFlags(func); + const aggregatedTypes = []; + let hasReturnWithNoExpression = functionHasImplicitReturn(func); + let hasReturnOfTypeNever = false; + forEachReturnStatement(func.body, (returnStatement) => { + let expr = returnStatement.expression; + if (expr) { + expr = skipParentheses( + expr, + /*excludeJSDocTypeAssertions*/ + true + ); + if (functionFlags & 2 && expr.kind === 223) { + expr = skipParentheses( + expr.expression, + /*excludeJSDocTypeAssertions*/ + true + ); + } + if (expr.kind === 213 && expr.expression.kind === 80 && checkExpressionCached(expr.expression).symbol === func.symbol) { + hasReturnOfTypeNever = true; + return; + } + let type3 = checkExpressionCached( + expr, + checkMode && checkMode & ~8 + /* SkipGenericFunctions */ + ); + if (functionFlags & 2) { + type3 = unwrapAwaitedType(checkAwaitedType( + type3, + /*withAlias*/ + false, + func, + Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + )); + } + if (type3.flags & 131072) { + hasReturnOfTypeNever = true; + } + pushIfUnique(aggregatedTypes, type3); + } else { + hasReturnWithNoExpression = true; + } + }); + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { + return void 0; + } + if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression && !(isJSConstructor(func) && aggregatedTypes.some((t8) => t8.symbol === func.symbol))) { + pushIfUnique(aggregatedTypes, undefinedType2); + } + return aggregatedTypes; + } + function mayReturnNever(func) { + switch (func.kind) { + case 218: + case 219: + return true; + case 174: + return func.parent.kind === 210; + default: + return false; + } + } + function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { + addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics); + return; + function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() { + const functionFlags = getFunctionFlags(func); + const type3 = returnType && unwrapReturnType(returnType, functionFlags); + if (type3 && (maybeTypeOfKind( + type3, + 16384 + /* Void */ + ) || type3.flags & (1 | 32768))) { + return; + } + if (func.kind === 173 || nodeIsMissing(func.body) || func.body.kind !== 241 || !functionHasImplicitReturn(func)) { + return; + } + const hasExplicitReturn = func.flags & 1024; + const errorNode = getEffectiveReturnTypeNode(func) || func; + if (type3 && type3.flags & 131072) { + error22(errorNode, Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point); + } else if (type3 && !hasExplicitReturn) { + error22(errorNode, Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value); + } else if (type3 && strictNullChecks && !isTypeAssignableTo(undefinedType2, type3)) { + error22(errorNode, Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined); + } else if (compilerOptions.noImplicitReturns) { + if (!type3) { + if (!hasExplicitReturn) { + return; + } + const inferredReturnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); + if (isUnwrappedReturnTypeUndefinedVoidOrAny(func, inferredReturnType)) { + return; + } + } + error22(errorNode, Diagnostics.Not_all_code_paths_return_a_value); + } + } + } + function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node)); + checkNodeDeferred(node); + if (isFunctionExpression(node)) { + checkCollisionsForDeclarationName(node, node.name); + } + if (checkMode && checkMode & 4 && isContextSensitive(node)) { + if (!getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) { + const contextualSignature = getContextualSignature(node); + if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) { + const links = getNodeLinks(node); + if (links.contextFreeType) { + return links.contextFreeType; + } + const returnType = getReturnTypeFromBody(node, checkMode); + const returnOnlySignature = createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + returnType, + /*resolvedTypePredicate*/ + void 0, + 0, + 64 + /* IsNonInferrable */ + ); + const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray); + returnOnlyType.objectFlags |= 262144; + return links.contextFreeType = returnOnlyType; + } + } + return anyFunctionType; + } + const hasGrammarError = checkGrammarFunctionLikeDeclaration(node); + if (!hasGrammarError && node.kind === 218) { + checkGrammarForGenerator(node); + } + contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return getTypeOfSymbol(getSymbolOfDeclaration(node)); + } + function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) { + const links = getNodeLinks(node); + if (!(links.flags & 64)) { + const contextualSignature = getContextualSignature(node); + if (!(links.flags & 64)) { + links.flags |= 64; + const signature = firstOrUndefined(getSignaturesOfType( + getTypeOfSymbol(getSymbolOfDeclaration(node)), + 0 + /* Call */ + )); + if (!signature) { + return; + } + if (isContextSensitive(node)) { + if (contextualSignature) { + const inferenceContext = getInferenceContext(node); + let instantiatedContextualSignature; + if (checkMode && checkMode & 2) { + inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + const restType = getEffectiveRestType(contextualSignature); + if (restType && restType.flags & 262144) { + instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper); + } + } + instantiatedContextualSignature || (instantiatedContextualSignature = inferenceContext ? instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature); + assignContextualParameterTypes(signature, instantiatedContextualSignature); + } else { + assignNonContextualParameterTypes(signature); + } + } else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) { + const inferenceContext = getInferenceContext(node); + if (checkMode && checkMode & 2) { + inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext); + } + } + if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) { + const returnType = getReturnTypeFromBody(node, checkMode); + if (!signature.resolvedReturnType) { + signature.resolvedReturnType = returnType; + } + } + checkSignatureDeclaration(node); + } + } + } + function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { + Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node)); + const functionFlags = getFunctionFlags(node); + const returnType = getReturnTypeFromAnnotation(node); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); + if (node.body) { + if (!getEffectiveReturnTypeNode(node)) { + getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + } + if (node.body.kind === 241) { + checkSourceElement(node.body); + } else { + const exprType = checkExpression(node.body); + const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags); + if (returnOrPromisedType) { + const effectiveCheckNode = getEffectiveCheckNode(node.body); + if ((functionFlags & 3) === 2) { + const awaitedType = checkAwaitedType( + exprType, + /*withAlias*/ + false, + effectiveCheckNode, + Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode); + } else { + checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode); + } + } + } + } + } + function checkArithmeticOperandType(operand, type3, diagnostic, isAwaitValid = false) { + if (!isTypeAssignableTo(type3, numberOrBigIntType)) { + const awaitedType = isAwaitValid && getAwaitedTypeOfPromise(type3); + errorAndMaybeSuggestAwait( + operand, + !!awaitedType && isTypeAssignableTo(awaitedType, numberOrBigIntType), + diagnostic + ); + return false; + } + return true; + } + function isReadonlyAssignmentDeclaration(d7) { + if (!isCallExpression(d7)) { + return false; + } + if (!isBindableObjectDefinePropertyCall(d7)) { + return false; + } + const objectLitType = checkExpressionCached(d7.arguments[2]); + const valueType = getTypeOfPropertyOfType(objectLitType, "value"); + if (valueType) { + const writableProp = getPropertyOfType(objectLitType, "writable"); + const writableType = writableProp && getTypeOfSymbol(writableProp); + if (!writableType || writableType === falseType || writableType === regularFalseType) { + return true; + } + if (writableProp && writableProp.valueDeclaration && isPropertyAssignment(writableProp.valueDeclaration)) { + const initializer = writableProp.valueDeclaration.initializer; + const rawOriginalType = checkExpression(initializer); + if (rawOriginalType === falseType || rawOriginalType === regularFalseType) { + return true; + } + } + return false; + } + const setProp = getPropertyOfType(objectLitType, "set"); + return !setProp; + } + function isReadonlySymbol(symbol) { + return !!(getCheckFlags(symbol) & 8 || symbol.flags & 4 && getDeclarationModifierFlagsFromSymbol(symbol) & 8 || symbol.flags & 3 && getDeclarationNodeFlagsFromSymbol(symbol) & 6 || symbol.flags & 98304 && !(symbol.flags & 65536) || symbol.flags & 8 || some2(symbol.declarations, isReadonlyAssignmentDeclaration)); + } + function isAssignmentToReadonlyEntity(expr, symbol, assignmentKind) { + var _a2, _b; + if (assignmentKind === 0) { + return false; + } + if (isReadonlySymbol(symbol)) { + if (symbol.flags & 4 && isAccessExpression(expr) && expr.expression.kind === 110) { + const ctor = getContainingFunction(expr); + if (!(ctor && (ctor.kind === 176 || isJSConstructor(ctor)))) { + return true; + } + if (symbol.valueDeclaration) { + const isAssignmentDeclaration2 = isBinaryExpression(symbol.valueDeclaration); + const isLocalPropertyDeclaration = ctor.parent === symbol.valueDeclaration.parent; + const isLocalParameterProperty = ctor === symbol.valueDeclaration.parent; + const isLocalThisPropertyAssignment = isAssignmentDeclaration2 && ((_a2 = symbol.parent) == null ? void 0 : _a2.valueDeclaration) === ctor.parent; + const isLocalThisPropertyAssignmentConstructorFunction = isAssignmentDeclaration2 && ((_b = symbol.parent) == null ? void 0 : _b.valueDeclaration) === ctor; + const isWriteableSymbol = isLocalPropertyDeclaration || isLocalParameterProperty || isLocalThisPropertyAssignment || isLocalThisPropertyAssignmentConstructorFunction; + return !isWriteableSymbol; + } + } + return true; + } + if (isAccessExpression(expr)) { + const node = skipParentheses(expr.expression); + if (node.kind === 80) { + const symbol2 = getNodeLinks(node).resolvedSymbol; + if (symbol2.flags & 2097152) { + const declaration = getDeclarationOfAliasSymbol(symbol2); + return !!declaration && declaration.kind === 274; + } + } + } + return false; + } + function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) { + const node = skipOuterExpressions( + expr, + 6 | 1 + /* Parentheses */ + ); + if (node.kind !== 80 && !isAccessExpression(node)) { + error22(expr, invalidReferenceMessage); + return false; + } + if (node.flags & 64) { + error22(expr, invalidOptionalChainMessage); + return false; + } + return true; + } + function checkDeleteExpression(node) { + checkExpression(node.expression); + const expr = skipParentheses(node.expression); + if (!isAccessExpression(expr)) { + error22(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); + return booleanType2; + } + if (isPropertyAccessExpression(expr) && isPrivateIdentifier(expr.name)) { + error22(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier); + } + const links = getNodeLinks(expr); + const symbol = getExportSymbolOfValueSymbolIfExported(links.resolvedSymbol); + if (symbol) { + if (isReadonlySymbol(symbol)) { + error22(expr, Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property); + } else { + checkDeleteExpressionMustBeOptional(expr, symbol); + } + } + return booleanType2; + } + function checkDeleteExpressionMustBeOptional(expr, symbol) { + const type3 = getTypeOfSymbol(symbol); + if (strictNullChecks && !(type3.flags & (3 | 131072)) && !(exactOptionalPropertyTypes ? symbol.flags & 16777216 : hasTypeFacts( + type3, + 16777216 + /* IsUndefined */ + ))) { + error22(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional); + } + } + function checkTypeOfExpression(node) { + checkExpression(node.expression); + return typeofType; + } + function checkVoidExpression(node) { + checkNodeDeferred(node); + return undefinedWideningType; + } + function checkAwaitGrammar(node) { + let hasError = false; + const container = getContainingFunctionOrClassStaticBlock(node); + if (container && isClassStaticBlockDeclaration(container)) { + const message = isAwaitExpression(node) ? Diagnostics.await_expression_cannot_be_used_inside_a_class_static_block : Diagnostics.await_using_statements_cannot_be_used_inside_a_class_static_block; + error22(node, message); + hasError = true; + } else if (!(node.flags & 65536)) { + if (isInTopLevelContext(node)) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + let span; + if (!isEffectiveExternalModule(sourceFile, compilerOptions)) { + span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); + const message = isAwaitExpression(node) ? Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module : Diagnostics.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module; + const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); + diagnostics.add(diagnostic); + hasError = true; + } + switch (moduleKind) { + case 100: + case 199: + if (sourceFile.impliedNodeFormat === 1) { + span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); + diagnostics.add( + createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) + ); + hasError = true; + break; + } + case 7: + case 99: + case 200: + case 4: + if (languageVersion >= 4) { + break; + } + default: + span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos)); + const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher; + diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message)); + hasError = true; + break; + } + } + } else { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + const span = getSpanOfTokenAtPosition(sourceFile, node.pos); + const message = isAwaitExpression(node) ? Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules : Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules; + const diagnostic = createFileDiagnostic(sourceFile, span.start, span.length, message); + if (container && container.kind !== 176 && (getFunctionFlags(container) & 2) === 0) { + const relatedInfo = createDiagnosticForNode(container, Diagnostics.Did_you_mean_to_mark_this_function_as_async); + addRelatedInfo(diagnostic, relatedInfo); + } + diagnostics.add(diagnostic); + hasError = true; + } + } + } + if (isAwaitExpression(node) && isInParameterInitializerBeforeContainingFunction(node)) { + error22(node, Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer); + hasError = true; + } + return hasError; + } + function checkAwaitExpression(node) { + addLazyDiagnostic(() => checkAwaitGrammar(node)); + const operandType = checkExpression(node.expression); + const awaitedType = checkAwaitedType( + operandType, + /*withAlias*/ + true, + node, + Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3)) { + addErrorOrSuggestion( + /*isError*/ + false, + createDiagnosticForNode(node, Diagnostics.await_has_no_effect_on_the_type_of_this_expression) + ); + } + return awaitedType; + } + function checkPrefixUnaryExpression(node) { + const operandType = checkExpression(node.operand); + if (operandType === silentNeverType) { + return silentNeverType; + } + switch (node.operand.kind) { + case 9: + switch (node.operator) { + case 41: + return getFreshTypeOfLiteralType(getNumberLiteralType(-node.operand.text)); + case 40: + return getFreshTypeOfLiteralType(getNumberLiteralType(+node.operand.text)); + } + break; + case 10: + if (node.operator === 41) { + return getFreshTypeOfLiteralType(getBigIntLiteralType({ + negative: true, + base10Value: parsePseudoBigInt(node.operand.text) + })); + } + } + switch (node.operator) { + case 40: + case 41: + case 55: + checkNonNullType(operandType, node.operand); + if (maybeTypeOfKindConsideringBaseConstraint( + operandType, + 12288 + /* ESSymbolLike */ + )) { + error22(node.operand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(node.operator)); + } + if (node.operator === 40) { + if (maybeTypeOfKindConsideringBaseConstraint( + operandType, + 2112 + /* BigIntLike */ + )) { + error22(node.operand, Diagnostics.Operator_0_cannot_be_applied_to_type_1, tokenToString(node.operator), typeToString(getBaseTypeOfLiteralType(operandType))); + } + return numberType2; + } + return getUnaryResultType(operandType); + case 54: + checkTruthinessOfType(operandType, node.operand); + const facts = getTypeFacts( + operandType, + 4194304 | 8388608 + /* Falsy */ + ); + return facts === 4194304 ? falseType : facts === 8388608 ? trueType : booleanType2; + case 46: + case 47: + const ok2 = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type); + if (ok2) { + checkReferenceExpression( + node.operand, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access + ); + } + return getUnaryResultType(operandType); + } + return errorType; + } + function checkPostfixUnaryExpression(node) { + const operandType = checkExpression(node.operand); + if (operandType === silentNeverType) { + return silentNeverType; + } + const ok2 = checkArithmeticOperandType( + node.operand, + checkNonNullType(operandType, node.operand), + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type + ); + if (ok2) { + checkReferenceExpression( + node.operand, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, + Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access + ); + } + return getUnaryResultType(operandType); + } + function getUnaryResultType(operandType) { + if (maybeTypeOfKind( + operandType, + 2112 + /* BigIntLike */ + )) { + return isTypeAssignableToKind( + operandType, + 3 + /* AnyOrUnknown */ + ) || maybeTypeOfKind( + operandType, + 296 + /* NumberLike */ + ) ? numberOrBigIntType : bigintType; + } + return numberType2; + } + function maybeTypeOfKindConsideringBaseConstraint(type3, kind) { + if (maybeTypeOfKind(type3, kind)) { + return true; + } + const baseConstraint = getBaseConstraintOrType(type3); + return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind); + } + function maybeTypeOfKind(type3, kind) { + if (type3.flags & kind) { + return true; + } + if (type3.flags & 3145728) { + const types3 = type3.types; + for (const t8 of types3) { + if (maybeTypeOfKind(t8, kind)) { + return true; + } + } + } + return false; + } + function isTypeAssignableToKind(source, kind, strict2) { + if (source.flags & kind) { + return true; + } + if (strict2 && source.flags & (3 | 16384 | 32768 | 65536)) { + return false; + } + return !!(kind & 296) && isTypeAssignableTo(source, numberType2) || !!(kind & 2112) && isTypeAssignableTo(source, bigintType) || !!(kind & 402653316) && isTypeAssignableTo(source, stringType2) || !!(kind & 528) && isTypeAssignableTo(source, booleanType2) || !!(kind & 16384) && isTypeAssignableTo(source, voidType2) || !!(kind & 131072) && isTypeAssignableTo(source, neverType2) || !!(kind & 65536) && isTypeAssignableTo(source, nullType2) || !!(kind & 32768) && isTypeAssignableTo(source, undefinedType2) || !!(kind & 4096) && isTypeAssignableTo(source, esSymbolType) || !!(kind & 67108864) && isTypeAssignableTo(source, nonPrimitiveType); + } + function allTypesAssignableToKind(source, kind, strict2) { + return source.flags & 1048576 ? every2(source.types, (subType) => allTypesAssignableToKind(subType, kind, strict2)) : isTypeAssignableToKind(source, kind, strict2); + } + function isConstEnumObjectType(type3) { + return !!(getObjectFlags(type3) & 16) && !!type3.symbol && isConstEnumSymbol(type3.symbol); + } + function isConstEnumSymbol(symbol) { + return (symbol.flags & 128) !== 0; + } + function getSymbolHasInstanceMethodOfObjectType(type3) { + const hasInstancePropertyName = getPropertyNameForKnownSymbolName("hasInstance"); + const hasInstanceProperty = getPropertyOfObjectType(type3, hasInstancePropertyName); + if (hasInstanceProperty) { + const hasInstancePropertyType = getTypeOfSymbol(hasInstanceProperty); + if (hasInstancePropertyType && getSignaturesOfType( + hasInstancePropertyType, + 0 + /* Call */ + ).length !== 0) { + return hasInstancePropertyType; + } + } + } + function checkInstanceOfExpression(left, right, leftType, rightType, checkMode) { + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (!isTypeAny(leftType) && allTypesAssignableToKind( + leftType, + 402784252 + /* Primitive */ + )) { + error22(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); + } + Debug.assert(isInstanceOfExpression(left.parent)); + const signature = getResolvedSignature( + left.parent, + /*candidatesOutArray*/ + void 0, + checkMode + ); + if (signature === resolvingSignature) { + return silentNeverType; + } + const returnType = getReturnTypeOfSignature(signature); + checkTypeAssignableTo(returnType, booleanType2, right, Diagnostics.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression); + return booleanType2; + } + function hasEmptyObjectIntersection(type3) { + return someType(type3, (t8) => t8 === unknownEmptyObjectType || !!(t8.flags & 2097152) && isEmptyAnonymousObjectType(getBaseConstraintOrType(t8))); + } + function checkInExpression(left, right, leftType, rightType) { + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (isPrivateIdentifier(left)) { + if (languageVersion < 99) { + checkExternalEmitHelpers( + left, + 2097152 + /* ClassPrivateFieldIn */ + ); + } + if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) { + const isUncheckedJS = isUncheckedJSSuggestion( + left, + rightType.symbol, + /*excludeClasses*/ + true + ); + reportNonexistentProperty(left, rightType, isUncheckedJS); + } + } else { + checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left); + } + if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) { + if (hasEmptyObjectIntersection(rightType)) { + error22(right, Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType)); + } + } + return booleanType2; + } + function checkObjectLiteralAssignment(node, sourceType, rightIsThis) { + const properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } + for (let i7 = 0; i7 < properties.length; i7++) { + checkObjectLiteralDestructuringPropertyAssignment(node, sourceType, i7, properties, rightIsThis); + } + return sourceType; + } + function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) { + const properties = node.properties; + const property2 = properties[propertyIndex]; + if (property2.kind === 303 || property2.kind === 304) { + const name2 = property2.name; + const exprType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(exprType)) { + const text = getPropertyNameFromType(exprType); + const prop = getPropertyOfType(objectLiteralType, text); + if (prop) { + markPropertyAsReferenced(prop, property2, rightIsThis); + checkPropertyAccessibility( + property2, + /*isSuper*/ + false, + /*writing*/ + true, + objectLiteralType, + prop + ); + } + } + const elementType = getIndexedAccessType(objectLiteralType, exprType, 32, name2); + const type3 = getFlowTypeOfDestructuring(property2, elementType); + return checkDestructuringAssignment(property2.kind === 304 ? property2 : property2.initializer, type3); + } else if (property2.kind === 305) { + if (propertyIndex < properties.length - 1) { + error22(property2, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } else { + if (languageVersion < 99) { + checkExternalEmitHelpers( + property2, + 4 + /* Rest */ + ); + } + const nonRestNames = []; + if (allProperties) { + for (const otherProperty of allProperties) { + if (!isSpreadAssignment(otherProperty)) { + nonRestNames.push(otherProperty.name); + } + } + } + const type3 = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol); + checkGrammarForDisallowedTrailingComma(allProperties, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + return checkDestructuringAssignment(property2.expression, type3); + } + } else { + error22(property2, Diagnostics.Property_assignment_expected); + } + } + function checkArrayLiteralAssignment(node, sourceType, checkMode) { + const elements = node.elements; + if (languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 512 + /* Read */ + ); + } + const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 | 128, sourceType, undefinedType2, node) || errorType; + let inBoundsType = compilerOptions.noUncheckedIndexedAccess ? void 0 : possiblyOutOfBoundsType; + for (let i7 = 0; i7 < elements.length; i7++) { + let type3 = possiblyOutOfBoundsType; + if (node.elements[i7].kind === 230) { + type3 = inBoundsType = inBoundsType ?? (checkIteratedTypeOrElementType(65, sourceType, undefinedType2, node) || errorType); + } + checkArrayLiteralDestructuringElementAssignment(node, sourceType, i7, type3, checkMode); + } + return sourceType; + } + function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { + const elements = node.elements; + const element = elements[elementIndex]; + if (element.kind !== 232) { + if (element.kind !== 230) { + const indexType = getNumberLiteralType(elementIndex); + if (isArrayLikeType(sourceType)) { + const accessFlags = 32 | (hasDefaultValue(element) ? 16 : 0); + const elementType2 = getIndexedAccessTypeOrUndefined(sourceType, indexType, accessFlags, createSyntheticExpression(element, indexType)) || errorType; + const assignedType = hasDefaultValue(element) ? getTypeWithFacts( + elementType2, + 524288 + /* NEUndefined */ + ) : elementType2; + const type3 = getFlowTypeOfDestructuring(element, assignedType); + return checkDestructuringAssignment(element, type3, checkMode); + } + return checkDestructuringAssignment(element, elementType, checkMode); + } + if (elementIndex < elements.length - 1) { + error22(element, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } else { + const restExpression = element.expression; + if (restExpression.kind === 226 && restExpression.operatorToken.kind === 64) { + error22(restExpression.operatorToken, Diagnostics.A_rest_element_cannot_have_an_initializer); + } else { + checkGrammarForDisallowedTrailingComma(node.elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + const type3 = everyType(sourceType, isTupleType) ? mapType2(sourceType, (t8) => sliceTupleType(t8, elementIndex)) : createArrayType(elementType); + return checkDestructuringAssignment(restExpression, type3, checkMode); + } + } + } + return void 0; + } + function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode, rightIsThis) { + let target; + if (exprOrAssignment.kind === 304) { + const prop = exprOrAssignment; + if (prop.objectAssignmentInitializer) { + if (strictNullChecks && !hasTypeFacts( + checkExpression(prop.objectAssignmentInitializer), + 16777216 + /* IsUndefined */ + )) { + sourceType = getTypeWithFacts( + sourceType, + 524288 + /* NEUndefined */ + ); + } + checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, checkMode); + } + target = exprOrAssignment.name; + } else { + target = exprOrAssignment; + } + if (target.kind === 226 && target.operatorToken.kind === 64) { + checkBinaryExpression(target, checkMode); + target = target.left; + if (strictNullChecks) { + sourceType = getTypeWithFacts( + sourceType, + 524288 + /* NEUndefined */ + ); + } + } + if (target.kind === 210) { + return checkObjectLiteralAssignment(target, sourceType, rightIsThis); + } + if (target.kind === 209) { + return checkArrayLiteralAssignment(target, sourceType, checkMode); + } + return checkReferenceAssignment(target, sourceType, checkMode); + } + function checkReferenceAssignment(target, sourceType, checkMode) { + const targetType = checkExpression(target, checkMode); + const error3 = target.parent.kind === 305 ? Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; + const optionalError = target.parent.kind === 305 ? Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access : Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access; + if (checkReferenceExpression(target, error3, optionalError)) { + checkTypeAssignableToAndOptionallyElaborate(sourceType, targetType, target, target); + } + if (isPrivateIdentifierPropertyAccessExpression(target)) { + checkExternalEmitHelpers( + target.parent, + 1048576 + /* ClassPrivateFieldSet */ + ); + } + return sourceType; + } + function isSideEffectFree(node) { + node = skipParentheses(node); + switch (node.kind) { + case 80: + case 11: + case 14: + case 215: + case 228: + case 15: + case 9: + case 10: + case 112: + case 97: + case 106: + case 157: + case 218: + case 231: + case 219: + case 209: + case 210: + case 221: + case 235: + case 285: + case 284: + return true; + case 227: + return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); + case 226: + if (isAssignmentOperator(node.operatorToken.kind)) { + return false; + } + return isSideEffectFree(node.left) && isSideEffectFree(node.right); + case 224: + case 225: + switch (node.operator) { + case 54: + case 40: + case 41: + case 55: + return true; + } + return false; + case 222: + case 216: + case 234: + default: + return false; + } + } + function isTypeEqualityComparableTo(source, target) { + return (target.flags & 98304) !== 0 || isTypeComparableTo(source, target); + } + function createCheckBinaryExpression() { + const trampoline = createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState); + return (node, checkMode) => { + const result2 = trampoline(node, checkMode); + Debug.assertIsDefined(result2); + return result2; + }; + function onEnter(node, state, checkMode) { + if (state) { + state.stackIndex++; + state.skip = false; + setLeftType( + state, + /*type*/ + void 0 + ); + setLastResult( + state, + /*type*/ + void 0 + ); + } else { + state = { + checkMode, + skip: false, + stackIndex: 0, + typeStack: [void 0, void 0] + }; + } + if (isInJSFile(node) && getAssignedExpandoInitializer(node)) { + state.skip = true; + setLastResult(state, checkExpression(node.right, checkMode)); + return state; + } + checkGrammarNullishCoalesceWithLogicalExpression(node); + const operator = node.operatorToken.kind; + if (operator === 64 && (node.left.kind === 210 || node.left.kind === 209)) { + state.skip = true; + setLastResult(state, checkDestructuringAssignment( + node.left, + checkExpression(node.right, checkMode), + checkMode, + node.right.kind === 110 + /* ThisKeyword */ + )); + return state; + } + return state; + } + function onLeft(left, state, _node) { + if (!state.skip) { + return maybeCheckExpression(state, left); + } + } + function onOperator(operatorToken, state, node) { + if (!state.skip) { + const leftType = getLastResult(state); + Debug.assertIsDefined(leftType); + setLeftType(state, leftType); + setLastResult( + state, + /*type*/ + void 0 + ); + const operator = operatorToken.kind; + if (isLogicalOrCoalescingBinaryOperator(operator)) { + let parent22 = node.parent; + while (parent22.kind === 217 || isLogicalOrCoalescingBinaryExpression(parent22)) { + parent22 = parent22.parent; + } + if (operator === 56 || isIfStatement(parent22)) { + checkTestingKnownTruthyCallableOrAwaitableType(node.left, leftType, isIfStatement(parent22) ? parent22.thenStatement : void 0); + } + checkTruthinessOfType(leftType, node.left); + } + } + } + function onRight(right, state, _node) { + if (!state.skip) { + return maybeCheckExpression(state, right); + } + } + function onExit(node, state) { + let result2; + if (state.skip) { + result2 = getLastResult(state); + } else { + const leftType = getLeftType(state); + Debug.assertIsDefined(leftType); + const rightType = getLastResult(state); + Debug.assertIsDefined(rightType); + result2 = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node); + } + state.skip = false; + setLeftType( + state, + /*type*/ + void 0 + ); + setLastResult( + state, + /*type*/ + void 0 + ); + state.stackIndex--; + return result2; + } + function foldState(state, result2, _side) { + setLastResult(state, result2); + return state; + } + function maybeCheckExpression(state, node) { + if (isBinaryExpression(node)) { + return node; + } + setLastResult(state, checkExpression(node, state.checkMode)); + } + function getLeftType(state) { + return state.typeStack[state.stackIndex]; + } + function setLeftType(state, type3) { + state.typeStack[state.stackIndex] = type3; + } + function getLastResult(state) { + return state.typeStack[state.stackIndex + 1]; + } + function setLastResult(state, type3) { + state.typeStack[state.stackIndex + 1] = type3; + } + } + function checkGrammarNullishCoalesceWithLogicalExpression(node) { + const { left, operatorToken, right } = node; + if (operatorToken.kind === 61) { + if (isBinaryExpression(left) && (left.operatorToken.kind === 57 || left.operatorToken.kind === 56)) { + grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind)); + } + if (isBinaryExpression(right) && (right.operatorToken.kind === 57 || right.operatorToken.kind === 56)) { + grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind)); + } + } + } + function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { + const operator = operatorToken.kind; + if (operator === 64 && (left.kind === 210 || left.kind === 209)) { + return checkDestructuringAssignment( + left, + checkExpression(right, checkMode), + checkMode, + right.kind === 110 + /* ThisKeyword */ + ); + } + let leftType; + if (isLogicalOrCoalescingBinaryOperator(operator)) { + leftType = checkTruthinessExpression(left, checkMode); + } else { + leftType = checkExpression(left, checkMode); + } + const rightType = checkExpression(right, checkMode); + return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode); + } + function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) { + const operator = operatorToken.kind; + switch (operator) { + case 42: + case 43: + case 67: + case 68: + case 44: + case 69: + case 45: + case 70: + case 41: + case 66: + case 48: + case 71: + case 49: + case 72: + case 50: + case 73: + case 52: + case 75: + case 53: + case 79: + case 51: + case 74: + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + let suggestedOperator; + if (leftType.flags & 528 && rightType.flags & 528 && (suggestedOperator = getSuggestedBooleanOperator(operatorToken.kind)) !== void 0) { + error22(errorNode || operatorToken, Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, tokenToString(operatorToken.kind), tokenToString(suggestedOperator)); + return numberType2; + } else { + const leftOk = checkArithmeticOperandType( + left, + leftType, + Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, + /*isAwaitValid*/ + true + ); + const rightOk = checkArithmeticOperandType( + right, + rightType, + Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type, + /*isAwaitValid*/ + true + ); + let resultType2; + if (isTypeAssignableToKind( + leftType, + 3 + /* AnyOrUnknown */ + ) && isTypeAssignableToKind( + rightType, + 3 + /* AnyOrUnknown */ + ) || // Or, if neither could be bigint, implicit coercion results in a number result + !(maybeTypeOfKind( + leftType, + 2112 + /* BigIntLike */ + ) || maybeTypeOfKind( + rightType, + 2112 + /* BigIntLike */ + ))) { + resultType2 = numberType2; + } else if (bothAreBigIntLike(leftType, rightType)) { + switch (operator) { + case 50: + case 73: + reportOperatorError(); + break; + case 43: + case 68: + if (languageVersion < 3) { + error22(errorNode, Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later); + } + } + resultType2 = bigintType; + } else { + reportOperatorError(bothAreBigIntLike); + resultType2 = errorType; + } + if (leftOk && rightOk) { + checkAssignmentOperator(resultType2); + } + return resultType2; + } + case 40: + case 65: + if (leftType === silentNeverType || rightType === silentNeverType) { + return silentNeverType; + } + if (!isTypeAssignableToKind( + leftType, + 402653316 + /* StringLike */ + ) && !isTypeAssignableToKind( + rightType, + 402653316 + /* StringLike */ + )) { + leftType = checkNonNullType(leftType, left); + rightType = checkNonNullType(rightType, right); + } + let resultType; + if (isTypeAssignableToKind( + leftType, + 296, + /*strict*/ + true + ) && isTypeAssignableToKind( + rightType, + 296, + /*strict*/ + true + )) { + resultType = numberType2; + } else if (isTypeAssignableToKind( + leftType, + 2112, + /*strict*/ + true + ) && isTypeAssignableToKind( + rightType, + 2112, + /*strict*/ + true + )) { + resultType = bigintType; + } else if (isTypeAssignableToKind( + leftType, + 402653316, + /*strict*/ + true + ) || isTypeAssignableToKind( + rightType, + 402653316, + /*strict*/ + true + )) { + resultType = stringType2; + } else if (isTypeAny(leftType) || isTypeAny(rightType)) { + resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType2; + } + if (resultType && !checkForDisallowedESSymbolOperand(operator)) { + return resultType; + } + if (!resultType) { + const closeEnoughKind = 296 | 2112 | 402653316 | 3; + reportOperatorError( + (left2, right2) => isTypeAssignableToKind(left2, closeEnoughKind) && isTypeAssignableToKind(right2, closeEnoughKind) + ); + return anyType2; + } + if (operator === 65) { + checkAssignmentOperator(resultType); + } + return resultType; + case 30: + case 32: + case 33: + case 34: + if (checkForDisallowedESSymbolOperand(operator)) { + leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left)); + rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right)); + reportOperatorErrorUnless((left2, right2) => { + if (isTypeAny(left2) || isTypeAny(right2)) { + return true; + } + const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType); + const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType); + return leftAssignableToNumber && rightAssignableToNumber || !leftAssignableToNumber && !rightAssignableToNumber && areTypesComparable(left2, right2); + }); + } + return booleanType2; + case 35: + case 36: + case 37: + case 38: + if (!(checkMode && checkMode & 64)) { + if ((isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) && // only report for === and !== in JS, not == or != + (!isInJSFile(left) || (operator === 37 || operator === 38))) { + const eqType = operator === 35 || operator === 37; + error22(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true"); + } + checkNaNEquality(errorNode, operator, left, right); + reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2)); + } + return booleanType2; + case 104: + return checkInstanceOfExpression(left, right, leftType, rightType, checkMode); + case 103: + return checkInExpression(left, right, leftType, rightType); + case 56: + case 77: { + const resultType2 = hasTypeFacts( + leftType, + 4194304 + /* Truthy */ + ) ? getUnionType([extractDefinitelyFalsyTypes(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType)), rightType]) : leftType; + if (operator === 77) { + checkAssignmentOperator(rightType); + } + return resultType2; + } + case 57: + case 76: { + const resultType2 = hasTypeFacts( + leftType, + 8388608 + /* Falsy */ + ) ? getUnionType( + [getNonNullableType(removeDefinitelyFalsyTypes(leftType)), rightType], + 2 + /* Subtype */ + ) : leftType; + if (operator === 76) { + checkAssignmentOperator(rightType); + } + return resultType2; + } + case 61: + case 78: { + const resultType2 = hasTypeFacts( + leftType, + 262144 + /* EQUndefinedOrNull */ + ) ? getUnionType( + [getNonNullableType(leftType), rightType], + 2 + /* Subtype */ + ) : leftType; + if (operator === 78) { + checkAssignmentOperator(rightType); + } + return resultType2; + } + case 64: + const declKind = isBinaryExpression(left.parent) ? getAssignmentDeclarationKind(left.parent) : 0; + checkAssignmentDeclaration(declKind, rightType); + if (isAssignmentDeclaration2(declKind)) { + if (!(rightType.flags & 524288) || declKind !== 2 && declKind !== 6 && !isEmptyObjectType(rightType) && !isFunctionObjectType(rightType) && !(getObjectFlags(rightType) & 1)) { + checkAssignmentOperator(rightType); + } + return leftType; + } else { + checkAssignmentOperator(rightType); + return rightType; + } + case 28: + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left) && !isIndirectCall(left.parent)) { + const sf = getSourceFileOfNode(left); + const sourceText = sf.text; + const start = skipTrivia(sourceText, left.pos); + const isInDiag2657 = sf.parseDiagnostics.some((diag2) => { + if (diag2.code !== Diagnostics.JSX_expressions_must_have_one_parent_element.code) + return false; + return textSpanContainsPosition(diag2, start); + }); + if (!isInDiag2657) + error22(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); + } + return rightType; + default: + return Debug.fail(); + } + function bothAreBigIntLike(left2, right2) { + return isTypeAssignableToKind( + left2, + 2112 + /* BigIntLike */ + ) && isTypeAssignableToKind( + right2, + 2112 + /* BigIntLike */ + ); + } + function checkAssignmentDeclaration(kind, rightType2) { + if (kind === 2) { + for (const prop of getPropertiesOfObjectType(rightType2)) { + const propType = getTypeOfSymbol(prop); + if (propType.symbol && propType.symbol.flags & 32) { + const name2 = prop.escapedName; + const symbol = resolveName( + prop.valueDeclaration, + name2, + 788968, + /*nameNotFoundMessage*/ + void 0, + name2, + /*isUse*/ + false + ); + if ((symbol == null ? void 0 : symbol.declarations) && symbol.declarations.some(isJSDocTypedefTag)) { + addDuplicateDeclarationErrorsForSymbols(symbol, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name2), prop); + addDuplicateDeclarationErrorsForSymbols(prop, Diagnostics.Duplicate_identifier_0, unescapeLeadingUnderscores(name2), symbol); + } + } + } + } + } + function isIndirectCall(node) { + return node.parent.kind === 217 && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 215) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior. + (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval"); + } + function checkForDisallowedESSymbolOperand(operator2) { + const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint( + leftType, + 12288 + /* ESSymbolLike */ + ) ? left : maybeTypeOfKindConsideringBaseConstraint( + rightType, + 12288 + /* ESSymbolLike */ + ) ? right : void 0; + if (offendingSymbolOperand) { + error22(offendingSymbolOperand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(operator2)); + return false; + } + return true; + } + function getSuggestedBooleanOperator(operator2) { + switch (operator2) { + case 52: + case 75: + return 57; + case 53: + case 79: + return 38; + case 51: + case 74: + return 56; + default: + return void 0; + } + } + function checkAssignmentOperator(valueType) { + if (isAssignmentOperator(operator)) { + addLazyDiagnostic(checkAssignmentOperatorWorker); + } + function checkAssignmentOperatorWorker() { + let assigneeType = leftType; + if (isCompoundAssignment(operatorToken.kind) && left.kind === 211) { + assigneeType = checkPropertyAccessExpression( + left, + /*checkMode*/ + void 0, + /*writeOnly*/ + true + ); + } + if (checkReferenceExpression(left, Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access, Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)) { + let headMessage; + if (exactOptionalPropertyTypes && isPropertyAccessExpression(left) && maybeTypeOfKind( + valueType, + 32768 + /* Undefined */ + )) { + const target = getTypeOfPropertyOfType(getTypeOfExpression(left.expression), left.name.escapedText); + if (isExactOptionalPropertyMismatch(valueType, target)) { + headMessage = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target; + } + } + checkTypeAssignableToAndOptionallyElaborate(valueType, assigneeType, left, right, headMessage); + } + } + } + function isAssignmentDeclaration2(kind) { + var _a2; + switch (kind) { + case 2: + return true; + case 1: + case 5: + case 6: + case 3: + case 4: + const symbol = getSymbolOfNode(left); + const init2 = getAssignedExpandoInitializer(right); + return !!init2 && isObjectLiteralExpression(init2) && !!((_a2 = symbol == null ? void 0 : symbol.exports) == null ? void 0 : _a2.size); + default: + return false; + } + } + function reportOperatorErrorUnless(typesAreCompatible) { + if (!typesAreCompatible(leftType, rightType)) { + reportOperatorError(typesAreCompatible); + return true; + } + return false; + } + function reportOperatorError(isRelated) { + let wouldWorkWithAwait = false; + const errNode = errorNode || operatorToken; + if (isRelated) { + const awaitedLeftType = getAwaitedTypeNoAlias(leftType); + const awaitedRightType = getAwaitedTypeNoAlias(rightType); + wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType) && !!(awaitedLeftType && awaitedRightType) && isRelated(awaitedLeftType, awaitedRightType); + } + let effectiveLeft = leftType; + let effectiveRight = rightType; + if (!wouldWorkWithAwait && isRelated) { + [effectiveLeft, effectiveRight] = getBaseTypesIfUnrelated(leftType, rightType, isRelated); + } + const [leftStr, rightStr] = getTypeNamesForErrorDisplay(effectiveLeft, effectiveRight); + if (!tryGiveBetterPrimaryError(errNode, wouldWorkWithAwait, leftStr, rightStr)) { + errorAndMaybeSuggestAwait( + errNode, + wouldWorkWithAwait, + Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, + tokenToString(operatorToken.kind), + leftStr, + rightStr + ); + } + } + function tryGiveBetterPrimaryError(errNode, maybeMissingAwait, leftStr, rightStr) { + switch (operatorToken.kind) { + case 37: + case 35: + case 38: + case 36: + return errorAndMaybeSuggestAwait( + errNode, + maybeMissingAwait, + Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap, + leftStr, + rightStr + ); + default: + return void 0; + } + } + function checkNaNEquality(errorNode2, operator2, left2, right2) { + const isLeftNaN = isGlobalNaN(skipParentheses(left2)); + const isRightNaN = isGlobalNaN(skipParentheses(right2)); + if (isLeftNaN || isRightNaN) { + const err = error22(errorNode2, Diagnostics.This_condition_will_always_return_0, tokenToString( + operator2 === 37 || operator2 === 35 ? 97 : 112 + /* TrueKeyword */ + )); + if (isLeftNaN && isRightNaN) + return; + const operatorString = operator2 === 38 || operator2 === 36 ? tokenToString( + 54 + /* ExclamationToken */ + ) : ""; + const location2 = isLeftNaN ? right2 : left2; + const expression = skipParentheses(location2); + addRelatedInfo(err, createDiagnosticForNode(location2, Diagnostics.Did_you_mean_0, `${operatorString}Number.isNaN(${isEntityNameExpression(expression) ? entityNameToString(expression) : "..."})`)); + } + } + function isGlobalNaN(expr) { + if (isIdentifier(expr) && expr.escapedText === "NaN") { + const globalNaNSymbol = getGlobalNaNSymbol(); + return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr); + } + return false; + } + } + function getBaseTypesIfUnrelated(leftType, rightType, isRelated) { + let effectiveLeft = leftType; + let effectiveRight = rightType; + const leftBase = getBaseTypeOfLiteralType(leftType); + const rightBase = getBaseTypeOfLiteralType(rightType); + if (!isRelated(leftBase, rightBase)) { + effectiveLeft = leftBase; + effectiveRight = rightBase; + } + return [effectiveLeft, effectiveRight]; + } + function checkYieldExpression(node) { + addLazyDiagnostic(checkYieldExpressionGrammar); + const func = getContainingFunction(node); + if (!func) + return anyType2; + const functionFlags = getFunctionFlags(func); + if (!(functionFlags & 1)) { + return anyType2; + } + const isAsync2 = (functionFlags & 2) !== 0; + if (node.asteriskToken) { + if (isAsync2 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 26624 + /* AsyncDelegatorIncludes */ + ); + } + if (!isAsync2 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 256 + /* Values */ + ); + } + } + let returnType = getReturnTypeFromAnnotation(func); + if (returnType && returnType.flags & 1048576) { + returnType = filterType(returnType, (t8) => checkGeneratorInstantiationAssignabilityToReturnType( + t8, + functionFlags, + /*errorNode*/ + void 0 + )); + } + const iterationTypes = returnType && getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsync2); + const signatureYieldType = iterationTypes && iterationTypes.yieldType || anyType2; + const signatureNextType = iterationTypes && iterationTypes.nextType || anyType2; + const resolvedSignatureNextType = isAsync2 ? getAwaitedType(signatureNextType) || anyType2 : signatureNextType; + const yieldExpressionType = node.expression ? checkExpression(node.expression) : undefinedWideningType; + const yieldedType = getYieldedTypeOfYieldExpression(node, yieldExpressionType, resolvedSignatureNextType, isAsync2); + if (returnType && yieldedType) { + checkTypeAssignableToAndOptionallyElaborate(yieldedType, signatureYieldType, node.expression || node, node.expression); + } + if (node.asteriskToken) { + const use = isAsync2 ? 19 : 17; + return getIterationTypeOfIterable(use, 1, yieldExpressionType, node.expression) || anyType2; + } else if (returnType) { + return getIterationTypeOfGeneratorFunctionReturnType(2, returnType, isAsync2) || anyType2; + } + let type3 = getContextualIterationType(2, func); + if (!type3) { + type3 = anyType2; + addLazyDiagnostic(() => { + if (noImplicitAny && !expressionResultIsUnused(node)) { + const contextualType = getContextualType2( + node, + /*contextFlags*/ + void 0 + ); + if (!contextualType || isTypeAny(contextualType)) { + error22(node, Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation); + } + } + }); + } + return type3; + function checkYieldExpressionGrammar() { + if (!(node.flags & 16384)) { + grammarErrorOnFirstToken(node, Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); + } + if (isInParameterInitializerBeforeContainingFunction(node)) { + error22(node, Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); + } + } + } + function checkConditionalExpression(node, checkMode) { + const type3 = checkTruthinessExpression(node.condition, checkMode); + checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type3, node.whenTrue); + const type1 = checkExpression(node.whenTrue, checkMode); + const type22 = checkExpression(node.whenFalse, checkMode); + return getUnionType( + [type1, type22], + 2 + /* Subtype */ + ); + } + function isTemplateLiteralContext(node) { + const parent22 = node.parent; + return isParenthesizedExpression(parent22) && isTemplateLiteralContext(parent22) || isElementAccessExpression(parent22) && parent22.argumentExpression === node; + } + function checkTemplateExpression(node) { + const texts = [node.head.text]; + const types3 = []; + for (const span of node.templateSpans) { + const type3 = checkExpression(span.expression); + if (maybeTypeOfKindConsideringBaseConstraint( + type3, + 12288 + /* ESSymbolLike */ + )) { + error22(span.expression, Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String); + } + texts.push(span.literal.text); + types3.push(isTypeAssignableTo(type3, templateConstraintType) ? type3 : stringType2); + } + if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType2( + node, + /*contextFlags*/ + void 0 + ) || unknownType2, isTemplateLiteralContextualType)) { + return getTemplateLiteralType(texts, types3); + } + const evaluated = node.parent.kind !== 215 && evaluateTemplateExpression(node); + return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType2; + } + function isTemplateLiteralContextualType(type3) { + return !!(type3.flags & (128 | 134217728) || type3.flags & 58982400 && maybeTypeOfKind( + getBaseConstraintOfType(type3) || unknownType2, + 402653316 + /* StringLike */ + )); + } + function getContextNode2(node) { + if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) { + return node.parent.parent; + } + return node; + } + function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) { + const contextNode = getContextNode2(node); + pushContextualType( + contextNode, + contextualType, + /*isCache*/ + false + ); + pushInferenceContext(contextNode, inferenceContext); + const type3 = checkExpression(node, checkMode | 1 | (inferenceContext ? 2 : 0)); + if (inferenceContext && inferenceContext.intraExpressionInferenceSites) { + inferenceContext.intraExpressionInferenceSites = void 0; + } + const result2 = maybeTypeOfKind( + type3, + 2944 + /* Literal */ + ) && isLiteralOfContextualType(type3, instantiateContextualType( + contextualType, + node, + /*contextFlags*/ + void 0 + )) ? getRegularTypeOfLiteralType(type3) : type3; + popInferenceContext(); + popContextualType(); + return result2; + } + function checkExpressionCached(node, checkMode) { + if (checkMode) { + return checkExpression(node, checkMode); + } + const links = getNodeLinks(node); + if (!links.resolvedType) { + const saveFlowLoopStart = flowLoopStart; + const saveFlowTypeCache = flowTypeCache; + flowLoopStart = flowLoopCount; + flowTypeCache = void 0; + links.resolvedType = checkExpression(node, checkMode); + flowTypeCache = saveFlowTypeCache; + flowLoopStart = saveFlowLoopStart; + } + return links.resolvedType; + } + function isTypeAssertion(node) { + node = skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + return node.kind === 216 || node.kind === 234 || isJSDocTypeAssertion(node); + } + function checkDeclarationInitializer(declaration, checkMode, contextualType) { + const initializer = getEffectiveInitializer(declaration); + if (isInJSFile(declaration)) { + const typeNode = tryGetJSDocSatisfiesTypeNode(declaration); + if (typeNode) { + return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode); + } + } + const type3 = getQuickTypeOfExpression(initializer) || (contextualType ? checkExpressionWithContextualType( + initializer, + contextualType, + /*inferenceContext*/ + void 0, + checkMode || 0 + /* Normal */ + ) : checkExpressionCached(initializer, checkMode)); + return isParameter(declaration) && declaration.name.kind === 207 && isTupleType(type3) && !type3.target.hasRestElement && getTypeReferenceArity(type3) < declaration.name.elements.length ? padTupleType(type3, declaration.name) : type3; + } + function padTupleType(type3, pattern5) { + const patternElements = pattern5.elements; + const elementTypes = getElementTypes(type3).slice(); + const elementFlags = type3.target.elementFlags.slice(); + for (let i7 = getTypeReferenceArity(type3); i7 < patternElements.length; i7++) { + const e10 = patternElements[i7]; + if (i7 < patternElements.length - 1 || !(e10.kind === 208 && e10.dotDotDotToken)) { + elementTypes.push(!isOmittedExpression(e10) && hasDefaultValue(e10) ? getTypeFromBindingElement( + e10, + /*includePatternInType*/ + false, + /*reportErrors*/ + false + ) : anyType2); + elementFlags.push( + 2 + /* Optional */ + ); + if (!isOmittedExpression(e10) && !hasDefaultValue(e10)) { + reportImplicitAny(e10, anyType2); + } + } + } + return createTupleType(elementTypes, elementFlags, type3.target.readonly); + } + function widenTypeInferredFromInitializer(declaration, type3) { + const widened = getCombinedNodeFlagsCached(declaration) & 6 || isDeclarationReadonly(declaration) ? type3 : getWidenedLiteralType(type3); + if (isInJSFile(declaration)) { + if (isEmptyLiteralType(widened)) { + reportImplicitAny(declaration, anyType2); + return anyType2; + } else if (isEmptyArrayLiteralType(widened)) { + reportImplicitAny(declaration, anyArrayType); + return anyArrayType; + } + } + return widened; + } + function isLiteralOfContextualType(candidateType, contextualType) { + if (contextualType) { + if (contextualType.flags & 3145728) { + const types3 = contextualType.types; + return some2(types3, (t8) => isLiteralOfContextualType(candidateType, t8)); + } + if (contextualType.flags & 58982400) { + const constraint = getBaseConstraintOfType(contextualType) || unknownType2; + return maybeTypeOfKind( + constraint, + 4 + /* String */ + ) && maybeTypeOfKind( + candidateType, + 128 + /* StringLiteral */ + ) || maybeTypeOfKind( + constraint, + 8 + /* Number */ + ) && maybeTypeOfKind( + candidateType, + 256 + /* NumberLiteral */ + ) || maybeTypeOfKind( + constraint, + 64 + /* BigInt */ + ) && maybeTypeOfKind( + candidateType, + 2048 + /* BigIntLiteral */ + ) || maybeTypeOfKind( + constraint, + 4096 + /* ESSymbol */ + ) && maybeTypeOfKind( + candidateType, + 8192 + /* UniqueESSymbol */ + ) || isLiteralOfContextualType(candidateType, constraint); + } + return !!(contextualType.flags & (128 | 4194304 | 134217728 | 268435456) && maybeTypeOfKind( + candidateType, + 128 + /* StringLiteral */ + ) || contextualType.flags & 256 && maybeTypeOfKind( + candidateType, + 256 + /* NumberLiteral */ + ) || contextualType.flags & 2048 && maybeTypeOfKind( + candidateType, + 2048 + /* BigIntLiteral */ + ) || contextualType.flags & 512 && maybeTypeOfKind( + candidateType, + 512 + /* BooleanLiteral */ + ) || contextualType.flags & 8192 && maybeTypeOfKind( + candidateType, + 8192 + /* UniqueESSymbol */ + )); + } + return false; + } + function isConstContext(node) { + const parent22 = node.parent; + return isAssertionExpression(parent22) && isConstTypeReference(parent22.type) || isJSDocTypeAssertion(parent22) && isConstTypeReference(getJSDocTypeAssertionType(parent22)) || isValidConstAssertionArgument(node) && isConstTypeVariable(getContextualType2( + node, + 0 + /* None */ + )) || (isParenthesizedExpression(parent22) || isArrayLiteralExpression(parent22) || isSpreadElement(parent22)) && isConstContext(parent22) || (isPropertyAssignment(parent22) || isShorthandPropertyAssignment(parent22) || isTemplateSpan(parent22)) && isConstContext(parent22.parent); + } + function checkExpressionForMutableLocation(node, checkMode, forceTuple) { + const type3 = checkExpression(node, checkMode, forceTuple); + return isConstContext(node) || isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type3) : isTypeAssertion(node) ? type3 : getWidenedLiteralLikeTypeForContextualType(type3, instantiateContextualType( + getContextualType2( + node, + /*contextFlags*/ + void 0 + ), + node, + /*contextFlags*/ + void 0 + )); + } + function checkPropertyAssignment(node, checkMode) { + if (node.name.kind === 167) { + checkComputedPropertyName(node.name); + } + return checkExpressionForMutableLocation(node.initializer, checkMode); + } + function checkObjectLiteralMethod(node, checkMode) { + checkGrammarMethod(node); + if (node.name.kind === 167) { + checkComputedPropertyName(node.name); + } + const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); + } + function instantiateTypeWithSingleGenericCallSignature(node, type3, checkMode) { + if (checkMode && checkMode & (2 | 8)) { + const callSignature = getSingleSignature( + type3, + 0, + /*allowMembers*/ + true + ); + const constructSignature = getSingleSignature( + type3, + 1, + /*allowMembers*/ + true + ); + const signature = callSignature || constructSignature; + if (signature && signature.typeParameters) { + const contextualType = getApparentTypeOfContextualType( + node, + 2 + /* NoConstraints */ + ); + if (contextualType) { + const contextualSignature = getSingleSignature( + getNonNullableType(contextualType), + callSignature ? 0 : 1, + /*allowMembers*/ + false + ); + if (contextualSignature && !contextualSignature.typeParameters) { + if (checkMode & 8) { + skippedGenericFunction(node, checkMode); + return anyFunctionType; + } + const context2 = getInferenceContext(node); + const returnType = context2.signature && getReturnTypeOfSignature(context2.signature); + const returnSignature = returnType && getSingleCallOrConstructSignature(returnType); + if (returnSignature && !returnSignature.typeParameters && !every2(context2.inferences, hasInferenceCandidates)) { + const uniqueTypeParameters = getUniqueTypeParameters(context2, signature.typeParameters); + const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters); + const inferences = map4(context2.inferences, (info2) => createInferenceInfo(info2.typeParameter)); + applyToParameterTypes(instantiatedSignature, contextualSignature, (source, target) => { + inferTypes( + inferences, + source, + target, + /*priority*/ + 0, + /*contravariant*/ + true + ); + }); + if (some2(inferences, hasInferenceCandidates)) { + applyToReturnTypes(instantiatedSignature, contextualSignature, (source, target) => { + inferTypes(inferences, source, target); + }); + if (!hasOverlappingInferences(context2.inferences, inferences)) { + mergeInferences(context2.inferences, inferences); + context2.inferredTypeParameters = concatenate(context2.inferredTypeParameters, uniqueTypeParameters); + return getOrCreateTypeFromSignature(instantiatedSignature); + } + } + } + return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context2)); + } + } + } + } + return type3; + } + function skippedGenericFunction(node, checkMode) { + if (checkMode & 2) { + const context2 = getInferenceContext(node); + context2.flags |= 4; + } + } + function hasInferenceCandidates(info2) { + return !!(info2.candidates || info2.contraCandidates); + } + function hasInferenceCandidatesOrDefault(info2) { + return !!(info2.candidates || info2.contraCandidates || hasTypeParameterDefault(info2.typeParameter)); + } + function hasOverlappingInferences(a7, b8) { + for (let i7 = 0; i7 < a7.length; i7++) { + if (hasInferenceCandidates(a7[i7]) && hasInferenceCandidates(b8[i7])) { + return true; + } + } + return false; + } + function mergeInferences(target, source) { + for (let i7 = 0; i7 < target.length; i7++) { + if (!hasInferenceCandidates(target[i7]) && hasInferenceCandidates(source[i7])) { + target[i7] = source[i7]; + } + } + } + function getUniqueTypeParameters(context2, typeParameters) { + const result2 = []; + let oldTypeParameters; + let newTypeParameters; + for (const tp of typeParameters) { + const name2 = tp.symbol.escapedName; + if (hasTypeParameterByName(context2.inferredTypeParameters, name2) || hasTypeParameterByName(result2, name2)) { + const newName = getUniqueTypeParameterName(concatenate(context2.inferredTypeParameters, result2), name2); + const symbol = createSymbol(262144, newName); + const newTypeParameter = createTypeParameter(symbol); + newTypeParameter.target = tp; + oldTypeParameters = append(oldTypeParameters, tp); + newTypeParameters = append(newTypeParameters, newTypeParameter); + result2.push(newTypeParameter); + } else { + result2.push(tp); + } + } + if (newTypeParameters) { + const mapper = createTypeMapper(oldTypeParameters, newTypeParameters); + for (const tp of newTypeParameters) { + tp.mapper = mapper; + } + } + return result2; + } + function hasTypeParameterByName(typeParameters, name2) { + return some2(typeParameters, (tp) => tp.symbol.escapedName === name2); + } + function getUniqueTypeParameterName(typeParameters, baseName) { + let len = baseName.length; + while (len > 1 && baseName.charCodeAt(len - 1) >= 48 && baseName.charCodeAt(len - 1) <= 57) + len--; + const s7 = baseName.slice(0, len); + for (let index4 = 1; true; index4++) { + const augmentedName = s7 + index4; + if (!hasTypeParameterByName(typeParameters, augmentedName)) { + return augmentedName; + } + } + } + function getReturnTypeOfSingleNonGenericCallSignature(funcType) { + const signature = getSingleCallSignature(funcType); + if (signature && !signature.typeParameters) { + return getReturnTypeOfSignature(signature); + } + } + function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) { + const funcType = checkExpression(expr.expression); + const nonOptionalType = getOptionalExpressionType(funcType, expr.expression); + const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType); + return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType); + } + function getTypeOfExpression(node) { + const quickType = getQuickTypeOfExpression(node); + if (quickType) { + return quickType; + } + if (node.flags & 268435456 && flowTypeCache) { + const cachedType = flowTypeCache[getNodeId(node)]; + if (cachedType) { + return cachedType; + } + } + const startInvocationCount = flowInvocationCount; + const type3 = checkExpression( + node, + 64 + /* TypeOnly */ + ); + if (flowInvocationCount !== startInvocationCount) { + const cache = flowTypeCache || (flowTypeCache = []); + cache[getNodeId(node)] = type3; + setNodeFlags( + node, + node.flags | 268435456 + /* TypeCached */ + ); + } + return type3; + } + function getQuickTypeOfExpression(node) { + let expr = skipParentheses( + node, + /*excludeJSDocTypeAssertions*/ + true + ); + if (isJSDocTypeAssertion(expr)) { + const type3 = getJSDocTypeAssertionType(expr); + if (!isConstTypeReference(type3)) { + return getTypeFromTypeNode(type3); + } + } + expr = skipParentheses(node); + if (isAwaitExpression(expr)) { + const type3 = getQuickTypeOfExpression(expr.expression); + return type3 ? getAwaitedType(type3) : void 0; + } + if (isCallExpression(expr) && expr.expression.kind !== 108 && !isRequireCall( + expr, + /*requireStringLiteralLikeArgument*/ + true + ) && !isSymbolOrSymbolForCall(expr)) { + return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression)); + } else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) { + return getTypeFromTypeNode(expr.type); + } else if (isLiteralExpression(node) || isBooleanLiteral(node)) { + return checkExpression(node); + } + return void 0; + } + function getContextFreeTypeOfExpression(node) { + const links = getNodeLinks(node); + if (links.contextFreeType) { + return links.contextFreeType; + } + pushContextualType( + node, + anyType2, + /*isCache*/ + false + ); + const type3 = links.contextFreeType = checkExpression( + node, + 4 + /* SkipContextSensitive */ + ); + popContextualType(); + return type3; + } + function checkExpression(node, checkMode, forceTuple) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + const saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + const uninstantiatedType = checkExpressionWorker(node, checkMode, forceTuple); + const type3 = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); + if (isConstEnumObjectType(type3)) { + checkConstEnumAccess(node, type3); + } + currentNode = saveCurrentNode; + (_b = tracing) == null ? void 0 : _b.pop(); + return type3; + } + function checkConstEnumAccess(node, type3) { + const ok2 = node.parent.kind === 211 && node.parent.expression === node || node.parent.kind === 212 && node.parent.expression === node || ((node.kind === 80 || node.kind === 166) && isInRightSideOfImportOrExportAssignment(node) || node.parent.kind === 186 && node.parent.exprName === node) || node.parent.kind === 281; + if (!ok2) { + error22(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); + } + if (getIsolatedModules(compilerOptions)) { + Debug.assert(!!(type3.symbol.flags & 128)); + const constEnumDeclaration = type3.symbol.valueDeclaration; + if (constEnumDeclaration.flags & 33554432 && !isValidTypeOnlyAliasUseSite(node)) { + error22(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName); + } + } + } + function checkParenthesizedExpression(node, checkMode) { + if (hasJSDocNodes(node)) { + if (isJSDocSatisfiesExpression(node)) { + return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode); + } + if (isJSDocTypeAssertion(node)) { + return checkAssertionWorker(node, checkMode); + } + } + return checkExpression(node.expression, checkMode); + } + function checkExpressionWorker(node, checkMode, forceTuple) { + const kind = node.kind; + if (cancellationToken) { + switch (kind) { + case 231: + case 218: + case 219: + cancellationToken.throwIfCancellationRequested(); + } + } + switch (kind) { + case 80: + return checkIdentifier(node, checkMode); + case 81: + return checkPrivateIdentifierExpression(node); + case 110: + return checkThisExpression(node); + case 108: + return checkSuperExpression(node); + case 106: + return nullWideningType; + case 15: + case 11: + return hasSkipDirectInferenceFlag(node) ? blockedStringType : getFreshTypeOfLiteralType(getStringLiteralType(node.text)); + case 9: + checkGrammarNumericLiteral(node); + return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text)); + case 10: + checkGrammarBigIntLiteral(node); + return getFreshTypeOfLiteralType(getBigIntLiteralType({ + negative: false, + base10Value: parsePseudoBigInt(node.text) + })); + case 112: + return trueType; + case 97: + return falseType; + case 228: + return checkTemplateExpression(node); + case 14: + return globalRegExpType; + case 209: + return checkArrayLiteral(node, checkMode, forceTuple); + case 210: + return checkObjectLiteral(node, checkMode); + case 211: + return checkPropertyAccessExpression(node, checkMode); + case 166: + return checkQualifiedName(node, checkMode); + case 212: + return checkIndexedAccess(node, checkMode); + case 213: + if (node.expression.kind === 102) { + return checkImportCallExpression(node); + } + case 214: + return checkCallExpression(node, checkMode); + case 215: + return checkTaggedTemplateExpression(node); + case 217: + return checkParenthesizedExpression(node, checkMode); + case 231: + return checkClassExpression(node); + case 218: + case 219: + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); + case 221: + return checkTypeOfExpression(node); + case 216: + case 234: + return checkAssertion(node, checkMode); + case 235: + return checkNonNullAssertion(node); + case 233: + return checkExpressionWithTypeArguments(node); + case 238: + return checkSatisfiesExpression(node); + case 236: + return checkMetaProperty(node); + case 220: + return checkDeleteExpression(node); + case 222: + return checkVoidExpression(node); + case 223: + return checkAwaitExpression(node); + case 224: + return checkPrefixUnaryExpression(node); + case 225: + return checkPostfixUnaryExpression(node); + case 226: + return checkBinaryExpression(node, checkMode); + case 227: + return checkConditionalExpression(node, checkMode); + case 230: + return checkSpreadExpression(node, checkMode); + case 232: + return undefinedWideningType; + case 229: + return checkYieldExpression(node); + case 237: + return checkSyntheticExpression(node); + case 294: + return checkJsxExpression(node, checkMode); + case 284: + return checkJsxElement(node, checkMode); + case 285: + return checkJsxSelfClosingElement(node, checkMode); + case 288: + return checkJsxFragment(node); + case 292: + return checkJsxAttributes(node, checkMode); + case 286: + Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); + } + return errorType; + } + function checkTypeParameter(node) { + checkGrammarModifiers(node); + if (node.expression) { + grammarErrorOnFirstToken(node.expression, Diagnostics.Type_expected); + } + checkSourceElement(node.constraint); + checkSourceElement(node.default); + const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); + getBaseConstraintOfType(typeParameter); + if (!hasNonCircularTypeParameterDefault(typeParameter)) { + error22(node.default, Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); + } + const constraintType = getConstraintOfTypeParameter(typeParameter); + const defaultType = getDefaultFromTypeParameter(typeParameter); + if (constraintType && defaultType) { + checkTypeAssignableTo(defaultType, getTypeWithThisArgument(instantiateType(constraintType, makeUnaryTypeMapper(typeParameter, defaultType)), defaultType), node.default, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + } + checkNodeDeferred(node); + addLazyDiagnostic(() => checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0)); + } + function checkTypeParameterDeferred(node) { + var _a2, _b; + if (isInterfaceDeclaration(node.parent) || isClassLike(node.parent) || isTypeAliasDeclaration(node.parent)) { + const typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node)); + const modifiers = getTypeParameterModifiers(typeParameter) & (8192 | 16384); + if (modifiers) { + const symbol = getSymbolOfDeclaration(node.parent); + if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 | 16 | 32))) { + error22(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types); + } else if (modifiers === 8192 || modifiers === 16384) { + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) }); + const source = createMarkerType(symbol, typeParameter, modifiers === 16384 ? markerSubTypeForCheck : markerSuperTypeForCheck); + const target = createMarkerType(symbol, typeParameter, modifiers === 16384 ? markerSuperTypeForCheck : markerSubTypeForCheck); + const saveVarianceTypeParameter = typeParameter; + varianceTypeParameter = typeParameter; + checkTypeAssignableTo(source, target, node, Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation); + varianceTypeParameter = saveVarianceTypeParameter; + (_b = tracing) == null ? void 0 : _b.pop(); + } + } + } + } + function checkParameter(node) { + checkGrammarModifiers(node); + checkVariableLikeDeclaration(node); + const func = getContainingFunction(node); + if (hasSyntacticModifier( + node, + 31 + /* ParameterPropertyModifier */ + )) { + if (!(func.kind === 176 && nodeIsPresent(func.body))) { + error22(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); + } + if (func.kind === 176 && isIdentifier(node.name) && node.name.escapedText === "constructor") { + error22(node.name, Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name); + } + } + if (!node.initializer && isOptionalDeclaration(node) && isBindingPattern(node.name) && func.body) { + error22(node, Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); + } + if (node.name && isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { + if (func.parameters.indexOf(node) !== 0) { + error22(node, Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); + } + if (func.kind === 176 || func.kind === 180 || func.kind === 185) { + error22(node, Diagnostics.A_constructor_cannot_have_a_this_parameter); + } + if (func.kind === 219) { + error22(node, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); + } + if (func.kind === 177 || func.kind === 178) { + error22(node, Diagnostics.get_and_set_accessors_cannot_declare_this_parameters); + } + } + if (node.dotDotDotToken && !isBindingPattern(node.name) && !isTypeAssignableTo(getReducedType(getTypeOfSymbol(node.symbol)), anyReadonlyArrayType)) { + error22(node, Diagnostics.A_rest_parameter_must_be_of_an_array_type); + } + } + function checkTypePredicate(node) { + const parent22 = getTypePredicateParent(node); + if (!parent22) { + error22(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + return; + } + const signature = getSignatureFromDeclaration(parent22); + const typePredicate = getTypePredicateOfSignature(signature); + if (!typePredicate) { + return; + } + checkSourceElement(node.type); + const { parameterName } = node; + if (typePredicate.kind === 0 || typePredicate.kind === 2) { + getTypeFromThisTypeNode(parameterName); + } else { + if (typePredicate.parameterIndex >= 0) { + if (signatureHasRestParameter(signature) && typePredicate.parameterIndex === signature.parameters.length - 1) { + error22(parameterName, Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); + } else { + if (typePredicate.type) { + const leadingError = () => chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type + ); + checkTypeAssignableTo( + typePredicate.type, + getTypeOfSymbol(signature.parameters[typePredicate.parameterIndex]), + node.type, + /*headMessage*/ + void 0, + leadingError + ); + } + } + } else if (parameterName) { + let hasReportedError = false; + for (const { name: name2 } of parent22.parameters) { + if (isBindingPattern(name2) && checkIfTypePredicateVariableIsDeclaredInBindingPattern(name2, parameterName, typePredicate.parameterName)) { + hasReportedError = true; + break; + } + } + if (!hasReportedError) { + error22(node.parameterName, Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); + } + } + } + } + function getTypePredicateParent(node) { + switch (node.parent.kind) { + case 219: + case 179: + case 262: + case 218: + case 184: + case 174: + case 173: + const parent22 = node.parent; + if (node === parent22.type) { + return parent22; + } + } + } + function checkIfTypePredicateVariableIsDeclaredInBindingPattern(pattern5, predicateVariableNode, predicateVariableName) { + for (const element of pattern5.elements) { + if (isOmittedExpression(element)) { + continue; + } + const name2 = element.name; + if (name2.kind === 80 && name2.escapedText === predicateVariableName) { + error22(predicateVariableNode, Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); + return true; + } else if (name2.kind === 207 || name2.kind === 206) { + if (checkIfTypePredicateVariableIsDeclaredInBindingPattern( + name2, + predicateVariableNode, + predicateVariableName + )) { + return true; + } + } + } + } + function checkSignatureDeclaration(node) { + if (node.kind === 181) { + checkGrammarIndexSignature(node); + } else if (node.kind === 184 || node.kind === 262 || node.kind === 185 || node.kind === 179 || node.kind === 176 || node.kind === 180) { + checkGrammarFunctionLikeDeclaration(node); + } + const functionFlags = getFunctionFlags(node); + if (!(functionFlags & 4)) { + if ((functionFlags & 3) === 3 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 6144 + /* AsyncGeneratorIncludes */ + ); + } + if ((functionFlags & 3) === 2 && languageVersion < 4) { + checkExternalEmitHelpers( + node, + 64 + /* Awaiter */ + ); + } + if ((functionFlags & 3) !== 0 && languageVersion < 2) { + checkExternalEmitHelpers( + node, + 128 + /* Generator */ + ); + } + } + checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); + checkUnmatchedJSDocParameters(node); + forEach4(node.parameters, checkParameter); + if (node.type) { + checkSourceElement(node.type); + } + addLazyDiagnostic(checkSignatureDeclarationDiagnostics); + function checkSignatureDeclarationDiagnostics() { + checkCollisionWithArgumentsInGeneratedCode(node); + let returnTypeNode = getEffectiveReturnTypeNode(node); + let returnTypeErrorLocation = returnTypeNode; + if (isInJSFile(node)) { + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression && isTypeReferenceNode(typeTag.typeExpression.type)) { + const signature = getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression)); + if (signature && signature.declaration) { + returnTypeNode = getEffectiveReturnTypeNode(signature.declaration); + returnTypeErrorLocation = typeTag.typeExpression.type; + } + } + } + if (noImplicitAny && !returnTypeNode) { + switch (node.kind) { + case 180: + error22(node, Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + case 179: + error22(node, Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); + break; + } + } + if (returnTypeNode && returnTypeErrorLocation) { + const functionFlags2 = getFunctionFlags(node); + if ((functionFlags2 & (4 | 1)) === 1) { + const returnType = getTypeFromTypeNode(returnTypeNode); + if (returnType === voidType2) { + error22(returnTypeErrorLocation, Diagnostics.A_generator_cannot_have_a_void_type_annotation); + } else { + checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags2, returnTypeErrorLocation); + } + } else if ((functionFlags2 & 3) === 2) { + checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation); + } + } + if (node.kind !== 181 && node.kind !== 324) { + registerForUnusedIdentifiersCheck(node); + } + } + } + function checkGeneratorInstantiationAssignabilityToReturnType(returnType, functionFlags, errorNode) { + const generatorYieldType = getIterationTypeOfGeneratorFunctionReturnType(0, returnType, (functionFlags & 2) !== 0) || anyType2; + const generatorReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, returnType, (functionFlags & 2) !== 0) || generatorYieldType; + const generatorNextType = getIterationTypeOfGeneratorFunctionReturnType(2, returnType, (functionFlags & 2) !== 0) || unknownType2; + const generatorInstantiation = createGeneratorReturnType(generatorYieldType, generatorReturnType, generatorNextType, !!(functionFlags & 2)); + return checkTypeAssignableTo(generatorInstantiation, returnType, errorNode); + } + function checkClassForDuplicateDeclarations(node) { + const instanceNames = /* @__PURE__ */ new Map(); + const staticNames = /* @__PURE__ */ new Map(); + const privateIdentifiers = /* @__PURE__ */ new Map(); + for (const member of node.members) { + if (member.kind === 176) { + for (const param of member.parameters) { + if (isParameterPropertyDeclaration(param, member) && !isBindingPattern(param.name)) { + addName( + instanceNames, + param.name, + param.name.escapedText, + 3 + /* GetOrSetAccessor */ + ); + } + } + } else { + const isStaticMember = isStatic(member); + const name2 = member.name; + if (!name2) { + continue; + } + const isPrivate = isPrivateIdentifier(name2); + const privateStaticFlags = isPrivate && isStaticMember ? 16 : 0; + const names = isPrivate ? privateIdentifiers : isStaticMember ? staticNames : instanceNames; + const memberName = name2 && getEffectivePropertyNameForPropertyNameNode(name2); + if (memberName) { + switch (member.kind) { + case 177: + addName(names, name2, memberName, 1 | privateStaticFlags); + break; + case 178: + addName(names, name2, memberName, 2 | privateStaticFlags); + break; + case 172: + addName(names, name2, memberName, 3 | privateStaticFlags); + break; + case 174: + addName(names, name2, memberName, 8 | privateStaticFlags); + break; + } + } + } + } + function addName(names, location2, name2, meaning) { + const prev = names.get(name2); + if (prev) { + if ((prev & 16) !== (meaning & 16)) { + error22(location2, Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, getTextOfNode(location2)); + } else { + const prevIsMethod = !!(prev & 8); + const isMethod = !!(meaning & 8); + if (prevIsMethod || isMethod) { + if (prevIsMethod !== isMethod) { + error22(location2, Diagnostics.Duplicate_identifier_0, getTextOfNode(location2)); + } + } else if (prev & meaning & ~16) { + error22(location2, Diagnostics.Duplicate_identifier_0, getTextOfNode(location2)); + } else { + names.set(name2, prev | meaning); + } + } + } else { + names.set(name2, meaning); + } + } + } + function checkClassForStaticPropertyNameConflicts(node) { + for (const member of node.members) { + const memberNameNode = member.name; + const isStaticMember = isStatic(member); + if (isStaticMember && memberNameNode) { + const memberName = getEffectivePropertyNameForPropertyNameNode(memberNameNode); + switch (memberName) { + case "name": + case "length": + case "caller": + case "arguments": + if (useDefineForClassFields) { + break; + } + case "prototype": + const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1; + const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node)); + error22(memberNameNode, message, memberName, className); + break; + } + } + } + } + function checkObjectTypeForDuplicateDeclarations(node) { + const names = /* @__PURE__ */ new Map(); + for (const member of node.members) { + if (member.kind === 171) { + let memberName; + const name2 = member.name; + switch (name2.kind) { + case 11: + case 9: + memberName = name2.text; + break; + case 80: + memberName = idText(name2); + break; + default: + continue; + } + if (names.get(memberName)) { + error22(getNameOfDeclaration(member.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName); + error22(member.name, Diagnostics.Duplicate_identifier_0, memberName); + } else { + names.set(memberName, true); + } + } + } + } + function checkTypeForDuplicateIndexSignatures(node) { + if (node.kind === 264) { + const nodeSymbol = getSymbolOfDeclaration(node); + if (nodeSymbol.declarations && nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { + return; + } + } + const indexSymbol = getIndexSymbol(getSymbolOfDeclaration(node)); + if (indexSymbol == null ? void 0 : indexSymbol.declarations) { + const indexSignatureMap = /* @__PURE__ */ new Map(); + for (const declaration of indexSymbol.declarations) { + if (declaration.parameters.length === 1 && declaration.parameters[0].type) { + forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type3) => { + const entry = indexSignatureMap.get(getTypeId(type3)); + if (entry) { + entry.declarations.push(declaration); + } else { + indexSignatureMap.set(getTypeId(type3), { type: type3, declarations: [declaration] }); + } + }); + } + } + indexSignatureMap.forEach((entry) => { + if (entry.declarations.length > 1) { + for (const declaration of entry.declarations) { + error22(declaration, Diagnostics.Duplicate_index_signature_for_type_0, typeToString(entry.type)); + } + } + }); + } + } + function checkPropertyDeclaration(node) { + if (!checkGrammarModifiers(node) && !checkGrammarProperty(node)) + checkGrammarComputedPropertyName(node.name); + checkVariableLikeDeclaration(node); + setNodeLinksForPrivateIdentifierScope(node); + if (hasSyntacticModifier( + node, + 64 + /* Abstract */ + ) && node.kind === 172 && node.initializer) { + error22(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name)); + } + } + function checkPropertySignature(node) { + if (isPrivateIdentifier(node.name)) { + error22(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + return checkPropertyDeclaration(node); + } + function checkMethodDeclaration(node) { + if (!checkGrammarMethod(node)) + checkGrammarComputedPropertyName(node.name); + if (isMethodDeclaration(node) && node.asteriskToken && isIdentifier(node.name) && idText(node.name) === "constructor") { + error22(node.name, Diagnostics.Class_constructor_may_not_be_a_generator); + } + checkFunctionOrMethodDeclaration(node); + if (hasSyntacticModifier( + node, + 64 + /* Abstract */ + ) && node.kind === 174 && node.body) { + error22(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); + } + if (isPrivateIdentifier(node.name) && !getContainingClass(node)) { + error22(node, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + setNodeLinksForPrivateIdentifierScope(node); + } + function setNodeLinksForPrivateIdentifierScope(node) { + if (isPrivateIdentifier(node.name) && languageVersion < 99) { + for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) { + getNodeLinks(lexicalScope).flags |= 1048576; + } + if (isClassExpression(node.parent)) { + const enclosingIterationStatement = getEnclosingIterationStatement(node.parent); + if (enclosingIterationStatement) { + getNodeLinks(node.name).flags |= 32768; + getNodeLinks(enclosingIterationStatement).flags |= 4096; + } + } + } + } + function checkClassStaticBlockDeclaration(node) { + checkGrammarModifiers(node); + forEachChild(node, checkSourceElement); + } + function checkConstructorDeclaration(node) { + checkSignatureDeclaration(node); + if (!checkGrammarConstructorTypeParameters(node)) + checkGrammarConstructorTypeAnnotation(node); + checkSourceElement(node.body); + const symbol = getSymbolOfDeclaration(node); + const firstDeclaration = getDeclarationOfKind(symbol, node.kind); + if (node === firstDeclaration) { + checkFunctionOrConstructorSymbol(symbol); + } + if (nodeIsMissing(node.body)) { + return; + } + addLazyDiagnostic(checkConstructorDeclarationDiagnostics); + return; + function isInstancePropertyWithInitializerOrPrivateIdentifierProperty(n7) { + if (isPrivateIdentifierClassElementDeclaration(n7)) { + return true; + } + return n7.kind === 172 && !isStatic(n7) && !!n7.initializer; + } + function checkConstructorDeclarationDiagnostics() { + const containingClassDecl = node.parent; + if (getClassExtendsHeritageElement(containingClassDecl)) { + captureLexicalThis(node.parent, containingClassDecl); + const classExtendsNull = classDeclarationExtendsNull(containingClassDecl); + const superCall = findFirstSuperCall(node.body); + if (superCall) { + if (classExtendsNull) { + error22(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null); + } + const superCallShouldBeRootLevel = !emitStandardClassFields && (some2(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some2(node.parameters, (p7) => hasSyntacticModifier( + p7, + 31 + /* ParameterPropertyModifier */ + ))); + if (superCallShouldBeRootLevel) { + if (!superCallIsRootLevelInConstructor(superCall, node.body)) { + error22(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers); + } else { + let superCallStatement; + for (const statement of node.body.statements) { + if (isExpressionStatement(statement) && isSuperCall(skipOuterExpressions(statement.expression))) { + superCallStatement = statement; + break; + } + if (nodeImmediatelyReferencesSuperOrThis(statement)) { + break; + } + } + if (superCallStatement === void 0) { + error22(node, Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers); + } + } + } + } else if (!classExtendsNull) { + error22(node, Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); + } + } + } + } + function superCallIsRootLevelInConstructor(superCall, body) { + const superCallParent = walkUpParenthesizedExpressions(superCall.parent); + return isExpressionStatement(superCallParent) && superCallParent.parent === body; + } + function nodeImmediatelyReferencesSuperOrThis(node) { + if (node.kind === 108 || node.kind === 110) { + return true; + } + if (isThisContainerOrFunctionBlock(node)) { + return false; + } + return !!forEachChild(node, nodeImmediatelyReferencesSuperOrThis); + } + function checkAccessorDeclaration(node) { + if (isIdentifier(node.name) && idText(node.name) === "constructor" && isClassLike(node.parent)) { + error22(node.name, Diagnostics.Class_constructor_may_not_be_an_accessor); + } + addLazyDiagnostic(checkAccessorDeclarationDiagnostics); + checkSourceElement(node.body); + setNodeLinksForPrivateIdentifierScope(node); + function checkAccessorDeclarationDiagnostics() { + if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node)) + checkGrammarComputedPropertyName(node.name); + checkDecorators(node); + checkSignatureDeclaration(node); + if (node.kind === 177) { + if (!(node.flags & 33554432) && nodeIsPresent(node.body) && node.flags & 512) { + if (!(node.flags & 1024)) { + error22(node.name, Diagnostics.A_get_accessor_must_return_a_value); + } + } + } + if (node.name.kind === 167) { + checkComputedPropertyName(node.name); + } + if (hasBindableName(node)) { + const symbol = getSymbolOfDeclaration(node); + const getter = getDeclarationOfKind( + symbol, + 177 + /* GetAccessor */ + ); + const setter = getDeclarationOfKind( + symbol, + 178 + /* SetAccessor */ + ); + if (getter && setter && !(getNodeCheckFlags(getter) & 1)) { + getNodeLinks(getter).flags |= 1; + const getterFlags = getEffectiveModifierFlags(getter); + const setterFlags = getEffectiveModifierFlags(setter); + if ((getterFlags & 64) !== (setterFlags & 64)) { + error22(getter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + error22(setter.name, Diagnostics.Accessors_must_both_be_abstract_or_non_abstract); + } + if (getterFlags & 4 && !(setterFlags & (4 | 2)) || getterFlags & 2 && !(setterFlags & 2)) { + error22(getter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + error22(setter.name, Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter); + } + } + } + const returnType = getTypeOfAccessors(getSymbolOfDeclaration(node)); + if (node.kind === 177) { + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); + } + } + } + function checkMissingDeclaration(node) { + checkDecorators(node); + } + function getEffectiveTypeArgumentAtIndex(node, typeParameters, index4) { + if (node.typeArguments && index4 < node.typeArguments.length) { + return getTypeFromTypeNode(node.typeArguments[index4]); + } + return getEffectiveTypeArguments2(node, typeParameters)[index4]; + } + function getEffectiveTypeArguments2(node, typeParameters) { + return fillMissingTypeArguments(map4(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { + let typeArguments; + let mapper; + let result2 = true; + for (let i7 = 0; i7 < typeParameters.length; i7++) { + const constraint = getConstraintOfTypeParameter(typeParameters[i7]); + if (constraint) { + if (!typeArguments) { + typeArguments = getEffectiveTypeArguments2(node, typeParameters); + mapper = createTypeMapper(typeParameters, typeArguments); + } + result2 = result2 && checkTypeAssignableTo( + typeArguments[i7], + instantiateType(constraint, mapper), + node.typeArguments[i7], + Diagnostics.Type_0_does_not_satisfy_the_constraint_1 + ); + } + } + return result2; + } + function getTypeParametersForTypeAndSymbol(type3, symbol) { + if (!isErrorType(type3)) { + return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters || (getObjectFlags(type3) & 4 ? type3.target.localTypeParameters : void 0); + } + return void 0; + } + function getTypeParametersForTypeReferenceOrImport(node) { + const type3 = getTypeFromTypeNode(node); + if (!isErrorType(type3)) { + const symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return getTypeParametersForTypeAndSymbol(type3, symbol); + } + } + return void 0; + } + function checkTypeReferenceNode(node) { + checkGrammarTypeArguments(node, node.typeArguments); + if (node.kind === 183 && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) { + const sourceFile = getSourceFileOfNode(node); + if (scanTokenAtPosition(sourceFile, node.typeName.end) === 25) { + grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } + } + forEach4(node.typeArguments, checkSourceElement); + checkTypeReferenceOrImport(node); + } + function checkTypeReferenceOrImport(node) { + const type3 = getTypeFromTypeNode(node); + if (!isErrorType(type3)) { + if (node.typeArguments) { + addLazyDiagnostic(() => { + const typeParameters = getTypeParametersForTypeReferenceOrImport(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); + } + }); + } + const symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + if (some2(symbol.declarations, (d7) => isTypeDeclaration(d7) && !!(d7.flags & 536870912))) { + addDeprecatedSuggestion( + getDeprecatedSuggestionNode(node), + symbol.declarations, + symbol.escapedName + ); + } + } + } + } + function getTypeArgumentConstraint(node) { + const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); + if (!typeReferenceNode) + return void 0; + const typeParameters = getTypeParametersForTypeReferenceOrImport(typeReferenceNode); + if (!typeParameters) + return void 0; + const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments2(typeReferenceNode, typeParameters))); + } + function checkTypeQuery(node) { + getTypeFromTypeQueryNode(node); + } + function checkTypeLiteral(node) { + forEach4(node.members, checkSourceElement); + addLazyDiagnostic(checkTypeLiteralDiagnostics); + function checkTypeLiteralDiagnostics() { + const type3 = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + checkIndexConstraints(type3, type3.symbol); + checkTypeForDuplicateIndexSignatures(node); + checkObjectTypeForDuplicateDeclarations(node); + } + } + function checkArrayType(node) { + checkSourceElement(node.elementType); + } + function checkTupleType(node) { + let seenOptionalElement = false; + let seenRestElement = false; + for (const e10 of node.elements) { + let flags = getTupleElementFlags(e10); + if (flags & 8) { + const type3 = getTypeFromTypeNode(e10.type); + if (!isArrayLikeType(type3)) { + error22(e10, Diagnostics.A_rest_element_type_must_be_an_array_type); + break; + } + if (isArrayType(type3) || isTupleType(type3) && type3.target.combinedFlags & 4) { + flags |= 4; + } + } + if (flags & 4) { + if (seenRestElement) { + grammarErrorOnNode(e10, Diagnostics.A_rest_element_cannot_follow_another_rest_element); + break; + } + seenRestElement = true; + } else if (flags & 2) { + if (seenRestElement) { + grammarErrorOnNode(e10, Diagnostics.An_optional_element_cannot_follow_a_rest_element); + break; + } + seenOptionalElement = true; + } else if (flags & 1 && seenOptionalElement) { + grammarErrorOnNode(e10, Diagnostics.A_required_element_cannot_follow_an_optional_element); + break; + } + } + forEach4(node.elements, checkSourceElement); + getTypeFromTypeNode(node); + } + function checkUnionOrIntersectionType(node) { + forEach4(node.types, checkSourceElement); + getTypeFromTypeNode(node); + } + function checkIndexedAccessIndexType(type3, accessNode) { + if (!(type3.flags & 8388608)) { + return type3; + } + const objectType2 = type3.objectType; + const indexType = type3.indexType; + const objectIndexType = isGenericMappedType(objectType2) && getMappedTypeNameTypeKind(objectType2) === 2 ? getIndexTypeForMappedType( + objectType2, + 0 + /* None */ + ) : getIndexType( + objectType2, + 0 + /* None */ + ); + const hasNumberIndexInfo = !!getIndexInfoOfType(objectType2, numberType2); + if (everyType(indexType, (t8) => isTypeAssignableTo(t8, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t8, numberType2))) { + if (accessNode.kind === 212 && isAssignmentTarget(accessNode) && getObjectFlags(objectType2) & 32 && getMappedTypeModifiers(objectType2) & 1) { + error22(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType2)); + } + return type3; + } + if (isGenericObjectType(objectType2)) { + const propertyName = getPropertyNameFromIndex(indexType, accessNode); + if (propertyName) { + const propertySymbol = forEachType(getApparentType(objectType2), (t8) => getPropertyOfType(t8, propertyName)); + if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6) { + error22(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName)); + return errorType; + } + } + } + error22(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType2)); + return errorType; + } + function checkIndexedAccessType(node) { + checkSourceElement(node.objectType); + checkSourceElement(node.indexType); + checkIndexedAccessIndexType(getTypeFromIndexedAccessTypeNode(node), node); + } + function checkMappedType(node) { + checkGrammarMappedType(node); + checkSourceElement(node.typeParameter); + checkSourceElement(node.nameType); + checkSourceElement(node.type); + if (!node.type) { + reportImplicitAny(node, anyType2); + } + const type3 = getTypeFromMappedTypeNode(node); + const nameType = getNameTypeFromMappedType(type3); + if (nameType) { + checkTypeAssignableTo(nameType, keyofConstraintType, node.nameType); + } else { + const constraintType = getConstraintTypeFromMappedType(type3); + checkTypeAssignableTo(constraintType, keyofConstraintType, getEffectiveConstraintOfTypeParameter(node.typeParameter)); + } + } + function checkGrammarMappedType(node) { + var _a2; + if ((_a2 = node.members) == null ? void 0 : _a2.length) { + return grammarErrorOnNode(node.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); + } + } + function checkThisType(node) { + getTypeFromThisTypeNode(node); + } + function checkTypeOperator(node) { + checkGrammarTypeOperatorNode(node); + checkSourceElement(node.type); + } + function checkConditionalType(node) { + forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!findAncestor(node, (n7) => n7.parent && n7.parent.kind === 194 && n7.parent.extendsType === n7)) { + grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + const symbol = getSymbolOfDeclaration(node.typeParameter); + if (symbol.declarations && symbol.declarations.length > 1) { + const links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + const typeParameter = getDeclaredTypeOfTypeParameter(symbol); + const declarations = getDeclarationsOfKind( + symbol, + 168 + /* TypeParameter */ + ); + if (!areTypeParametersIdentical(declarations, [typeParameter], (decl) => [decl])) { + const name2 = symbolToString2(symbol); + for (const declaration of declarations) { + error22(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_constraints, name2); + } + } + } + } + registerForUnusedIdentifiersCheck(node); + } + function checkTemplateLiteralType(node) { + for (const span of node.templateSpans) { + checkSourceElement(span.type); + const type3 = getTypeFromTypeNode(span.type); + checkTypeAssignableTo(type3, templateConstraintType, span.type); + } + getTypeFromTypeNode(node); + } + function checkImportType(node) { + checkSourceElement(node.argument); + if (node.attributes) { + getResolutionModeOverride(node.attributes, grammarErrorOnNode); + } + checkTypeReferenceOrImport(node); + } + function checkNamedTupleMember(node) { + if (node.dotDotDotToken && node.questionToken) { + grammarErrorOnNode(node, Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest); + } + if (node.type.kind === 190) { + grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type); + } + if (node.type.kind === 191) { + grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type); + } + checkSourceElement(node.type); + getTypeFromTypeNode(node); + } + function isPrivateWithinAmbient(node) { + return (hasEffectiveModifier( + node, + 2 + /* Private */ + ) || isPrivateIdentifierClassElementDeclaration(node)) && !!(node.flags & 33554432); + } + function getEffectiveDeclarationFlags(n7, flagsToCheck) { + let flags = getCombinedModifierFlagsCached(n7); + if (n7.parent.kind !== 264 && n7.parent.kind !== 263 && n7.parent.kind !== 231 && n7.flags & 33554432) { + const container = getEnclosingContainer(n7); + if (container && container.flags & 128 && !(flags & 128) && !(isModuleBlock(n7.parent) && isModuleDeclaration(n7.parent.parent) && isGlobalScopeAugmentation(n7.parent.parent))) { + flags |= 32; + } + flags |= 128; + } + return flags & flagsToCheck; + } + function checkFunctionOrConstructorSymbol(symbol) { + addLazyDiagnostic(() => checkFunctionOrConstructorSymbolWorker(symbol)); + } + function checkFunctionOrConstructorSymbolWorker(symbol) { + function getCanonicalOverload(overloads, implementation) { + const implementationSharesContainerWithFirstOverload = implementation !== void 0 && implementation.parent === overloads[0].parent; + return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; + } + function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck2, someOverloadFlags, allOverloadFlags) { + const someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; + if (someButNotAllOverloadFlags !== 0) { + const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2); + forEach4(overloads, (o7) => { + const deviation = getEffectiveDeclarationFlags(o7, flagsToCheck2) ^ canonicalFlags; + if (deviation & 32) { + error22(getNameOfDeclaration(o7), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported); + } else if (deviation & 128) { + error22(getNameOfDeclaration(o7), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); + } else if (deviation & (2 | 4)) { + error22(getNameOfDeclaration(o7) || o7, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); + } else if (deviation & 64) { + error22(getNameOfDeclaration(o7), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract); + } + }); + } + } + function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken2, allHaveQuestionToken2) { + if (someHaveQuestionToken2 !== allHaveQuestionToken2) { + const canonicalHasQuestionToken = hasQuestionToken(getCanonicalOverload(overloads, implementation)); + forEach4(overloads, (o7) => { + const deviation = hasQuestionToken(o7) !== canonicalHasQuestionToken; + if (deviation) { + error22(getNameOfDeclaration(o7), Diagnostics.Overload_signatures_must_all_be_optional_or_required); + } + }); + } + } + const flagsToCheck = 32 | 128 | 2 | 4 | 64; + let someNodeFlags = 0; + let allNodeFlags = flagsToCheck; + let someHaveQuestionToken = false; + let allHaveQuestionToken = true; + let hasOverloads = false; + let bodyDeclaration; + let lastSeenNonAmbientDeclaration; + let previousDeclaration; + const declarations = symbol.declarations; + const isConstructor = (symbol.flags & 16384) !== 0; + function reportImplementationExpectedError(node) { + if (node.name && nodeIsMissing(node.name)) { + return; + } + let seen = false; + const subsequentNode = forEachChild(node.parent, (c7) => { + if (seen) { + return c7; + } else { + seen = c7 === node; + } + }); + if (subsequentNode && subsequentNode.pos === node.end) { + if (subsequentNode.kind === node.kind) { + const errorNode2 = subsequentNode.name || subsequentNode; + const subsequentName = subsequentNode.name; + if (node.name && subsequentName && // both are private identifiers + (isPrivateIdentifier(node.name) && isPrivateIdentifier(subsequentName) && node.name.escapedText === subsequentName.escapedText || // Both are computed property names + isComputedPropertyName(node.name) && isComputedPropertyName(subsequentName) && isTypeIdenticalTo(checkComputedPropertyName(node.name), checkComputedPropertyName(subsequentName)) || // Both are literal property names that are the same. + isPropertyNameLiteral(node.name) && isPropertyNameLiteral(subsequentName) && getEscapedTextOfIdentifierOrLiteral(node.name) === getEscapedTextOfIdentifierOrLiteral(subsequentName))) { + const reportError = (node.kind === 174 || node.kind === 173) && isStatic(node) !== isStatic(subsequentNode); + if (reportError) { + const diagnostic = isStatic(node) ? Diagnostics.Function_overload_must_be_static : Diagnostics.Function_overload_must_not_be_static; + error22(errorNode2, diagnostic); + } + return; + } + if (nodeIsPresent(subsequentNode.body)) { + error22(errorNode2, Diagnostics.Function_implementation_name_must_be_0, declarationNameToString(node.name)); + return; + } + } + } + const errorNode = node.name || node; + if (isConstructor) { + error22(errorNode, Diagnostics.Constructor_implementation_is_missing); + } else { + if (hasSyntacticModifier( + node, + 64 + /* Abstract */ + )) { + error22(errorNode, Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive); + } else { + error22(errorNode, Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); + } + } + } + let duplicateFunctionDeclaration = false; + let multipleConstructorImplementation = false; + let hasNonAmbientClass = false; + const functionDeclarations = []; + if (declarations) { + for (const current of declarations) { + const node = current; + const inAmbientContext = node.flags & 33554432; + const inAmbientContextOrInterface = node.parent && (node.parent.kind === 264 || node.parent.kind === 187) || inAmbientContext; + if (inAmbientContextOrInterface) { + previousDeclaration = void 0; + } + if ((node.kind === 263 || node.kind === 231) && !inAmbientContext) { + hasNonAmbientClass = true; + } + if (node.kind === 262 || node.kind === 174 || node.kind === 173 || node.kind === 176) { + functionDeclarations.push(node); + const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); + someNodeFlags |= currentNodeFlags; + allNodeFlags &= currentNodeFlags; + someHaveQuestionToken = someHaveQuestionToken || hasQuestionToken(node); + allHaveQuestionToken = allHaveQuestionToken && hasQuestionToken(node); + const bodyIsPresent = nodeIsPresent(node.body); + if (bodyIsPresent && bodyDeclaration) { + if (isConstructor) { + multipleConstructorImplementation = true; + } else { + duplicateFunctionDeclaration = true; + } + } else if ((previousDeclaration == null ? void 0 : previousDeclaration.parent) === node.parent && previousDeclaration.end !== node.pos) { + reportImplementationExpectedError(previousDeclaration); + } + if (bodyIsPresent) { + if (!bodyDeclaration) { + bodyDeclaration = node; + } + } else { + hasOverloads = true; + } + previousDeclaration = node; + if (!inAmbientContextOrInterface) { + lastSeenNonAmbientDeclaration = node; + } + } + if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) { + hasOverloads = length(getJSDocOverloadTags(current)) > 0; + } + } + } + if (multipleConstructorImplementation) { + forEach4(functionDeclarations, (declaration) => { + error22(declaration, Diagnostics.Multiple_constructor_implementations_are_not_allowed); + }); + } + if (duplicateFunctionDeclaration) { + forEach4(functionDeclarations, (declaration) => { + error22(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_function_implementation); + }); + } + if (hasNonAmbientClass && !isConstructor && symbol.flags & 16 && declarations) { + const relatedDiagnostics = filter2( + declarations, + (d7) => d7.kind === 263 + /* ClassDeclaration */ + ).map((d7) => createDiagnosticForNode(d7, Diagnostics.Consider_adding_a_declare_modifier_to_this_class)); + forEach4(declarations, (declaration) => { + const diagnostic = declaration.kind === 263 ? Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 : declaration.kind === 262 ? Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient : void 0; + if (diagnostic) { + addRelatedInfo( + error22(getNameOfDeclaration(declaration) || declaration, diagnostic, symbolName(symbol)), + ...relatedDiagnostics + ); + } + }); + } + if (lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body && !hasSyntacticModifier( + lastSeenNonAmbientDeclaration, + 64 + /* Abstract */ + ) && !lastSeenNonAmbientDeclaration.questionToken) { + reportImplementationExpectedError(lastSeenNonAmbientDeclaration); + } + if (hasOverloads) { + if (declarations) { + checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); + checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken); + } + if (bodyDeclaration) { + const signatures = getSignaturesOfSymbol(symbol); + const bodySignature = getSignatureFromDeclaration(bodyDeclaration); + for (const signature of signatures) { + if (!isImplementationCompatibleWithOverload(bodySignature, signature)) { + const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration; + addRelatedInfo( + error22(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature), + createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here) + ); + break; + } + } + } + } + } + function checkExportsOnMergedDeclarations(node) { + addLazyDiagnostic(() => checkExportsOnMergedDeclarationsWorker(node)); + } + function checkExportsOnMergedDeclarationsWorker(node) { + let symbol = node.localSymbol; + if (!symbol) { + symbol = getSymbolOfDeclaration(node); + if (!symbol.exportSymbol) { + return; + } + } + if (getDeclarationOfKind(symbol, node.kind) !== node) { + return; + } + let exportedDeclarationSpaces = 0; + let nonExportedDeclarationSpaces = 0; + let defaultExportedDeclarationSpaces = 0; + for (const d7 of symbol.declarations) { + const declarationSpaces = getDeclarationSpaces(d7); + const effectiveDeclarationFlags = getEffectiveDeclarationFlags( + d7, + 32 | 2048 + /* Default */ + ); + if (effectiveDeclarationFlags & 32) { + if (effectiveDeclarationFlags & 2048) { + defaultExportedDeclarationSpaces |= declarationSpaces; + } else { + exportedDeclarationSpaces |= declarationSpaces; + } + } else { + nonExportedDeclarationSpaces |= declarationSpaces; + } + } + const nonDefaultExportedDeclarationSpaces = exportedDeclarationSpaces | nonExportedDeclarationSpaces; + const commonDeclarationSpacesForExportsAndLocals = exportedDeclarationSpaces & nonExportedDeclarationSpaces; + const commonDeclarationSpacesForDefaultAndNonDefault = defaultExportedDeclarationSpaces & nonDefaultExportedDeclarationSpaces; + if (commonDeclarationSpacesForExportsAndLocals || commonDeclarationSpacesForDefaultAndNonDefault) { + for (const d7 of symbol.declarations) { + const declarationSpaces = getDeclarationSpaces(d7); + const name2 = getNameOfDeclaration(d7); + if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) { + error22(name2, Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, declarationNameToString(name2)); + } else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) { + error22(name2, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(name2)); + } + } + } + function getDeclarationSpaces(decl) { + let d7 = decl; + switch (d7.kind) { + case 264: + case 265: + case 353: + case 345: + case 347: + return 2; + case 267: + return isAmbientModule(d7) || getModuleInstanceState(d7) !== 0 ? 4 | 1 : 4; + case 263: + case 266: + case 306: + return 2 | 1; + case 312: + return 2 | 1 | 4; + case 277: + case 226: + const node2 = d7; + const expression = isExportAssignment(node2) ? node2.expression : node2.right; + if (!isEntityNameExpression(expression)) { + return 1; + } + d7 = expression; + case 271: + case 274: + case 273: + let result2 = 0; + const target = resolveAlias(getSymbolOfDeclaration(d7)); + forEach4(target.declarations, (d22) => { + result2 |= getDeclarationSpaces(d22); + }); + return result2; + case 260: + case 208: + case 262: + case 276: + case 80: + return 1; + case 173: + case 171: + return 2; + default: + return Debug.failBadSyntaxKind(d7); + } + } + } + function getAwaitedTypeOfPromise(type3, errorNode, diagnosticMessage, ...args) { + const promisedType = getPromisedTypeOfPromise(type3, errorNode); + return promisedType && getAwaitedType(promisedType, errorNode, diagnosticMessage, ...args); + } + function getPromisedTypeOfPromise(type3, errorNode, thisTypeForErrorOut) { + if (isTypeAny(type3)) { + return void 0; + } + const typeAsPromise = type3; + if (typeAsPromise.promisedTypeOfPromise) { + return typeAsPromise.promisedTypeOfPromise; + } + if (isReferenceToType2(type3, getGlobalPromiseType( + /*reportErrors*/ + false + ))) { + return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type3)[0]; + } + if (allTypesAssignableToKind( + getBaseConstraintOrType(type3), + 402784252 | 131072 + /* Never */ + )) { + return void 0; + } + const thenFunction = getTypeOfPropertyOfType(type3, "then"); + if (isTypeAny(thenFunction)) { + return void 0; + } + const thenSignatures = thenFunction ? getSignaturesOfType( + thenFunction, + 0 + /* Call */ + ) : emptyArray; + if (thenSignatures.length === 0) { + if (errorNode) { + error22(errorNode, Diagnostics.A_promise_must_have_a_then_method); + } + return void 0; + } + let thisTypeForError; + let candidates; + for (const thenSignature of thenSignatures) { + const thisType = getThisTypeOfSignature(thenSignature); + if (thisType && thisType !== voidType2 && !isTypeRelatedTo(type3, thisType, subtypeRelation)) { + thisTypeForError = thisType; + } else { + candidates = append(candidates, thenSignature); + } + } + if (!candidates) { + Debug.assertIsDefined(thisTypeForError); + if (thisTypeForErrorOut) { + thisTypeForErrorOut.value = thisTypeForError; + } + if (errorNode) { + error22(errorNode, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type3), typeToString(thisTypeForError)); + } + return void 0; + } + const onfulfilledParameterType = getTypeWithFacts( + getUnionType(map4(candidates, getTypeOfFirstParameterOfSignature)), + 2097152 + /* NEUndefinedOrNull */ + ); + if (isTypeAny(onfulfilledParameterType)) { + return void 0; + } + const onfulfilledParameterSignatures = getSignaturesOfType( + onfulfilledParameterType, + 0 + /* Call */ + ); + if (onfulfilledParameterSignatures.length === 0) { + if (errorNode) { + error22(errorNode, Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback); + } + return void 0; + } + return typeAsPromise.promisedTypeOfPromise = getUnionType( + map4(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), + 2 + /* Subtype */ + ); + } + function checkAwaitedType(type3, withAlias, errorNode, diagnosticMessage, ...args) { + const awaitedType = withAlias ? getAwaitedType(type3, errorNode, diagnosticMessage, ...args) : getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, ...args); + return awaitedType || errorType; + } + function isThenableType(type3) { + if (allTypesAssignableToKind( + getBaseConstraintOrType(type3), + 402784252 | 131072 + /* Never */ + )) { + return false; + } + const thenFunction = getTypeOfPropertyOfType(type3, "then"); + return !!thenFunction && getSignaturesOfType( + getTypeWithFacts( + thenFunction, + 2097152 + /* NEUndefinedOrNull */ + ), + 0 + /* Call */ + ).length > 0; + } + function isAwaitedTypeInstantiation(type3) { + var _a2; + if (type3.flags & 16777216) { + const awaitedSymbol = getGlobalAwaitedSymbol( + /*reportErrors*/ + false + ); + return !!awaitedSymbol && type3.aliasSymbol === awaitedSymbol && ((_a2 = type3.aliasTypeArguments) == null ? void 0 : _a2.length) === 1; + } + return false; + } + function unwrapAwaitedType(type3) { + return type3.flags & 1048576 ? mapType2(type3, unwrapAwaitedType) : isAwaitedTypeInstantiation(type3) ? type3.aliasTypeArguments[0] : type3; + } + function isAwaitedTypeNeeded(type3) { + if (isTypeAny(type3) || isAwaitedTypeInstantiation(type3)) { + return false; + } + if (isGenericObjectType(type3)) { + const baseConstraint = getBaseConstraintOfType(type3); + if (baseConstraint ? baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) : maybeTypeOfKind( + type3, + 8650752 + /* TypeVariable */ + )) { + return true; + } + } + return false; + } + function tryCreateAwaitedType(type3) { + const awaitedSymbol = getGlobalAwaitedSymbol( + /*reportErrors*/ + true + ); + if (awaitedSymbol) { + return getTypeAliasInstantiation(awaitedSymbol, [unwrapAwaitedType(type3)]); + } + return void 0; + } + function createAwaitedTypeIfNeeded(type3) { + if (isAwaitedTypeNeeded(type3)) { + const awaitedType = tryCreateAwaitedType(type3); + if (awaitedType) { + return awaitedType; + } + } + Debug.assert(isAwaitedTypeInstantiation(type3) || getPromisedTypeOfPromise(type3) === void 0, "type provided should not be a non-generic 'promise'-like."); + return type3; + } + function getAwaitedType(type3, errorNode, diagnosticMessage, ...args) { + const awaitedType = getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, ...args); + return awaitedType && createAwaitedTypeIfNeeded(awaitedType); + } + function getAwaitedTypeNoAlias(type3, errorNode, diagnosticMessage, ...args) { + if (isTypeAny(type3)) { + return type3; + } + if (isAwaitedTypeInstantiation(type3)) { + return type3; + } + const typeAsAwaitable = type3; + if (typeAsAwaitable.awaitedTypeOfType) { + return typeAsAwaitable.awaitedTypeOfType; + } + if (type3.flags & 1048576) { + if (awaitedTypeStack.lastIndexOf(type3.id) >= 0) { + if (errorNode) { + error22(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return void 0; + } + const mapper = errorNode ? (constituentType) => getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, ...args) : getAwaitedTypeNoAlias; + awaitedTypeStack.push(type3.id); + const mapped = mapType2(type3, mapper); + awaitedTypeStack.pop(); + return typeAsAwaitable.awaitedTypeOfType = mapped; + } + if (isAwaitedTypeNeeded(type3)) { + return typeAsAwaitable.awaitedTypeOfType = type3; + } + const thisTypeForErrorOut = { value: void 0 }; + const promisedType = getPromisedTypeOfPromise( + type3, + /*errorNode*/ + void 0, + thisTypeForErrorOut + ); + if (promisedType) { + if (type3.id === promisedType.id || awaitedTypeStack.lastIndexOf(promisedType.id) >= 0) { + if (errorNode) { + error22(errorNode, Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); + } + return void 0; + } + awaitedTypeStack.push(type3.id); + const awaitedType = getAwaitedTypeNoAlias(promisedType, errorNode, diagnosticMessage, ...args); + awaitedTypeStack.pop(); + if (!awaitedType) { + return void 0; + } + return typeAsAwaitable.awaitedTypeOfType = awaitedType; + } + if (isThenableType(type3)) { + if (errorNode) { + Debug.assertIsDefined(diagnosticMessage); + let chain3; + if (thisTypeForErrorOut.value) { + chain3 = chainDiagnosticMessages(chain3, Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1, typeToString(type3), typeToString(thisTypeForErrorOut.value)); + } + chain3 = chainDiagnosticMessages(chain3, diagnosticMessage, ...args); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(errorNode), errorNode, chain3)); + } + return void 0; + } + return typeAsAwaitable.awaitedTypeOfType = type3; + } + function checkAsyncFunctionReturnType(node, returnTypeNode, returnTypeErrorLocation) { + const returnType = getTypeFromTypeNode(returnTypeNode); + if (languageVersion >= 2) { + if (isErrorType(returnType)) { + return; + } + const globalPromiseType = getGlobalPromiseType( + /*reportErrors*/ + true + ); + if (globalPromiseType !== emptyGenericType && !isReferenceToType2(returnType, globalPromiseType)) { + reportErrorForInvalidReturnType(Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, returnTypeNode, returnTypeErrorLocation, typeToString(getAwaitedTypeNoAlias(returnType) || voidType2)); + return; + } + } else { + markTypeNodeAsReferenced(returnTypeNode); + if (isErrorType(returnType)) { + return; + } + const promiseConstructorName = getEntityNameFromTypeNode(returnTypeNode); + if (promiseConstructorName === void 0) { + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, typeToString(returnType)); + return; + } + const promiseConstructorSymbol = resolveEntityName( + promiseConstructorName, + 111551, + /*ignoreErrors*/ + true + ); + const promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType; + if (isErrorType(promiseConstructorType)) { + if (promiseConstructorName.kind === 80 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType( + /*reportErrors*/ + false + )) { + error22(returnTypeErrorLocation, Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option); + } else { + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); + } + return; + } + const globalPromiseConstructorLikeType = getGlobalPromiseConstructorLikeType( + /*reportErrors*/ + true + ); + if (globalPromiseConstructorLikeType === emptyObjectType) { + reportErrorForInvalidReturnType(Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, returnTypeNode, returnTypeErrorLocation, entityNameToString(promiseConstructorName)); + return; + } + const headMessage = Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value; + const errorInfo = () => returnTypeNode === returnTypeErrorLocation ? void 0 : chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type + ); + if (!checkTypeAssignableTo(promiseConstructorType, globalPromiseConstructorLikeType, returnTypeErrorLocation, headMessage, errorInfo)) { + return; + } + const rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName); + const collidingSymbol = getSymbol2( + node.locals, + rootName.escapedText, + 111551 + /* Value */ + ); + if (collidingSymbol) { + error22(collidingSymbol.valueDeclaration, Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, idText(rootName), entityNameToString(promiseConstructorName)); + return; + } + } + checkAwaitedType( + returnType, + /*withAlias*/ + false, + node, + Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ); + function reportErrorForInvalidReturnType(message, returnTypeNode2, returnTypeErrorLocation2, typeName) { + if (returnTypeNode2 === returnTypeErrorLocation2) { + error22(returnTypeErrorLocation2, message, typeName); + } else { + const diag2 = error22(returnTypeErrorLocation2, Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type); + addRelatedInfo(diag2, createDiagnosticForNode(returnTypeNode2, message, typeName)); + } + } + } + function checkDecorator(node) { + const signature = getResolvedSignature(node); + checkDeprecatedSignature(signature, node); + const returnType = getReturnTypeOfSignature(signature); + if (returnType.flags & 1) { + return; + } + const decoratorSignature = getDecoratorCallSignature(node); + if (!(decoratorSignature == null ? void 0 : decoratorSignature.resolvedReturnType)) + return; + let headMessage; + const expectedReturnType = decoratorSignature.resolvedReturnType; + switch (node.parent.kind) { + case 263: + case 231: + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + case 172: + if (!legacyDecorators) { + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + } + case 169: + headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any; + break; + case 174: + case 177: + case 178: + headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1; + break; + default: + return Debug.failBadSyntaxKind(node.parent); + } + checkTypeAssignableTo(returnType, expectedReturnType, node.expression, headMessage); + } + function createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount = parameters.length, flags = 0) { + const decl = factory.createFunctionTypeNode( + /*typeParameters*/ + void 0, + emptyArray, + factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ); + return createSignature(decl, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + } + function createFunctionType(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags) { + const signature = createCallSignature(typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, flags); + return getOrCreateTypeFromSignature(signature); + } + function createGetterFunctionType(type3) { + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + emptyArray, + type3 + ); + } + function createSetterFunctionType(type3) { + const valueParam = createParameter2("value", type3); + return createFunctionType( + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + [valueParam], + voidType2 + ); + } + function markTypeNodeAsReferenced(node) { + markEntityNameOrEntityExpressionAsReference( + node && getEntityNameFromTypeNode(node), + /*forDecoratorMetadata*/ + false + ); + } + function markEntityNameOrEntityExpressionAsReference(typeName, forDecoratorMetadata) { + if (!typeName) + return; + const rootName = getFirstIdentifier(typeName); + const meaning = (typeName.kind === 80 ? 788968 : 1920) | 2097152; + const rootSymbol = resolveName( + rootName, + rootName.escapedText, + meaning, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (rootSymbol && rootSymbol.flags & 2097152) { + if (canCollectSymbolAliasAccessabilityData && symbolIsValue(rootSymbol) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol)) && !getTypeOnlyAliasDeclaration(rootSymbol)) { + markAliasSymbolAsReferenced(rootSymbol); + } else if (forDecoratorMetadata && getIsolatedModules(compilerOptions) && getEmitModuleKind(compilerOptions) >= 5 && !symbolIsValue(rootSymbol) && !some2(rootSymbol.declarations, isTypeOnlyImportOrExportDeclaration)) { + const diag2 = error22(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled); + const aliasDeclaration = find2(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2); + if (aliasDeclaration) { + addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here, idText(rootName))); + } + } + } + } + function markDecoratorMedataDataTypeNodeAsReferenced(node) { + const entityName = getEntityNameForDecoratorMetadata(node); + if (entityName && isEntityName(entityName)) { + markEntityNameOrEntityExpressionAsReference( + entityName, + /*forDecoratorMetadata*/ + true + ); + } + } + function getEntityNameForDecoratorMetadata(node) { + if (node) { + switch (node.kind) { + case 193: + case 192: + return getEntityNameForDecoratorMetadataFromTypeList(node.types); + case 194: + return getEntityNameForDecoratorMetadataFromTypeList([node.trueType, node.falseType]); + case 196: + case 202: + return getEntityNameForDecoratorMetadata(node.type); + case 183: + return node.typeName; + } + } + } + function getEntityNameForDecoratorMetadataFromTypeList(types3) { + let commonEntityName; + for (let typeNode of types3) { + while (typeNode.kind === 196 || typeNode.kind === 202) { + typeNode = typeNode.type; + } + if (typeNode.kind === 146) { + continue; + } + if (!strictNullChecks && (typeNode.kind === 201 && typeNode.literal.kind === 106 || typeNode.kind === 157)) { + continue; + } + const individualEntityName = getEntityNameForDecoratorMetadata(typeNode); + if (!individualEntityName) { + return void 0; + } + if (commonEntityName) { + if (!isIdentifier(commonEntityName) || !isIdentifier(individualEntityName) || commonEntityName.escapedText !== individualEntityName.escapedText) { + return void 0; + } + } else { + commonEntityName = individualEntityName; + } + } + return commonEntityName; + } + function getParameterTypeNodeForDecoratorCheck(node) { + const typeNode = getEffectiveTypeAnnotationNode(node); + return isRestParameter(node) ? getRestParameterElementType(typeNode) : typeNode; + } + function checkDecorators(node) { + if (!canHaveDecorators(node) || !hasDecorators(node) || !node.modifiers || !nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + return; + } + const firstDecorator = find2(node.modifiers, isDecorator); + if (!firstDecorator) { + return; + } + if (legacyDecorators) { + checkExternalEmitHelpers( + firstDecorator, + 8 + /* Decorate */ + ); + if (node.kind === 169) { + checkExternalEmitHelpers( + firstDecorator, + 32 + /* Param */ + ); + } + } else if (languageVersion < 99) { + checkExternalEmitHelpers( + firstDecorator, + 8 + /* ESDecorateAndRunInitializers */ + ); + if (isClassDeclaration(node)) { + if (!node.name) { + checkExternalEmitHelpers( + firstDecorator, + 8388608 + /* SetFunctionName */ + ); + } else { + const member = getFirstTransformableStaticClassElement(node); + if (member) { + checkExternalEmitHelpers( + firstDecorator, + 8388608 + /* SetFunctionName */ + ); + } + } + } else if (!isClassExpression(node)) { + if (isPrivateIdentifier(node.name) && (isMethodDeclaration(node) || isAccessor(node) || isAutoAccessorPropertyDeclaration(node))) { + checkExternalEmitHelpers( + firstDecorator, + 8388608 + /* SetFunctionName */ + ); + } + if (isComputedPropertyName(node.name)) { + checkExternalEmitHelpers( + firstDecorator, + 16777216 + /* PropKey */ + ); + } + } + } + if (compilerOptions.emitDecoratorMetadata) { + checkExternalEmitHelpers( + firstDecorator, + 16 + /* Metadata */ + ); + switch (node.kind) { + case 263: + const constructor = getFirstConstructorWithBody(node); + if (constructor) { + for (const parameter of constructor.parameters) { + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + } + break; + case 177: + case 178: + const otherKind = node.kind === 177 ? 178 : 177; + const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(node), otherKind); + markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); + break; + case 174: + for (const parameter of node.parameters) { + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(node)); + break; + case 172: + markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveTypeAnnotationNode(node)); + break; + case 169: + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); + const containingSignature = node.parent; + for (const parameter of containingSignature.parameters) { + markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); + } + markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature)); + break; + } + } + for (const modifier of node.modifiers) { + if (isDecorator(modifier)) { + checkDecorator(modifier); + } + } + } + function checkFunctionDeclaration(node) { + addLazyDiagnostic(checkFunctionDeclarationDiagnostics); + function checkFunctionDeclarationDiagnostics() { + checkFunctionOrMethodDeclaration(node); + checkGrammarForGenerator(node); + checkCollisionsForDeclarationName(node, node.name); + } + } + function checkJSDocTypeAliasTag(node) { + if (!node.typeExpression) { + error22(node.name, Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags); + } + if (node.name) { + checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); + } + checkSourceElement(node.typeExpression); + checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); + } + function checkJSDocTemplateTag(node) { + checkSourceElement(node.constraint); + for (const tp of node.typeParameters) { + checkSourceElement(tp); + } + } + function checkJSDocTypeTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocSatisfiesTag(node) { + checkSourceElement(node.typeExpression); + const host2 = getEffectiveJSDocHost(node); + if (host2) { + const tags6 = getAllJSDocTags(host2, isJSDocSatisfiesTag); + if (length(tags6) > 1) { + for (let i7 = 1; i7 < length(tags6); i7++) { + const tagName = tags6[i7].tagName; + error22(tagName, Diagnostics._0_tag_already_specified, idText(tagName)); + } + } + } + } + function checkJSDocLinkLikeTag(node) { + if (node.name) { + resolveJSDocMemberName( + node.name, + /*ignoreErrors*/ + true + ); + } + } + function checkJSDocParameterTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocPropertyTag(node) { + checkSourceElement(node.typeExpression); + } + function checkJSDocFunctionType(node) { + addLazyDiagnostic(checkJSDocFunctionTypeImplicitAny); + checkSignatureDeclaration(node); + function checkJSDocFunctionTypeImplicitAny() { + if (!node.type && !isJSDocConstructSignature(node)) { + reportImplicitAny(node, anyType2); + } + } + } + function checkJSDocThisTag(node) { + const host2 = getEffectiveJSDocHost(node); + if (host2 && isArrowFunction(host2)) { + error22(node.tagName, Diagnostics.An_arrow_function_cannot_have_a_this_parameter); + } + } + function checkJSDocImplementsTag(node) { + const classLike = getEffectiveJSDocHost(node); + if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) { + error22(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); + } + } + function checkJSDocAugmentsTag(node) { + const classLike = getEffectiveJSDocHost(node); + if (!classLike || !isClassDeclaration(classLike) && !isClassExpression(classLike)) { + error22(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); + return; + } + const augmentsTags = getJSDocTags(classLike).filter(isJSDocAugmentsTag); + Debug.assert(augmentsTags.length > 0); + if (augmentsTags.length > 1) { + error22(augmentsTags[1], Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); + } + const name2 = getIdentifierFromEntityNameExpression(node.class.expression); + const extend22 = getClassExtendsHeritageElement(classLike); + if (extend22) { + const className = getIdentifierFromEntityNameExpression(extend22.expression); + if (className && name2.escapedText !== className.escapedText) { + error22(name2, Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, idText(node.tagName), idText(name2), idText(className)); + } + } + } + function checkJSDocAccessibilityModifiers(node) { + const host2 = getJSDocHost(node); + if (host2 && isPrivateIdentifierClassElementDeclaration(host2)) { + error22(node, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + } + } + function getIdentifierFromEntityNameExpression(node) { + switch (node.kind) { + case 80: + return node; + case 211: + return node.name; + default: + return void 0; + } + } + function checkFunctionOrMethodDeclaration(node) { + var _a2; + checkDecorators(node); + checkSignatureDeclaration(node); + const functionFlags = getFunctionFlags(node); + if (node.name && node.name.kind === 167) { + checkComputedPropertyName(node.name); + } + if (hasBindableName(node)) { + const symbol = getSymbolOfDeclaration(node); + const localSymbol = node.localSymbol || symbol; + const firstDeclaration = (_a2 = localSymbol.declarations) == null ? void 0 : _a2.find( + // Get first non javascript function declaration + (declaration) => declaration.kind === node.kind && !(declaration.flags & 524288) + ); + if (node === firstDeclaration) { + checkFunctionOrConstructorSymbol(localSymbol); + } + if (symbol.parent) { + checkFunctionOrConstructorSymbol(symbol); + } + } + const body = node.kind === 173 ? void 0 : node.body; + checkSourceElement(body); + checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, getReturnTypeFromAnnotation(node)); + addLazyDiagnostic(checkFunctionOrMethodDeclarationDiagnostics); + if (isInJSFile(node)) { + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression && !getContextualCallSignature(getTypeFromTypeNode(typeTag.typeExpression), node)) { + error22(typeTag.typeExpression.type, Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature); + } + } + function checkFunctionOrMethodDeclarationDiagnostics() { + if (!getEffectiveReturnTypeNode(node)) { + if (nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { + reportImplicitAny(node, anyType2); + } + if (functionFlags & 1 && nodeIsPresent(body)) { + getReturnTypeOfSignature(getSignatureFromDeclaration(node)); + } + } + } + } + function registerForUnusedIdentifiersCheck(node) { + addLazyDiagnostic(registerForUnusedIdentifiersCheckDiagnostics); + function registerForUnusedIdentifiersCheckDiagnostics() { + const sourceFile = getSourceFileOfNode(node); + let potentiallyUnusedIdentifiers = allPotentiallyUnusedIdentifiers.get(sourceFile.path); + if (!potentiallyUnusedIdentifiers) { + potentiallyUnusedIdentifiers = []; + allPotentiallyUnusedIdentifiers.set(sourceFile.path, potentiallyUnusedIdentifiers); + } + potentiallyUnusedIdentifiers.push(node); + } + } + function checkUnusedIdentifiers(potentiallyUnusedIdentifiers, addDiagnostic) { + for (const node of potentiallyUnusedIdentifiers) { + switch (node.kind) { + case 263: + case 231: + checkUnusedClassMembers(node, addDiagnostic); + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 312: + case 267: + case 241: + case 269: + case 248: + case 249: + case 250: + checkUnusedLocalsAndParameters(node, addDiagnostic); + break; + case 176: + case 218: + case 262: + case 219: + case 174: + case 177: + case 178: + if (node.body) { + checkUnusedLocalsAndParameters(node, addDiagnostic); + } + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 173: + case 179: + case 180: + case 184: + case 185: + case 265: + case 264: + checkUnusedTypeParameters(node, addDiagnostic); + break; + case 195: + checkUnusedInferTypeParameter(node, addDiagnostic); + break; + default: + Debug.assertNever(node, "Node should not have been registered for unused identifiers check"); + } + } + } + function errorUnusedLocal(declaration, name2, addDiagnostic) { + const node = getNameOfDeclaration(declaration) || declaration; + const message = isTypeDeclaration(declaration) ? Diagnostics._0_is_declared_but_never_used : Diagnostics._0_is_declared_but_its_value_is_never_read; + addDiagnostic(declaration, 0, createDiagnosticForNode(node, message, name2)); + } + function isIdentifierThatStartsWithUnderscore(node) { + return isIdentifier(node) && idText(node).charCodeAt(0) === 95; + } + function checkUnusedClassMembers(node, addDiagnostic) { + for (const member of node.members) { + switch (member.kind) { + case 174: + case 172: + case 177: + case 178: + if (member.kind === 178 && member.symbol.flags & 32768) { + break; + } + const symbol = getSymbolOfDeclaration(member); + if (!symbol.isReferenced && (hasEffectiveModifier( + member, + 2 + /* Private */ + ) || isNamedDeclaration(member) && isPrivateIdentifier(member.name)) && !(member.flags & 33554432)) { + addDiagnostic(member, 0, createDiagnosticForNode(member.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString2(symbol))); + } + break; + case 176: + for (const parameter of member.parameters) { + if (!parameter.symbol.isReferenced && hasSyntacticModifier( + parameter, + 2 + /* Private */ + )) { + addDiagnostic(parameter, 0, createDiagnosticForNode(parameter.name, Diagnostics.Property_0_is_declared_but_its_value_is_never_read, symbolName(parameter.symbol))); + } + } + break; + case 181: + case 240: + case 175: + break; + default: + Debug.fail("Unexpected class member"); + } + } + } + function checkUnusedInferTypeParameter(node, addDiagnostic) { + const { typeParameter } = node; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, 1, createDiagnosticForNode(node, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(typeParameter.name))); + } + } + function checkUnusedTypeParameters(node, addDiagnostic) { + const declarations = getSymbolOfDeclaration(node).declarations; + if (!declarations || last2(declarations) !== node) + return; + const typeParameters = getEffectiveTypeParameterDeclarations(node); + const seenParentsWithEveryUnused = /* @__PURE__ */ new Set(); + for (const typeParameter of typeParameters) { + if (!isTypeParameterUnused(typeParameter)) + continue; + const name2 = idText(typeParameter.name); + const { parent: parent22 } = typeParameter; + if (parent22.kind !== 195 && parent22.typeParameters.every(isTypeParameterUnused)) { + if (tryAddToSet(seenParentsWithEveryUnused, parent22)) { + const sourceFile = getSourceFileOfNode(parent22); + const range2 = isJSDocTemplateTag(parent22) ? rangeOfNode(parent22) : rangeOfTypeParameters(sourceFile, parent22.typeParameters); + const only = parent22.typeParameters.length === 1; + const messageAndArg = only ? [Diagnostics._0_is_declared_but_its_value_is_never_read, name2] : [Diagnostics.All_type_parameters_are_unused]; + addDiagnostic(typeParameter, 1, createFileDiagnostic(sourceFile, range2.pos, range2.end - range2.pos, ...messageAndArg)); + } + } else { + addDiagnostic(typeParameter, 1, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name2)); + } + } + } + function isTypeParameterUnused(typeParameter) { + return !(getMergedSymbol(typeParameter.symbol).isReferenced & 262144) && !isIdentifierThatStartsWithUnderscore(typeParameter.name); + } + function addToGroup(map22, key, value2, getKey) { + const keyString = String(getKey(key)); + const group22 = map22.get(keyString); + if (group22) { + group22[1].push(value2); + } else { + map22.set(keyString, [key, [value2]]); + } + } + function tryGetRootParameterDeclaration(node) { + return tryCast(getRootDeclaration(node), isParameter); + } + function isValidUnusedLocalDeclaration(declaration) { + if (isBindingElement(declaration)) { + if (isObjectBindingPattern(declaration.parent)) { + return !!(declaration.propertyName && isIdentifierThatStartsWithUnderscore(declaration.name)); + } + return isIdentifierThatStartsWithUnderscore(declaration.name); + } + return isAmbientModule(declaration) || (isVariableDeclaration(declaration) && isForInOrOfStatement(declaration.parent.parent) || isImportedDeclaration(declaration)) && isIdentifierThatStartsWithUnderscore(declaration.name); + } + function checkUnusedLocalsAndParameters(nodeWithLocals, addDiagnostic) { + const unusedImports = /* @__PURE__ */ new Map(); + const unusedDestructures = /* @__PURE__ */ new Map(); + const unusedVariables = /* @__PURE__ */ new Map(); + nodeWithLocals.locals.forEach((local) => { + if (local.flags & 262144 ? !(local.flags & 3 && !(local.isReferenced & 3)) : local.isReferenced || local.exportSymbol) { + return; + } + if (local.declarations) { + for (const declaration of local.declarations) { + if (isValidUnusedLocalDeclaration(declaration)) { + continue; + } + if (isImportedDeclaration(declaration)) { + addToGroup(unusedImports, importClauseFromImported(declaration), declaration, getNodeId); + } else if (isBindingElement(declaration) && isObjectBindingPattern(declaration.parent)) { + const lastElement = last2(declaration.parent.elements); + if (declaration === lastElement || !last2(declaration.parent.elements).dotDotDotToken) { + addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); + } + } else if (isVariableDeclaration(declaration)) { + const blockScopeKind = getCombinedNodeFlagsCached(declaration) & 7; + const name2 = getNameOfDeclaration(declaration); + if (blockScopeKind !== 4 && blockScopeKind !== 6 || !name2 || !isIdentifierThatStartsWithUnderscore(name2)) { + addToGroup(unusedVariables, declaration.parent, declaration, getNodeId); + } + } else { + const parameter = local.valueDeclaration && tryGetRootParameterDeclaration(local.valueDeclaration); + const name2 = local.valueDeclaration && getNameOfDeclaration(local.valueDeclaration); + if (parameter && name2) { + if (!isParameterPropertyDeclaration(parameter, parameter.parent) && !parameterIsThisKeyword(parameter) && !isIdentifierThatStartsWithUnderscore(name2)) { + if (isBindingElement(declaration) && isArrayBindingPattern(declaration.parent)) { + addToGroup(unusedDestructures, declaration.parent, declaration, getNodeId); + } else { + addDiagnostic(parameter, 1, createDiagnosticForNode(name2, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(local))); + } + } + } else { + errorUnusedLocal(declaration, symbolName(local), addDiagnostic); + } + } + } + } + }); + unusedImports.forEach(([importClause, unuseds]) => { + const importDecl = importClause.parent; + const nDeclarations = (importClause.name ? 1 : 0) + (importClause.namedBindings ? importClause.namedBindings.kind === 274 ? 1 : importClause.namedBindings.elements.length : 0); + if (nDeclarations === unuseds.length) { + addDiagnostic( + importDecl, + 0, + unuseds.length === 1 ? createDiagnosticForNode(importDecl, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(first(unuseds).name)) : createDiagnosticForNode(importDecl, Diagnostics.All_imports_in_import_declaration_are_unused) + ); + } else { + for (const unused of unuseds) + errorUnusedLocal(unused, idText(unused.name), addDiagnostic); + } + }); + unusedDestructures.forEach(([bindingPattern, bindingElements]) => { + const kind = tryGetRootParameterDeclaration(bindingPattern.parent) ? 1 : 0; + if (bindingPattern.elements.length === bindingElements.length) { + if (bindingElements.length === 1 && bindingPattern.parent.kind === 260 && bindingPattern.parent.parent.kind === 261) { + addToGroup(unusedVariables, bindingPattern.parent.parent, bindingPattern.parent, getNodeId); + } else { + addDiagnostic( + bindingPattern, + kind, + bindingElements.length === 1 ? createDiagnosticForNode(bindingPattern, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(bindingElements).name)) : createDiagnosticForNode(bindingPattern, Diagnostics.All_destructured_elements_are_unused) + ); + } + } else { + for (const e10 of bindingElements) { + addDiagnostic(e10, kind, createDiagnosticForNode(e10, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(e10.name))); + } + } + }); + unusedVariables.forEach(([declarationList, declarations]) => { + if (declarationList.declarations.length === declarations.length) { + addDiagnostic( + declarationList, + 0, + declarations.length === 1 ? createDiagnosticForNode(first(declarations).name, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(first(declarations).name)) : createDiagnosticForNode(declarationList.parent.kind === 243 ? declarationList.parent : declarationList, Diagnostics.All_variables_are_unused) + ); + } else { + for (const decl of declarations) { + addDiagnostic(decl, 0, createDiagnosticForNode(decl, Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name))); + } + } + }); + } + function checkPotentialUncheckedRenamedBindingElementsInTypes() { + var _a2; + for (const node of potentialUnusedRenamedBindingElementsInTypes) { + if (!((_a2 = getSymbolOfDeclaration(node)) == null ? void 0 : _a2.isReferenced)) { + const wrappingDeclaration = walkUpBindingElementsAndPatterns(node); + Debug.assert(isParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here"); + const diagnostic = createDiagnosticForNode(node.name, Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, declarationNameToString(node.name), declarationNameToString(node.propertyName)); + if (!wrappingDeclaration.type) { + addRelatedInfo( + diagnostic, + createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName)) + ); + } + diagnostics.add(diagnostic); + } + } + } + function bindingNameText(name2) { + switch (name2.kind) { + case 80: + return idText(name2); + case 207: + case 206: + return bindingNameText(cast(first(name2.elements), isBindingElement).name); + default: + return Debug.assertNever(name2); + } + } + function isImportedDeclaration(node) { + return node.kind === 273 || node.kind === 276 || node.kind === 274; + } + function importClauseFromImported(decl) { + return decl.kind === 273 ? decl : decl.kind === 274 ? decl.parent : decl.parent.parent; + } + function checkBlock(node) { + if (node.kind === 241) { + checkGrammarStatementInAmbientContext(node); + } + if (isFunctionOrModuleBlock(node)) { + const saveFlowAnalysisDisabled = flowAnalysisDisabled; + forEach4(node.statements, checkSourceElement); + flowAnalysisDisabled = saveFlowAnalysisDisabled; + } else { + forEach4(node.statements, checkSourceElement); + } + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkCollisionWithArgumentsInGeneratedCode(node) { + if (languageVersion >= 2 || !hasRestParameter(node) || node.flags & 33554432 || nodeIsMissing(node.body)) { + return; + } + forEach4(node.parameters, (p7) => { + if (p7.name && !isBindingPattern(p7.name) && p7.name.escapedText === argumentsSymbol.escapedName) { + errorSkippedOn("noEmit", p7, Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); + } + }); + } + function needCollisionCheckForIdentifier(node, identifier, name2) { + if ((identifier == null ? void 0 : identifier.escapedText) !== name2) { + return false; + } + if (node.kind === 172 || node.kind === 171 || node.kind === 174 || node.kind === 173 || node.kind === 177 || node.kind === 178 || node.kind === 303) { + return false; + } + if (node.flags & 33554432) { + return false; + } + if (isImportClause(node) || isImportEqualsDeclaration(node) || isImportSpecifier(node)) { + if (isTypeOnlyImportOrExportDeclaration(node)) { + return false; + } + } + const root2 = getRootDeclaration(node); + if (isParameter(root2) && nodeIsMissing(root2.parent.body)) { + return false; + } + return true; + } + function checkIfThisIsCapturedInEnclosingScope(node) { + findAncestor(node, (current) => { + if (getNodeCheckFlags(current) & 4) { + const isDeclaration2 = node.kind !== 80; + if (isDeclaration2) { + error22(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); + } else { + error22(node, Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); + } + return true; + } + return false; + }); + } + function checkIfNewTargetIsCapturedInEnclosingScope(node) { + findAncestor(node, (current) => { + if (getNodeCheckFlags(current) & 8) { + const isDeclaration2 = node.kind !== 80; + if (isDeclaration2) { + error22(getNameOfDeclaration(node), Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference); + } else { + error22(node, Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference); + } + return true; + } + return false; + }); + } + function checkCollisionWithRequireExportsInGeneratedCode(node, name2) { + if (moduleKind >= 5 && !(moduleKind >= 100 && getSourceFileOfNode(node).impliedNodeFormat === 1)) { + return; + } + if (!name2 || !needCollisionCheckForIdentifier(node, name2, "require") && !needCollisionCheckForIdentifier(node, name2, "exports")) { + return; + } + if (isModuleDeclaration(node) && getModuleInstanceState(node) !== 1) { + return; + } + const parent22 = getDeclarationContainer(node); + if (parent22.kind === 312 && isExternalOrCommonJsModule(parent22)) { + errorSkippedOn("noEmit", name2, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, declarationNameToString(name2), declarationNameToString(name2)); + } + } + function checkCollisionWithGlobalPromiseInGeneratedCode(node, name2) { + if (!name2 || languageVersion >= 4 || !needCollisionCheckForIdentifier(node, name2, "Promise")) { + return; + } + if (isModuleDeclaration(node) && getModuleInstanceState(node) !== 1) { + return; + } + const parent22 = getDeclarationContainer(node); + if (parent22.kind === 312 && isExternalOrCommonJsModule(parent22) && parent22.flags & 4096) { + errorSkippedOn("noEmit", name2, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, declarationNameToString(name2), declarationNameToString(name2)); + } + } + function recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name2) { + if (languageVersion <= 8 && (needCollisionCheckForIdentifier(node, name2, "WeakMap") || needCollisionCheckForIdentifier(node, name2, "WeakSet"))) { + potentialWeakMapSetCollisions.push(node); + } + } + function checkWeakMapSetCollision(node) { + const enclosingBlockScope = getEnclosingBlockScopeContainer(node); + if (getNodeCheckFlags(enclosingBlockScope) & 1048576) { + Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier"); + errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText); + } + } + function recordPotentialCollisionWithReflectInGeneratedCode(node, name2) { + if (name2 && languageVersion >= 2 && languageVersion <= 8 && needCollisionCheckForIdentifier(node, name2, "Reflect")) { + potentialReflectCollisions.push(node); + } + } + function checkReflectCollision(node) { + let hasCollision = false; + if (isClassExpression(node)) { + for (const member of node.members) { + if (getNodeCheckFlags(member) & 2097152) { + hasCollision = true; + break; + } + } + } else if (isFunctionExpression(node)) { + if (getNodeCheckFlags(node) & 2097152) { + hasCollision = true; + } + } else { + const container = getEnclosingBlockScopeContainer(node); + if (container && getNodeCheckFlags(container) & 2097152) { + hasCollision = true; + } + } + if (hasCollision) { + Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name), "The target of a Reflect collision check should be an identifier"); + errorSkippedOn("noEmit", node, Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, declarationNameToString(node.name), "Reflect"); + } + } + function checkCollisionsForDeclarationName(node, name2) { + if (!name2) + return; + checkCollisionWithRequireExportsInGeneratedCode(node, name2); + checkCollisionWithGlobalPromiseInGeneratedCode(node, name2); + recordPotentialCollisionWithWeakMapSetInGeneratedCode(node, name2); + recordPotentialCollisionWithReflectInGeneratedCode(node, name2); + if (isClassLike(node)) { + checkTypeNameIsReserved(name2, Diagnostics.Class_name_cannot_be_0); + if (!(node.flags & 33554432)) { + checkClassNameCollisionWithObject(name2); + } + } else if (isEnumDeclaration(node)) { + checkTypeNameIsReserved(name2, Diagnostics.Enum_name_cannot_be_0); + } + } + function checkVarDeclaredNamesNotShadowed(node) { + if ((getCombinedNodeFlagsCached(node) & 7) !== 0 || isParameterDeclaration(node)) { + return; + } + const symbol = getSymbolOfDeclaration(node); + if (symbol.flags & 1) { + if (!isIdentifier(node.name)) + return Debug.fail(); + const localDeclarationSymbol = resolveName( + node, + node.name.escapedText, + 3, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + ); + if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { + if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 7) { + const varDeclList = getAncestor( + localDeclarationSymbol.valueDeclaration, + 261 + /* VariableDeclarationList */ + ); + const container = varDeclList.parent.kind === 243 && varDeclList.parent.parent ? varDeclList.parent.parent : void 0; + const namesShareScope = container && (container.kind === 241 && isFunctionLike(container.parent) || container.kind === 268 || container.kind === 267 || container.kind === 312); + if (!namesShareScope) { + const name2 = symbolToString2(localDeclarationSymbol); + error22(node, Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name2, name2); + } + } + } + } + } + function convertAutoToAny(type3) { + return type3 === autoType ? anyType2 : type3 === autoArrayType ? anyArrayType : type3; + } + function checkVariableLikeDeclaration(node) { + var _a2; + checkDecorators(node); + if (!isBindingElement(node)) { + checkSourceElement(node.type); + } + if (!node.name) { + return; + } + if (node.name.kind === 167) { + checkComputedPropertyName(node.name); + if (hasOnlyExpressionInitializer(node) && node.initializer) { + checkExpressionCached(node.initializer); + } + } + if (isBindingElement(node)) { + if (node.propertyName && isIdentifier(node.name) && isParameterDeclaration(node) && nodeIsMissing(getContainingFunction(node).body)) { + potentialUnusedRenamedBindingElementsInTypes.push(node); + return; + } + if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5) { + checkExternalEmitHelpers( + node, + 4 + /* Rest */ + ); + } + if (node.propertyName && node.propertyName.kind === 167) { + checkComputedPropertyName(node.propertyName); + } + const parent22 = node.parent.parent; + const parentCheckMode = node.dotDotDotToken ? 32 : 0; + const parentType = getTypeForBindingElementParent(parent22, parentCheckMode); + const name2 = node.propertyName || node.name; + if (parentType && !isBindingPattern(name2)) { + const exprType = getLiteralTypeFromPropertyName(name2); + if (isTypeUsableAsPropertyName(exprType)) { + const nameText = getPropertyNameFromType(exprType); + const property2 = getPropertyOfType(parentType, nameText); + if (property2) { + markPropertyAsReferenced( + property2, + /*nodeForCheckWriteOnly*/ + void 0, + /*isSelfTypeAccess*/ + false + ); + checkPropertyAccessibility( + node, + !!parent22.initializer && parent22.initializer.kind === 108, + /*writing*/ + false, + parentType, + property2 + ); + } + } + } + } + if (isBindingPattern(node.name)) { + if (node.name.kind === 207 && languageVersion < 2 && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers( + node, + 512 + /* Read */ + ); + } + forEach4(node.name.elements, checkSourceElement); + } + if (node.initializer && isParameterDeclaration(node) && nodeIsMissing(getContainingFunction(node).body)) { + error22(node, Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); + return; + } + if (isBindingPattern(node.name)) { + if (isInAmbientOrTypeNode(node)) { + return; + } + const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249; + const needCheckWidenedType = !some2(node.name.elements, not(isOmittedExpression)); + if (needCheckInitializer || needCheckWidenedType) { + const widenedType = getWidenedTypeForVariableLikeDeclaration(node); + if (needCheckInitializer) { + const initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && needCheckWidenedType) { + checkNonNullNonVoidType(initializerType, node); + } else { + checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer); + } + } + if (needCheckWidenedType) { + if (isArrayBindingPattern(node.name)) { + checkIteratedTypeOrElementType(65, widenedType, undefinedType2, node); + } else if (strictNullChecks) { + checkNonNullNonVoidType(widenedType, node); + } + } + } + return; + } + const symbol = getSymbolOfDeclaration(node); + if (symbol.flags & 2097152 && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node))) { + checkAliasSymbol(node); + return; + } + const type3 = convertAutoToAny(getTypeOfSymbol(symbol)); + if (node === symbol.valueDeclaration) { + const initializer = hasOnlyExpressionInitializer(node) && getEffectiveInitializer(node); + if (initializer) { + const isJSObjectLiteralInitializer = isInJSFile(node) && isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAccess(node.name)) && !!((_a2 = symbol.exports) == null ? void 0 : _a2.size); + if (!isJSObjectLiteralInitializer && node.parent.parent.kind !== 249) { + const initializerType = checkExpressionCached(initializer); + checkTypeAssignableToAndOptionallyElaborate( + initializerType, + type3, + node, + initializer, + /*headMessage*/ + void 0 + ); + const blockScopeKind = getCombinedNodeFlagsCached(node) & 7; + if (blockScopeKind === 6) { + const globalAsyncDisposableType = getGlobalAsyncDisposableType( + /*reportErrors*/ + true + ); + const globalDisposableType = getGlobalDisposableType( + /*reportErrors*/ + true + ); + if (globalAsyncDisposableType !== emptyObjectType && globalDisposableType !== emptyObjectType) { + const optionalDisposableType = getUnionType([globalAsyncDisposableType, globalDisposableType, nullType2, undefinedType2]); + checkTypeAssignableTo(initializerType, optionalDisposableType, initializer, Diagnostics.The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined); + } + } else if (blockScopeKind === 4) { + const globalDisposableType = getGlobalDisposableType( + /*reportErrors*/ + true + ); + if (globalDisposableType !== emptyObjectType) { + const optionalDisposableType = getUnionType([globalDisposableType, nullType2, undefinedType2]); + checkTypeAssignableTo(initializerType, optionalDisposableType, initializer, Diagnostics.The_initializer_of_a_using_declaration_must_be_either_an_object_with_a_Symbol_dispose_method_or_be_null_or_undefined); + } + } + } + } + if (symbol.declarations && symbol.declarations.length > 1) { + if (some2(symbol.declarations, (d7) => d7 !== node && isVariableLike(d7) && !areDeclarationFlagsIdentical(d7, node))) { + error22(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); + } + } + } else { + const declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node)); + if (!isErrorType(type3) && !isErrorType(declarationType) && !isTypeIdenticalTo(type3, declarationType) && !(symbol.flags & 67108864)) { + errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type3, node, declarationType); + } + if (hasOnlyExpressionInitializer(node) && node.initializer) { + checkTypeAssignableToAndOptionallyElaborate( + checkExpressionCached(node.initializer), + declarationType, + node, + node.initializer, + /*headMessage*/ + void 0 + ); + } + if (symbol.valueDeclaration && !areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) { + error22(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name)); + } + } + if (node.kind !== 172 && node.kind !== 171) { + checkExportsOnMergedDeclarations(node); + if (node.kind === 260 || node.kind === 208) { + checkVarDeclaredNamesNotShadowed(node); + } + checkCollisionsForDeclarationName(node, node.name); + } + } + function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration, firstType, nextDeclaration, nextType) { + const nextDeclarationName = getNameOfDeclaration(nextDeclaration); + const message = nextDeclaration.kind === 172 || nextDeclaration.kind === 171 ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; + const declName = declarationNameToString(nextDeclarationName); + const err = error22( + nextDeclarationName, + message, + declName, + typeToString(firstType), + typeToString(nextType) + ); + if (firstDeclaration) { + addRelatedInfo(err, createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName)); + } + } + function areDeclarationFlagsIdentical(left, right) { + if (left.kind === 169 && right.kind === 260 || left.kind === 260 && right.kind === 169) { + return true; + } + if (hasQuestionToken(left) !== hasQuestionToken(right)) { + return false; + } + const interestingFlags = 2 | 4 | 1024 | 64 | 8 | 256; + return getSelectedEffectiveModifierFlags(left, interestingFlags) === getSelectedEffectiveModifierFlags(right, interestingFlags); + } + function checkVariableDeclaration(node) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + checkGrammarVariableDeclaration(node); + checkVariableLikeDeclaration(node); + (_b = tracing) == null ? void 0 : _b.pop(); + } + function checkBindingElement(node) { + checkGrammarBindingElement(node); + return checkVariableLikeDeclaration(node); + } + function checkVariableDeclarationList(node) { + const blockScopeKind = getCombinedNodeFlags(node) & 7; + if (blockScopeKind === 4 || blockScopeKind === 6) { + checkExternalEmitHelpers( + node, + 33554432 + /* AddDisposableResourceAndDisposeResources */ + ); + } + forEach4(node.declarations, checkSourceElement); + } + function checkVariableStatement(node) { + if (!checkGrammarModifiers(node) && !checkGrammarVariableDeclarationList(node.declarationList)) + checkGrammarForDisallowedBlockScopedVariableStatement(node); + checkVariableDeclarationList(node.declarationList); + } + function checkExpressionStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkExpression(node.expression); + } + function checkIfStatement(node) { + checkGrammarStatementInAmbientContext(node); + const type3 = checkTruthinessExpression(node.expression); + checkTestingKnownTruthyCallableOrAwaitableType(node.expression, type3, node.thenStatement); + checkSourceElement(node.thenStatement); + if (node.thenStatement.kind === 242) { + error22(node.thenStatement, Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); + } + checkSourceElement(node.elseStatement); + } + function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, condType, body) { + if (!strictNullChecks) + return; + bothHelper(condExpr, body); + function bothHelper(condExpr2, body2) { + condExpr2 = skipParentheses(condExpr2); + helper(condExpr2, body2); + while (isBinaryExpression(condExpr2) && (condExpr2.operatorToken.kind === 57 || condExpr2.operatorToken.kind === 61)) { + condExpr2 = skipParentheses(condExpr2.left); + helper(condExpr2, body2); + } + } + function helper(condExpr2, body2) { + const location2 = isLogicalOrCoalescingBinaryExpression(condExpr2) ? skipParentheses(condExpr2.right) : condExpr2; + if (isModuleExportsAccessExpression(location2)) { + return; + } + if (isLogicalOrCoalescingBinaryExpression(location2)) { + bothHelper(location2, body2); + return; + } + const type3 = location2 === condExpr2 ? condType : checkTruthinessExpression(location2); + const isPropertyExpressionCast = isPropertyAccessExpression(location2) && isTypeAssertion(location2.expression); + if (!hasTypeFacts( + type3, + 4194304 + /* Truthy */ + ) || isPropertyExpressionCast) + return; + const callSignatures = getSignaturesOfType( + type3, + 0 + /* Call */ + ); + const isPromise = !!getAwaitedTypeOfPromise(type3); + if (callSignatures.length === 0 && !isPromise) { + return; + } + const testedNode = isIdentifier(location2) ? location2 : isPropertyAccessExpression(location2) ? location2.name : void 0; + const testedSymbol = testedNode && getSymbolAtLocation(testedNode); + if (!testedSymbol && !isPromise) { + return; + } + const isUsed = testedSymbol && isBinaryExpression(condExpr2.parent) && isSymbolUsedInBinaryExpressionChain(condExpr2.parent, testedSymbol) || testedSymbol && body2 && isSymbolUsedInConditionBody(condExpr2, body2, testedNode, testedSymbol); + if (!isUsed) { + if (isPromise) { + errorAndMaybeSuggestAwait( + location2, + /*maybeMissingAwait*/ + true, + Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, + getTypeNameForErrorDisplay(type3) + ); + } else { + error22(location2, Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead); + } + } + } + } + function isSymbolUsedInConditionBody(expr, body, testedNode, testedSymbol) { + return !!forEachChild(body, function check(childNode) { + if (isIdentifier(childNode)) { + const childSymbol = getSymbolAtLocation(childNode); + if (childSymbol && childSymbol === testedSymbol) { + if (isIdentifier(expr) || isIdentifier(testedNode) && isBinaryExpression(testedNode.parent)) { + return true; + } + let testedExpression = testedNode.parent; + let childExpression = childNode.parent; + while (testedExpression && childExpression) { + if (isIdentifier(testedExpression) && isIdentifier(childExpression) || testedExpression.kind === 110 && childExpression.kind === 110) { + return getSymbolAtLocation(testedExpression) === getSymbolAtLocation(childExpression); + } else if (isPropertyAccessExpression(testedExpression) && isPropertyAccessExpression(childExpression)) { + if (getSymbolAtLocation(testedExpression.name) !== getSymbolAtLocation(childExpression.name)) { + return false; + } + childExpression = childExpression.expression; + testedExpression = testedExpression.expression; + } else if (isCallExpression(testedExpression) && isCallExpression(childExpression)) { + childExpression = childExpression.expression; + testedExpression = testedExpression.expression; + } else { + return false; + } + } + } + } + return forEachChild(childNode, check); + }); + } + function isSymbolUsedInBinaryExpressionChain(node, testedSymbol) { + while (isBinaryExpression(node) && node.operatorToken.kind === 56) { + const isUsed = forEachChild(node.right, function visit7(child) { + if (isIdentifier(child)) { + const symbol = getSymbolAtLocation(child); + if (symbol && symbol === testedSymbol) { + return true; + } + } + return forEachChild(child, visit7); + }); + if (isUsed) { + return true; + } + node = node.parent; + } + return false; + } + function checkDoStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkSourceElement(node.statement); + checkTruthinessExpression(node.expression); + } + function checkWhileStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkTruthinessExpression(node.expression); + checkSourceElement(node.statement); + } + function checkTruthinessOfType(type3, node) { + if (type3.flags & 16384) { + error22(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness); + } + return type3; + } + function checkTruthinessExpression(node, checkMode) { + return checkTruthinessOfType(checkExpression(node, checkMode), node); + } + function checkForStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (node.initializer && node.initializer.kind === 261) { + checkGrammarVariableDeclarationList(node.initializer); + } + } + if (node.initializer) { + if (node.initializer.kind === 261) { + checkVariableDeclarationList(node.initializer); + } else { + checkExpression(node.initializer); + } + } + if (node.condition) + checkTruthinessExpression(node.condition); + if (node.incrementor) + checkExpression(node.incrementor); + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkForOfStatement(node) { + checkGrammarForInOrForOfStatement(node); + const container = getContainingFunctionOrClassStaticBlock(node); + if (node.awaitModifier) { + if (container && isClassStaticBlockDeclaration(container)) { + grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block); + } else { + const functionFlags = getFunctionFlags(container); + if ((functionFlags & (4 | 2)) === 2 && languageVersion < 99) { + checkExternalEmitHelpers( + node, + 16384 + /* ForAwaitOfIncludes */ + ); + } + } + } else if (compilerOptions.downlevelIteration && languageVersion < 2) { + checkExternalEmitHelpers( + node, + 256 + /* ForOfIncludes */ + ); + } + if (node.initializer.kind === 261) { + checkVariableDeclarationList(node.initializer); + } else { + const varExpr = node.initializer; + const iteratedType = checkRightHandSideOfForOf(node); + if (varExpr.kind === 209 || varExpr.kind === 210) { + checkDestructuringAssignment(varExpr, iteratedType || errorType); + } else { + const leftType = checkExpression(varExpr); + checkReferenceExpression( + varExpr, + Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access, + Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access + ); + if (iteratedType) { + checkTypeAssignableToAndOptionallyElaborate(iteratedType, leftType, varExpr, node.expression); + } + } + } + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkForInStatement(node) { + checkGrammarForInOrForOfStatement(node); + const rightType = getNonNullableTypeIfNeeded(checkExpression(node.expression)); + if (node.initializer.kind === 261) { + const variable = node.initializer.declarations[0]; + if (variable && isBindingPattern(variable.name)) { + error22(variable.name, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + } + checkVariableDeclarationList(node.initializer); + } else { + const varExpr = node.initializer; + const leftType = checkExpression(varExpr); + if (varExpr.kind === 209 || varExpr.kind === 210) { + error22(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); + } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { + error22(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); + } else { + checkReferenceExpression( + varExpr, + Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, + Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access + ); + } + } + if (rightType === neverType2 || !isTypeAssignableToKind( + rightType, + 67108864 | 58982400 + /* InstantiableNonPrimitive */ + )) { + error22(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType)); + } + checkSourceElement(node.statement); + if (node.locals) { + registerForUnusedIdentifiersCheck(node); + } + } + function checkRightHandSideOfForOf(statement) { + const use = statement.awaitModifier ? 15 : 13; + return checkIteratedTypeOrElementType(use, checkNonNullExpression(statement.expression), undefinedType2, statement.expression); + } + function checkIteratedTypeOrElementType(use, inputType, sentType, errorNode) { + if (isTypeAny(inputType)) { + return inputType; + } + return getIteratedTypeOrElementType( + use, + inputType, + sentType, + errorNode, + /*checkAssignability*/ + true + ) || anyType2; + } + function getIteratedTypeOrElementType(use, inputType, sentType, errorNode, checkAssignability) { + const allowAsyncIterables = (use & 2) !== 0; + if (inputType === neverType2) { + reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables); + return void 0; + } + const uplevelIteration = languageVersion >= 2; + const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration; + const possibleOutOfBounds = compilerOptions.noUncheckedIndexedAccess && !!(use & 128); + if (uplevelIteration || downlevelIteration || allowAsyncIterables) { + const iterationTypes = getIterationTypesOfIterable(inputType, use, uplevelIteration ? errorNode : void 0); + if (checkAssignability) { + if (iterationTypes) { + const diagnostic = use & 8 ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0 : use & 32 ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0 : use & 64 ? Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0 : use & 16 ? Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0 : void 0; + if (diagnostic) { + checkTypeAssignableTo(sentType, iterationTypes.nextType, errorNode, diagnostic); + } + } + } + if (iterationTypes || uplevelIteration) { + return possibleOutOfBounds ? includeUndefinedInIndexSignature(iterationTypes && iterationTypes.yieldType) : iterationTypes && iterationTypes.yieldType; + } + } + let arrayType2 = inputType; + let reportedError = false; + let hasStringConstituent = false; + if (use & 4) { + if (arrayType2.flags & 1048576) { + const arrayTypes = inputType.types; + const filteredTypes = filter2(arrayTypes, (t8) => !(t8.flags & 402653316)); + if (filteredTypes !== arrayTypes) { + arrayType2 = getUnionType( + filteredTypes, + 2 + /* Subtype */ + ); + } + } else if (arrayType2.flags & 402653316) { + arrayType2 = neverType2; + } + hasStringConstituent = arrayType2 !== inputType; + if (hasStringConstituent) { + if (languageVersion < 1) { + if (errorNode) { + error22(errorNode, Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); + reportedError = true; + } + } + if (arrayType2.flags & 131072) { + return possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType2) : stringType2; + } + } + } + if (!isArrayLikeType(arrayType2)) { + if (errorNode && !reportedError) { + const allowsStrings = !!(use & 4) && !hasStringConstituent; + const [defaultDiagnostic, maybeMissingAwait] = getIterationDiagnosticDetails(allowsStrings, downlevelIteration); + errorAndMaybeSuggestAwait( + errorNode, + maybeMissingAwait && !!getAwaitedTypeOfPromise(arrayType2), + defaultDiagnostic, + typeToString(arrayType2) + ); + } + return hasStringConstituent ? possibleOutOfBounds ? includeUndefinedInIndexSignature(stringType2) : stringType2 : void 0; + } + const arrayElementType = getIndexTypeOfType(arrayType2, numberType2); + if (hasStringConstituent && arrayElementType) { + if (arrayElementType.flags & 402653316 && !compilerOptions.noUncheckedIndexedAccess) { + return stringType2; + } + return getUnionType( + possibleOutOfBounds ? [arrayElementType, stringType2, undefinedType2] : [arrayElementType, stringType2], + 2 + /* Subtype */ + ); + } + return use & 128 ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType; + function getIterationDiagnosticDetails(allowsStrings, downlevelIteration2) { + var _a2; + if (downlevelIteration2) { + return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true] : [Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]; + } + const yieldType = getIterationTypeOfIterable( + use, + 0, + inputType, + /*errorNode*/ + void 0 + ); + if (yieldType) { + return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false]; + } + if (isES2015OrLaterIterable((_a2 = inputType.symbol) == null ? void 0 : _a2.escapedName)) { + return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true]; + } + return allowsStrings ? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type, true] : [Diagnostics.Type_0_is_not_an_array_type, true]; + } + } + function isES2015OrLaterIterable(n7) { + switch (n7) { + case "Float32Array": + case "Float64Array": + case "Int16Array": + case "Int32Array": + case "Int8Array": + case "NodeList": + case "Uint16Array": + case "Uint32Array": + case "Uint8Array": + case "Uint8ClampedArray": + return true; + } + return false; + } + function getIterationTypeOfIterable(use, typeKind, inputType, errorNode) { + if (isTypeAny(inputType)) { + return void 0; + } + const iterationTypes = getIterationTypesOfIterable(inputType, use, errorNode); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(typeKind)]; + } + function createIterationTypes(yieldType = neverType2, returnType = neverType2, nextType = unknownType2) { + if (yieldType.flags & 67359327 && returnType.flags & (1 | 131072 | 2 | 16384 | 32768) && nextType.flags & (1 | 131072 | 2 | 16384 | 32768)) { + const id = getTypeListId([yieldType, returnType, nextType]); + let iterationTypes = iterationTypesCache.get(id); + if (!iterationTypes) { + iterationTypes = { yieldType, returnType, nextType }; + iterationTypesCache.set(id, iterationTypes); + } + return iterationTypes; + } + return { yieldType, returnType, nextType }; + } + function combineIterationTypes(array) { + let yieldTypes; + let returnTypes; + let nextTypes; + for (const iterationTypes of array) { + if (iterationTypes === void 0 || iterationTypes === noIterationTypes) { + continue; + } + if (iterationTypes === anyIterationTypes) { + return anyIterationTypes; + } + yieldTypes = append(yieldTypes, iterationTypes.yieldType); + returnTypes = append(returnTypes, iterationTypes.returnType); + nextTypes = append(nextTypes, iterationTypes.nextType); + } + if (yieldTypes || returnTypes || nextTypes) { + return createIterationTypes( + yieldTypes && getUnionType(yieldTypes), + returnTypes && getUnionType(returnTypes), + nextTypes && getIntersectionType(nextTypes) + ); + } + return noIterationTypes; + } + function getCachedIterationTypes(type3, cacheKey) { + return type3[cacheKey]; + } + function setCachedIterationTypes(type3, cacheKey, cachedTypes2) { + return type3[cacheKey] = cachedTypes2; + } + function getIterationTypesOfIterable(type3, use, errorNode) { + var _a2, _b; + if (isTypeAny(type3)) { + return anyIterationTypes; + } + if (!(type3.flags & 1048576)) { + const errorOutputContainer = errorNode ? { errors: void 0 } : void 0; + const iterationTypes2 = getIterationTypesOfIterableWorker(type3, use, errorNode, errorOutputContainer); + if (iterationTypes2 === noIterationTypes) { + if (errorNode) { + const rootDiag = reportTypeNotIterableError(errorNode, type3, !!(use & 2)); + if (errorOutputContainer == null ? void 0 : errorOutputContainer.errors) { + addRelatedInfo(rootDiag, ...errorOutputContainer.errors); + } + } + return void 0; + } else if ((_a2 = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _a2.length) { + for (const diag2 of errorOutputContainer.errors) { + diagnostics.add(diag2); + } + } + return iterationTypes2; + } + const cacheKey = use & 2 ? "iterationTypesOfAsyncIterable" : "iterationTypesOfIterable"; + const cachedTypes2 = getCachedIterationTypes(type3, cacheKey); + if (cachedTypes2) + return cachedTypes2 === noIterationTypes ? void 0 : cachedTypes2; + let allIterationTypes; + for (const constituent of type3.types) { + const errorOutputContainer = errorNode ? { errors: void 0 } : void 0; + const iterationTypes2 = getIterationTypesOfIterableWorker(constituent, use, errorNode, errorOutputContainer); + if (iterationTypes2 === noIterationTypes) { + if (errorNode) { + const rootDiag = reportTypeNotIterableError(errorNode, type3, !!(use & 2)); + if (errorOutputContainer == null ? void 0 : errorOutputContainer.errors) { + addRelatedInfo(rootDiag, ...errorOutputContainer.errors); + } + } + setCachedIterationTypes(type3, cacheKey, noIterationTypes); + return void 0; + } else if ((_b = errorOutputContainer == null ? void 0 : errorOutputContainer.errors) == null ? void 0 : _b.length) { + for (const diag2 of errorOutputContainer.errors) { + diagnostics.add(diag2); + } + } + allIterationTypes = append(allIterationTypes, iterationTypes2); + } + const iterationTypes = allIterationTypes ? combineIterationTypes(allIterationTypes) : noIterationTypes; + setCachedIterationTypes(type3, cacheKey, iterationTypes); + return iterationTypes === noIterationTypes ? void 0 : iterationTypes; + } + function getAsyncFromSyncIterationTypes(iterationTypes, errorNode) { + if (iterationTypes === noIterationTypes) + return noIterationTypes; + if (iterationTypes === anyIterationTypes) + return anyIterationTypes; + const { yieldType, returnType, nextType } = iterationTypes; + if (errorNode) { + getGlobalAwaitedSymbol( + /*reportErrors*/ + true + ); + } + return createIterationTypes( + getAwaitedType(yieldType, errorNode) || anyType2, + getAwaitedType(returnType, errorNode) || anyType2, + nextType + ); + } + function getIterationTypesOfIterableWorker(type3, use, errorNode, errorOutputContainer) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + let noCache = false; + if (use & 2) { + const iterationTypes = getIterationTypesOfIterableCached(type3, asyncIterationTypesResolver) || getIterationTypesOfIterableFast(type3, asyncIterationTypesResolver); + if (iterationTypes) { + if (iterationTypes === noIterationTypes && errorNode) { + noCache = true; + } else { + return use & 8 ? getAsyncFromSyncIterationTypes(iterationTypes, errorNode) : iterationTypes; + } + } + } + if (use & 1) { + let iterationTypes = getIterationTypesOfIterableCached(type3, syncIterationTypesResolver) || getIterationTypesOfIterableFast(type3, syncIterationTypesResolver); + if (iterationTypes) { + if (iterationTypes === noIterationTypes && errorNode) { + noCache = true; + } else { + if (use & 2) { + if (iterationTypes !== noIterationTypes) { + iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); + return noCache ? iterationTypes : setCachedIterationTypes(type3, "iterationTypesOfAsyncIterable", iterationTypes); + } + } else { + return iterationTypes; + } + } + } + } + if (use & 2) { + const iterationTypes = getIterationTypesOfIterableSlow(type3, asyncIterationTypesResolver, errorNode, errorOutputContainer, noCache); + if (iterationTypes !== noIterationTypes) { + return iterationTypes; + } + } + if (use & 1) { + let iterationTypes = getIterationTypesOfIterableSlow(type3, syncIterationTypesResolver, errorNode, errorOutputContainer, noCache); + if (iterationTypes !== noIterationTypes) { + if (use & 2) { + iterationTypes = getAsyncFromSyncIterationTypes(iterationTypes, errorNode); + return noCache ? iterationTypes : setCachedIterationTypes(type3, "iterationTypesOfAsyncIterable", iterationTypes); + } else { + return iterationTypes; + } + } + } + return noIterationTypes; + } + function getIterationTypesOfIterableCached(type3, resolver) { + return getCachedIterationTypes(type3, resolver.iterableCacheKey); + } + function getIterationTypesOfGlobalIterableType(globalType, resolver) { + const globalIterationTypes = getIterationTypesOfIterableCached(globalType, resolver) || getIterationTypesOfIterableSlow( + globalType, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0, + /*noCache*/ + false + ); + return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes; + } + function getIterationTypesOfIterableFast(type3, resolver) { + let globalType; + if (isReferenceToType2(type3, globalType = resolver.getGlobalIterableType( + /*reportErrors*/ + false + )) || isReferenceToType2(type3, globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ))) { + const [yieldType] = getTypeArguments(type3); + const { returnType, nextType } = getIterationTypesOfGlobalIterableType(globalType, resolver); + return setCachedIterationTypes(type3, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || yieldType, resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || returnType, nextType)); + } + if (isReferenceToType2(type3, resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ))) { + const [yieldType, returnType, nextType] = getTypeArguments(type3); + return setCachedIterationTypes(type3, resolver.iterableCacheKey, createIterationTypes(resolver.resolveIterationType( + yieldType, + /*errorNode*/ + void 0 + ) || yieldType, resolver.resolveIterationType( + returnType, + /*errorNode*/ + void 0 + ) || returnType, nextType)); + } + } + function getPropertyNameForKnownSymbolName(symbolName2) { + const ctorType = getGlobalESSymbolConstructorSymbol( + /*reportErrors*/ + false + ); + const uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), escapeLeadingUnderscores(symbolName2)); + return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : `__@${symbolName2}`; + } + function getIterationTypesOfIterableSlow(type3, resolver, errorNode, errorOutputContainer, noCache) { + const method2 = getPropertyOfType(type3, getPropertyNameForKnownSymbolName(resolver.iteratorSymbolName)); + const methodType = method2 && !(method2.flags & 16777216) ? getTypeOfSymbol(method2) : void 0; + if (isTypeAny(methodType)) { + return noCache ? anyIterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, anyIterationTypes); + } + const signatures = methodType ? getSignaturesOfType( + methodType, + 0 + /* Call */ + ) : void 0; + if (!some2(signatures)) { + return noCache ? noIterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, noIterationTypes); + } + const iteratorType = getIntersectionType(map4(signatures, getReturnTypeOfSignature)); + const iterationTypes = getIterationTypesOfIteratorWorker(iteratorType, resolver, errorNode, errorOutputContainer, noCache) ?? noIterationTypes; + return noCache ? iterationTypes : setCachedIterationTypes(type3, resolver.iterableCacheKey, iterationTypes); + } + function reportTypeNotIterableError(errorNode, type3, allowAsyncIterables) { + const message = allowAsyncIterables ? Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator : Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator; + const suggestAwait = ( + // for (const x of Promise<...>) or [...Promise<...>] + !!getAwaitedTypeOfPromise(type3) || !allowAsyncIterables && isForOfStatement(errorNode.parent) && errorNode.parent.expression === errorNode && getGlobalAsyncIterableType( + /*reportErrors*/ + false + ) !== emptyGenericType && isTypeAssignableTo(type3, getGlobalAsyncIterableType( + /*reportErrors*/ + false + )) + ); + return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type3)); + } + function getIterationTypesOfIterator(type3, resolver, errorNode, errorOutputContainer) { + return getIterationTypesOfIteratorWorker( + type3, + resolver, + errorNode, + errorOutputContainer, + /*noCache*/ + false + ); + } + function getIterationTypesOfIteratorWorker(type3, resolver, errorNode, errorOutputContainer, noCache) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + let iterationTypes = getIterationTypesOfIteratorCached(type3, resolver) || getIterationTypesOfIteratorFast(type3, resolver); + if (iterationTypes === noIterationTypes && errorNode) { + iterationTypes = void 0; + noCache = true; + } + iterationTypes ?? (iterationTypes = getIterationTypesOfIteratorSlow(type3, resolver, errorNode, errorOutputContainer, noCache)); + return iterationTypes === noIterationTypes ? void 0 : iterationTypes; + } + function getIterationTypesOfIteratorCached(type3, resolver) { + return getCachedIterationTypes(type3, resolver.iteratorCacheKey); + } + function getIterationTypesOfIteratorFast(type3, resolver) { + const globalType = resolver.getGlobalIterableIteratorType( + /*reportErrors*/ + false + ); + if (isReferenceToType2(type3, globalType)) { + const [yieldType] = getTypeArguments(type3); + const globalIterationTypes = getIterationTypesOfIteratorCached(globalType, resolver) || getIterationTypesOfIteratorSlow( + globalType, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0, + /*noCache*/ + false + ); + const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes; + return setCachedIterationTypes(type3, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); + } + if (isReferenceToType2(type3, resolver.getGlobalIteratorType( + /*reportErrors*/ + false + )) || isReferenceToType2(type3, resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ))) { + const [yieldType, returnType, nextType] = getTypeArguments(type3); + return setCachedIterationTypes(type3, resolver.iteratorCacheKey, createIterationTypes(yieldType, returnType, nextType)); + } + } + function isIteratorResult(type3, kind) { + const doneType = getTypeOfPropertyOfType(type3, "done") || falseType; + return isTypeAssignableTo(kind === 0 ? falseType : trueType, doneType); + } + function isYieldIteratorResult(type3) { + return isIteratorResult( + type3, + 0 + /* Yield */ + ); + } + function isReturnIteratorResult(type3) { + return isIteratorResult( + type3, + 1 + /* Return */ + ); + } + function getIterationTypesOfIteratorResult(type3) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + const cachedTypes2 = getCachedIterationTypes(type3, "iterationTypesOfIteratorResult"); + if (cachedTypes2) { + return cachedTypes2; + } + if (isReferenceToType2(type3, getGlobalIteratorYieldResultType( + /*reportErrors*/ + false + ))) { + const yieldType2 = getTypeArguments(type3)[0]; + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + yieldType2, + /*returnType*/ + void 0, + /*nextType*/ + void 0 + )); + } + if (isReferenceToType2(type3, getGlobalIteratorReturnResultType( + /*reportErrors*/ + false + ))) { + const returnType2 = getTypeArguments(type3)[0]; + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + /*yieldType*/ + void 0, + returnType2, + /*nextType*/ + void 0 + )); + } + const yieldIteratorResult = filterType(type3, isYieldIteratorResult); + const yieldType = yieldIteratorResult !== neverType2 ? getTypeOfPropertyOfType(yieldIteratorResult, "value") : void 0; + const returnIteratorResult = filterType(type3, isReturnIteratorResult); + const returnType = returnIteratorResult !== neverType2 ? getTypeOfPropertyOfType(returnIteratorResult, "value") : void 0; + if (!yieldType && !returnType) { + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", noIterationTypes); + } + return setCachedIterationTypes(type3, "iterationTypesOfIteratorResult", createIterationTypes( + yieldType, + returnType || voidType2, + /*nextType*/ + void 0 + )); + } + function getIterationTypesOfMethod(type3, resolver, methodName, errorNode, errorOutputContainer) { + var _a2, _b, _c, _d; + const method2 = getPropertyOfType(type3, methodName); + if (!method2 && methodName !== "next") { + return void 0; + } + const methodType = method2 && !(methodName === "next" && method2.flags & 16777216) ? methodName === "next" ? getTypeOfSymbol(method2) : getTypeWithFacts( + getTypeOfSymbol(method2), + 2097152 + /* NEUndefinedOrNull */ + ) : void 0; + if (isTypeAny(methodType)) { + return methodName === "next" ? anyIterationTypes : anyIterationTypesExceptNext; + } + const methodSignatures = methodType ? getSignaturesOfType( + methodType, + 0 + /* Call */ + ) : emptyArray; + if (methodSignatures.length === 0) { + if (errorNode) { + const diagnostic = methodName === "next" ? resolver.mustHaveANextMethodDiagnostic : resolver.mustBeAMethodDiagnostic; + if (errorOutputContainer) { + errorOutputContainer.errors ?? (errorOutputContainer.errors = []); + errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, diagnostic, methodName)); + } else { + error22(errorNode, diagnostic, methodName); + } + } + return methodName === "next" ? noIterationTypes : void 0; + } + if ((methodType == null ? void 0 : methodType.symbol) && methodSignatures.length === 1) { + const globalGeneratorType = resolver.getGlobalGeneratorType( + /*reportErrors*/ + false + ); + const globalIteratorType = resolver.getGlobalIteratorType( + /*reportErrors*/ + false + ); + const isGeneratorMethod = ((_b = (_a2 = globalGeneratorType.symbol) == null ? void 0 : _a2.members) == null ? void 0 : _b.get(methodName)) === methodType.symbol; + const isIteratorMethod = !isGeneratorMethod && ((_d = (_c = globalIteratorType.symbol) == null ? void 0 : _c.members) == null ? void 0 : _d.get(methodName)) === methodType.symbol; + if (isGeneratorMethod || isIteratorMethod) { + const globalType = isGeneratorMethod ? globalGeneratorType : globalIteratorType; + const { mapper } = methodType; + return createIterationTypes( + getMappedType(globalType.typeParameters[0], mapper), + getMappedType(globalType.typeParameters[1], mapper), + methodName === "next" ? getMappedType(globalType.typeParameters[2], mapper) : void 0 + ); + } + } + let methodParameterTypes; + let methodReturnTypes; + for (const signature of methodSignatures) { + if (methodName !== "throw" && some2(signature.parameters)) { + methodParameterTypes = append(methodParameterTypes, getTypeAtPosition(signature, 0)); + } + methodReturnTypes = append(methodReturnTypes, getReturnTypeOfSignature(signature)); + } + let returnTypes; + let nextType; + if (methodName !== "throw") { + const methodParameterType = methodParameterTypes ? getUnionType(methodParameterTypes) : unknownType2; + if (methodName === "next") { + nextType = methodParameterType; + } else if (methodName === "return") { + const resolvedMethodParameterType = resolver.resolveIterationType(methodParameterType, errorNode) || anyType2; + returnTypes = append(returnTypes, resolvedMethodParameterType); + } + } + let yieldType; + const methodReturnType = methodReturnTypes ? getIntersectionType(methodReturnTypes) : neverType2; + const resolvedMethodReturnType = resolver.resolveIterationType(methodReturnType, errorNode) || anyType2; + const iterationTypes = getIterationTypesOfIteratorResult(resolvedMethodReturnType); + if (iterationTypes === noIterationTypes) { + if (errorNode) { + if (errorOutputContainer) { + errorOutputContainer.errors ?? (errorOutputContainer.errors = []); + errorOutputContainer.errors.push(createDiagnosticForNode(errorNode, resolver.mustHaveAValueDiagnostic, methodName)); + } else { + error22(errorNode, resolver.mustHaveAValueDiagnostic, methodName); + } + } + yieldType = anyType2; + returnTypes = append(returnTypes, anyType2); + } else { + yieldType = iterationTypes.yieldType; + returnTypes = append(returnTypes, iterationTypes.returnType); + } + return createIterationTypes(yieldType, getUnionType(returnTypes), nextType); + } + function getIterationTypesOfIteratorSlow(type3, resolver, errorNode, errorOutputContainer, noCache) { + const iterationTypes = combineIterationTypes([ + getIterationTypesOfMethod(type3, resolver, "next", errorNode, errorOutputContainer), + getIterationTypesOfMethod(type3, resolver, "return", errorNode, errorOutputContainer), + getIterationTypesOfMethod(type3, resolver, "throw", errorNode, errorOutputContainer) + ]); + return noCache ? iterationTypes : setCachedIterationTypes(type3, resolver.iteratorCacheKey, iterationTypes); + } + function getIterationTypeOfGeneratorFunctionReturnType(kind, returnType, isAsyncGenerator) { + if (isTypeAny(returnType)) { + return void 0; + } + const iterationTypes = getIterationTypesOfGeneratorFunctionReturnType(returnType, isAsyncGenerator); + return iterationTypes && iterationTypes[getIterationTypesKeyFromIterationTypeKind(kind)]; + } + function getIterationTypesOfGeneratorFunctionReturnType(type3, isAsyncGenerator) { + if (isTypeAny(type3)) { + return anyIterationTypes; + } + const use = isAsyncGenerator ? 2 : 1; + const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver; + return getIterationTypesOfIterable( + type3, + use, + /*errorNode*/ + void 0 + ) || getIterationTypesOfIterator( + type3, + resolver, + /*errorNode*/ + void 0, + /*errorOutputContainer*/ + void 0 + ); + } + function checkBreakOrContinueStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) + checkGrammarBreakOrContinueStatement(node); + } + function unwrapReturnType(returnType, functionFlags) { + const isGenerator = !!(functionFlags & 1); + const isAsync2 = !!(functionFlags & 2); + if (isGenerator) { + const returnIterationType = getIterationTypeOfGeneratorFunctionReturnType(1, returnType, isAsync2); + if (!returnIterationType) { + return errorType; + } + return isAsync2 ? getAwaitedTypeNoAlias(unwrapAwaitedType(returnIterationType)) : returnIterationType; + } + return isAsync2 ? getAwaitedTypeNoAlias(returnType) || errorType : returnType; + } + function isUnwrappedReturnTypeUndefinedVoidOrAny(func, returnType) { + const type3 = unwrapReturnType(returnType, getFunctionFlags(func)); + return !!(type3 && (maybeTypeOfKind( + type3, + 16384 + /* Void */ + ) || type3.flags & (1 | 32768))); + } + function checkReturnStatement(node) { + if (checkGrammarStatementInAmbientContext(node)) { + return; + } + const container = getContainingFunctionOrClassStaticBlock(node); + if (container && isClassStaticBlockDeclaration(container)) { + grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block); + return; + } + if (!container) { + grammarErrorOnFirstToken(node, Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + const signature = getSignatureFromDeclaration(container); + const returnType = getReturnTypeOfSignature(signature); + const functionFlags = getFunctionFlags(container); + if (strictNullChecks || node.expression || returnType.flags & 131072) { + const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType2; + if (container.kind === 178) { + if (node.expression) { + error22(node, Diagnostics.Setters_cannot_return_a_value); + } + } else if (container.kind === 176) { + if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType, returnType, node, node.expression)) { + error22(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } + } else if (getReturnTypeFromAnnotation(container)) { + const unwrappedReturnType = unwrapReturnType(returnType, functionFlags) ?? returnType; + const unwrappedExprType = functionFlags & 2 ? checkAwaitedType( + exprType, + /*withAlias*/ + false, + node, + Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + ) : exprType; + if (unwrappedReturnType) { + checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression); + } + } + } else if (container.kind !== 176 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) { + error22(node, Diagnostics.Not_all_code_paths_return_a_value); + } + } + function checkWithStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (node.flags & 65536) { + grammarErrorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_an_async_function_block); + } + } + checkExpression(node.expression); + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + const start = getSpanOfTokenAtPosition(sourceFile, node.pos).start; + const end = node.statement.pos; + grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any); + } + } + function checkSwitchStatement(node) { + checkGrammarStatementInAmbientContext(node); + let firstDefaultClause; + let hasDuplicateDefaultClause = false; + const expressionType = checkExpression(node.expression); + forEach4(node.caseBlock.clauses, (clause) => { + if (clause.kind === 297 && !hasDuplicateDefaultClause) { + if (firstDefaultClause === void 0) { + firstDefaultClause = clause; + } else { + grammarErrorOnNode(clause, Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); + hasDuplicateDefaultClause = true; + } + } + if (clause.kind === 296) { + addLazyDiagnostic(createLazyCaseClauseDiagnostics(clause)); + } + forEach4(clause.statements, checkSourceElement); + if (compilerOptions.noFallthroughCasesInSwitch && clause.fallthroughFlowNode && isReachableFlowNode(clause.fallthroughFlowNode)) { + error22(clause, Diagnostics.Fallthrough_case_in_switch); + } + function createLazyCaseClauseDiagnostics(clause2) { + return () => { + const caseType = checkExpression(clause2.expression); + if (!isTypeEqualityComparableTo(expressionType, caseType)) { + checkTypeComparableTo( + caseType, + expressionType, + clause2.expression, + /*headMessage*/ + void 0 + ); + } + }; + } + }); + if (node.caseBlock.locals) { + registerForUnusedIdentifiersCheck(node.caseBlock); + } + } + function checkLabeledStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + findAncestor(node.parent, (current) => { + if (isFunctionLike(current)) { + return "quit"; + } + if (current.kind === 256 && current.label.escapedText === node.label.escapedText) { + grammarErrorOnNode(node.label, Diagnostics.Duplicate_label_0, getTextOfNode(node.label)); + return true; + } + return false; + }); + } + checkSourceElement(node.statement); + } + function checkThrowStatement(node) { + if (!checkGrammarStatementInAmbientContext(node)) { + if (isIdentifier(node.expression) && !node.expression.escapedText) { + grammarErrorAfterFirstToken(node, Diagnostics.Line_break_not_permitted_here); + } + } + if (node.expression) { + checkExpression(node.expression); + } + } + function checkTryStatement(node) { + checkGrammarStatementInAmbientContext(node); + checkBlock(node.tryBlock); + const catchClause = node.catchClause; + if (catchClause) { + if (catchClause.variableDeclaration) { + const declaration = catchClause.variableDeclaration; + checkVariableLikeDeclaration(declaration); + const typeNode = getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + const type3 = getTypeFromTypeNode(typeNode); + if (type3 && !(type3.flags & 3)) { + grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified); + } + } else if (declaration.initializer) { + grammarErrorOnFirstToken(declaration.initializer, Diagnostics.Catch_clause_variable_cannot_have_an_initializer); + } else { + const blockLocals = catchClause.block.locals; + if (blockLocals) { + forEachKey(catchClause.locals, (caughtName) => { + const blockLocal = blockLocals.get(caughtName); + if ((blockLocal == null ? void 0 : blockLocal.valueDeclaration) && (blockLocal.flags & 2) !== 0) { + grammarErrorOnNode(blockLocal.valueDeclaration, Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, unescapeLeadingUnderscores(caughtName)); + } + }); + } + } + } + checkBlock(catchClause.block); + } + if (node.finallyBlock) { + checkBlock(node.finallyBlock); + } + } + function checkIndexConstraints(type3, symbol, isStaticIndex) { + const indexInfos = getIndexInfosOfType(type3); + if (indexInfos.length === 0) { + return; + } + for (const prop of getPropertiesOfObjectType(type3)) { + if (!(isStaticIndex && prop.flags & 4194304)) { + checkIndexConstraintForProperty(type3, prop, getLiteralTypeFromProperty( + prop, + 8576, + /*includeNonPublic*/ + true + ), getNonMissingTypeOfSymbol(prop)); + } + } + const typeDeclaration = symbol.valueDeclaration; + if (typeDeclaration && isClassLike(typeDeclaration)) { + for (const member of typeDeclaration.members) { + if (!isStatic(member) && !hasBindableName(member)) { + const symbol2 = getSymbolOfDeclaration(member); + checkIndexConstraintForProperty(type3, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2)); + } + } + } + if (indexInfos.length > 1) { + for (const info2 of indexInfos) { + checkIndexConstraintForIndexSignature(type3, info2); + } + } + } + function checkIndexConstraintForProperty(type3, prop, propNameType, propType) { + const declaration = prop.valueDeclaration; + const name2 = getNameOfDeclaration(declaration); + if (name2 && isPrivateIdentifier(name2)) { + return; + } + const indexInfos = getApplicableIndexInfos(type3, propNameType); + const interfaceDeclaration = getObjectFlags(type3) & 2 ? getDeclarationOfKind( + type3.symbol, + 264 + /* InterfaceDeclaration */ + ) : void 0; + const propDeclaration = declaration && declaration.kind === 226 || name2 && name2.kind === 167 ? declaration : void 0; + const localPropDeclaration = getParentOfSymbol(prop) === type3.symbol ? declaration : void 0; + for (const info2 of indexInfos) { + const localIndexDeclaration = info2.declaration && getParentOfSymbol(getSymbolOfDeclaration(info2.declaration)) === type3.symbol ? info2.declaration : void 0; + const errorNode = localPropDeclaration || localIndexDeclaration || (interfaceDeclaration && !some2(getBaseTypes(type3), (base) => !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info2.keyType)) ? interfaceDeclaration : void 0); + if (errorNode && !isTypeAssignableTo(propType, info2.type)) { + const diagnostic = createError(errorNode, Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString2(prop), typeToString(propType), typeToString(info2.keyType), typeToString(info2.type)); + if (propDeclaration && errorNode !== propDeclaration) { + addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here, symbolToString2(prop))); + } + diagnostics.add(diagnostic); + } + } + } + function checkIndexConstraintForIndexSignature(type3, checkInfo) { + const declaration = checkInfo.declaration; + const indexInfos = getApplicableIndexInfos(type3, checkInfo.keyType); + const interfaceDeclaration = getObjectFlags(type3) & 2 ? getDeclarationOfKind( + type3.symbol, + 264 + /* InterfaceDeclaration */ + ) : void 0; + const localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfDeclaration(declaration)) === type3.symbol ? declaration : void 0; + for (const info2 of indexInfos) { + if (info2 === checkInfo) + continue; + const localIndexDeclaration = info2.declaration && getParentOfSymbol(getSymbolOfDeclaration(info2.declaration)) === type3.symbol ? info2.declaration : void 0; + const errorNode = localCheckDeclaration || localIndexDeclaration || (interfaceDeclaration && !some2(getBaseTypes(type3), (base) => !!getIndexInfoOfType(base, checkInfo.keyType) && !!getIndexTypeOfType(base, info2.keyType)) ? interfaceDeclaration : void 0); + if (errorNode && !isTypeAssignableTo(checkInfo.type, info2.type)) { + error22(errorNode, Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info2.keyType), typeToString(info2.type)); + } + } + } + function checkTypeNameIsReserved(name2, message) { + switch (name2.escapedText) { + case "any": + case "unknown": + case "never": + case "number": + case "bigint": + case "boolean": + case "string": + case "symbol": + case "void": + case "object": + error22(name2, message, name2.escapedText); + } + } + function checkClassNameCollisionWithObject(name2) { + if (languageVersion >= 1 && name2.escapedText === "Object" && (moduleKind < 5 || getSourceFileOfNode(name2).impliedNodeFormat === 1)) { + error22(name2, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]); + } + } + function checkUnmatchedJSDocParameters(node) { + const jsdocParameters = filter2(getJSDocTags(node), isJSDocParameterTag); + if (!length(jsdocParameters)) + return; + const isJs = isInJSFile(node); + const parameters = /* @__PURE__ */ new Set(); + const excludedParameters = /* @__PURE__ */ new Set(); + forEach4(node.parameters, ({ name: name2 }, index4) => { + if (isIdentifier(name2)) { + parameters.add(name2.escapedText); + } + if (isBindingPattern(name2)) { + excludedParameters.add(index4); + } + }); + const containsArguments = containsArgumentsReference(node); + if (containsArguments) { + const lastJSDocParamIndex = jsdocParameters.length - 1; + const lastJSDocParam = jsdocParameters[lastJSDocParamIndex]; + if (isJs && lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression && lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !excludedParameters.has(lastJSDocParamIndex) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) { + error22(lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name)); + } + } else { + forEach4(jsdocParameters, ({ name: name2, isNameFirst }, index4) => { + if (excludedParameters.has(index4) || isIdentifier(name2) && parameters.has(name2.escapedText)) { + return; + } + if (isQualifiedName(name2)) { + if (isJs) { + error22(name2, Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, entityNameToString(name2), entityNameToString(name2.left)); + } + } else { + if (!isNameFirst) { + errorOrSuggestion(isJs, name2, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, idText(name2)); + } + } + }); + } + } + function checkTypeParameters(typeParameterDeclarations) { + let seenDefault = false; + if (typeParameterDeclarations) { + for (let i7 = 0; i7 < typeParameterDeclarations.length; i7++) { + const node = typeParameterDeclarations[i7]; + checkTypeParameter(node); + addLazyDiagnostic(createCheckTypeParameterDiagnostic(node, i7)); + } + } + function createCheckTypeParameterDiagnostic(node, i7) { + return () => { + if (node.default) { + seenDefault = true; + checkTypeParametersNotReferenced(node.default, typeParameterDeclarations, i7); + } else if (seenDefault) { + error22(node, Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters); + } + for (let j6 = 0; j6 < i7; j6++) { + if (typeParameterDeclarations[j6].symbol === node.symbol) { + error22(node.name, Diagnostics.Duplicate_identifier_0, declarationNameToString(node.name)); + } + } + }; + } + } + function checkTypeParametersNotReferenced(root2, typeParameters, index4) { + visit7(root2); + function visit7(node) { + if (node.kind === 183) { + const type3 = getTypeFromTypeReference(node); + if (type3.flags & 262144) { + for (let i7 = index4; i7 < typeParameters.length; i7++) { + if (type3.symbol === getSymbolOfDeclaration(typeParameters[i7])) { + error22(node, Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters); + } + } + } + } + forEachChild(node, visit7); + } + } + function checkTypeParameterListsIdentical(symbol) { + if (symbol.declarations && symbol.declarations.length === 1) { + return; + } + const links = getSymbolLinks(symbol); + if (!links.typeParametersChecked) { + links.typeParametersChecked = true; + const declarations = getClassOrInterfaceDeclarationsOfSymbol(symbol); + if (!declarations || declarations.length <= 1) { + return; + } + const type3 = getDeclaredTypeOfSymbol(symbol); + if (!areTypeParametersIdentical(declarations, type3.localTypeParameters, getEffectiveTypeParameterDeclarations)) { + const name2 = symbolToString2(symbol); + for (const declaration of declarations) { + error22(declaration.name, Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name2); + } + } + } + } + function areTypeParametersIdentical(declarations, targetParameters, getTypeParameterDeclarations) { + const maxTypeArgumentCount = length(targetParameters); + const minTypeArgumentCount = getMinTypeArgumentCount(targetParameters); + for (const declaration of declarations) { + const sourceParameters = getTypeParameterDeclarations(declaration); + const numTypeParameters = sourceParameters.length; + if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) { + return false; + } + for (let i7 = 0; i7 < numTypeParameters; i7++) { + const source = sourceParameters[i7]; + const target = targetParameters[i7]; + if (source.name.escapedText !== target.symbol.escapedName) { + return false; + } + const constraint = getEffectiveConstraintOfTypeParameter(source); + const sourceConstraint = constraint && getTypeFromTypeNode(constraint); + const targetConstraint = getConstraintOfTypeParameter(target); + if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } + const sourceDefault = source.default && getTypeFromTypeNode(source.default); + const targetDefault = getDefaultFromTypeParameter(target); + if (sourceDefault && targetDefault && !isTypeIdenticalTo(sourceDefault, targetDefault)) { + return false; + } + } + } + return true; + } + function getFirstTransformableStaticClassElement(node) { + const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9; + const willTransformInitializers = !emitStandardClassFields; + if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) { + for (const member of node.members) { + if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + return firstOrUndefined(getDecorators(node)) ?? node; + } else if (willTransformPrivateElementsOrClassStaticBlocks) { + if (isClassStaticBlockDeclaration(member)) { + return member; + } else if (isStatic(member)) { + if (isPrivateIdentifierClassElementDeclaration(member) || willTransformInitializers && isInitializedProperty(member)) { + return member; + } + } + } + } + } + } + function checkClassExpressionExternalHelpers(node) { + if (node.name) + return; + const parent22 = walkUpOuterExpressions(node); + if (!isNamedEvaluationSource(parent22)) + return; + const willTransformESDecorators = !legacyDecorators && languageVersion < 99; + let location2; + if (willTransformESDecorators && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + location2 = firstOrUndefined(getDecorators(node)) ?? node; + } else { + location2 = getFirstTransformableStaticClassElement(node); + } + if (location2) { + checkExternalEmitHelpers( + location2, + 8388608 + /* SetFunctionName */ + ); + if ((isPropertyAssignment(parent22) || isPropertyDeclaration(parent22) || isBindingElement(parent22)) && isComputedPropertyName(parent22.name)) { + checkExternalEmitHelpers( + location2, + 16777216 + /* PropKey */ + ); + } + } + } + function checkClassExpression(node) { + checkClassLikeDeclaration(node); + checkNodeDeferred(node); + checkClassExpressionExternalHelpers(node); + return getTypeOfSymbol(getSymbolOfDeclaration(node)); + } + function checkClassExpressionDeferred(node) { + forEach4(node.members, checkSourceElement); + registerForUnusedIdentifiersCheck(node); + } + function checkClassDeclaration(node) { + const firstDecorator = find2(node.modifiers, isDecorator); + if (legacyDecorators && firstDecorator && some2(node.members, (p7) => hasStaticModifier(p7) && isPrivateIdentifierClassElementDeclaration(p7))) { + grammarErrorOnNode(firstDecorator, Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator); + } + if (!node.name && !hasSyntacticModifier( + node, + 2048 + /* Default */ + )) { + grammarErrorOnFirstToken(node, Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); + } + checkClassLikeDeclaration(node); + forEach4(node.members, checkSourceElement); + registerForUnusedIdentifiersCheck(node); + } + function checkClassLikeDeclaration(node) { + checkGrammarClassLikeDeclaration(node); + checkDecorators(node); + checkCollisionsForDeclarationName(node, node.name); + checkTypeParameters(getEffectiveTypeParameterDeclarations(node)); + checkExportsOnMergedDeclarations(node); + const symbol = getSymbolOfDeclaration(node); + const type3 = getDeclaredTypeOfSymbol(symbol); + const typeWithThis = getTypeWithThisArgument(type3); + const staticType = getTypeOfSymbol(symbol); + checkTypeParameterListsIdentical(symbol); + checkFunctionOrConstructorSymbol(symbol); + checkClassForDuplicateDeclarations(node); + const nodeInAmbientContext = !!(node.flags & 33554432); + if (!nodeInAmbientContext) { + checkClassForStaticPropertyNameConflicts(node); + } + const baseTypeNode = getEffectiveBaseTypeNode(node); + if (baseTypeNode) { + forEach4(baseTypeNode.typeArguments, checkSourceElement); + if (languageVersion < 2) { + checkExternalEmitHelpers( + baseTypeNode.parent, + 1 + /* Extends */ + ); + } + const extendsNode = getClassExtendsHeritageElement(node); + if (extendsNode && extendsNode !== baseTypeNode) { + checkExpression(extendsNode.expression); + } + const baseTypes = getBaseTypes(type3); + if (baseTypes.length) { + addLazyDiagnostic(() => { + const baseType = baseTypes[0]; + const baseConstructorType = getBaseConstructorTypeOfClass(type3); + const staticBaseType = getApparentType(baseConstructorType); + checkBaseTypeAccessibility(staticBaseType, baseTypeNode); + checkSourceElement(baseTypeNode.expression); + if (some2(baseTypeNode.typeArguments)) { + forEach4(baseTypeNode.typeArguments, checkSourceElement); + for (const constructor of getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { + break; + } + } + } + const baseWithThis = getTypeWithThisArgument(baseType, type3.thisType); + if (!checkTypeAssignableTo( + typeWithThis, + baseWithThis, + /*errorNode*/ + void 0 + )) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, Diagnostics.Class_0_incorrectly_extends_base_class_1); + } else { + checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); + } + if (baseConstructorType.flags & 8650752) { + if (!isMixinConstructorType(staticType)) { + error22(node.name || node, Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); + } else { + const constructSignatures = getSignaturesOfType( + baseConstructorType, + 1 + /* Construct */ + ); + if (constructSignatures.some( + (signature) => signature.flags & 4 + /* Abstract */ + ) && !hasSyntacticModifier( + node, + 64 + /* Abstract */ + )) { + error22(node.name || node, Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract); + } + } + } + if (!(staticBaseType.symbol && staticBaseType.symbol.flags & 32) && !(baseConstructorType.flags & 8650752)) { + const constructors = getInstantiatedConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); + if (forEach4(constructors, (sig) => !isJSConstructor(sig.declaration) && !isTypeIdenticalTo(getReturnTypeOfSignature(sig), baseType))) { + error22(baseTypeNode.expression, Diagnostics.Base_constructors_must_all_have_the_same_return_type); + } + } + checkKindsOfPropertyMemberOverrides(type3, baseType); + }); + } + } + checkMembersForOverrideModifier(node, type3, typeWithThis, staticType); + const implementedTypeNodes = getEffectiveImplementsTypeNodes(node); + if (implementedTypeNodes) { + for (const typeRefNode of implementedTypeNodes) { + if (!isEntityNameExpression(typeRefNode.expression) || isOptionalChain(typeRefNode.expression)) { + error22(typeRefNode.expression, Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkTypeReferenceNode(typeRefNode); + addLazyDiagnostic(createImplementsDiagnostics(typeRefNode)); + } + } + addLazyDiagnostic(() => { + checkIndexConstraints(type3, symbol); + checkIndexConstraints( + staticType, + symbol, + /*isStaticIndex*/ + true + ); + checkTypeForDuplicateIndexSignatures(node); + checkPropertyInitialization(node); + }); + function createImplementsDiagnostics(typeRefNode) { + return () => { + const t8 = getReducedType(getTypeFromTypeNode(typeRefNode)); + if (!isErrorType(t8)) { + if (isValidBaseType(t8)) { + const genericDiag = t8.symbol && t8.symbol.flags & 32 ? Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : Diagnostics.Class_0_incorrectly_implements_interface_1; + const baseWithThis = getTypeWithThisArgument(t8, type3.thisType); + if (!checkTypeAssignableTo( + typeWithThis, + baseWithThis, + /*errorNode*/ + void 0 + )) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } + } else { + error22(typeRefNode, Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members); + } + } + }; + } + } + function checkMembersForOverrideModifier(node, type3, typeWithThis, staticType) { + const baseTypeNode = getEffectiveBaseTypeNode(node); + const baseTypes = baseTypeNode && getBaseTypes(type3); + const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type3.thisType) : void 0; + const baseStaticType = getBaseConstructorTypeOfClass(type3); + for (const member of node.members) { + if (hasAmbientModifier(member)) { + continue; + } + if (isConstructorDeclaration(member)) { + forEach4(member.parameters, (param) => { + if (isParameterPropertyDeclaration(param, member)) { + checkExistingMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + param, + /*memberIsParameterProperty*/ + true + ); + } + }); + } + checkExistingMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + member, + /*memberIsParameterProperty*/ + false + ); + } + } + function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type3, typeWithThis, member, memberIsParameterProperty, reportErrors2 = true) { + const declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (!declaredProp) { + return 0; + } + return checkMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + hasOverrideModifier(member), + hasAbstractModifier(member), + isStatic(member), + memberIsParameterProperty, + symbolName(declaredProp), + reportErrors2 ? member : void 0 + ); + } + function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type3, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, memberName, errorNode) { + const isJs = isInJSFile(node); + const nodeInAmbientContext = !!(node.flags & 33554432); + if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) { + const memberEscapedName = escapeLeadingUnderscores(memberName); + const thisType = memberIsStatic ? staticType : typeWithThis; + const baseType = memberIsStatic ? baseStaticType : baseWithThis; + const prop = getPropertyOfType(thisType, memberEscapedName); + const baseProp = getPropertyOfType(baseType, memberEscapedName); + const baseClassName = typeToString(baseWithThis); + if (prop && !baseProp && memberHasOverrideModifier) { + if (errorNode) { + const suggestion = getSuggestedSymbolForNonexistentClassMember(memberName, baseType); + suggestion ? error22( + errorNode, + isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, + baseClassName, + symbolToString2(suggestion) + ) : error22( + errorNode, + isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, + baseClassName + ); + } + return 2; + } else if (prop && (baseProp == null ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) { + const baseHasAbstract = some2(baseProp.declarations, hasAbstractModifier); + if (memberHasOverrideModifier) { + return 0; + } + if (!baseHasAbstract) { + if (errorNode) { + const diag2 = memberIsParameterProperty ? isJs ? Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 : isJs ? Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 : Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0; + error22(errorNode, diag2, baseClassName); + } + return 1; + } else if (memberHasAbstractModifier && baseHasAbstract) { + if (errorNode) { + error22(errorNode, Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0, baseClassName); + } + return 1; + } + } + } else if (memberHasOverrideModifier) { + if (errorNode) { + const className = typeToString(type3); + error22( + errorNode, + isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, + className + ); + } + return 2; + } + return 0; + } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + let issuedMemberError = false; + for (const member of node.members) { + if (isStatic(member)) { + continue; + } + const declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + const prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + const baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + const rootChain = () => chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, + symbolToString2(declaredProp), + typeToString(typeWithThis), + typeToString(baseWithThis) + ); + if (!checkTypeAssignableTo( + getTypeOfSymbol(prop), + getTypeOfSymbol(baseProp), + member.name || member, + /*headMessage*/ + void 0, + rootChain + )) { + issuedMemberError = true; + } + } + } + } + if (!issuedMemberError) { + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } + function checkBaseTypeAccessibility(type3, node) { + const signatures = getSignaturesOfType( + type3, + 1 + /* Construct */ + ); + if (signatures.length) { + const declaration = signatures[0].declaration; + if (declaration && hasEffectiveModifier( + declaration, + 2 + /* Private */ + )) { + const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type3.symbol); + if (!isNodeWithinClass(node, typeClassDeclaration)) { + error22(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName2(type3.symbol)); + } + } + } + } + function getMemberOverrideModifierStatus(node, member, memberSymbol) { + if (!member.name) { + return 0; + } + const classSymbol = getSymbolOfDeclaration(node); + const type3 = getDeclaredTypeOfSymbol(classSymbol); + const typeWithThis = getTypeWithThisArgument(type3); + const staticType = getTypeOfSymbol(classSymbol); + const baseTypeNode = getEffectiveBaseTypeNode(node); + const baseTypes = baseTypeNode && getBaseTypes(type3); + const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type3.thisType) : void 0; + const baseStaticType = getBaseConstructorTypeOfClass(type3); + const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier( + member, + 16 + /* Override */ + ); + return checkMemberForOverrideModifier( + node, + staticType, + baseStaticType, + baseWithThis, + type3, + typeWithThis, + memberHasOverrideModifier, + hasAbstractModifier(member), + isStatic(member), + /*memberIsParameterProperty*/ + false, + symbolName(memberSymbol) + ); + } + function getTargetSymbol(s7) { + return getCheckFlags(s7) & 1 ? s7.links.target : s7; + } + function getClassOrInterfaceDeclarationsOfSymbol(symbol) { + return filter2( + symbol.declarations, + (d7) => d7.kind === 263 || d7.kind === 264 + /* InterfaceDeclaration */ + ); + } + function checkKindsOfPropertyMemberOverrides(type3, baseType) { + var _a2, _b, _c, _d; + const baseProperties = getPropertiesOfType(baseType); + let inheritedAbstractMemberNotImplementedError; + basePropertyCheck: + for (const baseProperty2 of baseProperties) { + const base = getTargetSymbol(baseProperty2); + if (base.flags & 4194304) { + continue; + } + const baseSymbol = getPropertyOfObjectType(type3, base.escapedName); + if (!baseSymbol) { + continue; + } + const derived = getTargetSymbol(baseSymbol); + const baseDeclarationFlags = getDeclarationModifierFlagsFromSymbol(base); + Debug.assert(!!derived, "derived should point to something, even if it is the base class' declaration."); + if (derived === base) { + const derivedClassDecl = getClassLikeDeclarationOfSymbol(type3.symbol); + if (baseDeclarationFlags & 64 && (!derivedClassDecl || !hasSyntacticModifier( + derivedClassDecl, + 64 + /* Abstract */ + ))) { + for (const otherBaseType of getBaseTypes(type3)) { + if (otherBaseType === baseType) + continue; + const baseSymbol2 = getPropertyOfObjectType(otherBaseType, base.escapedName); + const derivedElsewhere = baseSymbol2 && getTargetSymbol(baseSymbol2); + if (derivedElsewhere && derivedElsewhere !== base) { + continue basePropertyCheck; + } + } + if (!inheritedAbstractMemberNotImplementedError) { + inheritedAbstractMemberNotImplementedError = error22( + derivedClassDecl, + Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1, + typeToString(type3), + typeToString(baseType) + ); + } + if (derivedClassDecl.kind === 231) { + addRelatedInfo( + inheritedAbstractMemberNotImplementedError, + createDiagnosticForNode( + baseProperty2.valueDeclaration ?? (baseProperty2.declarations && first(baseProperty2.declarations)) ?? derivedClassDecl, + Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, + symbolToString2(baseProperty2), + typeToString(baseType) + ) + ); + } else { + addRelatedInfo( + inheritedAbstractMemberNotImplementedError, + createDiagnosticForNode( + baseProperty2.valueDeclaration ?? (baseProperty2.declarations && first(baseProperty2.declarations)) ?? derivedClassDecl, + Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, + typeToString(type3), + symbolToString2(baseProperty2), + typeToString(baseType) + ) + ); + } + } + } else { + const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived); + if (baseDeclarationFlags & 2 || derivedDeclarationFlags & 2) { + continue; + } + let errorMessage; + const basePropertyFlags = base.flags & 98308; + const derivedPropertyFlags = derived.flags & 98308; + if (basePropertyFlags && derivedPropertyFlags) { + if ((getCheckFlags(base) & 6 ? (_a2 = base.declarations) == null ? void 0 : _a2.some((d7) => isPropertyAbstractOrInterface(d7, baseDeclarationFlags)) : (_b = base.declarations) == null ? void 0 : _b.every((d7) => isPropertyAbstractOrInterface(d7, baseDeclarationFlags))) || getCheckFlags(base) & 262144 || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) { + continue; + } + const overriddenInstanceProperty = basePropertyFlags !== 4 && derivedPropertyFlags === 4; + const overriddenInstanceAccessor = basePropertyFlags === 4 && derivedPropertyFlags !== 4; + if (overriddenInstanceProperty || overriddenInstanceAccessor) { + const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor; + error22(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString2(base), typeToString(baseType), typeToString(type3)); + } else if (useDefineForClassFields) { + const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d7) => d7.kind === 172 && !d7.initializer); + if (uninitialized && !(derived.flags & 33554432) && !(baseDeclarationFlags & 64) && !(derivedDeclarationFlags & 64) && !((_d = derived.declarations) == null ? void 0 : _d.some((d7) => !!(d7.flags & 33554432)))) { + const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type3.symbol)); + const propName2 = uninitialized.name; + if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName2) || !strictNullChecks || !isPropertyInitializedInConstructor(propName2, type3, constructor)) { + const errorMessage2 = Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration; + error22(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString2(base), typeToString(baseType)); + } + } + } + continue; + } else if (isPrototypeProperty(base)) { + if (isPrototypeProperty(derived) || derived.flags & 4) { + continue; + } else { + Debug.assert(!!(derived.flags & 98304)); + errorMessage = Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; + } + } else if (base.flags & 98304) { + errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; + } else { + errorMessage = Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; + } + error22(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString2(base), typeToString(type3)); + } + } + } + function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) { + return baseDeclarationFlags & 64 && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent); + } + function getNonInheritedProperties(type3, baseTypes, properties) { + if (!length(baseTypes)) { + return properties; + } + const seen = /* @__PURE__ */ new Map(); + forEach4(properties, (p7) => { + seen.set(p7.escapedName, p7); + }); + for (const base of baseTypes) { + const properties2 = getPropertiesOfType(getTypeWithThisArgument(base, type3.thisType)); + for (const prop of properties2) { + const existing = seen.get(prop.escapedName); + if (existing && prop.parent === existing.parent) { + seen.delete(prop.escapedName); + } + } + } + return arrayFrom(seen.values()); + } + function checkInheritedPropertiesAreIdentical(type3, typeNode) { + const baseTypes = getBaseTypes(type3); + if (baseTypes.length < 2) { + return true; + } + const seen = /* @__PURE__ */ new Map(); + forEach4(resolveDeclaredMembers(type3).declaredProperties, (p7) => { + seen.set(p7.escapedName, { prop: p7, containingType: type3 }); + }); + let ok2 = true; + for (const base of baseTypes) { + const properties = getPropertiesOfType(getTypeWithThisArgument(base, type3.thisType)); + for (const prop of properties) { + const existing = seen.get(prop.escapedName); + if (!existing) { + seen.set(prop.escapedName, { prop, containingType: base }); + } else { + const isInheritedProperty = existing.containingType !== type3; + if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { + ok2 = false; + const typeName1 = typeToString(existing.containingType); + const typeName2 = typeToString(base); + let errorInfo = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, + symbolToString2(prop), + typeName1, + typeName2 + ); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type3), typeName1, typeName2); + diagnostics.add(createDiagnosticForNodeFromMessageChain(getSourceFileOfNode(typeNode), typeNode, errorInfo)); + } + } + } + } + return ok2; + } + function checkPropertyInitialization(node) { + if (!strictNullChecks || !strictPropertyInitialization || node.flags & 33554432) { + return; + } + const constructor = findConstructorDeclaration(node); + for (const member of node.members) { + if (getEffectiveModifierFlags(member) & 128) { + continue; + } + if (!isStatic(member) && isPropertyWithoutInitializer(member)) { + const propName2 = member.name; + if (isIdentifier(propName2) || isPrivateIdentifier(propName2) || isComputedPropertyName(propName2)) { + const type3 = getTypeOfSymbol(getSymbolOfDeclaration(member)); + if (!(type3.flags & 3 || containsUndefinedType(type3))) { + if (!constructor || !isPropertyInitializedInConstructor(propName2, type3, constructor)) { + error22(member.name, Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor, declarationNameToString(propName2)); + } + } + } + } + } + } + function isPropertyWithoutInitializer(node) { + return node.kind === 172 && !hasAbstractModifier(node) && !node.exclamationToken && !node.initializer; + } + function isPropertyInitializedInStaticBlocks(propName2, propType, staticBlocks, startPos, endPos) { + for (const staticBlock of staticBlocks) { + if (staticBlock.pos >= startPos && staticBlock.pos <= endPos) { + const reference = factory.createPropertyAccessExpression(factory.createThis(), propName2); + setParent(reference.expression, reference); + setParent(reference, staticBlock); + reference.flowNode = staticBlock.returnFlowNode; + const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); + if (!containsUndefinedType(flowType)) { + return true; + } + } + } + return false; + } + function isPropertyInitializedInConstructor(propName2, propType, constructor) { + const reference = isComputedPropertyName(propName2) ? factory.createElementAccessExpression(factory.createThis(), propName2.expression) : factory.createPropertyAccessExpression(factory.createThis(), propName2); + setParent(reference.expression, reference); + setParent(reference, constructor); + reference.flowNode = constructor.returnFlowNode; + const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); + return !containsUndefinedType(flowType); + } + function checkInterfaceDeclaration(node) { + if (!checkGrammarModifiers(node)) + checkGrammarInterfaceDeclaration(node); + checkTypeParameters(node.typeParameters); + addLazyDiagnostic(() => { + checkTypeNameIsReserved(node.name, Diagnostics.Interface_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + const symbol = getSymbolOfDeclaration(node); + checkTypeParameterListsIdentical(symbol); + const firstInterfaceDecl = getDeclarationOfKind( + symbol, + 264 + /* InterfaceDeclaration */ + ); + if (node === firstInterfaceDecl) { + const type3 = getDeclaredTypeOfSymbol(symbol); + const typeWithThis = getTypeWithThisArgument(type3); + if (checkInheritedPropertiesAreIdentical(type3, node.name)) { + for (const baseType of getBaseTypes(type3)) { + checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType, type3.thisType), node.name, Diagnostics.Interface_0_incorrectly_extends_interface_1); + } + checkIndexConstraints(type3, symbol); + } + } + checkObjectTypeForDuplicateDeclarations(node); + }); + forEach4(getInterfaceBaseTypeNodes(node), (heritageElement) => { + if (!isEntityNameExpression(heritageElement.expression) || isOptionalChain(heritageElement.expression)) { + error22(heritageElement.expression, Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); + } + checkTypeReferenceNode(heritageElement); + }); + forEach4(node.members, checkSourceElement); + addLazyDiagnostic(() => { + checkTypeForDuplicateIndexSignatures(node); + registerForUnusedIdentifiersCheck(node); + }); + } + function checkTypeAliasDeclaration(node) { + checkGrammarModifiers(node); + checkTypeNameIsReserved(node.name, Diagnostics.Type_alias_name_cannot_be_0); + checkExportsOnMergedDeclarations(node); + checkTypeParameters(node.typeParameters); + if (node.type.kind === 141) { + if (!intrinsicTypeKinds.has(node.name.escapedText) || length(node.typeParameters) !== 1) { + error22(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types); + } + } else { + checkSourceElement(node.type); + registerForUnusedIdentifiersCheck(node); + } + } + function computeEnumMemberValues(node) { + const nodeLinks2 = getNodeLinks(node); + if (!(nodeLinks2.flags & 1024)) { + nodeLinks2.flags |= 1024; + let autoValue = 0; + for (const member of node.members) { + const value2 = computeMemberValue(member, autoValue); + getNodeLinks(member).enumMemberValue = value2; + autoValue = typeof value2 === "number" ? value2 + 1 : void 0; + } + } + } + function computeMemberValue(member, autoValue) { + if (isComputedNonLiteralName(member.name)) { + error22(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); + } else { + const text = getTextOfPropertyName(member.name); + if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { + error22(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); + } + } + if (member.initializer) { + return computeConstantValue(member); + } + if (member.parent.flags & 33554432 && !isEnumConst(member.parent)) { + return void 0; + } + if (autoValue !== void 0) { + return autoValue; + } + error22(member.name, Diagnostics.Enum_member_must_have_initializer); + return void 0; + } + function computeConstantValue(member) { + const isConstEnum = isEnumConst(member.parent); + const initializer = member.initializer; + const value2 = evaluate(initializer, member); + if (value2 !== void 0) { + if (isConstEnum && typeof value2 === "number" && !isFinite(value2)) { + error22( + initializer, + isNaN(value2) ? Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN : Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value + ); + } + } else if (isConstEnum) { + error22(initializer, Diagnostics.const_enum_member_initializers_must_be_constant_expressions); + } else if (member.parent.flags & 33554432) { + error22(initializer, Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression); + } else { + checkTypeAssignableTo(checkExpression(initializer), numberType2, initializer, Diagnostics.Type_0_is_not_assignable_to_type_1_as_required_for_computed_enum_member_values); + } + return value2; + } + function evaluate(expr, location2) { + switch (expr.kind) { + case 224: + const value2 = evaluate(expr.operand, location2); + if (typeof value2 === "number") { + switch (expr.operator) { + case 40: + return value2; + case 41: + return -value2; + case 55: + return ~value2; + } + } + break; + case 226: + const left = evaluate(expr.left, location2); + const right = evaluate(expr.right, location2); + if (typeof left === "number" && typeof right === "number") { + switch (expr.operatorToken.kind) { + case 52: + return left | right; + case 51: + return left & right; + case 49: + return left >> right; + case 50: + return left >>> right; + case 48: + return left << right; + case 53: + return left ^ right; + case 42: + return left * right; + case 44: + return left / right; + case 40: + return left + right; + case 41: + return left - right; + case 45: + return left % right; + case 43: + return left ** right; + } + } else if ((typeof left === "string" || typeof left === "number") && (typeof right === "string" || typeof right === "number") && expr.operatorToken.kind === 40) { + return "" + left + right; + } + break; + case 11: + case 15: + return expr.text; + case 228: + return evaluateTemplateExpression(expr, location2); + case 9: + checkGrammarNumericLiteral(expr); + return +expr.text; + case 217: + return evaluate(expr.expression, location2); + case 80: { + const identifier = expr; + if (isInfinityOrNaNString(identifier.escapedText) && resolveEntityName( + identifier, + 111551, + /*ignoreErrors*/ + true + ) === getGlobalSymbol( + identifier.escapedText, + 111551, + /*diagnostic*/ + void 0 + )) { + return +identifier.escapedText; + } + } + case 211: + if (isEntityNameExpression(expr)) { + const symbol = resolveEntityName( + expr, + 111551, + /*ignoreErrors*/ + true + ); + if (symbol) { + if (symbol.flags & 8) { + return location2 ? evaluateEnumMember(expr, symbol, location2) : getEnumMemberValue(symbol.valueDeclaration); + } + if (isConstantVariable(symbol)) { + const declaration = symbol.valueDeclaration; + if (declaration && isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && (!location2 || declaration !== location2 && isBlockScopedNameDeclaredBeforeUse(declaration, location2))) { + return evaluate(declaration.initializer, declaration); + } + } + } + } + break; + case 212: + const root2 = expr.expression; + if (isEntityNameExpression(root2) && isStringLiteralLike(expr.argumentExpression)) { + const rootSymbol = resolveEntityName( + root2, + 111551, + /*ignoreErrors*/ + true + ); + if (rootSymbol && rootSymbol.flags & 384) { + const name2 = escapeLeadingUnderscores(expr.argumentExpression.text); + const member = rootSymbol.exports.get(name2); + if (member) { + return location2 ? evaluateEnumMember(expr, member, location2) : getEnumMemberValue(member.valueDeclaration); + } + } + } + break; + } + return void 0; + } + function evaluateEnumMember(expr, symbol, location2) { + const declaration = symbol.valueDeclaration; + if (!declaration || declaration === location2) { + error22(expr, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString2(symbol)); + return void 0; + } + if (!isBlockScopedNameDeclaredBeforeUse(declaration, location2)) { + error22(expr, Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums); + return 0; + } + return getEnumMemberValue(declaration); + } + function evaluateTemplateExpression(expr, location2) { + let result2 = expr.head.text; + for (const span of expr.templateSpans) { + const value2 = evaluate(span.expression, location2); + if (value2 === void 0) { + return void 0; + } + result2 += value2; + result2 += span.literal.text; + } + return result2; + } + function checkEnumDeclaration(node) { + addLazyDiagnostic(() => checkEnumDeclarationWorker(node)); + } + function checkEnumDeclarationWorker(node) { + checkGrammarModifiers(node); + checkCollisionsForDeclarationName(node, node.name); + checkExportsOnMergedDeclarations(node); + node.members.forEach(checkEnumMember); + computeEnumMemberValues(node); + const enumSymbol = getSymbolOfDeclaration(node); + const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); + if (node === firstDeclaration) { + if (enumSymbol.declarations && enumSymbol.declarations.length > 1) { + const enumIsConst = isEnumConst(node); + forEach4(enumSymbol.declarations, (decl) => { + if (isEnumDeclaration(decl) && isEnumConst(decl) !== enumIsConst) { + error22(getNameOfDeclaration(decl), Diagnostics.Enum_declarations_must_all_be_const_or_non_const); + } + }); + } + let seenEnumMissingInitialInitializer = false; + forEach4(enumSymbol.declarations, (declaration) => { + if (declaration.kind !== 266) { + return false; + } + const enumDeclaration = declaration; + if (!enumDeclaration.members.length) { + return false; + } + const firstEnumMember = enumDeclaration.members[0]; + if (!firstEnumMember.initializer) { + if (seenEnumMissingInitialInitializer) { + error22(firstEnumMember.name, Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); + } else { + seenEnumMissingInitialInitializer = true; + } + } + }); + } + } + function checkEnumMember(node) { + if (isPrivateIdentifier(node.name)) { + error22(node, Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier); + } + if (node.initializer) { + checkExpression(node.initializer); + } + } + function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { + const declarations = symbol.declarations; + if (declarations) { + for (const declaration of declarations) { + if ((declaration.kind === 263 || declaration.kind === 262 && nodeIsPresent(declaration.body)) && !(declaration.flags & 33554432)) { + return declaration; + } + } + } + return void 0; + } + function inSameLexicalScope(node1, node2) { + const container1 = getEnclosingBlockScopeContainer(node1); + const container2 = getEnclosingBlockScopeContainer(node2); + if (isGlobalSourceFile(container1)) { + return isGlobalSourceFile(container2); + } else if (isGlobalSourceFile(container2)) { + return false; + } else { + return container1 === container2; + } + } + function checkModuleDeclaration(node) { + if (node.body) { + checkSourceElement(node.body); + if (!isGlobalScopeAugmentation(node)) { + registerForUnusedIdentifiersCheck(node); + } + } + addLazyDiagnostic(checkModuleDeclarationDiagnostics); + function checkModuleDeclarationDiagnostics() { + var _a2, _b; + const isGlobalAugmentation = isGlobalScopeAugmentation(node); + const inAmbientContext = node.flags & 33554432; + if (isGlobalAugmentation && !inAmbientContext) { + error22(node.name, Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context); + } + const isAmbientExternalModule = isAmbientModule(node); + const contextErrorMessage = isAmbientExternalModule ? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file : Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module; + if (checkGrammarModuleElementContext(node, contextErrorMessage)) { + return; + } + if (!checkGrammarModifiers(node)) { + if (!inAmbientContext && node.name.kind === 11) { + grammarErrorOnNode(node.name, Diagnostics.Only_ambient_modules_can_use_quoted_names); + } + } + if (isIdentifier(node.name)) { + checkCollisionsForDeclarationName(node, node.name); + } + checkExportsOnMergedDeclarations(node); + const symbol = getSymbolOfDeclaration(node); + if (symbol.flags & 512 && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) { + if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) { + error22(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName); + } + if (((_a2 = symbol.declarations) == null ? void 0 : _a2.length) > 1) { + const firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); + if (firstNonAmbientClassOrFunc) { + if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) { + error22(node.name, Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); + } else if (node.pos < firstNonAmbientClassOrFunc.pos) { + error22(node.name, Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); + } + } + const mergedClass = getDeclarationOfKind( + symbol, + 263 + /* ClassDeclaration */ + ); + if (mergedClass && inSameLexicalScope(node, mergedClass)) { + getNodeLinks(node).flags |= 2048; + } + } + if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 312 && (moduleKind === 1 || node.parent.impliedNodeFormat === 1)) { + const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find( + (m7) => m7.kind === 95 + /* ExportKeyword */ + ); + if (exportModifier) { + error22(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + } + } + if (isAmbientExternalModule) { + if (isExternalModuleAugmentation(node)) { + const checkBody = isGlobalAugmentation || getSymbolOfDeclaration(node).flags & 33554432; + if (checkBody && node.body) { + for (const statement of node.body.statements) { + checkModuleAugmentationElement(statement, isGlobalAugmentation); + } + } + } else if (isGlobalSourceFile(node.parent)) { + if (isGlobalAugmentation) { + error22(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } else if (isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(node.name))) { + error22(node.name, Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); + } + } else { + if (isGlobalAugmentation) { + error22(node.name, Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations); + } else { + error22(node.name, Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces); + } + } + } + } + } + function checkModuleAugmentationElement(node, isGlobalAugmentation) { + switch (node.kind) { + case 243: + for (const decl of node.declarationList.declarations) { + checkModuleAugmentationElement(decl, isGlobalAugmentation); + } + break; + case 277: + case 278: + grammarErrorOnFirstToken(node, Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); + break; + case 271: + case 272: + grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); + break; + case 208: + case 260: + const name2 = node.name; + if (isBindingPattern(name2)) { + for (const el of name2.elements) { + checkModuleAugmentationElement(el, isGlobalAugmentation); + } + break; + } + case 263: + case 266: + case 262: + case 264: + case 267: + case 265: + if (isGlobalAugmentation) { + return; + } + break; + } + } + function getFirstNonModuleExportsIdentifier(node) { + switch (node.kind) { + case 80: + return node; + case 166: + do { + node = node.left; + } while (node.kind !== 80); + return node; + case 211: + do { + if (isModuleExportsAccessExpression(node.expression) && !isPrivateIdentifier(node.name)) { + return node.name; + } + node = node.expression; + } while (node.kind !== 80); + return node; + } + } + function checkExternalImportOrExportDeclaration(node) { + const moduleName3 = getExternalModuleName(node); + if (!moduleName3 || nodeIsMissing(moduleName3)) { + return false; + } + if (!isStringLiteral(moduleName3)) { + error22(moduleName3, Diagnostics.String_literal_expected); + return false; + } + const inAmbientExternalModule = node.parent.kind === 268 && isAmbientModule(node.parent.parent); + if (node.parent.kind !== 312 && !inAmbientExternalModule) { + error22( + moduleName3, + node.kind === 278 ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module + ); + return false; + } + if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName3.text)) { + if (!isTopLevelInExternalModuleAugmentation(node)) { + error22(node, Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); + return false; + } + } + if (!isImportEqualsDeclaration(node) && node.attributes) { + const diagnostic = node.attributes.token === 118 ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions; + let hasError = false; + for (const attr of node.attributes.elements) { + if (!isStringLiteral(attr.value)) { + hasError = true; + error22(attr.value, diagnostic); + } + } + return !hasError; + } + return true; + } + function checkAliasSymbol(node) { + var _a2, _b, _c, _d; + let symbol = getSymbolOfDeclaration(node); + const target = resolveAlias(symbol); + if (target !== unknownSymbol) { + symbol = getMergedSymbol(symbol.exportSymbol || symbol); + if (isInJSFile(node) && !(target.flags & 111551) && !isTypeOnlyImportOrExportDeclaration(node)) { + const errorNode = isImportOrExportSpecifier(node) ? node.propertyName || node.name : isNamedDeclaration(node) ? node.name : node; + Debug.assert( + node.kind !== 280 + /* NamespaceExport */ + ); + if (node.kind === 281) { + const diag2 = error22(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files); + const alreadyExportedSymbol = (_b = (_a2 = getSourceFileOfNode(node).symbol) == null ? void 0 : _a2.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText); + if (alreadyExportedSymbol === target) { + const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode); + if (exportingDeclaration) { + addRelatedInfo( + diag2, + createDiagnosticForNode( + exportingDeclaration, + Diagnostics._0_is_automatically_exported_here, + unescapeLeadingUnderscores(alreadyExportedSymbol.escapedName) + ) + ); + } + } + } else { + Debug.assert( + node.kind !== 260 + /* VariableDeclaration */ + ); + const importDeclaration = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)); + const moduleSpecifier = (importDeclaration && ((_d = tryGetModuleSpecifierFromDeclaration(importDeclaration)) == null ? void 0 : _d.text)) ?? "..."; + const importedIdentifier = unescapeLeadingUnderscores(isIdentifier(errorNode) ? errorNode.escapedText : symbol.escapedName); + error22( + errorNode, + Diagnostics._0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation, + importedIdentifier, + `import("${moduleSpecifier}").${importedIdentifier}` + ); + } + return; + } + const targetFlags = getSymbolFlags(target); + const excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) | (symbol.flags & 788968 ? 788968 : 0) | (symbol.flags & 1920 ? 1920 : 0); + if (targetFlags & excludedMeanings) { + const message = node.kind === 281 ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; + error22(node, message, symbolToString2(symbol)); + } else if (node.kind !== 281) { + const appearsValueyToTranspiler = compilerOptions.isolatedModules && !findAncestor(node, isTypeOnlyImportOrExportDeclaration); + if (appearsValueyToTranspiler && symbol.flags & (111551 | 1048576)) { + error22( + node, + Diagnostics.Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled, + symbolToString2(symbol), + isolatedModulesLikeFlagName + ); + } + } + if (getIsolatedModules(compilerOptions) && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432)) { + const typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol); + const isType = !(targetFlags & 111551); + if (isType || typeOnlyAlias) { + switch (node.kind) { + case 273: + case 276: + case 271: { + if (compilerOptions.preserveValueImports || compilerOptions.verbatimModuleSyntax) { + Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name"); + const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? compilerOptions.verbatimModuleSyntax ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled : compilerOptions.verbatimModuleSyntax ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled; + const name2 = idText(node.kind === 276 ? node.propertyName || node.name : node.name); + addTypeOnlyDeclarationRelatedInfo( + error22(node, message, name2), + isType ? void 0 : typeOnlyAlias, + name2 + ); + } + if (isType && node.kind === 271 && hasEffectiveModifier( + node, + 32 + /* Export */ + )) { + error22(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_0_is_enabled, isolatedModulesLikeFlagName); + } + break; + } + case 281: { + if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) { + const name2 = idText(node.propertyName || node.name); + const diagnostic = isType ? error22(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error22(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name2, isolatedModulesLikeFlagName); + addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name2); + break; + } + } + } + } + if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 && !isInJSFile(node) && (moduleKind === 1 || getSourceFileOfNode(node).impliedNodeFormat === 1)) { + error22(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + } + if (isImportSpecifier(node)) { + const targetSymbol = resolveAliasWithDeprecationCheck(symbol, node); + if (isDeprecatedSymbol(targetSymbol) && targetSymbol.declarations) { + addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName); + } + } + } + } + function resolveAliasWithDeprecationCheck(symbol, location2) { + if (!(symbol.flags & 2097152) || isDeprecatedSymbol(symbol) || !getDeclarationOfAliasSymbol(symbol)) { + return symbol; + } + const targetSymbol = resolveAlias(symbol); + if (targetSymbol === unknownSymbol) + return targetSymbol; + while (symbol.flags & 2097152) { + const target = getImmediateAliasedSymbol(symbol); + if (target) { + if (target === targetSymbol) + break; + if (target.declarations && length(target.declarations)) { + if (isDeprecatedSymbol(target)) { + addDeprecatedSuggestion(location2, target.declarations, target.escapedName); + break; + } else { + if (symbol === targetSymbol) + break; + symbol = target; + } + } + } else { + break; + } + } + return targetSymbol; + } + function checkImportBinding(node) { + checkCollisionsForDeclarationName(node, node.name); + checkAliasSymbol(node); + if (node.kind === 276 && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && moduleKind !== 4 && (moduleKind < 5 || getSourceFileOfNode(node).impliedNodeFormat === 1)) { + checkExternalEmitHelpers( + node, + 131072 + /* ImportDefault */ + ); + } + } + function checkImportAttributes(declaration) { + var _a2; + const node = declaration.attributes; + if (node) { + const importAttributesType = getGlobalImportAttributesType( + /*reportErrors*/ + true + ); + if (importAttributesType !== emptyObjectType) { + checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType( + importAttributesType, + 32768 + /* Undefined */ + ), node); + } + const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration); + const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0); + const isImportAttributes2 = declaration.attributes.token === 118; + if (validForTypeAttributes && override) { + return; + } + const mode = moduleKind === 199 && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier); + if (mode !== 99 && moduleKind !== 99 && moduleKind !== 200) { + const message = isImportAttributes2 ? moduleKind === 199 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve; + return grammarErrorOnNode(node, message); + } + if (isImportDeclaration(declaration) ? (_a2 = declaration.importClause) == null ? void 0 : _a2.isTypeOnly : declaration.isTypeOnly) { + return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); + } + if (override) { + return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); + } + } + } + function checkImportAttribute(node) { + return getRegularTypeOfLiteralType(checkExpressionCached(node.value)); + } + function checkImportDeclaration(node) { + if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { + grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); + } + if (checkExternalImportOrExportDeclaration(node)) { + const importClause = node.importClause; + if (importClause && !checkGrammarImportClause(importClause)) { + if (importClause.name) { + checkImportBinding(importClause); + } + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === 274) { + checkImportBinding(importClause.namedBindings); + if (moduleKind !== 4 && (moduleKind < 5 || getSourceFileOfNode(node).impliedNodeFormat === 1) && getESModuleInterop(compilerOptions)) { + checkExternalEmitHelpers( + node, + 65536 + /* ImportStar */ + ); + } + } else { + const moduleExisted = resolveExternalModuleName(node, node.moduleSpecifier); + if (moduleExisted) { + forEach4(importClause.namedBindings.elements, checkImportBinding); + } + } + } + } + } + checkImportAttributes(node); + } + function checkImportEqualsDeclaration(node) { + if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + checkGrammarModifiers(node); + if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { + checkImportBinding(node); + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + markExportAsReferenced(node); + } + if (node.moduleReference.kind !== 283) { + const target = resolveAlias(getSymbolOfDeclaration(node)); + if (target !== unknownSymbol) { + const targetFlags = getSymbolFlags(target); + if (targetFlags & 111551) { + const moduleName3 = getFirstIdentifier(node.moduleReference); + if (!(resolveEntityName( + moduleName3, + 111551 | 1920 + /* Namespace */ + ).flags & 1920)) { + error22(moduleName3, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName3)); + } + } + if (targetFlags & 788968) { + checkTypeNameIsReserved(node.name, Diagnostics.Import_name_cannot_be_0); + } + } + if (node.isTypeOnly) { + grammarErrorOnNode(node, Diagnostics.An_import_alias_cannot_use_import_type); + } + } else { + if (moduleKind >= 5 && moduleKind !== 200 && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 33554432)) { + grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead); + } + } + } + } + function checkExportDeclaration(node) { + if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) { + return; + } + if (!checkGrammarModifiers(node) && hasSyntacticModifiers(node)) { + grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); + } + if (node.moduleSpecifier && node.exportClause && isNamedExports(node.exportClause) && length(node.exportClause.elements) && languageVersion === 0) { + checkExternalEmitHelpers( + node, + 4194304 + /* CreateBinding */ + ); + } + checkGrammarExportDeclaration(node); + if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { + if (node.exportClause && !isNamespaceExport(node.exportClause)) { + forEach4(node.exportClause.elements, checkExportSpecifier); + const inAmbientExternalModule = node.parent.kind === 268 && isAmbientModule(node.parent.parent); + const inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 268 && !node.moduleSpecifier && node.flags & 33554432; + if (node.parent.kind !== 312 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + error22(node, Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); + } + } else { + const moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); + if (moduleSymbol && hasExportAssignmentSymbol(moduleSymbol)) { + error22(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString2(moduleSymbol)); + } else if (node.exportClause) { + checkAliasSymbol(node.exportClause); + } + if (moduleKind !== 4 && (moduleKind < 5 || getSourceFileOfNode(node).impliedNodeFormat === 1)) { + if (node.exportClause) { + if (getESModuleInterop(compilerOptions)) { + checkExternalEmitHelpers( + node, + 65536 + /* ImportStar */ + ); + } + } else { + checkExternalEmitHelpers( + node, + 32768 + /* ExportStar */ + ); + } + } + } + } + checkImportAttributes(node); + } + function checkGrammarExportDeclaration(node) { + var _a2; + if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 279) { + return checkGrammarNamedImportsOrExports(node.exportClause); + } + return false; + } + function checkGrammarModuleElementContext(node, errorMessage) { + const isInAppropriateContext = node.parent.kind === 312 || node.parent.kind === 268 || node.parent.kind === 267; + if (!isInAppropriateContext) { + grammarErrorOnFirstToken(node, errorMessage); + } + return !isInAppropriateContext; + } + function importClauseContainsReferencedImport(importClause) { + return forEachImportClauseDeclaration(importClause, (declaration) => { + return !!getSymbolOfDeclaration(declaration).isReferenced; + }); + } + function importClauseContainsConstEnumUsedAsValue(importClause) { + return forEachImportClauseDeclaration(importClause, (declaration) => { + return !!getSymbolLinks(getSymbolOfDeclaration(declaration)).constEnumReferenced; + }); + } + function canConvertImportDeclarationToTypeOnly(statement) { + return isImportDeclaration(statement) && statement.importClause && !statement.importClause.isTypeOnly && importClauseContainsReferencedImport(statement.importClause) && !isReferencedAliasDeclaration( + statement.importClause, + /*checkChildren*/ + true + ) && !importClauseContainsConstEnumUsedAsValue(statement.importClause); + } + function canConvertImportEqualsDeclarationToTypeOnly(statement) { + return isImportEqualsDeclaration(statement) && isExternalModuleReference(statement.moduleReference) && !statement.isTypeOnly && getSymbolOfDeclaration(statement).isReferenced && !isReferencedAliasDeclaration( + statement, + /*checkChildren*/ + false + ) && !getSymbolLinks(getSymbolOfDeclaration(statement)).constEnumReferenced; + } + function checkImportsForTypeOnlyConversion(sourceFile) { + if (!canCollectSymbolAliasAccessabilityData) { + return; + } + for (const statement of sourceFile.statements) { + if (canConvertImportDeclarationToTypeOnly(statement) || canConvertImportEqualsDeclarationToTypeOnly(statement)) { + error22( + statement, + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error + ); + } + } + } + function checkExportSpecifier(node) { + checkAliasSymbol(node); + if (getEmitDeclarations(compilerOptions)) { + collectLinkedAliases( + node.propertyName || node.name, + /*setVisibility*/ + true + ); + } + if (!node.parent.parent.moduleSpecifier) { + const exportedName = node.propertyName || node.name; + const symbol = resolveName( + exportedName, + exportedName.escapedText, + 111551 | 788968 | 1920 | 2097152, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + if (symbol && (symbol === undefinedSymbol || symbol === globalThisSymbol || symbol.declarations && isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { + error22(exportedName, Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, idText(exportedName)); + } else { + if (!node.isTypeOnly && !node.parent.parent.isTypeOnly) { + markExportAsReferenced(node); + } + const target = symbol && (symbol.flags & 2097152 ? resolveAlias(symbol) : symbol); + if (!target || getSymbolFlags(target) & 111551) { + checkExpressionCached(node.propertyName || node.name); + } + } + } else { + if (getESModuleInterop(compilerOptions) && moduleKind !== 4 && (moduleKind < 5 || getSourceFileOfNode(node).impliedNodeFormat === 1) && idText(node.propertyName || node.name) === "default") { + checkExternalEmitHelpers( + node, + 131072 + /* ImportDefault */ + ); + } + } + } + function checkExportAssignment(node) { + const illegalContextMessage = node.isExportEquals ? Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration : Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration; + if (checkGrammarModuleElementContext(node, illegalContextMessage)) { + return; + } + const container = node.parent.kind === 312 ? node.parent : node.parent.parent; + if (container.kind === 267 && !isAmbientModule(container)) { + if (node.isExportEquals) { + error22(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); + } else { + error22(node, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } + return; + } + if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) { + grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); + } + const typeAnnotationNode = getEffectiveTypeAnnotationNode(node); + if (typeAnnotationNode) { + checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression); + } + const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 33554432) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 || getSourceFileOfNode(node).impliedNodeFormat === 1); + if (node.expression.kind === 80) { + const id = node.expression; + const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName( + id, + -1, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + node + )); + if (sym) { + const typeOnlyDeclaration = getTypeOnlyAliasDeclaration( + sym, + 111551 + /* Value */ + ); + markAliasReferenced(sym, id); + if (getSymbolFlags(sym) & 111551) { + checkExpressionCached(id); + if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) { + error22( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration, + idText(id) + ); + } + } else if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432) && compilerOptions.verbatimModuleSyntax) { + error22( + id, + node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type, + idText(id) + ); + } + if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432) && getIsolatedModules(compilerOptions) && !(sym.flags & 111551)) { + const nonLocalMeanings = getSymbolFlags( + sym, + /*excludeTypeOnlyMeanings*/ + false, + /*excludeLocalMeanings*/ + true + ); + if (sym.flags & 2097152 && nonLocalMeanings & 788968 && !(nonLocalMeanings & 111551) && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) { + error22( + id, + node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default, + idText(id), + isolatedModulesLikeFlagName + ); + } else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) { + addTypeOnlyDeclarationRelatedInfo( + error22( + id, + node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default, + idText(id), + isolatedModulesLikeFlagName + ), + typeOnlyDeclaration, + idText(id) + ); + } + } + } else { + checkExpressionCached(id); + } + if (getEmitDeclarations(compilerOptions)) { + collectLinkedAliases( + id, + /*setVisibility*/ + true + ); + } + } else { + checkExpressionCached(node.expression); + } + if (isIllegalExportDefaultInCJS) { + error22(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + checkExternalModuleExports(container); + if (node.flags & 33554432 && !isEntityNameExpression(node.expression)) { + grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context); + } + if (node.isExportEquals) { + if (moduleKind >= 5 && moduleKind !== 200 && (node.flags & 33554432 && getSourceFileOfNode(node).impliedNodeFormat === 99 || !(node.flags & 33554432) && getSourceFileOfNode(node).impliedNodeFormat !== 1)) { + grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead); + } else if (moduleKind === 4 && !(node.flags & 33554432)) { + grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); + } + } + } + function hasExportedMembers(moduleSymbol) { + return forEachEntry(moduleSymbol.exports, (_6, id) => id !== "export="); + } + function checkExternalModuleExports(node) { + const moduleSymbol = getSymbolOfDeclaration(node); + const links = getSymbolLinks(moduleSymbol); + if (!links.exportsChecked) { + const exportEqualsSymbol = moduleSymbol.exports.get("export="); + if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { + const declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; + if (declaration && !isTopLevelInExternalModuleAugmentation(declaration) && !isInJSFile(declaration)) { + error22(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); + } + } + const exports29 = getExportsOfModule(moduleSymbol); + if (exports29) { + exports29.forEach(({ declarations, flags }, id) => { + if (id === "__export") { + return; + } + if (flags & (1920 | 384)) { + return; + } + const exportedDeclarationsCount = countWhere(declarations, and(isNotOverloadAndNotAccessor, not(isInterfaceDeclaration))); + if (flags & 524288 && exportedDeclarationsCount <= 2) { + return; + } + if (exportedDeclarationsCount > 1) { + if (!isDuplicatedCommonJSExport(declarations)) { + for (const declaration of declarations) { + if (isNotOverload(declaration)) { + diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Cannot_redeclare_exported_variable_0, unescapeLeadingUnderscores(id))); + } + } + } + } + }); + } + links.exportsChecked = true; + } + } + function isDuplicatedCommonJSExport(declarations) { + return declarations && declarations.length > 1 && declarations.every((d7) => isInJSFile(d7) && isAccessExpression(d7) && (isExportsIdentifier(d7.expression) || isModuleExportsAccessExpression(d7.expression))); + } + function checkSourceElement(node) { + if (node) { + const saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + checkSourceElementWorker(node); + currentNode = saveCurrentNode; + } + } + function checkSourceElementWorker(node) { + if (canHaveJSDoc(node)) { + forEach4(node.jsDoc, ({ comment, tags: tags6 }) => { + checkJSDocCommentWorker(comment); + forEach4(tags6, (tag) => { + checkJSDocCommentWorker(tag.comment); + if (isInJSFile(node)) { + checkSourceElement(tag); + } + }); + }); + } + const kind = node.kind; + if (cancellationToken) { + switch (kind) { + case 267: + case 263: + case 264: + case 262: + cancellationToken.throwIfCancellationRequested(); + } + } + if (kind >= 243 && kind <= 259 && canHaveFlowNode(node) && node.flowNode && !isReachableFlowNode(node.flowNode)) { + errorOrSuggestion(compilerOptions.allowUnreachableCode === false, node, Diagnostics.Unreachable_code_detected); + } + switch (kind) { + case 168: + return checkTypeParameter(node); + case 169: + return checkParameter(node); + case 172: + return checkPropertyDeclaration(node); + case 171: + return checkPropertySignature(node); + case 185: + case 184: + case 179: + case 180: + case 181: + return checkSignatureDeclaration(node); + case 174: + case 173: + return checkMethodDeclaration(node); + case 175: + return checkClassStaticBlockDeclaration(node); + case 176: + return checkConstructorDeclaration(node); + case 177: + case 178: + return checkAccessorDeclaration(node); + case 183: + return checkTypeReferenceNode(node); + case 182: + return checkTypePredicate(node); + case 186: + return checkTypeQuery(node); + case 187: + return checkTypeLiteral(node); + case 188: + return checkArrayType(node); + case 189: + return checkTupleType(node); + case 192: + case 193: + return checkUnionOrIntersectionType(node); + case 196: + case 190: + case 191: + return checkSourceElement(node.type); + case 197: + return checkThisType(node); + case 198: + return checkTypeOperator(node); + case 194: + return checkConditionalType(node); + case 195: + return checkInferType(node); + case 203: + return checkTemplateLiteralType(node); + case 205: + return checkImportType(node); + case 202: + return checkNamedTupleMember(node); + case 335: + return checkJSDocAugmentsTag(node); + case 336: + return checkJSDocImplementsTag(node); + case 353: + case 345: + case 347: + return checkJSDocTypeAliasTag(node); + case 352: + return checkJSDocTemplateTag(node); + case 351: + return checkJSDocTypeTag(node); + case 331: + case 332: + case 333: + return checkJSDocLinkLikeTag(node); + case 348: + return checkJSDocParameterTag(node); + case 355: + return checkJSDocPropertyTag(node); + case 324: + checkJSDocFunctionType(node); + case 322: + case 321: + case 319: + case 320: + case 329: + checkJSDocTypeIsInJsFile(node); + forEachChild(node, checkSourceElement); + return; + case 325: + checkJSDocVariadicType(node); + return; + case 316: + return checkSourceElement(node.type); + case 340: + case 342: + case 341: + return checkJSDocAccessibilityModifiers(node); + case 357: + return checkJSDocSatisfiesTag(node); + case 350: + return checkJSDocThisTag(node); + case 199: + return checkIndexedAccessType(node); + case 200: + return checkMappedType(node); + case 262: + return checkFunctionDeclaration(node); + case 241: + case 268: + return checkBlock(node); + case 243: + return checkVariableStatement(node); + case 244: + return checkExpressionStatement(node); + case 245: + return checkIfStatement(node); + case 246: + return checkDoStatement(node); + case 247: + return checkWhileStatement(node); + case 248: + return checkForStatement(node); + case 249: + return checkForInStatement(node); + case 250: + return checkForOfStatement(node); + case 251: + case 252: + return checkBreakOrContinueStatement(node); + case 253: + return checkReturnStatement(node); + case 254: + return checkWithStatement(node); + case 255: + return checkSwitchStatement(node); + case 256: + return checkLabeledStatement(node); + case 257: + return checkThrowStatement(node); + case 258: + return checkTryStatement(node); + case 260: + return checkVariableDeclaration(node); + case 208: + return checkBindingElement(node); + case 263: + return checkClassDeclaration(node); + case 264: + return checkInterfaceDeclaration(node); + case 265: + return checkTypeAliasDeclaration(node); + case 266: + return checkEnumDeclaration(node); + case 267: + return checkModuleDeclaration(node); + case 272: + return checkImportDeclaration(node); + case 271: + return checkImportEqualsDeclaration(node); + case 278: + return checkExportDeclaration(node); + case 277: + return checkExportAssignment(node); + case 242: + case 259: + checkGrammarStatementInAmbientContext(node); + return; + case 282: + return checkMissingDeclaration(node); + } + } + function checkJSDocCommentWorker(node) { + if (isArray3(node)) { + forEach4(node, (tag) => { + if (isJSDocLinkLike(tag)) { + checkSourceElement(tag); + } + }); + } + } + function checkJSDocTypeIsInJsFile(node) { + if (!isInJSFile(node)) { + if (isJSDocNonNullableType(node) || isJSDocNullableType(node)) { + const token = tokenToString( + isJSDocNonNullableType(node) ? 54 : 58 + /* QuestionToken */ + ); + const diagnostic = node.postfix ? Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1 : Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1; + const typeNode = node.type; + const type3 = getTypeFromTypeNode(typeNode); + grammarErrorOnNode( + node, + diagnostic, + token, + typeToString( + isJSDocNullableType(node) && !(type3 === neverType2 || type3 === voidType2) ? getUnionType(append([type3, undefinedType2], node.postfix ? void 0 : nullType2)) : type3 + ) + ); + } else { + grammarErrorOnNode(node, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); + } + } + } + function checkJSDocVariadicType(node) { + checkJSDocTypeIsInJsFile(node); + checkSourceElement(node.type); + const { parent: parent22 } = node; + if (isParameter(parent22) && isJSDocFunctionType(parent22.parent)) { + if (last2(parent22.parent.parameters) !== parent22) { + error22(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + return; + } + if (!isJSDocTypeExpression(parent22)) { + error22(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + } + const paramTag = node.parent.parent; + if (!isJSDocParameterTag(paramTag)) { + error22(node, Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature); + return; + } + const param = getParameterSymbolFromJSDoc(paramTag); + if (!param) { + return; + } + const host2 = getHostSignatureFromJSDoc(paramTag); + if (!host2 || last2(host2.parameters).symbol !== param) { + error22(node, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + } + function getTypeFromJSDocVariadicType(node) { + const type3 = getTypeFromTypeNode(node.type); + const { parent: parent22 } = node; + const paramTag = node.parent.parent; + if (isJSDocTypeExpression(node.parent) && isJSDocParameterTag(paramTag)) { + const host2 = getHostSignatureFromJSDoc(paramTag); + const isCallbackTag = isJSDocCallbackTag(paramTag.parent.parent); + if (host2 || isCallbackTag) { + const lastParamDeclaration = isCallbackTag ? lastOrUndefined(paramTag.parent.parent.typeExpression.parameters) : lastOrUndefined(host2.parameters); + const symbol = getParameterSymbolFromJSDoc(paramTag); + if (!lastParamDeclaration || symbol && lastParamDeclaration.symbol === symbol && isRestParameter(lastParamDeclaration)) { + return createArrayType(type3); + } + } + } + if (isParameter(parent22) && isJSDocFunctionType(parent22.parent)) { + return createArrayType(type3); + } + return addOptionality(type3); + } + function checkNodeDeferred(node) { + const enclosingFile = getSourceFileOfNode(node); + const links = getNodeLinks(enclosingFile); + if (!(links.flags & 1)) { + links.deferredNodes || (links.deferredNodes = /* @__PURE__ */ new Set()); + links.deferredNodes.add(node); + } else { + Debug.assert(!links.deferredNodes, "A type-checked file should have no deferred nodes."); + } + } + function checkDeferredNodes(context2) { + const links = getNodeLinks(context2); + if (links.deferredNodes) { + links.deferredNodes.forEach(checkDeferredNode); + } + links.deferredNodes = void 0; + } + function checkDeferredNode(node) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Check, "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath }); + const saveCurrentNode = currentNode; + currentNode = node; + instantiationCount = 0; + switch (node.kind) { + case 213: + case 214: + case 215: + case 170: + case 286: + resolveUntypedCall(node); + break; + case 218: + case 219: + case 174: + case 173: + checkFunctionExpressionOrObjectLiteralMethodDeferred(node); + break; + case 177: + case 178: + checkAccessorDeclaration(node); + break; + case 231: + checkClassExpressionDeferred(node); + break; + case 168: + checkTypeParameterDeferred(node); + break; + case 285: + checkJsxSelfClosingElementDeferred(node); + break; + case 284: + checkJsxElementDeferred(node); + break; + case 216: + case 234: + case 217: + checkAssertionDeferred(node); + break; + case 222: + checkExpression(node.expression); + break; + case 226: + if (isInstanceOfExpression(node)) { + resolveUntypedCall(node); + } + break; + } + currentNode = saveCurrentNode; + (_b = tracing) == null ? void 0 : _b.pop(); + } + function checkSourceFile(node) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push( + tracing.Phase.Check, + "checkSourceFile", + { path: node.path }, + /*separateBeginAndEnd*/ + true + ); + mark("beforeCheck"); + checkSourceFileWorker(node); + mark("afterCheck"); + measure("Check", "beforeCheck", "afterCheck"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + function unusedIsError(kind, isAmbient) { + if (isAmbient) { + return false; + } + switch (kind) { + case 0: + return !!compilerOptions.noUnusedLocals; + case 1: + return !!compilerOptions.noUnusedParameters; + default: + return Debug.assertNever(kind); + } + } + function getPotentiallyUnusedIdentifiers(sourceFile) { + return allPotentiallyUnusedIdentifiers.get(sourceFile.path) || emptyArray; + } + function checkSourceFileWorker(node) { + const links = getNodeLinks(node); + if (!(links.flags & 1)) { + if (skipTypeChecking(node, compilerOptions, host)) { + return; + } + checkGrammarSourceFile(node); + clear2(potentialThisCollisions); + clear2(potentialNewTargetCollisions); + clear2(potentialWeakMapSetCollisions); + clear2(potentialReflectCollisions); + clear2(potentialUnusedRenamedBindingElementsInTypes); + forEach4(node.statements, checkSourceElement); + checkSourceElement(node.endOfFileToken); + checkDeferredNodes(node); + if (isExternalOrCommonJsModule(node)) { + registerForUnusedIdentifiersCheck(node); + } + addLazyDiagnostic(() => { + if (!node.isDeclarationFile && (compilerOptions.noUnusedLocals || compilerOptions.noUnusedParameters)) { + checkUnusedIdentifiers(getPotentiallyUnusedIdentifiers(node), (containingNode, kind, diag2) => { + if (!containsParseError(containingNode) && unusedIsError(kind, !!(containingNode.flags & 33554432))) { + diagnostics.add(diag2); + } + }); + } + if (!node.isDeclarationFile) { + checkPotentialUncheckedRenamedBindingElementsInTypes(); + } + }); + if (compilerOptions.importsNotUsedAsValues === 2 && !node.isDeclarationFile && isExternalModule(node)) { + checkImportsForTypeOnlyConversion(node); + } + if (isExternalOrCommonJsModule(node)) { + checkExternalModuleExports(node); + } + if (potentialThisCollisions.length) { + forEach4(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); + clear2(potentialThisCollisions); + } + if (potentialNewTargetCollisions.length) { + forEach4(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope); + clear2(potentialNewTargetCollisions); + } + if (potentialWeakMapSetCollisions.length) { + forEach4(potentialWeakMapSetCollisions, checkWeakMapSetCollision); + clear2(potentialWeakMapSetCollisions); + } + if (potentialReflectCollisions.length) { + forEach4(potentialReflectCollisions, checkReflectCollision); + clear2(potentialReflectCollisions); + } + links.flags |= 1; + } + } + function getDiagnostics2(sourceFile, ct) { + try { + cancellationToken = ct; + return getDiagnosticsWorker(sourceFile); + } finally { + cancellationToken = void 0; + } + } + function ensurePendingDiagnosticWorkComplete() { + for (const cb of deferredDiagnosticsCallbacks) { + cb(); + } + deferredDiagnosticsCallbacks = []; + } + function checkSourceFileWithEagerDiagnostics(sourceFile) { + ensurePendingDiagnosticWorkComplete(); + const oldAddLazyDiagnostics = addLazyDiagnostic; + addLazyDiagnostic = (cb) => cb(); + checkSourceFile(sourceFile); + addLazyDiagnostic = oldAddLazyDiagnostics; + } + function getDiagnosticsWorker(sourceFile) { + if (sourceFile) { + ensurePendingDiagnosticWorkComplete(); + const previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); + const previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length; + checkSourceFileWithEagerDiagnostics(sourceFile); + const semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); + const currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics(); + if (currentGlobalDiagnostics !== previousGlobalDiagnostics) { + const deferredGlobalDiagnostics = relativeComplement(previousGlobalDiagnostics, currentGlobalDiagnostics, compareDiagnostics); + return concatenate(deferredGlobalDiagnostics, semanticDiagnostics); + } else if (previousGlobalDiagnosticsSize === 0 && currentGlobalDiagnostics.length > 0) { + return concatenate(currentGlobalDiagnostics, semanticDiagnostics); + } + return semanticDiagnostics; + } + forEach4(host.getSourceFiles(), checkSourceFileWithEagerDiagnostics); + return diagnostics.getDiagnostics(); + } + function getGlobalDiagnostics() { + ensurePendingDiagnosticWorkComplete(); + return diagnostics.getGlobalDiagnostics(); + } + function getSymbolsInScope(location2, meaning) { + if (location2.flags & 67108864) { + return []; + } + const symbols = createSymbolTable(); + let isStaticSymbol = false; + populateSymbols(); + symbols.delete( + "this" + /* This */ + ); + return symbolsToArray(symbols); + function populateSymbols() { + while (location2) { + if (canHaveLocals(location2) && location2.locals && !isGlobalSourceFile(location2)) { + copySymbols2(location2.locals, meaning); + } + switch (location2.kind) { + case 312: + if (!isExternalModule(location2)) + break; + case 267: + copyLocallyVisibleExportSymbols( + getSymbolOfDeclaration(location2).exports, + meaning & 2623475 + /* ModuleMember */ + ); + break; + case 266: + copySymbols2( + getSymbolOfDeclaration(location2).exports, + meaning & 8 + /* EnumMember */ + ); + break; + case 231: + const className = location2.name; + if (className) { + copySymbol(location2.symbol, meaning); + } + case 263: + case 264: + if (!isStaticSymbol) { + copySymbols2( + getMembersOfSymbol(getSymbolOfDeclaration(location2)), + meaning & 788968 + /* Type */ + ); + } + break; + case 218: + const funcName = location2.name; + if (funcName) { + copySymbol(location2.symbol, meaning); + } + break; + } + if (introducesArgumentsExoticObject(location2)) { + copySymbol(argumentsSymbol, meaning); + } + isStaticSymbol = isStatic(location2); + location2 = location2.parent; + } + copySymbols2(globals3, meaning); + } + function copySymbol(symbol, meaning2) { + if (getCombinedLocalAndExportSymbolFlags(symbol) & meaning2) { + const id = symbol.escapedName; + if (!symbols.has(id)) { + symbols.set(id, symbol); + } + } + } + function copySymbols2(source, meaning2) { + if (meaning2) { + source.forEach((symbol) => { + copySymbol(symbol, meaning2); + }); + } + } + function copyLocallyVisibleExportSymbols(source, meaning2) { + if (meaning2) { + source.forEach((symbol) => { + if (!getDeclarationOfKind( + symbol, + 281 + /* ExportSpecifier */ + ) && !getDeclarationOfKind( + symbol, + 280 + /* NamespaceExport */ + ) && symbol.escapedName !== "default") { + copySymbol(symbol, meaning2); + } + }); + } + } + } + function isTypeDeclarationName(name2) { + return name2.kind === 80 && isTypeDeclaration(name2.parent) && getNameOfDeclaration(name2.parent) === name2; + } + function isTypeReferenceIdentifier(node) { + while (node.parent.kind === 166) { + node = node.parent; + } + return node.parent.kind === 183; + } + function isInNameOfExpressionWithTypeArguments(node) { + while (node.parent.kind === 211) { + node = node.parent; + } + return node.parent.kind === 233; + } + function forEachEnclosingClass(node, callback) { + let result2; + let containingClass = getContainingClass(node); + while (containingClass) { + if (result2 = callback(containingClass)) + break; + containingClass = getContainingClass(containingClass); + } + return result2; + } + function isNodeUsedDuringClassInitialization(node) { + return !!findAncestor(node, (element) => { + if (isConstructorDeclaration(element) && nodeIsPresent(element.body) || isPropertyDeclaration(element)) { + return true; + } else if (isClassLike(element) || isFunctionLikeDeclaration(element)) { + return "quit"; + } + return false; + }); + } + function isNodeWithinClass(node, classDeclaration) { + return !!forEachEnclosingClass(node, (n7) => n7 === classDeclaration); + } + function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { + while (nodeOnRightSide.parent.kind === 166) { + nodeOnRightSide = nodeOnRightSide.parent; + } + if (nodeOnRightSide.parent.kind === 271) { + return nodeOnRightSide.parent.moduleReference === nodeOnRightSide ? nodeOnRightSide.parent : void 0; + } + if (nodeOnRightSide.parent.kind === 277) { + return nodeOnRightSide.parent.expression === nodeOnRightSide ? nodeOnRightSide.parent : void 0; + } + return void 0; + } + function isInRightSideOfImportOrExportAssignment(node) { + return getLeftSideOfImportEqualsOrExportAssignment(node) !== void 0; + } + function getSpecialPropertyAssignmentSymbolFromEntityName(entityName) { + const specialPropertyAssignmentKind = getAssignmentDeclarationKind(entityName.parent.parent); + switch (specialPropertyAssignmentKind) { + case 1: + case 3: + return getSymbolOfNode(entityName.parent); + case 5: + if (isPropertyAccessExpression(entityName.parent) && getLeftmostAccessExpression(entityName.parent) === entityName) { + return void 0; + } + case 4: + case 2: + return getSymbolOfDeclaration(entityName.parent.parent); + } + } + function isImportTypeQualifierPart(node) { + let parent22 = node.parent; + while (isQualifiedName(parent22)) { + node = parent22; + parent22 = parent22.parent; + } + if (parent22 && parent22.kind === 205 && parent22.qualifier === node) { + return parent22; + } + return void 0; + } + function isThisPropertyAndThisTyped(node) { + if (node.expression.kind === 110) { + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (isFunctionLike(container)) { + const containingLiteral = getContainingObjectLiteral(container); + if (containingLiteral) { + const contextualType = getApparentTypeOfContextualType( + containingLiteral, + /*contextFlags*/ + void 0 + ); + const type3 = getThisTypeOfObjectLiteralFromContextualType(containingLiteral, contextualType); + return type3 && !isTypeAny(type3); + } + } + } + } + function getSymbolOfNameOrPropertyAccessExpression(name2) { + if (isDeclarationName(name2)) { + return getSymbolOfNode(name2.parent); + } + if (isInJSFile(name2) && name2.parent.kind === 211 && name2.parent === name2.parent.parent.left) { + if (!isPrivateIdentifier(name2) && !isJSDocMemberName(name2) && !isThisPropertyAndThisTyped(name2.parent)) { + const specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(name2); + if (specialPropertyAssignmentSymbol) { + return specialPropertyAssignmentSymbol; + } + } + } + if (name2.parent.kind === 277 && isEntityNameExpression(name2)) { + const success = resolveEntityName( + name2, + /*all meanings*/ + 111551 | 788968 | 1920 | 2097152, + /*ignoreErrors*/ + true + ); + if (success && success !== unknownSymbol) { + return success; + } + } else if (isEntityName(name2) && isInRightSideOfImportOrExportAssignment(name2)) { + const importEqualsDeclaration = getAncestor( + name2, + 271 + /* ImportEqualsDeclaration */ + ); + Debug.assert(importEqualsDeclaration !== void 0); + return getSymbolOfPartOfRightHandSideOfImportEquals( + name2, + /*dontResolveAlias*/ + true + ); + } + if (isEntityName(name2)) { + const possibleImportNode = isImportTypeQualifierPart(name2); + if (possibleImportNode) { + getTypeFromTypeNode(possibleImportNode); + const sym = getNodeLinks(name2).resolvedSymbol; + return sym === unknownSymbol ? void 0 : sym; + } + } + while (isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(name2)) { + name2 = name2.parent; + } + if (isInNameOfExpressionWithTypeArguments(name2)) { + let meaning = 0; + if (name2.parent.kind === 233) { + meaning = isPartOfTypeNode(name2) ? 788968 : 111551; + if (isExpressionWithTypeArgumentsInClassExtendsClause(name2.parent)) { + meaning |= 111551; + } + } else { + meaning = 1920; + } + meaning |= 2097152; + const entityNameSymbol = isEntityNameExpression(name2) ? resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + true + ) : void 0; + if (entityNameSymbol) { + return entityNameSymbol; + } + } + if (name2.parent.kind === 348) { + return getParameterSymbolFromJSDoc(name2.parent); + } + if (name2.parent.kind === 168 && name2.parent.parent.kind === 352) { + Debug.assert(!isInJSFile(name2)); + const typeParameter = getTypeParameterFromJsDoc(name2.parent); + return typeParameter && typeParameter.symbol; + } + if (isExpressionNode(name2)) { + if (nodeIsMissing(name2)) { + return void 0; + } + const isJSDoc2 = findAncestor(name2, or(isJSDocLinkLike, isJSDocNameReference, isJSDocMemberName)); + const meaning = isJSDoc2 ? 788968 | 1920 | 111551 : 111551; + if (name2.kind === 80) { + if (isJSXTagName(name2) && isJsxIntrinsicTagName(name2)) { + const symbol = getIntrinsicTagSymbol(name2.parent); + return symbol === unknownSymbol ? void 0 : symbol; + } + const result2 = resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + getHostSignatureFromJSDoc(name2) + ); + if (!result2 && isJSDoc2) { + const container = findAncestor(name2, or(isClassLike, isInterfaceDeclaration)); + if (container) { + return resolveJSDocMemberName( + name2, + /*ignoreErrors*/ + true, + getSymbolOfDeclaration(container) + ); + } + } + if (result2 && isJSDoc2) { + const container = getJSDocHost(name2); + if (container && isEnumMember(container) && container === result2.valueDeclaration) { + return resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + getSourceFileOfNode(container) + ) || result2; + } + } + return result2; + } else if (isPrivateIdentifier(name2)) { + return getSymbolForPrivateIdentifierExpression(name2); + } else if (name2.kind === 211 || name2.kind === 166) { + const links = getNodeLinks(name2); + if (links.resolvedSymbol) { + return links.resolvedSymbol; + } + if (name2.kind === 211) { + checkPropertyAccessExpression( + name2, + 0 + /* Normal */ + ); + if (!links.resolvedSymbol) { + links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name2.expression), getLiteralTypeFromPropertyName(name2.name)); + } + } else { + checkQualifiedName( + name2, + 0 + /* Normal */ + ); + } + if (!links.resolvedSymbol && isJSDoc2 && isQualifiedName(name2)) { + return resolveJSDocMemberName(name2); + } + return links.resolvedSymbol; + } else if (isJSDocMemberName(name2)) { + return resolveJSDocMemberName(name2); + } + } else if (isTypeReferenceIdentifier(name2)) { + const meaning = name2.parent.kind === 183 ? 788968 : 1920; + const symbol = resolveEntityName( + name2, + meaning, + /*ignoreErrors*/ + false, + /*dontResolveAlias*/ + true + ); + return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name2); + } + if (name2.parent.kind === 182) { + return resolveEntityName( + name2, + /*meaning*/ + 1 + /* FunctionScopedVariable */ + ); + } + return void 0; + } + function getApplicableIndexSymbol(type3, keyType) { + const infos = getApplicableIndexInfos(type3, keyType); + if (infos.length && type3.members) { + const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type3).members); + if (infos === getIndexInfosOfType(type3)) { + return symbol; + } else if (symbol) { + const symbolLinks2 = getSymbolLinks(symbol); + const declarationList = mapDefined(infos, (i7) => i7.declaration); + const nodeListId = map4(declarationList, getNodeId).join(","); + if (!symbolLinks2.filteredIndexSymbolCache) { + symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map(); + } + if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) { + return symbolLinks2.filteredIndexSymbolCache.get(nodeListId); + } else { + const copy4 = createSymbol( + 131072, + "__index" + /* Index */ + ); + copy4.declarations = mapDefined(infos, (i7) => i7.declaration); + copy4.parent = type3.aliasSymbol ? type3.aliasSymbol : type3.symbol ? type3.symbol : getSymbolAtLocation(copy4.declarations[0].parent); + symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy4); + return copy4; + } + } + } + } + function resolveJSDocMemberName(name2, ignoreErrors, container) { + if (isEntityName(name2)) { + const meaning = 788968 | 1920 | 111551; + let symbol = resolveEntityName( + name2, + meaning, + ignoreErrors, + /*dontResolveAlias*/ + true, + getHostSignatureFromJSDoc(name2) + ); + if (!symbol && isIdentifier(name2) && container) { + symbol = getMergedSymbol(getSymbol2(getExportsOfSymbol(container), name2.escapedText, meaning)); + } + if (symbol) { + return symbol; + } + } + const left = isIdentifier(name2) ? container : resolveJSDocMemberName(name2.left, ignoreErrors, container); + const right = isIdentifier(name2) ? name2.escapedText : name2.right.escapedText; + if (left) { + const proto = left.flags & 111551 && getPropertyOfType(getTypeOfSymbol(left), "prototype"); + const t8 = proto ? getTypeOfSymbol(proto) : getDeclaredTypeOfSymbol(left); + return getPropertyOfType(t8, right); + } + } + function getSymbolAtLocation(node, ignoreErrors) { + if (isSourceFile(node)) { + return isExternalModule(node) ? getMergedSymbol(node.symbol) : void 0; + } + const { parent: parent22 } = node; + const grandParent = parent22.parent; + if (node.flags & 67108864) { + return void 0; + } + if (isDeclarationNameOrImportPropertyName(node)) { + const parentSymbol = getSymbolOfDeclaration(parent22); + return isImportOrExportSpecifier(node.parent) && node.parent.propertyName === node ? getImmediateAliasedSymbol(parentSymbol) : parentSymbol; + } else if (isLiteralComputedPropertyDeclarationName(node)) { + return getSymbolOfDeclaration(parent22.parent); + } + if (node.kind === 80) { + if (isInRightSideOfImportOrExportAssignment(node)) { + return getSymbolOfNameOrPropertyAccessExpression(node); + } else if (parent22.kind === 208 && grandParent.kind === 206 && node === parent22.propertyName) { + const typeOfPattern = getTypeOfNode(grandParent); + const propertyDeclaration = getPropertyOfType(typeOfPattern, node.escapedText); + if (propertyDeclaration) { + return propertyDeclaration; + } + } else if (isMetaProperty(parent22) && parent22.name === node) { + if (parent22.keywordToken === 105 && idText(node) === "target") { + return checkNewTargetMetaProperty(parent22).symbol; + } + if (parent22.keywordToken === 102 && idText(node) === "meta") { + return getGlobalImportMetaExpressionType().members.get("meta"); + } + return void 0; + } + } + switch (node.kind) { + case 80: + case 81: + case 211: + case 166: + if (!isThisInTypeQuery(node)) { + return getSymbolOfNameOrPropertyAccessExpression(node); + } + case 110: + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (isFunctionLike(container)) { + const sig = getSignatureFromDeclaration(container); + if (sig.thisParameter) { + return sig.thisParameter; + } + } + if (isInExpressionContext(node)) { + return checkExpression(node).symbol; + } + case 197: + return getTypeFromThisTypeNode(node).symbol; + case 108: + return checkExpression(node).symbol; + case 137: + const constructorDeclaration = node.parent; + if (constructorDeclaration && constructorDeclaration.kind === 176) { + return constructorDeclaration.parent.symbol; + } + return void 0; + case 11: + case 15: + if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 || node.parent.kind === 278) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall( + node.parent, + /*requireStringLiteralLikeArgument*/ + false + ) || isImportCall(node.parent)) || isLiteralTypeNode(node.parent) && isLiteralImportTypeNode(node.parent.parent) && node.parent.parent.argument === node.parent) { + return resolveExternalModuleName(node, node, ignoreErrors); + } + if (isCallExpression(parent22) && isBindableObjectDefinePropertyCall(parent22) && parent22.arguments[1] === node) { + return getSymbolOfDeclaration(parent22); + } + case 9: + const objectType2 = isElementAccessExpression(parent22) ? parent22.argumentExpression === node ? getTypeOfExpression(parent22.expression) : void 0 : isLiteralTypeNode(parent22) && isIndexedAccessTypeNode(grandParent) ? getTypeFromTypeNode(grandParent.objectType) : void 0; + return objectType2 && getPropertyOfType(objectType2, escapeLeadingUnderscores(node.text)); + case 90: + case 100: + case 39: + case 86: + return getSymbolOfNode(node.parent); + case 205: + return isLiteralImportTypeNode(node) ? getSymbolAtLocation(node.argument.literal, ignoreErrors) : void 0; + case 95: + return isExportAssignment(node.parent) ? Debug.checkDefined(node.parent.symbol) : void 0; + case 102: + case 105: + return isMetaProperty(node.parent) ? checkMetaPropertyKeyword(node.parent).symbol : void 0; + case 104: + if (isBinaryExpression(node.parent)) { + const type3 = getTypeOfExpression(node.parent.right); + const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(type3); + return (hasInstanceMethodType == null ? void 0 : hasInstanceMethodType.symbol) ?? type3.symbol; + } + return void 0; + case 236: + return checkExpression(node).symbol; + case 295: + if (isJSXTagName(node) && isJsxIntrinsicTagName(node)) { + const symbol = getIntrinsicTagSymbol(node.parent); + return symbol === unknownSymbol ? void 0 : symbol; + } + default: + return void 0; + } + } + function getIndexInfosAtLocation(node) { + if (isIdentifier(node) && isPropertyAccessExpression(node.parent) && node.parent.name === node) { + const keyType = getLiteralTypeFromPropertyName(node); + const objectType2 = getTypeOfExpression(node.parent.expression); + const objectTypes = objectType2.flags & 1048576 ? objectType2.types : [objectType2]; + return flatMap2(objectTypes, (t8) => filter2(getIndexInfosOfType(t8), (info2) => isApplicableIndexType(keyType, info2.keyType))); + } + return void 0; + } + function getShorthandAssignmentValueSymbol(location2) { + if (location2 && location2.kind === 304) { + return resolveEntityName( + location2.name, + 111551 | 2097152 + /* Alias */ + ); + } + return void 0; + } + function getExportSpecifierLocalTargetSymbol(node) { + if (isExportSpecifier(node)) { + return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName( + node.propertyName || node.name, + 111551 | 788968 | 1920 | 2097152 + /* Alias */ + ); + } else { + return resolveEntityName( + node, + 111551 | 788968 | 1920 | 2097152 + /* Alias */ + ); + } + } + function getTypeOfNode(node) { + if (isSourceFile(node) && !isExternalModule(node)) { + return errorType; + } + if (node.flags & 67108864) { + return errorType; + } + const classDecl = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + const classType = classDecl && getDeclaredTypeOfClassOrInterface(getSymbolOfDeclaration(classDecl.class)); + if (isPartOfTypeNode(node)) { + const typeFromTypeNode = getTypeFromTypeNode(node); + return classType ? getTypeWithThisArgument(typeFromTypeNode, classType.thisType) : typeFromTypeNode; + } + if (isExpressionNode(node)) { + return getRegularTypeOfExpression(node); + } + if (classType && !classDecl.isImplements) { + const baseType = firstOrUndefined(getBaseTypes(classType)); + return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType; + } + if (isTypeDeclaration(node)) { + const symbol = getSymbolOfDeclaration(node); + return getDeclaredTypeOfSymbol(symbol); + } + if (isTypeDeclarationName(node)) { + const symbol = getSymbolAtLocation(node); + return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; + } + if (isBindingElement(node)) { + return getTypeForVariableLikeDeclaration( + node, + /*includeOptionality*/ + true, + 0 + /* Normal */ + ) || errorType; + } + if (isDeclaration(node)) { + const symbol = getSymbolOfDeclaration(node); + return symbol ? getTypeOfSymbol(symbol) : errorType; + } + if (isDeclarationNameOrImportPropertyName(node)) { + const symbol = getSymbolAtLocation(node); + if (symbol) { + return getTypeOfSymbol(symbol); + } + return errorType; + } + if (isBindingPattern(node)) { + return getTypeForVariableLikeDeclaration( + node.parent, + /*includeOptionality*/ + true, + 0 + /* Normal */ + ) || errorType; + } + if (isInRightSideOfImportOrExportAssignment(node)) { + const symbol = getSymbolAtLocation(node); + if (symbol) { + const declaredType = getDeclaredTypeOfSymbol(symbol); + return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol); + } + } + if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) { + return checkMetaPropertyKeyword(node.parent); + } + if (isImportAttributes(node)) { + return getGlobalImportAttributesType( + /*reportErrors*/ + false + ); + } + return errorType; + } + function getTypeOfAssignmentPattern(expr) { + Debug.assert( + expr.kind === 210 || expr.kind === 209 + /* ArrayLiteralExpression */ + ); + if (expr.parent.kind === 250) { + const iteratedType = checkRightHandSideOfForOf(expr.parent); + return checkDestructuringAssignment(expr, iteratedType || errorType); + } + if (expr.parent.kind === 226) { + const iteratedType = getTypeOfExpression(expr.parent.right); + return checkDestructuringAssignment(expr, iteratedType || errorType); + } + if (expr.parent.kind === 303) { + const node2 = cast(expr.parent.parent, isObjectLiteralExpression); + const typeOfParentObjectLiteral = getTypeOfAssignmentPattern(node2) || errorType; + const propertyIndex = indexOfNode(node2.properties, expr.parent); + return checkObjectLiteralDestructuringPropertyAssignment(node2, typeOfParentObjectLiteral, propertyIndex); + } + const node = cast(expr.parent, isArrayLiteralExpression); + const typeOfArrayLiteral = getTypeOfAssignmentPattern(node) || errorType; + const elementType = checkIteratedTypeOrElementType(65, typeOfArrayLiteral, undefinedType2, expr.parent) || errorType; + return checkArrayLiteralDestructuringElementAssignment(node, typeOfArrayLiteral, node.elements.indexOf(expr), elementType); + } + function getPropertySymbolOfDestructuringAssignment(location2) { + const typeOfObjectLiteral = getTypeOfAssignmentPattern(cast(location2.parent.parent, isAssignmentPattern)); + return typeOfObjectLiteral && getPropertyOfType(typeOfObjectLiteral, location2.escapedText); + } + function getRegularTypeOfExpression(expr) { + if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { + expr = expr.parent; + } + return getRegularTypeOfLiteralType(getTypeOfExpression(expr)); + } + function getParentTypeOfClassElement(node) { + const classSymbol = getSymbolOfNode(node.parent); + return isStatic(node) ? getTypeOfSymbol(classSymbol) : getDeclaredTypeOfSymbol(classSymbol); + } + function getClassElementPropertyKeyType(element) { + const name2 = element.name; + switch (name2.kind) { + case 80: + return getStringLiteralType(idText(name2)); + case 9: + case 11: + return getStringLiteralType(name2.text); + case 167: + const nameType = checkComputedPropertyName(name2); + return isTypeAssignableToKind( + nameType, + 12288 + /* ESSymbolLike */ + ) ? nameType : stringType2; + default: + return Debug.fail("Unsupported property name."); + } + } + function getAugmentedPropertiesOfType(type3) { + type3 = getApparentType(type3); + const propsByName = createSymbolTable(getPropertiesOfType(type3)); + const functionType2 = getSignaturesOfType( + type3, + 0 + /* Call */ + ).length ? globalCallableFunctionType : getSignaturesOfType( + type3, + 1 + /* Construct */ + ).length ? globalNewableFunctionType : void 0; + if (functionType2) { + forEach4(getPropertiesOfType(functionType2), (p7) => { + if (!propsByName.has(p7.escapedName)) { + propsByName.set(p7.escapedName, p7); + } + }); + } + return getNamedMembers(propsByName); + } + function typeHasCallOrConstructSignatures(type3) { + return getSignaturesOfType( + type3, + 0 + /* Call */ + ).length !== 0 || getSignaturesOfType( + type3, + 1 + /* Construct */ + ).length !== 0; + } + function getRootSymbols(symbol) { + const roots = getImmediateRootSymbols(symbol); + return roots ? flatMap2(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { + if (getCheckFlags(symbol) & 6) { + return mapDefined(getSymbolLinks(symbol).containingType.types, (type3) => getPropertyOfType(type3, symbol.escapedName)); + } else if (symbol.flags & 33554432) { + const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol; + return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol)); + } + return void 0; + } + function tryGetTarget(symbol) { + let target; + let next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; + } + function isArgumentsLocalBinding(nodeIn) { + if (isGeneratedIdentifier(nodeIn)) + return false; + const node = getParseTreeNode(nodeIn, isIdentifier); + if (!node) + return false; + const parent22 = node.parent; + if (!parent22) + return false; + const isPropertyName2 = (isPropertyAccessExpression(parent22) || isPropertyAssignment(parent22)) && parent22.name === node; + return !isPropertyName2 && getReferencedValueSymbol(node) === argumentsSymbol; + } + function moduleExportsSomeValue(moduleReferenceExpression) { + let moduleSymbol = resolveExternalModuleName(moduleReferenceExpression.parent, moduleReferenceExpression); + if (!moduleSymbol || isShorthandAmbientModuleSymbol(moduleSymbol)) { + return true; + } + const hasExportAssignment = hasExportAssignmentSymbol(moduleSymbol); + moduleSymbol = resolveExternalModuleSymbol(moduleSymbol); + const symbolLinks2 = getSymbolLinks(moduleSymbol); + if (symbolLinks2.exportsSomeValue === void 0) { + symbolLinks2.exportsSomeValue = hasExportAssignment ? !!(moduleSymbol.flags & 111551) : forEachEntry(getExportsOfModule(moduleSymbol), isValue); + } + return symbolLinks2.exportsSomeValue; + function isValue(s7) { + s7 = resolveSymbol(s7); + return s7 && !!(getSymbolFlags(s7) & 111551); + } + } + function isNameOfModuleOrEnumDeclaration(node) { + return isModuleOrEnumDeclaration(node.parent) && node === node.parent.name; + } + function getReferencedExportContainer(nodeIn, prefixLocals) { + var _a2; + const node = getParseTreeNode(nodeIn, isIdentifier); + if (node) { + let symbol = getReferencedValueSymbol( + node, + /*startInDeclarationContainer*/ + isNameOfModuleOrEnumDeclaration(node) + ); + if (symbol) { + if (symbol.flags & 1048576) { + const exportSymbol = getMergedSymbol(symbol.exportSymbol); + if (!prefixLocals && exportSymbol.flags & 944 && !(exportSymbol.flags & 3)) { + return void 0; + } + symbol = exportSymbol; + } + const parentSymbol = getParentOfSymbol(symbol); + if (parentSymbol) { + if (parentSymbol.flags & 512 && ((_a2 = parentSymbol.valueDeclaration) == null ? void 0 : _a2.kind) === 312) { + const symbolFile = parentSymbol.valueDeclaration; + const referenceFile = getSourceFileOfNode(node); + const symbolIsUmdExport = symbolFile !== referenceFile; + return symbolIsUmdExport ? void 0 : symbolFile; + } + return findAncestor(node.parent, (n7) => isModuleOrEnumDeclaration(n7) && getSymbolOfDeclaration(n7) === parentSymbol); + } + } + } + } + function getReferencedImportDeclaration(nodeIn) { + const specifier = getIdentifierGeneratedImportReference(nodeIn); + if (specifier) { + return specifier; + } + const node = getParseTreeNode(nodeIn, isIdentifier); + if (node) { + const symbol = getReferencedValueOrAliasSymbol(node); + if (isNonLocalAlias( + symbol, + /*excludes*/ + 111551 + /* Value */ + ) && !getTypeOnlyAliasDeclaration( + symbol, + 111551 + /* Value */ + )) { + return getDeclarationOfAliasSymbol(symbol); + } + } + return void 0; + } + function isSymbolOfDestructuredElementOfCatchBinding(symbol) { + return symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration) && walkUpBindingElementsAndPatterns(symbol.valueDeclaration).parent.kind === 299; + } + function isSymbolOfDeclarationWithCollidingName(symbol) { + if (symbol.flags & 418 && symbol.valueDeclaration && !isSourceFile(symbol.valueDeclaration)) { + const links = getSymbolLinks(symbol); + if (links.isDeclarationWithCollidingName === void 0) { + const container = getEnclosingBlockScopeContainer(symbol.valueDeclaration); + if (isStatementWithLocals(container) || isSymbolOfDestructuredElementOfCatchBinding(symbol)) { + const nodeLinks2 = getNodeLinks(symbol.valueDeclaration); + if (resolveName( + container.parent, + symbol.escapedName, + 111551, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + false + )) { + links.isDeclarationWithCollidingName = true; + } else if (nodeLinks2.flags & 16384) { + const isDeclaredInLoop = nodeLinks2.flags & 32768; + const inLoopInitializer = isIterationStatement( + container, + /*lookInLabeledStatements*/ + false + ); + const inLoopBodyBlock = container.kind === 241 && isIterationStatement( + container.parent, + /*lookInLabeledStatements*/ + false + ); + links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock); + } else { + links.isDeclarationWithCollidingName = false; + } + } + } + return links.isDeclarationWithCollidingName; + } + return false; + } + function getReferencedDeclarationWithCollidingName(nodeIn) { + if (!isGeneratedIdentifier(nodeIn)) { + const node = getParseTreeNode(nodeIn, isIdentifier); + if (node) { + const symbol = getReferencedValueSymbol(node); + if (symbol && isSymbolOfDeclarationWithCollidingName(symbol)) { + return symbol.valueDeclaration; + } + } + } + return void 0; + } + function isDeclarationWithCollidingName(nodeIn) { + const node = getParseTreeNode(nodeIn, isDeclaration); + if (node) { + const symbol = getSymbolOfDeclaration(node); + if (symbol) { + return isSymbolOfDeclarationWithCollidingName(symbol); + } + } + return false; + } + function isValueAliasDeclaration(node) { + Debug.assert(canCollectSymbolAliasAccessabilityData); + switch (node.kind) { + case 271: + return isAliasResolvedToValue(getSymbolOfDeclaration(node)); + case 273: + case 274: + case 276: + case 281: + const symbol = getSymbolOfDeclaration(node); + return !!symbol && isAliasResolvedToValue( + symbol, + /*excludeTypeOnlyValues*/ + true + ); + case 278: + const exportClause = node.exportClause; + return !!exportClause && (isNamespaceExport(exportClause) || some2(exportClause.elements, isValueAliasDeclaration)); + case 277: + return node.expression && node.expression.kind === 80 ? isAliasResolvedToValue( + getSymbolOfDeclaration(node), + /*excludeTypeOnlyValues*/ + true + ) : true; + } + return false; + } + function isTopLevelValueImportEqualsWithEntityName(nodeIn) { + const node = getParseTreeNode(nodeIn, isImportEqualsDeclaration); + if (node === void 0 || node.parent.kind !== 312 || !isInternalModuleImportEqualsDeclaration(node)) { + return false; + } + const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node)); + return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference); + } + function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) { + if (!symbol) { + return false; + } + const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol)); + if (target === unknownSymbol) { + return !excludeTypeOnlyValues || !getTypeOnlyAliasDeclaration(symbol); + } + return !!(getSymbolFlags( + symbol, + excludeTypeOnlyValues, + /*excludeLocalMeanings*/ + true + ) & 111551) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target)); + } + function isConstEnumOrConstEnumOnlyModule(s7) { + return isConstEnumSymbol(s7) || !!s7.constEnumOnlyModule; + } + function isReferencedAliasDeclaration(node, checkChildren) { + Debug.assert(canCollectSymbolAliasAccessabilityData); + if (isAliasSymbolDeclaration2(node)) { + const symbol = getSymbolOfDeclaration(node); + const links = symbol && getSymbolLinks(symbol); + if (links == null ? void 0 : links.referenced) { + return true; + } + const target = getSymbolLinks(symbol).aliasTarget; + if (target && getEffectiveModifierFlags(node) & 32 && getSymbolFlags(target) & 111551 && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) { + return true; + } + } + if (checkChildren) { + return !!forEachChild(node, (node2) => isReferencedAliasDeclaration(node2, checkChildren)); + } + return false; + } + function isImplementationOfOverload(node) { + if (nodeIsPresent(node.body)) { + if (isGetAccessor(node) || isSetAccessor(node)) + return false; + const symbol = getSymbolOfDeclaration(node); + const signaturesOfSymbol = getSignaturesOfSymbol(symbol); + return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node + // e.g.: function foo(a: string): string; + // function foo(a: any) { // This is implementation of the overloads + // return a; + // } + signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node; + } + return false; + } + function isRequiredInitializedParameter(parameter) { + return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier( + parameter, + 31 + /* ParameterPropertyModifier */ + ); + } + function isOptionalUninitializedParameterProperty(parameter) { + return strictNullChecks && isOptionalParameter(parameter) && !parameter.initializer && hasSyntacticModifier( + parameter, + 31 + /* ParameterPropertyModifier */ + ); + } + function isExpandoFunctionDeclaration(node) { + const declaration = getParseTreeNode(node, isFunctionDeclaration); + if (!declaration) { + return false; + } + const symbol = getSymbolOfDeclaration(declaration); + if (!symbol || !(symbol.flags & 16)) { + return false; + } + return !!forEachEntry(getExportsOfSymbol(symbol), (p7) => p7.flags & 111551 && isExpandoPropertyDeclaration(p7.valueDeclaration)); + } + function getPropertiesOfContainerFunction(node) { + const declaration = getParseTreeNode(node, isFunctionDeclaration); + if (!declaration) { + return emptyArray; + } + const symbol = getSymbolOfDeclaration(declaration); + return symbol && getPropertiesOfType(getTypeOfSymbol(symbol)) || emptyArray; + } + function getNodeCheckFlags(node) { + var _a2; + const nodeId = node.id || 0; + if (nodeId < 0 || nodeId >= nodeLinks.length) + return 0; + return ((_a2 = nodeLinks[nodeId]) == null ? void 0 : _a2.flags) || 0; + } + function getEnumMemberValue(node) { + computeEnumMemberValues(node.parent); + return getNodeLinks(node).enumMemberValue; + } + function canHaveConstantValue(node) { + switch (node.kind) { + case 306: + case 211: + case 212: + return true; + } + return false; + } + function getConstantValue2(node) { + if (node.kind === 306) { + return getEnumMemberValue(node); + } + const symbol = getNodeLinks(node).resolvedSymbol; + if (symbol && symbol.flags & 8) { + const member = symbol.valueDeclaration; + if (isEnumConst(member.parent)) { + return getEnumMemberValue(member); + } + } + return void 0; + } + function isFunctionType(type3) { + return !!(type3.flags & 524288) && getSignaturesOfType( + type3, + 0 + /* Call */ + ).length > 0; + } + function getTypeReferenceSerializationKind(typeNameIn, location2) { + var _a2; + const typeName = getParseTreeNode(typeNameIn, isEntityName); + if (!typeName) + return 0; + if (location2) { + location2 = getParseTreeNode(location2); + if (!location2) + return 0; + } + let isTypeOnly = false; + if (isQualifiedName(typeName)) { + const rootValueSymbol = resolveEntityName( + getFirstIdentifier(typeName), + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + location2 + ); + isTypeOnly = !!((_a2 = rootValueSymbol == null ? void 0 : rootValueSymbol.declarations) == null ? void 0 : _a2.every(isTypeOnlyImportOrExportDeclaration)); + } + const valueSymbol = resolveEntityName( + typeName, + 111551, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + location2 + ); + const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 ? resolveAlias(valueSymbol) : valueSymbol; + isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration( + valueSymbol, + 111551 + /* Value */ + ))); + const typeSymbol = resolveEntityName( + typeName, + 788968, + /*ignoreErrors*/ + true, + /*dontResolveAlias*/ + true, + location2 + ); + const resolvedTypeSymbol = typeSymbol && typeSymbol.flags & 2097152 ? resolveAlias(typeSymbol) : typeSymbol; + if (!valueSymbol) { + isTypeOnly || (isTypeOnly = !!(typeSymbol && getTypeOnlyAliasDeclaration( + typeSymbol, + 788968 + /* Type */ + ))); + } + if (resolvedValueSymbol && resolvedValueSymbol === resolvedTypeSymbol) { + const globalPromiseSymbol = getGlobalPromiseConstructorSymbol( + /*reportErrors*/ + false + ); + if (globalPromiseSymbol && resolvedValueSymbol === globalPromiseSymbol) { + return 9; + } + const constructorType = getTypeOfSymbol(resolvedValueSymbol); + if (constructorType && isConstructorType(constructorType)) { + return isTypeOnly ? 10 : 1; + } + } + if (!resolvedTypeSymbol) { + return isTypeOnly ? 11 : 0; + } + const type3 = getDeclaredTypeOfSymbol(resolvedTypeSymbol); + if (isErrorType(type3)) { + return isTypeOnly ? 11 : 0; + } else if (type3.flags & 3) { + return 11; + } else if (isTypeAssignableToKind( + type3, + 16384 | 98304 | 131072 + /* Never */ + )) { + return 2; + } else if (isTypeAssignableToKind( + type3, + 528 + /* BooleanLike */ + )) { + return 6; + } else if (isTypeAssignableToKind( + type3, + 296 + /* NumberLike */ + )) { + return 3; + } else if (isTypeAssignableToKind( + type3, + 2112 + /* BigIntLike */ + )) { + return 4; + } else if (isTypeAssignableToKind( + type3, + 402653316 + /* StringLike */ + )) { + return 5; + } else if (isTupleType(type3)) { + return 7; + } else if (isTypeAssignableToKind( + type3, + 12288 + /* ESSymbolLike */ + )) { + return 8; + } else if (isFunctionType(type3)) { + return 10; + } else if (isArrayType(type3)) { + return 7; + } else { + return 11; + } + } + function createTypeOfDeclaration(declarationIn, enclosingDeclaration, flags, tracker, addUndefined) { + const declaration = getParseTreeNode(declarationIn, isVariableLikeOrAccessor); + if (!declaration) { + return factory.createToken( + 133 + /* AnyKeyword */ + ); + } + const symbol = getSymbolOfDeclaration(declaration); + let type3 = symbol && !(symbol.flags & (2048 | 131072)) ? getWidenedLiteralType(getTypeOfSymbol(symbol)) : errorType; + if (type3.flags & 8192 && type3.symbol === symbol) { + flags |= 1048576; + } + if (addUndefined) { + type3 = getOptionalType(type3); + } + return nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, flags | 1024, tracker); + } + function createReturnTypeOfSignatureDeclaration(signatureDeclarationIn, enclosingDeclaration, flags, tracker) { + const signatureDeclaration = getParseTreeNode(signatureDeclarationIn, isFunctionLike); + if (!signatureDeclaration) { + return factory.createToken( + 133 + /* AnyKeyword */ + ); + } + const signature = getSignatureFromDeclaration(signatureDeclaration); + return nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, tracker); + } + function createTypeOfExpression(exprIn, enclosingDeclaration, flags, tracker) { + const expr = getParseTreeNode(exprIn, isExpression); + if (!expr) { + return factory.createToken( + 133 + /* AnyKeyword */ + ); + } + const type3 = getWidenedType(getRegularTypeOfExpression(expr)); + return nodeBuilder.typeToTypeNode(type3, enclosingDeclaration, flags | 1024, tracker); + } + function hasGlobalName(name2) { + return globals3.has(escapeLeadingUnderscores(name2)); + } + function getReferencedValueSymbol(reference, startInDeclarationContainer) { + const resolvedSymbol = getNodeLinks(reference).resolvedSymbol; + if (resolvedSymbol) { + return resolvedSymbol; + } + let location2 = reference; + if (startInDeclarationContainer) { + const parent22 = reference.parent; + if (isDeclaration(parent22) && reference === parent22.name) { + location2 = getDeclarationContainer(parent22); + } + } + return resolveName( + location2, + reference.escapedText, + 111551 | 1048576 | 2097152, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true + ); + } + function getReferencedValueOrAliasSymbol(reference) { + const resolvedSymbol = getNodeLinks(reference).resolvedSymbol; + if (resolvedSymbol && resolvedSymbol !== unknownSymbol) { + return resolvedSymbol; + } + return resolveName( + reference, + reference.escapedText, + 111551 | 1048576 | 2097152, + /*nameNotFoundMessage*/ + void 0, + /*nameArg*/ + void 0, + /*isUse*/ + true, + /*excludeGlobals*/ + void 0, + /*getSpellingSuggestions*/ + void 0 + ); + } + function getReferencedValueDeclaration(referenceIn) { + if (!isGeneratedIdentifier(referenceIn)) { + const reference = getParseTreeNode(referenceIn, isIdentifier); + if (reference) { + const symbol = getReferencedValueSymbol(reference); + if (symbol) { + return getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; + } + } + } + return void 0; + } + function getReferencedValueDeclarations(referenceIn) { + if (!isGeneratedIdentifier(referenceIn)) { + const reference = getParseTreeNode(referenceIn, isIdentifier); + if (reference) { + const symbol = getReferencedValueSymbol(reference); + if (symbol) { + return filter2(getExportSymbolOfValueSymbolIfExported(symbol).declarations, (declaration) => { + switch (declaration.kind) { + case 260: + case 169: + case 208: + case 172: + case 303: + case 304: + case 306: + case 210: + case 262: + case 218: + case 219: + case 263: + case 231: + case 266: + case 174: + case 177: + case 178: + case 267: + return true; + } + return false; + }); + } + } + } + return void 0; + } + function isLiteralConstDeclaration(node) { + if (isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConstLike(node)) { + return isFreshLiteralType(getTypeOfSymbol(getSymbolOfDeclaration(node))); + } + return false; + } + function literalTypeToNode(type3, enclosing, tracker) { + const enumResult = type3.flags & 1056 ? nodeBuilder.symbolToExpression( + type3.symbol, + 111551, + enclosing, + /*flags*/ + void 0, + tracker + ) : type3 === trueType ? factory.createTrue() : type3 === falseType && factory.createFalse(); + if (enumResult) + return enumResult; + const literalValue = type3.value; + return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue); + } + function createLiteralConstValue(node, tracker) { + const type3 = getTypeOfSymbol(getSymbolOfDeclaration(node)); + return literalTypeToNode(type3, node, tracker); + } + function getJsxFactoryEntity(location2) { + return location2 ? (getJsxNamespace(location2), getSourceFileOfNode(location2).localJsxFactory || _jsxFactoryEntity) : _jsxFactoryEntity; + } + function getJsxFragmentFactoryEntity(location2) { + if (location2) { + const file = getSourceFileOfNode(location2); + if (file) { + if (file.localJsxFragmentFactory) { + return file.localJsxFragmentFactory; + } + const jsxFragPragmas = file.pragmas.get("jsxfrag"); + const jsxFragPragma = isArray3(jsxFragPragmas) ? jsxFragPragmas[0] : jsxFragPragmas; + if (jsxFragPragma) { + file.localJsxFragmentFactory = parseIsolatedEntityName(jsxFragPragma.arguments.factory, languageVersion); + return file.localJsxFragmentFactory; + } + } + } + if (compilerOptions.jsxFragmentFactory) { + return parseIsolatedEntityName(compilerOptions.jsxFragmentFactory, languageVersion); + } + } + function createResolver4() { + const resolvedTypeReferenceDirectives = host.getResolvedTypeReferenceDirectives(); + let fileToDirective; + if (resolvedTypeReferenceDirectives) { + fileToDirective = /* @__PURE__ */ new Map(); + resolvedTypeReferenceDirectives.forEach(({ resolvedTypeReferenceDirective }, key, mode) => { + if (!(resolvedTypeReferenceDirective == null ? void 0 : resolvedTypeReferenceDirective.resolvedFileName)) { + return; + } + const file = host.getSourceFile(resolvedTypeReferenceDirective.resolvedFileName); + if (file) { + addReferencedFilesToTypeDirective(file, key, mode); + } + }); + } + return { + getReferencedExportContainer, + getReferencedImportDeclaration, + getReferencedDeclarationWithCollidingName, + isDeclarationWithCollidingName, + isValueAliasDeclaration: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node && canCollectSymbolAliasAccessabilityData ? isValueAliasDeclaration(node) : true; + }, + hasGlobalName, + isReferencedAliasDeclaration: (nodeIn, checkChildren) => { + const node = getParseTreeNode(nodeIn); + return node && canCollectSymbolAliasAccessabilityData ? isReferencedAliasDeclaration(node, checkChildren) : true; + }, + getNodeCheckFlags: (nodeIn) => { + const node = getParseTreeNode(nodeIn); + return node ? getNodeCheckFlags(node) : 0; + }, + isTopLevelValueImportEqualsWithEntityName, + isDeclarationVisible, + isImplementationOfOverload, + isRequiredInitializedParameter, + isOptionalUninitializedParameterProperty, + isExpandoFunctionDeclaration, + getPropertiesOfContainerFunction, + createTypeOfDeclaration, + createReturnTypeOfSignatureDeclaration, + createTypeOfExpression, + createLiteralConstValue, + isSymbolAccessible, + isEntityNameVisible, + getConstantValue: (nodeIn) => { + const node = getParseTreeNode(nodeIn, canHaveConstantValue); + return node ? getConstantValue2(node) : void 0; + }, + collectLinkedAliases, + getReferencedValueDeclaration, + getReferencedValueDeclarations, + getTypeReferenceSerializationKind, + isOptionalParameter, + moduleExportsSomeValue, + isArgumentsLocalBinding, + getExternalModuleFileFromDeclaration: (nodeIn) => { + const node = getParseTreeNode(nodeIn, hasPossibleExternalModuleReference); + return node && getExternalModuleFileFromDeclaration(node); + }, + getTypeReferenceDirectivesForEntityName, + getTypeReferenceDirectivesForSymbol, + isLiteralConstDeclaration, + isLateBound: (nodeIn) => { + const node = getParseTreeNode(nodeIn, isDeclaration); + const symbol = node && getSymbolOfDeclaration(node); + return !!(symbol && getCheckFlags(symbol) & 4096); + }, + getJsxFactoryEntity, + getJsxFragmentFactoryEntity, + getAllAccessorDeclarations(accessor) { + accessor = getParseTreeNode(accessor, isGetOrSetAccessorDeclaration); + const otherKind = accessor.kind === 178 ? 177 : 178; + const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(accessor), otherKind); + const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor; + const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor; + const setAccessor = accessor.kind === 178 ? accessor : otherAccessor; + const getAccessor = accessor.kind === 177 ? accessor : otherAccessor; + return { + firstAccessor, + secondAccessor, + setAccessor, + getAccessor + }; + }, + getSymbolOfExternalModuleSpecifier: (moduleName3) => resolveExternalModuleNameWorker( + moduleName3, + moduleName3, + /*moduleNotFoundError*/ + void 0 + ), + isBindingCapturedByNode: (node, decl) => { + const parseNode = getParseTreeNode(node); + const parseDecl = getParseTreeNode(decl); + return !!parseNode && !!parseDecl && (isVariableDeclaration(parseDecl) || isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl); + }, + getDeclarationStatementsForSourceFile: (node, flags, tracker, bundled) => { + const n7 = getParseTreeNode(node); + Debug.assert(n7 && n7.kind === 312, "Non-sourcefile node passed into getDeclarationsForSourceFile"); + const sym = getSymbolOfDeclaration(node); + if (!sym) { + return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker, bundled); + } + return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled); + }, + isImportRequiredByAugmentation, + tryFindAmbientModule: (moduleReferenceExpression) => { + const node = getParseTreeNode(moduleReferenceExpression); + const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0; + return moduleSpecifier !== void 0 ? tryFindAmbientModule( + moduleSpecifier, + /*withAugmentations*/ + true + ) : void 0; + } + }; + function isImportRequiredByAugmentation(node) { + const file = getSourceFileOfNode(node); + if (!file.symbol) + return false; + const importTarget = getExternalModuleFileFromDeclaration(node); + if (!importTarget) + return false; + if (importTarget === file) + return false; + const exports29 = getExportsOfModule(file.symbol); + for (const s7 of arrayFrom(exports29.values())) { + if (s7.mergeId) { + const merged = getMergedSymbol(s7); + if (merged.declarations) { + for (const d7 of merged.declarations) { + const declFile = getSourceFileOfNode(d7); + if (declFile === importTarget) { + return true; + } + } + } + } + } + return false; + } + function isInHeritageClause(node) { + return node.parent && node.parent.kind === 233 && node.parent.parent && node.parent.parent.kind === 298; + } + function getTypeReferenceDirectivesForEntityName(node) { + if (!fileToDirective) { + return void 0; + } + let meaning; + if (node.parent.kind === 167) { + meaning = 111551 | 1048576; + } else { + meaning = 788968 | 1920; + if (node.kind === 80 && isInTypeQuery(node) || node.kind === 211 && !isInHeritageClause(node)) { + meaning = 111551 | 1048576; + } + } + const symbol = resolveEntityName( + node, + meaning, + /*ignoreErrors*/ + true + ); + return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : void 0; + } + function getTypeReferenceDirectivesForSymbol(symbol, meaning) { + if (!fileToDirective || !isSymbolFromTypeDeclarationFile(symbol)) { + return void 0; + } + let typeReferenceDirectives; + for (const decl of symbol.declarations) { + if (decl.symbol && decl.symbol.flags & meaning) { + const file = getSourceFileOfNode(decl); + const typeReferenceDirective = fileToDirective.get(file.path); + if (typeReferenceDirective) { + (typeReferenceDirectives || (typeReferenceDirectives = [])).push(typeReferenceDirective); + } else { + return void 0; + } + } + } + return typeReferenceDirectives; + } + function isSymbolFromTypeDeclarationFile(symbol) { + if (!symbol.declarations) { + return false; + } + let current = symbol; + while (true) { + const parent22 = getParentOfSymbol(current); + if (parent22) { + current = parent22; + } else { + break; + } + } + if (current.valueDeclaration && current.valueDeclaration.kind === 312 && current.flags & 512) { + return false; + } + for (const decl of symbol.declarations) { + const file = getSourceFileOfNode(decl); + if (fileToDirective.has(file.path)) { + return true; + } + } + return false; + } + function addReferencedFilesToTypeDirective(file, key, mode) { + if (fileToDirective.has(file.path)) + return; + fileToDirective.set(file.path, [key, mode]); + for (const { fileName } of file.referencedFiles) { + const resolvedFile = resolveTripleslashReference(fileName, file.fileName); + const referencedFile = host.getSourceFile(resolvedFile); + if (referencedFile) { + addReferencedFilesToTypeDirective(referencedFile, key, mode || file.impliedNodeFormat); + } + } + } + } + function getExternalModuleFileFromDeclaration(declaration) { + const specifier = declaration.kind === 267 ? tryCast(declaration.name, isStringLiteral) : getExternalModuleName(declaration); + const moduleSymbol = resolveExternalModuleNameWorker( + specifier, + specifier, + /*moduleNotFoundError*/ + void 0 + ); + if (!moduleSymbol) { + return void 0; + } + return getDeclarationOfKind( + moduleSymbol, + 312 + /* SourceFile */ + ); + } + function initializeTypeChecker() { + for (const file of host.getSourceFiles()) { + bindSourceFile(file, compilerOptions); + } + amalgamatedDuplicates = /* @__PURE__ */ new Map(); + let augmentations; + for (const file of host.getSourceFiles()) { + if (file.redirectInfo) { + continue; + } + if (!isExternalOrCommonJsModule(file)) { + const fileGlobalThisSymbol = file.locals.get("globalThis"); + if (fileGlobalThisSymbol == null ? void 0 : fileGlobalThisSymbol.declarations) { + for (const declaration of fileGlobalThisSymbol.declarations) { + diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, "globalThis")); + } + } + mergeSymbolTable(globals3, file.locals); + } + if (file.jsGlobalAugmentations) { + mergeSymbolTable(globals3, file.jsGlobalAugmentations); + } + if (file.patternAmbientModules && file.patternAmbientModules.length) { + patternAmbientModules = concatenate(patternAmbientModules, file.patternAmbientModules); + } + if (file.moduleAugmentations.length) { + (augmentations || (augmentations = [])).push(file.moduleAugmentations); + } + if (file.symbol && file.symbol.globalExports) { + const source = file.symbol.globalExports; + source.forEach((sourceSymbol, id) => { + if (!globals3.has(id)) { + globals3.set(id, sourceSymbol); + } + }); + } + } + if (augmentations) { + for (const list of augmentations) { + for (const augmentation of list) { + if (!isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } + addToSymbolTable(globals3, builtinGlobals, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0); + getSymbolLinks(undefinedSymbol).type = undefinedWideningType; + getSymbolLinks(argumentsSymbol).type = getGlobalType( + "IArguments", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + getSymbolLinks(unknownSymbol).type = errorType; + getSymbolLinks(globalThisSymbol).type = createObjectType(16, globalThisSymbol); + globalArrayType = getGlobalType( + "Array", + /*arity*/ + 1, + /*reportErrors*/ + true + ); + globalObjectType = getGlobalType( + "Object", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalFunctionType = getGlobalType( + "Function", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalCallableFunctionType = strictBindCallApply && getGlobalType( + "CallableFunction", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || globalFunctionType; + globalNewableFunctionType = strictBindCallApply && getGlobalType( + "NewableFunction", + /*arity*/ + 0, + /*reportErrors*/ + true + ) || globalFunctionType; + globalStringType = getGlobalType( + "String", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalNumberType = getGlobalType( + "Number", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalBooleanType = getGlobalType( + "Boolean", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + globalRegExpType = getGlobalType( + "RegExp", + /*arity*/ + 0, + /*reportErrors*/ + true + ); + anyArrayType = createArrayType(anyType2); + autoArrayType = createArrayType(autoType); + if (autoArrayType === emptyObjectType) { + autoArrayType = createAnonymousType( + /*symbol*/ + void 0, + emptySymbols, + emptyArray, + emptyArray, + emptyArray + ); + } + globalReadonlyArrayType = getGlobalTypeOrUndefined( + "ReadonlyArray", + /*arity*/ + 1 + ) || globalArrayType; + anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType2]) : anyArrayType; + globalThisType = getGlobalTypeOrUndefined( + "ThisType", + /*arity*/ + 1 + ); + if (augmentations) { + for (const list of augmentations) { + for (const augmentation of list) { + if (isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } + amalgamatedDuplicates.forEach(({ firstFile, secondFile, conflictingSymbols }) => { + if (conflictingSymbols.size < 8) { + conflictingSymbols.forEach(({ isBlockScoped, firstFileLocations, secondFileLocations }, symbolName2) => { + const message = isBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; + for (const node of firstFileLocations) { + addDuplicateDeclarationError(node, message, symbolName2, secondFileLocations); + } + for (const node of secondFileLocations) { + addDuplicateDeclarationError(node, message, symbolName2, firstFileLocations); + } + }); + } else { + const list = arrayFrom(conflictingSymbols.keys()).join(", "); + diagnostics.add(addRelatedInfo( + createDiagnosticForNode(firstFile, Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), + createDiagnosticForNode(secondFile, Diagnostics.Conflicts_are_in_this_file) + )); + diagnostics.add(addRelatedInfo( + createDiagnosticForNode(secondFile, Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0, list), + createDiagnosticForNode(firstFile, Diagnostics.Conflicts_are_in_this_file) + )); + } + }); + amalgamatedDuplicates = void 0; + } + function checkExternalEmitHelpers(location2, helpers) { + if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { + const sourceFile = getSourceFileOfNode(location2); + if (isEffectiveExternalModule(sourceFile, compilerOptions) && !(location2.flags & 33554432)) { + const helpersModule = resolveHelpersModule(sourceFile, location2); + if (helpersModule !== unknownSymbol) { + const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers; + for (let helper = 1; helper <= 33554432; helper <<= 1) { + if (uncheckedHelpers & helper) { + for (const name2 of getHelperNames(helper)) { + if (requestedExternalEmitHelperNames.has(name2)) + continue; + requestedExternalEmitHelperNames.add(name2); + const symbol = resolveSymbol(getSymbol2( + getExportsOfModule(helpersModule), + escapeLeadingUnderscores(name2), + 111551 + /* Value */ + )); + if (!symbol) { + error22(location2, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name2); + } else if (helper & 524288) { + if (!some2(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 3)) { + error22(location2, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name2, 4); + } + } else if (helper & 1048576) { + if (!some2(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 4)) { + error22(location2, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name2, 5); + } + } else if (helper & 1024) { + if (!some2(getSignaturesOfSymbol(symbol), (signature) => getParameterCount(signature) > 2)) { + error22(location2, Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name2, 3); + } + } + } + } + } + } + requestedExternalEmitHelpers |= helpers; + } + } + } + function getHelperNames(helper) { + switch (helper) { + case 1: + return ["__extends"]; + case 2: + return ["__assign"]; + case 4: + return ["__rest"]; + case 8: + return legacyDecorators ? ["__decorate"] : ["__esDecorate", "__runInitializers"]; + case 16: + return ["__metadata"]; + case 32: + return ["__param"]; + case 64: + return ["__awaiter"]; + case 128: + return ["__generator"]; + case 256: + return ["__values"]; + case 512: + return ["__read"]; + case 1024: + return ["__spreadArray"]; + case 2048: + return ["__await"]; + case 4096: + return ["__asyncGenerator"]; + case 8192: + return ["__asyncDelegator"]; + case 16384: + return ["__asyncValues"]; + case 32768: + return ["__exportStar"]; + case 65536: + return ["__importStar"]; + case 131072: + return ["__importDefault"]; + case 262144: + return ["__makeTemplateObject"]; + case 524288: + return ["__classPrivateFieldGet"]; + case 1048576: + return ["__classPrivateFieldSet"]; + case 2097152: + return ["__classPrivateFieldIn"]; + case 4194304: + return ["__createBinding"]; + case 8388608: + return ["__setFunctionName"]; + case 16777216: + return ["__propKey"]; + case 33554432: + return ["__addDisposableResource", "__disposeResources"]; + default: + return Debug.fail("Unrecognized helper"); + } + } + function resolveHelpersModule(node, errorNode) { + if (!externalHelpersModule) { + externalHelpersModule = resolveExternalModule(node, externalHelpersModuleNameText, Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found, errorNode) || unknownSymbol; + } + return externalHelpersModule; + } + function checkGrammarModifiers(node) { + var _a2; + const quickResult = reportObviousDecoratorErrors(node) || reportObviousModifierErrors(node); + if (quickResult !== void 0) { + return quickResult; + } + if (isParameter(node) && parameterIsThisKeyword(node)) { + return grammarErrorOnFirstToken(node, Diagnostics.Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters); + } + const blockScopeKind = isVariableStatement(node) ? node.declarationList.flags & 7 : 0; + let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator; + let flags = 0; + let sawExportBeforeDecorators = false; + let hasLeadingDecorators = false; + for (const modifier of node.modifiers) { + if (isDecorator(modifier)) { + if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) { + if (node.kind === 174 && !nodeIsPresent(node.body)) { + return grammarErrorOnFirstToken(node, Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); + } else { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_are_not_valid_here); + } + } else if (legacyDecorators && (node.kind === 177 || node.kind === 178)) { + const accessors = getAllAccessorDeclarations(node.parent.members, node); + if (hasDecorators(accessors.firstAccessor) && node === accessors.secondAccessor) { + return grammarErrorOnFirstToken(node, Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); + } + } + if (flags & ~(2080 | 32768)) { + return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here); + } + if (hasLeadingDecorators && flags & 98303) { + Debug.assertIsDefined(firstDecorator); + const sourceFile = getSourceFileOfNode(modifier); + if (!hasParseDiagnostics(sourceFile)) { + addRelatedInfo( + error22(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here) + ); + return true; + } + return false; + } + flags |= 32768; + if (!(flags & 98303)) { + hasLeadingDecorators = true; + } else if (flags & 32) { + sawExportBeforeDecorators = true; + } + firstDecorator ?? (firstDecorator = modifier); + } else { + if (modifier.kind !== 148) { + if (node.kind === 171 || node.kind === 173) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_member, tokenToString(modifier.kind)); + } + if (node.kind === 181 && (modifier.kind !== 126 || !isClassLike(node.parent))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_index_signature, tokenToString(modifier.kind)); + } + } + if (modifier.kind !== 103 && modifier.kind !== 147 && modifier.kind !== 87) { + if (node.kind === 168) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_type_parameter, tokenToString(modifier.kind)); + } + } + switch (modifier.kind) { + case 87: { + if (node.kind !== 266 && node.kind !== 168) { + return grammarErrorOnNode(node, Diagnostics.A_class_member_cannot_have_the_0_keyword, tokenToString( + 87 + /* ConstKeyword */ + )); + } + const parent22 = isJSDocTemplateTag(node.parent) && getEffectiveJSDocHost(node.parent) || node.parent; + if (node.kind === 168 && !(isFunctionLikeDeclaration(parent22) || isClassLike(parent22) || isFunctionTypeNode(parent22) || isConstructorTypeNode(parent22) || isCallSignatureDeclaration(parent22) || isConstructSignatureDeclaration(parent22) || isMethodSignature(parent22))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_function_method_or_class, tokenToString(modifier.kind)); + } + break; + } + case 164: + if (flags & 16) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "override"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "override", "declare"); + } else if (flags & 8) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "readonly"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "accessor"); + } else if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "override", "async"); + } + flags |= 16; + lastOverride = modifier; + break; + case 125: + case 124: + case 123: + const text = visibilityToString(modifierToFlag(modifier.kind)); + if (flags & 7) { + return grammarErrorOnNode(modifier, Diagnostics.Accessibility_modifier_already_seen); + } else if (flags & 16) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "override"); + } else if (flags & 256) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "accessor"); + } else if (flags & 8) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "readonly"); + } else if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); + } else if (node.parent.kind === 268 || node.parent.kind === 312) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); + } else if (flags & 64) { + if (modifier.kind === 123) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, text, "abstract"); + } else { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, text, "abstract"); + } + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier); + } + flags |= modifierToFlag(modifier.kind); + break; + case 126: + if (flags & 256) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "static"); + } else if (flags & 8) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "readonly"); + } else if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "accessor"); + } else if (node.parent.kind === 268 || node.parent.kind === 312) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); + } else if (node.kind === 169) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } else if (flags & 16) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "static", "override"); + } + flags |= 256; + lastStatic = modifier; + break; + case 129: + if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "accessor"); + } else if (flags & 8) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "readonly"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "accessor", "declare"); + } else if (node.kind !== 172) { + return grammarErrorOnNode(modifier, Diagnostics.accessor_modifier_can_only_appear_on_a_property_declaration); + } + flags |= 512; + break; + case 148: + if (flags & 8) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "readonly"); + } else if (node.kind !== 172 && node.kind !== 171 && node.kind !== 181 && node.kind !== 169) { + return grammarErrorOnNode(modifier, Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "readonly", "accessor"); + } + flags |= 8; + break; + case 95: + if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432) && node.kind !== 265 && node.kind !== 264 && // ModuleDeclaration needs to be checked that it is uninstantiated later + node.kind !== 267 && node.parent.kind === 312 && (moduleKind === 1 || getSourceFileOfNode(node).impliedNodeFormat === 1)) { + return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + if (flags & 32) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "export"); + } else if (flags & 128) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); + } else if (flags & 64) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "abstract"); + } else if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); + } else if (isClassLike(node.parent)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "export"); + } else if (node.kind === 169) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); + } else if (blockScopeKind === 4) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "export"); + } else if (blockScopeKind === 6) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "export"); + } + flags |= 32; + break; + case 90: + const container = node.parent.kind === 312 ? node.parent : node.parent.parent; + if (container.kind === 267 && !isAmbientModule(container)) { + return grammarErrorOnNode(modifier, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); + } else if (blockScopeKind === 4) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "default"); + } else if (blockScopeKind === 6) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "default"); + } else if (!(flags & 32)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "export", "default"); + } else if (sawExportBeforeDecorators) { + return grammarErrorOnNode(firstDecorator, Diagnostics.Decorators_are_not_valid_here); + } + flags |= 2048; + break; + case 138: + if (flags & 128) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "declare"); + } else if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (flags & 16) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "override"); + } else if (isClassLike(node.parent) && !isPropertyDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind, "declare"); + } else if (node.kind === 169) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); + } else if (blockScopeKind === 4) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_using_declaration, "declare"); + } else if (blockScopeKind === 6) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_an_await_using_declaration, "declare"); + } else if (node.parent.flags & 33554432 && node.parent.kind === 268) { + return grammarErrorOnNode(modifier, Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); + } else if (isPrivateIdentifierClassElementDeclaration(node)) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "declare"); + } else if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "declare", "accessor"); + } + flags |= 128; + lastDeclare = modifier; + break; + case 128: + if (flags & 64) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "abstract"); + } + if (node.kind !== 263 && node.kind !== 185) { + if (node.kind !== 174 && node.kind !== 172 && node.kind !== 177 && node.kind !== 178) { + return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); + } + if (!(node.parent.kind === 263 && hasSyntacticModifier( + node.parent, + 64 + /* Abstract */ + ))) { + const message = node.kind === 172 ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class; + return grammarErrorOnNode(modifier, message); + } + if (flags & 256) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract"); + } + if (flags & 2) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "private", "abstract"); + } + if (flags & 1024 && lastAsync) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + if (flags & 16) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "override"); + } + if (flags & 512) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "abstract", "accessor"); + } + } + if (isNamedDeclaration(node) && node.name.kind === 81) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier, "abstract"); + } + flags |= 64; + break; + case 134: + if (flags & 1024) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, "async"); + } else if (flags & 128 || node.parent.flags & 33554432) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); + } else if (node.kind === 169) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); + } + if (flags & 64) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "async", "abstract"); + } + flags |= 1024; + lastAsync = modifier; + break; + case 103: + case 147: { + const inOutFlag = modifier.kind === 103 ? 8192 : 16384; + const inOutText = modifier.kind === 103 ? "in" : "out"; + const parent22 = isJSDocTemplateTag(node.parent) && (getEffectiveJSDocHost(node.parent) || find2((_a2 = getJSDocRoot(node.parent)) == null ? void 0 : _a2.tags, isJSDocTypedefTag)) || node.parent; + if (node.kind !== 168 || parent22 && !(isInterfaceDeclaration(parent22) || isClassLike(parent22) || isTypeAliasDeclaration(parent22) || isJSDocTypedefTag(parent22))) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias, inOutText); + } + if (flags & inOutFlag) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_already_seen, inOutText); + } + if (inOutFlag & 8192 && flags & 16384) { + return grammarErrorOnNode(modifier, Diagnostics._0_modifier_must_precede_1_modifier, "in", "out"); + } + flags |= inOutFlag; + break; + } + } + } + } + if (node.kind === 176) { + if (flags & 256) { + return grammarErrorOnNode(lastStatic, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); + } + if (flags & 16) { + return grammarErrorOnNode(lastOverride, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "override"); + } + if (flags & 1024) { + return grammarErrorOnNode(lastAsync, Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "async"); + } + return false; + } else if ((node.kind === 272 || node.kind === 271) && flags & 128) { + return grammarErrorOnNode(lastDeclare, Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); + } else if (node.kind === 169 && flags & 31 && isBindingPattern(node.name)) { + return grammarErrorOnNode(node, Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); + } else if (node.kind === 169 && flags & 31 && node.dotDotDotToken) { + return grammarErrorOnNode(node, Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); + } + if (flags & 1024) { + return checkGrammarAsyncModifier(node, lastAsync); + } + return false; + } + function reportObviousModifierErrors(node) { + if (!node.modifiers) + return false; + const modifier = findFirstIllegalModifier(node); + return modifier && grammarErrorOnFirstToken(modifier, Diagnostics.Modifiers_cannot_appear_here); + } + function findFirstModifierExcept(node, allowedModifier) { + const modifier = find2(node.modifiers, isModifier); + return modifier && modifier.kind !== allowedModifier ? modifier : void 0; + } + function findFirstIllegalModifier(node) { + switch (node.kind) { + case 177: + case 178: + case 176: + case 172: + case 171: + case 174: + case 173: + case 181: + case 267: + case 272: + case 271: + case 278: + case 277: + case 218: + case 219: + case 169: + case 168: + return void 0; + case 175: + case 303: + case 304: + case 270: + case 282: + return find2(node.modifiers, isModifier); + default: + if (node.parent.kind === 268 || node.parent.kind === 312) { + return void 0; + } + switch (node.kind) { + case 262: + return findFirstModifierExcept( + node, + 134 + /* AsyncKeyword */ + ); + case 263: + case 185: + return findFirstModifierExcept( + node, + 128 + /* AbstractKeyword */ + ); + case 231: + case 264: + case 265: + return find2(node.modifiers, isModifier); + case 243: + return node.declarationList.flags & 4 ? findFirstModifierExcept( + node, + 135 + /* AwaitKeyword */ + ) : find2(node.modifiers, isModifier); + case 266: + return findFirstModifierExcept( + node, + 87 + /* ConstKeyword */ + ); + default: + Debug.assertNever(node); + } + } + } + function reportObviousDecoratorErrors(node) { + const decorator = findFirstIllegalDecorator(node); + return decorator && grammarErrorOnFirstToken(decorator, Diagnostics.Decorators_are_not_valid_here); + } + function findFirstIllegalDecorator(node) { + return canHaveIllegalDecorators(node) ? find2(node.modifiers, isDecorator) : void 0; + } + function checkGrammarAsyncModifier(node, asyncModifier) { + switch (node.kind) { + case 174: + case 262: + case 218: + case 219: + return false; + } + return grammarErrorOnNode(asyncModifier, Diagnostics._0_modifier_cannot_be_used_here, "async"); + } + function checkGrammarForDisallowedTrailingComma(list, diag2 = Diagnostics.Trailing_comma_not_allowed) { + if (list && list.hasTrailingComma) { + return grammarErrorAtPos(list[0], list.end - ",".length, ",".length, diag2); + } + return false; + } + function checkGrammarTypeParameterList(typeParameters, file) { + if (typeParameters && typeParameters.length === 0) { + const start = typeParameters.pos - "<".length; + const end = skipTrivia(file.text, typeParameters.end) + ">".length; + return grammarErrorAtPos(file, start, end - start, Diagnostics.Type_parameter_list_cannot_be_empty); + } + return false; + } + function checkGrammarParameterList(parameters) { + let seenOptionalParameter = false; + const parameterCount = parameters.length; + for (let i7 = 0; i7 < parameterCount; i7++) { + const parameter = parameters[i7]; + if (parameter.dotDotDotToken) { + if (i7 !== parameterCount - 1) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); + } + if (!(parameter.flags & 33554432)) { + checkGrammarForDisallowedTrailingComma(parameters, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_rest_parameter_cannot_be_optional); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer); + } + } else if (isOptionalParameter(parameter)) { + seenOptionalParameter = true; + if (parameter.questionToken && parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer); + } + } else if (seenOptionalParameter && !parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); + } + } + } + function getNonSimpleParameters(parameters) { + return filter2(parameters, (parameter) => !!parameter.initializer || isBindingPattern(parameter.name) || isRestParameter(parameter)); + } + function checkGrammarForUseStrictSimpleParameterList(node) { + if (languageVersion >= 3) { + const useStrictDirective = node.body && isBlock2(node.body) && findUseStrictPrologue(node.body.statements); + if (useStrictDirective) { + const nonSimpleParameters = getNonSimpleParameters(node.parameters); + if (length(nonSimpleParameters)) { + forEach4(nonSimpleParameters, (parameter) => { + addRelatedInfo( + error22(parameter, Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive), + createDiagnosticForNode(useStrictDirective, Diagnostics.use_strict_directive_used_here) + ); + }); + const diagnostics2 = nonSimpleParameters.map((parameter, index4) => index4 === 0 ? createDiagnosticForNode(parameter, Diagnostics.Non_simple_parameter_declared_here) : createDiagnosticForNode(parameter, Diagnostics.and_here)); + addRelatedInfo(error22(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2); + return true; + } + } + } + return false; + } + function checkGrammarFunctionLikeDeclaration(node) { + const file = getSourceFileOfNode(node); + return checkGrammarModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file) || isFunctionLikeDeclaration(node) && checkGrammarForUseStrictSimpleParameterList(node); + } + function checkGrammarClassLikeDeclaration(node) { + const file = getSourceFileOfNode(node); + return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); + } + function checkGrammarArrowFunction(node, file) { + if (!isArrowFunction(node)) { + return false; + } + if (node.typeParameters && !(length(node.typeParameters) > 1 || node.typeParameters.hasTrailingComma || node.typeParameters[0].constraint)) { + if (file && fileExtensionIsOneOf(file.fileName, [ + ".mts", + ".cts" + /* Cts */ + ])) { + grammarErrorOnNode(node.typeParameters[0], Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint); + } + } + const { equalsGreaterThanToken } = node; + const startLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + const endLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, Diagnostics.Line_terminator_not_permitted_before_arrow); + } + function checkGrammarIndexSignatureParameters(node) { + const parameter = node.parameters[0]; + if (node.parameters.length !== 1) { + if (parameter) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } else { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_exactly_one_parameter); + } + } + checkGrammarForDisallowedTrailingComma(node.parameters, Diagnostics.An_index_signature_cannot_have_a_trailing_comma); + if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); + } + if (hasEffectiveModifiers(parameter)) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); + } + if (parameter.initializer) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); + } + if (!parameter.type) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); + } + const type3 = getTypeFromTypeNode(parameter.type); + if (someType(type3, (t8) => !!(t8.flags & 8576)) || isGenericType(type3)) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead); + } + if (!everyType(type3, isValidIndexKeyType)) { + return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type); + } + if (!node.type) { + return grammarErrorOnNode(node, Diagnostics.An_index_signature_must_have_a_type_annotation); + } + return false; + } + function checkGrammarIndexSignature(node) { + return checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node); + } + function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { + if (typeArguments && typeArguments.length === 0) { + const sourceFile = getSourceFileOfNode(node); + const start = typeArguments.pos - "<".length; + const end = skipTrivia(sourceFile.text, typeArguments.end) + ">".length; + return grammarErrorAtPos(sourceFile, start, end - start, Diagnostics.Type_argument_list_cannot_be_empty); + } + return false; + } + function checkGrammarTypeArguments(node, typeArguments) { + return checkGrammarForDisallowedTrailingComma(typeArguments) || checkGrammarForAtLeastOneTypeArgument(node, typeArguments); + } + function checkGrammarTaggedTemplateChain(node) { + if (node.questionDotToken || node.flags & 64) { + return grammarErrorOnNode(node.template, Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain); + } + return false; + } + function checkGrammarHeritageClause(node) { + const types3 = node.types; + if (checkGrammarForDisallowedTrailingComma(types3)) { + return true; + } + if (types3 && types3.length === 0) { + const listType = tokenToString(node.token); + return grammarErrorAtPos(node, types3.pos, 0, Diagnostics._0_list_cannot_be_empty, listType); + } + return some2(types3, checkGrammarExpressionWithTypeArguments); + } + function checkGrammarExpressionWithTypeArguments(node) { + if (isExpressionWithTypeArguments(node) && isImportKeyword(node.expression) && node.typeArguments) { + return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); + } + return checkGrammarTypeArguments(node, node.typeArguments); + } + function checkGrammarClassDeclarationHeritageClauses(node) { + let seenExtendsClause = false; + let seenImplementsClause = false; + if (!checkGrammarModifiers(node) && node.heritageClauses) { + for (const heritageClause of node.heritageClauses) { + if (heritageClause.token === 96) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); + } + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_must_precede_implements_clause); + } + if (heritageClause.types.length > 1) { + return grammarErrorOnFirstToken(heritageClause.types[1], Diagnostics.Classes_can_only_extend_a_single_class); + } + seenExtendsClause = true; + } else { + Debug.assert( + heritageClause.token === 119 + /* ImplementsKeyword */ + ); + if (seenImplementsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.implements_clause_already_seen); + } + seenImplementsClause = true; + } + checkGrammarHeritageClause(heritageClause); + } + } + } + function checkGrammarInterfaceDeclaration(node) { + let seenExtendsClause = false; + if (node.heritageClauses) { + for (const heritageClause of node.heritageClauses) { + if (heritageClause.token === 96) { + if (seenExtendsClause) { + return grammarErrorOnFirstToken(heritageClause, Diagnostics.extends_clause_already_seen); + } + seenExtendsClause = true; + } else { + Debug.assert( + heritageClause.token === 119 + /* ImplementsKeyword */ + ); + return grammarErrorOnFirstToken(heritageClause, Diagnostics.Interface_declaration_cannot_have_implements_clause); + } + checkGrammarHeritageClause(heritageClause); + } + } + return false; + } + function checkGrammarComputedPropertyName(node) { + if (node.kind !== 167) { + return false; + } + const computedPropertyName = node; + if (computedPropertyName.expression.kind === 226 && computedPropertyName.expression.operatorToken.kind === 28) { + return grammarErrorOnNode(computedPropertyName.expression, Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); + } + return false; + } + function checkGrammarForGenerator(node) { + if (node.asteriskToken) { + Debug.assert( + node.kind === 262 || node.kind === 218 || node.kind === 174 + /* MethodDeclaration */ + ); + if (node.flags & 33554432) { + return grammarErrorOnNode(node.asteriskToken, Diagnostics.Generators_are_not_allowed_in_an_ambient_context); + } + if (!node.body) { + return grammarErrorOnNode(node.asteriskToken, Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); + } + } + } + function checkGrammarForInvalidQuestionMark(questionToken, message) { + return !!questionToken && grammarErrorOnNode(questionToken, message); + } + function checkGrammarForInvalidExclamationToken(exclamationToken, message) { + return !!exclamationToken && grammarErrorOnNode(exclamationToken, message); + } + function checkGrammarObjectLiteralExpression(node, inDestructuring) { + const seen = /* @__PURE__ */ new Map(); + for (const prop of node.properties) { + if (prop.kind === 305) { + if (inDestructuring) { + const expression = skipParentheses(prop.expression); + if (isArrayLiteralExpression(expression) || isObjectLiteralExpression(expression)) { + return grammarErrorOnNode(prop.expression, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); + } + } + continue; + } + const name2 = prop.name; + if (name2.kind === 167) { + checkGrammarComputedPropertyName(name2); + } + if (prop.kind === 304 && !inDestructuring && prop.objectAssignmentInitializer) { + grammarErrorOnNode(prop.equalsToken, Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern); + } + if (name2.kind === 81) { + grammarErrorOnNode(name2, Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); + } + if (canHaveModifiers(prop) && prop.modifiers) { + for (const mod2 of prop.modifiers) { + if (isModifier(mod2) && (mod2.kind !== 134 || prop.kind !== 174)) { + grammarErrorOnNode(mod2, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod2)); + } + } + } else if (canHaveIllegalModifiers(prop) && prop.modifiers) { + for (const mod2 of prop.modifiers) { + if (isModifier(mod2)) { + grammarErrorOnNode(mod2, Diagnostics._0_modifier_cannot_be_used_here, getTextOfNode(mod2)); + } + } + } + let currentKind; + switch (prop.kind) { + case 304: + case 303: + checkGrammarForInvalidExclamationToken(prop.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); + checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); + if (name2.kind === 9) { + checkGrammarNumericLiteral(name2); + } + currentKind = 4; + break; + case 174: + currentKind = 8; + break; + case 177: + currentKind = 1; + break; + case 178: + currentKind = 2; + break; + default: + Debug.assertNever(prop, "Unexpected syntax kind:" + prop.kind); + } + if (!inDestructuring) { + const effectiveName = getEffectivePropertyNameForPropertyNameNode(name2); + if (effectiveName === void 0) { + continue; + } + const existingKind = seen.get(effectiveName); + if (!existingKind) { + seen.set(effectiveName, currentKind); + } else { + if (currentKind & 8 && existingKind & 8) { + grammarErrorOnNode(name2, Diagnostics.Duplicate_identifier_0, getTextOfNode(name2)); + } else if (currentKind & 4 && existingKind & 4) { + grammarErrorOnNode(name2, Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, getTextOfNode(name2)); + } else if (currentKind & 3 && existingKind & 3) { + if (existingKind !== 3 && currentKind !== existingKind) { + seen.set(effectiveName, currentKind | existingKind); + } else { + return grammarErrorOnNode(name2, Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); + } + } else { + return grammarErrorOnNode(name2, Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); + } + } + } + } + } + function checkGrammarJsxElement(node) { + checkGrammarJsxName(node.tagName); + checkGrammarTypeArguments(node, node.typeArguments); + const seen = /* @__PURE__ */ new Map(); + for (const attr of node.attributes.properties) { + if (attr.kind === 293) { + continue; + } + const { name: name2, initializer } = attr; + const escapedText = getEscapedTextOfJsxAttributeName(name2); + if (!seen.get(escapedText)) { + seen.set(escapedText, true); + } else { + return grammarErrorOnNode(name2, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); + } + if (initializer && initializer.kind === 294 && !initializer.expression) { + return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + } + } + } + function checkGrammarJsxName(node) { + if (isPropertyAccessExpression(node) && isJsxNamespacedName(node.expression)) { + return grammarErrorOnNode(node.expression, Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names); + } + if (isJsxNamespacedName(node) && getJSXTransformEnabled(compilerOptions) && !isIntrinsicJsxName(node.namespace.escapedText)) { + return grammarErrorOnNode(node, Diagnostics.React_components_cannot_include_JSX_namespace_names); + } + } + function checkGrammarJsxExpression(node) { + if (node.expression && isCommaSequence(node.expression)) { + return grammarErrorOnNode(node.expression, Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array); + } + } + function checkGrammarForInOrForOfStatement(forInOrOfStatement) { + if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { + return true; + } + if (forInOrOfStatement.kind === 250 && forInOrOfStatement.awaitModifier) { + if (!(forInOrOfStatement.flags & 65536)) { + const sourceFile = getSourceFileOfNode(forInOrOfStatement); + if (isInTopLevelContext(forInOrOfStatement)) { + if (!hasParseDiagnostics(sourceFile)) { + if (!isEffectiveExternalModule(sourceFile, compilerOptions)) { + diagnostics.add(createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)); + } + switch (moduleKind) { + case 100: + case 199: + if (sourceFile.impliedNodeFormat === 1) { + diagnostics.add( + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level) + ); + break; + } + case 7: + case 99: + case 4: + if (languageVersion >= 4) { + break; + } + default: + diagnostics.add( + createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher) + ); + break; + } + } + } else { + if (!hasParseDiagnostics(sourceFile)) { + const diagnostic = createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules); + const func = getContainingFunction(forInOrOfStatement); + if (func && func.kind !== 176) { + Debug.assert((getFunctionFlags(func) & 2) === 0, "Enclosing function should never be an async function."); + const relatedInfo = createDiagnosticForNode(func, Diagnostics.Did_you_mean_to_mark_this_function_as_async); + addRelatedInfo(diagnostic, relatedInfo); + } + diagnostics.add(diagnostic); + return true; + } + } + return false; + } + } + if (isForOfStatement(forInOrOfStatement) && !(forInOrOfStatement.flags & 65536) && isIdentifier(forInOrOfStatement.initializer) && forInOrOfStatement.initializer.escapedText === "async") { + grammarErrorOnNode(forInOrOfStatement.initializer, Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async); + return false; + } + if (forInOrOfStatement.initializer.kind === 261) { + const variableList = forInOrOfStatement.initializer; + if (!checkGrammarVariableDeclarationList(variableList)) { + const declarations = variableList.declarations; + if (!declarations.length) { + return false; + } + if (declarations.length > 1) { + const diagnostic = forInOrOfStatement.kind === 249 ? Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; + return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); + } + const firstDeclaration = declarations[0]; + if (firstDeclaration.initializer) { + const diagnostic = forInOrOfStatement.kind === 249 ? Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; + return grammarErrorOnNode(firstDeclaration.name, diagnostic); + } + if (firstDeclaration.type) { + const diagnostic = forInOrOfStatement.kind === 249 ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; + return grammarErrorOnNode(firstDeclaration, diagnostic); + } + } + } + return false; + } + function checkGrammarAccessor(accessor) { + if (!(accessor.flags & 33554432) && accessor.parent.kind !== 187 && accessor.parent.kind !== 264) { + if (languageVersion < 1) { + return grammarErrorOnNode(accessor.name, Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); + } + if (languageVersion < 2 && isPrivateIdentifier(accessor.name)) { + return grammarErrorOnNode(accessor.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (accessor.body === void 0 && !hasSyntacticModifier( + accessor, + 64 + /* Abstract */ + )) { + return grammarErrorAtPos(accessor, accessor.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + } + if (accessor.body) { + if (hasSyntacticModifier( + accessor, + 64 + /* Abstract */ + )) { + return grammarErrorOnNode(accessor, Diagnostics.An_abstract_accessor_cannot_have_an_implementation); + } + if (accessor.parent.kind === 187 || accessor.parent.kind === 264) { + return grammarErrorOnNode(accessor.body, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); + } + } + if (accessor.typeParameters) { + return grammarErrorOnNode(accessor.name, Diagnostics.An_accessor_cannot_have_type_parameters); + } + if (!doesAccessorHaveCorrectParameterCount(accessor)) { + return grammarErrorOnNode( + accessor.name, + accessor.kind === 177 ? Diagnostics.A_get_accessor_cannot_have_parameters : Diagnostics.A_set_accessor_must_have_exactly_one_parameter + ); + } + if (accessor.kind === 178) { + if (accessor.type) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); + } + const parameter = Debug.checkDefined(getSetAccessorValueParameter(accessor), "Return value does not match parameter count assertion."); + if (parameter.dotDotDotToken) { + return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.A_set_accessor_cannot_have_rest_parameter); + } + if (parameter.questionToken) { + return grammarErrorOnNode(parameter.questionToken, Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); + } + if (parameter.initializer) { + return grammarErrorOnNode(accessor.name, Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); + } + } + return false; + } + function doesAccessorHaveCorrectParameterCount(accessor) { + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 177 ? 0 : 1); + } + function getAccessorThisParameter(accessor) { + if (accessor.parameters.length === (accessor.kind === 177 ? 1 : 2)) { + return getThisParameter(accessor); + } + } + function checkGrammarTypeOperatorNode(node) { + if (node.operator === 158) { + if (node.type.kind !== 155) { + return grammarErrorOnNode(node.type, Diagnostics._0_expected, tokenToString( + 155 + /* SymbolKeyword */ + )); + } + let parent22 = walkUpParenthesizedTypes(node.parent); + if (isInJSFile(parent22) && isJSDocTypeExpression(parent22)) { + const host2 = getJSDocHost(parent22); + if (host2) { + parent22 = getSingleVariableOfVariableStatement(host2) || host2; + } + } + switch (parent22.kind) { + case 260: + const decl = parent22; + if (decl.name.kind !== 80) { + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); + } + if (!isVariableDeclarationInVariableStatement(decl)) { + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement); + } + if (!(decl.parent.flags & 2)) { + return grammarErrorOnNode(parent22.name, Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); + } + break; + case 172: + if (!isStatic(parent22) || !hasEffectiveReadonlyModifier(parent22)) { + return grammarErrorOnNode(parent22.name, Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); + } + break; + case 171: + if (!hasSyntacticModifier( + parent22, + 8 + /* Readonly */ + )) { + return grammarErrorOnNode(parent22.name, Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); + } + break; + default: + return grammarErrorOnNode(node, Diagnostics.unique_symbol_types_are_not_allowed_here); + } + } else if (node.operator === 148) { + if (node.type.kind !== 188 && node.type.kind !== 189) { + return grammarErrorOnFirstToken(node, Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types, tokenToString( + 155 + /* SymbolKeyword */ + )); + } + } + } + function checkGrammarForInvalidDynamicName(node, message) { + if (isNonBindableDynamicName(node)) { + return grammarErrorOnNode(node, message); + } + } + function checkGrammarMethod(node) { + if (checkGrammarFunctionLikeDeclaration(node)) { + return true; + } + if (node.kind === 174) { + if (node.parent.kind === 210) { + if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === 134)) { + return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); + } else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } else if (checkGrammarForInvalidExclamationToken(node.exclamationToken, Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context)) { + return true; + } else if (node.body === void 0) { + return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{"); + } + } + if (checkGrammarForGenerator(node)) { + return true; + } + } + if (isClassLike(node.parent)) { + if (languageVersion < 2 && isPrivateIdentifier(node.name)) { + return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (node.flags & 33554432) { + return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } else if (node.kind === 174 && !node.body) { + return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } + } else if (node.parent.kind === 264) { + return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } else if (node.parent.kind === 187) { + return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); + } + } + function checkGrammarBreakOrContinueStatement(node) { + let current = node; + while (current) { + if (isFunctionLikeOrClassStaticBlockDeclaration(current)) { + return grammarErrorOnNode(node, Diagnostics.Jump_target_cannot_cross_function_boundary); + } + switch (current.kind) { + case 256: + if (node.label && current.label.escapedText === node.label.escapedText) { + const isMisplacedContinueLabel = node.kind === 251 && !isIterationStatement( + current.statement, + /*lookInLabeledStatements*/ + true + ); + if (isMisplacedContinueLabel) { + return grammarErrorOnNode(node, Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); + } + return false; + } + break; + case 255: + if (node.kind === 252 && !node.label) { + return false; + } + break; + default: + if (isIterationStatement( + current, + /*lookInLabeledStatements*/ + false + ) && !node.label) { + return false; + } + break; + } + current = current.parent; + } + if (node.label) { + const message = node.kind === 252 ? Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } else { + const message = node.kind === 252 ? Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; + return grammarErrorOnNode(node, message); + } + } + function checkGrammarBindingElement(node) { + if (node.dotDotDotToken) { + const elements = node.parent.elements; + if (node !== last2(elements)) { + return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); + } + checkGrammarForDisallowedTrailingComma(elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); + if (node.propertyName) { + return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_have_a_property_name); + } + } + if (node.dotDotDotToken && node.initializer) { + return grammarErrorAtPos(node, node.initializer.pos - 1, 1, Diagnostics.A_rest_element_cannot_have_an_initializer); + } + } + function isStringOrNumberLiteralExpression(expr) { + return isStringOrNumericLiteralLike(expr) || expr.kind === 224 && expr.operator === 41 && expr.operand.kind === 9; + } + function isBigIntLiteralExpression(expr) { + return expr.kind === 10 || expr.kind === 224 && expr.operator === 41 && expr.operand.kind === 10; + } + function isSimpleLiteralEnumReference(expr) { + if ((isPropertyAccessExpression(expr) || isElementAccessExpression(expr) && isStringOrNumberLiteralExpression(expr.argumentExpression)) && isEntityNameExpression(expr.expression)) { + return !!(checkExpressionCached(expr).flags & 1056); + } + } + function checkAmbientInitializer(node) { + const initializer = node.initializer; + if (initializer) { + const isInvalidInitializer = !(isStringOrNumberLiteralExpression(initializer) || isSimpleLiteralEnumReference(initializer) || initializer.kind === 112 || initializer.kind === 97 || isBigIntLiteralExpression(initializer)); + const isConstOrReadonly = isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConstLike(node); + if (isConstOrReadonly && !node.type) { + if (isInvalidInitializer) { + return grammarErrorOnNode(initializer, Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference); + } + } else { + return grammarErrorOnNode(initializer, Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); + } + } + } + function checkGrammarVariableDeclaration(node) { + const nodeFlags = getCombinedNodeFlagsCached(node); + const blockScopeKind = nodeFlags & 7; + if (isBindingPattern(node.name)) { + switch (blockScopeKind) { + case 6: + return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "await using"); + case 4: + return grammarErrorOnNode(node, Diagnostics._0_declarations_may_not_have_binding_patterns, "using"); + } + } + if (node.parent.parent.kind !== 249 && node.parent.parent.kind !== 250) { + if (nodeFlags & 33554432) { + checkAmbientInitializer(node); + } else if (!node.initializer) { + if (isBindingPattern(node.name) && !isBindingPattern(node.parent)) { + return grammarErrorOnNode(node, Diagnostics.A_destructuring_declaration_must_have_an_initializer); + } + switch (blockScopeKind) { + case 6: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "await using"); + case 4: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "using"); + case 2: + return grammarErrorOnNode(node, Diagnostics._0_declarations_must_be_initialized, "const"); + } + } + } + if (node.exclamationToken && (node.parent.parent.kind !== 243 || !node.type || node.initializer || nodeFlags & 33554432)) { + const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; + return grammarErrorOnNode(node.exclamationToken, message); + } + if ((moduleKind < 5 || getSourceFileOfNode(node).impliedNodeFormat === 1) && moduleKind !== 4 && !(node.parent.parent.flags & 33554432) && hasSyntacticModifier( + node.parent.parent, + 32 + /* Export */ + )) { + checkESModuleMarker(node.name); + } + return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name); + } + function checkESModuleMarker(name2) { + if (name2.kind === 80) { + if (idText(name2) === "__esModule") { + return grammarErrorOnNodeSkippedOn("noEmit", name2, Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules); + } + } else { + const elements = name2.elements; + for (const element of elements) { + if (!isOmittedExpression(element)) { + return checkESModuleMarker(element.name); + } + } + } + return false; + } + function checkGrammarNameInLetOrConstDeclarations(name2) { + if (name2.kind === 80) { + if (name2.escapedText === "let") { + return grammarErrorOnNode(name2, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); + } + } else { + const elements = name2.elements; + for (const element of elements) { + if (!isOmittedExpression(element)) { + checkGrammarNameInLetOrConstDeclarations(element.name); + } + } + } + return false; + } + function checkGrammarVariableDeclarationList(declarationList) { + const declarations = declarationList.declarations; + if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) { + return true; + } + if (!declarationList.declarations.length) { + return grammarErrorAtPos(declarationList, declarations.pos, declarations.end - declarations.pos, Diagnostics.Variable_declaration_list_cannot_be_empty); + } + const blockScopeFlags = declarationList.flags & 7; + if ((blockScopeFlags === 4 || blockScopeFlags === 6) && isForInStatement(declarationList.parent)) { + return grammarErrorOnNode( + declarationList, + blockScopeFlags === 4 ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration + ); + } + if (blockScopeFlags === 6) { + return checkAwaitGrammar(declarationList); + } + return false; + } + function allowLetAndConstDeclarations(parent22) { + switch (parent22.kind) { + case 245: + case 246: + case 247: + case 254: + case 248: + case 249: + case 250: + return false; + case 256: + return allowLetAndConstDeclarations(parent22.parent); + } + return true; + } + function checkGrammarForDisallowedBlockScopedVariableStatement(node) { + if (!allowLetAndConstDeclarations(node.parent)) { + const blockScopeKind = getCombinedNodeFlagsCached(node.declarationList) & 7; + if (blockScopeKind) { + const keyword = blockScopeKind === 1 ? "let" : blockScopeKind === 2 ? "const" : blockScopeKind === 4 ? "using" : blockScopeKind === 6 ? "await using" : Debug.fail("Unknown BlockScope flag"); + return grammarErrorOnNode(node, Diagnostics._0_declarations_can_only_be_declared_inside_a_block, keyword); + } + } + } + function checkGrammarMetaProperty(node) { + const escapedText = node.name.escapedText; + switch (node.keywordToken) { + case 105: + if (escapedText !== "target") { + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "target"); + } + break; + case 102: + if (escapedText !== "meta") { + return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, unescapeLeadingUnderscores(node.name.escapedText), tokenToString(node.keywordToken), "meta"); + } + break; + } + } + function hasParseDiagnostics(sourceFile) { + return sourceFile.parseDiagnostics.length > 0; + } + function grammarErrorOnFirstToken(node, message, ...args) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + const span = getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message, ...args)); + return true; + } + return false; + } + function grammarErrorAtPos(nodeForSourceFile, start, length2, message, ...args) { + const sourceFile = getSourceFileOfNode(nodeForSourceFile); + if (!hasParseDiagnostics(sourceFile)) { + diagnostics.add(createFileDiagnostic(sourceFile, start, length2, message, ...args)); + return true; + } + return false; + } + function grammarErrorOnNodeSkippedOn(key, node, message, ...args) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + errorSkippedOn(key, node, message, ...args); + return true; + } + return false; + } + function grammarErrorOnNode(node, message, ...args) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + diagnostics.add(createDiagnosticForNode(node, message, ...args)); + return true; + } + return false; + } + function checkGrammarConstructorTypeParameters(node) { + const jsdocTypeParameters = isInJSFile(node) ? getJSDocTypeParameterDeclarations(node) : void 0; + const range2 = node.typeParameters || jsdocTypeParameters && firstOrUndefined(jsdocTypeParameters); + if (range2) { + const pos = range2.pos === range2.end ? range2.pos : skipTrivia(getSourceFileOfNode(node).text, range2.pos); + return grammarErrorAtPos(node, pos, range2.end - pos, Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); + } + } + function checkGrammarConstructorTypeAnnotation(node) { + const type3 = node.type || getEffectiveReturnTypeNode(node); + if (type3) { + return grammarErrorOnNode(type3, Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); + } + } + function checkGrammarProperty(node) { + if (isComputedPropertyName(node.name) && isBinaryExpression(node.name.expression) && node.name.expression.operatorToken.kind === 103) { + return grammarErrorOnNode(node.parent.members[0], Diagnostics.A_mapped_type_may_not_declare_properties_or_methods); + } + if (isClassLike(node.parent)) { + if (isStringLiteral(node.name) && node.name.text === "constructor") { + return grammarErrorOnNode(node.name, Diagnostics.Classes_may_not_have_a_field_named_constructor); + } + if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type)) { + return true; + } + if (languageVersion < 2 && isPrivateIdentifier(node.name)) { + return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (languageVersion < 2 && isAutoAccessorPropertyDeclaration(node)) { + return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher); + } + if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) { + return true; + } + } else if (node.parent.kind === 264) { + if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { + return true; + } + Debug.assertNode(node, isPropertySignature); + if (node.initializer) { + return grammarErrorOnNode(node.initializer, Diagnostics.An_interface_property_cannot_have_an_initializer); + } + } else if (isTypeLiteralNode(node.parent)) { + if (checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { + return true; + } + Debug.assertNode(node, isPropertySignature); + if (node.initializer) { + return grammarErrorOnNode(node.initializer, Diagnostics.A_type_literal_property_cannot_have_an_initializer); + } + } + if (node.flags & 33554432) { + checkAmbientInitializer(node); + } + if (isPropertyDeclaration(node) && node.exclamationToken && (!isClassLike(node.parent) || !node.type || node.initializer || node.flags & 33554432 || isStatic(node) || hasAbstractModifier(node))) { + const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context; + return grammarErrorOnNode(node.exclamationToken, message); + } + } + function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { + if (node.kind === 264 || node.kind === 265 || node.kind === 272 || node.kind === 271 || node.kind === 278 || node.kind === 277 || node.kind === 270 || hasSyntacticModifier( + node, + 128 | 32 | 2048 + /* Default */ + )) { + return false; + } + return grammarErrorOnFirstToken(node, Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier); + } + function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { + for (const decl of file.statements) { + if (isDeclaration(decl) || decl.kind === 243) { + if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { + return true; + } + } + } + return false; + } + function checkGrammarSourceFile(node) { + return !!(node.flags & 33554432) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); + } + function checkGrammarStatementInAmbientContext(node) { + if (node.flags & 33554432) { + const links = getNodeLinks(node); + if (!links.hasReportedStatementInAmbientContext && (isFunctionLike(node.parent) || isAccessor(node.parent))) { + return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); + } + if (node.parent.kind === 241 || node.parent.kind === 268 || node.parent.kind === 312) { + const links2 = getNodeLinks(node.parent); + if (!links2.hasReportedStatementInAmbientContext) { + return links2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, Diagnostics.Statements_are_not_allowed_in_ambient_contexts); + } + } else { + } + } + return false; + } + function checkGrammarNumericLiteral(node) { + const isFractional = getTextOfNode(node).includes("."); + const isScientific = node.numericLiteralFlags & 16; + if (isFractional || isScientific) { + return; + } + const value2 = +node.text; + if (value2 <= 2 ** 53 - 1) { + return; + } + addErrorOrSuggestion( + /*isError*/ + false, + createDiagnosticForNode(node, Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers) + ); + } + function checkGrammarBigIntLiteral(node) { + const literalType2 = isLiteralTypeNode(node.parent) || isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent); + if (!literalType2) { + if (languageVersion < 7) { + if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) { + return true; + } + } + } + return false; + } + function grammarErrorAfterFirstToken(node, message, ...args) { + const sourceFile = getSourceFileOfNode(node); + if (!hasParseDiagnostics(sourceFile)) { + const span = getSpanOfTokenAtPosition(sourceFile, node.pos); + diagnostics.add(createFileDiagnostic( + sourceFile, + textSpanEnd(span), + /*length*/ + 0, + message, + ...args + )); + return true; + } + return false; + } + function getAmbientModules() { + if (!ambientModulesCache) { + ambientModulesCache = []; + globals3.forEach((global2, sym) => { + if (ambientModuleSymbolRegex.test(sym)) { + ambientModulesCache.push(global2); + } + }); + } + return ambientModulesCache; + } + function checkGrammarImportClause(node) { + var _a2; + if (node.isTypeOnly && node.name && node.namedBindings) { + return grammarErrorOnNode(node, Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both); + } + if (node.isTypeOnly && ((_a2 = node.namedBindings) == null ? void 0 : _a2.kind) === 275) { + return checkGrammarNamedImportsOrExports(node.namedBindings); + } + return false; + } + function checkGrammarNamedImportsOrExports(namedBindings) { + return !!forEach4(namedBindings.elements, (specifier) => { + if (specifier.isTypeOnly) { + return grammarErrorOnFirstToken( + specifier, + specifier.kind === 276 ? Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement : Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement + ); + } + }); + } + function checkGrammarImportCallExpression(node) { + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1) { + return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled); + } + if (moduleKind === 5) { + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext); + } + if (node.typeArguments) { + return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments); + } + const nodeArguments = node.arguments; + if (moduleKind !== 99 && moduleKind !== 199 && moduleKind !== 100) { + checkGrammarForDisallowedTrailingComma(nodeArguments); + if (nodeArguments.length > 1) { + const importAttributesArgument = nodeArguments[1]; + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); + } + } + if (nodeArguments.length === 0 || nodeArguments.length > 2) { + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments); + } + const spreadElement = find2(nodeArguments, isSpreadElement); + if (spreadElement) { + return grammarErrorOnNode(spreadElement, Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element); + } + return false; + } + function findMatchingTypeReferenceOrTypeAliasReference(source, unionTarget) { + const sourceObjectFlags = getObjectFlags(source); + if (sourceObjectFlags & (4 | 16) && unionTarget.flags & 1048576) { + return find2(unionTarget.types, (target) => { + if (target.flags & 524288) { + const overlapObjFlags = sourceObjectFlags & getObjectFlags(target); + if (overlapObjFlags & 4) { + return source.target === target.target; + } + if (overlapObjFlags & 16) { + return !!source.aliasSymbol && source.aliasSymbol === target.aliasSymbol; + } + } + return false; + }); + } + } + function findBestTypeForObjectLiteral(source, unionTarget) { + if (getObjectFlags(source) & 128 && someType(unionTarget, isArrayLikeType)) { + return find2(unionTarget.types, (t8) => !isArrayLikeType(t8)); + } + } + function findBestTypeForInvokable(source, unionTarget) { + let signatureKind = 0; + const hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 || (signatureKind = 1, getSignaturesOfType(source, signatureKind).length > 0); + if (hasSignatures) { + return find2(unionTarget.types, (t8) => getSignaturesOfType(t8, signatureKind).length > 0); + } + } + function findMostOverlappyType(source, unionTarget) { + let bestMatch; + if (!(source.flags & (402784252 | 406847488))) { + let matchingCount = 0; + for (const target of unionTarget.types) { + if (!(target.flags & (402784252 | 406847488))) { + const overlap = getIntersectionType([getIndexType(source), getIndexType(target)]); + if (overlap.flags & 4194304) { + return target; + } else if (isUnitType(overlap) || overlap.flags & 1048576) { + const len = overlap.flags & 1048576 ? countWhere(overlap.types, isUnitType) : 1; + if (len >= matchingCount) { + bestMatch = target; + matchingCount = len; + } + } + } + } + } + return bestMatch; + } + function filterPrimitivesIfContainsNonPrimitive(type3) { + if (maybeTypeOfKind( + type3, + 67108864 + /* NonPrimitive */ + )) { + const result2 = filterType(type3, (t8) => !(t8.flags & 402784252)); + if (!(result2.flags & 131072)) { + return result2; + } + } + return type3; + } + function findMatchingDiscriminantType(source, target, isRelatedTo) { + if (target.flags & 1048576 && source.flags & (2097152 | 524288)) { + const match = getMatchingUnionConstituentForType(target, source); + if (match) { + return match; + } + const sourceProperties = getPropertiesOfType(source); + if (sourceProperties) { + const sourcePropertiesFiltered = findDiscriminantProperties(sourceProperties, target); + if (sourcePropertiesFiltered) { + const discriminated = discriminateTypeByDiscriminableItems(target, map4(sourcePropertiesFiltered, (p7) => [() => getTypeOfSymbol(p7), p7.escapedName]), isRelatedTo); + if (discriminated !== target) { + return discriminated; + } + } + } + } + return void 0; + } + function getEffectivePropertyNameForPropertyNameNode(node) { + const name2 = getPropertyNameForPropertyNameNode(node); + return name2 ? name2 : isComputedPropertyName(node) ? tryGetNameFromType(getTypeOfExpression(node.expression)) : void 0; + } + function getCombinedModifierFlagsCached(node) { + if (lastGetCombinedModifierFlagsNode === node) { + return lastGetCombinedModifierFlagsResult; + } + lastGetCombinedModifierFlagsNode = node; + lastGetCombinedModifierFlagsResult = getCombinedModifierFlags(node); + return lastGetCombinedModifierFlagsResult; + } + function getCombinedNodeFlagsCached(node) { + if (lastGetCombinedNodeFlagsNode === node) { + return lastGetCombinedNodeFlagsResult; + } + lastGetCombinedNodeFlagsNode = node; + lastGetCombinedNodeFlagsResult = getCombinedNodeFlags(node); + return lastGetCombinedNodeFlagsResult; + } + function isVarConstLike(node) { + const blockScopeKind = getCombinedNodeFlagsCached(node) & 7; + return blockScopeKind === 2 || blockScopeKind === 4 || blockScopeKind === 6; + } + } + function isNotAccessor(declaration) { + return !isAccessor(declaration); + } + function isNotOverload(declaration) { + return declaration.kind !== 262 && declaration.kind !== 174 || !!declaration.body; + } + function isDeclarationNameOrImportPropertyName(name2) { + switch (name2.parent.kind) { + case 276: + case 281: + return isIdentifier(name2); + default: + return isDeclarationName(name2); + } + } + function getIterationTypesKeyFromIterationTypeKind(typeKind) { + switch (typeKind) { + case 0: + return "yieldType"; + case 1: + return "returnType"; + case 2: + return "nextType"; + } + } + function signatureHasRestParameter(s7) { + return !!(s7.flags & 1); + } + function signatureHasLiteralTypes(s7) { + return !!(s7.flags & 2); + } + function createBasicNodeBuilderModuleSpecifierResolutionHost(host) { + return { + getCommonSourceDirectory: !!host.getCommonSourceDirectory ? () => host.getCommonSourceDirectory() : () => "", + getCurrentDirectory: () => host.getCurrentDirectory(), + getSymlinkCache: maybeBind(host, host.getSymlinkCache), + getPackageJsonInfoCache: () => { + var _a2; + return (_a2 = host.getPackageJsonInfoCache) == null ? void 0 : _a2.call(host); + }, + useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames), + redirectTargetsMap: host.redirectTargetsMap, + getProjectReferenceRedirect: (fileName) => host.getProjectReferenceRedirect(fileName), + isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName), + fileExists: (fileName) => host.fileExists(fileName), + getFileIncludeReasons: () => host.getFileIncludeReasons(), + readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0 + }; + } + var ambientModuleSymbolRegex, anon, nextSymbolId, nextNodeId, nextMergeId, nextFlowId, TypeFacts, typeofNEFacts, CheckMode, SignatureCheckMode, isNotOverloadAndNotAccessor, intrinsicTypeKinds, SymbolLinks, JsxNames, SymbolTrackerImpl; + var init_checker = __esm2({ + "src/compiler/checker.ts"() { + "use strict"; + init_ts2(); + init_ts_moduleSpecifiers(); + init_ts_performance(); + ambientModuleSymbolRegex = /^".+"$/; + anon = "(anonymous)"; + nextSymbolId = 1; + nextNodeId = 1; + nextMergeId = 1; + nextFlowId = 1; + TypeFacts = /* @__PURE__ */ ((TypeFacts3) => { + TypeFacts3[TypeFacts3["None"] = 0] = "None"; + TypeFacts3[TypeFacts3["TypeofEQString"] = 1] = "TypeofEQString"; + TypeFacts3[TypeFacts3["TypeofEQNumber"] = 2] = "TypeofEQNumber"; + TypeFacts3[TypeFacts3["TypeofEQBigInt"] = 4] = "TypeofEQBigInt"; + TypeFacts3[TypeFacts3["TypeofEQBoolean"] = 8] = "TypeofEQBoolean"; + TypeFacts3[TypeFacts3["TypeofEQSymbol"] = 16] = "TypeofEQSymbol"; + TypeFacts3[TypeFacts3["TypeofEQObject"] = 32] = "TypeofEQObject"; + TypeFacts3[TypeFacts3["TypeofEQFunction"] = 64] = "TypeofEQFunction"; + TypeFacts3[TypeFacts3["TypeofEQHostObject"] = 128] = "TypeofEQHostObject"; + TypeFacts3[TypeFacts3["TypeofNEString"] = 256] = "TypeofNEString"; + TypeFacts3[TypeFacts3["TypeofNENumber"] = 512] = "TypeofNENumber"; + TypeFacts3[TypeFacts3["TypeofNEBigInt"] = 1024] = "TypeofNEBigInt"; + TypeFacts3[TypeFacts3["TypeofNEBoolean"] = 2048] = "TypeofNEBoolean"; + TypeFacts3[TypeFacts3["TypeofNESymbol"] = 4096] = "TypeofNESymbol"; + TypeFacts3[TypeFacts3["TypeofNEObject"] = 8192] = "TypeofNEObject"; + TypeFacts3[TypeFacts3["TypeofNEFunction"] = 16384] = "TypeofNEFunction"; + TypeFacts3[TypeFacts3["TypeofNEHostObject"] = 32768] = "TypeofNEHostObject"; + TypeFacts3[TypeFacts3["EQUndefined"] = 65536] = "EQUndefined"; + TypeFacts3[TypeFacts3["EQNull"] = 131072] = "EQNull"; + TypeFacts3[TypeFacts3["EQUndefinedOrNull"] = 262144] = "EQUndefinedOrNull"; + TypeFacts3[TypeFacts3["NEUndefined"] = 524288] = "NEUndefined"; + TypeFacts3[TypeFacts3["NENull"] = 1048576] = "NENull"; + TypeFacts3[TypeFacts3["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull"; + TypeFacts3[TypeFacts3["Truthy"] = 4194304] = "Truthy"; + TypeFacts3[TypeFacts3["Falsy"] = 8388608] = "Falsy"; + TypeFacts3[TypeFacts3["IsUndefined"] = 16777216] = "IsUndefined"; + TypeFacts3[TypeFacts3["IsNull"] = 33554432] = "IsNull"; + TypeFacts3[TypeFacts3["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull"; + TypeFacts3[TypeFacts3["All"] = 134217727] = "All"; + TypeFacts3[TypeFacts3["BaseStringStrictFacts"] = 3735041] = "BaseStringStrictFacts"; + TypeFacts3[TypeFacts3["BaseStringFacts"] = 12582401] = "BaseStringFacts"; + TypeFacts3[TypeFacts3["StringStrictFacts"] = 16317953] = "StringStrictFacts"; + TypeFacts3[TypeFacts3["StringFacts"] = 16776705] = "StringFacts"; + TypeFacts3[TypeFacts3["EmptyStringStrictFacts"] = 12123649] = "EmptyStringStrictFacts"; + TypeFacts3[ + TypeFacts3["EmptyStringFacts"] = 12582401 + /* BaseStringFacts */ + ] = "EmptyStringFacts"; + TypeFacts3[TypeFacts3["NonEmptyStringStrictFacts"] = 7929345] = "NonEmptyStringStrictFacts"; + TypeFacts3[TypeFacts3["NonEmptyStringFacts"] = 16776705] = "NonEmptyStringFacts"; + TypeFacts3[TypeFacts3["BaseNumberStrictFacts"] = 3734786] = "BaseNumberStrictFacts"; + TypeFacts3[TypeFacts3["BaseNumberFacts"] = 12582146] = "BaseNumberFacts"; + TypeFacts3[TypeFacts3["NumberStrictFacts"] = 16317698] = "NumberStrictFacts"; + TypeFacts3[TypeFacts3["NumberFacts"] = 16776450] = "NumberFacts"; + TypeFacts3[TypeFacts3["ZeroNumberStrictFacts"] = 12123394] = "ZeroNumberStrictFacts"; + TypeFacts3[ + TypeFacts3["ZeroNumberFacts"] = 12582146 + /* BaseNumberFacts */ + ] = "ZeroNumberFacts"; + TypeFacts3[TypeFacts3["NonZeroNumberStrictFacts"] = 7929090] = "NonZeroNumberStrictFacts"; + TypeFacts3[TypeFacts3["NonZeroNumberFacts"] = 16776450] = "NonZeroNumberFacts"; + TypeFacts3[TypeFacts3["BaseBigIntStrictFacts"] = 3734276] = "BaseBigIntStrictFacts"; + TypeFacts3[TypeFacts3["BaseBigIntFacts"] = 12581636] = "BaseBigIntFacts"; + TypeFacts3[TypeFacts3["BigIntStrictFacts"] = 16317188] = "BigIntStrictFacts"; + TypeFacts3[TypeFacts3["BigIntFacts"] = 16775940] = "BigIntFacts"; + TypeFacts3[TypeFacts3["ZeroBigIntStrictFacts"] = 12122884] = "ZeroBigIntStrictFacts"; + TypeFacts3[ + TypeFacts3["ZeroBigIntFacts"] = 12581636 + /* BaseBigIntFacts */ + ] = "ZeroBigIntFacts"; + TypeFacts3[TypeFacts3["NonZeroBigIntStrictFacts"] = 7928580] = "NonZeroBigIntStrictFacts"; + TypeFacts3[TypeFacts3["NonZeroBigIntFacts"] = 16775940] = "NonZeroBigIntFacts"; + TypeFacts3[TypeFacts3["BaseBooleanStrictFacts"] = 3733256] = "BaseBooleanStrictFacts"; + TypeFacts3[TypeFacts3["BaseBooleanFacts"] = 12580616] = "BaseBooleanFacts"; + TypeFacts3[TypeFacts3["BooleanStrictFacts"] = 16316168] = "BooleanStrictFacts"; + TypeFacts3[TypeFacts3["BooleanFacts"] = 16774920] = "BooleanFacts"; + TypeFacts3[TypeFacts3["FalseStrictFacts"] = 12121864] = "FalseStrictFacts"; + TypeFacts3[ + TypeFacts3["FalseFacts"] = 12580616 + /* BaseBooleanFacts */ + ] = "FalseFacts"; + TypeFacts3[TypeFacts3["TrueStrictFacts"] = 7927560] = "TrueStrictFacts"; + TypeFacts3[TypeFacts3["TrueFacts"] = 16774920] = "TrueFacts"; + TypeFacts3[TypeFacts3["SymbolStrictFacts"] = 7925520] = "SymbolStrictFacts"; + TypeFacts3[TypeFacts3["SymbolFacts"] = 16772880] = "SymbolFacts"; + TypeFacts3[TypeFacts3["ObjectStrictFacts"] = 7888800] = "ObjectStrictFacts"; + TypeFacts3[TypeFacts3["ObjectFacts"] = 16736160] = "ObjectFacts"; + TypeFacts3[TypeFacts3["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts"; + TypeFacts3[TypeFacts3["FunctionFacts"] = 16728e3] = "FunctionFacts"; + TypeFacts3[TypeFacts3["VoidFacts"] = 9830144] = "VoidFacts"; + TypeFacts3[TypeFacts3["UndefinedFacts"] = 26607360] = "UndefinedFacts"; + TypeFacts3[TypeFacts3["NullFacts"] = 42917664] = "NullFacts"; + TypeFacts3[TypeFacts3["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts"; + TypeFacts3[TypeFacts3["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts"; + TypeFacts3[TypeFacts3["UnknownFacts"] = 83886079] = "UnknownFacts"; + TypeFacts3[TypeFacts3["AllTypeofNE"] = 556800] = "AllTypeofNE"; + TypeFacts3[TypeFacts3["OrFactsMask"] = 8256] = "OrFactsMask"; + TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask"; + return TypeFacts3; + })(TypeFacts || {}); + typeofNEFacts = new Map(Object.entries({ + string: 256, + number: 512, + bigint: 1024, + boolean: 2048, + symbol: 4096, + undefined: 524288, + object: 8192, + function: 16384 + /* TypeofNEFunction */ + })); + CheckMode = /* @__PURE__ */ ((CheckMode3) => { + CheckMode3[CheckMode3["Normal"] = 0] = "Normal"; + CheckMode3[CheckMode3["Contextual"] = 1] = "Contextual"; + CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential"; + CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive"; + CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; + CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; + CheckMode3[CheckMode3["RestBindingElement"] = 32] = "RestBindingElement"; + CheckMode3[CheckMode3["TypeOnly"] = 64] = "TypeOnly"; + return CheckMode3; + })(CheckMode || {}); + SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { + SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None"; + SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback"; + SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; + SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; + SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; + SignatureCheckMode3[SignatureCheckMode3["StrictTopSignature"] = 16] = "StrictTopSignature"; + SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; + return SignatureCheckMode3; + })(SignatureCheckMode || {}); + isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor); + intrinsicTypeKinds = new Map(Object.entries({ + Uppercase: 0, + Lowercase: 1, + Capitalize: 2, + Uncapitalize: 3, + NoInfer: 4 + /* NoInfer */ + })); + SymbolLinks = class { + }; + ((JsxNames2) => { + JsxNames2.JSX = "JSX"; + JsxNames2.IntrinsicElements = "IntrinsicElements"; + JsxNames2.ElementClass = "ElementClass"; + JsxNames2.ElementAttributesPropertyNameContainer = "ElementAttributesProperty"; + JsxNames2.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute"; + JsxNames2.Element = "Element"; + JsxNames2.ElementType = "ElementType"; + JsxNames2.IntrinsicAttributes = "IntrinsicAttributes"; + JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes"; + JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes"; + })(JsxNames || (JsxNames = {})); + SymbolTrackerImpl = class _SymbolTrackerImpl { + constructor(context2, tracker, moduleResolverHost) { + this.moduleResolverHost = void 0; + this.inner = void 0; + this.disableTrackSymbol = false; + var _a2; + while (tracker instanceof _SymbolTrackerImpl) { + tracker = tracker.inner; + } + this.inner = tracker; + this.moduleResolverHost = moduleResolverHost; + this.context = context2; + this.canTrackSymbol = !!((_a2 = this.inner) == null ? void 0 : _a2.trackSymbol); + } + trackSymbol(symbol, enclosingDeclaration, meaning) { + var _a2, _b; + if (((_a2 = this.inner) == null ? void 0 : _a2.trackSymbol) && !this.disableTrackSymbol) { + if (this.inner.trackSymbol(symbol, enclosingDeclaration, meaning)) { + this.onDiagnosticReported(); + return true; + } + if (!(symbol.flags & 262144)) + ((_b = this.context).trackedSymbols ?? (_b.trackedSymbols = [])).push([symbol, enclosingDeclaration, meaning]); + } + return false; + } + reportInaccessibleThisError() { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportInaccessibleThisError) { + this.onDiagnosticReported(); + this.inner.reportInaccessibleThisError(); + } + } + reportPrivateInBaseOfClassExpression(propertyName) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportPrivateInBaseOfClassExpression) { + this.onDiagnosticReported(); + this.inner.reportPrivateInBaseOfClassExpression(propertyName); + } + } + reportInaccessibleUniqueSymbolError() { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportInaccessibleUniqueSymbolError) { + this.onDiagnosticReported(); + this.inner.reportInaccessibleUniqueSymbolError(); + } + } + reportCyclicStructureError() { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportCyclicStructureError) { + this.onDiagnosticReported(); + this.inner.reportCyclicStructureError(); + } + } + reportLikelyUnsafeImportRequiredError(specifier) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportLikelyUnsafeImportRequiredError) { + this.onDiagnosticReported(); + this.inner.reportLikelyUnsafeImportRequiredError(specifier); + } + } + reportTruncationError() { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportTruncationError) { + this.onDiagnosticReported(); + this.inner.reportTruncationError(); + } + } + trackReferencedAmbientModule(decl, symbol) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.trackReferencedAmbientModule) { + this.onDiagnosticReported(); + this.inner.trackReferencedAmbientModule(decl, symbol); + } + } + trackExternalModuleSymbolOfImportTypeNode(symbol) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.trackExternalModuleSymbolOfImportTypeNode) { + this.onDiagnosticReported(); + this.inner.trackExternalModuleSymbolOfImportTypeNode(symbol); + } + } + reportNonlocalAugmentation(containingFile, parentSymbol, augmentingSymbol) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportNonlocalAugmentation) { + this.onDiagnosticReported(); + this.inner.reportNonlocalAugmentation(containingFile, parentSymbol, augmentingSymbol); + } + } + reportNonSerializableProperty(propertyName) { + var _a2; + if ((_a2 = this.inner) == null ? void 0 : _a2.reportNonSerializableProperty) { + this.onDiagnosticReported(); + this.inner.reportNonSerializableProperty(propertyName); + } + } + onDiagnosticReported() { + this.context.reportedDiagnostic = true; + } + }; + } + }); + function visitNode(node, visitor, test, lift) { + if (node === void 0) { + return node; + } + const visited = visitor(node); + let visitedNode; + if (visited === void 0) { + return void 0; + } else if (isArray3(visited)) { + visitedNode = (lift || extractSingleNode)(visited); + } else { + visitedNode = visited; + } + Debug.assertNode(visitedNode, test); + return visitedNode; + } + function visitNodes2(nodes, visitor, test, start, count2) { + if (nodes === void 0) { + return nodes; + } + const length2 = nodes.length; + if (start === void 0 || start < 0) { + start = 0; + } + if (count2 === void 0 || count2 > length2 - start) { + count2 = length2 - start; + } + let hasTrailingComma; + let pos = -1; + let end = -1; + if (start > 0 || count2 < length2) { + hasTrailingComma = nodes.hasTrailingComma && start + count2 === length2; + } else { + pos = nodes.pos; + end = nodes.end; + hasTrailingComma = nodes.hasTrailingComma; + } + const updated = visitArrayWorker(nodes, visitor, test, start, count2); + if (updated !== nodes) { + const updatedArray = factory.createNodeArray(updated, hasTrailingComma); + setTextRangePosEnd(updatedArray, pos, end); + return updatedArray; + } + return nodes; + } + function visitArray(nodes, visitor, test, start, count2) { + if (nodes === void 0) { + return nodes; + } + const length2 = nodes.length; + if (start === void 0 || start < 0) { + start = 0; + } + if (count2 === void 0 || count2 > length2 - start) { + count2 = length2 - start; + } + return visitArrayWorker(nodes, visitor, test, start, count2); + } + function visitArrayWorker(nodes, visitor, test, start, count2) { + let updated; + const length2 = nodes.length; + if (start > 0 || count2 < length2) { + updated = []; + } + for (let i7 = 0; i7 < count2; i7++) { + const node = nodes[i7 + start]; + const visited = node !== void 0 ? visitor ? visitor(node) : node : void 0; + if (updated !== void 0 || visited === void 0 || visited !== node) { + if (updated === void 0) { + updated = nodes.slice(0, i7); + Debug.assertEachNode(updated, test); + } + if (visited) { + if (isArray3(visited)) { + for (const visitedNode of visited) { + Debug.assertNode(visitedNode, test); + updated.push(visitedNode); + } + } else { + Debug.assertNode(visited, test); + updated.push(visited); + } + } + } + } + if (updated) { + return updated; + } + Debug.assertEachNode(nodes, test); + return nodes; + } + function visitLexicalEnvironment(statements, visitor, context2, start, ensureUseStrict, nodesVisitor = visitNodes2) { + context2.startLexicalEnvironment(); + statements = nodesVisitor(statements, visitor, isStatement, start); + if (ensureUseStrict) + statements = context2.factory.ensureUseStrict(statements); + return factory.mergeLexicalEnvironment(statements, context2.endLexicalEnvironment()); + } + function visitParameterList(nodes, visitor, context2, nodesVisitor = visitNodes2) { + let updated; + context2.startLexicalEnvironment(); + if (nodes) { + context2.setLexicalEnvironmentFlags(1, true); + updated = nodesVisitor(nodes, visitor, isParameter); + if (context2.getLexicalEnvironmentFlags() & 2 && getEmitScriptTarget(context2.getCompilerOptions()) >= 2) { + updated = addDefaultValueAssignmentsIfNeeded(updated, context2); + } + context2.setLexicalEnvironmentFlags(1, false); + } + context2.suspendLexicalEnvironment(); + return updated; + } + function addDefaultValueAssignmentsIfNeeded(parameters, context2) { + let result2; + for (let i7 = 0; i7 < parameters.length; i7++) { + const parameter = parameters[i7]; + const updated = addDefaultValueAssignmentIfNeeded(parameter, context2); + if (result2 || updated !== parameter) { + if (!result2) + result2 = parameters.slice(0, i7); + result2[i7] = updated; + } + } + if (result2) { + return setTextRange(context2.factory.createNodeArray(result2, parameters.hasTrailingComma), parameters); + } + return parameters; + } + function addDefaultValueAssignmentIfNeeded(parameter, context2) { + return parameter.dotDotDotToken ? parameter : isBindingPattern(parameter.name) ? addDefaultValueAssignmentForBindingPattern(parameter, context2) : parameter.initializer ? addDefaultValueAssignmentForInitializer(parameter, parameter.name, parameter.initializer, context2) : parameter; + } + function addDefaultValueAssignmentForBindingPattern(parameter, context2) { + const { factory: factory2 } = context2; + context2.addInitializationStatement( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + parameter.name, + /*exclamationToken*/ + void 0, + parameter.type, + parameter.initializer ? factory2.createConditionalExpression( + factory2.createStrictEquality( + factory2.getGeneratedNameForNode(parameter), + factory2.createVoidZero() + ), + /*questionToken*/ + void 0, + parameter.initializer, + /*colonToken*/ + void 0, + factory2.getGeneratedNameForNode(parameter) + ) : factory2.getGeneratedNameForNode(parameter) + ) + ]) + ) + ); + return factory2.updateParameterDeclaration( + parameter, + parameter.modifiers, + parameter.dotDotDotToken, + factory2.getGeneratedNameForNode(parameter), + parameter.questionToken, + parameter.type, + /*initializer*/ + void 0 + ); + } + function addDefaultValueAssignmentForInitializer(parameter, name2, initializer, context2) { + const factory2 = context2.factory; + context2.addInitializationStatement( + factory2.createIfStatement( + factory2.createTypeCheck(factory2.cloneNode(name2), "undefined"), + setEmitFlags( + setTextRange( + factory2.createBlock([ + factory2.createExpressionStatement( + setEmitFlags( + setTextRange( + factory2.createAssignment( + setEmitFlags( + factory2.cloneNode(name2), + 96 + /* NoSourceMap */ + ), + setEmitFlags( + initializer, + 96 | getEmitFlags(initializer) | 3072 + /* NoComments */ + ) + ), + parameter + ), + 3072 + /* NoComments */ + ) + ) + ]), + parameter + ), + 1 | 64 | 768 | 3072 + /* NoComments */ + ) + ) + ); + return factory2.updateParameterDeclaration( + parameter, + parameter.modifiers, + parameter.dotDotDotToken, + parameter.name, + parameter.questionToken, + parameter.type, + /*initializer*/ + void 0 + ); + } + function visitFunctionBody(node, visitor, context2, nodeVisitor = visitNode) { + context2.resumeLexicalEnvironment(); + const updated = nodeVisitor(node, visitor, isConciseBody); + const declarations = context2.endLexicalEnvironment(); + if (some2(declarations)) { + if (!updated) { + return context2.factory.createBlock(declarations); + } + const block = context2.factory.converters.convertToFunctionBlock(updated); + const statements = factory.mergeLexicalEnvironment(block.statements, declarations); + return context2.factory.updateBlock(block, statements); + } + return updated; + } + function visitIterationBody(body, visitor, context2, nodeVisitor = visitNode) { + context2.startBlockScope(); + const updated = nodeVisitor(body, visitor, isStatement, context2.factory.liftToBlock); + Debug.assert(updated); + const declarations = context2.endBlockScope(); + if (some2(declarations)) { + if (isBlock2(updated)) { + declarations.push(...updated.statements); + return context2.factory.updateBlock(updated, declarations); + } + declarations.push(updated); + return context2.factory.createBlock(declarations); + } + return updated; + } + function visitCommaListElements(elements, visitor, discardVisitor = visitor) { + if (discardVisitor === visitor || elements.length <= 1) { + return visitNodes2(elements, visitor, isExpression); + } + let i7 = 0; + const length2 = elements.length; + return visitNodes2(elements, (node) => { + const discarded = i7 < length2 - 1; + i7++; + return discarded ? discardVisitor(node) : visitor(node); + }, isExpression); + } + function visitEachChild(node, visitor, context2 = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) { + if (node === void 0) { + return void 0; + } + const fn = visitEachChildTable[node.kind]; + return fn === void 0 ? node : fn(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor); + } + function extractSingleNode(nodes) { + Debug.assert(nodes.length <= 1, "Too many nodes written to output."); + return singleOrUndefined(nodes); + } + var visitEachChildTable; + var init_visitorPublic = __esm2({ + "src/compiler/visitorPublic.ts"() { + "use strict"; + init_ts2(); + visitEachChildTable = { + [ + 166 + /* QualifiedName */ + ]: function visitEachChildOfQualifiedName(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateQualifiedName( + node, + Debug.checkDefined(nodeVisitor(node.left, visitor, isEntityName)), + Debug.checkDefined(nodeVisitor(node.right, visitor, isIdentifier)) + ); + }, + [ + 167 + /* ComputedPropertyName */ + ]: function visitEachChildOfComputedPropertyName(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateComputedPropertyName( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + // Signature elements + [ + 168 + /* TypeParameter */ + ]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeParameterDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + nodeVisitor(node.constraint, visitor, isTypeNode), + nodeVisitor(node.default, visitor, isTypeNode) + ); + }, + [ + 169 + /* Parameter */ + ]: function visitEachChildOfParameterDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateParameterDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + nodeVisitor(node.type, visitor, isTypeNode), + nodeVisitor(node.initializer, visitor, isExpression) + ); + }, + [ + 170 + /* Decorator */ + ]: function visitEachChildOfDecorator(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDecorator( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + // Type elements + [ + 171 + /* PropertySignature */ + ]: function visitEachChildOfPropertySignature(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updatePropertySignature( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + nodeVisitor(node.type, visitor, isTypeNode) + ); + }, + [ + 172 + /* PropertyDeclaration */ + ]: function visitEachChildOfPropertyDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updatePropertyDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration + tokenVisitor ? nodeVisitor(node.questionToken ?? node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken) : node.questionToken ?? node.exclamationToken, + nodeVisitor(node.type, visitor, isTypeNode), + nodeVisitor(node.initializer, visitor, isExpression) + ); + }, + [ + 173 + /* MethodSignature */ + ]: function visitEachChildOfMethodSignature(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMethodSignature( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), + nodeVisitor(node.type, visitor, isTypeNode) + ); + }, + [ + 174 + /* MethodDeclaration */ + ]: function visitEachChildOfMethodDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMethodDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + nodeVisitor(node.type, visitor, isTypeNode), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 176 + /* Constructor */ + ]: function visitEachChildOfConstructorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructorDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 177 + /* GetAccessor */ + ]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateGetAccessorDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + nodeVisitor(node.type, visitor, isTypeNode), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 178 + /* SetAccessor */ + ]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSetAccessorDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 175 + /* ClassStaticBlockDeclaration */ + ]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + context2.startLexicalEnvironment(); + context2.suspendLexicalEnvironment(); + return context2.factory.updateClassStaticBlockDeclaration( + node, + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 179 + /* CallSignature */ + ]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCallSignature( + node, + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), + nodeVisitor(node.type, visitor, isTypeNode) + ); + }, + [ + 180 + /* ConstructSignature */ + ]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructSignature( + node, + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), + nodeVisitor(node.type, visitor, isTypeNode) + ); + }, + [ + 181 + /* IndexSignature */ + ]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIndexSignature( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + // Types + [ + 182 + /* TypePredicate */ + ]: function visitEachChildOfTypePredicateNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypePredicateNode( + node, + nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), + Debug.checkDefined(nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode)), + nodeVisitor(node.type, visitor, isTypeNode) + ); + }, + [ + 183 + /* TypeReference */ + ]: function visitEachChildOfTypeReferenceNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeReferenceNode( + node, + Debug.checkDefined(nodeVisitor(node.typeName, visitor, isEntityName)), + nodesVisitor(node.typeArguments, visitor, isTypeNode) + ); + }, + [ + 184 + /* FunctionType */ + ]: function visitEachChildOfFunctionTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateFunctionTypeNode( + node, + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 185 + /* ConstructorType */ + ]: function visitEachChildOfConstructorTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConstructorTypeNode( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.parameters, visitor, isParameter), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 186 + /* TypeQuery */ + ]: function visitEachChildOfTypeQueryNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeQueryNode( + node, + Debug.checkDefined(nodeVisitor(node.exprName, visitor, isEntityName)), + nodesVisitor(node.typeArguments, visitor, isTypeNode) + ); + }, + [ + 187 + /* TypeLiteral */ + ]: function visitEachChildOfTypeLiteralNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeLiteralNode( + node, + nodesVisitor(node.members, visitor, isTypeElement) + ); + }, + [ + 188 + /* ArrayType */ + ]: function visitEachChildOfArrayTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.elementType, visitor, isTypeNode)) + ); + }, + [ + 189 + /* TupleType */ + ]: function visitEachChildOfTupleTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateTupleTypeNode( + node, + nodesVisitor(node.elements, visitor, isTypeNode) + ); + }, + [ + 190 + /* OptionalType */ + ]: function visitEachChildOfOptionalTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateOptionalTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 191 + /* RestType */ + ]: function visitEachChildOfRestTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateRestTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 192 + /* UnionType */ + ]: function visitEachChildOfUnionTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateUnionTypeNode( + node, + nodesVisitor(node.types, visitor, isTypeNode) + ); + }, + [ + 193 + /* IntersectionType */ + ]: function visitEachChildOfIntersectionTypeNode(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateIntersectionTypeNode( + node, + nodesVisitor(node.types, visitor, isTypeNode) + ); + }, + [ + 194 + /* ConditionalType */ + ]: function visitEachChildOfConditionalTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateConditionalTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.checkType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.extendsType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.trueType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.falseType, visitor, isTypeNode)) + ); + }, + [ + 195 + /* InferType */ + ]: function visitEachChildOfInferTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateInferTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)) + ); + }, + [ + 205 + /* ImportType */ + ]: function visitEachChildOfImportTypeNode(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), + nodeVisitor(node.attributes, visitor, isImportAttributes), + nodeVisitor(node.qualifier, visitor, isEntityName), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + node.isTypeOf + ); + }, + [ + 302 + /* ImportTypeAssertionContainer */ + ]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportTypeAssertionContainer( + node, + Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)), + node.multiLine + ); + }, + [ + 202 + /* NamedTupleMember */ + ]: function visitEachChildOfNamedTupleMember(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateNamedTupleMember( + node, + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 196 + /* ParenthesizedType */ + ]: function visitEachChildOfParenthesizedType(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateParenthesizedType( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 198 + /* TypeOperator */ + ]: function visitEachChildOfTypeOperatorNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeOperatorNode( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 199 + /* IndexedAccessType */ + ]: function visitEachChildOfIndexedAccessType(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIndexedAccessTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.objectType, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.indexType, visitor, isTypeNode)) + ); + }, + [ + 200 + /* MappedType */ + ]: function visitEachChildOfMappedType(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateMappedTypeNode( + node, + tokenVisitor ? nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken) : node.readonlyToken, + Debug.checkDefined(nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration)), + nodeVisitor(node.nameType, visitor, isTypeNode), + tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken) : node.questionToken, + nodeVisitor(node.type, visitor, isTypeNode), + nodesVisitor(node.members, visitor, isTypeElement) + ); + }, + [ + 201 + /* LiteralType */ + ]: function visitEachChildOfLiteralTypeNode(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateLiteralTypeNode( + node, + Debug.checkDefined(nodeVisitor(node.literal, visitor, isLiteralTypeLiteral)) + ); + }, + [ + 203 + /* TemplateLiteralType */ + ]: function visitEachChildOfTemplateLiteralType(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateLiteralType( + node, + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), + nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) + ); + }, + [ + 204 + /* TemplateLiteralTypeSpan */ + ]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateLiteralTypeSpan( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) + ); + }, + // Binding patterns + [ + 206 + /* ObjectBindingPattern */ + ]: function visitEachChildOfObjectBindingPattern(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateObjectBindingPattern( + node, + nodesVisitor(node.elements, visitor, isBindingElement) + ); + }, + [ + 207 + /* ArrayBindingPattern */ + ]: function visitEachChildOfArrayBindingPattern(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayBindingPattern( + node, + nodesVisitor(node.elements, visitor, isArrayBindingElement) + ); + }, + [ + 208 + /* BindingElement */ + ]: function visitEachChildOfBindingElement(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateBindingElement( + node, + tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken, + nodeVisitor(node.propertyName, visitor, isPropertyName), + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + nodeVisitor(node.initializer, visitor, isExpression) + ); + }, + // Expression + [ + 209 + /* ArrayLiteralExpression */ + ]: function visitEachChildOfArrayLiteralExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateArrayLiteralExpression( + node, + nodesVisitor(node.elements, visitor, isExpression) + ); + }, + [ + 210 + /* ObjectLiteralExpression */ + ]: function visitEachChildOfObjectLiteralExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateObjectLiteralExpression( + node, + nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) + ); + }, + [ + 211 + /* PropertyAccessExpression */ + ]: function visitEachChildOfPropertyAccessExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return isPropertyAccessChain(node) ? context2.factory.updatePropertyAccessChain( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) + ) : context2.factory.updatePropertyAccessExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isMemberName)) + ); + }, + [ + 212 + /* ElementAccessExpression */ + ]: function visitEachChildOfElementAccessExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return isElementAccessChain(node) ? context2.factory.updateElementAccessChain( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) + ) : context2.factory.updateElementAccessExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.argumentExpression, visitor, isExpression)) + ); + }, + [ + 213 + /* CallExpression */ + ]: function visitEachChildOfCallExpression(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return isCallChain(node) ? context2.factory.updateCallChain( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + tokenVisitor ? nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken) : node.questionDotToken, + nodesVisitor(node.typeArguments, visitor, isTypeNode), + nodesVisitor(node.arguments, visitor, isExpression) + ) : context2.factory.updateCallExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + nodesVisitor(node.arguments, visitor, isExpression) + ); + }, + [ + 214 + /* NewExpression */ + ]: function visitEachChildOfNewExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNewExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + nodesVisitor(node.arguments, visitor, isExpression) + ); + }, + [ + 215 + /* TaggedTemplateExpression */ + ]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTaggedTemplateExpression( + node, + Debug.checkDefined(nodeVisitor(node.tag, visitor, isExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.template, visitor, isTemplateLiteral)) + ); + }, + [ + 216 + /* TypeAssertionExpression */ + ]: function visitEachChildOfTypeAssertionExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeAssertion( + node, + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 217 + /* ParenthesizedExpression */ + ]: function visitEachChildOfParenthesizedExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateParenthesizedExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 218 + /* FunctionExpression */ + ]: function visitEachChildOfFunctionExpression(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateFunctionExpression( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + nodeVisitor(node.type, visitor, isTypeNode), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 219 + /* ArrowFunction */ + ]: function visitEachChildOfArrowFunction(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateArrowFunction( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + nodeVisitor(node.type, visitor, isTypeNode), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken)) : node.equalsGreaterThanToken, + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 220 + /* DeleteExpression */ + ]: function visitEachChildOfDeleteExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDeleteExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 221 + /* TypeOfExpression */ + ]: function visitEachChildOfTypeOfExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeOfExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 222 + /* VoidExpression */ + ]: function visitEachChildOfVoidExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateVoidExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 223 + /* AwaitExpression */ + ]: function visitEachChildOfAwaitExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateAwaitExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 224 + /* PrefixUnaryExpression */ + ]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePrefixUnaryExpression( + node, + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) + ); + }, + [ + 225 + /* PostfixUnaryExpression */ + ]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePostfixUnaryExpression( + node, + Debug.checkDefined(nodeVisitor(node.operand, visitor, isExpression)) + ); + }, + [ + 226 + /* BinaryExpression */ + ]: function visitEachChildOfBinaryExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateBinaryExpression( + node, + Debug.checkDefined(nodeVisitor(node.left, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken)) : node.operatorToken, + Debug.checkDefined(nodeVisitor(node.right, visitor, isExpression)) + ); + }, + [ + 227 + /* ConditionalExpression */ + ]: function visitEachChildOfConditionalExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateConditionalExpression( + node, + Debug.checkDefined(nodeVisitor(node.condition, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken)) : node.questionToken, + Debug.checkDefined(nodeVisitor(node.whenTrue, visitor, isExpression)), + tokenVisitor ? Debug.checkDefined(nodeVisitor(node.colonToken, tokenVisitor, isColonToken)) : node.colonToken, + Debug.checkDefined(nodeVisitor(node.whenFalse, visitor, isExpression)) + ); + }, + [ + 228 + /* TemplateExpression */ + ]: function visitEachChildOfTemplateExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateExpression( + node, + Debug.checkDefined(nodeVisitor(node.head, visitor, isTemplateHead)), + nodesVisitor(node.templateSpans, visitor, isTemplateSpan) + ); + }, + [ + 229 + /* YieldExpression */ + ]: function visitEachChildOfYieldExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateYieldExpression( + node, + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + nodeVisitor(node.expression, visitor, isExpression) + ); + }, + [ + 230 + /* SpreadElement */ + ]: function visitEachChildOfSpreadElement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSpreadElement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 231 + /* ClassExpression */ + ]: function visitEachChildOfClassExpression(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateClassExpression( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.heritageClauses, visitor, isHeritageClause), + nodesVisitor(node.members, visitor, isClassElement) + ); + }, + [ + 233 + /* ExpressionWithTypeArguments */ + ]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExpressionWithTypeArguments( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode) + ); + }, + [ + 234 + /* AsExpression */ + ]: function visitEachChildOfAsExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateAsExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 238 + /* SatisfiesExpression */ + ]: function visitEachChildOfSatisfiesExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSatisfiesExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 235 + /* NonNullExpression */ + ]: function visitEachChildOfNonNullExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return isOptionalChain(node) ? context2.factory.updateNonNullChain( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ) : context2.factory.updateNonNullExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 236 + /* MetaProperty */ + ]: function visitEachChildOfMetaProperty(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateMetaProperty( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + // Misc + [ + 239 + /* TemplateSpan */ + ]: function visitEachChildOfTemplateSpan(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTemplateSpan( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail)) + ); + }, + // Element + [ + 241 + /* Block */ + ]: function visitEachChildOfBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateBlock( + node, + nodesVisitor(node.statements, visitor, isStatement) + ); + }, + [ + 243 + /* VariableStatement */ + ]: function visitEachChildOfVariableStatement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateVariableStatement( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.declarationList, visitor, isVariableDeclarationList)) + ); + }, + [ + 244 + /* ExpressionStatement */ + ]: function visitEachChildOfExpressionStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExpressionStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 245 + /* IfStatement */ + ]: function visitEachChildOfIfStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateIfStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.thenStatement, visitor, isStatement, context2.factory.liftToBlock)), + nodeVisitor(node.elseStatement, visitor, isStatement, context2.factory.liftToBlock) + ); + }, + [ + 246 + /* DoStatement */ + ]: function visitEachChildOfDoStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateDoStatement( + node, + visitIterationBody(node.statement, visitor, context2, nodeVisitor), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 247 + /* WhileStatement */ + ]: function visitEachChildOfWhileStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateWhileStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + visitIterationBody(node.statement, visitor, context2, nodeVisitor) + ); + }, + [ + 248 + /* ForStatement */ + ]: function visitEachChildOfForStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateForStatement( + node, + nodeVisitor(node.initializer, visitor, isForInitializer), + nodeVisitor(node.condition, visitor, isExpression), + nodeVisitor(node.incrementor, visitor, isExpression), + visitIterationBody(node.statement, visitor, context2, nodeVisitor) + ); + }, + [ + 249 + /* ForInStatement */ + ]: function visitEachChildOfForInStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateForInStatement( + node, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + visitIterationBody(node.statement, visitor, context2, nodeVisitor) + ); + }, + [ + 250 + /* ForOfStatement */ + ]: function visitEachChildOfForOfStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateForOfStatement( + node, + tokenVisitor ? nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword) : node.awaitModifier, + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + visitIterationBody(node.statement, visitor, context2, nodeVisitor) + ); + }, + [ + 251 + /* ContinueStatement */ + ]: function visitEachChildOfContinueStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateContinueStatement( + node, + nodeVisitor(node.label, visitor, isIdentifier) + ); + }, + [ + 252 + /* BreakStatement */ + ]: function visitEachChildOfBreakStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateBreakStatement( + node, + nodeVisitor(node.label, visitor, isIdentifier) + ); + }, + [ + 253 + /* ReturnStatement */ + ]: function visitEachChildOfReturnStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateReturnStatement( + node, + nodeVisitor(node.expression, visitor, isExpression) + ); + }, + [ + 254 + /* WithStatement */ + ]: function visitEachChildOfWithStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateWithStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context2.factory.liftToBlock)) + ); + }, + [ + 255 + /* SwitchStatement */ + ]: function visitEachChildOfSwitchStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSwitchStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + Debug.checkDefined(nodeVisitor(node.caseBlock, visitor, isCaseBlock)) + ); + }, + [ + 256 + /* LabeledStatement */ + ]: function visitEachChildOfLabeledStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateLabeledStatement( + node, + Debug.checkDefined(nodeVisitor(node.label, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.statement, visitor, isStatement, context2.factory.liftToBlock)) + ); + }, + [ + 257 + /* ThrowStatement */ + ]: function visitEachChildOfThrowStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateThrowStatement( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 258 + /* TryStatement */ + ]: function visitEachChildOfTryStatement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTryStatement( + node, + Debug.checkDefined(nodeVisitor(node.tryBlock, visitor, isBlock2)), + nodeVisitor(node.catchClause, visitor, isCatchClause), + nodeVisitor(node.finallyBlock, visitor, isBlock2) + ); + }, + [ + 260 + /* VariableDeclaration */ + ]: function visitEachChildOfVariableDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateVariableDeclaration( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isBindingName)), + tokenVisitor ? nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken) : node.exclamationToken, + nodeVisitor(node.type, visitor, isTypeNode), + nodeVisitor(node.initializer, visitor, isExpression) + ); + }, + [ + 261 + /* VariableDeclarationList */ + ]: function visitEachChildOfVariableDeclarationList(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateVariableDeclarationList( + node, + nodesVisitor(node.declarations, visitor, isVariableDeclaration) + ); + }, + [ + 262 + /* FunctionDeclaration */ + ]: function visitEachChildOfFunctionDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, tokenVisitor) { + return context2.factory.updateFunctionDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifier), + tokenVisitor ? nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken) : node.asteriskToken, + nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + visitParameterList(node.parameters, visitor, context2, nodesVisitor), + nodeVisitor(node.type, visitor, isTypeNode), + visitFunctionBody(node.body, visitor, context2, nodeVisitor) + ); + }, + [ + 263 + /* ClassDeclaration */ + ]: function visitEachChildOfClassDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateClassDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodeVisitor(node.name, visitor, isIdentifier), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.heritageClauses, visitor, isHeritageClause), + nodesVisitor(node.members, visitor, isClassElement) + ); + }, + [ + 264 + /* InterfaceDeclaration */ + ]: function visitEachChildOfInterfaceDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateInterfaceDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + nodesVisitor(node.heritageClauses, visitor, isHeritageClause), + nodesVisitor(node.members, visitor, isTypeElement) + ); + }, + [ + 265 + /* TypeAliasDeclaration */ + ]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateTypeAliasDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), + Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode)) + ); + }, + [ + 266 + /* EnumDeclaration */ + ]: function visitEachChildOfEnumDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateEnumDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + nodesVisitor(node.members, visitor, isEnumMember) + ); + }, + [ + 267 + /* ModuleDeclaration */ + ]: function visitEachChildOfModuleDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateModuleDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleName)), + nodeVisitor(node.body, visitor, isModuleBody) + ); + }, + [ + 268 + /* ModuleBlock */ + ]: function visitEachChildOfModuleBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateModuleBlock( + node, + nodesVisitor(node.statements, visitor, isStatement) + ); + }, + [ + 269 + /* CaseBlock */ + ]: function visitEachChildOfCaseBlock(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateCaseBlock( + node, + nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) + ); + }, + [ + 270 + /* NamespaceExportDeclaration */ + ]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceExportDeclaration( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + [ + 271 + /* ImportEqualsDeclaration */ + ]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportEqualsDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + node.isTypeOnly, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.moduleReference, visitor, isModuleReference)) + ); + }, + [ + 272 + /* ImportDeclaration */ + ]: function visitEachChildOfImportDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + nodeVisitor(node.importClause, visitor, isImportClause), + Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), + nodeVisitor(node.attributes, visitor, isImportAttributes) + ); + }, + [ + 300 + /* ImportAttributes */ + ]: function visitEachChildOfImportAttributes(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportAttributes( + node, + nodesVisitor(node.elements, visitor, isImportAttribute), + node.multiLine + ); + }, + [ + 301 + /* ImportAttribute */ + ]: function visitEachChildOfImportAttribute(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportAttribute( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), + Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)) + ); + }, + [ + 273 + /* ImportClause */ + ]: function visitEachChildOfImportClause(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportClause( + node, + node.isTypeOnly, + nodeVisitor(node.name, visitor, isIdentifier), + nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) + ); + }, + [ + 274 + /* NamespaceImport */ + ]: function visitEachChildOfNamespaceImport(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceImport( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + [ + 280 + /* NamespaceExport */ + ]: function visitEachChildOfNamespaceExport(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamespaceExport( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + [ + 275 + /* NamedImports */ + ]: function visitEachChildOfNamedImports(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamedImports( + node, + nodesVisitor(node.elements, visitor, isImportSpecifier) + ); + }, + [ + 276 + /* ImportSpecifier */ + ]: function visitEachChildOfImportSpecifier(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateImportSpecifier( + node, + node.isTypeOnly, + nodeVisitor(node.propertyName, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + [ + 277 + /* ExportAssignment */ + ]: function visitEachChildOfExportAssignment(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportAssignment( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 278 + /* ExportDeclaration */ + ]: function visitEachChildOfExportDeclaration(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportDeclaration( + node, + nodesVisitor(node.modifiers, visitor, isModifierLike), + node.isTypeOnly, + nodeVisitor(node.exportClause, visitor, isNamedExportBindings), + nodeVisitor(node.moduleSpecifier, visitor, isExpression), + nodeVisitor(node.attributes, visitor, isImportAttributes) + ); + }, + [ + 279 + /* NamedExports */ + ]: function visitEachChildOfNamedExports(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateNamedExports( + node, + nodesVisitor(node.elements, visitor, isExportSpecifier) + ); + }, + [ + 281 + /* ExportSpecifier */ + ]: function visitEachChildOfExportSpecifier(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExportSpecifier( + node, + node.isTypeOnly, + nodeVisitor(node.propertyName, visitor, isIdentifier), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + // Module references + [ + 283 + /* ExternalModuleReference */ + ]: function visitEachChildOfExternalModuleReference(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateExternalModuleReference( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + // JSX + [ + 284 + /* JsxElement */ + ]: function visitEachChildOfJsxElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxElement( + node, + Debug.checkDefined(nodeVisitor(node.openingElement, visitor, isJsxOpeningElement)), + nodesVisitor(node.children, visitor, isJsxChild), + Debug.checkDefined(nodeVisitor(node.closingElement, visitor, isJsxClosingElement)) + ); + }, + [ + 285 + /* JsxSelfClosingElement */ + ]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxSelfClosingElement( + node, + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) + ); + }, + [ + 286 + /* JsxOpeningElement */ + ]: function visitEachChildOfJsxOpeningElement(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxOpeningElement( + node, + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)), + nodesVisitor(node.typeArguments, visitor, isTypeNode), + Debug.checkDefined(nodeVisitor(node.attributes, visitor, isJsxAttributes)) + ); + }, + [ + 287 + /* JsxClosingElement */ + ]: function visitEachChildOfJsxClosingElement(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxClosingElement( + node, + Debug.checkDefined(nodeVisitor(node.tagName, visitor, isJsxTagNameExpression)) + ); + }, + [ + 295 + /* JsxNamespacedName */ + ]: function forEachChildInJsxNamespacedName2(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxNamespacedName( + node, + Debug.checkDefined(nodeVisitor(node.namespace, visitor, isIdentifier)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)) + ); + }, + [ + 288 + /* JsxFragment */ + ]: function visitEachChildOfJsxFragment(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxFragment( + node, + Debug.checkDefined(nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment)), + nodesVisitor(node.children, visitor, isJsxChild), + Debug.checkDefined(nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment)) + ); + }, + [ + 291 + /* JsxAttribute */ + ]: function visitEachChildOfJsxAttribute(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxAttribute( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isJsxAttributeName)), + nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) + ); + }, + [ + 292 + /* JsxAttributes */ + ]: function visitEachChildOfJsxAttributes(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxAttributes( + node, + nodesVisitor(node.properties, visitor, isJsxAttributeLike) + ); + }, + [ + 293 + /* JsxSpreadAttribute */ + ]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxSpreadAttribute( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 294 + /* JsxExpression */ + ]: function visitEachChildOfJsxExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateJsxExpression( + node, + nodeVisitor(node.expression, visitor, isExpression) + ); + }, + // Clauses + [ + 296 + /* CaseClause */ + ]: function visitEachChildOfCaseClause(node, visitor, context2, nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCaseClause( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)), + nodesVisitor(node.statements, visitor, isStatement) + ); + }, + [ + 297 + /* DefaultClause */ + ]: function visitEachChildOfDefaultClause(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateDefaultClause( + node, + nodesVisitor(node.statements, visitor, isStatement) + ); + }, + [ + 298 + /* HeritageClause */ + ]: function visitEachChildOfHeritageClause(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateHeritageClause( + node, + nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) + ); + }, + [ + 299 + /* CatchClause */ + ]: function visitEachChildOfCatchClause(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateCatchClause( + node, + nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), + Debug.checkDefined(nodeVisitor(node.block, visitor, isBlock2)) + ); + }, + // Property assignments + [ + 303 + /* PropertyAssignment */ + ]: function visitEachChildOfPropertyAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePropertyAssignment( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + Debug.checkDefined(nodeVisitor(node.initializer, visitor, isExpression)) + ); + }, + [ + 304 + /* ShorthandPropertyAssignment */ + ]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateShorthandPropertyAssignment( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)), + nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) + ); + }, + [ + 305 + /* SpreadAssignment */ + ]: function visitEachChildOfSpreadAssignment(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateSpreadAssignment( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + // Enum + [ + 306 + /* EnumMember */ + ]: function visitEachChildOfEnumMember(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updateEnumMember( + node, + Debug.checkDefined(nodeVisitor(node.name, visitor, isPropertyName)), + nodeVisitor(node.initializer, visitor, isExpression) + ); + }, + // Top-level nodes + [ + 312 + /* SourceFile */ + ]: function visitEachChildOfSourceFile(node, visitor, context2, _nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateSourceFile( + node, + visitLexicalEnvironment(node.statements, visitor, context2) + ); + }, + // Transformation nodes + [ + 360 + /* PartiallyEmittedExpression */ + ]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context2, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context2.factory.updatePartiallyEmittedExpression( + node, + Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression)) + ); + }, + [ + 361 + /* CommaListExpression */ + ]: function visitEachChildOfCommaListExpression(node, visitor, context2, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context2.factory.updateCommaListExpression( + node, + nodesVisitor(node.elements, visitor, isExpression) + ); + } + }; + } + }); + function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) { + var { enter, exit: exit3 } = generatorOptions.extendedDiagnostics ? createTimer("Source Map", "beforeSourcemap", "afterSourcemap") : nullTimer; + var rawSources = []; + var sources = []; + var sourceToSourceIndexMap = /* @__PURE__ */ new Map(); + var sourcesContent; + var names = []; + var nameToNameIndexMap; + var mappingCharCodes = []; + var mappings = ""; + var lastGeneratedLine = 0; + var lastGeneratedCharacter = 0; + var lastSourceIndex = 0; + var lastSourceLine = 0; + var lastSourceCharacter = 0; + var lastNameIndex = 0; + var hasLast = false; + var pendingGeneratedLine = 0; + var pendingGeneratedCharacter = 0; + var pendingSourceIndex = 0; + var pendingSourceLine = 0; + var pendingSourceCharacter = 0; + var pendingNameIndex = 0; + var hasPending = false; + var hasPendingSource = false; + var hasPendingName = false; + return { + getSources: () => rawSources, + addSource, + setSourceContent, + addName, + addMapping, + appendSourceMap, + toJSON, + toString: () => JSON.stringify(toJSON()) + }; + function addSource(fileName) { + enter(); + const source = getRelativePathToDirectoryOrUrl( + sourcesDirectoryPath, + fileName, + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + true + ); + let sourceIndex = sourceToSourceIndexMap.get(source); + if (sourceIndex === void 0) { + sourceIndex = sources.length; + sources.push(source); + rawSources.push(fileName); + sourceToSourceIndexMap.set(source, sourceIndex); + } + exit3(); + return sourceIndex; + } + function setSourceContent(sourceIndex, content) { + enter(); + if (content !== null) { + if (!sourcesContent) + sourcesContent = []; + while (sourcesContent.length < sourceIndex) { + sourcesContent.push(null); + } + sourcesContent[sourceIndex] = content; + } + exit3(); + } + function addName(name2) { + enter(); + if (!nameToNameIndexMap) + nameToNameIndexMap = /* @__PURE__ */ new Map(); + let nameIndex = nameToNameIndexMap.get(name2); + if (nameIndex === void 0) { + nameIndex = names.length; + names.push(name2); + nameToNameIndexMap.set(name2, nameIndex); + } + exit3(); + return nameIndex; + } + function isNewGeneratedPosition(generatedLine, generatedCharacter) { + return !hasPending || pendingGeneratedLine !== generatedLine || pendingGeneratedCharacter !== generatedCharacter; + } + function isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter) { + return sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0 && pendingSourceIndex === sourceIndex && (pendingSourceLine > sourceLine || pendingSourceLine === sourceLine && pendingSourceCharacter > sourceCharacter); + } + function addMapping(generatedLine, generatedCharacter, sourceIndex, sourceLine, sourceCharacter, nameIndex) { + Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); + Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); + Debug.assert(sourceIndex === void 0 || sourceIndex >= 0, "sourceIndex cannot be negative"); + Debug.assert(sourceLine === void 0 || sourceLine >= 0, "sourceLine cannot be negative"); + Debug.assert(sourceCharacter === void 0 || sourceCharacter >= 0, "sourceCharacter cannot be negative"); + enter(); + if (isNewGeneratedPosition(generatedLine, generatedCharacter) || isBacktrackingSourcePosition(sourceIndex, sourceLine, sourceCharacter)) { + commitPendingMapping(); + pendingGeneratedLine = generatedLine; + pendingGeneratedCharacter = generatedCharacter; + hasPendingSource = false; + hasPendingName = false; + hasPending = true; + } + if (sourceIndex !== void 0 && sourceLine !== void 0 && sourceCharacter !== void 0) { + pendingSourceIndex = sourceIndex; + pendingSourceLine = sourceLine; + pendingSourceCharacter = sourceCharacter; + hasPendingSource = true; + if (nameIndex !== void 0) { + pendingNameIndex = nameIndex; + hasPendingName = true; + } + } + exit3(); + } + function appendSourceMap(generatedLine, generatedCharacter, map22, sourceMapPath, start, end) { + Debug.assert(generatedLine >= pendingGeneratedLine, "generatedLine cannot backtrack"); + Debug.assert(generatedCharacter >= 0, "generatedCharacter cannot be negative"); + enter(); + const sourceIndexToNewSourceIndexMap = []; + let nameIndexToNewNameIndexMap; + const mappingIterator = decodeMappings(map22.mappings); + for (const raw of mappingIterator) { + if (end && (raw.generatedLine > end.line || raw.generatedLine === end.line && raw.generatedCharacter > end.character)) { + break; + } + if (start && (raw.generatedLine < start.line || start.line === raw.generatedLine && raw.generatedCharacter < start.character)) { + continue; + } + let newSourceIndex; + let newSourceLine; + let newSourceCharacter; + let newNameIndex; + if (raw.sourceIndex !== void 0) { + newSourceIndex = sourceIndexToNewSourceIndexMap[raw.sourceIndex]; + if (newSourceIndex === void 0) { + const rawPath = map22.sources[raw.sourceIndex]; + const relativePath2 = map22.sourceRoot ? combinePaths(map22.sourceRoot, rawPath) : rawPath; + const combinedPath = combinePaths(getDirectoryPath(sourceMapPath), relativePath2); + sourceIndexToNewSourceIndexMap[raw.sourceIndex] = newSourceIndex = addSource(combinedPath); + if (map22.sourcesContent && typeof map22.sourcesContent[raw.sourceIndex] === "string") { + setSourceContent(newSourceIndex, map22.sourcesContent[raw.sourceIndex]); + } + } + newSourceLine = raw.sourceLine; + newSourceCharacter = raw.sourceCharacter; + if (map22.names && raw.nameIndex !== void 0) { + if (!nameIndexToNewNameIndexMap) + nameIndexToNewNameIndexMap = []; + newNameIndex = nameIndexToNewNameIndexMap[raw.nameIndex]; + if (newNameIndex === void 0) { + nameIndexToNewNameIndexMap[raw.nameIndex] = newNameIndex = addName(map22.names[raw.nameIndex]); + } + } + } + const rawGeneratedLine = raw.generatedLine - (start ? start.line : 0); + const newGeneratedLine = rawGeneratedLine + generatedLine; + const rawGeneratedCharacter = start && start.line === raw.generatedLine ? raw.generatedCharacter - start.character : raw.generatedCharacter; + const newGeneratedCharacter = rawGeneratedLine === 0 ? rawGeneratedCharacter + generatedCharacter : rawGeneratedCharacter; + addMapping(newGeneratedLine, newGeneratedCharacter, newSourceIndex, newSourceLine, newSourceCharacter, newNameIndex); + } + exit3(); + } + function shouldCommitMapping() { + return !hasLast || lastGeneratedLine !== pendingGeneratedLine || lastGeneratedCharacter !== pendingGeneratedCharacter || lastSourceIndex !== pendingSourceIndex || lastSourceLine !== pendingSourceLine || lastSourceCharacter !== pendingSourceCharacter || lastNameIndex !== pendingNameIndex; + } + function appendMappingCharCode(charCode) { + mappingCharCodes.push(charCode); + if (mappingCharCodes.length >= 1024) { + flushMappingBuffer(); + } + } + function commitPendingMapping() { + if (!hasPending || !shouldCommitMapping()) { + return; + } + enter(); + if (lastGeneratedLine < pendingGeneratedLine) { + do { + appendMappingCharCode( + 59 + /* semicolon */ + ); + lastGeneratedLine++; + } while (lastGeneratedLine < pendingGeneratedLine); + lastGeneratedCharacter = 0; + } else { + Debug.assertEqual(lastGeneratedLine, pendingGeneratedLine, "generatedLine cannot backtrack"); + if (hasLast) { + appendMappingCharCode( + 44 + /* comma */ + ); + } + } + appendBase64VLQ(pendingGeneratedCharacter - lastGeneratedCharacter); + lastGeneratedCharacter = pendingGeneratedCharacter; + if (hasPendingSource) { + appendBase64VLQ(pendingSourceIndex - lastSourceIndex); + lastSourceIndex = pendingSourceIndex; + appendBase64VLQ(pendingSourceLine - lastSourceLine); + lastSourceLine = pendingSourceLine; + appendBase64VLQ(pendingSourceCharacter - lastSourceCharacter); + lastSourceCharacter = pendingSourceCharacter; + if (hasPendingName) { + appendBase64VLQ(pendingNameIndex - lastNameIndex); + lastNameIndex = pendingNameIndex; + } + } + hasLast = true; + exit3(); + } + function flushMappingBuffer() { + if (mappingCharCodes.length > 0) { + mappings += String.fromCharCode.apply(void 0, mappingCharCodes); + mappingCharCodes.length = 0; + } + } + function toJSON() { + commitPendingMapping(); + flushMappingBuffer(); + return { + version: 3, + file, + sourceRoot, + sources, + names, + mappings, + sourcesContent + }; + } + function appendBase64VLQ(inValue) { + if (inValue < 0) { + inValue = (-inValue << 1) + 1; + } else { + inValue = inValue << 1; + } + do { + let currentDigit = inValue & 31; + inValue = inValue >> 5; + if (inValue > 0) { + currentDigit = currentDigit | 32; + } + appendMappingCharCode(base64FormatEncode(currentDigit)); + } while (inValue > 0); + } + } + function getLineInfo(text, lineStarts) { + return { + getLineCount: () => lineStarts.length, + getLineText: (line) => text.substring(lineStarts[line], lineStarts[line + 1]) + }; + } + function tryGetSourceMappingURL(lineInfo) { + for (let index4 = lineInfo.getLineCount() - 1; index4 >= 0; index4--) { + const line = lineInfo.getLineText(index4); + const comment = sourceMapCommentRegExp.exec(line); + if (comment) { + return comment[1].trimEnd(); + } else if (!line.match(whitespaceOrMapCommentRegExp)) { + break; + } + } + } + function isStringOrNull(x7) { + return typeof x7 === "string" || x7 === null; + } + function isRawSourceMap(x7) { + return x7 !== null && typeof x7 === "object" && x7.version === 3 && typeof x7.file === "string" && typeof x7.mappings === "string" && isArray3(x7.sources) && every2(x7.sources, isString4) && (x7.sourceRoot === void 0 || x7.sourceRoot === null || typeof x7.sourceRoot === "string") && (x7.sourcesContent === void 0 || x7.sourcesContent === null || isArray3(x7.sourcesContent) && every2(x7.sourcesContent, isStringOrNull)) && (x7.names === void 0 || x7.names === null || isArray3(x7.names) && every2(x7.names, isString4)); + } + function tryParseRawSourceMap(text) { + try { + const parsed = JSON.parse(text); + if (isRawSourceMap(parsed)) { + return parsed; + } + } catch { + } + return void 0; + } + function decodeMappings(mappings) { + let done = false; + let pos = 0; + let generatedLine = 0; + let generatedCharacter = 0; + let sourceIndex = 0; + let sourceLine = 0; + let sourceCharacter = 0; + let nameIndex = 0; + let error22; + return { + get pos() { + return pos; + }, + get error() { + return error22; + }, + get state() { + return captureMapping( + /*hasSource*/ + true, + /*hasName*/ + true + ); + }, + next() { + while (!done && pos < mappings.length) { + const ch = mappings.charCodeAt(pos); + if (ch === 59) { + generatedLine++; + generatedCharacter = 0; + pos++; + continue; + } + if (ch === 44) { + pos++; + continue; + } + let hasSource = false; + let hasName = false; + generatedCharacter += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (generatedCharacter < 0) + return setErrorAndStopIterating("Invalid generatedCharacter found"); + if (!isSourceMappingSegmentEnd()) { + hasSource = true; + sourceIndex += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceIndex < 0) + return setErrorAndStopIterating("Invalid sourceIndex found"); + if (isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Format: No entries after sourceIndex"); + sourceLine += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceLine < 0) + return setErrorAndStopIterating("Invalid sourceLine found"); + if (isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Format: No entries after sourceLine"); + sourceCharacter += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (sourceCharacter < 0) + return setErrorAndStopIterating("Invalid sourceCharacter found"); + if (!isSourceMappingSegmentEnd()) { + hasName = true; + nameIndex += base64VLQFormatDecode(); + if (hasReportedError()) + return stopIterating(); + if (nameIndex < 0) + return setErrorAndStopIterating("Invalid nameIndex found"); + if (!isSourceMappingSegmentEnd()) + return setErrorAndStopIterating("Unsupported Error Format: Entries after nameIndex"); + } + } + return { value: captureMapping(hasSource, hasName), done }; + } + return stopIterating(); + }, + [Symbol.iterator]() { + return this; + } + }; + function captureMapping(hasSource, hasName) { + return { + generatedLine, + generatedCharacter, + sourceIndex: hasSource ? sourceIndex : void 0, + sourceLine: hasSource ? sourceLine : void 0, + sourceCharacter: hasSource ? sourceCharacter : void 0, + nameIndex: hasName ? nameIndex : void 0 + }; + } + function stopIterating() { + done = true; + return { value: void 0, done: true }; + } + function setError(message) { + if (error22 === void 0) { + error22 = message; + } + } + function setErrorAndStopIterating(message) { + setError(message); + return stopIterating(); + } + function hasReportedError() { + return error22 !== void 0; + } + function isSourceMappingSegmentEnd() { + return pos === mappings.length || mappings.charCodeAt(pos) === 44 || mappings.charCodeAt(pos) === 59; + } + function base64VLQFormatDecode() { + let moreDigits = true; + let shiftCount = 0; + let value2 = 0; + for (; moreDigits; pos++) { + if (pos >= mappings.length) + return setError("Error in decoding base64VLQFormatDecode, past the mapping string"), -1; + const currentByte = base64FormatDecode(mappings.charCodeAt(pos)); + if (currentByte === -1) + return setError("Invalid character in VLQ"), -1; + moreDigits = (currentByte & 32) !== 0; + value2 = value2 | (currentByte & 31) << shiftCount; + shiftCount += 5; + } + if ((value2 & 1) === 0) { + value2 = value2 >> 1; + } else { + value2 = value2 >> 1; + value2 = -value2; + } + return value2; + } + } + function sameMapping(left, right) { + return left === right || left.generatedLine === right.generatedLine && left.generatedCharacter === right.generatedCharacter && left.sourceIndex === right.sourceIndex && left.sourceLine === right.sourceLine && left.sourceCharacter === right.sourceCharacter && left.nameIndex === right.nameIndex; + } + function isSourceMapping(mapping) { + return mapping.sourceIndex !== void 0 && mapping.sourceLine !== void 0 && mapping.sourceCharacter !== void 0; + } + function base64FormatEncode(value2) { + return value2 >= 0 && value2 < 26 ? 65 + value2 : value2 >= 26 && value2 < 52 ? 97 + value2 - 26 : value2 >= 52 && value2 < 62 ? 48 + value2 - 52 : value2 === 62 ? 43 : value2 === 63 ? 47 : Debug.fail(`${value2}: not a base64 value`); + } + function base64FormatDecode(ch) { + return ch >= 65 && ch <= 90 ? ch - 65 : ch >= 97 && ch <= 122 ? ch - 97 + 26 : ch >= 48 && ch <= 57 ? ch - 48 + 52 : ch === 43 ? 62 : ch === 47 ? 63 : -1; + } + function isSourceMappedPosition(value2) { + return value2.sourceIndex !== void 0 && value2.sourcePosition !== void 0; + } + function sameMappedPosition(left, right) { + return left.generatedPosition === right.generatedPosition && left.sourceIndex === right.sourceIndex && left.sourcePosition === right.sourcePosition; + } + function compareSourcePositions(left, right) { + Debug.assert(left.sourceIndex === right.sourceIndex); + return compareValues(left.sourcePosition, right.sourcePosition); + } + function compareGeneratedPositions(left, right) { + return compareValues(left.generatedPosition, right.generatedPosition); + } + function getSourcePositionOfMapping(value2) { + return value2.sourcePosition; + } + function getGeneratedPositionOfMapping(value2) { + return value2.generatedPosition; + } + function createDocumentPositionMapper(host, map22, mapPath) { + const mapDirectory = getDirectoryPath(mapPath); + const sourceRoot = map22.sourceRoot ? getNormalizedAbsolutePath(map22.sourceRoot, mapDirectory) : mapDirectory; + const generatedAbsoluteFilePath = getNormalizedAbsolutePath(map22.file, mapDirectory); + const generatedFile = host.getSourceFileLike(generatedAbsoluteFilePath); + const sourceFileAbsolutePaths = map22.sources.map((source) => getNormalizedAbsolutePath(source, sourceRoot)); + const sourceToSourceIndexMap = new Map(sourceFileAbsolutePaths.map((source, i7) => [host.getCanonicalFileName(source), i7])); + let decodedMappings; + let generatedMappings; + let sourceMappings; + return { + getSourcePosition, + getGeneratedPosition + }; + function processMapping(mapping) { + const generatedPosition = generatedFile !== void 0 ? getPositionOfLineAndCharacter( + generatedFile, + mapping.generatedLine, + mapping.generatedCharacter, + /*allowEdits*/ + true + ) : -1; + let source; + let sourcePosition; + if (isSourceMapping(mapping)) { + const sourceFile = host.getSourceFileLike(sourceFileAbsolutePaths[mapping.sourceIndex]); + source = map22.sources[mapping.sourceIndex]; + sourcePosition = sourceFile !== void 0 ? getPositionOfLineAndCharacter( + sourceFile, + mapping.sourceLine, + mapping.sourceCharacter, + /*allowEdits*/ + true + ) : -1; + } + return { + generatedPosition, + source, + sourceIndex: mapping.sourceIndex, + sourcePosition, + nameIndex: mapping.nameIndex + }; + } + function getDecodedMappings() { + if (decodedMappings === void 0) { + const decoder = decodeMappings(map22.mappings); + const mappings = arrayFrom(decoder, processMapping); + if (decoder.error !== void 0) { + if (host.log) { + host.log(`Encountered error while decoding sourcemap: ${decoder.error}`); + } + decodedMappings = emptyArray; + } else { + decodedMappings = mappings; + } + } + return decodedMappings; + } + function getSourceMappings(sourceIndex) { + if (sourceMappings === void 0) { + const lists = []; + for (const mapping of getDecodedMappings()) { + if (!isSourceMappedPosition(mapping)) + continue; + let list = lists[mapping.sourceIndex]; + if (!list) + lists[mapping.sourceIndex] = list = []; + list.push(mapping); + } + sourceMappings = lists.map((list) => sortAndDeduplicate(list, compareSourcePositions, sameMappedPosition)); + } + return sourceMappings[sourceIndex]; + } + function getGeneratedMappings() { + if (generatedMappings === void 0) { + const list = []; + for (const mapping of getDecodedMappings()) { + list.push(mapping); + } + generatedMappings = sortAndDeduplicate(list, compareGeneratedPositions, sameMappedPosition); + } + return generatedMappings; + } + function getGeneratedPosition(loc) { + const sourceIndex = sourceToSourceIndexMap.get(host.getCanonicalFileName(loc.fileName)); + if (sourceIndex === void 0) + return loc; + const sourceMappings2 = getSourceMappings(sourceIndex); + if (!some2(sourceMappings2)) + return loc; + let targetIndex = binarySearchKey(sourceMappings2, loc.pos, getSourcePositionOfMapping, compareValues); + if (targetIndex < 0) { + targetIndex = ~targetIndex; + } + const mapping = sourceMappings2[targetIndex]; + if (mapping === void 0 || mapping.sourceIndex !== sourceIndex) { + return loc; + } + return { fileName: generatedAbsoluteFilePath, pos: mapping.generatedPosition }; + } + function getSourcePosition(loc) { + const generatedMappings2 = getGeneratedMappings(); + if (!some2(generatedMappings2)) + return loc; + let targetIndex = binarySearchKey(generatedMappings2, loc.pos, getGeneratedPositionOfMapping, compareValues); + if (targetIndex < 0) { + targetIndex = ~targetIndex; + } + const mapping = generatedMappings2[targetIndex]; + if (mapping === void 0 || !isSourceMappedPosition(mapping)) { + return loc; + } + return { fileName: sourceFileAbsolutePaths[mapping.sourceIndex], pos: mapping.sourcePosition }; + } + } + var sourceMapCommentRegExpDontCareLineStart, sourceMapCommentRegExp, whitespaceOrMapCommentRegExp, identitySourceMapConsumer; + var init_sourcemap = __esm2({ + "src/compiler/sourcemap.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + sourceMapCommentRegExpDontCareLineStart = /\/\/[@#] source[M]appingURL=(.+)\r?\n?$/; + sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/; + whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/; + identitySourceMapConsumer = { + getSourcePosition: identity2, + getGeneratedPosition: identity2 + }; + } + }); + function getOriginalNodeId(node) { + node = getOriginalNode(node); + return node ? getNodeId(node) : 0; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!isNamedImports(node)) + return false; + return some2(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e10) { + return e10.propertyName !== void 0 && e10.propertyName.escapedText === "default"; + } + function chainBundle(context2, transformSourceFile) { + return transformSourceFileOrBundle; + function transformSourceFileOrBundle(node) { + return node.kind === 312 ? transformSourceFile(node) : transformBundle(node); + } + function transformBundle(node) { + return context2.factory.createBundle(map4(node.sourceFiles, transformSourceFile), node.prepends); + } + } + function getExportNeedsImportStarHelper(node) { + return !!getNamespaceDeclarationNode(node); + } + function getImportNeedsImportStarHelper(node) { + if (!!getNamespaceDeclarationNode(node)) { + return true; + } + const bindings6 = node.importClause && node.importClause.namedBindings; + if (!bindings6) { + return false; + } + if (!isNamedImports(bindings6)) + return false; + let defaultRefCount = 0; + for (const binding3 of bindings6.elements) { + if (isNamedDefaultReference(binding3)) { + defaultRefCount++; + } + } + return defaultRefCount > 0 && defaultRefCount !== bindings6.elements.length || !!(bindings6.elements.length - defaultRefCount) && isDefaultImport(node); + } + function getImportNeedsImportDefaultHelper(node) { + return !getImportNeedsImportStarHelper(node) && (isDefaultImport(node) || !!node.importClause && isNamedImports(node.importClause.namedBindings) && containsDefaultReference(node.importClause.namedBindings)); + } + function collectExternalModuleInfo(context2, sourceFile) { + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const externalImports = []; + const exportSpecifiers = new IdentifierNameMultiMap(); + const exportedBindings = []; + const uniqueExports = /* @__PURE__ */ new Map(); + let exportedNames; + let hasExportDefault = false; + let exportEquals; + let hasExportStarsToExportValues = false; + let hasImportStar = false; + let hasImportDefault = false; + for (const node of sourceFile.statements) { + switch (node.kind) { + case 272: + externalImports.push(node); + if (!hasImportStar && getImportNeedsImportStarHelper(node)) { + hasImportStar = true; + } + if (!hasImportDefault && getImportNeedsImportDefaultHelper(node)) { + hasImportDefault = true; + } + break; + case 271: + if (node.moduleReference.kind === 283) { + externalImports.push(node); + } + break; + case 278: + if (node.moduleSpecifier) { + if (!node.exportClause) { + externalImports.push(node); + hasExportStarsToExportValues = true; + } else { + externalImports.push(node); + if (isNamedExports(node.exportClause)) { + addExportedNamesForExportDeclaration(node); + } else { + const name2 = node.exportClause.name; + if (!uniqueExports.get(idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(idText(name2), true); + exportedNames = append(exportedNames, name2); + } + hasImportStar = true; + } + } + } else { + addExportedNamesForExportDeclaration(node); + } + break; + case 277: + if (node.isExportEquals && !exportEquals) { + exportEquals = node; + } + break; + case 243: + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + for (const decl of node.declarationList.declarations) { + exportedNames = collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings); + } + } + break; + case 262: + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + if (hasSyntacticModifier( + node, + 2048 + /* Default */ + )) { + if (!hasExportDefault) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context2.factory.getDeclarationName(node)); + hasExportDefault = true; + } + } else { + const name2 = node.name; + if (!uniqueExports.get(idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(idText(name2), true); + exportedNames = append(exportedNames, name2); + } + } + } + break; + case 263: + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + if (hasSyntacticModifier( + node, + 2048 + /* Default */ + )) { + if (!hasExportDefault) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context2.factory.getDeclarationName(node)); + hasExportDefault = true; + } + } else { + const name2 = node.name; + if (name2 && !uniqueExports.get(idText(name2))) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name2); + uniqueExports.set(idText(name2), true); + exportedNames = append(exportedNames, name2); + } + } + } + break; + } + } + const externalHelpersImportDeclaration = createExternalHelpersImportDeclarationIfNeeded(context2.factory, context2.getEmitHelperFactory(), sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault); + if (externalHelpersImportDeclaration) { + externalImports.unshift(externalHelpersImportDeclaration); + } + return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration }; + function addExportedNamesForExportDeclaration(node) { + for (const specifier of cast(node.exportClause, isNamedExports).elements) { + if (!uniqueExports.get(idText(specifier.name))) { + const name2 = specifier.propertyName || specifier.name; + if (!node.moduleSpecifier) { + exportSpecifiers.add(name2, specifier); + } + const decl = resolver.getReferencedImportDeclaration(name2) || resolver.getReferencedValueDeclaration(name2); + if (decl) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name); + } + uniqueExports.set(idText(specifier.name), true); + exportedNames = append(exportedNames, specifier.name); + } + } + } + } + function collectExportedVariableInfo(decl, uniqueExports, exportedNames, exportedBindings) { + if (isBindingPattern(decl.name)) { + for (const element of decl.name.elements) { + if (!isOmittedExpression(element)) { + exportedNames = collectExportedVariableInfo(element, uniqueExports, exportedNames, exportedBindings); + } + } + } else if (!isGeneratedIdentifier(decl.name)) { + const text = idText(decl.name); + if (!uniqueExports.get(text)) { + uniqueExports.set(text, true); + exportedNames = append(exportedNames, decl.name); + if (isLocalName(decl.name)) { + multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), decl.name); + } + } + } + return exportedNames; + } + function multiMapSparseArrayAdd(map22, key, value2) { + let values2 = map22[key]; + if (values2) { + values2.push(value2); + } else { + map22[key] = values2 = [value2]; + } + return values2; + } + function isSimpleCopiableExpression(expression) { + return isStringLiteralLike(expression) || expression.kind === 9 || isKeyword(expression.kind) || isIdentifier(expression); + } + function isSimpleInlineableExpression(expression) { + return !isIdentifier(expression) && isSimpleCopiableExpression(expression); + } + function isCompoundAssignment(kind) { + return kind >= 65 && kind <= 79; + } + function getNonAssignmentOperatorForCompoundAssignment(kind) { + switch (kind) { + case 65: + return 40; + case 66: + return 41; + case 67: + return 42; + case 68: + return 43; + case 69: + return 44; + case 70: + return 45; + case 71: + return 48; + case 72: + return 49; + case 73: + return 50; + case 74: + return 51; + case 75: + return 52; + case 79: + return 53; + case 76: + return 57; + case 77: + return 56; + case 78: + return 61; + } + } + function getSuperCallFromStatement(statement) { + if (!isExpressionStatement(statement)) { + return void 0; + } + const expression = skipParentheses(statement.expression); + return isSuperCall(expression) ? expression : void 0; + } + function findSuperStatementIndexPathWorker(statements, start, indices) { + for (let i7 = start; i7 < statements.length; i7 += 1) { + const statement = statements[i7]; + if (getSuperCallFromStatement(statement)) { + indices.unshift(i7); + return true; + } else if (isTryStatement(statement) && findSuperStatementIndexPathWorker(statement.tryBlock.statements, 0, indices)) { + indices.unshift(i7); + return true; + } + } + return false; + } + function findSuperStatementIndexPath(statements, start) { + const indices = []; + findSuperStatementIndexPathWorker(statements, start, indices); + return indices; + } + function getProperties(node, requireInitializer, isStatic2) { + return filter2(node.members, (m7) => isInitializedOrStaticProperty(m7, requireInitializer, isStatic2)); + } + function isStaticPropertyDeclarationOrClassStaticBlockDeclaration(element) { + return isStaticPropertyDeclaration(element) || isClassStaticBlockDeclaration(element); + } + function getStaticPropertiesAndClassStaticBlock(node) { + return filter2(node.members, isStaticPropertyDeclarationOrClassStaticBlockDeclaration); + } + function isInitializedOrStaticProperty(member, requireInitializer, isStatic2) { + return isPropertyDeclaration(member) && (!!member.initializer || !requireInitializer) && hasStaticModifier(member) === isStatic2; + } + function isStaticPropertyDeclaration(member) { + return isPropertyDeclaration(member) && hasStaticModifier(member); + } + function isInitializedProperty(member) { + return member.kind === 172 && member.initializer !== void 0; + } + function isNonStaticMethodOrAccessorWithPrivateName(member) { + return !isStatic(member) && (isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member)) && isPrivateIdentifier(member.name); + } + function getDecoratorsOfParameters(node) { + let decorators; + if (node) { + const parameters = node.parameters; + const firstParameterIsThis = parameters.length > 0 && parameterIsThisKeyword(parameters[0]); + const firstParameterOffset = firstParameterIsThis ? 1 : 0; + const numParameters = firstParameterIsThis ? parameters.length - 1 : parameters.length; + for (let i7 = 0; i7 < numParameters; i7++) { + const parameter = parameters[i7 + firstParameterOffset]; + if (decorators || hasDecorators(parameter)) { + if (!decorators) { + decorators = new Array(numParameters); + } + decorators[i7] = getDecorators(parameter); + } + } + } + return decorators; + } + function getAllDecoratorsOfClass(node) { + const decorators = getDecorators(node); + const parameters = getDecoratorsOfParameters(getFirstConstructorWithBody(node)); + if (!some2(decorators) && !some2(parameters)) { + return void 0; + } + return { + decorators, + parameters + }; + } + function getAllDecoratorsOfClassElement(member, parent22, useLegacyDecorators) { + switch (member.kind) { + case 177: + case 178: + if (!useLegacyDecorators) { + return getAllDecoratorsOfMethod(member); + } + return getAllDecoratorsOfAccessors(member, parent22); + case 174: + return getAllDecoratorsOfMethod(member); + case 172: + return getAllDecoratorsOfProperty(member); + default: + return void 0; + } + } + function getAllDecoratorsOfAccessors(accessor, parent22) { + if (!accessor.body) { + return void 0; + } + const { firstAccessor, secondAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(parent22.members, accessor); + const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0; + if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) { + return void 0; + } + const decorators = getDecorators(firstAccessorWithDecorators); + const parameters = getDecoratorsOfParameters(setAccessor); + if (!some2(decorators) && !some2(parameters)) { + return void 0; + } + return { + decorators, + parameters, + getDecorators: getAccessor && getDecorators(getAccessor), + setDecorators: setAccessor && getDecorators(setAccessor) + }; + } + function getAllDecoratorsOfMethod(method2) { + if (!method2.body) { + return void 0; + } + const decorators = getDecorators(method2); + const parameters = getDecoratorsOfParameters(method2); + if (!some2(decorators) && !some2(parameters)) { + return void 0; + } + return { decorators, parameters }; + } + function getAllDecoratorsOfProperty(property2) { + const decorators = getDecorators(property2); + if (!some2(decorators)) { + return void 0; + } + return { decorators }; + } + function walkUpLexicalEnvironments(env3, cb) { + while (env3) { + const result2 = cb(env3); + if (result2 !== void 0) + return result2; + env3 = env3.previous; + } + } + function newPrivateEnvironment(data) { + return { data }; + } + function getPrivateIdentifier(privateEnv, name2) { + var _a2, _b; + return isGeneratedPrivateIdentifier(name2) ? (_a2 = privateEnv == null ? void 0 : privateEnv.generatedIdentifiers) == null ? void 0 : _a2.get(getNodeForGeneratedName(name2)) : (_b = privateEnv == null ? void 0 : privateEnv.identifiers) == null ? void 0 : _b.get(name2.escapedText); + } + function setPrivateIdentifier(privateEnv, name2, entry) { + if (isGeneratedPrivateIdentifier(name2)) { + privateEnv.generatedIdentifiers ?? (privateEnv.generatedIdentifiers = /* @__PURE__ */ new Map()); + privateEnv.generatedIdentifiers.set(getNodeForGeneratedName(name2), entry); + } else { + privateEnv.identifiers ?? (privateEnv.identifiers = /* @__PURE__ */ new Map()); + privateEnv.identifiers.set(name2.escapedText, entry); + } + } + function accessPrivateIdentifier(env3, name2) { + return walkUpLexicalEnvironments(env3, (env22) => getPrivateIdentifier(env22.privateEnv, name2)); + } + function isSimpleParameter(node) { + return !node.initializer && isIdentifier(node.name); + } + function isSimpleParameterList(nodes) { + return every2(nodes, isSimpleParameter); + } + var IdentifierNameMap, IdentifierNameMultiMap; + var init_utilities3 = __esm2({ + "src/compiler/transformers/utilities.ts"() { + "use strict"; + init_ts2(); + IdentifierNameMap = class _IdentifierNameMap { + constructor() { + this._map = /* @__PURE__ */ new Map(); + } + get size() { + return this._map.size; + } + has(key) { + return this._map.has(_IdentifierNameMap.toKey(key)); + } + get(key) { + return this._map.get(_IdentifierNameMap.toKey(key)); + } + set(key, value2) { + this._map.set(_IdentifierNameMap.toKey(key), value2); + return this; + } + delete(key) { + var _a2; + return ((_a2 = this._map) == null ? void 0 : _a2.delete(_IdentifierNameMap.toKey(key))) ?? false; + } + clear() { + this._map.clear(); + } + values() { + return this._map.values(); + } + static toKey(name2) { + if (isGeneratedPrivateIdentifier(name2) || isGeneratedIdentifier(name2)) { + const autoGenerate = name2.emitNode.autoGenerate; + if ((autoGenerate.flags & 7) === 4) { + const node = getNodeForGeneratedName(name2); + const baseName = isMemberName(node) && node !== name2 ? _IdentifierNameMap.toKey(node) : `(generated@${getNodeId(node)})`; + return formatGeneratedName( + /*privateName*/ + false, + autoGenerate.prefix, + baseName, + autoGenerate.suffix, + _IdentifierNameMap.toKey + ); + } else { + const baseName = `(auto@${autoGenerate.id})`; + return formatGeneratedName( + /*privateName*/ + false, + autoGenerate.prefix, + baseName, + autoGenerate.suffix, + _IdentifierNameMap.toKey + ); + } + } + if (isPrivateIdentifier(name2)) { + return idText(name2).slice(1); + } + return idText(name2); + } + }; + IdentifierNameMultiMap = class extends IdentifierNameMap { + add(key, value2) { + let values2 = this.get(key); + if (values2) { + values2.push(value2); + } else { + this.set(key, values2 = [value2]); + } + return values2; + } + remove(key, value2) { + const values2 = this.get(key); + if (values2) { + unorderedRemoveItem(values2, value2); + if (!values2.length) { + this.delete(key); + } + } + } + }; + } + }); + function flattenDestructuringAssignment(node, visitor, context2, level, needsValue, createAssignmentCallback) { + let location2 = node; + let value2; + if (isDestructuringAssignment(node)) { + value2 = node.right; + while (isEmptyArrayLiteral(node.left) || isEmptyObjectLiteral(node.left)) { + if (isDestructuringAssignment(value2)) { + location2 = node = value2; + value2 = node.right; + } else { + return Debug.checkDefined(visitNode(value2, visitor, isExpression)); + } + } + } + let expressions; + const flattenContext = { + context: context2, + level, + downlevelIteration: !!context2.getCompilerOptions().downlevelIteration, + hoistTempVariables: true, + emitExpression, + emitBindingOrAssignment, + createArrayBindingOrAssignmentPattern: (elements) => makeArrayAssignmentPattern(context2.factory, elements), + createObjectBindingOrAssignmentPattern: (elements) => makeObjectAssignmentPattern(context2.factory, elements), + createArrayBindingOrAssignmentElement: makeAssignmentElement, + visitor + }; + if (value2) { + value2 = visitNode(value2, visitor, isExpression); + Debug.assert(value2); + if (isIdentifier(value2) && bindingOrAssignmentElementAssignsToName(node, value2.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node)) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + false, + location2 + ); + } else if (needsValue) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + } else if (nodeIsSynthesized(node)) { + location2 = value2; + } + } + flattenBindingOrAssignmentElement( + flattenContext, + node, + value2, + location2, + /*skipInitializer*/ + isDestructuringAssignment(node) + ); + if (value2 && needsValue) { + if (!some2(expressions)) { + return value2; + } + expressions.push(value2); + } + return context2.factory.inlineExpressions(expressions) || context2.factory.createOmittedExpression(); + function emitExpression(expression) { + expressions = append(expressions, expression); + } + function emitBindingOrAssignment(target, value22, location22, original) { + Debug.assertNode(target, createAssignmentCallback ? isIdentifier : isExpression); + const expression = createAssignmentCallback ? createAssignmentCallback(target, value22, location22) : setTextRange( + context2.factory.createAssignment(Debug.checkDefined(visitNode(target, visitor, isExpression)), value22), + location22 + ); + expression.original = original; + emitExpression(expression); + } + } + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } else if (isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern5, escapedName) { + const elements = getElementsOfBindingOrAssignmentPattern(pattern5); + for (const element of elements) { + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } + function bindingOrAssignmentElementContainsNonLiteralComputedName(element) { + const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(element); + if (propertyName && isComputedPropertyName(propertyName) && !isLiteralExpression(propertyName.expression)) { + return true; + } + const target = getTargetOfBindingOrAssignmentElement(element); + return !!target && isBindingOrAssignmentPattern(target) && bindingOrAssignmentPatternContainsNonLiteralComputedName(target); + } + function bindingOrAssignmentPatternContainsNonLiteralComputedName(pattern5) { + return !!forEach4(getElementsOfBindingOrAssignmentPattern(pattern5), bindingOrAssignmentElementContainsNonLiteralComputedName); + } + function flattenDestructuringBinding(node, visitor, context2, level, rval, hoistTempVariables = false, skipInitializer) { + let pendingExpressions; + const pendingDeclarations = []; + const declarations = []; + const flattenContext = { + context: context2, + level, + downlevelIteration: !!context2.getCompilerOptions().downlevelIteration, + hoistTempVariables, + emitExpression, + emitBindingOrAssignment, + createArrayBindingOrAssignmentPattern: (elements) => makeArrayBindingPattern(context2.factory, elements), + createObjectBindingOrAssignmentPattern: (elements) => makeObjectBindingPattern(context2.factory, elements), + createArrayBindingOrAssignmentElement: (name2) => makeBindingElement(context2.factory, name2), + visitor + }; + if (isVariableDeclaration(node)) { + let initializer = getInitializerOfBindingOrAssignmentElement(node); + if (initializer && (isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText) || bindingOrAssignmentElementContainsNonLiteralComputedName(node))) { + initializer = ensureIdentifier( + flattenContext, + Debug.checkDefined(visitNode(initializer, flattenContext.visitor, isExpression)), + /*reuseIdentifierExpressions*/ + false, + initializer + ); + node = context2.factory.updateVariableDeclaration( + node, + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ); + } + } + flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); + if (pendingExpressions) { + const temp = context2.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (hoistTempVariables) { + const value2 = context2.factory.inlineExpressions(pendingExpressions); + pendingExpressions = void 0; + emitBindingOrAssignment( + temp, + value2, + /*location*/ + void 0, + /*original*/ + void 0 + ); + } else { + context2.hoistVariableDeclaration(temp); + const pendingDeclaration = last2(pendingDeclarations); + pendingDeclaration.pendingExpressions = append( + pendingDeclaration.pendingExpressions, + context2.factory.createAssignment(temp, pendingDeclaration.value) + ); + addRange(pendingDeclaration.pendingExpressions, pendingExpressions); + pendingDeclaration.value = temp; + } + } + for (const { pendingExpressions: pendingExpressions2, name: name2, value: value2, location: location2, original } of pendingDeclarations) { + const variable = context2.factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + pendingExpressions2 ? context2.factory.inlineExpressions(append(pendingExpressions2, value2)) : value2 + ); + variable.original = original; + setTextRange(variable, location2); + declarations.push(variable); + } + return declarations; + function emitExpression(value2) { + pendingExpressions = append(pendingExpressions, value2); + } + function emitBindingOrAssignment(target, value2, location2, original) { + Debug.assertNode(target, isBindingName); + if (pendingExpressions) { + value2 = context2.factory.inlineExpressions(append(pendingExpressions, value2)); + pendingExpressions = void 0; + } + pendingDeclarations.push({ pendingExpressions, name: target, value: value2, location: location2, original }); + } + } + function flattenBindingOrAssignmentElement(flattenContext, element, value2, location2, skipInitializer) { + const bindingTarget = getTargetOfBindingOrAssignmentElement(element); + if (!skipInitializer) { + const initializer = visitNode(getInitializerOfBindingOrAssignmentElement(element), flattenContext.visitor, isExpression); + if (initializer) { + if (value2) { + value2 = createDefaultValueCheck(flattenContext, value2, initializer, location2); + if (!isSimpleInlineableExpression(initializer) && isBindingOrAssignmentPattern(bindingTarget)) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + } + } else { + value2 = initializer; + } + } else if (!value2) { + value2 = flattenContext.context.factory.createVoidZero(); + } + } + if (isObjectBindingOrAssignmentPattern(bindingTarget)) { + flattenObjectBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value2, location2); + } else if (isArrayBindingOrAssignmentPattern(bindingTarget)) { + flattenArrayBindingOrAssignmentPattern(flattenContext, element, bindingTarget, value2, location2); + } else { + flattenContext.emitBindingOrAssignment( + bindingTarget, + value2, + location2, + /*original*/ + element + ); + } + } + function flattenObjectBindingOrAssignmentPattern(flattenContext, parent22, pattern5, value2, location2) { + const elements = getElementsOfBindingOrAssignmentPattern(pattern5); + const numElements = elements.length; + if (numElements !== 1) { + const reuseIdentifierExpressions = !isDeclarationBindingElement(parent22) || numElements !== 0; + value2 = ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2); + } + let bindingElements; + let computedTempVariables; + for (let i7 = 0; i7 < numElements; i7++) { + const element = elements[i7]; + if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { + const propertyName = getPropertyNameOfBindingOrAssignmentElement(element); + if (flattenContext.level >= 1 && !(element.transformFlags & (32768 | 65536)) && !(getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 | 65536)) && !isComputedPropertyName(propertyName)) { + bindingElements = append(bindingElements, visitNode(element, flattenContext.visitor, isBindingOrAssignmentElement)); + } else { + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + bindingElements = void 0; + } + const rhsValue = createDestructuringPropertyAccess(flattenContext, value2, propertyName); + if (isComputedPropertyName(propertyName)) { + computedTempVariables = append(computedTempVariables, rhsValue.argumentExpression); + } + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } + } else if (i7 === numElements - 1) { + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + bindingElements = void 0; + } + const rhsValue = flattenContext.context.getEmitHelperFactory().createRestHelper(value2, elements, computedTempVariables, pattern5); + flattenBindingOrAssignmentElement(flattenContext, element, rhsValue, element); + } + } + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createObjectBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + } + } + function flattenArrayBindingOrAssignmentPattern(flattenContext, parent22, pattern5, value2, location2) { + const elements = getElementsOfBindingOrAssignmentPattern(pattern5); + const numElements = elements.length; + if (flattenContext.level < 1 && flattenContext.downlevelIteration) { + value2 = ensureIdentifier( + flattenContext, + setTextRange( + flattenContext.context.getEmitHelperFactory().createReadHelper( + value2, + numElements > 0 && getRestIndicatorOfBindingOrAssignmentElement(elements[numElements - 1]) ? void 0 : numElements + ), + location2 + ), + /*reuseIdentifierExpressions*/ + false, + location2 + ); + } else if (numElements !== 1 && (flattenContext.level < 1 || numElements === 0) || every2(elements, isOmittedExpression)) { + const reuseIdentifierExpressions = !isDeclarationBindingElement(parent22) || numElements !== 0; + value2 = ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2); + } + let bindingElements; + let restContainingElements; + for (let i7 = 0; i7 < numElements; i7++) { + const element = elements[i7]; + if (flattenContext.level >= 1) { + if (element.transformFlags & 65536 || flattenContext.hasTransformedPriorElement && !isSimpleBindingOrAssignmentElement(element)) { + flattenContext.hasTransformedPriorElement = true; + const temp = flattenContext.context.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (flattenContext.hoistTempVariables) { + flattenContext.context.hoistVariableDeclaration(temp); + } + restContainingElements = append(restContainingElements, [temp, element]); + bindingElements = append(bindingElements, flattenContext.createArrayBindingOrAssignmentElement(temp)); + } else { + bindingElements = append(bindingElements, element); + } + } else if (isOmittedExpression(element)) { + continue; + } else if (!getRestIndicatorOfBindingOrAssignmentElement(element)) { + const rhsValue = flattenContext.context.factory.createElementAccessExpression(value2, i7); + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } else if (i7 === numElements - 1) { + const rhsValue = flattenContext.context.factory.createArraySliceCall(value2, i7); + flattenBindingOrAssignmentElement( + flattenContext, + element, + rhsValue, + /*location*/ + element + ); + } + } + if (bindingElements) { + flattenContext.emitBindingOrAssignment(flattenContext.createArrayBindingOrAssignmentPattern(bindingElements), value2, location2, pattern5); + } + if (restContainingElements) { + for (const [id, element] of restContainingElements) { + flattenBindingOrAssignmentElement(flattenContext, element, id, element); + } + } + } + function isSimpleBindingOrAssignmentElement(element) { + const target = getTargetOfBindingOrAssignmentElement(element); + if (!target || isOmittedExpression(target)) + return true; + const propertyName = tryGetPropertyNameOfBindingOrAssignmentElement(element); + if (propertyName && !isPropertyNameLiteral(propertyName)) + return false; + const initializer = getInitializerOfBindingOrAssignmentElement(element); + if (initializer && !isSimpleInlineableExpression(initializer)) + return false; + if (isBindingOrAssignmentPattern(target)) + return every2(getElementsOfBindingOrAssignmentPattern(target), isSimpleBindingOrAssignmentElement); + return isIdentifier(target); + } + function createDefaultValueCheck(flattenContext, value2, defaultValue, location2) { + value2 = ensureIdentifier( + flattenContext, + value2, + /*reuseIdentifierExpressions*/ + true, + location2 + ); + return flattenContext.context.factory.createConditionalExpression( + flattenContext.context.factory.createTypeCheck(value2, "undefined"), + /*questionToken*/ + void 0, + defaultValue, + /*colonToken*/ + void 0, + value2 + ); + } + function createDestructuringPropertyAccess(flattenContext, value2, propertyName) { + const { factory: factory2 } = flattenContext.context; + if (isComputedPropertyName(propertyName)) { + const argumentExpression = ensureIdentifier( + flattenContext, + Debug.checkDefined(visitNode(propertyName.expression, flattenContext.visitor, isExpression)), + /*reuseIdentifierExpressions*/ + false, + /*location*/ + propertyName + ); + return flattenContext.context.factory.createElementAccessExpression(value2, argumentExpression); + } else if (isStringOrNumericLiteralLike(propertyName)) { + const argumentExpression = factory2.cloneNode(propertyName); + return flattenContext.context.factory.createElementAccessExpression(value2, argumentExpression); + } else { + const name2 = flattenContext.context.factory.createIdentifier(idText(propertyName)); + return flattenContext.context.factory.createPropertyAccessExpression(value2, name2); + } + } + function ensureIdentifier(flattenContext, value2, reuseIdentifierExpressions, location2) { + if (isIdentifier(value2) && reuseIdentifierExpressions) { + return value2; + } else { + const temp = flattenContext.context.factory.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + if (flattenContext.hoistTempVariables) { + flattenContext.context.hoistVariableDeclaration(temp); + flattenContext.emitExpression(setTextRange(flattenContext.context.factory.createAssignment(temp, value2), location2)); + } else { + flattenContext.emitBindingOrAssignment( + temp, + value2, + location2, + /*original*/ + void 0 + ); + } + return temp; + } + } + function makeArrayBindingPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingElement); + return factory2.createArrayBindingPattern(elements); + } + function makeArrayAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isArrayBindingOrAssignmentElement); + return factory2.createArrayLiteralExpression(map4(elements, factory2.converters.convertToArrayAssignmentElement)); + } + function makeObjectBindingPattern(factory2, elements) { + Debug.assertEachNode(elements, isBindingElement); + return factory2.createObjectBindingPattern(elements); + } + function makeObjectAssignmentPattern(factory2, elements) { + Debug.assertEachNode(elements, isObjectBindingOrAssignmentElement); + return factory2.createObjectLiteralExpression(map4(elements, factory2.converters.convertToObjectAssignmentElement)); + } + function makeBindingElement(factory2, name2) { + return factory2.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + name2 + ); + } + function makeAssignmentElement(name2) { + return name2; + } + var FlattenLevel; + var init_destructuring = __esm2({ + "src/compiler/transformers/destructuring.ts"() { + "use strict"; + init_ts2(); + FlattenLevel = /* @__PURE__ */ ((FlattenLevel2) => { + FlattenLevel2[FlattenLevel2["All"] = 0] = "All"; + FlattenLevel2[FlattenLevel2["ObjectRest"] = 1] = "ObjectRest"; + return FlattenLevel2; + })(FlattenLevel || {}); + } + }); + function createClassThisAssignmentBlock(factory2, classThis, thisExpression = factory2.createThis()) { + const expression = factory2.createAssignment(classThis, thisExpression); + const statement = factory2.createExpressionStatement(expression); + const body = factory2.createBlock( + [statement], + /*multiLine*/ + false + ); + const block = factory2.createClassStaticBlockDeclaration(body); + getOrCreateEmitNode(block).classThis = classThis; + return block; + } + function isClassThisAssignmentBlock(node) { + var _a2; + if (!isClassStaticBlockDeclaration(node) || node.body.statements.length !== 1) { + return false; + } + const statement = node.body.statements[0]; + return isExpressionStatement(statement) && isAssignmentExpression( + statement.expression, + /*excludeCompoundAssignment*/ + true + ) && isIdentifier(statement.expression.left) && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) === statement.expression.left && statement.expression.right.kind === 110; + } + function classHasClassThisAssignment(node) { + var _a2; + return !!((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) && some2(node.members, isClassThisAssignmentBlock); + } + function injectClassThisAssignmentIfMissing(factory2, node, classThis, thisExpression) { + if (classHasClassThisAssignment(node)) { + return node; + } + const staticBlock = createClassThisAssignmentBlock(factory2, classThis, thisExpression); + if (node.name) { + setSourceMapRange(staticBlock.body.statements[0], node.name); + } + const members = factory2.createNodeArray([staticBlock, ...node.members]); + setTextRange(members, node.members); + const updatedNode = isClassDeclaration(node) ? factory2.updateClassDeclaration( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ) : factory2.updateClassExpression( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ); + getOrCreateEmitNode(updatedNode).classThis = classThis; + return updatedNode; + } + var init_classThis = __esm2({ + "src/compiler/transformers/classThis.ts"() { + "use strict"; + init_ts2(); + } + }); + function getAssignedNameOfIdentifier(factory2, name2, expression) { + const original = getOriginalNode(skipOuterExpressions(expression)); + if ((isClassDeclaration(original) || isFunctionDeclaration(original)) && !original.name && hasSyntacticModifier( + original, + 2048 + /* Default */ + )) { + return factory2.createStringLiteral("default"); + } + return factory2.createStringLiteralFromNode(name2); + } + function getAssignedNameOfPropertyName(context2, name2, assignedNameText) { + const { factory: factory2 } = context2; + if (assignedNameText !== void 0) { + const assignedName2 = factory2.createStringLiteral(assignedNameText); + return { assignedName: assignedName2, name: name2 }; + } + if (isPropertyNameLiteral(name2) || isPrivateIdentifier(name2)) { + const assignedName2 = factory2.createStringLiteralFromNode(name2); + return { assignedName: assignedName2, name: name2 }; + } + if (isPropertyNameLiteral(name2.expression) && !isIdentifier(name2.expression)) { + const assignedName2 = factory2.createStringLiteralFromNode(name2.expression); + return { assignedName: assignedName2, name: name2 }; + } + const assignedName = factory2.getGeneratedNameForNode(name2); + context2.hoistVariableDeclaration(assignedName); + const key = context2.getEmitHelperFactory().createPropKeyHelper(name2.expression); + const assignment = factory2.createAssignment(assignedName, key); + const updatedName = factory2.updateComputedPropertyName(name2, assignment); + return { assignedName, name: updatedName }; + } + function createClassNamedEvaluationHelperBlock(context2, assignedName, thisExpression = context2.factory.createThis()) { + const { factory: factory2 } = context2; + const expression = context2.getEmitHelperFactory().createSetFunctionNameHelper(thisExpression, assignedName); + const statement = factory2.createExpressionStatement(expression); + const body = factory2.createBlock( + [statement], + /*multiLine*/ + false + ); + const block = factory2.createClassStaticBlockDeclaration(body); + getOrCreateEmitNode(block).assignedName = assignedName; + return block; + } + function isClassNamedEvaluationHelperBlock(node) { + var _a2; + if (!isClassStaticBlockDeclaration(node) || node.body.statements.length !== 1) { + return false; + } + const statement = node.body.statements[0]; + return isExpressionStatement(statement) && isCallToHelper(statement.expression, "___setFunctionName") && statement.expression.arguments.length >= 2 && statement.expression.arguments[1] === ((_a2 = node.emitNode) == null ? void 0 : _a2.assignedName); + } + function classHasExplicitlyAssignedName(node) { + var _a2; + return !!((_a2 = node.emitNode) == null ? void 0 : _a2.assignedName) && some2(node.members, isClassNamedEvaluationHelperBlock); + } + function classHasDeclaredOrExplicitlyAssignedName(node) { + return !!node.name || classHasExplicitlyAssignedName(node); + } + function injectClassNamedEvaluationHelperBlockIfMissing(context2, node, assignedName, thisExpression) { + if (classHasExplicitlyAssignedName(node)) { + return node; + } + const { factory: factory2 } = context2; + const namedEvaluationBlock = createClassNamedEvaluationHelperBlock(context2, assignedName, thisExpression); + if (node.name) { + setSourceMapRange(namedEvaluationBlock.body.statements[0], node.name); + } + const insertionIndex = findIndex2(node.members, isClassThisAssignmentBlock) + 1; + const leading = node.members.slice(0, insertionIndex); + const trailing = node.members.slice(insertionIndex); + const members = factory2.createNodeArray([...leading, namedEvaluationBlock, ...trailing]); + setTextRange(members, node.members); + node = isClassDeclaration(node) ? factory2.updateClassDeclaration( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ) : factory2.updateClassExpression( + node, + node.modifiers, + node.name, + node.typeParameters, + node.heritageClauses, + members + ); + getOrCreateEmitNode(node).assignedName = assignedName; + return node; + } + function finishTransformNamedEvaluation(context2, expression, assignedName, ignoreEmptyStringLiteral) { + if (ignoreEmptyStringLiteral && isStringLiteral(assignedName) && isEmptyStringLiteral(assignedName)) { + return expression; + } + const { factory: factory2 } = context2; + const innerExpression = skipOuterExpressions(expression); + const updatedExpression = isClassExpression(innerExpression) ? cast(injectClassNamedEvaluationHelperBlockIfMissing(context2, innerExpression, assignedName), isClassExpression) : context2.getEmitHelperFactory().createSetFunctionNameHelper(innerExpression, assignedName); + return factory2.restoreOuterExpressions(expression, updatedExpression); + } + function transformNamedEvaluationOfPropertyAssignment(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const { assignedName, name: name2 } = getAssignedNameOfPropertyName(context2, node.name, assignedNameText); + const initializer = finishTransformNamedEvaluation(context2, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updatePropertyAssignment( + node, + name2, + initializer + ); + } + function transformNamedEvaluationOfShorthandAssignmentProperty(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.objectAssignmentInitializer); + const objectAssignmentInitializer = finishTransformNamedEvaluation(context2, node.objectAssignmentInitializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateShorthandPropertyAssignment( + node, + node.name, + objectAssignmentInitializer + ); + } + function transformNamedEvaluationOfVariableDeclaration(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context2, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateVariableDeclaration( + node, + node.name, + node.exclamationToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfParameterDeclaration(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context2, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateParameterDeclaration( + node, + node.modifiers, + node.dotDotDotToken, + node.name, + node.questionToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfBindingElement(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.name, node.initializer); + const initializer = finishTransformNamedEvaluation(context2, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updateBindingElement( + node, + node.dotDotDotToken, + node.propertyName, + node.name, + initializer + ); + } + function transformNamedEvaluationOfPropertyDeclaration(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const { assignedName, name: name2 } = getAssignedNameOfPropertyName(context2, node.name, assignedNameText); + const initializer = finishTransformNamedEvaluation(context2, node.initializer, assignedName, ignoreEmptyStringLiteral); + return factory2.updatePropertyDeclaration( + node, + node.modifiers, + name2, + node.questionToken ?? node.exclamationToken, + node.type, + initializer + ); + } + function transformNamedEvaluationOfAssignmentExpression(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : getAssignedNameOfIdentifier(factory2, node.left, node.right); + const right = finishTransformNamedEvaluation(context2, node.right, assignedName, ignoreEmptyStringLiteral); + return factory2.updateBinaryExpression( + node, + node.left, + node.operatorToken, + right + ); + } + function transformNamedEvaluationOfExportAssignment(context2, node, ignoreEmptyStringLiteral, assignedNameText) { + const { factory: factory2 } = context2; + const assignedName = assignedNameText !== void 0 ? factory2.createStringLiteral(assignedNameText) : factory2.createStringLiteral(node.isExportEquals ? "" : "default"); + const expression = finishTransformNamedEvaluation(context2, node.expression, assignedName, ignoreEmptyStringLiteral); + return factory2.updateExportAssignment( + node, + node.modifiers, + expression + ); + } + function transformNamedEvaluation(context2, node, ignoreEmptyStringLiteral, assignedName) { + switch (node.kind) { + case 303: + return transformNamedEvaluationOfPropertyAssignment(context2, node, ignoreEmptyStringLiteral, assignedName); + case 304: + return transformNamedEvaluationOfShorthandAssignmentProperty(context2, node, ignoreEmptyStringLiteral, assignedName); + case 260: + return transformNamedEvaluationOfVariableDeclaration(context2, node, ignoreEmptyStringLiteral, assignedName); + case 169: + return transformNamedEvaluationOfParameterDeclaration(context2, node, ignoreEmptyStringLiteral, assignedName); + case 208: + return transformNamedEvaluationOfBindingElement(context2, node, ignoreEmptyStringLiteral, assignedName); + case 172: + return transformNamedEvaluationOfPropertyDeclaration(context2, node, ignoreEmptyStringLiteral, assignedName); + case 226: + return transformNamedEvaluationOfAssignmentExpression(context2, node, ignoreEmptyStringLiteral, assignedName); + case 277: + return transformNamedEvaluationOfExportAssignment(context2, node, ignoreEmptyStringLiteral, assignedName); + } + } + var init_namedEvaluation = __esm2({ + "src/compiler/transformers/namedEvaluation.ts"() { + "use strict"; + init_ts2(); + } + }); + function processTaggedTemplateExpression(context2, node, visitor, currentSourceFile, recordTaggedTemplateString, level) { + const tag = visitNode(node.tag, visitor, isExpression); + Debug.assert(tag); + const templateArguments = [void 0]; + const cookedStrings = []; + const rawStrings = []; + const template2 = node.template; + if (level === 0 && !hasInvalidEscape(template2)) { + return visitEachChild(node, visitor, context2); + } + const { factory: factory2 } = context2; + if (isNoSubstitutionTemplateLiteral(template2)) { + cookedStrings.push(createTemplateCooked(factory2, template2)); + rawStrings.push(getRawLiteral(factory2, template2, currentSourceFile)); + } else { + cookedStrings.push(createTemplateCooked(factory2, template2.head)); + rawStrings.push(getRawLiteral(factory2, template2.head, currentSourceFile)); + for (const templateSpan of template2.templateSpans) { + cookedStrings.push(createTemplateCooked(factory2, templateSpan.literal)); + rawStrings.push(getRawLiteral(factory2, templateSpan.literal, currentSourceFile)); + templateArguments.push(Debug.checkDefined(visitNode(templateSpan.expression, visitor, isExpression))); + } + } + const helperCall = context2.getEmitHelperFactory().createTemplateObjectHelper( + factory2.createArrayLiteralExpression(cookedStrings), + factory2.createArrayLiteralExpression(rawStrings) + ); + if (isExternalModule(currentSourceFile)) { + const tempVar = factory2.createUniqueName("templateObject"); + recordTaggedTemplateString(tempVar); + templateArguments[0] = factory2.createLogicalOr( + tempVar, + factory2.createAssignment( + tempVar, + helperCall + ) + ); + } else { + templateArguments[0] = helperCall; + } + return factory2.createCallExpression( + tag, + /*typeArguments*/ + void 0, + templateArguments + ); + } + function createTemplateCooked(factory2, template2) { + return template2.templateFlags & 26656 ? factory2.createVoidZero() : factory2.createStringLiteral(template2.text); + } + function getRawLiteral(factory2, node, currentSourceFile) { + let text = node.rawText; + if (text === void 0) { + Debug.assertIsDefined(currentSourceFile, "Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."); + text = getSourceTextOfNodeFromSourceFile(currentSourceFile, node); + const isLast = node.kind === 15 || node.kind === 18; + text = text.substring(1, text.length - (isLast ? 1 : 2)); + } + text = text.replace(/\r\n?/g, "\n"); + return setTextRange(factory2.createStringLiteral(text), node); + } + var ProcessLevel; + var init_taggedTemplate = __esm2({ + "src/compiler/transformers/taggedTemplate.ts"() { + "use strict"; + init_ts2(); + ProcessLevel = /* @__PURE__ */ ((ProcessLevel2) => { + ProcessLevel2[ProcessLevel2["LiftRestriction"] = 0] = "LiftRestriction"; + ProcessLevel2[ProcessLevel2["All"] = 1] = "All"; + return ProcessLevel2; + })(ProcessLevel || {}); + } + }); + function transformTypeScript(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + resumeLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const moduleKind = getEmitModuleKind(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; + const typeSerializer = compilerOptions.emitDecoratorMetadata ? createRuntimeTypeSerializer(context2) : void 0; + const previousOnEmitNode = context2.onEmitNode; + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableSubstitution( + 211 + /* PropertyAccessExpression */ + ); + context2.enableSubstitution( + 212 + /* ElementAccessExpression */ + ); + let currentSourceFile; + let currentNamespace; + let currentNamespaceContainerName; + let currentLexicalScope; + let currentScopeFirstDeclarationsOfName; + let currentClassHasParameterProperties; + let enabledSubstitutions; + let applicableSubstitutions; + return transformSourceFileOrBundle; + function transformSourceFileOrBundle(node) { + if (node.kind === 313) { + return transformBundle(node); + } + return transformSourceFile(node); + } + function transformBundle(node) { + return factory2.createBundle( + node.sourceFiles.map(transformSourceFile), + mapDefined(node.prepends, (prepend) => { + if (prepend.kind === 315) { + return createUnparsedSourceFile(prepend, "js"); + } + return prepend; + }) + ); + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + const visited = saveStateAndInvoke(node, visitSourceFile); + addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + return visited; + } + function saveStateAndInvoke(node, f8) { + const savedCurrentScope = currentLexicalScope; + const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; + const savedCurrentClassHasParameterProperties = currentClassHasParameterProperties; + onBeforeVisitNode(node); + const visited = f8(node); + if (currentLexicalScope !== savedCurrentScope) { + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + } + currentLexicalScope = savedCurrentScope; + currentClassHasParameterProperties = savedCurrentClassHasParameterProperties; + return visited; + } + function onBeforeVisitNode(node) { + switch (node.kind) { + case 312: + case 269: + case 268: + case 241: + currentLexicalScope = node; + currentScopeFirstDeclarationsOfName = void 0; + break; + case 263: + case 262: + if (hasSyntacticModifier( + node, + 128 + /* Ambient */ + )) { + break; + } + if (node.name) { + recordEmittedDeclarationInScope(node); + } else { + Debug.assert(node.kind === 263 || hasSyntacticModifier( + node, + 2048 + /* Default */ + )); + } + break; + } + } + function visitor(node) { + return saveStateAndInvoke(node, visitorWorker); + } + function visitorWorker(node) { + if (node.transformFlags & 1) { + return visitTypeScript(node); + } + return node; + } + function sourceElementVisitor(node) { + return saveStateAndInvoke(node, sourceElementVisitorWorker); + } + function sourceElementVisitorWorker(node) { + switch (node.kind) { + case 272: + case 271: + case 277: + case 278: + return visitElidableStatement(node); + default: + return visitorWorker(node); + } + } + function isElisionBlocked(node) { + const parsed = getParseTreeNode(node); + if (parsed === node || isExportAssignment(node)) { + return false; + } + if (!parsed || parsed.kind !== node.kind) { + return true; + } + switch (node.kind) { + case 272: + Debug.assertNode(parsed, isImportDeclaration); + if (node.importClause !== parsed.importClause) { + return true; + } + if (node.attributes !== parsed.attributes) { + return true; + } + break; + case 271: + Debug.assertNode(parsed, isImportEqualsDeclaration); + if (node.name !== parsed.name) { + return true; + } + if (node.isTypeOnly !== parsed.isTypeOnly) { + return true; + } + if (node.moduleReference !== parsed.moduleReference && (isEntityName(node.moduleReference) || isEntityName(parsed.moduleReference))) { + return true; + } + break; + case 278: + Debug.assertNode(parsed, isExportDeclaration); + if (node.exportClause !== parsed.exportClause) { + return true; + } + if (node.attributes !== parsed.attributes) { + return true; + } + break; + } + return false; + } + function visitElidableStatement(node) { + if (isElisionBlocked(node)) { + if (node.transformFlags & 1) { + return visitEachChild(node, visitor, context2); + } + return node; + } + switch (node.kind) { + case 272: + return visitImportDeclaration(node); + case 271: + return visitImportEqualsDeclaration(node); + case 277: + return visitExportAssignment(node); + case 278: + return visitExportDeclaration(node); + default: + Debug.fail("Unhandled ellided statement"); + } + } + function namespaceElementVisitor(node) { + return saveStateAndInvoke(node, namespaceElementVisitorWorker); + } + function namespaceElementVisitorWorker(node) { + if (node.kind === 278 || node.kind === 272 || node.kind === 273 || node.kind === 271 && node.moduleReference.kind === 283) { + return void 0; + } else if (node.transformFlags & 1 || hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + return visitTypeScript(node); + } + return node; + } + function getClassElementVisitor(parent22) { + return (node) => saveStateAndInvoke(node, (n7) => classElementVisitorWorker(n7, parent22)); + } + function classElementVisitorWorker(node, parent22) { + switch (node.kind) { + case 176: + return visitConstructor(node); + case 172: + return visitPropertyDeclaration(node, parent22); + case 177: + return visitGetAccessor(node, parent22); + case 178: + return visitSetAccessor(node, parent22); + case 174: + return visitMethodDeclaration(node, parent22); + case 175: + return visitEachChild(node, visitor, context2); + case 240: + return node; + case 181: + return; + default: + return Debug.failBadSyntaxKind(node); + } + } + function getObjectLiteralElementVisitor(parent22) { + return (node) => saveStateAndInvoke(node, (n7) => objectLiteralElementVisitorWorker(n7, parent22)); + } + function objectLiteralElementVisitorWorker(node, parent22) { + switch (node.kind) { + case 303: + case 304: + case 305: + return visitor(node); + case 177: + return visitGetAccessor(node, parent22); + case 178: + return visitSetAccessor(node, parent22); + case 174: + return visitMethodDeclaration(node, parent22); + default: + return Debug.failBadSyntaxKind(node); + } + } + function decoratorElidingVisitor(node) { + return isDecorator(node) ? void 0 : visitor(node); + } + function modifierElidingVisitor(node) { + return isModifier(node) ? void 0 : visitor(node); + } + function modifierVisitor(node) { + if (isDecorator(node)) + return void 0; + if (modifierToFlag(node.kind) & 28895) { + return void 0; + } else if (currentNamespace && node.kind === 95) { + return void 0; + } + return node; + } + function visitTypeScript(node) { + if (isStatement(node) && hasSyntacticModifier( + node, + 128 + /* Ambient */ + )) { + return factory2.createNotEmittedStatement(node); + } + switch (node.kind) { + case 95: + case 90: + return currentNamespace ? void 0 : node; + case 125: + case 123: + case 124: + case 128: + case 164: + case 87: + case 138: + case 148: + case 103: + case 147: + case 188: + case 189: + case 190: + case 191: + case 187: + case 182: + case 168: + case 133: + case 159: + case 136: + case 154: + case 150: + case 146: + case 116: + case 155: + case 185: + case 184: + case 186: + case 183: + case 192: + case 193: + case 194: + case 196: + case 197: + case 198: + case 199: + case 200: + case 201: + case 181: + return void 0; + case 265: + return factory2.createNotEmittedStatement(node); + case 270: + return void 0; + case 264: + return factory2.createNotEmittedStatement(node); + case 263: + return visitClassDeclaration(node); + case 231: + return visitClassExpression(node); + case 298: + return visitHeritageClause(node); + case 233: + return visitExpressionWithTypeArguments(node); + case 210: + return visitObjectLiteralExpression(node); + case 176: + case 172: + case 174: + case 177: + case 178: + case 175: + return Debug.fail("Class and object literal elements must be visited with their respective visitors"); + case 262: + return visitFunctionDeclaration(node); + case 218: + return visitFunctionExpression(node); + case 219: + return visitArrowFunction(node); + case 169: + return visitParameter(node); + case 217: + return visitParenthesizedExpression(node); + case 216: + case 234: + return visitAssertionExpression(node); + case 238: + return visitSatisfiesExpression(node); + case 213: + return visitCallExpression(node); + case 214: + return visitNewExpression(node); + case 215: + return visitTaggedTemplateExpression(node); + case 235: + return visitNonNullExpression(node); + case 266: + return visitEnumDeclaration(node); + case 243: + return visitVariableStatement(node); + case 260: + return visitVariableDeclaration(node); + case 267: + return visitModuleDeclaration(node); + case 271: + return visitImportEqualsDeclaration(node); + case 285: + return visitJsxSelfClosingElement(node); + case 286: + return visitJsxJsxOpeningElement(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitSourceFile(node) { + const alwaysStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") && !(isExternalModule(node) && moduleKind >= 5) && !isJsonSourceFile(node); + return factory2.updateSourceFile( + node, + visitLexicalEnvironment( + node.statements, + sourceElementVisitor, + context2, + /*start*/ + 0, + alwaysStrict + ) + ); + } + function visitObjectLiteralExpression(node) { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, getObjectLiteralElementVisitor(node), isObjectLiteralElementLike) + ); + } + function getClassFacts(node) { + let facts = 0; + if (some2(getProperties( + node, + /*requireInitializer*/ + true, + /*isStatic*/ + true + ))) + facts |= 1; + const extendsClauseElement = getEffectiveBaseTypeNode(node); + if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106) + facts |= 64; + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) + facts |= 2; + if (childIsDecorated(legacyDecorators, node)) + facts |= 4; + if (isExportOfNamespace(node)) + facts |= 8; + else if (isDefaultExternalModuleExport(node)) + facts |= 32; + else if (isNamedExternalModuleExport(node)) + facts |= 16; + return facts; + } + function hasTypeScriptClassSyntax(node) { + return !!(node.transformFlags & 8192); + } + function isClassLikeDeclarationWithTypeScriptSyntax(node) { + return hasDecorators(node) || some2(node.typeParameters) || some2(node.heritageClauses, hasTypeScriptClassSyntax) || some2(node.members, hasTypeScriptClassSyntax); + } + function visitClassDeclaration(node) { + const facts = getClassFacts(node); + const promoteToIIFE = languageVersion <= 1 && !!(facts & 7); + if (!isClassLikeDeclarationWithTypeScriptSyntax(node) && !classOrConstructorParameterIsDecorated(legacyDecorators, node) && !isExportOfNamespace(node)) { + return factory2.updateClassDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.name, + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, getClassElementVisitor(node), isClassElement) + ); + } + if (promoteToIIFE) { + context2.startLexicalEnvironment(); + } + const moveModifiers = promoteToIIFE || facts & 8; + let modifiers = moveModifiers ? visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, visitor, isModifierLike); + if (facts & 2) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + const needsName = moveModifiers && !node.name || facts & 4 || facts & 1; + const name2 = needsName ? node.name ?? factory2.getGeneratedNameForNode(node) : node.name; + const classDeclaration = factory2.updateClassDeclaration( + node, + modifiers, + name2, + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + transformClassMembers(node) + ); + let emitFlags = getEmitFlags(node); + if (facts & 1) { + emitFlags |= 64; + } + setEmitFlags(classDeclaration, emitFlags); + let statement; + if (promoteToIIFE) { + const statements = [classDeclaration]; + const closingBraceLocation = createTokenRange( + skipTrivia(currentSourceFile.text, node.members.end), + 20 + /* CloseBraceToken */ + ); + const localName = factory2.getInternalName(node); + const outer = factory2.createPartiallyEmittedExpression(localName); + setTextRangeEnd(outer, closingBraceLocation.end); + setEmitFlags( + outer, + 3072 + /* NoComments */ + ); + const returnStatement = factory2.createReturnStatement(outer); + setTextRangePos(returnStatement, closingBraceLocation.pos); + setEmitFlags( + returnStatement, + 3072 | 768 + /* NoTokenSourceMaps */ + ); + statements.push(returnStatement); + insertStatementsAfterStandardPrologue(statements, context2.endLexicalEnvironment()); + const iife = factory2.createImmediatelyInvokedArrowFunction(statements); + setInternalEmitFlags( + iife, + 1 + /* TypeScriptClassWrapper */ + ); + const varDecl = factory2.createVariableDeclaration( + factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + false + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + setOriginalNode(varDecl, node); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [varDecl], + 1 + /* Let */ + ) + ); + setOriginalNode(varStatement, node); + setCommentRange(varStatement, node); + setSourceMapRange(varStatement, moveRangePastDecorators(node)); + startOnNewLine(varStatement); + statement = varStatement; + } else { + statement = classDeclaration; + } + if (moveModifiers) { + if (facts & 8) { + return [ + statement, + createExportMemberAssignmentStatement(node) + ]; + } + if (facts & 32) { + return [ + statement, + factory2.createExportDefault(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ]; + } + if (facts & 16) { + return [ + statement, + factory2.createExternalModuleExport(factory2.getDeclarationName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )) + ]; + } + } + return statement; + } + function visitClassExpression(node) { + let modifiers = visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike); + if (classOrConstructorParameterIsDecorated(legacyDecorators, node)) { + modifiers = injectClassTypeMetadata(modifiers, node); + } + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + transformClassMembers(node) + ); + } + function transformClassMembers(node) { + const members = visitNodes2(node.members, getClassElementVisitor(node), isClassElement); + let newMembers; + const constructor = getFirstConstructorWithBody(node); + const parametersWithPropertyAssignments = constructor && filter2(constructor.parameters, (p7) => isParameterPropertyDeclaration(p7, constructor)); + if (parametersWithPropertyAssignments) { + for (const parameter of parametersWithPropertyAssignments) { + const parameterProperty = factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + parameter.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + setOriginalNode(parameterProperty, parameter); + newMembers = append(newMembers, parameterProperty); + } + } + if (newMembers) { + newMembers = addRange(newMembers, members); + return setTextRange( + factory2.createNodeArray(newMembers), + /*location*/ + node.members + ); + } + return members; + } + function injectClassTypeMetadata(modifiers, node) { + const metadata = getTypeMetadata(node, node); + if (some2(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, takeWhile2(modifiers, isExportOrDefaultModifier)); + addRange(modifiersArray, filter2(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter2(skipWhile(modifiers, isExportOrDefaultModifier), isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); + } + return modifiers; + } + function injectClassElementTypeMetadata(modifiers, node, container) { + if (isClassLike(container) && classElementOrClassElementParameterIsDecorated(legacyDecorators, node, container)) { + const metadata = getTypeMetadata(node, container); + if (some2(metadata)) { + const modifiersArray = []; + addRange(modifiersArray, filter2(modifiers, isDecorator)); + addRange(modifiersArray, metadata); + addRange(modifiersArray, filter2(modifiers, isModifier)); + modifiers = setTextRange(factory2.createNodeArray(modifiersArray), modifiers); + } + } + return modifiers; + } + function getTypeMetadata(node, container) { + if (!legacyDecorators) + return void 0; + return USE_NEW_TYPE_METADATA_FORMAT ? getNewTypeMetadata(node, container) : getOldTypeMetadata(node, container); + } + function getOldTypeMetadata(node, container) { + if (typeSerializer) { + let decorators; + if (shouldAddTypeMetadata(node)) { + const typeMetadata = emitHelpers().createMetadataHelper("design:type", typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node)); + decorators = append(decorators, factory2.createDecorator(typeMetadata)); + } + if (shouldAddParamTypesMetadata(node)) { + const paramTypesMetadata = emitHelpers().createMetadataHelper("design:paramtypes", typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container)); + decorators = append(decorators, factory2.createDecorator(paramTypesMetadata)); + } + if (shouldAddReturnTypeMetadata(node)) { + const returnTypeMetadata = emitHelpers().createMetadataHelper("design:returntype", typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node)); + decorators = append(decorators, factory2.createDecorator(returnTypeMetadata)); + } + return decorators; + } + } + function getNewTypeMetadata(node, container) { + if (typeSerializer) { + let properties; + if (shouldAddTypeMetadata(node)) { + const typeProperty = factory2.createPropertyAssignment("type", factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory2.createToken( + 39 + /* EqualsGreaterThanToken */ + ), + typeSerializer.serializeTypeOfNode({ currentLexicalScope, currentNameScope: container }, node) + )); + properties = append(properties, typeProperty); + } + if (shouldAddParamTypesMetadata(node)) { + const paramTypeProperty = factory2.createPropertyAssignment("paramTypes", factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory2.createToken( + 39 + /* EqualsGreaterThanToken */ + ), + typeSerializer.serializeParameterTypesOfNode({ currentLexicalScope, currentNameScope: container }, node, container) + )); + properties = append(properties, paramTypeProperty); + } + if (shouldAddReturnTypeMetadata(node)) { + const returnTypeProperty = factory2.createPropertyAssignment("returnType", factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + [], + /*type*/ + void 0, + factory2.createToken( + 39 + /* EqualsGreaterThanToken */ + ), + typeSerializer.serializeReturnTypeOfNode({ currentLexicalScope, currentNameScope: container }, node) + )); + properties = append(properties, returnTypeProperty); + } + if (properties) { + const typeInfoMetadata = emitHelpers().createMetadataHelper("design:typeinfo", factory2.createObjectLiteralExpression( + properties, + /*multiLine*/ + true + )); + return [factory2.createDecorator(typeInfoMetadata)]; + } + } + } + function shouldAddTypeMetadata(node) { + const kind = node.kind; + return kind === 174 || kind === 177 || kind === 178 || kind === 172; + } + function shouldAddReturnTypeMetadata(node) { + return node.kind === 174; + } + function shouldAddParamTypesMetadata(node) { + switch (node.kind) { + case 263: + case 231: + return getFirstConstructorWithBody(node) !== void 0; + case 174: + case 177: + case 178: + return true; + } + return false; + } + function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { + const name2 = member.name; + if (isPrivateIdentifier(name2)) { + return factory2.createIdentifier(""); + } else if (isComputedPropertyName(name2)) { + return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name2.expression) ? factory2.getGeneratedNameForNode(name2) : name2.expression; + } else if (isIdentifier(name2)) { + return factory2.createStringLiteral(idText(name2)); + } else { + return factory2.cloneNode(name2); + } + } + function visitPropertyNameOfClassElement(member) { + const name2 = member.name; + if (isComputedPropertyName(name2) && (!hasStaticModifier(member) && currentClassHasParameterProperties || hasDecorators(member) && legacyDecorators)) { + const expression = visitNode(name2.expression, visitor, isExpression); + Debug.assert(expression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + if (!isSimpleInlineableExpression(innerExpression)) { + const generatedName = factory2.getGeneratedNameForNode(name2); + hoistVariableDeclaration(generatedName); + return factory2.updateComputedPropertyName(name2, factory2.createAssignment(generatedName, expression)); + } + } + return Debug.checkDefined(visitNode(name2, visitor, isPropertyName)); + } + function visitHeritageClause(node) { + if (node.token === 119) { + return void 0; + } + return visitEachChild(node, visitor, context2); + } + function visitExpressionWithTypeArguments(node) { + return factory2.updateExpressionWithTypeArguments( + node, + Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression)), + /*typeArguments*/ + void 0 + ); + } + function shouldEmitFunctionLikeDeclaration(node) { + return !nodeIsMissing(node.body); + } + function visitPropertyDeclaration(node, parent22) { + const isAmbient = node.flags & 33554432 || hasSyntacticModifier( + node, + 64 + /* Abstract */ + ); + if (isAmbient && !(legacyDecorators && hasDecorators(node))) { + return void 0; + } + let modifiers = isClassLike(parent22) ? !isAmbient ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, modifierElidingVisitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent22); + if (isAmbient) { + return factory2.updatePropertyDeclaration( + node, + concatenate(modifiers, factory2.createModifiersFromModifierFlags( + 128 + /* Ambient */ + )), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + return factory2.updatePropertyDeclaration( + node, + modifiers, + visitPropertyNameOfClassElement(node), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + function visitConstructor(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return void 0; + } + return factory2.updateConstructorDeclaration( + node, + /*modifiers*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + transformConstructorBody(node.body, node) + ); + } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock2) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex + 1)); + } + function transformConstructorBody(body, constructor) { + const parametersWithPropertyAssignments = constructor && filter2(constructor.parameters, (p7) => isParameterPropertyDeclaration(p7, constructor)); + if (!some2(parametersWithPropertyAssignments)) { + return visitFunctionBody(body, visitor, context2); + } + let statements = []; + resumeLexicalEnvironment(); + const prologueStatementCount = factory2.copyPrologue( + body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + const superPath = findSuperStatementIndexPath(body.statements, prologueStatementCount); + const parameterPropertyAssignments = mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment); + if (superPath.length) { + transformConstructorBodyWorker( + statements, + body.statements, + prologueStatementCount, + superPath, + /*superPathDepth*/ + 0, + parameterPropertyAssignments + ); + } else { + addRange(statements, parameterPropertyAssignments); + addRange(statements, visitNodes2(body.statements, visitor, isStatement, prologueStatementCount)); + } + statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + const block = factory2.createBlock( + setTextRange(factory2.createNodeArray(statements), body.statements), + /*multiLine*/ + true + ); + setTextRange( + block, + /*location*/ + body + ); + setOriginalNode(block, body); + return block; + } + function transformParameterWithPropertyAssignment(node) { + const name2 = node.name; + if (!isIdentifier(name2)) { + return void 0; + } + const propertyName = setParent(setTextRange(factory2.cloneNode(name2), name2), name2.parent); + setEmitFlags( + propertyName, + 3072 | 96 + /* NoSourceMap */ + ); + const localName = setParent(setTextRange(factory2.cloneNode(name2), name2), name2.parent); + setEmitFlags( + localName, + 3072 + /* NoComments */ + ); + return startOnNewLine( + removeAllComments( + setTextRange( + setOriginalNode( + factory2.createExpressionStatement( + factory2.createAssignment( + setTextRange( + factory2.createPropertyAccessExpression( + factory2.createThis(), + propertyName + ), + node.name + ), + localName + ) + ), + node + ), + moveRangePos(node, -1) + ) + ) + ); + } + function visitMethodDeclaration(node, parent22) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitFunctionLikeDeclaration(node)) { + return void 0; + } + let modifiers = isClassLike(parent22) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent22); + return factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + visitPropertyNameOfClassElement(node), + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + visitFunctionBody(node.body, visitor, context2) + ); + } + function shouldEmitAccessorDeclaration(node) { + return !(nodeIsMissing(node.body) && hasSyntacticModifier( + node, + 64 + /* Abstract */ + )); + } + function visitGetAccessor(node, parent22) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitAccessorDeclaration(node)) { + return void 0; + } + let modifiers = isClassLike(parent22) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent22); + return factory2.updateGetAccessorDeclaration( + node, + modifiers, + visitPropertyNameOfClassElement(node), + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + visitFunctionBody(node.body, visitor, context2) || factory2.createBlock([]) + ); + } + function visitSetAccessor(node, parent22) { + if (!(node.transformFlags & 1)) { + return node; + } + if (!shouldEmitAccessorDeclaration(node)) { + return void 0; + } + let modifiers = isClassLike(parent22) ? visitNodes2(node.modifiers, visitor, isModifierLike) : visitNodes2(node.modifiers, decoratorElidingVisitor, isModifierLike); + modifiers = injectClassElementTypeMetadata(modifiers, node, parent22); + return factory2.updateSetAccessorDeclaration( + node, + modifiers, + visitPropertyNameOfClassElement(node), + visitParameterList(node.parameters, visitor, context2), + visitFunctionBody(node.body, visitor, context2) || factory2.createBlock([]) + ); + } + function visitFunctionDeclaration(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return factory2.createNotEmittedStatement(node); + } + const updated = factory2.updateFunctionDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + visitFunctionBody(node.body, visitor, context2) || factory2.createBlock([]) + ); + if (isExportOfNamespace(node)) { + const statements = [updated]; + addExportMemberAssignment(statements, node); + return statements; + } + return updated; + } + function visitFunctionExpression(node) { + if (!shouldEmitFunctionLikeDeclaration(node)) { + return factory2.createOmittedExpression(); + } + const updated = factory2.updateFunctionExpression( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + visitFunctionBody(node.body, visitor, context2) || factory2.createBlock([]) + ); + return updated; + } + function visitArrowFunction(node) { + const updated = factory2.updateArrowFunction( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + visitFunctionBody(node.body, visitor, context2) + ); + return updated; + } + function visitParameter(node) { + if (parameterIsThisKeyword(node)) { + return void 0; + } + const updated = factory2.updateParameterDeclaration( + node, + visitNodes2(node.modifiers, (node2) => isDecorator(node2) ? visitor(node2) : void 0, isModifierLike), + node.dotDotDotToken, + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags( + updated.name, + 64 + /* NoTrailingSourceMap */ + ); + } + return updated; + } + function visitVariableStatement(node) { + if (isExportOfNamespace(node)) { + const variables = getInitializedVariables(node.declarationList); + if (variables.length === 0) { + return void 0; + } + return setTextRange( + factory2.createExpressionStatement( + factory2.inlineExpressions( + map4(variables, transformInitializedVariable) + ) + ), + node + ); + } else { + return visitEachChild(node, visitor, context2); + } + } + function transformInitializedVariable(node) { + const name2 = node.name; + if (isBindingPattern(name2)) { + return flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + /*needsValue*/ + false, + createNamespaceExportExpression + ); + } else { + return setTextRange( + factory2.createAssignment( + getNamespaceMemberNameWithSourceMapsAndWithoutComments(name2), + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) + ), + /*location*/ + node + ); + } + } + function visitVariableDeclaration(node) { + const updated = factory2.updateVariableDeclaration( + node, + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + if (node.type) { + setTypeNode(updated.name, node.type); + } + return updated; + } + function visitParenthesizedExpression(node) { + const innerExpression = skipOuterExpressions( + node.expression, + ~6 + /* Assertions */ + ); + if (isAssertionExpression(innerExpression)) { + const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + return factory2.createPartiallyEmittedExpression(expression, node); + } + return visitEachChild(node, visitor, context2); + } + function visitAssertionExpression(node) { + const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + return factory2.createPartiallyEmittedExpression(expression, node); + } + function visitNonNullExpression(node) { + const expression = visitNode(node.expression, visitor, isLeftHandSideExpression); + Debug.assert(expression); + return factory2.createPartiallyEmittedExpression(expression, node); + } + function visitSatisfiesExpression(node) { + const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + return factory2.createPartiallyEmittedExpression(expression, node); + } + function visitCallExpression(node) { + return factory2.updateCallExpression( + node, + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + /*typeArguments*/ + void 0, + visitNodes2(node.arguments, visitor, isExpression) + ); + } + function visitNewExpression(node) { + return factory2.updateNewExpression( + node, + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + /*typeArguments*/ + void 0, + visitNodes2(node.arguments, visitor, isExpression) + ); + } + function visitTaggedTemplateExpression(node) { + return factory2.updateTaggedTemplateExpression( + node, + Debug.checkDefined(visitNode(node.tag, visitor, isExpression)), + /*typeArguments*/ + void 0, + Debug.checkDefined(visitNode(node.template, visitor, isTemplateLiteral)) + ); + } + function visitJsxSelfClosingElement(node) { + return factory2.updateJsxSelfClosingElement( + node, + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), + /*typeArguments*/ + void 0, + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) + ); + } + function visitJsxJsxOpeningElement(node) { + return factory2.updateJsxOpeningElement( + node, + Debug.checkDefined(visitNode(node.tagName, visitor, isJsxTagNameExpression)), + /*typeArguments*/ + void 0, + Debug.checkDefined(visitNode(node.attributes, visitor, isJsxAttributes)) + ); + } + function shouldEmitEnumDeclaration(node) { + return !isEnumConst(node) || shouldPreserveConstEnums(compilerOptions); + } + function visitEnumDeclaration(node) { + if (!shouldEmitEnumDeclaration(node)) { + return factory2.createNotEmittedStatement(node); + } + const statements = []; + let emitFlags = 4; + const varAdded = addVarForEnumOrModuleDeclaration(statements, node); + if (varAdded) { + if (moduleKind !== 4 || currentLexicalScope !== currentSourceFile) { + emitFlags |= 1024; + } + } + const parameterName = getNamespaceParameterName(node); + const containerName = getNamespaceContainerName(node); + const exportName = isExportOfNamespace(node) ? factory2.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory2.getDeclarationName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + let moduleArg = factory2.createLogicalOr( + exportName, + factory2.createAssignment( + exportName, + factory2.createObjectLiteralExpression() + ) + ); + if (isExportOfNamespace(node)) { + const localName = factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + moduleArg = factory2.createAssignment(localName, moduleArg); + } + const enumStatement = factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + transformEnumBody(node, containerName) + ), + /*typeArguments*/ + void 0, + [moduleArg] + ) + ); + setOriginalNode(enumStatement, node); + if (varAdded) { + setSyntheticLeadingComments(enumStatement, void 0); + setSyntheticTrailingComments(enumStatement, void 0); + } + setTextRange(enumStatement, node); + addEmitFlags(enumStatement, emitFlags); + statements.push(enumStatement); + return statements; + } + function transformEnumBody(node, localName) { + const savedCurrentNamespaceLocalName = currentNamespaceContainerName; + currentNamespaceContainerName = localName; + const statements = []; + startLexicalEnvironment(); + const members = map4(node.members, transformEnumMember); + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + addRange(statements, members); + currentNamespaceContainerName = savedCurrentNamespaceLocalName; + return factory2.createBlock( + setTextRange( + factory2.createNodeArray(statements), + /*location*/ + node.members + ), + /*multiLine*/ + true + ); + } + function transformEnumMember(member) { + const name2 = getExpressionForPropertyName( + member, + /*generateNameForComputedPropertyName*/ + false + ); + const valueExpression = transformEnumMemberDeclarationValue(member); + const innerAssignment = factory2.createAssignment( + factory2.createElementAccessExpression( + currentNamespaceContainerName, + name2 + ), + valueExpression + ); + const outerAssignment = valueExpression.kind === 11 ? innerAssignment : factory2.createAssignment( + factory2.createElementAccessExpression( + currentNamespaceContainerName, + innerAssignment + ), + name2 + ); + return setTextRange( + factory2.createExpressionStatement( + setTextRange( + outerAssignment, + member + ) + ), + member + ); + } + function transformEnumMemberDeclarationValue(member) { + const value2 = resolver.getConstantValue(member); + if (value2 !== void 0) { + return typeof value2 === "string" ? factory2.createStringLiteral(value2) : value2 < 0 ? factory2.createPrefixUnaryExpression(41, factory2.createNumericLiteral(-value2)) : factory2.createNumericLiteral(value2); + } else { + enableSubstitutionForNonQualifiedEnumMembers(); + if (member.initializer) { + return Debug.checkDefined(visitNode(member.initializer, visitor, isExpression)); + } else { + return factory2.createVoidZero(); + } + } + } + function shouldEmitModuleDeclaration(nodeIn) { + const node = getParseTreeNode(nodeIn, isModuleDeclaration); + if (!node) { + return true; + } + return isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions)); + } + function recordEmittedDeclarationInScope(node) { + if (!currentScopeFirstDeclarationsOfName) { + currentScopeFirstDeclarationsOfName = /* @__PURE__ */ new Map(); + } + const name2 = declaredNameInScope(node); + if (!currentScopeFirstDeclarationsOfName.has(name2)) { + currentScopeFirstDeclarationsOfName.set(name2, node); + } + } + function isFirstEmittedDeclarationInScope(node) { + if (currentScopeFirstDeclarationsOfName) { + const name2 = declaredNameInScope(node); + return currentScopeFirstDeclarationsOfName.get(name2) === node; + } + return true; + } + function declaredNameInScope(node) { + Debug.assertNode(node.name, isIdentifier); + return node.name.escapedText; + } + function addVarForEnumOrModuleDeclaration(statements, node) { + const varDecl = factory2.createVariableDeclaration(factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + )); + const varFlags = currentLexicalScope.kind === 312 ? 0 : 1; + const statement = factory2.createVariableStatement( + visitNodes2(node.modifiers, modifierVisitor, isModifier), + factory2.createVariableDeclarationList([varDecl], varFlags) + ); + setOriginalNode(varDecl, node); + setSyntheticLeadingComments(varDecl, void 0); + setSyntheticTrailingComments(varDecl, void 0); + setOriginalNode(statement, node); + recordEmittedDeclarationInScope(node); + if (isFirstEmittedDeclarationInScope(node)) { + if (node.kind === 266) { + setSourceMapRange(statement.declarationList, node); + } else { + setSourceMapRange(statement, node); + } + setCommentRange(statement, node); + addEmitFlags( + statement, + 2048 + /* NoTrailingComments */ + ); + statements.push(statement); + return true; + } + return false; + } + function visitModuleDeclaration(node) { + if (!shouldEmitModuleDeclaration(node)) { + return factory2.createNotEmittedStatement(node); + } + Debug.assertNode(node.name, isIdentifier, "A TypeScript namespace should have an Identifier name."); + enableSubstitutionForNamespaceExports(); + const statements = []; + let emitFlags = 4; + const varAdded = addVarForEnumOrModuleDeclaration(statements, node); + if (varAdded) { + if (moduleKind !== 4 || currentLexicalScope !== currentSourceFile) { + emitFlags |= 1024; + } + } + const parameterName = getNamespaceParameterName(node); + const containerName = getNamespaceContainerName(node); + const exportName = isExportOfNamespace(node) ? factory2.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory2.getDeclarationName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + let moduleArg = factory2.createLogicalOr( + exportName, + factory2.createAssignment( + exportName, + factory2.createObjectLiteralExpression() + ) + ); + if (isExportOfNamespace(node)) { + const localName = factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + moduleArg = factory2.createAssignment(localName, moduleArg); + } + const moduleStatement = factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + transformModuleBody(node, containerName) + ), + /*typeArguments*/ + void 0, + [moduleArg] + ) + ); + setOriginalNode(moduleStatement, node); + if (varAdded) { + setSyntheticLeadingComments(moduleStatement, void 0); + setSyntheticTrailingComments(moduleStatement, void 0); + } + setTextRange(moduleStatement, node); + addEmitFlags(moduleStatement, emitFlags); + statements.push(moduleStatement); + return statements; + } + function transformModuleBody(node, namespaceLocalName) { + const savedCurrentNamespaceContainerName = currentNamespaceContainerName; + const savedCurrentNamespace = currentNamespace; + const savedCurrentScopeFirstDeclarationsOfName = currentScopeFirstDeclarationsOfName; + currentNamespaceContainerName = namespaceLocalName; + currentNamespace = node; + currentScopeFirstDeclarationsOfName = void 0; + const statements = []; + startLexicalEnvironment(); + let statementsLocation; + let blockLocation; + if (node.body) { + if (node.body.kind === 268) { + saveStateAndInvoke(node.body, (body) => addRange(statements, visitNodes2(body.statements, namespaceElementVisitor, isStatement))); + statementsLocation = node.body.statements; + blockLocation = node.body; + } else { + const result2 = visitModuleDeclaration(node.body); + if (result2) { + if (isArray3(result2)) { + addRange(statements, result2); + } else { + statements.push(result2); + } + } + const moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; + statementsLocation = moveRangePos(moduleBlock.statements, -1); + } + } + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + currentNamespaceContainerName = savedCurrentNamespaceContainerName; + currentNamespace = savedCurrentNamespace; + currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; + const block = factory2.createBlock( + setTextRange( + factory2.createNodeArray(statements), + /*location*/ + statementsLocation + ), + /*multiLine*/ + true + ); + setTextRange(block, blockLocation); + if (!node.body || node.body.kind !== 268) { + setEmitFlags( + block, + getEmitFlags(block) | 3072 + /* NoComments */ + ); + } + return block; + } + function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { + if (moduleDeclaration.body.kind === 267) { + const recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); + return recursiveInnerModule || moduleDeclaration.body; + } + } + function visitImportDeclaration(node) { + if (!node.importClause) { + return node; + } + if (node.importClause.isTypeOnly) { + return void 0; + } + const importClause = visitNode(node.importClause, visitImportClause, isImportClause); + return importClause || compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2 ? factory2.updateImportDeclaration( + node, + /*modifiers*/ + void 0, + importClause, + node.moduleSpecifier, + node.attributes + ) : void 0; + } + function visitImportClause(node) { + Debug.assert(!node.isTypeOnly); + const name2 = shouldEmitAliasDeclaration(node) ? node.name : void 0; + const namedBindings = visitNode(node.namedBindings, visitNamedImportBindings, isNamedImportBindings); + return name2 || namedBindings ? factory2.updateImportClause( + node, + /*isTypeOnly*/ + false, + name2, + namedBindings + ) : void 0; + } + function visitNamedImportBindings(node) { + if (node.kind === 274) { + return shouldEmitAliasDeclaration(node) ? node : void 0; + } else { + const allowEmpty = compilerOptions.verbatimModuleSyntax || compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2); + const elements = visitNodes2(node.elements, visitImportSpecifier, isImportSpecifier); + return allowEmpty || some2(elements) ? factory2.updateNamedImports(node, elements) : void 0; + } + } + function visitImportSpecifier(node) { + return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : void 0; + } + function visitExportAssignment(node) { + return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node) ? visitEachChild(node, visitor, context2) : void 0; + } + function visitExportDeclaration(node) { + if (node.isTypeOnly) { + return void 0; + } + if (!node.exportClause || isNamespaceExport(node.exportClause)) { + return node; + } + const allowEmpty = compilerOptions.verbatimModuleSyntax || !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 || compilerOptions.importsNotUsedAsValues === 2); + const exportClause = visitNode( + node.exportClause, + (bindings6) => visitNamedExportBindings(bindings6, allowEmpty), + isNamedExportBindings + ); + return exportClause ? factory2.updateExportDeclaration( + node, + /*modifiers*/ + void 0, + node.isTypeOnly, + exportClause, + node.moduleSpecifier, + node.attributes + ) : void 0; + } + function visitNamedExports(node, allowEmpty) { + const elements = visitNodes2(node.elements, visitExportSpecifier, isExportSpecifier); + return allowEmpty || some2(elements) ? factory2.updateNamedExports(node, elements) : void 0; + } + function visitNamespaceExports(node) { + return factory2.updateNamespaceExport(node, Debug.checkDefined(visitNode(node.name, visitor, isIdentifier))); + } + function visitNamedExportBindings(node, allowEmpty) { + return isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty); + } + function visitExportSpecifier(node) { + return !node.isTypeOnly && (compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)) ? node : void 0; + } + function shouldEmitImportEqualsDeclaration(node) { + return shouldEmitAliasDeclaration(node) || !isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node); + } + function visitImportEqualsDeclaration(node) { + if (node.isTypeOnly) { + return void 0; + } + if (isExternalModuleImportEqualsDeclaration(node)) { + const isReferenced = shouldEmitAliasDeclaration(node); + if (!isReferenced && compilerOptions.importsNotUsedAsValues === 1) { + return setOriginalNode( + setTextRange( + factory2.createImportDeclaration( + /*modifiers*/ + void 0, + /*importClause*/ + void 0, + node.moduleReference.expression, + /*attributes*/ + void 0 + ), + node + ), + node + ); + } + return isReferenced ? visitEachChild(node, visitor, context2) : void 0; + } + if (!shouldEmitImportEqualsDeclaration(node)) { + return void 0; + } + const moduleReference = createExpressionFromEntityName(factory2, node.moduleReference); + setEmitFlags( + moduleReference, + 3072 | 4096 + /* NoNestedComments */ + ); + if (isNamedExternalModuleExport(node) || !isExportOfNamespace(node)) { + return setOriginalNode( + setTextRange( + factory2.createVariableStatement( + visitNodes2(node.modifiers, modifierVisitor, isModifier), + factory2.createVariableDeclarationList([ + setOriginalNode( + factory2.createVariableDeclaration( + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + moduleReference + ), + node + ) + ]) + ), + node + ), + node + ); + } else { + return setOriginalNode( + createNamespaceExport( + node.name, + moduleReference, + node + ), + node + ); + } + } + function isExportOfNamespace(node) { + return currentNamespace !== void 0 && hasSyntacticModifier( + node, + 32 + /* Export */ + ); + } + function isExternalModuleExport(node) { + return currentNamespace === void 0 && hasSyntacticModifier( + node, + 32 + /* Export */ + ); + } + function isNamedExternalModuleExport(node) { + return isExternalModuleExport(node) && !hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + } + function isDefaultExternalModuleExport(node) { + return isExternalModuleExport(node) && hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + } + function createExportMemberAssignmentStatement(node) { + const expression = factory2.createAssignment( + factory2.getExternalModuleOrNamespaceExportName( + currentNamespaceContainerName, + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ), + factory2.getLocalName(node) + ); + setSourceMapRange(expression, createRange2(node.name ? node.name.pos : node.pos, node.end)); + const statement = factory2.createExpressionStatement(expression); + setSourceMapRange(statement, createRange2(-1, node.end)); + return statement; + } + function addExportMemberAssignment(statements, node) { + statements.push(createExportMemberAssignmentStatement(node)); + } + function createNamespaceExport(exportName, exportValue, location2) { + return setTextRange( + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.getNamespaceMemberName( + currentNamespaceContainerName, + exportName, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ), + exportValue + ) + ), + location2 + ); + } + function createNamespaceExportExpression(exportName, exportValue, location2) { + return setTextRange(factory2.createAssignment(getNamespaceMemberNameWithSourceMapsAndWithoutComments(exportName), exportValue), location2); + } + function getNamespaceMemberNameWithSourceMapsAndWithoutComments(name2) { + return factory2.getNamespaceMemberName( + currentNamespaceContainerName, + name2, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + } + function getNamespaceParameterName(node) { + const name2 = factory2.getGeneratedNameForNode(node); + setSourceMapRange(name2, node.name); + return name2; + } + function getNamespaceContainerName(node) { + return factory2.getGeneratedNameForNode(node); + } + function enableSubstitutionForNonQualifiedEnumMembers() { + if ((enabledSubstitutions & 8) === 0) { + enabledSubstitutions |= 8; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + } + } + function enableSubstitutionForNamespaceExports() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + context2.enableSubstitution( + 304 + /* ShorthandPropertyAssignment */ + ); + context2.enableEmitNotification( + 267 + /* ModuleDeclaration */ + ); + } + } + function isTransformedModuleDeclaration(node) { + return getOriginalNode(node).kind === 267; + } + function isTransformedEnumDeclaration(node) { + return getOriginalNode(node).kind === 266; + } + function onEmitNode(hint, node, emitCallback) { + const savedApplicableSubstitutions = applicableSubstitutions; + const savedCurrentSourceFile = currentSourceFile; + if (isSourceFile(node)) { + currentSourceFile = node; + } + if (enabledSubstitutions & 2 && isTransformedModuleDeclaration(node)) { + applicableSubstitutions |= 2; + } + if (enabledSubstitutions & 8 && isTransformedEnumDeclaration(node)) { + applicableSubstitutions |= 8; + } + previousOnEmitNode(hint, node, emitCallback); + applicableSubstitutions = savedApplicableSubstitutions; + currentSourceFile = savedCurrentSourceFile; + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } else if (isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + if (enabledSubstitutions & 2) { + const name2 = node.name; + const exportedName = trySubstituteNamespaceExportedName(name2); + if (exportedName) { + if (node.objectAssignmentInitializer) { + const initializer = factory2.createAssignment(exportedName, node.objectAssignmentInitializer); + return setTextRange(factory2.createPropertyAssignment(name2, initializer), node); + } + return setTextRange(factory2.createPropertyAssignment(name2, exportedName), node); + } + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + case 211: + return substitutePropertyAccessExpression(node); + case 212: + return substituteElementAccessExpression(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + return trySubstituteNamespaceExportedName(node) || node; + } + function trySubstituteNamespaceExportedName(node) { + if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) { + const container = resolver.getReferencedExportContainer( + node, + /*prefixLocals*/ + false + ); + if (container && container.kind !== 312) { + const substitute = applicableSubstitutions & 2 && container.kind === 267 || applicableSubstitutions & 8 && container.kind === 266; + if (substitute) { + return setTextRange( + factory2.createPropertyAccessExpression(factory2.getGeneratedNameForNode(container), node), + /*location*/ + node + ); + } + } + } + return void 0; + } + function substitutePropertyAccessExpression(node) { + return substituteConstantValue(node); + } + function substituteElementAccessExpression(node) { + return substituteConstantValue(node); + } + function safeMultiLineComment(value2) { + return value2.replace(/\*\//g, "*_/"); + } + function substituteConstantValue(node) { + const constantValue = tryGetConstEnumValue(node); + if (constantValue !== void 0) { + setConstantValue(node, constantValue); + const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue); + if (!compilerOptions.removeComments) { + const originalNode = getOriginalNode(node, isAccessExpression); + addSyntheticTrailingComment(substitute, 3, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `); + } + return substitute; + } + return node; + } + function tryGetConstEnumValue(node) { + if (getIsolatedModules(compilerOptions)) { + return void 0; + } + return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : void 0; + } + function shouldEmitAliasDeclaration(node) { + return compilerOptions.verbatimModuleSyntax || isInJSFile(node) || (compilerOptions.preserveValueImports ? resolver.isValueAliasDeclaration(node) : resolver.isReferencedAliasDeclaration(node)); + } + } + var USE_NEW_TYPE_METADATA_FORMAT; + var init_ts = __esm2({ + "src/compiler/transformers/ts.ts"() { + "use strict"; + init_ts2(); + USE_NEW_TYPE_METADATA_FORMAT = false; + } + }); + function transformClassFields(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + hoistVariableDeclaration, + endLexicalEnvironment, + startLexicalEnvironment, + resumeLexicalEnvironment, + addBlockScopedVariable + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const legacyDecorators = !!compilerOptions.experimentalDecorators; + const shouldTransformInitializersUsingSet = !useDefineForClassFields; + const shouldTransformInitializersUsingDefine = useDefineForClassFields && languageVersion < 9; + const shouldTransformInitializers = shouldTransformInitializersUsingSet || shouldTransformInitializersUsingDefine; + const shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9; + const shouldTransformAutoAccessors = languageVersion < 99 ? -1 : !useDefineForClassFields ? 3 : 0; + const shouldTransformThisInStaticInitializers = languageVersion < 9; + const shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2; + const shouldTransformAnything = shouldTransformInitializers || shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformAutoAccessors === -1; + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + const previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + let shouldTransformPrivateStaticElementsInFile = false; + let enabledSubstitutions; + let classAliases; + let pendingExpressions; + let pendingStatements; + let lexicalEnvironment; + const lexicalEnvironmentMap = /* @__PURE__ */ new Map(); + const noSubstitution = /* @__PURE__ */ new Set(); + let currentClassContainer; + let currentClassElement; + let shouldSubstituteThisWithClassThis = false; + let previousShouldSubstituteThisWithClassThis = false; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + lexicalEnvironment = void 0; + shouldTransformPrivateStaticElementsInFile = !!(getInternalEmitFlags(node) & 32); + if (!shouldTransformAnything && !shouldTransformPrivateStaticElementsInFile) { + return node; + } + const visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function modifierVisitor(node) { + switch (node.kind) { + case 129: + return shouldTransformAutoAccessorsInCurrentClass() ? void 0 : node; + default: + return tryCast(node, isModifier); + } + } + function visitor(node) { + if (!(node.transformFlags & 16777216) && !(node.transformFlags & 134234112)) { + return node; + } + switch (node.kind) { + case 129: + return Debug.fail("Use `modifierVisitor` instead."); + case 263: + return visitClassDeclaration(node); + case 231: + return visitClassExpression(node); + case 175: + case 172: + return Debug.fail("Use `classElementVisitor` instead."); + case 303: + return visitPropertyAssignment(node); + case 243: + return visitVariableStatement(node); + case 260: + return visitVariableDeclaration(node); + case 169: + return visitParameterDeclaration(node); + case 208: + return visitBindingElement(node); + case 277: + return visitExportAssignment(node); + case 81: + return visitPrivateIdentifier(node); + case 211: + return visitPropertyAccessExpression(node); + case 212: + return visitElementAccessExpression(node); + case 224: + case 225: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + false + ); + case 226: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 217: + return visitParenthesizedExpression( + node, + /*discarded*/ + false + ); + case 213: + return visitCallExpression(node); + case 244: + return visitExpressionStatement(node); + case 215: + return visitTaggedTemplateExpression(node); + case 248: + return visitForStatement(node); + case 110: + return visitThisExpression(node); + case 262: + case 218: + return setCurrentClassElementAnd( + /*classElement*/ + void 0, + fallbackVisitor, + node + ); + case 176: + case 174: + case 177: + case 178: { + return setCurrentClassElementAnd( + node, + fallbackVisitor, + node + ); + } + default: + return fallbackVisitor(node); + } + } + function fallbackVisitor(node) { + return visitEachChild(node, visitor, context2); + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 224: + case 225: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 226: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 361: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 217: + return visitParenthesizedExpression( + node, + /*discarded*/ + true + ); + default: + return visitor(node); + } + } + function heritageClauseVisitor(node) { + switch (node.kind) { + case 298: + return visitEachChild(node, heritageClauseVisitor, context2); + case 233: + return visitExpressionWithTypeArgumentsInHeritageClause(node); + default: + return visitor(node); + } + } + function assignmentTargetVisitor(node) { + switch (node.kind) { + case 210: + case 209: + return visitAssignmentPattern(node); + default: + return visitor(node); + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 176: + return setCurrentClassElementAnd( + node, + visitConstructorDeclaration, + node + ); + case 177: + case 178: + case 174: + return setCurrentClassElementAnd( + node, + visitMethodOrAccessorDeclaration, + node + ); + case 172: + return setCurrentClassElementAnd( + node, + visitPropertyDeclaration, + node + ); + case 175: + return setCurrentClassElementAnd( + node, + visitClassStaticBlockDeclaration, + node + ); + case 167: + return visitComputedPropertyName(node); + case 240: + return node; + default: + return isModifierLike(node) ? modifierVisitor(node) : visitor(node); + } + } + function propertyNameVisitor(node) { + switch (node.kind) { + case 167: + return visitComputedPropertyName(node); + default: + return visitor(node); + } + } + function accessorFieldResultVisitor(node) { + switch (node.kind) { + case 172: + return transformFieldInitializer(node); + case 177: + case 178: + return classElementVisitor(node); + default: + Debug.assertMissingNode(node, "Expected node to either be a PropertyDeclaration, GetAccessorDeclaration, or SetAccessorDeclaration"); + break; + } + } + function visitPrivateIdentifier(node) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks) { + return node; + } + if (isStatement(node.parent)) { + return node; + } + return setOriginalNode(factory2.createIdentifier(""), node); + } + function transformPrivateIdentifierInInExpression(node) { + const info2 = accessPrivateIdentifier2(node.left); + if (info2) { + const receiver = visitNode(node.right, visitor, isExpression); + return setOriginalNode( + emitHelpers().createClassPrivateFieldInHelper(info2.brandCheckIdentifier, receiver), + node + ); + } + return visitEachChild(node, visitor, context2); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return visitEachChild(node, visitor, context2); + } + function visitVariableStatement(node) { + const savedPendingStatements = pendingStatements; + pendingStatements = []; + const visitedNode = visitEachChild(node, visitor, context2); + const statement = some2(pendingStatements) ? [visitedNode, ...pendingStatements] : visitedNode; + pendingStatements = savedPendingStatements; + return statement; + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return visitEachChild(node, visitor, context2); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return visitEachChild(node, visitor, context2); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return visitEachChild(node, visitor, context2); + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation( + context2, + node, + /*ignoreEmptyStringLiteral*/ + true, + node.isExportEquals ? "" : "default" + ); + } + return visitEachChild(node, visitor, context2); + } + function injectPendingExpressions(expression) { + if (some2(pendingExpressions)) { + if (isParenthesizedExpression(expression)) { + pendingExpressions.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions)); + } else { + pendingExpressions.push(expression); + expression = factory2.inlineExpressions(pendingExpressions); + } + pendingExpressions = void 0; + } + return expression; + } + function visitComputedPropertyName(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return factory2.updateComputedPropertyName(node, injectPendingExpressions(expression)); + } + function visitConstructorDeclaration(node) { + if (currentClassContainer) { + return transformConstructor(node, currentClassContainer); + } + return fallbackVisitor(node); + } + function shouldTransformClassElementToWeakMap(node) { + if (shouldTransformPrivateElementsOrClassStaticBlocks) + return true; + if (hasStaticModifier(node) && getInternalEmitFlags(node) & 32) + return true; + return false; + } + function visitMethodOrAccessorDeclaration(node) { + Debug.assert(!hasDecorators(node)); + if (!isPrivateIdentifierClassElementDeclaration(node) || !shouldTransformClassElementToWeakMap(node)) { + return visitEachChild(node, classElementVisitor, context2); + } + const info2 = accessPrivateIdentifier2(node.name); + Debug.assert(info2, "Undeclared private name for property declaration."); + if (!info2.isValid) { + return node; + } + const functionName = getHoistedFunctionName(node); + if (functionName) { + getPendingExpressions().push( + factory2.createAssignment( + functionName, + factory2.createFunctionExpression( + filter2(node.modifiers, (m7) => isModifier(m7) && !isStaticModifier(m7) && !isAccessorModifier(m7)), + node.asteriskToken, + functionName, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + visitFunctionBody(node.body, visitor, context2) + ) + ) + ); + } + return void 0; + } + function setCurrentClassElementAnd(classElement, visitor2, arg) { + if (classElement !== currentClassElement) { + const savedCurrentClassElement = currentClassElement; + currentClassElement = classElement; + const result2 = visitor2(arg); + currentClassElement = savedCurrentClassElement; + return result2; + } + return visitor2(arg); + } + function getHoistedFunctionName(node) { + Debug.assert(isPrivateIdentifier(node.name)); + const info2 = accessPrivateIdentifier2(node.name); + Debug.assert(info2, "Undeclared private name for property declaration."); + if (info2.kind === "m") { + return info2.methodName; + } + if (info2.kind === "a") { + if (isGetAccessor(node)) { + return info2.getterName; + } + if (isSetAccessor(node)) { + return info2.setterName; + } + } + } + function getClassThis() { + const lex = getClassLexicalEnvironment(); + const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name); + return Debug.checkDefined(classThis); + } + function transformAutoAccessor(node) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name2 = node.name; + let getterName = name2; + let setterName = name2; + if (isComputedPropertyName(name2) && !isSimpleInlineableExpression(name2.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name2, visitNode(name2.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name2, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name2.expression); + const expression = visitNode(name2.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name2.expression); + getterName = factory2.updateComputedPropertyName(name2, assignment); + setterName = factory2.updateComputedPropertyName(name2, temp); + } + } + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiers, node.initializer); + setOriginalNode(backingField, node); + setEmitFlags( + backingField, + 3072 + /* NoComments */ + ); + setSourceMapRange(backingField, sourceMapRange); + const receiver = isStatic(node) ? getClassThis() : factory2.createThis(); + const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers)); + const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver); + setOriginalNode(setter, node); + setEmitFlags( + setter, + 3072 + /* NoComments */ + ); + setSourceMapRange(setter, sourceMapRange); + return visitArray([backingField, getter, setter], accessorFieldResultVisitor, isClassElement); + } + function transformPrivateFieldInitializer(node) { + if (shouldTransformClassElementToWeakMap(node)) { + const info2 = accessPrivateIdentifier2(node.name); + Debug.assert(info2, "Undeclared private name for property declaration."); + if (!info2.isValid) { + return node; + } + if (info2.isStatic && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const statement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (statement) { + return factory2.createClassStaticBlockDeclaration(factory2.createBlock( + [statement], + /*multiLine*/ + true + )); + } + } + return void 0; + } + if (shouldTransformInitializersUsingSet && !isStatic(node) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && lexicalEnvironment.data.facts & 16) { + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifierLike), + node.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + function transformPublicFieldInitializer(node) { + if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) { + const expr = getPropertyNameExpressionIfNeeded( + node.name, + /*shouldHoist*/ + !!node.initializer || useDefineForClassFields + ); + if (expr) { + getPendingExpressions().push(...flattenCommaList(expr)); + } + if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks) { + const initializerStatement = transformPropertyOrClassStaticBlock(node, factory2.createThis()); + if (initializerStatement) { + const staticBlock = factory2.createClassStaticBlockDeclaration( + factory2.createBlock([initializerStatement]) + ); + setOriginalNode(staticBlock, node); + setCommentRange(staticBlock, node); + setCommentRange(initializerStatement, { pos: -1, end: -1 }); + setSyntheticLeadingComments(initializerStatement, void 0); + setSyntheticTrailingComments(initializerStatement, void 0); + return staticBlock; + } + } + return void 0; + } + return factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNode(node.name, propertyNameVisitor, isPropertyName), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + function transformFieldInitializer(node) { + Debug.assert(!hasDecorators(node), "Decorators should already have been transformed and elided."); + return isPrivateIdentifierClassElementDeclaration(node) ? transformPrivateFieldInitializer(node) : transformPublicFieldInitializer(node); + } + function shouldTransformAutoAccessorsInCurrentClass() { + return shouldTransformAutoAccessors === -1 || shouldTransformAutoAccessors === 3 && !!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !!(lexicalEnvironment.data.facts & 16); + } + function visitPropertyDeclaration(node) { + if (isAutoAccessorPropertyDeclaration(node) && (shouldTransformAutoAccessorsInCurrentClass() || hasStaticModifier(node) && getInternalEmitFlags(node) & 32)) { + return transformAutoAccessor(node); + } + return transformFieldInitializer(node); + } + function shouldForceDynamicThis() { + return !!currentClassElement && hasStaticModifier(currentClassElement) && isAccessor(currentClassElement) && isAutoAccessorPropertyDeclaration(getOriginalNode(currentClassElement)); + } + function ensureDynamicThisIfNeeded(node) { + if (shouldForceDynamicThis()) { + const innerExpression = skipOuterExpressions(node); + if (innerExpression.kind === 110) { + noSubstitution.add(innerExpression); + } + } + } + function createPrivateIdentifierAccess(info2, receiver) { + receiver = visitNode(receiver, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); + return createPrivateIdentifierAccessHelper(info2, receiver); + } + function createPrivateIdentifierAccessHelper(info2, receiver) { + setCommentRange(receiver, moveRangePos(receiver, -1)); + switch (info2.kind) { + case "a": + return emitHelpers().createClassPrivateFieldGetHelper( + receiver, + info2.brandCheckIdentifier, + info2.kind, + info2.getterName + ); + case "m": + return emitHelpers().createClassPrivateFieldGetHelper( + receiver, + info2.brandCheckIdentifier, + info2.kind, + info2.methodName + ); + case "f": + return emitHelpers().createClassPrivateFieldGetHelper( + receiver, + info2.brandCheckIdentifier, + info2.kind, + info2.isStatic ? info2.variableName : void 0 + ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); + default: + Debug.assertNever(info2, "Unknown private element type"); + } + } + function visitPropertyAccessExpression(node) { + if (isPrivateIdentifier(node.name)) { + const privateIdentifierInfo = accessPrivateIdentifier2(node.name); + if (privateIdentifierInfo) { + return setTextRange( + setOriginalNode( + createPrivateIdentifierAccess(privateIdentifierInfo, node.expression), + node + ), + node + ); + } + } + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isIdentifier(node.name) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1) { + return visitInvalidSuperProperty(node); + } + if (classConstructor && superClassReference) { + const superProperty = factory2.createReflectGetCall( + superClassReference, + factory2.createStringLiteralFromNode(node.name), + classConstructor + ); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + } + return visitEachChild(node, visitor, context2); + } + function visitElementAccessExpression(node) { + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1) { + return visitInvalidSuperProperty(node); + } + if (classConstructor && superClassReference) { + const superProperty = factory2.createReflectGetCall( + superClassReference, + visitNode(node.argumentExpression, visitor, isExpression), + classConstructor + ); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + } + return visitEachChild(node, visitor, context2); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 46 || node.operator === 47) { + const operand = skipParentheses(node.operand); + if (isPrivateIdentifierPropertyAccessExpression(operand)) { + let info2; + if (info2 = accessPrivateIdentifier2(operand.name)) { + const receiver = visitNode(operand.expression, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); + const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); + let expression = createPrivateIdentifierAccess(info2, readExpression); + const temp = isPrefixUnaryExpression(node) || discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = createPrivateIdentifierAssignment( + info2, + initializeExpression || readExpression, + expression, + 64 + /* EqualsToken */ + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(operand) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1) { + const expression = visitInvalidSuperProperty(operand); + return isPrefixUnaryExpression(node) ? factory2.updatePrefixUnaryExpression(node, expression) : factory2.updatePostfixUnaryExpression(node, expression); + } + if (classConstructor && superClassReference) { + let setterName; + let getterName; + if (isPropertyAccessExpression(operand)) { + if (isIdentifier(operand.name)) { + getterName = setterName = factory2.createStringLiteralFromNode(operand.name); + } + } else { + if (isSimpleInlineableExpression(operand.argumentExpression)) { + getterName = setterName = operand.argumentExpression; + } else { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, visitNode(operand.argumentExpression, visitor, isExpression)); + } + } + if (setterName && getterName) { + let expression = factory2.createReflectGetCall(superClassReference, getterName, classConstructor); + setTextRange(expression, operand); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(superClassReference, setterName, expression, classConstructor); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + } + return visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context2) + ); + } + function visitExpressionStatement(node) { + return factory2.updateExpressionStatement( + node, + visitNode(node.expression, discardedValueVisitor, isExpression) + ); + } + function createCopiableReceiverExpr(receiver) { + const clone22 = nodeIsSynthesized(receiver) ? receiver : factory2.cloneNode(receiver); + if (receiver.kind === 110 && noSubstitution.has(receiver)) { + noSubstitution.add(clone22); + } + if (isSimpleInlineableExpression(receiver)) { + return { readExpression: clone22, initializeExpression: void 0 }; + } + const readExpression = factory2.createTempVariable(hoistVariableDeclaration); + const initializeExpression = factory2.createAssignment(readExpression, clone22); + return { readExpression, initializeExpression }; + } + function visitCallExpression(node) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.expression) && accessPrivateIdentifier2(node.expression.name)) { + const { thisArg, target } = factory2.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion); + if (isCallChain(node)) { + return factory2.updateCallChain( + node, + factory2.createPropertyAccessChain(visitNode(target, visitor, isExpression), node.questionDotToken, "call"), + /*questionDotToken*/ + void 0, + /*typeArguments*/ + void 0, + [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] + ); + } + return factory2.updateCallExpression( + node, + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "call"), + /*typeArguments*/ + void 0, + [visitNode(thisArg, visitor, isExpression), ...visitNodes2(node.arguments, visitor, isExpression)] + ); + } + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.expression) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { + const invocation = factory2.createFunctionCallCall( + visitNode(node.expression, visitor, isExpression), + lexicalEnvironment.data.classConstructor, + visitNodes2(node.arguments, visitor, isExpression) + ); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context2); + } + function visitTaggedTemplateExpression(node) { + var _a2; + if (isPrivateIdentifierPropertyAccessExpression(node.tag) && accessPrivateIdentifier2(node.tag.name)) { + const { thisArg, target } = factory2.createCallBinding(node.tag, hoistVariableDeclaration, languageVersion); + return factory2.updateTaggedTemplateExpression( + node, + factory2.createCallExpression( + factory2.createPropertyAccessExpression(visitNode(target, visitor, isExpression), "bind"), + /*typeArguments*/ + void 0, + [visitNode(thisArg, visitor, isExpression)] + ), + /*typeArguments*/ + void 0, + visitNode(node.template, visitor, isTemplateLiteral) + ); + } + if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.tag) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.classConstructor)) { + const invocation = factory2.createFunctionBindCall( + visitNode(node.tag, visitor, isExpression), + lexicalEnvironment.data.classConstructor, + [] + ); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return factory2.updateTaggedTemplateExpression( + node, + invocation, + /*typeArguments*/ + void 0, + visitNode(node.template, visitor, isTemplateLiteral) + ); + } + return visitEachChild(node, visitor, context2); + } + function transformClassStaticBlockDeclaration(node) { + if (lexicalEnvironment) { + lexicalEnvironmentMap.set(getOriginalNode(node), lexicalEnvironment); + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (isClassThisAssignmentBlock(node)) { + const result2 = visitNode(node.body.statements[0].expression, visitor, isExpression); + if (isAssignmentExpression( + result2, + /*excludeCompoundAssignment*/ + true + ) && result2.left === result2.right) { + return void 0; + } + return result2; + } + if (isClassNamedEvaluationHelperBlock(node)) { + return visitNode(node.body.statements[0].expression, visitor, isExpression); + } + startLexicalEnvironment(); + let statements = setCurrentClassElementAnd( + node, + (statements2) => visitNodes2(statements2, visitor, isStatement), + node.body.statements + ); + statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + const iife = factory2.createImmediatelyInvokedArrowFunction(statements); + setOriginalNode(skipParentheses(iife.expression), node); + addEmitFlags( + skipParentheses(iife.expression), + 4 + /* AdviseOnEmitNode */ + ); + setOriginalNode(iife, node); + setTextRange(iife, node); + return iife; + } + } + function isAnonymousClassNeedingAssignedName(node) { + if (isClassExpression(node) && !node.name) { + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + if (some2(staticPropertiesOrClassStaticBlocks, isClassNamedEvaluationHelperBlock)) { + return false; + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || !!(getInternalEmitFlags(node) && 32)) && some2(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + return hasTransformableStatics; + } + return false; + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const savedPendingExpressions = pendingExpressions; + pendingExpressions = void 0; + node = factory2.updateBinaryExpression( + node, + visitNode(node.left, assignmentTargetVisitor, isExpression), + node.operatorToken, + visitNode(node.right, visitor, isExpression) + ); + const expr = some2(pendingExpressions) ? factory2.inlineExpressions(compact2([...pendingExpressions, node])) : node; + pendingExpressions = savedPendingExpressions; + return expr; + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + Debug.assertNode(node, isAssignmentExpression); + } + const left = skipOuterExpressions( + node.left, + 8 | 1 + /* Parentheses */ + ); + if (isPrivateIdentifierPropertyAccessExpression(left)) { + const info2 = accessPrivateIdentifier2(left.name); + if (info2) { + return setTextRange( + setOriginalNode( + createPrivateIdentifierAssignment(info2, left.expression, node.right, node.operatorToken.kind), + node + ), + node + ); + } + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node.left) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1) { + return factory2.updateBinaryExpression( + node, + visitInvalidSuperProperty(node.left), + node.operatorToken, + visitNode(node.right, visitor, isExpression) + ); + } + if (classConstructor && superClassReference) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + superClassReference, + getterName, + classConstructor + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + superClassReference, + setterName, + expression, + classConstructor + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + } + if (isPrivateIdentifierInExpression(node)) { + return transformPrivateIdentifierInInExpression(node); + } + return visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitParenthesizedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function createPrivateIdentifierAssignment(info2, receiver, right, operator) { + receiver = visitNode(receiver, visitor, isExpression); + right = visitNode(right, visitor, isExpression); + ensureDynamicThisIfNeeded(receiver); + if (isCompoundAssignment(operator)) { + const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver); + receiver = initializeExpression || readExpression; + right = factory2.createBinaryExpression( + createPrivateIdentifierAccessHelper(info2, readExpression), + getNonAssignmentOperatorForCompoundAssignment(operator), + right + ); + } + setCommentRange(receiver, moveRangePos(receiver, -1)); + switch (info2.kind) { + case "a": + return emitHelpers().createClassPrivateFieldSetHelper( + receiver, + info2.brandCheckIdentifier, + right, + info2.kind, + info2.setterName + ); + case "m": + return emitHelpers().createClassPrivateFieldSetHelper( + receiver, + info2.brandCheckIdentifier, + right, + info2.kind, + /*f*/ + void 0 + ); + case "f": + return emitHelpers().createClassPrivateFieldSetHelper( + receiver, + info2.brandCheckIdentifier, + right, + info2.kind, + info2.isStatic ? info2.variableName : void 0 + ); + case "untransformed": + return Debug.fail("Access helpers should not be created for untransformed private elements"); + default: + Debug.assertNever(info2, "Unknown private element type"); + } + } + function getPrivateInstanceMethodsAndAccessors(node) { + return filter2(node.members, isNonStaticMethodOrAccessorWithPrivateName); + } + function getClassFacts(node) { + var _a2; + let facts = 0; + const original = getOriginalNode(node); + if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) { + facts |= 1; + } + if (shouldTransformPrivateElementsOrClassStaticBlocks && (classHasClassThisAssignment(node) || classHasExplicitlyAssignedName(node))) { + facts |= 2; + } + let containsPublicInstanceFields = false; + let containsInitializedPublicInstanceFields = false; + let containsInstancePrivateElements = false; + let containsInstanceAutoAccessors = false; + for (const member of node.members) { + if (isStatic(member)) { + if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) { + facts |= 2; + } else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 && !node.name && !((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + facts |= 2; + } + if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) { + if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384) { + facts |= 8; + if (!(facts & 1)) { + facts |= 2; + } + } + if (shouldTransformSuperInStaticInitializers && member.transformFlags & 134217728) { + if (!(facts & 1)) { + facts |= 2 | 4; + } + } + } + } else if (!hasAbstractModifier(getOriginalNode(member))) { + if (isAutoAccessorPropertyDeclaration(member)) { + containsInstanceAutoAccessors = true; + containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member)); + } else if (isPrivateIdentifierClassElementDeclaration(member)) { + containsInstancePrivateElements = true; + if (resolver.getNodeCheckFlags(member) & 262144) { + facts |= 2; + } + } else if (isPropertyDeclaration(member)) { + containsPublicInstanceFields = true; + containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer); + } + } + } + const willHoistInitializersToConstructor = shouldTransformInitializersUsingDefine && containsPublicInstanceFields || shouldTransformInitializersUsingSet && containsInitializedPublicInstanceFields || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstancePrivateElements || shouldTransformPrivateElementsOrClassStaticBlocks && containsInstanceAutoAccessors && shouldTransformAutoAccessors === -1; + if (willHoistInitializersToConstructor) { + facts |= 16; + } + return facts; + } + function visitExpressionWithTypeArgumentsInHeritageClause(node) { + var _a2; + const facts = ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts) || 0; + if (facts & 4) { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().superClassReference = temp; + return factory2.updateExpressionWithTypeArguments( + node, + factory2.createAssignment( + temp, + visitNode(node.expression, visitor, isExpression) + ), + /*typeArguments*/ + void 0 + ); + } + return visitEachChild(node, visitor, context2); + } + function visitInNewClassLexicalEnvironment(node, visitor2) { + var _a2; + const savedCurrentClassContainer = currentClassContainer; + const savedPendingExpressions = pendingExpressions; + const savedLexicalEnvironment = lexicalEnvironment; + currentClassContainer = node; + pendingExpressions = void 0; + startClassLexicalEnvironment(); + const shouldAlwaysTransformPrivateStaticElements = getInternalEmitFlags(node) & 32; + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldAlwaysTransformPrivateStaticElements) { + const name2 = getNameOfDeclaration(node); + if (name2 && isIdentifier(name2)) { + getPrivateIdentifierEnvironment().data.className = name2; + } else if ((_a2 = node.emitNode) == null ? void 0 : _a2.assignedName) { + if (isStringLiteral(node.emitNode.assignedName)) { + if (node.emitNode.assignedName.textSourceNode && isIdentifier(node.emitNode.assignedName.textSourceNode)) { + getPrivateIdentifierEnvironment().data.className = node.emitNode.assignedName.textSourceNode; + } else if (isIdentifierText(node.emitNode.assignedName.text, languageVersion)) { + const prefixName = factory2.createIdentifier(node.emitNode.assignedName.text); + getPrivateIdentifierEnvironment().data.className = prefixName; + } + } + } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + const privateInstanceMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); + if (some2(privateInstanceMethodsAndAccessors)) { + getPrivateIdentifierEnvironment().data.weakSetName = createHoistedVariableForClass( + "instances", + privateInstanceMethodsAndAccessors[0].name + ); + } + } + const facts = getClassFacts(node); + if (facts) { + getClassLexicalEnvironment().facts = facts; + } + if (facts & 8) { + enableSubstitutionForClassStaticThisOrSuperReference(); + } + const result2 = visitor2(node, facts); + endClassLexicalEnvironment(); + Debug.assert(lexicalEnvironment === savedLexicalEnvironment); + currentClassContainer = savedCurrentClassContainer; + pendingExpressions = savedPendingExpressions; + return result2; + } + function visitClassDeclaration(node) { + return visitInNewClassLexicalEnvironment(node, visitClassDeclarationInNewClassLexicalEnvironment); + } + function visitClassDeclarationInNewClassLexicalEnvironment(node, facts) { + var _a2, _b; + let pendingClassReferenceAssignment; + if (facts & 2) { + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) { + getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + pendingClassReferenceAssignment = factory2.createAssignment(node.emitNode.classThis, factory2.getInternalName(node)); + } else { + const temp = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp); + pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node)); + } + } + if ((_b = node.emitNode) == null ? void 0 : _b.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } + const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144; + const isExport = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + const isDefault = hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); + const { members, prologue } = transformClassMembers(node); + const statements = []; + if (pendingClassReferenceAssignment) { + getPendingExpressions().unshift(pendingClassReferenceAssignment); + } + if (some2(pendingExpressions)) { + statements.push(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + } + if (shouldTransformInitializersUsingSet || shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32) { + const staticProperties = getStaticPropertiesAndClassStaticBlock(node); + if (some2(staticProperties)) { + addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory2.getInternalName(node)); + } + } + if (statements.length > 0 && isExport && isDefault) { + modifiers = visitNodes2(modifiers, (node2) => isExportOrDefaultModifier(node2) ? void 0 : node2, isModifier); + statements.push(factory2.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) + )); + } + const alias = getClassLexicalEnvironment().classConstructor; + if (isClassWithConstructorReference && alias) { + enableSubstitutionForClassAliases(); + classAliases[getOriginalNodeId(node)] = alias; + } + const classDecl = factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + statements.unshift(classDecl); + if (prologue) { + statements.unshift(factory2.createExpressionStatement(prologue)); + } + return statements; + } + function visitClassExpression(node) { + return visitInNewClassLexicalEnvironment(node, visitClassExpressionInNewClassLexicalEnvironment); + } + function visitClassExpressionInNewClassLexicalEnvironment(node, facts) { + var _a2, _b, _c; + const isDecoratedClassDeclaration = !!(facts & 1); + const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node); + const classCheckFlags = resolver.getNodeCheckFlags(node); + const isClassWithConstructorReference = classCheckFlags & 262144; + let temp; + function createClassTempVar() { + var _a22; + if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a22 = node.emitNode) == null ? void 0 : _a22.classThis)) { + return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis; + } + const requiresBlockScopedVar = classCheckFlags & 32768; + const temp2 = factory2.createTempVariable( + requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp2); + return temp2; + } + if ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis) { + getClassLexicalEnvironment().classThis = node.emitNode.classThis; + } + if (facts & 2) { + temp ?? (temp = createClassTempVar()); + } + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, heritageClauseVisitor, isHeritageClause); + const { members, prologue } = transformClassMembers(node); + const classExpression = factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + const expressions = []; + if (prologue) { + expressions.push(prologue); + } + const hasTransformableStatics = (shouldTransformPrivateElementsOrClassStaticBlocks || getInternalEmitFlags(node) & 32) && some2(staticPropertiesOrClassStaticBlocks, (node2) => isClassStaticBlockDeclaration(node2) || isPrivateIdentifierClassElementDeclaration(node2) || shouldTransformInitializers && isInitializedProperty(node2)); + if (hasTransformableStatics || some2(pendingExpressions)) { + if (isDecoratedClassDeclaration) { + Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration."); + if (some2(pendingExpressions)) { + addRange(pendingStatements, map4(pendingExpressions, factory2.createExpressionStatement)); + } + if (some2(staticPropertiesOrClassStaticBlocks)) { + addPropertyOrClassStaticBlockStatements(pendingStatements, staticPropertiesOrClassStaticBlocks, ((_b = node.emitNode) == null ? void 0 : _b.classThis) ?? factory2.getInternalName(node)); + } + if (temp) { + expressions.push(factory2.createAssignment(temp, classExpression)); + } else if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_c = node.emitNode) == null ? void 0 : _c.classThis)) { + expressions.push(factory2.createAssignment(node.emitNode.classThis, classExpression)); + } else { + expressions.push(classExpression); + } + } else { + temp ?? (temp = createClassTempVar()); + if (isClassWithConstructorReference) { + enableSubstitutionForClassAliases(); + const alias = factory2.cloneNode(temp); + alias.emitNode.autoGenerate.flags &= ~8; + classAliases[getOriginalNodeId(node)] = alias; + } + expressions.push(factory2.createAssignment(temp, classExpression)); + addRange(expressions, pendingExpressions); + addRange(expressions, generateInitializedPropertyExpressionsOrClassStaticBlock(staticPropertiesOrClassStaticBlocks, temp)); + expressions.push(factory2.cloneNode(temp)); + } + } else { + expressions.push(classExpression); + } + if (expressions.length > 1) { + addEmitFlags( + classExpression, + 131072 + /* Indented */ + ); + expressions.forEach(startOnNewLine); + } + return factory2.inlineExpressions(expressions); + } + function visitClassStaticBlockDeclaration(node) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks) { + return visitEachChild(node, visitor, context2); + } + return void 0; + } + function visitThisExpression(node) { + if (shouldTransformThisInStaticInitializers && currentClassElement && isClassStaticBlockDeclaration(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classThis, classConstructor } = lexicalEnvironment.data; + return classThis ?? classConstructor ?? node; + } + return node; + } + function transformClassMembers(node) { + const shouldTransformPrivateStaticElementsInClass = !!(getInternalEmitFlags(node) & 32); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInFile) { + for (const member of node.members) { + if (isPrivateIdentifierClassElementDeclaration(member)) { + if (shouldTransformClassElementToWeakMap(member)) { + addPrivateIdentifierToEnvironment(member, member.name, addPrivateIdentifierClassElementToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, member.name, { kind: "untransformed" }); + } + } + } + if (shouldTransformPrivateElementsOrClassStaticBlocks) { + if (some2(getPrivateInstanceMethodsAndAccessors(node))) { + createBrandCheckWeakSetForPrivateMethods(); + } + } + if (shouldTransformAutoAccessorsInCurrentClass()) { + for (const member of node.members) { + if (isAutoAccessorPropertyDeclaration(member)) { + const storageName = factory2.getGeneratedPrivateNameForNode( + member.name, + /*prefix*/ + void 0, + "_accessor_storage" + ); + if (shouldTransformPrivateElementsOrClassStaticBlocks || shouldTransformPrivateStaticElementsInClass && hasStaticModifier(member)) { + addPrivateIdentifierToEnvironment(member, storageName, addPrivateIdentifierPropertyDeclarationToEnvironment); + } else { + const privateEnv = getPrivateIdentifierEnvironment(); + setPrivateIdentifier(privateEnv, storageName, { kind: "untransformed" }); + } + } + } + } + } + let members = visitNodes2(node.members, classElementVisitor, isClassElement); + let syntheticConstructor; + if (!some2(members, isConstructorDeclaration)) { + syntheticConstructor = transformConstructor( + /*constructor*/ + void 0, + node + ); + } + let prologue; + let syntheticStaticBlock; + if (!shouldTransformPrivateElementsOrClassStaticBlocks && some2(pendingExpressions)) { + let statement = factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions)); + if (statement.transformFlags & 134234112) { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + const arrow = factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createBlock([statement]) + ); + prologue = factory2.createAssignment(temp, arrow); + statement = factory2.createExpressionStatement(factory2.createCallExpression( + temp, + /*typeArguments*/ + void 0, + [] + )); + } + const block = factory2.createBlock([statement]); + syntheticStaticBlock = factory2.createClassStaticBlockDeclaration(block); + pendingExpressions = void 0; + } + if (syntheticConstructor || syntheticStaticBlock) { + let membersArray; + const classThisAssignmentBlock = find2(members, isClassThisAssignmentBlock); + const classNamedEvaluationHelperBlock = find2(members, isClassNamedEvaluationHelperBlock); + membersArray = append(membersArray, classThisAssignmentBlock); + membersArray = append(membersArray, classNamedEvaluationHelperBlock); + membersArray = append(membersArray, syntheticConstructor); + membersArray = append(membersArray, syntheticStaticBlock); + const remainingMembers = classThisAssignmentBlock || classNamedEvaluationHelperBlock ? filter2(members, (member) => member !== classThisAssignmentBlock && member !== classNamedEvaluationHelperBlock) : members; + membersArray = addRange(membersArray, remainingMembers); + members = setTextRange( + factory2.createNodeArray(membersArray), + /*location*/ + node.members + ); + } + return { members, prologue }; + } + function createBrandCheckWeakSetForPrivateMethods() { + const { weakSetName } = getPrivateIdentifierEnvironment().data; + Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); + getPendingExpressions().push( + factory2.createAssignment( + weakSetName, + factory2.createNewExpression( + factory2.createIdentifier("WeakSet"), + /*typeArguments*/ + void 0, + [] + ) + ) + ); + } + function transformConstructor(constructor, container) { + constructor = visitNode(constructor, visitor, isConstructorDeclaration); + if (!(lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) || !(lexicalEnvironment.data.facts & 16)) { + return constructor; + } + const extendsClauseElement = getEffectiveBaseTypeNode(container); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106); + const parameters = visitParameterList(constructor ? constructor.parameters : void 0, visitor, context2); + const body = transformConstructorBody(container, constructor, isDerivedClass); + if (!body) { + return constructor; + } + if (constructor) { + Debug.assert(parameters); + return factory2.updateConstructorDeclaration( + constructor, + /*modifiers*/ + void 0, + parameters, + body + ); + } + return startOnNewLine( + setOriginalNode( + setTextRange( + factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + parameters ?? [], + body + ), + constructor || container + ), + constructor + ) + ); + } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements, constructor) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + statementOffset = superStatementIndex + 1; + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements, + constructor + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock2) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + while (statementOffset < statementsIn.length) { + const statement = statementsIn[statementOffset]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + statementOffset++; + } else { + break; + } + } + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset)); + } + function transformConstructorBody(node, constructor, isDerivedClass) { + const instanceProperties = getProperties( + node, + /*requireInitializer*/ + false, + /*isStatic*/ + false + ); + let properties = instanceProperties; + if (!useDefineForClassFields) { + properties = filter2(properties, (property2) => !!property2.initializer || isPrivateIdentifier(property2.name) || hasAccessorModifier(property2)); + } + const privateMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node); + const needsConstructorBody = some2(properties) || some2(privateMethodsAndAccessors); + if (!constructor && !needsConstructorBody) { + return visitFunctionBody( + /*node*/ + void 0, + visitor, + context2 + ); + } + resumeLexicalEnvironment(); + const needsSyntheticConstructor = !constructor && isDerivedClass; + let statementOffset = 0; + let statements = []; + const initializerStatements = []; + const receiver = factory2.createThis(); + addInstanceMethodStatements(initializerStatements, privateMethodsAndAccessors, receiver); + if (constructor) { + const parameterProperties = filter2(instanceProperties, (prop) => isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + const nonParameterProperties = filter2(properties, (prop) => !isParameterPropertyDeclaration(getOriginalNode(prop), constructor)); + addPropertyOrClassStaticBlockStatements(initializerStatements, parameterProperties, receiver); + addPropertyOrClassStaticBlockStatements(initializerStatements, nonParameterProperties, receiver); + } else { + addPropertyOrClassStaticBlockStatements(initializerStatements, properties, receiver); + } + if (constructor == null ? void 0 : constructor.body) { + statementOffset = factory2.copyPrologue( + constructor.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + const superStatementIndices = findSuperStatementIndexPath(constructor.body.statements, statementOffset); + if (superStatementIndices.length) { + transformConstructorBodyWorker( + statements, + constructor.body.statements, + statementOffset, + superStatementIndices, + /*superPathDepth*/ + 0, + initializerStatements, + constructor + ); + } else { + while (statementOffset < constructor.body.statements.length) { + const statement = constructor.body.statements[statementOffset]; + if (isParameterPropertyDeclaration(getOriginalNode(statement), constructor)) { + statementOffset++; + } else { + break; + } + } + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, statementOffset)); + } + } else { + if (needsSyntheticConstructor) { + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [factory2.createSpreadElement(factory2.createIdentifier("arguments"))] + ) + ) + ); + } + addRange(statements, initializerStatements); + } + statements = factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + if (statements.length === 0 && !constructor) { + return void 0; + } + const multiLine = (constructor == null ? void 0 : constructor.body) && constructor.body.statements.length >= statements.length ? constructor.body.multiLine ?? statements.length > 0 : statements.length > 0; + return setTextRange( + factory2.createBlock( + setTextRange( + factory2.createNodeArray(statements), + /*location*/ + constructor ? constructor.body.statements : node.members + ), + multiLine + ), + /*location*/ + constructor ? constructor.body : void 0 + ); + } + function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) { + for (const property2 of properties) { + if (isStatic(property2) && !shouldTransformPrivateElementsOrClassStaticBlocks) { + continue; + } + const statement = transformPropertyOrClassStaticBlock(property2, receiver); + if (!statement) { + continue; + } + statements.push(statement); + } + } + function transformPropertyOrClassStaticBlock(property2, receiver) { + const expression = isClassStaticBlockDeclaration(property2) ? setCurrentClassElementAnd(property2, transformClassStaticBlockDeclaration, property2) : transformProperty(property2, receiver); + if (!expression) { + return void 0; + } + const statement = factory2.createExpressionStatement(expression); + setOriginalNode(statement, property2); + addEmitFlags( + statement, + getEmitFlags(property2) & 3072 + /* NoComments */ + ); + setCommentRange(statement, property2); + const propertyOriginalNode = getOriginalNode(property2); + if (isParameter(propertyOriginalNode)) { + setSourceMapRange(statement, propertyOriginalNode); + removeAllComments(statement); + } else { + setSourceMapRange(statement, moveRangePastModifiers(property2)); + } + setSyntheticLeadingComments(expression, void 0); + setSyntheticTrailingComments(expression, void 0); + if (hasAccessorModifier(propertyOriginalNode)) { + addEmitFlags( + statement, + 3072 + /* NoComments */ + ); + } + return statement; + } + function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) { + const expressions = []; + for (const property2 of propertiesOrClassStaticBlocks) { + const expression = isClassStaticBlockDeclaration(property2) ? setCurrentClassElementAnd(property2, transformClassStaticBlockDeclaration, property2) : setCurrentClassElementAnd( + property2, + () => transformProperty(property2, receiver), + /*arg*/ + void 0 + ); + if (!expression) { + continue; + } + startOnNewLine(expression); + setOriginalNode(expression, property2); + addEmitFlags( + expression, + getEmitFlags(property2) & 3072 + /* NoComments */ + ); + setSourceMapRange(expression, moveRangePastModifiers(property2)); + setCommentRange(expression, property2); + expressions.push(expression); + } + return expressions; + } + function transformProperty(property2, receiver) { + var _a2; + const savedCurrentClassElement = currentClassElement; + const transformed = transformPropertyWorker(property2, receiver); + if (transformed && hasStaticModifier(property2) && ((_a2 = lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) == null ? void 0 : _a2.facts)) { + setOriginalNode(transformed, property2); + addEmitFlags( + transformed, + 4 + /* AdviseOnEmitNode */ + ); + setSourceMapRange(transformed, getSourceMapRange(property2.name)); + lexicalEnvironmentMap.set(getOriginalNode(property2), lexicalEnvironment); + } + currentClassElement = savedCurrentClassElement; + return transformed; + } + function transformPropertyWorker(property2, receiver) { + const emitAssignment = !useDefineForClassFields; + if (isNamedEvaluation(property2, isAnonymousClassNeedingAssignedName)) { + property2 = transformNamedEvaluation(context2, property2); + } + const propertyName = hasAccessorModifier(property2) ? factory2.getGeneratedPrivateNameForNode(property2.name) : isComputedPropertyName(property2.name) && !isSimpleInlineableExpression(property2.name.expression) ? factory2.updateComputedPropertyName(property2.name, factory2.getGeneratedNameForNode(property2.name)) : property2.name; + if (hasStaticModifier(property2)) { + currentClassElement = property2; + } + if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property2)) { + const privateIdentifierInfo = accessPrivateIdentifier2(propertyName); + if (privateIdentifierInfo) { + if (privateIdentifierInfo.kind === "f") { + if (!privateIdentifierInfo.isStatic) { + return createPrivateInstanceFieldInitializer( + factory2, + receiver, + visitNode(property2.initializer, visitor, isExpression), + privateIdentifierInfo.brandCheckIdentifier + ); + } else { + return createPrivateStaticFieldInitializer( + factory2, + privateIdentifierInfo.variableName, + visitNode(property2.initializer, visitor, isExpression) + ); + } + } else { + return void 0; + } + } else { + Debug.fail("Undeclared private name for property declaration."); + } + } + if ((isPrivateIdentifier(propertyName) || hasStaticModifier(property2)) && !property2.initializer) { + return void 0; + } + const propertyOriginalNode = getOriginalNode(property2); + if (hasSyntacticModifier( + propertyOriginalNode, + 64 + /* Abstract */ + )) { + return void 0; + } + let initializer = visitNode(property2.initializer, visitor, isExpression); + if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) { + const localName = factory2.cloneNode(propertyName); + if (initializer) { + if (isParenthesizedExpression(initializer) && isCommaExpression(initializer.expression) && isCallToHelper(initializer.expression.left, "___runInitializers") && isVoidExpression(initializer.expression.right) && isNumericLiteral(initializer.expression.right.expression)) { + initializer = initializer.expression.left; + } + initializer = factory2.inlineExpressions([initializer, localName]); + } else { + initializer = localName; + } + setEmitFlags( + propertyName, + 3072 | 96 + /* NoSourceMap */ + ); + setSourceMapRange(localName, propertyOriginalNode.name); + setEmitFlags( + localName, + 3072 + /* NoComments */ + ); + } else { + initializer ?? (initializer = factory2.createVoidZero()); + } + if (emitAssignment || isPrivateIdentifier(propertyName)) { + const memberAccess = createMemberAccessForPropertyName( + factory2, + receiver, + propertyName, + /*location*/ + propertyName + ); + addEmitFlags( + memberAccess, + 1024 + /* NoLeadingComments */ + ); + const expression = factory2.createAssignment(memberAccess, initializer); + return expression; + } else { + const name2 = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; + const descriptor = factory2.createPropertyDescriptor({ value: initializer, configurable: true, writable: true, enumerable: true }); + return factory2.createObjectDefinePropertyCall(receiver, name2, descriptor); + } + } + function enableSubstitutionForClassAliases() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + classAliases = []; + } + } + function enableSubstitutionForClassStaticThisOrSuperReference() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 110 + /* ThisKeyword */ + ); + context2.enableEmitNotification( + 262 + /* FunctionDeclaration */ + ); + context2.enableEmitNotification( + 218 + /* FunctionExpression */ + ); + context2.enableEmitNotification( + 176 + /* Constructor */ + ); + context2.enableEmitNotification( + 177 + /* GetAccessor */ + ); + context2.enableEmitNotification( + 178 + /* SetAccessor */ + ); + context2.enableEmitNotification( + 174 + /* MethodDeclaration */ + ); + context2.enableEmitNotification( + 172 + /* PropertyDeclaration */ + ); + context2.enableEmitNotification( + 167 + /* ComputedPropertyName */ + ); + } + } + function addInstanceMethodStatements(statements, methods, receiver) { + if (!shouldTransformPrivateElementsOrClassStaticBlocks || !some2(methods)) { + return; + } + const { weakSetName } = getPrivateIdentifierEnvironment().data; + Debug.assert(weakSetName, "weakSetName should be set in private identifier environment"); + statements.push( + factory2.createExpressionStatement( + createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName) + ) + ); + } + function visitInvalidSuperProperty(node) { + return isPropertyAccessExpression(node) ? factory2.updatePropertyAccessExpression( + node, + factory2.createVoidZero(), + node.name + ) : factory2.updateElementAccessExpression( + node, + factory2.createVoidZero(), + visitNode(node.argumentExpression, visitor, isExpression) + ); + } + function getPropertyNameExpressionIfNeeded(name2, shouldHoist) { + if (isComputedPropertyName(name2)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name2); + const expression = visitNode(name2.expression, visitor, isExpression); + const innerExpression = skipPartiallyEmittedExpressions(expression); + const inlinable = isSimpleInlineableExpression(innerExpression); + const alreadyTransformed = !!cacheAssignment || isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left); + if (!alreadyTransformed && !inlinable && shouldHoist) { + const generatedName = factory2.getGeneratedNameForNode(name2); + if (resolver.getNodeCheckFlags(name2) & 32768) { + addBlockScopedVariable(generatedName); + } else { + hoistVariableDeclaration(generatedName); + } + return factory2.createAssignment(generatedName, expression); + } + return inlinable || isIdentifier(innerExpression) ? void 0 : expression; + } + } + function startClassLexicalEnvironment() { + lexicalEnvironment = { previous: lexicalEnvironment, data: void 0 }; + } + function endClassLexicalEnvironment() { + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + } + function getClassLexicalEnvironment() { + Debug.assert(lexicalEnvironment); + return lexicalEnvironment.data ?? (lexicalEnvironment.data = { + facts: 0, + classConstructor: void 0, + classThis: void 0, + superClassReference: void 0 + // privateIdentifierEnvironment: undefined, + }); + } + function getPrivateIdentifierEnvironment() { + Debug.assert(lexicalEnvironment); + return lexicalEnvironment.privateEnv ?? (lexicalEnvironment.privateEnv = newPrivateEnvironment({ + className: void 0, + weakSetName: void 0 + })); + } + function getPendingExpressions() { + return pendingExpressions ?? (pendingExpressions = []); + } + function addPrivateIdentifierClassElementToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo) { + if (isAutoAccessorPropertyDeclaration(node)) { + addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } else if (isPropertyDeclaration(node)) { + addPrivateIdentifierPropertyDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } else if (isMethodDeclaration(node)) { + addPrivateIdentifierMethodDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } else if (isGetAccessorDeclaration(node)) { + addPrivateIdentifierGetAccessorDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } else if (isSetAccessorDeclaration(node)) { + addPrivateIdentifierSetAccessorDeclarationToEnvironment(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } + } + function addPrivateIdentifierPropertyDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic2, isValid2, _previousInfo) { + if (isStatic2) { + const brandCheckIdentifier = Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment"); + const variableName = createHoistedVariableForPrivateName(name2); + setPrivateIdentifier(privateEnv, name2, { + kind: "f", + isStatic: true, + brandCheckIdentifier, + variableName, + isValid: isValid2 + }); + } else { + const weakMapName = createHoistedVariableForPrivateName(name2); + setPrivateIdentifier(privateEnv, name2, { + kind: "f", + isStatic: false, + brandCheckIdentifier: weakMapName, + isValid: isValid2 + }); + getPendingExpressions().push(factory2.createAssignment( + weakMapName, + factory2.createNewExpression( + factory2.createIdentifier("WeakMap"), + /*typeArguments*/ + void 0, + [] + ) + )); + } + } + function addPrivateIdentifierMethodDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic2, isValid2, _previousInfo) { + const methodName = createHoistedVariableForPrivateName(name2); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name2, { + kind: "m", + methodName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid: isValid2 + }); + } + function addPrivateIdentifierGetAccessorDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo) { + const getterName = createHoistedVariableForPrivateName(name2, "_get"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" && previousInfo.isStatic === isStatic2 && !previousInfo.getterName) { + previousInfo.getterName = getterName; + } else { + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName, + setterName: void 0, + brandCheckIdentifier, + isStatic: isStatic2, + isValid: isValid2 + }); + } + } + function addPrivateIdentifierSetAccessorDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo) { + const setterName = createHoistedVariableForPrivateName(name2, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + if ((previousInfo == null ? void 0 : previousInfo.kind) === "a" && previousInfo.isStatic === isStatic2 && !previousInfo.setterName) { + previousInfo.setterName = setterName; + } else { + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName: void 0, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid: isValid2 + }); + } + } + function addPrivateIdentifierAutoAccessorPropertyDeclarationToEnvironment(_node, name2, lex, privateEnv, isStatic2, isValid2, _previousInfo) { + const getterName = createHoistedVariableForPrivateName(name2, "_get"); + const setterName = createHoistedVariableForPrivateName(name2, "_set"); + const brandCheckIdentifier = isStatic2 ? Debug.checkDefined(lex.classThis ?? lex.classConstructor, "classConstructor should be set in private identifier environment") : Debug.checkDefined(privateEnv.data.weakSetName, "weakSetName should be set in private identifier environment"); + setPrivateIdentifier(privateEnv, name2, { + kind: "a", + getterName, + setterName, + brandCheckIdentifier, + isStatic: isStatic2, + isValid: isValid2 + }); + } + function addPrivateIdentifierToEnvironment(node, name2, addDeclaration) { + const lex = getClassLexicalEnvironment(); + const privateEnv = getPrivateIdentifierEnvironment(); + const previousInfo = getPrivateIdentifier(privateEnv, name2); + const isStatic2 = hasStaticModifier(node); + const isValid2 = !isReservedPrivateName(name2) && previousInfo === void 0; + addDeclaration(node, name2, lex, privateEnv, isStatic2, isValid2, previousInfo); + } + function createHoistedVariableForClass(name2, node, suffix) { + const { className } = getPrivateIdentifierEnvironment().data; + const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_"; + const identifier = typeof name2 === "object" ? factory2.getGeneratedNameForNode(name2, 16 | 8, prefix, suffix) : typeof name2 === "string" ? factory2.createUniqueName(name2, 16, prefix, suffix) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0, + /*reservedInNestedScopes*/ + true, + prefix, + suffix + ); + if (resolver.getNodeCheckFlags(node) & 32768) { + addBlockScopedVariable(identifier); + } else { + hoistVariableDeclaration(identifier); + } + return identifier; + } + function createHoistedVariableForPrivateName(name2, suffix) { + const text = tryGetTextOfPropertyName(name2); + return createHoistedVariableForClass((text == null ? void 0 : text.substring(1)) ?? name2, name2, suffix); + } + function accessPrivateIdentifier2(name2) { + const info2 = accessPrivateIdentifier(lexicalEnvironment, name2); + return (info2 == null ? void 0 : info2.kind) === "untransformed" ? void 0 : info2; + } + function wrapPrivateIdentifierForDestructuringTarget(node) { + const parameter = factory2.getGeneratedNameForNode(node); + const info2 = accessPrivateIdentifier2(node.name); + if (!info2) { + return visitEachChild(node, visitor, context2); + } + let receiver = node.expression; + if (isThisProperty(node) || isSuperProperty(node) || !isSimpleCopiableExpression(node.expression)) { + receiver = factory2.createTempVariable( + hoistVariableDeclaration, + /*reservedInNestedScopes*/ + true + ); + getPendingExpressions().push(factory2.createBinaryExpression(receiver, 64, visitNode(node.expression, visitor, isExpression))); + } + return factory2.createAssignmentTargetWrapper( + parameter, + createPrivateIdentifierAssignment( + info2, + receiver, + parameter, + 64 + /* EqualsToken */ + ) + ); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isPrivateIdentifierPropertyAccessExpression(node)) { + return wrapPrivateIdentifierForDestructuringTarget(node); + } else if (shouldTransformSuperInStaticInitializers && currentClassElement && isSuperProperty(node) && isStaticPropertyDeclarationOrClassStaticBlock(currentClassElement) && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data)) { + const { classConstructor, superClassReference, facts } = lexicalEnvironment.data; + if (facts & 1) { + return visitInvalidSuperProperty(node); + } else if (classConstructor && superClassReference) { + const name2 = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (name2) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + return factory2.createAssignmentTargetWrapper( + temp, + factory2.createReflectSetCall( + superClassReference, + name2, + temp, + classConstructor + ) + ); + } + } + } + return visitEachChild(node, visitor, context2); + } + function visitAssignmentElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + const left = visitDestructuringAssignmentTarget(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitDestructuringAssignmentTarget(node); + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context2); + } + function visitArrayAssignmentElement(node) { + if (isArrayBindingOrAssignmentElement(node)) { + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + } + return visitEachChild(node, visitor, context2); + } + function visitAssignmentProperty(node) { + const name2 = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name2, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name2, assignmentElement); + } + return visitEachChild(node, visitor, context2); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node); + } + return visitEachChild(node, visitor, context2); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context2); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context2); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + return factory2.updateArrayLiteralExpression( + node, + visitNodes2(node.elements, visitArrayAssignmentElement, isExpression) + ); + } else { + return factory2.updateObjectLiteralExpression( + node, + visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike) + ); + } + } + function onEmitNode(hint, node, emitCallback) { + const original = getOriginalNode(node); + const lex = lexicalEnvironmentMap.get(original); + if (lex) { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = lex; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = !isClassStaticBlockDeclaration(original) || !(getInternalEmitFlags(original) & 32); + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; + } + switch (node.kind) { + case 218: + if (isArrowFunction(original) || getEmitFlags(node) & 524288) { + break; + } + case 262: + case 176: + case 177: + case 178: + case 174: + case 172: { + const savedLexicalEnvironment = lexicalEnvironment; + const savedPreviousShouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + lexicalEnvironment = void 0; + previousShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + shouldSubstituteThisWithClassThis = false; + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousShouldSubstituteThisWithClassThis = savedPreviousShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; + } + case 167: { + const savedLexicalEnvironment = lexicalEnvironment; + const savedShouldSubstituteThisWithClassThis = shouldSubstituteThisWithClassThis; + lexicalEnvironment = lexicalEnvironment == null ? void 0 : lexicalEnvironment.previous; + shouldSubstituteThisWithClassThis = previousShouldSubstituteThisWithClassThis; + previousOnEmitNode(hint, node, emitCallback); + shouldSubstituteThisWithClassThis = savedShouldSubstituteThisWithClassThis; + lexicalEnvironment = savedLexicalEnvironment; + return; + } + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + case 110: + return substituteThisExpression(node); + } + return node; + } + function substituteThisExpression(node) { + if (enabledSubstitutions & 2 && (lexicalEnvironment == null ? void 0 : lexicalEnvironment.data) && !noSubstitution.has(node)) { + const { facts, classConstructor, classThis } = lexicalEnvironment.data; + const substituteThis = shouldSubstituteThisWithClassThis ? classThis ?? classConstructor : classConstructor; + if (substituteThis) { + return setTextRange( + setOriginalNode( + factory2.cloneNode(substituteThis), + node + ), + node + ); + } + if (facts & 1 && legacyDecorators) { + return factory2.createParenthesizedExpression(factory2.createVoidZero()); + } + } + return node; + } + function substituteExpressionIdentifier(node) { + return trySubstituteClassAlias(node) || node; + } + function trySubstituteClassAlias(node) { + if (enabledSubstitutions & 1) { + if (resolver.getNodeCheckFlags(node) & 536870912) { + const declaration = resolver.getReferencedValueDeclaration(node); + if (declaration) { + const classAlias = classAliases[declaration.id]; + if (classAlias) { + const clone22 = factory2.cloneNode(classAlias); + setSourceMapRange(clone22, node); + setCommentRange(clone22, node); + return clone22; + } + } + } + } + return void 0; + } + } + function createPrivateStaticFieldInitializer(factory2, variableName, initializer) { + return factory2.createAssignment( + variableName, + factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("value", initializer || factory2.createVoidZero()) + ]) + ); + } + function createPrivateInstanceFieldInitializer(factory2, receiver, initializer, weakMapName) { + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(weakMapName, "set"), + /*typeArguments*/ + void 0, + [receiver, initializer || factory2.createVoidZero()] + ); + } + function createPrivateInstanceMethodInitializer(factory2, receiver, weakSetName) { + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(weakSetName, "add"), + /*typeArguments*/ + void 0, + [receiver] + ); + } + function isReservedPrivateName(node) { + return !isGeneratedPrivateIdentifier(node) && node.escapedText === "#constructor"; + } + function isPrivateIdentifierInExpression(node) { + return isPrivateIdentifier(node.left) && node.operatorToken.kind === 103; + } + function isStaticPropertyDeclaration2(node) { + return isPropertyDeclaration(node) && hasStaticModifier(node); + } + function isStaticPropertyDeclarationOrClassStaticBlock(node) { + return isClassStaticBlockDeclaration(node) || isStaticPropertyDeclaration2(node); + } + var init_classFields = __esm2({ + "src/compiler/transformers/classFields.ts"() { + "use strict"; + init_ts2(); + } + }); + function createRuntimeTypeSerializer(context2) { + const { + factory: factory2, + hoistVariableDeclaration + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); + let currentLexicalScope; + let currentNameScope; + return { + serializeTypeNode: (serializerContext, node) => setSerializerContextAnd(serializerContext, serializeTypeNode, node), + serializeTypeOfNode: (serializerContext, node) => setSerializerContextAnd(serializerContext, serializeTypeOfNode, node), + serializeParameterTypesOfNode: (serializerContext, node, container) => setSerializerContextAnd(serializerContext, serializeParameterTypesOfNode, node, container), + serializeReturnTypeOfNode: (serializerContext, node) => setSerializerContextAnd(serializerContext, serializeReturnTypeOfNode, node) + }; + function setSerializerContextAnd(serializerContext, cb, node, arg) { + const savedCurrentLexicalScope = currentLexicalScope; + const savedCurrentNameScope = currentNameScope; + currentLexicalScope = serializerContext.currentLexicalScope; + currentNameScope = serializerContext.currentNameScope; + const result2 = arg === void 0 ? cb(node) : cb(node, arg); + currentLexicalScope = savedCurrentLexicalScope; + currentNameScope = savedCurrentNameScope; + return result2; + } + function getAccessorTypeNode(node) { + const accessors = resolver.getAllAccessorDeclarations(node); + return accessors.setAccessor && getSetAccessorTypeAnnotationNode(accessors.setAccessor) || accessors.getAccessor && getEffectiveReturnTypeNode(accessors.getAccessor); + } + function serializeTypeOfNode(node) { + switch (node.kind) { + case 172: + case 169: + return serializeTypeNode(node.type); + case 178: + case 177: + return serializeTypeNode(getAccessorTypeNode(node)); + case 263: + case 231: + case 174: + return factory2.createIdentifier("Function"); + default: + return factory2.createVoidZero(); + } + } + function serializeParameterTypesOfNode(node, container) { + const valueDeclaration = isClassLike(node) ? getFirstConstructorWithBody(node) : isFunctionLike(node) && nodeIsPresent(node.body) ? node : void 0; + const expressions = []; + if (valueDeclaration) { + const parameters = getParametersOfDecoratedDeclaration(valueDeclaration, container); + const numParameters = parameters.length; + for (let i7 = 0; i7 < numParameters; i7++) { + const parameter = parameters[i7]; + if (i7 === 0 && isIdentifier(parameter.name) && parameter.name.escapedText === "this") { + continue; + } + if (parameter.dotDotDotToken) { + expressions.push(serializeTypeNode(getRestParameterElementType(parameter.type))); + } else { + expressions.push(serializeTypeOfNode(parameter)); + } + } + } + return factory2.createArrayLiteralExpression(expressions); + } + function getParametersOfDecoratedDeclaration(node, container) { + if (container && node.kind === 177) { + const { setAccessor } = getAllAccessorDeclarations(container.members, node); + if (setAccessor) { + return setAccessor.parameters; + } + } + return node.parameters; + } + function serializeReturnTypeOfNode(node) { + if (isFunctionLike(node) && node.type) { + return serializeTypeNode(node.type); + } else if (isAsyncFunction(node)) { + return factory2.createIdentifier("Promise"); + } + return factory2.createVoidZero(); + } + function serializeTypeNode(node) { + if (node === void 0) { + return factory2.createIdentifier("Object"); + } + node = skipTypeParentheses(node); + switch (node.kind) { + case 116: + case 157: + case 146: + return factory2.createVoidZero(); + case 184: + case 185: + return factory2.createIdentifier("Function"); + case 188: + case 189: + return factory2.createIdentifier("Array"); + case 182: + return node.assertsModifier ? factory2.createVoidZero() : factory2.createIdentifier("Boolean"); + case 136: + return factory2.createIdentifier("Boolean"); + case 203: + case 154: + return factory2.createIdentifier("String"); + case 151: + return factory2.createIdentifier("Object"); + case 201: + return serializeLiteralOfLiteralTypeNode(node.literal); + case 150: + return factory2.createIdentifier("Number"); + case 163: + return getGlobalConstructor( + "BigInt", + 7 + /* ES2020 */ + ); + case 155: + return getGlobalConstructor( + "Symbol", + 2 + /* ES2015 */ + ); + case 183: + return serializeTypeReferenceNode(node); + case 193: + return serializeUnionOrIntersectionConstituents( + node.types, + /*isIntersection*/ + true + ); + case 192: + return serializeUnionOrIntersectionConstituents( + node.types, + /*isIntersection*/ + false + ); + case 194: + return serializeUnionOrIntersectionConstituents( + [node.trueType, node.falseType], + /*isIntersection*/ + false + ); + case 198: + if (node.operator === 148) { + return serializeTypeNode(node.type); + } + break; + case 186: + case 199: + case 200: + case 187: + case 133: + case 159: + case 197: + case 205: + break; + case 319: + case 320: + case 324: + case 325: + case 326: + break; + case 321: + case 322: + case 323: + return serializeTypeNode(node.type); + default: + return Debug.failBadSyntaxKind(node); + } + return factory2.createIdentifier("Object"); + } + function serializeLiteralOfLiteralTypeNode(node) { + switch (node.kind) { + case 11: + case 15: + return factory2.createIdentifier("String"); + case 224: { + const operand = node.operand; + switch (operand.kind) { + case 9: + case 10: + return serializeLiteralOfLiteralTypeNode(operand); + default: + return Debug.failBadSyntaxKind(operand); + } + } + case 9: + return factory2.createIdentifier("Number"); + case 10: + return getGlobalConstructor( + "BigInt", + 7 + /* ES2020 */ + ); + case 112: + case 97: + return factory2.createIdentifier("Boolean"); + case 106: + return factory2.createVoidZero(); + default: + return Debug.failBadSyntaxKind(node); + } + } + function serializeUnionOrIntersectionConstituents(types3, isIntersection) { + let serializedType; + for (let typeNode of types3) { + typeNode = skipTypeParentheses(typeNode); + if (typeNode.kind === 146) { + if (isIntersection) + return factory2.createVoidZero(); + continue; + } + if (typeNode.kind === 159) { + if (!isIntersection) + return factory2.createIdentifier("Object"); + continue; + } + if (typeNode.kind === 133) { + return factory2.createIdentifier("Object"); + } + if (!strictNullChecks && (isLiteralTypeNode(typeNode) && typeNode.literal.kind === 106 || typeNode.kind === 157)) { + continue; + } + const serializedConstituent = serializeTypeNode(typeNode); + if (isIdentifier(serializedConstituent) && serializedConstituent.escapedText === "Object") { + return serializedConstituent; + } + if (serializedType) { + if (!equateSerializedTypeNodes(serializedType, serializedConstituent)) { + return factory2.createIdentifier("Object"); + } + } else { + serializedType = serializedConstituent; + } + } + return serializedType ?? factory2.createVoidZero(); + } + function equateSerializedTypeNodes(left, right) { + return ( + // temp vars used in fallback + isGeneratedIdentifier(left) ? isGeneratedIdentifier(right) : ( + // entity names + isIdentifier(left) ? isIdentifier(right) && left.escapedText === right.escapedText : isPropertyAccessExpression(left) ? isPropertyAccessExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) && equateSerializedTypeNodes(left.name, right.name) : ( + // `void 0` + isVoidExpression(left) ? isVoidExpression(right) && isNumericLiteral(left.expression) && left.expression.text === "0" && isNumericLiteral(right.expression) && right.expression.text === "0" : ( + // `"undefined"` or `"function"` in `typeof` checks + isStringLiteral(left) ? isStringLiteral(right) && left.text === right.text : ( + // used in `typeof` checks for fallback + isTypeOfExpression(left) ? isTypeOfExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( + // parens in `typeof` checks with temps + isParenthesizedExpression(left) ? isParenthesizedExpression(right) && equateSerializedTypeNodes(left.expression, right.expression) : ( + // conditionals used in fallback + isConditionalExpression(left) ? isConditionalExpression(right) && equateSerializedTypeNodes(left.condition, right.condition) && equateSerializedTypeNodes(left.whenTrue, right.whenTrue) && equateSerializedTypeNodes(left.whenFalse, right.whenFalse) : ( + // logical binary and assignments used in fallback + isBinaryExpression(left) ? isBinaryExpression(right) && left.operatorToken.kind === right.operatorToken.kind && equateSerializedTypeNodes(left.left, right.left) && equateSerializedTypeNodes(left.right, right.right) : false + ) + ) + ) + ) + ) + ) + ) + ); + } + function serializeTypeReferenceNode(node) { + const kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope ?? currentLexicalScope); + switch (kind) { + case 0: + if (findAncestor(node, (n7) => n7.parent && isConditionalTypeNode(n7.parent) && (n7.parent.trueType === n7 || n7.parent.falseType === n7))) { + return factory2.createIdentifier("Object"); + } + const serialized = serializeEntityNameAsExpressionFallback(node.typeName); + const temp = factory2.createTempVariable(hoistVariableDeclaration); + return factory2.createConditionalExpression( + factory2.createTypeCheck(factory2.createAssignment(temp, serialized), "function"), + /*questionToken*/ + void 0, + temp, + /*colonToken*/ + void 0, + factory2.createIdentifier("Object") + ); + case 1: + return serializeEntityNameAsExpression(node.typeName); + case 2: + return factory2.createVoidZero(); + case 4: + return getGlobalConstructor( + "BigInt", + 7 + /* ES2020 */ + ); + case 6: + return factory2.createIdentifier("Boolean"); + case 3: + return factory2.createIdentifier("Number"); + case 5: + return factory2.createIdentifier("String"); + case 7: + return factory2.createIdentifier("Array"); + case 8: + return getGlobalConstructor( + "Symbol", + 2 + /* ES2015 */ + ); + case 10: + return factory2.createIdentifier("Function"); + case 9: + return factory2.createIdentifier("Promise"); + case 11: + return factory2.createIdentifier("Object"); + default: + return Debug.assertNever(kind); + } + } + function createCheckedValue(left, right) { + return factory2.createLogicalAnd( + factory2.createStrictInequality(factory2.createTypeOfExpression(left), factory2.createStringLiteral("undefined")), + right + ); + } + function serializeEntityNameAsExpressionFallback(node) { + if (node.kind === 80) { + const copied = serializeEntityNameAsExpression(node); + return createCheckedValue(copied, copied); + } + if (node.left.kind === 80) { + return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node)); + } + const left = serializeEntityNameAsExpressionFallback(node.left); + const temp = factory2.createTempVariable(hoistVariableDeclaration); + return factory2.createLogicalAnd( + factory2.createLogicalAnd( + left.left, + factory2.createStrictInequality(factory2.createAssignment(temp, left.right), factory2.createVoidZero()) + ), + factory2.createPropertyAccessExpression(temp, node.right) + ); + } + function serializeEntityNameAsExpression(node) { + switch (node.kind) { + case 80: + const name2 = setParent(setTextRange(parseNodeFactory.cloneNode(node), node), node.parent); + name2.original = void 0; + setParent(name2, getParseTreeNode(currentLexicalScope)); + return name2; + case 166: + return serializeQualifiedNameAsExpression(node); + } + } + function serializeQualifiedNameAsExpression(node) { + return factory2.createPropertyAccessExpression(serializeEntityNameAsExpression(node.left), node.right); + } + function getGlobalConstructorWithFallback(name2) { + return factory2.createConditionalExpression( + factory2.createTypeCheck(factory2.createIdentifier(name2), "function"), + /*questionToken*/ + void 0, + factory2.createIdentifier(name2), + /*colonToken*/ + void 0, + factory2.createIdentifier("Object") + ); + } + function getGlobalConstructor(name2, minLanguageVersion) { + return languageVersion < minLanguageVersion ? getGlobalConstructorWithFallback(name2) : factory2.createIdentifier(name2); + } + } + var init_typeSerializer = __esm2({ + "src/compiler/transformers/typeSerializer.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformLegacyDecorators(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + hoistVariableDeclaration + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + let classAliases; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + const visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function modifierVisitor(node) { + return isDecorator(node) ? void 0 : node; + } + function visitor(node) { + if (!(node.transformFlags & 33554432)) { + return node; + } + switch (node.kind) { + case 170: + return void 0; + case 263: + return visitClassDeclaration(node); + case 231: + return visitClassExpression(node); + case 176: + return visitConstructorDeclaration(node); + case 174: + return visitMethodDeclaration(node); + case 178: + return visitSetAccessorDeclaration(node); + case 177: + return visitGetAccessorDeclaration(node); + case 172: + return visitPropertyDeclaration(node); + case 169: + return visitParameterDeclaration(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitClassDeclaration(node) { + if (!(classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) || childIsDecorated( + /*useLegacyDecorators*/ + true, + node + ))) { + return visitEachChild(node, visitor, context2); + } + const statements = classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + true, + node + ) ? transformClassDeclarationWithClassDecorators(node, node.name) : transformClassDeclarationWithoutClassDecorators(node, node.name); + return singleOrMany(statements); + } + function decoratorContainsPrivateIdentifierInExpression(decorator) { + return !!(decorator.transformFlags & 536870912); + } + function parameterDecoratorsContainPrivateIdentifierInExpression(parameterDecorators) { + return some2(parameterDecorators, decoratorContainsPrivateIdentifierInExpression); + } + function hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node) { + for (const member of node.members) { + if (!canHaveDecorators(member)) + continue; + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); + if (some2(allDecorators == null ? void 0 : allDecorators.decorators, decoratorContainsPrivateIdentifierInExpression)) + return true; + if (some2(allDecorators == null ? void 0 : allDecorators.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) + return true; + } + return false; + } + function transformDecoratorsOfClassElements(node, members) { + let decorationStatements = []; + addClassElementDecorationStatements( + decorationStatements, + node, + /*isStatic*/ + false + ); + addClassElementDecorationStatements( + decorationStatements, + node, + /*isStatic*/ + true + ); + if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) { + members = setTextRange( + factory2.createNodeArray([ + ...members, + factory2.createClassStaticBlockDeclaration( + factory2.createBlock( + decorationStatements, + /*multiLine*/ + true + ) + ) + ]), + members + ); + decorationStatements = void 0; + } + return { decorationStatements, members }; + } + function transformClassDeclarationWithoutClassDecorators(node, name2) { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + let members = visitNodes2(node.members, visitor, isClassElement); + let decorationStatements = []; + ({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members)); + const updated = factory2.updateClassDeclaration( + node, + modifiers, + name2, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + return addRange([updated], decorationStatements); + } + function transformClassDeclarationWithClassDecorators(node, name2) { + const isExport = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + const isDefault = hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + const modifiers = visitNodes2(node.modifiers, (node2) => isExportOrDefaultModifier(node2) || isDecorator(node2) ? void 0 : node2, isModifierLike); + const location2 = moveRangePastModifiers(node); + const classAlias = getClassAliasIfNeeded(node); + const declName = languageVersion < 2 ? factory2.getInternalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + let members = visitNodes2(node.members, visitor, isClassElement); + let decorationStatements = []; + ({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members)); + const assignClassAliasInStaticBlock = languageVersion >= 9 && !!classAlias && some2(members, (member) => isPropertyDeclaration(member) && hasSyntacticModifier( + member, + 256 + /* Static */ + ) || isClassStaticBlockDeclaration(member)); + if (assignClassAliasInStaticBlock) { + members = setTextRange( + factory2.createNodeArray([ + factory2.createClassStaticBlockDeclaration( + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment(classAlias, factory2.createThis()) + ) + ]) + ), + ...members + ]), + members + ); + } + const classExpression = factory2.createClassExpression( + modifiers, + name2 && isGeneratedIdentifier(name2) ? void 0 : name2, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + setOriginalNode(classExpression, node); + setTextRange(classExpression, location2); + const varInitializer = classAlias && !assignClassAliasInStaticBlock ? factory2.createAssignment(classAlias, classExpression) : classExpression; + const varDecl = factory2.createVariableDeclaration( + declName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + varInitializer + ); + setOriginalNode(varDecl, node); + const varDeclList = factory2.createVariableDeclarationList( + [varDecl], + 1 + /* Let */ + ); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + varDeclList + ); + setOriginalNode(varStatement, node); + setTextRange(varStatement, location2); + setCommentRange(varStatement, node); + const statements = [varStatement]; + addRange(statements, decorationStatements); + addConstructorDecorationStatement(statements, node); + if (isExport) { + if (isDefault) { + const exportStatement = factory2.createExportDefault(declName); + statements.push(exportStatement); + } else { + const exportStatement = factory2.createExternalModuleExport(factory2.getDeclarationName(node)); + statements.push(exportStatement); + } + } + return statements; + } + function visitClassExpression(node) { + return factory2.updateClassExpression( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.name, + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) + ); + } + function visitConstructorDeclaration(node) { + return factory2.updateConstructorDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock2) + ); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastModifiers(original)); + } + return updated; + } + function visitMethodDeclaration(node) { + return finishClassElement( + factory2.updateMethodDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.asteriskToken, + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitNode(node.body, visitor, isBlock2) + ), + node + ); + } + function visitGetAccessorDeclaration(node) { + return finishClassElement( + factory2.updateGetAccessorDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitNode(node.body, visitor, isBlock2) + ), + node + ); + } + function visitSetAccessorDeclaration(node) { + return finishClassElement( + factory2.updateSetAccessorDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock2) + ), + node + ); + } + function visitPropertyDeclaration(node) { + if (node.flags & 33554432 || hasSyntacticModifier( + node, + 128 + /* Ambient */ + )) { + return void 0; + } + return finishClassElement( + factory2.updatePropertyDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifier), + Debug.checkDefined(visitNode(node.name, visitor, isPropertyName)), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ), + node + ); + } + function visitParameterDeclaration(node) { + const updated = factory2.updateParameterDeclaration( + node, + elideNodes(factory2, node.modifiers), + node.dotDotDotToken, + Debug.checkDefined(visitNode(node.name, visitor, isBindingName)), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags( + updated.name, + 64 + /* NoTrailingSourceMap */ + ); + } + return updated; + } + function isSyntheticMetadataDecorator(node) { + return isCallToHelper(node.expression, "___metadata"); + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const { false: decorators, true: metadata } = groupBy2(allDecorators.decorators, isSyntheticMetadataDecorator); + const decoratorExpressions = []; + addRange(decoratorExpressions, map4(decorators, transformDecorator)); + addRange(decoratorExpressions, flatMap2(allDecorators.parameters, transformDecoratorsOfParameter)); + addRange(decoratorExpressions, map4(metadata, transformDecorator)); + return decoratorExpressions; + } + function addClassElementDecorationStatements(statements, node, isStatic2) { + addRange(statements, map4(generateClassElementDecorationExpressions(node, isStatic2), (expr) => factory2.createExpressionStatement(expr))); + } + function isDecoratedClassElement(member, isStaticElement, parent22) { + return nodeOrChildIsDecorated( + /*useLegacyDecorators*/ + true, + member, + parent22 + ) && isStaticElement === isStatic(member); + } + function getDecoratedClassElements(node, isStatic2) { + return filter2(node.members, (m7) => isDecoratedClassElement(m7, isStatic2, node)); + } + function generateClassElementDecorationExpressions(node, isStatic2) { + const members = getDecoratedClassElements(node, isStatic2); + let expressions; + for (const member of members) { + expressions = append(expressions, generateClassElementDecorationExpression(node, member)); + } + return expressions; + } + function generateClassElementDecorationExpression(node, member) { + const allDecorators = getAllDecoratorsOfClassElement( + member, + node, + /*useLegacyDecorators*/ + true + ); + const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + const prefix = getClassMemberPrefix(node, member); + const memberName = getExpressionForPropertyName( + member, + /*generateNameForComputedPropertyName*/ + !hasSyntacticModifier( + member, + 128 + /* Ambient */ + ) + ); + const descriptor = languageVersion > 0 ? isPropertyDeclaration(member) && !hasAccessorModifier(member) ? factory2.createVoidZero() : factory2.createNull() : void 0; + const helper = emitHelpers().createDecorateHelper( + decoratorExpressions, + prefix, + memberName, + descriptor + ); + setEmitFlags( + helper, + 3072 + /* NoComments */ + ); + setSourceMapRange(helper, moveRangePastModifiers(member)); + return helper; + } + function addConstructorDecorationStatement(statements, node) { + const expression = generateConstructorDecorationExpression(node); + if (expression) { + statements.push(setOriginalNode(factory2.createExpressionStatement(expression), node)); + } + } + function generateConstructorDecorationExpression(node) { + const allDecorators = getAllDecoratorsOfClass(node); + const decoratorExpressions = transformAllDecoratorsOfDeclaration(allDecorators); + if (!decoratorExpressions) { + return void 0; + } + const classAlias = classAliases && classAliases[getOriginalNodeId(node)]; + const localName = languageVersion < 2 ? factory2.getInternalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ) : factory2.getDeclarationName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + const decorate = emitHelpers().createDecorateHelper(decoratorExpressions, localName); + const expression = factory2.createAssignment(localName, classAlias ? factory2.createAssignment(classAlias, decorate) : decorate); + setEmitFlags( + expression, + 3072 + /* NoComments */ + ); + setSourceMapRange(expression, moveRangePastModifiers(node)); + return expression; + } + function transformDecorator(decorator) { + return Debug.checkDefined(visitNode(decorator.expression, visitor, isExpression)); + } + function transformDecoratorsOfParameter(decorators, parameterOffset) { + let expressions; + if (decorators) { + expressions = []; + for (const decorator of decorators) { + const helper = emitHelpers().createParamHelper( + transformDecorator(decorator), + parameterOffset + ); + setTextRange(helper, decorator.expression); + setEmitFlags( + helper, + 3072 + /* NoComments */ + ); + expressions.push(helper); + } + } + return expressions; + } + function getExpressionForPropertyName(member, generateNameForComputedPropertyName) { + const name2 = member.name; + if (isPrivateIdentifier(name2)) { + return factory2.createIdentifier(""); + } else if (isComputedPropertyName(name2)) { + return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name2.expression) ? factory2.getGeneratedNameForNode(name2) : name2.expression; + } else if (isIdentifier(name2)) { + return factory2.createStringLiteral(idText(name2)); + } else { + return factory2.cloneNode(name2); + } + } + function enableSubstitutionForClassAliases() { + if (!classAliases) { + context2.enableSubstitution( + 80 + /* Identifier */ + ); + classAliases = []; + } + } + function getClassAliasIfNeeded(node) { + if (resolver.getNodeCheckFlags(node) & 262144) { + enableSubstitutionForClassAliases(); + const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default"); + classAliases[getOriginalNodeId(node)] = classAlias; + hoistVariableDeclaration(classAlias); + return classAlias; + } + } + function getClassPrototype(node) { + return factory2.createPropertyAccessExpression(factory2.getDeclarationName(node), "prototype"); + } + function getClassMemberPrefix(node, member) { + return isStatic(member) ? factory2.getDeclarationName(node) : getClassPrototype(node); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + return trySubstituteClassAlias(node) ?? node; + } + function trySubstituteClassAlias(node) { + if (classAliases) { + if (resolver.getNodeCheckFlags(node) & 536870912) { + const declaration = resolver.getReferencedValueDeclaration(node); + if (declaration) { + const classAlias = classAliases[declaration.id]; + if (classAlias) { + const clone22 = factory2.cloneNode(classAlias); + setSourceMapRange(clone22, node); + setCommentRange(clone22, node); + return clone22; + } + } + } + } + return void 0; + } + } + var init_legacyDecorators = __esm2({ + "src/compiler/transformers/legacyDecorators.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformESDecorators(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const languageVersion = getEmitScriptTarget(context2.getCompilerOptions()); + let top; + let classInfo; + let classThis; + let classSuper; + let pendingExpressions; + let shouldTransformPrivateStaticElementsInFile; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + top = void 0; + shouldTransformPrivateStaticElementsInFile = false; + const visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + if (shouldTransformPrivateStaticElementsInFile) { + addInternalEmitFlags( + visited, + 32 + /* TransformPrivateStaticElements */ + ); + shouldTransformPrivateStaticElementsInFile = false; + } + return visited; + } + function updateState() { + classInfo = void 0; + classThis = void 0; + classSuper = void 0; + switch (top == null ? void 0 : top.kind) { + case "class": + classInfo = top.classInfo; + break; + case "class-element": + classInfo = top.next.classInfo; + classThis = top.classThis; + classSuper = top.classSuper; + break; + case "name": + const grandparent = top.next.next.next; + if ((grandparent == null ? void 0 : grandparent.kind) === "class-element") { + classInfo = grandparent.next.classInfo; + classThis = grandparent.classThis; + classSuper = grandparent.classSuper; + } + break; + } + } + function enterClass(classInfo2) { + top = { kind: "class", next: top, classInfo: classInfo2, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + function exitClass() { + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + function enterClassElement(node) { + var _a2, _b; + Debug.assert((top == null ? void 0 : top.kind) === "class", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "class-element", next: top }; + if (isClassStaticBlockDeclaration(node) || isPropertyDeclaration(node) && hasStaticModifier(node)) { + top.classThis = (_a2 = top.next.classInfo) == null ? void 0 : _a2.classThis; + top.classSuper = (_b = top.next.classInfo) == null ? void 0 : _b.classSuper; + } + updateState(); + } + function exitClassElement() { + var _a2; + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + Debug.assert(((_a2 = top.next) == null ? void 0 : _a2.kind) === "class", "Incorrect value for top.next.kind.", () => { + var _a22; + return `Expected top.next.kind to be 'class' but got '${(_a22 = top.next) == null ? void 0 : _a22.kind}' instead.`; + }); + top = top.next; + updateState(); + } + function enterName() { + Debug.assert((top == null ? void 0 : top.kind) === "class-element", "Incorrect value for top.kind.", () => `Expected top.kind to be 'class-element' but got '${top == null ? void 0 : top.kind}' instead.`); + top = { kind: "name", next: top }; + updateState(); + } + function exitName() { + Debug.assert((top == null ? void 0 : top.kind) === "name", "Incorrect value for top.kind.", () => `Expected top.kind to be 'name' but got '${top == null ? void 0 : top.kind}' instead.`); + top = top.next; + updateState(); + } + function enterOther() { + if ((top == null ? void 0 : top.kind) === "other") { + Debug.assert(!pendingExpressions); + top.depth++; + } else { + top = { kind: "other", next: top, depth: 0, savedPendingExpressions: pendingExpressions }; + pendingExpressions = void 0; + updateState(); + } + } + function exitOther() { + Debug.assert((top == null ? void 0 : top.kind) === "other", "Incorrect value for top.kind.", () => `Expected top.kind to be 'other' but got '${top == null ? void 0 : top.kind}' instead.`); + if (top.depth > 0) { + Debug.assert(!pendingExpressions); + top.depth--; + } else { + pendingExpressions = top.savedPendingExpressions; + top = top.next; + updateState(); + } + } + function shouldVisitNode(node) { + return !!(node.transformFlags & 33554432) || !!classThis && !!(node.transformFlags & 16384) || !!classThis && !!classSuper && !!(node.transformFlags & 134217728); + } + function visitor(node) { + if (!shouldVisitNode(node)) { + return node; + } + switch (node.kind) { + case 170: + return Debug.fail("Use `modifierVisitor` instead."); + case 263: + return visitClassDeclaration(node); + case 231: + return visitClassExpression(node); + case 176: + case 172: + case 175: + return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead."); + case 169: + return visitParameterDeclaration(node); + case 226: + return visitBinaryExpression( + node, + /*discarded*/ + false + ); + case 303: + return visitPropertyAssignment(node); + case 260: + return visitVariableDeclaration(node); + case 208: + return visitBindingElement(node); + case 277: + return visitExportAssignment(node); + case 110: + return visitThisExpression(node); + case 248: + return visitForStatement(node); + case 244: + return visitExpressionStatement(node); + case 361: + return visitCommaListExpression( + node, + /*discarded*/ + false + ); + case 217: + return visitParenthesizedExpression( + node, + /*discarded*/ + false + ); + case 360: + return visitPartiallyEmittedExpression( + node, + /*discarded*/ + false + ); + case 213: + return visitCallExpression(node); + case 215: + return visitTaggedTemplateExpression(node); + case 224: + case 225: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + false + ); + case 211: + return visitPropertyAccessExpression(node); + case 212: + return visitElementAccessExpression(node); + case 167: + return visitComputedPropertyName(node); + case 174: + case 178: + case 177: + case 218: + case 262: { + enterOther(); + const result2 = visitEachChild(node, fallbackVisitor, context2); + exitOther(); + return result2; + } + default: + return visitEachChild(node, fallbackVisitor, context2); + } + } + function fallbackVisitor(node) { + switch (node.kind) { + case 170: + return void 0; + default: + return visitor(node); + } + } + function modifierVisitor(node) { + switch (node.kind) { + case 170: + return void 0; + default: + return node; + } + } + function classElementVisitor(node) { + switch (node.kind) { + case 176: + return visitConstructorDeclaration(node); + case 174: + return visitMethodDeclaration(node); + case 177: + return visitGetAccessorDeclaration(node); + case 178: + return visitSetAccessorDeclaration(node); + case 172: + return visitPropertyDeclaration(node); + case 175: + return visitClassStaticBlockDeclaration(node); + default: + return visitor(node); + } + } + function discardedValueVisitor(node) { + switch (node.kind) { + case 224: + case 225: + return visitPreOrPostfixUnaryExpression( + node, + /*discarded*/ + true + ); + case 226: + return visitBinaryExpression( + node, + /*discarded*/ + true + ); + case 361: + return visitCommaListExpression( + node, + /*discarded*/ + true + ); + case 217: + return visitParenthesizedExpression( + node, + /*discarded*/ + true + ); + default: + return visitor(node); + } + } + function getHelperVariableName(node) { + let declarationName = node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name) : node.name && isPrivateIdentifier(node.name) && !isGeneratedIdentifier(node.name) ? idText(node.name).slice(1) : node.name && isStringLiteral(node.name) && isIdentifierText( + node.name.text, + 99 + /* ESNext */ + ) ? node.name.text : isClassLike(node) ? "class" : "member"; + if (isGetAccessor(node)) + declarationName = `get_${declarationName}`; + if (isSetAccessor(node)) + declarationName = `set_${declarationName}`; + if (node.name && isPrivateIdentifier(node.name)) + declarationName = `private_${declarationName}`; + if (isStatic(node)) + declarationName = `static_${declarationName}`; + return "_" + declarationName; + } + function createHelperVariable(node, suffix) { + return factory2.createUniqueName( + `${getHelperVariableName(node)}_${suffix}`, + 16 | 8 + /* ReservedInNestedScopes */ + ); + } + function createLet(name2, initializer) { + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ], + 1 + /* Let */ + ) + ); + } + function createClassInfo(node) { + const metadataReference = factory2.createUniqueName( + "_metadata", + 16 | 32 + /* FileLevel */ + ); + let instanceMethodExtraInitializersName; + let staticMethodExtraInitializersName; + let hasStaticInitializers = false; + let hasNonAmbientInstanceFields = false; + let hasStaticPrivateClassElements = false; + let classThis2; + let pendingStaticInitializers; + let pendingInstanceInitializers; + if (nodeIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + const needsUniqueClassThis = some2(node.members, (member) => (isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)); + classThis2 = factory2.createUniqueName( + "_classThis", + needsUniqueClassThis ? 16 | 8 : 16 | 32 + /* FileLevel */ + ); + } + for (const member of node.members) { + if (isMethodOrAccessor(member) && nodeOrChildIsDecorated( + /*useLegacyDecorators*/ + false, + member, + node + )) { + if (hasStaticModifier(member)) { + if (!staticMethodExtraInitializersName) { + staticMethodExtraInitializersName = factory2.createUniqueName( + "_staticExtraInitializers", + 16 | 32 + /* FileLevel */ + ); + const initializer = emitHelpers().createRunInitializersHelper(classThis2 ?? factory2.createThis(), staticMethodExtraInitializersName); + setSourceMapRange(initializer, node.name ?? moveRangePastDecorators(node)); + pendingStaticInitializers ?? (pendingStaticInitializers = []); + pendingStaticInitializers.push(initializer); + } + } else { + if (!instanceMethodExtraInitializersName) { + instanceMethodExtraInitializersName = factory2.createUniqueName( + "_instanceExtraInitializers", + 16 | 32 + /* FileLevel */ + ); + const initializer = emitHelpers().createRunInitializersHelper(factory2.createThis(), instanceMethodExtraInitializersName); + setSourceMapRange(initializer, node.name ?? moveRangePastDecorators(node)); + pendingInstanceInitializers ?? (pendingInstanceInitializers = []); + pendingInstanceInitializers.push(initializer); + } + instanceMethodExtraInitializersName ?? (instanceMethodExtraInitializersName = factory2.createUniqueName( + "_instanceExtraInitializers", + 16 | 32 + /* FileLevel */ + )); + } + } + if (isClassStaticBlockDeclaration(member)) { + if (!isClassNamedEvaluationHelperBlock(member)) { + hasStaticInitializers = true; + } + } else if (isPropertyDeclaration(member)) { + if (hasStaticModifier(member)) { + hasStaticInitializers || (hasStaticInitializers = !!member.initializer || hasDecorators(member)); + } else { + hasNonAmbientInstanceFields || (hasNonAmbientInstanceFields = !isAmbientPropertyDeclaration(member)); + } + } + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + hasStaticPrivateClassElements = true; + } + if (staticMethodExtraInitializersName && instanceMethodExtraInitializersName && hasStaticInitializers && hasNonAmbientInstanceFields && hasStaticPrivateClassElements) { + break; + } + } + return { + class: node, + classThis: classThis2, + metadataReference, + instanceMethodExtraInitializersName, + staticMethodExtraInitializersName, + hasStaticInitializers, + hasNonAmbientInstanceFields, + hasStaticPrivateClassElements, + pendingStaticInitializers, + pendingInstanceInitializers + }; + } + function transformClassLike(node) { + startLexicalEnvironment(); + if (!classHasDeclaredOrExplicitlyAssignedName(node) && classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + )) { + node = injectClassNamedEvaluationHelperBlockIfMissing(context2, node, factory2.createStringLiteral("")); + } + const classReference = factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + false, + /*ignoreAssignedName*/ + true + ); + const classInfo2 = createClassInfo(node); + const classDefinitionStatements = []; + let leadingBlockStatements; + let trailingBlockStatements; + let syntheticConstructor; + let heritageClauses; + let shouldTransformPrivateStaticElementsInClass = false; + const classDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClass(node)); + if (classDecorators) { + classInfo2.classDecoratorsName = factory2.createUniqueName( + "_classDecorators", + 16 | 32 + /* FileLevel */ + ); + classInfo2.classDescriptorName = factory2.createUniqueName( + "_classDescriptor", + 16 | 32 + /* FileLevel */ + ); + classInfo2.classExtraInitializersName = factory2.createUniqueName( + "_classExtraInitializers", + 16 | 32 + /* FileLevel */ + ); + Debug.assertIsDefined(classInfo2.classThis); + classDefinitionStatements.push( + createLet(classInfo2.classDecoratorsName, factory2.createArrayLiteralExpression(classDecorators)), + createLet(classInfo2.classDescriptorName), + createLet(classInfo2.classExtraInitializersName, factory2.createArrayLiteralExpression()), + createLet(classInfo2.classThis) + ); + if (classInfo2.hasStaticPrivateClassElements) { + shouldTransformPrivateStaticElementsInClass = true; + shouldTransformPrivateStaticElementsInFile = true; + } + } + const extendsClause = getHeritageClause( + node.heritageClauses, + 96 + /* ExtendsKeyword */ + ); + const extendsElement = extendsClause && firstOrUndefined(extendsClause.types); + const extendsExpression = extendsElement && visitNode(extendsElement.expression, visitor, isExpression); + if (extendsExpression) { + classInfo2.classSuper = factory2.createUniqueName( + "_classSuper", + 16 | 32 + /* FileLevel */ + ); + const unwrapped = skipOuterExpressions(extendsExpression); + const safeExtendsExpression = isClassExpression(unwrapped) && !unwrapped.name || isFunctionExpression(unwrapped) && !unwrapped.name || isArrowFunction(unwrapped) ? factory2.createComma(factory2.createNumericLiteral(0), extendsExpression) : extendsExpression; + classDefinitionStatements.push(createLet(classInfo2.classSuper, safeExtendsExpression)); + const updatedExtendsElement = factory2.updateExpressionWithTypeArguments( + extendsElement, + classInfo2.classSuper, + /*typeArguments*/ + void 0 + ); + const updatedExtendsClause = factory2.updateHeritageClause(extendsClause, [updatedExtendsElement]); + heritageClauses = factory2.createNodeArray([updatedExtendsClause]); + } + const renamedClassThis = classInfo2.classThis ?? factory2.createThis(); + enterClass(classInfo2); + leadingBlockStatements = append(leadingBlockStatements, createMetadata(classInfo2.metadataReference, classInfo2.classSuper)); + let members = node.members; + members = visitNodes2(members, (node2) => isConstructorDeclaration(node2) ? node2 : classElementVisitor(node2), isClassElement); + members = visitNodes2(members, (node2) => isConstructorDeclaration(node2) ? classElementVisitor(node2) : node2, isClassElement); + if (pendingExpressions) { + let outerThis; + for (let expression of pendingExpressions) { + expression = visitNode(expression, function thisVisitor(node2) { + if (!(node2.transformFlags & 16384)) { + return node2; + } + switch (node2.kind) { + case 110: + if (!outerThis) { + outerThis = factory2.createUniqueName( + "_outerThis", + 16 + /* Optimistic */ + ); + classDefinitionStatements.unshift(createLet(outerThis, factory2.createThis())); + } + return outerThis; + default: + return visitEachChild(node2, thisVisitor, context2); + } + }, isExpression); + const statement = factory2.createExpressionStatement(expression); + leadingBlockStatements = append(leadingBlockStatements, statement); + } + pendingExpressions = void 0; + } + exitClass(); + if (some2(classInfo2.pendingInstanceInitializers) && !getFirstConstructorWithBody(node)) { + const initializerStatements = prepareConstructor(node, classInfo2); + if (initializerStatements) { + const extendsClauseElement = getEffectiveBaseTypeNode(node); + const isDerivedClass = !!(extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106); + const constructorStatements = []; + if (isDerivedClass) { + const spreadArguments = factory2.createSpreadElement(factory2.createIdentifier("arguments")); + const superCall = factory2.createCallExpression( + factory2.createSuper(), + /*typeArguments*/ + void 0, + [spreadArguments] + ); + constructorStatements.push(factory2.createExpressionStatement(superCall)); + } + addRange(constructorStatements, initializerStatements); + const constructorBody = factory2.createBlock( + constructorStatements, + /*multiLine*/ + true + ); + syntheticConstructor = factory2.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + constructorBody + ); + } + } + if (classInfo2.staticMethodExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.staticMethodExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.instanceMethodExtraInitializersName) { + classDefinitionStatements.push( + createLet(classInfo2.instanceMethodExtraInitializersName, factory2.createArrayLiteralExpression()) + ); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberExtraInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberExtraInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + if (classInfo2.memberInfos) { + forEachEntry(classInfo2.memberInfos, (memberInfo, member) => { + if (!isStatic(member)) { + classDefinitionStatements.push(createLet(memberInfo.memberDecoratorsName)); + if (memberInfo.memberInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberExtraInitializersName) { + classDefinitionStatements.push(createLet(memberInfo.memberExtraInitializersName, factory2.createArrayLiteralExpression())); + } + if (memberInfo.memberDescriptorName) { + classDefinitionStatements.push(createLet(memberInfo.memberDescriptorName)); + } + } + }); + } + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticNonFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.staticFieldDecorationStatements); + leadingBlockStatements = addRange(leadingBlockStatements, classInfo2.nonStaticFieldDecorationStatements); + if (classInfo2.classDescriptorName && classInfo2.classDecoratorsName && classInfo2.classExtraInitializersName && classInfo2.classThis) { + leadingBlockStatements ?? (leadingBlockStatements = []); + const valueProperty = factory2.createPropertyAssignment("value", renamedClassThis); + const classDescriptor = factory2.createObjectLiteralExpression([valueProperty]); + const classDescriptorAssignment = factory2.createAssignment(classInfo2.classDescriptorName, classDescriptor); + const classNameReference = factory2.createPropertyAccessExpression(renamedClassThis, "name"); + const esDecorateHelper2 = emitHelpers().createESDecorateHelper( + factory2.createNull(), + classDescriptorAssignment, + classInfo2.classDecoratorsName, + { kind: "class", name: classNameReference, metadata: classInfo2.metadataReference }, + factory2.createNull(), + classInfo2.classExtraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateHelper2); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(node)); + leadingBlockStatements.push(esDecorateStatement); + const classDescriptorValueReference = factory2.createPropertyAccessExpression(classInfo2.classDescriptorName, "value"); + const classThisAssignment = factory2.createAssignment(classInfo2.classThis, classDescriptorValueReference); + const classReferenceAssignment = factory2.createAssignment(classReference, classThisAssignment); + leadingBlockStatements.push(factory2.createExpressionStatement(classReferenceAssignment)); + } + leadingBlockStatements.push(createSymbolMetadata(renamedClassThis, classInfo2.metadataReference)); + if (some2(classInfo2.pendingStaticInitializers)) { + for (const initializer of classInfo2.pendingStaticInitializers) { + const initializerStatement = factory2.createExpressionStatement(initializer); + setSourceMapRange(initializerStatement, getSourceMapRange(initializer)); + trailingBlockStatements = append(trailingBlockStatements, initializerStatement); + } + classInfo2.pendingStaticInitializers = void 0; + } + if (classInfo2.classExtraInitializersName) { + const runClassInitializersHelper = emitHelpers().createRunInitializersHelper(renamedClassThis, classInfo2.classExtraInitializersName); + const runClassInitializersStatement = factory2.createExpressionStatement(runClassInitializersHelper); + setSourceMapRange(runClassInitializersStatement, node.name ?? moveRangePastDecorators(node)); + trailingBlockStatements = append(trailingBlockStatements, runClassInitializersStatement); + } + if (leadingBlockStatements && trailingBlockStatements && !classInfo2.hasStaticInitializers) { + addRange(leadingBlockStatements, trailingBlockStatements); + trailingBlockStatements = void 0; + } + const leadingStaticBlock = leadingBlockStatements && factory2.createClassStaticBlockDeclaration(factory2.createBlock( + leadingBlockStatements, + /*multiLine*/ + true + )); + if (leadingStaticBlock && shouldTransformPrivateStaticElementsInClass) { + setInternalEmitFlags( + leadingStaticBlock, + 32 + /* TransformPrivateStaticElements */ + ); + } + const trailingStaticBlock = trailingBlockStatements && factory2.createClassStaticBlockDeclaration(factory2.createBlock( + trailingBlockStatements, + /*multiLine*/ + true + )); + if (leadingStaticBlock || syntheticConstructor || trailingStaticBlock) { + const newMembers = []; + const existingNamedEvaluationHelperBlockIndex = members.findIndex(isClassNamedEvaluationHelperBlock); + if (leadingStaticBlock) { + addRange(newMembers, members, 0, existingNamedEvaluationHelperBlockIndex + 1); + newMembers.push(leadingStaticBlock); + addRange(newMembers, members, existingNamedEvaluationHelperBlockIndex + 1); + } else { + addRange(newMembers, members); + } + if (syntheticConstructor) { + newMembers.push(syntheticConstructor); + } + if (trailingStaticBlock) { + newMembers.push(trailingStaticBlock); + } + members = setTextRange(factory2.createNodeArray(newMembers), members); + } + const lexicalEnvironment = endLexicalEnvironment(); + let classExpression; + if (classDecorators) { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + if (classInfo2.classThis) { + classExpression = injectClassThisAssignmentIfMissing(factory2, classExpression, classInfo2.classThis); + } + const classReferenceDeclaration = factory2.createVariableDeclaration( + classReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + classExpression + ); + const classReferenceVarDeclList = factory2.createVariableDeclarationList([classReferenceDeclaration]); + const returnExpr = classInfo2.classThis ? factory2.createAssignment(classReference, classInfo2.classThis) : classReference; + classDefinitionStatements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + classReferenceVarDeclList + ), + factory2.createReturnStatement(returnExpr) + ); + } else { + classExpression = factory2.createClassExpression( + /*modifiers*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + classDefinitionStatements.push(factory2.createReturnStatement(classExpression)); + } + if (shouldTransformPrivateStaticElementsInClass) { + addInternalEmitFlags( + classExpression, + 32 + /* TransformPrivateStaticElements */ + ); + for (const member of classExpression.members) { + if ((isPrivateIdentifierClassElementDeclaration(member) || isAutoAccessorPropertyDeclaration(member)) && hasStaticModifier(member)) { + addInternalEmitFlags( + member, + 32 + /* TransformPrivateStaticElements */ + ); + } + } + } + setOriginalNode(classExpression, node); + return factory2.createImmediatelyInvokedArrowFunction(factory2.mergeLexicalEnvironment(classDefinitionStatements, lexicalEnvironment)); + } + function isDecoratedClassLike(node) { + return classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + node + ) || childIsDecorated( + /*useLegacyDecorators*/ + false, + node + ); + } + function visitClassDeclaration(node) { + if (isDecoratedClassLike(node)) { + const statements = []; + const originalClass = getOriginalNode(node, isClassLike) ?? node; + const className = originalClass.name ? factory2.createStringLiteralFromNode(originalClass.name) : factory2.createStringLiteral("default"); + const isExport = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + const isDefault = hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + if (!node.name) { + node = injectClassNamedEvaluationHelperBlockIfMissing(context2, node, className); + } + if (isExport && isDefault) { + const iife = transformClassLike(node); + if (node.name) { + const varDecl = factory2.createVariableDeclaration( + factory2.getLocalName(node), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + setOriginalNode(varDecl, node); + const varDecls = factory2.createVariableDeclarationList( + [varDecl], + 1 + /* Let */ + ); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + varDecls + ); + statements.push(varStatement); + const exportStatement = factory2.createExportDefault(factory2.getDeclarationName(node)); + setOriginalNode(exportStatement, node); + setCommentRange(exportStatement, getCommentRange(node)); + setSourceMapRange(exportStatement, moveRangePastDecorators(node)); + statements.push(exportStatement); + } else { + const exportStatement = factory2.createExportDefault(iife); + setOriginalNode(exportStatement, node); + setCommentRange(exportStatement, getCommentRange(node)); + setSourceMapRange(exportStatement, moveRangePastDecorators(node)); + statements.push(exportStatement); + } + } else { + Debug.assertIsDefined(node.name, "A class declaration that is not a default export must have a name."); + const iife = transformClassLike(node); + const modifierVisitorNoExport = isExport ? (node2) => isExportModifier(node2) ? void 0 : modifierVisitor(node2) : modifierVisitor; + const modifiers = visitNodes2(node.modifiers, modifierVisitorNoExport, isModifier); + const declName = factory2.getLocalName( + node, + /*allowComments*/ + false, + /*allowSourceMaps*/ + true + ); + const varDecl = factory2.createVariableDeclaration( + declName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + iife + ); + setOriginalNode(varDecl, node); + const varDecls = factory2.createVariableDeclarationList( + [varDecl], + 1 + /* Let */ + ); + const varStatement = factory2.createVariableStatement(modifiers, varDecls); + setOriginalNode(varStatement, node); + setCommentRange(varStatement, getCommentRange(node)); + statements.push(varStatement); + if (isExport) { + const exportStatement = factory2.createExternalModuleExport(declName); + setOriginalNode(exportStatement, node); + statements.push(exportStatement); + } + } + return singleOrMany(statements); + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassDeclaration( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function visitClassExpression(node) { + if (isDecoratedClassLike(node)) { + const iife = transformClassLike(node); + setOriginalNode(iife, node); + return iife; + } else { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const heritageClauses = visitNodes2(node.heritageClauses, visitor, isHeritageClause); + enterClass( + /*classInfo*/ + void 0 + ); + const members = visitNodes2(node.members, classElementVisitor, isClassElement); + exitClass(); + return factory2.updateClassExpression( + node, + modifiers, + node.name, + /*typeParameters*/ + void 0, + heritageClauses, + members + ); + } + } + function prepareConstructor(_parent, classInfo2) { + if (some2(classInfo2.pendingInstanceInitializers)) { + const statements = []; + statements.push( + factory2.createExpressionStatement( + factory2.inlineExpressions(classInfo2.pendingInstanceInitializers) + ) + ); + classInfo2.pendingInstanceInitializers = void 0; + return statements; + } + } + function transformConstructorBodyWorker(statementsOut, statementsIn, statementOffset, superPath, superPathDepth, initializerStatements) { + const superStatementIndex = superPath[superPathDepth]; + const superStatement = statementsIn[superStatementIndex]; + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset, superStatementIndex - statementOffset)); + if (isTryStatement(superStatement)) { + const tryBlockStatements = []; + transformConstructorBodyWorker( + tryBlockStatements, + superStatement.tryBlock.statements, + /*statementOffset*/ + 0, + superPath, + superPathDepth + 1, + initializerStatements + ); + const tryBlockStatementsArray = factory2.createNodeArray(tryBlockStatements); + setTextRange(tryBlockStatementsArray, superStatement.tryBlock.statements); + statementsOut.push(factory2.updateTryStatement( + superStatement, + factory2.updateBlock(superStatement.tryBlock, tryBlockStatements), + visitNode(superStatement.catchClause, visitor, isCatchClause), + visitNode(superStatement.finallyBlock, visitor, isBlock2) + )); + } else { + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex, 1)); + addRange(statementsOut, initializerStatements); + } + addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, superStatementIndex + 1)); + } + function visitConstructorDeclaration(node) { + enterClassElement(node); + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + const parameters = visitNodes2(node.parameters, visitor, isParameter); + let body; + if (node.body && classInfo) { + const initializerStatements = prepareConstructor(classInfo.class, classInfo); + if (initializerStatements) { + const statements = []; + const nonPrologueStart = factory2.copyPrologue( + node.body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + const superStatementIndices = findSuperStatementIndexPath(node.body.statements, nonPrologueStart); + if (superStatementIndices.length > 0) { + transformConstructorBodyWorker(statements, node.body.statements, nonPrologueStart, superStatementIndices, 0, initializerStatements); + } else { + addRange(statements, initializerStatements); + addRange(statements, visitNodes2(node.body.statements, visitor, isStatement)); + } + body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setOriginalNode(body, node.body); + setTextRange(body, node.body); + } + } + body ?? (body = visitNode(node.body, visitor, isBlock2)); + exitClassElement(); + return factory2.updateConstructorDeclaration(node, modifiers, parameters, body); + } + function finishClassElement(updated, original) { + if (updated !== original) { + setCommentRange(updated, original); + setSourceMapRange(updated, moveRangePastDecorators(original)); + } + return updated; + } + function partialTransformClassElement(member, classInfo2, createDescriptor) { + let referencedName; + let name2; + let initializersName; + let extraInitializersName; + let thisArg; + let descriptorName; + if (!classInfo2) { + const modifiers2 = visitNodes2(member.modifiers, modifierVisitor, isModifier); + enterName(); + name2 = visitPropertyName(member.name); + exitName(); + return { modifiers: modifiers2, referencedName, name: name2, initializersName, descriptorName, thisArg }; + } + const memberDecorators = transformAllDecoratorsOfDeclaration(getAllDecoratorsOfClassElement( + member, + classInfo2.class, + /*useLegacyDecorators*/ + false + )); + const modifiers = visitNodes2(member.modifiers, modifierVisitor, isModifier); + if (memberDecorators) { + const memberDecoratorsName = createHelperVariable(member, "decorators"); + const memberDecoratorsArray = factory2.createArrayLiteralExpression(memberDecorators); + const memberDecoratorsAssignment = factory2.createAssignment(memberDecoratorsName, memberDecoratorsArray); + const memberInfo = { memberDecoratorsName }; + classInfo2.memberInfos ?? (classInfo2.memberInfos = /* @__PURE__ */ new Map()); + classInfo2.memberInfos.set(member, memberInfo); + pendingExpressions ?? (pendingExpressions = []); + pendingExpressions.push(memberDecoratorsAssignment); + const statements = isMethodOrAccessor(member) || isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? classInfo2.staticNonFieldDecorationStatements ?? (classInfo2.staticNonFieldDecorationStatements = []) : classInfo2.nonStaticNonFieldDecorationStatements ?? (classInfo2.nonStaticNonFieldDecorationStatements = []) : isPropertyDeclaration(member) && !isAutoAccessorPropertyDeclaration(member) ? isStatic(member) ? classInfo2.staticFieldDecorationStatements ?? (classInfo2.staticFieldDecorationStatements = []) : classInfo2.nonStaticFieldDecorationStatements ?? (classInfo2.nonStaticFieldDecorationStatements = []) : Debug.fail(); + const kind = isGetAccessorDeclaration(member) ? "getter" : isSetAccessorDeclaration(member) ? "setter" : isMethodDeclaration(member) ? "method" : isAutoAccessorPropertyDeclaration(member) ? "accessor" : isPropertyDeclaration(member) ? "field" : Debug.fail(); + let propertyName; + if (isIdentifier(member.name) || isPrivateIdentifier(member.name)) { + propertyName = { computed: false, name: member.name }; + } else if (isPropertyNameLiteral(member.name)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(member.name) }; + } else { + const expression = member.name.expression; + if (isPropertyNameLiteral(expression) && !isIdentifier(expression)) { + propertyName = { computed: true, name: factory2.createStringLiteralFromNode(expression) }; + } else { + enterName(); + ({ referencedName, name: name2 } = visitReferencedPropertyName(member.name)); + propertyName = { computed: true, name: referencedName }; + exitName(); + } + } + const context22 = { + kind, + name: propertyName, + static: isStatic(member), + private: isPrivateIdentifier(member.name), + access: { + // 15.7.3 CreateDecoratorAccessObject (kind, name) + // 2. If _kind_ is ~field~, ~method~, ~accessor~, or ~getter~, then ... + get: isPropertyDeclaration(member) || isGetAccessorDeclaration(member) || isMethodDeclaration(member), + // 3. If _kind_ is ~field~, ~accessor~, or ~setter~, then ... + set: isPropertyDeclaration(member) || isSetAccessorDeclaration(member) + }, + metadata: classInfo2.metadataReference + }; + if (isMethodOrAccessor(member)) { + const methodExtraInitializersName = isStatic(member) ? classInfo2.staticMethodExtraInitializersName : classInfo2.instanceMethodExtraInitializersName; + Debug.assertIsDefined(methodExtraInitializersName); + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && createDescriptor) { + descriptor = createDescriptor(member, visitNodes2(modifiers, (node) => tryCast(node, isAsyncModifier), isModifier)); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper(factory2.createThis(), descriptor ?? factory2.createNull(), memberDecoratorsName, context22, factory2.createNull(), methodExtraInitializersName); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } else if (isPropertyDeclaration(member)) { + initializersName = memberInfo.memberInitializersName ?? (memberInfo.memberInitializersName = createHelperVariable(member, "initializers")); + extraInitializersName = memberInfo.memberExtraInitializersName ?? (memberInfo.memberExtraInitializersName = createHelperVariable(member, "extraInitializers")); + if (isStatic(member)) { + thisArg = classInfo2.classThis; + } + let descriptor; + if (isPrivateIdentifierClassElementDeclaration(member) && hasAccessorModifier(member) && createDescriptor) { + descriptor = createDescriptor( + member, + /*modifiers*/ + void 0 + ); + memberInfo.memberDescriptorName = descriptorName = createHelperVariable(member, "descriptor"); + descriptor = factory2.createAssignment(descriptorName, descriptor); + } + const esDecorateExpression = emitHelpers().createESDecorateHelper( + isAutoAccessorPropertyDeclaration(member) ? factory2.createThis() : factory2.createNull(), + descriptor ?? factory2.createNull(), + memberDecoratorsName, + context22, + initializersName, + extraInitializersName + ); + const esDecorateStatement = factory2.createExpressionStatement(esDecorateExpression); + setSourceMapRange(esDecorateStatement, moveRangePastDecorators(member)); + statements.push(esDecorateStatement); + } + } + if (name2 === void 0) { + enterName(); + name2 = visitPropertyName(member.name); + exitName(); + } + if (!some2(modifiers) && (isMethodDeclaration(member) || isPropertyDeclaration(member))) { + setEmitFlags( + name2, + 1024 + /* NoLeadingComments */ + ); + } + return { modifiers, referencedName, name: name2, initializersName, extraInitializersName, descriptorName, thisArg }; + } + function visitMethodDeclaration(node) { + enterClassElement(node); + const { modifiers, name: name2, descriptorName } = partialTransformClassElement(node, classInfo, createMethodDescriptorObject); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createMethodDescriptorForwarder(modifiers, name2, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock2); + exitClassElement(); + return finishClassElement(factory2.updateMethodDeclaration( + node, + modifiers, + node.asteriskToken, + name2, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitGetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name: name2, descriptorName } = partialTransformClassElement(node, classInfo, createGetAccessorDescriptorObject); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createGetAccessorDescriptorForwarder(modifiers, name2, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock2); + exitClassElement(); + return finishClassElement(factory2.updateGetAccessorDeclaration( + node, + modifiers, + name2, + parameters, + /*type*/ + void 0, + body + ), node); + } + } + function visitSetAccessorDeclaration(node) { + enterClassElement(node); + const { modifiers, name: name2, descriptorName } = partialTransformClassElement(node, classInfo, createSetAccessorDescriptorObject); + if (descriptorName) { + exitClassElement(); + return finishClassElement(createSetAccessorDescriptorForwarder(modifiers, name2, descriptorName), node); + } else { + const parameters = visitNodes2(node.parameters, visitor, isParameter); + const body = visitNode(node.body, visitor, isBlock2); + exitClassElement(); + return finishClassElement(factory2.updateSetAccessorDeclaration(node, modifiers, name2, parameters, body), node); + } + } + function visitClassStaticBlockDeclaration(node) { + enterClassElement(node); + let result2; + if (isClassNamedEvaluationHelperBlock(node)) { + result2 = visitEachChild(node, visitor, context2); + } else if (isClassThisAssignmentBlock(node)) { + const savedClassThis = classThis; + classThis = void 0; + result2 = visitEachChild(node, visitor, context2); + classThis = savedClassThis; + } else { + node = visitEachChild(node, visitor, context2); + result2 = node; + if (classInfo) { + classInfo.hasStaticInitializers = true; + if (some2(classInfo.pendingStaticInitializers)) { + const statements = []; + for (const initializer of classInfo.pendingStaticInitializers) { + const initializerStatement = factory2.createExpressionStatement(initializer); + setSourceMapRange(initializerStatement, getSourceMapRange(initializer)); + statements.push(initializerStatement); + } + const body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + const staticBlock = factory2.createClassStaticBlockDeclaration(body); + result2 = [staticBlock, result2]; + classInfo.pendingStaticInitializers = void 0; + } + } + } + exitClassElement(); + return result2; + } + function visitPropertyDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } + enterClassElement(node); + Debug.assert(!isAmbientPropertyDeclaration(node), "Not yet implemented."); + const { modifiers, name: name2, initializersName, extraInitializersName, descriptorName, thisArg } = partialTransformClassElement(node, classInfo, hasAccessorModifier(node) ? createAccessorPropertyDescriptorObject : void 0); + startLexicalEnvironment(); + let initializer = visitNode(node.initializer, visitor, isExpression); + if (initializersName) { + initializer = emitHelpers().createRunInitializersHelper( + thisArg ?? factory2.createThis(), + initializersName, + initializer ?? factory2.createVoidZero() + ); + } + if (isStatic(node) && classInfo && initializer) { + classInfo.hasStaticInitializers = true; + } + const declarations = endLexicalEnvironment(); + if (some2(declarations)) { + initializer = factory2.createImmediatelyInvokedArrowFunction([ + ...declarations, + factory2.createReturnStatement(initializer) + ]); + } + if (classInfo) { + if (isStatic(node)) { + initializer = injectPendingInitializers( + classInfo, + /*isStatic*/ + true, + initializer + ); + if (extraInitializersName) { + classInfo.pendingStaticInitializers ?? (classInfo.pendingStaticInitializers = []); + classInfo.pendingStaticInitializers.push( + emitHelpers().createRunInitializersHelper( + classInfo.classThis ?? factory2.createThis(), + extraInitializersName + ) + ); + } + } else { + initializer = injectPendingInitializers( + classInfo, + /*isStatic*/ + false, + initializer + ); + if (extraInitializersName) { + classInfo.pendingInstanceInitializers ?? (classInfo.pendingInstanceInitializers = []); + classInfo.pendingInstanceInitializers.push( + emitHelpers().createRunInitializersHelper( + factory2.createThis(), + extraInitializersName + ) + ); + } + } + } + exitClassElement(); + if (hasAccessorModifier(node) && descriptorName) { + const commentRange = getCommentRange(node); + const sourceMapRange = getSourceMapRange(node); + const name22 = node.name; + let getterName = name22; + let setterName = name22; + if (isComputedPropertyName(name22) && !isSimpleInlineableExpression(name22.expression)) { + const cacheAssignment = findComputedPropertyNameCacheAssignment(name22); + if (cacheAssignment) { + getterName = factory2.updateComputedPropertyName(name22, visitNode(name22.expression, visitor, isExpression)); + setterName = factory2.updateComputedPropertyName(name22, cacheAssignment.left); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + setSourceMapRange(temp, name22.expression); + const expression = visitNode(name22.expression, visitor, isExpression); + const assignment = factory2.createAssignment(temp, expression); + setSourceMapRange(assignment, name22.expression); + getterName = factory2.updateComputedPropertyName(name22, assignment); + setterName = factory2.updateComputedPropertyName(name22, temp); + } + } + const modifiersWithoutAccessor = visitNodes2(modifiers, (node2) => node2.kind !== 129 ? node2 : void 0, isModifier); + const backingField = createAccessorPropertyBackingField(factory2, node, modifiersWithoutAccessor, initializer); + setOriginalNode(backingField, node); + setEmitFlags( + backingField, + 3072 + /* NoComments */ + ); + setSourceMapRange(backingField, sourceMapRange); + setSourceMapRange(backingField.name, node.name); + const getter = createGetAccessorDescriptorForwarder(modifiersWithoutAccessor, getterName, descriptorName); + setOriginalNode(getter, node); + setCommentRange(getter, commentRange); + setSourceMapRange(getter, sourceMapRange); + const setter = createSetAccessorDescriptorForwarder(modifiersWithoutAccessor, setterName, descriptorName); + setOriginalNode(setter, node); + setEmitFlags( + setter, + 3072 + /* NoComments */ + ); + setSourceMapRange(setter, sourceMapRange); + return [backingField, getter, setter]; + } + return finishClassElement(factory2.updatePropertyDeclaration( + node, + modifiers, + name2, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node); + } + function visitThisExpression(node) { + return classThis ?? node; + } + function visitCallExpression(node) { + if (isSuperProperty(node.expression) && classThis) { + const expression = visitNode(node.expression, visitor, isExpression); + const argumentsList = visitNodes2(node.arguments, visitor, isExpression); + const invocation = factory2.createFunctionCallCall(expression, classThis, argumentsList); + setOriginalNode(invocation, node); + setTextRange(invocation, node); + return invocation; + } + return visitEachChild(node, visitor, context2); + } + function visitTaggedTemplateExpression(node) { + if (isSuperProperty(node.tag) && classThis) { + const tag = visitNode(node.tag, visitor, isExpression); + const boundTag = factory2.createFunctionBindCall(tag, classThis, []); + setOriginalNode(boundTag, node); + setTextRange(boundTag, node); + const template2 = visitNode(node.template, visitor, isTemplateLiteral); + return factory2.updateTaggedTemplateExpression( + node, + boundTag, + /*typeArguments*/ + void 0, + template2 + ); + } + return visitEachChild(node, visitor, context2); + } + function visitPropertyAccessExpression(node) { + if (isSuperProperty(node) && isIdentifier(node.name) && classThis && classSuper) { + const propertyName = factory2.createStringLiteralFromNode(node.name); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context2); + } + function visitElementAccessExpression(node) { + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = visitNode(node.argumentExpression, visitor, isExpression); + const superProperty = factory2.createReflectGetCall(classSuper, propertyName, classThis); + setOriginalNode(superProperty, node.expression); + setTextRange(superProperty, node.expression); + return superProperty; + } + return visitEachChild(node, visitor, context2); + } + function visitParameterDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } + const updated = factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + visitNode(node.name, visitor, isBindingName), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + if (updated !== node) { + setCommentRange(updated, node); + setTextRange(updated, moveRangePastModifiers(node)); + setSourceMapRange(updated, moveRangePastModifiers(node)); + setEmitFlags( + updated.name, + 64 + /* NoTrailingSourceMap */ + ); + } + return updated; + } + function isAnonymousClassNeedingAssignedName(node) { + return isClassExpression(node) && !node.name && isDecoratedClassLike(node); + } + function canIgnoreEmptyStringLiteralInAssignedName(node) { + const innerExpression = skipOuterExpressions(node); + return isClassExpression(innerExpression) && !innerExpression.name && !classOrConstructorParameterIsDecorated( + /*useLegacyDecorators*/ + false, + innerExpression + ); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, visitor, context2) + ); + } + function visitExpressionStatement(node) { + return visitEachChild(node, discardedValueVisitor, context2); + } + function visitBinaryExpression(node, discarded) { + if (isDestructuringAssignment(node)) { + const left = visitAssignmentPattern(node.left); + const right = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + if (isAssignmentExpression(node)) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.right)); + return visitEachChild(node, visitor, context2); + } + if (isSuperProperty(node.left) && classThis && classSuper) { + let setterName = isElementAccessExpression(node.left) ? visitNode(node.left.argumentExpression, visitor, isExpression) : isIdentifier(node.left.name) ? factory2.createStringLiteralFromNode(node.left.name) : void 0; + if (setterName) { + let expression = visitNode(node.right, visitor, isExpression); + if (isCompoundAssignment(node.operatorToken.kind)) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + const superPropertyGet = factory2.createReflectGetCall( + classSuper, + getterName, + classThis + ); + setOriginalNode(superPropertyGet, node.left); + setTextRange(superPropertyGet, node.left); + expression = factory2.createBinaryExpression( + superPropertyGet, + getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), + expression + ); + setTextRange(expression, node); + } + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + if (temp) { + expression = factory2.createAssignment(temp, expression); + setTextRange(temp, node); + } + expression = factory2.createReflectSetCall( + classSuper, + setterName, + expression, + classThis + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + if (node.operatorToken.kind === 28) { + const left = visitNode(node.left, discardedValueVisitor, isExpression); + const right = visitNode(node.right, discarded ? discardedValueVisitor : visitor, isExpression); + return factory2.updateBinaryExpression(node, left, node.operatorToken, right); + } + return visitEachChild(node, visitor, context2); + } + function visitPreOrPostfixUnaryExpression(node, discarded) { + if (node.operator === 46 || node.operator === 47) { + const operand = skipParentheses(node.operand); + if (isSuperProperty(operand) && classThis && classSuper) { + let setterName = isElementAccessExpression(operand) ? visitNode(operand.argumentExpression, visitor, isExpression) : isIdentifier(operand.name) ? factory2.createStringLiteralFromNode(operand.name) : void 0; + if (setterName) { + let getterName = setterName; + if (!isSimpleInlineableExpression(setterName)) { + getterName = factory2.createTempVariable(hoistVariableDeclaration); + setterName = factory2.createAssignment(getterName, setterName); + } + let expression = factory2.createReflectGetCall(classSuper, getterName, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + const temp = discarded ? void 0 : factory2.createTempVariable(hoistVariableDeclaration); + expression = expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, hoistVariableDeclaration, temp); + expression = factory2.createReflectSetCall(classSuper, setterName, expression, classThis); + setOriginalNode(expression, node); + setTextRange(expression, node); + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + } + return visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, discarded) { + const elements = discarded ? visitCommaListElements(node.elements, discardedValueVisitor) : visitCommaListElements(node.elements, visitor, discardedValueVisitor); + return factory2.updateCommaListExpression(node, elements); + } + function visitReferencedPropertyName(node) { + if (isPropertyNameLiteral(node) || isPrivateIdentifier(node)) { + const referencedName2 = factory2.createStringLiteralFromNode(node); + const name22 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name22 }; + } + if (isPropertyNameLiteral(node.expression) && !isIdentifier(node.expression)) { + const referencedName2 = factory2.createStringLiteralFromNode(node.expression); + const name22 = visitNode(node, visitor, isPropertyName); + return { referencedName: referencedName2, name: name22 }; + } + const referencedName = factory2.getGeneratedNameForNode(node); + hoistVariableDeclaration(referencedName); + const key = emitHelpers().createPropKeyHelper(visitNode(node.expression, visitor, isExpression)); + const assignment = factory2.createAssignment(referencedName, key); + const name2 = factory2.updateComputedPropertyName(node, injectPendingExpressions(assignment)); + return { referencedName, name: name2 }; + } + function visitPropertyName(node) { + if (isComputedPropertyName(node)) { + return visitComputedPropertyName(node); + } + return visitNode(node, visitor, isPropertyName); + } + function visitComputedPropertyName(node) { + let expression = visitNode(node.expression, visitor, isExpression); + if (!isSimpleInlineableExpression(expression)) { + expression = injectPendingExpressions(expression); + } + return factory2.updateComputedPropertyName(node, expression); + } + function visitPropertyAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } + return visitEachChild(node, visitor, context2); + } + function visitVariableDeclaration(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } + return visitEachChild(node, visitor, context2); + } + function visitBindingElement(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.initializer)); + } + return visitEachChild(node, visitor, context2); + } + function visitDestructuringAssignmentTarget(node) { + if (isObjectLiteralExpression(node) || isArrayLiteralExpression(node)) { + return visitAssignmentPattern(node); + } + if (isSuperProperty(node) && classThis && classSuper) { + const propertyName = isElementAccessExpression(node) ? visitNode(node.argumentExpression, visitor, isExpression) : isIdentifier(node.name) ? factory2.createStringLiteralFromNode(node.name) : void 0; + if (propertyName) { + const paramName = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const expression = factory2.createAssignmentTargetWrapper( + paramName, + factory2.createReflectSetCall( + classSuper, + propertyName, + paramName, + classThis + ) + ); + setOriginalNode(expression, node); + setTextRange(expression, node); + return expression; + } + } + return visitEachChild(node, visitor, context2); + } + function visitAssignmentElement(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.right)); + } + const assignmentTarget = visitDestructuringAssignmentTarget(node.left); + const initializer = visitNode(node.right, visitor, isExpression); + return factory2.updateBinaryExpression(node, assignmentTarget, node.operatorToken, initializer); + } else { + return visitDestructuringAssignmentTarget(node); + } + } + function visitAssignmentRestElement(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadElement(node, expression); + } + return visitEachChild(node, visitor, context2); + } + function visitArrayAssignmentElement(node) { + Debug.assertNode(node, isArrayBindingOrAssignmentElement); + if (isSpreadElement(node)) + return visitAssignmentRestElement(node); + if (!isOmittedExpression(node)) + return visitAssignmentElement(node); + return visitEachChild(node, visitor, context2); + } + function visitAssignmentProperty(node) { + const name2 = visitNode(node.name, visitor, isPropertyName); + if (isAssignmentExpression( + node.initializer, + /*excludeCompoundAssignment*/ + true + )) { + const assignmentElement = visitAssignmentElement(node.initializer); + return factory2.updatePropertyAssignment(node, name2, assignmentElement); + } + if (isLeftHandSideExpression(node.initializer)) { + const assignmentElement = visitDestructuringAssignmentTarget(node.initializer); + return factory2.updatePropertyAssignment(node, name2, assignmentElement); + } + return visitEachChild(node, visitor, context2); + } + function visitShorthandAssignmentProperty(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.objectAssignmentInitializer)); + } + return visitEachChild(node, visitor, context2); + } + function visitAssignmentRestProperty(node) { + if (isLeftHandSideExpression(node.expression)) { + const expression = visitDestructuringAssignmentTarget(node.expression); + return factory2.updateSpreadAssignment(node, expression); + } + return visitEachChild(node, visitor, context2); + } + function visitObjectAssignmentElement(node) { + Debug.assertNode(node, isObjectBindingOrAssignmentElement); + if (isSpreadAssignment(node)) + return visitAssignmentRestProperty(node); + if (isShorthandPropertyAssignment(node)) + return visitShorthandAssignmentProperty(node); + if (isPropertyAssignment(node)) + return visitAssignmentProperty(node); + return visitEachChild(node, visitor, context2); + } + function visitAssignmentPattern(node) { + if (isArrayLiteralExpression(node)) { + const elements = visitNodes2(node.elements, visitArrayAssignmentElement, isExpression); + return factory2.updateArrayLiteralExpression(node, elements); + } else { + const properties = visitNodes2(node.properties, visitObjectAssignmentElement, isObjectLiteralElementLike); + return factory2.updateObjectLiteralExpression(node, properties); + } + } + function visitExportAssignment(node) { + if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) { + node = transformNamedEvaluation(context2, node, canIgnoreEmptyStringLiteralInAssignedName(node.expression)); + } + return visitEachChild(node, visitor, context2); + } + function visitParenthesizedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updateParenthesizedExpression(node, expression); + } + function visitPartiallyEmittedExpression(node, discarded) { + const visitorFunc = discarded ? discardedValueVisitor : visitor; + const expression = visitNode(node.expression, visitorFunc, isExpression); + return factory2.updatePartiallyEmittedExpression(node, expression); + } + function injectPendingExpressionsCommon(pendingExpressions2, expression) { + if (some2(pendingExpressions2)) { + if (expression) { + if (isParenthesizedExpression(expression)) { + pendingExpressions2.push(expression.expression); + expression = factory2.updateParenthesizedExpression(expression, factory2.inlineExpressions(pendingExpressions2)); + } else { + pendingExpressions2.push(expression); + expression = factory2.inlineExpressions(pendingExpressions2); + } + } else { + expression = factory2.inlineExpressions(pendingExpressions2); + } + } + return expression; + } + function injectPendingExpressions(expression) { + const result2 = injectPendingExpressionsCommon(pendingExpressions, expression); + Debug.assertIsDefined(result2); + if (result2 !== expression) { + pendingExpressions = void 0; + } + return result2; + } + function injectPendingInitializers(classInfo2, isStatic2, expression) { + const result2 = injectPendingExpressionsCommon(isStatic2 ? classInfo2.pendingStaticInitializers : classInfo2.pendingInstanceInitializers, expression); + if (result2 !== expression) { + if (isStatic2) { + classInfo2.pendingStaticInitializers = void 0; + } else { + classInfo2.pendingInstanceInitializers = void 0; + } + } + return result2; + } + function transformAllDecoratorsOfDeclaration(allDecorators) { + if (!allDecorators) { + return void 0; + } + const decoratorExpressions = []; + addRange(decoratorExpressions, map4(allDecorators.decorators, transformDecorator)); + return decoratorExpressions; + } + function transformDecorator(decorator) { + const expression = visitNode(decorator.expression, visitor, isExpression); + setEmitFlags( + expression, + 3072 + /* NoComments */ + ); + const innerExpression = skipOuterExpressions(expression); + if (isAccessExpression(innerExpression)) { + const { target, thisArg } = factory2.createCallBinding( + expression, + hoistVariableDeclaration, + languageVersion, + /*cacheIdentifiers*/ + true + ); + return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, [])); + } + return expression; + } + function createDescriptorMethod(original, name2, modifiers, asteriskToken, kind, parameters, body) { + const func = factory2.createFunctionExpression( + modifiers, + asteriskToken, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body ?? factory2.createBlock([]) + ); + setOriginalNode(func, original); + setSourceMapRange(func, moveRangePastDecorators(original)); + setEmitFlags( + func, + 3072 + /* NoComments */ + ); + const prefix = kind === "get" || kind === "set" ? kind : void 0; + const functionName = factory2.createStringLiteralFromNode( + name2, + /*isSingleQuote*/ + void 0 + ); + const namedFunction = emitHelpers().createSetFunctionNameHelper(func, functionName, prefix); + const method2 = factory2.createPropertyAssignment(factory2.createIdentifier(kind), namedFunction); + setOriginalNode(method2, original); + setSourceMapRange(method2, moveRangePastDecorators(original)); + setEmitFlags( + method2, + 3072 + /* NoComments */ + ); + return method2; + } + function createMethodDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + node.asteriskToken, + "value", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock2) + ) + ]); + } + function createGetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + visitNode(node.body, visitor, isBlock2) + ) + ]); + } + function createSetAccessorDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + visitNodes2(node.parameters, visitor, isParameter), + visitNode(node.body, visitor, isBlock2) + ) + ]); + } + function createAccessorPropertyDescriptorObject(node, modifiers) { + return factory2.createObjectLiteralExpression([ + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "get", + [], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ) + ) + ]) + ), + createDescriptorMethod( + node, + node.name, + modifiers, + /*asteriskToken*/ + void 0, + "set", + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createThis(), + factory2.getGeneratedPrivateNameForNode(node.name) + ), + factory2.createIdentifier("value") + ) + ) + ]) + ) + ]); + } + function createMethodDescriptorForwarder(modifiers, name2, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name2, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("value") + ) + ) + ]) + ); + } + function createGetAccessorDescriptorForwarder(modifiers, name2, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createGetAccessorDeclaration( + modifiers, + name2, + [], + /*type*/ + void 0, + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("get") + ), + factory2.createThis(), + [] + ) + ) + ]) + ); + } + function createSetAccessorDescriptorForwarder(modifiers, name2, descriptorName) { + modifiers = visitNodes2(modifiers, (node) => isStaticModifier(node) ? node : void 0, isModifier); + return factory2.createSetAccessorDeclaration( + modifiers, + name2, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + )], + factory2.createBlock([ + factory2.createReturnStatement( + factory2.createFunctionCallCall( + factory2.createPropertyAccessExpression( + descriptorName, + factory2.createIdentifier("set") + ), + factory2.createThis(), + [factory2.createIdentifier("value")] + ) + ) + ]) + ); + } + function createMetadata(name2, classSuper2) { + const varDecl = factory2.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createConditionalExpression( + factory2.createLogicalAnd( + factory2.createTypeCheck(factory2.createIdentifier("Symbol"), "function"), + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata") + ), + factory2.createToken( + 58 + /* QuestionToken */ + ), + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "create"), + /*typeArguments*/ + void 0, + [classSuper2 ? createSymbolMetadataReference(classSuper2) : factory2.createNull()] + ), + factory2.createToken( + 59 + /* ColonToken */ + ), + factory2.createVoidZero() + ) + ); + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [varDecl], + 2 + /* Const */ + ) + ); + } + function createSymbolMetadata(target, value2) { + const defineProperty2 = factory2.createObjectDefinePropertyCall( + target, + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata"), + factory2.createPropertyDescriptor( + { configurable: true, writable: true, enumerable: true, value: value2 }, + /*singleLine*/ + true + ) + ); + return setEmitFlags( + factory2.createIfStatement(value2, factory2.createExpressionStatement(defineProperty2)), + 1 + /* SingleLine */ + ); + } + function createSymbolMetadataReference(classSuper2) { + return factory2.createBinaryExpression( + factory2.createElementAccessExpression( + classSuper2, + factory2.createPropertyAccessExpression(factory2.createIdentifier("Symbol"), "metadata") + ), + 61, + factory2.createNull() + ); + } + } + var init_esDecorators = __esm2({ + "src/compiler/transformers/esDecorators.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES2017(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + resumeLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + let enabledSubstitutions; + let enclosingSuperContainerFlags = 0; + let enclosingFunctionParameterNames; + let capturedSuperProperties; + let hasSuperElementAccess; + let lexicalArgumentsBinding; + const substitutedSuperAccessors = []; + let contextFlags = 0; + const previousOnEmitNode = context2.onEmitNode; + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + setContextFlag(1, false); + setContextFlag(2, !isEffectiveStrictModeSourceFile(node, compilerOptions)); + const visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function setContextFlag(flag, val) { + contextFlags = val ? contextFlags | flag : contextFlags & ~flag; + } + function inContext(flags) { + return (contextFlags & flags) !== 0; + } + function inTopLevelContext() { + return !inContext( + 1 + /* NonTopLevel */ + ); + } + function inHasLexicalThisContext() { + return inContext( + 2 + /* HasLexicalThis */ + ); + } + function doWithContext(flags, cb, value2) { + const contextFlagsToSet = flags & ~contextFlags; + if (contextFlagsToSet) { + setContextFlag( + contextFlagsToSet, + /*val*/ + true + ); + const result2 = cb(value2); + setContextFlag( + contextFlagsToSet, + /*val*/ + false + ); + return result2; + } + return cb(value2); + } + function visitDefault(node) { + return visitEachChild(node, visitor, context2); + } + function argumentsVisitor(node) { + switch (node.kind) { + case 218: + case 262: + case 174: + case 177: + case 178: + case 176: + return node; + case 169: + case 208: + case 260: + break; + case 80: + if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) { + return lexicalArgumentsBinding; + } + break; + } + return visitEachChild(node, argumentsVisitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 256) === 0) { + return lexicalArgumentsBinding ? argumentsVisitor(node) : node; + } + switch (node.kind) { + case 134: + return void 0; + case 223: + return visitAwaitExpression(node); + case 174: + return doWithContext(1 | 2, visitMethodDeclaration, node); + case 262: + return doWithContext(1 | 2, visitFunctionDeclaration, node); + case 218: + return doWithContext(1 | 2, visitFunctionExpression, node); + case 219: + return doWithContext(1, visitArrowFunction, node); + case 211: + if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108) { + capturedSuperProperties.add(node.name.escapedText); + } + return visitEachChild(node, visitor, context2); + case 212: + if (capturedSuperProperties && node.expression.kind === 108) { + hasSuperElementAccess = true; + } + return visitEachChild(node, visitor, context2); + case 177: + return doWithContext(1 | 2, visitGetAccessorDeclaration, node); + case 178: + return doWithContext(1 | 2, visitSetAccessorDeclaration, node); + case 176: + return doWithContext(1 | 2, visitConstructorDeclaration, node); + case 263: + case 231: + return doWithContext(1 | 2, visitDefault, node); + default: + return visitEachChild(node, visitor, context2); + } + } + function asyncBodyVisitor(node) { + if (isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 243: + return visitVariableStatementInAsyncBody(node); + case 248: + return visitForStatementInAsyncBody(node); + case 249: + return visitForInStatementInAsyncBody(node); + case 250: + return visitForOfStatementInAsyncBody(node); + case 299: + return visitCatchClauseInAsyncBody(node); + case 241: + case 255: + case 269: + case 296: + case 297: + case 258: + case 246: + case 247: + case 245: + case 254: + case 256: + return visitEachChild(node, asyncBodyVisitor, context2); + default: + return Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + const catchClauseNames = /* @__PURE__ */ new Set(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + let catchClauseUnshadowedNames; + catchClauseNames.forEach((_6, escapedName) => { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = new Set(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + const result2 = visitEachChild(node, asyncBodyVisitor, context2); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result2; + } else { + return visitEachChild(node, asyncBodyVisitor, context2); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + const expression = visitVariableDeclarationListWithCollidingNames( + node.declarationList, + /*hasReceiver*/ + false + ); + return expression ? factory2.createExpressionStatement(expression) : void 0; + } + return visitEachChild(node, visitor, context2); + } + function visitForInStatementInAsyncBody(node) { + return factory2.updateForInStatement( + node, + isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( + node.initializer, + /*hasReceiver*/ + true + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + visitIterationBody(node.statement, asyncBodyVisitor, context2) + ); + } + function visitForOfStatementInAsyncBody(node) { + return factory2.updateForOfStatement( + node, + visitNode(node.awaitModifier, visitor, isAwaitKeyword), + isVariableDeclarationListWithCollidingName(node.initializer) ? visitVariableDeclarationListWithCollidingNames( + node.initializer, + /*hasReceiver*/ + true + ) : Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + visitIterationBody(node.statement, asyncBodyVisitor, context2) + ); + } + function visitForStatementInAsyncBody(node) { + const initializer = node.initializer; + return factory2.updateForStatement( + node, + isVariableDeclarationListWithCollidingName(initializer) ? visitVariableDeclarationListWithCollidingNames( + initializer, + /*hasReceiver*/ + false + ) : visitNode(node.initializer, visitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, visitor, isExpression), + visitIterationBody(node.statement, asyncBodyVisitor, context2) + ); + } + function visitAwaitExpression(node) { + if (inTopLevelContext()) { + return visitEachChild(node, visitor, context2); + } + return setOriginalNode( + setTextRange( + factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + visitNode(node.expression, visitor, isExpression) + ), + node + ), + node + ); + } + function visitConstructorDeclaration(node) { + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const updated = factory2.updateConstructorDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifier), + visitParameterList(node.parameters, visitor, context2), + transformMethodBody(node) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitMethodDeclaration(node) { + let parameters; + const functionFlags = getFunctionFlags(node); + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const updated = factory2.updateMethodDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifierLike), + node.asteriskToken, + node.name, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters = functionFlags & 2 ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + functionFlags & 2 ? transformAsyncFunctionBody(node, parameters) : transformMethodBody(node) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitGetAccessorDeclaration(node) { + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const updated = factory2.updateGetAccessorDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifierLike), + node.name, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformMethodBody(node) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitSetAccessorDeclaration(node) { + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const updated = factory2.updateSetAccessorDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifierLike), + node.name, + visitParameterList(node.parameters, visitor, context2), + transformMethodBody(node) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitFunctionDeclaration(node) { + let parameters; + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const functionFlags = getFunctionFlags(node); + const updated = factory2.updateFunctionDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifierLike), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + parameters = functionFlags & 2 ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + functionFlags & 2 ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context2) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitFunctionExpression(node) { + let parameters; + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + lexicalArgumentsBinding = void 0; + const functionFlags = getFunctionFlags(node); + const updated = factory2.updateFunctionExpression( + node, + visitNodes2(node.modifiers, visitor, isModifier), + node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + parameters = functionFlags & 2 ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + functionFlags & 2 ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context2) + ); + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + return updated; + } + function visitArrowFunction(node) { + let parameters; + const functionFlags = getFunctionFlags(node); + return factory2.updateArrowFunction( + node, + visitNodes2(node.modifiers, visitor, isModifier), + /*typeParameters*/ + void 0, + parameters = functionFlags & 2 ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + functionFlags & 2 ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context2) + ); + } + function recordDeclarationName({ name: name2 }, names) { + if (isIdentifier(name2)) { + names.add(name2.escapedText); + } else { + for (const element of name2.elements) { + if (!isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return !!node && isVariableDeclarationList(node) && !(node.flags & 7) && node.declarations.some(collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + const variables = getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return visitNode(factory2.converters.convertToAssignmentElementTarget(node.declarations[0].name), visitor, isExpression); + } + return void 0; + } + return factory2.inlineExpressions(map4(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + forEach4(node.declarations, hoistVariable); + } + function hoistVariable({ name: name2 }) { + if (isIdentifier(name2)) { + hoistVariableDeclaration(name2); + } else { + for (const element of name2.elements) { + if (!isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + const converted = setSourceMapRange( + factory2.createAssignment( + factory2.converters.convertToAssignmentElementTarget(node.name), + node.initializer + ), + node + ); + return Debug.checkDefined(visitNode(converted, visitor, isExpression)); + } + function collidesWithParameterName({ name: name2 }) { + if (isIdentifier(name2)) { + return enclosingFunctionParameterNames.has(name2.escapedText); + } else { + for (const element of name2.elements) { + if (!isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } + function transformMethodBody(node) { + Debug.assertIsDefined(node.body); + const savedCapturedSuperProperties = capturedSuperProperties; + const savedHasSuperElementAccess = hasSuperElementAccess; + capturedSuperProperties = /* @__PURE__ */ new Set(); + hasSuperElementAccess = false; + let updated = visitFunctionBody(node.body, visitor, context2); + const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration); + const emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (256 | 128) && (getFunctionFlags(originalMethod) & 3) !== 3; + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + if (capturedSuperProperties.size) { + const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[getNodeId(variableStatement)] = true; + const statements = updated.statements.slice(); + insertStatementsAfterStandardPrologue(statements, [variableStatement]); + updated = factory2.updateBlock(updated, statements); + } + if (hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 256) { + addEmitHelper(updated, advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 128) { + addEmitHelper(updated, asyncSuperHelper); + } + } + } + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + return updated; + } + function createCaptureArgumentsStatement() { + Debug.assert(lexicalArgumentsBinding); + const variable = factory2.createVariableDeclaration( + lexicalArgumentsBinding, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createIdentifier("arguments") + ); + const statement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + [variable] + ); + startOnNewLine(statement); + addEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + return statement; + } + function transformAsyncFunctionParameterList(node) { + if (isSimpleParameterList(node.parameters)) { + return visitParameterList(node.parameters, visitor, context2); + } + const newParameters = []; + for (const parameter of node.parameters) { + if (parameter.initializer || parameter.dotDotDotToken) { + if (node.kind === 219) { + const restParameter = factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + factory2.createToken( + 26 + /* DotDotDotToken */ + ), + factory2.createUniqueName( + "args", + 8 + /* ReservedInNestedScopes */ + ) + ); + newParameters.push(restParameter); + } + break; + } + const newParameter = factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.getGeneratedNameForNode( + parameter.name, + 8 + /* ReservedInNestedScopes */ + ) + ); + newParameters.push(newParameter); + } + const newParametersArray = factory2.createNodeArray(newParameters); + setTextRange(newParametersArray, node.parameters); + return newParametersArray; + } + function transformAsyncFunctionBody(node, outerParameters) { + const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context2) : void 0; + resumeLexicalEnvironment(); + const original = getOriginalNode(node, isFunctionLike); + const nodeType = original.type; + const promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : void 0; + const isArrowFunction2 = node.kind === 219; + const savedLexicalArgumentsBinding = lexicalArgumentsBinding; + const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512) !== 0; + const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding; + if (captureLexicalArguments) { + lexicalArgumentsBinding = factory2.createUniqueName("arguments"); + } + let argumentsExpression; + if (innerParameters) { + if (isArrowFunction2) { + const parameterBindings = []; + Debug.assert(outerParameters.length <= node.parameters.length); + for (let i7 = 0; i7 < node.parameters.length; i7++) { + Debug.assert(i7 < outerParameters.length); + const originalParameter = node.parameters[i7]; + const outerParameter = outerParameters[i7]; + Debug.assertNode(outerParameter.name, isIdentifier); + if (originalParameter.initializer || originalParameter.dotDotDotToken) { + Debug.assert(i7 === outerParameters.length - 1); + parameterBindings.push(factory2.createSpreadElement(outerParameter.name)); + break; + } + parameterBindings.push(outerParameter.name); + } + argumentsExpression = factory2.createArrayLiteralExpression(parameterBindings); + } else { + argumentsExpression = factory2.createIdentifier("arguments"); + } + } + const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = /* @__PURE__ */ new Set(); + for (const parameter of node.parameters) { + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + const savedCapturedSuperProperties = capturedSuperProperties; + const savedHasSuperElementAccess = hasSuperElementAccess; + if (!isArrowFunction2) { + capturedSuperProperties = /* @__PURE__ */ new Set(); + hasSuperElementAccess = false; + } + const hasLexicalThis = inHasLexicalThisContext(); + let asyncBody = transformAsyncFunctionBodyWorker(node.body); + asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, endLexicalEnvironment())); + let result2; + if (!isArrowFunction2) { + const statements = []; + statements.push( + factory2.createReturnStatement( + emitHelpers().createAwaiterHelper( + hasLexicalThis, + argumentsExpression, + promiseConstructor, + innerParameters, + asyncBody + ) + ) + ); + const emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (256 | 128); + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + if (capturedSuperProperties.size) { + const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[getNodeId(variableStatement)] = true; + insertStatementsAfterStandardPrologue(statements, [variableStatement]); + } + } + if (captureLexicalArguments) { + insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]); + } + const block = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + setTextRange(block, node.body); + if (emitSuperHelpers && hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 256) { + addEmitHelper(block, advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 128) { + addEmitHelper(block, asyncSuperHelper); + } + } + result2 = block; + } else { + result2 = emitHelpers().createAwaiterHelper( + hasLexicalThis, + argumentsExpression, + promiseConstructor, + innerParameters, + asyncBody + ); + if (captureLexicalArguments) { + const block = factory2.converters.convertToFunctionBlock(result2); + result2 = factory2.updateBlock(block, factory2.mergeLexicalEnvironment(block.statements, [createCaptureArgumentsStatement()])); + } + } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + if (!isArrowFunction2) { + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + lexicalArgumentsBinding = savedLexicalArgumentsBinding; + } + return result2; + } + function transformAsyncFunctionBodyWorker(body, start) { + if (isBlock2(body)) { + return factory2.updateBlock(body, visitNodes2(body.statements, asyncBodyVisitor, isStatement, start)); + } else { + return factory2.converters.convertToFunctionBlock(Debug.checkDefined(visitNode(body, asyncBodyVisitor, isConciseBody))); + } + } + function getPromiseConstructor(type3) { + const typeName = type3 && getEntityNameFromTypeNode(type3); + if (typeName && isEntityName(typeName)) { + const serializationKind = resolver.getTypeReferenceSerializationKind(typeName); + if (serializationKind === 1 || serializationKind === 0) { + return typeName; + } + } + return void 0; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 213 + /* CallExpression */ + ); + context2.enableSubstitution( + 211 + /* PropertyAccessExpression */ + ); + context2.enableSubstitution( + 212 + /* ElementAccessExpression */ + ); + context2.enableEmitNotification( + 263 + /* ClassDeclaration */ + ); + context2.enableEmitNotification( + 174 + /* MethodDeclaration */ + ); + context2.enableEmitNotification( + 177 + /* GetAccessor */ + ); + context2.enableEmitNotification( + 178 + /* SetAccessor */ + ); + context2.enableEmitNotification( + 176 + /* Constructor */ + ); + context2.enableEmitNotification( + 243 + /* VariableStatement */ + ); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 | 256); + if (superContainerFlags !== enclosingSuperContainerFlags) { + const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) { + const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = 0; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 211: + return substitutePropertyAccessExpression(node); + case 212: + return substituteElementAccessExpression(node); + case 213: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 108) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.createUniqueName( + "_super", + 16 | 32 + /* FileLevel */ + ), + node.name + ), + node + ); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 108) { + return createSuperElementAccessInAsyncMethod( + node.argumentExpression, + node + ); + } + return node; + } + function substituteCallExpression(node) { + const expression = node.expression; + if (isSuperProperty(expression)) { + const argumentExpression = isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(argumentExpression, "call"), + /*typeArguments*/ + void 0, + [ + factory2.createThis(), + ...node.arguments + ] + ); + } + return node; + } + function isSuperContainer(node) { + const kind = node.kind; + return kind === 263 || kind === 176 || kind === 174 || kind === 177 || kind === 178; + } + function createSuperElementAccessInAsyncMethod(argumentExpression, location2) { + if (enclosingSuperContainerFlags & 256) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.createCallExpression( + factory2.createUniqueName( + "_superIndex", + 16 | 32 + /* FileLevel */ + ), + /*typeArguments*/ + void 0, + [argumentExpression] + ), + "value" + ), + location2 + ); + } else { + return setTextRange( + factory2.createCallExpression( + factory2.createUniqueName( + "_superIndex", + 16 | 32 + /* FileLevel */ + ), + /*typeArguments*/ + void 0, + [argumentExpression] + ), + location2 + ); + } + } + } + function createSuperAccessVariableStatement(factory2, resolver, node, names) { + const hasBinding = (resolver.getNodeCheckFlags(node) & 256) !== 0; + const accessors = []; + names.forEach((_6, key) => { + const name2 = unescapeLeadingUnderscores(key); + const getterAndSetter = []; + getterAndSetter.push(factory2.createPropertyAssignment( + "get", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /* parameters */ + [], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + setEmitFlags( + factory2.createPropertyAccessExpression( + setEmitFlags( + factory2.createSuper(), + 8 + /* NoSubstitution */ + ), + name2 + ), + 8 + /* NoSubstitution */ + ) + ) + )); + if (hasBinding) { + getterAndSetter.push( + factory2.createPropertyAssignment( + "set", + factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /* parameters */ + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "v", + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ) + ], + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + factory2.createAssignment( + setEmitFlags( + factory2.createPropertyAccessExpression( + setEmitFlags( + factory2.createSuper(), + 8 + /* NoSubstitution */ + ), + name2 + ), + 8 + /* NoSubstitution */ + ), + factory2.createIdentifier("v") + ) + ) + ) + ); + } + accessors.push( + factory2.createPropertyAssignment( + name2, + factory2.createObjectLiteralExpression(getterAndSetter) + ) + ); + }); + return factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + factory2.createUniqueName( + "_super", + 16 | 32 + /* FileLevel */ + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createCallExpression( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("Object"), + "create" + ), + /*typeArguments*/ + void 0, + [ + factory2.createNull(), + factory2.createObjectLiteralExpression( + accessors, + /*multiLine*/ + true + ) + ] + ) + ) + ], + 2 + /* Const */ + ) + ); + } + var init_es2017 = __esm2({ + "src/compiler/transformers/es2017.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES2018(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + resumeLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + let exportedVariableStatement = false; + let enabledSubstitutions; + let enclosingFunctionFlags; + let parametersWithPrecedingObjectRestOrSpread; + let enclosingSuperContainerFlags = 0; + let hierarchyFacts = 0; + let currentSourceFile; + let taggedTemplateStringDeclarations; + let capturedSuperProperties; + let hasSuperElementAccess; + const substitutedSuperAccessors = []; + return chainBundle(context2, transformSourceFile); + function affectsSubtree(excludeFacts, includeFacts) { + return hierarchyFacts !== (hierarchyFacts & ~excludeFacts | includeFacts); + } + function enterSubtree(excludeFacts, includeFacts) { + const ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 3; + return ancestorFacts; + } + function exitSubtree(ancestorFacts) { + hierarchyFacts = ancestorFacts; + } + function recordTaggedTemplateString(temp) { + taggedTemplateStringDeclarations = append( + taggedTemplateStringDeclarations, + factory2.createVariableDeclaration(temp) + ); + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + const visited = visitSourceFile(node); + addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + taggedTemplateStringDeclarations = void 0; + return visited; + } + function visitor(node) { + return visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + } + function visitorWithUnusedExpressionResult(node) { + return visitorWorker( + node, + /*expressionResultIsUnused*/ + true + ); + } + function visitorNoAsyncModifier(node) { + if (node.kind === 134) { + return void 0; + } + return node; + } + function doWithHierarchyFacts(cb, value2, excludeFacts, includeFacts) { + if (affectsSubtree(excludeFacts, includeFacts)) { + const ancestorFacts = enterSubtree(excludeFacts, includeFacts); + const result2 = cb(value2); + exitSubtree(ancestorFacts); + return result2; + } + return cb(value2); + } + function visitDefault(node) { + return visitEachChild(node, visitor, context2); + } + function visitorWorker(node, expressionResultIsUnused2) { + if ((node.transformFlags & 128) === 0) { + return node; + } + switch (node.kind) { + case 223: + return visitAwaitExpression(node); + case 229: + return visitYieldExpression(node); + case 253: + return visitReturnStatement(node); + case 256: + return visitLabeledStatement(node); + case 210: + return visitObjectLiteralExpression(node); + case 226: + return visitBinaryExpression(node, expressionResultIsUnused2); + case 361: + return visitCommaListExpression(node, expressionResultIsUnused2); + case 299: + return visitCatchClause(node); + case 243: + return visitVariableStatement(node); + case 260: + return visitVariableDeclaration(node); + case 246: + case 247: + case 249: + return doWithHierarchyFacts( + visitDefault, + node, + 0, + 2 + /* IterationStatementIncludes */ + ); + case 250: + return visitForOfStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 248: + return doWithHierarchyFacts( + visitForStatement, + node, + 0, + 2 + /* IterationStatementIncludes */ + ); + case 222: + return visitVoidExpression(node); + case 176: + return doWithHierarchyFacts( + visitConstructorDeclaration, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 174: + return doWithHierarchyFacts( + visitMethodDeclaration, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 177: + return doWithHierarchyFacts( + visitGetAccessorDeclaration, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 178: + return doWithHierarchyFacts( + visitSetAccessorDeclaration, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 262: + return doWithHierarchyFacts( + visitFunctionDeclaration, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 218: + return doWithHierarchyFacts( + visitFunctionExpression, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + case 219: + return doWithHierarchyFacts( + visitArrowFunction, + node, + 2, + 0 + /* ArrowFunctionIncludes */ + ); + case 169: + return visitParameter(node); + case 244: + return visitExpressionStatement(node); + case 217: + return visitParenthesizedExpression(node, expressionResultIsUnused2); + case 215: + return visitTaggedTemplateExpression(node); + case 211: + if (capturedSuperProperties && isPropertyAccessExpression(node) && node.expression.kind === 108) { + capturedSuperProperties.add(node.name.escapedText); + } + return visitEachChild(node, visitor, context2); + case 212: + if (capturedSuperProperties && node.expression.kind === 108) { + hasSuperElementAccess = true; + } + return visitEachChild(node, visitor, context2); + case 263: + case 231: + return doWithHierarchyFacts( + visitDefault, + node, + 2, + 1 + /* ClassOrFunctionIncludes */ + ); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitAwaitExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + return setOriginalNode( + setTextRange( + factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper(visitNode(node.expression, visitor, isExpression)) + ), + /*location*/ + node + ), + node + ); + } + return visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + if (node.asteriskToken) { + const expression = visitNode(Debug.checkDefined(node.expression), visitor, isExpression); + return setOriginalNode( + setTextRange( + factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper( + factory2.updateYieldExpression( + node, + node.asteriskToken, + setTextRange( + emitHelpers().createAsyncDelegatorHelper( + setTextRange( + emitHelpers().createAsyncValuesHelper(expression), + expression + ) + ), + expression + ) + ) + ) + ), + node + ), + node + ); + } + return setOriginalNode( + setTextRange( + factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + createDownlevelAwait( + node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + ) + ), + node + ), + node + ); + } + return visitEachChild(node, visitor, context2); + } + function visitReturnStatement(node) { + if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + return factory2.updateReturnStatement( + node, + createDownlevelAwait( + node.expression ? visitNode(node.expression, visitor, isExpression) : factory2.createVoidZero() + ) + ); + } + return visitEachChild(node, visitor, context2); + } + function visitLabeledStatement(node) { + if (enclosingFunctionFlags & 2) { + const statement = unwrapInnermostStatementOfLabel(node); + if (statement.kind === 250 && statement.awaitModifier) { + return visitForOfStatement(statement, node); + } + return factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock), node); + } + return visitEachChild(node, visitor, context2); + } + function chunkObjectLiteralElements(elements) { + let chunkObject; + const objects = []; + for (const e10 of elements) { + if (e10.kind === 305) { + if (chunkObject) { + objects.push(factory2.createObjectLiteralExpression(chunkObject)); + chunkObject = void 0; + } + const target = e10.expression; + objects.push(visitNode(target, visitor, isExpression)); + } else { + chunkObject = append( + chunkObject, + e10.kind === 303 ? factory2.createPropertyAssignment(e10.name, visitNode(e10.initializer, visitor, isExpression)) : visitNode(e10, visitor, isObjectLiteralElementLike) + ); + } + } + if (chunkObject) { + objects.push(factory2.createObjectLiteralExpression(chunkObject)); + } + return objects; + } + function visitObjectLiteralExpression(node) { + if (node.transformFlags & 65536) { + const objects = chunkObjectLiteralElements(node.properties); + if (objects.length && objects[0].kind !== 210) { + objects.unshift(factory2.createObjectLiteralExpression()); + } + let expression = objects[0]; + if (objects.length > 1) { + for (let i7 = 1; i7 < objects.length; i7++) { + expression = emitHelpers().createAssignHelper([expression, objects[i7]]); + } + return expression; + } else { + return emitHelpers().createAssignHelper(objects); + } + } + return visitEachChild(node, visitor, context2); + } + function visitExpressionStatement(node) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitParenthesizedExpression(node, expressionResultIsUnused2) { + return visitEachChild(node, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, context2); + } + function visitSourceFile(node) { + const ancestorFacts = enterSubtree( + 2, + isEffectiveStrictModeSourceFile(node, compilerOptions) ? 0 : 1 + /* SourceFileIncludes */ + ); + exportedVariableStatement = false; + const visited = visitEachChild(node, visitor, context2); + const statement = concatenate( + visited.statements, + taggedTemplateStringDeclarations && [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList(taggedTemplateStringDeclarations) + ) + ] + ); + const result2 = factory2.updateSourceFile(visited, setTextRange(factory2.createNodeArray(statement), node.statements)); + exitSubtree(ancestorFacts); + return result2; + } + function visitTaggedTemplateExpression(node) { + return processTaggedTemplateExpression( + context2, + node, + visitor, + currentSourceFile, + recordTaggedTemplateString, + 0 + /* LiftRestriction */ + ); + } + function visitBinaryExpression(node, expressionResultIsUnused2) { + if (isDestructuringAssignment(node) && containsObjectRestOrSpread(node.left)) { + return flattenDestructuringAssignment( + node, + visitor, + context2, + 1, + !expressionResultIsUnused2 + ); + } + if (node.operatorToken.kind === 28) { + return factory2.updateBinaryExpression( + node, + visitNode(node.left, visitorWithUnusedExpressionResult, isExpression), + node.operatorToken, + visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression) + ); + } + return visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, expressionResultIsUnused2) { + if (expressionResultIsUnused2) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + let result2; + for (let i7 = 0; i7 < node.elements.length; i7++) { + const element = node.elements[i7]; + const visited = visitNode(element, i7 < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); + if (result2 || visited !== element) { + result2 || (result2 = node.elements.slice(0, i7)); + result2.push(visited); + } + } + const elements = result2 ? setTextRange(factory2.createNodeArray(result2), node.elements) : node.elements; + return factory2.updateCommaListExpression(node, elements); + } + function visitCatchClause(node) { + if (node.variableDeclaration && isBindingPattern(node.variableDeclaration.name) && node.variableDeclaration.name.transformFlags & 65536) { + const name2 = factory2.getGeneratedNameForNode(node.variableDeclaration.name); + const updatedDecl = factory2.updateVariableDeclaration( + node.variableDeclaration, + node.variableDeclaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + name2 + ); + const visitedBindings = flattenDestructuringBinding( + updatedDecl, + visitor, + context2, + 1 + /* ObjectRest */ + ); + let block = visitNode(node.block, visitor, isBlock2); + if (some2(visitedBindings)) { + block = factory2.updateBlock(block, [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + visitedBindings + ), + ...block.statements + ]); + } + return factory2.updateCatchClause( + node, + factory2.updateVariableDeclaration( + node.variableDeclaration, + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + block + ); + } + return visitEachChild(node, visitor, context2); + } + function visitVariableStatement(node) { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + const savedExportedVariableStatement = exportedVariableStatement; + exportedVariableStatement = true; + const visited = visitEachChild(node, visitor, context2); + exportedVariableStatement = savedExportedVariableStatement; + return visited; + } + return visitEachChild(node, visitor, context2); + } + function visitVariableDeclaration(node) { + if (exportedVariableStatement) { + const savedExportedVariableStatement = exportedVariableStatement; + exportedVariableStatement = false; + const visited = visitVariableDeclarationWorker( + node, + /*exportedVariableStatement*/ + true + ); + exportedVariableStatement = savedExportedVariableStatement; + return visited; + } + return visitVariableDeclarationWorker( + node, + /*exportedVariableStatement*/ + false + ); + } + function visitVariableDeclarationWorker(node, exportedVariableStatement2) { + if (isBindingPattern(node.name) && node.name.transformFlags & 65536) { + return flattenDestructuringBinding( + node, + visitor, + context2, + 1, + /*rval*/ + void 0, + exportedVariableStatement2 + ); + } + return visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), + visitIterationBody(node.statement, visitor, context2) + ); + } + function visitVoidExpression(node) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitForOfStatement(node, outermostLabeledStatement) { + const ancestorFacts = enterSubtree( + 0, + 2 + /* IterationStatementIncludes */ + ); + if (node.initializer.transformFlags & 65536 || isAssignmentPattern(node.initializer) && containsObjectRestOrSpread(node.initializer)) { + node = transformForOfStatementWithObjectRest(node); + } + const result2 = node.awaitModifier ? transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) : factory2.restoreEnclosingLabel(visitEachChild(node, visitor, context2), outermostLabeledStatement); + exitSubtree(ancestorFacts); + return result2; + } + function transformForOfStatementWithObjectRest(node) { + const initializerWithoutParens = skipParentheses(node.initializer); + if (isVariableDeclarationList(initializerWithoutParens) || isAssignmentPattern(initializerWithoutParens)) { + let bodyLocation; + let statementsLocation; + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const statements = [createForOfBindingStatement(factory2, initializerWithoutParens, temp)]; + if (isBlock2(node.statement)) { + addRange(statements, node.statement.statements); + bodyLocation = node.statement; + statementsLocation = node.statement.statements; + } else if (node.statement) { + append(statements, node.statement); + bodyLocation = node.statement; + statementsLocation = node.statement; + } + return factory2.updateForOfStatement( + node, + node.awaitModifier, + setTextRange( + factory2.createVariableDeclarationList( + [ + setTextRange(factory2.createVariableDeclaration(temp), node.initializer) + ], + 1 + /* Let */ + ), + node.initializer + ), + node.expression, + setTextRange( + factory2.createBlock( + setTextRange(factory2.createNodeArray(statements), statementsLocation), + /*multiLine*/ + true + ), + bodyLocation + ) + ); + } + return node; + } + function convertForOfStatementHead(node, boundValue, nonUserCode) { + const value2 = factory2.createTempVariable(hoistVariableDeclaration); + const iteratorValueExpression = factory2.createAssignment(value2, boundValue); + const iteratorValueStatement = factory2.createExpressionStatement(iteratorValueExpression); + setSourceMapRange(iteratorValueStatement, node.expression); + const exitNonUserCodeExpression = factory2.createAssignment(nonUserCode, factory2.createFalse()); + const exitNonUserCodeStatement = factory2.createExpressionStatement(exitNonUserCodeExpression); + setSourceMapRange(exitNonUserCodeStatement, node.expression); + const statements = [iteratorValueStatement, exitNonUserCodeStatement]; + const binding3 = createForOfBindingStatement(factory2, node.initializer, value2); + statements.push(visitNode(binding3, visitor, isStatement)); + let bodyLocation; + let statementsLocation; + const statement = visitIterationBody(node.statement, visitor, context2); + if (isBlock2(statement)) { + addRange(statements, statement.statements); + bodyLocation = statement; + statementsLocation = statement.statements; + } else { + statements.push(statement); + } + return setTextRange( + factory2.createBlock( + setTextRange(factory2.createNodeArray(statements), statementsLocation), + /*multiLine*/ + true + ), + bodyLocation + ); + } + function createDownlevelAwait(expression) { + return enclosingFunctionFlags & 1 ? factory2.createYieldExpression( + /*asteriskToken*/ + void 0, + emitHelpers().createAwaitHelper(expression) + ) : factory2.createAwaitExpression(expression); + } + function transformForAwaitOfStatement(node, outermostLabeledStatement, ancestorFacts) { + const expression = visitNode(node.expression, visitor, isExpression); + const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const result2 = isIdentifier(expression) ? factory2.getGeneratedNameForNode(iterator) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const nonUserCode = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const done = factory2.createTempVariable(hoistVariableDeclaration); + const errorRecord = factory2.createUniqueName("e"); + const catchVariable = factory2.getGeneratedNameForNode(errorRecord); + const returnMethod = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const callValues = setTextRange(emitHelpers().createAsyncValuesHelper(expression), node.expression); + const callNext = factory2.createCallExpression( + factory2.createPropertyAccessExpression(iterator, "next"), + /*typeArguments*/ + void 0, + [] + ); + const getDone = factory2.createPropertyAccessExpression(result2, "done"); + const getValue2 = factory2.createPropertyAccessExpression(result2, "value"); + const callReturn = factory2.createFunctionCallCall(returnMethod, iterator, []); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + const initializer = ancestorFacts & 2 ? factory2.inlineExpressions([factory2.createAssignment(errorRecord, factory2.createVoidZero()), callValues]) : callValues; + const forStatement = setEmitFlags( + setTextRange( + factory2.createForStatement( + /*initializer*/ + setEmitFlags( + setTextRange( + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + nonUserCode, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createTrue() + ), + setTextRange(factory2.createVariableDeclaration( + iterator, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node.expression), + factory2.createVariableDeclaration(result2) + ]), + node.expression + ), + 4194304 + /* NoHoisting */ + ), + /*condition*/ + factory2.inlineExpressions([ + factory2.createAssignment(result2, createDownlevelAwait(callNext)), + factory2.createAssignment(done, getDone), + factory2.createLogicalNot(done) + ]), + /*incrementor*/ + factory2.createAssignment(nonUserCode, factory2.createTrue()), + /*statement*/ + convertForOfStatementHead(node, getValue2, nonUserCode) + ), + /*location*/ + node + ), + 512 + /* NoTokenTrailingSourceMaps */ + ); + setOriginalNode(forStatement, node); + return factory2.createTryStatement( + factory2.createBlock([ + factory2.restoreEnclosingLabel( + forStatement, + outermostLabeledStatement + ) + ]), + factory2.createCatchClause( + factory2.createVariableDeclaration(catchVariable), + setEmitFlags( + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + errorRecord, + factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("error", catchVariable) + ]) + ) + ) + ]), + 1 + /* SingleLine */ + ) + ), + factory2.createBlock([ + factory2.createTryStatement( + /*tryBlock*/ + factory2.createBlock([ + setEmitFlags( + factory2.createIfStatement( + factory2.createLogicalAnd( + factory2.createLogicalAnd( + factory2.createLogicalNot(nonUserCode), + factory2.createLogicalNot(done) + ), + factory2.createAssignment( + returnMethod, + factory2.createPropertyAccessExpression(iterator, "return") + ) + ), + factory2.createExpressionStatement(createDownlevelAwait(callReturn)) + ), + 1 + /* SingleLine */ + ) + ]), + /*catchClause*/ + void 0, + /*finallyBlock*/ + setEmitFlags( + factory2.createBlock([ + setEmitFlags( + factory2.createIfStatement( + errorRecord, + factory2.createThrowStatement( + factory2.createPropertyAccessExpression(errorRecord, "error") + ) + ), + 1 + /* SingleLine */ + ) + ]), + 1 + /* SingleLine */ + ) + ) + ]) + ); + } + function parameterVisitor(node) { + Debug.assertNode(node, isParameter); + return visitParameter(node); + } + function visitParameter(node) { + if (parametersWithPrecedingObjectRestOrSpread == null ? void 0 : parametersWithPrecedingObjectRestOrSpread.has(node)) { + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + isBindingPattern(node.name) ? factory2.getGeneratedNameForNode(node) : node.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + } + if (node.transformFlags & 65536) { + return factory2.updateParameterDeclaration( + node, + /*modifiers*/ + void 0, + node.dotDotDotToken, + factory2.getGeneratedNameForNode(node), + /*questionToken*/ + void 0, + /*type*/ + void 0, + visitNode(node.initializer, visitor, isExpression) + ); + } + return visitEachChild(node, visitor, context2); + } + function collectParametersWithPrecedingObjectRestOrSpread(node) { + let parameters; + for (const parameter of node.parameters) { + if (parameters) { + parameters.add(parameter); + } else if (parameter.transformFlags & 65536) { + parameters = /* @__PURE__ */ new Set(); + } + } + return parameters; + } + function visitConstructorDeclaration(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateConstructorDeclaration( + node, + node.modifiers, + visitParameterList(node.parameters, parameterVisitor, context2), + transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitGetAccessorDeclaration(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateGetAccessorDeclaration( + node, + node.modifiers, + visitNode(node.name, visitor, isPropertyName), + visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitSetAccessorDeclaration(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateSetAccessorDeclaration( + node, + node.modifiers, + visitNode(node.name, visitor, isPropertyName), + visitParameterList(node.parameters, parameterVisitor, context2), + transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitMethodDeclaration(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateMethodDeclaration( + node, + enclosingFunctionFlags & 1 ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifierLike) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + visitNode(node.name, visitor, isPropertyName), + visitNode( + /*node*/ + void 0, + visitor, + isQuestionToken + ), + /*typeParameters*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitFunctionDeclaration(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateFunctionDeclaration( + node, + enclosingFunctionFlags & 1 ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifier) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitArrowFunction(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateArrowFunction( + node, + node.modifiers, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + node.equalsGreaterThanToken, + transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function visitFunctionExpression(node) { + const savedEnclosingFunctionFlags = enclosingFunctionFlags; + const savedParametersWithPrecedingObjectRestOrSpread = parametersWithPrecedingObjectRestOrSpread; + enclosingFunctionFlags = getFunctionFlags(node); + parametersWithPrecedingObjectRestOrSpread = collectParametersWithPrecedingObjectRestOrSpread(node); + const updated = factory2.updateFunctionExpression( + node, + enclosingFunctionFlags & 1 ? visitNodes2(node.modifiers, visitorNoAsyncModifier, isModifier) : node.modifiers, + enclosingFunctionFlags & 2 ? void 0 : node.asteriskToken, + node.name, + /*typeParameters*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context2), + /*type*/ + void 0, + enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1 ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody2(node) + ); + enclosingFunctionFlags = savedEnclosingFunctionFlags; + parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread; + return updated; + } + function transformAsyncGeneratorFunctionParameterList(node) { + if (isSimpleParameterList(node.parameters)) { + return visitParameterList(node.parameters, visitor, context2); + } + const newParameters = []; + for (const parameter of node.parameters) { + if (parameter.initializer || parameter.dotDotDotToken) { + break; + } + const newParameter = factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.getGeneratedNameForNode( + parameter.name, + 8 + /* ReservedInNestedScopes */ + ) + ); + newParameters.push(newParameter); + } + const newParametersArray = factory2.createNodeArray(newParameters); + setTextRange(newParametersArray, node.parameters); + return newParametersArray; + } + function transformAsyncGeneratorFunctionBody(node) { + const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context2) : void 0; + resumeLexicalEnvironment(); + const savedCapturedSuperProperties = capturedSuperProperties; + const savedHasSuperElementAccess = hasSuperElementAccess; + capturedSuperProperties = /* @__PURE__ */ new Set(); + hasSuperElementAccess = false; + const outerStatements = []; + let asyncBody = factory2.updateBlock(node.body, visitNodes2(node.body.statements, visitor, isStatement)); + asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, appendObjectRestAssignmentsIfNeeded(endLexicalEnvironment(), node))); + const returnStatement = factory2.createReturnStatement( + emitHelpers().createAsyncGeneratorHelper( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + factory2.createToken( + 42 + /* AsteriskToken */ + ), + node.name && factory2.getGeneratedNameForNode(node.name), + /*typeParameters*/ + void 0, + innerParameters ?? [], + /*type*/ + void 0, + asyncBody + ), + !!(hierarchyFacts & 1) + ) + ); + const emitSuperHelpers = languageVersion >= 2 && resolver.getNodeCheckFlags(node) & (256 | 128); + if (emitSuperHelpers) { + enableSubstitutionForAsyncMethodsWithSuper(); + const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties); + substitutedSuperAccessors[getNodeId(variableStatement)] = true; + insertStatementsAfterStandardPrologue(outerStatements, [variableStatement]); + } + outerStatements.push(returnStatement); + const block = factory2.updateBlock(node.body, outerStatements); + if (emitSuperHelpers && hasSuperElementAccess) { + if (resolver.getNodeCheckFlags(node) & 256) { + addEmitHelper(block, advancedAsyncSuperHelper); + } else if (resolver.getNodeCheckFlags(node) & 128) { + addEmitHelper(block, asyncSuperHelper); + } + } + capturedSuperProperties = savedCapturedSuperProperties; + hasSuperElementAccess = savedHasSuperElementAccess; + return block; + } + function transformFunctionBody2(node) { + resumeLexicalEnvironment(); + let statementOffset = 0; + const statements = []; + const body = visitNode(node.body, visitor, isConciseBody) ?? factory2.createBlock([]); + if (isBlock2(body)) { + statementOffset = factory2.copyPrologue( + body.statements, + statements, + /*ensureUseStrict*/ + false, + visitor + ); + } + addRange(statements, appendObjectRestAssignmentsIfNeeded( + /*statements*/ + void 0, + node + )); + const leadingStatements = endLexicalEnvironment(); + if (statementOffset > 0 || some2(statements) || some2(leadingStatements)) { + const block = factory2.converters.convertToFunctionBlock( + body, + /*multiLine*/ + true + ); + insertStatementsAfterStandardPrologue(statements, leadingStatements); + addRange(statements, block.statements.slice(statementOffset)); + return factory2.updateBlock(block, setTextRange(factory2.createNodeArray(statements), block.statements)); + } + return body; + } + function appendObjectRestAssignmentsIfNeeded(statements, node) { + let containsPrecedingObjectRestOrSpread = false; + for (const parameter of node.parameters) { + if (containsPrecedingObjectRestOrSpread) { + if (isBindingPattern(parameter.name)) { + if (parameter.name.elements.length > 0) { + const declarations = flattenDestructuringBinding( + parameter, + visitor, + context2, + 0, + factory2.getGeneratedNameForNode(parameter) + ); + if (some2(declarations)) { + const declarationList = factory2.createVariableDeclarationList(declarations); + const statement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + ); + setEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + statements = append(statements, statement); + } + } else if (parameter.initializer) { + const name2 = factory2.getGeneratedNameForNode(parameter); + const initializer = visitNode(parameter.initializer, visitor, isExpression); + const assignment = factory2.createAssignment(name2, initializer); + const statement = factory2.createExpressionStatement(assignment); + setEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + statements = append(statements, statement); + } + } else if (parameter.initializer) { + const name2 = factory2.cloneNode(parameter.name); + setTextRange(name2, parameter.name); + setEmitFlags( + name2, + 96 + /* NoSourceMap */ + ); + const initializer = visitNode(parameter.initializer, visitor, isExpression); + addEmitFlags( + initializer, + 96 | 3072 + /* NoComments */ + ); + const assignment = factory2.createAssignment(name2, initializer); + setTextRange(assignment, parameter); + setEmitFlags( + assignment, + 3072 + /* NoComments */ + ); + const block = factory2.createBlock([factory2.createExpressionStatement(assignment)]); + setTextRange(block, parameter); + setEmitFlags( + block, + 1 | 64 | 768 | 3072 + /* NoComments */ + ); + const typeCheck = factory2.createTypeCheck(factory2.cloneNode(parameter.name), "undefined"); + const statement = factory2.createIfStatement(typeCheck, block); + startOnNewLine(statement); + setTextRange(statement, parameter); + setEmitFlags( + statement, + 768 | 64 | 2097152 | 3072 + /* NoComments */ + ); + statements = append(statements, statement); + } + } else if (parameter.transformFlags & 65536) { + containsPrecedingObjectRestOrSpread = true; + const declarations = flattenDestructuringBinding( + parameter, + visitor, + context2, + 1, + factory2.getGeneratedNameForNode(parameter), + /*hoistTempVariables*/ + false, + /*skipInitializer*/ + true + ); + if (some2(declarations)) { + const declarationList = factory2.createVariableDeclarationList(declarations); + const statement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + ); + setEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + statements = append(statements, statement); + } + } + } + return statements; + } + function enableSubstitutionForAsyncMethodsWithSuper() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 213 + /* CallExpression */ + ); + context2.enableSubstitution( + 211 + /* PropertyAccessExpression */ + ); + context2.enableSubstitution( + 212 + /* ElementAccessExpression */ + ); + context2.enableEmitNotification( + 263 + /* ClassDeclaration */ + ); + context2.enableEmitNotification( + 174 + /* MethodDeclaration */ + ); + context2.enableEmitNotification( + 177 + /* GetAccessor */ + ); + context2.enableEmitNotification( + 178 + /* SetAccessor */ + ); + context2.enableEmitNotification( + 176 + /* Constructor */ + ); + context2.enableEmitNotification( + 243 + /* VariableStatement */ + ); + } + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isSuperContainer(node)) { + const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 | 256); + if (superContainerFlags !== enclosingSuperContainerFlags) { + const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = superContainerFlags; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + } else if (enabledSubstitutions && substitutedSuperAccessors[getNodeId(node)]) { + const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags; + enclosingSuperContainerFlags = 0; + previousOnEmitNode(hint, node, emitCallback); + enclosingSuperContainerFlags = savedEnclosingSuperContainerFlags; + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1 && enclosingSuperContainerFlags) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 211: + return substitutePropertyAccessExpression(node); + case 212: + return substituteElementAccessExpression(node); + case 213: + return substituteCallExpression(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (node.expression.kind === 108) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.createUniqueName( + "_super", + 16 | 32 + /* FileLevel */ + ), + node.name + ), + node + ); + } + return node; + } + function substituteElementAccessExpression(node) { + if (node.expression.kind === 108) { + return createSuperElementAccessInAsyncMethod( + node.argumentExpression, + node + ); + } + return node; + } + function substituteCallExpression(node) { + const expression = node.expression; + if (isSuperProperty(expression)) { + const argumentExpression = isPropertyAccessExpression(expression) ? substitutePropertyAccessExpression(expression) : substituteElementAccessExpression(expression); + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(argumentExpression, "call"), + /*typeArguments*/ + void 0, + [ + factory2.createThis(), + ...node.arguments + ] + ); + } + return node; + } + function isSuperContainer(node) { + const kind = node.kind; + return kind === 263 || kind === 176 || kind === 174 || kind === 177 || kind === 178; + } + function createSuperElementAccessInAsyncMethod(argumentExpression, location2) { + if (enclosingSuperContainerFlags & 256) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.createCallExpression( + factory2.createIdentifier("_superIndex"), + /*typeArguments*/ + void 0, + [argumentExpression] + ), + "value" + ), + location2 + ); + } else { + return setTextRange( + factory2.createCallExpression( + factory2.createIdentifier("_superIndex"), + /*typeArguments*/ + void 0, + [argumentExpression] + ), + location2 + ); + } + } + } + var init_es2018 = __esm2({ + "src/compiler/transformers/es2018.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES2019(context2) { + const factory2 = context2.factory; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 64) === 0) { + return node; + } + switch (node.kind) { + case 299: + return visitCatchClause(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitCatchClause(node) { + if (!node.variableDeclaration) { + return factory2.updateCatchClause( + node, + factory2.createVariableDeclaration(factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + )), + visitNode(node.block, visitor, isBlock2) + ); + } + return visitEachChild(node, visitor, context2); + } + } + var init_es2019 = __esm2({ + "src/compiler/transformers/es2019.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES2020(context2) { + const { + factory: factory2, + hoistVariableDeclaration + } = context2; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 32) === 0) { + return node; + } + switch (node.kind) { + case 213: { + const updated = visitNonOptionalCallExpression( + node, + /*captureThisArg*/ + false + ); + Debug.assertNotNode(updated, isSyntheticReference); + return updated; + } + case 211: + case 212: + if (isOptionalChain(node)) { + const updated = visitOptionalExpression( + node, + /*captureThisArg*/ + false, + /*isDelete*/ + false + ); + Debug.assertNotNode(updated, isSyntheticReference); + return updated; + } + return visitEachChild(node, visitor, context2); + case 226: + if (node.operatorToken.kind === 61) { + return transformNullishCoalescingExpression(node); + } + return visitEachChild(node, visitor, context2); + case 220: + return visitDeleteExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function flattenChain(chain3) { + Debug.assertNotNode(chain3, isNonNullChain); + const links = [chain3]; + while (!chain3.questionDotToken && !isTaggedTemplateExpression(chain3)) { + chain3 = cast(skipPartiallyEmittedExpressions(chain3.expression), isOptionalChain); + Debug.assertNotNode(chain3, isNonNullChain); + links.unshift(chain3); + } + return { expression: chain3.expression, chain: links }; + } + function visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete) { + const expression = visitNonOptionalExpression(node.expression, captureThisArg, isDelete); + if (isSyntheticReference(expression)) { + return factory2.createSyntheticReferenceExpression(factory2.updateParenthesizedExpression(node, expression.expression), expression.thisArg); + } + return factory2.updateParenthesizedExpression(node, expression); + } + function visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete) { + if (isOptionalChain(node)) { + return visitOptionalExpression(node, captureThisArg, isDelete); + } + let expression = visitNode(node.expression, visitor, isExpression); + Debug.assertNotNode(expression, isSyntheticReference); + let thisArg; + if (captureThisArg) { + if (!isSimpleCopiableExpression(expression)) { + thisArg = factory2.createTempVariable(hoistVariableDeclaration); + expression = factory2.createAssignment(thisArg, expression); + } else { + thisArg = expression; + } + } + expression = node.kind === 211 ? factory2.updatePropertyAccessExpression(node, expression, visitNode(node.name, visitor, isIdentifier)) : factory2.updateElementAccessExpression(node, expression, visitNode(node.argumentExpression, visitor, isExpression)); + return thisArg ? factory2.createSyntheticReferenceExpression(expression, thisArg) : expression; + } + function visitNonOptionalCallExpression(node, captureThisArg) { + if (isOptionalChain(node)) { + return visitOptionalExpression( + node, + captureThisArg, + /*isDelete*/ + false + ); + } + if (isParenthesizedExpression(node.expression) && isOptionalChain(skipParentheses(node.expression))) { + const expression = visitNonOptionalParenthesizedExpression( + node.expression, + /*captureThisArg*/ + true, + /*isDelete*/ + false + ); + const args = visitNodes2(node.arguments, visitor, isExpression); + if (isSyntheticReference(expression)) { + return setTextRange(factory2.createFunctionCallCall(expression.expression, expression.thisArg, args), node); + } + return factory2.updateCallExpression( + node, + expression, + /*typeArguments*/ + void 0, + args + ); + } + return visitEachChild(node, visitor, context2); + } + function visitNonOptionalExpression(node, captureThisArg, isDelete) { + switch (node.kind) { + case 217: + return visitNonOptionalParenthesizedExpression(node, captureThisArg, isDelete); + case 211: + case 212: + return visitNonOptionalPropertyOrElementAccessExpression(node, captureThisArg, isDelete); + case 213: + return visitNonOptionalCallExpression(node, captureThisArg); + default: + return visitNode(node, visitor, isExpression); + } + } + function visitOptionalExpression(node, captureThisArg, isDelete) { + const { expression, chain: chain3 } = flattenChain(node); + const left = visitNonOptionalExpression( + skipPartiallyEmittedExpressions(expression), + isCallChain(chain3[0]), + /*isDelete*/ + false + ); + let leftThisArg = isSyntheticReference(left) ? left.thisArg : void 0; + let capturedLeft = isSyntheticReference(left) ? left.expression : left; + let leftExpression = factory2.restoreOuterExpressions( + expression, + capturedLeft, + 8 + /* PartiallyEmittedExpressions */ + ); + if (!isSimpleCopiableExpression(capturedLeft)) { + capturedLeft = factory2.createTempVariable(hoistVariableDeclaration); + leftExpression = factory2.createAssignment(capturedLeft, leftExpression); + } + let rightExpression = capturedLeft; + let thisArg; + for (let i7 = 0; i7 < chain3.length; i7++) { + const segment = chain3[i7]; + switch (segment.kind) { + case 211: + case 212: + if (i7 === chain3.length - 1 && captureThisArg) { + if (!isSimpleCopiableExpression(rightExpression)) { + thisArg = factory2.createTempVariable(hoistVariableDeclaration); + rightExpression = factory2.createAssignment(thisArg, rightExpression); + } else { + thisArg = rightExpression; + } + } + rightExpression = segment.kind === 211 ? factory2.createPropertyAccessExpression(rightExpression, visitNode(segment.name, visitor, isIdentifier)) : factory2.createElementAccessExpression(rightExpression, visitNode(segment.argumentExpression, visitor, isExpression)); + break; + case 213: + if (i7 === 0 && leftThisArg) { + if (!isGeneratedIdentifier(leftThisArg)) { + leftThisArg = factory2.cloneNode(leftThisArg); + addEmitFlags( + leftThisArg, + 3072 + /* NoComments */ + ); + } + rightExpression = factory2.createFunctionCallCall( + rightExpression, + leftThisArg.kind === 108 ? factory2.createThis() : leftThisArg, + visitNodes2(segment.arguments, visitor, isExpression) + ); + } else { + rightExpression = factory2.createCallExpression( + rightExpression, + /*typeArguments*/ + void 0, + visitNodes2(segment.arguments, visitor, isExpression) + ); + } + break; + } + setOriginalNode(rightExpression, segment); + } + const target = isDelete ? factory2.createConditionalExpression( + createNotNullCondition( + leftExpression, + capturedLeft, + /*invert*/ + true + ), + /*questionToken*/ + void 0, + factory2.createTrue(), + /*colonToken*/ + void 0, + factory2.createDeleteExpression(rightExpression) + ) : factory2.createConditionalExpression( + createNotNullCondition( + leftExpression, + capturedLeft, + /*invert*/ + true + ), + /*questionToken*/ + void 0, + factory2.createVoidZero(), + /*colonToken*/ + void 0, + rightExpression + ); + setTextRange(target, node); + return thisArg ? factory2.createSyntheticReferenceExpression(target, thisArg) : target; + } + function createNotNullCondition(left, right, invert2) { + return factory2.createBinaryExpression( + factory2.createBinaryExpression( + left, + factory2.createToken( + invert2 ? 37 : 38 + /* ExclamationEqualsEqualsToken */ + ), + factory2.createNull() + ), + factory2.createToken( + invert2 ? 57 : 56 + /* AmpersandAmpersandToken */ + ), + factory2.createBinaryExpression( + right, + factory2.createToken( + invert2 ? 37 : 38 + /* ExclamationEqualsEqualsToken */ + ), + factory2.createVoidZero() + ) + ); + } + function transformNullishCoalescingExpression(node) { + let left = visitNode(node.left, visitor, isExpression); + let right = left; + if (!isSimpleCopiableExpression(left)) { + right = factory2.createTempVariable(hoistVariableDeclaration); + left = factory2.createAssignment(right, left); + } + return setTextRange( + factory2.createConditionalExpression( + createNotNullCondition(left, right), + /*questionToken*/ + void 0, + right, + /*colonToken*/ + void 0, + visitNode(node.right, visitor, isExpression) + ), + node + ); + } + function visitDeleteExpression(node) { + return isOptionalChain(skipParentheses(node.expression)) ? setOriginalNode(visitNonOptionalExpression( + node.expression, + /*captureThisArg*/ + false, + /*isDelete*/ + true + ), node) : factory2.updateDeleteExpression(node, visitNode(node.expression, visitor, isExpression)); + } + } + var init_es2020 = __esm2({ + "src/compiler/transformers/es2020.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES2021(context2) { + const { + hoistVariableDeclaration, + factory: factory2 + } = context2; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 16) === 0) { + return node; + } + if (isLogicalOrCoalescingAssignmentExpression(node)) { + return transformLogicalAssignment(node); + } + return visitEachChild(node, visitor, context2); + } + function transformLogicalAssignment(binaryExpression) { + const operator = binaryExpression.operatorToken; + const nonAssignmentOperator = getNonAssignmentOperatorForCompoundAssignment(operator.kind); + let left = skipParentheses(visitNode(binaryExpression.left, visitor, isLeftHandSideExpression)); + let assignmentTarget = left; + const right = skipParentheses(visitNode(binaryExpression.right, visitor, isExpression)); + if (isAccessExpression(left)) { + const propertyAccessTargetSimpleCopiable = isSimpleCopiableExpression(left.expression); + const propertyAccessTarget = propertyAccessTargetSimpleCopiable ? left.expression : factory2.createTempVariable(hoistVariableDeclaration); + const propertyAccessTargetAssignment = propertyAccessTargetSimpleCopiable ? left.expression : factory2.createAssignment( + propertyAccessTarget, + left.expression + ); + if (isPropertyAccessExpression(left)) { + assignmentTarget = factory2.createPropertyAccessExpression( + propertyAccessTarget, + left.name + ); + left = factory2.createPropertyAccessExpression( + propertyAccessTargetAssignment, + left.name + ); + } else { + const elementAccessArgumentSimpleCopiable = isSimpleCopiableExpression(left.argumentExpression); + const elementAccessArgument = elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory2.createTempVariable(hoistVariableDeclaration); + assignmentTarget = factory2.createElementAccessExpression( + propertyAccessTarget, + elementAccessArgument + ); + left = factory2.createElementAccessExpression( + propertyAccessTargetAssignment, + elementAccessArgumentSimpleCopiable ? left.argumentExpression : factory2.createAssignment( + elementAccessArgument, + left.argumentExpression + ) + ); + } + } + return factory2.createBinaryExpression( + left, + nonAssignmentOperator, + factory2.createParenthesizedExpression( + factory2.createAssignment( + assignmentTarget, + right + ) + ) + ); + } + } + var init_es2021 = __esm2({ + "src/compiler/transformers/es2021.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformESNext(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + hoistVariableDeclaration, + startLexicalEnvironment, + endLexicalEnvironment + } = context2; + let exportBindings; + let exportVars; + let defaultExportBinding; + let exportEqualsBinding; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + const visited = visitNode(node, visitor, isSourceFile); + addEmitHelpers(visited, context2.readEmitHelpers()); + exportVars = void 0; + exportBindings = void 0; + defaultExportBinding = void 0; + return visited; + } + function visitor(node) { + if ((node.transformFlags & 4) === 0) { + return node; + } + switch (node.kind) { + case 312: + return visitSourceFile(node); + case 241: + return visitBlock(node); + case 248: + return visitForStatement(node); + case 250: + return visitForOfStatement(node); + case 255: + return visitSwitchStatement(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitSourceFile(node) { + const usingKind = getUsingKindOfStatements(node.statements); + if (usingKind) { + startLexicalEnvironment(); + exportBindings = new IdentifierNameMap(); + exportVars = []; + const prologueCount = countPrologueStatements(node.statements); + const topLevelStatements = []; + addRange(topLevelStatements, visitArray(node.statements, visitor, isStatement, 0, prologueCount)); + let pos = prologueCount; + while (pos < node.statements.length) { + const statement = node.statements[pos]; + if (getUsingKind(statement) !== 0) { + if (pos > prologueCount) { + addRange(topLevelStatements, visitNodes2(node.statements, visitor, isStatement, prologueCount, pos - prologueCount)); + } + break; + } + pos++; + } + Debug.assert(pos < node.statements.length, "Should have encountered at least one 'using' statement."); + const envBinding = createEnvBinding(); + const bodyStatements = transformUsingDeclarations(node.statements, pos, node.statements.length, envBinding, topLevelStatements); + if (exportBindings.size) { + append( + topLevelStatements, + factory2.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory2.createNamedExports(arrayFrom(exportBindings.values())) + ) + ); + } + addRange(topLevelStatements, endLexicalEnvironment()); + if (exportVars.length) { + topLevelStatements.push(factory2.createVariableStatement( + factory2.createModifiersFromModifierFlags( + 32 + /* Export */ + ), + factory2.createVariableDeclarationList( + exportVars, + 1 + /* Let */ + ) + )); + } + addRange(topLevelStatements, createDownlevelUsingStatements( + bodyStatements, + envBinding, + usingKind === 2 + /* Async */ + )); + if (exportEqualsBinding) { + topLevelStatements.push(factory2.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + true, + exportEqualsBinding + )); + } + return factory2.updateSourceFile(node, topLevelStatements); + } + return visitEachChild(node, visitor, context2); + } + function visitBlock(node) { + const usingKind = getUsingKindOfStatements(node.statements); + if (usingKind) { + const prologueCount = countPrologueStatements(node.statements); + const envBinding = createEnvBinding(); + return factory2.updateBlock( + node, + [ + ...visitArray(node.statements, visitor, isStatement, 0, prologueCount), + ...createDownlevelUsingStatements( + transformUsingDeclarations( + node.statements, + prologueCount, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ), + envBinding, + usingKind === 2 + /* Async */ + ) + ] + ); + } + return visitEachChild(node, visitor, context2); + } + function visitForStatement(node) { + if (node.initializer && isUsingVariableDeclarationList(node.initializer)) { + return visitNode( + factory2.createBlock([ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + node.initializer + ), + factory2.updateForStatement( + node, + /*initializer*/ + void 0, + node.condition, + node.incrementor, + node.statement + ) + ]), + visitor, + isStatement + ); + } + return visitEachChild(node, visitor, context2); + } + function visitForOfStatement(node) { + if (isUsingVariableDeclarationList(node.initializer)) { + const forInitializer = node.initializer; + Debug.assertNode(forInitializer, isUsingVariableDeclarationList); + Debug.assert(forInitializer.declarations.length === 1, "ForInitializer may only have one declaration"); + const forDecl = forInitializer.declarations[0]; + Debug.assert(!forDecl.initializer, "ForInitializer may not have an initializer"); + const isAwaitUsing = getUsingKindOfVariableDeclarationList(forInitializer) === 2; + const temp = factory2.getGeneratedNameForNode(forDecl.name); + const usingVar = factory2.updateVariableDeclaration( + forDecl, + forDecl.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + temp + ); + const usingVarList = factory2.createVariableDeclarationList( + [usingVar], + isAwaitUsing ? 6 : 4 + /* Using */ + ); + const usingVarStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + usingVarList + ); + return visitNode( + factory2.updateForOfStatement( + node, + node.awaitModifier, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration(temp) + ], + 2 + /* Const */ + ), + node.expression, + isBlock2(node.statement) ? factory2.updateBlock(node.statement, [ + usingVarStatement, + ...node.statement.statements + ]) : factory2.createBlock( + [ + usingVarStatement, + node.statement + ], + /*multiLine*/ + true + ) + ), + visitor, + isStatement + ); + } + return visitEachChild(node, visitor, context2); + } + function visitCaseOrDefaultClause(node, envBinding) { + if (getUsingKindOfStatements(node.statements) !== 0) { + if (isCaseClause(node)) { + return factory2.updateCaseClause( + node, + visitNode(node.expression, visitor, isExpression), + transformUsingDeclarations( + node.statements, + /*start*/ + 0, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ) + ); + } else { + return factory2.updateDefaultClause( + node, + transformUsingDeclarations( + node.statements, + /*start*/ + 0, + node.statements.length, + envBinding, + /*topLevelStatements*/ + void 0 + ) + ); + } + } + return visitEachChild(node, visitor, context2); + } + function visitSwitchStatement(node) { + const usingKind = getUsingKindOfCaseOrDefaultClauses(node.caseBlock.clauses); + if (usingKind) { + const envBinding = createEnvBinding(); + return createDownlevelUsingStatements( + [ + factory2.updateSwitchStatement( + node, + visitNode(node.expression, visitor, isExpression), + factory2.updateCaseBlock( + node.caseBlock, + node.caseBlock.clauses.map((clause) => visitCaseOrDefaultClause(clause, envBinding)) + ) + ) + ], + envBinding, + usingKind === 2 + /* Async */ + ); + } + return visitEachChild(node, visitor, context2); + } + function transformUsingDeclarations(statementsIn, start, end, envBinding, topLevelStatements) { + const statements = []; + for (let i7 = start; i7 < end; i7++) { + const statement = statementsIn[i7]; + const usingKind = getUsingKind(statement); + if (usingKind) { + Debug.assertNode(statement, isVariableStatement); + const declarations = []; + for (let declaration of statement.declarationList.declarations) { + if (!isIdentifier(declaration.name)) { + declarations.length = 0; + break; + } + if (isNamedEvaluation(declaration)) { + declaration = transformNamedEvaluation(context2, declaration); + } + const initializer = visitNode(declaration.initializer, visitor, isExpression) ?? factory2.createVoidZero(); + declarations.push(factory2.updateVariableDeclaration( + declaration, + declaration.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + emitHelpers().createAddDisposableResourceHelper( + envBinding, + initializer, + usingKind === 2 + /* Async */ + ) + )); + } + if (declarations.length) { + const varList = factory2.createVariableDeclarationList( + declarations, + 2 + /* Const */ + ); + setOriginalNode(varList, statement.declarationList); + setTextRange(varList, statement.declarationList); + hoistOrAppendNode(factory2.updateVariableStatement( + statement, + /*modifiers*/ + void 0, + varList + )); + continue; + } + } + const result2 = visitor(statement); + if (isArray3(result2)) { + result2.forEach(hoistOrAppendNode); + } else if (result2) { + hoistOrAppendNode(result2); + } + } + return statements; + function hoistOrAppendNode(node) { + Debug.assertNode(node, isStatement); + append(statements, hoist(node)); + } + function hoist(node) { + if (!topLevelStatements) + return node; + switch (node.kind) { + case 272: + case 271: + case 278: + case 262: + return hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements); + case 277: + return hoistExportAssignment(node); + case 263: + return hoistClassDeclaration(node); + case 243: + return hoistVariableStatement(node); + } + return node; + } + } + function hoistImportOrExportOrHoistedDeclaration(node, topLevelStatements) { + topLevelStatements.push(node); + return void 0; + } + function hoistExportAssignment(node) { + return node.isExportEquals ? hoistExportEquals(node) : hoistExportDefault(node); + } + function hoistExportDefault(node) { + if (defaultExportBinding) { + return node; + } + defaultExportBinding = factory2.createUniqueName( + "_default", + 8 | 32 | 16 + /* Optimistic */ + ); + hoistBindingIdentifier( + defaultExportBinding, + /*isExport*/ + true, + "default", + node + ); + let expression = node.expression; + let innerExpression = skipOuterExpressions(expression); + if (isNamedEvaluation(innerExpression)) { + innerExpression = transformNamedEvaluation( + context2, + innerExpression, + /*ignoreEmptyStringLiteral*/ + false, + "default" + ); + expression = factory2.restoreOuterExpressions(expression, innerExpression); + } + const assignment = factory2.createAssignment(defaultExportBinding, expression); + return factory2.createExpressionStatement(assignment); + } + function hoistExportEquals(node) { + if (exportEqualsBinding) { + return node; + } + exportEqualsBinding = factory2.createUniqueName( + "_default", + 8 | 32 | 16 + /* Optimistic */ + ); + hoistVariableDeclaration(exportEqualsBinding); + const assignment = factory2.createAssignment(exportEqualsBinding, node.expression); + return factory2.createExpressionStatement(assignment); + } + function hoistClassDeclaration(node) { + if (!node.name && defaultExportBinding) { + return node; + } + const isExported2 = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + const isDefault = hasSyntacticModifier( + node, + 2048 + /* Default */ + ); + let expression = factory2.converters.convertToClassExpression(node); + if (node.name) { + hoistBindingIdentifier( + factory2.getLocalName(node), + isExported2 && !isDefault, + /*exportAlias*/ + void 0, + node + ); + expression = factory2.createAssignment(factory2.getDeclarationName(node), expression); + if (isNamedEvaluation(expression)) { + expression = transformNamedEvaluation( + context2, + expression, + /*ignoreEmptyStringLiteral*/ + false + ); + } + setOriginalNode(expression, node); + setSourceMapRange(expression, node); + setCommentRange(expression, node); + } + if (isDefault && !defaultExportBinding) { + defaultExportBinding = factory2.createUniqueName( + "_default", + 8 | 32 | 16 + /* Optimistic */ + ); + hoistBindingIdentifier( + defaultExportBinding, + /*isExport*/ + true, + "default", + node + ); + expression = factory2.createAssignment(defaultExportBinding, expression); + if (isNamedEvaluation(expression)) { + expression = transformNamedEvaluation( + context2, + expression, + /*ignoreEmptyStringLiteral*/ + false, + "default" + ); + } + setOriginalNode(expression, node); + } + return factory2.createExpressionStatement(expression); + } + function hoistVariableStatement(node) { + let expressions; + const isExported2 = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + for (const variable of node.declarationList.declarations) { + hoistBindingElement(variable, isExported2, variable); + if (variable.initializer) { + expressions = append(expressions, hoistInitializedVariable(variable)); + } + } + if (expressions) { + const statement = factory2.createExpressionStatement(factory2.inlineExpressions(expressions)); + setOriginalNode(statement, node); + setCommentRange(statement, node); + setSourceMapRange(statement, node); + return statement; + } + return void 0; + } + function hoistInitializedVariable(node) { + Debug.assertIsDefined(node.initializer); + let target; + if (isIdentifier(node.name)) { + target = factory2.cloneNode(node.name); + setEmitFlags(target, getEmitFlags(target) & ~(32768 | 16384 | 65536)); + } else { + target = factory2.converters.convertToAssignmentPattern(node.name); + } + const assignment = factory2.createAssignment(target, node.initializer); + setOriginalNode(assignment, node); + setCommentRange(assignment, node); + setSourceMapRange(assignment, node); + return assignment; + } + function hoistBindingElement(node, isExportedDeclaration, original) { + if (isBindingPattern(node.name)) { + for (const element of node.name.elements) { + if (!isOmittedExpression(element)) { + hoistBindingElement(element, isExportedDeclaration, original); + } + } + } else { + hoistBindingIdentifier( + node.name, + isExportedDeclaration, + /*exportAlias*/ + void 0, + original + ); + } + } + function hoistBindingIdentifier(node, isExport, exportAlias, original) { + const name2 = isGeneratedIdentifier(node) ? node : factory2.cloneNode(node); + if (isExport) { + if (exportAlias === void 0 && !isLocalName(name2)) { + const varDecl = factory2.createVariableDeclaration(name2); + if (original) { + setOriginalNode(varDecl, original); + } + exportVars.push(varDecl); + return; + } + const localName = exportAlias !== void 0 ? name2 : void 0; + const exportName = exportAlias !== void 0 ? exportAlias : name2; + const specifier = factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + localName, + exportName + ); + if (original) { + setOriginalNode(specifier, original); + } + exportBindings.set(name2, specifier); + } + hoistVariableDeclaration(name2); + } + function createEnvBinding() { + return factory2.createUniqueName("env"); + } + function createDownlevelUsingStatements(bodyStatements, envBinding, async) { + const statements = []; + const envObject = factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("stack", factory2.createArrayLiteralExpression()), + factory2.createPropertyAssignment("error", factory2.createVoidZero()), + factory2.createPropertyAssignment("hasError", factory2.createFalse()) + ]); + const envVar = factory2.createVariableDeclaration( + envBinding, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + envObject + ); + const envVarList = factory2.createVariableDeclarationList( + [envVar], + 2 + /* Const */ + ); + const envVarStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + envVarList + ); + statements.push(envVarStatement); + const tryBlock = factory2.createBlock( + bodyStatements, + /*multiLine*/ + true + ); + const bodyCatchBinding = factory2.createUniqueName("e"); + const catchClause = factory2.createCatchClause( + bodyCatchBinding, + factory2.createBlock( + [ + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(envBinding, "error"), + bodyCatchBinding + ) + ), + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(envBinding, "hasError"), + factory2.createTrue() + ) + ) + ], + /*multiLine*/ + true + ) + ); + let finallyBlock; + if (async) { + const result2 = factory2.createUniqueName("result"); + finallyBlock = factory2.createBlock( + [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + result2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + emitHelpers().createDisposeResourcesHelper(envBinding) + ) + ], + 2 + /* Const */ + ) + ), + factory2.createIfStatement(result2, factory2.createExpressionStatement(factory2.createAwaitExpression(result2))) + ], + /*multiLine*/ + true + ); + } else { + finallyBlock = factory2.createBlock( + [ + factory2.createExpressionStatement( + emitHelpers().createDisposeResourcesHelper(envBinding) + ) + ], + /*multiLine*/ + true + ); + } + const tryStatement = factory2.createTryStatement(tryBlock, catchClause, finallyBlock); + statements.push(tryStatement); + return statements; + } + } + function countPrologueStatements(statements) { + for (let i7 = 0; i7 < statements.length; i7++) { + if (!isPrologueDirective(statements[i7]) && !isCustomPrologue(statements[i7])) { + return i7; + } + } + return 0; + } + function isUsingVariableDeclarationList(node) { + return isVariableDeclarationList(node) && getUsingKindOfVariableDeclarationList(node) !== 0; + } + function getUsingKindOfVariableDeclarationList(node) { + return (node.flags & 7) === 6 ? 2 : (node.flags & 7) === 4 ? 1 : 0; + } + function getUsingKindOfVariableStatement(node) { + return getUsingKindOfVariableDeclarationList(node.declarationList); + } + function getUsingKind(statement) { + return isVariableStatement(statement) ? getUsingKindOfVariableStatement(statement) : 0; + } + function getUsingKindOfStatements(statements) { + let result2 = 0; + for (const statement of statements) { + const usingKind = getUsingKind(statement); + if (usingKind === 2) + return 2; + if (usingKind > result2) + result2 = usingKind; + } + return result2; + } + function getUsingKindOfCaseOrDefaultClauses(clauses) { + let result2 = 0; + for (const clause of clauses) { + const usingKind = getUsingKindOfStatements(clause.statements); + if (usingKind === 2) + return 2; + if (usingKind > result2) + result2 = usingKind; + } + return result2; + } + var init_esnext = __esm2({ + "src/compiler/transformers/esnext.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformJsx(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers + } = context2; + const compilerOptions = context2.getCompilerOptions(); + let currentSourceFile; + let currentFileState; + return chainBundle(context2, transformSourceFile); + function getCurrentFileNameExpression() { + if (currentFileState.filenameDeclaration) { + return currentFileState.filenameDeclaration.name; + } + const declaration = factory2.createVariableDeclaration( + factory2.createUniqueName( + "_jsxFileName", + 16 | 32 + /* FileLevel */ + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createStringLiteral(currentSourceFile.fileName) + ); + currentFileState.filenameDeclaration = declaration; + return currentFileState.filenameDeclaration.name; + } + function getJsxFactoryCalleePrimitive(isStaticChildren) { + return compilerOptions.jsx === 5 ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx"; + } + function getJsxFactoryCallee(isStaticChildren) { + const type3 = getJsxFactoryCalleePrimitive(isStaticChildren); + return getImplicitImportForName(type3); + } + function getImplicitJsxFragmentReference() { + return getImplicitImportForName("Fragment"); + } + function getImplicitImportForName(name2) { + var _a2, _b; + const importSource = name2 === "createElement" ? currentFileState.importSpecifier : getJSXRuntimeImport(currentFileState.importSpecifier, compilerOptions); + const existing = (_b = (_a2 = currentFileState.utilizedImplicitRuntimeImports) == null ? void 0 : _a2.get(importSource)) == null ? void 0 : _b.get(name2); + if (existing) { + return existing.name; + } + if (!currentFileState.utilizedImplicitRuntimeImports) { + currentFileState.utilizedImplicitRuntimeImports = /* @__PURE__ */ new Map(); + } + let specifierSourceImports = currentFileState.utilizedImplicitRuntimeImports.get(importSource); + if (!specifierSourceImports) { + specifierSourceImports = /* @__PURE__ */ new Map(); + currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports); + } + const generatedName = factory2.createUniqueName( + `_${name2}`, + 16 | 32 | 64 + /* AllowNameSubstitution */ + ); + const specifier = factory2.createImportSpecifier( + /*isTypeOnly*/ + false, + factory2.createIdentifier(name2), + generatedName + ); + setIdentifierGeneratedImportReference(generatedName, specifier); + specifierSourceImports.set(name2, specifier); + return generatedName; + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + currentFileState = {}; + currentFileState.importSpecifier = getJSXImplicitImportBase(compilerOptions, node); + let visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + let statements = visited.statements; + if (currentFileState.filenameDeclaration) { + statements = insertStatementAfterCustomPrologue(statements.slice(), factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [currentFileState.filenameDeclaration], + 2 + /* Const */ + ) + )); + } + if (currentFileState.utilizedImplicitRuntimeImports) { + for (const [importSource, importSpecifiersMap] of arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries())) { + if (isExternalModule(node)) { + const importStatement = factory2.createImportDeclaration( + /*modifiers*/ + void 0, + factory2.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory2.createNamedImports(arrayFrom(importSpecifiersMap.values())) + ), + factory2.createStringLiteral(importSource), + /*attributes*/ + void 0 + ); + setParentRecursive( + importStatement, + /*incremental*/ + false + ); + statements = insertStatementAfterCustomPrologue(statements.slice(), importStatement); + } else if (isExternalOrCommonJsModule(node)) { + const requireStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + factory2.createObjectBindingPattern(arrayFrom(importSpecifiersMap.values(), (s7) => factory2.createBindingElement( + /*dotDotDotToken*/ + void 0, + s7.propertyName, + s7.name + ))), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createCallExpression( + factory2.createIdentifier("require"), + /*typeArguments*/ + void 0, + [factory2.createStringLiteral(importSource)] + ) + ) + ], + 2 + /* Const */ + ) + ); + setParentRecursive( + requireStatement, + /*incremental*/ + false + ); + statements = insertStatementAfterCustomPrologue(statements.slice(), requireStatement); + } else { + } + } + } + if (statements !== visited.statements) { + visited = factory2.updateSourceFile(visited, statements); + } + currentFileState = void 0; + return visited; + } + function visitor(node) { + if (node.transformFlags & 2) { + return visitorWorker(node); + } else { + return node; + } + } + function visitorWorker(node) { + switch (node.kind) { + case 284: + return visitJsxElement( + node, + /*isChild*/ + false + ); + case 285: + return visitJsxSelfClosingElement( + node, + /*isChild*/ + false + ); + case 288: + return visitJsxFragment( + node, + /*isChild*/ + false + ); + case 294: + return visitJsxExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function transformJsxChildToExpression(node) { + switch (node.kind) { + case 12: + return visitJsxText(node); + case 294: + return visitJsxExpression(node); + case 284: + return visitJsxElement( + node, + /*isChild*/ + true + ); + case 285: + return visitJsxSelfClosingElement( + node, + /*isChild*/ + true + ); + case 288: + return visitJsxFragment( + node, + /*isChild*/ + true + ); + default: + return Debug.failBadSyntaxKind(node); + } + } + function hasProto(obj) { + return obj.properties.some( + (p7) => isPropertyAssignment(p7) && (isIdentifier(p7.name) && idText(p7.name) === "__proto__" || isStringLiteral(p7.name) && p7.name.text === "__proto__") + ); + } + function hasKeyAfterPropsSpread(node) { + let spread2 = false; + for (const elem of node.attributes.properties) { + if (isJsxSpreadAttribute(elem) && (!isObjectLiteralExpression(elem.expression) || elem.expression.properties.some(isSpreadAssignment))) { + spread2 = true; + } else if (spread2 && isJsxAttribute(elem) && isIdentifier(elem.name) && elem.name.escapedText === "key") { + return true; + } + } + return false; + } + function shouldUseCreateElement(node) { + return currentFileState.importSpecifier === void 0 || hasKeyAfterPropsSpread(node); + } + function visitJsxElement(node, isChild) { + const tagTransform = shouldUseCreateElement(node.openingElement) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; + return tagTransform( + node.openingElement, + node.children, + isChild, + /*location*/ + node + ); + } + function visitJsxSelfClosingElement(node, isChild) { + const tagTransform = shouldUseCreateElement(node) ? visitJsxOpeningLikeElementCreateElement : visitJsxOpeningLikeElementJSX; + return tagTransform( + node, + /*children*/ + void 0, + isChild, + /*location*/ + node + ); + } + function visitJsxFragment(node, isChild) { + const tagTransform = currentFileState.importSpecifier === void 0 ? visitJsxOpeningFragmentCreateElement : visitJsxOpeningFragmentJSX; + return tagTransform( + node.openingFragment, + node.children, + isChild, + /*location*/ + node + ); + } + function convertJsxChildrenToChildrenPropObject(children) { + const prop = convertJsxChildrenToChildrenPropAssignment(children); + return prop && factory2.createObjectLiteralExpression([prop]); + } + function convertJsxChildrenToChildrenPropAssignment(children) { + const nonWhitespaceChildren = getSemanticJsxChildren(children); + if (length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) { + const result22 = transformJsxChildToExpression(nonWhitespaceChildren[0]); + return result22 && factory2.createPropertyAssignment("children", result22); + } + const result2 = mapDefined(children, transformJsxChildToExpression); + return length(result2) ? factory2.createPropertyAssignment("children", factory2.createArrayLiteralExpression(result2)) : void 0; + } + function visitJsxOpeningLikeElementJSX(node, children, isChild, location2) { + const tagName = getTagName(node); + const childrenProp = children && children.length ? convertJsxChildrenToChildrenPropAssignment(children) : void 0; + const keyAttr = find2(node.attributes.properties, (p7) => !!p7.name && isIdentifier(p7.name) && p7.name.escapedText === "key"); + const attrs = keyAttr ? filter2(node.attributes.properties, (p7) => p7 !== keyAttr) : node.attributes.properties; + const objectProperties = length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) : factory2.createObjectLiteralExpression(childrenProp ? [childrenProp] : emptyArray); + return visitJsxOpeningLikeElementOrFragmentJSX( + tagName, + objectProperties, + keyAttr, + children || emptyArray, + isChild, + location2 + ); + } + function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location2) { + var _a2; + const nonWhitespaceChildren = getSemanticJsxChildren(children); + const isStaticChildren = length(nonWhitespaceChildren) > 1 || !!((_a2 = nonWhitespaceChildren[0]) == null ? void 0 : _a2.dotDotDotToken); + const args = [tagName, objectProperties]; + if (keyAttr) { + args.push(transformJsxAttributeInitializer(keyAttr.initializer)); + } + if (compilerOptions.jsx === 5) { + const originalFile = getOriginalNode(currentSourceFile); + if (originalFile && isSourceFile(originalFile)) { + if (keyAttr === void 0) { + args.push(factory2.createVoidZero()); + } + args.push(isStaticChildren ? factory2.createTrue() : factory2.createFalse()); + const lineCol = getLineAndCharacterOfPosition(originalFile, location2.pos); + args.push(factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("fileName", getCurrentFileNameExpression()), + factory2.createPropertyAssignment("lineNumber", factory2.createNumericLiteral(lineCol.line + 1)), + factory2.createPropertyAssignment("columnNumber", factory2.createNumericLiteral(lineCol.character + 1)) + ])); + args.push(factory2.createThis()); + } + } + const element = setTextRange( + factory2.createCallExpression( + getJsxFactoryCallee(isStaticChildren), + /*typeArguments*/ + void 0, + args + ), + location2 + ); + if (isChild) { + startOnNewLine(element); + } + return element; + } + function visitJsxOpeningLikeElementCreateElement(node, children, isChild, location2) { + const tagName = getTagName(node); + const attrs = node.attributes.properties; + const objectProperties = length(attrs) ? transformJsxAttributesToObjectProps(attrs) : factory2.createNull(); + const callee = currentFileState.importSpecifier === void 0 ? createJsxFactoryExpression( + factory2, + context2.getEmitResolver().getJsxFactoryEntity(currentSourceFile), + compilerOptions.reactNamespace, + // TODO: GH#18217 + node + ) : getImplicitImportForName("createElement"); + const element = createExpressionForJsxElement( + factory2, + callee, + tagName, + objectProperties, + mapDefined(children, transformJsxChildToExpression), + location2 + ); + if (isChild) { + startOnNewLine(element); + } + return element; + } + function visitJsxOpeningFragmentJSX(_node, children, isChild, location2) { + let childrenProps; + if (children && children.length) { + const result2 = convertJsxChildrenToChildrenPropObject(children); + if (result2) { + childrenProps = result2; + } + } + return visitJsxOpeningLikeElementOrFragmentJSX( + getImplicitJsxFragmentReference(), + childrenProps || factory2.createObjectLiteralExpression([]), + /*keyAttr*/ + void 0, + children, + isChild, + location2 + ); + } + function visitJsxOpeningFragmentCreateElement(node, children, isChild, location2) { + const element = createExpressionForJsxFragment( + factory2, + context2.getEmitResolver().getJsxFactoryEntity(currentSourceFile), + context2.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), + compilerOptions.reactNamespace, + // TODO: GH#18217 + mapDefined(children, transformJsxChildToExpression), + node, + location2 + ); + if (isChild) { + startOnNewLine(element); + } + return element; + } + function transformJsxSpreadAttributeToProps(node) { + if (isObjectLiteralExpression(node.expression) && !hasProto(node.expression)) { + return sameMap(node.expression.properties, (p7) => Debug.checkDefined(visitNode(p7, visitor, isObjectLiteralElementLike))); + } + return factory2.createSpreadAssignment(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); + } + function transformJsxAttributesToObjectProps(attrs, children) { + const target = getEmitScriptTarget(compilerOptions); + return target && target >= 5 ? factory2.createObjectLiteralExpression(transformJsxAttributesToProps(attrs, children)) : transformJsxAttributesToExpression(attrs, children); + } + function transformJsxAttributesToProps(attrs, children) { + const props = flatten2(spanMap(attrs, isJsxSpreadAttribute, (attrs2, isSpread) => flatten2(map4(attrs2, (attr) => isSpread ? transformJsxSpreadAttributeToProps(attr) : transformJsxAttributeToObjectLiteralElement(attr))))); + if (children) { + props.push(children); + } + return props; + } + function transformJsxAttributesToExpression(attrs, children) { + const expressions = []; + let properties = []; + for (const attr of attrs) { + if (isJsxSpreadAttribute(attr)) { + if (isObjectLiteralExpression(attr.expression) && !hasProto(attr.expression)) { + for (const prop of attr.expression.properties) { + if (isSpreadAssignment(prop)) { + finishObjectLiteralIfNeeded(); + expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression))); + continue; + } + properties.push(Debug.checkDefined(visitNode(prop, visitor))); + } + continue; + } + finishObjectLiteralIfNeeded(); + expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression))); + continue; + } + properties.push(transformJsxAttributeToObjectLiteralElement(attr)); + } + if (children) { + properties.push(children); + } + finishObjectLiteralIfNeeded(); + if (expressions.length && !isObjectLiteralExpression(expressions[0])) { + expressions.unshift(factory2.createObjectLiteralExpression()); + } + return singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions); + function finishObjectLiteralIfNeeded() { + if (properties.length) { + expressions.push(factory2.createObjectLiteralExpression(properties)); + properties = []; + } + } + } + function transformJsxAttributeToObjectLiteralElement(node) { + const name2 = getAttributeName(node); + const expression = transformJsxAttributeInitializer(node.initializer); + return factory2.createPropertyAssignment(name2, expression); + } + function transformJsxAttributeInitializer(node) { + if (node === void 0) { + return factory2.createTrue(); + } + if (node.kind === 11) { + const singleQuote2 = node.singleQuote !== void 0 ? node.singleQuote : !isStringDoubleQuoted(node, currentSourceFile); + const literal = factory2.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote2); + return setTextRange(literal, node); + } + if (node.kind === 294) { + if (node.expression === void 0) { + return factory2.createTrue(); + } + return Debug.checkDefined(visitNode(node.expression, visitor, isExpression)); + } + if (isJsxElement(node)) { + return visitJsxElement( + node, + /*isChild*/ + false + ); + } + if (isJsxSelfClosingElement(node)) { + return visitJsxSelfClosingElement( + node, + /*isChild*/ + false + ); + } + if (isJsxFragment(node)) { + return visitJsxFragment( + node, + /*isChild*/ + false + ); + } + return Debug.failBadSyntaxKind(node); + } + function visitJsxText(node) { + const fixed = fixupWhitespaceAndDecodeEntities(node.text); + return fixed === void 0 ? void 0 : factory2.createStringLiteral(fixed); + } + function fixupWhitespaceAndDecodeEntities(text) { + let acc; + let firstNonWhitespace = 0; + let lastNonWhitespace = -1; + for (let i7 = 0; i7 < text.length; i7++) { + const c7 = text.charCodeAt(i7); + if (isLineBreak2(c7)) { + if (firstNonWhitespace !== -1 && lastNonWhitespace !== -1) { + acc = addLineOfJsxText(acc, text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1)); + } + firstNonWhitespace = -1; + } else if (!isWhiteSpaceSingleLine(c7)) { + lastNonWhitespace = i7; + if (firstNonWhitespace === -1) { + firstNonWhitespace = i7; + } + } + } + return firstNonWhitespace !== -1 ? addLineOfJsxText(acc, text.substr(firstNonWhitespace)) : acc; + } + function addLineOfJsxText(acc, trimmedLine) { + const decoded = decodeEntities(trimmedLine); + return acc === void 0 ? decoded : acc + " " + decoded; + } + function decodeEntities(text) { + return text.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g, (match, _all, _number, _digits, decimal, hex, word) => { + if (decimal) { + return utf16EncodeAsString(parseInt(decimal, 10)); + } else if (hex) { + return utf16EncodeAsString(parseInt(hex, 16)); + } else { + const ch = entities.get(word); + return ch ? utf16EncodeAsString(ch) : match; + } + }); + } + function tryDecodeEntities(text) { + const decoded = decodeEntities(text); + return decoded === text ? void 0 : decoded; + } + function getTagName(node) { + if (node.kind === 284) { + return getTagName(node.openingElement); + } else { + const tagName = node.tagName; + if (isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText)) { + return factory2.createStringLiteral(idText(tagName)); + } else if (isJsxNamespacedName(tagName)) { + return factory2.createStringLiteral(idText(tagName.namespace) + ":" + idText(tagName.name)); + } else { + return createExpressionFromEntityName(factory2, tagName); + } + } + } + function getAttributeName(node) { + const name2 = node.name; + if (isIdentifier(name2)) { + const text = idText(name2); + return /^[A-Za-z_]\w*$/.test(text) ? name2 : factory2.createStringLiteral(text); + } + return factory2.createStringLiteral(idText(name2.namespace) + ":" + idText(name2.name)); + } + function visitJsxExpression(node) { + const expression = visitNode(node.expression, visitor, isExpression); + return node.dotDotDotToken ? factory2.createSpreadElement(expression) : expression; + } + } + var entities; + var init_jsx = __esm2({ + "src/compiler/transformers/jsx.ts"() { + "use strict"; + init_ts2(); + entities = new Map(Object.entries({ + quot: 34, + amp: 38, + apos: 39, + lt: 60, + gt: 62, + nbsp: 160, + iexcl: 161, + cent: 162, + pound: 163, + curren: 164, + yen: 165, + brvbar: 166, + sect: 167, + uml: 168, + copy: 169, + ordf: 170, + laquo: 171, + not: 172, + shy: 173, + reg: 174, + macr: 175, + deg: 176, + plusmn: 177, + sup2: 178, + sup3: 179, + acute: 180, + micro: 181, + para: 182, + middot: 183, + cedil: 184, + sup1: 185, + ordm: 186, + raquo: 187, + frac14: 188, + frac12: 189, + frac34: 190, + iquest: 191, + Agrave: 192, + Aacute: 193, + Acirc: 194, + Atilde: 195, + Auml: 196, + Aring: 197, + AElig: 198, + Ccedil: 199, + Egrave: 200, + Eacute: 201, + Ecirc: 202, + Euml: 203, + Igrave: 204, + Iacute: 205, + Icirc: 206, + Iuml: 207, + ETH: 208, + Ntilde: 209, + Ograve: 210, + Oacute: 211, + Ocirc: 212, + Otilde: 213, + Ouml: 214, + times: 215, + Oslash: 216, + Ugrave: 217, + Uacute: 218, + Ucirc: 219, + Uuml: 220, + Yacute: 221, + THORN: 222, + szlig: 223, + agrave: 224, + aacute: 225, + acirc: 226, + atilde: 227, + auml: 228, + aring: 229, + aelig: 230, + ccedil: 231, + egrave: 232, + eacute: 233, + ecirc: 234, + euml: 235, + igrave: 236, + iacute: 237, + icirc: 238, + iuml: 239, + eth: 240, + ntilde: 241, + ograve: 242, + oacute: 243, + ocirc: 244, + otilde: 245, + ouml: 246, + divide: 247, + oslash: 248, + ugrave: 249, + uacute: 250, + ucirc: 251, + uuml: 252, + yacute: 253, + thorn: 254, + yuml: 255, + OElig: 338, + oelig: 339, + Scaron: 352, + scaron: 353, + Yuml: 376, + fnof: 402, + circ: 710, + tilde: 732, + Alpha: 913, + Beta: 914, + Gamma: 915, + Delta: 916, + Epsilon: 917, + Zeta: 918, + Eta: 919, + Theta: 920, + Iota: 921, + Kappa: 922, + Lambda: 923, + Mu: 924, + Nu: 925, + Xi: 926, + Omicron: 927, + Pi: 928, + Rho: 929, + Sigma: 931, + Tau: 932, + Upsilon: 933, + Phi: 934, + Chi: 935, + Psi: 936, + Omega: 937, + alpha: 945, + beta: 946, + gamma: 947, + delta: 948, + epsilon: 949, + zeta: 950, + eta: 951, + theta: 952, + iota: 953, + kappa: 954, + lambda: 955, + mu: 956, + nu: 957, + xi: 958, + omicron: 959, + pi: 960, + rho: 961, + sigmaf: 962, + sigma: 963, + tau: 964, + upsilon: 965, + phi: 966, + chi: 967, + psi: 968, + omega: 969, + thetasym: 977, + upsih: 978, + piv: 982, + ensp: 8194, + emsp: 8195, + thinsp: 8201, + zwnj: 8204, + zwj: 8205, + lrm: 8206, + rlm: 8207, + ndash: 8211, + mdash: 8212, + lsquo: 8216, + rsquo: 8217, + sbquo: 8218, + ldquo: 8220, + rdquo: 8221, + bdquo: 8222, + dagger: 8224, + Dagger: 8225, + bull: 8226, + hellip: 8230, + permil: 8240, + prime: 8242, + Prime: 8243, + lsaquo: 8249, + rsaquo: 8250, + oline: 8254, + frasl: 8260, + euro: 8364, + image: 8465, + weierp: 8472, + real: 8476, + trade: 8482, + alefsym: 8501, + larr: 8592, + uarr: 8593, + rarr: 8594, + darr: 8595, + harr: 8596, + crarr: 8629, + lArr: 8656, + uArr: 8657, + rArr: 8658, + dArr: 8659, + hArr: 8660, + forall: 8704, + part: 8706, + exist: 8707, + empty: 8709, + nabla: 8711, + isin: 8712, + notin: 8713, + ni: 8715, + prod: 8719, + sum: 8721, + minus: 8722, + lowast: 8727, + radic: 8730, + prop: 8733, + infin: 8734, + ang: 8736, + and: 8743, + or: 8744, + cap: 8745, + cup: 8746, + int: 8747, + there4: 8756, + sim: 8764, + cong: 8773, + asymp: 8776, + ne: 8800, + equiv: 8801, + le: 8804, + ge: 8805, + sub: 8834, + sup: 8835, + nsub: 8836, + sube: 8838, + supe: 8839, + oplus: 8853, + otimes: 8855, + perp: 8869, + sdot: 8901, + lceil: 8968, + rceil: 8969, + lfloor: 8970, + rfloor: 8971, + lang: 9001, + rang: 9002, + loz: 9674, + spades: 9824, + clubs: 9827, + hearts: 9829, + diams: 9830 + })); + } + }); + function transformES2016(context2) { + const { + factory: factory2, + hoistVariableDeclaration + } = context2; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + if ((node.transformFlags & 512) === 0) { + return node; + } + switch (node.kind) { + case 226: + return visitBinaryExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitBinaryExpression(node) { + switch (node.operatorToken.kind) { + case 68: + return visitExponentiationAssignmentExpression(node); + case 43: + return visitExponentiationExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitExponentiationAssignmentExpression(node) { + let target; + let value2; + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, visitor, isExpression); + if (isElementAccessExpression(left)) { + const expressionTemp = factory2.createTempVariable(hoistVariableDeclaration); + const argumentExpressionTemp = factory2.createTempVariable(hoistVariableDeclaration); + target = setTextRange( + factory2.createElementAccessExpression( + setTextRange(factory2.createAssignment(expressionTemp, left.expression), left.expression), + setTextRange(factory2.createAssignment(argumentExpressionTemp, left.argumentExpression), left.argumentExpression) + ), + left + ); + value2 = setTextRange( + factory2.createElementAccessExpression( + expressionTemp, + argumentExpressionTemp + ), + left + ); + } else if (isPropertyAccessExpression(left)) { + const expressionTemp = factory2.createTempVariable(hoistVariableDeclaration); + target = setTextRange( + factory2.createPropertyAccessExpression( + setTextRange(factory2.createAssignment(expressionTemp, left.expression), left.expression), + left.name + ), + left + ); + value2 = setTextRange( + factory2.createPropertyAccessExpression( + expressionTemp, + left.name + ), + left + ); + } else { + target = left; + value2 = left; + } + return setTextRange( + factory2.createAssignment( + target, + setTextRange(factory2.createGlobalMethodCall("Math", "pow", [value2, right]), node) + ), + node + ); + } + function visitExponentiationExpression(node) { + const left = visitNode(node.left, visitor, isExpression); + const right = visitNode(node.right, visitor, isExpression); + return setTextRange(factory2.createGlobalMethodCall("Math", "pow", [left, right]), node); + } + } + var init_es2016 = __esm2({ + "src/compiler/transformers/es2016.ts"() { + "use strict"; + init_ts2(); + } + }); + function createSpreadSegment(kind, expression) { + return { kind, expression }; + } + function transformES2015(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + resumeLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const compilerOptions = context2.getCompilerOptions(); + const resolver = context2.getEmitResolver(); + const previousOnSubstituteNode = context2.onSubstituteNode; + const previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + let currentSourceFile; + let currentText; + let hierarchyFacts; + let taggedTemplateStringDeclarations; + function recordTaggedTemplateString(temp) { + taggedTemplateStringDeclarations = append( + taggedTemplateStringDeclarations, + factory2.createVariableDeclaration(temp) + ); + } + let convertedLoopState; + let enabledSubstitutions; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + currentText = node.text; + const visited = visitSourceFile(node); + addEmitHelpers(visited, context2.readEmitHelpers()); + currentSourceFile = void 0; + currentText = void 0; + taggedTemplateStringDeclarations = void 0; + hierarchyFacts = 0; + return visited; + } + function enterSubtree(excludeFacts, includeFacts) { + const ancestorFacts = hierarchyFacts; + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & 32767; + return ancestorFacts; + } + function exitSubtree(ancestorFacts, excludeFacts, includeFacts) { + hierarchyFacts = (hierarchyFacts & ~excludeFacts | includeFacts) & -32768 | ancestorFacts; + } + function isReturnVoidStatementInConstructorWithCapturedSuper(node) { + return (hierarchyFacts & 8192) !== 0 && node.kind === 253 && !node.expression; + } + function isOrMayContainReturnCompletion(node) { + return node.transformFlags & 4194304 && (isReturnStatement(node) || isIfStatement(node) || isWithStatement(node) || isSwitchStatement(node) || isCaseBlock(node) || isCaseClause(node) || isDefaultClause(node) || isTryStatement(node) || isCatchClause(node) || isLabeledStatement(node) || isIterationStatement( + node, + /*lookInLabeledStatements*/ + false + ) || isBlock2(node)); + } + function shouldVisitNode(node) { + return (node.transformFlags & 1024) !== 0 || convertedLoopState !== void 0 || hierarchyFacts & 8192 && isOrMayContainReturnCompletion(node) || isIterationStatement( + node, + /*lookInLabeledStatements*/ + false + ) && shouldConvertIterationStatement(node) || (getInternalEmitFlags(node) & 1) !== 0; + } + function visitor(node) { + return shouldVisitNode(node) ? visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ) : node; + } + function visitorWithUnusedExpressionResult(node) { + return shouldVisitNode(node) ? visitorWorker( + node, + /*expressionResultIsUnused*/ + true + ) : node; + } + function classWrapperStatementVisitor(node) { + if (shouldVisitNode(node)) { + const original = getOriginalNode(node); + if (isPropertyDeclaration(original) && hasStaticModifier(original)) { + const ancestorFacts = enterSubtree( + 32670, + 16449 + /* StaticInitializerIncludes */ + ); + const result2 = visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + return result2; + } + return visitorWorker( + node, + /*expressionResultIsUnused*/ + false + ); + } + return node; + } + function callExpressionVisitor(node) { + if (node.kind === 108) { + return visitSuperKeyword( + node, + /*isExpressionOfCall*/ + true + ); + } + return visitor(node); + } + function visitorWorker(node, expressionResultIsUnused2) { + switch (node.kind) { + case 126: + return void 0; + case 263: + return visitClassDeclaration(node); + case 231: + return visitClassExpression(node); + case 169: + return visitParameter(node); + case 262: + return visitFunctionDeclaration(node); + case 219: + return visitArrowFunction(node); + case 218: + return visitFunctionExpression(node); + case 260: + return visitVariableDeclaration(node); + case 80: + return visitIdentifier(node); + case 261: + return visitVariableDeclarationList(node); + case 255: + return visitSwitchStatement(node); + case 269: + return visitCaseBlock(node); + case 241: + return visitBlock( + node, + /*isFunctionBody*/ + false + ); + case 252: + case 251: + return visitBreakOrContinueStatement(node); + case 256: + return visitLabeledStatement(node); + case 246: + case 247: + return visitDoOrWhileStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 248: + return visitForStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 249: + return visitForInStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 250: + return visitForOfStatement( + node, + /*outermostLabeledStatement*/ + void 0 + ); + case 244: + return visitExpressionStatement(node); + case 210: + return visitObjectLiteralExpression(node); + case 299: + return visitCatchClause(node); + case 304: + return visitShorthandPropertyAssignment(node); + case 167: + return visitComputedPropertyName(node); + case 209: + return visitArrayLiteralExpression(node); + case 213: + return visitCallExpression(node); + case 214: + return visitNewExpression(node); + case 217: + return visitParenthesizedExpression(node, expressionResultIsUnused2); + case 226: + return visitBinaryExpression(node, expressionResultIsUnused2); + case 361: + return visitCommaListExpression(node, expressionResultIsUnused2); + case 15: + case 16: + case 17: + case 18: + return visitTemplateLiteral(node); + case 11: + return visitStringLiteral(node); + case 9: + return visitNumericLiteral(node); + case 215: + return visitTaggedTemplateExpression(node); + case 228: + return visitTemplateExpression(node); + case 229: + return visitYieldExpression(node); + case 230: + return visitSpreadElement(node); + case 108: + return visitSuperKeyword( + node, + /*isExpressionOfCall*/ + false + ); + case 110: + return visitThisKeyword(node); + case 236: + return visitMetaProperty(node); + case 174: + return visitMethodDeclaration(node); + case 177: + case 178: + return visitAccessorDeclaration(node); + case 243: + return visitVariableStatement(node); + case 253: + return visitReturnStatement(node); + case 222: + return visitVoidExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitSourceFile(node) { + const ancestorFacts = enterSubtree( + 8064, + 64 + /* SourceFileIncludes */ + ); + const prologue = []; + const statements = []; + startLexicalEnvironment(); + const statementOffset = factory2.copyPrologue( + node.statements, + prologue, + /*ensureUseStrict*/ + false, + visitor + ); + addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset)); + if (taggedTemplateStringDeclarations) { + statements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList(taggedTemplateStringDeclarations) + ) + ); + } + factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + insertCaptureThisForNodeIfNeeded(prologue, node); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return factory2.updateSourceFile( + node, + setTextRange(factory2.createNodeArray(concatenate(prologue, statements)), node.statements) + ); + } + function visitSwitchStatement(node) { + if (convertedLoopState !== void 0) { + const savedAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps |= 2; + const result2 = visitEachChild(node, visitor, context2); + convertedLoopState.allowedNonLabeledJumps = savedAllowedNonLabeledJumps; + return result2; + } + return visitEachChild(node, visitor, context2); + } + function visitCaseBlock(node) { + const ancestorFacts = enterSubtree( + 7104, + 0 + /* BlockScopeIncludes */ + ); + const updated = visitEachChild(node, visitor, context2); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function returnCapturedThis(node) { + return setOriginalNode(factory2.createReturnStatement(createCapturedThis()), node); + } + function createCapturedThis() { + return factory2.createUniqueName( + "_this", + 16 | 32 + /* FileLevel */ + ); + } + function visitReturnStatement(node) { + if (convertedLoopState) { + convertedLoopState.nonLocalJumps |= 8; + if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + node = returnCapturedThis(node); + } + return factory2.createReturnStatement( + factory2.createObjectLiteralExpression( + [ + factory2.createPropertyAssignment( + factory2.createIdentifier("value"), + node.expression ? Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) : factory2.createVoidZero() + ) + ] + ) + ); + } else if (isReturnVoidStatementInConstructorWithCapturedSuper(node)) { + return returnCapturedThis(node); + } + return visitEachChild(node, visitor, context2); + } + function visitThisKeyword(node) { + hierarchyFacts |= 65536; + if (hierarchyFacts & 2 && !(hierarchyFacts & 16384)) { + hierarchyFacts |= 131072; + } + if (convertedLoopState) { + if (hierarchyFacts & 2) { + convertedLoopState.containsLexicalThis = true; + return node; + } + return convertedLoopState.thisName || (convertedLoopState.thisName = factory2.createUniqueName("this")); + } + return node; + } + function visitVoidExpression(node) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitIdentifier(node) { + if (convertedLoopState) { + if (resolver.isArgumentsLocalBinding(node)) { + return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments")); + } + } + if (node.flags & 256) { + return setOriginalNode( + setTextRange( + factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)), + node + ), + node + ); + } + return node; + } + function visitBreakOrContinueStatement(node) { + if (convertedLoopState) { + const jump = node.kind === 252 ? 2 : 4; + const canUseBreakOrContinue = node.label && convertedLoopState.labels && convertedLoopState.labels.get(idText(node.label)) || !node.label && convertedLoopState.allowedNonLabeledJumps & jump; + if (!canUseBreakOrContinue) { + let labelMarker; + const label = node.label; + if (!label) { + if (node.kind === 252) { + convertedLoopState.nonLocalJumps |= 2; + labelMarker = "break"; + } else { + convertedLoopState.nonLocalJumps |= 4; + labelMarker = "continue"; + } + } else { + if (node.kind === 252) { + labelMarker = `break-${label.escapedText}`; + setLabeledJump( + convertedLoopState, + /*isBreak*/ + true, + idText(label), + labelMarker + ); + } else { + labelMarker = `continue-${label.escapedText}`; + setLabeledJump( + convertedLoopState, + /*isBreak*/ + false, + idText(label), + labelMarker + ); + } + } + let returnExpression = factory2.createStringLiteral(labelMarker); + if (convertedLoopState.loopOutParameters.length) { + const outParams = convertedLoopState.loopOutParameters; + let expr; + for (let i7 = 0; i7 < outParams.length; i7++) { + const copyExpr = copyOutParameter( + outParams[i7], + 1 + /* ToOutParameter */ + ); + if (i7 === 0) { + expr = copyExpr; + } else { + expr = factory2.createBinaryExpression(expr, 28, copyExpr); + } + } + returnExpression = factory2.createBinaryExpression(expr, 28, returnExpression); + } + return factory2.createReturnStatement(returnExpression); + } + } + return visitEachChild(node, visitor, context2); + } + function visitClassDeclaration(node) { + const variable = factory2.createVariableDeclaration( + factory2.getLocalName( + node, + /*allowComments*/ + true + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + transformClassLikeDeclarationToExpression(node) + ); + setOriginalNode(variable, node); + const statements = []; + const statement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([variable]) + ); + setOriginalNode(statement, node); + setTextRange(statement, node); + startOnNewLine(statement); + statements.push(statement); + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + const exportStatement = hasSyntacticModifier( + node, + 2048 + /* Default */ + ) ? factory2.createExportDefault(factory2.getLocalName(node)) : factory2.createExternalModuleExport(factory2.getLocalName(node)); + setOriginalNode(exportStatement, statement); + statements.push(exportStatement); + } + return singleOrMany(statements); + } + function visitClassExpression(node) { + return transformClassLikeDeclarationToExpression(node); + } + function transformClassLikeDeclarationToExpression(node) { + if (node.name) { + enableSubstitutionsForBlockScopedBindings(); + } + const extendsClauseElement = getClassExtendsHeritageElement(node); + const classFunction = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + extendsClauseElement ? [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + createSyntheticSuper() + )] : [], + /*type*/ + void 0, + transformClassBody(node, extendsClauseElement) + ); + setEmitFlags( + classFunction, + getEmitFlags(node) & 131072 | 1048576 + /* ReuseTempVariableScope */ + ); + const inner = factory2.createPartiallyEmittedExpression(classFunction); + setTextRangeEnd(inner, node.end); + setEmitFlags( + inner, + 3072 + /* NoComments */ + ); + const outer = factory2.createPartiallyEmittedExpression(inner); + setTextRangeEnd(outer, skipTrivia(currentText, node.pos)); + setEmitFlags( + outer, + 3072 + /* NoComments */ + ); + const result2 = factory2.createParenthesizedExpression( + factory2.createCallExpression( + outer, + /*typeArguments*/ + void 0, + extendsClauseElement ? [Debug.checkDefined(visitNode(extendsClauseElement.expression, visitor, isExpression))] : [] + ) + ); + addSyntheticLeadingComment(result2, 3, "* @class "); + return result2; + } + function transformClassBody(node, extendsClauseElement) { + const statements = []; + const name2 = factory2.getInternalName(node); + const constructorLikeName = isIdentifierANonContextualKeyword(name2) ? factory2.getGeneratedNameForNode(name2) : name2; + startLexicalEnvironment(); + addExtendsHelperIfNeeded(statements, node, extendsClauseElement); + addConstructor(statements, node, constructorLikeName, extendsClauseElement); + addClassMembers(statements, node); + const closingBraceLocation = createTokenRange( + skipTrivia(currentText, node.members.end), + 20 + /* CloseBraceToken */ + ); + const outer = factory2.createPartiallyEmittedExpression(constructorLikeName); + setTextRangeEnd(outer, closingBraceLocation.end); + setEmitFlags( + outer, + 3072 + /* NoComments */ + ); + const statement = factory2.createReturnStatement(outer); + setTextRangePos(statement, closingBraceLocation.pos); + setEmitFlags( + statement, + 3072 | 768 + /* NoTokenSourceMaps */ + ); + statements.push(statement); + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + const block = factory2.createBlock( + setTextRange( + factory2.createNodeArray(statements), + /*location*/ + node.members + ), + /*multiLine*/ + true + ); + setEmitFlags( + block, + 3072 + /* NoComments */ + ); + return block; + } + function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { + if (extendsClauseElement) { + statements.push( + setTextRange( + factory2.createExpressionStatement( + emitHelpers().createExtendsHelper(factory2.getInternalName(node)) + ), + /*location*/ + extendsClauseElement + ) + ); + } + } + function addConstructor(statements, node, name2, extendsClauseElement) { + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const ancestorFacts = enterSubtree( + 32662, + 73 + /* ConstructorIncludes */ + ); + const constructor = getFirstConstructorWithBody(node); + const hasSynthesizedSuper = hasSynthesizedDefaultSuperCall(constructor, extendsClauseElement !== void 0); + const constructorFunction = factory2.createFunctionDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + name2, + /*typeParameters*/ + void 0, + transformConstructorParameters(constructor, hasSynthesizedSuper), + /*type*/ + void 0, + transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) + ); + setTextRange(constructorFunction, constructor || node); + if (extendsClauseElement) { + setEmitFlags( + constructorFunction, + 16 + /* CapturesThis */ + ); + } + statements.push(constructorFunction); + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + } + function transformConstructorParameters(constructor, hasSynthesizedSuper) { + return visitParameterList(constructor && !hasSynthesizedSuper ? constructor.parameters : void 0, visitor, context2) || []; + } + function createDefaultConstructorBody(node, isDerivedClass) { + const statements = []; + resumeLexicalEnvironment(); + factory2.mergeLexicalEnvironment(statements, endLexicalEnvironment()); + if (isDerivedClass) { + statements.push(factory2.createReturnStatement(createDefaultSuperCallOrThis())); + } + const statementsArray = factory2.createNodeArray(statements); + setTextRange(statementsArray, node.members); + const block = factory2.createBlock( + statementsArray, + /*multiLine*/ + true + ); + setTextRange(block, node); + setEmitFlags( + block, + 3072 + /* NoComments */ + ); + return block; + } + function isUninitializedVariableStatement(node) { + return isVariableStatement(node) && every2(node.declarationList.declarations, (decl) => isIdentifier(decl.name) && !decl.initializer); + } + function containsSuperCall(node) { + if (isSuperCall(node)) { + return true; + } + if (!(node.transformFlags & 134217728)) { + return false; + } + switch (node.kind) { + case 219: + case 218: + case 262: + case 176: + case 175: + return false; + case 177: + case 178: + case 174: + case 172: { + const named = node; + if (isComputedPropertyName(named.name)) { + return !!forEachChild(named.name, containsSuperCall); + } + return false; + } + } + return !!forEachChild(node, containsSuperCall); + } + function transformConstructorBody(constructor, node, extendsClauseElement, hasSynthesizedSuper) { + const isDerivedClass = !!extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== 106; + if (!constructor) + return createDefaultConstructorBody(node, isDerivedClass); + const prologue = []; + const statements = []; + resumeLexicalEnvironment(); + const standardPrologueEnd = factory2.copyStandardPrologue( + constructor.body.statements, + prologue, + /*statementOffset*/ + 0 + ); + if (hasSynthesizedSuper || containsSuperCall(constructor.body)) { + hierarchyFacts |= 8192; + } + addRange(statements, visitNodes2(constructor.body.statements, visitor, isStatement, standardPrologueEnd)); + const mayReplaceThis = isDerivedClass || hierarchyFacts & 8192; + addDefaultValueAssignmentsIfNeeded2(prologue, constructor); + addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper); + insertCaptureNewTargetIfNeeded(prologue, constructor); + if (mayReplaceThis) { + insertCaptureThisForNode(prologue, constructor, createActualThis()); + } else { + insertCaptureThisForNodeIfNeeded(prologue, constructor); + } + factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + if (mayReplaceThis && !isSufficientlyCoveredByReturnStatements(constructor.body)) { + statements.push(factory2.createReturnStatement(createCapturedThis())); + } + const body = factory2.createBlock( + setTextRange( + factory2.createNodeArray( + [ + ...prologue, + ...statements + ] + ), + /*location*/ + constructor.body.statements + ), + /*multiLine*/ + true + ); + setTextRange(body, constructor.body); + return simplifyConstructor(body, constructor.body, hasSynthesizedSuper); + } + function isCapturedThis(node) { + return isGeneratedIdentifier(node) && idText(node) === "_this"; + } + function isSyntheticSuper(node) { + return isGeneratedIdentifier(node) && idText(node) === "_super"; + } + function isThisCapturingVariableStatement(node) { + return isVariableStatement(node) && node.declarationList.declarations.length === 1 && isThisCapturingVariableDeclaration(node.declarationList.declarations[0]); + } + function isThisCapturingVariableDeclaration(node) { + return isVariableDeclaration(node) && isCapturedThis(node.name) && !!node.initializer; + } + function isThisCapturingAssignment(node) { + return isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + ) && isCapturedThis(node.left); + } + function isTransformedSuperCall(node) { + return isCallExpression(node) && isPropertyAccessExpression(node.expression) && isSyntheticSuper(node.expression.expression) && isIdentifier(node.expression.name) && (idText(node.expression.name) === "call" || idText(node.expression.name) === "apply") && node.arguments.length >= 1 && node.arguments[0].kind === 110; + } + function isTransformedSuperCallWithFallback(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 57 && node.right.kind === 110 && isTransformedSuperCall(node.left); + } + function isImplicitSuperCall(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 56 && isBinaryExpression(node.left) && node.left.operatorToken.kind === 38 && isSyntheticSuper(node.left.left) && node.left.right.kind === 106 && isTransformedSuperCall(node.right) && idText(node.right.expression.name) === "apply"; + } + function isImplicitSuperCallWithFallback(node) { + return isBinaryExpression(node) && node.operatorToken.kind === 57 && node.right.kind === 110 && isImplicitSuperCall(node.left); + } + function isThisCapturingTransformedSuperCallWithFallback(node) { + return isThisCapturingAssignment(node) && isTransformedSuperCallWithFallback(node.right); + } + function isThisCapturingImplicitSuperCallWithFallback(node) { + return isThisCapturingAssignment(node) && isImplicitSuperCallWithFallback(node.right); + } + function isTransformedSuperCallLike(node) { + return isTransformedSuperCall(node) || isTransformedSuperCallWithFallback(node) || isThisCapturingTransformedSuperCallWithFallback(node) || isImplicitSuperCall(node) || isImplicitSuperCallWithFallback(node) || isThisCapturingImplicitSuperCallWithFallback(node); + } + function simplifyConstructorInlineSuperInThisCaptureVariable(body) { + for (let i7 = 0; i7 < body.statements.length - 1; i7++) { + const statement = body.statements[i7]; + if (!isThisCapturingVariableStatement(statement)) { + continue; + } + const varDecl = statement.declarationList.declarations[0]; + if (varDecl.initializer.kind !== 110) { + continue; + } + const thisCaptureStatementIndex = i7; + let superCallIndex = i7 + 1; + while (superCallIndex < body.statements.length) { + const statement2 = body.statements[superCallIndex]; + if (isExpressionStatement(statement2)) { + if (isTransformedSuperCallLike(skipOuterExpressions(statement2.expression))) { + break; + } + } + if (isUninitializedVariableStatement(statement2)) { + superCallIndex++; + continue; + } + return body; + } + const following = body.statements[superCallIndex]; + let expression = following.expression; + if (isThisCapturingAssignment(expression)) { + expression = expression.right; + } + const newVarDecl = factory2.updateVariableDeclaration( + varDecl, + varDecl.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + expression + ); + const newDeclList = factory2.updateVariableDeclarationList(statement.declarationList, [newVarDecl]); + const newVarStatement = factory2.createVariableStatement(statement.modifiers, newDeclList); + setOriginalNode(newVarStatement, following); + setTextRange(newVarStatement, following); + const newStatements = factory2.createNodeArray([ + ...body.statements.slice(0, thisCaptureStatementIndex), + // copy statements preceding to `var _this` + ...body.statements.slice(thisCaptureStatementIndex + 1, superCallIndex), + // copy intervening temp variables + newVarStatement, + ...body.statements.slice(superCallIndex + 1) + // copy statements following `super.call(this, ...)` + ]); + setTextRange(newStatements, body.statements); + return factory2.updateBlock(body, newStatements); + } + return body; + } + function simplifyConstructorInlineSuperReturn(body, original) { + for (const statement of original.statements) { + if (statement.transformFlags & 134217728 && !getSuperCallFromStatement(statement)) { + return body; + } + } + const canElideThisCapturingVariable = !(original.transformFlags & 16384) && !(hierarchyFacts & 65536) && !(hierarchyFacts & 131072); + for (let i7 = body.statements.length - 1; i7 > 0; i7--) { + const statement = body.statements[i7]; + if (isReturnStatement(statement) && statement.expression && isCapturedThis(statement.expression)) { + const preceding = body.statements[i7 - 1]; + let expression; + if (isExpressionStatement(preceding) && isThisCapturingTransformedSuperCallWithFallback(skipOuterExpressions(preceding.expression))) { + expression = preceding.expression; + } else if (canElideThisCapturingVariable && isThisCapturingVariableStatement(preceding)) { + const varDecl = preceding.declarationList.declarations[0]; + if (isTransformedSuperCallLike(skipOuterExpressions(varDecl.initializer))) { + expression = factory2.createAssignment( + createCapturedThis(), + varDecl.initializer + ); + } + } + if (!expression) { + break; + } + const newReturnStatement = factory2.createReturnStatement(expression); + setOriginalNode(newReturnStatement, preceding); + setTextRange(newReturnStatement, preceding); + const newStatements = factory2.createNodeArray([ + ...body.statements.slice(0, i7 - 1), + // copy all statements preceding `_super.call(this, ...)` + newReturnStatement, + ...body.statements.slice(i7 + 1) + // copy all statements following `return _this;` + ]); + setTextRange(newStatements, body.statements); + return factory2.updateBlock(body, newStatements); + } + } + return body; + } + function elideUnusedThisCaptureWorker(node) { + if (isThisCapturingVariableStatement(node)) { + const varDecl = node.declarationList.declarations[0]; + if (varDecl.initializer.kind === 110) { + return void 0; + } + } else if (isThisCapturingAssignment(node)) { + return factory2.createPartiallyEmittedExpression(node.right, node); + } + switch (node.kind) { + case 219: + case 218: + case 262: + case 176: + case 175: + return node; + case 177: + case 178: + case 174: + case 172: { + const named = node; + if (isComputedPropertyName(named.name)) { + return factory2.replacePropertyName(named, visitEachChild( + named.name, + elideUnusedThisCaptureWorker, + /*context*/ + void 0 + )); + } + return node; + } + } + return visitEachChild( + node, + elideUnusedThisCaptureWorker, + /*context*/ + void 0 + ); + } + function simplifyConstructorElideUnusedThisCapture(body, original) { + if (original.transformFlags & 16384 || hierarchyFacts & 65536 || hierarchyFacts & 131072) { + return body; + } + for (const statement of original.statements) { + if (statement.transformFlags & 134217728 && !getSuperCallFromStatement(statement)) { + return body; + } + } + return factory2.updateBlock(body, visitNodes2(body.statements, elideUnusedThisCaptureWorker, isStatement)); + } + function injectSuperPresenceCheckWorker(node) { + if (isTransformedSuperCall(node) && node.arguments.length === 2 && isIdentifier(node.arguments[1]) && idText(node.arguments[1]) === "arguments") { + return factory2.createLogicalAnd( + factory2.createStrictInequality( + createSyntheticSuper(), + factory2.createNull() + ), + node + ); + } + switch (node.kind) { + case 219: + case 218: + case 262: + case 176: + case 175: + return node; + case 177: + case 178: + case 174: + case 172: { + const named = node; + if (isComputedPropertyName(named.name)) { + return factory2.replacePropertyName(named, visitEachChild( + named.name, + injectSuperPresenceCheckWorker, + /*context*/ + void 0 + )); + } + return node; + } + } + return visitEachChild( + node, + injectSuperPresenceCheckWorker, + /*context*/ + void 0 + ); + } + function complicateConstructorInjectSuperPresenceCheck(body) { + return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement)); + } + function simplifyConstructor(body, original, hasSynthesizedSuper) { + const inputBody = body; + body = simplifyConstructorInlineSuperInThisCaptureVariable(body); + body = simplifyConstructorInlineSuperReturn(body, original); + if (body !== inputBody) { + body = simplifyConstructorElideUnusedThisCapture(body, original); + } + if (hasSynthesizedSuper) { + body = complicateConstructorInjectSuperPresenceCheck(body); + } + return body; + } + function isSufficientlyCoveredByReturnStatements(statement) { + if (statement.kind === 253) { + return true; + } else if (statement.kind === 245) { + const ifStatement = statement; + if (ifStatement.elseStatement) { + return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); + } + } else if (statement.kind === 241) { + const lastStatement = lastOrUndefined(statement.statements); + if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { + return true; + } + } + return false; + } + function createActualThis() { + return setEmitFlags( + factory2.createThis(), + 8 + /* NoSubstitution */ + ); + } + function createDefaultSuperCallOrThis() { + return factory2.createLogicalOr( + factory2.createLogicalAnd( + factory2.createStrictInequality( + createSyntheticSuper(), + factory2.createNull() + ), + factory2.createFunctionApplyCall( + createSyntheticSuper(), + createActualThis(), + factory2.createIdentifier("arguments") + ) + ), + createActualThis() + ); + } + function visitParameter(node) { + if (node.dotDotDotToken) { + return void 0; + } else if (isBindingPattern(node.name)) { + return setOriginalNode( + setTextRange( + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory2.getGeneratedNameForNode(node), + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + /*location*/ + node + ), + /*original*/ + node + ); + } else if (node.initializer) { + return setOriginalNode( + setTextRange( + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + node.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ), + /*location*/ + node + ), + /*original*/ + node + ); + } else { + return node; + } + } + function hasDefaultValueOrBindingPattern(node) { + return node.initializer !== void 0 || isBindingPattern(node.name); + } + function addDefaultValueAssignmentsIfNeeded2(statements, node) { + if (!some2(node.parameters, hasDefaultValueOrBindingPattern)) { + return false; + } + let added = false; + for (const parameter of node.parameters) { + const { name: name2, initializer, dotDotDotToken } = parameter; + if (dotDotDotToken) { + continue; + } + if (isBindingPattern(name2)) { + added = insertDefaultValueAssignmentForBindingPattern(statements, parameter, name2, initializer) || added; + } else if (initializer) { + insertDefaultValueAssignmentForInitializer(statements, parameter, name2, initializer); + added = true; + } + } + return added; + } + function insertDefaultValueAssignmentForBindingPattern(statements, parameter, name2, initializer) { + if (name2.elements.length > 0) { + insertStatementAfterCustomPrologue( + statements, + setEmitFlags( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + flattenDestructuringBinding( + parameter, + visitor, + context2, + 0, + factory2.getGeneratedNameForNode(parameter) + ) + ) + ), + 2097152 + /* CustomPrologue */ + ) + ); + return true; + } else if (initializer) { + insertStatementAfterCustomPrologue( + statements, + setEmitFlags( + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.getGeneratedNameForNode(parameter), + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) + ) + ), + 2097152 + /* CustomPrologue */ + ) + ); + return true; + } + return false; + } + function insertDefaultValueAssignmentForInitializer(statements, parameter, name2, initializer) { + initializer = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); + const statement = factory2.createIfStatement( + factory2.createTypeCheck(factory2.cloneNode(name2), "undefined"), + setEmitFlags( + setTextRange( + factory2.createBlock([ + factory2.createExpressionStatement( + setEmitFlags( + setTextRange( + factory2.createAssignment( + // TODO(rbuckton): Does this need to be parented? + setEmitFlags( + setParent(setTextRange(factory2.cloneNode(name2), name2), name2.parent), + 96 + /* NoSourceMap */ + ), + setEmitFlags( + initializer, + 96 | getEmitFlags(initializer) | 3072 + /* NoComments */ + ) + ), + parameter + ), + 3072 + /* NoComments */ + ) + ) + ]), + parameter + ), + 1 | 64 | 768 | 3072 + /* NoComments */ + ) + ); + startOnNewLine(statement); + setTextRange(statement, parameter); + setEmitFlags( + statement, + 768 | 64 | 2097152 | 3072 + /* NoComments */ + ); + insertStatementAfterCustomPrologue(statements, statement); + } + function shouldAddRestParameter(node, inConstructorWithSynthesizedSuper) { + return !!(node && node.dotDotDotToken && !inConstructorWithSynthesizedSuper); + } + function addRestParameterIfNeeded(statements, node, inConstructorWithSynthesizedSuper) { + const prologueStatements = []; + const parameter = lastOrUndefined(node.parameters); + if (!shouldAddRestParameter(parameter, inConstructorWithSynthesizedSuper)) { + return false; + } + const declarationName = parameter.name.kind === 80 ? setParent(setTextRange(factory2.cloneNode(parameter.name), parameter.name), parameter.name.parent) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + setEmitFlags( + declarationName, + 96 + /* NoSourceMap */ + ); + const expressionName = parameter.name.kind === 80 ? factory2.cloneNode(parameter.name) : declarationName; + const restIndex = node.parameters.length - 1; + const temp = factory2.createLoopVariable(); + prologueStatements.push( + setEmitFlags( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + declarationName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createArrayLiteralExpression([]) + ) + ]) + ), + /*location*/ + parameter + ), + 2097152 + /* CustomPrologue */ + ) + ); + const forStatement = factory2.createForStatement( + setTextRange( + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + temp, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createNumericLiteral(restIndex) + ) + ]), + parameter + ), + setTextRange( + factory2.createLessThan( + temp, + factory2.createPropertyAccessExpression(factory2.createIdentifier("arguments"), "length") + ), + parameter + ), + setTextRange(factory2.createPostfixIncrement(temp), parameter), + factory2.createBlock([ + startOnNewLine( + setTextRange( + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createElementAccessExpression( + expressionName, + restIndex === 0 ? temp : factory2.createSubtract(temp, factory2.createNumericLiteral(restIndex)) + ), + factory2.createElementAccessExpression(factory2.createIdentifier("arguments"), temp) + ) + ), + /*location*/ + parameter + ) + ) + ]) + ); + setEmitFlags( + forStatement, + 2097152 + /* CustomPrologue */ + ); + startOnNewLine(forStatement); + prologueStatements.push(forStatement); + if (parameter.name.kind !== 80) { + prologueStatements.push( + setEmitFlags( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + flattenDestructuringBinding(parameter, visitor, context2, 0, expressionName) + ) + ), + parameter + ), + 2097152 + /* CustomPrologue */ + ) + ); + } + insertStatementsAfterCustomPrologue(statements, prologueStatements); + return true; + } + function insertCaptureThisForNodeIfNeeded(statements, node) { + if (hierarchyFacts & 131072 && node.kind !== 219) { + insertCaptureThisForNode(statements, node, factory2.createThis()); + return true; + } + return false; + } + function insertCaptureThisForNode(statements, node, initializer) { + enableSubstitutionsForCapturedThis(); + const captureThisStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + createCapturedThis(), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ) + ]) + ); + setEmitFlags( + captureThisStatement, + 3072 | 2097152 + /* CustomPrologue */ + ); + setSourceMapRange(captureThisStatement, node); + insertStatementAfterCustomPrologue(statements, captureThisStatement); + } + function insertCaptureNewTargetIfNeeded(statements, node) { + if (hierarchyFacts & 32768) { + let newTarget; + switch (node.kind) { + case 219: + return statements; + case 174: + case 177: + case 178: + newTarget = factory2.createVoidZero(); + break; + case 176: + newTarget = factory2.createPropertyAccessExpression( + setEmitFlags( + factory2.createThis(), + 8 + /* NoSubstitution */ + ), + "constructor" + ); + break; + case 262: + case 218: + newTarget = factory2.createConditionalExpression( + factory2.createLogicalAnd( + setEmitFlags( + factory2.createThis(), + 8 + /* NoSubstitution */ + ), + factory2.createBinaryExpression( + setEmitFlags( + factory2.createThis(), + 8 + /* NoSubstitution */ + ), + 104, + factory2.getLocalName(node) + ) + ), + /*questionToken*/ + void 0, + factory2.createPropertyAccessExpression( + setEmitFlags( + factory2.createThis(), + 8 + /* NoSubstitution */ + ), + "constructor" + ), + /*colonToken*/ + void 0, + factory2.createVoidZero() + ); + break; + default: + return Debug.failBadSyntaxKind(node); + } + const captureNewTargetStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + factory2.createUniqueName( + "_newTarget", + 16 | 32 + /* FileLevel */ + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + newTarget + ) + ]) + ); + setEmitFlags( + captureNewTargetStatement, + 3072 | 2097152 + /* CustomPrologue */ + ); + insertStatementAfterCustomPrologue(statements, captureNewTargetStatement); + } + return statements; + } + function addClassMembers(statements, node) { + for (const member of node.members) { + switch (member.kind) { + case 240: + statements.push(transformSemicolonClassElementToStatement(member)); + break; + case 174: + statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); + break; + case 177: + case 178: + const accessors = getAllAccessorDeclarations(node.members, member); + if (member === accessors.firstAccessor) { + statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); + } + break; + case 176: + case 175: + break; + default: + Debug.failBadSyntaxKind(member, currentSourceFile && currentSourceFile.fileName); + break; + } + } + } + function transformSemicolonClassElementToStatement(member) { + return setTextRange(factory2.createEmptyStatement(), member); + } + function transformClassMethodDeclarationToStatement(receiver, member, container) { + const commentRange = getCommentRange(member); + const sourceMapRange = getSourceMapRange(member); + const memberFunction = transformFunctionLikeToExpression( + member, + /*location*/ + member, + /*name*/ + void 0, + container + ); + const propertyName = visitNode(member.name, visitor, isPropertyName); + Debug.assert(propertyName); + let e10; + if (!isPrivateIdentifier(propertyName) && getUseDefineForClassFields(context2.getCompilerOptions())) { + const name2 = isComputedPropertyName(propertyName) ? propertyName.expression : isIdentifier(propertyName) ? factory2.createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText)) : propertyName; + e10 = factory2.createObjectDefinePropertyCall(receiver, name2, factory2.createPropertyDescriptor({ value: memberFunction, enumerable: false, writable: true, configurable: true })); + } else { + const memberName = createMemberAccessForPropertyName( + factory2, + receiver, + propertyName, + /*location*/ + member.name + ); + e10 = factory2.createAssignment(memberName, memberFunction); + } + setEmitFlags( + memberFunction, + 3072 + /* NoComments */ + ); + setSourceMapRange(memberFunction, sourceMapRange); + const statement = setTextRange( + factory2.createExpressionStatement(e10), + /*location*/ + member + ); + setOriginalNode(statement, member); + setCommentRange(statement, commentRange); + setEmitFlags( + statement, + 96 + /* NoSourceMap */ + ); + return statement; + } + function transformAccessorsToStatement(receiver, accessors, container) { + const statement = factory2.createExpressionStatement(transformAccessorsToExpression( + receiver, + accessors, + container, + /*startsOnNewLine*/ + false + )); + setEmitFlags( + statement, + 3072 + /* NoComments */ + ); + setSourceMapRange(statement, getSourceMapRange(accessors.firstAccessor)); + return statement; + } + function transformAccessorsToExpression(receiver, { firstAccessor, getAccessor, setAccessor }, container, startsOnNewLine) { + const target = setParent(setTextRange(factory2.cloneNode(receiver), receiver), receiver.parent); + setEmitFlags( + target, + 3072 | 64 + /* NoTrailingSourceMap */ + ); + setSourceMapRange(target, firstAccessor.name); + const visitedAccessorName = visitNode(firstAccessor.name, visitor, isPropertyName); + Debug.assert(visitedAccessorName); + if (isPrivateIdentifier(visitedAccessorName)) { + return Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015."); + } + const propertyName = createExpressionForPropertyName(factory2, visitedAccessorName); + setEmitFlags( + propertyName, + 3072 | 32 + /* NoLeadingSourceMap */ + ); + setSourceMapRange(propertyName, firstAccessor.name); + const properties = []; + if (getAccessor) { + const getterFunction = transformFunctionLikeToExpression( + getAccessor, + /*location*/ + void 0, + /*name*/ + void 0, + container + ); + setSourceMapRange(getterFunction, getSourceMapRange(getAccessor)); + setEmitFlags( + getterFunction, + 1024 + /* NoLeadingComments */ + ); + const getter = factory2.createPropertyAssignment("get", getterFunction); + setCommentRange(getter, getCommentRange(getAccessor)); + properties.push(getter); + } + if (setAccessor) { + const setterFunction = transformFunctionLikeToExpression( + setAccessor, + /*location*/ + void 0, + /*name*/ + void 0, + container + ); + setSourceMapRange(setterFunction, getSourceMapRange(setAccessor)); + setEmitFlags( + setterFunction, + 1024 + /* NoLeadingComments */ + ); + const setter = factory2.createPropertyAssignment("set", setterFunction); + setCommentRange(setter, getCommentRange(setAccessor)); + properties.push(setter); + } + properties.push( + factory2.createPropertyAssignment("enumerable", getAccessor || setAccessor ? factory2.createFalse() : factory2.createTrue()), + factory2.createPropertyAssignment("configurable", factory2.createTrue()) + ); + const call = factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ + void 0, + [ + target, + propertyName, + factory2.createObjectLiteralExpression( + properties, + /*multiLine*/ + true + ) + ] + ); + if (startsOnNewLine) { + startOnNewLine(call); + } + return call; + } + function visitArrowFunction(node) { + if (node.transformFlags & 16384 && !(hierarchyFacts & 16384)) { + hierarchyFacts |= 131072; + } + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const ancestorFacts = enterSubtree( + 15232, + 66 + /* ArrowFunctionIncludes */ + ); + const func = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformFunctionBody2(node) + ); + setTextRange(func, node); + setOriginalNode(func, node); + setEmitFlags( + func, + 16 + /* CapturesThis */ + ); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + return func; + } + function visitFunctionExpression(node) { + const ancestorFacts = getEmitFlags(node) & 524288 ? enterSubtree( + 32662, + 69 + /* AsyncFunctionBodyIncludes */ + ) : enterSubtree( + 32670, + 65 + /* FunctionIncludes */ + ); + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const parameters = visitParameterList(node.parameters, visitor, context2); + const body = transformFunctionBody2(node); + const name2 = hierarchyFacts & 32768 ? factory2.getLocalName(node) : node.name; + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + return factory2.updateFunctionExpression( + node, + /*modifiers*/ + void 0, + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + function visitFunctionDeclaration(node) { + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const ancestorFacts = enterSubtree( + 32670, + 65 + /* FunctionIncludes */ + ); + const parameters = visitParameterList(node.parameters, visitor, context2); + const body = transformFunctionBody2(node); + const name2 = hierarchyFacts & 32768 ? factory2.getLocalName(node) : node.name; + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + return factory2.updateFunctionDeclaration( + node, + visitNodes2(node.modifiers, visitor, isModifier), + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + function transformFunctionLikeToExpression(node, location2, name2, container) { + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const ancestorFacts = container && isClassLike(container) && !isStatic(node) ? enterSubtree( + 32670, + 65 | 8 + /* NonStaticClassElement */ + ) : enterSubtree( + 32670, + 65 + /* FunctionIncludes */ + ); + const parameters = visitParameterList(node.parameters, visitor, context2); + const body = transformFunctionBody2(node); + if (hierarchyFacts & 32768 && !name2 && (node.kind === 262 || node.kind === 218)) { + name2 = factory2.getGeneratedNameForNode(node); + } + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + return setOriginalNode( + setTextRange( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + node.asteriskToken, + name2, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ), + location2 + ), + /*original*/ + node + ); + } + function transformFunctionBody2(node) { + let multiLine = false; + let singleLine = false; + let statementsLocation; + let closeBraceLocation; + const prologue = []; + const statements = []; + const body = node.body; + let statementOffset; + resumeLexicalEnvironment(); + if (isBlock2(body)) { + statementOffset = factory2.copyStandardPrologue( + body.statements, + prologue, + 0, + /*ensureUseStrict*/ + false + ); + statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor, isHoistedFunction); + statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor, isHoistedVariableStatement); + } + multiLine = addDefaultValueAssignmentsIfNeeded2(statements, node) || multiLine; + multiLine = addRestParameterIfNeeded( + statements, + node, + /*inConstructorWithSynthesizedSuper*/ + false + ) || multiLine; + if (isBlock2(body)) { + statementOffset = factory2.copyCustomPrologue(body.statements, statements, statementOffset, visitor); + statementsLocation = body.statements; + addRange(statements, visitNodes2(body.statements, visitor, isStatement, statementOffset)); + if (!multiLine && body.multiLine) { + multiLine = true; + } + } else { + Debug.assert( + node.kind === 219 + /* ArrowFunction */ + ); + statementsLocation = moveRangeEnd(body, -1); + const equalsGreaterThanToken = node.equalsGreaterThanToken; + if (!nodeIsSynthesized(equalsGreaterThanToken) && !nodeIsSynthesized(body)) { + if (rangeEndIsOnSameLineAsRangeStart(equalsGreaterThanToken, body, currentSourceFile)) { + singleLine = true; + } else { + multiLine = true; + } + } + const expression = visitNode(body, visitor, isExpression); + const returnStatement = factory2.createReturnStatement(expression); + setTextRange(returnStatement, body); + moveSyntheticComments(returnStatement, body); + setEmitFlags( + returnStatement, + 768 | 64 | 2048 + /* NoTrailingComments */ + ); + statements.push(returnStatement); + closeBraceLocation = body; + } + factory2.mergeLexicalEnvironment(prologue, endLexicalEnvironment()); + insertCaptureNewTargetIfNeeded(prologue, node); + insertCaptureThisForNodeIfNeeded(prologue, node); + if (some2(prologue)) { + multiLine = true; + } + statements.unshift(...prologue); + if (isBlock2(body) && arrayIsEqualTo(statements, body.statements)) { + return body; + } + const block = factory2.createBlock(setTextRange(factory2.createNodeArray(statements), statementsLocation), multiLine); + setTextRange(block, node.body); + if (!multiLine && singleLine) { + setEmitFlags( + block, + 1 + /* SingleLine */ + ); + } + if (closeBraceLocation) { + setTokenSourceMapRange(block, 20, closeBraceLocation); + } + setOriginalNode(block, node.body); + return block; + } + function visitBlock(node, isFunctionBody2) { + if (isFunctionBody2) { + return visitEachChild(node, visitor, context2); + } + const ancestorFacts = hierarchyFacts & 256 ? enterSubtree( + 7104, + 512 + /* IterationStatementBlockIncludes */ + ) : enterSubtree( + 6976, + 128 + /* BlockIncludes */ + ); + const updated = visitEachChild(node, visitor, context2); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function visitExpressionStatement(node) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + function visitParenthesizedExpression(node, expressionResultIsUnused2) { + return visitEachChild(node, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, context2); + } + function visitBinaryExpression(node, expressionResultIsUnused2) { + if (isDestructuringAssignment(node)) { + return flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + !expressionResultIsUnused2 + ); + } + if (node.operatorToken.kind === 28) { + return factory2.updateBinaryExpression( + node, + Debug.checkDefined(visitNode(node.left, visitorWithUnusedExpressionResult, isExpression)), + node.operatorToken, + Debug.checkDefined(visitNode(node.right, expressionResultIsUnused2 ? visitorWithUnusedExpressionResult : visitor, isExpression)) + ); + } + return visitEachChild(node, visitor, context2); + } + function visitCommaListExpression(node, expressionResultIsUnused2) { + if (expressionResultIsUnused2) { + return visitEachChild(node, visitorWithUnusedExpressionResult, context2); + } + let result2; + for (let i7 = 0; i7 < node.elements.length; i7++) { + const element = node.elements[i7]; + const visited = visitNode(element, i7 < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, isExpression); + if (result2 || visited !== element) { + result2 || (result2 = node.elements.slice(0, i7)); + Debug.assert(visited); + result2.push(visited); + } + } + const elements = result2 ? setTextRange(factory2.createNodeArray(result2), node.elements) : node.elements; + return factory2.updateCommaListExpression(node, elements); + } + function isVariableStatementOfTypeScriptClassWrapper(node) { + return node.declarationList.declarations.length === 1 && !!node.declarationList.declarations[0].initializer && !!(getInternalEmitFlags(node.declarationList.declarations[0].initializer) & 1); + } + function visitVariableStatement(node) { + const ancestorFacts = enterSubtree( + 0, + hasSyntacticModifier( + node, + 32 + /* Export */ + ) ? 32 : 0 + /* None */ + ); + let updated; + if (convertedLoopState && (node.declarationList.flags & 7) === 0 && !isVariableStatementOfTypeScriptClassWrapper(node)) { + let assignments; + for (const decl of node.declarationList.declarations) { + hoistVariableDeclarationDeclaredInConvertedLoop(convertedLoopState, decl); + if (decl.initializer) { + let assignment; + if (isBindingPattern(decl.name)) { + assignment = flattenDestructuringAssignment( + decl, + visitor, + context2, + 0 + /* All */ + ); + } else { + assignment = factory2.createBinaryExpression(decl.name, 64, Debug.checkDefined(visitNode(decl.initializer, visitor, isExpression))); + setTextRange(assignment, decl); + } + assignments = append(assignments, assignment); + } + } + if (assignments) { + updated = setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(assignments)), node); + } else { + updated = void 0; + } + } else { + updated = visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function visitVariableDeclarationList(node) { + if (node.flags & 7 || node.transformFlags & 524288) { + if (node.flags & 7) { + enableSubstitutionsForBlockScopedBindings(); + } + const declarations = visitNodes2( + node.declarations, + node.flags & 1 ? visitVariableDeclarationInLetDeclarationList : visitVariableDeclaration, + isVariableDeclaration + ); + const declarationList = factory2.createVariableDeclarationList(declarations); + setOriginalNode(declarationList, node); + setTextRange(declarationList, node); + setCommentRange(declarationList, node); + if (node.transformFlags & 524288 && (isBindingPattern(node.declarations[0].name) || isBindingPattern(last2(node.declarations).name))) { + setSourceMapRange(declarationList, getRangeUnion(declarations)); + } + return declarationList; + } + return visitEachChild(node, visitor, context2); + } + function getRangeUnion(declarations) { + let pos = -1, end = -1; + for (const node of declarations) { + pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos); + end = Math.max(end, node.end); + } + return createRange2(pos, end); + } + function shouldEmitExplicitInitializerForLetDeclaration(node) { + const flags = resolver.getNodeCheckFlags(node); + const isCapturedInFunction = flags & 16384; + const isDeclaredInLoop = flags & 32768; + const emittedAsTopLevel = (hierarchyFacts & 64) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512) !== 0; + const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 | 4096)) === 0); + return emitExplicitInitializer; + } + function visitVariableDeclarationInLetDeclarationList(node) { + const name2 = node.name; + if (isBindingPattern(name2)) { + return visitVariableDeclaration(node); + } + if (!node.initializer && shouldEmitExplicitInitializerForLetDeclaration(node)) { + return factory2.updateVariableDeclaration( + node, + node.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createVoidZero() + ); + } + return visitEachChild(node, visitor, context2); + } + function visitVariableDeclaration(node) { + const ancestorFacts = enterSubtree( + 32, + 0 + /* None */ + ); + let updated; + if (isBindingPattern(node.name)) { + updated = flattenDestructuringBinding( + node, + visitor, + context2, + 0, + /*rval*/ + void 0, + (ancestorFacts & 32) !== 0 + ); + } else { + updated = visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function recordLabel(node) { + convertedLoopState.labels.set(idText(node.label), true); + } + function resetLabel(node) { + convertedLoopState.labels.set(idText(node.label), false); + } + function visitLabeledStatement(node) { + if (convertedLoopState && !convertedLoopState.labels) { + convertedLoopState.labels = /* @__PURE__ */ new Map(); + } + const statement = unwrapInnermostStatementOfLabel(node, convertedLoopState && recordLabel); + return isIterationStatement( + statement, + /*lookInLabeledStatements*/ + false + ) ? visitIterationStatement( + statement, + /*outermostLabeledStatement*/ + node + ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel); + } + function visitIterationStatement(node, outermostLabeledStatement) { + switch (node.kind) { + case 246: + case 247: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 248: + return visitForStatement(node, outermostLabeledStatement); + case 249: + return visitForInStatement(node, outermostLabeledStatement); + case 250: + return visitForOfStatement(node, outermostLabeledStatement); + } + } + function visitIterationStatementWithFacts(excludeFacts, includeFacts, node, outermostLabeledStatement, convert) { + const ancestorFacts = enterSubtree(excludeFacts, includeFacts); + const updated = convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function visitDoOrWhileStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts( + 0, + 1280, + node, + outermostLabeledStatement + ); + } + function visitForStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts( + 5056, + 3328, + node, + outermostLabeledStatement + ); + } + function visitEachChildOfForStatement2(node) { + return factory2.updateForStatement( + node, + visitNode(node.initializer, visitorWithUnusedExpressionResult, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, visitorWithUnusedExpressionResult, isExpression), + Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock)) + ); + } + function visitForInStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts( + 3008, + 5376, + node, + outermostLabeledStatement + ); + } + function visitForOfStatement(node, outermostLabeledStatement) { + return visitIterationStatementWithFacts( + 3008, + 5376, + node, + outermostLabeledStatement, + compilerOptions.downlevelIteration ? convertForOfStatementForIterable : convertForOfStatementForArray + ); + } + function convertForOfStatementHead(node, boundValue, convertedLoopBodyStatements) { + const statements = []; + const initializer = node.initializer; + if (isVariableDeclarationList(initializer)) { + if (node.initializer.flags & 7) { + enableSubstitutionsForBlockScopedBindings(); + } + const firstOriginalDeclaration = firstOrUndefined(initializer.declarations); + if (firstOriginalDeclaration && isBindingPattern(firstOriginalDeclaration.name)) { + const declarations = flattenDestructuringBinding( + firstOriginalDeclaration, + visitor, + context2, + 0, + boundValue + ); + const declarationList = setTextRange(factory2.createVariableDeclarationList(declarations), node.initializer); + setOriginalNode(declarationList, node.initializer); + setSourceMapRange(declarationList, createRange2(declarations[0].pos, last2(declarations).end)); + statements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + declarationList + ) + ); + } else { + statements.push( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + setOriginalNode( + setTextRange( + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + firstOriginalDeclaration ? firstOriginalDeclaration.name : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + boundValue + ) + ]), + moveRangePos(initializer, -1) + ), + initializer + ) + ), + moveRangeEnd(initializer, -1) + ) + ); + } + } else { + const assignment = factory2.createAssignment(initializer, boundValue); + if (isDestructuringAssignment(assignment)) { + statements.push(factory2.createExpressionStatement(visitBinaryExpression( + assignment, + /*expressionResultIsUnused*/ + true + ))); + } else { + setTextRangeEnd(assignment, initializer.end); + statements.push(setTextRange(factory2.createExpressionStatement(Debug.checkDefined(visitNode(assignment, visitor, isExpression))), moveRangeEnd(initializer, -1))); + } + } + if (convertedLoopBodyStatements) { + return createSyntheticBlockForConvertedStatements(addRange(statements, convertedLoopBodyStatements)); + } else { + const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + Debug.assert(statement); + if (isBlock2(statement)) { + return factory2.updateBlock(statement, setTextRange(factory2.createNodeArray(concatenate(statements, statement.statements)), statement.statements)); + } else { + statements.push(statement); + return createSyntheticBlockForConvertedStatements(statements); + } + } + } + function createSyntheticBlockForConvertedStatements(statements) { + return setEmitFlags( + factory2.createBlock( + factory2.createNodeArray(statements), + /*multiLine*/ + true + ), + 96 | 768 + /* NoTokenSourceMaps */ + ); + } + function convertForOfStatementForArray(node, outermostLabeledStatement, convertedLoopBodyStatements) { + const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + const counter = factory2.createLoopVariable(); + const rhsReference = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + setEmitFlags(expression, 96 | getEmitFlags(expression)); + const forStatement = setTextRange( + factory2.createForStatement( + /*initializer*/ + setEmitFlags( + setTextRange( + factory2.createVariableDeclarationList([ + setTextRange(factory2.createVariableDeclaration( + counter, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createNumericLiteral(0) + ), moveRangePos(node.expression, -1)), + setTextRange(factory2.createVariableDeclaration( + rhsReference, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + expression + ), node.expression) + ]), + node.expression + ), + 4194304 + /* NoHoisting */ + ), + /*condition*/ + setTextRange( + factory2.createLessThan( + counter, + factory2.createPropertyAccessExpression(rhsReference, "length") + ), + node.expression + ), + /*incrementor*/ + setTextRange(factory2.createPostfixIncrement(counter), node.expression), + /*statement*/ + convertForOfStatementHead( + node, + factory2.createElementAccessExpression(rhsReference, counter), + convertedLoopBodyStatements + ) + ), + /*location*/ + node + ); + setEmitFlags( + forStatement, + 512 + /* NoTokenTrailingSourceMaps */ + ); + setTextRange(forStatement, node); + return factory2.restoreEnclosingLabel(forStatement, outermostLabeledStatement, convertedLoopState && resetLabel); + } + function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) { + const expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + const iterator = isIdentifier(expression) ? factory2.getGeneratedNameForNode(expression) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const result2 = isIdentifier(expression) ? factory2.getGeneratedNameForNode(iterator) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const errorRecord = factory2.createUniqueName("e"); + const catchVariable = factory2.getGeneratedNameForNode(errorRecord); + const returnMethod = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const values2 = setTextRange(emitHelpers().createValuesHelper(expression), node.expression); + const next = factory2.createCallExpression( + factory2.createPropertyAccessExpression(iterator, "next"), + /*typeArguments*/ + void 0, + [] + ); + hoistVariableDeclaration(errorRecord); + hoistVariableDeclaration(returnMethod); + const initializer = ancestorFacts & 1024 ? factory2.inlineExpressions([factory2.createAssignment(errorRecord, factory2.createVoidZero()), values2]) : values2; + const forStatement = setEmitFlags( + setTextRange( + factory2.createForStatement( + /*initializer*/ + setEmitFlags( + setTextRange( + factory2.createVariableDeclarationList([ + setTextRange(factory2.createVariableDeclaration( + iterator, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + initializer + ), node.expression), + factory2.createVariableDeclaration( + result2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + next + ) + ]), + node.expression + ), + 4194304 + /* NoHoisting */ + ), + /*condition*/ + factory2.createLogicalNot(factory2.createPropertyAccessExpression(result2, "done")), + /*incrementor*/ + factory2.createAssignment(result2, next), + /*statement*/ + convertForOfStatementHead( + node, + factory2.createPropertyAccessExpression(result2, "value"), + convertedLoopBodyStatements + ) + ), + /*location*/ + node + ), + 512 + /* NoTokenTrailingSourceMaps */ + ); + return factory2.createTryStatement( + factory2.createBlock([ + factory2.restoreEnclosingLabel( + forStatement, + outermostLabeledStatement, + convertedLoopState && resetLabel + ) + ]), + factory2.createCatchClause( + factory2.createVariableDeclaration(catchVariable), + setEmitFlags( + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createAssignment( + errorRecord, + factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("error", catchVariable) + ]) + ) + ) + ]), + 1 + /* SingleLine */ + ) + ), + factory2.createBlock([ + factory2.createTryStatement( + /*tryBlock*/ + factory2.createBlock([ + setEmitFlags( + factory2.createIfStatement( + factory2.createLogicalAnd( + factory2.createLogicalAnd( + result2, + factory2.createLogicalNot( + factory2.createPropertyAccessExpression(result2, "done") + ) + ), + factory2.createAssignment( + returnMethod, + factory2.createPropertyAccessExpression(iterator, "return") + ) + ), + factory2.createExpressionStatement( + factory2.createFunctionCallCall(returnMethod, iterator, []) + ) + ), + 1 + /* SingleLine */ + ) + ]), + /*catchClause*/ + void 0, + /*finallyBlock*/ + setEmitFlags( + factory2.createBlock([ + setEmitFlags( + factory2.createIfStatement( + errorRecord, + factory2.createThrowStatement( + factory2.createPropertyAccessExpression(errorRecord, "error") + ) + ), + 1 + /* SingleLine */ + ) + ]), + 1 + /* SingleLine */ + ) + ) + ]) + ); + } + function visitObjectLiteralExpression(node) { + const properties = node.properties; + let numInitialProperties = -1, hasComputed = false; + for (let i7 = 0; i7 < properties.length; i7++) { + const property2 = properties[i7]; + if (property2.transformFlags & 1048576 && hierarchyFacts & 4 || (hasComputed = Debug.checkDefined(property2.name).kind === 167)) { + numInitialProperties = i7; + break; + } + } + if (numInitialProperties < 0) { + return visitEachChild(node, visitor, context2); + } + const temp = factory2.createTempVariable(hoistVariableDeclaration); + const expressions = []; + const assignment = factory2.createAssignment( + temp, + setEmitFlags( + factory2.createObjectLiteralExpression( + visitNodes2(properties, visitor, isObjectLiteralElementLike, 0, numInitialProperties), + node.multiLine + ), + hasComputed ? 131072 : 0 + ) + ); + if (node.multiLine) { + startOnNewLine(assignment); + } + expressions.push(assignment); + addObjectLiteralMembers(expressions, node, temp, numInitialProperties); + expressions.push(node.multiLine ? startOnNewLine(setParent(setTextRange(factory2.cloneNode(temp), temp), temp.parent)) : temp); + return factory2.inlineExpressions(expressions); + } + function shouldConvertPartOfIterationStatement(node) { + return (resolver.getNodeCheckFlags(node) & 8192) !== 0; + } + function shouldConvertInitializerOfForStatement(node) { + return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer); + } + function shouldConvertConditionOfForStatement(node) { + return isForStatement(node) && !!node.condition && shouldConvertPartOfIterationStatement(node.condition); + } + function shouldConvertIncrementorOfForStatement(node) { + return isForStatement(node) && !!node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + } + function shouldConvertIterationStatement(node) { + return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node); + } + function shouldConvertBodyOfIterationStatement(node) { + return (resolver.getNodeCheckFlags(node) & 4096) !== 0; + } + function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) { + if (!state.hoistedLocalVariables) { + state.hoistedLocalVariables = []; + } + visit7(node.name); + function visit7(node2) { + if (node2.kind === 80) { + state.hoistedLocalVariables.push(node2); + } else { + for (const element of node2.elements) { + if (!isOmittedExpression(element)) { + visit7(element.name); + } + } + } + } + } + function convertIterationStatementBodyIfNecessary(node, outermostLabeledStatement, ancestorFacts, convert) { + if (!shouldConvertIterationStatement(node)) { + let saveAllowedNonLabeledJumps; + if (convertedLoopState) { + saveAllowedNonLabeledJumps = convertedLoopState.allowedNonLabeledJumps; + convertedLoopState.allowedNonLabeledJumps = 2 | 4; + } + const result2 = convert ? convert( + node, + outermostLabeledStatement, + /*convertedLoopBodyStatements*/ + void 0, + ancestorFacts + ) : factory2.restoreEnclosingLabel( + isForStatement(node) ? visitEachChildOfForStatement2(node) : visitEachChild(node, visitor, context2), + outermostLabeledStatement, + convertedLoopState && resetLabel + ); + if (convertedLoopState) { + convertedLoopState.allowedNonLabeledJumps = saveAllowedNonLabeledJumps; + } + return result2; + } + const currentState = createConvertedLoopState(node); + const statements = []; + const outerConvertedLoopState = convertedLoopState; + convertedLoopState = currentState; + const initializerFunction = shouldConvertInitializerOfForStatement(node) ? createFunctionForInitializerOfForStatement(node, currentState) : void 0; + const bodyFunction = shouldConvertBodyOfIterationStatement(node) ? createFunctionForBodyOfIterationStatement(node, currentState, outerConvertedLoopState) : void 0; + convertedLoopState = outerConvertedLoopState; + if (initializerFunction) + statements.push(initializerFunction.functionDeclaration); + if (bodyFunction) + statements.push(bodyFunction.functionDeclaration); + addExtraDeclarationsForConvertedLoop(statements, currentState, outerConvertedLoopState); + if (initializerFunction) { + statements.push(generateCallToConvertedLoopInitializer(initializerFunction.functionName, initializerFunction.containsYield)); + } + let loop; + if (bodyFunction) { + if (convert) { + loop = convert(node, outermostLabeledStatement, bodyFunction.part, ancestorFacts); + } else { + const clone22 = convertIterationStatementCore(node, initializerFunction, factory2.createBlock( + bodyFunction.part, + /*multiLine*/ + true + )); + loop = factory2.restoreEnclosingLabel(clone22, outermostLabeledStatement, convertedLoopState && resetLabel); + } + } else { + const clone22 = convertIterationStatementCore(node, initializerFunction, Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); + loop = factory2.restoreEnclosingLabel(clone22, outermostLabeledStatement, convertedLoopState && resetLabel); + } + statements.push(loop); + return statements; + } + function convertIterationStatementCore(node, initializerFunction, convertedLoopBody) { + switch (node.kind) { + case 248: + return convertForStatement(node, initializerFunction, convertedLoopBody); + case 249: + return convertForInStatement(node, convertedLoopBody); + case 250: + return convertForOfStatement(node, convertedLoopBody); + case 246: + return convertDoStatement(node, convertedLoopBody); + case 247: + return convertWhileStatement(node, convertedLoopBody); + default: + return Debug.failBadSyntaxKind(node, "IterationStatement expected"); + } + } + function convertForStatement(node, initializerFunction, convertedLoopBody) { + const shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); + const shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + return factory2.updateForStatement( + node, + visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitorWithUnusedExpressionResult, isForInitializer), + visitNode(shouldConvertCondition ? void 0 : node.condition, visitor, isExpression), + visitNode(shouldConvertIncrementor ? void 0 : node.incrementor, visitorWithUnusedExpressionResult, isExpression), + convertedLoopBody + ); + } + function convertForOfStatement(node, convertedLoopBody) { + return factory2.updateForOfStatement( + node, + /*awaitModifier*/ + void 0, + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + convertedLoopBody + ); + } + function convertForInStatement(node, convertedLoopBody) { + return factory2.updateForInStatement( + node, + Debug.checkDefined(visitNode(node.initializer, visitor, isForInitializer)), + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + convertedLoopBody + ); + } + function convertDoStatement(node, convertedLoopBody) { + return factory2.updateDoStatement( + node, + convertedLoopBody, + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)) + ); + } + function convertWhileStatement(node, convertedLoopBody) { + return factory2.updateWhileStatement( + node, + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + convertedLoopBody + ); + } + function createConvertedLoopState(node) { + let loopInitializer; + switch (node.kind) { + case 248: + case 249: + case 250: + const initializer = node.initializer; + if (initializer && initializer.kind === 261) { + loopInitializer = initializer; + } + break; + } + const loopParameters = []; + const loopOutParameters = []; + if (loopInitializer && getCombinedNodeFlags(loopInitializer) & 7) { + const hasCapturedBindingsInForHead = shouldConvertInitializerOfForStatement(node) || shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node); + for (const decl of loopInitializer.declarations) { + processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); + } + } + const currentState = { loopParameters, loopOutParameters }; + if (convertedLoopState) { + if (convertedLoopState.argumentsName) { + currentState.argumentsName = convertedLoopState.argumentsName; + } + if (convertedLoopState.thisName) { + currentState.thisName = convertedLoopState.thisName; + } + if (convertedLoopState.hoistedLocalVariables) { + currentState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; + } + } + return currentState; + } + function addExtraDeclarationsForConvertedLoop(statements, state, outerState) { + let extraVariableDeclarations; + if (state.argumentsName) { + if (outerState) { + outerState.argumentsName = state.argumentsName; + } else { + (extraVariableDeclarations || (extraVariableDeclarations = [])).push( + factory2.createVariableDeclaration( + state.argumentsName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createIdentifier("arguments") + ) + ); + } + } + if (state.thisName) { + if (outerState) { + outerState.thisName = state.thisName; + } else { + (extraVariableDeclarations || (extraVariableDeclarations = [])).push( + factory2.createVariableDeclaration( + state.thisName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createIdentifier("this") + ) + ); + } + } + if (state.hoistedLocalVariables) { + if (outerState) { + outerState.hoistedLocalVariables = state.hoistedLocalVariables; + } else { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + for (const identifier of state.hoistedLocalVariables) { + extraVariableDeclarations.push(factory2.createVariableDeclaration(identifier)); + } + } + } + if (state.loopOutParameters.length) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + for (const outParam of state.loopOutParameters) { + extraVariableDeclarations.push(factory2.createVariableDeclaration(outParam.outParamName)); + } + } + if (state.conditionVariable) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + extraVariableDeclarations.push(factory2.createVariableDeclaration( + state.conditionVariable, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createFalse() + )); + } + if (extraVariableDeclarations) { + statements.push(factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList(extraVariableDeclarations) + )); + } + } + function createOutVariable(p7) { + return factory2.createVariableDeclaration( + p7.originalName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + p7.outParamName + ); + } + function createFunctionForInitializerOfForStatement(node, currentState) { + const functionName = factory2.createUniqueName("_loop_init"); + const containsYield = (node.initializer.transformFlags & 1048576) !== 0; + let emitFlags = 0; + if (currentState.containsLexicalThis) + emitFlags |= 16; + if (containsYield && hierarchyFacts & 4) + emitFlags |= 524288; + const statements = []; + statements.push(factory2.createVariableStatement( + /*modifiers*/ + void 0, + node.initializer + )); + copyOutParameters(currentState.loopOutParameters, 2, 1, statements); + const functionDeclaration = factory2.createVariableStatement( + /*modifiers*/ + void 0, + setEmitFlags( + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + functionName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + setEmitFlags( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + containsYield ? factory2.createToken( + 42 + /* AsteriskToken */ + ) : void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + void 0, + /*type*/ + void 0, + Debug.checkDefined(visitNode( + factory2.createBlock( + statements, + /*multiLine*/ + true + ), + visitor, + isBlock2 + )) + ), + emitFlags + ) + ) + ]), + 4194304 + /* NoHoisting */ + ) + ); + const part = factory2.createVariableDeclarationList(map4(currentState.loopOutParameters, createOutVariable)); + return { functionName, containsYield, functionDeclaration, part }; + } + function createFunctionForBodyOfIterationStatement(node, currentState, outerState) { + const functionName = factory2.createUniqueName("_loop"); + startLexicalEnvironment(); + const statement = visitNode(node.statement, visitor, isStatement, factory2.liftToBlock); + const lexicalEnvironment = endLexicalEnvironment(); + const statements = []; + if (shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node)) { + currentState.conditionVariable = factory2.createUniqueName("inc"); + if (node.incrementor) { + statements.push(factory2.createIfStatement( + currentState.conditionVariable, + factory2.createExpressionStatement(Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression))), + factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) + )); + } else { + statements.push(factory2.createIfStatement( + factory2.createLogicalNot(currentState.conditionVariable), + factory2.createExpressionStatement(factory2.createAssignment(currentState.conditionVariable, factory2.createTrue())) + )); + } + if (shouldConvertConditionOfForStatement(node)) { + statements.push(factory2.createIfStatement( + factory2.createPrefixUnaryExpression(54, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))), + Debug.checkDefined(visitNode(factory2.createBreakStatement(), visitor, isStatement)) + )); + } + } + Debug.assert(statement); + if (isBlock2(statement)) { + addRange(statements, statement.statements); + } else { + statements.push(statement); + } + copyOutParameters(currentState.loopOutParameters, 1, 1, statements); + insertStatementsAfterStandardPrologue(statements, lexicalEnvironment); + const loopBody = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + if (isBlock2(statement)) + setOriginalNode(loopBody, statement); + const containsYield = (node.statement.transformFlags & 1048576) !== 0; + let emitFlags = 1048576; + if (currentState.containsLexicalThis) + emitFlags |= 16; + if (containsYield && (hierarchyFacts & 4) !== 0) + emitFlags |= 524288; + const functionDeclaration = factory2.createVariableStatement( + /*modifiers*/ + void 0, + setEmitFlags( + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + functionName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + setEmitFlags( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + containsYield ? factory2.createToken( + 42 + /* AsteriskToken */ + ) : void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + currentState.loopParameters, + /*type*/ + void 0, + loopBody + ), + emitFlags + ) + ) + ] + ), + 4194304 + /* NoHoisting */ + ) + ); + const part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield); + return { functionName, containsYield, functionDeclaration, part }; + } + function copyOutParameter(outParam, copyDirection) { + const source = copyDirection === 0 ? outParam.outParamName : outParam.originalName; + const target = copyDirection === 0 ? outParam.originalName : outParam.outParamName; + return factory2.createBinaryExpression(target, 64, source); + } + function copyOutParameters(outParams, partFlags, copyDirection, statements) { + for (const outParam of outParams) { + if (outParam.flags & partFlags) { + statements.push(factory2.createExpressionStatement(copyOutParameter(outParam, copyDirection))); + } + } + } + function generateCallToConvertedLoopInitializer(initFunctionExpressionName, containsYield) { + const call = factory2.createCallExpression( + initFunctionExpressionName, + /*typeArguments*/ + void 0, + [] + ); + const callResult = containsYield ? factory2.createYieldExpression( + factory2.createToken( + 42 + /* AsteriskToken */ + ), + setEmitFlags( + call, + 8388608 + /* Iterator */ + ) + ) : call; + return factory2.createExpressionStatement(callResult); + } + function generateCallToConvertedLoop(loopFunctionExpressionName, state, outerState, containsYield) { + const statements = []; + const isSimpleLoop = !(state.nonLocalJumps & ~4) && !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; + const call = factory2.createCallExpression( + loopFunctionExpressionName, + /*typeArguments*/ + void 0, + map4(state.loopParameters, (p7) => p7.name) + ); + const callResult = containsYield ? factory2.createYieldExpression( + factory2.createToken( + 42 + /* AsteriskToken */ + ), + setEmitFlags( + call, + 8388608 + /* Iterator */ + ) + ) : call; + if (isSimpleLoop) { + statements.push(factory2.createExpressionStatement(callResult)); + copyOutParameters(state.loopOutParameters, 1, 0, statements); + } else { + const loopResultName = factory2.createUniqueName("state"); + const stateVariable = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [factory2.createVariableDeclaration( + loopResultName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + callResult + )] + ) + ); + statements.push(stateVariable); + copyOutParameters(state.loopOutParameters, 1, 0, statements); + if (state.nonLocalJumps & 8) { + let returnStatement; + if (outerState) { + outerState.nonLocalJumps |= 8; + returnStatement = factory2.createReturnStatement(loopResultName); + } else { + returnStatement = factory2.createReturnStatement(factory2.createPropertyAccessExpression(loopResultName, "value")); + } + statements.push( + factory2.createIfStatement( + factory2.createTypeCheck(loopResultName, "object"), + returnStatement + ) + ); + } + if (state.nonLocalJumps & 2) { + statements.push( + factory2.createIfStatement( + factory2.createStrictEquality( + loopResultName, + factory2.createStringLiteral("break") + ), + factory2.createBreakStatement() + ) + ); + } + if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) { + const caseClauses = []; + processLabeledJumps( + state.labeledNonLocalBreaks, + /*isBreak*/ + true, + loopResultName, + outerState, + caseClauses + ); + processLabeledJumps( + state.labeledNonLocalContinues, + /*isBreak*/ + false, + loopResultName, + outerState, + caseClauses + ); + statements.push( + factory2.createSwitchStatement( + loopResultName, + factory2.createCaseBlock(caseClauses) + ) + ); + } + } + return statements; + } + function setLabeledJump(state, isBreak, labelText, labelMarker) { + if (isBreak) { + if (!state.labeledNonLocalBreaks) { + state.labeledNonLocalBreaks = /* @__PURE__ */ new Map(); + } + state.labeledNonLocalBreaks.set(labelText, labelMarker); + } else { + if (!state.labeledNonLocalContinues) { + state.labeledNonLocalContinues = /* @__PURE__ */ new Map(); + } + state.labeledNonLocalContinues.set(labelText, labelMarker); + } + } + function processLabeledJumps(table2, isBreak, loopResultName, outerLoop, caseClauses) { + if (!table2) { + return; + } + table2.forEach((labelMarker, labelText) => { + const statements = []; + if (!outerLoop || outerLoop.labels && outerLoop.labels.get(labelText)) { + const label = factory2.createIdentifier(labelText); + statements.push(isBreak ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label)); + } else { + setLabeledJump(outerLoop, isBreak, labelText, labelMarker); + statements.push(factory2.createReturnStatement(loopResultName)); + } + caseClauses.push(factory2.createCaseClause(factory2.createStringLiteral(labelMarker), statements)); + }); + } + function processLoopVariableDeclaration(container, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForHead) { + const name2 = decl.name; + if (isBindingPattern(name2)) { + for (const element of name2.elements) { + if (!isOmittedExpression(element)) { + processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForHead); + } + } + } else { + loopParameters.push(factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name2 + )); + const checkFlags = resolver.getNodeCheckFlags(decl); + if (checkFlags & 65536 || hasCapturedBindingsInForHead) { + const outParamName = factory2.createUniqueName("out_" + idText(name2)); + let flags = 0; + if (checkFlags & 65536) { + flags |= 1; + } + if (isForStatement(container)) { + if (container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) { + flags |= 2; + } + if (container.condition && resolver.isBindingCapturedByNode(container.condition, decl) || container.incrementor && resolver.isBindingCapturedByNode(container.incrementor, decl)) { + flags |= 1; + } + } + loopOutParameters.push({ flags, originalName: name2, outParamName }); + } + } + } + function addObjectLiteralMembers(expressions, node, receiver, start) { + const properties = node.properties; + const numProperties = properties.length; + for (let i7 = start; i7 < numProperties; i7++) { + const property2 = properties[i7]; + switch (property2.kind) { + case 177: + case 178: + const accessors = getAllAccessorDeclarations(node.properties, property2); + if (property2 === accessors.firstAccessor) { + expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine)); + } + break; + case 174: + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property2, receiver, node, node.multiLine)); + break; + case 303: + expressions.push(transformPropertyAssignmentToExpression(property2, receiver, node.multiLine)); + break; + case 304: + expressions.push(transformShorthandPropertyAssignmentToExpression(property2, receiver, node.multiLine)); + break; + default: + Debug.failBadSyntaxKind(node); + break; + } + } + } + function transformPropertyAssignmentToExpression(property2, receiver, startsOnNewLine) { + const expression = factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + Debug.checkDefined(visitNode(property2.name, visitor, isPropertyName)) + ), + Debug.checkDefined(visitNode(property2.initializer, visitor, isExpression)) + ); + setTextRange(expression, property2); + if (startsOnNewLine) { + startOnNewLine(expression); + } + return expression; + } + function transformShorthandPropertyAssignmentToExpression(property2, receiver, startsOnNewLine) { + const expression = factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + Debug.checkDefined(visitNode(property2.name, visitor, isPropertyName)) + ), + factory2.cloneNode(property2.name) + ); + setTextRange(expression, property2); + if (startsOnNewLine) { + startOnNewLine(expression); + } + return expression; + } + function transformObjectLiteralMethodDeclarationToExpression(method2, receiver, container, startsOnNewLine) { + const expression = factory2.createAssignment( + createMemberAccessForPropertyName( + factory2, + receiver, + Debug.checkDefined(visitNode(method2.name, visitor, isPropertyName)) + ), + transformFunctionLikeToExpression( + method2, + /*location*/ + method2, + /*name*/ + void 0, + container + ) + ); + setTextRange(expression, method2); + if (startsOnNewLine) { + startOnNewLine(expression); + } + return expression; + } + function visitCatchClause(node) { + const ancestorFacts = enterSubtree( + 7104, + 0 + /* BlockScopeIncludes */ + ); + let updated; + Debug.assert(!!node.variableDeclaration, "Catch clause variable should always be present when downleveling ES2015."); + if (isBindingPattern(node.variableDeclaration.name)) { + const temp = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + const newVariableDeclaration = factory2.createVariableDeclaration(temp); + setTextRange(newVariableDeclaration, node.variableDeclaration); + const vars = flattenDestructuringBinding( + node.variableDeclaration, + visitor, + context2, + 0, + temp + ); + const list = factory2.createVariableDeclarationList(vars); + setTextRange(list, node.variableDeclaration); + const destructure = factory2.createVariableStatement( + /*modifiers*/ + void 0, + list + ); + updated = factory2.updateCatchClause(node, newVariableDeclaration, addStatementToStartOfBlock(node.block, destructure)); + } else { + updated = visitEachChild(node, visitor, context2); + } + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return updated; + } + function addStatementToStartOfBlock(block, statement) { + const transformedStatements = visitNodes2(block.statements, visitor, isStatement); + return factory2.updateBlock(block, [statement, ...transformedStatements]); + } + function visitMethodDeclaration(node) { + Debug.assert(!isComputedPropertyName(node.name)); + const functionExpression = transformFunctionLikeToExpression( + node, + /*location*/ + moveRangePos(node, -1), + /*name*/ + void 0, + /*container*/ + void 0 + ); + setEmitFlags(functionExpression, 1024 | getEmitFlags(functionExpression)); + return setTextRange( + factory2.createPropertyAssignment( + node.name, + functionExpression + ), + /*location*/ + node + ); + } + function visitAccessorDeclaration(node) { + Debug.assert(!isComputedPropertyName(node.name)); + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const ancestorFacts = enterSubtree( + 32670, + 65 + /* FunctionIncludes */ + ); + let updated; + const parameters = visitParameterList(node.parameters, visitor, context2); + const body = transformFunctionBody2(node); + if (node.kind === 177) { + updated = factory2.updateGetAccessorDeclaration(node, node.modifiers, node.name, parameters, node.type, body); + } else { + updated = factory2.updateSetAccessorDeclaration(node, node.modifiers, node.name, parameters, body); + } + exitSubtree( + ancestorFacts, + 229376, + 0 + /* None */ + ); + convertedLoopState = savedConvertedLoopState; + return updated; + } + function visitShorthandPropertyAssignment(node) { + return setTextRange( + factory2.createPropertyAssignment( + node.name, + visitIdentifier(factory2.cloneNode(node.name)) + ), + /*location*/ + node + ); + } + function visitComputedPropertyName(node) { + return visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + return visitEachChild(node, visitor, context2); + } + function visitArrayLiteralExpression(node) { + if (some2(node.elements, isSpreadElement)) { + return transformAndSpreadElements( + node.elements, + /*isArgumentList*/ + false, + !!node.multiLine, + /*hasTrailingComma*/ + !!node.elements.hasTrailingComma + ); + } + return visitEachChild(node, visitor, context2); + } + function visitCallExpression(node) { + if (getInternalEmitFlags(node) & 1) { + return visitTypeScriptClassWrapper(node); + } + const expression = skipOuterExpressions(node.expression); + if (expression.kind === 108 || isSuperProperty(expression) || some2(node.arguments, isSpreadElement)) { + return visitCallExpressionWithPotentialCapturedThisAssignment( + node, + /*assignToCapturedThis*/ + true + ); + } + return factory2.updateCallExpression( + node, + Debug.checkDefined(visitNode(node.expression, callExpressionVisitor, isExpression)), + /*typeArguments*/ + void 0, + visitNodes2(node.arguments, visitor, isExpression) + ); + } + function visitTypeScriptClassWrapper(node) { + const body = cast(cast(skipOuterExpressions(node.expression), isArrowFunction).body, isBlock2); + const isVariableStatementWithInitializer = (stmt) => isVariableStatement(stmt) && !!first(stmt.declarationList.declarations).initializer; + const savedConvertedLoopState = convertedLoopState; + convertedLoopState = void 0; + const bodyStatements = visitNodes2(body.statements, classWrapperStatementVisitor, isStatement); + convertedLoopState = savedConvertedLoopState; + const classStatements = filter2(bodyStatements, isVariableStatementWithInitializer); + const remainingStatements = filter2(bodyStatements, (stmt) => !isVariableStatementWithInitializer(stmt)); + const varStatement = cast(first(classStatements), isVariableStatement); + const variable = varStatement.declarationList.declarations[0]; + const initializer = skipOuterExpressions(variable.initializer); + let aliasAssignment = tryCast(initializer, isAssignmentExpression); + if (!aliasAssignment && isBinaryExpression(initializer) && initializer.operatorToken.kind === 28) { + aliasAssignment = tryCast(initializer.left, isAssignmentExpression); + } + const call = cast(aliasAssignment ? skipOuterExpressions(aliasAssignment.right) : initializer, isCallExpression); + const func = cast(skipOuterExpressions(call.expression), isFunctionExpression); + const funcStatements = func.body.statements; + let classBodyStart = 0; + let classBodyEnd = -1; + const statements = []; + if (aliasAssignment) { + const extendsCall = tryCast(funcStatements[classBodyStart], isExpressionStatement); + if (extendsCall) { + statements.push(extendsCall); + classBodyStart++; + } + statements.push(funcStatements[classBodyStart]); + classBodyStart++; + statements.push( + factory2.createExpressionStatement( + factory2.createAssignment( + aliasAssignment.left, + cast(variable.name, isIdentifier) + ) + ) + ); + } + while (!isReturnStatement(elementAt(funcStatements, classBodyEnd))) { + classBodyEnd--; + } + addRange(statements, funcStatements, classBodyStart, classBodyEnd); + if (classBodyEnd < -1) { + addRange(statements, funcStatements, classBodyEnd + 1); + } + const returnStatement = tryCast(elementAt(funcStatements, classBodyEnd), isReturnStatement); + for (const statement of remainingStatements) { + if (isReturnStatement(statement) && (returnStatement == null ? void 0 : returnStatement.expression) && !isIdentifier(returnStatement.expression)) { + statements.push(returnStatement); + } else { + statements.push(statement); + } + } + addRange( + statements, + classStatements, + /*start*/ + 1 + ); + return factory2.restoreOuterExpressions( + node.expression, + factory2.restoreOuterExpressions( + variable.initializer, + factory2.restoreOuterExpressions( + aliasAssignment && aliasAssignment.right, + factory2.updateCallExpression( + call, + factory2.restoreOuterExpressions( + call.expression, + factory2.updateFunctionExpression( + func, + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + func.parameters, + /*type*/ + void 0, + factory2.updateBlock( + func.body, + statements + ) + ) + ), + /*typeArguments*/ + void 0, + call.arguments + ) + ) + ) + ); + } + function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { + if (node.transformFlags & 32768 || node.expression.kind === 108 || isSuperProperty(skipOuterExpressions(node.expression))) { + const { target, thisArg } = factory2.createCallBinding(node.expression, hoistVariableDeclaration); + if (node.expression.kind === 108) { + setEmitFlags( + thisArg, + 8 + /* NoSubstitution */ + ); + } + let resultingCall; + if (node.transformFlags & 32768) { + resultingCall = factory2.createFunctionApplyCall( + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 108 ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), + transformAndSpreadElements( + node.arguments, + /*isArgumentList*/ + true, + /*multiLine*/ + false, + /*hasTrailingComma*/ + false + ) + ); + } else { + resultingCall = setTextRange( + factory2.createFunctionCallCall( + Debug.checkDefined(visitNode(target, callExpressionVisitor, isExpression)), + node.expression.kind === 108 ? thisArg : Debug.checkDefined(visitNode(thisArg, visitor, isExpression)), + visitNodes2(node.arguments, visitor, isExpression) + ), + node + ); + } + if (node.expression.kind === 108) { + const initializer = factory2.createLogicalOr( + resultingCall, + createActualThis() + ); + resultingCall = assignToCapturedThis ? factory2.createAssignment(createCapturedThis(), initializer) : initializer; + } + return setOriginalNode(resultingCall, node); + } + if (isSuperCall(node)) { + hierarchyFacts |= 131072; + } + return visitEachChild(node, visitor, context2); + } + function visitNewExpression(node) { + if (some2(node.arguments, isSpreadElement)) { + const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); + return factory2.createNewExpression( + factory2.createFunctionApplyCall( + Debug.checkDefined(visitNode(target, visitor, isExpression)), + thisArg, + transformAndSpreadElements( + factory2.createNodeArray([factory2.createVoidZero(), ...node.arguments]), + /*isArgumentList*/ + true, + /*multiLine*/ + false, + /*hasTrailingComma*/ + false + ) + ), + /*typeArguments*/ + void 0, + [] + ); + } + return visitEachChild(node, visitor, context2); + } + function transformAndSpreadElements(elements, isArgumentList, multiLine, hasTrailingComma) { + const numElements = elements.length; + const segments = flatten2( + // As we visit each element, we return one of two functions to use as the "key": + // - `visitSpanOfSpreads` for one or more contiguous `...` spread expressions, i.e. `...a, ...b` in `[1, 2, ...a, ...b]` + // - `visitSpanOfNonSpreads` for one or more contiguous non-spread elements, i.e. `1, 2`, in `[1, 2, ...a, ...b]` + spanMap(elements, partitionSpread, (partition2, visitPartition, _start, end) => visitPartition(partition2, multiLine, hasTrailingComma && end === numElements)) + ); + if (segments.length === 1) { + const firstSegment = segments[0]; + if (isArgumentList && !compilerOptions.downlevelIteration || isPackedArrayLiteral(firstSegment.expression) || isCallToHelper(firstSegment.expression, "___spreadArray")) { + return firstSegment.expression; + } + } + const helpers = emitHelpers(); + const startsWithSpread = segments[0].kind !== 0; + let expression = startsWithSpread ? factory2.createArrayLiteralExpression() : segments[0].expression; + for (let i7 = startsWithSpread ? 0 : 1; i7 < segments.length; i7++) { + const segment = segments[i7]; + expression = helpers.createSpreadArrayHelper( + expression, + segment.expression, + segment.kind === 1 && !isArgumentList + ); + } + return expression; + } + function partitionSpread(node) { + return isSpreadElement(node) ? visitSpanOfSpreads : visitSpanOfNonSpreads; + } + function visitSpanOfSpreads(chunk2) { + return map4(chunk2, visitExpressionOfSpread); + } + function visitExpressionOfSpread(node) { + Debug.assertNode(node, isSpreadElement); + let expression = visitNode(node.expression, visitor, isExpression); + Debug.assert(expression); + const isCallToReadHelper = isCallToHelper(expression, "___read"); + let kind = isCallToReadHelper || isPackedArrayLiteral(expression) ? 2 : 1; + if (compilerOptions.downlevelIteration && kind === 1 && !isArrayLiteralExpression(expression) && !isCallToReadHelper) { + expression = emitHelpers().createReadHelper( + expression, + /*count*/ + void 0 + ); + kind = 2; + } + return createSpreadSegment(kind, expression); + } + function visitSpanOfNonSpreads(chunk2, multiLine, hasTrailingComma) { + const expression = factory2.createArrayLiteralExpression( + visitNodes2(factory2.createNodeArray(chunk2, hasTrailingComma), visitor, isExpression), + multiLine + ); + return createSpreadSegment(0, expression); + } + function visitSpreadElement(node) { + return visitNode(node.expression, visitor, isExpression); + } + function visitTemplateLiteral(node) { + return setTextRange(factory2.createStringLiteral(node.text), node); + } + function visitStringLiteral(node) { + if (node.hasExtendedUnicodeEscape) { + return setTextRange(factory2.createStringLiteral(node.text), node); + } + return node; + } + function visitNumericLiteral(node) { + if (node.numericLiteralFlags & 384) { + return setTextRange(factory2.createNumericLiteral(node.text), node); + } + return node; + } + function visitTaggedTemplateExpression(node) { + return processTaggedTemplateExpression( + context2, + node, + visitor, + currentSourceFile, + recordTaggedTemplateString, + 1 + /* All */ + ); + } + function visitTemplateExpression(node) { + let expression = factory2.createStringLiteral(node.head.text); + for (const span of node.templateSpans) { + const args = [Debug.checkDefined(visitNode(span.expression, visitor, isExpression))]; + if (span.literal.text.length > 0) { + args.push(factory2.createStringLiteral(span.literal.text)); + } + expression = factory2.createCallExpression( + factory2.createPropertyAccessExpression(expression, "concat"), + /*typeArguments*/ + void 0, + args + ); + } + return setTextRange(expression, node); + } + function createSyntheticSuper() { + return factory2.createUniqueName( + "_super", + 16 | 32 + /* FileLevel */ + ); + } + function visitSuperKeyword(node, isExpressionOfCall) { + const expression = hierarchyFacts & 8 && !isExpressionOfCall ? factory2.createPropertyAccessExpression(setOriginalNode(createSyntheticSuper(), node), "prototype") : createSyntheticSuper(); + setOriginalNode(expression, node); + setCommentRange(expression, node); + setSourceMapRange(expression, node); + return expression; + } + function visitMetaProperty(node) { + if (node.keywordToken === 105 && node.name.escapedText === "target") { + hierarchyFacts |= 32768; + return factory2.createUniqueName( + "_newTarget", + 16 | 32 + /* FileLevel */ + ); + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (enabledSubstitutions & 1 && isFunctionLike(node)) { + const ancestorFacts = enterSubtree( + 32670, + getEmitFlags(node) & 16 ? 65 | 16 : 65 + /* FunctionIncludes */ + ); + previousOnEmitNode(hint, node, emitCallback); + exitSubtree( + ancestorFacts, + 0, + 0 + /* None */ + ); + return; + } + previousOnEmitNode(hint, node, emitCallback); + } + function enableSubstitutionsForBlockScopedBindings() { + if ((enabledSubstitutions & 2) === 0) { + enabledSubstitutions |= 2; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + } + } + function enableSubstitutionsForCapturedThis() { + if ((enabledSubstitutions & 1) === 0) { + enabledSubstitutions |= 1; + context2.enableSubstitution( + 110 + /* ThisKeyword */ + ); + context2.enableEmitNotification( + 176 + /* Constructor */ + ); + context2.enableEmitNotification( + 174 + /* MethodDeclaration */ + ); + context2.enableEmitNotification( + 177 + /* GetAccessor */ + ); + context2.enableEmitNotification( + 178 + /* SetAccessor */ + ); + context2.enableEmitNotification( + 219 + /* ArrowFunction */ + ); + context2.enableEmitNotification( + 218 + /* FunctionExpression */ + ); + context2.enableEmitNotification( + 262 + /* FunctionDeclaration */ + ); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + if (isIdentifier(node)) { + return substituteIdentifier(node); + } + return node; + } + function substituteIdentifier(node) { + if (enabledSubstitutions & 2 && !isInternalName(node)) { + const original = getParseTreeNode(node, isIdentifier); + if (original && isNameOfDeclarationWithCollidingName(original)) { + return setTextRange(factory2.getGeneratedNameForNode(original), node); + } + } + return node; + } + function isNameOfDeclarationWithCollidingName(node) { + switch (node.parent.kind) { + case 208: + case 263: + case 266: + case 260: + return node.parent.name === node && resolver.isDeclarationWithCollidingName(node.parent); + } + return false; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + case 110: + return substituteThisKeyword(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (enabledSubstitutions & 2 && !isInternalName(node)) { + const declaration = resolver.getReferencedDeclarationWithCollidingName(node); + if (declaration && !(isClassLike(declaration) && isPartOfClassBody(declaration, node))) { + return setTextRange(factory2.getGeneratedNameForNode(getNameOfDeclaration(declaration)), node); + } + } + return node; + } + function isPartOfClassBody(declaration, node) { + let currentNode = getParseTreeNode(node); + if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) { + return false; + } + const blockScope = getEnclosingBlockScopeContainer(declaration); + while (currentNode) { + if (currentNode === blockScope || currentNode === declaration) { + return false; + } + if (isClassElement(currentNode) && currentNode.parent === declaration) { + return true; + } + currentNode = currentNode.parent; + } + return false; + } + function substituteThisKeyword(node) { + if (enabledSubstitutions & 1 && hierarchyFacts & 16) { + return setTextRange(createCapturedThis(), node); + } + return node; + } + function getClassMemberPrefix(node, member) { + return isStatic(member) ? factory2.getInternalName(node) : factory2.createPropertyAccessExpression(factory2.getInternalName(node), "prototype"); + } + function hasSynthesizedDefaultSuperCall(constructor, hasExtendsClause) { + if (!constructor || !hasExtendsClause) { + return false; + } + if (some2(constructor.parameters)) { + return false; + } + const statement = firstOrUndefined(constructor.body.statements); + if (!statement || !nodeIsSynthesized(statement) || statement.kind !== 244) { + return false; + } + const statementExpression = statement.expression; + if (!nodeIsSynthesized(statementExpression) || statementExpression.kind !== 213) { + return false; + } + const callTarget = statementExpression.expression; + if (!nodeIsSynthesized(callTarget) || callTarget.kind !== 108) { + return false; + } + const callArgument = singleOrUndefined(statementExpression.arguments); + if (!callArgument || !nodeIsSynthesized(callArgument) || callArgument.kind !== 230) { + return false; + } + const expression = callArgument.expression; + return isIdentifier(expression) && expression.escapedText === "arguments"; + } + } + var init_es2015 = __esm2({ + "src/compiler/transformers/es2015.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformES5(context2) { + const { factory: factory2 } = context2; + const compilerOptions = context2.getCompilerOptions(); + let previousOnEmitNode; + let noSubstitution; + if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { + previousOnEmitNode = context2.onEmitNode; + context2.onEmitNode = onEmitNode; + context2.enableEmitNotification( + 286 + /* JsxOpeningElement */ + ); + context2.enableEmitNotification( + 287 + /* JsxClosingElement */ + ); + context2.enableEmitNotification( + 285 + /* JsxSelfClosingElement */ + ); + noSubstitution = []; + } + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableSubstitution( + 211 + /* PropertyAccessExpression */ + ); + context2.enableSubstitution( + 303 + /* PropertyAssignment */ + ); + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + return node; + } + function onEmitNode(hint, node, emitCallback) { + switch (node.kind) { + case 286: + case 287: + case 285: + const tagName = node.tagName; + noSubstitution[getOriginalNodeId(tagName)] = true; + break; + } + previousOnEmitNode(hint, node, emitCallback); + } + function onSubstituteNode(hint, node) { + if (node.id && noSubstitution && noSubstitution[node.id]) { + return previousOnSubstituteNode(hint, node); + } + node = previousOnSubstituteNode(hint, node); + if (isPropertyAccessExpression(node)) { + return substitutePropertyAccessExpression(node); + } else if (isPropertyAssignment(node)) { + return substitutePropertyAssignment(node); + } + return node; + } + function substitutePropertyAccessExpression(node) { + if (isPrivateIdentifier(node.name)) { + return node; + } + const literalName = trySubstituteReservedName(node.name); + if (literalName) { + return setTextRange(factory2.createElementAccessExpression(node.expression, literalName), node); + } + return node; + } + function substitutePropertyAssignment(node) { + const literalName = isIdentifier(node.name) && trySubstituteReservedName(node.name); + if (literalName) { + return factory2.updatePropertyAssignment(node, literalName, node.initializer); + } + return node; + } + function trySubstituteReservedName(name2) { + const token = identifierToKeywordKind(name2); + if (token !== void 0 && token >= 83 && token <= 118) { + return setTextRange(factory2.createStringLiteralFromNode(name2), name2); + } + return void 0; + } + } + var init_es5 = __esm2({ + "src/compiler/transformers/es5.ts"() { + "use strict"; + init_ts2(); + } + }); + function getInstructionName(instruction) { + switch (instruction) { + case 2: + return "return"; + case 3: + return "break"; + case 4: + return "yield"; + case 5: + return "yield*"; + case 7: + return "endfinally"; + default: + return void 0; + } + } + function transformGenerators(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + resumeLexicalEnvironment, + endLexicalEnvironment, + hoistFunctionDeclaration, + hoistVariableDeclaration + } = context2; + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const resolver = context2.getEmitResolver(); + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onSubstituteNode = onSubstituteNode; + let renamedCatchVariables; + let renamedCatchVariableDeclarations; + let inGeneratorFunctionBody; + let inStatementContainingYield; + let blocks; + let blockOffsets; + let blockActions; + let blockStack; + let labelOffsets; + let labelExpressions; + let nextLabelId = 1; + let operations; + let operationArguments; + let operationLocations; + let state; + let blockIndex = 0; + let labelNumber = 0; + let labelNumbers; + let lastOperationWasAbrupt; + let lastOperationWasCompletion; + let clauses; + let statements; + let exceptionBlockStack; + let currentExceptionBlock; + let withBlockStack; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || (node.transformFlags & 2048) === 0) { + return node; + } + const visited = visitEachChild(node, visitor, context2); + addEmitHelpers(visited, context2.readEmitHelpers()); + return visited; + } + function visitor(node) { + const transformFlags = node.transformFlags; + if (inStatementContainingYield) { + return visitJavaScriptInStatementContainingYield(node); + } else if (inGeneratorFunctionBody) { + return visitJavaScriptInGeneratorFunctionBody(node); + } else if (isFunctionLikeDeclaration(node) && node.asteriskToken) { + return visitGenerator(node); + } else if (transformFlags & 2048) { + return visitEachChild(node, visitor, context2); + } else { + return node; + } + } + function visitJavaScriptInStatementContainingYield(node) { + switch (node.kind) { + case 246: + return visitDoStatement(node); + case 247: + return visitWhileStatement(node); + case 255: + return visitSwitchStatement(node); + case 256: + return visitLabeledStatement(node); + default: + return visitJavaScriptInGeneratorFunctionBody(node); + } + } + function visitJavaScriptInGeneratorFunctionBody(node) { + switch (node.kind) { + case 262: + return visitFunctionDeclaration(node); + case 218: + return visitFunctionExpression(node); + case 177: + case 178: + return visitAccessorDeclaration(node); + case 243: + return visitVariableStatement(node); + case 248: + return visitForStatement(node); + case 249: + return visitForInStatement(node); + case 252: + return visitBreakStatement(node); + case 251: + return visitContinueStatement(node); + case 253: + return visitReturnStatement(node); + default: + if (node.transformFlags & 1048576) { + return visitJavaScriptContainingYield(node); + } else if (node.transformFlags & (2048 | 4194304)) { + return visitEachChild(node, visitor, context2); + } else { + return node; + } + } + } + function visitJavaScriptContainingYield(node) { + switch (node.kind) { + case 226: + return visitBinaryExpression(node); + case 361: + return visitCommaListExpression(node); + case 227: + return visitConditionalExpression(node); + case 229: + return visitYieldExpression(node); + case 209: + return visitArrayLiteralExpression(node); + case 210: + return visitObjectLiteralExpression(node); + case 212: + return visitElementAccessExpression(node); + case 213: + return visitCallExpression(node); + case 214: + return visitNewExpression(node); + default: + return visitEachChild(node, visitor, context2); + } + } + function visitGenerator(node) { + switch (node.kind) { + case 262: + return visitFunctionDeclaration(node); + case 218: + return visitFunctionExpression(node); + default: + return Debug.failBadSyntaxKind(node); + } + } + function visitFunctionDeclaration(node) { + if (node.asteriskToken) { + node = setOriginalNode( + setTextRange( + factory2.createFunctionDeclaration( + node.modifiers, + /*asteriskToken*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformGeneratorFunctionBody(node.body) + ), + /*location*/ + node + ), + node + ); + } else { + const savedInGeneratorFunctionBody = inGeneratorFunctionBody; + const savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + } + if (inGeneratorFunctionBody) { + hoistFunctionDeclaration(node); + return void 0; + } else { + return node; + } + } + function visitFunctionExpression(node) { + if (node.asteriskToken) { + node = setOriginalNode( + setTextRange( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + node.name, + /*typeParameters*/ + void 0, + visitParameterList(node.parameters, visitor, context2), + /*type*/ + void 0, + transformGeneratorFunctionBody(node.body) + ), + /*location*/ + node + ), + node + ); + } else { + const savedInGeneratorFunctionBody = inGeneratorFunctionBody; + const savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + } + return node; + } + function visitAccessorDeclaration(node) { + const savedInGeneratorFunctionBody = inGeneratorFunctionBody; + const savedInStatementContainingYield = inStatementContainingYield; + inGeneratorFunctionBody = false; + inStatementContainingYield = false; + node = visitEachChild(node, visitor, context2); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + return node; + } + function transformGeneratorFunctionBody(body) { + const statements2 = []; + const savedInGeneratorFunctionBody = inGeneratorFunctionBody; + const savedInStatementContainingYield = inStatementContainingYield; + const savedBlocks = blocks; + const savedBlockOffsets = blockOffsets; + const savedBlockActions = blockActions; + const savedBlockStack = blockStack; + const savedLabelOffsets = labelOffsets; + const savedLabelExpressions = labelExpressions; + const savedNextLabelId = nextLabelId; + const savedOperations = operations; + const savedOperationArguments = operationArguments; + const savedOperationLocations = operationLocations; + const savedState = state; + inGeneratorFunctionBody = true; + inStatementContainingYield = false; + blocks = void 0; + blockOffsets = void 0; + blockActions = void 0; + blockStack = void 0; + labelOffsets = void 0; + labelExpressions = void 0; + nextLabelId = 1; + operations = void 0; + operationArguments = void 0; + operationLocations = void 0; + state = factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + resumeLexicalEnvironment(); + const statementOffset = factory2.copyPrologue( + body.statements, + statements2, + /*ensureUseStrict*/ + false, + visitor + ); + transformAndEmitStatements(body.statements, statementOffset); + const buildResult = build2(); + insertStatementsAfterStandardPrologue(statements2, endLexicalEnvironment()); + statements2.push(factory2.createReturnStatement(buildResult)); + inGeneratorFunctionBody = savedInGeneratorFunctionBody; + inStatementContainingYield = savedInStatementContainingYield; + blocks = savedBlocks; + blockOffsets = savedBlockOffsets; + blockActions = savedBlockActions; + blockStack = savedBlockStack; + labelOffsets = savedLabelOffsets; + labelExpressions = savedLabelExpressions; + nextLabelId = savedNextLabelId; + operations = savedOperations; + operationArguments = savedOperationArguments; + operationLocations = savedOperationLocations; + state = savedState; + return setTextRange(factory2.createBlock(statements2, body.multiLine), body); + } + function visitVariableStatement(node) { + if (node.transformFlags & 1048576) { + transformAndEmitVariableDeclarationList(node.declarationList); + return void 0; + } else { + if (getEmitFlags(node) & 2097152) { + return node; + } + for (const variable of node.declarationList.declarations) { + hoistVariableDeclaration(variable.name); + } + const variables = getInitializedVariables(node.declarationList); + if (variables.length === 0) { + return void 0; + } + return setSourceMapRange( + factory2.createExpressionStatement( + factory2.inlineExpressions( + map4(variables, transformInitializedVariable) + ) + ), + node + ); + } + } + function visitBinaryExpression(node) { + const assoc = getExpressionAssociativity(node); + switch (assoc) { + case 0: + return visitLeftAssociativeBinaryExpression(node); + case 1: + return visitRightAssociativeBinaryExpression(node); + default: + return Debug.assertNever(assoc); + } + } + function visitRightAssociativeBinaryExpression(node) { + const { left, right } = node; + if (containsYield(right)) { + let target; + switch (left.kind) { + case 211: + target = factory2.updatePropertyAccessExpression( + left, + cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), + left.name + ); + break; + case 212: + target = factory2.updateElementAccessExpression(left, cacheExpression(Debug.checkDefined(visitNode(left.expression, visitor, isLeftHandSideExpression))), cacheExpression(Debug.checkDefined(visitNode(left.argumentExpression, visitor, isExpression)))); + break; + default: + target = Debug.checkDefined(visitNode(left, visitor, isExpression)); + break; + } + const operator = node.operatorToken.kind; + if (isCompoundAssignment(operator)) { + return setTextRange( + factory2.createAssignment( + target, + setTextRange( + factory2.createBinaryExpression( + cacheExpression(target), + getNonAssignmentOperatorForCompoundAssignment(operator), + Debug.checkDefined(visitNode(right, visitor, isExpression)) + ), + node + ) + ), + node + ); + } else { + return factory2.updateBinaryExpression(node, target, node.operatorToken, Debug.checkDefined(visitNode(right, visitor, isExpression))); + } + } + return visitEachChild(node, visitor, context2); + } + function visitLeftAssociativeBinaryExpression(node) { + if (containsYield(node.right)) { + if (isLogicalOperator(node.operatorToken.kind)) { + return visitLogicalBinaryExpression(node); + } else if (node.operatorToken.kind === 28) { + return visitCommaExpression(node); + } + return factory2.updateBinaryExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.left, visitor, isExpression))), node.operatorToken, Debug.checkDefined(visitNode(node.right, visitor, isExpression))); + } + return visitEachChild(node, visitor, context2); + } + function visitCommaExpression(node) { + let pendingExpressions = []; + visit7(node.left); + visit7(node.right); + return factory2.inlineExpressions(pendingExpressions); + function visit7(node2) { + if (isBinaryExpression(node2) && node2.operatorToken.kind === 28) { + visit7(node2.left); + visit7(node2.right); + } else { + if (containsYield(node2) && pendingExpressions.length > 0) { + emitWorker(1, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(Debug.checkDefined(visitNode(node2, visitor, isExpression))); + } + } + } + function visitCommaListExpression(node) { + let pendingExpressions = []; + for (const elem of node.elements) { + if (isBinaryExpression(elem) && elem.operatorToken.kind === 28) { + pendingExpressions.push(visitCommaExpression(elem)); + } else { + if (containsYield(elem) && pendingExpressions.length > 0) { + emitWorker(1, [factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))]); + pendingExpressions = []; + } + pendingExpressions.push(Debug.checkDefined(visitNode(elem, visitor, isExpression))); + } + } + return factory2.inlineExpressions(pendingExpressions); + } + function visitLogicalBinaryExpression(node) { + const resultLabel = defineLabel(); + const resultLocal = declareLocal(); + emitAssignment( + resultLocal, + Debug.checkDefined(visitNode(node.left, visitor, isExpression)), + /*location*/ + node.left + ); + if (node.operatorToken.kind === 56) { + emitBreakWhenFalse( + resultLabel, + resultLocal, + /*location*/ + node.left + ); + } else { + emitBreakWhenTrue( + resultLabel, + resultLocal, + /*location*/ + node.left + ); + } + emitAssignment( + resultLocal, + Debug.checkDefined(visitNode(node.right, visitor, isExpression)), + /*location*/ + node.right + ); + markLabel(resultLabel); + return resultLocal; + } + function visitConditionalExpression(node) { + if (containsYield(node.whenTrue) || containsYield(node.whenFalse)) { + const whenFalseLabel = defineLabel(); + const resultLabel = defineLabel(); + const resultLocal = declareLocal(); + emitBreakWhenFalse( + whenFalseLabel, + Debug.checkDefined(visitNode(node.condition, visitor, isExpression)), + /*location*/ + node.condition + ); + emitAssignment( + resultLocal, + Debug.checkDefined(visitNode(node.whenTrue, visitor, isExpression)), + /*location*/ + node.whenTrue + ); + emitBreak(resultLabel); + markLabel(whenFalseLabel); + emitAssignment( + resultLocal, + Debug.checkDefined(visitNode(node.whenFalse, visitor, isExpression)), + /*location*/ + node.whenFalse + ); + markLabel(resultLabel); + return resultLocal; + } + return visitEachChild(node, visitor, context2); + } + function visitYieldExpression(node) { + const resumeLabel = defineLabel(); + const expression = visitNode(node.expression, visitor, isExpression); + if (node.asteriskToken) { + const iterator = (getEmitFlags(node.expression) & 8388608) === 0 ? setTextRange(emitHelpers().createValuesHelper(expression), node) : expression; + emitYieldStar( + iterator, + /*location*/ + node + ); + } else { + emitYield( + expression, + /*location*/ + node + ); + } + markLabel(resumeLabel); + return createGeneratorResume( + /*location*/ + node + ); + } + function visitArrayLiteralExpression(node) { + return visitElements( + node.elements, + /*leadingElement*/ + void 0, + /*location*/ + void 0, + node.multiLine + ); + } + function visitElements(elements, leadingElement, location2, multiLine) { + const numInitialElements = countInitialNodesWithoutYield(elements); + let temp; + if (numInitialElements > 0) { + temp = declareLocal(); + const initialElements = visitNodes2(elements, visitor, isExpression, 0, numInitialElements); + emitAssignment( + temp, + factory2.createArrayLiteralExpression( + leadingElement ? [leadingElement, ...initialElements] : initialElements + ) + ); + leadingElement = void 0; + } + const expressions = reduceLeft(elements, reduceElement, [], numInitialElements); + return temp ? factory2.createArrayConcatCall(temp, [factory2.createArrayLiteralExpression(expressions, multiLine)]) : setTextRange( + factory2.createArrayLiteralExpression(leadingElement ? [leadingElement, ...expressions] : expressions, multiLine), + location2 + ); + function reduceElement(expressions2, element) { + if (containsYield(element) && expressions2.length > 0) { + const hasAssignedTemp = temp !== void 0; + if (!temp) { + temp = declareLocal(); + } + emitAssignment( + temp, + hasAssignedTemp ? factory2.createArrayConcatCall( + temp, + [factory2.createArrayLiteralExpression(expressions2, multiLine)] + ) : factory2.createArrayLiteralExpression( + leadingElement ? [leadingElement, ...expressions2] : expressions2, + multiLine + ) + ); + leadingElement = void 0; + expressions2 = []; + } + expressions2.push(Debug.checkDefined(visitNode(element, visitor, isExpression))); + return expressions2; + } + } + function visitObjectLiteralExpression(node) { + const properties = node.properties; + const multiLine = node.multiLine; + const numInitialProperties = countInitialNodesWithoutYield(properties); + const temp = declareLocal(); + emitAssignment( + temp, + factory2.createObjectLiteralExpression( + visitNodes2(properties, visitor, isObjectLiteralElementLike, 0, numInitialProperties), + multiLine + ) + ); + const expressions = reduceLeft(properties, reduceProperty, [], numInitialProperties); + expressions.push(multiLine ? startOnNewLine(setParent(setTextRange(factory2.cloneNode(temp), temp), temp.parent)) : temp); + return factory2.inlineExpressions(expressions); + function reduceProperty(expressions2, property2) { + if (containsYield(property2) && expressions2.length > 0) { + emitStatement(factory2.createExpressionStatement(factory2.inlineExpressions(expressions2))); + expressions2 = []; + } + const expression = createExpressionForObjectLiteralElementLike(factory2, node, property2, temp); + const visited = visitNode(expression, visitor, isExpression); + if (visited) { + if (multiLine) { + startOnNewLine(visited); + } + expressions2.push(visited); + } + return expressions2; + } + } + function visitElementAccessExpression(node) { + if (containsYield(node.argumentExpression)) { + return factory2.updateElementAccessExpression(node, cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isLeftHandSideExpression))), Debug.checkDefined(visitNode(node.argumentExpression, visitor, isExpression))); + } + return visitEachChild(node, visitor, context2); + } + function visitCallExpression(node) { + if (!isImportCall(node) && forEach4(node.arguments, containsYield)) { + const { target, thisArg } = factory2.createCallBinding( + node.expression, + hoistVariableDeclaration, + languageVersion, + /*cacheIdentifiers*/ + true + ); + return setOriginalNode( + setTextRange( + factory2.createFunctionApplyCall( + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isLeftHandSideExpression))), + thisArg, + visitElements(node.arguments) + ), + node + ), + node + ); + } + return visitEachChild(node, visitor, context2); + } + function visitNewExpression(node) { + if (forEach4(node.arguments, containsYield)) { + const { target, thisArg } = factory2.createCallBinding(factory2.createPropertyAccessExpression(node.expression, "bind"), hoistVariableDeclaration); + return setOriginalNode( + setTextRange( + factory2.createNewExpression( + factory2.createFunctionApplyCall( + cacheExpression(Debug.checkDefined(visitNode(target, visitor, isExpression))), + thisArg, + visitElements( + node.arguments, + /*leadingElement*/ + factory2.createVoidZero() + ) + ), + /*typeArguments*/ + void 0, + [] + ), + node + ), + node + ); + } + return visitEachChild(node, visitor, context2); + } + function transformAndEmitStatements(statements2, start = 0) { + const numStatements = statements2.length; + for (let i7 = start; i7 < numStatements; i7++) { + transformAndEmitStatement(statements2[i7]); + } + } + function transformAndEmitEmbeddedStatement(node) { + if (isBlock2(node)) { + transformAndEmitStatements(node.statements); + } else { + transformAndEmitStatement(node); + } + } + function transformAndEmitStatement(node) { + const savedInStatementContainingYield = inStatementContainingYield; + if (!inStatementContainingYield) { + inStatementContainingYield = containsYield(node); + } + transformAndEmitStatementWorker(node); + inStatementContainingYield = savedInStatementContainingYield; + } + function transformAndEmitStatementWorker(node) { + switch (node.kind) { + case 241: + return transformAndEmitBlock(node); + case 244: + return transformAndEmitExpressionStatement(node); + case 245: + return transformAndEmitIfStatement(node); + case 246: + return transformAndEmitDoStatement(node); + case 247: + return transformAndEmitWhileStatement(node); + case 248: + return transformAndEmitForStatement(node); + case 249: + return transformAndEmitForInStatement(node); + case 251: + return transformAndEmitContinueStatement(node); + case 252: + return transformAndEmitBreakStatement(node); + case 253: + return transformAndEmitReturnStatement(node); + case 254: + return transformAndEmitWithStatement(node); + case 255: + return transformAndEmitSwitchStatement(node); + case 256: + return transformAndEmitLabeledStatement(node); + case 257: + return transformAndEmitThrowStatement(node); + case 258: + return transformAndEmitTryStatement(node); + default: + return emitStatement(visitNode(node, visitor, isStatement)); + } + } + function transformAndEmitBlock(node) { + if (containsYield(node)) { + transformAndEmitStatements(node.statements); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function transformAndEmitExpressionStatement(node) { + emitStatement(visitNode(node, visitor, isStatement)); + } + function transformAndEmitVariableDeclarationList(node) { + for (const variable of node.declarations) { + const name2 = factory2.cloneNode(variable.name); + setCommentRange(name2, variable.name); + hoistVariableDeclaration(name2); + } + const variables = getInitializedVariables(node); + const numVariables = variables.length; + let variablesWritten = 0; + let pendingExpressions = []; + while (variablesWritten < numVariables) { + for (let i7 = variablesWritten; i7 < numVariables; i7++) { + const variable = variables[i7]; + if (containsYield(variable.initializer) && pendingExpressions.length > 0) { + break; + } + pendingExpressions.push(transformInitializedVariable(variable)); + } + if (pendingExpressions.length) { + emitStatement(factory2.createExpressionStatement(factory2.inlineExpressions(pendingExpressions))); + variablesWritten += pendingExpressions.length; + pendingExpressions = []; + } + } + return void 0; + } + function transformInitializedVariable(node) { + return setSourceMapRange( + factory2.createAssignment( + setSourceMapRange(factory2.cloneNode(node.name), node.name), + Debug.checkDefined(visitNode(node.initializer, visitor, isExpression)) + ), + node + ); + } + function transformAndEmitIfStatement(node) { + if (containsYield(node)) { + if (containsYield(node.thenStatement) || containsYield(node.elseStatement)) { + const endLabel = defineLabel(); + const elseLabel = node.elseStatement ? defineLabel() : void 0; + emitBreakWhenFalse( + node.elseStatement ? elseLabel : endLabel, + Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), + /*location*/ + node.expression + ); + transformAndEmitEmbeddedStatement(node.thenStatement); + if (node.elseStatement) { + emitBreak(endLabel); + markLabel(elseLabel); + transformAndEmitEmbeddedStatement(node.elseStatement); + } + markLabel(endLabel); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function transformAndEmitDoStatement(node) { + if (containsYield(node)) { + const conditionLabel = defineLabel(); + const loopLabel = defineLabel(); + beginLoopBlock( + /*continueLabel*/ + conditionLabel + ); + markLabel(loopLabel); + transformAndEmitEmbeddedStatement(node.statement); + markLabel(conditionLabel); + emitBreakWhenTrue(loopLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); + endLoopBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitDoStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + node = visitEachChild(node, visitor, context2); + endLoopBlock(); + return node; + } else { + return visitEachChild(node, visitor, context2); + } + } + function transformAndEmitWhileStatement(node) { + if (containsYield(node)) { + const loopLabel = defineLabel(); + const endLabel = beginLoopBlock(loopLabel); + markLabel(loopLabel); + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); + transformAndEmitEmbeddedStatement(node.statement); + emitBreak(loopLabel); + endLoopBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitWhileStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + node = visitEachChild(node, visitor, context2); + endLoopBlock(); + return node; + } else { + return visitEachChild(node, visitor, context2); + } + } + function transformAndEmitForStatement(node) { + if (containsYield(node)) { + const conditionLabel = defineLabel(); + const incrementLabel = defineLabel(); + const endLabel = beginLoopBlock(incrementLabel); + if (node.initializer) { + const initializer = node.initializer; + if (isVariableDeclarationList(initializer)) { + transformAndEmitVariableDeclarationList(initializer); + } else { + emitStatement( + setTextRange( + factory2.createExpressionStatement( + Debug.checkDefined(visitNode(initializer, visitor, isExpression)) + ), + initializer + ) + ); + } + } + markLabel(conditionLabel); + if (node.condition) { + emitBreakWhenFalse(endLabel, Debug.checkDefined(visitNode(node.condition, visitor, isExpression))); + } + transformAndEmitEmbeddedStatement(node.statement); + markLabel(incrementLabel); + if (node.incrementor) { + emitStatement( + setTextRange( + factory2.createExpressionStatement( + Debug.checkDefined(visitNode(node.incrementor, visitor, isExpression)) + ), + node.incrementor + ) + ); + } + emitBreak(conditionLabel); + endLoopBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitForStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + } + const initializer = node.initializer; + if (initializer && isVariableDeclarationList(initializer)) { + for (const variable of initializer.declarations) { + hoistVariableDeclaration(variable.name); + } + const variables = getInitializedVariables(initializer); + node = factory2.updateForStatement( + node, + variables.length > 0 ? factory2.inlineExpressions(map4(variables, transformInitializedVariable)) : void 0, + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, visitor, isExpression), + visitIterationBody(node.statement, visitor, context2) + ); + } else { + node = visitEachChild(node, visitor, context2); + } + if (inStatementContainingYield) { + endLoopBlock(); + } + return node; + } + function transformAndEmitForInStatement(node) { + if (containsYield(node)) { + const obj = declareLocal(); + const keysArray = declareLocal(); + const key = declareLocal(); + const keysIndex = factory2.createLoopVariable(); + const initializer = node.initializer; + hoistVariableDeclaration(keysIndex); + emitAssignment(obj, Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); + emitAssignment(keysArray, factory2.createArrayLiteralExpression()); + emitStatement( + factory2.createForInStatement( + key, + obj, + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(keysArray, "push"), + /*typeArguments*/ + void 0, + [key] + ) + ) + ) + ); + emitAssignment(keysIndex, factory2.createNumericLiteral(0)); + const conditionLabel = defineLabel(); + const incrementLabel = defineLabel(); + const endLoopLabel = beginLoopBlock(incrementLabel); + markLabel(conditionLabel); + emitBreakWhenFalse(endLoopLabel, factory2.createLessThan(keysIndex, factory2.createPropertyAccessExpression(keysArray, "length"))); + emitAssignment(key, factory2.createElementAccessExpression(keysArray, keysIndex)); + emitBreakWhenFalse(incrementLabel, factory2.createBinaryExpression(key, 103, obj)); + let variable; + if (isVariableDeclarationList(initializer)) { + for (const variable2 of initializer.declarations) { + hoistVariableDeclaration(variable2.name); + } + variable = factory2.cloneNode(initializer.declarations[0].name); + } else { + variable = Debug.checkDefined(visitNode(initializer, visitor, isExpression)); + Debug.assert(isLeftHandSideExpression(variable)); + } + emitAssignment(variable, key); + transformAndEmitEmbeddedStatement(node.statement); + markLabel(incrementLabel); + emitStatement(factory2.createExpressionStatement(factory2.createPostfixIncrement(keysIndex))); + emitBreak(conditionLabel); + endLoopBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitForInStatement(node) { + if (inStatementContainingYield) { + beginScriptLoopBlock(); + } + const initializer = node.initializer; + if (isVariableDeclarationList(initializer)) { + for (const variable of initializer.declarations) { + hoistVariableDeclaration(variable.name); + } + node = factory2.updateForInStatement(node, initializer.declarations[0].name, Debug.checkDefined(visitNode(node.expression, visitor, isExpression)), Debug.checkDefined(visitNode(node.statement, visitor, isStatement, factory2.liftToBlock))); + } else { + node = visitEachChild(node, visitor, context2); + } + if (inStatementContainingYield) { + endLoopBlock(); + } + return node; + } + function transformAndEmitContinueStatement(node) { + const label = findContinueTarget(node.label ? idText(node.label) : void 0); + if (label > 0) { + emitBreak( + label, + /*location*/ + node + ); + } else { + emitStatement(node); + } + } + function visitContinueStatement(node) { + if (inStatementContainingYield) { + const label = findContinueTarget(node.label && idText(node.label)); + if (label > 0) { + return createInlineBreak( + label, + /*location*/ + node + ); + } + } + return visitEachChild(node, visitor, context2); + } + function transformAndEmitBreakStatement(node) { + const label = findBreakTarget(node.label ? idText(node.label) : void 0); + if (label > 0) { + emitBreak( + label, + /*location*/ + node + ); + } else { + emitStatement(node); + } + } + function visitBreakStatement(node) { + if (inStatementContainingYield) { + const label = findBreakTarget(node.label && idText(node.label)); + if (label > 0) { + return createInlineBreak( + label, + /*location*/ + node + ); + } + } + return visitEachChild(node, visitor, context2); + } + function transformAndEmitReturnStatement(node) { + emitReturn( + visitNode(node.expression, visitor, isExpression), + /*location*/ + node + ); + } + function visitReturnStatement(node) { + return createInlineReturn( + visitNode(node.expression, visitor, isExpression), + /*location*/ + node + ); + } + function transformAndEmitWithStatement(node) { + if (containsYield(node)) { + beginWithBlock(cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression)))); + transformAndEmitEmbeddedStatement(node.statement); + endWithBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function transformAndEmitSwitchStatement(node) { + if (containsYield(node.caseBlock)) { + const caseBlock = node.caseBlock; + const numClauses = caseBlock.clauses.length; + const endLabel = beginSwitchBlock(); + const expression = cacheExpression(Debug.checkDefined(visitNode(node.expression, visitor, isExpression))); + const clauseLabels = []; + let defaultClauseIndex = -1; + for (let i7 = 0; i7 < numClauses; i7++) { + const clause = caseBlock.clauses[i7]; + clauseLabels.push(defineLabel()); + if (clause.kind === 297 && defaultClauseIndex === -1) { + defaultClauseIndex = i7; + } + } + let clausesWritten = 0; + let pendingClauses = []; + while (clausesWritten < numClauses) { + let defaultClausesSkipped = 0; + for (let i7 = clausesWritten; i7 < numClauses; i7++) { + const clause = caseBlock.clauses[i7]; + if (clause.kind === 296) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { + break; + } + pendingClauses.push( + factory2.createCaseClause( + Debug.checkDefined(visitNode(clause.expression, visitor, isExpression)), + [ + createInlineBreak( + clauseLabels[i7], + /*location*/ + clause.expression + ) + ] + ) + ); + } else { + defaultClausesSkipped++; + } + } + if (pendingClauses.length) { + emitStatement(factory2.createSwitchStatement(expression, factory2.createCaseBlock(pendingClauses))); + clausesWritten += pendingClauses.length; + pendingClauses = []; + } + if (defaultClausesSkipped > 0) { + clausesWritten += defaultClausesSkipped; + defaultClausesSkipped = 0; + } + } + if (defaultClauseIndex >= 0) { + emitBreak(clauseLabels[defaultClauseIndex]); + } else { + emitBreak(endLabel); + } + for (let i7 = 0; i7 < numClauses; i7++) { + markLabel(clauseLabels[i7]); + transformAndEmitStatements(caseBlock.clauses[i7].statements); + } + endSwitchBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitSwitchStatement(node) { + if (inStatementContainingYield) { + beginScriptSwitchBlock(); + } + node = visitEachChild(node, visitor, context2); + if (inStatementContainingYield) { + endSwitchBlock(); + } + return node; + } + function transformAndEmitLabeledStatement(node) { + if (containsYield(node)) { + beginLabeledBlock(idText(node.label)); + transformAndEmitEmbeddedStatement(node.statement); + endLabeledBlock(); + } else { + emitStatement(visitNode(node, visitor, isStatement)); + } + } + function visitLabeledStatement(node) { + if (inStatementContainingYield) { + beginScriptLabeledBlock(idText(node.label)); + } + node = visitEachChild(node, visitor, context2); + if (inStatementContainingYield) { + endLabeledBlock(); + } + return node; + } + function transformAndEmitThrowStatement(node) { + emitThrow( + Debug.checkDefined(visitNode(node.expression ?? factory2.createVoidZero(), visitor, isExpression)), + /*location*/ + node + ); + } + function transformAndEmitTryStatement(node) { + if (containsYield(node)) { + beginExceptionBlock(); + transformAndEmitEmbeddedStatement(node.tryBlock); + if (node.catchClause) { + beginCatchBlock(node.catchClause.variableDeclaration); + transformAndEmitEmbeddedStatement(node.catchClause.block); + } + if (node.finallyBlock) { + beginFinallyBlock(); + transformAndEmitEmbeddedStatement(node.finallyBlock); + } + endExceptionBlock(); + } else { + emitStatement(visitEachChild(node, visitor, context2)); + } + } + function containsYield(node) { + return !!node && (node.transformFlags & 1048576) !== 0; + } + function countInitialNodesWithoutYield(nodes) { + const numNodes = nodes.length; + for (let i7 = 0; i7 < numNodes; i7++) { + if (containsYield(nodes[i7])) { + return i7; + } + } + return -1; + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (hint === 1) { + return substituteExpression(node); + } + return node; + } + function substituteExpression(node) { + if (isIdentifier(node)) { + return substituteExpressionIdentifier(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + if (!isGeneratedIdentifier(node) && renamedCatchVariables && renamedCatchVariables.has(idText(node))) { + const original = getOriginalNode(node); + if (isIdentifier(original) && original.parent) { + const declaration = resolver.getReferencedValueDeclaration(original); + if (declaration) { + const name2 = renamedCatchVariableDeclarations[getOriginalNodeId(declaration)]; + if (name2) { + const clone22 = setParent(setTextRange(factory2.cloneNode(name2), name2), name2.parent); + setSourceMapRange(clone22, node); + setCommentRange(clone22, node); + return clone22; + } + } + } + } + return node; + } + function cacheExpression(node) { + if (isGeneratedIdentifier(node) || getEmitFlags(node) & 8192) { + return node; + } + const temp = factory2.createTempVariable(hoistVariableDeclaration); + emitAssignment( + temp, + node, + /*location*/ + node + ); + return temp; + } + function declareLocal(name2) { + const temp = name2 ? factory2.createUniqueName(name2) : factory2.createTempVariable( + /*recordTempVariable*/ + void 0 + ); + hoistVariableDeclaration(temp); + return temp; + } + function defineLabel() { + if (!labelOffsets) { + labelOffsets = []; + } + const label = nextLabelId; + nextLabelId++; + labelOffsets[label] = -1; + return label; + } + function markLabel(label) { + Debug.assert(labelOffsets !== void 0, "No labels were defined."); + labelOffsets[label] = operations ? operations.length : 0; + } + function beginBlock(block) { + if (!blocks) { + blocks = []; + blockActions = []; + blockOffsets = []; + blockStack = []; + } + const index4 = blockActions.length; + blockActions[index4] = 0; + blockOffsets[index4] = operations ? operations.length : 0; + blocks[index4] = block; + blockStack.push(block); + return index4; + } + function endBlock() { + const block = peekBlock(); + if (block === void 0) + return Debug.fail("beginBlock was never called."); + const index4 = blockActions.length; + blockActions[index4] = 1; + blockOffsets[index4] = operations ? operations.length : 0; + blocks[index4] = block; + blockStack.pop(); + return block; + } + function peekBlock() { + return lastOrUndefined(blockStack); + } + function peekBlockKind() { + const block = peekBlock(); + return block && block.kind; + } + function beginWithBlock(expression) { + const startLabel = defineLabel(); + const endLabel = defineLabel(); + markLabel(startLabel); + beginBlock({ + kind: 1, + expression, + startLabel, + endLabel + }); + } + function endWithBlock() { + Debug.assert( + peekBlockKind() === 1 + /* With */ + ); + const block = endBlock(); + markLabel(block.endLabel); + } + function beginExceptionBlock() { + const startLabel = defineLabel(); + const endLabel = defineLabel(); + markLabel(startLabel); + beginBlock({ + kind: 0, + state: 0, + startLabel, + endLabel + }); + emitNop(); + return endLabel; + } + function beginCatchBlock(variable) { + Debug.assert( + peekBlockKind() === 0 + /* Exception */ + ); + let name2; + if (isGeneratedIdentifier(variable.name)) { + name2 = variable.name; + hoistVariableDeclaration(variable.name); + } else { + const text = idText(variable.name); + name2 = declareLocal(text); + if (!renamedCatchVariables) { + renamedCatchVariables = /* @__PURE__ */ new Map(); + renamedCatchVariableDeclarations = []; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + } + renamedCatchVariables.set(text, true); + renamedCatchVariableDeclarations[getOriginalNodeId(variable)] = name2; + } + const exception2 = peekBlock(); + Debug.assert( + exception2.state < 1 + /* Catch */ + ); + const endLabel = exception2.endLabel; + emitBreak(endLabel); + const catchLabel = defineLabel(); + markLabel(catchLabel); + exception2.state = 1; + exception2.catchVariable = name2; + exception2.catchLabel = catchLabel; + emitAssignment(name2, factory2.createCallExpression( + factory2.createPropertyAccessExpression(state, "sent"), + /*typeArguments*/ + void 0, + [] + )); + emitNop(); + } + function beginFinallyBlock() { + Debug.assert( + peekBlockKind() === 0 + /* Exception */ + ); + const exception2 = peekBlock(); + Debug.assert( + exception2.state < 2 + /* Finally */ + ); + const endLabel = exception2.endLabel; + emitBreak(endLabel); + const finallyLabel = defineLabel(); + markLabel(finallyLabel); + exception2.state = 2; + exception2.finallyLabel = finallyLabel; + } + function endExceptionBlock() { + Debug.assert( + peekBlockKind() === 0 + /* Exception */ + ); + const exception2 = endBlock(); + const state2 = exception2.state; + if (state2 < 2) { + emitBreak(exception2.endLabel); + } else { + emitEndfinally(); + } + markLabel(exception2.endLabel); + emitNop(); + exception2.state = 3; + } + function beginScriptLoopBlock() { + beginBlock({ + kind: 3, + isScript: true, + breakLabel: -1, + continueLabel: -1 + }); + } + function beginLoopBlock(continueLabel) { + const breakLabel = defineLabel(); + beginBlock({ + kind: 3, + isScript: false, + breakLabel, + continueLabel + }); + return breakLabel; + } + function endLoopBlock() { + Debug.assert( + peekBlockKind() === 3 + /* Loop */ + ); + const block = endBlock(); + const breakLabel = block.breakLabel; + if (!block.isScript) { + markLabel(breakLabel); + } + } + function beginScriptSwitchBlock() { + beginBlock({ + kind: 2, + isScript: true, + breakLabel: -1 + }); + } + function beginSwitchBlock() { + const breakLabel = defineLabel(); + beginBlock({ + kind: 2, + isScript: false, + breakLabel + }); + return breakLabel; + } + function endSwitchBlock() { + Debug.assert( + peekBlockKind() === 2 + /* Switch */ + ); + const block = endBlock(); + const breakLabel = block.breakLabel; + if (!block.isScript) { + markLabel(breakLabel); + } + } + function beginScriptLabeledBlock(labelText) { + beginBlock({ + kind: 4, + isScript: true, + labelText, + breakLabel: -1 + }); + } + function beginLabeledBlock(labelText) { + const breakLabel = defineLabel(); + beginBlock({ + kind: 4, + isScript: false, + labelText, + breakLabel + }); + } + function endLabeledBlock() { + Debug.assert( + peekBlockKind() === 4 + /* Labeled */ + ); + const block = endBlock(); + if (!block.isScript) { + markLabel(block.breakLabel); + } + } + function supportsUnlabeledBreak(block) { + return block.kind === 2 || block.kind === 3; + } + function supportsLabeledBreakOrContinue(block) { + return block.kind === 4; + } + function supportsUnlabeledContinue(block) { + return block.kind === 3; + } + function hasImmediateContainingLabeledBlock(labelText, start) { + for (let j6 = start; j6 >= 0; j6--) { + const containingBlock = blockStack[j6]; + if (supportsLabeledBreakOrContinue(containingBlock)) { + if (containingBlock.labelText === labelText) { + return true; + } + } else { + break; + } + } + return false; + } + function findBreakTarget(labelText) { + if (blockStack) { + if (labelText) { + for (let i7 = blockStack.length - 1; i7 >= 0; i7--) { + const block = blockStack[i7]; + if (supportsLabeledBreakOrContinue(block) && block.labelText === labelText) { + return block.breakLabel; + } else if (supportsUnlabeledBreak(block) && hasImmediateContainingLabeledBlock(labelText, i7 - 1)) { + return block.breakLabel; + } + } + } else { + for (let i7 = blockStack.length - 1; i7 >= 0; i7--) { + const block = blockStack[i7]; + if (supportsUnlabeledBreak(block)) { + return block.breakLabel; + } + } + } + } + return 0; + } + function findContinueTarget(labelText) { + if (blockStack) { + if (labelText) { + for (let i7 = blockStack.length - 1; i7 >= 0; i7--) { + const block = blockStack[i7]; + if (supportsUnlabeledContinue(block) && hasImmediateContainingLabeledBlock(labelText, i7 - 1)) { + return block.continueLabel; + } + } + } else { + for (let i7 = blockStack.length - 1; i7 >= 0; i7--) { + const block = blockStack[i7]; + if (supportsUnlabeledContinue(block)) { + return block.continueLabel; + } + } + } + } + return 0; + } + function createLabel(label) { + if (label !== void 0 && label > 0) { + if (labelExpressions === void 0) { + labelExpressions = []; + } + const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER); + if (labelExpressions[label] === void 0) { + labelExpressions[label] = [expression]; + } else { + labelExpressions[label].push(expression); + } + return expression; + } + return factory2.createOmittedExpression(); + } + function createInstruction(instruction) { + const literal = factory2.createNumericLiteral(instruction); + addSyntheticTrailingComment(literal, 3, getInstructionName(instruction)); + return literal; + } + function createInlineBreak(label, location2) { + Debug.assertLessThan(0, label, "Invalid label"); + return setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 3 + /* Break */ + ), + createLabel(label) + ]) + ), + location2 + ); + } + function createInlineReturn(expression, location2) { + return setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression( + expression ? [createInstruction( + 2 + /* Return */ + ), expression] : [createInstruction( + 2 + /* Return */ + )] + ) + ), + location2 + ); + } + function createGeneratorResume(location2) { + return setTextRange( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(state, "sent"), + /*typeArguments*/ + void 0, + [] + ), + location2 + ); + } + function emitNop() { + emitWorker( + 0 + /* Nop */ + ); + } + function emitStatement(node) { + if (node) { + emitWorker(1, [node]); + } else { + emitNop(); + } + } + function emitAssignment(left, right, location2) { + emitWorker(2, [left, right], location2); + } + function emitBreak(label, location2) { + emitWorker(3, [label], location2); + } + function emitBreakWhenTrue(label, condition, location2) { + emitWorker(4, [label, condition], location2); + } + function emitBreakWhenFalse(label, condition, location2) { + emitWorker(5, [label, condition], location2); + } + function emitYieldStar(expression, location2) { + emitWorker(7, [expression], location2); + } + function emitYield(expression, location2) { + emitWorker(6, [expression], location2); + } + function emitReturn(expression, location2) { + emitWorker(8, [expression], location2); + } + function emitThrow(expression, location2) { + emitWorker(9, [expression], location2); + } + function emitEndfinally() { + emitWorker( + 10 + /* Endfinally */ + ); + } + function emitWorker(code, args, location2) { + if (operations === void 0) { + operations = []; + operationArguments = []; + operationLocations = []; + } + if (labelOffsets === void 0) { + markLabel(defineLabel()); + } + const operationIndex = operations.length; + operations[operationIndex] = code; + operationArguments[operationIndex] = args; + operationLocations[operationIndex] = location2; + } + function build2() { + blockIndex = 0; + labelNumber = 0; + labelNumbers = void 0; + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + clauses = void 0; + statements = void 0; + exceptionBlockStack = void 0; + currentExceptionBlock = void 0; + withBlockStack = void 0; + const buildResult = buildStatements(); + return emitHelpers().createGeneratorHelper( + setEmitFlags( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + state + )], + /*type*/ + void 0, + factory2.createBlock( + buildResult, + /*multiLine*/ + buildResult.length > 0 + ) + ), + 1048576 + /* ReuseTempVariableScope */ + ) + ); + } + function buildStatements() { + if (operations) { + for (let operationIndex = 0; operationIndex < operations.length; operationIndex++) { + writeOperation(operationIndex); + } + flushFinalLabel(operations.length); + } else { + flushFinalLabel(0); + } + if (clauses) { + const labelExpression = factory2.createPropertyAccessExpression(state, "label"); + const switchStatement = factory2.createSwitchStatement(labelExpression, factory2.createCaseBlock(clauses)); + return [startOnNewLine(switchStatement)]; + } + if (statements) { + return statements; + } + return []; + } + function flushLabel() { + if (!statements) { + return; + } + appendLabel( + /*markLabelEnd*/ + !lastOperationWasAbrupt + ); + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + labelNumber++; + } + function flushFinalLabel(operationIndex) { + if (isFinalLabelReachable(operationIndex)) { + tryEnterLabel(operationIndex); + withBlockStack = void 0; + writeReturn( + /*expression*/ + void 0, + /*operationLocation*/ + void 0 + ); + } + if (statements && clauses) { + appendLabel( + /*markLabelEnd*/ + false + ); + } + updateLabelExpressions(); + } + function isFinalLabelReachable(operationIndex) { + if (!lastOperationWasCompletion) { + return true; + } + if (!labelOffsets || !labelExpressions) { + return false; + } + for (let label = 0; label < labelOffsets.length; label++) { + if (labelOffsets[label] === operationIndex && labelExpressions[label]) { + return true; + } + } + return false; + } + function appendLabel(markLabelEnd) { + if (!clauses) { + clauses = []; + } + if (statements) { + if (withBlockStack) { + for (let i7 = withBlockStack.length - 1; i7 >= 0; i7--) { + const withBlock = withBlockStack[i7]; + statements = [factory2.createWithStatement(withBlock.expression, factory2.createBlock(statements))]; + } + } + if (currentExceptionBlock) { + const { startLabel, catchLabel, finallyLabel, endLabel } = currentExceptionBlock; + statements.unshift( + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createPropertyAccessExpression(state, "trys"), "push"), + /*typeArguments*/ + void 0, + [ + factory2.createArrayLiteralExpression([ + createLabel(startLabel), + createLabel(catchLabel), + createLabel(finallyLabel), + createLabel(endLabel) + ]) + ] + ) + ) + ); + currentExceptionBlock = void 0; + } + if (markLabelEnd) { + statements.push( + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(state, "label"), + factory2.createNumericLiteral(labelNumber + 1) + ) + ) + ); + } + } + clauses.push( + factory2.createCaseClause( + factory2.createNumericLiteral(labelNumber), + statements || [] + ) + ); + statements = void 0; + } + function tryEnterLabel(operationIndex) { + if (!labelOffsets) { + return; + } + for (let label = 0; label < labelOffsets.length; label++) { + if (labelOffsets[label] === operationIndex) { + flushLabel(); + if (labelNumbers === void 0) { + labelNumbers = []; + } + if (labelNumbers[labelNumber] === void 0) { + labelNumbers[labelNumber] = [label]; + } else { + labelNumbers[labelNumber].push(label); + } + } + } + } + function updateLabelExpressions() { + if (labelExpressions !== void 0 && labelNumbers !== void 0) { + for (let labelNumber2 = 0; labelNumber2 < labelNumbers.length; labelNumber2++) { + const labels = labelNumbers[labelNumber2]; + if (labels !== void 0) { + for (const label of labels) { + const expressions = labelExpressions[label]; + if (expressions !== void 0) { + for (const expression of expressions) { + expression.text = String(labelNumber2); + } + } + } + } + } + } + } + function tryEnterOrLeaveBlock(operationIndex) { + if (blocks) { + for (; blockIndex < blockActions.length && blockOffsets[blockIndex] <= operationIndex; blockIndex++) { + const block = blocks[blockIndex]; + const blockAction = blockActions[blockIndex]; + switch (block.kind) { + case 0: + if (blockAction === 0) { + if (!exceptionBlockStack) { + exceptionBlockStack = []; + } + if (!statements) { + statements = []; + } + exceptionBlockStack.push(currentExceptionBlock); + currentExceptionBlock = block; + } else if (blockAction === 1) { + currentExceptionBlock = exceptionBlockStack.pop(); + } + break; + case 1: + if (blockAction === 0) { + if (!withBlockStack) { + withBlockStack = []; + } + withBlockStack.push(block); + } else if (blockAction === 1) { + withBlockStack.pop(); + } + break; + } + } + } + } + function writeOperation(operationIndex) { + tryEnterLabel(operationIndex); + tryEnterOrLeaveBlock(operationIndex); + if (lastOperationWasAbrupt) { + return; + } + lastOperationWasAbrupt = false; + lastOperationWasCompletion = false; + const opcode = operations[operationIndex]; + if (opcode === 0) { + return; + } else if (opcode === 10) { + return writeEndfinally(); + } + const args = operationArguments[operationIndex]; + if (opcode === 1) { + return writeStatement(args[0]); + } + const location2 = operationLocations[operationIndex]; + switch (opcode) { + case 2: + return writeAssign(args[0], args[1], location2); + case 3: + return writeBreak(args[0], location2); + case 4: + return writeBreakWhenTrue(args[0], args[1], location2); + case 5: + return writeBreakWhenFalse(args[0], args[1], location2); + case 6: + return writeYield(args[0], location2); + case 7: + return writeYieldStar(args[0], location2); + case 8: + return writeReturn(args[0], location2); + case 9: + return writeThrow(args[0], location2); + } + } + function writeStatement(statement) { + if (statement) { + if (!statements) { + statements = [statement]; + } else { + statements.push(statement); + } + } + } + function writeAssign(left, right, operationLocation) { + writeStatement(setTextRange(factory2.createExpressionStatement(factory2.createAssignment(left, right)), operationLocation)); + } + function writeThrow(expression, operationLocation) { + lastOperationWasAbrupt = true; + lastOperationWasCompletion = true; + writeStatement(setTextRange(factory2.createThrowStatement(expression), operationLocation)); + } + function writeReturn(expression, operationLocation) { + lastOperationWasAbrupt = true; + lastOperationWasCompletion = true; + writeStatement( + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression( + expression ? [createInstruction( + 2 + /* Return */ + ), expression] : [createInstruction( + 2 + /* Return */ + )] + ) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ); + } + function writeBreak(label, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement( + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 3 + /* Break */ + ), + createLabel(label) + ]) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ); + } + function writeBreakWhenTrue(label, condition, operationLocation) { + writeStatement( + setEmitFlags( + factory2.createIfStatement( + condition, + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 3 + /* Break */ + ), + createLabel(label) + ]) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ), + 1 + /* SingleLine */ + ) + ); + } + function writeBreakWhenFalse(label, condition, operationLocation) { + writeStatement( + setEmitFlags( + factory2.createIfStatement( + factory2.createLogicalNot(condition), + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 3 + /* Break */ + ), + createLabel(label) + ]) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ), + 1 + /* SingleLine */ + ) + ); + } + function writeYield(expression, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement( + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression( + expression ? [createInstruction( + 4 + /* Yield */ + ), expression] : [createInstruction( + 4 + /* Yield */ + )] + ) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ); + } + function writeYieldStar(expression, operationLocation) { + lastOperationWasAbrupt = true; + writeStatement( + setEmitFlags( + setTextRange( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 5 + /* YieldStar */ + ), + expression + ]) + ), + operationLocation + ), + 768 + /* NoTokenSourceMaps */ + ) + ); + } + function writeEndfinally() { + lastOperationWasAbrupt = true; + writeStatement( + factory2.createReturnStatement( + factory2.createArrayLiteralExpression([ + createInstruction( + 7 + /* Endfinally */ + ) + ]) + ) + ); + } + } + var init_generators = __esm2({ + "src/compiler/transformers/generators.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformModule(context2) { + function getTransformModuleDelegate(moduleKind2) { + switch (moduleKind2) { + case 2: + return transformAMDModule; + case 3: + return transformUMDModule; + default: + return transformCommonJSModule; + } + } + const { + factory: factory2, + getEmitHelperFactory: emitHelpers, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const compilerOptions = context2.getCompilerOptions(); + const resolver = context2.getEmitResolver(); + const host = context2.getEmitHost(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const moduleKind = getEmitModuleKind(compilerOptions); + const previousOnSubstituteNode = context2.onSubstituteNode; + const previousOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 213 + /* CallExpression */ + ); + context2.enableSubstitution( + 215 + /* TaggedTemplateExpression */ + ); + context2.enableSubstitution( + 80 + /* Identifier */ + ); + context2.enableSubstitution( + 226 + /* BinaryExpression */ + ); + context2.enableSubstitution( + 304 + /* ShorthandPropertyAssignment */ + ); + context2.enableEmitNotification( + 312 + /* SourceFile */ + ); + const moduleInfoMap = []; + let currentSourceFile; + let currentModuleInfo; + const noSubstitution = []; + let needUMDDynamicImportHelper; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608 || isJsonSourceFile(node) && hasJsonModuleEmitEnabled(compilerOptions) && outFile(compilerOptions))) { + return node; + } + currentSourceFile = node; + currentModuleInfo = collectExternalModuleInfo(context2, node); + moduleInfoMap[getOriginalNodeId(node)] = currentModuleInfo; + const transformModule2 = getTransformModuleDelegate(moduleKind); + const updated = transformModule2(node); + currentSourceFile = void 0; + currentModuleInfo = void 0; + needUMDDynamicImportHelper = false; + return updated; + } + function shouldEmitUnderscoreUnderscoreESModule() { + if (!currentModuleInfo.exportEquals && isExternalModule(currentSourceFile)) { + return true; + } + return false; + } + function transformCommonJSModule(node) { + startLexicalEnvironment(); + const statements = []; + const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || !compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile); + const statementOffset = factory2.copyPrologue(node.statements, statements, ensureUseStrict && !isJsonSourceFile(node), topLevelVisitor); + if (shouldEmitUnderscoreUnderscoreESModule()) { + append(statements, createUnderscoreUnderscoreESModule()); + } + if (length(currentModuleInfo.exportedNames)) { + const chunkSize = 50; + for (let i7 = 0; i7 < currentModuleInfo.exportedNames.length; i7 += chunkSize) { + append( + statements, + factory2.createExpressionStatement( + reduceLeft( + currentModuleInfo.exportedNames.slice(i7, i7 + chunkSize), + (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), + factory2.createVoidZero() + ) + ) + ); + } + } + append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement)); + addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset)); + addExportEqualsIfNeeded( + statements, + /*emitAsReturn*/ + false + ); + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + const updated = factory2.updateSourceFile(node, setTextRange(factory2.createNodeArray(statements), node.statements)); + addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function transformAMDModule(node) { + const define2 = factory2.createIdentifier("define"); + const moduleName3 = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); + const jsonSourceFile = isJsonSourceFile(node) && node; + const { aliasedModuleNames, unaliasedModuleNames, importAliasNames } = collectAsynchronousDependencies( + node, + /*includeNonAmdDependencies*/ + true + ); + const updated = factory2.updateSourceFile( + node, + setTextRange( + factory2.createNodeArray([ + factory2.createExpressionStatement( + factory2.createCallExpression( + define2, + /*typeArguments*/ + void 0, + [ + // Add the module name (if provided). + ...moduleName3 ? [moduleName3] : [], + // Add the dependency array argument: + // + // ["require", "exports", module1", "module2", ...] + factory2.createArrayLiteralExpression( + jsonSourceFile ? emptyArray : [ + factory2.createStringLiteral("require"), + factory2.createStringLiteral("exports"), + ...aliasedModuleNames, + ...unaliasedModuleNames + ] + ), + // Add the module body function argument: + // + // function (require, exports, module1, module2) ... + jsonSourceFile ? jsonSourceFile.statements.length ? jsonSourceFile.statements[0].expression : factory2.createObjectLiteralExpression() : factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "require" + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "exports" + ), + ...importAliasNames + ], + /*type*/ + void 0, + transformAsynchronousModuleBody(node) + ) + ] + ) + ) + ]), + /*location*/ + node.statements + ) + ); + addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function transformUMDModule(node) { + const { aliasedModuleNames, unaliasedModuleNames, importAliasNames } = collectAsynchronousDependencies( + node, + /*includeNonAmdDependencies*/ + false + ); + const moduleName3 = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); + const umdHeader = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "factory" + )], + /*type*/ + void 0, + setTextRange( + factory2.createBlock( + [ + factory2.createIfStatement( + factory2.createLogicalAnd( + factory2.createTypeCheck(factory2.createIdentifier("module"), "object"), + factory2.createTypeCheck(factory2.createPropertyAccessExpression(factory2.createIdentifier("module"), "exports"), "object") + ), + factory2.createBlock([ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + [ + factory2.createVariableDeclaration( + "v", + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createCallExpression( + factory2.createIdentifier("factory"), + /*typeArguments*/ + void 0, + [ + factory2.createIdentifier("require"), + factory2.createIdentifier("exports") + ] + ) + ) + ] + ), + setEmitFlags( + factory2.createIfStatement( + factory2.createStrictInequality( + factory2.createIdentifier("v"), + factory2.createIdentifier("undefined") + ), + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression(factory2.createIdentifier("module"), "exports"), + factory2.createIdentifier("v") + ) + ) + ), + 1 + /* SingleLine */ + ) + ]), + factory2.createIfStatement( + factory2.createLogicalAnd( + factory2.createTypeCheck(factory2.createIdentifier("define"), "function"), + factory2.createPropertyAccessExpression(factory2.createIdentifier("define"), "amd") + ), + factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createIdentifier("define"), + /*typeArguments*/ + void 0, + [ + // Add the module name (if provided). + ...moduleName3 ? [moduleName3] : [], + factory2.createArrayLiteralExpression([ + factory2.createStringLiteral("require"), + factory2.createStringLiteral("exports"), + ...aliasedModuleNames, + ...unaliasedModuleNames + ]), + factory2.createIdentifier("factory") + ] + ) + ) + ]) + ) + ) + ], + /*multiLine*/ + true + ), + /*location*/ + void 0 + ) + ); + const updated = factory2.updateSourceFile( + node, + setTextRange( + factory2.createNodeArray([ + factory2.createExpressionStatement( + factory2.createCallExpression( + umdHeader, + /*typeArguments*/ + void 0, + [ + // Add the module body function argument: + // + // function (require, exports) ... + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "require" + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "exports" + ), + ...importAliasNames + ], + /*type*/ + void 0, + transformAsynchronousModuleBody(node) + ) + ] + ) + ) + ]), + /*location*/ + node.statements + ) + ); + addEmitHelpers(updated, context2.readEmitHelpers()); + return updated; + } + function collectAsynchronousDependencies(node, includeNonAmdDependencies) { + const aliasedModuleNames = []; + const unaliasedModuleNames = []; + const importAliasNames = []; + for (const amdDependency of node.amdDependencies) { + if (amdDependency.name) { + aliasedModuleNames.push(factory2.createStringLiteral(amdDependency.path)); + importAliasNames.push(factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + amdDependency.name + )); + } else { + unaliasedModuleNames.push(factory2.createStringLiteral(amdDependency.path)); + } + } + for (const importNode of currentModuleInfo.externalImports) { + const externalModuleName = getExternalModuleNameLiteral(factory2, importNode, currentSourceFile, host, resolver, compilerOptions); + const importAliasName = getLocalNameForExternalImport(factory2, importNode, currentSourceFile); + if (externalModuleName) { + if (includeNonAmdDependencies && importAliasName) { + setEmitFlags( + importAliasName, + 8 + /* NoSubstitution */ + ); + aliasedModuleNames.push(externalModuleName); + importAliasNames.push(factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + importAliasName + )); + } else { + unaliasedModuleNames.push(externalModuleName); + } + } + } + return { aliasedModuleNames, unaliasedModuleNames, importAliasNames }; + } + function getAMDImportExpressionForImport(node) { + if (isImportEqualsDeclaration(node) || isExportDeclaration(node) || !getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions)) { + return void 0; + } + const name2 = getLocalNameForExternalImport(factory2, node, currentSourceFile); + const expr = getHelperExpressionForImport(node, name2); + if (expr === name2) { + return void 0; + } + return factory2.createExpressionStatement(factory2.createAssignment(name2, expr)); + } + function transformAsynchronousModuleBody(node) { + startLexicalEnvironment(); + const statements = []; + const statementOffset = factory2.copyPrologue( + node.statements, + statements, + /*ensureUseStrict*/ + !compilerOptions.noImplicitUseStrict, + topLevelVisitor + ); + if (shouldEmitUnderscoreUnderscoreESModule()) { + append(statements, createUnderscoreUnderscoreESModule()); + } + if (length(currentModuleInfo.exportedNames)) { + append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero()))); + } + append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement)); + if (moduleKind === 2) { + addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } + addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset)); + addExportEqualsIfNeeded( + statements, + /*emitAsReturn*/ + true + ); + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + const body = factory2.createBlock( + statements, + /*multiLine*/ + true + ); + if (needUMDDynamicImportHelper) { + addEmitHelper(body, dynamicImportUMDHelper); + } + return body; + } + function addExportEqualsIfNeeded(statements, emitAsReturn) { + if (currentModuleInfo.exportEquals) { + const expressionResult = visitNode(currentModuleInfo.exportEquals.expression, visitor, isExpression); + if (expressionResult) { + if (emitAsReturn) { + const statement = factory2.createReturnStatement(expressionResult); + setTextRange(statement, currentModuleInfo.exportEquals); + setEmitFlags( + statement, + 768 | 3072 + /* NoComments */ + ); + statements.push(statement); + } else { + const statement = factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("module"), + "exports" + ), + expressionResult + ) + ); + setTextRange(statement, currentModuleInfo.exportEquals); + setEmitFlags( + statement, + 3072 + /* NoComments */ + ); + statements.push(statement); + } + } + } + } + function topLevelVisitor(node) { + switch (node.kind) { + case 272: + return visitTopLevelImportDeclaration(node); + case 271: + return visitTopLevelImportEqualsDeclaration(node); + case 278: + return visitTopLevelExportDeclaration(node); + case 277: + return visitTopLevelExportAssignment(node); + default: + return topLevelNestedVisitor(node); + } + } + function topLevelNestedVisitor(node) { + switch (node.kind) { + case 243: + return visitVariableStatement(node); + case 262: + return visitFunctionDeclaration(node); + case 263: + return visitClassDeclaration(node); + case 248: + return visitForStatement( + node, + /*isTopLevel*/ + true + ); + case 249: + return visitForInStatement(node); + case 250: + return visitForOfStatement(node); + case 246: + return visitDoStatement(node); + case 247: + return visitWhileStatement(node); + case 256: + return visitLabeledStatement(node); + case 254: + return visitWithStatement(node); + case 245: + return visitIfStatement(node); + case 255: + return visitSwitchStatement(node); + case 269: + return visitCaseBlock(node); + case 296: + return visitCaseClause(node); + case 297: + return visitDefaultClause(node); + case 258: + return visitTryStatement(node); + case 299: + return visitCatchClause(node); + case 241: + return visitBlock(node); + default: + return visitor(node); + } + } + function visitorWorker(node, valueIsDiscarded) { + if (!(node.transformFlags & (8388608 | 4096 | 268435456))) { + return node; + } + switch (node.kind) { + case 248: + return visitForStatement( + node, + /*isTopLevel*/ + false + ); + case 244: + return visitExpressionStatement(node); + case 217: + return visitParenthesizedExpression(node, valueIsDiscarded); + case 360: + return visitPartiallyEmittedExpression(node, valueIsDiscarded); + case 213: + if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) { + return visitImportCallExpression(node); + } + break; + case 226: + if (isDestructuringAssignment(node)) { + return visitDestructuringAssignment(node, valueIsDiscarded); + } + break; + case 224: + case 225: + return visitPreOrPostfixUnaryExpression(node, valueIsDiscarded); + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + false + ); + } + function discardedValueVisitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + true + ); + } + function destructuringNeedsFlattening(node) { + if (isObjectLiteralExpression(node)) { + for (const elem of node.properties) { + switch (elem.kind) { + case 303: + if (destructuringNeedsFlattening(elem.initializer)) { + return true; + } + break; + case 304: + if (destructuringNeedsFlattening(elem.name)) { + return true; + } + break; + case 305: + if (destructuringNeedsFlattening(elem.expression)) { + return true; + } + break; + case 174: + case 177: + case 178: + return false; + default: + Debug.assertNever(elem, "Unhandled object member kind"); + } + } + } else if (isArrayLiteralExpression(node)) { + for (const elem of node.elements) { + if (isSpreadElement(elem)) { + if (destructuringNeedsFlattening(elem.expression)) { + return true; + } + } else if (destructuringNeedsFlattening(elem)) { + return true; + } + } + } else if (isIdentifier(node)) { + return length(getExports(node)) > (isExportName(node) ? 1 : 0); + } + return false; + } + function visitDestructuringAssignment(node, valueIsDiscarded) { + if (destructuringNeedsFlattening(node.left)) { + return flattenDestructuringAssignment(node, visitor, context2, 0, !valueIsDiscarded, createAllExportExpressions); + } + return visitEachChild(node, visitor, context2); + } + function visitForStatement(node, isTopLevel) { + if (isTopLevel && node.initializer && isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7)) { + const exportStatements = appendExportsOfVariableDeclarationList( + /*statements*/ + void 0, + node.initializer, + /*isForInOrOfInitializer*/ + false + ); + if (exportStatements) { + const statements = []; + const varDeclList = visitNode(node.initializer, discardedValueVisitor, isVariableDeclarationList); + const varStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + varDeclList + ); + statements.push(varStatement); + addRange(statements, exportStatements); + const condition = visitNode(node.condition, visitor, isExpression); + const incrementor = visitNode(node.incrementor, discardedValueVisitor, isExpression); + const body = visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context2); + statements.push(factory2.updateForStatement( + node, + /*initializer*/ + void 0, + condition, + incrementor, + body + )); + return statements; + } + } + return factory2.updateForStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context2) + ); + } + function visitForInStatement(node) { + if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7)) { + const exportStatements = appendExportsOfVariableDeclarationList( + /*statements*/ + void 0, + node.initializer, + /*isForInOrOfInitializer*/ + true + ); + if (some2(exportStatements)) { + const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer); + const expression = visitNode(node.expression, visitor, isExpression); + const body = visitIterationBody(node.statement, topLevelNestedVisitor, context2); + const mergedBody = isBlock2(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock( + [...exportStatements, body], + /*multiLine*/ + true + ); + return factory2.updateForInStatement(node, initializer, expression, mergedBody); + } + } + return factory2.updateForInStatement( + node, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + } + function visitForOfStatement(node) { + if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 7)) { + const exportStatements = appendExportsOfVariableDeclarationList( + /*statements*/ + void 0, + node.initializer, + /*isForInOrOfInitializer*/ + true + ); + const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer); + const expression = visitNode(node.expression, visitor, isExpression); + let body = visitIterationBody(node.statement, topLevelNestedVisitor, context2); + if (some2(exportStatements)) { + body = isBlock2(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock( + [...exportStatements, body], + /*multiLine*/ + true + ); + } + return factory2.updateForOfStatement(node, node.awaitModifier, initializer, expression, body); + } + return factory2.updateForOfStatement( + node, + node.awaitModifier, + visitNode(node.initializer, discardedValueVisitor, isForInitializer), + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + } + function visitDoStatement(node) { + return factory2.updateDoStatement( + node, + visitIterationBody(node.statement, topLevelNestedVisitor, context2), + visitNode(node.expression, visitor, isExpression) + ); + } + function visitWhileStatement(node) { + return factory2.updateWhileStatement( + node, + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + } + function visitLabeledStatement(node) { + return factory2.updateLabeledStatement( + node, + node.label, + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) + ); + } + function visitWithStatement(node) { + return factory2.updateWithStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) + ); + } + function visitIfStatement(node) { + return factory2.updateIfStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)), + visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + ); + } + function visitSwitchStatement(node) { + return factory2.updateSwitchStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) + ); + } + function visitCaseBlock(node) { + return factory2.updateCaseBlock( + node, + visitNodes2(node.clauses, topLevelNestedVisitor, isCaseOrDefaultClause) + ); + } + function visitCaseClause(node) { + return factory2.updateCaseClause( + node, + visitNode(node.expression, visitor, isExpression), + visitNodes2(node.statements, topLevelNestedVisitor, isStatement) + ); + } + function visitDefaultClause(node) { + return visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitTryStatement(node) { + return visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitCatchClause(node) { + return factory2.updateCatchClause( + node, + node.variableDeclaration, + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock2)) + ); + } + function visitBlock(node) { + node = visitEachChild(node, topLevelNestedVisitor, context2); + return node; + } + function visitExpressionStatement(node) { + return factory2.updateExpressionStatement( + node, + visitNode(node.expression, discardedValueVisitor, isExpression) + ); + } + function visitParenthesizedExpression(node, valueIsDiscarded) { + return factory2.updateParenthesizedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); + } + function visitPartiallyEmittedExpression(node, valueIsDiscarded) { + return factory2.updatePartiallyEmittedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); + } + function visitPreOrPostfixUnaryExpression(node, valueIsDiscarded) { + if ((node.operator === 46 || node.operator === 47) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand) && !isDeclarationNameOfEnumOrNamespace(node.operand)) { + const exportedNames = getExports(node.operand); + if (exportedNames) { + let temp; + let expression = visitNode(node.operand, visitor, isExpression); + if (isPrefixUnaryExpression(node)) { + expression = factory2.updatePrefixUnaryExpression(node, expression); + } else { + expression = factory2.updatePostfixUnaryExpression(node, expression); + if (!valueIsDiscarded) { + temp = factory2.createTempVariable(hoistVariableDeclaration); + expression = factory2.createAssignment(temp, expression); + setTextRange(expression, node); + } + expression = factory2.createComma(expression, factory2.cloneNode(node.operand)); + setTextRange(expression, node); + } + for (const exportName of exportedNames) { + noSubstitution[getNodeId(expression)] = true; + expression = createExportExpression(exportName, expression); + setTextRange(expression, node); + } + if (temp) { + noSubstitution[getNodeId(expression)] = true; + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + return visitEachChild(node, visitor, context2); + } + function visitImportCallExpression(node) { + if (moduleKind === 0 && languageVersion >= 7) { + return visitEachChild(node, visitor, context2); + } + const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); + const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; + const containsLexicalThis = !!(node.transformFlags & 16384); + switch (compilerOptions.module) { + case 2: + return createImportCallExpressionAMD(argument, containsLexicalThis); + case 3: + return createImportCallExpressionUMD(argument ?? factory2.createVoidZero(), containsLexicalThis); + case 1: + default: + return createImportCallExpressionCommonJS(argument); + } + } + function createImportCallExpressionUMD(arg, containsLexicalThis) { + needUMDDynamicImportHelper = true; + if (isSimpleCopiableExpression(arg)) { + const argClone = isGeneratedIdentifier(arg) ? arg : isStringLiteral(arg) ? factory2.createStringLiteralFromNode(arg) : setEmitFlags( + setTextRange(factory2.cloneNode(arg), arg), + 3072 + /* NoComments */ + ); + return factory2.createConditionalExpression( + /*condition*/ + factory2.createIdentifier("__syncRequire"), + /*questionToken*/ + void 0, + /*whenTrue*/ + createImportCallExpressionCommonJS(arg), + /*colonToken*/ + void 0, + /*whenFalse*/ + createImportCallExpressionAMD(argClone, containsLexicalThis) + ); + } else { + const temp = factory2.createTempVariable(hoistVariableDeclaration); + return factory2.createComma( + factory2.createAssignment(temp, arg), + factory2.createConditionalExpression( + /*condition*/ + factory2.createIdentifier("__syncRequire"), + /*questionToken*/ + void 0, + /*whenTrue*/ + createImportCallExpressionCommonJS( + temp, + /*isInlineable*/ + true + ), + /*colonToken*/ + void 0, + /*whenFalse*/ + createImportCallExpressionAMD(temp, containsLexicalThis) + ) + ); + } + } + function createImportCallExpressionAMD(arg, containsLexicalThis) { + const resolve3 = factory2.createUniqueName("resolve"); + const reject2 = factory2.createUniqueName("reject"); + const parameters = [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + resolve3 + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + reject2 + ) + ]; + const body = factory2.createBlock([ + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createIdentifier("require"), + /*typeArguments*/ + void 0, + [factory2.createArrayLiteralExpression([arg || factory2.createOmittedExpression()]), resolve3, reject2] + ) + ) + ]); + let func; + if (languageVersion >= 2) { + func = factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + body + ); + } else { + func = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + if (containsLexicalThis) { + setEmitFlags( + func, + 16 + /* CapturesThis */ + ); + } + } + const promise = factory2.createNewExpression( + factory2.createIdentifier("Promise"), + /*typeArguments*/ + void 0, + [func] + ); + if (getESModuleInterop(compilerOptions)) { + return factory2.createCallExpression( + factory2.createPropertyAccessExpression(promise, factory2.createIdentifier("then")), + /*typeArguments*/ + void 0, + [emitHelpers().createImportStarCallbackHelper()] + ); + } + return promise; + } + function createImportCallExpressionCommonJS(arg, isInlineable) { + const needSyncEval = arg && !isSimpleInlineableExpression(arg) && !isInlineable; + const promiseResolveCall = factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Promise"), "resolve"), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + needSyncEval ? languageVersion >= 2 ? [ + factory2.createTemplateExpression(factory2.createTemplateHead(""), [ + factory2.createTemplateSpan(arg, factory2.createTemplateTail("")) + ]) + ] : [ + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createStringLiteral(""), "concat"), + /*typeArguments*/ + void 0, + [arg] + ) + ] : [] + ); + let requireCall = factory2.createCallExpression( + factory2.createIdentifier("require"), + /*typeArguments*/ + void 0, + needSyncEval ? [factory2.createIdentifier("s")] : arg ? [arg] : [] + ); + if (getESModuleInterop(compilerOptions)) { + requireCall = emitHelpers().createImportStarHelper(requireCall); + } + const parameters = needSyncEval ? [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + "s" + ) + ] : []; + let func; + if (languageVersion >= 2) { + func = factory2.createArrowFunction( + /*modifiers*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + parameters, + /*type*/ + void 0, + /*equalsGreaterThanToken*/ + void 0, + requireCall + ); + } else { + func = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + parameters, + /*type*/ + void 0, + factory2.createBlock([factory2.createReturnStatement(requireCall)]) + ); + } + const downleveledImport = factory2.createCallExpression( + factory2.createPropertyAccessExpression(promiseResolveCall, "then"), + /*typeArguments*/ + void 0, + [func] + ); + return downleveledImport; + } + function getHelperExpressionForExport(node, innerExpr) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2) { + return innerExpr; + } + if (getExportNeedsImportStarHelper(node)) { + return emitHelpers().createImportStarHelper(innerExpr); + } + return innerExpr; + } + function getHelperExpressionForImport(node, innerExpr) { + if (!getESModuleInterop(compilerOptions) || getInternalEmitFlags(node) & 2) { + return innerExpr; + } + if (getImportNeedsImportStarHelper(node)) { + return emitHelpers().createImportStarHelper(innerExpr); + } + if (getImportNeedsImportDefaultHelper(node)) { + return emitHelpers().createImportDefaultHelper(innerExpr); + } + return innerExpr; + } + function visitTopLevelImportDeclaration(node) { + let statements; + const namespaceDeclaration = getNamespaceDeclarationNode(node); + if (moduleKind !== 2) { + if (!node.importClause) { + return setOriginalNode(setTextRange(factory2.createExpressionStatement(createRequireCall2(node)), node), node); + } else { + const variables = []; + if (namespaceDeclaration && !isDefaultImport(node)) { + variables.push( + factory2.createVariableDeclaration( + factory2.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + getHelperExpressionForImport(node, createRequireCall2(node)) + ) + ); + } else { + variables.push( + factory2.createVariableDeclaration( + factory2.getGeneratedNameForNode(node), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + getHelperExpressionForImport(node, createRequireCall2(node)) + ) + ); + if (namespaceDeclaration && isDefaultImport(node)) { + variables.push( + factory2.createVariableDeclaration( + factory2.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.getGeneratedNameForNode(node) + ) + ); + } + } + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + variables, + languageVersion >= 2 ? 2 : 0 + /* None */ + ) + ), + /*location*/ + node + ), + /*original*/ + node + ) + ); + } + } else if (namespaceDeclaration && isDefaultImport(node)) { + statements = append( + statements, + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + setOriginalNode( + setTextRange( + factory2.createVariableDeclaration( + factory2.cloneNode(namespaceDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.getGeneratedNameForNode(node) + ), + /*location*/ + node + ), + /*original*/ + node + ) + ], + languageVersion >= 2 ? 2 : 0 + /* None */ + ) + ) + ); + } + statements = appendExportsOfImportDeclaration(statements, node); + return singleOrMany(statements); + } + function createRequireCall2(importNode) { + const moduleName3 = getExternalModuleNameLiteral(factory2, importNode, currentSourceFile, host, resolver, compilerOptions); + const args = []; + if (moduleName3) { + args.push(moduleName3); + } + return factory2.createCallExpression( + factory2.createIdentifier("require"), + /*typeArguments*/ + void 0, + args + ); + } + function visitTopLevelImportEqualsDeclaration(node) { + Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + let statements; + if (moduleKind !== 2) { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + createExportExpression( + node.name, + createRequireCall2(node) + ) + ), + node + ), + node + ) + ); + } else { + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + factory2.cloneNode(node.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall2(node) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* None */ + ) + ), + node + ), + node + ) + ); + } + } else { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + createExportExpression(factory2.getExportName(node), factory2.getLocalName(node)) + ), + node + ), + node + ) + ); + } + } + statements = appendExportsOfImportEqualsDeclaration(statements, node); + return singleOrMany(statements); + } + function visitTopLevelExportDeclaration(node) { + if (!node.moduleSpecifier) { + return void 0; + } + const generatedName = factory2.getGeneratedNameForNode(node); + if (node.exportClause && isNamedExports(node.exportClause)) { + const statements = []; + if (moduleKind !== 2) { + statements.push( + setOriginalNode( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + generatedName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall2(node) + ) + ]) + ), + /*location*/ + node + ), + /* original */ + node + ) + ); + } + for (const specifier of node.exportClause.elements) { + if (languageVersion === 0) { + statements.push( + setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + emitHelpers().createCreateBindingHelper(generatedName, factory2.createStringLiteralFromNode(specifier.propertyName || specifier.name), specifier.propertyName ? factory2.createStringLiteralFromNode(specifier.name) : void 0) + ), + specifier + ), + specifier + ) + ); + } else { + const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2) && idText(specifier.propertyName || specifier.name) === "default"; + const exportedValue = factory2.createPropertyAccessExpression( + exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName, + specifier.propertyName || specifier.name + ); + statements.push( + setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + createExportExpression( + factory2.getExportName(specifier), + exportedValue, + /*location*/ + void 0, + /*liveBinding*/ + true + ) + ), + specifier + ), + specifier + ) + ); + } + } + return singleOrMany(statements); + } else if (node.exportClause) { + const statements = []; + statements.push( + setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + createExportExpression( + factory2.cloneNode(node.exportClause.name), + getHelperExpressionForExport( + node, + moduleKind !== 2 ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name)) + ) + ) + ), + node + ), + node + ) + ); + return singleOrMany(statements); + } else { + return setOriginalNode( + setTextRange( + factory2.createExpressionStatement( + emitHelpers().createExportStarHelper(moduleKind !== 2 ? createRequireCall2(node) : generatedName) + ), + node + ), + node + ); + } + } + function visitTopLevelExportAssignment(node) { + if (node.isExportEquals) { + return void 0; + } + return createExportStatement( + factory2.createIdentifier("default"), + visitNode(node.expression, visitor, isExpression), + /*location*/ + node, + /*allowComments*/ + true + ); + } + function visitFunctionDeclaration(node) { + let statements; + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createFunctionDeclaration( + visitNodes2(node.modifiers, modifierVisitor, isModifier), + node.asteriskToken, + factory2.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitEachChild(node.body, visitor, context2) + ), + /*location*/ + node + ), + /*original*/ + node + ) + ); + } else { + statements = append(statements, visitEachChild(node, visitor, context2)); + } + statements = appendExportsOfHoistedDeclaration(statements, node); + return singleOrMany(statements); + } + function visitClassDeclaration(node) { + let statements; + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createClassDeclaration( + visitNodes2(node.modifiers, modifierVisitor, isModifierLike), + factory2.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) + ), + node + ), + node + ) + ); + } else { + statements = append(statements, visitEachChild(node, visitor, context2)); + } + statements = appendExportsOfHoistedDeclaration(statements, node); + return singleOrMany(statements); + } + function visitVariableStatement(node) { + let statements; + let variables; + let expressions; + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + let modifiers; + let removeCommentsOnExpressions = false; + for (const variable of node.declarationList.declarations) { + if (isIdentifier(variable.name) && isLocalName(variable.name)) { + if (!modifiers) { + modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier); + } + if (variable.initializer) { + const updatedVariable = factory2.updateVariableDeclaration( + variable, + variable.name, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createExportExpression( + variable.name, + visitNode(variable.initializer, visitor, isExpression) + ) + ); + variables = append(variables, updatedVariable); + } else { + variables = append(variables, variable); + } + } else if (variable.initializer) { + if (!isBindingPattern(variable.name) && (isArrowFunction(variable.initializer) || isFunctionExpression(variable.initializer) || isClassExpression(variable.initializer))) { + const expression = factory2.createAssignment( + setTextRange( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("exports"), + variable.name + ), + /*location*/ + variable.name + ), + factory2.createIdentifier(getTextOfIdentifierOrLiteral(variable.name)) + ); + const updatedVariable = factory2.createVariableDeclaration( + variable.name, + variable.exclamationToken, + variable.type, + visitNode(variable.initializer, visitor, isExpression) + ); + variables = append(variables, updatedVariable); + expressions = append(expressions, expression); + removeCommentsOnExpressions = true; + } else { + expressions = append(expressions, transformInitializedVariable(variable)); + } + } + } + if (variables) { + statements = append(statements, factory2.updateVariableStatement(node, modifiers, factory2.updateVariableDeclarationList(node.declarationList, variables))); + } + if (expressions) { + const statement = setOriginalNode(setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(expressions)), node), node); + if (removeCommentsOnExpressions) { + removeAllComments(statement); + } + statements = append(statements, statement); + } + } else { + statements = append(statements, visitEachChild(node, visitor, context2)); + } + statements = appendExportsOfVariableStatement(statements, node); + return singleOrMany(statements); + } + function createAllExportExpressions(name2, value2, location2) { + const exportedNames = getExports(name2); + if (exportedNames) { + let expression = isExportName(name2) ? value2 : factory2.createAssignment(name2, value2); + for (const exportName of exportedNames) { + setEmitFlags( + expression, + 8 + /* NoSubstitution */ + ); + expression = createExportExpression( + exportName, + expression, + /*location*/ + location2 + ); + } + return expression; + } + return factory2.createAssignment(name2, value2); + } + function transformInitializedVariable(node) { + if (isBindingPattern(node.name)) { + return flattenDestructuringAssignment( + visitNode(node, visitor, isInitializedVariable), + visitor, + context2, + 0, + /*needsValue*/ + false, + createAllExportExpressions + ); + } else { + return factory2.createAssignment( + setTextRange( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("exports"), + node.name + ), + /*location*/ + node.name + ), + node.initializer ? visitNode(node.initializer, visitor, isExpression) : factory2.createVoidZero() + ); + } + } + function appendExportsOfImportDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + const importClause = decl.importClause; + if (!importClause) { + return statements; + } + const seen = new IdentifierNameMap(); + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, seen, importClause); + } + const namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 274: + statements = appendExportsOfDeclaration(statements, seen, namedBindings); + break; + case 275: + for (const importBinding of namedBindings.elements) { + statements = appendExportsOfDeclaration( + statements, + seen, + importBinding, + /*liveBinding*/ + true + ); + } + break; + } + } + return statements; + } + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); + } + function appendExportsOfVariableStatement(statements, node) { + return appendExportsOfVariableDeclarationList( + statements, + node.declarationList, + /*isForInOrOfInitializer*/ + false + ); + } + function appendExportsOfVariableDeclarationList(statements, node, isForInOrOfInitializer) { + if (currentModuleInfo.exportEquals) { + return statements; + } + for (const decl of node.declarations) { + statements = appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer); + } + return statements; + } + function appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer) { + if (currentModuleInfo.exportEquals) { + return statements; + } + if (isBindingPattern(decl.name)) { + for (const element of decl.name.elements) { + if (!isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element, isForInOrOfInitializer); + } + } + } else if (!isGeneratedIdentifier(decl.name) && (!isVariableDeclaration(decl) || decl.initializer || isForInOrOfInitializer)) { + statements = appendExportsOfDeclaration(statements, new IdentifierNameMap(), decl); + } + return statements; + } + function appendExportsOfHoistedDeclaration(statements, decl) { + if (currentModuleInfo.exportEquals) { + return statements; + } + const seen = new IdentifierNameMap(); + if (hasSyntacticModifier( + decl, + 32 + /* Export */ + )) { + const exportName = hasSyntacticModifier( + decl, + 2048 + /* Default */ + ) ? factory2.createIdentifier("default") : factory2.getDeclarationName(decl); + statements = appendExportStatement( + statements, + seen, + exportName, + factory2.getLocalName(decl), + /*location*/ + decl + ); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, seen, decl); + } + return statements; + } + function appendExportsOfDeclaration(statements, seen, decl, liveBinding) { + const name2 = factory2.getDeclarationName(decl); + const exportSpecifiers = currentModuleInfo.exportSpecifiers.get(name2); + if (exportSpecifiers) { + for (const exportSpecifier of exportSpecifiers) { + statements = appendExportStatement( + statements, + seen, + exportSpecifier.name, + name2, + /*location*/ + exportSpecifier.name, + /*allowComments*/ + void 0, + liveBinding + ); + } + } + return statements; + } + function appendExportStatement(statements, seen, exportName, expression, location2, allowComments, liveBinding) { + if (!seen.has(exportName)) { + seen.set(exportName, true); + statements = append(statements, createExportStatement(exportName, expression, location2, allowComments, liveBinding)); + } + return statements; + } + function createUnderscoreUnderscoreESModule() { + let statement; + if (languageVersion === 0) { + statement = factory2.createExpressionStatement( + createExportExpression( + factory2.createIdentifier("__esModule"), + factory2.createTrue() + ) + ); + } else { + statement = factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("Object"), "defineProperty"), + /*typeArguments*/ + void 0, + [ + factory2.createIdentifier("exports"), + factory2.createStringLiteral("__esModule"), + factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("value", factory2.createTrue()) + ]) + ] + ) + ); + } + setEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + return statement; + } + function createExportStatement(name2, value2, location2, allowComments, liveBinding) { + const statement = setTextRange(factory2.createExpressionStatement(createExportExpression( + name2, + value2, + /*location*/ + void 0, + liveBinding + )), location2); + startOnNewLine(statement); + if (!allowComments) { + setEmitFlags( + statement, + 3072 + /* NoComments */ + ); + } + return statement; + } + function createExportExpression(name2, value2, location2, liveBinding) { + return setTextRange( + liveBinding && languageVersion !== 0 ? factory2.createCallExpression( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("Object"), + "defineProperty" + ), + /*typeArguments*/ + void 0, + [ + factory2.createIdentifier("exports"), + factory2.createStringLiteralFromNode(name2), + factory2.createObjectLiteralExpression([ + factory2.createPropertyAssignment("enumerable", factory2.createTrue()), + factory2.createPropertyAssignment( + "get", + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory2.createBlock([factory2.createReturnStatement(value2)]) + ) + ) + ]) + ] + ) : factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("exports"), + factory2.cloneNode(name2) + ), + value2 + ), + location2 + ); + } + function modifierVisitor(node) { + switch (node.kind) { + case 95: + case 90: + return void 0; + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 312) { + currentSourceFile = node; + currentModuleInfo = moduleInfoMap[getOriginalNodeId(currentSourceFile)]; + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = void 0; + currentModuleInfo = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (node.id && noSubstitution[node.id]) { + return node; + } + if (hint === 1) { + return substituteExpression(node); + } else if (isShorthandPropertyAssignment(node)) { + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + const name2 = node.name; + const exportedOrImportedName = substituteExpressionIdentifier(name2); + if (exportedOrImportedName !== name2) { + if (node.objectAssignmentInitializer) { + const initializer = factory2.createAssignment(exportedOrImportedName, node.objectAssignmentInitializer); + return setTextRange(factory2.createPropertyAssignment(name2, initializer), node); + } + return setTextRange(factory2.createPropertyAssignment(name2, exportedOrImportedName), node); + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + case 213: + return substituteCallExpression(node); + case 215: + return substituteTaggedTemplateExpression(node); + case 226: + return substituteBinaryExpression(node); + } + return node; + } + function substituteCallExpression(node) { + if (isIdentifier(node.expression)) { + const expression = substituteExpressionIdentifier(node.expression); + noSubstitution[getNodeId(expression)] = true; + if (!isIdentifier(expression) && !(getEmitFlags(node.expression) & 8192)) { + return addInternalEmitFlags( + factory2.updateCallExpression( + node, + expression, + /*typeArguments*/ + void 0, + node.arguments + ), + 16 + /* IndirectCall */ + ); + } + } + return node; + } + function substituteTaggedTemplateExpression(node) { + if (isIdentifier(node.tag)) { + const tag = substituteExpressionIdentifier(node.tag); + noSubstitution[getNodeId(tag)] = true; + if (!isIdentifier(tag) && !(getEmitFlags(node.tag) & 8192)) { + return addInternalEmitFlags( + factory2.updateTaggedTemplateExpression( + node, + tag, + /*typeArguments*/ + void 0, + node.template + ), + 16 + /* IndirectCall */ + ); + } + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2, _b; + if (getEmitFlags(node) & 8192) { + const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); + } + return node; + } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64)) && !isLocalName(node)) { + const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node)); + if (exportContainer && exportContainer.kind === 312) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("exports"), + factory2.cloneNode(node) + ), + /*location*/ + node + ); + } + const importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (isImportClause(importDeclaration)) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(importDeclaration.parent), + factory2.createIdentifier("default") + ), + /*location*/ + node + ); + } else if (isImportSpecifier(importDeclaration)) { + const name2 = importDeclaration.propertyName || importDeclaration.name; + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.parent) || importDeclaration), + factory2.cloneNode(name2) + ), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteBinaryExpression(node) { + if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && (!isGeneratedIdentifier(node.left) || isFileLevelReservedGeneratedIdentifier(node.left)) && !isLocalName(node.left)) { + const exportedNames = getExports(node.left); + if (exportedNames) { + let expression = node; + for (const exportName of exportedNames) { + noSubstitution[getNodeId(expression)] = true; + expression = createExportExpression( + exportName, + expression, + /*location*/ + node + ); + } + return expression; + } + } + return node; + } + function getExports(name2) { + if (!isGeneratedIdentifier(name2)) { + const importDeclaration = resolver.getReferencedImportDeclaration(name2); + if (importDeclaration) { + return currentModuleInfo == null ? void 0 : currentModuleInfo.exportedBindings[getOriginalNodeId(importDeclaration)]; + } + const bindingsSet = /* @__PURE__ */ new Set(); + const declarations = resolver.getReferencedValueDeclarations(name2); + if (declarations) { + for (const declaration of declarations) { + const bindings6 = currentModuleInfo == null ? void 0 : currentModuleInfo.exportedBindings[getOriginalNodeId(declaration)]; + if (bindings6) { + for (const binding3 of bindings6) { + bindingsSet.add(binding3); + } + } + } + if (bindingsSet.size) { + return arrayFrom(bindingsSet); + } + } + } else if (isFileLevelReservedGeneratedIdentifier(name2)) { + const exportSpecifiers = currentModuleInfo == null ? void 0 : currentModuleInfo.exportSpecifiers.get(name2); + if (exportSpecifiers) { + const exportedNames = []; + for (const exportSpecifier of exportSpecifiers) { + exportedNames.push(exportSpecifier.name); + } + return exportedNames; + } + } + } + } + var dynamicImportUMDHelper; + var init_module2 = __esm2({ + "src/compiler/transformers/module/module.ts"() { + "use strict"; + init_ts2(); + dynamicImportUMDHelper = { + name: "typescript:dynamicimport-sync-require", + scoped: true, + text: ` + var __syncRequire = typeof module === "object" && typeof module.exports === "object";` + }; + } + }); + function transformSystemModule(context2) { + const { + factory: factory2, + startLexicalEnvironment, + endLexicalEnvironment, + hoistVariableDeclaration + } = context2; + const compilerOptions = context2.getCompilerOptions(); + const resolver = context2.getEmitResolver(); + const host = context2.getEmitHost(); + const previousOnSubstituteNode = context2.onSubstituteNode; + const previousOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 80 + /* Identifier */ + ); + context2.enableSubstitution( + 304 + /* ShorthandPropertyAssignment */ + ); + context2.enableSubstitution( + 226 + /* BinaryExpression */ + ); + context2.enableSubstitution( + 236 + /* MetaProperty */ + ); + context2.enableEmitNotification( + 312 + /* SourceFile */ + ); + const moduleInfoMap = []; + const exportFunctionsMap = []; + const noSubstitutionMap = []; + const contextObjectMap = []; + let currentSourceFile; + let moduleInfo; + let exportFunction; + let contextObject; + let hoistedStatements; + let enclosingBlockScopedContainer; + let noSubstitution; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile || !(isEffectiveExternalModule(node, compilerOptions) || node.transformFlags & 8388608)) { + return node; + } + const id = getOriginalNodeId(node); + currentSourceFile = node; + enclosingBlockScopedContainer = node; + moduleInfo = moduleInfoMap[id] = collectExternalModuleInfo(context2, node); + exportFunction = factory2.createUniqueName("exports"); + exportFunctionsMap[id] = exportFunction; + contextObject = contextObjectMap[id] = factory2.createUniqueName("context"); + const dependencyGroups = collectDependencyGroups(moduleInfo.externalImports); + const moduleBodyBlock = createSystemModuleBody(node, dependencyGroups); + const moduleBodyFunction = factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [ + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + exportFunction + ), + factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + contextObject + ) + ], + /*type*/ + void 0, + moduleBodyBlock + ); + const moduleName3 = tryGetModuleNameFromFile(factory2, node, host, compilerOptions); + const dependencies = factory2.createArrayLiteralExpression(map4(dependencyGroups, (dependencyGroup) => dependencyGroup.name)); + const updated = setEmitFlags( + factory2.updateSourceFile( + node, + setTextRange( + factory2.createNodeArray([ + factory2.createExpressionStatement( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(factory2.createIdentifier("System"), "register"), + /*typeArguments*/ + void 0, + moduleName3 ? [moduleName3, dependencies, moduleBodyFunction] : [dependencies, moduleBodyFunction] + ) + ) + ]), + node.statements + ) + ), + 2048 + /* NoTrailingComments */ + ); + if (!outFile(compilerOptions)) { + moveEmitHelpers(updated, moduleBodyBlock, (helper) => !helper.scoped); + } + if (noSubstitution) { + noSubstitutionMap[id] = noSubstitution; + noSubstitution = void 0; + } + currentSourceFile = void 0; + moduleInfo = void 0; + exportFunction = void 0; + contextObject = void 0; + hoistedStatements = void 0; + enclosingBlockScopedContainer = void 0; + return updated; + } + function collectDependencyGroups(externalImports) { + const groupIndices = /* @__PURE__ */ new Map(); + const dependencyGroups = []; + for (const externalImport of externalImports) { + const externalModuleName = getExternalModuleNameLiteral(factory2, externalImport, currentSourceFile, host, resolver, compilerOptions); + if (externalModuleName) { + const text = externalModuleName.text; + const groupIndex = groupIndices.get(text); + if (groupIndex !== void 0) { + dependencyGroups[groupIndex].externalImports.push(externalImport); + } else { + groupIndices.set(text, dependencyGroups.length); + dependencyGroups.push({ + name: externalModuleName, + externalImports: [externalImport] + }); + } + } + } + return dependencyGroups; + } + function createSystemModuleBody(node, dependencyGroups) { + const statements = []; + startLexicalEnvironment(); + const ensureUseStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") || !compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile); + const statementOffset = factory2.copyPrologue(node.statements, statements, ensureUseStrict, topLevelVisitor); + statements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + "__moduleName", + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createLogicalAnd( + contextObject, + factory2.createPropertyAccessExpression(contextObject, "id") + ) + ) + ]) + ) + ); + visitNode(moduleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement); + const executeStatements = visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset); + addRange(statements, hoistedStatements); + insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment()); + const exportStarFunction = addExportStarIfNeeded(statements); + const modifiers = node.transformFlags & 2097152 ? factory2.createModifiersFromModifierFlags( + 1024 + /* Async */ + ) : void 0; + const moduleObject = factory2.createObjectLiteralExpression( + [ + factory2.createPropertyAssignment("setters", createSettersArray(exportStarFunction, dependencyGroups)), + factory2.createPropertyAssignment( + "execute", + factory2.createFunctionExpression( + modifiers, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + /*parameters*/ + [], + /*type*/ + void 0, + factory2.createBlock( + executeStatements, + /*multiLine*/ + true + ) + ) + ) + ], + /*multiLine*/ + true + ); + statements.push(factory2.createReturnStatement(moduleObject)); + return factory2.createBlock( + statements, + /*multiLine*/ + true + ); + } + function addExportStarIfNeeded(statements) { + if (!moduleInfo.hasExportStarsToExportValues) { + return; + } + if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) { + let hasExportDeclarationWithExportClause = false; + for (const externalImport of moduleInfo.externalImports) { + if (externalImport.kind === 278 && externalImport.exportClause) { + hasExportDeclarationWithExportClause = true; + break; + } + } + if (!hasExportDeclarationWithExportClause) { + const exportStarFunction2 = createExportStarFunction( + /*localNames*/ + void 0 + ); + statements.push(exportStarFunction2); + return exportStarFunction2.name; + } + } + const exportedNames = []; + if (moduleInfo.exportedNames) { + for (const exportedLocalName of moduleInfo.exportedNames) { + if (exportedLocalName.escapedText === "default") { + continue; + } + exportedNames.push( + factory2.createPropertyAssignment( + factory2.createStringLiteralFromNode(exportedLocalName), + factory2.createTrue() + ) + ); + } + } + const exportedNamesStorageRef = factory2.createUniqueName("exportedNames"); + statements.push( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + exportedNamesStorageRef, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createObjectLiteralExpression( + exportedNames, + /*multiLine*/ + true + ) + ) + ]) + ) + ); + const exportStarFunction = createExportStarFunction(exportedNamesStorageRef); + statements.push(exportStarFunction); + return exportStarFunction.name; + } + function createExportStarFunction(localNames) { + const exportStarFunction = factory2.createUniqueName("exportStar"); + const m7 = factory2.createIdentifier("m"); + const n7 = factory2.createIdentifier("n"); + const exports29 = factory2.createIdentifier("exports"); + let condition = factory2.createStrictInequality(n7, factory2.createStringLiteral("default")); + if (localNames) { + condition = factory2.createLogicalAnd( + condition, + factory2.createLogicalNot( + factory2.createCallExpression( + factory2.createPropertyAccessExpression(localNames, "hasOwnProperty"), + /*typeArguments*/ + void 0, + [n7] + ) + ) + ); + } + return factory2.createFunctionDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + exportStarFunction, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + m7 + )], + /*type*/ + void 0, + factory2.createBlock( + [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration( + exports29, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createObjectLiteralExpression([]) + ) + ]) + ), + factory2.createForInStatement( + factory2.createVariableDeclarationList([ + factory2.createVariableDeclaration(n7) + ]), + m7, + factory2.createBlock([ + setEmitFlags( + factory2.createIfStatement( + condition, + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createElementAccessExpression(exports29, n7), + factory2.createElementAccessExpression(m7, n7) + ) + ) + ), + 1 + /* SingleLine */ + ) + ]) + ), + factory2.createExpressionStatement( + factory2.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [exports29] + ) + ) + ], + /*multiLine*/ + true + ) + ); + } + function createSettersArray(exportStarFunction, dependencyGroups) { + const setters = []; + for (const group22 of dependencyGroups) { + const localName = forEach4(group22.externalImports, (i7) => getLocalNameForExternalImport(factory2, i7, currentSourceFile)); + const parameterName = localName ? factory2.getGeneratedNameForNode(localName) : factory2.createUniqueName(""); + const statements = []; + for (const entry of group22.externalImports) { + const importVariableName = getLocalNameForExternalImport(factory2, entry, currentSourceFile); + switch (entry.kind) { + case 272: + if (!entry.importClause) { + break; + } + case 271: + Debug.assert(importVariableName !== void 0); + statements.push( + factory2.createExpressionStatement( + factory2.createAssignment(importVariableName, parameterName) + ) + ); + if (hasSyntacticModifier( + entry, + 32 + /* Export */ + )) { + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [ + factory2.createStringLiteral(idText(importVariableName)), + parameterName + ] + ) + ) + ); + } + break; + case 278: + Debug.assert(importVariableName !== void 0); + if (entry.exportClause) { + if (isNamedExports(entry.exportClause)) { + const properties = []; + for (const e10 of entry.exportClause.elements) { + properties.push( + factory2.createPropertyAssignment( + factory2.createStringLiteral(idText(e10.name)), + factory2.createElementAccessExpression( + parameterName, + factory2.createStringLiteral(idText(e10.propertyName || e10.name)) + ) + ) + ); + } + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [factory2.createObjectLiteralExpression( + properties, + /*multiLine*/ + true + )] + ) + ) + ); + } else { + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [ + factory2.createStringLiteral(idText(entry.exportClause.name)), + parameterName + ] + ) + ) + ); + } + } else { + statements.push( + factory2.createExpressionStatement( + factory2.createCallExpression( + exportStarFunction, + /*typeArguments*/ + void 0, + [parameterName] + ) + ) + ); + } + break; + } + } + setters.push( + factory2.createFunctionExpression( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + /*name*/ + void 0, + /*typeParameters*/ + void 0, + [factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + parameterName + )], + /*type*/ + void 0, + factory2.createBlock( + statements, + /*multiLine*/ + true + ) + ) + ); + } + return factory2.createArrayLiteralExpression( + setters, + /*multiLine*/ + true + ); + } + function topLevelVisitor(node) { + switch (node.kind) { + case 272: + return visitImportDeclaration(node); + case 271: + return visitImportEqualsDeclaration(node); + case 278: + return visitExportDeclaration(node); + case 277: + return visitExportAssignment(node); + default: + return topLevelNestedVisitor(node); + } + } + function visitImportDeclaration(node) { + let statements; + if (node.importClause) { + hoistVariableDeclaration(getLocalNameForExternalImport(factory2, node, currentSourceFile)); + } + return singleOrMany(appendExportsOfImportDeclaration(statements, node)); + } + function visitExportDeclaration(node) { + Debug.assertIsDefined(node); + return void 0; + } + function visitImportEqualsDeclaration(node) { + Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + let statements; + hoistVariableDeclaration(getLocalNameForExternalImport(factory2, node, currentSourceFile)); + return singleOrMany(appendExportsOfImportEqualsDeclaration(statements, node)); + } + function visitExportAssignment(node) { + if (node.isExportEquals) { + return void 0; + } + const expression = visitNode(node.expression, visitor, isExpression); + return createExportStatement( + factory2.createIdentifier("default"), + expression, + /*allowComments*/ + true + ); + } + function visitFunctionDeclaration(node) { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + hoistedStatements = append( + hoistedStatements, + factory2.updateFunctionDeclaration( + node, + visitNodes2(node.modifiers, modifierVisitor, isModifierLike), + node.asteriskToken, + factory2.getDeclarationName( + node, + /*allowComments*/ + true, + /*allowSourceMaps*/ + true + ), + /*typeParameters*/ + void 0, + visitNodes2(node.parameters, visitor, isParameter), + /*type*/ + void 0, + visitNode(node.body, visitor, isBlock2) + ) + ); + } else { + hoistedStatements = append(hoistedStatements, visitEachChild(node, visitor, context2)); + } + hoistedStatements = appendExportsOfHoistedDeclaration(hoistedStatements, node); + return void 0; + } + function visitClassDeclaration(node) { + let statements; + const name2 = factory2.getLocalName(node); + hoistVariableDeclaration(name2); + statements = append( + statements, + setTextRange( + factory2.createExpressionStatement( + factory2.createAssignment( + name2, + setTextRange( + factory2.createClassExpression( + visitNodes2(node.modifiers, modifierVisitor, isModifierLike), + node.name, + /*typeParameters*/ + void 0, + visitNodes2(node.heritageClauses, visitor, isHeritageClause), + visitNodes2(node.members, visitor, isClassElement) + ), + node + ) + ) + ), + node + ) + ); + statements = appendExportsOfHoistedDeclaration(statements, node); + return singleOrMany(statements); + } + function visitVariableStatement(node) { + if (!shouldHoistVariableDeclarationList(node.declarationList)) { + return visitNode(node, visitor, isStatement); + } + let statements; + if (isVarUsing(node.declarationList) || isVarAwaitUsing(node.declarationList)) { + const modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifierLike); + const declarations = []; + for (const variable of node.declarationList.declarations) { + declarations.push(factory2.updateVariableDeclaration( + variable, + factory2.getGeneratedNameForNode(variable.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + transformInitializedVariable( + variable, + /*isExportedDeclaration*/ + false + ) + )); + } + const declarationList = factory2.updateVariableDeclarationList( + node.declarationList, + declarations + ); + statements = append(statements, factory2.updateVariableStatement(node, modifiers, declarationList)); + } else { + let expressions; + const isExportedDeclaration = hasSyntacticModifier( + node, + 32 + /* Export */ + ); + for (const variable of node.declarationList.declarations) { + if (variable.initializer) { + expressions = append(expressions, transformInitializedVariable(variable, isExportedDeclaration)); + } else { + hoistBindingElement(variable); + } + } + if (expressions) { + statements = append(statements, setTextRange(factory2.createExpressionStatement(factory2.inlineExpressions(expressions)), node)); + } + } + statements = appendExportsOfVariableStatement( + statements, + node, + /*exportSelf*/ + false + ); + return singleOrMany(statements); + } + function hoistBindingElement(node) { + if (isBindingPattern(node.name)) { + for (const element of node.name.elements) { + if (!isOmittedExpression(element)) { + hoistBindingElement(element); + } + } + } else { + hoistVariableDeclaration(factory2.cloneNode(node.name)); + } + } + function shouldHoistVariableDeclarationList(node) { + return (getEmitFlags(node) & 4194304) === 0 && (enclosingBlockScopedContainer.kind === 312 || (getOriginalNode(node).flags & 7) === 0); + } + function transformInitializedVariable(node, isExportedDeclaration) { + const createAssignment = isExportedDeclaration ? createExportedVariableAssignment : createNonExportedVariableAssignment; + return isBindingPattern(node.name) ? flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + /*needsValue*/ + false, + createAssignment + ) : node.initializer ? createAssignment(node.name, visitNode(node.initializer, visitor, isExpression)) : node.name; + } + function createExportedVariableAssignment(name2, value2, location2) { + return createVariableAssignment( + name2, + value2, + location2, + /*isExportedDeclaration*/ + true + ); + } + function createNonExportedVariableAssignment(name2, value2, location2) { + return createVariableAssignment( + name2, + value2, + location2, + /*isExportedDeclaration*/ + false + ); + } + function createVariableAssignment(name2, value2, location2, isExportedDeclaration) { + hoistVariableDeclaration(factory2.cloneNode(name2)); + return isExportedDeclaration ? createExportExpression(name2, preventSubstitution(setTextRange(factory2.createAssignment(name2, value2), location2))) : preventSubstitution(setTextRange(factory2.createAssignment(name2, value2), location2)); + } + function appendExportsOfImportDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + const importClause = decl.importClause; + if (!importClause) { + return statements; + } + if (importClause.name) { + statements = appendExportsOfDeclaration(statements, importClause); + } + const namedBindings = importClause.namedBindings; + if (namedBindings) { + switch (namedBindings.kind) { + case 274: + statements = appendExportsOfDeclaration(statements, namedBindings); + break; + case 275: + for (const importBinding of namedBindings.elements) { + statements = appendExportsOfDeclaration(statements, importBinding); + } + break; + } + } + return statements; + } + function appendExportsOfImportEqualsDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + return appendExportsOfDeclaration(statements, decl); + } + function appendExportsOfVariableStatement(statements, node, exportSelf) { + if (moduleInfo.exportEquals) { + return statements; + } + for (const decl of node.declarationList.declarations) { + if (decl.initializer || exportSelf) { + statements = appendExportsOfBindingElement(statements, decl, exportSelf); + } + } + return statements; + } + function appendExportsOfBindingElement(statements, decl, exportSelf) { + if (moduleInfo.exportEquals) { + return statements; + } + if (isBindingPattern(decl.name)) { + for (const element of decl.name.elements) { + if (!isOmittedExpression(element)) { + statements = appendExportsOfBindingElement(statements, element, exportSelf); + } + } + } else if (!isGeneratedIdentifier(decl.name)) { + let excludeName; + if (exportSelf) { + statements = appendExportStatement(statements, decl.name, factory2.getLocalName(decl)); + excludeName = idText(decl.name); + } + statements = appendExportsOfDeclaration(statements, decl, excludeName); + } + return statements; + } + function appendExportsOfHoistedDeclaration(statements, decl) { + if (moduleInfo.exportEquals) { + return statements; + } + let excludeName; + if (hasSyntacticModifier( + decl, + 32 + /* Export */ + )) { + const exportName = hasSyntacticModifier( + decl, + 2048 + /* Default */ + ) ? factory2.createStringLiteral("default") : decl.name; + statements = appendExportStatement(statements, exportName, factory2.getLocalName(decl)); + excludeName = getTextOfIdentifierOrLiteral(exportName); + } + if (decl.name) { + statements = appendExportsOfDeclaration(statements, decl, excludeName); + } + return statements; + } + function appendExportsOfDeclaration(statements, decl, excludeName) { + if (moduleInfo.exportEquals) { + return statements; + } + const name2 = factory2.getDeclarationName(decl); + const exportSpecifiers = moduleInfo.exportSpecifiers.get(name2); + if (exportSpecifiers) { + for (const exportSpecifier of exportSpecifiers) { + if (exportSpecifier.name.escapedText !== excludeName) { + statements = appendExportStatement(statements, exportSpecifier.name, name2); + } + } + } + return statements; + } + function appendExportStatement(statements, exportName, expression, allowComments) { + statements = append(statements, createExportStatement(exportName, expression, allowComments)); + return statements; + } + function createExportStatement(name2, value2, allowComments) { + const statement = factory2.createExpressionStatement(createExportExpression(name2, value2)); + startOnNewLine(statement); + if (!allowComments) { + setEmitFlags( + statement, + 3072 + /* NoComments */ + ); + } + return statement; + } + function createExportExpression(name2, value2) { + const exportName = isIdentifier(name2) ? factory2.createStringLiteralFromNode(name2) : name2; + setEmitFlags( + value2, + getEmitFlags(value2) | 3072 + /* NoComments */ + ); + return setCommentRange(factory2.createCallExpression( + exportFunction, + /*typeArguments*/ + void 0, + [exportName, value2] + ), value2); + } + function topLevelNestedVisitor(node) { + switch (node.kind) { + case 243: + return visitVariableStatement(node); + case 262: + return visitFunctionDeclaration(node); + case 263: + return visitClassDeclaration(node); + case 248: + return visitForStatement( + node, + /*isTopLevel*/ + true + ); + case 249: + return visitForInStatement(node); + case 250: + return visitForOfStatement(node); + case 246: + return visitDoStatement(node); + case 247: + return visitWhileStatement(node); + case 256: + return visitLabeledStatement(node); + case 254: + return visitWithStatement(node); + case 245: + return visitIfStatement(node); + case 255: + return visitSwitchStatement(node); + case 269: + return visitCaseBlock(node); + case 296: + return visitCaseClause(node); + case 297: + return visitDefaultClause(node); + case 258: + return visitTryStatement(node); + case 299: + return visitCatchClause(node); + case 241: + return visitBlock(node); + default: + return visitor(node); + } + } + function visitForStatement(node, isTopLevel) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory2.updateForStatement( + node, + visitNode(node.initializer, isTopLevel ? visitForInitializer : discardedValueVisitor, isForInitializer), + visitNode(node.condition, visitor, isExpression), + visitNode(node.incrementor, discardedValueVisitor, isExpression), + visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context2) + ); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitForInStatement(node) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory2.updateForInStatement( + node, + visitForInitializer(node.initializer), + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitForOfStatement(node) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory2.updateForOfStatement( + node, + node.awaitModifier, + visitForInitializer(node.initializer), + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function shouldHoistForInitializer(node) { + return isVariableDeclarationList(node) && shouldHoistVariableDeclarationList(node); + } + function visitForInitializer(node) { + if (shouldHoistForInitializer(node)) { + let expressions; + for (const variable of node.declarations) { + expressions = append(expressions, transformInitializedVariable( + variable, + /*isExportedDeclaration*/ + false + )); + if (!variable.initializer) { + hoistBindingElement(variable); + } + } + return expressions ? factory2.inlineExpressions(expressions) : factory2.createOmittedExpression(); + } else { + return visitNode(node, discardedValueVisitor, isForInitializer); + } + } + function visitDoStatement(node) { + return factory2.updateDoStatement( + node, + visitIterationBody(node.statement, topLevelNestedVisitor, context2), + visitNode(node.expression, visitor, isExpression) + ); + } + function visitWhileStatement(node) { + return factory2.updateWhileStatement( + node, + visitNode(node.expression, visitor, isExpression), + visitIterationBody(node.statement, topLevelNestedVisitor, context2) + ); + } + function visitLabeledStatement(node) { + return factory2.updateLabeledStatement( + node, + node.label, + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) + ); + } + function visitWithStatement(node) { + return factory2.updateWithStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)) + ); + } + function visitIfStatement(node) { + return factory2.updateIfStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)), + visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) + ); + } + function visitSwitchStatement(node) { + return factory2.updateSwitchStatement( + node, + visitNode(node.expression, visitor, isExpression), + Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock)) + ); + } + function visitCaseBlock(node) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory2.updateCaseBlock( + node, + visitNodes2(node.clauses, topLevelNestedVisitor, isCaseOrDefaultClause) + ); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitCaseClause(node) { + return factory2.updateCaseClause( + node, + visitNode(node.expression, visitor, isExpression), + visitNodes2(node.statements, topLevelNestedVisitor, isStatement) + ); + } + function visitDefaultClause(node) { + return visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitTryStatement(node) { + return visitEachChild(node, topLevelNestedVisitor, context2); + } + function visitCatchClause(node) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = factory2.updateCatchClause( + node, + node.variableDeclaration, + Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock2)) + ); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitBlock(node) { + const savedEnclosingBlockScopedContainer = enclosingBlockScopedContainer; + enclosingBlockScopedContainer = node; + node = visitEachChild(node, topLevelNestedVisitor, context2); + enclosingBlockScopedContainer = savedEnclosingBlockScopedContainer; + return node; + } + function visitorWorker(node, valueIsDiscarded) { + if (!(node.transformFlags & (4096 | 8388608 | 268435456))) { + return node; + } + switch (node.kind) { + case 248: + return visitForStatement( + node, + /*isTopLevel*/ + false + ); + case 244: + return visitExpressionStatement(node); + case 217: + return visitParenthesizedExpression(node, valueIsDiscarded); + case 360: + return visitPartiallyEmittedExpression(node, valueIsDiscarded); + case 226: + if (isDestructuringAssignment(node)) { + return visitDestructuringAssignment(node, valueIsDiscarded); + } + break; + case 213: + if (isImportCall(node)) { + return visitImportCallExpression(node); + } + break; + case 224: + case 225: + return visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded); + } + return visitEachChild(node, visitor, context2); + } + function visitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + false + ); + } + function discardedValueVisitor(node) { + return visitorWorker( + node, + /*valueIsDiscarded*/ + true + ); + } + function visitExpressionStatement(node) { + return factory2.updateExpressionStatement(node, visitNode(node.expression, discardedValueVisitor, isExpression)); + } + function visitParenthesizedExpression(node, valueIsDiscarded) { + return factory2.updateParenthesizedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); + } + function visitPartiallyEmittedExpression(node, valueIsDiscarded) { + return factory2.updatePartiallyEmittedExpression(node, visitNode(node.expression, valueIsDiscarded ? discardedValueVisitor : visitor, isExpression)); + } + function visitImportCallExpression(node) { + const externalModuleName = getExternalModuleNameLiteral(factory2, node, currentSourceFile, host, resolver, compilerOptions); + const firstArgument = visitNode(firstOrUndefined(node.arguments), visitor, isExpression); + const argument = externalModuleName && (!firstArgument || !isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument; + return factory2.createCallExpression( + factory2.createPropertyAccessExpression( + contextObject, + factory2.createIdentifier("import") + ), + /*typeArguments*/ + void 0, + argument ? [argument] : [] + ); + } + function visitDestructuringAssignment(node, valueIsDiscarded) { + if (hasExportedReferenceInDestructuringTarget(node.left)) { + return flattenDestructuringAssignment( + node, + visitor, + context2, + 0, + !valueIsDiscarded + ); + } + return visitEachChild(node, visitor, context2); + } + function hasExportedReferenceInDestructuringTarget(node) { + if (isAssignmentExpression( + node, + /*excludeCompoundAssignment*/ + true + )) { + return hasExportedReferenceInDestructuringTarget(node.left); + } else if (isSpreadElement(node)) { + return hasExportedReferenceInDestructuringTarget(node.expression); + } else if (isObjectLiteralExpression(node)) { + return some2(node.properties, hasExportedReferenceInDestructuringTarget); + } else if (isArrayLiteralExpression(node)) { + return some2(node.elements, hasExportedReferenceInDestructuringTarget); + } else if (isShorthandPropertyAssignment(node)) { + return hasExportedReferenceInDestructuringTarget(node.name); + } else if (isPropertyAssignment(node)) { + return hasExportedReferenceInDestructuringTarget(node.initializer); + } else if (isIdentifier(node)) { + const container = resolver.getReferencedExportContainer(node); + return container !== void 0 && container.kind === 312; + } else { + return false; + } + } + function visitPrefixOrPostfixUnaryExpression(node, valueIsDiscarded) { + if ((node.operator === 46 || node.operator === 47) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand) && !isDeclarationNameOfEnumOrNamespace(node.operand)) { + const exportedNames = getExports(node.operand); + if (exportedNames) { + let temp; + let expression = visitNode(node.operand, visitor, isExpression); + if (isPrefixUnaryExpression(node)) { + expression = factory2.updatePrefixUnaryExpression(node, expression); + } else { + expression = factory2.updatePostfixUnaryExpression(node, expression); + if (!valueIsDiscarded) { + temp = factory2.createTempVariable(hoistVariableDeclaration); + expression = factory2.createAssignment(temp, expression); + setTextRange(expression, node); + } + expression = factory2.createComma(expression, factory2.cloneNode(node.operand)); + setTextRange(expression, node); + } + for (const exportName of exportedNames) { + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + if (temp) { + expression = factory2.createComma(expression, temp); + setTextRange(expression, node); + } + return expression; + } + } + return visitEachChild(node, visitor, context2); + } + function modifierVisitor(node) { + switch (node.kind) { + case 95: + case 90: + return void 0; + } + return node; + } + function onEmitNode(hint, node, emitCallback) { + if (node.kind === 312) { + const id = getOriginalNodeId(node); + currentSourceFile = node; + moduleInfo = moduleInfoMap[id]; + exportFunction = exportFunctionsMap[id]; + noSubstitution = noSubstitutionMap[id]; + contextObject = contextObjectMap[id]; + if (noSubstitution) { + delete noSubstitutionMap[id]; + } + previousOnEmitNode(hint, node, emitCallback); + currentSourceFile = void 0; + moduleInfo = void 0; + exportFunction = void 0; + contextObject = void 0; + noSubstitution = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (isSubstitutionPrevented(node)) { + return node; + } + if (hint === 1) { + return substituteExpression(node); + } else if (hint === 4) { + return substituteUnspecified(node); + } + return node; + } + function substituteUnspecified(node) { + switch (node.kind) { + case 304: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var _a2, _b; + const name2 = node.name; + if (!isGeneratedIdentifier(name2) && !isLocalName(name2)) { + const importDeclaration = resolver.getReferencedImportDeclaration(name2); + if (importDeclaration) { + if (isImportClause(importDeclaration)) { + return setTextRange( + factory2.createPropertyAssignment( + factory2.cloneNode(name2), + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(importDeclaration.parent), + factory2.createIdentifier("default") + ) + ), + /*location*/ + node + ); + } else if (isImportSpecifier(importDeclaration)) { + return setTextRange( + factory2.createPropertyAssignment( + factory2.cloneNode(name2), + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.parent) || importDeclaration), + factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name) + ) + ), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteExpression(node) { + switch (node.kind) { + case 80: + return substituteExpressionIdentifier(node); + case 226: + return substituteBinaryExpression(node); + case 236: + return substituteMetaProperty(node); + } + return node; + } + function substituteExpressionIdentifier(node) { + var _a2, _b; + if (getEmitFlags(node) & 8192) { + const externalHelpersModuleName = getExternalHelpersModuleName(currentSourceFile); + if (externalHelpersModuleName) { + return factory2.createPropertyAccessExpression(externalHelpersModuleName, node); + } + return node; + } + if (!isGeneratedIdentifier(node) && !isLocalName(node)) { + const importDeclaration = resolver.getReferencedImportDeclaration(node); + if (importDeclaration) { + if (isImportClause(importDeclaration)) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(importDeclaration.parent), + factory2.createIdentifier("default") + ), + /*location*/ + node + ); + } else if (isImportSpecifier(importDeclaration)) { + return setTextRange( + factory2.createPropertyAccessExpression( + factory2.getGeneratedNameForNode(((_b = (_a2 = importDeclaration.parent) == null ? void 0 : _a2.parent) == null ? void 0 : _b.parent) || importDeclaration), + factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name) + ), + /*location*/ + node + ); + } + } + } + return node; + } + function substituteBinaryExpression(node) { + if (isAssignmentOperator(node.operatorToken.kind) && isIdentifier(node.left) && (!isGeneratedIdentifier(node.left) || isFileLevelReservedGeneratedIdentifier(node.left)) && !isLocalName(node.left)) { + const exportedNames = getExports(node.left); + if (exportedNames) { + let expression = node; + for (const exportName of exportedNames) { + expression = createExportExpression(exportName, preventSubstitution(expression)); + } + return expression; + } + } + return node; + } + function substituteMetaProperty(node) { + if (isImportMeta(node)) { + return factory2.createPropertyAccessExpression(contextObject, factory2.createIdentifier("meta")); + } + return node; + } + function getExports(name2) { + let exportedNames; + const valueDeclaration = getReferencedDeclaration(name2); + if (valueDeclaration) { + const exportContainer = resolver.getReferencedExportContainer( + name2, + /*prefixLocals*/ + false + ); + if (exportContainer && exportContainer.kind === 312) { + exportedNames = append(exportedNames, factory2.getDeclarationName(valueDeclaration)); + } + exportedNames = addRange(exportedNames, moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)]); + } else if (isGeneratedIdentifier(name2) && isFileLevelReservedGeneratedIdentifier(name2)) { + const exportSpecifiers = moduleInfo == null ? void 0 : moduleInfo.exportSpecifiers.get(name2); + if (exportSpecifiers) { + const exportedNames2 = []; + for (const exportSpecifier of exportSpecifiers) { + exportedNames2.push(exportSpecifier.name); + } + return exportedNames2; + } + } + return exportedNames; + } + function getReferencedDeclaration(name2) { + if (!isGeneratedIdentifier(name2)) { + const importDeclaration = resolver.getReferencedImportDeclaration(name2); + if (importDeclaration) + return importDeclaration; + const valueDeclaration = resolver.getReferencedValueDeclaration(name2); + if (valueDeclaration && (moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(valueDeclaration)])) + return valueDeclaration; + const declarations = resolver.getReferencedValueDeclarations(name2); + if (declarations) { + for (const declaration of declarations) { + if (declaration !== valueDeclaration && (moduleInfo == null ? void 0 : moduleInfo.exportedBindings[getOriginalNodeId(declaration)])) + return declaration; + } + } + return valueDeclaration; + } + } + function preventSubstitution(node) { + if (noSubstitution === void 0) + noSubstitution = []; + noSubstitution[getNodeId(node)] = true; + return node; + } + function isSubstitutionPrevented(node) { + return noSubstitution && node.id && noSubstitution[node.id]; + } + } + var init_system = __esm2({ + "src/compiler/transformers/module/system.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformECMAScriptModule(context2) { + const { + factory: factory2, + getEmitHelperFactory: emitHelpers + } = context2; + const host = context2.getEmitHost(); + const resolver = context2.getEmitResolver(); + const compilerOptions = context2.getCompilerOptions(); + const languageVersion = getEmitScriptTarget(compilerOptions); + const previousOnEmitNode = context2.onEmitNode; + const previousOnSubstituteNode = context2.onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.enableEmitNotification( + 312 + /* SourceFile */ + ); + context2.enableSubstitution( + 80 + /* Identifier */ + ); + let helperNameSubstitutions; + let currentSourceFile; + let importRequireStatements; + return chainBundle(context2, transformSourceFile); + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + if (isExternalModule(node) || getIsolatedModules(compilerOptions)) { + currentSourceFile = node; + importRequireStatements = void 0; + let result2 = updateExternalModule(node); + currentSourceFile = void 0; + if (importRequireStatements) { + result2 = factory2.updateSourceFile( + result2, + setTextRange(factory2.createNodeArray(insertStatementsAfterCustomPrologue(result2.statements.slice(), importRequireStatements)), result2.statements) + ); + } + if (!isExternalModule(node) || getEmitModuleKind(compilerOptions) === 200 || some2(result2.statements, isExternalModuleIndicator)) { + return result2; + } + return factory2.updateSourceFile( + result2, + setTextRange(factory2.createNodeArray([...result2.statements, createEmptyExports(factory2)]), result2.statements) + ); + } + return node; + } + function updateExternalModule(node) { + const externalHelpersImportDeclaration = createExternalHelpersImportDeclarationIfNeeded(factory2, emitHelpers(), node, compilerOptions); + if (externalHelpersImportDeclaration) { + const statements = []; + const statementOffset = factory2.copyPrologue(node.statements, statements); + append(statements, externalHelpersImportDeclaration); + addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset)); + return factory2.updateSourceFile( + node, + setTextRange(factory2.createNodeArray(statements), node.statements) + ); + } else { + return visitEachChild(node, visitor, context2); + } + } + function visitor(node) { + switch (node.kind) { + case 271: + return getEmitModuleKind(compilerOptions) >= 100 ? visitImportEqualsDeclaration(node) : void 0; + case 277: + return visitExportAssignment(node); + case 278: + const exportDecl = node; + return visitExportDeclaration(exportDecl); + } + return node; + } + function createRequireCall2(importNode) { + const moduleName3 = getExternalModuleNameLiteral(factory2, importNode, Debug.checkDefined(currentSourceFile), host, resolver, compilerOptions); + const args = []; + if (moduleName3) { + args.push(moduleName3); + } + if (getEmitModuleKind(compilerOptions) === 200) { + return factory2.createCallExpression( + factory2.createIdentifier("require"), + /*typeArguments*/ + void 0, + args + ); + } + if (!importRequireStatements) { + const createRequireName = factory2.createUniqueName( + "_createRequire", + 16 | 32 + /* FileLevel */ + ); + const importStatement = factory2.createImportDeclaration( + /*modifiers*/ + void 0, + factory2.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory2.createNamedImports([ + factory2.createImportSpecifier( + /*isTypeOnly*/ + false, + factory2.createIdentifier("createRequire"), + createRequireName + ) + ]) + ), + factory2.createStringLiteral("module"), + /*attributes*/ + void 0 + ); + const requireHelperName = factory2.createUniqueName( + "__require", + 16 | 32 + /* FileLevel */ + ); + const requireStatement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + requireHelperName, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory2.createCallExpression( + factory2.cloneNode(createRequireName), + /*typeArguments*/ + void 0, + [ + factory2.createPropertyAccessExpression(factory2.createMetaProperty(102, factory2.createIdentifier("meta")), factory2.createIdentifier("url")) + ] + ) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* None */ + ) + ); + importRequireStatements = [importStatement, requireStatement]; + } + const name2 = importRequireStatements[1].declarationList.declarations[0].name; + Debug.assertNode(name2, isIdentifier); + return factory2.createCallExpression( + factory2.cloneNode(name2), + /*typeArguments*/ + void 0, + args + ); + } + function visitImportEqualsDeclaration(node) { + Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer."); + let statements; + statements = append( + statements, + setOriginalNode( + setTextRange( + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + [ + factory2.createVariableDeclaration( + factory2.cloneNode(node.name), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall2(node) + ) + ], + /*flags*/ + languageVersion >= 2 ? 2 : 0 + /* None */ + ) + ), + node + ), + node + ) + ); + statements = appendExportsOfImportEqualsDeclaration(statements, node); + return singleOrMany(statements); + } + function appendExportsOfImportEqualsDeclaration(statements, node) { + if (hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + statements = append( + statements, + factory2.createExportDeclaration( + /*modifiers*/ + void 0, + node.isTypeOnly, + factory2.createNamedExports([factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + idText(node.name) + )]) + ) + ); + } + return statements; + } + function visitExportAssignment(node) { + if (node.isExportEquals) { + if (getEmitModuleKind(compilerOptions) === 200) { + const statement = setOriginalNode( + factory2.createExpressionStatement( + factory2.createAssignment( + factory2.createPropertyAccessExpression( + factory2.createIdentifier("module"), + "exports" + ), + node.expression + ) + ), + node + ); + return statement; + } + return void 0; + } + return node; + } + function visitExportDeclaration(node) { + if (compilerOptions.module !== void 0 && compilerOptions.module > 5) { + return node; + } + if (!node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) { + return node; + } + const oldIdentifier = node.exportClause.name; + const synthName = factory2.getGeneratedNameForNode(oldIdentifier); + const importDecl = factory2.createImportDeclaration( + /*modifiers*/ + void 0, + factory2.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory2.createNamespaceImport( + synthName + ) + ), + node.moduleSpecifier, + node.attributes + ); + setOriginalNode(importDecl, node.exportClause); + const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory2.createNamedExports([factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + synthName, + oldIdentifier + )]) + ); + setOriginalNode(exportDecl, node); + return [importDecl, exportDecl]; + } + function onEmitNode(hint, node, emitCallback) { + if (isSourceFile(node)) { + if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) { + helperNameSubstitutions = /* @__PURE__ */ new Map(); + } + previousOnEmitNode(hint, node, emitCallback); + helperNameSubstitutions = void 0; + } else { + previousOnEmitNode(hint, node, emitCallback); + } + } + function onSubstituteNode(hint, node) { + node = previousOnSubstituteNode(hint, node); + if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) & 8192) { + return substituteHelperName(node); + } + return node; + } + function substituteHelperName(node) { + const name2 = idText(node); + let substitution = helperNameSubstitutions.get(name2); + if (!substitution) { + helperNameSubstitutions.set(name2, substitution = factory2.createUniqueName( + name2, + 16 | 32 + /* FileLevel */ + )); + } + return substitution; + } + } + var init_esnextAnd2015 = __esm2({ + "src/compiler/transformers/module/esnextAnd2015.ts"() { + "use strict"; + init_ts2(); + } + }); + function transformNodeModule(context2) { + const previousOnSubstituteNode = context2.onSubstituteNode; + const previousOnEmitNode = context2.onEmitNode; + const esmTransform = transformECMAScriptModule(context2); + const esmOnSubstituteNode = context2.onSubstituteNode; + const esmOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = previousOnSubstituteNode; + context2.onEmitNode = previousOnEmitNode; + const cjsTransform = transformModule(context2); + const cjsOnSubstituteNode = context2.onSubstituteNode; + const cjsOnEmitNode = context2.onEmitNode; + context2.onSubstituteNode = onSubstituteNode; + context2.onEmitNode = onEmitNode; + context2.enableSubstitution( + 312 + /* SourceFile */ + ); + context2.enableEmitNotification( + 312 + /* SourceFile */ + ); + let currentSourceFile; + return transformSourceFileOrBundle; + function onSubstituteNode(hint, node) { + if (isSourceFile(node)) { + currentSourceFile = node; + return previousOnSubstituteNode(hint, node); + } else { + if (!currentSourceFile) { + return previousOnSubstituteNode(hint, node); + } + if (currentSourceFile.impliedNodeFormat === 99) { + return esmOnSubstituteNode(hint, node); + } + return cjsOnSubstituteNode(hint, node); + } + } + function onEmitNode(hint, node, emitCallback) { + if (isSourceFile(node)) { + currentSourceFile = node; + } + if (!currentSourceFile) { + return previousOnEmitNode(hint, node, emitCallback); + } + if (currentSourceFile.impliedNodeFormat === 99) { + return esmOnEmitNode(hint, node, emitCallback); + } + return cjsOnEmitNode(hint, node, emitCallback); + } + function getModuleTransformForFile(file) { + return file.impliedNodeFormat === 99 ? esmTransform : cjsTransform; + } + function transformSourceFile(node) { + if (node.isDeclarationFile) { + return node; + } + currentSourceFile = node; + const result2 = getModuleTransformForFile(node)(node); + currentSourceFile = void 0; + Debug.assert(isSourceFile(result2)); + return result2; + } + function transformSourceFileOrBundle(node) { + return node.kind === 312 ? transformSourceFile(node) : transformBundle(node); + } + function transformBundle(node) { + return context2.factory.createBundle(map4(node.sourceFiles, transformSourceFile), node.prepends); + } + } + var init_node = __esm2({ + "src/compiler/transformers/module/node.ts"() { + "use strict"; + init_ts2(); + } + }); + function canProduceDiagnostics(node) { + return isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isSetAccessor(node) || isGetAccessor(node) || isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isParameter(node) || isTypeParameterDeclaration(node) || isExpressionWithTypeArguments(node) || isImportEqualsDeclaration(node) || isTypeAliasDeclaration(node) || isConstructorDeclaration(node) || isIndexSignatureDeclaration(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isJSDocTypeAlias(node); + } + function createGetSymbolAccessibilityDiagnosticForNodeName(node) { + if (isSetAccessor(node) || isGetAccessor(node)) { + return getAccessorNameVisibilityError; + } else if (isMethodSignature(node) || isMethodDeclaration(node)) { + return getMethodNameVisibilityError; + } else { + return createGetSymbolAccessibilityDiagnosticForNode(node); + } + function getAccessorNameVisibilityError(symbolAccessibilityResult) { + const diagnosticMessage = getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getAccessorNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 263) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + function getMethodNameVisibilityError(symbolAccessibilityResult) { + const diagnosticMessage = getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getMethodNameVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 263) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + } + function createGetSymbolAccessibilityDiagnosticForNode(node) { + if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node) || isBinaryExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) { + return getVariableDeclarationTypeVisibilityError; + } else if (isSetAccessor(node) || isGetAccessor(node)) { + return getAccessorDeclarationTypeVisibilityError; + } else if (isConstructSignatureDeclaration(node) || isCallSignatureDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isFunctionDeclaration(node) || isIndexSignatureDeclaration(node)) { + return getReturnTypeVisibilityError; + } else if (isParameter(node)) { + if (isParameterPropertyDeclaration(node, node.parent) && hasSyntacticModifier( + node.parent, + 2 + /* Private */ + )) { + return getVariableDeclarationTypeVisibilityError; + } + return getParameterDeclarationTypeVisibilityError; + } else if (isTypeParameterDeclaration(node)) { + return getTypeParameterConstraintVisibilityError; + } else if (isExpressionWithTypeArguments(node)) { + return getHeritageClauseVisibilityError; + } else if (isImportEqualsDeclaration(node)) { + return getImportEntityNameVisibilityError; + } else if (isTypeAliasDeclaration(node) || isJSDocTypeAlias(node)) { + return getTypeAliasDeclarationVisibilityError; + } else { + return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`); + } + function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { + if (node.kind === 260 || node.kind === 208) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; + } else if (node.kind === 172 || node.kind === 211 || node.kind === 212 || node.kind === 226 || node.kind === 171 || node.kind === 169 && hasSyntacticModifier( + node.parent, + 2 + /* Private */ + )) { + if (isStatic(node)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.kind === 263 || node.kind === 169) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; + } + } + } + function getVariableDeclarationTypeVisibilityError(symbolAccessibilityResult) { + const diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { + let diagnosticMessage; + if (node.kind === 178) { + if (isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1; + } + } else { + if (isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1; + } + } + return { + diagnosticMessage, + errorNode: node.name, + typeName: node.name + }; + } + function getReturnTypeVisibilityError(symbolAccessibilityResult) { + let diagnosticMessage; + switch (node.kind) { + case 180: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 179: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 181: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; + break; + case 174: + case 173: + if (isStatic(node)) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; + } else if (node.parent.kind === 263) { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; + } else { + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; + } + break; + case 262: + diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; + break; + default: + return Debug.fail("This is unknown kind for signature: " + node.kind); + } + return { + diagnosticMessage, + errorNode: node.name || node + }; + } + function getParameterDeclarationTypeVisibilityError(symbolAccessibilityResult) { + const diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult); + return diagnosticMessage !== void 0 ? { + diagnosticMessage, + errorNode: node, + typeName: node.name + } : void 0; + } + function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { + switch (node.parent.kind) { + case 176: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; + case 180: + case 185: + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + case 179: + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + case 181: + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 174: + case 173: + if (isStatic(node.parent)) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.parent.kind === 263) { + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } else { + return symbolAccessibilityResult.errorModuleName ? Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + case 262: + case 184: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; + case 178: + case 177: + return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1; + default: + return Debug.fail(`Unknown parent for parameter: ${Debug.formatSyntaxKind(node.parent.kind)}`); + } + } + function getTypeParameterConstraintVisibilityError() { + let diagnosticMessage; + switch (node.parent.kind) { + case 263: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; + break; + case 264: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; + break; + case 200: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1; + break; + case 185: + case 180: + diagnosticMessage = Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 179: + diagnosticMessage = Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; + break; + case 174: + case 173: + if (isStatic(node.parent)) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; + } else if (node.parent.parent.kind === 263) { + diagnosticMessage = Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; + } else { + diagnosticMessage = Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; + } + break; + case 184: + case 262: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; + break; + case 195: + diagnosticMessage = Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1; + break; + case 265: + diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; + break; + default: + return Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); + } + return { + diagnosticMessage, + errorNode: node, + typeName: node.name + }; + } + function getHeritageClauseVisibilityError() { + let diagnosticMessage; + if (isClassDeclaration(node.parent.parent)) { + diagnosticMessage = isHeritageClause(node.parent) && node.parent.token === 119 ? Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : node.parent.parent.name ? Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1 : Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0; + } else { + diagnosticMessage = Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; + } + return { + diagnosticMessage, + errorNode: node, + typeName: getNameOfDeclaration(node.parent.parent) + }; + } + function getImportEntityNameVisibilityError() { + return { + diagnosticMessage: Diagnostics.Import_declaration_0_is_using_private_name_1, + errorNode: node, + typeName: node.name + }; + } + function getTypeAliasDeclarationVisibilityError(symbolAccessibilityResult) { + return { + diagnosticMessage: symbolAccessibilityResult.errorModuleName ? Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 : Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, + errorNode: isJSDocTypeAlias(node) ? Debug.checkDefined(node.typeExpression) : node.type, + typeName: isJSDocTypeAlias(node) ? getNameOfDeclaration(node) : node.name + }; + } + } + var init_diagnostics = __esm2({ + "src/compiler/transformers/declarations/diagnostics.ts"() { + "use strict"; + init_ts2(); + } + }); + function getDeclarationDiagnostics(host, resolver, file) { + const compilerOptions = host.getCompilerOptions(); + const result2 = transformNodes( + resolver, + host, + factory, + compilerOptions, + file ? [file] : filter2(host.getSourceFiles(), isSourceFileNotJson), + [transformDeclarations], + /*allowDtsFiles*/ + false + ); + return result2.diagnostics; + } + function transformDeclarations(context2) { + const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context"); + let getSymbolAccessibilityDiagnostic = throwDiagnostic; + let needsDeclare = true; + let isBundledEmit = false; + let resultHasExternalModuleIndicator = false; + let needsScopeFixMarker = false; + let resultHasScopeMarker = false; + let enclosingDeclaration; + let necessaryTypeReferences; + let lateMarkedStatements; + let lateStatementReplacementMap; + let suppressNewDiagnosticContexts; + let exportedModulesFromDeclarationEmit; + const { factory: factory2 } = context2; + const host = context2.getEmitHost(); + const symbolTracker = { + trackSymbol, + reportInaccessibleThisError, + reportInaccessibleUniqueSymbolError, + reportCyclicStructureError, + reportPrivateInBaseOfClassExpression, + reportLikelyUnsafeImportRequiredError, + reportTruncationError, + moduleResolverHost: host, + trackReferencedAmbientModule, + trackExternalModuleSymbolOfImportTypeNode, + reportNonlocalAugmentation, + reportNonSerializableProperty + }; + let errorNameNode; + let errorFallbackNode; + let currentSourceFile; + let refs; + let libs2; + let emittedImports; + const resolver = context2.getEmitResolver(); + const options = context2.getCompilerOptions(); + const { noResolve, stripInternal } = options; + return transformRoot; + function recordTypeReferenceDirectivesIfNecessary(typeReferenceDirectives) { + if (!typeReferenceDirectives) { + return; + } + necessaryTypeReferences = necessaryTypeReferences || /* @__PURE__ */ new Set(); + for (const ref of typeReferenceDirectives) { + necessaryTypeReferences.add(ref); + } + } + function trackReferencedAmbientModule(node, symbol) { + const directives = resolver.getTypeReferenceDirectivesForSymbol( + symbol, + -1 + /* All */ + ); + if (length(directives)) { + return recordTypeReferenceDirectivesIfNecessary(directives); + } + const container = getSourceFileOfNode(node); + refs.set(getOriginalNodeId(container), container); + } + function trackReferencedAmbientModuleFromImport(node) { + const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node); + const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier); + if (symbol == null ? void 0 : symbol.declarations) { + for (const decl of symbol.declarations) { + if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) { + trackReferencedAmbientModule(decl, symbol); + } + } + } + } + function handleSymbolAccessibilityError(symbolAccessibilityResult) { + if (symbolAccessibilityResult.accessibility === 0) { + if (symbolAccessibilityResult.aliasesToMakeVisible) { + if (!lateMarkedStatements) { + lateMarkedStatements = symbolAccessibilityResult.aliasesToMakeVisible; + } else { + for (const ref of symbolAccessibilityResult.aliasesToMakeVisible) { + pushIfUnique(lateMarkedStatements, ref); + } + } + } + } else { + const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult); + if (errorInfo) { + if (errorInfo.typeName) { + context2.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, getTextOfNode(errorInfo.typeName), symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); + } else { + context2.addDiagnostic(createDiagnosticForNode(symbolAccessibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccessibilityResult.errorSymbolName, symbolAccessibilityResult.errorModuleName)); + } + return true; + } + } + return false; + } + function trackExternalModuleSymbolOfImportTypeNode(symbol) { + if (!isBundledEmit) { + (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol); + } + } + function trackSymbol(symbol, enclosingDeclaration2, meaning) { + if (symbol.flags & 262144) + return false; + const issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible( + symbol, + enclosingDeclaration2, + meaning, + /*shouldComputeAliasToMarkVisible*/ + true + )); + recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning)); + return issuedDiagnostic; + } + function reportPrivateInBaseOfClassExpression(propertyName) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic( + createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected, propertyName) + ); + } + } + function errorDeclarationNameWithFallback() { + return errorNameNode ? declarationNameToString(errorNameNode) : errorFallbackNode && getNameOfDeclaration(errorFallbackNode) ? declarationNameToString(getNameOfDeclaration(errorFallbackNode)) : errorFallbackNode && isExportAssignment(errorFallbackNode) ? errorFallbackNode.isExportEquals ? "export=" : "default" : "(Missing)"; + } + function reportInaccessibleUniqueSymbolError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "unique symbol")); + } + } + function reportCyclicStructureError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary, errorDeclarationNameWithFallback())); + } + } + function reportInaccessibleThisError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), "this")); + } + } + function reportLikelyUnsafeImportRequiredError(specifier) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary, errorDeclarationNameWithFallback(), specifier)); + } + } + function reportTruncationError() { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed)); + } + } + function reportNonlocalAugmentation(containingFile, parentSymbol, symbol) { + var _a2; + const primaryDeclaration = (_a2 = parentSymbol.declarations) == null ? void 0 : _a2.find((d7) => getSourceFileOfNode(d7) === containingFile); + const augmentingDeclarations = filter2(symbol.declarations, (d7) => getSourceFileOfNode(d7) !== containingFile); + if (primaryDeclaration && augmentingDeclarations) { + for (const augmentations of augmentingDeclarations) { + context2.addDiagnostic(addRelatedInfo( + createDiagnosticForNode(augmentations, Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), + createDiagnosticForNode(primaryDeclaration, Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file) + )); + } + } + } + function reportNonSerializableProperty(propertyName) { + if (errorNameNode || errorFallbackNode) { + context2.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName)); + } + } + function transformDeclarationsForJS(sourceFile, bundled) { + const oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = (s7) => s7.errorNode && canProduceDiagnostics(s7.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s7.errorNode)(s7) : { + diagnosticMessage: s7.errorModuleName ? Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit : Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit, + errorNode: s7.errorNode || sourceFile + }; + const result2 = resolver.getDeclarationStatementsForSourceFile(sourceFile, declarationEmitNodeBuilderFlags, symbolTracker, bundled); + getSymbolAccessibilityDiagnostic = oldDiag; + return result2; + } + function transformRoot(node) { + if (node.kind === 312 && node.isDeclarationFile) { + return node; + } + if (node.kind === 313) { + isBundledEmit = true; + refs = /* @__PURE__ */ new Map(); + libs2 = /* @__PURE__ */ new Map(); + let hasNoDefaultLib = false; + const bundle = factory2.createBundle( + map4(node.sourceFiles, (sourceFile) => { + if (sourceFile.isDeclarationFile) + return void 0; + hasNoDefaultLib = hasNoDefaultLib || sourceFile.hasNoDefaultLib; + currentSourceFile = sourceFile; + enclosingDeclaration = sourceFile; + lateMarkedStatements = void 0; + suppressNewDiagnosticContexts = false; + lateStatementReplacementMap = /* @__PURE__ */ new Map(); + getSymbolAccessibilityDiagnostic = throwDiagnostic; + needsScopeFixMarker = false; + resultHasScopeMarker = false; + collectReferences(sourceFile, refs); + collectLibs(sourceFile, libs2); + if (isExternalOrCommonJsModule(sourceFile) || isJsonSourceFile(sourceFile)) { + resultHasExternalModuleIndicator = false; + needsDeclare = false; + const statements = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS( + sourceFile, + /*bundled*/ + true + )) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); + const newFile = factory2.updateSourceFile( + sourceFile, + [factory2.createModuleDeclaration( + [factory2.createModifier( + 138 + /* DeclareKeyword */ + )], + factory2.createStringLiteral(getResolvedExternalModuleName(context2.getEmitHost(), sourceFile)), + factory2.createModuleBlock(setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)) + )], + /*isDeclarationFile*/ + true, + /*referencedFiles*/ + [], + /*typeReferences*/ + [], + /*hasNoDefaultLib*/ + false, + /*libReferences*/ + [] + ); + return newFile; + } + needsDeclare = true; + const updated2 = isSourceFileJS(sourceFile) ? factory2.createNodeArray(transformDeclarationsForJS(sourceFile)) : visitNodes2(sourceFile.statements, visitDeclarationStatements, isStatement); + return factory2.updateSourceFile( + sourceFile, + transformAndReplaceLatePaintedStatements(updated2), + /*isDeclarationFile*/ + true, + /*referencedFiles*/ + [], + /*typeReferences*/ + [], + /*hasNoDefaultLib*/ + false, + /*libReferences*/ + [] + ); + }), + mapDefined(node.prepends, (prepend) => { + if (prepend.kind === 315) { + const sourceFile = createUnparsedSourceFile(prepend, "dts", stripInternal); + hasNoDefaultLib = hasNoDefaultLib || !!sourceFile.hasNoDefaultLib; + collectReferences(sourceFile, refs); + recordTypeReferenceDirectivesIfNecessary(map4(sourceFile.typeReferenceDirectives, (ref) => [ref.fileName, ref.resolutionMode])); + collectLibs(sourceFile, libs2); + return sourceFile; + } + return prepend; + }) + ); + bundle.syntheticFileReferences = []; + bundle.syntheticTypeReferences = getFileReferencesForUsedTypeReferences(); + bundle.syntheticLibReferences = getLibReferences(); + bundle.hasNoDefaultLib = hasNoDefaultLib; + const outputFilePath2 = getDirectoryPath(normalizeSlashes(getOutputPathsFor( + node, + host, + /*forceDtsPaths*/ + true + ).declarationFilePath)); + const referenceVisitor2 = mapReferencesIntoArray(bundle.syntheticFileReferences, outputFilePath2); + refs.forEach(referenceVisitor2); + return bundle; + } + needsDeclare = true; + needsScopeFixMarker = false; + resultHasScopeMarker = false; + enclosingDeclaration = node; + currentSourceFile = node; + getSymbolAccessibilityDiagnostic = throwDiagnostic; + isBundledEmit = false; + resultHasExternalModuleIndicator = false; + suppressNewDiagnosticContexts = false; + lateMarkedStatements = void 0; + lateStatementReplacementMap = /* @__PURE__ */ new Map(); + necessaryTypeReferences = void 0; + refs = collectReferences(currentSourceFile, /* @__PURE__ */ new Map()); + libs2 = collectLibs(currentSourceFile, /* @__PURE__ */ new Map()); + const references = []; + const outputFilePath = getDirectoryPath(normalizeSlashes(getOutputPathsFor( + node, + host, + /*forceDtsPaths*/ + true + ).declarationFilePath)); + const referenceVisitor = mapReferencesIntoArray(references, outputFilePath); + let combinedStatements; + if (isSourceFileJS(currentSourceFile)) { + combinedStatements = factory2.createNodeArray(transformDeclarationsForJS(node)); + refs.forEach(referenceVisitor); + emittedImports = filter2(combinedStatements, isAnyImportSyntax); + } else { + const statements = visitNodes2(node.statements, visitDeclarationStatements, isStatement); + combinedStatements = setTextRange(factory2.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements); + refs.forEach(referenceVisitor); + emittedImports = filter2(combinedStatements, isAnyImportSyntax); + if (isExternalModule(node) && (!resultHasExternalModuleIndicator || needsScopeFixMarker && !resultHasScopeMarker)) { + combinedStatements = setTextRange(factory2.createNodeArray([...combinedStatements, createEmptyExports(factory2)]), combinedStatements); + } + } + const updated = factory2.updateSourceFile( + node, + combinedStatements, + /*isDeclarationFile*/ + true, + references, + getFileReferencesForUsedTypeReferences(), + node.hasNoDefaultLib, + getLibReferences() + ); + updated.exportedModulesFromDeclarationEmit = exportedModulesFromDeclarationEmit; + return updated; + function getLibReferences() { + return arrayFrom(libs2.keys(), (lib2) => ({ fileName: lib2, pos: -1, end: -1 })); + } + function getFileReferencesForUsedTypeReferences() { + return necessaryTypeReferences ? mapDefined(arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : []; + } + function getFileReferenceForSpecifierModeTuple([typeName, mode]) { + if (emittedImports) { + for (const importStatement of emittedImports) { + if (isImportEqualsDeclaration(importStatement) && isExternalModuleReference(importStatement.moduleReference)) { + const expr = importStatement.moduleReference.expression; + if (isStringLiteralLike(expr) && expr.text === typeName) { + return void 0; + } + } else if (isImportDeclaration(importStatement) && isStringLiteral(importStatement.moduleSpecifier) && importStatement.moduleSpecifier.text === typeName) { + return void 0; + } + } + } + return { fileName: typeName, pos: -1, end: -1, ...mode ? { resolutionMode: mode } : void 0 }; + } + function mapReferencesIntoArray(references2, outputFilePath2) { + return (file) => { + if (exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.includes(file.symbol)) { + return; + } + let declFileName; + if (file.isDeclarationFile) { + declFileName = file.fileName; + } else { + if (isBundledEmit && contains2(node.sourceFiles, file)) + return; + const paths = getOutputPathsFor( + file, + host, + /*forceDtsPaths*/ + true + ); + declFileName = paths.declarationFilePath || paths.jsFilePath || file.fileName; + } + if (declFileName) { + const specifier = getModuleSpecifier( + options, + currentSourceFile, + getNormalizedAbsolutePath(outputFilePath2, host.getCurrentDirectory()), + getNormalizedAbsolutePath(declFileName, host.getCurrentDirectory()), + host + ); + if (!pathIsRelative(specifier)) { + recordTypeReferenceDirectivesIfNecessary([[ + specifier, + /*mode*/ + void 0 + ]]); + return; + } + let fileName = getRelativePathToDirectoryOrUrl( + outputFilePath2, + declFileName, + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + false + ); + if (startsWith2(fileName, "./") && hasExtension(fileName)) { + fileName = fileName.substring(2); + } + if (startsWith2(fileName, "node_modules/") || pathContainsNodeModules(fileName)) { + return; + } + references2.push({ pos: -1, end: -1, fileName }); + } + }; + } + } + function collectReferences(sourceFile, ret) { + if (noResolve || !isUnparsedSource(sourceFile) && isSourceFileJS(sourceFile)) + return ret; + forEach4(sourceFile.referencedFiles, (f8) => { + const elem = host.getSourceFileFromReference(sourceFile, f8); + if (elem) { + ret.set(getOriginalNodeId(elem), elem); + } + }); + return ret; + } + function collectLibs(sourceFile, ret) { + forEach4(sourceFile.libReferenceDirectives, (ref) => { + const lib2 = host.getLibFileFromReference(ref); + if (lib2) { + ret.set(toFileNameLowerCase(ref.fileName), true); + } + }); + return ret; + } + function filterBindingPatternInitializers(name2) { + if (name2.kind === 80) { + return name2; + } else { + if (name2.kind === 207) { + return factory2.updateArrayBindingPattern(name2, visitNodes2(name2.elements, visitBindingElement, isArrayBindingElement)); + } else { + return factory2.updateObjectBindingPattern(name2, visitNodes2(name2.elements, visitBindingElement, isBindingElement)); + } + } + function visitBindingElement(elem) { + if (elem.kind === 232) { + return elem; + } + if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) { + checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration); + } + return factory2.updateBindingElement( + elem, + elem.dotDotDotToken, + elem.propertyName, + filterBindingPatternInitializers(elem.name), + shouldPrintWithInitializer(elem) ? elem.initializer : void 0 + ); + } + } + function ensureParameter(p7, modifierMask, type3) { + let oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p7); + } + const newParam = factory2.updateParameterDeclaration( + p7, + maskModifiers(factory2, p7, modifierMask), + p7.dotDotDotToken, + filterBindingPatternInitializers(p7.name), + resolver.isOptionalParameter(p7) ? p7.questionToken || factory2.createToken( + 58 + /* QuestionToken */ + ) : void 0, + ensureType( + p7, + type3 || p7.type, + /*ignorePrivate*/ + true + ), + // Ignore private param props, since this type is going straight back into a param + ensureNoInitializer(p7) + ); + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + return newParam; + } + function shouldPrintWithInitializer(node) { + return canHaveLiteralInitializer(node) && resolver.isLiteralConstDeclaration(getParseTreeNode(node)); + } + function ensureNoInitializer(node) { + if (shouldPrintWithInitializer(node)) { + return resolver.createLiteralConstValue(getParseTreeNode(node), symbolTracker); + } + return void 0; + } + function ensureType(node, type3, ignorePrivate) { + if (!ignorePrivate && hasEffectiveModifier( + node, + 2 + /* Private */ + )) { + return; + } + if (shouldPrintWithInitializer(node)) { + return; + } + const shouldUseResolverType = node.kind === 169 && (resolver.isRequiredInitializedParameter(node) || resolver.isOptionalUninitializedParameterProperty(node)); + if (type3 && !shouldUseResolverType) { + return visitNode(type3, visitDeclarationSubtree, isTypeNode); + } + if (!getParseTreeNode(node)) { + return type3 ? visitNode(type3, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + if (node.kind === 178) { + return factory2.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + errorNameNode = node.name; + let oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node); + } + if (node.kind === 260 || node.kind === 208) { + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + } + if (node.kind === 169 || node.kind === 172 || node.kind === 171) { + if (isPropertySignature(node) || !node.initializer) + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType)); + return cleanup(resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldUseResolverType) || resolver.createTypeOfExpression(node.initializer, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + } + return cleanup(resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker)); + function cleanup(returnValue) { + errorNameNode = void 0; + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + return returnValue || factory2.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + } + function isDeclarationAndNotVisible(node) { + node = getParseTreeNode(node); + switch (node.kind) { + case 262: + case 267: + case 264: + case 263: + case 265: + case 266: + return !resolver.isDeclarationVisible(node); + case 260: + return !getBindingNameVisible(node); + case 271: + case 272: + case 278: + case 277: + return false; + case 175: + return true; + } + return false; + } + function shouldEmitFunctionProperties(input) { + var _a2; + if (input.body) { + return true; + } + const overloadSignatures = (_a2 = input.symbol.declarations) == null ? void 0 : _a2.filter((decl) => isFunctionDeclaration(decl) && !decl.body); + return !overloadSignatures || overloadSignatures.indexOf(input) === overloadSignatures.length - 1; + } + function getBindingNameVisible(elem) { + if (isOmittedExpression(elem)) { + return false; + } + if (isBindingPattern(elem.name)) { + return some2(elem.name.elements, getBindingNameVisible); + } else { + return resolver.isDeclarationVisible(elem); + } + } + function updateParamsList(node, params, modifierMask) { + if (hasEffectiveModifier( + node, + 2 + /* Private */ + )) { + return factory2.createNodeArray(); + } + const newParams = map4(params, (p7) => ensureParameter(p7, modifierMask)); + if (!newParams) { + return factory2.createNodeArray(); + } + return factory2.createNodeArray(newParams, params.hasTrailingComma); + } + function updateAccessorParamsList(input, isPrivate) { + let newParams; + if (!isPrivate) { + const thisParameter = getThisParameter(input); + if (thisParameter) { + newParams = [ensureParameter(thisParameter)]; + } + } + if (isSetAccessorDeclaration(input)) { + let newValueParameter; + if (!isPrivate) { + const valueParameter = getSetAccessorValueParameter(input); + if (valueParameter) { + const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); + newValueParameter = ensureParameter( + valueParameter, + /*modifierMask*/ + void 0, + accessorType + ); + } + } + if (!newValueParameter) { + newValueParameter = factory2.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "value" + ); + } + newParams = append(newParams, newValueParameter); + } + return factory2.createNodeArray(newParams || emptyArray); + } + function ensureTypeParams(node, params) { + return hasEffectiveModifier( + node, + 2 + /* Private */ + ) ? void 0 : visitNodes2(params, visitDeclarationSubtree, isTypeParameterDeclaration); + } + function isEnclosingDeclaration(node) { + return isSourceFile(node) || isTypeAliasDeclaration(node) || isModuleDeclaration(node) || isClassDeclaration(node) || isInterfaceDeclaration(node) || isFunctionLike(node) || isIndexSignatureDeclaration(node) || isMappedTypeNode(node); + } + function checkEntityNameVisibility(entityName, enclosingDeclaration2) { + const visibilityResult = resolver.isEntityNameVisible(entityName, enclosingDeclaration2); + handleSymbolAccessibilityError(visibilityResult); + recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); + } + function preserveJsDoc(updated, original) { + if (hasJSDocNodes(updated) && hasJSDocNodes(original)) { + updated.jsDoc = original.jsDoc; + } + return setCommentRange(updated, getCommentRange(original)); + } + function rewriteModuleSpecifier(parent22, input) { + if (!input) + return void 0; + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent22.kind !== 267 && parent22.kind !== 205; + if (isStringLiteralLike(input)) { + if (isBundledEmit) { + const newName = getExternalModuleNameFromDeclaration(context2.getEmitHost(), resolver, parent22); + if (newName) { + return factory2.createStringLiteral(newName); + } + } else { + const symbol = resolver.getSymbolOfExternalModuleSpecifier(input); + if (symbol) { + (exportedModulesFromDeclarationEmit || (exportedModulesFromDeclarationEmit = [])).push(symbol); + } + } + } + return input; + } + function transformImportEqualsDeclaration(decl) { + if (!resolver.isDeclarationVisible(decl)) + return; + if (decl.moduleReference.kind === 283) { + const specifier = getExternalModuleImportEqualsDeclarationExpression(decl); + return factory2.updateImportEqualsDeclaration( + decl, + decl.modifiers, + decl.isTypeOnly, + decl.name, + factory2.updateExternalModuleReference(decl.moduleReference, rewriteModuleSpecifier(decl, specifier)) + ); + } else { + const oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(decl); + checkEntityNameVisibility(decl.moduleReference, enclosingDeclaration); + getSymbolAccessibilityDiagnostic = oldDiag; + return decl; + } + } + function transformImportDeclaration(decl) { + if (!decl.importClause) { + return factory2.updateImportDeclaration( + decl, + decl.modifiers, + decl.importClause, + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ); + } + const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0; + if (!decl.importClause.namedBindings) { + return visibleDefaultBinding && factory2.updateImportDeclaration( + decl, + decl.modifiers, + factory2.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + /*namedBindings*/ + void 0 + ), + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ); + } + if (decl.importClause.namedBindings.kind === 274) { + const namedBindings = resolver.isDeclarationVisible(decl.importClause.namedBindings) ? decl.importClause.namedBindings : ( + /*namedBindings*/ + void 0 + ); + return visibleDefaultBinding || namedBindings ? factory2.updateImportDeclaration( + decl, + decl.modifiers, + factory2.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + namedBindings + ), + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ) : void 0; + } + const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b8) => resolver.isDeclarationVisible(b8) ? b8 : void 0); + if (bindingList && bindingList.length || visibleDefaultBinding) { + return factory2.updateImportDeclaration( + decl, + decl.modifiers, + factory2.updateImportClause( + decl.importClause, + decl.importClause.isTypeOnly, + visibleDefaultBinding, + bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0 + ), + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ); + } + if (resolver.isImportRequiredByAugmentation(decl)) { + return factory2.updateImportDeclaration( + decl, + decl.modifiers, + /*importClause*/ + void 0, + rewriteModuleSpecifier(decl, decl.moduleSpecifier), + tryGetResolutionModeOverride(decl.attributes) + ); + } + } + function tryGetResolutionModeOverride(node) { + const mode = getResolutionModeOverride(node); + return node && mode !== void 0 ? node : void 0; + } + function transformAndReplaceLatePaintedStatements(statements) { + while (length(lateMarkedStatements)) { + const i7 = lateMarkedStatements.shift(); + if (!isLateVisibilityPaintedStatement(i7)) { + return Debug.fail(`Late replaced statement was found which is not handled by the declaration transformer!: ${Debug.formatSyntaxKind(i7.kind)}`); + } + const priorNeedsDeclare = needsDeclare; + needsDeclare = i7.parent && isSourceFile(i7.parent) && !(isExternalModule(i7.parent) && isBundledEmit); + const result2 = transformTopLevelDeclaration(i7); + needsDeclare = priorNeedsDeclare; + lateStatementReplacementMap.set(getOriginalNodeId(i7), result2); + } + return visitNodes2(statements, visitLateVisibilityMarkedStatements, isStatement); + function visitLateVisibilityMarkedStatements(statement) { + if (isLateVisibilityPaintedStatement(statement)) { + const key = getOriginalNodeId(statement); + if (lateStatementReplacementMap.has(key)) { + const result2 = lateStatementReplacementMap.get(key); + lateStatementReplacementMap.delete(key); + if (result2) { + if (isArray3(result2) ? some2(result2, needsScopeMarker) : needsScopeMarker(result2)) { + needsScopeFixMarker = true; + } + if (isSourceFile(statement.parent) && (isArray3(result2) ? some2(result2, isExternalModuleIndicator) : isExternalModuleIndicator(result2))) { + resultHasExternalModuleIndicator = true; + } + } + return result2; + } + } + return statement; + } + } + function visitDeclarationSubtree(input) { + if (shouldStripInternal(input)) + return; + if (isDeclaration(input)) { + if (isDeclarationAndNotVisible(input)) + return; + if (hasDynamicName(input) && !resolver.isLateBound(getParseTreeNode(input))) { + return; + } + } + if (isFunctionLike(input) && resolver.isImplementationOfOverload(input)) + return; + if (isSemicolonClassElement(input)) + return; + let previousEnclosingDeclaration; + if (isEnclosingDeclaration(input)) { + previousEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = input; + } + const oldDiag = getSymbolAccessibilityDiagnostic; + const canProduceDiagnostic = canProduceDiagnostics(input); + const oldWithinObjectLiteralType = suppressNewDiagnosticContexts; + let shouldEnterSuppressNewDiagnosticsContextContext = (input.kind === 187 || input.kind === 200) && input.parent.kind !== 265; + if (isMethodDeclaration(input) || isMethodSignature(input)) { + if (hasEffectiveModifier( + input, + 2 + /* Private */ + )) { + if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) + return; + return cleanup(factory2.createPropertyDeclaration( + ensureModifiers(input), + input.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )); + } + } + if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input); + } + if (isTypeQueryNode(input)) { + checkEntityNameVisibility(input.exprName, enclosingDeclaration); + } + if (shouldEnterSuppressNewDiagnosticsContextContext) { + suppressNewDiagnosticContexts = true; + } + if (isProcessedComponent(input)) { + switch (input.kind) { + case 233: { + if (isEntityName(input.expression) || isEntityNameExpression(input.expression)) { + checkEntityNameVisibility(input.expression, enclosingDeclaration); + } + const node = visitEachChild(input, visitDeclarationSubtree, context2); + return cleanup(factory2.updateExpressionWithTypeArguments(node, node.expression, node.typeArguments)); + } + case 183: { + checkEntityNameVisibility(input.typeName, enclosingDeclaration); + const node = visitEachChild(input, visitDeclarationSubtree, context2); + return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments)); + } + case 180: + return cleanup(factory2.updateConstructSignature( + input, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type) + )); + case 176: { + const ctor = factory2.createConstructorDeclaration( + /*modifiers*/ + ensureModifiers(input), + updateParamsList( + input, + input.parameters, + 0 + /* None */ + ), + /*body*/ + void 0 + ); + return cleanup(ctor); + } + case 174: { + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + const sig = factory2.createMethodDeclaration( + ensureModifiers(input), + /*asteriskToken*/ + void 0, + input.name, + input.questionToken, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type), + /*body*/ + void 0 + ); + return cleanup(sig); + } + case 177: { + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input)); + return cleanup(factory2.updateGetAccessorDeclaration( + input, + ensureModifiers(input), + input.name, + updateAccessorParamsList(input, hasEffectiveModifier( + input, + 2 + /* Private */ + )), + ensureType(input, accessorType), + /*body*/ + void 0 + )); + } + case 178: { + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory2.updateSetAccessorDeclaration( + input, + ensureModifiers(input), + input.name, + updateAccessorParamsList(input, hasEffectiveModifier( + input, + 2 + /* Private */ + )), + /*body*/ + void 0 + )); + } + case 172: + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory2.updatePropertyDeclaration( + input, + ensureModifiers(input), + input.name, + input.questionToken, + ensureType(input, input.type), + ensureNoInitializer(input) + )); + case 171: + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory2.updatePropertySignature( + input, + ensureModifiers(input), + input.name, + input.questionToken, + ensureType(input, input.type) + )); + case 173: { + if (isPrivateIdentifier(input.name)) { + return cleanup( + /*returnValue*/ + void 0 + ); + } + return cleanup(factory2.updateMethodSignature( + input, + ensureModifiers(input), + input.name, + input.questionToken, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type) + )); + } + case 179: { + return cleanup( + factory2.updateCallSignature( + input, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type) + ) + ); + } + case 181: { + return cleanup(factory2.updateIndexSignature( + input, + ensureModifiers(input), + updateParamsList(input, input.parameters), + visitNode(input.type, visitDeclarationSubtree, isTypeNode) || factory2.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + )); + } + case 260: { + if (isBindingPattern(input.name)) { + return recreateBindingPattern(input.name); + } + shouldEnterSuppressNewDiagnosticsContextContext = true; + suppressNewDiagnosticContexts = true; + return cleanup(factory2.updateVariableDeclaration( + input, + input.name, + /*exclamationToken*/ + void 0, + ensureType(input, input.type), + ensureNoInitializer(input) + )); + } + case 168: { + if (isPrivateMethodTypeParameter(input) && (input.default || input.constraint)) { + return cleanup(factory2.updateTypeParameterDeclaration( + input, + input.modifiers, + input.name, + /*constraint*/ + void 0, + /*defaultType*/ + void 0 + )); + } + return cleanup(visitEachChild(input, visitDeclarationSubtree, context2)); + } + case 194: { + const checkType = visitNode(input.checkType, visitDeclarationSubtree, isTypeNode); + const extendsType = visitNode(input.extendsType, visitDeclarationSubtree, isTypeNode); + const oldEnclosingDecl = enclosingDeclaration; + enclosingDeclaration = input.trueType; + const trueType = visitNode(input.trueType, visitDeclarationSubtree, isTypeNode); + enclosingDeclaration = oldEnclosingDecl; + const falseType = visitNode(input.falseType, visitDeclarationSubtree, isTypeNode); + Debug.assert(checkType); + Debug.assert(extendsType); + Debug.assert(trueType); + Debug.assert(falseType); + return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType)); + } + case 184: { + return cleanup(factory2.updateFunctionTypeNode( + input, + visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), + updateParamsList(input, input.parameters), + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) + )); + } + case 185: { + return cleanup(factory2.updateConstructorTypeNode( + input, + ensureModifiers(input), + visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), + updateParamsList(input, input.parameters), + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) + )); + } + case 205: { + if (!isLiteralImportTypeNode(input)) + return cleanup(input); + trackReferencedAmbientModuleFromImport(input); + return cleanup(factory2.updateImportTypeNode( + input, + factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), + input.attributes, + input.qualifier, + visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode), + input.isTypeOf + )); + } + default: + Debug.assertNever(input, `Attempted to process unhandled node kind: ${Debug.formatSyntaxKind(input.kind)}`); + } + } + if (isTupleTypeNode(input) && getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === getLineAndCharacterOfPosition(currentSourceFile, input.end).line) { + setEmitFlags( + input, + 1 + /* SingleLine */ + ); + } + return cleanup(visitEachChild(input, visitDeclarationSubtree, context2)); + function cleanup(returnValue) { + if (returnValue && canProduceDiagnostic && hasDynamicName(input)) { + checkName(input); + } + if (isEnclosingDeclaration(input)) { + enclosingDeclaration = previousEnclosingDeclaration; + } + if (canProduceDiagnostic && !suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + if (shouldEnterSuppressNewDiagnosticsContextContext) { + suppressNewDiagnosticContexts = oldWithinObjectLiteralType; + } + if (returnValue === input) { + return returnValue; + } + return returnValue && setOriginalNode(preserveJsDoc(returnValue, input), input); + } + } + function isPrivateMethodTypeParameter(node) { + return node.parent.kind === 174 && hasEffectiveModifier( + node.parent, + 2 + /* Private */ + ); + } + function visitDeclarationStatements(input) { + if (!isPreservedDeclarationStatement(input)) { + return; + } + if (shouldStripInternal(input)) + return; + switch (input.kind) { + case 278: { + if (isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + trackReferencedAmbientModuleFromImport(input); + return factory2.updateExportDeclaration( + input, + input.modifiers, + input.isTypeOnly, + input.exportClause, + rewriteModuleSpecifier(input, input.moduleSpecifier), + tryGetResolutionModeOverride(input.attributes) + ); + } + case 277: { + if (isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + if (input.expression.kind === 80) { + return input; + } else { + const newId = factory2.createUniqueName( + "_default", + 16 + /* Optimistic */ + ); + getSymbolAccessibilityDiagnostic = () => ({ + diagnosticMessage: Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, + errorNode: input + }); + errorFallbackNode = input; + const varDecl = factory2.createVariableDeclaration( + newId, + /*exclamationToken*/ + void 0, + resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), + /*initializer*/ + void 0 + ); + errorFallbackNode = void 0; + const statement = factory2.createVariableStatement(needsDeclare ? [factory2.createModifier( + 138 + /* DeclareKeyword */ + )] : [], factory2.createVariableDeclarationList( + [varDecl], + 2 + /* Const */ + )); + preserveJsDoc(statement, input); + removeAllComments(input); + return [statement, factory2.updateExportAssignment(input, input.modifiers, newId)]; + } + } + } + const result2 = transformTopLevelDeclaration(input); + lateStatementReplacementMap.set(getOriginalNodeId(input), result2); + return input; + } + function stripExportModifiers(statement) { + if (isImportEqualsDeclaration(statement) || hasEffectiveModifier( + statement, + 2048 + /* Default */ + ) || !canHaveModifiers(statement)) { + return statement; + } + const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (131071 ^ 32)); + return factory2.replaceModifiers(statement, modifiers); + } + function updateModuleDeclarationAndKeyword(node, modifiers, name2, body) { + const updated = factory2.updateModuleDeclaration(node, modifiers, name2, body); + if (isAmbientModule(updated) || updated.flags & 32) { + return updated; + } + const fixed = factory2.createModuleDeclaration( + updated.modifiers, + updated.name, + updated.body, + updated.flags | 32 + /* Namespace */ + ); + setOriginalNode(fixed, updated); + setTextRange(fixed, updated); + return fixed; + } + function transformTopLevelDeclaration(input) { + if (lateMarkedStatements) { + while (orderedRemoveItem(lateMarkedStatements, input)) + ; + } + if (shouldStripInternal(input)) + return; + switch (input.kind) { + case 271: { + const transformed = transformImportEqualsDeclaration(input); + if (transformed) { + trackReferencedAmbientModuleFromImport(input); + } + return transformed; + } + case 272: { + const transformed = transformImportDeclaration(input); + if (transformed) { + trackReferencedAmbientModuleFromImport(input); + } + return transformed; + } + } + if (isDeclaration(input) && isDeclarationAndNotVisible(input)) + return; + if (isFunctionLike(input) && resolver.isImplementationOfOverload(input)) + return; + let previousEnclosingDeclaration; + if (isEnclosingDeclaration(input)) { + previousEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = input; + } + const canProdiceDiagnostic = canProduceDiagnostics(input); + const oldDiag = getSymbolAccessibilityDiagnostic; + if (canProdiceDiagnostic) { + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(input); + } + const previousNeedsDeclare = needsDeclare; + switch (input.kind) { + case 265: { + needsDeclare = false; + const clean2 = cleanup(factory2.updateTypeAliasDeclaration( + input, + ensureModifiers(input), + input.name, + visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration), + Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode)) + )); + needsDeclare = previousNeedsDeclare; + return clean2; + } + case 264: { + return cleanup(factory2.updateInterfaceDeclaration( + input, + ensureModifiers(input), + input.name, + ensureTypeParams(input, input.typeParameters), + transformHeritageClauses(input.heritageClauses), + visitNodes2(input.members, visitDeclarationSubtree, isTypeElement) + )); + } + case 262: { + const clean2 = cleanup(factory2.updateFunctionDeclaration( + input, + ensureModifiers(input), + /*asteriskToken*/ + void 0, + input.name, + ensureTypeParams(input, input.typeParameters), + updateParamsList(input, input.parameters), + ensureType(input, input.type), + /*body*/ + void 0 + )); + if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) { + const props = resolver.getPropertiesOfContainerFunction(input); + const fakespace = parseNodeFactory.createModuleDeclaration( + /*modifiers*/ + void 0, + clean2.name || factory2.createIdentifier("_default"), + factory2.createModuleBlock([]), + 32 + /* Namespace */ + ); + setParent(fakespace, enclosingDeclaration); + fakespace.locals = createSymbolTable(props); + fakespace.symbol = props[0].parent; + const exportMappings = []; + let declarations = mapDefined(props, (p7) => { + if (!isExpandoPropertyDeclaration(p7.valueDeclaration)) { + return void 0; + } + const nameStr = unescapeLeadingUnderscores(p7.escapedName); + if (!isIdentifierText( + nameStr, + 99 + /* ESNext */ + )) { + return void 0; + } + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p7.valueDeclaration); + const type3 = resolver.createTypeOfDeclaration(p7.valueDeclaration, fakespace, declarationEmitNodeBuilderFlags, symbolTracker); + getSymbolAccessibilityDiagnostic = oldDiag; + const isNonContextualKeywordName = isStringANonContextualKeyword(nameStr); + const name2 = isNonContextualKeywordName ? factory2.getGeneratedNameForNode(p7.valueDeclaration) : factory2.createIdentifier(nameStr); + if (isNonContextualKeywordName) { + exportMappings.push([name2, nameStr]); + } + const varDecl = factory2.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + type3, + /*initializer*/ + void 0 + ); + return factory2.createVariableStatement(isNonContextualKeywordName ? void 0 : [factory2.createToken( + 95 + /* ExportKeyword */ + )], factory2.createVariableDeclarationList([varDecl])); + }); + if (!exportMappings.length) { + declarations = mapDefined(declarations, (declaration) => factory2.replaceModifiers( + declaration, + 0 + /* None */ + )); + } else { + declarations.push(factory2.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory2.createNamedExports(map4(exportMappings, ([gen, exp]) => { + return factory2.createExportSpecifier( + /*isTypeOnly*/ + false, + gen, + exp + ); + })) + )); + } + const namespaceDecl = factory2.createModuleDeclaration( + ensureModifiers(input), + input.name, + factory2.createModuleBlock(declarations), + 32 + /* Namespace */ + ); + if (!hasEffectiveModifier( + clean2, + 2048 + /* Default */ + )) { + return [clean2, namespaceDecl]; + } + const modifiers = factory2.createModifiersFromModifierFlags( + getEffectiveModifierFlags(clean2) & ~2080 | 128 + /* Ambient */ + ); + const cleanDeclaration = factory2.updateFunctionDeclaration( + clean2, + modifiers, + /*asteriskToken*/ + void 0, + clean2.name, + clean2.typeParameters, + clean2.parameters, + clean2.type, + /*body*/ + void 0 + ); + const namespaceDeclaration = factory2.updateModuleDeclaration( + namespaceDecl, + modifiers, + namespaceDecl.name, + namespaceDecl.body + ); + const exportDefaultDeclaration = factory2.createExportAssignment( + /*modifiers*/ + void 0, + /*isExportEquals*/ + false, + namespaceDecl.name + ); + if (isSourceFile(input.parent)) { + resultHasExternalModuleIndicator = true; + } + resultHasScopeMarker = true; + return [cleanDeclaration, namespaceDeclaration, exportDefaultDeclaration]; + } else { + return clean2; + } + } + case 267: { + needsDeclare = false; + const inner = input.body; + if (inner && inner.kind === 268) { + const oldNeedsScopeFix = needsScopeFixMarker; + const oldHasScopeFix = resultHasScopeMarker; + resultHasScopeMarker = false; + needsScopeFixMarker = false; + const statements = visitNodes2(inner.statements, visitDeclarationStatements, isStatement); + let lateStatements = transformAndReplaceLatePaintedStatements(statements); + if (input.flags & 33554432) { + needsScopeFixMarker = false; + } + if (!isGlobalScopeAugmentation(input) && !hasScopeMarker2(lateStatements) && !resultHasScopeMarker) { + if (needsScopeFixMarker) { + lateStatements = factory2.createNodeArray([...lateStatements, createEmptyExports(factory2)]); + } else { + lateStatements = visitNodes2(lateStatements, stripExportModifiers, isStatement); + } + } + const body = factory2.updateModuleBlock(inner, lateStatements); + needsDeclare = previousNeedsDeclare; + needsScopeFixMarker = oldNeedsScopeFix; + resultHasScopeMarker = oldHasScopeFix; + const mods = ensureModifiers(input); + return cleanup(updateModuleDeclarationAndKeyword( + input, + mods, + isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name, + body + )); + } else { + needsDeclare = previousNeedsDeclare; + const mods = ensureModifiers(input); + needsDeclare = false; + visitNode(inner, visitDeclarationStatements); + const id = getOriginalNodeId(inner); + const body = lateStatementReplacementMap.get(id); + lateStatementReplacementMap.delete(id); + return cleanup(updateModuleDeclarationAndKeyword( + input, + mods, + input.name, + body + )); + } + } + case 263: { + errorNameNode = input.name; + errorFallbackNode = input; + const modifiers = factory2.createNodeArray(ensureModifiers(input)); + const typeParameters = ensureTypeParams(input, input.typeParameters); + const ctor = getFirstConstructorWithBody(input); + let parameterProperties; + if (ctor) { + const oldDiag2 = getSymbolAccessibilityDiagnostic; + parameterProperties = compact2(flatMap2(ctor.parameters, (param) => { + if (!hasSyntacticModifier( + param, + 31 + /* ParameterPropertyModifier */ + ) || shouldStripInternal(param)) + return; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(param); + if (param.name.kind === 80) { + return preserveJsDoc( + factory2.createPropertyDeclaration( + ensureModifiers(param), + param.name, + param.questionToken, + ensureType(param, param.type), + ensureNoInitializer(param) + ), + param + ); + } else { + return walkBindingPattern(param.name); + } + function walkBindingPattern(pattern5) { + let elems; + for (const elem of pattern5.elements) { + if (isOmittedExpression(elem)) + continue; + if (isBindingPattern(elem.name)) { + elems = concatenate(elems, walkBindingPattern(elem.name)); + } + elems = elems || []; + elems.push(factory2.createPropertyDeclaration( + ensureModifiers(param), + elem.name, + /*questionOrExclamationToken*/ + void 0, + ensureType( + elem, + /*type*/ + void 0 + ), + /*initializer*/ + void 0 + )); + } + return elems; + } + })); + getSymbolAccessibilityDiagnostic = oldDiag2; + } + const hasPrivateIdentifier = some2(input.members, (member) => !!member.name && isPrivateIdentifier(member.name)); + const privateIdentifier = hasPrivateIdentifier ? [ + factory2.createPropertyDeclaration( + /*modifiers*/ + void 0, + factory2.createPrivateIdentifier("#private"), + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ) + ] : void 0; + const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement)); + const members = factory2.createNodeArray(memberNodes); + const extendsClause = getEffectiveBaseTypeNode(input); + if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106) { + const oldId = input.name ? unescapeLeadingUnderscores(input.name.escapedText) : "default"; + const newId = factory2.createUniqueName( + `${oldId}_base`, + 16 + /* Optimistic */ + ); + getSymbolAccessibilityDiagnostic = () => ({ + diagnosticMessage: Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, + errorNode: extendsClause, + typeName: input.name + }); + const varDecl = factory2.createVariableDeclaration( + newId, + /*exclamationToken*/ + void 0, + resolver.createTypeOfExpression(extendsClause.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), + /*initializer*/ + void 0 + ); + const statement = factory2.createVariableStatement(needsDeclare ? [factory2.createModifier( + 138 + /* DeclareKeyword */ + )] : [], factory2.createVariableDeclarationList( + [varDecl], + 2 + /* Const */ + )); + const heritageClauses = factory2.createNodeArray(map4(input.heritageClauses, (clause) => { + if (clause.token === 96) { + const oldDiag2 = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]); + const newClause = factory2.updateHeritageClause(clause, map4(clause.types, (t8) => factory2.updateExpressionWithTypeArguments(t8, newId, visitNodes2(t8.typeArguments, visitDeclarationSubtree, isTypeNode)))); + getSymbolAccessibilityDiagnostic = oldDiag2; + return newClause; + } + return factory2.updateHeritageClause(clause, visitNodes2(factory2.createNodeArray(filter2( + clause.types, + (t8) => isEntityNameExpression(t8.expression) || t8.expression.kind === 106 + /* NullKeyword */ + )), visitDeclarationSubtree, isExpressionWithTypeArguments)); + })); + return [ + statement, + cleanup(factory2.updateClassDeclaration( + input, + modifiers, + input.name, + typeParameters, + heritageClauses, + members + )) + ]; + } else { + const heritageClauses = transformHeritageClauses(input.heritageClauses); + return cleanup(factory2.updateClassDeclaration( + input, + modifiers, + input.name, + typeParameters, + heritageClauses, + members + )); + } + } + case 243: { + return cleanup(transformVariableStatement(input)); + } + case 266: { + return cleanup(factory2.updateEnumDeclaration( + input, + factory2.createNodeArray(ensureModifiers(input)), + input.name, + factory2.createNodeArray(mapDefined(input.members, (m7) => { + if (shouldStripInternal(m7)) + return; + const constValue = resolver.getConstantValue(m7); + const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue); + return preserveJsDoc(factory2.updateEnumMember(m7, m7.name, newInitializer), m7); + })) + )); + } + } + return Debug.assertNever(input, `Unhandled top-level node in declaration emit: ${Debug.formatSyntaxKind(input.kind)}`); + function cleanup(node) { + if (isEnclosingDeclaration(input)) { + enclosingDeclaration = previousEnclosingDeclaration; + } + if (canProdiceDiagnostic) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + if (input.kind === 267) { + needsDeclare = previousNeedsDeclare; + } + if (node === input) { + return node; + } + errorFallbackNode = void 0; + errorNameNode = void 0; + return node && setOriginalNode(preserveJsDoc(node, input), input); + } + } + function transformVariableStatement(input) { + if (!forEach4(input.declarationList.declarations, getBindingNameVisible)) + return; + const nodes = visitNodes2(input.declarationList.declarations, visitDeclarationSubtree, isVariableDeclaration); + if (!length(nodes)) + return; + const modifiers = factory2.createNodeArray(ensureModifiers(input)); + let declList; + if (isVarUsing(input.declarationList) || isVarAwaitUsing(input.declarationList)) { + declList = factory2.createVariableDeclarationList( + nodes, + 2 + /* Const */ + ); + setOriginalNode(declList, input.declarationList); + setTextRange(declList, input.declarationList); + setCommentRange(declList, input.declarationList); + } else { + declList = factory2.updateVariableDeclarationList(input.declarationList, nodes); + } + return factory2.updateVariableStatement(input, modifiers, declList); + } + function recreateBindingPattern(d7) { + return flatten2(mapDefined(d7.elements, (e10) => recreateBindingElement(e10))); + } + function recreateBindingElement(e10) { + if (e10.kind === 232) { + return; + } + if (e10.name) { + if (!getBindingNameVisible(e10)) + return; + if (isBindingPattern(e10.name)) { + return recreateBindingPattern(e10.name); + } else { + return factory2.createVariableDeclaration( + e10.name, + /*exclamationToken*/ + void 0, + ensureType( + e10, + /*type*/ + void 0 + ), + /*initializer*/ + void 0 + ); + } + } + } + function checkName(node) { + let oldDiag; + if (!suppressNewDiagnosticContexts) { + oldDiag = getSymbolAccessibilityDiagnostic; + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNodeName(node); + } + errorNameNode = node.name; + Debug.assert(resolver.isLateBound(getParseTreeNode(node))); + const decl = node; + const entityName = decl.name.expression; + checkEntityNameVisibility(entityName, enclosingDeclaration); + if (!suppressNewDiagnosticContexts) { + getSymbolAccessibilityDiagnostic = oldDiag; + } + errorNameNode = void 0; + } + function shouldStripInternal(node) { + return !!stripInternal && !!node && isInternalDeclaration(node, currentSourceFile); + } + function isScopeMarker2(node) { + return isExportAssignment(node) || isExportDeclaration(node); + } + function hasScopeMarker2(statements) { + return some2(statements, isScopeMarker2); + } + function ensureModifiers(node) { + const currentFlags = getEffectiveModifierFlags(node); + const newFlags = ensureModifierFlags(node); + if (currentFlags === newFlags) { + return visitArray(node.modifiers, (n7) => tryCast(n7, isModifier), isModifier); + } + return factory2.createModifiersFromModifierFlags(newFlags); + } + function ensureModifierFlags(node) { + let mask2 = 131071 ^ (1 | 1024 | 16); + let additions = needsDeclare && !isAlwaysType(node) ? 128 : 0; + const parentIsFile = node.parent.kind === 312; + if (!parentIsFile || isBundledEmit && parentIsFile && isExternalModule(node.parent)) { + mask2 ^= 128; + additions = 0; + } + return maskModifierFlags(node, mask2, additions); + } + function getTypeAnnotationFromAllAccessorDeclarations(node, accessors) { + let accessorType = getTypeAnnotationFromAccessor(node); + if (!accessorType && node !== accessors.firstAccessor) { + accessorType = getTypeAnnotationFromAccessor(accessors.firstAccessor); + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(accessors.firstAccessor); + } + if (!accessorType && accessors.secondAccessor && node !== accessors.secondAccessor) { + accessorType = getTypeAnnotationFromAccessor(accessors.secondAccessor); + getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(accessors.secondAccessor); + } + return accessorType; + } + function transformHeritageClauses(nodes) { + return factory2.createNodeArray(filter2( + map4(nodes, (clause) => factory2.updateHeritageClause( + clause, + visitNodes2( + factory2.createNodeArray(filter2(clause.types, (t8) => { + return isEntityNameExpression(t8.expression) || clause.token === 96 && t8.expression.kind === 106; + })), + visitDeclarationSubtree, + isExpressionWithTypeArguments + ) + )), + (clause) => clause.types && !!clause.types.length + )); + } + } + function isAlwaysType(node) { + if (node.kind === 264) { + return true; + } + return false; + } + function maskModifiers(factory2, node, modifierMask, modifierAdditions) { + return factory2.createModifiersFromModifierFlags(maskModifierFlags(node, modifierMask, modifierAdditions)); + } + function maskModifierFlags(node, modifierMask = 131071 ^ 1, modifierAdditions = 0) { + let flags = getEffectiveModifierFlags(node) & modifierMask | modifierAdditions; + if (flags & 2048 && !(flags & 32)) { + flags ^= 32; + } + if (flags & 2048 && flags & 128) { + flags ^= 128; + } + return flags; + } + function getTypeAnnotationFromAccessor(accessor) { + if (accessor) { + return accessor.kind === 177 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type : void 0; + } + } + function canHaveLiteralInitializer(node) { + switch (node.kind) { + case 172: + case 171: + return !hasEffectiveModifier( + node, + 2 + /* Private */ + ); + case 169: + case 260: + return true; + } + return false; + } + function isPreservedDeclarationStatement(node) { + switch (node.kind) { + case 262: + case 267: + case 271: + case 264: + case 263: + case 265: + case 266: + case 243: + case 272: + case 278: + case 277: + return true; + } + return false; + } + function isProcessedComponent(node) { + switch (node.kind) { + case 180: + case 176: + case 174: + case 177: + case 178: + case 172: + case 171: + case 173: + case 179: + case 181: + case 260: + case 168: + case 233: + case 183: + case 194: + case 184: + case 185: + case 205: + return true; + } + return false; + } + var declarationEmitNodeBuilderFlags; + var init_declarations = __esm2({ + "src/compiler/transformers/declarations.ts"() { + "use strict"; + init_ts2(); + init_ts_moduleSpecifiers(); + declarationEmitNodeBuilderFlags = 1024 | 2048 | 4096 | 8 | 524288 | 4 | 1; + } + }); + function getModuleTransformer(moduleKind) { + switch (moduleKind) { + case 99: + case 7: + case 6: + case 5: + case 200: + return transformECMAScriptModule; + case 4: + return transformSystemModule; + case 100: + case 199: + return transformNodeModule; + default: + return transformModule; + } + } + function getTransformers(compilerOptions, customTransformers, emitOnly) { + return { + scriptTransformers: getScriptTransformers(compilerOptions, customTransformers, emitOnly), + declarationTransformers: getDeclarationTransformers(customTransformers) + }; + } + function getScriptTransformers(compilerOptions, customTransformers, emitOnly) { + if (emitOnly) + return emptyArray; + const languageVersion = getEmitScriptTarget(compilerOptions); + const moduleKind = getEmitModuleKind(compilerOptions); + const useDefineForClassFields = getUseDefineForClassFields(compilerOptions); + const transformers = []; + addRange(transformers, customTransformers && map4(customTransformers.before, wrapScriptTransformerFactory)); + transformers.push(transformTypeScript); + if (compilerOptions.experimentalDecorators) { + transformers.push(transformLegacyDecorators); + } + if (getJSXTransformEnabled(compilerOptions)) { + transformers.push(transformJsx); + } + if (languageVersion < 99) { + transformers.push(transformESNext); + } + if (!compilerOptions.experimentalDecorators && (languageVersion < 99 || !useDefineForClassFields)) { + transformers.push(transformESDecorators); + } + transformers.push(transformClassFields); + if (languageVersion < 8) { + transformers.push(transformES2021); + } + if (languageVersion < 7) { + transformers.push(transformES2020); + } + if (languageVersion < 6) { + transformers.push(transformES2019); + } + if (languageVersion < 5) { + transformers.push(transformES2018); + } + if (languageVersion < 4) { + transformers.push(transformES2017); + } + if (languageVersion < 3) { + transformers.push(transformES2016); + } + if (languageVersion < 2) { + transformers.push(transformES2015); + transformers.push(transformGenerators); + } + transformers.push(getModuleTransformer(moduleKind)); + if (languageVersion < 1) { + transformers.push(transformES5); + } + addRange(transformers, customTransformers && map4(customTransformers.after, wrapScriptTransformerFactory)); + return transformers; + } + function getDeclarationTransformers(customTransformers) { + const transformers = []; + transformers.push(transformDeclarations); + addRange(transformers, customTransformers && map4(customTransformers.afterDeclarations, wrapDeclarationTransformerFactory)); + return transformers; + } + function wrapCustomTransformer(transformer) { + return (node) => isBundle(node) ? transformer.transformBundle(node) : transformer.transformSourceFile(node); + } + function wrapCustomTransformerFactory(transformer, handleDefault) { + return (context2) => { + const customTransformer = transformer(context2); + return typeof customTransformer === "function" ? handleDefault(context2, customTransformer) : wrapCustomTransformer(customTransformer); + }; + } + function wrapScriptTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, chainBundle); + } + function wrapDeclarationTransformerFactory(transformer) { + return wrapCustomTransformerFactory(transformer, (_6, node) => node); + } + function noEmitSubstitution(_hint, node) { + return node; + } + function noEmitNotification(hint, node, callback) { + callback(hint, node); + } + function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) { + var _a2, _b; + const enabledSyntaxKindFeatures = new Array( + 363 + /* Count */ + ); + let lexicalEnvironmentVariableDeclarations; + let lexicalEnvironmentFunctionDeclarations; + let lexicalEnvironmentStatements; + let lexicalEnvironmentFlags = 0; + let lexicalEnvironmentVariableDeclarationsStack = []; + let lexicalEnvironmentFunctionDeclarationsStack = []; + let lexicalEnvironmentStatementsStack = []; + let lexicalEnvironmentFlagsStack = []; + let lexicalEnvironmentStackOffset = 0; + let lexicalEnvironmentSuspended = false; + let blockScopedVariableDeclarationsStack = []; + let blockScopeStackOffset = 0; + let blockScopedVariableDeclarations; + let emitHelpers; + let onSubstituteNode = noEmitSubstitution; + let onEmitNode = noEmitNotification; + let state = 0; + const diagnostics = []; + const context2 = { + factory: factory2, + getCompilerOptions: () => options, + getEmitResolver: () => resolver, + // TODO: GH#18217 + getEmitHost: () => host, + // TODO: GH#18217 + getEmitHelperFactory: memoize2(() => createEmitHelperFactory(context2)), + startLexicalEnvironment, + suspendLexicalEnvironment, + resumeLexicalEnvironment, + endLexicalEnvironment, + setLexicalEnvironmentFlags, + getLexicalEnvironmentFlags, + hoistVariableDeclaration, + hoistFunctionDeclaration, + addInitializationStatement, + startBlockScope, + endBlockScope, + addBlockScopedVariable, + requestEmitHelper, + readEmitHelpers, + enableSubstitution, + enableEmitNotification, + isSubstitutionEnabled, + isEmitNotificationEnabled, + get onSubstituteNode() { + return onSubstituteNode; + }, + set onSubstituteNode(value2) { + Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + Debug.assert(value2 !== void 0, "Value must not be 'undefined'"); + onSubstituteNode = value2; + }, + get onEmitNode() { + return onEmitNode; + }, + set onEmitNode(value2) { + Debug.assert(state < 1, "Cannot modify transformation hooks after initialization has completed."); + Debug.assert(value2 !== void 0, "Value must not be 'undefined'"); + onEmitNode = value2; + }, + addDiagnostic(diag2) { + diagnostics.push(diag2); + } + }; + for (const node of nodes) { + disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(node))); + } + mark("beforeTransform"); + const transformersWithContext = transformers.map((t8) => t8(context2)); + const transformation = (node) => { + for (const transform22 of transformersWithContext) { + node = transform22(node); + } + return node; + }; + state = 1; + const transformed = []; + for (const node of nodes) { + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "transformNodes", node.kind === 312 ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end }); + transformed.push((allowDtsFiles ? transformation : transformRoot)(node)); + (_b = tracing) == null ? void 0 : _b.pop(); + } + state = 2; + mark("afterTransform"); + measure("transformTime", "beforeTransform", "afterTransform"); + return { + transformed, + substituteNode, + emitNodeWithNotification, + isEmitNotificationEnabled, + dispose, + diagnostics + }; + function transformRoot(node) { + return node && (!isSourceFile(node) || !node.isDeclarationFile) ? transformation(node) : node; + } + function enableSubstitution(kind) { + Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + enabledSyntaxKindFeatures[kind] |= 1; + } + function isSubstitutionEnabled(node) { + return (enabledSyntaxKindFeatures[node.kind] & 1) !== 0 && (getEmitFlags(node) & 8) === 0; + } + function substituteNode(hint, node) { + Debug.assert(state < 3, "Cannot substitute a node after the result is disposed."); + return node && isSubstitutionEnabled(node) && onSubstituteNode(hint, node) || node; + } + function enableEmitNotification(kind) { + Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + enabledSyntaxKindFeatures[kind] |= 2; + } + function isEmitNotificationEnabled(node) { + return (enabledSyntaxKindFeatures[node.kind] & 2) !== 0 || (getEmitFlags(node) & 4) !== 0; + } + function emitNodeWithNotification(hint, node, emitCallback) { + Debug.assert(state < 3, "Cannot invoke TransformationResult callbacks after the result is disposed."); + if (node) { + if (isEmitNotificationEnabled(node)) { + onEmitNode(hint, node, emitCallback); + } else { + emitCallback(hint, node); + } + } + } + function hoistVariableDeclaration(name2) { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + const decl = setEmitFlags( + factory2.createVariableDeclaration(name2), + 128 + /* NoNestedSourceMaps */ + ); + if (!lexicalEnvironmentVariableDeclarations) { + lexicalEnvironmentVariableDeclarations = [decl]; + } else { + lexicalEnvironmentVariableDeclarations.push(decl); + } + if (lexicalEnvironmentFlags & 1) { + lexicalEnvironmentFlags |= 2; + } + } + function hoistFunctionDeclaration(func) { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + setEmitFlags( + func, + 2097152 + /* CustomPrologue */ + ); + if (!lexicalEnvironmentFunctionDeclarations) { + lexicalEnvironmentFunctionDeclarations = [func]; + } else { + lexicalEnvironmentFunctionDeclarations.push(func); + } + } + function addInitializationStatement(node) { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + setEmitFlags( + node, + 2097152 + /* CustomPrologue */ + ); + if (!lexicalEnvironmentStatements) { + lexicalEnvironmentStatements = [node]; + } else { + lexicalEnvironmentStatements.push(node); + } + } + function startLexicalEnvironment() { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); + lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentVariableDeclarations; + lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFunctionDeclarations; + lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentStatements; + lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset] = lexicalEnvironmentFlags; + lexicalEnvironmentStackOffset++; + lexicalEnvironmentVariableDeclarations = void 0; + lexicalEnvironmentFunctionDeclarations = void 0; + lexicalEnvironmentStatements = void 0; + lexicalEnvironmentFlags = 0; + } + function suspendLexicalEnvironment() { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is already suspended."); + lexicalEnvironmentSuspended = true; + } + function resumeLexicalEnvironment() { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + Debug.assert(lexicalEnvironmentSuspended, "Lexical environment is not suspended."); + lexicalEnvironmentSuspended = false; + } + function endLexicalEnvironment() { + Debug.assert(state > 0, "Cannot modify the lexical environment during initialization."); + Debug.assert(state < 2, "Cannot modify the lexical environment after transformation has completed."); + Debug.assert(!lexicalEnvironmentSuspended, "Lexical environment is suspended."); + let statements; + if (lexicalEnvironmentVariableDeclarations || lexicalEnvironmentFunctionDeclarations || lexicalEnvironmentStatements) { + if (lexicalEnvironmentFunctionDeclarations) { + statements = [...lexicalEnvironmentFunctionDeclarations]; + } + if (lexicalEnvironmentVariableDeclarations) { + const statement = factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList(lexicalEnvironmentVariableDeclarations) + ); + setEmitFlags( + statement, + 2097152 + /* CustomPrologue */ + ); + if (!statements) { + statements = [statement]; + } else { + statements.push(statement); + } + } + if (lexicalEnvironmentStatements) { + if (!statements) { + statements = [...lexicalEnvironmentStatements]; + } else { + statements = [...statements, ...lexicalEnvironmentStatements]; + } + } + } + lexicalEnvironmentStackOffset--; + lexicalEnvironmentVariableDeclarations = lexicalEnvironmentVariableDeclarationsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentFunctionDeclarations = lexicalEnvironmentFunctionDeclarationsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentStatements = lexicalEnvironmentStatementsStack[lexicalEnvironmentStackOffset]; + lexicalEnvironmentFlags = lexicalEnvironmentFlagsStack[lexicalEnvironmentStackOffset]; + if (lexicalEnvironmentStackOffset === 0) { + lexicalEnvironmentVariableDeclarationsStack = []; + lexicalEnvironmentFunctionDeclarationsStack = []; + lexicalEnvironmentStatementsStack = []; + lexicalEnvironmentFlagsStack = []; + } + return statements; + } + function setLexicalEnvironmentFlags(flags, value2) { + lexicalEnvironmentFlags = value2 ? lexicalEnvironmentFlags | flags : lexicalEnvironmentFlags & ~flags; + } + function getLexicalEnvironmentFlags() { + return lexicalEnvironmentFlags; + } + function startBlockScope() { + Debug.assert(state > 0, "Cannot start a block scope during initialization."); + Debug.assert(state < 2, "Cannot start a block scope after transformation has completed."); + blockScopedVariableDeclarationsStack[blockScopeStackOffset] = blockScopedVariableDeclarations; + blockScopeStackOffset++; + blockScopedVariableDeclarations = void 0; + } + function endBlockScope() { + Debug.assert(state > 0, "Cannot end a block scope during initialization."); + Debug.assert(state < 2, "Cannot end a block scope after transformation has completed."); + const statements = some2(blockScopedVariableDeclarations) ? [ + factory2.createVariableStatement( + /*modifiers*/ + void 0, + factory2.createVariableDeclarationList( + blockScopedVariableDeclarations.map((identifier) => factory2.createVariableDeclaration(identifier)), + 1 + /* Let */ + ) + ) + ] : void 0; + blockScopeStackOffset--; + blockScopedVariableDeclarations = blockScopedVariableDeclarationsStack[blockScopeStackOffset]; + if (blockScopeStackOffset === 0) { + blockScopedVariableDeclarationsStack = []; + } + return statements; + } + function addBlockScopedVariable(name2) { + Debug.assert(blockScopeStackOffset > 0, "Cannot add a block scoped variable outside of an iteration body."); + (blockScopedVariableDeclarations || (blockScopedVariableDeclarations = [])).push(name2); + } + function requestEmitHelper(helper) { + Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + Debug.assert(!helper.scoped, "Cannot request a scoped emit helper."); + if (helper.dependencies) { + for (const h8 of helper.dependencies) { + requestEmitHelper(h8); + } + } + emitHelpers = append(emitHelpers, helper); + } + function readEmitHelpers() { + Debug.assert(state > 0, "Cannot modify the transformation context during initialization."); + Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed."); + const helpers = emitHelpers; + emitHelpers = void 0; + return helpers; + } + function dispose() { + if (state < 3) { + for (const node of nodes) { + disposeEmitNodes(getSourceFileOfNode(getParseTreeNode(node))); + } + lexicalEnvironmentVariableDeclarations = void 0; + lexicalEnvironmentVariableDeclarationsStack = void 0; + lexicalEnvironmentFunctionDeclarations = void 0; + lexicalEnvironmentFunctionDeclarationsStack = void 0; + onSubstituteNode = void 0; + onEmitNode = void 0; + emitHelpers = void 0; + state = 3; + } + } + } + var noTransformers, nullTransformationContext; + var init_transformer = __esm2({ + "src/compiler/transformer.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + noTransformers = { scriptTransformers: emptyArray, declarationTransformers: emptyArray }; + nullTransformationContext = { + factory, + // eslint-disable-line object-shorthand + getCompilerOptions: () => ({}), + getEmitResolver: notImplemented, + getEmitHost: notImplemented, + getEmitHelperFactory: notImplemented, + startLexicalEnvironment: noop4, + resumeLexicalEnvironment: noop4, + suspendLexicalEnvironment: noop4, + endLexicalEnvironment: returnUndefined, + setLexicalEnvironmentFlags: noop4, + getLexicalEnvironmentFlags: () => 0, + hoistVariableDeclaration: noop4, + hoistFunctionDeclaration: noop4, + addInitializationStatement: noop4, + startBlockScope: noop4, + endBlockScope: returnUndefined, + addBlockScopedVariable: noop4, + requestEmitHelper: noop4, + readEmitHelpers: notImplemented, + enableSubstitution: noop4, + enableEmitNotification: noop4, + isSubstitutionEnabled: notImplemented, + isEmitNotificationEnabled: notImplemented, + onSubstituteNode: noEmitSubstitution, + onEmitNode: noEmitNotification, + addDiagnostic: noop4 + }; + } + }); + function isBuildInfoFile(file) { + return fileExtensionIs( + file, + ".tsbuildinfo" + /* TsBuildInfo */ + ); + } + function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDtsEmit = false, onlyBuildInfo, includeBuildInfo) { + const sourceFiles = isArray3(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile, forceDtsEmit); + const options = host.getCompilerOptions(); + if (outFile(options)) { + const prepends = host.getPrependNodes(); + if (sourceFiles.length || prepends.length) { + const bundle = factory.createBundle(sourceFiles, prepends); + const result2 = action(getOutputPathsFor(bundle, host, forceDtsEmit), bundle); + if (result2) { + return result2; + } + } + } else { + if (!onlyBuildInfo) { + for (const sourceFile of sourceFiles) { + const result2 = action(getOutputPathsFor(sourceFile, host, forceDtsEmit), sourceFile); + if (result2) { + return result2; + } + } + } + if (includeBuildInfo) { + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); + if (buildInfoPath) + return action( + { buildInfoPath }, + /*sourceFileOrBundle*/ + void 0 + ); + } + } + } + function getTsBuildInfoEmitOutputFilePath(options) { + const configFile = options.configFilePath; + if (!isIncrementalCompilation(options)) + return void 0; + if (options.tsBuildInfoFile) + return options.tsBuildInfoFile; + const outPath = outFile(options); + let buildInfoExtensionLess; + if (outPath) { + buildInfoExtensionLess = removeFileExtension(outPath); + } else { + if (!configFile) + return void 0; + const configFileExtensionLess = removeFileExtension(configFile); + buildInfoExtensionLess = options.outDir ? options.rootDir ? resolvePath(options.outDir, getRelativePathFromDirectory( + options.rootDir, + configFileExtensionLess, + /*ignoreCase*/ + true + )) : combinePaths(options.outDir, getBaseFileName(configFileExtensionLess)) : configFileExtensionLess; + } + return buildInfoExtensionLess + ".tsbuildinfo"; + } + function getOutputPathsForBundle(options, forceDtsPaths) { + const outPath = outFile(options); + const jsFilePath = options.emitDeclarationOnly ? void 0 : outPath; + const sourceMapFilePath = jsFilePath && getSourceMapFilePath(jsFilePath, options); + const declarationFilePath = forceDtsPaths || getEmitDeclarations(options) ? removeFileExtension(outPath) + ".d.ts" : void 0; + const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); + return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath }; + } + function getOutputPathsFor(sourceFile, host, forceDtsPaths) { + const options = host.getCompilerOptions(); + if (sourceFile.kind === 313) { + return getOutputPathsForBundle(options, forceDtsPaths); + } else { + const ownOutputFilePath = getOwnEmitOutputFilePath(sourceFile.fileName, host, getOutputExtension(sourceFile.fileName, options)); + const isJsonFile = isJsonSourceFile(sourceFile); + const isJsonEmittedToSameLocation = isJsonFile && comparePaths(sourceFile.fileName, ownOutputFilePath, host.getCurrentDirectory(), !host.useCaseSensitiveFileNames()) === 0; + const jsFilePath = options.emitDeclarationOnly || isJsonEmittedToSameLocation ? void 0 : ownOutputFilePath; + const sourceMapFilePath = !jsFilePath || isJsonSourceFile(sourceFile) ? void 0 : getSourceMapFilePath(jsFilePath, options); + const declarationFilePath = forceDtsPaths || getEmitDeclarations(options) && !isJsonFile ? getDeclarationEmitOutputFilePath(sourceFile.fileName, host) : void 0; + const declarationMapPath = declarationFilePath && getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : void 0; + return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath: void 0 }; + } + } + function getSourceMapFilePath(jsFilePath, options) { + return options.sourceMap && !options.inlineSourceMap ? jsFilePath + ".map" : void 0; + } + function getOutputExtension(fileName, options) { + return fileExtensionIs( + fileName, + ".json" + /* Json */ + ) ? ".json" : options.jsx === 1 && fileExtensionIsOneOf(fileName, [ + ".jsx", + ".tsx" + /* Tsx */ + ]) ? ".jsx" : fileExtensionIsOneOf(fileName, [ + ".mts", + ".mjs" + /* Mjs */ + ]) ? ".mjs" : fileExtensionIsOneOf(fileName, [ + ".cts", + ".cjs" + /* Cjs */ + ]) ? ".cjs" : ".js"; + } + function getOutputPathWithoutChangingExt(inputFileName, ignoreCase, outputDir, getCommonSourceDirectory2) { + return outputDir ? resolvePath( + outputDir, + getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase) + ) : inputFileName; + } + function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2 = () => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)) { + return getOutputDeclarationFileNameWorker(inputFileName, configFile.options, ignoreCase, getCommonSourceDirectory2); + } + function getOutputDeclarationFileNameWorker(inputFileName, options, ignoreCase, getCommonSourceDirectory2) { + return changeExtension( + getOutputPathWithoutChangingExt(inputFileName, ignoreCase, options.declarationDir || options.outDir, getCommonSourceDirectory2), + getDeclarationEmitExtensionForPath(inputFileName) + ); + } + function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2 = () => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)) { + if (configFile.options.emitDeclarationOnly) + return void 0; + const isJsonFile = fileExtensionIs( + inputFileName, + ".json" + /* Json */ + ); + const outputFileName = getOutputJSFileNameWorker(inputFileName, configFile.options, ignoreCase, getCommonSourceDirectory2); + return !isJsonFile || comparePaths(inputFileName, outputFileName, Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 ? outputFileName : void 0; + } + function getOutputJSFileNameWorker(inputFileName, options, ignoreCase, getCommonSourceDirectory2) { + return changeExtension( + getOutputPathWithoutChangingExt(inputFileName, ignoreCase, options.outDir, getCommonSourceDirectory2), + getOutputExtension(inputFileName, options) + ); + } + function createAddOutput() { + let outputs; + return { addOutput, getOutputs }; + function addOutput(path2) { + if (path2) { + (outputs || (outputs = [])).push(path2); + } + } + function getOutputs() { + return outputs || emptyArray; + } + } + function getSingleOutputFileNames(configFile, addOutput) { + const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle( + configFile.options, + /*forceDtsPaths*/ + false + ); + addOutput(jsFilePath); + addOutput(sourceMapFilePath); + addOutput(declarationFilePath); + addOutput(declarationMapPath); + addOutput(buildInfoPath); + } + function getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory2) { + if (isDeclarationFileName(inputFileName)) + return; + const js = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + addOutput(js); + if (fileExtensionIs( + inputFileName, + ".json" + /* Json */ + )) + return; + if (js && configFile.options.sourceMap) { + addOutput(`${js}.map`); + } + if (getEmitDeclarations(configFile.options)) { + const dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + addOutput(dts); + if (configFile.options.declarationMap) { + addOutput(`${dts}.map`); + } + } + } + function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { + let commonSourceDirectory; + if (options.rootDir) { + commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, currentDirectory); + checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(options.rootDir); + } else if (options.composite && options.configFilePath) { + commonSourceDirectory = getDirectoryPath(normalizeSlashes(options.configFilePath)); + checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(commonSourceDirectory); + } else { + commonSourceDirectory = computeCommonSourceDirectoryOfFilenames(emittedFiles(), currentDirectory, getCanonicalFileName); + } + if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { + commonSourceDirectory += directorySeparator; + } + return commonSourceDirectory; + } + function getCommonSourceDirectoryOfConfig({ options, fileNames }, ignoreCase) { + return getCommonSourceDirectory( + options, + () => filter2(fileNames, (file) => !(options.noEmitForJsFiles && fileExtensionIsOneOf(file, supportedJSExtensionsFlat)) && !isDeclarationFileName(file)), + getDirectoryPath(normalizeSlashes(Debug.checkDefined(options.configFilePath))), + createGetCanonicalFileName(!ignoreCase) + ); + } + function getAllProjectOutputs(configFile, ignoreCase) { + const { addOutput, getOutputs } = createAddOutput(); + if (outFile(configFile.options)) { + getSingleOutputFileNames(configFile, addOutput); + } else { + const getCommonSourceDirectory2 = memoize2(() => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)); + for (const inputFileName of configFile.fileNames) { + getOwnOutputFileNames(configFile, inputFileName, ignoreCase, addOutput, getCommonSourceDirectory2); + } + addOutput(getTsBuildInfoEmitOutputFilePath(configFile.options)); + } + return getOutputs(); + } + function getOutputFileNames(commandLine, inputFileName, ignoreCase) { + inputFileName = normalizePath(inputFileName); + Debug.assert(contains2(commandLine.fileNames, inputFileName), `Expected fileName to be present in command line`); + const { addOutput, getOutputs } = createAddOutput(); + if (outFile(commandLine.options)) { + getSingleOutputFileNames(commandLine, addOutput); + } else { + getOwnOutputFileNames(commandLine, inputFileName, ignoreCase, addOutput); + } + return getOutputs(); + } + function getFirstProjectOutput(configFile, ignoreCase) { + if (outFile(configFile.options)) { + const { jsFilePath, declarationFilePath } = getOutputPathsForBundle( + configFile.options, + /*forceDtsPaths*/ + false + ); + return Debug.checkDefined(jsFilePath || declarationFilePath, `project ${configFile.options.configFilePath} expected to have at least one output`); + } + const getCommonSourceDirectory2 = memoize2(() => getCommonSourceDirectoryOfConfig(configFile, ignoreCase)); + for (const inputFileName of configFile.fileNames) { + if (isDeclarationFileName(inputFileName)) + continue; + const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + if (jsFilePath) + return jsFilePath; + if (fileExtensionIs( + inputFileName, + ".json" + /* Json */ + )) + continue; + if (getEmitDeclarations(configFile.options)) { + return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2); + } + } + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options); + if (buildInfoPath) + return buildInfoPath; + return Debug.fail(`project ${configFile.options.configFilePath} expected to have at least one output`); + } + function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, declarationTransformers }, emitOnly, onlyBuildInfo, forceDtsEmit) { + var compilerOptions = host.getCompilerOptions(); + var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap || getAreDeclarationMapsEnabled(compilerOptions) ? [] : void 0; + var emittedFilesList = compilerOptions.listEmittedFiles ? [] : void 0; + var emitterDiagnostics = createDiagnosticCollection(); + var newLine = getNewLineCharacter(compilerOptions); + var writer = createTextWriter(newLine); + var { enter, exit: exit3 } = createTimer("printTime", "beforePrint", "afterPrint"); + var bundleBuildInfo; + var emitSkipped = false; + enter(); + forEachEmittedFile( + host, + emitSourceFileOrBundle, + getSourceFilesToEmit(host, targetSourceFile, forceDtsEmit), + forceDtsEmit, + onlyBuildInfo, + !targetSourceFile + ); + exit3(); + return { + emitSkipped, + diagnostics: emitterDiagnostics.getDiagnostics(), + emittedFiles: emittedFilesList, + sourceMaps: sourceMapDataList + }; + function emitSourceFileOrBundle({ jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath }, sourceFileOrBundle) { + var _a2, _b, _c, _d, _e2, _f; + let buildInfoDirectory; + if (buildInfoPath && sourceFileOrBundle && isBundle(sourceFileOrBundle)) { + buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + bundleBuildInfo = { + commonSourceDirectory: relativeToBuildInfo(host.getCommonSourceDirectory()), + sourceFiles: sourceFileOrBundle.sourceFiles.map((file) => relativeToBuildInfo(getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()))) + }; + } + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Emit, "emitJsFileOrBundle", { jsFilePath }); + emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo); + (_b = tracing) == null ? void 0 : _b.pop(); + (_c = tracing) == null ? void 0 : _c.push(tracing.Phase.Emit, "emitDeclarationFileOrBundle", { declarationFilePath }); + emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo); + (_d = tracing) == null ? void 0 : _d.pop(); + (_e2 = tracing) == null ? void 0 : _e2.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath }); + emitBuildInfo(bundleBuildInfo, buildInfoPath); + (_f = tracing) == null ? void 0 : _f.pop(); + function relativeToBuildInfo(path2) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path2, host.getCanonicalFileName)); + } + } + function emitBuildInfo(bundle, buildInfoPath) { + if (!buildInfoPath || targetSourceFile || emitSkipped) + return; + if (host.isEmitBlocked(buildInfoPath)) { + emitSkipped = true; + return; + } + const buildInfo = host.getBuildInfo(bundle) || createBuildInfo( + /*program*/ + void 0, + bundle + ); + writeFile2( + host, + emitterDiagnostics, + buildInfoPath, + getBuildInfoText(buildInfo), + /*writeByteOrderMark*/ + false, + /*sourceFiles*/ + void 0, + { buildInfo } + ); + emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath); + } + function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) { + if (!sourceFileOrBundle || emitOnly || !jsFilePath) { + return; + } + if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit) { + emitSkipped = true; + return; + } + const transform22 = transformNodes( + resolver, + host, + factory, + compilerOptions, + [sourceFileOrBundle], + scriptTransformers, + /*allowDtsFiles*/ + false + ); + const printerOptions = { + removeComments: compilerOptions.removeComments, + newLine: compilerOptions.newLine, + noEmitHelpers: compilerOptions.noEmitHelpers, + module: compilerOptions.module, + target: compilerOptions.target, + sourceMap: compilerOptions.sourceMap, + inlineSourceMap: compilerOptions.inlineSourceMap, + inlineSources: compilerOptions.inlineSources, + extendedDiagnostics: compilerOptions.extendedDiagnostics, + writeBundleFileInfo: !!bundleBuildInfo, + relativeToBuildInfo + }; + const printer = createPrinter(printerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: transform22.emitNodeWithNotification, + isEmitNotificationEnabled: transform22.isEmitNotificationEnabled, + substituteNode: transform22.substituteNode + }); + Debug.assert(transform22.transformed.length === 1, "Should only see one output from the transform"); + printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform22, printer, compilerOptions); + transform22.dispose(); + if (bundleBuildInfo) + bundleBuildInfo.js = printer.bundleFileInfo; + if (emittedFilesList) { + emittedFilesList.push(jsFilePath); + if (sourceMapFilePath) { + emittedFilesList.push(sourceMapFilePath); + } + } + } + function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) { + if (!sourceFileOrBundle || emitOnly === 0) + return; + if (!declarationFilePath) { + if (emitOnly || compilerOptions.emitDeclarationOnly) + emitSkipped = true; + return; + } + const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles; + const filesForEmit = forceDtsEmit ? sourceFiles : filter2(sourceFiles, isSourceFileNotJson); + const inputListOrBundle = outFile(compilerOptions) ? [factory.createBundle(filesForEmit, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : void 0)] : filesForEmit; + if (emitOnly && !getEmitDeclarations(compilerOptions)) { + filesForEmit.forEach(collectLinkedAliases); + } + const declarationTransform = transformNodes( + resolver, + host, + factory, + compilerOptions, + inputListOrBundle, + declarationTransformers, + /*allowDtsFiles*/ + false + ); + if (length(declarationTransform.diagnostics)) { + for (const diagnostic of declarationTransform.diagnostics) { + emitterDiagnostics.add(diagnostic); + } + } + const declBlocked = !!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit; + emitSkipped = emitSkipped || declBlocked; + if (!declBlocked || forceDtsEmit) { + Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform"); + const printerOptions = { + removeComments: compilerOptions.removeComments, + newLine: compilerOptions.newLine, + noEmitHelpers: true, + module: compilerOptions.module, + target: compilerOptions.target, + sourceMap: !forceDtsEmit && compilerOptions.declarationMap, + inlineSourceMap: compilerOptions.inlineSourceMap, + extendedDiagnostics: compilerOptions.extendedDiagnostics, + onlyPrintJsDocStyle: true, + omitBraceSourceMapPositions: true, + writeBundleFileInfo: !!bundleBuildInfo, + recordInternalSection: !!bundleBuildInfo, + relativeToBuildInfo + }; + const declarationPrinter = createPrinter(printerOptions, { + // resolver hooks + hasGlobalName: resolver.hasGlobalName, + // transform hooks + onEmitNode: declarationTransform.emitNodeWithNotification, + isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled, + substituteNode: declarationTransform.substituteNode + }); + printSourceFileOrBundle( + declarationFilePath, + declarationMapPath, + declarationTransform, + declarationPrinter, + { + sourceMap: printerOptions.sourceMap, + sourceRoot: compilerOptions.sourceRoot, + mapRoot: compilerOptions.mapRoot, + extendedDiagnostics: compilerOptions.extendedDiagnostics + // Explicitly do not passthru either `inline` option + } + ); + if (emittedFilesList) { + emittedFilesList.push(declarationFilePath); + if (declarationMapPath) { + emittedFilesList.push(declarationMapPath); + } + } + if (bundleBuildInfo) + bundleBuildInfo.dts = declarationPrinter.bundleFileInfo; + } + declarationTransform.dispose(); + } + function collectLinkedAliases(node) { + if (isExportAssignment(node)) { + if (node.expression.kind === 80) { + resolver.collectLinkedAliases( + node.expression, + /*setVisibility*/ + true + ); + } + return; + } else if (isExportSpecifier(node)) { + resolver.collectLinkedAliases( + node.propertyName || node.name, + /*setVisibility*/ + true + ); + return; + } + forEachChild(node, collectLinkedAliases); + } + function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, transform22, printer, mapOptions) { + const sourceFileOrBundle = transform22.transformed[0]; + const bundle = sourceFileOrBundle.kind === 313 ? sourceFileOrBundle : void 0; + const sourceFile = sourceFileOrBundle.kind === 312 ? sourceFileOrBundle : void 0; + const sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; + let sourceMapGenerator; + if (shouldEmitSourceMaps(mapOptions, sourceFileOrBundle)) { + sourceMapGenerator = createSourceMapGenerator( + host, + getBaseFileName(normalizeSlashes(jsFilePath)), + getSourceRoot(mapOptions), + getSourceMapDirectory(mapOptions, jsFilePath, sourceFile), + mapOptions + ); + } + if (bundle) { + printer.writeBundle(bundle, writer, sourceMapGenerator); + } else { + printer.writeFile(sourceFile, writer, sourceMapGenerator); + } + let sourceMapUrlPos; + if (sourceMapGenerator) { + if (sourceMapDataList) { + sourceMapDataList.push({ + inputSourceFileNames: sourceMapGenerator.getSources(), + sourceMap: sourceMapGenerator.toJSON() + }); + } + const sourceMappingURL = getSourceMappingURL( + mapOptions, + sourceMapGenerator, + jsFilePath, + sourceMapFilePath, + sourceFile + ); + if (sourceMappingURL) { + if (!writer.isAtStartOfLine()) + writer.rawWrite(newLine); + sourceMapUrlPos = writer.getTextPos(); + writer.writeComment(`//# ${"sourceMappingURL"}=${sourceMappingURL}`); + } + if (sourceMapFilePath) { + const sourceMap = sourceMapGenerator.toString(); + writeFile2( + host, + emitterDiagnostics, + sourceMapFilePath, + sourceMap, + /*writeByteOrderMark*/ + false, + sourceFiles + ); + if (printer.bundleFileInfo) + printer.bundleFileInfo.mapHash = computeSignature(sourceMap, host); + } + } else { + writer.writeLine(); + } + const text = writer.getText(); + writeFile2(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, { sourceMapUrlPos, diagnostics: transform22.diagnostics }); + if (printer.bundleFileInfo) + printer.bundleFileInfo.hash = computeSignature(text, host); + writer.clear(); + } + function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) { + return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 312 || !fileExtensionIs( + sourceFileOrBundle.fileName, + ".json" + /* Json */ + )); + } + function getSourceRoot(mapOptions) { + const sourceRoot = normalizeSlashes(mapOptions.sourceRoot || ""); + return sourceRoot ? ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot; + } + function getSourceMapDirectory(mapOptions, filePath, sourceFile) { + if (mapOptions.sourceRoot) + return host.getCommonSourceDirectory(); + if (mapOptions.mapRoot) { + let sourceMapDir = normalizeSlashes(mapOptions.mapRoot); + if (sourceFile) { + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); + } + if (getRootLength(sourceMapDir) === 0) { + sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + } + return sourceMapDir; + } + return getDirectoryPath(normalizePath(filePath)); + } + function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) { + if (mapOptions.inlineSourceMap) { + const sourceMapText = sourceMapGenerator.toString(); + const base64SourceMapText = base64encode(sys, sourceMapText); + return `data:application/json;base64,${base64SourceMapText}`; + } + const sourceMapFile = getBaseFileName(normalizeSlashes(Debug.checkDefined(sourceMapFilePath))); + if (mapOptions.mapRoot) { + let sourceMapDir = normalizeSlashes(mapOptions.mapRoot); + if (sourceFile) { + sourceMapDir = getDirectoryPath(getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir)); + } + if (getRootLength(sourceMapDir) === 0) { + sourceMapDir = combinePaths(host.getCommonSourceDirectory(), sourceMapDir); + return encodeURI( + getRelativePathToDirectoryOrUrl( + getDirectoryPath(normalizePath(filePath)), + // get the relative sourceMapDir path based on jsFilePath + combinePaths(sourceMapDir, sourceMapFile), + // this is where user expects to see sourceMap + host.getCurrentDirectory(), + host.getCanonicalFileName, + /*isAbsolutePathAnUrl*/ + true + ) + ); + } else { + return encodeURI(combinePaths(sourceMapDir, sourceMapFile)); + } + } + return encodeURI(sourceMapFile); + } + } + function createBuildInfo(program, bundle) { + return { bundle, program, version: version5 }; + } + function getBuildInfoText(buildInfo) { + return JSON.stringify(buildInfo); + } + function getBuildInfo(buildInfoFile, buildInfoText) { + return readJsonOrUndefined(buildInfoFile, buildInfoText); + } + function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) { + var _a2; + const jsBundle = Debug.checkDefined(bundle.js); + const prologueMap = ((_a2 = jsBundle.sources) == null ? void 0 : _a2.prologues) && arrayToMap(jsBundle.sources.prologues, (prologueInfo) => prologueInfo.file); + return bundle.sourceFiles.map((fileName, index4) => { + const prologueInfo = prologueMap == null ? void 0 : prologueMap.get(index4); + const statements = prologueInfo == null ? void 0 : prologueInfo.directives.map((directive) => { + const literal = setTextRange(factory.createStringLiteral(directive.expression.text), directive.expression); + const statement = setTextRange(factory.createExpressionStatement(literal), directive); + setParent(literal, statement); + return statement; + }); + const eofToken = factory.createToken( + 1 + /* EndOfFileToken */ + ); + const sourceFile = factory.createSourceFile( + statements ?? [], + eofToken, + 0 + /* None */ + ); + sourceFile.fileName = getRelativePathFromDirectory( + host.getCurrentDirectory(), + getNormalizedAbsolutePath(fileName, buildInfoDirectory), + !host.useCaseSensitiveFileNames() + ); + sourceFile.text = (prologueInfo == null ? void 0 : prologueInfo.text) ?? ""; + setTextRangePosWidth(sourceFile, 0, (prologueInfo == null ? void 0 : prologueInfo.text.length) ?? 0); + setEachParent(sourceFile.statements, sourceFile); + setTextRangePosWidth(eofToken, sourceFile.end, 0); + setParent(eofToken, sourceFile); + return sourceFile; + }); + } + function emitUsingBuildInfo(config3, host, getCommandLine, customTransformers) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push( + tracing.Phase.Emit, + "emitUsingBuildInfo", + {}, + /*separateBeginAndEnd*/ + true + ); + mark("beforeEmit"); + const result2 = emitUsingBuildInfoWorker(config3, host, getCommandLine, customTransformers); + mark("afterEmit"); + measure("Emit", "beforeEmit", "afterEmit"); + (_b = tracing) == null ? void 0 : _b.pop(); + return result2; + } + function emitUsingBuildInfoWorker(config3, host, getCommandLine, customTransformers) { + const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle( + config3.options, + /*forceDtsPaths*/ + false + ); + const buildInfo = host.getBuildInfo(buildInfoPath, config3.options.configFilePath); + if (!buildInfo) + return buildInfoPath; + if (!buildInfo.bundle || !buildInfo.bundle.js || declarationFilePath && !buildInfo.bundle.dts) + return buildInfoPath; + const jsFileText = host.readFile(Debug.checkDefined(jsFilePath)); + if (!jsFileText) + return jsFilePath; + if (computeSignature(jsFileText, host) !== buildInfo.bundle.js.hash) + return jsFilePath; + const sourceMapText = sourceMapFilePath && host.readFile(sourceMapFilePath); + if (sourceMapFilePath && !sourceMapText || config3.options.inlineSourceMap) + return sourceMapFilePath || "inline sourcemap decoding"; + if (sourceMapFilePath && computeSignature(sourceMapText, host) !== buildInfo.bundle.js.mapHash) + return sourceMapFilePath; + const declarationText = declarationFilePath && host.readFile(declarationFilePath); + if (declarationFilePath && !declarationText) + return declarationFilePath; + if (declarationFilePath && computeSignature(declarationText, host) !== buildInfo.bundle.dts.hash) + return declarationFilePath; + const declarationMapText = declarationMapPath && host.readFile(declarationMapPath); + if (declarationMapPath && !declarationMapText || config3.options.inlineSourceMap) + return declarationMapPath || "inline sourcemap decoding"; + if (declarationMapPath && computeSignature(declarationMapText, host) !== buildInfo.bundle.dts.mapHash) + return declarationMapPath; + const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + const ownPrependInput = createInputFilesWithFileTexts( + jsFilePath, + jsFileText, + sourceMapFilePath, + sourceMapText, + declarationFilePath, + declarationText, + declarationMapPath, + declarationMapText, + buildInfoPath, + buildInfo, + /*oldFileOfCurrentEmit*/ + true + ); + const outputFiles = []; + const prependNodes = createPrependNodes(config3.projectReferences, getCommandLine, (f8) => host.readFile(f8), host); + const sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host); + let changedDtsText; + let changedDtsData; + const emitHost = { + getPrependNodes: memoize2(() => [...prependNodes, ownPrependInput]), + getCanonicalFileName: host.getCanonicalFileName, + getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle.commonSourceDirectory, buildInfoDirectory), + getCompilerOptions: () => config3.options, + getCurrentDirectory: () => host.getCurrentDirectory(), + getSourceFile: returnUndefined, + getSourceFileByPath: returnUndefined, + getSourceFiles: () => sourceFilesForJsEmit, + getLibFileFromReference: notImplemented, + isSourceFileFromExternalLibrary: returnFalse, + getResolvedProjectReferenceToRedirect: returnUndefined, + getProjectReferenceRedirect: returnUndefined, + isSourceOfProjectReferenceRedirect: returnFalse, + writeFile: (name2, text, writeByteOrderMark, _onError, _sourceFiles, data) => { + switch (name2) { + case jsFilePath: + if (jsFileText === text) + return; + break; + case sourceMapFilePath: + if (sourceMapText === text) + return; + break; + case buildInfoPath: + break; + case declarationFilePath: + if (declarationText === text) + return; + changedDtsText = text; + changedDtsData = data; + break; + case declarationMapPath: + if (declarationMapText === text) + return; + break; + default: + Debug.fail(`Unexpected path: ${name2}`); + } + outputFiles.push({ name: name2, text, writeByteOrderMark, data }); + }, + isEmitBlocked: returnFalse, + readFile: (f8) => host.readFile(f8), + fileExists: (f8) => host.fileExists(f8), + useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), + getBuildInfo: (bundle) => { + const program = buildInfo.program; + if (program && changedDtsText !== void 0 && config3.options.composite) { + program.outSignature = computeSignature(changedDtsText, host, changedDtsData); + } + const { js, dts, sourceFiles } = buildInfo.bundle; + bundle.js.sources = js.sources; + if (dts) { + bundle.dts.sources = dts.sources; + } + bundle.sourceFiles = sourceFiles; + return createBuildInfo(program, bundle); + }, + getSourceFileFromReference: returnUndefined, + redirectTargetsMap: createMultiMap(), + getFileIncludeReasons: notImplemented, + createHash: maybeBind(host, host.createHash) + }; + emitFiles( + notImplementedResolver, + emitHost, + /*targetSourceFile*/ + void 0, + getTransformers(config3.options, customTransformers) + ); + return outputFiles; + } + function createPrinter(printerOptions = {}, handlers = {}) { + var { + hasGlobalName, + onEmitNode = noEmitNotification, + isEmitNotificationEnabled, + substituteNode = noEmitSubstitution, + onBeforeEmitNode, + onAfterEmitNode, + onBeforeEmitNodeArray, + onAfterEmitNodeArray, + onBeforeEmitToken, + onAfterEmitToken + } = handlers; + var extendedDiagnostics = !!printerOptions.extendedDiagnostics; + var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions; + var newLine = getNewLineCharacter(printerOptions); + var moduleKind = getEmitModuleKind(printerOptions); + var bundledHelpers = /* @__PURE__ */ new Map(); + var currentSourceFile; + var nodeIdToGeneratedName; + var nodeIdToGeneratedPrivateName; + var autoGeneratedIdToGeneratedName; + var generatedNames; + var formattedNameTempFlagsStack; + var formattedNameTempFlags; + var privateNameTempFlagsStack; + var privateNameTempFlags; + var tempFlagsStack; + var tempFlags; + var reservedNamesStack; + var reservedNames; + var reservedPrivateNamesStack; + var reservedPrivateNames; + var preserveSourceNewlines = printerOptions.preserveSourceNewlines; + var nextListElementPos; + var writer; + var ownWriter; + var write = writeBase; + var isOwnFileEmit; + var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; + var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; + var recordInternalSection = printerOptions.recordInternalSection; + var sourceFileTextPos = 0; + var sourceFileTextKind = "text"; + var sourceMapsDisabled = true; + var sourceMapGenerator; + var sourceMapSource; + var sourceMapSourceIndex = -1; + var mostRecentlyAddedSourceMapSource; + var mostRecentlyAddedSourceMapSourceIndex = -1; + var containerPos = -1; + var containerEnd = -1; + var declarationListContainerEnd = -1; + var currentLineMap; + var detachedCommentsInfo; + var hasWrittenComment = false; + var commentsDisabled = !!printerOptions.removeComments; + var lastSubstitution; + var currentParenthesizerRule; + var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); + var parenthesizer = factory.parenthesizer; + var typeArgumentParenthesizerRuleSelector = { + select: (index4) => index4 === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 + }; + var emitBinaryExpression = createEmitBinaryExpression(); + reset2(); + return { + // public API + printNode, + printList, + printFile, + printBundle, + // internal API + writeNode: writeNode2, + writeList, + writeFile: writeFile22, + writeBundle, + bundleFileInfo + }; + function printNode(hint, node, sourceFile) { + switch (hint) { + case 0: + Debug.assert(isSourceFile(node), "Expected a SourceFile node."); + break; + case 2: + Debug.assert(isIdentifier(node), "Expected an Identifier node."); + break; + case 1: + Debug.assert(isExpression(node), "Expected an Expression node."); + break; + } + switch (node.kind) { + case 312: + return printFile(node); + case 313: + return printBundle(node); + case 314: + return printUnparsedSource(node); + } + writeNode2(hint, node, sourceFile, beginPrint()); + return endPrint(); + } + function printList(format5, nodes, sourceFile) { + writeList(format5, nodes, sourceFile, beginPrint()); + return endPrint(); + } + function printBundle(bundle) { + writeBundle( + bundle, + beginPrint(), + /*sourceMapGenerator*/ + void 0 + ); + return endPrint(); + } + function printFile(sourceFile) { + writeFile22( + sourceFile, + beginPrint(), + /*sourceMapGenerator*/ + void 0 + ); + return endPrint(); + } + function printUnparsedSource(unparsed) { + writeUnparsedSource(unparsed, beginPrint()); + return endPrint(); + } + function writeNode2(hint, node, sourceFile, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print(hint, node, sourceFile); + reset2(); + writer = previousWriter; + } + function writeList(format5, nodes, sourceFile, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList( + /*parentNode*/ + void 0, + nodes, + format5 + ); + reset2(); + writer = previousWriter; + } + function getTextPosWithWriteLine() { + return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos(); + } + function updateOrPushBundleFileTextLike(pos, end, kind) { + const last22 = lastOrUndefined(bundleFileInfo.sections); + if (last22 && last22.kind === kind) { + last22.end = end; + } else { + bundleFileInfo.sections.push({ pos, end, kind }); + } + } + function recordBundleFileInternalSectionStart(node) { + if (recordInternalSection && bundleFileInfo && currentSourceFile && (isDeclaration(node) || isVariableStatement(node)) && isInternalDeclaration(node, currentSourceFile) && sourceFileTextKind !== "internal") { + const prevSourceFileTextKind = sourceFileTextKind; + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = "internal"; + return prevSourceFileTextKind; + } + return void 0; + } + function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) { + if (prevSourceFileTextKind) { + recordBundleFileTextLikeSection(writer.getTextPos()); + sourceFileTextPos = getTextPosWithWriteLine(); + sourceFileTextKind = prevSourceFileTextKind; + } + } + function recordBundleFileTextLikeSection(end) { + if (sourceFileTextPos < end) { + updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind); + return true; + } + return false; + } + function writeBundle(bundle, output, sourceMapGenerator2) { + isOwnFileEmit = false; + const previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(bundle); + emitPrologueDirectivesIfNeeded(bundle); + emitHelpers(bundle); + emitSyntheticTripleSlashReferencesIfNeeded(bundle); + for (const prepend of bundle.prepends) { + writeLine(); + const pos = writer.getTextPos(); + const savedSections = bundleFileInfo && bundleFileInfo.sections; + if (savedSections) + bundleFileInfo.sections = []; + print( + 4, + prepend, + /*sourceFile*/ + void 0 + ); + if (bundleFileInfo) { + const newSections = bundleFileInfo.sections; + bundleFileInfo.sections = savedSections; + if (prepend.oldFileOfCurrentEmit) + bundleFileInfo.sections.push(...newSections); + else { + newSections.forEach((section) => Debug.assert(isBundleFileTextLike(section))); + bundleFileInfo.sections.push({ + pos, + end: writer.getTextPos(), + kind: "prepend", + data: relativeToBuildInfo(prepend.fileName), + texts: newSections + }); + } + } + } + sourceFileTextPos = getTextPosWithWriteLine(); + for (const sourceFile of bundle.sourceFiles) { + print(0, sourceFile, sourceFile); + } + if (bundleFileInfo && bundle.sourceFiles.length) { + const end = writer.getTextPos(); + if (recordBundleFileTextLikeSection(end)) { + const prologues = getPrologueDirectivesFromBundledSourceFiles(bundle); + if (prologues) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.prologues = prologues; + } + const helpers = getHelpersFromBundledSourceFiles(bundle); + if (helpers) { + if (!bundleFileInfo.sources) + bundleFileInfo.sources = {}; + bundleFileInfo.sources.helpers = helpers; + } + } + } + reset2(); + writer = previousWriter; + } + function writeUnparsedSource(unparsed, output) { + const previousWriter = writer; + setWriter( + output, + /*_sourceMapGenerator*/ + void 0 + ); + print( + 4, + unparsed, + /*sourceFile*/ + void 0 + ); + reset2(); + writer = previousWriter; + } + function writeFile22(sourceFile, output, sourceMapGenerator2) { + isOwnFileEmit = true; + const previousWriter = writer; + setWriter(output, sourceMapGenerator2); + emitShebangIfNeeded(sourceFile); + emitPrologueDirectivesIfNeeded(sourceFile); + print(0, sourceFile, sourceFile); + reset2(); + writer = previousWriter; + } + function beginPrint() { + return ownWriter || (ownWriter = createTextWriter(newLine)); + } + function endPrint() { + const text = ownWriter.getText(); + ownWriter.clear(); + return text; + } + function print(hint, node, sourceFile) { + if (sourceFile) { + setSourceFile(sourceFile); + } + pipelineEmit( + hint, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function setSourceFile(sourceFile) { + currentSourceFile = sourceFile; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + if (sourceFile) { + setSourceMapSource(sourceFile); + } + } + function setWriter(_writer, _sourceMapGenerator) { + if (_writer && printerOptions.omitTrailingSemicolon) { + _writer = getTrailingSemicolonDeferringWriter(_writer); + } + writer = _writer; + sourceMapGenerator = _sourceMapGenerator; + sourceMapsDisabled = !writer || !sourceMapGenerator; + } + function reset2() { + nodeIdToGeneratedName = []; + nodeIdToGeneratedPrivateName = []; + autoGeneratedIdToGeneratedName = []; + generatedNames = /* @__PURE__ */ new Set(); + formattedNameTempFlagsStack = []; + formattedNameTempFlags = /* @__PURE__ */ new Map(); + privateNameTempFlagsStack = []; + privateNameTempFlags = 0; + tempFlagsStack = []; + tempFlags = 0; + reservedNamesStack = []; + reservedNames = void 0; + reservedPrivateNamesStack = []; + reservedPrivateNames = void 0; + currentSourceFile = void 0; + currentLineMap = void 0; + detachedCommentsInfo = void 0; + setWriter( + /*output*/ + void 0, + /*_sourceMapGenerator*/ + void 0 + ); + } + function getCurrentLineMap() { + return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); + } + function emit3(node, parenthesizerRule) { + if (node === void 0) + return; + const prevSourceFileTextKind = recordBundleFileInternalSectionStart(node); + pipelineEmit(4, node, parenthesizerRule); + recordBundleFileInternalSectionEnd(prevSourceFileTextKind); + } + function emitIdentifierName(node) { + if (node === void 0) + return; + pipelineEmit( + 2, + node, + /*parenthesizerRule*/ + void 0 + ); + } + function emitExpression(node, parenthesizerRule) { + if (node === void 0) + return; + pipelineEmit(1, node, parenthesizerRule); + } + function emitJsxAttributeValue(node) { + pipelineEmit(isStringLiteral(node) ? 6 : 4, node); + } + function beforeEmitNode(node) { + if (preserveSourceNewlines && getInternalEmitFlags(node) & 4) { + preserveSourceNewlines = false; + } + } + function afterEmitNode(savedPreserveSourceNewlines) { + preserveSourceNewlines = savedPreserveSourceNewlines; + } + function pipelineEmit(emitHint, node, parenthesizerRule) { + currentParenthesizerRule = parenthesizerRule; + const pipelinePhase = getPipelinePhase(0, emitHint, node); + pipelinePhase(emitHint, node); + currentParenthesizerRule = void 0; + } + function shouldEmitComments(node) { + return !commentsDisabled && !isSourceFile(node); + } + function shouldEmitSourceMaps(node) { + return !sourceMapsDisabled && !isSourceFile(node) && !isInJsonFile(node) && !isUnparsedSource(node) && !isUnparsedPrepend(node); + } + function getPipelinePhase(phase, emitHint, node) { + switch (phase) { + case 0: + if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { + return pipelineEmitWithNotification; + } + case 1: + if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { + if (currentParenthesizerRule) { + lastSubstitution = currentParenthesizerRule(lastSubstitution); + } + return pipelineEmitWithSubstitution; + } + case 2: + if (shouldEmitComments(node)) { + return pipelineEmitWithComments; + } + case 3: + if (shouldEmitSourceMaps(node)) { + return pipelineEmitWithSourceMaps; + } + case 4: + return pipelineEmitWithHint; + default: + return Debug.assertNever(phase); + } + } + function getNextPipelinePhase(currentPhase, emitHint, node) { + return getPipelinePhase(currentPhase + 1, emitHint, node); + } + function pipelineEmitWithNotification(hint, node) { + const pipelinePhase = getNextPipelinePhase(0, hint, node); + onEmitNode(hint, node, pipelinePhase); + } + function pipelineEmitWithHint(hint, node) { + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); + if (preserveSourceNewlines) { + const savedPreserveSourceNewlines = preserveSourceNewlines; + beforeEmitNode(node); + pipelineEmitWithHintWorker(hint, node); + afterEmitNode(savedPreserveSourceNewlines); + } else { + pipelineEmitWithHintWorker(hint, node); + } + onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); + currentParenthesizerRule = void 0; + } + function pipelineEmitWithHintWorker(hint, node, allowSnippets = true) { + if (allowSnippets) { + const snippet2 = getSnippetElement(node); + if (snippet2) { + return emitSnippetNode(hint, node, snippet2); + } + } + if (hint === 0) + return emitSourceFile(cast(node, isSourceFile)); + if (hint === 2) + return emitIdentifier(cast(node, isIdentifier)); + if (hint === 6) + return emitLiteral( + cast(node, isStringLiteral), + /*jsxAttributeEscape*/ + true + ); + if (hint === 3) + return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration)); + if (hint === 7) + return emitImportTypeNodeAttributes(cast(node, isImportAttributes)); + if (hint === 5) { + Debug.assertNode(node, isEmptyStatement); + return emitEmptyStatement( + /*isEmbeddedStatement*/ + true + ); + } + if (hint === 4) { + switch (node.kind) { + case 16: + case 17: + case 18: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 80: + return emitIdentifier(node); + case 81: + return emitPrivateIdentifier(node); + case 166: + return emitQualifiedName(node); + case 167: + return emitComputedPropertyName(node); + case 168: + return emitTypeParameter(node); + case 169: + return emitParameter(node); + case 170: + return emitDecorator(node); + case 171: + return emitPropertySignature(node); + case 172: + return emitPropertyDeclaration(node); + case 173: + return emitMethodSignature(node); + case 174: + return emitMethodDeclaration(node); + case 175: + return emitClassStaticBlockDeclaration(node); + case 176: + return emitConstructor(node); + case 177: + case 178: + return emitAccessorDeclaration(node); + case 179: + return emitCallSignature(node); + case 180: + return emitConstructSignature(node); + case 181: + return emitIndexSignature(node); + case 182: + return emitTypePredicate(node); + case 183: + return emitTypeReference(node); + case 184: + return emitFunctionType(node); + case 185: + return emitConstructorType(node); + case 186: + return emitTypeQuery(node); + case 187: + return emitTypeLiteral(node); + case 188: + return emitArrayType(node); + case 189: + return emitTupleType(node); + case 190: + return emitOptionalType(node); + case 192: + return emitUnionType(node); + case 193: + return emitIntersectionType(node); + case 194: + return emitConditionalType(node); + case 195: + return emitInferType(node); + case 196: + return emitParenthesizedType(node); + case 233: + return emitExpressionWithTypeArguments(node); + case 197: + return emitThisType(); + case 198: + return emitTypeOperator(node); + case 199: + return emitIndexedAccessType(node); + case 200: + return emitMappedType(node); + case 201: + return emitLiteralType(node); + case 202: + return emitNamedTupleMember(node); + case 203: + return emitTemplateType(node); + case 204: + return emitTemplateTypeSpan(node); + case 205: + return emitImportTypeNode(node); + case 206: + return emitObjectBindingPattern(node); + case 207: + return emitArrayBindingPattern(node); + case 208: + return emitBindingElement(node); + case 239: + return emitTemplateSpan(node); + case 240: + return emitSemicolonClassElement(); + case 241: + return emitBlock(node); + case 243: + return emitVariableStatement(node); + case 242: + return emitEmptyStatement( + /*isEmbeddedStatement*/ + false + ); + case 244: + return emitExpressionStatement(node); + case 245: + return emitIfStatement(node); + case 246: + return emitDoStatement(node); + case 247: + return emitWhileStatement(node); + case 248: + return emitForStatement(node); + case 249: + return emitForInStatement(node); + case 250: + return emitForOfStatement(node); + case 251: + return emitContinueStatement(node); + case 252: + return emitBreakStatement(node); + case 253: + return emitReturnStatement(node); + case 254: + return emitWithStatement(node); + case 255: + return emitSwitchStatement(node); + case 256: + return emitLabeledStatement(node); + case 257: + return emitThrowStatement(node); + case 258: + return emitTryStatement(node); + case 259: + return emitDebuggerStatement(node); + case 260: + return emitVariableDeclaration(node); + case 261: + return emitVariableDeclarationList(node); + case 262: + return emitFunctionDeclaration(node); + case 263: + return emitClassDeclaration(node); + case 264: + return emitInterfaceDeclaration(node); + case 265: + return emitTypeAliasDeclaration(node); + case 266: + return emitEnumDeclaration(node); + case 267: + return emitModuleDeclaration(node); + case 268: + return emitModuleBlock(node); + case 269: + return emitCaseBlock(node); + case 270: + return emitNamespaceExportDeclaration(node); + case 271: + return emitImportEqualsDeclaration(node); + case 272: + return emitImportDeclaration(node); + case 273: + return emitImportClause(node); + case 274: + return emitNamespaceImport(node); + case 280: + return emitNamespaceExport(node); + case 275: + return emitNamedImports(node); + case 276: + return emitImportSpecifier(node); + case 277: + return emitExportAssignment(node); + case 278: + return emitExportDeclaration(node); + case 279: + return emitNamedExports(node); + case 281: + return emitExportSpecifier(node); + case 300: + return emitImportAttributes(node); + case 301: + return emitImportAttribute(node); + case 282: + return; + case 283: + return emitExternalModuleReference(node); + case 12: + return emitJsxText(node); + case 286: + case 289: + return emitJsxOpeningElementOrFragment(node); + case 287: + case 290: + return emitJsxClosingElementOrFragment(node); + case 291: + return emitJsxAttribute(node); + case 292: + return emitJsxAttributes(node); + case 293: + return emitJsxSpreadAttribute(node); + case 294: + return emitJsxExpression(node); + case 295: + return emitJsxNamespacedName(node); + case 296: + return emitCaseClause(node); + case 297: + return emitDefaultClause(node); + case 298: + return emitHeritageClause(node); + case 299: + return emitCatchClause(node); + case 303: + return emitPropertyAssignment(node); + case 304: + return emitShorthandPropertyAssignment(node); + case 305: + return emitSpreadAssignment(node); + case 306: + return emitEnumMember(node); + case 307: + return writeUnparsedNode(node); + case 314: + case 308: + return emitUnparsedSourceOrPrepend(node); + case 309: + case 310: + return emitUnparsedTextLike(node); + case 311: + return emitUnparsedSyntheticReference(node); + case 312: + return emitSourceFile(node); + case 313: + return Debug.fail("Bundles should be printed using printBundle"); + case 315: + return Debug.fail("InputFiles should not be printed"); + case 316: + return emitJSDocTypeExpression(node); + case 317: + return emitJSDocNameReference(node); + case 319: + return writePunctuation("*"); + case 320: + return writePunctuation("?"); + case 321: + return emitJSDocNullableType(node); + case 322: + return emitJSDocNonNullableType(node); + case 323: + return emitJSDocOptionalType(node); + case 324: + return emitJSDocFunctionType(node); + case 191: + case 325: + return emitRestOrJSDocVariadicType(node); + case 326: + return; + case 327: + return emitJSDoc(node); + case 329: + return emitJSDocTypeLiteral(node); + case 330: + return emitJSDocSignature(node); + case 334: + case 339: + case 344: + return emitJSDocSimpleTag(node); + case 335: + case 336: + return emitJSDocHeritageTag(node); + case 337: + case 338: + return; + case 340: + case 341: + case 342: + case 343: + return; + case 345: + return emitJSDocCallbackTag(node); + case 346: + return emitJSDocOverloadTag(node); + case 348: + case 355: + return emitJSDocPropertyLikeTag(node); + case 347: + case 349: + case 350: + case 351: + case 356: + case 357: + return emitJSDocSimpleTypedTag(node); + case 352: + return emitJSDocTemplateTag(node); + case 353: + return emitJSDocTypedefTag(node); + case 354: + return emitJSDocSeeTag(node); + case 359: + return; + } + if (isExpression(node)) { + hint = 1; + if (substituteNode !== noEmitSubstitution) { + const substitute = substituteNode(hint, node) || node; + if (substitute !== node) { + node = substitute; + if (currentParenthesizerRule) { + node = currentParenthesizerRule(node); + } + } + } + } + } + if (hint === 1) { + switch (node.kind) { + case 9: + case 10: + return emitNumericOrBigIntLiteral(node); + case 11: + case 14: + case 15: + return emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + case 80: + return emitIdentifier(node); + case 81: + return emitPrivateIdentifier(node); + case 209: + return emitArrayLiteralExpression(node); + case 210: + return emitObjectLiteralExpression(node); + case 211: + return emitPropertyAccessExpression(node); + case 212: + return emitElementAccessExpression(node); + case 213: + return emitCallExpression(node); + case 214: + return emitNewExpression(node); + case 215: + return emitTaggedTemplateExpression(node); + case 216: + return emitTypeAssertionExpression(node); + case 217: + return emitParenthesizedExpression(node); + case 218: + return emitFunctionExpression(node); + case 219: + return emitArrowFunction(node); + case 220: + return emitDeleteExpression(node); + case 221: + return emitTypeOfExpression(node); + case 222: + return emitVoidExpression(node); + case 223: + return emitAwaitExpression(node); + case 224: + return emitPrefixUnaryExpression(node); + case 225: + return emitPostfixUnaryExpression(node); + case 226: + return emitBinaryExpression(node); + case 227: + return emitConditionalExpression(node); + case 228: + return emitTemplateExpression(node); + case 229: + return emitYieldExpression(node); + case 230: + return emitSpreadElement(node); + case 231: + return emitClassExpression(node); + case 232: + return; + case 234: + return emitAsExpression(node); + case 235: + return emitNonNullExpression(node); + case 233: + return emitExpressionWithTypeArguments(node); + case 238: + return emitSatisfiesExpression(node); + case 236: + return emitMetaProperty(node); + case 237: + return Debug.fail("SyntheticExpression should never be printed."); + case 282: + return; + case 284: + return emitJsxElement(node); + case 285: + return emitJsxSelfClosingElement(node); + case 288: + return emitJsxFragment(node); + case 358: + return Debug.fail("SyntaxList should not be printed"); + case 359: + return; + case 360: + return emitPartiallyEmittedExpression(node); + case 361: + return emitCommaList(node); + case 362: + return Debug.fail("SyntheticReferenceExpression should not be printed"); + } + } + if (isKeyword(node.kind)) + return writeTokenNode(node, writeKeyword); + if (isTokenKind(node.kind)) + return writeTokenNode(node, writePunctuation); + Debug.fail(`Unhandled SyntaxKind: ${Debug.formatSyntaxKind(node.kind)}.`); + } + function emitMappedTypeParameter(node) { + emit3(node.name); + writeSpace(); + writeKeyword("in"); + writeSpace(); + emit3(node.constraint); + } + function pipelineEmitWithSubstitution(hint, node) { + const pipelinePhase = getNextPipelinePhase(1, hint, node); + Debug.assertIsDefined(lastSubstitution); + node = lastSubstitution; + lastSubstitution = void 0; + pipelinePhase(hint, node); + } + function getHelpersFromBundledSourceFiles(bundle) { + let result2; + if (moduleKind === 0 || printerOptions.noEmitHelpers) { + return void 0; + } + const bundledHelpers2 = /* @__PURE__ */ new Map(); + for (const sourceFile of bundle.sourceFiles) { + const shouldSkip = getExternalHelpersModuleName(sourceFile) !== void 0; + const helpers = getSortedEmitHelpers(sourceFile); + if (!helpers) + continue; + for (const helper of helpers) { + if (!helper.scoped && !shouldSkip && !bundledHelpers2.get(helper.name)) { + bundledHelpers2.set(helper.name, true); + (result2 || (result2 = [])).push(helper.name); + } + } + } + return result2; + } + function emitHelpers(node) { + let helpersEmitted = false; + const bundle = node.kind === 313 ? node : void 0; + if (bundle && moduleKind === 0) { + return; + } + const numPrepends = bundle ? bundle.prepends.length : 0; + const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; + for (let i7 = 0; i7 < numNodes; i7++) { + const currentNode = bundle ? i7 < numPrepends ? bundle.prepends[i7] : bundle.sourceFiles[i7 - numPrepends] : node; + const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? void 0 : currentSourceFile; + const shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && hasRecordedExternalHelpers(sourceFile); + const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit; + const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); + if (helpers) { + for (const helper of helpers) { + if (!helper.scoped) { + if (shouldSkip) + continue; + if (shouldBundle) { + if (bundledHelpers.get(helper.name)) { + continue; + } + bundledHelpers.set(helper.name, true); + } + } else if (bundle) { + continue; + } + const pos = getTextPosWithWriteLine(); + if (typeof helper.text === "string") { + writeLines(helper.text); + } else { + writeLines(helper.text(makeFileLevelOptimisticUniqueName)); + } + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "emitHelpers", data: helper.name }); + helpersEmitted = true; + } + } + } + return helpersEmitted; + } + function getSortedEmitHelpers(node) { + const helpers = getEmitHelpers(node); + return helpers && stableSort(helpers, compareEmitHelpers); + } + function emitNumericOrBigIntLiteral(node) { + emitLiteral( + node, + /*jsxAttributeEscape*/ + false + ); + } + function emitLiteral(node, jsxAttributeEscape) { + const text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape); + if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 11 || isTemplateLiteralKind(node.kind))) { + writeLiteral(text); + } else { + writeStringLiteral(text); + } + } + function emitUnparsedSourceOrPrepend(unparsed) { + for (const text of unparsed.texts) { + writeLine(); + emit3(text); + } + } + function writeUnparsedNode(unparsed) { + writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end)); + } + function emitUnparsedTextLike(unparsed) { + const pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + updateOrPushBundleFileTextLike( + pos, + writer.getTextPos(), + unparsed.kind === 309 ? "text" : "internal" + /* Internal */ + ); + } + } + function emitUnparsedSyntheticReference(unparsed) { + const pos = getTextPosWithWriteLine(); + writeUnparsedNode(unparsed); + if (bundleFileInfo) { + const section = clone2(unparsed.section); + section.pos = pos; + section.end = writer.getTextPos(); + bundleFileInfo.sections.push(section); + } + } + function emitSnippetNode(hint, node, snippet2) { + switch (snippet2.kind) { + case 1: + emitPlaceholder(hint, node, snippet2); + break; + case 0: + emitTabStop(hint, node, snippet2); + break; + } + } + function emitPlaceholder(hint, node, snippet2) { + nonEscapingWrite(`\${${snippet2.order}:`); + pipelineEmitWithHintWorker( + hint, + node, + /*allowSnippets*/ + false + ); + nonEscapingWrite(`}`); + } + function emitTabStop(hint, node, snippet2) { + Debug.assert(node.kind === 242, `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.`); + Debug.assert(hint !== 5, `A tab stop cannot be attached to an embedded statement.`); + nonEscapingWrite(`$${snippet2.order}`); + } + function emitIdentifier(node) { + const writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode2( + node, + /*includeTrivia*/ + false + ), node.symbol); + emitList( + node, + getIdentifierTypeArguments(node), + 53776 + /* TypeParameters */ + ); + } + function emitPrivateIdentifier(node) { + write(getTextOfNode2( + node, + /*includeTrivia*/ + false + )); + } + function emitQualifiedName(node) { + emitEntityName(node.left); + writePunctuation("."); + emit3(node.right); + } + function emitEntityName(node) { + if (node.kind === 80) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitComputedPropertyName(node) { + const savedPrivateNameTempFlags = privateNameTempFlags; + const savedReservedMemberNames = reservedPrivateNames; + popPrivateNameGenerationScope(); + writePunctuation("["); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); + writePunctuation("]"); + pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames); + } + function emitTypeParameter(node) { + emitModifierList(node, node.modifiers); + emit3(node.name); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit3(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit3(node.default); + } + } + function emitParameter(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit3(node.dotDotDotToken); + emitNodeWithWriter(node.name, writeParameter); + emit3(node.questionToken); + if (node.parent && node.parent.kind === 324 && !node.name) { + emit3(node.type); + } else { + emitTypeAnnotation(node.type); + } + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitDecorator(decorator) { + writePunctuation("@"); + emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); + } + function emitPropertySignature(node) { + emitModifierList(node, node.modifiers); + emitNodeWithWriter(node.name, writeProperty); + emit3(node.questionToken); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitPropertyDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit3(node.name); + emit3(node.questionToken); + emit3(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); + writeTrailingSemicolon(); + } + function emitMethodSignature(node) { + pushNameGenerationScope(node); + emitModifierList(node, node.modifiers); + emit3(node.name); + emit3(node.questionToken); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitMethodDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emit3(node.asteriskToken); + emit3(node.name); + emit3(node.questionToken); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitClassStaticBlockDeclaration(node) { + writeKeyword("static"); + emitBlockFunctionBody(node.body); + } + function emitConstructor(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("constructor"); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitAccessorDeclaration(node) { + const pos = emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + const token = node.kind === 177 ? 139 : 153; + emitTokenWithComment(token, pos, writeKeyword, node); + writeSpace(); + emit3(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitCallSignature(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitConstructSignature(node) { + pushNameGenerationScope(node); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + popNameGenerationScope(node); + } + function emitIndexSignature(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitParametersForIndexSignature(node, node.parameters); + emitTypeAnnotation(node.type); + writeTrailingSemicolon(); + } + function emitTemplateTypeSpan(node) { + emit3(node.type); + emit3(node.literal); + } + function emitSemicolonClassElement() { + writeTrailingSemicolon(); + } + function emitTypePredicate(node) { + if (node.assertsModifier) { + emit3(node.assertsModifier); + writeSpace(); + } + emit3(node.parameterName); + if (node.type) { + writeSpace(); + writeKeyword("is"); + writeSpace(); + emit3(node.type); + } + } + function emitTypeReference(node) { + emit3(node.typeName); + emitTypeArguments(node, node.typeArguments); + } + function emitFunctionType(node) { + pushNameGenerationScope(node); + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit3(node.type); + popNameGenerationScope(node); + } + function emitJSDocFunctionType(node) { + writeKeyword("function"); + emitParameters(node, node.parameters); + writePunctuation(":"); + emit3(node.type); + } + function emitJSDocNullableType(node) { + writePunctuation("?"); + emit3(node.type); + } + function emitJSDocNonNullableType(node) { + writePunctuation("!"); + emit3(node.type); + } + function emitJSDocOptionalType(node) { + emit3(node.type); + writePunctuation("="); + } + function emitConstructorType(node) { + pushNameGenerationScope(node); + emitModifierList(node, node.modifiers); + writeKeyword("new"); + writeSpace(); + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + writeSpace(); + writePunctuation("=>"); + writeSpace(); + emit3(node.type); + popNameGenerationScope(node); + } + function emitTypeQuery(node) { + writeKeyword("typeof"); + writeSpace(); + emit3(node.exprName); + emitTypeArguments(node, node.typeArguments); + } + function emitTypeLiteral(node) { + pushPrivateNameGenerationScope( + 0, + /*newReservedMemberNames*/ + void 0 + ); + writePunctuation("{"); + const flags = getEmitFlags(node) & 1 ? 768 : 32897; + emitList( + node, + node.members, + flags | 524288 + /* NoSpaceIfEmpty */ + ); + writePunctuation("}"); + popPrivateNameGenerationScope(); + } + function emitArrayType(node) { + emit3(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + writePunctuation("]"); + } + function emitRestOrJSDocVariadicType(node) { + writePunctuation("..."); + emit3(node.type); + } + function emitTupleType(node) { + emitTokenWithComment(23, node.pos, writePunctuation, node); + const flags = getEmitFlags(node) & 1 ? 528 : 657; + emitList(node, node.elements, flags | 524288, parenthesizer.parenthesizeElementTypeOfTupleType); + emitTokenWithComment(24, node.elements.end, writePunctuation, node); + } + function emitNamedTupleMember(node) { + emit3(node.dotDotDotToken); + emit3(node.name); + emit3(node.questionToken); + emitTokenWithComment(59, node.name.end, writePunctuation, node); + writeSpace(); + emit3(node.type); + } + function emitOptionalType(node) { + emit3(node.type, parenthesizer.parenthesizeTypeOfOptionalType); + writePunctuation("?"); + } + function emitUnionType(node) { + emitList(node, node.types, 516, parenthesizer.parenthesizeConstituentTypeOfUnionType); + } + function emitIntersectionType(node) { + emitList(node, node.types, 520, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); + } + function emitConditionalType(node) { + emit3(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit3(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit3(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit3(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit3(node.typeParameter); + } + function emitParenthesizedType(node) { + writePunctuation("("); + emit3(node.type); + writePunctuation(")"); + } + function emitThisType() { + writeKeyword("this"); + } + function emitTypeOperator(node) { + writeTokenText(node.operator, writeKeyword); + writeSpace(); + const parenthesizerRule = node.operator === 148 ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; + emit3(node.type, parenthesizerRule); + } + function emitIndexedAccessType(node) { + emit3(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); + writePunctuation("["); + emit3(node.indexType); + writePunctuation("]"); + } + function emitMappedType(node) { + const emitFlags = getEmitFlags(node); + writePunctuation("{"); + if (emitFlags & 1) { + writeSpace(); + } else { + writeLine(); + increaseIndent(); + } + if (node.readonlyToken) { + emit3(node.readonlyToken); + if (node.readonlyToken.kind !== 148) { + writeKeyword("readonly"); + } + writeSpace(); + } + writePunctuation("["); + pipelineEmit(3, node.typeParameter); + if (node.nameType) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit3(node.nameType); + } + writePunctuation("]"); + if (node.questionToken) { + emit3(node.questionToken); + if (node.questionToken.kind !== 58) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); + emit3(node.type); + writeTrailingSemicolon(); + if (emitFlags & 1) { + writeSpace(); + } else { + writeLine(); + decreaseIndent(); + } + emitList( + node, + node.members, + 2 + /* PreserveLines */ + ); + writePunctuation("}"); + } + function emitLiteralType(node) { + emitExpression(node.literal); + } + function emitTemplateType(node) { + emit3(node.head); + emitList( + node, + node.templateSpans, + 262144 + /* TemplateExpressionSpans */ + ); + } + function emitImportTypeNode(node) { + if (node.isTypeOf) { + writeKeyword("typeof"); + writeSpace(); + } + writeKeyword("import"); + writePunctuation("("); + emit3(node.argument); + if (node.attributes) { + writePunctuation(","); + writeSpace(); + pipelineEmit(7, node.attributes); + } + writePunctuation(")"); + if (node.qualifier) { + writePunctuation("."); + emit3(node.qualifier); + } + emitTypeArguments(node, node.typeArguments); + } + function emitObjectBindingPattern(node) { + writePunctuation("{"); + emitList( + node, + node.elements, + 525136 + /* ObjectBindingPatternElements */ + ); + writePunctuation("}"); + } + function emitArrayBindingPattern(node) { + writePunctuation("["); + emitList( + node, + node.elements, + 524880 + /* ArrayBindingPatternElements */ + ); + writePunctuation("]"); + } + function emitBindingElement(node) { + emit3(node.dotDotDotToken); + if (node.propertyName) { + emit3(node.propertyName); + writePunctuation(":"); + writeSpace(); + } + emit3(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitArrayLiteralExpression(node) { + const elements = node.elements; + const preferNewLine = node.multiLine ? 65536 : 0; + emitExpressionList(node, elements, 8914 | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitObjectLiteralExpression(node) { + pushPrivateNameGenerationScope( + 0, + /*newReservedMemberNames*/ + void 0 + ); + forEach4(node.properties, generateMemberNames); + const indentedFlag = getEmitFlags(node) & 131072; + if (indentedFlag) { + increaseIndent(); + } + const preferNewLine = node.multiLine ? 65536 : 0; + const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 && !isJsonSourceFile(currentSourceFile) ? 64 : 0; + emitList(node, node.properties, 526226 | allowTrailingComma | preferNewLine); + if (indentedFlag) { + decreaseIndent(); + } + popPrivateNameGenerationScope(); + } + function emitPropertyAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + const token = node.questionDotToken || setTextRangePosEnd(factory.createToken( + 25 + /* DotToken */ + ), node.expression.end, node.name.pos); + const linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); + const linesAfterDot = getLinesBetweenNodes(node, token, node.name); + writeLinesAndIndent( + linesBeforeDot, + /*writeSpaceIfNotIndenting*/ + false + ); + const shouldEmitDotDot = token.kind !== 29 && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); + if (shouldEmitDotDot) { + writePunctuation("."); + } + if (node.questionDotToken) { + emit3(token); + } else { + emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); + } + writeLinesAndIndent( + linesAfterDot, + /*writeSpaceIfNotIndenting*/ + false + ); + emit3(node.name); + decreaseIndentIf(linesBeforeDot, linesAfterDot); + } + function mayNeedDotDotForPropertyAccess(expression) { + expression = skipPartiallyEmittedExpressions(expression); + if (isNumericLiteral(expression)) { + const text = getLiteralTextOfNode( + expression, + /*neverAsciiEscape*/ + true, + /*jsxAttributeEscape*/ + false + ); + return !(expression.numericLiteralFlags & 448) && !text.includes(tokenToString( + 25 + /* DotToken */ + )) && !text.includes(String.fromCharCode( + 69 + /* E */ + )) && !text.includes(String.fromCharCode( + 101 + /* e */ + )); + } else if (isAccessExpression(expression)) { + const constantValue = getConstantValue(expression); + return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue; + } + } + function emitElementAccessExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emit3(node.questionDotToken); + emitTokenWithComment(23, node.expression.end, writePunctuation, node); + emitExpression(node.argumentExpression); + emitTokenWithComment(24, node.argumentExpression.end, writePunctuation, node); + } + function emitCallExpression(node) { + const indirectCall = getInternalEmitFlags(node) & 16; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emit3(node.questionDotToken); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 2576, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitNewExpression(node) { + emitTokenWithComment(105, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); + emitTypeArguments(node, node.typeArguments); + emitExpressionList(node, node.arguments, 18960, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitTaggedTemplateExpression(node) { + const indirectCall = getInternalEmitFlags(node) & 16; + if (indirectCall) { + writePunctuation("("); + writeLiteral("0"); + writePunctuation(","); + writeSpace(); + } + emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); + if (indirectCall) { + writePunctuation(")"); + } + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emitExpression(node.template); + } + function emitTypeAssertionExpression(node) { + writePunctuation("<"); + emit3(node.type); + writePunctuation(">"); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitParenthesizedExpression(node) { + const openParenPos = emitTokenWithComment(21, node.pos, writePunctuation, node); + const indented = writeLineSeparatorsAndIndentBefore(node.expression, node); + emitExpression( + node.expression, + /*parenthesizerRule*/ + void 0 + ); + writeLineSeparatorsAfter(node.expression, node); + decreaseIndentIf(indented); + emitTokenWithComment(22, node.expression ? node.expression.end : openParenPos, writePunctuation, node); + } + function emitFunctionExpression(node) { + generateNameIfNeeded(node.name); + emitFunctionDeclarationOrExpression(node); + } + function emitArrowFunction(node) { + emitModifierList(node, node.modifiers); + emitSignatureAndBody(node, emitArrowFunctionHead); + } + function emitArrowFunctionHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParametersForArrow(node, node.parameters); + emitTypeAnnotation(node.type); + writeSpace(); + emit3(node.equalsGreaterThanToken); + } + function emitDeleteExpression(node) { + emitTokenWithComment(91, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitTypeOfExpression(node) { + emitTokenWithComment(114, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitVoidExpression(node) { + emitTokenWithComment(116, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitAwaitExpression(node) { + emitTokenWithComment(135, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function emitPrefixUnaryExpression(node) { + writeTokenText(node.operator, writeOperator); + if (shouldEmitWhitespaceBeforeOperand(node)) { + writeSpace(); + } + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); + } + function shouldEmitWhitespaceBeforeOperand(node) { + const operand = node.operand; + return operand.kind === 224 && (node.operator === 40 && (operand.operator === 40 || operand.operator === 46) || node.operator === 41 && (operand.operator === 41 || operand.operator === 47)); + } + function emitPostfixUnaryExpression(node) { + emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); + writeTokenText(node.operator, writeOperator); + } + function createEmitBinaryExpression() { + return createBinaryExpressionTrampoline( + onEnter, + onLeft, + onOperator, + onRight, + onExit, + /*foldState*/ + void 0 + ); + function onEnter(node, state) { + if (state) { + state.stackIndex++; + state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; + state.containerPosStack[state.stackIndex] = containerPos; + state.containerEndStack[state.stackIndex] = containerEnd; + state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; + const emitComments2 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); + const emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); + if (emitComments2) + emitCommentsBeforeNode(node); + if (emitSourceMaps) + emitSourceMapsBeforeNode(node); + beforeEmitNode(node); + } else { + state = { + stackIndex: 0, + preserveSourceNewlinesStack: [void 0], + containerPosStack: [-1], + containerEndStack: [-1], + declarationListContainerEndStack: [-1], + shouldEmitCommentsStack: [false], + shouldEmitSourceMapsStack: [false] + }; + } + return state; + } + function onLeft(next, _workArea, parent22) { + return maybeEmitExpression(next, parent22, "left"); + } + function onOperator(operatorToken, _state, node) { + const isCommaOperator = operatorToken.kind !== 28; + const linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); + const linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); + writeLinesAndIndent(linesBeforeOperator, isCommaOperator); + emitLeadingCommentsOfPosition(operatorToken.pos); + writeTokenNode(operatorToken, operatorToken.kind === 103 ? writeKeyword : writeOperator); + emitTrailingCommentsOfPosition( + operatorToken.end, + /*prefixSpace*/ + true + ); + writeLinesAndIndent( + linesAfterOperator, + /*writeSpaceIfNotIndenting*/ + true + ); + } + function onRight(next, _workArea, parent22) { + return maybeEmitExpression(next, parent22, "right"); + } + function onExit(node, state) { + const linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); + const linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); + decreaseIndentIf(linesBeforeOperator, linesAfterOperator); + if (state.stackIndex > 0) { + const savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; + const savedContainerPos = state.containerPosStack[state.stackIndex]; + const savedContainerEnd = state.containerEndStack[state.stackIndex]; + const savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; + const shouldEmitComments2 = state.shouldEmitCommentsStack[state.stackIndex]; + const shouldEmitSourceMaps2 = state.shouldEmitSourceMapsStack[state.stackIndex]; + afterEmitNode(savedPreserveSourceNewlines); + if (shouldEmitSourceMaps2) + emitSourceMapsAfterNode(node); + if (shouldEmitComments2) + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); + state.stackIndex--; + } + } + function maybeEmitExpression(next, parent22, side) { + const parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent22.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent22.operatorToken.kind); + let pipelinePhase = getPipelinePhase(0, 1, next); + if (pipelinePhase === pipelineEmitWithSubstitution) { + Debug.assertIsDefined(lastSubstitution); + next = parenthesizerRule(cast(lastSubstitution, isExpression)); + pipelinePhase = getNextPipelinePhase(1, 1, next); + lastSubstitution = void 0; + } + if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { + if (isBinaryExpression(next)) { + return next; + } + } + currentParenthesizerRule = parenthesizerRule; + pipelinePhase(1, next); + } + } + function emitConditionalExpression(node) { + const linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); + const linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); + const linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); + const linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); + emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); + writeLinesAndIndent( + linesBeforeQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emit3(node.questionToken); + writeLinesAndIndent( + linesAfterQuestion, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); + writeLinesAndIndent( + linesBeforeColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emit3(node.colonToken); + writeLinesAndIndent( + linesAfterColon, + /*writeSpaceIfNotIndenting*/ + true + ); + emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); + decreaseIndentIf(linesBeforeColon, linesAfterColon); + } + function emitTemplateExpression(node) { + emit3(node.head); + emitList( + node, + node.templateSpans, + 262144 + /* TemplateExpressionSpans */ + ); + } + function emitYieldExpression(node) { + emitTokenWithComment(127, node.pos, writeKeyword, node); + emit3(node.asteriskToken); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); + } + function emitSpreadElement(node) { + emitTokenWithComment(26, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitClassExpression(node) { + generateNameIfNeeded(node.name); + emitClassDeclarationOrExpression(node); + } + function emitExpressionWithTypeArguments(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + emitTypeArguments(node, node.typeArguments); + } + function emitAsExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRule*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("as"); + writeSpace(); + emit3(node.type); + } + } + function emitNonNullExpression(node) { + emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); + writeOperator("!"); + } + function emitSatisfiesExpression(node) { + emitExpression( + node.expression, + /*parenthesizerRule*/ + void 0 + ); + if (node.type) { + writeSpace(); + writeKeyword("satisfies"); + writeSpace(); + emit3(node.type); + } + } + function emitMetaProperty(node) { + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); + emit3(node.name); + } + function emitTemplateSpan(node) { + emitExpression(node.expression); + emit3(node.literal); + } + function emitBlock(node) { + emitBlockStatements( + node, + /*forceSingleLine*/ + !node.multiLine && isEmptyBlock(node) + ); + } + function emitBlockStatements(node, forceSingleLine) { + emitTokenWithComment( + 19, + node.pos, + writePunctuation, + /*contextNode*/ + node + ); + const format5 = forceSingleLine || getEmitFlags(node) & 1 ? 768 : 129; + emitList(node, node.statements, format5); + emitTokenWithComment( + 20, + node.statements.end, + writePunctuation, + /*contextNode*/ + node, + /*indentLeading*/ + !!(format5 & 1) + ); + } + function emitVariableStatement(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emit3(node.declarationList); + writeTrailingSemicolon(); + } + function emitEmptyStatement(isEmbeddedStatement) { + if (isEmbeddedStatement) { + writePunctuation(";"); + } else { + writeTrailingSemicolon(); + } + } + function emitExpressionStatement(node) { + emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); + if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { + writeTrailingSemicolon(); + } + } + function emitIfStatement(node) { + const openParenPos = emitTokenWithComment(101, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.thenStatement); + if (node.elseStatement) { + writeLineOrSpace(node, node.thenStatement, node.elseStatement); + emitTokenWithComment(93, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 245) { + writeSpace(); + emit3(node.elseStatement); + } else { + emitEmbeddedStatement(node, node.elseStatement); + } + } + } + function emitWhileClause(node, startPos) { + const openParenPos = emitTokenWithComment(117, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + } + function emitDoStatement(node) { + emitTokenWithComment(92, node.pos, writeKeyword, node); + emitEmbeddedStatement(node, node.statement); + if (isBlock2(node.statement) && !preserveSourceNewlines) { + writeSpace(); + } else { + writeLineOrSpace(node, node.statement, node.expression); + } + emitWhileClause(node, node.statement.end); + writeTrailingSemicolon(); + } + function emitWhileStatement(node) { + emitWhileClause(node, node.pos); + emitEmbeddedStatement(node, node.statement); + } + function emitForStatement(node) { + const openParenPos = emitTokenWithComment(99, node.pos, writeKeyword, node); + writeSpace(); + let pos = emitTokenWithComment( + 21, + openParenPos, + writePunctuation, + /*contextNode*/ + node + ); + emitForBinding(node.initializer); + pos = emitTokenWithComment(27, node.initializer ? node.initializer.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.condition); + pos = emitTokenWithComment(27, node.condition ? node.condition.end : pos, writePunctuation, node); + emitExpressionWithLeadingSpace(node.incrementor); + emitTokenWithComment(22, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForInStatement(node) { + const openParenPos = emitTokenWithComment(99, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(103, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForOfStatement(node) { + const openParenPos = emitTokenWithComment(99, node.pos, writeKeyword, node); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitForBinding(node.initializer); + writeSpace(); + emitTokenWithComment(165, node.initializer.end, writeKeyword, node); + writeSpace(); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitForBinding(node) { + if (node !== void 0) { + if (node.kind === 261) { + emit3(node); + } else { + emitExpression(node); + } + } + } + function emitContinueStatement(node) { + emitTokenWithComment(88, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitBreakStatement(node) { + emitTokenWithComment(83, node.pos, writeKeyword, node); + emitWithLeadingSpace(node.label); + writeTrailingSemicolon(); + } + function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { + const node = getParseTreeNode(contextNode); + const isSimilarNode = node && node.kind === contextNode.kind; + const startPos = pos; + if (isSimilarNode && currentSourceFile) { + pos = skipTrivia(currentSourceFile.text, pos); + } + if (isSimilarNode && contextNode.pos !== startPos) { + const needsIndent = indentLeading && currentSourceFile && !positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + if (!omitBraceSourcePositions && (token === 19 || token === 20)) { + pos = writeToken(token, pos, writer2, contextNode); + } else { + pos = writeTokenText(token, writer2, pos); + } + if (isSimilarNode && contextNode.end !== pos) { + const isJsxExprContext = contextNode.kind === 294; + emitTrailingCommentsOfPosition( + pos, + /*prefixSpace*/ + !isJsxExprContext, + /*forceNoNewline*/ + isJsxExprContext + ); + } + return pos; + } + function commentWillEmitNewLine(node) { + return node.kind === 2 || !!node.hasTrailingNewLine; + } + function willEmitLeadingNewLine(node) { + if (!currentSourceFile) + return false; + const leadingCommentRanges = getLeadingCommentRanges(currentSourceFile.text, node.pos); + if (leadingCommentRanges) { + const parseNode = getParseTreeNode(node); + if (parseNode && isParenthesizedExpression(parseNode.parent)) { + return true; + } + } + if (some2(leadingCommentRanges, commentWillEmitNewLine)) + return true; + if (some2(getSyntheticLeadingComments(node), commentWillEmitNewLine)) + return true; + if (isPartiallyEmittedExpression(node)) { + if (node.pos !== node.expression.pos) { + if (some2(getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) + return true; + } + return willEmitLeadingNewLine(node.expression); + } + return false; + } + function parenthesizeExpressionForNoAsi(node) { + if (!commentsDisabled && isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { + const parseNode = getParseTreeNode(node); + if (parseNode && isParenthesizedExpression(parseNode)) { + const parens = factory.createParenthesizedExpression(node.expression); + setOriginalNode(parens, node); + setTextRange(parens, parseNode); + return parens; + } + return factory.createParenthesizedExpression(node); + } + return node; + } + function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { + return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); + } + function emitReturnStatement(node) { + emitTokenWithComment( + 107, + node.pos, + writeKeyword, + /*contextNode*/ + node + ); + emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitWithStatement(node) { + const openParenPos = emitTokenWithComment(118, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + emitEmbeddedStatement(node, node.statement); + } + function emitSwitchStatement(node) { + const openParenPos = emitTokenWithComment(109, node.pos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(22, node.expression.end, writePunctuation, node); + writeSpace(); + emit3(node.caseBlock); + } + function emitLabeledStatement(node) { + emit3(node.label); + emitTokenWithComment(59, node.label.end, writePunctuation, node); + writeSpace(); + emit3(node.statement); + } + function emitThrowStatement(node) { + emitTokenWithComment(111, node.pos, writeKeyword, node); + emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); + writeTrailingSemicolon(); + } + function emitTryStatement(node) { + emitTokenWithComment(113, node.pos, writeKeyword, node); + writeSpace(); + emit3(node.tryBlock); + if (node.catchClause) { + writeLineOrSpace(node, node.tryBlock, node.catchClause); + emit3(node.catchClause); + } + if (node.finallyBlock) { + writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); + emitTokenWithComment(98, (node.catchClause || node.tryBlock).end, writeKeyword, node); + writeSpace(); + emit3(node.finallyBlock); + } + } + function emitDebuggerStatement(node) { + writeToken(89, node.pos, writeKeyword); + writeTrailingSemicolon(); + } + function emitVariableDeclaration(node) { + var _a2, _b, _c; + emit3(node.name); + emit3(node.exclamationToken); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer, ((_a2 = node.type) == null ? void 0 : _a2.end) ?? ((_c = (_b = node.name.emitNode) == null ? void 0 : _b.typeNode) == null ? void 0 : _c.end) ?? node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitVariableDeclarationList(node) { + if (isVarAwaitUsing(node)) { + writeKeyword("await"); + writeSpace(); + writeKeyword("using"); + } else { + const head2 = isLet(node) ? "let" : isVarConst(node) ? "const" : isVarUsing(node) ? "using" : "var"; + writeKeyword(head2); + } + writeSpace(); + emitList( + node, + node.declarations, + 528 + /* VariableDeclarationList */ + ); + } + function emitFunctionDeclaration(node) { + emitFunctionDeclarationOrExpression(node); + } + function emitFunctionDeclarationOrExpression(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("function"); + emit3(node.asteriskToken); + writeSpace(); + emitIdentifierName(node.name); + emitSignatureAndBody(node, emitSignatureHead); + } + function emitSignatureAndBody(node, emitSignatureHead2) { + const body = node.body; + if (body) { + if (isBlock2(body)) { + const indentedFlag = getEmitFlags(node) & 131072; + if (indentedFlag) { + increaseIndent(); + } + pushNameGenerationScope(node); + forEach4(node.parameters, generateNames); + generateNames(node.body); + emitSignatureHead2(node); + emitBlockFunctionBody(body); + popNameGenerationScope(node); + if (indentedFlag) { + decreaseIndent(); + } + } else { + emitSignatureHead2(node); + writeSpace(); + emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); + } + } else { + emitSignatureHead2(node); + writeTrailingSemicolon(); + } + } + function emitSignatureHead(node) { + emitTypeParameters(node, node.typeParameters); + emitParameters(node, node.parameters); + emitTypeAnnotation(node.type); + } + function shouldEmitBlockFunctionBodyOnSingleLine(body) { + if (getEmitFlags(body) & 1) { + return true; + } + if (body.multiLine) { + return false; + } + if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { + return false; + } + if (getLeadingLineTerminatorCount( + body, + firstOrUndefined(body.statements), + 2 + /* PreserveLines */ + ) || getClosingLineTerminatorCount(body, lastOrUndefined(body.statements), 2, body.statements)) { + return false; + } + let previousStatement; + for (const statement of body.statements) { + if (getSeparatingLineTerminatorCount( + previousStatement, + statement, + 2 + /* PreserveLines */ + ) > 0) { + return false; + } + previousStatement = statement; + } + return true; + } + function emitBlockFunctionBody(body) { + onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body); + writeSpace(); + writePunctuation("{"); + increaseIndent(); + const emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; + emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); + decreaseIndent(); + writeToken(20, body.statements.end, writePunctuation, body); + onAfterEmitNode == null ? void 0 : onAfterEmitNode(body); + } + function emitBlockFunctionBodyOnSingleLine(body) { + emitBlockFunctionBodyWorker( + body, + /*emitBlockFunctionBodyOnSingleLine*/ + true + ); + } + function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { + const statementOffset = emitPrologueDirectives(body.statements); + const pos = writer.getTextPos(); + emitHelpers(body); + if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { + decreaseIndent(); + emitList( + body, + body.statements, + 768 + /* SingleLineFunctionBodyStatements */ + ); + increaseIndent(); + } else { + emitList( + body, + body.statements, + 1, + /*parenthesizerRule*/ + void 0, + statementOffset + ); + } + } + function emitClassDeclaration(node) { + emitClassDeclarationOrExpression(node); + } + function emitClassDeclarationOrExpression(node) { + pushPrivateNameGenerationScope( + 0, + /*newReservedMemberNames*/ + void 0 + ); + forEach4(node.members, generateMemberNames); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + true + ); + emitTokenWithComment(86, moveRangePastModifiers(node).pos, writeKeyword, node); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } + const indentedFlag = getEmitFlags(node) & 131072; + if (indentedFlag) { + increaseIndent(); + } + emitTypeParameters(node, node.typeParameters); + emitList( + node, + node.heritageClauses, + 0 + /* ClassHeritageClauses */ + ); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 129 + /* ClassMembers */ + ); + writePunctuation("}"); + if (indentedFlag) { + decreaseIndent(); + } + popPrivateNameGenerationScope(); + } + function emitInterfaceDeclaration(node) { + pushPrivateNameGenerationScope( + 0, + /*newReservedMemberNames*/ + void 0 + ); + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("interface"); + writeSpace(); + emit3(node.name); + emitTypeParameters(node, node.typeParameters); + emitList( + node, + node.heritageClauses, + 512 + /* HeritageClauses */ + ); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 129 + /* InterfaceMembers */ + ); + writePunctuation("}"); + popPrivateNameGenerationScope(); + } + function emitTypeAliasDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("type"); + writeSpace(); + emit3(node.name); + emitTypeParameters(node, node.typeParameters); + writeSpace(); + writePunctuation("="); + writeSpace(); + emit3(node.type); + writeTrailingSemicolon(); + } + function emitEnumDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + writeKeyword("enum"); + writeSpace(); + emit3(node.name); + writeSpace(); + writePunctuation("{"); + emitList( + node, + node.members, + 145 + /* EnumMembers */ + ); + writePunctuation("}"); + } + function emitModuleDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + if (~node.flags & 2048) { + writeKeyword(node.flags & 32 ? "namespace" : "module"); + writeSpace(); + } + emit3(node.name); + let body = node.body; + if (!body) + return writeTrailingSemicolon(); + while (body && isModuleDeclaration(body)) { + writePunctuation("."); + emit3(body.name); + body = body.body; + } + writeSpace(); + emit3(body); + } + function emitModuleBlock(node) { + pushNameGenerationScope(node); + forEach4(node.statements, generateNames); + emitBlockStatements( + node, + /*forceSingleLine*/ + isEmptyBlock(node) + ); + popNameGenerationScope(node); + } + function emitCaseBlock(node) { + emitTokenWithComment(19, node.pos, writePunctuation, node); + emitList( + node, + node.clauses, + 129 + /* CaseBlockClauses */ + ); + emitTokenWithComment( + 20, + node.clauses.end, + writePunctuation, + node, + /*indentLeading*/ + true + ); + } + function emitImportEqualsDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitTokenWithComment(102, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + emitTokenWithComment(156, node.pos, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + writeSpace(); + emitTokenWithComment(64, node.name.end, writePunctuation, node); + writeSpace(); + emitModuleReference(node.moduleReference); + writeTrailingSemicolon(); + } + function emitModuleReference(node) { + if (node.kind === 80) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitImportDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + emitTokenWithComment(102, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); + writeSpace(); + if (node.importClause) { + emit3(node.importClause); + writeSpace(); + emitTokenWithComment(161, node.importClause.end, writeKeyword, node); + writeSpace(); + } + emitExpression(node.moduleSpecifier); + if (node.attributes) { + emitWithLeadingSpace(node.attributes); + } + writeTrailingSemicolon(); + } + function emitImportClause(node) { + if (node.isTypeOnly) { + emitTokenWithComment(156, node.pos, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + if (node.name && node.namedBindings) { + emitTokenWithComment(28, node.name.end, writePunctuation, node); + writeSpace(); + } + emit3(node.namedBindings); + } + function emitNamespaceImport(node) { + const asPos = emitTokenWithComment(42, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(130, asPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + } + function emitNamedImports(node) { + emitNamedImportsOrExports(node); + } + function emitImportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitExportAssignment(node) { + const nextPos = emitTokenWithComment(95, node.pos, writeKeyword, node); + writeSpace(); + if (node.isExportEquals) { + emitTokenWithComment(64, nextPos, writeOperator, node); + } else { + emitTokenWithComment(90, nextPos, writeKeyword, node); + } + writeSpace(); + emitExpression( + node.expression, + node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator( + 64 + /* EqualsToken */ + ) : parenthesizer.parenthesizeExpressionOfExportDefault + ); + writeTrailingSemicolon(); + } + function emitExportDeclaration(node) { + emitDecoratorsAndModifiers( + node, + node.modifiers, + /*allowDecorators*/ + false + ); + let nextPos = emitTokenWithComment(95, node.pos, writeKeyword, node); + writeSpace(); + if (node.isTypeOnly) { + nextPos = emitTokenWithComment(156, nextPos, writeKeyword, node); + writeSpace(); + } + if (node.exportClause) { + emit3(node.exportClause); + } else { + nextPos = emitTokenWithComment(42, nextPos, writePunctuation, node); + } + if (node.moduleSpecifier) { + writeSpace(); + const fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(161, fromPos, writeKeyword, node); + writeSpace(); + emitExpression(node.moduleSpecifier); + } + if (node.attributes) { + emitWithLeadingSpace(node.attributes); + } + writeTrailingSemicolon(); + } + function emitImportTypeNodeAttributes(node) { + writePunctuation("{"); + writeSpace(); + writeKeyword(node.token === 132 ? "assert" : "with"); + writePunctuation(":"); + writeSpace(); + const elements = node.elements; + emitList( + node, + elements, + 526226 + /* ImportAttributes */ + ); + writeSpace(); + writePunctuation("}"); + } + function emitImportAttributes(node) { + emitTokenWithComment(node.token, node.pos, writeKeyword, node); + writeSpace(); + const elements = node.elements; + emitList( + node, + elements, + 526226 + /* ImportAttributes */ + ); + } + function emitImportAttribute(node) { + emit3(node.name); + writePunctuation(":"); + writeSpace(); + const value2 = node.value; + if ((getEmitFlags(value2) & 1024) === 0) { + const commentRange = getCommentRange(value2); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emit3(value2); + } + function emitNamespaceExportDeclaration(node) { + let nextPos = emitTokenWithComment(95, node.pos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(130, nextPos, writeKeyword, node); + writeSpace(); + nextPos = emitTokenWithComment(145, nextPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + writeTrailingSemicolon(); + } + function emitNamespaceExport(node) { + const asPos = emitTokenWithComment(42, node.pos, writePunctuation, node); + writeSpace(); + emitTokenWithComment(130, asPos, writeKeyword, node); + writeSpace(); + emit3(node.name); + } + function emitNamedExports(node) { + emitNamedImportsOrExports(node); + } + function emitExportSpecifier(node) { + emitImportOrExportSpecifier(node); + } + function emitNamedImportsOrExports(node) { + writePunctuation("{"); + emitList( + node, + node.elements, + 525136 + /* NamedImportsOrExportsElements */ + ); + writePunctuation("}"); + } + function emitImportOrExportSpecifier(node) { + if (node.isTypeOnly) { + writeKeyword("type"); + writeSpace(); + } + if (node.propertyName) { + emit3(node.propertyName); + writeSpace(); + emitTokenWithComment(130, node.propertyName.end, writeKeyword, node); + writeSpace(); + } + emit3(node.name); + } + function emitExternalModuleReference(node) { + writeKeyword("require"); + writePunctuation("("); + emitExpression(node.expression); + writePunctuation(")"); + } + function emitJsxElement(node) { + emit3(node.openingElement); + emitList( + node, + node.children, + 262144 + /* JsxElementOrFragmentChildren */ + ); + emit3(node.closingElement); + } + function emitJsxSelfClosingElement(node) { + writePunctuation("<"); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + writeSpace(); + emit3(node.attributes); + writePunctuation("/>"); + } + function emitJsxFragment(node) { + emit3(node.openingFragment); + emitList( + node, + node.children, + 262144 + /* JsxElementOrFragmentChildren */ + ); + emit3(node.closingFragment); + } + function emitJsxOpeningElementOrFragment(node) { + writePunctuation("<"); + if (isJsxOpeningElement(node)) { + const indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); + emitJsxTagName(node.tagName); + emitTypeArguments(node, node.typeArguments); + if (node.attributes.properties && node.attributes.properties.length > 0) { + writeSpace(); + } + emit3(node.attributes); + writeLineSeparatorsAfter(node.attributes, node); + decreaseIndentIf(indented); + } + writePunctuation(">"); + } + function emitJsxText(node) { + writer.writeLiteral(node.text); + } + function emitJsxClosingElementOrFragment(node) { + writePunctuation(""); + } + function emitJsxAttributes(node) { + emitList( + node, + node.properties, + 262656 + /* JsxElementAttributes */ + ); + } + function emitJsxAttribute(node) { + emit3(node.name); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); + } + function emitJsxSpreadAttribute(node) { + writePunctuation("{..."); + emitExpression(node.expression); + writePunctuation("}"); + } + function hasTrailingCommentsAtPosition(pos) { + let result2 = false; + forEachTrailingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result2 = true); + return result2; + } + function hasLeadingCommentsAtPosition(pos) { + let result2 = false; + forEachLeadingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result2 = true); + return result2; + } + function hasCommentsAtPosition(pos) { + return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); + } + function emitJsxExpression(node) { + var _a2; + if (node.expression || !commentsDisabled && !nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { + const isMultiline = currentSourceFile && !nodeIsSynthesized(node) && getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== getLineAndCharacterOfPosition(currentSourceFile, node.end).line; + if (isMultiline) { + writer.increaseIndent(); + } + const end = emitTokenWithComment(19, node.pos, writePunctuation, node); + emit3(node.dotDotDotToken); + emitExpression(node.expression); + emitTokenWithComment(20, ((_a2 = node.expression) == null ? void 0 : _a2.end) || end, writePunctuation, node); + if (isMultiline) { + writer.decreaseIndent(); + } + } + } + function emitJsxNamespacedName(node) { + emitIdentifierName(node.namespace); + writePunctuation(":"); + emitIdentifierName(node.name); + } + function emitJsxTagName(node) { + if (node.kind === 80) { + emitExpression(node); + } else { + emit3(node); + } + } + function emitCaseClause(node) { + emitTokenWithComment(84, node.pos, writeKeyword, node); + writeSpace(); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); + } + function emitDefaultClause(node) { + const pos = emitTokenWithComment(90, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); + } + function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { + const emitAsSingleStatement = statements.length === 1 && // treat synthesized nodes as located on the same line for emit purposes + (!currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); + let format5 = 163969; + if (emitAsSingleStatement) { + writeToken(59, colonPos, writePunctuation, parentNode); + writeSpace(); + format5 &= ~(1 | 128); + } else { + emitTokenWithComment(59, colonPos, writePunctuation, parentNode); + } + emitList(parentNode, statements, format5); + } + function emitHeritageClause(node) { + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); + emitList( + node, + node.types, + 528 + /* HeritageClauseTypes */ + ); + } + function emitCatchClause(node) { + const openParenPos = emitTokenWithComment(85, node.pos, writeKeyword, node); + writeSpace(); + if (node.variableDeclaration) { + emitTokenWithComment(21, openParenPos, writePunctuation, node); + emit3(node.variableDeclaration); + emitTokenWithComment(22, node.variableDeclaration.end, writePunctuation, node); + writeSpace(); + } + emit3(node.block); + } + function emitPropertyAssignment(node) { + emit3(node.name); + writePunctuation(":"); + writeSpace(); + const initializer = node.initializer; + if ((getEmitFlags(initializer) & 1024) === 0) { + const commentRange = getCommentRange(initializer); + emitTrailingCommentsOfPosition(commentRange.pos); + } + emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitShorthandPropertyAssignment(node) { + emit3(node.name); + if (node.objectAssignmentInitializer) { + writeSpace(); + writePunctuation("="); + writeSpace(); + emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitSpreadAssignment(node) { + if (node.expression) { + emitTokenWithComment(26, node.pos, writePunctuation, node); + emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + } + function emitEnumMember(node) { + emit3(node.name); + emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); + } + function emitJSDoc(node) { + write("/**"); + if (node.comment) { + const text = getTextOfJSDocComment(node.comment); + if (text) { + const lines = text.split(/\r\n?|\n/g); + for (const line of lines) { + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + write(line); + } + } + } + if (node.tags) { + if (node.tags.length === 1 && node.tags[0].kind === 351 && !node.comment) { + writeSpace(); + emit3(node.tags[0]); + } else { + emitList( + node, + node.tags, + 33 + /* JSDocComment */ + ); + } + } + writeSpace(); + write("*/"); + } + function emitJSDocSimpleTypedTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.typeExpression); + emitJSDocComment(tag.comment); + } + function emitJSDocSeeTag(tag) { + emitJSDocTagName(tag.tagName); + emit3(tag.name); + emitJSDocComment(tag.comment); + } + function emitJSDocNameReference(node) { + writeSpace(); + writePunctuation("{"); + emit3(node.name); + writePunctuation("}"); + } + function emitJSDocHeritageTag(tag) { + emitJSDocTagName(tag.tagName); + writeSpace(); + writePunctuation("{"); + emit3(tag.class); + writePunctuation("}"); + emitJSDocComment(tag.comment); + } + function emitJSDocTemplateTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocTypeExpression(tag.constraint); + writeSpace(); + emitList( + tag, + tag.typeParameters, + 528 + /* CommaListElements */ + ); + emitJSDocComment(tag.comment); + } + function emitJSDocTypedefTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.typeExpression) { + if (tag.typeExpression.kind === 316) { + emitJSDocTypeExpression(tag.typeExpression); + } else { + writeSpace(); + writePunctuation("{"); + write("Object"); + if (tag.typeExpression.isArrayType) { + writePunctuation("["); + writePunctuation("]"); + } + writePunctuation("}"); + } + } + if (tag.fullName) { + writeSpace(); + emit3(tag.fullName); + } + emitJSDocComment(tag.comment); + if (tag.typeExpression && tag.typeExpression.kind === 329) { + emitJSDocTypeLiteral(tag.typeExpression); + } + } + function emitJSDocCallbackTag(tag) { + emitJSDocTagName(tag.tagName); + if (tag.name) { + writeSpace(); + emit3(tag.name); + } + emitJSDocComment(tag.comment); + emitJSDocSignature(tag.typeExpression); + } + function emitJSDocOverloadTag(tag) { + emitJSDocComment(tag.comment); + emitJSDocSignature(tag.typeExpression); + } + function emitJSDocSimpleTag(tag) { + emitJSDocTagName(tag.tagName); + emitJSDocComment(tag.comment); + } + function emitJSDocTypeLiteral(lit) { + emitList( + lit, + factory.createNodeArray(lit.jsDocPropertyTags), + 33 + /* JSDocComment */ + ); + } + function emitJSDocSignature(sig) { + if (sig.typeParameters) { + emitList( + sig, + factory.createNodeArray(sig.typeParameters), + 33 + /* JSDocComment */ + ); + } + if (sig.parameters) { + emitList( + sig, + factory.createNodeArray(sig.parameters), + 33 + /* JSDocComment */ + ); + } + if (sig.type) { + writeLine(); + writeSpace(); + writePunctuation("*"); + writeSpace(); + emit3(sig.type); + } + } + function emitJSDocPropertyLikeTag(param) { + emitJSDocTagName(param.tagName); + emitJSDocTypeExpression(param.typeExpression); + writeSpace(); + if (param.isBracketed) { + writePunctuation("["); + } + emit3(param.name); + if (param.isBracketed) { + writePunctuation("]"); + } + emitJSDocComment(param.comment); + } + function emitJSDocTagName(tagName) { + writePunctuation("@"); + emit3(tagName); + } + function emitJSDocComment(comment) { + const text = getTextOfJSDocComment(comment); + if (text) { + writeSpace(); + write(text); + } + } + function emitJSDocTypeExpression(typeExpression) { + if (typeExpression) { + writeSpace(); + writePunctuation("{"); + emit3(typeExpression.type); + writePunctuation("}"); + } + } + function emitSourceFile(node) { + writeLine(); + const statements = node.statements; + const shouldEmitDetachedComment = statements.length === 0 || !isPrologueDirective(statements[0]) || nodeIsSynthesized(statements[0]); + if (shouldEmitDetachedComment) { + emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); + return; + } + emitSourceFileWorker(node); + } + function emitSyntheticTripleSlashReferencesIfNeeded(node) { + emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); + for (const prepend of node.prepends) { + if (isUnparsedSource(prepend) && prepend.syntheticReferences) { + for (const ref of prepend.syntheticReferences) { + emit3(ref); + writeLine(); + } + } + } + } + function emitTripleSlashDirectivesIfNeeded(node) { + if (node.isDeclarationFile) + emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); + } + function emitTripleSlashDirectives(hasNoDefaultLib, files, types3, libs2) { + if (hasNoDefaultLib) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ + pos, + end: writer.getTextPos(), + kind: "no-default-lib" + /* NoDefaultLib */ + }); + writeLine(); + } + if (currentSourceFile && currentSourceFile.moduleName) { + writeComment(`/// `); + writeLine(); + } + if (currentSourceFile && currentSourceFile.amdDependencies) { + for (const dep of currentSourceFile.amdDependencies) { + if (dep.name) { + writeComment(`/// `); + } else { + writeComment(`/// `); + } + writeLine(); + } + } + for (const directive of files) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName }); + writeLine(); + } + for (const directive of types3) { + const pos = writer.getTextPos(); + const resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile == null ? void 0 : currentSourceFile.impliedNodeFormat) ? `resolution-mode="${directive.resolutionMode === 99 ? "import" : "require"}"` : ""; + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" : directive.resolutionMode === 99 ? "type-import" : "type-require", data: directive.fileName }); + writeLine(); + } + for (const directive of libs2) { + const pos = writer.getTextPos(); + writeComment(`/// `); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "lib", data: directive.fileName }); + writeLine(); + } + } + function emitSourceFileWorker(node) { + const statements = node.statements; + pushNameGenerationScope(node); + forEach4(node.statements, generateNames); + emitHelpers(node); + const index4 = findIndex2(statements, (statement) => !isPrologueDirective(statement)); + emitTripleSlashDirectivesIfNeeded(node); + emitList( + node, + statements, + 1, + /*parenthesizerRule*/ + void 0, + index4 === -1 ? statements.length : index4 + ); + popNameGenerationScope(node); + } + function emitPartiallyEmittedExpression(node) { + const emitFlags = getEmitFlags(node); + if (!(emitFlags & 1024) && node.pos !== node.expression.pos) { + emitTrailingCommentsOfPosition(node.expression.pos); + } + emitExpression(node.expression); + if (!(emitFlags & 2048) && node.end !== node.expression.end) { + emitLeadingCommentsOfPosition(node.expression.end); + } + } + function emitCommaList(node) { + emitExpressionList( + node, + node.elements, + 528, + /*parenthesizerRule*/ + void 0 + ); + } + function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) { + let needsToSetSourceFile = !!sourceFile; + for (let i7 = 0; i7 < statements.length; i7++) { + const statement = statements[i7]; + if (isPrologueDirective(statement)) { + const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; + if (shouldEmitPrologueDirective) { + if (needsToSetSourceFile) { + needsToSetSourceFile = false; + setSourceFile(sourceFile); + } + writeLine(); + const pos = writer.getTextPos(); + emit3(statement); + if (recordBundleFileSection && bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue", data: statement.expression.text }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(statement.expression.text); + } + } + } else { + return i7; + } + } + return statements.length; + } + function emitUnparsedPrologues(prologues, seenPrologueDirectives) { + for (const prologue of prologues) { + if (!seenPrologueDirectives.has(prologue.data)) { + writeLine(); + const pos = writer.getTextPos(); + emit3(prologue); + if (bundleFileInfo) + bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue", data: prologue.data }); + if (seenPrologueDirectives) { + seenPrologueDirectives.add(prologue.data); + } + } + } + } + function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { + if (isSourceFile(sourceFileOrBundle)) { + emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); + } else { + const seenPrologueDirectives = /* @__PURE__ */ new Set(); + for (const prepend of sourceFileOrBundle.prepends) { + emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives); + } + for (const sourceFile of sourceFileOrBundle.sourceFiles) { + emitPrologueDirectives( + sourceFile.statements, + sourceFile, + seenPrologueDirectives, + /*recordBundleFileSection*/ + true + ); + } + setSourceFile(void 0); + } + } + function getPrologueDirectivesFromBundledSourceFiles(bundle) { + const seenPrologueDirectives = /* @__PURE__ */ new Set(); + let prologues; + for (let index4 = 0; index4 < bundle.sourceFiles.length; index4++) { + const sourceFile = bundle.sourceFiles[index4]; + let directives; + let end = 0; + for (const statement of sourceFile.statements) { + if (!isPrologueDirective(statement)) + break; + if (seenPrologueDirectives.has(statement.expression.text)) + continue; + seenPrologueDirectives.add(statement.expression.text); + (directives || (directives = [])).push({ + pos: statement.pos, + end: statement.end, + expression: { + pos: statement.expression.pos, + end: statement.expression.end, + text: statement.expression.text + } + }); + end = end < statement.end ? statement.end : end; + } + if (directives) + (prologues || (prologues = [])).push({ file: index4, text: sourceFile.text.substring(0, end), directives }); + } + return prologues; + } + function emitShebangIfNeeded(sourceFileOrBundle) { + if (isSourceFile(sourceFileOrBundle) || isUnparsedSource(sourceFileOrBundle)) { + const shebang = getShebang(sourceFileOrBundle.text); + if (shebang) { + writeComment(shebang); + writeLine(); + return true; + } + } else { + for (const prepend of sourceFileOrBundle.prepends) { + Debug.assertNode(prepend, isUnparsedSource); + if (emitShebangIfNeeded(prepend)) { + return true; + } + } + for (const sourceFile of sourceFileOrBundle.sourceFiles) { + if (emitShebangIfNeeded(sourceFile)) { + return true; + } + } + } + } + function emitNodeWithWriter(node, writer2) { + if (!node) + return; + const savedWrite = write; + write = writer2; + emit3(node); + write = savedWrite; + } + function emitDecoratorsAndModifiers(node, modifiers, allowDecorators) { + if (modifiers == null ? void 0 : modifiers.length) { + if (every2(modifiers, isModifier)) { + return emitModifierList(node, modifiers); + } + if (every2(modifiers, isDecorator)) { + if (allowDecorators) { + return emitDecoratorList(node, modifiers); + } + return node.pos; + } + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); + let lastMode; + let mode; + let start = 0; + let pos = 0; + let lastModifier; + while (start < modifiers.length) { + while (pos < modifiers.length) { + lastModifier = modifiers[pos]; + mode = isDecorator(lastModifier) ? "decorators" : "modifiers"; + if (lastMode === void 0) { + lastMode = mode; + } else if (mode !== lastMode) { + break; + } + pos++; + } + const textRange = { pos: -1, end: -1 }; + if (start === 0) + textRange.pos = modifiers.pos; + if (pos === modifiers.length - 1) + textRange.end = modifiers.end; + if (lastMode === "modifiers" || allowDecorators) { + emitNodeListItems( + emit3, + node, + modifiers, + lastMode === "modifiers" ? 2359808 : 2146305, + /*parenthesizerRule*/ + void 0, + start, + pos - start, + /*hasTrailingComma*/ + false, + textRange + ); + } + start = pos; + lastMode = mode; + pos++; + } + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); + if (lastModifier && !positionIsSynthesized(lastModifier.end)) { + return lastModifier.end; + } + } + return node.pos; + } + function emitModifierList(node, modifiers) { + emitList( + node, + modifiers, + 2359808 + /* Modifiers */ + ); + const lastModifier = lastOrUndefined(modifiers); + return lastModifier && !positionIsSynthesized(lastModifier.end) ? lastModifier.end : node.pos; + } + function emitTypeAnnotation(node) { + if (node) { + writePunctuation(":"); + writeSpace(); + emit3(node); + } + } + function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { + if (node) { + writeSpace(); + emitTokenWithComment(64, equalCommentStartPos, writeOperator, container); + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit22) { + if (node) { + prefixWriter(prefix); + emit22(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit3(node); + } + } + function emitExpressionWithLeadingSpace(node, parenthesizerRule) { + if (node) { + writeSpace(); + emitExpression(node, parenthesizerRule); + } + } + function emitWithTrailingSpace(node) { + if (node) { + emit3(node); + writeSpace(); + } + } + function emitEmbeddedStatement(parent22, node) { + if (isBlock2(node) || getEmitFlags(parent22) & 1 || preserveSourceNewlines && !getLeadingLineTerminatorCount( + parent22, + node, + 0 + /* None */ + )) { + writeSpace(); + emit3(node); + } else { + writeLine(); + increaseIndent(); + if (isEmptyStatement(node)) { + pipelineEmit(5, node); + } else { + emit3(node); + } + decreaseIndent(); + } + } + function emitDecoratorList(parentNode, decorators) { + emitList( + parentNode, + decorators, + 2146305 + /* Decorators */ + ); + const lastDecorator = lastOrUndefined(decorators); + return lastDecorator && !positionIsSynthesized(lastDecorator.end) ? lastDecorator.end : parentNode.pos; + } + function emitTypeArguments(parentNode, typeArguments) { + emitList(parentNode, typeArguments, 53776, typeArgumentParenthesizerRuleSelector); + } + function emitTypeParameters(parentNode, typeParameters) { + if (isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList( + parentNode, + typeParameters, + 53776 + /* TypeParameters */ + ); + } + function emitParameters(parentNode, parameters) { + emitList( + parentNode, + parameters, + 2576 + /* Parameters */ + ); + } + function canEmitSimpleArrowHead(parentNode, parameters) { + const parameter = singleOrUndefined(parameters); + return parameter && parameter.pos === parentNode.pos && isArrowFunction(parentNode) && !parentNode.type && !some2(parentNode.modifiers) && !some2(parentNode.typeParameters) && !some2(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && isIdentifier(parameter.name); + } + function emitParametersForArrow(parentNode, parameters) { + if (canEmitSimpleArrowHead(parentNode, parameters)) { + emitList( + parentNode, + parameters, + 2576 & ~2048 + /* Parenthesis */ + ); + } else { + emitParameters(parentNode, parameters); + } + } + function emitParametersForIndexSignature(parentNode, parameters) { + emitList( + parentNode, + parameters, + 8848 + /* IndexSignatureParameters */ + ); + } + function writeDelimiter(format5) { + switch (format5 & 60) { + case 0: + break; + case 16: + writePunctuation(","); + break; + case 4: + writeSpace(); + writePunctuation("|"); + break; + case 32: + writeSpace(); + writePunctuation("*"); + writeSpace(); + break; + case 8: + writeSpace(); + writePunctuation("&"); + break; + } + } + function emitList(parentNode, children, format5, parenthesizerRule, start, count2) { + emitNodeList( + emit3, + parentNode, + children, + format5 | (parentNode && getEmitFlags(parentNode) & 2 ? 65536 : 0), + parenthesizerRule, + start, + count2 + ); + } + function emitExpressionList(parentNode, children, format5, parenthesizerRule, start, count2) { + emitNodeList(emitExpression, parentNode, children, format5, parenthesizerRule, start, count2); + } + function emitNodeList(emit22, parentNode, children, format5, parenthesizerRule, start = 0, count2 = children ? children.length - start : 0) { + const isUndefined3 = children === void 0; + if (isUndefined3 && format5 & 16384) { + return; + } + const isEmpty4 = children === void 0 || start >= children.length || count2 === 0; + if (isEmpty4 && format5 & 32768) { + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); + return; + } + if (format5 & 15360) { + writePunctuation(getOpeningBracket(format5)); + if (isEmpty4 && children) { + emitTrailingCommentsOfPosition( + children.pos, + /*prefixSpace*/ + true + ); + } + } + onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); + if (isEmpty4) { + if (format5 & 1 && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { + writeLine(); + } else if (format5 & 256 && !(format5 & 524288)) { + writeSpace(); + } + } else { + emitNodeListItems(emit22, parentNode, children, format5, parenthesizerRule, start, count2, children.hasTrailingComma, children); + } + onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); + if (format5 & 15360) { + if (isEmpty4 && children) { + emitLeadingCommentsOfPosition(children.end); + } + writePunctuation(getClosingBracket(format5)); + } + } + function emitNodeListItems(emit22, parentNode, children, format5, parenthesizerRule, start, count2, hasTrailingComma, childrenTextRange) { + const mayEmitInterveningComments = (format5 & 262144) === 0; + let shouldEmitInterveningComments = mayEmitInterveningComments; + const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format5); + if (leadingLineTerminatorCount) { + writeLine(leadingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (format5 & 256) { + writeSpace(); + } + if (format5 & 128) { + increaseIndent(); + } + const emitListItem = getEmitListItem(emit22, parenthesizerRule); + let previousSibling; + let previousSourceFileTextKind; + let shouldDecreaseIndentAfterEmit = false; + for (let i7 = 0; i7 < count2; i7++) { + const child = children[start + i7]; + if (format5 & 32) { + writeLine(); + writeDelimiter(format5); + } else if (previousSibling) { + if (format5 & 60 && previousSibling.end !== (parentNode ? parentNode.end : -1)) { + const previousSiblingEmitFlags = getEmitFlags(previousSibling); + if (!(previousSiblingEmitFlags & 2048)) { + emitLeadingCommentsOfPosition(previousSibling.end); + } + } + writeDelimiter(format5); + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + const separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format5); + if (separatingLineTerminatorCount > 0) { + if ((format5 & (3 | 128)) === 0) { + increaseIndent(); + shouldDecreaseIndentAfterEmit = true; + } + if (shouldEmitInterveningComments && format5 & 60 && !positionIsSynthesized(child.pos)) { + const commentRange = getCommentRange(child); + emitTrailingCommentsOfPosition( + commentRange.pos, + /*prefixSpace*/ + !!(format5 & 512), + /*forceNoNewline*/ + true + ); + } + writeLine(separatingLineTerminatorCount); + shouldEmitInterveningComments = false; + } else if (previousSibling && format5 & 512) { + writeSpace(); + } + } + previousSourceFileTextKind = recordBundleFileInternalSectionStart(child); + if (shouldEmitInterveningComments) { + const commentRange = getCommentRange(child); + emitTrailingCommentsOfPosition(commentRange.pos); + } else { + shouldEmitInterveningComments = mayEmitInterveningComments; + } + nextListElementPos = child.pos; + emitListItem(child, emit22, parenthesizerRule, i7); + if (shouldDecreaseIndentAfterEmit) { + decreaseIndent(); + shouldDecreaseIndentAfterEmit = false; + } + previousSibling = child; + } + const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0; + const skipTrailingComments = commentsDisabled || !!(emitFlags & 2048); + const emitTrailingComma = hasTrailingComma && format5 & 64 && format5 & 16; + if (emitTrailingComma) { + if (previousSibling && !skipTrailingComments) { + emitTokenWithComment(28, previousSibling.end, writePunctuation, previousSibling); + } else { + writePunctuation(","); + } + } + if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format5 & 60 && !skipTrailingComments) { + emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange == null ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); + } + if (format5 & 128) { + decreaseIndent(); + } + recordBundleFileInternalSectionEnd(previousSourceFileTextKind); + const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count2 - 1], format5, childrenTextRange); + if (closingLineTerminatorCount) { + writeLine(closingLineTerminatorCount); + } else if (format5 & (2097152 | 256)) { + writeSpace(); + } + } + function writeLiteral(s7) { + writer.writeLiteral(s7); + } + function writeStringLiteral(s7) { + writer.writeStringLiteral(s7); + } + function writeBase(s7) { + writer.write(s7); + } + function writeSymbol(s7, sym) { + writer.writeSymbol(s7, sym); + } + function writePunctuation(s7) { + writer.writePunctuation(s7); + } + function writeTrailingSemicolon() { + writer.writeTrailingSemicolon(";"); + } + function writeKeyword(s7) { + writer.writeKeyword(s7); + } + function writeOperator(s7) { + writer.writeOperator(s7); + } + function writeParameter(s7) { + writer.writeParameter(s7); + } + function writeComment(s7) { + writer.writeComment(s7); + } + function writeSpace() { + writer.writeSpace(" "); + } + function writeProperty(s7) { + writer.writeProperty(s7); + } + function nonEscapingWrite(s7) { + if (writer.nonEscapingWrite) { + writer.nonEscapingWrite(s7); + } else { + writer.write(s7); + } + } + function writeLine(count2 = 1) { + for (let i7 = 0; i7 < count2; i7++) { + writer.writeLine(i7 > 0); + } + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function writeToken(token, pos, writer2, contextNode) { + return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); + } + function writeTokenNode(node, writer2) { + if (onBeforeEmitToken) { + onBeforeEmitToken(node); + } + writer2(tokenToString(node.kind)); + if (onAfterEmitToken) { + onAfterEmitToken(node); + } + } + function writeTokenText(token, writer2, pos) { + const tokenString = tokenToString(token); + writer2(tokenString); + return pos < 0 ? pos : pos + tokenString.length; + } + function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { + if (getEmitFlags(parentNode) & 1) { + writeSpace(); + } else if (preserveSourceNewlines) { + const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); + if (lines) { + writeLine(lines); + } else { + writeSpace(); + } + } else { + writeLine(); + } + } + function writeLines(text) { + const lines = text.split(/\r\n?|\n/g); + const indentation = guessIndentation(lines); + for (const lineText of lines) { + const line = indentation ? lineText.slice(indentation) : lineText; + if (line.length) { + writeLine(); + write(line); + } + } + } + function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { + if (lineCount) { + increaseIndent(); + writeLine(lineCount); + } else if (writeSpaceIfNotIndenting) { + writeSpace(); + } + } + function decreaseIndentIf(value1, value2) { + if (value1) { + decreaseIndent(); + } + if (value2) { + decreaseIndent(); + } + } + function getLeadingLineTerminatorCount(parentNode, firstChild, format5) { + if (format5 & 2 || preserveSourceNewlines) { + if (format5 & 65536) { + return 1; + } + if (firstChild === void 0) { + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (firstChild.pos === nextListElementPos) { + return 0; + } + if (firstChild.kind === 12) { + return 0; + } + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))) { + if (preserveSourceNewlines) { + return getEffectiveLines( + (includeComments) => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter( + firstChild.pos, + parentNode.pos, + currentSourceFile, + includeComments + ) + ); + } + return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(firstChild, format5)) { + return 1; + } + } + return format5 & 1 ? 1 : 0; + } + function getSeparatingLineTerminatorCount(previousNode, nextNode, format5) { + if (format5 & 2 || preserveSourceNewlines) { + if (previousNode === void 0 || nextNode === void 0) { + return 0; + } + if (nextNode.kind === 12) { + return 0; + } else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { + if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { + return getEffectiveLines( + (includeComments) => getLinesBetweenRangeEndAndRangeStart( + previousNode, + nextNode, + currentSourceFile, + includeComments + ) + ); + } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { + return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; + } + return format5 & 65536 ? 1 : 0; + } else if (synthesizedNodeStartsOnNewLine(previousNode, format5) || synthesizedNodeStartsOnNewLine(nextNode, format5)) { + return 1; + } + } else if (getStartsOnNewLine(nextNode)) { + return 1; + } + return format5 & 1 ? 1 : 0; + } + function getClosingLineTerminatorCount(parentNode, lastChild, format5, childrenTextRange) { + if (format5 & 2 || preserveSourceNewlines) { + if (format5 & 65536) { + return 1; + } + if (lastChild === void 0) { + return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; + } + if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { + if (preserveSourceNewlines) { + const end = childrenTextRange && !positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; + return getEffectiveLines( + (includeComments) => getLinesBetweenPositionAndNextNonWhitespaceCharacter( + end, + parentNode.end, + currentSourceFile, + includeComments + ) + ); + } + return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; + } + if (synthesizedNodeStartsOnNewLine(lastChild, format5)) { + return 1; + } + } + if (format5 & 1 && !(format5 & 131072)) { + return 1; + } + return 0; + } + function getEffectiveLines(getLineDifference) { + Debug.assert(!!preserveSourceNewlines); + const lines = getLineDifference( + /*includeComments*/ + true + ); + if (lines === 0) { + return getLineDifference( + /*includeComments*/ + false + ); + } + return lines; + } + function writeLineSeparatorsAndIndentBefore(node, parent22) { + const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount( + parent22, + node, + 0 + /* None */ + ); + if (leadingNewlines) { + writeLinesAndIndent( + leadingNewlines, + /*writeSpaceIfNotIndenting*/ + false + ); + } + return !!leadingNewlines; + } + function writeLineSeparatorsAfter(node, parent22) { + const trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount( + parent22, + node, + 0, + /*childrenTextRange*/ + void 0 + ); + if (trailingNewlines) { + writeLine(trailingNewlines); + } + } + function synthesizedNodeStartsOnNewLine(node, format5) { + if (nodeIsSynthesized(node)) { + const startsOnNewLine = getStartsOnNewLine(node); + if (startsOnNewLine === void 0) { + return (format5 & 65536) !== 0; + } + return startsOnNewLine; + } + return (format5 & 65536) !== 0; + } + function getLinesBetweenNodes(parent22, node1, node2) { + if (getEmitFlags(parent22) & 262144) { + return 0; + } + parent22 = skipSynthesizedParentheses(parent22); + node1 = skipSynthesizedParentheses(node1); + node2 = skipSynthesizedParentheses(node2); + if (getStartsOnNewLine(node2)) { + return 1; + } + if (currentSourceFile && !nodeIsSynthesized(parent22) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { + if (preserveSourceNewlines) { + return getEffectiveLines( + (includeComments) => getLinesBetweenRangeEndAndRangeStart( + node1, + node2, + currentSourceFile, + includeComments + ) + ); + } + return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; + } + return 0; + } + function isEmptyBlock(block) { + return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); + } + function skipSynthesizedParentheses(node) { + while (node.kind === 217 && nodeIsSynthesized(node)) { + node = node.expression; + } + return node; + } + function getTextOfNode2(node, includeTrivia) { + if (isGeneratedIdentifier(node) || isGeneratedPrivateIdentifier(node)) { + return generateName(node); + } + if (isStringLiteral(node) && node.textSourceNode) { + return getTextOfNode2(node.textSourceNode, includeTrivia); + } + const sourceFile = currentSourceFile; + const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node); + if (isMemberName(node)) { + if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { + return idText(node); + } + } else if (isJsxNamespacedName(node)) { + if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { + return getTextOfJsxNamespacedName(node); + } + } else { + Debug.assertNode(node, isLiteralExpression); + if (!canUseSourceFile) { + return node.text; + } + } + return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); + } + function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) { + if (node.kind === 11 && node.textSourceNode) { + const textSourceNode = node.textSourceNode; + if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode) || isJsxNamespacedName(textSourceNode)) { + const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode); + return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 16777216 ? `"${escapeString2(text)}"` : `"${escapeNonAsciiString(text)}"`; + } else { + return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); + } + } + const flags = (neverAsciiEscape ? 1 : 0) | (jsxAttributeEscape ? 2 : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 : 0) | (printerOptions.target && printerOptions.target >= 8 ? 8 : 0); + return getLiteralText(node, currentSourceFile, flags); + } + function pushNameGenerationScope(node) { + if (node && getEmitFlags(node) & 1048576) { + return; + } + tempFlagsStack.push(tempFlags); + tempFlags = 0; + formattedNameTempFlagsStack.push(formattedNameTempFlags); + formattedNameTempFlags = void 0; + reservedNamesStack.push(reservedNames); + } + function popNameGenerationScope(node) { + if (node && getEmitFlags(node) & 1048576) { + return; + } + tempFlags = tempFlagsStack.pop(); + formattedNameTempFlags = formattedNameTempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name2) { + if (!reservedNames || reservedNames === lastOrUndefined(reservedNamesStack)) { + reservedNames = /* @__PURE__ */ new Set(); + } + reservedNames.add(name2); + } + function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) { + privateNameTempFlagsStack.push(privateNameTempFlags); + privateNameTempFlags = newPrivateNameTempFlags; + reservedPrivateNamesStack.push(reservedNames); + reservedPrivateNames = newReservedMemberNames; + } + function popPrivateNameGenerationScope() { + privateNameTempFlags = privateNameTempFlagsStack.pop(); + reservedPrivateNames = reservedPrivateNamesStack.pop(); + } + function reservePrivateNameInNestedScopes(name2) { + if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) { + reservedPrivateNames = /* @__PURE__ */ new Set(); + } + reservedPrivateNames.add(name2); + } + function generateNames(node) { + if (!node) + return; + switch (node.kind) { + case 241: + forEach4(node.statements, generateNames); + break; + case 256: + case 254: + case 246: + case 247: + generateNames(node.statement); + break; + case 245: + generateNames(node.thenStatement); + generateNames(node.elseStatement); + break; + case 248: + case 250: + case 249: + generateNames(node.initializer); + generateNames(node.statement); + break; + case 255: + generateNames(node.caseBlock); + break; + case 269: + forEach4(node.clauses, generateNames); + break; + case 296: + case 297: + forEach4(node.statements, generateNames); + break; + case 258: + generateNames(node.tryBlock); + generateNames(node.catchClause); + generateNames(node.finallyBlock); + break; + case 299: + generateNames(node.variableDeclaration); + generateNames(node.block); + break; + case 243: + generateNames(node.declarationList); + break; + case 261: + forEach4(node.declarations, generateNames); + break; + case 260: + case 169: + case 208: + case 263: + generateNameIfNeeded(node.name); + break; + case 262: + generateNameIfNeeded(node.name); + if (getEmitFlags(node) & 1048576) { + forEach4(node.parameters, generateNames); + generateNames(node.body); + } + break; + case 206: + case 207: + forEach4(node.elements, generateNames); + break; + case 272: + generateNames(node.importClause); + break; + case 273: + generateNameIfNeeded(node.name); + generateNames(node.namedBindings); + break; + case 274: + generateNameIfNeeded(node.name); + break; + case 280: + generateNameIfNeeded(node.name); + break; + case 275: + forEach4(node.elements, generateNames); + break; + case 276: + generateNameIfNeeded(node.propertyName || node.name); + break; + } + } + function generateMemberNames(node) { + if (!node) + return; + switch (node.kind) { + case 303: + case 304: + case 172: + case 174: + case 177: + case 178: + generateNameIfNeeded(node.name); + break; + } + } + function generateNameIfNeeded(name2) { + if (name2) { + if (isGeneratedIdentifier(name2) || isGeneratedPrivateIdentifier(name2)) { + generateName(name2); + } else if (isBindingPattern(name2)) { + generateNames(name2); + } + } + } + function generateName(name2) { + const autoGenerate = name2.emitNode.autoGenerate; + if ((autoGenerate.flags & 7) === 4) { + return generateNameCached(getNodeForGeneratedName(name2), isPrivateIdentifier(name2), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix); + } else { + const autoGenerateId = autoGenerate.id; + return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name2)); + } + } + function generateNameCached(node, privateName, flags, prefix, suffix) { + const nodeId = getNodeId(node); + const cache = privateName ? nodeIdToGeneratedPrivateName : nodeIdToGeneratedName; + return cache[nodeId] || (cache[nodeId] = generateNameForNode(node, privateName, flags ?? 0, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); + } + function isUniqueName(name2, privateName) { + return isFileLevelUniqueNameInCurrentFile(name2, privateName) && !isReservedName(name2, privateName) && !generatedNames.has(name2); + } + function isReservedName(name2, privateName) { + return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name2)) : !!(reservedNames == null ? void 0 : reservedNames.has(name2)); + } + function isFileLevelUniqueNameInCurrentFile(name2, _isPrivate) { + return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name2, hasGlobalName) : true; + } + function isUniqueLocalName(name2, container) { + for (let node = container; node && isNodeDescendantOf(node, container); node = node.nextContainer) { + if (canHaveLocals(node) && node.locals) { + const local = node.locals.get(escapeLeadingUnderscores(name2)); + if (local && local.flags & (111551 | 1048576 | 2097152)) { + return false; + } + } + } + return true; + } + function getTempFlags(formattedNameKey) { + switch (formattedNameKey) { + case "": + return tempFlags; + case "#": + return privateNameTempFlags; + default: + return (formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) ?? 0; + } + } + function setTempFlags(formattedNameKey, flags) { + switch (formattedNameKey) { + case "": + tempFlags = flags; + break; + case "#": + privateNameTempFlags = flags; + break; + default: + formattedNameTempFlags ?? (formattedNameTempFlags = /* @__PURE__ */ new Map()); + formattedNameTempFlags.set(formattedNameKey, flags); + break; + } + } + function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { + if (prefix.length > 0 && prefix.charCodeAt(0) === 35) { + prefix = prefix.slice(1); + } + const key = formatGeneratedName(privateName, prefix, "", suffix); + let tempFlags2 = getTempFlags(key); + if (flags && !(tempFlags2 & flags)) { + const name2 = flags === 268435456 ? "_i" : "_n"; + const fullName = formatGeneratedName(privateName, prefix, name2, suffix); + if (isUniqueName(fullName, privateName)) { + tempFlags2 |= flags; + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + while (true) { + const count2 = tempFlags2 & 268435455; + tempFlags2++; + if (count2 !== 8 && count2 !== 13) { + const name2 = count2 < 26 ? "_" + String.fromCharCode(97 + count2) : "_" + (count2 - 26); + const fullName = formatGeneratedName(privateName, prefix, name2, suffix); + if (isUniqueName(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (reservedInNestedScopes) { + reserveNameInNestedScopes(fullName); + } + setTempFlags(key, tempFlags2); + return fullName; + } + } + } + } + function makeUniqueName2(baseName, checkFn = isUniqueName, optimistic, scoped, privateName, prefix, suffix) { + if (baseName.length > 0 && baseName.charCodeAt(0) === 35) { + baseName = baseName.slice(1); + } + if (prefix.length > 0 && prefix.charCodeAt(0) === 35) { + prefix = prefix.slice(1); + } + if (optimistic) { + const fullName = formatGeneratedName(privateName, prefix, baseName, suffix); + if (checkFn(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + } + if (baseName.charCodeAt(baseName.length - 1) !== 95) { + baseName += "_"; + } + let i7 = 1; + while (true) { + const fullName = formatGeneratedName(privateName, prefix, baseName + i7, suffix); + if (checkFn(fullName, privateName)) { + if (privateName) { + reservePrivateNameInNestedScopes(fullName); + } else if (scoped) { + reserveNameInNestedScopes(fullName); + } else { + generatedNames.add(fullName); + } + return fullName; + } + i7++; + } + } + function makeFileLevelOptimisticUniqueName(name2) { + return makeUniqueName2( + name2, + isFileLevelUniqueNameInCurrentFile, + /*optimistic*/ + true, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForModuleOrEnum(node) { + const name2 = getTextOfNode2(node.name); + return isUniqueLocalName(name2, tryCast(node, canHaveLocals)) ? name2 : makeUniqueName2( + name2, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForImportOrExportDeclaration(node) { + const expr = getExternalModuleName(node); + const baseName = isStringLiteral(expr) ? makeIdentifierFromModuleName(expr.text) : "module"; + return makeUniqueName2( + baseName, + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForExportDefault() { + return makeUniqueName2( + "default", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForClassExpression() { + return makeUniqueName2( + "class", + isUniqueName, + /*optimistic*/ + false, + /*scoped*/ + false, + /*privateName*/ + false, + /*prefix*/ + "", + /*suffix*/ + "" + ); + } + function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { + if (isIdentifier(node.name)) { + return generateNameCached(node.name, privateName); + } + return makeTempVariableName( + 0, + /*reservedInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + function generateNameForNode(node, privateName, flags, prefix, suffix) { + switch (node.kind) { + case 80: + case 81: + return makeUniqueName2( + getTextOfNode2(node), + isUniqueName, + !!(flags & 16), + !!(flags & 8), + privateName, + prefix, + suffix + ); + case 267: + case 266: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForModuleOrEnum(node); + case 272: + case 278: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForImportOrExportDeclaration(node); + case 262: + case 263: { + Debug.assert(!prefix && !suffix && !privateName); + const name2 = node.name; + if (name2 && !isGeneratedIdentifier(name2)) { + return generateNameForNode( + name2, + /*privateName*/ + false, + flags, + prefix, + suffix + ); + } + return generateNameForExportDefault(); + } + case 277: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForExportDefault(); + case 231: + Debug.assert(!prefix && !suffix && !privateName); + return generateNameForClassExpression(); + case 174: + case 177: + case 178: + return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); + case 167: + return makeTempVariableName( + 0, + /*reservedInNestedScopes*/ + true, + privateName, + prefix, + suffix + ); + default: + return makeTempVariableName( + 0, + /*reservedInNestedScopes*/ + false, + privateName, + prefix, + suffix + ); + } + } + function makeName(name2) { + const autoGenerate = name2.emitNode.autoGenerate; + const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName); + const suffix = formatGeneratedNamePart(autoGenerate.suffix); + switch (autoGenerate.flags & 7) { + case 1: + return makeTempVariableName(0, !!(autoGenerate.flags & 8), isPrivateIdentifier(name2), prefix, suffix); + case 2: + Debug.assertNode(name2, isIdentifier); + return makeTempVariableName( + 268435456, + !!(autoGenerate.flags & 8), + /*privateName*/ + false, + prefix, + suffix + ); + case 3: + return makeUniqueName2( + idText(name2), + autoGenerate.flags & 32 ? isFileLevelUniqueNameInCurrentFile : isUniqueName, + !!(autoGenerate.flags & 16), + !!(autoGenerate.flags & 8), + isPrivateIdentifier(name2), + prefix, + suffix + ); + } + return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum( + autoGenerate.flags & 7, + GeneratedIdentifierFlags, + /*isFlags*/ + true + )}.`); + } + function pipelineEmitWithComments(hint, node) { + const pipelinePhase = getNextPipelinePhase(2, hint, node); + const savedContainerPos = containerPos; + const savedContainerEnd = containerEnd; + const savedDeclarationListContainerEnd = declarationListContainerEnd; + emitCommentsBeforeNode(node); + pipelinePhase(hint, node); + emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + function emitCommentsBeforeNode(node) { + const emitFlags = getEmitFlags(node); + const commentRange = getCommentRange(node); + emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); + if (emitFlags & 4096) { + commentsDisabled = true; + } + } + function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + const emitFlags = getEmitFlags(node); + const commentRange = getCommentRange(node); + if (emitFlags & 4096) { + commentsDisabled = false; + } + emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + const typeNode = getTypeNode(node); + if (typeNode) { + emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); + } + } + function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { + enterComment(); + hasWrittenComment = false; + const skipLeadingComments = pos < 0 || (emitFlags & 1024) !== 0 || node.kind === 12; + const skipTrailingComments = end < 0 || (emitFlags & 2048) !== 0 || node.kind === 12; + if ((pos > 0 || end > 0) && pos !== end) { + if (!skipLeadingComments) { + emitLeadingComments( + pos, + /*isEmittedNode*/ + node.kind !== 359 + /* NotEmittedStatement */ + ); + } + if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024) !== 0) { + containerPos = pos; + } + if (!skipTrailingComments || end >= 0 && (emitFlags & 2048) !== 0) { + containerEnd = end; + if (node.kind === 261) { + declarationListContainerEnd = end; + } + } + } + forEach4(getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); + exitComment(); + } + function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { + enterComment(); + const skipTrailingComments = end < 0 || (emitFlags & 2048) !== 0 || node.kind === 12; + forEach4(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); + if ((pos > 0 || end > 0) && pos !== end) { + containerPos = savedContainerPos; + containerEnd = savedContainerEnd; + declarationListContainerEnd = savedDeclarationListContainerEnd; + if (!skipTrailingComments && node.kind !== 359) { + emitTrailingComments(end); + } + } + exitComment(); + } + function emitLeadingSynthesizedComment(comment) { + if (comment.hasLeadingNewline || comment.kind === 2) { + writer.writeLine(); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine || comment.kind === 2) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function emitTrailingSynthesizedComment(comment) { + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + writeSynthesizedComment(comment); + if (comment.hasTrailingNewLine) { + writer.writeLine(); + } + } + function writeSynthesizedComment(comment) { + const text = formatSynthesizedComment(comment); + const lineMap = comment.kind === 3 ? computeLineStarts(text) : void 0; + writeCommentRange(text, lineMap, writer, 0, text.length, newLine); + } + function formatSynthesizedComment(comment) { + return comment.kind === 3 ? `/*${comment.text}*/` : `//${comment.text}`; + } + function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { + enterComment(); + const { pos, end } = detachedRange; + const emitFlags = getEmitFlags(node); + const skipLeadingComments = pos < 0 || (emitFlags & 1024) !== 0; + const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 2048) !== 0; + if (!skipLeadingComments) { + emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); + } + exitComment(); + if (emitFlags & 4096 && !commentsDisabled) { + commentsDisabled = true; + emitCallback(node); + commentsDisabled = false; + } else { + emitCallback(node); + } + enterComment(); + if (!skipTrailingComments) { + emitLeadingComments( + detachedRange.end, + /*isEmittedNode*/ + true + ); + if (hasWrittenComment && !writer.isAtStartOfLine()) { + writer.writeLine(); + } + } + exitComment(); + } + function originalNodesHaveSameParent(nodeA, nodeB) { + nodeA = getOriginalNode(nodeA); + return nodeA.parent && nodeA.parent === getOriginalNode(nodeB).parent; + } + function siblingNodePositionsAreComparable(previousNode, nextNode) { + if (nextNode.pos < previousNode.end) { + return false; + } + previousNode = getOriginalNode(previousNode); + nextNode = getOriginalNode(nextNode); + const parent22 = previousNode.parent; + if (!parent22 || parent22 !== nextNode.parent) { + return false; + } + const parentNodeArray = getContainingNodeArray(previousNode); + const prevNodeIndex = parentNodeArray == null ? void 0 : parentNodeArray.indexOf(previousNode); + return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; + } + function emitLeadingComments(pos, isEmittedNode) { + hasWrittenComment = false; + if (isEmittedNode) { + if (pos === 0 && (currentSourceFile == null ? void 0 : currentSourceFile.isDeclarationFile)) { + forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); + } else { + forEachLeadingCommentToEmit(pos, emitLeadingComment); + } + } else if (pos === 0) { + forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); + } + } + function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!isTripleSlashComment(commentPos, commentEnd)) { + emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); + } + } + function shouldWriteComment(text, pos) { + if (printerOptions.onlyPrintJsDocStyle) { + return isJSDocLikeText(text, pos) || isPinnedComment(text, pos); + } + return true; + } + function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!hasWrittenComment) { + emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); + hasWrittenComment = true; + } + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else if (kind === 3) { + writer.writeSpace(" "); + } + } + function emitLeadingCommentsOfPosition(pos) { + if (commentsDisabled || pos === -1) { + return; + } + emitLeadingComments( + pos, + /*isEmittedNode*/ + true + ); + } + function emitTrailingComments(pos) { + forEachTrailingCommentToEmit(pos, emitTrailingComment); + } + function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + if (!writer.isAtStartOfLine()) { + writer.writeSpace(" "); + } + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } + } + function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { + if (commentsDisabled) { + return; + } + enterComment(); + forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); + exitComment(); + } + function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { + if (!currentSourceFile) + return; + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (kind === 2) { + writer.writeLine(); + } + } + function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { + if (!currentSourceFile) + return; + emitPos(commentPos); + writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); + emitPos(commentEnd); + if (hasTrailingNewLine) { + writer.writeLine(); + } else { + writer.writeSpace(" "); + } + } + function forEachLeadingCommentToEmit(pos, cb) { + if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { + if (hasDetachedComments(pos)) { + forEachLeadingCommentWithoutDetachedComments(cb); + } else { + forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + } + } + function forEachTrailingCommentToEmit(end, cb) { + if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { + forEachTrailingCommentRange(currentSourceFile.text, end, cb); + } + } + function hasDetachedComments(pos) { + return detachedCommentsInfo !== void 0 && last2(detachedCommentsInfo).nodePos === pos; + } + function forEachLeadingCommentWithoutDetachedComments(cb) { + if (!currentSourceFile) + return; + const pos = last2(detachedCommentsInfo).detachedCommentEndPos; + if (detachedCommentsInfo.length - 1) { + detachedCommentsInfo.pop(); + } else { + detachedCommentsInfo = void 0; + } + forEachLeadingCommentRange( + currentSourceFile.text, + pos, + cb, + /*state*/ + pos + ); + } + function emitDetachedCommentsAndUpdateCommentsInfo(range2) { + const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range2, newLine, commentsDisabled); + if (currentDetachedCommentInfo) { + if (detachedCommentsInfo) { + detachedCommentsInfo.push(currentDetachedCommentInfo); + } else { + detachedCommentsInfo = [currentDetachedCommentInfo]; + } + } + } + function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { + if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) + return; + emitPos(commentPos); + writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); + emitPos(commentEnd); + } + function isTripleSlashComment(commentPos, commentEnd) { + return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); + } + function getParsedSourceMap(node) { + if (node.parsedSourceMap === void 0 && node.sourceMapText !== void 0) { + node.parsedSourceMap = tryParseRawSourceMap(node.sourceMapText) || false; + } + return node.parsedSourceMap || void 0; + } + function pipelineEmitWithSourceMaps(hint, node) { + const pipelinePhase = getNextPipelinePhase(3, hint, node); + emitSourceMapsBeforeNode(node); + pipelinePhase(hint, node); + emitSourceMapsAfterNode(node); + } + function emitSourceMapsBeforeNode(node) { + const emitFlags = getEmitFlags(node); + const sourceMapRange = getSourceMapRange(node); + if (isUnparsedNode(node)) { + Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers"); + const parsed = getParsedSourceMap(node.parent); + if (parsed && sourceMapGenerator) { + sourceMapGenerator.appendSourceMap( + writer.getLine(), + writer.getColumn(), + parsed, + node.parent.sourceMapPath, + node.parent.getLineAndCharacterOfPosition(node.pos), + node.parent.getLineAndCharacterOfPosition(node.end) + ); + } + } else { + const source = sourceMapRange.source || sourceMapSource; + if (node.kind !== 359 && (emitFlags & 32) === 0 && sourceMapRange.pos >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); + } + if (emitFlags & 128) { + sourceMapsDisabled = true; + } + } + } + function emitSourceMapsAfterNode(node) { + const emitFlags = getEmitFlags(node); + const sourceMapRange = getSourceMapRange(node); + if (!isUnparsedNode(node)) { + if (emitFlags & 128) { + sourceMapsDisabled = false; + } + if (node.kind !== 359 && (emitFlags & 64) === 0 && sourceMapRange.end >= 0) { + emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); + } + } + } + function skipSourceTrivia(source, pos) { + return source.skipTrivia ? source.skipTrivia(pos) : skipTrivia(source.text, pos); + } + function emitPos(pos) { + if (sourceMapsDisabled || positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { + return; + } + const { line: sourceLine, character: sourceCharacter } = getLineAndCharacterOfPosition(sourceMapSource, pos); + sourceMapGenerator.addMapping( + writer.getLine(), + writer.getColumn(), + sourceMapSourceIndex, + sourceLine, + sourceCharacter, + /*nameIndex*/ + void 0 + ); + } + function emitSourcePos(source, pos) { + if (source !== sourceMapSource) { + const savedSourceMapSource = sourceMapSource; + const savedSourceMapSourceIndex = sourceMapSourceIndex; + setSourceMapSource(source); + emitPos(pos); + resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); + } else { + emitPos(pos); + } + } + function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { + if (sourceMapsDisabled || node && isInJsonFile(node)) { + return emitCallback(token, writer2, tokenPos); + } + const emitNode = node && node.emitNode; + const emitFlags = emitNode && emitNode.flags || 0; + const range2 = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; + const source = range2 && range2.source || sourceMapSource; + tokenPos = skipSourceTrivia(source, range2 ? range2.pos : tokenPos); + if ((emitFlags & 256) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + tokenPos = emitCallback(token, writer2, tokenPos); + if (range2) + tokenPos = range2.end; + if ((emitFlags & 512) === 0 && tokenPos >= 0) { + emitSourcePos(source, tokenPos); + } + return tokenPos; + } + function setSourceMapSource(source) { + if (sourceMapsDisabled) { + return; + } + sourceMapSource = source; + if (source === mostRecentlyAddedSourceMapSource) { + sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; + return; + } + if (isJsonSourceMapSource(source)) { + return; + } + sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); + if (printerOptions.inlineSources) { + sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); + } + mostRecentlyAddedSourceMapSource = source; + mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; + } + function resetSourceMapSource(source, sourceIndex) { + sourceMapSource = source; + sourceMapSourceIndex = sourceIndex; + } + function isJsonSourceMapSource(sourceFile) { + return fileExtensionIs( + sourceFile.fileName, + ".json" + /* Json */ + ); + } + } + function createBracketsMap() { + const brackets2 = []; + brackets2[ + 1024 + /* Braces */ + ] = ["{", "}"]; + brackets2[ + 2048 + /* Parenthesis */ + ] = ["(", ")"]; + brackets2[ + 4096 + /* AngleBrackets */ + ] = ["<", ">"]; + brackets2[ + 8192 + /* SquareBrackets */ + ] = ["[", "]"]; + return brackets2; + } + function getOpeningBracket(format5) { + return brackets[ + format5 & 15360 + /* BracketsMask */ + ][0]; + } + function getClosingBracket(format5) { + return brackets[ + format5 & 15360 + /* BracketsMask */ + ][1]; + } + function emitListItemNoParenthesizer(node, emit3, _parenthesizerRule, _index) { + emit3(node); + } + function emitListItemWithParenthesizerRuleSelector(node, emit3, parenthesizerRuleSelector, index4) { + emit3(node, parenthesizerRuleSelector.select(index4)); + } + function emitListItemWithParenthesizerRule(node, emit3, parenthesizerRule, _index) { + emit3(node, parenthesizerRule); + } + function getEmitListItem(emit3, parenthesizerRule) { + return emit3.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; + } + var brackets, notImplementedResolver, createPrinterWithDefaults, createPrinterWithRemoveComments, createPrinterWithRemoveCommentsNeverAsciiEscape, createPrinterWithRemoveCommentsOmitTrailingSemicolon; + var init_emitter = __esm2({ + "src/compiler/emitter.ts"() { + "use strict"; + init_ts2(); + init_ts2(); + init_ts_performance(); + brackets = createBracketsMap(); + notImplementedResolver = { + hasGlobalName: notImplemented, + getReferencedExportContainer: notImplemented, + getReferencedImportDeclaration: notImplemented, + getReferencedDeclarationWithCollidingName: notImplemented, + isDeclarationWithCollidingName: notImplemented, + isValueAliasDeclaration: notImplemented, + isReferencedAliasDeclaration: notImplemented, + isTopLevelValueImportEqualsWithEntityName: notImplemented, + getNodeCheckFlags: notImplemented, + isDeclarationVisible: notImplemented, + isLateBound: (_node) => false, + collectLinkedAliases: notImplemented, + isImplementationOfOverload: notImplemented, + isRequiredInitializedParameter: notImplemented, + isOptionalUninitializedParameterProperty: notImplemented, + isExpandoFunctionDeclaration: notImplemented, + getPropertiesOfContainerFunction: notImplemented, + createTypeOfDeclaration: notImplemented, + createReturnTypeOfSignatureDeclaration: notImplemented, + createTypeOfExpression: notImplemented, + createLiteralConstValue: notImplemented, + isSymbolAccessible: notImplemented, + isEntityNameVisible: notImplemented, + // Returns the constant value this property access resolves to: notImplemented, or 'undefined' for a non-constant + getConstantValue: notImplemented, + getReferencedValueDeclaration: notImplemented, + getReferencedValueDeclarations: notImplemented, + getTypeReferenceSerializationKind: notImplemented, + isOptionalParameter: notImplemented, + moduleExportsSomeValue: notImplemented, + isArgumentsLocalBinding: notImplemented, + getExternalModuleFileFromDeclaration: notImplemented, + getTypeReferenceDirectivesForEntityName: notImplemented, + getTypeReferenceDirectivesForSymbol: notImplemented, + isLiteralConstDeclaration: notImplemented, + getJsxFactoryEntity: notImplemented, + getJsxFragmentFactoryEntity: notImplemented, + getAllAccessorDeclarations: notImplemented, + getSymbolOfExternalModuleSpecifier: notImplemented, + isBindingCapturedByNode: notImplemented, + getDeclarationStatementsForSourceFile: notImplemented, + isImportRequiredByAugmentation: notImplemented, + tryFindAmbientModule: notImplemented + }; + createPrinterWithDefaults = /* @__PURE__ */ memoize2(() => createPrinter({})); + createPrinterWithRemoveComments = /* @__PURE__ */ memoize2(() => createPrinter({ removeComments: true })); + createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize2(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); + createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize2(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); + } + }); + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) { + if (!host.getDirectories || !host.readDirectory) { + return void 0; + } + const cachedReadDirectoryResult = /* @__PURE__ */ new Map(); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + fileExists, + readFile: (path2, encoding) => host.readFile(path2, encoding), + directoryExists: host.directoryExists && directoryExists, + getDirectories, + readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile22, + addOrDeleteFileOrDirectory, + addOrDeleteFile, + clearCache, + realpath: host.realpath && realpath2 + }; + function toPath3(fileName) { + return toPath2(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(ensureTrailingDirectorySeparator(rootDirPath)); + } + function getCachedFileSystemEntriesForBaseDir(path2) { + const entries = getCachedFileSystemEntries(getDirectoryPath(path2)); + if (!entries) { + return entries; + } + if (!entries.sortedAndCanonicalizedFiles) { + entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort(); + entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort(); + } + return entries; + } + function getBaseNameOfFileName(fileName) { + return getBaseFileName(normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var _a2; + if (!host.realpath || ensureTrailingDirectorySeparator(toPath3(host.realpath(rootDir))) === rootDirPath) { + const resultFromHost = { + files: map4(host.readDirectory( + rootDir, + /*extensions*/ + void 0, + /*exclude*/ + void 0, + /*include*/ + ["*.*"] + ), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(ensureTrailingDirectorySeparator(rootDirPath), resultFromHost); + return resultFromHost; + } + if ((_a2 = host.directoryExists) == null ? void 0 : _a2.call(host, rootDir)) { + cachedReadDirectoryResult.set(rootDirPath, false); + return false; + } + return void 0; + } + function tryReadDirectory2(rootDir, rootDirPath) { + rootDirPath = ensureTrailingDirectorySeparator(rootDirPath); + const cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } catch (_e2) { + Debug.assert(!cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(rootDirPath))); + return void 0; + } + } + function hasEntry(entries, name2) { + const index4 = binarySearch(entries, name2, identity2, compareStringsCaseSensitive); + return index4 >= 0; + } + function writeFile22(fileName, data, writeByteOrderMark) { + const path2 = toPath3(fileName); + const result2 = getCachedFileSystemEntriesForBaseDir(path2); + if (result2) { + updateFilesOfFileSystemEntry( + result2, + getBaseNameOfFileName(fileName), + /*fileExists*/ + true + ); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + const path2 = toPath3(fileName); + const result2 = getCachedFileSystemEntriesForBaseDir(path2); + return result2 && hasEntry(result2.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) || host.fileExists(fileName); + } + function directoryExists(dirPath) { + const path2 = toPath3(dirPath); + return cachedReadDirectoryResult.has(ensureTrailingDirectorySeparator(path2)) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + const path2 = toPath3(dirPath); + const result2 = getCachedFileSystemEntriesForBaseDir(path2); + if (result2) { + const baseName = getBaseNameOfFileName(dirPath); + const canonicalizedBaseName = getCanonicalFileName(baseName); + const canonicalizedDirectories = result2.sortedAndCanonicalizedDirectories; + if (insertSorted(canonicalizedDirectories, canonicalizedBaseName, compareStringsCaseSensitive)) { + result2.directories.push(baseName); + } + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + const rootDirPath = toPath3(rootDir); + const result2 = tryReadDirectory2(rootDir, rootDirPath); + if (result2) { + return result2.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions6, excludes, includes2, depth) { + const rootDirPath = toPath3(rootDir); + const rootResult = tryReadDirectory2(rootDir, rootDirPath); + let rootSymLinkResult; + if (rootResult !== void 0) { + return matchFiles(rootDir, extensions6, excludes, includes2, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath2); + } + return host.readDirectory(rootDir, extensions6, excludes, includes2, depth); + function getFileSystemEntries(dir2) { + const path2 = toPath3(dir2); + if (path2 === rootDirPath) { + return rootResult || getFileSystemEntriesFromHost(dir2, path2); + } + const result2 = tryReadDirectory2(dir2, path2); + return result2 !== void 0 ? result2 || getFileSystemEntriesFromHost(dir2, path2) : emptyFileSystemEntries; + } + function getFileSystemEntriesFromHost(dir2, path2) { + if (rootSymLinkResult && path2 === rootDirPath) + return rootSymLinkResult; + const result2 = { + files: map4(host.readDirectory( + dir2, + /*extensions*/ + void 0, + /*exclude*/ + void 0, + /*include*/ + ["*.*"] + ), getBaseNameOfFileName) || emptyArray, + directories: host.getDirectories(dir2) || emptyArray + }; + if (path2 === rootDirPath) + rootSymLinkResult = result2; + return result2; + } + } + function realpath2(s7) { + return host.realpath ? host.realpath(s7) : s7; + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + const existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult !== void 0) { + clearCache(); + return void 0; + } + const parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return void 0; + } + if (!host.directoryExists) { + clearCache(); + return void 0; + } + const baseName = getBaseNameOfFileName(fileOrDirectory); + const fsQueryResult = { + fileExists: host.fileExists(fileOrDirectory), + directoryExists: host.directoryExists(fileOrDirectory) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) { + clearCache(); + } else { + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === 1) { + return; + } + const parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry( + parentResult, + getBaseNameOfFileName(fileName), + eventKind === 0 + /* Created */ + ); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists2) { + const canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles; + const canonicalizedBaseName = getCanonicalFileName(baseName); + if (fileExists2) { + if (insertSorted(canonicalizedFiles, canonicalizedBaseName, compareStringsCaseSensitive)) { + parentResult.files.push(baseName); + } + } else { + const sortedIndex2 = binarySearch(canonicalizedFiles, canonicalizedBaseName, identity2, compareStringsCaseSensitive); + if (sortedIndex2 >= 0) { + canonicalizedFiles.splice(sortedIndex2, 1); + const unsortedIndex = parentResult.files.findIndex((entry) => getCanonicalFileName(entry) === canonicalizedBaseName); + parentResult.files.splice(unsortedIndex, 1); + } + } + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath3) { + var _a2; + const extendedConfigs = arrayToMap(((_a2 = options == null ? void 0 : options.configFile) == null ? void 0 : _a2.extendedSourceFiles) || emptyArray, toPath3); + extendedConfigFilesMap.forEach((watcher, extendedConfigFilePath) => { + if (!extendedConfigs.has(extendedConfigFilePath)) { + watcher.projects.delete(projectPath); + watcher.close(); + } + }); + extendedConfigs.forEach((extendedConfigFileName, extendedConfigFilePath) => { + const existing = extendedConfigFilesMap.get(extendedConfigFilePath); + if (existing) { + existing.projects.add(projectPath); + } else { + extendedConfigFilesMap.set(extendedConfigFilePath, { + projects: /* @__PURE__ */ new Set([projectPath]), + watcher: createExtendedConfigFileWatch(extendedConfigFileName, extendedConfigFilePath), + close: () => { + const existing2 = extendedConfigFilesMap.get(extendedConfigFilePath); + if (!existing2 || existing2.projects.size !== 0) + return; + existing2.watcher.close(); + extendedConfigFilesMap.delete(extendedConfigFilePath); + } + }); + } + }); + } + function clearSharedExtendedConfigFileWatcher(projectPath, extendedConfigFilesMap) { + extendedConfigFilesMap.forEach((watcher) => { + if (watcher.projects.delete(projectPath)) + watcher.close(); + }); + } + function cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath3) { + if (!extendedConfigCache.delete(extendedConfigFilePath)) + return; + extendedConfigCache.forEach(({ extendedResult }, key) => { + var _a2; + if ((_a2 = extendedResult.extendedSourceFiles) == null ? void 0 : _a2.some((extendedFile) => toPath3(extendedFile) === extendedConfigFilePath)) { + cleanExtendedConfigCache(extendedConfigCache, key, toPath3); + } + }); + } + function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) { + mutateMap( + missingFileWatches, + program.getMissingFilePaths(), + { + // Watch the missing files + createNewValue: createMissingFileWatch, + // Files that are no longer missing (e.g. because they are no longer required) + // should no longer be watched. + onDeleteValue: closeFileWatcher + } + ); + } + function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) { + if (wildcardDirectories) { + mutateMap( + existingWatchedForWildcards, + new Map(Object.entries(wildcardDirectories)), + { + // Create new watch and recursive info + createNewValue: createWildcardDirectoryWatcher, + // Close existing watch thats not needed any more + onDeleteValue: closeFileWatcherOf, + // Close existing watch that doesnt match in the flags + onExistingValue: updateWildcardDirectoryWatcher + } + ); + } else { + clearMap(existingWatchedForWildcards, closeFileWatcherOf); + } + function createWildcardDirectoryWatcher(directory, flags) { + return { + watcher: watchDirectory(directory, flags), + flags + }; + } + function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) { + if (existingWatcher.flags === flags) { + return; + } + existingWatcher.watcher.close(); + existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags)); + } + } + function isIgnoredFileFromWildCardWatching({ + watchedDirPath, + fileOrDirectory, + fileOrDirectoryPath, + configFileName, + options, + program, + extraFileExtensions, + currentDirectory, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + writeLog, + toPath: toPath3, + getScriptKind: getScriptKind2 + }) { + const newPath = removeIgnoredPath(fileOrDirectoryPath); + if (!newPath) { + writeLog(`Project: ${configFileName} Detected ignored path: ${fileOrDirectory}`); + return true; + } + fileOrDirectoryPath = newPath; + if (fileOrDirectoryPath === watchedDirPath) + return false; + if (hasExtension(fileOrDirectoryPath) && !(isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions) || isSupportedScriptKind())) { + writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`); + return true; + } + if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) { + writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`); + return true; + } + if (!program) + return false; + if (outFile(options) || options.outDir) + return false; + if (isDeclarationFileName(fileOrDirectoryPath)) { + if (options.declarationDir) + return false; + } else if (!fileExtensionIsOneOf(fileOrDirectoryPath, supportedJSExtensionsFlat)) { + return false; + } + const filePathWithoutExtension = removeFileExtension(fileOrDirectoryPath); + const realProgram = isArray3(program) ? void 0 : isBuilderProgram(program) ? program.getProgramOrUndefined() : program; + const builderProgram = !realProgram && !isArray3(program) ? program : void 0; + if (hasSourceFile( + filePathWithoutExtension + ".ts" + /* Ts */ + ) || hasSourceFile( + filePathWithoutExtension + ".tsx" + /* Tsx */ + )) { + writeLog(`Project: ${configFileName} Detected output file: ${fileOrDirectory}`); + return true; + } + return false; + function hasSourceFile(file) { + return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find2(program, (rootFile) => toPath3(rootFile) === file); + } + function isSupportedScriptKind() { + if (!getScriptKind2) + return false; + const scriptKind = getScriptKind2(fileOrDirectory); + switch (scriptKind) { + case 3: + case 4: + case 7: + case 5: + return true; + case 1: + case 2: + return getAllowJSCompilerOption(options); + case 6: + return getResolveJsonModule(options); + case 0: + return false; + } + } + } + function isBuilderProgram(program) { + return !!program.getState; + } + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + function getWatchFactory(host, watchLogLevel, log3, getDetailWatchInfo2) { + setSysLog(watchLogLevel === 2 ? log3 : noop4); + const plainInvokeFactory = { + watchFile: (file, callback, pollingInterval, options) => host.watchFile(file, callback, pollingInterval, options), + watchDirectory: (directory, callback, flags, options) => host.watchDirectory(directory, callback, (flags & 1) !== 0, options) + }; + const triggerInvokingFactory = watchLogLevel !== 0 ? { + watchFile: createTriggerLoggingAddWatch("watchFile"), + watchDirectory: createTriggerLoggingAddWatch("watchDirectory") + } : void 0; + const factory2 = watchLogLevel === 2 ? { + watchFile: createFileWatcherWithLogging, + watchDirectory: createDirectoryWatcherWithLogging + } : triggerInvokingFactory || plainInvokeFactory; + const excludeWatcherFactory = watchLogLevel === 2 ? createExcludeWatcherWithLogging : returnNoopFileWatcher; + return { + watchFile: createExcludeHandlingAddWatch("watchFile"), + watchDirectory: createExcludeHandlingAddWatch("watchDirectory") + }; + function createExcludeHandlingAddWatch(key) { + return (file, cb, flags, options, detailInfo1, detailInfo2) => { + var _a2; + return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2(), ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)) || "") ? factory2[key].call( + /*thisArgs*/ + void 0, + file, + cb, + flags, + options, + detailInfo1, + detailInfo2 + ) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); + }; + } + function useCaseSensitiveFileNames2() { + return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); + } + function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { + log3(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + return { + close: () => log3(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`) + }; + } + function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + log3(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); + return { + close: () => { + log3(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); + watcher.close(); + } + }; + } + function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { + const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log3(watchInfo); + const start = timestamp3(); + const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); + const elapsed = timestamp3() - start; + log3(`Elapsed:: ${elapsed}ms ${watchInfo}`); + return { + close: () => { + const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log3(watchInfo2); + const start2 = timestamp3(); + watcher.close(); + const elapsed2 = timestamp3() - start2; + log3(`Elapsed:: ${elapsed2}ms ${watchInfo2}`); + } + }; + } + function createTriggerLoggingAddWatch(key) { + return (file, cb, flags, options, detailInfo1, detailInfo2) => plainInvokeFactory[key].call( + /*thisArgs*/ + void 0, + file, + (...args) => { + const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; + log3(triggerredInfo); + const start = timestamp3(); + cb.call( + /*thisArg*/ + void 0, + ...args + ); + const elapsed = timestamp3() - start; + log3(`Elapsed:: ${elapsed}ms ${triggerredInfo}`); + }, + flags, + options, + detailInfo1, + detailInfo2 + ); + } + function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo3) { + return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo3 ? getDetailWatchInfo3(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; + } + } + function getFallbackOptions(options) { + const fallbackPolling = options == null ? void 0 : options.fallbackPolling; + return { + watchFile: fallbackPolling !== void 0 ? fallbackPolling : 1 + /* PriorityPollingInterval */ + }; + } + function closeFileWatcherOf(objWithWatcher) { + objWithWatcher.watcher.close(); + } + var ProgramUpdateLevel, WatchLogLevel; + var init_watchUtilities = __esm2({ + "src/compiler/watchUtilities.ts"() { + "use strict"; + init_ts2(); + ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => { + ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update"; + ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate"; + ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full"; + return ProgramUpdateLevel2; + })(ProgramUpdateLevel || {}); + WatchLogLevel = /* @__PURE__ */ ((WatchLogLevel2) => { + WatchLogLevel2[WatchLogLevel2["None"] = 0] = "None"; + WatchLogLevel2[WatchLogLevel2["TriggerOnly"] = 1] = "TriggerOnly"; + WatchLogLevel2[WatchLogLevel2["Verbose"] = 2] = "Verbose"; + return WatchLogLevel2; + })(WatchLogLevel || {}); + } + }); + function findConfigFile(searchPath, fileExists, configName = "tsconfig.json") { + return forEachAncestorDirectory(searchPath, (ancestor) => { + const fileName = combinePaths(ancestor, configName); + return fileExists(fileName) ? fileName : void 0; + }); + } + function resolveTripleslashReference(moduleName3, containingFile) { + const basePath = getDirectoryPath(containingFile); + const referencedFileName = isRootedDiskPath(moduleName3) ? moduleName3 : combinePaths(basePath, moduleName3); + return normalizePath(referencedFileName); + } + function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { + let commonPathComponents; + const failed = forEach4(fileNames, (sourceFile) => { + const sourcePathComponents = getNormalizedPathComponents(sourceFile, currentDirectory); + sourcePathComponents.pop(); + if (!commonPathComponents) { + commonPathComponents = sourcePathComponents; + return; + } + const n7 = Math.min(commonPathComponents.length, sourcePathComponents.length); + for (let i7 = 0; i7 < n7; i7++) { + if (getCanonicalFileName(commonPathComponents[i7]) !== getCanonicalFileName(sourcePathComponents[i7])) { + if (i7 === 0) { + return true; + } + commonPathComponents.length = i7; + break; + } + } + if (sourcePathComponents.length < commonPathComponents.length) { + commonPathComponents.length = sourcePathComponents.length; + } + }); + if (failed) { + return ""; + } + if (!commonPathComponents) { + return currentDirectory; + } + return getPathFromPathComponents(commonPathComponents); + } + function createCompilerHost(options, setParentNodes) { + return createCompilerHostWorker(options, setParentNodes); + } + function createGetSourceFile(readFile2, getCompilerOptions, setParentNodes) { + return (fileName, languageVersionOrOptions, onError) => { + let text; + try { + mark("beforeIORead"); + text = readFile2(fileName, getCompilerOptions().charset); + mark("afterIORead"); + measure("I/O Read", "beforeIORead", "afterIORead"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + text = ""; + } + return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0; + }; + } + function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) { + return (fileName, data, writeByteOrderMark, onError) => { + try { + mark("beforeIOWrite"); + writeFileEnsuringDirectories( + fileName, + data, + writeByteOrderMark, + actualWriteFile, + createDirectory, + directoryExists + ); + mark("afterIOWrite"); + measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } catch (e10) { + if (onError) { + onError(e10.message); + } + } + }; + } + function createCompilerHostWorker(options, setParentNodes, system = sys) { + const existingDirectories = /* @__PURE__ */ new Map(); + const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames); + function directoryExists(directoryPath) { + if (existingDirectories.has(directoryPath)) { + return true; + } + if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) { + existingDirectories.set(directoryPath, true); + return true; + } + return false; + } + function getDefaultLibLocation() { + return getDirectoryPath(normalizePath(system.getExecutingFilePath())); + } + const newLine = getNewLineCharacter(options); + const realpath2 = system.realpath && ((path2) => system.realpath(path2)); + const compilerHost = { + getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes), + getDefaultLibLocation, + getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)), + writeFile: createWriteFileMeasuringIO( + (path2, data, writeByteOrderMark) => system.writeFile(path2, data, writeByteOrderMark), + (path2) => (compilerHost.createDirectory || system.createDirectory)(path2), + (path2) => directoryExists(path2) + ), + getCurrentDirectory: memoize2(() => system.getCurrentDirectory()), + useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames, + getCanonicalFileName, + getNewLine: () => newLine, + fileExists: (fileName) => system.fileExists(fileName), + readFile: (fileName) => system.readFile(fileName), + trace: (s7) => system.write(s7 + newLine), + directoryExists: (directoryName) => system.directoryExists(directoryName), + getEnvironmentVariable: (name2) => system.getEnvironmentVariable ? system.getEnvironmentVariable(name2) : "", + getDirectories: (path2) => system.getDirectories(path2), + realpath: realpath2, + readDirectory: (path2, extensions6, include, exclude, depth) => system.readDirectory(path2, extensions6, include, exclude, depth), + createDirectory: (d7) => system.createDirectory(d7), + createHash: maybeBind(system, system.createHash) + }; + return compilerHost; + } + function changeCompilerHostLikeToUseCache(host, toPath3, getSourceFile) { + const originalReadFile = host.readFile; + const originalFileExists = host.fileExists; + const originalDirectoryExists = host.directoryExists; + const originalCreateDirectory = host.createDirectory; + const originalWriteFile = host.writeFile; + const readFileCache = /* @__PURE__ */ new Map(); + const fileExistsCache = /* @__PURE__ */ new Map(); + const directoryExistsCache = /* @__PURE__ */ new Map(); + const sourceFileCache = /* @__PURE__ */ new Map(); + const readFileWithCache = (fileName) => { + const key = toPath3(fileName); + const value2 = readFileCache.get(key); + if (value2 !== void 0) + return value2 !== false ? value2 : void 0; + return setReadFileCache(key, fileName); + }; + const setReadFileCache = (key, fileName) => { + const newValue = originalReadFile.call(host, fileName); + readFileCache.set(key, newValue !== void 0 ? newValue : false); + return newValue; + }; + host.readFile = (fileName) => { + const key = toPath3(fileName); + const value2 = readFileCache.get(key); + if (value2 !== void 0) + return value2 !== false ? value2 : void 0; + if (!fileExtensionIs( + fileName, + ".json" + /* Json */ + ) && !isBuildInfoFile(fileName)) { + return originalReadFile.call(host, fileName); + } + return setReadFileCache(key, fileName); + }; + const getSourceFileWithCache = getSourceFile ? (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) => { + const key = toPath3(fileName); + const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0; + const forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat); + const value2 = forImpliedNodeFormat == null ? void 0 : forImpliedNodeFormat.get(key); + if (value2) + return value2; + const sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile); + if (sourceFile && (isDeclarationFileName(fileName) || fileExtensionIs( + fileName, + ".json" + /* Json */ + ))) { + sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || /* @__PURE__ */ new Map()).set(key, sourceFile)); + } + return sourceFile; + } : void 0; + host.fileExists = (fileName) => { + const key = toPath3(fileName); + const value2 = fileExistsCache.get(key); + if (value2 !== void 0) + return value2; + const newValue = originalFileExists.call(host, fileName); + fileExistsCache.set(key, !!newValue); + return newValue; + }; + if (originalWriteFile) { + host.writeFile = (fileName, data, ...rest2) => { + const key = toPath3(fileName); + fileExistsCache.delete(key); + const value2 = readFileCache.get(key); + if (value2 !== void 0 && value2 !== data) { + readFileCache.delete(key); + sourceFileCache.forEach((map22) => map22.delete(key)); + } else if (getSourceFileWithCache) { + sourceFileCache.forEach((map22) => { + const sourceFile = map22.get(key); + if (sourceFile && sourceFile.text !== data) { + map22.delete(key); + } + }); + } + originalWriteFile.call(host, fileName, data, ...rest2); + }; + } + if (originalDirectoryExists) { + host.directoryExists = (directory) => { + const key = toPath3(directory); + const value2 = directoryExistsCache.get(key); + if (value2 !== void 0) + return value2; + const newValue = originalDirectoryExists.call(host, directory); + directoryExistsCache.set(key, !!newValue); + return newValue; + }; + if (originalCreateDirectory) { + host.createDirectory = (directory) => { + const key = toPath3(directory); + directoryExistsCache.delete(key); + originalCreateDirectory.call(host, directory); + }; + } + } + return { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + getSourceFileWithCache, + readFileWithCache + }; + } + function getPreEmitDiagnostics(program, sourceFile, cancellationToken) { + let diagnostics; + diagnostics = addRange(diagnostics, program.getConfigFileParsingDiagnostics()); + diagnostics = addRange(diagnostics, program.getOptionsDiagnostics(cancellationToken)); + diagnostics = addRange(diagnostics, program.getSyntacticDiagnostics(sourceFile, cancellationToken)); + diagnostics = addRange(diagnostics, program.getGlobalDiagnostics(cancellationToken)); + diagnostics = addRange(diagnostics, program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (getEmitDeclarations(program.getCompilerOptions())) { + diagnostics = addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken)); + } + return sortAndDeduplicateDiagnostics(diagnostics || emptyArray); + } + function formatDiagnostics(diagnostics, host) { + let output = ""; + for (const diagnostic of diagnostics) { + output += formatDiagnostic(diagnostic, host); + } + return output; + } + function formatDiagnostic(diagnostic, host) { + const errorMessage = `${diagnosticCategoryName(diagnostic)} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`; + if (diagnostic.file) { + const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); + const fileName = diagnostic.file.fileName; + const relativeFileName = convertToRelativePath(fileName, host.getCurrentDirectory(), (fileName2) => host.getCanonicalFileName(fileName2)); + return `${relativeFileName}(${line + 1},${character + 1}): ` + errorMessage; + } + return errorMessage; + } + function getCategoryFormat(category) { + switch (category) { + case 1: + return "\x1B[91m"; + case 0: + return "\x1B[93m"; + case 2: + return Debug.fail("Should never get an Info diagnostic on the command line."); + case 3: + return "\x1B[94m"; + } + } + function formatColorAndReset(text, formatStyle) { + return formatStyle + text + resetEscapeSequence; + } + function formatCodeSpan(file, start, length2, indent3, squiggleColor, host) { + const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start); + const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length2); + const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line; + const hasMoreThanFiveLines = lastLine - firstLine >= 4; + let gutterWidth = (lastLine + 1 + "").length; + if (hasMoreThanFiveLines) { + gutterWidth = Math.max(ellipsis.length, gutterWidth); + } + let context2 = ""; + for (let i7 = firstLine; i7 <= lastLine; i7++) { + context2 += host.getNewLine(); + if (hasMoreThanFiveLines && firstLine + 1 < i7 && i7 < lastLine - 1) { + context2 += indent3 + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + i7 = lastLine - 1; + } + const lineStart = getPositionOfLineAndCharacter(file, i7, 0); + const lineEnd = i7 < lastLineInFile ? getPositionOfLineAndCharacter(file, i7 + 1, 0) : file.text.length; + let lineContent = file.text.slice(lineStart, lineEnd); + lineContent = lineContent.trimEnd(); + lineContent = lineContent.replace(/\t/g, " "); + context2 += indent3 + formatColorAndReset((i7 + 1 + "").padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; + context2 += lineContent + host.getNewLine(); + context2 += indent3 + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + gutterSeparator; + context2 += squiggleColor; + if (i7 === firstLine) { + const lastCharForLine = i7 === lastLine ? lastLineChar : void 0; + context2 += lineContent.slice(0, firstLineChar).replace(/\S/g, " "); + context2 += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~"); + } else if (i7 === lastLine) { + context2 += lineContent.slice(0, lastLineChar).replace(/./g, "~"); + } else { + context2 += lineContent.replace(/./g, "~"); + } + context2 += resetEscapeSequence; + } + return context2; + } + function formatLocation(file, start, host, color = formatColorAndReset) { + const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start); + const relativeFileName = host ? convertToRelativePath(file.fileName, host.getCurrentDirectory(), (fileName) => host.getCanonicalFileName(fileName)) : file.fileName; + let output = ""; + output += color( + relativeFileName, + "\x1B[96m" + /* Cyan */ + ); + output += ":"; + output += color( + `${firstLine + 1}`, + "\x1B[93m" + /* Yellow */ + ); + output += ":"; + output += color( + `${firstLineChar + 1}`, + "\x1B[93m" + /* Yellow */ + ); + return output; + } + function formatDiagnosticsWithColorAndContext(diagnostics, host) { + let output = ""; + for (const diagnostic of diagnostics) { + if (diagnostic.file) { + const { file, start } = diagnostic; + output += formatLocation(file, start, host); + output += " - "; + } + output += formatColorAndReset(diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); + output += formatColorAndReset( + ` TS${diagnostic.code}: `, + "\x1B[90m" + /* Grey */ + ); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + if (diagnostic.file && diagnostic.code !== Diagnostics.File_appears_to_be_binary.code) { + output += host.getNewLine(); + output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host); + } + if (diagnostic.relatedInformation) { + output += host.getNewLine(); + for (const { file, start, length: length2, messageText } of diagnostic.relatedInformation) { + if (file) { + output += host.getNewLine(); + output += halfIndent + formatLocation(file, start, host); + output += formatCodeSpan(file, start, length2, indent, "\x1B[96m", host); + } + output += host.getNewLine(); + output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine()); + } + } + output += host.getNewLine(); + } + return output; + } + function flattenDiagnosticMessageText(diag2, newLine, indent3 = 0) { + if (isString4(diag2)) { + return diag2; + } else if (diag2 === void 0) { + return ""; + } + let result2 = ""; + if (indent3) { + result2 += newLine; + for (let i7 = 0; i7 < indent3; i7++) { + result2 += " "; + } + } + result2 += diag2.messageText; + indent3++; + if (diag2.next) { + for (const kid of diag2.next) { + result2 += flattenDiagnosticMessageText(kid, newLine, indent3); + } + } + return result2; + } + function getModeForFileReference(ref, containingFileMode) { + return (isString4(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode; + } + function getModeForResolutionAtIndex(file, index4, compilerOptions) { + return getModeForUsageLocationWorker(file, getModuleNameStringLiteralAt(file, index4), compilerOptions); + } + function isExclusivelyTypeOnlyImportOrExport(decl) { + var _a2; + if (isExportDeclaration(decl)) { + return decl.isTypeOnly; + } + if ((_a2 = decl.importClause) == null ? void 0 : _a2.isTypeOnly) { + return true; + } + return false; + } + function getModeForUsageLocation(file, usage, compilerOptions) { + return getModeForUsageLocationWorker(file, usage, compilerOptions); + } + function getModeForUsageLocationWorker(file, usage, compilerOptions) { + var _a2; + if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) { + const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent); + if (isTypeOnly) { + const override = getResolutionModeOverride(usage.parent.attributes); + if (override) { + return override; + } + } + } + if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) { + const override = getResolutionModeOverride(usage.parent.parent.attributes); + if (override) { + return override; + } + } + if (compilerOptions && getEmitModuleKind(compilerOptions) === 200) { + return usage.parent.parent && isImportEqualsDeclaration(usage.parent.parent) || isRequireCall( + usage.parent, + /*requireStringLiteralLikeArgument*/ + false + ) ? 1 : 99; + } + if (file.impliedNodeFormat === void 0) + return void 0; + if (file.impliedNodeFormat !== 99) { + return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 : 1; + } + const exprParentParent = (_a2 = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a2.parent; + return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 : 99; + } + function getResolutionModeOverride(node, grammarErrorOnNode) { + if (!node) + return void 0; + if (length(node.elements) !== 1) { + grammarErrorOnNode == null ? void 0 : grammarErrorOnNode( + node, + node.token === 118 ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require + ); + return void 0; + } + const elem = node.elements[0]; + if (!isStringLiteralLike(elem.name)) + return void 0; + if (elem.name.text !== "resolution-mode") { + grammarErrorOnNode == null ? void 0 : grammarErrorOnNode( + elem.name, + node.token === 118 ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions + ); + return void 0; + } + if (!isStringLiteralLike(elem.value)) + return void 0; + if (elem.value.text !== "import" && elem.value.text !== "require") { + grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(elem.value, Diagnostics.resolution_mode_should_be_either_require_or_import); + return void 0; + } + return elem.value.text === "import" ? 99 : 1; + } + function getModuleResolutionName(literal) { + return literal.text; + } + function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) { + return { + nameAndMode: moduleResolutionNameAndModeGetter, + resolve: (moduleName3, resolutionMode) => resolveModuleName( + moduleName3, + containingFile, + options, + host, + cache, + redirectedReference, + resolutionMode + ) + }; + } + function getTypeReferenceResolutionName(entry) { + return !isString4(entry) ? toFileNameLowerCase(entry.fileName) : entry; + } + function createTypeReferenceResolutionLoader(containingFile, redirectedReference, options, host, cache) { + return { + nameAndMode: typeReferenceResolutionNameAndModeGetter, + resolve: (typeRef, resoluionMode) => resolveTypeReferenceDirective( + typeRef, + containingFile, + options, + host, + redirectedReference, + cache, + resoluionMode + ) + }; + } + function loadWithModeAwareCache(entries, containingFile, redirectedReference, options, containingSourceFile, host, resolutionCache, createLoader) { + if (entries.length === 0) + return emptyArray; + const resolutions = []; + const cache = /* @__PURE__ */ new Map(); + const loader2 = createLoader(containingFile, redirectedReference, options, host, resolutionCache); + for (const entry of entries) { + const name2 = loader2.nameAndMode.getName(entry); + const mode = loader2.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options); + const key = createModeAwareCacheKey(name2, mode); + let result2 = cache.get(key); + if (!result2) { + cache.set(key, result2 = loader2.resolve(name2, mode)); + } + resolutions.push(result2); + } + return resolutions; + } + function forEachResolvedProjectReference(resolvedProjectReferences, cb) { + return forEachProjectReference( + /*projectReferences*/ + void 0, + resolvedProjectReferences, + (resolvedRef, parent22) => resolvedRef && cb(resolvedRef, parent22) + ); + } + function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) { + let seenResolvedRefs; + return worker( + projectReferences, + resolvedProjectReferences, + /*parent*/ + void 0 + ); + function worker(projectReferences2, resolvedProjectReferences2, parent22) { + if (cbRef) { + const result2 = cbRef(projectReferences2, parent22); + if (result2) + return result2; + } + return forEach4(resolvedProjectReferences2, (resolvedRef, index4) => { + if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) { + return void 0; + } + const result2 = cbResolvedRef(resolvedRef, parent22, index4); + if (result2 || !resolvedRef) + return result2; + (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path); + return worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef); + }); + } + } + function getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName) { + const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory; + return combinePaths(containingDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`); + } + function getLibraryNameFromLibFileName(libFileName) { + const components = libFileName.split("."); + let path2 = components[1]; + let i7 = 2; + while (components[i7] && components[i7] !== "d") { + path2 += (i7 === 2 ? "/" : "-") + components[i7]; + i7++; + } + return "@typescript/lib-" + path2; + } + function getLibFileNameFromLibReference(libReference) { + const libName = toFileNameLowerCase(libReference.fileName); + const libFileName = libMap.get(libName); + return { libName, libFileName }; + } + function isReferencedFile(reason) { + switch (reason == null ? void 0 : reason.kind) { + case 3: + case 4: + case 5: + case 7: + return true; + default: + return false; + } + } + function isReferenceFileLocation(location2) { + return location2.pos !== void 0; + } + function getReferencedFileLocation(program, ref) { + var _a2, _b, _c, _d; + const file = Debug.checkDefined(program.getSourceFileByPath(ref.file)); + const { kind, index: index4 } = ref; + let pos, end, packageId, resolutionMode; + switch (kind) { + case 3: + const importLiteral = getModuleNameStringLiteralAt(file, index4); + packageId = (_b = (_a2 = program.getResolvedModule(file, importLiteral.text, program.getModeForUsageLocation(file, importLiteral))) == null ? void 0 : _a2.resolvedModule) == null ? void 0 : _b.packageId; + if (importLiteral.pos === -1) + return { file, packageId, text: importLiteral.text }; + pos = skipTrivia(file.text, importLiteral.pos); + end = importLiteral.end; + break; + case 4: + ({ pos, end } = file.referencedFiles[index4]); + break; + case 5: + ({ pos, end, resolutionMode } = file.typeReferenceDirectives[index4]); + packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index4].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId; + break; + case 7: + ({ pos, end } = file.libReferenceDirectives[index4]); + break; + default: + return Debug.assertNever(kind); + } + return { file, pos, end, packageId }; + } + function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) { + if (!program || (hasChangedAutomaticTypeDirectiveNames == null ? void 0 : hasChangedAutomaticTypeDirectiveNames())) + return false; + if (!arrayIsEqualTo(program.getRootFileNames(), rootFileNames)) + return false; + let seenResolvedRefs; + if (!arrayIsEqualTo(program.getProjectReferences(), projectReferences, projectReferenceUptoDate)) + return false; + if (program.getSourceFiles().some(sourceFileNotUptoDate)) + return false; + const missingPaths = program.getMissingFilePaths(); + if (missingPaths && forEachEntry(missingPaths, fileExists)) + return false; + const currentOptions = program.getCompilerOptions(); + if (!compareDataObjects(currentOptions, newOptions)) + return false; + if (program.resolvedLibReferences && forEachEntry(program.resolvedLibReferences, (_value, libFileName) => hasInvalidatedLibResolutions(libFileName))) + return false; + if (currentOptions.configFile && newOptions.configFile) + return currentOptions.configFile.text === newOptions.configFile.text; + return true; + function sourceFileNotUptoDate(sourceFile) { + return !sourceFileVersionUptoDate(sourceFile) || hasInvalidatedResolutions(sourceFile.path); + } + function sourceFileVersionUptoDate(sourceFile) { + return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName); + } + function projectReferenceUptoDate(oldRef, newRef, index4) { + return projectReferenceIsEqualTo(oldRef, newRef) && resolvedProjectReferenceUptoDate(program.getResolvedProjectReferences()[index4], oldRef); + } + function resolvedProjectReferenceUptoDate(oldResolvedRef, oldRef) { + if (oldResolvedRef) { + if (contains2(seenResolvedRefs, oldResolvedRef)) + return true; + const refPath2 = resolveProjectReferencePath(oldRef); + const newParsedCommandLine = getParsedCommandLine(refPath2); + if (!newParsedCommandLine) + return false; + if (oldResolvedRef.commandLine.options.configFile !== newParsedCommandLine.options.configFile) + return false; + if (!arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newParsedCommandLine.fileNames)) + return false; + (seenResolvedRefs || (seenResolvedRefs = [])).push(oldResolvedRef); + return !forEach4(oldResolvedRef.references, (childResolvedRef, index4) => !resolvedProjectReferenceUptoDate(childResolvedRef, oldResolvedRef.commandLine.projectReferences[index4])); + } + const refPath = resolveProjectReferencePath(oldRef); + return !getParsedCommandLine(refPath); + } + } + function getConfigFileParsingDiagnostics(configFileParseResult) { + return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors; + } + function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) { + const result2 = getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options); + return typeof result2 === "object" ? result2.impliedNodeFormat : result2; + } + function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) { + switch (getEmitModuleResolutionKind(options)) { + case 3: + case 99: + return fileExtensionIsOneOf(fileName, [ + ".d.mts", + ".mts", + ".mjs" + /* Mjs */ + ]) ? 99 : fileExtensionIsOneOf(fileName, [ + ".d.cts", + ".cts", + ".cjs" + /* Cjs */ + ]) ? 1 : fileExtensionIsOneOf(fileName, [ + ".d.ts", + ".ts", + ".tsx", + ".js", + ".jsx" + /* Jsx */ + ]) ? lookupFromPackageJson() : void 0; + default: + return void 0; + } + function lookupFromPackageJson() { + const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options); + const packageJsonLocations = []; + state.failedLookupLocations = packageJsonLocations; + state.affectingLocations = packageJsonLocations; + const packageJsonScope = getPackageScopeForPath(fileName, state); + const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 : 1; + return { impliedNodeFormat, packageJsonLocations, packageJsonScope }; + } + } + function shouldProgramCreateNewSourceFiles(program, newOptions) { + if (!program) + return false; + return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions); + } + function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion3) { + return { + rootNames, + options, + host, + oldProgram, + configFileParsingDiagnostics, + typeScriptVersion: typeScriptVersion3 + }; + } + function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; + const createProgramOptions = isArray3(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions; + const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions; + let { oldProgram } = createProgramOptions; + const reportInvalidIgnoreDeprecations = memoize2(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations)); + let processingDefaultLibFiles; + let processingOtherFiles; + let files; + let symlinks; + let commonSourceDirectory; + let typeChecker; + let classifiableNames; + const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map(); + let fileReasons = createMultiMap(); + const cachedBindAndCheckDiagnosticsForFile = {}; + const cachedDeclarationDiagnosticsForFile = {}; + let resolvedTypeReferenceDirectives = createModeAwareCache(); + let fileProcessingDiagnostics; + let automaticTypeDirectiveNames; + let automaticTypeDirectiveResolutions; + let resolvedLibReferences; + let resolvedLibProcessing; + let resolvedModules; + let resolvedModulesProcessing; + let resolvedTypeReferenceDirectiveNames; + let resolvedTypeReferenceDirectiveNamesProcessing; + let packageMap; + const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0; + let currentNodeModulesDepth = 0; + const modulesWithElidedImports = /* @__PURE__ */ new Map(); + const sourceFilesFoundSearchingNodeModules = /* @__PURE__ */ new Map(); + (_a2 = tracing) == null ? void 0 : _a2.push( + tracing.Phase.Program, + "createProgram", + { configFilePath: options.configFilePath, rootDir: options.rootDir }, + /*separateBeginAndEnd*/ + true + ); + mark("beforeProgram"); + const host = createProgramOptions.host || createCompilerHost(options); + const configParsingHost = parseConfigHostFromCompilerHostLike(host); + let skipDefaultLib = options.noLib; + const getDefaultLibraryFileName = memoize2(() => host.getDefaultLibFileName(options)); + const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName()); + const programDiagnostics = createDiagnosticCollection(); + const currentDirectory = host.getCurrentDirectory(); + const supportedExtensions = getSupportedExtensions(options); + const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions); + const hasEmitBlockingDiagnostics = /* @__PURE__ */ new Map(); + let _compilerOptionsObjectLiteralSyntax; + let moduleResolutionCache; + let actualResolveModuleNamesWorker; + const hasInvalidatedResolutions = host.hasInvalidatedResolutions || returnFalse; + if (host.resolveModuleNameLiterals) { + actualResolveModuleNamesWorker = host.resolveModuleNameLiterals.bind(host); + moduleResolutionCache = (_b = host.getModuleResolutionCache) == null ? void 0 : _b.call(host); + } else if (host.resolveModuleNames) { + actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile, reusedNames) => host.resolveModuleNames( + moduleNames.map(getModuleResolutionName), + containingFile, + reusedNames == null ? void 0 : reusedNames.map(getModuleResolutionName), + redirectedReference, + options2, + containingSourceFile + ).map( + (resolved) => resolved ? resolved.extension !== void 0 ? { resolvedModule: resolved } : ( + // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName. + { resolvedModule: { ...resolved, extension: extensionFromPath(resolved.resolvedFileName) } } + ) : emptyResolution + ); + moduleResolutionCache = (_c = host.getModuleResolutionCache) == null ? void 0 : _c.call(host); + } else { + moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options); + actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( + moduleNames, + containingFile, + redirectedReference, + options2, + containingSourceFile, + host, + moduleResolutionCache, + createModuleResolutionLoader + ); + } + let actualResolveTypeReferenceDirectiveNamesWorker; + if (host.resolveTypeReferenceDirectiveReferences) { + actualResolveTypeReferenceDirectiveNamesWorker = host.resolveTypeReferenceDirectiveReferences.bind(host); + } else if (host.resolveTypeReferenceDirectives) { + actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => host.resolveTypeReferenceDirectives( + typeDirectiveNames.map(getTypeReferenceResolutionName), + containingFile, + redirectedReference, + options2, + containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat + ).map((resolvedTypeReferenceDirective) => ({ resolvedTypeReferenceDirective })); + } else { + const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( + currentDirectory, + getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey + ); + actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( + typeDirectiveNames, + containingFile, + redirectedReference, + options2, + containingSourceFile, + host, + typeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader + ); + } + const hasInvalidatedLibResolutions = host.hasInvalidatedLibResolutions || returnFalse; + let actualResolveLibrary; + if (host.resolveLibrary) { + actualResolveLibrary = host.resolveLibrary.bind(host); + } else { + const libraryResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()); + actualResolveLibrary = (libraryName, resolveFrom, options2) => resolveLibrary(libraryName, resolveFrom, options2, host, libraryResolutionCache); + } + const packageIdToSourceFile = /* @__PURE__ */ new Map(); + let sourceFileToPackageName = /* @__PURE__ */ new Map(); + let redirectTargetsMap = createMultiMap(); + let usesUriStyleNodeCoreModules = false; + const filesByName = /* @__PURE__ */ new Map(); + let missingFileNames = /* @__PURE__ */ new Map(); + const filesByNameIgnoreCase = host.useCaseSensitiveFileNames() ? /* @__PURE__ */ new Map() : void 0; + let resolvedProjectReferences; + let projectReferenceRedirects; + let mapFromFileToProjectReferenceRedirects; + let mapFromToProjectReferenceRedirectSource; + const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect; + const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({ + compilerHost: host, + getSymlinkCache, + useSourceOfProjectReferenceRedirect, + toPath: toPath3, + getResolvedProjectReferences, + getSourceOfProjectReferenceRedirect, + forEachResolvedProjectReference: forEachResolvedProjectReference2 + }); + const readFile2 = host.readFile.bind(host); + (_e2 = tracing) == null ? void 0 : _e2.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram }); + const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); + (_f = tracing) == null ? void 0 : _f.pop(); + let structureIsReused; + (_g = tracing) == null ? void 0 : _g.push(tracing.Phase.Program, "tryReuseStructureFromOldProgram", {}); + structureIsReused = tryReuseStructureFromOldProgram(); + (_h = tracing) == null ? void 0 : _h.pop(); + if (structureIsReused !== 2) { + processingDefaultLibFiles = []; + processingOtherFiles = []; + if (projectReferences) { + if (!resolvedProjectReferences) { + resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); + } + if (rootNames.length) { + resolvedProjectReferences == null ? void 0 : resolvedProjectReferences.forEach((parsedRef, index4) => { + if (!parsedRef) + return; + const out = outFile(parsedRef.commandLine.options); + if (useSourceOfProjectReferenceRedirect) { + if (out || getEmitModuleKind(parsedRef.commandLine.options) === 0) { + for (const fileName of parsedRef.commandLine.fileNames) { + processProjectReferenceFile(fileName, { kind: 1, index: index4 }); + } + } + } else { + if (out) { + processProjectReferenceFile(changeExtension(out, ".d.ts"), { kind: 2, index: index4 }); + } else if (getEmitModuleKind(parsedRef.commandLine.options) === 0) { + const getCommonSourceDirectory3 = memoize2(() => getCommonSourceDirectoryOfConfig(parsedRef.commandLine, !host.useCaseSensitiveFileNames())); + for (const fileName of parsedRef.commandLine.fileNames) { + if (!isDeclarationFileName(fileName) && !fileExtensionIs( + fileName, + ".json" + /* Json */ + )) { + processProjectReferenceFile(getOutputDeclarationFileName(fileName, parsedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3), { kind: 2, index: index4 }); + } + } + } + } + }); + } + } + (_i = tracing) == null ? void 0 : _i.push(tracing.Phase.Program, "processRootFiles", { count: rootNames.length }); + forEach4(rootNames, (name2, index4) => processRootFile( + name2, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + { kind: 0, index: index4 } + )); + (_j = tracing) == null ? void 0 : _j.pop(); + automaticTypeDirectiveNames ?? (automaticTypeDirectiveNames = rootNames.length ? getAutomaticTypeDirectiveNames(options, host) : emptyArray); + automaticTypeDirectiveResolutions = createModeAwareCache(); + if (automaticTypeDirectiveNames.length) { + (_k = tracing) == null ? void 0 : _k.push(tracing.Phase.Program, "processTypeReferences", { count: automaticTypeDirectiveNames.length }); + const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory; + const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile); + const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(automaticTypeDirectiveNames, containingFilename); + for (let i7 = 0; i7 < automaticTypeDirectiveNames.length; i7++) { + automaticTypeDirectiveResolutions.set( + automaticTypeDirectiveNames[i7], + /*mode*/ + void 0, + resolutions[i7] + ); + processTypeReferenceDirective( + automaticTypeDirectiveNames[i7], + /*mode*/ + void 0, + resolutions[i7], + { + kind: 8, + typeReference: automaticTypeDirectiveNames[i7], + packageId: (_m = (_l = resolutions[i7]) == null ? void 0 : _l.resolvedTypeReferenceDirective) == null ? void 0 : _m.packageId + } + ); + } + (_n = tracing) == null ? void 0 : _n.pop(); + } + if (rootNames.length && !skipDefaultLib) { + const defaultLibraryFileName = getDefaultLibraryFileName(); + if (!options.lib && defaultLibraryFileName) { + processRootFile( + defaultLibraryFileName, + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + false, + { + kind: 6 + /* LibFile */ + } + ); + } else { + forEach4(options.lib, (libFileName, index4) => { + processRootFile( + pathForLibFile(libFileName), + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + false, + { kind: 6, index: index4 } + ); + }); + } + } + files = stableSort(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles); + processingDefaultLibFiles = void 0; + processingOtherFiles = void 0; + } + if (oldProgram && host.onReleaseOldSourceFile) { + const oldSourceFiles = oldProgram.getSourceFiles(); + for (const oldSourceFile of oldSourceFiles) { + const newFile = getSourceFileByPath(oldSourceFile.resolvedPath); + if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is + oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) { + host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path)); + } + } + if (!host.getParsedCommandLine) { + oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => { + if (!getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + host.onReleaseOldSourceFile( + resolvedProjectReference.sourceFile, + oldProgram.getCompilerOptions(), + /*hasSourceFileByPath*/ + false + ); + } + }); + } + } + if (oldProgram && host.onReleaseParsedCommandLine) { + forEachProjectReference( + oldProgram.getProjectReferences(), + oldProgram.getResolvedProjectReferences(), + (oldResolvedRef, parent22, index4) => { + const oldReference = (parent22 == null ? void 0 : parent22.commandLine.projectReferences[index4]) || oldProgram.getProjectReferences()[index4]; + const oldRefPath = resolveProjectReferencePath(oldReference); + if (!(projectReferenceRedirects == null ? void 0 : projectReferenceRedirects.has(toPath3(oldRefPath)))) { + host.onReleaseParsedCommandLine(oldRefPath, oldResolvedRef, oldProgram.getCompilerOptions()); + } + } + ); + } + oldProgram = void 0; + resolvedLibProcessing = void 0; + resolvedModulesProcessing = void 0; + resolvedTypeReferenceDirectiveNamesProcessing = void 0; + const program = { + getRootFileNames: () => rootNames, + getSourceFile, + getSourceFileByPath, + getSourceFiles: () => files, + getMissingFilePaths: () => missingFileNames, + getModuleResolutionCache: () => moduleResolutionCache, + getFilesByNameMap: () => filesByName, + getCompilerOptions: () => options, + getSyntacticDiagnostics, + getOptionsDiagnostics, + getGlobalDiagnostics, + getSemanticDiagnostics, + getCachedSemanticDiagnostics, + getSuggestionDiagnostics, + getDeclarationDiagnostics: getDeclarationDiagnostics2, + getBindAndCheckDiagnostics, + getProgramDiagnostics, + getTypeChecker, + getClassifiableNames, + getCommonSourceDirectory: getCommonSourceDirectory2, + emit: emit3, + getCurrentDirectory: () => currentDirectory, + getNodeCount: () => getTypeChecker().getNodeCount(), + getIdentifierCount: () => getTypeChecker().getIdentifierCount(), + getSymbolCount: () => getTypeChecker().getSymbolCount(), + getTypeCount: () => getTypeChecker().getTypeCount(), + getInstantiationCount: () => getTypeChecker().getInstantiationCount(), + getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(), + getFileProcessingDiagnostics: () => fileProcessingDiagnostics, + getResolvedTypeReferenceDirectives: () => resolvedTypeReferenceDirectives, + getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames, + getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions, + isSourceFileFromExternalLibrary, + isSourceFileDefaultLibrary, + getModeForUsageLocation: getModeForUsageLocation2, + getModeForResolutionAtIndex: getModeForResolutionAtIndex2, + getSourceFileFromReference, + getLibFileFromReference, + sourceFileToPackageName, + redirectTargetsMap, + usesUriStyleNodeCoreModules, + resolvedModules, + resolvedTypeReferenceDirectiveNames, + resolvedLibReferences, + getResolvedModule, + getResolvedModuleFromModuleSpecifier, + getResolvedTypeReferenceDirective, + forEachResolvedModule, + forEachResolvedTypeReferenceDirective, + getCurrentPackagesMap: () => packageMap, + typesPackageExists, + packageBundlesTypes, + isEmittedFile, + getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2, + getProjectReferences, + getResolvedProjectReferences, + getProjectReferenceRedirect, + getResolvedProjectReferenceToRedirect, + getResolvedProjectReferenceByPath, + forEachResolvedProjectReference: forEachResolvedProjectReference2, + isSourceOfProjectReferenceRedirect, + emitBuildInfo, + fileExists, + readFile: readFile2, + directoryExists, + getSymlinkCache, + realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host), + useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), + getCanonicalFileName, + getFileIncludeReasons: () => fileReasons, + structureIsReused, + writeFile: writeFile22 + }; + onProgramCreateComplete(); + fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => { + switch (diagnostic.kind) { + case 1: + return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray)); + case 0: + const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason); + return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray)); + case 2: + return diagnostic.diagnostics.forEach((d7) => programDiagnostics.add(d7)); + default: + Debug.assertNever(diagnostic); + } + }); + verifyCompilerOptions(); + mark("afterProgram"); + measure("Program", "beforeProgram", "afterProgram"); + (_p = tracing) == null ? void 0 : _p.pop(); + return program; + function getResolvedModule(file, moduleName3, mode) { + var _a22; + return (_a22 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a22.get(moduleName3, mode); + } + function getResolvedModuleFromModuleSpecifier(moduleSpecifier) { + const sourceFile = getSourceFileOfNode(moduleSpecifier); + Debug.assertIsDefined(sourceFile, "`moduleSpecifier` must have a `SourceFile` ancestor. Use `program.getResolvedModule` instead to provide the containing file and resolution mode."); + return getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation2(sourceFile, moduleSpecifier)); + } + function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) { + var _a22; + return (_a22 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a22.get(typeDirectiveName, mode); + } + function forEachResolvedModule(callback, file) { + forEachResolution(resolvedModules, callback, file); + } + function forEachResolvedTypeReferenceDirective(callback, file) { + forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file); + } + function forEachResolution(resolutionCache, callback, file) { + var _a22; + if (file) + (_a22 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a22.forEach((resolution, name2, mode) => callback(resolution, name2, mode, file.path)); + else + resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name2, mode) => callback(resolution, name2, mode, filePath))); + } + function getPackagesMap() { + if (packageMap) + return packageMap; + packageMap = /* @__PURE__ */ new Map(); + forEachResolvedModule(({ resolvedModule }) => { + if (resolvedModule == null ? void 0 : resolvedModule.packageId) + packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" || !!packageMap.get(resolvedModule.packageId.name)); + }); + return packageMap; + } + function typesPackageExists(packageName) { + return getPackagesMap().has(getTypesPackageName(packageName)); + } + function packageBundlesTypes(packageName) { + return !!getPackagesMap().get(packageName); + } + function addResolutionDiagnostics(resolution) { + var _a22; + if (!((_a22 = resolution.resolutionDiagnostics) == null ? void 0 : _a22.length)) + return; + (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({ + kind: 2, + diagnostics: resolution.resolutionDiagnostics + }); + } + function addResolutionDiagnosticsFromResolutionOrCache(containingFile, name2, resolution, mode) { + if (host.resolveModuleNameLiterals || !host.resolveModuleNames) + return addResolutionDiagnostics(resolution); + if (!moduleResolutionCache || isExternalModuleNameRelative(name2)) + return; + const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); + const containingDir = getDirectoryPath(containingFileName); + const redirectedReference = getRedirectReferenceForResolution(containingFile); + const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name2, mode, containingDir, redirectedReference); + if (fromCache) + addResolutionDiagnostics(fromCache); + } + function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) { + var _a22, _b2; + if (!moduleNames.length) + return emptyArray; + const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory); + const redirectedReference = getRedirectReferenceForResolution(containingFile); + (_a22 = tracing) == null ? void 0 : _a22.push(tracing.Phase.Program, "resolveModuleNamesWorker", { containingFileName }); + mark("beforeResolveModule"); + const result2 = actualResolveModuleNamesWorker(moduleNames, containingFileName, redirectedReference, options, containingFile, reusedNames); + mark("afterResolveModule"); + measure("ResolveModule", "beforeResolveModule", "afterResolveModule"); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + return result2; + } + function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, reusedNames) { + var _a22, _b2; + if (!typeDirectiveNames.length) + return []; + const containingSourceFile = !isString4(containingFile) ? containingFile : void 0; + const containingFileName = !isString4(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile; + const redirectedReference = containingSourceFile && getRedirectReferenceForResolution(containingSourceFile); + (_a22 = tracing) == null ? void 0 : _a22.push(tracing.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName }); + mark("beforeResolveTypeReference"); + const result2 = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, options, containingSourceFile, reusedNames); + mark("afterResolveTypeReference"); + measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference"); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + return result2; + } + function getRedirectReferenceForResolution(file) { + const redirect = getResolvedProjectReferenceToRedirect(file.originalFileName); + if (redirect || !isDeclarationFileName(file.originalFileName)) + return redirect; + const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path); + if (resultFromDts) + return resultFromDts; + if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart)) + return void 0; + const realDeclarationPath = toPath3(host.realpath(file.originalFileName)); + return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath); + } + function getRedirectReferenceForResolutionFromSourceOfProject(filePath) { + const source = getSourceOfProjectReferenceRedirect(filePath); + if (isString4(source)) + return getResolvedProjectReferenceToRedirect(source); + if (!source) + return void 0; + return forEachResolvedProjectReference2((resolvedRef) => { + const out = outFile(resolvedRef.commandLine.options); + if (!out) + return void 0; + return toPath3(out) === filePath ? resolvedRef : void 0; + }); + } + function compareDefaultLibFiles(a7, b8) { + return compareValues(getDefaultLibFilePriority(a7), getDefaultLibFilePriority(b8)); + } + function getDefaultLibFilePriority(a7) { + if (containsPath( + defaultLibraryPath, + a7.fileName, + /*ignoreCase*/ + false + )) { + const basename2 = getBaseFileName(a7.fileName); + if (basename2 === "lib.d.ts" || basename2 === "lib.es6.d.ts") + return 0; + const name2 = removeSuffix(removePrefix(basename2, "lib."), ".d.ts"); + const index4 = libs.indexOf(name2); + if (index4 !== -1) + return index4 + 1; + } + return libs.length + 2; + } + function toPath3(fileName) { + return toPath2(fileName, currentDirectory, getCanonicalFileName); + } + function getCommonSourceDirectory2() { + if (commonSourceDirectory === void 0) { + const emittedFiles = filter2(files, (file) => sourceFileMayBeEmitted(file, program)); + commonSourceDirectory = getCommonSourceDirectory( + options, + () => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName), + currentDirectory, + getCanonicalFileName, + (commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2) + ); + } + return commonSourceDirectory; + } + function getClassifiableNames() { + var _a22; + if (!classifiableNames) { + getTypeChecker(); + classifiableNames = /* @__PURE__ */ new Set(); + for (const sourceFile of files) { + (_a22 = sourceFile.classifiableNames) == null ? void 0 : _a22.forEach((value2) => classifiableNames.add(value2)); + } + } + return classifiableNames; + } + function resolveModuleNamesReusingOldState(moduleNames, file) { + if (structureIsReused === 0 && !file.ambientModuleNames.length) { + return resolveModuleNamesWorker( + moduleNames, + file, + /*reusedNames*/ + void 0 + ); + } + let unknownModuleNames; + let result2; + let reusedNames; + const predictedToResolveToAmbientModuleMarker = emptyResolution; + const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName); + for (let i7 = 0; i7 < moduleNames.length; i7++) { + const moduleName3 = moduleNames[i7]; + if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) { + const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName3.text, getModeForUsageLocation2(file, moduleName3)); + if (oldResolution == null ? void 0 : oldResolution.resolvedModule) { + if (isTraceEnabled(options, host)) { + trace2( + host, + oldResolution.resolvedModule.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2, + moduleName3.text, + getNormalizedAbsolutePath(file.originalFileName, currentDirectory), + oldResolution.resolvedModule.resolvedFileName, + oldResolution.resolvedModule.packageId && packageIdToString(oldResolution.resolvedModule.packageId) + ); + } + (result2 ?? (result2 = new Array(moduleNames.length)))[i7] = oldResolution; + (reusedNames ?? (reusedNames = [])).push(moduleName3); + continue; + } + } + let resolvesToAmbientModuleInNonModifiedFile = false; + if (contains2(file.ambientModuleNames, moduleName3.text)) { + resolvesToAmbientModuleInNonModifiedFile = true; + if (isTraceEnabled(options, host)) { + trace2(host, Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1, moduleName3.text, getNormalizedAbsolutePath(file.originalFileName, currentDirectory)); + } + } else { + resolvesToAmbientModuleInNonModifiedFile = moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName3); + } + if (resolvesToAmbientModuleInNonModifiedFile) { + (result2 || (result2 = new Array(moduleNames.length)))[i7] = predictedToResolveToAmbientModuleMarker; + } else { + (unknownModuleNames ?? (unknownModuleNames = [])).push(moduleName3); + } + } + const resolutions = unknownModuleNames && unknownModuleNames.length ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) : emptyArray; + if (!result2) { + Debug.assert(resolutions.length === moduleNames.length); + return resolutions; + } + let j6 = 0; + for (let i7 = 0; i7 < result2.length; i7++) { + if (!result2[i7]) { + result2[i7] = resolutions[j6]; + j6++; + } + } + Debug.assert(j6 === resolutions.length); + return result2; + function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName3) { + var _a22; + const resolutionToFile = (_a22 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName3.text, getModeForUsageLocation2(file, moduleName3))) == null ? void 0 : _a22.resolvedModule; + const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile) { + return false; + } + const unmodifiedFile = ambientModuleNameToUnmodifiedFileName.get(moduleName3.text); + if (!unmodifiedFile) { + return false; + } + if (isTraceEnabled(options, host)) { + trace2(host, Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified, moduleName3.text, unmodifiedFile); + } + return true; + } + } + function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) { + var _a22; + if (structureIsReused === 0) { + return resolveTypeReferenceDirectiveNamesWorker( + typeDirectiveNames, + containingFile, + /*reusedNames*/ + void 0 + ); + } + let unknownTypeReferenceDirectiveNames; + let result2; + let reusedNames; + const containingSourceFile = !isString4(containingFile) ? containingFile : void 0; + const oldSourceFile = !isString4(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0; + const canReuseResolutions = !isString4(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(containingFile.path) : !hasInvalidatedResolutions(toPath3(containingFile)); + for (let i7 = 0; i7 < typeDirectiveNames.length; i7++) { + const entry = typeDirectiveNames[i7]; + if (canReuseResolutions) { + const typeDirectiveName = getTypeReferenceResolutionName(entry); + const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat); + const oldResolution = !isString4(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a22 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a22.get(typeDirectiveName, mode); + if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) { + if (isTraceEnabled(options, host)) { + trace2( + host, + oldResolution.resolvedTypeReferenceDirective.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2, + typeDirectiveName, + !isString4(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile, + oldResolution.resolvedTypeReferenceDirective.resolvedFileName, + oldResolution.resolvedTypeReferenceDirective.packageId && packageIdToString(oldResolution.resolvedTypeReferenceDirective.packageId) + ); + } + (result2 ?? (result2 = new Array(typeDirectiveNames.length)))[i7] = oldResolution; + (reusedNames ?? (reusedNames = [])).push(entry); + continue; + } + } + (unknownTypeReferenceDirectiveNames ?? (unknownTypeReferenceDirectiveNames = [])).push(entry); + } + if (!unknownTypeReferenceDirectiveNames) + return result2 || emptyArray; + const resolutions = resolveTypeReferenceDirectiveNamesWorker( + unknownTypeReferenceDirectiveNames, + containingFile, + reusedNames + ); + if (!result2) { + Debug.assert(resolutions.length === typeDirectiveNames.length); + return resolutions; + } + let j6 = 0; + for (let i7 = 0; i7 < result2.length; i7++) { + if (!result2[i7]) { + result2[i7] = resolutions[j6]; + j6++; + } + } + Debug.assert(j6 === resolutions.length); + return result2; + } + function canReuseProjectReferences() { + return !forEachProjectReference( + oldProgram.getProjectReferences(), + oldProgram.getResolvedProjectReferences(), + (oldResolvedRef, parent22, index4) => { + const newRef = (parent22 ? parent22.commandLine.projectReferences : projectReferences)[index4]; + const newResolvedRef = parseProjectReferenceConfigFile(newRef); + if (oldResolvedRef) { + return !newResolvedRef || newResolvedRef.sourceFile !== oldResolvedRef.sourceFile || !arrayIsEqualTo(oldResolvedRef.commandLine.fileNames, newResolvedRef.commandLine.fileNames); + } else { + return newResolvedRef !== void 0; + } + }, + (oldProjectReferences, parent22) => { + const newReferences = parent22 ? getResolvedProjectReferenceByPath(parent22.sourceFile.path).commandLine.projectReferences : projectReferences; + return !arrayIsEqualTo(oldProjectReferences, newReferences, projectReferenceIsEqualTo); + } + ); + } + function tryReuseStructureFromOldProgram() { + var _a22; + if (!oldProgram) { + return 0; + } + const oldOptions = oldProgram.getCompilerOptions(); + if (changesAffectModuleResolution(oldOptions, options)) { + return 0; + } + const oldRootNames = oldProgram.getRootFileNames(); + if (!arrayIsEqualTo(oldRootNames, rootNames)) { + return 0; + } + if (!canReuseProjectReferences()) { + return 0; + } + if (projectReferences) { + resolvedProjectReferences = projectReferences.map(parseProjectReferenceConfigFile); + } + const newSourceFiles = []; + const modifiedSourceFiles = []; + structureIsReused = 2; + if (forEachEntry(oldProgram.getMissingFilePaths(), (missingFileName) => host.fileExists(missingFileName))) { + return 0; + } + const oldSourceFiles = oldProgram.getSourceFiles(); + let SeenPackageName; + ((SeenPackageName2) => { + SeenPackageName2[SeenPackageName2["Exists"] = 0] = "Exists"; + SeenPackageName2[SeenPackageName2["Modified"] = 1] = "Modified"; + })(SeenPackageName || (SeenPackageName = {})); + const seenPackageNames = /* @__PURE__ */ new Map(); + for (const oldSourceFile of oldSourceFiles) { + const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options); + let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath( + oldSourceFile.fileName, + oldSourceFile.resolvedPath, + sourceFileOptions, + /*onError*/ + void 0, + shouldCreateNewSourceFile + ) : host.getSourceFile( + oldSourceFile.fileName, + sourceFileOptions, + /*onError*/ + void 0, + shouldCreateNewSourceFile + ); + if (!newSourceFile) { + return 0; + } + newSourceFile.packageJsonLocations = ((_a22 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a22.length) ? sourceFileOptions.packageJsonLocations : void 0; + newSourceFile.packageJsonScope = sourceFileOptions.packageJsonScope; + Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`"); + let fileChanged; + if (oldSourceFile.redirectInfo) { + if (newSourceFile !== oldSourceFile.redirectInfo.unredirected) { + return 0; + } + fileChanged = false; + newSourceFile = oldSourceFile; + } else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { + if (newSourceFile !== oldSourceFile) { + return 0; + } + fileChanged = false; + } else { + fileChanged = newSourceFile !== oldSourceFile; + } + newSourceFile.path = oldSourceFile.path; + newSourceFile.originalFileName = oldSourceFile.originalFileName; + newSourceFile.resolvedPath = oldSourceFile.resolvedPath; + newSourceFile.fileName = oldSourceFile.fileName; + const packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); + if (packageName !== void 0) { + const prevKind = seenPackageNames.get(packageName); + const newKind = fileChanged ? 1 : 0; + if (prevKind !== void 0 && newKind === 1 || prevKind === 1) { + return 0; + } + seenPackageNames.set(packageName, newKind); + } + if (fileChanged) { + if (oldSourceFile.impliedNodeFormat !== newSourceFile.impliedNodeFormat) { + structureIsReused = 1; + } else if (!arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } else if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) { + structureIsReused = 1; + } else if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } else { + collectExternalModuleReferences(newSourceFile); + if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) { + structureIsReused = 1; + } else if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) { + structureIsReused = 1; + } else if ((oldSourceFile.flags & 12582912) !== (newSourceFile.flags & 12582912)) { + structureIsReused = 1; + } else if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) { + structureIsReused = 1; + } + } + modifiedSourceFiles.push(newSourceFile); + } else if (hasInvalidatedResolutions(oldSourceFile.path)) { + structureIsReused = 1; + modifiedSourceFiles.push(newSourceFile); + } else { + for (const moduleName3 of oldSourceFile.ambientModuleNames) { + ambientModuleNameToUnmodifiedFileName.set(moduleName3, oldSourceFile.fileName); + } + } + newSourceFiles.push(newSourceFile); + } + if (structureIsReused !== 2) { + return structureIsReused; + } + for (const newSourceFile of modifiedSourceFiles) { + const moduleNames = getModuleNames(newSourceFile); + const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile); + (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions); + const resolutionsChanged = hasChangesInResolutions( + moduleNames, + resolutions, + (name2) => oldProgram.getResolvedModule(newSourceFile, name2.text, getModeForUsageLocation2(newSourceFile, name2)), + moduleResolutionIsEqualTo + ); + if (resolutionsChanged) + structureIsReused = 1; + const typesReferenceDirectives = newSourceFile.typeReferenceDirectives; + const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile); + (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions); + const typeReferenceResolutionsChanged = hasChangesInResolutions( + typesReferenceDirectives, + typeReferenceResolutions, + (name2) => oldProgram.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name2), getModeForFileReference(name2, newSourceFile.impliedNodeFormat)), + typeDirectiveIsEqualTo + ); + if (typeReferenceResolutionsChanged) + structureIsReused = 1; + } + if (structureIsReused !== 2) { + return structureIsReused; + } + if (changesAffectingProgramStructure(oldOptions, options)) { + return 1; + } + if (oldProgram.resolvedLibReferences && forEachEntry(oldProgram.resolvedLibReferences, (resolution, libFileName) => pathForLibFileWorker(libFileName).actual !== resolution.actual)) { + return 1; + } + if (host.hasChangedAutomaticTypeDirectiveNames) { + if (host.hasChangedAutomaticTypeDirectiveNames()) + return 1; + } else { + automaticTypeDirectiveNames = getAutomaticTypeDirectiveNames(options, host); + if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames)) + return 1; + } + missingFileNames = oldProgram.getMissingFilePaths(); + Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length); + for (const newSourceFile of newSourceFiles) { + filesByName.set(newSourceFile.path, newSourceFile); + } + const oldFilesByNameMap = oldProgram.getFilesByNameMap(); + oldFilesByNameMap.forEach((oldFile, path2) => { + if (!oldFile) { + filesByName.set(path2, oldFile); + return; + } + if (oldFile.path === path2) { + if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) { + sourceFilesFoundSearchingNodeModules.set(oldFile.path, true); + } + return; + } + filesByName.set(path2, filesByName.get(oldFile.path)); + }); + files = newSourceFiles; + fileReasons = oldProgram.getFileIncludeReasons(); + fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics(); + resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives(); + automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames(); + automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions(); + sourceFileToPackageName = oldProgram.sourceFileToPackageName; + redirectTargetsMap = oldProgram.redirectTargetsMap; + usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules; + resolvedModules = oldProgram.resolvedModules; + resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames; + resolvedLibReferences = oldProgram.resolvedLibReferences; + packageMap = oldProgram.getCurrentPackagesMap(); + return 2; + } + function getEmitHost(writeFileCallback) { + return { + getPrependNodes, + getCanonicalFileName, + getCommonSourceDirectory: program.getCommonSourceDirectory, + getCompilerOptions: program.getCompilerOptions, + getCurrentDirectory: () => currentDirectory, + getSourceFile: program.getSourceFile, + getSourceFileByPath: program.getSourceFileByPath, + getSourceFiles: program.getSourceFiles, + getLibFileFromReference: program.getLibFileFromReference, + isSourceFileFromExternalLibrary, + getResolvedProjectReferenceToRedirect, + getProjectReferenceRedirect, + isSourceOfProjectReferenceRedirect, + getSymlinkCache, + writeFile: writeFileCallback || writeFile22, + isEmitBlocked, + readFile: (f8) => host.readFile(f8), + fileExists: (f8) => { + const path2 = toPath3(f8); + if (getSourceFileByPath(path2)) + return true; + if (missingFileNames.has(path2)) + return false; + return host.fileExists(f8); + }, + useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(), + getBuildInfo: (bundle) => { + var _a22; + return (_a22 = program.getBuildInfo) == null ? void 0 : _a22.call(program, bundle); + }, + getSourceFileFromReference: (file, ref) => program.getSourceFileFromReference(file, ref), + redirectTargetsMap, + getFileIncludeReasons: program.getFileIncludeReasons, + createHash: maybeBind(host, host.createHash) + }; + } + function writeFile22(fileName, text, writeByteOrderMark, onError, sourceFiles, data) { + host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + } + function emitBuildInfo(writeFileCallback) { + var _a22, _b2; + Debug.assert(!outFile(options)); + (_a22 = tracing) == null ? void 0 : _a22.push( + tracing.Phase.Emit, + "emitBuildInfo", + {}, + /*separateBeginAndEnd*/ + true + ); + mark("beforeEmit"); + const emitResult = emitFiles( + notImplementedResolver, + getEmitHost(writeFileCallback), + /*targetSourceFile*/ + void 0, + /*transformers*/ + noTransformers, + /*emitOnly*/ + false, + /*onlyBuildInfo*/ + true + ); + mark("afterEmit"); + measure("Emit", "beforeEmit", "afterEmit"); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + return emitResult; + } + function getResolvedProjectReferences() { + return resolvedProjectReferences; + } + function getProjectReferences() { + return projectReferences; + } + function getPrependNodes() { + return createPrependNodes( + projectReferences, + (_ref, index4) => { + var _a22; + return (_a22 = resolvedProjectReferences[index4]) == null ? void 0 : _a22.commandLine; + }, + (fileName) => { + const path2 = toPath3(fileName); + const sourceFile = getSourceFileByPath(path2); + return sourceFile ? sourceFile.text : filesByName.has(path2) ? void 0 : host.readFile(path2); + }, + host + ); + } + function isSourceFileFromExternalLibrary(file) { + return !!sourceFilesFoundSearchingNodeModules.get(file.path); + } + function isSourceFileDefaultLibrary(file) { + if (!file.isDeclarationFile) { + return false; + } + if (file.hasNoDefaultLib) { + return true; + } + if (!options.noLib) { + return false; + } + const equalityComparer = host.useCaseSensitiveFileNames() ? equateStringsCaseSensitive : equateStringsCaseInsensitive; + if (!options.lib) { + return equalityComparer(file.fileName, getDefaultLibraryFileName()); + } else { + return some2(options.lib, (libFileName) => equalityComparer(file.fileName, resolvedLibReferences.get(libFileName).actual)); + } + } + function getTypeChecker() { + return typeChecker || (typeChecker = createTypeChecker(program)); + } + function emit3(sourceFile, writeFileCallback, cancellationToken, emitOnly, transformers, forceDtsEmit) { + var _a22, _b2; + (_a22 = tracing) == null ? void 0 : _a22.push( + tracing.Phase.Emit, + "emit", + { path: sourceFile == null ? void 0 : sourceFile.path }, + /*separateBeginAndEnd*/ + true + ); + const result2 = runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnly, transformers, forceDtsEmit)); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + return result2; + } + function isEmitBlocked(emitFileName) { + return hasEmitBlockingDiagnostics.has(toPath3(emitFileName)); + } + function emitWorker(program2, sourceFile, writeFileCallback, cancellationToken, emitOnly, customTransformers, forceDtsEmit) { + if (!forceDtsEmit) { + const result2 = handleNoEmitOptions(program2, sourceFile, writeFileCallback, cancellationToken); + if (result2) + return result2; + } + const emitResolver = getTypeChecker().getEmitResolver(outFile(options) ? void 0 : sourceFile, cancellationToken); + mark("beforeEmit"); + const emitResult = emitFiles( + emitResolver, + getEmitHost(writeFileCallback), + sourceFile, + getTransformers(options, customTransformers, emitOnly), + emitOnly, + /*onlyBuildInfo*/ + false, + forceDtsEmit + ); + mark("afterEmit"); + measure("Emit", "beforeEmit", "afterEmit"); + return emitResult; + } + function getSourceFile(fileName) { + return getSourceFileByPath(toPath3(fileName)); + } + function getSourceFileByPath(path2) { + return filesByName.get(path2) || void 0; + } + function getDiagnosticsHelper(sourceFile, getDiagnostics2, cancellationToken) { + if (sourceFile) { + return sortAndDeduplicateDiagnostics(getDiagnostics2(sourceFile, cancellationToken)); + } + return sortAndDeduplicateDiagnostics(flatMap2(program.getSourceFiles(), (sourceFile2) => { + if (cancellationToken) { + cancellationToken.throwIfCancellationRequested(); + } + return getDiagnostics2(sourceFile2, cancellationToken); + })); + } + function getSyntacticDiagnostics(sourceFile, cancellationToken) { + return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken); + } + function getSemanticDiagnostics(sourceFile, cancellationToken) { + return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile, cancellationToken); + } + function getCachedSemanticDiagnostics(sourceFile) { + var _a22; + return sourceFile ? (_a22 = cachedBindAndCheckDiagnosticsForFile.perFile) == null ? void 0 : _a22.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; + } + function getBindAndCheckDiagnostics(sourceFile, cancellationToken) { + return getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken); + } + function getProgramDiagnostics(sourceFile) { + var _a22; + if (skipTypeChecking(sourceFile, options, program)) { + return emptyArray; + } + const programDiagnosticsInFile = programDiagnostics.getDiagnostics(sourceFile.fileName); + if (!((_a22 = sourceFile.commentDirectives) == null ? void 0 : _a22.length)) { + return programDiagnosticsInFile; + } + return getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, programDiagnosticsInFile).diagnostics; + } + function getDeclarationDiagnostics2(sourceFile, cancellationToken) { + const options2 = program.getCompilerOptions(); + if (!sourceFile || outFile(options2)) { + return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + } else { + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); + } + } + function getSyntacticDiagnosticsForFile(sourceFile) { + if (isSourceFileJS(sourceFile)) { + if (!sourceFile.additionalSyntacticDiagnostics) { + sourceFile.additionalSyntacticDiagnostics = getJSSyntacticDiagnosticsForFile(sourceFile); + } + return concatenate(sourceFile.additionalSyntacticDiagnostics, sourceFile.parseDiagnostics); + } + return sourceFile.parseDiagnostics; + } + function runWithCancellationToken(func) { + try { + return func(); + } catch (e10) { + if (e10 instanceof OperationCanceledException) { + typeChecker = void 0; + } + throw e10; + } + } + function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) { + return concatenate( + filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options), + getProgramDiagnostics(sourceFile) + ); + } + function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache); + } + function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken) { + return runWithCancellationToken(() => { + if (skipTypeChecking(sourceFile, options, program)) { + return emptyArray; + } + const typeChecker2 = getTypeChecker(); + Debug.assert(!!sourceFile.bindDiagnostics); + const isJs = sourceFile.scriptKind === 1 || sourceFile.scriptKind === 2; + const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options); + const isPlainJs = isPlainJsFile(sourceFile, options.checkJs); + const isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false; + const includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4 || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7); + let bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : emptyArray; + let checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker2.getDiagnostics(sourceFile, cancellationToken) : emptyArray; + if (isPlainJs) { + bindDiagnostics = filter2(bindDiagnostics, (d7) => plainJSErrors.has(d7.code)); + checkDiagnostics = filter2(checkDiagnostics, (d7) => plainJSErrors.has(d7.code)); + } + return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : void 0); + }); + } + function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, ...allDiagnostics) { + var _a22; + const flatDiagnostics = flatten2(allDiagnostics); + if (!includeBindAndCheckDiagnostics || !((_a22 = sourceFile.commentDirectives) == null ? void 0 : _a22.length)) { + return flatDiagnostics; + } + const { diagnostics, directives } = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics); + for (const errorExpectation of directives.getUnusedExpectations()) { + diagnostics.push(createDiagnosticForRange(sourceFile, errorExpectation.range, Diagnostics.Unused_ts_expect_error_directive)); + } + return diagnostics; + } + function getDiagnosticsWithPrecedingDirectives(sourceFile, commentDirectives, flatDiagnostics) { + const directives = createCommentDirectivesMap(sourceFile, commentDirectives); + const diagnostics = flatDiagnostics.filter((diagnostic) => markPrecedingCommentDirectiveLine(diagnostic, directives) === -1); + return { diagnostics, directives }; + } + function getSuggestionDiagnostics(sourceFile, cancellationToken) { + return runWithCancellationToken(() => { + return getTypeChecker().getSuggestionDiagnostics(sourceFile, cancellationToken); + }); + } + function markPrecedingCommentDirectiveLine(diagnostic, directives) { + const { file, start } = diagnostic; + if (!file) { + return -1; + } + const lineStarts = getLineStarts(file); + let line = computeLineAndCharacterOfPosition(lineStarts, start).line - 1; + while (line >= 0) { + if (directives.markUsed(line)) { + return line; + } + const lineText = file.text.slice(lineStarts[line], lineStarts[line + 1]).trim(); + if (lineText !== "" && !/^(\s*)\/\/(.*)$/.test(lineText)) { + return -1; + } + line--; + } + return -1; + } + function getJSSyntacticDiagnosticsForFile(sourceFile) { + return runWithCancellationToken(() => { + const diagnostics = []; + walk(sourceFile, sourceFile); + forEachChildRecursively(sourceFile, walk, walkArray); + return diagnostics; + function walk(node, parent22) { + switch (parent22.kind) { + case 169: + case 172: + case 174: + if (parent22.questionToken === node) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); + return "skip"; + } + case 173: + case 176: + case 177: + case 178: + case 218: + case 262: + case 219: + case 260: + if (parent22.type === node) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + } + switch (node.kind) { + case 273: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode2(parent22, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "import type")); + return "skip"; + } + break; + case 278: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, "export type")); + return "skip"; + } + break; + case 276: + case 281: + if (node.isTypeOnly) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, isImportSpecifier(node) ? "import...type" : "export...type")); + return "skip"; + } + break; + case 271: + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.import_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 277: + if (node.isExportEquals) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.export_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 298: + const heritageClause = node; + if (heritageClause.token === 119) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 264: + const interfaceKeyword = tokenToString( + 120 + /* InterfaceKeyword */ + ); + Debug.assertIsDefined(interfaceKeyword); + diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword)); + return "skip"; + case 267: + const moduleKeyword = node.flags & 32 ? tokenToString( + 145 + /* NamespaceKeyword */ + ) : tokenToString( + 144 + /* ModuleKeyword */ + ); + Debug.assertIsDefined(moduleKeyword); + diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, moduleKeyword)); + return "skip"; + case 265: + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 176: + case 174: + case 262: + if (!node.body) { + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + return; + case 266: + const enumKeyword = Debug.checkDefined(tokenToString( + 94 + /* EnumKeyword */ + )); + diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword)); + return "skip"; + case 235: + diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 234: + diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 238: + diagnostics.push(createDiagnosticForNode2(node.type, Diagnostics.Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files)); + return "skip"; + case 216: + Debug.fail(); + } + } + function walkArray(nodes, parent22) { + if (canHaveIllegalDecorators(parent22)) { + const decorator = find2(parent22.modifiers, isDecorator); + if (decorator) { + diagnostics.push(createDiagnosticForNode2(decorator, Diagnostics.Decorators_are_not_valid_here)); + } + } else if (canHaveDecorators(parent22) && parent22.modifiers) { + const decoratorIndex = findIndex2(parent22.modifiers, isDecorator); + if (decoratorIndex >= 0) { + if (isParameter(parent22) && !options.experimentalDecorators) { + diagnostics.push(createDiagnosticForNode2(parent22.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (isClassDeclaration(parent22)) { + const exportIndex = findIndex2(parent22.modifiers, isExportModifier); + if (exportIndex >= 0) { + const defaultIndex = findIndex2(parent22.modifiers, isDefaultModifier); + if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) { + diagnostics.push(createDiagnosticForNode2(parent22.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here)); + } else if (exportIndex >= 0 && decoratorIndex < exportIndex) { + const trailingDecoratorIndex = findIndex2(parent22.modifiers, isDecorator, exportIndex); + if (trailingDecoratorIndex >= 0) { + diagnostics.push(addRelatedInfo( + createDiagnosticForNode2(parent22.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export), + createDiagnosticForNode2(parent22.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here) + )); + } + } + } + } + } + } + switch (parent22.kind) { + case 263: + case 231: + case 174: + case 176: + case 177: + case 178: + case 218: + case 262: + case 219: + if (nodes === parent22.typeParameters) { + diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + case 243: + if (nodes === parent22.modifiers) { + checkModifiers( + parent22.modifiers, + parent22.kind === 243 + /* VariableStatement */ + ); + return "skip"; + } + break; + case 172: + if (nodes === parent22.modifiers) { + for (const modifier of nodes) { + if (isModifier(modifier) && modifier.kind !== 126 && modifier.kind !== 129) { + diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind))); + } + } + return "skip"; + } + break; + case 169: + if (nodes === parent22.modifiers && some2(nodes, isModifier)) { + diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + case 213: + case 214: + case 233: + case 285: + case 286: + case 215: + if (nodes === parent22.typeArguments) { + diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)); + return "skip"; + } + break; + } + } + function checkModifiers(modifiers, isConstValid) { + for (const modifier of modifiers) { + switch (modifier.kind) { + case 87: + if (isConstValid) { + continue; + } + case 125: + case 123: + case 124: + case 148: + case 138: + case 128: + case 164: + case 103: + case 147: + diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind))); + break; + case 126: + case 95: + case 90: + case 129: + } + } + } + function createDiagnosticForNodeArray2(nodes, message, ...args) { + const start = nodes.pos; + return createFileDiagnostic(sourceFile, start, nodes.end - start, message, ...args); + } + function createDiagnosticForNode2(node, message, ...args) { + return createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args); + } + }); + } + function getDeclarationDiagnosticsWorker(sourceFile, cancellationToken) { + return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + } + function getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken) { + return runWithCancellationToken(() => { + const resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken); + return getDeclarationDiagnostics(getEmitHost(noop4), resolver, sourceFile) || emptyArray; + }); + } + function getAndCacheDiagnostics(sourceFile, cancellationToken, cache, getDiagnostics2) { + var _a22; + const cachedResult = sourceFile ? (_a22 = cache.perFile) == null ? void 0 : _a22.get(sourceFile.path) : cache.allDiagnostics; + if (cachedResult) { + return cachedResult; + } + const result2 = getDiagnostics2(sourceFile, cancellationToken); + if (sourceFile) { + (cache.perFile || (cache.perFile = /* @__PURE__ */ new Map())).set(sourceFile.path, result2); + } else { + cache.allDiagnostics = result2; + } + return result2; + } + function getDeclarationDiagnosticsForFile(sourceFile, cancellationToken) { + return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + } + function getOptionsDiagnostics() { + return sortAndDeduplicateDiagnostics(concatenate( + programDiagnostics.getGlobalDiagnostics(), + getOptionsDiagnosticsOfConfigFile() + )); + } + function getOptionsDiagnosticsOfConfigFile() { + if (!options.configFile) + return emptyArray; + let diagnostics = programDiagnostics.getDiagnostics(options.configFile.fileName); + forEachResolvedProjectReference2((resolvedRef) => { + diagnostics = concatenate(diagnostics, programDiagnostics.getDiagnostics(resolvedRef.sourceFile.fileName)); + }); + return diagnostics; + } + function getGlobalDiagnostics() { + return rootNames.length ? sortAndDeduplicateDiagnostics(getTypeChecker().getGlobalDiagnostics().slice()) : emptyArray; + } + function getConfigFileParsingDiagnostics2() { + return configFileParsingDiagnostics || emptyArray; + } + function processRootFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason) { + processSourceFile( + normalizePath(fileName), + isDefaultLib, + ignoreNoDefaultLib, + /*packageId*/ + void 0, + reason + ); + } + function fileReferenceIsEqualTo(a7, b8) { + return a7.fileName === b8.fileName; + } + function moduleNameIsEqualTo(a7, b8) { + return a7.kind === 80 ? b8.kind === 80 && a7.escapedText === b8.escapedText : b8.kind === 11 && a7.text === b8.text; + } + function createSyntheticImport(text, file) { + const externalHelpersModuleReference = factory.createStringLiteral(text); + const importDecl = factory.createImportDeclaration( + /*modifiers*/ + void 0, + /*importClause*/ + void 0, + externalHelpersModuleReference, + /*attributes*/ + void 0 + ); + addInternalEmitFlags( + importDecl, + 2 + /* NeverApplyImportHelper */ + ); + setParent(externalHelpersModuleReference, importDecl); + setParent(importDecl, file); + externalHelpersModuleReference.flags &= ~16; + importDecl.flags &= ~16; + return externalHelpersModuleReference; + } + function collectExternalModuleReferences(file) { + if (file.imports) { + return; + } + const isJavaScriptFile = isSourceFileJS(file); + const isExternalModuleFile = isExternalModule(file); + let imports; + let moduleAugmentations; + let ambientModules; + if ((getIsolatedModules(options) || isExternalModuleFile) && !file.isDeclarationFile) { + if (options.importHelpers) { + imports = [createSyntheticImport(externalHelpersModuleNameText, file)]; + } + const jsxImport = getJSXRuntimeImport(getJSXImplicitImportBase(options, file), options); + if (jsxImport) { + (imports || (imports = [])).push(createSyntheticImport(jsxImport, file)); + } + } + for (const node of file.statements) { + collectModuleReferences( + node, + /*inAmbientModule*/ + false + ); + } + if (file.flags & 4194304 || isJavaScriptFile) { + collectDynamicImportOrRequireCalls(file); + } + file.imports = imports || emptyArray; + file.moduleAugmentations = moduleAugmentations || emptyArray; + file.ambientModuleNames = ambientModules || emptyArray; + return; + function collectModuleReferences(node, inAmbientModule) { + if (isAnyImportOrReExport(node)) { + const moduleNameExpr = getExternalModuleName(node); + if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text && (!inAmbientModule || !isExternalModuleNameRelative(moduleNameExpr.text))) { + setParentRecursive( + node, + /*incremental*/ + false + ); + imports = append(imports, moduleNameExpr); + if (!usesUriStyleNodeCoreModules && currentNodeModulesDepth === 0 && !file.isDeclarationFile) { + usesUriStyleNodeCoreModules = startsWith2(moduleNameExpr.text, "node:"); + } + } + } else if (isModuleDeclaration(node)) { + if (isAmbientModule(node) && (inAmbientModule || hasSyntacticModifier( + node, + 128 + /* Ambient */ + ) || file.isDeclarationFile)) { + node.name.parent = node; + const nameText = getTextOfIdentifierOrLiteral(node.name); + if (isExternalModuleFile || inAmbientModule && !isExternalModuleNameRelative(nameText)) { + (moduleAugmentations || (moduleAugmentations = [])).push(node.name); + } else if (!inAmbientModule) { + if (file.isDeclarationFile) { + (ambientModules || (ambientModules = [])).push(nameText); + } + const body = node.body; + if (body) { + for (const statement of body.statements) { + collectModuleReferences( + statement, + /*inAmbientModule*/ + true + ); + } + } + } + } + } + } + function collectDynamicImportOrRequireCalls(file2) { + const r8 = /import|require/g; + while (r8.exec(file2.text) !== null) { + const node = getNodeAtPosition(file2, r8.lastIndex); + if (isJavaScriptFile && isRequireCall( + node, + /*requireStringLiteralLikeArgument*/ + true + )) { + setParentRecursive( + node, + /*incremental*/ + false + ); + imports = append(imports, node.arguments[0]); + } else if (isImportCall(node) && node.arguments.length >= 1 && isStringLiteralLike(node.arguments[0])) { + setParentRecursive( + node, + /*incremental*/ + false + ); + imports = append(imports, node.arguments[0]); + } else if (isLiteralImportTypeNode(node)) { + setParentRecursive( + node, + /*incremental*/ + false + ); + imports = append(imports, node.argument.literal); + } + } + } + function getNodeAtPosition(sourceFile, position) { + let current = sourceFile; + const getContainingChild = (child) => { + if (child.pos <= position && (position < child.end || position === child.end && child.kind === 1)) { + return child; + } + }; + while (true) { + const child = isJavaScriptFile && hasJSDocNodes(current) && forEach4(current.jsDoc, getContainingChild) || forEachChild(current, getContainingChild); + if (!child) { + return current; + } + current = child; + } + } + } + function getLibFileFromReference(ref) { + var _a22; + const { libFileName } = getLibFileNameFromLibReference(ref); + const actualFileName = libFileName && ((_a22 = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName)) == null ? void 0 : _a22.actual); + return actualFileName !== void 0 ? getSourceFile(actualFileName) : void 0; + } + function getSourceFileFromReference(referencingFile, ref) { + return getSourceFileFromReferenceWorker(resolveTripleslashReference(ref.fileName, referencingFile.fileName), getSourceFile); + } + function getSourceFileFromReferenceWorker(fileName, getSourceFile2, fail2, reason) { + if (hasExtension(fileName)) { + const canonicalFileName = host.getCanonicalFileName(fileName); + if (!options.allowNonTsExtensions && !forEach4(flatten2(supportedExtensionsWithJsonIfResolveJsonModule), (extension) => fileExtensionIs(canonicalFileName, extension))) { + if (fail2) { + if (hasJSFileExtension(canonicalFileName)) { + fail2(Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, fileName); + } else { + fail2(Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1, fileName, "'" + flatten2(supportedExtensions).join("', '") + "'"); + } + } + return void 0; + } + const sourceFile = getSourceFile2(fileName); + if (fail2) { + if (!sourceFile) { + const redirect = getProjectReferenceRedirect(fileName); + if (redirect) { + fail2(Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, fileName); + } else { + fail2(Diagnostics.File_0_not_found, fileName); + } + } else if (isReferencedFile(reason) && canonicalFileName === host.getCanonicalFileName(getSourceFileByPath(reason.file).fileName)) { + fail2(Diagnostics.A_file_cannot_have_a_reference_to_itself); + } + } + return sourceFile; + } else { + const sourceFileNoExtension = options.allowNonTsExtensions && getSourceFile2(fileName); + if (sourceFileNoExtension) + return sourceFileNoExtension; + if (fail2 && options.allowNonTsExtensions) { + fail2(Diagnostics.File_0_not_found, fileName); + return void 0; + } + const sourceFileWithAddedExtension = forEach4(supportedExtensions[0], (extension) => getSourceFile2(fileName + extension)); + if (fail2 && !sourceFileWithAddedExtension) + fail2(Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1, fileName, "'" + flatten2(supportedExtensions).join("', '") + "'"); + return sourceFileWithAddedExtension; + } + } + function processSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, packageId, reason) { + getSourceFileFromReferenceWorker( + fileName, + (fileName2) => findSourceFile(fileName2, isDefaultLib, ignoreNoDefaultLib, reason, packageId), + // TODO: GH#18217 + (diagnostic, ...args) => addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + diagnostic, + args + ), + reason + ); + } + function processProjectReferenceFile(fileName, reason) { + return processSourceFile( + fileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + /*packageId*/ + void 0, + reason + ); + } + function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) { + const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some2(fileReasons.get(existingFile.path), isReferencedFile); + if (hasExistingReasonToReportErrorOn) { + addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]); + } else { + addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, [fileName, existingFile.fileName]); + } + } + function createRedirectedSourceFile(redirectTarget, unredirected, fileName, path2, resolvedPath, originalFileName, sourceFileOptions) { + var _a22; + const redirect = parseNodeFactory.createRedirectedSourceFile({ redirectTarget, unredirected }); + redirect.fileName = fileName; + redirect.path = path2; + redirect.resolvedPath = resolvedPath; + redirect.originalFileName = originalFileName; + redirect.packageJsonLocations = ((_a22 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a22.length) ? sourceFileOptions.packageJsonLocations : void 0; + redirect.packageJsonScope = sourceFileOptions.packageJsonScope; + sourceFilesFoundSearchingNodeModules.set(path2, currentNodeModulesDepth > 0); + return redirect; + } + function findSourceFile(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { + var _a22, _b2; + (_a22 = tracing) == null ? void 0 : _a22.push(tracing.Phase.Program, "findSourceFile", { + fileName, + isDefaultLib: isDefaultLib || void 0, + fileIncludeKind: FileIncludeKind[reason.kind] + }); + const result2 = findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + return result2; + } + function getCreateSourceFileOptions(fileName, moduleResolutionCache2, host2, options2) { + const result2 = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2); + const languageVersion = getEmitScriptTarget(options2); + const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2); + return typeof result2 === "object" ? { ...result2, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result2, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode }; + } + function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) { + var _a22; + const path2 = toPath3(fileName); + if (useSourceOfProjectReferenceRedirect) { + let source = getSourceOfProjectReferenceRedirect(path2); + if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) { + const realPath2 = toPath3(host.realpath(fileName)); + if (realPath2 !== path2) + source = getSourceOfProjectReferenceRedirect(realPath2); + } + if (source) { + const file2 = isString4(source) ? findSourceFile(source, isDefaultLib, ignoreNoDefaultLib, reason, packageId) : void 0; + if (file2) + addFileToFilesByName( + file2, + path2, + fileName, + /*redirectedPath*/ + void 0 + ); + return file2; + } + } + const originalFileName = fileName; + if (filesByName.has(path2)) { + const file2 = filesByName.get(path2); + addFileIncludeReason(file2 || void 0, reason); + if (file2 && !(options.forceConsistentCasingInFileNames === false)) { + const checkedName = file2.fileName; + const isRedirect = toPath3(checkedName) !== toPath3(fileName); + if (isRedirect) { + fileName = getProjectReferenceRedirect(fileName) || fileName; + } + const checkedAbsolutePath = getNormalizedAbsolutePathWithoutRoot(checkedName, currentDirectory); + const inputAbsolutePath = getNormalizedAbsolutePathWithoutRoot(fileName, currentDirectory); + if (checkedAbsolutePath !== inputAbsolutePath) { + reportFileNamesDifferOnlyInCasingError(fileName, file2, reason); + } + } + if (file2 && sourceFilesFoundSearchingNodeModules.get(file2.path) && currentNodeModulesDepth === 0) { + sourceFilesFoundSearchingNodeModules.set(file2.path, false); + if (!options.noResolve) { + processReferencedFiles(file2, isDefaultLib); + processTypeReferenceDirectives(file2); + } + if (!options.noLib) { + processLibReferenceDirectives(file2); + } + modulesWithElidedImports.set(file2.path, false); + processImportedModules(file2); + } else if (file2 && modulesWithElidedImports.get(file2.path)) { + if (currentNodeModulesDepth < maxNodeModuleJsDepth) { + modulesWithElidedImports.set(file2.path, false); + processImportedModules(file2); + } + } + return file2 || void 0; + } + let redirectedPath; + if (isReferencedFile(reason) && !useSourceOfProjectReferenceRedirect) { + const redirectProject = getProjectReferenceRedirectProject(fileName); + if (redirectProject) { + if (outFile(redirectProject.commandLine.options)) { + return void 0; + } + const redirect = getProjectReferenceOutputName(redirectProject, fileName); + fileName = redirect; + redirectedPath = toPath3(redirect); + } + } + const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options); + const file = host.getSourceFile( + fileName, + sourceFileOptions, + (hostErrorMessage) => addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + Diagnostics.Cannot_read_file_0_Colon_1, + [fileName, hostErrorMessage] + ), + shouldCreateNewSourceFile + ); + if (packageId) { + const packageIdKey = packageIdToString(packageId); + const fileFromPackageId = packageIdToSourceFile.get(packageIdKey); + if (fileFromPackageId) { + const dupFile = createRedirectedSourceFile(fileFromPackageId, file, fileName, path2, toPath3(fileName), originalFileName, sourceFileOptions); + redirectTargetsMap.add(fileFromPackageId.path, fileName); + addFileToFilesByName(dupFile, path2, fileName, redirectedPath); + addFileIncludeReason(dupFile, reason); + sourceFileToPackageName.set(path2, packageIdToPackageName(packageId)); + processingOtherFiles.push(dupFile); + return dupFile; + } else if (file) { + packageIdToSourceFile.set(packageIdKey, file); + sourceFileToPackageName.set(path2, packageIdToPackageName(packageId)); + } + } + addFileToFilesByName(file, path2, fileName, redirectedPath); + if (file) { + sourceFilesFoundSearchingNodeModules.set(path2, currentNodeModulesDepth > 0); + file.fileName = fileName; + file.path = path2; + file.resolvedPath = toPath3(fileName); + file.originalFileName = originalFileName; + file.packageJsonLocations = ((_a22 = sourceFileOptions.packageJsonLocations) == null ? void 0 : _a22.length) ? sourceFileOptions.packageJsonLocations : void 0; + file.packageJsonScope = sourceFileOptions.packageJsonScope; + addFileIncludeReason(file, reason); + if (host.useCaseSensitiveFileNames()) { + const pathLowerCase = toFileNameLowerCase(path2); + const existingFile = filesByNameIgnoreCase.get(pathLowerCase); + if (existingFile) { + reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason); + } else { + filesByNameIgnoreCase.set(pathLowerCase, file); + } + } + skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib && !ignoreNoDefaultLib; + if (!options.noResolve) { + processReferencedFiles(file, isDefaultLib); + processTypeReferenceDirectives(file); + } + if (!options.noLib) { + processLibReferenceDirectives(file); + } + processImportedModules(file); + if (isDefaultLib) { + processingDefaultLibFiles.push(file); + } else { + processingOtherFiles.push(file); + } + } + return file; + } + function addFileIncludeReason(file, reason) { + if (file) + fileReasons.add(file.path, reason); + } + function addFileToFilesByName(file, path2, fileName, redirectedPath) { + if (redirectedPath) { + updateFilesByNameMap(fileName, redirectedPath, file); + updateFilesByNameMap(fileName, path2, file || false); + } else { + updateFilesByNameMap(fileName, path2, file); + } + } + function updateFilesByNameMap(fileName, path2, file) { + filesByName.set(path2, file); + if (file !== void 0) + missingFileNames.delete(path2); + else + missingFileNames.set(path2, fileName); + } + function getProjectReferenceRedirect(fileName) { + const referencedProject = getProjectReferenceRedirectProject(fileName); + return referencedProject && getProjectReferenceOutputName(referencedProject, fileName); + } + function getProjectReferenceRedirectProject(fileName) { + if (!resolvedProjectReferences || !resolvedProjectReferences.length || isDeclarationFileName(fileName) || fileExtensionIs( + fileName, + ".json" + /* Json */ + )) { + return void 0; + } + return getResolvedProjectReferenceToRedirect(fileName); + } + function getProjectReferenceOutputName(referencedProject, fileName) { + const out = outFile(referencedProject.commandLine.options); + return out ? changeExtension( + out, + ".d.ts" + /* Dts */ + ) : getOutputDeclarationFileName(fileName, referencedProject.commandLine, !host.useCaseSensitiveFileNames()); + } + function getResolvedProjectReferenceToRedirect(fileName) { + if (mapFromFileToProjectReferenceRedirects === void 0) { + mapFromFileToProjectReferenceRedirects = /* @__PURE__ */ new Map(); + forEachResolvedProjectReference2((referencedProject) => { + if (toPath3(options.configFilePath) !== referencedProject.sourceFile.path) { + referencedProject.commandLine.fileNames.forEach((f8) => mapFromFileToProjectReferenceRedirects.set(toPath3(f8), referencedProject.sourceFile.path)); + } + }); + } + const referencedProjectPath = mapFromFileToProjectReferenceRedirects.get(toPath3(fileName)); + return referencedProjectPath && getResolvedProjectReferenceByPath(referencedProjectPath); + } + function forEachResolvedProjectReference2(cb) { + return forEachResolvedProjectReference(resolvedProjectReferences, cb); + } + function getSourceOfProjectReferenceRedirect(path2) { + if (!isDeclarationFileName(path2)) + return void 0; + if (mapFromToProjectReferenceRedirectSource === void 0) { + mapFromToProjectReferenceRedirectSource = /* @__PURE__ */ new Map(); + forEachResolvedProjectReference2((resolvedRef) => { + const out = outFile(resolvedRef.commandLine.options); + if (out) { + const outputDts = changeExtension( + out, + ".d.ts" + /* Dts */ + ); + mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), true); + } else { + const getCommonSourceDirectory3 = memoize2(() => getCommonSourceDirectoryOfConfig(resolvedRef.commandLine, !host.useCaseSensitiveFileNames())); + forEach4(resolvedRef.commandLine.fileNames, (fileName) => { + if (!isDeclarationFileName(fileName) && !fileExtensionIs( + fileName, + ".json" + /* Json */ + )) { + const outputDts = getOutputDeclarationFileName(fileName, resolvedRef.commandLine, !host.useCaseSensitiveFileNames(), getCommonSourceDirectory3); + mapFromToProjectReferenceRedirectSource.set(toPath3(outputDts), fileName); + } + }); + } + }); + } + return mapFromToProjectReferenceRedirectSource.get(path2); + } + function isSourceOfProjectReferenceRedirect(fileName) { + return useSourceOfProjectReferenceRedirect && !!getResolvedProjectReferenceToRedirect(fileName); + } + function getResolvedProjectReferenceByPath(projectReferencePath) { + if (!projectReferenceRedirects) { + return void 0; + } + return projectReferenceRedirects.get(projectReferencePath) || void 0; + } + function processReferencedFiles(file, isDefaultLib) { + forEach4(file.referencedFiles, (ref, index4) => { + processSourceFile( + resolveTripleslashReference(ref.fileName, file.fileName), + isDefaultLib, + /*ignoreNoDefaultLib*/ + false, + /*packageId*/ + void 0, + { kind: 4, file: file.path, index: index4 } + ); + }); + } + function processTypeReferenceDirectives(file) { + const typeDirectives = file.typeReferenceDirectives; + if (!typeDirectives.length) + return; + const resolutions = (resolvedTypeReferenceDirectiveNamesProcessing == null ? void 0 : resolvedTypeReferenceDirectiveNamesProcessing.get(file.path)) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file); + const resolutionsInFile = createModeAwareCache(); + (resolvedTypeReferenceDirectiveNames ?? (resolvedTypeReferenceDirectiveNames = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile); + for (let index4 = 0; index4 < typeDirectives.length; index4++) { + const ref = file.typeReferenceDirectives[index4]; + const resolvedTypeReferenceDirective = resolutions[index4]; + const fileName = toFileNameLowerCase(ref.fileName); + resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective); + const mode = ref.resolutionMode || file.impliedNodeFormat; + processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5, file: file.path, index: index4 }); + } + } + function processTypeReferenceDirective(typeReferenceDirective, mode, resolution, reason) { + var _a22, _b2; + (_a22 = tracing) == null ? void 0 : _a22.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolution.resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 }); + processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason); + (_b2 = tracing) == null ? void 0 : _b2.pop(); + } + function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason) { + var _a22; + addResolutionDiagnostics(resolution); + const previousResolution = (_a22 = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode)) == null ? void 0 : _a22.resolvedTypeReferenceDirective; + if (previousResolution && previousResolution.primary) { + return; + } + let saveResolution = true; + const { resolvedTypeReferenceDirective } = resolution; + if (resolvedTypeReferenceDirective) { + if (resolvedTypeReferenceDirective.isExternalLibraryImport) + currentNodeModulesDepth++; + if (resolvedTypeReferenceDirective.primary) { + processSourceFile( + resolvedTypeReferenceDirective.resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + resolvedTypeReferenceDirective.packageId, + reason + ); + } else { + if (previousResolution) { + if (resolvedTypeReferenceDirective.resolvedFileName !== previousResolution.resolvedFileName) { + const otherFileText = host.readFile(resolvedTypeReferenceDirective.resolvedFileName); + const existingFile = getSourceFile(previousResolution.resolvedFileName); + if (otherFileText !== existingFile.text) { + addFilePreprocessingFileExplainingDiagnostic( + existingFile, + reason, + Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict, + [typeReferenceDirective, resolvedTypeReferenceDirective.resolvedFileName, previousResolution.resolvedFileName] + ); + } + } + saveResolution = false; + } else { + processSourceFile( + resolvedTypeReferenceDirective.resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + resolvedTypeReferenceDirective.packageId, + reason + ); + } + } + if (resolvedTypeReferenceDirective.isExternalLibraryImport) + currentNodeModulesDepth--; + } else { + addFilePreprocessingFileExplainingDiagnostic( + /*file*/ + void 0, + reason, + Diagnostics.Cannot_find_type_definition_file_for_0, + [typeReferenceDirective] + ); + } + if (saveResolution) { + resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolution); + } + } + function pathForLibFile(libFileName) { + const existing = resolvedLibReferences == null ? void 0 : resolvedLibReferences.get(libFileName); + if (existing) + return existing.actual; + const result2 = pathForLibFileWorker(libFileName); + (resolvedLibReferences ?? (resolvedLibReferences = /* @__PURE__ */ new Map())).set(libFileName, result2); + return result2.actual; + } + function pathForLibFileWorker(libFileName) { + var _a22, _b2, _c2, _d2, _e22; + const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName); + if (existing) + return existing; + if (structureIsReused !== 0 && oldProgram && !hasInvalidatedLibResolutions(libFileName)) { + const oldResolution = (_a22 = oldProgram.resolvedLibReferences) == null ? void 0 : _a22.get(libFileName); + if (oldResolution) { + if (oldResolution.resolution && isTraceEnabled(options, host)) { + const libraryName2 = getLibraryNameFromLibFileName(libFileName); + const resolveFrom2 = getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName); + trace2( + host, + oldResolution.resolution.resolvedModule ? oldResolution.resolution.resolvedModule.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved, + libraryName2, + getNormalizedAbsolutePath(resolveFrom2, currentDirectory), + (_b2 = oldResolution.resolution.resolvedModule) == null ? void 0 : _b2.resolvedFileName, + ((_c2 = oldResolution.resolution.resolvedModule) == null ? void 0 : _c2.packageId) && packageIdToString(oldResolution.resolution.resolvedModule.packageId) + ); + } + (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, oldResolution); + return oldResolution; + } + } + const libraryName = getLibraryNameFromLibFileName(libFileName); + const resolveFrom = getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName); + (_d2 = tracing) == null ? void 0 : _d2.push(tracing.Phase.Program, "resolveLibrary", { resolveFrom }); + mark("beforeResolveLibrary"); + const resolution = actualResolveLibrary(libraryName, resolveFrom, options, libFileName); + mark("afterResolveLibrary"); + measure("ResolveLibrary", "beforeResolveLibrary", "afterResolveLibrary"); + (_e22 = tracing) == null ? void 0 : _e22.pop(); + const result2 = { + resolution, + actual: resolution.resolvedModule ? resolution.resolvedModule.resolvedFileName : combinePaths(defaultLibraryPath, libFileName) + }; + (resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2); + return result2; + } + function processLibReferenceDirectives(file) { + forEach4(file.libReferenceDirectives, (libReference, index4) => { + const { libName, libFileName } = getLibFileNameFromLibReference(libReference); + if (libFileName) { + processRootFile( + pathForLibFile(libFileName), + /*isDefaultLib*/ + true, + /*ignoreNoDefaultLib*/ + true, + { kind: 7, file: file.path, index: index4 } + ); + } else { + const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts"); + const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity2); + const diagnostic = suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0; + const args = suggestion ? [libName, suggestion] : [libName]; + (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({ + kind: 0, + reason: { kind: 7, file: file.path, index: index4 }, + diagnostic, + args + }); + } + }); + } + function getCanonicalFileName(fileName) { + return host.getCanonicalFileName(fileName); + } + function processImportedModules(file) { + var _a22; + collectExternalModuleReferences(file); + if (file.imports.length || file.moduleAugmentations.length) { + const moduleNames = getModuleNames(file); + const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file); + Debug.assert(resolutions.length === moduleNames.length); + const optionsForFile = ((_a22 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a22.commandLine.options) || options; + const resolutionsInFile = createModeAwareCache(); + (resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile); + for (let index4 = 0; index4 < moduleNames.length; index4++) { + const resolution = resolutions[index4].resolvedModule; + const moduleName3 = moduleNames[index4].text; + const mode = getModeForUsageLocationWorker(file, moduleNames[index4], optionsForFile); + resolutionsInFile.set(moduleName3, mode, resolutions[index4]); + addResolutionDiagnosticsFromResolutionOrCache(file, moduleName3, resolutions[index4], mode); + if (!resolution) { + continue; + } + const isFromNodeModulesSearch = resolution.isExternalLibraryImport; + const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension); + const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName)); + const resolvedFileName = resolution.resolvedFileName; + if (isFromNodeModulesSearch) { + currentNodeModulesDepth++; + } + const elideImport = isJsFileFromNodeModules && currentNodeModulesDepth > maxNodeModuleJsDepth; + const shouldAddFile = resolvedFileName && !getResolutionDiagnostic(optionsForFile, resolution, file) && !optionsForFile.noResolve && index4 < file.imports.length && !elideImport && !(isJsFile && !getAllowJSCompilerOption(optionsForFile)) && (isInJSFile(file.imports[index4]) || !(file.imports[index4].flags & 16777216)); + if (elideImport) { + modulesWithElidedImports.set(file.path, true); + } else if (shouldAddFile) { + findSourceFile( + resolvedFileName, + /*isDefaultLib*/ + false, + /*ignoreNoDefaultLib*/ + false, + { kind: 3, file: file.path, index: index4 }, + resolution.packageId + ); + } + if (isFromNodeModulesSearch) { + currentNodeModulesDepth--; + } + } + } + } + function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { + let allFilesBelongToPath = true; + const absoluteRootDirectoryPath = host.getCanonicalFileName(getNormalizedAbsolutePath(rootDirectory, currentDirectory)); + for (const sourceFile of sourceFiles) { + if (!sourceFile.isDeclarationFile) { + const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); + if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { + addProgramDiagnosticExplainingFile( + sourceFile, + Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, + [sourceFile.fileName, rootDirectory] + ); + allFilesBelongToPath = false; + } + } + } + return allFilesBelongToPath; + } + function parseProjectReferenceConfigFile(ref) { + if (!projectReferenceRedirects) { + projectReferenceRedirects = /* @__PURE__ */ new Map(); + } + const refPath = resolveProjectReferencePath(ref); + const sourceFilePath = toPath3(refPath); + const fromCache = projectReferenceRedirects.get(sourceFilePath); + if (fromCache !== void 0) { + return fromCache || void 0; + } + let commandLine; + let sourceFile; + if (host.getParsedCommandLine) { + commandLine = host.getParsedCommandLine(refPath); + if (!commandLine) { + addFileToFilesByName( + /*file*/ + void 0, + sourceFilePath, + refPath, + /*redirectedPath*/ + void 0 + ); + projectReferenceRedirects.set(sourceFilePath, false); + return void 0; + } + sourceFile = Debug.checkDefined(commandLine.options.configFile); + Debug.assert(!sourceFile.path || sourceFile.path === sourceFilePath); + addFileToFilesByName( + sourceFile, + sourceFilePath, + refPath, + /*redirectedPath*/ + void 0 + ); + } else { + const basePath = getNormalizedAbsolutePath(getDirectoryPath(refPath), currentDirectory); + sourceFile = host.getSourceFile( + refPath, + 100 + /* JSON */ + ); + addFileToFilesByName( + sourceFile, + sourceFilePath, + refPath, + /*redirectedPath*/ + void 0 + ); + if (sourceFile === void 0) { + projectReferenceRedirects.set(sourceFilePath, false); + return void 0; + } + commandLine = parseJsonSourceFileConfigFileContent( + sourceFile, + configParsingHost, + basePath, + /*existingOptions*/ + void 0, + refPath + ); + } + sourceFile.fileName = refPath; + sourceFile.path = sourceFilePath; + sourceFile.resolvedPath = sourceFilePath; + sourceFile.originalFileName = refPath; + const resolvedRef = { commandLine, sourceFile }; + projectReferenceRedirects.set(sourceFilePath, resolvedRef); + if (commandLine.projectReferences) { + resolvedRef.references = commandLine.projectReferences.map(parseProjectReferenceConfigFile); + } + return resolvedRef; + } + function verifyCompilerOptions() { + if (options.strictPropertyInitialization && !getStrictOptionValue(options, "strictNullChecks")) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks"); + } + if (options.exactOptionalPropertyTypes && !getStrictOptionValue(options, "strictNullChecks")) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "exactOptionalPropertyTypes", "strictNullChecks"); + } + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.out) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); + } + if (options.outFile) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "outFile", options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules"); + } + } + if (options.inlineSourceMap) { + if (options.sourceMap) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "sourceMap", "inlineSourceMap"); + } + if (options.mapRoot) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "mapRoot", "inlineSourceMap"); + } + } + if (options.composite) { + if (options.declaration === false) { + createDiagnosticForOptionName(Diagnostics.Composite_projects_may_not_disable_declaration_emit, "declaration"); + } + if (options.incremental === false) { + createDiagnosticForOptionName(Diagnostics.Composite_projects_may_not_disable_incremental_compilation, "declaration"); + } + } + const outputFile = outFile(options); + if (options.tsBuildInfoFile) { + if (!isIncrementalCompilation(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "tsBuildInfoFile", "incremental", "composite"); + } + } else if (options.incremental && !outputFile && !options.configFilePath) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)); + } + verifyDeprecatedCompilerOptions(); + verifyProjectReferences(); + if (options.composite) { + const rootPaths = new Set(rootNames.map(toPath3)); + for (const file of files) { + if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) { + addProgramDiagnosticExplainingFile( + file, + Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern, + [file.fileName, options.configFilePath || ""] + ); + } + } + } + if (options.paths) { + for (const key in options.paths) { + if (!hasProperty(options.paths, key)) { + continue; + } + if (!hasZeroOrOneAsteriskCharacter(key)) { + createDiagnosticForOptionPaths( + /*onKey*/ + true, + key, + Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, + key + ); + } + if (isArray3(options.paths[key])) { + const len = options.paths[key].length; + if (len === 0) { + createDiagnosticForOptionPaths( + /*onKey*/ + false, + key, + Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array, + key + ); + } + for (let i7 = 0; i7 < len; i7++) { + const subst = options.paths[key][i7]; + const typeOfSubst = typeof subst; + if (typeOfSubst === "string") { + if (!hasZeroOrOneAsteriskCharacter(subst)) { + createDiagnosticForOptionPathKeyValue(key, i7, Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character, subst, key); + } + if (!options.baseUrl && !pathIsRelative(subst) && !pathIsAbsolute(subst)) { + createDiagnosticForOptionPathKeyValue(key, i7, Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash); + } + } else { + createDiagnosticForOptionPathKeyValue(key, i7, Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2, subst, key, typeOfSubst); + } + } + } else { + createDiagnosticForOptionPaths( + /*onKey*/ + false, + key, + Diagnostics.Substitutions_for_pattern_0_should_be_an_array, + key + ); + } + } + } + if (!options.sourceMap && !options.inlineSourceMap) { + if (options.inlineSources) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "inlineSources"); + } + if (options.sourceRoot) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided, "sourceRoot"); + } + } + if (options.out && options.outFile) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "out", "outFile"); + } + if (options.mapRoot && !(options.sourceMap || options.declarationMap)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "mapRoot", "sourceMap", "declarationMap"); + } + if (options.declarationDir) { + if (!getEmitDeclarations(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); + } + if (outputFile) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", options.out ? "out" : "outFile"); + } + } + if (options.declarationMap && !getEmitDeclarations(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationMap", "declaration", "composite"); + } + if (options.lib && options.noLib) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "lib", "noLib"); + } + if (options.noImplicitUseStrict && getStrictOptionValue(options, "alwaysStrict")) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noImplicitUseStrict", "alwaysStrict"); + } + const languageVersion = getEmitScriptTarget(options); + const firstNonAmbientExternalModuleSourceFile = find2(files, (f8) => isExternalModule(f8) && !f8.isDeclarationFile); + if (options.isolatedModules || options.verbatimModuleSyntax) { + if (options.module === 0 && languageVersion < 2 && options.isolatedModules) { + createDiagnosticForOptionName(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher, "isolatedModules", "target"); + } + if (options.preserveConstEnums === false) { + createDiagnosticForOptionName(Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_0_is_enabled, options.verbatimModuleSyntax ? "verbatimModuleSyntax" : "isolatedModules", "preserveConstEnums"); + } + } else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === 0) { + const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); + programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)); + } + if (outputFile && !options.emitDeclarationOnly) { + if (options.module && !(options.module === 2 || options.module === 4)) { + createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, options.out ? "out" : "outFile", "module"); + } else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) { + const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator); + programDiagnostics.add(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, options.out ? "out" : "outFile")); + } + } + if (getResolveJsonModule(options)) { + if (getEmitModuleResolutionKind(options) === 1) { + createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule"); + } else if (!hasJsonModuleEmitEnabled(options)) { + createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_module_is_set_to_none_system_or_umd, "resolveJsonModule", "module"); + } + } + if (options.outDir || // there is --outDir specified + options.rootDir || // there is --rootDir specified + options.sourceRoot || // there is --sourceRoot specified + options.mapRoot) { + const dir2 = getCommonSourceDirectory2(); + if (options.outDir && dir2 === "" && files.some((file) => getRootLength(file.fileName) > 1)) { + createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir"); + } + } + if (options.useDefineForClassFields && languageVersion === 0) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields"); + } + if (options.checkJs && !getAllowJSCompilerOption(options)) { + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); + } + if (options.emitDeclarationOnly) { + if (!getEmitDeclarations(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite"); + } + if (options.noEmit) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } + if (options.emitDecoratorMetadata && !options.experimentalDecorators) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); + } + if (options.jsxFactory) { + if (options.reactNamespace) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "reactNamespace", "jsxFactory"); + } + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFactory", inverseJsxOptionMap.get("" + options.jsx)); + } + if (!parseIsolatedEntityName(options.jsxFactory, languageVersion)) { + createOptionValueDiagnostic("jsxFactory", Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFactory); + } + } else if (options.reactNamespace && !isIdentifierText(options.reactNamespace, languageVersion)) { + createOptionValueDiagnostic("reactNamespace", Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier, options.reactNamespace); + } + if (options.jsxFragmentFactory) { + if (!options.jsxFactory) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "jsxFragmentFactory", "jsxFactory"); + } + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxFragmentFactory", inverseJsxOptionMap.get("" + options.jsx)); + } + if (!parseIsolatedEntityName(options.jsxFragmentFactory, languageVersion)) { + createOptionValueDiagnostic("jsxFragmentFactory", Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name, options.jsxFragmentFactory); + } + } + if (options.reactNamespace) { + if (options.jsx === 4 || options.jsx === 5) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "reactNamespace", inverseJsxOptionMap.get("" + options.jsx)); + } + } + if (options.jsxImportSource) { + if (options.jsx === 2) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1, "jsxImportSource", inverseJsxOptionMap.get("" + options.jsx)); + } + } + if (options.preserveValueImports && getEmitModuleKind(options) < 5) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "preserveValueImports"); + } + const moduleKind = getEmitModuleKind(options); + if (options.verbatimModuleSyntax) { + if (moduleKind === 2 || moduleKind === 3 || moduleKind === 4) { + createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax"); + } + if (options.preserveValueImports) { + createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax"); + } + if (options.importsNotUsedAsValues) { + createRedundantOptionDiagnostic("importsNotUsedAsValues", "verbatimModuleSyntax"); + } + } + if (options.allowImportingTsExtensions && !(options.noEmit || options.emitDeclarationOnly)) { + createOptionValueDiagnostic("allowImportingTsExtensions", Diagnostics.Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set); + } + const moduleResolution = getEmitModuleResolutionKind(options); + if (options.resolvePackageJsonExports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonExports"); + } + if (options.resolvePackageJsonImports && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "resolvePackageJsonImports"); + } + if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) { + createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions"); + } + if (moduleResolution === 100 && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200) { + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler"); + } + if (ModuleKind[moduleKind] && (100 <= moduleKind && moduleKind <= 199) && !(3 <= moduleResolution && moduleResolution <= 99)) { + const moduleKindName = ModuleKind[moduleKind]; + createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleKindName, moduleKindName); + } else if (ModuleResolutionKind[moduleResolution] && (3 <= moduleResolution && moduleResolution <= 99) && !(100 <= moduleKind && moduleKind <= 199)) { + const moduleResolutionName = ModuleResolutionKind[moduleResolution]; + createOptionValueDiagnostic("module", Diagnostics.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, moduleResolutionName, moduleResolutionName); + } + if (!options.noEmit && !options.suppressOutputPathCheck) { + const emitHost = getEmitHost(); + const emitFilesSeen = /* @__PURE__ */ new Set(); + forEachEmittedFile(emitHost, (emitFileNames) => { + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen); + } + verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen); + }); + } + function verifyEmitFilePath(emitFileName, emitFilesSeen) { + if (emitFileName) { + const emitFilePath = toPath3(emitFileName); + if (filesByName.has(emitFilePath)) { + let chain3; + if (!options.configFilePath) { + chain3 = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig + ); + } + chain3 = chainDiagnosticMessages(chain3, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, createCompilerDiagnosticFromMessageChain(chain3)); + } + const emitFileKey = !host.useCaseSensitiveFileNames() ? toFileNameLowerCase(emitFilePath) : emitFilePath; + if (emitFilesSeen.has(emitFileKey)) { + blockEmittingOfFile(emitFileName, createCompilerDiagnostic(Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName)); + } else { + emitFilesSeen.add(emitFileKey); + } + } + } + } + function getIgnoreDeprecationsVersion() { + const ignoreDeprecations = options.ignoreDeprecations; + if (ignoreDeprecations) { + if (ignoreDeprecations === "5.0") { + return new Version(ignoreDeprecations); + } + reportInvalidIgnoreDeprecations(); + } + return Version.zero; + } + function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) { + const deprecatedInVersion = new Version(deprecatedIn); + const removedInVersion = new Version(removedIn); + const typescriptVersion = new Version(typeScriptVersion3 || versionMajorMinor); + const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion(); + const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1); + const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1; + if (mustBeRemoved || canBeSilenced) { + fn((name2, value2, useInstead) => { + if (mustBeRemoved) { + if (value2 === void 0) { + createDiagnostic(name2, value2, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name2); + } else { + createDiagnostic(name2, value2, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name2, value2); + } + } else { + if (value2 === void 0) { + createDiagnostic(name2, value2, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name2, removedIn, deprecatedIn); + } else { + createDiagnostic(name2, value2, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name2, value2, removedIn, deprecatedIn); + } + } + }); + } + } + function verifyDeprecatedCompilerOptions() { + function createDiagnostic(name2, value2, useInstead, message, ...args) { + if (useInstead) { + const details = chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Use_0_instead, + useInstead + ); + const chain3 = chainDiagnosticMessages(details, message, ...args); + createDiagnosticForOption( + /*onKey*/ + !value2, + name2, + /*option2*/ + void 0, + chain3 + ); + } else { + createDiagnosticForOption( + /*onKey*/ + !value2, + name2, + /*option2*/ + void 0, + message, + ...args + ); + } + } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (options.target === 0) { + createDeprecatedDiagnostic("target", "ES3"); + } + if (options.noImplicitUseStrict) { + createDeprecatedDiagnostic("noImplicitUseStrict"); + } + if (options.keyofStringsOnly) { + createDeprecatedDiagnostic("keyofStringsOnly"); + } + if (options.suppressExcessPropertyErrors) { + createDeprecatedDiagnostic("suppressExcessPropertyErrors"); + } + if (options.suppressImplicitAnyIndexErrors) { + createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors"); + } + if (options.noStrictGenericChecks) { + createDeprecatedDiagnostic("noStrictGenericChecks"); + } + if (options.charset) { + createDeprecatedDiagnostic("charset"); + } + if (options.out) { + createDeprecatedDiagnostic( + "out", + /*value*/ + void 0, + "outFile" + ); + } + if (options.importsNotUsedAsValues) { + createDeprecatedDiagnostic( + "importsNotUsedAsValues", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + if (options.preserveValueImports) { + createDeprecatedDiagnostic( + "preserveValueImports", + /*value*/ + void 0, + "verbatimModuleSyntax" + ); + } + }); + } + function verifyDeprecatedProjectReference(ref, parentFile, index4) { + function createDiagnostic(_name, _value, _useInstead, message, ...args) { + createDiagnosticForReference(parentFile, index4, message, ...args); + } + checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => { + if (ref.prepend) { + createDeprecatedDiagnostic("prepend"); + } + }); + } + function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) { + var _a22; + let fileIncludeReasons; + let relatedInfo; + let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0; + if (file) + (_a22 = fileReasons.get(file.path)) == null ? void 0 : _a22.forEach(processReason); + if (fileProcessingReason) + processReason(fileProcessingReason); + if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1) + fileIncludeReasons = void 0; + const location2 = locationReason && getReferencedFileLocation(program, locationReason); + const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon); + const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file); + const chain3 = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray); + return location2 && isReferenceFileLocation(location2) ? createFileDiagnosticFromMessageChain(location2.file, location2.pos, location2.end - location2.pos, chain3, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain3, relatedInfo); + function processReason(reason) { + (fileIncludeReasons || (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason)); + if (!locationReason && isReferencedFile(reason)) { + locationReason = reason; + } else if (locationReason !== reason) { + relatedInfo = append(relatedInfo, fileIncludeReasonToRelatedInformation(reason)); + } + if (reason === fileProcessingReason) + fileProcessingReason = void 0; + } + } + function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) { + (fileProcessingDiagnostics || (fileProcessingDiagnostics = [])).push({ + kind: 1, + file: file && file.path, + fileProcessingReason, + diagnostic, + args + }); + } + function addProgramDiagnosticExplainingFile(file, diagnostic, args) { + programDiagnostics.add(createDiagnosticExplainingFile( + file, + /*fileProcessingReason*/ + void 0, + diagnostic, + args + )); + } + function fileIncludeReasonToRelatedInformation(reason) { + if (isReferencedFile(reason)) { + const referenceLocation = getReferencedFileLocation(program, reason); + let message2; + switch (reason.kind) { + case 3: + message2 = Diagnostics.File_is_included_via_import_here; + break; + case 4: + message2 = Diagnostics.File_is_included_via_reference_here; + break; + case 5: + message2 = Diagnostics.File_is_included_via_type_library_reference_here; + break; + case 7: + message2 = Diagnostics.File_is_included_via_library_reference_here; + break; + default: + Debug.assertNever(reason); + } + return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic( + referenceLocation.file, + referenceLocation.pos, + referenceLocation.end - referenceLocation.pos, + message2 + ) : void 0; + } + if (!options.configFile) + return void 0; + let configFileNode; + let message; + switch (reason.kind) { + case 0: + if (!options.configFile.configFileSpecs) + return void 0; + const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory); + const matchedByFiles = getMatchedFileSpec(program, fileName); + if (matchedByFiles) { + configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles); + message = Diagnostics.File_is_matched_by_files_list_specified_here; + break; + } + const matchedByInclude = getMatchedIncludeSpec(program, fileName); + if (!matchedByInclude || !isString4(matchedByInclude)) + return void 0; + configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude); + message = Diagnostics.File_is_matched_by_include_pattern_specified_here; + break; + case 1: + case 2: + const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]); + const referenceInfo = forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent22, index22) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent22 == null ? void 0 : parent22.sourceFile) || options.configFile, index: index22 } : void 0); + if (!referenceInfo) + return void 0; + const { sourceFile, index: index4 } = referenceInfo; + const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property2) => isArrayLiteralExpression(property2.initializer) ? property2.initializer : void 0); + return referencesSyntax && referencesSyntax.elements.length > index4 ? createDiagnosticForNodeInSourceFile( + sourceFile, + referencesSyntax.elements[index4], + reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here + ) : void 0; + case 8: + if (!options.types) + return void 0; + configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference); + message = Diagnostics.File_is_entry_point_of_type_library_specified_here; + break; + case 6: + if (reason.index !== void 0) { + configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]); + message = Diagnostics.File_is_library_specified_here; + break; + } + const target = forEachEntry(targetOptionDeclaration.type, (value2, key) => value2 === getEmitScriptTarget(options) ? key : void 0); + configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0; + message = Diagnostics.File_is_default_library_for_target_specified_here; + break; + default: + Debug.assertNever(reason); + } + return configFileNode && createDiagnosticForNodeInSourceFile( + options.configFile, + configFileNode, + message + ); + } + function verifyProjectReferences() { + const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0; + forEachProjectReference(projectReferences, resolvedProjectReferences, (resolvedRef, parent22, index4) => { + const ref = (parent22 ? parent22.commandLine.projectReferences : projectReferences)[index4]; + const parentFile = parent22 && parent22.sourceFile; + verifyDeprecatedProjectReference(ref, parentFile, index4); + if (!resolvedRef) { + createDiagnosticForReference(parentFile, index4, Diagnostics.File_0_not_found, ref.path); + return; + } + const options2 = resolvedRef.commandLine.options; + if (!options2.composite || options2.noEmit) { + const inputs = parent22 ? parent22.commandLine.fileNames : rootNames; + if (inputs.length) { + if (!options2.composite) + createDiagnosticForReference(parentFile, index4, Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true, ref.path); + if (options2.noEmit) + createDiagnosticForReference(parentFile, index4, Diagnostics.Referenced_project_0_may_not_disable_emit, ref.path); + } + } + if (ref.prepend) { + const out = outFile(options2); + if (out) { + if (!host.fileExists(out)) { + createDiagnosticForReference(parentFile, index4, Diagnostics.Output_file_0_from_project_1_does_not_exist, out, ref.path); + } + } else { + createDiagnosticForReference(parentFile, index4, Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set, ref.path); + } + } + if (!parent22 && buildInfoPath && buildInfoPath === getTsBuildInfoEmitOutputFilePath(options2)) { + createDiagnosticForReference(parentFile, index4, Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1, buildInfoPath, ref.path); + hasEmitBlockingDiagnostics.set(toPath3(buildInfoPath), true); + } + }); + } + function createDiagnosticForOptionPathKeyValue(key, valueIndex, message, ...args) { + let needCompilerDiagnostic = true; + forEachOptionPathsSyntax((pathProp) => { + if (isObjectLiteralExpression(pathProp.initializer)) { + forEachPropertyAssignment(pathProp.initializer, key, (keyProps) => { + const initializer = keyProps.initializer; + if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message, ...args)); + needCompilerDiagnostic = false; + } + }); + } + }); + if (needCompilerDiagnostic) { + programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + } + } + function createDiagnosticForOptionPaths(onKey, key, message, ...args) { + let needCompilerDiagnostic = true; + forEachOptionPathsSyntax((pathProp) => { + if (isObjectLiteralExpression(pathProp.initializer) && createOptionDiagnosticInObjectLiteralSyntax( + pathProp.initializer, + onKey, + key, + /*key2*/ + void 0, + message, + ...args + )) { + needCompilerDiagnostic = false; + } + }); + if (needCompilerDiagnostic) { + programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + } + } + function forEachOptionsSyntaxByName(name2, callback) { + return forEachPropertyAssignment(getCompilerOptionsObjectLiteralSyntax(), name2, callback); + } + function forEachOptionPathsSyntax(callback) { + return forEachOptionsSyntaxByName("paths", callback); + } + function getOptionsSyntaxByValue(name2, value2) { + return forEachOptionsSyntaxByName(name2, (property2) => isStringLiteral(property2.initializer) && property2.initializer.text === value2 ? property2.initializer : void 0); + } + function getOptionsSyntaxByArrayElementValue(name2, value2) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + return compilerOptionsObjectLiteralSyntax && getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name2, value2); + } + function createDiagnosticForOptionName(message, option1, option2, option3) { + createDiagnosticForOption( + /*onKey*/ + true, + option1, + option2, + message, + option1, + option2, + option3 + ); + } + function createOptionValueDiagnostic(option1, message, ...args) { + createDiagnosticForOption( + /*onKey*/ + false, + option1, + /*option2*/ + void 0, + message, + ...args + ); + } + function createDiagnosticForReference(sourceFile, index4, message, ...args) { + const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property2) => isArrayLiteralExpression(property2.initializer) ? property2.initializer : void 0); + if (referencesSyntax && referencesSyntax.elements.length > index4) { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index4], message, ...args)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + } + } + function createDiagnosticForOption(onKey, option1, option2, message, ...args) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, ...args); + if (needCompilerDiagnostic) { + if ("messageText" in message) { + programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message)); + } else { + programDiagnostics.add(createCompilerDiagnostic(message, ...args)); + } + } + } + function getCompilerOptionsObjectLiteralSyntax() { + if (_compilerOptionsObjectLiteralSyntax === void 0) { + _compilerOptionsObjectLiteralSyntax = forEachPropertyAssignment( + getTsConfigObjectLiteralExpression(options.configFile), + "compilerOptions", + (prop) => isObjectLiteralExpression(prop.initializer) ? prop.initializer : void 0 + ) || false; + } + return _compilerOptionsObjectLiteralSyntax || void 0; + } + function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, ...args) { + let needsCompilerDiagnostic = false; + forEachPropertyAssignment(objectLiteral, key1, (prop) => { + if ("messageText" in message) { + programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message)); + } else { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, ...args)); + } + needsCompilerDiagnostic = true; + }, key2); + return needsCompilerDiagnostic; + } + function createRedundantOptionDiagnostic(errorOnOption, redundantWithOption) { + const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax(); + if (compilerOptionsObjectLiteralSyntax) { + createOptionDiagnosticInObjectLiteralSyntax( + compilerOptionsObjectLiteralSyntax, + /*onKey*/ + true, + errorOnOption, + /*key2*/ + void 0, + Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, + errorOnOption, + redundantWithOption + ); + } else { + createDiagnosticForOptionName(Diagnostics.Option_0_is_redundant_and_cannot_be_specified_with_option_1, errorOnOption, redundantWithOption); + } + } + function blockEmittingOfFile(emitFileName, diag2) { + hasEmitBlockingDiagnostics.set(toPath3(emitFileName), true); + programDiagnostics.add(diag2); + } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + const filePath = toPath3(file); + if (getSourceFileByPath(filePath)) { + return false; + } + const out = outFile(options); + if (out) { + return isSameFile(filePath, out) || isSameFile( + filePath, + removeFileExtension(out) + ".d.ts" + /* Dts */ + ); + } + if (options.declarationDir && containsPath(options.declarationDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames())) { + return true; + } + if (options.outDir) { + return containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (fileExtensionIsOneOf(filePath, supportedJSExtensionsFlat) || isDeclarationFileName(filePath)) { + const filePathWithoutExtension = removeFileExtension(filePath); + return !!getSourceFileByPath( + filePathWithoutExtension + ".ts" + /* Ts */ + ) || !!getSourceFileByPath( + filePathWithoutExtension + ".tsx" + /* Tsx */ + ); + } + return false; + } + function isSameFile(file1, file2) { + return comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0; + } + function getSymlinkCache() { + if (host.getSymlinkCache) { + return host.getSymlinkCache(); + } + if (!symlinks) { + symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName); + } + if (files && !symlinks.hasProcessedResolutions()) { + symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions); + } + return symlinks; + } + function getModeForUsageLocation2(file, usage) { + var _a22; + const optionsForFile = ((_a22 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a22.commandLine.options) || options; + return getModeForUsageLocationWorker(file, usage, optionsForFile); + } + function getModeForResolutionAtIndex2(file, index4) { + return getModeForUsageLocation2(file, getModuleNameStringLiteralAt(file, index4)); + } + } + function updateHostForUseSourceOfProjectReferenceRedirect(host) { + let setOfDeclarationDirectories; + const originalFileExists = host.compilerHost.fileExists; + const originalDirectoryExists = host.compilerHost.directoryExists; + const originalGetDirectories = host.compilerHost.getDirectories; + const originalRealpath = host.compilerHost.realpath; + if (!host.useSourceOfProjectReferenceRedirect) + return { onProgramCreateComplete: noop4, fileExists }; + host.compilerHost.fileExists = fileExists; + let directoryExists; + if (originalDirectoryExists) { + directoryExists = host.compilerHost.directoryExists = (path2) => { + if (originalDirectoryExists.call(host.compilerHost, path2)) { + handleDirectoryCouldBeSymlink(path2); + return true; + } + if (!host.getResolvedProjectReferences()) + return false; + if (!setOfDeclarationDirectories) { + setOfDeclarationDirectories = /* @__PURE__ */ new Set(); + host.forEachResolvedProjectReference((ref) => { + const out = outFile(ref.commandLine.options); + if (out) { + setOfDeclarationDirectories.add(getDirectoryPath(host.toPath(out))); + } else { + const declarationDir = ref.commandLine.options.declarationDir || ref.commandLine.options.outDir; + if (declarationDir) { + setOfDeclarationDirectories.add(host.toPath(declarationDir)); + } + } + }); + } + return fileOrDirectoryExistsUsingSource( + path2, + /*isFile*/ + false + ); + }; + } + if (originalGetDirectories) { + host.compilerHost.getDirectories = (path2) => !host.getResolvedProjectReferences() || originalDirectoryExists && originalDirectoryExists.call(host.compilerHost, path2) ? originalGetDirectories.call(host.compilerHost, path2) : []; + } + if (originalRealpath) { + host.compilerHost.realpath = (s7) => { + var _a2; + return ((_a2 = host.getSymlinkCache().getSymlinkedFiles()) == null ? void 0 : _a2.get(host.toPath(s7))) || originalRealpath.call(host.compilerHost, s7); + }; + } + return { onProgramCreateComplete, fileExists, directoryExists }; + function onProgramCreateComplete() { + host.compilerHost.fileExists = originalFileExists; + host.compilerHost.directoryExists = originalDirectoryExists; + host.compilerHost.getDirectories = originalGetDirectories; + } + function fileExists(file) { + if (originalFileExists.call(host.compilerHost, file)) + return true; + if (!host.getResolvedProjectReferences()) + return false; + if (!isDeclarationFileName(file)) + return false; + return fileOrDirectoryExistsUsingSource( + file, + /*isFile*/ + true + ); + } + function fileExistsIfProjectReferenceDts(file) { + const source = host.getSourceOfProjectReferenceRedirect(host.toPath(file)); + return source !== void 0 ? isString4(source) ? originalFileExists.call(host.compilerHost, source) : true : void 0; + } + function directoryExistsIfProjectReferenceDeclDir(dir2) { + const dirPath = host.toPath(dir2); + const dirPathWithTrailingDirectorySeparator = `${dirPath}${directorySeparator}`; + return forEachKey( + setOfDeclarationDirectories, + (declDirPath) => dirPath === declDirPath || // Any parent directory of declaration dir + startsWith2(declDirPath, dirPathWithTrailingDirectorySeparator) || // Any directory inside declaration dir + startsWith2(dirPath, `${declDirPath}/`) + ); + } + function handleDirectoryCouldBeSymlink(directory) { + var _a2; + if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory)) + return; + if (!originalRealpath || !directory.includes(nodeModulesPathPart)) + return; + const symlinkCache = host.getSymlinkCache(); + const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory)); + if ((_a2 = symlinkCache.getSymlinkedDirectories()) == null ? void 0 : _a2.has(directoryPath)) + return; + const real = normalizePath(originalRealpath.call(host.compilerHost, directory)); + let realPath2; + if (real === directory || (realPath2 = ensureTrailingDirectorySeparator(host.toPath(real))) === directoryPath) { + symlinkCache.setSymlinkedDirectory(directoryPath, false); + return; + } + symlinkCache.setSymlinkedDirectory(directory, { + real: ensureTrailingDirectorySeparator(real), + realPath: realPath2 + }); + } + function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { + var _a2; + const fileOrDirectoryExistsUsingSource2 = isFile ? (file) => fileExistsIfProjectReferenceDts(file) : (dir2) => directoryExistsIfProjectReferenceDeclDir(dir2); + const result2 = fileOrDirectoryExistsUsingSource2(fileOrDirectory); + if (result2 !== void 0) + return result2; + const symlinkCache = host.getSymlinkCache(); + const symlinkedDirectories = symlinkCache.getSymlinkedDirectories(); + if (!symlinkedDirectories) + return false; + const fileOrDirectoryPath = host.toPath(fileOrDirectory); + if (!fileOrDirectoryPath.includes(nodeModulesPathPart)) + return false; + if (isFile && ((_a2 = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a2.has(fileOrDirectoryPath))) + return true; + return firstDefinedIterator( + symlinkedDirectories.entries(), + ([directoryPath, symlinkedDirectory]) => { + if (!symlinkedDirectory || !startsWith2(fileOrDirectoryPath, directoryPath)) + return void 0; + const result22 = fileOrDirectoryExistsUsingSource2(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); + if (isFile && result22) { + const absolutePath = getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); + symlinkCache.setSymlinkedFile( + fileOrDirectoryPath, + `${symlinkedDirectory.real}${absolutePath.replace(new RegExp(directoryPath, "i"), "")}` + ); + } + return result22; + } + ) || false; + } + } + function handleNoEmitOptions(program, sourceFile, writeFile22, cancellationToken) { + const options = program.getCompilerOptions(); + if (options.noEmit) { + program.getSemanticDiagnostics(sourceFile, cancellationToken); + return sourceFile || outFile(options) ? emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile22, cancellationToken); + } + if (!options.noEmitOnError) + return void 0; + let diagnostics = [ + ...program.getOptionsDiagnostics(cancellationToken), + ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), + ...program.getGlobalDiagnostics(cancellationToken), + ...program.getSemanticDiagnostics(sourceFile, cancellationToken) + ]; + if (diagnostics.length === 0 && getEmitDeclarations(program.getCompilerOptions())) { + diagnostics = program.getDeclarationDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ); + } + if (!diagnostics.length) + return void 0; + let emittedFiles; + if (!sourceFile && !outFile(options)) { + const emitResult = program.emitBuildInfo(writeFile22, cancellationToken); + if (emitResult.diagnostics) + diagnostics = [...diagnostics, ...emitResult.diagnostics]; + emittedFiles = emitResult.emittedFiles; + } + return { diagnostics, sourceMaps: void 0, emittedFiles, emitSkipped: true }; + } + function filterSemanticDiagnostics(diagnostic, option) { + return filter2(diagnostic, (d7) => !d7.skippedOn || !option[d7.skippedOn]); + } + function parseConfigHostFromCompilerHostLike(host, directoryStructureHost = host) { + return { + fileExists: (f8) => directoryStructureHost.fileExists(f8), + readDirectory(root2, extensions6, excludes, includes2, depth) { + Debug.assertIsDefined(directoryStructureHost.readDirectory, "'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return directoryStructureHost.readDirectory(root2, extensions6, excludes, includes2, depth); + }, + readFile: (f8) => directoryStructureHost.readFile(f8), + directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath), + useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(), + getCurrentDirectory: () => host.getCurrentDirectory(), + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined, + trace: host.trace ? (s7) => host.trace(s7) : void 0 + }; + } + function createPrependNodes(projectReferences, getCommandLine, readFile2, host) { + if (!projectReferences) + return emptyArray; + let nodes; + for (let i7 = 0; i7 < projectReferences.length; i7++) { + const ref = projectReferences[i7]; + const resolvedRefOpts = getCommandLine(ref, i7); + if (ref.prepend && resolvedRefOpts && resolvedRefOpts.options) { + const out = outFile(resolvedRefOpts.options); + if (!out) + continue; + const { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath } = getOutputPathsForBundle( + resolvedRefOpts.options, + /*forceDtsPaths*/ + true + ); + const node = createInputFilesWithFilePaths(readFile2, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath, host, resolvedRefOpts.options); + (nodes || (nodes = [])).push(node); + } + } + return nodes || emptyArray; + } + function resolveProjectReferencePath(ref) { + return resolveConfigFileProjectName(ref.path); + } + function getResolutionDiagnostic(options, { extension }, { isDeclarationFile }) { + switch (extension) { + case ".ts": + case ".d.ts": + case ".mts": + case ".d.mts": + case ".cts": + case ".d.cts": + return void 0; + case ".tsx": + return needJsx(); + case ".jsx": + return needJsx() || needAllowJs(); + case ".js": + case ".mjs": + case ".cjs": + return needAllowJs(); + case ".json": + return needResolveJsonModule(); + default: + return needAllowArbitraryExtensions(); + } + function needJsx() { + return options.jsx ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set; + } + function needAllowJs() { + return getAllowJSCompilerOption(options) || !getStrictOptionValue(options, "noImplicitAny") ? void 0 : Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type; + } + function needResolveJsonModule() { + return getResolveJsonModule(options) ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used; + } + function needAllowArbitraryExtensions() { + return isDeclarationFile || options.allowArbitraryExtensions ? void 0 : Diagnostics.Module_0_was_resolved_to_1_but_allowArbitraryExtensions_is_not_set; + } + } + function getModuleNames({ imports, moduleAugmentations }) { + const res = imports.map((i7) => i7); + for (const aug of moduleAugmentations) { + if (aug.kind === 11) { + res.push(aug); + } + } + return res; + } + function getModuleNameStringLiteralAt({ imports, moduleAugmentations }, index4) { + if (index4 < imports.length) + return imports[index4]; + let augIndex = imports.length; + for (const aug of moduleAugmentations) { + if (aug.kind === 11) { + if (index4 === augIndex) + return aug; + augIndex++; + } + } + Debug.fail("should never ask for module name at index higher than possible module name"); + } + var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent, indent, emptyResolution, moduleResolutionNameAndModeGetter, typeReferenceResolutionNameAndModeGetter, inferredTypesContainingFile, plainJSErrors, emitSkippedWithNoDiagnostics; + var init_program = __esm2({ + "src/compiler/program.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + ForegroundColorEscapeSequences = /* @__PURE__ */ ((ForegroundColorEscapeSequences2) => { + ForegroundColorEscapeSequences2["Grey"] = "\x1B[90m"; + ForegroundColorEscapeSequences2["Red"] = "\x1B[91m"; + ForegroundColorEscapeSequences2["Yellow"] = "\x1B[93m"; + ForegroundColorEscapeSequences2["Blue"] = "\x1B[94m"; + ForegroundColorEscapeSequences2["Cyan"] = "\x1B[96m"; + return ForegroundColorEscapeSequences2; + })(ForegroundColorEscapeSequences || {}); + gutterStyleSequence = "\x1B[7m"; + gutterSeparator = " "; + resetEscapeSequence = "\x1B[0m"; + ellipsis = "..."; + halfIndent = " "; + indent = " "; + emptyResolution = { + resolvedModule: void 0, + resolvedTypeReferenceDirective: void 0 + }; + moduleResolutionNameAndModeGetter = { + getName: getModuleResolutionName, + getMode: (entry, file, compilerOptions) => getModeForUsageLocation(file, entry, compilerOptions) + }; + typeReferenceResolutionNameAndModeGetter = { + getName: getTypeReferenceResolutionName, + getMode: (entry, file) => getModeForFileReference(entry, file == null ? void 0 : file.impliedNodeFormat) + }; + inferredTypesContainingFile = "__inferred type names__.ts"; + plainJSErrors = /* @__PURE__ */ new Set([ + // binder errors + Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, + Diagnostics.A_module_cannot_have_multiple_default_exports.code, + Diagnostics.Another_export_default_is_here.code, + Diagnostics.The_first_export_default_is_here.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, + Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, + Diagnostics.constructor_is_a_reserved_word.code, + Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, + Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, + Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, + Diagnostics.Invalid_use_of_0_in_strict_mode.code, + Diagnostics.A_label_is_not_allowed_here.code, + Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, + // grammar errors + Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, + Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, + Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, + Diagnostics.A_class_member_cannot_have_the_0_keyword.code, + Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, + Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, + Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, + Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, + Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, + Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, + Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, + Diagnostics.A_get_accessor_cannot_have_parameters.code, + Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, + Diagnostics.A_rest_element_cannot_have_a_property_name.code, + Diagnostics.A_rest_element_cannot_have_an_initializer.code, + Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, + Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, + Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, + Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, + Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, + Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, + Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, + Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + Diagnostics.An_export_declaration_cannot_have_modifiers.code, + Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, + Diagnostics.An_import_declaration_cannot_have_modifiers.code, + Diagnostics.An_object_member_cannot_be_declared_optional.code, + Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, + Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, + Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, + Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, + Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, + Diagnostics.Classes_can_only_extend_a_single_class.code, + Diagnostics.Classes_may_not_have_a_field_named_constructor.code, + Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code, + Diagnostics.Duplicate_label_0.code, + Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code, + Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code, + Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, + Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, + Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, + Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, + Diagnostics.Jump_target_cannot_cross_function_boundary.code, + Diagnostics.Line_terminator_not_permitted_before_arrow.code, + Diagnostics.Modifiers_cannot_appear_here.code, + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, + Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, + Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code, + Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, + Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, + Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, + Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, + Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, + Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, + Diagnostics.Trailing_comma_not_allowed.code, + Diagnostics.Variable_declaration_list_cannot_be_empty.code, + Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, + Diagnostics._0_expected.code, + Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, + Diagnostics._0_list_cannot_be_empty.code, + Diagnostics._0_modifier_already_seen.code, + Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, + Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, + Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, + Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, + Diagnostics._0_modifier_cannot_be_used_here.code, + Diagnostics._0_modifier_must_precede_1_modifier.code, + Diagnostics._0_declarations_can_only_be_declared_inside_a_block.code, + Diagnostics._0_declarations_must_be_initialized.code, + Diagnostics.extends_clause_already_seen.code, + Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, + Diagnostics.Class_constructor_may_not_be_a_generator.code, + Diagnostics.Class_constructor_may_not_be_an_accessor.code, + Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + Diagnostics.Private_field_0_must_be_declared_in_an_enclosing_class.code, + // Type errors + Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value.code + ]); + emitSkippedWithNoDiagnostics = { diagnostics: emptyArray, sourceMaps: void 0, emittedFiles: void 0, emitSkipped: true }; + } + }); + var init_builderStatePublic = __esm2({ + "src/compiler/builderStatePublic.ts"() { + "use strict"; + } + }); + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) { + const outputFiles = []; + const { emitSkipped, diagnostics } = program.emit(sourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit); + return { outputFiles, emitSkipped, diagnostics }; + function writeFile22(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark, text }); + } + } + var BuilderState; + var init_builderState = __esm2({ + "src/compiler/builderState.ts"() { + "use strict"; + init_ts2(); + ((BuilderState2) => { + function createManyToManyPathMap() { + function create22(forward, reverse2, deleted) { + const map22 = { + getKeys: (v8) => reverse2.get(v8), + getValues: (k6) => forward.get(k6), + keys: () => forward.keys(), + deleteKey: (k6) => { + (deleted || (deleted = /* @__PURE__ */ new Set())).add(k6); + const set4 = forward.get(k6); + if (!set4) { + return false; + } + set4.forEach((v8) => deleteFromMultimap(reverse2, v8, k6)); + forward.delete(k6); + return true; + }, + set: (k6, vSet) => { + deleted == null ? void 0 : deleted.delete(k6); + const existingVSet = forward.get(k6); + forward.set(k6, vSet); + existingVSet == null ? void 0 : existingVSet.forEach((v8) => { + if (!vSet.has(v8)) { + deleteFromMultimap(reverse2, v8, k6); + } + }); + vSet.forEach((v8) => { + if (!(existingVSet == null ? void 0 : existingVSet.has(v8))) { + addToMultimap(reverse2, v8, k6); + } + }); + return map22; + } + }; + return map22; + } + return create22( + /* @__PURE__ */ new Map(), + /* @__PURE__ */ new Map(), + /*deleted*/ + void 0 + ); + } + BuilderState2.createManyToManyPathMap = createManyToManyPathMap; + function addToMultimap(map22, k6, v8) { + let set4 = map22.get(k6); + if (!set4) { + set4 = /* @__PURE__ */ new Set(); + map22.set(k6, set4); + } + set4.add(v8); + } + function deleteFromMultimap(map22, k6, v8) { + const set4 = map22.get(k6); + if (set4 == null ? void 0 : set4.delete(v8)) { + if (!set4.size) { + map22.delete(k6); + } + return true; + } + return false; + } + function getReferencedFilesFromImportedModuleSymbol(symbol) { + return mapDefined(symbol.declarations, (declaration) => { + var _a2; + return (_a2 = getSourceFileOfNode(declaration)) == null ? void 0 : _a2.resolvedPath; + }); + } + function getReferencedFilesFromImportLiteral(checker, importName) { + const symbol = checker.getSymbolAtLocation(importName); + return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); + } + function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { + return toPath2(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); + } + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + let referencedFiles; + if (sourceFile.imports && sourceFile.imports.length > 0) { + const checker = program.getTypeChecker(); + for (const importName of sourceFile.imports) { + const declarationSourceFilePaths = getReferencedFilesFromImportLiteral(checker, importName); + declarationSourceFilePaths == null ? void 0 : declarationSourceFilePaths.forEach(addReferencedFile); + } + } + const sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (const referencedFile of sourceFile.referencedFiles) { + const referencedPath = getReferencedFileFromFileName(program, referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => { + if (!resolvedTypeReferenceDirective) { + return; + } + const fileName = resolvedTypeReferenceDirective.resolvedFileName; + const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }, sourceFile); + if (sourceFile.moduleAugmentations.length) { + const checker = program.getTypeChecker(); + for (const moduleName3 of sourceFile.moduleAugmentations) { + if (!isStringLiteral(moduleName3)) + continue; + const symbol = checker.getSymbolAtLocation(moduleName3); + if (!symbol) + continue; + addReferenceFromAmbientModule(symbol); + } + } + for (const ambientModule of program.getTypeChecker().getAmbientModules()) { + if (ambientModule.declarations && ambientModule.declarations.length > 1) { + addReferenceFromAmbientModule(ambientModule); + } + } + return referencedFiles; + function addReferenceFromAmbientModule(symbol) { + if (!symbol.declarations) { + return; + } + for (const declaration of symbol.declarations) { + const declarationSourceFile = getSourceFileOfNode(declaration); + if (declarationSourceFile && declarationSourceFile !== sourceFile) { + addReferencedFile(declarationSourceFile.resolvedPath); + } + } + } + function addReferencedFile(referencedPath) { + (referencedFiles || (referencedFiles = /* @__PURE__ */ new Set())).add(referencedPath); + } + } + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState2.canReuseOldState = canReuseOldState; + function create2(newProgram, oldState, disableUseFileVersionAsSignature) { + var _a2, _b, _c; + const fileInfos = /* @__PURE__ */ new Map(); + const options = newProgram.getCompilerOptions(); + const isOutFile = outFile(options); + const referencedMap = options.module !== 0 && !isOutFile ? createManyToManyPathMap() : void 0; + const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0; + const useOldState = canReuseOldState(referencedMap, oldState); + newProgram.getTypeChecker(); + for (const sourceFile of newProgram.getSourceFiles()) { + const version22 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); + const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0; + const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0; + if (referencedMap) { + const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.resolvedPath, newReferences); + } + if (useOldState) { + const oldUncommittedExportedModules = (_c = oldState.oldExportedModulesMap) == null ? void 0 : _c.get(sourceFile.resolvedPath); + const exportedModules = oldUncommittedExportedModules === void 0 ? oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) : oldUncommittedExportedModules || void 0; + if (exportedModules) { + exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); + } + } + } + fileInfos.set(sourceFile.resolvedPath, { + version: version22, + signature, + // No need to calculate affectsGlobalScope with --out since its not used at all + affectsGlobalScope: !isOutFile ? isFileAffectingGlobalScope(sourceFile) || void 0 : void 0, + impliedFormat: sourceFile.impliedNodeFormat + }); + } + return { + fileInfos, + referencedMap, + exportedModulesMap, + useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState + }; + } + BuilderState2.create = create2; + function releaseCache2(state) { + state.allFilesExcludingDefaultLibraryFile = void 0; + state.allFileNames = void 0; + } + BuilderState2.releaseCache = releaseCache2; + function getFilesAffectedBy(state, programOfThisState, path2, cancellationToken, host) { + var _a2, _b; + const result2 = getFilesAffectedByWithOldState( + state, + programOfThisState, + path2, + cancellationToken, + host + ); + (_a2 = state.oldSignatures) == null ? void 0 : _a2.clear(); + (_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear(); + return result2; + } + BuilderState2.getFilesAffectedBy = getFilesAffectedBy; + function getFilesAffectedByWithOldState(state, programOfThisState, path2, cancellationToken, host) { + const sourceFile = programOfThisState.getSourceFileByPath(path2); + if (!sourceFile) { + return emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host)) { + return [sourceFile]; + } + return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, host); + } + BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState; + function updateSignatureOfFile(state, signature, path2) { + state.fileInfos.get(path2).signature = signature; + (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path2); + } + BuilderState2.updateSignatureOfFile = updateSignatureOfFile; + function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) { + programOfThisState.emit( + sourceFile, + (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => { + Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`); + onNewSignature( + computeSignatureWithDiagnostics( + programOfThisState, + sourceFile, + text, + host, + data + ), + sourceFiles + ); + }, + cancellationToken, + /*emitOnly*/ + true, + /*customTransformers*/ + void 0, + /*forceDtsEmit*/ + true + ); + } + BuilderState2.computeDtsSignature = computeDtsSignature; + function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) { + var _a2; + if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath)) + return false; + const info2 = state.fileInfos.get(sourceFile.resolvedPath); + const prevSignature = info2.signature; + let latestSignature; + if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) { + computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => { + latestSignature = signature; + if (latestSignature !== prevSignature) { + updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit); + } + }); + } + if (latestSignature === void 0) { + latestSignature = sourceFile.version; + if (state.exportedModulesMap && latestSignature !== prevSignature) { + (state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); + const references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : void 0; + if (references) { + state.exportedModulesMap.set(sourceFile.resolvedPath, references); + } else { + state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); + } + } + } + (state.oldSignatures || (state.oldSignatures = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, prevSignature || false); + (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(sourceFile.resolvedPath); + info2.signature = latestSignature; + return latestSignature !== prevSignature; + } + BuilderState2.updateShapeSignature = updateShapeSignature; + function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) { + if (!state.exportedModulesMap) + return; + (state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); + const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit); + if (exportedModules) { + state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); + } else { + state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); + } + } + BuilderState2.updateExportedModules = updateExportedModules; + function getExportedModules(exportedModulesFromDeclarationEmit) { + let exportedModules; + exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach( + (symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach( + (path2) => (exportedModules ?? (exportedModules = /* @__PURE__ */ new Set())).add(path2) + ) + ); + return exportedModules; + } + BuilderState2.getExportedModules = getExportedModules; + function getAllDependencies(state, programOfThisState, sourceFile) { + const compilerOptions = programOfThisState.getCompilerOptions(); + if (outFile(compilerOptions)) { + return getAllFileNames(state, programOfThisState); + } + if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) { + return getAllFileNames(state, programOfThisState); + } + const seenMap = /* @__PURE__ */ new Set(); + const queue3 = [sourceFile.resolvedPath]; + while (queue3.length) { + const path2 = queue3.pop(); + if (!seenMap.has(path2)) { + seenMap.add(path2); + const references = state.referencedMap.getValues(path2); + if (references) { + for (const key of references.keys()) { + queue3.push(key); + } + } + } + } + return arrayFrom(mapDefinedIterator(seenMap.keys(), (path2) => { + var _a2; + return ((_a2 = programOfThisState.getSourceFileByPath(path2)) == null ? void 0 : _a2.fileName) ?? path2; + })); + } + BuilderState2.getAllDependencies = getAllDependencies; + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + const sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === emptyArray ? emptyArray : sourceFiles.map((file) => file.fileName); + } + return state.allFileNames; + } + function getReferencedByPaths(state, referencedFilePath) { + const keys2 = state.referencedMap.getKeys(referencedFilePath); + return keys2 ? arrayFrom(keys2.keys()) : []; + } + BuilderState2.getReferencedByPaths = getReferencedByPaths; + function containsOnlyAmbientModules(sourceFile) { + for (const statement of sourceFile.statements) { + if (!isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + function containsGlobalScopeAugmentation(sourceFile) { + return some2(sourceFile.moduleAugmentations, (augmentation) => isGlobalScopeAugmentation(augmentation.parent)); + } + function isFileAffectingGlobalScope(sourceFile) { + return containsGlobalScopeAugmentation(sourceFile) || !isExternalOrCommonJsModule(sourceFile) && !isJsonSourceFile(sourceFile) && !containsOnlyAmbientModules(sourceFile); + } + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + let result2; + if (firstSourceFile) + addSourceFile(firstSourceFile); + for (const sourceFile of programOfThisState.getSourceFiles()) { + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result2 || emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result2 || (result2 = [])).push(sourceFile); + } + } + } + BuilderState2.getAllFilesExcludingDefaultLibraryFile = getAllFilesExcludingDefaultLibraryFile; + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + const compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && outFile(compilerOptions)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, host) { + if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + const compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) { + return [sourceFileWithUpdatedShape]; + } + const seenFileNamesMap = /* @__PURE__ */ new Map(); + seenFileNamesMap.set(sourceFileWithUpdatedShape.resolvedPath, sourceFileWithUpdatedShape); + const queue3 = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); + while (queue3.length > 0) { + const currentPath = queue3.pop(); + if (!seenFileNamesMap.has(currentPath)) { + const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, host)) { + queue3.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath)); + } + } + } + return arrayFrom(mapDefinedIterator(seenFileNamesMap.values(), (value2) => value2)); + } + })(BuilderState || (BuilderState = {})); + } + }); + function getBuilderFileEmit(options) { + let result2 = 1; + if (options.sourceMap) + result2 = result2 | 2; + if (options.inlineSourceMap) + result2 = result2 | 4; + if (getEmitDeclarations(options)) + result2 = result2 | 8; + if (options.declarationMap) + result2 = result2 | 16; + if (options.emitDeclarationOnly) + result2 = result2 & 24; + return result2; + } + function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) { + const oldEmitKind = oldOptionsOrEmitKind && (isNumber3(oldOptionsOrEmitKind) ? oldOptionsOrEmitKind : getBuilderFileEmit(oldOptionsOrEmitKind)); + const emitKind = isNumber3(optionsOrEmitKind) ? optionsOrEmitKind : getBuilderFileEmit(optionsOrEmitKind); + if (oldEmitKind === emitKind) + return 0; + if (!oldEmitKind || !emitKind) + return emitKind; + const diff = oldEmitKind ^ emitKind; + let result2 = 0; + if (diff & 7) + result2 = emitKind & 7; + if (diff & 24) + result2 = result2 | emitKind & 24; + return result2; + } + function hasSameKeys(map1, map22) { + return map1 === map22 || map1 !== void 0 && map22 !== void 0 && map1.size === map22.size && !forEachKey(map1, (key) => !map22.has(key)); + } + function createBuilderProgramState(newProgram, oldState) { + var _a2, _b; + const state = BuilderState.create( + newProgram, + oldState, + /*disableUseFileVersionAsSignature*/ + false + ); + state.program = newProgram; + const compilerOptions = newProgram.getCompilerOptions(); + state.compilerOptions = compilerOptions; + const outFilePath = outFile(compilerOptions); + if (!outFilePath) { + state.semanticDiagnosticsPerFile = /* @__PURE__ */ new Map(); + } else if (compilerOptions.composite && (oldState == null ? void 0 : oldState.outSignature) && outFilePath === outFile(oldState == null ? void 0 : oldState.compilerOptions)) { + state.outSignature = oldState.outSignature && getEmitSignatureFromOldSignature(compilerOptions, oldState.compilerOptions, oldState.outSignature); + } + state.changedFilesSet = /* @__PURE__ */ new Set(); + state.latestChangedDtsFile = compilerOptions.composite ? oldState == null ? void 0 : oldState.latestChangedDtsFile : void 0; + const useOldState = BuilderState.canReuseOldState(state.referencedMap, oldState); + const oldCompilerOptions = useOldState ? oldState.compilerOptions : void 0; + const canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile && !compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions); + const canCopyEmitSignatures = compilerOptions.composite && (oldState == null ? void 0 : oldState.emitSignatures) && !outFilePath && !compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions); + if (useOldState) { + (_a2 = oldState.changedFilesSet) == null ? void 0 : _a2.forEach((value2) => state.changedFilesSet.add(value2)); + if (!outFilePath && ((_b = oldState.affectedFilesPendingEmit) == null ? void 0 : _b.size)) { + state.affectedFilesPendingEmit = new Map(oldState.affectedFilesPendingEmit); + state.seenAffectedFiles = /* @__PURE__ */ new Set(); + } + state.programEmitPending = oldState.programEmitPending; + } else { + state.buildInfoEmitPending = true; + } + const referencedMap = state.referencedMap; + const oldReferencedMap = useOldState ? oldState.referencedMap : void 0; + const copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck; + const copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck; + state.fileInfos.forEach((info2, sourceFilePath) => { + var _a22; + let oldInfo; + let newReferences; + if (!useOldState || // File wasn't present in old state + !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || // versions dont match + oldInfo.version !== info2.version || // Implied formats dont match + oldInfo.impliedFormat !== info2.impliedFormat || // Referenced files changed + !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program + newReferences && forEachKey(newReferences, (path2) => !state.fileInfos.has(path2) && oldState.fileInfos.has(path2))) { + addFileToChangeSet(state, sourceFilePath); + } else { + const sourceFile = newProgram.getSourceFileByPath(sourceFilePath); + const emitDiagnostics = (_a22 = oldState.emitDiagnosticsPerFile) == null ? void 0 : _a22.get(sourceFilePath); + if (emitDiagnostics) { + (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set( + sourceFilePath, + oldState.hasReusableDiagnostic ? convertToDiagnostics(emitDiagnostics, newProgram) : repopulateDiagnostics(emitDiagnostics, newProgram) + ); + } + if (canCopySemanticDiagnostics) { + if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics) + return; + if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics) + return; + const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath); + if (diagnostics) { + state.semanticDiagnosticsPerFile.set( + sourceFilePath, + oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram) + ); + (state.semanticDiagnosticsFromOldState ?? (state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(sourceFilePath); + } + } + } + if (canCopyEmitSignatures) { + const oldEmitSignature = oldState.emitSignatures.get(sourceFilePath); + if (oldEmitSignature) { + (state.emitSignatures ?? (state.emitSignatures = /* @__PURE__ */ new Map())).set(sourceFilePath, getEmitSignatureFromOldSignature(compilerOptions, oldState.compilerOptions, oldEmitSignature)); + } + } + }); + if (useOldState && forEachEntry(oldState.fileInfos, (info2, sourceFilePath) => { + if (state.fileInfos.has(sourceFilePath)) + return false; + if (outFilePath || info2.affectsGlobalScope) + return true; + state.buildInfoEmitPending = true; + return false; + })) { + BuilderState.getAllFilesExcludingDefaultLibraryFile( + state, + newProgram, + /*firstSourceFile*/ + void 0 + ).forEach((file) => addFileToChangeSet(state, file.resolvedPath)); + } else if (oldCompilerOptions) { + const pendingEmitKind = compilerOptionsAffectEmit(compilerOptions, oldCompilerOptions) ? getBuilderFileEmit(compilerOptions) : getPendingEmitKind(compilerOptions, oldCompilerOptions); + if (pendingEmitKind !== 0) { + if (!outFilePath) { + newProgram.getSourceFiles().forEach((f8) => { + if (!state.changedFilesSet.has(f8.resolvedPath)) { + addToAffectedFilesPendingEmit( + state, + f8.resolvedPath, + pendingEmitKind + ); + } + }); + Debug.assert(!state.seenAffectedFiles || !state.seenAffectedFiles.size); + state.seenAffectedFiles = state.seenAffectedFiles || /* @__PURE__ */ new Set(); + state.buildInfoEmitPending = true; + } else { + state.programEmitPending = state.programEmitPending ? state.programEmitPending | pendingEmitKind : pendingEmitKind; + } + } + } + if (outFilePath && !state.changedFilesSet.size) { + if (useOldState) + state.bundle = oldState.bundle; + if (some2(newProgram.getProjectReferences(), (ref) => !!ref.prepend)) + state.programEmitPending = getBuilderFileEmit(compilerOptions); + } + return state; + } + function addFileToChangeSet(state, path2) { + state.changedFilesSet.add(path2); + state.buildInfoEmitPending = true; + state.programEmitPending = void 0; + } + function getEmitSignatureFromOldSignature(options, oldOptions, oldEmitSignature) { + return !!options.declarationMap === !!oldOptions.declarationMap ? ( + // Use same format of signature + oldEmitSignature + ) : ( + // Convert to different format + isString4(oldEmitSignature) ? [oldEmitSignature] : oldEmitSignature[0] + ); + } + function repopulateDiagnostics(diagnostics, newProgram) { + if (!diagnostics.length) + return diagnostics; + return sameMap(diagnostics, (diag2) => { + if (isString4(diag2.messageText)) + return diag2; + const repopulatedChain = convertOrRepopulateDiagnosticMessageChain(diag2.messageText, diag2.file, newProgram, (chain3) => { + var _a2; + return (_a2 = chain3.repopulateInfo) == null ? void 0 : _a2.call(chain3); + }); + return repopulatedChain === diag2.messageText ? diag2 : { ...diag2, messageText: repopulatedChain }; + }); + } + function convertOrRepopulateDiagnosticMessageChain(chain3, sourceFile, newProgram, repopulateInfo) { + const info2 = repopulateInfo(chain3); + if (info2) { + return { + ...createModuleNotFoundChain(sourceFile, newProgram, info2.moduleReference, info2.mode, info2.packageName || info2.moduleReference), + next: convertOrRepopulateDiagnosticMessageChainArray(chain3.next, sourceFile, newProgram, repopulateInfo) + }; + } + const next = convertOrRepopulateDiagnosticMessageChainArray(chain3.next, sourceFile, newProgram, repopulateInfo); + return next === chain3.next ? chain3 : { ...chain3, next }; + } + function convertOrRepopulateDiagnosticMessageChainArray(array, sourceFile, newProgram, repopulateInfo) { + return sameMap(array, (chain3) => convertOrRepopulateDiagnosticMessageChain(chain3, sourceFile, newProgram, repopulateInfo)); + } + function convertToDiagnostics(diagnostics, newProgram) { + if (!diagnostics.length) + return emptyArray; + let buildInfoDirectory; + return diagnostics.map((diagnostic) => { + const result2 = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPathInBuildInfoDirectory); + result2.reportsUnnecessary = diagnostic.reportsUnnecessary; + result2.reportsDeprecated = diagnostic.reportDeprecated; + result2.source = diagnostic.source; + result2.skippedOn = diagnostic.skippedOn; + const { relatedInformation } = diagnostic; + result2.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r8) => convertToDiagnosticRelatedInformation(r8, newProgram, toPathInBuildInfoDirectory)) : [] : void 0; + return result2; + }); + function toPathInBuildInfoDirectory(path2) { + buildInfoDirectory ?? (buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()))); + return toPath2(path2, buildInfoDirectory, newProgram.getCanonicalFileName); + } + } + function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) { + const { file } = diagnostic; + const sourceFile = file ? newProgram.getSourceFileByPath(toPath3(file)) : void 0; + return { + ...diagnostic, + file: sourceFile, + messageText: isString4(diagnostic.messageText) ? diagnostic.messageText : convertOrRepopulateDiagnosticMessageChain(diagnostic.messageText, sourceFile, newProgram, (chain3) => chain3.info) + }; + } + function releaseCache(state) { + BuilderState.releaseCache(state); + state.program = void 0; + } + function backupBuilderProgramEmitState(state) { + const outFilePath = outFile(state.compilerOptions); + Debug.assert(!state.changedFilesSet.size || outFilePath); + return { + affectedFilesPendingEmit: state.affectedFilesPendingEmit && new Map(state.affectedFilesPendingEmit), + seenEmittedFiles: state.seenEmittedFiles && new Map(state.seenEmittedFiles), + programEmitPending: state.programEmitPending, + emitSignatures: state.emitSignatures && new Map(state.emitSignatures), + outSignature: state.outSignature, + latestChangedDtsFile: state.latestChangedDtsFile, + hasChangedEmitSignature: state.hasChangedEmitSignature, + changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0, + buildInfoEmitPending: state.buildInfoEmitPending, + emitDiagnosticsPerFile: state.emitDiagnosticsPerFile && new Map(state.emitDiagnosticsPerFile) + }; + } + function restoreBuilderProgramEmitState(state, savedEmitState) { + state.affectedFilesPendingEmit = savedEmitState.affectedFilesPendingEmit; + state.seenEmittedFiles = savedEmitState.seenEmittedFiles; + state.programEmitPending = savedEmitState.programEmitPending; + state.emitSignatures = savedEmitState.emitSignatures; + state.outSignature = savedEmitState.outSignature; + state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile; + state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature; + state.buildInfoEmitPending = savedEmitState.buildInfoEmitPending; + state.emitDiagnosticsPerFile = savedEmitState.emitDiagnosticsPerFile; + if (savedEmitState.changedFilesSet) + state.changedFilesSet = savedEmitState.changedFilesSet; + } + function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { + Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath)); + } + function getNextAffectedFile(state, cancellationToken, host) { + var _a2, _b; + while (true) { + const { affectedFiles } = state; + if (affectedFiles) { + const seenAffectedFiles = state.seenAffectedFiles; + let affectedFilesIndex = state.affectedFilesIndex; + while (affectedFilesIndex < affectedFiles.length) { + const affectedFile = affectedFiles[affectedFilesIndex]; + if (!seenAffectedFiles.has(affectedFile.resolvedPath)) { + state.affectedFilesIndex = affectedFilesIndex; + addToAffectedFilesPendingEmit(state, affectedFile.resolvedPath, getBuilderFileEmit(state.compilerOptions)); + handleDtsMayChangeOfAffectedFile( + state, + affectedFile, + cancellationToken, + host + ); + return affectedFile; + } + affectedFilesIndex++; + } + state.changedFilesSet.delete(state.currentChangedFilePath); + state.currentChangedFilePath = void 0; + (_a2 = state.oldSignatures) == null ? void 0 : _a2.clear(); + (_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear(); + state.affectedFiles = void 0; + } + const nextKey = state.changedFilesSet.keys().next(); + if (nextKey.done) { + return void 0; + } + const program = Debug.checkDefined(state.program); + const compilerOptions = program.getCompilerOptions(); + if (outFile(compilerOptions)) { + Debug.assert(!state.semanticDiagnosticsPerFile); + return program; + } + state.affectedFiles = BuilderState.getFilesAffectedByWithOldState( + state, + program, + nextKey.value, + cancellationToken, + host + ); + state.currentChangedFilePath = nextKey.value; + state.affectedFilesIndex = 0; + if (!state.seenAffectedFiles) + state.seenAffectedFiles = /* @__PURE__ */ new Set(); + } + } + function clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles) { + var _a2; + if (!((_a2 = state.affectedFilesPendingEmit) == null ? void 0 : _a2.size)) + return; + if (!emitOnlyDtsFiles) + return state.affectedFilesPendingEmit = void 0; + state.affectedFilesPendingEmit.forEach((emitKind, path2) => { + const pending = emitKind & 7; + if (!pending) + state.affectedFilesPendingEmit.delete(path2); + else + state.affectedFilesPendingEmit.set(path2, pending); + }); + } + function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles) { + var _a2; + if (!((_a2 = state.affectedFilesPendingEmit) == null ? void 0 : _a2.size)) + return void 0; + return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path2) => { + var _a22; + const affectedFile = state.program.getSourceFileByPath(path2); + if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) { + state.affectedFilesPendingEmit.delete(path2); + return void 0; + } + const seenKind = (_a22 = state.seenEmittedFiles) == null ? void 0 : _a22.get(affectedFile.resolvedPath); + let pendingKind = getPendingEmitKind(emitKind, seenKind); + if (emitOnlyDtsFiles) + pendingKind = pendingKind & 24; + if (pendingKind) + return { affectedFile, emitKind: pendingKind }; + }); + } + function getNextPendingEmitDiagnosticsFile(state) { + var _a2; + if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) + return void 0; + return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path2) => { + var _a22; + const affectedFile = state.program.getSourceFileByPath(path2); + if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) { + state.emitDiagnosticsPerFile.delete(path2); + return void 0; + } + const seenKind = ((_a22 = state.seenEmittedFiles) == null ? void 0 : _a22.get(affectedFile.resolvedPath)) || 0; + if (!(seenKind & 24)) + return { affectedFile, diagnostics, seenKind }; + }); + } + function removeDiagnosticsOfLibraryFiles(state) { + if (!state.cleanedDiagnosticsOfLibFiles) { + state.cleanedDiagnosticsOfLibFiles = true; + const program = Debug.checkDefined(state.program); + const options = program.getCompilerOptions(); + forEach4(program.getSourceFiles(), (f8) => program.isSourceFileDefaultLibrary(f8) && !skipTypeChecking(f8, options, program) && removeSemanticDiagnosticsOf(state, f8.resolvedPath)); + } + } + function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) { + removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath); + if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { + removeDiagnosticsOfLibraryFiles(state); + BuilderState.updateShapeSignature( + state, + Debug.checkDefined(state.program), + affectedFile, + cancellationToken, + host + ); + return; + } + if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) + return; + handleDtsMayChangeOfReferencingExportOfAffectedFile( + state, + affectedFile, + cancellationToken, + host + ); + } + function handleDtsMayChangeOf(state, path2, cancellationToken, host) { + removeSemanticDiagnosticsOf(state, path2); + if (!state.changedFilesSet.has(path2)) { + const program = Debug.checkDefined(state.program); + const sourceFile = program.getSourceFileByPath(path2); + if (sourceFile) { + BuilderState.updateShapeSignature( + state, + program, + sourceFile, + cancellationToken, + host, + /*useFileVersionAsSignature*/ + true + ); + if (getEmitDeclarations(state.compilerOptions)) { + addToAffectedFilesPendingEmit( + state, + path2, + state.compilerOptions.declarationMap ? 24 : 8 + /* Dts */ + ); + } + } + } + } + function removeSemanticDiagnosticsOf(state, path2) { + if (!state.semanticDiagnosticsFromOldState) { + return true; + } + state.semanticDiagnosticsFromOldState.delete(path2); + state.semanticDiagnosticsPerFile.delete(path2); + return !state.semanticDiagnosticsFromOldState.size; + } + function isChangedSignature(state, path2) { + const oldSignature = Debug.checkDefined(state.oldSignatures).get(path2) || void 0; + const newSignature = Debug.checkDefined(state.fileInfos.get(path2)).signature; + return newSignature !== oldSignature; + } + function handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host) { + var _a2; + if (!((_a2 = state.fileInfos.get(filePath)) == null ? void 0 : _a2.affectsGlobalScope)) + return false; + BuilderState.getAllFilesExcludingDefaultLibraryFile( + state, + state.program, + /*firstSourceFile*/ + void 0 + ).forEach( + (file) => handleDtsMayChangeOf( + state, + file.resolvedPath, + cancellationToken, + host + ) + ); + removeDiagnosticsOfLibraryFiles(state); + return true; + } + function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, host) { + var _a2; + if (!state.exportedModulesMap || !state.changedFilesSet.has(affectedFile.resolvedPath)) + return; + if (!isChangedSignature(state, affectedFile.resolvedPath)) + return; + if (getIsolatedModules(state.compilerOptions)) { + const seenFileNamesMap = /* @__PURE__ */ new Map(); + seenFileNamesMap.set(affectedFile.resolvedPath, true); + const queue3 = BuilderState.getReferencedByPaths(state, affectedFile.resolvedPath); + while (queue3.length > 0) { + const currentPath = queue3.pop(); + if (!seenFileNamesMap.has(currentPath)) { + seenFileNamesMap.set(currentPath, true); + if (handleDtsMayChangeOfGlobalScope(state, currentPath, cancellationToken, host)) + return; + handleDtsMayChangeOf(state, currentPath, cancellationToken, host); + if (isChangedSignature(state, currentPath)) { + const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath); + queue3.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath)); + } + } + } + } + const seenFileAndExportsOfFile = /* @__PURE__ */ new Set(); + (_a2 = state.exportedModulesMap.getKeys(affectedFile.resolvedPath)) == null ? void 0 : _a2.forEach((exportedFromPath) => { + if (handleDtsMayChangeOfGlobalScope(state, exportedFromPath, cancellationToken, host)) + return true; + const references = state.referencedMap.getKeys(exportedFromPath); + return references && forEachKey(references, (filePath) => handleDtsMayChangeOfFileAndExportsOfFile( + state, + filePath, + seenFileAndExportsOfFile, + cancellationToken, + host + )); + }); + } + function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, seenFileAndExportsOfFile, cancellationToken, host) { + var _a2, _b; + if (!tryAddToSet(seenFileAndExportsOfFile, filePath)) + return void 0; + if (handleDtsMayChangeOfGlobalScope(state, filePath, cancellationToken, host)) + return true; + handleDtsMayChangeOf(state, filePath, cancellationToken, host); + (_a2 = state.exportedModulesMap.getKeys(filePath)) == null ? void 0 : _a2.forEach( + (exportedFromPath) => handleDtsMayChangeOfFileAndExportsOfFile( + state, + exportedFromPath, + seenFileAndExportsOfFile, + cancellationToken, + host + ) + ); + (_b = state.referencedMap.getKeys(filePath)) == null ? void 0 : _b.forEach( + (referencingFilePath) => !seenFileAndExportsOfFile.has(referencingFilePath) && // Not already removed diagnostic file + handleDtsMayChangeOf( + // Dont add to seen since this is not yet done with the export removal + state, + referencingFilePath, + cancellationToken, + host + ) + ); + return void 0; + } + function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { + return concatenate( + getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken), + Debug.checkDefined(state.program).getProgramDiagnostics(sourceFile) + ); + } + function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken) { + const path2 = sourceFile.resolvedPath; + if (state.semanticDiagnosticsPerFile) { + const cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path2); + if (cachedDiagnostics) { + return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions); + } + } + const diagnostics = Debug.checkDefined(state.program).getBindAndCheckDiagnostics(sourceFile, cancellationToken); + if (state.semanticDiagnosticsPerFile) { + state.semanticDiagnosticsPerFile.set(path2, diagnostics); + } + return filterSemanticDiagnostics(diagnostics, state.compilerOptions); + } + function isProgramBundleEmitBuildInfo(info2) { + return !!outFile(info2.options || {}); + } + function getBuildInfo2(state, bundle) { + var _a2, _b, _c; + const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory(); + const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory)); + const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0; + const fileNames = []; + const fileNameToFileId = /* @__PURE__ */ new Map(); + const root2 = []; + if (outFile(state.compilerOptions)) { + const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value2]) => { + const fileId = toFileId(key); + tryAddRoot(key, fileId); + return value2.impliedFormat ? { version: value2.version, impliedFormat: value2.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value2.version; + }); + const program2 = { + fileNames, + fileInfos: fileInfos2, + root: root2, + options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), + outSignature: state.outSignature, + latestChangedDtsFile, + pendingEmit: !state.programEmitPending ? void 0 : ( + // Pending is undefined or None is encoded as undefined + state.programEmitPending === getBuilderFileEmit(state.compilerOptions) ? false : ( + // Pending emit is same as deteremined by compilerOptions + state.programEmitPending + ) + ) + // Actual value + }; + const { js, dts, commonSourceDirectory, sourceFiles } = bundle; + state.bundle = bundle = { + commonSourceDirectory, + sourceFiles, + js: js || (!state.compilerOptions.emitDeclarationOnly ? (_a2 = state.bundle) == null ? void 0 : _a2.js : void 0), + dts: dts || (getEmitDeclarations(state.compilerOptions) ? (_b = state.bundle) == null ? void 0 : _b.dts : void 0) + }; + return createBuildInfo(program2, bundle); + } + let fileIdsList; + let fileNamesToFileIdListId; + let emitSignatures; + const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value2]) => { + var _a22, _b2; + const fileId = toFileId(key); + tryAddRoot(key, fileId); + Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key)); + const oldSignature = (_a22 = state.oldSignatures) == null ? void 0 : _a22.get(key); + const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value2.signature; + if (state.compilerOptions.composite) { + const file = state.program.getSourceFileByPath(key); + if (!isJsonSourceFile(file) && sourceFileMayBeEmitted(file, state.program)) { + const emitSignature = (_b2 = state.emitSignatures) == null ? void 0 : _b2.get(key); + if (emitSignature !== actualSignature) { + (emitSignatures || (emitSignatures = [])).push( + emitSignature === void 0 ? fileId : ( + // There is no emit, encode as false + // fileId, signature: emptyArray if signature only differs in dtsMap option than our own compilerOptions otherwise EmitSignature + [fileId, !isString4(emitSignature) && emitSignature[0] === actualSignature ? emptyArray : emitSignature] + ) + ); + } + } + } + return value2.version === actualSignature ? value2.affectsGlobalScope || value2.impliedFormat ? ( + // If file version is same as signature, dont serialize signature + { version: value2.version, signature: void 0, affectsGlobalScope: value2.affectsGlobalScope, impliedFormat: value2.impliedFormat } + ) : ( + // If file info only contains version and signature and both are same we can just write string + value2.version + ) : actualSignature !== void 0 ? ( + // If signature is not same as version, encode signature in the fileInfo + oldSignature === void 0 ? ( + // If we havent computed signature, use fileInfo as is + value2 + ) : ( + // Serialize fileInfo with new updated signature + { version: value2.version, signature: actualSignature, affectsGlobalScope: value2.affectsGlobalScope, impliedFormat: value2.impliedFormat } + ) + ) : ( + // Signature of the FileInfo is undefined, serialize it as false + { version: value2.version, signature: false, affectsGlobalScope: value2.affectsGlobalScope, impliedFormat: value2.impliedFormat } + ); + }); + let referencedMap; + if (state.referencedMap) { + referencedMap = arrayFrom(state.referencedMap.keys()).sort(compareStringsCaseSensitive).map((key) => [ + toFileId(key), + toFileIdListId(state.referencedMap.getValues(key)) + ]); + } + let exportedModulesMap; + if (state.exportedModulesMap) { + exportedModulesMap = mapDefined(arrayFrom(state.exportedModulesMap.keys()).sort(compareStringsCaseSensitive), (key) => { + var _a22; + const oldValue = (_a22 = state.oldExportedModulesMap) == null ? void 0 : _a22.get(key); + if (oldValue === void 0) + return [toFileId(key), toFileIdListId(state.exportedModulesMap.getValues(key))]; + if (oldValue) + return [toFileId(key), toFileIdListId(oldValue)]; + return void 0; + }); + } + const semanticDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.semanticDiagnosticsPerFile); + let affectedFilesPendingEmit; + if ((_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.size) { + const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions); + const seenFiles = /* @__PURE__ */ new Set(); + for (const path2 of arrayFrom(state.affectedFilesPendingEmit.keys()).sort(compareStringsCaseSensitive)) { + if (tryAddToSet(seenFiles, path2)) { + const file = state.program.getSourceFileByPath(path2); + if (!file || !sourceFileMayBeEmitted(file, state.program)) + continue; + const fileId = toFileId(path2), pendingEmit = state.affectedFilesPendingEmit.get(path2); + (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push( + pendingEmit === fullEmitForOptions ? fileId : ( + // Pending full emit per options + pendingEmit === 8 ? [fileId] : ( + // Pending on Dts only + [fileId, pendingEmit] + ) + ) + // Anything else + ); + } + } + } + let changeFileSet; + if (state.changedFilesSet.size) { + for (const path2 of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) { + (changeFileSet || (changeFileSet = [])).push(toFileId(path2)); + } + } + const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile); + const program = { + fileNames, + fileInfos, + root: root2, + options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions), + fileIdsList, + referencedMap, + exportedModulesMap, + semanticDiagnosticsPerFile, + emitDiagnosticsPerFile, + affectedFilesPendingEmit, + changeFileSet, + emitSignatures, + latestChangedDtsFile + }; + return createBuildInfo(program, bundle); + function relativeToBuildInfoEnsuringAbsolutePath(path2) { + return relativeToBuildInfo(getNormalizedAbsolutePath(path2, currentDirectory)); + } + function relativeToBuildInfo(path2) { + return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path2, state.program.getCanonicalFileName)); + } + function toFileId(path2) { + let fileId = fileNameToFileId.get(path2); + if (fileId === void 0) { + fileNames.push(relativeToBuildInfo(path2)); + fileNameToFileId.set(path2, fileId = fileNames.length); + } + return fileId; + } + function toFileIdListId(set4) { + const fileIds = arrayFrom(set4.keys(), toFileId).sort(compareValues); + const key = fileIds.join(); + let fileIdListId = fileNamesToFileIdListId == null ? void 0 : fileNamesToFileIdListId.get(key); + if (fileIdListId === void 0) { + (fileIdsList || (fileIdsList = [])).push(fileIds); + (fileNamesToFileIdListId || (fileNamesToFileIdListId = /* @__PURE__ */ new Map())).set(key, fileIdListId = fileIdsList.length); + } + return fileIdListId; + } + function tryAddRoot(path2, fileId) { + const file = state.program.getSourceFile(path2); + if (!state.program.getFileIncludeReasons().get(file.path).some( + (r8) => r8.kind === 0 + /* RootFile */ + )) + return; + if (!root2.length) + return root2.push(fileId); + const last22 = root2[root2.length - 1]; + const isLastStartEnd = isArray3(last22); + if (isLastStartEnd && last22[1] === fileId - 1) + return last22[1] = fileId; + if (isLastStartEnd || root2.length === 1 || last22 !== fileId - 1) + return root2.push(fileId); + const lastButOne = root2[root2.length - 2]; + if (!isNumber3(lastButOne) || lastButOne !== last22 - 1) + return root2.push(fileId); + root2[root2.length - 2] = [lastButOne, fileId]; + return root2.length = root2.length - 1; + } + function convertToProgramBuildInfoCompilerOptions(options) { + let result2; + const { optionsNameMap } = getOptionsNameMap(); + for (const name2 of getOwnKeys(options).sort(compareStringsCaseSensitive)) { + const optionInfo = optionsNameMap.get(name2.toLowerCase()); + if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) { + (result2 || (result2 = {}))[name2] = convertToReusableCompilerOptionValue( + optionInfo, + options[name2] + ); + } + } + return result2; + } + function convertToReusableCompilerOptionValue(option, value2) { + if (option) { + Debug.assert(option.type !== "listOrElement"); + if (option.type === "list") { + const values2 = value2; + if (option.element.isFilePath && values2.length) { + return values2.map(relativeToBuildInfoEnsuringAbsolutePath); + } + } else if (option.isFilePath) { + return relativeToBuildInfoEnsuringAbsolutePath(value2); + } + } + return value2; + } + function convertToProgramBuildInfoDiagnostics(diagnostics) { + let result2; + if (diagnostics) { + for (const key of arrayFrom(diagnostics.keys()).sort(compareStringsCaseSensitive)) { + const value2 = diagnostics.get(key); + (result2 || (result2 = [])).push( + value2.length ? [ + toFileId(key), + convertToReusableDiagnostics(value2) + ] : toFileId(key) + ); + } + } + return result2; + } + function convertToReusableDiagnostics(diagnostics) { + Debug.assert(!!diagnostics.length); + return diagnostics.map((diagnostic) => { + const result2 = convertToReusableDiagnosticRelatedInformation(diagnostic); + result2.reportsUnnecessary = diagnostic.reportsUnnecessary; + result2.reportDeprecated = diagnostic.reportsDeprecated; + result2.source = diagnostic.source; + result2.skippedOn = diagnostic.skippedOn; + const { relatedInformation } = diagnostic; + result2.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r8) => convertToReusableDiagnosticRelatedInformation(r8)) : [] : void 0; + return result2; + }); + } + function convertToReusableDiagnosticRelatedInformation(diagnostic) { + const { file } = diagnostic; + return { + ...diagnostic, + file: file ? relativeToBuildInfo(file.resolvedPath) : void 0, + messageText: isString4(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText) + }; + } + function convertToReusableDiagnosticMessageChain(chain3) { + if (chain3.repopulateInfo) { + return { + info: chain3.repopulateInfo(), + next: convertToReusableDiagnosticMessageChainArray(chain3.next) + }; + } + const next = convertToReusableDiagnosticMessageChainArray(chain3.next); + return next === chain3.next ? chain3 : { ...chain3, next }; + } + function convertToReusableDiagnosticMessageChainArray(array) { + if (!array) + return array; + return forEach4(array, (chain3, index4) => { + const reusable = convertToReusableDiagnosticMessageChain(chain3); + if (chain3 === reusable) + return void 0; + const result2 = index4 > 0 ? array.slice(0, index4 - 1) : []; + result2.push(reusable); + for (let i7 = index4 + 1; i7 < array.length; i7++) { + result2.push(convertToReusableDiagnosticMessageChain(array[i7])); + } + return result2; + }) || array; + } + } + function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + let host; + let newProgram; + let oldProgram; + if (newProgramOrRootNames === void 0) { + Debug.assert(hostOrOptions === void 0); + host = oldProgramOrHost; + oldProgram = configFileParsingDiagnosticsOrOldProgram; + Debug.assert(!!oldProgram); + newProgram = oldProgram.getProgram(); + } else if (isArray3(newProgramOrRootNames)) { + oldProgram = configFileParsingDiagnosticsOrOldProgram; + newProgram = createProgram({ + rootNames: newProgramOrRootNames, + options: hostOrOptions, + host: oldProgramOrHost, + oldProgram: oldProgram && oldProgram.getProgramOrUndefined(), + configFileParsingDiagnostics, + projectReferences + }); + host = oldProgramOrHost; + } else { + newProgram = newProgramOrRootNames; + host = hostOrOptions; + oldProgram = oldProgramOrHost; + configFileParsingDiagnostics = configFileParsingDiagnosticsOrOldProgram; + } + return { host, newProgram, oldProgram, configFileParsingDiagnostics: configFileParsingDiagnostics || emptyArray }; + } + function getTextHandlingSourceMapForSignature(text, data) { + return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text; + } + function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) { + var _a2; + text = getTextHandlingSourceMapForSignature(text, data); + let sourceFileDirectory; + if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) { + text += data.diagnostics.map((diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}`).join("\n"); + } + return (host.createHash ?? generateDjb2Hash)(text); + function flattenDiagnosticMessageText2(diagnostic) { + return isString4(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n"); + } + function locationInfo(diagnostic) { + if (diagnostic.file.resolvedPath === sourceFile.resolvedPath) + return `(${diagnostic.start},${diagnostic.length})`; + if (sourceFileDirectory === void 0) + sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); + return `${ensurePathIsNonModuleName(getRelativePathFromDirectory( + sourceFileDirectory, + diagnostic.file.resolvedPath, + program.getCanonicalFileName + ))}(${diagnostic.start},${diagnostic.length})`; + } + } + function computeSignature(text, host, data) { + return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data)); + } + function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) { + let oldState = oldProgram && oldProgram.getState(); + if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) { + newProgram = void 0; + oldState = void 0; + return oldProgram; + } + const state = createBuilderProgramState(newProgram, oldState); + newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle); + newProgram = void 0; + oldProgram = void 0; + oldState = void 0; + const getState = () => state; + const builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics); + builderProgram.getState = getState; + builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state); + builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved); + builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature; + builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(state, Debug.checkDefined(state.program), sourceFile); + builderProgram.getSemanticDiagnostics = getSemanticDiagnostics; + builderProgram.emit = emit3; + builderProgram.releaseProgram = () => releaseCache(state); + if (kind === 0) { + builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + } else if (kind === 1) { + builderProgram.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + builderProgram.emitNextAffectedFile = emitNextAffectedFile; + builderProgram.emitBuildInfo = emitBuildInfo; + } else { + notImplemented(); + } + return builderProgram; + function emitBuildInfo(writeFile22, cancellationToken) { + if (state.buildInfoEmitPending) { + const result2 = Debug.checkDefined(state.program).emitBuildInfo(writeFile22 || maybeBind(host, host.writeFile), cancellationToken); + state.buildInfoEmitPending = false; + return result2; + } + return emitSkippedWithNoDiagnostics; + } + function emitNextAffectedFile(writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var _a2, _b, _c; + let affected = getNextAffectedFile(state, cancellationToken, host); + const programEmitKind = getBuilderFileEmit(state.compilerOptions); + let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 : programEmitKind; + if (!affected) { + if (!outFile(state.compilerOptions)) { + const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles); + if (!pendingAffectedFile) { + const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state); + if (pendingForDiagnostics) { + (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set( + pendingForDiagnostics.affectedFile.resolvedPath, + pendingForDiagnostics.seenKind | 24 + /* AllDts */ + ); + return { + result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics }, + affected: pendingForDiagnostics.affectedFile + }; + } + if (!state.buildInfoEmitPending) + return void 0; + const affected2 = state.program; + const result22 = affected2.emitBuildInfo(writeFile22 || maybeBind(host, host.writeFile), cancellationToken); + state.buildInfoEmitPending = false; + return { result: result22, affected: affected2 }; + } + ({ affectedFile: affected, emitKind } = pendingAffectedFile); + } else { + if (!state.programEmitPending) + return void 0; + emitKind = state.programEmitPending; + if (emitOnlyDtsFiles) + emitKind = emitKind & 24; + if (!emitKind) + return void 0; + affected = state.program; + } + } + let emitOnly; + if (emitKind & 7) + emitOnly = 0; + if (emitKind & 24) + emitOnly = emitOnly === void 0 ? 1 : void 0; + if (affected === state.program) { + state.programEmitPending = state.changedFilesSet.size ? getPendingEmitKind(programEmitKind, emitKind) : state.programEmitPending ? getPendingEmitKind(state.programEmitPending, emitKind) : void 0; + } + const result2 = state.program.emit( + affected === state.program ? void 0 : affected, + getWriteFileCallback(writeFile22, customTransformers), + cancellationToken, + emitOnly, + customTransformers + ); + if (affected !== state.program) { + const affectedSourceFile = affected; + state.seenAffectedFiles.add(affectedSourceFile.resolvedPath); + if (state.affectedFilesIndex !== void 0) + state.affectedFilesIndex++; + state.buildInfoEmitPending = true; + const existing = ((_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedSourceFile.resolvedPath)) || 0; + (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, emitKind | existing); + const existingPending = ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.get(affectedSourceFile.resolvedPath)) || programEmitKind; + const pendingKind = getPendingEmitKind(existingPending, emitKind | existing); + if (pendingKind) + (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, pendingKind); + else + (_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.delete(affectedSourceFile.resolvedPath); + if (result2.diagnostics.length) + (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, result2.diagnostics); + } else { + state.changedFilesSet.clear(); + } + return { result: result2, affected }; + } + function getWriteFileCallback(writeFile22, customTransformers) { + if (!getEmitDeclarations(state.compilerOptions)) + return writeFile22 || maybeBind(host, host.writeFile); + return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => { + var _a2, _b, _c, _d; + if (isDeclarationFileName(fileName)) { + if (!outFile(state.compilerOptions)) { + Debug.assert((sourceFiles == null ? void 0 : sourceFiles.length) === 1); + let emitSignature; + if (!customTransformers) { + const file = sourceFiles[0]; + const info2 = state.fileInfos.get(file.resolvedPath); + if (info2.signature === file.version) { + const signature = computeSignatureWithDiagnostics( + state.program, + file, + text, + host, + data + ); + if (!((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length)) + emitSignature = signature; + if (signature !== file.version) { + if (host.storeFilesChangingSignatureDuringEmit) + (state.filesChangingSignature ?? (state.filesChangingSignature = /* @__PURE__ */ new Set())).add(file.resolvedPath); + if (state.exportedModulesMap) + BuilderState.updateExportedModules(state, file, file.exportedModulesFromDeclarationEmit); + if (state.affectedFiles) { + const existing = (_b = state.oldSignatures) == null ? void 0 : _b.get(file.resolvedPath); + if (existing === void 0) + (state.oldSignatures ?? (state.oldSignatures = /* @__PURE__ */ new Map())).set(file.resolvedPath, info2.signature || false); + info2.signature = signature; + } else { + info2.signature = signature; + (_c = state.oldExportedModulesMap) == null ? void 0 : _c.clear(); + } + } + } + } + if (state.compilerOptions.composite) { + const filePath = sourceFiles[0].resolvedPath; + emitSignature = handleNewSignature((_d = state.emitSignatures) == null ? void 0 : _d.get(filePath), emitSignature); + if (!emitSignature) + return; + (state.emitSignatures ?? (state.emitSignatures = /* @__PURE__ */ new Map())).set(filePath, emitSignature); + } + } else if (state.compilerOptions.composite) { + const newSignature = handleNewSignature( + state.outSignature, + /*newSignature*/ + void 0 + ); + if (!newSignature) + return; + state.outSignature = newSignature; + } + } + if (writeFile22) + writeFile22(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else if (host.writeFile) + host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + else + state.program.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data); + function handleNewSignature(oldSignatureFormat, newSignature) { + const oldSignature = !oldSignatureFormat || isString4(oldSignatureFormat) ? oldSignatureFormat : oldSignatureFormat[0]; + newSignature ?? (newSignature = computeSignature(text, host, data)); + if (newSignature === oldSignature) { + if (oldSignatureFormat === oldSignature) + return void 0; + else if (data) + data.differsOnlyInMap = true; + else + data = { differsOnlyInMap: true }; + } else { + state.hasChangedEmitSignature = true; + state.latestChangedDtsFile = fileName; + } + return newSignature; + } + }; + } + function emit3(targetSourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) { + if (kind === 1) { + assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); + } + const result2 = handleNoEmitOptions(builderProgram, targetSourceFile, writeFile22, cancellationToken); + if (result2) + return result2; + if (!targetSourceFile) { + if (kind === 1) { + let sourceMaps = []; + let emitSkipped = false; + let diagnostics; + let emittedFiles = []; + let affectedEmitResult; + while (affectedEmitResult = emitNextAffectedFile(writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped, + diagnostics: diagnostics || emptyArray, + emittedFiles, + sourceMaps + }; + } else { + clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles); + } + } + return Debug.checkDefined(state.program).emit( + targetSourceFile, + getWriteFileCallback(writeFile22, customTransformers), + cancellationToken, + emitOnlyDtsFiles, + customTransformers + ); + } + function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { + while (true) { + const affected = getNextAffectedFile(state, cancellationToken, host); + let result2; + if (!affected) + return void 0; + else if (affected !== state.program) { + const affectedSourceFile = affected; + if (!ignoreSourceFile || !ignoreSourceFile(affectedSourceFile)) { + result2 = getSemanticDiagnosticsOfFile(state, affectedSourceFile, cancellationToken); + } + state.seenAffectedFiles.add(affectedSourceFile.resolvedPath); + state.affectedFilesIndex++; + state.buildInfoEmitPending = true; + if (!result2) + continue; + } else { + result2 = state.program.getSemanticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ); + state.changedFilesSet.clear(); + state.programEmitPending = getBuilderFileEmit(state.compilerOptions); + } + return { result: result2, affected }; + } + } + function getSemanticDiagnostics(sourceFile, cancellationToken) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + const compilerOptions = Debug.checkDefined(state.program).getCompilerOptions(); + if (outFile(compilerOptions)) { + Debug.assert(!state.semanticDiagnosticsPerFile); + return Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken); + } + if (sourceFile) { + return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); + } + while (getSemanticDiagnosticsOfNextAffectedFile(cancellationToken)) { + } + let diagnostics; + for (const sourceFile2 of Debug.checkDefined(state.program).getSourceFiles()) { + diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken)); + } + return diagnostics || emptyArray; + } + } + function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) { + var _a2, _b; + const existingKind = ((_a2 = state.affectedFilesPendingEmit) == null ? void 0 : _a2.get(affectedFilePendingEmit)) || 0; + (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedFilePendingEmit, existingKind | kind); + (_b = state.emitDiagnosticsPerFile) == null ? void 0 : _b.delete(affectedFilePendingEmit); + } + function toBuilderStateFileInfoForMultiEmit(fileInfo) { + return isString4(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString4(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat }; + } + function toBuilderFileEmit(value2, fullEmitForOptions) { + return isNumber3(value2) ? fullEmitForOptions : value2[1] || 8; + } + function toProgramEmitPending(value2, options) { + return !value2 ? getBuilderFileEmit(options || {}) : value2; + } + function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host) { + var _a2, _b, _c, _d; + const program = buildInfo.program; + const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + let state; + const filePaths = (_a2 = program.fileNames) == null ? void 0 : _a2.map(toPathInBuildInfoDirectory); + let filePathsSetList; + const latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : void 0; + if (isProgramBundleEmitBuildInfo(program)) { + const fileInfos = /* @__PURE__ */ new Map(); + program.fileInfos.forEach((fileInfo, index4) => { + const path2 = toFilePath(index4 + 1); + fileInfos.set(path2, isString4(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo); + }); + state = { + fileInfos, + compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {}, + latestChangedDtsFile, + outSignature: program.outSignature, + programEmitPending: program.pendingEmit === void 0 ? void 0 : toProgramEmitPending(program.pendingEmit, program.options), + bundle: buildInfo.bundle + }; + } else { + filePathsSetList = (_b = program.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath))); + const fileInfos = /* @__PURE__ */ new Map(); + const emitSignatures = ((_c = program.options) == null ? void 0 : _c.composite) && !outFile(program.options) ? /* @__PURE__ */ new Map() : void 0; + program.fileInfos.forEach((fileInfo, index4) => { + const path2 = toFilePath(index4 + 1); + const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo); + fileInfos.set(path2, stateFileInfo); + if (emitSignatures && stateFileInfo.signature) + emitSignatures.set(path2, stateFileInfo.signature); + }); + (_d = program.emitSignatures) == null ? void 0 : _d.forEach((value2) => { + if (isNumber3(value2)) + emitSignatures.delete(toFilePath(value2)); + else { + const key = toFilePath(value2[0]); + emitSignatures.set( + key, + !isString4(value2[1]) && !value2[1].length ? ( + // File signature is emit signature but differs in map + [emitSignatures.get(key)] + ) : value2[1] + ); + } + }); + const fullEmitForOptions = program.affectedFilesPendingEmit ? getBuilderFileEmit(program.options || {}) : void 0; + state = { + fileInfos, + compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {}, + referencedMap: toManyToManyPathMap(program.referencedMap), + exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap), + semanticDiagnosticsPerFile: toPerFileDiagnostics(program.semanticDiagnosticsPerFile), + emitDiagnosticsPerFile: toPerFileDiagnostics(program.emitDiagnosticsPerFile), + hasReusableDiagnostic: true, + affectedFilesPendingEmit: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, (value2) => toFilePath(isNumber3(value2) ? value2 : value2[0]), (value2) => toBuilderFileEmit(value2, fullEmitForOptions)), + changedFilesSet: new Set(map4(program.changeFileSet, toFilePath)), + latestChangedDtsFile, + emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0 + }; + } + return { + getState: () => state, + saveEmitState: noop4, + restoreEmitState: noop4, + getProgram: notImplemented, + getProgramOrUndefined: returnUndefined, + releaseProgram: noop4, + getCompilerOptions: () => state.compilerOptions, + getSourceFile: notImplemented, + getSourceFiles: notImplemented, + getOptionsDiagnostics: notImplemented, + getGlobalDiagnostics: notImplemented, + getConfigFileParsingDiagnostics: notImplemented, + getSyntacticDiagnostics: notImplemented, + getDeclarationDiagnostics: notImplemented, + getSemanticDiagnostics: notImplemented, + emit: notImplemented, + getAllDependencies: notImplemented, + getCurrentDirectory: notImplemented, + emitNextAffectedFile: notImplemented, + getSemanticDiagnosticsOfNextAffectedFile: notImplemented, + emitBuildInfo: notImplemented, + close: noop4, + hasChangedEmitSignature: returnFalse + }; + function toPathInBuildInfoDirectory(path2) { + return toPath2(path2, buildInfoDirectory, getCanonicalFileName); + } + function toAbsolutePath(path2) { + return getNormalizedAbsolutePath(path2, buildInfoDirectory); + } + function toFilePath(fileId) { + return filePaths[fileId - 1]; + } + function toFilePathsSet(fileIdsListId) { + return filePathsSetList[fileIdsListId - 1]; + } + function toManyToManyPathMap(referenceMap) { + if (!referenceMap) { + return void 0; + } + const map22 = BuilderState.createManyToManyPathMap(); + referenceMap.forEach(([fileId, fileIdListId]) => map22.set(toFilePath(fileId), toFilePathsSet(fileIdListId))); + return map22; + } + function toPerFileDiagnostics(diagnostics) { + return diagnostics && arrayToMap(diagnostics, (value2) => toFilePath(isNumber3(value2) ? value2 : value2[0]), (value2) => isNumber3(value2) ? emptyArray : value2[1]); + } + } + function getBuildInfoFileVersionMap(program, buildInfoPath, host) { + const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory())); + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + const fileInfos = /* @__PURE__ */ new Map(); + let rootIndex = 0; + const roots = []; + program.fileInfos.forEach((fileInfo, index4) => { + const path2 = toPath2(program.fileNames[index4], buildInfoDirectory, getCanonicalFileName); + const version22 = isString4(fileInfo) ? fileInfo : fileInfo.version; + fileInfos.set(path2, version22); + if (rootIndex < program.root.length) { + const current = program.root[rootIndex]; + const fileId = index4 + 1; + if (isArray3(current)) { + if (current[0] <= fileId && fileId <= current[1]) { + roots.push(path2); + if (current[1] === fileId) + rootIndex++; + } + } else if (current === fileId) { + roots.push(path2); + rootIndex++; + } + } + }); + return { fileInfos, roots }; + } + function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) { + return { + getState: notImplemented, + saveEmitState: noop4, + restoreEmitState: noop4, + getProgram, + getProgramOrUndefined: () => getState().program, + releaseProgram: () => getState().program = void 0, + getCompilerOptions: () => getState().compilerOptions, + getSourceFile: (fileName) => getProgram().getSourceFile(fileName), + getSourceFiles: () => getProgram().getSourceFiles(), + getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken), + getGlobalDiagnostics: (cancellationToken) => getProgram().getGlobalDiagnostics(cancellationToken), + getConfigFileParsingDiagnostics: () => configFileParsingDiagnostics, + getSyntacticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSyntacticDiagnostics(sourceFile, cancellationToken), + getDeclarationDiagnostics: (sourceFile, cancellationToken) => getProgram().getDeclarationDiagnostics(sourceFile, cancellationToken), + getSemanticDiagnostics: (sourceFile, cancellationToken) => getProgram().getSemanticDiagnostics(sourceFile, cancellationToken), + emit: (sourceFile, writeFile22, cancellationToken, emitOnlyDts, customTransformers) => getProgram().emit(sourceFile, writeFile22, cancellationToken, emitOnlyDts, customTransformers), + emitBuildInfo: (writeFile22, cancellationToken) => getProgram().emitBuildInfo(writeFile22, cancellationToken), + getAllDependencies: notImplemented, + getCurrentDirectory: () => getProgram().getCurrentDirectory(), + close: noop4 + }; + function getProgram() { + return Debug.checkDefined(getState().program); + } + } + var BuilderFileEmit, BuilderProgramKind; + var init_builder = __esm2({ + "src/compiler/builder.ts"() { + "use strict"; + init_ts2(); + BuilderFileEmit = /* @__PURE__ */ ((BuilderFileEmit2) => { + BuilderFileEmit2[BuilderFileEmit2["None"] = 0] = "None"; + BuilderFileEmit2[BuilderFileEmit2["Js"] = 1] = "Js"; + BuilderFileEmit2[BuilderFileEmit2["JsMap"] = 2] = "JsMap"; + BuilderFileEmit2[BuilderFileEmit2["JsInlineMap"] = 4] = "JsInlineMap"; + BuilderFileEmit2[BuilderFileEmit2["Dts"] = 8] = "Dts"; + BuilderFileEmit2[BuilderFileEmit2["DtsMap"] = 16] = "DtsMap"; + BuilderFileEmit2[BuilderFileEmit2["AllJs"] = 7] = "AllJs"; + BuilderFileEmit2[BuilderFileEmit2["AllDts"] = 24] = "AllDts"; + BuilderFileEmit2[BuilderFileEmit2["All"] = 31] = "All"; + return BuilderFileEmit2; + })(BuilderFileEmit || {}); + BuilderProgramKind = /* @__PURE__ */ ((BuilderProgramKind2) => { + BuilderProgramKind2[BuilderProgramKind2["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; + BuilderProgramKind2[BuilderProgramKind2["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; + return BuilderProgramKind2; + })(BuilderProgramKind || {}); + } + }); + function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + return createBuilderProgram(0, getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences)); + } + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + return createBuilderProgram(1, getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences)); + } + function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) { + const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences); + return createRedirectedBuilderProgram(() => ({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }), newConfigFileParsingDiagnostics); + } + var init_builderPublic = __esm2({ + "src/compiler/builderPublic.ts"() { + "use strict"; + init_ts2(); + } + }); + function removeIgnoredPath(path2) { + if (endsWith2(path2, "/node_modules/.staging")) { + return removeSuffix(path2, "/.staging"); + } + return some2(ignoredPaths, (searchPath) => path2.includes(searchPath)) ? void 0 : path2; + } + function perceivedOsRootLengthForWatching(pathComponents2, length2) { + if (length2 <= 1) + return 1; + let indexAfterOsRoot = 1; + let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0; + if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths + pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) { + if (length2 === 2) + return 2; + indexAfterOsRoot = 2; + isDosStyle = true; + } + if (isDosStyle && !pathComponents2[indexAfterOsRoot].match(/^users$/i)) { + return indexAfterOsRoot; + } + if (pathComponents2[indexAfterOsRoot].match(/^workspaces$/i)) { + return indexAfterOsRoot + 1; + } + return indexAfterOsRoot + 2; + } + function canWatchDirectoryOrFile(pathComponents2, length2) { + if (length2 === void 0) + length2 = pathComponents2.length; + if (length2 <= 2) + return false; + const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2); + return length2 > perceivedOsRootLength + 1; + } + function canWatchAtTypes(atTypes) { + return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes)); + } + function isInDirectoryPath(dirComponents, fileOrDirComponents) { + if (fileOrDirComponents.length < fileOrDirComponents.length) + return false; + for (let i7 = 0; i7 < dirComponents.length; i7++) { + if (fileOrDirComponents[i7] !== dirComponents[i7]) + return false; + } + return true; + } + function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) { + return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath)); + } + function canWatchAffectingLocation(filePath) { + return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath); + } + function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory) { + const failedLookupPathComponents = getPathComponents(failedLookupLocationPath); + failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory()); + const failedLookupComponents = getPathComponents(failedLookupLocation); + const perceivedOsRootLength = perceivedOsRootLengthForWatching(failedLookupPathComponents, failedLookupPathComponents.length); + if (failedLookupPathComponents.length <= perceivedOsRootLength + 1) + return void 0; + const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules"); + if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1) + return void 0; + if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) { + if (failedLookupPathComponents.length > rootPathComponents.length + 1) { + return getDirectoryOfFailedLookupWatch(failedLookupComponents, failedLookupPathComponents, Math.max(rootPathComponents.length + 1, perceivedOsRootLength + 1)); + } else { + return { + dir: rootDir, + dirPath: rootPath, + nonRecursive: true + }; + } + } + return getDirectoryToWatchFromFailedLookupLocationDirectory( + failedLookupComponents, + failedLookupPathComponents, + failedLookupPathComponents.length - 1, + perceivedOsRootLength, + nodeModulesIndex, + rootPathComponents + ); + } + function getDirectoryToWatchFromFailedLookupLocationDirectory(dirComponents, dirPathComponents, dirPathComponentsLength, perceivedOsRootLength, nodeModulesIndex, rootPathComponents) { + if (nodeModulesIndex !== -1) { + return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, nodeModulesIndex + 1); + } + let nonRecursive = true; + let length2 = dirPathComponentsLength; + for (let i7 = 0; i7 < dirPathComponentsLength; i7++) { + if (dirPathComponents[i7] !== rootPathComponents[i7]) { + nonRecursive = false; + length2 = Math.max(i7 + 1, perceivedOsRootLength + 1); + break; + } + } + return getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive); + } + function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, length2, nonRecursive) { + return { + dir: getPathFromPathComponents(dirComponents, length2), + dirPath: getPathFromPathComponents(dirPathComponents, length2), + nonRecursive + }; + } + function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, filterCustomPath) { + const typeRootPathComponents = getPathComponents(typeRootPath); + if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) { + return rootPath; + } + typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory()); + const toWatch = getDirectoryToWatchFromFailedLookupLocationDirectory( + getPathComponents(typeRoot), + typeRootPathComponents, + typeRootPathComponents.length, + perceivedOsRootLengthForWatching(typeRootPathComponents, typeRootPathComponents.length), + typeRootPathComponents.indexOf("node_modules"), + rootPathComponents + ); + return toWatch && filterCustomPath(toWatch.dirPath) ? toWatch.dirPath : void 0; + } + function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory) { + const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory()); + return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized; + } + function getRootPathSplitLength(rootPath) { + return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0); + } + function getModuleResolutionHost(resolutionHost) { + var _a2; + return ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost; + } + function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) { + return { + nameAndMode: moduleResolutionNameAndModeGetter, + resolve: (moduleName3, resoluionMode) => resolveModuleNameUsingGlobalCache( + resolutionHost, + moduleResolutionCache, + moduleName3, + containingFile, + options, + redirectedReference, + resoluionMode + ) + }; + } + function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName3, containingFile, compilerOptions, redirectedReference, mode) { + const host = getModuleResolutionHost(resolutionHost); + const primaryResult = resolveModuleName(moduleName3, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode); + if (!resolutionHost.getGlobalCache) { + return primaryResult; + } + const globalCache = resolutionHost.getGlobalCache(); + if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName3) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) { + const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache( + Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName3), + resolutionHost.projectName, + compilerOptions, + host, + globalCache, + moduleResolutionCache + ); + if (resolvedModule) { + primaryResult.resolvedModule = resolvedModule; + primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations); + primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations); + primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics); + return primaryResult; + } + } + return primaryResult; + } + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { + let filesWithChangedSetOfUnresolvedImports; + let filesWithInvalidatedResolutions; + let filesWithInvalidatedNonRelativeUnresolvedImports; + const nonRelativeExternalModuleResolutions = createMultiMap(); + const resolutionsWithFailedLookups = /* @__PURE__ */ new Set(); + const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set(); + const resolvedFileToResolution = /* @__PURE__ */ new Map(); + const impliedFormatPackageJsons = /* @__PURE__ */ new Map(); + let hasChangedAutomaticTypeDirectiveNames = false; + let affectingPathChecksForFile; + let affectingPathChecks; + let failedLookupChecks; + let startsWithPathChecks; + let isInDirectoryChecks; + let allModuleAndTypeResolutionsAreInvalidated = false; + const getCurrentDirectory = memoize2(() => resolutionHost.getCurrentDirectory()); + const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); + const resolvedModuleNames = /* @__PURE__ */ new Map(); + const moduleResolutionCache = createModuleResolutionCache( + getCurrentDirectory(), + resolutionHost.getCanonicalFileName, + resolutionHost.getCompilationSettings() + ); + const resolvedTypeReferenceDirectives = /* @__PURE__ */ new Map(); + const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( + getCurrentDirectory(), + resolutionHost.getCanonicalFileName, + resolutionHost.getCompilationSettings(), + moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache.optionsToRedirectsKey + ); + const resolvedLibraries = /* @__PURE__ */ new Map(); + const libraryResolutionCache = createModuleResolutionCache( + getCurrentDirectory(), + resolutionHost.getCanonicalFileName, + getOptionsForLibraryResolution(resolutionHost.getCompilationSettings()), + moduleResolutionCache.getPackageJsonInfoCache() + ); + const directoryWatchesOfFailedLookups = /* @__PURE__ */ new Map(); + const fileWatchesOfAffectingLocations = /* @__PURE__ */ new Map(); + const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory); + const rootPath = resolutionHost.toPath(rootDir); + const rootPathComponents = getPathComponents(rootPath); + const typeRootsWatches = /* @__PURE__ */ new Map(); + return { + rootDirForResolution, + resolvedModuleNames, + resolvedTypeReferenceDirectives, + resolvedLibraries, + resolvedFileToResolution, + resolutionsWithFailedLookups, + resolutionsWithOnlyAffectingLocations, + directoryWatchesOfFailedLookups, + fileWatchesOfAffectingLocations, + watchFailedLookupLocationsOfExternalModuleResolutions, + getModuleResolutionCache: () => moduleResolutionCache, + startRecordingFilesWithChangedResolutions, + finishRecordingFilesWithChangedResolutions, + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + startCachingPerDirectoryResolution, + finishCachingPerDirectoryResolution, + resolveModuleNameLiterals, + resolveTypeReferenceDirectiveReferences, + resolveLibrary: resolveLibrary2, + resolveSingleModuleNameWithoutWatching, + removeResolutionsFromProjectReferenceRedirects, + removeResolutionsOfFile, + hasChangedAutomaticTypeDirectiveNames: () => hasChangedAutomaticTypeDirectiveNames, + invalidateResolutionOfFile, + invalidateResolutionsOfFailedLookupLocations, + setFilesWithInvalidatedNonRelativeUnresolvedImports, + createHasInvalidatedResolutions, + isFileWithInvalidatedNonRelativeUnresolvedImports, + updateTypeRootsWatch, + closeTypeRootsWatch, + clear: clear22, + onChangesAffectModuleResolution + }; + function getResolvedModule(resolution) { + return resolution.resolvedModule; + } + function getResolvedTypeReferenceDirective(resolution) { + return resolution.resolvedTypeReferenceDirective; + } + function clear22() { + clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf); + clearMap(fileWatchesOfAffectingLocations, closeFileWatcherOf); + nonRelativeExternalModuleResolutions.clear(); + closeTypeRootsWatch(); + resolvedModuleNames.clear(); + resolvedTypeReferenceDirectives.clear(); + resolvedFileToResolution.clear(); + resolutionsWithFailedLookups.clear(); + resolutionsWithOnlyAffectingLocations.clear(); + failedLookupChecks = void 0; + startsWithPathChecks = void 0; + isInDirectoryChecks = void 0; + affectingPathChecks = void 0; + affectingPathChecksForFile = void 0; + allModuleAndTypeResolutionsAreInvalidated = false; + moduleResolutionCache.clear(); + typeReferenceDirectiveResolutionCache.clear(); + moduleResolutionCache.update(resolutionHost.getCompilationSettings()); + typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings()); + libraryResolutionCache.clear(); + impliedFormatPackageJsons.clear(); + resolvedLibraries.clear(); + hasChangedAutomaticTypeDirectiveNames = false; + } + function onChangesAffectModuleResolution() { + allModuleAndTypeResolutionsAreInvalidated = true; + moduleResolutionCache.clearAllExceptPackageJsonInfoCache(); + typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache(); + moduleResolutionCache.update(resolutionHost.getCompilationSettings()); + typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings()); + } + function startRecordingFilesWithChangedResolutions() { + filesWithChangedSetOfUnresolvedImports = []; + } + function finishRecordingFilesWithChangedResolutions() { + const collected = filesWithChangedSetOfUnresolvedImports; + filesWithChangedSetOfUnresolvedImports = void 0; + return collected; + } + function isFileWithInvalidatedNonRelativeUnresolvedImports(path2) { + if (!filesWithInvalidatedNonRelativeUnresolvedImports) { + return false; + } + const value2 = filesWithInvalidatedNonRelativeUnresolvedImports.get(path2); + return !!value2 && !!value2.length; + } + function createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidatedLibResolutions) { + invalidateResolutionsOfFailedLookupLocations(); + const collected = filesWithInvalidatedResolutions; + filesWithInvalidatedResolutions = void 0; + return { + hasInvalidatedResolutions: (path2) => customHasInvalidatedResolutions(path2) || allModuleAndTypeResolutionsAreInvalidated || !!(collected == null ? void 0 : collected.has(path2)) || isFileWithInvalidatedNonRelativeUnresolvedImports(path2), + hasInvalidatedLibResolutions: (libFileName) => { + var _a2; + return customHasInvalidatedLibResolutions(libFileName) || !!((_a2 = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName)) == null ? void 0 : _a2.isInvalidated); + } + }; + } + function startCachingPerDirectoryResolution() { + moduleResolutionCache.isReadonly = void 0; + typeReferenceDirectiveResolutionCache.isReadonly = void 0; + libraryResolutionCache.isReadonly = void 0; + moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0; + moduleResolutionCache.clearAllExceptPackageJsonInfoCache(); + typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache(); + libraryResolutionCache.clearAllExceptPackageJsonInfoCache(); + nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions); + nonRelativeExternalModuleResolutions.clear(); + } + function cleanupLibResolutionWatching(newProgram) { + resolvedLibraries.forEach((resolution, libFileName) => { + var _a2; + if (!((_a2 = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a2.has(libFileName))) { + stopWatchFailedLookupLocationOfResolution( + resolution, + resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)), + getResolvedModule + ); + resolvedLibraries.delete(libFileName); + } + }); + } + function finishCachingPerDirectoryResolution(newProgram, oldProgram) { + filesWithInvalidatedNonRelativeUnresolvedImports = void 0; + allModuleAndTypeResolutionsAreInvalidated = false; + nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions); + nonRelativeExternalModuleResolutions.clear(); + if (newProgram !== oldProgram) { + cleanupLibResolutionWatching(newProgram); + newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => { + var _a2; + const expected = isExternalOrCommonJsModule(newFile) ? ((_a2 = newFile.packageJsonLocations) == null ? void 0 : _a2.length) ?? 0 : 0; + const existing = impliedFormatPackageJsons.get(newFile.path) ?? emptyArray; + for (let i7 = existing.length; i7 < expected; i7++) { + createFileWatcherOfAffectingLocation( + newFile.packageJsonLocations[i7], + /*forResolution*/ + false + ); + } + if (existing.length > expected) { + for (let i7 = expected; i7 < existing.length; i7++) { + fileWatchesOfAffectingLocations.get(existing[i7]).files--; + } + } + if (expected) + impliedFormatPackageJsons.set(newFile.path, newFile.packageJsonLocations); + else + impliedFormatPackageJsons.delete(newFile.path); + }); + impliedFormatPackageJsons.forEach((existing, path2) => { + if (!(newProgram == null ? void 0 : newProgram.getSourceFileByPath(path2))) { + existing.forEach((location2) => fileWatchesOfAffectingLocations.get(location2).files--); + impliedFormatPackageJsons.delete(path2); + } + }); + } + directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup); + fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation); + hasChangedAutomaticTypeDirectiveNames = false; + moduleResolutionCache.isReadonly = true; + typeReferenceDirectiveResolutionCache.isReadonly = true; + libraryResolutionCache.isReadonly = true; + moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true; + } + function closeDirectoryWatchesOfFailedLookup(watcher, path2) { + if (watcher.refCount === 0) { + directoryWatchesOfFailedLookups.delete(path2); + watcher.watcher.close(); + } + } + function closeFileWatcherOfAffectingLocation(watcher, path2) { + var _a2; + if (watcher.files === 0 && watcher.resolutions === 0 && !((_a2 = watcher.symlinks) == null ? void 0 : _a2.size)) { + fileWatchesOfAffectingLocations.delete(path2); + watcher.watcher.close(); + } + } + function resolveNamesWithLocalCache({ + entries, + containingFile, + containingSourceFile, + redirectedReference, + options, + perFileCache, + reusedNames, + loader: loader2, + getResolutionWithResolvedFileName, + deferWatchingNonRelativeResolution, + shouldRetryResolution, + logChanges + }) { + const path2 = resolutionHost.toPath(containingFile); + const resolutionsInFile = perFileCache.get(path2) || perFileCache.set(path2, createModeAwareCache()).get(path2); + const resolvedModules = []; + const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path2); + const program = resolutionHost.getCurrentProgram(); + const oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile); + const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference; + const seenNamesInFile = createModeAwareCache(); + for (const entry of entries) { + const name2 = loader2.nameAndMode.getName(entry); + const mode = loader2.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options); + let resolution = resolutionsInFile.get(name2, mode); + if (!seenNamesInFile.has(name2, mode) && (allModuleAndTypeResolutionsAreInvalidated || unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate + hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name2) && shouldRetryResolution(resolution))) { + const existingResolution = resolution; + resolution = loader2.resolve(name2, mode); + if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) { + resolutionHost.onDiscoveredSymlink(); + } + resolutionsInFile.set(name2, mode, resolution); + if (resolution !== existingResolution) { + watchFailedLookupLocationsOfExternalModuleResolutions(name2, resolution, path2, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution); + if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution, path2, getResolutionWithResolvedFileName); + } + } + if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + filesWithChangedSetOfUnresolvedImports.push(path2); + logChanges = false; + } + } else { + const host = getModuleResolutionHost(resolutionHost); + if (isTraceEnabled(options, host) && !seenNamesInFile.has(name2, mode)) { + const resolved = getResolutionWithResolvedFileName(resolution); + trace2( + host, + perFileCache === resolvedModuleNames ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved, + name2, + containingFile, + resolved == null ? void 0 : resolved.resolvedFileName, + (resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId) + ); + } + } + Debug.assert(resolution !== void 0 && !resolution.isInvalidated); + seenNamesInFile.set(name2, mode, true); + resolvedModules.push(resolution); + } + reusedNames == null ? void 0 : reusedNames.forEach( + (entry) => seenNamesInFile.set( + loader2.nameAndMode.getName(entry), + loader2.nameAndMode.getMode(entry, containingSourceFile, (redirectedReference == null ? void 0 : redirectedReference.commandLine.options) || options), + true + ) + ); + if (resolutionsInFile.size() !== seenNamesInFile.size()) { + resolutionsInFile.forEach((resolution, name2, mode) => { + if (!seenNamesInFile.has(name2, mode)) { + stopWatchFailedLookupLocationOfResolution(resolution, path2, getResolutionWithResolvedFileName); + resolutionsInFile.delete(name2, mode); + } + }); + } + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution) { + return false; + } + const oldResult = getResolutionWithResolvedFileName(oldResolution); + const newResult = getResolutionWithResolvedFileName(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return oldResult.resolvedFileName === newResult.resolvedFileName; + } + } + function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return resolveNamesWithLocalCache({ + entries: typeDirectiveReferences, + containingFile, + containingSourceFile, + redirectedReference, + options, + reusedNames, + perFileCache: resolvedTypeReferenceDirectives, + loader: createTypeReferenceResolutionLoader( + containingFile, + redirectedReference, + options, + getModuleResolutionHost(resolutionHost), + typeReferenceDirectiveResolutionCache + ), + getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective, + shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0, + deferWatchingNonRelativeResolution: false + }); + } + function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return resolveNamesWithLocalCache({ + entries: moduleLiterals, + containingFile, + containingSourceFile, + redirectedReference, + options, + reusedNames, + perFileCache: resolvedModuleNames, + loader: createModuleResolutionLoaderUsingGlobalCache( + containingFile, + redirectedReference, + options, + resolutionHost, + moduleResolutionCache + ), + getResolutionWithResolvedFileName: getResolvedModule, + shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension), + logChanges: logChangesWhenResolvingModule, + deferWatchingNonRelativeResolution: true + // Defer non relative resolution watch because we could be using ambient modules + }); + } + function resolveLibrary2(libraryName, resolveFrom, options, libFileName) { + const host = getModuleResolutionHost(resolutionHost); + let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName); + if (!resolution || resolution.isInvalidated) { + const existingResolution = resolution; + resolution = resolveLibrary(libraryName, resolveFrom, options, host, libraryResolutionCache); + const path2 = resolutionHost.toPath(resolveFrom); + watchFailedLookupLocationsOfExternalModuleResolutions( + libraryName, + resolution, + path2, + getResolvedModule, + /*deferWatchingNonRelativeResolution*/ + false + ); + resolvedLibraries.set(libFileName, resolution); + if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution, path2, getResolvedModule); + } + } else { + if (isTraceEnabled(options, host)) { + const resolved = getResolvedModule(resolution); + trace2( + host, + (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved, + libraryName, + resolveFrom, + resolved == null ? void 0 : resolved.resolvedFileName, + (resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId) + ); + } + } + return resolution; + } + function resolveSingleModuleNameWithoutWatching(moduleName3, containingFile) { + var _a2, _b; + const path2 = resolutionHost.toPath(containingFile); + const resolutionsInFile = resolvedModuleNames.get(path2); + const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get( + moduleName3, + /*mode*/ + void 0 + ); + if (resolution && !resolution.isInvalidated) + return resolution; + const data = (_a2 = resolutionHost.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : _a2.call(resolutionHost, moduleResolutionCache); + const host = getModuleResolutionHost(resolutionHost); + const result2 = resolveModuleName( + moduleName3, + containingFile, + resolutionHost.getCompilationSettings(), + host, + moduleResolutionCache + ); + (_b = resolutionHost.afterResolveSingleModuleNameWithoutWatching) == null ? void 0 : _b.call(resolutionHost, moduleResolutionCache, moduleName3, containingFile, result2, data); + return result2; + } + function isNodeModulesAtTypesDirectory(dirPath) { + return endsWith2(dirPath, "/node_modules/@types"); + } + function watchFailedLookupLocationsOfExternalModuleResolutions(name2, resolution, filePath, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution) { + var _a2; + if (resolution.refCount) { + resolution.refCount++; + Debug.assertIsDefined(resolution.files); + } else { + resolution.refCount = 1; + Debug.assert(!((_a2 = resolution.files) == null ? void 0 : _a2.size)); + if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name2)) { + watchFailedLookupLocationOfResolution(resolution); + } else { + nonRelativeExternalModuleResolutions.add(name2, resolution); + } + const resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + const key = resolutionHost.toPath(resolved.resolvedFileName); + let resolutions = resolvedFileToResolution.get(key); + if (!resolutions) + resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set()); + resolutions.add(resolution); + } + } + (resolution.files ?? (resolution.files = /* @__PURE__ */ new Set())).add(filePath); + } + function watchFailedLookupLocation(failedLookupLocation, setAtRoot) { + const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + const toWatch = getDirectoryToWatchFailedLookupLocation( + failedLookupLocation, + failedLookupLocationPath, + rootDir, + rootPath, + rootPathComponents, + getCurrentDirectory + ); + if (toWatch) { + const { dir: dir2, dirPath, nonRecursive } = toWatch; + if (dirPath === rootPath) { + Debug.assert(nonRecursive); + setAtRoot = true; + } else { + setDirectoryWatcher(dir2, dirPath, nonRecursive); + } + } + return setAtRoot; + } + function watchFailedLookupLocationOfResolution(resolution) { + Debug.assert(!!resolution.refCount); + const { failedLookupLocations, affectingLocations, alternateResult } = resolution; + if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length) && !alternateResult) + return; + if ((failedLookupLocations == null ? void 0 : failedLookupLocations.length) || alternateResult) + resolutionsWithFailedLookups.add(resolution); + let setAtRoot = false; + if (failedLookupLocations) { + for (const failedLookupLocation of failedLookupLocations) { + setAtRoot = watchFailedLookupLocation(failedLookupLocation, setAtRoot); + } + } + if (alternateResult) + setAtRoot = watchFailedLookupLocation(alternateResult, setAtRoot); + if (setAtRoot) { + setDirectoryWatcher( + rootDir, + rootPath, + /*nonRecursive*/ + true + ); + } + watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !alternateResult); + } + function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) { + Debug.assert(!!resolution.refCount); + const { affectingLocations } = resolution; + if (!(affectingLocations == null ? void 0 : affectingLocations.length)) + return; + if (addToResolutionsWithOnlyAffectingLocations) + resolutionsWithOnlyAffectingLocations.add(resolution); + for (const affectingLocation of affectingLocations) { + createFileWatcherOfAffectingLocation( + affectingLocation, + /*forResolution*/ + true + ); + } + } + function createFileWatcherOfAffectingLocation(affectingLocation, forResolution) { + const fileWatcher = fileWatchesOfAffectingLocations.get(affectingLocation); + if (fileWatcher) { + if (forResolution) + fileWatcher.resolutions++; + else + fileWatcher.files++; + return; + } + let locationToWatch = affectingLocation; + let isSymlink = false; + let symlinkWatcher; + if (resolutionHost.realpath) { + locationToWatch = resolutionHost.realpath(affectingLocation); + if (affectingLocation !== locationToWatch) { + isSymlink = true; + symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch); + } + } + const resolutions = forResolution ? 1 : 0; + const files = forResolution ? 0 : 1; + if (!isSymlink || !symlinkWatcher) { + const watcher = { + watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => { + cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind); + invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap()); + resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); + }) : noopFileWatcher, + resolutions: isSymlink ? 0 : resolutions, + files: isSymlink ? 0 : files, + symlinks: void 0 + }; + fileWatchesOfAffectingLocations.set(locationToWatch, watcher); + if (isSymlink) + symlinkWatcher = watcher; + } + if (isSymlink) { + Debug.assert(!!symlinkWatcher); + const watcher = { + watcher: { + close: () => { + var _a2; + const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch); + if (((_a2 = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a2.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) { + fileWatchesOfAffectingLocations.delete(locationToWatch); + symlinkWatcher2.watcher.close(); + } + } + }, + resolutions, + files, + symlinks: void 0 + }; + fileWatchesOfAffectingLocations.set(affectingLocation, watcher); + (symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation); + } + } + function invalidateAffectingFileWatcher(path2, packageJsonMap) { + var _a2; + const watcher = fileWatchesOfAffectingLocations.get(path2); + if (watcher == null ? void 0 : watcher.resolutions) + (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path2); + if (watcher == null ? void 0 : watcher.files) + (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path2); + (_a2 = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a2.forEach((path22) => invalidateAffectingFileWatcher(path22, packageJsonMap)); + packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path2)); + } + function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name2) { + const program = resolutionHost.getCurrentProgram(); + if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name2)) { + resolutions.forEach(watchFailedLookupLocationOfResolution); + } else { + resolutions.forEach((resolution) => watchAffectingLocationsOfResolution( + resolution, + /*addToResolutionsWithOnlyAffectingLocations*/ + true + )); + } + } + function setDirectoryWatcher(dir2, dirPath, nonRecursive) { + const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + Debug.assert(!!nonRecursive === !!dirWatcher.nonRecursive); + dirWatcher.refCount++; + } else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir2, dirPath, nonRecursive), refCount: 1, nonRecursive }); + } + } + function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) { + const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + const toWatch = getDirectoryToWatchFailedLookupLocation( + failedLookupLocation, + failedLookupLocationPath, + rootDir, + rootPath, + rootPathComponents, + getCurrentDirectory + ); + if (toWatch) { + const { dirPath } = toWatch; + if (dirPath === rootPath) { + removeAtRoot = true; + } else { + removeDirectoryWatcher(dirPath, syncDirWatcherRemove); + } + } + return removeAtRoot; + } + function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) { + Debug.checkDefined(resolution.files).delete(filePath); + resolution.refCount--; + if (resolution.refCount) { + return; + } + const resolved = getResolutionWithResolvedFileName(resolution); + if (resolved && resolved.resolvedFileName) { + const key = resolutionHost.toPath(resolved.resolvedFileName); + const resolutions = resolvedFileToResolution.get(key); + if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size) + resolvedFileToResolution.delete(key); + } + const { failedLookupLocations, affectingLocations, alternateResult } = resolution; + if (resolutionsWithFailedLookups.delete(resolution)) { + let removeAtRoot = false; + if (failedLookupLocations) { + for (const failedLookupLocation of failedLookupLocations) { + removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove); + } + } + if (alternateResult) + removeAtRoot = stopWatchFailedLookupLocation(alternateResult, removeAtRoot, syncDirWatcherRemove); + if (removeAtRoot) + removeDirectoryWatcher(rootPath, syncDirWatcherRemove); + } else if (affectingLocations == null ? void 0 : affectingLocations.length) { + resolutionsWithOnlyAffectingLocations.delete(resolution); + } + if (affectingLocations) { + for (const affectingLocation of affectingLocations) { + const watcher = fileWatchesOfAffectingLocations.get(affectingLocation); + watcher.resolutions--; + if (syncDirWatcherRemove) + closeFileWatcherOfAffectingLocation(watcher, affectingLocation); + } + } + } + function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) { + const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + dirWatcher.refCount--; + if (syncDirWatcherRemove) + closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath); + } + function createDirectoryWatcher(directory, dirPath, nonRecursive) { + return resolutionHost.watchDirectoryOfFailedLookupLocation( + directory, + (fileOrDirectory) => { + const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); + }, + nonRecursive ? 0 : 1 + /* Recursive */ + ); + } + function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) { + const resolutions = cache.get(filePath); + if (resolutions) { + resolutions.forEach( + (resolution) => stopWatchFailedLookupLocationOfResolution( + resolution, + filePath, + getResolutionWithResolvedFileName, + syncDirWatcherRemove + ) + ); + cache.delete(filePath); + } + } + function removeResolutionsFromProjectReferenceRedirects(filePath) { + if (!fileExtensionIs( + filePath, + ".json" + /* Json */ + )) + return; + const program = resolutionHost.getCurrentProgram(); + if (!program) + return; + const resolvedProjectReference = program.getResolvedProjectReferenceByPath(filePath); + if (!resolvedProjectReference) + return; + resolvedProjectReference.commandLine.fileNames.forEach((f8) => removeResolutionsOfFile(resolutionHost.toPath(f8))); + } + function removeResolutionsOfFile(filePath, syncDirWatcherRemove) { + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove); + } + function invalidateResolutions(resolutions, canInvalidate) { + if (!resolutions) + return false; + let invalidated = false; + resolutions.forEach((resolution) => { + if (resolution.isInvalidated || !canInvalidate(resolution)) + return; + resolution.isInvalidated = invalidated = true; + for (const containingFilePath of Debug.checkDefined(resolution.files)) { + (filesWithInvalidatedResolutions ?? (filesWithInvalidatedResolutions = /* @__PURE__ */ new Set())).add(containingFilePath); + hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith2(containingFilePath, inferredTypesContainingFile); + } + }); + return invalidated; + } + function invalidateResolutionOfFile(filePath) { + removeResolutionsOfFile(filePath); + const prevHasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + if (invalidateResolutions(resolvedFileToResolution.get(filePath), returnTrue) && hasChangedAutomaticTypeDirectiveNames && !prevHasChangedAutomaticTypeDirectiveNames) { + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + } + } + function setFilesWithInvalidatedNonRelativeUnresolvedImports(filesMap) { + Debug.assert(filesWithInvalidatedNonRelativeUnresolvedImports === filesMap || filesWithInvalidatedNonRelativeUnresolvedImports === void 0); + filesWithInvalidatedNonRelativeUnresolvedImports = filesMap; + } + function scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) { + if (isCreatingWatchedDirectory) { + (isInDirectoryChecks || (isInDirectoryChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); + } else { + const updatedPath = removeIgnoredPath(fileOrDirectoryPath); + if (!updatedPath) + return false; + fileOrDirectoryPath = updatedPath; + if (resolutionHost.fileIsOpen(fileOrDirectoryPath)) { + return false; + } + const dirOfFileOrDirectory = getDirectoryPath(fileOrDirectoryPath); + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); + (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); + } else { + if (isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } + if (fileExtensionIs(fileOrDirectoryPath, ".map")) { + return false; + } + (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath); + const packagePath = parseNodeModuleFromPath( + fileOrDirectoryPath, + /*isFolder*/ + true + ); + if (packagePath) + (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(packagePath); + } + } + resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations(); + } + function invalidatePackageJsonMap() { + const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap(); + if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) { + packageJsonMap.forEach((_value, path2) => isInvalidatedFailedLookup(path2) ? packageJsonMap.delete(path2) : void 0); + } + } + function invalidateResolutionsOfFailedLookupLocations() { + var _a2; + if (allModuleAndTypeResolutionsAreInvalidated) { + affectingPathChecksForFile = void 0; + invalidatePackageJsonMap(); + if (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks || affectingPathChecks) { + invalidateResolutions(resolvedLibraries, canInvalidateFailedLookupResolution); + } + failedLookupChecks = void 0; + startsWithPathChecks = void 0; + isInDirectoryChecks = void 0; + affectingPathChecks = void 0; + return true; + } + let invalidated = false; + if (affectingPathChecksForFile) { + (_a2 = resolutionHost.getCurrentProgram()) == null ? void 0 : _a2.getSourceFiles().forEach((f8) => { + if (some2(f8.packageJsonLocations, (location2) => affectingPathChecksForFile.has(location2))) { + (filesWithInvalidatedResolutions ?? (filesWithInvalidatedResolutions = /* @__PURE__ */ new Set())).add(f8.path); + invalidated = true; + } + }); + affectingPathChecksForFile = void 0; + } + if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks && !affectingPathChecks) { + return invalidated; + } + invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution) || invalidated; + invalidatePackageJsonMap(); + failedLookupChecks = void 0; + startsWithPathChecks = void 0; + isInDirectoryChecks = void 0; + invalidated = invalidateResolutions(resolutionsWithOnlyAffectingLocations, canInvalidatedFailedLookupResolutionWithAffectingLocation) || invalidated; + affectingPathChecks = void 0; + return invalidated; + } + function canInvalidateFailedLookupResolution(resolution) { + var _a2; + if (canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution)) + return true; + if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks) + return false; + return ((_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location2) => isInvalidatedFailedLookup(resolutionHost.toPath(location2)))) || !!resolution.alternateResult && isInvalidatedFailedLookup(resolutionHost.toPath(resolution.alternateResult)); + } + function isInvalidatedFailedLookup(locationPath) { + return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || [], (fileOrDirectoryPath) => startsWith2(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || [], (dirPath) => locationPath.length > dirPath.length && startsWith2(locationPath, dirPath) && (isDiskPathRoot(dirPath) || locationPath[dirPath.length] === directorySeparator) ? true : void 0); + } + function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) { + var _a2; + return !!affectingPathChecks && ((_a2 = resolution.affectingLocations) == null ? void 0 : _a2.some((location2) => affectingPathChecks.has(location2))); + } + function closeTypeRootsWatch() { + clearMap(typeRootsWatches, closeFileWatcher); + } + function createTypeRootsWatch(typeRoot) { + return canWatchTypeRootPath(typeRoot) ? resolutionHost.watchTypeRootsDirectory( + typeRoot, + (fileOrDirectory) => { + const fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + hasChangedAutomaticTypeDirectiveNames = true; + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + const dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot( + typeRoot, + resolutionHost.toPath(typeRoot), + rootPath, + rootPathComponents, + getCurrentDirectory, + (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) + ); + if (dirPath) { + scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath); + } + }, + 1 + /* Recursive */ + ) : noopFileWatcher; + } + function updateTypeRootsWatch() { + const options = resolutionHost.getCompilationSettings(); + if (options.types) { + closeTypeRootsWatch(); + return; + } + const typeRoots = getEffectiveTypeRoots(options, { getCurrentDirectory }); + if (typeRoots) { + mutateMap( + typeRootsWatches, + new Set(typeRoots), + { + createNewValue: createTypeRootsWatch, + onDeleteValue: closeFileWatcher + } + ); + } else { + closeTypeRootsWatch(); + } + } + function canWatchTypeRootPath(typeRoot) { + if (resolutionHost.getCompilationSettings().typeRoots) + return true; + return canWatchAtTypes(resolutionHost.toPath(typeRoot)); + } + } + function resolutionIsSymlink(resolution) { + var _a2, _b; + return !!(((_a2 = resolution.resolvedModule) == null ? void 0 : _a2.originalPath) || ((_b = resolution.resolvedTypeReferenceDirective) == null ? void 0 : _b.originalPath)); + } + var init_resolutionCache = __esm2({ + "src/compiler/resolutionCache.ts"() { + "use strict"; + init_ts2(); + } + }); + function createDiagnosticReporter(system, pretty) { + const host = system === sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : { + getCurrentDirectory: () => system.getCurrentDirectory(), + getNewLine: () => system.newLine, + getCanonicalFileName: createGetCanonicalFileName(system.useCaseSensitiveFileNames) + }; + if (!pretty) { + return (diagnostic) => system.write(formatDiagnostic(diagnostic, host)); + } + const diagnostics = new Array(1); + return (diagnostic) => { + diagnostics[0] = diagnostic; + system.write(formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); + diagnostics[0] = void 0; + }; + } + function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { + if (system.clearScreen && !options.preserveWatchOutput && !options.extendedDiagnostics && !options.diagnostics && contains2(screenStartingMessageCodes, diagnostic.code)) { + system.clearScreen(); + return true; + } + return false; + } + function getPlainDiagnosticFollowingNewLines(diagnostic, newLine) { + return contains2(screenStartingMessageCodes, diagnostic.code) ? newLine + newLine : newLine; + } + function getLocaleTimeString(system) { + return !system.now ? (/* @__PURE__ */ new Date()).toLocaleTimeString() : ( + // On some systems / builds of Node, there's a non-breaking space between the time and AM/PM. + // This branch is solely for testing, so just switch it to a normal space for baseline stability. + // See: + // - https://github.com/nodejs/node/issues/45171 + // - https://github.com/nodejs/node/issues/45753 + system.now().toLocaleTimeString("en-US", { timeZone: "UTC" }).replace("\u202F", " ") + ); + } + function createWatchStatusReporter(system, pretty) { + return pretty ? (diagnostic, newLine, options) => { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + let output = `[${formatColorAndReset( + getLocaleTimeString(system), + "\x1B[90m" + /* Grey */ + )}] `; + output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine}`; + system.write(output); + } : (diagnostic, newLine, options) => { + let output = ""; + if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) { + output += newLine; + } + output += `${getLocaleTimeString(system)} - `; + output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`; + system.write(output); + }; + } + function parseConfigFileWithSystem(configFileName, optionsToExtend, extendedConfigCache, watchOptionsToExtend, system, reportDiagnostic) { + const host = system; + host.onUnRecoverableConfigFileDiagnostic = (diagnostic) => reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); + const result2 = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache, watchOptionsToExtend); + host.onUnRecoverableConfigFileDiagnostic = void 0; + return result2; + } + function getErrorCountForSummary(diagnostics) { + return countWhere( + diagnostics, + (diagnostic) => diagnostic.category === 1 + /* Error */ + ); + } + function getFilesInErrorForSummary(diagnostics) { + const filesInError = filter2( + diagnostics, + (diagnostic) => diagnostic.category === 1 + /* Error */ + ).map( + (errorDiagnostic) => { + if (errorDiagnostic.file === void 0) + return; + return `${errorDiagnostic.file.fileName}`; + } + ); + return filesInError.map((fileName) => { + if (fileName === void 0) { + return void 0; + } + const diagnosticForFileName = find2(diagnostics, (diagnostic) => diagnostic.file !== void 0 && diagnostic.file.fileName === fileName); + if (diagnosticForFileName !== void 0) { + const { line } = getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start); + return { + fileName, + line: line + 1 + }; + } + }); + } + function getWatchErrorSummaryDiagnosticMessage(errorCount) { + return errorCount === 1 ? Diagnostics.Found_1_error_Watching_for_file_changes : Diagnostics.Found_0_errors_Watching_for_file_changes; + } + function prettyPathForFileError(error22, cwd3) { + const line = formatColorAndReset( + ":" + error22.line, + "\x1B[90m" + /* Grey */ + ); + if (pathIsAbsolute(error22.fileName) && pathIsAbsolute(cwd3)) { + return getRelativePathFromDirectory( + cwd3, + error22.fileName, + /*ignoreCase*/ + false + ) + line; + } + return error22.fileName + line; + } + function getErrorSummaryText(errorCount, filesInError, newLine, host) { + if (errorCount === 0) + return ""; + const nonNilFiles = filesInError.filter((fileInError) => fileInError !== void 0); + const distinctFileNamesWithLines = nonNilFiles.map((fileInError) => `${fileInError.fileName}:${fileInError.line}`).filter((value2, index4, self2) => self2.indexOf(value2) === index4); + const firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory()); + let messageAndArgs; + if (errorCount === 1) { + messageAndArgs = filesInError[0] !== void 0 ? [Diagnostics.Found_1_error_in_0, firstFileReference] : [Diagnostics.Found_1_error]; + } else { + messageAndArgs = distinctFileNamesWithLines.length === 0 ? [Diagnostics.Found_0_errors, errorCount] : distinctFileNamesWithLines.length === 1 ? [Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1, errorCount, firstFileReference] : [Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length]; + } + const d7 = createCompilerDiagnostic(...messageAndArgs); + const suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : ""; + return `${newLine}${flattenDiagnosticMessageText(d7.messageText, newLine)}${newLine}${newLine}${suffix}`; + } + function createTabularErrorsDisplay(filesInError, host) { + const distinctFiles = filesInError.filter((value2, index4, self2) => index4 === self2.findIndex((file) => (file == null ? void 0 : file.fileName) === (value2 == null ? void 0 : value2.fileName))); + if (distinctFiles.length === 0) + return ""; + const numberLength = (num) => Math.log(num) * Math.LOG10E + 1; + const fileToErrorCount = distinctFiles.map((file) => [file, countWhere(filesInError, (fileInError) => fileInError.fileName === file.fileName)]); + const maxErrors = fileToErrorCount.reduce((acc, value2) => Math.max(acc, value2[1] || 0), 0); + const headerRow = Diagnostics.Errors_Files.message; + const leftColumnHeadingLength = headerRow.split(" ")[0].length; + const leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors)); + const headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0); + let tabularData = ""; + tabularData += " ".repeat(headerPadding) + headerRow + "\n"; + fileToErrorCount.forEach((row) => { + const [file, errorCount] = row; + const errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0; + const leftPadding = errorCountDigitsLength < leftPaddingGoal ? " ".repeat(leftPaddingGoal - errorCountDigitsLength) : ""; + const fileRef = prettyPathForFileError(file, host.getCurrentDirectory()); + tabularData += `${leftPadding}${errorCount} ${fileRef} +`; + }); + return tabularData; + } + function isBuilderProgram2(program) { + return !!program.getState; + } + function listFiles(program, write) { + const options = program.getCompilerOptions(); + if (options.explainFiles) { + explainFiles(isBuilderProgram2(program) ? program.getProgram() : program, write); + } else if (options.listFiles || options.listFilesOnly) { + forEach4(program.getSourceFiles(), (file) => { + write(file.fileName); + }); + } + } + function explainFiles(program, write) { + var _a2, _b; + const reasons = program.getFileIncludeReasons(); + const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName); + for (const file of program.getSourceFiles()) { + write(`${toFileName(file, relativeFileName)}`); + (_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`)); + (_b = explainIfFileIsRedirectAndImpliedFormat(file, relativeFileName)) == null ? void 0 : _b.forEach((d7) => write(` ${d7.messageText}`)); + } + } + function explainIfFileIsRedirectAndImpliedFormat(file, fileNameConvertor) { + var _a2; + let result2; + if (file.path !== file.resolvedPath) { + (result2 ?? (result2 = [])).push(chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.File_is_output_of_project_reference_source_0, + toFileName(file.originalFileName, fileNameConvertor) + )); + } + if (file.redirectInfo) { + (result2 ?? (result2 = [])).push(chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.File_redirects_to_file_0, + toFileName(file.redirectInfo.redirectTarget, fileNameConvertor) + )); + } + if (isExternalOrCommonJsModule(file)) { + switch (file.impliedNodeFormat) { + case 99: + if (file.packageJsonScope) { + (result2 ?? (result2 = [])).push(chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.File_is_ECMAScript_module_because_0_has_field_type_with_value_module, + toFileName(last2(file.packageJsonLocations), fileNameConvertor) + )); + } + break; + case 1: + if (file.packageJsonScope) { + (result2 ?? (result2 = [])).push(chainDiagnosticMessages( + /*details*/ + void 0, + file.packageJsonScope.contents.packageJsonContent.type ? Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module : Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type, + toFileName(last2(file.packageJsonLocations), fileNameConvertor) + )); + } else if ((_a2 = file.packageJsonLocations) == null ? void 0 : _a2.length) { + (result2 ?? (result2 = [])).push(chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.File_is_CommonJS_module_because_package_json_was_not_found + )); + } + break; + } + } + return result2; + } + function getMatchedFileSpec(program, fileName) { + var _a2; + const configFile = program.getCompilerOptions().configFile; + if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec)) + return void 0; + const filePath = program.getCanonicalFileName(fileName); + const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); + return find2(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath); + } + function getMatchedIncludeSpec(program, fileName) { + var _a2, _b; + const configFile = program.getCompilerOptions().configFile; + if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedIncludeSpecs)) + return void 0; + if (configFile.configFileSpecs.isDefaultIncludeSpec) + return true; + const isJsonFile = fileExtensionIs( + fileName, + ".json" + /* Json */ + ); + const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory())); + const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames(); + return find2((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => { + if (isJsonFile && !endsWith2( + includeSpec, + ".json" + /* Json */ + )) + return false; + const pattern5 = getPatternFromSpec(includeSpec, basePath, "files"); + return !!pattern5 && getRegexFromPattern(`(${pattern5})$`, useCaseSensitiveFileNames2).test(fileName); + }); + } + function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) { + var _a2, _b; + const options = program.getCompilerOptions(); + if (isReferencedFile(reason)) { + const referenceLocation = getReferencedFileLocation(program, reason); + const referenceText = isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : `"${referenceLocation.text}"`; + let message; + Debug.assert(isReferenceFileLocation(referenceLocation) || reason.kind === 3, "Only synthetic references are imports"); + switch (reason.kind) { + case 3: + if (isReferenceFileLocation(referenceLocation)) { + message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2 : Diagnostics.Imported_via_0_from_file_1; + } else if (referenceLocation.text === externalHelpersModuleNameText) { + message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions : Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions; + } else { + message = referenceLocation.packageId ? Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions : Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions; + } + break; + case 4: + Debug.assert(!referenceLocation.packageId); + message = Diagnostics.Referenced_via_0_from_file_1; + break; + case 5: + message = referenceLocation.packageId ? Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2 : Diagnostics.Type_library_referenced_via_0_from_file_1; + break; + case 7: + Debug.assert(!referenceLocation.packageId); + message = Diagnostics.Library_referenced_via_0_from_file_1; + break; + default: + Debug.assertNever(reason); + } + return chainDiagnosticMessages( + /*details*/ + void 0, + message, + referenceText, + toFileName(referenceLocation.file, fileNameConvertor), + referenceLocation.packageId && packageIdToString(referenceLocation.packageId) + ); + } + switch (reason.kind) { + case 0: + if (!((_a2 = options.configFile) == null ? void 0 : _a2.configFileSpecs)) + return chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Root_file_specified_for_compilation + ); + const fileName = getNormalizedAbsolutePath(program.getRootFileNames()[reason.index], program.getCurrentDirectory()); + const matchedByFiles = getMatchedFileSpec(program, fileName); + if (matchedByFiles) + return chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Part_of_files_list_in_tsconfig_json + ); + const matchedByInclude = getMatchedIncludeSpec(program, fileName); + return isString4(matchedByInclude) ? chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Matched_by_include_pattern_0_in_1, + matchedByInclude, + toFileName(options.configFile, fileNameConvertor) + ) : ( + // Could be additional files specified as roots or matched by default include + chainDiagnosticMessages( + /*details*/ + void 0, + matchedByInclude ? Diagnostics.Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk : Diagnostics.Root_file_specified_for_compilation + ) + ); + case 1: + case 2: + const isOutput = reason.kind === 2; + const referencedResolvedRef = Debug.checkDefined((_b = program.getResolvedProjectReferences()) == null ? void 0 : _b[reason.index]); + return chainDiagnosticMessages( + /*details*/ + void 0, + outFile(options) ? isOutput ? Diagnostics.Output_from_referenced_project_0_included_because_1_specified : Diagnostics.Source_from_referenced_project_0_included_because_1_specified : isOutput ? Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none : Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none, + toFileName(referencedResolvedRef.sourceFile.fileName, fileNameConvertor), + options.outFile ? "--outFile" : "--out" + ); + case 8: { + const messageAndArgs = options.types ? reason.packageId ? [Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] : [Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions, reason.typeReference] : reason.packageId ? [Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] : [Diagnostics.Entry_point_for_implicit_type_library_0, reason.typeReference]; + return chainDiagnosticMessages( + /*details*/ + void 0, + ...messageAndArgs + ); + } + case 6: { + if (reason.index !== void 0) + return chainDiagnosticMessages( + /*details*/ + void 0, + Diagnostics.Library_0_specified_in_compilerOptions, + options.lib[reason.index] + ); + const target = forEachEntry(targetOptionDeclaration.type, (value2, key) => value2 === getEmitScriptTarget(options) ? key : void 0); + const messageAndArgs = target ? [Diagnostics.Default_library_for_target_0, target] : [Diagnostics.Default_library]; + return chainDiagnosticMessages( + /*details*/ + void 0, + ...messageAndArgs + ); + } + default: + Debug.assertNever(reason); + } + } + function toFileName(file, fileNameConvertor) { + const fileName = isString4(file) ? file : file.fileName; + return fileNameConvertor ? fileNameConvertor(fileName) : fileName; + } + function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummary, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) { + const isListFilesOnly = !!program.getCompilerOptions().listFilesOnly; + const allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); + const configFileParsingDiagnosticsLength = allDiagnostics.length; + addRange(allDiagnostics, program.getSyntacticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + )); + if (allDiagnostics.length === configFileParsingDiagnosticsLength) { + addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken)); + if (!isListFilesOnly) { + addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken)); + if (allDiagnostics.length === configFileParsingDiagnosticsLength) { + addRange(allDiagnostics, program.getSemanticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + )); + } + } + } + const emitResult = isListFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program.emit( + /*targetSourceFile*/ + void 0, + writeFile22, + cancellationToken, + emitOnlyDtsFiles, + customTransformers + ); + const { emittedFiles, diagnostics: emitDiagnostics } = emitResult; + addRange(allDiagnostics, emitDiagnostics); + const diagnostics = sortAndDeduplicateDiagnostics(allDiagnostics); + diagnostics.forEach(reportDiagnostic); + if (write) { + const currentDir = program.getCurrentDirectory(); + forEach4(emittedFiles, (file) => { + const filepath = getNormalizedAbsolutePath(file, currentDir); + write(`TSFILE: ${filepath}`); + }); + listFiles(program, write); + } + if (reportSummary) { + reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics)); + } + return { + emitResult, + diagnostics + }; + } + function emitFilesAndReportErrorsAndGetExitStatus(program, reportDiagnostic, write, reportSummary, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) { + const { emitResult, diagnostics } = emitFilesAndReportErrors( + program, + reportDiagnostic, + write, + reportSummary, + writeFile22, + cancellationToken, + emitOnlyDtsFiles, + customTransformers + ); + if (emitResult.emitSkipped && diagnostics.length > 0) { + return 1; + } else if (diagnostics.length > 0) { + return 2; + } + return 0; + } + function createWatchHost(system = sys, reportWatchStatus2) { + const onWatchStatusChange = reportWatchStatus2 || createWatchStatusReporter(system); + return { + onWatchStatusChange, + watchFile: maybeBind(system, system.watchFile) || returnNoopFileWatcher, + watchDirectory: maybeBind(system, system.watchDirectory) || returnNoopFileWatcher, + setTimeout: maybeBind(system, system.setTimeout) || noop4, + clearTimeout: maybeBind(system, system.clearTimeout) || noop4 + }; + } + function createWatchFactory(host, options) { + const watchLogLevel = host.trace ? options.extendedDiagnostics ? 2 : options.diagnostics ? 1 : 0 : 0; + const writeLog = watchLogLevel !== 0 ? (s7) => host.trace(s7) : noop4; + const result2 = getWatchFactory(host, watchLogLevel, writeLog); + result2.writeLog = writeLog; + return result2; + } + function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) { + const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames(); + const compilerHost = { + getSourceFile: createGetSourceFile( + (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding), + getCompilerOptions, + /*setParentNodes*/ + void 0 + ), + getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation), + getDefaultLibFileName: (options) => host.getDefaultLibFileName(options), + writeFile: createWriteFileMeasuringIO( + (path2, data, writeByteOrderMark) => host.writeFile(path2, data, writeByteOrderMark), + (path2) => host.createDirectory(path2), + (path2) => host.directoryExists(path2) + ), + getCurrentDirectory: memoize2(() => host.getCurrentDirectory()), + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, + getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2), + getNewLine: () => getNewLineCharacter(getCompilerOptions()), + fileExists: (f8) => host.fileExists(f8), + readFile: (f8) => host.readFile(f8), + trace: maybeBind(host, host.trace), + directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists), + getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories), + realpath: maybeBind(host, host.realpath), + getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""), + createHash: maybeBind(host, host.createHash), + readDirectory: maybeBind(host, host.readDirectory), + storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit, + jsDocParsingMode: host.jsDocParsingMode + }; + return compilerHost; + } + function getSourceFileVersionAsHashFromText(host, text) { + if (text.match(sourceMapCommentRegExpDontCareLineStart)) { + let lineEnd = text.length; + let lineStart = lineEnd; + for (let pos = lineEnd - 1; pos >= 0; pos--) { + const ch = text.charCodeAt(pos); + switch (ch) { + case 10: + if (pos && text.charCodeAt(pos - 1) === 13) { + pos--; + } + case 13: + break; + default: + if (ch < 127 || !isLineBreak2(ch)) { + lineStart = pos; + continue; + } + break; + } + const line = text.substring(lineStart, lineEnd); + if (line.match(sourceMapCommentRegExp)) { + text = text.substring(0, lineStart); + break; + } else if (!line.match(whitespaceOrMapCommentRegExp)) { + break; + } + lineEnd = lineStart; + } + } + return (host.createHash || generateDjb2Hash)(text); + } + function setGetSourceFileAsHashVersioned(compilerHost) { + const originalGetSourceFile = compilerHost.getSourceFile; + compilerHost.getSourceFile = (...args) => { + const result2 = originalGetSourceFile.call(compilerHost, ...args); + if (result2) { + result2.version = getSourceFileVersionAsHashFromText(compilerHost, result2.text); + } + return result2; + }; + } + function createProgramHost(system, createProgram2) { + const getDefaultLibLocation = memoize2(() => getDirectoryPath(normalizePath(system.getExecutingFilePath()))); + return { + useCaseSensitiveFileNames: () => system.useCaseSensitiveFileNames, + getNewLine: () => system.newLine, + getCurrentDirectory: memoize2(() => system.getCurrentDirectory()), + getDefaultLibLocation, + getDefaultLibFileName: (options) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options)), + fileExists: (path2) => system.fileExists(path2), + readFile: (path2, encoding) => system.readFile(path2, encoding), + directoryExists: (path2) => system.directoryExists(path2), + getDirectories: (path2) => system.getDirectories(path2), + readDirectory: (path2, extensions6, exclude, include, depth) => system.readDirectory(path2, extensions6, exclude, include, depth), + realpath: maybeBind(system, system.realpath), + getEnvironmentVariable: maybeBind(system, system.getEnvironmentVariable), + trace: (s7) => system.write(s7 + system.newLine), + createDirectory: (path2) => system.createDirectory(path2), + writeFile: (path2, data, writeByteOrderMark) => system.writeFile(path2, data, writeByteOrderMark), + createHash: maybeBind(system, system.createHash), + createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram, + storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit, + now: maybeBind(system, system.now) + }; + } + function createWatchCompilerHost(system = sys, createProgram2, reportDiagnostic, reportWatchStatus2) { + const write = (s7) => system.write(s7 + system.newLine); + const result2 = createProgramHost(system, createProgram2); + copyProperties(result2, createWatchHost(system, reportWatchStatus2)); + result2.afterProgramCreate = (builderProgram) => { + const compilerOptions = builderProgram.getCompilerOptions(); + const newLine = getNewLineCharacter(compilerOptions); + emitFilesAndReportErrors( + builderProgram, + reportDiagnostic, + write, + (errorCount) => result2.onWatchStatusChange( + createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount), + newLine, + compilerOptions, + errorCount + ) + ); + }; + return result2; + } + function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { + reportDiagnostic(diagnostic); + system.exit( + 1 + /* DiagnosticsPresent_OutputsSkipped */ + ); + } + function createWatchCompilerHostOfConfigFile({ + configFileName, + optionsToExtend, + watchOptionsToExtend, + extraFileExtensions, + system, + createProgram: createProgram2, + reportDiagnostic, + reportWatchStatus: reportWatchStatus2 + }) { + const diagnosticReporter = reportDiagnostic || createDiagnosticReporter(system); + const host = createWatchCompilerHost(system, createProgram2, diagnosticReporter, reportWatchStatus2); + host.onUnRecoverableConfigFileDiagnostic = (diagnostic) => reportUnrecoverableDiagnostic(system, diagnosticReporter, diagnostic); + host.configFileName = configFileName; + host.optionsToExtend = optionsToExtend; + host.watchOptionsToExtend = watchOptionsToExtend; + host.extraFileExtensions = extraFileExtensions; + return host; + } + function createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles, + options, + watchOptions, + projectReferences, + system, + createProgram: createProgram2, + reportDiagnostic, + reportWatchStatus: reportWatchStatus2 + }) { + const host = createWatchCompilerHost(system, createProgram2, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus2); + host.rootFiles = rootFiles; + host.options = options; + host.watchOptions = watchOptions; + host.projectReferences = projectReferences; + return host; + } + function performIncrementalCompilation(input) { + const system = input.system || sys; + const host = input.host || (input.host = createIncrementalCompilerHost(input.options, system)); + const builderProgram = createIncrementalProgram(input); + const exitStatus = emitFilesAndReportErrorsAndGetExitStatus( + builderProgram, + input.reportDiagnostic || createDiagnosticReporter(system), + (s7) => host.trace && host.trace(s7), + input.reportErrorSummary || input.options.pretty ? (errorCount, filesInError) => system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)) : void 0 + ); + if (input.afterProgramEmitAndDiagnostics) + input.afterProgramEmitAndDiagnostics(builderProgram); + return exitStatus; + } + var sysFormatDiagnosticsHost, screenStartingMessageCodes, noopFileWatcher, returnNoopFileWatcher, WatchType; + var init_watch = __esm2({ + "src/compiler/watch.ts"() { + "use strict"; + init_ts2(); + sysFormatDiagnosticsHost = sys ? { + getCurrentDirectory: () => sys.getCurrentDirectory(), + getNewLine: () => sys.newLine, + getCanonicalFileName: createGetCanonicalFileName(sys.useCaseSensitiveFileNames) + } : void 0; + screenStartingMessageCodes = [ + Diagnostics.Starting_compilation_in_watch_mode.code, + Diagnostics.File_change_detected_Starting_incremental_compilation.code + ]; + noopFileWatcher = { close: noop4 }; + returnNoopFileWatcher = () => noopFileWatcher; + WatchType = { + ConfigFile: "Config file", + ExtendedConfigFile: "Extended config file", + SourceFile: "Source file", + MissingFile: "Missing file", + WildcardDirectory: "Wild card directory", + FailedLookupLocations: "Failed Lookup Locations", + AffectingFileLocation: "File location affecting resolution", + TypeRoots: "Type roots", + ConfigFileOfReferencedProject: "Config file of referened project", + ExtendedConfigOfReferencedProject: "Extended config file of referenced project", + WildcardDirectoryOfReferencedProject: "Wild card directory of referenced project", + PackageJson: "package.json file", + ClosedScriptInfo: "Closed Script info", + ConfigFileForInferredRoot: "Config file for the inferred project root", + NodeModules: "node_modules for closed script infos and package.jsons affecting module specifier cache", + MissingSourceMapFile: "Missing source map file", + NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root", + MissingGeneratedFile: "Missing generated file", + NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation", + TypingInstallerLocationFile: "File location for typing installer", + TypingInstallerLocationDirectory: "Directory location for typing installer" + }; + } + }); + function readBuilderProgram(compilerOptions, host) { + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(compilerOptions); + if (!buildInfoPath) + return void 0; + let buildInfo; + if (host.getBuildInfo) { + buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath); + } else { + const content = host.readFile(buildInfoPath); + if (!content) + return void 0; + buildInfo = getBuildInfo(buildInfoPath, content); + } + if (!buildInfo || buildInfo.version !== version5 || !buildInfo.program) + return void 0; + return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host); + } + function createIncrementalCompilerHost(options, system = sys) { + const host = createCompilerHostWorker( + options, + /*setParentNodes*/ + void 0, + system + ); + host.createHash = maybeBind(system, system.createHash); + host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit; + setGetSourceFileAsHashVersioned(host); + changeCompilerHostLikeToUseCache(host, (fileName) => toPath2(fileName, host.getCurrentDirectory(), host.getCanonicalFileName)); + return host; + } + function createIncrementalProgram({ + rootNames, + options, + configFileParsingDiagnostics, + projectReferences, + host, + createProgram: createProgram2 + }) { + host = host || createIncrementalCompilerHost(options); + createProgram2 = createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram; + const oldProgram = readBuilderProgram(options, host); + return createProgram2(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences); + } + function createWatchCompilerHost2(rootFilesOrConfigFileName, options, system, createProgram2, reportDiagnostic, reportWatchStatus2, projectReferencesOrWatchOptionsToExtend, watchOptionsOrExtraFileExtensions) { + if (isArray3(rootFilesOrConfigFileName)) { + return createWatchCompilerHostOfFilesAndCompilerOptions({ + rootFiles: rootFilesOrConfigFileName, + options, + watchOptions: watchOptionsOrExtraFileExtensions, + projectReferences: projectReferencesOrWatchOptionsToExtend, + system, + createProgram: createProgram2, + reportDiagnostic, + reportWatchStatus: reportWatchStatus2 + }); + } else { + return createWatchCompilerHostOfConfigFile({ + configFileName: rootFilesOrConfigFileName, + optionsToExtend: options, + watchOptionsToExtend: projectReferencesOrWatchOptionsToExtend, + extraFileExtensions: watchOptionsOrExtraFileExtensions, + system, + createProgram: createProgram2, + reportDiagnostic, + reportWatchStatus: reportWatchStatus2 + }); + } + } + function createWatchProgram(host) { + let builderProgram; + let updateLevel; + let missingFilesMap; + let watchedWildcardDirectories; + let timerToUpdateProgram; + let timerToInvalidateFailedLookupResolutions; + let parsedConfigs; + let sharedExtendedConfigFileWatchers; + let extendedConfigCache = host.extendedConfigCache; + let reportFileChangeDetectedOnCreateProgram = false; + const sourceFilesCache = /* @__PURE__ */ new Map(); + let missingFilePathsRequestedForRelease; + let hasChangedCompilerOptions = false; + const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames(); + const currentDirectory = host.getCurrentDirectory(); + const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host; + let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host; + let wildcardDirectories; + let configFileParsingDiagnostics; + let canConfigFileJsonReportNoInputFiles = false; + let hasChangedConfigFileParsingErrors = false; + const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2); + const directoryStructureHost = cachedDirectoryStructureHost || host; + const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost); + let newLine = updateNewLine(); + if (configFileName && host.configFileParsingResult) { + setConfigFileParsingResult(host.configFileParsingResult); + newLine = updateNewLine(); + } + reportWatchDiagnostic(Diagnostics.Starting_compilation_in_watch_mode); + if (configFileName && !host.configFileParsingResult) { + newLine = getNewLineCharacter(optionsToExtendForConfigFile); + Debug.assert(!rootFileNames); + parseConfigFile2(); + newLine = updateNewLine(); + } + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); + const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`); + let configFileWatcher; + if (configFileName) { + configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3, watchOptions, WatchType.ConfigFile); + } + const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost); + setGetSourceFileAsHashVersioned(compilerHost); + const getNewSourceFile = compilerHost.getSourceFile; + compilerHost.getSourceFile = (fileName, ...args) => getVersionedSourceFileByPath(fileName, toPath3(fileName), ...args); + compilerHost.getSourceFileByPath = getVersionedSourceFileByPath; + compilerHost.getNewLine = () => newLine; + compilerHost.fileExists = fileExists; + compilerHost.onReleaseOldSourceFile = onReleaseOldSourceFile; + compilerHost.onReleaseParsedCommandLine = onReleaseParsedCommandLine; + compilerHost.toPath = toPath3; + compilerHost.getCompilationSettings = () => compilerOptions; + compilerHost.useSourceOfProjectReferenceRedirect = maybeBind(host, host.useSourceOfProjectReferenceRedirect); + compilerHost.watchDirectoryOfFailedLookupLocation = (dir2, cb, flags) => watchDirectory(dir2, cb, flags, watchOptions, WatchType.FailedLookupLocations); + compilerHost.watchAffectingFileLocation = (file, cb) => watchFile2(file, cb, 2e3, watchOptions, WatchType.AffectingFileLocation); + compilerHost.watchTypeRootsDirectory = (dir2, cb, flags) => watchDirectory(dir2, cb, flags, watchOptions, WatchType.TypeRoots); + compilerHost.getCachedDirectoryStructureHost = () => cachedDirectoryStructureHost; + compilerHost.scheduleInvalidateResolutionsOfFailedLookupLocations = scheduleInvalidateResolutionsOfFailedLookupLocations; + compilerHost.onInvalidatedResolution = scheduleProgramUpdate; + compilerHost.onChangedAutomaticTypeDirectiveNames = scheduleProgramUpdate; + compilerHost.fileIsOpen = returnFalse; + compilerHost.getCurrentProgram = getCurrentProgram; + compilerHost.writeLog = writeLog; + compilerHost.getParsedCommandLine = getParsedCommandLine; + const resolutionCache = createResolutionCache( + compilerHost, + configFileName ? getDirectoryPath(getNormalizedAbsolutePath(configFileName, currentDirectory)) : currentDirectory, + /*logChangesWhenResolvingModule*/ + false + ); + compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); + compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); + if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) { + compilerHost.resolveModuleNameLiterals = resolutionCache.resolveModuleNameLiterals.bind(resolutionCache); + } + compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); + compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); + if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) { + compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache); + } + compilerHost.resolveLibrary = !host.resolveLibrary ? resolutionCache.resolveLibrary.bind(resolutionCache) : host.resolveLibrary.bind(host); + compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : () => resolutionCache.getModuleResolutionCache(); + const userProvidedResolution = !!host.resolveModuleNameLiterals || !!host.resolveTypeReferenceDirectiveReferences || !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; + const customHasInvalidatedResolutions = userProvidedResolution ? maybeBind(host, host.hasInvalidatedResolutions) || returnTrue : returnFalse; + const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse; + builderProgram = readBuilderProgram(compilerOptions, compilerHost); + synchronizeProgram(); + watchConfigFileWildCardDirectories(); + if (configFileName) + updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); + return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache }; + function close() { + clearInvalidateResolutionsOfFailedLookupLocations(); + resolutionCache.clear(); + clearMap(sourceFilesCache, (value2) => { + if (value2 && value2.fileWatcher) { + value2.fileWatcher.close(); + value2.fileWatcher = void 0; + } + }); + if (configFileWatcher) { + configFileWatcher.close(); + configFileWatcher = void 0; + } + extendedConfigCache == null ? void 0 : extendedConfigCache.clear(); + extendedConfigCache = void 0; + if (sharedExtendedConfigFileWatchers) { + clearMap(sharedExtendedConfigFileWatchers, closeFileWatcherOf); + sharedExtendedConfigFileWatchers = void 0; + } + if (watchedWildcardDirectories) { + clearMap(watchedWildcardDirectories, closeFileWatcherOf); + watchedWildcardDirectories = void 0; + } + if (missingFilesMap) { + clearMap(missingFilesMap, closeFileWatcher); + missingFilesMap = void 0; + } + if (parsedConfigs) { + clearMap(parsedConfigs, (config3) => { + var _a2; + (_a2 = config3.watcher) == null ? void 0 : _a2.close(); + config3.watcher = void 0; + if (config3.watchedDirectories) + clearMap(config3.watchedDirectories, closeFileWatcherOf); + config3.watchedDirectories = void 0; + }); + parsedConfigs = void 0; + } + } + function getResolutionCache() { + return resolutionCache; + } + function getCurrentBuilderProgram() { + return builderProgram; + } + function getCurrentProgram() { + return builderProgram && builderProgram.getProgramOrUndefined(); + } + function synchronizeProgram() { + writeLog(`Synchronizing program`); + Debug.assert(compilerOptions); + Debug.assert(rootFileNames); + clearInvalidateResolutionsOfFailedLookupLocations(); + const program = getCurrentBuilderProgram(); + if (hasChangedCompilerOptions) { + newLine = updateNewLine(); + if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { + resolutionCache.onChangesAffectModuleResolution(); + } + } + const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions, customHasInvalidLibResolutions); + const { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + readFileWithCache + } = changeCompilerHostLikeToUseCache(compilerHost, toPath3); + if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, (path2) => getSourceVersion(path2, readFileWithCache), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { + if (hasChangedConfigFileParsingErrors) { + if (reportFileChangeDetectedOnCreateProgram) { + reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation); + } + builderProgram = createProgram2( + /*rootNames*/ + void 0, + /*options*/ + void 0, + compilerHost, + builderProgram, + configFileParsingDiagnostics, + projectReferences + ); + hasChangedConfigFileParsingErrors = false; + } + } else { + if (reportFileChangeDetectedOnCreateProgram) { + reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation); + } + createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions); + } + reportFileChangeDetectedOnCreateProgram = false; + if (host.afterProgramCreate && program !== builderProgram) { + host.afterProgramCreate(builderProgram); + } + compilerHost.readFile = originalReadFile; + compilerHost.fileExists = originalFileExists; + compilerHost.directoryExists = originalDirectoryExists; + compilerHost.createDirectory = originalCreateDirectory; + compilerHost.writeFile = originalWriteFile; + return builderProgram; + } + function createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions) { + writeLog("CreatingProgramWith::"); + writeLog(` roots: ${JSON.stringify(rootFileNames)}`); + writeLog(` options: ${JSON.stringify(compilerOptions)}`); + if (projectReferences) + writeLog(` projectReferences: ${JSON.stringify(projectReferences)}`); + const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram(); + hasChangedCompilerOptions = false; + hasChangedConfigFileParsingErrors = false; + resolutionCache.startCachingPerDirectoryResolution(); + compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions; + compilerHost.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions; + compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + const oldProgram = getCurrentProgram(); + builderProgram = createProgram2(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); + resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram); + updateMissingFilePathsWatch( + builderProgram.getProgram(), + missingFilesMap || (missingFilesMap = /* @__PURE__ */ new Map()), + watchMissingFilePath + ); + if (needsUpdateInTypeRootWatch) { + resolutionCache.updateTypeRootsWatch(); + } + if (missingFilePathsRequestedForRelease) { + for (const missingFilePath of missingFilePathsRequestedForRelease) { + if (!missingFilesMap.has(missingFilePath)) { + sourceFilesCache.delete(missingFilePath); + } + } + missingFilePathsRequestedForRelease = void 0; + } + } + function updateRootFileNames(files) { + Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); + rootFileNames = files; + scheduleProgramUpdate(); + } + function updateNewLine() { + return getNewLineCharacter(compilerOptions || optionsToExtendForConfigFile); + } + function toPath3(fileName) { + return toPath2(fileName, currentDirectory, getCanonicalFileName); + } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "boolean"; + } + function isFilePresenceUnknownOnHost(hostSourceFile) { + return typeof hostSourceFile.version === "boolean"; + } + function fileExists(fileName) { + const path2 = toPath3(fileName); + if (isFileMissingOnHost(sourceFilesCache.get(path2))) { + return false; + } + return directoryStructureHost.fileExists(fileName); + } + function getVersionedSourceFileByPath(fileName, path2, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { + const hostSourceFile = sourceFilesCache.get(path2); + if (isFileMissingOnHost(hostSourceFile)) { + return void 0; + } + const impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : void 0; + if (hostSourceFile === void 0 || shouldCreateNewSourceFile || isFilePresenceUnknownOnHost(hostSourceFile) || hostSourceFile.sourceFile.impliedNodeFormat !== impliedNodeFormat) { + const sourceFile = getNewSourceFile(fileName, languageVersionOrOptions, onError); + if (hostSourceFile) { + if (sourceFile) { + hostSourceFile.sourceFile = sourceFile; + hostSourceFile.version = sourceFile.version; + if (!hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher = watchFilePath(path2, fileName, onSourceFileChange, 250, watchOptions, WatchType.SourceFile); + } + } else { + if (hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path2, false); + } + } else { + if (sourceFile) { + const fileWatcher = watchFilePath(path2, fileName, onSourceFileChange, 250, watchOptions, WatchType.SourceFile); + sourceFilesCache.set(path2, { sourceFile, version: sourceFile.version, fileWatcher }); + } else { + sourceFilesCache.set(path2, false); + } + } + return sourceFile; + } + return hostSourceFile.sourceFile; + } + function nextSourceFileVersion(path2) { + const hostSourceFile = sourceFilesCache.get(path2); + if (hostSourceFile !== void 0) { + if (isFileMissingOnHost(hostSourceFile)) { + sourceFilesCache.set(path2, { version: false }); + } else { + hostSourceFile.version = false; + } + } + } + function getSourceVersion(path2, readFileWithCache) { + const hostSourceFile = sourceFilesCache.get(path2); + if (!hostSourceFile) + return void 0; + if (hostSourceFile.version) + return hostSourceFile.version; + const text = readFileWithCache(path2); + return text !== void 0 ? getSourceFileVersionAsHashFromText(compilerHost, text) : void 0; + } + function onReleaseOldSourceFile(oldSourceFile, _oldOptions, hasSourceFileByPath) { + const hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.resolvedPath); + if (hostSourceFileInfo !== void 0) { + if (isFileMissingOnHost(hostSourceFileInfo)) { + (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); + } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + if (hostSourceFileInfo.fileWatcher) { + hostSourceFileInfo.fileWatcher.close(); + } + sourceFilesCache.delete(oldSourceFile.resolvedPath); + if (!hasSourceFileByPath) { + resolutionCache.removeResolutionsOfFile(oldSourceFile.path); + } + } + } + } + function reportWatchDiagnostic(message) { + if (host.onWatchStatusChange) { + host.onWatchStatusChange(createCompilerDiagnostic(message), newLine, compilerOptions || optionsToExtendForConfigFile); + } + } + function hasChangedAutomaticTypeDirectiveNames() { + return resolutionCache.hasChangedAutomaticTypeDirectiveNames(); + } + function clearInvalidateResolutionsOfFailedLookupLocations() { + if (!timerToInvalidateFailedLookupResolutions) + return false; + host.clearTimeout(timerToInvalidateFailedLookupResolutions); + timerToInvalidateFailedLookupResolutions = void 0; + return true; + } + function scheduleInvalidateResolutionsOfFailedLookupLocations() { + if (!host.setTimeout || !host.clearTimeout) { + return resolutionCache.invalidateResolutionsOfFailedLookupLocations(); + } + const pending = clearInvalidateResolutionsOfFailedLookupLocations(); + writeLog(`Scheduling invalidateFailedLookup${pending ? ", Cancelled earlier one" : ""}`); + timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250, "timerToInvalidateFailedLookupResolutions"); + } + function invalidateResolutionsOfFailedLookup() { + timerToInvalidateFailedLookupResolutions = void 0; + if (resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + scheduleProgramUpdate(); + } + } + function scheduleProgramUpdate() { + if (!host.setTimeout || !host.clearTimeout) { + return; + } + if (timerToUpdateProgram) { + host.clearTimeout(timerToUpdateProgram); + } + writeLog("Scheduling update"); + timerToUpdateProgram = host.setTimeout(updateProgramWithWatchStatus, 250, "timerToUpdateProgram"); + } + function scheduleProgramReload() { + Debug.assert(!!configFileName); + updateLevel = 2; + scheduleProgramUpdate(); + } + function updateProgramWithWatchStatus() { + timerToUpdateProgram = void 0; + reportFileChangeDetectedOnCreateProgram = true; + updateProgram(); + } + function updateProgram() { + var _a2, _b, _c, _d; + switch (updateLevel) { + case 1: + (_a2 = perfLogger) == null ? void 0 : _a2.logStartUpdateProgram("PartialConfigReload"); + reloadFileNamesFromConfigFile(); + break; + case 2: + (_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload"); + reloadConfigFile(); + break; + default: + (_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram"); + synchronizeProgram(); + break; + } + (_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done"); + return getCurrentBuilderProgram(); + } + function reloadFileNamesFromConfigFile() { + writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + Debug.assert(configFileName); + updateLevel = 0; + rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions); + if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) { + hasChangedConfigFileParsingErrors = true; + } + synchronizeProgram(); + } + function reloadConfigFile() { + Debug.assert(configFileName); + writeLog(`Reloading config file: ${configFileName}`); + updateLevel = 0; + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.clearCache(); + } + parseConfigFile2(); + hasChangedCompilerOptions = true; + synchronizeProgram(); + watchConfigFileWildCardDirectories(); + updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile); + } + function parseConfigFile2() { + Debug.assert(configFileName); + setConfigFileParsingResult( + getParsedCommandLineOfConfigFile( + configFileName, + optionsToExtendForConfigFile, + parseConfigFileHost, + extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), + watchOptionsToExtend, + extraFileExtensions + ) + ); + } + function setConfigFileParsingResult(configFileParseResult) { + rootFileNames = configFileParseResult.fileNames; + compilerOptions = configFileParseResult.options; + watchOptions = configFileParseResult.watchOptions; + projectReferences = configFileParseResult.projectReferences; + wildcardDirectories = configFileParseResult.wildcardDirectories; + configFileParsingDiagnostics = getConfigFileParsingDiagnostics(configFileParseResult).slice(); + canConfigFileJsonReportNoInputFiles = canJsonReportNoInputFiles(configFileParseResult.raw); + hasChangedConfigFileParsingErrors = true; + } + function getParsedCommandLine(configFileName2) { + const configPath = toPath3(configFileName2); + let config3 = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); + if (config3) { + if (!config3.updateLevel) + return config3.parsedCommandLine; + if (config3.parsedCommandLine && config3.updateLevel === 1 && !host.getParsedCommandLine) { + writeLog("Reloading new file names and options"); + Debug.assert(compilerOptions); + const fileNames = getFileNamesFromConfigSpecs( + config3.parsedCommandLine.options.configFile.configFileSpecs, + getNormalizedAbsolutePath(getDirectoryPath(configFileName2), currentDirectory), + compilerOptions, + parseConfigFileHost + ); + config3.parsedCommandLine = { ...config3.parsedCommandLine, fileNames }; + config3.updateLevel = void 0; + return config3.parsedCommandLine; + } + } + writeLog(`Loading config file: ${configFileName2}`); + const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2); + if (config3) { + config3.parsedCommandLine = parsedCommandLine; + config3.updateLevel = void 0; + } else { + (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config3 = { parsedCommandLine }); + } + watchReferencedProject(configFileName2, configPath, config3); + return parsedCommandLine; + } + function getParsedCommandLineFromConfigFileHost(configFileName2) { + const onUnRecoverableConfigFileDiagnostic = parseConfigFileHost.onUnRecoverableConfigFileDiagnostic; + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop4; + const parsedCommandLine = getParsedCommandLineOfConfigFile( + configFileName2, + /*optionsToExtend*/ + void 0, + parseConfigFileHost, + extendedConfigCache || (extendedConfigCache = /* @__PURE__ */ new Map()), + watchOptionsToExtend + ); + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = onUnRecoverableConfigFileDiagnostic; + return parsedCommandLine; + } + function onReleaseParsedCommandLine(fileName) { + var _a2; + const path2 = toPath3(fileName); + const config3 = parsedConfigs == null ? void 0 : parsedConfigs.get(path2); + if (!config3) + return; + parsedConfigs.delete(path2); + if (config3.watchedDirectories) + clearMap(config3.watchedDirectories, closeFileWatcherOf); + (_a2 = config3.watcher) == null ? void 0 : _a2.close(); + clearSharedExtendedConfigFileWatcher(path2, sharedExtendedConfigFileWatchers); + } + function watchFilePath(path2, file, callback, pollingInterval, options, watchType) { + return watchFile2(file, (fileName, eventKind) => callback(fileName, eventKind, path2), pollingInterval, options, watchType); + } + function onSourceFileChange(fileName, eventKind, path2) { + updateCachedSystemWithFile(fileName, path2, eventKind); + if (eventKind === 2 && sourceFilesCache.has(path2)) { + resolutionCache.invalidateResolutionOfFile(path2); + } + nextSourceFileVersion(path2); + scheduleProgramUpdate(); + } + function updateCachedSystemWithFile(fileName, path2, eventKind) { + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFile(fileName, path2, eventKind); + } + } + function watchMissingFilePath(missingFilePath, missingFileName) { + return (parsedConfigs == null ? void 0 : parsedConfigs.has(missingFilePath)) ? noopFileWatcher : watchFilePath( + missingFilePath, + missingFileName, + onMissingFileChange, + 500, + watchOptions, + WatchType.MissingFile + ); + } + function onMissingFileChange(fileName, eventKind, missingFilePath) { + updateCachedSystemWithFile(fileName, missingFilePath, eventKind); + if (eventKind === 0 && missingFilesMap.has(missingFilePath)) { + missingFilesMap.get(missingFilePath).close(); + missingFilesMap.delete(missingFilePath); + nextSourceFileVersion(missingFilePath); + scheduleProgramUpdate(); + } + } + function watchConfigFileWildCardDirectories() { + updateWatchingWildcardDirectories( + watchedWildcardDirectories || (watchedWildcardDirectories = /* @__PURE__ */ new Map()), + wildcardDirectories, + watchWildcardDirectory + ); + } + function watchWildcardDirectory(directory, flags) { + return watchDirectory( + directory, + (fileOrDirectory) => { + Debug.assert(configFileName); + Debug.assert(compilerOptions); + const fileOrDirectoryPath = toPath3(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + if (isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath3(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName, + extraFileExtensions, + options: compilerOptions, + program: getCurrentBuilderProgram() || rootFileNames, + currentDirectory, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + writeLog, + toPath: toPath3 + })) + return; + if (updateLevel !== 2) { + updateLevel = 1; + scheduleProgramUpdate(); + } + }, + flags, + watchOptions, + WatchType.WildcardDirectory + ); + } + function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) { + updateSharedExtendedConfigFileWatcher( + forProjectPath, + options, + sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map()), + (extendedConfigFileName, extendedConfigFilePath) => watchFile2( + extendedConfigFileName, + (_fileName, eventKind) => { + var _a2; + updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind); + if (extendedConfigCache) + cleanExtendedConfigCache(extendedConfigCache, extendedConfigFilePath, toPath3); + const projects = (_a2 = sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) == null ? void 0 : _a2.projects; + if (!(projects == null ? void 0 : projects.size)) + return; + projects.forEach((projectPath) => { + if (configFileName && toPath3(configFileName) === projectPath) { + updateLevel = 2; + } else { + const config3 = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath); + if (config3) + config3.updateLevel = 2; + resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath); + } + scheduleProgramUpdate(); + }); + }, + 2e3, + watchOptions2, + watchType + ), + toPath3 + ); + } + function watchReferencedProject(configFileName2, configPath, commandLine) { + var _a2, _b, _c, _d; + commandLine.watcher || (commandLine.watcher = watchFile2( + configFileName2, + (_fileName, eventKind) => { + updateCachedSystemWithFile(configFileName2, configPath, eventKind); + const config3 = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); + if (config3) + config3.updateLevel = 2; + resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath); + scheduleProgramUpdate(); + }, + 2e3, + ((_a2 = commandLine.parsedCommandLine) == null ? void 0 : _a2.watchOptions) || watchOptions, + WatchType.ConfigFileOfReferencedProject + )); + updateWatchingWildcardDirectories( + commandLine.watchedDirectories || (commandLine.watchedDirectories = /* @__PURE__ */ new Map()), + (_b = commandLine.parsedCommandLine) == null ? void 0 : _b.wildcardDirectories, + (directory, flags) => { + var _a22; + return watchDirectory( + directory, + (fileOrDirectory) => { + const fileOrDirectoryPath = toPath3(fileOrDirectory); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + const config3 = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath); + if (!(config3 == null ? void 0 : config3.parsedCommandLine)) + return; + if (isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath3(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName: configFileName2, + options: config3.parsedCommandLine.options, + program: config3.parsedCommandLine.fileNames, + currentDirectory, + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + writeLog, + toPath: toPath3 + })) + return; + if (config3.updateLevel !== 2) { + config3.updateLevel = 1; + scheduleProgramUpdate(); + } + }, + flags, + ((_a22 = commandLine.parsedCommandLine) == null ? void 0 : _a22.watchOptions) || watchOptions, + WatchType.WildcardDirectoryOfReferencedProject + ); + } + ); + updateExtendedConfigFilesWatches( + configPath, + (_c = commandLine.parsedCommandLine) == null ? void 0 : _c.options, + ((_d = commandLine.parsedCommandLine) == null ? void 0 : _d.watchOptions) || watchOptions, + WatchType.ExtendedConfigOfReferencedProject + ); + } + } + var init_watchPublic = __esm2({ + "src/compiler/watchPublic.ts"() { + "use strict"; + init_ts2(); + } + }); + function resolveConfigFileProjectName(project) { + if (fileExtensionIs( + project, + ".json" + /* Json */ + )) { + return project; + } + return combinePaths(project, "tsconfig.json"); + } + var UpToDateStatusType; + var init_tsbuild = __esm2({ + "src/compiler/tsbuild.ts"() { + "use strict"; + init_ts2(); + UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => { + UpToDateStatusType2[UpToDateStatusType2["Unbuildable"] = 0] = "Unbuildable"; + UpToDateStatusType2[UpToDateStatusType2["UpToDate"] = 1] = "UpToDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithUpstreamTypes"] = 2] = "UpToDateWithUpstreamTypes"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithPrepend"] = 3] = "OutOfDateWithPrepend"; + UpToDateStatusType2[UpToDateStatusType2["OutputMissing"] = 4] = "OutputMissing"; + UpToDateStatusType2[UpToDateStatusType2["ErrorReadingFile"] = 5] = "ErrorReadingFile"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithSelf"] = 6] = "OutOfDateWithSelf"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions"; + UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked"; + UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream"; + UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate"; + UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText"; + UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly"; + UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild"; + return UpToDateStatusType2; + })(UpToDateStatusType || {}); + } + }); + function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) { + const existingValue = configFileMap.get(resolved); + let newValue; + if (!existingValue) { + newValue = createT(); + configFileMap.set(resolved, newValue); + } + return existingValue || newValue; + } + function getOrCreateValueMapFromConfigFileMap(configFileMap, resolved) { + return getOrCreateValueFromConfigFileMap(configFileMap, resolved, () => /* @__PURE__ */ new Map()); + } + function getCurrentTime(host) { + return host.now ? host.now() : /* @__PURE__ */ new Date(); + } + function isCircularBuildOrder(buildOrder) { + return !!buildOrder && !!buildOrder.buildOrder; + } + function getBuildOrderFromAnyBuildOrder(anyBuildOrder) { + return isCircularBuildOrder(anyBuildOrder) ? anyBuildOrder.buildOrder : anyBuildOrder; + } + function createBuilderStatusReporter(system, pretty) { + return (diagnostic) => { + let output = pretty ? `[${formatColorAndReset( + getLocaleTimeString(system), + "\x1B[90m" + /* Grey */ + )}] ` : `${getLocaleTimeString(system)} - `; + output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${system.newLine + system.newLine}`; + system.write(output); + }; + } + function createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus) { + const host = createProgramHost(system, createProgram2); + host.getModifiedTime = system.getModifiedTime ? (path2) => system.getModifiedTime(path2) : returnUndefined; + host.setModifiedTime = system.setModifiedTime ? (path2, date) => system.setModifiedTime(path2, date) : noop4; + host.deleteFile = system.deleteFile ? (path2) => system.deleteFile(path2) : noop4; + host.reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system); + host.reportSolutionBuilderStatus = reportSolutionBuilderStatus || createBuilderStatusReporter(system); + host.now = maybeBind(system, system.now); + return host; + } + function createSolutionBuilderHost(system = sys, createProgram2, reportDiagnostic, reportSolutionBuilderStatus, reportErrorSummary2) { + const host = createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus); + host.reportErrorSummary = reportErrorSummary2; + return host; + } + function createSolutionBuilderWithWatchHost(system = sys, createProgram2, reportDiagnostic, reportSolutionBuilderStatus, reportWatchStatus2) { + const host = createSolutionBuilderHostBase(system, createProgram2, reportDiagnostic, reportSolutionBuilderStatus); + const watchHost = createWatchHost(system, reportWatchStatus2); + copyProperties(host, watchHost); + return host; + } + function getCompilerOptionsOfBuildOptions(buildOptions2) { + const result2 = {}; + commonOptionsWithBuild.forEach((option) => { + if (hasProperty(buildOptions2, option.name)) + result2[option.name] = buildOptions2[option.name]; + }); + return result2; + } + function createSolutionBuilder(host, rootNames, defaultOptions9) { + return createSolutionBuilderWorker( + /*watch*/ + false, + host, + rootNames, + defaultOptions9 + ); + } + function createSolutionBuilderWithWatch(host, rootNames, defaultOptions9, baseWatchOptions) { + return createSolutionBuilderWorker( + /*watch*/ + true, + host, + rootNames, + defaultOptions9, + baseWatchOptions + ); + } + function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { + const host = hostOrHostWithWatch; + const hostWithWatch = hostOrHostWithWatch; + const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); + const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions); + setGetSourceFileAsHashVersioned(compilerHost); + compilerHost.getParsedCommandLine = (fileName) => parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName)); + compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals); + compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences); + compilerHost.resolveLibrary = maybeBind(host, host.resolveLibrary); + compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); + compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); + compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache); + let moduleResolutionCache, typeReferenceDirectiveResolutionCache; + if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) { + moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName); + compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( + moduleNames, + containingFile, + redirectedReference, + options2, + containingSourceFile, + host, + moduleResolutionCache, + createModuleResolutionLoader + ); + compilerHost.getModuleResolutionCache = () => moduleResolutionCache; + } + if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) { + typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache( + compilerHost.getCurrentDirectory(), + compilerHost.getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(), + moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey + ); + compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache( + typeDirectiveNames, + containingFile, + redirectedReference, + options2, + containingSourceFile, + host, + typeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader + ); + } + let libraryResolutionCache; + if (!compilerHost.resolveLibrary) { + libraryResolutionCache = createModuleResolutionCache( + compilerHost.getCurrentDirectory(), + compilerHost.getCanonicalFileName, + /*options*/ + void 0, + moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache() + ); + compilerHost.resolveLibrary = (libraryName, resolveFrom, options2) => resolveLibrary( + libraryName, + resolveFrom, + options2, + host, + libraryResolutionCache + ); + } + compilerHost.getBuildInfo = (fileName, configFilePath) => getBuildInfo3( + state, + fileName, + toResolvedConfigFilePath(state, configFilePath), + /*modifiedTime*/ + void 0 + ); + const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(hostWithWatch, options); + const state = { + host, + hostWithWatch, + parseConfigFileHost: parseConfigHostFromCompilerHostLike(host), + write: maybeBind(host, host.trace), + // State of solution + options, + baseCompilerOptions, + rootNames, + baseWatchOptions, + resolvedConfigFilePaths: /* @__PURE__ */ new Map(), + configFileCache: /* @__PURE__ */ new Map(), + projectStatus: /* @__PURE__ */ new Map(), + extendedConfigCache: /* @__PURE__ */ new Map(), + buildInfoCache: /* @__PURE__ */ new Map(), + outputTimeStamps: /* @__PURE__ */ new Map(), + builderPrograms: /* @__PURE__ */ new Map(), + diagnostics: /* @__PURE__ */ new Map(), + projectPendingBuild: /* @__PURE__ */ new Map(), + projectErrorsReported: /* @__PURE__ */ new Map(), + compilerHost, + moduleResolutionCache, + typeReferenceDirectiveResolutionCache, + libraryResolutionCache, + // Mutable state + buildOrder: void 0, + readFileWithCache: (f8) => host.readFile(f8), + projectCompilerOptions: baseCompilerOptions, + cache: void 0, + allProjectBuildPending: true, + needsSummary: true, + watchAllProjectsPending: watch, + // Watch state + watch, + allWatchedWildcardDirectories: /* @__PURE__ */ new Map(), + allWatchedInputFiles: /* @__PURE__ */ new Map(), + allWatchedConfigFiles: /* @__PURE__ */ new Map(), + allWatchedExtendedConfigFiles: /* @__PURE__ */ new Map(), + allWatchedPackageJsonFiles: /* @__PURE__ */ new Map(), + filesWatched: /* @__PURE__ */ new Map(), + lastCachedPackageJsonLookups: /* @__PURE__ */ new Map(), + timerToBuildInvalidatedProject: void 0, + reportFileChangeDetected: false, + watchFile: watchFile2, + watchDirectory, + writeLog + }; + return state; + } + function toPath22(state, fileName) { + return toPath2(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName); + } + function toResolvedConfigFilePath(state, fileName) { + const { resolvedConfigFilePaths } = state; + const path2 = resolvedConfigFilePaths.get(fileName); + if (path2 !== void 0) + return path2; + const resolvedPath = toPath22(state, fileName); + resolvedConfigFilePaths.set(fileName, resolvedPath); + return resolvedPath; + } + function isParsedCommandLine(entry) { + return !!entry.options; + } + function getCachedParsedConfigFile(state, configFilePath) { + const value2 = state.configFileCache.get(configFilePath); + return value2 && isParsedCommandLine(value2) ? value2 : void 0; + } + function parseConfigFile(state, configFileName, configFilePath) { + const { configFileCache } = state; + const value2 = configFileCache.get(configFilePath); + if (value2) { + return isParsedCommandLine(value2) ? value2 : void 0; + } + mark("SolutionBuilder::beforeConfigFileParsing"); + let diagnostic; + const { parseConfigFileHost, baseCompilerOptions, baseWatchOptions, extendedConfigCache, host } = state; + let parsed; + if (host.getParsedCommandLine) { + parsed = host.getParsedCommandLine(configFileName); + if (!parsed) + diagnostic = createCompilerDiagnostic(Diagnostics.File_0_not_found, configFileName); + } else { + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = (d7) => diagnostic = d7; + parsed = getParsedCommandLineOfConfigFile(configFileName, baseCompilerOptions, parseConfigFileHost, extendedConfigCache, baseWatchOptions); + parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop4; + } + configFileCache.set(configFilePath, parsed || diagnostic); + mark("SolutionBuilder::afterConfigFileParsing"); + measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing"); + return parsed; + } + function resolveProjectName(state, name2) { + return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name2)); + } + function createBuildOrder(state, roots) { + const temporaryMarks = /* @__PURE__ */ new Map(); + const permanentMarks = /* @__PURE__ */ new Map(); + const circularityReportStack = []; + let buildOrder; + let circularDiagnostics; + for (const root2 of roots) { + visit7(root2); + } + return circularDiagnostics ? { buildOrder: buildOrder || emptyArray, circularDiagnostics } : buildOrder || emptyArray; + function visit7(configFileName, inCircularContext) { + const projPath = toResolvedConfigFilePath(state, configFileName); + if (permanentMarks.has(projPath)) + return; + if (temporaryMarks.has(projPath)) { + if (!inCircularContext) { + (circularDiagnostics || (circularDiagnostics = [])).push( + createCompilerDiagnostic( + Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0, + circularityReportStack.join("\r\n") + ) + ); + } + return; + } + temporaryMarks.set(projPath, true); + circularityReportStack.push(configFileName); + const parsed = parseConfigFile(state, configFileName, projPath); + if (parsed && parsed.projectReferences) { + for (const ref of parsed.projectReferences) { + const resolvedRefPath = resolveProjectName(state, ref.path); + visit7(resolvedRefPath, inCircularContext || ref.circular); + } + } + circularityReportStack.pop(); + permanentMarks.set(projPath, true); + (buildOrder || (buildOrder = [])).push(configFileName); + } + } + function getBuildOrder(state) { + return state.buildOrder || createStateBuildOrder(state); + } + function createStateBuildOrder(state) { + const buildOrder = createBuildOrder(state, state.rootNames.map((f8) => resolveProjectName(state, f8))); + state.resolvedConfigFilePaths.clear(); + const currentProjects = new Set( + getBuildOrderFromAnyBuildOrder(buildOrder).map( + (resolved) => toResolvedConfigFilePath(state, resolved) + ) + ); + const noopOnDelete = { onDeleteValue: noop4 }; + mutateMapSkippingNewValues(state.configFileCache, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.projectStatus, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.builderPrograms, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.diagnostics, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.projectPendingBuild, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.projectErrorsReported, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.buildInfoCache, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.outputTimeStamps, currentProjects, noopOnDelete); + mutateMapSkippingNewValues(state.lastCachedPackageJsonLookups, currentProjects, noopOnDelete); + if (state.watch) { + mutateMapSkippingNewValues( + state.allWatchedConfigFiles, + currentProjects, + { onDeleteValue: closeFileWatcher } + ); + state.allWatchedExtendedConfigFiles.forEach((watcher) => { + watcher.projects.forEach((project) => { + if (!currentProjects.has(project)) { + watcher.projects.delete(project); + } + }); + watcher.close(); + }); + mutateMapSkippingNewValues( + state.allWatchedWildcardDirectories, + currentProjects, + { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcherOf) } + ); + mutateMapSkippingNewValues( + state.allWatchedInputFiles, + currentProjects, + { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcher) } + ); + mutateMapSkippingNewValues( + state.allWatchedPackageJsonFiles, + currentProjects, + { onDeleteValue: (existingMap) => existingMap.forEach(closeFileWatcher) } + ); + } + return state.buildOrder = buildOrder; + } + function getBuildOrderFor(state, project, onlyReferences) { + const resolvedProject = project && resolveProjectName(state, project); + const buildOrderFromState = getBuildOrder(state); + if (isCircularBuildOrder(buildOrderFromState)) + return buildOrderFromState; + if (resolvedProject) { + const projectPath = toResolvedConfigFilePath(state, resolvedProject); + const projectIndex = findIndex2( + buildOrderFromState, + (configFileName) => toResolvedConfigFilePath(state, configFileName) === projectPath + ); + if (projectIndex === -1) + return void 0; + } + const buildOrder = resolvedProject ? createBuildOrder(state, [resolvedProject]) : buildOrderFromState; + Debug.assert(!isCircularBuildOrder(buildOrder)); + Debug.assert(!onlyReferences || resolvedProject !== void 0); + Debug.assert(!onlyReferences || buildOrder[buildOrder.length - 1] === resolvedProject); + return onlyReferences ? buildOrder.slice(0, buildOrder.length - 1) : buildOrder; + } + function enableCache(state) { + if (state.cache) { + disableCache(state); + } + const { compilerHost, host } = state; + const originalReadFileWithCache = state.readFileWithCache; + const originalGetSourceFile = compilerHost.getSourceFile; + const { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + getSourceFileWithCache, + readFileWithCache + } = changeCompilerHostLikeToUseCache( + host, + (fileName) => toPath22(state, fileName), + (...args) => originalGetSourceFile.call(compilerHost, ...args) + ); + state.readFileWithCache = readFileWithCache; + compilerHost.getSourceFile = getSourceFileWithCache; + state.cache = { + originalReadFile, + originalFileExists, + originalDirectoryExists, + originalCreateDirectory, + originalWriteFile, + originalReadFileWithCache, + originalGetSourceFile + }; + } + function disableCache(state) { + if (!state.cache) + return; + const { cache, host, compilerHost, extendedConfigCache, moduleResolutionCache, typeReferenceDirectiveResolutionCache, libraryResolutionCache } = state; + host.readFile = cache.originalReadFile; + host.fileExists = cache.originalFileExists; + host.directoryExists = cache.originalDirectoryExists; + host.createDirectory = cache.originalCreateDirectory; + host.writeFile = cache.originalWriteFile; + compilerHost.getSourceFile = cache.originalGetSourceFile; + state.readFileWithCache = cache.originalReadFileWithCache; + extendedConfigCache.clear(); + moduleResolutionCache == null ? void 0 : moduleResolutionCache.clear(); + typeReferenceDirectiveResolutionCache == null ? void 0 : typeReferenceDirectiveResolutionCache.clear(); + libraryResolutionCache == null ? void 0 : libraryResolutionCache.clear(); + state.cache = void 0; + } + function clearProjectStatus(state, resolved) { + state.projectStatus.delete(resolved); + state.diagnostics.delete(resolved); + } + function addProjToQueue({ projectPendingBuild }, proj, updateLevel) { + const value2 = projectPendingBuild.get(proj); + if (value2 === void 0) { + projectPendingBuild.set(proj, updateLevel); + } else if (value2 < updateLevel) { + projectPendingBuild.set(proj, updateLevel); + } + } + function setupInitialBuild(state, cancellationToken) { + if (!state.allProjectBuildPending) + return; + state.allProjectBuildPending = false; + if (state.options.watch) + reportWatchStatus(state, Diagnostics.Starting_compilation_in_watch_mode); + enableCache(state); + const buildOrder = getBuildOrderFromAnyBuildOrder(getBuildOrder(state)); + buildOrder.forEach( + (configFileName) => state.projectPendingBuild.set( + toResolvedConfigFilePath(state, configFileName), + 0 + /* Update */ + ) + ); + if (cancellationToken) { + cancellationToken.throwIfCancellationRequested(); + } + } + function doneInvalidatedProject(state, projectPath) { + state.projectPendingBuild.delete(projectPath); + return state.diagnostics.has(projectPath) ? 1 : 0; + } + function createUpdateOutputFileStampsProject(state, project, projectPath, config3, buildOrder) { + let updateOutputFileStampsPending = true; + return { + kind: 2, + project, + projectPath, + buildOrder, + getCompilerOptions: () => config3.options, + getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(), + updateOutputFileStatmps: () => { + updateOutputTimestamps(state, config3, projectPath); + updateOutputFileStampsPending = false; + }, + done: () => { + if (updateOutputFileStampsPending) { + updateOutputTimestamps(state, config3, projectPath); + } + mark("SolutionBuilder::Timestamps only updates"); + return doneInvalidatedProject(state, projectPath); + } + }; + } + function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath, projectIndex, config3, buildOrder) { + let step = kind === 0 ? 0 : 4; + let program; + let buildResult; + let invalidatedProjectOfBundle; + return kind === 0 ? { + kind, + project, + projectPath, + buildOrder, + getCompilerOptions: () => config3.options, + getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(), + getBuilderProgram: () => withProgramOrUndefined(identity2), + getProgram: () => withProgramOrUndefined( + (program2) => program2.getProgramOrUndefined() + ), + getSourceFile: (fileName) => withProgramOrUndefined( + (program2) => program2.getSourceFile(fileName) + ), + getSourceFiles: () => withProgramOrEmptyArray( + (program2) => program2.getSourceFiles() + ), + getOptionsDiagnostics: (cancellationToken) => withProgramOrEmptyArray( + (program2) => program2.getOptionsDiagnostics(cancellationToken) + ), + getGlobalDiagnostics: (cancellationToken) => withProgramOrEmptyArray( + (program2) => program2.getGlobalDiagnostics(cancellationToken) + ), + getConfigFileParsingDiagnostics: () => withProgramOrEmptyArray( + (program2) => program2.getConfigFileParsingDiagnostics() + ), + getSyntacticDiagnostics: (sourceFile, cancellationToken) => withProgramOrEmptyArray( + (program2) => program2.getSyntacticDiagnostics(sourceFile, cancellationToken) + ), + getAllDependencies: (sourceFile) => withProgramOrEmptyArray( + (program2) => program2.getAllDependencies(sourceFile) + ), + getSemanticDiagnostics: (sourceFile, cancellationToken) => withProgramOrEmptyArray( + (program2) => program2.getSemanticDiagnostics(sourceFile, cancellationToken) + ), + getSemanticDiagnosticsOfNextAffectedFile: (cancellationToken, ignoreSourceFile) => withProgramOrUndefined( + (program2) => program2.getSemanticDiagnosticsOfNextAffectedFile && program2.getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) + ), + emit: (targetSourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers) => { + if (targetSourceFile || emitOnlyDtsFiles) { + return withProgramOrUndefined( + (program2) => { + var _a2, _b; + return program2.emit(targetSourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers || ((_b = (_a2 = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a2, project))); + } + ); + } + executeSteps(2, cancellationToken); + if (step === 5) { + return emitBuildInfo(writeFile22, cancellationToken); + } + if (step !== 3) + return void 0; + return emit3(writeFile22, cancellationToken, customTransformers); + }, + done + } : { + kind, + project, + projectPath, + buildOrder, + getCompilerOptions: () => config3.options, + getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(), + emit: (writeFile22, customTransformers) => { + if (step !== 4) + return invalidatedProjectOfBundle; + return emitBundle(writeFile22, customTransformers); + }, + done + }; + function done(cancellationToken, writeFile22, customTransformers) { + executeSteps(8, cancellationToken, writeFile22, customTransformers); + if (kind === 0) + mark("SolutionBuilder::Projects built"); + else + mark("SolutionBuilder::Bundles updated"); + return doneInvalidatedProject(state, projectPath); + } + function withProgramOrUndefined(action) { + executeSteps( + 0 + /* CreateProgram */ + ); + return program && action(program); + } + function withProgramOrEmptyArray(action) { + return withProgramOrUndefined(action) || emptyArray; + } + function createProgram2() { + var _a2, _b, _c; + Debug.assert(program === void 0); + if (state.options.dry) { + reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project); + buildResult = 1; + step = 7; + return; + } + if (state.options.verbose) + reportStatus(state, Diagnostics.Building_project_0, project); + if (config3.fileNames.length === 0) { + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config3)); + buildResult = 0; + step = 7; + return; + } + const { host, compilerHost } = state; + state.projectCompilerOptions = config3.options; + (_a2 = state.moduleResolutionCache) == null ? void 0 : _a2.update(config3.options); + (_b = state.typeReferenceDirectiveResolutionCache) == null ? void 0 : _b.update(config3.options); + program = host.createProgram( + config3.fileNames, + config3.options, + compilerHost, + getOldProgram(state, projectPath, config3), + getConfigFileParsingDiagnostics(config3), + config3.projectReferences + ); + if (state.watch) { + const internalMap = (_c = state.moduleResolutionCache) == null ? void 0 : _c.getPackageJsonInfoCache().getInternalMap(); + state.lastCachedPackageJsonLookups.set( + projectPath, + internalMap && new Set(arrayFrom( + internalMap.values(), + (data) => state.host.realpath && (isPackageJsonInfo(data) || data.directoryExists) ? state.host.realpath(combinePaths(data.packageDirectory, "package.json")) : combinePaths(data.packageDirectory, "package.json") + )) + ); + state.builderPrograms.set(projectPath, program); + } + step++; + } + function handleDiagnostics(diagnostics, errorFlags, errorType) { + if (diagnostics.length) { + ({ buildResult, step } = buildErrors( + state, + projectPath, + program, + config3, + diagnostics, + errorFlags, + errorType + )); + } else { + step++; + } + } + function getSyntaxDiagnostics(cancellationToken) { + Debug.assertIsDefined(program); + handleDiagnostics( + [ + ...program.getConfigFileParsingDiagnostics(), + ...program.getOptionsDiagnostics(cancellationToken), + ...program.getGlobalDiagnostics(cancellationToken), + ...program.getSyntacticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ) + ], + 8, + "Syntactic" + ); + } + function getSemanticDiagnostics(cancellationToken) { + handleDiagnostics( + Debug.checkDefined(program).getSemanticDiagnostics( + /*sourceFile*/ + void 0, + cancellationToken + ), + 16, + "Semantic" + ); + } + function emit3(writeFileCallback, cancellationToken, customTransformers) { + var _a2, _b, _c; + Debug.assertIsDefined(program); + Debug.assert( + step === 3 + /* Emit */ + ); + const saved = program.saveEmitState(); + let declDiagnostics; + const reportDeclarationDiagnostics = (d7) => (declDiagnostics || (declDiagnostics = [])).push(d7); + const outputFiles = []; + const { emitResult } = emitFilesAndReportErrors( + program, + reportDeclarationDiagnostics, + /*write*/ + void 0, + /*reportSummary*/ + void 0, + (name2, text, writeByteOrderMark, _onError, _sourceFiles, data) => outputFiles.push({ name: name2, text, writeByteOrderMark, data }), + cancellationToken, + /*emitOnlyDtsFiles*/ + false, + customTransformers || ((_b = (_a2 = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a2, project)) + ); + if (declDiagnostics) { + program.restoreEmitState(saved); + ({ buildResult, step } = buildErrors( + state, + projectPath, + program, + config3, + declDiagnostics, + 32, + "Declaration file" + )); + return { + emitSkipped: true, + diagnostics: emitResult.diagnostics + }; + } + const { host, compilerHost } = state; + const resultFlags = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 : 2; + const emitterDiagnostics = createDiagnosticCollection(); + const emittedOutputs = /* @__PURE__ */ new Map(); + const options = program.getCompilerOptions(); + const isIncremental = isIncrementalCompilation(options); + let outputTimeStampMap; + let now2; + outputFiles.forEach(({ name: name2, text, writeByteOrderMark, data }) => { + const path2 = toPath22(state, name2); + emittedOutputs.set(toPath22(state, name2), name2); + if (data == null ? void 0 : data.buildInfo) + setBuildInfo(state, data.buildInfo, projectPath, options, resultFlags); + const modifiedTime = (data == null ? void 0 : data.differsOnlyInMap) ? getModifiedTime(state.host, name2) : void 0; + writeFile2(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name2, text, writeByteOrderMark); + if (data == null ? void 0 : data.differsOnlyInMap) + state.host.setModifiedTime(name2, modifiedTime); + else if (!isIncremental && state.watch) { + (outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path2, now2 || (now2 = getCurrentTime(state.host))); + } + }); + finishEmit( + emitterDiagnostics, + emittedOutputs, + outputFiles.length ? outputFiles[0].name : getFirstProjectOutput(config3, !host.useCaseSensitiveFileNames()), + resultFlags + ); + return emitResult; + } + function emitBuildInfo(writeFileCallback, cancellationToken) { + Debug.assertIsDefined(program); + Debug.assert( + step === 5 + /* EmitBuildInfo */ + ); + const emitResult = program.emitBuildInfo((name2, text, writeByteOrderMark, onError, sourceFiles, data) => { + if (data == null ? void 0 : data.buildInfo) + setBuildInfo( + state, + data.buildInfo, + projectPath, + program.getCompilerOptions(), + 2 + /* DeclarationOutputUnchanged */ + ); + if (writeFileCallback) + writeFileCallback(name2, text, writeByteOrderMark, onError, sourceFiles, data); + else + state.compilerHost.writeFile(name2, text, writeByteOrderMark, onError, sourceFiles, data); + }, cancellationToken); + if (emitResult.diagnostics.length) { + reportErrors(state, emitResult.diagnostics); + state.diagnostics.set(projectPath, [...state.diagnostics.get(projectPath), ...emitResult.diagnostics]); + buildResult = 64 & buildResult; + } + if (emitResult.emittedFiles && state.write) { + emitResult.emittedFiles.forEach((name2) => listEmittedFile(state, config3, name2)); + } + afterProgramDone(state, program, config3); + step = 7; + return emitResult; + } + function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) { + const emitDiagnostics = emitterDiagnostics.getDiagnostics(); + if (emitDiagnostics.length) { + ({ buildResult, step } = buildErrors( + state, + projectPath, + program, + config3, + emitDiagnostics, + 64, + "Emit" + )); + return emitDiagnostics; + } + if (state.write) { + emittedOutputs.forEach((name2) => listEmittedFile(state, config3, name2)); + } + updateOutputTimestampsWorker(state, config3, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs); + state.diagnostics.delete(projectPath); + state.projectStatus.set(projectPath, { + type: 1, + oldestOutputFileName + }); + afterProgramDone(state, program, config3); + step = 7; + buildResult = resultFlags; + return emitDiagnostics; + } + function emitBundle(writeFileCallback, customTransformers) { + var _a2, _b, _c, _d; + Debug.assert( + kind === 1 + /* UpdateBundle */ + ); + if (state.options.dry) { + reportStatus(state, Diagnostics.A_non_dry_build_would_update_output_of_project_0, project); + buildResult = 1; + step = 7; + return void 0; + } + if (state.options.verbose) + reportStatus(state, Diagnostics.Updating_output_of_project_0, project); + const { compilerHost } = state; + state.projectCompilerOptions = config3.options; + (_b = (_a2 = state.host).beforeEmitBundle) == null ? void 0 : _b.call(_a2, config3); + const outputFiles = emitUsingBuildInfo( + config3, + compilerHost, + (ref) => { + const refName = resolveProjectName(state, ref.path); + return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName)); + }, + customTransformers || ((_d = (_c = state.host).getCustomTransformers) == null ? void 0 : _d.call(_c, project)) + ); + if (isString4(outputFiles)) { + reportStatus(state, Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles)); + step = 6; + return invalidatedProjectOfBundle = createBuildOrUpdateInvalidedProject( + 0, + state, + project, + projectPath, + projectIndex, + config3, + buildOrder + ); + } + Debug.assert(!!outputFiles.length); + const emitterDiagnostics = createDiagnosticCollection(); + const emittedOutputs = /* @__PURE__ */ new Map(); + let resultFlags = 2; + const existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo || void 0; + outputFiles.forEach(({ name: name2, text, writeByteOrderMark, data }) => { + var _a22, _b2; + emittedOutputs.set(toPath22(state, name2), name2); + if (data == null ? void 0 : data.buildInfo) { + if (((_a22 = data.buildInfo.program) == null ? void 0 : _a22.outSignature) !== ((_b2 = existingBuildInfo == null ? void 0 : existingBuildInfo.program) == null ? void 0 : _b2.outSignature)) { + resultFlags &= ~2; + } + setBuildInfo(state, data.buildInfo, projectPath, config3.options, resultFlags); + } + writeFile2(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name2, text, writeByteOrderMark); + }); + const emitDiagnostics = finishEmit( + emitterDiagnostics, + emittedOutputs, + outputFiles[0].name, + resultFlags + ); + return { emitSkipped: false, diagnostics: emitDiagnostics }; + } + function executeSteps(till, cancellationToken, writeFile22, customTransformers) { + while (step <= till && step < 8) { + const currentStep = step; + switch (step) { + case 0: + createProgram2(); + break; + case 1: + getSyntaxDiagnostics(cancellationToken); + break; + case 2: + getSemanticDiagnostics(cancellationToken); + break; + case 3: + emit3(writeFile22, cancellationToken, customTransformers); + break; + case 5: + emitBuildInfo(writeFile22, cancellationToken); + break; + case 4: + emitBundle(writeFile22, customTransformers); + break; + case 6: + Debug.checkDefined(invalidatedProjectOfBundle).done(cancellationToken, writeFile22, customTransformers); + step = 8; + break; + case 7: + queueReferencingProjects(state, project, projectPath, projectIndex, config3, buildOrder, Debug.checkDefined(buildResult)); + step++; + break; + case 8: + default: + assertType(step); + } + Debug.assert(step > currentStep); + } + } + } + function needsBuild({ options }, status, config3) { + if (status.type !== 3 || options.force) + return true; + return config3.fileNames.length === 0 || !!getConfigFileParsingDiagnostics(config3).length || !isIncrementalCompilation(config3.options); + } + function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) { + if (!state.projectPendingBuild.size) + return void 0; + if (isCircularBuildOrder(buildOrder)) + return void 0; + const { options, projectPendingBuild } = state; + for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) { + const project = buildOrder[projectIndex]; + const projectPath = toResolvedConfigFilePath(state, project); + const updateLevel = state.projectPendingBuild.get(projectPath); + if (updateLevel === void 0) + continue; + if (reportQueue) { + reportQueue = false; + reportBuildQueue(state, buildOrder); + } + const config3 = parseConfigFile(state, project, projectPath); + if (!config3) { + reportParseConfigFileDiagnostic(state, projectPath); + projectPendingBuild.delete(projectPath); + continue; + } + if (updateLevel === 2) { + watchConfigFile(state, project, projectPath, config3); + watchExtendedConfigFiles(state, projectPath, config3); + watchWildCardDirectories(state, project, projectPath, config3); + watchInputFiles(state, project, projectPath, config3); + watchPackageJsonFiles(state, project, projectPath, config3); + } else if (updateLevel === 1) { + config3.fileNames = getFileNamesFromConfigSpecs(config3.options.configFile.configFileSpecs, getDirectoryPath(project), config3.options, state.parseConfigFileHost); + updateErrorForNoInputFiles(config3.fileNames, project, config3.options.configFile.configFileSpecs, config3.errors, canJsonReportNoInputFiles(config3.raw)); + watchInputFiles(state, project, projectPath, config3); + watchPackageJsonFiles(state, project, projectPath, config3); + } + const status = getUpToDateStatus(state, config3, projectPath); + if (!options.force) { + if (status.type === 1) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + if (options.dry) { + reportStatus(state, Diagnostics.Project_0_is_up_to_date, project); + } + continue; + } + if (status.type === 2 || status.type === 15) { + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config3)); + return { + kind: 2, + status, + project, + projectPath, + projectIndex, + config: config3 + }; + } + } + if (status.type === 12) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + if (options.verbose) { + reportStatus( + state, + status.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors, + project, + status.upstreamProjectName + ); + } + continue; + } + if (status.type === 16) { + verboseReportProjectStatus(state, project, status); + reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config3)); + projectPendingBuild.delete(projectPath); + continue; + } + return { + kind: needsBuild(state, status, config3) ? 0 : 1, + status, + project, + projectPath, + projectIndex, + config: config3 + }; + } + return void 0; + } + function createInvalidatedProjectWithInfo(state, info2, buildOrder) { + verboseReportProjectStatus(state, info2.project, info2.status); + return info2.kind !== 2 ? createBuildOrUpdateInvalidedProject( + info2.kind, + state, + info2.project, + info2.projectPath, + info2.projectIndex, + info2.config, + buildOrder + ) : createUpdateOutputFileStampsProject( + state, + info2.project, + info2.projectPath, + info2.config, + buildOrder + ); + } + function getNextInvalidatedProject(state, buildOrder, reportQueue) { + const info2 = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue); + if (!info2) + return info2; + return createInvalidatedProjectWithInfo(state, info2, buildOrder); + } + function listEmittedFile({ write }, proj, file) { + if (write && proj.options.listEmittedFiles) { + write(`TSFILE: ${file}`); + } + } + function getOldProgram({ options, builderPrograms, compilerHost }, proj, parsed) { + if (options.force) + return void 0; + const value2 = builderPrograms.get(proj); + if (value2) + return value2; + return readBuilderProgram(parsed.options, compilerHost); + } + function afterProgramDone(state, program, config3) { + if (program) { + if (state.write) + listFiles(program, state.write); + if (state.host.afterProgramEmitAndDiagnostics) { + state.host.afterProgramEmitAndDiagnostics(program); + } + program.releaseProgram(); + } else if (state.host.afterEmitBundle) { + state.host.afterEmitBundle(config3); + } + state.projectCompilerOptions = state.baseCompilerOptions; + } + function buildErrors(state, resolvedPath, program, config3, diagnostics, buildResult, errorType) { + const canEmitBuildInfo = program && !outFile(program.getCompilerOptions()); + reportAndStoreErrors(state, resolvedPath, diagnostics); + state.projectStatus.set(resolvedPath, { type: 0, reason: `${errorType} errors` }); + if (canEmitBuildInfo) + return { + buildResult, + step: 5 + /* EmitBuildInfo */ + }; + afterProgramDone(state, program, config3); + return { + buildResult, + step: 7 + /* QueueReferencingProjects */ + }; + } + function isFileWatcherWithModifiedTime(value2) { + return !!value2.watcher; + } + function getModifiedTime2(state, fileName) { + const path2 = toPath22(state, fileName); + const existing = state.filesWatched.get(path2); + if (state.watch && !!existing) { + if (!isFileWatcherWithModifiedTime(existing)) + return existing; + if (existing.modifiedTime) + return existing.modifiedTime; + } + const result2 = getModifiedTime(state.host, fileName); + if (state.watch) { + if (existing) + existing.modifiedTime = result2; + else + state.filesWatched.set(path2, result2); + } + return result2; + } + function watchFile(state, file, callback, pollingInterval, options, watchType, project) { + const path2 = toPath22(state, file); + const existing = state.filesWatched.get(path2); + if (existing && isFileWatcherWithModifiedTime(existing)) { + existing.callbacks.push(callback); + } else { + const watcher = state.watchFile( + file, + (fileName, eventKind, modifiedTime) => { + const existing2 = Debug.checkDefined(state.filesWatched.get(path2)); + Debug.assert(isFileWatcherWithModifiedTime(existing2)); + existing2.modifiedTime = modifiedTime; + existing2.callbacks.forEach((cb) => cb(fileName, eventKind, modifiedTime)); + }, + pollingInterval, + options, + watchType, + project + ); + state.filesWatched.set(path2, { callbacks: [callback], watcher, modifiedTime: existing }); + } + return { + close: () => { + const existing2 = Debug.checkDefined(state.filesWatched.get(path2)); + Debug.assert(isFileWatcherWithModifiedTime(existing2)); + if (existing2.callbacks.length === 1) { + state.filesWatched.delete(path2); + closeFileWatcherOf(existing2); + } else { + unorderedRemoveItem(existing2.callbacks, callback); + } + } + }; + } + function getOutputTimeStampMap(state, resolvedConfigFilePath) { + if (!state.watch) + return void 0; + let result2 = state.outputTimeStamps.get(resolvedConfigFilePath); + if (!result2) + state.outputTimeStamps.set(resolvedConfigFilePath, result2 = /* @__PURE__ */ new Map()); + return result2; + } + function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) { + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options); + const existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath); + const modifiedTime = getCurrentTime(state.host); + if (existing) { + existing.buildInfo = buildInfo; + existing.modifiedTime = modifiedTime; + if (!(resultFlags & 2)) + existing.latestChangedDtsTime = modifiedTime; + } else { + state.buildInfoCache.set(resolvedConfigPath, { + path: toPath22(state, buildInfoPath), + buildInfo, + modifiedTime, + latestChangedDtsTime: resultFlags & 2 ? void 0 : modifiedTime + }); + } + } + function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) { + const path2 = toPath22(state, buildInfoPath); + const existing = state.buildInfoCache.get(resolvedConfigPath); + return (existing == null ? void 0 : existing.path) === path2 ? existing : void 0; + } + function getBuildInfo3(state, buildInfoPath, resolvedConfigPath, modifiedTime) { + const path2 = toPath22(state, buildInfoPath); + const existing = state.buildInfoCache.get(resolvedConfigPath); + if (existing !== void 0 && existing.path === path2) { + return existing.buildInfo || void 0; + } + const value2 = state.readFileWithCache(buildInfoPath); + const buildInfo = value2 ? getBuildInfo(buildInfoPath, value2) : void 0; + state.buildInfoCache.set(resolvedConfigPath, { path: path2, buildInfo: buildInfo || false, modifiedTime: modifiedTime || missingFileModifiedTime }); + return buildInfo; + } + function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName) { + const tsconfigTime = getModifiedTime2(state, configFile); + if (oldestOutputFileTime < tsconfigTime) { + return { + type: 6, + outOfDateOutputFileName: oldestOutputFileName, + newerInputFileName: configFile + }; + } + } + function getUpToDateStatusWorker(state, project, resolvedPath) { + var _a2, _b, _c; + if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) { + return { + type: 16 + /* ContainerOnly */ + }; + } + let referenceStatuses; + const force = !!state.options.force; + if (project.projectReferences) { + state.projectStatus.set(resolvedPath, { + type: 13 + /* ComputingUpstream */ + }); + for (const ref of project.projectReferences) { + const resolvedRef = resolveProjectReferencePath(ref); + const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef); + const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath); + const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath); + if (refStatus.type === 13 || refStatus.type === 16) { + continue; + } + if (refStatus.type === 0 || refStatus.type === 12) { + return { + type: 12, + upstreamProjectName: ref.path, + upstreamProjectBlocked: refStatus.type === 12 + /* UpstreamBlocked */ + }; + } + if (refStatus.type !== 1) { + return { + type: 11, + upstreamProjectName: ref.path + }; + } + if (!force) + (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig }); + } + } + if (force) + return { + type: 17 + /* ForceBuild */ + }; + const { host } = state; + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options); + let oldestOutputFileName; + let oldestOutputFileTime = maximumDate; + let buildInfoTime; + let buildInfoProgram; + let buildInfoVersionMap; + if (buildInfoPath) { + const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath); + buildInfoTime = (buildInfoCacheEntry2 == null ? void 0 : buildInfoCacheEntry2.modifiedTime) || getModifiedTime(host, buildInfoPath); + if (buildInfoTime === missingFileModifiedTime) { + if (!buildInfoCacheEntry2) { + state.buildInfoCache.set(resolvedPath, { + path: toPath22(state, buildInfoPath), + buildInfo: false, + modifiedTime: buildInfoTime + }); + } + return { + type: 4, + missingOutputFileName: buildInfoPath + }; + } + const buildInfo = getBuildInfo3(state, buildInfoPath, resolvedPath, buildInfoTime); + if (!buildInfo) { + return { + type: 5, + fileName: buildInfoPath + }; + } + if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version5) { + return { + type: 14, + version: buildInfo.version + }; + } + if (buildInfo.program) { + if (((_a2 = buildInfo.program.changeFileSet) == null ? void 0 : _a2.length) || (!project.options.noEmit ? ((_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.program.emitDiagnosticsPerFile) == null ? void 0 : _c.length) : some2(buildInfo.program.semanticDiagnosticsPerFile, isArray3))) { + return { + type: 8, + buildInfoFile: buildInfoPath + }; + } + if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.program.options || {})) { + return { + type: 9, + buildInfoFile: buildInfoPath + }; + } + buildInfoProgram = buildInfo.program; + } + oldestOutputFileTime = buildInfoTime; + oldestOutputFileName = buildInfoPath; + } + let newestInputFileName = void 0; + let newestInputFileTime = minimumDate; + let pseudoInputUpToDate = false; + const seenRoots = /* @__PURE__ */ new Set(); + for (const inputFile of project.fileNames) { + const inputTime = getModifiedTime2(state, inputFile); + if (inputTime === missingFileModifiedTime) { + return { + type: 0, + reason: `${inputFile} does not exist` + }; + } + if (buildInfoTime && buildInfoTime < inputTime) { + let version22; + let currentVersion; + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + version22 = buildInfoVersionMap.fileInfos.get(toPath22(state, inputFile)); + const text = version22 ? state.readFileWithCache(inputFile) : void 0; + currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0; + if (version22 && version22 === currentVersion) + pseudoInputUpToDate = true; + } + if (!version22 || version22 !== currentVersion) { + return { + type: 6, + outOfDateOutputFileName: buildInfoPath, + newerInputFileName: inputFile + }; + } + } + if (inputTime > newestInputFileTime) { + newestInputFileName = inputFile; + newestInputFileTime = inputTime; + } + if (buildInfoProgram) + seenRoots.add(toPath22(state, inputFile)); + } + if (buildInfoProgram) { + if (!buildInfoVersionMap) + buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host); + for (const existingRoot of buildInfoVersionMap.roots) { + if (!seenRoots.has(existingRoot)) { + return { + type: 10, + buildInfoFile: buildInfoPath, + inputFile: existingRoot + }; + } + } + } + if (!buildInfoPath) { + const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames()); + const outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath); + for (const output of outputs) { + const path2 = toPath22(state, output); + let outputTime = outputTimeStampMap == null ? void 0 : outputTimeStampMap.get(path2); + if (!outputTime) { + outputTime = getModifiedTime(state.host, output); + outputTimeStampMap == null ? void 0 : outputTimeStampMap.set(path2, outputTime); + } + if (outputTime === missingFileModifiedTime) { + return { + type: 4, + missingOutputFileName: output + }; + } + if (outputTime < newestInputFileTime) { + return { + type: 6, + outOfDateOutputFileName: output, + newerInputFileName: newestInputFileName + }; + } + if (outputTime < oldestOutputFileTime) { + oldestOutputFileTime = outputTime; + oldestOutputFileName = output; + } + } + } + const buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath); + let pseudoUpToDate = false; + let usesPrepend = false; + let upstreamChangedProject; + if (referenceStatuses) { + for (const { ref, refStatus, resolvedConfig, resolvedRefPath } of referenceStatuses) { + usesPrepend = usesPrepend || !!ref.prepend; + if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) { + continue; + } + if (buildInfoCacheEntry && hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath)) { + return { + type: 7, + outOfDateOutputFileName: buildInfoPath, + newerProjectName: ref.path + }; + } + const newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath); + if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) { + pseudoUpToDate = true; + upstreamChangedProject = ref.path; + continue; + } + Debug.assert(oldestOutputFileName !== void 0, "Should have an oldest output filename here"); + return { + type: 7, + outOfDateOutputFileName: oldestOutputFileName, + newerProjectName: ref.path + }; + } + } + const configStatus = checkConfigFileUpToDateStatus(state, project.options.configFilePath, oldestOutputFileTime, oldestOutputFileName); + if (configStatus) + return configStatus; + const extendedConfigStatus = forEach4(project.options.configFile.extendedSourceFiles || emptyArray, (configFile) => checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime, oldestOutputFileName)); + if (extendedConfigStatus) + return extendedConfigStatus; + const packageJsonLookups = state.lastCachedPackageJsonLookups.get(resolvedPath); + const dependentPackageFileStatus = packageJsonLookups && forEachKey( + packageJsonLookups, + (path2) => checkConfigFileUpToDateStatus(state, path2, oldestOutputFileTime, oldestOutputFileName) + ); + if (dependentPackageFileStatus) + return dependentPackageFileStatus; + if (usesPrepend && pseudoUpToDate) { + return { + type: 3, + outOfDateOutputFileName: oldestOutputFileName, + newerProjectName: upstreamChangedProject + }; + } + return { + type: pseudoUpToDate ? 2 : pseudoInputUpToDate ? 15 : 1, + newestInputFileTime, + newestInputFileName, + oldestOutputFileName + }; + } + function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) { + const refBuildInfo = state.buildInfoCache.get(resolvedRefPath); + return refBuildInfo.path === buildInfoCacheEntry.path; + } + function getUpToDateStatus(state, project, resolvedPath) { + if (project === void 0) { + return { type: 0, reason: "File deleted mid-build" }; + } + const prior = state.projectStatus.get(resolvedPath); + if (prior !== void 0) { + return prior; + } + mark("SolutionBuilder::beforeUpToDateCheck"); + const actual = getUpToDateStatusWorker(state, project, resolvedPath); + mark("SolutionBuilder::afterUpToDateCheck"); + measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck"); + state.projectStatus.set(resolvedPath, actual); + return actual; + } + function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage, skipOutputs) { + if (proj.options.noEmit) + return; + let now2; + const buildInfoPath = getTsBuildInfoEmitOutputFilePath(proj.options); + if (buildInfoPath) { + if (!(skipOutputs == null ? void 0 : skipOutputs.has(toPath22(state, buildInfoPath)))) { + if (!!state.options.verbose) + reportStatus(state, verboseMessage, proj.options.configFilePath); + state.host.setModifiedTime(buildInfoPath, now2 = getCurrentTime(state.host)); + getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now2; + } + state.outputTimeStamps.delete(projectPath); + return; + } + const { host } = state; + const outputs = getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames()); + const outputTimeStampMap = getOutputTimeStampMap(state, projectPath); + const modifiedOutputs = outputTimeStampMap ? /* @__PURE__ */ new Set() : void 0; + if (!skipOutputs || outputs.length !== skipOutputs.size) { + let reportVerbose = !!state.options.verbose; + for (const file of outputs) { + const path2 = toPath22(state, file); + if (skipOutputs == null ? void 0 : skipOutputs.has(path2)) + continue; + if (reportVerbose) { + reportVerbose = false; + reportStatus(state, verboseMessage, proj.options.configFilePath); + } + host.setModifiedTime(file, now2 || (now2 = getCurrentTime(state.host))); + if (outputTimeStampMap) { + outputTimeStampMap.set(path2, now2); + modifiedOutputs.add(path2); + } + } + } + outputTimeStampMap == null ? void 0 : outputTimeStampMap.forEach((_value, key) => { + if (!(skipOutputs == null ? void 0 : skipOutputs.has(key)) && !modifiedOutputs.has(key)) + outputTimeStampMap.delete(key); + }); + } + function getLatestChangedDtsTime(state, options, resolvedConfigPath) { + if (!options.composite) + return void 0; + const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath)); + if (entry.latestChangedDtsTime !== void 0) + return entry.latestChangedDtsTime || void 0; + const latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0; + entry.latestChangedDtsTime = latestChangedDtsTime || false; + return latestChangedDtsTime; + } + function updateOutputTimestamps(state, proj, resolvedPath) { + if (state.options.dry) { + return reportStatus(state, Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0, proj.options.configFilePath); + } + updateOutputTimestampsWorker(state, proj, resolvedPath, Diagnostics.Updating_output_timestamps_of_project_0); + state.projectStatus.set(resolvedPath, { + type: 1, + oldestOutputFileName: getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames()) + }); + } + function queueReferencingProjects(state, project, projectPath, projectIndex, config3, buildOrder, buildResult) { + if (buildResult & 124) + return; + if (!config3.options.composite) + return; + for (let index4 = projectIndex + 1; index4 < buildOrder.length; index4++) { + const nextProject = buildOrder[index4]; + const nextProjectPath = toResolvedConfigFilePath(state, nextProject); + if (state.projectPendingBuild.has(nextProjectPath)) + continue; + const nextProjectConfig = parseConfigFile(state, nextProject, nextProjectPath); + if (!nextProjectConfig || !nextProjectConfig.projectReferences) + continue; + for (const ref of nextProjectConfig.projectReferences) { + const resolvedRefPath = resolveProjectName(state, ref.path); + if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath) + continue; + const status = state.projectStatus.get(nextProjectPath); + if (status) { + switch (status.type) { + case 1: + if (buildResult & 2) { + if (ref.prepend) { + state.projectStatus.set(nextProjectPath, { + type: 3, + outOfDateOutputFileName: status.oldestOutputFileName, + newerProjectName: project + }); + } else { + status.type = 2; + } + break; + } + case 15: + case 2: + case 3: + if (!(buildResult & 2)) { + state.projectStatus.set(nextProjectPath, { + type: 7, + outOfDateOutputFileName: status.type === 3 ? status.outOfDateOutputFileName : status.oldestOutputFileName, + newerProjectName: project + }); + } + break; + case 12: + if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) { + clearProjectStatus(state, nextProjectPath); + } + break; + } + } + addProjToQueue( + state, + nextProjectPath, + 0 + /* Update */ + ); + break; + } + } + } + function build(state, project, cancellationToken, writeFile22, getCustomTransformers, onlyReferences) { + mark("SolutionBuilder::beforeBuild"); + const result2 = buildWorker(state, project, cancellationToken, writeFile22, getCustomTransformers, onlyReferences); + mark("SolutionBuilder::afterBuild"); + measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); + return result2; + } + function buildWorker(state, project, cancellationToken, writeFile22, getCustomTransformers, onlyReferences) { + const buildOrder = getBuildOrderFor(state, project, onlyReferences); + if (!buildOrder) + return 3; + setupInitialBuild(state, cancellationToken); + let reportQueue = true; + let successfulProjects = 0; + while (true) { + const invalidatedProject = getNextInvalidatedProject(state, buildOrder, reportQueue); + if (!invalidatedProject) + break; + reportQueue = false; + invalidatedProject.done(cancellationToken, writeFile22, getCustomTransformers == null ? void 0 : getCustomTransformers(invalidatedProject.project)); + if (!state.diagnostics.has(invalidatedProject.projectPath)) + successfulProjects++; + } + disableCache(state); + reportErrorSummary(state, buildOrder); + startWatching(state, buildOrder); + return isCircularBuildOrder(buildOrder) ? 4 : !buildOrder.some((p7) => state.diagnostics.has(toResolvedConfigFilePath(state, p7))) ? 0 : successfulProjects ? 2 : 1; + } + function clean(state, project, onlyReferences) { + mark("SolutionBuilder::beforeClean"); + const result2 = cleanWorker(state, project, onlyReferences); + mark("SolutionBuilder::afterClean"); + measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean"); + return result2; + } + function cleanWorker(state, project, onlyReferences) { + const buildOrder = getBuildOrderFor(state, project, onlyReferences); + if (!buildOrder) + return 3; + if (isCircularBuildOrder(buildOrder)) { + reportErrors(state, buildOrder.circularDiagnostics); + return 4; + } + const { options, host } = state; + const filesToDelete = options.dry ? [] : void 0; + for (const proj of buildOrder) { + const resolvedPath = toResolvedConfigFilePath(state, proj); + const parsed = parseConfigFile(state, proj, resolvedPath); + if (parsed === void 0) { + reportParseConfigFileDiagnostic(state, resolvedPath); + continue; + } + const outputs = getAllProjectOutputs(parsed, !host.useCaseSensitiveFileNames()); + if (!outputs.length) + continue; + const inputFileNames = new Set(parsed.fileNames.map((f8) => toPath22(state, f8))); + for (const output of outputs) { + if (inputFileNames.has(toPath22(state, output))) + continue; + if (host.fileExists(output)) { + if (filesToDelete) { + filesToDelete.push(output); + } else { + host.deleteFile(output); + invalidateProject( + state, + resolvedPath, + 0 + /* Update */ + ); + } + } + } + } + if (filesToDelete) { + reportStatus(state, Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map((f8) => `\r + * ${f8}`).join("")); + } + return 0; + } + function invalidateProject(state, resolved, updateLevel) { + if (state.host.getParsedCommandLine && updateLevel === 1) { + updateLevel = 2; + } + if (updateLevel === 2) { + state.configFileCache.delete(resolved); + state.buildOrder = void 0; + } + state.needsSummary = true; + clearProjectStatus(state, resolved); + addProjToQueue(state, resolved, updateLevel); + enableCache(state); + } + function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) { + state.reportFileChangeDetected = true; + invalidateProject(state, resolvedPath, updateLevel); + scheduleBuildInvalidatedProject( + state, + 250, + /*changeDetected*/ + true + ); + } + function scheduleBuildInvalidatedProject(state, time2, changeDetected) { + const { hostWithWatch } = state; + if (!hostWithWatch.setTimeout || !hostWithWatch.clearTimeout) { + return; + } + if (state.timerToBuildInvalidatedProject) { + hostWithWatch.clearTimeout(state.timerToBuildInvalidatedProject); + } + state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time2, "timerToBuildInvalidatedProject", state, changeDetected); + } + function buildNextInvalidatedProject(_timeoutType, state, changeDetected) { + mark("SolutionBuilder::beforeBuild"); + const buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected); + mark("SolutionBuilder::afterBuild"); + measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild"); + if (buildOrder) + reportErrorSummary(state, buildOrder); + } + function buildNextInvalidatedProjectWorker(state, changeDetected) { + state.timerToBuildInvalidatedProject = void 0; + if (state.reportFileChangeDetected) { + state.reportFileChangeDetected = false; + state.projectErrorsReported.clear(); + reportWatchStatus(state, Diagnostics.File_change_detected_Starting_incremental_compilation); + } + let projectsBuilt = 0; + const buildOrder = getBuildOrder(state); + const invalidatedProject = getNextInvalidatedProject( + state, + buildOrder, + /*reportQueue*/ + false + ); + if (invalidatedProject) { + invalidatedProject.done(); + projectsBuilt++; + while (state.projectPendingBuild.size) { + if (state.timerToBuildInvalidatedProject) + return; + const info2 = getNextInvalidatedProjectCreateInfo( + state, + buildOrder, + /*reportQueue*/ + false + ); + if (!info2) + break; + if (info2.kind !== 2 && (changeDetected || projectsBuilt === 5)) { + scheduleBuildInvalidatedProject( + state, + 100, + /*changeDetected*/ + false + ); + return; + } + const project = createInvalidatedProjectWithInfo(state, info2, buildOrder); + project.done(); + if (info2.kind !== 2) + projectsBuilt++; + } + } + disableCache(state); + return buildOrder; + } + function watchConfigFile(state, resolved, resolvedPath, parsed) { + if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath)) + return; + state.allWatchedConfigFiles.set( + resolvedPath, + watchFile( + state, + resolved, + () => invalidateProjectAndScheduleBuilds( + state, + resolvedPath, + 2 + /* Full */ + ), + 2e3, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.ConfigFile, + resolved + ) + ); + } + function watchExtendedConfigFiles(state, resolvedPath, parsed) { + updateSharedExtendedConfigFileWatcher( + resolvedPath, + parsed == null ? void 0 : parsed.options, + state.allWatchedExtendedConfigFiles, + (extendedConfigFileName, extendedConfigFilePath) => watchFile( + state, + extendedConfigFileName, + () => { + var _a2; + return (_a2 = state.allWatchedExtendedConfigFiles.get(extendedConfigFilePath)) == null ? void 0 : _a2.projects.forEach((projectConfigFilePath) => invalidateProjectAndScheduleBuilds( + state, + projectConfigFilePath, + 2 + /* Full */ + )); + }, + 2e3, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.ExtendedConfigFile + ), + (fileName) => toPath22(state, fileName) + ); + } + function watchWildCardDirectories(state, resolved, resolvedPath, parsed) { + if (!state.watch) + return; + updateWatchingWildcardDirectories( + getOrCreateValueMapFromConfigFileMap(state.allWatchedWildcardDirectories, resolvedPath), + parsed.wildcardDirectories, + (dir2, flags) => state.watchDirectory( + dir2, + (fileOrDirectory) => { + var _a2; + if (isIgnoredFileFromWildCardWatching({ + watchedDirPath: toPath22(state, dir2), + fileOrDirectory, + fileOrDirectoryPath: toPath22(state, fileOrDirectory), + configFileName: resolved, + currentDirectory: state.compilerHost.getCurrentDirectory(), + options: parsed.options, + program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames), + useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames, + writeLog: (s7) => state.writeLog(s7), + toPath: (fileName) => toPath22(state, fileName) + })) + return; + invalidateProjectAndScheduleBuilds( + state, + resolvedPath, + 1 + /* RootNamesAndUpdate */ + ); + }, + flags, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.WildcardDirectory, + resolved + ) + ); + } + function watchInputFiles(state, resolved, resolvedPath, parsed) { + if (!state.watch) + return; + mutateMap( + getOrCreateValueMapFromConfigFileMap(state.allWatchedInputFiles, resolvedPath), + new Set(parsed.fileNames), + { + createNewValue: (input) => watchFile( + state, + input, + () => invalidateProjectAndScheduleBuilds( + state, + resolvedPath, + 0 + /* Update */ + ), + 250, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.SourceFile, + resolved + ), + onDeleteValue: closeFileWatcher + } + ); + } + function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) { + if (!state.watch || !state.lastCachedPackageJsonLookups) + return; + mutateMap( + getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), + state.lastCachedPackageJsonLookups.get(resolvedPath), + { + createNewValue: (input) => watchFile( + state, + input, + () => invalidateProjectAndScheduleBuilds( + state, + resolvedPath, + 0 + /* Update */ + ), + 2e3, + parsed == null ? void 0 : parsed.watchOptions, + WatchType.PackageJson, + resolved + ), + onDeleteValue: closeFileWatcher + } + ); + } + function startWatching(state, buildOrder) { + if (!state.watchAllProjectsPending) + return; + mark("SolutionBuilder::beforeWatcherCreation"); + state.watchAllProjectsPending = false; + for (const resolved of getBuildOrderFromAnyBuildOrder(buildOrder)) { + const resolvedPath = toResolvedConfigFilePath(state, resolved); + const cfg = parseConfigFile(state, resolved, resolvedPath); + watchConfigFile(state, resolved, resolvedPath, cfg); + watchExtendedConfigFiles(state, resolvedPath, cfg); + if (cfg) { + watchWildCardDirectories(state, resolved, resolvedPath, cfg); + watchInputFiles(state, resolved, resolvedPath, cfg); + watchPackageJsonFiles(state, resolved, resolvedPath, cfg); + } + } + mark("SolutionBuilder::afterWatcherCreation"); + measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation"); + } + function stopWatching(state) { + clearMap(state.allWatchedConfigFiles, closeFileWatcher); + clearMap(state.allWatchedExtendedConfigFiles, closeFileWatcherOf); + clearMap(state.allWatchedWildcardDirectories, (watchedWildcardDirectories) => clearMap(watchedWildcardDirectories, closeFileWatcherOf)); + clearMap(state.allWatchedInputFiles, (watchedWildcardDirectories) => clearMap(watchedWildcardDirectories, closeFileWatcher)); + clearMap(state.allWatchedPackageJsonFiles, (watchedPacageJsonFiles) => clearMap(watchedPacageJsonFiles, closeFileWatcher)); + } + function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) { + const state = createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions); + return { + build: (project, cancellationToken, writeFile22, getCustomTransformers) => build(state, project, cancellationToken, writeFile22, getCustomTransformers), + clean: (project) => clean(state, project), + buildReferences: (project, cancellationToken, writeFile22, getCustomTransformers) => build( + state, + project, + cancellationToken, + writeFile22, + getCustomTransformers, + /*onlyReferences*/ + true + ), + cleanReferences: (project) => clean( + state, + project, + /*onlyReferences*/ + true + ), + getNextInvalidatedProject: (cancellationToken) => { + setupInitialBuild(state, cancellationToken); + return getNextInvalidatedProject( + state, + getBuildOrder(state), + /*reportQueue*/ + false + ); + }, + getBuildOrder: () => getBuildOrder(state), + getUpToDateStatusOfProject: (project) => { + const configFileName = resolveProjectName(state, project); + const configFilePath = toResolvedConfigFilePath(state, configFileName); + return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath); + }, + invalidateProject: (configFilePath, updateLevel) => invalidateProject( + state, + configFilePath, + updateLevel || 0 + /* Update */ + ), + close: () => stopWatching(state) + }; + } + function relName(state, path2) { + return convertToRelativePath(path2, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName); + } + function reportStatus(state, message, ...args) { + state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args)); + } + function reportWatchStatus(state, message, ...args) { + var _a2, _b; + (_b = (_a2 = state.hostWithWatch).onWatchStatusChange) == null ? void 0 : _b.call(_a2, createCompilerDiagnostic(message, ...args), state.host.getNewLine(), state.baseCompilerOptions); + } + function reportErrors({ host }, errors) { + errors.forEach((err) => host.reportDiagnostic(err)); + } + function reportAndStoreErrors(state, proj, errors) { + reportErrors(state, errors); + state.projectErrorsReported.set(proj, true); + if (errors.length) { + state.diagnostics.set(proj, errors); + } + } + function reportParseConfigFileDiagnostic(state, proj) { + reportAndStoreErrors(state, proj, [state.configFileCache.get(proj)]); + } + function reportErrorSummary(state, buildOrder) { + if (!state.needsSummary) + return; + state.needsSummary = false; + const canReportSummary = state.watch || !!state.host.reportErrorSummary; + const { diagnostics } = state; + let totalErrors = 0; + let filesInError = []; + if (isCircularBuildOrder(buildOrder)) { + reportBuildQueue(state, buildOrder.buildOrder); + reportErrors(state, buildOrder.circularDiagnostics); + if (canReportSummary) + totalErrors += getErrorCountForSummary(buildOrder.circularDiagnostics); + if (canReportSummary) + filesInError = [...filesInError, ...getFilesInErrorForSummary(buildOrder.circularDiagnostics)]; + } else { + buildOrder.forEach((project) => { + const projectPath = toResolvedConfigFilePath(state, project); + if (!state.projectErrorsReported.has(projectPath)) { + reportErrors(state, diagnostics.get(projectPath) || emptyArray); + } + }); + if (canReportSummary) + diagnostics.forEach((singleProjectErrors) => totalErrors += getErrorCountForSummary(singleProjectErrors)); + if (canReportSummary) + diagnostics.forEach((singleProjectErrors) => [...filesInError, ...getFilesInErrorForSummary(singleProjectErrors)]); + } + if (state.watch) { + reportWatchStatus(state, getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors); + } else if (state.host.reportErrorSummary) { + state.host.reportErrorSummary(totalErrors, filesInError); + } + } + function reportBuildQueue(state, buildQueue) { + if (state.options.verbose) { + reportStatus(state, Diagnostics.Projects_in_this_build_Colon_0, buildQueue.map((s7) => "\r\n * " + relName(state, s7)).join("")); + } + } + function reportUpToDateStatus(state, configFileName, status) { + switch (status.type) { + case 6: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, + relName(state, configFileName), + relName(state, status.outOfDateOutputFileName), + relName(state, status.newerInputFileName) + ); + case 7: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, + relName(state, configFileName), + relName(state, status.outOfDateOutputFileName), + relName(state, status.newerProjectName) + ); + case 4: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, + relName(state, configFileName), + relName(state, status.missingOutputFileName) + ); + case 5: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1, + relName(state, configFileName), + relName(state, status.fileName) + ); + case 8: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted, + relName(state, configFileName), + relName(state, status.buildInfoFile) + ); + case 9: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions, + relName(state, configFileName), + relName(state, status.buildInfoFile) + ); + case 10: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more, + relName(state, configFileName), + relName(state, status.buildInfoFile), + relName(state, status.inputFile) + ); + case 1: + if (status.newestInputFileTime !== void 0) { + return reportStatus( + state, + Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2, + relName(state, configFileName), + relName(state, status.newestInputFileName || ""), + relName(state, status.oldestOutputFileName || "") + ); + } + break; + case 3: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed, + relName(state, configFileName), + relName(state, status.newerProjectName) + ); + case 2: + return reportStatus( + state, + Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies, + relName(state, configFileName) + ); + case 15: + return reportStatus( + state, + Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files, + relName(state, configFileName) + ); + case 11: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date, + relName(state, configFileName), + relName(state, status.upstreamProjectName) + ); + case 12: + return reportStatus( + state, + status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors, + relName(state, configFileName), + relName(state, status.upstreamProjectName) + ); + case 0: + return reportStatus( + state, + Diagnostics.Failed_to_parse_file_0_Colon_1, + relName(state, configFileName), + status.reason + ); + case 14: + return reportStatus( + state, + Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2, + relName(state, configFileName), + status.version, + version5 + ); + case 17: + return reportStatus( + state, + Diagnostics.Project_0_is_being_forcibly_rebuilt, + relName(state, configFileName) + ); + case 16: + case 13: + break; + default: + assertType(status); + } + } + function verboseReportProjectStatus(state, configFileName, status) { + if (state.options.verbose) { + reportUpToDateStatus(state, configFileName, status); + } + } + var minimumDate, maximumDate, InvalidatedProjectKind; + var init_tsbuildPublic = __esm2({ + "src/compiler/tsbuildPublic.ts"() { + "use strict"; + init_ts2(); + init_ts_performance(); + minimumDate = /* @__PURE__ */ new Date(-864e13); + maximumDate = /* @__PURE__ */ new Date(864e13); + InvalidatedProjectKind = /* @__PURE__ */ ((InvalidatedProjectKind2) => { + InvalidatedProjectKind2[InvalidatedProjectKind2["Build"] = 0] = "Build"; + InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateBundle"] = 1] = "UpdateBundle"; + InvalidatedProjectKind2[InvalidatedProjectKind2["UpdateOutputFileStamps"] = 2] = "UpdateOutputFileStamps"; + return InvalidatedProjectKind2; + })(InvalidatedProjectKind || {}); + } + }); + var init_ts2 = __esm2({ + "src/compiler/_namespaces/ts.ts"() { + "use strict"; + init_corePublic(); + init_core(); + init_debug(); + init_semver(); + init_performanceCore(); + init_perfLogger(); + init_tracing(); + init_types(); + init_sys(); + init_path2(); + init_diagnosticInformationMap_generated(); + init_scanner2(); + init_utilitiesPublic(); + init_utilities(); + init_baseNodeFactory(); + init_parenthesizerRules(); + init_nodeConverters(); + init_nodeFactory(); + init_emitNode(); + init_emitHelpers(); + init_nodeTests(); + init_utilities2(); + init_utilitiesPublic2(); + init_parser4(); + init_commandLineParser(); + init_moduleNameResolver(); + init_binder(); + init_symbolWalker(); + init_checker(); + init_visitorPublic(); + init_sourcemap(); + init_utilities3(); + init_destructuring(); + init_classThis(); + init_namedEvaluation(); + init_taggedTemplate(); + init_ts(); + init_classFields(); + init_typeSerializer(); + init_legacyDecorators(); + init_esDecorators(); + init_es2017(); + init_es2018(); + init_es2019(); + init_es2020(); + init_es2021(); + init_esnext(); + init_jsx(); + init_es2016(); + init_es2015(); + init_es5(); + init_generators(); + init_module2(); + init_system(); + init_esnextAnd2015(); + init_node(); + init_diagnostics(); + init_declarations(); + init_transformer(); + init_emitter(); + init_watchUtilities(); + init_program(); + init_builderStatePublic(); + init_builderState(); + init_builder(); + init_builderPublic(); + init_resolutionCache(); + init_watch(); + init_watchPublic(); + init_tsbuild(); + init_tsbuildPublic(); + init_ts_moduleSpecifiers(); + init_ts_performance(); + } + }); + function hasArgument(argumentName) { + return sys.args.includes(argumentName); + } + function findArgument(argumentName) { + const index4 = sys.args.indexOf(argumentName); + return index4 >= 0 && index4 < sys.args.length - 1 ? sys.args[index4 + 1] : void 0; + } + function nowString() { + const d7 = /* @__PURE__ */ new Date(); + return `${d7.getHours().toString().padStart(2, "0")}:${d7.getMinutes().toString().padStart(2, "0")}:${d7.getSeconds().toString().padStart(2, "0")}.${d7.getMilliseconds().toString().padStart(3, "0")}`; + } + function indent2(str2) { + return indentStr + str2.replace(/\n/g, indentStr); + } + function stringifyIndented(json2) { + return indent2(JSON.stringify(json2, void 0, 2)); + } + var ActionSet, ActionInvalidate, ActionPackageInstalled, EventTypesRegistry, EventBeginInstallTypes, EventEndInstallTypes, EventInitializationFailed, ActionWatchTypingLocations, Arguments, indentStr; + var init_shared = __esm2({ + "src/jsTyping/shared.ts"() { + "use strict"; + init_ts3(); + ActionSet = "action::set"; + ActionInvalidate = "action::invalidate"; + ActionPackageInstalled = "action::packageInstalled"; + EventTypesRegistry = "event::typesRegistry"; + EventBeginInstallTypes = "event::beginInstallTypes"; + EventEndInstallTypes = "event::endInstallTypes"; + EventInitializationFailed = "event::initializationFailed"; + ActionWatchTypingLocations = "action::watchTypingLocations"; + ((Arguments2) => { + Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments2.LogFile = "--logFile"; + Arguments2.EnableTelemetry = "--enableTelemetry"; + Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments2.TypesMapLocation = "--typesMapLocation"; + Arguments2.NpmLocation = "--npmLocation"; + Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; + })(Arguments || (Arguments = {})); + indentStr = "\n "; + } + }); + var init_types2 = __esm2({ + "src/jsTyping/types.ts"() { + "use strict"; + } + }); + var init_ts_server = __esm2({ + "src/jsTyping/_namespaces/ts.server.ts"() { + "use strict"; + init_shared(); + init_types2(); + } + }); + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); + return availableVersion.compareTo(cachedTyping.version) <= 0; + } + function nonRelativeModuleNameForTypingCache(moduleName3) { + return nodeCoreModules.has(moduleName3) ? "node" : moduleName3; + } + function loadSafeList(host, safeListPath) { + const result2 = readConfigFile(safeListPath, (path2) => host.readFile(path2)); + return new Map(Object.entries(result2.config)); + } + function loadTypesMap(host, typesMapPath) { + var _a2; + const result2 = readConfigFile(typesMapPath, (path2) => host.readFile(path2)); + if ((_a2 = result2.config) == null ? void 0 : _a2.simpleMap) { + return new Map(Object.entries(result2.config.simpleMap)); + } + return void 0; + } + function discoverTypings(host, log3, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry, compilerOptions) { + if (!typeAcquisition || !typeAcquisition.enable) { + return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; + } + const inferredTypings = /* @__PURE__ */ new Map(); + fileNames = mapDefined(fileNames, (fileName) => { + const path2 = normalizePath(fileName); + if (hasJSFileExtension(path2)) { + return path2; + } + }); + const filesToWatch = []; + if (typeAcquisition.include) + addInferredTypings(typeAcquisition.include, "Explicitly included types"); + const exclude = typeAcquisition.exclude || []; + if (!compilerOptions.types) { + const possibleSearchDirs = new Set(fileNames.map(getDirectoryPath)); + possibleSearchDirs.add(projectRootPath); + possibleSearchDirs.forEach((searchDir) => { + getTypingNames(searchDir, "bower.json", "bower_components", filesToWatch); + getTypingNames(searchDir, "package.json", "node_modules", filesToWatch); + }); + } + if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { + getTypingNamesFromSourceFileNames(fileNames); + } + if (unresolvedImports) { + const module22 = deduplicate( + unresolvedImports.map(nonRelativeModuleNameForTypingCache), + equateStringsCaseSensitive, + compareStringsCaseSensitive + ); + addInferredTypings(module22, "Inferred typings from unresolved imports"); + } + for (const excludeTypingName of exclude) { + const didDelete = inferredTypings.delete(excludeTypingName); + if (didDelete && log3) + log3(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`); + } + packageNameToTypingLocation.forEach((typing, name2) => { + const registryEntry = typesRegistry.get(name2); + if (inferredTypings.get(name2) === false && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) { + inferredTypings.set(name2, typing.typingLocation); + } + }); + const newTypingNames = []; + const cachedTypingPaths = []; + inferredTypings.forEach((inferred, typing) => { + if (inferred) { + cachedTypingPaths.push(inferred); + } else { + newTypingNames.push(typing); + } + }); + const result2 = { cachedTypingPaths, newTypingNames, filesToWatch }; + if (log3) + log3(`Finished typings discovery:${stringifyIndented(result2)}`); + return result2; + function addInferredTyping(typingName) { + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, false); + } + } + function addInferredTypings(typingNames, message) { + if (log3) + log3(`${message}: ${JSON.stringify(typingNames)}`); + forEach4(typingNames, addInferredTyping); + } + function getTypingNames(projectRootPath2, manifestName, modulesDirName, filesToWatch2) { + const manifestPath = combinePaths(projectRootPath2, manifestName); + let manifest; + let manifestTypingNames; + if (host.fileExists(manifestPath)) { + filesToWatch2.push(manifestPath); + manifest = readConfigFile(manifestPath, (path2) => host.readFile(path2)).config; + manifestTypingNames = flatMap2([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], getOwnKeys); + addInferredTypings(manifestTypingNames, `Typing names in '${manifestPath}' dependencies`); + } + const packagesFolderPath = combinePaths(projectRootPath2, modulesDirName); + filesToWatch2.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { + return; + } + const packageNames = []; + const dependencyManifestNames = manifestTypingNames ? manifestTypingNames.map((typingName) => combinePaths(packagesFolderPath, typingName, manifestName)) : host.readDirectory( + packagesFolderPath, + [ + ".json" + /* Json */ + ], + /*excludes*/ + void 0, + /*includes*/ + void 0, + /*depth*/ + 3 + ).filter((manifestPath2) => { + if (getBaseFileName(manifestPath2) !== manifestName) { + return false; + } + const pathComponents2 = getPathComponents(normalizePath(manifestPath2)); + const isScoped = pathComponents2[pathComponents2.length - 3][0] === "@"; + return isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 4]) === modulesDirName || // `node_modules/@foo/bar` + !isScoped && toFileNameLowerCase(pathComponents2[pathComponents2.length - 3]) === modulesDirName; + }); + if (log3) + log3(`Searching for typing names in ${packagesFolderPath}; all files: ${JSON.stringify(dependencyManifestNames)}`); + for (const manifestPath2 of dependencyManifestNames) { + const normalizedFileName = normalizePath(manifestPath2); + const result22 = readConfigFile(normalizedFileName, (path2) => host.readFile(path2)); + const manifest2 = result22.config; + if (!manifest2.name) { + continue; + } + const ownTypes = manifest2.types || manifest2.typings; + if (ownTypes) { + const absolutePath = getNormalizedAbsolutePath(ownTypes, getDirectoryPath(normalizedFileName)); + if (host.fileExists(absolutePath)) { + if (log3) + log3(` Package '${manifest2.name}' provides its own types.`); + inferredTypings.set(manifest2.name, absolutePath); + } else { + if (log3) + log3(` Package '${manifest2.name}' provides its own types but they are missing.`); + } + } else { + packageNames.push(manifest2.name); + } + } + addInferredTypings(packageNames, " Found package names"); + } + function getTypingNamesFromSourceFileNames(fileNames2) { + const fromFileNames = mapDefined(fileNames2, (j6) => { + if (!hasJSFileExtension(j6)) + return void 0; + const inferredTypingName = removeFileExtension(toFileNameLowerCase(getBaseFileName(j6))); + const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName); + return safeList.get(cleanedTypingName); + }); + if (fromFileNames.length) { + addInferredTypings(fromFileNames, "Inferred typings from file names"); + } + const hasJsxFile = some2(fileNames2, (f8) => fileExtensionIs( + f8, + ".jsx" + /* Jsx */ + )); + if (hasJsxFile) { + if (log3) + log3(`Inferred 'react' typings due to presence of '.jsx' extension`); + addInferredTyping("react"); + } + } + } + function validatePackageName(packageName) { + return validatePackageNameWorker( + packageName, + /*supportScopedPackage*/ + true + ); + } + function validatePackageNameWorker(packageName, supportScopedPackage) { + if (!packageName) { + return 1; + } + if (packageName.length > maxPackageNameLength) { + return 2; + } + if (packageName.charCodeAt(0) === 46) { + return 3; + } + if (packageName.charCodeAt(0) === 95) { + return 4; + } + if (supportScopedPackage) { + const matches2 = /^@([^/]+)\/([^/]+)$/.exec(packageName); + if (matches2) { + const scopeResult = validatePackageNameWorker( + matches2[1], + /*supportScopedPackage*/ + false + ); + if (scopeResult !== 0) { + return { name: matches2[1], isScopeName: true, result: scopeResult }; + } + const packageResult = validatePackageNameWorker( + matches2[2], + /*supportScopedPackage*/ + false + ); + if (packageResult !== 0) { + return { name: matches2[2], isScopeName: false, result: packageResult }; + } + return 0; + } + } + if (encodeURIComponent(packageName) !== packageName) { + return 5; + } + return 0; + } + function renderPackageNameValidationFailure(result2, typing) { + return typeof result2 === "object" ? renderPackageNameValidationFailureWorker(typing, result2.result, result2.name, result2.isScopeName) : renderPackageNameValidationFailureWorker( + typing, + result2, + typing, + /*isScopeName*/ + false + ); + } + function renderPackageNameValidationFailureWorker(typing, result2, name2, isScopeName) { + const kind = isScopeName ? "Scope" : "Package"; + switch (result2) { + case 1: + return `'${typing}':: ${kind} name '${name2}' cannot be empty`; + case 2: + return `'${typing}':: ${kind} name '${name2}' should be less than ${maxPackageNameLength} characters`; + case 3: + return `'${typing}':: ${kind} name '${name2}' cannot start with '.'`; + case 4: + return `'${typing}':: ${kind} name '${name2}' cannot start with '_'`; + case 5: + return `'${typing}':: ${kind} name '${name2}' contains non URI safe characters`; + case 0: + return Debug.fail(); + default: + Debug.assertNever(result2); + } + } + var unprefixedNodeCoreModuleList, prefixedNodeCoreModuleList, nodeCoreModuleList, nodeCoreModules, NameValidationResult, maxPackageNameLength; + var init_jsTyping = __esm2({ + "src/jsTyping/jsTyping.ts"() { + "use strict"; + init_ts3(); + init_ts_server(); + unprefixedNodeCoreModuleList = [ + "assert", + "assert/strict", + "async_hooks", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "diagnostics_channel", + "dns", + "dns/promises", + "domain", + "events", + "fs", + "fs/promises", + "http", + "https", + "http2", + "inspector", + "module", + "net", + "os", + "path", + "perf_hooks", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "stream/promises", + "string_decoder", + "timers", + "timers/promises", + "tls", + "trace_events", + "tty", + "url", + "util", + "util/types", + "v8", + "vm", + "wasi", + "worker_threads", + "zlib" + ]; + prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map((name2) => `node:${name2}`); + nodeCoreModuleList = [...unprefixedNodeCoreModuleList, ...prefixedNodeCoreModuleList]; + nodeCoreModules = new Set(nodeCoreModuleList); + NameValidationResult = /* @__PURE__ */ ((NameValidationResult2) => { + NameValidationResult2[NameValidationResult2["Ok"] = 0] = "Ok"; + NameValidationResult2[NameValidationResult2["EmptyName"] = 1] = "EmptyName"; + NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong"; + NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot"; + NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore"; + NameValidationResult2[NameValidationResult2["NameContainsNonURISafeCharacters"] = 5] = "NameContainsNonURISafeCharacters"; + return NameValidationResult2; + })(NameValidationResult || {}); + maxPackageNameLength = 214; + } + }); + var ts_JsTyping_exports = {}; + __export2(ts_JsTyping_exports, { + NameValidationResult: () => NameValidationResult, + discoverTypings: () => discoverTypings, + isTypingUpToDate: () => isTypingUpToDate, + loadSafeList: () => loadSafeList, + loadTypesMap: () => loadTypesMap, + nodeCoreModuleList: () => nodeCoreModuleList, + nodeCoreModules: () => nodeCoreModules, + nonRelativeModuleNameForTypingCache: () => nonRelativeModuleNameForTypingCache, + prefixedNodeCoreModuleList: () => prefixedNodeCoreModuleList, + renderPackageNameValidationFailure: () => renderPackageNameValidationFailure, + validatePackageName: () => validatePackageName + }); + var init_ts_JsTyping = __esm2({ + "src/jsTyping/_namespaces/ts.JsTyping.ts"() { + "use strict"; + init_jsTyping(); + } + }); + var init_ts3 = __esm2({ + "src/jsTyping/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts_JsTyping(); + init_ts_server(); + } + }); + function getDefaultFormatCodeSettings(newLineCharacter) { + return { + indentSize: 4, + tabSize: 4, + newLineCharacter: newLineCharacter || "\n", + convertTabsToSpaces: true, + indentStyle: 2, + insertSpaceAfterConstructor: false, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: true, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, + insertSpaceBeforeFunctionParenthesis: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, + semicolons: "ignore", + trimTrailingWhitespace: true, + indentSwitchCase: true + }; + } + var ScriptSnapshot, PackageJsonDependencyGroup, PackageJsonAutoImportPreference, LanguageServiceMode, emptyOptions, SemanticClassificationFormat, OrganizeImportsMode, CompletionTriggerKind, InlayHintKind, HighlightSpanKind, IndentStyle, SemicolonPreference, testFormatSettings, SymbolDisplayPartKind, CompletionInfoFlags, OutliningSpanKind, OutputFileType, EndOfLineState, TokenClass, ScriptElementKind, ScriptElementKindModifier, ClassificationTypeNames, ClassificationType; + var init_types3 = __esm2({ + "src/services/types.ts"() { + "use strict"; + ((ScriptSnapshot2) => { + class StringScriptSnapshot { + constructor(text) { + this.text = text; + } + getText(start, end) { + return start === 0 && end === this.text.length ? this.text : this.text.substring(start, end); + } + getLength() { + return this.text.length; + } + getChangeRange() { + return void 0; + } + } + function fromString(text) { + return new StringScriptSnapshot(text); + } + ScriptSnapshot2.fromString = fromString; + })(ScriptSnapshot || (ScriptSnapshot = {})); + PackageJsonDependencyGroup = /* @__PURE__ */ ((PackageJsonDependencyGroup2) => { + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["Dependencies"] = 1] = "Dependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["DevDependencies"] = 2] = "DevDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["PeerDependencies"] = 4] = "PeerDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["OptionalDependencies"] = 8] = "OptionalDependencies"; + PackageJsonDependencyGroup2[PackageJsonDependencyGroup2["All"] = 15] = "All"; + return PackageJsonDependencyGroup2; + })(PackageJsonDependencyGroup || {}); + PackageJsonAutoImportPreference = /* @__PURE__ */ ((PackageJsonAutoImportPreference2) => { + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Off"] = 0] = "Off"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["On"] = 1] = "On"; + PackageJsonAutoImportPreference2[PackageJsonAutoImportPreference2["Auto"] = 2] = "Auto"; + return PackageJsonAutoImportPreference2; + })(PackageJsonAutoImportPreference || {}); + LanguageServiceMode = /* @__PURE__ */ ((LanguageServiceMode2) => { + LanguageServiceMode2[LanguageServiceMode2["Semantic"] = 0] = "Semantic"; + LanguageServiceMode2[LanguageServiceMode2["PartialSemantic"] = 1] = "PartialSemantic"; + LanguageServiceMode2[LanguageServiceMode2["Syntactic"] = 2] = "Syntactic"; + return LanguageServiceMode2; + })(LanguageServiceMode || {}); + emptyOptions = {}; + SemanticClassificationFormat = /* @__PURE__ */ ((SemanticClassificationFormat2) => { + SemanticClassificationFormat2["Original"] = "original"; + SemanticClassificationFormat2["TwentyTwenty"] = "2020"; + return SemanticClassificationFormat2; + })(SemanticClassificationFormat || {}); + OrganizeImportsMode = /* @__PURE__ */ ((OrganizeImportsMode3) => { + OrganizeImportsMode3["All"] = "All"; + OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; + return OrganizeImportsMode3; + })(OrganizeImportsMode || {}); + CompletionTriggerKind = /* @__PURE__ */ ((CompletionTriggerKind4) => { + CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + return CompletionTriggerKind4; + })(CompletionTriggerKind || {}); + InlayHintKind = /* @__PURE__ */ ((InlayHintKind2) => { + InlayHintKind2["Type"] = "Type"; + InlayHintKind2["Parameter"] = "Parameter"; + InlayHintKind2["Enum"] = "Enum"; + return InlayHintKind2; + })(InlayHintKind || {}); + HighlightSpanKind = /* @__PURE__ */ ((HighlightSpanKind2) => { + HighlightSpanKind2["none"] = "none"; + HighlightSpanKind2["definition"] = "definition"; + HighlightSpanKind2["reference"] = "reference"; + HighlightSpanKind2["writtenReference"] = "writtenReference"; + return HighlightSpanKind2; + })(HighlightSpanKind || {}); + IndentStyle = /* @__PURE__ */ ((IndentStyle3) => { + IndentStyle3[IndentStyle3["None"] = 0] = "None"; + IndentStyle3[IndentStyle3["Block"] = 1] = "Block"; + IndentStyle3[IndentStyle3["Smart"] = 2] = "Smart"; + return IndentStyle3; + })(IndentStyle || {}); + SemicolonPreference = /* @__PURE__ */ ((SemicolonPreference3) => { + SemicolonPreference3["Ignore"] = "ignore"; + SemicolonPreference3["Insert"] = "insert"; + SemicolonPreference3["Remove"] = "remove"; + return SemicolonPreference3; + })(SemicolonPreference || {}); + testFormatSettings = getDefaultFormatCodeSettings("\n"); + SymbolDisplayPartKind = /* @__PURE__ */ ((SymbolDisplayPartKind2) => { + SymbolDisplayPartKind2[SymbolDisplayPartKind2["aliasName"] = 0] = "aliasName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["className"] = 1] = "className"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumName"] = 2] = "enumName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["fieldName"] = 3] = "fieldName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["interfaceName"] = 4] = "interfaceName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["keyword"] = 5] = "keyword"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["lineBreak"] = 6] = "lineBreak"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["numericLiteral"] = 7] = "numericLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["stringLiteral"] = 8] = "stringLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["localName"] = 9] = "localName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["methodName"] = 10] = "methodName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["moduleName"] = 11] = "moduleName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["operator"] = 12] = "operator"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["parameterName"] = 13] = "parameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["propertyName"] = 14] = "propertyName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["punctuation"] = 15] = "punctuation"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["space"] = 16] = "space"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["text"] = 17] = "text"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["typeParameterName"] = 18] = "typeParameterName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["enumMemberName"] = 19] = "enumMemberName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["functionName"] = 20] = "functionName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["link"] = 22] = "link"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkName"] = 23] = "linkName"; + SymbolDisplayPartKind2[SymbolDisplayPartKind2["linkText"] = 24] = "linkText"; + return SymbolDisplayPartKind2; + })(SymbolDisplayPartKind || {}); + CompletionInfoFlags = /* @__PURE__ */ ((CompletionInfoFlags2) => { + CompletionInfoFlags2[CompletionInfoFlags2["None"] = 0] = "None"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeAutoImports"] = 1] = "MayIncludeAutoImports"; + CompletionInfoFlags2[CompletionInfoFlags2["IsImportStatementCompletion"] = 2] = "IsImportStatementCompletion"; + CompletionInfoFlags2[CompletionInfoFlags2["IsContinuation"] = 4] = "IsContinuation"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiers"] = 8] = "ResolvedModuleSpecifiers"; + CompletionInfoFlags2[CompletionInfoFlags2["ResolvedModuleSpecifiersBeyondLimit"] = 16] = "ResolvedModuleSpecifiersBeyondLimit"; + CompletionInfoFlags2[CompletionInfoFlags2["MayIncludeMethodSnippets"] = 32] = "MayIncludeMethodSnippets"; + return CompletionInfoFlags2; + })(CompletionInfoFlags || {}); + OutliningSpanKind = /* @__PURE__ */ ((OutliningSpanKind2) => { + OutliningSpanKind2["Comment"] = "comment"; + OutliningSpanKind2["Region"] = "region"; + OutliningSpanKind2["Code"] = "code"; + OutliningSpanKind2["Imports"] = "imports"; + return OutliningSpanKind2; + })(OutliningSpanKind || {}); + OutputFileType = /* @__PURE__ */ ((OutputFileType2) => { + OutputFileType2[OutputFileType2["JavaScript"] = 0] = "JavaScript"; + OutputFileType2[OutputFileType2["SourceMap"] = 1] = "SourceMap"; + OutputFileType2[OutputFileType2["Declaration"] = 2] = "Declaration"; + return OutputFileType2; + })(OutputFileType || {}); + EndOfLineState = /* @__PURE__ */ ((EndOfLineState2) => { + EndOfLineState2[EndOfLineState2["None"] = 0] = "None"; + EndOfLineState2[EndOfLineState2["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; + EndOfLineState2[EndOfLineState2["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; + EndOfLineState2[EndOfLineState2["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; + EndOfLineState2[EndOfLineState2["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; + EndOfLineState2[EndOfLineState2["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; + return EndOfLineState2; + })(EndOfLineState || {}); + TokenClass = /* @__PURE__ */ ((TokenClass2) => { + TokenClass2[TokenClass2["Punctuation"] = 0] = "Punctuation"; + TokenClass2[TokenClass2["Keyword"] = 1] = "Keyword"; + TokenClass2[TokenClass2["Operator"] = 2] = "Operator"; + TokenClass2[TokenClass2["Comment"] = 3] = "Comment"; + TokenClass2[TokenClass2["Whitespace"] = 4] = "Whitespace"; + TokenClass2[TokenClass2["Identifier"] = 5] = "Identifier"; + TokenClass2[TokenClass2["NumberLiteral"] = 6] = "NumberLiteral"; + TokenClass2[TokenClass2["BigIntLiteral"] = 7] = "BigIntLiteral"; + TokenClass2[TokenClass2["StringLiteral"] = 8] = "StringLiteral"; + TokenClass2[TokenClass2["RegExpLiteral"] = 9] = "RegExpLiteral"; + return TokenClass2; + })(TokenClass || {}); + ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => { + ScriptElementKind2["unknown"] = ""; + ScriptElementKind2["warning"] = "warning"; + ScriptElementKind2["keyword"] = "keyword"; + ScriptElementKind2["scriptElement"] = "script"; + ScriptElementKind2["moduleElement"] = "module"; + ScriptElementKind2["classElement"] = "class"; + ScriptElementKind2["localClassElement"] = "local class"; + ScriptElementKind2["interfaceElement"] = "interface"; + ScriptElementKind2["typeElement"] = "type"; + ScriptElementKind2["enumElement"] = "enum"; + ScriptElementKind2["enumMemberElement"] = "enum member"; + ScriptElementKind2["variableElement"] = "var"; + ScriptElementKind2["localVariableElement"] = "local var"; + ScriptElementKind2["variableUsingElement"] = "using"; + ScriptElementKind2["variableAwaitUsingElement"] = "await using"; + ScriptElementKind2["functionElement"] = "function"; + ScriptElementKind2["localFunctionElement"] = "local function"; + ScriptElementKind2["memberFunctionElement"] = "method"; + ScriptElementKind2["memberGetAccessorElement"] = "getter"; + ScriptElementKind2["memberSetAccessorElement"] = "setter"; + ScriptElementKind2["memberVariableElement"] = "property"; + ScriptElementKind2["memberAccessorVariableElement"] = "accessor"; + ScriptElementKind2["constructorImplementationElement"] = "constructor"; + ScriptElementKind2["callSignatureElement"] = "call"; + ScriptElementKind2["indexSignatureElement"] = "index"; + ScriptElementKind2["constructSignatureElement"] = "construct"; + ScriptElementKind2["parameterElement"] = "parameter"; + ScriptElementKind2["typeParameterElement"] = "type parameter"; + ScriptElementKind2["primitiveType"] = "primitive type"; + ScriptElementKind2["label"] = "label"; + ScriptElementKind2["alias"] = "alias"; + ScriptElementKind2["constElement"] = "const"; + ScriptElementKind2["letElement"] = "let"; + ScriptElementKind2["directory"] = "directory"; + ScriptElementKind2["externalModuleName"] = "external module name"; + ScriptElementKind2["jsxAttribute"] = "JSX attribute"; + ScriptElementKind2["string"] = "string"; + ScriptElementKind2["link"] = "link"; + ScriptElementKind2["linkName"] = "link name"; + ScriptElementKind2["linkText"] = "link text"; + return ScriptElementKind2; + })(ScriptElementKind || {}); + ScriptElementKindModifier = /* @__PURE__ */ ((ScriptElementKindModifier2) => { + ScriptElementKindModifier2["none"] = ""; + ScriptElementKindModifier2["publicMemberModifier"] = "public"; + ScriptElementKindModifier2["privateMemberModifier"] = "private"; + ScriptElementKindModifier2["protectedMemberModifier"] = "protected"; + ScriptElementKindModifier2["exportedModifier"] = "export"; + ScriptElementKindModifier2["ambientModifier"] = "declare"; + ScriptElementKindModifier2["staticModifier"] = "static"; + ScriptElementKindModifier2["abstractModifier"] = "abstract"; + ScriptElementKindModifier2["optionalModifier"] = "optional"; + ScriptElementKindModifier2["deprecatedModifier"] = "deprecated"; + ScriptElementKindModifier2["dtsModifier"] = ".d.ts"; + ScriptElementKindModifier2["tsModifier"] = ".ts"; + ScriptElementKindModifier2["tsxModifier"] = ".tsx"; + ScriptElementKindModifier2["jsModifier"] = ".js"; + ScriptElementKindModifier2["jsxModifier"] = ".jsx"; + ScriptElementKindModifier2["jsonModifier"] = ".json"; + ScriptElementKindModifier2["dmtsModifier"] = ".d.mts"; + ScriptElementKindModifier2["mtsModifier"] = ".mts"; + ScriptElementKindModifier2["mjsModifier"] = ".mjs"; + ScriptElementKindModifier2["dctsModifier"] = ".d.cts"; + ScriptElementKindModifier2["ctsModifier"] = ".cts"; + ScriptElementKindModifier2["cjsModifier"] = ".cjs"; + return ScriptElementKindModifier2; + })(ScriptElementKindModifier || {}); + ClassificationTypeNames = /* @__PURE__ */ ((ClassificationTypeNames2) => { + ClassificationTypeNames2["comment"] = "comment"; + ClassificationTypeNames2["identifier"] = "identifier"; + ClassificationTypeNames2["keyword"] = "keyword"; + ClassificationTypeNames2["numericLiteral"] = "number"; + ClassificationTypeNames2["bigintLiteral"] = "bigint"; + ClassificationTypeNames2["operator"] = "operator"; + ClassificationTypeNames2["stringLiteral"] = "string"; + ClassificationTypeNames2["whiteSpace"] = "whitespace"; + ClassificationTypeNames2["text"] = "text"; + ClassificationTypeNames2["punctuation"] = "punctuation"; + ClassificationTypeNames2["className"] = "class name"; + ClassificationTypeNames2["enumName"] = "enum name"; + ClassificationTypeNames2["interfaceName"] = "interface name"; + ClassificationTypeNames2["moduleName"] = "module name"; + ClassificationTypeNames2["typeParameterName"] = "type parameter name"; + ClassificationTypeNames2["typeAliasName"] = "type alias name"; + ClassificationTypeNames2["parameterName"] = "parameter name"; + ClassificationTypeNames2["docCommentTagName"] = "doc comment tag name"; + ClassificationTypeNames2["jsxOpenTagName"] = "jsx open tag name"; + ClassificationTypeNames2["jsxCloseTagName"] = "jsx close tag name"; + ClassificationTypeNames2["jsxSelfClosingTagName"] = "jsx self closing tag name"; + ClassificationTypeNames2["jsxAttribute"] = "jsx attribute"; + ClassificationTypeNames2["jsxText"] = "jsx text"; + ClassificationTypeNames2["jsxAttributeStringLiteralValue"] = "jsx attribute string literal value"; + return ClassificationTypeNames2; + })(ClassificationTypeNames || {}); + ClassificationType = /* @__PURE__ */ ((ClassificationType3) => { + ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; + ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; + ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; + ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; + ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType3[ClassificationType3["text"] = 9] = "text"; + ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; + ClassificationType3[ClassificationType3["className"] = 11] = "className"; + ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; + ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; + ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; + ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; + ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; + ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; + return ClassificationType3; + })(ClassificationType || {}); + } + }); + function getMeaningFromDeclaration(node) { + switch (node.kind) { + case 260: + return isInJSFile(node) && getJSDocEnumTag(node) ? 7 : 1; + case 169: + case 208: + case 172: + case 171: + case 303: + case 304: + case 174: + case 173: + case 176: + case 177: + case 178: + case 262: + case 218: + case 219: + case 299: + case 291: + return 1; + case 168: + case 264: + case 265: + case 187: + return 2; + case 353: + return node.name === void 0 ? 1 | 2 : 2; + case 306: + case 263: + return 1 | 2; + case 267: + if (isAmbientModule(node)) { + return 4 | 1; + } else if (getModuleInstanceState(node) === 1) { + return 4 | 1; + } else { + return 4; + } + case 266: + case 275: + case 276: + case 271: + case 272: + case 277: + case 278: + return 7; + case 312: + return 4 | 1; + } + return 7; + } + function getMeaningFromLocation(node) { + node = getAdjustedReferenceLocation(node); + const parent22 = node.parent; + if (node.kind === 312) { + return 1; + } else if (isExportAssignment(parent22) || isExportSpecifier(parent22) || isExternalModuleReference(parent22) || isImportSpecifier(parent22) || isImportClause(parent22) || isImportEqualsDeclaration(parent22) && node === parent22.name) { + return 7; + } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { + return getMeaningFromRightHandSideOfImportEquals(node); + } else if (isDeclarationName(node)) { + return getMeaningFromDeclaration(parent22); + } else if (isEntityName(node) && findAncestor(node, or(isJSDocNameReference, isJSDocLinkLike, isJSDocMemberName))) { + return 7; + } else if (isTypeReference(node)) { + return 2; + } else if (isNamespaceReference(node)) { + return 4; + } else if (isTypeParameterDeclaration(parent22)) { + Debug.assert(isJSDocTemplateTag(parent22.parent)); + return 2; + } else if (isLiteralTypeNode(parent22)) { + return 2 | 1; + } else { + return 1; + } + } + function getMeaningFromRightHandSideOfImportEquals(node) { + const name2 = node.kind === 166 ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : void 0; + return name2 && name2.parent.kind === 271 ? 7 : 4; + } + function isInRightSideOfInternalImportEqualsDeclaration(node) { + while (node.parent.kind === 166) { + node = node.parent; + } + return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; + } + function isNamespaceReference(node) { + return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); + } + function isQualifiedNameNamespaceReference(node) { + let root2 = node; + let isLastClause = true; + if (root2.parent.kind === 166) { + while (root2.parent && root2.parent.kind === 166) { + root2 = root2.parent; + } + isLastClause = root2.right === node; + } + return root2.parent.kind === 183 && !isLastClause; + } + function isPropertyAccessNamespaceReference(node) { + let root2 = node; + let isLastClause = true; + if (root2.parent.kind === 211) { + while (root2.parent && root2.parent.kind === 211) { + root2 = root2.parent; + } + isLastClause = root2.name === node; + } + if (!isLastClause && root2.parent.kind === 233 && root2.parent.parent.kind === 298) { + const decl = root2.parent.parent.parent; + return decl.kind === 263 && root2.parent.parent.token === 119 || decl.kind === 264 && root2.parent.parent.token === 96; + } + return false; + } + function isTypeReference(node) { + if (isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + switch (node.kind) { + case 110: + return !isExpressionNode(node); + case 197: + return true; + } + switch (node.parent.kind) { + case 183: + return true; + case 205: + return !node.parent.isTypeOf; + case 233: + return isPartOfTypeNode(node.parent); + } + return false; + } + function isCallExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isCallExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + function isNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + function isCallOrNewExpressionTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isCallOrNewExpression, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + function isTaggedTemplateTag(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isTaggedTemplateExpression, selectTagOfTaggedTemplateExpression, includeElementAccess, skipPastOuterExpressions); + } + function isDecoratorTarget(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isDecorator, selectExpressionOfCallOrNewExpressionOrDecorator, includeElementAccess, skipPastOuterExpressions); + } + function isJsxOpeningLikeElementTagName(node, includeElementAccess = false, skipPastOuterExpressions = false) { + return isCalleeWorker(node, isJsxOpeningLikeElement, selectTagNameOfJsxOpeningLikeElement, includeElementAccess, skipPastOuterExpressions); + } + function selectExpressionOfCallOrNewExpressionOrDecorator(node) { + return node.expression; + } + function selectTagOfTaggedTemplateExpression(node) { + return node.tag; + } + function selectTagNameOfJsxOpeningLikeElement(node) { + return node.tagName; + } + function isCalleeWorker(node, pred, calleeSelector, includeElementAccess, skipPastOuterExpressions) { + let target = includeElementAccess ? climbPastPropertyOrElementAccess(node) : climbPastPropertyAccess(node); + if (skipPastOuterExpressions) { + target = skipOuterExpressions(target); + } + return !!target && !!target.parent && pred(target.parent) && calleeSelector(target.parent) === target; + } + function climbPastPropertyAccess(node) { + return isRightSideOfPropertyAccess(node) ? node.parent : node; + } + function climbPastPropertyOrElementAccess(node) { + return isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node) ? node.parent : node; + } + function getTargetLabel(referenceNode, labelName) { + while (referenceNode) { + if (referenceNode.kind === 256 && referenceNode.label.escapedText === labelName) { + return referenceNode.label; + } + referenceNode = referenceNode.parent; + } + return void 0; + } + function hasPropertyAccessExpressionWithName(node, funcName) { + if (!isPropertyAccessExpression(node.expression)) { + return false; + } + return node.expression.name.text === funcName; + } + function isJumpStatementTarget(node) { + var _a2; + return isIdentifier(node) && ((_a2 = tryCast(node.parent, isBreakOrContinueStatement)) == null ? void 0 : _a2.label) === node; + } + function isLabelOfLabeledStatement(node) { + var _a2; + return isIdentifier(node) && ((_a2 = tryCast(node.parent, isLabeledStatement)) == null ? void 0 : _a2.label) === node; + } + function isLabelName(node) { + return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); + } + function isTagName(node) { + var _a2; + return ((_a2 = tryCast(node.parent, isJSDocTag)) == null ? void 0 : _a2.tagName) === node; + } + function isRightSideOfQualifiedName(node) { + var _a2; + return ((_a2 = tryCast(node.parent, isQualifiedName)) == null ? void 0 : _a2.right) === node; + } + function isRightSideOfPropertyAccess(node) { + var _a2; + return ((_a2 = tryCast(node.parent, isPropertyAccessExpression)) == null ? void 0 : _a2.name) === node; + } + function isArgumentExpressionOfElementAccess(node) { + var _a2; + return ((_a2 = tryCast(node.parent, isElementAccessExpression)) == null ? void 0 : _a2.argumentExpression) === node; + } + function isNameOfModuleDeclaration(node) { + var _a2; + return ((_a2 = tryCast(node.parent, isModuleDeclaration)) == null ? void 0 : _a2.name) === node; + } + function isNameOfFunctionDeclaration(node) { + var _a2; + return isIdentifier(node) && ((_a2 = tryCast(node.parent, isFunctionLike)) == null ? void 0 : _a2.name) === node; + } + function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { + switch (node.parent.kind) { + case 172: + case 171: + case 303: + case 306: + case 174: + case 173: + case 177: + case 178: + case 267: + return getNameOfDeclaration(node.parent) === node; + case 212: + return node.parent.argumentExpression === node; + case 167: + return true; + case 201: + return node.parent.parent.kind === 199; + default: + return false; + } + } + function isExpressionOfExternalModuleImportEqualsDeclaration(node) { + return isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node; + } + function getContainerNode(node) { + if (isJSDocTypeAlias(node)) { + node = node.parent.parent; + } + while (true) { + node = node.parent; + if (!node) { + return void 0; + } + switch (node.kind) { + case 312: + case 174: + case 173: + case 262: + case 218: + case 177: + case 178: + case 263: + case 264: + case 266: + case 267: + return node; + } + } + } + function getNodeKind(node) { + switch (node.kind) { + case 312: + return isExternalModule(node) ? "module" : "script"; + case 267: + return "module"; + case 263: + case 231: + return "class"; + case 264: + return "interface"; + case 265: + case 345: + case 353: + return "type"; + case 266: + return "enum"; + case 260: + return getKindOfVariableDeclaration(node); + case 208: + return getKindOfVariableDeclaration(getRootDeclaration(node)); + case 219: + case 262: + case 218: + return "function"; + case 177: + return "getter"; + case 178: + return "setter"; + case 174: + case 173: + return "method"; + case 303: + const { initializer } = node; + return isFunctionLike(initializer) ? "method" : "property"; + case 172: + case 171: + case 304: + case 305: + return "property"; + case 181: + return "index"; + case 180: + return "construct"; + case 179: + return "call"; + case 176: + case 175: + return "constructor"; + case 168: + return "type parameter"; + case 306: + return "enum member"; + case 169: + return hasSyntacticModifier( + node, + 31 + /* ParameterPropertyModifier */ + ) ? "property" : "parameter"; + case 271: + case 276: + case 281: + case 274: + case 280: + return "alias"; + case 226: + const kind = getAssignmentDeclarationKind(node); + const { right } = node; + switch (kind) { + case 7: + case 8: + case 9: + case 0: + return ""; + case 1: + case 2: + const rightKind = getNodeKind(right); + return rightKind === "" ? "const" : rightKind; + case 3: + return isFunctionExpression(right) ? "method" : "property"; + case 4: + return "property"; + case 5: + return isFunctionExpression(right) ? "method" : "property"; + case 6: + return "local class"; + default: { + assertType(kind); + return ""; + } + } + case 80: + return isImportClause(node.parent) ? "alias" : ""; + case 277: + const scriptKind = getNodeKind(node.expression); + return scriptKind === "" ? "const" : scriptKind; + default: + return ""; + } + function getKindOfVariableDeclaration(v8) { + return isVarConst(v8) ? "const" : isLet(v8) ? "let" : "var"; + } + } + function isThis(node) { + switch (node.kind) { + case 110: + return true; + case 80: + return identifierIsThisKeyword(node) && node.parent.kind === 169; + default: + return false; + } + } + function getLineStartPositionForPosition(position, sourceFile) { + const lineStarts = getLineStarts(sourceFile); + const line = sourceFile.getLineAndCharacterOfPosition(position).line; + return lineStarts[line]; + } + function rangeContainsRange(r1, r22) { + return startEndContainsRange(r1.pos, r1.end, r22); + } + function rangeContainsRangeExclusive(r1, r22) { + return rangeContainsPositionExclusive(r1, r22.pos) && rangeContainsPositionExclusive(r1, r22.end); + } + function rangeContainsPosition(r8, pos) { + return r8.pos <= pos && pos <= r8.end; + } + function rangeContainsPositionExclusive(r8, pos) { + return r8.pos < pos && pos < r8.end; + } + function startEndContainsRange(start, end, range2) { + return start <= range2.pos && end >= range2.end; + } + function rangeContainsStartEnd(range2, start, end) { + return range2.pos <= start && range2.end >= end; + } + function rangeOverlapsWithStartEnd(r1, start, end) { + return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); + } + function nodeOverlapsWithStartEnd(node, sourceFile, start, end) { + return startEndOverlapsWithStartEnd(node.getStart(sourceFile), node.end, start, end); + } + function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { + const start = Math.max(start1, start2); + const end = Math.min(end1, end2); + return start < end; + } + function positionBelongsToNode(candidate, position, sourceFile) { + Debug.assert(candidate.pos <= position); + return position < candidate.end || !isCompletedNode(candidate, sourceFile); + } + function isCompletedNode(n7, sourceFile) { + if (n7 === void 0 || nodeIsMissing(n7)) { + return false; + } + switch (n7.kind) { + case 263: + case 264: + case 266: + case 210: + case 206: + case 187: + case 241: + case 268: + case 269: + case 275: + case 279: + return nodeEndsWith(n7, 20, sourceFile); + case 299: + return isCompletedNode(n7.block, sourceFile); + case 214: + if (!n7.arguments) { + return true; + } + case 213: + case 217: + case 196: + return nodeEndsWith(n7, 22, sourceFile); + case 184: + case 185: + return isCompletedNode(n7.type, sourceFile); + case 176: + case 177: + case 178: + case 262: + case 218: + case 174: + case 173: + case 180: + case 179: + case 219: + if (n7.body) { + return isCompletedNode(n7.body, sourceFile); + } + if (n7.type) { + return isCompletedNode(n7.type, sourceFile); + } + return hasChildOfKind(n7, 22, sourceFile); + case 267: + return !!n7.body && isCompletedNode(n7.body, sourceFile); + case 245: + if (n7.elseStatement) { + return isCompletedNode(n7.elseStatement, sourceFile); + } + return isCompletedNode(n7.thenStatement, sourceFile); + case 244: + return isCompletedNode(n7.expression, sourceFile) || hasChildOfKind(n7, 27, sourceFile); + case 209: + case 207: + case 212: + case 167: + case 189: + return nodeEndsWith(n7, 24, sourceFile); + case 181: + if (n7.type) { + return isCompletedNode(n7.type, sourceFile); + } + return hasChildOfKind(n7, 24, sourceFile); + case 296: + case 297: + return false; + case 248: + case 249: + case 250: + case 247: + return isCompletedNode(n7.statement, sourceFile); + case 246: + return hasChildOfKind(n7, 117, sourceFile) ? nodeEndsWith(n7, 22, sourceFile) : isCompletedNode(n7.statement, sourceFile); + case 186: + return isCompletedNode(n7.exprName, sourceFile); + case 221: + case 220: + case 222: + case 229: + case 230: + const unaryWordExpression = n7; + return isCompletedNode(unaryWordExpression.expression, sourceFile); + case 215: + return isCompletedNode(n7.template, sourceFile); + case 228: + const lastSpan = lastOrUndefined(n7.templateSpans); + return isCompletedNode(lastSpan, sourceFile); + case 239: + return nodeIsPresent(n7.literal); + case 278: + case 272: + return nodeIsPresent(n7.moduleSpecifier); + case 224: + return isCompletedNode(n7.operand, sourceFile); + case 226: + return isCompletedNode(n7.right, sourceFile); + case 227: + return isCompletedNode(n7.whenFalse, sourceFile); + default: + return true; + } + } + function nodeEndsWith(n7, expectedLastToken, sourceFile) { + const children = n7.getChildren(sourceFile); + if (children.length) { + const lastChild = last2(children); + if (lastChild.kind === expectedLastToken) { + return true; + } else if (lastChild.kind === 27 && children.length !== 1) { + return children[children.length - 2].kind === expectedLastToken; + } + } + return false; + } + function findListItemInfo(node) { + const list = findContainingList(node); + if (!list) { + return void 0; + } + const children = list.getChildren(); + const listItemIndex = indexOfNode(children, node); + return { + listItemIndex, + list + }; + } + function hasChildOfKind(n7, kind, sourceFile) { + return !!findChildOfKind(n7, kind, sourceFile); + } + function findChildOfKind(n7, kind, sourceFile) { + return find2(n7.getChildren(sourceFile), (c7) => c7.kind === kind); + } + function findContainingList(node) { + const syntaxList = find2(node.parent.getChildren(), (c7) => isSyntaxList(c7) && rangeContainsRange(c7, node)); + Debug.assert(!syntaxList || contains2(syntaxList.getChildren(), node)); + return syntaxList; + } + function isDefaultModifier2(node) { + return node.kind === 90; + } + function isClassKeyword(node) { + return node.kind === 86; + } + function isFunctionKeyword(node) { + return node.kind === 100; + } + function getAdjustedLocationForClass(node) { + if (isNamedDeclaration(node)) { + return node.name; + } + if (isClassDeclaration(node)) { + const defaultModifier = node.modifiers && find2(node.modifiers, isDefaultModifier2); + if (defaultModifier) + return defaultModifier; + } + if (isClassExpression(node)) { + const classKeyword = find2(node.getChildren(), isClassKeyword); + if (classKeyword) + return classKeyword; + } + } + function getAdjustedLocationForFunction(node) { + if (isNamedDeclaration(node)) { + return node.name; + } + if (isFunctionDeclaration(node)) { + const defaultModifier = find2(node.modifiers, isDefaultModifier2); + if (defaultModifier) + return defaultModifier; + } + if (isFunctionExpression(node)) { + const functionKeyword = find2(node.getChildren(), isFunctionKeyword); + if (functionKeyword) + return functionKeyword; + } + } + function getAncestorTypeNode(node) { + let lastTypeNode; + findAncestor(node, (a7) => { + if (isTypeNode(a7)) { + lastTypeNode = a7; + } + return !isQualifiedName(a7.parent) && !isTypeNode(a7.parent) && !isTypeElement(a7.parent); + }); + return lastTypeNode; + } + function getContextualTypeFromParentOrAncestorTypeNode(node, checker) { + if (node.flags & (16777216 & ~524288)) + return void 0; + const contextualType = getContextualTypeFromParent(node, checker); + if (contextualType) + return contextualType; + const ancestorTypeNode = getAncestorTypeNode(node); + return ancestorTypeNode && checker.getTypeAtLocation(ancestorTypeNode); + } + function getAdjustedLocationForDeclaration(node, forRename) { + if (!forRename) { + switch (node.kind) { + case 263: + case 231: + return getAdjustedLocationForClass(node); + case 262: + case 218: + return getAdjustedLocationForFunction(node); + case 176: + return node; + } + } + if (isNamedDeclaration(node)) { + return node.name; + } + } + function getAdjustedLocationForImportDeclaration(node, forRename) { + if (node.importClause) { + if (node.importClause.name && node.importClause.namedBindings) { + return; + } + if (node.importClause.name) { + return node.importClause.name; + } + if (node.importClause.namedBindings) { + if (isNamedImports(node.importClause.namedBindings)) { + const onlyBinding = singleOrUndefined(node.importClause.namedBindings.elements); + if (!onlyBinding) { + return; + } + return onlyBinding.name; + } else if (isNamespaceImport(node.importClause.namedBindings)) { + return node.importClause.namedBindings.name; + } + } + } + if (!forRename) { + return node.moduleSpecifier; + } + } + function getAdjustedLocationForExportDeclaration(node, forRename) { + if (node.exportClause) { + if (isNamedExports(node.exportClause)) { + const onlyBinding = singleOrUndefined(node.exportClause.elements); + if (!onlyBinding) { + return; + } + return node.exportClause.elements[0].name; + } else if (isNamespaceExport(node.exportClause)) { + return node.exportClause.name; + } + } + if (!forRename) { + return node.moduleSpecifier; + } + } + function getAdjustedLocationForHeritageClause(node) { + if (node.types.length === 1) { + return node.types[0].expression; + } + } + function getAdjustedLocation(node, forRename) { + const { parent: parent22 } = node; + if (isModifier(node) && (forRename || node.kind !== 90) ? canHaveModifiers(parent22) && contains2(parent22.modifiers, node) : node.kind === 86 ? isClassDeclaration(parent22) || isClassExpression(node) : node.kind === 100 ? isFunctionDeclaration(parent22) || isFunctionExpression(node) : node.kind === 120 ? isInterfaceDeclaration(parent22) : node.kind === 94 ? isEnumDeclaration(parent22) : node.kind === 156 ? isTypeAliasDeclaration(parent22) : node.kind === 145 || node.kind === 144 ? isModuleDeclaration(parent22) : node.kind === 102 ? isImportEqualsDeclaration(parent22) : node.kind === 139 ? isGetAccessorDeclaration(parent22) : node.kind === 153 && isSetAccessorDeclaration(parent22)) { + const location2 = getAdjustedLocationForDeclaration(parent22, forRename); + if (location2) { + return location2; + } + } + if ((node.kind === 115 || node.kind === 87 || node.kind === 121) && isVariableDeclarationList(parent22) && parent22.declarations.length === 1) { + const decl = parent22.declarations[0]; + if (isIdentifier(decl.name)) { + return decl.name; + } + } + if (node.kind === 156) { + if (isImportClause(parent22) && parent22.isTypeOnly) { + const location2 = getAdjustedLocationForImportDeclaration(parent22.parent, forRename); + if (location2) { + return location2; + } + } + if (isExportDeclaration(parent22) && parent22.isTypeOnly) { + const location2 = getAdjustedLocationForExportDeclaration(parent22, forRename); + if (location2) { + return location2; + } + } + } + if (node.kind === 130) { + if (isImportSpecifier(parent22) && parent22.propertyName || isExportSpecifier(parent22) && parent22.propertyName || isNamespaceImport(parent22) || isNamespaceExport(parent22)) { + return parent22.name; + } + if (isExportDeclaration(parent22) && parent22.exportClause && isNamespaceExport(parent22.exportClause)) { + return parent22.exportClause.name; + } + } + if (node.kind === 102 && isImportDeclaration(parent22)) { + const location2 = getAdjustedLocationForImportDeclaration(parent22, forRename); + if (location2) { + return location2; + } + } + if (node.kind === 95) { + if (isExportDeclaration(parent22)) { + const location2 = getAdjustedLocationForExportDeclaration(parent22, forRename); + if (location2) { + return location2; + } + } + if (isExportAssignment(parent22)) { + return skipOuterExpressions(parent22.expression); + } + } + if (node.kind === 149 && isExternalModuleReference(parent22)) { + return parent22.expression; + } + if (node.kind === 161 && (isImportDeclaration(parent22) || isExportDeclaration(parent22)) && parent22.moduleSpecifier) { + return parent22.moduleSpecifier; + } + if ((node.kind === 96 || node.kind === 119) && isHeritageClause(parent22) && parent22.token === node.kind) { + const location2 = getAdjustedLocationForHeritageClause(parent22); + if (location2) { + return location2; + } + } + if (node.kind === 96) { + if (isTypeParameterDeclaration(parent22) && parent22.constraint && isTypeReferenceNode(parent22.constraint)) { + return parent22.constraint.typeName; + } + if (isConditionalTypeNode(parent22) && isTypeReferenceNode(parent22.extendsType)) { + return parent22.extendsType.typeName; + } + } + if (node.kind === 140 && isInferTypeNode(parent22)) { + return parent22.typeParameter.name; + } + if (node.kind === 103 && isTypeParameterDeclaration(parent22) && isMappedTypeNode(parent22.parent)) { + return parent22.name; + } + if (node.kind === 143 && isTypeOperatorNode(parent22) && parent22.operator === 143 && isTypeReferenceNode(parent22.type)) { + return parent22.type.typeName; + } + if (node.kind === 148 && isTypeOperatorNode(parent22) && parent22.operator === 148 && isArrayTypeNode(parent22.type) && isTypeReferenceNode(parent22.type.elementType)) { + return parent22.type.elementType.typeName; + } + if (!forRename) { + if (node.kind === 105 && isNewExpression(parent22) || node.kind === 116 && isVoidExpression(parent22) || node.kind === 114 && isTypeOfExpression(parent22) || node.kind === 135 && isAwaitExpression(parent22) || node.kind === 127 && isYieldExpression(parent22) || node.kind === 91 && isDeleteExpression(parent22)) { + if (parent22.expression) { + return skipOuterExpressions(parent22.expression); + } + } + if ((node.kind === 103 || node.kind === 104) && isBinaryExpression(parent22) && parent22.operatorToken === node) { + return skipOuterExpressions(parent22.right); + } + if (node.kind === 130 && isAsExpression(parent22) && isTypeReferenceNode(parent22.type)) { + return parent22.type.typeName; + } + if (node.kind === 103 && isForInStatement(parent22) || node.kind === 165 && isForOfStatement(parent22)) { + return skipOuterExpressions(parent22.expression); + } + } + return node; + } + function getAdjustedReferenceLocation(node) { + return getAdjustedLocation( + node, + /*forRename*/ + false + ); + } + function getAdjustedRenameLocation(node) { + return getAdjustedLocation( + node, + /*forRename*/ + true + ); + } + function getTouchingPropertyName(sourceFile, position) { + return getTouchingToken(sourceFile, position, (n7) => isPropertyNameLiteral(n7) || isKeyword(n7.kind) || isPrivateIdentifier(n7)); + } + function getTouchingToken(sourceFile, position, includePrecedingTokenAtEndPosition) { + return getTokenAtPositionWorker( + sourceFile, + position, + /*allowPositionInLeadingTrivia*/ + false, + includePrecedingTokenAtEndPosition, + /*includeEndPosition*/ + false + ); + } + function getTokenAtPosition(sourceFile, position) { + return getTokenAtPositionWorker( + sourceFile, + position, + /*allowPositionInLeadingTrivia*/ + true, + /*includePrecedingTokenAtEndPosition*/ + void 0, + /*includeEndPosition*/ + false + ); + } + function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includePrecedingTokenAtEndPosition, includeEndPosition) { + let current = sourceFile; + let foundToken; + outer: + while (true) { + const children = current.getChildren(sourceFile); + const i7 = binarySearchKey(children, position, (_6, i22) => i22, (middle, _6) => { + const end = children[middle].getEnd(); + if (end < position) { + return -1; + } + const start = allowPositionInLeadingTrivia ? children[middle].getFullStart() : children[middle].getStart( + sourceFile, + /*includeJsDocComment*/ + true + ); + if (start > position) { + return 1; + } + if (nodeContainsPosition(children[middle], start, end)) { + if (children[middle - 1]) { + if (nodeContainsPosition(children[middle - 1])) { + return 1; + } + } + return 0; + } + if (includePrecedingTokenAtEndPosition && start === position && children[middle - 1] && children[middle - 1].getEnd() === position && nodeContainsPosition(children[middle - 1])) { + return 1; + } + return -1; + }); + if (foundToken) { + return foundToken; + } + if (i7 >= 0 && children[i7]) { + current = children[i7]; + continue outer; + } + return current; + } + function nodeContainsPosition(node, start, end) { + end ?? (end = node.getEnd()); + if (end < position) { + return false; + } + start ?? (start = allowPositionInLeadingTrivia ? node.getFullStart() : node.getStart( + sourceFile, + /*includeJsDocComment*/ + true + )); + if (start > position) { + return false; + } + if (position < end || position === end && (node.kind === 1 || includeEndPosition)) { + return true; + } else if (includePrecedingTokenAtEndPosition && end === position) { + const previousToken = findPrecedingToken(position, sourceFile, node); + if (previousToken && includePrecedingTokenAtEndPosition(previousToken)) { + foundToken = previousToken; + return true; + } + } + return false; + } + } + function findFirstNonJsxWhitespaceToken(sourceFile, position) { + let tokenAtPosition = getTokenAtPosition(sourceFile, position); + while (isWhiteSpaceOnlyJsxText(tokenAtPosition)) { + const nextToken = findNextToken(tokenAtPosition, tokenAtPosition.parent, sourceFile); + if (!nextToken) + return; + tokenAtPosition = nextToken; + } + return tokenAtPosition; + } + function findTokenOnLeftOfPosition(file, position) { + const tokenAtPosition = getTokenAtPosition(file, position); + if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { + return tokenAtPosition; + } + return findPrecedingToken(position, file); + } + function findNextToken(previousToken, parent22, sourceFile) { + return find22(parent22); + function find22(n7) { + if (isToken(n7) && n7.pos === previousToken.end) { + return n7; + } + return firstDefined(n7.getChildren(sourceFile), (child) => { + const shouldDiveInChildNode = ( + // previous token is enclosed somewhere in the child + child.pos <= previousToken.pos && child.end > previousToken.end || // previous token ends exactly at the beginning of child + child.pos === previousToken.end + ); + return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find22(child) : void 0; + }); + } + } + function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) { + const result2 = find22(startNode2 || sourceFile); + Debug.assert(!(result2 && isWhiteSpaceOnlyJsxText(result2))); + return result2; + function find22(n7) { + if (isNonWhitespaceToken(n7) && n7.kind !== 1) { + return n7; + } + const children = n7.getChildren(sourceFile); + const i7 = binarySearchKey(children, position, (_6, i22) => i22, (middle, _6) => { + if (position < children[middle].end) { + if (!children[middle - 1] || position >= children[middle - 1].end) { + return 0; + } + return 1; + } + return -1; + }); + if (i7 >= 0 && children[i7]) { + const child = children[i7]; + if (position < child.end) { + const start = child.getStart( + sourceFile, + /*includeJsDoc*/ + !excludeJsdoc + ); + const lookInPreviousChild = start >= position || // cursor in the leading trivia + !nodeHasTokens(child, sourceFile) || isWhiteSpaceOnlyJsxText(child); + if (lookInPreviousChild) { + const candidate2 = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + i7, + sourceFile, + n7.kind + ); + if (candidate2) { + if (!excludeJsdoc && isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) { + return find22(candidate2); + } + return findRightmostToken(candidate2, sourceFile); + } + return void 0; + } else { + return find22(child); + } + } + } + Debug.assert(startNode2 !== void 0 || n7.kind === 312 || n7.kind === 1 || isJSDocCommentContainingNode(n7)); + const candidate = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + children.length, + sourceFile, + n7.kind + ); + return candidate && findRightmostToken(candidate, sourceFile); + } + } + function isNonWhitespaceToken(n7) { + return isToken(n7) && !isWhiteSpaceOnlyJsxText(n7); + } + function findRightmostToken(n7, sourceFile) { + if (isNonWhitespaceToken(n7)) { + return n7; + } + const children = n7.getChildren(sourceFile); + if (children.length === 0) { + return n7; + } + const candidate = findRightmostChildNodeWithTokens( + children, + /*exclusiveStartPosition*/ + children.length, + sourceFile, + n7.kind + ); + return candidate && findRightmostToken(candidate, sourceFile); + } + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition, sourceFile, parentKind) { + for (let i7 = exclusiveStartPosition - 1; i7 >= 0; i7--) { + const child = children[i7]; + if (isWhiteSpaceOnlyJsxText(child)) { + if (i7 === 0 && (parentKind === 12 || parentKind === 285)) { + Debug.fail("`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + } else if (nodeHasTokens(children[i7], sourceFile)) { + return children[i7]; + } + } + } + function isInString(sourceFile, position, previousToken = findPrecedingToken(position, sourceFile)) { + if (previousToken && isStringTextContainingNode(previousToken)) { + const start = previousToken.getStart(sourceFile); + const end = previousToken.getEnd(); + if (start < position && position < end) { + return true; + } + if (position === end) { + return !!previousToken.isUnterminated; + } + } + return false; + } + function isInsideJsxElementOrAttribute(sourceFile, position) { + const token = getTokenAtPosition(sourceFile, position); + if (!token) { + return false; + } + if (token.kind === 12) { + return true; + } + if (token.kind === 30 && token.parent.kind === 12) { + return true; + } + if (token.kind === 30 && token.parent.kind === 294) { + return true; + } + if (token && token.kind === 20 && token.parent.kind === 294) { + return true; + } + if (token.kind === 30 && token.parent.kind === 287) { + return true; + } + return false; + } + function isWhiteSpaceOnlyJsxText(node) { + return isJsxText(node) && node.containsOnlyTriviaWhiteSpaces; + } + function isInTemplateString(sourceFile, position) { + const token = getTokenAtPosition(sourceFile, position); + return isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); + } + function isInJSXText(sourceFile, position) { + const token = getTokenAtPosition(sourceFile, position); + if (isJsxText(token)) { + return true; + } + if (token.kind === 19 && isJsxExpression(token.parent) && isJsxElement(token.parent.parent)) { + return true; + } + if (token.kind === 30 && isJsxOpeningLikeElement(token.parent) && isJsxElement(token.parent.parent)) { + return true; + } + return false; + } + function isInsideJsxElement(sourceFile, position) { + function isInsideJsxElementTraversal(node) { + while (node) { + if (node.kind >= 285 && node.kind <= 294 || node.kind === 12 || node.kind === 30 || node.kind === 32 || node.kind === 80 || node.kind === 20 || node.kind === 19 || node.kind === 44) { + node = node.parent; + } else if (node.kind === 284) { + if (position > node.getStart(sourceFile)) + return true; + node = node.parent; + } else { + return false; + } + } + return false; + } + return isInsideJsxElementTraversal(getTokenAtPosition(sourceFile, position)); + } + function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) { + const closeTokenText = tokenToString(token.kind); + const matchingTokenText = tokenToString(matchingTokenKind); + const tokenFullStart = token.getFullStart(); + const bestGuessIndex = sourceFile.text.lastIndexOf(matchingTokenText, tokenFullStart); + if (bestGuessIndex === -1) { + return void 0; + } + if (sourceFile.text.lastIndexOf(closeTokenText, tokenFullStart - 1) < bestGuessIndex) { + const nodeAtGuess = findPrecedingToken(bestGuessIndex + 1, sourceFile); + if (nodeAtGuess && nodeAtGuess.kind === matchingTokenKind) { + return nodeAtGuess; + } + } + const tokenKind = token.kind; + let remainingMatchingTokens = 0; + while (true) { + const preceding = findPrecedingToken(token.getFullStart(), sourceFile); + if (!preceding) { + return void 0; + } + token = preceding; + if (token.kind === matchingTokenKind) { + if (remainingMatchingTokens === 0) { + return token; + } + remainingMatchingTokens--; + } else if (token.kind === tokenKind) { + remainingMatchingTokens++; + } + } + } + function removeOptionality(type3, isOptionalExpression, isOptionalChain2) { + return isOptionalExpression ? type3.getNonNullableType() : isOptionalChain2 ? type3.getNonOptionalType() : type3; + } + function isPossiblyTypeArgumentPosition(token, sourceFile, checker) { + const info2 = getPossibleTypeArgumentsInfo(token, sourceFile); + return info2 !== void 0 && (isPartOfTypeNode(info2.called) || getPossibleGenericSignatures(info2.called, info2.nTypeArguments, checker).length !== 0 || isPossiblyTypeArgumentPosition(info2.called, sourceFile, checker)); + } + function getPossibleGenericSignatures(called, typeArgumentCount, checker) { + let type3 = checker.getTypeAtLocation(called); + if (isOptionalChain(called.parent)) { + type3 = removeOptionality( + type3, + isOptionalChainRoot(called.parent), + /*isOptionalChain*/ + true + ); + } + const signatures = isNewExpression(called.parent) ? type3.getConstructSignatures() : type3.getCallSignatures(); + return signatures.filter((candidate) => !!candidate.typeParameters && candidate.typeParameters.length >= typeArgumentCount); + } + function getPossibleTypeArgumentsInfo(tokenIn, sourceFile) { + if (sourceFile.text.lastIndexOf("<", tokenIn ? tokenIn.pos : sourceFile.text.length) === -1) { + return void 0; + } + let token = tokenIn; + let remainingLessThanTokens = 0; + let nTypeArguments = 0; + while (token) { + switch (token.kind) { + case 30: + token = findPrecedingToken(token.getFullStart(), sourceFile); + if (token && token.kind === 29) { + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + if (!token || !isIdentifier(token)) + return void 0; + if (!remainingLessThanTokens) { + return isDeclarationName(token) ? void 0 : { called: token, nTypeArguments }; + } + remainingLessThanTokens--; + break; + case 50: + remainingLessThanTokens = 3; + break; + case 49: + remainingLessThanTokens = 2; + break; + case 32: + remainingLessThanTokens++; + break; + case 20: + token = findPrecedingMatchingToken(token, 19, sourceFile); + if (!token) + return void 0; + break; + case 22: + token = findPrecedingMatchingToken(token, 21, sourceFile); + if (!token) + return void 0; + break; + case 24: + token = findPrecedingMatchingToken(token, 23, sourceFile); + if (!token) + return void 0; + break; + case 28: + nTypeArguments++; + break; + case 39: + case 80: + case 11: + case 9: + case 10: + case 112: + case 97: + case 114: + case 96: + case 143: + case 25: + case 52: + case 58: + case 59: + break; + default: + if (isTypeNode(token)) { + break; + } + return void 0; + } + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + return void 0; + } + function isInComment(sourceFile, position, tokenAtPosition) { + return ts_formatting_exports.getRangeOfEnclosingComment( + sourceFile, + position, + /*precedingToken*/ + void 0, + tokenAtPosition + ); + } + function hasDocComment(sourceFile, position) { + const token = getTokenAtPosition(sourceFile, position); + return !!findAncestor(token, isJSDoc); + } + function nodeHasTokens(n7, sourceFile) { + return n7.kind === 1 ? !!n7.jsDoc : n7.getWidth(sourceFile) !== 0; + } + function getNodeModifiers(node, excludeFlags = 0) { + const result2 = []; + const flags = isDeclaration(node) ? getCombinedNodeFlagsAlwaysIncludeJSDoc(node) & ~excludeFlags : 0; + if (flags & 2) + result2.push( + "private" + /* privateMemberModifier */ + ); + if (flags & 4) + result2.push( + "protected" + /* protectedMemberModifier */ + ); + if (flags & 1) + result2.push( + "public" + /* publicMemberModifier */ + ); + if (flags & 256 || isClassStaticBlockDeclaration(node)) + result2.push( + "static" + /* staticModifier */ + ); + if (flags & 64) + result2.push( + "abstract" + /* abstractModifier */ + ); + if (flags & 32) + result2.push( + "export" + /* exportedModifier */ + ); + if (flags & 65536) + result2.push( + "deprecated" + /* deprecatedModifier */ + ); + if (node.flags & 33554432) + result2.push( + "declare" + /* ambientModifier */ + ); + if (node.kind === 277) + result2.push( + "export" + /* exportedModifier */ + ); + return result2.length > 0 ? result2.join(",") : ""; + } + function getTypeArgumentOrTypeParameterList(node) { + if (node.kind === 183 || node.kind === 213) { + return node.typeArguments; + } + if (isFunctionLike(node) || node.kind === 263 || node.kind === 264) { + return node.typeParameters; + } + return void 0; + } + function isComment(kind) { + return kind === 2 || kind === 3; + } + function isStringOrRegularExpressionOrTemplateLiteral(kind) { + if (kind === 11 || kind === 14 || isTemplateLiteralKind(kind)) { + return true; + } + return false; + } + function areIntersectedTypesAvoidingStringReduction(checker, t1, t22) { + return !!(t1.flags & 4) && checker.isEmptyAnonymousObjectType(t22); + } + function isStringAndEmptyAnonymousObjectIntersection(type3) { + if (!type3.isIntersection()) { + return false; + } + const { types: types3, checker } = type3; + return types3.length === 2 && (areIntersectedTypesAvoidingStringReduction(checker, types3[0], types3[1]) || areIntersectedTypesAvoidingStringReduction(checker, types3[1], types3[0])); + } + function isInsideTemplateLiteral(node, position, sourceFile) { + return isTemplateLiteralKind(node.kind) && (node.getStart(sourceFile) < position && position < node.end) || !!node.isUnterminated && position === node.end; + } + function isAccessibilityModifier(kind) { + switch (kind) { + case 125: + case 123: + case 124: + return true; + } + return false; + } + function cloneCompilerOptions(options) { + const result2 = clone2(options); + setConfigFileInOptions(result2, options && options.configFile); + return result2; + } + function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { + if (node.kind === 209 || node.kind === 210) { + if (node.parent.kind === 226 && node.parent.left === node && node.parent.operatorToken.kind === 64) { + return true; + } + if (node.parent.kind === 250 && node.parent.initializer === node) { + return true; + } + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 303 ? node.parent.parent : node.parent)) { + return true; + } + } + return false; + } + function isInReferenceComment(sourceFile, position) { + return isInReferenceCommentWorker( + sourceFile, + position, + /*shouldBeReference*/ + true + ); + } + function isInNonReferenceComment(sourceFile, position) { + return isInReferenceCommentWorker( + sourceFile, + position, + /*shouldBeReference*/ + false + ); + } + function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) { + const range2 = isInComment( + sourceFile, + position, + /*tokenAtPosition*/ + void 0 + ); + return !!range2 && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range2.pos, range2.end)); + } + function getReplacementSpanForContextToken(contextToken) { + if (!contextToken) + return void 0; + switch (contextToken.kind) { + case 11: + case 15: + return createTextSpanFromStringLiteralLikeContent(contextToken); + default: + return createTextSpanFromNode(contextToken); + } + } + function createTextSpanFromNode(node, sourceFile, endNode2) { + return createTextSpanFromBounds(node.getStart(sourceFile), (endNode2 || node).getEnd()); + } + function createTextSpanFromStringLiteralLikeContent(node) { + if (node.isUnterminated) + return void 0; + return createTextSpanFromBounds(node.getStart() + 1, node.getEnd() - 1); + } + function createTextRangeFromNode(node, sourceFile) { + return createRange2(node.getStart(sourceFile), node.end); + } + function createTextSpanFromRange(range2) { + return createTextSpanFromBounds(range2.pos, range2.end); + } + function createTextRangeFromSpan(span) { + return createRange2(span.start, span.start + span.length); + } + function createTextChangeFromStartLength(start, length2, newText) { + return createTextChange(createTextSpan(start, length2), newText); + } + function createTextChange(span, newText) { + return { span, newText }; + } + function isTypeKeyword(kind) { + return contains2(typeKeywords, kind); + } + function isTypeKeywordToken(node) { + return node.kind === 156; + } + function isTypeKeywordTokenOrIdentifier(node) { + return isTypeKeywordToken(node) || isIdentifier(node) && node.text === "type"; + } + function isExternalModuleSymbol(moduleSymbol) { + return !!(moduleSymbol.flags & 1536) && moduleSymbol.name.charCodeAt(0) === 34; + } + function nodeSeenTracker() { + const seen = []; + return (node) => { + const id = getNodeId(node); + return !seen[id] && (seen[id] = true); + }; + } + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + function repeatString(str2, count2) { + let result2 = ""; + for (let i7 = 0; i7 < count2; i7++) { + result2 += str2; + } + return result2; + } + function skipConstraint(type3) { + return type3.isTypeParameter() ? type3.getConstraint() || type3 : type3; + } + function getNameFromPropertyName(name2) { + return name2.kind === 167 ? isStringOrNumericLiteralLike(name2.expression) ? name2.expression.text : void 0 : isPrivateIdentifier(name2) ? idText(name2) : getTextOfIdentifierOrLiteral(name2); + } + function programContainsModules(program) { + return program.getSourceFiles().some((s7) => !s7.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s7) && !!(s7.externalModuleIndicator || s7.commonJsModuleIndicator)); + } + function programContainsEsModules(program) { + return program.getSourceFiles().some((s7) => !s7.isDeclarationFile && !program.isSourceFileFromExternalLibrary(s7) && !!s7.externalModuleIndicator); + } + function compilerOptionsIndicateEsModules(compilerOptions) { + return !!compilerOptions.module || getEmitScriptTarget(compilerOptions) >= 2 || !!compilerOptions.noEmit; + } + function createModuleSpecifierResolutionHost(program, host) { + return { + fileExists: (fileName) => program.fileExists(fileName), + getCurrentDirectory: () => host.getCurrentDirectory(), + readFile: maybeBind(host, host.readFile), + useCaseSensitiveFileNames: maybeBind(host, host.useCaseSensitiveFileNames), + getSymlinkCache: maybeBind(host, host.getSymlinkCache) || program.getSymlinkCache, + getModuleSpecifierCache: maybeBind(host, host.getModuleSpecifierCache), + getPackageJsonInfoCache: () => { + var _a2; + return (_a2 = program.getModuleResolutionCache()) == null ? void 0 : _a2.getPackageJsonInfoCache(); + }, + getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation), + redirectTargetsMap: program.redirectTargetsMap, + getProjectReferenceRedirect: (fileName) => program.getProjectReferenceRedirect(fileName), + isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName), + getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson), + getFileIncludeReasons: () => program.getFileIncludeReasons(), + getCommonSourceDirectory: () => program.getCommonSourceDirectory() + }; + } + function getModuleSpecifierResolverHost(program, host) { + return { + ...createModuleSpecifierResolutionHost(program, host), + getCommonSourceDirectory: () => program.getCommonSourceDirectory() + }; + } + function moduleResolutionUsesNodeModules(moduleResolution) { + return moduleResolution === 2 || moduleResolution >= 3 && moduleResolution <= 99 || moduleResolution === 100; + } + function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) { + return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0; + } + function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference, isTypeOnly) { + return factory.createImportDeclaration( + /*modifiers*/ + void 0, + defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0, + typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, + /*attributes*/ + void 0 + ); + } + function makeStringLiteral(text, quotePreference) { + return factory.createStringLiteral( + text, + quotePreference === 0 + /* Single */ + ); + } + function quotePreferenceFromString(str2, sourceFile) { + return isStringDoubleQuoted(str2, sourceFile) ? 1 : 0; + } + function getQuotePreference(sourceFile, preferences) { + if (preferences.quotePreference && preferences.quotePreference !== "auto") { + return preferences.quotePreference === "single" ? 0 : 1; + } else { + const firstModuleSpecifier = sourceFile.imports && find2(sourceFile.imports, (n7) => isStringLiteral(n7) && !nodeIsSynthesized(n7.parent)); + return firstModuleSpecifier ? quotePreferenceFromString(firstModuleSpecifier, sourceFile) : 1; + } + } + function getQuoteFromPreference(qp) { + switch (qp) { + case 0: + return "'"; + case 1: + return '"'; + default: + return Debug.assertNever(qp); + } + } + function symbolNameNoDefault(symbol) { + const escaped = symbolEscapedNameNoDefault(symbol); + return escaped === void 0 ? void 0 : unescapeLeadingUnderscores(escaped); + } + function symbolEscapedNameNoDefault(symbol) { + if (symbol.escapedName !== "default") { + return symbol.escapedName; + } + return firstDefined(symbol.declarations, (decl) => { + const name2 = getNameOfDeclaration(decl); + return name2 && name2.kind === 80 ? name2.escapedText : void 0; + }); + } + function isModuleSpecifierLike(node) { + return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isRequireCall( + node.parent, + /*requireStringLiteralLikeArgument*/ + false + ) && node.parent.arguments[0] === node || isImportCall(node.parent) && node.parent.arguments[0] === node); + } + function isObjectBindingElementWithoutPropertyName(bindingElement) { + return isBindingElement(bindingElement) && isObjectBindingPattern(bindingElement.parent) && isIdentifier(bindingElement.name) && !bindingElement.propertyName; + } + function getPropertySymbolFromBindingElement(checker, bindingElement) { + const typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); + return typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); + } + function getParentNodeInSpan(node, file, span) { + if (!node) + return void 0; + while (node.parent) { + if (isSourceFile(node.parent) || !spanContainsNode(span, node.parent, file)) { + return node; + } + node = node.parent; + } + } + function spanContainsNode(span, node, file) { + return textSpanContainsPosition(span, node.getStart(file)) && node.getEnd() <= textSpanEnd(span); + } + function findModifier(node, kind) { + return canHaveModifiers(node) ? find2(node.modifiers, (m7) => m7.kind === kind) : void 0; + } + function insertImports(changes, sourceFile, imports, blankLineBetween, preferences) { + const decl = isArray3(imports) ? imports[0] : imports; + const importKindPredicate = decl.kind === 243 ? isRequireVariableStatement : isAnyImportSyntax; + const existingImportStatements = filter2(sourceFile.statements, importKindPredicate); + let sortKind = isArray3(imports) ? ts_OrganizeImports_exports.detectImportDeclarationSorting(imports, preferences) : 3; + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer( + preferences, + sortKind === 2 + /* CaseInsensitive */ + ); + const sortedNewImports = isArray3(imports) ? stableSort(imports, (a7, b8) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a7, b8, comparer)) : [imports]; + if (!existingImportStatements.length) { + changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); + } else if (existingImportStatements && (sortKind = ts_OrganizeImports_exports.detectImportDeclarationSorting(existingImportStatements, preferences))) { + const comparer2 = ts_OrganizeImports_exports.getOrganizeImportsComparer( + preferences, + sortKind === 2 + /* CaseInsensitive */ + ); + for (const newImport of sortedNewImports) { + const insertionIndex = ts_OrganizeImports_exports.getImportDeclarationInsertionIndex(existingImportStatements, newImport, comparer2); + if (insertionIndex === 0) { + const options = existingImportStatements[0] === sourceFile.statements[0] ? { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude } : {}; + changes.insertNodeBefore( + sourceFile, + existingImportStatements[0], + newImport, + /*blankLineBetween*/ + false, + options + ); + } else { + const prevImport = existingImportStatements[insertionIndex - 1]; + changes.insertNodeAfter(sourceFile, prevImport, newImport); + } + } + } else { + const lastExistingImport = lastOrUndefined(existingImportStatements); + if (lastExistingImport) { + changes.insertNodesAfter(sourceFile, lastExistingImport, sortedNewImports); + } else { + changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween); + } + } + } + function getTypeKeywordOfTypeOnlyImport(importClause, sourceFile) { + Debug.assert(importClause.isTypeOnly); + return cast(importClause.getChildAt(0, sourceFile), isTypeKeywordToken); + } + function textSpansEqual(a7, b8) { + return !!a7 && !!b8 && a7.start === b8.start && a7.length === b8.length; + } + function documentSpansEqual(a7, b8, useCaseSensitiveFileNames2) { + return (useCaseSensitiveFileNames2 ? equateStringsCaseSensitive : equateStringsCaseInsensitive)(a7.fileName, b8.fileName) && textSpansEqual(a7.textSpan, b8.textSpan); + } + function getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2) { + return (a7, b8) => documentSpansEqual(a7, b8, useCaseSensitiveFileNames2); + } + function forEachUnique(array, callback) { + if (array) { + for (let i7 = 0; i7 < array.length; i7++) { + if (array.indexOf(array[i7]) === i7) { + const result2 = callback(array[i7], i7); + if (result2) { + return result2; + } + } + } + } + return void 0; + } + function isTextWhiteSpaceLike(text, startPos, endPos) { + for (let i7 = startPos; i7 < endPos; i7++) { + if (!isWhiteSpaceLike(text.charCodeAt(i7))) { + return false; + } + } + return true; + } + function getMappedLocation(location2, sourceMapper, fileExists) { + const mapsTo = sourceMapper.tryGetSourcePosition(location2); + return mapsTo && (!fileExists || fileExists(normalizePath(mapsTo.fileName)) ? mapsTo : void 0); + } + function getMappedDocumentSpan(documentSpan, sourceMapper, fileExists) { + const { fileName, textSpan } = documentSpan; + const newPosition = getMappedLocation({ fileName, pos: textSpan.start }, sourceMapper, fileExists); + if (!newPosition) + return void 0; + const newEndPosition = getMappedLocation({ fileName, pos: textSpan.start + textSpan.length }, sourceMapper, fileExists); + const newLength = newEndPosition ? newEndPosition.pos - newPosition.pos : textSpan.length; + return { + fileName: newPosition.fileName, + textSpan: { + start: newPosition.pos, + length: newLength + }, + originalFileName: documentSpan.fileName, + originalTextSpan: documentSpan.textSpan, + contextSpan: getMappedContextSpan(documentSpan, sourceMapper, fileExists), + originalContextSpan: documentSpan.contextSpan + }; + } + function getMappedContextSpan(documentSpan, sourceMapper, fileExists) { + const contextSpanStart = documentSpan.contextSpan && getMappedLocation( + { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start }, + sourceMapper, + fileExists + ); + const contextSpanEnd = documentSpan.contextSpan && getMappedLocation( + { fileName: documentSpan.fileName, pos: documentSpan.contextSpan.start + documentSpan.contextSpan.length }, + sourceMapper, + fileExists + ); + return contextSpanStart && contextSpanEnd ? { start: contextSpanStart.pos, length: contextSpanEnd.pos - contextSpanStart.pos } : void 0; + } + function isFirstDeclarationOfSymbolParameter(symbol) { + const declaration = symbol.declarations ? firstOrUndefined(symbol.declarations) : void 0; + return !!findAncestor(declaration, (n7) => isParameter(n7) ? true : isBindingElement(n7) || isObjectBindingPattern(n7) || isArrayBindingPattern(n7) ? false : "quit"); + } + function getDisplayPartWriter() { + const absoluteMaximumLength = defaultMaximumTruncationLength * 10; + let displayParts; + let lineStart; + let indent3; + let length2; + resetWriter(); + const unknownWrite = (text) => writeKind( + text, + 17 + /* text */ + ); + return { + displayParts: () => { + const finalText = displayParts.length && displayParts[displayParts.length - 1].text; + if (length2 > absoluteMaximumLength && finalText && finalText !== "...") { + if (!isWhiteSpaceLike(finalText.charCodeAt(finalText.length - 1))) { + displayParts.push(displayPart( + " ", + 16 + /* space */ + )); + } + displayParts.push(displayPart( + "...", + 15 + /* punctuation */ + )); + } + return displayParts; + }, + writeKeyword: (text) => writeKind( + text, + 5 + /* keyword */ + ), + writeOperator: (text) => writeKind( + text, + 12 + /* operator */ + ), + writePunctuation: (text) => writeKind( + text, + 15 + /* punctuation */ + ), + writeTrailingSemicolon: (text) => writeKind( + text, + 15 + /* punctuation */ + ), + writeSpace: (text) => writeKind( + text, + 16 + /* space */ + ), + writeStringLiteral: (text) => writeKind( + text, + 8 + /* stringLiteral */ + ), + writeParameter: (text) => writeKind( + text, + 13 + /* parameterName */ + ), + writeProperty: (text) => writeKind( + text, + 14 + /* propertyName */ + ), + writeLiteral: (text) => writeKind( + text, + 8 + /* stringLiteral */ + ), + writeSymbol, + writeLine, + write: unknownWrite, + writeComment: unknownWrite, + getText: () => "", + getTextPos: () => 0, + getColumn: () => 0, + getLine: () => 0, + isAtStartOfLine: () => false, + hasTrailingWhitespace: () => false, + hasTrailingComment: () => false, + rawWrite: notImplemented, + getIndent: () => indent3, + increaseIndent: () => { + indent3++; + }, + decreaseIndent: () => { + indent3--; + }, + clear: resetWriter + }; + function writeIndent() { + if (length2 > absoluteMaximumLength) + return; + if (lineStart) { + const indentString2 = getIndentString(indent3); + if (indentString2) { + length2 += indentString2.length; + displayParts.push(displayPart( + indentString2, + 16 + /* space */ + )); + } + lineStart = false; + } + } + function writeKind(text, kind) { + if (length2 > absoluteMaximumLength) + return; + writeIndent(); + length2 += text.length; + displayParts.push(displayPart(text, kind)); + } + function writeSymbol(text, symbol) { + if (length2 > absoluteMaximumLength) + return; + writeIndent(); + length2 += text.length; + displayParts.push(symbolPart(text, symbol)); + } + function writeLine() { + if (length2 > absoluteMaximumLength) + return; + length2 += 1; + displayParts.push(lineBreakPart()); + lineStart = true; + } + function resetWriter() { + displayParts = []; + lineStart = true; + indent3 = 0; + length2 = 0; + } + } + function symbolPart(text, symbol) { + return displayPart(text, displayPartKind(symbol)); + function displayPartKind(symbol2) { + const flags = symbol2.flags; + if (flags & 3) { + return isFirstDeclarationOfSymbolParameter(symbol2) ? 13 : 9; + } + if (flags & 4) + return 14; + if (flags & 32768) + return 14; + if (flags & 65536) + return 14; + if (flags & 8) + return 19; + if (flags & 16) + return 20; + if (flags & 32) + return 1; + if (flags & 64) + return 4; + if (flags & 384) + return 2; + if (flags & 1536) + return 11; + if (flags & 8192) + return 10; + if (flags & 262144) + return 18; + if (flags & 524288) + return 0; + if (flags & 2097152) + return 0; + return 17; + } + } + function displayPart(text, kind) { + return { text, kind: SymbolDisplayPartKind[kind] }; + } + function spacePart() { + return displayPart( + " ", + 16 + /* space */ + ); + } + function keywordPart(kind) { + return displayPart( + tokenToString(kind), + 5 + /* keyword */ + ); + } + function punctuationPart(kind) { + return displayPart( + tokenToString(kind), + 15 + /* punctuation */ + ); + } + function operatorPart(kind) { + return displayPart( + tokenToString(kind), + 12 + /* operator */ + ); + } + function parameterNamePart(text) { + return displayPart( + text, + 13 + /* parameterName */ + ); + } + function propertyNamePart(text) { + return displayPart( + text, + 14 + /* propertyName */ + ); + } + function textOrKeywordPart(text) { + const kind = stringToToken(text); + return kind === void 0 ? textPart(text) : keywordPart(kind); + } + function textPart(text) { + return displayPart( + text, + 17 + /* text */ + ); + } + function typeAliasNamePart(text) { + return displayPart( + text, + 0 + /* aliasName */ + ); + } + function typeParameterNamePart(text) { + return displayPart( + text, + 18 + /* typeParameterName */ + ); + } + function linkTextPart(text) { + return displayPart( + text, + 24 + /* linkText */ + ); + } + function linkNamePart(text, target) { + return { + text, + kind: SymbolDisplayPartKind[ + 23 + /* linkName */ + ], + target: { + fileName: getSourceFileOfNode(target).fileName, + textSpan: createTextSpanFromNode(target) + } + }; + } + function linkPart(text) { + return displayPart( + text, + 22 + /* link */ + ); + } + function buildLinkParts(link2, checker) { + var _a2; + const prefix = isJSDocLink(link2) ? "link" : isJSDocLinkCode(link2) ? "linkcode" : "linkplain"; + const parts = [linkPart(`{@${prefix} `)]; + if (!link2.name) { + if (link2.text) { + parts.push(linkTextPart(link2.text)); + } + } else { + const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link2.name); + const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0; + const suffix = findLinkNameEnd(link2.text); + const name2 = getTextOfNode(link2.name) + link2.text.slice(0, suffix); + const text = skipSeparatorFromLinkText(link2.text.slice(suffix)); + const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a2 = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a2[0]); + if (decl) { + parts.push(linkNamePart(name2, decl)); + if (text) + parts.push(linkTextPart(text)); + } else { + const separator = suffix === 0 || link2.text.charCodeAt(suffix) === 124 && name2.charCodeAt(name2.length - 1) !== 32 ? " " : ""; + parts.push(linkTextPart(name2 + separator + text)); + } + } + parts.push(linkPart("}")); + return parts; + } + function skipSeparatorFromLinkText(text) { + let pos = 0; + if (text.charCodeAt(pos++) === 124) { + while (pos < text.length && text.charCodeAt(pos) === 32) + pos++; + return text.slice(pos); + } + return text; + } + function findLinkNameEnd(text) { + let pos = text.indexOf("://"); + if (pos === 0) { + while (pos < text.length && text.charCodeAt(pos) !== 124) + pos++; + return pos; + } + if (text.indexOf("()") === 0) + return 2; + if (text.charAt(0) === "<") { + let brackets2 = 0; + let i7 = 0; + while (i7 < text.length) { + if (text[i7] === "<") + brackets2++; + if (text[i7] === ">") + brackets2--; + i7++; + if (!brackets2) + return i7; + } + } + return 0; + } + function getNewLineOrDefaultFromHost(host, formatSettings) { + var _a2; + return (formatSettings == null ? void 0 : formatSettings.newLineCharacter) || ((_a2 = host.getNewLine) == null ? void 0 : _a2.call(host)) || lineFeed2; + } + function lineBreakPart() { + return displayPart( + "\n", + 6 + /* lineBreak */ + ); + } + function mapToDisplayParts(writeDisplayParts) { + try { + writeDisplayParts(displayPartWriter); + return displayPartWriter.displayParts(); + } finally { + displayPartWriter.clear(); + } + } + function typeToDisplayParts(typechecker, type3, enclosingDeclaration, flags = 0) { + return mapToDisplayParts((writer) => { + typechecker.writeType(type3, enclosingDeclaration, flags | 1024 | 16384, writer); + }); + } + function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags = 0) { + return mapToDisplayParts((writer) => { + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8, writer); + }); + } + function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags = 0) { + flags |= 16384 | 1024 | 32 | 8192; + return mapToDisplayParts((writer) => { + typechecker.writeSignature( + signature, + enclosingDeclaration, + flags, + /*kind*/ + void 0, + writer + ); + }); + } + function nodeToDisplayParts(node, enclosingDeclaration) { + const file = enclosingDeclaration.getSourceFile(); + return mapToDisplayParts((writer) => { + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); + printer.writeNode(4, node, file, writer); + }); + } + function isImportOrExportSpecifierName(location2) { + return !!location2.parent && isImportOrExportSpecifier(location2.parent) && location2.parent.propertyName === location2; + } + function getScriptKind(fileName, host) { + return ensureScriptKind(fileName, host.getScriptKind && host.getScriptKind(fileName)); + } + function getSymbolTarget(symbol, checker) { + let next = symbol; + while (isAliasSymbol(next) || isTransientSymbol(next) && next.links.target) { + if (isTransientSymbol(next) && next.links.target) { + next = next.links.target; + } else { + next = skipAlias(next, checker); + } + } + return next; + } + function isAliasSymbol(symbol) { + return (symbol.flags & 2097152) !== 0; + } + function getUniqueSymbolId(symbol, checker) { + return getSymbolId(skipAlias(symbol, checker)); + } + function getFirstNonSpaceCharacterPosition(text, position) { + while (isWhiteSpaceLike(text.charCodeAt(position))) { + position += 1; + } + return position; + } + function getPrecedingNonSpaceCharacterPosition(text, position) { + while (position > -1 && isWhiteSpaceSingleLine(text.charCodeAt(position))) { + position -= 1; + } + return position + 1; + } + function getSynthesizedDeepClone(node, includeTrivia = true) { + const clone22 = node && getSynthesizedDeepCloneWorker(node); + if (clone22 && !includeTrivia) + suppressLeadingAndTrailingTrivia(clone22); + return clone22; + } + function getSynthesizedDeepCloneWithReplacements(node, includeTrivia, replaceNode2) { + let clone22 = replaceNode2(node); + if (clone22) { + setOriginalNode(clone22, node); + } else { + clone22 = getSynthesizedDeepCloneWorker(node, replaceNode2); + } + if (clone22 && !includeTrivia) + suppressLeadingAndTrailingTrivia(clone22); + return clone22; + } + function getSynthesizedDeepCloneWorker(node, replaceNode2) { + const nodeClone = replaceNode2 ? (n7) => getSynthesizedDeepCloneWithReplacements( + n7, + /*includeTrivia*/ + true, + replaceNode2 + ) : getSynthesizedDeepClone; + const nodesClone = replaceNode2 ? (ns) => ns && getSynthesizedDeepClonesWithReplacements( + ns, + /*includeTrivia*/ + true, + replaceNode2 + ) : (ns) => ns && getSynthesizedDeepClones(ns); + const visited = visitEachChild( + node, + nodeClone, + /*context*/ + void 0, + nodesClone, + nodeClone + ); + if (visited === node) { + const clone22 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node); + return setTextRange(clone22, node); + } + visited.parent = void 0; + return visited; + } + function getSynthesizedDeepClones(nodes, includeTrivia = true) { + if (nodes) { + const cloned = factory.createNodeArray(nodes.map((n7) => getSynthesizedDeepClone(n7, includeTrivia)), nodes.hasTrailingComma); + setTextRange(cloned, nodes); + return cloned; + } + return nodes; + } + function getSynthesizedDeepClonesWithReplacements(nodes, includeTrivia, replaceNode2) { + return factory.createNodeArray(nodes.map((n7) => getSynthesizedDeepCloneWithReplacements(n7, includeTrivia, replaceNode2)), nodes.hasTrailingComma); + } + function suppressLeadingAndTrailingTrivia(node) { + suppressLeadingTrivia(node); + suppressTrailingTrivia(node); + } + function suppressLeadingTrivia(node) { + addEmitFlagsRecursively(node, 1024, getFirstChild); + } + function suppressTrailingTrivia(node) { + addEmitFlagsRecursively(node, 2048, getLastChild); + } + function copyComments(sourceNode, targetNode) { + const sourceFile = sourceNode.getSourceFile(); + const text = sourceFile.text; + if (hasLeadingLineBreak(sourceNode, text)) { + copyLeadingComments(sourceNode, targetNode, sourceFile); + } else { + copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile); + } + copyTrailingComments(sourceNode, targetNode, sourceFile); + } + function hasLeadingLineBreak(node, text) { + const start = node.getFullStart(); + const end = node.getStart(); + for (let i7 = start; i7 < end; i7++) { + if (text.charCodeAt(i7) === 10) + return true; + } + return false; + } + function addEmitFlagsRecursively(node, flag, getChild) { + addEmitFlags(node, flag); + const child = getChild(node); + if (child) + addEmitFlagsRecursively(child, flag, getChild); + } + function getFirstChild(node) { + return node.forEachChild((child) => child); + } + function getUniqueName(baseName, sourceFile) { + let nameText = baseName; + for (let i7 = 1; !isFileLevelUniqueName(sourceFile, nameText); i7++) { + nameText = `${baseName}_${i7}`; + } + return nameText; + } + function getRenameLocation(edits, renameFilename, name2, preferLastLocation) { + let delta = 0; + let lastPos = -1; + for (const { fileName, textChanges: textChanges2 } of edits) { + Debug.assert(fileName === renameFilename); + for (const change of textChanges2) { + const { span, newText } = change; + const index4 = indexInTextChange(newText, escapeString2(name2)); + if (index4 !== -1) { + lastPos = span.start + delta + index4; + if (!preferLastLocation) { + return lastPos; + } + } + delta += newText.length - span.length; + } + } + Debug.assert(preferLastLocation); + Debug.assert(lastPos >= 0); + return lastPos; + } + function copyLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticLeadingComment)); + } + function copyTrailingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + forEachTrailingCommentRange(sourceFile.text, sourceNode.end, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticTrailingComment)); + } + function copyTrailingAsLeadingComments(sourceNode, targetNode, sourceFile, commentKind, hasTrailingNewLine) { + forEachTrailingCommentRange(sourceFile.text, sourceNode.pos, getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, addSyntheticLeadingComment)); + } + function getAddCommentsFunction(targetNode, sourceFile, commentKind, hasTrailingNewLine, cb) { + return (pos, end, kind, htnl) => { + if (kind === 3) { + pos += 2; + end -= 2; + } else { + pos += 2; + } + cb(targetNode, commentKind || kind, sourceFile.text.slice(pos, end), hasTrailingNewLine !== void 0 ? hasTrailingNewLine : htnl); + }; + } + function indexInTextChange(change, name2) { + if (startsWith2(change, name2)) + return 0; + let idx = change.indexOf(" " + name2); + if (idx === -1) + idx = change.indexOf("." + name2); + if (idx === -1) + idx = change.indexOf('"' + name2); + return idx === -1 ? -1 : idx + 1; + } + function needsParentheses(expression) { + return isBinaryExpression(expression) && expression.operatorToken.kind === 28 || isObjectLiteralExpression(expression) || (isAsExpression(expression) || isSatisfiesExpression(expression)) && isObjectLiteralExpression(expression.expression); + } + function getContextualTypeFromParent(node, checker, contextFlags) { + const parent22 = walkUpParenthesizedExpressions(node.parent); + switch (parent22.kind) { + case 214: + return checker.getContextualType(parent22, contextFlags); + case 226: { + const { left, operatorToken, right } = parent22; + return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node, contextFlags); + } + case 296: + return getSwitchedType(parent22, checker); + default: + return checker.getContextualType(node, contextFlags); + } + } + function quote(sourceFile, preferences, text) { + const quotePreference = getQuotePreference(sourceFile, preferences); + const quoted = JSON.stringify(text); + return quotePreference === 0 ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted; + } + function isEqualityOperatorKind(kind) { + switch (kind) { + case 37: + case 35: + case 38: + case 36: + return true; + default: + return false; + } + } + function isStringLiteralOrTemplate(node) { + switch (node.kind) { + case 11: + case 15: + case 228: + case 215: + return true; + default: + return false; + } + } + function hasIndexSignature(type3) { + return !!type3.getStringIndexType() || !!type3.getNumberIndexType(); + } + function getSwitchedType(caseClause, checker) { + return checker.getTypeAtLocation(caseClause.parent.parent.expression); + } + function getTypeNodeIfAccessible(type3, enclosingScope, program, host) { + const checker = program.getTypeChecker(); + let typeIsAccessible = true; + const notAccessible = () => typeIsAccessible = false; + const res = checker.typeToTypeNode(type3, enclosingScope, 1, { + trackSymbol: (symbol, declaration, meaning) => { + typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible( + symbol, + declaration, + meaning, + /*shouldComputeAliasToMarkVisible*/ + false + ).accessibility === 0; + return !typeIsAccessible; + }, + reportInaccessibleThisError: notAccessible, + reportPrivateInBaseOfClassExpression: notAccessible, + reportInaccessibleUniqueSymbolError: notAccessible, + moduleResolverHost: getModuleSpecifierResolverHost(program, host) + }); + return typeIsAccessible ? res : void 0; + } + function syntaxRequiresTrailingCommaOrSemicolonOrASI(kind) { + return kind === 179 || kind === 180 || kind === 181 || kind === 171 || kind === 173; + } + function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) { + return kind === 262 || kind === 176 || kind === 174 || kind === 177 || kind === 178; + } + function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) { + return kind === 267; + } + function syntaxRequiresTrailingSemicolonOrASI(kind) { + return kind === 243 || kind === 244 || kind === 246 || kind === 251 || kind === 252 || kind === 253 || kind === 257 || kind === 259 || kind === 172 || kind === 265 || kind === 272 || kind === 271 || kind === 278 || kind === 270 || kind === 277; + } + function nodeIsASICandidate(node, sourceFile) { + const lastToken = node.getLastToken(sourceFile); + if (lastToken && lastToken.kind === 27) { + return false; + } + if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { + if (lastToken && lastToken.kind === 28) { + return false; + } + } else if (syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(node.kind)) { + const lastChild = last2(node.getChildren(sourceFile)); + if (lastChild && isModuleBlock(lastChild)) { + return false; + } + } else if (syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(node.kind)) { + const lastChild = last2(node.getChildren(sourceFile)); + if (lastChild && isFunctionBlock(lastChild)) { + return false; + } + } else if (!syntaxRequiresTrailingSemicolonOrASI(node.kind)) { + return false; + } + if (node.kind === 246) { + return true; + } + const topNode = findAncestor(node, (ancestor) => !ancestor.parent); + const nextToken = findNextToken(node, topNode, sourceFile); + if (!nextToken || nextToken.kind === 20) { + return true; + } + const startLine = sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; + const endLine = sourceFile.getLineAndCharacterOfPosition(nextToken.getStart(sourceFile)).line; + return startLine !== endLine; + } + function positionIsASICandidate(pos, context2, sourceFile) { + const contextAncestor = findAncestor(context2, (ancestor) => { + if (ancestor.end !== pos) { + return "quit"; + } + return syntaxMayBeASICandidate(ancestor.kind); + }); + return !!contextAncestor && nodeIsASICandidate(contextAncestor, sourceFile); + } + function probablyUsesSemicolons(sourceFile) { + let withSemicolon = 0; + let withoutSemicolon = 0; + const nStatementsToObserve = 5; + forEachChild(sourceFile, function visit7(node) { + if (syntaxRequiresTrailingSemicolonOrASI(node.kind)) { + const lastToken = node.getLastToken(sourceFile); + if ((lastToken == null ? void 0 : lastToken.kind) === 27) { + withSemicolon++; + } else { + withoutSemicolon++; + } + } else if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) { + const lastToken = node.getLastToken(sourceFile); + if ((lastToken == null ? void 0 : lastToken.kind) === 27) { + withSemicolon++; + } else if (lastToken && lastToken.kind !== 28) { + const lastTokenLine = getLineAndCharacterOfPosition(sourceFile, lastToken.getStart(sourceFile)).line; + const nextTokenLine = getLineAndCharacterOfPosition(sourceFile, getSpanOfTokenAtPosition(sourceFile, lastToken.end).start).line; + if (lastTokenLine !== nextTokenLine) { + withoutSemicolon++; + } + } + } + if (withSemicolon + withoutSemicolon >= nStatementsToObserve) { + return true; + } + return forEachChild(node, visit7); + }); + if (withSemicolon === 0 && withoutSemicolon <= 1) { + return true; + } + return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve; + } + function tryGetDirectories(host, directoryName) { + return tryIOAndConsumeErrors(host, host.getDirectories, directoryName) || []; + } + function tryReadDirectory(host, path2, extensions6, exclude, include) { + return tryIOAndConsumeErrors(host, host.readDirectory, path2, extensions6, exclude, include) || emptyArray; + } + function tryFileExists(host, path2) { + return tryIOAndConsumeErrors(host, host.fileExists, path2); + } + function tryDirectoryExists(host, path2) { + return tryAndIgnoreErrors(() => directoryProbablyExists(path2, host)) || false; + } + function tryAndIgnoreErrors(cb) { + try { + return cb(); + } catch { + return void 0; + } + } + function tryIOAndConsumeErrors(host, toApply, ...args) { + return tryAndIgnoreErrors(() => toApply && toApply.apply(host, args)); + } + function findPackageJsons(startDirectory, host, stopDirectory) { + const paths = []; + forEachAncestorDirectory(startDirectory, (ancestor) => { + if (ancestor === stopDirectory) { + return true; + } + const currentConfigPath = combinePaths(ancestor, "package.json"); + if (tryFileExists(host, currentConfigPath)) { + paths.push(currentConfigPath); + } + }); + return paths; + } + function findPackageJson(directory, host) { + let packageJson; + forEachAncestorDirectory(directory, (ancestor) => { + if (ancestor === "node_modules") + return true; + packageJson = findConfigFile(ancestor, (f8) => tryFileExists(host, f8), "package.json"); + if (packageJson) { + return true; + } + }); + return packageJson; + } + function getPackageJsonsVisibleToFile(fileName, host) { + if (!host.fileExists) { + return []; + } + const packageJsons = []; + forEachAncestorDirectory(getDirectoryPath(fileName), (ancestor) => { + const packageJsonFileName = combinePaths(ancestor, "package.json"); + if (host.fileExists(packageJsonFileName)) { + const info2 = createPackageJsonInfo(packageJsonFileName, host); + if (info2) { + packageJsons.push(info2); + } + } + }); + return packageJsons; + } + function createPackageJsonInfo(fileName, host) { + if (!host.readFile) { + return void 0; + } + const dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"]; + const stringContent = host.readFile(fileName) || ""; + const content = tryParseJson(stringContent); + const info2 = {}; + if (content) { + for (const key of dependencyKeys) { + const dependencies = content[key]; + if (!dependencies) { + continue; + } + const dependencyMap = /* @__PURE__ */ new Map(); + for (const packageName in dependencies) { + dependencyMap.set(packageName, dependencies[packageName]); + } + info2[key] = dependencyMap; + } + } + const dependencyGroups = [ + [1, info2.dependencies], + [2, info2.devDependencies], + [8, info2.optionalDependencies], + [4, info2.peerDependencies] + ]; + return { + ...info2, + parseable: !!content, + fileName, + get: get4, + has(dependencyName, inGroups) { + return !!get4(dependencyName, inGroups); + } + }; + function get4(dependencyName, inGroups = 15) { + for (const [group22, deps] of dependencyGroups) { + if (deps && inGroups & group22) { + const dep = deps.get(dependencyName); + if (dep !== void 0) { + return dep; + } + } + } + } + } + function createPackageJsonImportFilter(fromFile2, preferences, host) { + const packageJsons = (host.getPackageJsonsVisibleToFile && host.getPackageJsonsVisibleToFile(fromFile2.fileName) || getPackageJsonsVisibleToFile(fromFile2.fileName, host)).filter((p7) => p7.parseable); + let usesNodeCoreModules; + let ambientModuleCache; + let sourceFileCache; + return { + allowsImportingAmbientModule, + allowsImportingSourceFile, + allowsImportingSpecifier + }; + function moduleSpecifierIsCoveredByPackageJson(specifier) { + const packageName = getNodeModuleRootSpecifier(specifier); + for (const packageJson of packageJsons) { + if (packageJson.has(packageName) || packageJson.has(getTypesPackageName(packageName))) { + return true; + } + } + return false; + } + function allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost) { + if (!packageJsons.length || !moduleSymbol.valueDeclaration) { + return true; + } + if (!ambientModuleCache) { + ambientModuleCache = /* @__PURE__ */ new Map(); + } else { + const cached = ambientModuleCache.get(moduleSymbol); + if (cached !== void 0) { + return cached; + } + } + const declaredModuleSpecifier = stripQuotes(moduleSymbol.getName()); + if (isAllowedCoreNodeModulesImport(declaredModuleSpecifier)) { + ambientModuleCache.set(moduleSymbol, true); + return true; + } + const declaringSourceFile = moduleSymbol.valueDeclaration.getSourceFile(); + const declaringNodeModuleName = getNodeModulesPackageNameFromFileName(declaringSourceFile.fileName, moduleSpecifierResolutionHost); + if (typeof declaringNodeModuleName === "undefined") { + ambientModuleCache.set(moduleSymbol, true); + return true; + } + const result2 = moduleSpecifierIsCoveredByPackageJson(declaringNodeModuleName) || moduleSpecifierIsCoveredByPackageJson(declaredModuleSpecifier); + ambientModuleCache.set(moduleSymbol, result2); + return result2; + } + function allowsImportingSourceFile(sourceFile, moduleSpecifierResolutionHost) { + if (!packageJsons.length) { + return true; + } + if (!sourceFileCache) { + sourceFileCache = /* @__PURE__ */ new Map(); + } else { + const cached = sourceFileCache.get(sourceFile); + if (cached !== void 0) { + return cached; + } + } + const moduleSpecifier = getNodeModulesPackageNameFromFileName(sourceFile.fileName, moduleSpecifierResolutionHost); + if (!moduleSpecifier) { + sourceFileCache.set(sourceFile, true); + return true; + } + const result2 = moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + sourceFileCache.set(sourceFile, result2); + return result2; + } + function allowsImportingSpecifier(moduleSpecifier) { + if (!packageJsons.length || isAllowedCoreNodeModulesImport(moduleSpecifier)) { + return true; + } + if (pathIsRelative(moduleSpecifier) || isRootedDiskPath(moduleSpecifier)) { + return true; + } + return moduleSpecifierIsCoveredByPackageJson(moduleSpecifier); + } + function isAllowedCoreNodeModulesImport(moduleSpecifier) { + if (isSourceFileJS(fromFile2) && ts_JsTyping_exports.nodeCoreModules.has(moduleSpecifier)) { + if (usesNodeCoreModules === void 0) { + usesNodeCoreModules = consumesNodeCoreModules(fromFile2); + } + if (usesNodeCoreModules) { + return true; + } + } + return false; + } + function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) { + if (!importedFileName.includes("node_modules")) { + return void 0; + } + const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName( + host.getCompilationSettings(), + fromFile2, + importedFileName, + moduleSpecifierResolutionHost, + preferences + ); + if (!specifier) { + return void 0; + } + if (!pathIsRelative(specifier) && !isRootedDiskPath(specifier)) { + return getNodeModuleRootSpecifier(specifier); + } + } + function getNodeModuleRootSpecifier(fullSpecifier) { + const components = getPathComponents(getPackageNameFromTypesPackageName(fullSpecifier)).slice(1); + if (startsWith2(components[0], "@")) { + return `${components[0]}/${components[1]}`; + } + return components[0]; + } + } + function consumesNodeCoreModules(sourceFile) { + return some2(sourceFile.imports, ({ text }) => ts_JsTyping_exports.nodeCoreModules.has(text)); + } + function isInsideNodeModules(fileOrDirectory) { + return contains2(getPathComponents(fileOrDirectory), "node_modules"); + } + function isDiagnosticWithLocation(diagnostic) { + return diagnostic.file !== void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0; + } + function findDiagnosticForNode(node, sortedFileDiagnostics) { + const span = createTextSpanFromNode(node); + const index4 = binarySearchKey(sortedFileDiagnostics, span, identity2, compareTextSpans); + if (index4 >= 0) { + const diagnostic = sortedFileDiagnostics[index4]; + Debug.assertEqual(diagnostic.file, node.getSourceFile(), "Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"); + return cast(diagnostic, isDiagnosticWithLocation); + } + } + function getDiagnosticsWithinSpan(span, sortedFileDiagnostics) { + var _a2; + let index4 = binarySearchKey(sortedFileDiagnostics, span.start, (diag2) => diag2.start, compareValues); + if (index4 < 0) { + index4 = ~index4; + } + while (((_a2 = sortedFileDiagnostics[index4 - 1]) == null ? void 0 : _a2.start) === span.start) { + index4--; + } + const result2 = []; + const end = textSpanEnd(span); + while (true) { + const diagnostic = tryCast(sortedFileDiagnostics[index4], isDiagnosticWithLocation); + if (!diagnostic || diagnostic.start > end) { + break; + } + if (textSpanContainsTextSpan(span, diagnostic)) { + result2.push(diagnostic); + } + index4++; + } + return result2; + } + function getRefactorContextSpan({ startPosition, endPosition }) { + return createTextSpanFromBounds(startPosition, endPosition === void 0 ? startPosition : endPosition); + } + function getFixableErrorSpanExpression(sourceFile, span) { + const token = getTokenAtPosition(sourceFile, span.start); + const expression = findAncestor(token, (node) => { + if (node.getStart(sourceFile) < span.start || node.getEnd() > textSpanEnd(span)) { + return "quit"; + } + return isExpression(node) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile)); + }); + return expression; + } + function mapOneOrMany(valueOrArray, f8, resultSelector = identity2) { + return valueOrArray ? isArray3(valueOrArray) ? resultSelector(map4(valueOrArray, f8)) : f8(valueOrArray, 0) : void 0; + } + function firstOrOnly(valueOrArray) { + return isArray3(valueOrArray) ? first(valueOrArray) : valueOrArray; + } + function getNamesForExportedSymbol(symbol, scriptTarget) { + if (needsNameFromDeclaration(symbol)) { + const fromDeclaration = getDefaultLikeExportNameFromDeclaration(symbol); + if (fromDeclaration) + return fromDeclaration; + const fileNameCase = ts_codefix_exports.moduleSymbolToValidIdentifier( + getSymbolParentOrFail(symbol), + scriptTarget, + /*forceCapitalize*/ + false + ); + const capitalized = ts_codefix_exports.moduleSymbolToValidIdentifier( + getSymbolParentOrFail(symbol), + scriptTarget, + /*forceCapitalize*/ + true + ); + if (fileNameCase === capitalized) + return fileNameCase; + return [fileNameCase, capitalized]; + } + return symbol.name; + } + function getNameForExportedSymbol(symbol, scriptTarget, preferCapitalized) { + if (needsNameFromDeclaration(symbol)) { + return getDefaultLikeExportNameFromDeclaration(symbol) || ts_codefix_exports.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, !!preferCapitalized); + } + return symbol.name; + } + function needsNameFromDeclaration(symbol) { + return !(symbol.flags & 33554432) && (symbol.escapedName === "export=" || symbol.escapedName === "default"); + } + function getDefaultLikeExportNameFromDeclaration(symbol) { + return firstDefined(symbol.declarations, (d7) => { + var _a2, _b, _c; + if (isExportAssignment(d7)) { + return (_a2 = tryCast(skipOuterExpressions(d7.expression), isIdentifier)) == null ? void 0 : _a2.text; + } + if (isExportSpecifier(d7) && d7.symbol.flags === 2097152) { + return (_b = tryCast(d7.propertyName, isIdentifier)) == null ? void 0 : _b.text; + } + return (_c = tryCast(getNameOfDeclaration(d7), isIdentifier)) == null ? void 0 : _c.text; + }); + } + function getSymbolParentOrFail(symbol) { + var _a2; + return Debug.checkDefined( + symbol.parent, + `Symbol parent was undefined. Flags: ${Debug.formatSymbolFlags(symbol.flags)}. Declarations: ${(_a2 = symbol.declarations) == null ? void 0 : _a2.map((d7) => { + const kind = Debug.formatSyntaxKind(d7.kind); + const inJS = isInJSFile(d7); + const { expression } = d7; + return (inJS ? "[JS]" : "") + kind + (expression ? ` (expression: ${Debug.formatSyntaxKind(expression.kind)})` : ""); + }).join(", ")}.` + ); + } + function stringContainsAt(haystack, needle, startIndex) { + const needleLength = needle.length; + if (needleLength + startIndex > haystack.length) { + return false; + } + for (let i7 = 0; i7 < needleLength; i7++) { + if (needle.charCodeAt(i7) !== haystack.charCodeAt(i7 + startIndex)) + return false; + } + return true; + } + function startsWithUnderscore(name2) { + return name2.charCodeAt(0) === 95; + } + function isGlobalDeclaration(declaration) { + return !isNonGlobalDeclaration(declaration); + } + function isNonGlobalDeclaration(declaration) { + const sourceFile = declaration.getSourceFile(); + if (!sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) { + return false; + } + return isInJSFile(declaration) || !findAncestor(declaration, (d7) => isModuleDeclaration(d7) && isGlobalScopeAugmentation(d7)); + } + function isDeprecatedDeclaration(decl) { + return !!(getCombinedNodeFlagsAlwaysIncludeJSDoc(decl) & 65536); + } + function shouldUseUriStyleNodeCoreModules(file, program) { + const decisionFromFile = firstDefined(file.imports, (node) => { + if (ts_JsTyping_exports.nodeCoreModules.has(node.text)) { + return startsWith2(node.text, "node:"); + } + }); + return decisionFromFile ?? program.usesUriStyleNodeCoreModules; + } + function getNewLineKind(newLineCharacter) { + return newLineCharacter === "\n" ? 1 : 0; + } + function diagnosticToString(diag2) { + return isArray3(diag2) ? formatStringFromArgs(getLocaleSpecificMessage(diag2[0]), diag2.slice(1)) : getLocaleSpecificMessage(diag2); + } + function getFormatCodeSettingsForWriting({ options }, sourceFile) { + const shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === "ignore"; + const shouldRemoveSemicolons = options.semicolons === "remove" || shouldAutoDetectSemicolonPreference && !probablyUsesSemicolons(sourceFile); + return { + ...options, + semicolons: shouldRemoveSemicolons ? "remove" : "ignore" + /* Ignore */ + }; + } + function jsxModeNeedsExplicitImport(jsx) { + return jsx === 2 || jsx === 3; + } + function isSourceFileFromLibrary(program, node) { + return program.isSourceFileFromExternalLibrary(node) || program.isSourceFileDefaultLibrary(node); + } + function newCaseClauseTracker(checker, clauses) { + const existingStrings = /* @__PURE__ */ new Set(); + const existingNumbers = /* @__PURE__ */ new Set(); + const existingBigInts = /* @__PURE__ */ new Set(); + for (const clause of clauses) { + if (!isDefaultClause(clause)) { + const expression = skipParentheses(clause.expression); + if (isLiteralExpression(expression)) { + switch (expression.kind) { + case 15: + case 11: + existingStrings.add(expression.text); + break; + case 9: + existingNumbers.add(parseInt(expression.text)); + break; + case 10: + const parsedBigInt = parseBigInt(endsWith2(expression.text, "n") ? expression.text.slice(0, -1) : expression.text); + if (parsedBigInt) { + existingBigInts.add(pseudoBigIntToString(parsedBigInt)); + } + break; + } + } else { + const symbol = checker.getSymbolAtLocation(clause.expression); + if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { + const enumValue = checker.getConstantValue(symbol.valueDeclaration); + if (enumValue !== void 0) { + addValue(enumValue); + } + } + } + } + } + return { + addValue, + hasValue + }; + function addValue(value2) { + switch (typeof value2) { + case "string": + existingStrings.add(value2); + break; + case "number": + existingNumbers.add(value2); + } + } + function hasValue(value2) { + switch (typeof value2) { + case "string": + return existingStrings.has(value2); + case "number": + return existingNumbers.has(value2); + case "object": + return existingBigInts.has(pseudoBigIntToString(value2)); + } + } + } + function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) { + var _a2; + const fileName = typeof file === "string" ? file : file.fileName; + if (!hasJSFileExtension(fileName)) { + return false; + } + const compilerOptions = program.getCompilerOptions(); + const moduleKind = getEmitModuleKind(compilerOptions); + const impliedNodeFormat = typeof file === "string" ? getImpliedNodeFormatForFile(toPath2(file, host.getCurrentDirectory(), hostGetCanonicalFileName(host)), (_a2 = program.getPackageJsonInfoCache) == null ? void 0 : _a2.call(program), host, compilerOptions) : file.impliedNodeFormat; + if (impliedNodeFormat === 99) { + return false; + } + if (impliedNodeFormat === 1) { + return true; + } + if (compilerOptions.verbatimModuleSyntax && moduleKind === 1) { + return true; + } + if (compilerOptions.verbatimModuleSyntax && emitModuleKindIsNonNodeESM(moduleKind)) { + return false; + } + if (typeof file === "object") { + if (file.commonJsModuleIndicator) { + return true; + } + if (file.externalModuleIndicator) { + return false; + } + } + return preferRequire; + } + var scanner, SemanticMeaning, tripleSlashDirectivePrefixRegex, typeKeywords, QuotePreference, displayPartWriter, lineFeed2, ANONYMOUS, syntaxMayBeASICandidate; + var init_utilities4 = __esm2({ + "src/services/utilities.ts"() { + "use strict"; + init_ts4(); + scanner = createScanner3( + 99, + /*skipTrivia*/ + true + ); + SemanticMeaning = /* @__PURE__ */ ((SemanticMeaning3) => { + SemanticMeaning3[SemanticMeaning3["None"] = 0] = "None"; + SemanticMeaning3[SemanticMeaning3["Value"] = 1] = "Value"; + SemanticMeaning3[SemanticMeaning3["Type"] = 2] = "Type"; + SemanticMeaning3[SemanticMeaning3["Namespace"] = 4] = "Namespace"; + SemanticMeaning3[SemanticMeaning3["All"] = 7] = "All"; + return SemanticMeaning3; + })(SemanticMeaning || {}); + tripleSlashDirectivePrefixRegex = /^\/\/\/\s* { + QuotePreference7[QuotePreference7["Single"] = 0] = "Single"; + QuotePreference7[QuotePreference7["Double"] = 1] = "Double"; + return QuotePreference7; + })(QuotePreference || {}); + displayPartWriter = getDisplayPartWriter(); + lineFeed2 = "\n"; + ANONYMOUS = "anonymous function"; + syntaxMayBeASICandidate = or( + syntaxRequiresTrailingCommaOrSemicolonOrASI, + syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI, + syntaxRequiresTrailingModuleBlockOrSemicolonOrASI, + syntaxRequiresTrailingSemicolonOrASI + ); + } + }); + function createCacheableExportInfoMap(host) { + let exportInfoId = 1; + const exportInfo = createMultiMap(); + const symbols = /* @__PURE__ */ new Map(); + const packages = /* @__PURE__ */ new Map(); + let usableByFileName; + const cache = { + isUsableByFile: (importingFile) => importingFile === usableByFileName, + isEmpty: () => !exportInfo.size, + clear: () => { + exportInfo.clear(); + symbols.clear(); + usableByFileName = void 0; + }, + add: (importingFile, symbol, symbolTableKey, moduleSymbol, moduleFile, exportKind, isFromPackageJson, checker) => { + if (importingFile !== usableByFileName) { + cache.clear(); + usableByFileName = importingFile; + } + let packageName; + if (moduleFile) { + const nodeModulesPathParts = getNodeModulePathParts(moduleFile.fileName); + if (nodeModulesPathParts) { + const { topLevelNodeModulesIndex, topLevelPackageNameIndex, packageRootIndex } = nodeModulesPathParts; + packageName = unmangleScopedPackageName(getPackageNameFromTypesPackageName(moduleFile.fileName.substring(topLevelPackageNameIndex + 1, packageRootIndex))); + if (startsWith2(importingFile, moduleFile.path.substring(0, topLevelNodeModulesIndex))) { + const prevDeepestNodeModulesPath = packages.get(packageName); + const nodeModulesPath = moduleFile.fileName.substring(0, topLevelPackageNameIndex + 1); + if (prevDeepestNodeModulesPath) { + const prevDeepestNodeModulesIndex = prevDeepestNodeModulesPath.indexOf(nodeModulesPathPart); + if (topLevelNodeModulesIndex > prevDeepestNodeModulesIndex) { + packages.set(packageName, nodeModulesPath); + } + } else { + packages.set(packageName, nodeModulesPath); + } + } + } + } + const isDefault = exportKind === 1; + const namedSymbol = isDefault && getLocalSymbolForExportDefault(symbol) || symbol; + const names = exportKind === 0 || isExternalModuleSymbol(namedSymbol) ? unescapeLeadingUnderscores(symbolTableKey) : getNamesForExportedSymbol( + namedSymbol, + /*scriptTarget*/ + void 0 + ); + const symbolName2 = typeof names === "string" ? names : names[0]; + const capitalizedSymbolName = typeof names === "string" ? void 0 : names[1]; + const moduleName3 = stripQuotes(moduleSymbol.name); + const id = exportInfoId++; + const target = skipAlias(symbol, checker); + const storedSymbol = symbol.flags & 33554432 ? void 0 : symbol; + const storedModuleSymbol = moduleSymbol.flags & 33554432 ? void 0 : moduleSymbol; + if (!storedSymbol || !storedModuleSymbol) + symbols.set(id, [symbol, moduleSymbol]); + exportInfo.add(key(symbolName2, symbol, isExternalModuleNameRelative(moduleName3) ? void 0 : moduleName3, checker), { + id, + symbolTableKey, + symbolName: symbolName2, + capitalizedSymbolName, + moduleName: moduleName3, + moduleFile, + moduleFileName: moduleFile == null ? void 0 : moduleFile.fileName, + packageName, + exportKind, + targetFlags: target.flags, + isFromPackageJson, + symbol: storedSymbol, + moduleSymbol: storedModuleSymbol + }); + }, + get: (importingFile, key2) => { + if (importingFile !== usableByFileName) + return; + const result2 = exportInfo.get(key2); + return result2 == null ? void 0 : result2.map(rehydrateCachedInfo); + }, + search: (importingFile, preferCapitalized, matches2, action) => { + if (importingFile !== usableByFileName) + return; + return forEachEntry(exportInfo, (info2, key2) => { + const { symbolName: symbolName2, ambientModuleName } = parseKey(key2); + const name2 = preferCapitalized && info2[0].capitalizedSymbolName || symbolName2; + if (matches2(name2, info2[0].targetFlags)) { + const rehydrated = info2.map(rehydrateCachedInfo); + const filtered = rehydrated.filter((r8, i7) => isNotShadowedByDeeperNodeModulesPackage(r8, info2[i7].packageName)); + if (filtered.length) { + const res = action(filtered, name2, !!ambientModuleName, key2); + if (res !== void 0) + return res; + } + } + }); + }, + releaseSymbols: () => { + symbols.clear(); + }, + onFileChanged: (oldSourceFile, newSourceFile, typeAcquisitionEnabled) => { + if (fileIsGlobalOnly(oldSourceFile) && fileIsGlobalOnly(newSourceFile)) { + return false; + } + if (usableByFileName && usableByFileName !== newSourceFile.path || // If ATA is enabled, auto-imports uses existing imports to guess whether you want auto-imports from node. + // Adding or removing imports from node could change the outcome of that guess, so could change the suggestions list. + typeAcquisitionEnabled && consumesNodeCoreModules(oldSourceFile) !== consumesNodeCoreModules(newSourceFile) || // Module agumentation and ambient module changes can add or remove exports available to be auto-imported. + // Changes elsewhere in the file can change the *type* of an export in a module augmentation, + // but type info is gathered in getCompletionEntryDetails, which doesn't use the cache. + !arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations) || !ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile)) { + cache.clear(); + return true; + } + usableByFileName = newSourceFile.path; + return false; + } + }; + if (Debug.isDebugging) { + Object.defineProperty(cache, "__cache", { value: exportInfo }); + } + return cache; + function rehydrateCachedInfo(info2) { + if (info2.symbol && info2.moduleSymbol) + return info2; + const { id, exportKind, targetFlags, isFromPackageJson, moduleFileName } = info2; + const [cachedSymbol, cachedModuleSymbol] = symbols.get(id) || emptyArray; + if (cachedSymbol && cachedModuleSymbol) { + return { + symbol: cachedSymbol, + moduleSymbol: cachedModuleSymbol, + moduleFileName, + exportKind, + targetFlags, + isFromPackageJson + }; + } + const checker = (isFromPackageJson ? host.getPackageJsonAutoImportProvider() : host.getCurrentProgram()).getTypeChecker(); + const moduleSymbol = info2.moduleSymbol || cachedModuleSymbol || Debug.checkDefined( + info2.moduleFile ? checker.getMergedSymbol(info2.moduleFile.symbol) : checker.tryFindAmbientModule(info2.moduleName) + ); + const symbol = info2.symbol || cachedSymbol || Debug.checkDefined( + exportKind === 2 ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(unescapeLeadingUnderscores(info2.symbolTableKey), moduleSymbol), + `Could not find symbol '${info2.symbolName}' by key '${info2.symbolTableKey}' in module ${moduleSymbol.name}` + ); + symbols.set(id, [symbol, moduleSymbol]); + return { + symbol, + moduleSymbol, + moduleFileName, + exportKind, + targetFlags, + isFromPackageJson + }; + } + function key(importedName, symbol, ambientModuleName, checker) { + const moduleKey = ambientModuleName || ""; + return `${importedName.length} ${getSymbolId(skipAlias(symbol, checker))} ${importedName} ${moduleKey}`; + } + function parseKey(key2) { + const firstSpace = key2.indexOf(" "); + const secondSpace = key2.indexOf(" ", firstSpace + 1); + const symbolNameLength = parseInt(key2.substring(0, firstSpace), 10); + const data = key2.substring(secondSpace + 1); + const symbolName2 = data.substring(0, symbolNameLength); + const moduleKey = data.substring(symbolNameLength + 1); + const ambientModuleName = moduleKey === "" ? void 0 : moduleKey; + return { symbolName: symbolName2, ambientModuleName }; + } + function fileIsGlobalOnly(file) { + return !file.commonJsModuleIndicator && !file.externalModuleIndicator && !file.moduleAugmentations && !file.ambientModuleNames; + } + function ambientModuleDeclarationsAreEqual(oldSourceFile, newSourceFile) { + if (!arrayIsEqualTo(oldSourceFile.ambientModuleNames, newSourceFile.ambientModuleNames)) { + return false; + } + let oldFileStatementIndex = -1; + let newFileStatementIndex = -1; + for (const ambientModuleName of newSourceFile.ambientModuleNames) { + const isMatchingModuleDeclaration = (node) => isNonGlobalAmbientModule(node) && node.name.text === ambientModuleName; + oldFileStatementIndex = findIndex2(oldSourceFile.statements, isMatchingModuleDeclaration, oldFileStatementIndex + 1); + newFileStatementIndex = findIndex2(newSourceFile.statements, isMatchingModuleDeclaration, newFileStatementIndex + 1); + if (oldSourceFile.statements[oldFileStatementIndex] !== newSourceFile.statements[newFileStatementIndex]) { + return false; + } + } + return true; + } + function isNotShadowedByDeeperNodeModulesPackage(info2, packageName) { + if (!packageName || !info2.moduleFileName) + return true; + const typingsCacheLocation = host.getGlobalTypingsCacheLocation(); + if (typingsCacheLocation && startsWith2(info2.moduleFileName, typingsCacheLocation)) + return true; + const packageDeepestNodeModulesPath = packages.get(packageName); + return !packageDeepestNodeModulesPath || startsWith2(info2.moduleFileName, packageDeepestNodeModulesPath); + } + } + function isImportableFile(program, from, to, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) { + var _a2; + if (from === to) + return false; + const cachedResult = moduleSpecifierCache == null ? void 0 : moduleSpecifierCache.get(from.path, to.path, preferences, {}); + if ((cachedResult == null ? void 0 : cachedResult.isBlockedByPackageJsonDependencies) !== void 0) { + return !cachedResult.isBlockedByPackageJsonDependencies; + } + const getCanonicalFileName = hostGetCanonicalFileName(moduleSpecifierResolutionHost); + const globalTypingsCache = (_a2 = moduleSpecifierResolutionHost.getGlobalTypingsCacheLocation) == null ? void 0 : _a2.call(moduleSpecifierResolutionHost); + const hasImportablePath = !!ts_moduleSpecifiers_exports.forEachFileNameOfModule( + from.fileName, + to.fileName, + moduleSpecifierResolutionHost, + /*preferSymlinks*/ + false, + (toPath3) => { + const toFile = program.getSourceFile(toPath3); + return (toFile === to || !toFile) && isImportablePath(from.fileName, toPath3, getCanonicalFileName, globalTypingsCache); + } + ); + if (packageJsonFilter) { + const isAutoImportable = hasImportablePath && packageJsonFilter.allowsImportingSourceFile(to, moduleSpecifierResolutionHost); + moduleSpecifierCache == null ? void 0 : moduleSpecifierCache.setBlockedByPackageJsonDependencies(from.path, to.path, preferences, {}, !isAutoImportable); + return isAutoImportable; + } + return hasImportablePath; + } + function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePath) { + const toNodeModules = forEachAncestorDirectory(toPath3, (ancestor) => getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0); + const toNodeModulesParent = toNodeModules && getDirectoryPath(getCanonicalFileName(toNodeModules)); + return toNodeModulesParent === void 0 || startsWith2(getCanonicalFileName(fromPath), toNodeModulesParent) || !!globalCachePath && startsWith2(getCanonicalFileName(globalCachePath), toNodeModulesParent); + } + function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) { + var _a2, _b; + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); + const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => { + const pattern5 = getSubPatternFromSpec(spec, "", "exclude"); + return pattern5 ? getRegexFromPattern(pattern5, useCaseSensitiveFileNames2) : void 0; + }); + forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, host, (module22, file) => cb( + module22, + file, + program, + /*isFromPackageJson*/ + false + )); + const autoImportProvider = useAutoImportProvider && ((_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host)); + if (autoImportProvider) { + const start = timestamp3(); + const checker = program.getTypeChecker(); + forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), excludePatterns, host, (module22, file) => { + if (file && !program.getSourceFile(file.fileName) || !file && !checker.resolveName( + module22.name, + /*location*/ + void 0, + 1536, + /*excludeGlobals*/ + false + )) { + cb( + module22, + file, + autoImportProvider, + /*isFromPackageJson*/ + true + ); + } + }); + (_b = host.log) == null ? void 0 : _b.call(host, `forEachExternalModuleToImportFrom autoImportProvider: ${timestamp3() - start}`); + } + } + function forEachExternalModule(checker, allSourceFiles, excludePatterns, host, cb) { + var _a2, _b; + const realpathsWithSymlinks = (_a2 = host.getSymlinkCache) == null ? void 0 : _a2.call(host).getSymlinkedDirectoriesByRealpath(); + const isExcluded = excludePatterns && (({ fileName, path: path2 }) => { + if (excludePatterns.some((p7) => p7.test(fileName))) + return true; + if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) { + let dir2 = getDirectoryPath(fileName); + return forEachAncestorDirectory(getDirectoryPath(path2), (dirPath) => { + const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath)); + if (symlinks) { + return symlinks.some((s7) => excludePatterns.some((p7) => p7.test(fileName.replace(dir2, s7)))); + } + dir2 = getDirectoryPath(dir2); + }) ?? false; + } + return false; + }); + for (const ambient of checker.getAmbientModules()) { + if (!ambient.name.includes("*") && !(excludePatterns && ((_b = ambient.declarations) == null ? void 0 : _b.every((d7) => isExcluded(d7.getSourceFile()))))) { + cb( + ambient, + /*sourceFile*/ + void 0 + ); + } + } + for (const sourceFile of allSourceFiles) { + if (isExternalOrCommonJsModule(sourceFile) && !(isExcluded == null ? void 0 : isExcluded(sourceFile))) { + cb(checker.getMergedSymbol(sourceFile.symbol), sourceFile); + } + } + } + function getExportInfoMap(importingFile, host, program, preferences, cancellationToken) { + var _a2, _b, _c, _d, _e2; + const start = timestamp3(); + (_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host); + const cache = ((_b = host.getCachedExportInfoMap) == null ? void 0 : _b.call(host)) || createCacheableExportInfoMap({ + getCurrentProgram: () => program, + getPackageJsonAutoImportProvider: () => { + var _a22; + return (_a22 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a22.call(host); + }, + getGlobalTypingsCacheLocation: () => { + var _a22; + return (_a22 = host.getGlobalTypingsCacheLocation) == null ? void 0 : _a22.call(host); + } + }); + if (cache.isUsableByFile(importingFile.path)) { + (_c = host.log) == null ? void 0 : _c.call(host, "getExportInfoMap: cache hit"); + return cache; + } + (_d = host.log) == null ? void 0 : _d.call(host, "getExportInfoMap: cache miss or empty; calculating new results"); + const compilerOptions = program.getCompilerOptions(); + let moduleCount = 0; + try { + forEachExternalModuleToImportFrom( + program, + host, + preferences, + /*useAutoImportProvider*/ + true, + (moduleSymbol, moduleFile, program2, isFromPackageJson) => { + if (++moduleCount % 100 === 0) + cancellationToken == null ? void 0 : cancellationToken.throwIfCancellationRequested(); + const seenExports = /* @__PURE__ */ new Map(); + const checker = program2.getTypeChecker(); + const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) { + cache.add( + importingFile.path, + defaultInfo.symbol, + defaultInfo.exportKind === 1 ? "default" : "export=", + moduleSymbol, + moduleFile, + defaultInfo.exportKind, + isFromPackageJson, + checker + ); + } + checker.forEachExportAndPropertyOfModule(moduleSymbol, (exported, key) => { + if (exported !== (defaultInfo == null ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && addToSeen(seenExports, key)) { + cache.add( + importingFile.path, + exported, + key, + moduleSymbol, + moduleFile, + 0, + isFromPackageJson, + checker + ); + } + }); + } + ); + } catch (err) { + cache.clear(); + throw err; + } + (_e2 = host.log) == null ? void 0 : _e2.call(host, `getExportInfoMap: done in ${timestamp3() - start} ms`); + return cache; + } + function getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions) { + const exported = getDefaultLikeExportWorker(moduleSymbol, checker); + if (!exported) + return void 0; + const { symbol, exportKind } = exported; + const info2 = getDefaultExportInfoWorker(symbol, checker, compilerOptions); + return info2 && { symbol, exportKind, ...info2 }; + } + function isImportableSymbol(symbol, checker) { + return !checker.isUndefinedSymbol(symbol) && !checker.isUnknownSymbol(symbol) && !isKnownSymbol(symbol) && !isPrivateIdentifierSymbol(symbol); + } + function getDefaultLikeExportWorker(moduleSymbol, checker) { + const exportEquals = checker.resolveExternalModuleSymbol(moduleSymbol); + if (exportEquals !== moduleSymbol) + return { + symbol: exportEquals, + exportKind: 2 + /* ExportEquals */ + }; + const defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + if (defaultExport) + return { + symbol: defaultExport, + exportKind: 1 + /* Default */ + }; + } + function getDefaultExportInfoWorker(defaultExport, checker, compilerOptions) { + const localSymbol = getLocalSymbolForExportDefault(defaultExport); + if (localSymbol) + return { resolvedSymbol: localSymbol, name: localSymbol.name }; + const name2 = getNameForExportDefault(defaultExport); + if (name2 !== void 0) + return { resolvedSymbol: defaultExport, name: name2 }; + if (defaultExport.flags & 2097152) { + const aliased = checker.getImmediateAliasedSymbol(defaultExport); + if (aliased && aliased.parent) { + return getDefaultExportInfoWorker(aliased, checker, compilerOptions); + } + } + if (defaultExport.escapedName !== "default" && defaultExport.escapedName !== "export=") { + return { resolvedSymbol: defaultExport, name: defaultExport.getName() }; + } + return { resolvedSymbol: defaultExport, name: getNameForExportedSymbol(defaultExport, compilerOptions.target) }; + } + function getNameForExportDefault(symbol) { + return symbol.declarations && firstDefined(symbol.declarations, (declaration) => { + var _a2; + if (isExportAssignment(declaration)) { + return (_a2 = tryCast(skipOuterExpressions(declaration.expression), isIdentifier)) == null ? void 0 : _a2.text; + } else if (isExportSpecifier(declaration)) { + Debug.assert(declaration.name.text === "default", "Expected the specifier to be a default export"); + return declaration.propertyName && declaration.propertyName.text; + } + }); + } + var ImportKind, ExportKind; + var init_exportInfoMap = __esm2({ + "src/services/exportInfoMap.ts"() { + "use strict"; + init_ts4(); + ImportKind = /* @__PURE__ */ ((ImportKind2) => { + ImportKind2[ImportKind2["Named"] = 0] = "Named"; + ImportKind2[ImportKind2["Default"] = 1] = "Default"; + ImportKind2[ImportKind2["Namespace"] = 2] = "Namespace"; + ImportKind2[ImportKind2["CommonJS"] = 3] = "CommonJS"; + return ImportKind2; + })(ImportKind || {}); + ExportKind = /* @__PURE__ */ ((ExportKind3) => { + ExportKind3[ExportKind3["Named"] = 0] = "Named"; + ExportKind3[ExportKind3["Default"] = 1] = "Default"; + ExportKind3[ExportKind3["ExportEquals"] = 2] = "ExportEquals"; + ExportKind3[ExportKind3["UMD"] = 3] = "UMD"; + return ExportKind3; + })(ExportKind || {}); + } + }); + function createClassifier() { + const scanner2 = createScanner3( + 99, + /*skipTrivia*/ + false + ); + function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { + return convertClassificationsToResult(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); + } + function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { + let token = 0; + let lastNonTriviaToken = 0; + const templateStack = []; + const { prefix, pushTemplate } = getPrefixFromLexState(lexState); + text = prefix + text; + const offset = prefix.length; + if (pushTemplate) { + templateStack.push( + 16 + /* TemplateHead */ + ); + } + scanner2.setText(text); + let endOfLineState = 0; + const spans = []; + let angleBracketStack = 0; + do { + token = scanner2.scan(); + if (!isTrivia(token)) { + handleToken(); + lastNonTriviaToken = token; + } + const end = scanner2.getTokenEnd(); + pushEncodedClassification(scanner2.getTokenStart(), end, offset, classFromKind(token), spans); + if (end >= text.length) { + const end2 = getNewEndOfLineState(scanner2, token, lastOrUndefined(templateStack)); + if (end2 !== void 0) { + endOfLineState = end2; + } + } + } while (token !== 1); + function handleToken() { + switch (token) { + case 44: + case 69: + if (!noRegexTable[lastNonTriviaToken] && scanner2.reScanSlashToken() === 14) { + token = 14; + } + break; + case 30: + if (lastNonTriviaToken === 80) { + angleBracketStack++; + } + break; + case 32: + if (angleBracketStack > 0) { + angleBracketStack--; + } + break; + case 133: + case 154: + case 150: + case 136: + case 155: + if (angleBracketStack > 0 && !syntacticClassifierAbsent) { + token = 80; + } + break; + case 16: + templateStack.push(token); + break; + case 19: + if (templateStack.length > 0) { + templateStack.push(token); + } + break; + case 20: + if (templateStack.length > 0) { + const lastTemplateStackToken = lastOrUndefined(templateStack); + if (lastTemplateStackToken === 16) { + token = scanner2.reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + if (token === 18) { + templateStack.pop(); + } else { + Debug.assertEqual(token, 17, "Should have been a template middle."); + } + } else { + Debug.assertEqual(lastTemplateStackToken, 19, "Should have been an open brace"); + templateStack.pop(); + } + } + break; + default: + if (!isKeyword(token)) { + break; + } + if (lastNonTriviaToken === 25) { + token = 80; + } else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { + token = 80; + } + } + } + return { endOfLineState, spans }; + } + return { getClassificationsForLine, getEncodedLexicalClassifications }; + } + function getNewEndOfLineState(scanner2, token, lastOnTemplateStack) { + switch (token) { + case 11: { + if (!scanner2.isUnterminated()) + return void 0; + const tokenText = scanner2.getTokenText(); + const lastCharIndex = tokenText.length - 1; + let numBackslashes = 0; + while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92) { + numBackslashes++; + } + if ((numBackslashes & 1) === 0) + return void 0; + return tokenText.charCodeAt(0) === 34 ? 3 : 2; + } + case 3: + return scanner2.isUnterminated() ? 1 : void 0; + default: + if (isTemplateLiteralKind(token)) { + if (!scanner2.isUnterminated()) { + return void 0; + } + switch (token) { + case 18: + return 5; + case 15: + return 4; + default: + return Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + } + } + return lastOnTemplateStack === 16 ? 6 : void 0; + } + } + function pushEncodedClassification(start, end, offset, classification, result2) { + if (classification === 8) { + return; + } + if (start === 0 && offset > 0) { + start += offset; + } + const length2 = end - start; + if (length2 > 0) { + result2.push(start - offset, length2, classification); + } + } + function convertClassificationsToResult(classifications, text) { + const entries = []; + const dense = classifications.spans; + let lastEnd = 0; + for (let i7 = 0; i7 < dense.length; i7 += 3) { + const start = dense[i7]; + const length2 = dense[i7 + 1]; + const type3 = dense[i7 + 2]; + if (lastEnd >= 0) { + const whitespaceLength2 = start - lastEnd; + if (whitespaceLength2 > 0) { + entries.push({ + length: whitespaceLength2, + classification: 4 + /* Whitespace */ + }); + } + } + entries.push({ length: length2, classification: convertClassification(type3) }); + lastEnd = start + length2; + } + const whitespaceLength = text.length - lastEnd; + if (whitespaceLength > 0) { + entries.push({ + length: whitespaceLength, + classification: 4 + /* Whitespace */ + }); + } + return { entries, finalLexState: classifications.endOfLineState }; + } + function convertClassification(type3) { + switch (type3) { + case 1: + return 3; + case 3: + return 1; + case 4: + return 6; + case 25: + return 7; + case 5: + return 2; + case 6: + return 8; + case 8: + return 4; + case 10: + return 0; + case 2: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 9: + case 17: + return 5; + default: + return void 0; + } + } + function canFollow(keyword1, keyword2) { + if (!isAccessibilityModifier(keyword1)) { + return true; + } + switch (keyword2) { + case 139: + case 153: + case 137: + case 126: + case 129: + return true; + default: + return false; + } + } + function getPrefixFromLexState(lexState) { + switch (lexState) { + case 3: + return { prefix: '"\\\n' }; + case 2: + return { prefix: "'\\\n" }; + case 1: + return { prefix: "/*\n" }; + case 4: + return { prefix: "`\n" }; + case 5: + return { prefix: "}\n", pushTemplate: true }; + case 6: + return { prefix: "", pushTemplate: true }; + case 0: + return { prefix: "" }; + default: + return Debug.assertNever(lexState); + } + } + function isBinaryExpressionOperatorToken(token) { + switch (token) { + case 42: + case 44: + case 45: + case 40: + case 41: + case 48: + case 49: + case 50: + case 30: + case 32: + case 33: + case 34: + case 104: + case 103: + case 130: + case 152: + case 35: + case 36: + case 37: + case 38: + case 51: + case 53: + case 52: + case 56: + case 57: + case 75: + case 74: + case 79: + case 71: + case 72: + case 73: + case 65: + case 66: + case 67: + case 69: + case 70: + case 64: + case 28: + case 61: + case 76: + case 77: + case 78: + return true; + default: + return false; + } + } + function isPrefixUnaryExpressionOperatorToken(token) { + switch (token) { + case 40: + case 41: + case 55: + case 54: + case 46: + case 47: + return true; + default: + return false; + } + } + function classFromKind(token) { + if (isKeyword(token)) { + return 3; + } else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { + return 5; + } else if (token >= 19 && token <= 79) { + return 10; + } + switch (token) { + case 9: + return 4; + case 10: + return 25; + case 11: + return 6; + case 14: + return 7; + case 7: + case 3: + case 2: + return 1; + case 5: + case 4: + return 8; + case 80: + default: + if (isTemplateLiteralKind(token)) { + return 6; + } + return 2; + } + } + function getSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { + return convertClassificationsToSpans(getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span)); + } + function checkForClassificationCancellation(cancellationToken, kind) { + switch (kind) { + case 267: + case 263: + case 264: + case 262: + case 231: + case 218: + case 219: + cancellationToken.throwIfCancellationRequested(); + } + } + function getEncodedSemanticClassifications(typeChecker, cancellationToken, sourceFile, classifiableNames, span) { + const spans = []; + sourceFile.forEachChild(function cb(node) { + if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { + return; + } + checkForClassificationCancellation(cancellationToken, node.kind); + if (isIdentifier(node) && !nodeIsMissing(node) && classifiableNames.has(node.escapedText)) { + const symbol = typeChecker.getSymbolAtLocation(node); + const type3 = symbol && classifySymbol(symbol, getMeaningFromLocation(node), typeChecker); + if (type3) { + pushClassification(node.getStart(sourceFile), node.getEnd(), type3); + } + } + node.forEachChild(cb); + }); + return { + spans, + endOfLineState: 0 + /* None */ + }; + function pushClassification(start, end, type3) { + const length2 = end - start; + Debug.assert(length2 > 0, `Classification had non-positive length of ${length2}`); + spans.push(start); + spans.push(length2); + spans.push(type3); + } + } + function classifySymbol(symbol, meaningAtPosition, checker) { + const flags = symbol.getFlags(); + if ((flags & 2885600) === 0) { + return void 0; + } else if (flags & 32) { + return 11; + } else if (flags & 384) { + return 12; + } else if (flags & 524288) { + return 16; + } else if (flags & 1536) { + return meaningAtPosition & 4 || meaningAtPosition & 1 && hasValueSideModule(symbol) ? 14 : void 0; + } else if (flags & 2097152) { + return classifySymbol(checker.getAliasedSymbol(symbol), meaningAtPosition, checker); + } else if (meaningAtPosition & 2) { + return flags & 64 ? 13 : flags & 262144 ? 15 : void 0; + } else { + return void 0; + } + } + function hasValueSideModule(symbol) { + return some2( + symbol.declarations, + (declaration) => isModuleDeclaration(declaration) && getModuleInstanceState(declaration) === 1 + /* Instantiated */ + ); + } + function getClassificationTypeName(type3) { + switch (type3) { + case 1: + return "comment"; + case 2: + return "identifier"; + case 3: + return "keyword"; + case 4: + return "number"; + case 25: + return "bigint"; + case 5: + return "operator"; + case 6: + return "string"; + case 8: + return "whitespace"; + case 9: + return "text"; + case 10: + return "punctuation"; + case 11: + return "class name"; + case 12: + return "enum name"; + case 13: + return "interface name"; + case 14: + return "module name"; + case 15: + return "type parameter name"; + case 16: + return "type alias name"; + case 17: + return "parameter name"; + case 18: + return "doc comment tag name"; + case 19: + return "jsx open tag name"; + case 20: + return "jsx close tag name"; + case 21: + return "jsx self closing tag name"; + case 22: + return "jsx attribute"; + case 23: + return "jsx text"; + case 24: + return "jsx attribute string literal value"; + default: + return void 0; + } + } + function convertClassificationsToSpans(classifications) { + Debug.assert(classifications.spans.length % 3 === 0); + const dense = classifications.spans; + const result2 = []; + for (let i7 = 0; i7 < dense.length; i7 += 3) { + result2.push({ + textSpan: createTextSpan(dense[i7], dense[i7 + 1]), + classificationType: getClassificationTypeName(dense[i7 + 2]) + }); + } + return result2; + } + function getSyntacticClassifications(cancellationToken, sourceFile, span) { + return convertClassificationsToSpans(getEncodedSyntacticClassifications(cancellationToken, sourceFile, span)); + } + function getEncodedSyntacticClassifications(cancellationToken, sourceFile, span) { + const spanStart = span.start; + const spanLength = span.length; + const triviaScanner = createScanner3( + 99, + /*skipTrivia*/ + false, + sourceFile.languageVariant, + sourceFile.text + ); + const mergeConflictScanner = createScanner3( + 99, + /*skipTrivia*/ + false, + sourceFile.languageVariant, + sourceFile.text + ); + const result2 = []; + processElement(sourceFile); + return { + spans: result2, + endOfLineState: 0 + /* None */ + }; + function pushClassification(start, length2, type3) { + result2.push(start); + result2.push(length2); + result2.push(type3); + } + function classifyLeadingTriviaAndGetTokenStart(token) { + triviaScanner.resetTokenState(token.pos); + while (true) { + const start = triviaScanner.getTokenEnd(); + if (!couldStartTrivia(sourceFile.text, start)) { + return start; + } + const kind = triviaScanner.scan(); + const end = triviaScanner.getTokenEnd(); + const width = end - start; + if (!isTrivia(kind)) { + return start; + } + switch (kind) { + case 4: + case 5: + continue; + case 2: + case 3: + classifyComment(token, kind, start, width); + triviaScanner.resetTokenState(end); + continue; + case 7: + const text = sourceFile.text; + const ch = text.charCodeAt(start); + if (ch === 60 || ch === 62) { + pushClassification( + start, + width, + 1 + /* comment */ + ); + continue; + } + Debug.assert( + ch === 124 || ch === 61 + /* equals */ + ); + classifyDisabledMergeCode(text, start, end); + break; + case 6: + break; + default: + Debug.assertNever(kind); + } + } + } + function classifyComment(token, kind, start, width) { + if (kind === 3) { + const docCommentAndDiagnostics = parseIsolatedJSDocComment(sourceFile.text, start, width); + if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDoc) { + setParent(docCommentAndDiagnostics.jsDoc, token); + classifyJSDocComment(docCommentAndDiagnostics.jsDoc); + return; + } + } else if (kind === 2) { + if (tryClassifyTripleSlashComment(start, width)) { + return; + } + } + pushCommentRange(start, width); + } + function pushCommentRange(start, width) { + pushClassification( + start, + width, + 1 + /* comment */ + ); + } + function classifyJSDocComment(docComment) { + var _a2, _b, _c, _d, _e2, _f, _g, _h; + let pos = docComment.pos; + if (docComment.tags) { + for (const tag of docComment.tags) { + if (tag.pos !== pos) { + pushCommentRange(pos, tag.pos - pos); + } + pushClassification( + tag.pos, + 1, + 10 + /* punctuation */ + ); + pushClassification( + tag.tagName.pos, + tag.tagName.end - tag.tagName.pos, + 18 + /* docCommentTagName */ + ); + pos = tag.tagName.end; + let commentStart = tag.tagName.end; + switch (tag.kind) { + case 348: + const param = tag; + processJSDocParameterTag(param); + commentStart = param.isNameFirst && ((_a2 = param.typeExpression) == null ? void 0 : _a2.end) || param.name.end; + break; + case 355: + const prop = tag; + commentStart = prop.isNameFirst && ((_b = prop.typeExpression) == null ? void 0 : _b.end) || prop.name.end; + break; + case 352: + processJSDocTemplateTag(tag); + pos = tag.end; + commentStart = tag.typeParameters.end; + break; + case 353: + const type3 = tag; + commentStart = ((_c = type3.typeExpression) == null ? void 0 : _c.kind) === 316 && ((_d = type3.fullName) == null ? void 0 : _d.end) || ((_e2 = type3.typeExpression) == null ? void 0 : _e2.end) || commentStart; + break; + case 345: + commentStart = tag.typeExpression.end; + break; + case 351: + processElement(tag.typeExpression); + pos = tag.end; + commentStart = tag.typeExpression.end; + break; + case 350: + case 347: + commentStart = tag.typeExpression.end; + break; + case 349: + processElement(tag.typeExpression); + pos = tag.end; + commentStart = ((_f = tag.typeExpression) == null ? void 0 : _f.end) || commentStart; + break; + case 354: + commentStart = ((_g = tag.name) == null ? void 0 : _g.end) || commentStart; + break; + case 335: + case 336: + commentStart = tag.class.end; + break; + case 356: + processElement(tag.typeExpression); + pos = tag.end; + commentStart = ((_h = tag.typeExpression) == null ? void 0 : _h.end) || commentStart; + break; + } + if (typeof tag.comment === "object") { + pushCommentRange(tag.comment.pos, tag.comment.end - tag.comment.pos); + } else if (typeof tag.comment === "string") { + pushCommentRange(commentStart, tag.end - commentStart); + } + } + } + if (pos !== docComment.end) { + pushCommentRange(pos, docComment.end - pos); + } + return; + function processJSDocParameterTag(tag) { + if (tag.isNameFirst) { + pushCommentRange(pos, tag.name.pos - pos); + pushClassification( + tag.name.pos, + tag.name.end - tag.name.pos, + 17 + /* parameterName */ + ); + pos = tag.name.end; + } + if (tag.typeExpression) { + pushCommentRange(pos, tag.typeExpression.pos - pos); + processElement(tag.typeExpression); + pos = tag.typeExpression.end; + } + if (!tag.isNameFirst) { + pushCommentRange(pos, tag.name.pos - pos); + pushClassification( + tag.name.pos, + tag.name.end - tag.name.pos, + 17 + /* parameterName */ + ); + pos = tag.name.end; + } + } + } + function tryClassifyTripleSlashComment(start, width) { + const tripleSlashXMLCommentRegEx = /^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im; + const attributeRegex = /(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/img; + const text = sourceFile.text.substr(start, width); + const match = tripleSlashXMLCommentRegEx.exec(text); + if (!match) { + return false; + } + if (!match[3] || !(match[3] in commentPragmas)) { + return false; + } + let pos = start; + pushCommentRange(pos, match[1].length); + pos += match[1].length; + pushClassification( + pos, + match[2].length, + 10 + /* punctuation */ + ); + pos += match[2].length; + pushClassification( + pos, + match[3].length, + 21 + /* jsxSelfClosingTagName */ + ); + pos += match[3].length; + const attrText = match[4]; + let attrPos = pos; + while (true) { + const attrMatch = attributeRegex.exec(attrText); + if (!attrMatch) { + break; + } + const newAttrPos = pos + attrMatch.index + attrMatch[1].length; + if (newAttrPos > attrPos) { + pushCommentRange(attrPos, newAttrPos - attrPos); + attrPos = newAttrPos; + } + pushClassification( + attrPos, + attrMatch[2].length, + 22 + /* jsxAttribute */ + ); + attrPos += attrMatch[2].length; + if (attrMatch[3].length) { + pushCommentRange(attrPos, attrMatch[3].length); + attrPos += attrMatch[3].length; + } + pushClassification( + attrPos, + attrMatch[4].length, + 5 + /* operator */ + ); + attrPos += attrMatch[4].length; + if (attrMatch[5].length) { + pushCommentRange(attrPos, attrMatch[5].length); + attrPos += attrMatch[5].length; + } + pushClassification( + attrPos, + attrMatch[6].length, + 24 + /* jsxAttributeStringLiteralValue */ + ); + attrPos += attrMatch[6].length; + } + pos += match[4].length; + if (pos > attrPos) { + pushCommentRange(attrPos, pos - attrPos); + } + if (match[5]) { + pushClassification( + pos, + match[5].length, + 10 + /* punctuation */ + ); + pos += match[5].length; + } + const end = start + width; + if (pos < end) { + pushCommentRange(pos, end - pos); + } + return true; + } + function processJSDocTemplateTag(tag) { + for (const child of tag.getChildren()) { + processElement(child); + } + } + function classifyDisabledMergeCode(text, start, end) { + let i7; + for (i7 = start; i7 < end; i7++) { + if (isLineBreak2(text.charCodeAt(i7))) { + break; + } + } + pushClassification( + start, + i7 - start, + 1 + /* comment */ + ); + mergeConflictScanner.resetTokenState(i7); + while (mergeConflictScanner.getTokenEnd() < end) { + classifyDisabledCodeToken(); + } + } + function classifyDisabledCodeToken() { + const start = mergeConflictScanner.getTokenEnd(); + const tokenKind = mergeConflictScanner.scan(); + const end = mergeConflictScanner.getTokenEnd(); + const type3 = classifyTokenType(tokenKind); + if (type3) { + pushClassification(start, end - start, type3); + } + } + function tryClassifyNode(node) { + if (isJSDoc(node)) { + return true; + } + if (nodeIsMissing(node)) { + return true; + } + const classifiedElementName = tryClassifyJsxElementName(node); + if (!isToken(node) && node.kind !== 12 && classifiedElementName === void 0) { + return false; + } + const tokenStart = node.kind === 12 ? node.pos : classifyLeadingTriviaAndGetTokenStart(node); + const tokenWidth = node.end - tokenStart; + Debug.assert(tokenWidth >= 0); + if (tokenWidth > 0) { + const type3 = classifiedElementName || classifyTokenType(node.kind, node); + if (type3) { + pushClassification(tokenStart, tokenWidth, type3); + } + } + return true; + } + function tryClassifyJsxElementName(token) { + switch (token.parent && token.parent.kind) { + case 286: + if (token.parent.tagName === token) { + return 19; + } + break; + case 287: + if (token.parent.tagName === token) { + return 20; + } + break; + case 285: + if (token.parent.tagName === token) { + return 21; + } + break; + case 291: + if (token.parent.name === token) { + return 22; + } + break; + } + return void 0; + } + function classifyTokenType(tokenKind, token) { + if (isKeyword(tokenKind)) { + return 3; + } + if (tokenKind === 30 || tokenKind === 32) { + if (token && getTypeArgumentOrTypeParameterList(token.parent)) { + return 10; + } + } + if (isPunctuation(tokenKind)) { + if (token) { + const parent22 = token.parent; + if (tokenKind === 64) { + if (parent22.kind === 260 || parent22.kind === 172 || parent22.kind === 169 || parent22.kind === 291) { + return 5; + } + } + if (parent22.kind === 226 || parent22.kind === 224 || parent22.kind === 225 || parent22.kind === 227) { + return 5; + } + } + return 10; + } else if (tokenKind === 9) { + return 4; + } else if (tokenKind === 10) { + return 25; + } else if (tokenKind === 11) { + return token && token.parent.kind === 291 ? 24 : 6; + } else if (tokenKind === 14) { + return 6; + } else if (isTemplateLiteralKind(tokenKind)) { + return 6; + } else if (tokenKind === 12) { + return 23; + } else if (tokenKind === 80) { + if (token) { + switch (token.parent.kind) { + case 263: + if (token.parent.name === token) { + return 11; + } + return; + case 168: + if (token.parent.name === token) { + return 15; + } + return; + case 264: + if (token.parent.name === token) { + return 13; + } + return; + case 266: + if (token.parent.name === token) { + return 12; + } + return; + case 267: + if (token.parent.name === token) { + return 14; + } + return; + case 169: + if (token.parent.name === token) { + return isThisIdentifier(token) ? 3 : 17; + } + return; + } + if (isConstTypeReference(token.parent)) { + return 3; + } + } + return 2; + } + } + function processElement(element) { + if (!element) { + return; + } + if (decodedTextSpanIntersectsWith(spanStart, spanLength, element.pos, element.getFullWidth())) { + checkForClassificationCancellation(cancellationToken, element.kind); + for (const child of element.getChildren(sourceFile)) { + if (!tryClassifyNode(child)) { + processElement(child); + } + } + } + } + } + var noRegexTable; + var init_classifier = __esm2({ + "src/services/classifier.ts"() { + "use strict"; + init_ts4(); + noRegexTable = arrayToNumericMap( + [ + 80, + 11, + 9, + 10, + 14, + 110, + 46, + 47, + 22, + 24, + 20, + 112, + 97 + /* FalseKeyword */ + ], + (token) => token, + () => true + ); + } + }); + var DocumentHighlights; + var init_documentHighlights = __esm2({ + "src/services/documentHighlights.ts"() { + "use strict"; + init_ts4(); + ((DocumentHighlights3) => { + function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { + const node = getTouchingPropertyName(sourceFile, position); + if (node.parent && (isJsxOpeningElement(node.parent) && node.parent.tagName === node || isJsxClosingElement(node.parent))) { + const { openingElement, closingElement } = node.parent.parent; + const highlightSpans = [openingElement, closingElement].map(({ tagName }) => getHighlightSpanForNode(tagName, sourceFile)); + return [{ fileName: sourceFile.fileName, highlightSpans }]; + } + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + } + DocumentHighlights3.getDocumentHighlights = getDocumentHighlights; + function getHighlightSpanForNode(node, sourceFile) { + return { + fileName: sourceFile.fileName, + textSpan: createTextSpanFromNode(node, sourceFile), + kind: "none" + /* none */ + }; + } + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + const sourceFilesSet = new Set(sourceFilesToSearch.map((f8) => f8.fileName)); + const referenceEntries = ts_FindAllReferences_exports.getReferenceEntriesForNode( + position, + node, + program, + sourceFilesToSearch, + cancellationToken, + /*options*/ + void 0, + sourceFilesSet + ); + if (!referenceEntries) + return void 0; + const map22 = arrayToMultiMap(referenceEntries.map(ts_FindAllReferences_exports.toHighlightSpan), (e10) => e10.fileName, (e10) => e10.span); + const getCanonicalFileName = createGetCanonicalFileName(program.useCaseSensitiveFileNames()); + return arrayFrom(mapDefinedIterator(map22.entries(), ([fileName, highlightSpans]) => { + if (!sourceFilesSet.has(fileName)) { + if (!program.redirectTargetsMap.has(toPath2(fileName, program.getCurrentDirectory(), getCanonicalFileName))) { + return void 0; + } + const redirectTarget = program.getSourceFile(fileName); + const redirect = find2(sourceFilesToSearch, (f8) => !!f8.redirectInfo && f8.redirectInfo.redirectTarget === redirectTarget); + fileName = redirect.fileName; + Debug.assert(sourceFilesSet.has(fileName)); + } + return { fileName, highlightSpans }; + })); + } + function getSyntacticDocumentHighlights(node, sourceFile) { + const highlightSpans = getHighlightSpans(node, sourceFile); + return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }]; + } + function getHighlightSpans(node, sourceFile) { + switch (node.kind) { + case 101: + case 93: + return isIfStatement(node.parent) ? getIfElseOccurrences(node.parent, sourceFile) : void 0; + case 107: + return useParent(node.parent, isReturnStatement, getReturnOccurrences); + case 111: + return useParent(node.parent, isThrowStatement, getThrowOccurrences); + case 113: + case 85: + case 98: + const tryStatement = node.kind === 85 ? node.parent.parent : node.parent; + return useParent(tryStatement, isTryStatement, getTryCatchFinallyOccurrences); + case 109: + return useParent(node.parent, isSwitchStatement, getSwitchCaseDefaultOccurrences); + case 84: + case 90: { + if (isDefaultClause(node.parent) || isCaseClause(node.parent)) { + return useParent(node.parent.parent.parent, isSwitchStatement, getSwitchCaseDefaultOccurrences); + } + return void 0; + } + case 83: + case 88: + return useParent(node.parent, isBreakOrContinueStatement, getBreakOrContinueStatementOccurrences); + case 99: + case 117: + case 92: + return useParent(node.parent, (n7) => isIterationStatement( + n7, + /*lookInLabeledStatements*/ + true + ), getLoopBreakContinueOccurrences); + case 137: + return getFromAllDeclarations(isConstructorDeclaration, [ + 137 + /* ConstructorKeyword */ + ]); + case 139: + case 153: + return getFromAllDeclarations(isAccessor, [ + 139, + 153 + /* SetKeyword */ + ]); + case 135: + return useParent(node.parent, isAwaitExpression, getAsyncAndAwaitOccurrences); + case 134: + return highlightSpans(getAsyncAndAwaitOccurrences(node)); + case 127: + return highlightSpans(getYieldOccurrences(node)); + case 103: + case 147: + return void 0; + default: + return isModifierKind(node.kind) && (isDeclaration(node.parent) || isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : void 0; + } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, (decl) => { + var _a2; + return mapDefined((_a2 = tryCast(decl, canHaveSymbol)) == null ? void 0 : _a2.symbol.declarations, (d7) => nodeTest(d7) ? find2(d7.getChildren(sourceFile), (c7) => contains2(keywords, c7.kind)) : void 0); + }); + } + function useParent(node2, nodeTest, getNodes4) { + return nodeTest(node2) ? highlightSpans(getNodes4(node2, sourceFile)) : void 0; + } + function highlightSpans(nodes) { + return nodes && nodes.map((node2) => getHighlightSpanForNode(node2, sourceFile)); + } + } + function aggregateOwnedThrowStatements(node) { + if (isThrowStatement(node)) { + return [node]; + } else if (isTryStatement(node)) { + return concatenate( + node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), + node.finallyBlock && aggregateOwnedThrowStatements(node.finallyBlock) + ); + } + return isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateOwnedThrowStatements); + } + function getThrowStatementOwner(throwStatement) { + let child = throwStatement; + while (child.parent) { + const parent22 = child.parent; + if (isFunctionBlock(parent22) || parent22.kind === 312) { + return parent22; + } + if (isTryStatement(parent22) && parent22.tryBlock === child && parent22.catchClause) { + return child; + } + child = parent22; + } + return void 0; + } + function aggregateAllBreakAndContinueStatements(node) { + return isBreakOrContinueStatement(node) ? [node] : isFunctionLike(node) ? void 0 : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + const result2 = []; + node.forEachChild((child) => { + const value2 = cb(child); + if (value2 !== void 0) { + result2.push(...toArray3(value2)); + } + }); + return result2; + } + function ownsBreakOrContinueStatement(owner, statement) { + const actualOwner = getBreakOrContinueOwner(statement); + return !!actualOwner && actualOwner === owner; + } + function getBreakOrContinueOwner(statement) { + return findAncestor(statement, (node) => { + switch (node.kind) { + case 255: + if (statement.kind === 251) { + return false; + } + case 248: + case 249: + case 250: + case 247: + case 246: + return !statement.label || isLabeledBy(node, statement.label.escapedText); + default: + return isFunctionLike(node) && "quit"; + } + }); + } + function getModifierOccurrences(modifier, declaration) { + return mapDefined(getNodesToSearchForModifier(declaration, modifierToFlag(modifier)), (node) => findModifier(node, modifier)); + } + function getNodesToSearchForModifier(declaration, modifierFlag) { + const container = declaration.parent; + switch (container.kind) { + case 268: + case 312: + case 241: + case 296: + case 297: + if (modifierFlag & 64 && isClassDeclaration(declaration)) { + return [...declaration.members, declaration]; + } else { + return container.statements; + } + case 176: + case 174: + case 262: + return [...container.parameters, ...isClassLike(container.parent) ? container.parent.members : []]; + case 263: + case 231: + case 264: + case 187: + const nodes = container.members; + if (modifierFlag & (7 | 8)) { + const constructor = find2(container.members, isConstructorDeclaration); + if (constructor) { + return [...nodes, ...constructor.parameters]; + } + } else if (modifierFlag & 64) { + return [...nodes, container]; + } + return nodes; + case 210: + return void 0; + default: + Debug.assertNever(container, "Invalid container kind."); + } + } + function pushKeywordIf(keywordList, token, ...expected) { + if (token && contains2(expected, token.kind)) { + keywordList.push(token); + return true; + } + return false; + } + function getLoopBreakContinueOccurrences(loopNode) { + const keywords = []; + if (pushKeywordIf( + keywords, + loopNode.getFirstToken(), + 99, + 117, + 92 + /* DoKeyword */ + )) { + if (loopNode.kind === 246) { + const loopTokens = loopNode.getChildren(); + for (let i7 = loopTokens.length - 1; i7 >= 0; i7--) { + if (pushKeywordIf( + keywords, + loopTokens[i7], + 117 + /* WhileKeyword */ + )) { + break; + } + } + } + } + forEach4(aggregateAllBreakAndContinueStatements(loopNode.statement), (statement) => { + if (ownsBreakOrContinueStatement(loopNode, statement)) { + pushKeywordIf( + keywords, + statement.getFirstToken(), + 83, + 88 + /* ContinueKeyword */ + ); + } + }); + return keywords; + } + function getBreakOrContinueStatementOccurrences(breakOrContinueStatement) { + const owner = getBreakOrContinueOwner(breakOrContinueStatement); + if (owner) { + switch (owner.kind) { + case 248: + case 249: + case 250: + case 246: + case 247: + return getLoopBreakContinueOccurrences(owner); + case 255: + return getSwitchCaseDefaultOccurrences(owner); + } + } + return void 0; + } + function getSwitchCaseDefaultOccurrences(switchStatement) { + const keywords = []; + pushKeywordIf( + keywords, + switchStatement.getFirstToken(), + 109 + /* SwitchKeyword */ + ); + forEach4(switchStatement.caseBlock.clauses, (clause) => { + pushKeywordIf( + keywords, + clause.getFirstToken(), + 84, + 90 + /* DefaultKeyword */ + ); + forEach4(aggregateAllBreakAndContinueStatements(clause), (statement) => { + if (ownsBreakOrContinueStatement(switchStatement, statement)) { + pushKeywordIf( + keywords, + statement.getFirstToken(), + 83 + /* BreakKeyword */ + ); + } + }); + }); + return keywords; + } + function getTryCatchFinallyOccurrences(tryStatement, sourceFile) { + const keywords = []; + pushKeywordIf( + keywords, + tryStatement.getFirstToken(), + 113 + /* TryKeyword */ + ); + if (tryStatement.catchClause) { + pushKeywordIf( + keywords, + tryStatement.catchClause.getFirstToken(), + 85 + /* CatchKeyword */ + ); + } + if (tryStatement.finallyBlock) { + const finallyKeyword = findChildOfKind(tryStatement, 98, sourceFile); + pushKeywordIf( + keywords, + finallyKeyword, + 98 + /* FinallyKeyword */ + ); + } + return keywords; + } + function getThrowOccurrences(throwStatement, sourceFile) { + const owner = getThrowStatementOwner(throwStatement); + if (!owner) { + return void 0; + } + const keywords = []; + forEach4(aggregateOwnedThrowStatements(owner), (throwStatement2) => { + keywords.push(findChildOfKind(throwStatement2, 111, sourceFile)); + }); + if (isFunctionBlock(owner)) { + forEachReturnStatement(owner, (returnStatement) => { + keywords.push(findChildOfKind(returnStatement, 107, sourceFile)); + }); + } + return keywords; + } + function getReturnOccurrences(returnStatement, sourceFile) { + const func = getContainingFunction(returnStatement); + if (!func) { + return void 0; + } + const keywords = []; + forEachReturnStatement(cast(func.body, isBlock2), (returnStatement2) => { + keywords.push(findChildOfKind(returnStatement2, 107, sourceFile)); + }); + forEach4(aggregateOwnedThrowStatements(func.body), (throwStatement) => { + keywords.push(findChildOfKind(throwStatement, 111, sourceFile)); + }); + return keywords; + } + function getAsyncAndAwaitOccurrences(node) { + const func = getContainingFunction(node); + if (!func) { + return void 0; + } + const keywords = []; + if (func.modifiers) { + func.modifiers.forEach((modifier) => { + pushKeywordIf( + keywords, + modifier, + 134 + /* AsyncKeyword */ + ); + }); + } + forEachChild(func, (child) => { + traverseWithoutCrossingFunction(child, (node2) => { + if (isAwaitExpression(node2)) { + pushKeywordIf( + keywords, + node2.getFirstToken(), + 135 + /* AwaitKeyword */ + ); + } + }); + }); + return keywords; + } + function getYieldOccurrences(node) { + const func = getContainingFunction(node); + if (!func) { + return void 0; + } + const keywords = []; + forEachChild(func, (child) => { + traverseWithoutCrossingFunction(child, (node2) => { + if (isYieldExpression(node2)) { + pushKeywordIf( + keywords, + node2.getFirstToken(), + 127 + /* YieldKeyword */ + ); + } + }); + }); + return keywords; + } + function traverseWithoutCrossingFunction(node, cb) { + cb(node); + if (!isFunctionLike(node) && !isClassLike(node) && !isInterfaceDeclaration(node) && !isModuleDeclaration(node) && !isTypeAliasDeclaration(node) && !isTypeNode(node)) { + forEachChild(node, (child) => traverseWithoutCrossingFunction(child, cb)); + } + } + function getIfElseOccurrences(ifStatement, sourceFile) { + const keywords = getIfElseKeywords(ifStatement, sourceFile); + const result2 = []; + for (let i7 = 0; i7 < keywords.length; i7++) { + if (keywords[i7].kind === 93 && i7 < keywords.length - 1) { + const elseKeyword = keywords[i7]; + const ifKeyword = keywords[i7 + 1]; + let shouldCombineElseAndIf = true; + for (let j6 = ifKeyword.getStart(sourceFile) - 1; j6 >= elseKeyword.end; j6--) { + if (!isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(j6))) { + shouldCombineElseAndIf = false; + break; + } + } + if (shouldCombineElseAndIf) { + result2.push({ + fileName: sourceFile.fileName, + textSpan: createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), + kind: "reference" + /* reference */ + }); + i7++; + continue; + } + } + result2.push(getHighlightSpanForNode(keywords[i7], sourceFile)); + } + return result2; + } + function getIfElseKeywords(ifStatement, sourceFile) { + const keywords = []; + while (isIfStatement(ifStatement.parent) && ifStatement.parent.elseStatement === ifStatement) { + ifStatement = ifStatement.parent; + } + while (true) { + const children = ifStatement.getChildren(sourceFile); + pushKeywordIf( + keywords, + children[0], + 101 + /* IfKeyword */ + ); + for (let i7 = children.length - 1; i7 >= 0; i7--) { + if (pushKeywordIf( + keywords, + children[i7], + 93 + /* ElseKeyword */ + )) { + break; + } + } + if (!ifStatement.elseStatement || !isIfStatement(ifStatement.elseStatement)) { + break; + } + ifStatement = ifStatement.elseStatement; + } + return keywords; + } + function isLabeledBy(node, labelName) { + return !!findAncestor(node.parent, (owner) => !isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName); + } + })(DocumentHighlights || (DocumentHighlights = {})); + } + }); + function isDocumentRegistryEntry(entry) { + return !!entry.sourceFile; + } + function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) { + return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode); + } + function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) { + const buckets = /* @__PURE__ */ new Map(); + const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2); + function reportStats() { + const bucketInfoArray = arrayFrom(buckets.keys()).filter((name2) => name2 && name2.charAt(0) === "_").map((name2) => { + const entries = buckets.get(name2); + const sourceFiles = []; + entries.forEach((entry, name22) => { + if (isDocumentRegistryEntry(entry)) { + sourceFiles.push({ + name: name22, + scriptKind: entry.sourceFile.scriptKind, + refCount: entry.languageServiceRefCount + }); + } else { + entry.forEach((value2, scriptKind) => sourceFiles.push({ name: name22, scriptKind, refCount: value2.languageServiceRefCount })); + } + }); + sourceFiles.sort((x7, y7) => y7.refCount - x7.refCount); + return { + bucket: name2, + sourceFiles + }; + }); + return JSON.stringify(bucketInfoArray, void 0, 2); + } + function getCompilationSettings(settingsOrHost) { + if (typeof settingsOrHost.getCompilationSettings === "function") { + return settingsOrHost.getCompilationSettings(); + } + return settingsOrHost; + } + function acquireDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) { + const path2 = toPath2(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); + return acquireDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions); + } + function acquireDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) { + return acquireOrUpdateDocument( + fileName, + path2, + compilationSettings, + key, + scriptSnapshot, + version22, + /*acquiring*/ + true, + scriptKind, + languageVersionOrOptions + ); + } + function updateDocument(fileName, compilationSettings, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) { + const path2 = toPath2(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(getCompilationSettings(compilationSettings)); + return updateDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions); + } + function updateDocumentWithKey(fileName, path2, compilationSettings, key, scriptSnapshot, version22, scriptKind, languageVersionOrOptions) { + return acquireOrUpdateDocument( + fileName, + path2, + getCompilationSettings(compilationSettings), + key, + scriptSnapshot, + version22, + /*acquiring*/ + false, + scriptKind, + languageVersionOrOptions + ); + } + function getDocumentRegistryEntry(bucketEntry, scriptKind) { + const entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided")); + Debug.assert(scriptKind === void 0 || !entry || entry.sourceFile.scriptKind === scriptKind, `Script kind should match provided ScriptKind:${scriptKind} and sourceFile.scriptKind: ${entry == null ? void 0 : entry.sourceFile.scriptKind}, !entry: ${!entry}`); + return entry; + } + function acquireOrUpdateDocument(fileName, path2, compilationSettingsOrHost, key, scriptSnapshot, version22, acquiring, scriptKind, languageVersionOrOptions) { + var _a2, _b, _c, _d; + scriptKind = ensureScriptKind(fileName, scriptKind); + const compilationSettings = getCompilationSettings(compilationSettingsOrHost); + const host = compilationSettingsOrHost === compilationSettings ? void 0 : compilationSettingsOrHost; + const scriptTarget = scriptKind === 6 ? 100 : getEmitScriptTarget(compilationSettings); + const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { + languageVersion: scriptTarget, + impliedNodeFormat: host && getImpliedNodeFormatForFile(path2, (_d = (_c = (_b = (_a2 = host.getCompilerHost) == null ? void 0 : _a2.call(host)) == null ? void 0 : _b.getModuleResolutionCache) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings), + setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings), + jsDocParsingMode + }; + sourceFileOptions.languageVersion = scriptTarget; + Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode); + const oldBucketCount = buckets.size; + const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat); + const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map()); + if (tracing) { + if (buckets.size > oldBucketCount) { + tracing.instant(tracing.Phase.Session, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key: keyWithMode }); + } + const otherBucketKey = !isDeclarationFileName(path2) && forEachEntry(buckets, (bucket2, bucketKey) => bucketKey !== keyWithMode && bucket2.has(path2) && bucketKey); + if (otherBucketKey) { + tracing.instant(tracing.Phase.Session, "documentRegistryBucketOverlap", { path: path2, key1: otherBucketKey, key2: keyWithMode }); + } + } + const bucketEntry = bucket.get(path2); + let entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind); + if (!entry && externalCache) { + const sourceFile = externalCache.getDocument(keyWithMode, path2); + if (sourceFile) { + Debug.assert(acquiring); + entry = { + sourceFile, + languageServiceRefCount: 0 + }; + setBucketEntry(); + } + } + if (!entry) { + const sourceFile = createLanguageServiceSourceFile( + fileName, + scriptSnapshot, + sourceFileOptions, + version22, + /*setNodeParents*/ + false, + scriptKind + ); + if (externalCache) { + externalCache.setDocument(keyWithMode, path2, sourceFile); + } + entry = { + sourceFile, + languageServiceRefCount: 1 + }; + setBucketEntry(); + } else { + if (entry.sourceFile.version !== version22) { + entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version22, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); + if (externalCache) { + externalCache.setDocument(keyWithMode, path2, entry.sourceFile); + } + } + if (acquiring) { + entry.languageServiceRefCount++; + } + } + Debug.assert(entry.languageServiceRefCount !== 0); + return entry.sourceFile; + function setBucketEntry() { + if (!bucketEntry) { + bucket.set(path2, entry); + } else if (isDocumentRegistryEntry(bucketEntry)) { + const scriptKindMap = /* @__PURE__ */ new Map(); + scriptKindMap.set(bucketEntry.sourceFile.scriptKind, bucketEntry); + scriptKindMap.set(scriptKind, entry); + bucket.set(path2, scriptKindMap); + } else { + bucketEntry.set(scriptKind, entry); + } + } + } + function releaseDocument(fileName, compilationSettings, scriptKind, impliedNodeFormat) { + const path2 = toPath2(fileName, currentDirectory, getCanonicalFileName); + const key = getKeyForCompilationSettings(compilationSettings); + return releaseDocumentWithKey(path2, key, scriptKind, impliedNodeFormat); + } + function releaseDocumentWithKey(path2, key, scriptKind, impliedNodeFormat) { + const bucket = Debug.checkDefined(buckets.get(getDocumentRegistryBucketKeyWithMode(key, impliedNodeFormat))); + const bucketEntry = bucket.get(path2); + const entry = getDocumentRegistryEntry(bucketEntry, scriptKind); + entry.languageServiceRefCount--; + Debug.assert(entry.languageServiceRefCount >= 0); + if (entry.languageServiceRefCount === 0) { + if (isDocumentRegistryEntry(bucketEntry)) { + bucket.delete(path2); + } else { + bucketEntry.delete(scriptKind); + if (bucketEntry.size === 1) { + bucket.set(path2, firstDefinedIterator(bucketEntry.values(), identity2)); + } + } + } + } + return { + acquireDocument, + acquireDocumentWithKey, + updateDocument, + updateDocumentWithKey, + releaseDocument, + releaseDocumentWithKey, + getKeyForCompilationSettings, + getDocumentRegistryBucketKeyWithMode, + reportStats, + getBuckets: () => buckets + }; + } + function getKeyForCompilationSettings(settings) { + return getKeyForCompilerOptions(settings, sourceFileAffectingCompilerOptions); + } + function getDocumentRegistryBucketKeyWithMode(key, mode) { + return mode ? `${key}|${mode}` : key; + } + var init_documentRegistry = __esm2({ + "src/services/documentRegistry.ts"() { + "use strict"; + init_ts4(); + } + }); + function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) { + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper); + const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper); + return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => { + updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2); + updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName); + }); + } + function getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper) { + const canonicalOldPath = getCanonicalFileName(oldFileOrDirPath); + return (path2) => { + const originalPath = sourceMapper && sourceMapper.tryGetSourcePosition({ fileName: path2, pos: 0 }); + const updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path2); + return originalPath ? updatedPath === void 0 ? void 0 : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path2, getCanonicalFileName) : updatedPath; + }; + function getUpdatedPath(pathToUpdate) { + if (getCanonicalFileName(pathToUpdate) === canonicalOldPath) + return newFileOrDirPath; + const suffix = tryRemoveDirectoryPrefix(pathToUpdate, canonicalOldPath, getCanonicalFileName); + return suffix === void 0 ? void 0 : newFileOrDirPath + "/" + suffix; + } + } + function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) { + const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName); + return combinePathsSafe(getDirectoryPath(a1), rel); + } + function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) { + const { configFile } = program.getCompilerOptions(); + if (!configFile) + return; + const configDir = getDirectoryPath(configFile.fileName); + const jsonObjectLiteral = getTsConfigObjectLiteralExpression(configFile); + if (!jsonObjectLiteral) + return; + forEachProperty(jsonObjectLiteral, (property2, propertyName) => { + switch (propertyName) { + case "files": + case "include": + case "exclude": { + const foundExactMatch = updatePaths(property2); + if (foundExactMatch || propertyName !== "include" || !isArrayLiteralExpression(property2.initializer)) + return; + const includes2 = mapDefined(property2.initializer.elements, (e10) => isStringLiteral(e10) ? e10.text : void 0); + if (includes2.length === 0) + return; + const matchers = getFileMatcherPatterns( + configDir, + /*excludes*/ + [], + includes2, + useCaseSensitiveFileNames2, + currentDirectory + ); + if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) { + changeTracker.insertNodeAfter(configFile, last2(property2.initializer.elements), factory.createStringLiteral(relativePath2(newFileOrDirPath))); + } + return; + } + case "compilerOptions": + forEachProperty(property2.initializer, (property22, propertyName2) => { + const option = getOptionFromName(propertyName2); + Debug.assert((option == null ? void 0 : option.type) !== "listOrElement"); + if (option && (option.isFilePath || option.type === "list" && option.element.isFilePath)) { + updatePaths(property22); + } else if (propertyName2 === "paths") { + forEachProperty(property22.initializer, (pathsProperty) => { + if (!isArrayLiteralExpression(pathsProperty.initializer)) + return; + for (const e10 of pathsProperty.initializer.elements) { + tryUpdateString(e10); + } + }); + } + }); + return; + } + }); + function updatePaths(property2) { + const elements = isArrayLiteralExpression(property2.initializer) ? property2.initializer.elements : [property2.initializer]; + let foundExactMatch = false; + for (const element of elements) { + foundExactMatch = tryUpdateString(element) || foundExactMatch; + } + return foundExactMatch; + } + function tryUpdateString(element) { + if (!isStringLiteral(element)) + return false; + const elementFileName = combinePathsSafe(configDir, element.text); + const updated = oldToNew(elementFileName); + if (updated !== void 0) { + changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath2(updated)); + return true; + } + return false; + } + function relativePath2(path2) { + return getRelativePathFromDirectory( + configDir, + path2, + /*ignoreCase*/ + !useCaseSensitiveFileNames2 + ); + } + } + function updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName) { + const allFiles = program.getSourceFiles(); + for (const sourceFile of allFiles) { + const newFromOld = oldToNew(sourceFile.fileName); + const newImportFromPath = newFromOld ?? sourceFile.fileName; + const newImportFromDirectory = getDirectoryPath(newImportFromPath); + const oldFromNew = newToOld(sourceFile.fileName); + const oldImportFromPath = oldFromNew || sourceFile.fileName; + const oldImportFromDirectory = getDirectoryPath(oldImportFromPath); + const importingSourceFileMoved = newFromOld !== void 0 || oldFromNew !== void 0; + updateImportsWorker(sourceFile, changeTracker, (referenceText) => { + if (!pathIsRelative(referenceText)) + return void 0; + const oldAbsolute = combinePathsSafe(oldImportFromDirectory, referenceText); + const newAbsolute = oldToNew(oldAbsolute); + return newAbsolute === void 0 ? void 0 : ensurePathIsNonModuleName(getRelativePathFromDirectory(newImportFromDirectory, newAbsolute, getCanonicalFileName)); + }, (importLiteral) => { + const importedModuleSymbol = program.getTypeChecker().getSymbolAtLocation(importLiteral); + if ((importedModuleSymbol == null ? void 0 : importedModuleSymbol.declarations) && importedModuleSymbol.declarations.some((d7) => isAmbientModule(d7))) + return void 0; + const toImport = oldFromNew !== void 0 ? getSourceFileToImportFromResolved(importLiteral, resolveModuleName(importLiteral.text, oldImportFromPath, program.getCompilerOptions(), host), oldToNew, allFiles) : getSourceFileToImport(importedModuleSymbol, importLiteral, sourceFile, program, host, oldToNew); + return toImport !== void 0 && (toImport.updated || importingSourceFileMoved && pathIsRelative(importLiteral.text)) ? ts_moduleSpecifiers_exports.updateModuleSpecifier(program.getCompilerOptions(), sourceFile, newImportFromPath, toImport.newFileName, createModuleSpecifierResolutionHost(program, host), importLiteral.text) : void 0; + }); + } + } + function combineNormal(pathA, pathB) { + return normalizePath(combinePaths(pathA, pathB)); + } + function combinePathsSafe(pathA, pathB) { + return ensurePathIsNonModuleName(combineNormal(pathA, pathB)); + } + function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) { + if (importedModuleSymbol) { + const oldFileName = find2(importedModuleSymbol.declarations, isSourceFile).fileName; + const newFileName = oldToNew(oldFileName); + return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true }; + } else { + const mode = program.getModeForUsageLocation(importingSourceFile, importLiteral); + const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModuleFromModuleSpecifier(importLiteral) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode); + return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles()); + } + } + function getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, sourceFiles) { + if (!resolved) + return void 0; + if (resolved.resolvedModule) { + const result22 = tryChange(resolved.resolvedModule.resolvedFileName); + if (result22) + return result22; + } + const result2 = forEach4(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJsonExisting) || pathIsRelative(importLiteral.text) && forEach4(resolved.failedLookupLocations, tryChangeWithIgnoringPackageJson); + if (result2) + return result2; + return resolved.resolvedModule && { newFileName: resolved.resolvedModule.resolvedFileName, updated: false }; + function tryChangeWithIgnoringPackageJsonExisting(oldFileName) { + const newFileName = oldToNew(oldFileName); + return newFileName && find2(sourceFiles, (src) => src.fileName === newFileName) ? tryChangeWithIgnoringPackageJson(oldFileName) : void 0; + } + function tryChangeWithIgnoringPackageJson(oldFileName) { + return !endsWith2(oldFileName, "/package.json") ? tryChange(oldFileName) : void 0; + } + function tryChange(oldFileName) { + const newFileName = oldToNew(oldFileName); + return newFileName && { newFileName, updated: true }; + } + } + function updateImportsWorker(sourceFile, changeTracker, updateRef, updateImport2) { + for (const ref of sourceFile.referencedFiles || emptyArray) { + const updated = updateRef(ref.fileName); + if (updated !== void 0 && updated !== sourceFile.text.slice(ref.pos, ref.end)) + changeTracker.replaceRangeWithText(sourceFile, ref, updated); + } + for (const importStringLiteral of sourceFile.imports) { + const updated = updateImport2(importStringLiteral); + if (updated !== void 0 && updated !== importStringLiteral.text) + changeTracker.replaceRangeWithText(sourceFile, createStringRange(importStringLiteral, sourceFile), updated); + } + } + function createStringRange(node, sourceFile) { + return createRange2(node.getStart(sourceFile) + 1, node.end - 1); + } + function forEachProperty(objectLiteral, cb) { + if (!isObjectLiteralExpression(objectLiteral)) + return; + for (const property2 of objectLiteral.properties) { + if (isPropertyAssignment(property2) && isStringLiteral(property2.name)) { + cb(property2, property2.name.text); + } + } + } + var init_getEditsForFileRename = __esm2({ + "src/services/getEditsForFileRename.ts"() { + "use strict"; + init_ts4(); + } + }); + function createPatternMatch(kind, isCaseSensitive) { + return { + kind, + isCaseSensitive + }; + } + function createPatternMatcher(pattern5) { + const stringToWordSpans = /* @__PURE__ */ new Map(); + const dotSeparatedSegments = pattern5.trim().split(".").map((p7) => createSegment(p7.trim())); + if (dotSeparatedSegments.length === 1 && dotSeparatedSegments[0].totalTextChunk.text === "") { + return { + getMatchForLastSegmentOfPattern: () => createPatternMatch( + 2, + /*isCaseSensitive*/ + true + ), + getFullMatch: () => createPatternMatch( + 2, + /*isCaseSensitive*/ + true + ), + patternContainsDots: false + }; + } + if (dotSeparatedSegments.some((segment) => !segment.subWordTextChunks.length)) + return void 0; + return { + getFullMatch: (containers, candidate) => getFullMatch(containers, candidate, dotSeparatedSegments, stringToWordSpans), + getMatchForLastSegmentOfPattern: (candidate) => matchSegment(candidate, last2(dotSeparatedSegments), stringToWordSpans), + patternContainsDots: dotSeparatedSegments.length > 1 + }; + } + function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) { + const candidateMatch = matchSegment(candidate, last2(dotSeparatedSegments), stringToWordSpans); + if (!candidateMatch) { + return void 0; + } + if (dotSeparatedSegments.length - 1 > candidateContainers.length) { + return void 0; + } + let bestMatch; + for (let i7 = dotSeparatedSegments.length - 2, j6 = candidateContainers.length - 1; i7 >= 0; i7 -= 1, j6 -= 1) { + bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j6], dotSeparatedSegments[i7], stringToWordSpans)); + } + return bestMatch; + } + function getWordSpans(word, stringToWordSpans) { + let spans = stringToWordSpans.get(word); + if (!spans) { + stringToWordSpans.set(word, spans = breakIntoWordSpans(word)); + } + return spans; + } + function matchTextChunk(candidate, chunk2, stringToWordSpans) { + const index4 = indexOfIgnoringCase(candidate, chunk2.textLowerCase); + if (index4 === 0) { + return createPatternMatch( + chunk2.text.length === candidate.length ? 0 : 1, + /*isCaseSensitive:*/ + startsWith2(candidate, chunk2.text) + ); + } + if (chunk2.isLowerCase) { + if (index4 === -1) + return void 0; + const wordSpans = getWordSpans(candidate, stringToWordSpans); + for (const span of wordSpans) { + if (partStartsWith( + candidate, + span, + chunk2.text, + /*ignoreCase*/ + true + )) { + return createPatternMatch( + 2, + /*isCaseSensitive:*/ + partStartsWith( + candidate, + span, + chunk2.text, + /*ignoreCase*/ + false + ) + ); + } + } + if (chunk2.text.length < candidate.length && isUpperCaseLetter(candidate.charCodeAt(index4))) { + return createPatternMatch( + 2, + /*isCaseSensitive*/ + false + ); + } + } else { + if (candidate.indexOf(chunk2.text) > 0) { + return createPatternMatch( + 2, + /*isCaseSensitive*/ + true + ); + } + if (chunk2.characterSpans.length > 0) { + const candidateParts = getWordSpans(candidate, stringToWordSpans); + const isCaseSensitive = tryCamelCaseMatch( + candidate, + candidateParts, + chunk2, + /*ignoreCase*/ + false + ) ? true : tryCamelCaseMatch( + candidate, + candidateParts, + chunk2, + /*ignoreCase*/ + true + ) ? false : void 0; + if (isCaseSensitive !== void 0) { + return createPatternMatch(3, isCaseSensitive); + } + } + } + } + function matchSegment(candidate, segment, stringToWordSpans) { + if (every22( + segment.totalTextChunk.text, + (ch) => ch !== 32 && ch !== 42 + /* asterisk */ + )) { + const match = matchTextChunk(candidate, segment.totalTextChunk, stringToWordSpans); + if (match) + return match; + } + const subWordTextChunks = segment.subWordTextChunks; + let bestMatch; + for (const subWordTextChunk of subWordTextChunks) { + bestMatch = betterMatch(bestMatch, matchTextChunk(candidate, subWordTextChunk, stringToWordSpans)); + } + return bestMatch; + } + function betterMatch(a7, b8) { + return min2([a7, b8], compareMatches); + } + function compareMatches(a7, b8) { + return a7 === void 0 ? 1 : b8 === void 0 ? -1 : compareValues(a7.kind, b8.kind) || compareBooleans(!a7.isCaseSensitive, !b8.isCaseSensitive); + } + function partStartsWith(candidate, candidateSpan, pattern5, ignoreCase, patternSpan = { start: 0, length: pattern5.length }) { + return patternSpan.length <= candidateSpan.length && everyInRange(0, patternSpan.length, (i7) => equalChars(pattern5.charCodeAt(patternSpan.start + i7), candidate.charCodeAt(candidateSpan.start + i7), ignoreCase)); + } + function equalChars(ch1, ch2, ignoreCase) { + return ignoreCase ? toLowerCase2(ch1) === toLowerCase2(ch2) : ch1 === ch2; + } + function tryCamelCaseMatch(candidate, candidateParts, chunk2, ignoreCase) { + const chunkCharacterSpans = chunk2.characterSpans; + let currentCandidate = 0; + let currentChunkSpan = 0; + let firstMatch; + let contiguous; + while (true) { + if (currentChunkSpan === chunkCharacterSpans.length) { + return true; + } else if (currentCandidate === candidateParts.length) { + return false; + } + let candidatePart = candidateParts[currentCandidate]; + let gotOneMatchThisCandidate = false; + for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { + const chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; + if (gotOneMatchThisCandidate) { + if (!isUpperCaseLetter(chunk2.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || !isUpperCaseLetter(chunk2.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { + break; + } + } + if (!partStartsWith(candidate, candidatePart, chunk2.text, ignoreCase, chunkCharacterSpan)) { + break; + } + gotOneMatchThisCandidate = true; + firstMatch = firstMatch === void 0 ? currentCandidate : firstMatch; + contiguous = contiguous === void 0 ? true : contiguous; + candidatePart = createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); + } + if (!gotOneMatchThisCandidate && contiguous !== void 0) { + contiguous = false; + } + currentCandidate++; + } + } + function createSegment(text) { + return { + totalTextChunk: createTextChunk(text), + subWordTextChunks: breakPatternIntoTextChunks(text) + }; + } + function isUpperCaseLetter(ch) { + if (ch >= 65 && ch <= 90) { + return true; + } + if (ch < 127 || !isUnicodeIdentifierStart( + ch, + 99 + /* Latest */ + )) { + return false; + } + const str2 = String.fromCharCode(ch); + return str2 === str2.toUpperCase(); + } + function isLowerCaseLetter(ch) { + if (ch >= 97 && ch <= 122) { + return true; + } + if (ch < 127 || !isUnicodeIdentifierStart( + ch, + 99 + /* Latest */ + )) { + return false; + } + const str2 = String.fromCharCode(ch); + return str2 === str2.toLowerCase(); + } + function indexOfIgnoringCase(str2, value2) { + const n7 = str2.length - value2.length; + for (let start = 0; start <= n7; start++) { + if (every22(value2, (valueChar, i7) => toLowerCase2(str2.charCodeAt(i7 + start)) === valueChar)) { + return start; + } + } + return -1; + } + function toLowerCase2(ch) { + if (ch >= 65 && ch <= 90) { + return 97 + (ch - 65); + } + if (ch < 127) { + return ch; + } + return String.fromCharCode(ch).toLowerCase().charCodeAt(0); + } + function isDigit22(ch) { + return ch >= 48 && ch <= 57; + } + function isWordChar(ch) { + return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit22(ch) || ch === 95 || ch === 36; + } + function breakPatternIntoTextChunks(pattern5) { + const result2 = []; + let wordStart = 0; + let wordLength = 0; + for (let i7 = 0; i7 < pattern5.length; i7++) { + const ch = pattern5.charCodeAt(i7); + if (isWordChar(ch)) { + if (wordLength === 0) { + wordStart = i7; + } + wordLength++; + } else { + if (wordLength > 0) { + result2.push(createTextChunk(pattern5.substr(wordStart, wordLength))); + wordLength = 0; + } + } + } + if (wordLength > 0) { + result2.push(createTextChunk(pattern5.substr(wordStart, wordLength))); + } + return result2; + } + function createTextChunk(text) { + const textLowerCase = text.toLowerCase(); + return { + text, + textLowerCase, + isLowerCase: text === textLowerCase, + characterSpans: breakIntoCharacterSpans(text) + }; + } + function breakIntoCharacterSpans(identifier) { + return breakIntoSpans( + identifier, + /*word*/ + false + ); + } + function breakIntoWordSpans(identifier) { + return breakIntoSpans( + identifier, + /*word*/ + true + ); + } + function breakIntoSpans(identifier, word) { + const result2 = []; + let wordStart = 0; + for (let i7 = 1; i7 < identifier.length; i7++) { + const lastIsDigit = isDigit22(identifier.charCodeAt(i7 - 1)); + const currentIsDigit = isDigit22(identifier.charCodeAt(i7)); + const hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i7); + const hasTransitionFromUpperToLower = word && transitionFromUpperToLower(identifier, i7, wordStart); + if (charIsPunctuation(identifier.charCodeAt(i7 - 1)) || charIsPunctuation(identifier.charCodeAt(i7)) || lastIsDigit !== currentIsDigit || hasTransitionFromLowerToUpper || hasTransitionFromUpperToLower) { + if (!isAllPunctuation(identifier, wordStart, i7)) { + result2.push(createTextSpan(wordStart, i7 - wordStart)); + } + wordStart = i7; + } + } + if (!isAllPunctuation(identifier, wordStart, identifier.length)) { + result2.push(createTextSpan(wordStart, identifier.length - wordStart)); + } + return result2; + } + function charIsPunctuation(ch) { + switch (ch) { + case 33: + case 34: + case 35: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 44: + case 45: + case 46: + case 47: + case 58: + case 59: + case 63: + case 64: + case 91: + case 92: + case 93: + case 95: + case 123: + case 125: + return true; + } + return false; + } + function isAllPunctuation(identifier, start, end) { + return every22(identifier, (ch) => charIsPunctuation(ch) && ch !== 95, start, end); + } + function transitionFromUpperToLower(identifier, index4, wordStart) { + return index4 !== wordStart && index4 + 1 < identifier.length && isUpperCaseLetter(identifier.charCodeAt(index4)) && isLowerCaseLetter(identifier.charCodeAt(index4 + 1)) && every22(identifier, isUpperCaseLetter, wordStart, index4); + } + function transitionFromLowerToUpper(identifier, word, index4) { + const lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index4 - 1)); + const currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index4)); + return currentIsUpper && (!word || !lastIsUpper); + } + function everyInRange(start, end, pred) { + for (let i7 = start; i7 < end; i7++) { + if (!pred(i7)) { + return false; + } + } + return true; + } + function every22(s7, pred, start = 0, end = s7.length) { + return everyInRange(start, end, (i7) => pred(s7.charCodeAt(i7), i7)); + } + var PatternMatchKind; + var init_patternMatcher = __esm2({ + "src/services/patternMatcher.ts"() { + "use strict"; + init_ts4(); + PatternMatchKind = /* @__PURE__ */ ((PatternMatchKind2) => { + PatternMatchKind2[PatternMatchKind2["exact"] = 0] = "exact"; + PatternMatchKind2[PatternMatchKind2["prefix"] = 1] = "prefix"; + PatternMatchKind2[PatternMatchKind2["substring"] = 2] = "substring"; + PatternMatchKind2[PatternMatchKind2["camelCase"] = 3] = "camelCase"; + return PatternMatchKind2; + })(PatternMatchKind || {}); + } + }); + function preProcessFile(sourceText, readImportFiles = true, detectJavaScriptImports = false) { + const pragmaContext = { + languageVersion: 1, + // controls whether the token scanner considers unicode identifiers or not - shouldn't matter, since we're only using it for trivia + pragmas: void 0, + checkJsDirective: void 0, + referencedFiles: [], + typeReferenceDirectives: [], + libReferenceDirectives: [], + amdDependencies: [], + hasNoDefaultLib: void 0, + moduleName: void 0 + }; + const importedFiles = []; + let ambientExternalModules; + let lastToken; + let currentToken; + let braceNesting = 0; + let externalModule = false; + function nextToken() { + lastToken = currentToken; + currentToken = scanner.scan(); + if (currentToken === 19) { + braceNesting++; + } else if (currentToken === 20) { + braceNesting--; + } + return currentToken; + } + function getFileReference() { + const fileName = scanner.getTokenValue(); + const pos = scanner.getTokenStart(); + return { fileName, pos, end: pos + fileName.length }; + } + function recordAmbientExternalModule() { + if (!ambientExternalModules) { + ambientExternalModules = []; + } + ambientExternalModules.push({ ref: getFileReference(), depth: braceNesting }); + } + function recordModuleName() { + importedFiles.push(getFileReference()); + markAsExternalModuleIfTopLevel(); + } + function markAsExternalModuleIfTopLevel() { + if (braceNesting === 0) { + externalModule = true; + } + } + function tryConsumeDeclare() { + let token = scanner.getToken(); + if (token === 138) { + token = nextToken(); + if (token === 144) { + token = nextToken(); + if (token === 11) { + recordAmbientExternalModule(); + } + } + return true; + } + return false; + } + function tryConsumeImport() { + if (lastToken === 25) { + return false; + } + let token = scanner.getToken(); + if (token === 102) { + token = nextToken(); + if (token === 21) { + token = nextToken(); + if (token === 11 || token === 15) { + recordModuleName(); + return true; + } + } else if (token === 11) { + recordModuleName(); + return true; + } else { + if (token === 156) { + const skipTypeKeyword = scanner.lookAhead(() => { + const token2 = scanner.scan(); + return token2 !== 161 && (token2 === 42 || token2 === 19 || token2 === 80 || isKeyword(token2)); + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 80 || isKeyword(token)) { + token = nextToken(); + if (token === 161) { + token = nextToken(); + if (token === 11) { + recordModuleName(); + return true; + } + } else if (token === 64) { + if (tryConsumeRequireCall( + /*skipCurrentToken*/ + true + )) { + return true; + } + } else if (token === 28) { + token = nextToken(); + } else { + return true; + } + } + if (token === 19) { + token = nextToken(); + while (token !== 20 && token !== 1) { + token = nextToken(); + } + if (token === 20) { + token = nextToken(); + if (token === 161) { + token = nextToken(); + if (token === 11) { + recordModuleName(); + } + } + } + } else if (token === 42) { + token = nextToken(); + if (token === 130) { + token = nextToken(); + if (token === 80 || isKeyword(token)) { + token = nextToken(); + if (token === 161) { + token = nextToken(); + if (token === 11) { + recordModuleName(); + } + } + } + } + } + } + return true; + } + return false; + } + function tryConsumeExport() { + let token = scanner.getToken(); + if (token === 95) { + markAsExternalModuleIfTopLevel(); + token = nextToken(); + if (token === 156) { + const skipTypeKeyword = scanner.lookAhead(() => { + const token2 = scanner.scan(); + return token2 === 42 || token2 === 19; + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 19) { + token = nextToken(); + while (token !== 20 && token !== 1) { + token = nextToken(); + } + if (token === 20) { + token = nextToken(); + if (token === 161) { + token = nextToken(); + if (token === 11) { + recordModuleName(); + } + } + } + } else if (token === 42) { + token = nextToken(); + if (token === 161) { + token = nextToken(); + if (token === 11) { + recordModuleName(); + } + } + } else if (token === 102) { + token = nextToken(); + if (token === 156) { + const skipTypeKeyword = scanner.lookAhead(() => { + const token2 = scanner.scan(); + return token2 === 80 || isKeyword(token2); + }); + if (skipTypeKeyword) { + token = nextToken(); + } + } + if (token === 80 || isKeyword(token)) { + token = nextToken(); + if (token === 64) { + if (tryConsumeRequireCall( + /*skipCurrentToken*/ + true + )) { + return true; + } + } + } + } + return true; + } + return false; + } + function tryConsumeRequireCall(skipCurrentToken, allowTemplateLiterals = false) { + let token = skipCurrentToken ? nextToken() : scanner.getToken(); + if (token === 149) { + token = nextToken(); + if (token === 21) { + token = nextToken(); + if (token === 11 || allowTemplateLiterals && token === 15) { + recordModuleName(); + } + } + return true; + } + return false; + } + function tryConsumeDefine() { + let token = scanner.getToken(); + if (token === 80 && scanner.getTokenValue() === "define") { + token = nextToken(); + if (token !== 21) { + return true; + } + token = nextToken(); + if (token === 11 || token === 15) { + token = nextToken(); + if (token === 28) { + token = nextToken(); + } else { + return true; + } + } + if (token !== 23) { + return true; + } + token = nextToken(); + while (token !== 24 && token !== 1) { + if (token === 11 || token === 15) { + recordModuleName(); + } + token = nextToken(); + } + return true; + } + return false; + } + function processImports() { + scanner.setText(sourceText); + nextToken(); + while (true) { + if (scanner.getToken() === 1) { + break; + } + if (scanner.getToken() === 16) { + const stack = [scanner.getToken()]; + loop: + while (length(stack)) { + const token = scanner.scan(); + switch (token) { + case 1: + break loop; + case 102: + tryConsumeImport(); + break; + case 16: + stack.push(token); + break; + case 19: + if (length(stack)) { + stack.push(token); + } + break; + case 20: + if (length(stack)) { + if (lastOrUndefined(stack) === 16) { + if (scanner.reScanTemplateToken( + /*isTaggedTemplate*/ + false + ) === 18) { + stack.pop(); + } + } else { + stack.pop(); + } + } + break; + } + } + nextToken(); + } + if (tryConsumeDeclare() || tryConsumeImport() || tryConsumeExport() || detectJavaScriptImports && (tryConsumeRequireCall( + /*skipCurrentToken*/ + false, + /*allowTemplateLiterals*/ + true + ) || tryConsumeDefine())) { + continue; + } else { + nextToken(); + } + } + scanner.setText(void 0); + } + if (readImportFiles) { + processImports(); + } + processCommentPragmas(pragmaContext, sourceText); + processPragmasIntoFields(pragmaContext, noop4); + if (externalModule) { + if (ambientExternalModules) { + for (const decl of ambientExternalModules) { + importedFiles.push(decl.ref); + } + } + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: void 0 }; + } else { + let ambientModuleNames; + if (ambientExternalModules) { + for (const decl of ambientExternalModules) { + if (decl.depth === 0) { + if (!ambientModuleNames) { + ambientModuleNames = []; + } + ambientModuleNames.push(decl.ref.fileName); + } else { + importedFiles.push(decl.ref); + } + } + } + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, libReferenceDirectives: pragmaContext.libReferenceDirectives, importedFiles, isLibFile: !!pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; + } + } + var init_preProcess = __esm2({ + "src/services/preProcess.ts"() { + "use strict"; + init_ts4(); + } + }); + function getSourceMapper(host) { + const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + const currentDirectory = host.getCurrentDirectory(); + const sourceFileLike = /* @__PURE__ */ new Map(); + const documentPositionMappers = /* @__PURE__ */ new Map(); + return { tryGetSourcePosition, tryGetGeneratedPosition, toLineColumnOffset, clearCache }; + function toPath3(fileName) { + return toPath2(fileName, currentDirectory, getCanonicalFileName); + } + function getDocumentPositionMapper2(generatedFileName, sourceFileName) { + const path2 = toPath3(generatedFileName); + const value2 = documentPositionMappers.get(path2); + if (value2) + return value2; + let mapper; + if (host.getDocumentPositionMapper) { + mapper = host.getDocumentPositionMapper(generatedFileName, sourceFileName); + } else if (host.readFile) { + const file = getSourceFileLike(generatedFileName); + mapper = file && getDocumentPositionMapper( + { getSourceFileLike, getCanonicalFileName, log: (s7) => host.log(s7) }, + generatedFileName, + getLineInfo(file.text, getLineStarts(file)), + (f8) => !host.fileExists || host.fileExists(f8) ? host.readFile(f8) : void 0 + ); + } + documentPositionMappers.set(path2, mapper || identitySourceMapConsumer); + return mapper || identitySourceMapConsumer; + } + function tryGetSourcePosition(info2) { + if (!isDeclarationFileName(info2.fileName)) + return void 0; + const file = getSourceFile(info2.fileName); + if (!file) + return void 0; + const newLoc = getDocumentPositionMapper2(info2.fileName).getSourcePosition(info2); + return !newLoc || newLoc === info2 ? void 0 : tryGetSourcePosition(newLoc) || newLoc; + } + function tryGetGeneratedPosition(info2) { + if (isDeclarationFileName(info2.fileName)) + return void 0; + const sourceFile = getSourceFile(info2.fileName); + if (!sourceFile) + return void 0; + const program = host.getProgram(); + if (program.isSourceOfProjectReferenceRedirect(sourceFile.fileName)) { + return void 0; + } + const options = program.getCompilerOptions(); + const outPath = outFile(options); + const declarationPath = outPath ? removeFileExtension(outPath) + ".d.ts" : getDeclarationEmitOutputFilePathWorker(info2.fileName, program.getCompilerOptions(), currentDirectory, program.getCommonSourceDirectory(), getCanonicalFileName); + if (declarationPath === void 0) + return void 0; + const newLoc = getDocumentPositionMapper2(declarationPath, info2.fileName).getGeneratedPosition(info2); + return newLoc === info2 ? void 0 : newLoc; + } + function getSourceFile(fileName) { + const program = host.getProgram(); + if (!program) + return void 0; + const path2 = toPath3(fileName); + const file = program.getSourceFileByPath(path2); + return file && file.resolvedPath === path2 ? file : void 0; + } + function getOrCreateSourceFileLike(fileName) { + const path2 = toPath3(fileName); + const fileFromCache = sourceFileLike.get(path2); + if (fileFromCache !== void 0) + return fileFromCache ? fileFromCache : void 0; + if (!host.readFile || host.fileExists && !host.fileExists(fileName)) { + sourceFileLike.set(path2, false); + return void 0; + } + const text = host.readFile(fileName); + const file = text ? createSourceFileLike(text) : false; + sourceFileLike.set(path2, file); + return file ? file : void 0; + } + function getSourceFileLike(fileName) { + return !host.getSourceFileLike ? getSourceFile(fileName) || getOrCreateSourceFileLike(fileName) : host.getSourceFileLike(fileName); + } + function toLineColumnOffset(fileName, position) { + const file = getSourceFileLike(fileName); + return file.getLineAndCharacterOfPosition(position); + } + function clearCache() { + sourceFileLike.clear(); + documentPositionMappers.clear(); + } + } + function getDocumentPositionMapper(host, generatedFileName, generatedFileLineInfo, readMapFile) { + let mapFileName = tryGetSourceMappingURL(generatedFileLineInfo); + if (mapFileName) { + const match = base64UrlRegExp.exec(mapFileName); + if (match) { + if (match[1]) { + const base64Object = match[1]; + return convertDocumentToSourceMapper(host, base64decode(sys, base64Object), generatedFileName); + } + mapFileName = void 0; + } + } + const possibleMapLocations = []; + if (mapFileName) { + possibleMapLocations.push(mapFileName); + } + possibleMapLocations.push(generatedFileName + ".map"); + const originalMapFileName = mapFileName && getNormalizedAbsolutePath(mapFileName, getDirectoryPath(generatedFileName)); + for (const location2 of possibleMapLocations) { + const mapFileName2 = getNormalizedAbsolutePath(location2, getDirectoryPath(generatedFileName)); + const mapFileContents = readMapFile(mapFileName2, originalMapFileName); + if (isString4(mapFileContents)) { + return convertDocumentToSourceMapper(host, mapFileContents, mapFileName2); + } + if (mapFileContents !== void 0) { + return mapFileContents || void 0; + } + } + return void 0; + } + function convertDocumentToSourceMapper(host, contents, mapFileName) { + const map22 = tryParseRawSourceMap(contents); + if (!map22 || !map22.sources || !map22.file || !map22.mappings) { + return void 0; + } + if (map22.sourcesContent && map22.sourcesContent.some(isString4)) + return void 0; + return createDocumentPositionMapper(host, map22, mapFileName); + } + function createSourceFileLike(text, lineMap) { + return { + text, + lineMap, + getLineAndCharacterOfPosition(pos) { + return computeLineAndCharacterOfPosition(getLineStarts(this), pos); + } + }; + } + var base64UrlRegExp; + var init_sourcemaps = __esm2({ + "src/services/sourcemaps.ts"() { + "use strict"; + init_ts4(); + base64UrlRegExp = /^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+/=]+)$)?/; + } + }); + function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) { + var _a2; + program.getSemanticDiagnostics(sourceFile, cancellationToken); + const diags = []; + const checker = program.getTypeChecker(); + const isCommonJSFile = sourceFile.impliedNodeFormat === 1 || fileExtensionIsOneOf(sourceFile.fileName, [ + ".cts", + ".cjs" + /* Cjs */ + ]); + if (!isCommonJSFile && sourceFile.commonJsModuleIndicator && (programContainsEsModules(program) || compilerOptionsIndicateEsModules(program.getCompilerOptions())) && containsTopLevelCommonjs(sourceFile)) { + diags.push(createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module)); + } + const isJsFile = isSourceFileJS(sourceFile); + visitedNestedConvertibleFunctions.clear(); + check(sourceFile); + if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) { + for (const moduleSpecifier of sourceFile.imports) { + const importNode = importFromModuleSpecifier(moduleSpecifier); + const name2 = importNameForConvertToDefaultImport(importNode); + if (!name2) + continue; + const module22 = (_a2 = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a2.resolvedModule; + const resolvedFile = module22 && program.getSourceFile(module22.resolvedFileName); + if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) { + diags.push(createDiagnosticForNode(name2, Diagnostics.Import_may_be_converted_to_a_default_import)); + } + } + } + addRange(diags, sourceFile.bindSuggestionDiagnostics); + addRange(diags, program.getSuggestionDiagnostics(sourceFile, cancellationToken)); + return diags.sort((d1, d22) => d1.start - d22.start); + function check(node) { + if (isJsFile) { + if (canBeConvertedToClass(node, checker)) { + diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) ? node.parent.name : node, Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); + } + } else { + if (isVariableStatement(node) && node.parent === sourceFile && node.declarationList.flags & 2 && node.declarationList.declarations.length === 1) { + const init2 = node.declarationList.declarations[0].initializer; + if (init2 && isRequireCall( + init2, + /*requireStringLiteralLikeArgument*/ + true + )) { + diags.push(createDiagnosticForNode(init2, Diagnostics.require_call_may_be_converted_to_an_import)); + } + } + const jsdocTypedefNodes = ts_codefix_exports.getJSDocTypedefNodes(node); + for (const jsdocTypedefNode of jsdocTypedefNodes) { + diags.push(createDiagnosticForNode(jsdocTypedefNode, Diagnostics.JSDoc_typedef_may_be_converted_to_TypeScript_type)); + } + if (ts_codefix_exports.parameterShouldGetTypeFromJSDoc(node)) { + diags.push(createDiagnosticForNode(node.name || node, Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types)); + } + } + if (canBeConvertedToAsync(node)) { + addConvertToAsyncFunctionDiagnostics(node, checker, diags); + } + node.forEachChild(check); + } + } + function containsTopLevelCommonjs(sourceFile) { + return sourceFile.statements.some((statement) => { + switch (statement.kind) { + case 243: + return statement.declarationList.declarations.some((decl) => !!decl.initializer && isRequireCall( + propertyAccessLeftHandSide(decl.initializer), + /*requireStringLiteralLikeArgument*/ + true + )); + case 244: { + const { expression } = statement; + if (!isBinaryExpression(expression)) + return isRequireCall( + expression, + /*requireStringLiteralLikeArgument*/ + true + ); + const kind = getAssignmentDeclarationKind(expression); + return kind === 1 || kind === 2; + } + default: + return false; + } + }); + } + function propertyAccessLeftHandSide(node) { + return isPropertyAccessExpression(node) ? propertyAccessLeftHandSide(node.expression) : node; + } + function importNameForConvertToDefaultImport(node) { + switch (node.kind) { + case 272: + const { importClause, moduleSpecifier } = node; + return importClause && !importClause.name && importClause.namedBindings && importClause.namedBindings.kind === 274 && isStringLiteral(moduleSpecifier) ? importClause.namedBindings.name : void 0; + case 271: + return node.name; + default: + return void 0; + } + } + function addConvertToAsyncFunctionDiagnostics(node, checker, diags) { + if (isConvertibleFunction(node, checker) && !visitedNestedConvertibleFunctions.has(getKeyFromNode(node))) { + diags.push(createDiagnosticForNode( + !node.name && isVariableDeclaration(node.parent) && isIdentifier(node.parent.name) ? node.parent.name : node, + Diagnostics.This_may_be_converted_to_an_async_function + )); + } + } + function isConvertibleFunction(node, checker) { + return !isAsyncFunction(node) && node.body && isBlock2(node.body) && hasReturnStatementWithPromiseHandler(node.body, checker) && returnsPromise(node, checker); + } + function returnsPromise(node, checker) { + const signature = checker.getSignatureFromDeclaration(node); + const returnType = signature ? checker.getReturnTypeOfSignature(signature) : void 0; + return !!returnType && !!checker.getPromisedTypeOfPromise(returnType); + } + function getErrorNodeFromCommonJsIndicator(commonJsModuleIndicator) { + return isBinaryExpression(commonJsModuleIndicator) ? commonJsModuleIndicator.left : commonJsModuleIndicator; + } + function hasReturnStatementWithPromiseHandler(body, checker) { + return !!forEachReturnStatement(body, (statement) => isReturnStatementWithFixablePromiseHandler(statement, checker)); + } + function isReturnStatementWithFixablePromiseHandler(node, checker) { + return isReturnStatement(node) && !!node.expression && isFixablePromiseHandler(node.expression, checker); + } + function isFixablePromiseHandler(node, checker) { + if (!isPromiseHandler(node) || !hasSupportedNumberOfArguments(node) || !node.arguments.every((arg) => isFixablePromiseArgument(arg, checker))) { + return false; + } + let currentNode = node.expression.expression; + while (isPromiseHandler(currentNode) || isPropertyAccessExpression(currentNode)) { + if (isCallExpression(currentNode)) { + if (!hasSupportedNumberOfArguments(currentNode) || !currentNode.arguments.every((arg) => isFixablePromiseArgument(arg, checker))) { + return false; + } + currentNode = currentNode.expression.expression; + } else { + currentNode = currentNode.expression; + } + } + return true; + } + function isPromiseHandler(node) { + return isCallExpression(node) && (hasPropertyAccessExpressionWithName(node, "then") || hasPropertyAccessExpressionWithName(node, "catch") || hasPropertyAccessExpressionWithName(node, "finally")); + } + function hasSupportedNumberOfArguments(node) { + const name2 = node.expression.name.text; + const maxArguments = name2 === "then" ? 2 : name2 === "catch" ? 1 : name2 === "finally" ? 1 : 0; + if (node.arguments.length > maxArguments) + return false; + if (node.arguments.length < maxArguments) + return true; + return maxArguments === 1 || some2(node.arguments, (arg) => { + return arg.kind === 106 || isIdentifier(arg) && arg.text === "undefined"; + }); + } + function isFixablePromiseArgument(arg, checker) { + switch (arg.kind) { + case 262: + case 218: + const functionFlags = getFunctionFlags(arg); + if (functionFlags & 1) { + return false; + } + case 219: + visitedNestedConvertibleFunctions.set(getKeyFromNode(arg), true); + case 106: + return true; + case 80: + case 211: { + const symbol = checker.getSymbolAtLocation(arg); + if (!symbol) { + return false; + } + return checker.isUndefinedSymbol(symbol) || some2(skipAlias(symbol, checker).declarations, (d7) => isFunctionLike(d7) || hasInitializer(d7) && !!d7.initializer && isFunctionLike(d7.initializer)); + } + default: + return false; + } + } + function getKeyFromNode(exp) { + return `${exp.pos.toString()}:${exp.end.toString()}`; + } + function canBeConvertedToClass(node, checker) { + var _a2, _b, _c, _d; + if (isFunctionExpression(node)) { + if (isVariableDeclaration(node.parent) && ((_a2 = node.symbol.members) == null ? void 0 : _a2.size)) { + return true; + } + const symbol = checker.getSymbolOfExpando( + node, + /*allowDeclaration*/ + false + ); + return !!(symbol && (((_b = symbol.exports) == null ? void 0 : _b.size) || ((_c = symbol.members) == null ? void 0 : _c.size))); + } + if (isFunctionDeclaration(node)) { + return !!((_d = node.symbol.members) == null ? void 0 : _d.size); + } + return false; + } + function canBeConvertedToAsync(node) { + switch (node.kind) { + case 262: + case 174: + case 218: + case 219: + return true; + default: + return false; + } + } + var visitedNestedConvertibleFunctions; + var init_suggestionDiagnostics = __esm2({ + "src/services/suggestionDiagnostics.ts"() { + "use strict"; + init_ts4(); + visitedNestedConvertibleFunctions = /* @__PURE__ */ new Map(); + } + }); + function transpileModule(input, transpileOptions) { + const diagnostics = []; + const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {}; + const defaultOptions9 = getDefaultCompilerOptions2(); + for (const key in defaultOptions9) { + if (hasProperty(defaultOptions9, key) && options[key] === void 0) { + options[key] = defaultOptions9[key]; + } + } + for (const option of transpileOptionValueCompilerOptions) { + if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) { + continue; + } + options[option.name] = option.transpileOptionValue; + } + options.suppressOutputPathCheck = true; + options.allowNonTsExtensions = true; + const newLine = getNewLineCharacter(options); + const compilerHost = { + getSourceFile: (fileName) => fileName === normalizePath(inputFileName) ? sourceFile : void 0, + writeFile: (name2, text) => { + if (fileExtensionIs(name2, ".map")) { + Debug.assertEqual(sourceMapText, void 0, "Unexpected multiple source map outputs, file:", name2); + sourceMapText = text; + } else { + Debug.assertEqual(outputText, void 0, "Unexpected multiple outputs, file:", name2); + outputText = text; + } + }, + getDefaultLibFileName: () => "lib.d.ts", + useCaseSensitiveFileNames: () => false, + getCanonicalFileName: (fileName) => fileName, + getCurrentDirectory: () => "", + getNewLine: () => newLine, + fileExists: (fileName) => fileName === inputFileName, + readFile: () => "", + directoryExists: () => true, + getDirectories: () => [] + }; + const inputFileName = transpileOptions.fileName || (transpileOptions.compilerOptions && transpileOptions.compilerOptions.jsx ? "module.tsx" : "module.ts"); + const sourceFile = createSourceFile( + inputFileName, + input, + { + languageVersion: getEmitScriptTarget(options), + impliedNodeFormat: getImpliedNodeFormatForFile( + toPath2(inputFileName, "", compilerHost.getCanonicalFileName), + /*packageJsonInfoCache*/ + void 0, + compilerHost, + options + ), + setExternalModuleIndicator: getSetExternalModuleIndicator(options), + jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 + /* ParseAll */ + } + ); + if (transpileOptions.moduleName) { + sourceFile.moduleName = transpileOptions.moduleName; + } + if (transpileOptions.renamedDependencies) { + sourceFile.renamedDependencies = new Map(Object.entries(transpileOptions.renamedDependencies)); + } + let outputText; + let sourceMapText; + const program = createProgram([inputFileName], options, compilerHost); + if (transpileOptions.reportDiagnostics) { + addRange( + /*to*/ + diagnostics, + /*from*/ + program.getSyntacticDiagnostics(sourceFile) + ); + addRange( + /*to*/ + diagnostics, + /*from*/ + program.getOptionsDiagnostics() + ); + } + program.emit( + /*targetSourceFile*/ + void 0, + /*writeFile*/ + void 0, + /*cancellationToken*/ + void 0, + /*emitOnlyDtsFiles*/ + void 0, + transpileOptions.transformers + ); + if (outputText === void 0) + return Debug.fail("Output generation failed"); + return { outputText, diagnostics, sourceMapText }; + } + function transpile(input, compilerOptions, fileName, diagnostics, moduleName3) { + const output = transpileModule(input, { compilerOptions, fileName, reportDiagnostics: !!diagnostics, moduleName: moduleName3 }); + addRange(diagnostics, output.diagnostics); + return output.outputText; + } + function fixupCompilerOptions(options, diagnostics) { + commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || filter2(optionDeclarations, (o7) => typeof o7.type === "object" && !forEachEntry(o7.type, (v8) => typeof v8 !== "number")); + options = cloneCompilerOptions(options); + for (const opt of commandLineOptionsStringToEnum) { + if (!hasProperty(options, opt.name)) { + continue; + } + const value2 = options[opt.name]; + if (isString4(value2)) { + options[opt.name] = parseCustomTypeOption(opt, value2, diagnostics); + } else { + if (!forEachEntry(opt.type, (v8) => v8 === value2)) { + diagnostics.push(createCompilerDiagnosticForInvalidCustomType(opt)); + } + } + } + return options; + } + var optionsRedundantWithVerbatimModuleSyntax, commandLineOptionsStringToEnum; + var init_transpile = __esm2({ + "src/services/transpile.ts"() { + "use strict"; + init_ts4(); + optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([ + "isolatedModules", + "preserveValueImports", + "importsNotUsedAsValues" + ]); + } + }); + function getNavigateToItems(sourceFiles, checker, cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles) { + const patternMatcher = createPatternMatcher(searchValue); + if (!patternMatcher) + return emptyArray; + const rawItems = []; + const singleCurrentFile = sourceFiles.length === 1 ? sourceFiles[0] : void 0; + for (const sourceFile of sourceFiles) { + cancellationToken.throwIfCancellationRequested(); + if (excludeDtsFiles && sourceFile.isDeclarationFile) { + continue; + } + if (shouldExcludeFile(sourceFile, !!excludeLibFiles, singleCurrentFile)) { + continue; + } + sourceFile.getNamedDeclarations().forEach((declarations, name2) => { + getItemsFromNamedDeclaration(patternMatcher, name2, declarations, checker, sourceFile.fileName, !!excludeLibFiles, singleCurrentFile, rawItems); + }); + } + rawItems.sort(compareNavigateToItems); + return (maxResultCount === void 0 ? rawItems : rawItems.slice(0, maxResultCount)).map(createNavigateToItem); + } + function shouldExcludeFile(file, excludeLibFiles, singleCurrentFile) { + return file !== singleCurrentFile && excludeLibFiles && (isInsideNodeModules(file.path) || file.hasNoDefaultLib); + } + function getItemsFromNamedDeclaration(patternMatcher, name2, declarations, checker, fileName, excludeLibFiles, singleCurrentFile, rawItems) { + const match = patternMatcher.getMatchForLastSegmentOfPattern(name2); + if (!match) { + return; + } + for (const declaration of declarations) { + if (!shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile)) + continue; + if (patternMatcher.patternContainsDots) { + const fullMatch = patternMatcher.getFullMatch(getContainers(declaration), name2); + if (fullMatch) { + rawItems.push({ name: name2, fileName, matchKind: fullMatch.kind, isCaseSensitive: fullMatch.isCaseSensitive, declaration }); + } + } else { + rawItems.push({ name: name2, fileName, matchKind: match.kind, isCaseSensitive: match.isCaseSensitive, declaration }); + } + } + } + function shouldKeepItem(declaration, checker, excludeLibFiles, singleCurrentFile) { + var _a2; + switch (declaration.kind) { + case 273: + case 276: + case 271: + const importer = checker.getSymbolAtLocation(declaration.name); + const imported = checker.getAliasedSymbol(importer); + return importer.escapedName !== imported.escapedName && !((_a2 = imported.declarations) == null ? void 0 : _a2.every((d7) => shouldExcludeFile(d7.getSourceFile(), excludeLibFiles, singleCurrentFile))); + default: + return true; + } + } + function tryAddSingleDeclarationName(declaration, containers) { + const name2 = getNameOfDeclaration(declaration); + return !!name2 && (pushLiteral(name2, containers) || name2.kind === 167 && tryAddComputedPropertyName(name2.expression, containers)); + } + function tryAddComputedPropertyName(expression, containers) { + return pushLiteral(expression, containers) || isPropertyAccessExpression(expression) && (containers.push(expression.name.text), true) && tryAddComputedPropertyName(expression.expression, containers); + } + function pushLiteral(node, containers) { + return isPropertyNameLiteral(node) && (containers.push(getTextOfIdentifierOrLiteral(node)), true); + } + function getContainers(declaration) { + const containers = []; + const name2 = getNameOfDeclaration(declaration); + if (name2 && name2.kind === 167 && !tryAddComputedPropertyName(name2.expression, containers)) { + return emptyArray; + } + containers.shift(); + let container = getContainerNode(declaration); + while (container) { + if (!tryAddSingleDeclarationName(container, containers)) { + return emptyArray; + } + container = getContainerNode(container); + } + return containers.reverse(); + } + function compareNavigateToItems(i1, i22) { + return compareValues(i1.matchKind, i22.matchKind) || compareStringsCaseSensitiveUI(i1.name, i22.name); + } + function createNavigateToItem(rawItem) { + const declaration = rawItem.declaration; + const container = getContainerNode(declaration); + const containerName = container && getNameOfDeclaration(container); + return { + name: rawItem.name, + kind: getNodeKind(declaration), + kindModifiers: getNodeModifiers(declaration), + matchKind: PatternMatchKind[rawItem.matchKind], + isCaseSensitive: rawItem.isCaseSensitive, + fileName: rawItem.fileName, + textSpan: createTextSpanFromNode(declaration), + // TODO(jfreeman): What should be the containerName when the container has a computed name? + containerName: containerName ? containerName.text : "", + containerKind: containerName ? getNodeKind(container) : "" + /* unknown */ + }; + } + var init_navigateTo = __esm2({ + "src/services/navigateTo.ts"() { + "use strict"; + init_ts4(); + } + }); + var ts_NavigateTo_exports = {}; + __export2(ts_NavigateTo_exports, { + getNavigateToItems: () => getNavigateToItems + }); + var init_ts_NavigateTo = __esm2({ + "src/services/_namespaces/ts.NavigateTo.ts"() { + "use strict"; + init_navigateTo(); + } + }); + function getNavigationBarItems(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; + curSourceFile = sourceFile; + try { + return map4(primaryNavBarMenuItems(rootNavigationBarNode(sourceFile)), convertToPrimaryNavBarMenuItem); + } finally { + reset(); + } + } + function getNavigationTree(sourceFile, cancellationToken) { + curCancellationToken = cancellationToken; + curSourceFile = sourceFile; + try { + return convertToTree(rootNavigationBarNode(sourceFile)); + } finally { + reset(); + } + } + function reset() { + curSourceFile = void 0; + curCancellationToken = void 0; + parentsStack = []; + parent2 = void 0; + emptyChildItemArray = []; + } + function nodeText(node) { + return cleanText(node.getText(curSourceFile)); + } + function navigationBarNodeKind(n7) { + return n7.node.kind; + } + function pushChild(parent22, child) { + if (parent22.children) { + parent22.children.push(child); + } else { + parent22.children = [child]; + } + } + function rootNavigationBarNode(sourceFile) { + Debug.assert(!parentsStack.length); + const root2 = { node: sourceFile, name: void 0, additionalNodes: void 0, parent: void 0, children: void 0, indent: 0 }; + parent2 = root2; + for (const statement of sourceFile.statements) { + addChildrenRecursively(statement); + } + endNode(); + Debug.assert(!parent2 && !parentsStack.length); + return root2; + } + function addLeafNode(node, name2) { + pushChild(parent2, emptyNavigationBarNode(node, name2)); + } + function emptyNavigationBarNode(node, name2) { + return { + node, + name: name2 || (isDeclaration(node) || isExpression(node) ? getNameOfDeclaration(node) : void 0), + additionalNodes: void 0, + parent: parent2, + children: void 0, + indent: parent2.indent + 1 + }; + } + function addTrackedEs5Class(name2) { + if (!trackedEs5Classes) { + trackedEs5Classes = /* @__PURE__ */ new Map(); + } + trackedEs5Classes.set(name2, true); + } + function endNestedNodes(depth) { + for (let i7 = 0; i7 < depth; i7++) + endNode(); + } + function startNestedNodes(targetNode, entityName) { + const names = []; + while (!isPropertyNameLiteral(entityName)) { + const name2 = getNameOrArgument(entityName); + const nameText = getElementOrPropertyAccessName(entityName); + entityName = entityName.expression; + if (nameText === "prototype" || isPrivateIdentifier(name2)) + continue; + names.push(name2); + } + names.push(entityName); + for (let i7 = names.length - 1; i7 > 0; i7--) { + const name2 = names[i7]; + startNode(targetNode, name2); + } + return [names.length - 1, names[0]]; + } + function startNode(node, name2) { + const navNode = emptyNavigationBarNode(node, name2); + pushChild(parent2, navNode); + parentsStack.push(parent2); + trackedEs5ClassesStack.push(trackedEs5Classes); + trackedEs5Classes = void 0; + parent2 = navNode; + } + function endNode() { + if (parent2.children) { + mergeChildren(parent2.children, parent2); + sortChildren(parent2.children); + } + parent2 = parentsStack.pop(); + trackedEs5Classes = trackedEs5ClassesStack.pop(); + } + function addNodeWithRecursiveChild(node, child, name2) { + startNode(node, name2); + addChildrenRecursively(child); + endNode(); + } + function addNodeWithRecursiveInitializer(node) { + if (node.initializer && isFunctionOrClassExpression(node.initializer)) { + startNode(node); + forEachChild(node.initializer, addChildrenRecursively); + endNode(); + } else { + addNodeWithRecursiveChild(node, node.initializer); + } + } + function hasNavigationBarName(node) { + const name2 = getNameOfDeclaration(node); + if (name2 === void 0) + return false; + if (isComputedPropertyName(name2)) { + const expression = name2.expression; + return isEntityNameExpression(expression) || isNumericLiteral(expression) || isStringOrNumericLiteralLike(expression); + } + return !!name2; + } + function addChildrenRecursively(node) { + curCancellationToken.throwIfCancellationRequested(); + if (!node || isToken(node)) { + return; + } + switch (node.kind) { + case 176: + const ctr = node; + addNodeWithRecursiveChild(ctr, ctr.body); + for (const param of ctr.parameters) { + if (isParameterPropertyDeclaration(param, ctr)) { + addLeafNode(param); + } + } + break; + case 174: + case 177: + case 178: + case 173: + if (hasNavigationBarName(node)) { + addNodeWithRecursiveChild(node, node.body); + } + break; + case 172: + if (hasNavigationBarName(node)) { + addNodeWithRecursiveInitializer(node); + } + break; + case 171: + if (hasNavigationBarName(node)) { + addLeafNode(node); + } + break; + case 273: + const importClause = node; + if (importClause.name) { + addLeafNode(importClause.name); + } + const { namedBindings } = importClause; + if (namedBindings) { + if (namedBindings.kind === 274) { + addLeafNode(namedBindings); + } else { + for (const element of namedBindings.elements) { + addLeafNode(element); + } + } + } + break; + case 304: + addNodeWithRecursiveChild(node, node.name); + break; + case 305: + const { expression } = node; + isIdentifier(expression) ? addLeafNode(node, expression) : addLeafNode(node); + break; + case 208: + case 303: + case 260: { + const child = node; + if (isBindingPattern(child.name)) { + addChildrenRecursively(child.name); + } else { + addNodeWithRecursiveInitializer(child); + } + break; + } + case 262: + const nameNode = node.name; + if (nameNode && isIdentifier(nameNode)) { + addTrackedEs5Class(nameNode.text); + } + addNodeWithRecursiveChild(node, node.body); + break; + case 219: + case 218: + addNodeWithRecursiveChild(node, node.body); + break; + case 266: + startNode(node); + for (const member of node.members) { + if (!isComputedProperty(member)) { + addLeafNode(member); + } + } + endNode(); + break; + case 263: + case 231: + case 264: + startNode(node); + for (const member of node.members) { + addChildrenRecursively(member); + } + endNode(); + break; + case 267: + addNodeWithRecursiveChild(node, getInteriorModule(node).body); + break; + case 277: { + const expression2 = node.expression; + const child = isObjectLiteralExpression(expression2) || isCallExpression(expression2) ? expression2 : isArrowFunction(expression2) || isFunctionExpression(expression2) ? expression2.body : void 0; + if (child) { + startNode(node); + addChildrenRecursively(child); + endNode(); + } else { + addLeafNode(node); + } + break; + } + case 281: + case 271: + case 181: + case 179: + case 180: + case 265: + addLeafNode(node); + break; + case 213: + case 226: { + const special = getAssignmentDeclarationKind(node); + switch (special) { + case 1: + case 2: + addNodeWithRecursiveChild(node, node.right); + return; + case 6: + case 3: { + const binaryExpression = node; + const assignmentTarget = binaryExpression.left; + const prototypeAccess = special === 3 ? assignmentTarget.expression : assignmentTarget; + let depth = 0; + let className; + if (isIdentifier(prototypeAccess.expression)) { + addTrackedEs5Class(prototypeAccess.expression.text); + className = prototypeAccess.expression; + } else { + [depth, className] = startNestedNodes(binaryExpression, prototypeAccess.expression); + } + if (special === 6) { + if (isObjectLiteralExpression(binaryExpression.right)) { + if (binaryExpression.right.properties.length > 0) { + startNode(binaryExpression, className); + forEachChild(binaryExpression.right, addChildrenRecursively); + endNode(); + } + } + } else if (isFunctionExpression(binaryExpression.right) || isArrowFunction(binaryExpression.right)) { + addNodeWithRecursiveChild(node, binaryExpression.right, className); + } else { + startNode(binaryExpression, className); + addNodeWithRecursiveChild(node, binaryExpression.right, assignmentTarget.name); + endNode(); + } + endNestedNodes(depth); + return; + } + case 7: + case 9: { + const defineCall = node; + const className = special === 7 ? defineCall.arguments[0] : defineCall.arguments[0].expression; + const memberName = defineCall.arguments[1]; + const [depth, classNameIdentifier] = startNestedNodes(node, className); + startNode(node, classNameIdentifier); + startNode(node, setTextRange(factory.createIdentifier(memberName.text), memberName)); + addChildrenRecursively(node.arguments[2]); + endNode(); + endNode(); + endNestedNodes(depth); + return; + } + case 5: { + const binaryExpression = node; + const assignmentTarget = binaryExpression.left; + const targetFunction = assignmentTarget.expression; + if (isIdentifier(targetFunction) && getElementOrPropertyAccessName(assignmentTarget) !== "prototype" && trackedEs5Classes && trackedEs5Classes.has(targetFunction.text)) { + if (isFunctionExpression(binaryExpression.right) || isArrowFunction(binaryExpression.right)) { + addNodeWithRecursiveChild(node, binaryExpression.right, targetFunction); + } else if (isBindableStaticAccessExpression(assignmentTarget)) { + startNode(binaryExpression, targetFunction); + addNodeWithRecursiveChild(binaryExpression.left, binaryExpression.right, getNameOrArgument(assignmentTarget)); + endNode(); + } + return; + } + break; + } + case 4: + case 0: + case 8: + break; + default: + Debug.assertNever(special); + } + } + default: + if (hasJSDocNodes(node)) { + forEach4(node.jsDoc, (jsDoc) => { + forEach4(jsDoc.tags, (tag) => { + if (isJSDocTypeAlias(tag)) { + addLeafNode(tag); + } + }); + }); + } + forEachChild(node, addChildrenRecursively); + } + } + function mergeChildren(children, node) { + const nameToItems = /* @__PURE__ */ new Map(); + filterMutate(children, (child, index4) => { + const declName = child.name || getNameOfDeclaration(child.node); + const name2 = declName && nodeText(declName); + if (!name2) { + return true; + } + const itemsWithSameName = nameToItems.get(name2); + if (!itemsWithSameName) { + nameToItems.set(name2, child); + return true; + } + if (itemsWithSameName instanceof Array) { + for (const itemWithSameName of itemsWithSameName) { + if (tryMerge(itemWithSameName, child, index4, node)) { + return false; + } + } + itemsWithSameName.push(child); + return true; + } else { + const itemWithSameName = itemsWithSameName; + if (tryMerge(itemWithSameName, child, index4, node)) { + return false; + } + nameToItems.set(name2, [itemWithSameName, child]); + return true; + } + }); + } + function tryMergeEs5Class(a7, b8, bIndex, parent22) { + function isPossibleConstructor(node) { + return isFunctionExpression(node) || isFunctionDeclaration(node) || isVariableDeclaration(node); + } + const bAssignmentDeclarationKind = isBinaryExpression(b8.node) || isCallExpression(b8.node) ? getAssignmentDeclarationKind(b8.node) : 0; + const aAssignmentDeclarationKind = isBinaryExpression(a7.node) || isCallExpression(a7.node) ? getAssignmentDeclarationKind(a7.node) : 0; + if (isEs5ClassMember[bAssignmentDeclarationKind] && isEs5ClassMember[aAssignmentDeclarationKind] || isPossibleConstructor(a7.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isPossibleConstructor(b8.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a7.node) && isSynthesized(a7.node) && isEs5ClassMember[bAssignmentDeclarationKind] || isClassDeclaration(b8.node) && isEs5ClassMember[aAssignmentDeclarationKind] || isClassDeclaration(a7.node) && isSynthesized(a7.node) && isPossibleConstructor(b8.node) || isClassDeclaration(b8.node) && isPossibleConstructor(a7.node) && isSynthesized(a7.node)) { + let lastANode = a7.additionalNodes && lastOrUndefined(a7.additionalNodes) || a7.node; + if (!isClassDeclaration(a7.node) && !isClassDeclaration(b8.node) || isPossibleConstructor(a7.node) || isPossibleConstructor(b8.node)) { + const ctorFunction = isPossibleConstructor(a7.node) ? a7.node : isPossibleConstructor(b8.node) ? b8.node : void 0; + if (ctorFunction !== void 0) { + const ctorNode = setTextRange( + factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + [], + /*body*/ + void 0 + ), + ctorFunction + ); + const ctor = emptyNavigationBarNode(ctorNode); + ctor.indent = a7.indent + 1; + ctor.children = a7.node === ctorFunction ? a7.children : b8.children; + a7.children = a7.node === ctorFunction ? concatenate([ctor], b8.children || [b8]) : concatenate(a7.children || [{ ...a7 }], [ctor]); + } else { + if (a7.children || b8.children) { + a7.children = concatenate(a7.children || [{ ...a7 }], b8.children || [b8]); + if (a7.children) { + mergeChildren(a7.children, a7); + sortChildren(a7.children); + } + } + } + lastANode = a7.node = setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + a7.name || factory.createIdentifier("__class__"), + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + [] + ), + a7.node + ); + } else { + a7.children = concatenate(a7.children, b8.children); + if (a7.children) { + mergeChildren(a7.children, a7); + } + } + const bNode = b8.node; + if (parent22.children[bIndex - 1].node.end === lastANode.end) { + setTextRange(lastANode, { pos: lastANode.pos, end: bNode.end }); + } else { + if (!a7.additionalNodes) + a7.additionalNodes = []; + a7.additionalNodes.push(setTextRange( + factory.createClassDeclaration( + /*modifiers*/ + void 0, + a7.name || factory.createIdentifier("__class__"), + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + [] + ), + b8.node + )); + } + return true; + } + return bAssignmentDeclarationKind === 0 ? false : true; + } + function tryMerge(a7, b8, bIndex, parent22) { + if (tryMergeEs5Class(a7, b8, bIndex, parent22)) { + return true; + } + if (shouldReallyMerge(a7.node, b8.node, parent22)) { + merge7(a7, b8); + return true; + } + return false; + } + function shouldReallyMerge(a7, b8, parent22) { + if (a7.kind !== b8.kind || a7.parent !== b8.parent && !(isOwnChild(a7, parent22) && isOwnChild(b8, parent22))) { + return false; + } + switch (a7.kind) { + case 172: + case 174: + case 177: + case 178: + return isStatic(a7) === isStatic(b8); + case 267: + return areSameModule(a7, b8) && getFullyQualifiedModuleName(a7) === getFullyQualifiedModuleName(b8); + default: + return true; + } + } + function isSynthesized(node) { + return !!(node.flags & 16); + } + function isOwnChild(n7, parent22) { + const par = isModuleBlock(n7.parent) ? n7.parent.parent : n7.parent; + return par === parent22.node || contains2(parent22.additionalNodes, par); + } + function areSameModule(a7, b8) { + if (!a7.body || !b8.body) { + return a7.body === b8.body; + } + return a7.body.kind === b8.body.kind && (a7.body.kind !== 267 || areSameModule(a7.body, b8.body)); + } + function merge7(target, source) { + target.additionalNodes = target.additionalNodes || []; + target.additionalNodes.push(source.node); + if (source.additionalNodes) { + target.additionalNodes.push(...source.additionalNodes); + } + target.children = concatenate(target.children, source.children); + if (target.children) { + mergeChildren(target.children, target); + sortChildren(target.children); + } + } + function sortChildren(children) { + children.sort(compareChildren); + } + function compareChildren(child1, child2) { + return compareStringsCaseSensitiveUI(tryGetName(child1.node), tryGetName(child2.node)) || compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); + } + function tryGetName(node) { + if (node.kind === 267) { + return getModuleName(node); + } + const declName = getNameOfDeclaration(node); + if (declName && isPropertyName(declName)) { + const propertyName = getPropertyNameForPropertyNameNode(declName); + return propertyName && unescapeLeadingUnderscores(propertyName); + } + switch (node.kind) { + case 218: + case 219: + case 231: + return getFunctionOrClassName(node); + default: + return void 0; + } + } + function getItemName(node, name2) { + if (node.kind === 267) { + return cleanText(getModuleName(node)); + } + if (name2) { + const text = isIdentifier(name2) ? name2.text : isElementAccessExpression(name2) ? `[${nodeText(name2.argumentExpression)}]` : nodeText(name2); + if (text.length > 0) { + return cleanText(text); + } + } + switch (node.kind) { + case 312: + const sourceFile = node; + return isExternalModule(sourceFile) ? `"${escapeString2(getBaseFileName(removeFileExtension(normalizePath(sourceFile.fileName))))}"` : ""; + case 277: + return isExportAssignment(node) && node.isExportEquals ? "export=" : "default"; + case 219: + case 262: + case 218: + case 263: + case 231: + if (getSyntacticModifierFlags(node) & 2048) { + return "default"; + } + return getFunctionOrClassName(node); + case 176: + return "constructor"; + case 180: + return "new()"; + case 179: + return "()"; + case 181: + return "[]"; + default: + return ""; + } + } + function primaryNavBarMenuItems(root2) { + const primaryNavBarMenuItems2 = []; + function recur(item) { + if (shouldAppearInPrimaryNavBarMenu(item)) { + primaryNavBarMenuItems2.push(item); + if (item.children) { + for (const child of item.children) { + recur(child); + } + } + } + } + recur(root2); + return primaryNavBarMenuItems2; + function shouldAppearInPrimaryNavBarMenu(item) { + if (item.children) { + return true; + } + switch (navigationBarNodeKind(item)) { + case 263: + case 231: + case 266: + case 264: + case 267: + case 312: + case 265: + case 353: + case 345: + return true; + case 219: + case 262: + case 218: + return isTopLevelFunctionDeclaration(item); + default: + return false; + } + function isTopLevelFunctionDeclaration(item2) { + if (!item2.node.body) { + return false; + } + switch (navigationBarNodeKind(item2.parent)) { + case 268: + case 312: + case 174: + case 176: + return true; + default: + return false; + } + } + } + } + function convertToTree(n7) { + return { + text: getItemName(n7.node, n7.name), + kind: getNodeKind(n7.node), + kindModifiers: getModifiers2(n7.node), + spans: getSpans(n7), + nameSpan: n7.name && getNodeSpan(n7.name), + childItems: map4(n7.children, convertToTree) + }; + } + function convertToPrimaryNavBarMenuItem(n7) { + return { + text: getItemName(n7.node, n7.name), + kind: getNodeKind(n7.node), + kindModifiers: getModifiers2(n7.node), + spans: getSpans(n7), + childItems: map4(n7.children, convertToSecondaryNavBarMenuItem) || emptyChildItemArray, + indent: n7.indent, + bolded: false, + grayed: false + }; + function convertToSecondaryNavBarMenuItem(n22) { + return { + text: getItemName(n22.node, n22.name), + kind: getNodeKind(n22.node), + kindModifiers: getNodeModifiers(n22.node), + spans: getSpans(n22), + childItems: emptyChildItemArray, + indent: 0, + bolded: false, + grayed: false + }; + } + } + function getSpans(n7) { + const spans = [getNodeSpan(n7.node)]; + if (n7.additionalNodes) { + for (const node of n7.additionalNodes) { + spans.push(getNodeSpan(node)); + } + } + return spans; + } + function getModuleName(moduleDeclaration) { + if (isAmbientModule(moduleDeclaration)) { + return getTextOfNode(moduleDeclaration.name); + } + return getFullyQualifiedModuleName(moduleDeclaration); + } + function getFullyQualifiedModuleName(moduleDeclaration) { + const result2 = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)]; + while (moduleDeclaration.body && moduleDeclaration.body.kind === 267) { + moduleDeclaration = moduleDeclaration.body; + result2.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name)); + } + return result2.join("."); + } + function getInteriorModule(decl) { + return decl.body && isModuleDeclaration(decl.body) ? getInteriorModule(decl.body) : decl; + } + function isComputedProperty(member) { + return !member.name || member.name.kind === 167; + } + function getNodeSpan(node) { + return node.kind === 312 ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); + } + function getModifiers2(node) { + if (node.parent && node.parent.kind === 260) { + node = node.parent; + } + return getNodeModifiers(node); + } + function getFunctionOrClassName(node) { + const { parent: parent22 } = node; + if (node.name && getFullWidth(node.name) > 0) { + return cleanText(declarationNameToString(node.name)); + } else if (isVariableDeclaration(parent22)) { + return cleanText(declarationNameToString(parent22.name)); + } else if (isBinaryExpression(parent22) && parent22.operatorToken.kind === 64) { + return nodeText(parent22.left).replace(whiteSpaceRegex, ""); + } else if (isPropertyAssignment(parent22)) { + return nodeText(parent22.name); + } else if (getSyntacticModifierFlags(node) & 2048) { + return "default"; + } else if (isClassLike(node)) { + return ""; + } else if (isCallExpression(parent22)) { + let name2 = getCalledExpressionName(parent22.expression); + if (name2 !== void 0) { + name2 = cleanText(name2); + if (name2.length > maxLength) { + return `${name2} callback`; + } + const args = cleanText(mapDefined(parent22.arguments, (a7) => isStringLiteralLike(a7) || isTemplateLiteral(a7) ? a7.getText(curSourceFile) : void 0).join(", ")); + return `${name2}(${args}) callback`; + } + } + return ""; + } + function getCalledExpressionName(expr) { + if (isIdentifier(expr)) { + return expr.text; + } else if (isPropertyAccessExpression(expr)) { + const left = getCalledExpressionName(expr.expression); + const right = expr.name.text; + return left === void 0 ? right : `${left}.${right}`; + } else { + return void 0; + } + } + function isFunctionOrClassExpression(node) { + switch (node.kind) { + case 219: + case 218: + case 231: + return true; + default: + return false; + } + } + function cleanText(text) { + text = text.length > maxLength ? text.substring(0, maxLength) + "..." : text; + return text.replace(/\\?(\r?\n|\r|\u2028|\u2029)/g, ""); + } + var whiteSpaceRegex, maxLength, curCancellationToken, curSourceFile, parentsStack, parent2, trackedEs5ClassesStack, trackedEs5Classes, emptyChildItemArray, isEs5ClassMember; + var init_navigationBar = __esm2({ + "src/services/navigationBar.ts"() { + "use strict"; + init_ts4(); + whiteSpaceRegex = /\s+/g; + maxLength = 150; + parentsStack = []; + trackedEs5ClassesStack = []; + emptyChildItemArray = []; + isEs5ClassMember = { + [ + 5 + /* Property */ + ]: true, + [ + 3 + /* PrototypeProperty */ + ]: true, + [ + 7 + /* ObjectDefinePropertyValue */ + ]: true, + [ + 9 + /* ObjectDefinePrototypeProperty */ + ]: true, + [ + 0 + /* None */ + ]: false, + [ + 1 + /* ExportsProperty */ + ]: false, + [ + 2 + /* ModuleExports */ + ]: false, + [ + 8 + /* ObjectDefinePropertyExports */ + ]: false, + [ + 6 + /* Prototype */ + ]: true, + [ + 4 + /* ThisProperty */ + ]: false + }; + } + }); + var ts_NavigationBar_exports = {}; + __export2(ts_NavigationBar_exports, { + getNavigationBarItems: () => getNavigationBarItems, + getNavigationTree: () => getNavigationTree + }); + var init_ts_NavigationBar = __esm2({ + "src/services/_namespaces/ts.NavigationBar.ts"() { + "use strict"; + init_navigationBar(); + } + }); + function registerRefactor(name2, refactor) { + refactors.set(name2, refactor); + } + function getApplicableRefactors(context2, includeInteractiveActions) { + return arrayFrom(flatMapIterator(refactors.values(), (refactor) => { + var _a2; + return context2.cancellationToken && context2.cancellationToken.isCancellationRequested() || !((_a2 = refactor.kinds) == null ? void 0 : _a2.some((kind) => refactorKindBeginsWith(kind, context2.kind))) ? void 0 : refactor.getAvailableActions(context2, includeInteractiveActions); + })); + } + function getEditsForRefactor(context2, refactorName14, actionName2, interactiveRefactorArguments) { + const refactor = refactors.get(refactorName14); + return refactor && refactor.getEditsForAction(context2, actionName2, interactiveRefactorArguments); + } + var refactors; + var init_refactorProvider = __esm2({ + "src/services/refactorProvider.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactors = /* @__PURE__ */ new Map(); + } + }); + function getInfo2(context2, considerPartialSpans = true) { + const { file, program } = context2; + const span = getRefactorContextSpan(context2); + const token = getTokenAtPosition(file, span.start); + const exportNode = !!(token.parent && getSyntacticModifierFlags(token.parent) & 32) && considerPartialSpans ? token.parent : getParentNodeInSpan(token, file, span); + if (!exportNode || !isSourceFile(exportNode.parent) && !(isModuleBlock(exportNode.parent) && isAmbientModule(exportNode.parent.parent))) { + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_export_statement) }; + } + const checker = program.getTypeChecker(); + const exportingModuleSymbol = getExportingModuleSymbol(exportNode.parent, checker); + const flags = getSyntacticModifierFlags(exportNode) || (isExportAssignment(exportNode) && !exportNode.isExportEquals ? 2080 : 0); + const wasDefault = !!(flags & 2048); + if (!(flags & 32) || !wasDefault && exportingModuleSymbol.exports.has( + "default" + /* Default */ + )) { + return { error: getLocaleSpecificMessage(Diagnostics.This_file_already_has_a_default_export) }; + } + const noSymbolError = (id) => isIdentifier(id) && checker.getSymbolAtLocation(id) ? void 0 : { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_named_export) }; + switch (exportNode.kind) { + case 262: + case 263: + case 264: + case 266: + case 265: + case 267: { + const node = exportNode; + if (!node.name) + return void 0; + return noSymbolError(node.name) || { exportNode: node, exportName: node.name, wasDefault, exportingModuleSymbol }; + } + case 243: { + const vs = exportNode; + if (!(vs.declarationList.flags & 2) || vs.declarationList.declarations.length !== 1) { + return void 0; + } + const decl = first(vs.declarationList.declarations); + if (!decl.initializer) + return void 0; + Debug.assert(!wasDefault, "Can't have a default flag here"); + return noSymbolError(decl.name) || { exportNode: vs, exportName: decl.name, wasDefault, exportingModuleSymbol }; + } + case 277: { + const node = exportNode; + if (node.isExportEquals) + return void 0; + return noSymbolError(node.expression) || { exportNode: node, exportName: node.expression, wasDefault, exportingModuleSymbol }; + } + default: + return void 0; + } + } + function doChange(exportingSourceFile, program, info2, changes, cancellationToken) { + changeExport(exportingSourceFile, info2, changes, program.getTypeChecker()); + changeImports(program, info2, changes, cancellationToken); + } + function changeExport(exportingSourceFile, { wasDefault, exportNode, exportName }, changes, checker) { + if (wasDefault) { + if (isExportAssignment(exportNode) && !exportNode.isExportEquals) { + const exp = exportNode.expression; + const spec = makeExportSpecifier(exp.text, exp.text); + changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([spec]) + )); + } else { + changes.delete(exportingSourceFile, Debug.checkDefined(findModifier( + exportNode, + 90 + /* DefaultKeyword */ + ), "Should find a default keyword in modifier list")); + } + } else { + const exportKeyword = Debug.checkDefined(findModifier( + exportNode, + 95 + /* ExportKeyword */ + ), "Should find an export keyword in modifier list"); + switch (exportNode.kind) { + case 262: + case 263: + case 264: + changes.insertNodeAfter(exportingSourceFile, exportKeyword, factory.createToken( + 90 + /* DefaultKeyword */ + )); + break; + case 243: + const decl = first(exportNode.declarationList.declarations); + if (!ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(exportName, checker, exportingSourceFile) && !decl.type) { + changes.replaceNode(exportingSourceFile, exportNode, factory.createExportDefault(Debug.checkDefined(decl.initializer, "Initializer was previously known to be present"))); + break; + } + case 266: + case 265: + case 267: + changes.deleteModifier(exportingSourceFile, exportKeyword); + changes.insertNodeAfter(exportingSourceFile, exportNode, factory.createExportDefault(factory.createIdentifier(exportName.text))); + break; + default: + Debug.fail(`Unexpected exportNode kind ${exportNode.kind}`); + } + } + } + function changeImports(program, { wasDefault, exportName, exportingModuleSymbol }, changes, cancellationToken) { + const checker = program.getTypeChecker(); + const exportSymbol = Debug.checkDefined(checker.getSymbolAtLocation(exportName), "Export name should resolve to a symbol"); + ts_FindAllReferences_exports.Core.eachExportReference(program.getSourceFiles(), checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName.text, wasDefault, (ref) => { + if (exportName === ref) + return; + const importingSourceFile = ref.getSourceFile(); + if (wasDefault) { + changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName.text); + } else { + changeNamedToDefaultImport(importingSourceFile, ref, changes); + } + }); + } + function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportName) { + const { parent: parent22 } = ref; + switch (parent22.kind) { + case 211: + changes.replaceNode(importingSourceFile, ref, factory.createIdentifier(exportName)); + break; + case 276: + case 281: { + const spec = parent22; + changes.replaceNode(importingSourceFile, spec, makeImportSpecifier(exportName, spec.name.text)); + break; + } + case 273: { + const clause = parent22; + Debug.assert(clause.name === ref, "Import clause name should match provided ref"); + const spec = makeImportSpecifier(exportName, ref.text); + const { namedBindings } = clause; + if (!namedBindings) { + changes.replaceNode(importingSourceFile, ref, factory.createNamedImports([spec])); + } else if (namedBindings.kind === 274) { + changes.deleteRange(importingSourceFile, { pos: ref.getStart(importingSourceFile), end: namedBindings.getStart(importingSourceFile) }); + const quotePreference = isStringLiteral(clause.parent.moduleSpecifier) ? quotePreferenceFromString(clause.parent.moduleSpecifier, importingSourceFile) : 1; + const newImport = makeImport( + /*defaultImport*/ + void 0, + [makeImportSpecifier(exportName, ref.text)], + clause.parent.moduleSpecifier, + quotePreference + ); + changes.insertNodeAfter(importingSourceFile, clause.parent, newImport); + } else { + changes.delete(importingSourceFile, ref); + changes.insertNodeAtEndOfList(importingSourceFile, namedBindings.elements, spec); + } + break; + } + case 205: + const importTypeNode = parent22; + changes.replaceNode(importingSourceFile, parent22, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); + break; + default: + Debug.failBadSyntaxKind(parent22); + } + } + function changeNamedToDefaultImport(importingSourceFile, ref, changes) { + const parent22 = ref.parent; + switch (parent22.kind) { + case 211: + changes.replaceNode(importingSourceFile, ref, factory.createIdentifier("default")); + break; + case 276: { + const defaultImport = factory.createIdentifier(parent22.name.text); + if (parent22.parent.elements.length === 1) { + changes.replaceNode(importingSourceFile, parent22.parent, defaultImport); + } else { + changes.delete(importingSourceFile, parent22); + changes.insertNodeBefore(importingSourceFile, parent22.parent, defaultImport); + } + break; + } + case 281: { + changes.replaceNode(importingSourceFile, parent22, makeExportSpecifier("default", parent22.name.text)); + break; + } + default: + Debug.assertNever(parent22, `Unexpected parent kind ${parent22.kind}`); + } + } + function makeImportSpecifier(propertyName, name2) { + return factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName === name2 ? void 0 : factory.createIdentifier(propertyName), + factory.createIdentifier(name2) + ); + } + function makeExportSpecifier(propertyName, name2) { + return factory.createExportSpecifier( + /*isTypeOnly*/ + false, + propertyName === name2 ? void 0 : factory.createIdentifier(propertyName), + factory.createIdentifier(name2) + ); + } + function getExportingModuleSymbol(parent22, checker) { + if (isSourceFile(parent22)) { + return parent22.symbol; + } + const symbol = parent22.parent.symbol; + if (symbol.valueDeclaration && isExternalModuleAugmentation(symbol.valueDeclaration)) { + return checker.getMergedSymbol(symbol); + } + return symbol; + } + var refactorName, defaultToNamedAction, namedToDefaultAction; + var init_convertExport = __esm2({ + "src/services/refactors/convertExport.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName = "Convert export"; + defaultToNamedAction = { + name: "Convert default export to named export", + description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), + kind: "refactor.rewrite.export.named" + }; + namedToDefaultAction = { + name: "Convert named export to default export", + description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export), + kind: "refactor.rewrite.export.default" + }; + registerRefactor(refactorName, { + kinds: [ + defaultToNamedAction.kind, + namedToDefaultAction.kind + ], + getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndDefaultExports(context2) { + const info2 = getInfo2(context2, context2.triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + const action = info2.wasDefault ? defaultToNamedAction : namedToDefaultAction; + return [{ name: refactorName, description: action.description, actions: [action] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [ + { + name: refactorName, + description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), + actions: [ + { ...defaultToNamedAction, notApplicableReason: info2.error }, + { ...namedToDefaultAction, notApplicableReason: info2.error } + ] + } + ]; + } + return emptyArray; + }, + getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndDefaultExports(context2, actionName2) { + Debug.assert(actionName2 === defaultToNamedAction.name || actionName2 === namedToDefaultAction.name, "Unexpected action name"); + const info2 = getInfo2(context2); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected applicable refactor info"); + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange(context2.file, context2.program, info2, t8, context2.cancellationToken)); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + } + }); + function getImportConversionInfo(context2, considerPartialSpans = true) { + const { file } = context2; + const span = getRefactorContextSpan(context2); + const token = getTokenAtPosition(file, span.start); + const importDecl = considerPartialSpans ? findAncestor(token, isImportDeclaration) : getParentNodeInSpan(token, file, span); + if (!importDecl || !isImportDeclaration(importDecl)) + return { error: "Selection is not an import declaration." }; + const end = span.start + span.length; + const nextToken = findNextToken(importDecl, importDecl.parent, file); + if (nextToken && end > nextToken.getStart()) + return void 0; + const { importClause } = importDecl; + if (!importClause) { + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_import_clause) }; + } + if (!importClause.namedBindings) { + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) }; + } + if (importClause.namedBindings.kind === 274) { + return { convertTo: 0, import: importClause.namedBindings }; + } + const shouldUseDefault = getShouldUseDefault(context2.program, importClause); + return shouldUseDefault ? { convertTo: 1, import: importClause.namedBindings } : { convertTo: 2, import: importClause.namedBindings }; + } + function getShouldUseDefault(program, importClause) { + return getAllowSyntheticDefaultImports(program.getCompilerOptions()) && isExportEqualsModule(importClause.parent.moduleSpecifier, program.getTypeChecker()); + } + function doChange2(sourceFile, program, changes, info2) { + const checker = program.getTypeChecker(); + if (info2.convertTo === 0) { + doChangeNamespaceToNamed(sourceFile, checker, changes, info2.import, getAllowSyntheticDefaultImports(program.getCompilerOptions())); + } else { + doChangeNamedToNamespaceOrDefault( + sourceFile, + program, + changes, + info2.import, + info2.convertTo === 1 + /* Default */ + ); + } + } + function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allowSyntheticDefaultImports) { + let usedAsNamespaceOrDefault = false; + const nodesToReplace = []; + const conflictingNames = /* @__PURE__ */ new Map(); + ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(toConvert.name, checker, sourceFile, (id) => { + if (!isPropertyAccessOrQualifiedName(id.parent)) { + usedAsNamespaceOrDefault = true; + } else { + const exportName = getRightOfPropertyAccessOrQualifiedName(id.parent).text; + if (checker.resolveName( + exportName, + id, + -1, + /*excludeGlobals*/ + true + )) { + conflictingNames.set(exportName, true); + } + Debug.assert(getLeftOfPropertyAccessOrQualifiedName(id.parent) === id, "Parent expression should match id"); + nodesToReplace.push(id.parent); + } + }); + const exportNameToImportName = /* @__PURE__ */ new Map(); + for (const propertyAccessOrQualifiedName of nodesToReplace) { + const exportName = getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName).text; + let importName = exportNameToImportName.get(exportName); + if (importName === void 0) { + exportNameToImportName.set(exportName, importName = conflictingNames.has(exportName) ? getUniqueName(exportName, sourceFile) : exportName); + } + changes.replaceNode(sourceFile, propertyAccessOrQualifiedName, factory.createIdentifier(importName)); + } + const importSpecifiers = []; + exportNameToImportName.forEach((name2, propertyName) => { + importSpecifiers.push(factory.createImportSpecifier( + /*isTypeOnly*/ + false, + name2 === propertyName ? void 0 : factory.createIdentifier(propertyName), + factory.createIdentifier(name2) + )); + }); + const importDecl = toConvert.parent.parent; + if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) { + changes.insertNodeAfter(sourceFile, importDecl, updateImport( + importDecl, + /*defaultImportName*/ + void 0, + importSpecifiers + )); + } else { + changes.replaceNode(sourceFile, importDecl, updateImport(importDecl, usedAsNamespaceOrDefault ? factory.createIdentifier(toConvert.name.text) : void 0, importSpecifiers)); + } + } + function getRightOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { + return isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.name : propertyAccessOrQualifiedName.right; + } + function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) { + return isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.expression : propertyAccessOrQualifiedName.left; + } + function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault = getShouldUseDefault(program, toConvert.parent)) { + const checker = program.getTypeChecker(); + const importDecl = toConvert.parent.parent; + const { moduleSpecifier } = importDecl; + const toConvertSymbols = /* @__PURE__ */ new Set(); + toConvert.elements.forEach((namedImport) => { + const symbol = checker.getSymbolAtLocation(namedImport.name); + if (symbol) { + toConvertSymbols.add(symbol); + } + }); + const preferredName = moduleSpecifier && isStringLiteral(moduleSpecifier) ? ts_codefix_exports.moduleSpecifierToValidIdentifier( + moduleSpecifier.text, + 99 + /* ESNext */ + ) : "module"; + function hasNamespaceNameConflict(namedImport) { + return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(namedImport.name, checker, sourceFile, (id) => { + const symbol = checker.resolveName( + preferredName, + id, + -1, + /*excludeGlobals*/ + true + ); + if (symbol) { + if (toConvertSymbols.has(symbol)) { + return isExportSpecifier(id.parent); + } + return true; + } + return false; + }); + } + const namespaceNameConflicts = toConvert.elements.some(hasNamespaceNameConflict); + const namespaceImportName = namespaceNameConflicts ? getUniqueName(preferredName, sourceFile) : preferredName; + const neededNamedImports = /* @__PURE__ */ new Set(); + for (const element of toConvert.elements) { + const propertyName = (element.propertyName || element.name).text; + ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, (id) => { + const access2 = factory.createPropertyAccessExpression(factory.createIdentifier(namespaceImportName), propertyName); + if (isShorthandPropertyAssignment(id.parent)) { + changes.replaceNode(sourceFile, id.parent, factory.createPropertyAssignment(id.text, access2)); + } else if (isExportSpecifier(id.parent)) { + neededNamedImports.add(element); + } else { + changes.replaceNode(sourceFile, id, access2); + } + }); + } + changes.replaceNode( + sourceFile, + toConvert, + shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)) + ); + if (neededNamedImports.size) { + const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.createIdentifier(element.propertyName.text), factory.createIdentifier(element.name.text))); + changes.insertNodeAfter(sourceFile, toConvert.parent.parent, updateImport( + importDecl, + /*defaultImportName*/ + void 0, + newNamedImports + )); + } + } + function isExportEqualsModule(moduleSpecifier, checker) { + const externalModule = checker.resolveExternalModuleName(moduleSpecifier); + if (!externalModule) + return false; + const exportEquals = checker.resolveExternalModuleSymbol(externalModule); + return externalModule !== exportEquals; + } + function updateImport(old, defaultImportName, elements) { + return factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImportName, + elements && elements.length ? factory.createNamedImports(elements) : void 0 + ), + old.moduleSpecifier, + /*attributes*/ + void 0 + ); + } + var refactorName2, actions; + var init_convertImport = __esm2({ + "src/services/refactors/convertImport.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName2 = "Convert import"; + actions = { + [ + 0 + /* Named */ + ]: { + name: "Convert namespace import to named imports", + description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports), + kind: "refactor.rewrite.import.named" + }, + [ + 2 + /* Namespace */ + ]: { + name: "Convert named imports to namespace import", + description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import), + kind: "refactor.rewrite.import.namespace" + }, + [ + 1 + /* Default */ + ]: { + name: "Convert named imports to default import", + description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import), + kind: "refactor.rewrite.import.default" + } + }; + registerRefactor(refactorName2, { + kinds: getOwnValues(actions).map((a7) => a7.kind), + getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndNamespacedImports(context2) { + const info2 = getImportConversionInfo(context2, context2.triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + const action = actions[info2.convertTo]; + return [{ name: refactorName2, description: action.description, actions: [action] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return getOwnValues(actions).map((action) => ({ + name: refactorName2, + description: action.description, + actions: [{ ...action, notApplicableReason: info2.error }] + })); + } + return emptyArray; + }, + getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndNamespacedImports(context2, actionName2) { + Debug.assert(some2(getOwnValues(actions), (action) => action.name === actionName2), "Unexpected action name"); + const info2 = getImportConversionInfo(context2); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected applicable refactor info"); + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange2(context2.file, context2.program, t8, info2)); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + } + }); + function getRangeToExtract(context2, considerEmptySpans = true) { + const { file, startPosition } = context2; + const isJS = isSourceFileJS(file); + const range2 = createTextRangeFromSpan(getRefactorContextSpan(context2)); + const isCursorRequest = range2.pos === range2.end && considerEmptySpans; + const firstType = getFirstTypeAt(file, startPosition, range2, isCursorRequest); + if (!firstType || !isTypeNode(firstType)) + return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }; + const checker = context2.program.getTypeChecker(); + const enclosingNode = getEnclosingNode(firstType, isJS); + if (enclosingNode === void 0) + return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }; + const expandedFirstType = getExpandedSelectionNode(firstType, enclosingNode); + if (!isTypeNode(expandedFirstType)) + return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) }; + const typeList = []; + if ((isUnionTypeNode(expandedFirstType.parent) || isIntersectionTypeNode(expandedFirstType.parent)) && range2.end > firstType.end) { + addRange( + typeList, + expandedFirstType.parent.types.filter((type3) => { + return nodeOverlapsWithStartEnd(type3, file, range2.pos, range2.end); + }) + ); + } + const selection = typeList.length > 1 ? typeList : expandedFirstType; + const typeParameters = collectTypeParameters(checker, selection, enclosingNode, file); + if (!typeParameters) + return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) }; + const typeElements = flattenTypeLiteralNodeReference(checker, selection); + return { isJS, selection, enclosingNode, typeParameters, typeElements }; + } + function getFirstTypeAt(file, startPosition, range2, isCursorRequest) { + const currentNodes = [ + () => getTokenAtPosition(file, startPosition), + () => getTouchingToken(file, startPosition, () => true) + ]; + for (const f8 of currentNodes) { + const current = f8(); + const overlappingRange = nodeOverlapsWithStartEnd(current, file, range2.pos, range2.end); + const firstType = findAncestor(current, (node) => node.parent && isTypeNode(node) && !rangeContainsSkipTrivia(range2, node.parent, file) && (isCursorRequest || overlappingRange)); + if (firstType) { + return firstType; + } + } + return void 0; + } + function flattenTypeLiteralNodeReference(checker, selection) { + if (!selection) + return void 0; + if (isArray3(selection)) { + const result2 = []; + for (const type3 of selection) { + const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type3); + if (!flattenedTypeMembers) + return void 0; + addRange(result2, flattenedTypeMembers); + } + return result2; + } + if (isIntersectionTypeNode(selection)) { + const result2 = []; + const seen = /* @__PURE__ */ new Map(); + for (const type3 of selection.types) { + const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type3); + if (!flattenedTypeMembers || !flattenedTypeMembers.every((type22) => type22.name && addToSeen(seen, getNameFromPropertyName(type22.name)))) { + return void 0; + } + addRange(result2, flattenedTypeMembers); + } + return result2; + } else if (isParenthesizedTypeNode(selection)) { + return flattenTypeLiteralNodeReference(checker, selection.type); + } else if (isTypeLiteralNode(selection)) { + return selection.members; + } + return void 0; + } + function rangeContainsSkipTrivia(r1, node, file) { + return rangeContainsStartEnd(r1, skipTrivia(file.text, node.pos), node.end); + } + function collectTypeParameters(checker, selection, enclosingNode, file) { + const result2 = []; + const selectionArray = toArray3(selection); + const selectionRange = { pos: selectionArray[0].pos, end: selectionArray[selectionArray.length - 1].end }; + for (const t8 of selectionArray) { + if (visitor(t8)) + return void 0; + } + return result2; + function visitor(node) { + if (isTypeReferenceNode(node)) { + if (isIdentifier(node.typeName)) { + const typeName = node.typeName; + const symbol = checker.resolveName( + typeName.text, + typeName, + 262144, + /*excludeGlobals*/ + true + ); + for (const decl of (symbol == null ? void 0 : symbol.declarations) || emptyArray) { + if (isTypeParameterDeclaration(decl) && decl.getSourceFile() === file) { + if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selectionRange, file)) { + return true; + } + if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selectionRange, decl, file)) { + pushIfUnique(result2, decl); + break; + } + } + } + } + } else if (isInferTypeNode(node)) { + const conditionalTypeNode = findAncestor(node, (n7) => isConditionalTypeNode(n7) && rangeContainsSkipTrivia(n7.extendsType, node, file)); + if (!conditionalTypeNode || !rangeContainsSkipTrivia(selectionRange, conditionalTypeNode, file)) { + return true; + } + } else if (isTypePredicateNode(node) || isThisTypeNode(node)) { + const functionLikeNode = findAncestor(node.parent, isFunctionLike); + if (functionLikeNode && functionLikeNode.type && rangeContainsSkipTrivia(functionLikeNode.type, node, file) && !rangeContainsSkipTrivia(selectionRange, functionLikeNode, file)) { + return true; + } + } else if (isTypeQueryNode(node)) { + if (isIdentifier(node.exprName)) { + const symbol = checker.resolveName( + node.exprName.text, + node.exprName, + 111551, + /*excludeGlobals*/ + false + ); + if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selectionRange, symbol.valueDeclaration, file)) { + return true; + } + } else { + if (isThisIdentifier(node.exprName.left) && !rangeContainsSkipTrivia(selectionRange, node.parent, file)) { + return true; + } + } + } + if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) { + setEmitFlags( + node, + 1 + /* SingleLine */ + ); + } + return forEachChild(node, visitor); + } + } + function doTypeAliasChange(changes, file, name2, info2) { + const { enclosingNode, typeParameters } = info2; + const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info2); + const newTypeDeclaration = factory.createTypeAliasDeclaration( + /*modifiers*/ + void 0, + name2, + typeParameters.map((id) => factory.updateTypeParameterDeclaration( + id, + id.modifiers, + id.name, + id.constraint, + /*defaultType*/ + void 0 + )), + newTypeNode + ); + changes.insertNodeBefore( + file, + enclosingNode, + ignoreSourceNewlines(newTypeDeclaration), + /*blankLineBetween*/ + true + ); + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name2, typeParameters.map((id) => factory.createTypeReferenceNode( + id.name, + /*typeArguments*/ + void 0 + ))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace }); + } + function doInterfaceChange(changes, file, name2, info2) { + var _a2; + const { enclosingNode, typeParameters, typeElements } = info2; + const newTypeNode = factory.createInterfaceDeclaration( + /*modifiers*/ + void 0, + name2, + typeParameters, + /*heritageClauses*/ + void 0, + typeElements + ); + setTextRange(newTypeNode, (_a2 = typeElements[0]) == null ? void 0 : _a2.parent); + changes.insertNodeBefore( + file, + enclosingNode, + ignoreSourceNewlines(newTypeNode), + /*blankLineBetween*/ + true + ); + const { firstTypeNode, lastTypeNode } = getNodesToEdit(info2); + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name2, typeParameters.map((id) => factory.createTypeReferenceNode( + id.name, + /*typeArguments*/ + void 0 + ))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace }); + } + function doTypedefChange(changes, context2, file, name2, info2) { + var _a2; + toArray3(info2.selection).forEach((typeNode) => { + setEmitFlags( + typeNode, + 3072 | 4096 + /* NoNestedComments */ + ); + }); + const { enclosingNode, typeParameters } = info2; + const { firstTypeNode, lastTypeNode, newTypeNode } = getNodesToEdit(info2); + const node = factory.createJSDocTypedefTag( + factory.createIdentifier("typedef"), + factory.createJSDocTypeExpression(newTypeNode), + factory.createIdentifier(name2) + ); + const templates = []; + forEach4(typeParameters, (typeParameter) => { + const constraint = getEffectiveConstraintOfTypeParameter(typeParameter); + const parameter = factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + typeParameter.name + ); + const template2 = factory.createJSDocTemplateTag( + factory.createIdentifier("template"), + constraint && cast(constraint, isJSDocTypeExpression), + [parameter] + ); + templates.push(template2); + }); + const jsDoc = factory.createJSDocComment( + /*comment*/ + void 0, + factory.createNodeArray(concatenate(templates, [node])) + ); + if (isJSDoc(enclosingNode)) { + const pos = enclosingNode.getStart(file); + const newLineCharacter = getNewLineOrDefaultFromHost(context2.host, (_a2 = context2.formatContext) == null ? void 0 : _a2.options); + changes.insertNodeAt(file, enclosingNode.getStart(file), jsDoc, { + suffix: newLineCharacter + newLineCharacter + file.text.slice(getPrecedingNonSpaceCharacterPosition(file.text, pos - 1), pos) + }); + } else { + changes.insertNodeBefore( + file, + enclosingNode, + jsDoc, + /*blankLineBetween*/ + true + ); + } + changes.replaceNodeRange(file, firstTypeNode, lastTypeNode, factory.createTypeReferenceNode(name2, typeParameters.map((id) => factory.createTypeReferenceNode( + id.name, + /*typeArguments*/ + void 0 + )))); + } + function getNodesToEdit(info2) { + if (isArray3(info2.selection)) { + return { + firstTypeNode: info2.selection[0], + lastTypeNode: info2.selection[info2.selection.length - 1], + newTypeNode: isUnionTypeNode(info2.selection[0].parent) ? factory.createUnionTypeNode(info2.selection) : factory.createIntersectionTypeNode(info2.selection) + }; + } + return { + firstTypeNode: info2.selection, + lastTypeNode: info2.selection, + newTypeNode: info2.selection + }; + } + function getEnclosingNode(node, isJS) { + return findAncestor(node, isStatement) || (isJS ? findAncestor(node, isJSDoc) : void 0); + } + function getExpandedSelectionNode(firstType, enclosingNode) { + return findAncestor(firstType, (node) => { + if (node === enclosingNode) + return "quit"; + if (isUnionTypeNode(node.parent) || isIntersectionTypeNode(node.parent)) { + return true; + } + return false; + }) ?? firstType; + } + var refactorName3, extractToTypeAliasAction, extractToInterfaceAction, extractToTypeDefAction; + var init_extractType = __esm2({ + "src/services/refactors/extractType.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName3 = "Extract type"; + extractToTypeAliasAction = { + name: "Extract to type alias", + description: getLocaleSpecificMessage(Diagnostics.Extract_to_type_alias), + kind: "refactor.extract.type" + }; + extractToInterfaceAction = { + name: "Extract to interface", + description: getLocaleSpecificMessage(Diagnostics.Extract_to_interface), + kind: "refactor.extract.interface" + }; + extractToTypeDefAction = { + name: "Extract to typedef", + description: getLocaleSpecificMessage(Diagnostics.Extract_to_typedef), + kind: "refactor.extract.typedef" + }; + registerRefactor(refactorName3, { + kinds: [ + extractToTypeAliasAction.kind, + extractToInterfaceAction.kind, + extractToTypeDefAction.kind + ], + getAvailableActions: function getRefactorActionsToExtractType(context2) { + const info2 = getRangeToExtract(context2, context2.triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + return [{ + name: refactorName3, + description: getLocaleSpecificMessage(Diagnostics.Extract_type), + actions: info2.isJS ? [extractToTypeDefAction] : append([extractToTypeAliasAction], info2.typeElements && extractToInterfaceAction) + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName3, + description: getLocaleSpecificMessage(Diagnostics.Extract_type), + actions: [ + { ...extractToTypeDefAction, notApplicableReason: info2.error }, + { ...extractToTypeAliasAction, notApplicableReason: info2.error }, + { ...extractToInterfaceAction, notApplicableReason: info2.error } + ] + }]; + } + return emptyArray; + }, + getEditsForAction: function getRefactorEditsToExtractType(context2, actionName2) { + const { file } = context2; + const info2 = getRangeToExtract(context2); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected to find a range to extract"); + const name2 = getUniqueName("NewType", file); + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + switch (actionName2) { + case extractToTypeAliasAction.name: + Debug.assert(!info2.isJS, "Invalid actionName/JS combo"); + return doTypeAliasChange(changes, file, name2, info2); + case extractToTypeDefAction.name: + Debug.assert(info2.isJS, "Invalid actionName/JS combo"); + return doTypedefChange(changes, context2, file, name2, info2); + case extractToInterfaceAction.name: + Debug.assert(!info2.isJS && !!info2.typeElements, "Invalid actionName/JS combo"); + return doInterfaceChange(changes, file, name2, info2); + default: + Debug.fail("Unexpected action name"); + } + }); + const renameFilename = file.fileName; + const renameLocation = getRenameLocation( + edits, + renameFilename, + name2, + /*preferLastLocation*/ + false + ); + return { edits, renameFilename, renameLocation }; + } + }); + } + }); + function isRefactorErrorInfo(info2) { + return info2.error !== void 0; + } + function refactorKindBeginsWith(known, requested) { + if (!requested) + return true; + return known.substr(0, requested.length) === requested; + } + var init_helpers = __esm2({ + "src/services/refactors/helpers.ts"() { + "use strict"; + } + }); + function getInliningInfo(file, startPosition, tryWithReferenceToken, program) { + var _a2, _b; + const checker = program.getTypeChecker(); + const token = getTouchingPropertyName(file, startPosition); + const parent22 = token.parent; + if (!isIdentifier(token)) { + return void 0; + } + if (isInitializedVariable(parent22) && isVariableDeclarationInVariableStatement(parent22) && isIdentifier(parent22.name)) { + if (((_a2 = checker.getMergedSymbol(parent22.symbol).declarations) == null ? void 0 : _a2.length) !== 1) { + return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) }; + } + if (isDeclarationExported(parent22)) { + return void 0; + } + const references = getReferenceNodes(parent22, checker, file); + return references && { references, declaration: parent22, replacement: parent22.initializer }; + } + if (tryWithReferenceToken) { + let definition = checker.resolveName( + token.text, + token, + 111551, + /*excludeGlobals*/ + false + ); + definition = definition && checker.getMergedSymbol(definition); + if (((_b = definition == null ? void 0 : definition.declarations) == null ? void 0 : _b.length) !== 1) { + return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) }; + } + const declaration = definition.declarations[0]; + if (!isInitializedVariable(declaration) || !isVariableDeclarationInVariableStatement(declaration) || !isIdentifier(declaration.name)) { + return void 0; + } + if (isDeclarationExported(declaration)) { + return void 0; + } + const references = getReferenceNodes(declaration, checker, file); + return references && { references, declaration, replacement: declaration.initializer }; + } + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_variable_to_inline) }; + } + function isDeclarationExported(declaration) { + const variableStatement = cast(declaration.parent.parent, isVariableStatement); + return some2(variableStatement.modifiers, isExportModifier); + } + function getReferenceNodes(declaration, checker, file) { + const references = []; + const cannotInline = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(declaration.name, checker, file, (ref) => { + if (ts_FindAllReferences_exports.isWriteAccessForReference(ref) && !isShorthandPropertyAssignment(ref.parent)) { + return true; + } + if (isExportSpecifier(ref.parent) || isExportAssignment(ref.parent)) { + return true; + } + if (isTypeQueryNode(ref.parent)) { + return true; + } + if (textRangeContainsPositionInclusive(declaration, ref.pos)) { + return true; + } + references.push(ref); + }); + return references.length === 0 || cannotInline ? void 0 : references; + } + function getReplacementExpression(reference, replacement) { + replacement = getSynthesizedDeepClone(replacement); + const { parent: parent22 } = reference; + if (isExpression(parent22) && (getExpressionPrecedence(replacement) < getExpressionPrecedence(parent22) || needsParentheses(parent22))) { + return factory.createParenthesizedExpression(replacement); + } + if (isFunctionLike(replacement) && (isCallLikeExpression(parent22) || isPropertyAccessExpression(parent22))) { + return factory.createParenthesizedExpression(replacement); + } + if (isPropertyAccessExpression(parent22) && (isNumericLiteral(replacement) || isObjectLiteralExpression(replacement))) { + return factory.createParenthesizedExpression(replacement); + } + if (isIdentifier(reference) && isShorthandPropertyAssignment(parent22)) { + return factory.createPropertyAssignment(reference, replacement); + } + return replacement; + } + var refactorName4, refactorDescription, inlineVariableAction; + var init_inlineVariable = __esm2({ + "src/services/refactors/inlineVariable.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName4 = "Inline variable"; + refactorDescription = getLocaleSpecificMessage(Diagnostics.Inline_variable); + inlineVariableAction = { + name: refactorName4, + description: refactorDescription, + kind: "refactor.inline.variable" + }; + registerRefactor(refactorName4, { + kinds: [inlineVariableAction.kind], + getAvailableActions(context2) { + const { + file, + program, + preferences, + startPosition, + triggerReason + } = context2; + const info2 = getInliningInfo(file, startPosition, triggerReason === "invoked", program); + if (!info2) { + return emptyArray; + } + if (!ts_refactor_exports.isRefactorErrorInfo(info2)) { + return [{ + name: refactorName4, + description: refactorDescription, + actions: [inlineVariableAction] + }]; + } + if (preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName4, + description: refactorDescription, + actions: [{ + ...inlineVariableAction, + notApplicableReason: info2.error + }] + }]; + } + return emptyArray; + }, + getEditsForAction(context2, actionName2) { + Debug.assert(actionName2 === refactorName4, "Unexpected refactor invoked"); + const { file, program, startPosition } = context2; + const info2 = getInliningInfo( + file, + startPosition, + /*tryWithReferenceToken*/ + true, + program + ); + if (!info2 || ts_refactor_exports.isRefactorErrorInfo(info2)) { + return void 0; + } + const { references, declaration, replacement } = info2; + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (tracker) => { + for (const node of references) { + tracker.replaceNode(file, node, getReplacementExpression(node, replacement)); + } + tracker.delete(file, declaration); + }); + return { edits }; + } + }); + } + }); + function doChange3(oldFile, program, toMove, changes, host, preferences) { + const checker = program.getTypeChecker(); + const usage = getUsageInfo(oldFile, toMove.all, checker); + const newFilename = createNewFileName(oldFile, program, host, toMove); + changes.createNewFile(oldFile, newFilename, getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences)); + addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host)); + } + function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences) { + const checker = program.getTypeChecker(); + const prologueDirectives = takeWhile2(oldFile.statements, isPrologueDirective); + if (oldFile.externalModuleIndicator === void 0 && oldFile.commonJsModuleIndicator === void 0 && usage.oldImportsNeededByTargetFile.size === 0) { + deleteMovedStatements(oldFile, toMove.ranges, changes); + return [...prologueDirectives, ...toMove.all]; + } + const useEsModuleSyntax = !fileShouldUseJavaScriptRequire(newFilename, program, host, !!oldFile.commonJsModuleIndicator); + const quotePreference = getQuotePreference(oldFile, preferences); + const importsFromNewFile = createOldFileImportsFromTargetFile(oldFile, usage.oldFileImportsFromTargetFile, newFilename, program, host, useEsModuleSyntax, quotePreference); + if (importsFromNewFile) { + insertImports( + changes, + oldFile, + importsFromNewFile, + /*blankLineBetween*/ + true, + preferences + ); + } + deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); + deleteMovedStatements(oldFile, toMove.ranges, changes); + updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename, quotePreference); + const imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference); + const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax); + if (imports.length && body.length) { + return [ + ...prologueDirectives, + ...imports, + 4, + ...body + ]; + } + return [ + ...prologueDirectives, + ...imports, + ...body + ]; + } + function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference) { + const copiedOldImports = []; + for (const oldStatement of oldFile.statements) { + forEachImportInStatement(oldStatement, (i7) => { + append(copiedOldImports, filterImport(i7, moduleSpecifierFromImport(i7), (name2) => importsToCopy.has(checker.getSymbolAtLocation(name2)))); + }); + } + let oldFileDefault; + const oldFileNamedImports = []; + const markSeenTop = nodeSeenTracker(); + newFileImportsFromOldFile.forEach((symbol) => { + if (!symbol.declarations) { + return; + } + for (const decl of symbol.declarations) { + if (!isTopLevelDeclaration(decl)) + continue; + const name2 = nameOfTopLevelDeclaration(decl); + if (!name2) + continue; + const top = getTopLevelDeclarationStatement(decl); + if (markSeenTop(top)) { + addExportToChanges(oldFile, top, name2, changes, useEsModuleSyntax); + } + if (hasSyntacticModifier( + decl, + 2048 + /* Default */ + )) { + oldFileDefault = name2; + } else { + oldFileNamedImports.push(name2.text); + } + } + }); + append(copiedOldImports, makeImportOrRequire(oldFile, oldFileDefault, oldFileNamedImports, getBaseFileName(oldFile.fileName), program, host, useEsModuleSyntax, quotePreference)); + return copiedOldImports; + } + var refactorName5, description7, moveToNewFileAction; + var init_moveToNewFile = __esm2({ + "src/services/refactors/moveToNewFile.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName5 = "Move to a new file"; + description7 = getLocaleSpecificMessage(Diagnostics.Move_to_a_new_file); + moveToNewFileAction = { + name: refactorName5, + description: description7, + kind: "refactor.move.newFile" + }; + registerRefactor(refactorName5, { + kinds: [moveToNewFileAction.kind], + getAvailableActions: function getRefactorActionsToMoveToNewFile(context2) { + const statements = getStatementsToMove(context2); + if (context2.preferences.allowTextChangesInNewFiles && statements) { + return [{ name: refactorName5, description: description7, actions: [moveToNewFileAction] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ name: refactorName5, description: description7, actions: [{ ...moveToNewFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] }]; + } + return emptyArray; + }, + getEditsForAction: function getRefactorEditsToMoveToNewFile(context2, actionName2) { + Debug.assert(actionName2 === refactorName5, "Wrong refactor invoked"); + const statements = Debug.checkDefined(getStatementsToMove(context2)); + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange3(context2.file, context2.program, statements, t8, context2.host, context2.preferences)); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + }); + } + }); + function error2(notApplicableReason) { + return { edits: [], renameFilename: void 0, renameLocation: void 0, notApplicableReason }; + } + function doChange4(context2, oldFile, targetFile, program, toMove, changes, host, preferences) { + const checker = program.getTypeChecker(); + if (!host.fileExists(targetFile)) { + changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, getUsageInfo(oldFile, toMove.all, checker), changes, toMove, program, host, preferences)); + addNewFileToTsconfig(program, changes, oldFile.fileName, targetFile, hostGetCanonicalFileName(host)); + } else { + const targetSourceFile = Debug.checkDefined(program.getSourceFile(targetFile)); + const importAdder = ts_codefix_exports.createImportAdder(targetSourceFile, context2.program, context2.preferences, context2.host); + getNewStatementsAndRemoveFromOldFile2(oldFile, targetSourceFile, getUsageInfo(oldFile, toMove.all, checker, getExistingLocals(targetSourceFile, toMove.all, checker)), changes, toMove, program, host, preferences, importAdder); + } + } + function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, changes, toMove, program, host, preferences, importAdder) { + const checker = program.getTypeChecker(); + const prologueDirectives = takeWhile2(oldFile.statements, isPrologueDirective); + if (oldFile.externalModuleIndicator === void 0 && oldFile.commonJsModuleIndicator === void 0 && usage.oldImportsNeededByTargetFile.size === 0 && usage.targetFileImportsFromOldFile.size === 0 && typeof targetFile === "string") { + deleteMovedStatements(oldFile, toMove.ranges, changes); + return [...prologueDirectives, ...toMove.all]; + } + const targetFileName = typeof targetFile === "string" ? targetFile : targetFile.fileName; + const useEsModuleSyntax = !fileShouldUseJavaScriptRequire(targetFileName, program, host, !!oldFile.commonJsModuleIndicator); + const quotePreference = getQuotePreference(oldFile, preferences); + const importsFromTargetFile = createOldFileImportsFromTargetFile(oldFile, usage.oldFileImportsFromTargetFile, targetFileName, program, host, useEsModuleSyntax, quotePreference); + if (importsFromTargetFile) { + insertImports( + changes, + oldFile, + importsFromTargetFile, + /*blankLineBetween*/ + true, + preferences + ); + } + deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker); + deleteMovedStatements(oldFile, toMove.ranges, changes); + updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, targetFileName, quotePreference); + const imports = getTargetFileImportsAndAddExportInOldFile(oldFile, targetFileName, usage.oldImportsNeededByTargetFile, usage.targetFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference, importAdder); + const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax); + if (typeof targetFile !== "string") { + if (targetFile.statements.length > 0) { + moveStatementsToTargetFile(changes, program, body, targetFile, toMove); + } else { + changes.insertNodesAtEndOfFile( + targetFile, + body, + /*blankLineBetween*/ + false + ); + } + if (imports.length > 0) { + insertImports( + changes, + targetFile, + imports, + /*blankLineBetween*/ + true, + preferences + ); + } + } + if (importAdder) { + importAdder.writeFixes(changes, quotePreference); + } + if (imports.length && body.length) { + return [ + ...prologueDirectives, + ...imports, + 4, + ...body + ]; + } + return [ + ...prologueDirectives, + ...imports, + ...body + ]; + } + function getTargetFileImportsAndAddExportInOldFile(oldFile, targetFile, importsToCopy, targetFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference, importAdder) { + const copiedOldImports = []; + if (importAdder) { + importsToCopy.forEach((isValidTypeOnlyUseSite, symbol) => { + try { + importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker), isValidTypeOnlyUseSite); + } catch { + for (const oldStatement of oldFile.statements) { + forEachImportInStatement(oldStatement, (i7) => { + append(copiedOldImports, filterImport(i7, factory.createStringLiteral(moduleSpecifierFromImport(i7).text), (name2) => importsToCopy.has(checker.getSymbolAtLocation(name2)))); + }); + } + } + }); + } else { + const targetSourceFile = program.getSourceFile(targetFile); + for (const oldStatement of oldFile.statements) { + forEachImportInStatement(oldStatement, (i7) => { + var _a2; + const moduleSpecifier = moduleSpecifierFromImport(i7); + const compilerOptions = program.getCompilerOptions(); + const resolved = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier); + const fileName = (_a2 = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a2.resolvedFileName; + if (fileName && targetSourceFile) { + const newModuleSpecifier = getModuleSpecifier(compilerOptions, targetSourceFile, targetSourceFile.fileName, fileName, createModuleSpecifierResolutionHost(program, host)); + append(copiedOldImports, filterImport(i7, makeStringLiteral(newModuleSpecifier, quotePreference), (name2) => importsToCopy.has(checker.getSymbolAtLocation(name2)))); + } else { + append(copiedOldImports, filterImport(i7, factory.createStringLiteral(moduleSpecifierFromImport(i7).text), (name2) => importsToCopy.has(checker.getSymbolAtLocation(name2)))); + } + }); + } + } + const targetFileSourceFile = program.getSourceFile(targetFile); + let oldFileDefault; + const oldFileNamedImports = []; + const markSeenTop = nodeSeenTracker(); + targetFileImportsFromOldFile.forEach((symbol) => { + if (!symbol.declarations) { + return; + } + for (const decl of symbol.declarations) { + if (!isTopLevelDeclaration(decl)) + continue; + const name2 = nameOfTopLevelDeclaration(decl); + if (!name2) + continue; + const top = getTopLevelDeclarationStatement(decl); + if (markSeenTop(top)) { + addExportToChanges(oldFile, top, name2, changes, useEsModuleSyntax); + } + if (importAdder && checker.isUnknownSymbol(symbol)) { + importAdder.addImportFromExportedSymbol(skipAlias(symbol, checker)); + } else { + if (hasSyntacticModifier( + decl, + 2048 + /* Default */ + )) { + oldFileDefault = name2; + } else { + oldFileNamedImports.push(name2.text); + } + } + } + }); + return targetFileSourceFile ? append(copiedOldImports, makeImportOrRequire(targetFileSourceFile, oldFileDefault, oldFileNamedImports, oldFile.fileName, program, host, useEsModuleSyntax, quotePreference)) : append(copiedOldImports, makeImportOrRequire(oldFile, oldFileDefault, oldFileNamedImports, oldFile.fileName, program, host, useEsModuleSyntax, quotePreference)); + } + function addNewFileToTsconfig(program, changes, oldFileName, newFileNameWithExtension, getCanonicalFileName) { + const cfg = program.getCompilerOptions().configFile; + if (!cfg) + return; + const newFileAbsolutePath = normalizePath(combinePaths(oldFileName, "..", newFileNameWithExtension)); + const newFilePath = getRelativePathFromFile(cfg.fileName, newFileAbsolutePath, getCanonicalFileName); + const cfgObject = cfg.statements[0] && tryCast(cfg.statements[0].expression, isObjectLiteralExpression); + const filesProp = cfgObject && find2(cfgObject.properties, (prop) => isPropertyAssignment(prop) && isStringLiteral(prop.name) && prop.name.text === "files"); + if (filesProp && isArrayLiteralExpression(filesProp.initializer)) { + changes.insertNodeInListAfter(cfg, last2(filesProp.initializer.elements), factory.createStringLiteral(newFilePath), filesProp.initializer.elements); + } + } + function deleteMovedStatements(sourceFile, moved, changes) { + for (const { first: first2, afterLast } of moved) { + changes.deleteNodeRangeExcludingEnd(sourceFile, first2, afterLast); + } + } + function deleteUnusedOldImports(oldFile, toMove, changes, toDelete, checker) { + for (const statement of oldFile.statements) { + if (contains2(toMove, statement)) + continue; + forEachImportInStatement(statement, (i7) => deleteUnusedImports(oldFile, i7, changes, (name2) => toDelete.has(checker.getSymbolAtLocation(name2)))); + } + } + function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, targetFileName, quotePreference) { + const checker = program.getTypeChecker(); + for (const sourceFile of program.getSourceFiles()) { + if (sourceFile === oldFile) + continue; + for (const statement of sourceFile.statements) { + forEachImportInStatement(statement, (importNode) => { + if (checker.getSymbolAtLocation(moduleSpecifierFromImport(importNode)) !== oldFile.symbol) + return; + const shouldMove = (name2) => { + const symbol = isBindingElement(name2.parent) ? getPropertySymbolFromBindingElement(checker, name2.parent) : skipAlias(checker.getSymbolAtLocation(name2), checker); + return !!symbol && movedSymbols.has(symbol); + }; + deleteUnusedImports(sourceFile, importNode, changes, shouldMove); + const pathToTargetFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), targetFileName); + const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFileWithExtension, createModuleSpecifierResolutionHost(program, host)); + const newImportDeclaration = filterImport(importNode, makeStringLiteral(newModuleSpecifier, quotePreference), shouldMove); + if (newImportDeclaration) + changes.insertNodeAfter(sourceFile, statement, newImportDeclaration); + const ns = getNamespaceLikeImport(importNode); + if (ns) + updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode, quotePreference); + }); + } + } + } + function getNamespaceLikeImport(node) { + switch (node.kind) { + case 272: + return node.importClause && node.importClause.namedBindings && node.importClause.namedBindings.kind === 274 ? node.importClause.namedBindings.name : void 0; + case 271: + return node.name; + case 260: + return tryCast(node.name, isIdentifier); + default: + return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); + } + } + function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode, quotePreference) { + const preferredNewNamespaceName = ts_codefix_exports.moduleSpecifierToValidIdentifier( + newModuleSpecifier, + 99 + /* ESNext */ + ); + let needUniqueName = false; + const toChange = []; + ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, (ref) => { + if (!isPropertyAccessExpression(ref.parent)) + return; + needUniqueName = needUniqueName || !!checker.resolveName( + preferredNewNamespaceName, + ref, + -1, + /*excludeGlobals*/ + true + ); + if (movedSymbols.has(checker.getSymbolAtLocation(ref.parent.name))) { + toChange.push(ref); + } + }); + if (toChange.length) { + const newNamespaceName = needUniqueName ? getUniqueName(preferredNewNamespaceName, sourceFile) : preferredNewNamespaceName; + for (const ref of toChange) { + changes.replaceNode(sourceFile, ref, factory.createIdentifier(newNamespaceName)); + } + changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier, quotePreference)); + } + } + function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier, quotePreference) { + const newNamespaceId = factory.createIdentifier(newNamespaceName); + const newModuleString = makeStringLiteral(newModuleSpecifier, quotePreference); + switch (node.kind) { + case 272: + return factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + /*name*/ + void 0, + factory.createNamespaceImport(newNamespaceId) + ), + newModuleString, + /*attributes*/ + void 0 + ); + case 271: + return factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + newNamespaceId, + factory.createExternalModuleReference(newModuleString) + ); + case 260: + return factory.createVariableDeclaration( + newNamespaceId, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + createRequireCall(newModuleString) + ); + default: + return Debug.assertNever(node, `Unexpected node kind ${node.kind}`); + } + } + function createRequireCall(moduleSpecifier) { + return factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [moduleSpecifier] + ); + } + function moduleSpecifierFromImport(i7) { + return i7.kind === 272 ? i7.moduleSpecifier : i7.kind === 271 ? i7.moduleReference.expression : i7.initializer.arguments[0]; + } + function forEachImportInStatement(statement, cb) { + if (isImportDeclaration(statement)) { + if (isStringLiteral(statement.moduleSpecifier)) + cb(statement); + } else if (isImportEqualsDeclaration(statement)) { + if (isExternalModuleReference(statement.moduleReference) && isStringLiteralLike(statement.moduleReference.expression)) { + cb(statement); + } + } else if (isVariableStatement(statement)) { + for (const decl of statement.declarationList.declarations) { + if (decl.initializer && isRequireCall( + decl.initializer, + /*requireStringLiteralLikeArgument*/ + true + )) { + cb(decl); + } + } + } + } + function createOldFileImportsFromTargetFile(sourceFile, targetFileNeedExport, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) { + let defaultImport; + const imports = []; + targetFileNeedExport.forEach((symbol) => { + if (symbol.escapedName === "default") { + defaultImport = factory.createIdentifier(symbolNameNoDefault(symbol)); + } else { + imports.push(symbol.name); + } + }); + return makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference); + } + function makeImportOrRequire(sourceFile, defaultImport, imports, targetFileNameWithExtension, program, host, useEs6Imports, quotePreference) { + const pathToTargetFile = resolvePath(getDirectoryPath(sourceFile.path), targetFileNameWithExtension); + const pathToTargetFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.fileName, pathToTargetFile, createModuleSpecifierResolutionHost(program, host)); + if (useEs6Imports) { + const specifiers = imports.map((i7) => factory.createImportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + factory.createIdentifier(i7) + )); + return makeImportIfNecessary(defaultImport, specifiers, pathToTargetFileWithCorrectExtension, quotePreference); + } else { + Debug.assert(!defaultImport, "No default import should exist"); + const bindingElements = imports.map((i7) => factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + i7 + )); + return bindingElements.length ? makeVariableStatement( + factory.createObjectBindingPattern(bindingElements), + /*type*/ + void 0, + createRequireCall(makeStringLiteral(pathToTargetFileWithCorrectExtension, quotePreference)) + ) : void 0; + } + } + function makeVariableStatement(name2, type3, initializer, flags = 2) { + return factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + type3, + initializer + )], flags) + ); + } + function addExports(sourceFile, toMove, needExport, useEs6Exports) { + return flatMap2(toMove, (statement) => { + if (isTopLevelDeclarationStatement(statement) && !isExported(sourceFile, statement, useEs6Exports) && forEachTopLevelDeclaration(statement, (d7) => { + var _a2; + return needExport.has(Debug.checkDefined((_a2 = tryCast(d7, canHaveSymbol)) == null ? void 0 : _a2.symbol)); + })) { + const exports29 = addExport(getSynthesizedDeepClone(statement), useEs6Exports); + if (exports29) + return exports29; + } + return getSynthesizedDeepClone(statement); + }); + } + function isExported(sourceFile, decl, useEs6Exports, name2) { + var _a2; + if (useEs6Exports) { + return !isExpressionStatement(decl) && hasSyntacticModifier( + decl, + 32 + /* Export */ + ) || !!(name2 && sourceFile.symbol && ((_a2 = sourceFile.symbol.exports) == null ? void 0 : _a2.has(name2.escapedText))); + } + return !!sourceFile.symbol && !!sourceFile.symbol.exports && getNamesToExportInCommonJS(decl).some((name22) => sourceFile.symbol.exports.has(escapeLeadingUnderscores(name22))); + } + function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) { + switch (importDecl.kind) { + case 272: + deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused); + break; + case 271: + if (isUnused(importDecl.name)) { + changes.delete(sourceFile, importDecl); + } + break; + case 260: + deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused); + break; + default: + Debug.assertNever(importDecl, `Unexpected import decl kind ${importDecl.kind}`); + } + } + function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) { + if (!importDecl.importClause) + return; + const { name: name2, namedBindings } = importDecl.importClause; + const defaultUnused = !name2 || isUnused(name2); + const namedBindingsUnused = !namedBindings || (namedBindings.kind === 274 ? isUnused(namedBindings.name) : namedBindings.elements.length !== 0 && namedBindings.elements.every((e10) => isUnused(e10.name))); + if (defaultUnused && namedBindingsUnused) { + changes.delete(sourceFile, importDecl); + } else { + if (name2 && defaultUnused) { + changes.delete(sourceFile, name2); + } + if (namedBindings) { + if (namedBindingsUnused) { + changes.replaceNode( + sourceFile, + importDecl.importClause, + factory.updateImportClause( + importDecl.importClause, + importDecl.importClause.isTypeOnly, + name2, + /*namedBindings*/ + void 0 + ) + ); + } else if (namedBindings.kind === 275) { + for (const element of namedBindings.elements) { + if (isUnused(element.name)) + changes.delete(sourceFile, element); + } + } + } + } + } + function deleteUnusedImportsInVariableDeclaration(sourceFile, varDecl, changes, isUnused) { + const { name: name2 } = varDecl; + switch (name2.kind) { + case 80: + if (isUnused(name2)) { + if (varDecl.initializer && isRequireCall( + varDecl.initializer, + /*requireStringLiteralLikeArgument*/ + true + )) { + changes.delete(sourceFile, isVariableDeclarationList(varDecl.parent) && length(varDecl.parent.declarations) === 1 ? varDecl.parent.parent : varDecl); + } else { + changes.delete(sourceFile, name2); + } + } + break; + case 207: + break; + case 206: + if (name2.elements.every((e10) => isIdentifier(e10.name) && isUnused(e10.name))) { + changes.delete(sourceFile, isVariableDeclarationList(varDecl.parent) && varDecl.parent.declarations.length === 1 ? varDecl.parent.parent : varDecl); + } else { + for (const element of name2.elements) { + if (isIdentifier(element.name) && isUnused(element.name)) { + changes.delete(sourceFile, element.name); + } + } + } + break; + } + } + function isTopLevelDeclarationStatement(node) { + Debug.assert(isSourceFile(node.parent), "Node parent should be a SourceFile"); + return isNonVariableTopLevelDeclaration(node) || isVariableStatement(node); + } + function addExport(decl, useEs6Exports) { + return useEs6Exports ? [addEs6Export(decl)] : addCommonjsExport(decl); + } + function addEs6Export(d7) { + const modifiers = canHaveModifiers(d7) ? concatenate([factory.createModifier( + 95 + /* ExportKeyword */ + )], getModifiers(d7)) : void 0; + switch (d7.kind) { + case 262: + return factory.updateFunctionDeclaration(d7, modifiers, d7.asteriskToken, d7.name, d7.typeParameters, d7.parameters, d7.type, d7.body); + case 263: + const decorators = canHaveDecorators(d7) ? getDecorators(d7) : void 0; + return factory.updateClassDeclaration(d7, concatenate(decorators, modifiers), d7.name, d7.typeParameters, d7.heritageClauses, d7.members); + case 243: + return factory.updateVariableStatement(d7, modifiers, d7.declarationList); + case 267: + return factory.updateModuleDeclaration(d7, modifiers, d7.name, d7.body); + case 266: + return factory.updateEnumDeclaration(d7, modifiers, d7.name, d7.members); + case 265: + return factory.updateTypeAliasDeclaration(d7, modifiers, d7.name, d7.typeParameters, d7.type); + case 264: + return factory.updateInterfaceDeclaration(d7, modifiers, d7.name, d7.typeParameters, d7.heritageClauses, d7.members); + case 271: + return factory.updateImportEqualsDeclaration(d7, modifiers, d7.isTypeOnly, d7.name, d7.moduleReference); + case 244: + return Debug.fail(); + default: + return Debug.assertNever(d7, `Unexpected declaration kind ${d7.kind}`); + } + } + function addCommonjsExport(decl) { + return [decl, ...getNamesToExportInCommonJS(decl).map(createExportAssignment)]; + } + function createExportAssignment(name2) { + return factory.createExpressionStatement( + factory.createBinaryExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.createIdentifier(name2)), + 64, + factory.createIdentifier(name2) + ) + ); + } + function getNamesToExportInCommonJS(decl) { + switch (decl.kind) { + case 262: + case 263: + return [decl.name.text]; + case 243: + return mapDefined(decl.declarationList.declarations, (d7) => isIdentifier(d7.name) ? d7.name.text : void 0); + case 267: + case 266: + case 265: + case 264: + case 271: + return emptyArray; + case 244: + return Debug.fail("Can't export an ExpressionStatement"); + default: + return Debug.assertNever(decl, `Unexpected decl kind ${decl.kind}`); + } + } + function filterImport(i7, moduleSpecifier, keep) { + switch (i7.kind) { + case 272: { + const clause = i7.importClause; + if (!clause) + return void 0; + const defaultImport = clause.name && keep(clause.name) ? clause.name : void 0; + const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep); + return defaultImport || namedBindings ? factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), + getSynthesizedDeepClone(moduleSpecifier), + /*attributes*/ + void 0 + ) : void 0; + } + case 271: + return keep(i7.name) ? i7 : void 0; + case 260: { + const name2 = filterBindingName(i7.name, keep); + return name2 ? makeVariableStatement(name2, i7.type, createRequireCall(moduleSpecifier), i7.parent.flags) : void 0; + } + default: + return Debug.assertNever(i7, `Unexpected import kind ${i7.kind}`); + } + } + function filterNamedBindings(namedBindings, keep) { + if (namedBindings.kind === 274) { + return keep(namedBindings.name) ? namedBindings : void 0; + } else { + const newElements = namedBindings.elements.filter((e10) => keep(e10.name)); + return newElements.length ? factory.createNamedImports(newElements) : void 0; + } + } + function filterBindingName(name2, keep) { + switch (name2.kind) { + case 80: + return keep(name2) ? name2 : void 0; + case 207: + return name2; + case 206: { + const newElements = name2.elements.filter((prop) => prop.propertyName || !isIdentifier(prop.name) || keep(prop.name)); + return newElements.length ? factory.createObjectBindingPattern(newElements) : void 0; + } + } + } + function nameOfTopLevelDeclaration(d7) { + return isExpressionStatement(d7) ? tryCast(d7.expression.left.name, isIdentifier) : tryCast(d7.name, isIdentifier); + } + function getTopLevelDeclarationStatement(d7) { + switch (d7.kind) { + case 260: + return d7.parent.parent; + case 208: + return getTopLevelDeclarationStatement( + cast(d7.parent.parent, (p7) => isVariableDeclaration(p7) || isBindingElement(p7)) + ); + default: + return d7; + } + } + function addExportToChanges(sourceFile, decl, name2, changes, useEs6Exports) { + if (isExported(sourceFile, decl, useEs6Exports, name2)) + return; + if (useEs6Exports) { + if (!isExpressionStatement(decl)) + changes.insertExportModifier(sourceFile, decl); + } else { + const names = getNamesToExportInCommonJS(decl); + if (names.length !== 0) + changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment)); + } + } + function createNewFileName(oldFile, program, host, toMove) { + const checker = program.getTypeChecker(); + if (toMove) { + const usage = getUsageInfo(oldFile, toMove.all, checker); + const currentDirectory = getDirectoryPath(oldFile.fileName); + const extension = extensionFromPath(oldFile.fileName); + const newFileName = combinePaths( + // new file is always placed in the same directory as the old file + currentDirectory, + // ensures the filename computed below isn't already taken + makeUniqueFilename( + // infers a name for the new file from the symbols being moved + inferNewFileName(usage.oldFileImportsFromTargetFile, usage.movedSymbols), + extension, + currentDirectory, + host + ) + ) + extension; + return newFileName; + } + return ""; + } + function getRangeToMove(context2) { + const { file } = context2; + const range2 = createTextRangeFromSpan(getRefactorContextSpan(context2)); + const { statements } = file; + let startNodeIndex = findIndex2(statements, (s7) => s7.end > range2.pos); + if (startNodeIndex === -1) + return void 0; + const startStatement = statements[startNodeIndex]; + const overloadRangeToMove = getOverloadRangeToMove(file, startStatement); + if (overloadRangeToMove) { + startNodeIndex = overloadRangeToMove.start; + } + let endNodeIndex = findIndex2(statements, (s7) => s7.end >= range2.end, startNodeIndex); + if (endNodeIndex !== -1 && range2.end <= statements[endNodeIndex].getStart()) { + endNodeIndex--; + } + const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]); + if (endingOverloadRangeToMove) { + endNodeIndex = endingOverloadRangeToMove.end; + } + return { + toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1), + afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1] + }; + } + function getStatementsToMove(context2) { + const rangeToMove = getRangeToMove(context2); + if (rangeToMove === void 0) + return void 0; + const all = []; + const ranges = []; + const { toMove, afterLast } = rangeToMove; + getRangesWhere(toMove, isAllowedStatementToMove, (start, afterEndIndex) => { + for (let i7 = start; i7 < afterEndIndex; i7++) + all.push(toMove[i7]); + ranges.push({ first: toMove[start], afterLast }); + }); + return all.length === 0 ? void 0 : { all, ranges }; + } + function containsJsx(statements) { + return find2(statements, (statement) => !!(statement.transformFlags & 2)); + } + function isAllowedStatementToMove(statement) { + return !isPureImport(statement) && !isPrologueDirective(statement); + } + function isPureImport(node) { + switch (node.kind) { + case 272: + return true; + case 271: + return !hasSyntacticModifier( + node, + 32 + /* Export */ + ); + case 243: + return node.declarationList.declarations.every((d7) => !!d7.initializer && isRequireCall( + d7.initializer, + /*requireStringLiteralLikeArgument*/ + true + )); + default: + return false; + } + } + function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PURE__ */ new Set()) { + const movedSymbols = /* @__PURE__ */ new Set(); + const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map(); + const targetFileImportsFromOldFile = /* @__PURE__ */ new Set(); + const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx(toMove)); + if (jsxNamespaceSymbol) { + oldImportsNeededByTargetFile.set(jsxNamespaceSymbol, false); + } + for (const statement of toMove) { + forEachTopLevelDeclaration(statement, (decl) => { + movedSymbols.add(Debug.checkDefined(isExpressionStatement(decl) ? checker.getSymbolAtLocation(decl.expression.left) : decl.symbol, "Need a symbol here")); + }); + } + const unusedImportsFromOldFile = /* @__PURE__ */ new Set(); + for (const statement of toMove) { + forEachReference(statement, checker, (symbol, isValidTypeOnlyUseSite) => { + if (!symbol.declarations) { + return; + } + if (existingTargetLocals.has(skipAlias(symbol, checker))) { + unusedImportsFromOldFile.add(symbol); + return; + } + for (const decl of symbol.declarations) { + if (isInImport(decl)) { + const prevIsTypeOnly = oldImportsNeededByTargetFile.get(symbol); + oldImportsNeededByTargetFile.set(symbol, prevIsTypeOnly === void 0 ? isValidTypeOnlyUseSite : prevIsTypeOnly && isValidTypeOnlyUseSite); + } else if (isTopLevelDeclaration(decl) && sourceFileOfTopLevelDeclaration(decl) === oldFile && !movedSymbols.has(symbol)) { + targetFileImportsFromOldFile.add(symbol); + } + } + }); + } + for (const unusedImport of oldImportsNeededByTargetFile.keys()) { + unusedImportsFromOldFile.add(unusedImport); + } + const oldFileImportsFromTargetFile = /* @__PURE__ */ new Set(); + for (const statement of oldFile.statements) { + if (contains2(toMove, statement)) + continue; + if (jsxNamespaceSymbol && !!(statement.transformFlags & 2)) { + unusedImportsFromOldFile.delete(jsxNamespaceSymbol); + } + forEachReference(statement, checker, (symbol) => { + if (movedSymbols.has(symbol)) + oldFileImportsFromTargetFile.add(symbol); + unusedImportsFromOldFile.delete(symbol); + }); + } + return { movedSymbols, targetFileImportsFromOldFile, oldFileImportsFromTargetFile, oldImportsNeededByTargetFile, unusedImportsFromOldFile }; + function getJsxNamespaceSymbol(containsJsx2) { + if (containsJsx2 === void 0) { + return void 0; + } + const jsxNamespace = checker.getJsxNamespace(containsJsx2); + const jsxNamespaceSymbol2 = checker.resolveName( + jsxNamespace, + containsJsx2, + 1920, + /*excludeGlobals*/ + true + ); + return !!jsxNamespaceSymbol2 && some2(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0; + } + } + function makeUniqueFilename(proposedFilename, extension, inDirectory, host) { + let newFilename = proposedFilename; + for (let i7 = 1; ; i7++) { + const name2 = combinePaths(inDirectory, newFilename + extension); + if (!host.fileExists(name2)) + return newFilename; + newFilename = `${proposedFilename}.${i7}`; + } + } + function inferNewFileName(importsFromNewFile, movedSymbols) { + return forEachKey(importsFromNewFile, symbolNameNoDefault) || forEachKey(movedSymbols, symbolNameNoDefault) || "newFile"; + } + function forEachReference(node, checker, onReference) { + node.forEachChild(function cb(node2) { + if (isIdentifier(node2) && !isDeclarationName(node2)) { + const sym = checker.getSymbolAtLocation(node2); + if (sym) + onReference(sym, isValidTypeOnlyAliasUseSite(node2)); + } else { + node2.forEachChild(cb); + } + }); + } + function forEachTopLevelDeclaration(statement, cb) { + switch (statement.kind) { + case 262: + case 263: + case 267: + case 266: + case 265: + case 264: + case 271: + return cb(statement); + case 243: + return firstDefined(statement.declarationList.declarations, (decl) => forEachTopLevelDeclarationInBindingName(decl.name, cb)); + case 244: { + const { expression } = statement; + return isBinaryExpression(expression) && getAssignmentDeclarationKind(expression) === 1 ? cb(statement) : void 0; + } + } + } + function isInImport(decl) { + switch (decl.kind) { + case 271: + case 276: + case 273: + case 274: + return true; + case 260: + return isVariableDeclarationInImport(decl); + case 208: + return isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent); + default: + return false; + } + } + function isVariableDeclarationInImport(decl) { + return isSourceFile(decl.parent.parent.parent) && !!decl.initializer && isRequireCall( + decl.initializer, + /*requireStringLiteralLikeArgument*/ + true + ); + } + function isTopLevelDeclaration(node) { + return isNonVariableTopLevelDeclaration(node) && isSourceFile(node.parent) || isVariableDeclaration(node) && isSourceFile(node.parent.parent.parent); + } + function sourceFileOfTopLevelDeclaration(node) { + return isVariableDeclaration(node) ? node.parent.parent.parent : node.parent; + } + function forEachTopLevelDeclarationInBindingName(name2, cb) { + switch (name2.kind) { + case 80: + return cb(cast(name2.parent, (x7) => isVariableDeclaration(x7) || isBindingElement(x7))); + case 207: + case 206: + return firstDefined(name2.elements, (em) => isOmittedExpression(em) ? void 0 : forEachTopLevelDeclarationInBindingName(em.name, cb)); + default: + return Debug.assertNever(name2, `Unexpected name kind ${name2.kind}`); + } + } + function isNonVariableTopLevelDeclaration(node) { + switch (node.kind) { + case 262: + case 263: + case 267: + case 266: + case 265: + case 264: + case 271: + return true; + default: + return false; + } + } + function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) { + var _a2; + const removedExports = /* @__PURE__ */ new Set(); + const targetExports = (_a2 = targetFile.symbol) == null ? void 0 : _a2.exports; + if (targetExports) { + const checker = program.getTypeChecker(); + const targetToSourceExports = /* @__PURE__ */ new Map(); + for (const node of toMove.all) { + if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier( + node, + 32 + /* Export */ + )) { + forEachTopLevelDeclaration(node, (declaration) => { + var _a22; + const targetDeclarations = canHaveSymbol(declaration) ? (_a22 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a22.declarations : void 0; + const exportDeclaration = firstDefined(targetDeclarations, (d7) => isExportDeclaration(d7) ? d7 : isExportSpecifier(d7) ? tryCast(d7.parent.parent, isExportDeclaration) : void 0); + if (exportDeclaration && exportDeclaration.moduleSpecifier) { + targetToSourceExports.set(exportDeclaration, (targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)); + } + }); + } + } + for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) { + if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) { + const elements = exportDeclaration.exportClause.elements; + const updatedElements = filter2(elements, (elem) => find2(skipAlias(elem.symbol, checker).declarations, (d7) => isTopLevelDeclaration(d7) && topLevelDeclarations.has(d7)) === void 0); + if (length(updatedElements) === 0) { + changes.deleteNode(targetFile, exportDeclaration); + removedExports.add(exportDeclaration); + continue; + } + if (length(updatedElements) < length(elements)) { + changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes)); + } + } + } + } + const lastReExport = findLast2(targetFile.statements, (n7) => isExportDeclaration(n7) && !!n7.moduleSpecifier && !removedExports.has(n7)); + if (lastReExport) { + changes.insertNodesBefore( + targetFile, + lastReExport, + statements, + /*blankLineBetween*/ + true + ); + } else { + changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements); + } + } + function getOverloadRangeToMove(sourceFile, statement) { + if (isFunctionLikeDeclaration(statement)) { + const declarations = statement.symbol.declarations; + if (declarations === void 0 || length(declarations) <= 1 || !contains2(declarations, statement)) { + return void 0; + } + const firstDecl = declarations[0]; + const lastDecl = declarations[length(declarations) - 1]; + const statementsToMove = mapDefined(declarations, (d7) => getSourceFileOfNode(d7) === sourceFile && isStatement(d7) ? d7 : void 0); + const end = findIndex2(sourceFile.statements, (s7) => s7.end >= lastDecl.end); + const start = findIndex2(sourceFile.statements, (s7) => s7.end >= firstDecl.end); + return { toMove: statementsToMove, start, end }; + } + return void 0; + } + function getExistingLocals(sourceFile, statements, checker) { + const existingLocals = /* @__PURE__ */ new Set(); + for (const moduleSpecifier of sourceFile.imports) { + const declaration = importFromModuleSpecifier(moduleSpecifier); + if (isImportDeclaration(declaration) && declaration.importClause && declaration.importClause.namedBindings && isNamedImports(declaration.importClause.namedBindings)) { + for (const e10 of declaration.importClause.namedBindings.elements) { + const symbol = checker.getSymbolAtLocation(e10.propertyName || e10.name); + if (symbol) { + existingLocals.add(skipAlias(symbol, checker)); + } + } + } + if (isVariableDeclarationInitializedToRequire(declaration.parent) && isObjectBindingPattern(declaration.parent.name)) { + for (const e10 of declaration.parent.name.elements) { + const symbol = checker.getSymbolAtLocation(e10.propertyName || e10.name); + if (symbol) { + existingLocals.add(skipAlias(symbol, checker)); + } + } + } + } + for (const statement of statements) { + forEachReference(statement, checker, (s7) => { + const symbol = skipAlias(s7, checker); + if (symbol.valueDeclaration && getSourceFileOfNode(symbol.valueDeclaration) === sourceFile) { + existingLocals.add(symbol); + } + }); + } + return existingLocals; + } + var refactorNameForMoveToFile, description22, moveToFileAction; + var init_moveToFile = __esm2({ + "src/services/refactors/moveToFile.ts"() { + "use strict"; + init_moduleSpecifiers(); + init_ts4(); + init_refactorProvider(); + refactorNameForMoveToFile = "Move to file"; + description22 = getLocaleSpecificMessage(Diagnostics.Move_to_file); + moveToFileAction = { + name: "Move to file", + description: description22, + kind: "refactor.move.file" + }; + registerRefactor(refactorNameForMoveToFile, { + kinds: [moveToFileAction.kind], + getAvailableActions: function getRefactorActionsToMoveToFile(context2, interactiveRefactorArguments) { + const statements = getStatementsToMove(context2); + if (!interactiveRefactorArguments) { + return emptyArray; + } + if (context2.preferences.allowTextChangesInNewFiles && statements) { + return [{ name: refactorNameForMoveToFile, description: description22, actions: [moveToFileAction] }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ name: refactorNameForMoveToFile, description: description22, actions: [{ ...moveToFileAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_statement_or_statements) }] }]; + } + return emptyArray; + }, + getEditsForAction: function getRefactorEditsToMoveToFile(context2, actionName2, interactiveRefactorArguments) { + Debug.assert(actionName2 === refactorNameForMoveToFile, "Wrong refactor invoked"); + const statements = Debug.checkDefined(getStatementsToMove(context2)); + const { host, program } = context2; + Debug.assert(interactiveRefactorArguments, "No interactive refactor arguments available"); + const targetFile = interactiveRefactorArguments.targetFile; + if (hasJSFileExtension(targetFile) || hasTSFileExtension(targetFile)) { + if (host.fileExists(targetFile) && program.getSourceFile(targetFile) === void 0) { + return error2(getLocaleSpecificMessage(Diagnostics.Cannot_move_statements_to_the_selected_file)); + } + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange4(context2, context2.file, interactiveRefactorArguments.targetFile, context2.program, statements, t8, context2.host, context2.preferences)); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + return error2(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid)); + } + }); + } + }); + function getRefactorActionsToConvertOverloadsToOneSignature(context2) { + const { file, startPosition, program } = context2; + const info2 = getConvertableOverloadListAtPosition(file, startPosition, program); + if (!info2) + return emptyArray; + return [{ + name: refactorName6, + description: refactorDescription2, + actions: [functionOverloadAction] + }]; + } + function getRefactorEditsToConvertOverloadsToOneSignature(context2) { + const { file, startPosition, program } = context2; + const signatureDecls = getConvertableOverloadListAtPosition(file, startPosition, program); + if (!signatureDecls) + return void 0; + const checker = program.getTypeChecker(); + const lastDeclaration = signatureDecls[signatureDecls.length - 1]; + let updated = lastDeclaration; + switch (lastDeclaration.kind) { + case 173: { + updated = factory.updateMethodSignature( + lastDeclaration, + lastDeclaration.modifiers, + lastDeclaration.name, + lastDeclaration.questionToken, + lastDeclaration.typeParameters, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.type + ); + break; + } + case 174: { + updated = factory.updateMethodDeclaration( + lastDeclaration, + lastDeclaration.modifiers, + lastDeclaration.asteriskToken, + lastDeclaration.name, + lastDeclaration.questionToken, + lastDeclaration.typeParameters, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.type, + lastDeclaration.body + ); + break; + } + case 179: { + updated = factory.updateCallSignature( + lastDeclaration, + lastDeclaration.typeParameters, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.type + ); + break; + } + case 176: { + updated = factory.updateConstructorDeclaration( + lastDeclaration, + lastDeclaration.modifiers, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.body + ); + break; + } + case 180: { + updated = factory.updateConstructSignature( + lastDeclaration, + lastDeclaration.typeParameters, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.type + ); + break; + } + case 262: { + updated = factory.updateFunctionDeclaration( + lastDeclaration, + lastDeclaration.modifiers, + lastDeclaration.asteriskToken, + lastDeclaration.name, + lastDeclaration.typeParameters, + getNewParametersForCombinedSignature(signatureDecls), + lastDeclaration.type, + lastDeclaration.body + ); + break; + } + default: + return Debug.failBadSyntaxKind(lastDeclaration, "Unhandled signature kind in overload list conversion refactoring"); + } + if (updated === lastDeclaration) { + return; + } + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + t8.replaceNodeRange(file, signatureDecls[0], signatureDecls[signatureDecls.length - 1], updated); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + function getNewParametersForCombinedSignature(signatureDeclarations) { + const lastSig = signatureDeclarations[signatureDeclarations.length - 1]; + if (isFunctionLikeDeclaration(lastSig) && lastSig.body) { + signatureDeclarations = signatureDeclarations.slice(0, signatureDeclarations.length - 1); + } + return factory.createNodeArray([ + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + factory.createToken( + 26 + /* DotDotDotToken */ + ), + "args", + /*questionToken*/ + void 0, + factory.createUnionTypeNode(map4(signatureDeclarations, convertSignatureParametersToTuple)) + ) + ]); + } + function convertSignatureParametersToTuple(decl) { + const members = map4(decl.parameters, convertParameterToNamedTupleMember); + return setEmitFlags( + factory.createTupleTypeNode(members), + some2(members, (m7) => !!length(getSyntheticLeadingComments(m7))) ? 0 : 1 + /* SingleLine */ + ); + } + function convertParameterToNamedTupleMember(p7) { + Debug.assert(isIdentifier(p7.name)); + const result2 = setTextRange( + factory.createNamedTupleMember( + p7.dotDotDotToken, + p7.name, + p7.questionToken, + p7.type || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ), + p7 + ); + const parameterDocComment = p7.symbol && p7.symbol.getDocumentationComment(checker); + if (parameterDocComment) { + const newComment = displayPartsToString(parameterDocComment); + if (newComment.length) { + setSyntheticLeadingComments(result2, [{ + text: `* +${newComment.split("\n").map((c7) => ` * ${c7}`).join("\n")} + `, + kind: 3, + pos: -1, + end: -1, + hasTrailingNewLine: true, + hasLeadingNewline: true + }]); + } + } + return result2; + } + } + function isConvertableSignatureDeclaration(d7) { + switch (d7.kind) { + case 173: + case 174: + case 179: + case 176: + case 180: + case 262: + return true; + } + return false; + } + function getConvertableOverloadListAtPosition(file, startPosition, program) { + const node = getTokenAtPosition(file, startPosition); + const containingDecl = findAncestor(node, isConvertableSignatureDeclaration); + if (!containingDecl) { + return; + } + if (isFunctionLikeDeclaration(containingDecl) && containingDecl.body && rangeContainsPosition(containingDecl.body, startPosition)) { + return; + } + const checker = program.getTypeChecker(); + const signatureSymbol = containingDecl.symbol; + if (!signatureSymbol) { + return; + } + const decls = signatureSymbol.declarations; + if (length(decls) <= 1) { + return; + } + if (!every2(decls, (d7) => getSourceFileOfNode(d7) === file)) { + return; + } + if (!isConvertableSignatureDeclaration(decls[0])) { + return; + } + const kindOne = decls[0].kind; + if (!every2(decls, (d7) => d7.kind === kindOne)) { + return; + } + const signatureDecls = decls; + if (some2(signatureDecls, (d7) => !!d7.typeParameters || some2(d7.parameters, (p7) => !!p7.modifiers || !isIdentifier(p7.name)))) { + return; + } + const signatures = mapDefined(signatureDecls, (d7) => checker.getSignatureFromDeclaration(d7)); + if (length(signatures) !== length(decls)) { + return; + } + const returnOne = checker.getReturnTypeOfSignature(signatures[0]); + if (!every2(signatures, (s7) => checker.getReturnTypeOfSignature(s7) === returnOne)) { + return; + } + return signatureDecls; + } + var refactorName6, refactorDescription2, functionOverloadAction; + var init_convertOverloadListToSingleSignature = __esm2({ + "src/services/refactors/convertOverloadListToSingleSignature.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName6 = "Convert overload list to single signature"; + refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature); + functionOverloadAction = { + name: refactorName6, + description: refactorDescription2, + kind: "refactor.rewrite.function.overloadList" + }; + registerRefactor(refactorName6, { + kinds: [functionOverloadAction.kind], + getEditsForAction: getRefactorEditsToConvertOverloadsToOneSignature, + getAvailableActions: getRefactorActionsToConvertOverloadsToOneSignature + }); + } + }); + function getRefactorActionsToRemoveFunctionBraces(context2) { + const { file, startPosition, triggerReason } = context2; + const info2 = getConvertibleArrowFunctionAtPosition(file, startPosition, triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + return [{ + name: refactorName7, + description: refactorDescription3, + actions: [ + info2.addBraces ? addBracesAction : removeBracesAction + ] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName7, + description: refactorDescription3, + actions: [ + { ...addBracesAction, notApplicableReason: info2.error }, + { ...removeBracesAction, notApplicableReason: info2.error } + ] + }]; + } + return emptyArray; + } + function getRefactorEditsToRemoveFunctionBraces(context2, actionName2) { + const { file, startPosition } = context2; + const info2 = getConvertibleArrowFunctionAtPosition(file, startPosition); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected applicable refactor info"); + const { expression, returnStatement, func } = info2; + let body; + if (actionName2 === addBracesAction.name) { + const returnStatement2 = factory.createReturnStatement(expression); + body = factory.createBlock( + [returnStatement2], + /*multiLine*/ + true + ); + copyLeadingComments( + expression, + returnStatement2, + file, + 3, + /*hasTrailingNewLine*/ + true + ); + } else if (actionName2 === removeBracesAction.name && returnStatement) { + const actualExpression = expression || factory.createVoidZero(); + body = needsParentheses(actualExpression) ? factory.createParenthesizedExpression(actualExpression) : actualExpression; + copyTrailingAsLeadingComments( + returnStatement, + body, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + copyLeadingComments( + returnStatement, + body, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + copyTrailingComments( + returnStatement, + body, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + } else { + Debug.fail("invalid action"); + } + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + t8.replaceNode(file, func.body, body); + }); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + function getConvertibleArrowFunctionAtPosition(file, startPosition, considerFunctionBodies = true, kind) { + const node = getTokenAtPosition(file, startPosition); + const func = getContainingFunction(node); + if (!func) { + return { + error: getLocaleSpecificMessage(Diagnostics.Could_not_find_a_containing_arrow_function) + }; + } + if (!isArrowFunction(func)) { + return { + error: getLocaleSpecificMessage(Diagnostics.Containing_function_is_not_an_arrow_function) + }; + } + if (!rangeContainsRange(func, node) || rangeContainsRange(func.body, node) && !considerFunctionBodies) { + return void 0; + } + if (refactorKindBeginsWith(addBracesAction.kind, kind) && isExpression(func.body)) { + return { func, addBraces: true, expression: func.body }; + } else if (refactorKindBeginsWith(removeBracesAction.kind, kind) && isBlock2(func.body) && func.body.statements.length === 1) { + const firstStatement = first(func.body.statements); + if (isReturnStatement(firstStatement)) { + const expression = firstStatement.expression && isObjectLiteralExpression(getLeftmostExpression( + firstStatement.expression, + /*stopAtCallExpressions*/ + false + )) ? factory.createParenthesizedExpression(firstStatement.expression) : firstStatement.expression; + return { func, addBraces: false, expression, returnStatement: firstStatement }; + } + } + return void 0; + } + var refactorName7, refactorDescription3, addBracesAction, removeBracesAction; + var init_addOrRemoveBracesToArrowFunction = __esm2({ + "src/services/refactors/addOrRemoveBracesToArrowFunction.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName7 = "Add or remove braces in an arrow function"; + refactorDescription3 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function); + addBracesAction = { + name: "Add braces to arrow function", + description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function), + kind: "refactor.rewrite.arrow.braces.add" + }; + removeBracesAction = { + name: "Remove braces from arrow function", + description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function), + kind: "refactor.rewrite.arrow.braces.remove" + }; + registerRefactor(refactorName7, { + kinds: [removeBracesAction.kind], + getEditsForAction: getRefactorEditsToRemoveFunctionBraces, + getAvailableActions: getRefactorActionsToRemoveFunctionBraces + }); + } + }); + var ts_refactor_addOrRemoveBracesToArrowFunction_exports = {}; + var init_ts_refactor_addOrRemoveBracesToArrowFunction = __esm2({ + "src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts"() { + "use strict"; + init_convertOverloadListToSingleSignature(); + init_addOrRemoveBracesToArrowFunction(); + } + }); + function getRefactorActionsToConvertFunctionExpressions(context2) { + const { file, startPosition, program, kind } = context2; + const info2 = getFunctionInfo(file, startPosition, program); + if (!info2) + return emptyArray; + const { selectedVariableDeclaration, func } = info2; + const possibleActions = []; + const errors = []; + if (refactorKindBeginsWith(toNamedFunctionAction.kind, kind)) { + const error22 = selectedVariableDeclaration || isArrowFunction(func) && isVariableDeclaration(func.parent) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_named_function); + if (error22) { + errors.push({ ...toNamedFunctionAction, notApplicableReason: error22 }); + } else { + possibleActions.push(toNamedFunctionAction); + } + } + if (refactorKindBeginsWith(toAnonymousFunctionAction.kind, kind)) { + const error22 = !selectedVariableDeclaration && isArrowFunction(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_anonymous_function); + if (error22) { + errors.push({ ...toAnonymousFunctionAction, notApplicableReason: error22 }); + } else { + possibleActions.push(toAnonymousFunctionAction); + } + } + if (refactorKindBeginsWith(toArrowFunctionAction.kind, kind)) { + const error22 = isFunctionExpression(func) ? void 0 : getLocaleSpecificMessage(Diagnostics.Could_not_convert_to_arrow_function); + if (error22) { + errors.push({ ...toArrowFunctionAction, notApplicableReason: error22 }); + } else { + possibleActions.push(toArrowFunctionAction); + } + } + return [{ + name: refactorName8, + description: refactorDescription4, + actions: possibleActions.length === 0 && context2.preferences.provideRefactorNotApplicableReason ? errors : possibleActions + }]; + } + function getRefactorEditsToConvertFunctionExpressions(context2, actionName2) { + const { file, startPosition, program } = context2; + const info2 = getFunctionInfo(file, startPosition, program); + if (!info2) + return void 0; + const { func } = info2; + const edits = []; + switch (actionName2) { + case toAnonymousFunctionAction.name: + edits.push(...getEditInfoForConvertToAnonymousFunction(context2, func)); + break; + case toNamedFunctionAction.name: + const variableInfo = getVariableInfo(func); + if (!variableInfo) + return void 0; + edits.push(...getEditInfoForConvertToNamedFunction(context2, func, variableInfo)); + break; + case toArrowFunctionAction.name: + if (!isFunctionExpression(func)) + return void 0; + edits.push(...getEditInfoForConvertToArrowFunction(context2, func)); + break; + default: + return Debug.fail("invalid action"); + } + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + function containingThis(node) { + let containsThis = false; + node.forEachChild(function checkThis(child) { + if (isThis(child)) { + containsThis = true; + return; + } + if (!isClassLike(child) && !isFunctionDeclaration(child) && !isFunctionExpression(child)) { + forEachChild(child, checkThis); + } + }); + return containsThis; + } + function getFunctionInfo(file, startPosition, program) { + const token = getTokenAtPosition(file, startPosition); + const typeChecker = program.getTypeChecker(); + const func = tryGetFunctionFromVariableDeclaration(file, typeChecker, token.parent); + if (func && !containingThis(func.body) && !typeChecker.containsArgumentsReference(func)) { + return { selectedVariableDeclaration: true, func }; + } + const maybeFunc = getContainingFunction(token); + if (maybeFunc && (isFunctionExpression(maybeFunc) || isArrowFunction(maybeFunc)) && !rangeContainsRange(maybeFunc.body, token) && !containingThis(maybeFunc.body) && !typeChecker.containsArgumentsReference(maybeFunc)) { + if (isFunctionExpression(maybeFunc) && isFunctionReferencedInFile(file, typeChecker, maybeFunc)) + return void 0; + return { selectedVariableDeclaration: false, func: maybeFunc }; + } + return void 0; + } + function isSingleVariableDeclaration(parent22) { + return isVariableDeclaration(parent22) || isVariableDeclarationList(parent22) && parent22.declarations.length === 1; + } + function tryGetFunctionFromVariableDeclaration(sourceFile, typeChecker, parent22) { + if (!isSingleVariableDeclaration(parent22)) { + return void 0; + } + const variableDeclaration = isVariableDeclaration(parent22) ? parent22 : first(parent22.declarations); + const initializer = variableDeclaration.initializer; + if (initializer && (isArrowFunction(initializer) || isFunctionExpression(initializer) && !isFunctionReferencedInFile(sourceFile, typeChecker, initializer))) { + return initializer; + } + return void 0; + } + function convertToBlock(body) { + if (isExpression(body)) { + const returnStatement = factory.createReturnStatement(body); + const file = body.getSourceFile(); + setTextRange(returnStatement, body); + suppressLeadingAndTrailingTrivia(returnStatement); + copyTrailingAsLeadingComments( + body, + returnStatement, + file, + /*commentKind*/ + void 0, + /*hasTrailingNewLine*/ + true + ); + return factory.createBlock( + [returnStatement], + /*multiLine*/ + true + ); + } else { + return body; + } + } + function getVariableInfo(func) { + const variableDeclaration = func.parent; + if (!isVariableDeclaration(variableDeclaration) || !isVariableDeclarationInVariableStatement(variableDeclaration)) + return void 0; + const variableDeclarationList = variableDeclaration.parent; + const statement = variableDeclarationList.parent; + if (!isVariableDeclarationList(variableDeclarationList) || !isVariableStatement(statement) || !isIdentifier(variableDeclaration.name)) + return void 0; + return { variableDeclaration, variableDeclarationList, statement, name: variableDeclaration.name }; + } + function getEditInfoForConvertToAnonymousFunction(context2, func) { + const { file } = context2; + const body = convertToBlock(func.body); + const newNode = factory.createFunctionExpression( + func.modifiers, + func.asteriskToken, + /*name*/ + void 0, + func.typeParameters, + func.parameters, + func.type, + body + ); + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(file, func, newNode)); + } + function getEditInfoForConvertToNamedFunction(context2, func, variableInfo) { + const { file } = context2; + const body = convertToBlock(func.body); + const { variableDeclaration, variableDeclarationList, statement, name: name2 } = variableInfo; + suppressLeadingTrivia(statement); + const modifiersFlags = getCombinedModifierFlags(variableDeclaration) & 32 | getEffectiveModifierFlags(func); + const modifiers = factory.createModifiersFromModifierFlags(modifiersFlags); + const newNode = factory.createFunctionDeclaration(length(modifiers) ? modifiers : void 0, func.asteriskToken, name2, func.typeParameters, func.parameters, func.type, body); + if (variableDeclarationList.declarations.length === 1) { + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(file, statement, newNode)); + } else { + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + t8.delete(file, variableDeclaration); + t8.insertNodeAfter(file, statement, newNode); + }); + } + } + function getEditInfoForConvertToArrowFunction(context2, func) { + const { file } = context2; + const statements = func.body.statements; + const head2 = statements[0]; + let body; + if (canBeConvertedToExpression(func.body, head2)) { + body = head2.expression; + suppressLeadingAndTrailingTrivia(body); + copyComments(head2, body); + } else { + body = func.body; + } + const newNode = factory.createArrowFunction(func.modifiers, func.typeParameters, func.parameters, func.type, factory.createToken( + 39 + /* EqualsGreaterThanToken */ + ), body); + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(file, func, newNode)); + } + function canBeConvertedToExpression(body, head2) { + return body.statements.length === 1 && (isReturnStatement(head2) && !!head2.expression); + } + function isFunctionReferencedInFile(sourceFile, typeChecker, node) { + return !!node.name && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(node.name, typeChecker, sourceFile); + } + var refactorName8, refactorDescription4, toAnonymousFunctionAction, toNamedFunctionAction, toArrowFunctionAction; + var init_convertArrowFunctionOrFunctionExpression = __esm2({ + "src/services/refactors/convertArrowFunctionOrFunctionExpression.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName8 = "Convert arrow function or function expression"; + refactorDescription4 = getLocaleSpecificMessage(Diagnostics.Convert_arrow_function_or_function_expression); + toAnonymousFunctionAction = { + name: "Convert to anonymous function", + description: getLocaleSpecificMessage(Diagnostics.Convert_to_anonymous_function), + kind: "refactor.rewrite.function.anonymous" + }; + toNamedFunctionAction = { + name: "Convert to named function", + description: getLocaleSpecificMessage(Diagnostics.Convert_to_named_function), + kind: "refactor.rewrite.function.named" + }; + toArrowFunctionAction = { + name: "Convert to arrow function", + description: getLocaleSpecificMessage(Diagnostics.Convert_to_arrow_function), + kind: "refactor.rewrite.function.arrow" + }; + registerRefactor(refactorName8, { + kinds: [ + toAnonymousFunctionAction.kind, + toNamedFunctionAction.kind, + toArrowFunctionAction.kind + ], + getEditsForAction: getRefactorEditsToConvertFunctionExpressions, + getAvailableActions: getRefactorActionsToConvertFunctionExpressions + }); + } + }); + var ts_refactor_convertArrowFunctionOrFunctionExpression_exports = {}; + var init_ts_refactor_convertArrowFunctionOrFunctionExpression = __esm2({ + "src/services/_namespaces/ts.refactor.convertArrowFunctionOrFunctionExpression.ts"() { + "use strict"; + init_convertArrowFunctionOrFunctionExpression(); + } + }); + function getRefactorActionsToConvertParametersToDestructuredObject(context2) { + const { file, startPosition } = context2; + const isJSFile = isSourceFileJS(file); + if (isJSFile) + return emptyArray; + const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, context2.program.getTypeChecker()); + if (!functionDeclaration) + return emptyArray; + return [{ + name: refactorName9, + description: refactorDescription5, + actions: [toDestructuredAction] + }]; + } + function getRefactorEditsToConvertParametersToDestructuredObject(context2, actionName2) { + Debug.assert(actionName2 === refactorName9, "Unexpected action name"); + const { file, startPosition, program, cancellationToken, host } = context2; + const functionDeclaration = getFunctionDeclarationAtPosition(file, startPosition, program.getTypeChecker()); + if (!functionDeclaration || !cancellationToken) + return void 0; + const groupedReferences = getGroupedReferences(functionDeclaration, program, cancellationToken); + if (groupedReferences.valid) { + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange5(file, program, host, t8, functionDeclaration, groupedReferences)); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + return { edits: [] }; + } + function doChange5(sourceFile, program, host, changes, functionDeclaration, groupedReferences) { + const signature = groupedReferences.signature; + const newFunctionDeclarationParams = map4(createNewParameters(functionDeclaration, program, host), (param) => getSynthesizedDeepClone(param)); + if (signature) { + const newSignatureParams = map4(createNewParameters(signature, program, host), (param) => getSynthesizedDeepClone(param)); + replaceParameters(signature, newSignatureParams); + } + replaceParameters(functionDeclaration, newFunctionDeclarationParams); + const functionCalls = sortAndDeduplicate( + groupedReferences.functionCalls, + /*comparer*/ + (a7, b8) => compareValues(a7.pos, b8.pos) + ); + for (const call of functionCalls) { + if (call.arguments && call.arguments.length) { + const newArgument = getSynthesizedDeepClone( + createNewArgument(functionDeclaration, call.arguments), + /*includeTrivia*/ + true + ); + changes.replaceNodeRange( + getSourceFileOfNode(call), + first(call.arguments), + last2(call.arguments), + newArgument, + { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include } + ); + } + } + function replaceParameters(declarationOrSignature, parameterDeclarations) { + changes.replaceNodeRangeWithNodes( + sourceFile, + first(declarationOrSignature.parameters), + last2(declarationOrSignature.parameters), + parameterDeclarations, + { + joiner: ", ", + // indentation is set to 0 because otherwise the object parameter will be indented if there is a `this` parameter + indentation: 0, + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include + } + ); + } + } + function getGroupedReferences(functionDeclaration, program, cancellationToken) { + const functionNames = getFunctionNames(functionDeclaration); + const classNames = isConstructorDeclaration(functionDeclaration) ? getClassNames(functionDeclaration) : []; + const names = deduplicate([...functionNames, ...classNames], equateValues); + const checker = program.getTypeChecker(); + const references = flatMap2( + names, + /*mapfn*/ + (name2) => ts_FindAllReferences_exports.getReferenceEntriesForNode(-1, name2, program, program.getSourceFiles(), cancellationToken) + ); + const groupedReferences = groupReferences(references); + if (!every2( + groupedReferences.declarations, + /*callback*/ + (decl) => contains2(names, decl) + )) { + groupedReferences.valid = false; + } + return groupedReferences; + function groupReferences(referenceEntries) { + const classReferences = { accessExpressions: [], typeUsages: [] }; + const groupedReferences2 = { functionCalls: [], declarations: [], classReferences, valid: true }; + const functionSymbols = map4(functionNames, getSymbolTargetAtLocation); + const classSymbols = map4(classNames, getSymbolTargetAtLocation); + const isConstructor = isConstructorDeclaration(functionDeclaration); + const contextualSymbols = map4(functionNames, (name2) => getSymbolForContextualType(name2, checker)); + for (const entry of referenceEntries) { + if (entry.kind === ts_FindAllReferences_exports.EntryKind.Span) { + groupedReferences2.valid = false; + continue; + } + if (contains2(contextualSymbols, getSymbolTargetAtLocation(entry.node))) { + if (isValidMethodSignature(entry.node.parent)) { + groupedReferences2.signature = entry.node.parent; + continue; + } + const call = entryToFunctionCall(entry); + if (call) { + groupedReferences2.functionCalls.push(call); + continue; + } + } + const contextualSymbol = getSymbolForContextualType(entry.node, checker); + if (contextualSymbol && contains2(contextualSymbols, contextualSymbol)) { + const decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + } + if (contains2(functionSymbols, getSymbolTargetAtLocation(entry.node)) || isNewExpressionTarget(entry.node)) { + const importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } + const decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + const call = entryToFunctionCall(entry); + if (call) { + groupedReferences2.functionCalls.push(call); + continue; + } + } + if (isConstructor && contains2(classSymbols, getSymbolTargetAtLocation(entry.node))) { + const importOrExportReference = entryToImportOrExport(entry); + if (importOrExportReference) { + continue; + } + const decl = entryToDeclaration(entry); + if (decl) { + groupedReferences2.declarations.push(decl); + continue; + } + const accessExpression = entryToAccessExpression(entry); + if (accessExpression) { + classReferences.accessExpressions.push(accessExpression); + continue; + } + if (isClassDeclaration(functionDeclaration.parent)) { + const type3 = entryToType(entry); + if (type3) { + classReferences.typeUsages.push(type3); + continue; + } + } + } + groupedReferences2.valid = false; + } + return groupedReferences2; + } + function getSymbolTargetAtLocation(node) { + const symbol = checker.getSymbolAtLocation(node); + return symbol && getSymbolTarget(symbol, checker); + } + } + function getSymbolForContextualType(node, checker) { + const element = getContainingObjectLiteralElement(node); + if (element) { + const contextualType = checker.getContextualTypeForObjectLiteralElement(element); + const symbol = contextualType == null ? void 0 : contextualType.getSymbol(); + if (symbol && !(getCheckFlags(symbol) & 6)) { + return symbol; + } + } + } + function entryToImportOrExport(entry) { + const node = entry.node; + if (isImportSpecifier(node.parent) || isImportClause(node.parent) || isImportEqualsDeclaration(node.parent) || isNamespaceImport(node.parent)) { + return node; + } + if (isExportSpecifier(node.parent) || isExportAssignment(node.parent)) { + return node; + } + return void 0; + } + function entryToDeclaration(entry) { + if (isDeclaration(entry.node.parent)) { + return entry.node; + } + return void 0; + } + function entryToFunctionCall(entry) { + if (entry.node.parent) { + const functionReference = entry.node; + const parent22 = functionReference.parent; + switch (parent22.kind) { + case 213: + case 214: + const callOrNewExpression = tryCast(parent22, isCallOrNewExpression); + if (callOrNewExpression && callOrNewExpression.expression === functionReference) { + return callOrNewExpression; + } + break; + case 211: + const propertyAccessExpression = tryCast(parent22, isPropertyAccessExpression); + if (propertyAccessExpression && propertyAccessExpression.parent && propertyAccessExpression.name === functionReference) { + const callOrNewExpression2 = tryCast(propertyAccessExpression.parent, isCallOrNewExpression); + if (callOrNewExpression2 && callOrNewExpression2.expression === propertyAccessExpression) { + return callOrNewExpression2; + } + } + break; + case 212: + const elementAccessExpression = tryCast(parent22, isElementAccessExpression); + if (elementAccessExpression && elementAccessExpression.parent && elementAccessExpression.argumentExpression === functionReference) { + const callOrNewExpression2 = tryCast(elementAccessExpression.parent, isCallOrNewExpression); + if (callOrNewExpression2 && callOrNewExpression2.expression === elementAccessExpression) { + return callOrNewExpression2; + } + } + break; + } + } + return void 0; + } + function entryToAccessExpression(entry) { + if (entry.node.parent) { + const reference = entry.node; + const parent22 = reference.parent; + switch (parent22.kind) { + case 211: + const propertyAccessExpression = tryCast(parent22, isPropertyAccessExpression); + if (propertyAccessExpression && propertyAccessExpression.expression === reference) { + return propertyAccessExpression; + } + break; + case 212: + const elementAccessExpression = tryCast(parent22, isElementAccessExpression); + if (elementAccessExpression && elementAccessExpression.expression === reference) { + return elementAccessExpression; + } + break; + } + } + return void 0; + } + function entryToType(entry) { + const reference = entry.node; + if (getMeaningFromLocation(reference) === 2 || isExpressionWithTypeArgumentsInClassExtendsClause(reference.parent)) { + return reference; + } + return void 0; + } + function getFunctionDeclarationAtPosition(file, startPosition, checker) { + const node = getTouchingToken(file, startPosition); + const functionDeclaration = getContainingFunctionDeclaration(node); + if (isTopLevelJSDoc(node)) + return void 0; + if (functionDeclaration && isValidFunctionDeclaration(functionDeclaration, checker) && rangeContainsRange(functionDeclaration, node) && !(functionDeclaration.body && rangeContainsRange(functionDeclaration.body, node))) + return functionDeclaration; + return void 0; + } + function isTopLevelJSDoc(node) { + const containingJSDoc = findAncestor(node, isJSDocNode); + if (containingJSDoc) { + const containingNonJSDoc = findAncestor(containingJSDoc, (n7) => !isJSDocNode(n7)); + return !!containingNonJSDoc && isFunctionLikeDeclaration(containingNonJSDoc); + } + return false; + } + function isValidMethodSignature(node) { + return isMethodSignature(node) && (isInterfaceDeclaration(node.parent) || isTypeLiteralNode(node.parent)); + } + function isValidFunctionDeclaration(functionDeclaration, checker) { + var _a2; + if (!isValidParameterNodeArray(functionDeclaration.parameters, checker)) + return false; + switch (functionDeclaration.kind) { + case 262: + return hasNameOrDefault(functionDeclaration) && isSingleImplementation(functionDeclaration, checker); + case 174: + if (isObjectLiteralExpression(functionDeclaration.parent)) { + const contextualSymbol = getSymbolForContextualType(functionDeclaration.name, checker); + return ((_a2 = contextualSymbol == null ? void 0 : contextualSymbol.declarations) == null ? void 0 : _a2.length) === 1 && isSingleImplementation(functionDeclaration, checker); + } + return isSingleImplementation(functionDeclaration, checker); + case 176: + if (isClassDeclaration(functionDeclaration.parent)) { + return hasNameOrDefault(functionDeclaration.parent) && isSingleImplementation(functionDeclaration, checker); + } else { + return isValidVariableDeclaration(functionDeclaration.parent.parent) && isSingleImplementation(functionDeclaration, checker); + } + case 218: + case 219: + return isValidVariableDeclaration(functionDeclaration.parent); + } + return false; + } + function isSingleImplementation(functionDeclaration, checker) { + return !!functionDeclaration.body && !checker.isImplementationOfOverload(functionDeclaration); + } + function hasNameOrDefault(functionOrClassDeclaration) { + if (!functionOrClassDeclaration.name) { + const defaultKeyword = findModifier( + functionOrClassDeclaration, + 90 + /* DefaultKeyword */ + ); + return !!defaultKeyword; + } + return true; + } + function isValidParameterNodeArray(parameters, checker) { + return getRefactorableParametersLength(parameters) >= minimumParameterLength && every2( + parameters, + /*callback*/ + (paramDecl) => isValidParameterDeclaration(paramDecl, checker) + ); + } + function isValidParameterDeclaration(parameterDeclaration, checker) { + if (isRestParameter(parameterDeclaration)) { + const type3 = checker.getTypeAtLocation(parameterDeclaration); + if (!checker.isArrayType(type3) && !checker.isTupleType(type3)) + return false; + } + return !parameterDeclaration.modifiers && isIdentifier(parameterDeclaration.name); + } + function isValidVariableDeclaration(node) { + return isVariableDeclaration(node) && isVarConst(node) && isIdentifier(node.name) && !node.type; + } + function hasThisParameter(parameters) { + return parameters.length > 0 && isThis(parameters[0].name); + } + function getRefactorableParametersLength(parameters) { + if (hasThisParameter(parameters)) { + return parameters.length - 1; + } + return parameters.length; + } + function getRefactorableParameters(parameters) { + if (hasThisParameter(parameters)) { + parameters = factory.createNodeArray(parameters.slice(1), parameters.hasTrailingComma); + } + return parameters; + } + function createPropertyOrShorthandAssignment(name2, initializer) { + if (isIdentifier(initializer) && getTextOfIdentifierOrLiteral(initializer) === name2) { + return factory.createShorthandPropertyAssignment(name2); + } + return factory.createPropertyAssignment(name2, initializer); + } + function createNewArgument(functionDeclaration, functionArguments) { + const parameters = getRefactorableParameters(functionDeclaration.parameters); + const hasRestParameter2 = isRestParameter(last2(parameters)); + const nonRestArguments = hasRestParameter2 ? functionArguments.slice(0, parameters.length - 1) : functionArguments; + const properties = map4(nonRestArguments, (arg, i7) => { + const parameterName = getParameterName(parameters[i7]); + const property2 = createPropertyOrShorthandAssignment(parameterName, arg); + suppressLeadingAndTrailingTrivia(property2.name); + if (isPropertyAssignment(property2)) + suppressLeadingAndTrailingTrivia(property2.initializer); + copyComments(arg, property2); + return property2; + }); + if (hasRestParameter2 && functionArguments.length >= parameters.length) { + const restArguments = functionArguments.slice(parameters.length - 1); + const restProperty = factory.createPropertyAssignment(getParameterName(last2(parameters)), factory.createArrayLiteralExpression(restArguments)); + properties.push(restProperty); + } + const objectLiteral = factory.createObjectLiteralExpression( + properties, + /*multiLine*/ + false + ); + return objectLiteral; + } + function createNewParameters(functionDeclaration, program, host) { + const checker = program.getTypeChecker(); + const refactorableParameters = getRefactorableParameters(functionDeclaration.parameters); + const bindingElements = map4(refactorableParameters, createBindingElementFromParameterDeclaration); + const objectParameterName = factory.createObjectBindingPattern(bindingElements); + const objectParameterType = createParameterTypeNode(refactorableParameters); + let objectInitializer; + if (every2(refactorableParameters, isOptionalParameter)) { + objectInitializer = factory.createObjectLiteralExpression(); + } + const objectParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + objectParameterName, + /*questionToken*/ + void 0, + objectParameterType, + objectInitializer + ); + if (hasThisParameter(functionDeclaration.parameters)) { + const thisParameter = functionDeclaration.parameters[0]; + const newThisParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + thisParameter.name, + /*questionToken*/ + void 0, + thisParameter.type + ); + suppressLeadingAndTrailingTrivia(newThisParameter.name); + copyComments(thisParameter.name, newThisParameter.name); + if (thisParameter.type) { + suppressLeadingAndTrailingTrivia(newThisParameter.type); + copyComments(thisParameter.type, newThisParameter.type); + } + return factory.createNodeArray([newThisParameter, objectParameter]); + } + return factory.createNodeArray([objectParameter]); + function createBindingElementFromParameterDeclaration(parameterDeclaration) { + const element = factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + getParameterName(parameterDeclaration), + isRestParameter(parameterDeclaration) && isOptionalParameter(parameterDeclaration) ? factory.createArrayLiteralExpression() : parameterDeclaration.initializer + ); + suppressLeadingAndTrailingTrivia(element); + if (parameterDeclaration.initializer && element.initializer) { + copyComments(parameterDeclaration.initializer, element.initializer); + } + return element; + } + function createParameterTypeNode(parameters) { + const members = map4(parameters, createPropertySignatureFromParameterDeclaration); + const typeNode = addEmitFlags( + factory.createTypeLiteralNode(members), + 1 + /* SingleLine */ + ); + return typeNode; + } + function createPropertySignatureFromParameterDeclaration(parameterDeclaration) { + let parameterType = parameterDeclaration.type; + if (!parameterType && (parameterDeclaration.initializer || isRestParameter(parameterDeclaration))) { + parameterType = getTypeNode3(parameterDeclaration); + } + const propertySignature = factory.createPropertySignature( + /*modifiers*/ + void 0, + getParameterName(parameterDeclaration), + isOptionalParameter(parameterDeclaration) ? factory.createToken( + 58 + /* QuestionToken */ + ) : parameterDeclaration.questionToken, + parameterType + ); + suppressLeadingAndTrailingTrivia(propertySignature); + copyComments(parameterDeclaration.name, propertySignature.name); + if (parameterDeclaration.type && propertySignature.type) { + copyComments(parameterDeclaration.type, propertySignature.type); + } + return propertySignature; + } + function getTypeNode3(node) { + const type3 = checker.getTypeAtLocation(node); + return getTypeNodeIfAccessible(type3, node, program, host); + } + function isOptionalParameter(parameterDeclaration) { + if (isRestParameter(parameterDeclaration)) { + const type3 = checker.getTypeAtLocation(parameterDeclaration); + return !checker.isTupleType(type3); + } + return checker.isOptionalParameter(parameterDeclaration); + } + } + function getParameterName(paramDeclaration) { + return getTextOfIdentifierOrLiteral(paramDeclaration.name); + } + function getClassNames(constructorDeclaration) { + switch (constructorDeclaration.parent.kind) { + case 263: + const classDeclaration = constructorDeclaration.parent; + if (classDeclaration.name) + return [classDeclaration.name]; + const defaultModifier = Debug.checkDefined( + findModifier( + classDeclaration, + 90 + /* DefaultKeyword */ + ), + "Nameless class declaration should be a default export" + ); + return [defaultModifier]; + case 231: + const classExpression = constructorDeclaration.parent; + const variableDeclaration = constructorDeclaration.parent.parent; + const className = classExpression.name; + if (className) + return [className, variableDeclaration.name]; + return [variableDeclaration.name]; + } + } + function getFunctionNames(functionDeclaration) { + switch (functionDeclaration.kind) { + case 262: + if (functionDeclaration.name) + return [functionDeclaration.name]; + const defaultModifier = Debug.checkDefined( + findModifier( + functionDeclaration, + 90 + /* DefaultKeyword */ + ), + "Nameless function declaration should be a default export" + ); + return [defaultModifier]; + case 174: + return [functionDeclaration.name]; + case 176: + const ctrKeyword = Debug.checkDefined( + findChildOfKind(functionDeclaration, 137, functionDeclaration.getSourceFile()), + "Constructor declaration should have constructor keyword" + ); + if (functionDeclaration.parent.kind === 231) { + const variableDeclaration = functionDeclaration.parent.parent; + return [variableDeclaration.name, ctrKeyword]; + } + return [ctrKeyword]; + case 219: + return [functionDeclaration.parent.name]; + case 218: + if (functionDeclaration.name) + return [functionDeclaration.name, functionDeclaration.parent.name]; + return [functionDeclaration.parent.name]; + default: + return Debug.assertNever(functionDeclaration, `Unexpected function declaration kind ${functionDeclaration.kind}`); + } + } + var refactorName9, minimumParameterLength, refactorDescription5, toDestructuredAction; + var init_convertParamsToDestructuredObject = __esm2({ + "src/services/refactors/convertParamsToDestructuredObject.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName9 = "Convert parameters to destructured object"; + minimumParameterLength = 1; + refactorDescription5 = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object); + toDestructuredAction = { + name: refactorName9, + description: refactorDescription5, + kind: "refactor.rewrite.parameters.toDestructured" + }; + registerRefactor(refactorName9, { + kinds: [toDestructuredAction.kind], + getEditsForAction: getRefactorEditsToConvertParametersToDestructuredObject, + getAvailableActions: getRefactorActionsToConvertParametersToDestructuredObject + }); + } + }); + var ts_refactor_convertParamsToDestructuredObject_exports = {}; + var init_ts_refactor_convertParamsToDestructuredObject = __esm2({ + "src/services/_namespaces/ts.refactor.convertParamsToDestructuredObject.ts"() { + "use strict"; + init_convertParamsToDestructuredObject(); + } + }); + function getRefactorActionsToConvertToTemplateString(context2) { + const { file, startPosition } = context2; + const node = getNodeOrParentOfParentheses(file, startPosition); + const maybeBinary = getParentBinaryExpression(node); + const nodeIsStringLiteral = isStringLiteral(maybeBinary); + const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] }; + if (nodeIsStringLiteral && context2.triggerReason !== "invoked") { + return emptyArray; + } + if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) { + refactorInfo.actions.push(convertStringAction); + return [refactorInfo]; + } else if (context2.preferences.provideRefactorNotApplicableReason) { + refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenations_and_string_literals) }); + return [refactorInfo]; + } + return emptyArray; + } + function getNodeOrParentOfParentheses(file, startPosition) { + const node = getTokenAtPosition(file, startPosition); + const nestedBinary = getParentBinaryExpression(node); + const isNonStringBinary = !treeToArray(nestedBinary).isValidConcatenation; + if (isNonStringBinary && isParenthesizedExpression(nestedBinary.parent) && isBinaryExpression(nestedBinary.parent.parent)) { + return nestedBinary.parent.parent; + } + return node; + } + function getRefactorEditsToConvertToTemplateString(context2, actionName2) { + const { file, startPosition } = context2; + const node = getNodeOrParentOfParentheses(file, startPosition); + switch (actionName2) { + case refactorDescription6: + return { edits: getEditsForToTemplateLiteral(context2, node) }; + default: + return Debug.fail("invalid action"); + } + } + function getEditsForToTemplateLiteral(context2, node) { + const maybeBinary = getParentBinaryExpression(node); + const file = context2.file; + const templateLiteral = nodesToTemplate(treeToArray(maybeBinary), file); + const trailingCommentRanges = getTrailingCommentRanges(file.text, maybeBinary.end); + if (trailingCommentRanges) { + const lastComment = trailingCommentRanges[trailingCommentRanges.length - 1]; + const trailingRange = { pos: trailingCommentRanges[0].pos, end: lastComment.end }; + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + t8.deleteRange(file, trailingRange); + t8.replaceNode(file, maybeBinary, templateLiteral); + }); + } else { + return ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(file, maybeBinary, templateLiteral)); + } + } + function isNotEqualsOperator(node) { + return !(node.operatorToken.kind === 64 || node.operatorToken.kind === 65); + } + function getParentBinaryExpression(expr) { + const container = findAncestor(expr.parent, (n7) => { + switch (n7.kind) { + case 211: + case 212: + return false; + case 228: + case 226: + return !(isBinaryExpression(n7.parent) && isNotEqualsOperator(n7.parent)); + default: + return "quit"; + } + }); + return container || expr; + } + function treeToArray(current) { + const loop = (current2) => { + if (!isBinaryExpression(current2)) { + return { nodes: [current2], operators: [], validOperators: true, hasString: isStringLiteral(current2) || isNoSubstitutionTemplateLiteral(current2) }; + } + const { nodes: nodes2, operators: operators2, hasString: leftHasString, validOperators: leftOperatorValid } = loop(current2.left); + if (!(leftHasString || isStringLiteral(current2.right) || isTemplateExpression(current2.right))) { + return { nodes: [current2], operators: [], hasString: false, validOperators: true }; + } + const currentOperatorValid = current2.operatorToken.kind === 40; + const validOperators2 = leftOperatorValid && currentOperatorValid; + nodes2.push(current2.right); + operators2.push(current2.operatorToken); + return { nodes: nodes2, operators: operators2, hasString: true, validOperators: validOperators2 }; + }; + const { nodes, operators, validOperators, hasString } = loop(current); + return { nodes, operators, isValidConcatenation: validOperators && hasString }; + } + function escapeRawStringForTemplate(s7) { + return s7.replace(/\\.|[$`]/g, (m7) => m7[0] === "\\" ? m7 : "\\" + m7); + } + function getRawTextOfTemplate(node) { + const rightShaving = isTemplateHead(node) || isTemplateMiddle(node) ? -2 : -1; + return getTextOfNode(node).slice(1, rightShaving); + } + function concatConsecutiveString(index4, nodes) { + const indexes = []; + let text = "", rawText = ""; + while (index4 < nodes.length) { + const node = nodes[index4]; + if (isStringLiteralLike(node)) { + text += node.text; + rawText += escapeRawStringForTemplate(getTextOfNode(node).slice(1, -1)); + indexes.push(index4); + index4++; + } else if (isTemplateExpression(node)) { + text += node.head.text; + rawText += getRawTextOfTemplate(node.head); + break; + } else { + break; + } + } + return [index4, text, rawText, indexes]; + } + function nodesToTemplate({ nodes, operators }, file) { + const copyOperatorComments = copyTrailingOperatorComments(operators, file); + const copyCommentFromStringLiterals = copyCommentFromMultiNode(nodes, file, copyOperatorComments); + const [begin, headText, rawHeadText, headIndexes] = concatConsecutiveString(0, nodes); + if (begin === nodes.length) { + const noSubstitutionTemplateLiteral = factory.createNoSubstitutionTemplateLiteral(headText, rawHeadText); + copyCommentFromStringLiterals(headIndexes, noSubstitutionTemplateLiteral); + return noSubstitutionTemplateLiteral; + } + const templateSpans = []; + const templateHead = factory.createTemplateHead(headText, rawHeadText); + copyCommentFromStringLiterals(headIndexes, templateHead); + for (let i7 = begin; i7 < nodes.length; i7++) { + const currentNode = getExpressionFromParenthesesOrExpression(nodes[i7]); + copyOperatorComments(i7, currentNode); + const [newIndex, subsequentText, rawSubsequentText, stringIndexes] = concatConsecutiveString(i7 + 1, nodes); + i7 = newIndex - 1; + const isLast = i7 === nodes.length - 1; + if (isTemplateExpression(currentNode)) { + const spans = map4(currentNode.templateSpans, (span, index4) => { + copyExpressionComments(span); + const isLastSpan = index4 === currentNode.templateSpans.length - 1; + const text = span.literal.text + (isLastSpan ? subsequentText : ""); + const rawText = getRawTextOfTemplate(span.literal) + (isLastSpan ? rawSubsequentText : ""); + return factory.createTemplateSpan( + span.expression, + isLast && isLastSpan ? factory.createTemplateTail(text, rawText) : factory.createTemplateMiddle(text, rawText) + ); + }); + templateSpans.push(...spans); + } else { + const templatePart = isLast ? factory.createTemplateTail(subsequentText, rawSubsequentText) : factory.createTemplateMiddle(subsequentText, rawSubsequentText); + copyCommentFromStringLiterals(stringIndexes, templatePart); + templateSpans.push(factory.createTemplateSpan(currentNode, templatePart)); + } + } + return factory.createTemplateExpression(templateHead, templateSpans); + } + function copyExpressionComments(node) { + const file = node.getSourceFile(); + copyTrailingComments( + node, + node.expression, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + copyTrailingAsLeadingComments( + node.expression, + node.expression, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + } + function getExpressionFromParenthesesOrExpression(node) { + if (isParenthesizedExpression(node)) { + copyExpressionComments(node); + node = node.expression; + } + return node; + } + var refactorName10, refactorDescription6, convertStringAction, copyTrailingOperatorComments, copyCommentFromMultiNode; + var init_convertStringOrTemplateLiteral = __esm2({ + "src/services/refactors/convertStringOrTemplateLiteral.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName10 = "Convert to template string"; + refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Convert_to_template_string); + convertStringAction = { + name: refactorName10, + description: refactorDescription6, + kind: "refactor.rewrite.string" + }; + registerRefactor(refactorName10, { + kinds: [convertStringAction.kind], + getEditsForAction: getRefactorEditsToConvertToTemplateString, + getAvailableActions: getRefactorActionsToConvertToTemplateString + }); + copyTrailingOperatorComments = (operators, file) => (index4, targetNode) => { + if (index4 < operators.length) { + copyTrailingComments( + operators[index4], + targetNode, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + } + }; + copyCommentFromMultiNode = (nodes, file, copyOperatorComments) => (indexes, targetNode) => { + while (indexes.length > 0) { + const index4 = indexes.shift(); + copyTrailingComments( + nodes[index4], + targetNode, + file, + 3, + /*hasTrailingNewLine*/ + false + ); + copyOperatorComments(index4, targetNode); + } + }; + } + }); + var ts_refactor_convertStringOrTemplateLiteral_exports = {}; + var init_ts_refactor_convertStringOrTemplateLiteral = __esm2({ + "src/services/_namespaces/ts.refactor.convertStringOrTemplateLiteral.ts"() { + "use strict"; + init_convertStringOrTemplateLiteral(); + } + }); + function getRefactorActionsToConvertToOptionalChain(context2) { + const info2 = getInfo3(context2, context2.triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + return [{ + name: refactorName11, + description: convertToOptionalChainExpressionMessage, + actions: [toOptionalChainAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName11, + description: convertToOptionalChainExpressionMessage, + actions: [{ ...toOptionalChainAction, notApplicableReason: info2.error }] + }]; + } + return emptyArray; + } + function getRefactorEditsToConvertToOptionalChain(context2, actionName2) { + const info2 = getInfo3(context2); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected applicable refactor info"); + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange6(context2.file, context2.program.getTypeChecker(), t8, info2, actionName2)); + return { edits, renameFilename: void 0, renameLocation: void 0 }; + } + function isValidExpression(node) { + return isBinaryExpression(node) || isConditionalExpression(node); + } + function isValidStatement(node) { + return isExpressionStatement(node) || isReturnStatement(node) || isVariableStatement(node); + } + function isValidExpressionOrStatement(node) { + return isValidExpression(node) || isValidStatement(node); + } + function getInfo3(context2, considerEmptySpans = true) { + const { file, program } = context2; + const span = getRefactorContextSpan(context2); + const forEmptySpan = span.length === 0; + if (forEmptySpan && !considerEmptySpans) + return void 0; + const startToken = getTokenAtPosition(file, span.start); + const endToken = findTokenOnLeftOfPosition(file, span.start + span.length); + const adjustedSpan = createTextSpanFromBounds(startToken.pos, endToken && endToken.end >= startToken.pos ? endToken.getEnd() : startToken.getEnd()); + const parent22 = forEmptySpan ? getValidParentNodeOfEmptySpan(startToken) : getValidParentNodeContainingSpan(startToken, adjustedSpan); + const expression = parent22 && isValidExpressionOrStatement(parent22) ? getExpression(parent22) : void 0; + if (!expression) + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; + const checker = program.getTypeChecker(); + return isConditionalExpression(expression) ? getConditionalInfo(expression, checker) : getBinaryInfo(expression); + } + function getConditionalInfo(expression, checker) { + const condition = expression.condition; + const finalExpression = getFinalExpressionInChain(expression.whenTrue); + if (!finalExpression || checker.isNullableType(checker.getTypeAtLocation(finalExpression))) { + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; + } + if ((isPropertyAccessExpression(condition) || isIdentifier(condition)) && getMatchingStart(condition, finalExpression.expression)) { + return { finalExpression, occurrences: [condition], expression }; + } else if (isBinaryExpression(condition)) { + const occurrences = getOccurrencesInExpression(finalExpression.expression, condition); + return occurrences ? { finalExpression, occurrences, expression } : { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_matching_access_expressions) }; + } + } + function getBinaryInfo(expression) { + if (expression.operatorToken.kind !== 56) { + return { error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_logical_AND_access_chains) }; + } + const finalExpression = getFinalExpressionInChain(expression.right); + if (!finalExpression) + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_convertible_access_expression) }; + const occurrences = getOccurrencesInExpression(finalExpression.expression, expression.left); + return occurrences ? { finalExpression, occurrences, expression } : { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_matching_access_expressions) }; + } + function getOccurrencesInExpression(matchTo, expression) { + const occurrences = []; + while (isBinaryExpression(expression) && expression.operatorToken.kind === 56) { + const match = getMatchingStart(skipParentheses(matchTo), skipParentheses(expression.right)); + if (!match) { + break; + } + occurrences.push(match); + matchTo = match; + expression = expression.left; + } + const finalMatch = getMatchingStart(matchTo, expression); + if (finalMatch) { + occurrences.push(finalMatch); + } + return occurrences.length > 0 ? occurrences : void 0; + } + function getMatchingStart(chain3, subchain) { + if (!isIdentifier(subchain) && !isPropertyAccessExpression(subchain) && !isElementAccessExpression(subchain)) { + return void 0; + } + return chainStartsWith(chain3, subchain) ? subchain : void 0; + } + function chainStartsWith(chain3, subchain) { + while (isCallExpression(chain3) || isPropertyAccessExpression(chain3) || isElementAccessExpression(chain3)) { + if (getTextOfChainNode(chain3) === getTextOfChainNode(subchain)) + break; + chain3 = chain3.expression; + } + while (isPropertyAccessExpression(chain3) && isPropertyAccessExpression(subchain) || isElementAccessExpression(chain3) && isElementAccessExpression(subchain)) { + if (getTextOfChainNode(chain3) !== getTextOfChainNode(subchain)) + return false; + chain3 = chain3.expression; + subchain = subchain.expression; + } + return isIdentifier(chain3) && isIdentifier(subchain) && chain3.getText() === subchain.getText(); + } + function getTextOfChainNode(node) { + if (isIdentifier(node) || isStringOrNumericLiteralLike(node)) { + return node.getText(); + } + if (isPropertyAccessExpression(node)) { + return getTextOfChainNode(node.name); + } + if (isElementAccessExpression(node)) { + return getTextOfChainNode(node.argumentExpression); + } + return void 0; + } + function getValidParentNodeContainingSpan(node, span) { + while (node.parent) { + if (isValidExpressionOrStatement(node) && span.length !== 0 && node.end >= span.start + span.length) { + return node; + } + node = node.parent; + } + return void 0; + } + function getValidParentNodeOfEmptySpan(node) { + while (node.parent) { + if (isValidExpressionOrStatement(node) && !isValidExpressionOrStatement(node.parent)) { + return node; + } + node = node.parent; + } + return void 0; + } + function getExpression(node) { + if (isValidExpression(node)) { + return node; + } + if (isVariableStatement(node)) { + const variable = getSingleVariableOfVariableStatement(node); + const initializer = variable == null ? void 0 : variable.initializer; + return initializer && isValidExpression(initializer) ? initializer : void 0; + } + return node.expression && isValidExpression(node.expression) ? node.expression : void 0; + } + function getFinalExpressionInChain(node) { + node = skipParentheses(node); + if (isBinaryExpression(node)) { + return getFinalExpressionInChain(node.left); + } else if ((isPropertyAccessExpression(node) || isElementAccessExpression(node) || isCallExpression(node)) && !isOptionalChain(node)) { + return node; + } + return void 0; + } + function convertOccurrences(checker, toConvert, occurrences) { + if (isPropertyAccessExpression(toConvert) || isElementAccessExpression(toConvert) || isCallExpression(toConvert)) { + const chain3 = convertOccurrences(checker, toConvert.expression, occurrences); + const lastOccurrence = occurrences.length > 0 ? occurrences[occurrences.length - 1] : void 0; + const isOccurrence = (lastOccurrence == null ? void 0 : lastOccurrence.getText()) === toConvert.expression.getText(); + if (isOccurrence) + occurrences.pop(); + if (isCallExpression(toConvert)) { + return isOccurrence ? factory.createCallChain(chain3, factory.createToken( + 29 + /* QuestionDotToken */ + ), toConvert.typeArguments, toConvert.arguments) : factory.createCallChain(chain3, toConvert.questionDotToken, toConvert.typeArguments, toConvert.arguments); + } else if (isPropertyAccessExpression(toConvert)) { + return isOccurrence ? factory.createPropertyAccessChain(chain3, factory.createToken( + 29 + /* QuestionDotToken */ + ), toConvert.name) : factory.createPropertyAccessChain(chain3, toConvert.questionDotToken, toConvert.name); + } else if (isElementAccessExpression(toConvert)) { + return isOccurrence ? factory.createElementAccessChain(chain3, factory.createToken( + 29 + /* QuestionDotToken */ + ), toConvert.argumentExpression) : factory.createElementAccessChain(chain3, toConvert.questionDotToken, toConvert.argumentExpression); + } + } + return toConvert; + } + function doChange6(sourceFile, checker, changes, info2, _actionName) { + const { finalExpression, occurrences, expression } = info2; + const firstOccurrence = occurrences[occurrences.length - 1]; + const convertedChain = convertOccurrences(checker, finalExpression, occurrences); + if (convertedChain && (isPropertyAccessExpression(convertedChain) || isElementAccessExpression(convertedChain) || isCallExpression(convertedChain))) { + if (isBinaryExpression(expression)) { + changes.replaceNodeRange(sourceFile, firstOccurrence, finalExpression, convertedChain); + } else if (isConditionalExpression(expression)) { + changes.replaceNode(sourceFile, expression, factory.createBinaryExpression(convertedChain, factory.createToken( + 61 + /* QuestionQuestionToken */ + ), expression.whenFalse)); + } + } + } + var refactorName11, convertToOptionalChainExpressionMessage, toOptionalChainAction; + var init_convertToOptionalChainExpression = __esm2({ + "src/services/refactors/convertToOptionalChainExpression.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName11 = "Convert to optional chain expression"; + convertToOptionalChainExpressionMessage = getLocaleSpecificMessage(Diagnostics.Convert_to_optional_chain_expression); + toOptionalChainAction = { + name: refactorName11, + description: convertToOptionalChainExpressionMessage, + kind: "refactor.rewrite.expression.optionalChain" + }; + registerRefactor(refactorName11, { + kinds: [toOptionalChainAction.kind], + getEditsForAction: getRefactorEditsToConvertToOptionalChain, + getAvailableActions: getRefactorActionsToConvertToOptionalChain + }); + } + }); + var ts_refactor_convertToOptionalChainExpression_exports = {}; + var init_ts_refactor_convertToOptionalChainExpression = __esm2({ + "src/services/_namespaces/ts.refactor.convertToOptionalChainExpression.ts"() { + "use strict"; + init_convertToOptionalChainExpression(); + } + }); + function getRefactorActionsToExtractSymbol(context2) { + const requestedRefactor = context2.kind; + const rangeToExtract = getRangeToExtract2(context2.file, getRefactorContextSpan(context2), context2.triggerReason === "invoked"); + const targetRange = rangeToExtract.targetRange; + if (targetRange === void 0) { + if (!rangeToExtract.errors || rangeToExtract.errors.length === 0 || !context2.preferences.provideRefactorNotApplicableReason) { + return emptyArray; + } + const errors = []; + if (refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { + errors.push({ + name: refactorName12, + description: extractFunctionAction.description, + actions: [{ ...extractFunctionAction, notApplicableReason: getStringError(rangeToExtract.errors) }] + }); + } + if (refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { + errors.push({ + name: refactorName12, + description: extractConstantAction.description, + actions: [{ ...extractConstantAction, notApplicableReason: getStringError(rangeToExtract.errors) }] + }); + } + return errors; + } + const extractions = getPossibleExtractions(targetRange, context2); + if (extractions === void 0) { + return emptyArray; + } + const functionActions = []; + const usedFunctionNames = /* @__PURE__ */ new Map(); + let innermostErrorFunctionAction; + const constantActions = []; + const usedConstantNames = /* @__PURE__ */ new Map(); + let innermostErrorConstantAction; + let i7 = 0; + for (const { functionExtraction, constantExtraction } of extractions) { + if (refactorKindBeginsWith(extractFunctionAction.kind, requestedRefactor)) { + const description32 = functionExtraction.description; + if (functionExtraction.errors.length === 0) { + if (!usedFunctionNames.has(description32)) { + usedFunctionNames.set(description32, true); + functionActions.push({ + description: description32, + name: `function_scope_${i7}`, + kind: extractFunctionAction.kind + }); + } + } else if (!innermostErrorFunctionAction) { + innermostErrorFunctionAction = { + description: description32, + name: `function_scope_${i7}`, + notApplicableReason: getStringError(functionExtraction.errors), + kind: extractFunctionAction.kind + }; + } + } + if (refactorKindBeginsWith(extractConstantAction.kind, requestedRefactor)) { + const description32 = constantExtraction.description; + if (constantExtraction.errors.length === 0) { + if (!usedConstantNames.has(description32)) { + usedConstantNames.set(description32, true); + constantActions.push({ + description: description32, + name: `constant_scope_${i7}`, + kind: extractConstantAction.kind + }); + } + } else if (!innermostErrorConstantAction) { + innermostErrorConstantAction = { + description: description32, + name: `constant_scope_${i7}`, + notApplicableReason: getStringError(constantExtraction.errors), + kind: extractConstantAction.kind + }; + } + } + i7++; + } + const infos = []; + if (functionActions.length) { + infos.push({ + name: refactorName12, + description: getLocaleSpecificMessage(Diagnostics.Extract_function), + actions: functionActions + }); + } else if (context2.preferences.provideRefactorNotApplicableReason && innermostErrorFunctionAction) { + infos.push({ + name: refactorName12, + description: getLocaleSpecificMessage(Diagnostics.Extract_function), + actions: [innermostErrorFunctionAction] + }); + } + if (constantActions.length) { + infos.push({ + name: refactorName12, + description: getLocaleSpecificMessage(Diagnostics.Extract_constant), + actions: constantActions + }); + } else if (context2.preferences.provideRefactorNotApplicableReason && innermostErrorConstantAction) { + infos.push({ + name: refactorName12, + description: getLocaleSpecificMessage(Diagnostics.Extract_constant), + actions: [innermostErrorConstantAction] + }); + } + return infos.length ? infos : emptyArray; + function getStringError(errors) { + let error22 = errors[0].messageText; + if (typeof error22 !== "string") { + error22 = error22.messageText; + } + return error22; + } + } + function getRefactorEditsToExtractSymbol(context2, actionName2) { + const rangeToExtract = getRangeToExtract2(context2.file, getRefactorContextSpan(context2)); + const targetRange = rangeToExtract.targetRange; + const parsedFunctionIndexMatch = /^function_scope_(\d+)$/.exec(actionName2); + if (parsedFunctionIndexMatch) { + const index4 = +parsedFunctionIndexMatch[1]; + Debug.assert(isFinite(index4), "Expected to parse a finite number from the function scope index"); + return getFunctionExtractionAtIndex(targetRange, context2, index4); + } + const parsedConstantIndexMatch = /^constant_scope_(\d+)$/.exec(actionName2); + if (parsedConstantIndexMatch) { + const index4 = +parsedConstantIndexMatch[1]; + Debug.assert(isFinite(index4), "Expected to parse a finite number from the constant scope index"); + return getConstantExtractionAtIndex(targetRange, context2, index4); + } + Debug.fail("Unrecognized action name"); + } + function getRangeToExtract2(sourceFile, span, invoked = true) { + const { length: length2 } = span; + if (length2 === 0 && !invoked) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractEmpty)] }; + } + const cursorRequest = length2 === 0 && invoked; + const startToken = findFirstNonJsxWhitespaceToken(sourceFile, span.start); + const endToken = findTokenOnLeftOfPosition(sourceFile, textSpanEnd(span)); + const adjustedSpan = startToken && endToken && invoked ? getAdjustedSpanFromNodes(startToken, endToken, sourceFile) : span; + const start = cursorRequest ? getExtractableParent(startToken) : getParentNodeInSpan(startToken, sourceFile, adjustedSpan); + const end = cursorRequest ? start : getParentNodeInSpan(endToken, sourceFile, adjustedSpan); + let rangeFacts = 0; + let thisNode; + if (!start || !end) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractRange)] }; + } + if (start.flags & 16777216) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractJSDoc)] }; + } + if (start.parent !== end.parent) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractRange)] }; + } + if (start !== end) { + if (!isBlockLike(start.parent)) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractRange)] }; + } + const statements = []; + for (const statement of start.parent.statements) { + if (statement === start || statements.length) { + const errors2 = checkNode(statement); + if (errors2) { + return { errors: errors2 }; + } + statements.push(statement); + } + if (statement === end) { + break; + } + } + if (!statements.length) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractRange)] }; + } + return { targetRange: { range: statements, facts: rangeFacts, thisNode } }; + } + if (isReturnStatement(start) && !start.expression) { + return { errors: [createFileDiagnostic(sourceFile, span.start, length2, Messages6.cannotExtractRange)] }; + } + const node = refineNode(start); + const errors = checkRootNode(node) || checkNode(node); + if (errors) { + return { errors }; + } + return { targetRange: { range: getStatementOrExpressionRange(node), facts: rangeFacts, thisNode } }; + function refineNode(node2) { + if (isReturnStatement(node2)) { + if (node2.expression) { + return node2.expression; + } + } else if (isVariableStatement(node2) || isVariableDeclarationList(node2)) { + const declarations = isVariableStatement(node2) ? node2.declarationList.declarations : node2.declarations; + let numInitializers = 0; + let lastInitializer; + for (const declaration of declarations) { + if (declaration.initializer) { + numInitializers++; + lastInitializer = declaration.initializer; + } + } + if (numInitializers === 1) { + return lastInitializer; + } + } else if (isVariableDeclaration(node2)) { + if (node2.initializer) { + return node2.initializer; + } + } + return node2; + } + function checkRootNode(node2) { + if (isIdentifier(isExpressionStatement(node2) ? node2.expression : node2)) { + return [createDiagnosticForNode(node2, Messages6.cannotExtractIdentifier)]; + } + return void 0; + } + function checkForStaticContext(nodeToCheck, containingClass) { + let current = nodeToCheck; + while (current !== containingClass) { + if (current.kind === 172) { + if (isStatic(current)) { + rangeFacts |= 32; + } + break; + } else if (current.kind === 169) { + const ctorOrMethod = getContainingFunction(current); + if (ctorOrMethod.kind === 176) { + rangeFacts |= 32; + } + break; + } else if (current.kind === 174) { + if (isStatic(current)) { + rangeFacts |= 32; + } + } + current = current.parent; + } + } + function checkNode(nodeToCheck) { + let PermittedJumps; + ((PermittedJumps2) => { + PermittedJumps2[PermittedJumps2["None"] = 0] = "None"; + PermittedJumps2[PermittedJumps2["Break"] = 1] = "Break"; + PermittedJumps2[PermittedJumps2["Continue"] = 2] = "Continue"; + PermittedJumps2[PermittedJumps2["Return"] = 4] = "Return"; + })(PermittedJumps || (PermittedJumps = {})); + Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"); + Debug.assert(!positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"); + if (!isStatement(nodeToCheck) && !(isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck)) && !isStringLiteralJsxAttribute(nodeToCheck)) { + return [createDiagnosticForNode(nodeToCheck, Messages6.statementOrExpressionExpected)]; + } + if (nodeToCheck.flags & 33554432) { + return [createDiagnosticForNode(nodeToCheck, Messages6.cannotExtractAmbientBlock)]; + } + const containingClass = getContainingClass(nodeToCheck); + if (containingClass) { + checkForStaticContext(nodeToCheck, containingClass); + } + let errors2; + let permittedJumps = 4; + let seenLabels; + visit7(nodeToCheck); + if (rangeFacts & 8) { + const container = getThisContainer( + nodeToCheck, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (container.kind === 262 || container.kind === 174 && container.parent.kind === 210 || container.kind === 218) { + rangeFacts |= 16; + } + } + return errors2; + function visit7(node2) { + if (errors2) { + return true; + } + if (isDeclaration(node2)) { + const declaringNode = node2.kind === 260 ? node2.parent.parent : node2; + if (hasSyntacticModifier( + declaringNode, + 32 + /* Export */ + )) { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractExportedEntity)); + return true; + } + } + switch (node2.kind) { + case 272: + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractImport)); + return true; + case 277: + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractExportedEntity)); + return true; + case 108: + if (node2.parent.kind === 213) { + const containingClass2 = getContainingClass(node2); + if (containingClass2 === void 0 || containingClass2.pos < span.start || containingClass2.end >= span.start + span.length) { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractSuper)); + return true; + } + } else { + rangeFacts |= 8; + thisNode = node2; + } + break; + case 219: + forEachChild(node2, function check(n7) { + if (isThis(n7)) { + rangeFacts |= 8; + thisNode = node2; + } else if (isClassLike(n7) || isFunctionLike(n7) && !isArrowFunction(n7)) { + return false; + } else { + forEachChild(n7, check); + } + }); + case 263: + case 262: + if (isSourceFile(node2.parent) && node2.parent.externalModuleIndicator === void 0) { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.functionWillNotBeVisibleInTheNewScope)); + } + case 231: + case 218: + case 174: + case 176: + case 177: + case 178: + return false; + } + const savedPermittedJumps = permittedJumps; + switch (node2.kind) { + case 245: + permittedJumps &= ~4; + break; + case 258: + permittedJumps = 0; + break; + case 241: + if (node2.parent && node2.parent.kind === 258 && node2.parent.finallyBlock === node2) { + permittedJumps = 4; + } + break; + case 297: + case 296: + permittedJumps |= 1; + break; + default: + if (isIterationStatement( + node2, + /*lookInLabeledStatements*/ + false + )) { + permittedJumps |= 1 | 2; + } + break; + } + switch (node2.kind) { + case 197: + case 110: + rangeFacts |= 8; + thisNode = node2; + break; + case 256: { + const label = node2.label; + (seenLabels || (seenLabels = [])).push(label.escapedText); + forEachChild(node2, visit7); + seenLabels.pop(); + break; + } + case 252: + case 251: { + const label = node2.label; + if (label) { + if (!contains2(seenLabels, label.escapedText)) { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)); + } + } else { + if (!(permittedJumps & (node2.kind === 252 ? 1 : 2))) { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); + } + } + break; + } + case 223: + rangeFacts |= 4; + break; + case 229: + rangeFacts |= 2; + break; + case 253: + if (permittedJumps & 4) { + rangeFacts |= 1; + } else { + (errors2 || (errors2 = [])).push(createDiagnosticForNode(node2, Messages6.cannotExtractRangeContainingConditionalReturnStatement)); + } + break; + default: + forEachChild(node2, visit7); + break; + } + permittedJumps = savedPermittedJumps; + } + } + } + function getAdjustedSpanFromNodes(startNode2, endNode2, sourceFile) { + const start = startNode2.getStart(sourceFile); + let end = endNode2.getEnd(); + if (sourceFile.text.charCodeAt(end) === 59) { + end++; + } + return { start, length: end - start }; + } + function getStatementOrExpressionRange(node) { + if (isStatement(node)) { + return [node]; + } + if (isExpressionNode(node)) { + return isExpressionStatement(node.parent) ? [node.parent] : node; + } + if (isStringLiteralJsxAttribute(node)) { + return node; + } + return void 0; + } + function isScope(node) { + return isArrowFunction(node) ? isFunctionBody(node.body) : isFunctionLikeDeclaration(node) || isSourceFile(node) || isModuleBlock(node) || isClassLike(node); + } + function collectEnclosingScopes(range2) { + let current = isReadonlyArray(range2.range) ? first(range2.range) : range2.range; + if (range2.facts & 8 && !(range2.facts & 16)) { + const containingClass = getContainingClass(current); + if (containingClass) { + const containingFunction = findAncestor(current, isFunctionLikeDeclaration); + return containingFunction ? [containingFunction, containingClass] : [containingClass]; + } + } + const scopes = []; + while (true) { + current = current.parent; + if (current.kind === 169) { + current = findAncestor(current, (parent22) => isFunctionLikeDeclaration(parent22)).parent; + } + if (isScope(current)) { + scopes.push(current); + if (current.kind === 312) { + return scopes; + } + } + } + } + function getFunctionExtractionAtIndex(targetRange, context2, requestedChangesIndex) { + const { scopes, readsAndWrites: { target, usagesPerScope, functionErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context2); + Debug.assert(!functionErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); + context2.cancellationToken.throwIfCancellationRequested(); + return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context2); + } + function getConstantExtractionAtIndex(targetRange, context2, requestedChangesIndex) { + const { scopes, readsAndWrites: { target, usagesPerScope, constantErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context2); + Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); + Debug.assert(exposedVariableDeclarations.length === 0, "Extract constant accepted a range containing a variable declaration?"); + context2.cancellationToken.throwIfCancellationRequested(); + const expression = isExpression(target) ? target : target.statements[0].expression; + return extractConstantInScope(expression, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange.facts, context2); + } + function getPossibleExtractions(targetRange, context2) { + const { scopes, readsAndWrites: { functionErrorsPerScope, constantErrorsPerScope } } = getPossibleExtractionsWorker(targetRange, context2); + const extractions = scopes.map((scope, i7) => { + const functionDescriptionPart = getDescriptionForFunctionInScope(scope); + const constantDescriptionPart = getDescriptionForConstantInScope(scope); + const scopeDescription = isFunctionLikeDeclaration(scope) ? getDescriptionForFunctionLikeDeclaration(scope) : isClassLike(scope) ? getDescriptionForClassLikeDeclaration(scope) : getDescriptionForModuleLikeDeclaration(scope); + let functionDescription; + let constantDescription; + if (scopeDescription === 1) { + functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "global"]); + constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "global"]); + } else if (scopeDescription === 0) { + functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [functionDescriptionPart, "module"]); + constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1_scope), [constantDescriptionPart, "module"]); + } else { + functionDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1), [functionDescriptionPart, scopeDescription]); + constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_1), [constantDescriptionPart, scopeDescription]); + } + if (i7 === 0 && !isClassLike(scope)) { + constantDescription = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Extract_to_0_in_enclosing_scope), [constantDescriptionPart]); + } + return { + functionExtraction: { + description: functionDescription, + errors: functionErrorsPerScope[i7] + }, + constantExtraction: { + description: constantDescription, + errors: constantErrorsPerScope[i7] + } + }; + }); + return extractions; + } + function getPossibleExtractionsWorker(targetRange, context2) { + const { file: sourceFile } = context2; + const scopes = collectEnclosingScopes(targetRange); + const enclosingTextRange = getEnclosingTextRange(targetRange, sourceFile); + const readsAndWrites = collectReadsAndWrites( + targetRange, + scopes, + enclosingTextRange, + sourceFile, + context2.program.getTypeChecker(), + context2.cancellationToken + ); + return { scopes, readsAndWrites }; + } + function getDescriptionForFunctionInScope(scope) { + return isFunctionLikeDeclaration(scope) ? "inner function" : isClassLike(scope) ? "method" : "function"; + } + function getDescriptionForConstantInScope(scope) { + return isClassLike(scope) ? "readonly field" : "constant"; + } + function getDescriptionForFunctionLikeDeclaration(scope) { + switch (scope.kind) { + case 176: + return "constructor"; + case 218: + case 262: + return scope.name ? `function '${scope.name.text}'` : ANONYMOUS; + case 219: + return "arrow function"; + case 174: + return `method '${scope.name.getText()}'`; + case 177: + return `'get ${scope.name.getText()}'`; + case 178: + return `'set ${scope.name.getText()}'`; + default: + Debug.assertNever(scope, `Unexpected scope kind ${scope.kind}`); + } + } + function getDescriptionForClassLikeDeclaration(scope) { + return scope.kind === 263 ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; + } + function getDescriptionForModuleLikeDeclaration(scope) { + return scope.kind === 268 ? `namespace '${scope.parent.name.getText()}'` : scope.externalModuleIndicator ? 0 : 1; + } + function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParameterUsages, substitutions }, exposedVariableDeclarations, range2, context2) { + const checker = context2.program.getTypeChecker(); + const scriptTarget = getEmitScriptTarget(context2.program.getCompilerOptions()); + const importAdder = ts_codefix_exports.createImportAdder(context2.file, context2.program, context2.preferences, context2.host); + const file = scope.getSourceFile(); + const functionNameText = getUniqueName(isClassLike(scope) ? "newMethod" : "newFunction", file); + const isJS = isInJSFile(scope); + const functionName = factory.createIdentifier(functionNameText); + let returnType; + const parameters = []; + const callArguments = []; + let writes; + usagesInScope.forEach((usage, name2) => { + let typeNode; + if (!isJS) { + let type3 = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); + type3 = checker.getBaseTypeOfLiteralType(type3); + typeNode = ts_codefix_exports.typeToAutoImportableTypeNode( + checker, + importAdder, + type3, + scope, + scriptTarget, + 1 + /* NoTruncation */ + ); + } + const paramDecl = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + name2, + /*questionToken*/ + void 0, + typeNode + ); + parameters.push(paramDecl); + if (usage.usage === 2) { + (writes || (writes = [])).push(usage); + } + callArguments.push(factory.createIdentifier(name2)); + }); + const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type3) => ({ type: type3, declaration: getFirstDeclarationBeforePosition(type3, context2.startPosition) })); + const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder); + const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration); + const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode( + decl.name, + /*typeArguments*/ + void 0 + )) : void 0; + if (isExpression(node) && !isJS) { + const contextualType = checker.getContextualType(node); + returnType = checker.typeToTypeNode( + contextualType, + scope, + 1 + /* NoTruncation */ + ); + } + const { body, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range2.facts & 1)); + suppressLeadingAndTrailingTrivia(body); + let newFunction; + const callThis = !!(range2.facts & 16); + if (isClassLike(scope)) { + const modifiers = isJS ? [] : [factory.createModifier( + 123 + /* PrivateKeyword */ + )]; + if (range2.facts & 32) { + modifiers.push(factory.createModifier( + 126 + /* StaticKeyword */ + )); + } + if (range2.facts & 4) { + modifiers.push(factory.createModifier( + 134 + /* AsyncKeyword */ + )); + } + newFunction = factory.createMethodDeclaration( + modifiers.length ? modifiers : void 0, + range2.facts & 2 ? factory.createToken( + 42 + /* AsteriskToken */ + ) : void 0, + functionName, + /*questionToken*/ + void 0, + typeParameters, + parameters, + returnType, + body + ); + } else { + if (callThis) { + parameters.unshift( + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + "this", + /*questionToken*/ + void 0, + checker.typeToTypeNode( + checker.getTypeAtLocation(range2.thisNode), + scope, + 1 + /* NoTruncation */ + ), + /*initializer*/ + void 0 + ) + ); + } + newFunction = factory.createFunctionDeclaration( + range2.facts & 4 ? [factory.createToken( + 134 + /* AsyncKeyword */ + )] : void 0, + range2.facts & 2 ? factory.createToken( + 42 + /* AsteriskToken */ + ) : void 0, + functionName, + typeParameters, + parameters, + returnType, + body + ); + } + const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context2); + const minInsertionPos = (isReadonlyArray(range2.range) ? last2(range2.range) : range2.range).end; + const nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); + if (nodeToInsertBefore) { + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newFunction, + /*blankLineBetween*/ + true + ); + } else { + changeTracker.insertNodeAtEndOfScope(context2.file, scope, newFunction); + } + importAdder.writeFixes(changeTracker); + const newNodes = []; + const called = getCalledExpression(scope, range2, functionNameText); + if (callThis) { + callArguments.unshift(factory.createIdentifier("this")); + } + let call = factory.createCallExpression( + callThis ? factory.createPropertyAccessExpression( + called, + "call" + ) : called, + callTypeArguments, + // Note that no attempt is made to take advantage of type argument inference + callArguments + ); + if (range2.facts & 2) { + call = factory.createYieldExpression(factory.createToken( + 42 + /* AsteriskToken */ + ), call); + } + if (range2.facts & 4) { + call = factory.createAwaitExpression(call); + } + if (isInJSXContent(node)) { + call = factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + call + ); + } + if (exposedVariableDeclarations.length && !writes) { + Debug.assert(!returnValueProperty, "Expected no returnValueProperty"); + Debug.assert(!(range2.facts & 1), "Expected RangeFacts.HasReturn flag to be unset"); + if (exposedVariableDeclarations.length === 1) { + const variableDeclaration = exposedVariableDeclarations[0]; + newNodes.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + getSynthesizedDeepClone(variableDeclaration.name), + /*exclamationToken*/ + void 0, + /*type*/ + getSynthesizedDeepClone(variableDeclaration.type), + /*initializer*/ + call + )], + variableDeclaration.parent.flags + ) + )); + } else { + const bindingElements = []; + const typeElements = []; + let commonNodeFlags = exposedVariableDeclarations[0].parent.flags; + let sawExplicitType = false; + for (const variableDeclaration of exposedVariableDeclarations) { + bindingElements.push(factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + /*name*/ + getSynthesizedDeepClone(variableDeclaration.name) + )); + const variableType = checker.typeToTypeNode( + checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), + scope, + 1 + /* NoTruncation */ + ); + typeElements.push(factory.createPropertySignature( + /*modifiers*/ + void 0, + /*name*/ + variableDeclaration.symbol.name, + /*questionToken*/ + void 0, + /*type*/ + variableType + )); + sawExplicitType = sawExplicitType || variableDeclaration.type !== void 0; + commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags; + } + const typeLiteral = sawExplicitType ? factory.createTypeLiteralNode(typeElements) : void 0; + if (typeLiteral) { + setEmitFlags( + typeLiteral, + 1 + /* SingleLine */ + ); + } + newNodes.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + factory.createObjectBindingPattern(bindingElements), + /*exclamationToken*/ + void 0, + /*type*/ + typeLiteral, + /*initializer*/ + call + )], + commonNodeFlags + ) + )); + } + } else if (exposedVariableDeclarations.length || writes) { + if (exposedVariableDeclarations.length) { + for (const variableDeclaration of exposedVariableDeclarations) { + let flags = variableDeclaration.parent.flags; + if (flags & 2) { + flags = flags & ~2 | 1; + } + newNodes.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + variableDeclaration.symbol.name, + /*exclamationToken*/ + void 0, + getTypeDeepCloneUnionUndefined(variableDeclaration.type) + )], + flags + ) + )); + } + } + if (returnValueProperty) { + newNodes.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + returnValueProperty, + /*exclamationToken*/ + void 0, + getTypeDeepCloneUnionUndefined(returnType) + )], + 1 + /* Let */ + ) + )); + } + const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (returnValueProperty) { + assignments.unshift(factory.createShorthandPropertyAssignment(returnValueProperty)); + } + if (assignments.length === 1) { + Debug.assert(!returnValueProperty, "Shouldn't have returnValueProperty here"); + newNodes.push(factory.createExpressionStatement(factory.createAssignment(assignments[0].name, call))); + if (range2.facts & 1) { + newNodes.push(factory.createReturnStatement()); + } + } else { + newNodes.push(factory.createExpressionStatement(factory.createAssignment(factory.createObjectLiteralExpression(assignments), call))); + if (returnValueProperty) { + newNodes.push(factory.createReturnStatement(factory.createIdentifier(returnValueProperty))); + } + } + } else { + if (range2.facts & 1) { + newNodes.push(factory.createReturnStatement(call)); + } else if (isReadonlyArray(range2.range)) { + newNodes.push(factory.createExpressionStatement(call)); + } else { + newNodes.push(call); + } + } + if (isReadonlyArray(range2.range)) { + changeTracker.replaceNodeRangeWithNodes(context2.file, first(range2.range), last2(range2.range), newNodes); + } else { + changeTracker.replaceNodeWithNodes(context2.file, range2.range, newNodes); + } + const edits = changeTracker.getChanges(); + const renameRange = isReadonlyArray(range2.range) ? first(range2.range) : range2.range; + const renameFilename = renameRange.getSourceFile().fileName; + const renameLocation = getRenameLocation( + edits, + renameFilename, + functionNameText, + /*preferLastLocation*/ + false + ); + return { renameFilename, renameLocation, edits }; + function getTypeDeepCloneUnionUndefined(typeNode) { + if (typeNode === void 0) { + return void 0; + } + const clone22 = getSynthesizedDeepClone(typeNode); + let withoutParens = clone22; + while (isParenthesizedTypeNode(withoutParens)) { + withoutParens = withoutParens.type; + } + return isUnionTypeNode(withoutParens) && find2( + withoutParens.types, + (t8) => t8.kind === 157 + /* UndefinedKeyword */ + ) ? clone22 : factory.createUnionTypeNode([clone22, factory.createKeywordTypeNode( + 157 + /* UndefinedKeyword */ + )]); + } + } + function extractConstantInScope(node, scope, { substitutions }, rangeFacts, context2) { + const checker = context2.program.getTypeChecker(); + const file = scope.getSourceFile(); + const localNameText = isPropertyAccessExpression(node) && !isClassLike(scope) && !checker.resolveName( + node.name.text, + node, + 111551, + /*excludeGlobals*/ + false + ) && !isPrivateIdentifier(node.name) && !identifierToKeywordKind(node.name) ? node.name.text : getUniqueName(isClassLike(scope) ? "newProperty" : "newLocal", file); + const isJS = isInJSFile(scope); + let variableType = isJS || !checker.isContextSensitive(node) ? void 0 : checker.typeToTypeNode( + checker.getContextualType(node), + scope, + 1 + /* NoTruncation */ + ); + let initializer = transformConstantInitializer(skipParentheses(node), substitutions); + ({ variableType, initializer } = transformFunctionInitializerAndType(variableType, initializer)); + suppressLeadingAndTrailingTrivia(initializer); + const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context2); + if (isClassLike(scope)) { + Debug.assert(!isJS, "Cannot extract to a JS class"); + const modifiers = []; + modifiers.push(factory.createModifier( + 123 + /* PrivateKeyword */ + )); + if (rangeFacts & 32) { + modifiers.push(factory.createModifier( + 126 + /* StaticKeyword */ + )); + } + modifiers.push(factory.createModifier( + 148 + /* ReadonlyKeyword */ + )); + const newVariable = factory.createPropertyDeclaration( + modifiers, + localNameText, + /*questionOrExclamationToken*/ + void 0, + variableType, + initializer + ); + let localReference = factory.createPropertyAccessExpression( + rangeFacts & 32 ? factory.createIdentifier(scope.name.getText()) : factory.createThis(), + factory.createIdentifier(localNameText) + ); + if (isInJSXContent(node)) { + localReference = factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + localReference + ); + } + const maxInsertionPos = node.pos; + const nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newVariable, + /*blankLineBetween*/ + true + ); + changeTracker.replaceNode(context2.file, node, localReference); + } else { + const newVariableDeclaration = factory.createVariableDeclaration( + localNameText, + /*exclamationToken*/ + void 0, + variableType, + initializer + ); + const oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); + if (oldVariableDeclaration) { + changeTracker.insertNodeBefore(context2.file, oldVariableDeclaration, newVariableDeclaration); + const localReference = factory.createIdentifier(localNameText); + changeTracker.replaceNode(context2.file, node, localReference); + } else if (node.parent.kind === 244 && scope === findAncestor(node, isScope)) { + const newVariableStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [newVariableDeclaration], + 2 + /* Const */ + ) + ); + changeTracker.replaceNode(context2.file, node.parent, newVariableStatement); + } else { + const newVariableStatement = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [newVariableDeclaration], + 2 + /* Const */ + ) + ); + const nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); + if (nodeToInsertBefore.pos === 0) { + changeTracker.insertNodeAtTopOfFile( + context2.file, + newVariableStatement, + /*blankLineBetween*/ + false + ); + } else { + changeTracker.insertNodeBefore( + context2.file, + nodeToInsertBefore, + newVariableStatement, + /*blankLineBetween*/ + false + ); + } + if (node.parent.kind === 244) { + changeTracker.delete(context2.file, node.parent); + } else { + let localReference = factory.createIdentifier(localNameText); + if (isInJSXContent(node)) { + localReference = factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + localReference + ); + } + changeTracker.replaceNode(context2.file, node, localReference); + } + } + } + const edits = changeTracker.getChanges(); + const renameFilename = node.getSourceFile().fileName; + const renameLocation = getRenameLocation( + edits, + renameFilename, + localNameText, + /*preferLastLocation*/ + true + ); + return { renameFilename, renameLocation, edits }; + function transformFunctionInitializerAndType(variableType2, initializer2) { + if (variableType2 === void 0) + return { variableType: variableType2, initializer: initializer2 }; + if (!isFunctionExpression(initializer2) && !isArrowFunction(initializer2) || !!initializer2.typeParameters) + return { variableType: variableType2, initializer: initializer2 }; + const functionType2 = checker.getTypeAtLocation(node); + const functionSignature = singleOrUndefined(checker.getSignaturesOfType( + functionType2, + 0 + /* Call */ + )); + if (!functionSignature) + return { variableType: variableType2, initializer: initializer2 }; + if (!!functionSignature.getTypeParameters()) + return { variableType: variableType2, initializer: initializer2 }; + const parameters = []; + let hasAny = false; + for (const p7 of initializer2.parameters) { + if (p7.type) { + parameters.push(p7); + } else { + const paramType = checker.getTypeAtLocation(p7); + if (paramType === checker.getAnyType()) + hasAny = true; + parameters.push(factory.updateParameterDeclaration(p7, p7.modifiers, p7.dotDotDotToken, p7.name, p7.questionToken, p7.type || checker.typeToTypeNode( + paramType, + scope, + 1 + /* NoTruncation */ + ), p7.initializer)); + } + } + if (hasAny) + return { variableType: variableType2, initializer: initializer2 }; + variableType2 = void 0; + if (isArrowFunction(initializer2)) { + initializer2 = factory.updateArrowFunction(initializer2, canHaveModifiers(node) ? getModifiers(node) : void 0, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode( + functionSignature.getReturnType(), + scope, + 1 + /* NoTruncation */ + ), initializer2.equalsGreaterThanToken, initializer2.body); + } else { + if (functionSignature && !!functionSignature.thisParameter) { + const firstParameter = firstOrUndefined(parameters); + if (!firstParameter || isIdentifier(firstParameter.name) && firstParameter.name.escapedText !== "this") { + const thisType = checker.getTypeOfSymbolAtLocation(functionSignature.thisParameter, node); + parameters.splice( + 0, + 0, + factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "this", + /*questionToken*/ + void 0, + checker.typeToTypeNode( + thisType, + scope, + 1 + /* NoTruncation */ + ) + ) + ); + } + } + initializer2 = factory.updateFunctionExpression(initializer2, canHaveModifiers(node) ? getModifiers(node) : void 0, initializer2.asteriskToken, initializer2.name, initializer2.typeParameters, parameters, initializer2.type || checker.typeToTypeNode( + functionSignature.getReturnType(), + scope, + 1 + /* NoTruncation */ + ), initializer2.body); + } + return { variableType: variableType2, initializer: initializer2 }; + } + } + function getContainingVariableDeclarationIfInList(node, scope) { + let prevNode; + while (node !== void 0 && node !== scope) { + if (isVariableDeclaration(node) && node.initializer === prevNode && isVariableDeclarationList(node.parent) && node.parent.declarations.length > 1) { + return node; + } + prevNode = node; + node = node.parent; + } + } + function getFirstDeclarationBeforePosition(type3, position) { + let firstDeclaration; + const symbol = type3.symbol; + if (symbol && symbol.declarations) { + for (const declaration of symbol.declarations) { + if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) { + firstDeclaration = declaration; + } + } + } + return firstDeclaration; + } + function compareTypesByDeclarationOrder({ type: type1, declaration: declaration1 }, { type: type22, declaration: declaration2 }) { + return compareProperties(declaration1, declaration2, "pos", compareValues) || compareStringsCaseSensitive( + type1.symbol ? type1.symbol.getName() : "", + type22.symbol ? type22.symbol.getName() : "" + ) || compareValues(type1.id, type22.id); + } + function getCalledExpression(scope, range2, functionNameText) { + const functionReference = factory.createIdentifier(functionNameText); + if (isClassLike(scope)) { + const lhs = range2.facts & 32 ? factory.createIdentifier(scope.name.text) : factory.createThis(); + return factory.createPropertyAccessExpression(lhs, functionReference); + } else { + return functionReference; + } + } + function transformFunctionBody(body, exposedVariableDeclarations, writes, substitutions, hasReturn2) { + const hasWritesOrVariableDeclarations = writes !== void 0 || exposedVariableDeclarations.length > 0; + if (isBlock2(body) && !hasWritesOrVariableDeclarations && substitutions.size === 0) { + return { body: factory.createBlock( + body.statements, + /*multiLine*/ + true + ), returnValueProperty: void 0 }; + } + let returnValueProperty; + let ignoreReturns = false; + const statements = factory.createNodeArray(isBlock2(body) ? body.statements.slice(0) : [isStatement(body) ? body : factory.createReturnStatement(skipParentheses(body))]); + if (hasWritesOrVariableDeclarations || substitutions.size) { + const rewrittenStatements = visitNodes2(statements, visitor, isStatement).slice(); + if (hasWritesOrVariableDeclarations && !hasReturn2 && isStatement(body)) { + const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (assignments.length === 1) { + rewrittenStatements.push(factory.createReturnStatement(assignments[0].name)); + } else { + rewrittenStatements.push(factory.createReturnStatement(factory.createObjectLiteralExpression(assignments))); + } + } + return { body: factory.createBlock( + rewrittenStatements, + /*multiLine*/ + true + ), returnValueProperty }; + } else { + return { body: factory.createBlock( + statements, + /*multiLine*/ + true + ), returnValueProperty: void 0 }; + } + function visitor(node) { + if (!ignoreReturns && isReturnStatement(node) && hasWritesOrVariableDeclarations) { + const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); + if (node.expression) { + if (!returnValueProperty) { + returnValueProperty = "__return"; + } + assignments.unshift(factory.createPropertyAssignment(returnValueProperty, visitNode(node.expression, visitor, isExpression))); + } + if (assignments.length === 1) { + return factory.createReturnStatement(assignments[0].name); + } else { + return factory.createReturnStatement(factory.createObjectLiteralExpression(assignments)); + } + } else { + const oldIgnoreReturns = ignoreReturns; + ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node); + const substitution = substitutions.get(getNodeId(node).toString()); + const result2 = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild( + node, + visitor, + /*context*/ + void 0 + ); + ignoreReturns = oldIgnoreReturns; + return result2; + } + } + } + function transformConstantInitializer(initializer, substitutions) { + return substitutions.size ? visitor(initializer) : initializer; + function visitor(node) { + const substitution = substitutions.get(getNodeId(node).toString()); + return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild( + node, + visitor, + /*context*/ + void 0 + ); + } + } + function getStatementsOrClassElements(scope) { + if (isFunctionLikeDeclaration(scope)) { + const body = scope.body; + if (isBlock2(body)) { + return body.statements; + } + } else if (isModuleBlock(scope) || isSourceFile(scope)) { + return scope.statements; + } else if (isClassLike(scope)) { + return scope.members; + } else { + assertType(scope); + } + return emptyArray; + } + function getNodeToInsertFunctionBefore(minPos, scope) { + return find2(getStatementsOrClassElements(scope), (child) => child.pos >= minPos && isFunctionLikeDeclaration(child) && !isConstructorDeclaration(child)); + } + function getNodeToInsertPropertyBefore(maxPos, scope) { + const members = scope.members; + Debug.assert(members.length > 0, "Found no members"); + let prevMember; + let allProperties = true; + for (const member of members) { + if (member.pos > maxPos) { + return prevMember || members[0]; + } + if (allProperties && !isPropertyDeclaration(member)) { + if (prevMember !== void 0) { + return member; + } + allProperties = false; + } + prevMember = member; + } + if (prevMember === void 0) + return Debug.fail(); + return prevMember; + } + function getNodeToInsertConstantBefore(node, scope) { + Debug.assert(!isClassLike(scope)); + let prevScope; + for (let curr = node; curr !== scope; curr = curr.parent) { + if (isScope(curr)) { + prevScope = curr; + } + } + for (let curr = (prevScope || node).parent; ; curr = curr.parent) { + if (isBlockLike(curr)) { + let prevStatement; + for (const statement of curr.statements) { + if (statement.pos > node.pos) { + break; + } + prevStatement = statement; + } + if (!prevStatement && isCaseClause(curr)) { + Debug.assert(isSwitchStatement(curr.parent.parent), "Grandparent isn't a switch statement"); + return curr.parent.parent; + } + return Debug.checkDefined(prevStatement, "prevStatement failed to get set"); + } + Debug.assert(curr !== scope, "Didn't encounter a block-like before encountering scope"); + } + } + function getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes) { + const variableAssignments = map4(exposedVariableDeclarations, (v8) => factory.createShorthandPropertyAssignment(v8.symbol.name)); + const writeAssignments = map4(writes, (w6) => factory.createShorthandPropertyAssignment(w6.symbol.name)); + return variableAssignments === void 0 ? writeAssignments : writeAssignments === void 0 ? variableAssignments : variableAssignments.concat(writeAssignments); + } + function isReadonlyArray(v8) { + return isArray3(v8); + } + function getEnclosingTextRange(targetRange, sourceFile) { + return isReadonlyArray(targetRange.range) ? { pos: first(targetRange.range).getStart(sourceFile), end: last2(targetRange.range).getEnd() } : targetRange.range; + } + function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFile, checker, cancellationToken) { + const allTypeParameterUsages = /* @__PURE__ */ new Map(); + const usagesPerScope = []; + const substitutionsPerScope = []; + const functionErrorsPerScope = []; + const constantErrorsPerScope = []; + const visibleDeclarationsInExtractedRange = []; + const exposedVariableSymbolSet = /* @__PURE__ */ new Map(); + const exposedVariableDeclarations = []; + let firstExposedNonVariableDeclaration; + const expression = !isReadonlyArray(targetRange.range) ? targetRange.range : targetRange.range.length === 1 && isExpressionStatement(targetRange.range[0]) ? targetRange.range[0].expression : void 0; + let expressionDiagnostic; + if (expression === void 0) { + const statements = targetRange.range; + const start = first(statements).getStart(); + const end = last2(statements).end; + expressionDiagnostic = createFileDiagnostic(sourceFile, start, end - start, Messages6.expressionExpected); + } else if (checker.getTypeAtLocation(expression).flags & (16384 | 131072)) { + expressionDiagnostic = createDiagnosticForNode(expression, Messages6.uselessConstantType); + } + for (const scope of scopes) { + usagesPerScope.push({ usages: /* @__PURE__ */ new Map(), typeParameterUsages: /* @__PURE__ */ new Map(), substitutions: /* @__PURE__ */ new Map() }); + substitutionsPerScope.push(/* @__PURE__ */ new Map()); + functionErrorsPerScope.push([]); + const constantErrors = []; + if (expressionDiagnostic) { + constantErrors.push(expressionDiagnostic); + } + if (isClassLike(scope) && isInJSFile(scope)) { + constantErrors.push(createDiagnosticForNode(scope, Messages6.cannotExtractToJSClass)); + } + if (isArrowFunction(scope) && !isBlock2(scope.body)) { + constantErrors.push(createDiagnosticForNode(scope, Messages6.cannotExtractToExpressionArrowFunction)); + } + constantErrorsPerScope.push(constantErrors); + } + const seenUsages = /* @__PURE__ */ new Map(); + const target = isReadonlyArray(targetRange.range) ? factory.createBlock(targetRange.range) : targetRange.range; + const unmodifiedNode = isReadonlyArray(targetRange.range) ? first(targetRange.range) : targetRange.range; + const inGenericContext = isInGenericContext(unmodifiedNode); + collectUsages(target); + if (inGenericContext && !isReadonlyArray(targetRange.range) && !isJsxAttribute(targetRange.range)) { + const contextualType = checker.getContextualType(targetRange.range); + recordTypeParameterUsages(contextualType); + } + if (allTypeParameterUsages.size > 0) { + const seenTypeParameterUsages = /* @__PURE__ */ new Map(); + let i7 = 0; + for (let curr = unmodifiedNode; curr !== void 0 && i7 < scopes.length; curr = curr.parent) { + if (curr === scopes[i7]) { + seenTypeParameterUsages.forEach((typeParameter, id) => { + usagesPerScope[i7].typeParameterUsages.set(id, typeParameter); + }); + i7++; + } + if (isDeclarationWithTypeParameters(curr)) { + for (const typeParameterDecl of getEffectiveTypeParameterDeclarations(curr)) { + const typeParameter = checker.getTypeAtLocation(typeParameterDecl); + if (allTypeParameterUsages.has(typeParameter.id.toString())) { + seenTypeParameterUsages.set(typeParameter.id.toString(), typeParameter); + } + } + } + } + Debug.assert(i7 === scopes.length, "Should have iterated all scopes"); + } + if (visibleDeclarationsInExtractedRange.length) { + const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : getEnclosingBlockScopeContainer(scopes[0]); + forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + for (let i7 = 0; i7 < scopes.length; i7++) { + const scopeUsages = usagesPerScope[i7]; + if (i7 > 0 && (scopeUsages.usages.size > 0 || scopeUsages.typeParameterUsages.size > 0)) { + const errorNode = isReadonlyArray(targetRange.range) ? targetRange.range[0] : targetRange.range; + constantErrorsPerScope[i7].push(createDiagnosticForNode(errorNode, Messages6.cannotAccessVariablesFromNestedScopes)); + } + if (targetRange.facts & 16 && isClassLike(scopes[i7])) { + functionErrorsPerScope[i7].push(createDiagnosticForNode(targetRange.thisNode, Messages6.cannotExtractFunctionsContainingThisToMethod)); + } + let hasWrite = false; + let readonlyClassPropertyWrite; + usagesPerScope[i7].usages.forEach((value2) => { + if (value2.usage === 2) { + hasWrite = true; + if (value2.symbol.flags & 106500 && value2.symbol.valueDeclaration && hasEffectiveModifier( + value2.symbol.valueDeclaration, + 8 + /* Readonly */ + )) { + readonlyClassPropertyWrite = value2.symbol.valueDeclaration; + } + } + }); + Debug.assert(isReadonlyArray(targetRange.range) || exposedVariableDeclarations.length === 0, "No variable declarations expected if something was extracted"); + if (hasWrite && !isReadonlyArray(targetRange.range)) { + const diag2 = createDiagnosticForNode(targetRange.range, Messages6.cannotWriteInExpression); + functionErrorsPerScope[i7].push(diag2); + constantErrorsPerScope[i7].push(diag2); + } else if (readonlyClassPropertyWrite && i7 > 0) { + const diag2 = createDiagnosticForNode(readonlyClassPropertyWrite, Messages6.cannotExtractReadonlyPropertyInitializerOutsideConstructor); + functionErrorsPerScope[i7].push(diag2); + constantErrorsPerScope[i7].push(diag2); + } else if (firstExposedNonVariableDeclaration) { + const diag2 = createDiagnosticForNode(firstExposedNonVariableDeclaration, Messages6.cannotExtractExportedEntity); + functionErrorsPerScope[i7].push(diag2); + constantErrorsPerScope[i7].push(diag2); + } + } + return { target, usagesPerScope, functionErrorsPerScope, constantErrorsPerScope, exposedVariableDeclarations }; + function isInGenericContext(node) { + return !!findAncestor(node, (n7) => isDeclarationWithTypeParameters(n7) && getEffectiveTypeParameterDeclarations(n7).length !== 0); + } + function recordTypeParameterUsages(type3) { + const symbolWalker = checker.getSymbolWalker(() => (cancellationToken.throwIfCancellationRequested(), true)); + const { visitedTypes } = symbolWalker.walkType(type3); + for (const visitedType of visitedTypes) { + if (visitedType.isTypeParameter()) { + allTypeParameterUsages.set(visitedType.id.toString(), visitedType); + } + } + } + function collectUsages(node, valueUsage = 1) { + if (inGenericContext) { + const type3 = checker.getTypeAtLocation(node); + recordTypeParameterUsages(type3); + } + if (isDeclaration(node) && node.symbol) { + visibleDeclarationsInExtractedRange.push(node); + } + if (isAssignmentExpression(node)) { + collectUsages( + node.left, + 2 + /* Write */ + ); + collectUsages(node.right); + } else if (isUnaryExpressionWithWrite(node)) { + collectUsages( + node.operand, + 2 + /* Write */ + ); + } else if (isPropertyAccessExpression(node) || isElementAccessExpression(node)) { + forEachChild(node, collectUsages); + } else if (isIdentifier(node)) { + if (!node.parent) { + return; + } + if (isQualifiedName(node.parent) && node !== node.parent.left) { + return; + } + if (isPropertyAccessExpression(node.parent) && node !== node.parent.expression) { + return; + } + recordUsage( + node, + valueUsage, + /*isTypeNode*/ + isPartOfTypeNode(node) + ); + } else { + forEachChild(node, collectUsages); + } + } + function recordUsage(n7, usage, isTypeNode2) { + const symbolId = recordUsagebySymbol(n7, usage, isTypeNode2); + if (symbolId) { + for (let i7 = 0; i7 < scopes.length; i7++) { + const substitution = substitutionsPerScope[i7].get(symbolId); + if (substitution) { + usagesPerScope[i7].substitutions.set(getNodeId(n7).toString(), substitution); + } + } + } + } + function recordUsagebySymbol(identifier, usage, isTypeName) { + const symbol = getSymbolReferencedByIdentifier(identifier); + if (!symbol) { + return void 0; + } + const symbolId = getSymbolId(symbol).toString(); + const lastUsage = seenUsages.get(symbolId); + if (lastUsage && lastUsage >= usage) { + return symbolId; + } + seenUsages.set(symbolId, usage); + if (lastUsage) { + for (const perScope of usagesPerScope) { + const prevEntry = perScope.usages.get(identifier.text); + if (prevEntry) { + perScope.usages.set(identifier.text, { usage, symbol, node: identifier }); + } + } + return symbolId; + } + const decls = symbol.getDeclarations(); + const declInFile = decls && find2(decls, (d7) => d7.getSourceFile() === sourceFile); + if (!declInFile) { + return void 0; + } + if (rangeContainsStartEnd(enclosingTextRange, declInFile.getStart(), declInFile.end)) { + return void 0; + } + if (targetRange.facts & 2 && usage === 2) { + const diag2 = createDiagnosticForNode(identifier, Messages6.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators); + for (const errors of functionErrorsPerScope) { + errors.push(diag2); + } + for (const errors of constantErrorsPerScope) { + errors.push(diag2); + } + } + for (let i7 = 0; i7 < scopes.length; i7++) { + const scope = scopes[i7]; + const resolvedSymbol = checker.resolveName( + symbol.name, + scope, + symbol.flags, + /*excludeGlobals*/ + false + ); + if (resolvedSymbol === symbol) { + continue; + } + if (!substitutionsPerScope[i7].has(symbolId)) { + const substitution = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.exportSymbol || symbol, scope, isTypeName); + if (substitution) { + substitutionsPerScope[i7].set(symbolId, substitution); + } else if (isTypeName) { + if (!(symbol.flags & 262144)) { + const diag2 = createDiagnosticForNode(identifier, Messages6.typeWillNotBeVisibleInTheNewScope); + functionErrorsPerScope[i7].push(diag2); + constantErrorsPerScope[i7].push(diag2); + } + } else { + usagesPerScope[i7].usages.set(identifier.text, { usage, symbol, node: identifier }); + } + } + } + return symbolId; + } + function checkForUsedDeclarations(node) { + if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) { + return; + } + const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node); + if (sym) { + const decl = find2(visibleDeclarationsInExtractedRange, (d7) => d7.symbol === sym); + if (decl) { + if (isVariableDeclaration(decl)) { + const idString = decl.symbol.id.toString(); + if (!exposedVariableSymbolSet.has(idString)) { + exposedVariableDeclarations.push(decl); + exposedVariableSymbolSet.set(idString, true); + } + } else { + firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl; + } + } + } + forEachChild(node, checkForUsedDeclarations); + } + function getSymbolReferencedByIdentifier(identifier) { + return identifier.parent && isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier ? checker.getShorthandAssignmentValueSymbol(identifier.parent) : checker.getSymbolAtLocation(identifier); + } + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol, scopeDecl, isTypeNode2) { + if (!symbol) { + return void 0; + } + const decls = symbol.getDeclarations(); + if (decls && decls.some((d7) => d7.parent === scopeDecl)) { + return factory.createIdentifier(symbol.name); + } + const prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode2); + if (prefix === void 0) { + return void 0; + } + return isTypeNode2 ? factory.createQualifiedName(prefix, factory.createIdentifier(symbol.name)) : factory.createPropertyAccessExpression(prefix, symbol.name); + } + } + function getExtractableParent(node) { + return findAncestor(node, (node2) => node2.parent && isExtractableExpression(node2) && !isBinaryExpression(node2.parent)); + } + function isExtractableExpression(node) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 306: + return false; + } + switch (node.kind) { + case 11: + return parent22.kind !== 272 && parent22.kind !== 276; + case 230: + case 206: + case 208: + return false; + case 80: + return parent22.kind !== 208 && parent22.kind !== 276 && parent22.kind !== 281; + } + return true; + } + function isBlockLike(node) { + switch (node.kind) { + case 241: + case 312: + case 268: + case 296: + return true; + default: + return false; + } + } + function isInJSXContent(node) { + return isStringLiteralJsxAttribute(node) || (isJsxElement(node) || isJsxSelfClosingElement(node) || isJsxFragment(node)) && (isJsxElement(node.parent) || isJsxFragment(node.parent)); + } + function isStringLiteralJsxAttribute(node) { + return isStringLiteral(node) && node.parent && isJsxAttribute(node.parent); + } + var refactorName12, extractConstantAction, extractFunctionAction, Messages6, RangeFacts; + var init_extractSymbol = __esm2({ + "src/services/refactors/extractSymbol.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName12 = "Extract Symbol"; + extractConstantAction = { + name: "Extract Constant", + description: getLocaleSpecificMessage(Diagnostics.Extract_constant), + kind: "refactor.extract.constant" + }; + extractFunctionAction = { + name: "Extract Function", + description: getLocaleSpecificMessage(Diagnostics.Extract_function), + kind: "refactor.extract.function" + }; + registerRefactor(refactorName12, { + kinds: [ + extractConstantAction.kind, + extractFunctionAction.kind + ], + getEditsForAction: getRefactorEditsToExtractSymbol, + getAvailableActions: getRefactorActionsToExtractSymbol + }); + ((Messages22) => { + function createMessage(message) { + return { message, code: 0, category: 3, key: message }; + } + Messages22.cannotExtractRange = createMessage("Cannot extract range."); + Messages22.cannotExtractImport = createMessage("Cannot extract import statement."); + Messages22.cannotExtractSuper = createMessage("Cannot extract super call."); + Messages22.cannotExtractJSDoc = createMessage("Cannot extract JSDoc."); + Messages22.cannotExtractEmpty = createMessage("Cannot extract empty range."); + Messages22.expressionExpected = createMessage("expression expected."); + Messages22.uselessConstantType = createMessage("No reason to extract constant of type."); + Messages22.statementOrExpressionExpected = createMessage("Statement or expression expected."); + Messages22.cannotExtractRangeContainingConditionalBreakOrContinueStatements = createMessage("Cannot extract range containing conditional break or continue statements."); + Messages22.cannotExtractRangeContainingConditionalReturnStatement = createMessage("Cannot extract range containing conditional return statement."); + Messages22.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange = createMessage("Cannot extract range containing labeled break or continue with target outside of the range."); + Messages22.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators = createMessage("Cannot extract range containing writes to references located outside of the target range in generators."); + Messages22.typeWillNotBeVisibleInTheNewScope = createMessage("Type will not visible in the new scope."); + Messages22.functionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); + Messages22.cannotExtractIdentifier = createMessage("Select more than a single identifier."); + Messages22.cannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); + Messages22.cannotWriteInExpression = createMessage("Cannot write back side-effects when extracting an expression"); + Messages22.cannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); + Messages22.cannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); + Messages22.cannotAccessVariablesFromNestedScopes = createMessage("Cannot access variables from nested scopes"); + Messages22.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); + Messages22.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); + Messages22.cannotExtractFunctionsContainingThisToMethod = createMessage("Cannot extract functions containing this to method"); + })(Messages6 || (Messages6 = {})); + RangeFacts = /* @__PURE__ */ ((RangeFacts2) => { + RangeFacts2[RangeFacts2["None"] = 0] = "None"; + RangeFacts2[RangeFacts2["HasReturn"] = 1] = "HasReturn"; + RangeFacts2[RangeFacts2["IsGenerator"] = 2] = "IsGenerator"; + RangeFacts2[RangeFacts2["IsAsyncFunction"] = 4] = "IsAsyncFunction"; + RangeFacts2[RangeFacts2["UsesThis"] = 8] = "UsesThis"; + RangeFacts2[RangeFacts2["UsesThisInFunction"] = 16] = "UsesThisInFunction"; + RangeFacts2[RangeFacts2["InStaticRegion"] = 32] = "InStaticRegion"; + return RangeFacts2; + })(RangeFacts || {}); + } + }); + var ts_refactor_extractSymbol_exports = {}; + __export2(ts_refactor_extractSymbol_exports, { + Messages: () => Messages6, + RangeFacts: () => RangeFacts, + getRangeToExtract: () => getRangeToExtract2, + getRefactorActionsToExtractSymbol: () => getRefactorActionsToExtractSymbol, + getRefactorEditsToExtractSymbol: () => getRefactorEditsToExtractSymbol + }); + var init_ts_refactor_extractSymbol = __esm2({ + "src/services/_namespaces/ts.refactor.extractSymbol.ts"() { + "use strict"; + init_extractSymbol(); + } + }); + var actionName, actionDescription, generateGetSetAction; + var init_generateGetAccessorAndSetAccessor = __esm2({ + "src/services/refactors/generateGetAccessorAndSetAccessor.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + actionName = "Generate 'get' and 'set' accessors"; + actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors); + generateGetSetAction = { + name: actionName, + description: actionDescription, + kind: "refactor.rewrite.property.generateAccessors" + }; + registerRefactor(actionName, { + kinds: [generateGetSetAction.kind], + getEditsForAction: function getRefactorActionsToGenerateGetAndSetAccessors(context2, actionName2) { + if (!context2.endPosition) + return void 0; + const info2 = ts_codefix_exports.getAccessorConvertiblePropertyAtPosition(context2.file, context2.program, context2.startPosition, context2.endPosition); + Debug.assert(info2 && !isRefactorErrorInfo(info2), "Expected applicable refactor info"); + const edits = ts_codefix_exports.generateAccessorFromProperty(context2.file, context2.program, context2.startPosition, context2.endPosition, context2, actionName2); + if (!edits) + return void 0; + const renameFilename = context2.file.fileName; + const nameNeedRename = info2.renameAccessor ? info2.accessorName : info2.fieldName; + const renameLocationOffset = isIdentifier(nameNeedRename) ? 0 : -1; + const renameLocation = renameLocationOffset + getRenameLocation( + edits, + renameFilename, + nameNeedRename.text, + /*preferLastLocation*/ + isParameter(info2.declaration) + ); + return { renameFilename, renameLocation, edits }; + }, + getAvailableActions(context2) { + if (!context2.endPosition) + return emptyArray; + const info2 = ts_codefix_exports.getAccessorConvertiblePropertyAtPosition(context2.file, context2.program, context2.startPosition, context2.endPosition, context2.triggerReason === "invoked"); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + return [{ + name: actionName, + description: actionDescription, + actions: [generateGetSetAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: actionName, + description: actionDescription, + actions: [{ ...generateGetSetAction, notApplicableReason: info2.error }] + }]; + } + return emptyArray; + } + }); + } + }); + var ts_refactor_generateGetAccessorAndSetAccessor_exports = {}; + var init_ts_refactor_generateGetAccessorAndSetAccessor = __esm2({ + "src/services/_namespaces/ts.refactor.generateGetAccessorAndSetAccessor.ts"() { + "use strict"; + init_generateGetAccessorAndSetAccessor(); + } + }); + function getRefactorEditsToInferReturnType(context2) { + const info2 = getInfo4(context2); + if (info2 && !isRefactorErrorInfo(info2)) { + const edits = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange7(context2.file, t8, info2.declaration, info2.returnTypeNode)); + return { renameFilename: void 0, renameLocation: void 0, edits }; + } + return void 0; + } + function getRefactorActionsToInferReturnType(context2) { + const info2 = getInfo4(context2); + if (!info2) + return emptyArray; + if (!isRefactorErrorInfo(info2)) { + return [{ + name: refactorName13, + description: refactorDescription7, + actions: [inferReturnTypeAction] + }]; + } + if (context2.preferences.provideRefactorNotApplicableReason) { + return [{ + name: refactorName13, + description: refactorDescription7, + actions: [{ ...inferReturnTypeAction, notApplicableReason: info2.error }] + }]; + } + return emptyArray; + } + function doChange7(sourceFile, changes, declaration, typeNode) { + const closeParen = findChildOfKind(declaration, 22, sourceFile); + const needParens = isArrowFunction(declaration) && closeParen === void 0; + const endNode2 = needParens ? first(declaration.parameters) : closeParen; + if (endNode2) { + if (needParens) { + changes.insertNodeBefore(sourceFile, endNode2, factory.createToken( + 21 + /* OpenParenToken */ + )); + changes.insertNodeAfter(sourceFile, endNode2, factory.createToken( + 22 + /* CloseParenToken */ + )); + } + changes.insertNodeAt(sourceFile, endNode2.end, typeNode, { prefix: ": " }); + } + } + function getInfo4(context2) { + if (isInJSFile(context2.file) || !refactorKindBeginsWith(inferReturnTypeAction.kind, context2.kind)) + return; + const token = getTouchingPropertyName(context2.file, context2.startPosition); + const declaration = findAncestor(token, (n7) => isBlock2(n7) || n7.parent && isArrowFunction(n7.parent) && (n7.kind === 39 || n7.parent.body === n7) ? "quit" : isConvertibleDeclaration(n7)); + if (!declaration || !declaration.body || declaration.type) { + return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) }; + } + const typeChecker = context2.program.getTypeChecker(); + const returnType = tryGetReturnType(typeChecker, declaration); + if (!returnType) { + return { error: getLocaleSpecificMessage(Diagnostics.Could_not_determine_function_return_type) }; + } + const returnTypeNode = typeChecker.typeToTypeNode( + returnType, + declaration, + 1 + /* NoTruncation */ + ); + if (returnTypeNode) { + return { declaration, returnTypeNode }; + } + } + function isConvertibleDeclaration(node) { + switch (node.kind) { + case 262: + case 218: + case 219: + case 174: + return true; + default: + return false; + } + } + function tryGetReturnType(typeChecker, node) { + if (typeChecker.isImplementationOfOverload(node)) { + const signatures = typeChecker.getTypeAtLocation(node).getCallSignatures(); + if (signatures.length > 1) { + return typeChecker.getUnionType(mapDefined(signatures, (s7) => s7.getReturnType())); + } + } + const signature = typeChecker.getSignatureFromDeclaration(node); + if (signature) { + return typeChecker.getReturnTypeOfSignature(signature); + } + } + var refactorName13, refactorDescription7, inferReturnTypeAction; + var init_inferFunctionReturnType = __esm2({ + "src/services/refactors/inferFunctionReturnType.ts"() { + "use strict"; + init_ts4(); + init_ts_refactor(); + refactorName13 = "Infer function return type"; + refactorDescription7 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type); + inferReturnTypeAction = { + name: refactorName13, + description: refactorDescription7, + kind: "refactor.rewrite.function.returnType" + }; + registerRefactor(refactorName13, { + kinds: [inferReturnTypeAction.kind], + getEditsForAction: getRefactorEditsToInferReturnType, + getAvailableActions: getRefactorActionsToInferReturnType + }); + } + }); + var ts_refactor_inferFunctionReturnType_exports = {}; + var init_ts_refactor_inferFunctionReturnType = __esm2({ + "src/services/_namespaces/ts.refactor.inferFunctionReturnType.ts"() { + "use strict"; + init_inferFunctionReturnType(); + } + }); + var ts_refactor_exports = {}; + __export2(ts_refactor_exports, { + addExportToChanges: () => addExportToChanges, + addExports: () => addExports, + addNewFileToTsconfig: () => addNewFileToTsconfig, + addOrRemoveBracesToArrowFunction: () => ts_refactor_addOrRemoveBracesToArrowFunction_exports, + containsJsx: () => containsJsx, + convertArrowFunctionOrFunctionExpression: () => ts_refactor_convertArrowFunctionOrFunctionExpression_exports, + convertParamsToDestructuredObject: () => ts_refactor_convertParamsToDestructuredObject_exports, + convertStringOrTemplateLiteral: () => ts_refactor_convertStringOrTemplateLiteral_exports, + convertToOptionalChainExpression: () => ts_refactor_convertToOptionalChainExpression_exports, + createNewFileName: () => createNewFileName, + createOldFileImportsFromTargetFile: () => createOldFileImportsFromTargetFile, + deleteMovedStatements: () => deleteMovedStatements, + deleteUnusedImports: () => deleteUnusedImports, + deleteUnusedOldImports: () => deleteUnusedOldImports, + doChangeNamedToNamespaceOrDefault: () => doChangeNamedToNamespaceOrDefault, + extractSymbol: () => ts_refactor_extractSymbol_exports, + filterImport: () => filterImport, + forEachImportInStatement: () => forEachImportInStatement, + generateGetAccessorAndSetAccessor: () => ts_refactor_generateGetAccessorAndSetAccessor_exports, + getApplicableRefactors: () => getApplicableRefactors, + getEditsForRefactor: () => getEditsForRefactor, + getStatementsToMove: () => getStatementsToMove, + getTopLevelDeclarationStatement: () => getTopLevelDeclarationStatement, + getUsageInfo: () => getUsageInfo, + inferFunctionReturnType: () => ts_refactor_inferFunctionReturnType_exports, + isRefactorErrorInfo: () => isRefactorErrorInfo, + isTopLevelDeclaration: () => isTopLevelDeclaration, + makeImportOrRequire: () => makeImportOrRequire, + moduleSpecifierFromImport: () => moduleSpecifierFromImport, + nameOfTopLevelDeclaration: () => nameOfTopLevelDeclaration, + refactorKindBeginsWith: () => refactorKindBeginsWith, + registerRefactor: () => registerRefactor, + updateImportsInOtherFiles: () => updateImportsInOtherFiles + }); + var init_ts_refactor = __esm2({ + "src/services/_namespaces/ts.refactor.ts"() { + "use strict"; + init_refactorProvider(); + init_convertExport(); + init_convertImport(); + init_extractType(); + init_helpers(); + init_inlineVariable(); + init_moveToNewFile(); + init_moveToFile(); + init_ts_refactor_addOrRemoveBracesToArrowFunction(); + init_ts_refactor_convertArrowFunctionOrFunctionExpression(); + init_ts_refactor_convertParamsToDestructuredObject(); + init_ts_refactor_convertStringOrTemplateLiteral(); + init_ts_refactor_convertToOptionalChainExpression(); + init_ts_refactor_extractSymbol(); + init_ts_refactor_generateGetAccessorAndSetAccessor(); + init_ts_refactor_inferFunctionReturnType(); + } + }); + function getSemanticClassifications2(program, cancellationToken, sourceFile, span) { + const classifications = getEncodedSemanticClassifications2(program, cancellationToken, sourceFile, span); + Debug.assert(classifications.spans.length % 3 === 0); + const dense = classifications.spans; + const result2 = []; + for (let i7 = 0; i7 < dense.length; i7 += 3) { + result2.push({ + textSpan: createTextSpan(dense[i7], dense[i7 + 1]), + classificationType: dense[i7 + 2] + }); + } + return result2; + } + function getEncodedSemanticClassifications2(program, cancellationToken, sourceFile, span) { + return { + spans: getSemanticTokens(program, sourceFile, span, cancellationToken), + endOfLineState: 0 + /* None */ + }; + } + function getSemanticTokens(program, sourceFile, span, cancellationToken) { + const resultTokens = []; + const collector = (node, typeIdx, modifierSet) => { + resultTokens.push(node.getStart(sourceFile), node.getWidth(sourceFile), (typeIdx + 1 << 8) + modifierSet); + }; + if (program && sourceFile) { + collectTokens(program, sourceFile, span, collector, cancellationToken); + } + return resultTokens; + } + function collectTokens(program, sourceFile, span, collector, cancellationToken) { + const typeChecker = program.getTypeChecker(); + let inJSXElement = false; + function visit7(node) { + switch (node.kind) { + case 267: + case 263: + case 264: + case 262: + case 231: + case 218: + case 219: + cancellationToken.throwIfCancellationRequested(); + } + if (!node || !textSpanIntersectsWith(span, node.pos, node.getFullWidth()) || node.getFullWidth() === 0) { + return; + } + const prevInJSXElement = inJSXElement; + if (isJsxElement(node) || isJsxSelfClosingElement(node)) { + inJSXElement = true; + } + if (isJsxExpression(node)) { + inJSXElement = false; + } + if (isIdentifier(node) && !inJSXElement && !inImportClause(node) && !isInfinityOrNaNString(node.escapedText)) { + let symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + if (symbol.flags & 2097152) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + let typeIdx = classifySymbol2(symbol, getMeaningFromLocation(node)); + if (typeIdx !== void 0) { + let modifierSet = 0; + if (node.parent) { + const parentIsDeclaration = isBindingElement(node.parent) || tokenFromDeclarationMapping.get(node.parent.kind) === typeIdx; + if (parentIsDeclaration && node.parent.name === node) { + modifierSet = 1 << 0; + } + } + if (typeIdx === 6 && isRightSideOfQualifiedNameOrPropertyAccess2(node)) { + typeIdx = 9; + } + typeIdx = reclassifyByType(typeChecker, node, typeIdx); + const decl = symbol.valueDeclaration; + if (decl) { + const modifiers = getCombinedModifierFlags(decl); + const nodeFlags = getCombinedNodeFlags(decl); + if (modifiers & 256) { + modifierSet |= 1 << 1; + } + if (modifiers & 1024) { + modifierSet |= 1 << 2; + } + if (typeIdx !== 0 && typeIdx !== 2) { + if (modifiers & 8 || nodeFlags & 2 || symbol.getFlags() & 8) { + modifierSet |= 1 << 3; + } + } + if ((typeIdx === 7 || typeIdx === 10) && isLocalDeclaration(decl, sourceFile)) { + modifierSet |= 1 << 5; + } + if (program.isSourceFileDefaultLibrary(decl.getSourceFile())) { + modifierSet |= 1 << 4; + } + } else if (symbol.declarations && symbol.declarations.some((d7) => program.isSourceFileDefaultLibrary(d7.getSourceFile()))) { + modifierSet |= 1 << 4; + } + collector(node, typeIdx, modifierSet); + } + } + } + forEachChild(node, visit7); + inJSXElement = prevInJSXElement; + } + visit7(sourceFile); + } + function classifySymbol2(symbol, meaning) { + const flags = symbol.getFlags(); + if (flags & 32) { + return 0; + } else if (flags & 384) { + return 1; + } else if (flags & 524288) { + return 5; + } else if (flags & 64) { + if (meaning & 2) { + return 2; + } + } else if (flags & 262144) { + return 4; + } + let decl = symbol.valueDeclaration || symbol.declarations && symbol.declarations[0]; + if (decl && isBindingElement(decl)) { + decl = getDeclarationForBindingElement(decl); + } + return decl && tokenFromDeclarationMapping.get(decl.kind); + } + function reclassifyByType(typeChecker, node, typeIdx) { + if (typeIdx === 7 || typeIdx === 9 || typeIdx === 6) { + const type3 = typeChecker.getTypeAtLocation(node); + if (type3) { + const test = (condition) => { + return condition(type3) || type3.isUnion() && type3.types.some(condition); + }; + if (typeIdx !== 6 && test((t8) => t8.getConstructSignatures().length > 0)) { + return 0; + } + if (test((t8) => t8.getCallSignatures().length > 0) && !test((t8) => t8.getProperties().length > 0) || isExpressionInCallExpression(node)) { + return typeIdx === 9 ? 11 : 10; + } + } + } + return typeIdx; + } + function isLocalDeclaration(decl, sourceFile) { + if (isBindingElement(decl)) { + decl = getDeclarationForBindingElement(decl); + } + if (isVariableDeclaration(decl)) { + return (!isSourceFile(decl.parent.parent.parent) || isCatchClause(decl.parent)) && decl.getSourceFile() === sourceFile; + } else if (isFunctionDeclaration(decl)) { + return !isSourceFile(decl.parent) && decl.getSourceFile() === sourceFile; + } + return false; + } + function getDeclarationForBindingElement(element) { + while (true) { + if (isBindingElement(element.parent.parent)) { + element = element.parent.parent; + } else { + return element.parent.parent; + } + } + } + function inImportClause(node) { + const parent22 = node.parent; + return parent22 && (isImportClause(parent22) || isImportSpecifier(parent22) || isNamespaceImport(parent22)); + } + function isExpressionInCallExpression(node) { + while (isRightSideOfQualifiedNameOrPropertyAccess2(node)) { + node = node.parent; + } + return isCallExpression(node.parent) && node.parent.expression === node; + } + function isRightSideOfQualifiedNameOrPropertyAccess2(node) { + return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node; + } + var TokenEncodingConsts, TokenType, TokenModifier, tokenFromDeclarationMapping; + var init_classifier2020 = __esm2({ + "src/services/classifier2020.ts"() { + "use strict"; + init_ts4(); + TokenEncodingConsts = /* @__PURE__ */ ((TokenEncodingConsts2) => { + TokenEncodingConsts2[TokenEncodingConsts2["typeOffset"] = 8] = "typeOffset"; + TokenEncodingConsts2[TokenEncodingConsts2["modifierMask"] = 255] = "modifierMask"; + return TokenEncodingConsts2; + })(TokenEncodingConsts || {}); + TokenType = /* @__PURE__ */ ((TokenType2) => { + TokenType2[TokenType2["class"] = 0] = "class"; + TokenType2[TokenType2["enum"] = 1] = "enum"; + TokenType2[TokenType2["interface"] = 2] = "interface"; + TokenType2[TokenType2["namespace"] = 3] = "namespace"; + TokenType2[TokenType2["typeParameter"] = 4] = "typeParameter"; + TokenType2[TokenType2["type"] = 5] = "type"; + TokenType2[TokenType2["parameter"] = 6] = "parameter"; + TokenType2[TokenType2["variable"] = 7] = "variable"; + TokenType2[TokenType2["enumMember"] = 8] = "enumMember"; + TokenType2[TokenType2["property"] = 9] = "property"; + TokenType2[TokenType2["function"] = 10] = "function"; + TokenType2[TokenType2["member"] = 11] = "member"; + return TokenType2; + })(TokenType || {}); + TokenModifier = /* @__PURE__ */ ((TokenModifier2) => { + TokenModifier2[TokenModifier2["declaration"] = 0] = "declaration"; + TokenModifier2[TokenModifier2["static"] = 1] = "static"; + TokenModifier2[TokenModifier2["async"] = 2] = "async"; + TokenModifier2[TokenModifier2["readonly"] = 3] = "readonly"; + TokenModifier2[TokenModifier2["defaultLibrary"] = 4] = "defaultLibrary"; + TokenModifier2[TokenModifier2["local"] = 5] = "local"; + return TokenModifier2; + })(TokenModifier || {}); + tokenFromDeclarationMapping = /* @__PURE__ */ new Map([ + [ + 260, + 7 + /* variable */ + ], + [ + 169, + 6 + /* parameter */ + ], + [ + 172, + 9 + /* property */ + ], + [ + 267, + 3 + /* namespace */ + ], + [ + 266, + 1 + /* enum */ + ], + [ + 306, + 8 + /* enumMember */ + ], + [ + 263, + 0 + /* class */ + ], + [ + 174, + 11 + /* member */ + ], + [ + 262, + 10 + /* function */ + ], + [ + 218, + 10 + /* function */ + ], + [ + 173, + 11 + /* member */ + ], + [ + 177, + 9 + /* property */ + ], + [ + 178, + 9 + /* property */ + ], + [ + 171, + 9 + /* property */ + ], + [ + 264, + 2 + /* interface */ + ], + [ + 265, + 5 + /* type */ + ], + [ + 168, + 4 + /* typeParameter */ + ], + [ + 303, + 9 + /* property */ + ], + [ + 304, + 9 + /* property */ + ] + ]); + } + }); + function createNode2(kind, pos, end, parent22) { + const node = isNodeKind(kind) ? new NodeObject(kind, pos, end) : kind === 80 ? new IdentifierObject(80, pos, end) : kind === 81 ? new PrivateIdentifierObject(81, pos, end) : new TokenObject(kind, pos, end); + node.parent = parent22; + node.flags = parent22.flags & 101441536; + return node; + } + function createChildren(node, sourceFile) { + if (!isNodeKind(node.kind)) { + return emptyArray; + } + const children = []; + if (isJSDocCommentContainingNode(node)) { + node.forEachChild((child) => { + children.push(child); + }); + return children; + } + scanner.setText((sourceFile || node.getSourceFile()).text); + let pos = node.pos; + const processNode = (child) => { + addSyntheticNodes(children, pos, child.pos, node); + children.push(child); + pos = child.end; + }; + const processNodes = (nodes) => { + addSyntheticNodes(children, pos, nodes.pos, node); + children.push(createSyntaxList(nodes, node)); + pos = nodes.end; + }; + forEach4(node.jsDoc, processNode); + pos = node.pos; + node.forEachChild(processNode, processNodes); + addSyntheticNodes(children, pos, node.end, node); + scanner.setText(void 0); + return children; + } + function addSyntheticNodes(nodes, pos, end, parent22) { + scanner.resetTokenState(pos); + while (pos < end) { + const token = scanner.scan(); + const textPos = scanner.getTokenEnd(); + if (textPos <= end) { + if (token === 80) { + if (hasTabstop(parent22)) { + continue; + } + Debug.fail(`Did not expect ${Debug.formatSyntaxKind(parent22.kind)} to have an Identifier in its trivia`); + } + nodes.push(createNode2(token, pos, textPos, parent22)); + } + pos = textPos; + if (token === 1) { + break; + } + } + } + function createSyntaxList(nodes, parent22) { + const list = createNode2(358, nodes.pos, nodes.end, parent22); + list._children = []; + let pos = nodes.pos; + for (const node of nodes) { + addSyntheticNodes(list._children, pos, node.pos, parent22); + list._children.push(node); + pos = node.end; + } + addSyntheticNodes(list._children, pos, nodes.end, parent22); + return list; + } + function hasJSDocInheritDocTag(node) { + return getJSDocTags(node).some((tag) => tag.tagName.text === "inheritDoc" || tag.tagName.text === "inheritdoc"); + } + function getJsDocTagsOfDeclarations(declarations, checker) { + if (!declarations) + return emptyArray; + let tags6 = ts_JsDoc_exports.getJsDocTagsFromDeclarations(declarations, checker); + if (checker && (tags6.length === 0 || declarations.some(hasJSDocInheritDocTag))) { + const seenSymbols = /* @__PURE__ */ new Set(); + for (const declaration of declarations) { + const inheritedTags = findBaseOfDeclaration(checker, declaration, (symbol) => { + var _a2; + if (!seenSymbols.has(symbol)) { + seenSymbols.add(symbol); + if (declaration.kind === 177 || declaration.kind === 178) { + return symbol.getContextualJsDocTags(declaration, checker); + } + return ((_a2 = symbol.declarations) == null ? void 0 : _a2.length) === 1 ? symbol.getJsDocTags() : void 0; + } + }); + if (inheritedTags) { + tags6 = [...inheritedTags, ...tags6]; + } + } + } + return tags6; + } + function getDocumentationComment(declarations, checker) { + if (!declarations) + return emptyArray; + let doc = ts_JsDoc_exports.getJsDocCommentsFromDeclarations(declarations, checker); + if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) { + const seenSymbols = /* @__PURE__ */ new Set(); + for (const declaration of declarations) { + const inheritedDocs = findBaseOfDeclaration(checker, declaration, (symbol) => { + if (!seenSymbols.has(symbol)) { + seenSymbols.add(symbol); + if (declaration.kind === 177 || declaration.kind === 178) { + return symbol.getContextualDocumentationComment(declaration, checker); + } + return symbol.getDocumentationComment(checker); + } + }); + if (inheritedDocs) + doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(lineBreakPart(), doc); + } + } + return doc; + } + function findBaseOfDeclaration(checker, declaration, cb) { + var _a2; + const classOrInterfaceDeclaration = ((_a2 = declaration.parent) == null ? void 0 : _a2.kind) === 176 ? declaration.parent.parent : declaration.parent; + if (!classOrInterfaceDeclaration) + return; + const isStaticMember = hasStaticModifier(declaration); + return firstDefined(getAllSuperTypeNodes(classOrInterfaceDeclaration), (superTypeNode) => { + const baseType = checker.getTypeAtLocation(superTypeNode); + const type3 = isStaticMember && baseType.symbol ? checker.getTypeOfSymbol(baseType.symbol) : baseType; + const symbol = checker.getPropertyOfType(type3, declaration.symbol.name); + return symbol ? cb(symbol) : void 0; + }); + } + function getServicesObjectAllocator() { + return { + getNodeConstructor: () => NodeObject, + getTokenConstructor: () => TokenObject, + getIdentifierConstructor: () => IdentifierObject, + getPrivateIdentifierConstructor: () => PrivateIdentifierObject, + getSourceFileConstructor: () => SourceFileObject, + getSymbolConstructor: () => SymbolObject, + getTypeConstructor: () => TypeObject, + getSignatureConstructor: () => SignatureObject, + getSourceMapSourceConstructor: () => SourceMapSourceObject + }; + } + function toEditorSettings(optionsAsMap) { + let allPropertiesAreCamelCased = true; + for (const key in optionsAsMap) { + if (hasProperty(optionsAsMap, key) && !isCamelCase(key)) { + allPropertiesAreCamelCased = false; + break; + } + } + if (allPropertiesAreCamelCased) { + return optionsAsMap; + } + const settings = {}; + for (const key in optionsAsMap) { + if (hasProperty(optionsAsMap, key)) { + const newKey = isCamelCase(key) ? key : key.charAt(0).toLowerCase() + key.substr(1); + settings[newKey] = optionsAsMap[key]; + } + } + return settings; + } + function isCamelCase(s7) { + return !s7.length || s7.charAt(0) === s7.charAt(0).toLowerCase(); + } + function displayPartsToString(displayParts) { + if (displayParts) { + return map4(displayParts, (displayPart2) => displayPart2.text).join(""); + } + return ""; + } + function getDefaultCompilerOptions2() { + return { + target: 1, + jsx: 1 + /* Preserve */ + }; + } + function getSupportedCodeFixes() { + return ts_codefix_exports.getSupportedErrorCodes(); + } + function setSourceFileFields(sourceFile, scriptSnapshot, version22) { + sourceFile.version = version22; + sourceFile.scriptSnapshot = scriptSnapshot; + } + function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version22, setNodeParents, scriptKind) { + const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind); + setSourceFileFields(sourceFile, scriptSnapshot, version22); + return sourceFile; + } + function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version22, textChangeRange, aggressiveChecks) { + if (textChangeRange) { + if (version22 !== sourceFile.version) { + let newText; + const prefix = textChangeRange.span.start !== 0 ? sourceFile.text.substr(0, textChangeRange.span.start) : ""; + const suffix = textSpanEnd(textChangeRange.span) !== sourceFile.text.length ? sourceFile.text.substr(textSpanEnd(textChangeRange.span)) : ""; + if (textChangeRange.newLength === 0) { + newText = prefix && suffix ? prefix + suffix : prefix || suffix; + } else { + const changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength); + newText = prefix && suffix ? prefix + changedText + suffix : prefix ? prefix + changedText : changedText + suffix; + } + const newSourceFile = updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); + setSourceFileFields(newSourceFile, scriptSnapshot, version22); + newSourceFile.nameTable = void 0; + if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) { + if (sourceFile.scriptSnapshot.dispose) { + sourceFile.scriptSnapshot.dispose(); + } + sourceFile.scriptSnapshot = void 0; + } + return newSourceFile; + } + } + const options = { + languageVersion: sourceFile.languageVersion, + impliedNodeFormat: sourceFile.impliedNodeFormat, + setExternalModuleIndicator: sourceFile.setExternalModuleIndicator, + jsDocParsingMode: sourceFile.jsDocParsingMode + }; + return createLanguageServiceSourceFile( + sourceFile.fileName, + scriptSnapshot, + options, + version22, + /*setNodeParents*/ + true, + sourceFile.scriptKind + ); + } + function createLanguageService(host, documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames(), host.getCurrentDirectory()), syntaxOnlyOrLanguageServiceMode) { + var _a2; + let languageServiceMode; + if (syntaxOnlyOrLanguageServiceMode === void 0) { + languageServiceMode = 0; + } else if (typeof syntaxOnlyOrLanguageServiceMode === "boolean") { + languageServiceMode = syntaxOnlyOrLanguageServiceMode ? 2 : 0; + } else { + languageServiceMode = syntaxOnlyOrLanguageServiceMode; + } + const syntaxTreeCache = new SyntaxTreeCache(host); + let program; + let lastProjectVersion; + let lastTypesRootVersion = 0; + const cancellationToken = host.getCancellationToken ? new CancellationTokenObject(host.getCancellationToken()) : NoopCancellationToken; + const currentDirectory = host.getCurrentDirectory(); + maybeSetLocalizedDiagnosticMessages((_a2 = host.getLocalizedDiagnosticMessages) == null ? void 0 : _a2.bind(host)); + function log3(message) { + if (host.log) { + host.log(message); + } + } + const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host); + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2); + const sourceMapper = getSourceMapper({ + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, + getCurrentDirectory: () => currentDirectory, + getProgram, + fileExists: maybeBind(host, host.fileExists), + readFile: maybeBind(host, host.readFile), + getDocumentPositionMapper: maybeBind(host, host.getDocumentPositionMapper), + getSourceFileLike: maybeBind(host, host.getSourceFileLike), + log: log3 + }); + function getValidSourceFile(fileName) { + const sourceFile = program.getSourceFile(fileName); + if (!sourceFile) { + const error22 = new Error(`Could not find source file: '${fileName}'.`); + error22.ProgramFiles = program.getSourceFiles().map((f8) => f8.fileName); + throw error22; + } + return sourceFile; + } + function synchronizeHostData() { + if (host.updateFromProject && !host.updateFromProjectInProgress) { + host.updateFromProject(); + } else { + synchronizeHostDataWorker(); + } + } + function synchronizeHostDataWorker() { + var _a22, _b, _c; + Debug.assert( + languageServiceMode !== 2 + /* Syntactic */ + ); + if (host.getProjectVersion) { + const hostProjectVersion = host.getProjectVersion(); + if (hostProjectVersion) { + if (lastProjectVersion === hostProjectVersion && !((_a22 = host.hasChangedAutomaticTypeDirectiveNames) == null ? void 0 : _a22.call(host))) { + return; + } + lastProjectVersion = hostProjectVersion; + } + } + const typeRootsVersion = host.getTypeRootsVersion ? host.getTypeRootsVersion() : 0; + if (lastTypesRootVersion !== typeRootsVersion) { + log3("TypeRoots version has changed; provide new program"); + program = void 0; + lastTypesRootVersion = typeRootsVersion; + } + const rootFileNames = host.getScriptFileNames().slice(); + const newSettings = host.getCompilationSettings() || getDefaultCompilerOptions2(); + const hasInvalidatedResolutions = host.hasInvalidatedResolutions || returnFalse; + const hasInvalidatedLibResolutions = maybeBind(host, host.hasInvalidatedLibResolutions) || returnFalse; + const hasChangedAutomaticTypeDirectiveNames = maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames); + const projectReferences = (_b = host.getProjectReferences) == null ? void 0 : _b.call(host); + let parsedCommandLines; + let compilerHost = { + getSourceFile: getOrCreateSourceFile, + getSourceFileByPath: getOrCreateSourceFileByPath, + getCancellationToken: () => cancellationToken, + getCanonicalFileName, + useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2, + getNewLine: () => getNewLineCharacter(newSettings), + getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2), + writeFile: noop4, + getCurrentDirectory: () => currentDirectory, + fileExists: (fileName) => host.fileExists(fileName), + readFile: (fileName) => host.readFile && host.readFile(fileName), + getSymlinkCache: maybeBind(host, host.getSymlinkCache), + realpath: maybeBind(host, host.realpath), + directoryExists: (directoryName) => { + return directoryProbablyExists(directoryName, host); + }, + getDirectories: (path2) => { + return host.getDirectories ? host.getDirectories(path2) : []; + }, + readDirectory: (path2, extensions6, exclude, include, depth) => { + Debug.checkDefined(host.readDirectory, "'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"); + return host.readDirectory(path2, extensions6, exclude, include, depth); + }, + onReleaseOldSourceFile, + onReleaseParsedCommandLine, + hasInvalidatedResolutions, + hasInvalidatedLibResolutions, + hasChangedAutomaticTypeDirectiveNames, + trace: maybeBind(host, host.trace), + resolveModuleNames: maybeBind(host, host.resolveModuleNames), + getModuleResolutionCache: maybeBind(host, host.getModuleResolutionCache), + createHash: maybeBind(host, host.createHash), + resolveTypeReferenceDirectives: maybeBind(host, host.resolveTypeReferenceDirectives), + resolveModuleNameLiterals: maybeBind(host, host.resolveModuleNameLiterals), + resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences), + resolveLibrary: maybeBind(host, host.resolveLibrary), + useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect), + getParsedCommandLine, + jsDocParsingMode: host.jsDocParsingMode + }; + const originalGetSourceFile = compilerHost.getSourceFile; + const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache( + compilerHost, + (fileName) => toPath2(fileName, currentDirectory, getCanonicalFileName), + (...args) => originalGetSourceFile.call(compilerHost, ...args) + ); + compilerHost.getSourceFile = getSourceFileWithCache; + (_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost); + const parseConfigHost = { + useCaseSensitiveFileNames: useCaseSensitiveFileNames2, + fileExists: (fileName) => compilerHost.fileExists(fileName), + readFile: (fileName) => compilerHost.readFile(fileName), + directoryExists: (f8) => compilerHost.directoryExists(f8), + getDirectories: (f8) => compilerHost.getDirectories(f8), + realpath: compilerHost.realpath, + readDirectory: (...args) => compilerHost.readDirectory(...args), + trace: compilerHost.trace, + getCurrentDirectory: compilerHost.getCurrentDirectory, + onUnRecoverableConfigFileDiagnostic: noop4 + }; + const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings); + let releasedScriptKinds = /* @__PURE__ */ new Set(); + if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { + compilerHost = void 0; + parsedCommandLines = void 0; + releasedScriptKinds = void 0; + return; + } + const options = { + rootNames: rootFileNames, + options: newSettings, + host: compilerHost, + oldProgram: program, + projectReferences + }; + program = createProgram(options); + compilerHost = void 0; + parsedCommandLines = void 0; + releasedScriptKinds = void 0; + sourceMapper.clearCache(); + program.getTypeChecker(); + return; + function getParsedCommandLine(fileName) { + const path2 = toPath2(fileName, currentDirectory, getCanonicalFileName); + const existing = parsedCommandLines == null ? void 0 : parsedCommandLines.get(path2); + if (existing !== void 0) + return existing || void 0; + const result2 = host.getParsedCommandLine ? host.getParsedCommandLine(fileName) : getParsedCommandLineOfConfigFileUsingSourceFile(fileName); + (parsedCommandLines || (parsedCommandLines = /* @__PURE__ */ new Map())).set(path2, result2 || false); + return result2; + } + function getParsedCommandLineOfConfigFileUsingSourceFile(configFileName) { + const result2 = getOrCreateSourceFile( + configFileName, + 100 + /* JSON */ + ); + if (!result2) + return void 0; + result2.path = toPath2(configFileName, currentDirectory, getCanonicalFileName); + result2.resolvedPath = result2.path; + result2.originalFileName = result2.fileName; + return parseJsonSourceFileConfigFileContent( + result2, + parseConfigHost, + getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), + /*existingOptions*/ + void 0, + getNormalizedAbsolutePath(configFileName, currentDirectory) + ); + } + function onReleaseParsedCommandLine(configFileName, oldResolvedRef, oldOptions) { + var _a3; + if (host.getParsedCommandLine) { + (_a3 = host.onReleaseParsedCommandLine) == null ? void 0 : _a3.call(host, configFileName, oldResolvedRef, oldOptions); + } else if (oldResolvedRef) { + onReleaseOldSourceFile(oldResolvedRef.sourceFile, oldOptions); + } + } + function onReleaseOldSourceFile(oldSourceFile, oldOptions) { + const oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldOptions); + documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, oldSettingsKey, oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); + } + function getOrCreateSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) { + return getOrCreateSourceFileByPath(fileName, toPath2(fileName, currentDirectory, getCanonicalFileName), languageVersionOrOptions, onError, shouldCreateNewSourceFile); + } + function getOrCreateSourceFileByPath(fileName, path2, languageVersionOrOptions, _onError, shouldCreateNewSourceFile) { + Debug.assert(compilerHost, "getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host."); + const scriptSnapshot = host.getScriptSnapshot(fileName); + if (!scriptSnapshot) { + return void 0; + } + const scriptKind = getScriptKind(fileName, host); + const scriptVersion = host.getScriptVersion(fileName); + if (!shouldCreateNewSourceFile) { + const oldSourceFile = program && program.getSourceFileByPath(path2); + if (oldSourceFile) { + if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) { + return documentRegistry.updateDocumentWithKey(fileName, path2, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); + } else { + documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat); + releasedScriptKinds.add(oldSourceFile.resolvedPath); + } + } + } + return documentRegistry.acquireDocumentWithKey(fileName, path2, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions); + } + } + function getProgram() { + if (languageServiceMode === 2) { + Debug.assert(program === void 0); + return void 0; + } + synchronizeHostData(); + return program; + } + function getAutoImportProvider() { + var _a22; + return (_a22 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a22.call(host); + } + function updateIsDefinitionOfReferencedSymbols(referencedSymbols, knownSymbolSpans) { + const checker = program.getTypeChecker(); + const symbol = getSymbolForProgram(); + if (!symbol) + return false; + for (const referencedSymbol of referencedSymbols) { + for (const ref of referencedSymbol.references) { + const refNode = getNodeForSpan(ref); + Debug.assertIsDefined(refNode); + if (knownSymbolSpans.has(ref) || ts_FindAllReferences_exports.isDeclarationOfSymbol(refNode, symbol)) { + knownSymbolSpans.add(ref); + ref.isDefinition = true; + const mappedSpan = getMappedDocumentSpan(ref, sourceMapper, maybeBind(host, host.fileExists)); + if (mappedSpan) { + knownSymbolSpans.add(mappedSpan); + } + } else { + ref.isDefinition = false; + } + } + } + return true; + function getSymbolForProgram() { + for (const referencedSymbol of referencedSymbols) { + for (const ref of referencedSymbol.references) { + if (knownSymbolSpans.has(ref)) { + const refNode = getNodeForSpan(ref); + Debug.assertIsDefined(refNode); + return checker.getSymbolAtLocation(refNode); + } + const mappedSpan = getMappedDocumentSpan(ref, sourceMapper, maybeBind(host, host.fileExists)); + if (mappedSpan && knownSymbolSpans.has(mappedSpan)) { + const refNode = getNodeForSpan(mappedSpan); + if (refNode) { + return checker.getSymbolAtLocation(refNode); + } + } + } + } + return void 0; + } + function getNodeForSpan(docSpan) { + const sourceFile = program.getSourceFile(docSpan.fileName); + if (!sourceFile) + return void 0; + const rawNode = getTouchingPropertyName(sourceFile, docSpan.textSpan.start); + const adjustedNode = ts_FindAllReferences_exports.Core.getAdjustedNode(rawNode, { use: ts_FindAllReferences_exports.FindReferencesUse.References }); + return adjustedNode; + } + } + function cleanupSemanticCache() { + if (program) { + const key = documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()); + forEach4(program.getSourceFiles(), (f8) => documentRegistry.releaseDocumentWithKey(f8.resolvedPath, key, f8.scriptKind, f8.impliedNodeFormat)); + program = void 0; + } + } + function dispose() { + cleanupSemanticCache(); + host = void 0; + } + function getSyntacticDiagnostics(fileName) { + synchronizeHostData(); + return program.getSyntacticDiagnostics(getValidSourceFile(fileName), cancellationToken).slice(); + } + function getSemanticDiagnostics(fileName) { + synchronizeHostData(); + const targetSourceFile = getValidSourceFile(fileName); + const semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); + if (!getEmitDeclarations(program.getCompilerOptions())) { + return semanticDiagnostics.slice(); + } + const declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); + return [...semanticDiagnostics, ...declarationDiagnostics]; + } + function getSuggestionDiagnostics(fileName) { + synchronizeHostData(); + return computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken); + } + function getCompilerOptionsDiagnostics() { + synchronizeHostData(); + return [...program.getOptionsDiagnostics(cancellationToken), ...program.getGlobalDiagnostics(cancellationToken)]; + } + function getCompletionsAtPosition2(fileName, position, options = emptyOptions, formattingSettings) { + const fullPreferences = { + ...identity2(options), + // avoid excess property check + includeCompletionsForModuleExports: options.includeCompletionsForModuleExports || options.includeExternalModuleExports, + includeCompletionsWithInsertText: options.includeCompletionsWithInsertText || options.includeInsertTextCompletions + }; + synchronizeHostData(); + return ts_Completions_exports.getCompletionsAtPosition( + host, + program, + log3, + getValidSourceFile(fileName), + position, + fullPreferences, + options.triggerCharacter, + options.triggerKind, + cancellationToken, + formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host), + options.includeSymbol + ); + } + function getCompletionEntryDetails2(fileName, position, name2, formattingOptions, source, preferences = emptyOptions, data) { + synchronizeHostData(); + return ts_Completions_exports.getCompletionEntryDetails( + program, + log3, + getValidSourceFile(fileName), + position, + { name: name2, source, data }, + host, + formattingOptions && ts_formatting_exports.getFormatContext(formattingOptions, host), + // TODO: GH#18217 + preferences, + cancellationToken + ); + } + function getCompletionEntrySymbol2(fileName, position, name2, source, preferences = emptyOptions) { + synchronizeHostData(); + return ts_Completions_exports.getCompletionEntrySymbol(program, log3, getValidSourceFile(fileName), position, { name: name2, source }, host, preferences); + } + function getQuickInfoAtPosition(fileName, position) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const node = getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + const typeChecker = program.getTypeChecker(); + const nodeForQuickInfo = getNodeForQuickInfo(node); + const symbol = getSymbolAtLocationForQuickInfo(nodeForQuickInfo, typeChecker); + if (!symbol || typeChecker.isUnknownSymbol(symbol)) { + const type3 = shouldGetType(sourceFile, nodeForQuickInfo, position) ? typeChecker.getTypeAtLocation(nodeForQuickInfo) : void 0; + return type3 && { + kind: "", + kindModifiers: "", + textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), + displayParts: typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => typeToDisplayParts(typeChecker2, type3, getContainerNode(nodeForQuickInfo))), + documentation: type3.symbol ? type3.symbol.getDocumentationComment(typeChecker) : void 0, + tags: type3.symbol ? type3.symbol.getJsDocTags(typeChecker) : void 0 + }; + } + const { symbolKind, displayParts, documentation, tags: tags6 } = typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker2, symbol, sourceFile, getContainerNode(nodeForQuickInfo), nodeForQuickInfo)); + return { + kind: symbolKind, + kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), + textSpan: createTextSpanFromNode(nodeForQuickInfo, sourceFile), + displayParts, + documentation, + tags: tags6 + }; + } + function getNodeForQuickInfo(node) { + if (isNewExpression(node.parent) && node.pos === node.parent.pos) { + return node.parent.expression; + } + if (isNamedTupleMember(node.parent) && node.pos === node.parent.pos) { + return node.parent; + } + if (isImportMeta(node.parent) && node.parent.name === node) { + return node.parent; + } + if (isJsxNamespacedName(node.parent)) { + return node.parent; + } + return node; + } + function shouldGetType(sourceFile, node, position) { + switch (node.kind) { + case 80: + return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent); + case 211: + case 166: + return !isInComment(sourceFile, position); + case 110: + case 197: + case 108: + case 202: + return true; + case 236: + return isImportMeta(node); + default: + return false; + } + } + function getDefinitionAtPosition2(fileName, position, searchOtherFilesOnly, stopAtAlias) { + synchronizeHostData(); + return ts_GoToDefinition_exports.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly, stopAtAlias); + } + function getDefinitionAndBoundSpan2(fileName, position) { + synchronizeHostData(); + return ts_GoToDefinition_exports.getDefinitionAndBoundSpan(program, getValidSourceFile(fileName), position); + } + function getTypeDefinitionAtPosition2(fileName, position) { + synchronizeHostData(); + return ts_GoToDefinition_exports.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position); + } + function getImplementationAtPosition(fileName, position) { + synchronizeHostData(); + return ts_FindAllReferences_exports.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + function getDocumentHighlights(fileName, position, filesToSearch) { + const normalizedFileName = normalizePath(fileName); + Debug.assert(filesToSearch.some((f8) => normalizePath(f8) === normalizedFileName)); + synchronizeHostData(); + const sourceFilesToSearch = mapDefined(filesToSearch, (fileName2) => program.getSourceFile(fileName2)); + const sourceFile = getValidSourceFile(fileName); + return DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); + } + function findRenameLocations(fileName, position, findInStrings, findInComments, preferences) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const node = getAdjustedRenameLocation(getTouchingPropertyName(sourceFile, position)); + if (!ts_Rename_exports.nodeIsEligibleForRename(node)) + return void 0; + if (isIdentifier(node) && (isJsxOpeningElement(node.parent) || isJsxClosingElement(node.parent)) && isIntrinsicJsxName(node.escapedText)) { + const { openingElement, closingElement } = node.parent.parent; + return [openingElement, closingElement].map((node2) => { + const textSpan = createTextSpanFromNode(node2.tagName, sourceFile); + return { + fileName: sourceFile.fileName, + textSpan, + ...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, node2.parent) + }; + }); + } else { + const quotePreference = getQuotePreference(sourceFile, preferences ?? emptyOptions); + const providePrefixAndSuffixTextForRename = typeof preferences === "boolean" ? preferences : preferences == null ? void 0 : preferences.providePrefixAndSuffixTextForRename; + return getReferencesWorker2(node, position, { findInStrings, findInComments, providePrefixAndSuffixTextForRename, use: ts_FindAllReferences_exports.FindReferencesUse.Rename }, (entry, originalNode, checker) => ts_FindAllReferences_exports.toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixTextForRename || false, quotePreference)); + } + } + function getReferencesAtPosition(fileName, position) { + synchronizeHostData(); + return getReferencesWorker2(getTouchingPropertyName(getValidSourceFile(fileName), position), position, { use: ts_FindAllReferences_exports.FindReferencesUse.References }, ts_FindAllReferences_exports.toReferenceEntry); + } + function getReferencesWorker2(node, position, options, cb) { + synchronizeHostData(); + const sourceFiles = options && options.use === ts_FindAllReferences_exports.FindReferencesUse.Rename ? program.getSourceFiles().filter((sourceFile) => !program.isSourceFileDefaultLibrary(sourceFile)) : program.getSourceFiles(); + return ts_FindAllReferences_exports.findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, cb); + } + function findReferences(fileName, position) { + synchronizeHostData(); + return ts_FindAllReferences_exports.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); + } + function getFileReferences(fileName) { + synchronizeHostData(); + return ts_FindAllReferences_exports.Core.getReferencesForFileName(fileName, program, program.getSourceFiles()).map(ts_FindAllReferences_exports.toReferenceEntry); + } + function getNavigateToItems2(searchValue, maxResultCount, fileName, excludeDtsFiles = false, excludeLibFiles = false) { + synchronizeHostData(); + const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles(); + return getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles, excludeLibFiles); + } + function getEmitOutput(fileName, emitOnlyDtsFiles, forceDtsEmit) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const customTransformers = host.getCustomTransformers && host.getCustomTransformers(); + return getFileEmitOutput(program, sourceFile, !!emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit); + } + function getSignatureHelpItems2(fileName, position, { triggerReason } = emptyOptions) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + return ts_SignatureHelp_exports.getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken); + } + function getNonBoundSourceFile(fileName) { + return syntaxTreeCache.getCurrentSourceFile(fileName); + } + function getNameOrDottedNameSpan(fileName, startPos, _endPos) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const node = getTouchingPropertyName(sourceFile, startPos); + if (node === sourceFile) { + return void 0; + } + switch (node.kind) { + case 211: + case 166: + case 11: + case 97: + case 112: + case 106: + case 108: + case 110: + case 197: + case 80: + break; + default: + return void 0; + } + let nodeForStartPos = node; + while (true) { + if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { + nodeForStartPos = nodeForStartPos.parent; + } else if (isNameOfModuleDeclaration(nodeForStartPos)) { + if (nodeForStartPos.parent.parent.kind === 267 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { + nodeForStartPos = nodeForStartPos.parent.parent.name; + } else { + break; + } + } else { + break; + } + } + return createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); + } + function getBreakpointStatementAtPosition(fileName, position) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts_BreakpointResolver_exports.spanInSourceFileAtLocation(sourceFile, position); + } + function getNavigationBarItems2(fileName) { + return getNavigationBarItems(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); + } + function getNavigationTree2(fileName) { + return getNavigationTree(syntaxTreeCache.getCurrentSourceFile(fileName), cancellationToken); + } + function getSemanticClassifications3(fileName, span, format5) { + synchronizeHostData(); + const responseFormat = format5 || "original"; + if (responseFormat === "2020") { + return getSemanticClassifications2(program, cancellationToken, getValidSourceFile(fileName), span); + } else { + return getSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); + } + } + function getEncodedSemanticClassifications3(fileName, span, format5) { + synchronizeHostData(); + const responseFormat = format5 || "original"; + if (responseFormat === "original") { + return getEncodedSemanticClassifications(program.getTypeChecker(), cancellationToken, getValidSourceFile(fileName), program.getClassifiableNames(), span); + } else { + return getEncodedSemanticClassifications2(program, cancellationToken, getValidSourceFile(fileName), span); + } + } + function getSyntacticClassifications2(fileName, span) { + return getSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); + } + function getEncodedSyntacticClassifications2(fileName, span) { + return getEncodedSyntacticClassifications(cancellationToken, syntaxTreeCache.getCurrentSourceFile(fileName), span); + } + function getOutliningSpans(fileName) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts_OutliningElementsCollector_exports.collectElements(sourceFile, cancellationToken); + } + const braceMatching = new Map(Object.entries({ + [ + 19 + /* OpenBraceToken */ + ]: 20, + [ + 21 + /* OpenParenToken */ + ]: 22, + [ + 23 + /* OpenBracketToken */ + ]: 24, + [ + 32 + /* GreaterThanToken */ + ]: 30 + /* LessThanToken */ + })); + braceMatching.forEach((value2, key) => braceMatching.set(value2.toString(), Number(key))); + function getBraceMatchingAtPosition(fileName, position) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const token = getTouchingToken(sourceFile, position); + const matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : void 0; + const match = matchKind && findChildOfKind(token.parent, matchKind, sourceFile); + return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a7, b8) => a7.start - b8.start) : emptyArray; + } + function getIndentationAtPosition(fileName, position, editorOptions) { + let start = timestamp3(); + const settings = toEditorSettings(editorOptions); + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + log3("getIndentationAtPosition: getCurrentSourceFile: " + (timestamp3() - start)); + start = timestamp3(); + const result2 = ts_formatting_exports.SmartIndenter.getIndentation(position, sourceFile, settings); + log3("getIndentationAtPosition: computeIndentation : " + (timestamp3() - start)); + return result2; + } + function getFormattingEditsForRange(fileName, start, end, options) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + return ts_formatting_exports.formatSelection(start, end, sourceFile, ts_formatting_exports.getFormatContext(toEditorSettings(options), host)); + } + function getFormattingEditsForDocument(fileName, options) { + return ts_formatting_exports.formatDocument(syntaxTreeCache.getCurrentSourceFile(fileName), ts_formatting_exports.getFormatContext(toEditorSettings(options), host)); + } + function getFormattingEditsAfterKeystroke(fileName, position, key, options) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const formatContext = ts_formatting_exports.getFormatContext(toEditorSettings(options), host); + if (!isInComment(sourceFile, position)) { + switch (key) { + case "{": + return ts_formatting_exports.formatOnOpeningCurly(position, sourceFile, formatContext); + case "}": + return ts_formatting_exports.formatOnClosingCurly(position, sourceFile, formatContext); + case ";": + return ts_formatting_exports.formatOnSemicolon(position, sourceFile, formatContext); + case "\n": + return ts_formatting_exports.formatOnEnter(position, sourceFile, formatContext); + } + } + return []; + } + function getCodeFixesAtPosition(fileName, start, end, errorCodes65, formatOptions, preferences = emptyOptions) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const span = createTextSpanFromBounds(start, end); + const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); + return flatMap2(deduplicate(errorCodes65, equateValues, compareValues), (errorCode) => { + cancellationToken.throwIfCancellationRequested(); + return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences }); + }); + } + function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) { + synchronizeHostData(); + Debug.assert(scope.type === "file"); + const sourceFile = getValidSourceFile(scope.fileName); + const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); + return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences }); + } + function organizeImports2(args, formatOptions, preferences = emptyOptions) { + synchronizeHostData(); + Debug.assert(args.type === "file"); + const sourceFile = getValidSourceFile(args.fileName); + const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host); + const mode = args.mode ?? (args.skipDestructiveCodeActions ? "SortAndCombine" : "All"); + return ts_OrganizeImports_exports.organizeImports(sourceFile, formatContext, host, program, preferences, mode); + } + function getEditsForFileRename2(oldFilePath, newFilePath, formatOptions, preferences = emptyOptions) { + return getEditsForFileRename(getProgram(), oldFilePath, newFilePath, host, ts_formatting_exports.getFormatContext(formatOptions, host), preferences, sourceMapper); + } + function applyCodeActionCommand(fileName, actionOrFormatSettingsOrUndefined) { + const action = typeof fileName === "string" ? actionOrFormatSettingsOrUndefined : fileName; + return isArray3(action) ? Promise.all(action.map((a7) => applySingleCodeActionCommand(a7))) : applySingleCodeActionCommand(action); + } + function applySingleCodeActionCommand(action) { + const getPath = (path2) => toPath2(path2, currentDirectory, getCanonicalFileName); + Debug.assertEqual(action.type, "install package"); + return host.installPackage ? host.installPackage({ fileName: getPath(action.file), packageName: action.packageName }) : Promise.reject("Host does not implement `installPackage`"); + } + function getDocCommentTemplateAtPosition2(fileName, position, options, formatOptions) { + const formatSettings = formatOptions ? ts_formatting_exports.getFormatContext(formatOptions, host).options : void 0; + return ts_JsDoc_exports.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + } + function isValidBraceCompletionAtPosition(fileName, position, openingBrace) { + if (openingBrace === 60) { + return false; + } + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + if (isInString(sourceFile, position)) { + return false; + } + if (isInsideJsxElementOrAttribute(sourceFile, position)) { + return openingBrace === 123; + } + if (isInTemplateString(sourceFile, position)) { + return false; + } + switch (openingBrace) { + case 39: + case 34: + case 96: + return !isInComment(sourceFile, position); + } + return true; + } + function getJsxClosingTagAtPosition(fileName, position) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const token = findPrecedingToken(position, sourceFile); + if (!token) + return void 0; + const element = token.kind === 32 && isJsxOpeningElement(token.parent) ? token.parent.parent : isJsxText(token) && isJsxElement(token.parent) ? token.parent : void 0; + if (element && isUnclosedTag(element)) { + return { newText: `` }; + } + const fragment = token.kind === 32 && isJsxOpeningFragment(token.parent) ? token.parent.parent : isJsxText(token) && isJsxFragment(token.parent) ? token.parent : void 0; + if (fragment && isUnclosedFragment(fragment)) { + return { newText: "" }; + } + } + function getLinkedEditingRangeAtPosition(fileName, position) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const token = findPrecedingToken(position, sourceFile); + if (!token || token.parent.kind === 312) + return void 0; + const jsxTagWordPattern = "[a-zA-Z0-9:\\-\\._$]*"; + if (isJsxFragment(token.parent.parent)) { + const openFragment = token.parent.parent.openingFragment; + const closeFragment = token.parent.parent.closingFragment; + if (containsParseError(openFragment) || containsParseError(closeFragment)) + return void 0; + const openPos = openFragment.getStart(sourceFile) + 1; + const closePos = closeFragment.getStart(sourceFile) + 2; + if (position !== openPos && position !== closePos) + return void 0; + return { + ranges: [{ start: openPos, length: 0 }, { start: closePos, length: 0 }], + wordPattern: jsxTagWordPattern + }; + } else { + const tag = findAncestor(token.parent, (n7) => { + if (isJsxOpeningElement(n7) || isJsxClosingElement(n7)) { + return true; + } + return false; + }); + if (!tag) + return void 0; + Debug.assert(isJsxOpeningElement(tag) || isJsxClosingElement(tag), "tag should be opening or closing element"); + const openTag = tag.parent.openingElement; + const closeTag = tag.parent.closingElement; + const openTagNameStart = openTag.tagName.getStart(sourceFile); + const openTagNameEnd = openTag.tagName.end; + const closeTagNameStart = closeTag.tagName.getStart(sourceFile); + const closeTagNameEnd = closeTag.tagName.end; + if (openTagNameStart === openTag.getStart(sourceFile) || closeTagNameStart === closeTag.getStart(sourceFile) || openTagNameEnd === openTag.getEnd() || closeTagNameEnd === closeTag.getEnd()) + return void 0; + if (!(openTagNameStart <= position && position <= openTagNameEnd || closeTagNameStart <= position && position <= closeTagNameEnd)) + return void 0; + const openingTagText = openTag.tagName.getText(sourceFile); + if (openingTagText !== closeTag.tagName.getText(sourceFile)) + return void 0; + return { + ranges: [{ start: openTagNameStart, length: openTagNameEnd - openTagNameStart }, { start: closeTagNameStart, length: closeTagNameEnd - closeTagNameStart }], + wordPattern: jsxTagWordPattern + }; + } + } + function getLinesForRange(sourceFile, textRange) { + return { + lineStarts: sourceFile.getLineStarts(), + firstLine: sourceFile.getLineAndCharacterOfPosition(textRange.pos).line, + lastLine: sourceFile.getLineAndCharacterOfPosition(textRange.end).line + }; + } + function toggleLineComment(fileName, textRange, insertComment) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const textChanges2 = []; + const { lineStarts, firstLine, lastLine } = getLinesForRange(sourceFile, textRange); + let isCommenting = insertComment || false; + let leftMostPosition = Number.MAX_VALUE; + const lineTextStarts = /* @__PURE__ */ new Map(); + const firstNonWhitespaceCharacterRegex = new RegExp(/\S/); + const isJsx = isInsideJsxElement(sourceFile, lineStarts[firstLine]); + const openComment = isJsx ? "{/*" : "//"; + for (let i7 = firstLine; i7 <= lastLine; i7++) { + const lineText = sourceFile.text.substring(lineStarts[i7], sourceFile.getLineEndOfPosition(lineStarts[i7])); + const regExec = firstNonWhitespaceCharacterRegex.exec(lineText); + if (regExec) { + leftMostPosition = Math.min(leftMostPosition, regExec.index); + lineTextStarts.set(i7.toString(), regExec.index); + if (lineText.substr(regExec.index, openComment.length) !== openComment) { + isCommenting = insertComment === void 0 || insertComment; + } + } + } + for (let i7 = firstLine; i7 <= lastLine; i7++) { + if (firstLine !== lastLine && lineStarts[i7] === textRange.end) { + continue; + } + const lineTextStart = lineTextStarts.get(i7.toString()); + if (lineTextStart !== void 0) { + if (isJsx) { + textChanges2.push(...toggleMultilineComment(fileName, { pos: lineStarts[i7] + leftMostPosition, end: sourceFile.getLineEndOfPosition(lineStarts[i7]) }, isCommenting, isJsx)); + } else if (isCommenting) { + textChanges2.push({ + newText: openComment, + span: { + length: 0, + start: lineStarts[i7] + leftMostPosition + } + }); + } else if (sourceFile.text.substr(lineStarts[i7] + lineTextStart, openComment.length) === openComment) { + textChanges2.push({ + newText: "", + span: { + length: openComment.length, + start: lineStarts[i7] + lineTextStart + } + }); + } + } + } + return textChanges2; + } + function toggleMultilineComment(fileName, textRange, insertComment, isInsideJsx) { + var _a22; + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const textChanges2 = []; + const { text } = sourceFile; + let hasComment = false; + let isCommenting = insertComment || false; + const positions = []; + let { pos } = textRange; + const isJsx = isInsideJsx !== void 0 ? isInsideJsx : isInsideJsxElement(sourceFile, pos); + const openMultiline = isJsx ? "{/*" : "/*"; + const closeMultiline = isJsx ? "*/}" : "*/"; + const openMultilineRegex = isJsx ? "\\{\\/\\*" : "\\/\\*"; + const closeMultilineRegex = isJsx ? "\\*\\/\\}" : "\\*\\/"; + while (pos <= textRange.end) { + const offset = text.substr(pos, openMultiline.length) === openMultiline ? openMultiline.length : 0; + const commentRange = isInComment(sourceFile, pos + offset); + if (commentRange) { + if (isJsx) { + commentRange.pos--; + commentRange.end++; + } + positions.push(commentRange.pos); + if (commentRange.kind === 3) { + positions.push(commentRange.end); + } + hasComment = true; + pos = commentRange.end + 1; + } else { + const newPos = text.substring(pos, textRange.end).search(`(${openMultilineRegex})|(${closeMultilineRegex})`); + isCommenting = insertComment !== void 0 ? insertComment : isCommenting || !isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); + pos = newPos === -1 ? textRange.end + 1 : pos + newPos + closeMultiline.length; + } + } + if (isCommenting || !hasComment) { + if (((_a22 = isInComment(sourceFile, textRange.pos)) == null ? void 0 : _a22.kind) !== 2) { + insertSorted(positions, textRange.pos, compareValues); + } + insertSorted(positions, textRange.end, compareValues); + const firstPos = positions[0]; + if (text.substr(firstPos, openMultiline.length) !== openMultiline) { + textChanges2.push({ + newText: openMultiline, + span: { + length: 0, + start: firstPos + } + }); + } + for (let i7 = 1; i7 < positions.length - 1; i7++) { + if (text.substr(positions[i7] - closeMultiline.length, closeMultiline.length) !== closeMultiline) { + textChanges2.push({ + newText: closeMultiline, + span: { + length: 0, + start: positions[i7] + } + }); + } + if (text.substr(positions[i7], openMultiline.length) !== openMultiline) { + textChanges2.push({ + newText: openMultiline, + span: { + length: 0, + start: positions[i7] + } + }); + } + } + if (textChanges2.length % 2 !== 0) { + textChanges2.push({ + newText: closeMultiline, + span: { + length: 0, + start: positions[positions.length - 1] + } + }); + } + } else { + for (const pos2 of positions) { + const from = pos2 - closeMultiline.length > 0 ? pos2 - closeMultiline.length : 0; + const offset = text.substr(from, closeMultiline.length) === closeMultiline ? closeMultiline.length : 0; + textChanges2.push({ + newText: "", + span: { + length: openMultiline.length, + start: pos2 - offset + } + }); + } + } + return textChanges2; + } + function commentSelection(fileName, textRange) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const { firstLine, lastLine } = getLinesForRange(sourceFile, textRange); + return firstLine === lastLine && textRange.pos !== textRange.end ? toggleMultilineComment( + fileName, + textRange, + /*insertComment*/ + true + ) : toggleLineComment( + fileName, + textRange, + /*insertComment*/ + true + ); + } + function uncommentSelection(fileName, textRange) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const textChanges2 = []; + const { pos } = textRange; + let { end } = textRange; + if (pos === end) { + end += isInsideJsxElement(sourceFile, pos) ? 2 : 1; + } + for (let i7 = pos; i7 <= end; i7++) { + const commentRange = isInComment(sourceFile, i7); + if (commentRange) { + switch (commentRange.kind) { + case 2: + textChanges2.push(...toggleLineComment( + fileName, + { end: commentRange.end, pos: commentRange.pos + 1 }, + /*insertComment*/ + false + )); + break; + case 3: + textChanges2.push(...toggleMultilineComment( + fileName, + { end: commentRange.end, pos: commentRange.pos + 1 }, + /*insertComment*/ + false + )); + } + i7 = commentRange.end + 1; + } + } + return textChanges2; + } + function isUnclosedTag({ openingElement, closingElement, parent: parent22 }) { + return !tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) || isJsxElement(parent22) && tagNamesAreEquivalent(openingElement.tagName, parent22.openingElement.tagName) && isUnclosedTag(parent22); + } + function isUnclosedFragment({ closingFragment, parent: parent22 }) { + return !!(closingFragment.flags & 262144) || isJsxFragment(parent22) && isUnclosedFragment(parent22); + } + function getSpanOfEnclosingComment(fileName, position, onlyMultiLine) { + const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); + const range2 = ts_formatting_exports.getRangeOfEnclosingComment(sourceFile, position); + return range2 && (!onlyMultiLine || range2.kind === 3) ? createTextSpanFromRange(range2) : void 0; + } + function getTodoComments(fileName, descriptors) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + cancellationToken.throwIfCancellationRequested(); + const fileContents = sourceFile.text; + const result2 = []; + if (descriptors.length > 0 && !isNodeModulesFile(sourceFile.fileName)) { + const regExp = getTodoCommentsRegExp(); + let matchArray; + while (matchArray = regExp.exec(fileContents)) { + cancellationToken.throwIfCancellationRequested(); + const firstDescriptorCaptureIndex = 3; + Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); + const preamble = matchArray[1]; + const matchPosition = matchArray.index + preamble.length; + if (!isInComment(sourceFile, matchPosition)) { + continue; + } + let descriptor; + for (let i7 = 0; i7 < descriptors.length; i7++) { + if (matchArray[i7 + firstDescriptorCaptureIndex]) { + descriptor = descriptors[i7]; + } + } + if (descriptor === void 0) + return Debug.fail(); + if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { + continue; + } + const message = matchArray[2]; + result2.push({ descriptor, message, position: matchPosition }); + } + } + return result2; + function escapeRegExp3(str2) { + return str2.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); + } + function getTodoCommentsRegExp() { + const singleLineCommentStart = /(?:\/\/+\s*)/.source; + const multiLineCommentStart = /(?:\/\*+\s*)/.source; + const anyNumberOfSpacesAndAsterisksAtStartOfLine = /(?:^(?:\s|\*)*)/.source; + const preamble = "(" + anyNumberOfSpacesAndAsterisksAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; + const literals = "(?:" + map4(descriptors, (d7) => "(" + escapeRegExp3(d7.text) + ")").join("|") + ")"; + const endOfLineOrEndOfComment = /(?:$|\*\/)/.source; + const messageRemainder = /(?:.*?)/.source; + const messagePortion = "(" + literals + messageRemainder + ")"; + const regExpString = preamble + messagePortion + endOfLineOrEndOfComment; + return new RegExp(regExpString, "gim"); + } + function isLetterOrDigit(char) { + return char >= 97 && char <= 122 || char >= 65 && char <= 90 || char >= 48 && char <= 57; + } + function isNodeModulesFile(path2) { + return path2.includes("/node_modules/"); + } + } + function getRenameInfo2(fileName, position, preferences) { + synchronizeHostData(); + return ts_Rename_exports.getRenameInfo(program, getValidSourceFile(fileName), position, preferences || {}); + } + function getRefactorContext(file, positionOrRange, preferences, formatOptions, triggerReason, kind) { + const [startPosition, endPosition] = typeof positionOrRange === "number" ? [positionOrRange, void 0] : [positionOrRange.pos, positionOrRange.end]; + return { + file, + startPosition, + endPosition, + program: getProgram(), + host, + formatContext: ts_formatting_exports.getFormatContext(formatOptions, host), + // TODO: GH#18217 + cancellationToken, + preferences, + triggerReason, + kind + }; + } + function getInlayHintsContext(file, span, preferences) { + return { + file, + program: getProgram(), + host, + span, + preferences, + cancellationToken + }; + } + function getSmartSelectionRange2(fileName, position) { + return ts_SmartSelectionRange_exports.getSmartSelectionRange(position, syntaxTreeCache.getCurrentSourceFile(fileName)); + } + function getApplicableRefactors2(fileName, positionOrRange, preferences = emptyOptions, triggerReason, kind, includeInteractiveActions) { + synchronizeHostData(); + const file = getValidSourceFile(fileName); + return ts_refactor_exports.getApplicableRefactors(getRefactorContext(file, positionOrRange, preferences, emptyOptions, triggerReason, kind), includeInteractiveActions); + } + function getMoveToRefactoringFileSuggestions(fileName, positionOrRange, preferences = emptyOptions) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const allFiles = Debug.checkDefined(program.getSourceFiles()); + const extension = extensionFromPath(fileName); + const toMove = getStatementsToMove(getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions)); + const toMoveContainsJsx = containsJsx(toMove == null ? void 0 : toMove.all); + const files = mapDefined(allFiles, (file) => { + const fileNameExtension = extensionFromPath(file.fileName); + const isValidSourceFile = !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" && fileNameExtension === ".d.ts" || extension === ".d.ts" && startsWith2(getBaseFileName(file.fileName), "lib.") && fileNameExtension === ".d.ts"); + return isValidSourceFile && (extension === fileNameExtension || (extension === ".tsx" && fileNameExtension === ".ts" || extension === ".jsx" && fileNameExtension === ".js") && !toMoveContainsJsx) ? file.fileName : void 0; + }); + return { newFileName: createNewFileName(sourceFile, program, host, toMove), files }; + } + function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) { + synchronizeHostData(); + const file = getValidSourceFile(fileName); + return ts_refactor_exports.getEditsForRefactor(getRefactorContext(file, positionOrRange, preferences, formatOptions), refactorName14, actionName2, interactiveRefactorArguments); + } + function toLineColumnOffset(fileName, position) { + if (position === 0) { + return { line: 0, character: 0 }; + } + return sourceMapper.toLineColumnOffset(fileName, position); + } + function prepareCallHierarchy(fileName, position) { + synchronizeHostData(); + const declarations = ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, getTouchingPropertyName(getValidSourceFile(fileName), position)); + return declarations && mapOneOrMany(declarations, (declaration) => ts_CallHierarchy_exports.createCallHierarchyItem(program, declaration)); + } + function provideCallHierarchyIncomingCalls(fileName, position) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const declaration = firstOrOnly(ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : getTouchingPropertyName(sourceFile, position))); + return declaration ? ts_CallHierarchy_exports.getIncomingCalls(program, declaration, cancellationToken) : []; + } + function provideCallHierarchyOutgoingCalls(fileName, position) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + const declaration = firstOrOnly(ts_CallHierarchy_exports.resolveCallHierarchyDeclaration(program, position === 0 ? sourceFile : getTouchingPropertyName(sourceFile, position))); + return declaration ? ts_CallHierarchy_exports.getOutgoingCalls(program, declaration) : []; + } + function provideInlayHints2(fileName, span, preferences = emptyOptions) { + synchronizeHostData(); + const sourceFile = getValidSourceFile(fileName); + return ts_InlayHints_exports.provideInlayHints(getInlayHintsContext(sourceFile, span, preferences)); + } + const ls = { + dispose, + cleanupSemanticCache, + getSyntacticDiagnostics, + getSemanticDiagnostics, + getSuggestionDiagnostics, + getCompilerOptionsDiagnostics, + getSyntacticClassifications: getSyntacticClassifications2, + getSemanticClassifications: getSemanticClassifications3, + getEncodedSyntacticClassifications: getEncodedSyntacticClassifications2, + getEncodedSemanticClassifications: getEncodedSemanticClassifications3, + getCompletionsAtPosition: getCompletionsAtPosition2, + getCompletionEntryDetails: getCompletionEntryDetails2, + getCompletionEntrySymbol: getCompletionEntrySymbol2, + getSignatureHelpItems: getSignatureHelpItems2, + getQuickInfoAtPosition, + getDefinitionAtPosition: getDefinitionAtPosition2, + getDefinitionAndBoundSpan: getDefinitionAndBoundSpan2, + getImplementationAtPosition, + getTypeDefinitionAtPosition: getTypeDefinitionAtPosition2, + getReferencesAtPosition, + findReferences, + getFileReferences, + getDocumentHighlights, + getNameOrDottedNameSpan, + getBreakpointStatementAtPosition, + getNavigateToItems: getNavigateToItems2, + getRenameInfo: getRenameInfo2, + getSmartSelectionRange: getSmartSelectionRange2, + findRenameLocations, + getNavigationBarItems: getNavigationBarItems2, + getNavigationTree: getNavigationTree2, + getOutliningSpans, + getTodoComments, + getBraceMatchingAtPosition, + getIndentationAtPosition, + getFormattingEditsForRange, + getFormattingEditsForDocument, + getFormattingEditsAfterKeystroke, + getDocCommentTemplateAtPosition: getDocCommentTemplateAtPosition2, + isValidBraceCompletionAtPosition, + getJsxClosingTagAtPosition, + getLinkedEditingRangeAtPosition, + getSpanOfEnclosingComment, + getCodeFixesAtPosition, + getCombinedCodeFix, + applyCodeActionCommand, + organizeImports: organizeImports2, + getEditsForFileRename: getEditsForFileRename2, + getEmitOutput, + getNonBoundSourceFile, + getProgram, + getCurrentProgram: () => program, + getAutoImportProvider, + updateIsDefinitionOfReferencedSymbols, + getApplicableRefactors: getApplicableRefactors2, + getEditsForRefactor: getEditsForRefactor2, + getMoveToRefactoringFileSuggestions, + toLineColumnOffset, + getSourceMapper: () => sourceMapper, + clearSourceMapperCache: () => sourceMapper.clearCache(), + prepareCallHierarchy, + provideCallHierarchyIncomingCalls, + provideCallHierarchyOutgoingCalls, + toggleLineComment, + toggleMultilineComment, + commentSelection, + uncommentSelection, + provideInlayHints: provideInlayHints2, + getSupportedCodeFixes + }; + switch (languageServiceMode) { + case 0: + break; + case 1: + invalidOperationsInPartialSemanticMode.forEach( + (key) => ls[key] = () => { + throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.PartialSemantic`); + } + ); + break; + case 2: + invalidOperationsInSyntacticMode.forEach( + (key) => ls[key] = () => { + throw new Error(`LanguageService Operation: ${key} not allowed in LanguageServiceMode.Syntactic`); + } + ); + break; + default: + Debug.assertNever(languageServiceMode); + } + return ls; + } + function getNameTable(sourceFile) { + if (!sourceFile.nameTable) { + initializeNameTable(sourceFile); + } + return sourceFile.nameTable; + } + function initializeNameTable(sourceFile) { + const nameTable = sourceFile.nameTable = /* @__PURE__ */ new Map(); + sourceFile.forEachChild(function walk(node) { + if (isIdentifier(node) && !isTagName(node) && node.escapedText || isStringOrNumericLiteralLike(node) && literalIsName(node)) { + const text = getEscapedTextOfIdentifierOrLiteral(node); + nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); + } else if (isPrivateIdentifier(node)) { + const text = node.escapedText; + nameTable.set(text, nameTable.get(text) === void 0 ? node.pos : -1); + } + forEachChild(node, walk); + if (hasJSDocNodes(node)) { + for (const jsDoc of node.jsDoc) { + forEachChild(jsDoc, walk); + } + } + }); + } + function literalIsName(node) { + return isDeclarationName(node) || node.parent.kind === 283 || isArgumentOfElementAccessExpression(node) || isLiteralComputedPropertyDeclarationName(node); + } + function getContainingObjectLiteralElement(node) { + const element = getContainingObjectLiteralElementWorker(node); + return element && (isObjectLiteralExpression(element.parent) || isJsxAttributes(element.parent)) ? element : void 0; + } + function getContainingObjectLiteralElementWorker(node) { + switch (node.kind) { + case 11: + case 15: + case 9: + if (node.parent.kind === 167) { + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : void 0; + } + case 80: + return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === 210 || node.parent.parent.kind === 292) && node.parent.name === node ? node.parent : void 0; + } + return void 0; + } + function getSymbolAtLocationForQuickInfo(node, checker) { + const object = getContainingObjectLiteralElement(node); + if (object) { + const contextualType = checker.getContextualType(object.parent); + const properties = contextualType && getPropertySymbolsFromContextualType( + object, + checker, + contextualType, + /*unionSymbolOk*/ + false + ); + if (properties && properties.length === 1) { + return first(properties); + } + } + return checker.getSymbolAtLocation(node); + } + function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) { + const name2 = getNameFromPropertyName(node.name); + if (!name2) + return emptyArray; + if (!contextualType.isUnion()) { + const symbol = contextualType.getProperty(name2); + return symbol ? [symbol] : emptyArray; + } + const filteredTypes = isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent) ? filter2(contextualType.types, (t8) => !checker.isTypeInvalidDueToUnionDiscriminant(t8, node.parent)) : contextualType.types; + const discriminatedPropertySymbols = mapDefined(filteredTypes, (t8) => t8.getProperty(name2)); + if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) { + const symbol = contextualType.getProperty(name2); + if (symbol) + return [symbol]; + } + if (!filteredTypes.length && !discriminatedPropertySymbols.length) { + return mapDefined(contextualType.types, (t8) => t8.getProperty(name2)); + } + return deduplicate(discriminatedPropertySymbols, equateValues); + } + function isArgumentOfElementAccessExpression(node) { + return node && node.parent && node.parent.kind === 212 && node.parent.argumentExpression === node; + } + function getDefaultLibFilePath(options) { + if (sys) { + return combinePaths(getDirectoryPath(normalizePath(sys.getExecutingFilePath())), getDefaultLibFileName(options)); + } + throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); + } + var servicesVersion, NodeObject, TokenOrIdentifierObject, SymbolObject, TokenObject, IdentifierObject, PrivateIdentifierObject, TypeObject, SignatureObject, SourceFileObject, SourceMapSourceObject, SyntaxTreeCache, NoopCancellationToken, CancellationTokenObject, ThrottledCancellationToken, invalidOperationsInPartialSemanticMode, invalidOperationsInSyntacticMode; + var init_services = __esm2({ + "src/services/services.ts"() { + "use strict"; + init_ts4(); + init_ts_NavigateTo(); + init_ts_NavigationBar(); + init_ts_refactor(); + init_classifier(); + init_classifier2020(); + servicesVersion = "0.8"; + NodeObject = class { + constructor(kind, pos, end) { + this.pos = pos; + this.end = end; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + this.kind = kind; + } + assertHasRealPosition(message) { + Debug.assert(!positionIsSynthesized(this.pos) && !positionIsSynthesized(this.end), message || "Node must have a real position for this operation"); + } + getSourceFile() { + return getSourceFileOfNode(this); + } + getStart(sourceFile, includeJsDocComment) { + this.assertHasRealPosition(); + return getTokenPosOfNode(this, sourceFile, includeJsDocComment); + } + getFullStart() { + this.assertHasRealPosition(); + return this.pos; + } + getEnd() { + this.assertHasRealPosition(); + return this.end; + } + getWidth(sourceFile) { + this.assertHasRealPosition(); + return this.getEnd() - this.getStart(sourceFile); + } + getFullWidth() { + this.assertHasRealPosition(); + return this.end - this.pos; + } + getLeadingTriviaWidth(sourceFile) { + this.assertHasRealPosition(); + return this.getStart(sourceFile) - this.pos; + } + getFullText(sourceFile) { + this.assertHasRealPosition(); + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + } + getText(sourceFile) { + this.assertHasRealPosition(); + if (!sourceFile) { + sourceFile = this.getSourceFile(); + } + return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); + } + getChildCount(sourceFile) { + return this.getChildren(sourceFile).length; + } + getChildAt(index4, sourceFile) { + return this.getChildren(sourceFile)[index4]; + } + getChildren(sourceFile) { + this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"); + return this._children || (this._children = createChildren(this, sourceFile)); + } + getFirstToken(sourceFile) { + this.assertHasRealPosition(); + const children = this.getChildren(sourceFile); + if (!children.length) { + return void 0; + } + const child = find2( + children, + (kid) => kid.kind < 316 || kid.kind > 357 + /* LastJSDocNode */ + ); + return child.kind < 166 ? child : child.getFirstToken(sourceFile); + } + getLastToken(sourceFile) { + this.assertHasRealPosition(); + const children = this.getChildren(sourceFile); + const child = lastOrUndefined(children); + if (!child) { + return void 0; + } + return child.kind < 166 ? child : child.getLastToken(sourceFile); + } + forEachChild(cbNode, cbNodeArray) { + return forEachChild(this, cbNode, cbNodeArray); + } + }; + TokenOrIdentifierObject = class { + constructor(pos, end) { + this.pos = pos; + this.end = end; + this.flags = 0; + this.modifierFlagsCache = 0; + this.transformFlags = 0; + this.parent = void 0; + } + getSourceFile() { + return getSourceFileOfNode(this); + } + getStart(sourceFile, includeJsDocComment) { + return getTokenPosOfNode(this, sourceFile, includeJsDocComment); + } + getFullStart() { + return this.pos; + } + getEnd() { + return this.end; + } + getWidth(sourceFile) { + return this.getEnd() - this.getStart(sourceFile); + } + getFullWidth() { + return this.end - this.pos; + } + getLeadingTriviaWidth(sourceFile) { + return this.getStart(sourceFile) - this.pos; + } + getFullText(sourceFile) { + return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); + } + getText(sourceFile) { + if (!sourceFile) { + sourceFile = this.getSourceFile(); + } + return sourceFile.text.substring(this.getStart(sourceFile), this.getEnd()); + } + getChildCount() { + return this.getChildren().length; + } + getChildAt(index4) { + return this.getChildren()[index4]; + } + getChildren() { + return this.kind === 1 ? this.jsDoc || emptyArray : emptyArray; + } + getFirstToken() { + return void 0; + } + getLastToken() { + return void 0; + } + forEachChild() { + return void 0; + } + }; + SymbolObject = class { + constructor(flags, name2) { + this.id = 0; + this.mergeId = 0; + this.flags = flags; + this.escapedName = name2; + } + getFlags() { + return this.flags; + } + get name() { + return symbolName(this); + } + getEscapedName() { + return this.escapedName; + } + getName() { + return this.name; + } + getDeclarations() { + return this.declarations; + } + getDocumentationComment(checker) { + if (!this.documentationComment) { + this.documentationComment = emptyArray; + if (!this.declarations && isTransientSymbol(this) && this.links.target && isTransientSymbol(this.links.target) && this.links.target.links.tupleLabelDeclaration) { + const labelDecl = this.links.target.links.tupleLabelDeclaration; + this.documentationComment = getDocumentationComment([labelDecl], checker); + } else { + this.documentationComment = getDocumentationComment(this.declarations, checker); + } + } + return this.documentationComment; + } + getContextualDocumentationComment(context2, checker) { + if (context2) { + if (isGetAccessor(context2)) { + if (!this.contextualGetAccessorDocumentationComment) { + this.contextualGetAccessorDocumentationComment = getDocumentationComment(filter2(this.declarations, isGetAccessor), checker); + } + if (length(this.contextualGetAccessorDocumentationComment)) { + return this.contextualGetAccessorDocumentationComment; + } + } + if (isSetAccessor(context2)) { + if (!this.contextualSetAccessorDocumentationComment) { + this.contextualSetAccessorDocumentationComment = getDocumentationComment(filter2(this.declarations, isSetAccessor), checker); + } + if (length(this.contextualSetAccessorDocumentationComment)) { + return this.contextualSetAccessorDocumentationComment; + } + } + } + return this.getDocumentationComment(checker); + } + getJsDocTags(checker) { + if (this.tags === void 0) { + this.tags = getJsDocTagsOfDeclarations(this.declarations, checker); + } + return this.tags; + } + getContextualJsDocTags(context2, checker) { + if (context2) { + if (isGetAccessor(context2)) { + if (!this.contextualGetAccessorTags) { + this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(filter2(this.declarations, isGetAccessor), checker); + } + if (length(this.contextualGetAccessorTags)) { + return this.contextualGetAccessorTags; + } + } + if (isSetAccessor(context2)) { + if (!this.contextualSetAccessorTags) { + this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(filter2(this.declarations, isSetAccessor), checker); + } + if (length(this.contextualSetAccessorTags)) { + return this.contextualSetAccessorTags; + } + } + } + return this.getJsDocTags(checker); + } + }; + TokenObject = class extends TokenOrIdentifierObject { + constructor(kind, pos, end) { + super(pos, end); + this.kind = kind; + } + }; + IdentifierObject = class extends TokenOrIdentifierObject { + constructor(_kind, pos, end) { + super(pos, end); + this.kind = 80; + } + get text() { + return idText(this); + } + }; + IdentifierObject.prototype.kind = 80; + PrivateIdentifierObject = class extends TokenOrIdentifierObject { + constructor(_kind, pos, end) { + super(pos, end); + this.kind = 81; + } + get text() { + return idText(this); + } + }; + PrivateIdentifierObject.prototype.kind = 81; + TypeObject = class { + constructor(checker, flags) { + this.checker = checker; + this.flags = flags; + } + getFlags() { + return this.flags; + } + getSymbol() { + return this.symbol; + } + getProperties() { + return this.checker.getPropertiesOfType(this); + } + getProperty(propertyName) { + return this.checker.getPropertyOfType(this, propertyName); + } + getApparentProperties() { + return this.checker.getAugmentedPropertiesOfType(this); + } + getCallSignatures() { + return this.checker.getSignaturesOfType( + this, + 0 + /* Call */ + ); + } + getConstructSignatures() { + return this.checker.getSignaturesOfType( + this, + 1 + /* Construct */ + ); + } + getStringIndexType() { + return this.checker.getIndexTypeOfType( + this, + 0 + /* String */ + ); + } + getNumberIndexType() { + return this.checker.getIndexTypeOfType( + this, + 1 + /* Number */ + ); + } + getBaseTypes() { + return this.isClassOrInterface() ? this.checker.getBaseTypes(this) : void 0; + } + isNullableType() { + return this.checker.isNullableType(this); + } + getNonNullableType() { + return this.checker.getNonNullableType(this); + } + getNonOptionalType() { + return this.checker.getNonOptionalType(this); + } + getConstraint() { + return this.checker.getBaseConstraintOfType(this); + } + getDefault() { + return this.checker.getDefaultFromTypeParameter(this); + } + isUnion() { + return !!(this.flags & 1048576); + } + isIntersection() { + return !!(this.flags & 2097152); + } + isUnionOrIntersection() { + return !!(this.flags & 3145728); + } + isLiteral() { + return !!(this.flags & (128 | 256 | 2048)); + } + isStringLiteral() { + return !!(this.flags & 128); + } + isNumberLiteral() { + return !!(this.flags & 256); + } + isTypeParameter() { + return !!(this.flags & 262144); + } + isClassOrInterface() { + return !!(getObjectFlags(this) & 3); + } + isClass() { + return !!(getObjectFlags(this) & 1); + } + isIndexType() { + return !!(this.flags & 4194304); + } + /** + * This polyfills `referenceType.typeArguments` for API consumers + */ + get typeArguments() { + if (getObjectFlags(this) & 4) { + return this.checker.getTypeArguments(this); + } + return void 0; + } + }; + SignatureObject = class { + // same + constructor(checker, flags) { + this.checker = checker; + this.flags = flags; + } + getDeclaration() { + return this.declaration; + } + getTypeParameters() { + return this.typeParameters; + } + getParameters() { + return this.parameters; + } + getReturnType() { + return this.checker.getReturnTypeOfSignature(this); + } + getTypeParameterAtPosition(pos) { + const type3 = this.checker.getParameterType(this, pos); + if (type3.isIndexType() && isThisTypeParameter(type3.type)) { + const constraint = type3.type.getConstraint(); + if (constraint) { + return this.checker.getIndexType(constraint); + } + } + return type3; + } + getDocumentationComment() { + return this.documentationComment || (this.documentationComment = getDocumentationComment(singleElementArray(this.declaration), this.checker)); + } + getJsDocTags() { + return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(singleElementArray(this.declaration), this.checker)); + } + }; + SourceFileObject = class extends NodeObject { + constructor(kind, pos, end) { + super(kind, pos, end); + this.kind = 312; + } + update(newText, textChangeRange) { + return updateSourceFile(this, newText, textChangeRange); + } + getLineAndCharacterOfPosition(position) { + return getLineAndCharacterOfPosition(this, position); + } + getLineStarts() { + return getLineStarts(this); + } + getPositionOfLineAndCharacter(line, character, allowEdits) { + return computePositionOfLineAndCharacter(getLineStarts(this), line, character, this.text, allowEdits); + } + getLineEndOfPosition(pos) { + const { line } = this.getLineAndCharacterOfPosition(pos); + const lineStarts = this.getLineStarts(); + let lastCharPos; + if (line + 1 >= lineStarts.length) { + lastCharPos = this.getEnd(); + } + if (!lastCharPos) { + lastCharPos = lineStarts[line + 1] - 1; + } + const fullText = this.getFullText(); + return fullText[lastCharPos] === "\n" && fullText[lastCharPos - 1] === "\r" ? lastCharPos - 1 : lastCharPos; + } + getNamedDeclarations() { + if (!this.namedDeclarations) { + this.namedDeclarations = this.computeNamedDeclarations(); + } + return this.namedDeclarations; + } + computeNamedDeclarations() { + const result2 = createMultiMap(); + this.forEachChild(visit7); + return result2; + function addDeclaration(declaration) { + const name2 = getDeclarationName(declaration); + if (name2) { + result2.add(name2, declaration); + } + } + function getDeclarations(name2) { + let declarations = result2.get(name2); + if (!declarations) { + result2.set(name2, declarations = []); + } + return declarations; + } + function getDeclarationName(declaration) { + const name2 = getNonAssignedNameOfDeclaration(declaration); + return name2 && (isComputedPropertyName(name2) && isPropertyAccessExpression(name2.expression) ? name2.expression.name.text : isPropertyName(name2) ? getNameFromPropertyName(name2) : void 0); + } + function visit7(node) { + switch (node.kind) { + case 262: + case 218: + case 174: + case 173: + const functionDeclaration = node; + const declarationName = getDeclarationName(functionDeclaration); + if (declarationName) { + const declarations = getDeclarations(declarationName); + const lastDeclaration = lastOrUndefined(declarations); + if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { + if (functionDeclaration.body && !lastDeclaration.body) { + declarations[declarations.length - 1] = functionDeclaration; + } + } else { + declarations.push(functionDeclaration); + } + } + forEachChild(node, visit7); + break; + case 263: + case 231: + case 264: + case 265: + case 266: + case 267: + case 271: + case 281: + case 276: + case 273: + case 274: + case 177: + case 178: + case 187: + addDeclaration(node); + forEachChild(node, visit7); + break; + case 169: + if (!hasSyntacticModifier( + node, + 31 + /* ParameterPropertyModifier */ + )) { + break; + } + case 260: + case 208: { + const decl = node; + if (isBindingPattern(decl.name)) { + forEachChild(decl.name, visit7); + break; + } + if (decl.initializer) { + visit7(decl.initializer); + } + } + case 306: + case 172: + case 171: + addDeclaration(node); + break; + case 278: + const exportDeclaration = node; + if (exportDeclaration.exportClause) { + if (isNamedExports(exportDeclaration.exportClause)) { + forEach4(exportDeclaration.exportClause.elements, visit7); + } else { + visit7(exportDeclaration.exportClause.name); + } + } + break; + case 272: + const importClause = node.importClause; + if (importClause) { + if (importClause.name) { + addDeclaration(importClause.name); + } + if (importClause.namedBindings) { + if (importClause.namedBindings.kind === 274) { + addDeclaration(importClause.namedBindings); + } else { + forEach4(importClause.namedBindings.elements, visit7); + } + } + } + break; + case 226: + if (getAssignmentDeclarationKind(node) !== 0) { + addDeclaration(node); + } + default: + forEachChild(node, visit7); + } + } + } + }; + SourceMapSourceObject = class { + constructor(fileName, text, skipTrivia2) { + this.fileName = fileName; + this.text = text; + this.skipTrivia = skipTrivia2; + } + getLineAndCharacterOfPosition(pos) { + return getLineAndCharacterOfPosition(this, pos); + } + }; + SyntaxTreeCache = class { + constructor(host) { + this.host = host; + } + getCurrentSourceFile(fileName) { + var _a2, _b, _c, _d, _e2, _f, _g, _h; + const scriptSnapshot = this.host.getScriptSnapshot(fileName); + if (!scriptSnapshot) { + throw new Error("Could not find file: '" + fileName + "'."); + } + const scriptKind = getScriptKind(fileName, this.host); + const version22 = this.host.getScriptVersion(fileName); + let sourceFile; + if (this.currentFileName !== fileName) { + const options = { + languageVersion: 99, + impliedNodeFormat: getImpliedNodeFormatForFile( + toPath2(fileName, this.host.getCurrentDirectory(), ((_c = (_b = (_a2 = this.host).getCompilerHost) == null ? void 0 : _b.call(_a2)) == null ? void 0 : _c.getCanonicalFileName) || hostGetCanonicalFileName(this.host)), + (_h = (_g = (_f = (_e2 = (_d = this.host).getCompilerHost) == null ? void 0 : _e2.call(_d)) == null ? void 0 : _f.getModuleResolutionCache) == null ? void 0 : _g.call(_f)) == null ? void 0 : _h.getPackageJsonInfoCache(), + this.host, + this.host.getCompilationSettings() + ), + setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()), + // These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll. + jsDocParsingMode: 0 + /* ParseAll */ + }; + sourceFile = createLanguageServiceSourceFile( + fileName, + scriptSnapshot, + options, + version22, + /*setNodeParents*/ + true, + scriptKind + ); + } else if (this.currentFileVersion !== version22) { + const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); + sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version22, editRange); + } + if (sourceFile) { + this.currentFileVersion = version22; + this.currentFileName = fileName; + this.currentFileScriptSnapshot = scriptSnapshot; + this.currentSourceFile = sourceFile; + } + return this.currentSourceFile; + } + }; + NoopCancellationToken = { + isCancellationRequested: returnFalse, + throwIfCancellationRequested: noop4 + }; + CancellationTokenObject = class { + constructor(cancellationToken) { + this.cancellationToken = cancellationToken; + } + isCancellationRequested() { + return this.cancellationToken.isCancellationRequested(); + } + throwIfCancellationRequested() { + var _a2; + if (this.isCancellationRequested()) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "cancellationThrown", { kind: "CancellationTokenObject" }); + throw new OperationCanceledException(); + } + } + }; + ThrottledCancellationToken = class { + constructor(hostCancellationToken, throttleWaitMilliseconds = 20) { + this.hostCancellationToken = hostCancellationToken; + this.throttleWaitMilliseconds = throttleWaitMilliseconds; + this.lastCancellationCheckTime = 0; + } + isCancellationRequested() { + const time2 = timestamp3(); + const duration = Math.abs(time2 - this.lastCancellationCheckTime); + if (duration >= this.throttleWaitMilliseconds) { + this.lastCancellationCheckTime = time2; + return this.hostCancellationToken.isCancellationRequested(); + } + return false; + } + throwIfCancellationRequested() { + var _a2; + if (this.isCancellationRequested()) { + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "cancellationThrown", { kind: "ThrottledCancellationToken" }); + throw new OperationCanceledException(); + } + } + }; + invalidOperationsInPartialSemanticMode = [ + "getSemanticDiagnostics", + "getSuggestionDiagnostics", + "getCompilerOptionsDiagnostics", + "getSemanticClassifications", + "getEncodedSemanticClassifications", + "getCodeFixesAtPosition", + "getCombinedCodeFix", + "applyCodeActionCommand", + "organizeImports", + "getEditsForFileRename", + "getEmitOutput", + "getApplicableRefactors", + "getEditsForRefactor", + "prepareCallHierarchy", + "provideCallHierarchyIncomingCalls", + "provideCallHierarchyOutgoingCalls", + "provideInlayHints", + "getSupportedCodeFixes" + ]; + invalidOperationsInSyntacticMode = [ + ...invalidOperationsInPartialSemanticMode, + "getCompletionsAtPosition", + "getCompletionEntryDetails", + "getCompletionEntrySymbol", + "getSignatureHelpItems", + "getQuickInfoAtPosition", + "getDefinitionAtPosition", + "getDefinitionAndBoundSpan", + "getImplementationAtPosition", + "getTypeDefinitionAtPosition", + "getReferencesAtPosition", + "findReferences", + "getDocumentHighlights", + "getNavigateToItems", + "getRenameInfo", + "findRenameLocations", + "getApplicableRefactors" + ]; + setObjectAllocator(getServicesObjectAllocator()); + } + }); + function transform2(source, transformers, compilerOptions) { + const diagnostics = []; + compilerOptions = fixupCompilerOptions(compilerOptions, diagnostics); + const nodes = isArray3(source) ? source : [source]; + const result2 = transformNodes( + /*resolver*/ + void 0, + /*host*/ + void 0, + factory, + compilerOptions, + nodes, + transformers, + /*allowDtsFiles*/ + true + ); + result2.diagnostics = concatenate(result2.diagnostics, diagnostics); + return result2; + } + var init_transform2 = __esm2({ + "src/services/transform.ts"() { + "use strict"; + init_ts4(); + } + }); + function spanInSourceFileAtLocation(sourceFile, position) { + if (sourceFile.isDeclarationFile) { + return void 0; + } + let tokenAtLocation = getTokenAtPosition(sourceFile, position); + const lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart(sourceFile)).line > lineOfPosition) { + const preceding = findPrecedingToken(tokenAtLocation.pos, sourceFile); + if (!preceding || sourceFile.getLineAndCharacterOfPosition(preceding.getEnd()).line !== lineOfPosition) { + return void 0; + } + tokenAtLocation = preceding; + } + if (tokenAtLocation.flags & 33554432) { + return void 0; + } + return spanInNode(tokenAtLocation); + function textSpan(startNode2, endNode2) { + const lastDecorator = canHaveDecorators(startNode2) ? findLast2(startNode2.modifiers, isDecorator) : void 0; + const start = lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : startNode2.getStart(sourceFile); + return createTextSpanFromBounds(start, (endNode2 || startNode2).getEnd()); + } + function textSpanEndingAtNextToken(startNode2, previousTokenToFindNextEndToken) { + return textSpan(startNode2, findNextToken(previousTokenToFindNextEndToken, previousTokenToFindNextEndToken.parent, sourceFile)); + } + function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { + if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line) { + return spanInNode(node); + } + return spanInNode(otherwiseOnNode); + } + function spanInNodeArray(nodeArray, node, match) { + if (nodeArray) { + const index4 = nodeArray.indexOf(node); + if (index4 >= 0) { + let start = index4; + let end = index4 + 1; + while (start > 0 && match(nodeArray[start - 1])) + start--; + while (end < nodeArray.length && match(nodeArray[end])) + end++; + return createTextSpanFromBounds(skipTrivia(sourceFile.text, nodeArray[start].pos), nodeArray[end - 1].end); + } + } + return textSpan(node); + } + function spanInPreviousNode(node) { + return spanInNode(findPrecedingToken(node.pos, sourceFile)); + } + function spanInNextNode(node) { + return spanInNode(findNextToken(node, node.parent, sourceFile)); + } + function spanInNode(node) { + if (node) { + const { parent: parent22 } = node; + switch (node.kind) { + case 243: + return spanInVariableDeclaration(node.declarationList.declarations[0]); + case 260: + case 172: + case 171: + return spanInVariableDeclaration(node); + case 169: + return spanInParameterDeclaration(node); + case 262: + case 174: + case 173: + case 177: + case 178: + case 176: + case 218: + case 219: + return spanInFunctionDeclaration(node); + case 241: + if (isFunctionBlock(node)) { + return spanInFunctionBlock(node); + } + case 268: + return spanInBlock(node); + case 299: + return spanInBlock(node.block); + case 244: + return textSpan(node.expression); + case 253: + return textSpan(node.getChildAt(0), node.expression); + case 247: + return textSpanEndingAtNextToken(node, node.expression); + case 246: + return spanInNode(node.statement); + case 259: + return textSpan(node.getChildAt(0)); + case 245: + return textSpanEndingAtNextToken(node, node.expression); + case 256: + return spanInNode(node.statement); + case 252: + case 251: + return textSpan(node.getChildAt(0), node.label); + case 248: + return spanInForStatement(node); + case 249: + return textSpanEndingAtNextToken(node, node.expression); + case 250: + return spanInInitializerOfForLike(node); + case 255: + return textSpanEndingAtNextToken(node, node.expression); + case 296: + case 297: + return spanInNode(node.statements[0]); + case 258: + return spanInBlock(node.tryBlock); + case 257: + return textSpan(node, node.expression); + case 277: + return textSpan(node, node.expression); + case 271: + return textSpan(node, node.moduleReference); + case 272: + return textSpan(node, node.moduleSpecifier); + case 278: + return textSpan(node, node.moduleSpecifier); + case 267: + if (getModuleInstanceState(node) !== 1) { + return void 0; + } + case 263: + case 266: + case 306: + case 208: + return textSpan(node); + case 254: + return spanInNode(node.statement); + case 170: + return spanInNodeArray(parent22.modifiers, node, isDecorator); + case 206: + case 207: + return spanInBindingPattern(node); + case 264: + case 265: + return void 0; + case 27: + case 1: + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node.pos, sourceFile)); + case 28: + return spanInPreviousNode(node); + case 19: + return spanInOpenBraceToken(node); + case 20: + return spanInCloseBraceToken(node); + case 24: + return spanInCloseBracketToken(node); + case 21: + return spanInOpenParenToken(node); + case 22: + return spanInCloseParenToken(node); + case 59: + return spanInColonToken(node); + case 32: + case 30: + return spanInGreaterThanOrLessThanToken(node); + case 117: + return spanInWhileKeyword(node); + case 93: + case 85: + case 98: + return spanInNextNode(node); + case 165: + return spanInOfKeyword(node); + default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); + } + if ((node.kind === 80 || node.kind === 230 || node.kind === 303 || node.kind === 304) && isArrayLiteralOrObjectLiteralDestructuringPattern(parent22)) { + return textSpan(node); + } + if (node.kind === 226) { + const { left, operatorToken } = node; + if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern( + left + ); + } + if (operatorToken.kind === 64 && isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { + return textSpan(node); + } + if (operatorToken.kind === 28) { + return spanInNode(left); + } + } + if (isExpressionNode(node)) { + switch (parent22.kind) { + case 246: + return spanInPreviousNode(node); + case 170: + return spanInNode(node.parent); + case 248: + case 250: + return textSpan(node); + case 226: + if (node.parent.operatorToken.kind === 28) { + return textSpan(node); + } + break; + case 219: + if (node.parent.body === node) { + return textSpan(node); + } + break; + } + } + switch (node.parent.kind) { + case 303: + if (node.parent.name === node && !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode(node.parent.initializer); + } + break; + case 216: + if (node.parent.type === node) { + return spanInNextNode(node.parent.type); + } + break; + case 260: + case 169: { + const { initializer, type: type3 } = node.parent; + if (initializer === node || type3 === node || isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + break; + } + case 226: { + const { left } = node.parent; + if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { + return spanInPreviousNode(node); + } + break; + } + default: + if (isFunctionLike(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } + } + return spanInNode(node.parent); + } + } + function textSpanFromVariableDeclaration(variableDeclaration) { + if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { + return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); + } else { + return textSpan(variableDeclaration); + } + } + function spanInVariableDeclaration(variableDeclaration) { + if (variableDeclaration.parent.parent.kind === 249) { + return spanInNode(variableDeclaration.parent.parent); + } + const parent22 = variableDeclaration.parent; + if (isBindingPattern(variableDeclaration.name)) { + return spanInBindingPattern(variableDeclaration.name); + } + if (hasOnlyExpressionInitializer(variableDeclaration) && variableDeclaration.initializer || hasSyntacticModifier( + variableDeclaration, + 32 + /* Export */ + ) || parent22.parent.kind === 250) { + return textSpanFromVariableDeclaration(variableDeclaration); + } + if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { + return spanInNode(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); + } + } + function canHaveSpanInParameterDeclaration(parameter) { + return !!parameter.initializer || parameter.dotDotDotToken !== void 0 || hasSyntacticModifier( + parameter, + 1 | 2 + /* Private */ + ); + } + function spanInParameterDeclaration(parameter) { + if (isBindingPattern(parameter.name)) { + return spanInBindingPattern(parameter.name); + } else if (canHaveSpanInParameterDeclaration(parameter)) { + return textSpan(parameter); + } else { + const functionDeclaration = parameter.parent; + const indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { + return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); + } else { + return spanInNode(functionDeclaration.body); + } + } + } + function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { + return hasSyntacticModifier( + functionDeclaration, + 32 + /* Export */ + ) || functionDeclaration.parent.kind === 263 && functionDeclaration.kind !== 176; + } + function spanInFunctionDeclaration(functionDeclaration) { + if (!functionDeclaration.body) { + return void 0; + } + if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { + return textSpan(functionDeclaration); + } + return spanInNode(functionDeclaration.body); + } + function spanInFunctionBlock(block) { + const nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); + if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { + return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); + } + return spanInNode(nodeForSpanInBlock); + } + function spanInBlock(block) { + switch (block.parent.kind) { + case 267: + if (getModuleInstanceState(block.parent) !== 1) { + return void 0; + } + case 247: + case 245: + case 249: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 248: + case 250: + return spanInNodeIfStartsOnSameLine(findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); + } + return spanInNode(block.statements[0]); + } + function spanInInitializerOfForLike(forLikeStatement) { + if (forLikeStatement.initializer.kind === 261) { + const variableDeclarationList = forLikeStatement.initializer; + if (variableDeclarationList.declarations.length > 0) { + return spanInNode(variableDeclarationList.declarations[0]); + } + } else { + return spanInNode(forLikeStatement.initializer); + } + } + function spanInForStatement(forStatement) { + if (forStatement.initializer) { + return spanInInitializerOfForLike(forStatement); + } + if (forStatement.condition) { + return textSpan(forStatement.condition); + } + if (forStatement.incrementor) { + return textSpan(forStatement.incrementor); + } + } + function spanInBindingPattern(bindingPattern) { + const firstBindingElement = forEach4(bindingPattern.elements, (element) => element.kind !== 232 ? element : void 0); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + if (bindingPattern.parent.kind === 208) { + return textSpan(bindingPattern.parent); + } + return textSpanFromVariableDeclaration(bindingPattern.parent); + } + function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node2) { + Debug.assert( + node2.kind !== 207 && node2.kind !== 206 + /* ObjectBindingPattern */ + ); + const elements = node2.kind === 209 ? node2.elements : node2.properties; + const firstBindingElement = forEach4(elements, (element) => element.kind !== 232 ? element : void 0); + if (firstBindingElement) { + return spanInNode(firstBindingElement); + } + return textSpan(node2.parent.kind === 226 ? node2.parent : node2); + } + function spanInOpenBraceToken(node2) { + switch (node2.parent.kind) { + case 266: + const enumDeclaration = node2.parent; + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); + case 263: + const classDeclaration = node2.parent; + return spanInNodeIfStartsOnSameLine(findPrecedingToken(node2.pos, sourceFile, node2.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); + case 269: + return spanInNodeIfStartsOnSameLine(node2.parent.parent, node2.parent.clauses[0]); + } + return spanInNode(node2.parent); + } + function spanInCloseBraceToken(node2) { + switch (node2.parent.kind) { + case 268: + if (getModuleInstanceState(node2.parent.parent) !== 1) { + return void 0; + } + case 266: + case 263: + return textSpan(node2); + case 241: + if (isFunctionBlock(node2.parent)) { + return textSpan(node2); + } + case 299: + return spanInNode(lastOrUndefined(node2.parent.statements)); + case 269: + const caseBlock = node2.parent; + const lastClause = lastOrUndefined(caseBlock.clauses); + if (lastClause) { + return spanInNode(lastOrUndefined(lastClause.statements)); + } + return void 0; + case 206: + const bindingPattern = node2.parent; + return spanInNode(lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { + const objectLiteral = node2.parent; + return textSpan(lastOrUndefined(objectLiteral.properties) || objectLiteral); + } + return spanInNode(node2.parent); + } + } + function spanInCloseBracketToken(node2) { + switch (node2.parent.kind) { + case 207: + const bindingPattern = node2.parent; + return textSpan(lastOrUndefined(bindingPattern.elements) || bindingPattern); + default: + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node2.parent)) { + const arrayLiteral = node2.parent; + return textSpan(lastOrUndefined(arrayLiteral.elements) || arrayLiteral); + } + return spanInNode(node2.parent); + } + } + function spanInOpenParenToken(node2) { + if (node2.parent.kind === 246 || // Go to while keyword and do action instead + node2.parent.kind === 213 || node2.parent.kind === 214) { + return spanInPreviousNode(node2); + } + if (node2.parent.kind === 217) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + function spanInCloseParenToken(node2) { + switch (node2.parent.kind) { + case 218: + case 262: + case 219: + case 174: + case 173: + case 177: + case 178: + case 176: + case 247: + case 246: + case 248: + case 250: + case 213: + case 214: + case 217: + return spanInPreviousNode(node2); + default: + return spanInNode(node2.parent); + } + } + function spanInColonToken(node2) { + if (isFunctionLike(node2.parent) || node2.parent.kind === 303 || node2.parent.kind === 169) { + return spanInPreviousNode(node2); + } + return spanInNode(node2.parent); + } + function spanInGreaterThanOrLessThanToken(node2) { + if (node2.parent.kind === 216) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + function spanInWhileKeyword(node2) { + if (node2.parent.kind === 246) { + return textSpanEndingAtNextToken(node2, node2.parent.expression); + } + return spanInNode(node2.parent); + } + function spanInOfKeyword(node2) { + if (node2.parent.kind === 250) { + return spanInNextNode(node2); + } + return spanInNode(node2.parent); + } + } + } + var init_breakpoints = __esm2({ + "src/services/breakpoints.ts"() { + "use strict"; + init_ts4(); + } + }); + var ts_BreakpointResolver_exports = {}; + __export2(ts_BreakpointResolver_exports, { + spanInSourceFileAtLocation: () => spanInSourceFileAtLocation + }); + var init_ts_BreakpointResolver = __esm2({ + "src/services/_namespaces/ts.BreakpointResolver.ts"() { + "use strict"; + init_breakpoints(); + } + }); + function isNamedExpression(node) { + return (isFunctionExpression(node) || isClassExpression(node)) && isNamedDeclaration(node); + } + function isVariableLike2(node) { + return isPropertyDeclaration(node) || isVariableDeclaration(node); + } + function isAssignedExpression(node) { + return (isFunctionExpression(node) || isArrowFunction(node) || isClassExpression(node)) && isVariableLike2(node.parent) && node === node.parent.initializer && isIdentifier(node.parent.name) && (!!(getCombinedNodeFlags(node.parent) & 2) || isPropertyDeclaration(node.parent)); + } + function isPossibleCallHierarchyDeclaration(node) { + return isSourceFile(node) || isModuleDeclaration(node) || isFunctionDeclaration(node) || isFunctionExpression(node) || isClassDeclaration(node) || isClassExpression(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node); + } + function isValidCallHierarchyDeclaration(node) { + return isSourceFile(node) || isModuleDeclaration(node) && isIdentifier(node.name) || isFunctionDeclaration(node) || isClassDeclaration(node) || isClassStaticBlockDeclaration(node) || isMethodDeclaration(node) || isMethodSignature(node) || isGetAccessorDeclaration(node) || isSetAccessorDeclaration(node) || isNamedExpression(node) || isAssignedExpression(node); + } + function getCallHierarchyDeclarationReferenceNode(node) { + if (isSourceFile(node)) + return node; + if (isNamedDeclaration(node)) + return node.name; + if (isAssignedExpression(node)) + return node.parent.name; + return Debug.checkDefined(node.modifiers && find2(node.modifiers, isDefaultModifier3)); + } + function isDefaultModifier3(node) { + return node.kind === 90; + } + function getSymbolOfCallHierarchyDeclaration(typeChecker, node) { + const location2 = getCallHierarchyDeclarationReferenceNode(node); + return location2 && typeChecker.getSymbolAtLocation(location2); + } + function getCallHierarchyItemName(program, node) { + if (isSourceFile(node)) { + return { text: node.fileName, pos: 0, end: 0 }; + } + if ((isFunctionDeclaration(node) || isClassDeclaration(node)) && !isNamedDeclaration(node)) { + const defaultModifier = node.modifiers && find2(node.modifiers, isDefaultModifier3); + if (defaultModifier) { + return { text: "default", pos: defaultModifier.getStart(), end: defaultModifier.getEnd() }; + } + } + if (isClassStaticBlockDeclaration(node)) { + const sourceFile = node.getSourceFile(); + const pos = skipTrivia(sourceFile.text, moveRangePastModifiers(node).pos); + const end = pos + 6; + const typeChecker = program.getTypeChecker(); + const symbol = typeChecker.getSymbolAtLocation(node.parent); + const prefix = symbol ? `${typeChecker.symbolToString(symbol, node.parent)} ` : ""; + return { text: `${prefix}static {}`, pos, end }; + } + const declName = isAssignedExpression(node) ? node.parent.name : Debug.checkDefined(getNameOfDeclaration(node), "Expected call hierarchy item to have a name"); + let text = isIdentifier(declName) ? idText(declName) : isStringOrNumericLiteralLike(declName) ? declName.text : isComputedPropertyName(declName) ? isStringOrNumericLiteralLike(declName.expression) ? declName.expression.text : void 0 : void 0; + if (text === void 0) { + const typeChecker = program.getTypeChecker(); + const symbol = typeChecker.getSymbolAtLocation(declName); + if (symbol) { + text = typeChecker.symbolToString(symbol, node); + } + } + if (text === void 0) { + const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon(); + text = usingSingleLineStringWriter((writer) => printer.writeNode(4, node, node.getSourceFile(), writer)); + } + return { text, pos: declName.getStart(), end: declName.getEnd() }; + } + function getCallHierarchItemContainerName(node) { + var _a2, _b, _c, _d; + if (isAssignedExpression(node)) { + if (isPropertyDeclaration(node.parent) && isClassLike(node.parent.parent)) { + return isClassExpression(node.parent.parent) ? (_a2 = getAssignedName(node.parent.parent)) == null ? void 0 : _a2.getText() : (_b = node.parent.parent.name) == null ? void 0 : _b.getText(); + } + if (isModuleBlock(node.parent.parent.parent.parent) && isIdentifier(node.parent.parent.parent.parent.parent.name)) { + return node.parent.parent.parent.parent.parent.name.getText(); + } + return; + } + switch (node.kind) { + case 177: + case 178: + case 174: + if (node.parent.kind === 210) { + return (_c = getAssignedName(node.parent)) == null ? void 0 : _c.getText(); + } + return (_d = getNameOfDeclaration(node.parent)) == null ? void 0 : _d.getText(); + case 262: + case 263: + case 267: + if (isModuleBlock(node.parent) && isIdentifier(node.parent.parent.name)) { + return node.parent.parent.name.getText(); + } + } + } + function findImplementation(typeChecker, node) { + if (node.body) { + return node; + } + if (isConstructorDeclaration(node)) { + return getFirstConstructorWithBody(node.parent); + } + if (isFunctionDeclaration(node) || isMethodDeclaration(node)) { + const symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); + if (symbol && symbol.valueDeclaration && isFunctionLikeDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.body) { + return symbol.valueDeclaration; + } + return void 0; + } + return node; + } + function findAllInitialDeclarations(typeChecker, node) { + const symbol = getSymbolOfCallHierarchyDeclaration(typeChecker, node); + let declarations; + if (symbol && symbol.declarations) { + const indices = indicesOf(symbol.declarations); + const keys2 = map4(symbol.declarations, (decl) => ({ file: decl.getSourceFile().fileName, pos: decl.pos })); + indices.sort((a7, b8) => compareStringsCaseSensitive(keys2[a7].file, keys2[b8].file) || keys2[a7].pos - keys2[b8].pos); + const sortedDeclarations = map4(indices, (i7) => symbol.declarations[i7]); + let lastDecl; + for (const decl of sortedDeclarations) { + if (isValidCallHierarchyDeclaration(decl)) { + if (!lastDecl || lastDecl.parent !== decl.parent || lastDecl.end !== decl.pos) { + declarations = append(declarations, decl); + } + lastDecl = decl; + } + } + } + return declarations; + } + function findImplementationOrAllInitialDeclarations(typeChecker, node) { + if (isClassStaticBlockDeclaration(node)) { + return node; + } + if (isFunctionLikeDeclaration(node)) { + return findImplementation(typeChecker, node) ?? findAllInitialDeclarations(typeChecker, node) ?? node; + } + return findAllInitialDeclarations(typeChecker, node) ?? node; + } + function resolveCallHierarchyDeclaration(program, location2) { + const typeChecker = program.getTypeChecker(); + let followingSymbol = false; + while (true) { + if (isValidCallHierarchyDeclaration(location2)) { + return findImplementationOrAllInitialDeclarations(typeChecker, location2); + } + if (isPossibleCallHierarchyDeclaration(location2)) { + const ancestor = findAncestor(location2, isValidCallHierarchyDeclaration); + return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); + } + if (isDeclarationName(location2)) { + if (isValidCallHierarchyDeclaration(location2.parent)) { + return findImplementationOrAllInitialDeclarations(typeChecker, location2.parent); + } + if (isPossibleCallHierarchyDeclaration(location2.parent)) { + const ancestor = findAncestor(location2.parent, isValidCallHierarchyDeclaration); + return ancestor && findImplementationOrAllInitialDeclarations(typeChecker, ancestor); + } + if (isVariableLike2(location2.parent) && location2.parent.initializer && isAssignedExpression(location2.parent.initializer)) { + return location2.parent.initializer; + } + return void 0; + } + if (isConstructorDeclaration(location2)) { + if (isValidCallHierarchyDeclaration(location2.parent)) { + return location2.parent; + } + return void 0; + } + if (location2.kind === 126 && isClassStaticBlockDeclaration(location2.parent)) { + location2 = location2.parent; + continue; + } + if (isVariableDeclaration(location2) && location2.initializer && isAssignedExpression(location2.initializer)) { + return location2.initializer; + } + if (!followingSymbol) { + let symbol = typeChecker.getSymbolAtLocation(location2); + if (symbol) { + if (symbol.flags & 2097152) { + symbol = typeChecker.getAliasedSymbol(symbol); + } + if (symbol.valueDeclaration) { + followingSymbol = true; + location2 = symbol.valueDeclaration; + continue; + } + } + } + return void 0; + } + } + function createCallHierarchyItem(program, node) { + const sourceFile = node.getSourceFile(); + const name2 = getCallHierarchyItemName(program, node); + const containerName = getCallHierarchItemContainerName(node); + const kind = getNodeKind(node); + const kindModifiers = getNodeModifiers(node); + const span = createTextSpanFromBounds(skipTrivia( + sourceFile.text, + node.getFullStart(), + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ), node.getEnd()); + const selectionSpan = createTextSpanFromBounds(name2.pos, name2.end); + return { file: sourceFile.fileName, kind, kindModifiers, name: name2.text, containerName, span, selectionSpan }; + } + function isDefined(x7) { + return x7 !== void 0; + } + function convertEntryToCallSite(entry) { + if (entry.kind === ts_FindAllReferences_exports.EntryKind.Node) { + const { node } = entry; + if (isCallOrNewExpressionTarget( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || isTaggedTemplateTag( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || isDecoratorTarget( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || isJsxOpeningLikeElementTagName( + node, + /*includeElementAccess*/ + true, + /*skipPastOuterExpressions*/ + true + ) || isRightSideOfPropertyAccess(node) || isArgumentExpressionOfElementAccess(node)) { + const sourceFile = node.getSourceFile(); + const ancestor = findAncestor(node, isValidCallHierarchyDeclaration) || sourceFile; + return { declaration: ancestor, range: createTextRangeFromNode(node, sourceFile) }; + } + } + } + function getCallSiteGroupKey(entry) { + return getNodeId(entry.declaration); + } + function createCallHierarchyIncomingCall(from, fromSpans) { + return { from, fromSpans }; + } + function convertCallSiteGroupToIncomingCall(program, entries) { + return createCallHierarchyIncomingCall(createCallHierarchyItem(program, entries[0].declaration), map4(entries, (entry) => createTextSpanFromRange(entry.range))); + } + function getIncomingCalls(program, declaration, cancellationToken) { + if (isSourceFile(declaration) || isModuleDeclaration(declaration) || isClassStaticBlockDeclaration(declaration)) { + return []; + } + const location2 = getCallHierarchyDeclarationReferenceNode(declaration); + const calls = filter2(ts_FindAllReferences_exports.findReferenceOrRenameEntries( + program, + cancellationToken, + program.getSourceFiles(), + location2, + /*position*/ + 0, + { use: ts_FindAllReferences_exports.FindReferencesUse.References }, + convertEntryToCallSite + ), isDefined); + return calls ? group2(calls, getCallSiteGroupKey, (entries) => convertCallSiteGroupToIncomingCall(program, entries)) : []; + } + function createCallSiteCollector(program, callSites) { + function recordCallSite(node) { + const target = isTaggedTemplateExpression(node) ? node.tag : isJsxOpeningLikeElement(node) ? node.tagName : isAccessExpression(node) ? node : isClassStaticBlockDeclaration(node) ? node : node.expression; + const declaration = resolveCallHierarchyDeclaration(program, target); + if (declaration) { + const range2 = createTextRangeFromNode(target, node.getSourceFile()); + if (isArray3(declaration)) { + for (const decl of declaration) { + callSites.push({ declaration: decl, range: range2 }); + } + } else { + callSites.push({ declaration, range: range2 }); + } + } + } + function collect(node) { + if (!node) + return; + if (node.flags & 33554432) { + return; + } + if (isValidCallHierarchyDeclaration(node)) { + if (isClassLike(node)) { + for (const member of node.members) { + if (member.name && isComputedPropertyName(member.name)) { + collect(member.name.expression); + } + } + } + return; + } + switch (node.kind) { + case 80: + case 271: + case 272: + case 278: + case 264: + case 265: + return; + case 175: + recordCallSite(node); + return; + case 216: + case 234: + collect(node.expression); + return; + case 260: + case 169: + collect(node.name); + collect(node.initializer); + return; + case 213: + recordCallSite(node); + collect(node.expression); + forEach4(node.arguments, collect); + return; + case 214: + recordCallSite(node); + collect(node.expression); + forEach4(node.arguments, collect); + return; + case 215: + recordCallSite(node); + collect(node.tag); + collect(node.template); + return; + case 286: + case 285: + recordCallSite(node); + collect(node.tagName); + collect(node.attributes); + return; + case 170: + recordCallSite(node); + collect(node.expression); + return; + case 211: + case 212: + recordCallSite(node); + forEachChild(node, collect); + break; + case 238: + collect(node.expression); + return; + } + if (isPartOfTypeNode(node)) { + return; + } + forEachChild(node, collect); + } + return collect; + } + function collectCallSitesOfSourceFile(node, collect) { + forEach4(node.statements, collect); + } + function collectCallSitesOfModuleDeclaration(node, collect) { + if (!hasSyntacticModifier( + node, + 128 + /* Ambient */ + ) && node.body && isModuleBlock(node.body)) { + forEach4(node.body.statements, collect); + } + } + function collectCallSitesOfFunctionLikeDeclaration(typeChecker, node, collect) { + const implementation = findImplementation(typeChecker, node); + if (implementation) { + forEach4(implementation.parameters, collect); + collect(implementation.body); + } + } + function collectCallSitesOfClassStaticBlockDeclaration(node, collect) { + collect(node.body); + } + function collectCallSitesOfClassLikeDeclaration(node, collect) { + forEach4(node.modifiers, collect); + const heritage = getClassExtendsHeritageElement(node); + if (heritage) { + collect(heritage.expression); + } + for (const member of node.members) { + if (canHaveModifiers(member)) { + forEach4(member.modifiers, collect); + } + if (isPropertyDeclaration(member)) { + collect(member.initializer); + } else if (isConstructorDeclaration(member) && member.body) { + forEach4(member.parameters, collect); + collect(member.body); + } else if (isClassStaticBlockDeclaration(member)) { + collect(member); + } + } + } + function collectCallSites(program, node) { + const callSites = []; + const collect = createCallSiteCollector(program, callSites); + switch (node.kind) { + case 312: + collectCallSitesOfSourceFile(node, collect); + break; + case 267: + collectCallSitesOfModuleDeclaration(node, collect); + break; + case 262: + case 218: + case 219: + case 174: + case 177: + case 178: + collectCallSitesOfFunctionLikeDeclaration(program.getTypeChecker(), node, collect); + break; + case 263: + case 231: + collectCallSitesOfClassLikeDeclaration(node, collect); + break; + case 175: + collectCallSitesOfClassStaticBlockDeclaration(node, collect); + break; + default: + Debug.assertNever(node); + } + return callSites; + } + function createCallHierarchyOutgoingCall(to, fromSpans) { + return { to, fromSpans }; + } + function convertCallSiteGroupToOutgoingCall(program, entries) { + return createCallHierarchyOutgoingCall(createCallHierarchyItem(program, entries[0].declaration), map4(entries, (entry) => createTextSpanFromRange(entry.range))); + } + function getOutgoingCalls(program, declaration) { + if (declaration.flags & 33554432 || isMethodSignature(declaration)) { + return []; + } + return group2(collectCallSites(program, declaration), getCallSiteGroupKey, (entries) => convertCallSiteGroupToOutgoingCall(program, entries)); + } + var init_callHierarchy = __esm2({ + "src/services/callHierarchy.ts"() { + "use strict"; + init_ts4(); + } + }); + var ts_CallHierarchy_exports = {}; + __export2(ts_CallHierarchy_exports, { + createCallHierarchyItem: () => createCallHierarchyItem, + getIncomingCalls: () => getIncomingCalls, + getOutgoingCalls: () => getOutgoingCalls, + resolveCallHierarchyDeclaration: () => resolveCallHierarchyDeclaration + }); + var init_ts_CallHierarchy = __esm2({ + "src/services/_namespaces/ts.CallHierarchy.ts"() { + "use strict"; + init_callHierarchy(); + } + }); + var ts_classifier_v2020_exports = {}; + __export2(ts_classifier_v2020_exports, { + TokenEncodingConsts: () => TokenEncodingConsts, + TokenModifier: () => TokenModifier, + TokenType: () => TokenType, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications2, + getSemanticClassifications: () => getSemanticClassifications2 + }); + var init_ts_classifier_v2020 = __esm2({ + "src/services/_namespaces/ts.classifier.v2020.ts"() { + "use strict"; + init_classifier2020(); + } + }); + var ts_classifier_exports = {}; + __export2(ts_classifier_exports, { + v2020: () => ts_classifier_v2020_exports + }); + var init_ts_classifier = __esm2({ + "src/services/_namespaces/ts.classifier.ts"() { + "use strict"; + init_ts_classifier_v2020(); + } + }); + function createCodeFixActionWithoutFixAll(fixName8, changes, description32) { + return createCodeFixActionWorker( + fixName8, + diagnosticToString(description32), + changes, + /*fixId*/ + void 0, + /*fixAllDescription*/ + void 0 + ); + } + function createCodeFixAction(fixName8, changes, description32, fixId52, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description32), changes, fixId52, diagnosticToString(fixAllDescription), command); + } + function createCodeFixActionMaybeFixAll(fixName8, changes, description32, fixId52, fixAllDescription, command) { + return createCodeFixActionWorker(fixName8, diagnosticToString(description32), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command); + } + function createCodeFixActionWorker(fixName8, description32, changes, fixId52, fixAllDescription, command) { + return { fixName: fixName8, description: description32, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 }; + } + function registerCodeFix(reg) { + for (const error22 of reg.errorCodes) { + errorCodeToFixesArray = void 0; + errorCodeToFixes.add(String(error22), reg); + } + if (reg.fixIds) { + for (const fixId52 of reg.fixIds) { + Debug.assert(!fixIdToRegistration.has(fixId52)); + fixIdToRegistration.set(fixId52, reg); + } + } + } + function getSupportedErrorCodes() { + return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys())); + } + function removeFixIdIfFixAllUnavailable(registration, diagnostics) { + const { errorCodes: errorCodes65 } = registration; + let maybeFixableDiagnostics = 0; + for (const diag2 of diagnostics) { + if (contains2(errorCodes65, diag2.code)) + maybeFixableDiagnostics++; + if (maybeFixableDiagnostics > 1) + break; + } + const fixAllUnavailable = maybeFixableDiagnostics < 2; + return ({ fixId: fixId52, fixAllDescription, ...action }) => { + return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription }; + }; + } + function getFixes(context2) { + const diagnostics = getDiagnostics(context2); + const registrations = errorCodeToFixes.get(String(context2.errorCode)); + return flatMap2(registrations, (f8) => map4(f8.getCodeActions(context2), removeFixIdIfFixAllUnavailable(f8, diagnostics))); + } + function getAllFixes(context2) { + return fixIdToRegistration.get(cast(context2.fixId, isString4)).getAllCodeActions(context2); + } + function createCombinedCodeActions(changes, commands) { + return { changes, commands }; + } + function createFileTextChanges(fileName, textChanges2) { + return { fileName, textChanges: textChanges2 }; + } + function codeFixAll(context2, errorCodes65, use) { + const commands = []; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => eachDiagnostic(context2, errorCodes65, (diag2) => use(t8, diag2, commands))); + return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands); + } + function eachDiagnostic(context2, errorCodes65, cb) { + for (const diag2 of getDiagnostics(context2)) { + if (contains2(errorCodes65, diag2.code)) { + cb(diag2); + } + } + } + function getDiagnostics({ program, sourceFile, cancellationToken }) { + return [ + ...program.getSemanticDiagnostics(sourceFile, cancellationToken), + ...program.getSyntacticDiagnostics(sourceFile, cancellationToken), + ...computeSuggestionDiagnostics(sourceFile, program, cancellationToken) + ]; + } + var errorCodeToFixes, fixIdToRegistration, errorCodeToFixesArray; + var init_codeFixProvider = __esm2({ + "src/services/codeFixProvider.ts"() { + "use strict"; + init_ts4(); + errorCodeToFixes = createMultiMap(); + fixIdToRegistration = /* @__PURE__ */ new Map(); + } + }); + function makeChange(changeTracker, sourceFile, assertion) { + const replacement = isAsExpression(assertion) ? factory.createAsExpression(assertion.expression, factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + )) : factory.createTypeAssertion(factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ), assertion.expression); + changeTracker.replaceNode(sourceFile, assertion.expression, replacement); + } + function getAssertion(sourceFile, pos) { + if (isInJSFile(sourceFile)) + return void 0; + return findAncestor(getTokenAtPosition(sourceFile, pos), (n7) => isAsExpression(n7) || isTypeAssertionExpression(n7)); + } + var fixId, errorCodes; + var init_addConvertToUnknownForNonOverlappingTypes = __esm2({ + "src/services/codefixes/addConvertToUnknownForNonOverlappingTypes.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId = "addConvertToUnknownForNonOverlappingTypes"; + errorCodes = [Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code]; + registerCodeFix({ + errorCodes, + getCodeActions: function getCodeActionsToAddConvertToUnknownForNonOverlappingTypes(context2) { + const assertion = getAssertion(context2.sourceFile, context2.span.start); + if (assertion === void 0) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange(t8, context2.sourceFile, assertion)); + return [createCodeFixAction(fixId, changes, Diagnostics.Add_unknown_conversion_for_non_overlapping_types, fixId, Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]; + }, + fixIds: [fixId], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes, (changes, diag2) => { + const assertion = getAssertion(diag2.file, diag2.start); + if (assertion) { + makeChange(changes, diag2.file, assertion); + } + }) + }); + } + }); + var init_addEmptyExportDeclaration = __esm2({ + "src/services/codefixes/addEmptyExportDeclaration.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + registerCodeFix({ + errorCodes: [ + Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code, + Diagnostics.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code, + Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code + ], + getCodeActions: function getCodeActionsToAddEmptyExportDeclaration(context2) { + const { sourceFile } = context2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changes2) => { + const exportDeclaration = factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports([]), + /*moduleSpecifier*/ + void 0 + ); + changes2.insertNodeAtEndOfScope(sourceFile, sourceFile, exportDeclaration); + }); + return [createCodeFixActionWithoutFixAll("addEmptyExportDeclaration", changes, Diagnostics.Add_export_to_make_this_file_into_a_module)]; + } + }); + } + }); + function getFix(context2, decl, trackChanges, fixedDeclarations) { + const changes = trackChanges((t8) => makeChange2(t8, context2.sourceFile, decl, fixedDeclarations)); + return createCodeFixAction(fixId2, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId2, Diagnostics.Add_all_missing_async_modifiers); + } + function makeChange2(changeTracker, sourceFile, insertionSite, fixedDeclarations) { + if (fixedDeclarations) { + if (fixedDeclarations.has(getNodeId(insertionSite))) { + return; + } + } + fixedDeclarations == null ? void 0 : fixedDeclarations.add(getNodeId(insertionSite)); + const cloneWithModifier = factory.replaceModifiers( + getSynthesizedDeepClone( + insertionSite, + /*includeTrivia*/ + true + ), + factory.createNodeArray(factory.createModifiersFromModifierFlags( + getSyntacticModifierFlags(insertionSite) | 1024 + /* Async */ + )) + ); + changeTracker.replaceNode( + sourceFile, + insertionSite, + cloneWithModifier + ); + } + function getFixableErrorSpanDeclaration(sourceFile, span) { + if (!span) + return void 0; + const token = getTokenAtPosition(sourceFile, span.start); + const decl = findAncestor(token, (node) => { + if (node.getStart(sourceFile) < span.start || node.getEnd() > textSpanEnd(span)) { + return "quit"; + } + return (isArrowFunction(node) || isMethodDeclaration(node) || isFunctionExpression(node) || isFunctionDeclaration(node)) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile)); + }); + return decl; + } + function getIsMatchingAsyncError(span, errorCode) { + return ({ start, length: length2, relatedInformation, code }) => isNumber3(start) && isNumber3(length2) && textSpansEqual({ start, length: length2 }, span) && code === errorCode && !!relatedInformation && some2(relatedInformation, (related) => related.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); + } + var fixId2, errorCodes2; + var init_addMissingAsync = __esm2({ + "src/services/codefixes/addMissingAsync.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId2 = "addMissingAsync"; + errorCodes2 = [ + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + Diagnostics.Type_0_is_not_assignable_to_type_1.code, + Diagnostics.Type_0_is_not_comparable_to_type_1.code + ]; + registerCodeFix({ + fixIds: [fixId2], + errorCodes: errorCodes2, + getCodeActions: function getCodeActionsToAddMissingAsync(context2) { + const { sourceFile, errorCode, cancellationToken, program, span } = context2; + const diagnostic = find2(program.getTypeChecker().getDiagnostics(sourceFile, cancellationToken), getIsMatchingAsyncError(span, errorCode)); + const directSpan = diagnostic && diagnostic.relatedInformation && find2(diagnostic.relatedInformation, (r8) => r8.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); + const decl = getFixableErrorSpanDeclaration(sourceFile, directSpan); + if (!decl) { + return; + } + const trackChanges = (cb) => ts_textChanges_exports.ChangeTracker.with(context2, cb); + return [getFix(context2, decl, trackChanges)]; + }, + getAllCodeActions: (context2) => { + const { sourceFile } = context2; + const fixedDeclarations = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes2, (t8, diagnostic) => { + const span = diagnostic.relatedInformation && find2(diagnostic.relatedInformation, (r8) => r8.code === Diagnostics.Did_you_mean_to_mark_this_function_as_async.code); + const decl = getFixableErrorSpanDeclaration(sourceFile, span); + if (!decl) { + return; + } + const trackChanges = (cb) => (cb(t8), []); + return getFix(context2, decl, trackChanges, fixedDeclarations); + }); + } + }); + } + }); + function getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program) { + const expression = getFixableErrorSpanExpression(sourceFile, span); + return expression && isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) && isInsideAwaitableBody(expression) ? expression : void 0; + } + function getDeclarationSiteFix(context2, expression, errorCode, checker, trackChanges, fixedDeclarations) { + const { sourceFile, program, cancellationToken } = context2; + const awaitableInitializers = findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker); + if (awaitableInitializers) { + const initializerChanges = trackChanges((t8) => { + forEach4(awaitableInitializers.initializers, ({ expression: expression2 }) => makeChange3(t8, errorCode, sourceFile, checker, expression2, fixedDeclarations)); + if (fixedDeclarations && awaitableInitializers.needsSecondPassForFixAll) { + makeChange3(t8, errorCode, sourceFile, checker, expression, fixedDeclarations); + } + }); + return createCodeFixActionWithoutFixAll( + "addMissingAwaitToInitializer", + initializerChanges, + awaitableInitializers.initializers.length === 1 ? [Diagnostics.Add_await_to_initializer_for_0, awaitableInitializers.initializers[0].declarationSymbol.name] : Diagnostics.Add_await_to_initializers + ); + } + } + function getUseSiteFix(context2, expression, errorCode, checker, trackChanges, fixedDeclarations) { + const changes = trackChanges((t8) => makeChange3(t8, errorCode, context2.sourceFile, checker, expression, fixedDeclarations)); + return createCodeFixAction(fixId3, changes, Diagnostics.Add_await, fixId3, Diagnostics.Fix_all_expressions_possibly_missing_await); + } + function isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program) { + const checker = program.getTypeChecker(); + const diagnostics = checker.getDiagnostics(sourceFile, cancellationToken); + return some2(diagnostics, ({ start, length: length2, relatedInformation, code }) => isNumber3(start) && isNumber3(length2) && textSpansEqual({ start, length: length2 }, span) && code === errorCode && !!relatedInformation && some2(relatedInformation, (related) => related.code === Diagnostics.Did_you_forget_to_use_await.code)); + } + function findAwaitableInitializers(expression, sourceFile, cancellationToken, program, checker) { + const identifiers = getIdentifiersFromErrorSpanExpression(expression, checker); + if (!identifiers) { + return; + } + let isCompleteFix = identifiers.isCompleteFix; + let initializers; + for (const identifier of identifiers.identifiers) { + const symbol = checker.getSymbolAtLocation(identifier); + if (!symbol) { + continue; + } + const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration); + const variableName = declaration && tryCast(declaration.name, isIdentifier); + const variableStatement = getAncestor( + declaration, + 243 + /* VariableStatement */ + ); + if (!declaration || !variableStatement || declaration.type || !declaration.initializer || variableStatement.getSourceFile() !== sourceFile || hasSyntacticModifier( + variableStatement, + 32 + /* Export */ + ) || !variableName || !isInsideAwaitableBody(declaration.initializer)) { + isCompleteFix = false; + continue; + } + const diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); + const isUsedElsewhere = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(variableName, checker, sourceFile, (reference) => { + return identifier !== reference && !symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker); + }); + if (isUsedElsewhere) { + isCompleteFix = false; + continue; + } + (initializers || (initializers = [])).push({ + expression: declaration.initializer, + declarationSymbol: symbol + }); + } + return initializers && { + initializers, + needsSecondPassForFixAll: !isCompleteFix + }; + } + function getIdentifiersFromErrorSpanExpression(expression, checker) { + if (isPropertyAccessExpression(expression.parent) && isIdentifier(expression.parent.expression)) { + return { identifiers: [expression.parent.expression], isCompleteFix: true }; + } + if (isIdentifier(expression)) { + return { identifiers: [expression], isCompleteFix: true }; + } + if (isBinaryExpression(expression)) { + let sides; + let isCompleteFix = true; + for (const side of [expression.left, expression.right]) { + const type3 = checker.getTypeAtLocation(side); + if (checker.getPromisedTypeOfPromise(type3)) { + if (!isIdentifier(side)) { + isCompleteFix = false; + continue; + } + (sides || (sides = [])).push(side); + } + } + return sides && { identifiers: sides, isCompleteFix }; + } + } + function symbolReferenceIsAlsoMissingAwait(reference, diagnostics, sourceFile, checker) { + const errorNode = isPropertyAccessExpression(reference.parent) ? reference.parent.name : isBinaryExpression(reference.parent) ? reference.parent : reference; + const diagnostic = find2(diagnostics, (diagnostic2) => diagnostic2.start === errorNode.getStart(sourceFile) && diagnostic2.start + diagnostic2.length === errorNode.getEnd()); + return diagnostic && contains2(errorCodes3, diagnostic.code) || // A Promise is usually not correct in a binary expression (it's not valid + // in an arithmetic expression and an equality comparison seems unusual), + // but if the other side of the binary expression has an error, the side + // is typed `any` which will squash the error that would identify this + // Promise as an invalid operand. So if the whole binary expression is + // typed `any` as a result, there is a strong likelihood that this Promise + // is accidentally missing `await`. + checker.getTypeAtLocation(errorNode).flags & 1; + } + function isInsideAwaitableBody(node) { + return node.flags & 65536 || !!findAncestor(node, (ancestor) => ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor || isBlock2(ancestor) && (ancestor.parent.kind === 262 || ancestor.parent.kind === 218 || ancestor.parent.kind === 219 || ancestor.parent.kind === 174)); + } + function makeChange3(changeTracker, errorCode, sourceFile, checker, insertionSite, fixedDeclarations) { + if (isForOfStatement(insertionSite.parent) && !insertionSite.parent.awaitModifier) { + const exprType = checker.getTypeAtLocation(insertionSite); + const asyncIter = checker.getAsyncIterableType(); + if (asyncIter && checker.isTypeAssignableTo(exprType, asyncIter)) { + const forOf = insertionSite.parent; + changeTracker.replaceNode(sourceFile, forOf, factory.updateForOfStatement(forOf, factory.createToken( + 135 + /* AwaitKeyword */ + ), forOf.initializer, forOf.expression, forOf.statement)); + return; + } + } + if (isBinaryExpression(insertionSite)) { + for (const side of [insertionSite.left, insertionSite.right]) { + if (fixedDeclarations && isIdentifier(side)) { + const symbol = checker.getSymbolAtLocation(side); + if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { + continue; + } + } + const type3 = checker.getTypeAtLocation(side); + const newNode = checker.getPromisedTypeOfPromise(type3) ? factory.createAwaitExpression(side) : side; + changeTracker.replaceNode(sourceFile, side, newNode); + } + } else if (errorCode === propertyAccessCode && isPropertyAccessExpression(insertionSite.parent)) { + if (fixedDeclarations && isIdentifier(insertionSite.parent.expression)) { + const symbol = checker.getSymbolAtLocation(insertionSite.parent.expression); + if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode( + sourceFile, + insertionSite.parent.expression, + factory.createParenthesizedExpression(factory.createAwaitExpression(insertionSite.parent.expression)) + ); + insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile); + } else if (contains2(callableConstructableErrorCodes, errorCode) && isCallOrNewExpression(insertionSite.parent)) { + if (fixedDeclarations && isIdentifier(insertionSite)) { + const symbol = checker.getSymbolAtLocation(insertionSite); + if (symbol && fixedDeclarations.has(getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode(sourceFile, insertionSite, factory.createParenthesizedExpression(factory.createAwaitExpression(insertionSite))); + insertLeadingSemicolonIfNeeded(changeTracker, insertionSite, sourceFile); + } else { + if (fixedDeclarations && isVariableDeclaration(insertionSite.parent) && isIdentifier(insertionSite.parent.name)) { + const symbol = checker.getSymbolAtLocation(insertionSite.parent.name); + if (symbol && !tryAddToSet(fixedDeclarations, getSymbolId(symbol))) { + return; + } + } + changeTracker.replaceNode(sourceFile, insertionSite, factory.createAwaitExpression(insertionSite)); + } + } + function insertLeadingSemicolonIfNeeded(changeTracker, beforeNode, sourceFile) { + const precedingToken = findPrecedingToken(beforeNode.pos, sourceFile); + if (precedingToken && positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { + changeTracker.insertText(sourceFile, beforeNode.getStart(sourceFile), ";"); + } + } + var fixId3, propertyAccessCode, callableConstructableErrorCodes, errorCodes3; + var init_addMissingAwait = __esm2({ + "src/services/codefixes/addMissingAwait.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId3 = "addMissingAwait"; + propertyAccessCode = Diagnostics.Property_0_does_not_exist_on_type_1.code; + callableConstructableErrorCodes = [ + Diagnostics.This_expression_is_not_callable.code, + Diagnostics.This_expression_is_not_constructable.code + ]; + errorCodes3 = [ + Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code, + Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, + Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code, + Diagnostics.Operator_0_cannot_be_applied_to_type_1.code, + Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code, + Diagnostics.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code, + Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code, + Diagnostics.Type_0_is_not_an_array_type.code, + Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code, + Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code, + Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code, + Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + propertyAccessCode, + ...callableConstructableErrorCodes + ]; + registerCodeFix({ + fixIds: [fixId3], + errorCodes: errorCodes3, + getCodeActions: function getCodeActionsToAddMissingAwait(context2) { + const { sourceFile, errorCode, span, cancellationToken, program } = context2; + const expression = getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program); + if (!expression) { + return; + } + const checker = context2.program.getTypeChecker(); + const trackChanges = (cb) => ts_textChanges_exports.ChangeTracker.with(context2, cb); + return compact2([ + getDeclarationSiteFix(context2, expression, errorCode, checker, trackChanges), + getUseSiteFix(context2, expression, errorCode, checker, trackChanges) + ]); + }, + getAllCodeActions: (context2) => { + const { sourceFile, program, cancellationToken } = context2; + const checker = context2.program.getTypeChecker(); + const fixedDeclarations = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes3, (t8, diagnostic) => { + const expression = getAwaitErrorSpanExpression(sourceFile, diagnostic.code, diagnostic, cancellationToken, program); + if (!expression) { + return; + } + const trackChanges = (cb) => (cb(t8), []); + return getDeclarationSiteFix(context2, expression, diagnostic.code, checker, trackChanges, fixedDeclarations) || getUseSiteFix(context2, expression, diagnostic.code, checker, trackChanges, fixedDeclarations); + }); + } + }); + } + }); + function makeChange4(changeTracker, sourceFile, pos, program, fixedNodes) { + const token = getTokenAtPosition(sourceFile, pos); + const forInitializer = findAncestor(token, (node) => isForInOrOfStatement(node.parent) ? node.parent.initializer === node : isPossiblyPartOfDestructuring(node) ? false : "quit"); + if (forInitializer) + return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes); + const parent22 = token.parent; + if (isBinaryExpression(parent22) && parent22.operatorToken.kind === 64 && isExpressionStatement(parent22.parent)) { + return applyChange(changeTracker, token, sourceFile, fixedNodes); + } + if (isArrayLiteralExpression(parent22)) { + const checker = program.getTypeChecker(); + if (!every2(parent22.elements, (element) => arrayElementCouldBeVariableDeclaration(element, checker))) { + return; + } + return applyChange(changeTracker, parent22, sourceFile, fixedNodes); + } + const commaExpression = findAncestor(token, (node) => isExpressionStatement(node.parent) ? true : isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit"); + if (commaExpression) { + const checker = program.getTypeChecker(); + if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) { + return; + } + return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes); + } + } + function applyChange(changeTracker, initializer, sourceFile, fixedNodes) { + if (!fixedNodes || tryAddToSet(fixedNodes, initializer)) { + changeTracker.insertModifierBefore(sourceFile, 87, initializer); + } + } + function isPossiblyPartOfDestructuring(node) { + switch (node.kind) { + case 80: + case 209: + case 210: + case 303: + case 304: + return true; + default: + return false; + } + } + function arrayElementCouldBeVariableDeclaration(expression, checker) { + const identifier = isIdentifier(expression) ? expression : isAssignmentExpression( + expression, + /*excludeCompoundAssignment*/ + true + ) && isIdentifier(expression.left) ? expression.left : void 0; + return !!identifier && !checker.getSymbolAtLocation(identifier); + } + function isPossiblyPartOfCommaSeperatedInitializer(node) { + switch (node.kind) { + case 80: + case 226: + case 28: + return true; + default: + return false; + } + } + function expressionCouldBeVariableDeclaration(expression, checker) { + if (!isBinaryExpression(expression)) { + return false; + } + if (expression.operatorToken.kind === 28) { + return every2([expression.left, expression.right], (expression2) => expressionCouldBeVariableDeclaration(expression2, checker)); + } + return expression.operatorToken.kind === 64 && isIdentifier(expression.left) && !checker.getSymbolAtLocation(expression.left); + } + var fixId4, errorCodes4; + var init_addMissingConst = __esm2({ + "src/services/codefixes/addMissingConst.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId4 = "addMissingConst"; + errorCodes4 = [ + Diagnostics.Cannot_find_name_0.code, + Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code + ]; + registerCodeFix({ + errorCodes: errorCodes4, + getCodeActions: function getCodeActionsToAddMissingConst(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange4(t8, context2.sourceFile, context2.span.start, context2.program)); + if (changes.length > 0) { + return [createCodeFixAction(fixId4, changes, Diagnostics.Add_const_to_unresolved_variable, fixId4, Diagnostics.Add_const_to_all_unresolved_variables)]; + } + }, + fixIds: [fixId4], + getAllCodeActions: (context2) => { + const fixedNodes = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes4, (changes, diag2) => makeChange4(changes, diag2.file, diag2.start, context2.program, fixedNodes)); + } + }); + } + }); + function makeChange5(changeTracker, sourceFile, pos, fixedNodes) { + const token = getTokenAtPosition(sourceFile, pos); + if (!isIdentifier(token)) { + return; + } + const declaration = token.parent; + if (declaration.kind === 172 && (!fixedNodes || tryAddToSet(fixedNodes, declaration))) { + changeTracker.insertModifierBefore(sourceFile, 138, declaration); + } + } + var fixId5, errorCodes5; + var init_addMissingDeclareProperty = __esm2({ + "src/services/codefixes/addMissingDeclareProperty.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId5 = "addMissingDeclareProperty"; + errorCodes5 = [ + Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code + ]; + registerCodeFix({ + errorCodes: errorCodes5, + getCodeActions: function getCodeActionsToAddMissingDeclareOnProperty(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange5(t8, context2.sourceFile, context2.span.start)); + if (changes.length > 0) { + return [createCodeFixAction(fixId5, changes, Diagnostics.Prefix_with_declare, fixId5, Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]; + } + }, + fixIds: [fixId5], + getAllCodeActions: (context2) => { + const fixedNodes = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes5, (changes, diag2) => makeChange5(changes, diag2.file, diag2.start, fixedNodes)); + } + }); + } + }); + function makeChange6(changeTracker, sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + const decorator = findAncestor(token, isDecorator); + Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + const replacement = factory.createCallExpression( + decorator.expression, + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } + var fixId6, errorCodes6; + var init_addMissingInvocationForDecorator = __esm2({ + "src/services/codefixes/addMissingInvocationForDecorator.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId6 = "addMissingInvocationForDecorator"; + errorCodes6 = [Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; + registerCodeFix({ + errorCodes: errorCodes6, + getCodeActions: function getCodeActionsToAddMissingInvocationForDecorator(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange6(t8, context2.sourceFile, context2.span.start)); + return [createCodeFixAction(fixId6, changes, Diagnostics.Call_decorator_expression, fixId6, Diagnostics.Add_to_all_uncalled_decorators)]; + }, + fixIds: [fixId6], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes6, (changes, diag2) => makeChange6(changes, diag2.file, diag2.start)) + }); + } + }); + function makeChange7(changeTracker, sourceFile, start) { + const token = getTokenAtPosition(sourceFile, start); + const param = token.parent; + if (!isParameter(param)) { + return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind)); + } + const i7 = param.parent.parameters.indexOf(param); + Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one."); + Debug.assert(i7 > -1, "Parameter not found in parent parameter list."); + let end = param.name.getEnd(); + let typeNode = factory.createTypeReferenceNode( + param.name, + /*typeArguments*/ + void 0 + ); + let nextParam = tryGetNextParam(sourceFile, param); + while (nextParam) { + typeNode = factory.createArrayTypeNode(typeNode); + end = nextParam.getEnd(); + nextParam = tryGetNextParam(sourceFile, nextParam); + } + const replacement = factory.createParameterDeclaration( + param.modifiers, + param.dotDotDotToken, + "arg" + i7, + param.questionToken, + param.dotDotDotToken && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode, + param.initializer + ); + changeTracker.replaceRange(sourceFile, createRange2(param.getStart(sourceFile), end), replacement); + } + function tryGetNextParam(sourceFile, param) { + const nextToken = findNextToken(param.name, param.parent, sourceFile); + if (nextToken && nextToken.kind === 23 && isArrayBindingPattern(nextToken.parent) && isParameter(nextToken.parent.parent)) { + return nextToken.parent.parent; + } + return void 0; + } + var fixId7, errorCodes7; + var init_addNameToNamelessParameter = __esm2({ + "src/services/codefixes/addNameToNamelessParameter.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId7 = "addNameToNamelessParameter"; + errorCodes7 = [Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code]; + registerCodeFix({ + errorCodes: errorCodes7, + getCodeActions: function getCodeActionsToAddNameToNamelessParameter(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange7(t8, context2.sourceFile, context2.span.start)); + return [createCodeFixAction(fixId7, changes, Diagnostics.Add_parameter_name, fixId7, Diagnostics.Add_names_to_all_parameters_without_names)]; + }, + fixIds: [fixId7], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes7, (changes, diag2) => makeChange7(changes, diag2.file, diag2.start)) + }); + } + }); + function getPropertiesToAdd(file, span, checker) { + var _a2, _b; + const sourceTarget = getSourceTarget(getFixableErrorSpanExpression(file, span), checker); + if (!sourceTarget) { + return emptyArray; + } + const { source: sourceNode, target: targetNode } = sourceTarget; + const target = shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) ? checker.getTypeAtLocation(targetNode.expression) : checker.getTypeAtLocation(targetNode); + if ((_b = (_a2 = target.symbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b.some((d7) => getSourceFileOfNode(d7).fileName.match(/\.d\.ts$/))) { + return emptyArray; + } + return checker.getExactOptionalProperties(target); + } + function shouldUseParentTypeOfProperty(sourceNode, targetNode, checker) { + return isPropertyAccessExpression(targetNode) && !!checker.getExactOptionalProperties(checker.getTypeAtLocation(targetNode.expression)).length && checker.getTypeAtLocation(sourceNode) === checker.getUndefinedType(); + } + function getSourceTarget(errorNode, checker) { + var _a2; + if (!errorNode) { + return void 0; + } else if (isBinaryExpression(errorNode.parent) && errorNode.parent.operatorToken.kind === 64) { + return { source: errorNode.parent.right, target: errorNode.parent.left }; + } else if (isVariableDeclaration(errorNode.parent) && errorNode.parent.initializer) { + return { source: errorNode.parent.initializer, target: errorNode.parent.name }; + } else if (isCallExpression(errorNode.parent)) { + const n7 = checker.getSymbolAtLocation(errorNode.parent.expression); + if (!(n7 == null ? void 0 : n7.valueDeclaration) || !isFunctionLikeKind(n7.valueDeclaration.kind)) + return void 0; + if (!isExpression(errorNode)) + return void 0; + const i7 = errorNode.parent.arguments.indexOf(errorNode); + if (i7 === -1) + return void 0; + const name2 = n7.valueDeclaration.parameters[i7].name; + if (isIdentifier(name2)) + return { source: errorNode, target: name2 }; + } else if (isPropertyAssignment(errorNode.parent) && isIdentifier(errorNode.parent.name) || isShorthandPropertyAssignment(errorNode.parent)) { + const parentTarget = getSourceTarget(errorNode.parent.parent, checker); + if (!parentTarget) + return void 0; + const prop = checker.getPropertyOfType(checker.getTypeAtLocation(parentTarget.target), errorNode.parent.name.text); + const declaration = (_a2 = prop == null ? void 0 : prop.declarations) == null ? void 0 : _a2[0]; + if (!declaration) + return void 0; + return { + source: isPropertyAssignment(errorNode.parent) ? errorNode.parent.initializer : errorNode.parent.name, + target: declaration + }; + } + return void 0; + } + function addUndefinedToOptionalProperty(changes, toAdd) { + for (const add2 of toAdd) { + const d7 = add2.valueDeclaration; + if (d7 && (isPropertySignature(d7) || isPropertyDeclaration(d7)) && d7.type) { + const t8 = factory.createUnionTypeNode([ + ...d7.type.kind === 192 ? d7.type.types : [d7.type], + factory.createTypeReferenceNode("undefined") + ]); + changes.replaceNode(d7.getSourceFile(), d7.type, t8); + } + } + } + var addOptionalPropertyUndefined, errorCodes8; + var init_addOptionalPropertyUndefined = __esm2({ + "src/services/codefixes/addOptionalPropertyUndefined.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + addOptionalPropertyUndefined = "addOptionalPropertyUndefined"; + errorCodes8 = [ + Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code, + Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code + ]; + registerCodeFix({ + errorCodes: errorCodes8, + getCodeActions(context2) { + const typeChecker = context2.program.getTypeChecker(); + const toAdd = getPropertiesToAdd(context2.sourceFile, context2.span, typeChecker); + if (!toAdd.length) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addUndefinedToOptionalProperty(t8, toAdd)); + return [createCodeFixActionWithoutFixAll(addOptionalPropertyUndefined, changes, Diagnostics.Add_undefined_to_optional_property_type)]; + }, + fixIds: [addOptionalPropertyUndefined] + }); + } + }); + function getDeclaration(file, pos) { + const name2 = getTokenAtPosition(file, pos); + return tryCast(isParameter(name2.parent) ? name2.parent.parent : name2.parent, parameterShouldGetTypeFromJSDoc); + } + function parameterShouldGetTypeFromJSDoc(node) { + return isDeclarationWithType(node) && hasUsableJSDoc(node); + } + function hasUsableJSDoc(decl) { + return isFunctionLikeDeclaration(decl) ? decl.parameters.some(hasUsableJSDoc) || !decl.type && !!getJSDocReturnType(decl) : !decl.type && !!getJSDocType(decl); + } + function doChange8(changes, sourceFile, decl) { + if (isFunctionLikeDeclaration(decl) && (getJSDocReturnType(decl) || decl.parameters.some((p7) => !!getJSDocType(p7)))) { + if (!decl.typeParameters) { + const typeParameters = getJSDocTypeParameterDeclarations(decl); + if (typeParameters.length) + changes.insertTypeParameters(sourceFile, decl, typeParameters); + } + const needParens = isArrowFunction(decl) && !findChildOfKind(decl, 21, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, first(decl.parameters), factory.createToken( + 21 + /* OpenParenToken */ + )); + for (const param of decl.parameters) { + if (!param.type) { + const paramType = getJSDocType(param); + if (paramType) + changes.tryInsertTypeAnnotation(sourceFile, param, visitNode(paramType, transformJSDocType, isTypeNode)); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, last2(decl.parameters), factory.createToken( + 22 + /* CloseParenToken */ + )); + if (!decl.type) { + const returnType = getJSDocReturnType(decl); + if (returnType) + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(returnType, transformJSDocType, isTypeNode)); + } + } else { + const jsdocType = Debug.checkDefined(getJSDocType(decl), "A JSDocType for this declaration should exist"); + Debug.assert(!decl.type, "The JSDocType decl should have a type"); + changes.tryInsertTypeAnnotation(sourceFile, decl, visitNode(jsdocType, transformJSDocType, isTypeNode)); + } + } + function isDeclarationWithType(node) { + return isFunctionLikeDeclaration(node) || node.kind === 260 || node.kind === 171 || node.kind === 172; + } + function transformJSDocType(node) { + switch (node.kind) { + case 319: + case 320: + return factory.createTypeReferenceNode("any", emptyArray); + case 323: + return transformJSDocOptionalType(node); + case 322: + return transformJSDocType(node.type); + case 321: + return transformJSDocNullableType(node); + case 325: + return transformJSDocVariadicType(node); + case 324: + return transformJSDocFunctionType(node); + case 183: + return transformJSDocTypeReference(node); + case 329: + return transformJSDocTypeLiteral(node); + default: + const visited = visitEachChild( + node, + transformJSDocType, + /*context*/ + void 0 + ); + setEmitFlags( + visited, + 1 + /* SingleLine */ + ); + return visited; + } + } + function transformJSDocTypeLiteral(node) { + const typeNode = factory.createTypeLiteralNode(map4(node.jsDocPropertyTags, (tag) => factory.createPropertySignature( + /*modifiers*/ + void 0, + isIdentifier(tag.name) ? tag.name : tag.name.right, + isOptionalJSDocPropertyLikeTag(tag) ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + tag.typeExpression && visitNode(tag.typeExpression.type, transformJSDocType, isTypeNode) || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ) + ))); + setEmitFlags( + typeNode, + 1 + /* SingleLine */ + ); + return typeNode; + } + function transformJSDocOptionalType(node) { + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("undefined", emptyArray)]); + } + function transformJSDocNullableType(node) { + return factory.createUnionTypeNode([visitNode(node.type, transformJSDocType, isTypeNode), factory.createTypeReferenceNode("null", emptyArray)]); + } + function transformJSDocVariadicType(node) { + return factory.createArrayTypeNode(visitNode(node.type, transformJSDocType, isTypeNode)); + } + function transformJSDocFunctionType(node) { + return factory.createFunctionTypeNode(emptyArray, node.parameters.map(transformJSDocParameter), node.type ?? factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + )); + } + function transformJSDocParameter(node) { + const index4 = node.parent.parameters.indexOf(node); + const isRest = node.type.kind === 325 && index4 === node.parent.parameters.length - 1; + const name2 = node.name || (isRest ? "rest" : "arg" + index4); + const dotdotdot = isRest ? factory.createToken( + 26 + /* DotDotDotToken */ + ) : node.dotDotDotToken; + return factory.createParameterDeclaration(node.modifiers, dotdotdot, name2, node.questionToken, visitNode(node.type, transformJSDocType, isTypeNode), node.initializer); + } + function transformJSDocTypeReference(node) { + let name2 = node.typeName; + let args = node.typeArguments; + if (isIdentifier(node.typeName)) { + if (isJSDocIndexSignature(node)) { + return transformJSDocIndexSignature(node); + } + let text = node.typeName.text; + switch (node.typeName.text) { + case "String": + case "Boolean": + case "Object": + case "Number": + text = text.toLowerCase(); + break; + case "array": + case "date": + case "promise": + text = text[0].toUpperCase() + text.slice(1); + break; + } + name2 = factory.createIdentifier(text); + if ((text === "Array" || text === "Promise") && !node.typeArguments) { + args = factory.createNodeArray([factory.createTypeReferenceNode("any", emptyArray)]); + } else { + args = visitNodes2(node.typeArguments, transformJSDocType, isTypeNode); + } + } + return factory.createTypeReferenceNode(name2, args); + } + function transformJSDocIndexSignature(node) { + const index4 = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + node.typeArguments[0].kind === 150 ? "n" : "s", + /*questionToken*/ + void 0, + factory.createTypeReferenceNode(node.typeArguments[0].kind === 150 ? "number" : "string", []), + /*initializer*/ + void 0 + ); + const indexSignature = factory.createTypeLiteralNode([factory.createIndexSignature( + /*modifiers*/ + void 0, + [index4], + node.typeArguments[1] + )]); + setEmitFlags( + indexSignature, + 1 + /* SingleLine */ + ); + return indexSignature; + } + var fixId8, errorCodes9; + var init_annotateWithTypeFromJSDoc = __esm2({ + "src/services/codefixes/annotateWithTypeFromJSDoc.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId8 = "annotateWithTypeFromJSDoc"; + errorCodes9 = [Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code]; + registerCodeFix({ + errorCodes: errorCodes9, + getCodeActions(context2) { + const decl = getDeclaration(context2.sourceFile, context2.span.start); + if (!decl) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange8(t8, context2.sourceFile, decl)); + return [createCodeFixAction(fixId8, changes, Diagnostics.Annotate_with_type_from_JSDoc, fixId8, Diagnostics.Annotate_everything_with_types_from_JSDoc)]; + }, + fixIds: [fixId8], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes9, (changes, diag2) => { + const decl = getDeclaration(diag2.file, diag2.start); + if (decl) + doChange8(changes, diag2.file, decl); + }) + }); + } + }); + function doChange9(changes, sourceFile, position, checker, preferences, compilerOptions) { + const ctorSymbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, position)); + if (!ctorSymbol || !ctorSymbol.valueDeclaration || !(ctorSymbol.flags & (16 | 3))) { + return void 0; + } + const ctorDeclaration = ctorSymbol.valueDeclaration; + if (isFunctionDeclaration(ctorDeclaration) || isFunctionExpression(ctorDeclaration)) { + changes.replaceNode(sourceFile, ctorDeclaration, createClassFromFunction(ctorDeclaration)); + } else if (isVariableDeclaration(ctorDeclaration)) { + const classDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + if (!classDeclaration) { + return void 0; + } + const ancestor = ctorDeclaration.parent.parent; + if (isVariableDeclarationList(ctorDeclaration.parent) && ctorDeclaration.parent.declarations.length > 1) { + changes.delete(sourceFile, ctorDeclaration); + changes.insertNodeAfter(sourceFile, ancestor, classDeclaration); + } else { + changes.replaceNode(sourceFile, ancestor, classDeclaration); + } + } + function createClassElementsFromSymbol(symbol) { + const memberElements = []; + if (symbol.exports) { + symbol.exports.forEach((member) => { + if (member.name === "prototype" && member.declarations) { + const firstDeclaration = member.declarations[0]; + if (member.declarations.length === 1 && isPropertyAccessExpression(firstDeclaration) && isBinaryExpression(firstDeclaration.parent) && firstDeclaration.parent.operatorToken.kind === 64 && isObjectLiteralExpression(firstDeclaration.parent.right)) { + const prototypes = firstDeclaration.parent.right; + createClassElement( + prototypes.symbol, + /*modifiers*/ + void 0, + memberElements + ); + } + } else { + createClassElement(member, [factory.createToken( + 126 + /* StaticKeyword */ + )], memberElements); + } + }); + } + if (symbol.members) { + symbol.members.forEach((member, key) => { + var _a2, _b, _c, _d; + if (key === "constructor" && member.valueDeclaration) { + const prototypeAssignment = (_d = (_c = (_b = (_a2 = symbol.exports) == null ? void 0 : _a2.get("prototype")) == null ? void 0 : _b.declarations) == null ? void 0 : _c[0]) == null ? void 0 : _d.parent; + if (prototypeAssignment && isBinaryExpression(prototypeAssignment) && isObjectLiteralExpression(prototypeAssignment.right) && some2(prototypeAssignment.right.properties, isConstructorAssignment)) { + } else { + changes.delete(sourceFile, member.valueDeclaration.parent); + } + return; + } + createClassElement( + member, + /*modifiers*/ + void 0, + memberElements + ); + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + if (isAccessExpression(_target)) { + if (isPropertyAccessExpression(_target) && isConstructorAssignment(_target)) + return true; + return isFunctionLike(source); + } else { + return every2(_target.properties, (property2) => { + if (isMethodDeclaration(property2) || isGetOrSetAccessorDeclaration(property2)) + return true; + if (isPropertyAssignment(property2) && isFunctionExpression(property2.initializer) && !!property2.name) + return true; + if (isConstructorAssignment(property2)) + return true; + return false; + }); + } + } + function createClassElement(symbol2, modifiers, members) { + if (!(symbol2.flags & 8192) && !(symbol2.flags & 4096)) { + return; + } + const memberDeclaration = symbol2.valueDeclaration; + const assignmentBinaryExpression = memberDeclaration.parent; + const assignmentExpr = assignmentBinaryExpression.right; + if (!shouldConvertDeclaration(memberDeclaration, assignmentExpr)) { + return; + } + if (some2(members, (m7) => { + const name2 = getNameOfDeclaration(m7); + if (name2 && isIdentifier(name2) && idText(name2) === symbolName(symbol2)) { + return true; + } + return false; + })) { + return; + } + const nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 244 ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + changes.delete(sourceFile, nodeToDelete); + if (!assignmentExpr) { + members.push(factory.createPropertyDeclaration( + modifiers, + symbol2.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + )); + return; + } + if (isAccessExpression(memberDeclaration) && (isFunctionExpression(assignmentExpr) || isArrowFunction(assignmentExpr))) { + const quotePreference = getQuotePreference(sourceFile, preferences); + const name2 = tryGetPropertyName(memberDeclaration, compilerOptions, quotePreference); + if (name2) { + createFunctionLikeExpressionMember(members, assignmentExpr, name2); + } + return; + } else if (isObjectLiteralExpression(assignmentExpr)) { + forEach4( + assignmentExpr.properties, + (property2) => { + if (isMethodDeclaration(property2) || isGetOrSetAccessorDeclaration(property2)) { + members.push(property2); + } + if (isPropertyAssignment(property2) && isFunctionExpression(property2.initializer)) { + createFunctionLikeExpressionMember(members, property2.initializer, property2.name); + } + if (isConstructorAssignment(property2)) + return; + return; + } + ); + return; + } else { + if (isSourceFileJS(sourceFile)) + return; + if (!isPropertyAccessExpression(memberDeclaration)) + return; + const prop = factory.createPropertyDeclaration( + modifiers, + memberDeclaration.name, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + assignmentExpr + ); + copyLeadingComments(assignmentBinaryExpression.parent, prop, sourceFile); + members.push(prop); + return; + } + function createFunctionLikeExpressionMember(members2, expression, name2) { + if (isFunctionExpression(expression)) + return createFunctionExpressionMember(members2, expression, name2); + else + return createArrowFunctionExpressionMember(members2, expression, name2); + } + function createFunctionExpressionMember(members2, functionExpression, name2) { + const fullModifiers = concatenate(modifiers, getModifierKindFromSource( + functionExpression, + 134 + /* AsyncKeyword */ + )); + const method2 = factory.createMethodDeclaration( + fullModifiers, + /*asteriskToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + functionExpression.parameters, + /*type*/ + void 0, + functionExpression.body + ); + copyLeadingComments(assignmentBinaryExpression, method2, sourceFile); + members2.push(method2); + return; + } + function createArrowFunctionExpressionMember(members2, arrowFunction, name2) { + const arrowFunctionBody = arrowFunction.body; + let bodyBlock; + if (arrowFunctionBody.kind === 241) { + bodyBlock = arrowFunctionBody; + } else { + bodyBlock = factory.createBlock([factory.createReturnStatement(arrowFunctionBody)]); + } + const fullModifiers = concatenate(modifiers, getModifierKindFromSource( + arrowFunction, + 134 + /* AsyncKeyword */ + )); + const method2 = factory.createMethodDeclaration( + fullModifiers, + /*asteriskToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + arrowFunction.parameters, + /*type*/ + void 0, + bodyBlock + ); + copyLeadingComments(assignmentBinaryExpression, method2, sourceFile); + members2.push(method2); + } + } + } + function createClassFromVariableDeclaration(node) { + const initializer = node.initializer; + if (!initializer || !isFunctionExpression(initializer) || !isIdentifier(node.name)) { + return void 0; + } + const memberElements = createClassElementsFromSymbol(node.symbol); + if (initializer.body) { + memberElements.unshift(factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + initializer.parameters, + initializer.body + )); + } + const modifiers = getModifierKindFromSource( + node.parent.parent, + 95 + /* ExportKeyword */ + ); + const cls = factory.createClassDeclaration( + modifiers, + node.name, + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + memberElements + ); + return cls; + } + function createClassFromFunction(node) { + const memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(factory.createConstructorDeclaration( + /*modifiers*/ + void 0, + node.parameters, + node.body + )); + } + const modifiers = getModifierKindFromSource( + node, + 95 + /* ExportKeyword */ + ); + const cls = factory.createClassDeclaration( + modifiers, + node.name, + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + memberElements + ); + return cls; + } + } + function getModifierKindFromSource(source, kind) { + return canHaveModifiers(source) ? filter2(source.modifiers, (modifier) => modifier.kind === kind) : void 0; + } + function isConstructorAssignment(x7) { + if (!x7.name) + return false; + if (isIdentifier(x7.name) && x7.name.text === "constructor") + return true; + return false; + } + function tryGetPropertyName(node, compilerOptions, quotePreference) { + if (isPropertyAccessExpression(node)) { + return node.name; + } + const propName2 = node.argumentExpression; + if (isNumericLiteral(propName2)) { + return propName2; + } + if (isStringLiteralLike(propName2)) { + return isIdentifierText(propName2.text, getEmitScriptTarget(compilerOptions)) ? factory.createIdentifier(propName2.text) : isNoSubstitutionTemplateLiteral(propName2) ? factory.createStringLiteral( + propName2.text, + quotePreference === 0 + /* Single */ + ) : propName2; + } + return void 0; + } + var fixId9, errorCodes10; + var init_convertFunctionToEs6Class = __esm2({ + "src/services/codefixes/convertFunctionToEs6Class.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId9 = "convertFunctionToEs6Class"; + errorCodes10 = [Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; + registerCodeFix({ + errorCodes: errorCodes10, + getCodeActions(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange9(t8, context2.sourceFile, context2.span.start, context2.program.getTypeChecker(), context2.preferences, context2.program.getCompilerOptions())); + return [createCodeFixAction(fixId9, changes, Diagnostics.Convert_function_to_an_ES2015_class, fixId9, Diagnostics.Convert_all_constructor_functions_to_classes)]; + }, + fixIds: [fixId9], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes10, (changes, err) => doChange9(changes, err.file, err.start, context2.program.getTypeChecker(), context2.preferences, context2.program.getCompilerOptions())) + }); + } + }); + function convertToAsyncFunction(changes, sourceFile, position, checker) { + const tokenAtPosition = getTokenAtPosition(sourceFile, position); + let functionToConvert; + if (isIdentifier(tokenAtPosition) && isVariableDeclaration(tokenAtPosition.parent) && tokenAtPosition.parent.initializer && isFunctionLikeDeclaration(tokenAtPosition.parent.initializer)) { + functionToConvert = tokenAtPosition.parent.initializer; + } else { + functionToConvert = tryCast(getContainingFunction(getTokenAtPosition(sourceFile, position)), canBeConvertedToAsync); + } + if (!functionToConvert) { + return; + } + const synthNamesMap = /* @__PURE__ */ new Map(); + const isInJavascript = isInJSFile(functionToConvert); + const setOfExpressionsToReturn = getAllPromiseExpressionsToReturn(functionToConvert, checker); + const functionToConvertRenamed = renameCollidingVarNames(functionToConvert, checker, synthNamesMap); + if (!returnsPromise(functionToConvertRenamed, checker)) { + return; + } + const returnStatements = functionToConvertRenamed.body && isBlock2(functionToConvertRenamed.body) ? getReturnStatementsWithPromiseHandlers(functionToConvertRenamed.body, checker) : emptyArray; + const transformer = { checker, synthNamesMap, setOfExpressionsToReturn, isInJSFile: isInJavascript }; + if (!returnStatements.length) { + return; + } + const pos = skipTrivia(sourceFile.text, moveRangePastModifiers(functionToConvert).pos); + changes.insertModifierAt(sourceFile, pos, 134, { suffix: " " }); + for (const returnStatement of returnStatements) { + forEachChild(returnStatement, function visit7(node) { + if (isCallExpression(node)) { + const newNodes = transformExpression( + node, + node, + transformer, + /*hasContinuation*/ + false + ); + if (hasFailed()) { + return true; + } + changes.replaceNodeWithNodes(sourceFile, returnStatement, newNodes); + } else if (!isFunctionLike(node)) { + forEachChild(node, visit7); + if (hasFailed()) { + return true; + } + } + }); + if (hasFailed()) { + return; + } + } + } + function getReturnStatementsWithPromiseHandlers(body, checker) { + const res = []; + forEachReturnStatement(body, (ret) => { + if (isReturnStatementWithFixablePromiseHandler(ret, checker)) + res.push(ret); + }); + return res; + } + function getAllPromiseExpressionsToReturn(func, checker) { + if (!func.body) { + return /* @__PURE__ */ new Set(); + } + const setOfExpressionsToReturn = /* @__PURE__ */ new Set(); + forEachChild(func.body, function visit7(node) { + if (isPromiseReturningCallExpression(node, checker, "then")) { + setOfExpressionsToReturn.add(getNodeId(node)); + forEach4(node.arguments, visit7); + } else if (isPromiseReturningCallExpression(node, checker, "catch") || isPromiseReturningCallExpression(node, checker, "finally")) { + setOfExpressionsToReturn.add(getNodeId(node)); + forEachChild(node, visit7); + } else if (isPromiseTypedExpression(node, checker)) { + setOfExpressionsToReturn.add(getNodeId(node)); + } else { + forEachChild(node, visit7); + } + }); + return setOfExpressionsToReturn; + } + function isPromiseReturningCallExpression(node, checker, name2) { + if (!isCallExpression(node)) + return false; + const isExpressionOfName = hasPropertyAccessExpressionWithName(node, name2); + const nodeType = isExpressionOfName && checker.getTypeAtLocation(node); + return !!(nodeType && checker.getPromisedTypeOfPromise(nodeType)); + } + function isReferenceToType(type3, target) { + return (getObjectFlags(type3) & 4) !== 0 && type3.target === target; + } + function getExplicitPromisedTypeOfPromiseReturningCallExpression(node, callback, checker) { + if (node.expression.name.escapedText === "finally") { + return void 0; + } + const promiseType2 = checker.getTypeAtLocation(node.expression.expression); + if (isReferenceToType(promiseType2, checker.getPromiseType()) || isReferenceToType(promiseType2, checker.getPromiseLikeType())) { + if (node.expression.name.escapedText === "then") { + if (callback === elementAt(node.arguments, 0)) { + return elementAt(node.typeArguments, 0); + } else if (callback === elementAt(node.arguments, 1)) { + return elementAt(node.typeArguments, 1); + } + } else { + return elementAt(node.typeArguments, 0); + } + } + } + function isPromiseTypedExpression(node, checker) { + if (!isExpression(node)) + return false; + return !!checker.getPromisedTypeOfPromise(checker.getTypeAtLocation(node)); + } + function renameCollidingVarNames(nodeToRename, checker, synthNamesMap) { + const identsToRenameMap = /* @__PURE__ */ new Map(); + const collidingSymbolMap = createMultiMap(); + forEachChild(nodeToRename, function visit7(node) { + if (!isIdentifier(node)) { + forEachChild(node, visit7); + return; + } + const symbol = checker.getSymbolAtLocation(node); + if (symbol) { + const type3 = checker.getTypeAtLocation(node); + const lastCallSignature = getLastCallSignature(type3, checker); + const symbolIdString = getSymbolId(symbol).toString(); + if (lastCallSignature && !isParameter(node.parent) && !isFunctionLikeDeclaration(node.parent) && !synthNamesMap.has(symbolIdString)) { + const firstParameter = firstOrUndefined(lastCallSignature.parameters); + const ident = (firstParameter == null ? void 0 : firstParameter.valueDeclaration) && isParameter(firstParameter.valueDeclaration) && tryCast(firstParameter.valueDeclaration.name, isIdentifier) || factory.createUniqueName( + "result", + 16 + /* Optimistic */ + ); + const synthName = getNewNameIfConflict(ident, collidingSymbolMap); + synthNamesMap.set(symbolIdString, synthName); + collidingSymbolMap.add(ident.text, symbol); + } else if (node.parent && (isParameter(node.parent) || isVariableDeclaration(node.parent) || isBindingElement(node.parent))) { + const originalName = node.text; + const collidingSymbols = collidingSymbolMap.get(originalName); + if (collidingSymbols && collidingSymbols.some((prevSymbol) => prevSymbol !== symbol)) { + const newName = getNewNameIfConflict(node, collidingSymbolMap); + identsToRenameMap.set(symbolIdString, newName.identifier); + synthNamesMap.set(symbolIdString, newName); + collidingSymbolMap.add(originalName, symbol); + } else { + const identifier = getSynthesizedDeepClone(node); + synthNamesMap.set(symbolIdString, createSynthIdentifier(identifier)); + collidingSymbolMap.add(originalName, symbol); + } + } + } + }); + return getSynthesizedDeepCloneWithReplacements( + nodeToRename, + /*includeTrivia*/ + true, + (original) => { + if (isBindingElement(original) && isIdentifier(original.name) && isObjectBindingPattern(original.parent)) { + const symbol = checker.getSymbolAtLocation(original.name); + const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol))); + if (renameInfo && renameInfo.text !== (original.name || original.propertyName).getText()) { + return factory.createBindingElement( + original.dotDotDotToken, + original.propertyName || original.name, + renameInfo, + original.initializer + ); + } + } else if (isIdentifier(original)) { + const symbol = checker.getSymbolAtLocation(original); + const renameInfo = symbol && identsToRenameMap.get(String(getSymbolId(symbol))); + if (renameInfo) { + return factory.createIdentifier(renameInfo.text); + } + } + } + ); + } + function getNewNameIfConflict(name2, originalNames) { + const numVarsSameName = (originalNames.get(name2.text) || emptyArray).length; + const identifier = numVarsSameName === 0 ? name2 : factory.createIdentifier(name2.text + "_" + numVarsSameName); + return createSynthIdentifier(identifier); + } + function hasFailed() { + return !codeActionSucceeded; + } + function silentFail() { + codeActionSucceeded = false; + return emptyArray; + } + function transformExpression(returnContextNode, node, transformer, hasContinuation, continuationArgName) { + if (isPromiseReturningCallExpression(node, transformer.checker, "then")) { + return transformThen(node, elementAt(node.arguments, 0), elementAt(node.arguments, 1), transformer, hasContinuation, continuationArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "catch")) { + return transformCatch(node, elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); + } + if (isPromiseReturningCallExpression(node, transformer.checker, "finally")) { + return transformFinally(node, elementAt(node.arguments, 0), transformer, hasContinuation, continuationArgName); + } + if (isPropertyAccessExpression(node)) { + return transformExpression(returnContextNode, node.expression, transformer, hasContinuation, continuationArgName); + } + const nodeType = transformer.checker.getTypeAtLocation(node); + if (nodeType && transformer.checker.getPromisedTypeOfPromise(nodeType)) { + Debug.assertNode(getOriginalNode(node).parent, isPropertyAccessExpression); + return transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName); + } + return silentFail(); + } + function isNullOrUndefined22({ checker }, node) { + if (node.kind === 106) + return true; + if (isIdentifier(node) && !isGeneratedIdentifier(node) && idText(node) === "undefined") { + const symbol = checker.getSymbolAtLocation(node); + return !symbol || checker.isUndefinedSymbol(symbol); + } + return false; + } + function createUniqueSynthName(prevArgName) { + const renamedPrevArg = factory.createUniqueName( + prevArgName.identifier.text, + 16 + /* Optimistic */ + ); + return createSynthIdentifier(renamedPrevArg); + } + function getPossibleNameForVarDecl(node, transformer, continuationArgName) { + let possibleNameForVarDecl; + if (continuationArgName && !shouldReturn(node, transformer)) { + if (isSynthIdentifier(continuationArgName)) { + possibleNameForVarDecl = continuationArgName; + transformer.synthNamesMap.forEach((val, key) => { + if (val.identifier.text === continuationArgName.identifier.text) { + const newSynthName = createUniqueSynthName(continuationArgName); + transformer.synthNamesMap.set(key, newSynthName); + } + }); + } else { + possibleNameForVarDecl = createSynthIdentifier(factory.createUniqueName( + "result", + 16 + /* Optimistic */ + ), continuationArgName.types); + } + declareSynthIdentifier(possibleNameForVarDecl); + } + return possibleNameForVarDecl; + } + function finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName) { + const statements = []; + let varDeclIdentifier; + if (possibleNameForVarDecl && !shouldReturn(node, transformer)) { + varDeclIdentifier = getSynthesizedDeepClone(declareSynthIdentifier(possibleNameForVarDecl)); + const typeArray = possibleNameForVarDecl.types; + const unionType2 = transformer.checker.getUnionType( + typeArray, + 2 + /* Subtype */ + ); + const unionTypeNode = transformer.isInJSFile ? void 0 : transformer.checker.typeToTypeNode( + unionType2, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + void 0 + ); + const varDecl = [factory.createVariableDeclaration( + varDeclIdentifier, + /*exclamationToken*/ + void 0, + unionTypeNode + )]; + const varDeclList = factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + varDecl, + 1 + /* Let */ + ) + ); + statements.push(varDeclList); + } + statements.push(tryStatement); + if (continuationArgName && varDeclIdentifier && isSynthBindingPattern(continuationArgName)) { + statements.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + getSynthesizedDeepClone(declareSynthBindingPattern(continuationArgName)), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + varDeclIdentifier + ) + ], + 2 + /* Const */ + ) + )); + } + return statements; + } + function transformFinally(node, onFinally, transformer, hasContinuation, continuationArgName) { + if (!onFinally || isNullOrUndefined22(transformer, onFinally)) { + return transformExpression( + /* returnContextNode */ + node, + node.expression.expression, + transformer, + hasContinuation, + continuationArgName + ); + } + const possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); + const inlinedLeftHandSide = transformExpression( + /*returnContextNode*/ + node, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + possibleNameForVarDecl + ); + if (hasFailed()) + return silentFail(); + const inlinedCallback = transformCallbackArgument( + onFinally, + hasContinuation, + /*continuationArgName*/ + void 0, + /*inputArgName*/ + void 0, + node, + transformer + ); + if (hasFailed()) + return silentFail(); + const tryBlock = factory.createBlock(inlinedLeftHandSide); + const finallyBlock = factory.createBlock(inlinedCallback); + const tryStatement = factory.createTryStatement( + tryBlock, + /*catchClause*/ + void 0, + finallyBlock + ); + return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); + } + function transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName) { + if (!onRejected || isNullOrUndefined22(transformer, onRejected)) { + return transformExpression( + /* returnContextNode */ + node, + node.expression.expression, + transformer, + hasContinuation, + continuationArgName + ); + } + const inputArgName = getArgBindingName(onRejected, transformer); + const possibleNameForVarDecl = getPossibleNameForVarDecl(node, transformer, continuationArgName); + const inlinedLeftHandSide = transformExpression( + /*returnContextNode*/ + node, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + possibleNameForVarDecl + ); + if (hasFailed()) + return silentFail(); + const inlinedCallback = transformCallbackArgument(onRejected, hasContinuation, possibleNameForVarDecl, inputArgName, node, transformer); + if (hasFailed()) + return silentFail(); + const tryBlock = factory.createBlock(inlinedLeftHandSide); + const catchClause = factory.createCatchClause(inputArgName && getSynthesizedDeepClone(declareSynthBindingName(inputArgName)), factory.createBlock(inlinedCallback)); + const tryStatement = factory.createTryStatement( + tryBlock, + catchClause, + /*finallyBlock*/ + void 0 + ); + return finishCatchOrFinallyTransform(node, transformer, tryStatement, possibleNameForVarDecl, continuationArgName); + } + function transformThen(node, onFulfilled, onRejected, transformer, hasContinuation, continuationArgName) { + if (!onFulfilled || isNullOrUndefined22(transformer, onFulfilled)) { + return transformCatch(node, onRejected, transformer, hasContinuation, continuationArgName); + } + if (onRejected && !isNullOrUndefined22(transformer, onRejected)) { + return silentFail(); + } + const inputArgName = getArgBindingName(onFulfilled, transformer); + const inlinedLeftHandSide = transformExpression( + node.expression.expression, + node.expression.expression, + transformer, + /*hasContinuation*/ + true, + inputArgName + ); + if (hasFailed()) + return silentFail(); + const inlinedCallback = transformCallbackArgument(onFulfilled, hasContinuation, continuationArgName, inputArgName, node, transformer); + if (hasFailed()) + return silentFail(); + return concatenate(inlinedLeftHandSide, inlinedCallback); + } + function transformPromiseExpressionOfPropertyAccess(returnContextNode, node, transformer, hasContinuation, continuationArgName) { + if (shouldReturn(returnContextNode, transformer)) { + let returnValue = getSynthesizedDeepClone(node); + if (hasContinuation) { + returnValue = factory.createAwaitExpression(returnValue); + } + return [factory.createReturnStatement(returnValue)]; + } + return createVariableOrAssignmentOrExpressionStatement( + continuationArgName, + factory.createAwaitExpression(node), + /*typeAnnotation*/ + void 0 + ); + } + function createVariableOrAssignmentOrExpressionStatement(variableName, rightHandSide, typeAnnotation) { + if (!variableName || isEmptyBindingName(variableName)) { + return [factory.createExpressionStatement(rightHandSide)]; + } + if (isSynthIdentifier(variableName) && variableName.hasBeenDeclared) { + return [factory.createExpressionStatement(factory.createAssignment(getSynthesizedDeepClone(referenceSynthIdentifier(variableName)), rightHandSide))]; + } + return [ + factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + getSynthesizedDeepClone(declareSynthBindingName(variableName)), + /*exclamationToken*/ + void 0, + typeAnnotation, + rightHandSide + ) + ], + 2 + /* Const */ + ) + ) + ]; + } + function maybeAnnotateAndReturn(expressionToReturn, typeAnnotation) { + if (typeAnnotation && expressionToReturn) { + const name2 = factory.createUniqueName( + "result", + 16 + /* Optimistic */ + ); + return [ + ...createVariableOrAssignmentOrExpressionStatement(createSynthIdentifier(name2), expressionToReturn, typeAnnotation), + factory.createReturnStatement(name2) + ]; + } + return [factory.createReturnStatement(expressionToReturn)]; + } + function transformCallbackArgument(func, hasContinuation, continuationArgName, inputArgName, parent22, transformer) { + var _a2; + switch (func.kind) { + case 106: + break; + case 211: + case 80: + if (!inputArgName) { + break; + } + const synthCall = factory.createCallExpression( + getSynthesizedDeepClone(func), + /*typeArguments*/ + void 0, + isSynthIdentifier(inputArgName) ? [referenceSynthIdentifier(inputArgName)] : [] + ); + if (shouldReturn(parent22, transformer)) { + return maybeAnnotateAndReturn(synthCall, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent22, func, transformer.checker)); + } + const type3 = transformer.checker.getTypeAtLocation(func); + const callSignatures = transformer.checker.getSignaturesOfType( + type3, + 0 + /* Call */ + ); + if (!callSignatures.length) { + return silentFail(); + } + const returnType = callSignatures[0].getReturnType(); + const varDeclOrAssignment = createVariableOrAssignmentOrExpressionStatement(continuationArgName, factory.createAwaitExpression(synthCall), getExplicitPromisedTypeOfPromiseReturningCallExpression(parent22, func, transformer.checker)); + if (continuationArgName) { + continuationArgName.types.push(transformer.checker.getAwaitedType(returnType) || returnType); + } + return varDeclOrAssignment; + case 218: + case 219: { + const funcBody = func.body; + const returnType2 = (_a2 = getLastCallSignature(transformer.checker.getTypeAtLocation(func), transformer.checker)) == null ? void 0 : _a2.getReturnType(); + if (isBlock2(funcBody)) { + let refactoredStmts = []; + let seenReturnStatement = false; + for (const statement of funcBody.statements) { + if (isReturnStatement(statement)) { + seenReturnStatement = true; + if (isReturnStatementWithFixablePromiseHandler(statement, transformer.checker)) { + refactoredStmts = refactoredStmts.concat(transformReturnStatementWithFixablePromiseHandler(transformer, statement, hasContinuation, continuationArgName)); + } else { + const possiblyAwaitedRightHandSide = returnType2 && statement.expression ? getPossiblyAwaitedRightHandSide(transformer.checker, returnType2, statement.expression) : statement.expression; + refactoredStmts.push(...maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent22, func, transformer.checker))); + } + } else if (hasContinuation && forEachReturnStatement(statement, returnTrue)) { + return silentFail(); + } else { + refactoredStmts.push(statement); + } + } + return shouldReturn(parent22, transformer) ? refactoredStmts.map((s7) => getSynthesizedDeepClone(s7)) : removeReturns( + refactoredStmts, + continuationArgName, + transformer, + seenReturnStatement + ); + } else { + const inlinedStatements = isFixablePromiseHandler(funcBody, transformer.checker) ? transformReturnStatementWithFixablePromiseHandler(transformer, factory.createReturnStatement(funcBody), hasContinuation, continuationArgName) : emptyArray; + if (inlinedStatements.length > 0) { + return inlinedStatements; + } + if (returnType2) { + const possiblyAwaitedRightHandSide = getPossiblyAwaitedRightHandSide(transformer.checker, returnType2, funcBody); + if (!shouldReturn(parent22, transformer)) { + const transformedStatement = createVariableOrAssignmentOrExpressionStatement( + continuationArgName, + possiblyAwaitedRightHandSide, + /*typeAnnotation*/ + void 0 + ); + if (continuationArgName) { + continuationArgName.types.push(transformer.checker.getAwaitedType(returnType2) || returnType2); + } + return transformedStatement; + } else { + return maybeAnnotateAndReturn(possiblyAwaitedRightHandSide, getExplicitPromisedTypeOfPromiseReturningCallExpression(parent22, func, transformer.checker)); + } + } else { + return silentFail(); + } + } + } + default: + return silentFail(); + } + return emptyArray; + } + function getPossiblyAwaitedRightHandSide(checker, type3, expr) { + const rightHandSide = getSynthesizedDeepClone(expr); + return !!checker.getPromisedTypeOfPromise(type3) ? factory.createAwaitExpression(rightHandSide) : rightHandSide; + } + function getLastCallSignature(type3, checker) { + const callSignatures = checker.getSignaturesOfType( + type3, + 0 + /* Call */ + ); + return lastOrUndefined(callSignatures); + } + function removeReturns(stmts, prevArgName, transformer, seenReturnStatement) { + const ret = []; + for (const stmt of stmts) { + if (isReturnStatement(stmt)) { + if (stmt.expression) { + const possiblyAwaitedExpression = isPromiseTypedExpression(stmt.expression, transformer.checker) ? factory.createAwaitExpression(stmt.expression) : stmt.expression; + if (prevArgName === void 0) { + ret.push(factory.createExpressionStatement(possiblyAwaitedExpression)); + } else if (isSynthIdentifier(prevArgName) && prevArgName.hasBeenDeclared) { + ret.push(factory.createExpressionStatement(factory.createAssignment(referenceSynthIdentifier(prevArgName), possiblyAwaitedExpression))); + } else { + ret.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + declareSynthBindingName(prevArgName), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + possiblyAwaitedExpression + )], + 2 + /* Const */ + ) + )); + } + } + } else { + ret.push(getSynthesizedDeepClone(stmt)); + } + } + if (!seenReturnStatement && prevArgName !== void 0) { + ret.push(factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + declareSynthBindingName(prevArgName), + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createIdentifier("undefined") + )], + 2 + /* Const */ + ) + )); + } + return ret; + } + function transformReturnStatementWithFixablePromiseHandler(transformer, innerRetStmt, hasContinuation, continuationArgName) { + let innerCbBody = []; + forEachChild(innerRetStmt, function visit7(node) { + if (isCallExpression(node)) { + const temp = transformExpression(node, node, transformer, hasContinuation, continuationArgName); + innerCbBody = innerCbBody.concat(temp); + if (innerCbBody.length > 0) { + return; + } + } else if (!isFunctionLike(node)) { + forEachChild(node, visit7); + } + }); + return innerCbBody; + } + function getArgBindingName(funcNode, transformer) { + const types3 = []; + let name2; + if (isFunctionLikeDeclaration(funcNode)) { + if (funcNode.parameters.length > 0) { + const param = funcNode.parameters[0].name; + name2 = getMappedBindingNameOrDefault(param); + } + } else if (isIdentifier(funcNode)) { + name2 = getMapEntryOrDefault(funcNode); + } else if (isPropertyAccessExpression(funcNode) && isIdentifier(funcNode.name)) { + name2 = getMapEntryOrDefault(funcNode.name); + } + if (!name2 || "identifier" in name2 && name2.identifier.text === "undefined") { + return void 0; + } + return name2; + function getMappedBindingNameOrDefault(bindingName) { + if (isIdentifier(bindingName)) + return getMapEntryOrDefault(bindingName); + const elements = flatMap2(bindingName.elements, (element) => { + if (isOmittedExpression(element)) + return []; + return [getMappedBindingNameOrDefault(element.name)]; + }); + return createSynthBindingPattern(bindingName, elements); + } + function getMapEntryOrDefault(identifier) { + const originalNode = getOriginalNode2(identifier); + const symbol = getSymbol2(originalNode); + if (!symbol) { + return createSynthIdentifier(identifier, types3); + } + const mapEntry = transformer.synthNamesMap.get(getSymbolId(symbol).toString()); + return mapEntry || createSynthIdentifier(identifier, types3); + } + function getSymbol2(node) { + var _a2; + return ((_a2 = tryCast(node, canHaveSymbol)) == null ? void 0 : _a2.symbol) ?? transformer.checker.getSymbolAtLocation(node); + } + function getOriginalNode2(node) { + return node.original ? node.original : node; + } + } + function isEmptyBindingName(bindingName) { + if (!bindingName) { + return true; + } + if (isSynthIdentifier(bindingName)) { + return !bindingName.identifier.text; + } + return every2(bindingName.elements, isEmptyBindingName); + } + function createSynthIdentifier(identifier, types3 = []) { + return { kind: 0, identifier, types: types3, hasBeenDeclared: false, hasBeenReferenced: false }; + } + function createSynthBindingPattern(bindingPattern, elements = emptyArray, types3 = []) { + return { kind: 1, bindingPattern, elements, types: types3 }; + } + function referenceSynthIdentifier(synthId) { + synthId.hasBeenReferenced = true; + return synthId.identifier; + } + function declareSynthBindingName(synthName) { + return isSynthIdentifier(synthName) ? declareSynthIdentifier(synthName) : declareSynthBindingPattern(synthName); + } + function declareSynthBindingPattern(synthPattern) { + for (const element of synthPattern.elements) { + declareSynthBindingName(element); + } + return synthPattern.bindingPattern; + } + function declareSynthIdentifier(synthId) { + synthId.hasBeenDeclared = true; + return synthId.identifier; + } + function isSynthIdentifier(bindingName) { + return bindingName.kind === 0; + } + function isSynthBindingPattern(bindingName) { + return bindingName.kind === 1; + } + function shouldReturn(expression, transformer) { + return !!expression.original && transformer.setOfExpressionsToReturn.has(getNodeId(expression.original)); + } + var fixId10, errorCodes11, codeActionSucceeded; + var init_convertToAsyncFunction = __esm2({ + "src/services/codefixes/convertToAsyncFunction.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId10 = "convertToAsyncFunction"; + errorCodes11 = [Diagnostics.This_may_be_converted_to_an_async_function.code]; + codeActionSucceeded = true; + registerCodeFix({ + errorCodes: errorCodes11, + getCodeActions(context2) { + codeActionSucceeded = true; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => convertToAsyncFunction(t8, context2.sourceFile, context2.span.start, context2.program.getTypeChecker())); + return codeActionSucceeded ? [createCodeFixAction(fixId10, changes, Diagnostics.Convert_to_async_function, fixId10, Diagnostics.Convert_all_to_async_functions)] : []; + }, + fixIds: [fixId10], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes11, (changes, err) => convertToAsyncFunction(changes, err.file, err.start, context2.program.getTypeChecker())) + }); + } + }); + function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) { + var _a2; + for (const moduleSpecifier of importingFile.imports) { + const imported = (_a2 = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a2.resolvedModule; + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + const importNode = importFromModuleSpecifier(moduleSpecifier); + switch (importNode.kind) { + case 271: + changes.replaceNode(importingFile, importNode, makeImport( + importNode.name, + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + )); + break; + case 213: + if (isRequireCall( + importNode, + /*requireStringLiteralLikeArgument*/ + false + )) { + changes.replaceNode(importingFile, importNode, factory.createPropertyAccessExpression(getSynthesizedDeepClone(importNode), "default")); + } + break; + } + } + } + function convertFileToEsModule(sourceFile, checker, changes, target, quotePreference) { + const identifiers = { original: collectFreeIdentifiers(sourceFile), additional: /* @__PURE__ */ new Set() }; + const exports29 = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports29, changes); + let moduleExportsChangedToDefault = false; + let useSitesToUnqualify; + for (const statement of filter2(sourceFile.statements, isVariableStatement)) { + const newUseSites = convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); + if (newUseSites) { + copyEntries(newUseSites, useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())); + } + } + for (const statement of filter2(sourceFile.statements, (s7) => !isVariableStatement(s7))) { + const moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports29, useSitesToUnqualify, quotePreference); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + useSitesToUnqualify == null ? void 0 : useSitesToUnqualify.forEach((replacement, original) => { + changes.replaceNode(sourceFile, original, replacement); + }); + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + const res = /* @__PURE__ */ new Map(); + forEachExportReference(sourceFile, (node) => { + const { text } = node.name; + if (!res.has(text) && (isIdentifierANonContextualKeyword(node.name) || checker.resolveName( + text, + node, + 111551, + /*excludeGlobals*/ + true + ))) { + res.set(text, makeUniqueName(`_${text}`, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports29, changes) { + forEachExportReference(sourceFile, (node, isAssignmentLhs) => { + if (isAssignmentLhs) { + return; + } + const { text } = node.name; + changes.replaceNode(sourceFile, node, factory.createIdentifier(exports29.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (isPropertyAccessExpression(node) && isExportsOrModuleExportsOrAlias(sourceFile, node.expression) && isIdentifier(node.name)) { + const { parent: parent22 } = node; + cb( + node, + isBinaryExpression(parent22) && parent22.left === node && parent22.operatorToken.kind === 64 + /* EqualsToken */ + ); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports29, useSitesToUnqualify, quotePreference) { + switch (statement.kind) { + case 243: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference); + return false; + case 244: { + const { expression } = statement; + switch (expression.kind) { + case 213: { + if (isRequireCall( + expression, + /*requireStringLiteralLikeArgument*/ + true + )) { + changes.replaceNode(sourceFile, statement, makeImport( + /*defaultImport*/ + void 0, + /*namedImports*/ + void 0, + expression.arguments[0], + quotePreference + )); + } + return false; + } + case 226: { + const { operatorToken } = expression; + return operatorToken.kind === 64 && convertAssignment(sourceFile, checker, expression, changes, exports29, useSitesToUnqualify); + } + } + } + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target, quotePreference) { + const { declarationList } = statement; + let foundImport = false; + const converted = map4(declarationList.declarations, (decl) => { + const { name: name2, initializer } = decl; + if (initializer) { + if (isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + foundImport = true; + return convertedImports([]); + } else if (isRequireCall( + initializer, + /*requireStringLiteralLikeArgument*/ + true + )) { + foundImport = true; + return convertSingleImport(name2, initializer.arguments[0], checker, identifiers, target, quotePreference); + } else if (isPropertyAccessExpression(initializer) && isRequireCall( + initializer.expression, + /*requireStringLiteralLikeArgument*/ + true + )) { + foundImport = true; + return convertPropertyAccessImport(name2, initializer.name.text, initializer.expression.arguments[0], identifiers, quotePreference); + } + } + return convertedImports([factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList([decl], declarationList.flags) + )]); + }); + if (foundImport) { + changes.replaceNodeWithNodes(sourceFile, statement, flatMap2(converted, (c7) => c7.newImports)); + let combinedUseSites; + forEach4(converted, (c7) => { + if (c7.useSitesToUnqualify) { + copyEntries(c7.useSitesToUnqualify, combinedUseSites ?? (combinedUseSites = /* @__PURE__ */ new Map())); + } + }); + return combinedUseSites; + } + } + function convertPropertyAccessImport(name2, propertyName, moduleSpecifier, identifiers, quotePreference) { + switch (name2.kind) { + case 206: + case 207: { + const tmp = makeUniqueName(propertyName, identifiers); + return convertedImports([ + makeSingleImport(tmp, propertyName, moduleSpecifier, quotePreference), + makeConst( + /*modifiers*/ + void 0, + name2, + factory.createIdentifier(tmp) + ) + ]); + } + case 80: + return convertedImports([makeSingleImport(name2.text, propertyName, moduleSpecifier, quotePreference)]); + default: + return Debug.assertNever(name2, `Convert to ES module got invalid syntax form ${name2.kind}`); + } + } + function convertAssignment(sourceFile, checker, assignment, changes, exports29, useSitesToUnqualify) { + const { left, right } = assignment; + if (!isPropertyAccessExpression(left)) { + return false; + } + if (isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (isExportsOrModuleExportsOrAlias(sourceFile, right)) { + changes.delete(sourceFile, assignment.parent); + } else { + const replacement = isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right, useSitesToUnqualify) : isRequireCall( + right, + /*requireStringLiteralLikeArgument*/ + true + ) ? convertReExportAll(right.arguments[0], checker) : void 0; + if (replacement) { + changes.replaceNodeWithNodes(sourceFile, assignment.parent, replacement[0]); + return replacement[1]; + } else { + changes.replaceRangeWithText(sourceFile, createRange2(left.getStart(sourceFile), right.pos), "export default"); + return true; + } + } + } else if (isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, assignment, changes, exports29); + } + return false; + } + function tryChangeModuleExportsObject(object, useSitesToUnqualify) { + const statements = mapAllOrFail(object.properties, (prop) => { + switch (prop.kind) { + case 177: + case 178: + case 304: + case 305: + return void 0; + case 303: + return !isIdentifier(prop.name) ? void 0 : convertExportsDotXEquals_replaceNode(prop.name.text, prop.initializer, useSitesToUnqualify); + case 174: + return !isIdentifier(prop.name) ? void 0 : functionExpressionToDeclaration(prop.name.text, [factory.createToken( + 95 + /* ExportKeyword */ + )], prop, useSitesToUnqualify); + default: + Debug.assertNever(prop, `Convert to ES6 got invalid prop kind ${prop.kind}`); + } + }); + return statements && [statements, false]; + } + function convertNamedExport(sourceFile, assignment, changes, exports29) { + const { text } = assignment.left.name; + const rename2 = exports29.get(text); + if (rename2 !== void 0) { + const newNodes = [ + makeConst( + /*modifiers*/ + void 0, + rename2, + assignment.right + ), + makeExportDeclaration([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + rename2, + text + )]) + ]; + changes.replaceNodeWithNodes(sourceFile, assignment.parent, newNodes); + } else { + convertExportsPropertyAssignment(assignment, sourceFile, changes); + } + } + function convertReExportAll(reExported, checker) { + const moduleSpecifier = reExported.text; + const moduleSymbol = checker.getSymbolAtLocation(reExported); + const exports29 = moduleSymbol ? moduleSymbol.exports : emptyMap; + return exports29.has( + "export=" + /* ExportEquals */ + ) ? [[reExportDefault(moduleSpecifier)], true] : !exports29.has( + "default" + /* Default */ + ) ? [[reExportStar(moduleSpecifier)], false] : ( + // If there's some non-default export, must include both `export *` and `export default`. + exports29.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true] + ); + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration( + /*exportSpecifiers*/ + void 0, + moduleSpecifier + ); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([factory.createExportSpecifier( + /*isTypeOnly*/ + false, + /*propertyName*/ + void 0, + "default" + )], moduleSpecifier); + } + function convertExportsPropertyAssignment({ left, right, parent: parent22 }, sourceFile, changes) { + const name2 = left.name.text; + if ((isFunctionExpression(right) || isArrowFunction(right) || isClassExpression(right)) && (!right.name || right.name.text === name2)) { + changes.replaceRange(sourceFile, { pos: left.getStart(sourceFile), end: right.getStart(sourceFile) }, factory.createToken( + 95 + /* ExportKeyword */ + ), { suffix: " " }); + if (!right.name) + changes.insertName(sourceFile, right, name2); + const semi = findChildOfKind(parent22, 27, sourceFile); + if (semi) + changes.delete(sourceFile, semi); + } else { + changes.replaceNodeRangeWithNodes(sourceFile, left.expression, findChildOfKind(left, 25, sourceFile), [factory.createToken( + 95 + /* ExportKeyword */ + ), factory.createToken( + 87 + /* ConstKeyword */ + )], { joiner: " ", suffix: " " }); + } + } + function convertExportsDotXEquals_replaceNode(name2, exported, useSitesToUnqualify) { + const modifiers = [factory.createToken( + 95 + /* ExportKeyword */ + )]; + switch (exported.kind) { + case 218: { + const { name: expressionName } = exported; + if (expressionName && expressionName.text !== name2) { + return exportConst(); + } + } + case 219: + return functionExpressionToDeclaration(name2, modifiers, exported, useSitesToUnqualify); + case 231: + return classExpressionToDeclaration(name2, modifiers, exported, useSitesToUnqualify); + default: + return exportConst(); + } + function exportConst() { + return makeConst(modifiers, factory.createIdentifier(name2), replaceImportUseSites(exported, useSitesToUnqualify)); + } + } + function replaceImportUseSites(nodeOrNodes, useSitesToUnqualify) { + if (!useSitesToUnqualify || !some2(arrayFrom(useSitesToUnqualify.keys()), (original) => rangeContainsRange(nodeOrNodes, original))) { + return nodeOrNodes; + } + return isArray3(nodeOrNodes) ? getSynthesizedDeepClonesWithReplacements( + nodeOrNodes, + /*includeTrivia*/ + true, + replaceNode2 + ) : getSynthesizedDeepCloneWithReplacements( + nodeOrNodes, + /*includeTrivia*/ + true, + replaceNode2 + ); + function replaceNode2(original) { + if (original.kind === 211) { + const replacement = useSitesToUnqualify.get(original); + useSitesToUnqualify.delete(original); + return replacement; + } + } + } + function convertSingleImport(name2, moduleSpecifier, checker, identifiers, target, quotePreference) { + switch (name2.kind) { + case 206: { + const importSpecifiers = mapAllOrFail(name2.elements, (e10) => e10.dotDotDotToken || e10.initializer || e10.propertyName && !isIdentifier(e10.propertyName) || !isIdentifier(e10.name) ? void 0 : makeImportSpecifier2(e10.propertyName && e10.propertyName.text, e10.name.text)); + if (importSpecifiers) { + return convertedImports([makeImport( + /*defaultImport*/ + void 0, + importSpecifiers, + moduleSpecifier, + quotePreference + )]); + } + } + case 207: { + const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier.text, target), identifiers); + return convertedImports([ + makeImport( + factory.createIdentifier(tmp), + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + ), + makeConst( + /*modifiers*/ + void 0, + getSynthesizedDeepClone(name2), + factory.createIdentifier(tmp) + ) + ]); + } + case 80: + return convertSingleIdentifierImport(name2, moduleSpecifier, checker, identifiers, quotePreference); + default: + return Debug.assertNever(name2, `Convert to ES module got invalid name kind ${name2.kind}`); + } + } + function convertSingleIdentifierImport(name2, moduleSpecifier, checker, identifiers, quotePreference) { + const nameSymbol = checker.getSymbolAtLocation(name2); + const namedBindingsNames = /* @__PURE__ */ new Map(); + let needDefaultImport = false; + let useSitesToUnqualify; + for (const use of identifiers.original.get(name2.text)) { + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name2) { + continue; + } + const { parent: parent22 } = use; + if (isPropertyAccessExpression(parent22)) { + const { name: { text: propertyName } } = parent22; + if (propertyName === "default") { + needDefaultImport = true; + const importDefaultName = use.getText(); + (useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())).set(parent22, factory.createIdentifier(importDefaultName)); + } else { + Debug.assert(parent22.expression === use, "Didn't expect expression === use"); + let idName = namedBindingsNames.get(propertyName); + if (idName === void 0) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + (useSitesToUnqualify ?? (useSitesToUnqualify = /* @__PURE__ */ new Map())).set(parent22, factory.createIdentifier(idName)); + } + } else { + needDefaultImport = true; + } + } + const namedBindings = namedBindingsNames.size === 0 ? void 0 : arrayFrom(mapIterator(namedBindingsNames.entries(), ([propertyName, idName]) => factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName === idName ? void 0 : factory.createIdentifier(propertyName), + factory.createIdentifier(idName) + ))); + if (!namedBindings) { + needDefaultImport = true; + } + return convertedImports( + [makeImport(needDefaultImport ? getSynthesizedDeepClone(name2) : void 0, namedBindings, moduleSpecifier, quotePreference)], + useSitesToUnqualify + ); + } + function makeUniqueName(name2, identifiers) { + while (identifiers.original.has(name2) || identifiers.additional.has(name2)) { + name2 = `_${name2}`; + } + identifiers.additional.add(name2); + return name2; + } + function collectFreeIdentifiers(file) { + const map22 = createMultiMap(); + forEachFreeIdentifier(file, (id) => map22.add(id.text, id)); + return map22; + } + function forEachFreeIdentifier(node, cb) { + if (isIdentifier(node) && isFreeIdentifier(node)) + cb(node); + node.forEachChild((child) => forEachFreeIdentifier(child, cb)); + } + function isFreeIdentifier(node) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 211: + return parent22.name !== node; + case 208: + return parent22.propertyName !== node; + case 276: + return parent22.propertyName !== node; + default: + return true; + } + } + function functionExpressionToDeclaration(name2, additionalModifiers, fn, useSitesToUnqualify) { + return factory.createFunctionDeclaration( + concatenate(additionalModifiers, getSynthesizedDeepClones(fn.modifiers)), + getSynthesizedDeepClone(fn.asteriskToken), + name2, + getSynthesizedDeepClones(fn.typeParameters), + getSynthesizedDeepClones(fn.parameters), + getSynthesizedDeepClone(fn.type), + factory.converters.convertToFunctionBlock(replaceImportUseSites(fn.body, useSitesToUnqualify)) + ); + } + function classExpressionToDeclaration(name2, additionalModifiers, cls, useSitesToUnqualify) { + return factory.createClassDeclaration( + concatenate(additionalModifiers, getSynthesizedDeepClones(cls.modifiers)), + name2, + getSynthesizedDeepClones(cls.typeParameters), + getSynthesizedDeepClones(cls.heritageClauses), + replaceImportUseSites(cls.members, useSitesToUnqualify) + ); + } + function makeSingleImport(localName, propertyName, moduleSpecifier, quotePreference) { + return propertyName === "default" ? makeImport( + factory.createIdentifier(localName), + /*namedImports*/ + void 0, + moduleSpecifier, + quotePreference + ) : makeImport( + /*defaultImport*/ + void 0, + [makeImportSpecifier2(propertyName, localName)], + moduleSpecifier, + quotePreference + ); + } + function makeImportSpecifier2(propertyName, name2) { + return factory.createImportSpecifier( + /*isTypeOnly*/ + false, + propertyName !== void 0 && propertyName !== name2 ? factory.createIdentifier(propertyName) : void 0, + factory.createIdentifier(name2) + ); + } + function makeConst(modifiers, name2, init2) { + return factory.createVariableStatement( + modifiers, + factory.createVariableDeclarationList( + [factory.createVariableDeclaration( + name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + init2 + )], + 2 + /* Const */ + ) + ); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + exportSpecifiers && factory.createNamedExports(exportSpecifiers), + moduleSpecifier === void 0 ? void 0 : factory.createStringLiteral(moduleSpecifier) + ); + } + function convertedImports(newImports, useSitesToUnqualify) { + return { + newImports, + useSitesToUnqualify + }; + } + var init_convertToEsModule = __esm2({ + "src/services/codefixes/convertToEsModule.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + registerCodeFix({ + errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code], + getCodeActions(context2) { + const { sourceFile, program, preferences } = context2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changes2) => { + const moduleExportsChangedToDefault = convertFileToEsModule(sourceFile, program.getTypeChecker(), changes2, getEmitScriptTarget(program.getCompilerOptions()), getQuotePreference(sourceFile, preferences)); + if (moduleExportsChangedToDefault) { + for (const importingFile of program.getSourceFiles()) { + fixImportOfModuleExports(importingFile, sourceFile, program, changes2, getQuotePreference(importingFile, preferences)); + } + } + }); + return [createCodeFixActionWithoutFixAll("convertToEsModule", changes, Diagnostics.Convert_to_ES_module)]; + } + }); + } + }); + function getQualifiedName(sourceFile, pos) { + const qualifiedName = findAncestor(getTokenAtPosition(sourceFile, pos), isQualifiedName); + Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return isIdentifier(qualifiedName.left) ? qualifiedName : void 0; + } + function doChange10(changeTracker, sourceFile, qualifiedName) { + const rightText = qualifiedName.right.text; + const replacement = factory.createIndexedAccessTypeNode( + factory.createTypeReferenceNode( + qualifiedName.left, + /*typeArguments*/ + void 0 + ), + factory.createLiteralTypeNode(factory.createStringLiteral(rightText)) + ); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } + var fixId11, errorCodes12; + var init_correctQualifiedNameToIndexedAccessType = __esm2({ + "src/services/codefixes/correctQualifiedNameToIndexedAccessType.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId11 = "correctQualifiedNameToIndexedAccessType"; + errorCodes12 = [Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; + registerCodeFix({ + errorCodes: errorCodes12, + getCodeActions(context2) { + const qualifiedName = getQualifiedName(context2.sourceFile, context2.span.start); + if (!qualifiedName) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange10(t8, context2.sourceFile, qualifiedName)); + const newText = `${qualifiedName.left.text}["${qualifiedName.right.text}"]`; + return [createCodeFixAction(fixId11, changes, [Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId11, Diagnostics.Rewrite_all_as_indexed_access_types)]; + }, + fixIds: [fixId11], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes12, (changes, diag2) => { + const q5 = getQualifiedName(diag2.file, diag2.start); + if (q5) { + doChange10(changes, diag2.file, q5); + } + }) + }); + } + }); + function getExportSpecifierForDiagnosticSpan(span, sourceFile) { + return tryCast(getTokenAtPosition(sourceFile, span.start).parent, isExportSpecifier); + } + function fixSingleExportDeclaration(changes, exportSpecifier, context2) { + if (!exportSpecifier) { + return; + } + const exportClause = exportSpecifier.parent; + const exportDeclaration = exportClause.parent; + const typeExportSpecifiers = getTypeExportSpecifiers(exportSpecifier, context2); + if (typeExportSpecifiers.length === exportClause.elements.length) { + changes.insertModifierBefore(context2.sourceFile, 156, exportClause); + } else { + const valueExportDeclaration = factory.updateExportDeclaration( + exportDeclaration, + exportDeclaration.modifiers, + /*isTypeOnly*/ + false, + factory.updateNamedExports(exportClause, filter2(exportClause.elements, (e10) => !contains2(typeExportSpecifiers, e10))), + exportDeclaration.moduleSpecifier, + /*attributes*/ + void 0 + ); + const typeExportDeclaration = factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + true, + factory.createNamedExports(typeExportSpecifiers), + exportDeclaration.moduleSpecifier, + /*attributes*/ + void 0 + ); + changes.replaceNode(context2.sourceFile, exportDeclaration, valueExportDeclaration, { + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude + }); + changes.insertNodeAfter(context2.sourceFile, exportDeclaration, typeExportDeclaration); + } + } + function getTypeExportSpecifiers(originExportSpecifier, context2) { + const exportClause = originExportSpecifier.parent; + if (exportClause.elements.length === 1) { + return exportClause.elements; + } + const diagnostics = getDiagnosticsWithinSpan( + createTextSpanFromNode(exportClause), + context2.program.getSemanticDiagnostics(context2.sourceFile, context2.cancellationToken) + ); + return filter2(exportClause.elements, (element) => { + var _a2; + return element === originExportSpecifier || ((_a2 = findDiagnosticForNode(element, diagnostics)) == null ? void 0 : _a2.code) === errorCodes13[0]; + }); + } + var errorCodes13, fixId12; + var init_convertToTypeOnlyExport = __esm2({ + "src/services/codefixes/convertToTypeOnlyExport.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes13 = [Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code]; + fixId12 = "convertToTypeOnlyExport"; + registerCodeFix({ + errorCodes: errorCodes13, + getCodeActions: function getCodeActionsToConvertToTypeOnlyExport(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => fixSingleExportDeclaration(t8, getExportSpecifierForDiagnosticSpan(context2.span, context2.sourceFile), context2)); + if (changes.length) { + return [createCodeFixAction(fixId12, changes, Diagnostics.Convert_to_type_only_export, fixId12, Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]; + } + }, + fixIds: [fixId12], + getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context2) { + const fixedExportDeclarations = /* @__PURE__ */ new Map(); + return codeFixAll(context2, errorCodes13, (changes, diag2) => { + const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag2, context2.sourceFile); + if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) { + fixSingleExportDeclaration(changes, exportSpecifier, context2); + } + }); + } + }); + } + }); + function getDeclaration2(sourceFile, pos) { + const { parent: parent22 } = getTokenAtPosition(sourceFile, pos); + return isImportSpecifier(parent22) || isImportDeclaration(parent22) && parent22.importClause ? parent22 : void 0; + } + function canConvertImportDeclarationForSpecifier(specifier, sourceFile, program) { + if (specifier.parent.parent.name) { + return false; + } + const nonTypeOnlySpecifiers = specifier.parent.elements.filter((e10) => !e10.isTypeOnly); + if (nonTypeOnlySpecifiers.length === 1) { + return true; + } + const checker = program.getTypeChecker(); + for (const specifier2 of nonTypeOnlySpecifiers) { + const isUsedAsValue = ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(specifier2.name, checker, sourceFile, (usage) => { + return !isValidTypeOnlyAliasUseSite(usage); + }); + if (isUsedAsValue) { + return false; + } + } + return true; + } + function doChange11(changes, sourceFile, declaration) { + var _a2; + if (isImportSpecifier(declaration)) { + changes.replaceNode(sourceFile, declaration, factory.updateImportSpecifier( + declaration, + /*isTypeOnly*/ + true, + declaration.propertyName, + declaration.name + )); + } else { + const importClause = declaration.importClause; + if (importClause.name && importClause.namedBindings) { + changes.replaceNodeWithNodes(sourceFile, declaration, [ + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + getSynthesizedDeepClone( + importClause.name, + /*includeTrivia*/ + true + ), + /*namedBindings*/ + void 0 + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.attributes, + /*includeTrivia*/ + true + ) + ), + factory.createImportDeclaration( + getSynthesizedDeepClones( + declaration.modifiers, + /*includeTrivia*/ + true + ), + factory.createImportClause( + /*isTypeOnly*/ + true, + /*name*/ + void 0, + getSynthesizedDeepClone( + importClause.namedBindings, + /*includeTrivia*/ + true + ) + ), + getSynthesizedDeepClone( + declaration.moduleSpecifier, + /*includeTrivia*/ + true + ), + getSynthesizedDeepClone( + declaration.attributes, + /*includeTrivia*/ + true + ) + ) + ]); + } else { + const newNamedBindings = ((_a2 = importClause.namedBindings) == null ? void 0 : _a2.kind) === 275 ? factory.updateNamedImports( + importClause.namedBindings, + sameMap(importClause.namedBindings.elements, (e10) => factory.updateImportSpecifier( + e10, + /*isTypeOnly*/ + false, + e10.propertyName, + e10.name + )) + ) : importClause.namedBindings; + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause( + importClause, + /*isTypeOnly*/ + true, + importClause.name, + newNamedBindings + ), declaration.moduleSpecifier, declaration.attributes); + changes.replaceNode(sourceFile, declaration, importDeclaration); + } + } + } + var errorCodes14, fixId13; + var init_convertToTypeOnlyImport = __esm2({ + "src/services/codefixes/convertToTypeOnlyImport.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes14 = [ + Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code, + Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code, + Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code + ]; + fixId13 = "convertToTypeOnlyImport"; + registerCodeFix({ + errorCodes: errorCodes14, + getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context2) { + var _a2; + const declaration = getDeclaration2(context2.sourceFile, context2.span.start); + if (declaration) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange11(t8, context2.sourceFile, declaration)); + const importDeclarationChanges = declaration.kind === 276 && canConvertImportDeclarationForSpecifier(declaration, context2.sourceFile, context2.program) ? ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange11(t8, context2.sourceFile, declaration.parent.parent.parent)) : void 0; + const mainAction = createCodeFixAction( + fixId13, + changes, + declaration.kind === 276 ? [Diagnostics.Use_type_0, ((_a2 = declaration.propertyName) == null ? void 0 : _a2.text) ?? declaration.name.text] : Diagnostics.Use_import_type, + fixId13, + Diagnostics.Fix_all_with_type_only_imports + ); + if (some2(importDeclarationChanges)) { + return [ + createCodeFixActionWithoutFixAll(fixId13, importDeclarationChanges, Diagnostics.Use_import_type), + mainAction + ]; + } + return [mainAction]; + } + return void 0; + }, + fixIds: [fixId13], + getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context2) { + const fixedImportDeclarations = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes14, (changes, diag2) => { + const errorDeclaration = getDeclaration2(diag2.file, diag2.start); + if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 && !fixedImportDeclarations.has(errorDeclaration)) { + doChange11(changes, diag2.file, errorDeclaration); + fixedImportDeclarations.add(errorDeclaration); + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context2.program)) { + doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent); + fixedImportDeclarations.add(errorDeclaration.parent.parent.parent); + } else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276) { + doChange11(changes, diag2.file, errorDeclaration); + } + }); + } + }); + } + }); + function doChange12(changes, node, sourceFile, newLine, fixAll = false) { + if (!isJSDocTypedefTag(node)) + return; + const declaration = createDeclaration(node); + if (!declaration) + return; + const commentNode = node.parent; + const { leftSibling, rightSibling } = getLeftAndRightSiblings(node); + let pos = commentNode.getStart(); + let prefix = ""; + if (!leftSibling && commentNode.comment) { + pos = findEndOfTextBetween(commentNode, commentNode.getStart(), node.getStart()); + prefix = `${newLine} */${newLine}`; + } + if (leftSibling) { + if (fixAll && isJSDocTypedefTag(leftSibling)) { + pos = node.getStart(); + prefix = ""; + } else { + pos = findEndOfTextBetween(commentNode, leftSibling.getStart(), node.getStart()); + prefix = `${newLine} */${newLine}`; + } + } + let end = commentNode.getEnd(); + let suffix = ""; + if (rightSibling) { + if (fixAll && isJSDocTypedefTag(rightSibling)) { + end = rightSibling.getStart(); + suffix = `${newLine}${newLine}`; + } else { + end = rightSibling.getStart(); + suffix = `${newLine}/**${newLine} * `; + } + } + changes.replaceRange(sourceFile, { pos, end }, declaration, { prefix, suffix }); + } + function getLeftAndRightSiblings(typedefNode) { + const commentNode = typedefNode.parent; + const maxChildIndex = commentNode.getChildCount() - 1; + const currentNodeIndex = commentNode.getChildren().findIndex( + (n7) => n7.getStart() === typedefNode.getStart() && n7.getEnd() === typedefNode.getEnd() + ); + const leftSibling = currentNodeIndex > 0 ? commentNode.getChildAt(currentNodeIndex - 1) : void 0; + const rightSibling = currentNodeIndex < maxChildIndex ? commentNode.getChildAt(currentNodeIndex + 1) : void 0; + return { leftSibling, rightSibling }; + } + function findEndOfTextBetween(jsDocComment, from, to) { + const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart()); + for (let i7 = comment.length; i7 > 0; i7--) { + if (!/[*/\s]/g.test(comment.substring(i7 - 1, i7))) { + return from + i7; + } + } + return to; + } + function createDeclaration(tag) { + var _a2; + const { typeExpression } = tag; + if (!typeExpression) + return; + const typeName = (_a2 = tag.name) == null ? void 0 : _a2.getText(); + if (!typeName) + return; + if (typeExpression.kind === 329) { + return createInterfaceForTypeLiteral(typeName, typeExpression); + } + if (typeExpression.kind === 316) { + return createTypeAliasForTypeExpression(typeName, typeExpression); + } + } + function createInterfaceForTypeLiteral(typeName, typeLiteral) { + const propertySignatures = createSignatureFromTypeLiteral(typeLiteral); + if (!some2(propertySignatures)) + return; + return factory.createInterfaceDeclaration( + /*modifiers*/ + void 0, + typeName, + /*typeParameters*/ + void 0, + /*heritageClauses*/ + void 0, + propertySignatures + ); + } + function createTypeAliasForTypeExpression(typeName, typeExpression) { + const typeReference = getSynthesizedDeepClone(typeExpression.type); + if (!typeReference) + return; + return factory.createTypeAliasDeclaration( + /*modifiers*/ + void 0, + factory.createIdentifier(typeName), + /*typeParameters*/ + void 0, + typeReference + ); + } + function createSignatureFromTypeLiteral(typeLiteral) { + const propertyTags = typeLiteral.jsDocPropertyTags; + if (!some2(propertyTags)) + return; + const getSignature = (tag) => { + var _a2; + const name2 = getPropertyName(tag); + const type3 = (_a2 = tag.typeExpression) == null ? void 0 : _a2.type; + const isOptional2 = tag.isBracketed; + let typeReference; + if (type3 && isJSDocTypeLiteral(type3)) { + const signatures = createSignatureFromTypeLiteral(type3); + typeReference = factory.createTypeLiteralNode(signatures); + } else if (type3) { + typeReference = getSynthesizedDeepClone(type3); + } + if (typeReference && name2) { + const questionToken = isOptional2 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0; + return factory.createPropertySignature( + /*modifiers*/ + void 0, + name2, + questionToken, + typeReference + ); + } + }; + return mapDefined(propertyTags, getSignature); + } + function getPropertyName(tag) { + return tag.name.kind === 80 ? tag.name.text : tag.name.right.text; + } + function getJSDocTypedefNodes(node) { + if (hasJSDocNodes(node)) { + return flatMap2(node.jsDoc, (doc) => { + var _a2; + return (_a2 = doc.tags) == null ? void 0 : _a2.filter((tag) => isJSDocTypedefTag(tag)); + }); + } + return []; + } + var fixId14, errorCodes15; + var init_convertTypedefToType = __esm2({ + "src/services/codefixes/convertTypedefToType.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId14 = "convertTypedefToType"; + errorCodes15 = [Diagnostics.JSDoc_typedef_may_be_converted_to_TypeScript_type.code]; + registerCodeFix({ + fixIds: [fixId14], + errorCodes: errorCodes15, + getCodeActions(context2) { + const newLineCharacter = getNewLineOrDefaultFromHost(context2.host, context2.formatContext.options); + const node = getTokenAtPosition( + context2.sourceFile, + context2.span.start + ); + if (!node) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange12(t8, node, context2.sourceFile, newLineCharacter)); + if (changes.length > 0) { + return [ + createCodeFixAction( + fixId14, + changes, + Diagnostics.Convert_typedef_to_TypeScript_type, + fixId14, + Diagnostics.Convert_all_typedef_to_TypeScript_types + ) + ]; + } + }, + getAllCodeActions: (context2) => codeFixAll( + context2, + errorCodes15, + (changes, diag2) => { + const newLineCharacter = getNewLineOrDefaultFromHost(context2.host, context2.formatContext.options); + const node = getTokenAtPosition(diag2.file, diag2.start); + const fixAll = true; + if (node) + doChange12(changes, node, diag2.file, newLineCharacter, fixAll); + } + ) + }); + } + }); + function getInfo5(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + if (isIdentifier(token)) { + const propertySignature = cast(token.parent.parent, isPropertySignature); + const propertyName = token.getText(sourceFile); + return { + container: cast(propertySignature.parent, isTypeLiteralNode), + typeNode: propertySignature.type, + constraint: propertyName, + name: propertyName === "K" ? "P" : "K" + }; + } + return void 0; + } + function doChange13(changes, sourceFile, { container, typeNode, constraint, name: name2 }) { + changes.replaceNode( + sourceFile, + container, + factory.createMappedTypeNode( + /*readonlyToken*/ + void 0, + factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + name2, + factory.createTypeReferenceNode(constraint) + ), + /*nameType*/ + void 0, + /*questionToken*/ + void 0, + typeNode, + /*members*/ + void 0 + ) + ); + } + var fixId15, errorCodes16; + var init_convertLiteralTypeToMappedType = __esm2({ + "src/services/codefixes/convertLiteralTypeToMappedType.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId15 = "convertLiteralTypeToMappedType"; + errorCodes16 = [Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code]; + registerCodeFix({ + errorCodes: errorCodes16, + getCodeActions: function getCodeActionsToConvertLiteralTypeToMappedType(context2) { + const { sourceFile, span } = context2; + const info2 = getInfo5(sourceFile, span.start); + if (!info2) { + return void 0; + } + const { name: name2, constraint } = info2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange13(t8, sourceFile, info2)); + return [createCodeFixAction(fixId15, changes, [Diagnostics.Convert_0_to_1_in_0, constraint, name2], fixId15, Diagnostics.Convert_all_type_literals_to_mapped_type)]; + }, + fixIds: [fixId15], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes16, (changes, diag2) => { + const info2 = getInfo5(diag2.file, diag2.start); + if (info2) { + doChange13(changes, diag2.file, info2); + } + }) + }); + } + }); + function getClass(sourceFile, pos) { + return Debug.checkDefined(getContainingClass(getTokenAtPosition(sourceFile, pos)), "There should be a containing class"); + } + function symbolPointsToNonPrivateMember(symbol) { + return !symbol.valueDeclaration || !(getEffectiveModifierFlags(symbol.valueDeclaration) & 2); + } + function addMissingDeclarations(context2, implementedTypeNode, sourceFile, classDeclaration, changeTracker, preferences) { + const checker = context2.program.getTypeChecker(); + const maybeHeritageClauseSymbol = getHeritageClauseSymbolTable(classDeclaration, checker); + const implementedType = checker.getTypeAtLocation(implementedTypeNode); + const implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + const nonPrivateAndNotExistedInHeritageClauseMembers = implementedTypeSymbols.filter(and(symbolPointsToNonPrivateMember, (symbol) => !maybeHeritageClauseSymbol.has(symbol.escapedName))); + const classType = checker.getTypeAtLocation(classDeclaration); + const constructor = find2(classDeclaration.members, (m7) => isConstructorDeclaration(m7)); + if (!classType.getNumberIndexType()) { + createMissingIndexSignatureDeclaration( + implementedType, + 1 + /* Number */ + ); + } + if (!classType.getStringIndexType()) { + createMissingIndexSignatureDeclaration( + implementedType, + 0 + /* String */ + ); + } + const importAdder = createImportAdder(sourceFile, context2.program, preferences, context2.host); + createMissingMemberNodes(classDeclaration, nonPrivateAndNotExistedInHeritageClauseMembers, sourceFile, context2, preferences, importAdder, (member) => insertInterfaceMemberNode(sourceFile, classDeclaration, member)); + importAdder.writeFixes(changeTracker); + function createMissingIndexSignatureDeclaration(type3, kind) { + const indexInfoOfKind = checker.getIndexInfoOfType(type3, kind); + if (indexInfoOfKind) { + insertInterfaceMemberNode(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration( + indexInfoOfKind, + classDeclaration, + /*flags*/ + void 0, + getNoopSymbolTrackerWithResolver(context2) + )); + } + } + function insertInterfaceMemberNode(sourceFile2, cls, newElement) { + if (constructor) { + changeTracker.insertNodeAfter(sourceFile2, constructor, newElement); + } else { + changeTracker.insertMemberAtStart(sourceFile2, cls, newElement); + } + } + } + function getHeritageClauseSymbolTable(classDeclaration, checker) { + const heritageClauseNode = getEffectiveBaseTypeNode(classDeclaration); + if (!heritageClauseNode) + return createSymbolTable(); + const heritageClauseType = checker.getTypeAtLocation(heritageClauseNode); + const heritageClauseTypeSymbols = checker.getPropertiesOfType(heritageClauseType); + return createSymbolTable(heritageClauseTypeSymbols.filter(symbolPointsToNonPrivateMember)); + } + var errorCodes17, fixId16; + var init_fixClassIncorrectlyImplementsInterface = __esm2({ + "src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes17 = [ + Diagnostics.Class_0_incorrectly_implements_interface_1.code, + Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code + ]; + fixId16 = "fixClassIncorrectlyImplementsInterface"; + registerCodeFix({ + errorCodes: errorCodes17, + getCodeActions(context2) { + const { sourceFile, span } = context2; + const classDeclaration = getClass(sourceFile, span.start); + return mapDefined(getEffectiveImplementsTypeNodes(classDeclaration), (implementedTypeNode) => { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMissingDeclarations(context2, implementedTypeNode, sourceFile, classDeclaration, t8, context2.preferences)); + return changes.length === 0 ? void 0 : createCodeFixAction(fixId16, changes, [Diagnostics.Implement_interface_0, implementedTypeNode.getText(sourceFile)], fixId16, Diagnostics.Implement_all_unimplemented_interfaces); + }); + }, + fixIds: [fixId16], + getAllCodeActions(context2) { + const seenClassDeclarations = /* @__PURE__ */ new Map(); + return codeFixAll(context2, errorCodes17, (changes, diag2) => { + const classDeclaration = getClass(diag2.file, diag2.start); + if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { + for (const implementedTypeNode of getEffectiveImplementsTypeNodes(classDeclaration)) { + addMissingDeclarations(context2, implementedTypeNode, diag2.file, classDeclaration, changes, context2.preferences); + } + } + }); + } + }); + } + }); + function createImportAdder(sourceFile, program, preferences, host, cancellationToken) { + return createImportAdderWorker( + sourceFile, + program, + /*useAutoImportProvider*/ + false, + preferences, + host, + cancellationToken + ); + } + function createImportAdderWorker(sourceFile, program, useAutoImportProvider, preferences, host, cancellationToken) { + const compilerOptions = program.getCompilerOptions(); + const addToNamespace = []; + const importType = []; + const addToExisting = /* @__PURE__ */ new Map(); + const newImports = /* @__PURE__ */ new Map(); + return { addImportFromDiagnostic, addImportFromExportedSymbol, writeFixes, hasFixes }; + function addImportFromDiagnostic(diagnostic, context2) { + const info2 = getFixInfos(context2, diagnostic.code, diagnostic.start, useAutoImportProvider); + if (!info2 || !info2.length) + return; + addImport(first(info2)); + } + function addImportFromExportedSymbol(exportedSymbol, isValidTypeOnlyUseSite) { + const moduleSymbol = Debug.checkDefined(exportedSymbol.parent); + const symbolName2 = getNameForExportedSymbol(exportedSymbol, getEmitScriptTarget(compilerOptions)); + const checker = program.getTypeChecker(); + const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker)); + const exportInfo = getAllExportInfoForSymbol( + sourceFile, + symbol, + symbolName2, + moduleSymbol, + /*preferCapitalized*/ + false, + program, + host, + preferences, + cancellationToken + ); + const useRequire = shouldUseRequire(sourceFile, program); + const fix = getImportFixForSymbol( + sourceFile, + Debug.checkDefined(exportInfo), + program, + /*position*/ + void 0, + !!isValidTypeOnlyUseSite, + useRequire, + host, + preferences + ); + if (fix) { + addImport({ fix, symbolName: symbolName2, errorIdentifierText: void 0 }); + } + } + function addImport(info2) { + var _a2, _b; + const { fix, symbolName: symbolName2 } = info2; + switch (fix.kind) { + case 0: + addToNamespace.push(fix); + break; + case 1: + importType.push(fix); + break; + case 2: { + const { importClauseOrBindingPattern, importKind, addAsTypeOnly } = fix; + const key = String(getNodeId(importClauseOrBindingPattern)); + let entry = addToExisting.get(key); + if (!entry) { + addToExisting.set(key, entry = { importClauseOrBindingPattern, defaultImport: void 0, namedImports: /* @__PURE__ */ new Map() }); + } + if (importKind === 0) { + const prevValue = entry == null ? void 0 : entry.namedImports.get(symbolName2); + entry.namedImports.set(symbolName2, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly)); + } else { + Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add to Existing) Default import should be missing or match symbolName"); + entry.defaultImport = { + name: symbolName2, + addAsTypeOnly: reduceAddAsTypeOnlyValues((_a2 = entry.defaultImport) == null ? void 0 : _a2.addAsTypeOnly, addAsTypeOnly) + }; + } + break; + } + case 3: { + const { moduleSpecifier, importKind, useRequire, addAsTypeOnly } = fix; + const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly); + Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module"); + switch (importKind) { + case 1: + Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add new) Default import should be missing or match symbolName"); + entry.defaultImport = { name: symbolName2, addAsTypeOnly: reduceAddAsTypeOnlyValues((_b = entry.defaultImport) == null ? void 0 : _b.addAsTypeOnly, addAsTypeOnly) }; + break; + case 0: + const prevValue = (entry.namedImports || (entry.namedImports = /* @__PURE__ */ new Map())).get(symbolName2); + entry.namedImports.set(symbolName2, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly)); + break; + case 3: + case 2: + Debug.assert(entry.namespaceLikeImport === void 0 || entry.namespaceLikeImport.name === symbolName2, "Namespacelike import shoudl be missing or match symbolName"); + entry.namespaceLikeImport = { importKind, name: symbolName2, addAsTypeOnly }; + break; + } + break; + } + case 4: + break; + default: + Debug.assertNever(fix, `fix wasn't never - got kind ${fix.kind}`); + } + function reduceAddAsTypeOnlyValues(prevValue, newValue) { + return Math.max(prevValue ?? 0, newValue); + } + function getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly) { + const typeOnlyKey = newImportsKey( + moduleSpecifier, + /*topLevelTypeOnly*/ + true + ); + const nonTypeOnlyKey = newImportsKey( + moduleSpecifier, + /*topLevelTypeOnly*/ + false + ); + const typeOnlyEntry = newImports.get(typeOnlyKey); + const nonTypeOnlyEntry = newImports.get(nonTypeOnlyKey); + const newEntry = { + defaultImport: void 0, + namedImports: void 0, + namespaceLikeImport: void 0, + useRequire + }; + if (importKind === 1 && addAsTypeOnly === 2) { + if (typeOnlyEntry) + return typeOnlyEntry; + newImports.set(typeOnlyKey, newEntry); + return newEntry; + } + if (addAsTypeOnly === 1 && (typeOnlyEntry || nonTypeOnlyEntry)) { + return typeOnlyEntry || nonTypeOnlyEntry; + } + if (nonTypeOnlyEntry) { + return nonTypeOnlyEntry; + } + newImports.set(nonTypeOnlyKey, newEntry); + return newEntry; + } + function newImportsKey(moduleSpecifier, topLevelTypeOnly) { + return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`; + } + } + function writeFixes(changeTracker, oldFileQuotePreference) { + let quotePreference; + if (sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) { + quotePreference = oldFileQuotePreference; + } else { + quotePreference = getQuotePreference(sourceFile, preferences); + } + for (const fix of addToNamespace) { + addNamespaceQualifier(changeTracker, sourceFile, fix); + } + for (const fix of importType) { + addImportType(changeTracker, sourceFile, fix, quotePreference); + } + addToExisting.forEach(({ importClauseOrBindingPattern, defaultImport, namedImports }) => { + doAddExistingFix( + changeTracker, + sourceFile, + importClauseOrBindingPattern, + defaultImport, + arrayFrom(namedImports.entries(), ([name2, addAsTypeOnly]) => ({ addAsTypeOnly, name: name2 })), + preferences + ); + }); + let newDeclarations; + newImports.forEach(({ useRequire, defaultImport, namedImports, namespaceLikeImport }, key) => { + const moduleSpecifier = key.slice(2); + const getDeclarations = useRequire ? getNewRequires : getNewImports; + const declarations = getDeclarations( + moduleSpecifier, + quotePreference, + defaultImport, + namedImports && arrayFrom(namedImports.entries(), ([name2, addAsTypeOnly]) => ({ addAsTypeOnly, name: name2 })), + namespaceLikeImport, + compilerOptions, + preferences + ); + newDeclarations = combine(newDeclarations, declarations); + }); + if (newDeclarations) { + insertImports( + changeTracker, + sourceFile, + newDeclarations, + /*blankLineBetween*/ + true, + preferences + ); + } + } + function hasFixes() { + return addToNamespace.length > 0 || importType.length > 0 || addToExisting.size > 0 || newImports.size > 0; + } + } + function createImportSpecifierResolver(importingFile, program, host, preferences) { + const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host); + const importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions()); + return { getModuleSpecifierForBestExportInfo }; + function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) { + const { fixes, computedWithoutCacheCount } = getImportFixes( + exportInfo, + position, + isValidTypeOnlyUseSite, + /*useRequire*/ + false, + program, + importingFile, + host, + preferences, + importMap, + fromCacheOnly + ); + const result2 = getBestFix(fixes, importingFile, program, packageJsonImportFilter, host); + return result2 && { ...result2, computedWithoutCacheCount }; + } + } + function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) { + let exportInfos; + if (exportMapKey) { + exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey"); + } else { + exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken); + Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol"); + } + const useRequire = shouldUseRequire(sourceFile, program); + const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position)); + const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences)); + return { + moduleSpecifier: fix.moduleSpecifier, + codeAction: codeFixActionToCodeAction(codeActionForFix( + { host, formatContext, preferences }, + sourceFile, + symbolName2, + fix, + /*includeSymbolNameInDescription*/ + false, + program, + preferences + )) + }; + } + function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, host, formatContext, preferences) { + const compilerOptions = program.getCompilerOptions(); + const symbolName2 = single(getSymbolNamesToImport(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions)); + const fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program); + const includeSymbolNameInDescription = symbolName2 !== symbolToken.text; + return fix && codeFixActionToCodeAction(codeActionForFix( + { host, formatContext, preferences }, + sourceFile, + symbolName2, + fix, + includeSymbolNameInDescription, + program, + preferences + )); + } + function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) { + const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host); + return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host); + } + function codeFixActionToCodeAction({ description: description32, changes, commands }) { + return { description: description32, changes, commands }; + } + function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) { + const getChecker = createGetChecker(program, host); + return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name2) => name2 === symbolName2, (info2) => { + if (skipAlias(info2[0].symbol, getChecker(info2[0].isFromPackageJson)) === symbol && info2.some((i7) => i7.moduleSymbol === moduleSymbol || i7.symbol.parent === moduleSymbol)) { + return info2; + } + }); + } + function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) { + var _a2, _b; + const compilerOptions = program.getCompilerOptions(); + const mainProgramInfo = getInfoWithChecker( + program.getTypeChecker(), + /*isFromPackageJson*/ + false + ); + if (mainProgramInfo) { + return mainProgramInfo; + } + const autoImportProvider = (_b = (_a2 = host.getPackageJsonAutoImportProvider) == null ? void 0 : _a2.call(host)) == null ? void 0 : _b.getTypeChecker(); + return Debug.checkDefined(autoImportProvider && getInfoWithChecker( + autoImportProvider, + /*isFromPackageJson*/ + true + ), `Could not find symbol in specified module for code actions`); + function getInfoWithChecker(checker, isFromPackageJson) { + const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) { + return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; + } + const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); + if (named && skipAlias(named, checker) === symbol) { + return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson }; + } + } + } + function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()), fromCacheOnly) { + const checker = program.getTypeChecker(); + const existingImports = flatMap2(exportInfos, importMap.getImportsForExportInfo); + const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition); + const addToExisting = tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, program.getCompilerOptions()); + if (addToExisting) { + return { + computedWithoutCacheCount: 0, + fixes: [...useNamespace ? [useNamespace] : emptyArray, addToExisting] + }; + } + const { fixes, computedWithoutCacheCount = 0 } = getFixesForAddImport( + exportInfos, + existingImports, + program, + sourceFile, + usagePosition, + isValidTypeOnlyUseSite, + useRequire, + host, + preferences, + fromCacheOnly + ); + return { + computedWithoutCacheCount, + fixes: [...useNamespace ? [useNamespace] : emptyArray, ...fixes] + }; + } + function tryUseExistingNamespaceImport(existingImports, position) { + return firstDefined(existingImports, ({ declaration, importKind }) => { + var _a2; + if (importKind !== 0) + return void 0; + const namespacePrefix = getNamespaceLikeImportText(declaration); + const moduleSpecifier = namespacePrefix && ((_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text); + if (moduleSpecifier) { + return { kind: 0, namespacePrefix, usagePosition: position, moduleSpecifier }; + } + }); + } + function getNamespaceLikeImportText(declaration) { + var _a2, _b, _c; + switch (declaration.kind) { + case 260: + return (_a2 = tryCast(declaration.name, isIdentifier)) == null ? void 0 : _a2.text; + case 271: + return declaration.name.text; + case 272: + return (_c = tryCast((_b = declaration.importClause) == null ? void 0 : _b.namedBindings, isNamespaceImport)) == null ? void 0 : _c.name.text; + default: + return Debug.assertNever(declaration); + } + } + function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, symbol, targetFlags, checker, compilerOptions) { + if (!isValidTypeOnlyUseSite) { + return 4; + } + if (isForNewImportDeclaration && compilerOptions.importsNotUsedAsValues === 2) { + return 2; + } + if (importNameElisionDisabled(compilerOptions) && (!(targetFlags & 111551) || !!checker.getTypeOnlyAliasDeclaration(symbol))) { + return 2; + } + return 1; + } + function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker, compilerOptions) { + let best; + for (const existingImport of existingImports) { + const fix = getAddToExistingImportFix(existingImport); + if (!fix) + continue; + const isTypeOnly = isTypeOnlyImportDeclaration(fix.importClauseOrBindingPattern); + if (fix.addAsTypeOnly !== 4 && isTypeOnly || fix.addAsTypeOnly === 4 && !isTypeOnly) { + return fix; + } + best ?? (best = fix); + } + return best; + function getAddToExistingImportFix({ declaration, importKind, symbol, targetFlags }) { + if (importKind === 3 || importKind === 2 || declaration.kind === 271) { + return void 0; + } + if (declaration.kind === 260) { + return (importKind === 0 || importKind === 1) && declaration.name.kind === 206 ? { + kind: 2, + importClauseOrBindingPattern: declaration.name, + importKind, + moduleSpecifier: declaration.initializer.arguments[0].text, + addAsTypeOnly: 4 + /* NotAllowed */ + } : void 0; + } + const { importClause } = declaration; + if (!importClause || !isStringLiteralLike(declaration.moduleSpecifier)) { + return void 0; + } + const { name: name2, namedBindings } = importClause; + if (importClause.isTypeOnly && !(importKind === 0 && namedBindings)) { + return void 0; + } + const addAsTypeOnly = getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + false, + symbol, + targetFlags, + checker, + compilerOptions + ); + if (importKind === 1 && (name2 || // Cannot add a default import to a declaration that already has one + addAsTypeOnly === 2 && namedBindings)) { + return void 0; + } + if (importKind === 0 && (namedBindings == null ? void 0 : namedBindings.kind) === 274) { + return void 0; + } + return { + kind: 2, + importClauseOrBindingPattern: importClause, + importKind, + moduleSpecifier: declaration.moduleSpecifier.text, + addAsTypeOnly + }; + } + } + function createExistingImportMap(checker, importingFile, compilerOptions) { + let importMap; + for (const moduleSpecifier of importingFile.imports) { + const i7 = importFromModuleSpecifier(moduleSpecifier); + if (isVariableDeclarationInitializedToRequire(i7.parent)) { + const moduleSymbol = checker.resolveExternalModuleName(moduleSpecifier); + if (moduleSymbol) { + (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i7.parent); + } + } else if (i7.kind === 272 || i7.kind === 271) { + const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + (importMap || (importMap = createMultiMap())).add(getSymbolId(moduleSymbol), i7); + } + } + } + return { + getImportsForExportInfo: ({ moduleSymbol, exportKind, targetFlags, symbol }) => { + if (!(targetFlags & 111551) && isSourceFileJS(importingFile)) + return emptyArray; + const matchingDeclarations = importMap == null ? void 0 : importMap.get(getSymbolId(moduleSymbol)); + if (!matchingDeclarations) + return emptyArray; + const importKind = getImportKind(importingFile, exportKind, compilerOptions); + return matchingDeclarations.map((declaration) => ({ declaration, importKind, symbol, targetFlags })); + } + }; + } + function shouldUseRequire(sourceFile, program) { + if (!isSourceFileJS(sourceFile)) { + return false; + } + if (sourceFile.commonJsModuleIndicator && !sourceFile.externalModuleIndicator) + return true; + if (sourceFile.externalModuleIndicator && !sourceFile.commonJsModuleIndicator) + return false; + const compilerOptions = program.getCompilerOptions(); + if (compilerOptions.configFile) { + return getEmitModuleKind(compilerOptions) < 5; + } + if (sourceFile.impliedNodeFormat === 1) + return true; + if (sourceFile.impliedNodeFormat === 99) + return false; + for (const otherFile of program.getSourceFiles()) { + if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) + continue; + if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) + return true; + if (otherFile.externalModuleIndicator && !otherFile.commonJsModuleIndicator) + return false; + } + return true; + } + function createGetChecker(program, host) { + return memoizeOne((isFromPackageJson) => isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker()); + } + function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) { + const isJs = isSourceFileJS(sourceFile); + const compilerOptions = program.getCompilerOptions(); + const moduleSpecifierResolutionHost = createModuleSpecifierResolutionHost(program, host); + const getChecker = createGetChecker(program, host); + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(moduleResolution); + const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo( + moduleSymbol, + checker, + compilerOptions, + sourceFile, + moduleSpecifierResolutionHost, + preferences, + /*options*/ + void 0, + /*forAutoImport*/ + true + ); + let computedWithoutCacheCount = 0; + const fixes = flatMap2(exportInfo, (exportInfo2, i7) => { + const checker = getChecker(exportInfo2.isFromPackageJson); + const { computedWithoutCache, moduleSpecifiers } = getModuleSpecifiers2(exportInfo2.moduleSymbol, checker); + const importedSymbolHasValueMeaning = !!(exportInfo2.targetFlags & 111551); + const addAsTypeOnly = getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + true, + exportInfo2.symbol, + exportInfo2.targetFlags, + checker, + compilerOptions + ); + computedWithoutCacheCount += computedWithoutCache ? 1 : 0; + return mapDefined(moduleSpecifiers, (moduleSpecifier) => { + var _a2; + if (rejectNodeModulesRelativePaths && pathContainsNodeModules(moduleSpecifier)) { + return void 0; + } + if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) { + return { kind: 1, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i7 > 0 }; + } + const importKind = getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions); + let qualification; + if (usagePosition !== void 0 && importKind === 3 && exportInfo2.exportKind === 0) { + const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol); + let namespacePrefix; + if (exportEquals !== exportInfo2.moduleSymbol) { + namespacePrefix = (_a2 = getDefaultExportInfoWorker(exportEquals, checker, compilerOptions)) == null ? void 0 : _a2.name; + } + namespacePrefix || (namespacePrefix = moduleSymbolToValidIdentifier( + exportInfo2.moduleSymbol, + getEmitScriptTarget(compilerOptions), + /*forceCapitalize*/ + false + )); + qualification = { namespacePrefix, usagePosition }; + } + return { + kind: 3, + moduleSpecifier, + importKind, + useRequire, + addAsTypeOnly, + exportInfo: exportInfo2, + isReExport: i7 > 0, + qualification + }; + }); + }); + return { computedWithoutCacheCount, fixes }; + } + function getFixesForAddImport(exportInfos, existingImports, program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, host, preferences, fromCacheOnly) { + const existingDeclaration = firstDefined(existingImports, (info2) => newImportInfoFromExistingSpecifier(info2, isValidTypeOnlyUseSite, useRequire, program.getTypeChecker(), program.getCompilerOptions())); + return existingDeclaration ? { fixes: [existingDeclaration] } : getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUseSite, useRequire, exportInfos, host, preferences, fromCacheOnly); + } + function newImportInfoFromExistingSpecifier({ declaration, importKind, symbol, targetFlags }, isValidTypeOnlyUseSite, useRequire, checker, compilerOptions) { + var _a2; + const moduleSpecifier = (_a2 = tryGetModuleSpecifierFromDeclaration(declaration)) == null ? void 0 : _a2.text; + if (moduleSpecifier) { + const addAsTypeOnly = useRequire ? 4 : getAddAsTypeOnly( + isValidTypeOnlyUseSite, + /*isForNewImportDeclaration*/ + true, + symbol, + targetFlags, + checker, + compilerOptions + ); + return { kind: 3, moduleSpecifier, importKind, addAsTypeOnly, useRequire }; + } + } + function getFixInfos(context2, errorCode, pos, useAutoImportProvider) { + const symbolToken = getTokenAtPosition(context2.sourceFile, pos); + let info2; + if (errorCode === Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) { + info2 = getFixesInfoForUMDImport(context2, symbolToken); + } else if (!isIdentifier(symbolToken)) { + return void 0; + } else if (errorCode === Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code) { + const symbolName2 = single(getSymbolNamesToImport(context2.sourceFile, context2.program.getTypeChecker(), symbolToken, context2.program.getCompilerOptions())); + const fix = getTypeOnlyPromotionFix(context2.sourceFile, symbolToken, symbolName2, context2.program); + return fix && [{ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text }]; + } else { + info2 = getFixesInfoForNonUMDImport(context2, symbolToken, useAutoImportProvider); + } + const packageJsonImportFilter = createPackageJsonImportFilter(context2.sourceFile, context2.preferences, context2.host); + return info2 && sortFixInfo(info2, context2.sourceFile, context2.program, packageJsonImportFilter, context2.host); + } + function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host) { + const _toPath = (fileName) => toPath2(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)); + return sort(fixes, (a7, b8) => compareBooleans(!!a7.isJsxNamespaceFix, !!b8.isJsxNamespaceFix) || compareValues(a7.fix.kind, b8.fix.kind) || compareModuleSpecifiers(a7.fix, b8.fix, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, _toPath)); + } + function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host) { + if (!some2(fixes)) + return; + if (fixes[0].kind === 0 || fixes[0].kind === 2) { + return fixes[0]; + } + return fixes.reduce( + (best, fix) => ( + // Takes true branch of conditional if `fix` is better than `best` + compareModuleSpecifiers( + fix, + best, + sourceFile, + program, + packageJsonImportFilter.allowsImportingSpecifier, + (fileName) => toPath2(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)) + ) === -1 ? fix : best + ) + ); + } + function compareModuleSpecifiers(a7, b8, importingFile, program, allowsImportingSpecifier, toPath3) { + if (a7.kind !== 0 && b8.kind !== 0) { + return compareBooleans(allowsImportingSpecifier(b8.moduleSpecifier), allowsImportingSpecifier(a7.moduleSpecifier)) || compareNodeCoreModuleSpecifiers(a7.moduleSpecifier, b8.moduleSpecifier, importingFile, program) || compareBooleans( + isFixPossiblyReExportingImportingFile(a7, importingFile, program.getCompilerOptions(), toPath3), + isFixPossiblyReExportingImportingFile(b8, importingFile, program.getCompilerOptions(), toPath3) + ) || compareNumberOfDirectorySeparators(a7.moduleSpecifier, b8.moduleSpecifier); + } + return 0; + } + function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) { + var _a2; + if (fix.isReExport && ((_a2 = fix.exportInfo) == null ? void 0 : _a2.moduleFileName) && isIndexFileName(fix.exportInfo.moduleFileName)) { + const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName)); + return startsWith2(importingFile.path, reExportDir); + } + return false; + } + function isIndexFileName(fileName) { + return getBaseFileName( + fileName, + [".js", ".jsx", ".d.ts", ".ts", ".tsx"], + /*ignoreCase*/ + true + ) === "index"; + } + function compareNodeCoreModuleSpecifiers(a7, b8, importingFile, program) { + if (startsWith2(a7, "node:") && !startsWith2(b8, "node:")) + return shouldUseUriStyleNodeCoreModules(importingFile, program) ? -1 : 1; + if (startsWith2(b8, "node:") && !startsWith2(a7, "node:")) + return shouldUseUriStyleNodeCoreModules(importingFile, program) ? 1 : -1; + return 0; + } + function getFixesInfoForUMDImport({ sourceFile, program, host, preferences }, token) { + const checker = program.getTypeChecker(); + const umdSymbol = getUmdSymbol(token, checker); + if (!umdSymbol) + return void 0; + const symbol = checker.getAliasedSymbol(umdSymbol); + const symbolName2 = umdSymbol.name; + const exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: void 0, exportKind: 3, targetFlags: symbol.flags, isFromPackageJson: false }]; + const useRequire = shouldUseRequire(sourceFile, program); + const fixes = getImportFixes( + exportInfo, + /*usagePosition*/ + void 0, + /*isValidTypeOnlyUseSite*/ + false, + useRequire, + program, + sourceFile, + host, + preferences + ).fixes; + return fixes.map((fix) => { + var _a2; + return { fix, symbolName: symbolName2, errorIdentifierText: (_a2 = tryCast(token, isIdentifier)) == null ? void 0 : _a2.text }; + }); + } + function getUmdSymbol(token, checker) { + const umdSymbol = isIdentifier(token) ? checker.getSymbolAtLocation(token) : void 0; + if (isUMDExportSymbol(umdSymbol)) + return umdSymbol; + const { parent: parent22 } = token; + if (isJsxOpeningLikeElement(parent22) && parent22.tagName === token || isJsxOpeningFragment(parent22)) { + const parentSymbol = checker.resolveName( + checker.getJsxNamespace(parent22), + isJsxOpeningLikeElement(parent22) ? token : parent22, + 111551, + /*excludeGlobals*/ + false + ); + if (isUMDExportSymbol(parentSymbol)) { + return parentSymbol; + } + } + return void 0; + } + function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) { + if (compilerOptions.verbatimModuleSyntax && (getEmitModuleKind(compilerOptions) === 1 || importingFile.impliedNodeFormat === 1)) { + return 3; + } + switch (exportKind) { + case 0: + return 0; + case 1: + return 1; + case 2: + return getExportEqualsImportKind(importingFile, compilerOptions, !!forceImportKeyword); + case 3: + return getUmdImportKind(importingFile, compilerOptions, !!forceImportKeyword); + default: + return Debug.assertNever(exportKind); + } + } + function getUmdImportKind(importingFile, compilerOptions, forceImportKeyword) { + if (getAllowSyntheticDefaultImports(compilerOptions)) { + return 1; + } + const moduleKind = getEmitModuleKind(compilerOptions); + switch (moduleKind) { + case 2: + case 1: + case 3: + if (isInJSFile(importingFile)) { + return isExternalModule(importingFile) || forceImportKeyword ? 2 : 3; + } + return 3; + case 4: + case 5: + case 6: + case 7: + case 99: + case 0: + case 200: + return 2; + case 100: + case 199: + return importingFile.impliedNodeFormat === 99 ? 2 : 3; + default: + return Debug.assertNever(moduleKind, `Unexpected moduleKind ${moduleKind}`); + } + } + function getFixesInfoForNonUMDImport({ sourceFile, program, cancellationToken, host, preferences }, symbolToken, useAutoImportProvider) { + const checker = program.getTypeChecker(); + const compilerOptions = program.getCompilerOptions(); + return flatMap2(getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions), (symbolName2) => { + if (symbolName2 === "default") { + return void 0; + } + const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(symbolToken); + const useRequire = shouldUseRequire(sourceFile, program); + const exportInfo = getExportInfos(symbolName2, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences); + return arrayFrom( + flatMapIterator(exportInfo.values(), (exportInfos) => getImportFixes(exportInfos, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes), + (fix) => ({ fix, symbolName: symbolName2, errorIdentifierText: symbolToken.text, isJsxNamespaceFix: symbolName2 !== symbolToken.text }) + ); + }); + } + function getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program) { + const checker = program.getTypeChecker(); + const symbol = checker.resolveName( + symbolName2, + symbolToken, + 111551, + /*excludeGlobals*/ + true + ); + if (!symbol) + return void 0; + const typeOnlyAliasDeclaration = checker.getTypeOnlyAliasDeclaration(symbol); + if (!typeOnlyAliasDeclaration || getSourceFileOfNode(typeOnlyAliasDeclaration) !== sourceFile) + return void 0; + return { kind: 4, typeOnlyAliasDeclaration }; + } + function getSymbolNamesToImport(sourceFile, checker, symbolToken, compilerOptions) { + const parent22 = symbolToken.parent; + if ((isJsxOpeningLikeElement(parent22) || isJsxClosingElement(parent22)) && parent22.tagName === symbolToken && jsxModeNeedsExplicitImport(compilerOptions.jsx)) { + const jsxNamespace = checker.getJsxNamespace(sourceFile); + if (needsJsxNamespaceFix(jsxNamespace, symbolToken, checker)) { + const needsComponentNameFix = !isIntrinsicJsxName(symbolToken.text) && !checker.resolveName( + symbolToken.text, + symbolToken, + 111551, + /*excludeGlobals*/ + false + ); + return needsComponentNameFix ? [symbolToken.text, jsxNamespace] : [jsxNamespace]; + } + } + return [symbolToken.text]; + } + function needsJsxNamespaceFix(jsxNamespace, symbolToken, checker) { + if (isIntrinsicJsxName(symbolToken.text)) + return true; + const namespaceSymbol = checker.resolveName( + jsxNamespace, + symbolToken, + 111551, + /*excludeGlobals*/ + true + ); + return !namespaceSymbol || some2(namespaceSymbol.declarations, isTypeOnlyImportOrExportDeclaration) && !(namespaceSymbol.flags & 111551); + } + function getExportInfos(symbolName2, isJsxTagName, currentTokenMeaning, cancellationToken, fromFile2, program, useAutoImportProvider, host, preferences) { + var _a2; + const originalSymbolToExportInfos = createMultiMap(); + const packageJsonFilter = createPackageJsonImportFilter(fromFile2, preferences, host); + const moduleSpecifierCache = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host); + const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => { + return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); + }); + function addSymbol(moduleSymbol, toFile, exportedSymbol, exportKind, program2, isFromPackageJson) { + const moduleSpecifierResolutionHost = getModuleSpecifierResolutionHost(isFromPackageJson); + if (toFile && isImportableFile(program2, fromFile2, toFile, preferences, packageJsonFilter, moduleSpecifierResolutionHost, moduleSpecifierCache) || !toFile && packageJsonFilter.allowsImportingAmbientModule(moduleSymbol, moduleSpecifierResolutionHost)) { + const checker = program2.getTypeChecker(); + originalSymbolToExportInfos.add(getUniqueSymbolId(exportedSymbol, checker).toString(), { symbol: exportedSymbol, moduleSymbol, moduleFileName: toFile == null ? void 0 : toFile.fileName, exportKind, targetFlags: skipAlias(exportedSymbol, checker).flags, isFromPackageJson }); + } + } + forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, (moduleSymbol, sourceFile, program2, isFromPackageJson) => { + const checker = program2.getTypeChecker(); + cancellationToken.throwIfCancellationRequested(); + const compilerOptions = program2.getCompilerOptions(); + const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); + if (defaultInfo && (defaultInfo.name === symbolName2 || moduleSymbolToValidIdentifier(moduleSymbol, getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName2) && symbolHasMeaning(defaultInfo.resolvedSymbol, currentTokenMeaning)) { + addSymbol(moduleSymbol, sourceFile, defaultInfo.symbol, defaultInfo.exportKind, program2, isFromPackageJson); + } + const exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol); + if (exportSymbolWithIdenticalName && symbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { + addSymbol(moduleSymbol, sourceFile, exportSymbolWithIdenticalName, 0, program2, isFromPackageJson); + } + }); + return originalSymbolToExportInfos; + } + function getExportEqualsImportKind(importingFile, compilerOptions, forceImportKeyword) { + const allowSyntheticDefaults = getAllowSyntheticDefaultImports(compilerOptions); + const isJS = isInJSFile(importingFile); + if (!isJS && getEmitModuleKind(compilerOptions) >= 5) { + return allowSyntheticDefaults ? 1 : 2; + } + if (isJS) { + return isExternalModule(importingFile) || forceImportKeyword ? allowSyntheticDefaults ? 1 : 2 : 3; + } + for (const statement of importingFile.statements) { + if (isImportEqualsDeclaration(statement) && !nodeIsMissing(statement.moduleReference)) { + return 3; + } + } + return allowSyntheticDefaults ? 1 : 3; + } + function codeActionForFix(context2, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) { + let diag2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (tracker) => { + diag2 = codeActionForFixWorker(tracker, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences); + }); + return createCodeFixAction(importFixName, changes, diag2, importFixId, Diagnostics.Add_all_missing_imports); + } + function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) { + const quotePreference = getQuotePreference(sourceFile, preferences); + switch (fix.kind) { + case 0: + addNamespaceQualifier(changes, sourceFile, fix); + return [Diagnostics.Change_0_to_1, symbolName2, `${fix.namespacePrefix}.${symbolName2}`]; + case 1: + addImportType(changes, sourceFile, fix, quotePreference); + return [Diagnostics.Change_0_to_1, symbolName2, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName2]; + case 2: { + const { importClauseOrBindingPattern, importKind, addAsTypeOnly, moduleSpecifier } = fix; + doAddExistingFix( + changes, + sourceFile, + importClauseOrBindingPattern, + importKind === 1 ? { name: symbolName2, addAsTypeOnly } : void 0, + importKind === 0 ? [{ name: symbolName2, addAsTypeOnly }] : emptyArray, + preferences + ); + const moduleSpecifierWithoutQuotes = stripQuotes(moduleSpecifier); + return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifierWithoutQuotes] : [Diagnostics.Update_import_from_0, moduleSpecifierWithoutQuotes]; + } + case 3: { + const { importKind, moduleSpecifier, addAsTypeOnly, useRequire, qualification } = fix; + const getDeclarations = useRequire ? getNewRequires : getNewImports; + const defaultImport = importKind === 1 ? { name: symbolName2, addAsTypeOnly } : void 0; + const namedImports = importKind === 0 ? [{ name: symbolName2, addAsTypeOnly }] : void 0; + const namespaceLikeImport = importKind === 2 || importKind === 3 ? { importKind, name: (qualification == null ? void 0 : qualification.namespacePrefix) || symbolName2, addAsTypeOnly } : void 0; + insertImports( + changes, + sourceFile, + getDeclarations( + moduleSpecifier, + quotePreference, + defaultImport, + namedImports, + namespaceLikeImport, + program.getCompilerOptions(), + preferences + ), + /*blankLineBetween*/ + true, + preferences + ); + if (qualification) { + addNamespaceQualifier(changes, sourceFile, qualification); + } + return includeSymbolNameInDescription ? [Diagnostics.Import_0_from_1, symbolName2, moduleSpecifier] : [Diagnostics.Add_import_from_0, moduleSpecifier]; + } + case 4: { + const { typeOnlyAliasDeclaration } = fix; + const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences); + return promotedDeclaration.kind === 276 ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)]; + } + default: + return Debug.assertNever(fix, `Unexpected fix kind ${fix.kind}`); + } + } + function getModuleSpecifierText(promotedDeclaration) { + var _a2, _b; + return promotedDeclaration.kind === 271 ? ((_b = tryCast((_a2 = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text; + } + function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, preferences) { + const compilerOptions = program.getCompilerOptions(); + const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions); + switch (aliasDeclaration.kind) { + case 276: + if (aliasDeclaration.isTypeOnly) { + const sortKind = ts_OrganizeImports_exports.detectImportSpecifierSorting(aliasDeclaration.parent.elements, preferences); + if (aliasDeclaration.parent.elements.length > 1 && sortKind) { + const newSpecifier = factory.updateImportSpecifier( + aliasDeclaration, + /*isTypeOnly*/ + false, + aliasDeclaration.propertyName, + aliasDeclaration.name + ); + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer( + preferences, + sortKind === 2 + /* CaseInsensitive */ + ); + const insertionIndex = ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(aliasDeclaration.parent.elements, newSpecifier, comparer, preferences); + if (insertionIndex !== aliasDeclaration.parent.elements.indexOf(aliasDeclaration)) { + changes.delete(sourceFile, aliasDeclaration); + changes.insertImportSpecifierAtIndex(sourceFile, newSpecifier, aliasDeclaration.parent, insertionIndex); + return aliasDeclaration; + } + } + changes.deleteRange(sourceFile, { pos: getTokenPosOfNode(aliasDeclaration.getFirstToken()), end: getTokenPosOfNode(aliasDeclaration.propertyName ?? aliasDeclaration.name) }); + return aliasDeclaration; + } else { + Debug.assert(aliasDeclaration.parent.parent.isTypeOnly); + promoteImportClause(aliasDeclaration.parent.parent); + return aliasDeclaration.parent.parent; + } + case 273: + promoteImportClause(aliasDeclaration); + return aliasDeclaration; + case 274: + promoteImportClause(aliasDeclaration.parent); + return aliasDeclaration.parent; + case 271: + changes.deleteRange(sourceFile, aliasDeclaration.getChildAt(1)); + return aliasDeclaration; + default: + Debug.failBadSyntaxKind(aliasDeclaration); + } + function promoteImportClause(importClause) { + var _a2; + changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile)); + if (!compilerOptions.allowImportingTsExtensions) { + const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent); + const resolvedModule = moduleSpecifier && ((_a2 = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a2.resolvedModule); + if (resolvedModule == null ? void 0 : resolvedModule.resolvedUsingTsExtension) { + const changedExtension = changeAnyExtension(moduleSpecifier.text, getOutputExtension(moduleSpecifier.text, compilerOptions)); + changes.replaceNode(sourceFile, moduleSpecifier, factory.createStringLiteral(changedExtension)); + } + } + if (convertExistingToTypeOnly) { + const namedImports = tryCast(importClause.namedBindings, isNamedImports); + if (namedImports && namedImports.elements.length > 1) { + if (ts_OrganizeImports_exports.detectImportSpecifierSorting(namedImports.elements, preferences) && aliasDeclaration.kind === 276 && namedImports.elements.indexOf(aliasDeclaration) !== 0) { + changes.delete(sourceFile, aliasDeclaration); + changes.insertImportSpecifierAtIndex(sourceFile, aliasDeclaration, namedImports, 0); + } + for (const element of namedImports.elements) { + if (element !== aliasDeclaration && !element.isTypeOnly) { + changes.insertModifierBefore(sourceFile, 156, element); + } + } + } + } + } + } + function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, preferences) { + var _a2; + if (clause.kind === 206) { + if (defaultImport) { + addElementToBindingPattern(clause, defaultImport.name, "default"); + } + for (const specifier of namedImports) { + addElementToBindingPattern( + clause, + specifier.name, + /*propertyName*/ + void 0 + ); + } + return; + } + const promoteFromTypeOnly2 = clause.isTypeOnly && some2( + [defaultImport, ...namedImports], + (i7) => (i7 == null ? void 0 : i7.addAsTypeOnly) === 4 + /* NotAllowed */ + ); + const existingSpecifiers = clause.namedBindings && ((_a2 = tryCast(clause.namedBindings, isNamedImports)) == null ? void 0 : _a2.elements); + if (defaultImport) { + Debug.assert(!clause.name, "Cannot add a default import to an import clause that already has one"); + changes.insertNodeAt(sourceFile, clause.getStart(sourceFile), factory.createIdentifier(defaultImport.name), { suffix: ", " }); + } + if (namedImports.length) { + let ignoreCaseForSorting; + if (typeof preferences.organizeImportsIgnoreCase === "boolean") { + ignoreCaseForSorting = preferences.organizeImportsIgnoreCase; + } else if (existingSpecifiers) { + const targetImportSorting = ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); + if (targetImportSorting !== 3) { + ignoreCaseForSorting = targetImportSorting === 2; + } + } + if (ignoreCaseForSorting === void 0) { + ignoreCaseForSorting = ts_OrganizeImports_exports.detectSorting(sourceFile, preferences) === 2; + } + const comparer = ts_OrganizeImports_exports.getOrganizeImportsComparer(preferences, ignoreCaseForSorting); + const newSpecifiers = stableSort( + namedImports.map( + (namedImport) => factory.createImportSpecifier( + (!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences), + /*propertyName*/ + void 0, + factory.createIdentifier(namedImport.name) + ) + ), + (s1, s22) => ts_OrganizeImports_exports.compareImportOrExportSpecifiers(s1, s22, comparer) + ); + const specifierSort = (existingSpecifiers == null ? void 0 : existingSpecifiers.length) && ts_OrganizeImports_exports.detectImportSpecifierSorting(existingSpecifiers, preferences); + if (specifierSort && !(ignoreCaseForSorting && specifierSort === 1)) { + for (const spec of newSpecifiers) { + const insertionIndex = promoteFromTypeOnly2 && !spec.isTypeOnly ? 0 : ts_OrganizeImports_exports.getImportSpecifierInsertionIndex(existingSpecifiers, spec, comparer, preferences); + changes.insertImportSpecifierAtIndex(sourceFile, spec, clause.namedBindings, insertionIndex); + } + } else if (existingSpecifiers == null ? void 0 : existingSpecifiers.length) { + for (const spec of newSpecifiers) { + changes.insertNodeInListAfter(sourceFile, last2(existingSpecifiers), spec, existingSpecifiers); + } + } else { + if (newSpecifiers.length) { + const namedImports2 = factory.createNamedImports(newSpecifiers); + if (clause.namedBindings) { + changes.replaceNode(sourceFile, clause.namedBindings, namedImports2); + } else { + changes.insertNodeAfter(sourceFile, Debug.checkDefined(clause.name, "Import clause must have either named imports or a default import"), namedImports2); + } + } + } + } + if (promoteFromTypeOnly2) { + changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(clause, sourceFile)); + if (existingSpecifiers) { + for (const specifier of existingSpecifiers) { + changes.insertModifierBefore(sourceFile, 156, specifier); + } + } + } + function addElementToBindingPattern(bindingPattern, name2, propertyName) { + const element = factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + propertyName, + name2 + ); + if (bindingPattern.elements.length) { + changes.insertNodeInListAfter(sourceFile, last2(bindingPattern.elements), element); + } else { + changes.replaceNode(sourceFile, bindingPattern, factory.createObjectBindingPattern([element])); + } + } + } + function addNamespaceQualifier(changes, sourceFile, { namespacePrefix, usagePosition }) { + changes.insertText(sourceFile, usagePosition, namespacePrefix + "."); + } + function addImportType(changes, sourceFile, { moduleSpecifier, usagePosition: position }, quotePreference) { + changes.insertText(sourceFile, position, getImportTypePrefix(moduleSpecifier, quotePreference)); + } + function getImportTypePrefix(moduleSpecifier, quotePreference) { + const quote2 = getQuoteFromPreference(quotePreference); + return `import(${quote2}${moduleSpecifier}${quote2}).`; + } + function needsTypeOnly({ addAsTypeOnly }) { + return addAsTypeOnly === 2; + } + function shouldUseTypeOnly(info2, preferences) { + return needsTypeOnly(info2) || !!preferences.preferTypeOnlyAutoImports && info2.addAsTypeOnly !== 4; + } + function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport, compilerOptions, preferences) { + const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); + let statements; + if (defaultImport !== void 0 || (namedImports == null ? void 0 : namedImports.length)) { + const topLevelTypeOnly = (!defaultImport || needsTypeOnly(defaultImport)) && every2(namedImports, needsTypeOnly) || (compilerOptions.verbatimModuleSyntax || preferences.preferTypeOnlyAutoImports) && (defaultImport == null ? void 0 : defaultImport.addAsTypeOnly) !== 4 && !some2( + namedImports, + (i7) => i7.addAsTypeOnly === 4 + /* NotAllowed */ + ); + statements = combine( + statements, + makeImport( + defaultImport && factory.createIdentifier(defaultImport.name), + namedImports == null ? void 0 : namedImports.map( + (namedImport) => factory.createImportSpecifier( + !topLevelTypeOnly && shouldUseTypeOnly(namedImport, preferences), + /*propertyName*/ + void 0, + factory.createIdentifier(namedImport.name) + ) + ), + moduleSpecifier, + quotePreference, + topLevelTypeOnly + ) + ); + } + if (namespaceLikeImport) { + const declaration = namespaceLikeImport.importKind === 3 ? factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + shouldUseTypeOnly(namespaceLikeImport, preferences), + factory.createIdentifier(namespaceLikeImport.name), + factory.createExternalModuleReference(quotedModuleSpecifier) + ) : factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + shouldUseTypeOnly(namespaceLikeImport, preferences), + /*name*/ + void 0, + factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)) + ), + quotedModuleSpecifier, + /*attributes*/ + void 0 + ); + statements = combine(statements, declaration); + } + return Debug.checkDefined(statements); + } + function getNewRequires(moduleSpecifier, quotePreference, defaultImport, namedImports, namespaceLikeImport) { + const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference); + let statements; + if (defaultImport || (namedImports == null ? void 0 : namedImports.length)) { + const bindingElements = (namedImports == null ? void 0 : namedImports.map(({ name: name2 }) => factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + /*propertyName*/ + void 0, + name2 + ))) || []; + if (defaultImport) { + bindingElements.unshift(factory.createBindingElement( + /*dotDotDotToken*/ + void 0, + "default", + defaultImport.name + )); + } + const declaration = createConstEqualsRequireDeclaration(factory.createObjectBindingPattern(bindingElements), quotedModuleSpecifier); + statements = combine(statements, declaration); + } + if (namespaceLikeImport) { + const declaration = createConstEqualsRequireDeclaration(namespaceLikeImport.name, quotedModuleSpecifier); + statements = combine(statements, declaration); + } + return Debug.checkDefined(statements); + } + function createConstEqualsRequireDeclaration(name2, quotedModuleSpecifier) { + return factory.createVariableStatement( + /*modifiers*/ + void 0, + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + typeof name2 === "string" ? factory.createIdentifier(name2) : name2, + /*exclamationToken*/ + void 0, + /*type*/ + void 0, + factory.createCallExpression( + factory.createIdentifier("require"), + /*typeArguments*/ + void 0, + [quotedModuleSpecifier] + ) + ) + ], + 2 + /* Const */ + ) + ); + } + function symbolHasMeaning({ declarations }, meaning) { + return some2(declarations, (decl) => !!(getMeaningFromDeclaration(decl) & meaning)); + } + function moduleSymbolToValidIdentifier(moduleSymbol, target, forceCapitalize) { + return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes(moduleSymbol.name)), target, forceCapitalize); + } + function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) { + const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index")); + let res = ""; + let lastCharWasValid = true; + const firstCharCode = baseName.charCodeAt(0); + if (isIdentifierStart(firstCharCode, target)) { + res += String.fromCharCode(firstCharCode); + if (forceCapitalize) { + res = res.toUpperCase(); + } + } else { + lastCharWasValid = false; + } + for (let i7 = 1; i7 < baseName.length; i7++) { + const ch = baseName.charCodeAt(i7); + const isValid2 = isIdentifierPart(ch, target); + if (isValid2) { + let char = String.fromCharCode(ch); + if (!lastCharWasValid) { + char = char.toUpperCase(); + } + res += char; + } + lastCharWasValid = isValid2; + } + return !isStringANonContextualKeyword(res) ? res || "_" : `_${res}`; + } + var importFixName, importFixId, errorCodes18; + var init_importFixes = __esm2({ + "src/services/codefixes/importFixes.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + importFixName = "import"; + importFixId = "fixMissingImport"; + errorCodes18 = [ + Diagnostics.Cannot_find_name_0.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, + Diagnostics.Cannot_find_namespace_0.code, + Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code, + Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code, + Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code, + Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code, + Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code, + Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code + ]; + registerCodeFix({ + errorCodes: errorCodes18, + getCodeActions(context2) { + const { errorCode, preferences, sourceFile, span, program } = context2; + const info2 = getFixInfos( + context2, + errorCode, + span.start, + /*useAutoImportProvider*/ + true + ); + if (!info2) + return void 0; + return info2.map( + ({ fix, symbolName: symbolName2, errorIdentifierText }) => codeActionForFix( + context2, + sourceFile, + symbolName2, + fix, + /*includeSymbolNameInDescription*/ + symbolName2 !== errorIdentifierText, + program, + preferences + ) + ); + }, + fixIds: [importFixId], + getAllCodeActions: (context2) => { + const { sourceFile, program, preferences, host, cancellationToken } = context2; + const importAdder = createImportAdderWorker( + sourceFile, + program, + /*useAutoImportProvider*/ + true, + preferences, + host, + cancellationToken + ); + eachDiagnostic(context2, errorCodes18, (diag2) => importAdder.addImportFromDiagnostic(diag2, context2)); + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, importAdder.writeFixes)); + } + }); + } + }); + function getInfo6(program, sourceFile, span) { + const diag2 = find2(program.getSemanticDiagnostics(sourceFile), (diag3) => diag3.start === span.start && diag3.length === span.length); + if (diag2 === void 0 || diag2.relatedInformation === void 0) + return; + const related = find2(diag2.relatedInformation, (related2) => related2.code === Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code); + if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) + return; + let declaration = findAncestorMatchingSpan(related.file, createTextSpan(related.start, related.length)); + if (declaration === void 0) + return; + if (isIdentifier(declaration) && isTypeParameterDeclaration(declaration.parent)) { + declaration = declaration.parent; + } + if (isTypeParameterDeclaration(declaration)) { + if (isMappedTypeNode(declaration.parent)) + return; + const token = getTokenAtPosition(sourceFile, span.start); + const checker = program.getTypeChecker(); + const constraint = tryGetConstraintType(checker, token) || tryGetConstraintFromDiagnosticMessage(related.messageText); + return { constraint, declaration, token }; + } + return void 0; + } + function addMissingConstraint(changes, program, preferences, host, sourceFile, info2) { + const { declaration, constraint } = info2; + const checker = program.getTypeChecker(); + if (isString4(constraint)) { + changes.insertText(sourceFile, declaration.name.end, ` extends ${constraint}`); + } else { + const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); + const tracker = getNoopSymbolTrackerWithResolver({ program, host }); + const importAdder = createImportAdder(sourceFile, program, preferences, host); + const typeNode = typeToAutoImportableTypeNode( + checker, + importAdder, + constraint, + /*contextNode*/ + void 0, + scriptTarget, + /*flags*/ + void 0, + tracker + ); + if (typeNode) { + changes.replaceNode(sourceFile, declaration, factory.updateTypeParameterDeclaration( + declaration, + /*modifiers*/ + void 0, + declaration.name, + typeNode, + declaration.default + )); + importAdder.writeFixes(changes); + } + } + } + function tryGetConstraintFromDiagnosticMessage(messageText) { + const [, constraint] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || []; + return constraint; + } + function tryGetConstraintType(checker, node) { + if (isTypeNode(node.parent)) { + return checker.getTypeArgumentConstraint(node.parent); + } + const contextualType = isExpression(node) ? checker.getContextualType(node) : void 0; + return contextualType || checker.getTypeAtLocation(node); + } + var fixId17, errorCodes19; + var init_fixAddMissingConstraint = __esm2({ + "src/services/codefixes/fixAddMissingConstraint.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId17 = "addMissingConstraint"; + errorCodes19 = [ + // We want errors this could be attached to: + // Diagnostics.This_type_parameter_probably_needs_an_extends_0_constraint + Diagnostics.Type_0_is_not_comparable_to_type_1.code, + Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, + Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + Diagnostics.Type_0_is_not_assignable_to_type_1.code, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code, + Diagnostics.Property_0_is_incompatible_with_index_signature.code, + Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, + Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code + ]; + registerCodeFix({ + errorCodes: errorCodes19, + getCodeActions(context2) { + const { sourceFile, span, program, preferences, host } = context2; + const info2 = getInfo6(program, sourceFile, span); + if (info2 === void 0) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMissingConstraint(t8, program, preferences, host, sourceFile, info2)); + return [createCodeFixAction(fixId17, changes, Diagnostics.Add_extends_constraint, fixId17, Diagnostics.Add_extends_constraint_to_all_type_parameters)]; + }, + fixIds: [fixId17], + getAllCodeActions: (context2) => { + const { program, preferences, host } = context2; + const seen = /* @__PURE__ */ new Map(); + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + eachDiagnostic(context2, errorCodes19, (diag2) => { + const info2 = getInfo6(program, diag2.file, createTextSpan(diag2.start, diag2.length)); + if (info2) { + if (addToSeen(seen, getNodeId(info2.declaration))) { + return addMissingConstraint(changes, program, preferences, host, diag2.file, info2); + } + } + return void 0; + }); + })); + } + }); + } + }); + function dispatchChanges(changeTracker, context2, errorCode, pos) { + switch (errorCode) { + case Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code: + case Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: + case Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code: + case Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code: + case Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code: + return doAddOverrideModifierChange(changeTracker, context2.sourceFile, pos); + case Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code: + case Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code: + case Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code: + case Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code: + return doRemoveOverrideModifierChange(changeTracker, context2.sourceFile, pos); + default: + Debug.fail("Unexpected error code: " + errorCode); + } + } + function doAddOverrideModifierChange(changeTracker, sourceFile, pos) { + const classElement = findContainerClassElementLike(sourceFile, pos); + if (isSourceFileJS(sourceFile)) { + changeTracker.addJSDocTags(sourceFile, classElement, [factory.createJSDocOverrideTag(factory.createIdentifier("override"))]); + return; + } + const modifiers = classElement.modifiers || emptyArray; + const staticModifier = find2(modifiers, isStaticModifier); + const abstractModifier = find2(modifiers, isAbstractModifier); + const accessibilityModifier = find2(modifiers, (m7) => isAccessibilityModifier(m7.kind)); + const lastDecorator = findLast2(modifiers, isDecorator); + const modifierPos = abstractModifier ? abstractModifier.end : staticModifier ? staticModifier.end : accessibilityModifier ? accessibilityModifier.end : lastDecorator ? skipTrivia(sourceFile.text, lastDecorator.end) : classElement.getStart(sourceFile); + const options = accessibilityModifier || staticModifier || abstractModifier ? { prefix: " " } : { suffix: " " }; + changeTracker.insertModifierAt(sourceFile, modifierPos, 164, options); + } + function doRemoveOverrideModifierChange(changeTracker, sourceFile, pos) { + const classElement = findContainerClassElementLike(sourceFile, pos); + if (isSourceFileJS(sourceFile)) { + changeTracker.filterJSDocTags(sourceFile, classElement, not(isJSDocOverrideTag)); + return; + } + const overrideModifier = find2(classElement.modifiers, isOverrideModifier); + Debug.assertIsDefined(overrideModifier); + changeTracker.deleteModifier(sourceFile, overrideModifier); + } + function isClassElementLikeHasJSDoc(node) { + switch (node.kind) { + case 176: + case 172: + case 174: + case 177: + case 178: + return true; + case 169: + return isParameterPropertyDeclaration(node, node.parent); + default: + return false; + } + } + function findContainerClassElementLike(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + const classElement = findAncestor(token, (node) => { + if (isClassLike(node)) + return "quit"; + return isClassElementLikeHasJSDoc(node); + }); + Debug.assert(classElement && isClassElementLikeHasJSDoc(classElement)); + return classElement; + } + var fixName, fixAddOverrideId, fixRemoveOverrideId, errorCodes20, errorCodeFixIdMap; + var init_fixOverrideModifier = __esm2({ + "src/services/codefixes/fixOverrideModifier.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName = "fixOverrideModifier"; + fixAddOverrideId = "fixAddOverrideModifier"; + fixRemoveOverrideId = "fixRemoveOverrideModifier"; + errorCodes20 = [ + Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code, + Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code, + Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code, + Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code, + Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code, + Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, + Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code, + Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code, + Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code + ]; + errorCodeFixIdMap = { + // case #1: + [Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]: { + descriptions: Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers + }, + [Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: { + descriptions: Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers + }, + // case #2: + [Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]: { + descriptions: Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers + }, + [Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]: { + descriptions: Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: Diagnostics.Remove_override_modifier + }, + // case #3: + [Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]: { + descriptions: Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers + }, + [Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]: { + descriptions: Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: Diagnostics.Add_all_missing_override_modifiers + }, + // case #4: + [Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]: { + descriptions: Diagnostics.Add_override_modifier, + fixId: fixAddOverrideId, + fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers + }, + // case #5: + [Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]: { + descriptions: Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers + }, + [Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]: { + descriptions: Diagnostics.Remove_override_modifier, + fixId: fixRemoveOverrideId, + fixAllDescriptions: Diagnostics.Remove_all_unnecessary_override_modifiers + } + }; + registerCodeFix({ + errorCodes: errorCodes20, + getCodeActions: function getCodeActionsToFixOverrideModifierIssues(context2) { + const { errorCode, span } = context2; + const info2 = errorCodeFixIdMap[errorCode]; + if (!info2) + return emptyArray; + const { descriptions, fixId: fixId52, fixAllDescriptions } = info2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changes2) => dispatchChanges(changes2, context2, errorCode, span.start)); + return [ + createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions) + ]; + }, + fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes20, (changes, diag2) => { + const { code, start } = diag2; + const info2 = errorCodeFixIdMap[code]; + if (!info2 || info2.fixId !== context2.fixId) { + return; + } + dispatchChanges(changes, context2, code, start); + }) + }); + } + }); + function doChange14(changes, sourceFile, node, preferences) { + const quotePreference = getQuotePreference(sourceFile, preferences); + const argumentsExpression = factory.createStringLiteral( + node.name.text, + quotePreference === 0 + /* Single */ + ); + changes.replaceNode( + sourceFile, + node, + isPropertyAccessChain(node) ? factory.createElementAccessChain(node.expression, node.questionDotToken, argumentsExpression) : factory.createElementAccessExpression(node.expression, argumentsExpression) + ); + } + function getPropertyAccessExpression(sourceFile, pos) { + return cast(getTokenAtPosition(sourceFile, pos).parent, isPropertyAccessExpression); + } + var fixId18, errorCodes21; + var init_fixNoPropertyAccessFromIndexSignature = __esm2({ + "src/services/codefixes/fixNoPropertyAccessFromIndexSignature.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId18 = "fixNoPropertyAccessFromIndexSignature"; + errorCodes21 = [ + Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code + ]; + registerCodeFix({ + errorCodes: errorCodes21, + fixIds: [fixId18], + getCodeActions(context2) { + const { sourceFile, span, preferences } = context2; + const property2 = getPropertyAccessExpression(sourceFile, span.start); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange14(t8, context2.sourceFile, property2, preferences)); + return [createCodeFixAction(fixId18, changes, [Diagnostics.Use_element_access_for_0, property2.name.text], fixId18, Diagnostics.Use_element_access_for_all_undeclared_properties)]; + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes21, (changes, diag2) => doChange14(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context2.preferences)) + }); + } + }); + function doChange15(changes, sourceFile, pos, checker) { + const token = getTokenAtPosition(sourceFile, pos); + if (!isThis(token)) + return void 0; + const fn = getThisContainer( + token, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (!isFunctionDeclaration(fn) && !isFunctionExpression(fn)) + return void 0; + if (!isSourceFile(getThisContainer( + fn, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ))) { + const fnKeyword = Debug.checkDefined(findChildOfKind(fn, 100, sourceFile)); + const { name: name2 } = fn; + const body = Debug.checkDefined(fn.body); + if (isFunctionExpression(fn)) { + if (name2 && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(name2, checker, sourceFile, body)) { + return void 0; + } + changes.delete(sourceFile, fnKeyword); + if (name2) { + changes.delete(sourceFile, name2); + } + changes.insertText(sourceFile, body.pos, " =>"); + return [Diagnostics.Convert_function_expression_0_to_arrow_function, name2 ? name2.text : ANONYMOUS]; + } else { + changes.replaceNode(sourceFile, fnKeyword, factory.createToken( + 87 + /* ConstKeyword */ + )); + changes.insertText(sourceFile, name2.end, " = "); + changes.insertText(sourceFile, body.pos, " =>"); + return [Diagnostics.Convert_function_declaration_0_to_arrow_function, name2.text]; + } + } + } + var fixId19, errorCodes22; + var init_fixImplicitThis = __esm2({ + "src/services/codefixes/fixImplicitThis.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId19 = "fixImplicitThis"; + errorCodes22 = [Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code]; + registerCodeFix({ + errorCodes: errorCodes22, + getCodeActions: function getCodeActionsToFixImplicitThis(context2) { + const { sourceFile, program, span } = context2; + let diagnostic; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + diagnostic = doChange15(t8, sourceFile, span.start, program.getTypeChecker()); + }); + return diagnostic ? [createCodeFixAction(fixId19, changes, diagnostic, fixId19, Diagnostics.Fix_all_implicit_this_errors)] : emptyArray; + }, + fixIds: [fixId19], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes22, (changes, diag2) => { + doChange15(changes, diag2.file, diag2.start, context2.program.getTypeChecker()); + }) + }); + } + }); + function getInfo7(sourceFile, pos, program) { + var _a2, _b; + const token = getTokenAtPosition(sourceFile, pos); + if (isIdentifier(token)) { + const importDeclaration = findAncestor(token, isImportDeclaration); + if (importDeclaration === void 0) + return void 0; + const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier : void 0; + if (moduleSpecifier === void 0) + return void 0; + const resolvedModule = (_a2 = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier)) == null ? void 0 : _a2.resolvedModule; + if (resolvedModule === void 0) + return void 0; + const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName); + if (moduleSourceFile === void 0 || isSourceFileFromLibrary(program, moduleSourceFile)) + return void 0; + const moduleSymbol = moduleSourceFile.symbol; + const locals = (_b = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _b.locals; + if (locals === void 0) + return void 0; + const localSymbol = locals.get(token.escapedText); + if (localSymbol === void 0) + return void 0; + const node = getNodeOfSymbol(localSymbol); + if (node === void 0) + return void 0; + const exportName = { node: token, isTypeOnly: isTypeDeclaration(node) }; + return { exportName, node, moduleSourceFile, moduleSpecifier: moduleSpecifier.text }; + } + return void 0; + } + function doChange16(changes, program, { exportName, node, moduleSourceFile }) { + const exportDeclaration = tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly); + if (exportDeclaration) { + updateExport(changes, program, moduleSourceFile, exportDeclaration, [exportName]); + } else if (canHaveExportModifier(node)) { + changes.insertExportModifier(moduleSourceFile, node); + } else { + createExport(changes, program, moduleSourceFile, [exportName]); + } + } + function doChanges(changes, program, sourceFile, moduleExports4, node) { + if (length(moduleExports4)) { + if (node) { + updateExport(changes, program, sourceFile, node, moduleExports4); + } else { + createExport(changes, program, sourceFile, moduleExports4); + } + } + } + function tryGetExportDeclaration(sourceFile, isTypeOnly) { + const predicate = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly); + return findLast2(sourceFile.statements, predicate); + } + function updateExport(changes, program, sourceFile, node, names) { + const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]); + const allowTypeModifier = !node.isTypeOnly && !!(getIsolatedModules(program.getCompilerOptions()) || find2(namedExports, (e10) => e10.isTypeOnly)); + changes.replaceNode( + sourceFile, + node, + factory.updateExportDeclaration( + node, + node.modifiers, + node.isTypeOnly, + factory.createNamedExports( + factory.createNodeArray( + [...namedExports, ...createExportSpecifiers(names, allowTypeModifier)], + /*hasTrailingComma*/ + namedExports.hasTrailingComma + ) + ), + node.moduleSpecifier, + node.attributes + ) + ); + } + function createExport(changes, program, sourceFile, names) { + changes.insertNodeAtEndOfScope(sourceFile, sourceFile, factory.createExportDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + factory.createNamedExports(createExportSpecifiers( + names, + /*allowTypeModifier*/ + getIsolatedModules(program.getCompilerOptions()) + )), + /*moduleSpecifier*/ + void 0, + /*attributes*/ + void 0 + )); + } + function createExportSpecifiers(names, allowTypeModifier) { + return factory.createNodeArray(map4(names, (n7) => factory.createExportSpecifier( + allowTypeModifier && n7.isTypeOnly, + /*propertyName*/ + void 0, + n7.node + ))); + } + function getNodeOfSymbol(symbol) { + if (symbol.valueDeclaration === void 0) { + return firstOrUndefined(symbol.declarations); + } + const declaration = symbol.valueDeclaration; + const variableStatement = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : void 0; + return variableStatement && length(variableStatement.declarationList.declarations) === 1 ? variableStatement : declaration; + } + var fixId20, errorCodes23; + var init_fixImportNonExportedMember = __esm2({ + "src/services/codefixes/fixImportNonExportedMember.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId20 = "fixImportNonExportedMember"; + errorCodes23 = [ + Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported.code + ]; + registerCodeFix({ + errorCodes: errorCodes23, + fixIds: [fixId20], + getCodeActions(context2) { + const { sourceFile, span, program } = context2; + const info2 = getInfo7(sourceFile, span.start, program); + if (info2 === void 0) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange16(t8, program, info2)); + return [createCodeFixAction(fixId20, changes, [Diagnostics.Export_0_from_module_1, info2.exportName.node.text, info2.moduleSpecifier], fixId20, Diagnostics.Export_all_referenced_locals)]; + }, + getAllCodeActions(context2) { + const { program } = context2; + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + const exports29 = /* @__PURE__ */ new Map(); + eachDiagnostic(context2, errorCodes23, (diag2) => { + const info2 = getInfo7(diag2.file, diag2.start, program); + if (info2 === void 0) + return void 0; + const { exportName, node, moduleSourceFile } = info2; + if (tryGetExportDeclaration(moduleSourceFile, exportName.isTypeOnly) === void 0 && canHaveExportModifier(node)) { + changes.insertExportModifier(moduleSourceFile, node); + } else { + const moduleExports4 = exports29.get(moduleSourceFile) || { typeOnlyExports: [], exports: [] }; + if (exportName.isTypeOnly) { + moduleExports4.typeOnlyExports.push(exportName); + } else { + moduleExports4.exports.push(exportName); + } + exports29.set(moduleSourceFile, moduleExports4); + } + }); + exports29.forEach((moduleExports4, moduleSourceFile) => { + const exportDeclaration = tryGetExportDeclaration( + moduleSourceFile, + /*isTypeOnly*/ + true + ); + if (exportDeclaration && exportDeclaration.isTypeOnly) { + doChanges(changes, program, moduleSourceFile, moduleExports4.typeOnlyExports, exportDeclaration); + doChanges(changes, program, moduleSourceFile, moduleExports4.exports, tryGetExportDeclaration( + moduleSourceFile, + /*isTypeOnly*/ + false + )); + } else { + doChanges(changes, program, moduleSourceFile, [...moduleExports4.exports, ...moduleExports4.typeOnlyExports], exportDeclaration); + } + }); + })); + } + }); + } + }); + function getNamedTupleMember(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + return findAncestor( + token, + (t8) => t8.kind === 202 + /* NamedTupleMember */ + ); + } + function doChange17(changes, sourceFile, namedTupleMember) { + if (!namedTupleMember) { + return; + } + let unwrappedType = namedTupleMember.type; + let sawOptional = false; + let sawRest = false; + while (unwrappedType.kind === 190 || unwrappedType.kind === 191 || unwrappedType.kind === 196) { + if (unwrappedType.kind === 190) { + sawOptional = true; + } else if (unwrappedType.kind === 191) { + sawRest = true; + } + unwrappedType = unwrappedType.type; + } + const updated = factory.updateNamedTupleMember( + namedTupleMember, + namedTupleMember.dotDotDotToken || (sawRest ? factory.createToken( + 26 + /* DotDotDotToken */ + ) : void 0), + namedTupleMember.name, + namedTupleMember.questionToken || (sawOptional ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0), + unwrappedType + ); + if (updated === namedTupleMember) { + return; + } + changes.replaceNode(sourceFile, namedTupleMember, updated); + } + var fixId21, errorCodes24; + var init_fixIncorrectNamedTupleSyntax = __esm2({ + "src/services/codefixes/fixIncorrectNamedTupleSyntax.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId21 = "fixIncorrectNamedTupleSyntax"; + errorCodes24 = [ + Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code, + Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code + ]; + registerCodeFix({ + errorCodes: errorCodes24, + getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context2) { + const { sourceFile, span } = context2; + const namedTupleMember = getNamedTupleMember(sourceFile, span.start); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange17(t8, sourceFile, namedTupleMember)); + return [createCodeFixAction(fixId21, changes, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels, fixId21, Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]; + }, + fixIds: [fixId21] + }); + } + }); + function getInfo8(sourceFile, pos, context2, errorCode) { + const node = getTokenAtPosition(sourceFile, pos); + const parent22 = node.parent; + if ((errorCode === Diagnostics.No_overload_matches_this_call.code || errorCode === Diagnostics.Type_0_is_not_assignable_to_type_1.code) && !isJsxAttribute(parent22)) + return void 0; + const checker = context2.program.getTypeChecker(); + let suggestedSymbol; + if (isPropertyAccessExpression(parent22) && parent22.name === node) { + Debug.assert(isMemberName(node), "Expected an identifier for spelling (property access)"); + let containingType = checker.getTypeAtLocation(parent22.expression); + if (parent22.flags & 64) { + containingType = checker.getNonNullableType(containingType); + } + suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, containingType); + } else if (isBinaryExpression(parent22) && parent22.operatorToken.kind === 103 && parent22.left === node && isPrivateIdentifier(node)) { + const receiverType = checker.getTypeAtLocation(parent22.right); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentProperty(node, receiverType); + } else if (isQualifiedName(parent22) && parent22.right === node) { + const symbol = checker.getSymbolAtLocation(parent22.left); + if (symbol && symbol.flags & 1536) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(parent22.right, symbol); + } + } else if (isImportSpecifier(parent22) && parent22.name === node) { + Debug.assertNode(node, isIdentifier, "Expected an identifier for spelling (import)"); + const importDeclaration = findAncestor(node, isImportDeclaration); + const resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(context2, importDeclaration); + if (resolvedSourceFile && resolvedSourceFile.symbol) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentModule(node, resolvedSourceFile.symbol); + } + } else if (isJsxAttribute(parent22) && parent22.name === node) { + Debug.assertNode(node, isIdentifier, "Expected an identifier for JSX attribute"); + const tag = findAncestor(node, isJsxOpeningLikeElement); + const props = checker.getContextualTypeForArgumentAtIndex(tag, 0); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentJSXAttribute(node, props); + } else if (hasOverrideModifier(parent22) && isClassElement(parent22) && parent22.name === node) { + const baseDeclaration = findAncestor(node, isClassLike); + const baseTypeNode = baseDeclaration ? getEffectiveBaseTypeNode(baseDeclaration) : void 0; + const baseType = baseTypeNode ? checker.getTypeAtLocation(baseTypeNode) : void 0; + if (baseType) { + suggestedSymbol = checker.getSuggestedSymbolForNonexistentClassMember(getTextOfNode(node), baseType); + } + } else { + const meaning = getMeaningFromLocation(node); + const name2 = getTextOfNode(node); + Debug.assert(name2 !== void 0, "name should be defined"); + suggestedSymbol = checker.getSuggestedSymbolForNonexistentSymbol(node, name2, convertSemanticMeaningToSymbolFlags(meaning)); + } + return suggestedSymbol === void 0 ? void 0 : { node, suggestedSymbol }; + } + function doChange18(changes, sourceFile, node, suggestedSymbol, target) { + const suggestion = symbolName(suggestedSymbol); + if (!isIdentifierText(suggestion, target) && isPropertyAccessExpression(node.parent)) { + const valDecl = suggestedSymbol.valueDeclaration; + if (valDecl && isNamedDeclaration(valDecl) && isPrivateIdentifier(valDecl.name)) { + changes.replaceNode(sourceFile, node, factory.createIdentifier(suggestion)); + } else { + changes.replaceNode(sourceFile, node.parent, factory.createElementAccessExpression(node.parent.expression, factory.createStringLiteral(suggestion))); + } + } else { + changes.replaceNode(sourceFile, node, factory.createIdentifier(suggestion)); + } + } + function convertSemanticMeaningToSymbolFlags(meaning) { + let flags = 0; + if (meaning & 4) { + flags |= 1920; + } + if (meaning & 2) { + flags |= 788968; + } + if (meaning & 1) { + flags |= 111551; + } + return flags; + } + function getResolvedSourceFileFromImportDeclaration(context2, importDeclaration) { + var _a2; + if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier)) + return void 0; + const resolvedModule = (_a2 = context2.program.getResolvedModuleFromModuleSpecifier(importDeclaration.moduleSpecifier)) == null ? void 0 : _a2.resolvedModule; + if (!resolvedModule) + return void 0; + return context2.program.getSourceFile(resolvedModule.resolvedFileName); + } + var fixId22, errorCodes25; + var init_fixSpelling = __esm2({ + "src/services/codefixes/fixSpelling.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId22 = "fixSpelling"; + errorCodes25 = [ + Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + Diagnostics.Could_not_find_name_0_Did_you_mean_1.code, + Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code, + Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code, + Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code, + Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code, + // for JSX class components + Diagnostics.No_overload_matches_this_call.code, + // for JSX FC + Diagnostics.Type_0_is_not_assignable_to_type_1.code + ]; + registerCodeFix({ + errorCodes: errorCodes25, + getCodeActions(context2) { + const { sourceFile, errorCode } = context2; + const info2 = getInfo8(sourceFile, context2.span.start, context2, errorCode); + if (!info2) + return void 0; + const { node, suggestedSymbol } = info2; + const target = getEmitScriptTarget(context2.host.getCompilationSettings()); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange18(t8, sourceFile, node, suggestedSymbol, target)); + return [createCodeFixAction("spelling", changes, [Diagnostics.Change_spelling_to_0, symbolName(suggestedSymbol)], fixId22, Diagnostics.Fix_all_detected_spelling_errors)]; + }, + fixIds: [fixId22], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes25, (changes, diag2) => { + const info2 = getInfo8(diag2.file, diag2.start, context2, diag2.code); + const target = getEmitScriptTarget(context2.host.getCompilationSettings()); + if (info2) + doChange18(changes, context2.sourceFile, info2.node, info2.suggestedSymbol, target); + }) + }); + } + }); + function createObjectTypeFromLabeledExpression(checker, label, expression) { + const member = checker.createSymbol(4, label.escapedText); + member.links.type = checker.getTypeAtLocation(expression); + const members = createSymbolTable([member]); + return checker.createAnonymousType( + /*symbol*/ + void 0, + members, + [], + [], + [] + ); + } + function getFixInfo(checker, declaration, expectType, isFunctionType) { + if (!declaration.body || !isBlock2(declaration.body) || length(declaration.body.statements) !== 1) + return void 0; + const firstStatement = first(declaration.body.statements); + if (isExpressionStatement(firstStatement) && checkFixedAssignableTo(checker, declaration, checker.getTypeAtLocation(firstStatement.expression), expectType, isFunctionType)) { + return { + declaration, + kind: 0, + expression: firstStatement.expression, + statement: firstStatement, + commentSource: firstStatement.expression + }; + } else if (isLabeledStatement(firstStatement) && isExpressionStatement(firstStatement.statement)) { + const node = factory.createObjectLiteralExpression([factory.createPropertyAssignment(firstStatement.label, firstStatement.statement.expression)]); + const nodeType = createObjectTypeFromLabeledExpression(checker, firstStatement.label, firstStatement.statement.expression); + if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { + return isArrowFunction(declaration) ? { + declaration, + kind: 1, + expression: node, + statement: firstStatement, + commentSource: firstStatement.statement.expression + } : { + declaration, + kind: 0, + expression: node, + statement: firstStatement, + commentSource: firstStatement.statement.expression + }; + } + } else if (isBlock2(firstStatement) && length(firstStatement.statements) === 1) { + const firstBlockStatement = first(firstStatement.statements); + if (isLabeledStatement(firstBlockStatement) && isExpressionStatement(firstBlockStatement.statement)) { + const node = factory.createObjectLiteralExpression([factory.createPropertyAssignment(firstBlockStatement.label, firstBlockStatement.statement.expression)]); + const nodeType = createObjectTypeFromLabeledExpression(checker, firstBlockStatement.label, firstBlockStatement.statement.expression); + if (checkFixedAssignableTo(checker, declaration, nodeType, expectType, isFunctionType)) { + return { + declaration, + kind: 0, + expression: node, + statement: firstStatement, + commentSource: firstBlockStatement + }; + } + } + } + return void 0; + } + function checkFixedAssignableTo(checker, declaration, exprType, type3, isFunctionType) { + if (isFunctionType) { + const sig = checker.getSignatureFromDeclaration(declaration); + if (sig) { + if (hasSyntacticModifier( + declaration, + 1024 + /* Async */ + )) { + exprType = checker.createPromiseType(exprType); + } + const newSig = checker.createSignature( + declaration, + sig.typeParameters, + sig.thisParameter, + sig.parameters, + exprType, + /*typePredicate*/ + void 0, + sig.minArgumentCount, + sig.flags + ); + exprType = checker.createAnonymousType( + /*symbol*/ + void 0, + createSymbolTable(), + [newSig], + [], + [] + ); + } else { + exprType = checker.getAnyType(); + } + } + return checker.isTypeAssignableTo(exprType, type3); + } + function getInfo9(checker, sourceFile, position, errorCode) { + const node = getTokenAtPosition(sourceFile, position); + if (!node.parent) + return void 0; + const declaration = findAncestor(node.parent, isFunctionLikeDeclaration); + switch (errorCode) { + case Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code: + if (!declaration || !declaration.body || !declaration.type || !rangeContainsRange(declaration.type, node)) + return void 0; + return getFixInfo( + checker, + declaration, + checker.getTypeFromTypeNode(declaration.type), + /*isFunctionType*/ + false + ); + case Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code: + if (!declaration || !isCallExpression(declaration.parent) || !declaration.body) + return void 0; + const pos = declaration.parent.arguments.indexOf(declaration); + if (pos === -1) + return void 0; + const type3 = checker.getContextualTypeForArgumentAtIndex(declaration.parent, pos); + if (!type3) + return void 0; + return getFixInfo( + checker, + declaration, + type3, + /*isFunctionType*/ + true + ); + case Diagnostics.Type_0_is_not_assignable_to_type_1.code: + if (!isDeclarationName(node) || !isVariableLike(node.parent) && !isJsxAttribute(node.parent)) + return void 0; + const initializer = getVariableLikeInitializer(node.parent); + if (!initializer || !isFunctionLikeDeclaration(initializer) || !initializer.body) + return void 0; + return getFixInfo( + checker, + initializer, + checker.getTypeAtLocation(node.parent), + /*isFunctionType*/ + true + ); + } + return void 0; + } + function getVariableLikeInitializer(declaration) { + switch (declaration.kind) { + case 260: + case 169: + case 208: + case 172: + case 303: + return declaration.initializer; + case 291: + return declaration.initializer && (isJsxExpression(declaration.initializer) ? declaration.initializer.expression : void 0); + case 304: + case 171: + case 306: + case 355: + case 348: + return void 0; + } + } + function addReturnStatement(changes, sourceFile, expression, statement) { + suppressLeadingAndTrailingTrivia(expression); + const probablyNeedSemi = probablyUsesSemicolons(sourceFile); + changes.replaceNode(sourceFile, statement, factory.createReturnStatement(expression), { + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude, + suffix: probablyNeedSemi ? ";" : void 0 + }); + } + function removeBlockBodyBrace(changes, sourceFile, declaration, expression, commentSource, withParen) { + const newBody = withParen || needsParentheses(expression) ? factory.createParenthesizedExpression(expression) : expression; + suppressLeadingAndTrailingTrivia(commentSource); + copyComments(commentSource, newBody); + changes.replaceNode(sourceFile, declaration.body, newBody); + } + function wrapBlockWithParen(changes, sourceFile, declaration, expression) { + changes.replaceNode(sourceFile, declaration.body, factory.createParenthesizedExpression(expression)); + } + function getActionForfixAddReturnStatement(context2, expression, statement) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addReturnStatement(t8, context2.sourceFile, expression, statement)); + return createCodeFixAction(fixId23, changes, Diagnostics.Add_a_return_statement, fixIdAddReturnStatement, Diagnostics.Add_all_missing_return_statement); + } + function getActionForFixRemoveBracesFromArrowFunctionBody(context2, declaration, expression, commentSource) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => removeBlockBodyBrace( + t8, + context2.sourceFile, + declaration, + expression, + commentSource, + /*withParen*/ + false + )); + return createCodeFixAction(fixId23, changes, Diagnostics.Remove_braces_from_arrow_function_body, fixRemoveBracesFromArrowFunctionBody, Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues); + } + function getActionForfixWrapTheBlockWithParen(context2, declaration, expression) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => wrapBlockWithParen(t8, context2.sourceFile, declaration, expression)); + return createCodeFixAction(fixId23, changes, Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal, fixIdWrapTheBlockWithParen, Diagnostics.Wrap_all_object_literal_with_parentheses); + } + var fixId23, fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen, errorCodes26; + var init_returnValueCorrect = __esm2({ + "src/services/codefixes/returnValueCorrect.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId23 = "returnValueCorrect"; + fixIdAddReturnStatement = "fixAddReturnStatement"; + fixRemoveBracesFromArrowFunctionBody = "fixRemoveBracesFromArrowFunctionBody"; + fixIdWrapTheBlockWithParen = "fixWrapTheBlockWithParen"; + errorCodes26 = [ + Diagnostics.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code, + Diagnostics.Type_0_is_not_assignable_to_type_1.code, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code + ]; + registerCodeFix({ + errorCodes: errorCodes26, + fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen], + getCodeActions: function getCodeActionsToCorrectReturnValue(context2) { + const { program, sourceFile, span: { start }, errorCode } = context2; + const info2 = getInfo9(program.getTypeChecker(), sourceFile, start, errorCode); + if (!info2) + return void 0; + if (info2.kind === 0) { + return append( + [getActionForfixAddReturnStatement(context2, info2.expression, info2.statement)], + isArrowFunction(info2.declaration) ? getActionForFixRemoveBracesFromArrowFunctionBody(context2, info2.declaration, info2.expression, info2.commentSource) : void 0 + ); + } else { + return [getActionForfixWrapTheBlockWithParen(context2, info2.declaration, info2.expression)]; + } + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes26, (changes, diag2) => { + const info2 = getInfo9(context2.program.getTypeChecker(), diag2.file, diag2.start, diag2.code); + if (!info2) + return void 0; + switch (context2.fixId) { + case fixIdAddReturnStatement: + addReturnStatement(changes, diag2.file, info2.expression, info2.statement); + break; + case fixRemoveBracesFromArrowFunctionBody: + if (!isArrowFunction(info2.declaration)) + return void 0; + removeBlockBodyBrace( + changes, + diag2.file, + info2.declaration, + info2.expression, + info2.commentSource, + /*withParen*/ + false + ); + break; + case fixIdWrapTheBlockWithParen: + if (!isArrowFunction(info2.declaration)) + return void 0; + wrapBlockWithParen(changes, diag2.file, info2.declaration, info2.expression); + break; + default: + Debug.fail(JSON.stringify(context2.fixId)); + } + }) + }); + } + }); + function getInfo10(sourceFile, tokenPos, errorCode, checker, program) { + var _a2; + const token = getTokenAtPosition(sourceFile, tokenPos); + const parent22 = token.parent; + if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) { + if (!(token.kind === 19 && isObjectLiteralExpression(parent22) && isCallExpression(parent22.parent))) + return void 0; + const argIndex = findIndex2(parent22.parent.arguments, (arg) => arg === parent22); + if (argIndex < 0) + return void 0; + const signature = checker.getResolvedSignature(parent22.parent); + if (!(signature && signature.declaration && signature.parameters[argIndex])) + return void 0; + const param = signature.parameters[argIndex].valueDeclaration; + if (!(param && isParameter(param) && isIdentifier(param.name))) + return void 0; + const properties = arrayFrom(checker.getUnmatchedProperties( + checker.getTypeAtLocation(parent22), + checker.getParameterType(signature, argIndex), + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + false + )); + if (!length(properties)) + return void 0; + return { kind: 3, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent22 }; + } + if (token.kind === 19 && isObjectLiteralExpression(parent22)) { + const targetType = checker.getContextualType(parent22) || checker.getTypeAtLocation(parent22); + const properties = arrayFrom(checker.getUnmatchedProperties( + checker.getTypeAtLocation(parent22), + targetType, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + false + )); + if (!length(properties)) + return void 0; + const identifier = ""; + return { kind: 3, token: parent22, identifier, properties, parentDeclaration: parent22 }; + } + if (!isMemberName(token)) + return void 0; + if (isIdentifier(token) && hasInitializer(parent22) && parent22.initializer && isObjectLiteralExpression(parent22.initializer)) { + const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token); + const properties = arrayFrom(checker.getUnmatchedProperties( + checker.getTypeAtLocation(parent22.initializer), + targetType, + /*requireOptionalProperties*/ + false, + /*matchDiscriminantProperties*/ + false + )); + if (!length(properties)) + return void 0; + return { kind: 3, token, identifier: token.text, properties, parentDeclaration: parent22.initializer }; + } + if (isIdentifier(token) && isJsxOpeningLikeElement(token.parent)) { + const target = getEmitScriptTarget(program.getCompilerOptions()); + const attributes = getUnmatchedAttributes(checker, target, token.parent); + if (!length(attributes)) + return void 0; + return { kind: 4, token, attributes, parentDeclaration: token.parent }; + } + if (isIdentifier(token)) { + const type3 = (_a2 = checker.getContextualType(token)) == null ? void 0 : _a2.getNonNullableType(); + if (type3 && getObjectFlags(type3) & 16) { + const signature = firstOrUndefined(checker.getSignaturesOfType( + type3, + 0 + /* Call */ + )); + if (signature === void 0) + return void 0; + return { kind: 5, token, signature, sourceFile, parentDeclaration: findScope(token) }; + } + if (isCallExpression(parent22) && parent22.expression === token) { + return { kind: 2, token, call: parent22, sourceFile, modifierFlags: 0, parentDeclaration: findScope(token) }; + } + } + if (!isPropertyAccessExpression(parent22)) + return void 0; + const leftExpressionType = skipConstraint(checker.getTypeAtLocation(parent22.expression)); + const symbol = leftExpressionType.symbol; + if (!symbol || !symbol.declarations) + return void 0; + if (isIdentifier(token) && isCallExpression(parent22.parent)) { + const moduleDeclaration = find2(symbol.declarations, isModuleDeclaration); + const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile(); + if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) { + return { kind: 2, token, call: parent22.parent, sourceFile, modifierFlags: 32, parentDeclaration: moduleDeclaration }; + } + const moduleSourceFile = find2(symbol.declarations, isSourceFile); + if (sourceFile.commonJsModuleIndicator) + return void 0; + if (moduleSourceFile && !isSourceFileFromLibrary(program, moduleSourceFile)) { + return { kind: 2, token, call: parent22.parent, sourceFile: moduleSourceFile, modifierFlags: 32, parentDeclaration: moduleSourceFile }; + } + } + const classDeclaration = find2(symbol.declarations, isClassLike); + if (!classDeclaration && isPrivateIdentifier(token)) + return void 0; + const declaration = classDeclaration || find2(symbol.declarations, (d7) => isInterfaceDeclaration(d7) || isTypeLiteralNode(d7)); + if (declaration && !isSourceFileFromLibrary(program, declaration.getSourceFile())) { + const makeStatic = !isTypeLiteralNode(declaration) && (leftExpressionType.target || leftExpressionType) !== checker.getDeclaredTypeOfSymbol(symbol); + if (makeStatic && (isPrivateIdentifier(token) || isInterfaceDeclaration(declaration))) + return void 0; + const declSourceFile = declaration.getSourceFile(); + const modifierFlags = isTypeLiteralNode(declaration) ? 0 : (makeStatic ? 256 : 0) | (startsWithUnderscore(token.text) ? 2 : 0); + const isJSFile = isSourceFileJS(declSourceFile); + const call = tryCast(parent22.parent, isCallExpression); + return { kind: 0, token, call, modifierFlags, parentDeclaration: declaration, declSourceFile, isJSFile }; + } + const enumDeclaration = find2(symbol.declarations, isEnumDeclaration); + if (enumDeclaration && !(leftExpressionType.flags & 1056) && !isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) { + return { kind: 1, token, parentDeclaration: enumDeclaration }; + } + return void 0; + } + function getActionsForMissingMemberDeclaration(context2, info2) { + return info2.isJSFile ? singleElementArray(createActionForAddMissingMemberInJavascriptFile(context2, info2)) : createActionsForAddMissingMemberInTypeScriptFile(context2, info2); + } + function createActionForAddMissingMemberInJavascriptFile(context2, { parentDeclaration, declSourceFile, modifierFlags, token }) { + if (isInterfaceDeclaration(parentDeclaration) || isTypeLiteralNode(parentDeclaration)) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMissingMemberInJs(t8, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256))); + if (changes.length === 0) { + return void 0; + } + const diagnostic = modifierFlags & 256 ? Diagnostics.Initialize_static_property_0 : isPrivateIdentifier(token) ? Diagnostics.Declare_a_private_field_named_0 : Diagnostics.Initialize_property_0_in_the_constructor; + return createCodeFixAction(fixMissingMember, changes, [diagnostic, token.text], fixMissingMember, Diagnostics.Add_all_missing_members); + } + function addMissingMemberInJs(changeTracker, sourceFile, classDeclaration, token, makeStatic) { + const tokenName = token.text; + if (makeStatic) { + if (classDeclaration.kind === 231) { + return; + } + const className = classDeclaration.name.getText(); + const staticInitialization = initializePropertyToUndefined(factory.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(sourceFile, classDeclaration, staticInitialization); + } else if (isPrivateIdentifier(token)) { + const property2 = factory.createPropertyDeclaration( + /*modifiers*/ + void 0, + tokenName, + /*questionOrExclamationToken*/ + void 0, + /*type*/ + void 0, + /*initializer*/ + void 0 + ); + const lastProp = getNodeToInsertPropertyAfter(classDeclaration); + if (lastProp) { + changeTracker.insertNodeAfter(sourceFile, lastProp, property2); + } else { + changeTracker.insertMemberAtStart(sourceFile, classDeclaration, property2); + } + } else { + const classConstructor = getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; + } + const propertyInitialization = initializePropertyToUndefined(factory.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(sourceFile, classConstructor, propertyInitialization); + } + } + function initializePropertyToUndefined(obj, propertyName) { + return factory.createExpressionStatement(factory.createAssignment(factory.createPropertyAccessExpression(obj, propertyName), createUndefined())); + } + function createActionsForAddMissingMemberInTypeScriptFile(context2, { parentDeclaration, declSourceFile, modifierFlags, token }) { + const memberName = token.text; + const isStatic2 = modifierFlags & 256; + const typeNode = getTypeNode2(context2.program.getTypeChecker(), parentDeclaration, token); + const addPropertyDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addPropertyDeclaration(t8, declSourceFile, parentDeclaration, memberName, typeNode, modifierFlags2)); + const actions2 = [createCodeFixAction(fixMissingMember, addPropertyDeclarationChanges( + modifierFlags & 256 + /* Static */ + ), [isStatic2 ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0, memberName], fixMissingMember, Diagnostics.Add_all_missing_members)]; + if (isStatic2 || isPrivateIdentifier(token)) { + return actions2; + } + if (modifierFlags & 2) { + actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addPropertyDeclarationChanges( + 2 + /* Private */ + ), [Diagnostics.Declare_private_property_0, memberName])); + } + actions2.push(createAddIndexSignatureAction(context2, declSourceFile, parentDeclaration, token.text, typeNode)); + return actions2; + } + function getTypeNode2(checker, node, token) { + let typeNode; + if (token.parent.parent.kind === 226) { + const binaryExpression = token.parent.parent; + const otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + const widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode( + widenedType, + node, + 1 + /* NoTruncation */ + ); + } else { + const contextualType = checker.getContextualType(token.parent); + typeNode = contextualType ? checker.typeToTypeNode( + contextualType, + /*enclosingDeclaration*/ + void 0, + 1 + /* NoTruncation */ + ) : void 0; + } + return typeNode || factory.createKeywordTypeNode( + 133 + /* AnyKeyword */ + ); + } + function addPropertyDeclaration(changeTracker, sourceFile, node, tokenName, typeNode, modifierFlags) { + const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; + const property2 = isClassLike(node) ? factory.createPropertyDeclaration( + modifiers, + tokenName, + /*questionOrExclamationToken*/ + void 0, + typeNode, + /*initializer*/ + void 0 + ) : factory.createPropertySignature( + /*modifiers*/ + void 0, + tokenName, + /*questionToken*/ + void 0, + typeNode + ); + const lastProp = getNodeToInsertPropertyAfter(node); + if (lastProp) { + changeTracker.insertNodeAfter(sourceFile, lastProp, property2); + } else { + changeTracker.insertMemberAtStart(sourceFile, node, property2); + } + } + function getNodeToInsertPropertyAfter(node) { + let res; + for (const member of node.members) { + if (!isPropertyDeclaration(member)) + break; + res = member; + } + return res; + } + function createAddIndexSignatureAction(context2, sourceFile, node, tokenName, typeNode) { + const stringTypeNode = factory.createKeywordTypeNode( + 154 + /* StringKeyword */ + ); + const indexingParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + "x", + /*questionToken*/ + void 0, + stringTypeNode, + /*initializer*/ + void 0 + ); + const indexSignature = factory.createIndexSignature( + /*modifiers*/ + void 0, + [indexingParameter], + typeNode + ); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.insertMemberAtStart(sourceFile, node, indexSignature)); + return createCodeFixActionWithoutFixAll(fixMissingMember, changes, [Diagnostics.Add_index_signature_for_property_0, tokenName]); + } + function getActionsForMissingMethodDeclaration(context2, info2) { + const { parentDeclaration, declSourceFile, modifierFlags, token, call } = info2; + if (call === void 0) { + return void 0; + } + const methodName = token.text; + const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMethodDeclaration(context2, t8, call, token, modifierFlags2, parentDeclaration, declSourceFile)); + const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges( + modifierFlags & 256 + /* Static */ + ), [modifierFlags & 256 ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)]; + if (modifierFlags & 2) { + actions2.unshift(createCodeFixActionWithoutFixAll(fixMissingMember, addMethodDeclarationChanges( + 2 + /* Private */ + ), [Diagnostics.Declare_private_method_0, methodName])); + } + return actions2; + } + function addMethodDeclaration(context2, changes, callExpression, name2, modifierFlags, parentDeclaration, sourceFile) { + const importAdder = createImportAdder(sourceFile, context2.program, context2.preferences, context2.host); + const kind = isClassLike(parentDeclaration) ? 174 : 173; + const signatureDeclaration = createSignatureDeclarationFromCallExpression(kind, context2, importAdder, callExpression, name2, modifierFlags, parentDeclaration); + const containingMethodDeclaration = tryGetContainingMethodDeclaration(parentDeclaration, callExpression); + if (containingMethodDeclaration) { + changes.insertNodeAfter(sourceFile, containingMethodDeclaration, signatureDeclaration); + } else { + changes.insertMemberAtStart(sourceFile, parentDeclaration, signatureDeclaration); + } + importAdder.writeFixes(changes); + } + function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }) { + const hasStringInitializer = some2(parentDeclaration.members, (member) => { + const type3 = checker.getTypeAtLocation(member); + return !!(type3 && type3.flags & 402653316); + }); + const sourceFile = parentDeclaration.getSourceFile(); + const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0); + const last22 = lastOrUndefined(parentDeclaration.members); + if (last22) { + changes.insertNodeInListAfter(sourceFile, last22, enumMember, parentDeclaration.members); + } else { + changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember); + } + } + function addFunctionDeclaration(changes, context2, info2) { + const quotePreference = getQuotePreference(context2.sourceFile, context2.preferences); + const importAdder = createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + const functionDeclaration = info2.kind === 2 ? createSignatureDeclarationFromCallExpression(262, context2, importAdder, info2.call, idText(info2.token), info2.modifierFlags, info2.parentDeclaration) : createSignatureDeclarationFromSignature( + 262, + context2, + quotePreference, + info2.signature, + createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), + info2.token, + /*modifiers*/ + void 0, + /*optional*/ + void 0, + /*enclosingDeclaration*/ + void 0, + importAdder + ); + if (functionDeclaration === void 0) { + Debug.fail("fixMissingFunctionDeclaration codefix got unexpected error."); + } + isReturnStatement(info2.parentDeclaration) ? changes.insertNodeBefore( + info2.sourceFile, + info2.parentDeclaration, + functionDeclaration, + /*blankLineBetween*/ + true + ) : changes.insertNodeAtEndOfScope(info2.sourceFile, info2.parentDeclaration, functionDeclaration); + importAdder.writeFixes(changes); + } + function addJsxAttributes(changes, context2, info2) { + const importAdder = createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + const quotePreference = getQuotePreference(context2.sourceFile, context2.preferences); + const checker = context2.program.getTypeChecker(); + const jsxAttributesNode = info2.parentDeclaration.attributes; + const hasSpreadAttribute = some2(jsxAttributesNode.properties, isJsxSpreadAttribute); + const attrs = map4(info2.attributes, (attr) => { + const value2 = tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeOfSymbol(attr), info2.parentDeclaration); + const name2 = factory.createIdentifier(attr.name); + const jsxAttribute = factory.createJsxAttribute(name2, factory.createJsxExpression( + /*dotDotDotToken*/ + void 0, + value2 + )); + setParent(name2, jsxAttribute); + return jsxAttribute; + }); + const jsxAttributes = factory.createJsxAttributes(hasSpreadAttribute ? [...attrs, ...jsxAttributesNode.properties] : [...jsxAttributesNode.properties, ...attrs]); + const options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : void 0 }; + changes.replaceNode(context2.sourceFile, jsxAttributesNode, jsxAttributes, options); + importAdder.writeFixes(changes); + } + function addObjectLiteralProperties(changes, context2, info2) { + const importAdder = createImportAdder(context2.sourceFile, context2.program, context2.preferences, context2.host); + const quotePreference = getQuotePreference(context2.sourceFile, context2.preferences); + const target = getEmitScriptTarget(context2.program.getCompilerOptions()); + const checker = context2.program.getTypeChecker(); + const props = map4(info2.properties, (prop) => { + const initializer = tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), info2.parentDeclaration); + return factory.createPropertyAssignment(createPropertyNameFromSymbol(prop, target, quotePreference, checker), initializer); + }); + const options = { + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude, + indentation: info2.indentation + }; + changes.replaceNode(context2.sourceFile, info2.parentDeclaration, factory.createObjectLiteralExpression( + [...info2.parentDeclaration.properties, ...props], + /*multiLine*/ + true + ), options); + importAdder.writeFixes(changes); + } + function tryGetValueFromType(context2, checker, importAdder, quotePreference, type3, enclosingDeclaration) { + if (type3.flags & 3) { + return createUndefined(); + } + if (type3.flags & (4 | 134217728)) { + return factory.createStringLiteral( + "", + /* isSingleQuote */ + quotePreference === 0 + /* Single */ + ); + } + if (type3.flags & 8) { + return factory.createNumericLiteral(0); + } + if (type3.flags & 64) { + return factory.createBigIntLiteral("0n"); + } + if (type3.flags & 16) { + return factory.createFalse(); + } + if (type3.flags & 1056) { + const enumMember = type3.symbol.exports ? firstOrUndefinedIterator(type3.symbol.exports.values()) : type3.symbol; + const name2 = checker.symbolToExpression( + type3.symbol.parent ? type3.symbol.parent : type3.symbol, + 111551, + /*enclosingDeclaration*/ + void 0, + /*flags*/ + 64 + /* UseFullyQualifiedType */ + ); + return enumMember === void 0 || name2 === void 0 ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name2, checker.symbolToString(enumMember)); + } + if (type3.flags & 256) { + return factory.createNumericLiteral(type3.value); + } + if (type3.flags & 2048) { + return factory.createBigIntLiteral(type3.value); + } + if (type3.flags & 128) { + return factory.createStringLiteral( + type3.value, + /* isSingleQuote */ + quotePreference === 0 + /* Single */ + ); + } + if (type3.flags & 512) { + return type3 === checker.getFalseType() || type3 === checker.getFalseType( + /*fresh*/ + true + ) ? factory.createFalse() : factory.createTrue(); + } + if (type3.flags & 65536) { + return factory.createNull(); + } + if (type3.flags & 1048576) { + const expression = firstDefined(type3.types, (t8) => tryGetValueFromType(context2, checker, importAdder, quotePreference, t8, enclosingDeclaration)); + return expression ?? createUndefined(); + } + if (checker.isArrayLikeType(type3)) { + return factory.createArrayLiteralExpression(); + } + if (isObjectLiteralType(type3)) { + const props = map4(checker.getPropertiesOfType(type3), (prop) => { + const initializer = tryGetValueFromType(context2, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop), enclosingDeclaration); + return factory.createPropertyAssignment(prop.name, initializer); + }); + return factory.createObjectLiteralExpression( + props, + /*multiLine*/ + true + ); + } + if (getObjectFlags(type3) & 16) { + const decl = find2(type3.symbol.declarations || emptyArray, or(isFunctionTypeNode, isMethodSignature, isMethodDeclaration)); + if (decl === void 0) + return createUndefined(); + const signature = checker.getSignaturesOfType( + type3, + 0 + /* Call */ + ); + if (signature === void 0) + return createUndefined(); + const func = createSignatureDeclarationFromSignature( + 218, + context2, + quotePreference, + signature[0], + createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference), + /*name*/ + void 0, + /*modifiers*/ + void 0, + /*optional*/ + void 0, + /*enclosingDeclaration*/ + enclosingDeclaration, + importAdder + ); + return func ?? createUndefined(); + } + if (getObjectFlags(type3) & 1) { + const classDeclaration = getClassLikeDeclarationOfSymbol(type3.symbol); + if (classDeclaration === void 0 || hasAbstractModifier(classDeclaration)) + return createUndefined(); + const constructorDeclaration = getFirstConstructorWithBody(classDeclaration); + if (constructorDeclaration && length(constructorDeclaration.parameters)) + return createUndefined(); + return factory.createNewExpression( + factory.createIdentifier(type3.symbol.name), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + } + return createUndefined(); + } + function createUndefined() { + return factory.createIdentifier("undefined"); + } + function isObjectLiteralType(type3) { + return type3.flags & 524288 && (getObjectFlags(type3) & 128 || type3.symbol && tryCast(singleOrUndefined(type3.symbol.declarations), isTypeLiteralNode)); + } + function getUnmatchedAttributes(checker, target, source) { + const attrsType = checker.getContextualType(source.attributes); + if (attrsType === void 0) + return emptyArray; + const targetProps = attrsType.getProperties(); + if (!length(targetProps)) + return emptyArray; + const seenNames = /* @__PURE__ */ new Set(); + for (const sourceProp of source.attributes.properties) { + if (isJsxAttribute(sourceProp)) { + seenNames.add(getEscapedTextOfJsxAttributeName(sourceProp.name)); + } + if (isJsxSpreadAttribute(sourceProp)) { + const type3 = checker.getTypeAtLocation(sourceProp.expression); + for (const prop of type3.getProperties()) { + seenNames.add(prop.escapedName); + } + } + } + return filter2(targetProps, (targetProp) => isIdentifierText( + targetProp.name, + target, + 1 + /* JSX */ + ) && !(targetProp.flags & 16777216 || getCheckFlags(targetProp) & 48 || seenNames.has(targetProp.escapedName))); + } + function tryGetContainingMethodDeclaration(node, callExpression) { + if (isTypeLiteralNode(node)) { + return void 0; + } + const declaration = findAncestor(callExpression, (n7) => isMethodDeclaration(n7) || isConstructorDeclaration(n7)); + return declaration && declaration.parent === node ? declaration : void 0; + } + function createPropertyNameFromSymbol(symbol, target, quotePreference, checker) { + if (isTransientSymbol(symbol)) { + const prop = checker.symbolToNode( + symbol, + 111551, + /*enclosingDeclaration*/ + void 0, + 1073741824 + /* WriteComputedProps */ + ); + if (prop && isComputedPropertyName(prop)) + return prop; + } + return createPropertyNameNodeForIdentifierOrLiteral( + symbol.name, + target, + quotePreference === 0, + /*stringNamed*/ + false, + /*isMethod*/ + false + ); + } + function findScope(node) { + if (findAncestor(node, isJsxExpression)) { + const returnStatement = findAncestor(node.parent, isReturnStatement); + if (returnStatement) + return returnStatement; + } + return getSourceFileOfNode(node); + } + var fixMissingMember, fixMissingProperties, fixMissingAttributes, fixMissingFunctionDeclaration, errorCodes27; + var init_fixAddMissingMember = __esm2({ + "src/services/codefixes/fixAddMissingMember.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixMissingMember = "fixMissingMember"; + fixMissingProperties = "fixMissingProperties"; + fixMissingAttributes = "fixMissingAttributes"; + fixMissingFunctionDeclaration = "fixMissingFunctionDeclaration"; + errorCodes27 = [ + Diagnostics.Property_0_does_not_exist_on_type_1.code, + Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code, + Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code, + Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code, + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + Diagnostics.Cannot_find_name_0.code + ]; + registerCodeFix({ + errorCodes: errorCodes27, + getCodeActions(context2) { + const typeChecker = context2.program.getTypeChecker(); + const info2 = getInfo10(context2.sourceFile, context2.span.start, context2.errorCode, typeChecker, context2.program); + if (!info2) { + return void 0; + } + if (info2.kind === 3) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addObjectLiteralProperties(t8, context2, info2)); + return [createCodeFixAction(fixMissingProperties, changes, Diagnostics.Add_missing_properties, fixMissingProperties, Diagnostics.Add_all_missing_properties)]; + } + if (info2.kind === 4) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addJsxAttributes(t8, context2, info2)); + return [createCodeFixAction(fixMissingAttributes, changes, Diagnostics.Add_missing_attributes, fixMissingAttributes, Diagnostics.Add_all_missing_attributes)]; + } + if (info2.kind === 2 || info2.kind === 5) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addFunctionDeclaration(t8, context2, info2)); + return [createCodeFixAction(fixMissingFunctionDeclaration, changes, [Diagnostics.Add_missing_function_declaration_0, info2.token.text], fixMissingFunctionDeclaration, Diagnostics.Add_all_missing_function_declarations)]; + } + if (info2.kind === 1) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addEnumMemberDeclaration(t8, context2.program.getTypeChecker(), info2)); + return [createCodeFixAction(fixMissingMember, changes, [Diagnostics.Add_missing_enum_member_0, info2.token.text], fixMissingMember, Diagnostics.Add_all_missing_members)]; + } + return concatenate(getActionsForMissingMethodDeclaration(context2, info2), getActionsForMissingMemberDeclaration(context2, info2)); + }, + fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes], + getAllCodeActions: (context2) => { + const { program, fixId: fixId52 } = context2; + const checker = program.getTypeChecker(); + const seen = /* @__PURE__ */ new Map(); + const typeDeclToMembers = /* @__PURE__ */ new Map(); + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + eachDiagnostic(context2, errorCodes27, (diag2) => { + const info2 = getInfo10(diag2.file, diag2.start, diag2.code, checker, context2.program); + if (!info2 || !addToSeen(seen, getNodeId(info2.parentDeclaration) + "#" + (info2.kind === 3 ? info2.identifier : info2.token.text))) { + return; + } + if (fixId52 === fixMissingFunctionDeclaration && (info2.kind === 2 || info2.kind === 5)) { + addFunctionDeclaration(changes, context2, info2); + } else if (fixId52 === fixMissingProperties && info2.kind === 3) { + addObjectLiteralProperties(changes, context2, info2); + } else if (fixId52 === fixMissingAttributes && info2.kind === 4) { + addJsxAttributes(changes, context2, info2); + } else { + if (info2.kind === 1) { + addEnumMemberDeclaration(changes, checker, info2); + } + if (info2.kind === 0) { + const { parentDeclaration, token } = info2; + const infos = getOrUpdate(typeDeclToMembers, parentDeclaration, () => []); + if (!infos.some((i7) => i7.token.text === token.text)) { + infos.push(info2); + } + } + } + }); + typeDeclToMembers.forEach((infos, declaration) => { + const supers = isTypeLiteralNode(declaration) ? void 0 : getAllSupers(declaration, checker); + for (const info2 of infos) { + if (supers == null ? void 0 : supers.some((superClassOrInterface) => { + const superInfos = typeDeclToMembers.get(superClassOrInterface); + return !!superInfos && superInfos.some(({ token: token2 }) => token2.text === info2.token.text); + })) + continue; + const { parentDeclaration, declSourceFile, modifierFlags, token, call, isJSFile } = info2; + if (call && !isPrivateIdentifier(token)) { + addMethodDeclaration(context2, changes, call, token, modifierFlags & 256, parentDeclaration, declSourceFile); + } else { + if (isJSFile && !isInterfaceDeclaration(parentDeclaration) && !isTypeLiteralNode(parentDeclaration)) { + addMissingMemberInJs(changes, declSourceFile, parentDeclaration, token, !!(modifierFlags & 256)); + } else { + const typeNode = getTypeNode2(checker, parentDeclaration, token); + addPropertyDeclaration( + changes, + declSourceFile, + parentDeclaration, + token.text, + typeNode, + modifierFlags & 256 + /* Static */ + ); + } + } + } + }); + })); + } + }); + } + }); + function addMissingNewOperator(changes, sourceFile, span) { + const call = cast(findAncestorMatchingSpan2(sourceFile, span), isCallExpression); + const newExpression = factory.createNewExpression(call.expression, call.typeArguments, call.arguments); + changes.replaceNode(sourceFile, call, newExpression); + } + function findAncestorMatchingSpan2(sourceFile, span) { + let token = getTokenAtPosition(sourceFile, span.start); + const end = textSpanEnd(span); + while (token.end < end) { + token = token.parent; + } + return token; + } + var fixId24, errorCodes28; + var init_fixAddMissingNewOperator = __esm2({ + "src/services/codefixes/fixAddMissingNewOperator.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId24 = "addMissingNewOperator"; + errorCodes28 = [Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code]; + registerCodeFix({ + errorCodes: errorCodes28, + getCodeActions(context2) { + const { sourceFile, span } = context2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMissingNewOperator(t8, sourceFile, span)); + return [createCodeFixAction(fixId24, changes, Diagnostics.Add_missing_new_operator_to_call, fixId24, Diagnostics.Add_missing_new_operator_to_all_calls)]; + }, + fixIds: [fixId24], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes28, (changes, diag2) => addMissingNewOperator(changes, context2.sourceFile, diag2)) + }); + } + }); + function getInfo11(sourceFile, program, pos) { + const token = getTokenAtPosition(sourceFile, pos); + const callExpression = findAncestor(token, isCallExpression); + if (callExpression === void 0 || length(callExpression.arguments) === 0) { + return void 0; + } + const checker = program.getTypeChecker(); + const type3 = checker.getTypeAtLocation(callExpression.expression); + const convertibleSignatureDeclarations = filter2(type3.symbol.declarations, isConvertibleSignatureDeclaration); + if (convertibleSignatureDeclarations === void 0) { + return void 0; + } + const nonOverloadDeclaration = lastOrUndefined(convertibleSignatureDeclarations); + if (nonOverloadDeclaration === void 0 || nonOverloadDeclaration.body === void 0 || isSourceFileFromLibrary(program, nonOverloadDeclaration.getSourceFile())) { + return void 0; + } + const name2 = tryGetName2(nonOverloadDeclaration); + if (name2 === void 0) { + return void 0; + } + const newParameters = []; + const newOptionalParameters = []; + const parametersLength = length(nonOverloadDeclaration.parameters); + const argumentsLength = length(callExpression.arguments); + if (parametersLength > argumentsLength) { + return void 0; + } + const declarations = [nonOverloadDeclaration, ...getOverloads(nonOverloadDeclaration, convertibleSignatureDeclarations)]; + for (let i7 = 0, pos2 = 0, paramIndex = 0; i7 < argumentsLength; i7++) { + const arg = callExpression.arguments[i7]; + const expr = isAccessExpression(arg) ? getNameOfAccessExpression(arg) : arg; + const type22 = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(arg))); + const parameter = pos2 < parametersLength ? nonOverloadDeclaration.parameters[pos2] : void 0; + if (parameter && checker.isTypeAssignableTo(type22, checker.getTypeAtLocation(parameter))) { + pos2++; + continue; + } + const name22 = expr && isIdentifier(expr) ? expr.text : `p${paramIndex++}`; + const typeNode = typeToTypeNode(checker, type22, nonOverloadDeclaration); + append(newParameters, { + pos: i7, + declaration: createParameter( + name22, + typeNode, + /*questionToken*/ + void 0 + ) + }); + if (isOptionalPos(declarations, pos2)) { + continue; + } + append(newOptionalParameters, { + pos: i7, + declaration: createParameter(name22, typeNode, factory.createToken( + 58 + /* QuestionToken */ + )) + }); + } + return { + newParameters, + newOptionalParameters, + name: declarationNameToString(name2), + declarations + }; + } + function tryGetName2(node) { + const name2 = getNameOfDeclaration(node); + if (name2) { + return name2; + } + if (isVariableDeclaration(node.parent) && isIdentifier(node.parent.name) || isPropertyDeclaration(node.parent) || isParameter(node.parent)) { + return node.parent.name; + } + } + function typeToTypeNode(checker, type3, enclosingDeclaration) { + return checker.typeToTypeNode( + checker.getWidenedType(type3), + enclosingDeclaration, + 1 + /* NoTruncation */ + ) ?? factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ); + } + function doChange19(changes, sourceFile, declarations, newParameters) { + forEach4(declarations, (declaration) => { + if (length(declaration.parameters)) { + changes.replaceNodeRangeWithNodes( + sourceFile, + first(declaration.parameters), + last2(declaration.parameters), + updateParameters(declaration, newParameters), + { + joiner: ", ", + indentation: 0, + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include + } + ); + } else { + forEach4(updateParameters(declaration, newParameters), (parameter, index4) => { + if (length(declaration.parameters) === 0 && index4 === 0) { + changes.insertNodeAt(sourceFile, declaration.parameters.end, parameter); + } else { + changes.insertNodeAtEndOfList(sourceFile, declaration.parameters, parameter); + } + }); + } + }); + } + function isConvertibleSignatureDeclaration(node) { + switch (node.kind) { + case 262: + case 218: + case 174: + case 219: + return true; + default: + return false; + } + } + function updateParameters(node, newParameters) { + const parameters = map4(node.parameters, (p7) => factory.createParameterDeclaration( + p7.modifiers, + p7.dotDotDotToken, + p7.name, + p7.questionToken, + p7.type, + p7.initializer + )); + for (const { pos, declaration } of newParameters) { + const prev = pos > 0 ? parameters[pos - 1] : void 0; + parameters.splice( + pos, + 0, + factory.updateParameterDeclaration( + declaration, + declaration.modifiers, + declaration.dotDotDotToken, + declaration.name, + prev && prev.questionToken ? factory.createToken( + 58 + /* QuestionToken */ + ) : declaration.questionToken, + declaration.type, + declaration.initializer + ) + ); + } + return parameters; + } + function getOverloads(implementation, declarations) { + const overloads = []; + for (const declaration of declarations) { + if (isOverload(declaration)) { + if (length(declaration.parameters) === length(implementation.parameters)) { + overloads.push(declaration); + continue; + } + if (length(declaration.parameters) > length(implementation.parameters)) { + return []; + } + } + } + return overloads; + } + function isOverload(declaration) { + return isConvertibleSignatureDeclaration(declaration) && declaration.body === void 0; + } + function createParameter(name2, type3, questionToken) { + return factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + name2, + questionToken, + type3, + /*initializer*/ + void 0 + ); + } + function isOptionalPos(declarations, pos) { + return length(declarations) && some2(declarations, (d7) => pos < length(d7.parameters) && !!d7.parameters[pos] && d7.parameters[pos].questionToken === void 0); + } + var addMissingParamFixId, addOptionalParamFixId, errorCodes29; + var init_fixAddMissingParam = __esm2({ + "src/services/codefixes/fixAddMissingParam.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + addMissingParamFixId = "addMissingParam"; + addOptionalParamFixId = "addOptionalParam"; + errorCodes29 = [Diagnostics.Expected_0_arguments_but_got_1.code]; + registerCodeFix({ + errorCodes: errorCodes29, + fixIds: [addMissingParamFixId, addOptionalParamFixId], + getCodeActions(context2) { + const info2 = getInfo11(context2.sourceFile, context2.program, context2.span.start); + if (info2 === void 0) + return void 0; + const { name: name2, declarations, newParameters, newOptionalParameters } = info2; + const actions2 = []; + if (length(newParameters)) { + append( + actions2, + createCodeFixAction( + addMissingParamFixId, + ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange19(t8, context2.sourceFile, declarations, newParameters)), + [length(newParameters) > 1 ? Diagnostics.Add_missing_parameters_to_0 : Diagnostics.Add_missing_parameter_to_0, name2], + addMissingParamFixId, + Diagnostics.Add_all_missing_parameters + ) + ); + } + if (length(newOptionalParameters)) { + append( + actions2, + createCodeFixAction( + addOptionalParamFixId, + ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange19(t8, context2.sourceFile, declarations, newOptionalParameters)), + [length(newOptionalParameters) > 1 ? Diagnostics.Add_optional_parameters_to_0 : Diagnostics.Add_optional_parameter_to_0, name2], + addOptionalParamFixId, + Diagnostics.Add_all_optional_parameters + ) + ); + } + return actions2; + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes29, (changes, diag2) => { + const info2 = getInfo11(context2.sourceFile, context2.program, diag2.start); + if (info2) { + const { declarations, newParameters, newOptionalParameters } = info2; + if (context2.fixId === addMissingParamFixId) { + doChange19(changes, context2.sourceFile, declarations, newParameters); + } + if (context2.fixId === addOptionalParamFixId) { + doChange19(changes, context2.sourceFile, declarations, newOptionalParameters); + } + } + }) + }); + } + }); + function getInstallCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName }; + } + function tryGetImportedPackageName(sourceFile, pos) { + const moduleSpecifierText = tryCast(getTokenAtPosition(sourceFile, pos), isStringLiteral); + if (!moduleSpecifierText) + return void 0; + const moduleName3 = moduleSpecifierText.text; + const { packageName } = parsePackageName(moduleName3); + return isExternalModuleNameRelative(packageName) ? void 0 : packageName; + } + function getTypesPackageNameToInstall(packageName, host, diagCode) { + var _a2; + return diagCode === errorCodeCannotFindModule ? ts_JsTyping_exports.nodeCoreModules.has(packageName) ? "@types/node" : void 0 : ((_a2 = host.isKnownTypesPackageName) == null ? void 0 : _a2.call(host, packageName)) ? getTypesPackageName(packageName) : void 0; + } + var fixName2, fixIdInstallTypesPackage, errorCodeCannotFindModule, errorCodes30; + var init_fixCannotFindModule = __esm2({ + "src/services/codefixes/fixCannotFindModule.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName2 = "fixCannotFindModule"; + fixIdInstallTypesPackage = "installTypesPackage"; + errorCodeCannotFindModule = Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code; + errorCodes30 = [ + errorCodeCannotFindModule, + Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code + ]; + registerCodeFix({ + errorCodes: errorCodes30, + getCodeActions: function getCodeActionsToFixNotFoundModule(context2) { + const { host, sourceFile, span: { start } } = context2; + const packageName = tryGetImportedPackageName(sourceFile, start); + if (packageName === void 0) + return void 0; + const typesPackageName = getTypesPackageNameToInstall(packageName, host, context2.errorCode); + return typesPackageName === void 0 ? [] : [createCodeFixAction( + fixName2, + /*changes*/ + [], + [Diagnostics.Install_0, typesPackageName], + fixIdInstallTypesPackage, + Diagnostics.Install_all_missing_types_packages, + getInstallCommand(sourceFile.fileName, typesPackageName) + )]; + }, + fixIds: [fixIdInstallTypesPackage], + getAllCodeActions: (context2) => { + return codeFixAll(context2, errorCodes30, (_changes, diag2, commands) => { + const packageName = tryGetImportedPackageName(diag2.file, diag2.start); + if (packageName === void 0) + return void 0; + switch (context2.fixId) { + case fixIdInstallTypesPackage: { + const pkg = getTypesPackageNameToInstall(packageName, context2.host, diag2.code); + if (pkg) { + commands.push(getInstallCommand(diag2.file.fileName, pkg)); + } + break; + } + default: + Debug.fail(`Bad fixId: ${context2.fixId}`); + } + }); + } + }); + } + }); + function getClass2(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + return cast(token.parent, isClassLike); + } + function addMissingMembers(classDeclaration, sourceFile, context2, changeTracker, preferences) { + const extendsNode = getEffectiveBaseTypeNode(classDeclaration); + const checker = context2.program.getTypeChecker(); + const instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + const abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + const importAdder = createImportAdder(sourceFile, context2.program, preferences, context2.host); + createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, sourceFile, context2, preferences, importAdder, (member) => changeTracker.insertMemberAtStart(sourceFile, classDeclaration, member)); + importAdder.writeFixes(changeTracker); + } + function symbolPointsToNonPrivateAndAbstractMember(symbol) { + const flags = getSyntacticModifierFlags(first(symbol.getDeclarations())); + return !(flags & 2) && !!(flags & 64); + } + var errorCodes31, fixId25; + var init_fixClassDoesntImplementInheritedAbstractMember = __esm2({ + "src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes31 = [ + Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code + ]; + fixId25 = "fixClassDoesntImplementInheritedAbstractMember"; + registerCodeFix({ + errorCodes: errorCodes31, + getCodeActions: function getCodeActionsToFixClassNotImplementingInheritedMembers(context2) { + const { sourceFile, span } = context2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addMissingMembers(getClass2(sourceFile, span.start), sourceFile, context2, t8, context2.preferences)); + return changes.length === 0 ? void 0 : [createCodeFixAction(fixId25, changes, Diagnostics.Implement_inherited_abstract_class, fixId25, Diagnostics.Implement_all_inherited_abstract_classes)]; + }, + fixIds: [fixId25], + getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context2) { + const seenClassDeclarations = /* @__PURE__ */ new Map(); + return codeFixAll(context2, errorCodes31, (changes, diag2) => { + const classDeclaration = getClass2(diag2.file, diag2.start); + if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { + addMissingMembers(classDeclaration, context2.sourceFile, context2, changes, context2.preferences); + } + }); + } + }); + } + }); + function doChange20(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.delete(sourceFile, superCall); + } + function getNodes(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + if (token.kind !== 110) + return void 0; + const constructor = getContainingFunction(token); + const superCall = findSuperCall(constructor.body); + return superCall && !superCall.expression.arguments.some((arg) => isPropertyAccessExpression(arg) && arg.expression === token) ? { constructor, superCall } : void 0; + } + function findSuperCall(n7) { + return isExpressionStatement(n7) && isSuperCall(n7.expression) ? n7 : isFunctionLike(n7) ? void 0 : forEachChild(n7, findSuperCall); + } + var fixId26, errorCodes32; + var init_fixClassSuperMustPrecedeThisAccess = __esm2({ + "src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId26 = "classSuperMustPrecedeThisAccess"; + errorCodes32 = [Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; + registerCodeFix({ + errorCodes: errorCodes32, + getCodeActions(context2) { + const { sourceFile, span } = context2; + const nodes = getNodes(sourceFile, span.start); + if (!nodes) + return void 0; + const { constructor, superCall } = nodes; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange20(t8, sourceFile, constructor, superCall)); + return [createCodeFixAction(fixId26, changes, Diagnostics.Make_super_call_the_first_statement_in_the_constructor, fixId26, Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]; + }, + fixIds: [fixId26], + getAllCodeActions(context2) { + const { sourceFile } = context2; + const seenClasses = /* @__PURE__ */ new Map(); + return codeFixAll(context2, errorCodes32, (changes, diag2) => { + const nodes = getNodes(diag2.file, diag2.start); + if (!nodes) + return; + const { constructor, superCall } = nodes; + if (addToSeen(seenClasses, getNodeId(constructor.parent))) { + doChange20(changes, sourceFile, constructor, superCall); + } + }); + } + }); + } + }); + function getNode(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + Debug.assert(isConstructorDeclaration(token.parent), "token should be at the constructor declaration"); + return token.parent; + } + function doChange21(changes, sourceFile, ctr) { + const superCall = factory.createExpressionStatement(factory.createCallExpression( + factory.createSuper(), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + emptyArray + )); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } + var fixId27, errorCodes33; + var init_fixConstructorForDerivedNeedSuperCall = __esm2({ + "src/services/codefixes/fixConstructorForDerivedNeedSuperCall.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId27 = "constructorForDerivedNeedSuperCall"; + errorCodes33 = [Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; + registerCodeFix({ + errorCodes: errorCodes33, + getCodeActions(context2) { + const { sourceFile, span } = context2; + const ctr = getNode(sourceFile, span.start); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange21(t8, sourceFile, ctr)); + return [createCodeFixAction(fixId27, changes, Diagnostics.Add_missing_super_call, fixId27, Diagnostics.Add_all_missing_super_calls)]; + }, + fixIds: [fixId27], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes33, (changes, diag2) => doChange21(changes, context2.sourceFile, getNode(diag2.file, diag2.start))) + }); + } + }); + function doChange22(changeTracker, configFile) { + setJsonCompilerOptionValue(changeTracker, configFile, "jsx", factory.createStringLiteral("react")); + } + var fixID, errorCodes34; + var init_fixEnableJsxFlag = __esm2({ + "src/services/codefixes/fixEnableJsxFlag.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixID = "fixEnableJsxFlag"; + errorCodes34 = [Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code]; + registerCodeFix({ + errorCodes: errorCodes34, + getCodeActions: function getCodeActionsToFixEnableJsxFlag(context2) { + const { configFile } = context2.program.getCompilerOptions(); + if (configFile === void 0) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changeTracker) => doChange22(changeTracker, configFile)); + return [ + createCodeFixActionWithoutFixAll(fixID, changes, Diagnostics.Enable_the_jsx_flag_in_your_configuration_file) + ]; + }, + fixIds: [fixID], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes34, (changes) => { + const { configFile } = context2.program.getCompilerOptions(); + if (configFile === void 0) { + return void 0; + } + doChange22(changes, configFile); + }) + }); + } + }); + function getInfo12(program, sourceFile, span) { + const diag2 = find2(program.getSemanticDiagnostics(sourceFile), (diag3) => diag3.start === span.start && diag3.length === span.length); + if (diag2 === void 0 || diag2.relatedInformation === void 0) + return; + const related = find2(diag2.relatedInformation, (related2) => related2.code === Diagnostics.Did_you_mean_0.code); + if (related === void 0 || related.file === void 0 || related.start === void 0 || related.length === void 0) + return; + const token = findAncestorMatchingSpan(related.file, createTextSpan(related.start, related.length)); + if (token === void 0) + return; + if (isExpression(token) && isBinaryExpression(token.parent)) { + return { suggestion: getSuggestion(related.messageText), expression: token.parent, arg: token }; + } + return void 0; + } + function doChange23(changes, sourceFile, arg, expression) { + const callExpression = factory.createCallExpression( + factory.createPropertyAccessExpression(factory.createIdentifier("Number"), factory.createIdentifier("isNaN")), + /*typeArguments*/ + void 0, + [arg] + ); + const operator = expression.operatorToken.kind; + changes.replaceNode( + sourceFile, + expression, + operator === 38 || operator === 36 ? factory.createPrefixUnaryExpression(54, callExpression) : callExpression + ); + } + function getSuggestion(messageText) { + const [, suggestion] = flattenDiagnosticMessageText(messageText, "\n", 0).match(/'(.*)'/) || []; + return suggestion; + } + var fixId28, errorCodes35; + var init_fixNaNEquality = __esm2({ + "src/services/codefixes/fixNaNEquality.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId28 = "fixNaNEquality"; + errorCodes35 = [ + Diagnostics.This_condition_will_always_return_0.code + ]; + registerCodeFix({ + errorCodes: errorCodes35, + getCodeActions(context2) { + const { sourceFile, span, program } = context2; + const info2 = getInfo12(program, sourceFile, span); + if (info2 === void 0) + return; + const { suggestion, expression, arg } = info2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange23(t8, sourceFile, arg, expression)); + return [createCodeFixAction(fixId28, changes, [Diagnostics.Use_0, suggestion], fixId28, Diagnostics.Use_Number_isNaN_in_all_conditions)]; + }, + fixIds: [fixId28], + getAllCodeActions: (context2) => { + return codeFixAll(context2, errorCodes35, (changes, diag2) => { + const info2 = getInfo12(context2.program, diag2.file, createTextSpan(diag2.start, diag2.length)); + if (info2) { + doChange23(changes, diag2.file, info2.arg, info2.expression); + } + }); + } + }); + } + }); + var init_fixModuleAndTargetOptions = __esm2({ + "src/services/codefixes/fixModuleAndTargetOptions.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + registerCodeFix({ + errorCodes: [ + Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code, + Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code + ], + getCodeActions: function getCodeActionsToFixModuleAndTarget(context2) { + const compilerOptions = context2.program.getCompilerOptions(); + const { configFile } = compilerOptions; + if (configFile === void 0) { + return void 0; + } + const codeFixes = []; + const moduleKind = getEmitModuleKind(compilerOptions); + const moduleOutOfRange = moduleKind >= 5 && moduleKind < 99; + if (moduleOutOfRange) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changes2) => { + setJsonCompilerOptionValue(changes2, configFile, "module", factory.createStringLiteral("esnext")); + }); + codeFixes.push(createCodeFixActionWithoutFixAll("fixModuleOption", changes, [Diagnostics.Set_the_module_option_in_your_configuration_file_to_0, "esnext"])); + } + const target = getEmitScriptTarget(compilerOptions); + const targetOutOfRange = target < 4 || target > 99; + if (targetOutOfRange) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (tracker) => { + const configObject = getTsConfigObjectLiteralExpression(configFile); + if (!configObject) + return; + const options = [["target", factory.createStringLiteral("es2017")]]; + if (moduleKind === 1) { + options.push(["module", factory.createStringLiteral("commonjs")]); + } + setJsonCompilerOptionValues(tracker, configFile, options); + }); + codeFixes.push(createCodeFixActionWithoutFixAll("fixTargetOption", changes, [Diagnostics.Set_the_target_option_in_your_configuration_file_to_0, "es2017"])); + } + return codeFixes.length ? codeFixes : void 0; + } + }); + } + }); + function doChange24(changes, sourceFile, node) { + changes.replaceNode(sourceFile, node, factory.createPropertyAssignment(node.name, node.objectAssignmentInitializer)); + } + function getProperty2(sourceFile, pos) { + return cast(getTokenAtPosition(sourceFile, pos).parent, isShorthandPropertyAssignment); + } + var fixId29, errorCodes36; + var init_fixPropertyAssignment = __esm2({ + "src/services/codefixes/fixPropertyAssignment.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId29 = "fixPropertyAssignment"; + errorCodes36 = [ + Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code + ]; + registerCodeFix({ + errorCodes: errorCodes36, + fixIds: [fixId29], + getCodeActions(context2) { + const { sourceFile, span } = context2; + const property2 = getProperty2(sourceFile, span.start); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange24(t8, context2.sourceFile, property2)); + return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])]; + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes36, (changes, diag2) => doChange24(changes, diag2.file, getProperty2(diag2.file, diag2.start))) + }); + } + }); + function getNodes2(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + const heritageClauses = getContainingClass(token).heritageClauses; + const extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 96 ? { extendsToken, heritageClauses } : void 0; + } + function doChanges2(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, factory.createToken( + 119 + /* ImplementsKeyword */ + )); + if (heritageClauses.length === 2 && heritageClauses[0].token === 96 && heritageClauses[1].token === 119) { + const implementsToken = heritageClauses[1].getFirstToken(); + const implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, factory.createToken( + 28 + /* CommaToken */ + )); + const text = sourceFile.text; + let end = implementsToken.end; + while (end < text.length && isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end }); + } + } + var fixId30, errorCodes37; + var init_fixExtendsInterfaceBecomesImplements = __esm2({ + "src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId30 = "extendsInterfaceBecomesImplements"; + errorCodes37 = [Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; + registerCodeFix({ + errorCodes: errorCodes37, + getCodeActions(context2) { + const { sourceFile } = context2; + const nodes = getNodes2(sourceFile, context2.span.start); + if (!nodes) + return void 0; + const { extendsToken, heritageClauses } = nodes; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChanges2(t8, sourceFile, extendsToken, heritageClauses)); + return [createCodeFixAction(fixId30, changes, Diagnostics.Change_extends_to_implements, fixId30, Diagnostics.Change_all_extended_interfaces_to_implements)]; + }, + fixIds: [fixId30], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes37, (changes, diag2) => { + const nodes = getNodes2(diag2.file, diag2.start); + if (nodes) + doChanges2(changes, diag2.file, nodes.extendsToken, nodes.heritageClauses); + }) + }); + } + }); + function getInfo13(sourceFile, pos, diagCode) { + const node = getTokenAtPosition(sourceFile, pos); + if (isIdentifier(node) || isPrivateIdentifier(node)) { + return { node, className: diagCode === didYouMeanStaticMemberCode ? getContainingClass(node).name.text : void 0 }; + } + } + function doChange25(changes, sourceFile, { node, className }) { + suppressLeadingAndTrailingTrivia(node); + changes.replaceNode(sourceFile, node, factory.createPropertyAccessExpression(className ? factory.createIdentifier(className) : factory.createThis(), node)); + } + var fixId31, didYouMeanStaticMemberCode, errorCodes38; + var init_fixForgottenThisPropertyAccess = __esm2({ + "src/services/codefixes/fixForgottenThisPropertyAccess.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId31 = "forgottenThisPropertyAccess"; + didYouMeanStaticMemberCode = Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code; + errorCodes38 = [ + Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code, + Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, + didYouMeanStaticMemberCode + ]; + registerCodeFix({ + errorCodes: errorCodes38, + getCodeActions(context2) { + const { sourceFile } = context2; + const info2 = getInfo13(sourceFile, context2.span.start, context2.errorCode); + if (!info2) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange25(t8, sourceFile, info2)); + return [createCodeFixAction(fixId31, changes, [Diagnostics.Add_0_to_unresolved_variable, info2.className || "this"], fixId31, Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]; + }, + fixIds: [fixId31], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes38, (changes, diag2) => { + const info2 = getInfo13(diag2.file, diag2.start, diag2.code); + if (info2) + doChange25(changes, context2.sourceFile, info2); + }) + }); + } + }); + function isValidCharacter(character) { + return hasProperty(htmlEntity, character); + } + function doChange26(changes, preferences, sourceFile, start, useHtmlEntity) { + const character = sourceFile.getText()[start]; + if (!isValidCharacter(character)) { + return; + } + const replacement = useHtmlEntity ? htmlEntity[character] : `{${quote(sourceFile, preferences, character)}}`; + changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement); + } + var fixIdExpression, fixIdHtmlEntity, errorCodes39, htmlEntity; + var init_fixInvalidJsxCharacters = __esm2({ + "src/services/codefixes/fixInvalidJsxCharacters.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixIdExpression = "fixInvalidJsxCharacters_expression"; + fixIdHtmlEntity = "fixInvalidJsxCharacters_htmlEntity"; + errorCodes39 = [ + Diagnostics.Unexpected_token_Did_you_mean_or_gt.code, + Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code + ]; + registerCodeFix({ + errorCodes: errorCodes39, + fixIds: [fixIdExpression, fixIdHtmlEntity], + getCodeActions(context2) { + const { sourceFile, preferences, span } = context2; + const changeToExpression = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange26( + t8, + preferences, + sourceFile, + span.start, + /*useHtmlEntity*/ + false + )); + const changeToHtmlEntity = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange26( + t8, + preferences, + sourceFile, + span.start, + /*useHtmlEntity*/ + true + )); + return [ + createCodeFixAction(fixIdExpression, changeToExpression, Diagnostics.Wrap_invalid_character_in_an_expression_container, fixIdExpression, Diagnostics.Wrap_all_invalid_characters_in_an_expression_container), + createCodeFixAction(fixIdHtmlEntity, changeToHtmlEntity, Diagnostics.Convert_invalid_character_to_its_html_entity_code, fixIdHtmlEntity, Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code) + ]; + }, + getAllCodeActions(context2) { + return codeFixAll(context2, errorCodes39, (changes, diagnostic) => doChange26(changes, context2.preferences, diagnostic.file, diagnostic.start, context2.fixId === fixIdHtmlEntity)); + } + }); + htmlEntity = { + ">": ">", + "}": "}" + }; + } + }); + function getDeleteAction(context2, { name: name2, jsDocHost, jsDocParameterTag }) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changeTracker) => changeTracker.filterJSDocTags(context2.sourceFile, jsDocHost, (t8) => t8 !== jsDocParameterTag)); + return createCodeFixAction( + deleteUnmatchedParameter, + changes, + [Diagnostics.Delete_unused_param_tag_0, name2.getText(context2.sourceFile)], + deleteUnmatchedParameter, + Diagnostics.Delete_all_unused_param_tags + ); + } + function getRenameAction(context2, { name: name2, jsDocHost, signature, jsDocParameterTag }) { + if (!length(signature.parameters)) + return void 0; + const sourceFile = context2.sourceFile; + const tags6 = getJSDocTags(signature); + const names = /* @__PURE__ */ new Set(); + for (const tag of tags6) { + if (isJSDocParameterTag(tag) && isIdentifier(tag.name)) { + names.add(tag.name.escapedText); + } + } + const parameterName = firstDefined(signature.parameters, (p7) => isIdentifier(p7.name) && !names.has(p7.name.escapedText) ? p7.name.getText(sourceFile) : void 0); + if (parameterName === void 0) + return void 0; + const newJSDocParameterTag = factory.updateJSDocParameterTag( + jsDocParameterTag, + jsDocParameterTag.tagName, + factory.createIdentifier(parameterName), + jsDocParameterTag.isBracketed, + jsDocParameterTag.typeExpression, + jsDocParameterTag.isNameFirst, + jsDocParameterTag.comment + ); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map4(tags6, (t8) => t8 === jsDocParameterTag ? newJSDocParameterTag : t8))); + return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name2.getText(sourceFile), parameterName]); + } + function getInfo14(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) { + const jsDocParameterTag = token.parent; + const jsDocHost = getJSDocHost(jsDocParameterTag); + const signature = getHostSignatureFromJSDoc(jsDocParameterTag); + if (jsDocHost && signature) { + return { jsDocHost, signature, name: token.parent.name, jsDocParameterTag }; + } + } + return void 0; + } + var deleteUnmatchedParameter, renameUnmatchedParameter, errorCodes40; + var init_fixUnmatchedParameter = __esm2({ + "src/services/codefixes/fixUnmatchedParameter.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + deleteUnmatchedParameter = "deleteUnmatchedParameter"; + renameUnmatchedParameter = "renameUnmatchedParameter"; + errorCodes40 = [ + Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code + ]; + registerCodeFix({ + fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter], + errorCodes: errorCodes40, + getCodeActions: function getCodeActionsToFixUnmatchedParameter(context2) { + const { sourceFile, span } = context2; + const actions2 = []; + const info2 = getInfo14(sourceFile, span.start); + if (info2) { + append(actions2, getDeleteAction(context2, info2)); + append(actions2, getRenameAction(context2, info2)); + return actions2; + } + return void 0; + }, + getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context2) { + const tagsToSignature = /* @__PURE__ */ new Map(); + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + eachDiagnostic(context2, errorCodes40, ({ file, start }) => { + const info2 = getInfo14(file, start); + if (info2) { + tagsToSignature.set(info2.signature, append(tagsToSignature.get(info2.signature), info2.jsDocParameterTag)); + } + }); + tagsToSignature.forEach((tags6, signature) => { + if (context2.fixId === deleteUnmatchedParameter) { + const tagsSet = new Set(tags6); + changes.filterJSDocTags(signature.getSourceFile(), signature, (t8) => !tagsSet.has(t8)); + } + }); + })); + } + }); + } + }); + function getImportDeclaration(sourceFile, program, start) { + const identifier = tryCast(getTokenAtPosition(sourceFile, start), isIdentifier); + if (!identifier || identifier.parent.kind !== 183) + return; + const checker = program.getTypeChecker(); + const symbol = checker.getSymbolAtLocation(identifier); + return find2((symbol == null ? void 0 : symbol.declarations) || emptyArray, or(isImportClause, isImportSpecifier, isImportEqualsDeclaration)); + } + function doTypeOnlyImportChange(changes, sourceFile, importDeclaration, program) { + if (importDeclaration.kind === 271) { + changes.insertModifierBefore(sourceFile, 156, importDeclaration.name); + return; + } + const importClause = importDeclaration.kind === 273 ? importDeclaration : importDeclaration.parent.parent; + if (importClause.name && importClause.namedBindings) { + return; + } + const checker = program.getTypeChecker(); + const importsValue = !!forEachImportClauseDeclaration(importClause, (decl) => { + if (skipAlias(decl.symbol, checker).flags & 111551) + return true; + }); + if (importsValue) { + return; + } + changes.insertModifierBefore(sourceFile, 156, importClause); + } + function doNamespaceImportChange(changes, sourceFile, importDeclaration, program) { + ts_refactor_exports.doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, importDeclaration.parent); + } + var fixId32, errorCodes41; + var init_fixUnreferenceableDecoratorMetadata = __esm2({ + "src/services/codefixes/fixUnreferenceableDecoratorMetadata.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId32 = "fixUnreferenceableDecoratorMetadata"; + errorCodes41 = [Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code]; + registerCodeFix({ + errorCodes: errorCodes41, + getCodeActions: (context2) => { + const importDeclaration = getImportDeclaration(context2.sourceFile, context2.program, context2.span.start); + if (!importDeclaration) + return; + const namespaceChanges = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => importDeclaration.kind === 276 && doNamespaceImportChange(t8, context2.sourceFile, importDeclaration, context2.program)); + const typeOnlyChanges = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doTypeOnlyImportChange(t8, context2.sourceFile, importDeclaration, context2.program)); + let actions2; + if (namespaceChanges.length) { + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, namespaceChanges, Diagnostics.Convert_named_imports_to_namespace_import)); + } + if (typeOnlyChanges.length) { + actions2 = append(actions2, createCodeFixActionWithoutFixAll(fixId32, typeOnlyChanges, Diagnostics.Use_import_type)); + } + return actions2; + }, + fixIds: [fixId32] + }); + } + }); + function changeInferToUnknown(changes, sourceFile, token) { + changes.replaceNode(sourceFile, token.parent, factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + )); + } + function createDeleteFix(changes, diag2) { + return createCodeFixAction(fixName3, changes, diag2, fixIdDelete, Diagnostics.Delete_all_unused_declarations); + } + function deleteTypeParameters(changes, sourceFile, token) { + changes.delete(sourceFile, Debug.checkDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters, "The type parameter to delete should exist")); + } + function isImport(token) { + return token.kind === 102 || token.kind === 80 && (token.parent.kind === 276 || token.parent.kind === 273); + } + function tryGetFullImport(token) { + return token.kind === 102 ? tryCast(token.parent, isImportDeclaration) : void 0; + } + function canDeleteEntireVariableStatement(sourceFile, token) { + return isVariableDeclarationList(token.parent) && first(token.parent.getChildren(sourceFile)) === token; + } + function deleteEntireVariableStatement(changes, sourceFile, node) { + changes.delete(sourceFile, node.parent.kind === 243 ? node.parent : node); + } + function deleteDestructuringElements(changes, sourceFile, node) { + forEach4(node.elements, (n7) => changes.delete(sourceFile, n7)); + } + function deleteDestructuring(context2, changes, sourceFile, { parent: parent22 }) { + if (isVariableDeclaration(parent22) && parent22.initializer && isCallLikeExpression(parent22.initializer)) { + if (isVariableDeclarationList(parent22.parent) && length(parent22.parent.declarations) > 1) { + const varStatement = parent22.parent.parent; + const pos = varStatement.getStart(sourceFile); + const end = varStatement.end; + changes.delete(sourceFile, parent22); + changes.insertNodeAt(sourceFile, end, parent22.initializer, { + prefix: getNewLineOrDefaultFromHost(context2.host, context2.formatContext.options) + sourceFile.text.slice(getPrecedingNonSpaceCharacterPosition(sourceFile.text, pos - 1), pos), + suffix: probablyUsesSemicolons(sourceFile) ? ";" : "" + }); + } else { + changes.replaceNode(sourceFile, parent22.parent, parent22.initializer); + } + } else { + changes.delete(sourceFile, parent22); + } + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) + return; + if (token.kind === 140) { + token = cast(token.parent, isInferTypeNode).typeParameter.name; + } + if (isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, factory.createIdentifier(`_${token.text}`)); + if (isParameter(token.parent)) { + getJSDocParameterTags(token.parent).forEach((tag) => { + if (isIdentifier(tag.name)) { + changes.replaceNode(sourceFile, tag.name, factory.createIdentifier(`_${tag.name.text}`)); + } + }); + } + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 169: + case 168: + return true; + case 260: { + const varDecl = token.parent; + switch (varDecl.parent.parent.kind) { + case 250: + case 249: + return true; + } + } + } + return false; + } + function tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, program, cancellationToken, isFixAll) { + tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll); + if (isIdentifier(token)) { + ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(token, checker, sourceFile, (ref) => { + if (isPropertyAccessExpression(ref.parent) && ref.parent.name === ref) + ref = ref.parent; + if (!isFixAll && mayDeleteExpression(ref)) { + changes.delete(sourceFile, ref.parent.parent); + } + }); + } + } + function tryDeleteDeclarationWorker(token, changes, sourceFile, checker, sourceFiles, program, cancellationToken, isFixAll) { + const { parent: parent22 } = token; + if (isParameter(parent22)) { + tryDeleteParameter(changes, sourceFile, parent22, checker, sourceFiles, program, cancellationToken, isFixAll); + } else if (!(isFixAll && isIdentifier(token) && ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(token, checker, sourceFile))) { + const node = isImportClause(parent22) ? token : isComputedPropertyName(parent22) ? parent22.parent : parent22; + Debug.assert(node !== sourceFile, "should not delete whole source file"); + changes.delete(sourceFile, node); + } + } + function tryDeleteParameter(changes, sourceFile, parameter, checker, sourceFiles, program, cancellationToken, isFixAll = false) { + if (mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll)) { + if (parameter.modifiers && parameter.modifiers.length > 0 && (!isIdentifier(parameter.name) || ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(parameter.name, checker, sourceFile))) { + for (const modifier of parameter.modifiers) { + if (isModifier(modifier)) { + changes.deleteModifier(sourceFile, modifier); + } + } + } else if (!parameter.initializer && isNotProvidedArguments(parameter, checker, sourceFiles)) { + changes.delete(sourceFile, parameter); + } + } + } + function isNotProvidedArguments(parameter, checker, sourceFiles) { + const index4 = parameter.parent.parameters.indexOf(parameter); + return !ts_FindAllReferences_exports.Core.someSignatureUsage(parameter.parent, sourceFiles, checker, (_6, call) => !call || call.arguments.length > index4); + } + function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program, cancellationToken, isFixAll) { + const { parent: parent22 } = parameter; + switch (parent22.kind) { + case 174: + case 176: + const index4 = parent22.parameters.indexOf(parameter); + const referent = isMethodDeclaration(parent22) ? parent22.name : parent22; + const entries = ts_FindAllReferences_exports.Core.getReferencedSymbolsForNode(parent22.pos, referent, program, sourceFiles, cancellationToken); + if (entries) { + for (const entry of entries) { + for (const reference of entry.references) { + if (reference.kind === ts_FindAllReferences_exports.EntryKind.Node) { + const isSuperCall2 = isSuperKeyword(reference.node) && isCallExpression(reference.node.parent) && reference.node.parent.arguments.length > index4; + const isSuperMethodCall = isPropertyAccessExpression(reference.node.parent) && isSuperKeyword(reference.node.parent.expression) && isCallExpression(reference.node.parent.parent) && reference.node.parent.parent.arguments.length > index4; + const isOverriddenMethod = (isMethodDeclaration(reference.node.parent) || isMethodSignature(reference.node.parent)) && reference.node.parent !== parameter.parent && reference.node.parent.parameters.length > index4; + if (isSuperCall2 || isSuperMethodCall || isOverriddenMethod) + return false; + } + } + } + } + return true; + case 262: { + if (parent22.name && isCallbackLike(checker, sourceFile, parent22.name)) { + return isLastParameter(parent22, parameter, isFixAll); + } + return true; + } + case 218: + case 219: + return isLastParameter(parent22, parameter, isFixAll); + case 178: + return false; + case 177: + return true; + default: + return Debug.failBadSyntaxKind(parent22); + } + } + function isCallbackLike(checker, sourceFile, name2) { + return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name2, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference)); + } + function isLastParameter(func, parameter, isFixAll) { + const parameters = func.parameters; + const index4 = parameters.indexOf(parameter); + Debug.assert(index4 !== -1, "The parameter should already be in the list"); + return isFixAll ? parameters.slice(index4 + 1).every((p7) => isIdentifier(p7.name) && !p7.symbol.isReferenced) : index4 === parameters.length - 1; + } + function mayDeleteExpression(node) { + return (isBinaryExpression(node.parent) && node.parent.left === node || (isPostfixUnaryExpression(node.parent) || isPrefixUnaryExpression(node.parent)) && node.parent.operand === node) && isExpressionStatement(node.parent.parent); + } + var fixName3, fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer, errorCodes42; + var init_fixUnusedIdentifier = __esm2({ + "src/services/codefixes/fixUnusedIdentifier.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName3 = "unusedIdentifier"; + fixIdPrefix = "unusedIdentifier_prefix"; + fixIdDelete = "unusedIdentifier_delete"; + fixIdDeleteImports = "unusedIdentifier_deleteImports"; + fixIdInfer = "unusedIdentifier_infer"; + errorCodes42 = [ + Diagnostics._0_is_declared_but_its_value_is_never_read.code, + Diagnostics._0_is_declared_but_never_used.code, + Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + Diagnostics.All_imports_in_import_declaration_are_unused.code, + Diagnostics.All_destructured_elements_are_unused.code, + Diagnostics.All_variables_are_unused.code, + Diagnostics.All_type_parameters_are_unused.code + ]; + registerCodeFix({ + errorCodes: errorCodes42, + getCodeActions(context2) { + const { errorCode, sourceFile, program, cancellationToken } = context2; + const checker = program.getTypeChecker(); + const sourceFiles = program.getSourceFiles(); + const token = getTokenAtPosition(sourceFile, context2.span.start); + if (isJSDocTemplateTag(token)) { + return [createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.delete(sourceFile, token)), Diagnostics.Remove_template_tag)]; + } + if (token.kind === 30) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => deleteTypeParameters(t8, sourceFile, token)); + return [createDeleteFix(changes, Diagnostics.Remove_type_parameters)]; + } + const importDecl = tryGetFullImport(token); + if (importDecl) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.delete(sourceFile, importDecl)); + return [createCodeFixAction(fixName3, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDeleteImports, Diagnostics.Delete_all_unused_imports)]; + } else if (isImport(token)) { + const deletion = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => tryDeleteDeclaration( + sourceFile, + token, + t8, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + false + )); + if (deletion.length) { + return [createCodeFixAction(fixName3, deletion, [Diagnostics.Remove_unused_declaration_for_Colon_0, token.getText(sourceFile)], fixIdDeleteImports, Diagnostics.Delete_all_unused_imports)]; + } + } + if (isObjectBindingPattern(token.parent) || isArrayBindingPattern(token.parent)) { + if (isParameter(token.parent.parent)) { + const elements = token.parent.elements; + const diagnostic = [ + elements.length > 1 ? Diagnostics.Remove_unused_declarations_for_Colon_0 : Diagnostics.Remove_unused_declaration_for_Colon_0, + map4(elements, (e10) => e10.getText(sourceFile)).join(", ") + ]; + return [ + createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context2, (t8) => deleteDestructuringElements(t8, sourceFile, token.parent)), diagnostic) + ]; + } + return [ + createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context2, (t8) => deleteDestructuring(context2, t8, sourceFile, token.parent)), Diagnostics.Remove_unused_destructuring_declaration) + ]; + } + if (canDeleteEntireVariableStatement(sourceFile, token)) { + return [ + createDeleteFix(ts_textChanges_exports.ChangeTracker.with(context2, (t8) => deleteEntireVariableStatement(t8, sourceFile, token.parent)), Diagnostics.Remove_variable_statement) + ]; + } + const result2 = []; + if (token.kind === 140) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => changeInferToUnknown(t8, sourceFile, token)); + const name2 = cast(token.parent, isInferTypeNode).typeParameter.name.text; + result2.push(createCodeFixAction(fixName3, changes, [Diagnostics.Replace_infer_0_with_unknown, name2], fixIdInfer, Diagnostics.Replace_all_unused_infer_with_unknown)); + } else { + const deletion = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => tryDeleteDeclaration( + sourceFile, + token, + t8, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + false + )); + if (deletion.length) { + const name2 = isComputedPropertyName(token.parent) ? token.parent : token; + result2.push(createDeleteFix(deletion, [Diagnostics.Remove_unused_declaration_for_Colon_0, name2.getText(sourceFile)])); + } + } + const prefix = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => tryPrefixDeclaration(t8, errorCode, sourceFile, token)); + if (prefix.length) { + result2.push(createCodeFixAction(fixName3, prefix, [Diagnostics.Prefix_0_with_an_underscore, token.getText(sourceFile)], fixIdPrefix, Diagnostics.Prefix_all_unused_declarations_with_where_possible)); + } + return result2; + }, + fixIds: [fixIdPrefix, fixIdDelete, fixIdDeleteImports, fixIdInfer], + getAllCodeActions: (context2) => { + const { sourceFile, program, cancellationToken } = context2; + const checker = program.getTypeChecker(); + const sourceFiles = program.getSourceFiles(); + return codeFixAll(context2, errorCodes42, (changes, diag2) => { + const token = getTokenAtPosition(sourceFile, diag2.start); + switch (context2.fixId) { + case fixIdPrefix: + tryPrefixDeclaration(changes, diag2.code, sourceFile, token); + break; + case fixIdDeleteImports: { + const importDecl = tryGetFullImport(token); + if (importDecl) { + changes.delete(sourceFile, importDecl); + } else if (isImport(token)) { + tryDeleteDeclaration( + sourceFile, + token, + changes, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + true + ); + } + break; + } + case fixIdDelete: { + if (token.kind === 140 || isImport(token)) { + break; + } else if (isJSDocTemplateTag(token)) { + changes.delete(sourceFile, token); + } else if (token.kind === 30) { + deleteTypeParameters(changes, sourceFile, token); + } else if (isObjectBindingPattern(token.parent)) { + if (token.parent.parent.initializer) { + break; + } else if (!isParameter(token.parent.parent) || isNotProvidedArguments(token.parent.parent, checker, sourceFiles)) { + changes.delete(sourceFile, token.parent.parent); + } + } else if (isArrayBindingPattern(token.parent.parent) && token.parent.parent.parent.initializer) { + break; + } else if (canDeleteEntireVariableStatement(sourceFile, token)) { + deleteEntireVariableStatement(changes, sourceFile, token.parent); + } else { + tryDeleteDeclaration( + sourceFile, + token, + changes, + checker, + sourceFiles, + program, + cancellationToken, + /*isFixAll*/ + true + ); + } + break; + } + case fixIdInfer: + if (token.kind === 140) { + changeInferToUnknown(changes, sourceFile, token); + } + break; + default: + Debug.fail(JSON.stringify(context2.fixId)); + } + }); + } + }); + } + }); + function doChange27(changes, sourceFile, start, length2, errorCode) { + const token = getTokenAtPosition(sourceFile, start); + const statement = findAncestor(token, isStatement); + if (statement.getStart(sourceFile) !== token.getStart(sourceFile)) { + const logData = JSON.stringify({ + statementKind: Debug.formatSyntaxKind(statement.kind), + tokenKind: Debug.formatSyntaxKind(token.kind), + errorCode, + start, + length: length2 + }); + Debug.fail("Token and statement should start at the same point. " + logData); + } + const container = (isBlock2(statement.parent) ? statement.parent : statement).parent; + if (!isBlock2(statement.parent) || statement === first(statement.parent.statements)) { + switch (container.kind) { + case 245: + if (container.elseStatement) { + if (isBlock2(statement.parent)) { + break; + } else { + changes.replaceNode(sourceFile, statement, factory.createBlock(emptyArray)); + } + return; + } + case 247: + case 248: + changes.delete(sourceFile, container); + return; + } + } + if (isBlock2(statement.parent)) { + const end = start + length2; + const lastStatement = Debug.checkDefined(lastWhere(sliceAfter(statement.parent.statements, statement), (s7) => s7.pos < end), "Some statement should be last"); + changes.deleteNodeRange(sourceFile, statement, lastStatement); + } else { + changes.delete(sourceFile, statement); + } + } + function lastWhere(a7, pred) { + let last22; + for (const value2 of a7) { + if (!pred(value2)) + break; + last22 = value2; + } + return last22; + } + var fixId33, errorCodes43; + var init_fixUnreachableCode = __esm2({ + "src/services/codefixes/fixUnreachableCode.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId33 = "fixUnreachableCode"; + errorCodes43 = [Diagnostics.Unreachable_code_detected.code]; + registerCodeFix({ + errorCodes: errorCodes43, + getCodeActions(context2) { + const syntacticDiagnostics = context2.program.getSyntacticDiagnostics(context2.sourceFile, context2.cancellationToken); + if (syntacticDiagnostics.length) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange27(t8, context2.sourceFile, context2.span.start, context2.span.length, context2.errorCode)); + return [createCodeFixAction(fixId33, changes, Diagnostics.Remove_unreachable_code, fixId33, Diagnostics.Remove_all_unreachable_code)]; + }, + fixIds: [fixId33], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes43, (changes, diag2) => doChange27(changes, diag2.file, diag2.start, diag2.length, diag2.code)) + }); + } + }); + function doChange28(changes, sourceFile, start) { + const token = getTokenAtPosition(sourceFile, start); + const labeledStatement = cast(token.parent, isLabeledStatement); + const pos = token.getStart(sourceFile); + const statementPos = labeledStatement.statement.getStart(sourceFile); + const end = positionsAreOnSameLine(pos, statementPos, sourceFile) ? statementPos : skipTrivia( + sourceFile.text, + findChildOfKind(labeledStatement, 59, sourceFile).end, + /*stopAfterLineBreak*/ + true + ); + changes.deleteRange(sourceFile, { pos, end }); + } + var fixId34, errorCodes44; + var init_fixUnusedLabel = __esm2({ + "src/services/codefixes/fixUnusedLabel.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId34 = "fixUnusedLabel"; + errorCodes44 = [Diagnostics.Unused_label.code]; + registerCodeFix({ + errorCodes: errorCodes44, + getCodeActions(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange28(t8, context2.sourceFile, context2.span.start)); + return [createCodeFixAction(fixId34, changes, Diagnostics.Remove_unused_label, fixId34, Diagnostics.Remove_all_unused_labels)]; + }, + fixIds: [fixId34], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes44, (changes, diag2) => doChange28(changes, diag2.file, diag2.start)) + }); + } + }); + function doChange29(changes, sourceFile, oldTypeNode, newType, checker) { + changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode( + newType, + /*enclosingDeclaration*/ + oldTypeNode, + /*flags*/ + void 0 + )); + } + function getInfo15(sourceFile, pos, checker) { + const decl = findAncestor(getTokenAtPosition(sourceFile, pos), isTypeContainer); + const typeNode = decl && decl.type; + return typeNode && { typeNode, type: getType(checker, typeNode) }; + } + function isTypeContainer(node) { + switch (node.kind) { + case 234: + case 179: + case 180: + case 262: + case 177: + case 181: + case 200: + case 174: + case 173: + case 169: + case 172: + case 171: + case 178: + case 265: + case 216: + case 260: + return true; + default: + return false; + } + } + function getType(checker, node) { + if (isJSDocNullableType(node)) { + const type3 = checker.getTypeFromTypeNode(node.type); + if (type3 === checker.getNeverType() || type3 === checker.getVoidType()) { + return type3; + } + return checker.getUnionType( + append([type3, checker.getUndefinedType()], node.postfix ? void 0 : checker.getNullType()) + ); + } + return checker.getTypeFromTypeNode(node); + } + var fixIdPlain, fixIdNullable, errorCodes45; + var init_fixJSDocTypes = __esm2({ + "src/services/codefixes/fixJSDocTypes.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixIdPlain = "fixJSDocTypes_plain"; + fixIdNullable = "fixJSDocTypes_nullable"; + errorCodes45 = [ + Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code, + Diagnostics._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code, + Diagnostics._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code + ]; + registerCodeFix({ + errorCodes: errorCodes45, + getCodeActions(context2) { + const { sourceFile } = context2; + const checker = context2.program.getTypeChecker(); + const info2 = getInfo15(sourceFile, context2.span.start, checker); + if (!info2) + return void 0; + const { typeNode, type: type3 } = info2; + const original = typeNode.getText(sourceFile); + const actions2 = [fix(type3, fixIdPlain, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)]; + if (typeNode.kind === 321) { + actions2.push(fix(type3, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)); + } + return actions2; + function fix(type22, fixId52, fixAllDescription) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange29(t8, sourceFile, typeNode, type22, checker)); + return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type22)], fixId52, fixAllDescription); + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions(context2) { + const { fixId: fixId52, program, sourceFile } = context2; + const checker = program.getTypeChecker(); + return codeFixAll(context2, errorCodes45, (changes, err) => { + const info2 = getInfo15(err.file, err.start, checker); + if (!info2) + return; + const { typeNode, type: type3 } = info2; + const fixedType = typeNode.kind === 321 && fixId52 === fixIdNullable ? checker.getNullableType( + type3, + 32768 + /* Undefined */ + ) : type3; + doChange29(changes, sourceFile, typeNode, fixedType, checker); + }); + } + }); + } + }); + function doChange30(changes, sourceFile, name2) { + changes.replaceNodeWithText(sourceFile, name2, `${name2.text}()`); + } + function getCallName(sourceFile, start) { + const token = getTokenAtPosition(sourceFile, start); + if (isPropertyAccessExpression(token.parent)) { + let current = token.parent; + while (isPropertyAccessExpression(current.parent)) { + current = current.parent; + } + return current.name; + } + if (isIdentifier(token)) { + return token; + } + return void 0; + } + var fixId35, errorCodes46; + var init_fixMissingCallParentheses = __esm2({ + "src/services/codefixes/fixMissingCallParentheses.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId35 = "fixMissingCallParentheses"; + errorCodes46 = [ + Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code + ]; + registerCodeFix({ + errorCodes: errorCodes46, + fixIds: [fixId35], + getCodeActions(context2) { + const { sourceFile, span } = context2; + const callName = getCallName(sourceFile, span.start); + if (!callName) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange30(t8, context2.sourceFile, callName)); + return [createCodeFixAction(fixId35, changes, Diagnostics.Add_missing_call_parentheses, fixId35, Diagnostics.Add_all_missing_call_parentheses)]; + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes46, (changes, diag2) => { + const callName = getCallName(diag2.file, diag2.start); + if (callName) + doChange30(changes, diag2.file, callName); + }) + }); + } + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (isVariableDeclaration(expr.parent) && expr.parent.type && isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes3(sourceFile, start) { + const token = getTokenAtPosition(sourceFile, start); + const containingFunction = getContainingFunction(token); + if (!containingFunction) { + return; + } + let insertBefore; + switch (containingFunction.kind) { + case 174: + insertBefore = containingFunction.name; + break; + case 262: + case 218: + insertBefore = findChildOfKind(containingFunction, 100, sourceFile); + break; + case 219: + const kind = containingFunction.typeParameters ? 30 : 21; + insertBefore = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters); + break; + default: + return; + } + return insertBefore && { + insertBefore, + returnType: getReturnType(containingFunction) + }; + } + function doChange31(changes, sourceFile, { insertBefore, returnType }) { + if (returnType) { + const entityName = getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 80 || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, factory.createTypeReferenceNode("Promise", factory.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 134, insertBefore); + } + var fixId36, errorCodes47; + var init_fixAwaitInSyncFunction = __esm2({ + "src/services/codefixes/fixAwaitInSyncFunction.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId36 = "fixAwaitInSyncFunction"; + errorCodes47 = [ + Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + Diagnostics.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code, + Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code + ]; + registerCodeFix({ + errorCodes: errorCodes47, + getCodeActions(context2) { + const { sourceFile, span } = context2; + const nodes = getNodes3(sourceFile, span.start); + if (!nodes) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange31(t8, sourceFile, nodes)); + return [createCodeFixAction(fixId36, changes, Diagnostics.Add_async_modifier_to_containing_function, fixId36, Diagnostics.Add_all_missing_async_modifiers)]; + }, + fixIds: [fixId36], + getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context2) { + const seen = /* @__PURE__ */ new Map(); + return codeFixAll(context2, errorCodes47, (changes, diag2) => { + const nodes = getNodes3(diag2.file, diag2.start); + if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) + return; + doChange31(changes, context2.sourceFile, nodes); + }); + } + }); + } + }); + function doChange32(file, start, length2, code, context2) { + let startPosition; + let endPosition; + if (code === Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code) { + startPosition = start; + endPosition = start + length2; + } else if (code === Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code) { + const checker = context2.program.getTypeChecker(); + const node = getTokenAtPosition(file, start).parent; + Debug.assert(isAccessor(node), "error span of fixPropertyOverrideAccessor should only be on an accessor"); + const containingClass = node.parent; + Debug.assert(isClassLike(containingClass), "erroneous accessors should only be inside classes"); + const base = singleOrUndefined(getAllSupers(containingClass, checker)); + if (!base) + return []; + const name2 = unescapeLeadingUnderscores(getTextOfPropertyName(node.name)); + const baseProp = checker.getPropertyOfType(checker.getTypeAtLocation(base), name2); + if (!baseProp || !baseProp.valueDeclaration) + return []; + startPosition = baseProp.valueDeclaration.pos; + endPosition = baseProp.valueDeclaration.end; + file = getSourceFileOfNode(baseProp.valueDeclaration); + } else { + Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code " + code); + } + return generateAccessorFromProperty(file, context2.program, startPosition, endPosition, context2, Diagnostics.Generate_get_and_set_accessors.message); + } + var errorCodes48, fixId37; + var init_fixPropertyOverrideAccessor = __esm2({ + "src/services/codefixes/fixPropertyOverrideAccessor.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes48 = [ + Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code, + Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code + ]; + fixId37 = "fixPropertyOverrideAccessor"; + registerCodeFix({ + errorCodes: errorCodes48, + getCodeActions(context2) { + const edits = doChange32(context2.sourceFile, context2.span.start, context2.span.length, context2.errorCode, context2); + if (edits) { + return [createCodeFixAction(fixId37, edits, Diagnostics.Generate_get_and_set_accessors, fixId37, Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]; + } + }, + fixIds: [fixId37], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes48, (changes, diag2) => { + const edits = doChange32(diag2.file, diag2.start, diag2.length, diag2.code, context2); + if (edits) { + for (const edit of edits) { + changes.pushRaw(context2.sourceFile, edit); + } + } + }) + }); + } + }); + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + case Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return isSetAccessorDeclaration(getContainingFunction(token)) ? Diagnostics.Infer_type_of_0_from_usage : Diagnostics.Infer_parameter_types_from_usage; + case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Infer_parameter_types_from_usage; + case Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: + return Diagnostics.Infer_this_type_of_0_from_usage; + default: + return Diagnostics.Infer_type_of_0_from_usage; + } + } + function mapSuggestionDiagnostic(errorCode) { + switch (errorCode) { + case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code; + case Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Variable_0_implicitly_has_an_1_type.code; + case Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Parameter_0_implicitly_has_an_1_type.code; + case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code; + case Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code: + return Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code; + case Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code; + case Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code: + return Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code; + case Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code: + return Diagnostics.Member_0_implicitly_has_an_1_type.code; + } + return errorCode; + } + function doChange33(changes, sourceFile, token, errorCode, program, cancellationToken, markSeen, host, preferences) { + if (!isParameterPropertyModifier(token.kind) && token.kind !== 80 && token.kind !== 26 && token.kind !== 110) { + return void 0; + } + const { parent: parent22 } = token; + const importAdder = createImportAdder(sourceFile, program, preferences, host); + errorCode = mapSuggestionDiagnostic(errorCode); + switch (errorCode) { + case Diagnostics.Member_0_implicitly_has_an_1_type.code: + case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + if (isVariableDeclaration(parent22) && markSeen(parent22) || isPropertyDeclaration(parent22) || isPropertySignature(parent22)) { + annotateVariableDeclaration(changes, importAdder, sourceFile, parent22, program, host, cancellationToken); + importAdder.writeFixes(changes); + return parent22; + } + if (isPropertyAccessExpression(parent22)) { + const type3 = inferTypeForVariableFromUsage(parent22.name, program, cancellationToken); + const typeNode = getTypeNodeIfAccessible(type3, parent22, program, host); + if (typeNode) { + const typeTag = factory.createJSDocTypeTag( + /*tagName*/ + void 0, + factory.createJSDocTypeExpression(typeNode), + /*comment*/ + void 0 + ); + changes.addJSDocTags(sourceFile, cast(parent22.parent.parent, isExpressionStatement), [typeTag]); + } + importAdder.writeFixes(changes); + return parent22; + } + return void 0; + case Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + const symbol = program.getTypeChecker().getSymbolAtLocation(token); + if (symbol && symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && markSeen(symbol.valueDeclaration)) { + annotateVariableDeclaration(changes, importAdder, getSourceFileOfNode(symbol.valueDeclaration), symbol.valueDeclaration, program, host, cancellationToken); + importAdder.writeFixes(changes); + return symbol.valueDeclaration; + } + return void 0; + } + } + const containingFunction = getContainingFunction(token); + if (containingFunction === void 0) { + return void 0; + } + let declaration; + switch (errorCode) { + case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (isSetAccessorDeclaration(containingFunction)) { + annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + break; + } + case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + if (markSeen(containingFunction)) { + const param = cast(parent22, isParameter); + annotateParameters(changes, importAdder, sourceFile, param, containingFunction, program, host, cancellationToken); + declaration = param; + } + break; + case Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + if (isGetAccessorDeclaration(containingFunction) && isIdentifier(containingFunction.name)) { + annotate(changes, importAdder, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program, host); + declaration = containingFunction; + } + break; + case Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + if (isSetAccessorDeclaration(containingFunction)) { + annotateSetAccessor(changes, importAdder, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + } + break; + case Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code: + if (ts_textChanges_exports.isThisTypeAnnotatable(containingFunction) && markSeen(containingFunction)) { + annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken); + declaration = containingFunction; + } + break; + default: + return Debug.fail(String(errorCode)); + } + importAdder.writeFixes(changes); + return declaration; + } + function annotateVariableDeclaration(changes, importAdder, sourceFile, declaration, program, host, cancellationToken) { + if (isIdentifier(declaration.name)) { + annotate(changes, importAdder, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program, host); + } + } + function annotateParameters(changes, importAdder, sourceFile, parameterDeclaration, containingFunction, program, host, cancellationToken) { + if (!isIdentifier(parameterDeclaration.name)) { + return; + } + const parameterInferences = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken); + Debug.assert(containingFunction.parameters.length === parameterInferences.length, "Parameter count and inference count should match"); + if (isInJSFile(containingFunction)) { + annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host); + } else { + const needParens = isArrowFunction(containingFunction) && !findChildOfKind(containingFunction, 21, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, first(containingFunction.parameters), factory.createToken( + 21 + /* OpenParenToken */ + )); + for (const { declaration, type: type3 } of parameterInferences) { + if (declaration && !declaration.type && !declaration.initializer) { + annotate(changes, importAdder, sourceFile, declaration, type3, program, host); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, last2(containingFunction.parameters), factory.createToken( + 22 + /* CloseParenToken */ + )); + } + } + function annotateThis(changes, sourceFile, containingFunction, program, host, cancellationToken) { + const references = getFunctionReferences(containingFunction, sourceFile, program, cancellationToken); + if (!references || !references.length) { + return; + } + const thisInference = inferTypeFromReferences(program, references, cancellationToken).thisParameter(); + const typeNode = getTypeNodeIfAccessible(thisInference, containingFunction, program, host); + if (!typeNode) { + return; + } + if (isInJSFile(containingFunction)) { + annotateJSDocThis(changes, sourceFile, containingFunction, typeNode); + } else { + changes.tryInsertThisTypeAnnotation(sourceFile, containingFunction, typeNode); + } + } + function annotateJSDocThis(changes, sourceFile, containingFunction, typeNode) { + changes.addJSDocTags(sourceFile, containingFunction, [ + factory.createJSDocThisTag( + /*tagName*/ + void 0, + factory.createJSDocTypeExpression(typeNode) + ) + ]); + } + function annotateSetAccessor(changes, importAdder, sourceFile, setAccessorDeclaration, program, host, cancellationToken) { + const param = firstOrUndefined(setAccessorDeclaration.parameters); + if (param && isIdentifier(setAccessorDeclaration.name) && isIdentifier(param.name)) { + let type3 = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken); + if (type3 === program.getTypeChecker().getAnyType()) { + type3 = inferTypeForVariableFromUsage(param.name, program, cancellationToken); + } + if (isInJSFile(setAccessorDeclaration)) { + annotateJSDocParameters(changes, sourceFile, [{ declaration: param, type: type3 }], program, host); + } else { + annotate(changes, importAdder, sourceFile, param, type3, program, host); + } + } + } + function annotate(changes, importAdder, sourceFile, declaration, type3, program, host) { + const typeNode = getTypeNodeIfAccessible(type3, declaration, program, host); + if (typeNode) { + if (isInJSFile(sourceFile) && declaration.kind !== 171) { + const parent22 = isVariableDeclaration(declaration) ? tryCast(declaration.parent.parent, isVariableStatement) : declaration; + if (!parent22) { + return; + } + const typeExpression = factory.createJSDocTypeExpression(typeNode); + const typeTag = isGetAccessorDeclaration(declaration) ? factory.createJSDocReturnTag( + /*tagName*/ + void 0, + typeExpression, + /*comment*/ + void 0 + ) : factory.createJSDocTypeTag( + /*tagName*/ + void 0, + typeExpression, + /*comment*/ + void 0 + ); + changes.addJSDocTags(sourceFile, parent22, [typeTag]); + } else if (!tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, getEmitScriptTarget(program.getCompilerOptions()))) { + changes.tryInsertTypeAnnotation(sourceFile, declaration, typeNode); + } + } + } + function tryReplaceImportTypeNodeWithAutoImport(typeNode, declaration, sourceFile, changes, importAdder, scriptTarget) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference && changes.tryInsertTypeAnnotation(sourceFile, declaration, importableReference.typeNode)) { + forEach4(importableReference.symbols, (s7) => importAdder.addImportFromExportedSymbol( + s7, + /*isValidTypeOnlyUseSite*/ + true + )); + return true; + } + return false; + } + function annotateJSDocParameters(changes, sourceFile, parameterInferences, program, host) { + const signature = parameterInferences.length && parameterInferences[0].declaration.parent; + if (!signature) { + return; + } + const inferences = mapDefined(parameterInferences, (inference) => { + const param = inference.declaration; + if (param.initializer || getJSDocType(param) || !isIdentifier(param.name)) { + return; + } + const typeNode = inference.type && getTypeNodeIfAccessible(inference.type, param, program, host); + if (typeNode) { + const name2 = factory.cloneNode(param.name); + setEmitFlags( + name2, + 3072 | 4096 + /* NoNestedComments */ + ); + return { name: factory.cloneNode(param.name), param, isOptional: !!inference.isOptional, typeNode }; + } + }); + if (!inferences.length) { + return; + } + if (isArrowFunction(signature) || isFunctionExpression(signature)) { + const needParens = isArrowFunction(signature) && !findChildOfKind(signature, 21, sourceFile); + if (needParens) { + changes.insertNodeBefore(sourceFile, first(signature.parameters), factory.createToken( + 21 + /* OpenParenToken */ + )); + } + forEach4(inferences, ({ typeNode, param }) => { + const typeTag = factory.createJSDocTypeTag( + /*tagName*/ + void 0, + factory.createJSDocTypeExpression(typeNode) + ); + const jsDoc = factory.createJSDocComment( + /*comment*/ + void 0, + [typeTag] + ); + changes.insertNodeAt(sourceFile, param.getStart(sourceFile), jsDoc, { suffix: " " }); + }); + if (needParens) { + changes.insertNodeAfter(sourceFile, last2(signature.parameters), factory.createToken( + 22 + /* CloseParenToken */ + )); + } + } else { + const paramTags = map4(inferences, ({ name: name2, typeNode, isOptional: isOptional2 }) => factory.createJSDocParameterTag( + /*tagName*/ + void 0, + name2, + /*isBracketed*/ + !!isOptional2, + factory.createJSDocTypeExpression(typeNode), + /*isNameFirst*/ + false, + /*comment*/ + void 0 + )); + changes.addJSDocTags(sourceFile, signature, paramTags); + } + } + function getReferences(token, program, cancellationToken) { + return mapDefined(ts_FindAllReferences_exports.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), (entry) => entry.kind !== ts_FindAllReferences_exports.EntryKind.Span ? tryCast(entry.node, isIdentifier) : void 0); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + const references = getReferences(token, program, cancellationToken); + return inferTypeFromReferences(program, references, cancellationToken).single(); + } + function inferTypeForParametersFromUsage(func, sourceFile, program, cancellationToken) { + const references = getFunctionReferences(func, sourceFile, program, cancellationToken); + return references && inferTypeFromReferences(program, references, cancellationToken).parameters(func) || func.parameters.map((p7) => ({ + declaration: p7, + type: isIdentifier(p7.name) ? inferTypeForVariableFromUsage(p7.name, program, cancellationToken) : program.getTypeChecker().getAnyType() + })); + } + function getFunctionReferences(containingFunction, sourceFile, program, cancellationToken) { + let searchToken; + switch (containingFunction.kind) { + case 176: + searchToken = findChildOfKind(containingFunction, 137, sourceFile); + break; + case 219: + case 218: + const parent22 = containingFunction.parent; + searchToken = (isVariableDeclaration(parent22) || isPropertyDeclaration(parent22)) && isIdentifier(parent22.name) ? parent22.name : containingFunction.name; + break; + case 262: + case 174: + case 173: + searchToken = containingFunction.name; + break; + } + if (!searchToken) { + return void 0; + } + return getReferences(searchToken, program, cancellationToken); + } + function inferTypeFromReferences(program, references, cancellationToken) { + const checker = program.getTypeChecker(); + const builtinConstructors = { + string: () => checker.getStringType(), + number: () => checker.getNumberType(), + Array: (t8) => checker.createArrayType(t8), + Promise: (t8) => checker.createPromiseType(t8) + }; + const builtins = [ + checker.getStringType(), + checker.getNumberType(), + checker.createArrayType(checker.getAnyType()), + checker.createPromiseType(checker.getAnyType()) + ]; + return { + single: single2, + parameters, + thisParameter + }; + function createEmptyUsage() { + return { + isNumber: void 0, + isString: void 0, + isNumberOrString: void 0, + candidateTypes: void 0, + properties: void 0, + calls: void 0, + constructs: void 0, + numberIndex: void 0, + stringIndex: void 0, + candidateThisTypes: void 0, + inferredTypes: void 0 + }; + } + function combineUsages(usages) { + const combinedProperties = /* @__PURE__ */ new Map(); + for (const u7 of usages) { + if (u7.properties) { + u7.properties.forEach((p7, name2) => { + if (!combinedProperties.has(name2)) { + combinedProperties.set(name2, []); + } + combinedProperties.get(name2).push(p7); + }); + } + } + const properties = /* @__PURE__ */ new Map(); + combinedProperties.forEach((ps, name2) => { + properties.set(name2, combineUsages(ps)); + }); + return { + isNumber: usages.some((u7) => u7.isNumber), + isString: usages.some((u7) => u7.isString), + isNumberOrString: usages.some((u7) => u7.isNumberOrString), + candidateTypes: flatMap2(usages, (u7) => u7.candidateTypes), + properties, + calls: flatMap2(usages, (u7) => u7.calls), + constructs: flatMap2(usages, (u7) => u7.constructs), + numberIndex: forEach4(usages, (u7) => u7.numberIndex), + stringIndex: forEach4(usages, (u7) => u7.stringIndex), + candidateThisTypes: flatMap2(usages, (u7) => u7.candidateThisTypes), + inferredTypes: void 0 + // clear type cache + }; + } + function single2() { + return combineTypes(inferTypesFromReferencesSingle(references)); + } + function parameters(declaration) { + if (references.length === 0 || !declaration.parameters) { + return void 0; + } + const usage = createEmptyUsage(); + for (const reference of references) { + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + const calls = [...usage.constructs || [], ...usage.calls || []]; + return declaration.parameters.map((parameter, parameterIndex) => { + const types3 = []; + const isRest = isRestParameter(parameter); + let isOptional2 = false; + for (const call of calls) { + if (call.argumentTypes.length <= parameterIndex) { + isOptional2 = isInJSFile(declaration); + types3.push(checker.getUndefinedType()); + } else if (isRest) { + for (let i7 = parameterIndex; i7 < call.argumentTypes.length; i7++) { + types3.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[i7])); + } + } else { + types3.push(checker.getBaseTypeOfLiteralType(call.argumentTypes[parameterIndex])); + } + } + if (isIdentifier(parameter.name)) { + const inferred = inferTypesFromReferencesSingle(getReferences(parameter.name, program, cancellationToken)); + types3.push(...isRest ? mapDefined(inferred, checker.getElementTypeOfArrayType) : inferred); + } + const type3 = combineTypes(types3); + return { + type: isRest ? checker.createArrayType(type3) : type3, + isOptional: isOptional2 && !isRest, + declaration: parameter + }; + }); + } + function thisParameter() { + const usage = createEmptyUsage(); + for (const reference of references) { + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + return combineTypes(usage.candidateThisTypes || emptyArray); + } + function inferTypesFromReferencesSingle(references2) { + const usage = createEmptyUsage(); + for (const reference of references2) { + cancellationToken.throwIfCancellationRequested(); + calculateUsageOfNode(reference, usage); + } + return inferTypes(usage); + } + function calculateUsageOfNode(node, usage) { + while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + switch (node.parent.kind) { + case 244: + inferTypeFromExpressionStatement(node, usage); + break; + case 225: + usage.isNumber = true; + break; + case 224: + inferTypeFromPrefixUnaryExpression(node.parent, usage); + break; + case 226: + inferTypeFromBinaryExpression(node, node.parent, usage); + break; + case 296: + case 297: + inferTypeFromSwitchStatementLabel(node.parent, usage); + break; + case 213: + case 214: + if (node.parent.expression === node) { + inferTypeFromCallExpression(node.parent, usage); + } else { + inferTypeFromContextualType(node, usage); + } + break; + case 211: + inferTypeFromPropertyAccessExpression(node.parent, usage); + break; + case 212: + inferTypeFromPropertyElementExpression(node.parent, node, usage); + break; + case 303: + case 304: + inferTypeFromPropertyAssignment(node.parent, usage); + break; + case 172: + inferTypeFromPropertyDeclaration(node.parent, usage); + break; + case 260: { + const { name: name2, initializer } = node.parent; + if (node === name2) { + if (initializer) { + addCandidateType(usage, checker.getTypeAtLocation(initializer)); + } + break; + } + } + default: + return inferTypeFromContextualType(node, usage); + } + } + function inferTypeFromContextualType(node, usage) { + if (isExpressionNode(node)) { + addCandidateType(usage, checker.getContextualType(node)); + } + } + function inferTypeFromExpressionStatement(node, usage) { + addCandidateType(usage, isCallExpression(node) ? checker.getVoidType() : checker.getAnyType()); + } + function inferTypeFromPrefixUnaryExpression(node, usage) { + switch (node.operator) { + case 46: + case 47: + case 41: + case 55: + usage.isNumber = true; + break; + case 40: + usage.isNumberOrString = true; + break; + } + } + function inferTypeFromBinaryExpression(node, parent22, usage) { + switch (parent22.operatorToken.kind) { + case 43: + case 42: + case 44: + case 45: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 66: + case 68: + case 67: + case 69: + case 70: + case 74: + case 75: + case 79: + case 71: + case 73: + case 72: + case 41: + case 30: + case 33: + case 32: + case 34: + const operandType = checker.getTypeAtLocation(parent22.left === node ? parent22.right : parent22.left); + if (operandType.flags & 1056) { + addCandidateType(usage, operandType); + } else { + usage.isNumber = true; + } + break; + case 65: + case 40: + const otherOperandType = checker.getTypeAtLocation(parent22.left === node ? parent22.right : parent22.left); + if (otherOperandType.flags & 1056) { + addCandidateType(usage, otherOperandType); + } else if (otherOperandType.flags & 296) { + usage.isNumber = true; + } else if (otherOperandType.flags & 402653316) { + usage.isString = true; + } else if (otherOperandType.flags & 1) { + } else { + usage.isNumberOrString = true; + } + break; + case 64: + case 35: + case 37: + case 38: + case 36: + case 77: + case 78: + case 76: + addCandidateType(usage, checker.getTypeAtLocation(parent22.left === node ? parent22.right : parent22.left)); + break; + case 103: + if (node === parent22.left) { + usage.isString = true; + } + break; + case 57: + case 61: + if (node === parent22.left && (node.parent.parent.kind === 260 || isAssignmentExpression( + node.parent.parent, + /*excludeCompoundAssignment*/ + true + ))) { + addCandidateType(usage, checker.getTypeAtLocation(parent22.right)); + } + break; + case 56: + case 28: + case 104: + break; + } + } + function inferTypeFromSwitchStatementLabel(parent22, usage) { + addCandidateType(usage, checker.getTypeAtLocation(parent22.parent.parent.expression)); + } + function inferTypeFromCallExpression(parent22, usage) { + const call = { + argumentTypes: [], + return_: createEmptyUsage() + }; + if (parent22.arguments) { + for (const argument of parent22.arguments) { + call.argumentTypes.push(checker.getTypeAtLocation(argument)); + } + } + calculateUsageOfNode(parent22, call.return_); + if (parent22.kind === 213) { + (usage.calls || (usage.calls = [])).push(call); + } else { + (usage.constructs || (usage.constructs = [])).push(call); + } + } + function inferTypeFromPropertyAccessExpression(parent22, usage) { + const name2 = escapeLeadingUnderscores(parent22.name.text); + if (!usage.properties) { + usage.properties = /* @__PURE__ */ new Map(); + } + const propertyUsage = usage.properties.get(name2) || createEmptyUsage(); + calculateUsageOfNode(parent22, propertyUsage); + usage.properties.set(name2, propertyUsage); + } + function inferTypeFromPropertyElementExpression(parent22, node, usage) { + if (node === parent22.argumentExpression) { + usage.isNumberOrString = true; + return; + } else { + const indexType = checker.getTypeAtLocation(parent22.argumentExpression); + const indexUsage = createEmptyUsage(); + calculateUsageOfNode(parent22, indexUsage); + if (indexType.flags & 296) { + usage.numberIndex = indexUsage; + } else { + usage.stringIndex = indexUsage; + } + } + } + function inferTypeFromPropertyAssignment(assignment, usage) { + const nodeWithRealType = isVariableDeclaration(assignment.parent.parent) ? assignment.parent.parent : assignment.parent; + addCandidateThisType(usage, checker.getTypeAtLocation(nodeWithRealType)); + } + function inferTypeFromPropertyDeclaration(declaration, usage) { + addCandidateThisType(usage, checker.getTypeAtLocation(declaration.parent)); + } + function removeLowPriorityInferences(inferences, priorities) { + const toRemove = []; + for (const i7 of inferences) { + for (const { high, low } of priorities) { + if (high(i7)) { + Debug.assert(!low(i7), "Priority can't have both low and high"); + toRemove.push(low); + } + } + } + return inferences.filter((i7) => toRemove.every((f8) => !f8(i7))); + } + function combineFromUsage(usage) { + return combineTypes(inferTypes(usage)); + } + function combineTypes(inferences) { + if (!inferences.length) + return checker.getAnyType(); + const stringNumber = checker.getUnionType([checker.getStringType(), checker.getNumberType()]); + const priorities = [ + { + high: (t8) => t8 === checker.getStringType() || t8 === checker.getNumberType(), + low: (t8) => t8 === stringNumber + }, + { + high: (t8) => !(t8.flags & (1 | 16384)), + low: (t8) => !!(t8.flags & (1 | 16384)) + }, + { + high: (t8) => !(t8.flags & (98304 | 1 | 16384)) && !(getObjectFlags(t8) & 16), + low: (t8) => !!(getObjectFlags(t8) & 16) + } + ]; + let good = removeLowPriorityInferences(inferences, priorities); + const anons = good.filter( + (i7) => getObjectFlags(i7) & 16 + /* Anonymous */ + ); + if (anons.length) { + good = good.filter((i7) => !(getObjectFlags(i7) & 16)); + good.push(combineAnonymousTypes(anons)); + } + return checker.getWidenedType(checker.getUnionType( + good.map(checker.getBaseTypeOfLiteralType), + 2 + /* Subtype */ + )); + } + function combineAnonymousTypes(anons) { + if (anons.length === 1) { + return anons[0]; + } + const calls = []; + const constructs = []; + const stringIndices = []; + const numberIndices = []; + let stringIndexReadonly = false; + let numberIndexReadonly = false; + const props = createMultiMap(); + for (const anon2 of anons) { + for (const p7 of checker.getPropertiesOfType(anon2)) { + props.add(p7.escapedName, p7.valueDeclaration ? checker.getTypeOfSymbolAtLocation(p7, p7.valueDeclaration) : checker.getAnyType()); + } + calls.push(...checker.getSignaturesOfType( + anon2, + 0 + /* Call */ + )); + constructs.push(...checker.getSignaturesOfType( + anon2, + 1 + /* Construct */ + )); + const stringIndexInfo = checker.getIndexInfoOfType( + anon2, + 0 + /* String */ + ); + if (stringIndexInfo) { + stringIndices.push(stringIndexInfo.type); + stringIndexReadonly = stringIndexReadonly || stringIndexInfo.isReadonly; + } + const numberIndexInfo = checker.getIndexInfoOfType( + anon2, + 1 + /* Number */ + ); + if (numberIndexInfo) { + numberIndices.push(numberIndexInfo.type); + numberIndexReadonly = numberIndexReadonly || numberIndexInfo.isReadonly; + } + } + const members = mapEntries(props, (name2, types3) => { + const isOptional2 = types3.length < anons.length ? 16777216 : 0; + const s7 = checker.createSymbol(4 | isOptional2, name2); + s7.links.type = checker.getUnionType(types3); + return [name2, s7]; + }); + const indexInfos = []; + if (stringIndices.length) + indexInfos.push(checker.createIndexInfo(checker.getStringType(), checker.getUnionType(stringIndices), stringIndexReadonly)); + if (numberIndices.length) + indexInfos.push(checker.createIndexInfo(checker.getNumberType(), checker.getUnionType(numberIndices), numberIndexReadonly)); + return checker.createAnonymousType( + anons[0].symbol, + members, + calls, + constructs, + indexInfos + ); + } + function inferTypes(usage) { + var _a2, _b, _c; + const types3 = []; + if (usage.isNumber) { + types3.push(checker.getNumberType()); + } + if (usage.isString) { + types3.push(checker.getStringType()); + } + if (usage.isNumberOrString) { + types3.push(checker.getUnionType([checker.getStringType(), checker.getNumberType()])); + } + if (usage.numberIndex) { + types3.push(checker.createArrayType(combineFromUsage(usage.numberIndex))); + } + if (((_a2 = usage.properties) == null ? void 0 : _a2.size) || ((_b = usage.constructs) == null ? void 0 : _b.length) || usage.stringIndex) { + types3.push(inferStructuralType(usage)); + } + const candidateTypes = (usage.candidateTypes || []).map((t8) => checker.getBaseTypeOfLiteralType(t8)); + const callsType = ((_c = usage.calls) == null ? void 0 : _c.length) ? inferStructuralType(usage) : void 0; + if (callsType && candidateTypes) { + types3.push(checker.getUnionType( + [callsType, ...candidateTypes], + 2 + /* Subtype */ + )); + } else { + if (callsType) { + types3.push(callsType); + } + if (length(candidateTypes)) { + types3.push(...candidateTypes); + } + } + types3.push(...inferNamedTypesFromProperties(usage)); + return types3; + } + function inferStructuralType(usage) { + const members = /* @__PURE__ */ new Map(); + if (usage.properties) { + usage.properties.forEach((u7, name2) => { + const symbol = checker.createSymbol(4, name2); + symbol.links.type = combineFromUsage(u7); + members.set(name2, symbol); + }); + } + const callSignatures = usage.calls ? [getSignatureFromCalls(usage.calls)] : []; + const constructSignatures = usage.constructs ? [getSignatureFromCalls(usage.constructs)] : []; + const indexInfos = usage.stringIndex ? [checker.createIndexInfo( + checker.getStringType(), + combineFromUsage(usage.stringIndex), + /*isReadonly*/ + false + )] : []; + return checker.createAnonymousType( + /*symbol*/ + void 0, + members, + callSignatures, + constructSignatures, + indexInfos + ); + } + function inferNamedTypesFromProperties(usage) { + if (!usage.properties || !usage.properties.size) + return []; + const types3 = builtins.filter((t8) => allPropertiesAreAssignableToUsage(t8, usage)); + if (0 < types3.length && types3.length < 3) { + return types3.map((t8) => inferInstantiationFromUsage(t8, usage)); + } + return []; + } + function allPropertiesAreAssignableToUsage(type3, usage) { + if (!usage.properties) + return false; + return !forEachEntry(usage.properties, (propUsage, name2) => { + const source = checker.getTypeOfPropertyOfType(type3, name2); + if (!source) { + return true; + } + if (propUsage.calls) { + const sigs = checker.getSignaturesOfType( + source, + 0 + /* Call */ + ); + return !sigs.length || !checker.isTypeAssignableTo(source, getFunctionFromCalls(propUsage.calls)); + } else { + return !checker.isTypeAssignableTo(source, combineFromUsage(propUsage)); + } + }); + } + function inferInstantiationFromUsage(type3, usage) { + if (!(getObjectFlags(type3) & 4) || !usage.properties) { + return type3; + } + const generic = type3.target; + const singleTypeParameter = singleOrUndefined(generic.typeParameters); + if (!singleTypeParameter) + return type3; + const types3 = []; + usage.properties.forEach((propUsage, name2) => { + const genericPropertyType = checker.getTypeOfPropertyOfType(generic, name2); + Debug.assert(!!genericPropertyType, "generic should have all the properties of its reference."); + types3.push(...inferTypeParameters(genericPropertyType, combineFromUsage(propUsage), singleTypeParameter)); + }); + return builtinConstructors[type3.symbol.escapedName](combineTypes(types3)); + } + function inferTypeParameters(genericType, usageType, typeParameter) { + if (genericType === typeParameter) { + return [usageType]; + } else if (genericType.flags & 3145728) { + return flatMap2(genericType.types, (t8) => inferTypeParameters(t8, usageType, typeParameter)); + } else if (getObjectFlags(genericType) & 4 && getObjectFlags(usageType) & 4) { + const genericArgs = checker.getTypeArguments(genericType); + const usageArgs = checker.getTypeArguments(usageType); + const types3 = []; + if (genericArgs && usageArgs) { + for (let i7 = 0; i7 < genericArgs.length; i7++) { + if (usageArgs[i7]) { + types3.push(...inferTypeParameters(genericArgs[i7], usageArgs[i7], typeParameter)); + } + } + } + return types3; + } + const genericSigs = checker.getSignaturesOfType( + genericType, + 0 + /* Call */ + ); + const usageSigs = checker.getSignaturesOfType( + usageType, + 0 + /* Call */ + ); + if (genericSigs.length === 1 && usageSigs.length === 1) { + return inferFromSignatures(genericSigs[0], usageSigs[0], typeParameter); + } + return []; + } + function inferFromSignatures(genericSig, usageSig, typeParameter) { + var _a2; + const types3 = []; + for (let i7 = 0; i7 < genericSig.parameters.length; i7++) { + const genericParam = genericSig.parameters[i7]; + const usageParam = usageSig.parameters[i7]; + const isRest = genericSig.declaration && isRestParameter(genericSig.declaration.parameters[i7]); + if (!usageParam) { + break; + } + let genericParamType = genericParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(genericParam, genericParam.valueDeclaration) : checker.getAnyType(); + const elementType = isRest && checker.getElementTypeOfArrayType(genericParamType); + if (elementType) { + genericParamType = elementType; + } + const targetType = ((_a2 = tryCast(usageParam, isTransientSymbol)) == null ? void 0 : _a2.links.type) || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType()); + types3.push(...inferTypeParameters(genericParamType, targetType, typeParameter)); + } + const genericReturn = checker.getReturnTypeOfSignature(genericSig); + const usageReturn = checker.getReturnTypeOfSignature(usageSig); + types3.push(...inferTypeParameters(genericReturn, usageReturn, typeParameter)); + return types3; + } + function getFunctionFromCalls(calls) { + return checker.createAnonymousType( + /*symbol*/ + void 0, + createSymbolTable(), + [getSignatureFromCalls(calls)], + emptyArray, + emptyArray + ); + } + function getSignatureFromCalls(calls) { + const parameters2 = []; + const length2 = Math.max(...calls.map((c7) => c7.argumentTypes.length)); + for (let i7 = 0; i7 < length2; i7++) { + const symbol = checker.createSymbol(1, escapeLeadingUnderscores(`arg${i7}`)); + symbol.links.type = combineTypes(calls.map((call) => call.argumentTypes[i7] || checker.getUndefinedType())); + if (calls.some((call) => call.argumentTypes[i7] === void 0)) { + symbol.flags |= 16777216; + } + parameters2.push(symbol); + } + const returnType = combineFromUsage(combineUsages(calls.map((call) => call.return_))); + return checker.createSignature( + /*declaration*/ + void 0, + /*typeParameters*/ + void 0, + /*thisParameter*/ + void 0, + parameters2, + returnType, + /*typePredicate*/ + void 0, + length2, + 0 + /* None */ + ); + } + function addCandidateType(usage, type3) { + if (type3 && !(type3.flags & 1) && !(type3.flags & 131072)) { + (usage.candidateTypes || (usage.candidateTypes = [])).push(type3); + } + } + function addCandidateThisType(usage, type3) { + if (type3 && !(type3.flags & 1) && !(type3.flags & 131072)) { + (usage.candidateThisTypes || (usage.candidateThisTypes = [])).push(type3); + } + } + } + var fixId38, errorCodes49; + var init_inferFromUsage = __esm2({ + "src/services/codefixes/inferFromUsage.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId38 = "inferFromUsage"; + errorCodes49 = [ + // Variable declarations + Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + // Variable uses + Diagnostics.Variable_0_implicitly_has_an_1_type.code, + // Parameter declarations + Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + // Get Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + // Set Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + // Property declarations + Diagnostics.Member_0_implicitly_has_an_1_type.code, + //// Suggestions + // Variable declarations + Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code, + // Variable uses + Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + // Parameter declarations + Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code, + // Get Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code, + Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code, + // Set Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code, + // Property declarations + Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code, + // Function expressions and declarations + Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code + ]; + registerCodeFix({ + errorCodes: errorCodes49, + getCodeActions(context2) { + const { sourceFile, program, span: { start }, errorCode, cancellationToken, host, preferences } = context2; + const token = getTokenAtPosition(sourceFile, start); + let declaration; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (changes2) => { + declaration = doChange33( + changes2, + sourceFile, + token, + errorCode, + program, + cancellationToken, + /*markSeen*/ + returnTrue, + host, + preferences + ); + }); + const name2 = declaration && getNameOfDeclaration(declaration); + return !name2 || changes.length === 0 ? void 0 : [createCodeFixAction(fixId38, changes, [getDiagnostic(errorCode, token), getTextOfNode(name2)], fixId38, Diagnostics.Infer_all_types_from_usage)]; + }, + fixIds: [fixId38], + getAllCodeActions(context2) { + const { sourceFile, program, cancellationToken, host, preferences } = context2; + const markSeen = nodeSeenTracker(); + return codeFixAll(context2, errorCodes49, (changes, err) => { + doChange33(changes, sourceFile, getTokenAtPosition(err.file, err.start), err.code, program, cancellationToken, markSeen, host, preferences); + }); + } + }); + } + }); + function getInfo16(sourceFile, checker, pos) { + if (isInJSFile(sourceFile)) { + return void 0; + } + const token = getTokenAtPosition(sourceFile, pos); + const func = findAncestor(token, isFunctionLikeDeclaration); + const returnTypeNode = func == null ? void 0 : func.type; + if (!returnTypeNode) { + return void 0; + } + const returnType = checker.getTypeFromTypeNode(returnTypeNode); + const promisedType = checker.getAwaitedType(returnType) || checker.getVoidType(); + const promisedTypeNode = checker.typeToTypeNode( + promisedType, + /*enclosingDeclaration*/ + returnTypeNode, + /*flags*/ + void 0 + ); + if (promisedTypeNode) { + return { returnTypeNode, returnType, promisedTypeNode, promisedType }; + } + } + function doChange34(changes, sourceFile, returnTypeNode, promisedTypeNode) { + changes.replaceNode(sourceFile, returnTypeNode, factory.createTypeReferenceNode("Promise", [promisedTypeNode])); + } + var fixId39, errorCodes50; + var init_fixReturnTypeInAsyncFunction = __esm2({ + "src/services/codefixes/fixReturnTypeInAsyncFunction.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId39 = "fixReturnTypeInAsyncFunction"; + errorCodes50 = [ + Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code + ]; + registerCodeFix({ + errorCodes: errorCodes50, + fixIds: [fixId39], + getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context2) { + const { sourceFile, program, span } = context2; + const checker = program.getTypeChecker(); + const info2 = getInfo16(sourceFile, program.getTypeChecker(), span.start); + if (!info2) { + return void 0; + } + const { returnTypeNode, returnType, promisedTypeNode, promisedType } = info2; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange34(t8, sourceFile, returnTypeNode, promisedTypeNode)); + return [createCodeFixAction( + fixId39, + changes, + [Diagnostics.Replace_0_with_Promise_1, checker.typeToString(returnType), checker.typeToString(promisedType)], + fixId39, + Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions + )]; + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes50, (changes, diag2) => { + const info2 = getInfo16(diag2.file, context2.program.getTypeChecker(), diag2.start); + if (info2) { + doChange34(changes, diag2.file, info2.returnTypeNode, info2.promisedTypeNode); + } + }) + }); + } + }); + function makeChange8(changes, sourceFile, position, seenLines) { + const { line: lineNumber } = getLineAndCharacterOfPosition(sourceFile, position); + if (!seenLines || tryAddToSet(seenLines, lineNumber)) { + changes.insertCommentBeforeLine(sourceFile, lineNumber, position, " @ts-ignore"); + } + } + var fixName4, fixId40, errorCodes51; + var init_disableJsDiagnostics = __esm2({ + "src/services/codefixes/disableJsDiagnostics.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName4 = "disableJsDiagnostics"; + fixId40 = "disableJsDiagnostics"; + errorCodes51 = mapDefined(Object.keys(Diagnostics), (key) => { + const diag2 = Diagnostics[key]; + return diag2.category === 1 ? diag2.code : void 0; + }); + registerCodeFix({ + errorCodes: errorCodes51, + getCodeActions: function getCodeActionsToDisableJsDiagnostics(context2) { + const { sourceFile, program, span, host, formatContext } = context2; + if (!isInJSFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return void 0; + } + const newLineCharacter = sourceFile.checkJsDirective ? "" : getNewLineOrDefaultFromHost(host, formatContext.options); + const fixes = [ + // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. + createCodeFixActionWithoutFixAll( + fixName4, + [createFileTextChanges(sourceFile.fileName, [ + createTextChange( + sourceFile.checkJsDirective ? createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : createTextSpan(0, 0), + `// @ts-nocheck${newLineCharacter}` + ) + ])], + Diagnostics.Disable_checking_for_this_file + ) + ]; + if (ts_textChanges_exports.isValidLocationToAddComment(sourceFile, span.start)) { + fixes.unshift(createCodeFixAction(fixName4, ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange8(t8, sourceFile, span.start)), Diagnostics.Ignore_this_error_message, fixId40, Diagnostics.Add_ts_ignore_to_all_error_messages)); + } + return fixes; + }, + fixIds: [fixId40], + getAllCodeActions: (context2) => { + const seenLines = /* @__PURE__ */ new Set(); + return codeFixAll(context2, errorCodes51, (changes, diag2) => { + if (ts_textChanges_exports.isValidLocationToAddComment(diag2.file, diag2.start)) { + makeChange8(changes, diag2.file, diag2.start, seenLines); + } + }); + } + }); + } + }); + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, sourceFile, context2, preferences, importAdder, addClassElement) { + const classMembers = classDeclaration.symbol.members; + for (const symbol of possiblyMissingSymbols) { + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol( + symbol, + classDeclaration, + sourceFile, + context2, + preferences, + importAdder, + addClassElement, + /*body*/ + void 0 + ); + } + } + } + function getNoopSymbolTrackerWithResolver(context2) { + return { + trackSymbol: () => false, + moduleResolverHost: getModuleSpecifierResolverHost(context2.program, context2.host) + }; + } + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, sourceFile, context2, preferences, importAdder, addClassElement, body, preserveOptional = 3, isAmbient = false) { + const declarations = symbol.getDeclarations(); + const declaration = firstOrUndefined(declarations); + const checker = context2.program.getTypeChecker(); + const scriptTarget = getEmitScriptTarget(context2.program.getCompilerOptions()); + const kind = (declaration == null ? void 0 : declaration.kind) ?? 171; + const declarationName = createDeclarationName(symbol, declaration); + const effectiveModifierFlags = declaration ? getEffectiveModifierFlags(declaration) : 0; + let modifierFlags = effectiveModifierFlags & 256; + modifierFlags |= effectiveModifierFlags & 1 ? 1 : effectiveModifierFlags & 4 ? 4 : 0; + if (declaration && isAutoAccessorPropertyDeclaration(declaration)) { + modifierFlags |= 512; + } + const modifiers = createModifiers(); + const type3 = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + const optional = !!(symbol.flags & 16777216); + const ambient = !!(enclosingDeclaration.flags & 33554432) || isAmbient; + const quotePreference = getQuotePreference(sourceFile, preferences); + switch (kind) { + case 171: + case 172: + const flags = quotePreference === 0 ? 268435456 : void 0; + let typeNode = checker.typeToTypeNode(type3, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context2)); + if (importAdder) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference) { + typeNode = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + addClassElement(factory.createPropertyDeclaration( + modifiers, + declaration ? createName(declarationName) : symbol.getName(), + optional && preserveOptional & 2 ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + typeNode, + /*initializer*/ + void 0 + )); + break; + case 177: + case 178: { + Debug.assertIsDefined(declarations); + let typeNode2 = checker.typeToTypeNode( + type3, + enclosingDeclaration, + /*flags*/ + void 0, + getNoopSymbolTrackerWithResolver(context2) + ); + const allAccessors = getAllAccessorDeclarations(declarations, declaration); + const orderedAccessors = allAccessors.secondAccessor ? [allAccessors.firstAccessor, allAccessors.secondAccessor] : [allAccessors.firstAccessor]; + if (importAdder) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode2, scriptTarget); + if (importableReference) { + typeNode2 = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + for (const accessor of orderedAccessors) { + if (isGetAccessorDeclaration(accessor)) { + addClassElement(factory.createGetAccessorDeclaration( + modifiers, + createName(declarationName), + emptyArray, + createTypeNode(typeNode2), + createBody(body, quotePreference, ambient) + )); + } else { + Debug.assertNode(accessor, isSetAccessorDeclaration, "The counterpart to a getter should be a setter"); + const parameter = getSetAccessorValueParameter(accessor); + const parameterName = parameter && isIdentifier(parameter.name) ? idText(parameter.name) : void 0; + addClassElement(factory.createSetAccessorDeclaration( + modifiers, + createName(declarationName), + createDummyParameters( + 1, + [parameterName], + [createTypeNode(typeNode2)], + 1, + /*inJs*/ + false + ), + createBody(body, quotePreference, ambient) + )); + } + } + break; + } + case 173: + case 174: + Debug.assertIsDefined(declarations); + const signatures = type3.isUnion() ? flatMap2(type3.types, (t8) => t8.getCallSignatures()) : type3.getCallSignatures(); + if (!some2(signatures)) { + break; + } + if (declarations.length === 1) { + Debug.assert(signatures.length === 1, "One declaration implies one signature"); + const signature = signatures[0]; + outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference, ambient)); + break; + } + for (const signature of signatures) { + outputMethod(quotePreference, signature, modifiers, createName(declarationName)); + } + if (!ambient) { + if (declarations.length > signatures.length) { + const signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); + outputMethod(quotePreference, signature, modifiers, createName(declarationName), createBody(body, quotePreference)); + } else { + Debug.assert(declarations.length === signatures.length, "Declarations and signatures should match count"); + addClassElement(createMethodImplementingSignatures(checker, context2, enclosingDeclaration, signatures, createName(declarationName), optional && !!(preserveOptional & 1), modifiers, quotePreference, body)); + } + } + break; + } + function outputMethod(quotePreference2, signature, modifiers2, name2, body2) { + const method2 = createSignatureDeclarationFromSignature(174, context2, quotePreference2, signature, body2, name2, modifiers2, optional && !!(preserveOptional & 1), enclosingDeclaration, importAdder); + if (method2) + addClassElement(method2); + } + function createModifiers() { + let modifiers2; + if (modifierFlags) { + modifiers2 = combine(modifiers2, factory.createModifiersFromModifierFlags(modifierFlags)); + } + if (shouldAddOverrideKeyword()) { + modifiers2 = append(modifiers2, factory.createToken( + 164 + /* OverrideKeyword */ + )); + } + return modifiers2 && factory.createNodeArray(modifiers2); + } + function shouldAddOverrideKeyword() { + return !!(context2.program.getCompilerOptions().noImplicitOverride && declaration && hasAbstractModifier(declaration)); + } + function createName(node) { + if (isIdentifier(node) && node.escapedText === "constructor") { + return factory.createComputedPropertyName(factory.createStringLiteral( + idText(node), + quotePreference === 0 + /* Single */ + )); + } + return getSynthesizedDeepClone( + node, + /*includeTrivia*/ + false + ); + } + function createBody(block, quotePreference2, ambient2) { + return ambient2 ? void 0 : getSynthesizedDeepClone( + block, + /*includeTrivia*/ + false + ) || createStubbedMethodBody(quotePreference2); + } + function createTypeNode(typeNode) { + return getSynthesizedDeepClone( + typeNode, + /*includeTrivia*/ + false + ); + } + function createDeclarationName(symbol2, declaration2) { + if (getCheckFlags(symbol2) & 262144) { + const nameType = symbol2.links.nameType; + if (nameType && isTypeUsableAsPropertyName(nameType)) { + return factory.createIdentifier(unescapeLeadingUnderscores(getPropertyNameFromType(nameType))); + } + } + return getSynthesizedDeepClone( + getNameOfDeclaration(declaration2), + /*includeTrivia*/ + false + ); + } + } + function createSignatureDeclarationFromSignature(kind, context2, quotePreference, signature, body, name2, modifiers, optional, enclosingDeclaration, importAdder) { + const program = context2.program; + const checker = program.getTypeChecker(); + const scriptTarget = getEmitScriptTarget(program.getCompilerOptions()); + const isJs = isInJSFile(enclosingDeclaration); + const flags = 1 | 256 | 524288 | (quotePreference === 0 ? 268435456 : 0); + const signatureDeclaration = checker.signatureToSignatureDeclaration(signature, kind, enclosingDeclaration, flags, getNoopSymbolTrackerWithResolver(context2)); + if (!signatureDeclaration) { + return void 0; + } + let typeParameters = isJs ? void 0 : signatureDeclaration.typeParameters; + let parameters = signatureDeclaration.parameters; + let type3 = isJs ? void 0 : signatureDeclaration.type; + if (importAdder) { + if (typeParameters) { + const newTypeParameters = sameMap(typeParameters, (typeParameterDecl) => { + let constraint = typeParameterDecl.constraint; + let defaultType = typeParameterDecl.default; + if (constraint) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(constraint, scriptTarget); + if (importableReference) { + constraint = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + if (defaultType) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(defaultType, scriptTarget); + if (importableReference) { + defaultType = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + return factory.updateTypeParameterDeclaration( + typeParameterDecl, + typeParameterDecl.modifiers, + typeParameterDecl.name, + constraint, + defaultType + ); + }); + if (typeParameters !== newTypeParameters) { + typeParameters = setTextRange(factory.createNodeArray(newTypeParameters, typeParameters.hasTrailingComma), typeParameters); + } + } + const newParameters = sameMap(parameters, (parameterDecl) => { + let type22 = isJs ? void 0 : parameterDecl.type; + if (type22) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(type22, scriptTarget); + if (importableReference) { + type22 = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + return factory.updateParameterDeclaration( + parameterDecl, + parameterDecl.modifiers, + parameterDecl.dotDotDotToken, + parameterDecl.name, + isJs ? void 0 : parameterDecl.questionToken, + type22, + parameterDecl.initializer + ); + }); + if (parameters !== newParameters) { + parameters = setTextRange(factory.createNodeArray(newParameters, parameters.hasTrailingComma), parameters); + } + if (type3) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(type3, scriptTarget); + if (importableReference) { + type3 = importableReference.typeNode; + importSymbols(importAdder, importableReference.symbols); + } + } + } + const questionToken = optional ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0; + const asteriskToken = signatureDeclaration.asteriskToken; + if (isFunctionExpression(signatureDeclaration)) { + return factory.updateFunctionExpression(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, tryCast(name2, isIdentifier), typeParameters, parameters, type3, body ?? signatureDeclaration.body); + } + if (isArrowFunction(signatureDeclaration)) { + return factory.updateArrowFunction(signatureDeclaration, modifiers, typeParameters, parameters, type3, signatureDeclaration.equalsGreaterThanToken, body ?? signatureDeclaration.body); + } + if (isMethodDeclaration(signatureDeclaration)) { + return factory.updateMethodDeclaration(signatureDeclaration, modifiers, asteriskToken, name2 ?? factory.createIdentifier(""), questionToken, typeParameters, parameters, type3, body); + } + if (isFunctionDeclaration(signatureDeclaration)) { + return factory.updateFunctionDeclaration(signatureDeclaration, modifiers, signatureDeclaration.asteriskToken, tryCast(name2, isIdentifier), typeParameters, parameters, type3, body ?? signatureDeclaration.body); + } + return void 0; + } + function createSignatureDeclarationFromCallExpression(kind, context2, importAdder, call, name2, modifierFlags, contextNode) { + const quotePreference = getQuotePreference(context2.sourceFile, context2.preferences); + const scriptTarget = getEmitScriptTarget(context2.program.getCompilerOptions()); + const tracker = getNoopSymbolTrackerWithResolver(context2); + const checker = context2.program.getTypeChecker(); + const isJs = isInJSFile(contextNode); + const { typeArguments, arguments: args, parent: parent22 } = call; + const contextualType = isJs ? void 0 : checker.getContextualType(call); + const names = map4(args, (arg) => isIdentifier(arg) ? arg.text : isPropertyAccessExpression(arg) && isIdentifier(arg.name) ? arg.name.text : void 0); + const instanceTypes = isJs ? [] : map4(args, (arg) => checker.getTypeAtLocation(arg)); + const { argumentTypeNodes, argumentTypeParameters } = getArgumentTypesAndTypeParameters( + checker, + importAdder, + instanceTypes, + contextNode, + scriptTarget, + 1, + tracker + ); + const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : void 0; + const asteriskToken = isYieldExpression(parent22) ? factory.createToken( + 42 + /* AsteriskToken */ + ) : void 0; + const typeParameters = isJs ? void 0 : createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments); + const parameters = createDummyParameters( + args.length, + names, + argumentTypeNodes, + /*minArgumentCount*/ + void 0, + isJs + ); + const type3 = isJs || contextualType === void 0 ? void 0 : checker.typeToTypeNode( + contextualType, + contextNode, + /*flags*/ + void 0, + tracker + ); + switch (kind) { + case 174: + return factory.createMethodDeclaration( + modifiers, + asteriskToken, + name2, + /*questionToken*/ + void 0, + typeParameters, + parameters, + type3, + createStubbedMethodBody(quotePreference) + ); + case 173: + return factory.createMethodSignature( + modifiers, + name2, + /*questionToken*/ + void 0, + typeParameters, + parameters, + type3 === void 0 ? factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ) : type3 + ); + case 262: + Debug.assert(typeof name2 === "string" || isIdentifier(name2), "Unexpected name"); + return factory.createFunctionDeclaration( + modifiers, + asteriskToken, + name2, + typeParameters, + parameters, + type3, + createStubbedBody(Diagnostics.Function_not_implemented.message, quotePreference) + ); + default: + Debug.fail("Unexpected kind"); + } + } + function createTypeParametersForArguments(checker, argumentTypeParameters, typeArguments) { + const usedNames = new Set(argumentTypeParameters.map((pair) => pair[0])); + const constraintsByName = new Map(argumentTypeParameters); + if (typeArguments) { + const typeArgumentsWithNewTypes = typeArguments.filter((typeArgument) => !argumentTypeParameters.some((pair) => { + var _a2; + return checker.getTypeAtLocation(typeArgument) === ((_a2 = pair[1]) == null ? void 0 : _a2.argumentType); + })); + const targetSize = usedNames.size + typeArgumentsWithNewTypes.length; + for (let i7 = 0; usedNames.size < targetSize; i7 += 1) { + usedNames.add(createTypeParameterName(i7)); + } + } + return arrayFrom( + usedNames.values(), + (usedName) => { + var _a2; + return factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + usedName, + (_a2 = constraintsByName.get(usedName)) == null ? void 0 : _a2.constraint + ); + } + ); + } + function createTypeParameterName(index4) { + return 84 + index4 <= 90 ? String.fromCharCode(84 + index4) : `T${index4}`; + } + function typeToAutoImportableTypeNode(checker, importAdder, type3, contextNode, scriptTarget, flags, tracker) { + let typeNode = checker.typeToTypeNode(type3, contextNode, flags, tracker); + if (typeNode && isImportTypeNode(typeNode)) { + const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget); + if (importableReference) { + importSymbols(importAdder, importableReference.symbols); + typeNode = importableReference.typeNode; + } + } + return getSynthesizedDeepClone(typeNode); + } + function typeContainsTypeParameter(type3) { + if (type3.isUnionOrIntersection()) { + return type3.types.some(typeContainsTypeParameter); + } + return type3.flags & 262144; + } + function getArgumentTypesAndTypeParameters(checker, importAdder, instanceTypes, contextNode, scriptTarget, flags, tracker) { + const argumentTypeNodes = []; + const argumentTypeParameters = /* @__PURE__ */ new Map(); + for (let i7 = 0; i7 < instanceTypes.length; i7 += 1) { + const instanceType = instanceTypes[i7]; + if (instanceType.isUnionOrIntersection() && instanceType.types.some(typeContainsTypeParameter)) { + const synthesizedTypeParameterName = createTypeParameterName(i7); + argumentTypeNodes.push(factory.createTypeReferenceNode(synthesizedTypeParameterName)); + argumentTypeParameters.set(synthesizedTypeParameterName, void 0); + continue; + } + const widenedInstanceType = checker.getBaseTypeOfLiteralType(instanceType); + const argumentTypeNode = typeToAutoImportableTypeNode(checker, importAdder, widenedInstanceType, contextNode, scriptTarget, flags, tracker); + if (!argumentTypeNode) { + continue; + } + argumentTypeNodes.push(argumentTypeNode); + const argumentTypeParameter = getFirstTypeParameterName(instanceType); + const instanceTypeConstraint = instanceType.isTypeParameter() && instanceType.constraint && !isAnonymousObjectConstraintType(instanceType.constraint) ? typeToAutoImportableTypeNode(checker, importAdder, instanceType.constraint, contextNode, scriptTarget, flags, tracker) : void 0; + if (argumentTypeParameter) { + argumentTypeParameters.set(argumentTypeParameter, { argumentType: instanceType, constraint: instanceTypeConstraint }); + } + } + return { argumentTypeNodes, argumentTypeParameters: arrayFrom(argumentTypeParameters.entries()) }; + } + function isAnonymousObjectConstraintType(type3) { + return type3.flags & 524288 && type3.objectFlags === 16; + } + function getFirstTypeParameterName(type3) { + var _a2; + if (type3.flags & (1048576 | 2097152)) { + for (const subType of type3.types) { + const subTypeName = getFirstTypeParameterName(subType); + if (subTypeName) { + return subTypeName; + } + } + } + return type3.flags & 262144 ? (_a2 = type3.getSymbol()) == null ? void 0 : _a2.getName() : void 0; + } + function createDummyParameters(argCount, names, types3, minArgumentCount, inJs) { + const parameters = []; + const parameterNameCounts = /* @__PURE__ */ new Map(); + for (let i7 = 0; i7 < argCount; i7++) { + const parameterName = (names == null ? void 0 : names[i7]) || `arg${i7}`; + const parameterNameCount = parameterNameCounts.get(parameterName); + parameterNameCounts.set(parameterName, (parameterNameCount || 0) + 1); + const newParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + /*name*/ + parameterName + (parameterNameCount || ""), + /*questionToken*/ + minArgumentCount !== void 0 && i7 >= minArgumentCount ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + /*type*/ + inJs ? void 0 : (types3 == null ? void 0 : types3[i7]) || factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + ), + /*initializer*/ + void 0 + ); + parameters.push(newParameter); + } + return parameters; + } + function createMethodImplementingSignatures(checker, context2, enclosingDeclaration, signatures, name2, optional, modifiers, quotePreference, body) { + let maxArgsSignature = signatures[0]; + let minArgumentCount = signatures[0].minArgumentCount; + let someSigHasRestParameter = false; + for (const sig of signatures) { + minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount); + if (signatureHasRestParameter(sig)) { + someSigHasRestParameter = true; + } + if (sig.parameters.length >= maxArgsSignature.parameters.length && (!signatureHasRestParameter(sig) || signatureHasRestParameter(maxArgsSignature))) { + maxArgsSignature = sig; + } + } + const maxNonRestArgs = maxArgsSignature.parameters.length - (signatureHasRestParameter(maxArgsSignature) ? 1 : 0); + const maxArgsParameterSymbolNames = maxArgsSignature.parameters.map((symbol) => symbol.name); + const parameters = createDummyParameters( + maxNonRestArgs, + maxArgsParameterSymbolNames, + /*types*/ + void 0, + minArgumentCount, + /*inJs*/ + false + ); + if (someSigHasRestParameter) { + const restParameter = factory.createParameterDeclaration( + /*modifiers*/ + void 0, + factory.createToken( + 26 + /* DotDotDotToken */ + ), + maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", + /*questionToken*/ + maxNonRestArgs >= minArgumentCount ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + factory.createArrayTypeNode(factory.createKeywordTypeNode( + 159 + /* UnknownKeyword */ + )), + /*initializer*/ + void 0 + ); + parameters.push(restParameter); + } + return createStubbedMethod( + modifiers, + name2, + optional, + /*typeParameters*/ + void 0, + parameters, + getReturnTypeFromSignatures(signatures, checker, context2, enclosingDeclaration), + quotePreference, + body + ); + } + function getReturnTypeFromSignatures(signatures, checker, context2, enclosingDeclaration) { + if (length(signatures)) { + const type3 = checker.getUnionType(map4(signatures, checker.getReturnTypeOfSignature)); + return checker.typeToTypeNode(type3, enclosingDeclaration, 1, getNoopSymbolTrackerWithResolver(context2)); + } + } + function createStubbedMethod(modifiers, name2, optional, typeParameters, parameters, returnType, quotePreference, body) { + return factory.createMethodDeclaration( + modifiers, + /*asteriskToken*/ + void 0, + name2, + optional ? factory.createToken( + 58 + /* QuestionToken */ + ) : void 0, + typeParameters, + parameters, + returnType, + body || createStubbedMethodBody(quotePreference) + ); + } + function createStubbedMethodBody(quotePreference) { + return createStubbedBody(Diagnostics.Method_not_implemented.message, quotePreference); + } + function createStubbedBody(text, quotePreference) { + return factory.createBlock( + [factory.createThrowStatement( + factory.createNewExpression( + factory.createIdentifier("Error"), + /*typeArguments*/ + void 0, + // TODO Handle auto quote preference. + [factory.createStringLiteral( + text, + /*isSingleQuote*/ + quotePreference === 0 + /* Single */ + )] + ) + )], + /*multiLine*/ + true + ); + } + function setJsonCompilerOptionValues(changeTracker, configFile, options) { + const tsconfigObjectLiteral = getTsConfigObjectLiteralExpression(configFile); + if (!tsconfigObjectLiteral) + return void 0; + const compilerOptionsProperty = findJsonProperty(tsconfigObjectLiteral, "compilerOptions"); + if (compilerOptionsProperty === void 0) { + changeTracker.insertNodeAtObjectStart( + configFile, + tsconfigObjectLiteral, + createJsonPropertyAssignment( + "compilerOptions", + factory.createObjectLiteralExpression( + options.map(([optionName, optionValue]) => createJsonPropertyAssignment(optionName, optionValue)), + /*multiLine*/ + true + ) + ) + ); + return; + } + const compilerOptions = compilerOptionsProperty.initializer; + if (!isObjectLiteralExpression(compilerOptions)) { + return; + } + for (const [optionName, optionValue] of options) { + const optionProperty = findJsonProperty(compilerOptions, optionName); + if (optionProperty === void 0) { + changeTracker.insertNodeAtObjectStart(configFile, compilerOptions, createJsonPropertyAssignment(optionName, optionValue)); + } else { + changeTracker.replaceNode(configFile, optionProperty.initializer, optionValue); + } + } + } + function setJsonCompilerOptionValue(changeTracker, configFile, optionName, optionValue) { + setJsonCompilerOptionValues(changeTracker, configFile, [[optionName, optionValue]]); + } + function createJsonPropertyAssignment(name2, initializer) { + return factory.createPropertyAssignment(factory.createStringLiteral(name2), initializer); + } + function findJsonProperty(obj, name2) { + return find2(obj.properties, (p7) => isPropertyAssignment(p7) && !!p7.name && isStringLiteral(p7.name) && p7.name.text === name2); + } + function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) { + let symbols; + const typeNode = visitNode(importTypeNode, visit7, isTypeNode); + if (symbols && typeNode) { + return { typeNode, symbols }; + } + function visit7(node) { + if (isLiteralImportTypeNode(node) && node.qualifier) { + const firstIdentifier = getFirstIdentifier(node.qualifier); + const name2 = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget); + const qualifier = name2 !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name2)) : node.qualifier; + symbols = append(symbols, firstIdentifier.symbol); + const typeArguments = visitNodes2(node.typeArguments, visit7, isTypeNode); + return factory.createTypeReferenceNode(qualifier, typeArguments); + } + return visitEachChild( + node, + visit7, + /*context*/ + void 0 + ); + } + } + function replaceFirstIdentifierOfEntityName(name2, newIdentifier) { + if (name2.kind === 80) { + return newIdentifier; + } + return factory.createQualifiedName(replaceFirstIdentifierOfEntityName(name2.left, newIdentifier), name2.right); + } + function importSymbols(importAdder, symbols) { + symbols.forEach((s7) => importAdder.addImportFromExportedSymbol( + s7, + /*isValidTypeOnlyUseSite*/ + true + )); + } + function findAncestorMatchingSpan(sourceFile, span) { + const end = textSpanEnd(span); + let token = getTokenAtPosition(sourceFile, span.start); + while (token.end < end) { + token = token.parent; + } + return token; + } + var PreserveOptionalFlags; + var init_helpers2 = __esm2({ + "src/services/codefixes/helpers.ts"() { + "use strict"; + init_ts4(); + PreserveOptionalFlags = /* @__PURE__ */ ((PreserveOptionalFlags2) => { + PreserveOptionalFlags2[PreserveOptionalFlags2["Method"] = 1] = "Method"; + PreserveOptionalFlags2[PreserveOptionalFlags2["Property"] = 2] = "Property"; + PreserveOptionalFlags2[PreserveOptionalFlags2["All"] = 3] = "All"; + return PreserveOptionalFlags2; + })(PreserveOptionalFlags || {}); + } + }); + function generateAccessorFromProperty(file, program, start, end, context2, _actionName) { + const fieldInfo = getAccessorConvertiblePropertyAtPosition(file, program, start, end); + if (!fieldInfo || ts_refactor_exports.isRefactorErrorInfo(fieldInfo)) + return void 0; + const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext(context2); + const { isStatic: isStatic2, isReadonly, fieldName, accessorName, originalName, type: type3, container, declaration } = fieldInfo; + suppressLeadingAndTrailingTrivia(fieldName); + suppressLeadingAndTrailingTrivia(accessorName); + suppressLeadingAndTrailingTrivia(declaration); + suppressLeadingAndTrailingTrivia(container); + let accessorModifiers; + let fieldModifiers; + if (isClassLike(container)) { + const modifierFlags = getEffectiveModifierFlags(declaration); + if (isSourceFileJS(file)) { + const modifiers = factory.createModifiersFromModifierFlags(modifierFlags); + accessorModifiers = modifiers; + fieldModifiers = modifiers; + } else { + accessorModifiers = factory.createModifiersFromModifierFlags(prepareModifierFlagsForAccessor(modifierFlags)); + fieldModifiers = factory.createModifiersFromModifierFlags(prepareModifierFlagsForField(modifierFlags)); + } + if (canHaveDecorators(declaration)) { + fieldModifiers = concatenate(getDecorators(declaration), fieldModifiers); + } + } + updateFieldDeclaration(changeTracker, file, declaration, type3, fieldName, fieldModifiers); + const getAccessor = generateGetAccessor(fieldName, accessorName, type3, accessorModifiers, isStatic2, container); + suppressLeadingAndTrailingTrivia(getAccessor); + insertAccessor(changeTracker, file, getAccessor, declaration, container); + if (isReadonly) { + const constructor = getFirstConstructorWithBody(container); + if (constructor) { + updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName); + } + } else { + const setAccessor = generateSetAccessor(fieldName, accessorName, type3, accessorModifiers, isStatic2, container); + suppressLeadingAndTrailingTrivia(setAccessor); + insertAccessor(changeTracker, file, setAccessor, declaration, container); + } + return changeTracker.getChanges(); + } + function isConvertibleName(name2) { + return isIdentifier(name2) || isStringLiteral(name2); + } + function isAcceptedDeclaration(node) { + return isParameterPropertyDeclaration(node, node.parent) || isPropertyDeclaration(node) || isPropertyAssignment(node); + } + function createPropertyName(name2, originalName) { + return isIdentifier(originalName) ? factory.createIdentifier(name2) : factory.createStringLiteral(name2); + } + function createAccessorAccessExpression(fieldName, isStatic2, container) { + const leftHead = isStatic2 ? container.name : factory.createThis(); + return isIdentifier(fieldName) ? factory.createPropertyAccessExpression(leftHead, fieldName) : factory.createElementAccessExpression(leftHead, factory.createStringLiteralFromNode(fieldName)); + } + function prepareModifierFlagsForAccessor(modifierFlags) { + modifierFlags &= ~8; + modifierFlags &= ~2; + if (!(modifierFlags & 4)) { + modifierFlags |= 1; + } + return modifierFlags; + } + function prepareModifierFlagsForField(modifierFlags) { + modifierFlags &= ~1; + modifierFlags &= ~4; + modifierFlags |= 2; + return modifierFlags; + } + function getAccessorConvertiblePropertyAtPosition(file, program, start, end, considerEmptySpans = true) { + const node = getTokenAtPosition(file, start); + const cursorRequest = start === end && considerEmptySpans; + const declaration = findAncestor(node.parent, isAcceptedDeclaration); + const meaning = 7 | 256 | 8; + if (!declaration || !(nodeOverlapsWithStartEnd(declaration.name, file, start, end) || cursorRequest)) { + return { + error: getLocaleSpecificMessage(Diagnostics.Could_not_find_property_for_which_to_generate_accessor) + }; + } + if (!isConvertibleName(declaration.name)) { + return { + error: getLocaleSpecificMessage(Diagnostics.Name_is_not_valid) + }; + } + if ((getEffectiveModifierFlags(declaration) & 98303 | meaning) !== meaning) { + return { + error: getLocaleSpecificMessage(Diagnostics.Can_only_convert_property_with_modifier) + }; + } + const name2 = declaration.name.text; + const startWithUnderscore = startsWithUnderscore(name2); + const fieldName = createPropertyName(startWithUnderscore ? name2 : getUniqueName(`_${name2}`, file), declaration.name); + const accessorName = createPropertyName(startWithUnderscore ? getUniqueName(name2.substring(1), file) : name2, declaration.name); + return { + isStatic: hasStaticModifier(declaration), + isReadonly: hasEffectiveReadonlyModifier(declaration), + type: getDeclarationType(declaration, program), + container: declaration.kind === 169 ? declaration.parent.parent : declaration.parent, + originalName: declaration.name.text, + declaration, + fieldName, + accessorName, + renameAccessor: startWithUnderscore + }; + } + function generateGetAccessor(fieldName, accessorName, type3, modifiers, isStatic2, container) { + return factory.createGetAccessorDeclaration( + modifiers, + accessorName, + [], + type3, + factory.createBlock( + [ + factory.createReturnStatement( + createAccessorAccessExpression(fieldName, isStatic2, container) + ) + ], + /*multiLine*/ + true + ) + ); + } + function generateSetAccessor(fieldName, accessorName, type3, modifiers, isStatic2, container) { + return factory.createSetAccessorDeclaration( + modifiers, + accessorName, + [factory.createParameterDeclaration( + /*modifiers*/ + void 0, + /*dotDotDotToken*/ + void 0, + factory.createIdentifier("value"), + /*questionToken*/ + void 0, + type3 + )], + factory.createBlock( + [ + factory.createExpressionStatement( + factory.createAssignment( + createAccessorAccessExpression(fieldName, isStatic2, container), + factory.createIdentifier("value") + ) + ) + ], + /*multiLine*/ + true + ) + ); + } + function updatePropertyDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers) { + const property2 = factory.updatePropertyDeclaration( + declaration, + modifiers, + fieldName, + declaration.questionToken || declaration.exclamationToken, + type3, + declaration.initializer + ); + changeTracker.replaceNode(file, declaration, property2); + } + function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) { + let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer); + if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) { + if (assignment === declaration) + assignment = factory.cloneNode(assignment); + assignment.modifiers = void 0; + assignment.questionToken = void 0; + assignment.exclamationToken = void 0; + } + changeTracker.replacePropertyAssignment(file, declaration, assignment); + } + function updateFieldDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers) { + if (isPropertyDeclaration(declaration)) { + updatePropertyDeclaration(changeTracker, file, declaration, type3, fieldName, modifiers); + } else if (isPropertyAssignment(declaration)) { + updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName); + } else { + changeTracker.replaceNode(file, declaration, factory.updateParameterDeclaration(declaration, modifiers, declaration.dotDotDotToken, cast(fieldName, isIdentifier), declaration.questionToken, declaration.type, declaration.initializer)); + } + } + function insertAccessor(changeTracker, file, accessor, declaration, container) { + isParameterPropertyDeclaration(declaration, declaration.parent) ? changeTracker.insertMemberAtStart(file, container, accessor) : isPropertyAssignment(declaration) ? changeTracker.insertNodeAfterComma(file, declaration, accessor) : changeTracker.insertNodeAfter(file, declaration, accessor); + } + function updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName, originalName) { + if (!constructor.body) + return; + constructor.body.forEachChild(function recur(node) { + if (isElementAccessExpression(node) && node.expression.kind === 110 && isStringLiteral(node.argumentExpression) && node.argumentExpression.text === originalName && isWriteAccess(node)) { + changeTracker.replaceNode(file, node.argumentExpression, factory.createStringLiteral(fieldName)); + } + if (isPropertyAccessExpression(node) && node.expression.kind === 110 && node.name.text === originalName && isWriteAccess(node)) { + changeTracker.replaceNode(file, node.name, factory.createIdentifier(fieldName)); + } + if (!isFunctionLike(node) && !isClassLike(node)) { + node.forEachChild(recur); + } + }); + } + function getDeclarationType(declaration, program) { + const typeNode = getTypeAnnotationNode(declaration); + if (isPropertyDeclaration(declaration) && typeNode && declaration.questionToken) { + const typeChecker = program.getTypeChecker(); + const type3 = typeChecker.getTypeFromTypeNode(typeNode); + if (!typeChecker.isTypeAssignableTo(typeChecker.getUndefinedType(), type3)) { + const types3 = isUnionTypeNode(typeNode) ? typeNode.types : [typeNode]; + return factory.createUnionTypeNode([...types3, factory.createKeywordTypeNode( + 157 + /* UndefinedKeyword */ + )]); + } + } + return typeNode; + } + function getAllSupers(decl, checker) { + const res = []; + while (decl) { + const superElement = getClassExtendsHeritageElement(decl); + const superSymbol = superElement && checker.getSymbolAtLocation(superElement.expression); + if (!superSymbol) + break; + const symbol = superSymbol.flags & 2097152 ? checker.getAliasedSymbol(superSymbol) : superSymbol; + const superDecl = symbol.declarations && find2(symbol.declarations, isClassLike); + if (!superDecl) + break; + res.push(superDecl); + decl = superDecl; + } + return res; + } + var init_generateAccessors = __esm2({ + "src/services/codefixes/generateAccessors.ts"() { + "use strict"; + init_ts4(); + } + }); + function getCodeFixesForImportDeclaration(context2, node) { + const sourceFile = getSourceFileOfNode(node); + const namespace = getNamespaceDeclarationNode(node); + const opts = context2.program.getCompilerOptions(); + const variations = []; + variations.push(createAction(context2, sourceFile, node, makeImport( + namespace.name, + /*namedImports*/ + void 0, + node.moduleSpecifier, + getQuotePreference(sourceFile, context2.preferences) + ))); + if (getEmitModuleKind(opts) === 1) { + variations.push(createAction( + context2, + sourceFile, + node, + factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + namespace.name, + factory.createExternalModuleReference(node.moduleSpecifier) + ) + )); + } + return variations; + } + function createAction(context2, sourceFile, node, replacement) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(sourceFile, node, replacement)); + return createCodeFixActionWithoutFixAll(fixName5, changes, [Diagnostics.Replace_import_with_0, changes[0].textChanges[0].newText]); + } + function getActionsForUsageOfInvalidImport(context2) { + const sourceFile = context2.sourceFile; + const targetKind = Diagnostics.This_expression_is_not_callable.code === context2.errorCode ? 213 : 214; + const node = findAncestor(getTokenAtPosition(sourceFile, context2.span.start), (a7) => a7.kind === targetKind); + if (!node) { + return []; + } + const expr = node.expression; + return getImportCodeFixesForExpression(context2, expr); + } + function getActionsForInvalidImportLocation(context2) { + const sourceFile = context2.sourceFile; + const node = findAncestor(getTokenAtPosition(sourceFile, context2.span.start), (a7) => a7.getStart() === context2.span.start && a7.getEnd() === context2.span.start + context2.span.length); + if (!node) { + return []; + } + return getImportCodeFixesForExpression(context2, node); + } + function getImportCodeFixesForExpression(context2, expr) { + const type3 = context2.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type3.symbol && isTransientSymbol(type3.symbol) && type3.symbol.links.originatingImport)) { + return []; + } + const fixes = []; + const relatedImport = type3.symbol.links.originatingImport; + if (!isImportCall(relatedImport)) { + addRange(fixes, getCodeFixesForImportDeclaration(context2, relatedImport)); + } + if (isExpression(expr) && !(isNamedDeclaration(expr.parent) && expr.parent.name === expr)) { + const sourceFile = context2.sourceFile; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => t8.replaceNode(sourceFile, expr, factory.createPropertyAccessExpression(expr, "default"), {})); + fixes.push(createCodeFixActionWithoutFixAll(fixName5, changes, Diagnostics.Use_synthetic_default_member)); + } + return fixes; + } + var fixName5; + var init_fixInvalidImportSyntax = __esm2({ + "src/services/codefixes/fixInvalidImportSyntax.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName5 = "invalidImportSyntax"; + registerCodeFix({ + errorCodes: [ + Diagnostics.This_expression_is_not_callable.code, + Diagnostics.This_expression_is_not_constructable.code + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + registerCodeFix({ + errorCodes: [ + // The following error codes cover pretty much all assignability errors that could involve an expression + Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, + Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code, + Diagnostics.Type_0_is_not_assignable_to_type_1.code, + Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code, + Diagnostics.Type_predicate_0_is_not_assignable_to_1.code, + Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code, + Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code, + Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code, + Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code, + Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code, + Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code + ], + getCodeActions: getActionsForInvalidImportLocation + }); + } + }); + function getInfo17(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + if (isIdentifier(token) && isPropertyDeclaration(token.parent)) { + const type3 = getEffectiveTypeAnnotationNode(token.parent); + if (type3) { + return { type: type3, prop: token.parent, isJs: isInJSFile(token.parent) }; + } + } + return void 0; + } + function getActionForAddMissingDefiniteAssignmentAssertion(context2, info2) { + if (info2.isJs) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addDefiniteAssignmentAssertion(t8, context2.sourceFile, info2.prop)); + return createCodeFixAction(fixName6, changes, [Diagnostics.Add_definite_assignment_assertion_to_property_0, info2.prop.getText()], fixIdAddDefiniteAssignmentAssertions, Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties); + } + function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { + suppressLeadingAndTrailingTrivia(propertyDeclaration); + const property2 = factory.updatePropertyDeclaration( + propertyDeclaration, + propertyDeclaration.modifiers, + propertyDeclaration.name, + factory.createToken( + 54 + /* ExclamationToken */ + ), + propertyDeclaration.type, + propertyDeclaration.initializer + ); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property2); + } + function getActionForAddMissingUndefinedType(context2, info2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addUndefinedType(t8, context2.sourceFile, info2)); + return createCodeFixAction(fixName6, changes, [Diagnostics.Add_undefined_type_to_property_0, info2.prop.name.getText()], fixIdAddUndefinedType, Diagnostics.Add_undefined_type_to_all_uninitialized_properties); + } + function addUndefinedType(changeTracker, sourceFile, info2) { + const undefinedTypeNode = factory.createKeywordTypeNode( + 157 + /* UndefinedKeyword */ + ); + const types3 = isUnionTypeNode(info2.type) ? info2.type.types.concat(undefinedTypeNode) : [info2.type, undefinedTypeNode]; + const unionTypeNode = factory.createUnionTypeNode(types3); + if (info2.isJs) { + changeTracker.addJSDocTags(sourceFile, info2.prop, [factory.createJSDocTypeTag( + /*tagName*/ + void 0, + factory.createJSDocTypeExpression(unionTypeNode) + )]); + } else { + changeTracker.replaceNode(sourceFile, info2.type, unionTypeNode); + } + } + function getActionForAddMissingInitializer(context2, info2) { + if (info2.isJs) + return void 0; + const checker = context2.program.getTypeChecker(); + const initializer = getInitializer(checker, info2.prop); + if (!initializer) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => addInitializer(t8, context2.sourceFile, info2.prop, initializer)); + return createCodeFixAction(fixName6, changes, [Diagnostics.Add_initializer_to_property_0, info2.prop.name.getText()], fixIdAddInitializer, Diagnostics.Add_initializers_to_all_uninitialized_properties); + } + function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer) { + suppressLeadingAndTrailingTrivia(propertyDeclaration); + const property2 = factory.updatePropertyDeclaration( + propertyDeclaration, + propertyDeclaration.modifiers, + propertyDeclaration.name, + propertyDeclaration.questionToken, + propertyDeclaration.type, + initializer + ); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property2); + } + function getInitializer(checker, propertyDeclaration) { + return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); + } + function getDefaultValueFromType(checker, type3) { + if (type3.flags & 512) { + return type3 === checker.getFalseType() || type3 === checker.getFalseType( + /*fresh*/ + true + ) ? factory.createFalse() : factory.createTrue(); + } else if (type3.isStringLiteral()) { + return factory.createStringLiteral(type3.value); + } else if (type3.isNumberLiteral()) { + return factory.createNumericLiteral(type3.value); + } else if (type3.flags & 2048) { + return factory.createBigIntLiteral(type3.value); + } else if (type3.isUnion()) { + return firstDefined(type3.types, (t8) => getDefaultValueFromType(checker, t8)); + } else if (type3.isClass()) { + const classDeclaration = getClassLikeDeclarationOfSymbol(type3.symbol); + if (!classDeclaration || hasSyntacticModifier( + classDeclaration, + 64 + /* Abstract */ + )) + return void 0; + const constructorDeclaration = getFirstConstructorWithBody(classDeclaration); + if (constructorDeclaration && constructorDeclaration.parameters.length) + return void 0; + return factory.createNewExpression( + factory.createIdentifier(type3.symbol.name), + /*typeArguments*/ + void 0, + /*argumentsArray*/ + void 0 + ); + } else if (checker.isArrayLikeType(type3)) { + return factory.createArrayLiteralExpression(); + } + return void 0; + } + var fixName6, fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer, errorCodes52; + var init_fixStrictClassInitialization = __esm2({ + "src/services/codefixes/fixStrictClassInitialization.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName6 = "strictClassInitialization"; + fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; + fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; + fixIdAddInitializer = "addMissingPropertyInitializer"; + errorCodes52 = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + registerCodeFix({ + errorCodes: errorCodes52, + getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context2) { + const info2 = getInfo17(context2.sourceFile, context2.span.start); + if (!info2) + return; + const result2 = []; + append(result2, getActionForAddMissingUndefinedType(context2, info2)); + append(result2, getActionForAddMissingDefiniteAssignmentAssertion(context2, info2)); + append(result2, getActionForAddMissingInitializer(context2, info2)); + return result2; + }, + fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], + getAllCodeActions: (context2) => { + return codeFixAll(context2, errorCodes52, (changes, diag2) => { + const info2 = getInfo17(diag2.file, diag2.start); + if (!info2) + return; + switch (context2.fixId) { + case fixIdAddDefiniteAssignmentAssertions: + addDefiniteAssignmentAssertion(changes, diag2.file, info2.prop); + break; + case fixIdAddUndefinedType: + addUndefinedType(changes, diag2.file, info2); + break; + case fixIdAddInitializer: + const checker = context2.program.getTypeChecker(); + const initializer = getInitializer(checker, info2.prop); + if (!initializer) + return; + addInitializer(changes, diag2.file, info2.prop, initializer); + break; + default: + Debug.fail(JSON.stringify(context2.fixId)); + } + }); + } + }); + } + }); + function doChange35(changes, sourceFile, info2) { + const { allowSyntheticDefaults, defaultImportName, namedImports, statement, required } = info2; + changes.replaceNode( + sourceFile, + statement, + defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration( + /*modifiers*/ + void 0, + /*isTypeOnly*/ + false, + defaultImportName, + factory.createExternalModuleReference(required) + ) : factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.createImportClause( + /*isTypeOnly*/ + false, + defaultImportName, + namedImports + ), + required, + /*attributes*/ + void 0 + ) + ); + } + function getInfo18(sourceFile, program, pos) { + const { parent: parent22 } = getTokenAtPosition(sourceFile, pos); + if (!isRequireCall( + parent22, + /*requireStringLiteralLikeArgument*/ + true + )) { + Debug.failBadSyntaxKind(parent22); + } + const decl = cast(parent22.parent, isVariableDeclaration); + const defaultImportName = tryCast(decl.name, isIdentifier); + const namedImports = isObjectBindingPattern(decl.name) ? tryCreateNamedImportsFromObjectBindingPattern(decl.name) : void 0; + if (defaultImportName || namedImports) { + return { + allowSyntheticDefaults: getAllowSyntheticDefaultImports(program.getCompilerOptions()), + defaultImportName, + namedImports, + statement: cast(decl.parent.parent, isVariableStatement), + required: first(parent22.arguments) + }; + } + } + function tryCreateNamedImportsFromObjectBindingPattern(node) { + const importSpecifiers = []; + for (const element of node.elements) { + if (!isIdentifier(element.name) || element.initializer) { + return void 0; + } + importSpecifiers.push(factory.createImportSpecifier( + /*isTypeOnly*/ + false, + tryCast(element.propertyName, isIdentifier), + element.name + )); + } + if (importSpecifiers.length) { + return factory.createNamedImports(importSpecifiers); + } + } + var fixId41, errorCodes53; + var init_requireInTs = __esm2({ + "src/services/codefixes/requireInTs.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId41 = "requireInTs"; + errorCodes53 = [Diagnostics.require_call_may_be_converted_to_an_import.code]; + registerCodeFix({ + errorCodes: errorCodes53, + getCodeActions(context2) { + const info2 = getInfo18(context2.sourceFile, context2.program, context2.span.start); + if (!info2) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange35(t8, context2.sourceFile, info2)); + return [createCodeFixAction(fixId41, changes, Diagnostics.Convert_require_to_import, fixId41, Diagnostics.Convert_all_require_to_import)]; + }, + fixIds: [fixId41], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes53, (changes, diag2) => { + const info2 = getInfo18(diag2.file, context2.program, diag2.start); + if (info2) { + doChange35(changes, context2.sourceFile, info2); + } + }) + }); + } + }); + function getInfo19(sourceFile, pos) { + const name2 = getTokenAtPosition(sourceFile, pos); + if (!isIdentifier(name2)) + return void 0; + const { parent: parent22 } = name2; + if (isImportEqualsDeclaration(parent22) && isExternalModuleReference(parent22.moduleReference)) { + return { importNode: parent22, name: name2, moduleSpecifier: parent22.moduleReference.expression }; + } else if (isNamespaceImport(parent22)) { + const importNode = parent22.parent.parent; + return { importNode, name: name2, moduleSpecifier: importNode.moduleSpecifier }; + } + } + function doChange36(changes, sourceFile, info2, preferences) { + changes.replaceNode(sourceFile, info2.importNode, makeImport( + info2.name, + /*namedImports*/ + void 0, + info2.moduleSpecifier, + getQuotePreference(sourceFile, preferences) + )); + } + var fixId42, errorCodes54; + var init_useDefaultImport = __esm2({ + "src/services/codefixes/useDefaultImport.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId42 = "useDefaultImport"; + errorCodes54 = [Diagnostics.Import_may_be_converted_to_a_default_import.code]; + registerCodeFix({ + errorCodes: errorCodes54, + getCodeActions(context2) { + const { sourceFile, span: { start } } = context2; + const info2 = getInfo19(sourceFile, start); + if (!info2) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange36(t8, sourceFile, info2, context2.preferences)); + return [createCodeFixAction(fixId42, changes, Diagnostics.Convert_to_default_import, fixId42, Diagnostics.Convert_all_to_default_imports)]; + }, + fixIds: [fixId42], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes54, (changes, diag2) => { + const info2 = getInfo19(diag2.file, diag2.start); + if (info2) + doChange36(changes, diag2.file, info2, context2.preferences); + }) + }); + } + }); + function makeChange9(changeTracker, sourceFile, span) { + const numericLiteral = tryCast(getTokenAtPosition(sourceFile, span.start), isNumericLiteral); + if (!numericLiteral) { + return; + } + const newText = numericLiteral.getText(sourceFile) + "n"; + changeTracker.replaceNode(sourceFile, numericLiteral, factory.createBigIntLiteral(newText)); + } + var fixId43, errorCodes55; + var init_useBigintLiteral = __esm2({ + "src/services/codefixes/useBigintLiteral.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId43 = "useBigintLiteral"; + errorCodes55 = [ + Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code + ]; + registerCodeFix({ + errorCodes: errorCodes55, + getCodeActions: function getCodeActionsToUseBigintLiteral(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange9(t8, context2.sourceFile, context2.span)); + if (changes.length > 0) { + return [createCodeFixAction(fixId43, changes, Diagnostics.Convert_to_a_bigint_numeric_literal, fixId43, Diagnostics.Convert_all_to_bigint_numeric_literals)]; + } + }, + fixIds: [fixId43], + getAllCodeActions: (context2) => { + return codeFixAll(context2, errorCodes55, (changes, diag2) => makeChange9(changes, diag2.file, diag2)); + } + }); + } + }); + function getImportTypeNode(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + Debug.assert(token.kind === 102, "This token should be an ImportKeyword"); + Debug.assert(token.parent.kind === 205, "Token parent should be an ImportType"); + return token.parent; + } + function doChange37(changes, sourceFile, importType) { + const newTypeNode = factory.updateImportTypeNode( + importType, + importType.argument, + importType.attributes, + importType.qualifier, + importType.typeArguments, + /*isTypeOf*/ + true + ); + changes.replaceNode(sourceFile, importType, newTypeNode); + } + var fixIdAddMissingTypeof, fixId44, errorCodes56; + var init_fixAddModuleReferTypeMissingTypeof = __esm2({ + "src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixIdAddMissingTypeof = "fixAddModuleReferTypeMissingTypeof"; + fixId44 = fixIdAddMissingTypeof; + errorCodes56 = [Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code]; + registerCodeFix({ + errorCodes: errorCodes56, + getCodeActions: function getCodeActionsToAddMissingTypeof(context2) { + const { sourceFile, span } = context2; + const importType = getImportTypeNode(sourceFile, span.start); + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange37(t8, sourceFile, importType)); + return [createCodeFixAction(fixId44, changes, Diagnostics.Add_missing_typeof, fixId44, Diagnostics.Add_missing_typeof)]; + }, + fixIds: [fixId44], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes56, (changes, diag2) => doChange37(changes, context2.sourceFile, getImportTypeNode(diag2.file, diag2.start))) + }); + } + }); + function findNodeToFix(sourceFile, pos) { + const lessThanToken = getTokenAtPosition(sourceFile, pos); + const firstJsxElementOrOpenElement = lessThanToken.parent; + let binaryExpr = firstJsxElementOrOpenElement.parent; + if (!isBinaryExpression(binaryExpr)) { + binaryExpr = binaryExpr.parent; + if (!isBinaryExpression(binaryExpr)) + return void 0; + } + if (!nodeIsMissing(binaryExpr.operatorToken)) + return void 0; + return binaryExpr; + } + function doChange38(changeTracker, sf, node) { + const jsx = flattenInvalidBinaryExpr(node); + if (jsx) + changeTracker.replaceNode(sf, node, factory.createJsxFragment(factory.createJsxOpeningFragment(), jsx, factory.createJsxJsxClosingFragment())); + } + function flattenInvalidBinaryExpr(node) { + const children = []; + let current = node; + while (true) { + if (isBinaryExpression(current) && nodeIsMissing(current.operatorToken) && current.operatorToken.kind === 28) { + children.push(current.left); + if (isJsxChild(current.right)) { + children.push(current.right); + return children; + } else if (isBinaryExpression(current.right)) { + current = current.right; + continue; + } else + return void 0; + } else + return void 0; + } + } + var fixID2, errorCodes57; + var init_wrapJsxInFragment = __esm2({ + "src/services/codefixes/wrapJsxInFragment.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixID2 = "wrapJsxInFragment"; + errorCodes57 = [Diagnostics.JSX_expressions_must_have_one_parent_element.code]; + registerCodeFix({ + errorCodes: errorCodes57, + getCodeActions: function getCodeActionsToWrapJsxInFragment(context2) { + const { sourceFile, span } = context2; + const node = findNodeToFix(sourceFile, span.start); + if (!node) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange38(t8, sourceFile, node)); + return [createCodeFixAction(fixID2, changes, Diagnostics.Wrap_in_JSX_fragment, fixID2, Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]; + }, + fixIds: [fixID2], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes57, (changes, diag2) => { + const node = findNodeToFix(context2.sourceFile, diag2.start); + if (!node) + return void 0; + doChange38(changes, context2.sourceFile, node); + }) + }); + } + }); + function getInfo20(sourceFile, pos) { + const token = getTokenAtPosition(sourceFile, pos); + const indexSignature = tryCast(token.parent.parent, isIndexSignatureDeclaration); + if (!indexSignature) + return void 0; + const container = isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : tryCast(indexSignature.parent.parent, isTypeAliasDeclaration); + if (!container) + return void 0; + return { indexSignature, container }; + } + function createTypeAliasFromInterface(declaration, type3) { + return factory.createTypeAliasDeclaration(declaration.modifiers, declaration.name, declaration.typeParameters, type3); + } + function doChange39(changes, sourceFile, { indexSignature, container }) { + const members = isInterfaceDeclaration(container) ? container.members : container.type.members; + const otherMembers = members.filter((member) => !isIndexSignatureDeclaration(member)); + const parameter = first(indexSignature.parameters); + const mappedTypeParameter = factory.createTypeParameterDeclaration( + /*modifiers*/ + void 0, + cast(parameter.name, isIdentifier), + parameter.type + ); + const mappedIntersectionType = factory.createMappedTypeNode( + hasEffectiveReadonlyModifier(indexSignature) ? factory.createModifier( + 148 + /* ReadonlyKeyword */ + ) : void 0, + mappedTypeParameter, + /*nameType*/ + void 0, + indexSignature.questionToken, + indexSignature.type, + /*members*/ + void 0 + ); + const intersectionType2 = factory.createIntersectionTypeNode([ + ...getAllSuperTypeNodes(container), + mappedIntersectionType, + ...otherMembers.length ? [factory.createTypeLiteralNode(otherMembers)] : emptyArray + ]); + changes.replaceNode(sourceFile, container, createTypeAliasFromInterface(container, intersectionType2)); + } + var fixId45, errorCodes58; + var init_convertToMappedObjectType = __esm2({ + "src/services/codefixes/convertToMappedObjectType.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId45 = "fixConvertToMappedObjectType"; + errorCodes58 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code]; + registerCodeFix({ + errorCodes: errorCodes58, + getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context2) { + const { sourceFile, span } = context2; + const info2 = getInfo20(sourceFile, span.start); + if (!info2) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange39(t8, sourceFile, info2)); + const name2 = idText(info2.container.name); + return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name2], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name2])]; + }, + fixIds: [fixId45], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes58, (changes, diag2) => { + const info2 = getInfo20(diag2.file, diag2.start); + if (info2) + doChange39(changes, diag2.file, info2); + }) + }); + } + }); + var fixId46, errorCodes59; + var init_removeAccidentalCallParentheses = __esm2({ + "src/services/codefixes/removeAccidentalCallParentheses.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId46 = "removeAccidentalCallParentheses"; + errorCodes59 = [ + Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code + ]; + registerCodeFix({ + errorCodes: errorCodes59, + getCodeActions(context2) { + const callExpression = findAncestor(getTokenAtPosition(context2.sourceFile, context2.span.start), isCallExpression); + if (!callExpression) { + return void 0; + } + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + t8.deleteRange(context2.sourceFile, { pos: callExpression.expression.end, end: callExpression.end }); + }); + return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)]; + }, + fixIds: [fixId46] + }); + } + }); + function makeChange10(changeTracker, sourceFile, span) { + const awaitKeyword = tryCast( + getTokenAtPosition(sourceFile, span.start), + (node) => node.kind === 135 + /* AwaitKeyword */ + ); + const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression); + if (!awaitExpression) { + return; + } + let expressionToReplace = awaitExpression; + const hasSurroundingParens = isParenthesizedExpression(awaitExpression.parent); + if (hasSurroundingParens) { + const leftMostExpression = getLeftmostExpression( + awaitExpression.expression, + /*stopAtCallExpressions*/ + false + ); + if (isIdentifier(leftMostExpression)) { + const precedingToken = findPrecedingToken(awaitExpression.parent.pos, sourceFile); + if (precedingToken && precedingToken.kind !== 105) { + expressionToReplace = awaitExpression.parent; + } + } + } + changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression); + } + var fixId47, errorCodes60; + var init_removeUnnecessaryAwait = __esm2({ + "src/services/codefixes/removeUnnecessaryAwait.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId47 = "removeUnnecessaryAwait"; + errorCodes60 = [ + Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code + ]; + registerCodeFix({ + errorCodes: errorCodes60, + getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange10(t8, context2.sourceFile, context2.span)); + if (changes.length > 0) { + return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)]; + } + }, + fixIds: [fixId47], + getAllCodeActions: (context2) => { + return codeFixAll(context2, errorCodes60, (changes, diag2) => makeChange10(changes, diag2.file, diag2)); + } + }); + } + }); + function getImportDeclaration2(sourceFile, span) { + return findAncestor(getTokenAtPosition(sourceFile, span.start), isImportDeclaration); + } + function splitTypeOnlyImport(changes, importDeclaration, context2) { + if (!importDeclaration) { + return; + } + const importClause = Debug.checkDefined(importDeclaration.importClause); + changes.replaceNode( + context2.sourceFile, + importDeclaration, + factory.updateImportDeclaration( + importDeclaration, + importDeclaration.modifiers, + factory.updateImportClause( + importClause, + importClause.isTypeOnly, + importClause.name, + /*namedBindings*/ + void 0 + ), + importDeclaration.moduleSpecifier, + importDeclaration.attributes + ) + ); + changes.insertNodeAfter( + context2.sourceFile, + importDeclaration, + factory.createImportDeclaration( + /*modifiers*/ + void 0, + factory.updateImportClause( + importClause, + importClause.isTypeOnly, + /*name*/ + void 0, + importClause.namedBindings + ), + importDeclaration.moduleSpecifier, + importDeclaration.attributes + ) + ); + } + var errorCodes61, fixId48; + var init_splitTypeOnlyImport = __esm2({ + "src/services/codefixes/splitTypeOnlyImport.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + errorCodes61 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code]; + fixId48 = "splitTypeOnlyImport"; + registerCodeFix({ + errorCodes: errorCodes61, + fixIds: [fixId48], + getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => { + return splitTypeOnlyImport(t8, getImportDeclaration2(context2.sourceFile, context2.span), context2); + }); + if (changes.length) { + return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)]; + } + }, + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes61, (changes, error22) => { + splitTypeOnlyImport(changes, getImportDeclaration2(context2.sourceFile, error22), context2); + }) + }); + } + }); + function getInfo21(sourceFile, pos, program) { + var _a2; + const checker = program.getTypeChecker(); + const symbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, pos)); + if (symbol === void 0) + return; + const declaration = tryCast((_a2 = symbol == null ? void 0 : symbol.valueDeclaration) == null ? void 0 : _a2.parent, isVariableDeclarationList); + if (declaration === void 0) + return; + const constToken = findChildOfKind(declaration, 87, sourceFile); + if (constToken === void 0) + return; + return { symbol, token: constToken }; + } + function doChange40(changes, sourceFile, token) { + changes.replaceNode(sourceFile, token, factory.createToken( + 121 + /* LetKeyword */ + )); + } + var fixId49, errorCodes62; + var init_convertConstToLet = __esm2({ + "src/services/codefixes/convertConstToLet.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId49 = "fixConvertConstToLet"; + errorCodes62 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code]; + registerCodeFix({ + errorCodes: errorCodes62, + getCodeActions: function getCodeActionsToConvertConstToLet(context2) { + const { sourceFile, span, program } = context2; + const info2 = getInfo21(sourceFile, span.start, program); + if (info2 === void 0) + return; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange40(t8, sourceFile, info2.token)); + return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)]; + }, + getAllCodeActions: (context2) => { + const { program } = context2; + const seen = /* @__PURE__ */ new Map(); + return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context2, (changes) => { + eachDiagnostic(context2, errorCodes62, (diag2) => { + const info2 = getInfo21(diag2.file, diag2.start, program); + if (info2) { + if (addToSeen(seen, getSymbolId(info2.symbol))) { + return doChange40(changes, diag2.file, info2.token); + } + } + return void 0; + }); + })); + }, + fixIds: [fixId49] + }); + } + }); + function getInfo22(sourceFile, pos, _6) { + const node = getTokenAtPosition(sourceFile, pos); + return node.kind === 27 && node.parent && (isObjectLiteralExpression(node.parent) || isArrayLiteralExpression(node.parent)) ? { node } : void 0; + } + function doChange41(changes, sourceFile, { node }) { + const newNode = factory.createToken( + 28 + /* CommaToken */ + ); + changes.replaceNode(sourceFile, node, newNode); + } + var fixId50, expectedErrorCode, errorCodes63; + var init_fixExpectedComma = __esm2({ + "src/services/codefixes/fixExpectedComma.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixId50 = "fixExpectedComma"; + expectedErrorCode = Diagnostics._0_expected.code; + errorCodes63 = [expectedErrorCode]; + registerCodeFix({ + errorCodes: errorCodes63, + getCodeActions(context2) { + const { sourceFile } = context2; + const info2 = getInfo22(sourceFile, context2.span.start, context2.errorCode); + if (!info2) + return void 0; + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => doChange41(t8, sourceFile, info2)); + return [createCodeFixAction( + fixId50, + changes, + [Diagnostics.Change_0_to_1, ";", ","], + fixId50, + [Diagnostics.Change_0_to_1, ";", ","] + )]; + }, + fixIds: [fixId50], + getAllCodeActions: (context2) => codeFixAll(context2, errorCodes63, (changes, diag2) => { + const info2 = getInfo22(diag2.file, diag2.start, diag2.code); + if (info2) + doChange41(changes, context2.sourceFile, info2); + }) + }); + } + }); + function makeChange11(changes, sourceFile, span, program, seen) { + const node = getTokenAtPosition(sourceFile, span.start); + if (!isIdentifier(node) || !isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0) + return; + const checker = program.getTypeChecker(); + const symbol = checker.getSymbolAtLocation(node); + const decl = symbol == null ? void 0 : symbol.valueDeclaration; + if (!decl || !isParameter(decl) || !isNewExpression(decl.parent.parent)) + return; + if (seen == null ? void 0 : seen.has(decl)) + return; + seen == null ? void 0 : seen.add(decl); + const typeArguments = getEffectiveTypeArguments(decl.parent.parent); + if (some2(typeArguments)) { + const typeArgument = typeArguments[0]; + const needsParens = !isUnionTypeNode(typeArgument) && !isParenthesizedTypeNode(typeArgument) && isParenthesizedTypeNode(factory.createUnionTypeNode([typeArgument, factory.createKeywordTypeNode( + 116 + /* VoidKeyword */ + )]).types[0]); + if (needsParens) { + changes.insertText(sourceFile, typeArgument.pos, "("); + } + changes.insertText(sourceFile, typeArgument.end, needsParens ? ") | void" : " | void"); + } else { + const signature = checker.getResolvedSignature(node.parent); + const parameter = signature == null ? void 0 : signature.parameters[0]; + const parameterType = parameter && checker.getTypeOfSymbolAtLocation(parameter, decl.parent.parent); + if (isInJSFile(decl)) { + if (!parameterType || parameterType.flags & 3) { + changes.insertText(sourceFile, decl.parent.parent.end, `)`); + changes.insertText(sourceFile, skipTrivia(sourceFile.text, decl.parent.parent.pos), `/** @type {Promise} */(`); + } + } else { + if (!parameterType || parameterType.flags & 2) { + changes.insertText(sourceFile, decl.parent.parent.expression.end, ""); + } + } + } + } + function getEffectiveTypeArguments(node) { + var _a2; + if (isInJSFile(node)) { + if (isParenthesizedExpression(node.parent)) { + const jsDocType = (_a2 = getJSDocTypeTag(node.parent)) == null ? void 0 : _a2.typeExpression.type; + if (jsDocType && isTypeReferenceNode(jsDocType) && isIdentifier(jsDocType.typeName) && idText(jsDocType.typeName) === "Promise") { + return jsDocType.typeArguments; + } + } + } else { + return node.typeArguments; + } + } + var fixName7, fixId51, errorCodes64; + var init_fixAddVoidToPromise = __esm2({ + "src/services/codefixes/fixAddVoidToPromise.ts"() { + "use strict"; + init_ts4(); + init_ts_codefix(); + fixName7 = "addVoidToPromise"; + fixId51 = "addVoidToPromise"; + errorCodes64 = [ + Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code, + Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code + ]; + registerCodeFix({ + errorCodes: errorCodes64, + fixIds: [fixId51], + getCodeActions(context2) { + const changes = ts_textChanges_exports.ChangeTracker.with(context2, (t8) => makeChange11(t8, context2.sourceFile, context2.span, context2.program)); + if (changes.length > 0) { + return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]; + } + }, + getAllCodeActions(context2) { + return codeFixAll(context2, errorCodes64, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context2.program, /* @__PURE__ */ new Set())); + } + }); + } + }); + var ts_codefix_exports = {}; + __export2(ts_codefix_exports, { + PreserveOptionalFlags: () => PreserveOptionalFlags, + addNewNodeForMemberSymbol: () => addNewNodeForMemberSymbol, + codeFixAll: () => codeFixAll, + createCodeFixAction: () => createCodeFixAction, + createCodeFixActionMaybeFixAll: () => createCodeFixActionMaybeFixAll, + createCodeFixActionWithoutFixAll: () => createCodeFixActionWithoutFixAll, + createCombinedCodeActions: () => createCombinedCodeActions, + createFileTextChanges: () => createFileTextChanges, + createImportAdder: () => createImportAdder, + createImportSpecifierResolver: () => createImportSpecifierResolver, + createJsonPropertyAssignment: () => createJsonPropertyAssignment, + createMissingMemberNodes: () => createMissingMemberNodes, + createSignatureDeclarationFromCallExpression: () => createSignatureDeclarationFromCallExpression, + createSignatureDeclarationFromSignature: () => createSignatureDeclarationFromSignature, + createStubbedBody: () => createStubbedBody, + eachDiagnostic: () => eachDiagnostic, + findAncestorMatchingSpan: () => findAncestorMatchingSpan, + findJsonProperty: () => findJsonProperty, + generateAccessorFromProperty: () => generateAccessorFromProperty, + getAccessorConvertiblePropertyAtPosition: () => getAccessorConvertiblePropertyAtPosition, + getAllFixes: () => getAllFixes, + getAllSupers: () => getAllSupers, + getArgumentTypesAndTypeParameters: () => getArgumentTypesAndTypeParameters, + getFixes: () => getFixes, + getImportCompletionAction: () => getImportCompletionAction, + getImportKind: () => getImportKind, + getJSDocTypedefNodes: () => getJSDocTypedefNodes, + getNoopSymbolTrackerWithResolver: () => getNoopSymbolTrackerWithResolver, + getPromoteTypeOnlyCompletionAction: () => getPromoteTypeOnlyCompletionAction, + getSupportedErrorCodes: () => getSupportedErrorCodes, + importFixName: () => importFixName, + importSymbols: () => importSymbols, + moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier, + moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier, + parameterShouldGetTypeFromJSDoc: () => parameterShouldGetTypeFromJSDoc, + registerCodeFix: () => registerCodeFix, + setJsonCompilerOptionValue: () => setJsonCompilerOptionValue, + setJsonCompilerOptionValues: () => setJsonCompilerOptionValues, + tryGetAutoImportableReferenceFromTypeNode: () => tryGetAutoImportableReferenceFromTypeNode, + typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode + }); + var init_ts_codefix = __esm2({ + "src/services/_namespaces/ts.codefix.ts"() { + "use strict"; + init_codeFixProvider(); + init_addConvertToUnknownForNonOverlappingTypes(); + init_addEmptyExportDeclaration(); + init_addMissingAsync(); + init_addMissingAwait(); + init_addMissingConst(); + init_addMissingDeclareProperty(); + init_addMissingInvocationForDecorator(); + init_addNameToNamelessParameter(); + init_addOptionalPropertyUndefined(); + init_annotateWithTypeFromJSDoc(); + init_convertFunctionToEs6Class(); + init_convertToAsyncFunction(); + init_convertToEsModule(); + init_correctQualifiedNameToIndexedAccessType(); + init_convertToTypeOnlyExport(); + init_convertToTypeOnlyImport(); + init_convertTypedefToType(); + init_convertLiteralTypeToMappedType(); + init_fixClassIncorrectlyImplementsInterface(); + init_importFixes(); + init_fixAddMissingConstraint(); + init_fixOverrideModifier(); + init_fixNoPropertyAccessFromIndexSignature(); + init_fixImplicitThis(); + init_fixImportNonExportedMember(); + init_fixIncorrectNamedTupleSyntax(); + init_fixSpelling(); + init_returnValueCorrect(); + init_fixAddMissingMember(); + init_fixAddMissingNewOperator(); + init_fixAddMissingParam(); + init_fixCannotFindModule(); + init_fixClassDoesntImplementInheritedAbstractMember(); + init_fixClassSuperMustPrecedeThisAccess(); + init_fixConstructorForDerivedNeedSuperCall(); + init_fixEnableJsxFlag(); + init_fixNaNEquality(); + init_fixModuleAndTargetOptions(); + init_fixPropertyAssignment(); + init_fixExtendsInterfaceBecomesImplements(); + init_fixForgottenThisPropertyAccess(); + init_fixInvalidJsxCharacters(); + init_fixUnmatchedParameter(); + init_fixUnreferenceableDecoratorMetadata(); + init_fixUnusedIdentifier(); + init_fixUnreachableCode(); + init_fixUnusedLabel(); + init_fixJSDocTypes(); + init_fixMissingCallParentheses(); + init_fixAwaitInSyncFunction(); + init_fixPropertyOverrideAccessor(); + init_inferFromUsage(); + init_fixReturnTypeInAsyncFunction(); + init_disableJsDiagnostics(); + init_helpers2(); + init_generateAccessors(); + init_fixInvalidImportSyntax(); + init_fixStrictClassInitialization(); + init_requireInTs(); + init_useDefaultImport(); + init_useBigintLiteral(); + init_fixAddModuleReferTypeMissingTypeof(); + init_wrapJsxInFragment(); + init_convertToMappedObjectType(); + init_removeAccidentalCallParentheses(); + init_removeUnnecessaryAwait(); + init_splitTypeOnlyImport(); + init_convertConstToLet(); + init_fixExpectedComma(); + init_fixAddVoidToPromise(); + } + }); + function originIsThisType(origin) { + return !!(origin.kind & 1); + } + function originIsSymbolMember(origin) { + return !!(origin.kind & 2); + } + function originIsExport(origin) { + return !!(origin && origin.kind & 4); + } + function originIsResolvedExport(origin) { + return !!(origin && origin.kind === 32); + } + function originIncludesSymbolName(origin) { + return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin); + } + function originIsPackageJsonImport(origin) { + return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson; + } + function originIsPromise(origin) { + return !!(origin.kind & 8); + } + function originIsNullableMember(origin) { + return !!(origin.kind & 16); + } + function originIsTypeOnlyAlias(origin) { + return !!(origin && origin.kind & 64); + } + function originIsObjectLiteralMethod(origin) { + return !!(origin && origin.kind & 128); + } + function originIsIgnore(origin) { + return !!(origin && origin.kind & 256); + } + function originIsComputedPropertyName(origin) { + return !!(origin && origin.kind & 512); + } + function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) { + var _a2, _b, _c; + const start = timestamp3(); + const needsFullResolution = isForImportStatementCompletion || moduleResolutionSupportsPackageJsonExportsAndImports(getEmitModuleResolutionKind(program.getCompilerOptions())); + let skippedAny = false; + let ambientCount = 0; + let resolvedCount = 0; + let resolvedFromCacheCount = 0; + let cacheAttemptCount = 0; + const result2 = cb({ + tryResolve, + skippedAny: () => skippedAny, + resolvedAny: () => resolvedCount > 0, + resolvedBeyondLimit: () => resolvedCount > moduleSpecifierResolutionLimit + }); + const hitRateMessage = cacheAttemptCount ? ` (${(resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1)}% hit rate)` : ""; + (_a2 = host.log) == null ? void 0 : _a2.call(host, `${logPrefix}: resolved ${resolvedCount} module specifiers, plus ${ambientCount} ambient and ${resolvedFromCacheCount} from cache${hitRateMessage}`); + (_b = host.log) == null ? void 0 : _b.call(host, `${logPrefix}: response is ${skippedAny ? "incomplete" : "complete"}`); + (_c = host.log) == null ? void 0 : _c.call(host, `${logPrefix}: ${timestamp3() - start}`); + return result2; + function tryResolve(exportInfo, isFromAmbientModule) { + if (isFromAmbientModule) { + const result3 = resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite); + if (result3) { + ambientCount++; + } + return result3 || "failed"; + } + const shouldResolveModuleSpecifier = needsFullResolution || preferences.allowIncompleteCompletions && resolvedCount < moduleSpecifierResolutionLimit; + const shouldGetModuleSpecifierFromCache = !shouldResolveModuleSpecifier && preferences.allowIncompleteCompletions && cacheAttemptCount < moduleSpecifierResolutionCacheAttemptLimit; + const result22 = shouldResolveModuleSpecifier || shouldGetModuleSpecifierFromCache ? resolver.getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, shouldGetModuleSpecifierFromCache) : void 0; + if (!shouldResolveModuleSpecifier && !shouldGetModuleSpecifierFromCache || shouldGetModuleSpecifierFromCache && !result22) { + skippedAny = true; + } + resolvedCount += (result22 == null ? void 0 : result22.computedWithoutCacheCount) || 0; + resolvedFromCacheCount += exportInfo.length - ((result22 == null ? void 0 : result22.computedWithoutCacheCount) || 0); + if (shouldGetModuleSpecifierFromCache) { + cacheAttemptCount++; + } + return result22 || (needsFullResolution ? "failed" : "skipped"); + } + } + function getCompletionsAtPosition(host, program, log3, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) { + var _a2; + const { previousToken } = getRelevantTokens(position, sourceFile); + if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) { + return void 0; + } + if (triggerCharacter === " ") { + if (preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { + return { isGlobalCompletion: true, isMemberCompletion: false, isNewIdentifierLocation: true, isIncomplete: true, entries: [] }; + } + return void 0; + } + const compilerOptions = program.getCompilerOptions(); + const checker = program.getTypeChecker(); + const incompleteCompletionsCache = preferences.allowIncompleteCompletions ? (_a2 = host.getIncompleteCompletionsCache) == null ? void 0 : _a2.call(host) : void 0; + if (incompleteCompletionsCache && completionKind === 3 && previousToken && isIdentifier(previousToken)) { + const incompleteContinuation = continuePreviousIncompleteResponse(incompleteCompletionsCache, sourceFile, previousToken, program, host, preferences, cancellationToken, position); + if (incompleteContinuation) { + return incompleteContinuation; + } + } else { + incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear(); + } + const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log3, preferences, includeSymbol); + if (stringCompletions) { + return stringCompletions; + } + if (previousToken && isBreakOrContinueStatement(previousToken.parent) && (previousToken.kind === 83 || previousToken.kind === 88 || previousToken.kind === 80)) { + return getLabelCompletionAtPosition(previousToken.parent); + } + const completionData = getCompletionData( + program, + log3, + sourceFile, + compilerOptions, + position, + preferences, + /*detailsEntryId*/ + void 0, + host, + formatContext, + cancellationToken + ); + if (!completionData) { + return void 0; + } + switch (completionData.kind) { + case 0: + const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log3, completionData, preferences, formatContext, position, includeSymbol); + if (response == null ? void 0 : response.isIncomplete) { + incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response); + } + return response; + case 1: + return jsdocCompletionInfo([ + ...ts_JsDoc_exports.getJSDocTagNameCompletions(), + ...getJSDocParameterCompletions( + sourceFile, + position, + checker, + compilerOptions, + preferences, + /*tagNameOnly*/ + true + ) + ]); + case 2: + return jsdocCompletionInfo([ + ...ts_JsDoc_exports.getJSDocTagCompletions(), + ...getJSDocParameterCompletions( + sourceFile, + position, + checker, + compilerOptions, + preferences, + /*tagNameOnly*/ + false + ) + ]); + case 3: + return jsdocCompletionInfo(ts_JsDoc_exports.getJSDocParameterNameCompletions(completionData.tag)); + case 4: + return specificKeywordCompletionInfo(completionData.keywordCompletions, completionData.isNewIdentifierLocation); + default: + return Debug.assertNever(completionData); + } + } + function compareCompletionEntries(entryInArray, entryToInsert) { + var _a2, _b; + let result2 = compareStringsCaseSensitiveUI(entryInArray.sortText, entryToInsert.sortText); + if (result2 === 0) { + result2 = compareStringsCaseSensitiveUI(entryInArray.name, entryToInsert.name); + } + if (result2 === 0 && ((_a2 = entryInArray.data) == null ? void 0 : _a2.moduleSpecifier) && ((_b = entryToInsert.data) == null ? void 0 : _b.moduleSpecifier)) { + result2 = compareNumberOfDirectorySeparators( + entryInArray.data.moduleSpecifier, + entryToInsert.data.moduleSpecifier + ); + } + if (result2 === 0) { + return -1; + } + return result2; + } + function completionEntryDataIsResolved(data) { + return !!(data == null ? void 0 : data.moduleSpecifier); + } + function continuePreviousIncompleteResponse(cache, file, location2, program, host, preferences, cancellationToken, position) { + const previousResponse = cache.get(); + if (!previousResponse) + return void 0; + const touchNode = getTouchingPropertyName(file, position); + const lowerCaseTokenText = location2.text.toLowerCase(); + const exportMap = getExportInfoMap(file, host, program, preferences, cancellationToken); + const newEntries = resolvingModuleSpecifiers( + "continuePreviousIncompleteResponse", + host, + ts_codefix_exports.createImportSpecifierResolver(file, program, host, preferences), + program, + location2.getStart(), + preferences, + /*isForImportStatementCompletion*/ + false, + isValidTypeOnlyAliasUseSite(location2), + (context2) => { + const entries = mapDefined(previousResponse.entries, (entry) => { + var _a2; + if (!entry.hasAction || !entry.source || !entry.data || completionEntryDataIsResolved(entry.data)) { + return entry; + } + if (!charactersFuzzyMatchInString(entry.name, lowerCaseTokenText)) { + return void 0; + } + const { origin } = Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)); + const info2 = exportMap.get(file.path, entry.data.exportMapKey); + const result2 = info2 && context2.tryResolve(info2, !isExternalModuleNameRelative(stripQuotes(origin.moduleSymbol.name))); + if (result2 === "skipped") + return entry; + if (!result2 || result2 === "failed") { + (_a2 = host.log) == null ? void 0 : _a2.call(host, `Unexpected failure resolving auto import for '${entry.name}' from '${entry.source}'`); + return void 0; + } + const newOrigin = { + ...origin, + kind: 32, + moduleSpecifier: result2.moduleSpecifier + }; + entry.data = originToCompletionEntryData(newOrigin); + entry.source = getSourceFromOrigin(newOrigin); + entry.sourceDisplay = [textPart(newOrigin.moduleSpecifier)]; + return entry; + }); + if (!context2.skippedAny()) { + previousResponse.isIncomplete = void 0; + } + return entries; + } + ); + previousResponse.entries = newEntries; + previousResponse.flags = (previousResponse.flags || 0) | 4; + previousResponse.optionalReplacementSpan = getOptionalReplacementSpan(touchNode); + return previousResponse; + } + function jsdocCompletionInfo(entries) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries }; + } + function getJSDocParameterCompletions(sourceFile, position, checker, options, preferences, tagNameOnly) { + const currentToken = getTokenAtPosition(sourceFile, position); + if (!isJSDocTag(currentToken) && !isJSDoc(currentToken)) { + return []; + } + const jsDoc = isJSDoc(currentToken) ? currentToken : currentToken.parent; + if (!isJSDoc(jsDoc)) { + return []; + } + const func = jsDoc.parent; + if (!isFunctionLike(func)) { + return []; + } + const isJs = isSourceFileJS(sourceFile); + const isSnippet = preferences.includeCompletionsWithSnippetText || void 0; + const paramTagCount = countWhere(jsDoc.tags, (tag) => isJSDocParameterTag(tag) && tag.getEnd() <= position); + return mapDefined(func.parameters, (param) => { + if (getJSDocParameterTags(param).length) { + return void 0; + } + if (isIdentifier(param.name)) { + const tabstopCounter = { tabstop: 1 }; + const paramName = param.name.text; + let displayText = getJSDocParamAnnotation( + paramName, + param.initializer, + param.dotDotDotToken, + isJs, + /*isObject*/ + false, + /*isSnippet*/ + false, + checker, + options, + preferences + ); + let snippetText = isSnippet ? getJSDocParamAnnotation( + paramName, + param.initializer, + param.dotDotDotToken, + isJs, + /*isObject*/ + false, + /*isSnippet*/ + true, + checker, + options, + preferences, + tabstopCounter + ) : void 0; + if (tagNameOnly) { + displayText = displayText.slice(1); + if (snippetText) + snippetText = snippetText.slice(1); + } + return { + name: displayText, + kind: "parameter", + sortText: SortText.LocationPriority, + insertText: isSnippet ? snippetText : void 0, + isSnippet + }; + } else if (param.parent.parameters.indexOf(param) === paramTagCount) { + const paramPath = `param${paramTagCount}`; + const displayTextResult = generateJSDocParamTagsForDestructuring( + paramPath, + param.name, + param.initializer, + param.dotDotDotToken, + isJs, + /*isSnippet*/ + false, + checker, + options, + preferences + ); + const snippetTextResult = isSnippet ? generateJSDocParamTagsForDestructuring( + paramPath, + param.name, + param.initializer, + param.dotDotDotToken, + isJs, + /*isSnippet*/ + true, + checker, + options, + preferences + ) : void 0; + let displayText = displayTextResult.join(getNewLineCharacter(options) + "* "); + let snippetText = snippetTextResult == null ? void 0 : snippetTextResult.join(getNewLineCharacter(options) + "* "); + if (tagNameOnly) { + displayText = displayText.slice(1); + if (snippetText) + snippetText = snippetText.slice(1); + } + return { + name: displayText, + kind: "parameter", + sortText: SortText.LocationPriority, + insertText: isSnippet ? snippetText : void 0, + isSnippet + }; + } + }); + } + function generateJSDocParamTagsForDestructuring(path2, pattern5, initializer, dotDotDotToken, isJs, isSnippet, checker, options, preferences) { + if (!isJs) { + return [ + getJSDocParamAnnotation( + path2, + initializer, + dotDotDotToken, + isJs, + /*isObject*/ + false, + isSnippet, + checker, + options, + preferences, + { tabstop: 1 } + ) + ]; + } + return patternWorker(path2, pattern5, initializer, dotDotDotToken, { tabstop: 1 }); + function patternWorker(path22, pattern22, initializer2, dotDotDotToken2, counter) { + if (isObjectBindingPattern(pattern22) && !dotDotDotToken2) { + const oldTabstop = counter.tabstop; + const childCounter = { tabstop: oldTabstop }; + const rootParam = getJSDocParamAnnotation( + path22, + initializer2, + dotDotDotToken2, + isJs, + /*isObject*/ + true, + isSnippet, + checker, + options, + preferences, + childCounter + ); + let childTags = []; + for (const element of pattern22.elements) { + const elementTags = elementWorker(path22, element, childCounter); + if (!elementTags) { + childTags = void 0; + break; + } else { + childTags.push(...elementTags); + } + } + if (childTags) { + counter.tabstop = childCounter.tabstop; + return [rootParam, ...childTags]; + } + } + return [ + getJSDocParamAnnotation( + path22, + initializer2, + dotDotDotToken2, + isJs, + /*isObject*/ + false, + isSnippet, + checker, + options, + preferences, + counter + ) + ]; + } + function elementWorker(path22, element, counter) { + if (!element.propertyName && isIdentifier(element.name) || isIdentifier(element.name)) { + const propertyName = element.propertyName ? tryGetTextOfPropertyName(element.propertyName) : element.name.text; + if (!propertyName) { + return void 0; + } + const paramName = `${path22}.${propertyName}`; + return [ + getJSDocParamAnnotation( + paramName, + element.initializer, + element.dotDotDotToken, + isJs, + /*isObject*/ + false, + isSnippet, + checker, + options, + preferences, + counter + ) + ]; + } else if (element.propertyName) { + const propertyName = tryGetTextOfPropertyName(element.propertyName); + return propertyName && patternWorker(`${path22}.${propertyName}`, element.name, element.initializer, element.dotDotDotToken, counter); + } + return void 0; + } + } + function getJSDocParamAnnotation(paramName, initializer, dotDotDotToken, isJs, isObject8, isSnippet, checker, options, preferences, tabstopCounter) { + if (isSnippet) { + Debug.assertIsDefined(tabstopCounter); + } + if (initializer) { + paramName = getJSDocParamNameWithInitializer(paramName, initializer); + } + if (isSnippet) { + paramName = escapeSnippetText(paramName); + } + if (isJs) { + let type3 = "*"; + if (isObject8) { + Debug.assert(!dotDotDotToken, `Cannot annotate a rest parameter with type 'Object'.`); + type3 = "Object"; + } else { + if (initializer) { + const inferredType = checker.getTypeAtLocation(initializer.parent); + if (!(inferredType.flags & (1 | 16384))) { + const sourceFile = initializer.getSourceFile(); + const quotePreference = getQuotePreference(sourceFile, preferences); + const builderFlags = quotePreference === 0 ? 268435456 : 0; + const typeNode = checker.typeToTypeNode(inferredType, findAncestor(initializer, isFunctionLike), builderFlags); + if (typeNode) { + const printer = isSnippet ? createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target + }) : createPrinter({ + removeComments: true, + module: options.module, + target: options.target + }); + setEmitFlags( + typeNode, + 1 + /* SingleLine */ + ); + type3 = printer.printNode(4, typeNode, sourceFile); + } + } + } + if (isSnippet && type3 === "*") { + type3 = `\${${tabstopCounter.tabstop++}:${type3}}`; + } + } + const dotDotDot = !isObject8 && dotDotDotToken ? "..." : ""; + const description32 = isSnippet ? `\${${tabstopCounter.tabstop++}}` : ""; + return `@param {${dotDotDot}${type3}} ${paramName} ${description32}`; + } else { + const description32 = isSnippet ? `\${${tabstopCounter.tabstop++}}` : ""; + return `@param ${paramName} ${description32}`; + } + } + function getJSDocParamNameWithInitializer(paramName, initializer) { + const initializerText = initializer.getText().trim(); + if (initializerText.includes("\n") || initializerText.length > 80) { + return `[${paramName}]`; + } + return `[${paramName}=${initializerText}]`; + } + function keywordToCompletionEntry(keyword) { + return { + name: tokenToString(keyword), + kind: "keyword", + kindModifiers: "", + sortText: SortText.GlobalsOrKeywords + }; + } + function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) { + return { + isGlobalCompletion: false, + isMemberCompletion: false, + isNewIdentifierLocation, + entries: entries.slice() + }; + } + function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) { + return { + kind: 4, + keywordCompletions: getKeywordCompletions(keywordFilters, filterOutTsOnlyKeywords), + isNewIdentifierLocation + }; + } + function keywordFiltersFromSyntaxKind(keywordCompletion) { + switch (keywordCompletion) { + case 156: + return 8; + default: + Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters"); + } + } + function getOptionalReplacementSpan(location2) { + return (location2 == null ? void 0 : location2.kind) === 80 ? createTextSpanFromNode(location2) : void 0; + } + function completionInfoFromData(sourceFile, host, program, compilerOptions, log3, completionData, preferences, formatContext, position, includeSymbol) { + const { + symbols, + contextToken, + completionKind, + isInSnippetScope, + isNewIdentifierLocation, + location: location2, + propertyAccessToConvert, + keywordFilters, + symbolToOriginInfoMap, + recommendedCompletion, + isJsxInitializer, + isTypeOnlyLocation, + isJsxIdentifierExpected, + isRightOfOpenTag, + isRightOfDotOrQuestionDot, + importStatementCompletion, + insideJsDocTagTypeExpression, + symbolToSortTextMap, + hasUnresolvedAutoImports + } = completionData; + let literals = completionData.literals; + const checker = program.getTypeChecker(); + if (getLanguageVariant(sourceFile.scriptKind) === 1) { + const completionInfo = getJsxClosingTagCompletion(location2, sourceFile); + if (completionInfo) { + return completionInfo; + } + } + const caseClause = findAncestor(contextToken, isCaseClause); + if (caseClause && (isCaseKeyword(contextToken) || isNodeDescendantOf(contextToken, caseClause.expression))) { + const tracker = newCaseClauseTracker(checker, caseClause.parent.clauses); + literals = literals.filter((literal) => !tracker.hasValue(literal)); + symbols.forEach((symbol, i7) => { + if (symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) { + const value2 = checker.getConstantValue(symbol.valueDeclaration); + if (value2 !== void 0 && tracker.hasValue(value2)) { + symbolToOriginInfoMap[i7] = { + kind: 256 + /* Ignore */ + }; + } + } + }); + } + const entries = createSortedArray(); + const isChecked = isCheckedFile(sourceFile, compilerOptions); + if (isChecked && !isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === 0) { + return void 0; + } + const uniqueNames = getCompletionEntriesFromSymbols( + symbols, + entries, + /*replacementToken*/ + void 0, + contextToken, + location2, + position, + sourceFile, + host, + program, + getEmitScriptTarget(compilerOptions), + log3, + completionKind, + preferences, + compilerOptions, + formatContext, + isTypeOnlyLocation, + propertyAccessToConvert, + isJsxIdentifierExpected, + isJsxInitializer, + importStatementCompletion, + recommendedCompletion, + symbolToOriginInfoMap, + symbolToSortTextMap, + isJsxIdentifierExpected, + isRightOfOpenTag, + includeSymbol + ); + if (keywordFilters !== 0) { + for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) { + if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) { + uniqueNames.add(keywordEntry.name); + insertSorted( + entries, + keywordEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + } + } + for (const keywordEntry of getContextualKeywords(contextToken, position)) { + if (!uniqueNames.has(keywordEntry.name)) { + uniqueNames.add(keywordEntry.name); + insertSorted( + entries, + keywordEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + } + for (const literal of literals) { + const literalEntry = createCompletionEntryForLiteral(sourceFile, preferences, literal); + uniqueNames.add(literalEntry.name); + insertSorted( + entries, + literalEntry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + if (!isChecked) { + getJSCompletionEntries(sourceFile, location2.pos, uniqueNames, getEmitScriptTarget(compilerOptions), entries); + } + let caseBlock; + if (preferences.includeCompletionsWithInsertText && contextToken && !isRightOfOpenTag && !isRightOfDotOrQuestionDot && (caseBlock = findAncestor(contextToken, isCaseBlock))) { + const cases = getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, compilerOptions, host, program, formatContext); + if (cases) { + entries.push(cases.entry); + } + } + return { + flags: completionData.flags, + isGlobalCompletion: isInSnippetScope, + isIncomplete: preferences.allowIncompleteCompletions && hasUnresolvedAutoImports ? true : void 0, + isMemberCompletion: isMemberCompletionKind(completionKind), + isNewIdentifierLocation, + optionalReplacementSpan: getOptionalReplacementSpan(location2), + entries + }; + } + function isCheckedFile(sourceFile, compilerOptions) { + return !isSourceFileJS(sourceFile) || !!isCheckJsEnabledForFile(sourceFile, compilerOptions); + } + function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, host, program, formatContext) { + const clauses = caseBlock.clauses; + const checker = program.getTypeChecker(); + const switchType = checker.getTypeAtLocation(caseBlock.parent.expression); + if (switchType && switchType.isUnion() && every2(switchType.types, (type3) => type3.isLiteral())) { + const tracker = newCaseClauseTracker(checker, clauses); + const target = getEmitScriptTarget(options); + const quotePreference = getQuotePreference(sourceFile, preferences); + const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); + const elements = []; + for (const type3 of switchType.types) { + if (type3.flags & 1024) { + Debug.assert(type3.symbol, "An enum member type should have a symbol"); + Debug.assert(type3.symbol.parent, "An enum member type should have a parent symbol (the enum symbol)"); + const enumValue = type3.symbol.valueDeclaration && checker.getConstantValue(type3.symbol.valueDeclaration); + if (enumValue !== void 0) { + if (tracker.hasValue(enumValue)) { + continue; + } + tracker.addValue(enumValue); + } + const typeNode = ts_codefix_exports.typeToAutoImportableTypeNode(checker, importAdder, type3, caseBlock, target); + if (!typeNode) { + return void 0; + } + const expr = typeNodeToExpression(typeNode, target, quotePreference); + if (!expr) { + return void 0; + } + elements.push(expr); + } else if (!tracker.hasValue(type3.value)) { + switch (typeof type3.value) { + case "object": + elements.push(type3.value.negative ? factory.createPrefixUnaryExpression(41, factory.createBigIntLiteral({ negative: false, base10Value: type3.value.base10Value })) : factory.createBigIntLiteral(type3.value)); + break; + case "number": + elements.push(type3.value < 0 ? factory.createPrefixUnaryExpression(41, factory.createNumericLiteral(-type3.value)) : factory.createNumericLiteral(type3.value)); + break; + case "string": + elements.push(factory.createStringLiteral( + type3.value, + quotePreference === 0 + /* Single */ + )); + break; + } + } + } + if (elements.length === 0) { + return void 0; + } + const newClauses = map4(elements, (element) => factory.createCaseClause(element, [])); + const newLineChar = getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options); + const printer = createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target, + newLine: getNewLineKind(newLineChar) + }); + const printNode = formatContext ? (node) => printer.printAndFormatNode(4, node, sourceFile, formatContext) : (node) => printer.printNode(4, node, sourceFile); + const insertText = map4(newClauses, (clause, i7) => { + if (preferences.includeCompletionsWithSnippetText) { + return `${printNode(clause)}$${i7 + 1}`; + } + return `${printNode(clause)}`; + }).join(newLineChar); + const firstClause = printer.printNode(4, newClauses[0], sourceFile); + return { + entry: { + name: `${firstClause} ...`, + kind: "", + sortText: SortText.GlobalsOrKeywords, + insertText, + hasAction: importAdder.hasFixes() || void 0, + source: "SwitchCases/", + isSnippet: preferences.includeCompletionsWithSnippetText ? true : void 0 + }, + importAdder + }; + } + return void 0; + } + function typeNodeToExpression(typeNode, languageVersion, quotePreference) { + switch (typeNode.kind) { + case 183: + const typeName = typeNode.typeName; + return entityNameToExpression(typeName, languageVersion, quotePreference); + case 199: + const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference); + const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference); + return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression); + case 201: + const literal = typeNode.literal; + switch (literal.kind) { + case 11: + return factory.createStringLiteral( + literal.text, + quotePreference === 0 + /* Single */ + ); + case 9: + return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags); + } + return void 0; + case 196: + const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference); + return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp)); + case 186: + return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference); + case 205: + Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`); + } + return void 0; + } + function entityNameToExpression(entityName, languageVersion, quotePreference) { + if (isIdentifier(entityName)) { + return entityName; + } + const unescapedName = unescapeLeadingUnderscores(entityName.right.escapedText); + if (canUsePropertyAccess(unescapedName, languageVersion)) { + return factory.createPropertyAccessExpression( + entityNameToExpression(entityName.left, languageVersion, quotePreference), + unescapedName + ); + } else { + return factory.createElementAccessExpression( + entityNameToExpression(entityName.left, languageVersion, quotePreference), + factory.createStringLiteral( + unescapedName, + quotePreference === 0 + /* Single */ + ) + ); + } + } + function isMemberCompletionKind(kind) { + switch (kind) { + case 0: + case 3: + case 2: + return true; + default: + return false; + } + } + function getJsxClosingTagCompletion(location2, sourceFile) { + const jsxClosingElement = findAncestor(location2, (node) => { + switch (node.kind) { + case 287: + return true; + case 44: + case 32: + case 80: + case 211: + return false; + default: + return "quit"; + } + }); + if (jsxClosingElement) { + const hasClosingAngleBracket = !!findChildOfKind(jsxClosingElement, 32, sourceFile); + const tagName = jsxClosingElement.parent.openingElement.tagName; + const closingTag = tagName.getText(sourceFile); + const fullClosingTag = closingTag + (hasClosingAngleBracket ? "" : ">"); + const replacementSpan = createTextSpanFromNode(jsxClosingElement.tagName); + const entry = { + name: fullClosingTag, + kind: "class", + kindModifiers: void 0, + sortText: SortText.LocationPriority + }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, optionalReplacementSpan: replacementSpan, entries: [entry] }; + } + return; + } + function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entries) { + getNameTable(sourceFile).forEach((pos, name2) => { + if (pos === position) { + return; + } + const realName = unescapeLeadingUnderscores(name2); + if (!uniqueNames.has(realName) && isIdentifierText(realName, target)) { + uniqueNames.add(realName); + insertSorted(entries, { + name: realName, + kind: "warning", + kindModifiers: "", + sortText: SortText.JavascriptIdentifiers, + isFromUncheckedFile: true + }, compareCompletionEntries); + } + }); + } + function completionNameForLiteral(sourceFile, preferences, literal) { + return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString4(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal); + } + function createCompletionEntryForLiteral(sourceFile, preferences, literal) { + return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string", kindModifiers: "", sortText: SortText.LocationPriority }; + } + function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location2, position, sourceFile, host, program, name2, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) { + var _a2, _b; + let insertText; + let filterText; + let replacementSpan = getReplacementSpanForContextToken(replacementToken); + let data; + let isSnippet; + let source = getSourceFromOrigin(origin); + let sourceDisplay; + let hasAction; + let labelDetails; + const typeChecker = program.getTypeChecker(); + const insertQuestionDot = origin && originIsNullableMember(origin); + const useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess; + if (origin && originIsThisType(origin)) { + insertText = needsConvertPropertyAccess ? `this${insertQuestionDot ? "?." : ""}[${quotePropertyName(sourceFile, preferences, name2)}]` : `this${insertQuestionDot ? "?." : "."}${name2}`; + } else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) { + insertText = useBraces ? needsConvertPropertyAccess ? `[${quotePropertyName(sourceFile, preferences, name2)}]` : `[${name2}]` : name2; + if (insertQuestionDot || propertyAccessToConvert.questionDotToken) { + insertText = `?.${insertText}`; + } + const dot = findChildOfKind(propertyAccessToConvert, 25, sourceFile) || findChildOfKind(propertyAccessToConvert, 29, sourceFile); + if (!dot) { + return void 0; + } + const end = startsWith2(name2, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; + replacementSpan = createTextSpanFromBounds(dot.getStart(sourceFile), end); + } + if (isJsxInitializer) { + if (insertText === void 0) + insertText = name2; + insertText = `{${insertText}}`; + if (typeof isJsxInitializer !== "boolean") { + replacementSpan = createTextSpanFromNode(isJsxInitializer, sourceFile); + } + } + if (origin && originIsPromise(origin) && propertyAccessToConvert) { + if (insertText === void 0) + insertText = name2; + const precedingToken = findPrecedingToken(propertyAccessToConvert.pos, sourceFile); + let awaitText = ""; + if (precedingToken && positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) { + awaitText = ";"; + } + awaitText += `(await ${propertyAccessToConvert.expression.getText()})`; + insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`; + const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression); + const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression; + replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end); + } + if (originIsResolvedExport(origin)) { + sourceDisplay = [textPart(origin.moduleSpecifier)]; + if (importStatementCompletion) { + ({ insertText, replacementSpan } = getInsertTextAndReplacementSpanForImportCompletion(name2, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences)); + isSnippet = preferences.includeCompletionsWithSnippetText ? true : void 0; + } + } + if ((origin == null ? void 0 : origin.kind) === 64) { + hasAction = true; + } + if (completionKind === 0 && contextToken && ((_a2 = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a2.kind) !== 28) { + if (isMethodDeclaration(contextToken.parent.parent) || isGetAccessorDeclaration(contextToken.parent.parent) || isSetAccessorDeclaration(contextToken.parent.parent) || isSpreadAssignment(contextToken.parent) || ((_b = findAncestor(contextToken.parent, isPropertyAssignment)) == null ? void 0 : _b.getLastToken(sourceFile)) === contextToken || isShorthandPropertyAssignment(contextToken.parent) && getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { + source = "ObjectLiteralMemberWithComma/"; + hasAction = true; + } + } + if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 && isClassLikeMemberCompletion(symbol, location2, sourceFile)) { + let importAdder; + const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name2, symbol, location2, position, contextToken, formatContext); + if (memberCompletionEntry) { + ({ insertText, filterText, isSnippet, importAdder } = memberCompletionEntry); + if (importAdder == null ? void 0 : importAdder.hasFixes()) { + hasAction = true; + source = "ClassMemberSnippet/"; + } + } else { + return void 0; + } + } + if (origin && originIsObjectLiteralMethod(origin)) { + ({ insertText, isSnippet, labelDetails } = origin); + if (!preferences.useLabelDetailsInCompletionEntries) { + name2 = name2 + labelDetails.detail; + labelDetails = void 0; + } + source = "ObjectLiteralMethodSnippet/"; + sortText = SortText.SortBelow(sortText); + } + if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location2.parent) && location2.parent.initializer)) { + let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces"; + const type3 = typeChecker.getTypeOfSymbolAtLocation(symbol, location2); + if (preferences.jsxAttributeCompletionStyle === "auto" && !(type3.flags & 528) && !(type3.flags & 1048576 && find2(type3.types, (type22) => !!(type22.flags & 528)))) { + if (type3.flags & 402653316 || type3.flags & 1048576 && every2(type3.types, (type22) => !!(type22.flags & (402653316 | 32768) || isStringAndEmptyAnonymousObjectIntersection(type22)))) { + insertText = `${escapeSnippetText(name2)}=${quote(sourceFile, preferences, "$1")}`; + isSnippet = true; + } else { + useBraces2 = true; + } + } + if (useBraces2) { + insertText = `${escapeSnippetText(name2)}={$1}`; + isSnippet = true; + } + } + if (insertText !== void 0 && !preferences.includeCompletionsWithInsertText) { + return void 0; + } + if (originIsExport(origin) || originIsResolvedExport(origin)) { + data = originToCompletionEntryData(origin); + hasAction = !importStatementCompletion; + } + const parentNamedImportOrExport = findAncestor(location2, isNamedImportsOrExports); + if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275) { + const possibleToken = stringToToken(name2); + if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 || isNonContextualKeyword(possibleToken))) { + insertText = `${name2} as ${name2}_`; + } + } + return { + name: name2, + kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location2), + kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), + sortText, + source, + hasAction: hasAction ? true : void 0, + isRecommended: isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker) || void 0, + insertText, + filterText, + replacementSpan, + sourceDisplay, + labelDetails, + isSnippet, + isPackageJsonImport: originIsPackageJsonImport(origin) || void 0, + isImportStatementCompletion: !!importStatementCompletion || void 0, + data, + ...includeSymbol ? { symbol } : void 0 + }; + } + function isClassLikeMemberCompletion(symbol, location2, sourceFile) { + if (isInJSFile(location2)) { + return false; + } + const memberFlags = 106500 & 900095; + return !!(symbol.flags & memberFlags) && (isClassLike(location2) || location2.parent && location2.parent.parent && isClassElement(location2.parent) && location2 === location2.parent.name && location2.parent.getLastToken(sourceFile) === location2.parent.name && isClassLike(location2.parent.parent) || location2.parent && isSyntaxList(location2) && isClassLike(location2.parent)); + } + function getEntryForMemberCompletion(host, program, options, preferences, name2, symbol, location2, position, contextToken, formatContext) { + const classLikeDeclaration = findAncestor(location2, isClassLike); + if (!classLikeDeclaration) { + return void 0; + } + let isSnippet; + let insertText = name2; + const filterText = name2; + const checker = program.getTypeChecker(); + const sourceFile = location2.getSourceFile(); + const printer = createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: false, + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) + }); + const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host); + let body; + if (preferences.includeCompletionsWithSnippetText) { + isSnippet = true; + const emptyStmt = factory.createEmptyStatement(); + body = factory.createBlock( + [emptyStmt], + /*multiLine*/ + true + ); + setSnippetElement(emptyStmt, { kind: 0, order: 0 }); + } else { + body = factory.createBlock( + [], + /*multiLine*/ + true + ); + } + let modifiers = 0; + const { modifiers: presentModifiers, range: eraseRange, decorators: presentDecorators } = getPresentModifiers(contextToken, sourceFile, position); + const isAbstract = presentModifiers & 64 && classLikeDeclaration.modifierFlagsCache & 64; + let completionNodes = []; + ts_codefix_exports.addNewNodeForMemberSymbol( + symbol, + classLikeDeclaration, + sourceFile, + { program, host }, + preferences, + importAdder, + // `addNewNodeForMemberSymbol` calls this callback function for each new member node + // it adds for the given member symbol. + // We store these member nodes in the `completionNodes` array. + // Note: there might be: + // - No nodes if `addNewNodeForMemberSymbol` cannot figure out a node for the member; + // - One node; + // - More than one node if the member is overloaded (e.g. a method with overload signatures). + (node) => { + let requiredModifiers = 0; + if (isAbstract) { + requiredModifiers |= 64; + } + if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1) { + requiredModifiers |= 16; + } + if (!completionNodes.length) { + modifiers = node.modifierFlagsCache | requiredModifiers; + } + node = factory.replaceModifiers(node, modifiers); + completionNodes.push(node); + }, + body, + ts_codefix_exports.PreserveOptionalFlags.Property, + !!isAbstract + ); + if (completionNodes.length) { + const isMethod = symbol.flags & 8192; + let allowedModifiers = modifiers | 16 | 1; + if (!isMethod) { + allowedModifiers |= 128 | 8; + } else { + allowedModifiers |= 1024; + } + const allowedAndPresent = presentModifiers & allowedModifiers; + if (presentModifiers & ~allowedModifiers) { + return void 0; + } + if (modifiers & 4 && allowedAndPresent & 1) { + modifiers &= ~4; + } + if (allowedAndPresent !== 0 && !(allowedAndPresent & 1)) { + modifiers &= ~1; + } + modifiers |= allowedAndPresent; + completionNodes = completionNodes.map((node) => factory.replaceModifiers(node, modifiers)); + if (presentDecorators == null ? void 0 : presentDecorators.length) { + const lastNode = completionNodes[completionNodes.length - 1]; + if (canHaveDecorators(lastNode)) { + completionNodes[completionNodes.length - 1] = factory.replaceDecoratorsAndModifiers(lastNode, presentDecorators.concat(getModifiers(lastNode) || [])); + } + } + const format5 = 1 | 131072; + if (formatContext) { + insertText = printer.printAndFormatSnippetList( + format5, + factory.createNodeArray(completionNodes), + sourceFile, + formatContext + ); + } else { + insertText = printer.printSnippetList( + format5, + factory.createNodeArray(completionNodes), + sourceFile + ); + } + } + return { insertText, filterText, isSnippet, importAdder, eraseRange }; + } + function getPresentModifiers(contextToken, sourceFile, position) { + if (!contextToken || getLineAndCharacterOfPosition(sourceFile, position).line > getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line) { + return { + modifiers: 0 + /* None */ + }; + } + let modifiers = 0; + let decorators; + let contextMod; + const range2 = { pos: position, end: position }; + if (isPropertyDeclaration(contextToken.parent) && contextToken.parent.modifiers) { + modifiers |= modifiersToFlags(contextToken.parent.modifiers) & 98303; + decorators = contextToken.parent.modifiers.filter(isDecorator) || []; + range2.pos = Math.min(range2.pos, contextToken.parent.modifiers.pos); + } + if (contextMod = isModifierLike2(contextToken)) { + const contextModifierFlag = modifierToFlag(contextMod); + if (!(modifiers & contextModifierFlag)) { + modifiers |= contextModifierFlag; + range2.pos = Math.min(range2.pos, contextToken.pos); + } + } + return { modifiers, decorators, range: range2.pos !== position ? range2 : void 0 }; + } + function isModifierLike2(node) { + if (isModifier(node)) { + return node.kind; + } + if (isIdentifier(node)) { + const originalKeywordKind = identifierToKeywordKind(node); + if (originalKeywordKind && isModifierKind(originalKeywordKind)) { + return originalKeywordKind; + } + } + return void 0; + } + function getEntryForObjectLiteralMethodCompletion(symbol, name2, enclosingDeclaration, program, host, options, preferences, formatContext) { + const isSnippet = preferences.includeCompletionsWithSnippetText || void 0; + let insertText = name2; + const sourceFile = enclosingDeclaration.getSourceFile(); + const method2 = createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences); + if (!method2) { + return void 0; + } + const printer = createSnippetPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: false, + newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options)) + }); + if (formatContext) { + insertText = printer.printAndFormatSnippetList(16 | 64, factory.createNodeArray( + [method2], + /*hasTrailingComma*/ + true + ), sourceFile, formatContext); + } else { + insertText = printer.printSnippetList(16 | 64, factory.createNodeArray( + [method2], + /*hasTrailingComma*/ + true + ), sourceFile); + } + const signaturePrinter = createPrinter({ + removeComments: true, + module: options.module, + target: options.target, + omitTrailingSemicolon: true + }); + const methodSignature = factory.createMethodSignature( + /*modifiers*/ + void 0, + /*name*/ + "", + method2.questionToken, + method2.typeParameters, + method2.parameters, + method2.type + ); + const labelDetails = { detail: signaturePrinter.printNode(4, methodSignature, sourceFile) }; + return { isSnippet, insertText, labelDetails }; + } + function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences) { + const declarations = symbol.getDeclarations(); + if (!(declarations && declarations.length)) { + return void 0; + } + const checker = program.getTypeChecker(); + const declaration = declarations[0]; + const name2 = getSynthesizedDeepClone( + getNameOfDeclaration(declaration), + /*includeTrivia*/ + false + ); + const type3 = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); + const quotePreference = getQuotePreference(sourceFile, preferences); + const builderFlags = 33554432 | (quotePreference === 0 ? 268435456 : 0); + switch (declaration.kind) { + case 171: + case 172: + case 173: + case 174: { + let effectiveType = type3.flags & 1048576 && type3.types.length < 10 ? checker.getUnionType( + type3.types, + 2 + /* Subtype */ + ) : type3; + if (effectiveType.flags & 1048576) { + const functionTypes = filter2(effectiveType.types, (type22) => checker.getSignaturesOfType( + type22, + 0 + /* Call */ + ).length > 0); + if (functionTypes.length === 1) { + effectiveType = functionTypes[0]; + } else { + return void 0; + } + } + const signatures = checker.getSignaturesOfType( + effectiveType, + 0 + /* Call */ + ); + if (signatures.length !== 1) { + return void 0; + } + const typeNode = checker.typeToTypeNode(effectiveType, enclosingDeclaration, builderFlags, ts_codefix_exports.getNoopSymbolTrackerWithResolver({ program, host })); + if (!typeNode || !isFunctionTypeNode(typeNode)) { + return void 0; + } + let body; + if (preferences.includeCompletionsWithSnippetText) { + const emptyStmt = factory.createEmptyStatement(); + body = factory.createBlock( + [emptyStmt], + /*multiLine*/ + true + ); + setSnippetElement(emptyStmt, { kind: 0, order: 0 }); + } else { + body = factory.createBlock( + [], + /*multiLine*/ + true + ); + } + const parameters = typeNode.parameters.map( + (typedParam) => factory.createParameterDeclaration( + /*modifiers*/ + void 0, + typedParam.dotDotDotToken, + typedParam.name, + /*questionToken*/ + void 0, + /*type*/ + void 0, + typedParam.initializer + ) + ); + return factory.createMethodDeclaration( + /*modifiers*/ + void 0, + /*asteriskToken*/ + void 0, + name2, + /*questionToken*/ + void 0, + /*typeParameters*/ + void 0, + parameters, + /*type*/ + void 0, + body + ); + } + default: + return void 0; + } + } + function createSnippetPrinter(printerOptions) { + let escapes; + const baseWriter = ts_textChanges_exports.createWriter(getNewLineCharacter(printerOptions)); + const printer = createPrinter(printerOptions, baseWriter); + const writer = { + ...baseWriter, + write: (s7) => escapingWrite(s7, () => baseWriter.write(s7)), + nonEscapingWrite: baseWriter.write, + writeLiteral: (s7) => escapingWrite(s7, () => baseWriter.writeLiteral(s7)), + writeStringLiteral: (s7) => escapingWrite(s7, () => baseWriter.writeStringLiteral(s7)), + writeSymbol: (s7, symbol) => escapingWrite(s7, () => baseWriter.writeSymbol(s7, symbol)), + writeParameter: (s7) => escapingWrite(s7, () => baseWriter.writeParameter(s7)), + writeComment: (s7) => escapingWrite(s7, () => baseWriter.writeComment(s7)), + writeProperty: (s7) => escapingWrite(s7, () => baseWriter.writeProperty(s7)) + }; + return { + printSnippetList, + printAndFormatSnippetList, + printNode, + printAndFormatNode + }; + function escapingWrite(s7, write) { + const escaped = escapeSnippetText(s7); + if (escaped !== s7) { + const start = baseWriter.getTextPos(); + write(); + const end = baseWriter.getTextPos(); + escapes = append(escapes || (escapes = []), { newText: escaped, span: { start, length: end - start } }); + } else { + write(); + } + } + function printSnippetList(format5, list, sourceFile) { + const unescaped = printUnescapedSnippetList(format5, list, sourceFile); + return escapes ? ts_textChanges_exports.applyChanges(unescaped, escapes) : unescaped; + } + function printUnescapedSnippetList(format5, list, sourceFile) { + escapes = void 0; + writer.clear(); + printer.writeList(format5, list, sourceFile, writer); + return writer.getText(); + } + function printAndFormatSnippetList(format5, list, sourceFile, formatContext) { + const syntheticFile = { + text: printUnescapedSnippetList( + format5, + list, + sourceFile + ), + getLineAndCharacterOfPosition(pos) { + return getLineAndCharacterOfPosition(this, pos); + } + }; + const formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile); + const changes = flatMap2(list, (node) => { + const nodeWithPos = ts_textChanges_exports.assignPositionsToNode(node); + return ts_formatting_exports.formatNodeGivenIndentation( + nodeWithPos, + syntheticFile, + sourceFile.languageVariant, + /* indentation */ + 0, + /* delta */ + 0, + { ...formatContext, options: formatOptions } + ); + }); + const allChanges = escapes ? stableSort(concatenate(changes, escapes), (a7, b8) => compareTextSpans(a7.span, b8.span)) : changes; + return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges); + } + function printNode(hint, node, sourceFile) { + const unescaped = printUnescapedNode(hint, node, sourceFile); + return escapes ? ts_textChanges_exports.applyChanges(unescaped, escapes) : unescaped; + } + function printUnescapedNode(hint, node, sourceFile) { + escapes = void 0; + writer.clear(); + printer.writeNode(hint, node, sourceFile, writer); + return writer.getText(); + } + function printAndFormatNode(hint, node, sourceFile, formatContext) { + const syntheticFile = { + text: printUnescapedNode( + hint, + node, + sourceFile + ), + getLineAndCharacterOfPosition(pos) { + return getLineAndCharacterOfPosition(this, pos); + } + }; + const formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile); + const nodeWithPos = ts_textChanges_exports.assignPositionsToNode(node); + const changes = ts_formatting_exports.formatNodeGivenIndentation( + nodeWithPos, + syntheticFile, + sourceFile.languageVariant, + /* indentation */ + 0, + /* delta */ + 0, + { ...formatContext, options: formatOptions } + ); + const allChanges = escapes ? stableSort(concatenate(changes, escapes), (a7, b8) => compareTextSpans(a7.span, b8.span)) : changes; + return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges); + } + } + function originToCompletionEntryData(origin) { + const ambientModuleName = origin.fileName ? void 0 : stripQuotes(origin.moduleSymbol.name); + const isPackageJsonImport = origin.isFromPackageJson ? true : void 0; + if (originIsResolvedExport(origin)) { + const resolvedData = { + exportName: origin.exportName, + exportMapKey: origin.exportMapKey, + moduleSpecifier: origin.moduleSpecifier, + ambientModuleName, + fileName: origin.fileName, + isPackageJsonImport + }; + return resolvedData; + } + const unresolvedData = { + exportName: origin.exportName, + exportMapKey: origin.exportMapKey, + fileName: origin.fileName, + ambientModuleName: origin.fileName ? void 0 : stripQuotes(origin.moduleSymbol.name), + isPackageJsonImport: origin.isFromPackageJson ? true : void 0 + }; + return unresolvedData; + } + function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbol) { + const isDefaultExport = data.exportName === "default"; + const isFromPackageJson = !!data.isPackageJsonImport; + if (completionEntryDataIsResolved(data)) { + const resolvedOrigin = { + kind: 32, + exportName: data.exportName, + exportMapKey: data.exportMapKey, + moduleSpecifier: data.moduleSpecifier, + symbolName: completionName, + fileName: data.fileName, + moduleSymbol, + isDefaultExport, + isFromPackageJson + }; + return resolvedOrigin; + } + const unresolvedOrigin = { + kind: 4, + exportName: data.exportName, + exportMapKey: data.exportMapKey, + symbolName: completionName, + fileName: data.fileName, + moduleSymbol, + isDefaultExport, + isFromPackageJson + }; + return unresolvedOrigin; + } + function getInsertTextAndReplacementSpanForImportCompletion(name2, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) { + const replacementSpan = importStatementCompletion.replacementSpan; + const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier)); + const exportKind = origin.isDefaultExport ? 1 : origin.exportName === "export=" ? 2 : 0; + const tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : ""; + const importKind = ts_codefix_exports.getImportKind( + sourceFile, + exportKind, + options, + /*forceImportKeyword*/ + true + ); + const isImportSpecifierTypeOnly = importStatementCompletion.couldBeTypeOnlyImportSpecifier; + const topLevelTypeOnlyText = importStatementCompletion.isTopLevelTypeOnly ? ` ${tokenToString( + 156 + /* TypeKeyword */ + )} ` : " "; + const importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? `${tokenToString( + 156 + /* TypeKeyword */ + )} ` : ""; + const suffix = useSemicolons ? ";" : ""; + switch (importKind) { + case 3: + return { replacementSpan, insertText: `import${topLevelTypeOnlyText}${escapeSnippetText(name2)}${tabStop} = require(${quotedModuleSpecifier})${suffix}` }; + case 1: + return { replacementSpan, insertText: `import${topLevelTypeOnlyText}${escapeSnippetText(name2)}${tabStop} from ${quotedModuleSpecifier}${suffix}` }; + case 2: + return { replacementSpan, insertText: `import${topLevelTypeOnlyText}* as ${escapeSnippetText(name2)} from ${quotedModuleSpecifier}${suffix}` }; + case 0: + return { replacementSpan, insertText: `import${topLevelTypeOnlyText}{ ${importSpecifierTypeOnlyText}${escapeSnippetText(name2)}${tabStop} } from ${quotedModuleSpecifier}${suffix}` }; + } + } + function quotePropertyName(sourceFile, preferences, name2) { + if (/^\d+$/.test(name2)) { + return name2; + } + return quote(sourceFile, preferences, name2); + } + function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { + return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; + } + function getSourceFromOrigin(origin) { + if (originIsExport(origin)) { + return stripQuotes(origin.moduleSymbol.name); + } + if (originIsResolvedExport(origin)) { + return origin.moduleSpecifier; + } + if ((origin == null ? void 0 : origin.kind) === 1) { + return "ThisProperty/"; + } + if ((origin == null ? void 0 : origin.kind) === 64) { + return "TypeOnlyAlias/"; + } + } + function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location2, position, sourceFile, host, program, target, log3, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) { + const start = timestamp3(); + const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken, location2); + const useSemicolons = probablyUsesSemicolons(sourceFile); + const typeChecker = program.getTypeChecker(); + const uniques = /* @__PURE__ */ new Map(); + for (let i7 = 0; i7 < symbols.length; i7++) { + const symbol = symbols[i7]; + const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i7]; + const info2 = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected); + if (!info2 || uniques.get(info2.name) && (!origin || !originIsObjectLiteralMethod(origin)) || kind === 1 && symbolToSortTextMap && !shouldIncludeSymbol(symbol, symbolToSortTextMap)) { + continue; + } + if (!isTypeOnlyLocation && isInJSFile(sourceFile) && symbolAppearsToBeTypeOnly(symbol)) { + continue; + } + const { name: name2, needsConvertPropertyAccess } = info2; + const originalSortText = (symbolToSortTextMap == null ? void 0 : symbolToSortTextMap[getSymbolId(symbol)]) ?? SortText.LocationPriority; + const sortText = isDeprecated(symbol, typeChecker) ? SortText.Deprecated(originalSortText) : originalSortText; + const entry = createCompletionEntry( + symbol, + sortText, + replacementToken, + contextToken, + location2, + position, + sourceFile, + host, + program, + name2, + needsConvertPropertyAccess, + origin, + recommendedCompletion, + propertyAccessToConvert, + isJsxInitializer, + importStatementCompletion, + useSemicolons, + compilerOptions, + preferences, + kind, + formatContext, + isJsxIdentifierExpected, + isRightOfOpenTag, + includeSymbol + ); + if (!entry) { + continue; + } + const shouldShadowLaterSymbols = (!origin || originIsTypeOnlyAlias(origin)) && !(symbol.parent === void 0 && !some2(symbol.declarations, (d7) => d7.getSourceFile() === location2.getSourceFile())); + uniques.set(name2, shouldShadowLaterSymbols); + insertSorted( + entries, + entry, + compareCompletionEntries, + /*allowDuplicates*/ + true + ); + } + log3("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (timestamp3() - start)); + return { + has: (name2) => uniques.has(name2), + add: (name2) => uniques.set(name2, true) + }; + function shouldIncludeSymbol(symbol, symbolToSortTextMap2) { + var _a2; + let allFlags = symbol.flags; + if (!isSourceFile(location2)) { + if (isExportAssignment(location2.parent)) { + return true; + } + if (tryCast(variableOrParameterDeclaration, isVariableDeclaration) && symbol.valueDeclaration === variableOrParameterDeclaration) { + return false; + } + const symbolDeclaration = symbol.valueDeclaration ?? ((_a2 = symbol.declarations) == null ? void 0 : _a2[0]); + if (variableOrParameterDeclaration && symbolDeclaration && (isTypeParameterDeclaration(variableOrParameterDeclaration) && isTypeParameterDeclaration(symbolDeclaration) || isParameter(variableOrParameterDeclaration) && isParameter(symbolDeclaration))) { + const symbolDeclarationPos = symbolDeclaration.pos; + const parameters = isParameter(variableOrParameterDeclaration) ? variableOrParameterDeclaration.parent.parameters : isInferTypeNode(variableOrParameterDeclaration.parent) ? void 0 : variableOrParameterDeclaration.parent.typeParameters; + if (symbolDeclarationPos >= variableOrParameterDeclaration.pos && parameters && symbolDeclarationPos < parameters.end) { + return false; + } + } + const symbolOrigin = skipAlias(symbol, typeChecker); + if (!!sourceFile.externalModuleIndicator && !compilerOptions.allowUmdGlobalAccess && symbolToSortTextMap2[getSymbolId(symbol)] === SortText.GlobalsOrKeywords && (symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.AutoImportSuggestions || symbolToSortTextMap2[getSymbolId(symbolOrigin)] === SortText.LocationPriority)) { + return false; + } + allFlags |= getCombinedLocalAndExportSymbolFlags(symbolOrigin); + if (isInRightSideOfInternalImportEqualsDeclaration(location2)) { + return !!(allFlags & 1920); + } + if (isTypeOnlyLocation) { + return symbolCanBeReferencedAtTypeLocation(symbol, typeChecker); + } + } + return !!(allFlags & 111551); + } + function symbolAppearsToBeTypeOnly(symbol) { + var _a2; + const flags = getCombinedLocalAndExportSymbolFlags(skipAlias(symbol, typeChecker)); + return !(flags & 111551) && (!isInJSFile((_a2 = symbol.declarations) == null ? void 0 : _a2[0]) || !!(flags & 788968)); + } + } + function getLabelCompletionAtPosition(node) { + const entries = getLabelStatementCompletions(node); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries }; + } + } + function getLabelStatementCompletions(node) { + const entries = []; + const uniques = /* @__PURE__ */ new Map(); + let current = node; + while (current) { + if (isFunctionLike(current)) { + break; + } + if (isLabeledStatement(current)) { + const name2 = current.label.text; + if (!uniques.has(name2)) { + uniques.set(name2, true); + entries.push({ + name: name2, + kindModifiers: "", + kind: "label", + sortText: SortText.LocationPriority + }); + } + } + current = current.parent; + } + return entries; + } + function getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences) { + if (entryId.source === "SwitchCases/") { + return { type: "cases" }; + } + if (entryId.data) { + const autoImport = getAutoImportSymbolFromCompletionEntryData(entryId.name, entryId.data, program, host); + if (autoImport) { + const { contextToken: contextToken2, previousToken: previousToken2 } = getRelevantTokens(position, sourceFile); + return { + type: "symbol", + symbol: autoImport.symbol, + location: getTouchingPropertyName(sourceFile, position), + previousToken: previousToken2, + contextToken: contextToken2, + isJsxInitializer: false, + isTypeOnlyLocation: false, + origin: autoImport.origin + }; + } + } + const compilerOptions = program.getCompilerOptions(); + const completionData = getCompletionData( + program, + log3, + sourceFile, + compilerOptions, + position, + { includeCompletionsForModuleExports: true, includeCompletionsWithInsertText: true }, + entryId, + host, + /*formatContext*/ + void 0 + ); + if (!completionData) { + return { type: "none" }; + } + if (completionData.kind !== 0) { + return { type: "request", request: completionData }; + } + const { symbols, literals, location: location2, completionKind, symbolToOriginInfoMap, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } = completionData; + const literal = find2(literals, (l7) => completionNameForLiteral(sourceFile, preferences, l7) === entryId.name); + if (literal !== void 0) + return { type: "literal", literal }; + return firstDefined(symbols, (symbol, index4) => { + const origin = symbolToOriginInfoMap[index4]; + const info2 = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected); + return info2 && info2.name === entryId.name && (entryId.source === "ClassMemberSnippet/" && symbol.flags & 106500 || entryId.source === "ObjectLiteralMethodSnippet/" && symbol.flags & (4 | 8192) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/") ? { type: "symbol", symbol, location: location2, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0; + }) || { type: "none" }; + } + function getCompletionEntryDetails(program, log3, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) { + const typeChecker = program.getTypeChecker(); + const compilerOptions = program.getCompilerOptions(); + const { name: name2, source, data } = entryId; + const { previousToken, contextToken } = getRelevantTokens(position, sourceFile); + if (isInString(sourceFile, position, previousToken)) { + return ts_Completions_StringCompletions_exports.getStringLiteralCompletionDetails(name2, sourceFile, position, previousToken, program, host, cancellationToken, preferences); + } + const symbolCompletion = getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences); + switch (symbolCompletion.type) { + case "request": { + const { request: request3 } = symbolCompletion; + switch (request3.kind) { + case 1: + return ts_JsDoc_exports.getJSDocTagNameCompletionDetails(name2); + case 2: + return ts_JsDoc_exports.getJSDocTagCompletionDetails(name2); + case 3: + return ts_JsDoc_exports.getJSDocParameterNameCompletionDetails(name2); + case 4: + return some2(request3.keywordCompletions, (c7) => c7.name === name2) ? createSimpleDetails( + name2, + "keyword", + 5 + /* keyword */ + ) : void 0; + default: + return Debug.assertNever(request3); + } + } + case "symbol": { + const { symbol, location: location2, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion; + const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name2, location2, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken); + const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name; + return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location2, cancellationToken, codeActions, sourceDisplay); + } + case "literal": { + const { literal } = symbolCompletion; + return createSimpleDetails( + completionNameForLiteral(sourceFile, preferences, literal), + "string", + typeof literal === "string" ? 8 : 7 + /* numericLiteral */ + ); + } + case "cases": { + const snippets = getExhaustiveCaseSnippets( + contextToken.parent, + sourceFile, + preferences, + program.getCompilerOptions(), + host, + program, + /*formatContext*/ + void 0 + ); + if (snippets == null ? void 0 : snippets.importAdder.hasFixes()) { + const { entry, importAdder } = snippets; + const changes = ts_textChanges_exports.ChangeTracker.with( + { host, formatContext, preferences }, + importAdder.writeFixes + ); + return { + name: entry.name, + kind: "", + kindModifiers: "", + displayParts: [], + sourceDisplay: void 0, + codeActions: [{ + changes, + description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name2]) + }] + }; + } + return { + name: name2, + kind: "", + kindModifiers: "", + displayParts: [], + sourceDisplay: void 0 + }; + } + case "none": + return allKeywordsCompletions().some((c7) => c7.name === name2) ? createSimpleDetails( + name2, + "keyword", + 5 + /* keyword */ + ) : void 0; + default: + Debug.assertNever(symbolCompletion); + } + } + function createSimpleDetails(name2, kind, kind2) { + return createCompletionDetails(name2, "", kind, [displayPart(name2, kind2)]); + } + function createCompletionDetailsForSymbol(symbol, name2, checker, sourceFile, location2, cancellationToken, codeActions, sourceDisplay) { + const { displayParts, documentation, symbolKind, tags: tags6 } = checker.runWithCancellationToken(cancellationToken, (checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( + checker2, + symbol, + sourceFile, + location2, + location2, + 7 + /* All */ + )); + return createCompletionDetails(name2, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags6, codeActions, sourceDisplay); + } + function createCompletionDetails(name2, kindModifiers, kind, displayParts, documentation, tags6, codeActions, source) { + return { name: name2, kindModifiers, kind, displayParts, documentation, tags: tags6, codeActions, source, sourceDisplay: source }; + } + function getCompletionEntryCodeActionsAndSourceDisplay(name2, location2, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) { + if (data == null ? void 0 : data.moduleSpecifier) { + if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) { + return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] }; + } + } + if (source === "ClassMemberSnippet/") { + const { importAdder, eraseRange } = getEntryForMemberCompletion( + host, + program, + compilerOptions, + preferences, + name2, + symbol, + location2, + position, + contextToken, + formatContext + ); + if (importAdder || eraseRange) { + const changes = ts_textChanges_exports.ChangeTracker.with( + { host, formatContext, preferences }, + (tracker) => { + if (importAdder) { + importAdder.writeFixes(tracker); + } + if (eraseRange) { + tracker.deleteRange(sourceFile, eraseRange); + } + } + ); + return { + sourceDisplay: void 0, + codeActions: [{ + changes, + description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name2]) + }] + }; + } + } + if (originIsTypeOnlyAlias(origin)) { + const codeAction2 = ts_codefix_exports.getPromoteTypeOnlyCompletionAction( + sourceFile, + origin.declaration.name, + program, + host, + formatContext, + preferences + ); + Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias"); + return { codeActions: [codeAction2], sourceDisplay: void 0 }; + } + if (source === "ObjectLiteralMemberWithComma/" && contextToken) { + const changes = ts_textChanges_exports.ChangeTracker.with( + { host, formatContext, preferences }, + (tracker) => tracker.insertText(sourceFile, contextToken.end, ",") + ); + if (changes) { + return { + sourceDisplay: void 0, + codeActions: [{ + changes, + description: diagnosticToString([Diagnostics.Add_missing_comma_for_object_member_completion_0, name2]) + }] + }; + } + } + if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) { + return { codeActions: void 0, sourceDisplay: void 0 }; + } + const checker = origin.isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker(); + const { moduleSymbol } = origin; + const targetSymbol = checker.getMergedSymbol(skipAlias(symbol.exportSymbol || symbol, checker)); + const isJsxOpeningTagName = (contextToken == null ? void 0 : contextToken.kind) === 30 && isJsxOpeningLikeElement(contextToken.parent); + const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction( + targetSymbol, + moduleSymbol, + data == null ? void 0 : data.exportMapKey, + sourceFile, + name2, + isJsxOpeningTagName, + host, + program, + formatContext, + previousToken && isIdentifier(previousToken) ? previousToken.getStart(sourceFile) : position, + preferences, + cancellationToken + ); + Debug.assert(!(data == null ? void 0 : data.moduleSpecifier) || moduleSpecifier === data.moduleSpecifier); + return { sourceDisplay: [textPart(moduleSpecifier)], codeActions: [codeAction] }; + } + function getCompletionEntrySymbol(program, log3, sourceFile, position, entryId, host, preferences) { + const completion = getSymbolCompletionFromEntryId(program, log3, sourceFile, position, entryId, host, preferences); + return completion.type === "symbol" ? completion.symbol : void 0; + } + function getRecommendedCompletion(previousToken, contextualType, checker) { + return firstDefined(contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), (type3) => { + const symbol = type3 && type3.symbol; + return symbol && (symbol.flags & (8 | 384 | 32) && !isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, previousToken, checker) : void 0; + }); + } + function getContextualType(previousToken, position, sourceFile, checker) { + const { parent: parent22 } = previousToken; + switch (previousToken.kind) { + case 80: + return getContextualTypeFromParent(previousToken, checker); + case 64: + switch (parent22.kind) { + case 260: + return checker.getContextualType(parent22.initializer); + case 226: + return checker.getTypeAtLocation(parent22.left); + case 291: + return checker.getContextualTypeForJsxAttribute(parent22); + default: + return void 0; + } + case 105: + return checker.getContextualType(parent22); + case 84: + const caseClause = tryCast(parent22, isCaseClause); + return caseClause ? getSwitchedType(caseClause, checker) : void 0; + case 19: + return isJsxExpression(parent22) && !isJsxElement(parent22.parent) && !isJsxFragment(parent22.parent) ? checker.getContextualTypeForJsxAttribute(parent22.parent) : void 0; + default: + const argInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(previousToken, position, sourceFile, checker); + return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent22) && isEqualityOperatorKind(parent22.operatorToken.kind) ? ( + // completion at `x ===/**/` should be for the right side + checker.getTypeAtLocation(parent22.left) + ) : checker.getContextualType( + previousToken, + 4 + /* Completions */ + ) || checker.getContextualType(previousToken); + } + } + function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { + const chain3 = checker.getAccessibleSymbolChain( + symbol, + enclosingDeclaration, + /*meaning*/ + -1, + /*useOnlyExternalAliasing*/ + false + ); + if (chain3) + return first(chain3); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); + } + function isModuleSymbol(symbol) { + var _a2; + return !!((_a2 = symbol.declarations) == null ? void 0 : _a2.some( + (d7) => d7.kind === 312 + /* SourceFile */ + )); + } + function getCompletionData(program, log3, sourceFile, compilerOptions, position, preferences, detailsEntryId, host, formatContext, cancellationToken) { + const typeChecker = program.getTypeChecker(); + const inCheckedFile = isCheckedFile(sourceFile, compilerOptions); + let start = timestamp3(); + let currentToken = getTokenAtPosition(sourceFile, position); + log3("getCompletionData: Get current token: " + (timestamp3() - start)); + start = timestamp3(); + const insideComment = isInComment(sourceFile, position, currentToken); + log3("getCompletionData: Is inside comment: " + (timestamp3() - start)); + let insideJsDocTagTypeExpression = false; + let isInSnippetScope = false; + if (insideComment) { + if (hasDocComment(sourceFile, position)) { + if (sourceFile.text.charCodeAt(position - 1) === 64) { + return { + kind: 1 + /* JsDocTagName */ + }; + } else { + const lineStart = getLineStartPositionForPosition(position, sourceFile); + if (!/[^*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { + return { + kind: 2 + /* JsDocTag */ + }; + } + } + } + const tag = getJsDocTagAtPosition(currentToken, position); + if (tag) { + if (tag.tagName.pos <= position && position <= tag.tagName.end) { + return { + kind: 1 + /* JsDocTagName */ + }; + } + const typeExpression = tryGetTypeExpressionFromTag(tag); + if (typeExpression) { + currentToken = getTokenAtPosition(sourceFile, position); + if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 || currentToken.parent.name !== currentToken)) { + insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression); + } + } + if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { + return { kind: 3, tag }; + } + } + if (!insideJsDocTagTypeExpression) { + log3("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment."); + return void 0; + } + } + start = timestamp3(); + const isJsOnlyLocation = !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile); + const tokens = getRelevantTokens(position, sourceFile); + const previousToken = tokens.previousToken; + let contextToken = tokens.contextToken; + log3("getCompletionData: Get previous token: " + (timestamp3() - start)); + let node = currentToken; + let propertyAccessToConvert; + let isRightOfDot = false; + let isRightOfQuestionDot = false; + let isRightOfOpenTag = false; + let isStartingCloseTag = false; + let isJsxInitializer = false; + let isJsxIdentifierExpected = false; + let importStatementCompletion; + let location2 = getTouchingPropertyName(sourceFile, position); + let keywordFilters = 0; + let isNewIdentifierLocation = false; + let flags = 0; + if (contextToken) { + const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile); + if (importStatementCompletionInfo.keywordCompletion) { + if (importStatementCompletionInfo.isKeywordOnlyCompletion) { + return { + kind: 4, + keywordCompletions: [keywordToCompletionEntry(importStatementCompletionInfo.keywordCompletion)], + isNewIdentifierLocation: importStatementCompletionInfo.isNewIdentifierLocation + }; + } + keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletionInfo.keywordCompletion); + } + if (importStatementCompletionInfo.replacementSpan && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) { + flags |= 2; + importStatementCompletion = importStatementCompletionInfo; + isNewIdentifierLocation = importStatementCompletionInfo.isNewIdentifierLocation; + } + if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) { + log3("Returning an empty list because completion was requested in an invalid position."); + return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierDefinitionLocation()) : void 0; + } + let parent22 = contextToken.parent; + if (contextToken.kind === 25 || contextToken.kind === 29) { + isRightOfDot = contextToken.kind === 25; + isRightOfQuestionDot = contextToken.kind === 29; + switch (parent22.kind) { + case 211: + propertyAccessToConvert = parent22; + node = propertyAccessToConvert.expression; + const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert); + if (nodeIsMissing(leftmostAccessExpression) || (isCallExpression(node) || isFunctionLike(node)) && node.end === contextToken.pos && node.getChildCount(sourceFile) && last2(node.getChildren(sourceFile)).kind !== 22) { + return void 0; + } + break; + case 166: + node = parent22.left; + break; + case 267: + node = parent22.name; + break; + case 205: + node = parent22; + break; + case 236: + node = parent22.getFirstToken(sourceFile); + Debug.assert( + node.kind === 102 || node.kind === 105 + /* NewKeyword */ + ); + break; + default: + return void 0; + } + } else if (!importStatementCompletion) { + if (parent22 && parent22.kind === 211) { + contextToken = parent22; + parent22 = parent22.parent; + } + if (currentToken.parent === location2) { + switch (currentToken.kind) { + case 32: + if (currentToken.parent.kind === 284 || currentToken.parent.kind === 286) { + location2 = currentToken; + } + break; + case 44: + if (currentToken.parent.kind === 285) { + location2 = currentToken; + } + break; + } + } + switch (parent22.kind) { + case 287: + if (contextToken.kind === 44) { + isStartingCloseTag = true; + location2 = contextToken; + } + break; + case 226: + if (!binaryExpressionMayBeOpenTag(parent22)) { + break; + } + case 285: + case 284: + case 286: + isJsxIdentifierExpected = true; + if (contextToken.kind === 30) { + isRightOfOpenTag = true; + location2 = contextToken; + } + break; + case 294: + case 293: + if (previousToken.kind === 20 || previousToken.kind === 80 && previousToken.parent.kind === 291) { + isJsxIdentifierExpected = true; + } + break; + case 291: + if (parent22.initializer === previousToken && previousToken.end < position) { + isJsxIdentifierExpected = true; + break; + } + switch (previousToken.kind) { + case 64: + isJsxInitializer = true; + break; + case 80: + isJsxIdentifierExpected = true; + if (parent22 !== previousToken.parent && !parent22.initializer && findChildOfKind(parent22, 64, sourceFile)) { + isJsxInitializer = previousToken; + } + } + break; + } + } + } + const semanticStart = timestamp3(); + let completionKind = 5; + let hasUnresolvedAutoImports = false; + let symbols = []; + let importSpecifierResolver; + const symbolToOriginInfoMap = []; + const symbolToSortTextMap = []; + const seenPropertySymbols = /* @__PURE__ */ new Map(); + const isTypeOnlyLocation = isTypeOnlyCompletion(); + const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => { + return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); + }); + if (isRightOfDot || isRightOfQuestionDot) { + getTypeScriptMemberSymbols(); + } else if (isRightOfOpenTag) { + symbols = typeChecker.getJsxIntrinsicTagNamesAt(location2); + Debug.assertEachIsDefined(symbols, "getJsxIntrinsicTagNames() should all be defined"); + tryGetGlobalSymbols(); + completionKind = 1; + keywordFilters = 0; + } else if (isStartingCloseTag) { + const tagName = contextToken.parent.parent.openingElement.tagName; + const tagSymbol = typeChecker.getSymbolAtLocation(tagName); + if (tagSymbol) { + symbols = [tagSymbol]; + } + completionKind = 1; + keywordFilters = 0; + } else { + if (!tryGetGlobalSymbols()) { + return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierLocation) : void 0; + } + } + log3("getCompletionData: Semantic work: " + (timestamp3() - semanticStart)); + const contextualType = previousToken && getContextualType(previousToken, position, sourceFile, typeChecker); + const isLiteralExpected = !tryCast(previousToken, isStringLiteralLike) && !isJsxIdentifierExpected; + const literals = !isLiteralExpected ? [] : mapDefined( + contextualType && (contextualType.isUnion() ? contextualType.types : [contextualType]), + (t8) => t8.isLiteral() && !(t8.flags & 1024) ? t8.value : void 0 + ); + const recommendedCompletion = previousToken && contextualType && getRecommendedCompletion(previousToken, contextualType, typeChecker); + return { + kind: 0, + symbols, + completionKind, + isInSnippetScope, + propertyAccessToConvert, + isNewIdentifierLocation, + location: location2, + keywordFilters, + literals, + symbolToOriginInfoMap, + recommendedCompletion, + previousToken, + contextToken, + isJsxInitializer, + insideJsDocTagTypeExpression, + symbolToSortTextMap, + isTypeOnlyLocation, + isJsxIdentifierExpected, + isRightOfOpenTag, + isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot, + importStatementCompletion, + hasUnresolvedAutoImports, + flags + }; + function isTagWithTypeExpression(tag) { + switch (tag.kind) { + case 348: + case 355: + case 349: + case 351: + case 353: + case 356: + case 357: + return true; + case 352: + return !!tag.constraint; + default: + return false; + } + } + function tryGetTypeExpressionFromTag(tag) { + if (isTagWithTypeExpression(tag)) { + const typeExpression = isJSDocTemplateTag(tag) ? tag.constraint : tag.typeExpression; + return typeExpression && typeExpression.kind === 316 ? typeExpression : void 0; + } + if (isJSDocAugmentsTag(tag) || isJSDocImplementsTag(tag)) { + return tag.class; + } + return void 0; + } + function getTypeScriptMemberSymbols() { + completionKind = 2; + const isImportType = isLiteralImportTypeNode(node); + const isTypeLocation = isImportType && !node.isTypeOf || isPartOfTypeNode(node.parent) || isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker); + const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node); + if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) { + const isNamespaceName = isModuleDeclaration(node.parent); + if (isNamespaceName) + isNewIdentifierLocation = true; + let symbol = typeChecker.getSymbolAtLocation(node); + if (symbol) { + symbol = skipAlias(symbol, typeChecker); + if (symbol.flags & (1536 | 384)) { + const exportedSymbols = typeChecker.getExportsOfModule(symbol); + Debug.assertEachIsDefined(exportedSymbols, "getExportsOfModule() should all be defined"); + const isValidValueAccess = (symbol2) => typeChecker.isValidPropertyAccess(isImportType ? node : node.parent, symbol2.name); + const isValidTypeAccess = (symbol2) => symbolCanBeReferencedAtTypeLocation(symbol2, typeChecker); + const isValidAccess = isNamespaceName ? (symbol2) => { + var _a2; + return !!(symbol2.flags & 1920) && !((_a2 = symbol2.declarations) == null ? void 0 : _a2.every((d7) => d7.parent === node.parent)); + } : isRhsOfImportDeclaration ? ( + // Any kind is allowed when dotting off namespace in internal import equals declaration + (symbol2) => isValidTypeAccess(symbol2) || isValidValueAccess(symbol2) + ) : isTypeLocation || insideJsDocTagTypeExpression ? isValidTypeAccess : isValidValueAccess; + for (const exportedSymbol of exportedSymbols) { + if (isValidAccess(exportedSymbol)) { + symbols.push(exportedSymbol); + } + } + if (!isTypeLocation && !insideJsDocTagTypeExpression && symbol.declarations && symbol.declarations.some( + (d7) => d7.kind !== 312 && d7.kind !== 267 && d7.kind !== 266 + /* EnumDeclaration */ + )) { + let type3 = typeChecker.getTypeOfSymbolAtLocation(symbol, node).getNonOptionalType(); + let insertQuestionDot = false; + if (type3.isNullableType()) { + const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; + if (canCorrectToQuestionDot || isRightOfQuestionDot) { + type3 = type3.getNonNullableType(); + if (canCorrectToQuestionDot) { + insertQuestionDot = true; + } + } + } + addTypeProperties(type3, !!(node.flags & 65536), insertQuestionDot); + } + return; + } + } + } + if (!isTypeLocation || isInTypeQuery(node)) { + typeChecker.tryGetThisTypeAt( + node, + /*includeGlobalThis*/ + false + ); + let type3 = typeChecker.getTypeAtLocation(node).getNonOptionalType(); + if (!isTypeLocation) { + let insertQuestionDot = false; + if (type3.isNullableType()) { + const canCorrectToQuestionDot = isRightOfDot && !isRightOfQuestionDot && preferences.includeAutomaticOptionalChainCompletions !== false; + if (canCorrectToQuestionDot || isRightOfQuestionDot) { + type3 = type3.getNonNullableType(); + if (canCorrectToQuestionDot) { + insertQuestionDot = true; + } + } + } + addTypeProperties(type3, !!(node.flags & 65536), insertQuestionDot); + } else { + addTypeProperties( + type3.getNonNullableType(), + /*insertAwait*/ + false, + /*insertQuestionDot*/ + false + ); + } + } + } + function addTypeProperties(type3, insertAwait, insertQuestionDot) { + isNewIdentifierLocation = !!type3.getStringIndexType(); + if (isRightOfQuestionDot && some2(type3.getCallSignatures())) { + isNewIdentifierLocation = true; + } + const propertyAccess = node.kind === 205 ? node : node.parent; + if (inCheckedFile) { + for (const symbol of type3.getApparentProperties()) { + if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type3, symbol)) { + addPropertySymbol( + symbol, + /*insertAwait*/ + false, + insertQuestionDot + ); + } + } + } else { + symbols.push(...filter2(getPropertiesForCompletion(type3, typeChecker), (s7) => typeChecker.isValidPropertyAccessForCompletions(propertyAccess, type3, s7))); + } + if (insertAwait && preferences.includeCompletionsWithInsertText) { + const promiseType2 = typeChecker.getPromisedTypeOfPromise(type3); + if (promiseType2) { + for (const symbol of promiseType2.getApparentProperties()) { + if (typeChecker.isValidPropertyAccessForCompletions(propertyAccess, promiseType2, symbol)) { + addPropertySymbol( + symbol, + /*insertAwait*/ + true, + insertQuestionDot + ); + } + } + } + } + } + function addPropertySymbol(symbol, insertAwait, insertQuestionDot) { + var _a2; + const computedPropertyName = firstDefined(symbol.declarations, (decl) => tryCast(getNameOfDeclaration(decl), isComputedPropertyName)); + if (computedPropertyName) { + const leftMostName = getLeftMostName(computedPropertyName.expression); + const nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName); + const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker); + const firstAccessibleSymbolId = firstAccessibleSymbol && getSymbolId(firstAccessibleSymbol); + if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) { + const index4 = symbols.length; + symbols.push(firstAccessibleSymbol); + const moduleSymbol = firstAccessibleSymbol.parent; + if (!moduleSymbol || !isExternalModuleSymbol(moduleSymbol) || typeChecker.tryGetMemberInModuleExportsAndProperties(firstAccessibleSymbol.name, moduleSymbol) !== firstAccessibleSymbol) { + symbolToOriginInfoMap[index4] = { kind: getNullableSymbolOriginInfoKind( + 2 + /* SymbolMemberNoExport */ + ) }; + } else { + const fileName = isExternalModuleNameRelative(stripQuotes(moduleSymbol.name)) ? (_a2 = getSourceFileOfModule(moduleSymbol)) == null ? void 0 : _a2.fileName : void 0; + const { moduleSpecifier } = (importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences))).getModuleSpecifierForBestExportInfo( + [{ + exportKind: 0, + moduleFileName: fileName, + isFromPackageJson: false, + moduleSymbol, + symbol: firstAccessibleSymbol, + targetFlags: skipAlias(firstAccessibleSymbol, typeChecker).flags + }], + position, + isValidTypeOnlyAliasUseSite(location2) + ) || {}; + if (moduleSpecifier) { + const origin = { + kind: getNullableSymbolOriginInfoKind( + 6 + /* SymbolMemberExport */ + ), + moduleSymbol, + isDefaultExport: false, + symbolName: firstAccessibleSymbol.name, + exportName: firstAccessibleSymbol.name, + fileName, + moduleSpecifier + }; + symbolToOriginInfoMap[index4] = origin; + } + } + } else if (preferences.includeCompletionsWithInsertText) { + if (firstAccessibleSymbolId && seenPropertySymbols.has(firstAccessibleSymbolId)) { + return; + } + addSymbolOriginInfo(symbol); + addSymbolSortInfo(symbol); + symbols.push(symbol); + } + } else { + addSymbolOriginInfo(symbol); + addSymbolSortInfo(symbol); + symbols.push(symbol); + } + function addSymbolSortInfo(symbol2) { + if (isStaticProperty(symbol2)) { + symbolToSortTextMap[getSymbolId(symbol2)] = SortText.LocalDeclarationPriority; + } + } + function addSymbolOriginInfo(symbol2) { + if (preferences.includeCompletionsWithInsertText) { + if (insertAwait && addToSeen(seenPropertySymbols, getSymbolId(symbol2))) { + symbolToOriginInfoMap[symbols.length] = { kind: getNullableSymbolOriginInfoKind( + 8 + /* Promise */ + ) }; + } else if (insertQuestionDot) { + symbolToOriginInfoMap[symbols.length] = { + kind: 16 + /* Nullable */ + }; + } + } + } + function getNullableSymbolOriginInfoKind(kind) { + return insertQuestionDot ? kind | 16 : kind; + } + } + function getLeftMostName(e10) { + return isIdentifier(e10) ? e10 : isPropertyAccessExpression(e10) ? getLeftMostName(e10.expression) : void 0; + } + function tryGetGlobalSymbols() { + const result2 = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1); + return result2 === 1; + } + function tryGetConstructorCompletion() { + if (!tryGetConstructorLikeCompletionContainer(contextToken)) + return 0; + completionKind = 5; + isNewIdentifierLocation = true; + keywordFilters = 4; + return 1; + } + function tryGetJsxCompletionSymbols() { + const jsxContainer = tryGetContainingJsxElement(contextToken); + const attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes); + if (!attrsType) + return 0; + const completionsType = jsxContainer && typeChecker.getContextualType( + jsxContainer.attributes, + 4 + /* Completions */ + ); + symbols = concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties)); + setSortTextToOptionalMember(); + completionKind = 3; + isNewIdentifierLocation = false; + return 1; + } + function tryGetImportCompletionSymbols() { + if (!importStatementCompletion) + return 0; + isNewIdentifierLocation = true; + collectAutoImports(); + return 1; + } + function getGlobalCompletions() { + keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 : 1; + completionKind = 1; + isNewIdentifierLocation = isNewIdentifierDefinitionLocation(); + if (previousToken !== contextToken) { + Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); + } + const adjustedPosition = previousToken !== contextToken ? previousToken.getStart() : position; + const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; + isInSnippetScope = isSnippetScope(scopeNode); + const symbolMeanings = (isTypeOnlyLocation ? 0 : 111551) | 788968 | 1920 | 2097152; + const typeOnlyAliasNeedsPromotion = previousToken && !isValidTypeOnlyAliasUseSite(previousToken); + symbols = concatenate(symbols, typeChecker.getSymbolsInScope(scopeNode, symbolMeanings)); + Debug.assertEachIsDefined(symbols, "getSymbolsInScope() should all be defined"); + for (let i7 = 0; i7 < symbols.length; i7++) { + const symbol = symbols[i7]; + if (!typeChecker.isArgumentsSymbol(symbol) && !some2(symbol.declarations, (d7) => d7.getSourceFile() === sourceFile)) { + symbolToSortTextMap[getSymbolId(symbol)] = SortText.GlobalsOrKeywords; + } + if (typeOnlyAliasNeedsPromotion && !(symbol.flags & 111551)) { + const typeOnlyAliasDeclaration = symbol.declarations && find2(symbol.declarations, isTypeOnlyImportDeclaration); + if (typeOnlyAliasDeclaration) { + const origin = { kind: 64, declaration: typeOnlyAliasDeclaration }; + symbolToOriginInfoMap[i7] = origin; + } + } + } + if (preferences.includeCompletionsWithInsertText && scopeNode.kind !== 312) { + const thisType = typeChecker.tryGetThisTypeAt( + scopeNode, + /*includeGlobalThis*/ + false, + isClassLike(scopeNode.parent) ? scopeNode : void 0 + ); + if (thisType && !isProbablyGlobalType(thisType, sourceFile, typeChecker)) { + for (const symbol of getPropertiesForCompletion(thisType, typeChecker)) { + symbolToOriginInfoMap[symbols.length] = { + kind: 1 + /* ThisType */ + }; + symbols.push(symbol); + symbolToSortTextMap[getSymbolId(symbol)] = SortText.SuggestedClassMembers; + } + } + } + collectAutoImports(); + if (isTypeOnlyLocation) { + keywordFilters = contextToken && isAssertionExpression(contextToken.parent) ? 6 : 7; + } + } + function shouldOfferImportCompletions() { + if (importStatementCompletion) + return true; + if (!preferences.includeCompletionsForModuleExports) + return false; + if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator) + return true; + if (compilerOptionsIndicateEsModules(program.getCompilerOptions())) + return true; + return programContainsModules(program); + } + function isSnippetScope(scopeNode) { + switch (scopeNode.kind) { + case 312: + case 228: + case 294: + case 241: + return true; + default: + return isStatement(scopeNode); + } + } + function isTypeOnlyCompletion() { + return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location2.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location2) || isContextTokenTypeLocation(contextToken)); + } + function isContextTokenValueLocation(contextToken2) { + return contextToken2 && (contextToken2.kind === 114 && (contextToken2.parent.kind === 186 || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 && contextToken2.parent.kind === 182); + } + function isContextTokenTypeLocation(contextToken2) { + if (contextToken2) { + const parentKind = contextToken2.parent.kind; + switch (contextToken2.kind) { + case 59: + return parentKind === 172 || parentKind === 171 || parentKind === 169 || parentKind === 260 || isFunctionLikeKind(parentKind); + case 64: + return parentKind === 265 || parentKind === 168; + case 130: + return parentKind === 234; + case 30: + return parentKind === 183 || parentKind === 216; + case 96: + return parentKind === 168; + case 152: + return parentKind === 238; + } + } + return false; + } + function collectAutoImports() { + var _a2, _b; + if (!shouldOfferImportCompletions()) + return; + Debug.assert(!(detailsEntryId == null ? void 0 : detailsEntryId.data), "Should not run 'collectAutoImports' when faster path is available via `data`"); + if (detailsEntryId && !detailsEntryId.source) { + return; + } + flags |= 1; + const isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken && importStatementCompletion; + const lowerCaseTokenText = isAfterTypeOnlyImportSpecifierModifier ? "" : previousToken && isIdentifier(previousToken) ? previousToken.text.toLowerCase() : ""; + const moduleSpecifierCache = (_a2 = host.getModuleSpecifierCache) == null ? void 0 : _a2.call(host); + const exportInfo = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken); + const packageJsonAutoImportProvider = (_b = host.getPackageJsonAutoImportProvider) == null ? void 0 : _b.call(host); + const packageJsonFilter = detailsEntryId ? void 0 : createPackageJsonImportFilter(sourceFile, preferences, host); + resolvingModuleSpecifiers( + "collectAutoImports", + host, + importSpecifierResolver || (importSpecifierResolver = ts_codefix_exports.createImportSpecifierResolver(sourceFile, program, host, preferences)), + program, + position, + preferences, + !!importStatementCompletion, + isValidTypeOnlyAliasUseSite(location2), + (context2) => { + exportInfo.search( + sourceFile.path, + /*preferCapitalized*/ + isRightOfOpenTag, + (symbolName2, targetFlags) => { + if (!isIdentifierText(symbolName2, getEmitScriptTarget(host.getCompilationSettings()))) + return false; + if (!detailsEntryId && isStringANonContextualKeyword(symbolName2)) + return false; + if (!isTypeOnlyLocation && !importStatementCompletion && !(targetFlags & 111551)) + return false; + if (isTypeOnlyLocation && !(targetFlags & (1536 | 788968))) + return false; + const firstChar = symbolName2.charCodeAt(0); + if (isRightOfOpenTag && (firstChar < 65 || firstChar > 90)) + return false; + if (detailsEntryId) + return true; + return charactersFuzzyMatchInString(symbolName2, lowerCaseTokenText); + }, + (info2, symbolName2, isFromAmbientModule, exportMapKey) => { + if (detailsEntryId && !some2(info2, (i7) => detailsEntryId.source === stripQuotes(i7.moduleSymbol.name))) { + return; + } + info2 = filter2(info2, isImportableExportInfo); + if (!info2.length) { + return; + } + const result2 = context2.tryResolve(info2, isFromAmbientModule) || {}; + if (result2 === "failed") + return; + let exportInfo2 = info2[0], moduleSpecifier; + if (result2 !== "skipped") { + ({ exportInfo: exportInfo2 = info2[0], moduleSpecifier } = result2); + } + const isDefaultExport = exportInfo2.exportKind === 1; + const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol; + pushAutoImportSymbol(symbol, { + kind: moduleSpecifier ? 32 : 4, + moduleSpecifier, + symbolName: symbolName2, + exportMapKey, + exportName: exportInfo2.exportKind === 2 ? "export=" : exportInfo2.symbol.name, + fileName: exportInfo2.moduleFileName, + isDefaultExport, + moduleSymbol: exportInfo2.moduleSymbol, + isFromPackageJson: exportInfo2.isFromPackageJson + }); + } + ); + hasUnresolvedAutoImports = context2.skippedAny(); + flags |= context2.resolvedAny() ? 8 : 0; + flags |= context2.resolvedBeyondLimit() ? 16 : 0; + } + ); + function isImportableExportInfo(info2) { + const moduleFile = tryCast(info2.moduleSymbol.valueDeclaration, isSourceFile); + if (!moduleFile) { + const moduleName3 = stripQuotes(info2.moduleSymbol.name); + if (ts_JsTyping_exports.nodeCoreModules.has(moduleName3) && startsWith2(moduleName3, "node:") !== shouldUseUriStyleNodeCoreModules(sourceFile, program)) { + return false; + } + return packageJsonFilter ? packageJsonFilter.allowsImportingAmbientModule(info2.moduleSymbol, getModuleSpecifierResolutionHost(info2.isFromPackageJson)) : true; + } + return isImportableFile( + info2.isFromPackageJson ? packageJsonAutoImportProvider : program, + sourceFile, + moduleFile, + preferences, + packageJsonFilter, + getModuleSpecifierResolutionHost(info2.isFromPackageJson), + moduleSpecifierCache + ); + } + } + function pushAutoImportSymbol(symbol, origin) { + const symbolId = getSymbolId(symbol); + if (symbolToSortTextMap[symbolId] === SortText.GlobalsOrKeywords) { + return; + } + symbolToOriginInfoMap[symbols.length] = origin; + symbolToSortTextMap[symbolId] = importStatementCompletion ? SortText.LocationPriority : SortText.AutoImportSuggestions; + symbols.push(symbol); + } + function collectObjectLiteralMethodSymbols(members, enclosingDeclaration) { + if (isInJSFile(location2)) { + return; + } + members.forEach((member) => { + if (!isObjectLiteralMethodSymbol(member)) { + return; + } + const displayName = getCompletionEntryDisplayNameForSymbol( + member, + getEmitScriptTarget(compilerOptions), + /*origin*/ + void 0, + 0, + /*jsxIdentifierExpected*/ + false + ); + if (!displayName) { + return; + } + const { name: name2 } = displayName; + const entryProps = getEntryForObjectLiteralMethodCompletion( + member, + name2, + enclosingDeclaration, + program, + host, + compilerOptions, + preferences, + formatContext + ); + if (!entryProps) { + return; + } + const origin = { kind: 128, ...entryProps }; + flags |= 32; + symbolToOriginInfoMap[symbols.length] = origin; + symbols.push(member); + }); + } + function isObjectLiteralMethodSymbol(symbol) { + if (!(symbol.flags & (4 | 8192))) { + return false; + } + return true; + } + function getScopeNode(initialToken, position2, sourceFile2) { + let scope = initialToken; + while (scope && !positionBelongsToNode(scope, position2, sourceFile2)) { + scope = scope.parent; + } + return scope; + } + function isCompletionListBlocker(contextToken2) { + const start2 = timestamp3(); + const result2 = isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) || isSolelyIdentifierDefinitionLocation(contextToken2) || isDotOfNumericLiteral(contextToken2) || isInJsxText(contextToken2) || isBigIntLiteral(contextToken2); + log3("getCompletionsAtPosition: isCompletionListBlocker: " + (timestamp3() - start2)); + return result2; + } + function isInJsxText(contextToken2) { + if (contextToken2.kind === 12) { + return true; + } + if (contextToken2.kind === 32 && contextToken2.parent) { + if (location2 === contextToken2.parent && (location2.kind === 286 || location2.kind === 285)) { + return false; + } + if (contextToken2.parent.kind === 286) { + return location2.parent.kind !== 286; + } + if (contextToken2.parent.kind === 287 || contextToken2.parent.kind === 285) { + return !!contextToken2.parent.parent && contextToken2.parent.parent.kind === 284; + } + } + return false; + } + function isNewIdentifierDefinitionLocation() { + if (contextToken) { + const containingNodeKind = contextToken.parent.kind; + const tokenKind = keywordForNode(contextToken); + switch (tokenKind) { + case 28: + return containingNodeKind === 213 || containingNodeKind === 176 || containingNodeKind === 214 || containingNodeKind === 209 || containingNodeKind === 226 || containingNodeKind === 184 || containingNodeKind === 210; + case 21: + return containingNodeKind === 213 || containingNodeKind === 176 || containingNodeKind === 214 || containingNodeKind === 217 || containingNodeKind === 196; + case 23: + return containingNodeKind === 209 || containingNodeKind === 181 || containingNodeKind === 167; + case 144: + case 145: + case 102: + return true; + case 25: + return containingNodeKind === 267; + case 19: + return containingNodeKind === 263 || containingNodeKind === 210; + case 64: + return containingNodeKind === 260 || containingNodeKind === 226; + case 16: + return containingNodeKind === 228; + case 17: + return containingNodeKind === 239; + case 134: + return containingNodeKind === 174 || containingNodeKind === 304; + case 42: + return containingNodeKind === 174; + } + if (isClassMemberCompletionKeyword(tokenKind)) { + return true; + } + } + return false; + } + function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) { + return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2))); + } + function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() { + const typeLiteralNode = tryGetTypeLiteralNode(contextToken); + if (!typeLiteralNode) + return 0; + const intersectionTypeNode = isIntersectionTypeNode(typeLiteralNode.parent) ? typeLiteralNode.parent : void 0; + const containerTypeNode = intersectionTypeNode || typeLiteralNode; + const containerExpectedType = getConstraintOfTypeArgumentProperty(containerTypeNode, typeChecker); + if (!containerExpectedType) + return 0; + const containerActualType = typeChecker.getTypeFromTypeNode(containerTypeNode); + const members = getPropertiesForCompletion(containerExpectedType, typeChecker); + const existingMembers = getPropertiesForCompletion(containerActualType, typeChecker); + const existingMemberEscapedNames = /* @__PURE__ */ new Set(); + existingMembers.forEach((s7) => existingMemberEscapedNames.add(s7.escapedName)); + symbols = concatenate(symbols, filter2(members, (s7) => !existingMemberEscapedNames.has(s7.escapedName))); + completionKind = 0; + isNewIdentifierLocation = true; + return 1; + } + function tryGetObjectLikeCompletionSymbols() { + const symbolsStartIndex = symbols.length; + const objectLikeContainer = tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile); + if (!objectLikeContainer) + return 0; + completionKind = 0; + let typeMembers; + let existingMembers; + if (objectLikeContainer.kind === 210) { + const instantiatedType = tryGetObjectLiteralContextualType(objectLikeContainer, typeChecker); + if (instantiatedType === void 0) { + if (objectLikeContainer.flags & 67108864) { + return 2; + } + return 0; + } + const completionsType = typeChecker.getContextualType( + objectLikeContainer, + 4 + /* Completions */ + ); + const hasStringIndexType = (completionsType || instantiatedType).getStringIndexType(); + const hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType(); + isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype; + typeMembers = getPropertiesForObjectExpression(instantiatedType, completionsType, objectLikeContainer, typeChecker); + existingMembers = objectLikeContainer.properties; + if (typeMembers.length === 0) { + if (!hasNumberIndextype) { + return 0; + } + } + } else { + Debug.assert( + objectLikeContainer.kind === 206 + /* ObjectBindingPattern */ + ); + isNewIdentifierLocation = false; + const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); + if (!isVariableLike(rootDeclaration)) + return Debug.fail("Root declaration is not variable-like."); + let canGetType = hasInitializer(rootDeclaration) || !!getEffectiveTypeAnnotationNode(rootDeclaration) || rootDeclaration.parent.parent.kind === 250; + if (!canGetType && rootDeclaration.kind === 169) { + if (isExpression(rootDeclaration.parent)) { + canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); + } else if (rootDeclaration.parent.kind === 174 || rootDeclaration.parent.kind === 178) { + canGetType = isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); + } + } + if (canGetType) { + const typeForObject = typeChecker.getTypeAtLocation(objectLikeContainer); + if (!typeForObject) + return 2; + typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter((propertySymbol) => { + return typeChecker.isPropertyAccessible( + objectLikeContainer, + /*isSuper*/ + false, + /*isWrite*/ + false, + typeForObject, + propertySymbol + ); + }); + existingMembers = objectLikeContainer.elements; + } + } + if (typeMembers && typeMembers.length > 0) { + const filteredMembers = filterObjectMembersList(typeMembers, Debug.checkDefined(existingMembers)); + symbols = concatenate(symbols, filteredMembers); + setSortTextToOptionalMember(); + if (objectLikeContainer.kind === 210 && preferences.includeCompletionsWithObjectLiteralMethodSnippets && preferences.includeCompletionsWithInsertText) { + transformObjectLiteralMembersSortText(symbolsStartIndex); + collectObjectLiteralMethodSymbols(filteredMembers, objectLikeContainer); + } + } + return 1; + } + function tryGetImportOrExportClauseCompletionSymbols() { + if (!contextToken) + return 0; + const namedImportsOrExports = contextToken.kind === 19 || contextToken.kind === 28 ? tryCast(contextToken.parent, isNamedImportsOrExports) : isTypeKeywordTokenOrIdentifier(contextToken) ? tryCast(contextToken.parent.parent, isNamedImportsOrExports) : void 0; + if (!namedImportsOrExports) + return 0; + if (!isTypeKeywordTokenOrIdentifier(contextToken)) { + keywordFilters = 8; + } + const { moduleSpecifier } = namedImportsOrExports.kind === 275 ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent; + if (!moduleSpecifier) { + isNewIdentifierLocation = true; + return namedImportsOrExports.kind === 275 ? 2 : 0; + } + const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); + if (!moduleSpecifierSymbol) { + isNewIdentifierLocation = true; + return 2; + } + completionKind = 3; + isNewIdentifierLocation = false; + const exports29 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol); + const existing = new Set(namedImportsOrExports.elements.filter((n7) => !isCurrentlyEditingNode(n7)).map((n7) => (n7.propertyName || n7.name).escapedText)); + const uniques = exports29.filter((e10) => e10.escapedName !== "default" && !existing.has(e10.escapedName)); + symbols = concatenate(symbols, uniques); + if (!uniques.length) { + keywordFilters = 0; + } + return 1; + } + function tryGetImportAttributesCompletionSymbols() { + if (contextToken === void 0) + return 0; + const importAttributes = contextToken.kind === 19 || contextToken.kind === 28 ? tryCast(contextToken.parent, isImportAttributes) : contextToken.kind === 59 ? tryCast(contextToken.parent.parent, isImportAttributes) : void 0; + if (importAttributes === void 0) + return 0; + const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute)); + symbols = filter2(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName)); + return 1; + } + function tryGetLocalNamedExportCompletionSymbols() { + var _a2; + const namedExports = contextToken && (contextToken.kind === 19 || contextToken.kind === 28) ? tryCast(contextToken.parent, isNamedExports) : void 0; + if (!namedExports) { + return 0; + } + const localsContainer = findAncestor(namedExports, or(isSourceFile, isModuleDeclaration)); + completionKind = 5; + isNewIdentifierLocation = false; + (_a2 = localsContainer.locals) == null ? void 0 : _a2.forEach((symbol, name2) => { + var _a22, _b; + symbols.push(symbol); + if ((_b = (_a22 = localsContainer.symbol) == null ? void 0 : _a22.exports) == null ? void 0 : _b.has(name2)) { + symbolToSortTextMap[getSymbolId(symbol)] = SortText.OptionalMember; + } + }); + return 1; + } + function tryGetClassLikeCompletionSymbols() { + const decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location2, position); + if (!decl) + return 0; + completionKind = 3; + isNewIdentifierLocation = true; + keywordFilters = contextToken.kind === 42 ? 0 : isClassLike(decl) ? 2 : 3; + if (!isClassLike(decl)) + return 1; + const classElement = contextToken.kind === 27 ? contextToken.parent.parent : contextToken.parent; + let classElementModifierFlags = isClassElement(classElement) ? getEffectiveModifierFlags(classElement) : 0; + if (contextToken.kind === 80 && !isCurrentlyEditingNode(contextToken)) { + switch (contextToken.getText()) { + case "private": + classElementModifierFlags = classElementModifierFlags | 2; + break; + case "static": + classElementModifierFlags = classElementModifierFlags | 256; + break; + case "override": + classElementModifierFlags = classElementModifierFlags | 16; + break; + } + } + if (isClassStaticBlockDeclaration(classElement)) { + classElementModifierFlags |= 256; + } + if (!(classElementModifierFlags & 2)) { + const baseTypeNodes = isClassLike(decl) && classElementModifierFlags & 16 ? singleElementArray(getEffectiveBaseTypeNode(decl)) : getAllSuperTypeNodes(decl); + const baseSymbols = flatMap2(baseTypeNodes, (baseTypeNode) => { + const type3 = typeChecker.getTypeAtLocation(baseTypeNode); + return classElementModifierFlags & 256 ? (type3 == null ? void 0 : type3.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type3.symbol, decl)) : type3 && typeChecker.getPropertiesOfType(type3); + }); + symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags)); + forEach4(symbols, (symbol, index4) => { + const declaration = symbol == null ? void 0 : symbol.valueDeclaration; + if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) { + const origin = { + kind: 512, + symbolName: typeChecker.symbolToString(symbol) + }; + symbolToOriginInfoMap[index4] = origin; + } + }); + } + return 1; + } + function isConstructorParameterCompletion(node2) { + return !!node2.parent && isParameter(node2.parent) && isConstructorDeclaration(node2.parent.parent) && (isParameterPropertyModifier(node2.kind) || isDeclarationName(node2)); + } + function tryGetConstructorLikeCompletionContainer(contextToken2) { + if (contextToken2) { + const parent22 = contextToken2.parent; + switch (contextToken2.kind) { + case 21: + case 28: + return isConstructorDeclaration(contextToken2.parent) ? contextToken2.parent : void 0; + default: + if (isConstructorParameterCompletion(contextToken2)) { + return parent22.parent; + } + } + } + return void 0; + } + function tryGetFunctionLikeBodyCompletionContainer(contextToken2) { + if (contextToken2) { + let prev; + const container = findAncestor(contextToken2.parent, (node2) => { + if (isClassLike(node2)) { + return "quit"; + } + if (isFunctionLikeDeclaration(node2) && prev === node2.body) { + return true; + } + prev = node2; + return false; + }); + return container && container; + } + } + function tryGetContainingJsxElement(contextToken2) { + if (contextToken2) { + const parent22 = contextToken2.parent; + switch (contextToken2.kind) { + case 32: + case 31: + case 44: + case 80: + case 211: + case 292: + case 291: + case 293: + if (parent22 && (parent22.kind === 285 || parent22.kind === 286)) { + if (contextToken2.kind === 32) { + const precedingToken = findPrecedingToken( + contextToken2.pos, + sourceFile, + /*startNode*/ + void 0 + ); + if (!parent22.typeArguments || precedingToken && precedingToken.kind === 44) + break; + } + return parent22; + } else if (parent22.kind === 291) { + return parent22.parent.parent; + } + break; + case 11: + if (parent22 && (parent22.kind === 291 || parent22.kind === 293)) { + return parent22.parent.parent; + } + break; + case 20: + if (parent22 && parent22.kind === 294 && parent22.parent && parent22.parent.kind === 291) { + return parent22.parent.parent.parent; + } + if (parent22 && parent22.kind === 293) { + return parent22.parent.parent; + } + break; + } + } + return void 0; + } + function isInDifferentLineThanContextToken(contextToken2, position2) { + return sourceFile.getLineEndOfPosition(contextToken2.getEnd()) < position2; + } + function isSolelyIdentifierDefinitionLocation(contextToken2) { + const parent22 = contextToken2.parent; + const containingNodeKind = parent22.kind; + switch (contextToken2.kind) { + case 28: + return containingNodeKind === 260 || isVariableDeclarationListButNotTypeArgument(contextToken2) || containingNodeKind === 243 || containingNodeKind === 266 || // enum a { foo, | + isFunctionLikeButNotConstructor(containingNodeKind) || containingNodeKind === 264 || // interface A= contextToken2.pos; + case 25: + return containingNodeKind === 207; + case 59: + return containingNodeKind === 208; + case 23: + return containingNodeKind === 207; + case 21: + return containingNodeKind === 299 || isFunctionLikeButNotConstructor(containingNodeKind); + case 19: + return containingNodeKind === 266; + case 30: + return containingNodeKind === 263 || // class A< | + containingNodeKind === 231 || // var C = class D< | + containingNodeKind === 264 || // interface A< | + containingNodeKind === 265 || // type List< | + isFunctionLikeKind(containingNodeKind); + case 126: + return containingNodeKind === 172 && !isClassLike(parent22.parent); + case 26: + return containingNodeKind === 169 || !!parent22.parent && parent22.parent.kind === 207; + case 125: + case 123: + case 124: + return containingNodeKind === 169 && !isConstructorDeclaration(parent22.parent); + case 130: + return containingNodeKind === 276 || containingNodeKind === 281 || containingNodeKind === 274; + case 139: + case 153: + return !isFromObjectTypeDeclaration(contextToken2); + case 80: { + if (containingNodeKind === 276 && contextToken2 === parent22.name && contextToken2.text === "type") { + return false; + } + const ancestorVariableDeclaration = findAncestor( + contextToken2.parent, + isVariableDeclaration + ); + if (ancestorVariableDeclaration && isInDifferentLineThanContextToken(contextToken2, position)) { + return false; + } + break; + } + case 86: + case 94: + case 120: + case 100: + case 115: + case 102: + case 121: + case 87: + case 140: + return true; + case 156: + return containingNodeKind !== 276; + case 42: + return isFunctionLike(contextToken2.parent) && !isMethodDeclaration(contextToken2.parent); + } + if (isClassMemberCompletionKeyword(keywordForNode(contextToken2)) && isFromObjectTypeDeclaration(contextToken2)) { + return false; + } + if (isConstructorParameterCompletion(contextToken2)) { + if (!isIdentifier(contextToken2) || isParameterPropertyModifier(keywordForNode(contextToken2)) || isCurrentlyEditingNode(contextToken2)) { + return false; + } + } + switch (keywordForNode(contextToken2)) { + case 128: + case 86: + case 87: + case 138: + case 94: + case 100: + case 120: + case 121: + case 123: + case 124: + case 125: + case 126: + case 115: + return true; + case 134: + return isPropertyDeclaration(contextToken2.parent); + } + const ancestorClassLike = findAncestor(contextToken2.parent, isClassLike); + if (ancestorClassLike && contextToken2 === previousToken && isPreviousPropertyDeclarationTerminated(contextToken2, position)) { + return false; + } + const ancestorPropertyDeclaraion = getAncestor( + contextToken2.parent, + 172 + /* PropertyDeclaration */ + ); + if (ancestorPropertyDeclaraion && contextToken2 !== previousToken && isClassLike(previousToken.parent.parent) && position <= previousToken.end) { + if (isPreviousPropertyDeclarationTerminated(contextToken2, previousToken.end)) { + return false; + } else if (contextToken2.kind !== 64 && (isInitializedProperty(ancestorPropertyDeclaraion) || hasType(ancestorPropertyDeclaraion))) { + return true; + } + } + return isDeclarationName(contextToken2) && !isShorthandPropertyAssignment(contextToken2.parent) && !isJsxAttribute(contextToken2.parent) && !((isClassLike(contextToken2.parent) || isInterfaceDeclaration(contextToken2.parent) || isTypeParameterDeclaration(contextToken2.parent)) && (contextToken2 !== previousToken || position > previousToken.end)); + } + function isPreviousPropertyDeclarationTerminated(contextToken2, position2) { + return contextToken2.kind !== 64 && (contextToken2.kind === 27 || !positionsAreOnSameLine(contextToken2.end, position2, sourceFile)); + } + function isFunctionLikeButNotConstructor(kind) { + return isFunctionLikeKind(kind) && kind !== 176; + } + function isDotOfNumericLiteral(contextToken2) { + if (contextToken2.kind === 9) { + const text = contextToken2.getFullText(); + return text.charAt(text.length - 1) === "."; + } + return false; + } + function isVariableDeclarationListButNotTypeArgument(node2) { + return node2.parent.kind === 261 && !isPossiblyTypeArgumentPosition(node2, sourceFile, typeChecker); + } + function filterObjectMembersList(contextualMemberSymbols, existingMembers) { + if (existingMembers.length === 0) { + return contextualMemberSymbols; + } + const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); + const existingMemberNames = /* @__PURE__ */ new Set(); + for (const m7 of existingMembers) { + if (m7.kind !== 303 && m7.kind !== 304 && m7.kind !== 208 && m7.kind !== 174 && m7.kind !== 177 && m7.kind !== 178 && m7.kind !== 305) { + continue; + } + if (isCurrentlyEditingNode(m7)) { + continue; + } + let existingName; + if (isSpreadAssignment(m7)) { + setMembersDeclaredBySpreadAssignment(m7, membersDeclaredBySpreadAssignment); + } else if (isBindingElement(m7) && m7.propertyName) { + if (m7.propertyName.kind === 80) { + existingName = m7.propertyName.escapedText; + } + } else { + const name2 = getNameOfDeclaration(m7); + existingName = name2 && isPropertyNameLiteral(name2) ? getEscapedTextOfIdentifierOrLiteral(name2) : void 0; + } + if (existingName !== void 0) { + existingMemberNames.add(existingName); + } + } + const filteredSymbols = contextualMemberSymbols.filter((m7) => !existingMemberNames.has(m7.escapedName)); + setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); + return filteredSymbols; + } + function setMembersDeclaredBySpreadAssignment(declaration, membersDeclaredBySpreadAssignment) { + const expression = declaration.expression; + const symbol = typeChecker.getSymbolAtLocation(expression); + const type3 = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, expression); + const properties = type3 && type3.properties; + if (properties) { + properties.forEach((property2) => { + membersDeclaredBySpreadAssignment.add(property2.name); + }); + } + } + function setSortTextToOptionalMember() { + symbols.forEach((m7) => { + if (m7.flags & 16777216) { + const symbolId = getSymbolId(m7); + symbolToSortTextMap[symbolId] = symbolToSortTextMap[symbolId] ?? SortText.OptionalMember; + } + }); + } + function setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, contextualMemberSymbols) { + if (membersDeclaredBySpreadAssignment.size === 0) { + return; + } + for (const contextualMemberSymbol of contextualMemberSymbols) { + if (membersDeclaredBySpreadAssignment.has(contextualMemberSymbol.name)) { + symbolToSortTextMap[getSymbolId(contextualMemberSymbol)] = SortText.MemberDeclaredBySpreadAssignment; + } + } + } + function transformObjectLiteralMembersSortText(start2) { + for (let i7 = start2; i7 < symbols.length; i7++) { + const symbol = symbols[i7]; + const symbolId = getSymbolId(symbol); + const origin = symbolToOriginInfoMap == null ? void 0 : symbolToOriginInfoMap[i7]; + const target = getEmitScriptTarget(compilerOptions); + const displayName = getCompletionEntryDisplayNameForSymbol( + symbol, + target, + origin, + 0, + /*jsxIdentifierExpected*/ + false + ); + if (displayName) { + const originalSortText = symbolToSortTextMap[symbolId] ?? SortText.LocationPriority; + const { name: name2 } = displayName; + symbolToSortTextMap[symbolId] = SortText.ObjectLiteralProperty(originalSortText, name2); + } + } + } + function filterClassMembersList(baseSymbols, existingMembers, currentClassElementModifierFlags) { + const existingMemberNames = /* @__PURE__ */ new Set(); + for (const m7 of existingMembers) { + if (m7.kind !== 172 && m7.kind !== 174 && m7.kind !== 177 && m7.kind !== 178) { + continue; + } + if (isCurrentlyEditingNode(m7)) { + continue; + } + if (hasEffectiveModifier( + m7, + 2 + /* Private */ + )) { + continue; + } + if (isStatic(m7) !== !!(currentClassElementModifierFlags & 256)) { + continue; + } + const existingName = getPropertyNameForPropertyNameNode(m7.name); + if (existingName) { + existingMemberNames.add(existingName); + } + } + return baseSymbols.filter( + (propertySymbol) => !existingMemberNames.has(propertySymbol.escapedName) && !!propertySymbol.declarations && !(getDeclarationModifierFlagsFromSymbol(propertySymbol) & 2) && !(propertySymbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(propertySymbol.valueDeclaration)) + ); + } + function filterJsxAttributes(symbols2, attributes) { + const seenNames = /* @__PURE__ */ new Set(); + const membersDeclaredBySpreadAssignment = /* @__PURE__ */ new Set(); + for (const attr of attributes) { + if (isCurrentlyEditingNode(attr)) { + continue; + } + if (attr.kind === 291) { + seenNames.add(getEscapedTextOfJsxAttributeName(attr.name)); + } else if (isJsxSpreadAttribute(attr)) { + setMembersDeclaredBySpreadAssignment(attr, membersDeclaredBySpreadAssignment); + } + } + const filteredSymbols = symbols2.filter((a7) => !seenNames.has(a7.escapedName)); + setSortTextToMemberDeclaredBySpreadAssignment(membersDeclaredBySpreadAssignment, filteredSymbols); + return filteredSymbols; + } + function isCurrentlyEditingNode(node2) { + return node2.getStart(sourceFile) <= position && position <= node2.getEnd(); + } + } + function tryGetObjectLikeCompletionContainer(contextToken, position, sourceFile) { + var _a2; + if (contextToken) { + const { parent: parent22 } = contextToken; + switch (contextToken.kind) { + case 19: + case 28: + if (isObjectLiteralExpression(parent22) || isObjectBindingPattern(parent22)) { + return parent22; + } + break; + case 42: + return isMethodDeclaration(parent22) ? tryCast(parent22.parent, isObjectLiteralExpression) : void 0; + case 134: + return tryCast(parent22.parent, isObjectLiteralExpression); + case 80: + if (contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent)) { + return contextToken.parent.parent; + } else { + if (isObjectLiteralExpression(contextToken.parent.parent) && (isSpreadAssignment(contextToken.parent) || isShorthandPropertyAssignment(contextToken.parent) && getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line)) { + return contextToken.parent.parent; + } + const ancestorNode2 = findAncestor(parent22, isPropertyAssignment); + if ((ancestorNode2 == null ? void 0 : ancestorNode2.getLastToken(sourceFile)) === contextToken && isObjectLiteralExpression(ancestorNode2.parent)) { + return ancestorNode2.parent; + } + } + break; + default: + if (((_a2 = parent22.parent) == null ? void 0 : _a2.parent) && (isMethodDeclaration(parent22.parent) || isGetAccessorDeclaration(parent22.parent) || isSetAccessorDeclaration(parent22.parent)) && isObjectLiteralExpression(parent22.parent.parent)) { + return parent22.parent.parent; + } + if (isSpreadAssignment(parent22) && isObjectLiteralExpression(parent22.parent)) { + return parent22.parent; + } + const ancestorNode = findAncestor(parent22, isPropertyAssignment); + if (contextToken.kind !== 59 && (ancestorNode == null ? void 0 : ancestorNode.getLastToken(sourceFile)) === contextToken && isObjectLiteralExpression(ancestorNode.parent)) { + return ancestorNode.parent; + } + } + } + return void 0; + } + function getRelevantTokens(position, sourceFile) { + const previousToken = findPrecedingToken(position, sourceFile); + if (previousToken && position <= previousToken.end && (isMemberName(previousToken) || isKeyword(previousToken.kind))) { + const contextToken = findPrecedingToken( + previousToken.getFullStart(), + sourceFile, + /*startNode*/ + void 0 + ); + return { contextToken, previousToken }; + } + return { contextToken: previousToken, previousToken }; + } + function getAutoImportSymbolFromCompletionEntryData(name2, data, program, host) { + const containingProgram = data.isPackageJsonImport ? host.getPackageJsonAutoImportProvider() : program; + const checker = containingProgram.getTypeChecker(); + const moduleSymbol = data.ambientModuleName ? checker.tryFindAmbientModule(data.ambientModuleName) : data.fileName ? checker.getMergedSymbol(Debug.checkDefined(containingProgram.getSourceFile(data.fileName)).symbol) : void 0; + if (!moduleSymbol) + return void 0; + let symbol = data.exportName === "export=" ? checker.resolveExternalModuleSymbol(moduleSymbol) : checker.tryGetMemberInModuleExportsAndProperties(data.exportName, moduleSymbol); + if (!symbol) + return void 0; + const isDefaultExport = data.exportName === "default"; + symbol = isDefaultExport && getLocalSymbolForExportDefault(symbol) || symbol; + return { symbol, origin: completionEntryDataToSymbolOriginInfo(data, name2, moduleSymbol) }; + } + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, jsxIdentifierExpected) { + if (originIsIgnore(origin)) { + return void 0; + } + const name2 = originIncludesSymbolName(origin) ? origin.symbolName : symbol.name; + if (name2 === void 0 || symbol.flags & 1536 && isSingleOrDoubleQuote(name2.charCodeAt(0)) || isKnownSymbol(symbol)) { + return void 0; + } + const validNameResult = { name: name2, needsConvertPropertyAccess: false }; + if (isIdentifierText( + name2, + target, + jsxIdentifierExpected ? 1 : 0 + /* Standard */ + ) || symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { + return validNameResult; + } + switch (kind) { + case 3: + return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0; + case 0: + return { name: JSON.stringify(name2), needsConvertPropertyAccess: false }; + case 2: + case 1: + return name2.charCodeAt(0) === 32 ? void 0 : { name: name2, needsConvertPropertyAccess: true }; + case 5: + case 4: + return validNameResult; + default: + Debug.assertNever(kind); + } + } + function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) { + if (!filterOutTsOnlyKeywords) + return getTypescriptKeywordCompletions(keywordFilter); + const index4 = keywordFilter + 8 + 1; + return _keywordCompletions[index4] || (_keywordCompletions[index4] = getTypescriptKeywordCompletions(keywordFilter).filter((entry) => !isTypeScriptOnlyKeyword(stringToToken(entry.name)))); + } + function getTypescriptKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter((entry) => { + const kind = stringToToken(entry.name); + switch (keywordFilter) { + case 0: + return false; + case 1: + return isFunctionLikeBodyKeyword(kind) || kind === 138 || kind === 144 || kind === 156 || kind === 145 || kind === 128 || isTypeKeyword(kind) && kind !== 157; + case 5: + return isFunctionLikeBodyKeyword(kind); + case 2: + return isClassMemberCompletionKeyword(kind); + case 3: + return isInterfaceOrTypeLiteralCompletionKeyword(kind); + case 4: + return isParameterPropertyModifier(kind); + case 6: + return isTypeKeyword(kind) || kind === 87; + case 7: + return isTypeKeyword(kind); + case 8: + return kind === 156; + default: + return Debug.assertNever(keywordFilter); + } + })); + } + function isTypeScriptOnlyKeyword(kind) { + switch (kind) { + case 128: + case 133: + case 163: + case 136: + case 138: + case 94: + case 162: + case 119: + case 140: + case 120: + case 142: + case 143: + case 144: + case 145: + case 146: + case 150: + case 151: + case 164: + case 123: + case 124: + case 125: + case 148: + case 154: + case 155: + case 156: + case 158: + case 159: + return true; + default: + return false; + } + } + function isInterfaceOrTypeLiteralCompletionKeyword(kind) { + return kind === 148; + } + function isClassMemberCompletionKeyword(kind) { + switch (kind) { + case 128: + case 129: + case 137: + case 139: + case 153: + case 134: + case 138: + case 164: + return true; + default: + return isClassMemberModifier(kind); + } + } + function isFunctionLikeBodyKeyword(kind) { + return kind === 134 || kind === 135 || kind === 160 || kind === 130 || kind === 152 || kind === 156 || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind); + } + function keywordForNode(node) { + return isIdentifier(node) ? identifierToKeywordKind(node) ?? 0 : node.kind; + } + function getContextualKeywords(contextToken, position) { + const entries = []; + if (contextToken) { + const file = contextToken.getSourceFile(); + const parent22 = contextToken.parent; + const tokenLine = file.getLineAndCharacterOfPosition(contextToken.end).line; + const currentLine = file.getLineAndCharacterOfPosition(position).line; + if ((isImportDeclaration(parent22) || isExportDeclaration(parent22) && parent22.moduleSpecifier) && contextToken === parent22.moduleSpecifier && tokenLine === currentLine) { + entries.push({ + name: tokenToString( + 132 + /* AssertKeyword */ + ), + kind: "keyword", + kindModifiers: "", + sortText: SortText.GlobalsOrKeywords + }); + } + } + return entries; + } + function getJsDocTagAtPosition(node, position) { + return findAncestor(node, (n7) => isJSDocTag(n7) && rangeContainsPosition(n7, position) ? true : isJSDoc(n7) ? "quit" : false); + } + function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) { + const hasCompletionsType = completionsType && completionsType !== contextualType; + const type3 = hasCompletionsType && !(completionsType.flags & 3) ? checker.getUnionType([contextualType, completionsType]) : contextualType; + const properties = getApparentProperties(type3, obj, checker); + return type3.isClass() && containsNonPublicProperties(properties) ? [] : hasCompletionsType ? filter2(properties, hasDeclarationOtherThanSelf) : properties; + function hasDeclarationOtherThanSelf(member) { + if (!length(member.declarations)) + return true; + return some2(member.declarations, (decl) => decl.parent !== obj); + } + } + function getApparentProperties(type3, node, checker) { + if (!type3.isUnion()) + return type3.getApparentProperties(); + return checker.getAllPossiblePropertiesOfTypes(filter2(type3.types, (memberType) => !(memberType.flags & 402784252 || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties())))); + } + function containsNonPublicProperties(props) { + return some2(props, (p7) => !!(getDeclarationModifierFlagsFromSymbol(p7) & 6)); + } + function getPropertiesForCompletion(type3, checker) { + return type3.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type3.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type3.getApparentProperties(), "getApparentProperties() should all be defined"); + } + function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location2, position) { + switch (location2.kind) { + case 358: + return tryCast(location2.parent, isObjectTypeDeclaration); + case 1: + const cls = tryCast(lastOrUndefined(cast(location2.parent, isSourceFile).statements), isObjectTypeDeclaration); + if (cls && !findChildOfKind(cls, 20, sourceFile)) { + return cls; + } + break; + case 81: + if (tryCast(location2.parent, isPropertyDeclaration)) { + return findAncestor(location2, isClassLike); + } + break; + case 80: { + const originalKeywordKind = identifierToKeywordKind(location2); + if (originalKeywordKind) { + return void 0; + } + if (isPropertyDeclaration(location2.parent) && location2.parent.initializer === location2) { + return void 0; + } + if (isFromObjectTypeDeclaration(location2)) { + return findAncestor(location2, isObjectTypeDeclaration); + } + } + } + if (!contextToken) + return void 0; + if (location2.kind === 137 || isIdentifier(contextToken) && isPropertyDeclaration(contextToken.parent) && isClassLike(location2)) { + return findAncestor(contextToken, isClassLike); + } + switch (contextToken.kind) { + case 64: + return void 0; + case 27: + case 20: + return isFromObjectTypeDeclaration(location2) && location2.parent.name === location2 ? location2.parent.parent : tryCast(location2, isObjectTypeDeclaration); + case 19: + case 28: + return tryCast(contextToken.parent, isObjectTypeDeclaration); + default: + if (isObjectTypeDeclaration(location2)) { + if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line) { + return location2; + } + const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword; + return isValidKeyword(contextToken.kind) || contextToken.kind === 42 || isIdentifier(contextToken) && isValidKeyword( + identifierToKeywordKind(contextToken) ?? 0 + /* Unknown */ + ) ? contextToken.parent.parent : void 0; + } + return void 0; + } + } + function tryGetTypeLiteralNode(node) { + if (!node) + return void 0; + const parent22 = node.parent; + switch (node.kind) { + case 19: + if (isTypeLiteralNode(parent22)) { + return parent22; + } + break; + case 27: + case 28: + case 80: + if (parent22.kind === 171 && isTypeLiteralNode(parent22.parent)) { + return parent22.parent; + } + break; + } + return void 0; + } + function getConstraintOfTypeArgumentProperty(node, checker) { + if (!node) + return void 0; + if (isTypeNode(node) && isTypeReferenceType(node.parent)) { + return checker.getTypeArgumentConstraint(node); + } + const t8 = getConstraintOfTypeArgumentProperty(node.parent, checker); + if (!t8) + return void 0; + switch (node.kind) { + case 171: + return checker.getTypeOfPropertyOfContextualType(t8, node.symbol.escapedName); + case 193: + case 187: + case 192: + return t8; + } + } + function isFromObjectTypeDeclaration(node) { + return node.parent && isClassOrTypeElement(node.parent) && isObjectTypeDeclaration(node.parent.parent); + } + function isValidTrigger(sourceFile, triggerCharacter, contextToken, position) { + switch (triggerCharacter) { + case ".": + case "@": + return true; + case '"': + case "'": + case "`": + return !!contextToken && isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1; + case "#": + return !!contextToken && isPrivateIdentifier(contextToken) && !!getContainingClass(contextToken); + case "<": + return !!contextToken && contextToken.kind === 30 && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); + case "/": + return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) : contextToken.kind === 44 && isJsxClosingElement(contextToken.parent)); + case " ": + return !!contextToken && isImportKeyword(contextToken) && contextToken.parent.kind === 312; + default: + return Debug.assertNever(triggerCharacter); + } + } + function binaryExpressionMayBeOpenTag({ left }) { + return nodeIsMissing(left); + } + function isProbablyGlobalType(type3, sourceFile, checker) { + const selfSymbol = checker.resolveName( + "self", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (selfSymbol && checker.getTypeOfSymbolAtLocation(selfSymbol, sourceFile) === type3) { + return true; + } + const globalSymbol = checker.resolveName( + "global", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (globalSymbol && checker.getTypeOfSymbolAtLocation(globalSymbol, sourceFile) === type3) { + return true; + } + const globalThisSymbol = checker.resolveName( + "globalThis", + /*location*/ + void 0, + 111551, + /*excludeGlobals*/ + false + ); + if (globalThisSymbol && checker.getTypeOfSymbolAtLocation(globalThisSymbol, sourceFile) === type3) { + return true; + } + return false; + } + function isStaticProperty(symbol) { + return !!(symbol.valueDeclaration && getEffectiveModifierFlags(symbol.valueDeclaration) & 256 && isClassLike(symbol.valueDeclaration.parent)); + } + function tryGetObjectLiteralContextualType(node, typeChecker) { + const type3 = typeChecker.getContextualType(node); + if (type3) { + return type3; + } + const parent22 = walkUpParenthesizedExpressions(node.parent); + if (isBinaryExpression(parent22) && parent22.operatorToken.kind === 64 && node === parent22.left) { + return typeChecker.getTypeAtLocation(parent22); + } + if (isExpression(parent22)) { + return typeChecker.getContextualType(parent22); + } + return void 0; + } + function getImportStatementCompletionInfo(contextToken, sourceFile) { + var _a2, _b, _c; + let keywordCompletion; + let isKeywordOnlyCompletion = false; + const candidate = getCandidate(); + return { + isKeywordOnlyCompletion, + keywordCompletion, + isNewIdentifierLocation: !!(candidate || keywordCompletion === 156), + isTopLevelTypeOnly: !!((_b = (_a2 = tryCast(candidate, isImportDeclaration)) == null ? void 0 : _a2.importClause) == null ? void 0 : _b.isTypeOnly) || !!((_c = tryCast(candidate, isImportEqualsDeclaration)) == null ? void 0 : _c.isTypeOnly), + couldBeTypeOnlyImportSpecifier: !!candidate && couldBeTypeOnlyImportSpecifier(candidate, contextToken), + replacementSpan: getSingleLineReplacementSpanForImportCompletionNode(candidate) + }; + function getCandidate() { + const parent22 = contextToken.parent; + if (isImportEqualsDeclaration(parent22)) { + const lastToken = parent22.getLastToken(sourceFile); + if (isIdentifier(contextToken) && lastToken !== contextToken) { + keywordCompletion = 161; + isKeywordOnlyCompletion = true; + return void 0; + } + keywordCompletion = contextToken.kind === 156 ? void 0 : 156; + return isModuleSpecifierMissingOrEmpty(parent22.moduleReference) ? parent22 : void 0; + } + if (couldBeTypeOnlyImportSpecifier(parent22, contextToken) && canCompleteFromNamedBindings(parent22.parent)) { + return parent22; + } + if (isNamedImports(parent22) || isNamespaceImport(parent22)) { + if (!parent22.parent.isTypeOnly && (contextToken.kind === 19 || contextToken.kind === 102 || contextToken.kind === 28)) { + keywordCompletion = 156; + } + if (canCompleteFromNamedBindings(parent22)) { + if (contextToken.kind === 20 || contextToken.kind === 80) { + isKeywordOnlyCompletion = true; + keywordCompletion = 161; + } else { + return parent22.parent.parent; + } + } + return void 0; + } + if (isExportDeclaration(parent22) && contextToken.kind === 42 || isNamedExports(parent22) && contextToken.kind === 20) { + isKeywordOnlyCompletion = true; + keywordCompletion = 161; + return void 0; + } + if (isImportKeyword(contextToken) && isSourceFile(parent22)) { + keywordCompletion = 156; + return contextToken; + } + if (isImportKeyword(contextToken) && isImportDeclaration(parent22)) { + keywordCompletion = 156; + return isModuleSpecifierMissingOrEmpty(parent22.moduleSpecifier) ? parent22 : void 0; + } + return void 0; + } + } + function getSingleLineReplacementSpanForImportCompletionNode(node) { + var _a2; + if (!node) + return void 0; + const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)) ?? node; + const sourceFile = top.getSourceFile(); + if (rangeIsOnSingleLine(top, sourceFile)) { + return createTextSpanFromNode(top, sourceFile); + } + Debug.assert( + top.kind !== 102 && top.kind !== 276 + /* ImportSpecifier */ + ); + const potentialSplitPoint = top.kind === 272 ? getPotentiallyInvalidImportSpecifier((_a2 = top.importClause) == null ? void 0 : _a2.namedBindings) ?? top.moduleSpecifier : top.moduleReference; + const withoutModuleSpecifier = { + pos: top.getFirstToken().getStart(), + end: potentialSplitPoint.pos + }; + if (rangeIsOnSingleLine(withoutModuleSpecifier, sourceFile)) { + return createTextSpanFromRange(withoutModuleSpecifier); + } + } + function getPotentiallyInvalidImportSpecifier(namedBindings) { + var _a2; + return find2( + (_a2 = tryCast(namedBindings, isNamedImports)) == null ? void 0 : _a2.elements, + (e10) => { + var _a22; + return !e10.propertyName && isStringANonContextualKeyword(e10.name.text) && ((_a22 = findPrecedingToken(e10.name.pos, namedBindings.getSourceFile(), namedBindings)) == null ? void 0 : _a22.kind) !== 28; + } + ); + } + function couldBeTypeOnlyImportSpecifier(importSpecifier, contextToken) { + return isImportSpecifier(importSpecifier) && (importSpecifier.isTypeOnly || contextToken === importSpecifier.name && isTypeKeywordTokenOrIdentifier(contextToken)); + } + function canCompleteFromNamedBindings(namedBindings) { + if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings.parent.name) { + return false; + } + if (isNamedImports(namedBindings)) { + const invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings); + const validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : namedBindings.elements.length; + return validImports < 2; + } + return true; + } + function isModuleSpecifierMissingOrEmpty(specifier) { + var _a2; + if (nodeIsMissing(specifier)) + return true; + return !((_a2 = tryCast(isExternalModuleReference(specifier) ? specifier.expression : specifier, isStringLiteralLike)) == null ? void 0 : _a2.text); + } + function getVariableOrParameterDeclaration(contextToken, location2) { + if (!contextToken) + return; + const possiblyParameterDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent)); + const possiblyVariableDeclaration = findAncestor(location2, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node)); + return possiblyParameterDeclaration || possiblyVariableDeclaration; + } + function isArrowFunctionBody(node) { + return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/; + node.kind === 39); + } + function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Map()) { + return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(skipAlias(symbol.exportSymbol || symbol, checker)); + function nonAliasCanBeReferencedAtTypeLocation(symbol2) { + return !!(symbol2.flags & 788968) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536) && addToSeen(seenModules, getSymbolId(symbol2)) && checker.getExportsOfModule(symbol2).some((e10) => symbolCanBeReferencedAtTypeLocation(e10, checker, seenModules)); + } + } + function isDeprecated(symbol, checker) { + const declarations = skipAlias(symbol, checker).declarations; + return !!length(declarations) && every2(declarations, isDeprecatedDeclaration); + } + function charactersFuzzyMatchInString(identifierString, lowercaseCharacters) { + if (lowercaseCharacters.length === 0) { + return true; + } + let matchedFirstCharacter = false; + let prevChar; + let characterIndex = 0; + const len = identifierString.length; + for (let strIndex = 0; strIndex < len; strIndex++) { + const strChar = identifierString.charCodeAt(strIndex); + const testChar = lowercaseCharacters.charCodeAt(characterIndex); + if (strChar === testChar || strChar === toUpperCharCode(testChar)) { + matchedFirstCharacter || (matchedFirstCharacter = prevChar === void 0 || // Beginning of word + 97 <= prevChar && prevChar <= 122 && 65 <= strChar && strChar <= 90 || // camelCase transition + prevChar === 95 && strChar !== 95); + if (matchedFirstCharacter) { + characterIndex++; + } + if (characterIndex === lowercaseCharacters.length) { + return true; + } + } + prevChar = strChar; + } + return false; + } + function toUpperCharCode(charCode) { + if (97 <= charCode && charCode <= 122) { + return charCode - 32; + } + return charCode; + } + function isContextualKeywordInAutoImportableExpressionSpace(keyword) { + return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type"; + } + var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions; + var init_completions = __esm2({ + "src/services/completions.ts"() { + "use strict"; + init_ts4(); + init_ts_Completions(); + moduleSpecifierResolutionLimit = 100; + moduleSpecifierResolutionCacheAttemptLimit = 1e3; + SortText = { + // Presets + LocalDeclarationPriority: "10", + LocationPriority: "11", + OptionalMember: "12", + MemberDeclaredBySpreadAssignment: "13", + SuggestedClassMembers: "14", + GlobalsOrKeywords: "15", + AutoImportSuggestions: "16", + ClassMemberSnippets: "17", + JavascriptIdentifiers: "18", + // Transformations + Deprecated(sortText) { + return "z" + sortText; + }, + ObjectLiteralProperty(presetSortText, symbolDisplayName) { + return `${presetSortText}\0${symbolDisplayName}\0`; + }, + SortBelow(sortText) { + return sortText + "1"; + } + }; + CompletionSource = /* @__PURE__ */ ((CompletionSource2) => { + CompletionSource2["ThisProperty"] = "ThisProperty/"; + CompletionSource2["ClassMemberSnippet"] = "ClassMemberSnippet/"; + CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/"; + CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/"; + CompletionSource2["SwitchCases"] = "SwitchCases/"; + CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/"; + return CompletionSource2; + })(CompletionSource || {}); + SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => { + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ThisType"] = 1] = "ThisType"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMember"] = 2] = "SymbolMember"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["Export"] = 4] = "Export"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["Promise"] = 8] = "Promise"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["Nullable"] = 16] = "Nullable"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ResolvedExport"] = 32] = "ResolvedExport"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName"; + SymbolOriginInfoKind2[ + SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 + /* SymbolMember */ + ] = "SymbolMemberNoExport"; + SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport"; + return SymbolOriginInfoKind2; + })(SymbolOriginInfoKind || {}); + CompletionKind = /* @__PURE__ */ ((CompletionKind2) => { + CompletionKind2[CompletionKind2["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; + CompletionKind2[CompletionKind2["Global"] = 1] = "Global"; + CompletionKind2[CompletionKind2["PropertyAccess"] = 2] = "PropertyAccess"; + CompletionKind2[CompletionKind2["MemberLike"] = 3] = "MemberLike"; + CompletionKind2[CompletionKind2["String"] = 4] = "String"; + CompletionKind2[CompletionKind2["None"] = 5] = "None"; + return CompletionKind2; + })(CompletionKind || {}); + _keywordCompletions = []; + allKeywordsCompletions = memoize2(() => { + const res = []; + for (let i7 = 83; i7 <= 165; i7++) { + res.push({ + name: tokenToString(i7), + kind: "keyword", + kindModifiers: "", + sortText: SortText.GlobalsOrKeywords + }); + } + return res; + }); + } + }); + function createNameAndKindSet() { + const map22 = /* @__PURE__ */ new Map(); + function add2(value2) { + const existing = map22.get(value2.name); + if (!existing || kindPrecedence[existing.kind] < kindPrecedence[value2.kind]) { + map22.set(value2.name, value2); + } + } + return { + add: add2, + has: map22.has.bind(map22), + values: map22.values.bind(map22) + }; + } + function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log3, preferences, includeSymbol) { + if (isInReferenceComment(sourceFile, position)) { + const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host); + return entries && convertPathCompletions(entries); + } + if (isInString(sourceFile, position, contextToken)) { + if (!contextToken || !isStringLiteralLike(contextToken)) + return void 0; + const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program, host, preferences); + return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log3, options, preferences, position, includeSymbol); + } + } + function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log3, options, preferences, position, includeSymbol) { + if (completion === void 0) { + return void 0; + } + const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken); + switch (completion.kind) { + case 0: + return convertPathCompletions(completion.paths); + case 1: { + const entries = createSortedArray(); + getCompletionEntriesFromSymbols( + completion.symbols, + entries, + contextToken, + contextToken, + sourceFile, + position, + sourceFile, + host, + program, + 99, + log3, + 4, + preferences, + options, + /*formatContext*/ + void 0, + /*isTypeOnlyLocation*/ + void 0, + /*propertyAccessToConvert*/ + void 0, + /*jsxIdentifierExpected*/ + void 0, + /*isJsxInitializer*/ + void 0, + /*importStatementCompletion*/ + void 0, + /*recommendedCompletion*/ + void 0, + /*symbolToOriginInfoMap*/ + void 0, + /*symbolToSortTextMap*/ + void 0, + /*isJsxIdentifierExpected*/ + void 0, + /*isRightOfOpenTag*/ + void 0, + includeSymbol + ); + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries }; + } + case 2: { + const quoteChar = contextToken.kind === 15 ? 96 : startsWith2(getTextOfNode(contextToken), "'") ? 39 : 34; + const entries = completion.types.map((type3) => ({ + name: escapeString2(type3.value, quoteChar), + kindModifiers: "", + kind: "string", + sortText: SortText.LocationPriority, + replacementSpan: getReplacementSpanForContextToken(contextToken) + })); + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan, entries }; + } + default: + return Debug.assertNever(completion); + } + } + function getStringLiteralCompletionDetails(name2, sourceFile, position, contextToken, program, host, cancellationToken, preferences) { + if (!contextToken || !isStringLiteralLike(contextToken)) + return void 0; + const completions = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program, host, preferences); + return completions && stringLiteralCompletionDetails(name2, contextToken, completions, sourceFile, program.getTypeChecker(), cancellationToken); + } + function stringLiteralCompletionDetails(name2, location2, completion, sourceFile, checker, cancellationToken) { + switch (completion.kind) { + case 0: { + const match = find2(completion.paths, (p7) => p7.name === name2); + return match && createCompletionDetails(name2, kindModifiersFromExtension(match.extension), match.kind, [textPart(name2)]); + } + case 1: { + const match = find2(completion.symbols, (s7) => s7.name === name2); + return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location2, cancellationToken); + } + case 2: + return find2(completion.types, (t8) => t8.value === name2) ? createCompletionDetails(name2, "", "string", [textPart(name2)]) : void 0; + default: + return Debug.assertNever(completion); + } + } + function convertPathCompletions(pathCompletions) { + const isGlobalCompletion = false; + const isNewIdentifierLocation = true; + const entries = pathCompletions.map(({ name: name2, kind, span, extension }) => ({ name: name2, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: SortText.LocationPriority, replacementSpan: span })); + return { isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation, entries }; + } + function kindModifiersFromExtension(extension) { + switch (extension) { + case ".d.ts": + return ".d.ts"; + case ".js": + return ".js"; + case ".json": + return ".json"; + case ".jsx": + return ".jsx"; + case ".ts": + return ".ts"; + case ".tsx": + return ".tsx"; + case ".d.mts": + return ".d.mts"; + case ".mjs": + return ".mjs"; + case ".mts": + return ".mts"; + case ".d.cts": + return ".d.cts"; + case ".cjs": + return ".cjs"; + case ".cts": + return ".cts"; + case ".tsbuildinfo": + return Debug.fail(`Extension ${".tsbuildinfo"} is unsupported.`); + case void 0: + return ""; + default: + return Debug.assertNever(extension); + } + } + function getStringLiteralCompletionEntries(sourceFile, node, position, program, host, preferences) { + const typeChecker = program.getTypeChecker(); + const parent22 = walkUpParentheses(node.parent); + switch (parent22.kind) { + case 201: { + const grandParent = walkUpParentheses(parent22.parent); + if (grandParent.kind === 205) { + return { kind: 0, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; + } + return fromUnionableLiteralType(grandParent); + } + case 303: + if (isObjectLiteralExpression(parent22.parent) && parent22.name === node) { + return stringLiteralCompletionsForObjectLiteral(typeChecker, parent22.parent); + } + return fromContextualType() || fromContextualType( + 0 + /* None */ + ); + case 212: { + const { expression, argumentExpression } = parent22; + if (node === skipParentheses(argumentExpression)) { + return stringLiteralCompletionsFromProperties(typeChecker.getTypeAtLocation(expression)); + } + return void 0; + } + case 213: + case 214: + case 291: + if (!isRequireCallArgument(node) && !isImportCall(parent22)) { + const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent22.kind === 291 ? parent22.parent : node, position, sourceFile, typeChecker); + return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType( + 0 + /* None */ + ); + } + case 272: + case 278: + case 283: + return { kind: 0, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) }; + case 296: + const tracker = newCaseClauseTracker(typeChecker, parent22.parent.clauses); + const contextualTypes = fromContextualType(); + if (!contextualTypes) { + return; + } + const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value)); + return { kind: 2, types: literals, isNewIdentifier: false }; + default: + return fromContextualType() || fromContextualType( + 0 + /* None */ + ); + } + function fromUnionableLiteralType(grandParent) { + switch (grandParent.kind) { + case 233: + case 183: { + const typeArgument = findAncestor(parent22, (n7) => n7.parent === grandParent); + if (typeArgument) { + return { kind: 2, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false }; + } + return void 0; + } + case 199: + const { indexType, objectType: objectType2 } = grandParent; + if (!rangeContainsPosition(indexType, position)) { + return void 0; + } + return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType2)); + case 192: { + const result2 = fromUnionableLiteralType(walkUpParentheses(grandParent.parent)); + if (!result2) { + return void 0; + } + const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent22); + if (result2.kind === 1) { + return { kind: 1, symbols: result2.symbols.filter((sym) => !contains2(alreadyUsedTypes, sym.name)), hasIndexSignature: result2.hasIndexSignature }; + } + return { kind: 2, types: result2.types.filter((t8) => !contains2(alreadyUsedTypes, t8.value)), isNewIdentifier: false }; + } + default: + return void 0; + } + } + function fromContextualType(contextFlags = 4) { + const types3 = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)); + if (!types3.length) { + return; + } + return { kind: 2, types: types3, isNewIdentifier: false }; + } + } + function walkUpParentheses(node) { + switch (node.kind) { + case 196: + return walkUpParenthesizedTypes(node); + case 217: + return walkUpParenthesizedExpressions(node); + default: + return node; + } + } + function getAlreadyUsedTypesInStringLiteralUnion(union2, current) { + return mapDefined(union2.types, (type3) => type3 !== current && isLiteralTypeNode(type3) && isStringLiteral(type3.literal) ? type3.literal.text : void 0); + } + function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) { + let isNewIdentifier = false; + const uniques = /* @__PURE__ */ new Map(); + const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg; + const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument); + const types3 = flatMap2(candidates, (candidate) => { + if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length) + return; + let type3 = candidate.getTypeParameterAtPosition(argumentInfo.argumentIndex); + if (isJsxOpeningLikeElement(call)) { + const propType = checker.getTypeOfPropertyOfType(type3, getTextOfJsxAttributeName(editingArgument.name)); + if (propType) { + type3 = propType; + } + } + isNewIdentifier = isNewIdentifier || !!(type3.flags & 4); + return getStringLiteralTypes(type3, uniques); + }); + return length(types3) ? { kind: 2, types: types3, isNewIdentifier } : void 0; + } + function stringLiteralCompletionsFromProperties(type3) { + return type3 && { + kind: 1, + symbols: filter2(type3.getApparentProperties(), (prop) => !(prop.valueDeclaration && isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration))), + hasIndexSignature: hasIndexSignature(type3) + }; + } + function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) { + const contextualType = checker.getContextualType(objectLiteralExpression); + if (!contextualType) + return void 0; + const completionsType = checker.getContextualType( + objectLiteralExpression, + 4 + /* Completions */ + ); + const symbols = getPropertiesForObjectExpression( + contextualType, + completionsType, + objectLiteralExpression, + checker + ); + return { + kind: 1, + symbols, + hasIndexSignature: hasIndexSignature(contextualType) + }; + } + function getStringLiteralTypes(type3, uniques = /* @__PURE__ */ new Map()) { + if (!type3) + return emptyArray; + type3 = skipConstraint(type3); + return type3.isUnion() ? flatMap2(type3.types, (t8) => getStringLiteralTypes(t8, uniques)) : type3.isStringLiteral() && !(type3.flags & 1024) && addToSeen(uniques, type3.value) ? [type3] : emptyArray; + } + function nameAndKind(name2, kind, extension) { + return { name: name2, kind, extension }; + } + function directoryResult(name2) { + return nameAndKind( + name2, + "directory", + /*extension*/ + void 0 + ); + } + function addReplacementSpans(text, textStart, names) { + const span = getDirectoryFragmentTextSpan(text, textStart); + const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length); + return names.map(({ name: name2, kind, extension }) => name2.includes(directorySeparator) || name2.includes(altDirectorySeparator) ? { name: name2, kind, extension, span: wholeSpan } : { name: name2, kind, extension, span }); + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) { + return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, program, host, preferences)); + } + function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, program, host, preferences) { + const literalValue = normalizeSlashes(node.text); + const mode = isStringLiteralLike(node) ? program.getModeForUsageLocation(sourceFile, node) : void 0; + const scriptPath = sourceFile.path; + const scriptDirectory = getDirectoryPath(scriptPath); + const compilerOptions = program.getCompilerOptions(); + const typeChecker = program.getTypeChecker(); + const extensionOptions = getExtensionOptions(compilerOptions, 1, sourceFile, typeChecker, preferences, mode); + return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker); + } + function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) { + return { + extensionsToSearch: flatten2(getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker)), + referenceKind, + importingSourceFile, + endingPreference: preferences == null ? void 0 : preferences.importModuleSpecifierEnding, + resolutionMode + }; + } + function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) { + if (compilerOptions.rootDirs) { + return getCompletionEntriesForDirectoryFragmentWithRootDirs( + compilerOptions.rootDirs, + literalValue, + scriptDirectory, + extensionOptions, + compilerOptions, + host, + scriptPath + ); + } else { + return arrayFrom(getCompletionEntriesForDirectoryFragment( + literalValue, + scriptDirectory, + extensionOptions, + host, + /*moduleSpecifierIsRelative*/ + true, + scriptPath + ).values()); + } + } + function getSupportedExtensionsForModuleResolution(compilerOptions, typeChecker) { + const ambientModulesExtensions = !typeChecker ? [] : mapDefined(typeChecker.getAmbientModules(), (module22) => { + const name2 = module22.name.slice(1, -1); + if (!name2.startsWith("*.") || name2.includes("/")) + return; + return name2.slice(1); + }); + const extensions6 = [...getSupportedExtensions(compilerOptions), ambientModulesExtensions]; + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + return moduleResolutionUsesNodeModules(moduleResolution) ? getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions6) : extensions6; + } + function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase) { + rootDirs = rootDirs.map((rootDirectory) => ensureTrailingDirectorySeparator(normalizePath(isRootedDiskPath(rootDirectory) ? rootDirectory : combinePaths(basePath, rootDirectory)))); + const relativeDirectory = firstDefined(rootDirs, (rootDirectory) => containsPath(rootDirectory, scriptDirectory, basePath, ignoreCase) ? scriptDirectory.substr(rootDirectory.length) : void 0); + return deduplicate( + [...rootDirs.map((rootDirectory) => combinePaths(rootDirectory, relativeDirectory)), scriptDirectory].map((baseDir) => removeTrailingDirectorySeparator(baseDir)), + equateStringsCaseSensitive, + compareStringsCaseSensitive + ); + } + function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) { + const basePath = compilerOptions.project || host.getCurrentDirectory(); + const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase); + return deduplicate( + flatMap2(baseDirectories, (baseDirectory) => arrayFrom(getCompletionEntriesForDirectoryFragment( + fragment, + baseDirectory, + extensionOptions, + host, + /*moduleSpecifierIsRelative*/ + true, + exclude + ).values())), + (itemA, itemB) => itemA.name === itemB.name && itemA.kind === itemB.kind && itemA.extension === itemB.extension + ); + } + function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions, host, moduleSpecifierIsRelative, exclude, result2 = createNameAndKindSet()) { + var _a2; + if (fragment === void 0) { + fragment = ""; + } + fragment = normalizeSlashes(fragment); + if (!hasTrailingDirectorySeparator(fragment)) { + fragment = getDirectoryPath(fragment); + } + if (fragment === "") { + fragment = "." + directorySeparator; + } + fragment = ensureTrailingDirectorySeparator(fragment); + const absolutePath = resolvePath(scriptDirectory, fragment); + const baseDirectory = hasTrailingDirectorySeparator(absolutePath) ? absolutePath : getDirectoryPath(absolutePath); + if (!moduleSpecifierIsRelative) { + const packageJsonPath = findPackageJson(baseDirectory, host); + if (packageJsonPath) { + const packageJson = readJson(packageJsonPath, host); + const typesVersions = packageJson.typesVersions; + if (typeof typesVersions === "object") { + const versionPaths = (_a2 = getPackageJsonTypesVersionsPaths(typesVersions)) == null ? void 0 : _a2.paths; + if (versionPaths) { + const packageDirectory = getDirectoryPath(packageJsonPath); + const pathInPackage = absolutePath.slice(ensureTrailingDirectorySeparator(packageDirectory).length); + if (addCompletionEntriesFromPaths(result2, pathInPackage, packageDirectory, extensionOptions, host, versionPaths)) { + return result2; + } + } + } + } + } + const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); + if (!tryDirectoryExists(host, baseDirectory)) + return result2; + const files = tryReadDirectory( + host, + baseDirectory, + extensionOptions.extensionsToSearch, + /*exclude*/ + void 0, + /*include*/ + ["./*"] + ); + if (files) { + for (let filePath of files) { + filePath = normalizePath(filePath); + if (exclude && comparePaths(filePath, exclude, scriptDirectory, ignoreCase) === 0) { + continue; + } + const { name: name2, extension } = getFilenameWithExtensionOption( + getBaseFileName(filePath), + host.getCompilationSettings(), + extensionOptions, + /*isExportsWildcard*/ + false + ); + result2.add(nameAndKind(name2, "script", extension)); + } + } + const directories = tryGetDirectories(host, baseDirectory); + if (directories) { + for (const directory of directories) { + const directoryName = getBaseFileName(normalizePath(directory)); + if (directoryName !== "@types") { + result2.add(directoryResult(directoryName)); + } + } + } + return result2; + } + function getFilenameWithExtensionOption(name2, compilerOptions, extensionOptions, isExportsWildcard) { + const nonJsResult = ts_moduleSpecifiers_exports.tryGetRealFileNameForNonJsDeclarationFileName(name2); + if (nonJsResult) { + return { name: nonJsResult, extension: tryGetExtensionFromPath2(nonJsResult) }; + } + if (extensionOptions.referenceKind === 0) { + return { name: name2, extension: tryGetExtensionFromPath2(name2) }; + } + let allowedEndings = getModuleSpecifierPreferences( + { importModuleSpecifierEnding: extensionOptions.endingPreference }, + compilerOptions, + extensionOptions.importingSourceFile + ).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode); + if (isExportsWildcard) { + allowedEndings = allowedEndings.filter( + (e10) => e10 !== 0 && e10 !== 1 + /* Index */ + ); + } + if (allowedEndings[0] === 3) { + if (fileExtensionIsOneOf(name2, supportedTSImplementationExtensions)) { + return { name: name2, extension: tryGetExtensionFromPath2(name2) }; + } + const outputExtension2 = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name2, compilerOptions); + return outputExtension2 ? { name: changeExtension(name2, outputExtension2), extension: outputExtension2 } : { name: name2, extension: tryGetExtensionFromPath2(name2) }; + } + if (!isExportsWildcard && (allowedEndings[0] === 0 || allowedEndings[0] === 1) && fileExtensionIsOneOf(name2, [ + ".js", + ".jsx", + ".ts", + ".tsx", + ".d.ts" + /* Dts */ + ])) { + return { name: removeFileExtension(name2), extension: tryGetExtensionFromPath2(name2) }; + } + const outputExtension = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name2, compilerOptions); + return outputExtension ? { name: changeExtension(name2, outputExtension), extension: outputExtension } : { name: name2, extension: tryGetExtensionFromPath2(name2) }; + } + function addCompletionEntriesFromPaths(result2, fragment, baseDirectory, extensionOptions, host, paths) { + const getPatternsForKey = (key) => paths[key]; + const comparePaths2 = (a7, b8) => { + const patternA = tryParsePattern(a7); + const patternB = tryParsePattern(b8); + const lengthA = typeof patternA === "object" ? patternA.prefix.length : a7.length; + const lengthB = typeof patternB === "object" ? patternB.prefix.length : b8.length; + return compareValues(lengthB, lengthA); + }; + return addCompletionEntriesFromPathsOrExports( + result2, + /*isExports*/ + false, + fragment, + baseDirectory, + extensionOptions, + host, + getOwnKeys(paths), + getPatternsForKey, + comparePaths2 + ); + } + function addCompletionEntriesFromPathsOrExports(result2, isExports, fragment, baseDirectory, extensionOptions, host, keys2, getPatternsForKey, comparePaths2) { + let pathResults = []; + let matchedPath; + for (const key of keys2) { + if (key === ".") + continue; + const keyWithoutLeadingDotSlash = key.replace(/^\.\//, ""); + const patterns = getPatternsForKey(key); + if (patterns) { + const pathPattern = tryParsePattern(keyWithoutLeadingDotSlash); + if (!pathPattern) + continue; + const isMatch2 = typeof pathPattern === "object" && isPatternMatch(pathPattern, fragment); + const isLongestMatch = isMatch2 && (matchedPath === void 0 || comparePaths2(key, matchedPath) === -1); + if (isLongestMatch) { + matchedPath = key; + pathResults = pathResults.filter((r8) => !r8.matchedPattern); + } + if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths2(key, matchedPath) !== 1) { + pathResults.push({ + matchedPattern: isMatch2, + results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch2, host).map(({ name: name2, kind, extension }) => nameAndKind(name2, kind, extension)) + }); + } + } + } + pathResults.forEach((pathResult) => pathResult.results.forEach((r8) => result2.add(r8))); + return matchedPath !== void 0; + } + function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, compilerOptions, host, extensionOptions, typeChecker) { + const { baseUrl, paths } = compilerOptions; + const result2 = createNameAndKindSet(); + const moduleResolution = getEmitModuleResolutionKind(compilerOptions); + if (baseUrl) { + const absolute = normalizePath(combinePaths(host.getCurrentDirectory(), baseUrl)); + getCompletionEntriesForDirectoryFragment( + fragment, + absolute, + extensionOptions, + host, + /*moduleSpecifierIsRelative*/ + false, + /*exclude*/ + void 0, + result2 + ); + } + if (paths) { + const absolute = getPathsBasePath(compilerOptions, host); + addCompletionEntriesFromPaths(result2, fragment, absolute, extensionOptions, host, paths); + } + const fragmentDirectory = getFragmentDirectory(fragment); + for (const ambientName of getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker)) { + result2.add(nameAndKind( + ambientName, + "external module name", + /*extension*/ + void 0 + )); + } + getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result2); + if (moduleResolutionUsesNodeModules(moduleResolution)) { + let foundGlobal = false; + if (fragmentDirectory === void 0) { + for (const moduleName3 of enumerateNodeModulesVisibleToScript(host, scriptPath)) { + const moduleResult = nameAndKind( + moduleName3, + "external module name", + /*extension*/ + void 0 + ); + if (!result2.has(moduleResult.name)) { + foundGlobal = true; + result2.add(moduleResult); + } + } + } + if (!foundGlobal) { + let ancestorLookup = (ancestor) => { + const nodeModules = combinePaths(ancestor, "node_modules"); + if (tryDirectoryExists(host, nodeModules)) { + getCompletionEntriesForDirectoryFragment( + fragment, + nodeModules, + extensionOptions, + host, + /*moduleSpecifierIsRelative*/ + false, + /*exclude*/ + void 0, + result2 + ); + } + }; + if (fragmentDirectory && getResolvePackageJsonExports(compilerOptions)) { + const nodeModulesDirectoryLookup = ancestorLookup; + ancestorLookup = (ancestor) => { + const components = getPathComponents(fragment); + components.shift(); + let packagePath = components.shift(); + if (!packagePath) { + return nodeModulesDirectoryLookup(ancestor); + } + if (startsWith2(packagePath, "@")) { + const subName = components.shift(); + if (!subName) { + return nodeModulesDirectoryLookup(ancestor); + } + packagePath = combinePaths(packagePath, subName); + } + const packageDirectory = combinePaths(ancestor, "node_modules", packagePath); + const packageFile = combinePaths(packageDirectory, "package.json"); + if (tryFileExists(host, packageFile)) { + const packageJson = readJson(packageFile, host); + const exports29 = packageJson.exports; + if (exports29) { + if (typeof exports29 !== "object" || exports29 === null) { + return; + } + const keys2 = getOwnKeys(exports29); + const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : ""); + const conditions = getConditions(compilerOptions, mode); + addCompletionEntriesFromPathsOrExports( + result2, + /*isExports*/ + true, + fragmentSubpath, + packageDirectory, + extensionOptions, + host, + keys2, + (key) => singleElementArray(getPatternFromFirstMatchingCondition(exports29[key], conditions)), + comparePatternKeys + ); + return; + } + } + return nodeModulesDirectoryLookup(ancestor); + }; + } + forEachAncestorDirectory(scriptPath, ancestorLookup); + } + } + return arrayFrom(result2.values()); + } + function getPatternFromFirstMatchingCondition(target, conditions) { + if (typeof target === "string") { + return target; + } + if (target && typeof target === "object" && !isArray3(target)) { + for (const condition in target) { + if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) { + const pattern5 = target[condition]; + return getPatternFromFirstMatchingCondition(pattern5, conditions); + } + } + } + } + function getFragmentDirectory(fragment) { + return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0; + } + function getCompletionsForPathMapping(path2, patterns, fragment, packageDirectory, extensionOptions, isExportsWildcard, host) { + if (!endsWith2(path2, "*")) { + return !path2.includes("*") ? justPathMappingName( + path2, + "script" + /* scriptElement */ + ) : emptyArray; + } + const pathPrefix = path2.slice(0, path2.length - 1); + const remainingFragment = tryRemovePrefix(fragment, pathPrefix); + if (remainingFragment === void 0) { + const starIsFullPathComponent = path2[path2.length - 2] === "/"; + return starIsFullPathComponent ? justPathMappingName( + pathPrefix, + "directory" + /* directory */ + ) : flatMap2(patterns, (pattern5) => { + var _a2; + return (_a2 = getModulesForPathsPattern("", packageDirectory, pattern5, extensionOptions, isExportsWildcard, host)) == null ? void 0 : _a2.map(({ name: name2, ...rest2 }) => ({ name: pathPrefix + name2, ...rest2 })); + }); + } + return flatMap2(patterns, (pattern5) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern5, extensionOptions, isExportsWildcard, host)); + function justPathMappingName(name2, kind) { + return startsWith2(name2, fragment) ? [{ name: removeTrailingDirectorySeparator(name2), kind, extension: void 0 }] : emptyArray; + } + } + function getModulesForPathsPattern(fragment, packageDirectory, pattern5, extensionOptions, isExportsWildcard, host) { + if (!host.readDirectory) { + return void 0; + } + const parsed = tryParsePattern(pattern5); + if (parsed === void 0 || isString4(parsed)) { + return void 0; + } + const normalizedPrefix = resolvePath(parsed.prefix); + const normalizedPrefixDirectory = hasTrailingDirectorySeparator(parsed.prefix) ? normalizedPrefix : getDirectoryPath(normalizedPrefix); + const normalizedPrefixBase = hasTrailingDirectorySeparator(parsed.prefix) ? "" : getBaseFileName(normalizedPrefix); + const fragmentHasPath = containsSlash(fragment); + const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0; + const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory; + const normalizedSuffix = normalizePath(parsed.suffix); + const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix); + const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix]; + const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory)); + const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"]; + const matches2 = mapDefined(tryReadDirectory( + host, + baseDirectory, + extensionOptions.extensionsToSearch, + /*exclude*/ + void 0, + includeGlobs + ), (match) => { + const trimmedWithPattern = trimPrefixAndSuffix(match); + if (trimmedWithPattern) { + if (containsSlash(trimmedWithPattern)) { + return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]); + } + const { name: name2, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions, isExportsWildcard); + return nameAndKind(name2, "script", extension); + } + }); + const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir2) => dir2 === "node_modules" ? void 0 : directoryResult(dir2)); + return [...matches2, ...directories]; + function trimPrefixAndSuffix(path2) { + return firstDefined(matchingSuffixes, (suffix) => { + const inner = withoutStartAndEnd(normalizePath(path2), completePrefix, suffix); + return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner); + }); + } + } + function withoutStartAndEnd(s7, start, end) { + return startsWith2(s7, start) && endsWith2(s7, end) ? s7.slice(start.length, s7.length - end.length) : void 0; + } + function removeLeadingDirectorySeparator(path2) { + return path2[0] === directorySeparator ? path2.slice(1) : path2; + } + function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) { + const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name)); + const nonRelativeModuleNames = ambientModules.filter((moduleName3) => startsWith2(moduleName3, fragment) && !moduleName3.includes("*")); + if (fragmentDirectory !== void 0) { + const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory); + return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator)); + } + return nonRelativeModuleNames; + } + function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) { + const token = getTokenAtPosition(sourceFile, position); + const commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos); + const range2 = commentRanges && find2(commentRanges, (commentRange) => position >= commentRange.pos && position <= commentRange.end); + if (!range2) { + return void 0; + } + const text = sourceFile.text.slice(range2.pos, position); + const match = tripleSlashDirectiveFragmentRegex.exec(text); + if (!match) { + return void 0; + } + const [, prefix, kind, toComplete] = match; + const scriptPath = getDirectoryPath(sourceFile.path); + const names = kind === "path" ? getCompletionEntriesForDirectoryFragment( + toComplete, + scriptPath, + getExtensionOptions(compilerOptions, 0, sourceFile), + host, + /*moduleSpecifierIsRelative*/ + true, + sourceFile.path + ) : kind === "types" ? getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, 1, sourceFile)) : Debug.fail(); + return addReplacementSpans(toComplete, range2.pos + prefix.length, arrayFrom(names.values())); + } + function getCompletionEntriesFromTypings(host, options, scriptPath, fragmentDirectory, extensionOptions, result2 = createNameAndKindSet()) { + const seen = /* @__PURE__ */ new Map(); + const typeRoots = tryAndIgnoreErrors(() => getEffectiveTypeRoots(options, host)) || emptyArray; + for (const root2 of typeRoots) { + getCompletionEntriesFromDirectories(root2); + } + for (const packageJson of findPackageJsons(scriptPath, host)) { + const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types"); + getCompletionEntriesFromDirectories(typesDir); + } + return result2; + function getCompletionEntriesFromDirectories(directory) { + if (!tryDirectoryExists(host, directory)) + return; + for (const typeDirectoryName of tryGetDirectories(host, directory)) { + const packageName = unmangleScopedPackageName(typeDirectoryName); + if (options.types && !contains2(options.types, packageName)) + continue; + if (fragmentDirectory === void 0) { + if (!seen.has(packageName)) { + result2.add(nameAndKind( + packageName, + "external module name", + /*extension*/ + void 0 + )); + seen.set(packageName, true); + } + } else { + const baseDirectory = combinePaths(directory, typeDirectoryName); + const remainingFragment = tryRemoveDirectoryPrefix(fragmentDirectory, packageName, hostGetCanonicalFileName(host)); + if (remainingFragment !== void 0) { + getCompletionEntriesForDirectoryFragment( + remainingFragment, + baseDirectory, + extensionOptions, + host, + /*moduleSpecifierIsRelative*/ + false, + /*exclude*/ + void 0, + result2 + ); + } + } + } + } + } + function enumerateNodeModulesVisibleToScript(host, scriptPath) { + if (!host.readFile || !host.fileExists) + return emptyArray; + const result2 = []; + for (const packageJson of findPackageJsons(scriptPath, host)) { + const contents = readJson(packageJson, host); + for (const key of nodeModulesDependencyKeys) { + const dependencies = contents[key]; + if (!dependencies) + continue; + for (const dep in dependencies) { + if (hasProperty(dependencies, dep) && !startsWith2(dep, "@types/")) { + result2.push(dep); + } + } + } + } + return result2; + } + function getDirectoryFragmentTextSpan(text, textStart) { + const index4 = Math.max(text.lastIndexOf(directorySeparator), text.lastIndexOf(altDirectorySeparator)); + const offset = index4 !== -1 ? index4 + 1 : 0; + const length2 = text.length - offset; + return length2 === 0 || isIdentifierText( + text.substr(offset, length2), + 99 + /* ESNext */ + ) ? void 0 : createTextSpan(textStart + offset, length2); + } + function isPathRelativeToScript(path2) { + if (path2 && path2.length >= 2 && path2.charCodeAt(0) === 46) { + const slashIndex = path2.length >= 3 && path2.charCodeAt(1) === 46 ? 2 : 1; + const slashCharCode = path2.charCodeAt(slashIndex); + return slashCharCode === 47 || slashCharCode === 92; + } + return false; + } + function containsSlash(fragment) { + return fragment.includes(directorySeparator); + } + function isRequireCallArgument(node) { + return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require"; + } + var kindPrecedence, tripleSlashDirectiveFragmentRegex, nodeModulesDependencyKeys; + var init_stringCompletions = __esm2({ + "src/services/stringCompletions.ts"() { + "use strict"; + init_moduleSpecifiers(); + init_ts4(); + init_ts_Completions(); + kindPrecedence = { + [ + "directory" + /* directory */ + ]: 0, + [ + "script" + /* scriptElement */ + ]: 1, + [ + "external module name" + /* externalModuleName */ + ]: 2 + }; + tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* getStringLiteralCompletionDetails, + getStringLiteralCompletions: () => getStringLiteralCompletions + }); + var init_ts_Completions_StringCompletions = __esm2({ + "src/services/_namespaces/ts.Completions.StringCompletions.ts"() { + "use strict"; + init_stringCompletions(); + } + }); + var ts_Completions_exports = {}; + __export2(ts_Completions_exports, { + CompletionKind: () => CompletionKind, + CompletionSource: () => CompletionSource, + SortText: () => SortText, + StringCompletions: () => ts_Completions_StringCompletions_exports, + SymbolOriginInfoKind: () => SymbolOriginInfoKind, + createCompletionDetails: () => createCompletionDetails, + createCompletionDetailsForSymbol: () => createCompletionDetailsForSymbol, + getCompletionEntriesFromSymbols: () => getCompletionEntriesFromSymbols, + getCompletionEntryDetails: () => getCompletionEntryDetails, + getCompletionEntrySymbol: () => getCompletionEntrySymbol, + getCompletionsAtPosition: () => getCompletionsAtPosition, + getPropertiesForObjectExpression: () => getPropertiesForObjectExpression, + moduleSpecifierResolutionCacheAttemptLimit: () => moduleSpecifierResolutionCacheAttemptLimit, + moduleSpecifierResolutionLimit: () => moduleSpecifierResolutionLimit + }); + var init_ts_Completions = __esm2({ + "src/services/_namespaces/ts.Completions.ts"() { + "use strict"; + init_completions(); + init_ts_Completions_StringCompletions(); + } + }); + function createImportTracker(sourceFiles, sourceFilesSet, checker, cancellationToken) { + const allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken); + return (exportSymbol, exportInfo, isForRename) => { + const { directImports, indirectUsers } = getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, exportInfo, checker, cancellationToken); + return { indirectUsers, ...getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename) }; + }; + } + function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, { exportingModuleSymbol, exportKind }, checker, cancellationToken) { + const markSeenDirectImport = nodeSeenTracker(); + const markSeenIndirectUser = nodeSeenTracker(); + const directImports = []; + const isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports; + const indirectUserDeclarations = isAvailableThroughGlobal ? void 0 : []; + handleDirectImports(exportingModuleSymbol); + return { directImports, indirectUsers: getIndirectUsers() }; + function getIndirectUsers() { + if (isAvailableThroughGlobal) { + return sourceFiles; + } + if (exportingModuleSymbol.declarations) { + for (const decl of exportingModuleSymbol.declarations) { + if (isExternalModuleAugmentation(decl) && sourceFilesSet.has(decl.getSourceFile().fileName)) { + addIndirectUser(decl); + } + } + } + return indirectUserDeclarations.map(getSourceFileOfNode); + } + function handleDirectImports(exportingModuleSymbol2) { + const theseDirectImports = getDirectImports(exportingModuleSymbol2); + if (theseDirectImports) { + for (const direct of theseDirectImports) { + if (!markSeenDirectImport(direct)) { + continue; + } + if (cancellationToken) + cancellationToken.throwIfCancellationRequested(); + switch (direct.kind) { + case 213: + if (isImportCall(direct)) { + handleImportCall(direct); + break; + } + if (!isAvailableThroughGlobal) { + const parent22 = direct.parent; + if (exportKind === 2 && parent22.kind === 260) { + const { name: name2 } = parent22; + if (name2.kind === 80) { + directImports.push(name2); + break; + } + } + } + break; + case 80: + break; + case 271: + handleNamespaceImport( + direct, + direct.name, + hasSyntacticModifier( + direct, + 32 + /* Export */ + ), + /*alreadyAddedDirect*/ + false + ); + break; + case 272: + directImports.push(direct); + const namedBindings = direct.importClause && direct.importClause.namedBindings; + if (namedBindings && namedBindings.kind === 274) { + handleNamespaceImport( + direct, + namedBindings.name, + /*isReExport*/ + false, + /*alreadyAddedDirect*/ + true + ); + } else if (!isAvailableThroughGlobal && isDefaultImport(direct)) { + addIndirectUser(getSourceFileLikeForImportDeclaration(direct)); + } + break; + case 278: + if (!direct.exportClause) { + handleDirectImports(getContainingModuleSymbol(direct, checker)); + } else if (direct.exportClause.kind === 280) { + addIndirectUser( + getSourceFileLikeForImportDeclaration(direct), + /*addTransitiveDependencies*/ + true + ); + } else { + directImports.push(direct); + } + break; + case 205: + if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported2(direct)) { + addIndirectUser( + direct.getSourceFile(), + /*addTransitiveDependencies*/ + true + ); + } + directImports.push(direct); + break; + default: + Debug.failBadSyntaxKind(direct, "Unexpected import kind."); + } + } + } + } + function handleImportCall(importCall) { + const top = findAncestor(importCall, isAmbientModuleDeclaration) || importCall.getSourceFile(); + addIndirectUser( + top, + /** addTransitiveDependencies */ + !!isExported2( + importCall, + /*stopAtAmbientModule*/ + true + ) + ); + } + function isExported2(node, stopAtAmbientModule = false) { + return findAncestor(node, (node2) => { + if (stopAtAmbientModule && isAmbientModuleDeclaration(node2)) + return "quit"; + return canHaveModifiers(node2) && some2(node2.modifiers, isExportModifier); + }); + } + function handleNamespaceImport(importDeclaration, name2, isReExport, alreadyAddedDirect) { + if (exportKind === 2) { + if (!alreadyAddedDirect) + directImports.push(importDeclaration); + } else if (!isAvailableThroughGlobal) { + const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); + Debug.assert( + sourceFileLike.kind === 312 || sourceFileLike.kind === 267 + /* ModuleDeclaration */ + ); + if (isReExport || findNamespaceReExports(sourceFileLike, name2, checker)) { + addIndirectUser( + sourceFileLike, + /*addTransitiveDependencies*/ + true + ); + } else { + addIndirectUser(sourceFileLike); + } + } + } + function addIndirectUser(sourceFileLike, addTransitiveDependencies = false) { + Debug.assert(!isAvailableThroughGlobal); + const isNew = markSeenIndirectUser(sourceFileLike); + if (!isNew) + return; + indirectUserDeclarations.push(sourceFileLike); + if (!addTransitiveDependencies) + return; + const moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol); + if (!moduleSymbol) + return; + Debug.assert(!!(moduleSymbol.flags & 1536)); + const directImports2 = getDirectImports(moduleSymbol); + if (directImports2) { + for (const directImport of directImports2) { + if (!isImportTypeNode(directImport)) { + addIndirectUser( + getSourceFileLikeForImportDeclaration(directImport), + /*addTransitiveDependencies*/ + true + ); + } + } + } + } + function getDirectImports(moduleSymbol) { + return allDirectImports.get(getSymbolId(moduleSymbol).toString()); + } + } + function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, checker, isForRename) { + const importSearches = []; + const singleReferences = []; + function addSearch(location2, symbol) { + importSearches.push([location2, symbol]); + } + if (directImports) { + for (const decl of directImports) { + handleImport(decl); + } + } + return { importSearches, singleReferences }; + function handleImport(decl) { + if (decl.kind === 271) { + if (isExternalModuleImportEquals(decl)) { + handleNamespaceImportLike(decl.name); + } + return; + } + if (decl.kind === 80) { + handleNamespaceImportLike(decl); + return; + } + if (decl.kind === 205) { + if (decl.qualifier) { + const firstIdentifier = getFirstIdentifier(decl.qualifier); + if (firstIdentifier.escapedText === symbolName(exportSymbol)) { + singleReferences.push(firstIdentifier); + } + } else if (exportKind === 2) { + singleReferences.push(decl.argument.literal); + } + return; + } + if (decl.moduleSpecifier.kind !== 11) { + return; + } + if (decl.kind === 278) { + if (decl.exportClause && isNamedExports(decl.exportClause)) { + searchForNamedImport(decl.exportClause); + } + return; + } + const { name: name2, namedBindings } = decl.importClause || { name: void 0, namedBindings: void 0 }; + if (namedBindings) { + switch (namedBindings.kind) { + case 274: + handleNamespaceImportLike(namedBindings.name); + break; + case 275: + if (exportKind === 0 || exportKind === 1) { + searchForNamedImport(namedBindings); + } + break; + default: + Debug.assertNever(namedBindings); + } + } + if (name2 && (exportKind === 1 || exportKind === 2) && (!isForRename || name2.escapedText === symbolEscapedNameNoDefault(exportSymbol))) { + const defaultImportAlias = checker.getSymbolAtLocation(name2); + addSearch(name2, defaultImportAlias); + } + } + function handleNamespaceImportLike(importName) { + if (exportKind === 2 && (!isForRename || isNameMatch(importName.escapedText))) { + addSearch(importName, checker.getSymbolAtLocation(importName)); + } + } + function searchForNamedImport(namedBindings) { + if (!namedBindings) { + return; + } + for (const element of namedBindings.elements) { + const { name: name2, propertyName } = element; + if (!isNameMatch((propertyName || name2).escapedText)) { + continue; + } + if (propertyName) { + singleReferences.push(propertyName); + if (!isForRename || name2.escapedText === exportSymbol.escapedName) { + addSearch(name2, checker.getSymbolAtLocation(name2)); + } + } else { + const localSymbol = element.kind === 281 && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name2); + addSearch(name2, localSymbol); + } + } + } + function isNameMatch(name2) { + return name2 === exportSymbol.escapedName || exportKind !== 0 && name2 === "default"; + } + } + function findNamespaceReExports(sourceFileLike, name2, checker) { + const namespaceImportSymbol = checker.getSymbolAtLocation(name2); + return !!forEachPossibleImportOrExportStatement(sourceFileLike, (statement) => { + if (!isExportDeclaration(statement)) + return; + const { exportClause, moduleSpecifier } = statement; + return !moduleSpecifier && exportClause && isNamedExports(exportClause) && exportClause.elements.some((element) => checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol); + }); + } + function findModuleReferences(program, sourceFiles, searchModuleSymbol) { + var _a2; + const refs = []; + const checker = program.getTypeChecker(); + for (const referencingFile of sourceFiles) { + const searchSourceFile = searchModuleSymbol.valueDeclaration; + if ((searchSourceFile == null ? void 0 : searchSourceFile.kind) === 312) { + for (const ref of referencingFile.referencedFiles) { + if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { + refs.push({ kind: "reference", referencingFile, ref }); + } + } + for (const ref of referencingFile.typeReferenceDirectives) { + const referenced = (_a2 = program.getResolvedTypeReferenceDirectives().get(ref.fileName, ref.resolutionMode || referencingFile.impliedNodeFormat)) == null ? void 0 : _a2.resolvedTypeReferenceDirective; + if (referenced !== void 0 && referenced.resolvedFileName === searchSourceFile.fileName) { + refs.push({ kind: "reference", referencingFile, ref }); + } + } + } + forEachImport(referencingFile, (importDecl, moduleSpecifier) => { + const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol === searchModuleSymbol) { + refs.push(nodeIsSynthesized(importDecl) ? { kind: "implicit", literal: moduleSpecifier, referencingFile } : { kind: "import", literal: moduleSpecifier }); + } + }); + } + return refs; + } + function getDirectImportsMap(sourceFiles, checker, cancellationToken) { + const map22 = /* @__PURE__ */ new Map(); + for (const sourceFile of sourceFiles) { + if (cancellationToken) + cancellationToken.throwIfCancellationRequested(); + forEachImport(sourceFile, (importDecl, moduleSpecifier) => { + const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier); + if (moduleSymbol) { + const id = getSymbolId(moduleSymbol).toString(); + let imports = map22.get(id); + if (!imports) { + map22.set(id, imports = []); + } + imports.push(importDecl); + } + }); + } + return map22; + } + function forEachPossibleImportOrExportStatement(sourceFileLike, action) { + return forEach4(sourceFileLike.kind === 312 ? sourceFileLike.statements : sourceFileLike.body.statements, (statement) => ( + // TODO: GH#18217 + action(statement) || isAmbientModuleDeclaration(statement) && forEach4(statement.body && statement.body.statements, action) + )); + } + function forEachImport(sourceFile, action) { + if (sourceFile.externalModuleIndicator || sourceFile.imports !== void 0) { + for (const i7 of sourceFile.imports) { + action(importFromModuleSpecifier(i7), i7); + } + } else { + forEachPossibleImportOrExportStatement(sourceFile, (statement) => { + switch (statement.kind) { + case 278: + case 272: { + const decl = statement; + if (decl.moduleSpecifier && isStringLiteral(decl.moduleSpecifier)) { + action(decl, decl.moduleSpecifier); + } + break; + } + case 271: { + const decl = statement; + if (isExternalModuleImportEquals(decl)) { + action(decl, decl.moduleReference.expression); + } + break; + } + } + }); + } + } + function getImportOrExportSymbol(node, symbol, checker, comingFromExport) { + return comingFromExport ? getExport() : getExport() || getImport(); + function getExport() { + var _a2; + const { parent: parent22 } = node; + const grandparent = parent22.parent; + if (symbol.exportSymbol) { + if (parent22.kind === 211) { + return ((_a2 = symbol.declarations) == null ? void 0 : _a2.some((d7) => d7 === parent22)) && isBinaryExpression(grandparent) ? getSpecialPropertyExport( + grandparent, + /*useLhsSymbol*/ + false + ) : void 0; + } else { + return exportInfo(symbol.exportSymbol, getExportKindForDeclaration(parent22)); + } + } else { + const exportNode = getExportNode(parent22, node); + if (exportNode && hasSyntacticModifier( + exportNode, + 32 + /* Export */ + )) { + if (isImportEqualsDeclaration(exportNode) && exportNode.moduleReference === node) { + if (comingFromExport) { + return void 0; + } + const lhsSymbol = checker.getSymbolAtLocation(exportNode.name); + return { kind: 0, symbol: lhsSymbol }; + } else { + return exportInfo(symbol, getExportKindForDeclaration(exportNode)); + } + } else if (isNamespaceExport(parent22)) { + return exportInfo( + symbol, + 0 + /* Named */ + ); + } else if (isExportAssignment(parent22)) { + return getExportAssignmentExport(parent22); + } else if (isExportAssignment(grandparent)) { + return getExportAssignmentExport(grandparent); + } else if (isBinaryExpression(parent22)) { + return getSpecialPropertyExport( + parent22, + /*useLhsSymbol*/ + true + ); + } else if (isBinaryExpression(grandparent)) { + return getSpecialPropertyExport( + grandparent, + /*useLhsSymbol*/ + true + ); + } else if (isJSDocTypedefTag(parent22) || isJSDocCallbackTag(parent22)) { + return exportInfo( + symbol, + 0 + /* Named */ + ); + } + } + function getExportAssignmentExport(ex) { + if (!ex.symbol.parent) + return void 0; + const exportKind = ex.isExportEquals ? 2 : 1; + return { kind: 1, symbol, exportInfo: { exportingModuleSymbol: ex.symbol.parent, exportKind } }; + } + function getSpecialPropertyExport(node2, useLhsSymbol) { + let kind; + switch (getAssignmentDeclarationKind(node2)) { + case 1: + kind = 0; + break; + case 2: + kind = 2; + break; + default: + return void 0; + } + const sym = useLhsSymbol ? checker.getSymbolAtLocation(getNameOfAccessExpression(cast(node2.left, isAccessExpression))) : symbol; + return sym && exportInfo(sym, kind); + } + } + function getImport() { + const isImport3 = isNodeImport(node); + if (!isImport3) + return void 0; + let importedSymbol = checker.getImmediateAliasedSymbol(symbol); + if (!importedSymbol) + return void 0; + importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker); + if (importedSymbol.escapedName === "export=") { + importedSymbol = getExportEqualsLocalSymbol(importedSymbol, checker); + if (importedSymbol === void 0) + return void 0; + } + const importedName = symbolEscapedNameNoDefault(importedSymbol); + if (importedName === void 0 || importedName === "default" || importedName === symbol.escapedName) { + return { kind: 0, symbol: importedSymbol }; + } + } + function exportInfo(symbol2, kind) { + const exportInfo2 = getExportInfo(symbol2, kind, checker); + return exportInfo2 && { kind: 1, symbol: symbol2, exportInfo: exportInfo2 }; + } + function getExportKindForDeclaration(node2) { + return hasSyntacticModifier( + node2, + 2048 + /* Default */ + ) ? 1 : 0; + } + } + function getExportEqualsLocalSymbol(importedSymbol, checker) { + var _a2, _b; + if (importedSymbol.flags & 2097152) { + return checker.getImmediateAliasedSymbol(importedSymbol); + } + const decl = Debug.checkDefined(importedSymbol.valueDeclaration); + if (isExportAssignment(decl)) { + return (_a2 = tryCast(decl.expression, canHaveSymbol)) == null ? void 0 : _a2.symbol; + } else if (isBinaryExpression(decl)) { + return (_b = tryCast(decl.right, canHaveSymbol)) == null ? void 0 : _b.symbol; + } else if (isSourceFile(decl)) { + return decl.symbol; + } + return void 0; + } + function getExportNode(parent22, node) { + const declaration = isVariableDeclaration(parent22) ? parent22 : isBindingElement(parent22) ? walkUpBindingElementsAndPatterns(parent22) : void 0; + if (declaration) { + return parent22.name !== node ? void 0 : isCatchClause(declaration.parent) ? void 0 : isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : void 0; + } else { + return parent22; + } + } + function isNodeImport(node) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 271: + return parent22.name === node && isExternalModuleImportEquals(parent22); + case 276: + return !parent22.propertyName; + case 273: + case 274: + Debug.assert(parent22.name === node); + return true; + case 208: + return isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(parent22.parent.parent); + default: + return false; + } + } + function getExportInfo(exportSymbol, exportKind, checker) { + const moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return void 0; + const exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); + return isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : void 0; + } + function skipExportSpecifierSymbol(symbol, checker) { + if (symbol.declarations) { + for (const declaration of symbol.declarations) { + if (isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { + return checker.getExportSpecifierLocalTargetSymbol(declaration) || symbol; + } else if (isPropertyAccessExpression(declaration) && isModuleExportsAccessExpression(declaration.expression) && !isPrivateIdentifier(declaration.name)) { + return checker.getSymbolAtLocation(declaration); + } else if (isShorthandPropertyAssignment(declaration) && isBinaryExpression(declaration.parent.parent) && getAssignmentDeclarationKind(declaration.parent.parent) === 2) { + return checker.getExportSpecifierLocalTargetSymbol(declaration.name); + } + } + } + return symbol; + } + function getContainingModuleSymbol(importer, checker) { + return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); + } + function getSourceFileLikeForImportDeclaration(node) { + if (node.kind === 213) { + return node.getSourceFile(); + } + const { parent: parent22 } = node; + if (parent22.kind === 312) { + return parent22; + } + Debug.assert( + parent22.kind === 268 + /* ModuleBlock */ + ); + return cast(parent22.parent, isAmbientModuleDeclaration); + } + function isAmbientModuleDeclaration(node) { + return node.kind === 267 && node.name.kind === 11; + } + function isExternalModuleImportEquals(eq2) { + return eq2.moduleReference.kind === 283 && eq2.moduleReference.expression.kind === 11; + } + var ExportKind2, ImportExport; + var init_importTracker = __esm2({ + "src/services/importTracker.ts"() { + "use strict"; + init_ts4(); + ExportKind2 = /* @__PURE__ */ ((ExportKind3) => { + ExportKind3[ExportKind3["Named"] = 0] = "Named"; + ExportKind3[ExportKind3["Default"] = 1] = "Default"; + ExportKind3[ExportKind3["ExportEquals"] = 2] = "ExportEquals"; + return ExportKind3; + })(ExportKind2 || {}); + ImportExport = /* @__PURE__ */ ((ImportExport2) => { + ImportExport2[ImportExport2["Import"] = 0] = "Import"; + ImportExport2[ImportExport2["Export"] = 1] = "Export"; + return ImportExport2; + })(ImportExport || {}); + } + }); + function nodeEntry(node, kind = 1) { + return { + kind, + node: node.name || node, + context: getContextNodeForNodeEntry(node) + }; + } + function isContextWithStartAndEndNode(node) { + return node && node.kind === void 0; + } + function getContextNodeForNodeEntry(node) { + if (isDeclaration(node)) { + return getContextNode(node); + } + if (!node.parent) + return void 0; + if (!isDeclaration(node.parent) && !isExportAssignment(node.parent)) { + if (isInJSFile(node)) { + const binaryExpression = isBinaryExpression(node.parent) ? node.parent : isAccessExpression(node.parent) && isBinaryExpression(node.parent.parent) && node.parent.parent.left === node.parent ? node.parent.parent : void 0; + if (binaryExpression && getAssignmentDeclarationKind(binaryExpression) !== 0) { + return getContextNode(binaryExpression); + } + } + if (isJsxOpeningElement(node.parent) || isJsxClosingElement(node.parent)) { + return node.parent.parent; + } else if (isJsxSelfClosingElement(node.parent) || isLabeledStatement(node.parent) || isBreakOrContinueStatement(node.parent)) { + return node.parent; + } else if (isStringLiteralLike(node)) { + const validImport = tryGetImportFromModuleSpecifier(node); + if (validImport) { + const declOrStatement = findAncestor(validImport, (node2) => isDeclaration(node2) || isStatement(node2) || isJSDocTag(node2)); + return isDeclaration(declOrStatement) ? getContextNode(declOrStatement) : declOrStatement; + } + } + const propertyName = findAncestor(node, isComputedPropertyName); + return propertyName ? getContextNode(propertyName.parent) : void 0; + } + if (node.parent.name === node || // node is name of declaration, use parent + isConstructorDeclaration(node.parent) || isExportAssignment(node.parent) || // Property name of the import export specifier or binding pattern, use parent + (isImportOrExportSpecifier(node.parent) || isBindingElement(node.parent)) && node.parent.propertyName === node || // Is default export + node.kind === 90 && hasSyntacticModifier( + node.parent, + 2080 + /* ExportDefault */ + )) { + return getContextNode(node.parent); + } + return void 0; + } + function getContextNode(node) { + if (!node) + return void 0; + switch (node.kind) { + case 260: + return !isVariableDeclarationList(node.parent) || node.parent.declarations.length !== 1 ? node : isVariableStatement(node.parent.parent) ? node.parent.parent : isForInOrOfStatement(node.parent.parent) ? getContextNode(node.parent.parent) : node.parent; + case 208: + return getContextNode(node.parent.parent); + case 276: + return node.parent.parent.parent; + case 281: + case 274: + return node.parent.parent; + case 273: + case 280: + return node.parent; + case 226: + return isExpressionStatement(node.parent) ? node.parent : node; + case 250: + case 249: + return { + start: node.initializer, + end: node.expression + }; + case 303: + case 304: + return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode( + findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2)) + ) : node; + case 255: + return { + start: find2( + node.getChildren(node.getSourceFile()), + (node2) => node2.kind === 109 + /* SwitchKeyword */ + ), + end: node.caseBlock + }; + default: + return node; + } + } + function toContextSpan(textSpan, sourceFile, context2) { + if (!context2) + return void 0; + const contextSpan = isContextWithStartAndEndNode(context2) ? getTextSpan(context2.start, sourceFile, context2.end) : getTextSpan(context2, sourceFile); + return contextSpan.start !== textSpan.start || contextSpan.length !== textSpan.length ? { contextSpan } : void 0; + } + function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { + const node = getTouchingPropertyName(sourceFile, position); + const options = { + use: 1 + /* References */ + }; + const referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); + const checker = program.getTypeChecker(); + const adjustedNode = Core.getAdjustedNode(node, options); + const symbol = isDefinitionForReference(adjustedNode) ? checker.getSymbolAtLocation(adjustedNode) : void 0; + return !referencedSymbols || !referencedSymbols.length ? void 0 : mapDefined(referencedSymbols, ({ definition, references }) => ( + // Only include referenced symbols that have a valid definition. + definition && { + definition: checker.runWithCancellationToken(cancellationToken, (checker2) => definitionToReferencedSymbolDefinitionInfo(definition, checker2, node)), + references: references.map((r8) => toReferencedSymbolEntry(r8, symbol)) + } + )); + } + function isDefinitionForReference(node) { + return node.kind === 90 || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node) || node.kind === 137 && isConstructorDeclaration(node.parent); + } + function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { + const node = getTouchingPropertyName(sourceFile, position); + let referenceEntries; + const entries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); + if (node.parent.kind === 211 || node.parent.kind === 208 || node.parent.kind === 212 || node.kind === 108) { + referenceEntries = entries && [...entries]; + } else if (entries) { + const queue3 = createQueue(entries); + const seenNodes = /* @__PURE__ */ new Map(); + while (!queue3.isEmpty()) { + const entry = queue3.dequeue(); + if (!addToSeen(seenNodes, getNodeId(entry.node))) { + continue; + } + referenceEntries = append(referenceEntries, entry); + const entries2 = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, entry.node, entry.node.pos); + if (entries2) { + queue3.enqueue(...entries2); + } + } + } + const checker = program.getTypeChecker(); + return map4(referenceEntries, (entry) => toImplementationLocation(entry, checker)); + } + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 312) { + return void 0; + } + const checker = program.getTypeChecker(); + if (node.parent.kind === 304) { + const result2 = []; + Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, (node2) => result2.push(nodeEntry(node2))); + return result2; + } else if (node.kind === 108 || isSuperProperty(node.parent)) { + const symbol = checker.getSymbolAtLocation(node); + return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; + } else { + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { + implementations: true, + use: 1 + /* References */ + }); + } + } + function findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, convertEntry) { + return map4(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), (entry) => convertEntry(entry, node, program.getTypeChecker())); + } + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f8) => f8.fileName))) { + return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet)); + } + function flattenEntries(referenceSymbols) { + return referenceSymbols && flatMap2(referenceSymbols, (r8) => r8.references); + } + function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) { + const info2 = (() => { + switch (def.type) { + case 0: { + const { symbol } = def; + const { displayParts: displayParts2, kind: kind2 } = getDefinitionKindAndDisplayParts(symbol, checker, originalNode); + const name22 = displayParts2.map((p7) => p7.text).join(""); + const declaration = symbol.declarations && firstOrUndefined(symbol.declarations); + const node = declaration ? getNameOfDeclaration(declaration) || declaration : originalNode; + return { + ...getFileAndTextSpanFromNode(node), + name: name22, + kind: kind2, + displayParts: displayParts2, + context: getContextNode(declaration) + }; + } + case 1: { + const { node } = def; + return { ...getFileAndTextSpanFromNode(node), name: node.text, kind: "label", displayParts: [displayPart( + node.text, + 17 + /* text */ + )] }; + } + case 2: { + const { node } = def; + const name22 = tokenToString(node.kind); + return { ...getFileAndTextSpanFromNode(node), name: name22, kind: "keyword", displayParts: [{ + text: name22, + kind: "keyword" + /* keyword */ + }] }; + } + case 3: { + const { node } = def; + const symbol = checker.getSymbolAtLocation(node); + const displayParts2 = symbol && ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind( + checker, + symbol, + node.getSourceFile(), + getContainerNode(node), + node + ).displayParts || [textPart("this")]; + return { ...getFileAndTextSpanFromNode(node), name: "this", kind: "var", displayParts: displayParts2 }; + } + case 4: { + const { node } = def; + return { + ...getFileAndTextSpanFromNode(node), + name: node.text, + kind: "var", + displayParts: [displayPart( + getTextOfNode(node), + 8 + /* stringLiteral */ + )] + }; + } + case 5: { + return { + textSpan: createTextSpanFromRange(def.reference), + sourceFile: def.file, + name: def.reference.fileName, + kind: "string", + displayParts: [displayPart( + `"${def.reference.fileName}"`, + 8 + /* stringLiteral */ + )] + }; + } + default: + return Debug.assertNever(def); + } + })(); + const { sourceFile, textSpan, name: name2, kind, displayParts, context: context2 } = info2; + return { + containerKind: "", + containerName: "", + fileName: sourceFile.fileName, + kind, + name: name2, + textSpan, + displayParts, + ...toContextSpan(textSpan, sourceFile, context2) + }; + } + function getFileAndTextSpanFromNode(node) { + const sourceFile = node.getSourceFile(); + return { + sourceFile, + textSpan: getTextSpan(isComputedPropertyName(node) ? node.expression : node, sourceFile) + }; + } + function getDefinitionKindAndDisplayParts(symbol, checker, node) { + const meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol); + const enclosingDeclaration = symbol.declarations && firstOrUndefined(symbol.declarations) || node; + const { displayParts, symbolKind } = ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning); + return { displayParts, kind: symbolKind }; + } + function toRenameLocation(entry, originalNode, checker, providePrefixAndSuffixText, quotePreference) { + return { ...entryToDocumentSpan(entry), ...providePrefixAndSuffixText && getPrefixAndSuffixText(entry, originalNode, checker, quotePreference) }; + } + function toReferencedSymbolEntry(entry, symbol) { + const referenceEntry = toReferenceEntry(entry); + if (!symbol) + return referenceEntry; + return { + ...referenceEntry, + isDefinition: entry.kind !== 0 && isDeclarationOfSymbol(entry.node, symbol) + }; + } + function toReferenceEntry(entry) { + const documentSpan = entryToDocumentSpan(entry); + if (entry.kind === 0) { + return { ...documentSpan, isWriteAccess: false }; + } + const { kind, node } = entry; + return { + ...documentSpan, + isWriteAccess: isWriteAccessForReference(node), + isInString: kind === 2 ? true : void 0 + }; + } + function entryToDocumentSpan(entry) { + if (entry.kind === 0) { + return { textSpan: entry.textSpan, fileName: entry.fileName }; + } else { + const sourceFile = entry.node.getSourceFile(); + const textSpan = getTextSpan(entry.node, sourceFile); + return { + textSpan, + fileName: sourceFile.fileName, + ...toContextSpan(textSpan, sourceFile, entry.context) + }; + } + } + function getPrefixAndSuffixText(entry, originalNode, checker, quotePreference) { + if (entry.kind !== 0 && isIdentifier(originalNode)) { + const { node, kind } = entry; + const parent22 = node.parent; + const name2 = originalNode.text; + const isShorthandAssignment = isShorthandPropertyAssignment(parent22); + if (isShorthandAssignment || isObjectBindingElementWithoutPropertyName(parent22) && parent22.name === node && parent22.dotDotDotToken === void 0) { + const prefixColon = { prefixText: name2 + ": " }; + const suffixColon = { suffixText: ": " + name2 }; + if (kind === 3) { + return prefixColon; + } + if (kind === 4) { + return suffixColon; + } + if (isShorthandAssignment) { + const grandParent = parent22.parent; + if (isObjectLiteralExpression(grandParent) && isBinaryExpression(grandParent.parent) && isModuleExportsAccessExpression(grandParent.parent.left)) { + return prefixColon; + } + return suffixColon; + } else { + return prefixColon; + } + } else if (isImportSpecifier(parent22) && !parent22.propertyName) { + const originalSymbol = isExportSpecifier(originalNode.parent) ? checker.getExportSpecifierLocalTargetSymbol(originalNode.parent) : checker.getSymbolAtLocation(originalNode); + return contains2(originalSymbol.declarations, parent22) ? { prefixText: name2 + " as " } : emptyOptions; + } else if (isExportSpecifier(parent22) && !parent22.propertyName) { + return originalNode === entry.node || checker.getSymbolAtLocation(originalNode) === checker.getSymbolAtLocation(entry.node) ? { prefixText: name2 + " as " } : { suffixText: " as " + name2 }; + } + } + if (entry.kind !== 0 && isNumericLiteral(entry.node) && isAccessExpression(entry.node.parent)) { + const quote2 = getQuoteFromPreference(quotePreference); + return { prefixText: quote2, suffixText: quote2 }; + } + return emptyOptions; + } + function toImplementationLocation(entry, checker) { + const documentSpan = entryToDocumentSpan(entry); + if (entry.kind !== 0) { + const { node } = entry; + return { + ...documentSpan, + ...implementationKindDisplayParts(node, checker) + }; + } else { + return { ...documentSpan, kind: "", displayParts: [] }; + } + } + function implementationKindDisplayParts(node, checker) { + const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); + if (symbol) { + return getDefinitionKindAndDisplayParts(symbol, checker, node); + } else if (node.kind === 210) { + return { + kind: "interface", + displayParts: [punctuationPart( + 21 + /* OpenParenToken */ + ), textPart("object literal"), punctuationPart( + 22 + /* CloseParenToken */ + )] + }; + } else if (node.kind === 231) { + return { + kind: "local class", + displayParts: [punctuationPart( + 21 + /* OpenParenToken */ + ), textPart("anonymous local class"), punctuationPart( + 22 + /* CloseParenToken */ + )] + }; + } else { + return { kind: getNodeKind(node), displayParts: [] }; + } + } + function toHighlightSpan(entry) { + const documentSpan = entryToDocumentSpan(entry); + if (entry.kind === 0) { + return { + fileName: documentSpan.fileName, + span: { + textSpan: documentSpan.textSpan, + kind: "reference" + /* reference */ + } + }; + } + const writeAccess = isWriteAccessForReference(entry.node); + const span = { + textSpan: documentSpan.textSpan, + kind: writeAccess ? "writtenReference" : "reference", + isInString: entry.kind === 2 ? true : void 0, + ...documentSpan.contextSpan && { contextSpan: documentSpan.contextSpan } + }; + return { fileName: documentSpan.fileName, span }; + } + function getTextSpan(node, sourceFile, endNode2) { + let start = node.getStart(sourceFile); + let end = (endNode2 || node).getEnd(); + if (isStringLiteralLike(node) && end - start > 2) { + Debug.assert(endNode2 === void 0); + start += 1; + end -= 1; + } + if ((endNode2 == null ? void 0 : endNode2.kind) === 269) { + end = endNode2.getFullStart(); + } + return createTextSpanFromBounds(start, end); + } + function getTextSpanOfEntry(entry) { + return entry.kind === 0 ? entry.textSpan : getTextSpan(entry.node, entry.node.getSourceFile()); + } + function isWriteAccessForReference(node) { + const decl = getDeclarationFromName(node); + return !!decl && declarationIsWriteAccess(decl) || node.kind === 90 || isWriteAccess(node); + } + function isDeclarationOfSymbol(node, target) { + var _a2; + if (!target) + return false; + const source = getDeclarationFromName(node) || (node.kind === 90 ? node.parent : isLiteralComputedPropertyDeclarationName(node) ? node.parent.parent : node.kind === 137 && isConstructorDeclaration(node.parent) ? node.parent.parent : void 0); + const commonjsSource = source && isBinaryExpression(source) ? source.left : void 0; + return !!(source && ((_a2 = target.declarations) == null ? void 0 : _a2.some((d7) => d7 === source || d7 === commonjsSource))); + } + function declarationIsWriteAccess(decl) { + if (!!(decl.flags & 33554432)) + return true; + switch (decl.kind) { + case 226: + case 208: + case 263: + case 231: + case 90: + case 266: + case 306: + case 281: + case 273: + case 271: + case 276: + case 264: + case 345: + case 353: + case 291: + case 267: + case 270: + case 274: + case 280: + case 169: + case 304: + case 265: + case 168: + return true; + case 303: + return !isArrayLiteralOrObjectLiteralDestructuringPattern(decl.parent); + case 262: + case 218: + case 176: + case 174: + case 177: + case 178: + return !!decl.body; + case 260: + case 172: + return !!decl.initializer || isCatchClause(decl.parent); + case 173: + case 171: + case 355: + case 348: + return false; + default: + return Debug.failBadSyntaxKind(decl); + } + } + var DefinitionKind, EntryKind, FindReferencesUse, Core; + var init_findAllReferences = __esm2({ + "src/services/findAllReferences.ts"() { + "use strict"; + init_ts4(); + init_ts_FindAllReferences(); + DefinitionKind = /* @__PURE__ */ ((DefinitionKind2) => { + DefinitionKind2[DefinitionKind2["Symbol"] = 0] = "Symbol"; + DefinitionKind2[DefinitionKind2["Label"] = 1] = "Label"; + DefinitionKind2[DefinitionKind2["Keyword"] = 2] = "Keyword"; + DefinitionKind2[DefinitionKind2["This"] = 3] = "This"; + DefinitionKind2[DefinitionKind2["String"] = 4] = "String"; + DefinitionKind2[DefinitionKind2["TripleSlashReference"] = 5] = "TripleSlashReference"; + return DefinitionKind2; + })(DefinitionKind || {}); + EntryKind = /* @__PURE__ */ ((EntryKind2) => { + EntryKind2[EntryKind2["Span"] = 0] = "Span"; + EntryKind2[EntryKind2["Node"] = 1] = "Node"; + EntryKind2[EntryKind2["StringLiteral"] = 2] = "StringLiteral"; + EntryKind2[EntryKind2["SearchedLocalFoundProperty"] = 3] = "SearchedLocalFoundProperty"; + EntryKind2[EntryKind2["SearchedPropertyFoundLocal"] = 4] = "SearchedPropertyFoundLocal"; + return EntryKind2; + })(EntryKind || {}); + FindReferencesUse = /* @__PURE__ */ ((FindReferencesUse2) => { + FindReferencesUse2[FindReferencesUse2["Other"] = 0] = "Other"; + FindReferencesUse2[FindReferencesUse2["References"] = 1] = "References"; + FindReferencesUse2[FindReferencesUse2["Rename"] = 2] = "Rename"; + return FindReferencesUse2; + })(FindReferencesUse || {}); + ((Core2) => { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f8) => f8.fileName))) { + var _a2, _b; + node = getAdjustedNode2(node, options); + if (isSourceFile(node)) { + const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program); + if (!(resolvedRef == null ? void 0 : resolvedRef.file)) { + return void 0; + } + const moduleSymbol = program.getTypeChecker().getMergedSymbol(resolvedRef.file.symbol); + if (moduleSymbol) { + return getReferencedSymbolsForModule( + program, + moduleSymbol, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + ); + } + const fileIncludeReasons = program.getFileIncludeReasons(); + if (!fileIncludeReasons) { + return void 0; + } + return [{ + definition: { type: 5, reference: resolvedRef.reference, file: node }, + references: getReferencesForNonModule(resolvedRef.file, fileIncludeReasons, program) || emptyArray + }]; + } + if (!options.implementations) { + const special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); + if (special) { + return special; + } + } + const checker = program.getTypeChecker(); + const symbol = checker.getSymbolAtLocation(isConstructorDeclaration(node) && node.parent.name || node); + if (!symbol) { + if (!options.implementations && isStringLiteralLike(node)) { + if (isModuleSpecifierLike(node)) { + const fileIncludeReasons = program.getFileIncludeReasons(); + const referencedFileName = (_b = (_a2 = program.getResolvedModuleFromModuleSpecifier(node)) == null ? void 0 : _a2.resolvedModule) == null ? void 0 : _b.resolvedFileName; + const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0; + if (referencedFile) { + return [{ definition: { type: 4, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }]; + } + } + return getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken); + } + return void 0; + } + if (symbol.escapedName === "export=") { + return getReferencedSymbolsForModule( + program, + symbol.parent, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + ); + } + const moduleReferences = getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + if (moduleReferences && !(symbol.flags & 33554432)) { + return moduleReferences; + } + const aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker); + const moduleReferencesOfExportTarget = aliasedSymbol && getReferencedSymbolsForModuleIfDeclaredBySourceFile(aliasedSymbol, program, sourceFiles, cancellationToken, options, sourceFilesSet); + const references = getReferencedSymbolsForSymbol(symbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options); + return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget); + } + Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode; + function getAdjustedNode2(node, options) { + if (options.use === 1) { + node = getAdjustedReferenceLocation(node); + } else if (options.use === 2) { + node = getAdjustedRenameLocation(node); + } + return node; + } + Core2.getAdjustedNode = getAdjustedNode2; + function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f8) => f8.fileName))) { + var _a2, _b; + const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol; + if (moduleSymbol) { + return ((_b = getReferencedSymbolsForModule( + program, + moduleSymbol, + /*excludeImportTypeOfExportEquals*/ + false, + sourceFiles, + sourceFilesSet + )[0]) == null ? void 0 : _b.references) || emptyArray; + } + const fileIncludeReasons = program.getFileIncludeReasons(); + const referencedFile = program.getSourceFile(fileName); + return referencedFile && fileIncludeReasons && getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray; + } + Core2.getReferencesForFileName = getReferencesForFileName; + function getReferencesForNonModule(referencedFile, refFileMap, program) { + let entries; + const references = refFileMap.get(referencedFile.path) || emptyArray; + for (const ref of references) { + if (isReferencedFile(ref)) { + const referencingFile = program.getSourceFileByPath(ref.file); + const location2 = getReferencedFileLocation(program, ref); + if (isReferenceFileLocation(location2)) { + entries = append(entries, { + kind: 0, + fileName: referencingFile.fileName, + textSpan: createTextSpanFromRange(location2) + }); + } + } + } + return entries; + } + function getMergedAliasedSymbolOfNamespaceExportDeclaration(node, symbol, checker) { + if (node.parent && isNamespaceExportDeclaration(node.parent)) { + const aliasedSymbol = checker.getAliasedSymbol(symbol); + const targetSymbol = checker.getMergedSymbol(aliasedSymbol); + if (aliasedSymbol !== targetSymbol) { + return targetSymbol; + } + } + return void 0; + } + function getReferencedSymbolsForModuleIfDeclaredBySourceFile(symbol, program, sourceFiles, cancellationToken, options, sourceFilesSet) { + const moduleSourceFile = symbol.flags & 1536 && symbol.declarations && find2(symbol.declarations, isSourceFile); + if (!moduleSourceFile) + return void 0; + const exportEquals = symbol.exports.get( + "export=" + /* ExportEquals */ + ); + const moduleReferences = getReferencedSymbolsForModule(program, symbol, !!exportEquals, sourceFiles, sourceFilesSet); + if (!exportEquals || !sourceFilesSet.has(moduleSourceFile.fileName)) + return moduleReferences; + const checker = program.getTypeChecker(); + symbol = skipAlias(exportEquals, checker); + return mergeReferences(program, moduleReferences, getReferencedSymbolsForSymbol( + symbol, + /*node*/ + void 0, + sourceFiles, + sourceFilesSet, + checker, + cancellationToken, + options + )); + } + function mergeReferences(program, ...referencesToMerge) { + let result2; + for (const references of referencesToMerge) { + if (!references || !references.length) + continue; + if (!result2) { + result2 = references; + continue; + } + for (const entry of references) { + if (!entry.definition || entry.definition.type !== 0) { + result2.push(entry); + continue; + } + const symbol = entry.definition.symbol; + const refIndex = findIndex2(result2, (ref) => !!ref.definition && ref.definition.type === 0 && ref.definition.symbol === symbol); + if (refIndex === -1) { + result2.push(entry); + continue; + } + const reference = result2[refIndex]; + result2[refIndex] = { + definition: reference.definition, + references: reference.references.concat(entry.references).sort((entry1, entry2) => { + const entry1File = getSourceFileIndexOfEntry(program, entry1); + const entry2File = getSourceFileIndexOfEntry(program, entry2); + if (entry1File !== entry2File) { + return compareValues(entry1File, entry2File); + } + const entry1Span = getTextSpanOfEntry(entry1); + const entry2Span = getTextSpanOfEntry(entry2); + return entry1Span.start !== entry2Span.start ? compareValues(entry1Span.start, entry2Span.start) : compareValues(entry1Span.length, entry2Span.length); + }) + }; + } + } + return result2; + } + function getSourceFileIndexOfEntry(program, entry) { + const sourceFile = entry.kind === 0 ? program.getSourceFile(entry.fileName) : entry.node.getSourceFile(); + return program.getSourceFiles().indexOf(sourceFile); + } + function getReferencedSymbolsForModule(program, symbol, excludeImportTypeOfExportEquals, sourceFiles, sourceFilesSet) { + Debug.assert(!!symbol.valueDeclaration); + const references = mapDefined(findModuleReferences(program, sourceFiles, symbol), (reference) => { + if (reference.kind === "import") { + const parent22 = reference.literal.parent; + if (isLiteralTypeNode(parent22)) { + const importType = cast(parent22.parent, isImportTypeNode); + if (excludeImportTypeOfExportEquals && !importType.qualifier) { + return void 0; + } + } + return nodeEntry(reference.literal); + } else if (reference.kind === "implicit") { + const range2 = reference.literal.text !== externalHelpersModuleNameText && forEachChildRecursively( + reference.referencingFile, + (n7) => !(n7.transformFlags & 2) ? "skip" : isJsxElement(n7) || isJsxSelfClosingElement(n7) || isJsxFragment(n7) ? n7 : void 0 + ) || reference.referencingFile.statements[0] || reference.referencingFile; + return nodeEntry(range2); + } else { + return { + kind: 0, + fileName: reference.referencingFile.fileName, + textSpan: createTextSpanFromRange(reference.ref) + }; + } + }); + if (symbol.declarations) { + for (const decl of symbol.declarations) { + switch (decl.kind) { + case 312: + break; + case 267: + if (sourceFilesSet.has(decl.getSourceFile().fileName)) { + references.push(nodeEntry(decl.name)); + } + break; + default: + Debug.assert(!!(symbol.flags & 33554432), "Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); + } + } + } + const exported = symbol.exports.get( + "export=" + /* ExportEquals */ + ); + if (exported == null ? void 0 : exported.declarations) { + for (const decl of exported.declarations) { + const sourceFile = decl.getSourceFile(); + if (sourceFilesSet.has(sourceFile.fileName)) { + const node = isBinaryExpression(decl) && isPropertyAccessExpression(decl.left) ? decl.left.expression : isExportAssignment(decl) ? Debug.checkDefined(findChildOfKind(decl, 95, sourceFile)) : getNameOfDeclaration(decl) || decl; + references.push(nodeEntry(node)); + } + } + } + return references.length ? [{ definition: { type: 0, symbol }, references }] : emptyArray; + } + function isReadonlyTypeOperator(node) { + return node.kind === 148 && isTypeOperatorNode(node.parent) && node.parent.operator === 148; + } + function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { + if (isTypeKeyword(node.kind)) { + if (node.kind === 116 && isVoidExpression(node.parent)) { + return void 0; + } + if (node.kind === 148 && !isReadonlyTypeOperator(node)) { + return void 0; + } + return getAllReferencesForKeyword( + sourceFiles, + node.kind, + cancellationToken, + node.kind === 148 ? isReadonlyTypeOperator : void 0 + ); + } + if (isImportMeta(node.parent) && node.parent.name === node) { + return getAllReferencesForImportMeta(sourceFiles, cancellationToken); + } + if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) { + return [{ definition: { type: 2, node }, references: [nodeEntry(node)] }]; + } + if (isJumpStatementTarget(node)) { + const labelDefinition = getTargetLabel(node.parent, node.text); + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); + } else if (isLabelOfLabeledStatement(node)) { + return getLabelReferencesInNode(node.parent, node); + } + if (isThis(node)) { + return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); + } + if (node.kind === 108) { + return getReferencesForSuperKeyword(node); + } + return void 0; + } + function getReferencedSymbolsForSymbol(originalSymbol, node, sourceFiles, sourceFilesSet, checker, cancellationToken, options) { + const symbol = node && skipPastExportOrImportSpecifierOrUnion( + originalSymbol, + node, + checker, + /*useLocalSymbolForExportSpecifier*/ + !isForRenameWithPrefixAndSuffixText(options) + ) || originalSymbol; + const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : 7; + const result2 = []; + const state = new State2(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : 0, checker, cancellationToken, searchMeaning, options, result2); + const exportSpecifier = !isForRenameWithPrefixAndSuffixText(options) || !symbol.declarations ? void 0 : find2(symbol.declarations, isExportSpecifier); + if (exportSpecifier) { + getReferencesAtExportSpecifier( + exportSpecifier.name, + symbol, + exportSpecifier, + state.createSearch( + node, + originalSymbol, + /*comingFrom*/ + void 0 + ), + state, + /*addReferencesHere*/ + true, + /*alwaysGetReferences*/ + true + ); + } else if (node && node.kind === 90 && symbol.escapedName === "default" && symbol.parent) { + addReference(node, symbol, state); + searchForImportsOfExport(node, symbol, { + exportingModuleSymbol: symbol.parent, + exportKind: 1 + /* Default */ + }, state); + } else { + const search = state.createSearch( + node, + symbol, + /*comingFrom*/ + void 0, + { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, options.use === 2, !!options.providePrefixAndSuffixTextForRename, !!options.implementations) : [symbol] } + ); + getReferencesInContainerOrFiles(symbol, state, search); + } + return result2; + } + function getReferencesInContainerOrFiles(symbol, state, search) { + const scope = getSymbolScope(symbol); + if (scope) { + getReferencesInContainer( + scope, + scope.getSourceFile(), + search, + state, + /*addReferencesHere*/ + !(isSourceFile(scope) && !contains2(state.sourceFiles, scope)) + ); + } else { + for (const sourceFile of state.sourceFiles) { + state.cancellationToken.throwIfCancellationRequested(); + searchForName(sourceFile, search, state); + } + } + } + function getSpecialSearchKind(node) { + switch (node.kind) { + case 176: + case 137: + return 1; + case 80: + if (isClassLike(node.parent)) { + Debug.assert(node.parent.name === node); + return 2; + } + default: + return 0; + } + } + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker, useLocalSymbolForExportSpecifier) { + const { parent: parent22 } = node; + if (isExportSpecifier(parent22) && useLocalSymbolForExportSpecifier) { + return getLocalSymbolForExportSpecifier(node, symbol, parent22, checker); + } + return firstDefined(symbol.declarations, (decl) => { + if (!decl.parent) { + if (symbol.flags & 33554432) + return void 0; + Debug.fail(`Unexpected symbol at ${Debug.formatSyntaxKind(node.kind)}: ${Debug.formatSymbol(symbol)}`); + } + return isTypeLiteralNode(decl.parent) && isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : void 0; + }); + } + let SpecialSearchKind; + ((SpecialSearchKind2) => { + SpecialSearchKind2[SpecialSearchKind2["None"] = 0] = "None"; + SpecialSearchKind2[SpecialSearchKind2["Constructor"] = 1] = "Constructor"; + SpecialSearchKind2[SpecialSearchKind2["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); + function getNonModuleSymbolOfMergedModuleSymbol(symbol) { + if (!(symbol.flags & (1536 | 33554432))) + return void 0; + const decl = symbol.declarations && find2(symbol.declarations, (d7) => !isSourceFile(d7) && !isModuleDeclaration(d7)); + return decl && decl.symbol; + } + class State2 { + constructor(sourceFiles, sourceFilesSet, specialSearchKind, checker, cancellationToken, searchMeaning, options, result2) { + this.sourceFiles = sourceFiles; + this.sourceFilesSet = sourceFilesSet; + this.specialSearchKind = specialSearchKind; + this.checker = checker; + this.cancellationToken = cancellationToken; + this.searchMeaning = searchMeaning; + this.options = options; + this.result = result2; + this.inheritsFromCache = /* @__PURE__ */ new Map(); + this.markSeenContainingTypeReference = nodeSeenTracker(); + this.markSeenReExportRHS = nodeSeenTracker(); + this.symbolIdToReferences = []; + this.sourceFileToSeenSymbols = []; + } + includesSourceFile(sourceFile) { + return this.sourceFilesSet.has(sourceFile.fileName); + } + /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */ + getImportSearches(exportSymbol, exportInfo) { + if (!this.importTracker) + this.importTracker = createImportTracker(this.sourceFiles, this.sourceFilesSet, this.checker, this.cancellationToken); + return this.importTracker( + exportSymbol, + exportInfo, + this.options.use === 2 + /* Rename */ + ); + } + /** @param allSearchSymbols set of additional symbols for use by `includes`. */ + createSearch(location2, symbol, comingFrom, searchOptions = {}) { + const { + text = stripQuotes(symbolName(getLocalSymbolForExportDefault(symbol) || getNonModuleSymbolOfMergedModuleSymbol(symbol) || symbol)), + allSearchSymbols = [symbol] + } = searchOptions; + const escapedText = escapeLeadingUnderscores(text); + const parents = this.options.implementations && location2 ? getParentSymbolsOfPropertyAccess(location2, symbol, this.checker) : void 0; + return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, includes: (sym) => contains2(allSearchSymbols, sym) }; + } + /** + * Callback to add references for a particular searched symbol. + * This initializes a reference group, so only call this if you will add at least one reference. + */ + referenceAdder(searchSymbol) { + const symbolId = getSymbolId(searchSymbol); + let references = this.symbolIdToReferences[symbolId]; + if (!references) { + references = this.symbolIdToReferences[symbolId] = []; + this.result.push({ definition: { type: 0, symbol: searchSymbol }, references }); + } + return (node, kind) => references.push(nodeEntry(node, kind)); + } + /** Add a reference with no associated definition. */ + addStringOrCommentReference(fileName, textSpan) { + this.result.push({ + definition: void 0, + references: [{ kind: 0, fileName, textSpan }] + }); + } + /** Returns `true` the first time we search for a symbol in a file and `false` afterwards. */ + markSearchedSymbols(sourceFile, symbols) { + const sourceId = getNodeId(sourceFile); + const seenSymbols = this.sourceFileToSeenSymbols[sourceId] || (this.sourceFileToSeenSymbols[sourceId] = /* @__PURE__ */ new Set()); + let anyNewSymbols = false; + for (const sym of symbols) { + anyNewSymbols = tryAddToSet(seenSymbols, getSymbolId(sym)) || anyNewSymbols; + } + return anyNewSymbols; + } + } + function searchForImportsOfExport(exportLocation, exportSymbol, exportInfo, state) { + const { importSearches, singleReferences, indirectUsers } = state.getImportSearches(exportSymbol, exportInfo); + if (singleReferences.length) { + const addRef = state.referenceAdder(exportSymbol); + for (const singleRef of singleReferences) { + if (shouldAddSingleReference(singleRef, state)) + addRef(singleRef); + } + } + for (const [importLocation, importSymbol] of importSearches) { + getReferencesInSourceFile(importLocation.getSourceFile(), state.createSearch( + importLocation, + importSymbol, + 1 + /* Export */ + ), state); + } + if (indirectUsers.length) { + let indirectSearch; + switch (exportInfo.exportKind) { + case 0: + indirectSearch = state.createSearch( + exportLocation, + exportSymbol, + 1 + /* Export */ + ); + break; + case 1: + indirectSearch = state.options.use === 2 ? void 0 : state.createSearch(exportLocation, exportSymbol, 1, { text: "default" }); + break; + case 2: + break; + } + if (indirectSearch) { + for (const indirectUser of indirectUsers) { + searchForName(indirectUser, indirectSearch, state); + } + } + } + } + function eachExportReference(sourceFiles, checker, cancellationToken, exportSymbol, exportingModuleSymbol, exportName, isDefaultExport, cb) { + const importTracker = createImportTracker(sourceFiles, new Set(sourceFiles.map((f8) => f8.fileName)), checker, cancellationToken); + const { importSearches, indirectUsers, singleReferences } = importTracker( + exportSymbol, + { exportKind: isDefaultExport ? 1 : 0, exportingModuleSymbol }, + /*isForRename*/ + false + ); + for (const [importLocation] of importSearches) { + cb(importLocation); + } + for (const singleReference of singleReferences) { + if (isIdentifier(singleReference) && isImportTypeNode(singleReference.parent)) { + cb(singleReference); + } + } + for (const indirectUser of indirectUsers) { + for (const node of getPossibleSymbolReferenceNodes(indirectUser, isDefaultExport ? "default" : exportName)) { + const symbol = checker.getSymbolAtLocation(node); + const hasExportAssignmentDeclaration = some2(symbol == null ? void 0 : symbol.declarations, (d7) => tryCast(d7, isExportAssignment) ? true : false); + if (isIdentifier(node) && !isImportOrExportSpecifier(node.parent) && (symbol === exportSymbol || hasExportAssignmentDeclaration)) { + cb(node); + } + } + } + } + Core2.eachExportReference = eachExportReference; + function shouldAddSingleReference(singleRef, state) { + if (!hasMatchingMeaning(singleRef, state)) + return false; + if (state.options.use !== 2) + return true; + if (!isIdentifier(singleRef)) + return false; + return !(isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default"); + } + function searchForImportedSymbol(symbol, state) { + if (!symbol.declarations) + return; + for (const declaration of symbol.declarations) { + const exportingFile = declaration.getSourceFile(); + getReferencesInSourceFile(exportingFile, state.createSearch( + declaration, + symbol, + 0 + /* Import */ + ), state, state.includesSourceFile(exportingFile)); + } + } + function searchForName(sourceFile, search, state) { + if (getNameTable(sourceFile).get(search.escapedText) !== void 0) { + getReferencesInSourceFile(sourceFile, search, state); + } + } + function getPropertySymbolOfDestructuringAssignment(location2, checker) { + return isArrayLiteralOrObjectLiteralDestructuringPattern(location2.parent.parent) ? checker.getPropertySymbolOfDestructuringAssignment(location2) : void 0; + } + function getSymbolScope(symbol) { + const { declarations, flags, parent: parent22, valueDeclaration } = symbol; + if (valueDeclaration && (valueDeclaration.kind === 218 || valueDeclaration.kind === 231)) { + return valueDeclaration; + } + if (!declarations) { + return void 0; + } + if (flags & (4 | 8192)) { + const privateDeclaration = find2(declarations, (d7) => hasEffectiveModifier( + d7, + 2 + /* Private */ + ) || isPrivateIdentifierClassElementDeclaration(d7)); + if (privateDeclaration) { + return getAncestor( + privateDeclaration, + 263 + /* ClassDeclaration */ + ); + } + return void 0; + } + if (declarations.some(isObjectBindingElementWithoutPropertyName)) { + return void 0; + } + const exposedByParent = parent22 && !(symbol.flags & 262144); + if (exposedByParent && !(isExternalModuleSymbol(parent22) && !parent22.globalExports)) { + return void 0; + } + let scope; + for (const declaration of declarations) { + const container = getContainerNode(declaration); + if (scope && scope !== container) { + return void 0; + } + if (!container || container.kind === 312 && !isExternalOrCommonJsModule(container)) { + return void 0; + } + scope = container; + if (isFunctionExpression(scope)) { + let next; + while (next = getNextJSDocCommentLocation(scope)) { + scope = next; + } + } + } + return exposedByParent ? scope.getSourceFile() : scope; + } + function isSymbolReferencedInFile(definition, checker, sourceFile, searchContainer = sourceFile) { + return eachSymbolReferenceInFile(definition, checker, sourceFile, () => true, searchContainer) || false; + } + Core2.isSymbolReferencedInFile = isSymbolReferencedInFile; + function eachSymbolReferenceInFile(definition, checker, sourceFile, cb, searchContainer = sourceFile) { + const symbol = isParameterPropertyDeclaration(definition.parent, definition.parent.parent) ? first(checker.getSymbolsOfParameterPropertyDeclaration(definition.parent, definition.text)) : checker.getSymbolAtLocation(definition); + if (!symbol) + return void 0; + for (const token of getPossibleSymbolReferenceNodes(sourceFile, symbol.name, searchContainer)) { + if (!isIdentifier(token) || token === definition || token.escapedText !== definition.escapedText) + continue; + const referenceSymbol = checker.getSymbolAtLocation(token); + if (referenceSymbol === symbol || checker.getShorthandAssignmentValueSymbol(token.parent) === symbol || isExportSpecifier(token.parent) && getLocalSymbolForExportSpecifier(token, referenceSymbol, token.parent, checker) === symbol) { + const res = cb(token); + if (res) + return res; + } + } + } + Core2.eachSymbolReferenceInFile = eachSymbolReferenceInFile; + function getTopMostDeclarationNamesInFile(declarationName, sourceFile) { + const candidates = filter2(getPossibleSymbolReferenceNodes(sourceFile, declarationName), (name2) => !!getDeclarationFromName(name2)); + return candidates.reduce((topMost, decl) => { + const depth = getDepth(decl); + if (!some2(topMost.declarationNames) || depth === topMost.depth) { + topMost.declarationNames.push(decl); + topMost.depth = depth; + } else if (depth < topMost.depth) { + topMost.declarationNames = [decl]; + topMost.depth = depth; + } + return topMost; + }, { depth: Infinity, declarationNames: [] }).declarationNames; + function getDepth(declaration) { + let depth = 0; + while (declaration) { + declaration = getContainerNode(declaration); + depth++; + } + return depth; + } + } + Core2.getTopMostDeclarationNamesInFile = getTopMostDeclarationNamesInFile; + function someSignatureUsage(signature, sourceFiles, checker, cb) { + if (!signature.name || !isIdentifier(signature.name)) + return false; + const symbol = Debug.checkDefined(checker.getSymbolAtLocation(signature.name)); + for (const sourceFile of sourceFiles) { + for (const name2 of getPossibleSymbolReferenceNodes(sourceFile, symbol.name)) { + if (!isIdentifier(name2) || name2 === signature.name || name2.escapedText !== signature.name.escapedText) + continue; + const called = climbPastPropertyAccess(name2); + const call = isCallExpression(called.parent) && called.parent.expression === called ? called.parent : void 0; + const referenceSymbol = checker.getSymbolAtLocation(name2); + if (referenceSymbol && checker.getRootSymbols(referenceSymbol).some((s7) => s7 === symbol)) { + if (cb(name2, call)) { + return true; + } + } + } + } + return false; + } + Core2.someSignatureUsage = someSignatureUsage; + function getPossibleSymbolReferenceNodes(sourceFile, symbolName2, container = sourceFile) { + return mapDefined(getPossibleSymbolReferencePositions(sourceFile, symbolName2, container), (pos) => { + const referenceLocation = getTouchingPropertyName(sourceFile, pos); + return referenceLocation === sourceFile ? void 0 : referenceLocation; + }); + } + function getPossibleSymbolReferencePositions(sourceFile, symbolName2, container = sourceFile) { + const positions = []; + if (!symbolName2 || !symbolName2.length) { + return positions; + } + const text = sourceFile.text; + const sourceLength = text.length; + const symbolNameLength = symbolName2.length; + let position = text.indexOf(symbolName2, container.pos); + while (position >= 0) { + if (position > container.end) + break; + const endPosition = position + symbolNameLength; + if ((position === 0 || !isIdentifierPart( + text.charCodeAt(position - 1), + 99 + /* Latest */ + )) && (endPosition === sourceLength || !isIdentifierPart( + text.charCodeAt(endPosition), + 99 + /* Latest */ + ))) { + positions.push(position); + } + position = text.indexOf(symbolName2, position + symbolNameLength + 1); + } + return positions; + } + function getLabelReferencesInNode(container, targetLabel) { + const sourceFile = container.getSourceFile(); + const labelName = targetLabel.text; + const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), (node) => ( + // Only pick labels that are either the target label, or have a target that is the target label + node === targetLabel || isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel ? nodeEntry(node) : void 0 + )); + return [{ definition: { type: 1, node: targetLabel }, references }]; + } + function isValidReferencePosition(node, searchSymbolName) { + switch (node.kind) { + case 81: + if (isJSDocMemberName(node.parent)) { + return true; + } + case 80: + return node.text.length === searchSymbolName.length; + case 15: + case 11: { + const str2 = node; + return (isLiteralNameOfPropertyDeclarationOrIndexAccess(str2) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node) && str2.text.length === searchSymbolName.length; + } + case 9: + return isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length; + case 90: + return "default".length === searchSymbolName.length; + default: + return false; + } + } + function getAllReferencesForImportMeta(sourceFiles, cancellationToken) { + const references = flatMap2(sourceFiles, (sourceFile) => { + cancellationToken.throwIfCancellationRequested(); + return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "meta", sourceFile), (node) => { + const parent22 = node.parent; + if (isImportMeta(parent22)) { + return nodeEntry(parent22); + } + }); + }); + return references.length ? [{ definition: { type: 2, node: references[0].node }, references }] : void 0; + } + function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken, filter22) { + const references = flatMap2(sourceFiles, (sourceFile) => { + cancellationToken.throwIfCancellationRequested(); + return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, tokenToString(keywordKind), sourceFile), (referenceLocation) => { + if (referenceLocation.kind === keywordKind && (!filter22 || filter22(referenceLocation))) { + return nodeEntry(referenceLocation); + } + }); + }); + return references.length ? [{ definition: { type: 2, node: references[0].node }, references }] : void 0; + } + function getReferencesInSourceFile(sourceFile, search, state, addReferencesHere = true) { + state.cancellationToken.throwIfCancellationRequested(); + return getReferencesInContainer(sourceFile, sourceFile, search, state, addReferencesHere); + } + function getReferencesInContainer(container, sourceFile, search, state, addReferencesHere) { + if (!state.markSearchedSymbols(sourceFile, search.allSearchSymbols)) { + return; + } + for (const position of getPossibleSymbolReferencePositions(sourceFile, search.text, container)) { + getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere); + } + } + function hasMatchingMeaning(referenceLocation, state) { + return !!(getMeaningFromLocation(referenceLocation) & state.searchMeaning); + } + function getReferencesAtLocation(sourceFile, position, search, state, addReferencesHere) { + const referenceLocation = getTouchingPropertyName(sourceFile, position); + if (!isValidReferencePosition(referenceLocation, search.text)) { + if (!state.options.implementations && (state.options.findInStrings && isInString(sourceFile, position) || state.options.findInComments && isInNonReferenceComment(sourceFile, position))) { + state.addStringOrCommentReference(sourceFile.fileName, createTextSpan(position, search.text.length)); + } + return; + } + if (!hasMatchingMeaning(referenceLocation, state)) + return; + let referenceSymbol = state.checker.getSymbolAtLocation(referenceLocation); + if (!referenceSymbol) { + return; + } + const parent22 = referenceLocation.parent; + if (isImportSpecifier(parent22) && parent22.propertyName === referenceLocation) { + return; + } + if (isExportSpecifier(parent22)) { + Debug.assert( + referenceLocation.kind === 80 + /* Identifier */ + ); + getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent22, search, state, addReferencesHere); + return; + } + if (isJSDocPropertyLikeTag(parent22) && parent22.isNameFirst && parent22.typeExpression && isJSDocTypeLiteral(parent22.typeExpression.type) && parent22.typeExpression.type.jsDocPropertyTags && length(parent22.typeExpression.type.jsDocPropertyTags)) { + getReferencesAtJSDocTypeLiteral(parent22.typeExpression.type.jsDocPropertyTags, referenceLocation, search, state); + return; + } + const relatedSymbol = getRelatedSymbol(search, referenceSymbol, referenceLocation, state); + if (!relatedSymbol) { + getReferenceForShorthandProperty(referenceSymbol, search, state); + return; + } + switch (state.specialSearchKind) { + case 0: + if (addReferencesHere) + addReference(referenceLocation, relatedSymbol, state); + break; + case 1: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + Debug.assertNever(state.specialSearchKind); + } + if (isInJSFile(referenceLocation) && isBindingElement(referenceLocation.parent) && isVariableDeclarationInitializedToBareOrAccessedRequire(referenceLocation.parent.parent.parent)) { + referenceSymbol = referenceLocation.parent.symbol; + if (!referenceSymbol) + return; + } + getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); + } + function getReferencesAtJSDocTypeLiteral(jsDocPropertyTags, referenceLocation, search, state) { + const addRef = state.referenceAdder(search.symbol); + addReference(referenceLocation, search.symbol, state); + forEach4(jsDocPropertyTags, (propTag) => { + if (isQualifiedName(propTag.name)) { + addRef(propTag.name.left); + } + }); + } + function getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, search, state, addReferencesHere, alwaysGetReferences) { + Debug.assert(!alwaysGetReferences || !!state.options.providePrefixAndSuffixTextForRename, "If alwaysGetReferences is true, then prefix/suffix text must be enabled"); + const { parent: parent22, propertyName, name: name2 } = exportSpecifier; + const exportDeclaration = parent22.parent; + const localSymbol = getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, state.checker); + if (!alwaysGetReferences && !search.includes(localSymbol)) { + return; + } + if (!propertyName) { + if (!(state.options.use === 2 && name2.escapedText === "default")) { + addRef(); + } + } else if (referenceLocation === propertyName) { + if (!exportDeclaration.moduleSpecifier) { + addRef(); + } + if (addReferencesHere && state.options.use !== 2 && state.markSeenReExportRHS(name2)) { + addReference(name2, Debug.checkDefined(exportSpecifier.symbol), state); + } + } else { + if (state.markSeenReExportRHS(referenceLocation)) { + addRef(); + } + } + if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) { + const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default"; + const exportKind = isDefaultExport ? 1 : 0; + const exportSymbol = Debug.checkDefined(exportSpecifier.symbol); + const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker); + if (exportInfo) { + searchForImportsOfExport(referenceLocation, exportSymbol, exportInfo, state); + } + } + if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName && !isForRenameWithPrefixAndSuffixText(state.options)) { + const imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); + } + function addRef() { + if (addReferencesHere) + addReference(referenceLocation, localSymbol, state); + } + } + function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; + } + function isExportSpecifierAlias(referenceLocation, exportSpecifier) { + const { parent: parent22, propertyName, name: name2 } = exportSpecifier; + Debug.assert(propertyName === referenceLocation || name2 === referenceLocation); + if (propertyName) { + return propertyName === referenceLocation; + } else { + return !parent22.parent.moduleSpecifier; + } + } + function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) { + const importOrExport = getImportOrExportSymbol( + referenceLocation, + referenceSymbol, + state.checker, + search.comingFrom === 1 + /* Export */ + ); + if (!importOrExport) + return; + const { symbol } = importOrExport; + if (importOrExport.kind === 0) { + if (!isForRenameWithPrefixAndSuffixText(state.options)) { + searchForImportedSymbol(symbol, state); + } + } else { + searchForImportsOfExport(referenceLocation, symbol, importOrExport.exportInfo, state); + } + } + function getReferenceForShorthandProperty({ flags, valueDeclaration }, search, state) { + const shorthandValueSymbol = state.checker.getShorthandAssignmentValueSymbol(valueDeclaration); + const name2 = valueDeclaration && getNameOfDeclaration(valueDeclaration); + if (!(flags & 33554432) && name2 && search.includes(shorthandValueSymbol)) { + addReference(name2, shorthandValueSymbol, state); + } + } + function addReference(referenceLocation, relatedSymbol, state) { + const { kind, symbol } = "kind" in relatedSymbol ? relatedSymbol : { kind: void 0, symbol: relatedSymbol }; + if (state.options.use === 2 && referenceLocation.kind === 90) { + return; + } + const addRef = state.referenceAdder(symbol); + if (state.options.implementations) { + addImplementationReferences(referenceLocation, addRef, state); + } else { + addRef(referenceLocation, kind); + } + } + function addConstructorReferences(referenceLocation, sourceFile, search, state) { + if (isNewExpressionTarget(referenceLocation)) { + addReference(referenceLocation, search.symbol, state); + } + const pusher = () => state.referenceAdder(search.symbol); + if (isClassLike(referenceLocation.parent)) { + Debug.assert(referenceLocation.kind === 90 || referenceLocation.parent.name === referenceLocation); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); + } else { + const classExtending = tryGetClassByExtendingIdentifier(referenceLocation); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); + findInheritedConstructorReferences(classExtending, state); + } + } + } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, state); + const classLike = referenceLocation.parent; + if (state.options.use === 2 || !isClassLike(classLike)) + return; + Debug.assert(classLike.name === referenceLocation); + const addRef = state.referenceAdder(search.symbol); + for (const member of classLike.members) { + if (!(isMethodOrAccessor(member) && isStatic(member))) { + continue; + } + if (member.body) { + member.body.forEachChild(function cb(node) { + if (node.kind === 110) { + addRef(node); + } else if (!isFunctionLike(node) && !isClassLike(node)) { + node.forEachChild(cb); + } + }); + } + } + } + function findOwnConstructorReferences(classSymbol, sourceFile, addNode2) { + const constructorSymbol = getClassConstructorSymbol(classSymbol); + if (constructorSymbol && constructorSymbol.declarations) { + for (const decl of constructorSymbol.declarations) { + const ctrKeyword = findChildOfKind(decl, 137, sourceFile); + Debug.assert(decl.kind === 176 && !!ctrKeyword); + addNode2(ctrKeyword); + } + } + if (classSymbol.exports) { + classSymbol.exports.forEach((member) => { + const decl = member.valueDeclaration; + if (decl && decl.kind === 174) { + const body = decl.body; + if (body) { + forEachDescendantOfKind(body, 110, (thisKeyword) => { + if (isNewExpressionTarget(thisKeyword)) { + addNode2(thisKeyword); + } + }); + } + } + }); + } + } + function getClassConstructorSymbol(classSymbol) { + return classSymbol.members && classSymbol.members.get( + "__constructor" + /* Constructor */ + ); + } + function findSuperConstructorAccesses(classDeclaration, addNode2) { + const constructor = getClassConstructorSymbol(classDeclaration.symbol); + if (!(constructor && constructor.declarations)) { + return; + } + for (const decl of constructor.declarations) { + Debug.assert( + decl.kind === 176 + /* Constructor */ + ); + const body = decl.body; + if (body) { + forEachDescendantOfKind(body, 108, (node) => { + if (isCallExpressionTarget(node)) { + addNode2(node); + } + }); + } + } + } + function hasOwnConstructor(classDeclaration) { + return !!getClassConstructorSymbol(classDeclaration.symbol); + } + function findInheritedConstructorReferences(classDeclaration, state) { + if (hasOwnConstructor(classDeclaration)) + return; + const classSymbol = classDeclaration.symbol; + const search = state.createSearch( + /*location*/ + void 0, + classSymbol, + /*comingFrom*/ + void 0 + ); + getReferencesInContainerOrFiles(classSymbol, state, search); + } + function addImplementationReferences(refNode, addReference2, state) { + if (isDeclarationName(refNode) && isImplementation(refNode.parent)) { + addReference2(refNode); + return; + } + if (refNode.kind !== 80) { + return; + } + if (refNode.parent.kind === 304) { + getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2); + } + const containingNode = getContainingNodeIfInHeritageClause(refNode); + if (containingNode) { + addReference2(containingNode); + return; + } + const typeNode = findAncestor(refNode, (a7) => !isQualifiedName(a7.parent) && !isTypeNode(a7.parent) && !isTypeElement(a7.parent)); + const typeHavingNode = typeNode.parent; + if (hasType(typeHavingNode) && typeHavingNode.type === typeNode && state.markSeenContainingTypeReference(typeHavingNode)) { + if (hasInitializer(typeHavingNode)) { + addIfImplementation(typeHavingNode.initializer); + } else if (isFunctionLike(typeHavingNode) && typeHavingNode.body) { + const body = typeHavingNode.body; + if (body.kind === 241) { + forEachReturnStatement(body, (returnStatement) => { + if (returnStatement.expression) + addIfImplementation(returnStatement.expression); + }); + } else { + addIfImplementation(body); + } + } else if (isAssertionExpression(typeHavingNode)) { + addIfImplementation(typeHavingNode.expression); + } + } + function addIfImplementation(e10) { + if (isImplementationExpression(e10)) + addReference2(e10); + } + } + function getContainingNodeIfInHeritageClause(node) { + return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0; + } + function isImplementationExpression(node) { + switch (node.kind) { + case 217: + return isImplementationExpression(node.expression); + case 219: + case 218: + case 210: + case 231: + case 209: + return true; + default: + return false; + } + } + function explicitlyInheritsFrom(symbol, parent22, cachedResults, checker) { + if (symbol === parent22) { + return true; + } + const key = getSymbolId(symbol) + "," + getSymbolId(parent22); + const cached = cachedResults.get(key); + if (cached !== void 0) { + return cached; + } + cachedResults.set(key, false); + const inherits2 = !!symbol.declarations && symbol.declarations.some( + (declaration) => getAllSuperTypeNodes(declaration).some((typeReference) => { + const type3 = checker.getTypeAtLocation(typeReference); + return !!type3 && !!type3.symbol && explicitlyInheritsFrom(type3.symbol, parent22, cachedResults, checker); + }) + ); + cachedResults.set(key, inherits2); + return inherits2; + } + function getReferencesForSuperKeyword(superKeyword) { + let searchSpaceNode = getSuperContainer( + superKeyword, + /*stopOnFunctions*/ + false + ); + if (!searchSpaceNode) { + return void 0; + } + let staticFlag = 256; + switch (searchSpaceNode.kind) { + case 172: + case 171: + case 174: + case 173: + case 176: + case 177: + case 178: + staticFlag &= getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + default: + return void 0; + } + const sourceFile = searchSpaceNode.getSourceFile(); + const references = mapDefined(getPossibleSymbolReferenceNodes(sourceFile, "super", searchSpaceNode), (node) => { + if (node.kind !== 108) { + return; + } + const container = getSuperContainer( + node, + /*stopOnFunctions*/ + false + ); + return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : void 0; + }); + return [{ definition: { type: 0, symbol: searchSpaceNode.symbol }, references }]; + } + function isParameterName(node) { + return node.kind === 80 && node.parent.kind === 169 && node.parent.name === node; + } + function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { + let searchSpaceNode = getThisContainer( + thisOrSuperKeyword, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + let staticFlag = 256; + switch (searchSpaceNode.kind) { + case 174: + case 173: + if (isObjectLiteralMethod(searchSpaceNode)) { + staticFlag &= getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + } + case 172: + case 171: + case 176: + case 177: + case 178: + staticFlag &= getSyntacticModifierFlags(searchSpaceNode); + searchSpaceNode = searchSpaceNode.parent; + break; + case 312: + if (isExternalModule(searchSpaceNode) || isParameterName(thisOrSuperKeyword)) { + return void 0; + } + case 262: + case 218: + break; + default: + return void 0; + } + const references = flatMap2(searchSpaceNode.kind === 312 ? sourceFiles : [searchSpaceNode.getSourceFile()], (sourceFile) => { + cancellationToken.throwIfCancellationRequested(); + return getPossibleSymbolReferenceNodes(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode).filter((node) => { + if (!isThis(node)) { + return false; + } + const container = getThisContainer( + node, + /*includeArrowFunctions*/ + false, + /*includeClassComputedPropertyName*/ + false + ); + if (!canHaveSymbol(container)) + return false; + switch (searchSpaceNode.kind) { + case 218: + case 262: + return searchSpaceNode.symbol === container.symbol; + case 174: + case 173: + return isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol; + case 231: + case 263: + case 210: + return container.parent && canHaveSymbol(container.parent) && searchSpaceNode.symbol === container.parent.symbol && isStatic(container) === !!staticFlag; + case 312: + return container.kind === 312 && !isExternalModule(container) && !isParameterName(node); + } + }); + }).map((n7) => nodeEntry(n7)); + const thisParameter = firstDefined(references, (r8) => isParameter(r8.node.parent) ? r8.node : void 0); + return [{ + definition: { type: 3, node: thisParameter || thisOrSuperKeyword }, + references + }]; + } + function getReferencesForStringLiteral(node, sourceFiles, checker, cancellationToken) { + const type3 = getContextualTypeFromParentOrAncestorTypeNode(node, checker); + const references = flatMap2(sourceFiles, (sourceFile) => { + cancellationToken.throwIfCancellationRequested(); + return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), (ref) => { + if (isStringLiteralLike(ref) && ref.text === node.text) { + if (type3) { + const refType = getContextualTypeFromParentOrAncestorTypeNode(ref, checker); + if (type3 !== checker.getStringType() && (type3 === refType || isStringLiteralPropertyReference(ref, checker))) { + return nodeEntry( + ref, + 2 + /* StringLiteral */ + ); + } + } else { + return isNoSubstitutionTemplateLiteral(ref) && !rangeIsOnSingleLine(ref, sourceFile) ? void 0 : nodeEntry( + ref, + 2 + /* StringLiteral */ + ); + } + } + }); + }); + return [{ + definition: { type: 4, node }, + references + }]; + } + function isStringLiteralPropertyReference(node, checker) { + if (isPropertySignature(node.parent)) { + return checker.getPropertyOfType(checker.getTypeAtLocation(node.parent.parent), node.text); + } + } + function populateSearchSymbolSet(symbol, location2, checker, isForRename, providePrefixAndSuffixText, implementations) { + const result2 = []; + forEachRelatedSymbol( + symbol, + location2, + checker, + isForRename, + !(isForRename && providePrefixAndSuffixText), + (sym, root2, base) => { + if (base) { + if (isStaticSymbol(symbol) !== isStaticSymbol(base)) { + base = void 0; + } + } + result2.push(base || root2 || sym); + }, + // when try to find implementation, implementations is true, and not allowed to find base class + /*allowBaseTypes*/ + () => !implementations + ); + return result2; + } + function forEachRelatedSymbol(symbol, location2, checker, isForRenamePopulateSearchSymbolSet, onlyIncludeBindingElementAtReferenceLocation, cbSymbol, allowBaseTypes) { + const containingObjectLiteralElement = getContainingObjectLiteralElement(location2); + if (containingObjectLiteralElement) { + const shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location2.parent); + if (shorthandValueSymbol && isForRenamePopulateSearchSymbolSet) { + return cbSymbol( + shorthandValueSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 3 + /* SearchedLocalFoundProperty */ + ); + } + const contextualType = checker.getContextualType(containingObjectLiteralElement.parent); + const res2 = contextualType && firstDefined( + getPropertySymbolsFromContextualType( + containingObjectLiteralElement, + checker, + contextualType, + /*unionSymbolOk*/ + true + ), + (sym) => fromRoot( + sym, + 4 + /* SearchedPropertyFoundLocal */ + ) + ); + if (res2) + return res2; + const propertySymbol = getPropertySymbolOfDestructuringAssignment(location2, checker); + const res1 = propertySymbol && cbSymbol( + propertySymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 4 + /* SearchedPropertyFoundLocal */ + ); + if (res1) + return res1; + const res22 = shorthandValueSymbol && cbSymbol( + shorthandValueSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 3 + /* SearchedLocalFoundProperty */ + ); + if (res22) + return res22; + } + const aliasedSymbol = getMergedAliasedSymbolOfNamespaceExportDeclaration(location2, symbol, checker); + if (aliasedSymbol) { + const res2 = cbSymbol( + aliasedSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 1 + /* Node */ + ); + if (res2) + return res2; + } + const res = fromRoot(symbol); + if (res) + return res; + if (symbol.valueDeclaration && isParameterPropertyDeclaration(symbol.valueDeclaration, symbol.valueDeclaration.parent)) { + const paramProps = checker.getSymbolsOfParameterPropertyDeclaration(cast(symbol.valueDeclaration, isParameter), symbol.name); + Debug.assert(paramProps.length === 2 && !!(paramProps[0].flags & 1) && !!(paramProps[1].flags & 4)); + return fromRoot(symbol.flags & 1 ? paramProps[1] : paramProps[0]); + } + const exportSpecifier = getDeclarationOfKind( + symbol, + 281 + /* ExportSpecifier */ + ); + if (!isForRenamePopulateSearchSymbolSet || exportSpecifier && !exportSpecifier.propertyName) { + const localSymbol = exportSpecifier && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (localSymbol) { + const res2 = cbSymbol( + localSymbol, + /*rootSymbol*/ + void 0, + /*baseSymbol*/ + void 0, + 1 + /* Node */ + ); + if (res2) + return res2; + } + } + if (!isForRenamePopulateSearchSymbolSet) { + let bindingElementPropertySymbol; + if (onlyIncludeBindingElementAtReferenceLocation) { + bindingElementPropertySymbol = isObjectBindingElementWithoutPropertyName(location2.parent) ? getPropertySymbolFromBindingElement(checker, location2.parent) : void 0; + } else { + bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + } + return bindingElementPropertySymbol && fromRoot( + bindingElementPropertySymbol, + 4 + /* SearchedPropertyFoundLocal */ + ); + } + Debug.assert(isForRenamePopulateSearchSymbolSet); + const includeOriginalSymbolOfBindingElement = onlyIncludeBindingElementAtReferenceLocation; + if (includeOriginalSymbolOfBindingElement) { + const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); + return bindingElementPropertySymbol && fromRoot( + bindingElementPropertySymbol, + 4 + /* SearchedPropertyFoundLocal */ + ); + } + function fromRoot(sym, kind) { + return firstDefined(checker.getRootSymbols(sym), (rootSymbol) => cbSymbol( + sym, + rootSymbol, + /*baseSymbol*/ + void 0, + kind + ) || (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64) && allowBaseTypes(rootSymbol) ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, (base) => cbSymbol(sym, rootSymbol, base, kind)) : void 0)); + } + function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol2, checker2) { + const bindingElement = getDeclarationOfKind( + symbol2, + 208 + /* BindingElement */ + ); + if (bindingElement && isObjectBindingElementWithoutPropertyName(bindingElement)) { + return getPropertySymbolFromBindingElement(checker2, bindingElement); + } + } + } + function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) { + const seen = /* @__PURE__ */ new Map(); + return recur(symbol); + function recur(symbol2) { + if (!(symbol2.flags & (32 | 64)) || !addToSeen(seen, getSymbolId(symbol2))) + return; + return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => { + const type3 = checker.getTypeAtLocation(typeReference); + const propertySymbol = type3 && type3.symbol && checker.getPropertyOfType(type3, propertyName); + return type3 && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type3.symbol)); + })); + } + } + function isStaticSymbol(symbol) { + if (!symbol.valueDeclaration) + return false; + const modifierFlags = getEffectiveModifierFlags(symbol.valueDeclaration); + return !!(modifierFlags & 256); + } + function getRelatedSymbol(search, referenceSymbol, referenceLocation, state) { + const { checker } = state; + return forEachRelatedSymbol( + referenceSymbol, + referenceLocation, + checker, + /*isForRenamePopulateSearchSymbolSet*/ + false, + /*onlyIncludeBindingElementAtReferenceLocation*/ + state.options.use !== 2 || !!state.options.providePrefixAndSuffixTextForRename, + (sym, rootSymbol, baseSymbol, kind) => { + if (baseSymbol) { + if (isStaticSymbol(referenceSymbol) !== isStaticSymbol(baseSymbol)) { + baseSymbol = void 0; + } + } + return search.includes(baseSymbol || rootSymbol || sym) ? { symbol: rootSymbol && !(getCheckFlags(sym) & 6) ? rootSymbol : sym, kind } : void 0; + }, + /*allowBaseTypes*/ + (rootSymbol) => !(search.parents && !search.parents.some((parent22) => explicitlyInheritsFrom(rootSymbol.parent, parent22, state.inheritsFromCache, checker))) + ); + } + function getIntersectingMeaningFromDeclarations(node, symbol) { + let meaning = getMeaningFromLocation(node); + const { declarations } = symbol; + if (declarations) { + let lastIterationMeaning; + do { + lastIterationMeaning = meaning; + for (const declaration of declarations) { + const declarationMeaning = getMeaningFromDeclaration(declaration); + if (declarationMeaning & meaning) { + meaning |= declarationMeaning; + } + } + } while (meaning !== lastIterationMeaning); + } + return meaning; + } + Core2.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; + function isImplementation(node) { + return !!(node.flags & 33554432) ? !(isInterfaceDeclaration(node) || isTypeAliasDeclaration(node)) : isVariableLike(node) ? hasInitializer(node) : isFunctionLikeDeclaration(node) ? !!node.body : isClassLike(node) || isModuleOrEnumDeclaration(node); + } + function getReferenceEntriesForShorthandPropertyAssignment(node, checker, addReference2) { + const refSymbol = checker.getSymbolAtLocation(node); + const shorthandSymbol = checker.getShorthandAssignmentValueSymbol(refSymbol.valueDeclaration); + if (shorthandSymbol) { + for (const declaration of shorthandSymbol.getDeclarations()) { + if (getMeaningFromDeclaration(declaration) & 1) { + addReference2(declaration); + } + } + } + } + Core2.getReferenceEntriesForShorthandPropertyAssignment = getReferenceEntriesForShorthandPropertyAssignment; + function forEachDescendantOfKind(node, kind, action) { + forEachChild(node, (child) => { + if (child.kind === kind) { + action(child); + } + forEachDescendantOfKind(child, kind, action); + }); + } + function tryGetClassByExtendingIdentifier(node) { + return tryGetClassExtendingExpressionWithTypeArguments(climbPastPropertyAccess(node).parent); + } + function getParentSymbolsOfPropertyAccess(location2, symbol, checker) { + const propertyAccessExpression = isRightSideOfPropertyAccess(location2) ? location2.parent : void 0; + const lhsType = propertyAccessExpression && checker.getTypeAtLocation(propertyAccessExpression.expression); + const res = mapDefined(lhsType && (lhsType.isUnionOrIntersection() ? lhsType.types : lhsType.symbol === symbol.parent ? void 0 : [lhsType]), (t8) => t8.symbol && t8.symbol.flags & (32 | 64) ? t8.symbol : void 0); + return res.length === 0 ? void 0 : res; + } + function isForRenameWithPrefixAndSuffixText(options) { + return options.use === 2 && options.providePrefixAndSuffixTextForRename; + } + })(Core || (Core = {})); + } + }); + var ts_FindAllReferences_exports = {}; + __export2(ts_FindAllReferences_exports, { + Core: () => Core, + DefinitionKind: () => DefinitionKind, + EntryKind: () => EntryKind, + ExportKind: () => ExportKind2, + FindReferencesUse: () => FindReferencesUse, + ImportExport: () => ImportExport, + createImportTracker: () => createImportTracker, + findModuleReferences: () => findModuleReferences, + findReferenceOrRenameEntries: () => findReferenceOrRenameEntries, + findReferencedSymbols: () => findReferencedSymbols, + getContextNode: () => getContextNode, + getExportInfo: () => getExportInfo, + getImplementationsAtPosition: () => getImplementationsAtPosition, + getImportOrExportSymbol: () => getImportOrExportSymbol, + getReferenceEntriesForNode: () => getReferenceEntriesForNode, + getTextSpanOfEntry: () => getTextSpanOfEntry, + isContextWithStartAndEndNode: () => isContextWithStartAndEndNode, + isDeclarationOfSymbol: () => isDeclarationOfSymbol, + isWriteAccessForReference: () => isWriteAccessForReference, + nodeEntry: () => nodeEntry, + toContextSpan: () => toContextSpan, + toHighlightSpan: () => toHighlightSpan, + toReferenceEntry: () => toReferenceEntry, + toRenameLocation: () => toRenameLocation + }); + var init_ts_FindAllReferences = __esm2({ + "src/services/_namespaces/ts.FindAllReferences.ts"() { + "use strict"; + init_importTracker(); + init_findAllReferences(); + } + }); + function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) { + var _a2; + const resolvedRef = getReferenceAtPosition(sourceFile, position, program); + const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray; + if (resolvedRef == null ? void 0 : resolvedRef.file) { + return fileReferenceDefinition; + } + const node = getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + const { parent: parent22 } = node; + const typeChecker = program.getTypeChecker(); + if (node.kind === 164 || isIdentifier(node) && isJSDocOverrideTag(parent22) && parent22.tagName === node) { + return getDefinitionFromOverriddenMember(typeChecker, node) || emptyArray; + } + if (isJumpStatementTarget(node)) { + const label = getTargetLabel(node.parent, node.text); + return label ? [createDefinitionInfoFromName( + typeChecker, + label, + "label", + node.text, + /*containerName*/ + void 0 + )] : void 0; + } + switch (node.kind) { + case 107: + const functionDeclaration = findAncestor(node.parent, (n7) => isClassStaticBlockDeclaration(n7) ? "quit" : isFunctionLikeDeclaration(n7)); + return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0; + case 90: + if (!isDefaultClause(node.parent)) { + break; + } + case 84: + const switchStatement = findAncestor(node.parent, isSwitchStatement); + if (switchStatement) { + return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)]; + } + break; + } + if (node.kind === 135) { + const functionDeclaration = findAncestor(node, (n7) => isFunctionLikeDeclaration(n7)); + const isAsyncFunction2 = functionDeclaration && some2( + functionDeclaration.modifiers, + (node2) => node2.kind === 134 + /* AsyncKeyword */ + ); + return isAsyncFunction2 ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0; + } + if (node.kind === 127) { + const functionDeclaration = findAncestor(node, (n7) => isFunctionLikeDeclaration(n7)); + const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken; + return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0; + } + if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) { + const classDecl = node.parent.parent; + const { symbol: symbol2, failedAliasResolution: failedAliasResolution2 } = getSymbol(classDecl, typeChecker, stopAtAlias); + const staticBlocks = filter2(classDecl.members, isClassStaticBlockDeclaration); + const containerName = symbol2 ? typeChecker.symbolToString(symbol2, classDecl) : ""; + const sourceFile2 = node.getSourceFile(); + return map4(staticBlocks, (staticBlock) => { + let { pos } = moveRangePastModifiers(staticBlock); + pos = skipTrivia(sourceFile2.text, pos); + return createDefinitionInfoFromName( + typeChecker, + staticBlock, + "constructor", + "static {}", + containerName, + /*unverified*/ + false, + failedAliasResolution2, + { start: pos, length: "static".length } + ); + }); + } + let { symbol, failedAliasResolution } = getSymbol(node, typeChecker, stopAtAlias); + let fallbackNode = node; + if (searchOtherFilesOnly && failedAliasResolution) { + const importDeclaration = forEach4([node, ...(symbol == null ? void 0 : symbol.declarations) || emptyArray], (n7) => findAncestor(n7, isAnyImportOrBareOrAccessedRequire)); + const moduleSpecifier = importDeclaration && tryGetModuleSpecifierFromDeclaration(importDeclaration); + if (moduleSpecifier) { + ({ symbol, failedAliasResolution } = getSymbol(moduleSpecifier, typeChecker, stopAtAlias)); + fallbackNode = moduleSpecifier; + } + } + if (!symbol && isModuleSpecifierLike(fallbackNode)) { + const ref = (_a2 = program.getResolvedModuleFromModuleSpecifier(fallbackNode)) == null ? void 0 : _a2.resolvedModule; + if (ref) { + return [{ + name: fallbackNode.text, + fileName: ref.resolvedFileName, + containerName: void 0, + containerKind: void 0, + kind: "script", + textSpan: createTextSpan(0, 0), + failedAliasResolution, + isAmbient: isDeclarationFileName(ref.resolvedFileName), + unverified: fallbackNode !== node + }]; + } + } + if (!symbol) { + return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker)); + } + if (searchOtherFilesOnly && every2(symbol.declarations, (d7) => d7.getSourceFile().fileName === sourceFile.fileName)) + return void 0; + const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); + if (calledDeclaration && !(isJsxOpeningLikeElement(node.parent) && isConstructorLike(calledDeclaration))) { + const sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration, failedAliasResolution); + if (typeChecker.getRootSymbols(symbol).some((s7) => symbolMatchesSignature(s7, calledDeclaration))) { + return [sigInfo]; + } else { + const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, calledDeclaration) || emptyArray; + return node.kind === 108 ? [sigInfo, ...defs] : [...defs, sigInfo]; + } + } + if (node.parent.kind === 304) { + const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); + const definitions = (shorthandSymbol == null ? void 0 : shorthandSymbol.declarations) ? shorthandSymbol.declarations.map((decl) => createDefinitionInfo( + decl, + typeChecker, + shorthandSymbol, + node, + /*unverified*/ + false, + failedAliasResolution + )) : emptyArray; + return concatenate(definitions, getDefinitionFromObjectLiteralElement(typeChecker, node)); + } + if (isPropertyName(node) && isBindingElement(parent22) && isObjectBindingPattern(parent22.parent) && node === (parent22.propertyName || parent22.name)) { + const name2 = getNameFromPropertyName(node); + const type3 = typeChecker.getTypeAtLocation(parent22.parent); + return name2 === void 0 ? emptyArray : flatMap2(type3.isUnion() ? type3.types : [type3], (t8) => { + const prop = t8.getProperty(name2); + return prop && getDefinitionFromSymbol(typeChecker, prop, node); + }); + } + const objectLiteralElementDefinition = getDefinitionFromObjectLiteralElement(typeChecker, node); + return concatenate(fileReferenceDefinition, objectLiteralElementDefinition.length ? objectLiteralElementDefinition : getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution)); + } + function symbolMatchesSignature(s7, calledDeclaration) { + var _a2; + return s7 === calledDeclaration.symbol || s7 === calledDeclaration.symbol.parent || isAssignmentExpression(calledDeclaration.parent) || !isCallLikeExpression(calledDeclaration.parent) && s7 === ((_a2 = tryCast(calledDeclaration.parent, canHaveSymbol)) == null ? void 0 : _a2.symbol); + } + function getDefinitionFromObjectLiteralElement(typeChecker, node) { + const element = getContainingObjectLiteralElement(node); + if (element) { + const contextualType = element && typeChecker.getContextualType(element.parent); + if (contextualType) { + return flatMap2(getPropertySymbolsFromContextualType( + element, + typeChecker, + contextualType, + /*unionSymbolOk*/ + false + ), (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node)); + } + } + return emptyArray; + } + function getDefinitionFromOverriddenMember(typeChecker, node) { + const classElement = findAncestor(node, isClassElement); + if (!(classElement && classElement.name)) + return; + const baseDeclaration = findAncestor(classElement, isClassLike); + if (!baseDeclaration) + return; + const baseTypeNode = getEffectiveBaseTypeNode(baseDeclaration); + if (!baseTypeNode) + return; + const expression = skipParentheses(baseTypeNode.expression); + const base = isClassExpression(expression) ? expression.symbol : typeChecker.getSymbolAtLocation(expression); + if (!base) + return; + const name2 = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name)); + const symbol = hasStaticModifier(classElement) ? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbol(base), name2) : typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name2); + if (!symbol) + return; + return getDefinitionFromSymbol(typeChecker, symbol, node); + } + function getReferenceAtPosition(sourceFile, position, program) { + var _a2, _b; + const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + const file = program.getSourceFileFromReference(sourceFile, referencePath); + return file && { reference: referencePath, fileName: file.fileName, file, unverified: false }; + } + const typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + const reference = (_a2 = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName, typeReferenceDirective.resolutionMode || sourceFile.impliedNodeFormat)) == null ? void 0 : _a2.resolvedTypeReferenceDirective; + const file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { reference: typeReferenceDirective, fileName: file.fileName, file, unverified: false }; + } + const libReferenceDirective = findReferenceInPosition(sourceFile.libReferenceDirectives, position); + if (libReferenceDirective) { + const file = program.getLibFileFromReference(libReferenceDirective); + return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false }; + } + if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) { + const node = getTouchingToken(sourceFile, position); + let resolution; + if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModuleFromModuleSpecifier(node))) { + const verifiedFileName = (_b = resolution.resolvedModule) == null ? void 0 : _b.resolvedFileName; + const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text); + return { + file: program.getSourceFile(fileName), + fileName, + reference: { + pos: node.getStart(), + end: node.getEnd(), + fileName: node.text + }, + unverified: !verifiedFileName + }; + } + } + return void 0; + } + function shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(typeChecker, type3) { + const referenceName = type3.symbol.name; + if (!typesWithUnwrappedTypeArguments.has(referenceName)) { + return false; + } + const globalType = typeChecker.resolveName( + referenceName, + /*location*/ + void 0, + 788968, + /*excludeGlobals*/ + false + ); + return !!globalType && globalType === type3.target.symbol; + } + function shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type3) { + if (!type3.aliasSymbol) { + return false; + } + const referenceName = type3.aliasSymbol.name; + if (!typesWithUnwrappedTypeArguments.has(referenceName)) { + return false; + } + const globalType = typeChecker.resolveName( + referenceName, + /*location*/ + void 0, + 788968, + /*excludeGlobals*/ + false + ); + return !!globalType && globalType === type3.aliasSymbol; + } + function getFirstTypeArgumentDefinitions(typeChecker, type3, node, failedAliasResolution) { + var _a2, _b; + if (!!(getObjectFlags(type3) & 4) && shouldUnwrapFirstTypeArgumentTypeDefinitionFromTypeReference(typeChecker, type3)) { + return definitionFromType(typeChecker.getTypeArguments(type3)[0], typeChecker, node, failedAliasResolution); + } + if (shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type3) && type3.aliasTypeArguments) { + return definitionFromType(type3.aliasTypeArguments[0], typeChecker, node, failedAliasResolution); + } + if (getObjectFlags(type3) & 32 && type3.target && shouldUnwrapFirstTypeArgumentTypeDefinitionFromAlias(typeChecker, type3.target)) { + const declaration = (_b = (_a2 = type3.aliasSymbol) == null ? void 0 : _a2.declarations) == null ? void 0 : _b[0]; + if (declaration && isTypeAliasDeclaration(declaration) && isTypeReferenceNode(declaration.type) && declaration.type.typeArguments) { + return definitionFromType(typeChecker.getTypeAtLocation(declaration.type.typeArguments[0]), typeChecker, node, failedAliasResolution); + } + } + return []; + } + function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { + const node = getTouchingPropertyName(sourceFile, position); + if (node === sourceFile) { + return void 0; + } + if (isImportMeta(node.parent) && node.parent.name === node) { + return definitionFromType( + typeChecker.getTypeAtLocation(node.parent), + typeChecker, + node.parent, + /*failedAliasResolution*/ + false + ); + } + const { symbol, failedAliasResolution } = getSymbol( + node, + typeChecker, + /*stopAtAlias*/ + false + ); + if (!symbol) + return void 0; + const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker); + const fromReturnType = returnType && definitionFromType(returnType, typeChecker, node, failedAliasResolution); + const [resolvedType, typeDefinitions] = fromReturnType && fromReturnType.length !== 0 ? [returnType, fromReturnType] : [typeAtLocation, definitionFromType(typeAtLocation, typeChecker, node, failedAliasResolution)]; + return typeDefinitions.length ? [...getFirstTypeArgumentDefinitions(typeChecker, resolvedType, node, failedAliasResolution), ...typeDefinitions] : !(symbol.flags & 111551) && symbol.flags & 788968 ? getDefinitionFromSymbol(typeChecker, skipAlias(symbol, typeChecker), node, failedAliasResolution) : void 0; + } + function definitionFromType(type3, checker, node, failedAliasResolution) { + return flatMap2(type3.isUnion() && !(type3.flags & 32) ? type3.types : [type3], (t8) => t8.symbol && getDefinitionFromSymbol(checker, t8.symbol, node, failedAliasResolution)); + } + function tryGetReturnTypeOfFunction(symbol, type3, checker) { + if (type3.symbol === symbol || // At `const f = () => {}`, the symbol is `f` and the type symbol is at `() => {}` + symbol.valueDeclaration && type3.symbol && isVariableDeclaration(symbol.valueDeclaration) && symbol.valueDeclaration.initializer === type3.symbol.valueDeclaration) { + const sigs = type3.getCallSignatures(); + if (sigs.length === 1) + return checker.getReturnTypeOfSignature(first(sigs)); + } + return void 0; + } + function getDefinitionAndBoundSpan(program, sourceFile, position) { + const definitions = getDefinitionAtPosition(program, sourceFile, position); + if (!definitions || definitions.length === 0) { + return void 0; + } + const comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position) || findReferenceInPosition(sourceFile.libReferenceDirectives, position); + if (comment) { + return { definitions, textSpan: createTextSpanFromRange(comment) }; + } + const node = getTouchingPropertyName(sourceFile, position); + const textSpan = createTextSpan(node.getStart(), node.getWidth()); + return { definitions, textSpan }; + } + function getDefinitionInfoForIndexSignatures(node, checker) { + return mapDefined(checker.getIndexInfosAtLocation(node), (info2) => info2.declaration && createDefinitionFromSignatureDeclaration(checker, info2.declaration)); + } + function getSymbol(node, checker, stopAtAlias) { + const symbol = checker.getSymbolAtLocation(node); + let failedAliasResolution = false; + if ((symbol == null ? void 0 : symbol.declarations) && symbol.flags & 2097152 && !stopAtAlias && shouldSkipAlias(node, symbol.declarations[0])) { + const aliased = checker.getAliasedSymbol(symbol); + if (aliased.declarations) { + return { symbol: aliased }; + } else { + failedAliasResolution = true; + } + } + return { symbol, failedAliasResolution }; + } + function shouldSkipAlias(node, declaration) { + if (node.kind !== 80) { + return false; + } + if (node.parent === declaration) { + return true; + } + if (declaration.kind === 274) { + return false; + } + return true; + } + function isExpandoDeclaration(node) { + if (!isAssignmentDeclaration(node)) + return false; + const containingAssignment = findAncestor(node, (p7) => { + if (isAssignmentExpression(p7)) + return true; + if (!isAssignmentDeclaration(p7)) + return "quit"; + return false; + }); + return !!containingAssignment && getAssignmentDeclarationKind(containingAssignment) === 5; + } + function getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, excludeDeclaration) { + const filteredDeclarations = filter2(symbol.declarations, (d7) => d7 !== excludeDeclaration); + const withoutExpandos = filter2(filteredDeclarations, (d7) => !isExpandoDeclaration(d7)); + const results = some2(withoutExpandos) ? withoutExpandos : filteredDeclarations; + return getConstructSignatureDefinition() || getCallSignatureDefinition() || map4(results, (declaration) => createDefinitionInfo( + declaration, + typeChecker, + symbol, + node, + /*unverified*/ + false, + failedAliasResolution + )); + function getConstructSignatureDefinition() { + if (symbol.flags & 32 && !(symbol.flags & (16 | 3)) && (isNewExpressionTarget(node) || node.kind === 137)) { + const cls = find2(filteredDeclarations, isClassLike) || Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition( + cls.members, + /*selectConstructors*/ + true + ); + } + } + function getCallSignatureDefinition() { + return isCallOrNewExpressionTarget(node) || isNameOfFunctionDeclaration(node) ? getSignatureDefinition( + filteredDeclarations, + /*selectConstructors*/ + false + ) : void 0; + } + function getSignatureDefinition(signatureDeclarations, selectConstructors) { + if (!signatureDeclarations) { + return void 0; + } + const declarations = signatureDeclarations.filter(selectConstructors ? isConstructorDeclaration : isFunctionLike); + const declarationsWithBody = declarations.filter((d7) => !!d7.body); + return declarations.length ? declarationsWithBody.length !== 0 ? declarationsWithBody.map((x7) => createDefinitionInfo(x7, typeChecker, symbol, node)) : [createDefinitionInfo( + last2(declarations), + typeChecker, + symbol, + node, + /*unverified*/ + false, + failedAliasResolution + )] : void 0; + } + } + function createDefinitionInfo(declaration, checker, symbol, node, unverified, failedAliasResolution) { + const symbolName2 = checker.symbolToString(symbol); + const symbolKind = ts_SymbolDisplay_exports.getSymbolKind(checker, symbol, node); + const containerName = symbol.parent ? checker.symbolToString(symbol.parent, node) : ""; + return createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName2, containerName, unverified, failedAliasResolution); + } + function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolName2, containerName, unverified, failedAliasResolution, textSpan) { + const sourceFile = declaration.getSourceFile(); + if (!textSpan) { + const name2 = getNameOfDeclaration(declaration) || declaration; + textSpan = createTextSpanFromNode(name2, sourceFile); + } + return { + fileName: sourceFile.fileName, + textSpan, + kind: symbolKind, + name: symbolName2, + containerKind: void 0, + // TODO: GH#18217 + containerName, + ...ts_FindAllReferences_exports.toContextSpan( + textSpan, + sourceFile, + ts_FindAllReferences_exports.getContextNode(declaration) + ), + isLocal: !isDefinitionVisible(checker, declaration), + isAmbient: !!(declaration.flags & 33554432), + unverified, + failedAliasResolution + }; + } + function createDefinitionInfoFromSwitch(statement, sourceFile) { + const keyword = ts_FindAllReferences_exports.getContextNode(statement); + const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile); + return { + fileName: sourceFile.fileName, + textSpan, + kind: "keyword", + name: "switch", + containerKind: void 0, + containerName: "", + ...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword), + isLocal: true, + isAmbient: false, + unverified: false, + failedAliasResolution: void 0 + }; + } + function isDefinitionVisible(checker, declaration) { + if (checker.isDeclarationVisible(declaration)) + return true; + if (!declaration.parent) + return false; + if (hasInitializer(declaration.parent) && declaration.parent.initializer === declaration) + return isDefinitionVisible(checker, declaration.parent); + switch (declaration.kind) { + case 172: + case 177: + case 178: + case 174: + if (hasEffectiveModifier( + declaration, + 2 + /* Private */ + )) + return false; + case 176: + case 303: + case 304: + case 210: + case 231: + case 219: + case 218: + return isDefinitionVisible(checker, declaration.parent); + default: + return false; + } + } + function createDefinitionFromSignatureDeclaration(typeChecker, decl, failedAliasResolution) { + return createDefinitionInfo( + decl, + typeChecker, + decl.symbol, + decl, + /*unverified*/ + false, + failedAliasResolution + ); + } + function findReferenceInPosition(refs, pos) { + return find2(refs, (ref) => textRangeContainsPositionInclusive(ref, pos)); + } + function getDefinitionInfoForFileReference(name2, targetFileName, unverified) { + return { + fileName: targetFileName, + textSpan: createTextSpanFromBounds(0, 0), + kind: "script", + name: name2, + containerName: void 0, + containerKind: void 0, + // TODO: GH#18217 + unverified + }; + } + function getAncestorCallLikeExpression(node) { + const target = findAncestor(node, (n7) => !isRightSideOfPropertyAccess(n7)); + const callLike = target == null ? void 0 : target.parent; + return callLike && isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target ? callLike : void 0; + } + function tryGetSignatureDeclaration(typeChecker, node) { + const callLike = getAncestorCallLikeExpression(node); + const signature = callLike && typeChecker.getResolvedSignature(callLike); + return tryCast(signature && signature.declaration, (d7) => isFunctionLike(d7) && !isFunctionTypeNode(d7)); + } + function isConstructorLike(node) { + switch (node.kind) { + case 176: + case 185: + case 180: + return true; + default: + return false; + } + } + var typesWithUnwrappedTypeArguments; + var init_goToDefinition = __esm2({ + "src/services/goToDefinition.ts"() { + "use strict"; + init_ts4(); + init_ts_FindAllReferences(); + typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([ + "Array", + "ArrayLike", + "ReadonlyArray", + "Promise", + "PromiseLike", + "Iterable", + "IterableIterator", + "AsyncIterable", + "Set", + "WeakSet", + "ReadonlySet", + "Map", + "WeakMap", + "ReadonlyMap", + "Partial", + "Required", + "Readonly", + "Pick", + "Omit" + ]); + } + }); + var ts_GoToDefinition_exports = {}; + __export2(ts_GoToDefinition_exports, { + createDefinitionInfo: () => createDefinitionInfo, + findReferenceInPosition: () => findReferenceInPosition, + getDefinitionAndBoundSpan: () => getDefinitionAndBoundSpan, + getDefinitionAtPosition: () => getDefinitionAtPosition, + getReferenceAtPosition: () => getReferenceAtPosition, + getTypeDefinitionAtPosition: () => getTypeDefinitionAtPosition + }); + var init_ts_GoToDefinition = __esm2({ + "src/services/_namespaces/ts.GoToDefinition.ts"() { + "use strict"; + init_goToDefinition(); + } + }); + function shouldShowParameterNameHints(preferences) { + return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all"; + } + function shouldShowLiteralParameterNameHintsOnly(preferences) { + return preferences.includeInlayParameterNameHints === "literals"; + } + function shouldUseInteractiveInlayHints(preferences) { + return preferences.interactiveInlayHints === true; + } + function provideInlayHints(context2) { + const { file, program, span, cancellationToken, preferences } = context2; + const sourceFileText = file.text; + const compilerOptions = program.getCompilerOptions(); + const quotePreference = getQuotePreference(file, preferences); + const checker = program.getTypeChecker(); + const result2 = []; + visitor(file); + return result2; + function visitor(node) { + if (!node || node.getFullWidth() === 0) { + return; + } + switch (node.kind) { + case 267: + case 263: + case 264: + case 262: + case 231: + case 218: + case 174: + case 219: + cancellationToken.throwIfCancellationRequested(); + } + if (!textSpanIntersectsWith(span, node.pos, node.getFullWidth())) { + return; + } + if (isTypeNode(node) && !isExpressionWithTypeArguments(node)) { + return; + } + if (preferences.includeInlayVariableTypeHints && isVariableDeclaration(node)) { + visitVariableLikeDeclaration(node); + } else if (preferences.includeInlayPropertyDeclarationTypeHints && isPropertyDeclaration(node)) { + visitVariableLikeDeclaration(node); + } else if (preferences.includeInlayEnumMemberValueHints && isEnumMember(node)) { + visitEnumMember(node); + } else if (shouldShowParameterNameHints(preferences) && (isCallExpression(node) || isNewExpression(node))) { + visitCallOrNewExpression(node); + } else { + if (preferences.includeInlayFunctionParameterTypeHints && isFunctionLikeDeclaration(node) && hasContextSensitiveParameters(node)) { + visitFunctionLikeForParameterType(node); + } + if (preferences.includeInlayFunctionLikeReturnTypeHints && isSignatureSupportingReturnAnnotation(node)) { + visitFunctionDeclarationLikeForReturnType(node); + } + } + return forEachChild(node, visitor); + } + function isSignatureSupportingReturnAnnotation(node) { + return isArrowFunction(node) || isFunctionExpression(node) || isFunctionDeclaration(node) || isMethodDeclaration(node) || isGetAccessorDeclaration(node); + } + function addParameterHints(text, parameter, position, isFirstVariadicArgument) { + let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`; + let displayParts; + if (shouldUseInteractiveInlayHints(preferences)) { + displayParts = [getNodeDisplayPart(hintText, parameter), { text: ":" }]; + hintText = ""; + } else { + hintText += ":"; + } + result2.push({ + text: hintText, + position, + kind: "Parameter", + whitespaceAfter: true, + displayParts + }); + } + function addTypeHints(hintText, position) { + result2.push({ + text: typeof hintText === "string" ? `: ${hintText}` : "", + displayParts: typeof hintText === "string" ? void 0 : [{ text: ": " }, ...hintText], + position, + kind: "Type", + whitespaceBefore: true + }); + } + function addEnumMemberValueHints(text, position) { + result2.push({ + text: `= ${text}`, + position, + kind: "Enum", + whitespaceBefore: true + }); + } + function visitEnumMember(member) { + if (member.initializer) { + return; + } + const enumValue = checker.getConstantValue(member); + if (enumValue !== void 0) { + addEnumMemberValueHints(enumValue.toString(), member.end); + } + } + function isModuleReferenceType(type3) { + return type3.symbol && type3.symbol.flags & 1536; + } + function visitVariableLikeDeclaration(decl) { + if (!decl.initializer || isBindingPattern(decl.name) || isVariableDeclaration(decl) && !isHintableDeclaration(decl)) { + return; + } + const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(decl); + if (effectiveTypeAnnotation) { + return; + } + const declarationType = checker.getTypeAtLocation(decl); + if (isModuleReferenceType(declarationType)) { + return; + } + const hintParts = typeToInlayHintParts(declarationType); + if (hintParts) { + const hintText = typeof hintParts === "string" ? hintParts : hintParts.map((part) => part.text).join(""); + const isVariableNameMatchesType = preferences.includeInlayVariableTypeHintsWhenTypeMatchesName === false && equateStringsCaseInsensitive(decl.name.getText(), hintText); + if (isVariableNameMatchesType) { + return; + } + addTypeHints(hintParts, decl.name.end); + } + } + function visitCallOrNewExpression(expr) { + const args = expr.arguments; + if (!args || !args.length) { + return; + } + const candidates = []; + const signature = checker.getResolvedSignatureForSignatureHelp(expr, candidates); + if (!signature || !candidates.length) { + return; + } + let signatureParamPos = 0; + for (const originalArg of args) { + const arg = skipParentheses(originalArg); + if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) { + signatureParamPos++; + continue; + } + let spreadArgs = 0; + if (isSpreadElement(arg)) { + const spreadType = checker.getTypeAtLocation(arg.expression); + if (checker.isTupleType(spreadType)) { + const { elementFlags, fixedLength } = spreadType.target; + if (fixedLength === 0) { + continue; + } + const firstOptionalIndex = findIndex2(elementFlags, (f8) => !(f8 & 1)); + const requiredArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; + if (requiredArgs > 0) { + spreadArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; + } + } + } + const identifierInfo = checker.getParameterIdentifierInfoAtPosition(signature, signatureParamPos); + signatureParamPos = signatureParamPos + (spreadArgs || 1); + if (identifierInfo) { + const { parameter, parameterName, isRestParameter: isFirstVariadicArgument } = identifierInfo; + const isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName); + if (!isParameterNameNotSameAsArgument && !isFirstVariadicArgument) { + continue; + } + const name2 = unescapeLeadingUnderscores(parameterName); + if (leadingCommentsContainsParameterName(arg, name2)) { + continue; + } + addParameterHints(name2, parameter, originalArg.getStart(), isFirstVariadicArgument); + } + } + } + function identifierOrAccessExpressionPostfixMatchesParameterName(expr, parameterName) { + if (isIdentifier(expr)) { + return expr.text === parameterName; + } + if (isPropertyAccessExpression(expr)) { + return expr.name.text === parameterName; + } + return false; + } + function leadingCommentsContainsParameterName(node, name2) { + if (!isIdentifierText(name2, compilerOptions.target, getLanguageVariant(file.scriptKind))) { + return false; + } + const ranges = getLeadingCommentRanges(sourceFileText, node.pos); + if (!(ranges == null ? void 0 : ranges.length)) { + return false; + } + const regex = leadingParameterNameCommentRegexFactory(name2); + return some2(ranges, (range2) => regex.test(sourceFileText.substring(range2.pos, range2.end))); + } + function isHintableLiteral(node) { + switch (node.kind) { + case 224: { + const operand = node.operand; + return isLiteralExpression(operand) || isIdentifier(operand) && isInfinityOrNaNString(operand.escapedText); + } + case 112: + case 97: + case 106: + case 15: + case 228: + return true; + case 80: { + const name2 = node.escapedText; + return isUndefined3(name2) || isInfinityOrNaNString(name2); + } + } + return isLiteralExpression(node); + } + function visitFunctionDeclarationLikeForReturnType(decl) { + if (isArrowFunction(decl)) { + if (!findChildOfKind(decl, 21, file)) { + return; + } + } + const effectiveTypeAnnotation = getEffectiveReturnTypeNode(decl); + if (effectiveTypeAnnotation || !decl.body) { + return; + } + const signature = checker.getSignatureFromDeclaration(decl); + if (!signature) { + return; + } + const returnType = checker.getReturnTypeOfSignature(signature); + if (isModuleReferenceType(returnType)) { + return; + } + const hintParts = typeToInlayHintParts(returnType); + if (hintParts) { + addTypeHints(hintParts, getTypeAnnotationPosition(decl)); + } + } + function getTypeAnnotationPosition(decl) { + const closeParenToken = findChildOfKind(decl, 22, file); + if (closeParenToken) { + return closeParenToken.end; + } + return decl.parameters.end; + } + function visitFunctionLikeForParameterType(node) { + const signature = checker.getSignatureFromDeclaration(node); + if (!signature) { + return; + } + for (let i7 = 0; i7 < node.parameters.length && i7 < signature.parameters.length; ++i7) { + const param = node.parameters[i7]; + if (!isHintableDeclaration(param)) { + continue; + } + const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(param); + if (effectiveTypeAnnotation) { + continue; + } + const typeHints = getParameterDeclarationTypeHints(signature.parameters[i7]); + if (!typeHints) { + continue; + } + addTypeHints(typeHints, param.questionToken ? param.questionToken.end : param.name.end); + } + } + function getParameterDeclarationTypeHints(symbol) { + const valueDeclaration = symbol.valueDeclaration; + if (!valueDeclaration || !isParameter(valueDeclaration)) { + return void 0; + } + const signatureParamType = checker.getTypeOfSymbolAtLocation(symbol, valueDeclaration); + if (isModuleReferenceType(signatureParamType)) { + return void 0; + } + return typeToInlayHintParts(signatureParamType); + } + function printTypeInSingleLine(type3) { + const flags = 70221824 | 1048576 | 16384; + const printer = createPrinterWithRemoveComments(); + return usingSingleLineStringWriter((writer) => { + const typeNode = checker.typeToTypeNode( + type3, + /*enclosingDeclaration*/ + void 0, + flags + ); + Debug.assertIsDefined(typeNode, "should always get typenode"); + printer.writeNode( + 4, + typeNode, + /*sourceFile*/ + file, + writer + ); + }); + } + function typeToInlayHintParts(type3) { + if (!shouldUseInteractiveInlayHints(preferences)) { + return printTypeInSingleLine(type3); + } + const flags = 70221824 | 1048576 | 16384; + const typeNode = checker.typeToTypeNode( + type3, + /*enclosingDeclaration*/ + void 0, + flags + ); + Debug.assertIsDefined(typeNode, "should always get typenode"); + const parts = []; + visitForDisplayParts(typeNode); + return parts; + function visitForDisplayParts(node) { + var _a2, _b; + if (!node) { + return; + } + const tokenString = tokenToString(node.kind); + if (tokenString) { + parts.push({ text: tokenString }); + return; + } + if (isLiteralExpression(node)) { + parts.push({ text: getLiteralText2(node) }); + return; + } + switch (node.kind) { + case 80: + Debug.assertNode(node, isIdentifier); + const identifierText = idText(node); + const name2 = node.symbol && node.symbol.declarations && node.symbol.declarations.length && getNameOfDeclaration(node.symbol.declarations[0]); + if (name2) { + parts.push(getNodeDisplayPart(identifierText, name2)); + } else { + parts.push({ text: identifierText }); + } + break; + case 166: + Debug.assertNode(node, isQualifiedName); + visitForDisplayParts(node.left); + parts.push({ text: "." }); + visitForDisplayParts(node.right); + break; + case 182: + Debug.assertNode(node, isTypePredicateNode); + if (node.assertsModifier) { + parts.push({ text: "asserts " }); + } + visitForDisplayParts(node.parameterName); + if (node.type) { + parts.push({ text: " is " }); + visitForDisplayParts(node.type); + } + break; + case 183: + Debug.assertNode(node, isTypeReferenceNode); + visitForDisplayParts(node.typeName); + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 168: + Debug.assertNode(node, isTypeParameterDeclaration); + if (node.modifiers) { + visitDisplayPartList(node.modifiers, " "); + } + visitForDisplayParts(node.name); + if (node.constraint) { + parts.push({ text: " extends " }); + visitForDisplayParts(node.constraint); + } + if (node.default) { + parts.push({ text: " = " }); + visitForDisplayParts(node.default); + } + break; + case 169: + Debug.assertNode(node, isParameter); + if (node.modifiers) { + visitDisplayPartList(node.modifiers, " "); + } + if (node.dotDotDotToken) { + parts.push({ text: "..." }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 185: + Debug.assertNode(node, isConstructorTypeNode); + parts.push({ text: "new " }); + visitParametersAndTypeParameters(node); + parts.push({ text: " => " }); + visitForDisplayParts(node.type); + break; + case 186: + Debug.assertNode(node, isTypeQueryNode); + parts.push({ text: "typeof " }); + visitForDisplayParts(node.exprName); + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 187: + Debug.assertNode(node, isTypeLiteralNode); + parts.push({ text: "{" }); + if (node.members.length) { + parts.push({ text: " " }); + visitDisplayPartList(node.members, "; "); + parts.push({ text: " " }); + } + parts.push({ text: "}" }); + break; + case 188: + Debug.assertNode(node, isArrayTypeNode); + visitForDisplayParts(node.elementType); + parts.push({ text: "[]" }); + break; + case 189: + Debug.assertNode(node, isTupleTypeNode); + parts.push({ text: "[" }); + visitDisplayPartList(node.elements, ", "); + parts.push({ text: "]" }); + break; + case 202: + Debug.assertNode(node, isNamedTupleMember); + if (node.dotDotDotToken) { + parts.push({ text: "..." }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + break; + case 190: + Debug.assertNode(node, isOptionalTypeNode); + visitForDisplayParts(node.type); + parts.push({ text: "?" }); + break; + case 191: + Debug.assertNode(node, isRestTypeNode); + parts.push({ text: "..." }); + visitForDisplayParts(node.type); + break; + case 192: + Debug.assertNode(node, isUnionTypeNode); + visitDisplayPartList(node.types, " | "); + break; + case 193: + Debug.assertNode(node, isIntersectionTypeNode); + visitDisplayPartList(node.types, " & "); + break; + case 194: + Debug.assertNode(node, isConditionalTypeNode); + visitForDisplayParts(node.checkType); + parts.push({ text: " extends " }); + visitForDisplayParts(node.extendsType); + parts.push({ text: " ? " }); + visitForDisplayParts(node.trueType); + parts.push({ text: " : " }); + visitForDisplayParts(node.falseType); + break; + case 195: + Debug.assertNode(node, isInferTypeNode); + parts.push({ text: "infer " }); + visitForDisplayParts(node.typeParameter); + break; + case 196: + Debug.assertNode(node, isParenthesizedTypeNode); + parts.push({ text: "(" }); + visitForDisplayParts(node.type); + parts.push({ text: ")" }); + break; + case 198: + Debug.assertNode(node, isTypeOperatorNode); + parts.push({ text: `${tokenToString(node.operator)} ` }); + visitForDisplayParts(node.type); + break; + case 199: + Debug.assertNode(node, isIndexedAccessTypeNode); + visitForDisplayParts(node.objectType); + parts.push({ text: "[" }); + visitForDisplayParts(node.indexType); + parts.push({ text: "]" }); + break; + case 200: + Debug.assertNode(node, isMappedTypeNode); + parts.push({ text: "{ " }); + if (node.readonlyToken) { + if (node.readonlyToken.kind === 40) { + parts.push({ text: "+" }); + } else if (node.readonlyToken.kind === 41) { + parts.push({ text: "-" }); + } + parts.push({ text: "readonly " }); + } + parts.push({ text: "[" }); + visitForDisplayParts(node.typeParameter); + if (node.nameType) { + parts.push({ text: " as " }); + visitForDisplayParts(node.nameType); + } + parts.push({ text: "]" }); + if (node.questionToken) { + if (node.questionToken.kind === 40) { + parts.push({ text: "+" }); + } else if (node.questionToken.kind === 41) { + parts.push({ text: "-" }); + } + parts.push({ text: "?" }); + } + parts.push({ text: ": " }); + if (node.type) { + visitForDisplayParts(node.type); + } + parts.push({ text: "; }" }); + break; + case 201: + Debug.assertNode(node, isLiteralTypeNode); + visitForDisplayParts(node.literal); + break; + case 184: + Debug.assertNode(node, isFunctionTypeNode); + visitParametersAndTypeParameters(node); + parts.push({ text: " => " }); + visitForDisplayParts(node.type); + break; + case 205: + Debug.assertNode(node, isImportTypeNode); + if (node.isTypeOf) { + parts.push({ text: "typeof " }); + } + parts.push({ text: "import(" }); + visitForDisplayParts(node.argument); + if (node.assertions) { + parts.push({ text: ", { assert: " }); + visitDisplayPartList(node.assertions.assertClause.elements, ", "); + parts.push({ text: " }" }); + } + parts.push({ text: ")" }); + if (node.qualifier) { + parts.push({ text: "." }); + visitForDisplayParts(node.qualifier); + } + if (node.typeArguments) { + parts.push({ text: "<" }); + visitDisplayPartList(node.typeArguments, ", "); + parts.push({ text: ">" }); + } + break; + case 171: + Debug.assertNode(node, isPropertySignature); + if ((_a2 = node.modifiers) == null ? void 0 : _a2.length) { + visitDisplayPartList(node.modifiers, " "); + parts.push({ text: " " }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 181: + Debug.assertNode(node, isIndexSignatureDeclaration); + parts.push({ text: "[" }); + visitDisplayPartList(node.parameters, ", "); + parts.push({ text: "]" }); + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 173: + Debug.assertNode(node, isMethodSignature); + if ((_b = node.modifiers) == null ? void 0 : _b.length) { + visitDisplayPartList(node.modifiers, " "); + parts.push({ text: " " }); + } + visitForDisplayParts(node.name); + if (node.questionToken) { + parts.push({ text: "?" }); + } + visitParametersAndTypeParameters(node); + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 179: + Debug.assertNode(node, isCallSignatureDeclaration); + visitParametersAndTypeParameters(node); + if (node.type) { + parts.push({ text: ": " }); + visitForDisplayParts(node.type); + } + break; + case 207: + Debug.assertNode(node, isArrayBindingPattern); + parts.push({ text: "[" }); + visitDisplayPartList(node.elements, ", "); + parts.push({ text: "]" }); + break; + case 206: + Debug.assertNode(node, isObjectBindingPattern); + parts.push({ text: "{" }); + if (node.elements.length) { + parts.push({ text: " " }); + visitDisplayPartList(node.elements, ", "); + parts.push({ text: " " }); + } + parts.push({ text: "}" }); + break; + case 208: + Debug.assertNode(node, isBindingElement); + visitForDisplayParts(node.name); + break; + case 224: + Debug.assertNode(node, isPrefixUnaryExpression); + parts.push({ text: tokenToString(node.operator) }); + visitForDisplayParts(node.operand); + break; + case 203: + Debug.assertNode(node, isTemplateLiteralTypeNode); + visitForDisplayParts(node.head); + node.templateSpans.forEach(visitForDisplayParts); + break; + case 16: + Debug.assertNode(node, isTemplateHead); + parts.push({ text: getLiteralText2(node) }); + break; + case 204: + Debug.assertNode(node, isTemplateLiteralTypeSpan); + visitForDisplayParts(node.type); + visitForDisplayParts(node.literal); + break; + case 17: + Debug.assertNode(node, isTemplateMiddle); + parts.push({ text: getLiteralText2(node) }); + break; + case 18: + Debug.assertNode(node, isTemplateTail); + parts.push({ text: getLiteralText2(node) }); + break; + case 197: + Debug.assertNode(node, isThisTypeNode); + parts.push({ text: "this" }); + break; + default: + Debug.failBadSyntaxKind(node); + } + } + function visitParametersAndTypeParameters(signatureDeclaration) { + if (signatureDeclaration.typeParameters) { + parts.push({ text: "<" }); + visitDisplayPartList(signatureDeclaration.typeParameters, ", "); + parts.push({ text: ">" }); + } + parts.push({ text: "(" }); + visitDisplayPartList(signatureDeclaration.parameters, ", "); + parts.push({ text: ")" }); + } + function visitDisplayPartList(nodes, separator) { + nodes.forEach((node, index4) => { + if (index4 > 0) { + parts.push({ text: separator }); + } + visitForDisplayParts(node); + }); + } + function getLiteralText2(node) { + switch (node.kind) { + case 11: + return quotePreference === 0 ? `'${escapeString2( + node.text, + 39 + /* singleQuote */ + )}'` : `"${escapeString2( + node.text, + 34 + /* doubleQuote */ + )}"`; + case 16: + case 17: + case 18: { + const rawText = node.rawText ?? escapeTemplateSubstitution(escapeString2( + node.text, + 96 + /* backtick */ + )); + switch (node.kind) { + case 16: + return "`" + rawText + "${"; + case 17: + return "}" + rawText + "${"; + case 18: + return "}" + rawText + "`"; + } + } + } + return node.text; + } + } + function isUndefined3(name2) { + return name2 === "undefined"; + } + function isHintableDeclaration(node) { + if ((isParameterDeclaration(node) || isVariableDeclaration(node) && isVarConst(node)) && node.initializer) { + const initializer = skipParentheses(node.initializer); + return !(isHintableLiteral(initializer) || isNewExpression(initializer) || isObjectLiteralExpression(initializer) || isAssertionExpression(initializer)); + } + return true; + } + function getNodeDisplayPart(text, node) { + const sourceFile = node.getSourceFile(); + return { + text, + span: createTextSpanFromNode(node, sourceFile), + file: sourceFile.fileName + }; + } + } + var leadingParameterNameCommentRegexFactory; + var init_inlayHints = __esm2({ + "src/services/inlayHints.ts"() { + "use strict"; + init_ts4(); + leadingParameterNameCommentRegexFactory = (name2) => { + return new RegExp(`^\\s?/\\*\\*?\\s?${name2}\\s?\\*\\/\\s?$`); + }; + } + }); + var ts_InlayHints_exports = {}; + __export2(ts_InlayHints_exports, { + provideInlayHints: () => provideInlayHints + }); + var init_ts_InlayHints = __esm2({ + "src/services/_namespaces/ts.InlayHints.ts"() { + "use strict"; + init_inlayHints(); + } + }); + function getJsDocCommentsFromDeclarations(declarations, checker) { + const parts = []; + forEachUnique(declarations, (declaration) => { + for (const jsdoc of getCommentHavingNodes(declaration)) { + const inheritDoc = isJSDoc(jsdoc) && jsdoc.tags && find2(jsdoc.tags, (t8) => t8.kind === 334 && (t8.tagName.escapedText === "inheritDoc" || t8.tagName.escapedText === "inheritdoc")); + if (jsdoc.comment === void 0 && !inheritDoc || isJSDoc(jsdoc) && declaration.kind !== 353 && declaration.kind !== 345 && jsdoc.tags && jsdoc.tags.some( + (t8) => t8.kind === 353 || t8.kind === 345 + /* JSDocCallbackTag */ + ) && !jsdoc.tags.some( + (t8) => t8.kind === 348 || t8.kind === 349 + /* JSDocReturnTag */ + )) { + continue; + } + let newparts = jsdoc.comment ? getDisplayPartsFromComment(jsdoc.comment, checker) : []; + if (inheritDoc && inheritDoc.comment) { + newparts = newparts.concat(getDisplayPartsFromComment(inheritDoc.comment, checker)); + } + if (!contains2(parts, newparts, isIdenticalListOfDisplayParts)) { + parts.push(newparts); + } + } + }); + return flatten2(intersperse(parts, [lineBreakPart()])); + } + function isIdenticalListOfDisplayParts(parts1, parts2) { + return arraysEqual(parts1, parts2, (p1, p22) => p1.kind === p22.kind && p1.text === p22.text); + } + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 348: + case 355: + return [declaration]; + case 345: + case 353: + return [declaration, declaration.parent]; + case 330: + if (isJSDocOverloadTag(declaration.parent)) { + return [declaration.parent.parent]; + } + default: + return getJSDocCommentsAndTags(declaration); + } + } + function getJsDocTagsFromDeclarations(declarations, checker) { + const infos = []; + forEachUnique(declarations, (declaration) => { + const tags6 = getJSDocTags(declaration); + if (tags6.some( + (t8) => t8.kind === 353 || t8.kind === 345 + /* JSDocCallbackTag */ + ) && !tags6.some( + (t8) => t8.kind === 348 || t8.kind === 349 + /* JSDocReturnTag */ + )) { + return; + } + for (const tag of tags6) { + infos.push({ name: tag.tagName.text, text: getCommentDisplayParts(tag, checker) }); + infos.push(...getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(tag), checker)); + } + }); + return infos; + } + function getJSDocPropertyTagsInfo(nodes, checker) { + return flatMap2(nodes, (propTag) => concatenate([{ name: propTag.tagName.text, text: getCommentDisplayParts(propTag, checker) }], getJSDocPropertyTagsInfo(tryGetJSDocPropertyTags(propTag), checker))); + } + function tryGetJSDocPropertyTags(node) { + return isJSDocPropertyLikeTag(node) && node.isNameFirst && node.typeExpression && isJSDocTypeLiteral(node.typeExpression.type) ? node.typeExpression.type.jsDocPropertyTags : void 0; + } + function getDisplayPartsFromComment(comment, checker) { + if (typeof comment === "string") { + return [textPart(comment)]; + } + return flatMap2( + comment, + (node) => node.kind === 328 ? [textPart(node.text)] : buildLinkParts(node, checker) + ); + } + function getCommentDisplayParts(tag, checker) { + const { comment, kind } = tag; + const namePart = getTagNameDisplayPart(kind); + switch (kind) { + case 356: + const typeExpression = tag.typeExpression; + return typeExpression ? withNode(typeExpression) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); + case 336: + return withNode(tag.class); + case 335: + return withNode(tag.class); + case 352: + const templateTag = tag; + const displayParts = []; + if (templateTag.constraint) { + displayParts.push(textPart(templateTag.constraint.getText())); + } + if (length(templateTag.typeParameters)) { + if (length(displayParts)) { + displayParts.push(spacePart()); + } + const lastTypeParameter = templateTag.typeParameters[templateTag.typeParameters.length - 1]; + forEach4(templateTag.typeParameters, (tp) => { + displayParts.push(namePart(tp.getText())); + if (lastTypeParameter !== tp) { + displayParts.push(...[punctuationPart( + 28 + /* CommaToken */ + ), spacePart()]); + } + }); + } + if (comment) { + displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]); + } + return displayParts; + case 351: + case 357: + return withNode(tag.typeExpression); + case 353: + case 345: + case 355: + case 348: + case 354: + const { name: name2 } = tag; + return name2 ? withNode(name2) : comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); + default: + return comment === void 0 ? void 0 : getDisplayPartsFromComment(comment, checker); + } + function withNode(node) { + return addComment(node.getText()); + } + function addComment(s7) { + if (comment) { + if (s7.match(/^https?$/)) { + return [textPart(s7), ...getDisplayPartsFromComment(comment, checker)]; + } else { + return [namePart(s7), spacePart(), ...getDisplayPartsFromComment(comment, checker)]; + } + } else { + return [textPart(s7)]; + } + } + } + function getTagNameDisplayPart(kind) { + switch (kind) { + case 348: + return parameterNamePart; + case 355: + return propertyNamePart; + case 352: + return typeParameterNamePart; + case 353: + case 345: + return typeAliasNamePart; + default: + return textPart; + } + } + function getJSDocTagNameCompletions() { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = map4(jsDocTagNames, (tagName) => { + return { + name: tagName, + kind: "keyword", + kindModifiers: "", + sortText: ts_Completions_exports.SortText.LocationPriority + }; + })); + } + function getJSDocTagCompletions() { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = map4(jsDocTagNames, (tagName) => { + return { + name: `@${tagName}`, + kind: "keyword", + kindModifiers: "", + sortText: ts_Completions_exports.SortText.LocationPriority + }; + })); + } + function getJSDocTagCompletionDetails(name2) { + return { + name: name2, + kind: "", + // TODO: should have its own kind? + kindModifiers: "", + displayParts: [textPart(name2)], + documentation: emptyArray, + tags: void 0, + codeActions: void 0 + }; + } + function getJSDocParameterNameCompletions(tag) { + if (!isIdentifier(tag.name)) { + return emptyArray; + } + const nameThusFar = tag.name.text; + const jsdoc = tag.parent; + const fn = jsdoc.parent; + if (!isFunctionLike(fn)) + return []; + return mapDefined(fn.parameters, (param) => { + if (!isIdentifier(param.name)) + return void 0; + const name2 = param.name.text; + if (jsdoc.tags.some((t8) => t8 !== tag && isJSDocParameterTag(t8) && isIdentifier(t8.name) && t8.name.escapedText === name2) || nameThusFar !== void 0 && !startsWith2(name2, nameThusFar)) { + return void 0; + } + return { name: name2, kind: "parameter", kindModifiers: "", sortText: ts_Completions_exports.SortText.LocationPriority }; + }); + } + function getJSDocParameterNameCompletionDetails(name2) { + return { + name: name2, + kind: "parameter", + kindModifiers: "", + displayParts: [textPart(name2)], + documentation: emptyArray, + tags: void 0, + codeActions: void 0 + }; + } + function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options) { + const tokenAtPos = getTokenAtPosition(sourceFile, position); + const existingDocComment = findAncestor(tokenAtPos, isJSDoc); + if (existingDocComment && (existingDocComment.comment !== void 0 || length(existingDocComment.tags))) { + return void 0; + } + const tokenStart = tokenAtPos.getStart(sourceFile); + if (!existingDocComment && tokenStart < position) { + return void 0; + } + const commentOwnerInfo = getCommentOwnerInfo(tokenAtPos, options); + if (!commentOwnerInfo) { + return void 0; + } + const { commentOwner, parameters, hasReturn: hasReturn2 } = commentOwnerInfo; + const commentOwnerJsDoc = hasJSDocNodes(commentOwner) && commentOwner.jsDoc ? commentOwner.jsDoc : void 0; + const lastJsDoc = lastOrUndefined(commentOwnerJsDoc); + if (commentOwner.getStart(sourceFile) < position || lastJsDoc && existingDocComment && lastJsDoc !== existingDocComment) { + return void 0; + } + const indentationStr = getIndentationStringAtPosition(sourceFile, position); + const isJavaScriptFile = hasJSFileExtension(sourceFile.fileName); + const tags6 = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : ""); + const openComment = "/**"; + const closeComment = " */"; + const hasTag = length(getJSDocTags(commentOwner)) > 0; + if (tags6 && !hasTag) { + const preamble = openComment + newLine + indentationStr + " * "; + const endLine = tokenStart === position ? newLine + indentationStr : ""; + const result2 = preamble + newLine + tags6 + indentationStr + closeComment + endLine; + return { newText: result2, caretOffset: preamble.length }; + } + return { newText: openComment + closeComment, caretOffset: 3 }; + } + function getIndentationStringAtPosition(sourceFile, position) { + const { text } = sourceFile; + const lineStart = getLineStartPositionForPosition(position, sourceFile); + let pos = lineStart; + for (; pos <= position && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) + ; + return text.slice(lineStart, pos); + } + function parameterDocComments(parameters, isJavaScriptFile, indentationStr, newLine) { + return parameters.map(({ name: name2, dotDotDotToken }, i7) => { + const paramName = name2.kind === 80 ? name2.text : "param" + i7; + const type3 = isJavaScriptFile ? dotDotDotToken ? "{...any} " : "{any} " : ""; + return `${indentationStr} * @param ${type3}${paramName}${newLine}`; + }).join(""); + } + function returnsDocComment(indentationStr, newLine) { + return `${indentationStr} * @returns${newLine}`; + } + function getCommentOwnerInfo(tokenAtPos, options) { + return forEachAncestor(tokenAtPos, (n7) => getCommentOwnerInfoWorker(n7, options)); + } + function getCommentOwnerInfoWorker(commentOwner, options) { + switch (commentOwner.kind) { + case 262: + case 218: + case 174: + case 176: + case 173: + case 219: + const host = commentOwner; + return { commentOwner, parameters: host.parameters, hasReturn: hasReturn(host, options) }; + case 303: + return getCommentOwnerInfoWorker(commentOwner.initializer, options); + case 263: + case 264: + case 266: + case 306: + case 265: + return { commentOwner }; + case 171: { + const host2 = commentOwner; + return host2.type && isFunctionTypeNode(host2.type) ? { commentOwner, parameters: host2.type.parameters, hasReturn: hasReturn(host2.type, options) } : { commentOwner }; + } + case 243: { + const varStatement = commentOwner; + const varDeclarations = varStatement.declarationList.declarations; + const host2 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getRightHandSideOfAssignment(varDeclarations[0].initializer) : void 0; + return host2 ? { commentOwner, parameters: host2.parameters, hasReturn: hasReturn(host2, options) } : { commentOwner }; + } + case 312: + return "quit"; + case 267: + return commentOwner.parent.kind === 267 ? void 0 : { commentOwner }; + case 244: + return getCommentOwnerInfoWorker(commentOwner.expression, options); + case 226: { + const be4 = commentOwner; + if (getAssignmentDeclarationKind(be4) === 0) { + return "quit"; + } + return isFunctionLike(be4.right) ? { commentOwner, parameters: be4.right.parameters, hasReturn: hasReturn(be4.right, options) } : { commentOwner }; + } + case 172: + const init2 = commentOwner.initializer; + if (init2 && (isFunctionExpression(init2) || isArrowFunction(init2))) { + return { commentOwner, parameters: init2.parameters, hasReturn: hasReturn(init2, options) }; + } + } + } + function hasReturn(node, options) { + return !!(options == null ? void 0 : options.generateReturnInDocTemplate) && (isFunctionTypeNode(node) || isArrowFunction(node) && isExpression(node.body) || isFunctionLikeDeclaration(node) && node.body && isBlock2(node.body) && !!forEachReturnStatement(node.body, (n7) => n7)); + } + function getRightHandSideOfAssignment(rightHandSide) { + while (rightHandSide.kind === 217) { + rightHandSide = rightHandSide.expression; + } + switch (rightHandSide.kind) { + case 218: + case 219: + return rightHandSide; + case 231: + return find2(rightHandSide.members, isConstructorDeclaration); + } + } + var jsDocTagNames, jsDocTagNameCompletionEntries, jsDocTagCompletionEntries, getJSDocTagNameCompletionDetails; + var init_jsDoc = __esm2({ + "src/services/jsDoc.ts"() { + "use strict"; + init_ts4(); + jsDocTagNames = [ + "abstract", + "access", + "alias", + "argument", + "async", + "augments", + "author", + "borrows", + "callback", + "class", + "classdesc", + "constant", + "constructor", + "constructs", + "copyright", + "default", + "deprecated", + "description", + "emits", + "enum", + "event", + "example", + "exports", + "extends", + "external", + "field", + "file", + "fileoverview", + "fires", + "function", + "generator", + "global", + "hideconstructor", + "host", + "ignore", + "implements", + "inheritdoc", + "inner", + "instance", + "interface", + "kind", + "lends", + "license", + "link", + "linkcode", + "linkplain", + "listens", + "member", + "memberof", + "method", + "mixes", + "module", + "name", + "namespace", + "overload", + "override", + "package", + "param", + "private", + "prop", + "property", + "protected", + "public", + "readonly", + "requires", + "returns", + "satisfies", + "see", + "since", + "static", + "summary", + "template", + "this", + "throws", + "todo", + "tutorial", + "type", + "typedef", + "var", + "variation", + "version", + "virtual", + "yields" + ]; + getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails; + } + }); + var ts_JsDoc_exports = {}; + __export2(ts_JsDoc_exports, { + getDocCommentTemplateAtPosition: () => getDocCommentTemplateAtPosition, + getJSDocParameterNameCompletionDetails: () => getJSDocParameterNameCompletionDetails, + getJSDocParameterNameCompletions: () => getJSDocParameterNameCompletions, + getJSDocTagCompletionDetails: () => getJSDocTagCompletionDetails, + getJSDocTagCompletions: () => getJSDocTagCompletions, + getJSDocTagNameCompletionDetails: () => getJSDocTagNameCompletionDetails, + getJSDocTagNameCompletions: () => getJSDocTagNameCompletions, + getJsDocCommentsFromDeclarations: () => getJsDocCommentsFromDeclarations, + getJsDocTagsFromDeclarations: () => getJsDocTagsFromDeclarations + }); + var init_ts_JsDoc = __esm2({ + "src/services/_namespaces/ts.JsDoc.ts"() { + "use strict"; + init_jsDoc(); + } + }); + function organizeImports(sourceFile, formatContext, host, program, preferences, mode) { + const changeTracker = ts_textChanges_exports.ChangeTracker.fromContext({ host, formatContext, preferences }); + const shouldSort = mode === "SortAndCombine" || mode === "All"; + const shouldCombine = shouldSort; + const shouldRemove = mode === "RemoveUnused" || mode === "All"; + const topLevelImportGroupDecls = groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)); + const comparer = getOrganizeImportsComparerWithDetection(preferences, shouldSort ? () => detectSortingWorker(topLevelImportGroupDecls, preferences) === 2 : void 0); + const processImportsOfSameModuleSpecifier = (importGroup) => { + if (shouldRemove) + importGroup = removeUnusedImports(importGroup, sourceFile, program); + if (shouldCombine) + importGroup = coalesceImportsWorker(importGroup, comparer, sourceFile, preferences); + if (shouldSort) + importGroup = stableSort(importGroup, (s1, s22) => compareImportsOrRequireStatements(s1, s22, comparer)); + return importGroup; + }; + topLevelImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); + if (mode !== "RemoveUnused") { + getTopLevelExportGroups(sourceFile).forEach((exportGroupDecl) => organizeImportsWorker(exportGroupDecl, (group22) => coalesceExportsWorker(group22, comparer, preferences))); + } + for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { + if (!ambientModule.body) + continue; + const ambientModuleImportGroupDecls = groupByNewlineContiguous(sourceFile, ambientModule.body.statements.filter(isImportDeclaration)); + ambientModuleImportGroupDecls.forEach((importGroupDecl) => organizeImportsWorker(importGroupDecl, processImportsOfSameModuleSpecifier)); + if (mode !== "RemoveUnused") { + const ambientModuleExportDecls = ambientModule.body.statements.filter(isExportDeclaration); + organizeImportsWorker(ambientModuleExportDecls, (group22) => coalesceExportsWorker(group22, comparer, preferences)); + } + } + return changeTracker.getChanges(); + function organizeImportsWorker(oldImportDecls, coalesce) { + if (length(oldImportDecls) === 0) { + return; + } + setEmitFlags( + oldImportDecls[0], + 1024 + /* NoLeadingComments */ + ); + const oldImportGroups = shouldCombine ? group2(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls]; + const sortedImportGroups = shouldSort ? stableSort(oldImportGroups, (group1, group22) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group22[0].moduleSpecifier, comparer)) : oldImportGroups; + const newImportDecls = flatMap2(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup); + if (newImportDecls.length === 0) { + changeTracker.deleteNodes( + sourceFile, + oldImportDecls, + { + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include + }, + /*hasTrailingComment*/ + true + ); + } else { + const replaceOptions = { + leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, + // Leave header comment in place + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include, + suffix: getNewLineOrDefaultFromHost(host, formatContext.options) + }; + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); + const hasTrailingComment = changeTracker.nodeHasTrailingComment(sourceFile, oldImportDecls[0], replaceOptions); + changeTracker.deleteNodes(sourceFile, oldImportDecls.slice(1), { + trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Include + }, hasTrailingComment); + } + } + } + function groupByNewlineContiguous(sourceFile, decls) { + const scanner2 = createScanner3( + sourceFile.languageVersion, + /*skipTrivia*/ + false, + sourceFile.languageVariant + ); + const group22 = []; + let groupIndex = 0; + for (const decl of decls) { + if (group22[groupIndex] && isNewGroup(sourceFile, decl, scanner2)) { + groupIndex++; + } + if (!group22[groupIndex]) { + group22[groupIndex] = []; + } + group22[groupIndex].push(decl); + } + return group22; + } + function isNewGroup(sourceFile, decl, scanner2) { + const startPos = decl.getFullStart(); + const endPos = decl.getStart(); + scanner2.setText(sourceFile.text, startPos, endPos - startPos); + let numberOfNewLines = 0; + while (scanner2.getTokenStart() < endPos) { + const tokenKind = scanner2.scan(); + if (tokenKind === 4) { + numberOfNewLines++; + if (numberOfNewLines >= 2) { + return true; + } + } + } + return false; + } + function removeUnusedImports(oldImports, sourceFile, program) { + const typeChecker = program.getTypeChecker(); + const compilerOptions = program.getCompilerOptions(); + const jsxNamespace = typeChecker.getJsxNamespace(sourceFile); + const jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile); + const jsxElementsPresent = !!(sourceFile.transformFlags & 2); + const usedImports = []; + for (const importDecl of oldImports) { + const { importClause, moduleSpecifier } = importDecl; + if (!importClause) { + usedImports.push(importDecl); + continue; + } + let { name: name2, namedBindings } = importClause; + if (name2 && !isDeclarationUsed(name2)) { + name2 = void 0; + } + if (namedBindings) { + if (isNamespaceImport(namedBindings)) { + if (!isDeclarationUsed(namedBindings.name)) { + namedBindings = void 0; + } + } else { + const newElements = namedBindings.elements.filter((e10) => isDeclarationUsed(e10.name)); + if (newElements.length < namedBindings.elements.length) { + namedBindings = newElements.length ? factory.updateNamedImports(namedBindings, newElements) : void 0; + } + } + } + if (name2 || namedBindings) { + usedImports.push(updateImportDeclarationAndClause(importDecl, name2, namedBindings)); + } else if (hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier)) { + if (sourceFile.isDeclarationFile) { + usedImports.push(factory.createImportDeclaration( + importDecl.modifiers, + /*importClause*/ + void 0, + moduleSpecifier, + /*attributes*/ + void 0 + )); + } else { + usedImports.push(importDecl); + } + } + } + return usedImports; + function isDeclarationUsed(identifier) { + return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) && jsxModeNeedsExplicitImport(compilerOptions.jsx) || ts_FindAllReferences_exports.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); + } + } + function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) { + const moduleSpecifierText = isStringLiteral(moduleSpecifier) && moduleSpecifier.text; + return isString4(moduleSpecifierText) && some2(sourceFile.moduleAugmentations, (moduleName3) => isStringLiteral(moduleName3) && moduleName3.text === moduleSpecifierText); + } + function getExternalModuleName2(specifier) { + return specifier !== void 0 && isStringLiteralLike(specifier) ? specifier.text : void 0; + } + function coalesceImports(importGroup, ignoreCase, sourceFile, preferences) { + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceImportsWorker(importGroup, comparer, sourceFile, preferences); + } + function coalesceImportsWorker(importGroup, comparer, sourceFile, preferences) { + if (importGroup.length === 0) { + return importGroup; + } + const importGroupsByAttributes = groupBy2(importGroup, (decl) => { + if (decl.attributes) { + let attrs = decl.attributes.token + " "; + for (const x7 of sort(decl.attributes.elements, (x22, y7) => compareStringsCaseSensitive(x22.name.text, y7.name.text))) { + attrs += x7.name.text + ":"; + attrs += isStringLiteralLike(x7.value) ? `"${x7.value.text}"` : x7.value.getText() + " "; + } + return attrs; + } + return ""; + }); + const coalescedImports = []; + for (const attribute in importGroupsByAttributes) { + const importGroupSameAttrs = importGroupsByAttributes[attribute]; + const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroupSameAttrs); + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + for (const group22 of [regularImports, typeOnlyImports]) { + const isTypeOnly = group22 === typeOnlyImports; + const { defaultImports, namespaceImports, namedImports } = group22; + if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + const defaultImport = defaultImports[0]; + coalescedImports.push( + updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings) + ); + continue; + } + const sortedNamespaceImports = stableSort(namespaceImports, (i1, i22) => comparer(i1.importClause.namedBindings.name.text, i22.importClause.namedBindings.name.text)); + for (const namespaceImport of sortedNamespaceImports) { + coalescedImports.push( + updateImportDeclarationAndClause( + namespaceImport, + /*name*/ + void 0, + namespaceImport.importClause.namedBindings + ) + ); + } + const firstDefaultImport = firstOrUndefined(defaultImports); + const firstNamedImport = firstOrUndefined(namedImports); + const importDecl = firstDefaultImport ?? firstNamedImport; + if (!importDecl) { + continue; + } + let newDefaultImport; + const newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0].importClause.name; + } else { + for (const defaultImport of defaultImports) { + newImportSpecifiers.push( + factory.createImportSpecifier( + /*isTypeOnly*/ + false, + factory.createIdentifier("default"), + defaultImport.importClause.name + ) + ); + } + } + newImportSpecifiers.push(...getNewImportSpecifiers(namedImports)); + const sortedImportSpecifiers = factory.createNodeArray( + sortSpecifiers(newImportSpecifiers, comparer, preferences), + firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma + ); + const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers); + if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) { + setEmitFlags( + newNamedImports, + 2 + /* MultiLine */ + ); + } + if (isTypeOnly && newDefaultImport && newNamedImports) { + coalescedImports.push( + updateImportDeclarationAndClause( + importDecl, + newDefaultImport, + /*namedBindings*/ + void 0 + ) + ); + coalescedImports.push( + updateImportDeclarationAndClause( + firstNamedImport ?? importDecl, + /*name*/ + void 0, + newNamedImports + ) + ); + } else { + coalescedImports.push( + updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports) + ); + } + } + } + return coalescedImports; + } + function getCategorizedImports(importGroup) { + let importWithoutClause; + const typeOnlyImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; + const regularImports = { defaultImports: [], namespaceImports: [], namedImports: [] }; + for (const importDeclaration of importGroup) { + if (importDeclaration.importClause === void 0) { + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + const group22 = importDeclaration.importClause.isTypeOnly ? typeOnlyImports : regularImports; + const { name: name2, namedBindings } = importDeclaration.importClause; + if (name2) { + group22.defaultImports.push(importDeclaration); + } + if (namedBindings) { + if (isNamespaceImport(namedBindings)) { + group22.namespaceImports.push(importDeclaration); + } else { + group22.namedImports.push(importDeclaration); + } + } + } + return { + importWithoutClause, + typeOnlyImports, + regularImports + }; + } + function coalesceExports(exportGroup, ignoreCase, preferences) { + const comparer = getOrganizeImportsOrdinalStringComparer(ignoreCase); + return coalesceExportsWorker(exportGroup, comparer, preferences); + } + function coalesceExportsWorker(exportGroup, comparer, preferences) { + if (exportGroup.length === 0) { + return exportGroup; + } + const { exportWithoutClause, namedExports, typeOnlyExports } = getCategorizedExports(exportGroup); + const coalescedExports = []; + if (exportWithoutClause) { + coalescedExports.push(exportWithoutClause); + } + for (const exportGroup2 of [namedExports, typeOnlyExports]) { + if (exportGroup2.length === 0) { + continue; + } + const newExportSpecifiers = []; + newExportSpecifiers.push(...flatMap2(exportGroup2, (i7) => i7.exportClause && isNamedExports(i7.exportClause) ? i7.exportClause.elements : emptyArray)); + const sortedExportSpecifiers = sortSpecifiers(newExportSpecifiers, comparer, preferences); + const exportDecl = exportGroup2[0]; + coalescedExports.push( + factory.updateExportDeclaration( + exportDecl, + exportDecl.modifiers, + exportDecl.isTypeOnly, + exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)), + exportDecl.moduleSpecifier, + exportDecl.attributes + ) + ); + } + return coalescedExports; + function getCategorizedExports(exportGroup2) { + let exportWithoutClause2; + const namedExports2 = []; + const typeOnlyExports2 = []; + for (const exportDeclaration of exportGroup2) { + if (exportDeclaration.exportClause === void 0) { + exportWithoutClause2 = exportWithoutClause2 || exportDeclaration; + } else if (exportDeclaration.isTypeOnly) { + typeOnlyExports2.push(exportDeclaration); + } else { + namedExports2.push(exportDeclaration); + } + } + return { + exportWithoutClause: exportWithoutClause2, + namedExports: namedExports2, + typeOnlyExports: typeOnlyExports2 + }; + } + } + function updateImportDeclarationAndClause(importDeclaration, name2, namedBindings) { + return factory.updateImportDeclaration( + importDeclaration, + importDeclaration.modifiers, + factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name2, namedBindings), + // TODO: GH#18217 + importDeclaration.moduleSpecifier, + importDeclaration.attributes + ); + } + function sortSpecifiers(specifiers, comparer, preferences) { + return stableSort(specifiers, (s1, s22) => compareImportOrExportSpecifiers(s1, s22, comparer, preferences)); + } + function compareImportOrExportSpecifiers(s1, s22, comparer, preferences) { + switch (preferences == null ? void 0 : preferences.organizeImportsTypeOrder) { + case "first": + return compareBooleans(s22.isTypeOnly, s1.isTypeOnly) || comparer(s1.name.text, s22.name.text); + case "inline": + return comparer(s1.name.text, s22.name.text); + default: + return compareBooleans(s1.isTypeOnly, s22.isTypeOnly) || comparer(s1.name.text, s22.name.text); + } + } + function compareModuleSpecifiers2(m1, m22, ignoreCase) { + const comparer = getOrganizeImportsOrdinalStringComparer(!!ignoreCase); + return compareModuleSpecifiersWorker(m1, m22, comparer); + } + function compareModuleSpecifiersWorker(m1, m22, comparer) { + const name1 = m1 === void 0 ? void 0 : getExternalModuleName2(m1); + const name2 = m22 === void 0 ? void 0 : getExternalModuleName2(m22); + return compareBooleans(name1 === void 0, name2 === void 0) || compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || comparer(name1, name2); + } + function getModuleSpecifierExpression(declaration) { + var _a2; + switch (declaration.kind) { + case 271: + return (_a2 = tryCast(declaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a2.expression; + case 272: + return declaration.moduleSpecifier; + case 243: + return declaration.declarationList.declarations[0].initializer.arguments[0]; + } + } + function detectSorting(sourceFile, preferences) { + return detectSortingWorker( + groupByNewlineContiguous(sourceFile, sourceFile.statements.filter(isImportDeclaration)), + preferences + ); + } + function detectSortingWorker(importGroups, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + let sortState = 3; + let seenUnsortedGroup = false; + for (const importGroup of importGroups) { + if (importGroup.length > 1) { + const moduleSpecifierSort = detectSortCaseSensitivity( + importGroup, + (i7) => { + var _a2; + return ((_a2 = tryCast(i7.moduleSpecifier, isStringLiteral)) == null ? void 0 : _a2.text) ?? ""; + }, + collateCaseSensitive, + collateCaseInsensitive + ); + if (moduleSpecifierSort) { + sortState &= moduleSpecifierSort; + seenUnsortedGroup = true; + } + if (!sortState) { + return sortState; + } + } + const declarationWithNamedImports = find2( + importGroup, + (i7) => { + var _a2, _b; + return ((_b = tryCast((_a2 = i7.importClause) == null ? void 0 : _a2.namedBindings, isNamedImports)) == null ? void 0 : _b.elements.length) > 1; + } + ); + if (declarationWithNamedImports) { + const namedImportSort = detectImportSpecifierSorting(declarationWithNamedImports.importClause.namedBindings.elements, preferences); + if (namedImportSort) { + sortState &= namedImportSort; + seenUnsortedGroup = true; + } + if (!sortState) { + return sortState; + } + } + if (sortState !== 3) { + return sortState; + } + } + return seenUnsortedGroup ? 0 : sortState; + } + function detectImportDeclarationSorting(imports, preferences) { + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + return detectSortCaseSensitivity( + imports, + (s7) => getExternalModuleName2(getModuleSpecifierExpression(s7)) || "", + collateCaseSensitive, + collateCaseInsensitive + ); + } + function getImportDeclarationInsertionIndex(sortedImports, newImport, comparer) { + const index4 = binarySearch(sortedImports, newImport, identity2, (a7, b8) => compareImportsOrRequireStatements(a7, b8, comparer)); + return index4 < 0 ? ~index4 : index4; + } + function getImportSpecifierInsertionIndex(sortedImports, newImport, comparer, preferences) { + const index4 = binarySearch(sortedImports, newImport, identity2, (s1, s22) => compareImportOrExportSpecifiers(s1, s22, comparer, preferences)); + return index4 < 0 ? ~index4 : index4; + } + function compareImportsOrRequireStatements(s1, s22, comparer) { + return compareModuleSpecifiersWorker(getModuleSpecifierExpression(s1), getModuleSpecifierExpression(s22), comparer) || compareImportKind(s1, s22); + } + function compareImportKind(s1, s22) { + return compareValues(getImportKindOrder(s1), getImportKindOrder(s22)); + } + function getImportKindOrder(s1) { + var _a2; + switch (s1.kind) { + case 272: + if (!s1.importClause) + return 0; + if (s1.importClause.isTypeOnly) + return 1; + if (((_a2 = s1.importClause.namedBindings) == null ? void 0 : _a2.kind) === 274) + return 2; + if (s1.importClause.name) + return 3; + return 4; + case 271: + return 5; + case 243: + return 6; + } + } + function getNewImportSpecifiers(namedImports) { + return flatMap2(namedImports, (namedImport) => map4(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText ? factory.updateImportSpecifier( + importSpecifier, + importSpecifier.isTypeOnly, + /*propertyName*/ + void 0, + importSpecifier.name + ) : importSpecifier)); + } + function tryGetNamedBindingElements(namedImport) { + var _a2; + return ((_a2 = namedImport.importClause) == null ? void 0 : _a2.namedBindings) && isNamedImports(namedImport.importClause.namedBindings) ? namedImport.importClause.namedBindings.elements : void 0; + } + function getOrganizeImportsOrdinalStringComparer(ignoreCase) { + return ignoreCase ? compareStringsCaseInsensitiveEslintCompatible : compareStringsCaseSensitive; + } + function getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) { + const resolvedLocale = getOrganizeImportsLocale(preferences); + const caseFirst = preferences.organizeImportsCaseFirst ?? false; + const numeric = preferences.organizeImportsNumericCollation ?? false; + const accents = preferences.organizeImportsAccentCollation ?? true; + const sensitivity = ignoreCase ? accents ? "accent" : "base" : accents ? "variant" : "case"; + const collator = new Intl.Collator(resolvedLocale, { + usage: "sort", + caseFirst: caseFirst || "false", + sensitivity, + numeric + }); + return collator.compare; + } + function getOrganizeImportsLocale(preferences) { + let locale = preferences.organizeImportsLocale; + if (locale === "auto") + locale = getUILocale(); + if (locale === void 0) + locale = "en"; + const supportedLocales = Intl.Collator.supportedLocalesOf(locale); + const resolvedLocale = supportedLocales.length ? supportedLocales[0] : "en"; + return resolvedLocale; + } + function getOrganizeImportsComparer(preferences, ignoreCase) { + const collation = preferences.organizeImportsCollation ?? "ordinal"; + return collation === "unicode" ? getOrganizeImportsUnicodeStringComparer(ignoreCase, preferences) : getOrganizeImportsOrdinalStringComparer(ignoreCase); + } + function getOrganizeImportsComparerWithDetection(preferences, detectIgnoreCase) { + const ignoreCase = typeof preferences.organizeImportsIgnoreCase === "boolean" ? preferences.organizeImportsIgnoreCase : (detectIgnoreCase == null ? void 0 : detectIgnoreCase()) ?? false; + return getOrganizeImportsComparer(preferences, ignoreCase); + } + function getTopLevelExportGroups(sourceFile) { + const topLevelExportGroups = []; + const statements = sourceFile.statements; + const len = length(statements); + let i7 = 0; + let groupIndex = 0; + while (i7 < len) { + if (isExportDeclaration(statements[i7])) { + if (topLevelExportGroups[groupIndex] === void 0) { + topLevelExportGroups[groupIndex] = []; + } + const exportDecl = statements[i7]; + if (exportDecl.moduleSpecifier) { + topLevelExportGroups[groupIndex].push(exportDecl); + i7++; + } else { + while (i7 < len && isExportDeclaration(statements[i7])) { + topLevelExportGroups[groupIndex].push(statements[i7++]); + } + groupIndex++; + } + } else { + i7++; + } + } + return flatMap2(topLevelExportGroups, (exportGroupDecls) => groupByNewlineContiguous(sourceFile, exportGroupDecls)); + } + var ImportSpecifierSortingCache, detectImportSpecifierSorting; + var init_organizeImports = __esm2({ + "src/services/organizeImports.ts"() { + "use strict"; + init_ts4(); + ImportSpecifierSortingCache = class { + has([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return false; + return this._cache.has(specifiers); + } + get([specifiers, preferences]) { + if (this._lastPreferences !== preferences || !this._cache) + return void 0; + return this._cache.get(specifiers); + } + set([specifiers, preferences], value2) { + if (this._lastPreferences !== preferences) { + this._lastPreferences = preferences; + this._cache = void 0; + } + this._cache ?? (this._cache = /* @__PURE__ */ new WeakMap()); + this._cache.set(specifiers, value2); + } + }; + detectImportSpecifierSorting = memoizeCached((specifiers, preferences) => { + switch (preferences.organizeImportsTypeOrder) { + case "first": + if (!arrayIsSorted(specifiers, (s1, s22) => compareBooleans(s22.isTypeOnly, s1.isTypeOnly))) + return 0; + break; + case "inline": + if (!arrayIsSorted(specifiers, (s1, s22) => { + const comparer = getStringComparer( + /*ignoreCase*/ + true + ); + return comparer(s1.name.text, s22.name.text); + })) { + return 0; + } + break; + default: + if (!arrayIsSorted(specifiers, (s1, s22) => compareBooleans(s1.isTypeOnly, s22.isTypeOnly))) + return 0; + break; + } + const collateCaseSensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + false + ); + const collateCaseInsensitive = getOrganizeImportsComparer( + preferences, + /*ignoreCase*/ + true + ); + if (preferences.organizeImportsTypeOrder !== "inline") { + const { type: regularImports, regular: typeImports } = groupBy2(specifiers, (s7) => s7.isTypeOnly ? "type" : "regular"); + const regularCaseSensitivity = (regularImports == null ? void 0 : regularImports.length) ? detectSortCaseSensitivity(regularImports, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive) : void 0; + const typeCaseSensitivity = (typeImports == null ? void 0 : typeImports.length) ? detectSortCaseSensitivity(typeImports, (specifier) => specifier.name.text ?? "", collateCaseSensitive, collateCaseInsensitive) : void 0; + if (regularCaseSensitivity === void 0) { + return typeCaseSensitivity ?? 0; + } + if (typeCaseSensitivity === void 0) { + return regularCaseSensitivity; + } + if (regularCaseSensitivity === 0 || typeCaseSensitivity === 0) { + return 0; + } + return typeCaseSensitivity & regularCaseSensitivity; + } + return detectSortCaseSensitivity(specifiers, (specifier) => specifier.name.text, collateCaseSensitive, collateCaseInsensitive); + }, new ImportSpecifierSortingCache()); + } + }); + var ts_OrganizeImports_exports = {}; + __export2(ts_OrganizeImports_exports, { + coalesceExports: () => coalesceExports, + coalesceImports: () => coalesceImports, + compareImportOrExportSpecifiers: () => compareImportOrExportSpecifiers, + compareImportsOrRequireStatements: () => compareImportsOrRequireStatements, + compareModuleSpecifiers: () => compareModuleSpecifiers2, + detectImportDeclarationSorting: () => detectImportDeclarationSorting, + detectImportSpecifierSorting: () => detectImportSpecifierSorting, + detectSorting: () => detectSorting, + getImportDeclarationInsertionIndex: () => getImportDeclarationInsertionIndex, + getImportSpecifierInsertionIndex: () => getImportSpecifierInsertionIndex, + getOrganizeImportsComparer: () => getOrganizeImportsComparer, + organizeImports: () => organizeImports + }); + var init_ts_OrganizeImports = __esm2({ + "src/services/_namespaces/ts.OrganizeImports.ts"() { + "use strict"; + init_organizeImports(); + } + }); + function collectElements(sourceFile, cancellationToken) { + const res = []; + addNodeOutliningSpans(sourceFile, cancellationToken, res); + addRegionOutliningSpans(sourceFile, res); + return res.sort((span1, span2) => span1.textSpan.start - span2.textSpan.start); + } + function addNodeOutliningSpans(sourceFile, cancellationToken, out) { + let depthRemaining = 40; + let current = 0; + const statements = [...sourceFile.statements, sourceFile.endOfFileToken]; + const n7 = statements.length; + while (current < n7) { + while (current < n7 && !isAnyImportSyntax(statements[current])) { + visitNode3(statements[current]); + current++; + } + if (current === n7) + break; + const firstImport = current; + while (current < n7 && isAnyImportSyntax(statements[current])) { + visitNode3(statements[current]); + current++; + } + const lastImport = current - 1; + if (lastImport !== firstImport) { + out.push(createOutliningSpanFromBounds( + findChildOfKind(statements[firstImport], 102, sourceFile).getStart(sourceFile), + statements[lastImport].getEnd(), + "imports" + /* Imports */ + )); + } + } + function visitNode3(n22) { + var _a2; + if (depthRemaining === 0) + return; + cancellationToken.throwIfCancellationRequested(); + if (isDeclaration(n22) || isVariableStatement(n22) || isReturnStatement(n22) || isCallOrNewExpression(n22) || n22.kind === 1) { + addOutliningForLeadingCommentsForNode(n22, sourceFile, cancellationToken, out); + } + if (isFunctionLike(n22) && isBinaryExpression(n22.parent) && isPropertyAccessExpression(n22.parent.left)) { + addOutliningForLeadingCommentsForNode(n22.parent.left, sourceFile, cancellationToken, out); + } + if (isBlock2(n22) || isModuleBlock(n22)) { + addOutliningForLeadingCommentsForPos(n22.statements.end, sourceFile, cancellationToken, out); + } + if (isClassLike(n22) || isInterfaceDeclaration(n22)) { + addOutliningForLeadingCommentsForPos(n22.members.end, sourceFile, cancellationToken, out); + } + const span = getOutliningSpanForNode(n22, sourceFile); + if (span) + out.push(span); + depthRemaining--; + if (isCallExpression(n22)) { + depthRemaining++; + visitNode3(n22.expression); + depthRemaining--; + n22.arguments.forEach(visitNode3); + (_a2 = n22.typeArguments) == null ? void 0 : _a2.forEach(visitNode3); + } else if (isIfStatement(n22) && n22.elseStatement && isIfStatement(n22.elseStatement)) { + visitNode3(n22.expression); + visitNode3(n22.thenStatement); + depthRemaining++; + visitNode3(n22.elseStatement); + depthRemaining--; + } else { + n22.forEachChild(visitNode3); + } + depthRemaining++; + } + } + function addRegionOutliningSpans(sourceFile, out) { + const regions = []; + const lineStarts = sourceFile.getLineStarts(); + for (const currentLineStart of lineStarts) { + const lineEnd = sourceFile.getLineEndOfPosition(currentLineStart); + const lineText = sourceFile.text.substring(currentLineStart, lineEnd); + const result2 = isRegionDelimiter(lineText); + if (!result2 || isInComment(sourceFile, currentLineStart)) { + continue; + } + if (!result2[1]) { + const span = createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); + regions.push(createOutliningSpan( + span, + "region", + span, + /*autoCollapse*/ + false, + result2[2] || "#region" + )); + } else { + const region = regions.pop(); + if (region) { + region.textSpan.length = lineEnd - region.textSpan.start; + region.hintSpan.length = lineEnd - region.textSpan.start; + out.push(region); + } + } + } + } + function isRegionDelimiter(lineText) { + lineText = lineText.trimStart(); + if (!startsWith2(lineText, "//")) { + return null; + } + lineText = lineText.slice(2).trim(); + return regionDelimiterRegExp.exec(lineText); + } + function addOutliningForLeadingCommentsForPos(pos, sourceFile, cancellationToken, out) { + const comments = getLeadingCommentRanges(sourceFile.text, pos); + if (!comments) + return; + let firstSingleLineCommentStart = -1; + let lastSingleLineCommentEnd = -1; + let singleLineCommentCount = 0; + const sourceText = sourceFile.getFullText(); + for (const { kind, pos: pos2, end } of comments) { + cancellationToken.throwIfCancellationRequested(); + switch (kind) { + case 2: + const commentText = sourceText.slice(pos2, end); + if (isRegionDelimiter(commentText)) { + combineAndAddMultipleSingleLineComments(); + singleLineCommentCount = 0; + break; + } + if (singleLineCommentCount === 0) { + firstSingleLineCommentStart = pos2; + } + lastSingleLineCommentEnd = end; + singleLineCommentCount++; + break; + case 3: + combineAndAddMultipleSingleLineComments(); + out.push(createOutliningSpanFromBounds( + pos2, + end, + "comment" + /* Comment */ + )); + singleLineCommentCount = 0; + break; + default: + Debug.assertNever(kind); + } + } + combineAndAddMultipleSingleLineComments(); + function combineAndAddMultipleSingleLineComments() { + if (singleLineCommentCount > 1) { + out.push(createOutliningSpanFromBounds( + firstSingleLineCommentStart, + lastSingleLineCommentEnd, + "comment" + /* Comment */ + )); + } + } + } + function addOutliningForLeadingCommentsForNode(n7, sourceFile, cancellationToken, out) { + if (isJsxText(n7)) + return; + addOutliningForLeadingCommentsForPos(n7.pos, sourceFile, cancellationToken, out); + } + function createOutliningSpanFromBounds(pos, end, kind) { + return createOutliningSpan(createTextSpanFromBounds(pos, end), kind); + } + function getOutliningSpanForNode(n7, sourceFile) { + switch (n7.kind) { + case 241: + if (isFunctionLike(n7.parent)) { + return functionSpan(n7.parent, n7, sourceFile); + } + switch (n7.parent.kind) { + case 246: + case 249: + case 250: + case 248: + case 245: + case 247: + case 254: + case 299: + return spanForNode(n7.parent); + case 258: + const tryStatement = n7.parent; + if (tryStatement.tryBlock === n7) { + return spanForNode(n7.parent); + } else if (tryStatement.finallyBlock === n7) { + const node = findChildOfKind(tryStatement, 98, sourceFile); + if (node) + return spanForNode(node); + } + default: + return createOutliningSpan( + createTextSpanFromNode(n7, sourceFile), + "code" + /* Code */ + ); + } + case 268: + return spanForNode(n7.parent); + case 263: + case 231: + case 264: + case 266: + case 269: + case 187: + case 206: + return spanForNode(n7); + case 189: + return spanForNode( + n7, + /*autoCollapse*/ + false, + /*useFullStart*/ + !isTupleTypeNode(n7.parent), + 23 + /* OpenBracketToken */ + ); + case 296: + case 297: + return spanForNodeArray(n7.statements); + case 210: + return spanForObjectOrArrayLiteral(n7); + case 209: + return spanForObjectOrArrayLiteral( + n7, + 23 + /* OpenBracketToken */ + ); + case 284: + return spanForJSXElement(n7); + case 288: + return spanForJSXFragment(n7); + case 285: + case 286: + return spanForJSXAttributes(n7.attributes); + case 228: + case 15: + return spanForTemplateLiteral(n7); + case 207: + return spanForNode( + n7, + /*autoCollapse*/ + false, + /*useFullStart*/ + !isBindingElement(n7.parent), + 23 + /* OpenBracketToken */ + ); + case 219: + return spanForArrowFunction(n7); + case 213: + return spanForCallExpression(n7); + case 217: + return spanForParenthesizedExpression(n7); + case 275: + case 279: + case 300: + return spanForImportExportElements(n7); + } + function spanForImportExportElements(node) { + if (!node.elements.length) { + return void 0; + } + const openToken = findChildOfKind(node, 19, sourceFile); + const closeToken = findChildOfKind(node, 20, sourceFile); + if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) { + return void 0; + } + return spanBetweenTokens( + openToken, + closeToken, + node, + sourceFile, + /*autoCollapse*/ + false, + /*useFullStart*/ + false + ); + } + function spanForCallExpression(node) { + if (!node.arguments.length) { + return void 0; + } + const openToken = findChildOfKind(node, 21, sourceFile); + const closeToken = findChildOfKind(node, 22, sourceFile); + if (!openToken || !closeToken || positionsAreOnSameLine(openToken.pos, closeToken.pos, sourceFile)) { + return void 0; + } + return spanBetweenTokens( + openToken, + closeToken, + node, + sourceFile, + /*autoCollapse*/ + false, + /*useFullStart*/ + true + ); + } + function spanForArrowFunction(node) { + if (isBlock2(node.body) || isParenthesizedExpression(node.body) || positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) { + return void 0; + } + const textSpan = createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd()); + return createOutliningSpan(textSpan, "code", createTextSpanFromNode(node)); + } + function spanForJSXElement(node) { + const textSpan = createTextSpanFromBounds(node.openingElement.getStart(sourceFile), node.closingElement.getEnd()); + const tagName = node.openingElement.tagName.getText(sourceFile); + const bannerText = "<" + tagName + ">..."; + return createOutliningSpan( + textSpan, + "code", + textSpan, + /*autoCollapse*/ + false, + bannerText + ); + } + function spanForJSXFragment(node) { + const textSpan = createTextSpanFromBounds(node.openingFragment.getStart(sourceFile), node.closingFragment.getEnd()); + const bannerText = "<>..."; + return createOutliningSpan( + textSpan, + "code", + textSpan, + /*autoCollapse*/ + false, + bannerText + ); + } + function spanForJSXAttributes(node) { + if (node.properties.length === 0) { + return void 0; + } + return createOutliningSpanFromBounds( + node.getStart(sourceFile), + node.getEnd(), + "code" + /* Code */ + ); + } + function spanForTemplateLiteral(node) { + if (node.kind === 15 && node.text.length === 0) { + return void 0; + } + return createOutliningSpanFromBounds( + node.getStart(sourceFile), + node.getEnd(), + "code" + /* Code */ + ); + } + function spanForObjectOrArrayLiteral(node, open2 = 19) { + return spanForNode( + node, + /*autoCollapse*/ + false, + /*useFullStart*/ + !isArrayLiteralExpression(node.parent) && !isCallExpression(node.parent), + open2 + ); + } + function spanForNode(hintSpanNode, autoCollapse = false, useFullStart = true, open2 = 19, close = open2 === 19 ? 20 : 24) { + const openToken = findChildOfKind(n7, open2, sourceFile); + const closeToken = findChildOfKind(n7, close, sourceFile); + return openToken && closeToken && spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse, useFullStart); + } + function spanForNodeArray(nodeArray) { + return nodeArray.length ? createOutliningSpan( + createTextSpanFromRange(nodeArray), + "code" + /* Code */ + ) : void 0; + } + function spanForParenthesizedExpression(node) { + if (positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile)) + return void 0; + const textSpan = createTextSpanFromBounds(node.getStart(), node.getEnd()); + return createOutliningSpan(textSpan, "code", createTextSpanFromNode(node)); + } + } + function functionSpan(node, body, sourceFile) { + const openToken = tryGetFunctionOpenToken(node, body, sourceFile); + const closeToken = findChildOfKind(body, 20, sourceFile); + return openToken && closeToken && spanBetweenTokens( + openToken, + closeToken, + node, + sourceFile, + /*autoCollapse*/ + node.kind !== 219 + /* ArrowFunction */ + ); + } + function spanBetweenTokens(openToken, closeToken, hintSpanNode, sourceFile, autoCollapse = false, useFullStart = true) { + const textSpan = createTextSpanFromBounds(useFullStart ? openToken.getFullStart() : openToken.getStart(sourceFile), closeToken.getEnd()); + return createOutliningSpan(textSpan, "code", createTextSpanFromNode(hintSpanNode, sourceFile), autoCollapse); + } + function createOutliningSpan(textSpan, kind, hintSpan = textSpan, autoCollapse = false, bannerText = "...") { + return { textSpan, kind, hintSpan, bannerText, autoCollapse }; + } + function tryGetFunctionOpenToken(node, body, sourceFile) { + if (isNodeArrayMultiLine(node.parameters, sourceFile)) { + const openParenToken = findChildOfKind(node, 21, sourceFile); + if (openParenToken) { + return openParenToken; + } + } + return findChildOfKind(body, 19, sourceFile); + } + var regionDelimiterRegExp; + var init_outliningElementsCollector = __esm2({ + "src/services/outliningElementsCollector.ts"() { + "use strict"; + init_ts4(); + regionDelimiterRegExp = /^#(end)?region(?:\s+(.*))?(?:\r)?$/; + } + }); + var ts_OutliningElementsCollector_exports = {}; + __export2(ts_OutliningElementsCollector_exports, { + collectElements: () => collectElements + }); + var init_ts_OutliningElementsCollector = __esm2({ + "src/services/_namespaces/ts.OutliningElementsCollector.ts"() { + "use strict"; + init_outliningElementsCollector(); + } + }); + function getRenameInfo(program, sourceFile, position, preferences) { + const node = getAdjustedRenameLocation(getTouchingPropertyName(sourceFile, position)); + if (nodeIsEligibleForRename(node)) { + const renameInfo = getRenameInfoForNode(node, program.getTypeChecker(), sourceFile, program, preferences); + if (renameInfo) { + return renameInfo; + } + } + return getRenameInfoError(Diagnostics.You_cannot_rename_this_element); + } + function getRenameInfoForNode(node, typeChecker, sourceFile, program, preferences) { + const symbol = typeChecker.getSymbolAtLocation(node); + if (!symbol) { + if (isStringLiteralLike(node)) { + const type3 = getContextualTypeFromParentOrAncestorTypeNode(node, typeChecker); + if (type3 && (type3.flags & 128 || type3.flags & 1048576 && every2(type3.types, (type22) => !!(type22.flags & 128)))) { + return getRenameInfoSuccess(node.text, node.text, "string", "", node, sourceFile); + } + } else if (isLabelName(node)) { + const name2 = getTextOfNode(node); + return getRenameInfoSuccess(name2, name2, "label", "", node, sourceFile); + } + return void 0; + } + const { declarations } = symbol; + if (!declarations || declarations.length === 0) + return; + if (declarations.some((declaration) => isDefinedInLibraryFile(program, declaration))) { + return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); + } + if (isIdentifier(node) && node.escapedText === "default" && symbol.parent && symbol.parent.flags & 1536) { + return void 0; + } + if (isStringLiteralLike(node) && tryGetImportFromModuleSpecifier(node)) { + return preferences.allowRenameOfImportPath ? getRenameInfoForModule(node, sourceFile, symbol) : void 0; + } + const wouldRenameNodeModules = wouldRenameInOtherNodeModules(sourceFile, symbol, typeChecker, preferences); + if (wouldRenameNodeModules) { + return getRenameInfoError(wouldRenameNodeModules); + } + const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, node); + const specifierName = isImportOrExportSpecifierName(node) || isStringOrNumericLiteralLike(node) && node.parent.kind === 167 ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : void 0; + const displayName = specifierName || typeChecker.symbolToString(symbol); + const fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol), node, sourceFile); + } + function isDefinedInLibraryFile(program, declaration) { + const sourceFile = declaration.getSourceFile(); + return program.isSourceFileDefaultLibrary(sourceFile) && fileExtensionIs( + sourceFile.fileName, + ".d.ts" + /* Dts */ + ); + } + function wouldRenameInOtherNodeModules(originalFile, symbol, checker, preferences) { + if (!preferences.providePrefixAndSuffixTextForRename && symbol.flags & 2097152) { + const importSpecifier = symbol.declarations && find2(symbol.declarations, (decl) => isImportSpecifier(decl)); + if (importSpecifier && !importSpecifier.propertyName) { + symbol = checker.getAliasedSymbol(symbol); + } + } + const { declarations } = symbol; + if (!declarations) { + return void 0; + } + const originalPackage = getPackagePathComponents(originalFile.path); + if (originalPackage === void 0) { + if (some2(declarations, (declaration) => isInsideNodeModules(declaration.getSourceFile().path))) { + return Diagnostics.You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder; + } else { + return void 0; + } + } + for (const declaration of declarations) { + const declPackage = getPackagePathComponents(declaration.getSourceFile().path); + if (declPackage) { + const length2 = Math.min(originalPackage.length, declPackage.length); + for (let i7 = 0; i7 <= length2; i7++) { + if (compareStringsCaseSensitive(originalPackage[i7], declPackage[i7]) !== 0) { + return Diagnostics.You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder; + } + } + } + } + return void 0; + } + function getPackagePathComponents(filePath) { + const components = getPathComponents(filePath); + const nodeModulesIdx = components.lastIndexOf("node_modules"); + if (nodeModulesIdx === -1) { + return void 0; + } + return components.slice(0, nodeModulesIdx + 2); + } + function getRenameInfoForModule(node, sourceFile, moduleSymbol) { + if (!isExternalModuleNameRelative(node.text)) { + return getRenameInfoError(Diagnostics.You_cannot_rename_a_module_via_a_global_import); + } + const moduleSourceFile = moduleSymbol.declarations && find2(moduleSymbol.declarations, isSourceFile); + if (!moduleSourceFile) + return void 0; + const withoutIndex = endsWith2(node.text, "/index") || endsWith2(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index"); + const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex; + const kind = withoutIndex === void 0 ? "module" : "directory"; + const indexAfterLastSlash = node.text.lastIndexOf("/") + 1; + const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash); + return { + canRename: true, + fileToRename: fileName, + kind, + displayName: fileName, + fullDisplayName: node.text, + kindModifiers: "", + triggerSpan + }; + } + function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { + return { + canRename: true, + fileToRename: void 0, + kind, + displayName, + fullDisplayName, + kindModifiers, + triggerSpan: createTriggerSpanForNode(node, sourceFile) + }; + } + function getRenameInfoError(diagnostic) { + return { canRename: false, localizedErrorMessage: getLocaleSpecificMessage(diagnostic) }; + } + function createTriggerSpanForNode(node, sourceFile) { + let start = node.getStart(sourceFile); + let width = node.getWidth(sourceFile); + if (isStringLiteralLike(node)) { + start += 1; + width -= 2; + } + return createTextSpan(start, width); + } + function nodeIsEligibleForRename(node) { + switch (node.kind) { + case 80: + case 81: + case 11: + case 15: + case 110: + return true; + case 9: + return isLiteralNameOfPropertyDeclarationOrIndexAccess(node); + default: + return false; + } + } + var init_rename = __esm2({ + "src/services/rename.ts"() { + "use strict"; + init_ts4(); + } + }); + var ts_Rename_exports = {}; + __export2(ts_Rename_exports, { + getRenameInfo: () => getRenameInfo, + nodeIsEligibleForRename: () => nodeIsEligibleForRename + }); + var init_ts_Rename = __esm2({ + "src/services/_namespaces/ts.Rename.ts"() { + "use strict"; + init_rename(); + } + }); + function getSignatureHelpItems(program, sourceFile, position, triggerReason, cancellationToken) { + const typeChecker = program.getTypeChecker(); + const startingToken = findTokenOnLeftOfPosition(sourceFile, position); + if (!startingToken) { + return void 0; + } + const onlyUseSyntacticOwners = !!triggerReason && triggerReason.kind === "characterTyped"; + if (onlyUseSyntacticOwners && (isInString(sourceFile, position, startingToken) || isInComment(sourceFile, position))) { + return void 0; + } + const isManuallyInvoked = !!triggerReason && triggerReason.kind === "invoked"; + const argumentInfo = getContainingArgumentInfo(startingToken, position, sourceFile, typeChecker, isManuallyInvoked); + if (!argumentInfo) + return void 0; + cancellationToken.throwIfCancellationRequested(); + const candidateInfo = getCandidateOrTypeInfo(argumentInfo, typeChecker, sourceFile, startingToken, onlyUseSyntacticOwners); + cancellationToken.throwIfCancellationRequested(); + if (!candidateInfo) { + return isSourceFileJS(sourceFile) ? createJSSignatureHelpItems(argumentInfo, program, cancellationToken) : void 0; + } + return typeChecker.runWithCancellationToken(cancellationToken, (typeChecker2) => candidateInfo.kind === 0 ? createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker2) : createTypeHelpItems(candidateInfo.symbol, argumentInfo, sourceFile, typeChecker2)); + } + function getCandidateOrTypeInfo({ invocation, argumentCount }, checker, sourceFile, startingToken, onlyUseSyntacticOwners) { + switch (invocation.kind) { + case 0: { + if (onlyUseSyntacticOwners && !isSyntacticOwner(startingToken, invocation.node, sourceFile)) { + return void 0; + } + const candidates = []; + const resolvedSignature = checker.getResolvedSignatureForSignatureHelp(invocation.node, candidates, argumentCount); + return candidates.length === 0 ? void 0 : { kind: 0, candidates, resolvedSignature }; + } + case 1: { + const { called } = invocation; + if (onlyUseSyntacticOwners && !containsPrecedingToken(startingToken, sourceFile, isIdentifier(called) ? called.parent : called)) { + return void 0; + } + const candidates = getPossibleGenericSignatures(called, argumentCount, checker); + if (candidates.length !== 0) + return { kind: 0, candidates, resolvedSignature: first(candidates) }; + const symbol = checker.getSymbolAtLocation(called); + return symbol && { kind: 1, symbol }; + } + case 2: + return { kind: 0, candidates: [invocation.signature], resolvedSignature: invocation.signature }; + default: + return Debug.assertNever(invocation); + } + } + function isSyntacticOwner(startingToken, node, sourceFile) { + if (!isCallOrNewExpression(node)) + return false; + const invocationChildren = node.getChildren(sourceFile); + switch (startingToken.kind) { + case 21: + return contains2(invocationChildren, startingToken); + case 28: { + const containingList = findContainingList(startingToken); + return !!containingList && contains2(invocationChildren, containingList); + } + case 30: + return containsPrecedingToken(startingToken, sourceFile, node.expression); + default: + return false; + } + } + function createJSSignatureHelpItems(argumentInfo, program, cancellationToken) { + if (argumentInfo.invocation.kind === 2) + return void 0; + const expression = getExpressionFromInvocation(argumentInfo.invocation); + const name2 = isPropertyAccessExpression(expression) ? expression.name.text : void 0; + const typeChecker = program.getTypeChecker(); + return name2 === void 0 ? void 0 : firstDefined(program.getSourceFiles(), (sourceFile) => firstDefined(sourceFile.getNamedDeclarations().get(name2), (declaration) => { + const type3 = declaration.symbol && typeChecker.getTypeOfSymbolAtLocation(declaration.symbol, declaration); + const callSignatures = type3 && type3.getCallSignatures(); + if (callSignatures && callSignatures.length) { + return typeChecker.runWithCancellationToken( + cancellationToken, + (typeChecker2) => createSignatureHelpItems( + callSignatures, + callSignatures[0], + argumentInfo, + sourceFile, + typeChecker2, + /*useFullPrefix*/ + true + ) + ); + } + })); + } + function containsPrecedingToken(startingToken, sourceFile, container) { + const pos = startingToken.getFullStart(); + let currentParent = startingToken.parent; + while (currentParent) { + const precedingToken = findPrecedingToken( + pos, + sourceFile, + currentParent, + /*excludeJsdoc*/ + true + ); + if (precedingToken) { + return rangeContainsRange(container, precedingToken); + } + currentParent = currentParent.parent; + } + return Debug.fail("Could not find preceding token"); + } + function getArgumentInfoForCompletions(node, position, sourceFile, checker) { + const info2 = getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker); + return !info2 || info2.isTypeParameterList || info2.invocation.kind !== 0 ? void 0 : { invocation: info2.invocation.node, argumentCount: info2.argumentCount, argumentIndex: info2.argumentIndex }; + } + function getArgumentOrParameterListInfo(node, position, sourceFile, checker) { + const info2 = getArgumentOrParameterListAndIndex(node, sourceFile, checker); + if (!info2) + return void 0; + const { list, argumentIndex } = info2; + const argumentCount = getArgumentCount(checker, list); + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } + const argumentsSpan = getApplicableSpanForArguments(list, sourceFile); + return { list, argumentIndex, argumentCount, argumentsSpan }; + } + function getArgumentOrParameterListAndIndex(node, sourceFile, checker) { + if (node.kind === 30 || node.kind === 21) { + return { list: getChildListThatStartsWithOpenerToken(node.parent, node, sourceFile), argumentIndex: 0 }; + } else { + const list = findContainingList(node); + return list && { list, argumentIndex: getArgumentIndex(checker, list, node) }; + } + } + function getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker) { + const { parent: parent22 } = node; + if (isCallOrNewExpression(parent22)) { + const invocation = parent22; + const info2 = getArgumentOrParameterListInfo(node, position, sourceFile, checker); + if (!info2) + return void 0; + const { list, argumentIndex, argumentCount, argumentsSpan } = info2; + const isTypeParameterList = !!parent22.typeArguments && parent22.typeArguments.pos === list.pos; + return { isTypeParameterList, invocation: { kind: 0, node: invocation }, argumentsSpan, argumentIndex, argumentCount }; + } else if (isNoSubstitutionTemplateLiteral(node) && isTaggedTemplateExpression(parent22)) { + if (isInsideTemplateLiteral(node, position, sourceFile)) { + return getArgumentListInfoForTemplate( + parent22, + /*argumentIndex*/ + 0, + sourceFile + ); + } + return void 0; + } else if (isTemplateHead(node) && parent22.parent.kind === 215) { + const templateExpression = parent22; + const tagExpression = templateExpression.parent; + Debug.assert( + templateExpression.kind === 228 + /* TemplateExpression */ + ); + const argumentIndex = isInsideTemplateLiteral(node, position, sourceFile) ? 0 : 1; + return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); + } else if (isTemplateSpan(parent22) && isTaggedTemplateExpression(parent22.parent.parent)) { + const templateSpan = parent22; + const tagExpression = parent22.parent.parent; + if (isTemplateTail(node) && !isInsideTemplateLiteral(node, position, sourceFile)) { + return void 0; + } + const spanIndex = templateSpan.parent.templateSpans.indexOf(templateSpan); + const argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile); + return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); + } else if (isJsxOpeningLikeElement(parent22)) { + const attributeSpanStart = parent22.attributes.pos; + const attributeSpanEnd = skipTrivia( + sourceFile.text, + parent22.attributes.end, + /*stopAfterLineBreak*/ + false + ); + return { + isTypeParameterList: false, + invocation: { kind: 0, node: parent22 }, + argumentsSpan: createTextSpan(attributeSpanStart, attributeSpanEnd - attributeSpanStart), + argumentIndex: 0, + argumentCount: 1 + }; + } else { + const typeArgInfo = getPossibleTypeArgumentsInfo(node, sourceFile); + if (typeArgInfo) { + const { called, nTypeArguments } = typeArgInfo; + const invocation = { kind: 1, called }; + const argumentsSpan = createTextSpanFromBounds(called.getStart(sourceFile), node.end); + return { isTypeParameterList: true, invocation, argumentsSpan, argumentIndex: nTypeArguments, argumentCount: nTypeArguments + 1 }; + } + return void 0; + } + } + function getImmediatelyContainingArgumentOrContextualParameterInfo(node, position, sourceFile, checker) { + return tryGetParameterInfo(node, position, sourceFile, checker) || getImmediatelyContainingArgumentInfo(node, position, sourceFile, checker); + } + function getHighestBinary(b8) { + return isBinaryExpression(b8.parent) ? getHighestBinary(b8.parent) : b8; + } + function countBinaryExpressionParameters(b8) { + return isBinaryExpression(b8.left) ? countBinaryExpressionParameters(b8.left) + 1 : 2; + } + function tryGetParameterInfo(startingToken, position, sourceFile, checker) { + const node = getAdjustedNode(startingToken); + if (node === void 0) + return void 0; + const info2 = getContextualSignatureLocationInfo(node, sourceFile, position, checker); + if (info2 === void 0) + return void 0; + const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info2; + const nonNullableContextualType = contextualType.getNonNullableType(); + const symbol = nonNullableContextualType.symbol; + if (symbol === void 0) + return void 0; + const signature = lastOrUndefined(nonNullableContextualType.getCallSignatures()); + if (signature === void 0) + return void 0; + const invocation = { kind: 2, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) }; + return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount }; + } + function getAdjustedNode(node) { + switch (node.kind) { + case 21: + case 28: + return node; + default: + return findAncestor(node.parent, (n7) => isParameter(n7) ? true : isBindingElement(n7) || isObjectBindingPattern(n7) || isArrayBindingPattern(n7) ? false : "quit"); + } + } + function getContextualSignatureLocationInfo(node, sourceFile, position, checker) { + const { parent: parent22 } = node; + switch (parent22.kind) { + case 217: + case 174: + case 218: + case 219: + const info2 = getArgumentOrParameterListInfo(node, position, sourceFile, checker); + if (!info2) + return void 0; + const { argumentIndex, argumentCount, argumentsSpan } = info2; + const contextualType = isMethodDeclaration(parent22) ? checker.getContextualTypeForObjectLiteralElement(parent22) : checker.getContextualType(parent22); + return contextualType && { contextualType, argumentIndex, argumentCount, argumentsSpan }; + case 226: { + const highestBinary = getHighestBinary(parent22); + const contextualType2 = checker.getContextualType(highestBinary); + const argumentIndex2 = node.kind === 21 ? 0 : countBinaryExpressionParameters(parent22) - 1; + const argumentCount2 = countBinaryExpressionParameters(highestBinary); + return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent22) }; + } + default: + return void 0; + } + } + function chooseBetterSymbol(s7) { + return s7.name === "__type" ? firstDefined(s7.declarations, (d7) => { + var _a2; + return isFunctionTypeNode(d7) ? (_a2 = tryCast(d7.parent, canHaveSymbol)) == null ? void 0 : _a2.symbol : void 0; + }) || s7 : s7; + } + function getSpreadElementCount(node, checker) { + const spreadType = checker.getTypeAtLocation(node.expression); + if (checker.isTupleType(spreadType)) { + const { elementFlags, fixedLength } = spreadType.target; + if (fixedLength === 0) { + return 0; + } + const firstOptionalIndex = findIndex2(elementFlags, (f8) => !(f8 & 1)); + return firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex; + } + return 0; + } + function getArgumentIndex(checker, argumentsList, node) { + return getArgumentIndexOrCount(checker, argumentsList, node); + } + function getArgumentCount(checker, argumentsList) { + return getArgumentIndexOrCount( + checker, + argumentsList, + /*node*/ + void 0 + ); + } + function getArgumentIndexOrCount(checker, argumentsList, node) { + const args = argumentsList.getChildren(); + let argumentIndex = 0; + let skipComma = false; + for (const child of args) { + if (node && child === node) { + if (!skipComma && child.kind === 28) { + argumentIndex++; + } + return argumentIndex; + } + if (isSpreadElement(child)) { + argumentIndex += getSpreadElementCount(child, checker); + skipComma = true; + continue; + } + if (child.kind !== 28) { + argumentIndex++; + skipComma = true; + continue; + } + if (skipComma) { + skipComma = false; + continue; + } + argumentIndex++; + } + if (node) { + return argumentIndex; + } + return args.length && last2(args).kind === 28 ? argumentIndex + 1 : argumentIndex; + } + function getArgumentIndexForTemplatePiece(spanIndex, node, position, sourceFile) { + Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); + if (isTemplateLiteralToken(node)) { + if (isInsideTemplateLiteral(node, position, sourceFile)) { + return 0; + } + return spanIndex + 2; + } + return spanIndex + 1; + } + function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { + const argumentCount = isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } + return { + isTypeParameterList: false, + invocation: { kind: 0, node: tagExpression }, + argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression, sourceFile), + argumentIndex, + argumentCount + }; + } + function getApplicableSpanForArguments(argumentsList, sourceFile) { + const applicableSpanStart = argumentsList.getFullStart(); + const applicableSpanEnd = skipTrivia( + sourceFile.text, + argumentsList.getEnd(), + /*stopAfterLineBreak*/ + false + ); + return createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + function getApplicableSpanForTaggedTemplate(taggedTemplate, sourceFile) { + const template2 = taggedTemplate.template; + const applicableSpanStart = template2.getStart(); + let applicableSpanEnd = template2.getEnd(); + if (template2.kind === 228) { + const lastSpan = last2(template2.templateSpans); + if (lastSpan.literal.getFullWidth() === 0) { + applicableSpanEnd = skipTrivia( + sourceFile.text, + applicableSpanEnd, + /*stopAfterLineBreak*/ + false + ); + } + } + return createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); + } + function getContainingArgumentInfo(node, position, sourceFile, checker, isManuallyInvoked) { + for (let n7 = node; !isSourceFile(n7) && (isManuallyInvoked || !isBlock2(n7)); n7 = n7.parent) { + Debug.assert(rangeContainsRange(n7.parent, n7), "Not a subspan", () => `Child: ${Debug.formatSyntaxKind(n7.kind)}, parent: ${Debug.formatSyntaxKind(n7.parent.kind)}`); + const argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n7, position, sourceFile, checker); + if (argumentInfo) { + return argumentInfo; + } + } + return void 0; + } + function getChildListThatStartsWithOpenerToken(parent22, openerToken, sourceFile) { + const children = parent22.getChildren(sourceFile); + const indexOfOpenerToken = children.indexOf(openerToken); + Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); + return children[indexOfOpenerToken + 1]; + } + function getExpressionFromInvocation(invocation) { + return invocation.kind === 0 ? getInvokedExpression(invocation.node) : invocation.called; + } + function getEnclosingDeclarationFromInvocation(invocation) { + return invocation.kind === 0 ? invocation.node : invocation.kind === 1 ? invocation.called : invocation.node; + } + function createSignatureHelpItems(candidates, resolvedSignature, { isTypeParameterList, argumentCount, argumentsSpan: applicableSpan, invocation, argumentIndex }, sourceFile, typeChecker, useFullPrefix) { + var _a2; + const enclosingDeclaration = getEnclosingDeclarationFromInvocation(invocation); + const callTargetSymbol = invocation.kind === 2 ? invocation.symbol : typeChecker.getSymbolAtLocation(getExpressionFromInvocation(invocation)) || useFullPrefix && ((_a2 = resolvedSignature.declaration) == null ? void 0 : _a2.symbol); + const callTargetDisplayParts = callTargetSymbol ? symbolToDisplayParts( + typeChecker, + callTargetSymbol, + useFullPrefix ? sourceFile : void 0, + /*meaning*/ + void 0 + ) : emptyArray; + const items = map4(candidates, (candidateSignature) => getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, typeChecker, enclosingDeclaration, sourceFile)); + if (argumentIndex !== 0) { + Debug.assertLessThan(argumentIndex, argumentCount); + } + let selectedItemIndex = 0; + let itemsSeen = 0; + for (let i7 = 0; i7 < items.length; i7++) { + const item = items[i7]; + if (candidates[i7] === resolvedSignature) { + selectedItemIndex = itemsSeen; + if (item.length > 1) { + let count2 = 0; + for (const i22 of item) { + if (i22.isVariadic || i22.parameters.length >= argumentCount) { + selectedItemIndex = itemsSeen + count2; + break; + } + count2++; + } + } + } + itemsSeen += item.length; + } + Debug.assert(selectedItemIndex !== -1); + const help = { items: flatMapToMutable(items, identity2), applicableSpan, selectedItemIndex, argumentIndex, argumentCount }; + const selected = help.items[selectedItemIndex]; + if (selected.isVariadic) { + const firstRest = findIndex2(selected.parameters, (p7) => !!p7.isRest); + if (-1 < firstRest && firstRest < selected.parameters.length - 1) { + help.argumentIndex = selected.parameters.length; + } else { + help.argumentIndex = Math.min(help.argumentIndex, selected.parameters.length - 1); + } + } + return help; + } + function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableSpan, invocation, argumentIndex }, sourceFile, checker) { + const typeParameters = checker.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); + if (!typeParameters) + return void 0; + const items = [getTypeHelpItem(symbol, typeParameters, checker, getEnclosingDeclarationFromInvocation(invocation), sourceFile)]; + return { items, applicableSpan, selectedItemIndex: 0, argumentIndex, argumentCount }; + } + function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) { + const typeSymbolDisplay = symbolToDisplayParts(checker, symbol); + const printer = createPrinterWithRemoveComments(); + const parameters = typeParameters.map((t8) => createSignatureHelpParameterForTypeParameter(t8, checker, enclosingDeclaration, sourceFile, printer)); + const documentation = symbol.getDocumentationComment(checker); + const tags6 = symbol.getJsDocTags(checker); + const prefixDisplayParts = [...typeSymbolDisplay, punctuationPart( + 30 + /* LessThanToken */ + )]; + return { isVariadic: false, prefixDisplayParts, suffixDisplayParts: [punctuationPart( + 32 + /* GreaterThanToken */ + )], separatorDisplayParts, parameters, documentation, tags: tags6 }; + } + function getSignatureHelpItem(candidateSignature, callTargetDisplayParts, isTypeParameterList, checker, enclosingDeclaration, sourceFile) { + const infos = (isTypeParameterList ? itemInfoForTypeParameters : itemInfoForParameters)(candidateSignature, checker, enclosingDeclaration, sourceFile); + return map4(infos, ({ isVariadic, parameters, prefix, suffix }) => { + const prefixDisplayParts = [...callTargetDisplayParts, ...prefix]; + const suffixDisplayParts = [...suffix, ...returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker)]; + const documentation = candidateSignature.getDocumentationComment(checker); + const tags6 = candidateSignature.getJsDocTags(); + return { isVariadic, prefixDisplayParts, suffixDisplayParts, separatorDisplayParts, parameters, documentation, tags: tags6 }; + }); + } + function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, checker) { + return mapToDisplayParts((writer) => { + writer.writePunctuation(":"); + writer.writeSpace(" "); + const predicate = checker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + checker.writeTypePredicate( + predicate, + enclosingDeclaration, + /*flags*/ + void 0, + writer + ); + } else { + checker.writeType( + checker.getReturnTypeOfSignature(candidateSignature), + enclosingDeclaration, + /*flags*/ + void 0, + writer + ); + } + }); + } + function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { + const typeParameters = (candidateSignature.target || candidateSignature).typeParameters; + const printer = createPrinterWithRemoveComments(); + const parameters = (typeParameters || emptyArray).map((t8) => createSignatureHelpParameterForTypeParameter(t8, checker, enclosingDeclaration, sourceFile, printer)); + const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : []; + return checker.getExpandedParameters(candidateSignature).map((paramList) => { + const params = factory.createNodeArray([...thisParameter, ...map4(paramList, (param) => checker.symbolToParameterDeclaration(param, enclosingDeclaration, signatureHelpNodeBuilderFlags))]); + const parameterParts = mapToDisplayParts((writer) => { + printer.writeList(2576, params, sourceFile, writer); + }); + return { isVariadic: false, parameters, prefix: [punctuationPart( + 30 + /* LessThanToken */ + )], suffix: [punctuationPart( + 32 + /* GreaterThanToken */ + ), ...parameterParts] }; + }); + } + function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) { + const printer = createPrinterWithRemoveComments(); + const typeParameterParts = mapToDisplayParts((writer) => { + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + const args = factory.createNodeArray(candidateSignature.typeParameters.map((p7) => checker.typeParameterToDeclaration(p7, enclosingDeclaration, signatureHelpNodeBuilderFlags))); + printer.writeList(53776, args, sourceFile, writer); + } + }); + const lists = checker.getExpandedParameters(candidateSignature); + const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_6) => false : lists.length === 1 ? (_6) => true : (pList) => { + var _a2; + return !!(pList.length && ((_a2 = tryCast(pList[pList.length - 1], isTransientSymbol)) == null ? void 0 : _a2.links.checkFlags) & 32768); + }; + return lists.map((parameterList) => ({ + isVariadic: isVariadic(parameterList), + parameters: parameterList.map((p7) => createSignatureHelpParameterForParameter(p7, checker, enclosingDeclaration, sourceFile, printer)), + prefix: [...typeParameterParts, punctuationPart( + 21 + /* OpenParenToken */ + )], + suffix: [punctuationPart( + 22 + /* CloseParenToken */ + )] + })); + } + function createSignatureHelpParameterForParameter(parameter, checker, enclosingDeclaration, sourceFile, printer) { + const displayParts = mapToDisplayParts((writer) => { + const param = checker.symbolToParameterDeclaration(parameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); + printer.writeNode(4, param, sourceFile, writer); + }); + const isOptional2 = checker.isOptionalParameter(parameter.valueDeclaration); + const isRest = isTransientSymbol(parameter) && !!(parameter.links.checkFlags & 32768); + return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional: isOptional2, isRest }; + } + function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) { + const displayParts = mapToDisplayParts((writer) => { + const param = checker.typeParameterToDeclaration(typeParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags); + printer.writeNode(4, param, sourceFile, writer); + }); + return { name: typeParameter.symbol.name, documentation: typeParameter.symbol.getDocumentationComment(checker), displayParts, isOptional: false, isRest: false }; + } + var signatureHelpNodeBuilderFlags, separatorDisplayParts; + var init_signatureHelp = __esm2({ + "src/services/signatureHelp.ts"() { + "use strict"; + init_ts4(); + signatureHelpNodeBuilderFlags = 8192 | 70221824 | 16384; + separatorDisplayParts = [punctuationPart( + 28 + /* CommaToken */ + ), spacePart()]; + } + }); + var ts_SignatureHelp_exports = {}; + __export2(ts_SignatureHelp_exports, { + getArgumentInfoForCompletions: () => getArgumentInfoForCompletions, + getSignatureHelpItems: () => getSignatureHelpItems + }); + var init_ts_SignatureHelp = __esm2({ + "src/services/_namespaces/ts.SignatureHelp.ts"() { + "use strict"; + init_signatureHelp(); + } + }); + function getSmartSelectionRange(pos, sourceFile) { + var _a2, _b; + let selectionRange = { + textSpan: createTextSpanFromBounds(sourceFile.getFullStart(), sourceFile.getEnd()) + }; + let parentNode = sourceFile; + outer: + while (true) { + const children = getSelectionChildren(parentNode); + if (!children.length) + break; + for (let i7 = 0; i7 < children.length; i7++) { + const prevNode = children[i7 - 1]; + const node = children[i7]; + const nextNode = children[i7 + 1]; + if (getTokenPosOfNode( + node, + sourceFile, + /*includeJsDoc*/ + true + ) > pos) { + break outer; + } + const comment = singleOrUndefined(getTrailingCommentRanges(sourceFile.text, node.end)); + if (comment && comment.kind === 2) { + pushSelectionCommentRange(comment.pos, comment.end); + } + if (positionShouldSnapToNode(sourceFile, pos, node)) { + if (isFunctionBody(node) && isFunctionLikeDeclaration(parentNode) && !positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) { + pushSelectionRange(node.getStart(sourceFile), node.getEnd()); + } + if (isBlock2(node) || isTemplateSpan(node) || isTemplateHead(node) || isTemplateTail(node) || prevNode && isTemplateHead(prevNode) || isVariableDeclarationList(node) && isVariableStatement(parentNode) || isSyntaxList(node) && isVariableDeclarationList(parentNode) || isVariableDeclaration(node) && isSyntaxList(parentNode) && children.length === 1 || isJSDocTypeExpression(node) || isJSDocSignature(node) || isJSDocTypeLiteral(node)) { + parentNode = node; + break; + } + if (isTemplateSpan(parentNode) && nextNode && isTemplateMiddleOrTemplateTail(nextNode)) { + const start2 = node.getFullStart() - "${".length; + const end2 = nextNode.getStart() + "}".length; + pushSelectionRange(start2, end2); + } + const isBetweenMultiLineBookends = isSyntaxList(node) && isListOpener(prevNode) && isListCloser(nextNode) && !positionsAreOnSameLine(prevNode.getStart(), nextNode.getStart(), sourceFile); + let start = isBetweenMultiLineBookends ? prevNode.getEnd() : node.getStart(); + const end = isBetweenMultiLineBookends ? nextNode.getStart() : getEndPos(sourceFile, node); + if (hasJSDocNodes(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.length)) { + pushSelectionRange(first(node.jsDoc).getStart(), end); + } + if (isSyntaxList(node)) { + const firstChild = node.getChildren()[0]; + if (firstChild && hasJSDocNodes(firstChild) && ((_b = firstChild.jsDoc) == null ? void 0 : _b.length) && firstChild.getStart() !== node.pos) { + start = Math.min(start, first(firstChild.jsDoc).getStart()); + } + } + pushSelectionRange(start, end); + if (isStringLiteral(node) || isTemplateLiteral(node)) { + pushSelectionRange(start + 1, end - 1); + } + parentNode = node; + break; + } + if (i7 === children.length - 1) { + break outer; + } + } + } + return selectionRange; + function pushSelectionRange(start, end) { + if (start !== end) { + const textSpan = createTextSpanFromBounds(start, end); + if (!selectionRange || // Skip ranges that are identical to the parent + !textSpansEqual(textSpan, selectionRange.textSpan) && // Skip ranges that don't contain the original position + textSpanIntersectsWithPosition(textSpan, pos)) { + selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } }; + } + } + } + function pushSelectionCommentRange(start, end) { + pushSelectionRange(start, end); + let pos2 = start; + while (sourceFile.text.charCodeAt(pos2) === 47) { + pos2++; + } + pushSelectionRange(pos2, end); + } + } + function positionShouldSnapToNode(sourceFile, pos, node) { + Debug.assert(node.pos <= pos); + if (pos < node.end) { + return true; + } + const nodeEnd = node.getEnd(); + if (nodeEnd === pos) { + return getTouchingPropertyName(sourceFile, pos).pos < node.end; + } + return false; + } + function getSelectionChildren(node) { + var _a2; + if (isSourceFile(node)) { + return groupChildren(node.getChildAt(0).getChildren(), isImport2); + } + if (isMappedTypeNode(node)) { + const [openBraceToken, ...children] = node.getChildren(); + const closeBraceToken = Debug.checkDefined(children.pop()); + Debug.assertEqual( + openBraceToken.kind, + 19 + /* OpenBraceToken */ + ); + Debug.assertEqual( + closeBraceToken.kind, + 20 + /* CloseBraceToken */ + ); + const groupedWithPlusMinusTokens = groupChildren( + children, + (child) => child === node.readonlyToken || child.kind === 148 || child === node.questionToken || child.kind === 58 + /* QuestionToken */ + ); + const groupedWithBrackets = groupChildren( + groupedWithPlusMinusTokens, + ({ kind }) => kind === 23 || kind === 168 || kind === 24 + /* CloseBracketToken */ + ); + return [ + openBraceToken, + // Pivot on `:` + createSyntaxList2(splitChildren( + groupedWithBrackets, + ({ kind }) => kind === 59 + /* ColonToken */ + )), + closeBraceToken + ]; + } + if (isPropertySignature(node)) { + const children = groupChildren(node.getChildren(), (child) => child === node.name || contains2(node.modifiers, child)); + const firstJSDocChild = ((_a2 = children[0]) == null ? void 0 : _a2.kind) === 327 ? children[0] : void 0; + const withJSDocSeparated = firstJSDocChild ? children.slice(1) : children; + const splittedChildren = splitChildren( + withJSDocSeparated, + ({ kind }) => kind === 59 + /* ColonToken */ + ); + return firstJSDocChild ? [firstJSDocChild, createSyntaxList2(splittedChildren)] : splittedChildren; + } + if (isParameter(node)) { + const groupedDotDotDotAndName = groupChildren(node.getChildren(), (child) => child === node.dotDotDotToken || child === node.name); + const groupedWithQuestionToken = groupChildren(groupedDotDotDotAndName, (child) => child === groupedDotDotDotAndName[0] || child === node.questionToken); + return splitChildren( + groupedWithQuestionToken, + ({ kind }) => kind === 64 + /* EqualsToken */ + ); + } + if (isBindingElement(node)) { + return splitChildren( + node.getChildren(), + ({ kind }) => kind === 64 + /* EqualsToken */ + ); + } + return node.getChildren(); + } + function groupChildren(children, groupOn) { + const result2 = []; + let group22; + for (const child of children) { + if (groupOn(child)) { + group22 = group22 || []; + group22.push(child); + } else { + if (group22) { + result2.push(createSyntaxList2(group22)); + group22 = void 0; + } + result2.push(child); + } + } + if (group22) { + result2.push(createSyntaxList2(group22)); + } + return result2; + } + function splitChildren(children, pivotOn, separateTrailingSemicolon = true) { + if (children.length < 2) { + return children; + } + const splitTokenIndex = findIndex2(children, pivotOn); + if (splitTokenIndex === -1) { + return children; + } + const leftChildren = children.slice(0, splitTokenIndex); + const splitToken = children[splitTokenIndex]; + const lastToken = last2(children); + const separateLastToken = separateTrailingSemicolon && lastToken.kind === 27; + const rightChildren = children.slice(splitTokenIndex + 1, separateLastToken ? children.length - 1 : void 0); + const result2 = compact2([ + leftChildren.length ? createSyntaxList2(leftChildren) : void 0, + splitToken, + rightChildren.length ? createSyntaxList2(rightChildren) : void 0 + ]); + return separateLastToken ? result2.concat(lastToken) : result2; + } + function createSyntaxList2(children) { + Debug.assertGreaterThanOrEqual(children.length, 1); + return setTextRangePosEnd(parseNodeFactory.createSyntaxList(children), children[0].pos, last2(children).end); + } + function isListOpener(token) { + const kind = token && token.kind; + return kind === 19 || kind === 23 || kind === 21 || kind === 286; + } + function isListCloser(token) { + const kind = token && token.kind; + return kind === 20 || kind === 24 || kind === 22 || kind === 287; + } + function getEndPos(sourceFile, node) { + switch (node.kind) { + case 348: + case 345: + case 355: + case 353: + case 350: + return sourceFile.getLineEndOfPosition(node.getStart()); + default: + return node.getEnd(); + } + } + var isImport2; + var init_smartSelection = __esm2({ + "src/services/smartSelection.ts"() { + "use strict"; + init_ts4(); + isImport2 = or(isImportDeclaration, isImportEqualsDeclaration); + } + }); + var ts_SmartSelectionRange_exports = {}; + __export2(ts_SmartSelectionRange_exports, { + getSmartSelectionRange: () => getSmartSelectionRange + }); + var init_ts_SmartSelectionRange = __esm2({ + "src/services/_namespaces/ts.SmartSelectionRange.ts"() { + "use strict"; + init_smartSelection(); + } + }); + function getSymbolKind(typeChecker, symbol, location2) { + const result2 = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2); + if (result2 !== "") { + return result2; + } + const flags = getCombinedLocalAndExportSymbolFlags(symbol); + if (flags & 32) { + return getDeclarationOfKind( + symbol, + 231 + /* ClassExpression */ + ) ? "local class" : "class"; + } + if (flags & 384) + return "enum"; + if (flags & 524288) + return "type"; + if (flags & 64) + return "interface"; + if (flags & 262144) + return "type parameter"; + if (flags & 8) + return "enum member"; + if (flags & 2097152) + return "alias"; + if (flags & 1536) + return "module"; + return result2; + } + function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2) { + const roots = typeChecker.getRootSymbols(symbol); + if (roots.length === 1 && first(roots).flags & 8192 && typeChecker.getTypeOfSymbolAtLocation(symbol, location2).getNonNullableType().getCallSignatures().length !== 0) { + return "method"; + } + if (typeChecker.isUndefinedSymbol(symbol)) { + return "var"; + } + if (typeChecker.isArgumentsSymbol(symbol)) { + return "local var"; + } + if (location2.kind === 110 && isExpression(location2) || isThisInTypeQuery(location2)) { + return "parameter"; + } + const flags = getCombinedLocalAndExportSymbolFlags(symbol); + if (flags & 3) { + if (isFirstDeclarationOfSymbolParameter(symbol)) { + return "parameter"; + } else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) { + return "const"; + } else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) { + return "using"; + } else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) { + return "await using"; + } else if (forEach4(symbol.declarations, isLet)) { + return "let"; + } + return isLocalVariableOrFunction(symbol) ? "local var" : "var"; + } + if (flags & 16) + return isLocalVariableOrFunction(symbol) ? "local function" : "function"; + if (flags & 32768) + return "getter"; + if (flags & 65536) + return "setter"; + if (flags & 8192) + return "method"; + if (flags & 16384) + return "constructor"; + if (flags & 131072) + return "index"; + if (flags & 4) { + if (flags & 33554432 && symbol.links.checkFlags & 6) { + const unionPropertyKind = forEach4(typeChecker.getRootSymbols(symbol), (rootSymbol) => { + const rootSymbolFlags = rootSymbol.getFlags(); + if (rootSymbolFlags & (98308 | 3)) { + return "property"; + } + }); + if (!unionPropertyKind) { + const typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location2); + if (typeOfUnionProperty.getCallSignatures().length) { + return "method"; + } + return "property"; + } + return unionPropertyKind; + } + return "property"; + } + return ""; + } + function getNormalizedSymbolModifiers(symbol) { + if (symbol.declarations && symbol.declarations.length) { + const [declaration, ...declarations] = symbol.declarations; + const excludeFlags = length(declarations) && isDeprecatedDeclaration(declaration) && some2(declarations, (d7) => !isDeprecatedDeclaration(d7)) ? 65536 : 0; + const modifiers = getNodeModifiers(declaration, excludeFlags); + if (modifiers) { + return modifiers.split(","); + } + } + return []; + } + function getSymbolModifiers(typeChecker, symbol) { + if (!symbol) { + return ""; + } + const modifiers = new Set(getNormalizedSymbolModifiers(symbol)); + if (symbol.flags & 2097152) { + const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol) { + forEach4(getNormalizedSymbolModifiers(resolvedSymbol), (modifier) => { + modifiers.add(modifier); + }); + } + } + if (symbol.flags & 16777216) { + modifiers.add( + "optional" + /* optionalModifier */ + ); + } + return modifiers.size > 0 ? arrayFrom(modifiers.values()).join(",") : ""; + } + function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(typeChecker, symbol, sourceFile, enclosingDeclaration, location2, type3, semanticMeaning, alias) { + var _a2; + const displayParts = []; + let documentation = []; + let tags6 = []; + const symbolFlags = getCombinedLocalAndExportSymbolFlags(symbol); + let symbolKind = semanticMeaning & 1 ? getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location2) : ""; + let hasAddedSymbolInfo = false; + const isThisExpression = location2.kind === 110 && isInExpressionContext(location2) || isThisInTypeQuery(location2); + let documentationFromAlias; + let tagsFromAlias; + let hasMultipleSignatures = false; + if (location2.kind === 110 && !isThisExpression) { + return { displayParts: [keywordPart( + 110 + /* ThisKeyword */ + )], documentation: [], symbolKind: "primitive type", tags: void 0 }; + } + if (symbolKind !== "" || symbolFlags & 32 || symbolFlags & 2097152) { + if (symbolKind === "getter" || symbolKind === "setter") { + const declaration = find2(symbol.declarations, (declaration2) => declaration2.name === location2); + if (declaration) { + switch (declaration.kind) { + case 177: + symbolKind = "getter"; + break; + case 178: + symbolKind = "setter"; + break; + case 172: + symbolKind = "accessor"; + break; + default: + Debug.assertNever(declaration); + } + } else { + symbolKind = "property"; + } + } + let signature; + type3 ?? (type3 = isThisExpression ? typeChecker.getTypeAtLocation(location2) : typeChecker.getTypeOfSymbolAtLocation(symbol, location2)); + if (location2.parent && location2.parent.kind === 211) { + const right = location2.parent.name; + if (right === location2 || right && right.getFullWidth() === 0) { + location2 = location2.parent; + } + } + let callExpressionLike; + if (isCallOrNewExpression(location2)) { + callExpressionLike = location2; + } else if (isCallExpressionTarget(location2) || isNewExpressionTarget(location2)) { + callExpressionLike = location2.parent; + } else if (location2.parent && (isJsxOpeningLikeElement(location2.parent) || isTaggedTemplateExpression(location2.parent)) && isFunctionLike(symbol.valueDeclaration)) { + callExpressionLike = location2.parent; + } + if (callExpressionLike) { + signature = typeChecker.getResolvedSignature(callExpressionLike); + const useConstructSignatures = callExpressionLike.kind === 214 || isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 108; + const allSignatures = useConstructSignatures ? type3.getConstructSignatures() : type3.getCallSignatures(); + if (signature && !contains2(allSignatures, signature.target) && !contains2(allSignatures, signature)) { + signature = allSignatures.length ? allSignatures[0] : void 0; + } + if (signature) { + if (useConstructSignatures && symbolFlags & 32) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type3.symbol, symbolKind); + } else if (symbolFlags & 2097152) { + symbolKind = "alias"; + pushSymbolKind(symbolKind); + displayParts.push(spacePart()); + if (useConstructSignatures) { + if (signature.flags & 4) { + displayParts.push(keywordPart( + 128 + /* AbstractKeyword */ + )); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart( + 105 + /* NewKeyword */ + )); + displayParts.push(spacePart()); + } + addFullSymbolName(symbol); + } else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + switch (symbolKind) { + case "JSX attribute": + case "property": + case "var": + case "const": + case "let": + case "parameter": + case "local var": + displayParts.push(punctuationPart( + 59 + /* ColonToken */ + )); + displayParts.push(spacePart()); + if (!(getObjectFlags(type3) & 16) && type3.symbol) { + addRange(displayParts, symbolToDisplayParts( + typeChecker, + type3.symbol, + enclosingDeclaration, + /*meaning*/ + void 0, + 4 | 1 + /* WriteTypeParametersOrArguments */ + )); + displayParts.push(lineBreakPart()); + } + if (useConstructSignatures) { + if (signature.flags & 4) { + displayParts.push(keywordPart( + 128 + /* AbstractKeyword */ + )); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart( + 105 + /* NewKeyword */ + )); + displayParts.push(spacePart()); + } + addSignatureDisplayParts( + signature, + allSignatures, + 262144 + /* WriteArrowStyleSignature */ + ); + break; + default: + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + hasMultipleSignatures = allSignatures.length > 1; + } + } else if (isNameOfFunctionDeclaration(location2) && !(symbolFlags & 98304) || // name of function declaration + location2.kind === 137 && location2.parent.kind === 176) { + const functionDeclaration = location2.parent; + const locationIsSymbolDeclaration = symbol.declarations && find2(symbol.declarations, (declaration) => declaration === (location2.kind === 137 ? functionDeclaration.parent : functionDeclaration)); + if (locationIsSymbolDeclaration) { + const allSignatures = functionDeclaration.kind === 176 ? type3.getNonNullableType().getConstructSignatures() : type3.getNonNullableType().getCallSignatures(); + if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { + signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); + } else { + signature = allSignatures[0]; + } + if (functionDeclaration.kind === 176) { + symbolKind = "constructor"; + addPrefixForAnyFunctionOrVar(type3.symbol, symbolKind); + } else { + addPrefixForAnyFunctionOrVar( + functionDeclaration.kind === 179 && !(type3.symbol.flags & 2048 || type3.symbol.flags & 4096) ? type3.symbol : symbol, + symbolKind + ); + } + if (signature) { + addSignatureDisplayParts(signature, allSignatures); + } + hasAddedSymbolInfo = true; + hasMultipleSignatures = allSignatures.length > 1; + } + } + } + if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) { + addAliasPrefixIfNecessary(); + if (getDeclarationOfKind( + symbol, + 231 + /* ClassExpression */ + )) { + pushSymbolKind( + "local class" + /* localClassElement */ + ); + } else { + displayParts.push(keywordPart( + 86 + /* ClassKeyword */ + )); + } + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & 64 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(keywordPart( + 120 + /* InterfaceKeyword */ + )); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + } + if (symbolFlags & 524288 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(keywordPart( + 156 + /* TypeKeyword */ + )); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + writeTypeParametersOfSymbol(symbol, sourceFile); + displayParts.push(spacePart()); + displayParts.push(operatorPart( + 64 + /* EqualsToken */ + )); + displayParts.push(spacePart()); + addRange(displayParts, typeToDisplayParts( + typeChecker, + location2.parent && isConstTypeReference(location2.parent) ? typeChecker.getTypeAtLocation(location2.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), + enclosingDeclaration, + 8388608 + /* InTypeAlias */ + )); + } + if (symbolFlags & 384) { + prefixNextMeaning(); + if (some2(symbol.declarations, (d7) => isEnumDeclaration(d7) && isEnumConst(d7))) { + displayParts.push(keywordPart( + 87 + /* ConstKeyword */ + )); + displayParts.push(spacePart()); + } + displayParts.push(keywordPart( + 94 + /* EnumKeyword */ + )); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & 1536 && !isThisExpression) { + prefixNextMeaning(); + const declaration = getDeclarationOfKind( + symbol, + 267 + /* ModuleDeclaration */ + ); + const isNamespace = declaration && declaration.name && declaration.name.kind === 80; + displayParts.push(keywordPart( + isNamespace ? 145 : 144 + /* ModuleKeyword */ + )); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + } + if (symbolFlags & 262144 && semanticMeaning & 2) { + prefixNextMeaning(); + displayParts.push(punctuationPart( + 21 + /* OpenParenToken */ + )); + displayParts.push(textPart("type parameter")); + displayParts.push(punctuationPart( + 22 + /* CloseParenToken */ + )); + displayParts.push(spacePart()); + addFullSymbolName(symbol); + if (symbol.parent) { + addInPrefix(); + addFullSymbolName(symbol.parent, enclosingDeclaration); + writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); + } else { + const decl = getDeclarationOfKind( + symbol, + 168 + /* TypeParameter */ + ); + if (decl === void 0) + return Debug.fail(); + const declaration = decl.parent; + if (declaration) { + if (isFunctionLike(declaration)) { + addInPrefix(); + const signature = typeChecker.getSignatureFromDeclaration(declaration); + if (declaration.kind === 180) { + displayParts.push(keywordPart( + 105 + /* NewKeyword */ + )); + displayParts.push(spacePart()); + } else if (declaration.kind !== 179 && declaration.name) { + addFullSymbolName(declaration.symbol); + } + addRange(displayParts, signatureToDisplayParts( + typeChecker, + signature, + sourceFile, + 32 + /* WriteTypeArgumentsOfSignature */ + )); + } else if (isTypeAliasDeclaration(declaration)) { + addInPrefix(); + displayParts.push(keywordPart( + 156 + /* TypeKeyword */ + )); + displayParts.push(spacePart()); + addFullSymbolName(declaration.symbol); + writeTypeParametersOfSymbol(declaration.symbol, sourceFile); + } + } + } + } + if (symbolFlags & 8) { + symbolKind = "enum member"; + addPrefixForAnyFunctionOrVar(symbol, "enum member"); + const declaration = (_a2 = symbol.declarations) == null ? void 0 : _a2[0]; + if ((declaration == null ? void 0 : declaration.kind) === 306) { + const constantValue = typeChecker.getConstantValue(declaration); + if (constantValue !== void 0) { + displayParts.push(spacePart()); + displayParts.push(operatorPart( + 64 + /* EqualsToken */ + )); + displayParts.push(spacePart()); + displayParts.push(displayPart( + getTextOfConstantValue(constantValue), + typeof constantValue === "number" ? 7 : 8 + /* stringLiteral */ + )); + } + } + } + if (symbol.flags & 2097152) { + prefixNextMeaning(); + if (!hasAddedSymbolInfo || documentation.length === 0 && tags6.length === 0) { + const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + const resolvedNode = resolvedSymbol.declarations[0]; + const declarationName = getNameOfDeclaration(resolvedNode); + if (declarationName && !hasAddedSymbolInfo) { + const isExternalModuleDeclaration = isModuleWithStringLiteralName(resolvedNode) && hasSyntacticModifier( + resolvedNode, + 128 + /* Ambient */ + ); + const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKindWorker( + typeChecker, + resolvedSymbol, + getSourceFileOfNode(resolvedNode), + resolvedNode, + declarationName, + type3, + semanticMeaning, + shouldUseAliasName ? symbol : resolvedSymbol + ); + displayParts.push(...resolvedInfo.displayParts); + displayParts.push(lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + tagsFromAlias = resolvedInfo.tags; + } else { + documentationFromAlias = resolvedSymbol.getContextualDocumentationComment(resolvedNode, typeChecker); + tagsFromAlias = resolvedSymbol.getJsDocTags(typeChecker); + } + } + } + if (symbol.declarations) { + switch (symbol.declarations[0].kind) { + case 270: + displayParts.push(keywordPart( + 95 + /* ExportKeyword */ + )); + displayParts.push(spacePart()); + displayParts.push(keywordPart( + 145 + /* NamespaceKeyword */ + )); + break; + case 277: + displayParts.push(keywordPart( + 95 + /* ExportKeyword */ + )); + displayParts.push(spacePart()); + displayParts.push(keywordPart( + symbol.declarations[0].isExportEquals ? 64 : 90 + /* DefaultKeyword */ + )); + break; + case 281: + displayParts.push(keywordPart( + 95 + /* ExportKeyword */ + )); + break; + default: + displayParts.push(keywordPart( + 102 + /* ImportKeyword */ + )); + } + } + displayParts.push(spacePart()); + addFullSymbolName(symbol); + forEach4(symbol.declarations, (declaration) => { + if (declaration.kind === 271) { + const importEqualsDeclaration = declaration; + if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { + displayParts.push(spacePart()); + displayParts.push(operatorPart( + 64 + /* EqualsToken */ + )); + displayParts.push(spacePart()); + displayParts.push(keywordPart( + 149 + /* RequireKeyword */ + )); + displayParts.push(punctuationPart( + 21 + /* OpenParenToken */ + )); + displayParts.push(displayPart( + getTextOfNode(getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), + 8 + /* stringLiteral */ + )); + displayParts.push(punctuationPart( + 22 + /* CloseParenToken */ + )); + } else { + const internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); + if (internalAliasSymbol) { + displayParts.push(spacePart()); + displayParts.push(operatorPart( + 64 + /* EqualsToken */ + )); + displayParts.push(spacePart()); + addFullSymbolName(internalAliasSymbol, enclosingDeclaration); + } + } + return true; + } + }); + } + if (!hasAddedSymbolInfo) { + if (symbolKind !== "") { + if (type3) { + if (isThisExpression) { + prefixNextMeaning(); + displayParts.push(keywordPart( + 110 + /* ThisKeyword */ + )); + } else { + addPrefixForAnyFunctionOrVar(symbol, symbolKind); + } + if (symbolKind === "property" || symbolKind === "accessor" || symbolKind === "getter" || symbolKind === "setter" || symbolKind === "JSX attribute" || symbolFlags & 3 || symbolKind === "local var" || symbolKind === "index" || symbolKind === "using" || symbolKind === "await using" || isThisExpression) { + displayParts.push(punctuationPart( + 59 + /* ColonToken */ + )); + displayParts.push(spacePart()); + if (type3.symbol && type3.symbol.flags & 262144 && symbolKind !== "index") { + const typeParameterParts = mapToDisplayParts((writer) => { + const param = typeChecker.typeParameterToDeclaration(type3, enclosingDeclaration, symbolDisplayNodeBuilderFlags); + getPrinter().writeNode(4, param, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration)), writer); + }); + addRange(displayParts, typeParameterParts); + } else { + addRange(displayParts, typeToDisplayParts(typeChecker, type3, enclosingDeclaration)); + } + if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) { + const labelDecl = symbol.links.target.links.tupleLabelDeclaration; + Debug.assertNode(labelDecl.name, isIdentifier); + displayParts.push(spacePart()); + displayParts.push(punctuationPart( + 21 + /* OpenParenToken */ + )); + displayParts.push(textPart(idText(labelDecl.name))); + displayParts.push(punctuationPart( + 22 + /* CloseParenToken */ + )); + } + } else if (symbolFlags & 16 || symbolFlags & 8192 || symbolFlags & 16384 || symbolFlags & 131072 || symbolFlags & 98304 || symbolKind === "method") { + const allSignatures = type3.getNonNullableType().getCallSignatures(); + if (allSignatures.length) { + addSignatureDisplayParts(allSignatures[0], allSignatures); + hasMultipleSignatures = allSignatures.length > 1; + } + } + } + } else { + symbolKind = getSymbolKind(typeChecker, symbol, location2); + } + } + if (documentation.length === 0 && !hasMultipleSignatures) { + documentation = symbol.getContextualDocumentationComment(enclosingDeclaration, typeChecker); + } + if (documentation.length === 0 && symbolFlags & 4) { + if (symbol.parent && symbol.declarations && forEach4( + symbol.parent.declarations, + (declaration) => declaration.kind === 312 + /* SourceFile */ + )) { + for (const declaration of symbol.declarations) { + if (!declaration.parent || declaration.parent.kind !== 226) { + continue; + } + const rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); + if (!rhsSymbol) { + continue; + } + documentation = rhsSymbol.getDocumentationComment(typeChecker); + tags6 = rhsSymbol.getJsDocTags(typeChecker); + if (documentation.length > 0) { + break; + } + } + } + } + if (documentation.length === 0 && isIdentifier(location2) && symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration)) { + const declaration = symbol.valueDeclaration; + const parent22 = declaration.parent; + const name2 = declaration.propertyName || declaration.name; + if (isIdentifier(name2) && isObjectBindingPattern(parent22)) { + const propertyName = getTextOfIdentifierOrLiteral(name2); + const objectType2 = typeChecker.getTypeAtLocation(parent22); + documentation = firstDefined(objectType2.isUnion() ? objectType2.types : [objectType2], (t8) => { + const prop = t8.getProperty(propertyName); + return prop ? prop.getDocumentationComment(typeChecker) : void 0; + }) || emptyArray; + } + } + if (tags6.length === 0 && !hasMultipleSignatures) { + tags6 = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker); + } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } + if (tags6.length === 0 && tagsFromAlias) { + tags6 = tagsFromAlias; + } + return { displayParts, documentation, symbolKind, tags: tags6.length === 0 ? void 0 : tags6 }; + function getPrinter() { + return createPrinterWithRemoveComments(); + } + function prefixNextMeaning() { + if (displayParts.length) { + displayParts.push(lineBreakPart()); + } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushSymbolKind( + "alias" + /* alias */ + ); + displayParts.push(spacePart()); + } + } + function addInPrefix() { + displayParts.push(spacePart()); + displayParts.push(keywordPart( + 103 + /* InKeyword */ + )); + displayParts.push(spacePart()); + } + function addFullSymbolName(symbolToDisplay, enclosingDeclaration2) { + let indexInfos; + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + if (symbolKind === "index") { + indexInfos = typeChecker.getIndexInfosOfIndexSymbol(symbolToDisplay); + } + let fullSymbolDisplayParts = []; + if (symbolToDisplay.flags & 131072 && indexInfos) { + if (symbolToDisplay.parent) { + fullSymbolDisplayParts = symbolToDisplayParts(typeChecker, symbolToDisplay.parent); + } + fullSymbolDisplayParts.push(punctuationPart( + 23 + /* OpenBracketToken */ + )); + indexInfos.forEach((info2, i7) => { + fullSymbolDisplayParts.push(...typeToDisplayParts(typeChecker, info2.keyType)); + if (i7 !== indexInfos.length - 1) { + fullSymbolDisplayParts.push(spacePart()); + fullSymbolDisplayParts.push(punctuationPart( + 52 + /* BarToken */ + )); + fullSymbolDisplayParts.push(spacePart()); + } + }); + fullSymbolDisplayParts.push(punctuationPart( + 24 + /* CloseBracketToken */ + )); + } else { + fullSymbolDisplayParts = symbolToDisplayParts( + typeChecker, + symbolToDisplay, + enclosingDeclaration2 || sourceFile, + /*meaning*/ + void 0, + 1 | 2 | 4 + /* AllowAnyNodeKind */ + ); + } + addRange(displayParts, fullSymbolDisplayParts); + if (symbol.flags & 16777216) { + displayParts.push(punctuationPart( + 58 + /* QuestionToken */ + )); + } + } + function addPrefixForAnyFunctionOrVar(symbol2, symbolKind2) { + prefixNextMeaning(); + if (symbolKind2) { + pushSymbolKind(symbolKind2); + if (symbol2 && !some2(symbol2.declarations, (d7) => isArrowFunction(d7) || (isFunctionExpression(d7) || isClassExpression(d7)) && !d7.name)) { + displayParts.push(spacePart()); + addFullSymbolName(symbol2); + } + } + } + function pushSymbolKind(symbolKind2) { + switch (symbolKind2) { + case "var": + case "function": + case "let": + case "const": + case "constructor": + case "using": + case "await using": + displayParts.push(textOrKeywordPart(symbolKind2)); + return; + default: + displayParts.push(punctuationPart( + 21 + /* OpenParenToken */ + )); + displayParts.push(textOrKeywordPart(symbolKind2)); + displayParts.push(punctuationPart( + 22 + /* CloseParenToken */ + )); + return; + } + } + function addSignatureDisplayParts(signature, allSignatures, flags = 0) { + addRange(displayParts, signatureToDisplayParts( + typeChecker, + signature, + enclosingDeclaration, + flags | 32 + /* WriteTypeArgumentsOfSignature */ + )); + if (allSignatures.length > 1) { + displayParts.push(spacePart()); + displayParts.push(punctuationPart( + 21 + /* OpenParenToken */ + )); + displayParts.push(operatorPart( + 40 + /* PlusToken */ + )); + displayParts.push(displayPart( + (allSignatures.length - 1).toString(), + 7 + /* numericLiteral */ + )); + displayParts.push(spacePart()); + displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); + displayParts.push(punctuationPart( + 22 + /* CloseParenToken */ + )); + } + documentation = signature.getDocumentationComment(typeChecker); + tags6 = signature.getJsDocTags(); + if (allSignatures.length > 1 && documentation.length === 0 && tags6.length === 0) { + documentation = allSignatures[0].getDocumentationComment(typeChecker); + tags6 = allSignatures[0].getJsDocTags().filter((tag) => tag.name !== "deprecated"); + } + } + function writeTypeParametersOfSymbol(symbol2, enclosingDeclaration2) { + const typeParameterParts = mapToDisplayParts((writer) => { + const params = typeChecker.symbolToTypeParameterDeclarations(symbol2, enclosingDeclaration2, symbolDisplayNodeBuilderFlags); + getPrinter().writeList(53776, params, getSourceFileOfNode(getParseTreeNode(enclosingDeclaration2)), writer); + }); + addRange(displayParts, typeParameterParts); + } + } + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location2, semanticMeaning = getMeaningFromLocation(location2), alias) { + return getSymbolDisplayPartsDocumentationAndSymbolKindWorker( + typeChecker, + symbol, + sourceFile, + enclosingDeclaration, + location2, + /*type*/ + void 0, + semanticMeaning, + alias + ); + } + function isLocalVariableOrFunction(symbol) { + if (symbol.parent) { + return false; + } + return forEach4(symbol.declarations, (declaration) => { + if (declaration.kind === 218) { + return true; + } + if (declaration.kind !== 260 && declaration.kind !== 262) { + return false; + } + for (let parent22 = declaration.parent; !isFunctionBlock(parent22); parent22 = parent22.parent) { + if (parent22.kind === 312 || parent22.kind === 268) { + return false; + } + } + return true; + }); + } + var symbolDisplayNodeBuilderFlags; + var init_symbolDisplay = __esm2({ + "src/services/symbolDisplay.ts"() { + "use strict"; + init_ts4(); + symbolDisplayNodeBuilderFlags = 8192 | 70221824 | 16384; + } + }); + var ts_SymbolDisplay_exports = {}; + __export2(ts_SymbolDisplay_exports, { + getSymbolDisplayPartsDocumentationAndSymbolKind: () => getSymbolDisplayPartsDocumentationAndSymbolKind, + getSymbolKind: () => getSymbolKind, + getSymbolModifiers: () => getSymbolModifiers + }); + var init_ts_SymbolDisplay = __esm2({ + "src/services/_namespaces/ts.SymbolDisplay.ts"() { + "use strict"; + init_symbolDisplay(); + } + }); + function getPos2(n7) { + const result2 = n7.__pos; + Debug.assert(typeof result2 === "number"); + return result2; + } + function setPos(n7, pos) { + Debug.assert(typeof pos === "number"); + n7.__pos = pos; + } + function getEnd(n7) { + const result2 = n7.__end; + Debug.assert(typeof result2 === "number"); + return result2; + } + function setEnd(n7, end) { + Debug.assert(typeof end === "number"); + n7.__end = end; + } + function skipWhitespacesAndLineBreaks(text, start) { + return skipTrivia( + text, + start, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + function hasCommentsBeforeLineBreak(text, start) { + let i7 = start; + while (i7 < text.length) { + const ch = text.charCodeAt(i7); + if (isWhiteSpaceSingleLine(ch)) { + i7++; + continue; + } + return ch === 47; + } + return false; + } + function getAdjustedRange(sourceFile, startNode2, endNode2, options) { + return { pos: getAdjustedStartPosition(sourceFile, startNode2, options), end: getAdjustedEndPosition(sourceFile, endNode2, options) }; + } + function getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment = false) { + var _a2, _b; + const { leadingTriviaOption } = options; + if (leadingTriviaOption === 0) { + return node.getStart(sourceFile); + } + if (leadingTriviaOption === 3) { + const startPos = node.getStart(sourceFile); + const pos = getLineStartPositionForPosition(startPos, sourceFile); + return rangeContainsPosition(node, pos) ? pos : startPos; + } + if (leadingTriviaOption === 2) { + const JSDocComments = getJSDocCommentRanges(node, sourceFile.text); + if (JSDocComments == null ? void 0 : JSDocComments.length) { + return getLineStartPositionForPosition(JSDocComments[0].pos, sourceFile); + } + } + const fullStart = node.getFullStart(); + const start = node.getStart(sourceFile); + if (fullStart === start) { + return start; + } + const fullStartLine = getLineStartPositionForPosition(fullStart, sourceFile); + const startLine = getLineStartPositionForPosition(start, sourceFile); + if (startLine === fullStartLine) { + return leadingTriviaOption === 1 ? fullStart : start; + } + if (hasTrailingComment) { + const comment = ((_a2 = getLeadingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _a2[0]) || ((_b = getTrailingCommentRanges(sourceFile.text, fullStart)) == null ? void 0 : _b[0]); + if (comment) { + return skipTrivia( + sourceFile.text, + comment.end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + } + } + const nextLineStart = fullStart > 0 ? 1 : 0; + let adjustedStartPosition = getStartPositionOfLine(getLineOfLocalPosition(sourceFile, fullStartLine) + nextLineStart, sourceFile); + adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); + return getStartPositionOfLine(getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); + } + function getEndPositionOfMultilineTrailingComment(sourceFile, node, options) { + const { end } = node; + const { trailingTriviaOption } = options; + if (trailingTriviaOption === 2) { + const comments = getTrailingCommentRanges(sourceFile.text, end); + if (comments) { + const nodeEndLine = getLineOfLocalPosition(sourceFile, node.end); + for (const comment of comments) { + if (comment.kind === 2 || getLineOfLocalPosition(sourceFile, comment.pos) > nodeEndLine) { + break; + } + const commentEndLine = getLineOfLocalPosition(sourceFile, comment.end); + if (commentEndLine > nodeEndLine) { + return skipTrivia( + sourceFile.text, + comment.end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + } + } + } + } + return void 0; + } + function getAdjustedEndPosition(sourceFile, node, options) { + var _a2; + const { end } = node; + const { trailingTriviaOption } = options; + if (trailingTriviaOption === 0) { + return end; + } + if (trailingTriviaOption === 1) { + const comments = concatenate(getTrailingCommentRanges(sourceFile.text, end), getLeadingCommentRanges(sourceFile.text, end)); + const realEnd = (_a2 = comments == null ? void 0 : comments[comments.length - 1]) == null ? void 0 : _a2.end; + if (realEnd) { + return realEnd; + } + return end; + } + const multilineEndPosition = getEndPositionOfMultilineTrailingComment(sourceFile, node, options); + if (multilineEndPosition) { + return multilineEndPosition; + } + const newEnd = skipTrivia( + sourceFile.text, + end, + /*stopAfterLineBreak*/ + true + ); + return newEnd !== end && (trailingTriviaOption === 2 || isLineBreak2(sourceFile.text.charCodeAt(newEnd - 1))) ? newEnd : end; + } + function isSeparator(node, candidate) { + return !!candidate && !!node.parent && (candidate.kind === 28 || candidate.kind === 27 && node.parent.kind === 210); + } + function isThisTypeAnnotatable(containingFunction) { + return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction); + } + function updateJSDocHost(parent22) { + if (parent22.kind !== 219) { + return parent22; + } + const jsDocNode = parent22.parent.kind === 172 ? parent22.parent : parent22.parent.parent; + jsDocNode.jsDoc = parent22.jsDoc; + return jsDocNode; + } + function tryMergeJsdocTags(oldTag, newTag) { + if (oldTag.kind !== newTag.kind) { + return void 0; + } + switch (oldTag.kind) { + case 348: { + const oldParam = oldTag; + const newParam = newTag; + return isIdentifier(oldParam.name) && isIdentifier(newParam.name) && oldParam.name.escapedText === newParam.name.escapedText ? factory.createJSDocParameterTag( + /*tagName*/ + void 0, + newParam.name, + /*isBracketed*/ + false, + newParam.typeExpression, + newParam.isNameFirst, + oldParam.comment + ) : void 0; + } + case 349: + return factory.createJSDocReturnTag( + /*tagName*/ + void 0, + newTag.typeExpression, + oldTag.comment + ); + case 351: + return factory.createJSDocTypeTag( + /*tagName*/ + void 0, + newTag.typeExpression, + oldTag.comment + ); + } + } + function startPositionToDeleteNodeInList(sourceFile, node) { + return skipTrivia( + sourceFile.text, + getAdjustedStartPosition(sourceFile, node, { + leadingTriviaOption: 1 + /* IncludeAll */ + }), + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + } + function endPositionToDeleteNodeInList(sourceFile, node, prevNode, nextNode) { + const end = startPositionToDeleteNodeInList(sourceFile, nextNode); + if (prevNode === void 0 || positionsAreOnSameLine(getAdjustedEndPosition(sourceFile, node, {}), end, sourceFile)) { + return end; + } + const token = findPrecedingToken(nextNode.getStart(sourceFile), sourceFile); + if (isSeparator(node, token)) { + const prevToken = findPrecedingToken(node.getStart(sourceFile), sourceFile); + if (isSeparator(prevNode, prevToken)) { + const pos = skipTrivia( + sourceFile.text, + token.getEnd(), + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + true + ); + if (positionsAreOnSameLine(prevToken.getStart(sourceFile), token.getStart(sourceFile), sourceFile)) { + return isLineBreak2(sourceFile.text.charCodeAt(pos - 1)) ? pos - 1 : pos; + } + if (isLineBreak2(sourceFile.text.charCodeAt(pos))) { + return pos; + } + } + } + return end; + } + function getClassOrObjectBraceEnds(cls, sourceFile) { + const open2 = findChildOfKind(cls, 19, sourceFile); + const close = findChildOfKind(cls, 20, sourceFile); + return [open2 == null ? void 0 : open2.end, close == null ? void 0 : close.end]; + } + function getMembersOrProperties(node) { + return isObjectLiteralExpression(node) ? node.properties : node.members; + } + function applyChanges(text, changes) { + for (let i7 = changes.length - 1; i7 >= 0; i7--) { + const { span, newText } = changes[i7]; + text = `${text.substring(0, span.start)}${newText}${text.substring(textSpanEnd(span))}`; + } + return text; + } + function isTrivia2(s7) { + return skipTrivia(s7, 0) === s7.length; + } + function assignPositionsToNode(node) { + const visited = visitEachChild(node, assignPositionsToNode, textChangesTransformationContext, assignPositionsToNodeArray, assignPositionsToNode); + const newNode = nodeIsSynthesized(visited) ? visited : Object.create(visited); + setTextRangePosEnd(newNode, getPos2(node), getEnd(node)); + return newNode; + } + function assignPositionsToNodeArray(nodes, visitor, test, start, count2) { + const visited = visitNodes2(nodes, visitor, test, start, count2); + if (!visited) { + return visited; + } + Debug.assert(nodes); + const nodeArray = visited === nodes ? factory.createNodeArray(visited.slice(0)) : visited; + setTextRangePosEnd(nodeArray, getPos2(nodes), getEnd(nodes)); + return nodeArray; + } + function createWriter(newLine) { + let lastNonTriviaPosition = 0; + const writer = createTextWriter(newLine); + const onBeforeEmitNode = (node) => { + if (node) { + setPos(node, lastNonTriviaPosition); + } + }; + const onAfterEmitNode = (node) => { + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + const onBeforeEmitNodeArray = (nodes) => { + if (nodes) { + setPos(nodes, lastNonTriviaPosition); + } + }; + const onAfterEmitNodeArray = (nodes) => { + if (nodes) { + setEnd(nodes, lastNonTriviaPosition); + } + }; + const onBeforeEmitToken = (node) => { + if (node) { + setPos(node, lastNonTriviaPosition); + } + }; + const onAfterEmitToken = (node) => { + if (node) { + setEnd(node, lastNonTriviaPosition); + } + }; + function setLastNonTriviaPosition(s7, force) { + if (force || !isTrivia2(s7)) { + lastNonTriviaPosition = writer.getTextPos(); + let i7 = 0; + while (isWhiteSpaceLike(s7.charCodeAt(s7.length - i7 - 1))) { + i7++; + } + lastNonTriviaPosition -= i7; + } + } + function write(s7) { + writer.write(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeComment(s7) { + writer.writeComment(s7); + } + function writeKeyword(s7) { + writer.writeKeyword(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeOperator(s7) { + writer.writeOperator(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writePunctuation(s7) { + writer.writePunctuation(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeTrailingSemicolon(s7) { + writer.writeTrailingSemicolon(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeParameter(s7) { + writer.writeParameter(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeProperty(s7) { + writer.writeProperty(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeSpace(s7) { + writer.writeSpace(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeStringLiteral(s7) { + writer.writeStringLiteral(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeSymbol(s7, sym) { + writer.writeSymbol(s7, sym); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeLine(force) { + writer.writeLine(force); + } + function increaseIndent() { + writer.increaseIndent(); + } + function decreaseIndent() { + writer.decreaseIndent(); + } + function getText() { + return writer.getText(); + } + function rawWrite(s7) { + writer.rawWrite(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + false + ); + } + function writeLiteral(s7) { + writer.writeLiteral(s7); + setLastNonTriviaPosition( + s7, + /*force*/ + true + ); + } + function getTextPos() { + return writer.getTextPos(); + } + function getLine2() { + return writer.getLine(); + } + function getColumn() { + return writer.getColumn(); + } + function getIndent() { + return writer.getIndent(); + } + function isAtStartOfLine() { + return writer.isAtStartOfLine(); + } + function clear22() { + writer.clear(); + lastNonTriviaPosition = 0; + } + return { + onBeforeEmitNode, + onAfterEmitNode, + onBeforeEmitNodeArray, + onAfterEmitNodeArray, + onBeforeEmitToken, + onAfterEmitToken, + write, + writeComment, + writeKeyword, + writeOperator, + writePunctuation, + writeTrailingSemicolon, + writeParameter, + writeProperty, + writeSpace, + writeStringLiteral, + writeSymbol, + writeLine, + increaseIndent, + decreaseIndent, + getText, + rawWrite, + writeLiteral, + getTextPos, + getLine: getLine2, + getColumn, + getIndent, + isAtStartOfLine, + hasTrailingComment: () => writer.hasTrailingComment(), + hasTrailingWhitespace: () => writer.hasTrailingWhitespace(), + clear: clear22 + }; + } + function getInsertionPositionAtSourceFileTop(sourceFile) { + let lastPrologue; + for (const node of sourceFile.statements) { + if (isPrologueDirective(node)) { + lastPrologue = node; + } else { + break; + } + } + let position = 0; + const text = sourceFile.text; + if (lastPrologue) { + position = lastPrologue.end; + advancePastLineBreak(); + return position; + } + const shebang = getShebang(text); + if (shebang !== void 0) { + position = shebang.length; + advancePastLineBreak(); + } + const ranges = getLeadingCommentRanges(text, position); + if (!ranges) + return position; + let lastComment; + let firstNodeLine; + for (const range2 of ranges) { + if (range2.kind === 3) { + if (isPinnedComment(text, range2.pos)) { + lastComment = { range: range2, pinnedOrTripleSlash: true }; + continue; + } + } else if (isRecognizedTripleSlashComment(text, range2.pos, range2.end)) { + lastComment = { range: range2, pinnedOrTripleSlash: true }; + continue; + } + if (lastComment) { + if (lastComment.pinnedOrTripleSlash) + break; + const commentLine = sourceFile.getLineAndCharacterOfPosition(range2.pos).line; + const lastCommentEndLine = sourceFile.getLineAndCharacterOfPosition(lastComment.range.end).line; + if (commentLine >= lastCommentEndLine + 2) + break; + } + if (sourceFile.statements.length) { + if (firstNodeLine === void 0) + firstNodeLine = sourceFile.getLineAndCharacterOfPosition(sourceFile.statements[0].getStart()).line; + const commentEndLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line; + if (firstNodeLine < commentEndLine + 2) + break; + } + lastComment = { range: range2, pinnedOrTripleSlash: false }; + } + if (lastComment) { + position = lastComment.range.end; + advancePastLineBreak(); + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + const charCode = text.charCodeAt(position); + if (isLineBreak2(charCode)) { + position++; + if (position < text.length && charCode === 13 && text.charCodeAt(position) === 10) { + position++; + } + } + } + } + } + function isValidLocationToAddComment(sourceFile, position) { + return !isInComment(sourceFile, position) && !isInString(sourceFile, position) && !isInTemplateString(sourceFile, position) && !isInJSXText(sourceFile, position); + } + function needSemicolonBetween(a7, b8) { + return (isPropertySignature(a7) || isPropertyDeclaration(a7)) && isClassOrTypeElement(b8) && b8.name.kind === 167 || isStatementButNotDeclaration(a7) && isStatementButNotDeclaration(b8); + } + function deleteNode(changes, sourceFile, node, options = { + leadingTriviaOption: 1 + /* IncludeAll */ + }) { + const startPosition = getAdjustedStartPosition(sourceFile, node, options); + const endPosition = getAdjustedEndPosition(sourceFile, node, options); + changes.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + function deleteNodeInList(changes, deletedNodesInLists, sourceFile, node) { + const containingList = Debug.checkDefined(ts_formatting_exports.SmartIndenter.getContainingList(node, sourceFile)); + const index4 = indexOfNode(containingList, node); + Debug.assert(index4 !== -1); + if (containingList.length === 1) { + deleteNode(changes, sourceFile, node); + return; + } + Debug.assert(!deletedNodesInLists.has(node), "Deleting a node twice"); + deletedNodesInLists.add(node); + changes.deleteRange(sourceFile, { + pos: startPositionToDeleteNodeInList(sourceFile, node), + end: index4 === containingList.length - 1 ? getAdjustedEndPosition(sourceFile, node, {}) : endPositionToDeleteNodeInList(sourceFile, node, containingList[index4 - 1], containingList[index4 + 1]) + }); + } + var LeadingTriviaOption, TrailingTriviaOption, useNonAdjustedPositions, ChangeTracker, changesToText, textChangesTransformationContext, deleteDeclaration; + var init_textChanges = __esm2({ + "src/services/textChanges.ts"() { + "use strict"; + init_ts4(); + LeadingTriviaOption = /* @__PURE__ */ ((LeadingTriviaOption2) => { + LeadingTriviaOption2[LeadingTriviaOption2["Exclude"] = 0] = "Exclude"; + LeadingTriviaOption2[LeadingTriviaOption2["IncludeAll"] = 1] = "IncludeAll"; + LeadingTriviaOption2[LeadingTriviaOption2["JSDoc"] = 2] = "JSDoc"; + LeadingTriviaOption2[LeadingTriviaOption2["StartLine"] = 3] = "StartLine"; + return LeadingTriviaOption2; + })(LeadingTriviaOption || {}); + TrailingTriviaOption = /* @__PURE__ */ ((TrailingTriviaOption2) => { + TrailingTriviaOption2[TrailingTriviaOption2["Exclude"] = 0] = "Exclude"; + TrailingTriviaOption2[TrailingTriviaOption2["ExcludeWhitespace"] = 1] = "ExcludeWhitespace"; + TrailingTriviaOption2[TrailingTriviaOption2["Include"] = 2] = "Include"; + return TrailingTriviaOption2; + })(TrailingTriviaOption || {}); + useNonAdjustedPositions = { + leadingTriviaOption: 0, + trailingTriviaOption: 0 + /* Exclude */ + }; + ChangeTracker = class _ChangeTracker { + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + constructor(newLineCharacter, formatContext) { + this.newLineCharacter = newLineCharacter; + this.formatContext = formatContext; + this.changes = []; + this.classesWithNodesInsertedAtStart = /* @__PURE__ */ new Map(); + this.deletedNodes = []; + } + static fromContext(context2) { + return new _ChangeTracker(getNewLineOrDefaultFromHost(context2.host, context2.formatContext.options), context2.formatContext); + } + static with(context2, cb) { + const tracker = _ChangeTracker.fromContext(context2); + cb(tracker); + return tracker.getChanges(); + } + pushRaw(sourceFile, change) { + Debug.assertEqual(sourceFile.fileName, change.fileName); + for (const c7 of change.textChanges) { + this.changes.push({ + kind: 3, + sourceFile, + text: c7.newText, + range: createTextRangeFromSpan(c7.span) + }); + } + } + deleteRange(sourceFile, range2) { + this.changes.push({ kind: 0, sourceFile, range: range2 }); + } + delete(sourceFile, node) { + this.deletedNodes.push({ sourceFile, node }); + } + /** Stop! Consider using `delete` instead, which has logic for deleting nodes from delimited lists. */ + deleteNode(sourceFile, node, options = { + leadingTriviaOption: 1 + /* IncludeAll */ + }) { + this.deleteRange(sourceFile, getAdjustedRange(sourceFile, node, node, options)); + } + deleteNodes(sourceFile, nodes, options = { + leadingTriviaOption: 1 + /* IncludeAll */ + }, hasTrailingComment) { + for (const node of nodes) { + const pos = getAdjustedStartPosition(sourceFile, node, options, hasTrailingComment); + const end = getAdjustedEndPosition(sourceFile, node, options); + this.deleteRange(sourceFile, { pos, end }); + hasTrailingComment = !!getEndPositionOfMultilineTrailingComment(sourceFile, node, options); + } + } + deleteModifier(sourceFile, modifier) { + this.deleteRange(sourceFile, { pos: modifier.getStart(sourceFile), end: skipTrivia( + sourceFile.text, + modifier.end, + /*stopAfterLineBreak*/ + true + ) }); + } + deleteNodeRange(sourceFile, startNode2, endNode2, options = { + leadingTriviaOption: 1 + /* IncludeAll */ + }) { + const startPosition = getAdjustedStartPosition(sourceFile, startNode2, options); + const endPosition = getAdjustedEndPosition(sourceFile, endNode2, options); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + deleteNodeRangeExcludingEnd(sourceFile, startNode2, afterEndNode, options = { + leadingTriviaOption: 1 + /* IncludeAll */ + }) { + const startPosition = getAdjustedStartPosition(sourceFile, startNode2, options); + const endPosition = afterEndNode === void 0 ? sourceFile.text.length : getAdjustedStartPosition(sourceFile, afterEndNode, options); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); + } + replaceRange(sourceFile, range2, newNode, options = {}) { + this.changes.push({ kind: 1, sourceFile, range: range2, options, node: newNode }); + } + replaceNode(sourceFile, oldNode, newNode, options = useNonAdjustedPositions) { + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNode, options); + } + replaceNodeRange(sourceFile, startNode2, endNode2, newNode, options = useNonAdjustedPositions) { + this.replaceRange(sourceFile, getAdjustedRange(sourceFile, startNode2, endNode2, options), newNode, options); + } + replaceRangeWithNodes(sourceFile, range2, newNodes, options = {}) { + this.changes.push({ kind: 2, sourceFile, range: range2, options, nodes: newNodes }); + } + replaceNodeWithNodes(sourceFile, oldNode, newNodes, options = useNonAdjustedPositions) { + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, options), newNodes, options); + } + replaceNodeWithText(sourceFile, oldNode, text) { + this.replaceRangeWithText(sourceFile, getAdjustedRange(sourceFile, oldNode, oldNode, useNonAdjustedPositions), text); + } + replaceNodeRangeWithNodes(sourceFile, startNode2, endNode2, newNodes, options = useNonAdjustedPositions) { + this.replaceRangeWithNodes(sourceFile, getAdjustedRange(sourceFile, startNode2, endNode2, options), newNodes, options); + } + nodeHasTrailingComment(sourceFile, oldNode, configurableEnd = useNonAdjustedPositions) { + return !!getEndPositionOfMultilineTrailingComment(sourceFile, oldNode, configurableEnd); + } + nextCommaToken(sourceFile, node) { + const next = findNextToken(node, node.parent, sourceFile); + return next && next.kind === 28 ? next : void 0; + } + replacePropertyAssignment(sourceFile, oldNode, newNode) { + const suffix = this.nextCommaToken(sourceFile, oldNode) ? "" : "," + this.newLineCharacter; + this.replaceNode(sourceFile, oldNode, newNode, { suffix }); + } + insertNodeAt(sourceFile, pos, newNode, options = {}) { + this.replaceRange(sourceFile, createRange2(pos), newNode, options); + } + insertNodesAt(sourceFile, pos, newNodes, options = {}) { + this.replaceRangeWithNodes(sourceFile, createRange2(pos), newNodes, options); + } + insertNodeAtTopOfFile(sourceFile, newNode, blankLineBetween) { + this.insertAtTopOfFile(sourceFile, newNode, blankLineBetween); + } + insertNodesAtTopOfFile(sourceFile, newNodes, blankLineBetween) { + this.insertAtTopOfFile(sourceFile, newNodes, blankLineBetween); + } + insertAtTopOfFile(sourceFile, insert, blankLineBetween) { + const pos = getInsertionPositionAtSourceFileTop(sourceFile); + const options = { + prefix: pos === 0 ? void 0 : this.newLineCharacter, + suffix: (isLineBreak2(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : "") + }; + if (isArray3(insert)) { + this.insertNodesAt(sourceFile, pos, insert, options); + } else { + this.insertNodeAt(sourceFile, pos, insert, options); + } + } + insertNodesAtEndOfFile(sourceFile, newNodes, blankLineBetween) { + this.insertAtEndOfFile(sourceFile, newNodes, blankLineBetween); + } + insertAtEndOfFile(sourceFile, insert, blankLineBetween) { + const pos = sourceFile.end + 1; + const options = { + prefix: this.newLineCharacter, + suffix: this.newLineCharacter + (blankLineBetween ? this.newLineCharacter : "") + }; + this.insertNodesAt(sourceFile, pos, insert, options); + } + insertStatementsInNewFile(fileName, statements, oldFile) { + if (!this.newFileChanges) { + this.newFileChanges = createMultiMap(); + } + this.newFileChanges.add(fileName, { oldFile, statements }); + } + insertFirstParameter(sourceFile, parameters, newParam) { + const p0 = firstOrUndefined(parameters); + if (p0) { + this.insertNodeBefore(sourceFile, p0, newParam); + } else { + this.insertNodeAt(sourceFile, parameters.pos, newParam); + } + } + insertNodeBefore(sourceFile, before2, newNode, blankLineBetween = false, options = {}) { + this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before2, options), newNode, this.getOptionsForInsertNodeBefore(before2, newNode, blankLineBetween)); + } + insertNodesBefore(sourceFile, before2, newNodes, blankLineBetween = false, options = {}) { + this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before2, options), newNodes, this.getOptionsForInsertNodeBefore(before2, first(newNodes), blankLineBetween)); + } + insertModifierAt(sourceFile, pos, modifier, options = {}) { + this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options); + } + insertModifierBefore(sourceFile, modifier, before2) { + return this.insertModifierAt(sourceFile, before2.getStart(sourceFile), modifier, { suffix: " " }); + } + insertCommentBeforeLine(sourceFile, lineNumber, position, commentText) { + const lineStartPosition = getStartPositionOfLine(lineNumber, sourceFile); + const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); + const insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition); + const token = getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position); + const indent3 = sourceFile.text.slice(lineStartPosition, startPosition); + const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${indent3}`; + this.insertText(sourceFile, token.getStart(sourceFile), text); + } + insertJsdocCommentBefore(sourceFile, node, tag) { + const fnStart = node.getStart(sourceFile); + if (node.jsDoc) { + for (const jsdoc of node.jsDoc) { + this.deleteRange(sourceFile, { + pos: getLineStartPositionForPosition(jsdoc.getStart(sourceFile), sourceFile), + end: getAdjustedEndPosition( + sourceFile, + jsdoc, + /*options*/ + {} + ) + }); + } + } + const startPosition = getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1); + const indent3 = sourceFile.text.slice(startPosition, fnStart); + this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent3 }); + } + createJSDocText(sourceFile, node) { + const comments = flatMap2(node.jsDoc, (jsDoc2) => isString4(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment); + const jsDoc = singleOrUndefined(node.jsDoc); + return jsDoc && positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && length(comments) === 0 ? void 0 : factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n"))); + } + replaceJSDocComment(sourceFile, node, tags6) { + this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), factory.createJSDocComment(this.createJSDocText(sourceFile, node), factory.createNodeArray(tags6))); + } + addJSDocTags(sourceFile, parent22, newTags) { + const oldTags = flatMapToMutable(parent22.jsDoc, (j6) => j6.tags); + const unmergedNewTags = newTags.filter( + (newTag) => !oldTags.some((tag, i7) => { + const merged = tryMergeJsdocTags(tag, newTag); + if (merged) + oldTags[i7] = merged; + return !!merged; + }) + ); + this.replaceJSDocComment(sourceFile, parent22, [...oldTags, ...unmergedNewTags]); + } + filterJSDocTags(sourceFile, parent22, predicate) { + this.replaceJSDocComment(sourceFile, parent22, filter2(flatMapToMutable(parent22.jsDoc, (j6) => j6.tags), predicate)); + } + replaceRangeWithText(sourceFile, range2, text) { + this.changes.push({ kind: 3, sourceFile, range: range2, text }); + } + insertText(sourceFile, pos, text) { + this.replaceRangeWithText(sourceFile, createRange2(pos), text); + } + /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */ + tryInsertTypeAnnotation(sourceFile, node, type3) { + let endNode2; + if (isFunctionLike(node)) { + endNode2 = findChildOfKind(node, 22, sourceFile); + if (!endNode2) { + if (!isArrowFunction(node)) + return false; + endNode2 = first(node.parameters); + } + } else { + endNode2 = (node.kind === 260 ? node.exclamationToken : node.questionToken) ?? node.name; + } + this.insertNodeAt(sourceFile, endNode2.end, type3, { prefix: ": " }); + return true; + } + tryInsertThisTypeAnnotation(sourceFile, node, type3) { + const start = findChildOfKind(node, 21, sourceFile).getStart(sourceFile) + 1; + const suffix = node.parameters.length ? ", " : ""; + this.insertNodeAt(sourceFile, start, type3, { prefix: "this: ", suffix }); + } + insertTypeParameters(sourceFile, node, typeParameters) { + const start = (findChildOfKind(node, 21, sourceFile) || first(node.parameters)).getStart(sourceFile); + this.insertNodesAt(sourceFile, start, typeParameters, { prefix: "<", suffix: ">", joiner: ", " }); + } + getOptionsForInsertNodeBefore(before2, inserted, blankLineBetween) { + if (isStatement(before2) || isClassElement(before2)) { + return { suffix: blankLineBetween ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } else if (isVariableDeclaration(before2)) { + return { suffix: ", " }; + } else if (isParameter(before2)) { + return isParameter(inserted) ? { suffix: ", " } : {}; + } else if (isStringLiteral(before2) && isImportDeclaration(before2.parent) || isNamedImports(before2)) { + return { suffix: ", " }; + } else if (isImportSpecifier(before2)) { + return { suffix: "," + (blankLineBetween ? this.newLineCharacter : " ") }; + } + return Debug.failBadSyntaxKind(before2); + } + insertNodeAtConstructorStart(sourceFile, ctr, newStatement) { + const firstStatement = firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [newStatement, ...ctr.body.statements]); + } else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + } + insertNodeAtConstructorStartAfterSuperCall(sourceFile, ctr, newStatement) { + const superCallStatement = find2(ctr.body.statements, (stmt) => isExpressionStatement(stmt) && isSuperCall(stmt.expression)); + if (!superCallStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [...ctr.body.statements, newStatement]); + } else { + this.insertNodeAfter(sourceFile, superCallStatement, newStatement); + } + } + insertNodeAtConstructorEnd(sourceFile, ctr, newStatement) { + const lastStatement = lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [...ctr.body.statements, newStatement]); + } else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + } + replaceConstructorBody(sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, factory.createBlock( + statements, + /*multiLine*/ + true + )); + } + insertNodeAtEndOfScope(sourceFile, scope, newNode) { + const pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: isLineBreak2(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + } + insertMemberAtStart(sourceFile, node, newElement) { + this.insertNodeAtStartWorker(sourceFile, node, newElement); + } + insertNodeAtObjectStart(sourceFile, obj, newElement) { + this.insertNodeAtStartWorker(sourceFile, obj, newElement); + } + insertNodeAtStartWorker(sourceFile, node, newElement) { + const indentation = this.guessIndentationFromExistingMembers(sourceFile, node) ?? this.computeIndentationForNewMember(sourceFile, node); + this.insertNodeAt(sourceFile, getMembersOrProperties(node).pos, newElement, this.getInsertNodeAtStartInsertOptions(sourceFile, node, indentation)); + } + /** + * Tries to guess the indentation from the existing members of a class/interface/object. All members must be on + * new lines and must share the same indentation. + */ + guessIndentationFromExistingMembers(sourceFile, node) { + let indentation; + let lastRange = node; + for (const member of getMembersOrProperties(node)) { + if (rangeStartPositionsAreOnSameLine(lastRange, member, sourceFile)) { + return void 0; + } + const memberStart = member.getStart(sourceFile); + const memberIndentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(memberStart, sourceFile), memberStart, sourceFile, this.formatContext.options); + if (indentation === void 0) { + indentation = memberIndentation; + } else if (memberIndentation !== indentation) { + return void 0; + } + lastRange = member; + } + return indentation; + } + computeIndentationForNewMember(sourceFile, node) { + const nodeStart = node.getStart(sourceFile); + return ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(getLineStartPositionForPosition(nodeStart, sourceFile), nodeStart, sourceFile, this.formatContext.options) + (this.formatContext.options.indentSize ?? 4); + } + getInsertNodeAtStartInsertOptions(sourceFile, node, indentation) { + const members = getMembersOrProperties(node); + const isEmpty4 = members.length === 0; + const isFirstInsertion = addToSeen(this.classesWithNodesInsertedAtStart, getNodeId(node), { node, sourceFile }); + const insertTrailingComma = isObjectLiteralExpression(node) && (!isJsonSourceFile(sourceFile) || !isEmpty4); + const insertLeadingComma = isObjectLiteralExpression(node) && isJsonSourceFile(sourceFile) && isEmpty4 && !isFirstInsertion; + return { + indentation, + prefix: (insertLeadingComma ? "," : "") + this.newLineCharacter, + suffix: insertTrailingComma ? "," : isInterfaceDeclaration(node) && isEmpty4 ? ";" : "" + }; + } + insertNodeAfterComma(sourceFile, after2, newNode) { + const endPosition = this.insertNodeAfterWorker(sourceFile, this.nextCommaToken(sourceFile, after2) || after2, newNode); + this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after2)); + } + insertNodeAfter(sourceFile, after2, newNode) { + const endPosition = this.insertNodeAfterWorker(sourceFile, after2, newNode); + this.insertNodeAt(sourceFile, endPosition, newNode, this.getInsertNodeAfterOptions(sourceFile, after2)); + } + insertNodeAtEndOfList(sourceFile, list, newNode) { + this.insertNodeAt(sourceFile, list.end, newNode, { prefix: ", " }); + } + insertNodesAfter(sourceFile, after2, newNodes) { + const endPosition = this.insertNodeAfterWorker(sourceFile, after2, first(newNodes)); + this.insertNodesAt(sourceFile, endPosition, newNodes, this.getInsertNodeAfterOptions(sourceFile, after2)); + } + insertNodeAfterWorker(sourceFile, after2, newNode) { + if (needSemicolonBetween(after2, newNode)) { + if (sourceFile.text.charCodeAt(after2.end - 1) !== 59) { + this.replaceRange(sourceFile, createRange2(after2.end), factory.createToken( + 27 + /* SemicolonToken */ + )); + } + } + const endPosition = getAdjustedEndPosition(sourceFile, after2, {}); + return endPosition; + } + getInsertNodeAfterOptions(sourceFile, after2) { + const options = this.getInsertNodeAfterOptionsWorker(after2); + return { + ...options, + prefix: after2.end === sourceFile.end && isStatement(after2) ? options.prefix ? ` +${options.prefix}` : "\n" : options.prefix + }; + } + getInsertNodeAfterOptionsWorker(node) { + switch (node.kind) { + case 263: + case 267: + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + case 260: + case 11: + case 80: + return { prefix: ", " }; + case 303: + return { suffix: "," + this.newLineCharacter }; + case 95: + return { prefix: " " }; + case 169: + return {}; + default: + Debug.assert(isStatement(node) || isClassOrTypeElement(node)); + return { suffix: this.newLineCharacter }; + } + } + insertName(sourceFile, node, name2) { + Debug.assert(!node.name); + if (node.kind === 219) { + const arrow = findChildOfKind(node, 39, sourceFile); + const lparen = findChildOfKind(node, 21, sourceFile); + if (lparen) { + this.insertNodesAt(sourceFile, lparen.getStart(sourceFile), [factory.createToken( + 100 + /* FunctionKeyword */ + ), factory.createIdentifier(name2)], { joiner: " " }); + deleteNode(this, sourceFile, arrow); + } else { + this.insertText(sourceFile, first(node.parameters).getStart(sourceFile), `function ${name2}(`); + this.replaceRange(sourceFile, arrow, factory.createToken( + 22 + /* CloseParenToken */ + )); + } + if (node.body.kind !== 241) { + this.insertNodesAt(sourceFile, node.body.getStart(sourceFile), [factory.createToken( + 19 + /* OpenBraceToken */ + ), factory.createToken( + 107 + /* ReturnKeyword */ + )], { joiner: " ", suffix: " " }); + this.insertNodesAt(sourceFile, node.body.end, [factory.createToken( + 27 + /* SemicolonToken */ + ), factory.createToken( + 20 + /* CloseBraceToken */ + )], { joiner: " " }); + } + } else { + const pos = findChildOfKind(node, node.kind === 218 ? 100 : 86, sourceFile).end; + this.insertNodeAt(sourceFile, pos, factory.createIdentifier(name2), { prefix: " " }); + } + } + insertExportModifier(sourceFile, node) { + this.insertText(sourceFile, node.getStart(sourceFile), "export "); + } + insertImportSpecifierAtIndex(sourceFile, importSpecifier, namedImports, index4) { + const prevSpecifier = namedImports.elements[index4 - 1]; + if (prevSpecifier) { + this.insertNodeInListAfter(sourceFile, prevSpecifier, importSpecifier); + } else { + this.insertNodeBefore( + sourceFile, + namedImports.elements[0], + importSpecifier, + !positionsAreOnSameLine(namedImports.elements[0].getStart(), namedImports.parent.parent.getStart(), sourceFile) + ); + } + } + /** + * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, + * i.e. arguments in arguments lists, parameters in parameter lists etc. + * Note that separators are part of the node in statements and class elements. + */ + insertNodeInListAfter(sourceFile, after2, newNode, containingList = ts_formatting_exports.SmartIndenter.getContainingList(after2, sourceFile)) { + if (!containingList) { + Debug.fail("node is not a list element"); + return; + } + const index4 = indexOfNode(containingList, after2); + if (index4 < 0) { + return; + } + const end = after2.getEnd(); + if (index4 !== containingList.length - 1) { + const nextToken = getTokenAtPosition(sourceFile, after2.end); + if (nextToken && isSeparator(after2, nextToken)) { + const nextNode = containingList[index4 + 1]; + const startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart()); + const suffix = `${tokenToString(nextToken.kind)}${sourceFile.text.substring(nextToken.end, startPos)}`; + this.insertNodesAt(sourceFile, startPos, [newNode], { suffix }); + } + } else { + const afterStart = after2.getStart(sourceFile); + const afterStartLinePosition = getLineStartPositionForPosition(afterStart, sourceFile); + let separator; + let multilineList = false; + if (containingList.length === 1) { + separator = 28; + } else { + const tokenBeforeInsertPosition = findPrecedingToken(after2.pos, sourceFile); + separator = isSeparator(after2, tokenBeforeInsertPosition) ? tokenBeforeInsertPosition.kind : 28; + const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index4 - 1].getStart(sourceFile), sourceFile); + multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition; + } + if (hasCommentsBeforeLineBreak(sourceFile.text, after2.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) { + multilineList = true; + } + if (multilineList) { + this.replaceRange(sourceFile, createRange2(end), factory.createToken(separator)); + const indentation = ts_formatting_exports.SmartIndenter.findFirstNonWhitespaceColumn(afterStartLinePosition, afterStart, sourceFile, this.formatContext.options); + let insertPos = skipTrivia( + sourceFile.text, + end, + /*stopAfterLineBreak*/ + true, + /*stopAtComments*/ + false + ); + while (insertPos !== end && isLineBreak2(sourceFile.text.charCodeAt(insertPos - 1))) { + insertPos--; + } + this.replaceRange(sourceFile, createRange2(insertPos), newNode, { indentation, prefix: this.newLineCharacter }); + } else { + this.replaceRange(sourceFile, createRange2(end), newNode, { prefix: `${tokenToString(separator)} ` }); + } + } + } + parenthesizeExpression(sourceFile, expression) { + this.replaceRange(sourceFile, rangeOfNode(expression), factory.createParenthesizedExpression(expression)); + } + finishClassesWithNodesInsertedAtStart() { + this.classesWithNodesInsertedAtStart.forEach(({ node, sourceFile }) => { + const [openBraceEnd, closeBraceEnd] = getClassOrObjectBraceEnds(node, sourceFile); + if (openBraceEnd !== void 0 && closeBraceEnd !== void 0) { + const isEmpty4 = getMembersOrProperties(node).length === 0; + const isSingleLine = positionsAreOnSameLine(openBraceEnd, closeBraceEnd, sourceFile); + if (isEmpty4 && isSingleLine && openBraceEnd !== closeBraceEnd - 1) { + this.deleteRange(sourceFile, createRange2(openBraceEnd, closeBraceEnd - 1)); + } + if (isSingleLine) { + this.insertText(sourceFile, closeBraceEnd - 1, this.newLineCharacter); + } + } + }); + } + finishDeleteDeclarations() { + const deletedNodesInLists = /* @__PURE__ */ new Set(); + for (const { sourceFile, node } of this.deletedNodes) { + if (!this.deletedNodes.some((d7) => d7.sourceFile === sourceFile && rangeContainsRangeExclusive(d7.node, node))) { + if (isArray3(node)) { + this.deleteRange(sourceFile, rangeOfTypeParameters(sourceFile, node)); + } else { + deleteDeclaration.deleteDeclaration(this, deletedNodesInLists, sourceFile, node); + } + } + } + deletedNodesInLists.forEach((node) => { + const sourceFile = node.getSourceFile(); + const list = ts_formatting_exports.SmartIndenter.getContainingList(node, sourceFile); + if (node !== last2(list)) + return; + const lastNonDeletedIndex = findLastIndex2(list, (n7) => !deletedNodesInLists.has(n7), list.length - 2); + if (lastNonDeletedIndex !== -1) { + this.deleteRange(sourceFile, { pos: list[lastNonDeletedIndex].end, end: startPositionToDeleteNodeInList(sourceFile, list[lastNonDeletedIndex + 1]) }); + } + }); + } + /** + * Note: after calling this, the TextChanges object must be discarded! + * @param validate only for tests + * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, + * so we can only call this once and can't get the non-formatted text separately. + */ + getChanges(validate15) { + this.finishDeleteDeclarations(); + this.finishClassesWithNodesInsertedAtStart(); + const changes = changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate15); + if (this.newFileChanges) { + this.newFileChanges.forEach((insertions, fileName) => { + changes.push(changesToText.newFileChanges(fileName, insertions, this.newLineCharacter, this.formatContext)); + }); + } + return changes; + } + createNewFile(oldFile, fileName, statements) { + this.insertStatementsInNewFile(fileName, statements, oldFile); + } + }; + ((changesToText2) => { + function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate15) { + return mapDefined(group2(changes, (c7) => c7.sourceFile.path), (changesInFile) => { + const sourceFile = changesInFile[0].sourceFile; + const normalized = stableSort(changesInFile, (a7, b8) => a7.range.pos - b8.range.pos || a7.range.end - b8.range.end); + for (let i7 = 0; i7 < normalized.length - 1; i7++) { + Debug.assert(normalized[i7].range.end <= normalized[i7 + 1].range.pos, "Changes overlap", () => `${JSON.stringify(normalized[i7].range)} and ${JSON.stringify(normalized[i7 + 1].range)}`); + } + const textChanges2 = mapDefined(normalized, (c7) => { + const span = createTextSpanFromRange(c7.range); + const targetSourceFile = c7.kind === 1 ? getSourceFileOfNode(getOriginalNode(c7.node)) ?? c7.sourceFile : c7.kind === 2 ? getSourceFileOfNode(getOriginalNode(c7.nodes[0])) ?? c7.sourceFile : c7.sourceFile; + const newText = computeNewText(c7, targetSourceFile, sourceFile, newLineCharacter, formatContext, validate15); + if (span.length === newText.length && stringContainsAt(targetSourceFile.text, newText, span.start)) { + return void 0; + } + return createTextChange(span, newText); + }); + return textChanges2.length > 0 ? { fileName: sourceFile.fileName, textChanges: textChanges2 } : void 0; + }); + } + changesToText2.getTextChangesFromChanges = getTextChangesFromChanges; + function newFileChanges(fileName, insertions, newLineCharacter, formatContext) { + const text = newFileChangesWorker(getScriptKindFromFileName(fileName), insertions, newLineCharacter, formatContext); + return { fileName, textChanges: [createTextChange(createTextSpan(0, 0), text)], isNewFile: true }; + } + changesToText2.newFileChanges = newFileChanges; + function newFileChangesWorker(scriptKind, insertions, newLineCharacter, formatContext) { + const nonFormattedText = flatMap2(insertions, (insertion) => insertion.statements.map((s7) => s7 === 4 ? "" : getNonformattedText(s7, insertion.oldFile, newLineCharacter).text)).join(newLineCharacter); + const sourceFile = createSourceFile( + "any file name", + nonFormattedText, + { + languageVersion: 99, + jsDocParsingMode: 1 + /* ParseNone */ + }, + /*setParentNodes*/ + true, + scriptKind + ); + const changes = ts_formatting_exports.formatDocument(sourceFile, formatContext); + return applyChanges(nonFormattedText, changes) + newLineCharacter; + } + changesToText2.newFileChangesWorker = newFileChangesWorker; + function computeNewText(change, targetSourceFile, sourceFile, newLineCharacter, formatContext, validate15) { + var _a2; + if (change.kind === 0) { + return ""; + } + if (change.kind === 3) { + return change.text; + } + const { options = {}, range: { pos } } = change; + const format5 = (n7) => getFormattedTextOfNode(n7, targetSourceFile, sourceFile, pos, options, newLineCharacter, formatContext, validate15); + const text = change.kind === 2 ? change.nodes.map((n7) => removeSuffix(format5(n7), newLineCharacter)).join(((_a2 = change.options) == null ? void 0 : _a2.joiner) || newLineCharacter) : format5(change.node); + const noIndent = options.indentation !== void 0 || getLineStartPositionForPosition(pos, targetSourceFile) === pos ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + noIndent + (!options.suffix || endsWith2(noIndent, options.suffix) ? "" : options.suffix); + } + function getFormattedTextOfNode(nodeIn, targetSourceFile, sourceFile, pos, { indentation, prefix, delta }, newLineCharacter, formatContext, validate15) { + const { node, text } = getNonformattedText(nodeIn, targetSourceFile, newLineCharacter); + if (validate15) + validate15(node, text); + const formatOptions = getFormatCodeSettingsForWriting(formatContext, targetSourceFile); + const initialIndentation = indentation !== void 0 ? indentation : ts_formatting_exports.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, prefix === newLineCharacter || getLineStartPositionForPosition(pos, targetSourceFile) === pos); + if (delta === void 0) { + delta = ts_formatting_exports.SmartIndenter.shouldIndentChildNode(formatOptions, nodeIn) ? formatOptions.indentSize || 0 : 0; + } + const file = { + text, + getLineAndCharacterOfPosition(pos2) { + return getLineAndCharacterOfPosition(this, pos2); + } + }; + const changes = ts_formatting_exports.formatNodeGivenIndentation(node, file, targetSourceFile.languageVariant, initialIndentation, delta, { ...formatContext, options: formatOptions }); + return applyChanges(text, changes); + } + function getNonformattedText(node, sourceFile, newLineCharacter) { + const writer = createWriter(newLineCharacter); + const newLine = getNewLineKind(newLineCharacter); + createPrinter({ + newLine, + neverAsciiEscape: true, + preserveSourceNewlines: true, + terminateUnterminatedLiterals: true + }, writer).writeNode(4, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + changesToText2.getNonformattedText = getNonformattedText; + })(changesToText || (changesToText = {})); + textChangesTransformationContext = { + ...nullTransformationContext, + factory: createNodeFactory( + nullTransformationContext.factory.flags | 1, + nullTransformationContext.factory.baseFactory + ) + }; + ((_deleteDeclaration) => { + function deleteDeclaration2(changes, deletedNodesInLists, sourceFile, node) { + switch (node.kind) { + case 169: { + const oldFunction = node.parent; + if (isArrowFunction(oldFunction) && oldFunction.parameters.length === 1 && !findChildOfKind(oldFunction, 21, sourceFile)) { + changes.replaceNodeWithText(sourceFile, node, "()"); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + } + case 272: + case 271: + const isFirstImport = sourceFile.imports.length && node === first(sourceFile.imports).parent || node === find2(sourceFile.statements, isAnyImportSyntax); + deleteNode(changes, sourceFile, node, { + leadingTriviaOption: isFirstImport ? 0 : hasJSDocNodes(node) ? 2 : 3 + /* StartLine */ + }); + break; + case 208: + const pattern5 = node.parent; + const preserveComma = pattern5.kind === 207 && node !== last2(pattern5.elements); + if (preserveComma) { + deleteNode(changes, sourceFile, node); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + case 260: + deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node); + break; + case 168: + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + break; + case 276: + const namedImports = node.parent; + if (namedImports.elements.length === 1) { + deleteImportBinding(changes, sourceFile, namedImports); + } else { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } + break; + case 274: + deleteImportBinding(changes, sourceFile, node); + break; + case 27: + deleteNode(changes, sourceFile, node, { + trailingTriviaOption: 0 + /* Exclude */ + }); + break; + case 100: + deleteNode(changes, sourceFile, node, { + leadingTriviaOption: 0 + /* Exclude */ + }); + break; + case 263: + case 262: + deleteNode(changes, sourceFile, node, { + leadingTriviaOption: hasJSDocNodes(node) ? 2 : 3 + /* StartLine */ + }); + break; + default: + if (!node.parent) { + deleteNode(changes, sourceFile, node); + } else if (isImportClause(node.parent) && node.parent.name === node) { + deleteDefaultImport(changes, sourceFile, node.parent); + } else if (isCallExpression(node.parent) && contains2(node.parent.arguments, node)) { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + } else { + deleteNode(changes, sourceFile, node); + } + } + } + _deleteDeclaration.deleteDeclaration = deleteDeclaration2; + function deleteDefaultImport(changes, sourceFile, importClause) { + if (!importClause.namedBindings) { + deleteNode(changes, sourceFile, importClause.parent); + } else { + const start = importClause.name.getStart(sourceFile); + const nextToken = getTokenAtPosition(sourceFile, importClause.name.end); + if (nextToken && nextToken.kind === 28) { + const end = skipTrivia( + sourceFile.text, + nextToken.end, + /*stopAfterLineBreak*/ + false, + /*stopAtComments*/ + true + ); + changes.deleteRange(sourceFile, { pos: start, end }); + } else { + deleteNode(changes, sourceFile, importClause.name); + } + } + } + function deleteImportBinding(changes, sourceFile, node) { + if (node.parent.name) { + const previousToken = Debug.checkDefined(getTokenAtPosition(sourceFile, node.pos - 1)); + changes.deleteRange(sourceFile, { pos: previousToken.getStart(sourceFile), end: node.end }); + } else { + const importDecl = getAncestor( + node, + 272 + /* ImportDeclaration */ + ); + deleteNode(changes, sourceFile, importDecl); + } + } + function deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node) { + const { parent: parent22 } = node; + if (parent22.kind === 299) { + changes.deleteNodeRange(sourceFile, findChildOfKind(parent22, 21, sourceFile), findChildOfKind(parent22, 22, sourceFile)); + return; + } + if (parent22.declarations.length !== 1) { + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); + return; + } + const gp = parent22.parent; + switch (gp.kind) { + case 250: + case 249: + changes.replaceNode(sourceFile, node, factory.createObjectLiteralExpression()); + break; + case 248: + deleteNode(changes, sourceFile, parent22); + break; + case 243: + deleteNode(changes, sourceFile, gp, { + leadingTriviaOption: hasJSDocNodes(gp) ? 2 : 3 + /* StartLine */ + }); + break; + default: + Debug.assertNever(gp); + } + } + })(deleteDeclaration || (deleteDeclaration = {})); + } + }); + var ts_textChanges_exports = {}; + __export2(ts_textChanges_exports, { + ChangeTracker: () => ChangeTracker, + LeadingTriviaOption: () => LeadingTriviaOption, + TrailingTriviaOption: () => TrailingTriviaOption, + applyChanges: () => applyChanges, + assignPositionsToNode: () => assignPositionsToNode, + createWriter: () => createWriter, + deleteNode: () => deleteNode, + isThisTypeAnnotatable: () => isThisTypeAnnotatable, + isValidLocationToAddComment: () => isValidLocationToAddComment + }); + var init_ts_textChanges = __esm2({ + "src/services/_namespaces/ts.textChanges.ts"() { + "use strict"; + init_textChanges(); + } + }); + var FormattingRequestKind, FormattingContext; + var init_formattingContext = __esm2({ + "src/services/formatting/formattingContext.ts"() { + "use strict"; + init_ts4(); + FormattingRequestKind = /* @__PURE__ */ ((FormattingRequestKind2) => { + FormattingRequestKind2[FormattingRequestKind2["FormatDocument"] = 0] = "FormatDocument"; + FormattingRequestKind2[FormattingRequestKind2["FormatSelection"] = 1] = "FormatSelection"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnEnter"] = 2] = "FormatOnEnter"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnOpeningCurlyBrace"] = 4] = "FormatOnOpeningCurlyBrace"; + FormattingRequestKind2[FormattingRequestKind2["FormatOnClosingCurlyBrace"] = 5] = "FormatOnClosingCurlyBrace"; + return FormattingRequestKind2; + })(FormattingRequestKind || {}); + FormattingContext = class { + constructor(sourceFile, formattingRequestKind, options) { + this.sourceFile = sourceFile; + this.formattingRequestKind = formattingRequestKind; + this.options = options; + } + updateContext(currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { + this.currentTokenSpan = Debug.checkDefined(currentRange); + this.currentTokenParent = Debug.checkDefined(currentTokenParent); + this.nextTokenSpan = Debug.checkDefined(nextRange); + this.nextTokenParent = Debug.checkDefined(nextTokenParent); + this.contextNode = Debug.checkDefined(commonParent); + this.contextNodeAllOnSameLine = void 0; + this.nextNodeAllOnSameLine = void 0; + this.tokensAreOnSameLine = void 0; + this.contextNodeBlockIsOnOneLine = void 0; + this.nextNodeBlockIsOnOneLine = void 0; + } + ContextNodeAllOnSameLine() { + if (this.contextNodeAllOnSameLine === void 0) { + this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); + } + return this.contextNodeAllOnSameLine; + } + NextNodeAllOnSameLine() { + if (this.nextNodeAllOnSameLine === void 0) { + this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeAllOnSameLine; + } + TokensAreOnSameLine() { + if (this.tokensAreOnSameLine === void 0) { + const startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; + const endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; + this.tokensAreOnSameLine = startLine === endLine; + } + return this.tokensAreOnSameLine; + } + ContextNodeBlockIsOnOneLine() { + if (this.contextNodeBlockIsOnOneLine === void 0) { + this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); + } + return this.contextNodeBlockIsOnOneLine; + } + NextNodeBlockIsOnOneLine() { + if (this.nextNodeBlockIsOnOneLine === void 0) { + this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); + } + return this.nextNodeBlockIsOnOneLine; + } + NodeIsOnOneLine(node) { + const startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; + const endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; + return startLine === endLine; + } + BlockIsOnOneLine(node) { + const openBrace = findChildOfKind(node, 19, this.sourceFile); + const closeBrace = findChildOfKind(node, 20, this.sourceFile); + if (openBrace && closeBrace) { + const startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; + const endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; + return startLine === endLine; + } + return false; + } + }; + } + }); + function getFormattingScanner(text, languageVariant, startPos, endPos, cb) { + const scanner2 = languageVariant === 1 ? jsxScanner : standardScanner; + scanner2.setText(text); + scanner2.resetTokenState(startPos); + let wasNewLine = true; + let leadingTrivia; + let trailingTrivia; + let savedPos; + let lastScanAction; + let lastTokenInfo; + const res = cb({ + advance, + readTokenInfo, + readEOFTokenRange, + isOnToken, + isOnEOF, + getCurrentLeadingTrivia: () => leadingTrivia, + lastTrailingTriviaWasNewLine: () => wasNewLine, + skipToEndOf, + skipToStartOf, + getTokenFullStart: () => (lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) ?? scanner2.getTokenStart(), + getStartPos: () => (lastTokenInfo == null ? void 0 : lastTokenInfo.token.pos) ?? scanner2.getTokenStart() + }); + lastTokenInfo = void 0; + scanner2.setText(void 0); + return res; + function advance() { + lastTokenInfo = void 0; + const isStarted = scanner2.getTokenFullStart() !== startPos; + if (isStarted) { + wasNewLine = !!trailingTrivia && last2(trailingTrivia).kind === 4; + } else { + scanner2.scan(); + } + leadingTrivia = void 0; + trailingTrivia = void 0; + let pos = scanner2.getTokenFullStart(); + while (pos < endPos) { + const t8 = scanner2.getToken(); + if (!isTrivia(t8)) { + break; + } + scanner2.scan(); + const item = { + pos, + end: scanner2.getTokenFullStart(), + kind: t8 + }; + pos = scanner2.getTokenFullStart(); + leadingTrivia = append(leadingTrivia, item); + } + savedPos = scanner2.getTokenFullStart(); + } + function shouldRescanGreaterThanToken(node) { + switch (node.kind) { + case 34: + case 72: + case 73: + case 50: + case 49: + return true; + } + return false; + } + function shouldRescanJsxIdentifier(node) { + if (node.parent) { + switch (node.parent.kind) { + case 291: + case 286: + case 287: + case 285: + return isKeyword(node.kind) || node.kind === 80; + } + } + return false; + } + function shouldRescanJsxText(node) { + return isJsxText(node) || isJsxElement(node) && (lastTokenInfo == null ? void 0 : lastTokenInfo.token.kind) === 12; + } + function shouldRescanSlashToken(container) { + return container.kind === 14; + } + function shouldRescanTemplateToken(container) { + return container.kind === 17 || container.kind === 18; + } + function shouldRescanJsxAttributeValue(node) { + return node.parent && isJsxAttribute(node.parent) && node.parent.initializer === node; + } + function startsWithSlashToken(t8) { + return t8 === 44 || t8 === 69; + } + function readTokenInfo(n7) { + Debug.assert(isOnToken()); + const expectedScanAction = shouldRescanGreaterThanToken(n7) ? 1 : shouldRescanSlashToken(n7) ? 2 : shouldRescanTemplateToken(n7) ? 3 : shouldRescanJsxIdentifier(n7) ? 4 : shouldRescanJsxText(n7) ? 5 : shouldRescanJsxAttributeValue(n7) ? 6 : 0; + if (lastTokenInfo && expectedScanAction === lastScanAction) { + return fixTokenKind(lastTokenInfo, n7); + } + if (scanner2.getTokenFullStart() !== savedPos) { + Debug.assert(lastTokenInfo !== void 0); + scanner2.resetTokenState(savedPos); + scanner2.scan(); + } + let currentToken = getNextToken(n7, expectedScanAction); + const token = createTextRangeWithKind( + scanner2.getTokenFullStart(), + scanner2.getTokenEnd(), + currentToken + ); + if (trailingTrivia) { + trailingTrivia = void 0; + } + while (scanner2.getTokenFullStart() < endPos) { + currentToken = scanner2.scan(); + if (!isTrivia(currentToken)) { + break; + } + const trivia = createTextRangeWithKind( + scanner2.getTokenFullStart(), + scanner2.getTokenEnd(), + currentToken + ); + if (!trailingTrivia) { + trailingTrivia = []; + } + trailingTrivia.push(trivia); + if (currentToken === 4) { + scanner2.scan(); + break; + } + } + lastTokenInfo = { leadingTrivia, trailingTrivia, token }; + return fixTokenKind(lastTokenInfo, n7); + } + function getNextToken(n7, expectedScanAction) { + const token = scanner2.getToken(); + lastScanAction = 0; + switch (expectedScanAction) { + case 1: + if (token === 32) { + lastScanAction = 1; + const newToken = scanner2.reScanGreaterToken(); + Debug.assert(n7.kind === newToken); + return newToken; + } + break; + case 2: + if (startsWithSlashToken(token)) { + lastScanAction = 2; + const newToken = scanner2.reScanSlashToken(); + Debug.assert(n7.kind === newToken); + return newToken; + } + break; + case 3: + if (token === 20) { + lastScanAction = 3; + return scanner2.reScanTemplateToken( + /*isTaggedTemplate*/ + false + ); + } + break; + case 4: + lastScanAction = 4; + return scanner2.scanJsxIdentifier(); + case 5: + lastScanAction = 5; + return scanner2.reScanJsxToken( + /*allowMultilineJsxText*/ + false + ); + case 6: + lastScanAction = 6; + return scanner2.reScanJsxAttributeValue(); + case 0: + break; + default: + Debug.assertNever(expectedScanAction); + } + return token; + } + function readEOFTokenRange() { + Debug.assert(isOnEOF()); + return createTextRangeWithKind( + scanner2.getTokenFullStart(), + scanner2.getTokenEnd(), + 1 + /* EndOfFileToken */ + ); + } + function isOnToken() { + const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken(); + return current !== 1 && !isTrivia(current); + } + function isOnEOF() { + const current = lastTokenInfo ? lastTokenInfo.token.kind : scanner2.getToken(); + return current === 1; + } + function fixTokenKind(tokenInfo, container) { + if (isToken(container) && tokenInfo.token.kind !== container.kind) { + tokenInfo.token.kind = container.kind; + } + return tokenInfo; + } + function skipToEndOf(node) { + scanner2.resetTokenState(node.end); + savedPos = scanner2.getTokenFullStart(); + lastScanAction = void 0; + lastTokenInfo = void 0; + wasNewLine = false; + leadingTrivia = void 0; + trailingTrivia = void 0; + } + function skipToStartOf(node) { + scanner2.resetTokenState(node.pos); + savedPos = scanner2.getTokenFullStart(); + lastScanAction = void 0; + lastTokenInfo = void 0; + wasNewLine = false; + leadingTrivia = void 0; + trailingTrivia = void 0; + } + } + var standardScanner, jsxScanner; + var init_formattingScanner = __esm2({ + "src/services/formatting/formattingScanner.ts"() { + "use strict"; + init_ts4(); + init_ts_formatting(); + standardScanner = createScanner3( + 99, + /*skipTrivia*/ + false, + 0 + /* Standard */ + ); + jsxScanner = createScanner3( + 99, + /*skipTrivia*/ + false, + 1 + /* JSX */ + ); + } + }); + var anyContext, RuleAction, RuleFlags; + var init_rule = __esm2({ + "src/services/formatting/rule.ts"() { + "use strict"; + init_ts4(); + anyContext = emptyArray; + RuleAction = /* @__PURE__ */ ((RuleAction2) => { + RuleAction2[RuleAction2["None"] = 0] = "None"; + RuleAction2[RuleAction2["StopProcessingSpaceActions"] = 1] = "StopProcessingSpaceActions"; + RuleAction2[RuleAction2["StopProcessingTokenActions"] = 2] = "StopProcessingTokenActions"; + RuleAction2[RuleAction2["InsertSpace"] = 4] = "InsertSpace"; + RuleAction2[RuleAction2["InsertNewLine"] = 8] = "InsertNewLine"; + RuleAction2[RuleAction2["DeleteSpace"] = 16] = "DeleteSpace"; + RuleAction2[RuleAction2["DeleteToken"] = 32] = "DeleteToken"; + RuleAction2[RuleAction2["InsertTrailingSemicolon"] = 64] = "InsertTrailingSemicolon"; + RuleAction2[RuleAction2["StopAction"] = 3] = "StopAction"; + RuleAction2[RuleAction2["ModifySpaceAction"] = 28] = "ModifySpaceAction"; + RuleAction2[RuleAction2["ModifyTokenAction"] = 96] = "ModifyTokenAction"; + return RuleAction2; + })(RuleAction || {}); + RuleFlags = /* @__PURE__ */ ((RuleFlags2) => { + RuleFlags2[RuleFlags2["None"] = 0] = "None"; + RuleFlags2[RuleFlags2["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; + return RuleFlags2; + })(RuleFlags || {}); + } + }); + function getAllRules() { + const allTokens = []; + for (let token = 0; token <= 165; token++) { + if (token !== 1) { + allTokens.push(token); + } + } + function anyTokenExcept(...tokens) { + return { tokens: allTokens.filter((t8) => !tokens.some((t22) => t22 === t8)), isSpecific: false }; + } + const anyToken = { tokens: allTokens, isSpecific: false }; + const anyTokenIncludingMultilineComments = tokenRangeFrom([ + ...allTokens, + 3 + /* MultiLineCommentTrivia */ + ]); + const anyTokenIncludingEOF = tokenRangeFrom([ + ...allTokens, + 1 + /* EndOfFileToken */ + ]); + const keywords = tokenRangeFromRange( + 83, + 165 + /* LastKeyword */ + ); + const binaryOperators = tokenRangeFromRange( + 30, + 79 + /* LastBinaryOperator */ + ); + const binaryKeywordOperators = [ + 103, + 104, + 165, + 130, + 142, + 152 + /* SatisfiesKeyword */ + ]; + const unaryPrefixOperators = [ + 46, + 47, + 55, + 54 + /* ExclamationToken */ + ]; + const unaryPrefixExpressions = [ + 9, + 10, + 80, + 21, + 23, + 19, + 110, + 105 + /* NewKeyword */ + ]; + const unaryPreincrementExpressions = [ + 80, + 21, + 110, + 105 + /* NewKeyword */ + ]; + const unaryPostincrementExpressions = [ + 80, + 22, + 24, + 105 + /* NewKeyword */ + ]; + const unaryPredecrementExpressions = [ + 80, + 21, + 110, + 105 + /* NewKeyword */ + ]; + const unaryPostdecrementExpressions = [ + 80, + 22, + 24, + 105 + /* NewKeyword */ + ]; + const comments = [ + 2, + 3 + /* MultiLineCommentTrivia */ + ]; + const typeNames = [80, ...typeKeywords]; + const functionOpenBraceLeftTokenRange = anyTokenIncludingMultilineComments; + const typeScriptOpenBraceLeftTokenRange = tokenRangeFrom([ + 80, + 32, + 3, + 86, + 95, + 102 + /* ImportKeyword */ + ]); + const controlOpenBraceLeftTokenRange = tokenRangeFrom([ + 22, + 3, + 92, + 113, + 98, + 93, + 85 + /* CatchKeyword */ + ]); + const highPriorityCommonRules = [ + // Leave comments alone + rule( + "IgnoreBeforeComment", + anyToken, + comments, + anyContext, + 1 + /* StopProcessingSpaceActions */ + ), + rule( + "IgnoreAfterLineComment", + 2, + anyToken, + anyContext, + 1 + /* StopProcessingSpaceActions */ + ), + rule( + "NotSpaceBeforeColon", + anyToken, + 59, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceAfterColon", + 59, + anyToken, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNextTokenParentNotJsxNamespacedName], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeQuestionMark", + anyToken, + 58, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], + 16 + /* DeleteSpace */ + ), + // insert space after '?' only when it is used in conditional operator + rule( + "SpaceAfterQuestionMarkInConditionalOperator", + 58, + anyToken, + [isNonJsxSameLineTokenContext, isConditionalOperatorContext], + 4 + /* InsertSpace */ + ), + // in other cases there should be no space between '?' and next token + rule( + "NoSpaceAfterQuestionMark", + 58, + anyToken, + [isNonJsxSameLineTokenContext, isNonOptionalPropertyContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeDot", + anyToken, + [ + 25, + 29 + /* QuestionDotToken */ + ], + [isNonJsxSameLineTokenContext, isNotPropertyAccessOnIntegerLiteral], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterDot", + [ + 25, + 29 + /* QuestionDotToken */ + ], + anyToken, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBetweenImportParenInImportType", + 102, + 21, + [isNonJsxSameLineTokenContext, isImportTypeContext], + 16 + /* DeleteSpace */ + ), + // Special handling of unary operators. + // Prefix operators generally shouldn't have a space between + // them and their target unary expression. + rule( + "NoSpaceAfterUnaryPrefixOperator", + unaryPrefixOperators, + unaryPrefixExpressions, + [isNonJsxSameLineTokenContext, isNotBinaryOpContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterUnaryPreincrementOperator", + 46, + unaryPreincrementExpressions, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterUnaryPredecrementOperator", + 47, + unaryPredecrementExpressions, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeUnaryPostincrementOperator", + unaryPostincrementExpressions, + 46, + [isNonJsxSameLineTokenContext, isNotStatementConditionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeUnaryPostdecrementOperator", + unaryPostdecrementExpressions, + 47, + [isNonJsxSameLineTokenContext, isNotStatementConditionContext], + 16 + /* DeleteSpace */ + ), + // More unary operator special-casing. + // DevDiv 181814: Be careful when removing leading whitespace + // around unary operators. Examples: + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b + rule( + "SpaceAfterPostincrementWhenFollowedByAdd", + 46, + 40, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterAddWhenFollowedByUnaryPlus", + 40, + 40, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterAddWhenFollowedByPreincrement", + 40, + 46, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterPostdecrementWhenFollowedBySubtract", + 47, + 41, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterSubtractWhenFollowedByUnaryMinus", + 41, + 41, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterSubtractWhenFollowedByPredecrement", + 41, + 47, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterCloseBrace", + 20, + [ + 28, + 27 + /* SemicolonToken */ + ], + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // For functions and control block place } on a new line [multi-line rule] + rule( + "NewLineBeforeCloseBraceInBlockContext", + anyTokenIncludingMultilineComments, + 20, + [isMultilineBlockContext], + 8 + /* InsertNewLine */ + ), + // Space/new line after }. + rule( + "SpaceAfterCloseBrace", + 20, + anyTokenExcept( + 22 + /* CloseParenToken */ + ), + [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], + 4 + /* InsertSpace */ + ), + // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied + // Also should not apply to }) + rule( + "SpaceBetweenCloseBraceAndElse", + 20, + 93, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBetweenCloseBraceAndWhile", + 20, + 117, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 19, + 20, + [isNonJsxSameLineTokenContext, isObjectContext], + 16 + /* DeleteSpace */ + ), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule( + "SpaceAfterConditionalClosingParen", + 22, + 23, + [isControlDeclContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenFunctionKeywordAndStar", + 100, + 42, + [isFunctionDeclarationOrFunctionExpressionContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceAfterStarInGeneratorDeclaration", + 42, + 80, + [isFunctionDeclarationOrFunctionExpressionContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterFunctionInFuncDecl", + 100, + anyToken, + [isFunctionDeclContext], + 4 + /* InsertSpace */ + ), + // Insert new line after { and before } in multi-line contexts. + rule( + "NewLineAfterOpenBraceInBlockContext", + 19, + anyToken, + [isMultilineBlockContext], + 8 + /* InsertNewLine */ + ), + // For get/set members, we check for (identifier,identifier) since get/set don't have tokens and they are represented as just an identifier token. + // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: + // get x() {} + // set x(val) {} + rule( + "SpaceAfterGetSetInMember", + [ + 139, + 153 + /* SetKeyword */ + ], + 80, + [isFunctionDeclContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenYieldKeywordAndStar", + 127, + 42, + [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceBetweenYieldOrYieldStarAndOperand", + [ + 127, + 42 + /* AsteriskToken */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenReturnAndSemicolon", + 107, + 27, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceAfterCertainKeywords", + [ + 115, + 111, + 105, + 91, + 107, + 114, + 135 + /* AwaitKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterLetConstInVariableDeclaration", + [ + 121, + 87 + /* ConstKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isStartOfVariableDeclarationList], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeOpenParenInFuncCall", + anyToken, + 21, + [isNonJsxSameLineTokenContext, isFunctionCallOrNewContext, isPreviousTokenNotComma], + 16 + /* DeleteSpace */ + ), + // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. + rule( + "SpaceBeforeBinaryKeywordOperator", + anyToken, + binaryKeywordOperators, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterBinaryKeywordOperator", + binaryKeywordOperators, + anyToken, + [isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterVoidOperator", + 116, + anyToken, + [isNonJsxSameLineTokenContext, isVoidOpContext], + 4 + /* InsertSpace */ + ), + // Async-await + rule( + "SpaceBetweenAsyncAndOpenParen", + 134, + 21, + [isArrowFunctionContext, isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBetweenAsyncAndFunctionKeyword", + 134, + [ + 100, + 80 + /* Identifier */ + ], + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + // Template string + rule( + "NoSpaceBetweenTagAndTemplateString", + [ + 80, + 22 + /* CloseParenToken */ + ], + [ + 15, + 16 + /* TemplateHead */ + ], + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // JSX opening elements + rule( + "SpaceBeforeJsxAttribute", + anyToken, + 80, + [isNextTokenParentJsxAttribute, isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeSlashInJsxOpeningElement", + anyToken, + 44, + [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeGreaterThanTokenInJsxOpeningElement", + 44, + 32, + [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeEqualInJsxAttribute", + anyToken, + 64, + [isJsxAttributeContext, isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterEqualInJsxAttribute", + 64, + anyToken, + [isJsxAttributeContext, isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeJsxNamespaceColon", + 80, + 59, + [isNextTokenParentJsxNamespacedName], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterJsxNamespaceColon", + 59, + 80, + [isNextTokenParentJsxNamespacedName], + 16 + /* DeleteSpace */ + ), + // TypeScript-specific rules + // Use of module as a function call. e.g.: import m2 = module("m2"); + rule( + "NoSpaceAfterModuleImport", + [ + 144, + 149 + /* RequireKeyword */ + ], + 21, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Add a space around certain TypeScript keywords + rule( + "SpaceAfterCertainTypeScriptKeywords", + [ + 128, + 129, + 86, + 138, + 90, + 94, + 95, + 96, + 139, + 119, + 102, + 120, + 144, + 145, + 123, + 125, + 124, + 148, + 153, + 126, + 156, + 161, + 143, + 140 + /* InferKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeCertainTypeScriptKeywords", + anyToken, + [ + 96, + 119, + 161 + /* FromKeyword */ + ], + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { + rule( + "SpaceAfterModuleName", + 11, + 19, + [isModuleDeclContext], + 4 + /* InsertSpace */ + ), + // Lambda expressions + rule( + "SpaceBeforeArrow", + anyToken, + 39, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterArrow", + 39, + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + // Optional parameters and let args + rule( + "NoSpaceAfterEllipsis", + 26, + 80, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterOptionalParameters", + 58, + [ + 22, + 28 + /* CommaToken */ + ], + [isNonJsxSameLineTokenContext, isNotBinaryOpContext], + 16 + /* DeleteSpace */ + ), + // Remove spaces in empty interface literals. e.g.: x: {} + rule( + "NoSpaceBetweenEmptyInterfaceBraceBrackets", + 19, + 20, + [isNonJsxSameLineTokenContext, isObjectTypeContext], + 16 + /* DeleteSpace */ + ), + // generics and type assertions + rule( + "NoSpaceBeforeOpenAngularBracket", + typeNames, + 30, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBetweenCloseParenAndAngularBracket", + 22, + 30, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenAngularBracket", + 30, + anyToken, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseAngularBracket", + anyToken, + 32, + [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterCloseAngularBracket", + 32, + [ + 21, + 23, + 32, + 28 + /* CommaToken */ + ], + [ + isNonJsxSameLineTokenContext, + isTypeArgumentOrParameterOrAssertionContext, + isNotFunctionDeclContext, + /*To prevent an interference with the SpaceBeforeOpenParenInFuncDecl rule*/ + isNonTypeAssertionContext + ], + 16 + /* DeleteSpace */ + ), + // decorators + rule( + "SpaceBeforeAt", + [ + 22, + 80 + /* Identifier */ + ], + 60, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterAt", + 60, + anyToken, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Insert space after @ in decorator + rule( + "SpaceAfterDecorator", + anyToken, + [ + 128, + 80, + 95, + 90, + 86, + 126, + 125, + 123, + 124, + 139, + 153, + 23, + 42 + /* AsteriskToken */ + ], + [isEndOfDecoratorContextOnSameLine], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeNonNullAssertionOperator", + anyToken, + 54, + [isNonJsxSameLineTokenContext, isNonNullAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterNewKeywordOnConstructorSignature", + 105, + 21, + [isNonJsxSameLineTokenContext, isConstructorSignatureContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceLessThanAndNonJSXTypeAnnotation", + 30, + 30, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ) + ]; + const userConfigurableRules = [ + // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses + rule( + "SpaceAfterConstructor", + 137, + 21, + [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterConstructor", + 137, + 21, + [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceAfterComma", + 28, + anyToken, + [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket, isNextTokenNotCloseParen], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterComma", + 28, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], + 16 + /* DeleteSpace */ + ), + // Insert space after function keyword for anonymous functions + rule( + "SpaceAfterAnonymousFunctionKeyword", + [ + 100, + 42 + /* AsteriskToken */ + ], + 21, + [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterAnonymousFunctionKeyword", + [ + 100, + 42 + /* AsteriskToken */ + ], + 21, + [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], + 16 + /* DeleteSpace */ + ), + // Insert space after keywords in control flow statements + rule( + "SpaceAfterKeywordInControl", + keywords, + 21, + [isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterKeywordInControl", + keywords, + 21, + [isOptionDisabledOrUndefined("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], + 16 + /* DeleteSpace */ + ), + // Insert space after opening and before closing nonempty parenthesis + rule( + "SpaceAfterOpenParen", + 21, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeCloseParen", + anyToken, + 22, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBetweenOpenParens", + 21, + 21, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenParens", + 21, + 22, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenParen", + 21, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseParen", + anyToken, + 22, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Insert space after opening and before closing nonempty brackets + rule( + "SpaceAfterOpenBracket", + 23, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeCloseBracket", + anyToken, + 24, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenBrackets", + 23, + 24, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenBracket", + 23, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBracket", + anyToken, + 24, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. + rule( + "SpaceAfterOpenBrace", + 19, + anyToken, + [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeCloseBrace", + anyToken, + 20, + [isOptionEnabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isBraceWrappedContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 19, + 20, + [isNonJsxSameLineTokenContext, isObjectContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterOpenBrace", + 19, + anyToken, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBrace", + anyToken, + 20, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Insert a space after opening and before closing empty brace brackets + rule( + "SpaceBetweenEmptyBraceBrackets", + 19, + 20, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBetweenEmptyBraceBrackets", + 19, + 20, + [isOptionDisabled("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // Insert space after opening and before closing template string braces + rule( + "SpaceAfterTemplateHeadAndMiddle", + [ + 16, + 17 + /* TemplateMiddle */ + ], + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], + 4, + 1 + /* CanDeleteNewLines */ + ), + rule( + "SpaceBeforeTemplateMiddleAndTail", + anyToken, + [ + 17, + 18 + /* TemplateTail */ + ], + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterTemplateHeadAndMiddle", + [ + 16, + 17 + /* TemplateMiddle */ + ], + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxTextContext], + 16, + 1 + /* CanDeleteNewLines */ + ), + rule( + "NoSpaceBeforeTemplateMiddleAndTail", + anyToken, + [ + 17, + 18 + /* TemplateTail */ + ], + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"), isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // No space after { and before } in JSX expression + rule( + "SpaceAfterOpenBraceInJsxExpression", + 19, + anyToken, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceBeforeCloseBraceInJsxExpression", + anyToken, + 20, + [isOptionEnabled("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterOpenBraceInJsxExpression", + 19, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceBeforeCloseBraceInJsxExpression", + anyToken, + 20, + [isOptionDisabledOrUndefined("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"), isNonJsxSameLineTokenContext, isJsxExpressionContext], + 16 + /* DeleteSpace */ + ), + // Insert space after semicolon in for statement + rule( + "SpaceAfterSemicolonInFor", + 27, + anyToken, + [isOptionEnabled("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterSemicolonInFor", + 27, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterSemicolonInForStatements"), isNonJsxSameLineTokenContext, isForContext], + 16 + /* DeleteSpace */ + ), + // Insert space before and after binary operators + rule( + "SpaceBeforeBinaryOperator", + anyToken, + binaryOperators, + [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "SpaceAfterBinaryOperator", + binaryOperators, + anyToken, + [isOptionEnabled("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeBinaryOperator", + anyToken, + binaryOperators, + [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterBinaryOperator", + binaryOperators, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceBeforeAndAfterBinaryOperators"), isNonJsxSameLineTokenContext, isBinaryOpContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceBeforeOpenParenInFuncDecl", + anyToken, + 21, + [isOptionEnabled("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeOpenParenInFuncDecl", + anyToken, + 21, + [isOptionDisabledOrUndefined("insertSpaceBeforeFunctionParenthesis"), isNonJsxSameLineTokenContext, isFunctionDeclContext], + 16 + /* DeleteSpace */ + ), + // Open Brace braces after control block + rule( + "NewLineBeforeOpenBraceInControl", + controlOpenBraceLeftTokenRange, + 19, + [isOptionEnabled("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isBeforeMultilineBlockContext], + 8, + 1 + /* CanDeleteNewLines */ + ), + // Open Brace braces after function + // TypeScript: Function can have return types, which can be made of tons of different token kinds + rule( + "NewLineBeforeOpenBraceInFunction", + functionOpenBraceLeftTokenRange, + 19, + [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeMultilineBlockContext], + 8, + 1 + /* CanDeleteNewLines */ + ), + // Open Brace braces after TypeScript module/class/interface + rule( + "NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", + typeScriptOpenBraceLeftTokenRange, + 19, + [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], + 8, + 1 + /* CanDeleteNewLines */ + ), + rule( + "SpaceAfterTypeAssertion", + 32, + anyToken, + [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceAfterTypeAssertion", + 32, + anyToken, + [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceBeforeTypeAnnotation", + anyToken, + [ + 58, + 59 + /* ColonToken */ + ], + [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], + 4 + /* InsertSpace */ + ), + rule( + "NoSpaceBeforeTypeAnnotation", + anyToken, + [ + 58, + 59 + /* ColonToken */ + ], + [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoOptionalSemicolon", + 27, + anyTokenIncludingEOF, + [optionEquals( + "semicolons", + "remove" + /* Remove */ + ), isSemicolonDeletionContext], + 32 + /* DeleteToken */ + ), + rule( + "OptionalSemicolon", + anyToken, + anyTokenIncludingEOF, + [optionEquals( + "semicolons", + "insert" + /* Insert */ + ), isSemicolonInsertionContext], + 64 + /* InsertTrailingSemicolon */ + ) + ]; + const lowPriorityCommonRules = [ + // Space after keyword but not before ; or : or ? + rule( + "NoSpaceBeforeSemicolon", + anyToken, + 27, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceBeforeOpenBraceInControl", + controlOpenBraceLeftTokenRange, + 19, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForControlBlocks"), isControlDeclContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* CanDeleteNewLines */ + ), + rule( + "SpaceBeforeOpenBraceInFunction", + functionOpenBraceLeftTokenRange, + 19, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* CanDeleteNewLines */ + ), + rule( + "SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", + typeScriptOpenBraceLeftTokenRange, + 19, + [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], + 4, + 1 + /* CanDeleteNewLines */ + ), + rule( + "NoSpaceBeforeComma", + anyToken, + 28, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + // No space before and after indexer `x[]` + rule( + "NoSpaceBeforeOpenBracket", + anyTokenExcept( + 134, + 84 + /* CaseKeyword */ + ), + 23, + [isNonJsxSameLineTokenContext], + 16 + /* DeleteSpace */ + ), + rule( + "NoSpaceAfterCloseBracket", + 24, + anyToken, + [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], + 16 + /* DeleteSpace */ + ), + rule( + "SpaceAfterSemicolon", + 27, + anyToken, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + // Remove extra space between for and await + rule( + "SpaceBetweenForAndAwaitKeyword", + 99, + 135, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ), + // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. + // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] + rule( + "SpaceBetweenStatements", + [ + 22, + 92, + 93, + 84 + /* CaseKeyword */ + ], + anyToken, + [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], + 4 + /* InsertSpace */ + ), + // This low-pri rule takes care of "try {", "catch {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. + rule( + "SpaceAfterTryCatchFinally", + [ + 113, + 85, + 98 + /* FinallyKeyword */ + ], + 19, + [isNonJsxSameLineTokenContext], + 4 + /* InsertSpace */ + ) + ]; + return [ + ...highPriorityCommonRules, + ...userConfigurableRules, + ...lowPriorityCommonRules + ]; + } + function rule(debugName, left, right, context2, action, flags = 0) { + return { leftTokenRange: toTokenRange(left), rightTokenRange: toTokenRange(right), rule: { debugName, context: context2, action, flags } }; + } + function tokenRangeFrom(tokens) { + return { tokens, isSpecific: true }; + } + function toTokenRange(arg) { + return typeof arg === "number" ? tokenRangeFrom([arg]) : isArray3(arg) ? tokenRangeFrom(arg) : arg; + } + function tokenRangeFromRange(from, to, except = []) { + const tokens = []; + for (let token = from; token <= to; token++) { + if (!contains2(except, token)) { + tokens.push(token); + } + } + return tokenRangeFrom(tokens); + } + function optionEquals(optionName, optionValue) { + return (context2) => context2.options && context2.options[optionName] === optionValue; + } + function isOptionEnabled(optionName) { + return (context2) => context2.options && hasProperty(context2.options, optionName) && !!context2.options[optionName]; + } + function isOptionDisabled(optionName) { + return (context2) => context2.options && hasProperty(context2.options, optionName) && !context2.options[optionName]; + } + function isOptionDisabledOrUndefined(optionName) { + return (context2) => !context2.options || !hasProperty(context2.options, optionName) || !context2.options[optionName]; + } + function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) { + return (context2) => !context2.options || !hasProperty(context2.options, optionName) || !context2.options[optionName] || context2.TokensAreOnSameLine(); + } + function isOptionEnabledOrUndefined(optionName) { + return (context2) => !context2.options || !hasProperty(context2.options, optionName) || !!context2.options[optionName]; + } + function isForContext(context2) { + return context2.contextNode.kind === 248; + } + function isNotForContext(context2) { + return !isForContext(context2); + } + function isBinaryOpContext(context2) { + switch (context2.contextNode.kind) { + case 226: + return context2.contextNode.operatorToken.kind !== 28; + case 227: + case 194: + case 234: + case 281: + case 276: + case 182: + case 192: + case 193: + case 238: + return true; + case 208: + case 265: + case 271: + case 277: + case 260: + case 169: + case 306: + case 172: + case 171: + return context2.currentTokenSpan.kind === 64 || context2.nextTokenSpan.kind === 64; + case 249: + case 168: + return context2.currentTokenSpan.kind === 103 || context2.nextTokenSpan.kind === 103 || context2.currentTokenSpan.kind === 64 || context2.nextTokenSpan.kind === 64; + case 250: + return context2.currentTokenSpan.kind === 165 || context2.nextTokenSpan.kind === 165; + } + return false; + } + function isNotBinaryOpContext(context2) { + return !isBinaryOpContext(context2); + } + function isNotTypeAnnotationContext(context2) { + return !isTypeAnnotationContext(context2); + } + function isTypeAnnotationContext(context2) { + const contextKind = context2.contextNode.kind; + return contextKind === 172 || contextKind === 171 || contextKind === 169 || contextKind === 260 || isFunctionLikeKind(contextKind); + } + function isOptionalPropertyContext(context2) { + return isPropertyDeclaration(context2.contextNode) && context2.contextNode.questionToken; + } + function isNonOptionalPropertyContext(context2) { + return !isOptionalPropertyContext(context2); + } + function isConditionalOperatorContext(context2) { + return context2.contextNode.kind === 227 || context2.contextNode.kind === 194; + } + function isSameLineTokenOrBeforeBlockContext(context2) { + return context2.TokensAreOnSameLine() || isBeforeBlockContext(context2); + } + function isBraceWrappedContext(context2) { + return context2.contextNode.kind === 206 || context2.contextNode.kind === 200 || isSingleLineBlockContext(context2); + } + function isBeforeMultilineBlockContext(context2) { + return isBeforeBlockContext(context2) && !(context2.NextNodeAllOnSameLine() || context2.NextNodeBlockIsOnOneLine()); + } + function isMultilineBlockContext(context2) { + return isBlockContext(context2) && !(context2.ContextNodeAllOnSameLine() || context2.ContextNodeBlockIsOnOneLine()); + } + function isSingleLineBlockContext(context2) { + return isBlockContext(context2) && (context2.ContextNodeAllOnSameLine() || context2.ContextNodeBlockIsOnOneLine()); + } + function isBlockContext(context2) { + return nodeIsBlockContext(context2.contextNode); + } + function isBeforeBlockContext(context2) { + return nodeIsBlockContext(context2.nextTokenParent); + } + function nodeIsBlockContext(node) { + if (nodeIsTypeScriptDeclWithBlockContext(node)) { + return true; + } + switch (node.kind) { + case 241: + case 269: + case 210: + case 268: + return true; + } + return false; + } + function isFunctionDeclContext(context2) { + switch (context2.contextNode.kind) { + case 262: + case 174: + case 173: + case 177: + case 178: + case 179: + case 218: + case 176: + case 219: + case 264: + return true; + } + return false; + } + function isNotFunctionDeclContext(context2) { + return !isFunctionDeclContext(context2); + } + function isFunctionDeclarationOrFunctionExpressionContext(context2) { + return context2.contextNode.kind === 262 || context2.contextNode.kind === 218; + } + function isTypeScriptDeclWithBlockContext(context2) { + return nodeIsTypeScriptDeclWithBlockContext(context2.contextNode); + } + function nodeIsTypeScriptDeclWithBlockContext(node) { + switch (node.kind) { + case 263: + case 231: + case 264: + case 266: + case 187: + case 267: + case 278: + case 279: + case 272: + case 275: + return true; + } + return false; + } + function isAfterCodeBlockContext(context2) { + switch (context2.currentTokenParent.kind) { + case 263: + case 267: + case 266: + case 299: + case 268: + case 255: + return true; + case 241: { + const blockParent = context2.currentTokenParent.parent; + if (!blockParent || blockParent.kind !== 219 && blockParent.kind !== 218) { + return true; + } + } + } + return false; + } + function isControlDeclContext(context2) { + switch (context2.contextNode.kind) { + case 245: + case 255: + case 248: + case 249: + case 250: + case 247: + case 258: + case 246: + case 254: + case 299: + return true; + default: + return false; + } + } + function isObjectContext(context2) { + return context2.contextNode.kind === 210; + } + function isFunctionCallContext(context2) { + return context2.contextNode.kind === 213; + } + function isNewContext(context2) { + return context2.contextNode.kind === 214; + } + function isFunctionCallOrNewContext(context2) { + return isFunctionCallContext(context2) || isNewContext(context2); + } + function isPreviousTokenNotComma(context2) { + return context2.currentTokenSpan.kind !== 28; + } + function isNextTokenNotCloseBracket(context2) { + return context2.nextTokenSpan.kind !== 24; + } + function isNextTokenNotCloseParen(context2) { + return context2.nextTokenSpan.kind !== 22; + } + function isArrowFunctionContext(context2) { + return context2.contextNode.kind === 219; + } + function isImportTypeContext(context2) { + return context2.contextNode.kind === 205; + } + function isNonJsxSameLineTokenContext(context2) { + return context2.TokensAreOnSameLine() && context2.contextNode.kind !== 12; + } + function isNonJsxTextContext(context2) { + return context2.contextNode.kind !== 12; + } + function isNonJsxElementOrFragmentContext(context2) { + return context2.contextNode.kind !== 284 && context2.contextNode.kind !== 288; + } + function isJsxExpressionContext(context2) { + return context2.contextNode.kind === 294 || context2.contextNode.kind === 293; + } + function isNextTokenParentJsxAttribute(context2) { + return context2.nextTokenParent.kind === 291 || context2.nextTokenParent.kind === 295 && context2.nextTokenParent.parent.kind === 291; + } + function isJsxAttributeContext(context2) { + return context2.contextNode.kind === 291; + } + function isNextTokenParentNotJsxNamespacedName(context2) { + return context2.nextTokenParent.kind !== 295; + } + function isNextTokenParentJsxNamespacedName(context2) { + return context2.nextTokenParent.kind === 295; + } + function isJsxSelfClosingElementContext(context2) { + return context2.contextNode.kind === 285; + } + function isNotBeforeBlockInFunctionDeclarationContext(context2) { + return !isFunctionDeclContext(context2) && !isBeforeBlockContext(context2); + } + function isEndOfDecoratorContextOnSameLine(context2) { + return context2.TokensAreOnSameLine() && hasDecorators(context2.contextNode) && nodeIsInDecoratorContext(context2.currentTokenParent) && !nodeIsInDecoratorContext(context2.nextTokenParent); + } + function nodeIsInDecoratorContext(node) { + while (node && isExpression(node)) { + node = node.parent; + } + return node && node.kind === 170; + } + function isStartOfVariableDeclarationList(context2) { + return context2.currentTokenParent.kind === 261 && context2.currentTokenParent.getStart(context2.sourceFile) === context2.currentTokenSpan.pos; + } + function isNotFormatOnEnter(context2) { + return context2.formattingRequestKind !== 2; + } + function isModuleDeclContext(context2) { + return context2.contextNode.kind === 267; + } + function isObjectTypeContext(context2) { + return context2.contextNode.kind === 187; + } + function isConstructorSignatureContext(context2) { + return context2.contextNode.kind === 180; + } + function isTypeArgumentOrParameterOrAssertion(token, parent22) { + if (token.kind !== 30 && token.kind !== 32) { + return false; + } + switch (parent22.kind) { + case 183: + case 216: + case 265: + case 263: + case 231: + case 264: + case 262: + case 218: + case 219: + case 174: + case 173: + case 179: + case 180: + case 213: + case 214: + case 233: + return true; + default: + return false; + } + } + function isTypeArgumentOrParameterOrAssertionContext(context2) { + return isTypeArgumentOrParameterOrAssertion(context2.currentTokenSpan, context2.currentTokenParent) || isTypeArgumentOrParameterOrAssertion(context2.nextTokenSpan, context2.nextTokenParent); + } + function isTypeAssertionContext(context2) { + return context2.contextNode.kind === 216; + } + function isNonTypeAssertionContext(context2) { + return !isTypeAssertionContext(context2); + } + function isVoidOpContext(context2) { + return context2.currentTokenSpan.kind === 116 && context2.currentTokenParent.kind === 222; + } + function isYieldOrYieldStarWithOperand(context2) { + return context2.contextNode.kind === 229 && context2.contextNode.expression !== void 0; + } + function isNonNullAssertionContext(context2) { + return context2.contextNode.kind === 235; + } + function isNotStatementConditionContext(context2) { + return !isStatementConditionContext(context2); + } + function isStatementConditionContext(context2) { + switch (context2.contextNode.kind) { + case 245: + case 248: + case 249: + case 250: + case 246: + case 247: + return true; + default: + return false; + } + } + function isSemicolonDeletionContext(context2) { + let nextTokenKind = context2.nextTokenSpan.kind; + let nextTokenStart = context2.nextTokenSpan.pos; + if (isTrivia(nextTokenKind)) { + const nextRealToken = context2.nextTokenParent === context2.currentTokenParent ? findNextToken( + context2.currentTokenParent, + findAncestor(context2.currentTokenParent, (a7) => !a7.parent), + context2.sourceFile + ) : context2.nextTokenParent.getFirstToken(context2.sourceFile); + if (!nextRealToken) { + return true; + } + nextTokenKind = nextRealToken.kind; + nextTokenStart = nextRealToken.getStart(context2.sourceFile); + } + const startLine = context2.sourceFile.getLineAndCharacterOfPosition(context2.currentTokenSpan.pos).line; + const endLine = context2.sourceFile.getLineAndCharacterOfPosition(nextTokenStart).line; + if (startLine === endLine) { + return nextTokenKind === 20 || nextTokenKind === 1; + } + if (nextTokenKind === 240 || nextTokenKind === 27) { + return false; + } + if (context2.contextNode.kind === 264 || context2.contextNode.kind === 265) { + return !isPropertySignature(context2.currentTokenParent) || !!context2.currentTokenParent.type || nextTokenKind !== 21; + } + if (isPropertyDeclaration(context2.currentTokenParent)) { + return !context2.currentTokenParent.initializer; + } + return context2.currentTokenParent.kind !== 248 && context2.currentTokenParent.kind !== 242 && context2.currentTokenParent.kind !== 240 && nextTokenKind !== 23 && nextTokenKind !== 21 && nextTokenKind !== 40 && nextTokenKind !== 41 && nextTokenKind !== 44 && nextTokenKind !== 14 && nextTokenKind !== 28 && nextTokenKind !== 228 && nextTokenKind !== 16 && nextTokenKind !== 15 && nextTokenKind !== 25; + } + function isSemicolonInsertionContext(context2) { + return positionIsASICandidate(context2.currentTokenSpan.end, context2.currentTokenParent, context2.sourceFile); + } + function isNotPropertyAccessOnIntegerLiteral(context2) { + return !isPropertyAccessExpression(context2.contextNode) || !isNumericLiteral(context2.contextNode.expression) || context2.contextNode.expression.getText().includes("."); + } + var init_rules = __esm2({ + "src/services/formatting/rules.ts"() { + "use strict"; + init_ts4(); + init_ts_formatting(); + } + }); + function getFormatContext(options, host) { + return { options, getRules: getRulesMap(), host }; + } + function getRulesMap() { + if (rulesMapCache === void 0) { + rulesMapCache = createRulesMap(getAllRules()); + } + return rulesMapCache; + } + function getRuleActionExclusion(ruleAction) { + let mask2 = 0; + if (ruleAction & 1) { + mask2 |= 28; + } + if (ruleAction & 2) { + mask2 |= 96; + } + if (ruleAction & 28) { + mask2 |= 28; + } + if (ruleAction & 96) { + mask2 |= 96; + } + return mask2; + } + function createRulesMap(rules) { + const map22 = buildMap(rules); + return (context2) => { + const bucket = map22[getRuleBucketIndex(context2.currentTokenSpan.kind, context2.nextTokenSpan.kind)]; + if (bucket) { + const rules2 = []; + let ruleActionMask = 0; + for (const rule2 of bucket) { + const acceptRuleActions = ~getRuleActionExclusion(ruleActionMask); + if (rule2.action & acceptRuleActions && every2(rule2.context, (c7) => c7(context2))) { + rules2.push(rule2); + ruleActionMask |= rule2.action; + } + } + if (rules2.length) { + return rules2; + } + } + }; + } + function buildMap(rules) { + const map22 = new Array(mapRowLength * mapRowLength); + const rulesBucketConstructionStateList = new Array(map22.length); + for (const rule2 of rules) { + const specificRule = rule2.leftTokenRange.isSpecific && rule2.rightTokenRange.isSpecific; + for (const left of rule2.leftTokenRange.tokens) { + for (const right of rule2.rightTokenRange.tokens) { + const index4 = getRuleBucketIndex(left, right); + let rulesBucket = map22[index4]; + if (rulesBucket === void 0) { + rulesBucket = map22[index4] = []; + } + addRule(rulesBucket, rule2.rule, specificRule, rulesBucketConstructionStateList, index4); + } + } + } + return map22; + } + function getRuleBucketIndex(row, column) { + Debug.assert(row <= 165 && column <= 165, "Must compute formatting context from tokens"); + return row * mapRowLength + column; + } + function addRule(rules, rule2, specificTokens, constructionState, rulesBucketIndex) { + const position = rule2.action & 3 ? specificTokens ? 0 : RulesPosition.StopRulesAny : rule2.context !== anyContext ? specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny : specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; + const state = constructionState[rulesBucketIndex] || 0; + rules.splice(getInsertionIndex(state, position), 0, rule2); + constructionState[rulesBucketIndex] = increaseInsertionIndex(state, position); + } + function getInsertionIndex(indexBitmap, maskPosition) { + let index4 = 0; + for (let pos = 0; pos <= maskPosition; pos += maskBitSize) { + index4 += indexBitmap & mask; + indexBitmap >>= maskBitSize; + } + return index4; + } + function increaseInsertionIndex(indexBitmap, maskPosition) { + const value2 = (indexBitmap >> maskPosition & mask) + 1; + Debug.assert((value2 & mask) === value2, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); + return indexBitmap & ~(mask << maskPosition) | value2 << maskPosition; + } + var rulesMapCache, maskBitSize, mask, mapRowLength, RulesPosition; + var init_rulesMap = __esm2({ + "src/services/formatting/rulesMap.ts"() { + "use strict"; + init_ts4(); + init_ts_formatting(); + maskBitSize = 5; + mask = 31; + mapRowLength = 165 + 1; + RulesPosition = ((RulesPosition2) => { + RulesPosition2[RulesPosition2["StopRulesSpecific"] = 0] = "StopRulesSpecific"; + RulesPosition2[RulesPosition2["StopRulesAny"] = maskBitSize * 1] = "StopRulesAny"; + RulesPosition2[RulesPosition2["ContextRulesSpecific"] = maskBitSize * 2] = "ContextRulesSpecific"; + RulesPosition2[RulesPosition2["ContextRulesAny"] = maskBitSize * 3] = "ContextRulesAny"; + RulesPosition2[RulesPosition2["NoContextRulesSpecific"] = maskBitSize * 4] = "NoContextRulesSpecific"; + RulesPosition2[RulesPosition2["NoContextRulesAny"] = maskBitSize * 5] = "NoContextRulesAny"; + return RulesPosition2; + })(RulesPosition || {}); + } + }); + function createTextRangeWithKind(pos, end, kind) { + const textRangeWithKind = { pos, end, kind }; + if (Debug.isDebugging) { + Object.defineProperty(textRangeWithKind, "__debugKind", { + get: () => Debug.formatSyntaxKind(kind) + }); + } + return textRangeWithKind; + } + function formatOnEnter(position, sourceFile, formatContext) { + const line = sourceFile.getLineAndCharacterOfPosition(position).line; + if (line === 0) { + return []; + } + let endOfFormatSpan = getEndLinePosition(line, sourceFile); + while (isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(endOfFormatSpan))) { + endOfFormatSpan--; + } + if (isLineBreak2(sourceFile.text.charCodeAt(endOfFormatSpan))) { + endOfFormatSpan--; + } + const span = { + // get start position for the previous line + pos: getStartPositionOfLine(line - 1, sourceFile), + // end value is exclusive so add 1 to the result + end: endOfFormatSpan + 1 + }; + return formatSpan( + span, + sourceFile, + formatContext, + 2 + /* FormatOnEnter */ + ); + } + function formatOnSemicolon(position, sourceFile, formatContext) { + const semicolon = findImmediatelyPrecedingTokenOfKind(position, 27, sourceFile); + return formatNodeLines( + findOutermostNodeWithinListLevel(semicolon), + sourceFile, + formatContext, + 3 + /* FormatOnSemicolon */ + ); + } + function formatOnOpeningCurly(position, sourceFile, formatContext) { + const openingCurly = findImmediatelyPrecedingTokenOfKind(position, 19, sourceFile); + if (!openingCurly) { + return []; + } + const curlyBraceRange = openingCurly.parent; + const outermostNode = findOutermostNodeWithinListLevel(curlyBraceRange); + const textRange = { + pos: getLineStartPositionForPosition(outermostNode.getStart(sourceFile), sourceFile), + // TODO: GH#18217 + end: position + }; + return formatSpan( + textRange, + sourceFile, + formatContext, + 4 + /* FormatOnOpeningCurlyBrace */ + ); + } + function formatOnClosingCurly(position, sourceFile, formatContext) { + const precedingToken = findImmediatelyPrecedingTokenOfKind(position, 20, sourceFile); + return formatNodeLines( + findOutermostNodeWithinListLevel(precedingToken), + sourceFile, + formatContext, + 5 + /* FormatOnClosingCurlyBrace */ + ); + } + function formatDocument(sourceFile, formatContext) { + const span = { + pos: 0, + end: sourceFile.text.length + }; + return formatSpan( + span, + sourceFile, + formatContext, + 0 + /* FormatDocument */ + ); + } + function formatSelection(start, end, sourceFile, formatContext) { + const span = { + pos: getLineStartPositionForPosition(start, sourceFile), + end + }; + return formatSpan( + span, + sourceFile, + formatContext, + 1 + /* FormatSelection */ + ); + } + function findImmediatelyPrecedingTokenOfKind(end, expectedTokenKind, sourceFile) { + const precedingToken = findPrecedingToken(end, sourceFile); + return precedingToken && precedingToken.kind === expectedTokenKind && end === precedingToken.getEnd() ? precedingToken : void 0; + } + function findOutermostNodeWithinListLevel(node) { + let current = node; + while (current && current.parent && current.parent.end === node.end && !isListElement(current.parent, current)) { + current = current.parent; + } + return current; + } + function isListElement(parent22, node) { + switch (parent22.kind) { + case 263: + case 264: + return rangeContainsRange(parent22.members, node); + case 267: + const body = parent22.body; + return !!body && body.kind === 268 && rangeContainsRange(body.statements, node); + case 312: + case 241: + case 268: + return rangeContainsRange(parent22.statements, node); + case 299: + return rangeContainsRange(parent22.block.statements, node); + } + return false; + } + function findEnclosingNode(range2, sourceFile) { + return find22(sourceFile); + function find22(n7) { + const candidate = forEachChild(n7, (c7) => startEndContainsRange(c7.getStart(sourceFile), c7.end, range2) && c7); + if (candidate) { + const result2 = find22(candidate); + if (result2) { + return result2; + } + } + return n7; + } + } + function prepareRangeContainsErrorFunction(errors, originalRange) { + if (!errors.length) { + return rangeHasNoErrors; + } + const sorted = errors.filter((d7) => rangeOverlapsWithStartEnd(originalRange, d7.start, d7.start + d7.length)).sort((e1, e22) => e1.start - e22.start); + if (!sorted.length) { + return rangeHasNoErrors; + } + let index4 = 0; + return (r8) => { + while (true) { + if (index4 >= sorted.length) { + return false; + } + const error22 = sorted[index4]; + if (r8.end <= error22.start) { + return false; + } + if (startEndOverlapsWithStartEnd(r8.pos, r8.end, error22.start, error22.start + error22.length)) { + return true; + } + index4++; + } + }; + function rangeHasNoErrors() { + return false; + } + } + function getScanStartPosition(enclosingNode, originalRange, sourceFile) { + const start = enclosingNode.getStart(sourceFile); + if (start === originalRange.pos && enclosingNode.end === originalRange.end) { + return start; + } + const precedingToken = findPrecedingToken(originalRange.pos, sourceFile); + if (!precedingToken) { + return enclosingNode.pos; + } + if (precedingToken.end >= originalRange.pos) { + return enclosingNode.pos; + } + return precedingToken.end; + } + function getOwnOrInheritedDelta(n7, options, sourceFile) { + let previousLine = -1; + let child; + while (n7) { + const line = sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)).line; + if (previousLine !== -1 && line !== previousLine) { + break; + } + if (SmartIndenter.shouldIndentChildNode(options, n7, child, sourceFile)) { + return options.indentSize; + } + previousLine = line; + child = n7; + n7 = n7.parent; + } + return 0; + } + function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) { + const range2 = { pos: node.pos, end: node.end }; + return getFormattingScanner(sourceFileLike.text, languageVariant, range2.pos, range2.end, (scanner2) => formatSpanWorker( + range2, + node, + initialIndentation, + delta, + scanner2, + formatContext, + 1, + (_6) => false, + // assume that node does not have any errors + sourceFileLike + )); + } + function formatNodeLines(node, sourceFile, formatContext, requestKind) { + if (!node) { + return []; + } + const span = { + pos: getLineStartPositionForPosition(node.getStart(sourceFile), sourceFile), + end: node.end + }; + return formatSpan(span, sourceFile, formatContext, requestKind); + } + function formatSpan(originalRange, sourceFile, formatContext, requestKind) { + const enclosingNode = findEnclosingNode(originalRange, sourceFile); + return getFormattingScanner( + sourceFile.text, + sourceFile.languageVariant, + getScanStartPosition(enclosingNode, originalRange, sourceFile), + originalRange.end, + (scanner2) => formatSpanWorker( + originalRange, + enclosingNode, + SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, formatContext.options), + getOwnOrInheritedDelta(enclosingNode, formatContext.options, sourceFile), + scanner2, + formatContext, + requestKind, + prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange), + sourceFile + ) + ); + } + function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delta, formattingScanner, { options, getRules, host }, requestKind, rangeContainsError, sourceFile) { + var _a2; + const formattingContext = new FormattingContext(sourceFile, requestKind, options); + let previousRangeTriviaEnd; + let previousRange; + let previousParent; + let previousRangeStartLine; + let lastIndentedLine; + let indentationOnLastIndentedLine = -1; + const edits = []; + formattingScanner.advance(); + if (formattingScanner.isOnToken()) { + const startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; + let undecoratedStartLine = startLine; + if (hasDecorators(enclosingNode)) { + undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; + } + processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); + } + const remainingTrivia = formattingScanner.getCurrentLeadingTrivia(); + if (remainingTrivia) { + const indentation = SmartIndenter.nodeWillIndentChild( + options, + enclosingNode, + /*child*/ + void 0, + sourceFile, + /*indentByDefault*/ + false + ) ? initialIndentation + options.indentSize : initialIndentation; + indentTriviaItems( + remainingTrivia, + indentation, + /*indentNextTokenOrTrivia*/ + true, + (item) => { + processRange( + item, + sourceFile.getLineAndCharacterOfPosition(item.pos), + enclosingNode, + enclosingNode, + /*dynamicIndentation*/ + void 0 + ); + insertIndentation( + item.pos, + indentation, + /*lineAdded*/ + false + ); + } + ); + if (options.trimTrailingWhitespace !== false) { + trimTrailingWhitespacesForRemainingRange(remainingTrivia); + } + } + if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) { + const tokenInfo = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() : formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token : void 0; + if (tokenInfo && tokenInfo.pos === previousRangeTriviaEnd) { + const parent22 = ((_a2 = findPrecedingToken(tokenInfo.end, sourceFile, enclosingNode)) == null ? void 0 : _a2.parent) || previousParent; + processPair( + tokenInfo, + sourceFile.getLineAndCharacterOfPosition(tokenInfo.pos).line, + parent22, + previousRange, + previousRangeStartLine, + previousParent, + parent22, + /*dynamicIndentation*/ + void 0 + ); + } + } + return edits; + function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range2, inheritedIndentation) { + if (rangeOverlapsWithStartEnd(range2, startPos, endPos) || rangeContainsStartEnd(range2, startPos, endPos)) { + if (inheritedIndentation !== -1) { + return inheritedIndentation; + } + } else { + const startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + const startLinePosition = getLineStartPositionForPosition(startPos, sourceFile); + const column = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); + if (startLine !== parentStartLine || startPos === column) { + const baseIndentSize = SmartIndenter.getBaseIndentation(options); + return baseIndentSize > column ? baseIndentSize : column; + } + } + return -1; + } + function computeIndentation(node, startLine, inheritedIndentation, parent22, parentDynamicIndentation, effectiveParentStartLine) { + const delta2 = SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; + if (effectiveParentStartLine === startLine) { + return { + indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta2) + }; + } else if (inheritedIndentation === -1) { + if (node.kind === 21 && startLine === lastIndentedLine) { + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } else if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent22, node, startLine, sourceFile) || SmartIndenter.childIsUnindentedBranchOfConditionalExpression(parent22, node, startLine, sourceFile) || SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(parent22, node, startLine, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta2 }; + } else { + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta2 }; + } + } else { + return { indentation: inheritedIndentation, delta: delta2 }; + } + } + function getFirstNonDecoratorTokenOfNode(node) { + if (canHaveModifiers(node)) { + const modifier = find2(node.modifiers, isModifier, findIndex2(node.modifiers, isDecorator)); + if (modifier) + return modifier.kind; + } + switch (node.kind) { + case 263: + return 86; + case 264: + return 120; + case 262: + return 100; + case 266: + return 266; + case 177: + return 139; + case 178: + return 153; + case 174: + if (node.asteriskToken) { + return 42; + } + case 172: + case 169: + const name2 = getNameOfDeclaration(node); + if (name2) { + return name2.kind; + } + } + } + function getDynamicIndentation(node, nodeStartLine, indentation, delta2) { + return { + getIndentationForComment: (kind, tokenIndentation, container) => { + switch (kind) { + case 20: + case 24: + case 22: + return indentation + getDelta(container); + } + return tokenIndentation !== -1 ? tokenIndentation : indentation; + }, + // if list end token is LessThanToken '>' then its delta should be explicitly suppressed + // so that LessThanToken as a binary operator can still be indented. + // foo.then + // < + // number, + // string, + // >(); + // vs + // var a = xValue + // > yValue; + getIndentationForToken: (line, kind, container, suppressDelta) => !suppressDelta && shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation, + getIndentation: () => indentation, + getDelta, + recomputeIndentation: (lineAdded, parent22) => { + if (SmartIndenter.shouldIndentChildNode(options, parent22, node, sourceFile)) { + indentation += lineAdded ? options.indentSize : -options.indentSize; + delta2 = SmartIndenter.shouldIndentChildNode(options, node) ? options.indentSize : 0; + } + } + }; + function shouldAddDelta(line, kind, container) { + switch (kind) { + case 19: + case 20: + case 22: + case 93: + case 117: + case 60: + return false; + case 44: + case 32: + switch (container.kind) { + case 286: + case 287: + case 285: + return false; + } + break; + case 23: + case 24: + if (container.kind !== 200) { + return false; + } + break; + } + return nodeStartLine !== line && !(hasDecorators(node) && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { + return SmartIndenter.nodeWillIndentChild( + options, + node, + child, + sourceFile, + /*indentByDefault*/ + true + ) ? delta2 : 0; + } + } + function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta2) { + if (!rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { + return; + } + const nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta2); + let childContextNode = contextNode; + forEachChild( + node, + (child) => { + processChildNode( + child, + /*inheritedIndentation*/ + -1, + node, + nodeDynamicIndentation, + nodeStartLine, + undecoratedNodeStartLine, + /*isListItem*/ + false + ); + }, + (nodes) => { + processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); + } + ); + while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { + const tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > Math.min(node.end, originalRange.end)) { + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node); + } + function processChildNode(child, inheritedIndentation, parent22, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) { + Debug.assert(!nodeIsSynthesized(child)); + if (nodeIsMissing(child) || isGrammarError(parent22, child)) { + return inheritedIndentation; + } + const childStartPos = child.getStart(sourceFile); + const childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; + let undecoratedChildStartLine = childStartLine; + if (hasDecorators(child)) { + undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(getNonDecoratorTokenPosOfNode(child, sourceFile)).line; + } + let childIndentationAmount = -1; + if (isListItem && rangeContainsRange(originalRange, parent22)) { + childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); + if (childIndentationAmount !== -1) { + inheritedIndentation = childIndentationAmount; + } + } + if (!rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { + if (child.end < originalRange.pos) { + formattingScanner.skipToEndOf(child); + } + return inheritedIndentation; + } + if (child.getFullWidth() === 0) { + return inheritedIndentation; + } + while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { + const tokenInfo = formattingScanner.readTokenInfo(node); + if (tokenInfo.token.end > originalRange.end) { + return inheritedIndentation; + } + if (tokenInfo.token.end > childStartPos) { + if (tokenInfo.token.pos > childStartPos) { + formattingScanner.skipToStartOf(child); + } + break; + } + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node); + } + if (!formattingScanner.isOnToken() || formattingScanner.getTokenFullStart() >= originalRange.end) { + return inheritedIndentation; + } + if (isToken(child)) { + const tokenInfo = formattingScanner.readTokenInfo(child); + if (child.kind !== 12) { + Debug.assert(tokenInfo.token.end === child.end, "Token end is child end"); + consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); + return inheritedIndentation; + } + } + const effectiveParentStartLine = child.kind === 170 ? childStartLine : undecoratedParentStartLine; + const childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); + processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); + childContextNode = node; + if (isFirstListItem && parent22.kind === 209 && inheritedIndentation === -1) { + inheritedIndentation = childIndentation.indentation; + } + return inheritedIndentation; + } + function processChildNodes(nodes, parent22, parentStartLine, parentDynamicIndentation) { + Debug.assert(isNodeArray(nodes)); + Debug.assert(!nodeIsSynthesized(nodes)); + const listStartToken = getOpenTokenForList(parent22, nodes); + let listDynamicIndentation = parentDynamicIndentation; + let startLine = parentStartLine; + if (!rangeOverlapsWithStartEnd(originalRange, nodes.pos, nodes.end)) { + if (nodes.end < originalRange.pos) { + formattingScanner.skipToEndOf(nodes); + } + return; + } + if (listStartToken !== 0) { + while (formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { + const tokenInfo = formattingScanner.readTokenInfo(parent22); + if (tokenInfo.token.end > nodes.pos) { + break; + } else if (tokenInfo.token.kind === listStartToken) { + startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; + consumeTokenAndAdvanceScanner(tokenInfo, parent22, parentDynamicIndentation, parent22); + let indentationOnListStartToken; + if (indentationOnLastIndentedLine !== -1) { + indentationOnListStartToken = indentationOnLastIndentedLine; + } else { + const startLinePosition = getLineStartPositionForPosition(tokenInfo.token.pos, sourceFile); + indentationOnListStartToken = SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, tokenInfo.token.pos, sourceFile, options); + } + listDynamicIndentation = getDynamicIndentation(parent22, parentStartLine, indentationOnListStartToken, options.indentSize); + } else { + consumeTokenAndAdvanceScanner(tokenInfo, parent22, parentDynamicIndentation, parent22); + } + } + } + let inheritedIndentation = -1; + for (let i7 = 0; i7 < nodes.length; i7++) { + const child = nodes[i7]; + inheritedIndentation = processChildNode( + child, + inheritedIndentation, + node, + listDynamicIndentation, + startLine, + startLine, + /*isListItem*/ + true, + /*isFirstListItem*/ + i7 === 0 + ); + } + const listEndToken = getCloseTokenForOpenToken(listStartToken); + if (listEndToken !== 0 && formattingScanner.isOnToken() && formattingScanner.getTokenFullStart() < originalRange.end) { + let tokenInfo = formattingScanner.readTokenInfo(parent22); + if (tokenInfo.token.kind === 28) { + consumeTokenAndAdvanceScanner(tokenInfo, parent22, listDynamicIndentation, parent22); + tokenInfo = formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(parent22) : void 0; + } + if (tokenInfo && tokenInfo.token.kind === listEndToken && rangeContainsRange(parent22, tokenInfo.token)) { + consumeTokenAndAdvanceScanner( + tokenInfo, + parent22, + listDynamicIndentation, + parent22, + /*isListEndToken*/ + true + ); + } + } + } + function consumeTokenAndAdvanceScanner(currentTokenInfo, parent22, dynamicIndentation, container, isListEndToken) { + Debug.assert(rangeContainsRange(parent22, currentTokenInfo.token)); + const lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); + let indentToken = false; + if (currentTokenInfo.leadingTrivia) { + processTrivia(currentTokenInfo.leadingTrivia, parent22, childContextNode, dynamicIndentation); + } + let lineAction = 0; + const isTokenInRange = rangeContainsRange(originalRange, currentTokenInfo.token); + const tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); + if (isTokenInRange) { + const rangeHasError = rangeContainsError(currentTokenInfo.token); + const savePreviousRange = previousRange; + lineAction = processRange(currentTokenInfo.token, tokenStart, parent22, childContextNode, dynamicIndentation); + if (!rangeHasError) { + if (lineAction === 0) { + const prevEndLine = savePreviousRange && sourceFile.getLineAndCharacterOfPosition(savePreviousRange.end).line; + indentToken = lastTriviaWasNewLine && tokenStart.line !== prevEndLine; + } else { + indentToken = lineAction === 1; + } + } + } + if (currentTokenInfo.trailingTrivia) { + previousRangeTriviaEnd = last2(currentTokenInfo.trailingTrivia).end; + processTrivia(currentTokenInfo.trailingTrivia, parent22, childContextNode, dynamicIndentation); + } + if (indentToken) { + const tokenIndentation = isTokenInRange && !rangeContainsError(currentTokenInfo.token) ? dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind, container, !!isListEndToken) : -1; + let indentNextTokenOrTrivia = true; + if (currentTokenInfo.leadingTrivia) { + const commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind, tokenIndentation, container); + indentNextTokenOrTrivia = indentTriviaItems(currentTokenInfo.leadingTrivia, commentIndentation, indentNextTokenOrTrivia, (item) => insertIndentation( + item.pos, + commentIndentation, + /*lineAdded*/ + false + )); + } + if (tokenIndentation !== -1 && indentNextTokenOrTrivia) { + insertIndentation( + currentTokenInfo.token.pos, + tokenIndentation, + lineAction === 1 + /* LineAdded */ + ); + lastIndentedLine = tokenStart.line; + indentationOnLastIndentedLine = tokenIndentation; + } + } + formattingScanner.advance(); + childContextNode = parent22; + } + } + function indentTriviaItems(trivia, commentIndentation, indentNextTokenOrTrivia, indentSingleLine) { + for (const triviaItem of trivia) { + const triviaInRange = rangeContainsRange(originalRange, triviaItem); + switch (triviaItem.kind) { + case 3: + if (triviaInRange) { + indentMultilineComment( + triviaItem, + commentIndentation, + /*firstLineIsIndented*/ + !indentNextTokenOrTrivia + ); + } + indentNextTokenOrTrivia = false; + break; + case 2: + if (indentNextTokenOrTrivia && triviaInRange) { + indentSingleLine(triviaItem); + } + indentNextTokenOrTrivia = false; + break; + case 4: + indentNextTokenOrTrivia = true; + break; + } + } + return indentNextTokenOrTrivia; + } + function processTrivia(trivia, parent22, contextNode, dynamicIndentation) { + for (const triviaItem of trivia) { + if (isComment(triviaItem.kind) && rangeContainsRange(originalRange, triviaItem)) { + const triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); + processRange(triviaItem, triviaItemStart, parent22, contextNode, dynamicIndentation); + } + } + } + function processRange(range2, rangeStart, parent22, contextNode, dynamicIndentation) { + const rangeHasError = rangeContainsError(range2); + let lineAction = 0; + if (!rangeHasError) { + if (!previousRange) { + const originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); + trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); + } else { + lineAction = processPair(range2, rangeStart.line, parent22, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); + } + } + previousRange = range2; + previousRangeTriviaEnd = range2.end; + previousParent = parent22; + previousRangeStartLine = rangeStart.line; + return lineAction; + } + function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent2, contextNode, dynamicIndentation) { + formattingContext.updateContext(previousItem, previousParent2, currentItem, currentParent, contextNode); + const rules = getRules(formattingContext); + let trimTrailingWhitespaces = formattingContext.options.trimTrailingWhitespace !== false; + let lineAction = 0; + if (rules) { + forEachRight2(rules, (rule2) => { + lineAction = applyRuleEdits(rule2, previousItem, previousStartLine, currentItem, currentStartLine); + if (dynamicIndentation) { + switch (lineAction) { + case 2: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation( + /*lineAddedByFormatting*/ + false, + contextNode + ); + } + break; + case 1: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation( + /*lineAddedByFormatting*/ + true, + contextNode + ); + } + break; + default: + Debug.assert( + lineAction === 0 + /* None */ + ); + } + } + trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule2.action & 16) && rule2.flags !== 1; + }); + } else { + trimTrailingWhitespaces = trimTrailingWhitespaces && currentItem.kind !== 1; + } + if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { + trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); + } + return lineAction; + } + function insertIndentation(pos, indentation, lineAdded) { + const indentationString = getIndentationString(indentation, options); + if (lineAdded) { + recordReplace(pos, 0, indentationString); + } else { + const tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); + const startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile); + if (indentation !== characterToColumn(startLinePosition, tokenStart.character) || indentationIsDifferent(indentationString, startLinePosition)) { + recordReplace(startLinePosition, tokenStart.character, indentationString); + } + } + } + function characterToColumn(startLinePosition, characterInLine) { + let column = 0; + for (let i7 = 0; i7 < characterInLine; i7++) { + if (sourceFile.text.charCodeAt(startLinePosition + i7) === 9) { + column += options.tabSize - column % options.tabSize; + } else { + column++; + } + } + return column; + } + function indentationIsDifferent(indentationString, startLinePosition) { + return indentationString !== sourceFile.text.substr(startLinePosition, indentationString.length); + } + function indentMultilineComment(commentRange, indentation, firstLineIsIndented, indentFinalLine = true) { + let startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; + const endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; + if (startLine === endLine) { + if (!firstLineIsIndented) { + insertIndentation( + commentRange.pos, + indentation, + /*lineAdded*/ + false + ); + } + return; + } + const parts = []; + let startPos = commentRange.pos; + for (let line = startLine; line < endLine; line++) { + const endOfLine = getEndLinePosition(line, sourceFile); + parts.push({ pos: startPos, end: endOfLine }); + startPos = getStartPositionOfLine(line + 1, sourceFile); + } + if (indentFinalLine) { + parts.push({ pos: startPos, end: commentRange.end }); + } + if (parts.length === 0) + return; + const startLinePos = getStartPositionOfLine(startLine, sourceFile); + const nonWhitespaceColumnInFirstPart = SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); + let startIndex = 0; + if (firstLineIsIndented) { + startIndex = 1; + startLine++; + } + const delta2 = indentation - nonWhitespaceColumnInFirstPart.column; + for (let i7 = startIndex; i7 < parts.length; i7++, startLine++) { + const startLinePos2 = getStartPositionOfLine(startLine, sourceFile); + const nonWhitespaceCharacterAndColumn = i7 === 0 ? nonWhitespaceColumnInFirstPart : SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i7].pos, parts[i7].end, sourceFile, options); + const newIndentation = nonWhitespaceCharacterAndColumn.column + delta2; + if (newIndentation > 0) { + const indentationString = getIndentationString(newIndentation, options); + recordReplace(startLinePos2, nonWhitespaceCharacterAndColumn.character, indentationString); + } else { + recordDelete(startLinePos2, nonWhitespaceCharacterAndColumn.character); + } + } + } + function trimTrailingWhitespacesForLines(line1, line2, range2) { + for (let line = line1; line < line2; line++) { + const lineStartPosition = getStartPositionOfLine(line, sourceFile); + const lineEndPosition = getEndLinePosition(line, sourceFile); + if (range2 && (isComment(range2.kind) || isStringOrRegularExpressionOrTemplateLiteral(range2.kind)) && range2.pos <= lineEndPosition && range2.end > lineEndPosition) { + continue; + } + const whitespaceStart = getTrailingWhitespaceStartPosition(lineStartPosition, lineEndPosition); + if (whitespaceStart !== -1) { + Debug.assert(whitespaceStart === lineStartPosition || !isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(whitespaceStart - 1))); + recordDelete(whitespaceStart, lineEndPosition + 1 - whitespaceStart); + } + } + } + function getTrailingWhitespaceStartPosition(start, end) { + let pos = end; + while (pos >= start && isWhiteSpaceSingleLine(sourceFile.text.charCodeAt(pos))) { + pos--; + } + if (pos !== end) { + return pos + 1; + } + return -1; + } + function trimTrailingWhitespacesForRemainingRange(trivias) { + let startPos = previousRange ? previousRange.end : originalRange.pos; + for (const trivia of trivias) { + if (isComment(trivia.kind)) { + if (startPos < trivia.pos) { + trimTrailingWitespacesForPositions(startPos, trivia.pos - 1, previousRange); + } + startPos = trivia.end + 1; + } + } + if (startPos < originalRange.end) { + trimTrailingWitespacesForPositions(startPos, originalRange.end, previousRange); + } + } + function trimTrailingWitespacesForPositions(startPos, endPos, previousRange2) { + const startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; + const endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line; + trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange2); + } + function recordDelete(start, len) { + if (len) { + edits.push(createTextChangeFromStartLength(start, len, "")); + } + } + function recordReplace(start, len, newText) { + if (len || newText) { + edits.push(createTextChangeFromStartLength(start, len, newText)); + } + } + function recordInsert(start, text) { + if (text) { + edits.push(createTextChangeFromStartLength(start, 0, text)); + } + } + function applyRuleEdits(rule2, previousRange2, previousStartLine, currentRange, currentStartLine) { + const onLaterLine = currentStartLine !== previousStartLine; + switch (rule2.action) { + case 1: + return 0; + case 16: + if (previousRange2.end !== currentRange.pos) { + recordDelete(previousRange2.end, currentRange.pos - previousRange2.end); + return onLaterLine ? 2 : 0; + } + break; + case 32: + recordDelete(previousRange2.pos, previousRange2.end - previousRange2.pos); + break; + case 8: + if (rule2.flags !== 1 && previousStartLine !== currentStartLine) { + return 0; + } + const lineDelta = currentStartLine - previousStartLine; + if (lineDelta !== 1) { + recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, getNewLineOrDefaultFromHost(host, options)); + return onLaterLine ? 0 : 1; + } + break; + case 4: + if (rule2.flags !== 1 && previousStartLine !== currentStartLine) { + return 0; + } + const posDelta = currentRange.pos - previousRange2.end; + if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange2.end) !== 32) { + recordReplace(previousRange2.end, currentRange.pos - previousRange2.end, " "); + return onLaterLine ? 2 : 0; + } + break; + case 64: + recordInsert(previousRange2.end, ";"); + } + return 0; + } + } + function getRangeOfEnclosingComment(sourceFile, position, precedingToken, tokenAtPosition = getTokenAtPosition(sourceFile, position)) { + const jsdoc = findAncestor(tokenAtPosition, isJSDoc); + if (jsdoc) + tokenAtPosition = jsdoc.parent; + const tokenStart = tokenAtPosition.getStart(sourceFile); + if (tokenStart <= position && position < tokenAtPosition.getEnd()) { + return void 0; + } + precedingToken = precedingToken === null ? void 0 : precedingToken === void 0 ? findPrecedingToken(position, sourceFile) : precedingToken; + const trailingRangesOfPreviousToken = precedingToken && getTrailingCommentRanges(sourceFile.text, precedingToken.end); + const leadingCommentRangesOfNextToken = getLeadingCommentRangesOfNode(tokenAtPosition, sourceFile); + const commentRanges = concatenate(trailingRangesOfPreviousToken, leadingCommentRangesOfNextToken); + return commentRanges && find2(commentRanges, (range2) => rangeContainsPositionExclusive(range2, position) || // The end marker of a single-line comment does not include the newline character. + // With caret at `^`, in the following case, we are inside a comment (^ denotes the cursor position): + // + // // asdf ^\n + // + // But for closed multi-line comments, we don't want to be inside the comment in the following case: + // + // /* asdf */^ + // + // However, unterminated multi-line comments *do* contain their end. + // + // Internally, we represent the end of the comment at the newline and closing '/', respectively. + // + position === range2.end && (range2.kind === 2 || position === sourceFile.getFullWidth())); + } + function getOpenTokenForList(node, list) { + switch (node.kind) { + case 176: + case 262: + case 218: + case 174: + case 173: + case 219: + case 179: + case 180: + case 184: + case 185: + case 177: + case 178: + if (node.typeParameters === list) { + return 30; + } else if (node.parameters === list) { + return 21; + } + break; + case 213: + case 214: + if (node.typeArguments === list) { + return 30; + } else if (node.arguments === list) { + return 21; + } + break; + case 263: + case 231: + case 264: + case 265: + if (node.typeParameters === list) { + return 30; + } + break; + case 183: + case 215: + case 186: + case 233: + case 205: + if (node.typeArguments === list) { + return 30; + } + break; + case 187: + return 19; + } + return 0; + } + function getCloseTokenForOpenToken(kind) { + switch (kind) { + case 21: + return 22; + case 30: + return 32; + case 19: + return 20; + } + return 0; + } + function getIndentationString(indentation, options) { + const resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.tabSize || internedSizes.indentSize !== options.indentSize); + if (resetInternedStrings) { + internedSizes = { tabSize: options.tabSize, indentSize: options.indentSize }; + internedTabsIndentation = internedSpacesIndentation = void 0; + } + if (!options.convertTabsToSpaces) { + const tabs = Math.floor(indentation / options.tabSize); + const spaces = indentation - tabs * options.tabSize; + let tabString; + if (!internedTabsIndentation) { + internedTabsIndentation = []; + } + if (internedTabsIndentation[tabs] === void 0) { + internedTabsIndentation[tabs] = tabString = repeatString(" ", tabs); + } else { + tabString = internedTabsIndentation[tabs]; + } + return spaces ? tabString + repeatString(" ", spaces) : tabString; + } else { + let spacesString; + const quotient = Math.floor(indentation / options.indentSize); + const remainder = indentation % options.indentSize; + if (!internedSpacesIndentation) { + internedSpacesIndentation = []; + } + if (internedSpacesIndentation[quotient] === void 0) { + spacesString = repeatString(" ", options.indentSize * quotient); + internedSpacesIndentation[quotient] = spacesString; + } else { + spacesString = internedSpacesIndentation[quotient]; + } + return remainder ? spacesString + repeatString(" ", remainder) : spacesString; + } + } + var internedSizes, internedTabsIndentation, internedSpacesIndentation; + var init_formatting = __esm2({ + "src/services/formatting/formatting.ts"() { + "use strict"; + init_ts4(); + init_ts_formatting(); + } + }); + var SmartIndenter; + var init_smartIndenter = __esm2({ + "src/services/formatting/smartIndenter.ts"() { + "use strict"; + init_ts4(); + init_ts_formatting(); + ((SmartIndenter2) => { + let Value; + ((Value2) => { + Value2[Value2["Unknown"] = -1] = "Unknown"; + })(Value || (Value = {})); + function getIndentation(position, sourceFile, options, assumeNewLineBeforeCloseBrace = false) { + if (position > sourceFile.text.length) { + return getBaseIndentation(options); + } + if (options.indentStyle === 0) { + return 0; + } + const precedingToken = findPrecedingToken( + position, + sourceFile, + /*startNode*/ + void 0, + /*excludeJsdoc*/ + true + ); + const enclosingCommentRange = getRangeOfEnclosingComment(sourceFile, position, precedingToken || null); + if (enclosingCommentRange && enclosingCommentRange.kind === 3) { + return getCommentIndent(sourceFile, position, options, enclosingCommentRange); + } + if (!precedingToken) { + return getBaseIndentation(options); + } + const precedingTokenIsLiteral = isStringOrRegularExpressionOrTemplateLiteral(precedingToken.kind); + if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && position < precedingToken.end) { + return 0; + } + const lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; + const currentToken = getTokenAtPosition(sourceFile, position); + const isObjectLiteral2 = currentToken.kind === 19 && currentToken.parent.kind === 210; + if (options.indentStyle === 1 || isObjectLiteral2) { + return getBlockIndent(sourceFile, position, options); + } + if (precedingToken.kind === 28 && precedingToken.parent.kind !== 226) { + const actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation; + } + } + const containerList = getListByPosition(position, precedingToken.parent, sourceFile); + if (containerList && !rangeContainsRange(containerList, precedingToken)) { + const useTheSameBaseIndentation = [ + 218, + 219 + /* ArrowFunction */ + ].includes(currentToken.parent.kind); + const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize; + return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize; + } + return getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options); + } + SmartIndenter2.getIndentation = getIndentation; + function getCommentIndent(sourceFile, position, options, enclosingCommentRange) { + const previousLine = getLineAndCharacterOfPosition(sourceFile, position).line - 1; + const commentStartLine = getLineAndCharacterOfPosition(sourceFile, enclosingCommentRange.pos).line; + Debug.assert(commentStartLine >= 0); + if (previousLine <= commentStartLine) { + return findFirstNonWhitespaceColumn(getStartPositionOfLine(commentStartLine, sourceFile), position, sourceFile, options); + } + const startPositionOfLine = getStartPositionOfLine(previousLine, sourceFile); + const { column, character } = findFirstNonWhitespaceCharacterAndColumn(startPositionOfLine, position, sourceFile, options); + if (column === 0) { + return column; + } + const firstNonWhitespaceCharacterCode = sourceFile.text.charCodeAt(startPositionOfLine + character); + return firstNonWhitespaceCharacterCode === 42 ? column - 1 : column; + } + function getBlockIndent(sourceFile, position, options) { + let current = position; + while (current > 0) { + const char = sourceFile.text.charCodeAt(current); + if (!isWhiteSpaceLike(char)) { + break; + } + current--; + } + const lineStart = getLineStartPositionForPosition(current, sourceFile); + return findFirstNonWhitespaceColumn(lineStart, current, sourceFile, options); + } + function getSmartIndent(sourceFile, position, precedingToken, lineAtPosition, assumeNewLineBeforeCloseBrace, options) { + let previous; + let current = precedingToken; + while (current) { + if (positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode( + options, + current, + previous, + sourceFile, + /*isNextChild*/ + true + )) { + const currentStart = getStartLineAndCharacterForNode(current, sourceFile); + const nextTokenKind = nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile); + const indentationDelta = nextTokenKind !== 0 ? assumeNewLineBeforeCloseBrace && nextTokenKind === 2 ? options.indentSize : 0 : lineAtPosition !== currentStart.line ? options.indentSize : 0; + return getIndentationForNodeWorker( + current, + currentStart, + /*ignoreActualIndentationRange*/ + void 0, + indentationDelta, + sourceFile, + /*isNextChild*/ + true, + options + ); + } + const actualIndentation = getActualIndentationForListItem( + current, + sourceFile, + options, + /*listIndentsChild*/ + true + ); + if (actualIndentation !== -1) { + return actualIndentation; + } + previous = current; + current = current.parent; + } + return getBaseIndentation(options); + } + function getIndentationForNode(n7, ignoreActualIndentationRange, sourceFile, options) { + const start = sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)); + return getIndentationForNodeWorker( + n7, + start, + ignoreActualIndentationRange, + /*indentationDelta*/ + 0, + sourceFile, + /*isNextChild*/ + false, + options + ); + } + SmartIndenter2.getIndentationForNode = getIndentationForNode; + function getBaseIndentation(options) { + return options.baseIndentSize || 0; + } + SmartIndenter2.getBaseIndentation = getBaseIndentation; + function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, isNextChild, options) { + var _a2; + let parent22 = current.parent; + while (parent22) { + let useActualIndentation = true; + if (ignoreActualIndentationRange) { + const start = current.getStart(sourceFile); + useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; + } + const containingListOrParentStart = getContainingListOrParentStart(parent22, current, sourceFile); + const parentAndChildShareLine = containingListOrParentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent22, current, currentStart.line, sourceFile); + if (useActualIndentation) { + const firstListChild = (_a2 = getContainingList(current, sourceFile)) == null ? void 0 : _a2[0]; + const listIndentsChild = !!firstListChild && getStartLineAndCharacterForNode(firstListChild, sourceFile).line > containingListOrParentStart.line; + let actualIndentation = getActualIndentationForListItem(current, sourceFile, options, listIndentsChild); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + actualIndentation = getActualIndentationForNode(current, parent22, currentStart, parentAndChildShareLine, sourceFile, options); + if (actualIndentation !== -1) { + return actualIndentation + indentationDelta; + } + } + if (shouldIndentChildNode(options, parent22, current, sourceFile, isNextChild) && !parentAndChildShareLine) { + indentationDelta += options.indentSize; + } + const useTrueStart = isArgumentAndStartLineOverlapsExpressionBeingCalled(parent22, current, currentStart.line, sourceFile); + current = parent22; + parent22 = current.parent; + currentStart = useTrueStart ? sourceFile.getLineAndCharacterOfPosition(current.getStart(sourceFile)) : containingListOrParentStart; + } + return indentationDelta + getBaseIndentation(options); + } + function getContainingListOrParentStart(parent22, child, sourceFile) { + const containingList = getContainingList(child, sourceFile); + const startPos = containingList ? containingList.pos : parent22.getStart(sourceFile); + return sourceFile.getLineAndCharacterOfPosition(startPos); + } + function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { + const commaItemInfo = findListItemInfo(commaToken); + if (commaItemInfo && commaItemInfo.listItemIndex > 0) { + return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); + } else { + return -1; + } + } + function getActualIndentationForNode(current, parent22, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { + const useActualIndentation = (isDeclaration(current) || isStatementButNotDeclaration(current)) && (parent22.kind === 312 || !parentAndChildShareLine); + if (!useActualIndentation) { + return -1; + } + return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); + } + let NextTokenKind; + ((NextTokenKind2) => { + NextTokenKind2[NextTokenKind2["Unknown"] = 0] = "Unknown"; + NextTokenKind2[NextTokenKind2["OpenBrace"] = 1] = "OpenBrace"; + NextTokenKind2[NextTokenKind2["CloseBrace"] = 2] = "CloseBrace"; + })(NextTokenKind || (NextTokenKind = {})); + function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { + const nextToken = findNextToken(precedingToken, current, sourceFile); + if (!nextToken) { + return 0; + } + if (nextToken.kind === 19) { + return 1; + } else if (nextToken.kind === 20) { + const nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; + return lineAtPosition === nextTokenStartLine ? 2 : 0; + } + return 0; + } + function getStartLineAndCharacterForNode(n7, sourceFile) { + return sourceFile.getLineAndCharacterOfPosition(n7.getStart(sourceFile)); + } + function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent22, child, childStartLine, sourceFile) { + if (!(isCallExpression(parent22) && contains2(parent22.arguments, child))) { + return false; + } + const expressionOfCallExpressionEnd = parent22.expression.getEnd(); + const expressionOfCallExpressionEndLine = getLineAndCharacterOfPosition(sourceFile, expressionOfCallExpressionEnd).line; + return expressionOfCallExpressionEndLine === childStartLine; + } + SmartIndenter2.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; + function childStartsOnTheSameLineWithElseInIfStatement(parent22, child, childStartLine, sourceFile) { + if (parent22.kind === 245 && parent22.elseStatement === child) { + const elseKeyword = findChildOfKind(parent22, 93, sourceFile); + Debug.assert(elseKeyword !== void 0); + const elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; + return elseKeywordStartLine === childStartLine; + } + return false; + } + SmartIndenter2.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; + function childIsUnindentedBranchOfConditionalExpression(parent22, child, childStartLine, sourceFile) { + if (isConditionalExpression(parent22) && (child === parent22.whenTrue || child === parent22.whenFalse)) { + const conditionEndLine = getLineAndCharacterOfPosition(sourceFile, parent22.condition.end).line; + if (child === parent22.whenTrue) { + return childStartLine === conditionEndLine; + } else { + const trueStartLine = getStartLineAndCharacterForNode(parent22.whenTrue, sourceFile).line; + const trueEndLine = getLineAndCharacterOfPosition(sourceFile, parent22.whenTrue.end).line; + return conditionEndLine === trueStartLine && trueEndLine === childStartLine; + } + } + return false; + } + SmartIndenter2.childIsUnindentedBranchOfConditionalExpression = childIsUnindentedBranchOfConditionalExpression; + function argumentStartsOnSameLineAsPreviousArgument(parent22, child, childStartLine, sourceFile) { + if (isCallOrNewExpression(parent22)) { + if (!parent22.arguments) + return false; + const currentNode = find2(parent22.arguments, (arg) => arg.pos === child.pos); + if (!currentNode) + return false; + const currentIndex = parent22.arguments.indexOf(currentNode); + if (currentIndex === 0) + return false; + const previousNode = parent22.arguments[currentIndex - 1]; + const lineOfPreviousNode = getLineAndCharacterOfPosition(sourceFile, previousNode.getEnd()).line; + if (childStartLine === lineOfPreviousNode) { + return true; + } + } + return false; + } + SmartIndenter2.argumentStartsOnSameLineAsPreviousArgument = argumentStartsOnSameLineAsPreviousArgument; + function getContainingList(node, sourceFile) { + return node.parent && getListByRange(node.getStart(sourceFile), node.getEnd(), node.parent, sourceFile); + } + SmartIndenter2.getContainingList = getContainingList; + function getListByPosition(pos, node, sourceFile) { + return node && getListByRange(pos, pos, node, sourceFile); + } + function getListByRange(start, end, node, sourceFile) { + switch (node.kind) { + case 183: + return getList(node.typeArguments); + case 210: + return getList(node.properties); + case 209: + return getList(node.elements); + case 187: + return getList(node.members); + case 262: + case 218: + case 219: + case 174: + case 173: + case 179: + case 176: + case 185: + case 180: + return getList(node.typeParameters) || getList(node.parameters); + case 177: + return getList(node.parameters); + case 263: + case 231: + case 264: + case 265: + case 352: + return getList(node.typeParameters); + case 214: + case 213: + return getList(node.typeArguments) || getList(node.arguments); + case 261: + return getList(node.declarations); + case 275: + case 279: + return getList(node.elements); + case 206: + case 207: + return getList(node.elements); + } + function getList(list) { + return list && rangeContainsStartEnd(getVisualListRange(node, list, sourceFile), start, end) ? list : void 0; + } + } + function getVisualListRange(node, list, sourceFile) { + const children = node.getChildren(sourceFile); + for (let i7 = 1; i7 < children.length - 1; i7++) { + if (children[i7].pos === list.pos && children[i7].end === list.end) { + return { pos: children[i7 - 1].end, end: children[i7 + 1].getStart(sourceFile) }; + } + } + return list; + } + function getActualIndentationForListStartLine(list, sourceFile, options) { + if (!list) { + return -1; + } + return findColumnForFirstNonWhitespaceCharacterInLine(sourceFile.getLineAndCharacterOfPosition(list.pos), sourceFile, options); + } + function getActualIndentationForListItem(node, sourceFile, options, listIndentsChild) { + if (node.parent && node.parent.kind === 261) { + return -1; + } + const containingList = getContainingList(node, sourceFile); + if (containingList) { + const index4 = containingList.indexOf(node); + if (index4 !== -1) { + const result2 = deriveActualIndentationFromList(containingList, index4, sourceFile, options); + if (result2 !== -1) { + return result2; + } + } + return getActualIndentationForListStartLine(containingList, sourceFile, options) + (listIndentsChild ? options.indentSize : 0); + } + return -1; + } + function deriveActualIndentationFromList(list, index4, sourceFile, options) { + Debug.assert(index4 >= 0 && index4 < list.length); + const node = list[index4]; + let lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); + for (let i7 = index4 - 1; i7 >= 0; i7--) { + if (list[i7].kind === 28) { + continue; + } + const prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i7].end).line; + if (prevEndLine !== lineAndCharacter.line) { + return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); + } + lineAndCharacter = getStartLineAndCharacterForNode(list[i7], sourceFile); + } + return -1; + } + function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { + const lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); + return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); + } + function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { + let character = 0; + let column = 0; + for (let pos = startPos; pos < endPos; pos++) { + const ch = sourceFile.text.charCodeAt(pos); + if (!isWhiteSpaceSingleLine(ch)) { + break; + } + if (ch === 9) { + column += options.tabSize + column % options.tabSize; + } else { + column++; + } + character++; + } + return { column, character }; + } + SmartIndenter2.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; + function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { + return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column; + } + SmartIndenter2.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; + function nodeWillIndentChild(settings, parent22, child, sourceFile, indentByDefault) { + const childKind = child ? child.kind : 0; + switch (parent22.kind) { + case 244: + case 263: + case 231: + case 264: + case 266: + case 265: + case 209: + case 241: + case 268: + case 210: + case 187: + case 200: + case 189: + case 217: + case 211: + case 213: + case 214: + case 243: + case 277: + case 253: + case 227: + case 207: + case 206: + case 286: + case 289: + case 285: + case 294: + case 173: + case 179: + case 180: + case 169: + case 184: + case 185: + case 196: + case 215: + case 223: + case 279: + case 275: + case 281: + case 276: + case 172: + case 296: + case 297: + return true; + case 269: + return settings.indentSwitchCase ?? true; + case 260: + case 303: + case 226: + if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === 210) { + return rangeIsOnOneLine(sourceFile, child); + } + if (parent22.kind === 226 && sourceFile && child && childKind === 284) { + const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent22.pos)).line; + const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line; + return parentStartLine !== childStartLine; + } + if (parent22.kind !== 226) { + return true; + } + break; + case 246: + case 247: + case 249: + case 250: + case 248: + case 245: + case 262: + case 218: + case 174: + case 176: + case 177: + case 178: + return childKind !== 241; + case 219: + if (sourceFile && childKind === 217) { + return rangeIsOnOneLine(sourceFile, child); + } + return childKind !== 241; + case 278: + return childKind !== 279; + case 272: + return childKind !== 273 || !!child.namedBindings && child.namedBindings.kind !== 275; + case 284: + return childKind !== 287; + case 288: + return childKind !== 290; + case 193: + case 192: + if (childKind === 187 || childKind === 189) { + return false; + } + break; + } + return indentByDefault; + } + SmartIndenter2.nodeWillIndentChild = nodeWillIndentChild; + function isControlFlowEndingStatement(kind, parent22) { + switch (kind) { + case 253: + case 257: + case 251: + case 252: + return parent22.kind !== 241; + default: + return false; + } + } + function shouldIndentChildNode(settings, parent22, child, sourceFile, isNextChild = false) { + return nodeWillIndentChild( + settings, + parent22, + child, + sourceFile, + /*indentByDefault*/ + false + ) && !(isNextChild && child && isControlFlowEndingStatement(child.kind, parent22)); + } + SmartIndenter2.shouldIndentChildNode = shouldIndentChildNode; + function rangeIsOnOneLine(sourceFile, range2) { + const rangeStart = skipTrivia(sourceFile.text, range2.pos); + const startLine = sourceFile.getLineAndCharacterOfPosition(rangeStart).line; + const endLine = sourceFile.getLineAndCharacterOfPosition(range2.end).line; + return startLine === endLine; + } + })(SmartIndenter || (SmartIndenter = {})); + } + }); + var ts_formatting_exports = {}; + __export2(ts_formatting_exports, { + FormattingContext: () => FormattingContext, + FormattingRequestKind: () => FormattingRequestKind, + RuleAction: () => RuleAction, + RuleFlags: () => RuleFlags, + SmartIndenter: () => SmartIndenter, + anyContext: () => anyContext, + createTextRangeWithKind: () => createTextRangeWithKind, + formatDocument: () => formatDocument, + formatNodeGivenIndentation: () => formatNodeGivenIndentation, + formatOnClosingCurly: () => formatOnClosingCurly, + formatOnEnter: () => formatOnEnter, + formatOnOpeningCurly: () => formatOnOpeningCurly, + formatOnSemicolon: () => formatOnSemicolon, + formatSelection: () => formatSelection, + getAllRules: () => getAllRules, + getFormatContext: () => getFormatContext, + getFormattingScanner: () => getFormattingScanner, + getIndentationString: () => getIndentationString, + getRangeOfEnclosingComment: () => getRangeOfEnclosingComment + }); + var init_ts_formatting = __esm2({ + "src/services/_namespaces/ts.formatting.ts"() { + "use strict"; + init_formattingContext(); + init_formattingScanner(); + init_rule(); + init_rules(); + init_rulesMap(); + init_formatting(); + init_smartIndenter(); + } + }); + var init_ts4 = __esm2({ + "src/services/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_types3(); + init_utilities4(); + init_exportInfoMap(); + init_classifier(); + init_documentHighlights(); + init_documentRegistry(); + init_getEditsForFileRename(); + init_patternMatcher(); + init_preProcess(); + init_sourcemaps(); + init_suggestionDiagnostics(); + init_transpile(); + init_services(); + init_transform2(); + init_ts_BreakpointResolver(); + init_ts_CallHierarchy(); + init_ts_classifier(); + init_ts_codefix(); + init_ts_Completions(); + init_ts_FindAllReferences(); + init_ts_GoToDefinition(); + init_ts_InlayHints(); + init_ts_JsDoc(); + init_ts_NavigateTo(); + init_ts_NavigationBar(); + init_ts_OrganizeImports(); + init_ts_OutliningElementsCollector(); + init_ts_refactor(); + init_ts_Rename(); + init_ts_SignatureHelp(); + init_ts_SmartSelectionRange(); + init_ts_SymbolDisplay(); + init_ts_textChanges(); + init_ts_formatting(); + } + }); + function getTypeScriptVersion() { + return typeScriptVersion2 ?? (typeScriptVersion2 = new Version(version5)); + } + function formatDeprecationMessage(name2, error22, errorAfter, since, message) { + let deprecationMessage = error22 ? "DeprecationError: " : "DeprecationWarning: "; + deprecationMessage += `'${name2}' `; + deprecationMessage += since ? `has been deprecated since v${since}` : "is deprecated"; + deprecationMessage += error22 ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : "."; + deprecationMessage += message ? ` ${formatStringFromArgs(message, [name2])}` : ""; + return deprecationMessage; + } + function createErrorDeprecation(name2, errorAfter, since, message) { + const deprecationMessage = formatDeprecationMessage( + name2, + /*error*/ + true, + errorAfter, + since, + message + ); + return () => { + throw new TypeError(deprecationMessage); + }; + } + function createWarningDeprecation(name2, errorAfter, since, message) { + let hasWrittenDeprecation = false; + return () => { + if (enableDeprecationWarnings && !hasWrittenDeprecation) { + Debug.log.warn(formatDeprecationMessage( + name2, + /*error*/ + false, + errorAfter, + since, + message + )); + hasWrittenDeprecation = true; + } + }; + } + function createDeprecation(name2, options = {}) { + const version22 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : options.typeScriptVersion ?? getTypeScriptVersion(); + const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; + const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; + const since = typeof options.since === "string" ? new Version(options.since) : options.since ?? warnAfter; + const error22 = options.error || errorAfter && version22.compareTo(errorAfter) >= 0; + const warn3 = !warnAfter || version22.compareTo(warnAfter) >= 0; + return error22 ? createErrorDeprecation(name2, errorAfter, since, options.message) : warn3 ? createWarningDeprecation(name2, errorAfter, since, options.message) : noop4; + } + function wrapFunction(deprecation, func) { + return function() { + deprecation(); + return func.apply(this, arguments); + }; + } + function deprecate2(func, options) { + const deprecation = createDeprecation((options == null ? void 0 : options.name) ?? Debug.getFunctionName(func), options); + return wrapFunction(deprecation, func); + } + var enableDeprecationWarnings, typeScriptVersion2; + var init_deprecate = __esm2({ + "src/deprecatedCompat/deprecate.ts"() { + "use strict"; + init_ts5(); + enableDeprecationWarnings = true; + } + }); + function createOverload(name2, overloads, binder2, deprecations) { + Object.defineProperty(call, "name", { ...Object.getOwnPropertyDescriptor(call, "name"), value: name2 }); + if (deprecations) { + for (const key of Object.keys(deprecations)) { + const index4 = +key; + if (!isNaN(index4) && hasProperty(overloads, `${index4}`)) { + overloads[index4] = deprecate2(overloads[index4], { ...deprecations[index4], name: name2 }); + } + } + } + const bind2 = createBinder2(overloads, binder2); + return call; + function call(...args) { + const index4 = bind2(args); + const fn = index4 !== void 0 ? overloads[index4] : void 0; + if (typeof fn === "function") { + return fn(...args); + } + throw new TypeError("Invalid arguments"); + } + } + function createBinder2(overloads, binder2) { + return (args) => { + for (let i7 = 0; hasProperty(overloads, `${i7}`) && hasProperty(binder2, `${i7}`); i7++) { + const fn = binder2[i7]; + if (fn(args)) { + return i7; + } + } + }; + } + function buildOverload(name2) { + return { + overload: (overloads) => ({ + bind: (binder2) => ({ + finish: () => createOverload(name2, overloads, binder2), + deprecate: (deprecations) => ({ + finish: () => createOverload(name2, overloads, binder2, deprecations) + }) + }) + }) + }; + } + var init_deprecations = __esm2({ + "src/deprecatedCompat/deprecations.ts"() { + "use strict"; + init_ts5(); + init_deprecate(); + } + }); + var init_identifierProperties = __esm2({ + "src/deprecatedCompat/5.0/identifierProperties.ts"() { + "use strict"; + init_ts5(); + init_deprecate(); + addObjectAllocatorPatcher((objectAllocator2) => { + const Identifier79 = objectAllocator2.getIdentifierConstructor(); + if (!hasProperty(Identifier79.prototype, "originalKeywordKind")) { + Object.defineProperty(Identifier79.prototype, "originalKeywordKind", { + get: deprecate2(function() { + return identifierToKeywordKind(this); + }, { + name: "originalKeywordKind", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use 'identifierToKeywordKind(identifier)' instead." + }) + }); + } + if (!hasProperty(Identifier79.prototype, "isInJSDocNamespace")) { + Object.defineProperty(Identifier79.prototype, "isInJSDocNamespace", { + get: deprecate2(function() { + return this.flags & 4096 ? true : void 0; + }, { + name: "isInJSDocNamespace", + since: "5.0", + warnAfter: "5.1", + errorAfter: "5.2", + message: "Use '.parent' or the surrounding context to determine this instead." + }) + }); + } + }); + } + }); + var init_ts5 = __esm2({ + "src/deprecatedCompat/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_deprecations(); + init_identifierProperties(); + } + }); + var init_ts6 = __esm2({ + "src/typingsInstallerCore/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_ts_server2(); + } + }); + function typingToFileName(cachePath, packageName, installTypingHost, log3) { + try { + const result2 = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { + moduleResolution: 2 + /* Node10 */ + }, installTypingHost); + return result2.resolvedModule && result2.resolvedModule.resolvedFileName; + } catch (e10) { + if (log3.isEnabled()) { + log3.writeLine(`Failed to resolve ${packageName} in folder '${cachePath}': ${e10.message}`); + } + return void 0; + } + } + function installNpmPackages(npmPath, tsVersion, packageNames, install) { + let hasError = false; + for (let remaining = packageNames.length; remaining > 0; ) { + const result2 = getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining); + remaining = result2.remaining; + hasError = install(result2.command) || hasError; + } + return hasError; + } + function getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining) { + const sliceStart = packageNames.length - remaining; + let command, toSlice = remaining; + while (true) { + command = `${npmPath} install --ignore-scripts ${(toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ")} --save-dev --user-agent="typesInstaller/${tsVersion}"`; + if (command.length < 8e3) { + break; + } + toSlice = toSlice - Math.floor(toSlice / 2); + } + return { command, remaining: remaining - toSlice }; + } + function typingsName(packageName) { + return `@types/${packageName}@ts${versionMajorMinor}`; + } + var nullLog, TypingsInstaller; + var init_typingsInstaller = __esm2({ + "src/typingsInstallerCore/typingsInstaller.ts"() { + "use strict"; + init_ts6(); + init_ts_server2(); + nullLog = { + isEnabled: () => false, + writeLine: noop4 + }; + TypingsInstaller = class { + constructor(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log3 = nullLog) { + this.installTypingHost = installTypingHost; + this.globalCachePath = globalCachePath; + this.safeListPath = safeListPath; + this.typesMapLocation = typesMapLocation; + this.throttleLimit = throttleLimit; + this.log = log3; + this.packageNameToTypingLocation = /* @__PURE__ */ new Map(); + this.missingTypingsSet = /* @__PURE__ */ new Set(); + this.knownCachesSet = /* @__PURE__ */ new Set(); + this.projectWatchers = /* @__PURE__ */ new Map(); + this.pendingRunRequests = []; + this.installRunCount = 1; + this.inFlightRequestCount = 0; + this.latestDistTag = "latest"; + const isLoggingEnabled = this.log.isEnabled(); + if (isLoggingEnabled) { + this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); + } + this.processCacheLocation(this.globalCachePath); + } + /** @internal */ + handleRequest(req) { + switch (req.kind) { + case "discover": + this.install(req); + break; + case "closeProject": + this.closeProject(req); + break; + case "typesRegistry": { + const typesRegistry = {}; + this.typesRegistry.forEach((value2, key) => { + typesRegistry[key] = value2; + }); + const response = { kind: EventTypesRegistry, typesRegistry }; + this.sendResponse(response); + break; + } + case "installPackage": { + this.installPackage(req); + break; + } + default: + Debug.assertNever(req); + } + } + closeProject(req) { + this.closeWatchers(req.projectName); + } + closeWatchers(projectName) { + if (this.log.isEnabled()) { + this.log.writeLine(`Closing file watchers for project '${projectName}'`); + } + const watchers = this.projectWatchers.get(projectName); + if (!watchers) { + if (this.log.isEnabled()) { + this.log.writeLine(`No watchers are registered for project '${projectName}'`); + } + return; + } + this.projectWatchers.delete(projectName); + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files: [] }); + if (this.log.isEnabled()) { + this.log.writeLine(`Closing file watchers for project '${projectName}' - done.`); + } + } + install(req) { + if (this.log.isEnabled()) { + this.log.writeLine(`Got install request${stringifyIndented(req)}`); + } + if (req.cachePath) { + if (this.log.isEnabled()) { + this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); + } + this.processCacheLocation(req.cachePath); + } + if (this.safeList === void 0) { + this.initializeSafeList(); + } + const discoverTypingsResult = ts_JsTyping_exports.discoverTypings( + this.installTypingHost, + this.log.isEnabled() ? (s7) => this.log.writeLine(s7) : void 0, + req.fileNames, + req.projectRootPath, + this.safeList, + this.packageNameToTypingLocation, + req.typeAcquisition, + req.unresolvedImports, + this.typesRegistry, + req.compilerOptions + ); + this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch); + if (discoverTypingsResult.newTypingNames.length) { + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); + } else { + this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); + if (this.log.isEnabled()) { + this.log.writeLine(`No new typings were requested as a result of typings discovery`); + } + } + } + /** @internal */ + installPackage(req) { + const { fileName, packageName, projectName, projectRootPath, id } = req; + const cwd3 = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => { + if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) { + return directory; + } + }) || projectRootPath; + if (cwd3) { + this.installWorker(-1, [packageName], cwd3, (success) => { + const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`; + const response = { + kind: ActionPackageInstalled, + projectName, + id, + success, + message + }; + this.sendResponse(response); + }); + } else { + const response = { + kind: ActionPackageInstalled, + projectName, + id, + success: false, + message: "Could not determine a project root path." + }; + this.sendResponse(response); + } + } + initializeSafeList() { + if (this.typesMapLocation) { + const safeListFromMap = ts_JsTyping_exports.loadTypesMap(this.installTypingHost, this.typesMapLocation); + if (safeListFromMap) { + this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`); + this.safeList = safeListFromMap; + return; + } + this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`); + } + this.safeList = ts_JsTyping_exports.loadSafeList(this.installTypingHost, this.safeListPath); + } + processCacheLocation(cacheLocation) { + if (this.log.isEnabled()) { + this.log.writeLine(`Processing cache location '${cacheLocation}'`); + } + if (this.knownCachesSet.has(cacheLocation)) { + if (this.log.isEnabled()) { + this.log.writeLine(`Cache location was already processed...`); + } + return; + } + const packageJson = combinePaths(cacheLocation, "package.json"); + const packageLockJson = combinePaths(cacheLocation, "package-lock.json"); + if (this.log.isEnabled()) { + this.log.writeLine(`Trying to find '${packageJson}'...`); + } + if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) { + const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); + const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); + if (this.log.isEnabled()) { + this.log.writeLine(`Loaded content of '${packageJson}':${stringifyIndented(npmConfig)}`); + this.log.writeLine(`Loaded content of '${packageLockJson}':${stringifyIndented(npmLock)}`); + } + if (npmConfig.devDependencies && npmLock.dependencies) { + for (const key in npmConfig.devDependencies) { + if (!hasProperty(npmLock.dependencies, key)) { + continue; + } + const packageName = getBaseFileName(key); + if (!packageName) { + continue; + } + const typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log); + if (!typingFile) { + this.missingTypingsSet.add(packageName); + continue; + } + const existingTypingFile = this.packageNameToTypingLocation.get(packageName); + if (existingTypingFile) { + if (existingTypingFile.typingLocation === typingFile) { + continue; + } + if (this.log.isEnabled()) { + this.log.writeLine(`New typing for package ${packageName} from '${typingFile}' conflicts with existing typing file '${existingTypingFile}'`); + } + } + if (this.log.isEnabled()) { + this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); + } + const info2 = getProperty(npmLock.dependencies, key); + const version22 = info2 && info2.version; + if (!version22) { + continue; + } + const newTyping = { typingLocation: typingFile, version: new Version(version22) }; + this.packageNameToTypingLocation.set(packageName, newTyping); + } + } + } + if (this.log.isEnabled()) { + this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); + } + this.knownCachesSet.add(cacheLocation); + } + filterTypings(typingsToInstall) { + return mapDefined(typingsToInstall, (typing) => { + const typingKey = mangleScopedPackageName(typing); + if (this.missingTypingsSet.has(typingKey)) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: '${typingKey}' is in missingTypingsSet - skipping...`); + return void 0; + } + const validationResult = ts_JsTyping_exports.validatePackageName(typing); + if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) { + this.missingTypingsSet.add(typingKey); + if (this.log.isEnabled()) + this.log.writeLine(ts_JsTyping_exports.renderPackageNameValidationFailure(validationResult, typing)); + return void 0; + } + if (!this.typesRegistry.has(typingKey)) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: Entry for package '${typingKey}' does not exist in local types registry - skipping...`); + return void 0; + } + if (this.packageNameToTypingLocation.get(typingKey) && ts_JsTyping_exports.isTypingUpToDate(this.packageNameToTypingLocation.get(typingKey), this.typesRegistry.get(typingKey))) { + if (this.log.isEnabled()) + this.log.writeLine(`'${typing}':: '${typingKey}' already has an up-to-date typing - skipping...`); + return void 0; + } + return typingKey; + }); + } + ensurePackageDirectoryExists(directory) { + const npmConfigPath = combinePaths(directory, "package.json"); + if (this.log.isEnabled()) { + this.log.writeLine(`Npm config file: ${npmConfigPath}`); + } + if (!this.installTypingHost.fileExists(npmConfigPath)) { + if (this.log.isEnabled()) { + this.log.writeLine(`Npm config file: '${npmConfigPath}' is missing, creating new one...`); + } + this.ensureDirectoryExists(directory, this.installTypingHost); + this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }'); + } + } + installTypings(req, cachePath, currentlyCachedTypings, typingsToInstall) { + if (this.log.isEnabled()) { + this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); + } + const filteredTypings = this.filterTypings(typingsToInstall); + if (filteredTypings.length === 0) { + if (this.log.isEnabled()) { + this.log.writeLine(`All typings are known to be missing or invalid - no need to install more typings`); + } + this.sendResponse(this.createSetTypings(req, currentlyCachedTypings)); + return; + } + this.ensurePackageDirectoryExists(cachePath); + const requestId = this.installRunCount; + this.installRunCount++; + this.sendResponse({ + kind: EventBeginInstallTypes, + eventId: requestId, + typingsInstallerVersion: version5, + projectName: req.projectName + }); + const scopedTypings = filteredTypings.map(typingsName); + this.installTypingsAsync(requestId, scopedTypings, cachePath, (ok2) => { + try { + if (!ok2) { + if (this.log.isEnabled()) { + this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(filteredTypings)}`); + } + for (const typing of filteredTypings) { + this.missingTypingsSet.add(typing); + } + return; + } + if (this.log.isEnabled()) { + this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); + } + const installedTypingFiles = []; + for (const packageName of filteredTypings) { + const typingFile = typingToFileName(cachePath, packageName, this.installTypingHost, this.log); + if (!typingFile) { + this.missingTypingsSet.add(packageName); + continue; + } + const distTags = this.typesRegistry.get(packageName); + const newVersion = new Version(distTags[`ts${versionMajorMinor}`] || distTags[this.latestDistTag]); + const newTyping = { typingLocation: typingFile, version: newVersion }; + this.packageNameToTypingLocation.set(packageName, newTyping); + installedTypingFiles.push(typingFile); + } + if (this.log.isEnabled()) { + this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); + } + this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); + } finally { + const response = { + kind: EventEndInstallTypes, + eventId: requestId, + projectName: req.projectName, + packagesToInstall: scopedTypings, + installSuccess: ok2, + typingsInstallerVersion: version5 + }; + this.sendResponse(response); + } + }); + } + ensureDirectoryExists(directory, host) { + const directoryName = getDirectoryPath(directory); + if (!host.directoryExists(directoryName)) { + this.ensureDirectoryExists(directoryName, host); + } + if (!host.directoryExists(directory)) { + host.createDirectory(directory); + } + } + watchFiles(projectName, files) { + if (!files.length) { + this.closeWatchers(projectName); + return; + } + const existing = this.projectWatchers.get(projectName); + const newSet = new Set(files); + if (!existing || forEachKey(newSet, (s7) => !existing.has(s7)) || forEachKey(existing, (s7) => !newSet.has(s7))) { + this.projectWatchers.set(projectName, newSet); + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files }); + } else { + this.sendResponse({ kind: ActionWatchTypingLocations, projectName, files: void 0 }); + } + } + createSetTypings(request3, typings) { + return { + projectName: request3.projectName, + typeAcquisition: request3.typeAcquisition, + compilerOptions: request3.compilerOptions, + typings, + unresolvedImports: request3.unresolvedImports, + kind: ActionSet + }; + } + installTypingsAsync(requestId, packageNames, cwd3, onRequestCompleted) { + this.pendingRunRequests.unshift({ requestId, packageNames, cwd: cwd3, onRequestCompleted }); + this.executeWithThrottling(); + } + executeWithThrottling() { + while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) { + this.inFlightRequestCount++; + const request3 = this.pendingRunRequests.pop(); + this.installWorker(request3.requestId, request3.packageNames, request3.cwd, (ok2) => { + this.inFlightRequestCount--; + request3.onRequestCompleted(ok2); + this.executeWithThrottling(); + }); + } + } + }; + } + }); + var ts_server_typingsInstaller_exports = {}; + __export2(ts_server_typingsInstaller_exports, { + TypingsInstaller: () => TypingsInstaller, + getNpmCommandForInstallation: () => getNpmCommandForInstallation, + installNpmPackages: () => installNpmPackages, + typingsName: () => typingsName + }); + var init_ts_server_typingsInstaller = __esm2({ + "src/typingsInstallerCore/_namespaces/ts.server.typingsInstaller.ts"() { + "use strict"; + init_typingsInstaller(); + } + }); + var init_ts_server2 = __esm2({ + "src/typingsInstallerCore/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server_typingsInstaller(); + } + }); + var init_types4 = __esm2({ + "src/server/types.ts"() { + "use strict"; + } + }); + function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { + return { + projectName: project.getProjectName(), + fileNames: project.getFileNames( + /*excludeFilesFromExternalLibraries*/ + true, + /*excludeConfigFiles*/ + true + ).concat(project.getExcludedFiles()), + compilerOptions: project.getCompilationSettings(), + typeAcquisition, + unresolvedImports, + projectRootPath: project.getCurrentDirectory(), + cachePath, + kind: "discover" + }; + } + function toNormalizedPath(fileName) { + return normalizePath(fileName); + } + function normalizedPathToPath(normalizedPath, currentDirectory, getCanonicalFileName) { + const f8 = isRootedDiskPath(normalizedPath) ? normalizedPath : getNormalizedAbsolutePath(normalizedPath, currentDirectory); + return getCanonicalFileName(f8); + } + function asNormalizedPath(fileName) { + return fileName; + } + function createNormalizedPathMap() { + const map22 = /* @__PURE__ */ new Map(); + return { + get(path2) { + return map22.get(path2); + }, + set(path2, value2) { + map22.set(path2, value2); + }, + contains(path2) { + return map22.has(path2); + }, + remove(path2) { + map22.delete(path2); + } + }; + } + function isInferredProjectName(name2) { + return /dev\/null\/inferredProject\d+\*/.test(name2); + } + function makeInferredProjectName(counter) { + return `/dev/null/inferredProject${counter}*`; + } + function makeAutoImportProviderProjectName(counter) { + return `/dev/null/autoImportProviderProject${counter}*`; + } + function makeAuxiliaryProjectName(counter) { + return `/dev/null/auxiliaryProject${counter}*`; + } + function createSortedArray2() { + return []; + } + var LogLevel2, emptyArray2, Msg, Errors; + var init_utilitiesPublic3 = __esm2({ + "src/server/utilitiesPublic.ts"() { + "use strict"; + init_ts7(); + LogLevel2 = /* @__PURE__ */ ((LogLevel3) => { + LogLevel3[LogLevel3["terse"] = 0] = "terse"; + LogLevel3[LogLevel3["normal"] = 1] = "normal"; + LogLevel3[LogLevel3["requestTime"] = 2] = "requestTime"; + LogLevel3[LogLevel3["verbose"] = 3] = "verbose"; + return LogLevel3; + })(LogLevel2 || {}); + emptyArray2 = createSortedArray2(); + Msg = /* @__PURE__ */ ((Msg2) => { + Msg2["Err"] = "Err"; + Msg2["Info"] = "Info"; + Msg2["Perf"] = "Perf"; + return Msg2; + })(Msg || {}); + ((Errors2) => { + function ThrowNoProject() { + throw new Error("No Project."); + } + Errors2.ThrowNoProject = ThrowNoProject; + function ThrowProjectLanguageServiceDisabled() { + throw new Error("The project's language service is disabled."); + } + Errors2.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled; + function ThrowProjectDoesNotContainDocument(fileName, project) { + throw new Error(`Project '${project.getProjectName()}' does not contain document '${fileName}'`); + } + Errors2.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument; + })(Errors || (Errors = {})); + } + }); + function getBaseConfigFileName(configFilePath) { + const base = getBaseFileName(configFilePath); + return base === "tsconfig.json" || base === "jsconfig.json" ? base : void 0; + } + function removeSorted(array, remove2, compare) { + if (!array || array.length === 0) { + return; + } + if (array[0] === remove2) { + array.splice(0, 1); + return; + } + const removeIndex = binarySearch(array, remove2, identity2, compare); + if (removeIndex >= 0) { + array.splice(removeIndex, 1); + } + } + var ThrottledOperations, GcTimer; + var init_utilities5 = __esm2({ + "src/server/utilities.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + ThrottledOperations = class _ThrottledOperations { + constructor(host, logger) { + this.host = host; + this.pendingTimeouts = /* @__PURE__ */ new Map(); + this.logger = logger.hasLevel( + 3 + /* verbose */ + ) ? logger : void 0; + } + /** + * Wait `number` milliseconds and then invoke `cb`. If, while waiting, schedule + * is called again with the same `operationId`, cancel this operation in favor + * of the new one. (Note that the amount of time the canceled operation had been + * waiting does not affect the amount of time that the new operation waits.) + */ + schedule(operationId, delay2, cb) { + const pendingTimeout = this.pendingTimeouts.get(operationId); + if (pendingTimeout) { + this.host.clearTimeout(pendingTimeout); + } + this.pendingTimeouts.set(operationId, this.host.setTimeout(_ThrottledOperations.run, delay2, operationId, this, cb)); + if (this.logger) { + this.logger.info(`Scheduled: ${operationId}${pendingTimeout ? ", Cancelled earlier one" : ""}`); + } + } + cancel(operationId) { + const pendingTimeout = this.pendingTimeouts.get(operationId); + if (!pendingTimeout) + return false; + this.host.clearTimeout(pendingTimeout); + return this.pendingTimeouts.delete(operationId); + } + static run(operationId, self2, cb) { + var _a2, _b; + (_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation(operationId); + self2.pendingTimeouts.delete(operationId); + if (self2.logger) { + self2.logger.info(`Running: ${operationId}`); + } + cb(); + (_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation(); + } + }; + GcTimer = class _GcTimer { + constructor(host, delay2, logger) { + this.host = host; + this.delay = delay2; + this.logger = logger; + } + scheduleCollect() { + if (!this.host.gc || this.timerId !== void 0) { + return; + } + this.timerId = this.host.setTimeout(_GcTimer.run, this.delay, this); + } + static run(self2) { + var _a2, _b; + self2.timerId = void 0; + (_a2 = perfLogger) == null ? void 0 : _a2.logStartScheduledOperation("GC collect"); + const log3 = self2.logger.hasLevel( + 2 + /* requestTime */ + ); + const before2 = log3 && self2.host.getMemoryUsage(); + self2.host.gc(); + if (log3) { + const after2 = self2.host.getMemoryUsage(); + self2.logger.perftrc(`GC::before ${before2}, after ${after2}`); + } + (_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation(); + } + }; + } + }); + var CommandTypes, OrganizeImportsMode2, WatchFileKind2, WatchDirectoryKind2, PollingWatchKind2, CompletionTriggerKind2, IndentStyle2, SemicolonPreference2, JsxEmit2, ModuleKind2, ModuleResolutionKind2, NewLineKind2, ScriptTarget10, ClassificationType2; + var init_protocol = __esm2({ + "src/server/protocol.ts"() { + "use strict"; + CommandTypes = /* @__PURE__ */ ((CommandTypes2) => { + CommandTypes2["JsxClosingTag"] = "jsxClosingTag"; + CommandTypes2["LinkedEditingRange"] = "linkedEditingRange"; + CommandTypes2["Brace"] = "brace"; + CommandTypes2["BraceFull"] = "brace-full"; + CommandTypes2["BraceCompletion"] = "braceCompletion"; + CommandTypes2["GetSpanOfEnclosingComment"] = "getSpanOfEnclosingComment"; + CommandTypes2["Change"] = "change"; + CommandTypes2["Close"] = "close"; + CommandTypes2["Completions"] = "completions"; + CommandTypes2["CompletionInfo"] = "completionInfo"; + CommandTypes2["CompletionsFull"] = "completions-full"; + CommandTypes2["CompletionDetails"] = "completionEntryDetails"; + CommandTypes2["CompletionDetailsFull"] = "completionEntryDetails-full"; + CommandTypes2["CompileOnSaveAffectedFileList"] = "compileOnSaveAffectedFileList"; + CommandTypes2["CompileOnSaveEmitFile"] = "compileOnSaveEmitFile"; + CommandTypes2["Configure"] = "configure"; + CommandTypes2["Definition"] = "definition"; + CommandTypes2["DefinitionFull"] = "definition-full"; + CommandTypes2["DefinitionAndBoundSpan"] = "definitionAndBoundSpan"; + CommandTypes2["DefinitionAndBoundSpanFull"] = "definitionAndBoundSpan-full"; + CommandTypes2["Implementation"] = "implementation"; + CommandTypes2["ImplementationFull"] = "implementation-full"; + CommandTypes2["EmitOutput"] = "emit-output"; + CommandTypes2["Exit"] = "exit"; + CommandTypes2["FileReferences"] = "fileReferences"; + CommandTypes2["FileReferencesFull"] = "fileReferences-full"; + CommandTypes2["Format"] = "format"; + CommandTypes2["Formatonkey"] = "formatonkey"; + CommandTypes2["FormatFull"] = "format-full"; + CommandTypes2["FormatonkeyFull"] = "formatonkey-full"; + CommandTypes2["FormatRangeFull"] = "formatRange-full"; + CommandTypes2["Geterr"] = "geterr"; + CommandTypes2["GeterrForProject"] = "geterrForProject"; + CommandTypes2["SemanticDiagnosticsSync"] = "semanticDiagnosticsSync"; + CommandTypes2["SyntacticDiagnosticsSync"] = "syntacticDiagnosticsSync"; + CommandTypes2["SuggestionDiagnosticsSync"] = "suggestionDiagnosticsSync"; + CommandTypes2["NavBar"] = "navbar"; + CommandTypes2["NavBarFull"] = "navbar-full"; + CommandTypes2["Navto"] = "navto"; + CommandTypes2["NavtoFull"] = "navto-full"; + CommandTypes2["NavTree"] = "navtree"; + CommandTypes2["NavTreeFull"] = "navtree-full"; + CommandTypes2["DocumentHighlights"] = "documentHighlights"; + CommandTypes2["DocumentHighlightsFull"] = "documentHighlights-full"; + CommandTypes2["Open"] = "open"; + CommandTypes2["Quickinfo"] = "quickinfo"; + CommandTypes2["QuickinfoFull"] = "quickinfo-full"; + CommandTypes2["References"] = "references"; + CommandTypes2["ReferencesFull"] = "references-full"; + CommandTypes2["Reload"] = "reload"; + CommandTypes2["Rename"] = "rename"; + CommandTypes2["RenameInfoFull"] = "rename-full"; + CommandTypes2["RenameLocationsFull"] = "renameLocations-full"; + CommandTypes2["Saveto"] = "saveto"; + CommandTypes2["SignatureHelp"] = "signatureHelp"; + CommandTypes2["SignatureHelpFull"] = "signatureHelp-full"; + CommandTypes2["FindSourceDefinition"] = "findSourceDefinition"; + CommandTypes2["Status"] = "status"; + CommandTypes2["TypeDefinition"] = "typeDefinition"; + CommandTypes2["ProjectInfo"] = "projectInfo"; + CommandTypes2["ReloadProjects"] = "reloadProjects"; + CommandTypes2["Unknown"] = "unknown"; + CommandTypes2["OpenExternalProject"] = "openExternalProject"; + CommandTypes2["OpenExternalProjects"] = "openExternalProjects"; + CommandTypes2["CloseExternalProject"] = "closeExternalProject"; + CommandTypes2["SynchronizeProjectList"] = "synchronizeProjectList"; + CommandTypes2["ApplyChangedToOpenFiles"] = "applyChangedToOpenFiles"; + CommandTypes2["UpdateOpen"] = "updateOpen"; + CommandTypes2["EncodedSyntacticClassificationsFull"] = "encodedSyntacticClassifications-full"; + CommandTypes2["EncodedSemanticClassificationsFull"] = "encodedSemanticClassifications-full"; + CommandTypes2["Cleanup"] = "cleanup"; + CommandTypes2["GetOutliningSpans"] = "getOutliningSpans"; + CommandTypes2["GetOutliningSpansFull"] = "outliningSpans"; + CommandTypes2["TodoComments"] = "todoComments"; + CommandTypes2["Indentation"] = "indentation"; + CommandTypes2["DocCommentTemplate"] = "docCommentTemplate"; + CommandTypes2["CompilerOptionsDiagnosticsFull"] = "compilerOptionsDiagnostics-full"; + CommandTypes2["NameOrDottedNameSpan"] = "nameOrDottedNameSpan"; + CommandTypes2["BreakpointStatement"] = "breakpointStatement"; + CommandTypes2["CompilerOptionsForInferredProjects"] = "compilerOptionsForInferredProjects"; + CommandTypes2["GetCodeFixes"] = "getCodeFixes"; + CommandTypes2["GetCodeFixesFull"] = "getCodeFixes-full"; + CommandTypes2["GetCombinedCodeFix"] = "getCombinedCodeFix"; + CommandTypes2["GetCombinedCodeFixFull"] = "getCombinedCodeFix-full"; + CommandTypes2["ApplyCodeActionCommand"] = "applyCodeActionCommand"; + CommandTypes2["GetSupportedCodeFixes"] = "getSupportedCodeFixes"; + CommandTypes2["GetApplicableRefactors"] = "getApplicableRefactors"; + CommandTypes2["GetEditsForRefactor"] = "getEditsForRefactor"; + CommandTypes2["GetMoveToRefactoringFileSuggestions"] = "getMoveToRefactoringFileSuggestions"; + CommandTypes2["GetEditsForRefactorFull"] = "getEditsForRefactor-full"; + CommandTypes2["OrganizeImports"] = "organizeImports"; + CommandTypes2["OrganizeImportsFull"] = "organizeImports-full"; + CommandTypes2["GetEditsForFileRename"] = "getEditsForFileRename"; + CommandTypes2["GetEditsForFileRenameFull"] = "getEditsForFileRename-full"; + CommandTypes2["ConfigurePlugin"] = "configurePlugin"; + CommandTypes2["SelectionRange"] = "selectionRange"; + CommandTypes2["SelectionRangeFull"] = "selectionRange-full"; + CommandTypes2["ToggleLineComment"] = "toggleLineComment"; + CommandTypes2["ToggleLineCommentFull"] = "toggleLineComment-full"; + CommandTypes2["ToggleMultilineComment"] = "toggleMultilineComment"; + CommandTypes2["ToggleMultilineCommentFull"] = "toggleMultilineComment-full"; + CommandTypes2["CommentSelection"] = "commentSelection"; + CommandTypes2["CommentSelectionFull"] = "commentSelection-full"; + CommandTypes2["UncommentSelection"] = "uncommentSelection"; + CommandTypes2["UncommentSelectionFull"] = "uncommentSelection-full"; + CommandTypes2["PrepareCallHierarchy"] = "prepareCallHierarchy"; + CommandTypes2["ProvideCallHierarchyIncomingCalls"] = "provideCallHierarchyIncomingCalls"; + CommandTypes2["ProvideCallHierarchyOutgoingCalls"] = "provideCallHierarchyOutgoingCalls"; + CommandTypes2["ProvideInlayHints"] = "provideInlayHints"; + CommandTypes2["WatchChange"] = "watchChange"; + return CommandTypes2; + })(CommandTypes || {}); + OrganizeImportsMode2 = /* @__PURE__ */ ((OrganizeImportsMode3) => { + OrganizeImportsMode3["All"] = "All"; + OrganizeImportsMode3["SortAndCombine"] = "SortAndCombine"; + OrganizeImportsMode3["RemoveUnused"] = "RemoveUnused"; + return OrganizeImportsMode3; + })(OrganizeImportsMode2 || {}); + WatchFileKind2 = /* @__PURE__ */ ((WatchFileKind3) => { + WatchFileKind3["FixedPollingInterval"] = "FixedPollingInterval"; + WatchFileKind3["PriorityPollingInterval"] = "PriorityPollingInterval"; + WatchFileKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; + WatchFileKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; + WatchFileKind3["UseFsEvents"] = "UseFsEvents"; + WatchFileKind3["UseFsEventsOnParentDirectory"] = "UseFsEventsOnParentDirectory"; + return WatchFileKind3; + })(WatchFileKind2 || {}); + WatchDirectoryKind2 = /* @__PURE__ */ ((WatchDirectoryKind3) => { + WatchDirectoryKind3["UseFsEvents"] = "UseFsEvents"; + WatchDirectoryKind3["FixedPollingInterval"] = "FixedPollingInterval"; + WatchDirectoryKind3["DynamicPriorityPolling"] = "DynamicPriorityPolling"; + WatchDirectoryKind3["FixedChunkSizePolling"] = "FixedChunkSizePolling"; + return WatchDirectoryKind3; + })(WatchDirectoryKind2 || {}); + PollingWatchKind2 = /* @__PURE__ */ ((PollingWatchKind3) => { + PollingWatchKind3["FixedInterval"] = "FixedInterval"; + PollingWatchKind3["PriorityInterval"] = "PriorityInterval"; + PollingWatchKind3["DynamicPriority"] = "DynamicPriority"; + PollingWatchKind3["FixedChunkSize"] = "FixedChunkSize"; + return PollingWatchKind3; + })(PollingWatchKind2 || {}); + CompletionTriggerKind2 = /* @__PURE__ */ ((CompletionTriggerKind4) => { + CompletionTriggerKind4[CompletionTriggerKind4["Invoked"] = 1] = "Invoked"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerCharacter"] = 2] = "TriggerCharacter"; + CompletionTriggerKind4[CompletionTriggerKind4["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions"; + return CompletionTriggerKind4; + })(CompletionTriggerKind2 || {}); + IndentStyle2 = /* @__PURE__ */ ((IndentStyle3) => { + IndentStyle3["None"] = "None"; + IndentStyle3["Block"] = "Block"; + IndentStyle3["Smart"] = "Smart"; + return IndentStyle3; + })(IndentStyle2 || {}); + SemicolonPreference2 = /* @__PURE__ */ ((SemicolonPreference3) => { + SemicolonPreference3["Ignore"] = "ignore"; + SemicolonPreference3["Insert"] = "insert"; + SemicolonPreference3["Remove"] = "remove"; + return SemicolonPreference3; + })(SemicolonPreference2 || {}); + JsxEmit2 = /* @__PURE__ */ ((JsxEmit3) => { + JsxEmit3["None"] = "None"; + JsxEmit3["Preserve"] = "Preserve"; + JsxEmit3["ReactNative"] = "ReactNative"; + JsxEmit3["React"] = "React"; + return JsxEmit3; + })(JsxEmit2 || {}); + ModuleKind2 = /* @__PURE__ */ ((ModuleKind3) => { + ModuleKind3["None"] = "None"; + ModuleKind3["CommonJS"] = "CommonJS"; + ModuleKind3["AMD"] = "AMD"; + ModuleKind3["UMD"] = "UMD"; + ModuleKind3["System"] = "System"; + ModuleKind3["ES6"] = "ES6"; + ModuleKind3["ES2015"] = "ES2015"; + ModuleKind3["ESNext"] = "ESNext"; + ModuleKind3["Node16"] = "Node16"; + ModuleKind3["NodeNext"] = "NodeNext"; + ModuleKind3["Preserve"] = "Preserve"; + return ModuleKind3; + })(ModuleKind2 || {}); + ModuleResolutionKind2 = /* @__PURE__ */ ((ModuleResolutionKind3) => { + ModuleResolutionKind3["Classic"] = "Classic"; + ModuleResolutionKind3["Node"] = "Node"; + ModuleResolutionKind3["Node10"] = "Node10"; + ModuleResolutionKind3["Node16"] = "Node16"; + ModuleResolutionKind3["NodeNext"] = "NodeNext"; + ModuleResolutionKind3["Bundler"] = "Bundler"; + return ModuleResolutionKind3; + })(ModuleResolutionKind2 || {}); + NewLineKind2 = /* @__PURE__ */ ((NewLineKind3) => { + NewLineKind3["Crlf"] = "Crlf"; + NewLineKind3["Lf"] = "Lf"; + return NewLineKind3; + })(NewLineKind2 || {}); + ScriptTarget10 = /* @__PURE__ */ ((ScriptTarget11) => { + ScriptTarget11["ES3"] = "ES3"; + ScriptTarget11["ES5"] = "ES5"; + ScriptTarget11["ES6"] = "ES6"; + ScriptTarget11["ES2015"] = "ES2015"; + ScriptTarget11["ES2016"] = "ES2016"; + ScriptTarget11["ES2017"] = "ES2017"; + ScriptTarget11["ES2018"] = "ES2018"; + ScriptTarget11["ES2019"] = "ES2019"; + ScriptTarget11["ES2020"] = "ES2020"; + ScriptTarget11["ES2021"] = "ES2021"; + ScriptTarget11["ES2022"] = "ES2022"; + ScriptTarget11["ESNext"] = "ESNext"; + return ScriptTarget11; + })(ScriptTarget10 || {}); + ClassificationType2 = /* @__PURE__ */ ((ClassificationType3) => { + ClassificationType3[ClassificationType3["comment"] = 1] = "comment"; + ClassificationType3[ClassificationType3["identifier"] = 2] = "identifier"; + ClassificationType3[ClassificationType3["keyword"] = 3] = "keyword"; + ClassificationType3[ClassificationType3["numericLiteral"] = 4] = "numericLiteral"; + ClassificationType3[ClassificationType3["operator"] = 5] = "operator"; + ClassificationType3[ClassificationType3["stringLiteral"] = 6] = "stringLiteral"; + ClassificationType3[ClassificationType3["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; + ClassificationType3[ClassificationType3["whiteSpace"] = 8] = "whiteSpace"; + ClassificationType3[ClassificationType3["text"] = 9] = "text"; + ClassificationType3[ClassificationType3["punctuation"] = 10] = "punctuation"; + ClassificationType3[ClassificationType3["className"] = 11] = "className"; + ClassificationType3[ClassificationType3["enumName"] = 12] = "enumName"; + ClassificationType3[ClassificationType3["interfaceName"] = 13] = "interfaceName"; + ClassificationType3[ClassificationType3["moduleName"] = 14] = "moduleName"; + ClassificationType3[ClassificationType3["typeParameterName"] = 15] = "typeParameterName"; + ClassificationType3[ClassificationType3["typeAliasName"] = 16] = "typeAliasName"; + ClassificationType3[ClassificationType3["parameterName"] = 17] = "parameterName"; + ClassificationType3[ClassificationType3["docCommentTagName"] = 18] = "docCommentTagName"; + ClassificationType3[ClassificationType3["jsxOpenTagName"] = 19] = "jsxOpenTagName"; + ClassificationType3[ClassificationType3["jsxCloseTagName"] = 20] = "jsxCloseTagName"; + ClassificationType3[ClassificationType3["jsxSelfClosingTagName"] = 21] = "jsxSelfClosingTagName"; + ClassificationType3[ClassificationType3["jsxAttribute"] = 22] = "jsxAttribute"; + ClassificationType3[ClassificationType3["jsxText"] = 23] = "jsxText"; + ClassificationType3[ClassificationType3["jsxAttributeStringLiteralValue"] = 24] = "jsxAttributeStringLiteralValue"; + ClassificationType3[ClassificationType3["bigintLiteral"] = 25] = "bigintLiteral"; + return ClassificationType3; + })(ClassificationType2 || {}); + } + }); + var ts_server_protocol_exports = {}; + __export2(ts_server_protocol_exports, { + ClassificationType: () => ClassificationType2, + CommandTypes: () => CommandTypes, + CompletionTriggerKind: () => CompletionTriggerKind2, + IndentStyle: () => IndentStyle2, + JsxEmit: () => JsxEmit2, + ModuleKind: () => ModuleKind2, + ModuleResolutionKind: () => ModuleResolutionKind2, + NewLineKind: () => NewLineKind2, + OrganizeImportsMode: () => OrganizeImportsMode2, + PollingWatchKind: () => PollingWatchKind2, + ScriptTarget: () => ScriptTarget10, + SemicolonPreference: () => SemicolonPreference2, + WatchDirectoryKind: () => WatchDirectoryKind2, + WatchFileKind: () => WatchFileKind2 + }); + var init_ts_server_protocol = __esm2({ + "src/server/_namespaces/ts.server.protocol.ts"() { + "use strict"; + init_protocol(); + } + }); + function isDynamicFileName(fileName) { + return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator); + } + function ensurePrimaryProjectKind(project) { + if (!project || isBackgroundProject(project)) { + return Errors.ThrowNoProject(); + } + return project; + } + function failIfInvalidPosition(position) { + Debug.assert(typeof position === "number", `Expected position ${position} to be a number.`); + Debug.assert(position >= 0, `Expected position to be non-negative.`); + } + function failIfInvalidLocation(location2) { + Debug.assert(typeof location2.line === "number", `Expected line ${location2.line} to be a number.`); + Debug.assert(typeof location2.offset === "number", `Expected offset ${location2.offset} to be a number.`); + Debug.assert(location2.line > 0, `Expected line to be non-${location2.line === 0 ? "zero" : "negative"}`); + Debug.assert(location2.offset > 0, `Expected offset to be non-${location2.offset === 0 ? "zero" : "negative"}`); + } + var TextStorage, ScriptInfo; + var init_scriptInfo = __esm2({ + "src/server/scriptInfo.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + TextStorage = class { + constructor(host, info2, initialVersion) { + this.host = host; + this.info = info2; + this.isOpen = false; + this.ownFileText = false; + this.pendingReloadFromDisk = false; + this.version = initialVersion || 0; + } + getVersion() { + return this.svc ? `SVC-${this.version}-${this.svc.getSnapshotVersion()}` : `Text-${this.version}`; + } + hasScriptVersionCache_TestOnly() { + return this.svc !== void 0; + } + resetSourceMapInfo() { + this.info.sourceFileLike = void 0; + this.info.closeSourceMapFileWatcher(); + this.info.sourceMapFilePath = void 0; + this.info.declarationInfoPath = void 0; + this.info.sourceInfos = void 0; + this.info.documentPositionMapper = void 0; + } + /** Public for testing */ + useText(newText) { + this.svc = void 0; + this.text = newText; + this.textSnapshot = void 0; + this.lineMap = void 0; + this.fileSize = void 0; + this.resetSourceMapInfo(); + this.version++; + } + edit(start, end, newText) { + this.switchToScriptVersionCache().edit(start, end - start, newText); + this.ownFileText = false; + this.text = void 0; + this.textSnapshot = void 0; + this.lineMap = void 0; + this.fileSize = void 0; + this.resetSourceMapInfo(); + } + /** + * Set the contents as newText + * returns true if text changed + */ + reload(newText) { + Debug.assert(newText !== void 0); + this.pendingReloadFromDisk = false; + if (!this.text && this.svc) { + this.text = getSnapshotText(this.svc.getSnapshot()); + } + if (this.text !== newText) { + this.useText(newText); + this.ownFileText = false; + return true; + } + return false; + } + /** + * Reads the contents from tempFile(if supplied) or own file and sets it as contents + * returns true if text changed + */ + reloadWithFileText(tempFileName) { + const { text: newText, fileSize } = tempFileName || !this.info.isDynamicOrHasMixedContent() ? this.getFileTextAndSize(tempFileName) : { text: "", fileSize: void 0 }; + const reloaded = this.reload(newText); + this.fileSize = fileSize; + this.ownFileText = !tempFileName || tempFileName === this.info.fileName; + return reloaded; + } + /** + * Schedule reload from the disk if its not already scheduled and its not own text + * returns true when scheduling reload + */ + scheduleReloadIfNeeded() { + return !this.pendingReloadFromDisk && !this.ownFileText ? this.pendingReloadFromDisk = true : false; + } + delayReloadFromFileIntoText() { + this.pendingReloadFromDisk = true; + } + /** + * For telemetry purposes, we would like to be able to report the size of the file. + * However, we do not want telemetry to require extra file I/O so we report a size + * that may be stale (e.g. may not reflect change made on disk since the last reload). + * NB: Will read from disk if the file contents have never been loaded because + * telemetry falsely indicating size 0 would be counter-productive. + */ + getTelemetryFileSize() { + return !!this.fileSize ? this.fileSize : !!this.text ? this.text.length : !!this.svc ? this.svc.getSnapshot().getLength() : this.getSnapshot().getLength(); + } + getSnapshot() { + var _a2; + return ((_a2 = this.tryUseScriptVersionCache()) == null ? void 0 : _a2.getSnapshot()) || (this.textSnapshot ?? (this.textSnapshot = ScriptSnapshot.fromString(Debug.checkDefined(this.text)))); + } + getAbsolutePositionAndLineText(oneBasedLine) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.getAbsolutePositionAndLineText(oneBasedLine); + const lineMap = this.getLineMap(); + return oneBasedLine <= lineMap.length ? { + absolutePosition: lineMap[oneBasedLine - 1], + lineText: this.text.substring(lineMap[oneBasedLine - 1], lineMap[oneBasedLine]) + } : { + absolutePosition: this.text.length, + lineText: void 0 + }; + } + /** + * @param line 0 based index + */ + lineToTextSpan(line) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.lineToTextSpan(line); + const lineMap = this.getLineMap(); + const start = lineMap[line]; + const end = line + 1 < lineMap.length ? lineMap[line + 1] : this.text.length; + return createTextSpanFromBounds(start, end); + } + /** + * @param line 1 based index + * @param offset 1 based index + */ + lineOffsetToPosition(line, offset, allowEdits) { + const svc = this.tryUseScriptVersionCache(); + return svc ? svc.lineOffsetToPosition(line, offset) : computePositionOfLineAndCharacter(this.getLineMap(), line - 1, offset - 1, this.text, allowEdits); + } + positionToLineOffset(position) { + const svc = this.tryUseScriptVersionCache(); + if (svc) + return svc.positionToLineOffset(position); + const { line, character } = computeLineAndCharacterOfPosition(this.getLineMap(), position); + return { line: line + 1, offset: character + 1 }; + } + getFileTextAndSize(tempFileName) { + let text; + const fileName = tempFileName || this.info.fileName; + const getText = () => text === void 0 ? text = this.host.readFile(fileName) || "" : text; + if (!hasTSFileExtension(this.info.fileName)) { + const fileSize = this.host.getFileSize ? this.host.getFileSize(fileName) : getText().length; + if (fileSize > maxFileSize) { + Debug.assert(!!this.info.containingProjects.length); + const service = this.info.containingProjects[0].projectService; + service.logger.info(`Skipped loading contents of large file ${fileName} for info ${this.info.fileName}: fileSize: ${fileSize}`); + this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize); + return { text: "", fileSize }; + } + } + return { text: getText() }; + } + /** @internal */ + switchToScriptVersionCache() { + if (!this.svc || this.pendingReloadFromDisk) { + this.svc = ScriptVersionCache.fromString(this.getOrLoadText()); + this.textSnapshot = void 0; + this.version++; + } + return this.svc; + } + tryUseScriptVersionCache() { + if (!this.svc || this.pendingReloadFromDisk) { + this.getOrLoadText(); + } + if (this.isOpen) { + if (!this.svc && !this.textSnapshot) { + this.svc = ScriptVersionCache.fromString(Debug.checkDefined(this.text)); + this.textSnapshot = void 0; + } + return this.svc; + } + return this.svc; + } + getOrLoadText() { + if (this.text === void 0 || this.pendingReloadFromDisk) { + Debug.assert(!this.svc || this.pendingReloadFromDisk, "ScriptVersionCache should not be set when reloading from disk"); + this.reloadWithFileText(); + } + return this.text; + } + getLineMap() { + Debug.assert(!this.svc, "ScriptVersionCache should not be set"); + return this.lineMap || (this.lineMap = computeLineStarts(Debug.checkDefined(this.text))); + } + getLineInfo() { + const svc = this.tryUseScriptVersionCache(); + if (svc) { + return { + getLineCount: () => svc.getLineCount(), + getLineText: (line) => svc.getAbsolutePositionAndLineText(line + 1).lineText + }; + } + const lineMap = this.getLineMap(); + return getLineInfo(this.text, lineMap); + } + }; + ScriptInfo = class { + constructor(host, fileName, scriptKind, hasMixedContent, path2, initialVersion) { + this.host = host; + this.fileName = fileName; + this.scriptKind = scriptKind; + this.hasMixedContent = hasMixedContent; + this.path = path2; + this.containingProjects = []; + this.isDynamic = isDynamicFileName(fileName); + this.textStorage = new TextStorage(host, this, initialVersion); + if (hasMixedContent || this.isDynamic) { + this.realpath = this.path; + } + this.scriptKind = scriptKind ? scriptKind : getScriptKindFromFileName(fileName); + } + /** @internal */ + isDynamicOrHasMixedContent() { + return this.hasMixedContent || this.isDynamic; + } + isScriptOpen() { + return this.textStorage.isOpen; + } + open(newText) { + this.textStorage.isOpen = true; + if (newText !== void 0 && this.textStorage.reload(newText)) { + this.markContainingProjectsAsDirty(); + } + } + close(fileExists = true) { + this.textStorage.isOpen = false; + if (fileExists && this.textStorage.scheduleReloadIfNeeded()) { + this.markContainingProjectsAsDirty(); + } + } + getSnapshot() { + return this.textStorage.getSnapshot(); + } + ensureRealPath() { + if (this.realpath === void 0) { + this.realpath = this.path; + if (this.host.realpath) { + Debug.assert(!!this.containingProjects.length); + const project = this.containingProjects[0]; + const realpath2 = this.host.realpath(this.path); + if (realpath2) { + this.realpath = project.toPath(realpath2); + if (this.realpath !== this.path) { + project.projectService.realpathToScriptInfos.add(this.realpath, this); + } + } + } + } + } + /** @internal */ + getRealpathIfDifferent() { + return this.realpath && this.realpath !== this.path ? this.realpath : void 0; + } + /** + * @internal + * Does not compute realpath; uses precomputed result. Use `ensureRealPath` + * first if a definite result is needed. + */ + isSymlink() { + return this.realpath && this.realpath !== this.path; + } + getFormatCodeSettings() { + return this.formatSettings; + } + getPreferences() { + return this.preferences; + } + attachToProject(project) { + const isNew = !this.isAttached(project); + if (isNew) { + this.containingProjects.push(project); + if (!project.getCompilerOptions().preserveSymlinks) { + this.ensureRealPath(); + } + project.onFileAddedOrRemoved(this.isSymlink()); + } + return isNew; + } + isAttached(project) { + switch (this.containingProjects.length) { + case 0: + return false; + case 1: + return this.containingProjects[0] === project; + case 2: + return this.containingProjects[0] === project || this.containingProjects[1] === project; + default: + return contains2(this.containingProjects, project); + } + } + detachFromProject(project) { + switch (this.containingProjects.length) { + case 0: + return; + case 1: + if (this.containingProjects[0] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects.pop(); + } + break; + case 2: + if (this.containingProjects[0] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects[0] = this.containingProjects.pop(); + } else if (this.containingProjects[1] === project) { + project.onFileAddedOrRemoved(this.isSymlink()); + this.containingProjects.pop(); + } + break; + default: + if (orderedRemoveItem(this.containingProjects, project)) { + project.onFileAddedOrRemoved(this.isSymlink()); + } + break; + } + } + detachAllProjects() { + for (const p7 of this.containingProjects) { + if (isConfiguredProject(p7)) { + p7.getCachedDirectoryStructureHost().addOrDeleteFile( + this.fileName, + this.path, + 2 + /* Deleted */ + ); + } + const existingRoot = p7.getRootFilesMap().get(this.path); + p7.removeFile( + this, + /*fileExists*/ + false, + /*detachFromProject*/ + false + ); + p7.onFileAddedOrRemoved(this.isSymlink()); + if (existingRoot && !isInferredProject(p7)) { + p7.addMissingFileRoot(existingRoot.fileName); + } + } + clear2(this.containingProjects); + } + getDefaultProject() { + switch (this.containingProjects.length) { + case 0: + return Errors.ThrowNoProject(); + case 1: + return ensurePrimaryProjectKind(this.containingProjects[0]); + default: + let firstExternalProject; + let firstConfiguredProject; + let firstInferredProject; + let firstNonSourceOfProjectReferenceRedirect; + let defaultConfiguredProject; + for (let index4 = 0; index4 < this.containingProjects.length; index4++) { + const project = this.containingProjects[index4]; + if (isConfiguredProject(project)) { + if (!project.isSourceOfProjectReferenceRedirect(this.fileName)) { + if (defaultConfiguredProject === void 0 && index4 !== this.containingProjects.length - 1) { + defaultConfiguredProject = project.projectService.findDefaultConfiguredProject(this) || false; + } + if (defaultConfiguredProject === project) + return project; + if (!firstNonSourceOfProjectReferenceRedirect) + firstNonSourceOfProjectReferenceRedirect = project; + } + if (!firstConfiguredProject) + firstConfiguredProject = project; + } else if (!firstExternalProject && isExternalProject(project)) { + firstExternalProject = project; + } else if (!firstInferredProject && isInferredProject(project)) { + firstInferredProject = project; + } + } + return ensurePrimaryProjectKind( + defaultConfiguredProject || firstNonSourceOfProjectReferenceRedirect || firstConfiguredProject || firstExternalProject || firstInferredProject + ); + } + } + registerFileUpdate() { + for (const p7 of this.containingProjects) { + p7.registerFileUpdate(this.path); + } + } + setOptions(formatSettings, preferences) { + if (formatSettings) { + if (!this.formatSettings) { + this.formatSettings = getDefaultFormatCodeSettings(this.host.newLine); + assign3(this.formatSettings, formatSettings); + } else { + this.formatSettings = { ...this.formatSettings, ...formatSettings }; + } + } + if (preferences) { + if (!this.preferences) { + this.preferences = emptyOptions; + } + this.preferences = { ...this.preferences, ...preferences }; + } + } + getLatestVersion() { + this.textStorage.getSnapshot(); + return this.textStorage.getVersion(); + } + saveTo(fileName) { + this.host.writeFile(fileName, getSnapshotText(this.textStorage.getSnapshot())); + } + /** @internal */ + delayReloadNonMixedContentFile() { + Debug.assert(!this.isDynamicOrHasMixedContent()); + this.textStorage.delayReloadFromFileIntoText(); + this.markContainingProjectsAsDirty(); + } + reloadFromFile(tempFileName) { + if (this.textStorage.reloadWithFileText(tempFileName)) { + this.markContainingProjectsAsDirty(); + return true; + } + return false; + } + editContent(start, end, newText) { + this.textStorage.edit(start, end, newText); + this.markContainingProjectsAsDirty(); + } + markContainingProjectsAsDirty() { + for (const p7 of this.containingProjects) { + p7.markFileAsDirty(this.path); + } + } + isOrphan() { + return !forEach4(this.containingProjects, (p7) => !p7.isOrphan()); + } + /** @internal */ + isContainedByBackgroundProject() { + return some2( + this.containingProjects, + isBackgroundProject + ); + } + /** + * @param line 1 based index + */ + lineToTextSpan(line) { + return this.textStorage.lineToTextSpan(line); + } + // eslint-disable-line @typescript-eslint/unified-signatures + lineOffsetToPosition(line, offset, allowEdits) { + return this.textStorage.lineOffsetToPosition(line, offset, allowEdits); + } + positionToLineOffset(position) { + failIfInvalidPosition(position); + const location2 = this.textStorage.positionToLineOffset(position); + failIfInvalidLocation(location2); + return location2; + } + isJavaScript() { + return this.scriptKind === 1 || this.scriptKind === 2; + } + /** @internal */ + closeSourceMapFileWatcher() { + if (this.sourceMapFilePath && !isString4(this.sourceMapFilePath)) { + closeFileWatcherOf(this.sourceMapFilePath); + this.sourceMapFilePath = void 0; + } + } + }; + } + }); + function setIsEqualTo(arr1, arr2) { + if (arr1 === arr2) { + return true; + } + if ((arr1 || emptyArray2).length === 0 && (arr2 || emptyArray2).length === 0) { + return true; + } + const set4 = /* @__PURE__ */ new Map(); + let unique = 0; + for (const v8 of arr1) { + if (set4.get(v8) !== true) { + set4.set(v8, true); + unique++; + } + } + for (const v8 of arr2) { + const isSet2 = set4.get(v8); + if (isSet2 === void 0) { + return false; + } + if (isSet2 === true) { + set4.set(v8, false); + unique--; + } + } + return unique === 0; + } + function typeAcquisitionChanged(opt1, opt2) { + return opt1.enable !== opt2.enable || !setIsEqualTo(opt1.include, opt2.include) || !setIsEqualTo(opt1.exclude, opt2.exclude); + } + function compilerOptionsChanged(opt1, opt2) { + return getAllowJSCompilerOption(opt1) !== getAllowJSCompilerOption(opt2); + } + function unresolvedImportsChanged(imports1, imports2) { + if (imports1 === imports2) { + return false; + } + return !arrayIsEqualTo(imports1, imports2); + } + var nullTypingsInstaller, TypingsCache; + var init_typingsCache = __esm2({ + "src/server/typingsCache.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + nullTypingsInstaller = { + isKnownTypesPackageName: returnFalse, + // Should never be called because we never provide a types registry. + installPackage: notImplemented, + enqueueInstallTypingsRequest: noop4, + attach: noop4, + onProjectClosed: noop4, + globalTypingsCacheLocation: void 0 + // TODO: GH#18217 + }; + TypingsCache = class { + constructor(installer) { + this.installer = installer; + this.perProjectCache = /* @__PURE__ */ new Map(); + } + isKnownTypesPackageName(name2) { + return this.installer.isKnownTypesPackageName(name2); + } + installPackage(options) { + return this.installer.installPackage(options); + } + enqueueInstallTypingsForProject(project, unresolvedImports, forceRefresh) { + const typeAcquisition = project.getTypeAcquisition(); + if (!typeAcquisition || !typeAcquisition.enable) { + return; + } + const entry = this.perProjectCache.get(project.getProjectName()); + if (forceRefresh || !entry || typeAcquisitionChanged(typeAcquisition, entry.typeAcquisition) || compilerOptionsChanged(project.getCompilationSettings(), entry.compilerOptions) || unresolvedImportsChanged(unresolvedImports, entry.unresolvedImports)) { + this.perProjectCache.set(project.getProjectName(), { + compilerOptions: project.getCompilationSettings(), + typeAcquisition, + typings: entry ? entry.typings : emptyArray2, + unresolvedImports, + poisoned: true + }); + this.installer.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + } + } + updateTypingsForProject(projectName, compilerOptions, typeAcquisition, unresolvedImports, newTypings) { + const typings = sort(newTypings); + this.perProjectCache.set(projectName, { + compilerOptions, + typeAcquisition, + typings, + unresolvedImports, + poisoned: false + }); + return !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : typings; + } + onProjectClosed(project) { + if (this.perProjectCache.delete(project.getProjectName())) { + this.installer.onProjectClosed(project); + } + } + }; + } + }); + function countEachFileTypes(infos, includeSizes = false) { + const result2 = { + js: 0, + jsSize: 0, + jsx: 0, + jsxSize: 0, + ts: 0, + tsSize: 0, + tsx: 0, + tsxSize: 0, + dts: 0, + dtsSize: 0, + deferred: 0, + deferredSize: 0 + }; + for (const info2 of infos) { + const fileSize = includeSizes ? info2.textStorage.getTelemetryFileSize() : 0; + switch (info2.scriptKind) { + case 1: + result2.js += 1; + result2.jsSize += fileSize; + break; + case 2: + result2.jsx += 1; + result2.jsxSize += fileSize; + break; + case 3: + if (isDeclarationFileName(info2.fileName)) { + result2.dts += 1; + result2.dtsSize += fileSize; + } else { + result2.ts += 1; + result2.tsSize += fileSize; + } + break; + case 4: + result2.tsx += 1; + result2.tsxSize += fileSize; + break; + case 7: + result2.deferred += 1; + result2.deferredSize += fileSize; + break; + } + } + return result2; + } + function hasOneOrMoreJsAndNoTsFiles(project) { + const counts2 = countEachFileTypes(project.getScriptInfos()); + return counts2.js > 0 && counts2.ts === 0 && counts2.tsx === 0; + } + function allRootFilesAreJsOrDts(project) { + const counts2 = countEachFileTypes(project.getRootScriptInfos()); + return counts2.ts === 0 && counts2.tsx === 0; + } + function allFilesAreJsOrDts(project) { + const counts2 = countEachFileTypes(project.getScriptInfos()); + return counts2.ts === 0 && counts2.tsx === 0; + } + function hasNoTypeScriptSource(fileNames) { + return !fileNames.some((fileName) => fileExtensionIs( + fileName, + ".ts" + /* Ts */ + ) && !isDeclarationFileName(fileName) || fileExtensionIs( + fileName, + ".tsx" + /* Tsx */ + )); + } + function isGeneratedFileWatcher(watch) { + return watch.generatedFilePath !== void 0; + } + function getUnresolvedImports(program, cachedUnresolvedImportsPerFile) { + var _a2, _b; + const sourceFiles = program.getSourceFiles(); + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "getUnresolvedImports", { count: sourceFiles.length }); + const ambientModules = program.getTypeChecker().getAmbientModules().map((mod2) => stripQuotes(mod2.getName())); + const result2 = sortAndDeduplicate(flatMap2(sourceFiles, (sourceFile) => extractUnresolvedImportsFromSourceFile( + program, + sourceFile, + ambientModules, + cachedUnresolvedImportsPerFile + ))); + (_b = tracing) == null ? void 0 : _b.pop(); + return result2; + } + function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, cachedUnresolvedImportsPerFile) { + return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => { + let unresolvedImports; + program.forEachResolvedModule(({ resolvedModule }, name2) => { + if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name2) && !ambientModules.some((m7) => m7 === name2)) { + unresolvedImports = append(unresolvedImports, parsePackageName(name2).packageName); + } + }, file); + return unresolvedImports || emptyArray2; + }); + } + function isInferredProject(project) { + return project.projectKind === 0; + } + function isConfiguredProject(project) { + return project.projectKind === 1; + } + function isExternalProject(project) { + return project.projectKind === 2; + } + function isBackgroundProject(project) { + return project.projectKind === 3 || project.projectKind === 4; + } + var ProjectKind, Project3, InferredProject2, AuxiliaryProject, _AutoImportProviderProject, AutoImportProviderProject, ConfiguredProject2, ExternalProject2; + var init_project = __esm2({ + "src/server/project.ts"() { + "use strict"; + init_ts7(); + init_ts7(); + init_ts_server3(); + ProjectKind = /* @__PURE__ */ ((ProjectKind2) => { + ProjectKind2[ProjectKind2["Inferred"] = 0] = "Inferred"; + ProjectKind2[ProjectKind2["Configured"] = 1] = "Configured"; + ProjectKind2[ProjectKind2["External"] = 2] = "External"; + ProjectKind2[ProjectKind2["AutoImportProvider"] = 3] = "AutoImportProvider"; + ProjectKind2[ProjectKind2["Auxiliary"] = 4] = "Auxiliary"; + return ProjectKind2; + })(ProjectKind || {}); + Project3 = class _Project { + /** @internal */ + constructor(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) { + this.projectKind = projectKind; + this.projectService = projectService; + this.documentRegistry = documentRegistry; + this.compilerOptions = compilerOptions; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.watchOptions = watchOptions; + this.rootFiles = []; + this.rootFilesMap = /* @__PURE__ */ new Map(); + this.plugins = []; + this.cachedUnresolvedImportsPerFile = /* @__PURE__ */ new Map(); + this.hasAddedorRemovedFiles = false; + this.hasAddedOrRemovedSymlinks = false; + this.lastReportedVersion = 0; + this.projectProgramVersion = 0; + this.projectStateVersion = 0; + this.isInitialLoadPending = returnFalse; + this.dirty = false; + this.typingFiles = emptyArray2; + this.moduleSpecifierCache = createModuleSpecifierCache(this); + this.createHash = maybeBind(this.projectService.host, this.projectService.host.createHash); + this.globalCacheResolutionModuleName = ts_JsTyping_exports.nonRelativeModuleNameForTypingCache; + this.updateFromProjectInProgress = false; + this.projectName = projectName; + this.directoryStructureHost = directoryStructureHost; + this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory); + this.getCanonicalFileName = this.projectService.toCanonicalFileName; + this.jsDocParsingMode = this.projectService.jsDocParsingMode; + this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds); + if (!this.compilerOptions) { + this.compilerOptions = getDefaultCompilerOptions2(); + this.compilerOptions.allowNonTsExtensions = true; + this.compilerOptions.allowJs = true; + } else if (hasExplicitListOfFiles || getAllowJSCompilerOption(this.compilerOptions) || this.projectService.hasDeferredExtension()) { + this.compilerOptions.allowNonTsExtensions = true; + } + switch (projectService.serverMode) { + case 0: + this.languageServiceEnabled = true; + break; + case 1: + this.languageServiceEnabled = true; + this.compilerOptions.noResolve = true; + this.compilerOptions.types = []; + break; + case 2: + this.languageServiceEnabled = false; + this.compilerOptions.noResolve = true; + this.compilerOptions.types = []; + break; + default: + Debug.assertNever(projectService.serverMode); + } + this.setInternalCompilerOptionsForEmittingJsFiles(); + const host = this.projectService.host; + if (this.projectService.logger.loggingEnabled()) { + this.trace = (s7) => this.writeLog(s7); + } else if (host.trace) { + this.trace = (s7) => host.trace(s7); + } + this.realpath = maybeBind(host, host.realpath); + this.resolutionCache = createResolutionCache( + this, + this.currentDirectory, + /*logChangesWhenResolvingModule*/ + true + ); + this.languageService = createLanguageService(this, this.documentRegistry, this.projectService.serverMode); + if (lastFileExceededProgramSize) { + this.disableLanguageService(lastFileExceededProgramSize); + } + this.markAsDirty(); + if (!isBackgroundProject(this)) { + this.projectService.pendingEnsureProjectForOpenFiles = true; + } + this.projectService.onProjectCreation(this); + } + /** @internal */ + getResolvedProjectReferenceToRedirect(_fileName) { + return void 0; + } + isNonTsProject() { + updateProjectIfDirty(this); + return allFilesAreJsOrDts(this); + } + isJsOnlyProject() { + updateProjectIfDirty(this); + return hasOneOrMoreJsAndNoTsFiles(this); + } + static resolveModule(moduleName3, initialDir, host, log3) { + return _Project.importServicePluginSync({ name: moduleName3 }, [initialDir], host, log3).resolvedModule; + } + /** @internal */ + static importServicePluginSync(pluginConfigEntry, searchPaths, host, log3) { + Debug.assertIsDefined(host.require); + let errorLogs; + let resolvedModule; + for (const initialDir of searchPaths) { + const resolvedPath = normalizeSlashes(host.resolvePath(combinePaths(initialDir, "node_modules"))); + log3(`Loading ${pluginConfigEntry.name} from ${initialDir} (resolved to ${resolvedPath})`); + const result2 = host.require(resolvedPath, pluginConfigEntry.name); + if (!result2.error) { + resolvedModule = result2.module; + break; + } + const err = result2.error.stack || result2.error.message || JSON.stringify(result2.error); + (errorLogs ?? (errorLogs = [])).push(`Failed to load module '${pluginConfigEntry.name}' from ${resolvedPath}: ${err}`); + } + return { pluginConfigEntry, resolvedModule, errorLogs }; + } + /** @internal */ + static async importServicePluginAsync(pluginConfigEntry, searchPaths, host, log3) { + Debug.assertIsDefined(host.importPlugin); + let errorLogs; + let resolvedModule; + for (const initialDir of searchPaths) { + const resolvedPath = combinePaths(initialDir, "node_modules"); + log3(`Dynamically importing ${pluginConfigEntry.name} from ${initialDir} (resolved to ${resolvedPath})`); + let result2; + try { + result2 = await host.importPlugin(resolvedPath, pluginConfigEntry.name); + } catch (e10) { + result2 = { module: void 0, error: e10 }; + } + if (!result2.error) { + resolvedModule = result2.module; + break; + } + const err = result2.error.stack || result2.error.message || JSON.stringify(result2.error); + (errorLogs ?? (errorLogs = [])).push(`Failed to dynamically import module '${pluginConfigEntry.name}' from ${resolvedPath}: ${err}`); + } + return { pluginConfigEntry, resolvedModule, errorLogs }; + } + isKnownTypesPackageName(name2) { + return this.typingsCache.isKnownTypesPackageName(name2); + } + installPackage(options) { + return this.typingsCache.installPackage({ ...options, projectName: this.projectName, projectRootPath: this.toPath(this.currentDirectory) }); + } + /** @internal */ + getGlobalTypingsCacheLocation() { + return this.getGlobalCache(); + } + get typingsCache() { + return this.projectService.typingsCache; + } + /** @internal */ + getSymlinkCache() { + if (!this.symlinks) { + this.symlinks = createSymlinkCache(this.getCurrentDirectory(), this.getCanonicalFileName); + } + if (this.program && !this.symlinks.hasProcessedResolutions()) { + this.symlinks.setSymlinksFromResolutions( + this.program.forEachResolvedModule, + this.program.forEachResolvedTypeReferenceDirective, + this.program.getAutomaticTypeDirectiveResolutions() + ); + } + return this.symlinks; + } + // Method of LanguageServiceHost + getCompilationSettings() { + return this.compilerOptions; + } + // Method to support public API + getCompilerOptions() { + return this.getCompilationSettings(); + } + getNewLine() { + return this.projectService.host.newLine; + } + getProjectVersion() { + return this.projectStateVersion.toString(); + } + getProjectReferences() { + return void 0; + } + getScriptFileNames() { + if (!this.rootFiles) { + return emptyArray; + } + let result2; + this.rootFilesMap.forEach((value2) => { + if (this.languageServiceEnabled || value2.info && value2.info.isScriptOpen()) { + (result2 || (result2 = [])).push(value2.fileName); + } + }); + return addRange(result2, this.typingFiles) || emptyArray; + } + getOrCreateScriptInfoAndAttachToProject(fileName) { + const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(fileName, this.currentDirectory, this.directoryStructureHost); + if (scriptInfo) { + const existingValue = this.rootFilesMap.get(scriptInfo.path); + if (existingValue && existingValue.info !== scriptInfo) { + this.rootFiles.push(scriptInfo); + existingValue.info = scriptInfo; + } + scriptInfo.attachToProject(this); + } + return scriptInfo; + } + getScriptKind(fileName) { + const info2 = this.projectService.getScriptInfoForPath(this.toPath(fileName)); + return info2 && info2.scriptKind; + } + getScriptVersion(filename) { + const info2 = this.projectService.getOrCreateScriptInfoNotOpenedByClient(filename, this.currentDirectory, this.directoryStructureHost); + return info2 && info2.getLatestVersion(); + } + getScriptSnapshot(filename) { + const scriptInfo = this.getOrCreateScriptInfoAndAttachToProject(filename); + if (scriptInfo) { + return scriptInfo.getSnapshot(); + } + } + getCancellationToken() { + return this.cancellationToken; + } + getCurrentDirectory() { + return this.currentDirectory; + } + getDefaultLibFileName() { + const nodeModuleBinDir = getDirectoryPath(normalizePath(this.projectService.getExecutingFilePath())); + return combinePaths(nodeModuleBinDir, getDefaultLibFileName(this.compilerOptions)); + } + useCaseSensitiveFileNames() { + return this.projectService.host.useCaseSensitiveFileNames; + } + readDirectory(path2, extensions6, exclude, include, depth) { + return this.directoryStructureHost.readDirectory(path2, extensions6, exclude, include, depth); + } + readFile(fileName) { + return this.projectService.host.readFile(fileName); + } + writeFile(fileName, content) { + return this.projectService.host.writeFile(fileName, content); + } + fileExists(file) { + const path2 = this.toPath(file); + return !this.isWatchedMissingFile(path2) && this.directoryStructureHost.fileExists(file); + } + /** @internal */ + resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return this.resolutionCache.resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames); + } + /** @internal */ + getModuleResolutionCache() { + return this.resolutionCache.getModuleResolutionCache(); + } + /** @internal */ + resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) { + return this.resolutionCache.resolveTypeReferenceDirectiveReferences( + typeDirectiveReferences, + containingFile, + redirectedReference, + options, + containingSourceFile, + reusedNames + ); + } + /** @internal */ + resolveLibrary(libraryName, resolveFrom, options, libFileName) { + return this.resolutionCache.resolveLibrary(libraryName, resolveFrom, options, libFileName); + } + directoryExists(path2) { + return this.directoryStructureHost.directoryExists(path2); + } + getDirectories(path2) { + return this.directoryStructureHost.getDirectories(path2); + } + /** @internal */ + getCachedDirectoryStructureHost() { + return void 0; + } + /** @internal */ + toPath(fileName) { + return toPath2(fileName, this.currentDirectory, this.projectService.toCanonicalFileName); + } + /** @internal */ + watchDirectoryOfFailedLookupLocation(directory, cb, flags) { + return this.projectService.watchFactory.watchDirectory( + directory, + cb, + flags, + this.projectService.getWatchOptions(this), + WatchType.FailedLookupLocations, + this + ); + } + /** @internal */ + watchAffectingFileLocation(file, cb) { + return this.projectService.watchFactory.watchFile( + file, + cb, + 2e3, + this.projectService.getWatchOptions(this), + WatchType.AffectingFileLocation, + this + ); + } + /** @internal */ + clearInvalidateResolutionOfFailedLookupTimer() { + return this.projectService.throttledOperations.cancel(`${this.getProjectName()}FailedLookupInvalidation`); + } + /** @internal */ + scheduleInvalidateResolutionsOfFailedLookupLocations() { + this.projectService.throttledOperations.schedule( + `${this.getProjectName()}FailedLookupInvalidation`, + /*delay*/ + 1e3, + () => { + if (this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + } + ); + } + /** @internal */ + invalidateResolutionsOfFailedLookupLocations() { + if (this.clearInvalidateResolutionOfFailedLookupTimer() && this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) { + this.markAsDirty(); + this.projectService.delayEnsureProjectForOpenFiles(); + } + } + /** @internal */ + onInvalidatedResolution() { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + /** @internal */ + watchTypeRootsDirectory(directory, cb, flags) { + return this.projectService.watchFactory.watchDirectory( + directory, + cb, + flags, + this.projectService.getWatchOptions(this), + WatchType.TypeRoots, + this + ); + } + /** @internal */ + hasChangedAutomaticTypeDirectiveNames() { + return this.resolutionCache.hasChangedAutomaticTypeDirectiveNames(); + } + /** @internal */ + onChangedAutomaticTypeDirectiveNames() { + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + /** @internal */ + getGlobalCache() { + return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0; + } + /** @internal */ + fileIsOpen(filePath) { + return this.projectService.openFiles.has(filePath); + } + /** @internal */ + writeLog(s7) { + this.projectService.logger.info(s7); + } + log(s7) { + this.writeLog(s7); + } + error(s7) { + this.projectService.logger.msg( + s7, + "Err" + /* Err */ + ); + } + setInternalCompilerOptionsForEmittingJsFiles() { + if (this.projectKind === 0 || this.projectKind === 2) { + this.compilerOptions.noEmitForJsFiles = true; + } + } + /** + * Get the errors that dont have any file name associated + */ + getGlobalProjectErrors() { + return filter2(this.projectErrors, (diagnostic) => !diagnostic.file) || emptyArray2; + } + /** + * Get all the project errors + */ + getAllProjectErrors() { + return this.projectErrors || emptyArray2; + } + setProjectErrors(projectErrors) { + this.projectErrors = projectErrors; + } + getLanguageService(ensureSynchronized = true) { + if (ensureSynchronized) { + updateProjectIfDirty(this); + } + return this.languageService; + } + /** @internal */ + getSourceMapper() { + return this.getLanguageService().getSourceMapper(); + } + /** @internal */ + clearSourceMapperCache() { + this.languageService.clearSourceMapperCache(); + } + /** @internal */ + getDocumentPositionMapper(generatedFileName, sourceFileName) { + return this.projectService.getDocumentPositionMapper(this, generatedFileName, sourceFileName); + } + /** @internal */ + getSourceFileLike(fileName) { + return this.projectService.getSourceFileLike(fileName, this); + } + /** @internal */ + shouldEmitFile(scriptInfo) { + return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent() && !this.program.isSourceOfProjectReferenceRedirect(scriptInfo.path); + } + getCompileOnSaveAffectedFileList(scriptInfo) { + if (!this.languageServiceEnabled) { + return []; + } + updateProjectIfDirty(this); + this.builderState = BuilderState.create( + this.program, + this.builderState, + /*disableUseFileVersionAsSignature*/ + true + ); + return mapDefined( + BuilderState.getFilesAffectedBy( + this.builderState, + this.program, + scriptInfo.path, + this.cancellationToken, + this.projectService.host + ), + (sourceFile) => this.shouldEmitFile(this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : void 0 + ); + } + /** + * Returns true if emit was conducted + */ + emitFile(scriptInfo, writeFile22) { + if (!this.languageServiceEnabled || !this.shouldEmitFile(scriptInfo)) { + return { emitSkipped: true, diagnostics: emptyArray2 }; + } + const { emitSkipped, diagnostics, outputFiles } = this.getLanguageService().getEmitOutput(scriptInfo.fileName); + if (!emitSkipped) { + for (const outputFile of outputFiles) { + const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, this.currentDirectory); + writeFile22(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); + } + if (this.builderState && getEmitDeclarations(this.compilerOptions)) { + const dtsFiles = outputFiles.filter((f8) => isDeclarationFileName(f8.name)); + if (dtsFiles.length === 1) { + const sourceFile = this.program.getSourceFile(scriptInfo.fileName); + const signature = this.projectService.host.createHash ? this.projectService.host.createHash(dtsFiles[0].text) : generateDjb2Hash(dtsFiles[0].text); + BuilderState.updateSignatureOfFile(this.builderState, signature, sourceFile.resolvedPath); + } + } + } + return { emitSkipped, diagnostics }; + } + enableLanguageService() { + if (this.languageServiceEnabled || this.projectService.serverMode === 2) { + return; + } + this.languageServiceEnabled = true; + this.lastFileExceededProgramSize = void 0; + this.projectService.onUpdateLanguageServiceStateForProject( + this, + /*languageServiceEnabled*/ + true + ); + } + /** @internal */ + cleanupProgram() { + if (this.program) { + for (const f8 of this.program.getSourceFiles()) { + this.detachScriptInfoIfNotRoot(f8.fileName); + } + this.program.forEachResolvedProjectReference((ref) => this.detachScriptInfoFromProject(ref.sourceFile.fileName)); + this.program = void 0; + } + } + disableLanguageService(lastFileExceededProgramSize) { + if (!this.languageServiceEnabled) { + return; + } + Debug.assert( + this.projectService.serverMode !== 2 + /* Syntactic */ + ); + this.languageService.cleanupSemanticCache(); + this.languageServiceEnabled = false; + this.cleanupProgram(); + this.lastFileExceededProgramSize = lastFileExceededProgramSize; + this.builderState = void 0; + if (this.autoImportProviderHost) { + this.autoImportProviderHost.close(); + } + this.autoImportProviderHost = void 0; + this.resolutionCache.closeTypeRootsWatch(); + this.clearGeneratedFileWatch(); + this.projectService.verifyDocumentRegistry(); + this.projectService.onUpdateLanguageServiceStateForProject( + this, + /*languageServiceEnabled*/ + false + ); + } + getProjectName() { + return this.projectName; + } + removeLocalTypingsFromTypeAcquisition(newTypeAcquisition) { + if (!newTypeAcquisition || !newTypeAcquisition.include) { + return newTypeAcquisition; + } + return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) }; + } + getExternalFiles(updateLevel) { + return sort(flatMap2(this.plugins, (plugin2) => { + if (typeof plugin2.module.getExternalFiles !== "function") + return; + try { + return plugin2.module.getExternalFiles( + this, + updateLevel || 0 + /* Update */ + ); + } catch (e10) { + this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e10}`); + if (e10.stack) { + this.projectService.logger.info(e10.stack); + } + } + })); + } + getSourceFile(path2) { + if (!this.program) { + return void 0; + } + return this.program.getSourceFileByPath(path2); + } + /** @internal */ + getSourceFileOrConfigFile(path2) { + const options = this.program.getCompilerOptions(); + return path2 === options.configFilePath ? options.configFile : this.getSourceFile(path2); + } + close() { + var _a2; + this.projectService.typingsCache.onProjectClosed(this); + this.closeWatchingTypingLocations(); + this.cleanupProgram(); + forEach4(this.externalFiles, (externalFile) => this.detachScriptInfoIfNotRoot(externalFile)); + for (const root2 of this.rootFiles) { + root2.detachFromProject(this); + } + this.projectService.pendingEnsureProjectForOpenFiles = true; + this.rootFiles = void 0; + this.rootFilesMap = void 0; + this.externalFiles = void 0; + this.program = void 0; + this.builderState = void 0; + this.resolutionCache.clear(); + this.resolutionCache = void 0; + this.cachedUnresolvedImportsPerFile = void 0; + (_a2 = this.packageJsonWatches) == null ? void 0 : _a2.forEach((watcher) => { + watcher.projects.delete(this); + watcher.close(); + }); + this.packageJsonWatches = void 0; + this.moduleSpecifierCache.clear(); + this.moduleSpecifierCache = void 0; + this.directoryStructureHost = void 0; + this.exportMapCache = void 0; + this.projectErrors = void 0; + this.plugins.length = 0; + if (this.missingFilesMap) { + clearMap(this.missingFilesMap, closeFileWatcher); + this.missingFilesMap = void 0; + } + this.clearGeneratedFileWatch(); + this.clearInvalidateResolutionOfFailedLookupTimer(); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.close(); + } + this.autoImportProviderHost = void 0; + if (this.noDtsResolutionProject) { + this.noDtsResolutionProject.close(); + } + this.noDtsResolutionProject = void 0; + this.languageService.dispose(); + this.languageService = void 0; + } + detachScriptInfoIfNotRoot(uncheckedFilename) { + const info2 = this.projectService.getScriptInfo(uncheckedFilename); + if (info2 && !this.isRoot(info2)) { + info2.detachFromProject(this); + } + } + isClosed() { + return this.rootFiles === void 0; + } + hasRoots() { + return this.rootFiles && this.rootFiles.length > 0; + } + /** @internal */ + isOrphan() { + return false; + } + getRootFiles() { + return this.rootFiles && this.rootFiles.map((info2) => info2.fileName); + } + /** @internal */ + getRootFilesMap() { + return this.rootFilesMap; + } + getRootScriptInfos() { + return this.rootFiles; + } + getScriptInfos() { + if (!this.languageServiceEnabled) { + return this.rootFiles; + } + return map4(this.program.getSourceFiles(), (sourceFile) => { + const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath); + Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`); + return scriptInfo; + }); + } + getExcludedFiles() { + return emptyArray2; + } + getFileNames(excludeFilesFromExternalLibraries, excludeConfigFiles) { + if (!this.program) { + return []; + } + if (!this.languageServiceEnabled) { + let rootFiles = this.getRootFiles(); + if (this.compilerOptions) { + const defaultLibrary = getDefaultLibFilePath(this.compilerOptions); + if (defaultLibrary) { + (rootFiles || (rootFiles = [])).push(asNormalizedPath(defaultLibrary)); + } + } + return rootFiles; + } + const result2 = []; + for (const f8 of this.program.getSourceFiles()) { + if (excludeFilesFromExternalLibraries && this.program.isSourceFileFromExternalLibrary(f8)) { + continue; + } + result2.push(asNormalizedPath(f8.fileName)); + } + if (!excludeConfigFiles) { + const configFile = this.program.getCompilerOptions().configFile; + if (configFile) { + result2.push(asNormalizedPath(configFile.fileName)); + if (configFile.extendedSourceFiles) { + for (const f8 of configFile.extendedSourceFiles) { + result2.push(asNormalizedPath(f8)); + } + } + } + } + return result2; + } + /** @internal */ + getFileNamesWithRedirectInfo(includeProjectReferenceRedirectInfo) { + return this.getFileNames().map((fileName) => ({ + fileName, + isSourceOfProjectReferenceRedirect: includeProjectReferenceRedirectInfo && this.isSourceOfProjectReferenceRedirect(fileName) + })); + } + hasConfigFile(configFilePath) { + if (this.program && this.languageServiceEnabled) { + const configFile = this.program.getCompilerOptions().configFile; + if (configFile) { + if (configFilePath === asNormalizedPath(configFile.fileName)) { + return true; + } + if (configFile.extendedSourceFiles) { + for (const f8 of configFile.extendedSourceFiles) { + if (configFilePath === asNormalizedPath(f8)) { + return true; + } + } + } + } + } + return false; + } + containsScriptInfo(info2) { + if (this.isRoot(info2)) + return true; + if (!this.program) + return false; + const file = this.program.getSourceFileByPath(info2.path); + return !!file && file.resolvedPath === info2.path; + } + containsFile(filename, requireOpen) { + const info2 = this.projectService.getScriptInfoForNormalizedPath(filename); + if (info2 && (info2.isScriptOpen() || !requireOpen)) { + return this.containsScriptInfo(info2); + } + return false; + } + isRoot(info2) { + var _a2; + return this.rootFilesMap && ((_a2 = this.rootFilesMap.get(info2.path)) == null ? void 0 : _a2.info) === info2; + } + // add a root file to project + addRoot(info2, fileName) { + Debug.assert(!this.isRoot(info2)); + this.rootFiles.push(info2); + this.rootFilesMap.set(info2.path, { fileName: fileName || info2.fileName, info: info2 }); + info2.attachToProject(this); + this.markAsDirty(); + } + // add a root file that doesnt exist on host + addMissingFileRoot(fileName) { + const path2 = this.projectService.toPath(fileName); + this.rootFilesMap.set(path2, { fileName }); + this.markAsDirty(); + } + removeFile(info2, fileExists, detachFromProject) { + if (this.isRoot(info2)) { + this.removeRoot(info2); + } + if (fileExists) { + this.resolutionCache.removeResolutionsOfFile(info2.path); + } else { + this.resolutionCache.invalidateResolutionOfFile(info2.path); + } + this.cachedUnresolvedImportsPerFile.delete(info2.path); + if (detachFromProject) { + info2.detachFromProject(this); + } + this.markAsDirty(); + } + registerFileUpdate(fileName) { + (this.updatedFileNames || (this.updatedFileNames = /* @__PURE__ */ new Set())).add(fileName); + } + /** @internal */ + markFileAsDirty(changedFile) { + this.markAsDirty(); + if (this.exportMapCache && !this.exportMapCache.isEmpty()) { + (this.changedFilesForExportMapCache || (this.changedFilesForExportMapCache = /* @__PURE__ */ new Set())).add(changedFile); + } + } + markAsDirty() { + if (!this.dirty) { + this.projectStateVersion++; + this.dirty = true; + } + } + /** @internal */ + onAutoImportProviderSettingsChanged() { + var _a2; + if (this.autoImportProviderHost === false) { + this.autoImportProviderHost = void 0; + } else { + (_a2 = this.autoImportProviderHost) == null ? void 0 : _a2.markAsDirty(); + } + } + /** @internal */ + onPackageJsonChange() { + this.moduleSpecifierCache.clear(); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.markAsDirty(); + } + } + /** @internal */ + onFileAddedOrRemoved(isSymlink) { + this.hasAddedorRemovedFiles = true; + if (isSymlink) { + this.hasAddedOrRemovedSymlinks = true; + } + } + /** @internal */ + onDiscoveredSymlink() { + this.hasAddedOrRemovedSymlinks = true; + } + /** @internal */ + updateFromProject() { + updateProjectIfDirty(this); + } + /** + * Updates set of files that contribute to this project + * @returns: true if set of files in the project stays the same and false - otherwise. + */ + updateGraph() { + var _a2, _b, _c, _d, _e2; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] }); + (_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph(); + this.resolutionCache.startRecordingFilesWithChangedResolutions(); + const hasNewProgram = this.updateGraphWorker(); + const hasAddedorRemovedFiles = this.hasAddedorRemovedFiles; + this.hasAddedorRemovedFiles = false; + this.hasAddedOrRemovedSymlinks = false; + const changedFiles = this.resolutionCache.finishRecordingFilesWithChangedResolutions() || emptyArray2; + for (const file of changedFiles) { + this.cachedUnresolvedImportsPerFile.delete(file); + } + if (this.languageServiceEnabled && this.projectService.serverMode === 0 && !this.isOrphan()) { + if (hasNewProgram || changedFiles.length) { + this.lastCachedUnresolvedImportsList = getUnresolvedImports(this.program, this.cachedUnresolvedImportsPerFile); + } + this.projectService.typingsCache.enqueueInstallTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasAddedorRemovedFiles); + } else { + this.lastCachedUnresolvedImportsList = void 0; + } + const isFirstProgramLoad = this.projectProgramVersion === 0 && hasNewProgram; + if (hasNewProgram) { + this.projectProgramVersion++; + } + if (hasAddedorRemovedFiles) { + if (!this.autoImportProviderHost) + this.autoImportProviderHost = void 0; + (_c = this.autoImportProviderHost) == null ? void 0 : _c.markAsDirty(); + } + if (isFirstProgramLoad) { + this.getPackageJsonAutoImportProvider(); + } + (_d = perfLogger) == null ? void 0 : _d.logStopUpdateGraph(); + (_e2 = tracing) == null ? void 0 : _e2.pop(); + return !hasNewProgram; + } + /** @internal */ + updateTypingFiles(typingFiles) { + if (enumerateInsertsAndDeletes( + typingFiles, + this.typingFiles, + getStringComparer(!this.useCaseSensitiveFileNames()), + /*inserted*/ + noop4, + (removed) => this.detachScriptInfoFromProject(removed) + )) { + this.typingFiles = typingFiles; + this.resolutionCache.setFilesWithInvalidatedNonRelativeUnresolvedImports(this.cachedUnresolvedImportsPerFile); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + } + /** @internal */ + closeWatchingTypingLocations() { + if (this.typingWatchers) + clearMap(this.typingWatchers, closeFileWatcher); + this.typingWatchers = void 0; + } + /** @internal */ + onTypingInstallerWatchInvoke() { + this.typingWatchers.isInvoked = true; + this.projectService.updateTypingsForProject({ projectName: this.getProjectName(), kind: ActionInvalidate }); + } + /** @internal */ + watchTypingLocations(files) { + if (!files) { + this.typingWatchers.isInvoked = false; + return; + } + if (!files.length) { + this.closeWatchingTypingLocations(); + return; + } + const toRemove = new Map(this.typingWatchers); + if (!this.typingWatchers) + this.typingWatchers = /* @__PURE__ */ new Map(); + this.typingWatchers.isInvoked = false; + const createProjectWatcher = (path2, typingsWatcherType) => { + const canonicalPath = this.toPath(path2); + toRemove.delete(canonicalPath); + if (!this.typingWatchers.has(canonicalPath)) { + this.typingWatchers.set( + canonicalPath, + typingsWatcherType === "FileWatcher" ? this.projectService.watchFactory.watchFile( + path2, + () => !this.typingWatchers.isInvoked ? this.onTypingInstallerWatchInvoke() : this.writeLog(`TypingWatchers already invoked`), + 2e3, + this.projectService.getWatchOptions(this), + WatchType.TypingInstallerLocationFile, + this + ) : this.projectService.watchFactory.watchDirectory( + path2, + (f8) => { + if (this.typingWatchers.isInvoked) + return this.writeLog(`TypingWatchers already invoked`); + if (!fileExtensionIs( + f8, + ".json" + /* Json */ + )) + return this.writeLog(`Ignoring files that are not *.json`); + if (comparePaths(f8, combinePaths(this.projectService.typingsInstaller.globalTypingsCacheLocation, "package.json"), !this.useCaseSensitiveFileNames())) + return this.writeLog(`Ignoring package.json change at global typings location`); + this.onTypingInstallerWatchInvoke(); + }, + 1, + this.projectService.getWatchOptions(this), + WatchType.TypingInstallerLocationDirectory, + this + ) + ); + } + }; + for (const file of files) { + const basename2 = getBaseFileName(file); + if (basename2 === "package.json" || basename2 === "bower.json") { + createProjectWatcher( + file, + "FileWatcher" + /* FileWatcher */ + ); + continue; + } + if (containsPath(this.currentDirectory, file, this.currentDirectory, !this.useCaseSensitiveFileNames())) { + const subDirectory = file.indexOf(directorySeparator, this.currentDirectory.length + 1); + if (subDirectory !== -1) { + createProjectWatcher( + file.substr(0, subDirectory), + "DirectoryWatcher" + /* DirectoryWatcher */ + ); + } else { + createProjectWatcher( + file, + "DirectoryWatcher" + /* DirectoryWatcher */ + ); + } + continue; + } + if (containsPath(this.projectService.typingsInstaller.globalTypingsCacheLocation, file, this.currentDirectory, !this.useCaseSensitiveFileNames())) { + createProjectWatcher( + this.projectService.typingsInstaller.globalTypingsCacheLocation, + "DirectoryWatcher" + /* DirectoryWatcher */ + ); + continue; + } + createProjectWatcher( + file, + "DirectoryWatcher" + /* DirectoryWatcher */ + ); + } + toRemove.forEach((watch, path2) => { + watch.close(); + this.typingWatchers.delete(path2); + }); + } + /** @internal */ + getCurrentProgram() { + return this.program; + } + removeExistingTypings(include) { + const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); + return include.filter((i7) => !existing.includes(i7)); + } + updateGraphWorker() { + var _a2, _b; + const oldProgram = this.languageService.getCurrentProgram(); + Debug.assert(oldProgram === this.program); + Debug.assert(!this.isClosed(), "Called update graph worker of closed project"); + this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`); + const start = timestamp3(); + const { hasInvalidatedResolutions, hasInvalidatedLibResolutions } = this.resolutionCache.createHasInvalidatedResolutions(returnFalse, returnFalse); + this.hasInvalidatedResolutions = hasInvalidatedResolutions; + this.hasInvalidatedLibResolutions = hasInvalidatedLibResolutions; + this.resolutionCache.startCachingPerDirectoryResolution(); + this.dirty = false; + this.updateFromProjectInProgress = true; + this.program = this.languageService.getProgram(); + this.updateFromProjectInProgress = false; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution"); + this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram); + (_b = tracing) == null ? void 0 : _b.pop(); + Debug.assert(oldProgram === void 0 || this.program !== void 0); + let hasNewProgram = false; + if (this.program && (!oldProgram || this.program !== oldProgram && this.program.structureIsReused !== 2)) { + hasNewProgram = true; + if (oldProgram) { + for (const f8 of oldProgram.getSourceFiles()) { + const newFile = this.program.getSourceFileByPath(f8.resolvedPath); + if (!newFile || f8.resolvedPath === f8.path && newFile.resolvedPath !== f8.path) { + this.detachScriptInfoFromProject( + f8.fileName, + !!this.program.getSourceFileByPath(f8.path), + /*syncDirWatcherRemove*/ + true + ); + } + } + oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => { + if (!this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) { + this.detachScriptInfoFromProject( + resolvedProjectReference.sourceFile.fileName, + /*noRemoveResolution*/ + void 0, + /*syncDirWatcherRemove*/ + true + ); + } + }); + } + updateMissingFilePathsWatch( + this.program, + this.missingFilesMap || (this.missingFilesMap = /* @__PURE__ */ new Map()), + // Watch the missing files + (missingFilePath, missingFileName) => this.addMissingFileWatcher(missingFilePath, missingFileName) + ); + if (this.generatedFilesMap) { + const outPath = outFile(this.compilerOptions); + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + if (!outPath || !this.isValidGeneratedFileWatcher( + removeFileExtension(outPath) + ".d.ts", + this.generatedFilesMap + )) { + this.clearGeneratedFileWatch(); + } + } else { + if (outPath) { + this.clearGeneratedFileWatch(); + } else { + this.generatedFilesMap.forEach((watcher, source) => { + const sourceFile = this.program.getSourceFileByPath(source); + if (!sourceFile || sourceFile.resolvedPath !== source || !this.isValidGeneratedFileWatcher( + getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.currentDirectory, this.program.getCommonSourceDirectory(), this.getCanonicalFileName), + watcher + )) { + closeFileWatcherOf(watcher); + this.generatedFilesMap.delete(source); + } + }); + } + } + } + if (this.languageServiceEnabled && this.projectService.serverMode === 0) { + this.resolutionCache.updateTypeRootsWatch(); + } + } + this.projectService.verifyProgram(this); + if (this.exportMapCache && !this.exportMapCache.isEmpty()) { + this.exportMapCache.releaseSymbols(); + if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) { + this.exportMapCache.clear(); + } else if (this.changedFilesForExportMapCache && oldProgram && this.program) { + forEachKey(this.changedFilesForExportMapCache, (fileName) => { + const oldSourceFile = oldProgram.getSourceFileByPath(fileName); + const sourceFile = this.program.getSourceFileByPath(fileName); + if (!oldSourceFile || !sourceFile) { + this.exportMapCache.clear(); + return true; + } + return this.exportMapCache.onFileChanged(oldSourceFile, sourceFile, !!this.getTypeAcquisition().enable); + }); + } + } + if (this.changedFilesForExportMapCache) { + this.changedFilesForExportMapCache.clear(); + } + if (this.hasAddedOrRemovedSymlinks || this.program && !this.program.structureIsReused && this.getCompilerOptions().preserveSymlinks) { + this.symlinks = void 0; + this.moduleSpecifierCache.clear(); + } + const oldExternalFiles = this.externalFiles || emptyArray2; + this.externalFiles = this.getExternalFiles(); + enumerateInsertsAndDeletes( + this.externalFiles, + oldExternalFiles, + getStringComparer(!this.useCaseSensitiveFileNames()), + // Ensure a ScriptInfo is created for new external files. This is performed indirectly + // by the host for files in the program when the program is retrieved above but + // the program doesn't contain external files so this must be done explicitly. + (inserted) => { + const scriptInfo = this.projectService.getOrCreateScriptInfoNotOpenedByClient(inserted, this.currentDirectory, this.directoryStructureHost); + scriptInfo == null ? void 0 : scriptInfo.attachToProject(this); + }, + (removed) => this.detachScriptInfoFromProject(removed) + ); + const elapsed = timestamp3() - start; + this.sendPerformanceEvent("UpdateGraph", elapsed); + this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`); + if (this.projectService.logger.isTestLogger) { + if (this.program !== oldProgram) { + this.print( + /*writeProjectFileNames*/ + true, + this.hasAddedorRemovedFiles, + /*writeFileVersionAndText*/ + true + ); + } else { + this.writeLog(`Same program as before`); + } + } else if (this.hasAddedorRemovedFiles) { + this.print( + /*writeProjectFileNames*/ + true, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + } else if (this.program !== oldProgram) { + this.writeLog(`Different program with same set of files`); + } + this.projectService.verifyDocumentRegistry(); + return hasNewProgram; + } + /** @internal */ + sendPerformanceEvent(kind, durationMs) { + this.projectService.sendPerformanceEvent(kind, durationMs); + } + detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution, syncDirWatcherRemove) { + const scriptInfoToDetach = this.projectService.getScriptInfo(uncheckedFileName); + if (scriptInfoToDetach) { + scriptInfoToDetach.detachFromProject(this); + if (!noRemoveResolution) { + this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path, syncDirWatcherRemove); + } + } + } + addMissingFileWatcher(missingFilePath, missingFileName) { + var _a2; + if (isConfiguredProject(this)) { + const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(missingFilePath); + if ((_a2 = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config) == null ? void 0 : _a2.projects.has(this.canonicalConfigFilePath)) + return noopFileWatcher; + } + const fileWatcher = this.projectService.watchFactory.watchFile( + getNormalizedAbsolutePath(missingFileName, this.currentDirectory), + (fileName, eventKind) => { + if (isConfiguredProject(this)) { + this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind); + } + if (eventKind === 0 && this.missingFilesMap.has(missingFilePath)) { + this.missingFilesMap.delete(missingFilePath); + fileWatcher.close(); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + } + }, + 500, + this.projectService.getWatchOptions(this), + WatchType.MissingFile, + this + ); + return fileWatcher; + } + isWatchedMissingFile(path2) { + return !!this.missingFilesMap && this.missingFilesMap.has(path2); + } + /** @internal */ + addGeneratedFileWatch(generatedFile, sourceFile) { + if (outFile(this.compilerOptions)) { + if (!this.generatedFilesMap) { + this.generatedFilesMap = this.createGeneratedFileWatcher(generatedFile); + } + } else { + const path2 = this.toPath(sourceFile); + if (this.generatedFilesMap) { + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + Debug.fail(`${this.projectName} Expected to not have --out watcher for generated file with options: ${JSON.stringify(this.compilerOptions)}`); + return; + } + if (this.generatedFilesMap.has(path2)) + return; + } else { + this.generatedFilesMap = /* @__PURE__ */ new Map(); + } + this.generatedFilesMap.set(path2, this.createGeneratedFileWatcher(generatedFile)); + } + } + createGeneratedFileWatcher(generatedFile) { + return { + generatedFilePath: this.toPath(generatedFile), + watcher: this.projectService.watchFactory.watchFile( + generatedFile, + () => { + this.clearSourceMapperCache(); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); + }, + 2e3, + this.projectService.getWatchOptions(this), + WatchType.MissingGeneratedFile, + this + ) + }; + } + isValidGeneratedFileWatcher(generateFile, watcher) { + return this.toPath(generateFile) === watcher.generatedFilePath; + } + clearGeneratedFileWatch() { + if (this.generatedFilesMap) { + if (isGeneratedFileWatcher(this.generatedFilesMap)) { + closeFileWatcherOf(this.generatedFilesMap); + } else { + clearMap(this.generatedFilesMap, closeFileWatcherOf); + } + this.generatedFilesMap = void 0; + } + } + getScriptInfoForNormalizedPath(fileName) { + const scriptInfo = this.projectService.getScriptInfoForPath(this.toPath(fileName)); + if (scriptInfo && !scriptInfo.isAttached(this)) { + return Errors.ThrowProjectDoesNotContainDocument(fileName, this); + } + return scriptInfo; + } + getScriptInfo(uncheckedFileName) { + return this.projectService.getScriptInfo(uncheckedFileName); + } + filesToString(writeProjectFileNames) { + return this.filesToStringWorker( + writeProjectFileNames, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + } + /** @internal */ + filesToStringWorker(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) { + if (this.isInitialLoadPending()) + return " Files (0) InitialLoadPending\n"; + if (!this.program) + return " Files (0) NoProgram\n"; + const sourceFiles = this.program.getSourceFiles(); + let strBuilder = ` Files (${sourceFiles.length}) +`; + if (writeProjectFileNames) { + for (const file of sourceFiles) { + strBuilder += ` ${file.fileName}${writeFileVersionAndText ? ` ${file.version} ${JSON.stringify(file.text)}` : ""} +`; + } + if (writeFileExplaination) { + strBuilder += "\n\n"; + explainFiles(this.program, (s7) => strBuilder += ` ${s7} +`); + } + } + return strBuilder; + } + /** @internal */ + print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) { + var _a2; + this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`); + this.writeLog(this.filesToStringWorker( + writeProjectFileNames && this.projectService.logger.hasLevel( + 3 + /* verbose */ + ), + writeFileExplaination && this.projectService.logger.hasLevel( + 3 + /* verbose */ + ), + writeFileVersionAndText && this.projectService.logger.hasLevel( + 3 + /* verbose */ + ) + )); + this.writeLog("-----------------------------------------------"); + if (this.autoImportProviderHost) { + this.autoImportProviderHost.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + (_a2 = this.noDtsResolutionProject) == null ? void 0 : _a2.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + setCompilerOptions(compilerOptions) { + var _a2; + if (compilerOptions) { + compilerOptions.allowNonTsExtensions = true; + const oldOptions = this.compilerOptions; + this.compilerOptions = compilerOptions; + this.setInternalCompilerOptionsForEmittingJsFiles(); + (_a2 = this.noDtsResolutionProject) == null ? void 0 : _a2.setCompilerOptions(this.getCompilerOptionsForNoDtsResolutionProject()); + if (changesAffectModuleResolution(oldOptions, compilerOptions)) { + this.cachedUnresolvedImportsPerFile.clear(); + this.lastCachedUnresolvedImportsList = void 0; + this.resolutionCache.onChangesAffectModuleResolution(); + this.moduleSpecifierCache.clear(); + } + this.markAsDirty(); + } + } + /** @internal */ + setWatchOptions(watchOptions) { + this.watchOptions = watchOptions; + } + /** @internal */ + getWatchOptions() { + return this.watchOptions; + } + setTypeAcquisition(newTypeAcquisition) { + if (newTypeAcquisition) { + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); + } + } + getTypeAcquisition() { + return this.typeAcquisition || {}; + } + /** @internal */ + getChangesSinceVersion(lastKnownVersion, includeProjectReferenceRedirectInfo) { + var _a2, _b; + const includeProjectReferenceRedirectInfoIfRequested = includeProjectReferenceRedirectInfo ? (files) => arrayFrom(files.entries(), ([fileName, isSourceOfProjectReferenceRedirect]) => ({ + fileName, + isSourceOfProjectReferenceRedirect + })) : (files) => arrayFrom(files.keys()); + if (!this.isInitialLoadPending()) { + updateProjectIfDirty(this); + } + const info2 = { + projectName: this.getProjectName(), + version: this.projectProgramVersion, + isInferred: isInferredProject(this), + options: this.getCompilationSettings(), + languageServiceDisabled: !this.languageServiceEnabled, + lastFileExceededProgramSize: this.lastFileExceededProgramSize + }; + const updatedFileNames = this.updatedFileNames; + this.updatedFileNames = void 0; + if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) { + if (this.projectProgramVersion === this.lastReportedVersion && !updatedFileNames) { + return { info: info2, projectErrors: this.getGlobalProjectErrors() }; + } + const lastReportedFileNames = this.lastReportedFileNames; + const externalFiles = ((_a2 = this.externalFiles) == null ? void 0 : _a2.map((f8) => ({ + fileName: toNormalizedPath(f8), + isSourceOfProjectReferenceRedirect: false + }))) || emptyArray2; + const currentFiles = arrayToMap( + this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo).concat(externalFiles), + (info22) => info22.fileName, + (info22) => info22.isSourceOfProjectReferenceRedirect + ); + const added = /* @__PURE__ */ new Map(); + const removed = /* @__PURE__ */ new Map(); + const updated = updatedFileNames ? arrayFrom(updatedFileNames.keys()) : []; + const updatedRedirects = []; + forEachEntry(currentFiles, (isSourceOfProjectReferenceRedirect, fileName) => { + if (!lastReportedFileNames.has(fileName)) { + added.set(fileName, isSourceOfProjectReferenceRedirect); + } else if (includeProjectReferenceRedirectInfo && isSourceOfProjectReferenceRedirect !== lastReportedFileNames.get(fileName)) { + updatedRedirects.push({ + fileName, + isSourceOfProjectReferenceRedirect + }); + } + }); + forEachEntry(lastReportedFileNames, (isSourceOfProjectReferenceRedirect, fileName) => { + if (!currentFiles.has(fileName)) { + removed.set(fileName, isSourceOfProjectReferenceRedirect); + } + }); + this.lastReportedFileNames = currentFiles; + this.lastReportedVersion = this.projectProgramVersion; + return { + info: info2, + changes: { + added: includeProjectReferenceRedirectInfoIfRequested(added), + removed: includeProjectReferenceRedirectInfoIfRequested(removed), + updated: includeProjectReferenceRedirectInfo ? updated.map((fileName) => ({ + fileName, + isSourceOfProjectReferenceRedirect: this.isSourceOfProjectReferenceRedirect(fileName) + })) : updated, + updatedRedirects: includeProjectReferenceRedirectInfo ? updatedRedirects : void 0 + }, + projectErrors: this.getGlobalProjectErrors() + }; + } else { + const projectFileNames = this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo); + const externalFiles = ((_b = this.externalFiles) == null ? void 0 : _b.map((f8) => ({ + fileName: toNormalizedPath(f8), + isSourceOfProjectReferenceRedirect: false + }))) || emptyArray2; + const allFiles = projectFileNames.concat(externalFiles); + this.lastReportedFileNames = arrayToMap( + allFiles, + (info22) => info22.fileName, + (info22) => info22.isSourceOfProjectReferenceRedirect + ); + this.lastReportedVersion = this.projectProgramVersion; + return { + info: info2, + files: includeProjectReferenceRedirectInfo ? allFiles : allFiles.map((f8) => f8.fileName), + projectErrors: this.getGlobalProjectErrors() + }; + } + } + // remove a root file from project + removeRoot(info2) { + orderedRemoveItem(this.rootFiles, info2); + this.rootFilesMap.delete(info2.path); + } + /** @internal */ + isSourceOfProjectReferenceRedirect(fileName) { + return !!this.program && this.program.isSourceOfProjectReferenceRedirect(fileName); + } + /** @internal */ + getGlobalPluginSearchPaths() { + return [ + ...this.projectService.pluginProbeLocations, + // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/ + combinePaths(this.projectService.getExecutingFilePath(), "../../..") + ]; + } + enableGlobalPlugins(options) { + if (!this.projectService.globalPlugins.length) + return; + const host = this.projectService.host; + if (!host.require && !host.importPlugin) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + const searchPaths = this.getGlobalPluginSearchPaths(); + for (const globalPluginName of this.projectService.globalPlugins) { + if (!globalPluginName) + continue; + if (options.plugins && options.plugins.some((p7) => p7.name === globalPluginName)) + continue; + this.projectService.logger.info(`Loading global plugin ${globalPluginName}`); + this.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + } + } + enablePlugin(pluginConfigEntry, searchPaths) { + this.projectService.requestEnablePlugin(this, pluginConfigEntry, searchPaths); + } + /** @internal */ + enableProxy(pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info(`Skipped loading plugin ${configEntry.name} because it did not expose a proper factory function`); + return; + } + const info2 = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this, + serverHost: this.projectService.host, + session: this.projectService.session + }; + const pluginModule = pluginModuleFactory({ typescript: ts_exports2 }); + const newLS = pluginModule.create(info2); + for (const k6 of Object.keys(this.languageService)) { + if (!(k6 in newLS)) { + this.projectService.logger.info(`Plugin activation warning: Missing proxied method ${k6} in created LS. Patching.`); + newLS[k6] = this.languageService[k6]; + } + } + this.projectService.logger.info(`Plugin validation succeeded`); + this.languageService = newLS; + this.plugins.push({ name: configEntry.name, module: pluginModule }); + } catch (e10) { + this.projectService.logger.info(`Plugin activation failed: ${e10}`); + } + } + /** @internal */ + onPluginConfigurationChanged(pluginName, configuration) { + this.plugins.filter((plugin2) => plugin2.name === pluginName).forEach((plugin2) => { + if (plugin2.module.onConfigurationChanged) { + plugin2.module.onConfigurationChanged(configuration); + } + }); + } + /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */ + refreshDiagnostics() { + this.projectService.sendProjectsUpdatedInBackgroundEvent(); + } + /** @internal */ + getPackageJsonsVisibleToFile(fileName, rootDir) { + if (this.projectService.serverMode !== 0) + return emptyArray2; + return this.projectService.getPackageJsonsVisibleToFile(fileName, this, rootDir); + } + /** @internal */ + getNearestAncestorDirectoryWithPackageJson(fileName) { + return this.projectService.getNearestAncestorDirectoryWithPackageJson(fileName); + } + /** @internal */ + getPackageJsonsForAutoImport(rootDir) { + return this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir); + } + /** @internal */ + getPackageJsonCache() { + return this.projectService.packageJsonCache; + } + /** @internal */ + getCachedExportInfoMap() { + return this.exportMapCache || (this.exportMapCache = createCacheableExportInfoMap(this)); + } + /** @internal */ + clearCachedExportInfoMap() { + var _a2; + (_a2 = this.exportMapCache) == null ? void 0 : _a2.clear(); + } + /** @internal */ + getModuleSpecifierCache() { + return this.moduleSpecifierCache; + } + /** @internal */ + includePackageJsonAutoImports() { + if (this.projectService.includePackageJsonAutoImports() === 0 || !this.languageServiceEnabled || isInsideNodeModules(this.currentDirectory) || !this.isDefaultProjectForOpenFiles()) { + return 0; + } + return this.projectService.includePackageJsonAutoImports(); + } + /** @internal */ + getHostForAutoImportProvider() { + var _a2, _b; + if (this.program) { + return { + fileExists: this.program.fileExists, + directoryExists: this.program.directoryExists, + realpath: this.program.realpath || ((_a2 = this.projectService.host.realpath) == null ? void 0 : _a2.bind(this.projectService.host)), + getCurrentDirectory: this.getCurrentDirectory.bind(this), + readFile: this.projectService.host.readFile.bind(this.projectService.host), + getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host), + trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host), + useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(), + readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host) + }; + } + return this.projectService.host; + } + /** @internal */ + getPackageJsonAutoImportProvider() { + var _a2, _b, _c; + if (this.autoImportProviderHost === false) { + return void 0; + } + if (this.projectService.serverMode !== 0) { + this.autoImportProviderHost = false; + return void 0; + } + if (this.autoImportProviderHost) { + updateProjectIfDirty(this.autoImportProviderHost); + if (this.autoImportProviderHost.isEmpty()) { + this.autoImportProviderHost.close(); + this.autoImportProviderHost = void 0; + return void 0; + } + return this.autoImportProviderHost.getCurrentProgram(); + } + const dependencySelection = this.includePackageJsonAutoImports(); + if (dependencySelection) { + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider"); + const start = timestamp3(); + this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry); + if (this.autoImportProviderHost) { + updateProjectIfDirty(this.autoImportProviderHost); + this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp3() - start); + (_b = tracing) == null ? void 0 : _b.pop(); + return this.autoImportProviderHost.getCurrentProgram(); + } + (_c = tracing) == null ? void 0 : _c.pop(); + } + } + /** @internal */ + isDefaultProjectForOpenFiles() { + return !!forEachEntry( + this.projectService.openFiles, + (_6, fileName) => this.projectService.tryGetDefaultProjectForFile(toNormalizedPath(fileName)) === this + ); + } + /** @internal */ + watchNodeModulesForPackageJsonChanges(directoryPath) { + return this.projectService.watchPackageJsonsInNodeModules(directoryPath, this); + } + /** @internal */ + getIncompleteCompletionsCache() { + return this.projectService.getIncompleteCompletionsCache(); + } + /** @internal */ + getNoDtsResolutionProject(rootFile) { + Debug.assert( + this.projectService.serverMode === 0 + /* Semantic */ + ); + if (!this.noDtsResolutionProject) { + this.noDtsResolutionProject = new AuxiliaryProject(this.projectService, this.documentRegistry, this.getCompilerOptionsForNoDtsResolutionProject(), this.currentDirectory); + } + if (this.noDtsResolutionProject.rootFile !== rootFile) { + this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject, [rootFile]); + this.noDtsResolutionProject.rootFile = rootFile; + } + return this.noDtsResolutionProject; + } + /** @internal */ + getCompilerOptionsForNoDtsResolutionProject() { + return { + ...this.getCompilerOptions(), + noDtsResolution: true, + allowJs: true, + maxNodeModuleJsDepth: 3, + diagnostics: false, + skipLibCheck: true, + sourceMap: false, + types: emptyArray, + lib: emptyArray, + noLib: true + }; + } + }; + InferredProject2 = class extends Project3 { + /** @internal */ + constructor(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, typeAcquisition) { + super( + projectService.newInferredProjectName(), + 0, + projectService, + documentRegistry, + // TODO: GH#18217 + /*files*/ + void 0, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + watchOptions, + projectService.host, + currentDirectory + ); + this._isJsInferredProject = false; + this.typeAcquisition = typeAcquisition; + this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); + if (!projectRootPath && !projectService.useSingleInferredProject) { + this.canonicalCurrentDirectory = projectService.toCanonicalFileName(this.currentDirectory); + } + this.enableGlobalPlugins(this.getCompilerOptions()); + } + toggleJsInferredProject(isJsInferredProject) { + if (isJsInferredProject !== this._isJsInferredProject) { + this._isJsInferredProject = isJsInferredProject; + this.setCompilerOptions(); + } + } + setCompilerOptions(options) { + if (!options && !this.getCompilationSettings()) { + return; + } + const newOptions = cloneCompilerOptions(options || this.getCompilationSettings()); + if (this._isJsInferredProject && typeof newOptions.maxNodeModuleJsDepth !== "number") { + newOptions.maxNodeModuleJsDepth = 2; + } else if (!this._isJsInferredProject) { + newOptions.maxNodeModuleJsDepth = void 0; + } + newOptions.allowJs = true; + super.setCompilerOptions(newOptions); + } + addRoot(info2) { + Debug.assert(info2.isScriptOpen()); + this.projectService.startWatchingConfigFilesForInferredProjectRoot(info2); + if (!this._isJsInferredProject && info2.isJavaScript()) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + true + ); + } else if (this.isOrphan() && this._isJsInferredProject && !info2.isJavaScript()) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + false + ); + } + super.addRoot(info2); + } + removeRoot(info2) { + this.projectService.stopWatchingConfigFilesForInferredProjectRoot(info2); + super.removeRoot(info2); + if (!this.isOrphan() && this._isJsInferredProject && info2.isJavaScript()) { + if (every2(this.getRootScriptInfos(), (rootInfo) => !rootInfo.isJavaScript())) { + this.toggleJsInferredProject( + /*isJsInferredProject*/ + false + ); + } + } + } + /** @internal */ + isOrphan() { + return !this.hasRoots(); + } + isProjectWithSingleRoot() { + return !this.projectRootPath && !this.projectService.useSingleInferredProject || this.getRootScriptInfos().length === 1; + } + close() { + forEach4(this.getRootScriptInfos(), (info2) => this.projectService.stopWatchingConfigFilesForInferredProjectRoot(info2)); + super.close(); + } + getTypeAcquisition() { + return this.typeAcquisition || { + enable: allRootFilesAreJsOrDts(this), + include: emptyArray, + exclude: emptyArray + }; + } + }; + AuxiliaryProject = class extends Project3 { + constructor(projectService, documentRegistry, compilerOptions, currentDirectory) { + super( + projectService.newAuxiliaryProjectName(), + 4, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + /*watchOptions*/ + void 0, + projectService.host, + currentDirectory + ); + } + isOrphan() { + return true; + } + scheduleInvalidateResolutionsOfFailedLookupLocations() { + return; + } + }; + _AutoImportProviderProject = class _AutoImportProviderProject2 extends Project3 { + /** @internal */ + constructor(hostProject, initialRootNames, documentRegistry, compilerOptions) { + super( + hostProject.projectService.newAutoImportProviderProjectName(), + 3, + hostProject.projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + compilerOptions, + /*compileOnSaveEnabled*/ + false, + hostProject.getWatchOptions(), + hostProject.projectService.host, + hostProject.currentDirectory + ); + this.hostProject = hostProject; + this.rootFileNames = initialRootNames; + this.useSourceOfProjectReferenceRedirect = maybeBind(this.hostProject, this.hostProject.useSourceOfProjectReferenceRedirect); + this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine); + } + /** @internal */ + static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) { + var _a2, _b; + if (!dependencySelection) { + return emptyArray; + } + const program = hostProject.getCurrentProgram(); + if (!program) { + return emptyArray; + } + const start = timestamp3(); + let dependencyNames; + let rootNames; + const rootFileName = combinePaths(hostProject.currentDirectory, inferredTypesContainingFile); + const packageJsons = hostProject.getPackageJsonsForAutoImport(combinePaths(hostProject.currentDirectory, rootFileName)); + for (const packageJson of packageJsons) { + (_a2 = packageJson.dependencies) == null ? void 0 : _a2.forEach((_6, dependenyName) => addDependency(dependenyName)); + (_b = packageJson.peerDependencies) == null ? void 0 : _b.forEach((_6, dependencyName) => addDependency(dependencyName)); + } + let dependenciesAdded = 0; + if (dependencyNames) { + const symlinkCache = hostProject.getSymlinkCache(); + for (const name2 of arrayFrom(dependencyNames.keys())) { + if (dependencySelection === 2 && dependenciesAdded > this.maxDependencies) { + hostProject.log(`AutoImportProviderProject: attempted to add more than ${this.maxDependencies} dependencies. Aborting.`); + return emptyArray; + } + const packageJson = resolvePackageNameToPackageJson( + name2, + hostProject.currentDirectory, + compilerOptions, + host, + program.getModuleResolutionCache() + ); + if (packageJson) { + const entrypoints = getRootNamesFromPackageJson(packageJson, program, symlinkCache); + if (entrypoints) { + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += entrypoints.length ? 1 : 0; + continue; + } + } + const done = forEach4([hostProject.currentDirectory, hostProject.getGlobalTypingsCacheLocation()], (directory) => { + if (directory) { + const typesPackageJson = resolvePackageNameToPackageJson( + `@types/${name2}`, + directory, + compilerOptions, + host, + program.getModuleResolutionCache() + ); + if (typesPackageJson) { + const entrypoints = getRootNamesFromPackageJson(typesPackageJson, program, symlinkCache); + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += (entrypoints == null ? void 0 : entrypoints.length) ? 1 : 0; + return true; + } + } + }); + if (done) + continue; + if (packageJson && compilerOptions.allowJs && compilerOptions.maxNodeModuleJsDepth) { + const entrypoints = getRootNamesFromPackageJson( + packageJson, + program, + symlinkCache, + /*resolveJs*/ + true + ); + rootNames = concatenate(rootNames, entrypoints); + dependenciesAdded += (entrypoints == null ? void 0 : entrypoints.length) ? 1 : 0; + } + } + } + if (rootNames == null ? void 0 : rootNames.length) { + hostProject.log(`AutoImportProviderProject: found ${rootNames.length} root files in ${dependenciesAdded} dependencies in ${timestamp3() - start} ms`); + } + return rootNames || emptyArray; + function addDependency(dependency) { + if (!startsWith2(dependency, "@types/")) { + (dependencyNames || (dependencyNames = /* @__PURE__ */ new Set())).add(dependency); + } + } + function getRootNamesFromPackageJson(packageJson, program2, symlinkCache, resolveJs) { + var _a22; + const entrypoints = getEntrypointsFromPackageJsonInfo( + packageJson, + compilerOptions, + host, + program2.getModuleResolutionCache(), + resolveJs + ); + if (entrypoints) { + const real = (_a22 = host.realpath) == null ? void 0 : _a22.call(host, packageJson.packageDirectory); + const realPath2 = real ? hostProject.toPath(real) : void 0; + const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory); + if (isSymlink) { + symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, { + real: ensureTrailingDirectorySeparator(real), + realPath: ensureTrailingDirectorySeparator(realPath2) + }); + } + return mapDefined(entrypoints, (entrypoint) => { + const resolvedFileName = isSymlink ? entrypoint.replace(packageJson.packageDirectory, real) : entrypoint; + if (!program2.getSourceFile(resolvedFileName) && !(isSymlink && program2.getSourceFile(entrypoint))) { + return resolvedFileName; + } + }); + } + } + } + /** @internal */ + static create(dependencySelection, hostProject, host, documentRegistry) { + if (dependencySelection === 0) { + return void 0; + } + const compilerOptions = { + ...hostProject.getCompilerOptions(), + ...this.compilerOptionsOverrides + }; + const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions); + if (!rootNames.length) { + return void 0; + } + return new _AutoImportProviderProject2(hostProject, rootNames, documentRegistry, compilerOptions); + } + /** @internal */ + isEmpty() { + return !some2(this.rootFileNames); + } + isOrphan() { + return true; + } + updateGraph() { + let rootFileNames = this.rootFileNames; + if (!rootFileNames) { + rootFileNames = _AutoImportProviderProject2.getRootFileNames( + this.hostProject.includePackageJsonAutoImports(), + this.hostProject, + this.hostProject.getHostForAutoImportProvider(), + this.getCompilationSettings() + ); + } + this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this, rootFileNames); + this.rootFileNames = rootFileNames; + const oldProgram = this.getCurrentProgram(); + const hasSameSetOfFiles = super.updateGraph(); + if (oldProgram && oldProgram !== this.getCurrentProgram()) { + this.hostProject.clearCachedExportInfoMap(); + } + return hasSameSetOfFiles; + } + /** @internal */ + scheduleInvalidateResolutionsOfFailedLookupLocations() { + return; + } + hasRoots() { + var _a2; + return !!((_a2 = this.rootFileNames) == null ? void 0 : _a2.length); + } + markAsDirty() { + this.rootFileNames = void 0; + super.markAsDirty(); + } + getScriptFileNames() { + return this.rootFileNames || emptyArray; + } + getLanguageService() { + throw new Error("AutoImportProviderProject language service should never be used. To get the program, use `project.getCurrentProgram()`."); + } + /** @internal */ + onAutoImportProviderSettingsChanged() { + throw new Error("AutoImportProviderProject is an auto import provider; use `markAsDirty()` instead."); + } + /** @internal */ + onPackageJsonChange() { + throw new Error("package.json changes should be notified on an AutoImportProvider's host project"); + } + getHostForAutoImportProvider() { + throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead."); + } + getProjectReferences() { + return this.hostProject.getProjectReferences(); + } + /** @internal */ + includePackageJsonAutoImports() { + return 0; + } + /** @internal */ + getSymlinkCache() { + return this.hostProject.getSymlinkCache(); + } + /** @internal */ + getModuleResolutionCache() { + var _a2; + return (_a2 = this.hostProject.getCurrentProgram()) == null ? void 0 : _a2.getModuleResolutionCache(); + } + }; + _AutoImportProviderProject.maxDependencies = 10; + _AutoImportProviderProject.compilerOptionsOverrides = { + diagnostics: false, + skipLibCheck: true, + sourceMap: false, + types: emptyArray, + lib: emptyArray, + noLib: true + }; + AutoImportProviderProject = _AutoImportProviderProject; + ConfiguredProject2 = class extends Project3 { + /** @internal */ + constructor(configFileName, canonicalConfigFilePath, projectService, documentRegistry, cachedDirectoryStructureHost) { + super( + configFileName, + 1, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + false, + /*lastFileExceededProgramSize*/ + void 0, + /*compilerOptions*/ + {}, + /*compileOnSaveEnabled*/ + false, + /*watchOptions*/ + void 0, + cachedDirectoryStructureHost, + getDirectoryPath(configFileName) + ); + this.canonicalConfigFilePath = canonicalConfigFilePath; + this.openFileWatchTriggered = /* @__PURE__ */ new Map(); + this.canConfigFileJsonReportNoInputFiles = false; + this.externalProjectRefCount = 0; + this.isInitialLoadPending = returnTrue; + this.sendLoadingProjectFinish = false; + } + /** @internal */ + setCompilerHost(host) { + this.compilerHost = host; + } + /** @internal */ + getCompilerHost() { + return this.compilerHost; + } + /** @internal */ + useSourceOfProjectReferenceRedirect() { + return this.languageServiceEnabled; + } + /** @internal */ + getParsedCommandLine(fileName) { + const configFileName = asNormalizedPath(normalizePath(fileName)); + const canonicalConfigFilePath = asNormalizedPath(this.projectService.toCanonicalFileName(configFileName)); + let configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + this.projectService.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo = { exists: this.projectService.host.fileExists(configFileName) }); + } + this.projectService.ensureParsedConfigUptoDate(configFileName, canonicalConfigFilePath, configFileExistenceInfo, this); + if (this.languageServiceEnabled && this.projectService.serverMode === 0) { + this.projectService.watchWildcards(configFileName, configFileExistenceInfo, this); + } + return configFileExistenceInfo.exists ? configFileExistenceInfo.config.parsedCommandLine : void 0; + } + /** @internal */ + onReleaseParsedCommandLine(fileName) { + this.releaseParsedConfig(asNormalizedPath(this.projectService.toCanonicalFileName(asNormalizedPath(normalizePath(fileName))))); + } + /** @internal */ + releaseParsedConfig(canonicalConfigFilePath) { + this.projectService.stopWatchingWildCards(canonicalConfigFilePath, this); + this.projectService.releaseParsedConfig(canonicalConfigFilePath, this); + } + /** + * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph + * @returns: true if set of files in the project stays the same and false - otherwise. + */ + updateGraph() { + const isInitialLoad = this.isInitialLoadPending(); + this.isInitialLoadPending = returnFalse; + const updateLevel = this.pendingUpdateLevel; + this.pendingUpdateLevel = 0; + let result2; + switch (updateLevel) { + case 1: + this.openFileWatchTriggered.clear(); + result2 = this.projectService.reloadFileNamesOfConfiguredProject(this); + break; + case 2: + this.openFileWatchTriggered.clear(); + const reason = Debug.checkDefined(this.pendingUpdateReason); + this.pendingUpdateReason = void 0; + this.projectService.reloadConfiguredProject( + this, + reason, + isInitialLoad, + /*clearSemanticCache*/ + false + ); + result2 = true; + break; + default: + result2 = super.updateGraph(); + } + this.compilerHost = void 0; + this.projectService.sendProjectLoadingFinishEvent(this); + this.projectService.sendProjectTelemetry(this); + return result2; + } + /** @internal */ + getCachedDirectoryStructureHost() { + return this.directoryStructureHost; + } + getConfigFilePath() { + return asNormalizedPath(this.getProjectName()); + } + getProjectReferences() { + return this.projectReferences; + } + updateReferences(refs) { + this.projectReferences = refs; + this.potentialProjectReferences = void 0; + } + /** @internal */ + setPotentialProjectReference(canonicalConfigPath) { + Debug.assert(this.isInitialLoadPending()); + (this.potentialProjectReferences || (this.potentialProjectReferences = /* @__PURE__ */ new Set())).add(canonicalConfigPath); + } + /** @internal */ + getResolvedProjectReferenceToRedirect(fileName) { + const program = this.getCurrentProgram(); + return program && program.getResolvedProjectReferenceToRedirect(fileName); + } + /** @internal */ + forEachResolvedProjectReference(cb) { + var _a2; + return (_a2 = this.getCurrentProgram()) == null ? void 0 : _a2.forEachResolvedProjectReference(cb); + } + /** @internal */ + enablePluginsWithOptions(options) { + var _a2; + this.plugins.length = 0; + if (!((_a2 = options.plugins) == null ? void 0 : _a2.length) && !this.projectService.globalPlugins.length) + return; + const host = this.projectService.host; + if (!host.require && !host.importPlugin) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + const searchPaths = this.getGlobalPluginSearchPaths(); + if (this.projectService.allowLocalPluginLoads) { + const local = getDirectoryPath(this.canonicalConfigFilePath); + this.projectService.logger.info(`Local plugin loading enabled; adding ${local} to search paths`); + searchPaths.unshift(local); + } + if (options.plugins) { + for (const pluginConfigEntry of options.plugins) { + this.enablePlugin(pluginConfigEntry, searchPaths); + } + } + return this.enableGlobalPlugins(options); + } + /** + * Get the errors that dont have any file name associated + */ + getGlobalProjectErrors() { + return filter2(this.projectErrors, (diagnostic) => !diagnostic.file) || emptyArray2; + } + /** + * Get all the project errors + */ + getAllProjectErrors() { + return this.projectErrors || emptyArray2; + } + setProjectErrors(projectErrors) { + this.projectErrors = projectErrors; + } + close() { + this.projectService.configFileExistenceInfoCache.forEach((_configFileExistenceInfo, canonicalConfigFilePath) => this.releaseParsedConfig(canonicalConfigFilePath)); + this.projectErrors = void 0; + this.openFileWatchTriggered.clear(); + this.compilerHost = void 0; + super.close(); + } + /** @internal */ + addExternalProjectReference() { + this.externalProjectRefCount++; + } + /** @internal */ + deleteExternalProjectReference() { + this.externalProjectRefCount--; + } + /** @internal */ + isSolution() { + return this.getRootFilesMap().size === 0 && !this.canConfigFileJsonReportNoInputFiles; + } + /** + * Find the configured project from the project references in project which contains the info directly + * + * @internal + */ + getDefaultChildProjectFromProjectWithReferences(info2) { + return forEachResolvedProjectReferenceProject( + this, + info2.path, + (child) => projectContainsInfoDirectly(child, info2) ? child : void 0, + 0 + /* Find */ + ); + } + /** + * Returns true if the project is needed by any of the open script info/external project + * + * @internal + */ + hasOpenRef() { + var _a2; + if (!!this.externalProjectRefCount) { + return true; + } + if (this.isClosed()) { + return false; + } + const configFileExistenceInfo = this.projectService.configFileExistenceInfoCache.get(this.canonicalConfigFilePath); + if (this.projectService.hasPendingProjectUpdate(this)) { + return !!((_a2 = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a2.size); + } + return !!configFileExistenceInfo.openFilesImpactedByConfigFile && forEachEntry( + configFileExistenceInfo.openFilesImpactedByConfigFile, + (_value, infoPath) => { + const info2 = this.projectService.getScriptInfoForPath(infoPath); + return this.containsScriptInfo(info2) || !!forEachResolvedProjectReferenceProject( + this, + info2.path, + (child) => child.containsScriptInfo(info2), + 0 + /* Find */ + ); + } + ) || false; + } + /** @internal */ + hasExternalProjectRef() { + return !!this.externalProjectRefCount; + } + getEffectiveTypeRoots() { + return getEffectiveTypeRoots(this.getCompilationSettings(), this) || []; + } + /** @internal */ + updateErrorOnNoInputFiles(fileNames) { + updateErrorForNoInputFiles(fileNames, this.getConfigFilePath(), this.getCompilerOptions().configFile.configFileSpecs, this.projectErrors, this.canConfigFileJsonReportNoInputFiles); + } + }; + ExternalProject2 = class extends Project3 { + /** @internal */ + constructor(externalProjectName, projectService, documentRegistry, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath, watchOptions) { + super( + externalProjectName, + 2, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ + true, + lastFileExceededProgramSize, + compilerOptions, + compileOnSaveEnabled, + watchOptions, + projectService.host, + getDirectoryPath(projectFilePath || normalizeSlashes(externalProjectName)) + ); + this.externalProjectName = externalProjectName; + this.compileOnSaveEnabled = compileOnSaveEnabled; + this.excludedFiles = []; + this.enableGlobalPlugins(this.getCompilerOptions()); + } + updateGraph() { + const result2 = super.updateGraph(); + this.projectService.sendProjectTelemetry(this); + return result2; + } + getExcludedFiles() { + return this.excludedFiles; + } + }; + } + }); + function prepareConvertersForEnumLikeCompilerOptions(commandLineOptions) { + const map22 = /* @__PURE__ */ new Map(); + for (const option of commandLineOptions) { + if (typeof option.type === "object") { + const optionMap = option.type; + optionMap.forEach((value2) => { + Debug.assert(typeof value2 === "number"); + }); + map22.set(option.name, optionMap); + } + } + return map22; + } + function convertFormatOptions(protocolOptions) { + if (isString4(protocolOptions.indentStyle)) { + protocolOptions.indentStyle = indentStyle.get(protocolOptions.indentStyle.toLowerCase()); + Debug.assert(protocolOptions.indentStyle !== void 0); + } + return protocolOptions; + } + function convertCompilerOptions(protocolOptions) { + compilerOptionConverters.forEach((mappedValues, id) => { + const propertyValue = protocolOptions[id]; + if (isString4(propertyValue)) { + protocolOptions[id] = mappedValues.get(propertyValue.toLowerCase()); + } + }); + return protocolOptions; + } + function convertWatchOptions(protocolOptions, currentDirectory) { + let watchOptions; + let errors; + optionsForWatch.forEach((option) => { + const propertyValue = protocolOptions[option.name]; + if (propertyValue === void 0) + return; + const mappedValues = watchOptionsConverters.get(option.name); + (watchOptions || (watchOptions = {}))[option.name] = mappedValues ? isString4(propertyValue) ? mappedValues.get(propertyValue.toLowerCase()) : propertyValue : convertJsonOption(option, propertyValue, currentDirectory || "", errors || (errors = [])); + }); + return watchOptions && { watchOptions, errors }; + } + function convertTypeAcquisition(protocolOptions) { + let result2; + typeAcquisitionDeclarations.forEach((option) => { + const propertyValue = protocolOptions[option.name]; + if (propertyValue === void 0) + return; + (result2 || (result2 = {}))[option.name] = propertyValue; + }); + return result2; + } + function tryConvertScriptKindName(scriptKindName) { + return isString4(scriptKindName) ? convertScriptKindName(scriptKindName) : scriptKindName; + } + function convertScriptKindName(scriptKindName) { + switch (scriptKindName) { + case "JS": + return 1; + case "JSX": + return 2; + case "TS": + return 3; + case "TSX": + return 4; + default: + return 0; + } + } + function convertUserPreferences(preferences) { + const { lazyConfiguredProjectsFromExternalProject: _6, ...userPreferences } = preferences; + return userPreferences; + } + function findProjectByName(projectName, projects) { + for (const proj of projects) { + if (proj.getProjectName() === projectName) { + return proj; + } + } + } + function isOpenScriptInfo(infoOrFileNameOrConfig) { + return !!infoOrFileNameOrConfig.containingProjects; + } + function isAncestorConfigFileInfo(infoOrFileNameOrConfig) { + return !!infoOrFileNameOrConfig.configFileInfo; + } + function forEachResolvedProjectReferenceProject(project, fileName, cb, projectReferenceProjectLoadKind, reason) { + var _a2; + const resolvedRefs = (_a2 = project.getCurrentProgram()) == null ? void 0 : _a2.getResolvedProjectReferences(); + if (!resolvedRefs) + return void 0; + let seenResolvedRefs; + const possibleDefaultRef = fileName ? project.getResolvedProjectReferenceToRedirect(fileName) : void 0; + if (possibleDefaultRef) { + const configFileName = toNormalizedPath(possibleDefaultRef.sourceFile.fileName); + const child = project.projectService.findConfiguredProjectByProjectName(configFileName); + if (child) { + const result2 = cb(child); + if (result2) + return result2; + } else if (projectReferenceProjectLoadKind !== 0) { + seenResolvedRefs = /* @__PURE__ */ new Map(); + const result2 = forEachResolvedProjectReferenceProjectWorker( + resolvedRefs, + project.getCompilerOptions(), + (ref, loadKind) => possibleDefaultRef === ref ? callback(ref, loadKind) : void 0, + projectReferenceProjectLoadKind, + project.projectService, + seenResolvedRefs + ); + if (result2) + return result2; + seenResolvedRefs.clear(); + } + } + return forEachResolvedProjectReferenceProjectWorker( + resolvedRefs, + project.getCompilerOptions(), + (ref, loadKind) => possibleDefaultRef !== ref ? callback(ref, loadKind) : void 0, + projectReferenceProjectLoadKind, + project.projectService, + seenResolvedRefs + ); + function callback(ref, loadKind) { + const configFileName = toNormalizedPath(ref.sourceFile.fileName); + const child = project.projectService.findConfiguredProjectByProjectName(configFileName) || (loadKind === 0 ? void 0 : loadKind === 1 ? project.projectService.createConfiguredProject(configFileName) : loadKind === 2 ? project.projectService.createAndLoadConfiguredProject(configFileName, reason) : Debug.assertNever(loadKind)); + return child && cb(child); + } + } + function forEachResolvedProjectReferenceProjectWorker(resolvedProjectReferences, parentOptions, cb, projectReferenceProjectLoadKind, projectService, seenResolvedRefs) { + const loadKind = parentOptions.disableReferencedProjectLoad ? 0 : projectReferenceProjectLoadKind; + return forEach4(resolvedProjectReferences, (ref) => { + if (!ref) + return void 0; + const configFileName = toNormalizedPath(ref.sourceFile.fileName); + const canonicalPath = projectService.toCanonicalFileName(configFileName); + const seenValue = seenResolvedRefs == null ? void 0 : seenResolvedRefs.get(canonicalPath); + if (seenValue !== void 0 && seenValue >= loadKind) { + return void 0; + } + const result2 = cb(ref, loadKind); + if (result2) { + return result2; + } + (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Map())).set(canonicalPath, loadKind); + return ref.references && forEachResolvedProjectReferenceProjectWorker(ref.references, ref.commandLine.options, cb, loadKind, projectService, seenResolvedRefs); + }); + } + function forEachPotentialProjectReference(project, cb) { + return project.potentialProjectReferences && forEachKey(project.potentialProjectReferences, cb); + } + function forEachAnyProjectReferenceKind(project, cb, cbProjectRef, cbPotentialProjectRef) { + return project.getCurrentProgram() ? project.forEachResolvedProjectReference(cb) : project.isInitialLoadPending() ? forEachPotentialProjectReference(project, cbPotentialProjectRef) : forEach4(project.getProjectReferences(), cbProjectRef); + } + function callbackRefProject(project, cb, refPath) { + const refProject = refPath && project.projectService.configuredProjects.get(refPath); + return refProject && cb(refProject); + } + function forEachReferencedProject(project, cb) { + return forEachAnyProjectReferenceKind( + project, + (resolvedRef) => callbackRefProject(project, cb, resolvedRef.sourceFile.path), + (projectRef) => callbackRefProject(project, cb, project.toPath(resolveProjectReferencePath(projectRef))), + (potentialProjectRef) => callbackRefProject(project, cb, potentialProjectRef) + ); + } + function getDetailWatchInfo(watchType, project) { + return `${isString4(project) ? `Config: ${project} ` : project ? `Project: ${project.getProjectName()} ` : ""}WatchType: ${watchType}`; + } + function isScriptInfoWatchedFromNodeModules(info2) { + return !info2.isScriptOpen() && info2.mTime !== void 0; + } + function projectContainsInfoDirectly(project, info2) { + return project.containsScriptInfo(info2) && !project.isSourceOfProjectReferenceRedirect(info2.path); + } + function updateProjectIfDirty(project) { + project.invalidateResolutionsOfFailedLookupLocations(); + return project.dirty && project.updateGraph(); + } + function setProjectOptionsUsed(project) { + if (isConfiguredProject(project)) { + project.projectOptions = true; + } + } + function createProjectNameFactoryWithCounter(nameFactory) { + let nextId = 1; + return () => nameFactory(nextId++); + } + function getHostWatcherMap() { + return { idToCallbacks: /* @__PURE__ */ new Map(), pathToId: /* @__PURE__ */ new Map() }; + } + function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) { + if (!canUseWatchEvents || !service.eventHandler || !service.session) + return void 0; + const watchedFiles = getHostWatcherMap(); + const watchedDirectories = getHostWatcherMap(); + const watchedDirectoriesRecursive = getHostWatcherMap(); + let ids = 1; + service.session.addProtocolHandler("watchChange", (req) => { + onWatchChange(req.arguments); + return { responseRequired: false }; + }); + return { + watchFile: watchFile2, + watchDirectory, + getCurrentDirectory: () => service.host.getCurrentDirectory(), + useCaseSensitiveFileNames: service.host.useCaseSensitiveFileNames + }; + function watchFile2(path2, callback) { + return getOrCreateFileWatcher( + watchedFiles, + path2, + callback, + (id) => ({ eventName: CreateFileWatcherEvent, data: { id, path: path2 } }) + ); + } + function watchDirectory(path2, callback, recursive) { + return getOrCreateFileWatcher( + recursive ? watchedDirectoriesRecursive : watchedDirectories, + path2, + callback, + (id) => ({ + eventName: CreateDirectoryWatcherEvent, + data: { + id, + path: path2, + recursive: !!recursive, + // Special case node_modules as we watch it for changes to closed script infos as well + ignoreUpdate: !path2.endsWith("/node_modules") ? true : void 0 + } + }) + ); + } + function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path2, callback, event) { + const key = service.toPath(path2); + let id = pathToId.get(key); + if (!id) + pathToId.set(key, id = ids++); + let callbacks = idToCallbacks.get(id); + if (!callbacks) { + idToCallbacks.set(id, callbacks = /* @__PURE__ */ new Set()); + service.eventHandler(event(id)); + } + callbacks.add(callback); + return { + close() { + const callbacks2 = idToCallbacks.get(id); + if (!(callbacks2 == null ? void 0 : callbacks2.delete(callback))) + return; + if (callbacks2.size) + return; + idToCallbacks.delete(id); + pathToId.delete(key); + service.eventHandler({ eventName: CloseFileWatcherEvent, data: { id } }); + } + }; + } + function onWatchChange(args) { + if (isArray3(args)) + args.forEach(onWatchChangeRequestArgs); + else + onWatchChangeRequestArgs(args); + } + function onWatchChangeRequestArgs({ id, created, deleted, updated }) { + onWatchEventType( + id, + created, + 0 + /* Created */ + ); + onWatchEventType( + id, + deleted, + 2 + /* Deleted */ + ); + onWatchEventType( + id, + updated, + 1 + /* Changed */ + ); + } + function onWatchEventType(id, paths, eventKind) { + if (!(paths == null ? void 0 : paths.length)) + return; + forEachCallback(watchedFiles, id, paths, (callback, eventPath) => callback(eventPath, eventKind)); + forEachCallback(watchedDirectories, id, paths, (callback, eventPath) => callback(eventPath)); + forEachCallback(watchedDirectoriesRecursive, id, paths, (callback, eventPath) => callback(eventPath)); + } + function forEachCallback(hostWatcherMap, id, eventPaths, cb) { + var _a2; + (_a2 = hostWatcherMap.idToCallbacks.get(id)) == null ? void 0 : _a2.forEach((callback) => { + eventPaths.forEach((eventPath) => cb(callback, normalizeSlashes(eventPath))); + }); + } + } + function createIncompleteCompletionsCache() { + let info2; + return { + get() { + return info2; + }, + set(newInfo) { + info2 = newInfo; + }, + clear() { + info2 = void 0; + } + }; + } + function isConfigFile(config3) { + return config3.kind !== void 0; + } + function printProjectWithoutFileNames(project) { + project.print( + /*writeProjectFileNames*/ + false, + /*writeFileExplaination*/ + false, + /*writeFileVersionAndText*/ + false + ); + } + var maxProgramSizeForNonTsFiles, maxFileSize, ProjectsUpdatedInBackgroundEvent, ProjectLoadingStartEvent, ProjectLoadingFinishEvent, LargeFileReferencedEvent, ConfigFileDiagEvent, ProjectLanguageServiceStateEvent, ProjectInfoTelemetryEvent, OpenFileInfoTelemetryEvent, CreateFileWatcherEvent, CreateDirectoryWatcherEvent, CloseFileWatcherEvent, ensureProjectForOpenFileSchedule, compilerOptionConverters, watchOptionsConverters, indentStyle, defaultTypeSafeList, fileNamePropertyReader, externalFilePropertyReader, noopConfigFileWatcher, ProjectReferenceProjectLoadKind, _ProjectService, ProjectService3; + var init_editorServices = __esm2({ + "src/server/editorServices.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + init_protocol(); + maxProgramSizeForNonTsFiles = 20 * 1024 * 1024; + maxFileSize = 4 * 1024 * 1024; + ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground"; + ProjectLoadingStartEvent = "projectLoadingStart"; + ProjectLoadingFinishEvent = "projectLoadingFinish"; + LargeFileReferencedEvent = "largeFileReferenced"; + ConfigFileDiagEvent = "configFileDiag"; + ProjectLanguageServiceStateEvent = "projectLanguageServiceState"; + ProjectInfoTelemetryEvent = "projectInfo"; + OpenFileInfoTelemetryEvent = "openFileInfo"; + CreateFileWatcherEvent = "createFileWatcher"; + CreateDirectoryWatcherEvent = "createDirectoryWatcher"; + CloseFileWatcherEvent = "closeFileWatcher"; + ensureProjectForOpenFileSchedule = "*ensureProjectForOpenFiles*"; + compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(optionDeclarations); + watchOptionsConverters = prepareConvertersForEnumLikeCompilerOptions(optionsForWatch); + indentStyle = new Map(Object.entries({ + none: 0, + block: 1, + smart: 2 + /* Smart */ + })); + defaultTypeSafeList = { + "jquery": { + // jquery files can have names like "jquery-1.10.2.min.js" (or "jquery.intellisense.js") + match: /jquery(-[\d.]+)?(\.intellisense)?(\.min)?\.js$/i, + types: ["jquery"] + }, + "WinJS": { + // e.g. c:/temp/UWApp1/lib/winjs-4.0.1/js/base.js + match: /^(.*\/winjs-[.\d]+)\/js\/base\.js$/i, + // If the winjs/base.js file is found.. + exclude: [["^", 1, "/.*"]], + // ..then exclude all files under the winjs folder + types: ["winjs"] + // And fetch the @types package for WinJS + }, + "Kendo": { + // e.g. /Kendo3/wwwroot/lib/kendo/kendo.all.min.js + match: /^(.*\/kendo(-ui)?)\/kendo\.all(\.min)?\.js$/i, + exclude: [["^", 1, "/.*"]], + types: ["kendo-ui"] + }, + "Office Nuget": { + // e.g. /scripts/Office/1/excel-15.debug.js + match: /^(.*\/office\/1)\/excel-\d+\.debug\.js$/i, + // Office NuGet package is installed under a "1/office" folder + exclude: [["^", 1, "/.*"]], + // Exclude that whole folder if the file indicated above is found in it + types: ["office"] + // @types package to fetch instead + }, + "References": { + match: /^(.*\/_references\.js)$/i, + exclude: [["^", 1, "$"]] + } + }; + fileNamePropertyReader = { + getFileName: (x7) => x7, + getScriptKind: (fileName, extraFileExtensions) => { + let result2; + if (extraFileExtensions) { + const fileExtension = getAnyExtensionFromPath(fileName); + if (fileExtension) { + some2(extraFileExtensions, (info2) => { + if (info2.extension === fileExtension) { + result2 = info2.scriptKind; + return true; + } + return false; + }); + } + } + return result2; + }, + hasMixedContent: (fileName, extraFileExtensions) => some2(extraFileExtensions, (ext) => ext.isMixedContent && fileExtensionIs(fileName, ext.extension)) + }; + externalFilePropertyReader = { + getFileName: (x7) => x7.fileName, + getScriptKind: (x7) => tryConvertScriptKindName(x7.scriptKind), + // TODO: GH#18217 + hasMixedContent: (x7) => !!x7.hasMixedContent + }; + noopConfigFileWatcher = { close: noop4 }; + ProjectReferenceProjectLoadKind = /* @__PURE__ */ ((ProjectReferenceProjectLoadKind2) => { + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["Find"] = 0] = "Find"; + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["FindCreate"] = 1] = "FindCreate"; + ProjectReferenceProjectLoadKind2[ProjectReferenceProjectLoadKind2["FindCreateLoad"] = 2] = "FindCreateLoad"; + return ProjectReferenceProjectLoadKind2; + })(ProjectReferenceProjectLoadKind || {}); + _ProjectService = class _ProjectService2 { + constructor(opts) { + this.filenameToScriptInfo = /* @__PURE__ */ new Map(); + this.nodeModulesWatchers = /* @__PURE__ */ new Map(); + this.filenameToScriptInfoVersion = /* @__PURE__ */ new Map(); + this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Map(); + this.externalProjectToConfiguredProjectMap = /* @__PURE__ */ new Map(); + this.externalProjects = []; + this.inferredProjects = []; + this.configuredProjects = /* @__PURE__ */ new Map(); + this.newInferredProjectName = createProjectNameFactoryWithCounter(makeInferredProjectName); + this.newAutoImportProviderProjectName = createProjectNameFactoryWithCounter(makeAutoImportProviderProjectName); + this.newAuxiliaryProjectName = createProjectNameFactoryWithCounter(makeAuxiliaryProjectName); + this.openFiles = /* @__PURE__ */ new Map(); + this.configFileForOpenFiles = /* @__PURE__ */ new Map(); + this.openFilesWithNonRootedDiskPath = /* @__PURE__ */ new Map(); + this.compilerOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + this.watchOptionsForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + this.typeAcquisitionForInferredProjectsPerProjectRoot = /* @__PURE__ */ new Map(); + this.projectToSizeMap = /* @__PURE__ */ new Map(); + this.configFileExistenceInfoCache = /* @__PURE__ */ new Map(); + this.safelist = defaultTypeSafeList; + this.legacySafelist = /* @__PURE__ */ new Map(); + this.pendingProjectUpdates = /* @__PURE__ */ new Map(); + this.pendingEnsureProjectForOpenFiles = false; + this.seenProjects = /* @__PURE__ */ new Map(); + this.sharedExtendedConfigFileWatchers = /* @__PURE__ */ new Map(); + this.extendedConfigCache = /* @__PURE__ */ new Map(); + this.baseline = noop4; + this.verifyDocumentRegistry = noop4; + this.verifyProgram = noop4; + this.onProjectCreation = noop4; + var _a2; + this.host = opts.host; + this.logger = opts.logger; + this.cancellationToken = opts.cancellationToken; + this.useSingleInferredProject = opts.useSingleInferredProject; + this.useInferredProjectPerProjectRoot = opts.useInferredProjectPerProjectRoot; + this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller; + this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds; + this.eventHandler = opts.eventHandler; + this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents; + this.globalPlugins = opts.globalPlugins || emptyArray2; + this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray2; + this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; + this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation; + this.session = opts.session; + this.jsDocParsingMode = opts.jsDocParsingMode; + if (opts.serverMode !== void 0) { + this.serverMode = opts.serverMode; + } else { + this.serverMode = 0; + } + if (this.host.realpath) { + this.realpathToScriptInfos = createMultiMap(); + } + this.currentDirectory = toNormalizedPath(this.host.getCurrentDirectory()); + this.toCanonicalFileName = createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); + this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation ? ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation)) : void 0; + this.throttledOperations = new ThrottledOperations(this.host, this.logger); + if (this.typesMapLocation) { + this.loadTypesMap(); + } else { + this.logger.info("No types map provided; using the default"); + } + this.typingsInstaller.attach(this); + this.typingsCache = new TypingsCache(this.typingsInstaller); + this.hostConfiguration = { + formatCodeOptions: getDefaultFormatCodeSettings(this.host.newLine), + preferences: emptyOptions, + hostInfo: "Unknown host", + extraFileExtensions: [] + }; + this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this); + const watchLogLevel = this.logger.hasLevel( + 3 + /* verbose */ + ) ? 2 : this.logger.loggingEnabled() ? 1 : 0; + const log3 = watchLogLevel !== 0 ? (s7) => this.logger.info(s7) : noop4; + this.packageJsonCache = createPackageJsonCache(this); + this.watchFactory = this.serverMode !== 0 ? { + watchFile: returnNoopFileWatcher, + watchDirectory: returnNoopFileWatcher + } : getWatchFactory( + createWatchFactoryHostUsingWatchEvents(this, opts.canUseWatchEvents) || this.host, + watchLogLevel, + log3, + getDetailWatchInfo + ); + (_a2 = opts.incrementalVerifier) == null ? void 0 : _a2.call(opts, this); + } + toPath(fileName) { + return toPath2(fileName, this.currentDirectory, this.toCanonicalFileName); + } + /** @internal */ + getExecutingFilePath() { + return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath()); + } + /** @internal */ + getNormalizedAbsolutePath(fileName) { + return getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); + } + /** @internal */ + setDocument(key, path2, sourceFile) { + const info2 = Debug.checkDefined(this.getScriptInfoForPath(path2)); + info2.cacheSourceFile = { key, sourceFile }; + } + /** @internal */ + getDocument(key, path2) { + const info2 = this.getScriptInfoForPath(path2); + return info2 && info2.cacheSourceFile && info2.cacheSourceFile.key === key ? info2.cacheSourceFile.sourceFile : void 0; + } + /** @internal */ + ensureInferredProjectsUpToDate_TestOnly() { + this.ensureProjectStructuresUptoDate(); + } + /** @internal */ + getCompilerOptionsForInferredProjects() { + return this.compilerOptionsForInferredProjects; + } + /** @internal */ + onUpdateLanguageServiceStateForProject(project, languageServiceEnabled) { + if (!this.eventHandler) { + return; + } + const event = { + eventName: ProjectLanguageServiceStateEvent, + data: { project, languageServiceEnabled } + }; + this.eventHandler(event); + } + loadTypesMap() { + try { + const fileContent = this.host.readFile(this.typesMapLocation); + if (fileContent === void 0) { + this.logger.info(`Provided types map file "${this.typesMapLocation}" doesn't exist`); + return; + } + const raw = JSON.parse(fileContent); + for (const k6 of Object.keys(raw.typesMap)) { + raw.typesMap[k6].match = new RegExp(raw.typesMap[k6].match, "i"); + } + this.safelist = raw.typesMap; + for (const key in raw.simpleMap) { + if (hasProperty(raw.simpleMap, key)) { + this.legacySafelist.set(key, raw.simpleMap[key].toLowerCase()); + } + } + } catch (e10) { + this.logger.info(`Error loading types map: ${e10}`); + this.safelist = defaultTypeSafeList; + this.legacySafelist.clear(); + } + } + // eslint-disable-line @typescript-eslint/unified-signatures + updateTypingsForProject(response) { + const project = this.findProject(response.projectName); + if (!project) { + return; + } + switch (response.kind) { + case ActionSet: + project.updateTypingFiles(this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings)); + return; + case ActionInvalidate: + this.typingsCache.enqueueInstallTypingsForProject( + project, + project.lastCachedUnresolvedImportsList, + /*forceRefresh*/ + true + ); + return; + } + } + /** @internal */ + watchTypingLocations(response) { + var _a2; + (_a2 = this.findProject(response.projectName)) == null ? void 0 : _a2.watchTypingLocations(response.files); + } + /** @internal */ + delayEnsureProjectForOpenFiles() { + if (!this.openFiles.size) + return; + this.pendingEnsureProjectForOpenFiles = true; + this.throttledOperations.schedule( + ensureProjectForOpenFileSchedule, + /*delay*/ + 2500, + () => { + if (this.pendingProjectUpdates.size !== 0) { + this.delayEnsureProjectForOpenFiles(); + } else { + if (this.pendingEnsureProjectForOpenFiles) { + this.ensureProjectForOpenFiles(); + this.sendProjectsUpdatedInBackgroundEvent(); + } + } + } + ); + } + delayUpdateProjectGraph(project) { + project.markAsDirty(); + if (isBackgroundProject(project)) + return; + const projectName = project.getProjectName(); + this.pendingProjectUpdates.set(projectName, project); + this.throttledOperations.schedule( + projectName, + /*delay*/ + 250, + () => { + if (this.pendingProjectUpdates.delete(projectName)) { + updateProjectIfDirty(project); + } + } + ); + } + /** @internal */ + hasPendingProjectUpdate(project) { + return this.pendingProjectUpdates.has(project.getProjectName()); + } + /** @internal */ + sendProjectsUpdatedInBackgroundEvent() { + if (!this.eventHandler) { + return; + } + const event = { + eventName: ProjectsUpdatedInBackgroundEvent, + data: { + openFiles: arrayFrom(this.openFiles.keys(), (path2) => this.getScriptInfoForPath(path2).fileName) + } + }; + this.eventHandler(event); + } + /** @internal */ + sendLargeFileReferencedEvent(file, fileSize) { + if (!this.eventHandler) { + return; + } + const event = { + eventName: LargeFileReferencedEvent, + data: { file, fileSize, maxFileSize } + }; + this.eventHandler(event); + } + /** @internal */ + sendProjectLoadingStartEvent(project, reason) { + if (!this.eventHandler) { + return; + } + project.sendLoadingProjectFinish = true; + const event = { + eventName: ProjectLoadingStartEvent, + data: { project, reason } + }; + this.eventHandler(event); + } + /** @internal */ + sendProjectLoadingFinishEvent(project) { + if (!this.eventHandler || !project.sendLoadingProjectFinish) { + return; + } + project.sendLoadingProjectFinish = false; + const event = { + eventName: ProjectLoadingFinishEvent, + data: { project } + }; + this.eventHandler(event); + } + /** @internal */ + sendPerformanceEvent(kind, durationMs) { + if (this.performanceEventHandler) { + this.performanceEventHandler({ kind, durationMs }); + } + } + /** @internal */ + delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project) { + this.delayUpdateProjectGraph(project); + this.delayEnsureProjectForOpenFiles(); + } + delayUpdateProjectGraphs(projects, clearSourceMapperCache) { + if (projects.length) { + for (const project of projects) { + if (clearSourceMapperCache) + project.clearSourceMapperCache(); + this.delayUpdateProjectGraph(project); + } + this.delayEnsureProjectForOpenFiles(); + } + } + setCompilerOptionsForInferredProjects(projectCompilerOptions, projectRootPath) { + Debug.assert(projectRootPath === void 0 || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); + const compilerOptions = convertCompilerOptions(projectCompilerOptions); + const watchOptions = convertWatchOptions(projectCompilerOptions, projectRootPath); + const typeAcquisition = convertTypeAcquisition(projectCompilerOptions); + compilerOptions.allowNonTsExtensions = true; + const canonicalProjectRootPath = projectRootPath && this.toCanonicalFileName(projectRootPath); + if (canonicalProjectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions); + this.watchOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, watchOptions || false); + this.typeAcquisitionForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, typeAcquisition); + } else { + this.compilerOptionsForInferredProjects = compilerOptions; + this.watchOptionsForInferredProjects = watchOptions; + this.typeAcquisitionForInferredProjects = typeAcquisition; + } + for (const project of this.inferredProjects) { + if (canonicalProjectRootPath ? project.projectRootPath === canonicalProjectRootPath : !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + project.setCompilerOptions(compilerOptions); + project.setTypeAcquisition(typeAcquisition); + project.setWatchOptions(watchOptions == null ? void 0 : watchOptions.watchOptions); + project.setProjectErrors(watchOptions == null ? void 0 : watchOptions.errors); + project.compileOnSaveEnabled = compilerOptions.compileOnSave; + project.markAsDirty(); + this.delayUpdateProjectGraph(project); + } + } + this.delayEnsureProjectForOpenFiles(); + } + findProject(projectName) { + if (projectName === void 0) { + return void 0; + } + if (isInferredProjectName(projectName)) { + return findProjectByName(projectName, this.inferredProjects); + } + return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(toNormalizedPath(projectName)); + } + /** @internal */ + forEachProject(cb) { + this.externalProjects.forEach(cb); + this.configuredProjects.forEach(cb); + this.inferredProjects.forEach(cb); + } + /** @internal */ + forEachEnabledProject(cb) { + this.forEachProject((project) => { + if (!project.isOrphan() && project.languageServiceEnabled) { + cb(project); + } + }); + } + getDefaultProjectForFile(fileName, ensureProject) { + return ensureProject ? this.ensureDefaultProjectForFile(fileName) : this.tryGetDefaultProjectForFile(fileName); + } + /** @internal */ + tryGetDefaultProjectForFile(fileNameOrScriptInfo) { + const scriptInfo = isString4(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo; + return scriptInfo && !scriptInfo.isOrphan() ? scriptInfo.getDefaultProject() : void 0; + } + /** @internal */ + ensureDefaultProjectForFile(fileNameOrScriptInfo) { + return this.tryGetDefaultProjectForFile(fileNameOrScriptInfo) || this.doEnsureDefaultProjectForFile(fileNameOrScriptInfo); + } + doEnsureDefaultProjectForFile(fileNameOrScriptInfo) { + this.ensureProjectStructuresUptoDate(); + const scriptInfo = isString4(fileNameOrScriptInfo) ? this.getScriptInfoForNormalizedPath(fileNameOrScriptInfo) : fileNameOrScriptInfo; + return scriptInfo ? scriptInfo.getDefaultProject() : (this.logErrorForScriptInfoNotFound(isString4(fileNameOrScriptInfo) ? fileNameOrScriptInfo : fileNameOrScriptInfo.fileName), Errors.ThrowNoProject()); + } + getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName) { + this.ensureProjectStructuresUptoDate(); + return this.getScriptInfo(uncheckedFileName); + } + /** + * Ensures the project structures are upto date + * This means, + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project + */ + ensureProjectStructuresUptoDate() { + let hasChanges = this.pendingEnsureProjectForOpenFiles; + this.pendingProjectUpdates.clear(); + const updateGraph = (project) => { + hasChanges = updateProjectIfDirty(project) || hasChanges; + }; + this.externalProjects.forEach(updateGraph); + this.configuredProjects.forEach(updateGraph); + this.inferredProjects.forEach(updateGraph); + if (hasChanges) { + this.ensureProjectForOpenFiles(); + } + } + getFormatCodeOptions(file) { + const info2 = this.getScriptInfoForNormalizedPath(file); + return info2 && info2.getFormatCodeSettings() || this.hostConfiguration.formatCodeOptions; + } + getPreferences(file) { + const info2 = this.getScriptInfoForNormalizedPath(file); + return { ...this.hostConfiguration.preferences, ...info2 && info2.getPreferences() }; + } + getHostFormatCodeOptions() { + return this.hostConfiguration.formatCodeOptions; + } + getHostPreferences() { + return this.hostConfiguration.preferences; + } + onSourceFileChanged(info2, eventKind) { + if (eventKind === 2) { + this.handleDeletedFile(info2); + } else if (!info2.isScriptOpen()) { + info2.delayReloadNonMixedContentFile(); + this.delayUpdateProjectGraphs( + info2.containingProjects, + /*clearSourceMapperCache*/ + false + ); + this.handleSourceMapProjects(info2); + } + } + handleSourceMapProjects(info2) { + if (info2.sourceMapFilePath) { + if (isString4(info2.sourceMapFilePath)) { + const sourceMapFileInfo = this.getScriptInfoForPath(info2.sourceMapFilePath); + this.delayUpdateSourceInfoProjects(sourceMapFileInfo && sourceMapFileInfo.sourceInfos); + } else { + this.delayUpdateSourceInfoProjects(info2.sourceMapFilePath.sourceInfos); + } + } + this.delayUpdateSourceInfoProjects(info2.sourceInfos); + if (info2.declarationInfoPath) { + this.delayUpdateProjectsOfScriptInfoPath(info2.declarationInfoPath); + } + } + delayUpdateSourceInfoProjects(sourceInfos) { + if (sourceInfos) { + sourceInfos.forEach((_value, path2) => this.delayUpdateProjectsOfScriptInfoPath(path2)); + } + } + delayUpdateProjectsOfScriptInfoPath(path2) { + const info2 = this.getScriptInfoForPath(path2); + if (info2) { + this.delayUpdateProjectGraphs( + info2.containingProjects, + /*clearSourceMapperCache*/ + true + ); + } + } + handleDeletedFile(info2) { + this.stopWatchingScriptInfo(info2); + if (!info2.isScriptOpen()) { + this.deleteScriptInfo(info2); + const containingProjects = info2.containingProjects.slice(); + info2.detachAllProjects(); + this.delayUpdateProjectGraphs( + containingProjects, + /*clearSourceMapperCache*/ + false + ); + this.handleSourceMapProjects(info2); + info2.closeSourceMapFileWatcher(); + if (info2.declarationInfoPath) { + const declarationInfo = this.getScriptInfoForPath(info2.declarationInfoPath); + if (declarationInfo) { + declarationInfo.sourceMapFilePath = void 0; + } + } + } + } + /** + * This is to watch whenever files are added or removed to the wildcard directories + * + * @internal + */ + watchWildcardDirectory(directory, flags, configFileName, config3) { + let watcher = this.watchFactory.watchDirectory( + directory, + (fileOrDirectory) => { + const fileOrDirectoryPath = this.toPath(fileOrDirectory); + const fsResult = config3.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + if (getBaseFileName(fileOrDirectoryPath) === "package.json" && !isInsideNodeModules(fileOrDirectoryPath) && (fsResult && fsResult.fileExists || !fsResult && this.host.fileExists(fileOrDirectory))) { + const file = this.getNormalizedAbsolutePath(fileOrDirectory); + this.logger.info(`Config: ${configFileName} Detected new package.json: ${file}`); + this.packageJsonCache.addOrUpdate(file, fileOrDirectoryPath); + this.watchPackageJsonFile(file, fileOrDirectoryPath, result2); + } + const configuredProjectForConfig = this.findConfiguredProjectByProjectName(configFileName); + if (isIgnoredFileFromWildCardWatching({ + watchedDirPath: this.toPath(directory), + fileOrDirectory, + fileOrDirectoryPath, + configFileName, + extraFileExtensions: this.hostConfiguration.extraFileExtensions, + currentDirectory: this.currentDirectory, + options: config3.parsedCommandLine.options, + program: (configuredProjectForConfig == null ? void 0 : configuredProjectForConfig.getCurrentProgram()) || config3.parsedCommandLine.fileNames, + useCaseSensitiveFileNames: this.host.useCaseSensitiveFileNames, + writeLog: (s7) => this.logger.info(s7), + toPath: (s7) => this.toPath(s7), + getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0 + })) + return; + if (config3.updateLevel !== 2) + config3.updateLevel = 1; + config3.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => { + if (!watchWildcardDirectories) + return; + const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); + if (!project) + return; + const updateLevel = configuredProjectForConfig === project ? 1 : 0; + if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel) + return; + if (this.openFiles.has(fileOrDirectoryPath)) { + const info2 = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath)); + if (info2.isAttached(project)) { + const loadLevelToSet = Math.max( + updateLevel, + project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 + /* Update */ + ); + project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet); + } else { + project.pendingUpdateLevel = updateLevel; + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); + } + } else { + project.pendingUpdateLevel = updateLevel; + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); + } + }); + }, + flags, + this.getWatchOptionsFromProjectWatchOptions(config3.parsedCommandLine.watchOptions), + WatchType.WildcardDirectory, + configFileName + ); + const result2 = { + packageJsonWatches: void 0, + close() { + var _a2; + if (watcher) { + watcher.close(); + watcher = void 0; + (_a2 = result2.packageJsonWatches) == null ? void 0 : _a2.forEach((watcher2) => { + watcher2.projects.delete(result2); + watcher2.close(); + }); + result2.packageJsonWatches = void 0; + } + } + }; + return result2; + } + /** @internal */ + delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) { + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config)) + return false; + let scheduledAnyProjectUpdate = false; + configFileExistenceInfo.config.updateLevel = 2; + configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => { + const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath); + if (!project) + return; + scheduledAnyProjectUpdate = true; + if (projectCanonicalPath === canonicalConfigFilePath) { + if (project.isInitialLoadPending()) + return; + project.pendingUpdateLevel = 2; + project.pendingUpdateReason = loadReason; + this.delayUpdateProjectGraph(project); + } else { + project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(canonicalConfigFilePath)); + this.delayUpdateProjectGraph(project); + } + }); + return scheduledAnyProjectUpdate; + } + /** @internal */ + onConfigFileChanged(canonicalConfigFilePath, eventKind) { + var _a2; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (eventKind === 2) { + configFileExistenceInfo.exists = false; + const project = ((_a2 = configFileExistenceInfo.config) == null ? void 0 : _a2.projects.has(canonicalConfigFilePath)) ? this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath) : void 0; + if (project) + this.removeProject(project); + } else { + configFileExistenceInfo.exists = true; + } + this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, "Change in config file detected"); + this.reloadConfiguredProjectForFiles( + configFileExistenceInfo.openFilesImpactedByConfigFile, + /*clearSemanticCache*/ + false, + /*delayReload*/ + true, + eventKind !== 2 ? identity2 : ( + // Reload open files if they are root of inferred project + returnTrue + ), + // Reload all the open files impacted by config file + "Change in config file detected" + ); + this.delayEnsureProjectForOpenFiles(); + } + removeProject(project) { + this.logger.info("`remove Project::"); + project.print( + /*writeProjectFileNames*/ + true, + /*writeFileExplaination*/ + true, + /*writeFileVersionAndText*/ + false + ); + project.close(); + if (Debug.shouldAssert( + 1 + /* Normal */ + )) { + this.filenameToScriptInfo.forEach( + (info2) => Debug.assert( + !info2.isAttached(project), + "Found script Info still attached to project", + () => `${project.projectName}: ScriptInfos still attached: ${JSON.stringify( + arrayFrom( + mapDefinedIterator( + this.filenameToScriptInfo.values(), + (info22) => info22.isAttached(project) ? { + fileName: info22.fileName, + projects: info22.containingProjects.map((p7) => p7.projectName), + hasMixedContent: info22.hasMixedContent + } : void 0 + ) + ), + /*replacer*/ + void 0, + " " + )}` + ) + ); + } + this.pendingProjectUpdates.delete(project.getProjectName()); + switch (project.projectKind) { + case 2: + unorderedRemoveItem(this.externalProjects, project); + this.projectToSizeMap.delete(project.getProjectName()); + break; + case 1: + this.configuredProjects.delete(project.canonicalConfigFilePath); + this.projectToSizeMap.delete(project.canonicalConfigFilePath); + break; + case 0: + unorderedRemoveItem(this.inferredProjects, project); + break; + } + } + /** @internal */ + assignOrphanScriptInfoToInferredProject(info2, projectRootPath) { + Debug.assert(info2.isOrphan()); + const project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(info2, projectRootPath) || this.getOrCreateSingleInferredProjectIfEnabled() || this.getOrCreateSingleInferredWithoutProjectRoot( + info2.isDynamic ? projectRootPath || this.currentDirectory : getDirectoryPath( + isRootedDiskPath(info2.fileName) ? info2.fileName : getNormalizedAbsolutePath( + info2.fileName, + projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory + ) + ) + ); + project.addRoot(info2); + if (info2.containingProjects[0] !== project) { + orderedRemoveItem(info2.containingProjects, project); + info2.containingProjects.unshift(project); + } + project.updateGraph(); + if (!this.useSingleInferredProject && !project.projectRootPath) { + for (const inferredProject of this.inferredProjects) { + if (inferredProject === project || inferredProject.isOrphan()) { + continue; + } + const roots = inferredProject.getRootScriptInfos(); + Debug.assert(roots.length === 1 || !!inferredProject.projectRootPath); + if (roots.length === 1 && forEach4(roots[0].containingProjects, (p7) => p7 !== roots[0].containingProjects[0] && !p7.isOrphan())) { + inferredProject.removeFile( + roots[0], + /*fileExists*/ + true, + /*detachFromProject*/ + true + ); + } + } + } + return project; + } + assignOrphanScriptInfosToInferredProject() { + this.openFiles.forEach((projectRootPath, path2) => { + const info2 = this.getScriptInfoForPath(path2); + if (info2.isOrphan()) { + this.assignOrphanScriptInfoToInferredProject(info2, projectRootPath); + } + }); + } + /** + * Remove this file from the set of open, non-configured files. + * @param info The file that has been closed or newly configured + */ + closeOpenFile(info2, skipAssignOrphanScriptInfosToInferredProject) { + const fileExists = info2.isDynamic ? false : this.host.fileExists(info2.fileName); + info2.close(fileExists); + this.stopWatchingConfigFilesForClosedScriptInfo(info2); + const canonicalFileName = this.toCanonicalFileName(info2.fileName); + if (this.openFilesWithNonRootedDiskPath.get(canonicalFileName) === info2) { + this.openFilesWithNonRootedDiskPath.delete(canonicalFileName); + } + let ensureProjectsForOpenFiles = false; + for (const p7 of info2.containingProjects) { + if (isConfiguredProject(p7)) { + if (info2.hasMixedContent) { + info2.registerFileUpdate(); + } + const updateLevel = p7.openFileWatchTriggered.get(info2.path); + if (updateLevel !== void 0) { + p7.openFileWatchTriggered.delete(info2.path); + if (p7.pendingUpdateLevel !== void 0 && p7.pendingUpdateLevel < updateLevel) { + p7.pendingUpdateLevel = updateLevel; + p7.markFileAsDirty(info2.path); + } + } + } else if (isInferredProject(p7) && p7.isRoot(info2)) { + if (p7.isProjectWithSingleRoot()) { + ensureProjectsForOpenFiles = true; + } + p7.removeFile( + info2, + fileExists, + /*detachFromProject*/ + true + ); + } + if (!p7.languageServiceEnabled) { + p7.markAsDirty(); + } + } + this.openFiles.delete(info2.path); + this.configFileForOpenFiles.delete(info2.path); + if (!skipAssignOrphanScriptInfosToInferredProject && ensureProjectsForOpenFiles) { + this.assignOrphanScriptInfosToInferredProject(); + } + if (fileExists) { + this.watchClosedScriptInfo(info2); + } else { + this.handleDeletedFile(info2); + } + return ensureProjectsForOpenFiles; + } + deleteScriptInfo(info2) { + this.filenameToScriptInfo.delete(info2.path); + this.filenameToScriptInfoVersion.set(info2.path, info2.textStorage.version); + const realpath2 = info2.getRealpathIfDifferent(); + if (realpath2) { + this.realpathToScriptInfos.remove(realpath2, info2); + } + } + configFileExists(configFileName, canonicalConfigFilePath, info2) { + var _a2; + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (configFileExistenceInfo) { + if (isOpenScriptInfo(info2) && !((_a2 = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a2.has(info2.path))) { + (configFileExistenceInfo.openFilesImpactedByConfigFile || (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info2.path, false); + } + return configFileExistenceInfo.exists; + } + const exists = this.host.fileExists(configFileName); + let openFilesImpactedByConfigFile; + if (isOpenScriptInfo(info2)) { + (openFilesImpactedByConfigFile || (openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info2.path, false); + } + configFileExistenceInfo = { exists, openFilesImpactedByConfigFile }; + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); + return exists; + } + /** @internal */ + createConfigFileWatcherForParsedConfig(configFileName, canonicalConfigFilePath, forProject) { + var _a2, _b; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo.watcher || configFileExistenceInfo.watcher === noopConfigFileWatcher) { + configFileExistenceInfo.watcher = this.watchFactory.watchFile( + configFileName, + (_fileName, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind), + 2e3, + this.getWatchOptionsFromProjectWatchOptions((_b = (_a2 = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config) == null ? void 0 : _a2.parsedCommandLine) == null ? void 0 : _b.watchOptions), + WatchType.ConfigFile, + forProject + ); + } + const projects = configFileExistenceInfo.config.projects; + projects.set(forProject.canonicalConfigFilePath, projects.get(forProject.canonicalConfigFilePath) || false); + } + /** + * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project + */ + configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo) { + return configFileExistenceInfo.openFilesImpactedByConfigFile && forEachEntry(configFileExistenceInfo.openFilesImpactedByConfigFile, identity2); + } + /** @internal */ + releaseParsedConfig(canonicalConfigFilePath, forProject) { + var _a2, _b, _c; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!((_a2 = configFileExistenceInfo.config) == null ? void 0 : _a2.projects.delete(forProject.canonicalConfigFilePath))) + return; + if ((_b = configFileExistenceInfo.config) == null ? void 0 : _b.projects.size) + return; + configFileExistenceInfo.config = void 0; + clearSharedExtendedConfigFileWatcher(canonicalConfigFilePath, this.sharedExtendedConfigFileWatchers); + Debug.checkDefined(configFileExistenceInfo.watcher); + if ((_c = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _c.size) { + if (this.configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo)) { + if (!canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath)))) { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = noopConfigFileWatcher; + } + } else { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = void 0; + } + } else { + configFileExistenceInfo.watcher.close(); + this.configFileExistenceInfoCache.delete(canonicalConfigFilePath); + } + } + /** + * Close the config file watcher in the cached ConfigFileExistenceInfo + * if there arent any open files that are root of inferred project and there is no parsed config held by any project + * + * @internal + */ + closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo) { + if (configFileExistenceInfo.watcher && !configFileExistenceInfo.config && !this.configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo)) { + configFileExistenceInfo.watcher.close(); + configFileExistenceInfo.watcher = void 0; + } + } + /** + * This is called on file close, so that we stop watching the config file for this script info + */ + stopWatchingConfigFilesForClosedScriptInfo(info2) { + Debug.assert(!info2.isScriptOpen()); + this.forEachConfigFileLocation(info2, (canonicalConfigFilePath) => { + var _a2, _b, _c; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (configFileExistenceInfo) { + const infoIsRootOfInferredProject = (_a2 = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a2.get(info2.path); + (_b = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _b.delete(info2.path); + if (infoIsRootOfInferredProject) { + this.closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo); + } + if (!((_c = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _c.size) && !configFileExistenceInfo.config) { + Debug.assert(!configFileExistenceInfo.watcher); + this.configFileExistenceInfoCache.delete(canonicalConfigFilePath); + } + } + }); + } + /** + * This is called by inferred project whenever script info is added as a root + * + * @internal + */ + startWatchingConfigFilesForInferredProjectRoot(info2) { + Debug.assert(info2.isScriptOpen()); + this.forEachConfigFileLocation(info2, (canonicalConfigFilePath, configFileName) => { + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + configFileExistenceInfo = { exists: this.host.fileExists(configFileName) }; + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); + } + (configFileExistenceInfo.openFilesImpactedByConfigFile || (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Map())).set(info2.path, true); + configFileExistenceInfo.watcher || (configFileExistenceInfo.watcher = canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath))) ? this.watchFactory.watchFile( + configFileName, + (_filename, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind), + 2e3, + this.hostConfiguration.watchOptions, + WatchType.ConfigFileForInferredRoot + ) : noopConfigFileWatcher); + }); + } + /** + * This is called by inferred project whenever root script info is removed from it + * + * @internal + */ + stopWatchingConfigFilesForInferredProjectRoot(info2) { + this.forEachConfigFileLocation(info2, (canonicalConfigFilePath) => { + var _a2; + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if ((_a2 = configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _a2.has(info2.path)) { + Debug.assert(info2.isScriptOpen()); + configFileExistenceInfo.openFilesImpactedByConfigFile.set(info2.path, false); + this.closeConfigFileWatcherOnReleaseOfOpenFile(configFileExistenceInfo); + } + }); + } + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + */ + forEachConfigFileLocation(info2, action) { + if (this.serverMode !== 0) { + return void 0; + } + Debug.assert(!isOpenScriptInfo(info2) || this.openFiles.has(info2.path)); + const projectRootPath = this.openFiles.get(info2.path); + const scriptInfo = Debug.checkDefined(this.getScriptInfo(info2.path)); + if (scriptInfo.isDynamic) + return void 0; + let searchPath = asNormalizedPath(getDirectoryPath(info2.fileName)); + const isSearchPathInProjectRoot = () => containsPath(projectRootPath, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames); + const anySearchPathOk = !projectRootPath || !isSearchPathInProjectRoot(); + let searchInDirectory = !isAncestorConfigFileInfo(info2); + do { + if (searchInDirectory) { + const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName); + const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json")); + let result2 = action(combinePaths(canonicalSearchPath, "tsconfig.json"), tsconfigFileName); + if (result2) + return tsconfigFileName; + const jsconfigFileName = asNormalizedPath(combinePaths(searchPath, "jsconfig.json")); + result2 = action(combinePaths(canonicalSearchPath, "jsconfig.json"), jsconfigFileName); + if (result2) + return jsconfigFileName; + if (isNodeModulesDirectory(canonicalSearchPath)) { + break; + } + } + const parentPath = asNormalizedPath(getDirectoryPath(searchPath)); + if (parentPath === searchPath) + break; + searchPath = parentPath; + searchInDirectory = true; + } while (anySearchPathOk || isSearchPathInProjectRoot()); + return void 0; + } + /** @internal */ + findDefaultConfiguredProject(info2) { + if (!info2.isScriptOpen()) + return void 0; + const configFileName = this.getConfigFileNameForFile(info2); + const project = configFileName && this.findConfiguredProjectByProjectName(configFileName); + return project && projectContainsInfoDirectly(project, info2) ? project : project == null ? void 0 : project.getDefaultChildProjectFromProjectWithReferences(info2); + } + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + * If script info is passed in, it is asserted to be open script info + * otherwise just file name + */ + getConfigFileNameForFile(info2) { + if (!isAncestorConfigFileInfo(info2)) { + const result2 = this.configFileForOpenFiles.get(info2.path); + if (result2 !== void 0) + return result2 || void 0; + } + this.logger.info(`Search path: ${getDirectoryPath(info2.fileName)}`); + const configFileName = this.forEachConfigFileLocation(info2, (canonicalConfigFilePath, configFileName2) => this.configFileExists(configFileName2, canonicalConfigFilePath, info2)); + if (configFileName) { + this.logger.info(`For info: ${info2.fileName} :: Config file name: ${configFileName}`); + } else { + this.logger.info(`For info: ${info2.fileName} :: No config files found.`); + } + if (isOpenScriptInfo(info2)) { + this.configFileForOpenFiles.set(info2.path, configFileName || false); + } + return configFileName; + } + printProjects() { + if (!this.logger.hasLevel( + 1 + /* normal */ + )) { + return; + } + this.logger.startGroup(); + this.externalProjects.forEach(printProjectWithoutFileNames); + this.configuredProjects.forEach(printProjectWithoutFileNames); + this.inferredProjects.forEach(printProjectWithoutFileNames); + this.logger.info("Open files: "); + this.openFiles.forEach((projectRootPath, path2) => { + const info2 = this.getScriptInfoForPath(path2); + this.logger.info(` FileName: ${info2.fileName} ProjectRootPath: ${projectRootPath}`); + this.logger.info(` Projects: ${info2.containingProjects.map((p7) => p7.getProjectName())}`); + }); + this.logger.endGroup(); + } + /** @internal */ + findConfiguredProjectByProjectName(configFileName) { + const canonicalConfigFilePath = asNormalizedPath(this.toCanonicalFileName(configFileName)); + return this.getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath); + } + getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath) { + return this.configuredProjects.get(canonicalConfigFilePath); + } + findExternalProjectByProjectName(projectFileName) { + return findProjectByName(projectFileName, this.externalProjects); + } + /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ + getFilenameForExceededTotalSizeLimitForNonTsFiles(name2, options, fileNames, propertyReader) { + if (options && options.disableSizeLimit || !this.host.getFileSize) { + return; + } + let availableSpace = maxProgramSizeForNonTsFiles; + this.projectToSizeMap.set(name2, 0); + this.projectToSizeMap.forEach((val) => availableSpace -= val || 0); + let totalNonTsFileSize = 0; + for (const f8 of fileNames) { + const fileName = propertyReader.getFileName(f8); + if (hasTSFileExtension(fileName)) { + continue; + } + totalNonTsFileSize += this.host.getFileSize(fileName); + if (totalNonTsFileSize > maxProgramSizeForNonTsFiles || totalNonTsFileSize > availableSpace) { + const top5LargestFiles = fileNames.map((f22) => propertyReader.getFileName(f22)).filter((name22) => !hasTSFileExtension(name22)).map((name22) => ({ name: name22, size: this.host.getFileSize(name22) })).sort((a7, b8) => b8.size - a7.size).slice(0, 5); + this.logger.info(`Non TS file size exceeded limit (${totalNonTsFileSize}). Largest files: ${top5LargestFiles.map((file) => `${file.name}:${file.size}`).join(", ")}`); + return fileName; + } + } + this.projectToSizeMap.set(name2, totalNonTsFileSize); + } + createExternalProject(projectFileName, files, options, typeAcquisition, excludedFiles) { + const compilerOptions = convertCompilerOptions(options); + const watchOptionsAndErrors = convertWatchOptions(options, getDirectoryPath(normalizeSlashes(projectFileName))); + const project = new ExternalProject2( + projectFileName, + this, + this.documentRegistry, + compilerOptions, + /*lastFileExceededProgramSize*/ + this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), + options.compileOnSave === void 0 ? true : options.compileOnSave, + /*projectFilePath*/ + void 0, + watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions + ); + project.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors); + project.excludedFiles = excludedFiles; + this.addFilesToNonInferredProject(project, files, externalFilePropertyReader, typeAcquisition); + this.externalProjects.push(project); + return project; + } + /** @internal */ + sendProjectTelemetry(project) { + if (this.seenProjects.has(project.projectName)) { + setProjectOptionsUsed(project); + return; + } + this.seenProjects.set(project.projectName, true); + if (!this.eventHandler || !this.host.createSHA256Hash) { + setProjectOptionsUsed(project); + return; + } + const projectOptions = isConfiguredProject(project) ? project.projectOptions : void 0; + setProjectOptionsUsed(project); + const data = { + projectId: this.host.createSHA256Hash(project.projectName), + fileStats: countEachFileTypes( + project.getScriptInfos(), + /*includeSizes*/ + true + ), + compilerOptions: convertCompilerOptionsForTelemetry(project.getCompilationSettings()), + typeAcquisition: convertTypeAcquisition2(project.getTypeAcquisition()), + extends: projectOptions && projectOptions.configHasExtendsProperty, + files: projectOptions && projectOptions.configHasFilesProperty, + include: projectOptions && projectOptions.configHasIncludeProperty, + exclude: projectOptions && projectOptions.configHasExcludeProperty, + compileOnSave: project.compileOnSaveEnabled, + configFileName: configFileName(), + projectType: project instanceof ExternalProject2 ? "external" : "configured", + languageServiceEnabled: project.languageServiceEnabled, + version: version5 + }; + this.eventHandler({ eventName: ProjectInfoTelemetryEvent, data }); + function configFileName() { + if (!isConfiguredProject(project)) { + return "other"; + } + return getBaseConfigFileName(project.getConfigFilePath()) || "other"; + } + function convertTypeAcquisition2({ enable: enable2, include, exclude }) { + return { + enable: enable2, + include: include !== void 0 && include.length !== 0, + exclude: exclude !== void 0 && exclude.length !== 0 + }; + } + } + addFilesToNonInferredProject(project, files, propertyReader, typeAcquisition) { + this.updateNonInferredProjectFiles(project, files, propertyReader); + project.setTypeAcquisition(typeAcquisition); + project.markAsDirty(); + } + /** @internal */ + createConfiguredProject(configFileName) { + var _a2; + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "createConfiguredProject", { configFilePath: configFileName }); + this.logger.info(`Creating configuration project ${configFileName}`); + const canonicalConfigFilePath = asNormalizedPath(this.toCanonicalFileName(configFileName)); + let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo) { + this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo = { exists: true }); + } else { + configFileExistenceInfo.exists = true; + } + if (!configFileExistenceInfo.config) { + configFileExistenceInfo.config = { + cachedDirectoryStructureHost: createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames), + projects: /* @__PURE__ */ new Map(), + updateLevel: 2 + /* Full */ + }; + } + const project = new ConfiguredProject2( + configFileName, + canonicalConfigFilePath, + this, + this.documentRegistry, + configFileExistenceInfo.config.cachedDirectoryStructureHost + ); + this.configuredProjects.set(canonicalConfigFilePath, project); + this.createConfigFileWatcherForParsedConfig(configFileName, canonicalConfigFilePath, project); + return project; + } + /** @internal */ + createConfiguredProjectWithDelayLoad(configFileName, reason) { + const project = this.createConfiguredProject(configFileName); + project.pendingUpdateLevel = 2; + project.pendingUpdateReason = reason; + return project; + } + /** @internal */ + createAndLoadConfiguredProject(configFileName, reason) { + const project = this.createConfiguredProject(configFileName); + this.loadConfiguredProject(project, reason); + return project; + } + /** @internal */ + createLoadAndUpdateConfiguredProject(configFileName, reason) { + const project = this.createAndLoadConfiguredProject(configFileName, reason); + project.updateGraph(); + return project; + } + /** + * Read the config file of the project, and update the project root file names. + * + * @internal + */ + loadConfiguredProject(project, reason) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "loadConfiguredProject", { configFilePath: project.canonicalConfigFilePath }); + this.sendProjectLoadingStartEvent(project, reason); + const configFilename = asNormalizedPath(normalizePath(project.getConfigFilePath())); + const configFileExistenceInfo = this.ensureParsedConfigUptoDate( + configFilename, + project.canonicalConfigFilePath, + this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath), + project + ); + const parsedCommandLine = configFileExistenceInfo.config.parsedCommandLine; + Debug.assert(!!parsedCommandLine.fileNames); + const compilerOptions = parsedCommandLine.options; + if (!project.projectOptions) { + project.projectOptions = { + configHasExtendsProperty: parsedCommandLine.raw.extends !== void 0, + configHasFilesProperty: parsedCommandLine.raw.files !== void 0, + configHasIncludeProperty: parsedCommandLine.raw.include !== void 0, + configHasExcludeProperty: parsedCommandLine.raw.exclude !== void 0 + }; + } + project.canConfigFileJsonReportNoInputFiles = canJsonReportNoInputFiles(parsedCommandLine.raw); + project.setProjectErrors(parsedCommandLine.options.configFile.parseDiagnostics); + project.updateReferences(parsedCommandLine.projectReferences); + const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, compilerOptions, parsedCommandLine.fileNames, fileNamePropertyReader); + if (lastFileExceededProgramSize) { + project.disableLanguageService(lastFileExceededProgramSize); + this.configFileExistenceInfoCache.forEach((_configFileExistenceInfo, canonicalConfigFilePath) => this.stopWatchingWildCards(canonicalConfigFilePath, project)); + } else { + project.setCompilerOptions(compilerOptions); + project.setWatchOptions(parsedCommandLine.watchOptions); + project.enableLanguageService(); + this.watchWildcards(configFilename, configFileExistenceInfo, project); + } + project.enablePluginsWithOptions(compilerOptions); + const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles( + 2 + /* Full */ + )); + this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions); + (_b = tracing) == null ? void 0 : _b.pop(); + } + /** @internal */ + ensureParsedConfigUptoDate(configFilename, canonicalConfigFilePath, configFileExistenceInfo, forProject) { + var _a2, _b, _c; + if (configFileExistenceInfo.config) { + if (!configFileExistenceInfo.config.updateLevel) + return configFileExistenceInfo; + if (configFileExistenceInfo.config.updateLevel === 1) { + this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config); + return configFileExistenceInfo; + } + } + const cachedDirectoryStructureHost = ((_a2 = configFileExistenceInfo.config) == null ? void 0 : _a2.cachedDirectoryStructureHost) || createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); + const configFileContent = tryReadFile(configFilename, (fileName) => this.host.readFile(fileName)); + const configFile = parseJsonText(configFilename, isString4(configFileContent) ? configFileContent : ""); + const configFileErrors = configFile.parseDiagnostics; + if (!isString4(configFileContent)) + configFileErrors.push(configFileContent); + const parsedCommandLine = parseJsonSourceFileConfigFileContent( + configFile, + cachedDirectoryStructureHost, + getDirectoryPath(configFilename), + /*existingOptions*/ + {}, + configFilename, + /*resolutionStack*/ + [], + this.hostConfiguration.extraFileExtensions, + this.extendedConfigCache + ); + if (parsedCommandLine.errors.length) { + configFileErrors.push(...parsedCommandLine.errors); + } + this.logger.info(`Config: ${configFilename} : ${JSON.stringify( + { + rootNames: parsedCommandLine.fileNames, + options: parsedCommandLine.options, + watchOptions: parsedCommandLine.watchOptions, + projectReferences: parsedCommandLine.projectReferences + }, + /*replacer*/ + void 0, + " " + )}`); + const oldCommandLine = (_b = configFileExistenceInfo.config) == null ? void 0 : _b.parsedCommandLine; + if (!configFileExistenceInfo.config) { + configFileExistenceInfo.config = { parsedCommandLine, cachedDirectoryStructureHost, projects: /* @__PURE__ */ new Map() }; + } else { + configFileExistenceInfo.config.parsedCommandLine = parsedCommandLine; + configFileExistenceInfo.config.watchedDirectoriesStale = true; + configFileExistenceInfo.config.updateLevel = void 0; + } + if (!oldCommandLine && !isJsonEqual( + // Old options + this.getWatchOptionsFromProjectWatchOptions( + /*projectOptions*/ + void 0 + ), + // New options + this.getWatchOptionsFromProjectWatchOptions(parsedCommandLine.watchOptions) + )) { + (_c = configFileExistenceInfo.watcher) == null ? void 0 : _c.close(); + configFileExistenceInfo.watcher = void 0; + } + this.createConfigFileWatcherForParsedConfig(configFilename, canonicalConfigFilePath, forProject); + updateSharedExtendedConfigFileWatcher( + canonicalConfigFilePath, + parsedCommandLine.options, + this.sharedExtendedConfigFileWatchers, + (extendedConfigFileName, extendedConfigFilePath) => this.watchFactory.watchFile( + extendedConfigFileName, + () => { + var _a22; + cleanExtendedConfigCache(this.extendedConfigCache, extendedConfigFilePath, (fileName) => this.toPath(fileName)); + let ensureProjectsForOpenFiles = false; + (_a22 = this.sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) == null ? void 0 : _a22.projects.forEach((canonicalPath) => { + ensureProjectsForOpenFiles = this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, `Change in extended config file ${extendedConfigFileName} detected`) || ensureProjectsForOpenFiles; + }); + if (ensureProjectsForOpenFiles) + this.delayEnsureProjectForOpenFiles(); + }, + 2e3, + this.hostConfiguration.watchOptions, + WatchType.ExtendedConfigFile, + configFilename + ), + (fileName) => this.toPath(fileName) + ); + return configFileExistenceInfo; + } + /** @internal */ + watchWildcards(configFileName, { exists, config: config3 }, forProject) { + config3.projects.set(forProject.canonicalConfigFilePath, true); + if (exists) { + if (config3.watchedDirectories && !config3.watchedDirectoriesStale) + return; + config3.watchedDirectoriesStale = false; + updateWatchingWildcardDirectories( + config3.watchedDirectories || (config3.watchedDirectories = /* @__PURE__ */ new Map()), + config3.parsedCommandLine.wildcardDirectories, + // Create new directory watcher + (directory, flags) => this.watchWildcardDirectory(directory, flags, configFileName, config3) + ); + } else { + config3.watchedDirectoriesStale = false; + if (!config3.watchedDirectories) + return; + clearMap(config3.watchedDirectories, closeFileWatcherOf); + config3.watchedDirectories = void 0; + } + } + /** @internal */ + stopWatchingWildCards(canonicalConfigFilePath, forProject) { + const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); + if (!configFileExistenceInfo.config || !configFileExistenceInfo.config.projects.get(forProject.canonicalConfigFilePath)) { + return; + } + configFileExistenceInfo.config.projects.set(forProject.canonicalConfigFilePath, false); + if (forEachEntry(configFileExistenceInfo.config.projects, identity2)) + return; + if (configFileExistenceInfo.config.watchedDirectories) { + clearMap(configFileExistenceInfo.config.watchedDirectories, closeFileWatcherOf); + configFileExistenceInfo.config.watchedDirectories = void 0; + } + configFileExistenceInfo.config.watchedDirectoriesStale = void 0; + } + updateNonInferredProjectFiles(project, files, propertyReader) { + const projectRootFilesMap = project.getRootFilesMap(); + const newRootScriptInfoMap = /* @__PURE__ */ new Map(); + for (const f8 of files) { + const newRootFile = propertyReader.getFileName(f8); + const fileName = toNormalizedPath(newRootFile); + const isDynamic = isDynamicFileName(fileName); + let path2; + if (!isDynamic && !project.fileExists(newRootFile)) { + path2 = normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName); + const existingValue = projectRootFilesMap.get(path2); + if (existingValue) { + if (existingValue.info) { + project.removeFile( + existingValue.info, + /*fileExists*/ + false, + /*detachFromProject*/ + true + ); + existingValue.info = void 0; + } + existingValue.fileName = fileName; + } else { + projectRootFilesMap.set(path2, { fileName }); + } + } else { + const scriptKind = propertyReader.getScriptKind(f8, this.hostConfiguration.extraFileExtensions); + const hasMixedContent = propertyReader.hasMixedContent(f8, this.hostConfiguration.extraFileExtensions); + const scriptInfo = Debug.checkDefined(this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath( + fileName, + project.currentDirectory, + scriptKind, + hasMixedContent, + project.directoryStructureHost + )); + path2 = scriptInfo.path; + const existingValue = projectRootFilesMap.get(path2); + if (!existingValue || existingValue.info !== scriptInfo) { + project.addRoot(scriptInfo, fileName); + if (scriptInfo.isScriptOpen()) { + this.removeRootOfInferredProjectIfNowPartOfOtherProject(scriptInfo); + } + } else { + existingValue.fileName = fileName; + } + } + newRootScriptInfoMap.set(path2, true); + } + if (projectRootFilesMap.size > newRootScriptInfoMap.size) { + projectRootFilesMap.forEach((value2, path2) => { + if (!newRootScriptInfoMap.has(path2)) { + if (value2.info) { + project.removeFile( + value2.info, + project.fileExists(value2.info.fileName), + /*detachFromProject*/ + true + ); + } else { + projectRootFilesMap.delete(path2); + } + } + }); + } + } + updateRootAndOptionsOfNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, watchOptions) { + project.setCompilerOptions(newOptions); + project.setWatchOptions(watchOptions); + if (compileOnSave !== void 0) { + project.compileOnSaveEnabled = compileOnSave; + } + this.addFilesToNonInferredProject(project, newUncheckedFiles, propertyReader, newTypeAcquisition); + } + /** + * Reload the file names from config file specs and update the project graph + * + * @internal + */ + reloadFileNamesOfConfiguredProject(project) { + const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config); + project.updateErrorOnNoInputFiles(fileNames); + this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles( + 1 + /* RootNamesAndUpdate */ + )), fileNamePropertyReader); + project.markAsDirty(); + return project.updateGraph(); + } + /** @internal */ + reloadFileNamesOfParsedConfig(configFileName, config3) { + if (config3.updateLevel === void 0) + return config3.parsedCommandLine.fileNames; + Debug.assert( + config3.updateLevel === 1 + /* RootNamesAndUpdate */ + ); + const configFileSpecs = config3.parsedCommandLine.options.configFile.configFileSpecs; + const fileNames = getFileNamesFromConfigSpecs( + configFileSpecs, + getDirectoryPath(configFileName), + config3.parsedCommandLine.options, + config3.cachedDirectoryStructureHost, + this.hostConfiguration.extraFileExtensions + ); + config3.parsedCommandLine = { ...config3.parsedCommandLine, fileNames }; + return fileNames; + } + /** @internal */ + setFileNamesOfAutpImportProviderOrAuxillaryProject(project, fileNames) { + this.updateNonInferredProjectFiles(project, fileNames, fileNamePropertyReader); + } + /** + * Read the config file of the project again by clearing the cache and update the project graph + * + * @internal + */ + reloadConfiguredProject(project, reason, isInitialLoad, clearSemanticCache) { + const host = project.getCachedDirectoryStructureHost(); + if (clearSemanticCache) + this.clearSemanticCache(project); + host.clearCache(); + const configFileName = project.getConfigFilePath(); + this.logger.info(`${isInitialLoad ? "Loading" : "Reloading"} configured project ${configFileName}`); + this.loadConfiguredProject(project, reason); + project.updateGraph(); + this.sendConfigFileDiagEvent(project, configFileName); + } + /** @internal */ + clearSemanticCache(project) { + project.resolutionCache.clear(); + project.getLanguageService( + /*ensureSynchronized*/ + false + ).cleanupSemanticCache(); + project.cleanupProgram(); + project.markAsDirty(); + } + sendConfigFileDiagEvent(project, triggerFile) { + if (!this.eventHandler || this.suppressDiagnosticEvents) { + return; + } + const diagnostics = project.getLanguageService().getCompilerOptionsDiagnostics(); + diagnostics.push(...project.getAllProjectErrors()); + this.eventHandler( + { + eventName: ConfigFileDiagEvent, + data: { configFileName: project.getConfigFilePath(), diagnostics, triggerFile } + } + ); + } + getOrCreateInferredProjectForProjectRootPathIfEnabled(info2, projectRootPath) { + if (!this.useInferredProjectPerProjectRoot || // Its a dynamic info opened without project root + info2.isDynamic && projectRootPath === void 0) { + return void 0; + } + if (projectRootPath) { + const canonicalProjectRootPath = this.toCanonicalFileName(projectRootPath); + for (const project of this.inferredProjects) { + if (project.projectRootPath === canonicalProjectRootPath) { + return project; + } + } + return this.createInferredProject( + projectRootPath, + /*isSingleInferredProject*/ + false, + projectRootPath + ); + } + let bestMatch; + for (const project of this.inferredProjects) { + if (!project.projectRootPath) + continue; + if (!containsPath(project.projectRootPath, info2.path, this.host.getCurrentDirectory(), !this.host.useCaseSensitiveFileNames)) + continue; + if (bestMatch && bestMatch.projectRootPath.length > project.projectRootPath.length) + continue; + bestMatch = project; + } + return bestMatch; + } + getOrCreateSingleInferredProjectIfEnabled() { + if (!this.useSingleInferredProject) { + return void 0; + } + if (this.inferredProjects.length > 0 && this.inferredProjects[0].projectRootPath === void 0) { + return this.inferredProjects[0]; + } + return this.createInferredProject( + "", + /*isSingleInferredProject*/ + true + ); + } + getOrCreateSingleInferredWithoutProjectRoot(currentDirectory) { + Debug.assert(!this.useSingleInferredProject); + const expectedCurrentDirectory = this.toCanonicalFileName(this.getNormalizedAbsolutePath(currentDirectory)); + for (const inferredProject of this.inferredProjects) { + if (!inferredProject.projectRootPath && inferredProject.isOrphan() && inferredProject.canonicalCurrentDirectory === expectedCurrentDirectory) { + return inferredProject; + } + } + return this.createInferredProject(currentDirectory); + } + createInferredProject(currentDirectory, isSingleInferredProject, projectRootPath) { + const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; + let watchOptionsAndErrors; + let typeAcquisition; + if (projectRootPath) { + watchOptionsAndErrors = this.watchOptionsForInferredProjectsPerProjectRoot.get(projectRootPath); + typeAcquisition = this.typeAcquisitionForInferredProjectsPerProjectRoot.get(projectRootPath); + } + if (watchOptionsAndErrors === void 0) { + watchOptionsAndErrors = this.watchOptionsForInferredProjects; + } + if (typeAcquisition === void 0) { + typeAcquisition = this.typeAcquisitionForInferredProjects; + } + watchOptionsAndErrors = watchOptionsAndErrors || void 0; + const project = new InferredProject2(this, this.documentRegistry, compilerOptions, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions, projectRootPath, currentDirectory, typeAcquisition); + project.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors); + if (isSingleInferredProject) { + this.inferredProjects.unshift(project); + } else { + this.inferredProjects.push(project); + } + return project; + } + /** @internal */ + getOrCreateScriptInfoNotOpenedByClient(uncheckedFileName, currentDirectory, hostToQueryFileExistsOn) { + return this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath( + toNormalizedPath(uncheckedFileName), + currentDirectory, + /*scriptKind*/ + void 0, + /*hasMixedContent*/ + void 0, + hostToQueryFileExistsOn + ); + } + getScriptInfo(uncheckedFileName) { + return this.getScriptInfoForNormalizedPath(toNormalizedPath(uncheckedFileName)); + } + /** @internal */ + getScriptInfoOrConfig(uncheckedFileName) { + const path2 = toNormalizedPath(uncheckedFileName); + const info2 = this.getScriptInfoForNormalizedPath(path2); + if (info2) + return info2; + const configProject = this.configuredProjects.get(this.toPath(uncheckedFileName)); + return configProject && configProject.getCompilerOptions().configFile; + } + /** @internal */ + logErrorForScriptInfoNotFound(fileName) { + const names = arrayFrom(this.filenameToScriptInfo.entries(), ([path2, scriptInfo]) => ({ path: path2, fileName: scriptInfo.fileName })); + this.logger.msg( + `Could not find file ${JSON.stringify(fileName)}. +All files are: ${JSON.stringify(names)}`, + "Err" + /* Err */ + ); + } + /** + * Returns the projects that contain script info through SymLink + * Note that this does not return projects in info.containingProjects + * + * @internal + */ + getSymlinkedProjects(info2) { + let projects; + if (this.realpathToScriptInfos) { + const realpath2 = info2.getRealpathIfDifferent(); + if (realpath2) { + forEach4(this.realpathToScriptInfos.get(realpath2), combineProjects); + } + forEach4(this.realpathToScriptInfos.get(info2.path), combineProjects); + } + return projects; + function combineProjects(toAddInfo) { + if (toAddInfo !== info2) { + for (const project of toAddInfo.containingProjects) { + if (project.languageServiceEnabled && !project.isOrphan() && !project.getCompilerOptions().preserveSymlinks && !info2.isAttached(project)) { + if (!projects) { + projects = createMultiMap(); + projects.add(toAddInfo.path, project); + } else if (!forEachEntry(projects, (projs, path2) => path2 === toAddInfo.path ? false : contains2(projs, project))) { + projects.add(toAddInfo.path, project); + } + } + } + } + } + } + watchClosedScriptInfo(info2) { + Debug.assert(!info2.fileWatcher); + if (!info2.isDynamicOrHasMixedContent() && (!this.globalCacheLocationDirectoryPath || !startsWith2(info2.path, this.globalCacheLocationDirectoryPath))) { + const indexOfNodeModules = info2.fileName.indexOf("/node_modules/"); + if (!this.host.getModifiedTime || indexOfNodeModules === -1) { + info2.fileWatcher = this.watchFactory.watchFile( + info2.fileName, + (_fileName, eventKind) => this.onSourceFileChanged(info2, eventKind), + 500, + this.hostConfiguration.watchOptions, + WatchType.ClosedScriptInfo + ); + } else { + info2.mTime = this.getModifiedTime(info2); + info2.fileWatcher = this.watchClosedScriptInfoInNodeModules(info2.fileName.substring(0, indexOfNodeModules)); + } + } + } + createNodeModulesWatcher(dir2, dirPath) { + let watcher = this.watchFactory.watchDirectory( + dir2, + (fileOrDirectory) => { + var _a2; + const fileOrDirectoryPath = removeIgnoredPath(this.toPath(fileOrDirectory)); + if (!fileOrDirectoryPath) + return; + const basename2 = getBaseFileName(fileOrDirectoryPath); + if (((_a2 = result2.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.size) && (basename2 === "package.json" || basename2 === "node_modules")) { + result2.affectedModuleSpecifierCacheProjects.forEach((project) => { + var _a22; + (_a22 = project.getModuleSpecifierCache()) == null ? void 0 : _a22.clear(); + }); + } + if (result2.refreshScriptInfoRefCount) { + if (dirPath === fileOrDirectoryPath) { + this.refreshScriptInfosInDirectory(dirPath); + } else { + const info2 = this.getScriptInfoForPath(fileOrDirectoryPath); + if (info2) { + if (isScriptInfoWatchedFromNodeModules(info2)) { + this.refreshScriptInfo(info2); + } + } else if (!hasExtension(fileOrDirectoryPath)) { + this.refreshScriptInfosInDirectory(fileOrDirectoryPath); + } + } + } + }, + 1, + this.hostConfiguration.watchOptions, + WatchType.NodeModules + ); + const result2 = { + refreshScriptInfoRefCount: 0, + affectedModuleSpecifierCacheProjects: void 0, + close: () => { + var _a2; + if (watcher && !result2.refreshScriptInfoRefCount && !((_a2 = result2.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.size)) { + watcher.close(); + watcher = void 0; + this.nodeModulesWatchers.delete(dirPath); + } + } + }; + this.nodeModulesWatchers.set(dirPath, result2); + return result2; + } + /** @internal */ + watchPackageJsonsInNodeModules(dir2, project) { + var _a2; + const dirPath = this.toPath(dir2); + const watcher = this.nodeModulesWatchers.get(dirPath) || this.createNodeModulesWatcher(dir2, dirPath); + Debug.assert(!((_a2 = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a2.has(project))); + (watcher.affectedModuleSpecifierCacheProjects || (watcher.affectedModuleSpecifierCacheProjects = /* @__PURE__ */ new Set())).add(project); + return { + close: () => { + var _a22; + (_a22 = watcher.affectedModuleSpecifierCacheProjects) == null ? void 0 : _a22.delete(project); + watcher.close(); + } + }; + } + watchClosedScriptInfoInNodeModules(dir2) { + const watchDir = dir2 + "/node_modules"; + const watchDirPath = this.toPath(watchDir); + const watcher = this.nodeModulesWatchers.get(watchDirPath) || this.createNodeModulesWatcher(watchDir, watchDirPath); + watcher.refreshScriptInfoRefCount++; + return { + close: () => { + watcher.refreshScriptInfoRefCount--; + watcher.close(); + } + }; + } + getModifiedTime(info2) { + return (this.host.getModifiedTime(info2.fileName) || missingFileModifiedTime).getTime(); + } + refreshScriptInfo(info2) { + const mTime = this.getModifiedTime(info2); + if (mTime !== info2.mTime) { + const eventKind = getFileWatcherEventKind(info2.mTime, mTime); + info2.mTime = mTime; + this.onSourceFileChanged(info2, eventKind); + } + } + refreshScriptInfosInDirectory(dir2) { + dir2 = dir2 + directorySeparator; + this.filenameToScriptInfo.forEach((info2) => { + if (isScriptInfoWatchedFromNodeModules(info2) && startsWith2(info2.path, dir2)) { + this.refreshScriptInfo(info2); + } + }); + } + stopWatchingScriptInfo(info2) { + if (info2.fileWatcher) { + info2.fileWatcher.close(); + info2.fileWatcher = void 0; + } + } + getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName, currentDirectory, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + if (isRootedDiskPath(fileName) || isDynamicFileName(fileName)) { + return this.getOrCreateScriptInfoWorker( + fileName, + currentDirectory, + /*openedByClient*/ + false, + /*fileContent*/ + void 0, + scriptKind, + hasMixedContent, + hostToQueryFileExistsOn + ); + } + const info2 = this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(fileName)); + if (info2) { + return info2; + } + return void 0; + } + getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, currentDirectory, fileContent, scriptKind, hasMixedContent) { + return this.getOrCreateScriptInfoWorker( + fileName, + currentDirectory, + /*openedByClient*/ + true, + fileContent, + scriptKind, + hasMixedContent + ); + } + getOrCreateScriptInfoForNormalizedPath(fileName, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + return this.getOrCreateScriptInfoWorker(fileName, this.currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn); + } + getOrCreateScriptInfoWorker(fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + Debug.assert(fileContent === void 0 || openedByClient, "ScriptInfo needs to be opened by client to be able to set its user defined content"); + const path2 = normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName); + let info2 = this.getScriptInfoForPath(path2); + if (!info2) { + const isDynamic = isDynamicFileName(fileName); + Debug.assert(isRootedDiskPath(fileName) || isDynamic || openedByClient, "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Script info with non-dynamic relative file name can only be open script info or in context of host currentDirectory`); + Debug.assert(!isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Open script files with non rooted disk path opened with current directory context cannot have same canonical names`); + Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", () => `${JSON.stringify({ fileName, currentDirectory, hostCurrentDirectory: this.currentDirectory, openKeys: arrayFrom(this.openFilesWithNonRootedDiskPath.keys()) })} +Dynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath.`); + if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) { + return; + } + info2 = new ScriptInfo(this.host, fileName, scriptKind, !!hasMixedContent, path2, this.filenameToScriptInfoVersion.get(path2)); + this.filenameToScriptInfo.set(info2.path, info2); + this.filenameToScriptInfoVersion.delete(info2.path); + if (!openedByClient) { + this.watchClosedScriptInfo(info2); + } else if (!isRootedDiskPath(fileName) && (!isDynamic || this.currentDirectory !== currentDirectory)) { + this.openFilesWithNonRootedDiskPath.set(this.toCanonicalFileName(fileName), info2); + } + } + if (openedByClient) { + this.stopWatchingScriptInfo(info2); + info2.open(fileContent); + if (hasMixedContent) { + info2.registerFileUpdate(); + } + } + return info2; + } + /** + * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred + */ + getScriptInfoForNormalizedPath(fileName) { + return !isRootedDiskPath(fileName) && this.openFilesWithNonRootedDiskPath.get(this.toCanonicalFileName(fileName)) || this.getScriptInfoForPath(normalizedPathToPath(fileName, this.currentDirectory, this.toCanonicalFileName)); + } + getScriptInfoForPath(fileName) { + return this.filenameToScriptInfo.get(fileName); + } + /** @internal */ + getDocumentPositionMapper(project, generatedFileName, sourceFileName) { + const declarationInfo = this.getOrCreateScriptInfoNotOpenedByClient(generatedFileName, project.currentDirectory, this.host); + if (!declarationInfo) { + if (sourceFileName) { + project.addGeneratedFileWatch(generatedFileName, sourceFileName); + } + return void 0; + } + declarationInfo.getSnapshot(); + if (isString4(declarationInfo.sourceMapFilePath)) { + const sourceMapFileInfo2 = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapFileInfo2) { + sourceMapFileInfo2.getSnapshot(); + if (sourceMapFileInfo2.documentPositionMapper !== void 0) { + sourceMapFileInfo2.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo2.sourceInfos); + return sourceMapFileInfo2.documentPositionMapper ? sourceMapFileInfo2.documentPositionMapper : void 0; + } + } + declarationInfo.sourceMapFilePath = void 0; + } else if (declarationInfo.sourceMapFilePath) { + declarationInfo.sourceMapFilePath.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, declarationInfo.sourceMapFilePath.sourceInfos); + return void 0; + } else if (declarationInfo.sourceMapFilePath !== void 0) { + return void 0; + } + let sourceMapFileInfo; + let mapFileNameFromDeclarationInfo; + let readMapFile = (mapFileName, mapFileNameFromDts) => { + const mapInfo = this.getOrCreateScriptInfoNotOpenedByClient(mapFileName, project.currentDirectory, this.host); + if (!mapInfo) { + mapFileNameFromDeclarationInfo = mapFileNameFromDts; + return void 0; + } + sourceMapFileInfo = mapInfo; + const snap = mapInfo.getSnapshot(); + if (mapInfo.documentPositionMapper !== void 0) + return mapInfo.documentPositionMapper; + return getSnapshotText(snap); + }; + const projectName = project.projectName; + const documentPositionMapper = getDocumentPositionMapper( + { getCanonicalFileName: this.toCanonicalFileName, log: (s7) => this.logger.info(s7), getSourceFileLike: (f8) => this.getSourceFileLike(f8, projectName, declarationInfo) }, + declarationInfo.fileName, + declarationInfo.textStorage.getLineInfo(), + readMapFile + ); + readMapFile = void 0; + if (sourceMapFileInfo) { + declarationInfo.sourceMapFilePath = sourceMapFileInfo.path; + sourceMapFileInfo.declarationInfoPath = declarationInfo.path; + sourceMapFileInfo.documentPositionMapper = documentPositionMapper || false; + sourceMapFileInfo.sourceInfos = this.addSourceInfoToSourceMap(sourceFileName, project, sourceMapFileInfo.sourceInfos); + } else if (mapFileNameFromDeclarationInfo) { + declarationInfo.sourceMapFilePath = { + watcher: this.addMissingSourceMapFile( + project.currentDirectory === this.currentDirectory ? mapFileNameFromDeclarationInfo : getNormalizedAbsolutePath(mapFileNameFromDeclarationInfo, project.currentDirectory), + declarationInfo.path + ), + sourceInfos: this.addSourceInfoToSourceMap(sourceFileName, project) + }; + } else { + declarationInfo.sourceMapFilePath = false; + } + return documentPositionMapper; + } + addSourceInfoToSourceMap(sourceFileName, project, sourceInfos) { + if (sourceFileName) { + const sourceInfo = this.getOrCreateScriptInfoNotOpenedByClient(sourceFileName, project.currentDirectory, project.directoryStructureHost); + (sourceInfos || (sourceInfos = /* @__PURE__ */ new Set())).add(sourceInfo.path); + } + return sourceInfos; + } + addMissingSourceMapFile(mapFileName, declarationInfoPath) { + const fileWatcher = this.watchFactory.watchFile( + mapFileName, + () => { + const declarationInfo = this.getScriptInfoForPath(declarationInfoPath); + if (declarationInfo && declarationInfo.sourceMapFilePath && !isString4(declarationInfo.sourceMapFilePath)) { + this.delayUpdateProjectGraphs( + declarationInfo.containingProjects, + /*clearSourceMapperCache*/ + true + ); + this.delayUpdateSourceInfoProjects(declarationInfo.sourceMapFilePath.sourceInfos); + declarationInfo.closeSourceMapFileWatcher(); + } + }, + 2e3, + this.hostConfiguration.watchOptions, + WatchType.MissingSourceMapFile + ); + return fileWatcher; + } + /** @internal */ + getSourceFileLike(fileName, projectNameOrProject, declarationInfo) { + const project = projectNameOrProject.projectName ? projectNameOrProject : this.findProject(projectNameOrProject); + if (project) { + const path2 = project.toPath(fileName); + const sourceFile = project.getSourceFile(path2); + if (sourceFile && sourceFile.resolvedPath === path2) + return sourceFile; + } + const info2 = this.getOrCreateScriptInfoNotOpenedByClient(fileName, (project || this).currentDirectory, project ? project.directoryStructureHost : this.host); + if (!info2) + return void 0; + if (declarationInfo && isString4(declarationInfo.sourceMapFilePath) && info2 !== declarationInfo) { + const sourceMapInfo = this.getScriptInfoForPath(declarationInfo.sourceMapFilePath); + if (sourceMapInfo) { + (sourceMapInfo.sourceInfos || (sourceMapInfo.sourceInfos = /* @__PURE__ */ new Set())).add(info2.path); + } + } + if (info2.cacheSourceFile) + return info2.cacheSourceFile.sourceFile; + if (!info2.sourceFileLike) { + info2.sourceFileLike = { + get text() { + Debug.fail("shouldnt need text"); + return ""; + }, + getLineAndCharacterOfPosition: (pos) => { + const lineOffset = info2.positionToLineOffset(pos); + return { line: lineOffset.line - 1, character: lineOffset.offset - 1 }; + }, + getPositionOfLineAndCharacter: (line, character, allowEdits) => info2.lineOffsetToPosition(line + 1, character + 1, allowEdits) + }; + } + return info2.sourceFileLike; + } + /** @internal */ + setPerformanceEventHandler(performanceEventHandler) { + this.performanceEventHandler = performanceEventHandler; + } + setHostConfiguration(args) { + var _a2; + if (args.file) { + const info2 = this.getScriptInfoForNormalizedPath(toNormalizedPath(args.file)); + if (info2) { + info2.setOptions(convertFormatOptions(args.formatOptions), args.preferences); + this.logger.info(`Host configuration update for file ${args.file}`); + } + } else { + if (args.hostInfo !== void 0) { + this.hostConfiguration.hostInfo = args.hostInfo; + this.logger.info(`Host information ${args.hostInfo}`); + } + if (args.formatOptions) { + this.hostConfiguration.formatCodeOptions = { ...this.hostConfiguration.formatCodeOptions, ...convertFormatOptions(args.formatOptions) }; + this.logger.info("Format host information updated"); + } + if (args.preferences) { + const { + lazyConfiguredProjectsFromExternalProject, + includePackageJsonAutoImports + } = this.hostConfiguration.preferences; + this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences }; + if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) { + this.externalProjectToConfiguredProjectMap.forEach( + (projects) => projects.forEach((project) => { + if (!project.isClosed() && project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 && !this.pendingProjectUpdates.has(project.getProjectName())) { + project.updateGraph(); + } + }) + ); + } + if (includePackageJsonAutoImports !== args.preferences.includePackageJsonAutoImports) { + this.forEachProject((project) => { + project.onAutoImportProviderSettingsChanged(); + }); + } + } + if (args.extraFileExtensions) { + this.hostConfiguration.extraFileExtensions = args.extraFileExtensions; + this.reloadProjects(); + this.logger.info("Host file extension mappings updated"); + } + if (args.watchOptions) { + this.hostConfiguration.watchOptions = (_a2 = convertWatchOptions(args.watchOptions)) == null ? void 0 : _a2.watchOptions; + this.logger.info(`Host watch options changed to ${JSON.stringify(this.hostConfiguration.watchOptions)}, it will be take effect for next watches.`); + } + } + } + /** @internal */ + getWatchOptions(project) { + return this.getWatchOptionsFromProjectWatchOptions(project.getWatchOptions()); + } + /** @internal */ + getWatchOptionsFromProjectWatchOptions(projectOptions) { + return projectOptions && this.hostConfiguration.watchOptions ? { ...this.hostConfiguration.watchOptions, ...projectOptions } : projectOptions || this.hostConfiguration.watchOptions; + } + closeLog() { + this.logger.close(); + } + /** + * This function rebuilds the project for every file opened by the client + * This does not reload contents of open files from disk. But we could do that if needed + */ + reloadProjects() { + this.logger.info("reload projects."); + this.filenameToScriptInfo.forEach((info2) => { + if (this.openFiles.has(info2.path)) + return; + if (!info2.fileWatcher) + return; + this.onSourceFileChanged( + info2, + this.host.fileExists(info2.fileName) ? 1 : 2 + /* Deleted */ + ); + }); + this.pendingProjectUpdates.forEach((_project, projectName) => { + this.throttledOperations.cancel(projectName); + this.pendingProjectUpdates.delete(projectName); + }); + this.throttledOperations.cancel(ensureProjectForOpenFileSchedule); + this.pendingEnsureProjectForOpenFiles = false; + this.configFileExistenceInfoCache.forEach((info2) => { + if (info2.config) + info2.config.updateLevel = 2; + }); + this.reloadConfiguredProjectForFiles( + this.openFiles, + /*clearSemanticCache*/ + true, + /*delayReload*/ + false, + returnTrue, + "User requested reload projects" + ); + this.externalProjects.forEach((project) => { + this.clearSemanticCache(project); + project.updateGraph(); + }); + this.inferredProjects.forEach((project) => this.clearSemanticCache(project)); + this.ensureProjectForOpenFiles(); + this.logger.info("After reloading projects.."); + this.printProjects(); + } + /** + * This function goes through all the openFiles and tries to file the config file for them. + * If the config file is found and it refers to existing project, it reloads it either immediately + * or schedules it for reload depending on delayReload option + * If there is no existing project it just opens the configured project for the config file + * reloadForInfo provides a way to filter out files to reload configured project for + */ + reloadConfiguredProjectForFiles(openFiles, clearSemanticCache, delayReload, shouldReloadProjectFor, reason) { + const updatedProjects = /* @__PURE__ */ new Map(); + const reloadChildProject = (child) => { + if (!updatedProjects.has(child.canonicalConfigFilePath)) { + updatedProjects.set(child.canonicalConfigFilePath, true); + this.reloadConfiguredProject( + child, + reason, + /*isInitialLoad*/ + false, + clearSemanticCache + ); + } + }; + openFiles == null ? void 0 : openFiles.forEach((openFileValue, path2) => { + this.configFileForOpenFiles.delete(path2); + if (!shouldReloadProjectFor(openFileValue)) { + return; + } + const info2 = this.getScriptInfoForPath(path2); + Debug.assert(info2.isScriptOpen()); + const configFileName = this.getConfigFileNameForFile(info2); + if (configFileName) { + const project = this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProject(configFileName); + if (!updatedProjects.has(project.canonicalConfigFilePath)) { + updatedProjects.set(project.canonicalConfigFilePath, true); + if (delayReload) { + project.pendingUpdateLevel = 2; + project.pendingUpdateReason = reason; + if (clearSemanticCache) + this.clearSemanticCache(project); + this.delayUpdateProjectGraph(project); + } else { + this.reloadConfiguredProject( + project, + reason, + /*isInitialLoad*/ + false, + clearSemanticCache + ); + if (!projectContainsInfoDirectly(project, info2)) { + const referencedProject = forEachResolvedProjectReferenceProject( + project, + info2.path, + (child) => { + reloadChildProject(child); + return projectContainsInfoDirectly(child, info2); + }, + 1 + /* FindCreate */ + ); + if (referencedProject) { + forEachResolvedProjectReferenceProject( + project, + /*fileName*/ + void 0, + reloadChildProject, + 0 + /* Find */ + ); + } + } + } + } + } + }); + } + /** + * Remove the root of inferred project if script info is part of another project + */ + removeRootOfInferredProjectIfNowPartOfOtherProject(info2) { + Debug.assert(info2.containingProjects.length > 0); + const firstProject = info2.containingProjects[0]; + if (!firstProject.isOrphan() && isInferredProject(firstProject) && firstProject.isRoot(info2) && forEach4(info2.containingProjects, (p7) => p7 !== firstProject && !p7.isOrphan())) { + firstProject.removeFile( + info2, + /*fileExists*/ + true, + /*detachFromProject*/ + true + ); + } + } + /** + * This function is to update the project structure for every inferred project. + * It is called on the premise that all the configured projects are + * up to date. + * This will go through open files and assign them to inferred project if open file is not part of any other project + * After that all the inferred project graphs are updated + */ + ensureProjectForOpenFiles() { + this.logger.info("Before ensureProjectForOpenFiles:"); + this.printProjects(); + this.openFiles.forEach((projectRootPath, path2) => { + const info2 = this.getScriptInfoForPath(path2); + if (info2.isOrphan()) { + this.assignOrphanScriptInfoToInferredProject(info2, projectRootPath); + } else { + this.removeRootOfInferredProjectIfNowPartOfOtherProject(info2); + } + }); + this.pendingEnsureProjectForOpenFiles = false; + this.inferredProjects.forEach(updateProjectIfDirty); + this.logger.info("After ensureProjectForOpenFiles:"); + this.printProjects(); + } + /** + * Open file whose contents is managed by the client + * @param filename is absolute pathname + * @param fileContent is a known version of the file content that is more up to date than the one on disk + */ + openClientFile(fileName, fileContent, scriptKind, projectRootPath) { + return this.openClientFileWithNormalizedPath( + toNormalizedPath(fileName), + fileContent, + scriptKind, + /*hasMixedContent*/ + false, + projectRootPath ? toNormalizedPath(projectRootPath) : void 0 + ); + } + /** @internal */ + getOriginalLocationEnsuringConfiguredProject(project, location2) { + const isSourceOfProjectReferenceRedirect = project.isSourceOfProjectReferenceRedirect(location2.fileName); + const originalLocation = isSourceOfProjectReferenceRedirect ? location2 : project.getSourceMapper().tryGetSourcePosition(location2); + if (!originalLocation) + return void 0; + const { fileName } = originalLocation; + const scriptInfo = this.getScriptInfo(fileName); + if (!scriptInfo && !this.host.fileExists(fileName)) + return void 0; + const originalFileInfo = { fileName: toNormalizedPath(fileName), path: this.toPath(fileName) }; + const configFileName = this.getConfigFileNameForFile(originalFileInfo); + if (!configFileName) + return void 0; + let configuredProject = this.findConfiguredProjectByProjectName(configFileName); + if (!configuredProject) { + if (project.getCompilerOptions().disableReferencedProjectLoad) { + if (isSourceOfProjectReferenceRedirect) { + return location2; + } + return (scriptInfo == null ? void 0 : scriptInfo.containingProjects.length) ? originalLocation : location2; + } + configuredProject = this.createAndLoadConfiguredProject(configFileName, `Creating project for original file: ${originalFileInfo.fileName}${location2 !== originalLocation ? " for location: " + location2.fileName : ""}`); + } + updateProjectIfDirty(configuredProject); + const projectContainsOriginalInfo = (project2) => { + const info2 = this.getScriptInfo(fileName); + return info2 && projectContainsInfoDirectly(project2, info2); + }; + if (configuredProject.isSolution() || !projectContainsOriginalInfo(configuredProject)) { + configuredProject = forEachResolvedProjectReferenceProject( + configuredProject, + fileName, + (child) => { + updateProjectIfDirty(child); + return projectContainsOriginalInfo(child) ? child : void 0; + }, + 2, + `Creating project referenced in solution ${configuredProject.projectName} to find possible configured project for original file: ${originalFileInfo.fileName}${location2 !== originalLocation ? " for location: " + location2.fileName : ""}` + ); + if (!configuredProject) + return void 0; + if (configuredProject === project) + return originalLocation; + } + addOriginalConfiguredProject(configuredProject); + const originalScriptInfo = this.getScriptInfo(fileName); + if (!originalScriptInfo || !originalScriptInfo.containingProjects.length) + return void 0; + originalScriptInfo.containingProjects.forEach((project2) => { + if (isConfiguredProject(project2)) { + addOriginalConfiguredProject(project2); + } + }); + return originalLocation; + function addOriginalConfiguredProject(originalProject) { + if (!project.originalConfiguredProjects) { + project.originalConfiguredProjects = /* @__PURE__ */ new Set(); + } + project.originalConfiguredProjects.add(originalProject.canonicalConfigFilePath); + } + } + /** @internal */ + fileExists(fileName) { + return !!this.getScriptInfoForNormalizedPath(fileName) || this.host.fileExists(fileName); + } + findExternalProjectContainingOpenScriptInfo(info2) { + return find2(this.externalProjects, (proj) => { + updateProjectIfDirty(proj); + return proj.containsScriptInfo(info2); + }); + } + getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { + const info2 = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent); + this.openFiles.set(info2.path, projectRootPath); + return info2; + } + assignProjectToOpenedScriptInfo(info2) { + let configFileName; + let configFileErrors; + let project = this.findExternalProjectContainingOpenScriptInfo(info2); + let retainProjects; + let projectForConfigFileDiag; + let defaultConfigProjectIsCreated = false; + if (!project && this.serverMode === 0) { + configFileName = this.getConfigFileNameForFile(info2); + if (configFileName) { + project = this.findConfiguredProjectByProjectName(configFileName); + if (!project) { + project = this.createLoadAndUpdateConfiguredProject(configFileName, `Creating possible configured project for ${info2.fileName} to open`); + defaultConfigProjectIsCreated = true; + } else { + updateProjectIfDirty(project); + } + projectForConfigFileDiag = project.containsScriptInfo(info2) ? project : void 0; + retainProjects = project; + if (!projectContainsInfoDirectly(project, info2)) { + forEachResolvedProjectReferenceProject( + project, + info2.path, + (child) => { + updateProjectIfDirty(child); + if (!isArray3(retainProjects)) { + retainProjects = [project, child]; + } else { + retainProjects.push(child); + } + if (projectContainsInfoDirectly(child, info2)) { + projectForConfigFileDiag = child; + return child; + } + if (!projectForConfigFileDiag && child.containsScriptInfo(info2)) { + projectForConfigFileDiag = child; + } + }, + 2, + `Creating project referenced in solution ${project.projectName} to find possible configured project for ${info2.fileName} to open` + ); + } + if (projectForConfigFileDiag) { + configFileName = projectForConfigFileDiag.getConfigFilePath(); + if (projectForConfigFileDiag !== project || defaultConfigProjectIsCreated) { + configFileErrors = projectForConfigFileDiag.getAllProjectErrors(); + this.sendConfigFileDiagEvent(projectForConfigFileDiag, info2.fileName); + } + } else { + configFileName = void 0; + } + this.createAncestorProjects(info2, project); + } + } + info2.containingProjects.forEach(updateProjectIfDirty); + if (info2.isOrphan()) { + if (isArray3(retainProjects)) { + retainProjects.forEach((project2) => this.sendConfigFileDiagEvent(project2, info2.fileName)); + } else if (retainProjects) { + this.sendConfigFileDiagEvent(retainProjects, info2.fileName); + } + Debug.assert(this.openFiles.has(info2.path)); + this.assignOrphanScriptInfoToInferredProject(info2, this.openFiles.get(info2.path)); + } + Debug.assert(!info2.isOrphan()); + return { configFileName, configFileErrors, retainProjects }; + } + createAncestorProjects(info2, project) { + if (!info2.isAttached(project)) + return; + while (true) { + if (!project.isInitialLoadPending() && (!project.getCompilerOptions().composite || project.getCompilerOptions().disableSolutionSearching)) + return; + const configFileName = this.getConfigFileNameForFile({ + fileName: project.getConfigFilePath(), + path: info2.path, + configFileInfo: true + }); + if (!configFileName) + return; + const ancestor = this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProjectWithDelayLoad(configFileName, `Creating project possibly referencing default composite project ${project.getProjectName()} of open file ${info2.fileName}`); + if (ancestor.isInitialLoadPending()) { + ancestor.setPotentialProjectReference(project.canonicalConfigFilePath); + } + project = ancestor; + } + } + /** @internal */ + loadAncestorProjectTree(forProjects) { + forProjects = forProjects || mapDefinedEntries( + this.configuredProjects, + (key, project) => !project.isInitialLoadPending() ? [key, true] : void 0 + ); + const seenProjects = /* @__PURE__ */ new Set(); + for (const project of arrayFrom(this.configuredProjects.values())) { + if (forEachPotentialProjectReference(project, (potentialRefPath) => forProjects.has(potentialRefPath))) { + updateProjectIfDirty(project); + } + this.ensureProjectChildren(project, forProjects, seenProjects); + } + } + ensureProjectChildren(project, forProjects, seenProjects) { + var _a2; + if (!tryAddToSet(seenProjects, project.canonicalConfigFilePath)) + return; + if (project.getCompilerOptions().disableReferencedProjectLoad) + return; + const children = (_a2 = project.getCurrentProgram()) == null ? void 0 : _a2.getResolvedProjectReferences(); + if (!children) + return; + for (const child of children) { + if (!child) + continue; + const referencedProject = forEachResolvedProjectReference(child.references, (ref) => forProjects.has(ref.sourceFile.path) ? ref : void 0); + if (!referencedProject) + continue; + const configFileName = toNormalizedPath(child.sourceFile.fileName); + const childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) || project.projectService.createAndLoadConfiguredProject(configFileName, `Creating project referenced by : ${project.projectName} as it references project ${referencedProject.sourceFile.fileName}`); + updateProjectIfDirty(childProject); + this.ensureProjectChildren(childProject, forProjects, seenProjects); + } + } + cleanupAfterOpeningFile(toRetainConfigProjects) { + this.removeOrphanConfiguredProjects(toRetainConfigProjects); + for (const inferredProject of this.inferredProjects.slice()) { + if (inferredProject.isOrphan()) { + this.removeProject(inferredProject); + } + } + this.removeOrphanScriptInfos(); + } + openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { + const info2 = this.getOrCreateOpenScriptInfo(fileName, fileContent, scriptKind, hasMixedContent, projectRootPath); + const { retainProjects, ...result2 } = this.assignProjectToOpenedScriptInfo(info2); + this.cleanupAfterOpeningFile(retainProjects); + this.telemetryOnOpenFile(info2); + this.printProjects(); + return result2; + } + removeOrphanConfiguredProjects(toRetainConfiguredProjects) { + const toRemoveConfiguredProjects = new Map(this.configuredProjects); + const markOriginalProjectsAsUsed = (project) => { + if (!project.isOrphan() && project.originalConfiguredProjects) { + project.originalConfiguredProjects.forEach( + (_value, configuredProjectPath) => { + const project2 = this.getConfiguredProjectByCanonicalConfigFilePath(configuredProjectPath); + return project2 && retainConfiguredProject(project2); + } + ); + } + }; + if (toRetainConfiguredProjects) { + if (isArray3(toRetainConfiguredProjects)) { + toRetainConfiguredProjects.forEach(retainConfiguredProject); + } else { + retainConfiguredProject(toRetainConfiguredProjects); + } + } + this.inferredProjects.forEach(markOriginalProjectsAsUsed); + this.externalProjects.forEach(markOriginalProjectsAsUsed); + this.configuredProjects.forEach((project) => { + if (project.hasOpenRef()) { + retainConfiguredProject(project); + } else if (toRemoveConfiguredProjects.has(project.canonicalConfigFilePath)) { + forEachReferencedProject( + project, + (ref) => isRetained(ref) && retainConfiguredProject(project) + ); + } + }); + toRemoveConfiguredProjects.forEach((project) => this.removeProject(project)); + function isRetained(project) { + return project.hasOpenRef() || !toRemoveConfiguredProjects.has(project.canonicalConfigFilePath); + } + function retainConfiguredProject(project) { + if (toRemoveConfiguredProjects.delete(project.canonicalConfigFilePath)) { + markOriginalProjectsAsUsed(project); + forEachReferencedProject(project, retainConfiguredProject); + } + } + } + removeOrphanScriptInfos() { + const toRemoveScriptInfos = new Map(this.filenameToScriptInfo); + this.filenameToScriptInfo.forEach((info2) => { + if (!info2.isScriptOpen() && info2.isOrphan() && !info2.isContainedByBackgroundProject()) { + if (!info2.sourceMapFilePath) + return; + let sourceInfos; + if (isString4(info2.sourceMapFilePath)) { + const sourceMapInfo = this.getScriptInfoForPath(info2.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } else { + sourceInfos = info2.sourceMapFilePath.sourceInfos; + } + if (!sourceInfos) + return; + if (!forEachKey(sourceInfos, (path2) => { + const info22 = this.getScriptInfoForPath(path2); + return !!info22 && (info22.isScriptOpen() || !info22.isOrphan()); + })) { + return; + } + } + toRemoveScriptInfos.delete(info2.path); + if (info2.sourceMapFilePath) { + let sourceInfos; + if (isString4(info2.sourceMapFilePath)) { + toRemoveScriptInfos.delete(info2.sourceMapFilePath); + const sourceMapInfo = this.getScriptInfoForPath(info2.sourceMapFilePath); + sourceInfos = sourceMapInfo && sourceMapInfo.sourceInfos; + } else { + sourceInfos = info2.sourceMapFilePath.sourceInfos; + } + if (sourceInfos) { + sourceInfos.forEach((_value, path2) => toRemoveScriptInfos.delete(path2)); + } + } + }); + toRemoveScriptInfos.forEach((info2) => { + this.stopWatchingScriptInfo(info2); + this.deleteScriptInfo(info2); + info2.closeSourceMapFileWatcher(); + }); + } + telemetryOnOpenFile(scriptInfo) { + if (this.serverMode !== 0 || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) { + return; + } + const project = this.ensureDefaultProjectForFile(scriptInfo); + if (!project.languageServiceEnabled) { + return; + } + const sourceFile = project.getSourceFile(scriptInfo.path); + const checkJs = !!sourceFile && !!sourceFile.checkJsDirective; + this.eventHandler({ eventName: OpenFileInfoTelemetryEvent, data: { info: { checkJs } } }); + } + closeClientFile(uncheckedFileName, skipAssignOrphanScriptInfosToInferredProject) { + const info2 = this.getScriptInfoForNormalizedPath(toNormalizedPath(uncheckedFileName)); + const result2 = info2 ? this.closeOpenFile(info2, skipAssignOrphanScriptInfosToInferredProject) : false; + if (!skipAssignOrphanScriptInfosToInferredProject) { + this.printProjects(); + } + return result2; + } + collectChanges(lastKnownProjectVersions, currentProjects, includeProjectReferenceRedirectInfo, result2) { + for (const proj of currentProjects) { + const knownProject = find2(lastKnownProjectVersions, (p7) => p7.projectName === proj.getProjectName()); + result2.push(proj.getChangesSinceVersion(knownProject && knownProject.version, includeProjectReferenceRedirectInfo)); + } + } + /** @internal */ + synchronizeProjectList(knownProjects, includeProjectReferenceRedirectInfo) { + const files = []; + this.collectChanges(knownProjects, this.externalProjects, includeProjectReferenceRedirectInfo, files); + this.collectChanges(knownProjects, this.configuredProjects.values(), includeProjectReferenceRedirectInfo, files); + this.collectChanges(knownProjects, this.inferredProjects, includeProjectReferenceRedirectInfo, files); + return files; + } + /** @internal */ + applyChangesInOpenFiles(openFiles, changedFiles, closedFiles) { + let openScriptInfos; + let assignOrphanScriptInfosToInferredProject = false; + if (openFiles) { + for (const file of openFiles) { + const info2 = this.getOrCreateOpenScriptInfo( + toNormalizedPath(file.fileName), + file.content, + tryConvertScriptKindName(file.scriptKind), + file.hasMixedContent, + file.projectRootPath ? toNormalizedPath(file.projectRootPath) : void 0 + ); + (openScriptInfos || (openScriptInfos = [])).push(info2); + } + } + if (changedFiles) { + for (const file of changedFiles) { + const scriptInfo = this.getScriptInfo(file.fileName); + Debug.assert(!!scriptInfo); + this.applyChangesToFile(scriptInfo, file.changes); + } + } + if (closedFiles) { + for (const file of closedFiles) { + assignOrphanScriptInfosToInferredProject = this.closeClientFile( + file, + /*skipAssignOrphanScriptInfosToInferredProject*/ + true + ) || assignOrphanScriptInfosToInferredProject; + } + } + let retainProjects; + if (openScriptInfos) { + retainProjects = flatMap2(openScriptInfos, (info2) => this.assignProjectToOpenedScriptInfo(info2).retainProjects); + } + if (assignOrphanScriptInfosToInferredProject) { + this.assignOrphanScriptInfosToInferredProject(); + } + if (openScriptInfos) { + this.cleanupAfterOpeningFile(retainProjects); + openScriptInfos.forEach((info2) => this.telemetryOnOpenFile(info2)); + this.printProjects(); + } else if (length(closedFiles)) { + this.printProjects(); + } + } + /** @internal */ + applyChangesToFile(scriptInfo, changes) { + for (const change of changes) { + scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); + } + } + closeConfiguredProjectReferencedFromExternalProject(configuredProjects) { + configuredProjects == null ? void 0 : configuredProjects.forEach((configuredProject) => { + if (!configuredProject.isClosed()) { + configuredProject.deleteExternalProjectReference(); + if (!configuredProject.hasOpenRef()) + this.removeProject(configuredProject); + } + }); + } + closeExternalProject(uncheckedFileName, print) { + const fileName = toNormalizedPath(uncheckedFileName); + const configuredProjects = this.externalProjectToConfiguredProjectMap.get(fileName); + if (configuredProjects) { + this.closeConfiguredProjectReferencedFromExternalProject(configuredProjects); + this.externalProjectToConfiguredProjectMap.delete(fileName); + } else { + const externalProject = this.findExternalProjectByProjectName(uncheckedFileName); + if (externalProject) { + this.removeProject(externalProject); + } + } + if (print) + this.printProjects(); + } + openExternalProjects(projects) { + const projectsToClose = arrayToMap(this.externalProjects, (p7) => p7.getProjectName(), (_6) => true); + forEachKey(this.externalProjectToConfiguredProjectMap, (externalProjectName) => { + projectsToClose.set(externalProjectName, true); + }); + for (const externalProject of projects) { + this.openExternalProject( + externalProject, + /*print*/ + false + ); + projectsToClose.delete(externalProject.projectFileName); + } + forEachKey(projectsToClose, (externalProjectName) => { + this.closeExternalProject( + externalProjectName, + /*print*/ + false + ); + }); + this.printProjects(); + } + static escapeFilenameForRegex(filename) { + return filename.replace(this.filenameEscapeRegexp, "\\$&"); + } + resetSafeList() { + this.safelist = defaultTypeSafeList; + } + applySafeList(proj) { + const typeAcquisition = proj.typeAcquisition; + Debug.assert(!!typeAcquisition, "proj.typeAcquisition should be set by now"); + const result2 = this.applySafeListWorker(proj, proj.rootFiles, typeAcquisition); + return (result2 == null ? void 0 : result2.excludedFiles) ?? []; + } + applySafeListWorker(proj, rootFiles, typeAcquisition) { + if (typeAcquisition.enable === false || typeAcquisition.disableFilenameBasedTypeAcquisition) { + return void 0; + } + const typeAcqInclude = typeAcquisition.include || (typeAcquisition.include = []); + const excludeRules = []; + const normalizedNames = rootFiles.map((f8) => normalizeSlashes(f8.fileName)); + for (const name2 of Object.keys(this.safelist)) { + const rule2 = this.safelist[name2]; + for (const root2 of normalizedNames) { + if (rule2.match.test(root2)) { + this.logger.info(`Excluding files based on rule ${name2} matching file '${root2}'`); + if (rule2.types) { + for (const type3 of rule2.types) { + if (!typeAcqInclude.includes(type3)) { + typeAcqInclude.push(type3); + } + } + } + if (rule2.exclude) { + for (const exclude of rule2.exclude) { + const processedRule = root2.replace(rule2.match, (...groups) => { + return exclude.map((groupNumberOrString) => { + if (typeof groupNumberOrString === "number") { + if (!isString4(groups[groupNumberOrString])) { + this.logger.info(`Incorrect RegExp specification in safelist rule ${name2} - not enough groups`); + return "\\*"; + } + return _ProjectService2.escapeFilenameForRegex(groups[groupNumberOrString]); + } + return groupNumberOrString; + }).join(""); + }); + if (!excludeRules.includes(processedRule)) { + excludeRules.push(processedRule); + } + } + } else { + const escaped = _ProjectService2.escapeFilenameForRegex(root2); + if (!excludeRules.includes(escaped)) { + excludeRules.push(escaped); + } + } + } + } + } + const excludeRegexes = excludeRules.map((e10) => new RegExp(e10, "i")); + let filesToKeep; + let excludedFiles; + for (let i7 = 0; i7 < rootFiles.length; i7++) { + if (excludeRegexes.some((re4) => re4.test(normalizedNames[i7]))) { + addExcludedFile(i7); + } else { + if (typeAcquisition.enable) { + const baseName = getBaseFileName(toFileNameLowerCase(normalizedNames[i7])); + if (fileExtensionIs(baseName, "js")) { + const inferredTypingName = removeFileExtension(baseName); + const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName); + const typeName = this.legacySafelist.get(cleanedTypingName); + if (typeName !== void 0) { + this.logger.info(`Excluded '${normalizedNames[i7]}' because it matched ${cleanedTypingName} from the legacy safelist`); + addExcludedFile(i7); + if (!typeAcqInclude.includes(typeName)) { + typeAcqInclude.push(typeName); + } + continue; + } + } + } + if (/^.+[.-]min\.js$/.test(normalizedNames[i7])) { + addExcludedFile(i7); + } else { + filesToKeep == null ? void 0 : filesToKeep.push(rootFiles[i7]); + } + } + } + return excludedFiles ? { + rootFiles: filesToKeep, + excludedFiles + } : void 0; + function addExcludedFile(index4) { + if (!excludedFiles) { + Debug.assert(!filesToKeep); + filesToKeep = rootFiles.slice(0, index4); + excludedFiles = []; + } + excludedFiles.push(normalizedNames[index4]); + } + } + openExternalProject(proj, print) { + const existingExternalProject = this.findExternalProjectByProjectName(proj.projectFileName); + const existingConfiguredProjects = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName); + let configuredProjects; + let rootFiles = []; + for (const file of proj.rootFiles) { + const normalized = toNormalizedPath(file.fileName); + if (getBaseConfigFileName(normalized)) { + if (this.serverMode === 0 && this.host.fileExists(normalized)) { + let project = this.findConfiguredProjectByProjectName(normalized); + if (!project) { + project = this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ? this.createConfiguredProjectWithDelayLoad(normalized, `Creating configured project in external project: ${proj.projectFileName}`) : this.createLoadAndUpdateConfiguredProject(normalized, `Creating configured project in external project: ${proj.projectFileName}`); + } + if (!(existingConfiguredProjects == null ? void 0 : existingConfiguredProjects.has(project))) { + project.addExternalProjectReference(); + } + (configuredProjects ?? (configuredProjects = /* @__PURE__ */ new Set())).add(project); + existingConfiguredProjects == null ? void 0 : existingConfiguredProjects.delete(project); + } + } else { + rootFiles.push(file); + } + } + if (configuredProjects) { + this.externalProjectToConfiguredProjectMap.set(proj.projectFileName, configuredProjects); + if (existingExternalProject) + this.removeProject(existingExternalProject); + } else { + this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); + const typeAcquisition = proj.typeAcquisition || {}; + typeAcquisition.include = typeAcquisition.include || []; + typeAcquisition.exclude = typeAcquisition.exclude || []; + if (typeAcquisition.enable === void 0) { + typeAcquisition.enable = hasNoTypeScriptSource(rootFiles.map((f8) => f8.fileName)); + } + const excludeResult = this.applySafeListWorker(proj, rootFiles, typeAcquisition); + const excludedFiles = (excludeResult == null ? void 0 : excludeResult.excludedFiles) ?? []; + rootFiles = (excludeResult == null ? void 0 : excludeResult.rootFiles) ?? rootFiles; + if (existingExternalProject) { + existingExternalProject.excludedFiles = excludedFiles; + const compilerOptions = convertCompilerOptions(proj.options); + const watchOptionsAndErrors = convertWatchOptions(proj.options, existingExternalProject.getCurrentDirectory()); + const lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, rootFiles, externalFilePropertyReader); + if (lastFileExceededProgramSize) { + existingExternalProject.disableLanguageService(lastFileExceededProgramSize); + } else { + existingExternalProject.enableLanguageService(); + } + existingExternalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors); + this.updateRootAndOptionsOfNonInferredProject(existingExternalProject, rootFiles, externalFilePropertyReader, compilerOptions, typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions); + existingExternalProject.updateGraph(); + } else { + const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, typeAcquisition, excludedFiles); + project.updateGraph(); + } + } + this.closeConfiguredProjectReferencedFromExternalProject(existingConfiguredProjects); + if (print) + this.printProjects(); + } + hasDeferredExtension() { + for (const extension of this.hostConfiguration.extraFileExtensions) { + if (extension.scriptKind === 7) { + return true; + } + } + return false; + } + /** + * Performs the initial steps of enabling a plugin by finding and instantiating the module for a plugin either asynchronously or synchronously + * @internal + */ + requestEnablePlugin(project, pluginConfigEntry, searchPaths) { + if (!this.host.importPlugin && !this.host.require) { + this.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + this.logger.info(`Enabling plugin ${pluginConfigEntry.name} from candidate paths: ${searchPaths.join(",")}`); + if (!pluginConfigEntry.name || parsePackageName(pluginConfigEntry.name).rest) { + this.logger.info(`Skipped loading plugin ${pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)} because only package name is allowed plugin name`); + return; + } + if (this.host.importPlugin) { + const importPromise = Project3.importServicePluginAsync( + pluginConfigEntry, + searchPaths, + this.host, + (s7) => this.logger.info(s7) + ); + this.pendingPluginEnablements ?? (this.pendingPluginEnablements = /* @__PURE__ */ new Map()); + let promises3 = this.pendingPluginEnablements.get(project); + if (!promises3) + this.pendingPluginEnablements.set(project, promises3 = []); + promises3.push(importPromise); + return; + } + this.endEnablePlugin( + project, + Project3.importServicePluginSync( + pluginConfigEntry, + searchPaths, + this.host, + (s7) => this.logger.info(s7) + ) + ); + } + /** + * Performs the remaining steps of enabling a plugin after its module has been instantiated. + * @internal + */ + endEnablePlugin(project, { pluginConfigEntry, resolvedModule, errorLogs }) { + var _a2; + if (resolvedModule) { + const configurationOverride = (_a2 = this.currentPluginConfigOverrides) == null ? void 0 : _a2.get(pluginConfigEntry.name); + if (configurationOverride) { + const pluginName = pluginConfigEntry.name; + pluginConfigEntry = configurationOverride; + pluginConfigEntry.name = pluginName; + } + project.enableProxy(resolvedModule, pluginConfigEntry); + } else { + forEach4(errorLogs, (message) => this.logger.info(message)); + this.logger.info(`Couldn't find ${pluginConfigEntry.name}`); + } + } + /** @internal */ + hasNewPluginEnablementRequests() { + return !!this.pendingPluginEnablements; + } + /** @internal */ + hasPendingPluginEnablements() { + return !!this.currentPluginEnablementPromise; + } + /** + * Waits for any ongoing plugin enablement requests to complete. + * + * @internal + */ + async waitForPendingPlugins() { + while (this.currentPluginEnablementPromise) { + await this.currentPluginEnablementPromise; + } + } + /** + * Starts enabling any requested plugins without waiting for the result. + * + * @internal + */ + enableRequestedPlugins() { + if (this.pendingPluginEnablements) { + void this.enableRequestedPluginsAsync(); + } + } + async enableRequestedPluginsAsync() { + if (this.currentPluginEnablementPromise) { + await this.waitForPendingPlugins(); + } + if (!this.pendingPluginEnablements) { + return; + } + const entries = arrayFrom(this.pendingPluginEnablements.entries()); + this.pendingPluginEnablements = void 0; + this.currentPluginEnablementPromise = this.enableRequestedPluginsWorker(entries); + await this.currentPluginEnablementPromise; + } + async enableRequestedPluginsWorker(pendingPlugins) { + Debug.assert(this.currentPluginEnablementPromise === void 0); + await Promise.all(map4(pendingPlugins, ([project, promises3]) => this.enableRequestedPluginsForProjectAsync(project, promises3))); + this.currentPluginEnablementPromise = void 0; + this.sendProjectsUpdatedInBackgroundEvent(); + } + async enableRequestedPluginsForProjectAsync(project, promises3) { + const results = await Promise.all(promises3); + if (project.isClosed()) { + return; + } + for (const result2 of results) { + this.endEnablePlugin(project, result2); + } + this.delayUpdateProjectGraph(project); + } + configurePlugin(args) { + this.forEachEnabledProject((project) => project.onPluginConfigurationChanged(args.pluginName, args.configuration)); + this.currentPluginConfigOverrides = this.currentPluginConfigOverrides || /* @__PURE__ */ new Map(); + this.currentPluginConfigOverrides.set(args.pluginName, args.configuration); + } + /** @internal */ + getPackageJsonsVisibleToFile(fileName, project, rootDir) { + const packageJsonCache = this.packageJsonCache; + const rootPath = rootDir && this.toPath(rootDir); + const result2 = []; + const processDirectory = (directory) => { + switch (packageJsonCache.directoryHasPackageJson(directory)) { + case 3: + packageJsonCache.searchDirectoryAndAncestors(directory); + return processDirectory(directory); + case -1: + const packageJsonFileName = combinePaths(directory, "package.json"); + this.watchPackageJsonFile(packageJsonFileName, this.toPath(packageJsonFileName), project); + const info2 = packageJsonCache.getInDirectory(directory); + if (info2) + result2.push(info2); + } + if (rootPath && rootPath === directory) { + return true; + } + }; + forEachAncestorDirectory(getDirectoryPath(fileName), processDirectory); + return result2; + } + /** @internal */ + getNearestAncestorDirectoryWithPackageJson(fileName) { + return forEachAncestorDirectory(fileName, (directory) => { + switch (this.packageJsonCache.directoryHasPackageJson(directory)) { + case -1: + return directory; + case 0: + return void 0; + case 3: + return this.host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0; + } + }); + } + /** @internal */ + watchPackageJsonFile(file, path2, project) { + Debug.assert(project !== void 0); + let result2 = (this.packageJsonFilesMap ?? (this.packageJsonFilesMap = /* @__PURE__ */ new Map())).get(path2); + if (!result2) { + let watcher = this.watchFactory.watchFile( + file, + (fileName, eventKind) => { + switch (eventKind) { + case 0: + return Debug.fail(); + case 1: + this.packageJsonCache.addOrUpdate(fileName, path2); + this.onPackageJsonChange(result2); + break; + case 2: + this.packageJsonCache.delete(path2); + this.onPackageJsonChange(result2); + result2.projects.clear(); + result2.close(); + } + }, + 250, + this.hostConfiguration.watchOptions, + WatchType.PackageJson + ); + result2 = { + projects: /* @__PURE__ */ new Set(), + close: () => { + var _a2; + if (result2.projects.size || !watcher) + return; + watcher.close(); + watcher = void 0; + (_a2 = this.packageJsonFilesMap) == null ? void 0 : _a2.delete(path2); + this.packageJsonCache.invalidate(path2); + } + }; + this.packageJsonFilesMap.set(path2, result2); + } + result2.projects.add(project); + (project.packageJsonWatches ?? (project.packageJsonWatches = /* @__PURE__ */ new Set())).add(result2); + } + /** @internal */ + onPackageJsonChange(result2) { + result2.projects.forEach((project) => { + var _a2; + return (_a2 = project.onPackageJsonChange) == null ? void 0 : _a2.call(project); + }); + } + /** @internal */ + includePackageJsonAutoImports() { + switch (this.hostConfiguration.preferences.includePackageJsonAutoImports) { + case "on": + return 1; + case "off": + return 0; + default: + return 2; + } + } + /** @internal */ + getIncompleteCompletionsCache() { + return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = createIncompleteCompletionsCache()); + } + }; + _ProjectService.filenameEscapeRegexp = /[-/\\^$*+?.()|[\]{}]/g; + ProjectService3 = _ProjectService; + } + }); + function createModuleSpecifierCache(host) { + let containedNodeModulesWatchers; + let cache; + let currentKey; + const result2 = { + get(fromFileName, toFileName2, preferences, options) { + if (!cache || currentKey !== key(fromFileName, preferences, options)) + return void 0; + return cache.get(toFileName2); + }, + set(fromFileName, toFileName2, preferences, options, modulePaths, moduleSpecifiers) { + ensureCache(fromFileName, preferences, options).set(toFileName2, createInfo( + modulePaths, + moduleSpecifiers, + /*isBlockedByPackageJsonDependencies*/ + false + )); + if (moduleSpecifiers) { + for (const p7 of modulePaths) { + if (p7.isInNodeModules) { + const nodeModulesPath = p7.path.substring(0, p7.path.indexOf(nodeModulesPathPart) + nodeModulesPathPart.length - 1); + const key2 = host.toPath(nodeModulesPath); + if (!(containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.has(key2))) { + (containedNodeModulesWatchers || (containedNodeModulesWatchers = /* @__PURE__ */ new Map())).set( + key2, + host.watchNodeModulesForPackageJsonChanges(nodeModulesPath) + ); + } + } + } + } + }, + setModulePaths(fromFileName, toFileName2, preferences, options, modulePaths) { + const cache2 = ensureCache(fromFileName, preferences, options); + const info2 = cache2.get(toFileName2); + if (info2) { + info2.modulePaths = modulePaths; + } else { + cache2.set(toFileName2, createInfo( + modulePaths, + /*moduleSpecifiers*/ + void 0, + /*isBlockedByPackageJsonDependencies*/ + void 0 + )); + } + }, + setBlockedByPackageJsonDependencies(fromFileName, toFileName2, preferences, options, isBlockedByPackageJsonDependencies) { + const cache2 = ensureCache(fromFileName, preferences, options); + const info2 = cache2.get(toFileName2); + if (info2) { + info2.isBlockedByPackageJsonDependencies = isBlockedByPackageJsonDependencies; + } else { + cache2.set(toFileName2, createInfo( + /*modulePaths*/ + void 0, + /*moduleSpecifiers*/ + void 0, + isBlockedByPackageJsonDependencies + )); + } + }, + clear() { + containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.forEach(closeFileWatcher); + cache == null ? void 0 : cache.clear(); + containedNodeModulesWatchers == null ? void 0 : containedNodeModulesWatchers.clear(); + currentKey = void 0; + }, + count() { + return cache ? cache.size : 0; + } + }; + if (Debug.isDebugging) { + Object.defineProperty(result2, "__cache", { get: () => cache }); + } + return result2; + function ensureCache(fromFileName, preferences, options) { + const newKey = key(fromFileName, preferences, options); + if (cache && currentKey !== newKey) { + result2.clear(); + } + currentKey = newKey; + return cache || (cache = /* @__PURE__ */ new Map()); + } + function key(fromFileName, preferences, options) { + return `${fromFileName},${preferences.importModuleSpecifierEnding},${preferences.importModuleSpecifierPreference},${options.overrideImportMode}`; + } + function createInfo(modulePaths, moduleSpecifiers, isBlockedByPackageJsonDependencies) { + return { modulePaths, moduleSpecifiers, isBlockedByPackageJsonDependencies }; + } + } + var init_moduleSpecifierCache = __esm2({ + "src/server/moduleSpecifierCache.ts"() { + "use strict"; + init_ts7(); + } + }); + function createPackageJsonCache(host) { + const packageJsons = /* @__PURE__ */ new Map(); + const directoriesWithoutPackageJson = /* @__PURE__ */ new Map(); + return { + addOrUpdate, + invalidate, + delete: (fileName) => { + packageJsons.delete(fileName); + directoriesWithoutPackageJson.set(getDirectoryPath(fileName), true); + }, + getInDirectory: (directory) => { + return packageJsons.get(host.toPath(combinePaths(directory, "package.json"))) || void 0; + }, + directoryHasPackageJson: (directory) => directoryHasPackageJson(host.toPath(directory)), + searchDirectoryAndAncestors: (directory) => { + forEachAncestorDirectory(directory, (ancestor) => { + const ancestorPath = host.toPath(ancestor); + if (directoryHasPackageJson(ancestorPath) !== 3) { + return true; + } + const packageJsonFileName = combinePaths(ancestor, "package.json"); + if (tryFileExists(host, packageJsonFileName)) { + addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json")); + } else { + directoriesWithoutPackageJson.set(ancestorPath, true); + } + }); + } + }; + function addOrUpdate(fileName, path2) { + const packageJsonInfo = Debug.checkDefined(createPackageJsonInfo(fileName, host.host)); + packageJsons.set(path2, packageJsonInfo); + directoriesWithoutPackageJson.delete(getDirectoryPath(path2)); + } + function invalidate(path2) { + packageJsons.delete(path2); + directoriesWithoutPackageJson.delete(getDirectoryPath(path2)); + } + function directoryHasPackageJson(directory) { + return packageJsons.has(combinePaths(directory, "package.json")) ? -1 : directoriesWithoutPackageJson.has(directory) ? 0 : 3; + } + } + var init_packageJsonCache = __esm2({ + "src/server/packageJsonCache.ts"() { + "use strict"; + init_ts7(); + } + }); + function hrTimeToMilliseconds(time2) { + const seconds = time2[0]; + const nanoseconds = time2[1]; + return (1e9 * seconds + nanoseconds) / 1e6; + } + function isDeclarationFileInJSOnlyNonConfiguredProject(project, file) { + if ((isInferredProject(project) || isExternalProject(project)) && project.isJsOnlyProject()) { + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return scriptInfo && !scriptInfo.isJavaScript(); + } + return false; + } + function dtsChangeCanAffectEmit(compilationSettings) { + return getEmitDeclarations(compilationSettings) || !!compilationSettings.emitDecoratorMetadata; + } + function formatDiag(fileName, project, diag2) { + const scriptInfo = project.getScriptInfoForNormalizedPath(fileName); + return { + start: scriptInfo.positionToLineOffset(diag2.start), + end: scriptInfo.positionToLineOffset(diag2.start + diag2.length), + // TODO: GH#18217 + text: flattenDiagnosticMessageText(diag2.messageText, "\n"), + code: diag2.code, + category: diagnosticCategoryName(diag2), + reportsUnnecessary: diag2.reportsUnnecessary, + reportsDeprecated: diag2.reportsDeprecated, + source: diag2.source, + relatedInformation: map4(diag2.relatedInformation, formatRelatedInformation) + }; + } + function formatRelatedInformation(info2) { + if (!info2.file) { + return { + message: flattenDiagnosticMessageText(info2.messageText, "\n"), + category: diagnosticCategoryName(info2), + code: info2.code + }; + } + return { + span: { + start: convertToLocation(getLineAndCharacterOfPosition(info2.file, info2.start)), + end: convertToLocation(getLineAndCharacterOfPosition(info2.file, info2.start + info2.length)), + // TODO: GH#18217 + file: info2.file.fileName + }, + message: flattenDiagnosticMessageText(info2.messageText, "\n"), + category: diagnosticCategoryName(info2), + code: info2.code + }; + } + function convertToLocation(lineAndCharacter) { + return { line: lineAndCharacter.line + 1, offset: lineAndCharacter.character + 1 }; + } + function formatDiagnosticToProtocol(diag2, includeFileName) { + const start = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start)); + const end = diag2.file && convertToLocation(getLineAndCharacterOfPosition(diag2.file, diag2.start + diag2.length)); + const text = flattenDiagnosticMessageText(diag2.messageText, "\n"); + const { code, source } = diag2; + const category = diagnosticCategoryName(diag2); + const common3 = { + start, + end, + text, + code, + category, + reportsUnnecessary: diag2.reportsUnnecessary, + reportsDeprecated: diag2.reportsDeprecated, + source, + relatedInformation: map4(diag2.relatedInformation, formatRelatedInformation) + }; + return includeFileName ? { ...common3, fileName: diag2.file && diag2.file.fileName } : common3; + } + function allEditsBeforePos(edits, pos) { + return edits.every((edit) => textSpanEnd(edit.span) < pos); + } + function formatMessage2(msg, logger, byteLength, newLine) { + const verboseLogging = logger.hasLevel( + 3 + /* verbose */ + ); + const json2 = JSON.stringify(msg); + if (verboseLogging) { + logger.info(`${msg.type}:${stringifyIndented(msg)}`); + } + const len = byteLength(json2, "utf8"); + return `Content-Length: ${1 + len}\r +\r +${json2}${newLine}`; + } + function toEvent(eventName, body) { + return { + seq: 0, + type: "event", + event: eventName, + body + }; + } + function combineProjectOutput(defaultValue, getValue2, projects, action) { + const outputs = flatMapToMutable(isArray3(projects) ? projects : projects.projects, (project) => action(project, defaultValue)); + if (!isArray3(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach((projects2, path2) => { + const value2 = getValue2(path2); + outputs.push(...flatMap2(projects2, (project) => action(project, value2))); + }); + } + return deduplicate(outputs, equateValues); + } + function createDocumentSpanSet(useCaseSensitiveFileNames2) { + return createSet2(({ textSpan }) => textSpan.start + 100003 * textSpan.length, getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2)); + } + function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences, useCaseSensitiveFileNames2) { + const perProjectResults = getPerProjectReferences( + projects, + defaultProject, + initialLocation, + /*isForRename*/ + true, + (project, position) => project.getLanguageService().findRenameLocations(position.fileName, position.pos, findInStrings, findInComments, preferences), + (renameLocation, cb) => cb(documentSpanLocation(renameLocation)) + ); + if (isArray3(perProjectResults)) { + return perProjectResults; + } + const results = []; + const seen = createDocumentSpanSet(useCaseSensitiveFileNames2); + perProjectResults.forEach((projectResults, project) => { + for (const result2 of projectResults) { + if (!seen.has(result2) && !getMappedLocationForProject(documentSpanLocation(result2), project)) { + results.push(result2); + seen.add(result2); + } + } + }); + return results; + } + function getDefinitionLocation(defaultProject, initialLocation, isForRename) { + const infos = defaultProject.getLanguageService().getDefinitionAtPosition( + initialLocation.fileName, + initialLocation.pos, + /*searchOtherFilesOnly*/ + false, + /*stopAtAlias*/ + isForRename + ); + const info2 = infos && firstOrUndefined(infos); + return info2 && !info2.isLocal ? { fileName: info2.fileName, pos: info2.textSpan.start } : void 0; + } + function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger) { + var _a2, _b; + const perProjectResults = getPerProjectReferences( + projects, + defaultProject, + initialLocation, + /*isForRename*/ + false, + (project, position) => { + logger.info(`Finding references to ${position.fileName} position ${position.pos} in project ${project.getProjectName()}`); + return project.getLanguageService().findReferences(position.fileName, position.pos); + }, + (referencedSymbol, cb) => { + cb(documentSpanLocation(referencedSymbol.definition)); + for (const ref of referencedSymbol.references) { + cb(documentSpanLocation(ref)); + } + } + ); + if (isArray3(perProjectResults)) { + return perProjectResults; + } + const defaultProjectResults = perProjectResults.get(defaultProject); + if (((_b = (_a2 = defaultProjectResults == null ? void 0 : defaultProjectResults[0]) == null ? void 0 : _a2.references[0]) == null ? void 0 : _b.isDefinition) === void 0) { + perProjectResults.forEach((projectResults) => { + for (const referencedSymbol of projectResults) { + for (const ref of referencedSymbol.references) { + delete ref.isDefinition; + } + } + }); + } else { + const knownSymbolSpans = createDocumentSpanSet(useCaseSensitiveFileNames2); + for (const referencedSymbol of defaultProjectResults) { + for (const ref of referencedSymbol.references) { + if (ref.isDefinition) { + knownSymbolSpans.add(ref); + break; + } + } + } + const updatedProjects = /* @__PURE__ */ new Set(); + while (true) { + let progress = false; + perProjectResults.forEach((referencedSymbols, project) => { + if (updatedProjects.has(project)) + return; + const updated = project.getLanguageService().updateIsDefinitionOfReferencedSymbols(referencedSymbols, knownSymbolSpans); + if (updated) { + updatedProjects.add(project); + progress = true; + } + }); + if (!progress) + break; + } + perProjectResults.forEach((referencedSymbols, project) => { + if (updatedProjects.has(project)) + return; + for (const referencedSymbol of referencedSymbols) { + for (const ref of referencedSymbol.references) { + ref.isDefinition = false; + } + } + }); + } + const results = []; + const seenRefs = createDocumentSpanSet(useCaseSensitiveFileNames2); + perProjectResults.forEach((projectResults, project) => { + for (const referencedSymbol of projectResults) { + const mappedDefinitionFile = getMappedLocationForProject(documentSpanLocation(referencedSymbol.definition), project); + const definition = mappedDefinitionFile === void 0 ? referencedSymbol.definition : { + ...referencedSymbol.definition, + textSpan: createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), + // Why would the length be the same in the original? + fileName: mappedDefinitionFile.fileName, + contextSpan: getMappedContextSpanForProject(referencedSymbol.definition, project) + }; + let symbolToAddTo = find2(results, (o7) => documentSpansEqual(o7.definition, definition, useCaseSensitiveFileNames2)); + if (!symbolToAddTo) { + symbolToAddTo = { definition, references: [] }; + results.push(symbolToAddTo); + } + for (const ref of referencedSymbol.references) { + if (!seenRefs.has(ref) && !getMappedLocationForProject(documentSpanLocation(ref), project)) { + seenRefs.add(ref); + symbolToAddTo.references.push(ref); + } + } + } + }); + return results.filter((o7) => o7.references.length !== 0); + } + function forEachProjectInProjects(projects, path2, cb) { + for (const project of isArray3(projects) ? projects : projects.projects) { + cb(project, path2); + } + if (!isArray3(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach((symlinkedProjects, symlinkedPath) => { + for (const project of symlinkedProjects) { + cb(project, symlinkedPath); + } + }); + } + } + function getPerProjectReferences(projects, defaultProject, initialLocation, isForRename, getResultsForPosition, forPositionInResult) { + const resultsMap = /* @__PURE__ */ new Map(); + const queue3 = createQueue(); + queue3.enqueue({ project: defaultProject, location: initialLocation }); + forEachProjectInProjects(projects, initialLocation.fileName, (project, path2) => { + const location2 = { fileName: path2, pos: initialLocation.pos }; + queue3.enqueue({ project, location: location2 }); + }); + const projectService = defaultProject.projectService; + const cancellationToken = defaultProject.getCancellationToken(); + const defaultDefinition = getDefinitionLocation(defaultProject, initialLocation, isForRename); + const getGeneratedDefinition = memoize2( + () => defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition.fileName) ? defaultDefinition : defaultProject.getLanguageService().getSourceMapper().tryGetGeneratedPosition(defaultDefinition) + ); + const getSourceDefinition = memoize2( + () => defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition.fileName) ? defaultDefinition : defaultProject.getLanguageService().getSourceMapper().tryGetSourcePosition(defaultDefinition) + ); + const searchedProjectKeys = /* @__PURE__ */ new Set(); + onCancellation: + while (!queue3.isEmpty()) { + while (!queue3.isEmpty()) { + if (cancellationToken.isCancellationRequested()) + break onCancellation; + const { project, location: location2 } = queue3.dequeue(); + if (resultsMap.has(project)) + continue; + if (isLocationProjectReferenceRedirect(project, location2)) + continue; + updateProjectIfDirty(project); + if (!project.containsFile(toNormalizedPath(location2.fileName))) { + continue; + } + const projectResults = searchPosition(project, location2); + resultsMap.set(project, projectResults ?? emptyArray2); + searchedProjectKeys.add(getProjectKey(project)); + } + if (defaultDefinition) { + projectService.loadAncestorProjectTree(searchedProjectKeys); + projectService.forEachEnabledProject((project) => { + if (cancellationToken.isCancellationRequested()) + return; + if (resultsMap.has(project)) + return; + const location2 = mapDefinitionInProject(defaultDefinition, project, getGeneratedDefinition, getSourceDefinition); + if (location2) { + queue3.enqueue({ project, location: location2 }); + } + }); + } + } + if (resultsMap.size === 1) { + return firstIterator(resultsMap.values()); + } + return resultsMap; + function searchPosition(project, location2) { + const projectResults = getResultsForPosition(project, location2); + if (!projectResults) + return void 0; + for (const result2 of projectResults) { + forPositionInResult(result2, (position) => { + const originalLocation = projectService.getOriginalLocationEnsuringConfiguredProject(project, position); + if (!originalLocation) + return; + const originalScriptInfo = projectService.getScriptInfo(originalLocation.fileName); + for (const project2 of originalScriptInfo.containingProjects) { + if (!project2.isOrphan() && !resultsMap.has(project2)) { + queue3.enqueue({ project: project2, location: originalLocation }); + } + } + const symlinkedProjectsMap = projectService.getSymlinkedProjects(originalScriptInfo); + if (symlinkedProjectsMap) { + symlinkedProjectsMap.forEach((symlinkedProjects, symlinkedPath) => { + for (const symlinkedProject of symlinkedProjects) { + if (!symlinkedProject.isOrphan() && !resultsMap.has(symlinkedProject)) { + queue3.enqueue({ project: symlinkedProject, location: { fileName: symlinkedPath, pos: originalLocation.pos } }); + } + } + }); + } + }); + } + return projectResults; + } + } + function mapDefinitionInProject(definition, project, getGeneratedDefinition, getSourceDefinition) { + if (project.containsFile(toNormalizedPath(definition.fileName)) && !isLocationProjectReferenceRedirect(project, definition)) { + return definition; + } + const generatedDefinition = getGeneratedDefinition(); + if (generatedDefinition && project.containsFile(toNormalizedPath(generatedDefinition.fileName))) + return generatedDefinition; + const sourceDefinition = getSourceDefinition(); + return sourceDefinition && project.containsFile(toNormalizedPath(sourceDefinition.fileName)) ? sourceDefinition : void 0; + } + function isLocationProjectReferenceRedirect(project, location2) { + if (!location2) + return false; + const program = project.getLanguageService().getProgram(); + if (!program) + return false; + const sourceFile = program.getSourceFile(location2.fileName); + return !!sourceFile && sourceFile.resolvedPath !== sourceFile.path && sourceFile.resolvedPath !== project.toPath(location2.fileName); + } + function getProjectKey(project) { + return isConfiguredProject(project) ? project.canonicalConfigFilePath : project.getProjectName(); + } + function documentSpanLocation({ fileName, textSpan }) { + return { fileName, pos: textSpan.start }; + } + function getMappedLocationForProject(location2, project) { + return getMappedLocation(location2, project.getSourceMapper(), (p7) => project.projectService.fileExists(p7)); + } + function getMappedDocumentSpanForProject(documentSpan, project) { + return getMappedDocumentSpan(documentSpan, project.getSourceMapper(), (p7) => project.projectService.fileExists(p7)); + } + function getMappedContextSpanForProject(documentSpan, project) { + return getMappedContextSpan(documentSpan, project.getSourceMapper(), (p7) => project.projectService.fileExists(p7)); + } + function toProtocolTextSpan(textSpan, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(textSpan)) + }; + } + function toProtocolTextSpanWithContext(span, contextSpan, scriptInfo) { + const textSpan = toProtocolTextSpan(span, scriptInfo); + const contextTextSpan = contextSpan && toProtocolTextSpan(contextSpan, scriptInfo); + return contextTextSpan ? { ...textSpan, contextStart: contextTextSpan.start, contextEnd: contextTextSpan.end } : textSpan; + } + function convertTextChangeToCodeEdit(change, scriptInfo) { + return { start: positionToLineOffset(scriptInfo, change.span.start), end: positionToLineOffset(scriptInfo, textSpanEnd(change.span)), newText: change.newText }; + } + function positionToLineOffset(info2, position) { + return isConfigFile(info2) ? locationFromLineAndCharacter(info2.getLineAndCharacterOfPosition(position)) : info2.positionToLineOffset(position); + } + function convertLinkedEditInfoToRanges(linkedEdit, scriptInfo) { + const ranges = linkedEdit.ranges.map( + (r8) => { + return { + start: scriptInfo.positionToLineOffset(r8.start), + end: scriptInfo.positionToLineOffset(r8.start + r8.length) + }; + } + ); + if (!linkedEdit.wordPattern) + return { ranges }; + return { ranges, wordPattern: linkedEdit.wordPattern }; + } + function locationFromLineAndCharacter(lc) { + return { line: lc.line + 1, offset: lc.character + 1 }; + } + function convertNewFileTextChangeToCodeEdit(textChanges2) { + Debug.assert(textChanges2.textChanges.length === 1); + const change = first(textChanges2.textChanges); + Debug.assert(change.span.start === 0 && change.span.length === 0); + return { fileName: textChanges2.fileName, textChanges: [{ start: { line: 0, offset: 0 }, end: { line: 0, offset: 0 }, newText: change.newText }] }; + } + function getLocationInNewDocument(oldText, renameFilename, renameLocation, edits) { + const newText = applyEdits(oldText, renameFilename, edits); + const { line, character } = computeLineAndCharacterOfPosition(computeLineStarts(newText), renameLocation); + return { line: line + 1, offset: character + 1 }; + } + function applyEdits(text, textFilename, edits) { + for (const { fileName, textChanges: textChanges2 } of edits) { + if (fileName !== textFilename) { + continue; + } + for (let i7 = textChanges2.length - 1; i7 >= 0; i7--) { + const { newText, span: { start, length: length2 } } = textChanges2[i7]; + text = text.slice(0, start) + newText + text.slice(start + length2); + } + } + return text; + } + function referenceEntryToReferencesResponseItem(projectService, { fileName, textSpan, contextSpan, isWriteAccess: isWriteAccess2, isDefinition }, { disableLineTextInReferences }) { + const scriptInfo = Debug.checkDefined(projectService.getScriptInfo(fileName)); + const span = toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo); + const lineText = disableLineTextInReferences ? void 0 : getLineText(scriptInfo, span); + return { + file: fileName, + ...span, + lineText, + isWriteAccess: isWriteAccess2, + isDefinition + }; + } + function getLineText(scriptInfo, span) { + const lineSpan = scriptInfo.lineToTextSpan(span.start.line - 1); + return scriptInfo.getSnapshot().getText(lineSpan.start, textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); + } + function isCompletionEntryData(data) { + return data === void 0 || data && typeof data === "object" && typeof data.exportName === "string" && (data.fileName === void 0 || typeof data.fileName === "string") && (data.ambientModuleName === void 0 || typeof data.ambientModuleName === "string" && (data.isPackageJsonImport === void 0 || typeof data.isPackageJsonImport === "boolean")); + } + var nullCancellationToken, CommandNames, MultistepOperation, invalidPartialSemanticModeCommands, invalidSyntacticModeCommands, Session3; + var init_session = __esm2({ + "src/server/session.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + init_protocol(); + nullCancellationToken = { + isCancellationRequested: () => false, + setRequest: () => void 0, + resetRequest: () => void 0 + }; + CommandNames = CommandTypes; + MultistepOperation = class { + constructor(operationHost) { + this.operationHost = operationHost; + } + startNew(action) { + this.complete(); + this.requestId = this.operationHost.getCurrentRequestId(); + this.executeAction(action); + } + complete() { + if (this.requestId !== void 0) { + this.operationHost.sendRequestCompletedEvent(this.requestId); + this.requestId = void 0; + } + this.setTimerHandle(void 0); + this.setImmediateId(void 0); + } + immediate(actionType, action) { + const requestId = this.requestId; + Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "immediate: incorrect request id"); + this.setImmediateId( + this.operationHost.getServerHost().setImmediate(() => { + this.immediateId = void 0; + this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action)); + }, actionType) + ); + } + delay(actionType, ms, action) { + const requestId = this.requestId; + Debug.assert(requestId === this.operationHost.getCurrentRequestId(), "delay: incorrect request id"); + this.setTimerHandle( + this.operationHost.getServerHost().setTimeout( + () => { + this.timerHandle = void 0; + this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action)); + }, + ms, + actionType + ) + ); + } + executeAction(action) { + var _a2, _b, _c, _d, _e2, _f; + let stop = false; + try { + if (this.operationHost.isCancellationRequested()) { + stop = true; + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId, early: true }); + } else { + (_b = tracing) == null ? void 0 : _b.push(tracing.Phase.Session, "stepAction", { seq: this.requestId }); + action(this); + (_c = tracing) == null ? void 0 : _c.pop(); + } + } catch (e10) { + (_d = tracing) == null ? void 0 : _d.popAll(); + stop = true; + if (e10 instanceof OperationCanceledException) { + (_e2 = tracing) == null ? void 0 : _e2.instant(tracing.Phase.Session, "stepCanceled", { seq: this.requestId }); + } else { + (_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "stepError", { seq: this.requestId, message: e10.message }); + this.operationHost.logError(e10, `delayed processing of request ${this.requestId}`); + } + } + if (stop || !this.hasPendingWork()) { + this.complete(); + } + } + setTimerHandle(timerHandle) { + if (this.timerHandle !== void 0) { + this.operationHost.getServerHost().clearTimeout(this.timerHandle); + } + this.timerHandle = timerHandle; + } + setImmediateId(immediateId) { + if (this.immediateId !== void 0) { + this.operationHost.getServerHost().clearImmediate(this.immediateId); + } + this.immediateId = immediateId; + } + hasPendingWork() { + return !!this.timerHandle || !!this.immediateId; + } + }; + invalidPartialSemanticModeCommands = [ + "openExternalProject", + "openExternalProjects", + "closeExternalProject", + "synchronizeProjectList", + "emit-output", + "compileOnSaveAffectedFileList", + "compileOnSaveEmitFile", + "compilerOptionsDiagnostics-full", + "encodedSemanticClassifications-full", + "semanticDiagnosticsSync", + "suggestionDiagnosticsSync", + "geterrForProject", + "reload", + "reloadProjects", + "getCodeFixes", + "getCodeFixes-full", + "getCombinedCodeFix", + "getCombinedCodeFix-full", + "applyCodeActionCommand", + "getSupportedCodeFixes", + "getApplicableRefactors", + "getMoveToRefactoringFileSuggestions", + "getEditsForRefactor", + "getEditsForRefactor-full", + "organizeImports", + "organizeImports-full", + "getEditsForFileRename", + "getEditsForFileRename-full", + "prepareCallHierarchy", + "provideCallHierarchyIncomingCalls", + "provideCallHierarchyOutgoingCalls" + /* ProvideCallHierarchyOutgoingCalls */ + ]; + invalidSyntacticModeCommands = [ + ...invalidPartialSemanticModeCommands, + "definition", + "definition-full", + "definitionAndBoundSpan", + "definitionAndBoundSpan-full", + "typeDefinition", + "implementation", + "implementation-full", + "references", + "references-full", + "rename", + "renameLocations-full", + "rename-full", + "quickinfo", + "quickinfo-full", + "completionInfo", + "completions", + "completions-full", + "completionEntryDetails", + "completionEntryDetails-full", + "signatureHelp", + "signatureHelp-full", + "navto", + "navto-full", + "documentHighlights", + "documentHighlights-full" + /* DocumentHighlightsFull */ + ]; + Session3 = class _Session { + constructor(opts) { + this.changeSeq = 0; + this.handlers = new Map(Object.entries({ + // TODO(jakebailey): correctly type the handlers + [ + "status" + /* Status */ + ]: () => { + const response = { version: version5 }; + return this.requiredResponse(response); + }, + [ + "openExternalProject" + /* OpenExternalProject */ + ]: (request3) => { + this.projectService.openExternalProject( + request3.arguments, + /*print*/ + true + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "openExternalProjects" + /* OpenExternalProjects */ + ]: (request3) => { + this.projectService.openExternalProjects(request3.arguments.projects); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "closeExternalProject" + /* CloseExternalProject */ + ]: (request3) => { + this.projectService.closeExternalProject( + request3.arguments.projectFileName, + /*print*/ + true + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "synchronizeProjectList" + /* SynchronizeProjectList */ + ]: (request3) => { + const result2 = this.projectService.synchronizeProjectList(request3.arguments.knownProjects, request3.arguments.includeProjectReferenceRedirectInfo); + if (!result2.some((p7) => p7.projectErrors && p7.projectErrors.length !== 0)) { + return this.requiredResponse(result2); + } + const converted = map4(result2, (p7) => { + if (!p7.projectErrors || p7.projectErrors.length === 0) { + return p7; + } + return { + info: p7.info, + changes: p7.changes, + files: p7.files, + projectErrors: this.convertToDiagnosticsWithLinePosition( + p7.projectErrors, + /*scriptInfo*/ + void 0 + ) + }; + }); + return this.requiredResponse(converted); + }, + [ + "updateOpen" + /* UpdateOpen */ + ]: (request3) => { + this.changeSeq++; + this.projectService.applyChangesInOpenFiles( + request3.arguments.openFiles && mapIterator(request3.arguments.openFiles, (file) => ({ + fileName: file.file, + content: file.fileContent, + scriptKind: file.scriptKindName, + projectRootPath: file.projectRootPath + })), + request3.arguments.changedFiles && mapIterator(request3.arguments.changedFiles, (file) => ({ + fileName: file.fileName, + changes: mapDefinedIterator(arrayReverseIterator(file.textChanges), (change) => { + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file.fileName)); + const start = scriptInfo.lineOffsetToPosition(change.start.line, change.start.offset); + const end = scriptInfo.lineOffsetToPosition(change.end.line, change.end.offset); + return start >= 0 ? { span: { start, length: end - start }, newText: change.newText } : void 0; + }) + })), + request3.arguments.closedFiles + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "applyChangedToOpenFiles" + /* ApplyChangedToOpenFiles */ + ]: (request3) => { + this.changeSeq++; + this.projectService.applyChangesInOpenFiles( + request3.arguments.openFiles, + request3.arguments.changedFiles && mapIterator(request3.arguments.changedFiles, (file) => ({ + fileName: file.fileName, + // apply changes in reverse order + changes: arrayReverseIterator(file.changes) + })), + request3.arguments.closedFiles + ); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "exit" + /* Exit */ + ]: () => { + this.exit(); + return this.notRequired(); + }, + [ + "definition" + /* Definition */ + ]: (request3) => { + return this.requiredResponse(this.getDefinition( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "definition-full" + /* DefinitionFull */ + ]: (request3) => { + return this.requiredResponse(this.getDefinition( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "definitionAndBoundSpan" + /* DefinitionAndBoundSpan */ + ]: (request3) => { + return this.requiredResponse(this.getDefinitionAndBoundSpan( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "definitionAndBoundSpan-full" + /* DefinitionAndBoundSpanFull */ + ]: (request3) => { + return this.requiredResponse(this.getDefinitionAndBoundSpan( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "findSourceDefinition" + /* FindSourceDefinition */ + ]: (request3) => { + return this.requiredResponse(this.findSourceDefinition(request3.arguments)); + }, + [ + "emit-output" + /* EmitOutput */ + ]: (request3) => { + return this.requiredResponse(this.getEmitOutput(request3.arguments)); + }, + [ + "typeDefinition" + /* TypeDefinition */ + ]: (request3) => { + return this.requiredResponse(this.getTypeDefinition(request3.arguments)); + }, + [ + "implementation" + /* Implementation */ + ]: (request3) => { + return this.requiredResponse(this.getImplementation( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "implementation-full" + /* ImplementationFull */ + ]: (request3) => { + return this.requiredResponse(this.getImplementation( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "references" + /* References */ + ]: (request3) => { + return this.requiredResponse(this.getReferences( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "references-full" + /* ReferencesFull */ + ]: (request3) => { + return this.requiredResponse(this.getReferences( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "rename" + /* Rename */ + ]: (request3) => { + return this.requiredResponse(this.getRenameLocations( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "renameLocations-full" + /* RenameLocationsFull */ + ]: (request3) => { + return this.requiredResponse(this.getRenameLocations( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "rename-full" + /* RenameInfoFull */ + ]: (request3) => { + return this.requiredResponse(this.getRenameInfo(request3.arguments)); + }, + [ + "open" + /* Open */ + ]: (request3) => { + this.openClientFile( + toNormalizedPath(request3.arguments.file), + request3.arguments.fileContent, + convertScriptKindName(request3.arguments.scriptKindName), + // TODO: GH#18217 + request3.arguments.projectRootPath ? toNormalizedPath(request3.arguments.projectRootPath) : void 0 + ); + return this.notRequired(); + }, + [ + "quickinfo" + /* Quickinfo */ + ]: (request3) => { + return this.requiredResponse(this.getQuickInfoWorker( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "quickinfo-full" + /* QuickinfoFull */ + ]: (request3) => { + return this.requiredResponse(this.getQuickInfoWorker( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "getOutliningSpans" + /* GetOutliningSpans */ + ]: (request3) => { + return this.requiredResponse(this.getOutliningSpans( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "outliningSpans" + /* GetOutliningSpansFull */ + ]: (request3) => { + return this.requiredResponse(this.getOutliningSpans( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "todoComments" + /* TodoComments */ + ]: (request3) => { + return this.requiredResponse(this.getTodoComments(request3.arguments)); + }, + [ + "indentation" + /* Indentation */ + ]: (request3) => { + return this.requiredResponse(this.getIndentation(request3.arguments)); + }, + [ + "nameOrDottedNameSpan" + /* NameOrDottedNameSpan */ + ]: (request3) => { + return this.requiredResponse(this.getNameOrDottedNameSpan(request3.arguments)); + }, + [ + "breakpointStatement" + /* BreakpointStatement */ + ]: (request3) => { + return this.requiredResponse(this.getBreakpointStatement(request3.arguments)); + }, + [ + "braceCompletion" + /* BraceCompletion */ + ]: (request3) => { + return this.requiredResponse(this.isValidBraceCompletion(request3.arguments)); + }, + [ + "docCommentTemplate" + /* DocCommentTemplate */ + ]: (request3) => { + return this.requiredResponse(this.getDocCommentTemplate(request3.arguments)); + }, + [ + "getSpanOfEnclosingComment" + /* GetSpanOfEnclosingComment */ + ]: (request3) => { + return this.requiredResponse(this.getSpanOfEnclosingComment(request3.arguments)); + }, + [ + "fileReferences" + /* FileReferences */ + ]: (request3) => { + return this.requiredResponse(this.getFileReferences( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "fileReferences-full" + /* FileReferencesFull */ + ]: (request3) => { + return this.requiredResponse(this.getFileReferences( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "format" + /* Format */ + ]: (request3) => { + return this.requiredResponse(this.getFormattingEditsForRange(request3.arguments)); + }, + [ + "formatonkey" + /* Formatonkey */ + ]: (request3) => { + return this.requiredResponse(this.getFormattingEditsAfterKeystroke(request3.arguments)); + }, + [ + "format-full" + /* FormatFull */ + ]: (request3) => { + return this.requiredResponse(this.getFormattingEditsForDocumentFull(request3.arguments)); + }, + [ + "formatonkey-full" + /* FormatonkeyFull */ + ]: (request3) => { + return this.requiredResponse(this.getFormattingEditsAfterKeystrokeFull(request3.arguments)); + }, + [ + "formatRange-full" + /* FormatRangeFull */ + ]: (request3) => { + return this.requiredResponse(this.getFormattingEditsForRangeFull(request3.arguments)); + }, + [ + "completionInfo" + /* CompletionInfo */ + ]: (request3) => { + return this.requiredResponse(this.getCompletions( + request3.arguments, + "completionInfo" + /* CompletionInfo */ + )); + }, + [ + "completions" + /* Completions */ + ]: (request3) => { + return this.requiredResponse(this.getCompletions( + request3.arguments, + "completions" + /* Completions */ + )); + }, + [ + "completions-full" + /* CompletionsFull */ + ]: (request3) => { + return this.requiredResponse(this.getCompletions( + request3.arguments, + "completions-full" + /* CompletionsFull */ + )); + }, + [ + "completionEntryDetails" + /* CompletionDetails */ + ]: (request3) => { + return this.requiredResponse(this.getCompletionEntryDetails( + request3.arguments, + /*fullResult*/ + false + )); + }, + [ + "completionEntryDetails-full" + /* CompletionDetailsFull */ + ]: (request3) => { + return this.requiredResponse(this.getCompletionEntryDetails( + request3.arguments, + /*fullResult*/ + true + )); + }, + [ + "compileOnSaveAffectedFileList" + /* CompileOnSaveAffectedFileList */ + ]: (request3) => { + return this.requiredResponse(this.getCompileOnSaveAffectedFileList(request3.arguments)); + }, + [ + "compileOnSaveEmitFile" + /* CompileOnSaveEmitFile */ + ]: (request3) => { + return this.requiredResponse(this.emitFile(request3.arguments)); + }, + [ + "signatureHelp" + /* SignatureHelp */ + ]: (request3) => { + return this.requiredResponse(this.getSignatureHelpItems( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "signatureHelp-full" + /* SignatureHelpFull */ + ]: (request3) => { + return this.requiredResponse(this.getSignatureHelpItems( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "compilerOptionsDiagnostics-full" + /* CompilerOptionsDiagnosticsFull */ + ]: (request3) => { + return this.requiredResponse(this.getCompilerOptionsDiagnostics(request3.arguments)); + }, + [ + "encodedSyntacticClassifications-full" + /* EncodedSyntacticClassificationsFull */ + ]: (request3) => { + return this.requiredResponse(this.getEncodedSyntacticClassifications(request3.arguments)); + }, + [ + "encodedSemanticClassifications-full" + /* EncodedSemanticClassificationsFull */ + ]: (request3) => { + return this.requiredResponse(this.getEncodedSemanticClassifications(request3.arguments)); + }, + [ + "cleanup" + /* Cleanup */ + ]: () => { + this.cleanup(); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "semanticDiagnosticsSync" + /* SemanticDiagnosticsSync */ + ]: (request3) => { + return this.requiredResponse(this.getSemanticDiagnosticsSync(request3.arguments)); + }, + [ + "syntacticDiagnosticsSync" + /* SyntacticDiagnosticsSync */ + ]: (request3) => { + return this.requiredResponse(this.getSyntacticDiagnosticsSync(request3.arguments)); + }, + [ + "suggestionDiagnosticsSync" + /* SuggestionDiagnosticsSync */ + ]: (request3) => { + return this.requiredResponse(this.getSuggestionDiagnosticsSync(request3.arguments)); + }, + [ + "geterr" + /* Geterr */ + ]: (request3) => { + this.errorCheck.startNew((next) => this.getDiagnostics(next, request3.arguments.delay, request3.arguments.files)); + return this.notRequired(); + }, + [ + "geterrForProject" + /* GeterrForProject */ + ]: (request3) => { + this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request3.arguments.delay, request3.arguments.file)); + return this.notRequired(); + }, + [ + "change" + /* Change */ + ]: (request3) => { + this.change(request3.arguments); + return this.notRequired(); + }, + [ + "configure" + /* Configure */ + ]: (request3) => { + this.projectService.setHostConfiguration(request3.arguments); + this.doOutput( + /*info*/ + void 0, + "configure", + request3.seq, + /*success*/ + true + ); + return this.notRequired(); + }, + [ + "reload" + /* Reload */ + ]: (request3) => { + this.reload(request3.arguments, request3.seq); + return this.requiredResponse({ reloadFinished: true }); + }, + [ + "saveto" + /* Saveto */ + ]: (request3) => { + const savetoArgs = request3.arguments; + this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile); + return this.notRequired(); + }, + [ + "close" + /* Close */ + ]: (request3) => { + const closeArgs = request3.arguments; + this.closeClientFile(closeArgs.file); + return this.notRequired(); + }, + [ + "navto" + /* Navto */ + ]: (request3) => { + return this.requiredResponse(this.getNavigateToItems( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "navto-full" + /* NavtoFull */ + ]: (request3) => { + return this.requiredResponse(this.getNavigateToItems( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "brace" + /* Brace */ + ]: (request3) => { + return this.requiredResponse(this.getBraceMatching( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "brace-full" + /* BraceFull */ + ]: (request3) => { + return this.requiredResponse(this.getBraceMatching( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "navbar" + /* NavBar */ + ]: (request3) => { + return this.requiredResponse(this.getNavigationBarItems( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "navbar-full" + /* NavBarFull */ + ]: (request3) => { + return this.requiredResponse(this.getNavigationBarItems( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "navtree" + /* NavTree */ + ]: (request3) => { + return this.requiredResponse(this.getNavigationTree( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "navtree-full" + /* NavTreeFull */ + ]: (request3) => { + return this.requiredResponse(this.getNavigationTree( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "documentHighlights" + /* DocumentHighlights */ + ]: (request3) => { + return this.requiredResponse(this.getDocumentHighlights( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "documentHighlights-full" + /* DocumentHighlightsFull */ + ]: (request3) => { + return this.requiredResponse(this.getDocumentHighlights( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "compilerOptionsForInferredProjects" + /* CompilerOptionsForInferredProjects */ + ]: (request3) => { + this.setCompilerOptionsForInferredProjects(request3.arguments); + return this.requiredResponse( + /*response*/ + true + ); + }, + [ + "projectInfo" + /* ProjectInfo */ + ]: (request3) => { + return this.requiredResponse(this.getProjectInfo(request3.arguments)); + }, + [ + "reloadProjects" + /* ReloadProjects */ + ]: () => { + this.projectService.reloadProjects(); + return this.notRequired(); + }, + [ + "jsxClosingTag" + /* JsxClosingTag */ + ]: (request3) => { + return this.requiredResponse(this.getJsxClosingTag(request3.arguments)); + }, + [ + "linkedEditingRange" + /* LinkedEditingRange */ + ]: (request3) => { + return this.requiredResponse(this.getLinkedEditingRange(request3.arguments)); + }, + [ + "getCodeFixes" + /* GetCodeFixes */ + ]: (request3) => { + return this.requiredResponse(this.getCodeFixes( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "getCodeFixes-full" + /* GetCodeFixesFull */ + ]: (request3) => { + return this.requiredResponse(this.getCodeFixes( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "getCombinedCodeFix" + /* GetCombinedCodeFix */ + ]: (request3) => { + return this.requiredResponse(this.getCombinedCodeFix( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "getCombinedCodeFix-full" + /* GetCombinedCodeFixFull */ + ]: (request3) => { + return this.requiredResponse(this.getCombinedCodeFix( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "applyCodeActionCommand" + /* ApplyCodeActionCommand */ + ]: (request3) => { + return this.requiredResponse(this.applyCodeActionCommand(request3.arguments)); + }, + [ + "getSupportedCodeFixes" + /* GetSupportedCodeFixes */ + ]: (request3) => { + return this.requiredResponse(this.getSupportedCodeFixes(request3.arguments)); + }, + [ + "getApplicableRefactors" + /* GetApplicableRefactors */ + ]: (request3) => { + return this.requiredResponse(this.getApplicableRefactors(request3.arguments)); + }, + [ + "getEditsForRefactor" + /* GetEditsForRefactor */ + ]: (request3) => { + return this.requiredResponse(this.getEditsForRefactor( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "getMoveToRefactoringFileSuggestions" + /* GetMoveToRefactoringFileSuggestions */ + ]: (request3) => { + return this.requiredResponse(this.getMoveToRefactoringFileSuggestions(request3.arguments)); + }, + [ + "getEditsForRefactor-full" + /* GetEditsForRefactorFull */ + ]: (request3) => { + return this.requiredResponse(this.getEditsForRefactor( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "organizeImports" + /* OrganizeImports */ + ]: (request3) => { + return this.requiredResponse(this.organizeImports( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "organizeImports-full" + /* OrganizeImportsFull */ + ]: (request3) => { + return this.requiredResponse(this.organizeImports( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "getEditsForFileRename" + /* GetEditsForFileRename */ + ]: (request3) => { + return this.requiredResponse(this.getEditsForFileRename( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "getEditsForFileRename-full" + /* GetEditsForFileRenameFull */ + ]: (request3) => { + return this.requiredResponse(this.getEditsForFileRename( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "configurePlugin" + /* ConfigurePlugin */ + ]: (request3) => { + this.configurePlugin(request3.arguments); + this.doOutput( + /*info*/ + void 0, + "configurePlugin", + request3.seq, + /*success*/ + true + ); + return this.notRequired(); + }, + [ + "selectionRange" + /* SelectionRange */ + ]: (request3) => { + return this.requiredResponse(this.getSmartSelectionRange( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "selectionRange-full" + /* SelectionRangeFull */ + ]: (request3) => { + return this.requiredResponse(this.getSmartSelectionRange( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "prepareCallHierarchy" + /* PrepareCallHierarchy */ + ]: (request3) => { + return this.requiredResponse(this.prepareCallHierarchy(request3.arguments)); + }, + [ + "provideCallHierarchyIncomingCalls" + /* ProvideCallHierarchyIncomingCalls */ + ]: (request3) => { + return this.requiredResponse(this.provideCallHierarchyIncomingCalls(request3.arguments)); + }, + [ + "provideCallHierarchyOutgoingCalls" + /* ProvideCallHierarchyOutgoingCalls */ + ]: (request3) => { + return this.requiredResponse(this.provideCallHierarchyOutgoingCalls(request3.arguments)); + }, + [ + "toggleLineComment" + /* ToggleLineComment */ + ]: (request3) => { + return this.requiredResponse(this.toggleLineComment( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "toggleLineComment-full" + /* ToggleLineCommentFull */ + ]: (request3) => { + return this.requiredResponse(this.toggleLineComment( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "toggleMultilineComment" + /* ToggleMultilineComment */ + ]: (request3) => { + return this.requiredResponse(this.toggleMultilineComment( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "toggleMultilineComment-full" + /* ToggleMultilineCommentFull */ + ]: (request3) => { + return this.requiredResponse(this.toggleMultilineComment( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "commentSelection" + /* CommentSelection */ + ]: (request3) => { + return this.requiredResponse(this.commentSelection( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "commentSelection-full" + /* CommentSelectionFull */ + ]: (request3) => { + return this.requiredResponse(this.commentSelection( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "uncommentSelection" + /* UncommentSelection */ + ]: (request3) => { + return this.requiredResponse(this.uncommentSelection( + request3.arguments, + /*simplifiedResult*/ + true + )); + }, + [ + "uncommentSelection-full" + /* UncommentSelectionFull */ + ]: (request3) => { + return this.requiredResponse(this.uncommentSelection( + request3.arguments, + /*simplifiedResult*/ + false + )); + }, + [ + "provideInlayHints" + /* ProvideInlayHints */ + ]: (request3) => { + return this.requiredResponse(this.provideInlayHints(request3.arguments)); + } + })); + this.host = opts.host; + this.cancellationToken = opts.cancellationToken; + this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller; + this.byteLength = opts.byteLength; + this.hrtime = opts.hrtime; + this.logger = opts.logger; + this.canUseEvents = opts.canUseEvents; + this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents; + this.noGetErrOnBackgroundUpdate = opts.noGetErrOnBackgroundUpdate; + const { throttleWaitMilliseconds } = opts; + this.eventHandler = this.canUseEvents ? opts.eventHandler || ((event) => this.defaultEventHandler(event)) : void 0; + const multistepOperationHost = { + executeWithRequestId: (requestId, action) => this.executeWithRequestId(requestId, action), + getCurrentRequestId: () => this.currentRequestId, + getServerHost: () => this.host, + logError: (err, cmd) => this.logError(err, cmd), + sendRequestCompletedEvent: (requestId) => this.sendRequestCompletedEvent(requestId), + isCancellationRequested: () => this.cancellationToken.isCancellationRequested() + }; + this.errorCheck = new MultistepOperation(multistepOperationHost); + const settings = { + host: this.host, + logger: this.logger, + cancellationToken: this.cancellationToken, + useSingleInferredProject: opts.useSingleInferredProject, + useInferredProjectPerProjectRoot: opts.useInferredProjectPerProjectRoot, + typingsInstaller: this.typingsInstaller, + throttleWaitMilliseconds, + eventHandler: this.eventHandler, + suppressDiagnosticEvents: this.suppressDiagnosticEvents, + globalPlugins: opts.globalPlugins, + pluginProbeLocations: opts.pluginProbeLocations, + allowLocalPluginLoads: opts.allowLocalPluginLoads, + typesMapLocation: opts.typesMapLocation, + serverMode: opts.serverMode, + session: this, + canUseWatchEvents: opts.canUseWatchEvents, + incrementalVerifier: opts.incrementalVerifier + }; + this.projectService = new ProjectService3(settings); + this.projectService.setPerformanceEventHandler(this.performanceEventHandler.bind(this)); + this.gcTimer = new GcTimer( + this.host, + /*delay*/ + 7e3, + this.logger + ); + switch (this.projectService.serverMode) { + case 0: + break; + case 1: + invalidPartialSemanticModeCommands.forEach( + (commandName) => this.handlers.set(commandName, (request3) => { + throw new Error(`Request: ${request3.command} not allowed in LanguageServiceMode.PartialSemantic`); + }) + ); + break; + case 2: + invalidSyntacticModeCommands.forEach( + (commandName) => this.handlers.set(commandName, (request3) => { + throw new Error(`Request: ${request3.command} not allowed in LanguageServiceMode.Syntactic`); + }) + ); + break; + default: + Debug.assertNever(this.projectService.serverMode); + } + } + sendRequestCompletedEvent(requestId) { + this.event({ request_seq: requestId }, "requestCompleted"); + } + addPerformanceData(key, value2) { + if (!this.performanceData) { + this.performanceData = {}; + } + this.performanceData[key] = (this.performanceData[key] ?? 0) + value2; + } + performanceEventHandler(event) { + switch (event.kind) { + case "UpdateGraph": + this.addPerformanceData("updateGraphDurationMs", event.durationMs); + break; + case "CreatePackageJsonAutoImportProvider": + this.addPerformanceData("createAutoImportProviderProgramDurationMs", event.durationMs); + break; + } + } + defaultEventHandler(event) { + switch (event.eventName) { + case ProjectsUpdatedInBackgroundEvent: + this.projectsUpdatedInBackgroundEvent(event.data.openFiles); + break; + case ProjectLoadingStartEvent: + this.event({ + projectName: event.data.project.getProjectName(), + reason: event.data.reason + }, event.eventName); + break; + case ProjectLoadingFinishEvent: + this.event({ + projectName: event.data.project.getProjectName() + }, event.eventName); + break; + case LargeFileReferencedEvent: + case CreateFileWatcherEvent: + case CreateDirectoryWatcherEvent: + case CloseFileWatcherEvent: + this.event(event.data, event.eventName); + break; + case ConfigFileDiagEvent: + this.event({ + triggerFile: event.data.triggerFile, + configFile: event.data.configFileName, + diagnostics: map4(event.data.diagnostics, (diagnostic) => formatDiagnosticToProtocol( + diagnostic, + /*includeFileName*/ + true + )) + }, event.eventName); + break; + case ProjectLanguageServiceStateEvent: { + this.event({ + projectName: event.data.project.getProjectName(), + languageServiceEnabled: event.data.languageServiceEnabled + }, event.eventName); + break; + } + case ProjectInfoTelemetryEvent: { + const eventName = "telemetry"; + this.event({ + telemetryEventName: event.eventName, + payload: event.data + }, eventName); + break; + } + } + } + projectsUpdatedInBackgroundEvent(openFiles) { + this.projectService.logger.info(`got projects updated in background ${openFiles}`); + if (openFiles.length) { + if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) { + this.projectService.logger.info(`Queueing diagnostics update for ${openFiles}`); + this.errorCheck.startNew((next) => this.updateErrorCheck( + next, + openFiles, + 100, + /*requireOpen*/ + true + )); + } + this.event({ + openFiles + }, ProjectsUpdatedInBackgroundEvent); + } + } + logError(err, cmd) { + this.logErrorWorker(err, cmd); + } + logErrorWorker(err, cmd, fileRequest) { + let msg = "Exception on executing command " + cmd; + if (err.message) { + msg += ":\n" + indent2(err.message); + if (err.stack) { + msg += "\n" + indent2(err.stack); + } + } + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + if (fileRequest) { + try { + const { file, project } = this.getFileAndProject(fileRequest); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + if (scriptInfo) { + const text = getSnapshotText(scriptInfo.getSnapshot()); + msg += ` + +File text of ${fileRequest.file}:${indent2(text)} +`; + } + } catch { + } + } + if (err.ProgramFiles) { + msg += ` + +Program files: ${JSON.stringify(err.ProgramFiles)} +`; + msg += ` + +Projects:: +`; + let counter = 0; + const addProjectInfo = (project) => { + msg += ` +Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter} +`; + msg += project.filesToString( + /*writeProjectFileNames*/ + true + ); + msg += "\n-----------------------------------------------\n"; + counter++; + }; + this.projectService.externalProjects.forEach(addProjectInfo); + this.projectService.configuredProjects.forEach(addProjectInfo); + this.projectService.inferredProjects.forEach(addProjectInfo); + } + } + this.logger.msg( + msg, + "Err" + /* Err */ + ); + } + send(msg) { + if (msg.type === "event" && !this.canUseEvents) { + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`Session does not support events: ignored event: ${stringifyIndented(msg)}`); + } + return; + } + this.writeMessage(msg); + } + writeMessage(msg) { + var _a2; + const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine); + (_a2 = perfLogger) == null ? void 0 : _a2.logEvent(`Response message size: ${msgText.length}`); + this.host.write(msgText); + } + event(body, eventName) { + this.send(toEvent(eventName, body)); + } + /** @internal */ + doOutput(info2, cmdName, reqSeq, success, message) { + const res = { + seq: 0, + type: "response", + command: cmdName, + request_seq: reqSeq, + success, + performanceData: this.performanceData + }; + if (success) { + let metadata; + if (isArray3(info2)) { + res.body = info2; + metadata = info2.metadata; + delete info2.metadata; + } else if (typeof info2 === "object") { + if (info2.metadata) { + const { metadata: infoMetadata, ...body } = info2; + res.body = body; + metadata = infoMetadata; + } else { + res.body = info2; + } + } else { + res.body = info2; + } + if (metadata) + res.metadata = metadata; + } else { + Debug.assert(info2 === void 0); + } + if (message) { + res.message = message; + } + this.send(res); + } + semanticCheck(file, project) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "semanticCheck", { file, configFilePath: project.canonicalConfigFilePath }); + const diags = isDeclarationFileInJSOnlyNonConfiguredProject(project, file) ? emptyArray2 : project.getLanguageService().getSemanticDiagnostics(file).filter((d7) => !!d7.file); + this.sendDiagnosticsEvent(file, project, diags, "semanticDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + syntacticCheck(file, project) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "syntacticCheck", { file, configFilePath: project.canonicalConfigFilePath }); + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + suggestionCheck(file, project) { + var _a2, _b; + (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Session, "suggestionCheck", { file, configFilePath: project.canonicalConfigFilePath }); + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag"); + (_b = tracing) == null ? void 0 : _b.pop(); + } + sendDiagnosticsEvent(file, project, diagnostics, kind) { + try { + this.event({ file, diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)) }, kind); + } catch (err) { + this.logError(err, kind); + } + } + /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */ + updateErrorCheck(next, checkList, ms, requireOpen = true) { + Debug.assert(!this.suppressDiagnosticEvents); + const seq3 = this.changeSeq; + const followMs = Math.min(ms, 200); + let index4 = 0; + const goNext = () => { + index4++; + if (checkList.length > index4) { + next.delay("checkOne", followMs, checkOne); + } + }; + const checkOne = () => { + if (this.changeSeq !== seq3) { + return; + } + let item = checkList[index4]; + if (isString4(item)) { + item = this.toPendingErrorCheck(item); + if (!item) { + goNext(); + return; + } + } + const { fileName, project } = item; + updateProjectIfDirty(project); + if (!project.containsFile(fileName, requireOpen)) { + return; + } + this.syntacticCheck(fileName, project); + if (this.changeSeq !== seq3) { + return; + } + if (project.projectService.serverMode !== 0) { + goNext(); + return; + } + next.immediate("semanticCheck", () => { + this.semanticCheck(fileName, project); + if (this.changeSeq !== seq3) { + return; + } + if (this.getPreferences(fileName).disableSuggestions) { + goNext(); + return; + } + next.immediate("suggestionCheck", () => { + this.suggestionCheck(fileName, project); + goNext(); + }); + }); + }; + if (checkList.length > index4 && this.changeSeq === seq3) { + next.delay("checkOne", ms, checkOne); + } + } + cleanProjects(caption, projects) { + if (!projects) { + return; + } + this.logger.info(`cleaning ${caption}`); + for (const p7 of projects) { + p7.getLanguageService( + /*ensureSynchronized*/ + false + ).cleanupSemanticCache(); + p7.cleanupProgram(); + } + } + cleanup() { + this.cleanProjects("inferred projects", this.projectService.inferredProjects); + this.cleanProjects("configured projects", arrayFrom(this.projectService.configuredProjects.values())); + this.cleanProjects("external projects", this.projectService.externalProjects); + if (this.host.gc) { + this.logger.info(`host.gc()`); + this.host.gc(); + } + } + getEncodedSyntacticClassifications(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + return languageService.getEncodedSyntacticClassifications(file, args); + } + getEncodedSemanticClassifications(args) { + const { file, project } = this.getFileAndProject(args); + const format5 = args.format === "2020" ? "2020" : "original"; + return project.getLanguageService().getEncodedSemanticClassifications(file, args, format5); + } + getProject(projectFileName) { + return projectFileName === void 0 ? void 0 : this.projectService.findProject(projectFileName); + } + getConfigFileAndProject(args) { + const project = this.getProject(args.projectFileName); + const file = toNormalizedPath(args.file); + return { + configFile: project && project.hasConfigFile(file) ? file : void 0, + project + }; + } + getConfigFileDiagnostics(configFile, project, includeLinePosition) { + const projectErrors = project.getAllProjectErrors(); + const optionsErrors = project.getLanguageService().getCompilerOptionsDiagnostics(); + const diagnosticsForConfigFile = filter2( + concatenate(projectErrors, optionsErrors), + (diagnostic) => !!diagnostic.file && diagnostic.file.fileName === configFile + ); + return includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnosticsForConfigFile) : map4( + diagnosticsForConfigFile, + (diagnostic) => formatDiagnosticToProtocol( + diagnostic, + /*includeFileName*/ + false + ) + ); + } + convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics) { + return diagnostics.map((d7) => ({ + message: flattenDiagnosticMessageText(d7.messageText, this.host.newLine), + start: d7.start, + // TODO: GH#18217 + length: d7.length, + // TODO: GH#18217 + category: diagnosticCategoryName(d7), + code: d7.code, + source: d7.source, + startLocation: d7.file && convertToLocation(getLineAndCharacterOfPosition(d7.file, d7.start)), + // TODO: GH#18217 + endLocation: d7.file && convertToLocation(getLineAndCharacterOfPosition(d7.file, d7.start + d7.length)), + // TODO: GH#18217 + reportsUnnecessary: d7.reportsUnnecessary, + reportsDeprecated: d7.reportsDeprecated, + relatedInformation: map4(d7.relatedInformation, formatRelatedInformation) + })); + } + getCompilerOptionsDiagnostics(args) { + const project = this.getProject(args.projectFileName); + return this.convertToDiagnosticsWithLinePosition( + filter2( + project.getLanguageService().getCompilerOptionsDiagnostics(), + (diagnostic) => !diagnostic.file + ), + /*scriptInfo*/ + void 0 + ); + } + convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) { + return diagnostics.map( + (d7) => ({ + message: flattenDiagnosticMessageText(d7.messageText, this.host.newLine), + start: d7.start, + length: d7.length, + category: diagnosticCategoryName(d7), + code: d7.code, + source: d7.source, + startLocation: scriptInfo && scriptInfo.positionToLineOffset(d7.start), + // TODO: GH#18217 + endLocation: scriptInfo && scriptInfo.positionToLineOffset(d7.start + d7.length), + reportsUnnecessary: d7.reportsUnnecessary, + reportsDeprecated: d7.reportsDeprecated, + relatedInformation: map4(d7.relatedInformation, formatRelatedInformation) + }) + ); + } + getDiagnosticsWorker(args, isSemantic, selector, includeLinePosition) { + const { project, file } = this.getFileAndProject(args); + if (isSemantic && isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { + return emptyArray2; + } + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const diagnostics = selector(project, file); + return includeLinePosition ? this.convertToDiagnosticsWithLinePosition(diagnostics, scriptInfo) : diagnostics.map((d7) => formatDiag(file, project, d7)); + } + getDefinition(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getDefinitionAtPosition(file, position) || emptyArray2, project); + return simplifiedResult ? this.mapDefinitionInfo(definitions, project) : definitions.map(_Session.mapToOriginalLocation); + } + mapDefinitionInfoLocations(definitions, project) { + return definitions.map((info2) => { + const newDocumentSpan = getMappedDocumentSpanForProject(info2, project); + return !newDocumentSpan ? info2 : { + ...newDocumentSpan, + containerKind: info2.containerKind, + containerName: info2.containerName, + kind: info2.kind, + name: info2.name, + failedAliasResolution: info2.failedAliasResolution, + ...info2.unverified && { unverified: info2.unverified } + }; + }); + } + getDefinitionAndBoundSpan(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const scriptInfo = Debug.checkDefined(project.getScriptInfo(file)); + const unmappedDefinitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position); + if (!unmappedDefinitionAndBoundSpan || !unmappedDefinitionAndBoundSpan.definitions) { + return { + definitions: emptyArray2, + textSpan: void 0 + // TODO: GH#18217 + }; + } + const definitions = this.mapDefinitionInfoLocations(unmappedDefinitionAndBoundSpan.definitions, project); + const { textSpan } = unmappedDefinitionAndBoundSpan; + if (simplifiedResult) { + return { + definitions: this.mapDefinitionInfo(definitions, project), + textSpan: toProtocolTextSpan(textSpan, scriptInfo) + }; + } + return { + definitions: definitions.map(_Session.mapToOriginalLocation), + textSpan + }; + } + findSourceDefinition(args) { + var _a2; + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const unmappedDefinitions = project.getLanguageService().getDefinitionAtPosition(file, position); + let definitions = this.mapDefinitionInfoLocations(unmappedDefinitions || emptyArray2, project).slice(); + const needsJsResolution = this.projectService.serverMode === 0 && (!some2(definitions, (d7) => toNormalizedPath(d7.fileName) !== file && !d7.isAmbient) || some2(definitions, (d7) => !!d7.failedAliasResolution)); + if (needsJsResolution) { + const definitionSet = createSet2( + (d7) => d7.textSpan.start, + getDocumentSpansEqualityComparer(this.host.useCaseSensitiveFileNames) + ); + definitions == null ? void 0 : definitions.forEach((d7) => definitionSet.add(d7)); + const noDtsProject = project.getNoDtsResolutionProject(file); + const ls = noDtsProject.getLanguageService(); + const jsDefinitions = (_a2 = ls.getDefinitionAtPosition( + file, + position, + /*searchOtherFilesOnly*/ + true, + /*stopAtAlias*/ + false + )) == null ? void 0 : _a2.filter((d7) => toNormalizedPath(d7.fileName) !== file); + if (some2(jsDefinitions)) { + for (const jsDefinition of jsDefinitions) { + if (jsDefinition.unverified) { + const refined = tryRefineDefinition(jsDefinition, project.getLanguageService().getProgram(), ls.getProgram()); + if (some2(refined)) { + for (const def of refined) { + definitionSet.add(def); + } + continue; + } + } + definitionSet.add(jsDefinition); + } + } else { + const ambientCandidates = definitions.filter((d7) => toNormalizedPath(d7.fileName) !== file && d7.isAmbient); + for (const candidate of some2(ambientCandidates) ? ambientCandidates : getAmbientCandidatesByClimbingAccessChain()) { + const fileNameToSearch = findImplementationFileFromDtsFileName(candidate.fileName, file, noDtsProject); + if (!fileNameToSearch) + continue; + const info2 = this.projectService.getOrCreateScriptInfoNotOpenedByClient( + fileNameToSearch, + noDtsProject.currentDirectory, + noDtsProject.directoryStructureHost + ); + if (!info2) + continue; + if (!noDtsProject.containsScriptInfo(info2)) { + noDtsProject.addRoot(info2); + noDtsProject.updateGraph(); + } + const noDtsProgram = ls.getProgram(); + const fileToSearch = Debug.checkDefined(noDtsProgram.getSourceFile(fileNameToSearch)); + for (const match of searchForDeclaration(candidate.name, fileToSearch, noDtsProgram)) { + definitionSet.add(match); + } + } + } + definitions = arrayFrom(definitionSet.values()); + } + definitions = definitions.filter((d7) => !d7.isAmbient && !d7.failedAliasResolution); + return this.mapDefinitionInfo(definitions, project); + function findImplementationFileFromDtsFileName(fileName, resolveFromFile, auxiliaryProject) { + var _a22, _b, _c; + const nodeModulesPathParts = getNodeModulePathParts(fileName); + if (nodeModulesPathParts && fileName.lastIndexOf(nodeModulesPathPart) === nodeModulesPathParts.topLevelNodeModulesIndex) { + const packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex); + const packageJsonCache = (_a22 = project.getModuleResolutionCache()) == null ? void 0 : _a22.getPackageJsonInfoCache(); + const compilerOptions = project.getCompilationSettings(); + const packageJson = getPackageScopeForPath(getNormalizedAbsolutePath(packageDirectory + "/package.json", project.getCurrentDirectory()), getTemporaryModuleResolutionState(packageJsonCache, project, compilerOptions)); + if (!packageJson) + return void 0; + const entrypoints = getEntrypointsFromPackageJsonInfo( + packageJson, + { + moduleResolution: 2 + /* Node10 */ + }, + project, + project.getModuleResolutionCache() + ); + const packageNamePathPart = fileName.substring( + nodeModulesPathParts.topLevelPackageNameIndex + 1, + nodeModulesPathParts.packageRootIndex + ); + const packageName = getPackageNameFromTypesPackageName(unmangleScopedPackageName(packageNamePathPart)); + const path2 = project.toPath(fileName); + if (entrypoints && some2(entrypoints, (e10) => project.toPath(e10) === path2)) { + return (_b = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(packageName, resolveFromFile).resolvedModule) == null ? void 0 : _b.resolvedFileName; + } else { + const pathToFileInPackage = fileName.substring(nodeModulesPathParts.packageRootIndex + 1); + const specifier = `${packageName}/${removeFileExtension(pathToFileInPackage)}`; + return (_c = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(specifier, resolveFromFile).resolvedModule) == null ? void 0 : _c.resolvedFileName; + } + } + return void 0; + } + function getAmbientCandidatesByClimbingAccessChain() { + const ls = project.getLanguageService(); + const program = ls.getProgram(); + const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); + if ((isStringLiteralLike(initialNode) || isIdentifier(initialNode)) && isAccessExpression(initialNode.parent)) { + return forEachNameInAccessChainWalkingLeft(initialNode, (nameInChain) => { + var _a22; + if (nameInChain === initialNode) + return void 0; + const candidates = (_a22 = ls.getDefinitionAtPosition( + file, + nameInChain.getStart(), + /*searchOtherFilesOnly*/ + true, + /*stopAtAlias*/ + false + )) == null ? void 0 : _a22.filter((d7) => toNormalizedPath(d7.fileName) !== file && d7.isAmbient).map((d7) => ({ + fileName: d7.fileName, + name: getTextOfIdentifierOrLiteral(initialNode) + })); + if (some2(candidates)) { + return candidates; + } + }) || emptyArray2; + } + return emptyArray2; + } + function tryRefineDefinition(definition, program, noDtsProgram) { + var _a22; + const fileToSearch = noDtsProgram.getSourceFile(definition.fileName); + if (!fileToSearch) { + return void 0; + } + const initialNode = getTouchingPropertyName(program.getSourceFile(file), position); + const symbol = program.getTypeChecker().getSymbolAtLocation(initialNode); + const importSpecifier = symbol && getDeclarationOfKind( + symbol, + 276 + /* ImportSpecifier */ + ); + if (!importSpecifier) + return void 0; + const nameToSearch = ((_a22 = importSpecifier.propertyName) == null ? void 0 : _a22.text) || importSpecifier.name.text; + return searchForDeclaration(nameToSearch, fileToSearch, noDtsProgram); + } + function searchForDeclaration(declarationName, fileToSearch, noDtsProgram) { + const matches2 = ts_FindAllReferences_exports.Core.getTopMostDeclarationNamesInFile(declarationName, fileToSearch); + return mapDefined(matches2, (match) => { + const symbol = noDtsProgram.getTypeChecker().getSymbolAtLocation(match); + const decl = getDeclarationFromName(match); + if (symbol && decl) { + return ts_GoToDefinition_exports.createDefinitionInfo( + decl, + noDtsProgram.getTypeChecker(), + symbol, + decl, + /*unverified*/ + true + ); + } + }); + } + } + getEmitOutput(args) { + const { file, project } = this.getFileAndProject(args); + if (!project.shouldEmitFile(project.getScriptInfo(file))) { + return { emitSkipped: true, outputFiles: [], diagnostics: [] }; + } + const result2 = project.getLanguageService().getEmitOutput(file); + return args.richResponse ? { + ...result2, + diagnostics: args.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(result2.diagnostics) : result2.diagnostics.map((d7) => formatDiagnosticToProtocol( + d7, + /*includeFileName*/ + true + )) + } : result2; + } + mapJSDocTagInfo(tags6, project, richResponse) { + return tags6 ? tags6.map((tag) => { + var _a2; + return { + ...tag, + text: richResponse ? this.mapDisplayParts(tag.text, project) : (_a2 = tag.text) == null ? void 0 : _a2.map((part) => part.text).join("") + }; + }) : []; + } + mapDisplayParts(parts, project) { + if (!parts) { + return []; + } + return parts.map( + (part) => part.kind !== "linkName" ? part : { + ...part, + target: this.toFileSpan(part.target.fileName, part.target.textSpan, project) + } + ); + } + mapSignatureHelpItems(items, project, richResponse) { + return items.map((item) => ({ + ...item, + documentation: this.mapDisplayParts(item.documentation, project), + parameters: item.parameters.map((p7) => ({ ...p7, documentation: this.mapDisplayParts(p7.documentation, project) })), + tags: this.mapJSDocTagInfo(item.tags, project, richResponse) + })); + } + mapDefinitionInfo(definitions, project) { + return definitions.map((def) => ({ ...this.toFileSpanWithContext(def.fileName, def.textSpan, def.contextSpan, project), ...def.unverified && { unverified: def.unverified } })); + } + /* + * When we map a .d.ts location to .ts, Visual Studio gets confused because there's no associated Roslyn Document in + * the same project which corresponds to the file. VS Code has no problem with this, and luckily we have two protocols. + * This retains the existing behavior for the "simplified" (VS Code) protocol but stores the .d.ts location in a + * set of additional fields, and does the reverse for VS (store the .d.ts location where + * it used to be and stores the .ts location in the additional fields). + */ + static mapToOriginalLocation(def) { + if (def.originalFileName) { + Debug.assert(def.originalTextSpan !== void 0, "originalTextSpan should be present if originalFileName is"); + return { + ...def, + fileName: def.originalFileName, + textSpan: def.originalTextSpan, + targetFileName: def.fileName, + targetTextSpan: def.textSpan, + contextSpan: def.originalContextSpan, + targetContextSpan: def.contextSpan + }; + } + return def; + } + toFileSpan(fileName, textSpan, project) { + const ls = project.getLanguageService(); + const start = ls.toLineColumnOffset(fileName, textSpan.start); + const end = ls.toLineColumnOffset(fileName, textSpanEnd(textSpan)); + return { + file: fileName, + start: { line: start.line + 1, offset: start.character + 1 }, + end: { line: end.line + 1, offset: end.character + 1 } + }; + } + toFileSpanWithContext(fileName, textSpan, contextSpan, project) { + const fileSpan = this.toFileSpan(fileName, textSpan, project); + const context2 = contextSpan && this.toFileSpan(fileName, contextSpan, project); + return context2 ? { ...fileSpan, contextStart: context2.start, contextEnd: context2.end } : fileSpan; + } + getTypeDefinition(args) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getTypeDefinitionAtPosition(file, position) || emptyArray2, project); + return this.mapDefinitionInfo(definitions, project); + } + mapImplementationLocations(implementations, project) { + return implementations.map((info2) => { + const newDocumentSpan = getMappedDocumentSpanForProject(info2, project); + return !newDocumentSpan ? info2 : { + ...newDocumentSpan, + kind: info2.kind, + displayParts: info2.displayParts + }; + }); + } + getImplementation(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const implementations = this.mapImplementationLocations(project.getLanguageService().getImplementationAtPosition(file, position) || emptyArray2, project); + return simplifiedResult ? implementations.map(({ fileName, textSpan, contextSpan }) => this.toFileSpanWithContext(fileName, textSpan, contextSpan, project)) : implementations.map(_Session.mapToOriginalLocation); + } + getSyntacticDiagnosticsSync(args) { + const { configFile } = this.getConfigFileAndProject(args); + if (configFile) { + return emptyArray2; + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + false, + (project, file) => project.getLanguageService().getSyntacticDiagnostics(file), + !!args.includeLinePosition + ); + } + getSemanticDiagnosticsSync(args) { + const { configFile, project } = this.getConfigFileAndProject(args); + if (configFile) { + return this.getConfigFileDiagnostics(configFile, project, !!args.includeLinePosition); + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + true, + (project2, file) => project2.getLanguageService().getSemanticDiagnostics(file).filter((d7) => !!d7.file), + !!args.includeLinePosition + ); + } + getSuggestionDiagnosticsSync(args) { + const { configFile } = this.getConfigFileAndProject(args); + if (configFile) { + return emptyArray2; + } + return this.getDiagnosticsWorker( + args, + /*isSemantic*/ + true, + (project, file) => project.getLanguageService().getSuggestionDiagnostics(file), + !!args.includeLinePosition + ); + } + getJsxClosingTag(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const tag = languageService.getJsxClosingTagAtPosition(file, position); + return tag === void 0 ? void 0 : { newText: tag.newText, caretOffset: 0 }; + } + getLinkedEditingRange(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const linkedEditInfo = languageService.getLinkedEditingRangeAtPosition(file, position); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + if (scriptInfo === void 0 || linkedEditInfo === void 0) + return void 0; + return convertLinkedEditInfoToRanges(linkedEditInfo, scriptInfo); + } + getDocumentHighlights(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const documentHighlights = project.getLanguageService().getDocumentHighlights(file, position, args.filesToSearch); + if (!documentHighlights) + return emptyArray2; + if (!simplifiedResult) + return documentHighlights; + return documentHighlights.map(({ fileName, highlightSpans }) => { + const scriptInfo = project.getScriptInfo(fileName); + return { + file: fileName, + highlightSpans: highlightSpans.map(({ textSpan, kind, contextSpan }) => ({ + ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), + kind + })) + }; + }); + } + provideInlayHints(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file)); + return hints.map((hint) => { + const { position, displayParts } = hint; + return { + ...hint, + position: scriptInfo.positionToLineOffset(position), + displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => { + if (span) { + Debug.assertIsDefined(file2, "Target file should be defined together with its span."); + const scriptInfo2 = this.projectService.getScriptInfo(file2); + return { + text, + span: { + start: scriptInfo2.positionToLineOffset(span.start), + end: scriptInfo2.positionToLineOffset(span.start + span.length), + file: file2 + } + }; + } else { + return { text }; + } + }) + }; + }); + } + setCompilerOptionsForInferredProjects(args) { + this.projectService.setCompilerOptionsForInferredProjects(args.options, args.projectRootPath); + } + getProjectInfo(args) { + return this.getProjectInfoWorker( + args.file, + args.projectFileName, + args.needFileNameList, + /*excludeConfigFiles*/ + false + ); + } + getProjectInfoWorker(uncheckedFileName, projectFileName, needFileNameList, excludeConfigFiles) { + const { project } = this.getFileAndProjectWorker(uncheckedFileName, projectFileName); + updateProjectIfDirty(project); + const projectInfo = { + configFileName: project.getProjectName(), + languageServiceDisabled: !project.languageServiceEnabled, + fileNames: needFileNameList ? project.getFileNames( + /*excludeFilesFromExternalLibraries*/ + false, + excludeConfigFiles + ) : void 0 + }; + return projectInfo; + } + getRenameInfo(args) { + const { file, project } = this.getFileAndProject(args); + const position = this.getPositionInFile(args, file); + const preferences = this.getPreferences(file); + return project.getLanguageService().getRenameInfo(file, position, preferences); + } + getProjects(args, getScriptInfoEnsuringProjectsUptoDate, ignoreNoProjectError) { + let projects; + let symLinkedProjects; + if (args.projectFileName) { + const project = this.getProject(args.projectFileName); + if (project) { + projects = [project]; + } + } else { + const scriptInfo = getScriptInfoEnsuringProjectsUptoDate ? this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file) : this.projectService.getScriptInfo(args.file); + if (!scriptInfo) { + if (ignoreNoProjectError) + return emptyArray2; + this.projectService.logErrorForScriptInfoNotFound(args.file); + return Errors.ThrowNoProject(); + } else if (!getScriptInfoEnsuringProjectsUptoDate) { + this.projectService.ensureDefaultProjectForFile(scriptInfo); + } + projects = scriptInfo.containingProjects; + symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo); + } + projects = filter2(projects, (p7) => p7.languageServiceEnabled && !p7.isOrphan()); + if (!ignoreNoProjectError && (!projects || !projects.length) && !symLinkedProjects) { + this.projectService.logErrorForScriptInfoNotFound(args.file ?? args.projectFileName); + return Errors.ThrowNoProject(); + } + return symLinkedProjects ? { projects, symLinkedProjects } : projects; + } + getDefaultProject(args) { + if (args.projectFileName) { + const project = this.getProject(args.projectFileName); + if (project) { + return project; + } + if (!args.file) { + return Errors.ThrowNoProject(); + } + } + const info2 = this.projectService.getScriptInfo(args.file); + return info2.getDefaultProject(); + } + getRenameLocations(args, simplifiedResult) { + const file = toNormalizedPath(args.file); + const position = this.getPositionInFile(args, file); + const projects = this.getProjects(args); + const defaultProject = this.getDefaultProject(args); + const preferences = this.getPreferences(file); + const renameInfo = this.mapRenameInfo( + defaultProject.getLanguageService().getRenameInfo(file, position, preferences), + Debug.checkDefined(this.projectService.getScriptInfo(file)) + ); + if (!renameInfo.canRename) + return simplifiedResult ? { info: renameInfo, locs: [] } : []; + const locations = getRenameLocationsWorker( + projects, + defaultProject, + { fileName: args.file, pos: position }, + !!args.findInStrings, + !!args.findInComments, + preferences, + this.host.useCaseSensitiveFileNames + ); + if (!simplifiedResult) + return locations; + return { info: renameInfo, locs: this.toSpanGroups(locations) }; + } + mapRenameInfo(info2, scriptInfo) { + if (info2.canRename) { + const { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan } = info2; + return identity2( + { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: toProtocolTextSpan(triggerSpan, scriptInfo) } + ); + } else { + return info2; + } + } + toSpanGroups(locations) { + const map22 = /* @__PURE__ */ new Map(); + for (const { fileName, textSpan, contextSpan, originalContextSpan: _22, originalTextSpan: _6, originalFileName: _1, ...prefixSuffixText } of locations) { + let group22 = map22.get(fileName); + if (!group22) + map22.set(fileName, group22 = { file: fileName, locs: [] }); + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(fileName)); + group22.locs.push({ ...toProtocolTextSpanWithContext(textSpan, contextSpan, scriptInfo), ...prefixSuffixText }); + } + return arrayFrom(map22.values()); + } + getReferences(args, simplifiedResult) { + const file = toNormalizedPath(args.file); + const projects = this.getProjects(args); + const position = this.getPositionInFile(args, file); + const references = getReferencesWorker( + projects, + this.getDefaultProject(args), + { fileName: args.file, pos: position }, + this.host.useCaseSensitiveFileNames, + this.logger + ); + if (!simplifiedResult) + return references; + const preferences = this.getPreferences(file); + const defaultProject = this.getDefaultProject(args); + const scriptInfo = defaultProject.getScriptInfoForNormalizedPath(file); + const nameInfo = defaultProject.getLanguageService().getQuickInfoAtPosition(file, position); + const symbolDisplayString = nameInfo ? displayPartsToString(nameInfo.displayParts) : ""; + const nameSpan = nameInfo && nameInfo.textSpan; + const symbolStartOffset = nameSpan ? scriptInfo.positionToLineOffset(nameSpan.start).offset : 0; + const symbolName2 = nameSpan ? scriptInfo.getSnapshot().getText(nameSpan.start, textSpanEnd(nameSpan)) : ""; + const refs = flatMap2(references, (referencedSymbol) => { + return referencedSymbol.references.map((entry) => referenceEntryToReferencesResponseItem(this.projectService, entry, preferences)); + }); + return { refs, symbolName: symbolName2, symbolStartOffset, symbolDisplayString }; + } + getFileReferences(args, simplifiedResult) { + const projects = this.getProjects(args); + const fileName = args.file; + const preferences = this.getPreferences(toNormalizedPath(fileName)); + const references = []; + const seen = createDocumentSpanSet(this.host.useCaseSensitiveFileNames); + forEachProjectInProjects( + projects, + /*path*/ + void 0, + (project) => { + if (project.getCancellationToken().isCancellationRequested()) + return; + const projectOutputs = project.getLanguageService().getFileReferences(fileName); + if (projectOutputs) { + for (const referenceEntry of projectOutputs) { + if (!seen.has(referenceEntry)) { + references.push(referenceEntry); + seen.add(referenceEntry); + } + } + } + } + ); + if (!simplifiedResult) + return references; + const refs = references.map((entry) => referenceEntryToReferencesResponseItem(this.projectService, entry, preferences)); + return { + refs, + symbolName: `"${args.file}"` + }; + } + /** + * @param fileName is the name of the file to be opened + * @param fileContent is a version of the file content that is known to be more up to date than the one on disk + */ + openClientFile(fileName, fileContent, scriptKind, projectRootPath) { + this.projectService.openClientFileWithNormalizedPath( + fileName, + fileContent, + scriptKind, + /*hasMixedContent*/ + false, + projectRootPath + ); + } + getPosition(args, scriptInfo) { + return args.position !== void 0 ? args.position : scriptInfo.lineOffsetToPosition(args.line, args.offset); + } + getPositionInFile(args, file) { + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + return this.getPosition(args, scriptInfo); + } + getFileAndProject(args) { + return this.getFileAndProjectWorker(args.file, args.projectFileName); + } + getFileAndLanguageServiceForSyntacticOperation(args) { + const { file, project } = this.getFileAndProject(args); + return { + file, + languageService: project.getLanguageService( + /*ensureSynchronized*/ + false + ) + }; + } + getFileAndProjectWorker(uncheckedFileName, projectFileName) { + const file = toNormalizedPath(uncheckedFileName); + const project = this.getProject(projectFileName) || this.projectService.ensureDefaultProjectForFile(file); + return { file, project }; + } + getOutliningSpans(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const spans = languageService.getOutliningSpans(file); + if (simplifiedResult) { + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + return spans.map((s7) => ({ + textSpan: toProtocolTextSpan(s7.textSpan, scriptInfo), + hintSpan: toProtocolTextSpan(s7.hintSpan, scriptInfo), + bannerText: s7.bannerText, + autoCollapse: s7.autoCollapse, + kind: s7.kind + })); + } else { + return spans; + } + } + getTodoComments(args) { + const { file, project } = this.getFileAndProject(args); + return project.getLanguageService().getTodoComments(file, args.descriptors); + } + getDocCommentTemplate(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file)); + } + getSpanOfEnclosingComment(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const onlyMultiLine = args.onlyMultiLine; + const position = this.getPositionInFile(args, file); + return languageService.getSpanOfEnclosingComment(file, position, onlyMultiLine); + } + getIndentation(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + const indentation = languageService.getIndentationAtPosition(file, position, options); + return { position, indentation }; + } + getBreakpointStatement(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getBreakpointStatementAtPosition(file, position); + } + getNameOrDottedNameSpan(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.getNameOrDottedNameSpan(file, position, position); + } + isValidBraceCompletion(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const position = this.getPositionInFile(args, file); + return languageService.isValidBraceCompletionAtPosition(file, position, args.openingBrace.charCodeAt(0)); + } + getQuickInfoWorker(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const quickInfo = project.getLanguageService().getQuickInfoAtPosition(file, this.getPosition(args, scriptInfo)); + if (!quickInfo) { + return void 0; + } + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + if (simplifiedResult) { + const displayString = displayPartsToString(quickInfo.displayParts); + return { + kind: quickInfo.kind, + kindModifiers: quickInfo.kindModifiers, + start: scriptInfo.positionToLineOffset(quickInfo.textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(quickInfo.textSpan)), + displayString, + documentation: useDisplayParts ? this.mapDisplayParts(quickInfo.documentation, project) : displayPartsToString(quickInfo.documentation), + tags: this.mapJSDocTagInfo(quickInfo.tags, project, useDisplayParts) + }; + } else { + return useDisplayParts ? quickInfo : { + ...quickInfo, + tags: this.mapJSDocTagInfo( + quickInfo.tags, + project, + /*richResponse*/ + false + ) + }; + } + } + getFormattingEditsForRange(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const startPosition = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + const edits = languageService.getFormattingEditsForRange(file, startPosition, endPosition, this.getFormatOptions(file)); + if (!edits) { + return void 0; + } + return edits.map((edit) => this.convertTextChangeToCodeEdit(edit, scriptInfo)); + } + getFormattingEditsForRangeFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsForRange(file, args.position, args.endPosition, options); + } + getFormattingEditsForDocumentFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsForDocument(file, options); + } + getFormattingEditsAfterKeystrokeFull(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const options = args.options ? convertFormatOptions(args.options) : this.getFormatOptions(file); + return languageService.getFormattingEditsAfterKeystroke(file, args.position, args.key, options); + } + getFormattingEditsAfterKeystroke(args) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const formatOptions = this.getFormatOptions(file); + const edits = languageService.getFormattingEditsAfterKeystroke(file, position, args.key, formatOptions); + if (args.key === "\n" && (!edits || edits.length === 0 || allEditsBeforePos(edits, position))) { + const { lineText, absolutePosition } = scriptInfo.textStorage.getAbsolutePositionAndLineText(args.line); + if (lineText && lineText.search("\\S") < 0) { + const preferredIndent = languageService.getIndentationAtPosition(file, position, formatOptions); + let hasIndent = 0; + let i7, len; + for (i7 = 0, len = lineText.length; i7 < len; i7++) { + if (lineText.charAt(i7) === " ") { + hasIndent++; + } else if (lineText.charAt(i7) === " ") { + hasIndent += formatOptions.tabSize; + } else { + break; + } + } + if (preferredIndent !== hasIndent) { + const firstNoWhiteSpacePosition = absolutePosition + i7; + edits.push({ + span: createTextSpanFromBounds(absolutePosition, firstNoWhiteSpacePosition), + newText: ts_formatting_exports.getIndentationString(preferredIndent, formatOptions) + }); + } + } + } + if (!edits) { + return void 0; + } + return edits.map((edit) => { + return { + start: scriptInfo.positionToLineOffset(edit.span.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(edit.span)), + newText: edit.newText ? edit.newText : "" + }; + }); + } + getCompletions(args, kind) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const completions = project.getLanguageService().getCompletionsAtPosition( + file, + position, + { + ...convertUserPreferences(this.getPreferences(file)), + triggerCharacter: args.triggerCharacter, + triggerKind: args.triggerKind, + includeExternalModuleExports: args.includeExternalModuleExports, + includeInsertTextCompletions: args.includeInsertTextCompletions + }, + project.projectService.getFormatCodeOptions(file) + ); + if (completions === void 0) + return void 0; + if (kind === "completions-full") + return completions; + const prefix = args.prefix || ""; + const entries = mapDefined(completions.entries, (entry) => { + if (completions.isMemberCompletion || startsWith2(entry.name.toLowerCase(), prefix.toLowerCase())) { + const { + name: name2, + kind: kind2, + kindModifiers, + sortText, + insertText, + filterText, + replacementSpan, + hasAction, + source, + sourceDisplay, + labelDetails, + isSnippet, + isRecommended, + isPackageJsonImport, + isImportStatementCompletion, + data + } = entry; + const convertedSpan = replacementSpan ? toProtocolTextSpan(replacementSpan, scriptInfo) : void 0; + return { + name: name2, + kind: kind2, + kindModifiers, + sortText, + insertText, + filterText, + replacementSpan: convertedSpan, + isSnippet, + hasAction: hasAction || void 0, + source, + sourceDisplay, + labelDetails, + isRecommended, + isPackageJsonImport, + isImportStatementCompletion, + data + }; + } + }); + if (kind === "completions") { + if (completions.metadata) + entries.metadata = completions.metadata; + return entries; + } + const res = { + ...completions, + optionalReplacementSpan: completions.optionalReplacementSpan && toProtocolTextSpan(completions.optionalReplacementSpan, scriptInfo), + entries + }; + return res; + } + getCompletionEntryDetails(args, fullResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const formattingOptions = project.projectService.getFormatCodeOptions(file); + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + const result2 = mapDefined(args.entryNames, (entryName) => { + const { name: name2, source, data } = typeof entryName === "string" ? { name: entryName, source: void 0, data: void 0 } : entryName; + return project.getLanguageService().getCompletionEntryDetails(file, position, name2, formattingOptions, source, this.getPreferences(file), data ? cast(data, isCompletionEntryData) : void 0); + }); + return fullResult ? useDisplayParts ? result2 : result2.map((details) => ({ ...details, tags: this.mapJSDocTagInfo( + details.tags, + project, + /*richResponse*/ + false + ) })) : result2.map((details) => ({ + ...details, + codeActions: map4(details.codeActions, (action) => this.mapCodeAction(action)), + documentation: this.mapDisplayParts(details.documentation, project), + tags: this.mapJSDocTagInfo(details.tags, project, useDisplayParts) + })); + } + getCompileOnSaveAffectedFileList(args) { + const projects = this.getProjects( + args, + /*getScriptInfoEnsuringProjectsUptoDate*/ + true, + /*ignoreNoProjectError*/ + true + ); + const info2 = this.projectService.getScriptInfo(args.file); + if (!info2) { + return emptyArray2; + } + return combineProjectOutput( + info2, + (path2) => this.projectService.getScriptInfoForPath(path2), + projects, + (project, info22) => { + if (!project.compileOnSaveEnabled || !project.languageServiceEnabled || project.isOrphan()) { + return void 0; + } + const compilationSettings = project.getCompilationSettings(); + if (!!compilationSettings.noEmit || isDeclarationFileName(info22.fileName) && !dtsChangeCanAffectEmit(compilationSettings)) { + return void 0; + } + return { + projectFileName: project.getProjectName(), + fileNames: project.getCompileOnSaveAffectedFileList(info22), + projectUsesOutFile: !!outFile(compilationSettings) + }; + } + ); + } + emitFile(args) { + const { file, project } = this.getFileAndProject(args); + if (!project) { + Errors.ThrowNoProject(); + } + if (!project.languageServiceEnabled) { + return args.richResponse ? { emitSkipped: true, diagnostics: [] } : false; + } + const scriptInfo = project.getScriptInfo(file); + const { emitSkipped, diagnostics } = project.emitFile(scriptInfo, (path2, data, writeByteOrderMark) => this.host.writeFile(path2, data, writeByteOrderMark)); + return args.richResponse ? { + emitSkipped, + diagnostics: args.includeLinePosition ? this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(diagnostics) : diagnostics.map((d7) => formatDiagnosticToProtocol( + d7, + /*includeFileName*/ + true + )) + } : !emitSkipped; + } + getSignatureHelpItems(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const helpItems = project.getLanguageService().getSignatureHelpItems(file, position, args); + const useDisplayParts = !!this.getPreferences(file).displayPartsForJSDoc; + if (helpItems && simplifiedResult) { + const span = helpItems.applicableSpan; + return { + ...helpItems, + applicableSpan: { + start: scriptInfo.positionToLineOffset(span.start), + end: scriptInfo.positionToLineOffset(span.start + span.length) + }, + items: this.mapSignatureHelpItems(helpItems.items, project, useDisplayParts) + }; + } else if (useDisplayParts || !helpItems) { + return helpItems; + } else { + return { + ...helpItems, + items: helpItems.items.map((item) => ({ ...item, tags: this.mapJSDocTagInfo( + item.tags, + project, + /*richResponse*/ + false + ) })) + }; + } + } + toPendingErrorCheck(uncheckedFileName) { + const fileName = toNormalizedPath(uncheckedFileName); + const project = this.projectService.tryGetDefaultProjectForFile(fileName); + return project && { fileName, project }; + } + getDiagnostics(next, delay2, fileNames) { + if (this.suppressDiagnosticEvents) { + return; + } + if (fileNames.length > 0) { + this.updateErrorCheck(next, fileNames, delay2); + } + } + change(args) { + const scriptInfo = this.projectService.getScriptInfo(args.file); + Debug.assert(!!scriptInfo); + scriptInfo.textStorage.switchToScriptVersionCache(); + const start = scriptInfo.lineOffsetToPosition(args.line, args.offset); + const end = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + if (start >= 0) { + this.changeSeq++; + this.projectService.applyChangesToFile( + scriptInfo, + singleIterator({ + span: { start, length: end - start }, + newText: args.insertString + // TODO: GH#18217 + }) + ); + } + } + reload(args, reqSeq) { + const file = toNormalizedPath(args.file); + const tempFileName = args.tmpfile === void 0 ? void 0 : toNormalizedPath(args.tmpfile); + const info2 = this.projectService.getScriptInfoForNormalizedPath(file); + if (info2) { + this.changeSeq++; + if (info2.reloadFromFile(tempFileName)) { + this.doOutput( + /*info*/ + void 0, + "reload", + reqSeq, + /*success*/ + true + ); + } + } + } + saveToTmp(fileName, tempFileName) { + const scriptInfo = this.projectService.getScriptInfo(fileName); + if (scriptInfo) { + scriptInfo.saveTo(tempFileName); + } + } + closeClientFile(fileName) { + if (!fileName) { + return; + } + const file = normalizePath(fileName); + this.projectService.closeClientFile(file); + } + mapLocationNavigationBarItems(items, scriptInfo) { + return map4(items, (item) => ({ + text: item.text, + kind: item.kind, + kindModifiers: item.kindModifiers, + spans: item.spans.map((span) => toProtocolTextSpan(span, scriptInfo)), + childItems: this.mapLocationNavigationBarItems(item.childItems, scriptInfo), + indent: item.indent + })); + } + getNavigationBarItems(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const items = languageService.getNavigationBarItems(file); + return !items ? void 0 : simplifiedResult ? this.mapLocationNavigationBarItems(items, this.projectService.getScriptInfoForNormalizedPath(file)) : items; + } + toLocationNavigationTree(tree, scriptInfo) { + return { + text: tree.text, + kind: tree.kind, + kindModifiers: tree.kindModifiers, + spans: tree.spans.map((span) => toProtocolTextSpan(span, scriptInfo)), + nameSpan: tree.nameSpan && toProtocolTextSpan(tree.nameSpan, scriptInfo), + childItems: map4(tree.childItems, (item) => this.toLocationNavigationTree(item, scriptInfo)) + }; + } + getNavigationTree(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const tree = languageService.getNavigationTree(file); + return !tree ? void 0 : simplifiedResult ? this.toLocationNavigationTree(tree, this.projectService.getScriptInfoForNormalizedPath(file)) : tree; + } + getNavigateToItems(args, simplifiedResult) { + const full = this.getFullNavigateToItems(args); + return !simplifiedResult ? flatMap2(full, ({ navigateToItems }) => navigateToItems) : flatMap2( + full, + ({ project, navigateToItems }) => navigateToItems.map((navItem) => { + const scriptInfo = project.getScriptInfo(navItem.fileName); + const bakedItem = { + name: navItem.name, + kind: navItem.kind, + kindModifiers: navItem.kindModifiers, + isCaseSensitive: navItem.isCaseSensitive, + matchKind: navItem.matchKind, + file: navItem.fileName, + start: scriptInfo.positionToLineOffset(navItem.textSpan.start), + end: scriptInfo.positionToLineOffset(textSpanEnd(navItem.textSpan)) + }; + if (navItem.kindModifiers && navItem.kindModifiers !== "") { + bakedItem.kindModifiers = navItem.kindModifiers; + } + if (navItem.containerName && navItem.containerName.length > 0) { + bakedItem.containerName = navItem.containerName; + } + if (navItem.containerKind && navItem.containerKind.length > 0) { + bakedItem.containerKind = navItem.containerKind; + } + return bakedItem; + }) + ); + } + getFullNavigateToItems(args) { + const { currentFileOnly, searchValue, maxResultCount, projectFileName } = args; + if (currentFileOnly) { + Debug.assertIsDefined(args.file); + const { file, project } = this.getFileAndProject(args); + return [{ project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }]; + } + const preferences = this.getHostPreferences(); + const outputs = []; + const seenItems = /* @__PURE__ */ new Map(); + if (!args.file && !projectFileName) { + this.projectService.loadAncestorProjectTree(); + this.projectService.forEachEnabledProject((project) => addItemsForProject(project)); + } else { + const projects = this.getProjects(args); + forEachProjectInProjects( + projects, + /*path*/ + void 0, + (project) => addItemsForProject(project) + ); + } + return outputs; + function addItemsForProject(project) { + const projectItems = project.getLanguageService().getNavigateToItems( + searchValue, + maxResultCount, + /*fileName*/ + void 0, + /*excludeDts*/ + project.isNonTsProject(), + /*excludeLibFiles*/ + preferences.excludeLibrarySymbolsInNavTo + ); + const unseenItems = filter2(projectItems, (item) => tryAddSeenItem(item) && !getMappedLocationForProject(documentSpanLocation(item), project)); + if (unseenItems.length) { + outputs.push({ project, navigateToItems: unseenItems }); + } + } + function tryAddSeenItem(item) { + const name2 = item.name; + if (!seenItems.has(name2)) { + seenItems.set(name2, [item]); + return true; + } + const seen = seenItems.get(name2); + for (const seenItem of seen) { + if (navigateToItemIsEqualTo(seenItem, item)) { + return false; + } + } + seen.push(item); + return true; + } + function navigateToItemIsEqualTo(a7, b8) { + if (a7 === b8) { + return true; + } + if (!a7 || !b8) { + return false; + } + return a7.containerKind === b8.containerKind && a7.containerName === b8.containerName && a7.fileName === b8.fileName && a7.isCaseSensitive === b8.isCaseSensitive && a7.kind === b8.kind && a7.kindModifiers === b8.kindModifiers && a7.matchKind === b8.matchKind && a7.name === b8.name && a7.textSpan.start === b8.textSpan.start && a7.textSpan.length === b8.textSpan.length; + } + } + getSupportedCodeFixes(args) { + if (!args) + return getSupportedCodeFixes(); + if (args.file) { + const { file, project: project2 } = this.getFileAndProject(args); + return project2.getLanguageService().getSupportedCodeFixes(file); + } + const project = this.getProject(args.projectFileName); + if (!project) + Errors.ThrowNoProject(); + return project.getLanguageService().getSupportedCodeFixes(); + } + isLocation(locationOrSpan) { + return locationOrSpan.line !== void 0; + } + extractPositionOrRange(args, scriptInfo) { + let position; + let textRange; + if (this.isLocation(args)) { + position = getPosition(args); + } else { + textRange = this.getRange(args, scriptInfo); + } + return Debug.checkDefined(position === void 0 ? textRange : position); + function getPosition(loc) { + return loc.position !== void 0 ? loc.position : scriptInfo.lineOffsetToPosition(loc.line, loc.offset); + } + } + getRange(args, scriptInfo) { + const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo); + return { pos: startPosition, end: endPosition }; + } + getApplicableRefactors(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return project.getLanguageService().getApplicableRefactors(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file), args.triggerReason, args.kind, args.includeInteractiveActions); + } + getEditsForRefactor(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const result2 = project.getLanguageService().getEditsForRefactor( + file, + this.getFormatOptions(file), + this.extractPositionOrRange(args, scriptInfo), + args.refactor, + args.action, + this.getPreferences(file), + args.interactiveRefactorArguments + ); + if (result2 === void 0) { + return { + edits: [] + }; + } + if (simplifiedResult) { + const { renameFilename, renameLocation, edits } = result2; + let mappedRenameLocation; + if (renameFilename !== void 0 && renameLocation !== void 0) { + const renameScriptInfo = project.getScriptInfoForNormalizedPath(toNormalizedPath(renameFilename)); + mappedRenameLocation = getLocationInNewDocument(getSnapshotText(renameScriptInfo.getSnapshot()), renameFilename, renameLocation, edits); + } + return { + renameLocation: mappedRenameLocation, + renameFilename, + edits: this.mapTextChangesToCodeEdits(edits), + notApplicableReason: result2.notApplicableReason + }; + } + return result2; + } + getMoveToRefactoringFileSuggestions(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + return project.getLanguageService().getMoveToRefactoringFileSuggestions(file, this.extractPositionOrRange(args, scriptInfo), this.getPreferences(file)); + } + organizeImports(args, simplifiedResult) { + Debug.assert(args.scope.type === "file"); + const { file, project } = this.getFileAndProject(args.scope.args); + const changes = project.getLanguageService().organizeImports( + { + fileName: file, + mode: args.mode ?? (args.skipDestructiveCodeActions ? "SortAndCombine" : void 0), + type: "file" + }, + this.getFormatOptions(file), + this.getPreferences(file) + ); + if (simplifiedResult) { + return this.mapTextChangesToCodeEdits(changes); + } else { + return changes; + } + } + getEditsForFileRename(args, simplifiedResult) { + const oldPath = toNormalizedPath(args.oldFilePath); + const newPath = toNormalizedPath(args.newFilePath); + const formatOptions = this.getHostFormatOptions(); + const preferences = this.getHostPreferences(); + const seenFiles = /* @__PURE__ */ new Set(); + const textChanges2 = []; + this.projectService.loadAncestorProjectTree(); + this.projectService.forEachEnabledProject((project) => { + const projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences); + const projectFiles = []; + for (const textChange of projectTextChanges) { + if (!seenFiles.has(textChange.fileName)) { + textChanges2.push(textChange); + projectFiles.push(textChange.fileName); + } + } + for (const file of projectFiles) { + seenFiles.add(file); + } + }); + return simplifiedResult ? textChanges2.map((c7) => this.mapTextChangeToCodeEdit(c7)) : textChanges2; + } + getCodeFixes(args, simplifiedResult) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + const { startPosition, endPosition } = this.getStartAndEndPosition(args, scriptInfo); + let codeActions; + try { + codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file)); + } catch (e10) { + const ls = project.getLanguageService(); + const existingDiagCodes = [ + ...ls.getSyntacticDiagnostics(file), + ...ls.getSemanticDiagnostics(file), + ...ls.getSuggestionDiagnostics(file) + ].map( + (d7) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d7.start, d7.length) && d7.code + ); + const badCode = args.errorCodes.find((c7) => !existingDiagCodes.includes(c7)); + if (badCode !== void 0) { + e10.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error: +${e10.message}`; + } + throw e10; + } + return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions; + } + getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) { + Debug.assert(scope.type === "file"); + const { file, project } = this.getFileAndProject(scope.args); + const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file)); + if (simplifiedResult) { + return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands }; + } else { + return res; + } + } + applyCodeActionCommand(args) { + const commands = args.command; + for (const command of toArray3(commands)) { + const { file, project } = this.getFileAndProject(command); + project.getLanguageService().applyCodeActionCommand(command, this.getFormatOptions(file)).then( + (_result) => { + }, + (_error) => { + } + ); + } + return {}; + } + getStartAndEndPosition(args, scriptInfo) { + let startPosition, endPosition; + if (args.startPosition !== void 0) { + startPosition = args.startPosition; + } else { + startPosition = scriptInfo.lineOffsetToPosition(args.startLine, args.startOffset); + args.startPosition = startPosition; + } + if (args.endPosition !== void 0) { + endPosition = args.endPosition; + } else { + endPosition = scriptInfo.lineOffsetToPosition(args.endLine, args.endOffset); + args.endPosition = endPosition; + } + return { startPosition, endPosition }; + } + mapCodeAction({ description: description32, changes, commands }) { + return { description: description32, changes: this.mapTextChangesToCodeEdits(changes), commands }; + } + mapCodeFixAction({ fixName: fixName8, description: description32, changes, commands, fixId: fixId52, fixAllDescription }) { + return { fixName: fixName8, description: description32, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription }; + } + mapTextChangesToCodeEdits(textChanges2) { + return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change)); + } + mapTextChangeToCodeEdit(textChanges2) { + const scriptInfo = this.projectService.getScriptInfoOrConfig(textChanges2.fileName); + if (!!textChanges2.isNewFile === !!scriptInfo) { + if (!scriptInfo) { + this.projectService.logErrorForScriptInfoNotFound(textChanges2.fileName); + } + Debug.fail("Expected isNewFile for (only) new files. " + JSON.stringify({ isNewFile: !!textChanges2.isNewFile, hasScriptInfo: !!scriptInfo })); + } + return scriptInfo ? { fileName: textChanges2.fileName, textChanges: textChanges2.textChanges.map((textChange) => convertTextChangeToCodeEdit(textChange, scriptInfo)) } : convertNewFileTextChangeToCodeEdit(textChanges2); + } + convertTextChangeToCodeEdit(change, scriptInfo) { + return { + start: scriptInfo.positionToLineOffset(change.span.start), + end: scriptInfo.positionToLineOffset(change.span.start + change.span.length), + newText: change.newText ? change.newText : "" + }; + } + getBraceMatching(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const position = this.getPosition(args, scriptInfo); + const spans = languageService.getBraceMatchingAtPosition(file, position); + return !spans ? void 0 : simplifiedResult ? spans.map((span) => toProtocolTextSpan(span, scriptInfo)) : spans; + } + getDiagnosticsForProject(next, delay2, fileName) { + if (this.suppressDiagnosticEvents) { + return; + } + const { fileNames, languageServiceDisabled } = this.getProjectInfoWorker( + fileName, + /*projectFileName*/ + void 0, + /*needFileNameList*/ + true, + /*excludeConfigFiles*/ + true + ); + if (languageServiceDisabled) { + return; + } + const fileNamesInProject = fileNames.filter((value2) => !value2.includes("lib.d.ts")); + if (fileNamesInProject.length === 0) { + return; + } + const highPriorityFiles = []; + const mediumPriorityFiles = []; + const lowPriorityFiles = []; + const veryLowPriorityFiles = []; + const normalizedFileName = toNormalizedPath(fileName); + const project = this.projectService.ensureDefaultProjectForFile(normalizedFileName); + for (const fileNameInProject of fileNamesInProject) { + if (this.getCanonicalFileName(fileNameInProject) === this.getCanonicalFileName(fileName)) { + highPriorityFiles.push(fileNameInProject); + } else { + const info2 = this.projectService.getScriptInfo(fileNameInProject); + if (!info2.isScriptOpen()) { + if (isDeclarationFileName(fileNameInProject)) { + veryLowPriorityFiles.push(fileNameInProject); + } else { + lowPriorityFiles.push(fileNameInProject); + } + } else { + mediumPriorityFiles.push(fileNameInProject); + } + } + } + const sortedFiles = [...highPriorityFiles, ...mediumPriorityFiles, ...lowPriorityFiles, ...veryLowPriorityFiles]; + const checkList = sortedFiles.map((fileName2) => ({ fileName: fileName2, project })); + this.updateErrorCheck( + next, + checkList, + delay2, + /*requireOpen*/ + false + ); + } + configurePlugin(args) { + this.projectService.configurePlugin(args); + } + getSmartSelectionRange(args, simplifiedResult) { + const { locations } = args; + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = Debug.checkDefined(this.projectService.getScriptInfo(file)); + return map4(locations, (location2) => { + const pos = this.getPosition(location2, scriptInfo); + const selectionRange = languageService.getSmartSelectionRange(file, pos); + return simplifiedResult ? this.mapSelectionRange(selectionRange, scriptInfo) : selectionRange; + }); + } + toggleLineComment(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfo(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.toggleLineComment(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + toggleMultilineComment(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.toggleMultilineComment(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + commentSelection(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.commentSelection(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + uncommentSelection(args, simplifiedResult) { + const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + const textRange = this.getRange(args, scriptInfo); + const textChanges2 = languageService.uncommentSelection(file, textRange); + if (simplifiedResult) { + const scriptInfo2 = this.projectService.getScriptInfoForNormalizedPath(file); + return textChanges2.map((textChange) => this.convertTextChangeToCodeEdit(textChange, scriptInfo2)); + } + return textChanges2; + } + mapSelectionRange(selectionRange, scriptInfo) { + const result2 = { + textSpan: toProtocolTextSpan(selectionRange.textSpan, scriptInfo) + }; + if (selectionRange.parent) { + result2.parent = this.mapSelectionRange(selectionRange.parent, scriptInfo); + } + return result2; + } + getScriptInfoFromProjectService(file) { + const normalizedFile = toNormalizedPath(file); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(normalizedFile); + if (!scriptInfo) { + this.projectService.logErrorForScriptInfoNotFound(normalizedFile); + return Errors.ThrowNoProject(); + } + return scriptInfo; + } + toProtocolCallHierarchyItem(item) { + const scriptInfo = this.getScriptInfoFromProjectService(item.file); + return { + name: item.name, + kind: item.kind, + kindModifiers: item.kindModifiers, + file: item.file, + containerName: item.containerName, + span: toProtocolTextSpan(item.span, scriptInfo), + selectionSpan: toProtocolTextSpan(item.selectionSpan, scriptInfo) + }; + } + toProtocolCallHierarchyIncomingCall(incomingCall) { + const scriptInfo = this.getScriptInfoFromProjectService(incomingCall.from.file); + return { + from: this.toProtocolCallHierarchyItem(incomingCall.from), + fromSpans: incomingCall.fromSpans.map((fromSpan) => toProtocolTextSpan(fromSpan, scriptInfo)) + }; + } + toProtocolCallHierarchyOutgoingCall(outgoingCall, scriptInfo) { + return { + to: this.toProtocolCallHierarchyItem(outgoingCall.to), + fromSpans: outgoingCall.fromSpans.map((fromSpan) => toProtocolTextSpan(fromSpan, scriptInfo)) + }; + } + prepareCallHierarchy(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file); + if (scriptInfo) { + const position = this.getPosition(args, scriptInfo); + const result2 = project.getLanguageService().prepareCallHierarchy(file, position); + return result2 && mapOneOrMany(result2, (item) => this.toProtocolCallHierarchyItem(item)); + } + return void 0; + } + provideCallHierarchyIncomingCalls(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.getScriptInfoFromProjectService(file); + const incomingCalls = project.getLanguageService().provideCallHierarchyIncomingCalls(file, this.getPosition(args, scriptInfo)); + return incomingCalls.map((call) => this.toProtocolCallHierarchyIncomingCall(call)); + } + provideCallHierarchyOutgoingCalls(args) { + const { file, project } = this.getFileAndProject(args); + const scriptInfo = this.getScriptInfoFromProjectService(file); + const outgoingCalls = project.getLanguageService().provideCallHierarchyOutgoingCalls(file, this.getPosition(args, scriptInfo)); + return outgoingCalls.map((call) => this.toProtocolCallHierarchyOutgoingCall(call, scriptInfo)); + } + getCanonicalFileName(fileName) { + const name2 = this.host.useCaseSensitiveFileNames ? fileName : toFileNameLowerCase(fileName); + return normalizePath(name2); + } + exit() { + } + notRequired() { + return { responseRequired: false }; + } + requiredResponse(response) { + return { response, responseRequired: true }; + } + addProtocolHandler(command, handler) { + if (this.handlers.has(command)) { + throw new Error(`Protocol handler already exists for command "${command}"`); + } + this.handlers.set(command, handler); + } + setCurrentRequest(requestId) { + Debug.assert(this.currentRequestId === void 0); + this.currentRequestId = requestId; + this.cancellationToken.setRequest(requestId); + } + resetCurrentRequest(requestId) { + Debug.assert(this.currentRequestId === requestId); + this.currentRequestId = void 0; + this.cancellationToken.resetRequest(requestId); + } + executeWithRequestId(requestId, f8) { + try { + this.setCurrentRequest(requestId); + return f8(); + } finally { + this.resetCurrentRequest(requestId); + } + } + executeCommand(request3) { + const handler = this.handlers.get(request3.command); + if (handler) { + const response = this.executeWithRequestId(request3.seq, () => handler(request3)); + this.projectService.enableRequestedPlugins(); + return response; + } else { + this.logger.msg( + `Unrecognized JSON command:${stringifyIndented(request3)}`, + "Err" + /* Err */ + ); + this.doOutput( + /*info*/ + void 0, + "unknown", + request3.seq, + /*success*/ + false, + `Unrecognized JSON command: ${request3.command}` + ); + return { responseRequired: false }; + } + } + onMessage(message) { + var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k; + this.gcTimer.scheduleCollect(); + this.performanceData = void 0; + let start; + if (this.logger.hasLevel( + 2 + /* requestTime */ + )) { + start = this.hrtime(); + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`request:${indent2(this.toStringMessage(message))}`); + } + } + let request3; + let relevantFile; + try { + request3 = this.parseMessage(message); + relevantFile = request3.arguments && request3.arguments.file ? request3.arguments : void 0; + (_a2 = tracing) == null ? void 0 : _a2.instant(tracing.Phase.Session, "request", { seq: request3.seq, command: request3.command }); + (_b = perfLogger) == null ? void 0 : _b.logStartCommand("" + request3.command, this.toStringMessage(message).substring(0, 100)); + (_c = tracing) == null ? void 0 : _c.push( + tracing.Phase.Session, + "executeCommand", + { seq: request3.seq, command: request3.command }, + /*separateBeginAndEnd*/ + true + ); + const { response, responseRequired } = this.executeCommand(request3); + (_d = tracing) == null ? void 0 : _d.pop(); + if (this.logger.hasLevel( + 2 + /* requestTime */ + )) { + const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4); + if (responseRequired) { + this.logger.perftrc(`${request3.seq}::${request3.command}: elapsed time (in milliseconds) ${elapsedTime}`); + } else { + this.logger.perftrc(`${request3.seq}::${request3.command}: async elapsed time (in milliseconds) ${elapsedTime}`); + } + } + (_e2 = perfLogger) == null ? void 0 : _e2.logStopCommand("" + request3.command, "Success"); + (_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "response", { seq: request3.seq, command: request3.command, success: !!response }); + if (response) { + this.doOutput( + response, + request3.command, + request3.seq, + /*success*/ + true + ); + } else if (responseRequired) { + this.doOutput( + /*info*/ + void 0, + request3.command, + request3.seq, + /*success*/ + false, + "No content available." + ); + } + } catch (err) { + (_g = tracing) == null ? void 0 : _g.popAll(); + if (err instanceof OperationCanceledException) { + (_h = perfLogger) == null ? void 0 : _h.logStopCommand("" + (request3 && request3.command), "Canceled: " + err); + (_i = tracing) == null ? void 0 : _i.instant(tracing.Phase.Session, "commandCanceled", { seq: request3 == null ? void 0 : request3.seq, command: request3 == null ? void 0 : request3.command }); + this.doOutput( + { canceled: true }, + request3.command, + request3.seq, + /*success*/ + true + ); + return; + } + this.logErrorWorker(err, this.toStringMessage(message), relevantFile); + (_j = perfLogger) == null ? void 0 : _j.logStopCommand("" + (request3 && request3.command), "Error: " + err); + (_k = tracing) == null ? void 0 : _k.instant(tracing.Phase.Session, "commandError", { seq: request3 == null ? void 0 : request3.seq, command: request3 == null ? void 0 : request3.command, message: err.message }); + this.doOutput( + /*info*/ + void 0, + request3 ? request3.command : "unknown", + request3 ? request3.seq : 0, + /*success*/ + false, + "Error processing request. " + err.message + "\n" + err.stack + ); + } + } + parseMessage(message) { + return JSON.parse(message); + } + toStringMessage(message) { + return message; + } + getFormatOptions(file) { + return this.projectService.getFormatCodeOptions(file); + } + getPreferences(file) { + return this.projectService.getPreferences(file); + } + getHostFormatOptions() { + return this.projectService.getHostFormatCodeOptions(); + } + getHostPreferences() { + return this.projectService.getHostPreferences(); + } + }; + } + }); + var lineCollectionCapacity, CharRangeSection, EditWalker, TextChange9, _ScriptVersionCache, ScriptVersionCache, LineIndexSnapshot, LineIndex, LineNode, LineLeaf; + var init_scriptVersionCache = __esm2({ + "src/server/scriptVersionCache.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + lineCollectionCapacity = 4; + CharRangeSection = /* @__PURE__ */ ((CharRangeSection2) => { + CharRangeSection2[CharRangeSection2["PreStart"] = 0] = "PreStart"; + CharRangeSection2[CharRangeSection2["Start"] = 1] = "Start"; + CharRangeSection2[CharRangeSection2["Entire"] = 2] = "Entire"; + CharRangeSection2[CharRangeSection2["Mid"] = 3] = "Mid"; + CharRangeSection2[CharRangeSection2["End"] = 4] = "End"; + CharRangeSection2[CharRangeSection2["PostEnd"] = 5] = "PostEnd"; + return CharRangeSection2; + })(CharRangeSection || {}); + EditWalker = class { + constructor() { + this.goSubtree = true; + this.lineIndex = new LineIndex(); + this.endBranch = []; + this.state = 2; + this.initialText = ""; + this.trailingText = ""; + this.lineIndex.root = new LineNode(); + this.startPath = [this.lineIndex.root]; + this.stack = [this.lineIndex.root]; + } + get done() { + return false; + } + insertLines(insertedText, suppressTrailingText) { + if (suppressTrailingText) { + this.trailingText = ""; + } + if (insertedText) { + insertedText = this.initialText + insertedText + this.trailingText; + } else { + insertedText = this.initialText + this.trailingText; + } + const lm = LineIndex.linesFromText(insertedText); + const lines = lm.lines; + if (lines.length > 1 && lines[lines.length - 1] === "") { + lines.pop(); + } + let branchParent; + let lastZeroCount; + for (let k6 = this.endBranch.length - 1; k6 >= 0; k6--) { + this.endBranch[k6].updateCounts(); + if (this.endBranch[k6].charCount() === 0) { + lastZeroCount = this.endBranch[k6]; + if (k6 > 0) { + branchParent = this.endBranch[k6 - 1]; + } else { + branchParent = this.branchNode; + } + } + } + if (lastZeroCount) { + branchParent.remove(lastZeroCount); + } + const leafNode = this.startPath[this.startPath.length - 1]; + if (lines.length > 0) { + leafNode.text = lines[0]; + if (lines.length > 1) { + let insertedNodes = new Array(lines.length - 1); + let startNode2 = leafNode; + for (let i7 = 1; i7 < lines.length; i7++) { + insertedNodes[i7 - 1] = new LineLeaf(lines[i7]); + } + let pathIndex = this.startPath.length - 2; + while (pathIndex >= 0) { + const insertionNode = this.startPath[pathIndex]; + insertedNodes = insertionNode.insertAt(startNode2, insertedNodes); + pathIndex--; + startNode2 = insertionNode; + } + let insertedNodesLen = insertedNodes.length; + while (insertedNodesLen > 0) { + const newRoot = new LineNode(); + newRoot.add(this.lineIndex.root); + insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes); + insertedNodesLen = insertedNodes.length; + this.lineIndex.root = newRoot; + } + this.lineIndex.root.updateCounts(); + } else { + for (let j6 = this.startPath.length - 2; j6 >= 0; j6--) { + this.startPath[j6].updateCounts(); + } + } + } else { + const insertionNode = this.startPath[this.startPath.length - 2]; + insertionNode.remove(leafNode); + for (let j6 = this.startPath.length - 2; j6 >= 0; j6--) { + this.startPath[j6].updateCounts(); + } + } + return this.lineIndex; + } + post(_relativeStart, _relativeLength, lineCollection) { + if (lineCollection === this.lineCollectionAtBranch) { + this.state = 4; + } + this.stack.pop(); + } + pre(_relativeStart, _relativeLength, lineCollection, _parent, nodeType) { + const currentNode = this.stack[this.stack.length - 1]; + if (this.state === 2 && nodeType === 1) { + this.state = 1; + this.branchNode = currentNode; + this.lineCollectionAtBranch = lineCollection; + } + let child; + function fresh(node) { + if (node.isLeaf()) { + return new LineLeaf(""); + } else + return new LineNode(); + } + switch (nodeType) { + case 0: + this.goSubtree = false; + if (this.state !== 4) { + currentNode.add(lineCollection); + } + break; + case 1: + if (this.state === 4) { + this.goSubtree = false; + } else { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath.push(child); + } + break; + case 2: + if (this.state !== 4) { + child = fresh(lineCollection); + currentNode.add(child); + this.startPath.push(child); + } else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch.push(child); + } + } + break; + case 3: + this.goSubtree = false; + break; + case 4: + if (this.state !== 4) { + this.goSubtree = false; + } else { + if (!lineCollection.isLeaf()) { + child = fresh(lineCollection); + currentNode.add(child); + this.endBranch.push(child); + } + } + break; + case 5: + this.goSubtree = false; + if (this.state !== 1) { + currentNode.add(lineCollection); + } + break; + } + if (this.goSubtree) { + this.stack.push(child); + } + } + // just gather text from the leaves + leaf(relativeStart, relativeLength, ll) { + if (this.state === 1) { + this.initialText = ll.text.substring(0, relativeStart); + } else if (this.state === 2) { + this.initialText = ll.text.substring(0, relativeStart); + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } else { + this.trailingText = ll.text.substring(relativeStart + relativeLength); + } + } + }; + TextChange9 = class { + constructor(pos, deleteLen, insertedText) { + this.pos = pos; + this.deleteLen = deleteLen; + this.insertedText = insertedText; + } + getTextChangeRange() { + return createTextChangeRange(createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0); + } + }; + _ScriptVersionCache = class _ScriptVersionCache2 { + constructor() { + this.changes = []; + this.versions = new Array(_ScriptVersionCache2.maxVersions); + this.minVersion = 0; + this.currentVersion = 0; + } + versionToIndex(version22) { + if (version22 < this.minVersion || version22 > this.currentVersion) { + return void 0; + } + return version22 % _ScriptVersionCache2.maxVersions; + } + currentVersionToIndex() { + return this.currentVersion % _ScriptVersionCache2.maxVersions; + } + // REVIEW: can optimize by coalescing simple edits + edit(pos, deleteLen, insertedText) { + this.changes.push(new TextChange9(pos, deleteLen, insertedText)); + if (this.changes.length > _ScriptVersionCache2.changeNumberThreshold || deleteLen > _ScriptVersionCache2.changeLengthThreshold || insertedText && insertedText.length > _ScriptVersionCache2.changeLengthThreshold) { + this.getSnapshot(); + } + } + getSnapshot() { + return this._getSnapshot(); + } + _getSnapshot() { + let snap = this.versions[this.currentVersionToIndex()]; + if (this.changes.length > 0) { + let snapIndex = snap.index; + for (const change of this.changes) { + snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText); + } + snap = new LineIndexSnapshot(this.currentVersion + 1, this, snapIndex, this.changes); + this.currentVersion = snap.version; + this.versions[this.currentVersionToIndex()] = snap; + this.changes = []; + if (this.currentVersion - this.minVersion >= _ScriptVersionCache2.maxVersions) { + this.minVersion = this.currentVersion - _ScriptVersionCache2.maxVersions + 1; + } + } + return snap; + } + getSnapshotVersion() { + return this._getSnapshot().version; + } + getAbsolutePositionAndLineText(oneBasedLine) { + return this._getSnapshot().index.lineNumberToInfo(oneBasedLine); + } + lineOffsetToPosition(line, column) { + return this._getSnapshot().index.absolutePositionOfStartOfLine(line) + (column - 1); + } + positionToLineOffset(position) { + return this._getSnapshot().index.positionToLineOffset(position); + } + lineToTextSpan(line) { + const index4 = this._getSnapshot().index; + const { lineText, absolutePosition } = index4.lineNumberToInfo(line + 1); + const len = lineText !== void 0 ? lineText.length : index4.absolutePositionOfStartOfLine(line + 2) - absolutePosition; + return createTextSpan(absolutePosition, len); + } + getTextChangesBetweenVersions(oldVersion, newVersion) { + if (oldVersion < newVersion) { + if (oldVersion >= this.minVersion) { + const textChangeRanges = []; + for (let i7 = oldVersion + 1; i7 <= newVersion; i7++) { + const snap = this.versions[this.versionToIndex(i7)]; + for (const textChange of snap.changesSincePreviousVersion) { + textChangeRanges.push(textChange.getTextChangeRange()); + } + } + return collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges); + } else { + return void 0; + } + } else { + return unchangedTextChangeRange; + } + } + getLineCount() { + return this._getSnapshot().index.getLineCount(); + } + static fromString(script) { + const svc = new _ScriptVersionCache2(); + const snap = new LineIndexSnapshot(0, svc, new LineIndex()); + svc.versions[svc.currentVersion] = snap; + const lm = LineIndex.linesFromText(script); + snap.index.load(lm.lines); + return svc; + } + }; + _ScriptVersionCache.changeNumberThreshold = 8; + _ScriptVersionCache.changeLengthThreshold = 256; + _ScriptVersionCache.maxVersions = 8; + ScriptVersionCache = _ScriptVersionCache; + LineIndexSnapshot = class _LineIndexSnapshot { + constructor(version22, cache, index4, changesSincePreviousVersion = emptyArray2) { + this.version = version22; + this.cache = cache; + this.index = index4; + this.changesSincePreviousVersion = changesSincePreviousVersion; + } + getText(rangeStart, rangeEnd) { + return this.index.getText(rangeStart, rangeEnd - rangeStart); + } + getLength() { + return this.index.getLength(); + } + getChangeRange(oldSnapshot) { + if (oldSnapshot instanceof _LineIndexSnapshot && this.cache === oldSnapshot.cache) { + if (this.version <= oldSnapshot.version) { + return unchangedTextChangeRange; + } else { + return this.cache.getTextChangesBetweenVersions(oldSnapshot.version, this.version); + } + } + } + }; + LineIndex = class _LineIndex { + constructor() { + this.checkEdits = false; + } + absolutePositionOfStartOfLine(oneBasedLine) { + return this.lineNumberToInfo(oneBasedLine).absolutePosition; + } + positionToLineOffset(position) { + const { oneBasedLine, zeroBasedColumn } = this.root.charOffsetToLineInfo(1, position); + return { line: oneBasedLine, offset: zeroBasedColumn + 1 }; + } + positionToColumnAndLineText(position) { + return this.root.charOffsetToLineInfo(1, position); + } + getLineCount() { + return this.root.lineCount(); + } + lineNumberToInfo(oneBasedLine) { + const lineCount = this.getLineCount(); + if (oneBasedLine <= lineCount) { + const { position, leaf } = this.root.lineNumberToInfo(oneBasedLine, 0); + return { absolutePosition: position, lineText: leaf && leaf.text }; + } else { + return { absolutePosition: this.root.charCount(), lineText: void 0 }; + } + } + load(lines) { + if (lines.length > 0) { + const leaves = []; + for (let i7 = 0; i7 < lines.length; i7++) { + leaves[i7] = new LineLeaf(lines[i7]); + } + this.root = _LineIndex.buildTreeFromBottom(leaves); + } else { + this.root = new LineNode(); + } + } + walk(rangeStart, rangeLength, walkFns) { + this.root.walk(rangeStart, rangeLength, walkFns); + } + getText(rangeStart, rangeLength) { + let accum = ""; + if (rangeLength > 0 && rangeStart < this.root.charCount()) { + this.walk(rangeStart, rangeLength, { + goSubtree: true, + done: false, + leaf: (relativeStart, relativeLength, ll) => { + accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength)); + } + }); + } + return accum; + } + getLength() { + return this.root.charCount(); + } + every(f8, rangeStart, rangeEnd) { + if (!rangeEnd) { + rangeEnd = this.root.charCount(); + } + const walkFns = { + goSubtree: true, + done: false, + leaf(relativeStart, relativeLength, ll) { + if (!f8(ll, relativeStart, relativeLength)) { + this.done = true; + } + } + }; + this.walk(rangeStart, rangeEnd - rangeStart, walkFns); + return !walkFns.done; + } + edit(pos, deleteLength, newText) { + if (this.root.charCount() === 0) { + Debug.assert(deleteLength === 0); + if (newText !== void 0) { + this.load(_LineIndex.linesFromText(newText).lines); + return this; + } + return void 0; + } else { + let checkText; + if (this.checkEdits) { + const source = this.getText(0, this.root.charCount()); + checkText = source.slice(0, pos) + newText + source.slice(pos + deleteLength); + } + const walker = new EditWalker(); + let suppressTrailingText = false; + if (pos >= this.root.charCount()) { + pos = this.root.charCount() - 1; + const endString = this.getText(pos, 1); + if (newText) { + newText = endString + newText; + } else { + newText = endString; + } + deleteLength = 0; + suppressTrailingText = true; + } else if (deleteLength > 0) { + const e10 = pos + deleteLength; + const { zeroBasedColumn, lineText } = this.positionToColumnAndLineText(e10); + if (zeroBasedColumn === 0) { + deleteLength += lineText.length; + newText = newText ? newText + lineText : lineText; + } + } + this.root.walk(pos, deleteLength, walker); + walker.insertLines(newText, suppressTrailingText); + if (this.checkEdits) { + const updatedText = walker.lineIndex.getText(0, walker.lineIndex.getLength()); + Debug.assert(checkText === updatedText, "buffer edit mismatch"); + } + return walker.lineIndex; + } + } + static buildTreeFromBottom(nodes) { + if (nodes.length < lineCollectionCapacity) { + return new LineNode(nodes); + } + const interiorNodes = new Array(Math.ceil(nodes.length / lineCollectionCapacity)); + let nodeIndex = 0; + for (let i7 = 0; i7 < interiorNodes.length; i7++) { + const end = Math.min(nodeIndex + lineCollectionCapacity, nodes.length); + interiorNodes[i7] = new LineNode(nodes.slice(nodeIndex, end)); + nodeIndex = end; + } + return this.buildTreeFromBottom(interiorNodes); + } + static linesFromText(text) { + const lineMap = computeLineStarts(text); + if (lineMap.length === 0) { + return { lines: [], lineMap }; + } + const lines = new Array(lineMap.length); + const lc = lineMap.length - 1; + for (let lmi = 0; lmi < lc; lmi++) { + lines[lmi] = text.substring(lineMap[lmi], lineMap[lmi + 1]); + } + const endText = text.substring(lineMap[lc]); + if (endText.length > 0) { + lines[lc] = endText; + } else { + lines.pop(); + } + return { lines, lineMap }; + } + }; + LineNode = class _LineNode { + constructor(children = []) { + this.children = children; + this.totalChars = 0; + this.totalLines = 0; + if (children.length) + this.updateCounts(); + } + isLeaf() { + return false; + } + updateCounts() { + this.totalChars = 0; + this.totalLines = 0; + for (const child of this.children) { + this.totalChars += child.charCount(); + this.totalLines += child.lineCount(); + } + } + execWalk(rangeStart, rangeLength, walkFns, childIndex, nodeType) { + if (walkFns.pre) { + walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + if (walkFns.goSubtree) { + this.children[childIndex].walk(rangeStart, rangeLength, walkFns); + if (walkFns.post) { + walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType); + } + } else { + walkFns.goSubtree = true; + } + return walkFns.done; + } + skipChild(relativeStart, relativeLength, childIndex, walkFns, nodeType) { + if (walkFns.pre && !walkFns.done) { + walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType); + walkFns.goSubtree = true; + } + } + walk(rangeStart, rangeLength, walkFns) { + let childIndex = 0; + let childCharCount = this.children[childIndex].charCount(); + let adjustedStart = rangeStart; + while (adjustedStart >= childCharCount) { + this.skipChild( + adjustedStart, + rangeLength, + childIndex, + walkFns, + 0 + /* PreStart */ + ); + adjustedStart -= childCharCount; + childIndex++; + childCharCount = this.children[childIndex].charCount(); + } + if (adjustedStart + rangeLength <= childCharCount) { + if (this.execWalk( + adjustedStart, + rangeLength, + walkFns, + childIndex, + 2 + /* Entire */ + )) { + return; + } + } else { + if (this.execWalk( + adjustedStart, + childCharCount - adjustedStart, + walkFns, + childIndex, + 1 + /* Start */ + )) { + return; + } + let adjustedLength = rangeLength - (childCharCount - adjustedStart); + childIndex++; + const child = this.children[childIndex]; + childCharCount = child.charCount(); + while (adjustedLength > childCharCount) { + if (this.execWalk( + 0, + childCharCount, + walkFns, + childIndex, + 3 + /* Mid */ + )) { + return; + } + adjustedLength -= childCharCount; + childIndex++; + childCharCount = this.children[childIndex].charCount(); + } + if (adjustedLength > 0) { + if (this.execWalk( + 0, + adjustedLength, + walkFns, + childIndex, + 4 + /* End */ + )) { + return; + } + } + } + if (walkFns.pre) { + const clen = this.children.length; + if (childIndex < clen - 1) { + for (let ej = childIndex + 1; ej < clen; ej++) { + this.skipChild( + 0, + 0, + ej, + walkFns, + 5 + /* PostEnd */ + ); + } + } + } + } + // Input position is relative to the start of this node. + // Output line number is absolute. + charOffsetToLineInfo(lineNumberAccumulator, relativePosition) { + if (this.children.length === 0) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: void 0 }; + } + for (const child of this.children) { + if (child.charCount() > relativePosition) { + if (child.isLeaf()) { + return { oneBasedLine: lineNumberAccumulator, zeroBasedColumn: relativePosition, lineText: child.text }; + } else { + return child.charOffsetToLineInfo(lineNumberAccumulator, relativePosition); + } + } else { + relativePosition -= child.charCount(); + lineNumberAccumulator += child.lineCount(); + } + } + const lineCount = this.lineCount(); + if (lineCount === 0) { + return { oneBasedLine: 1, zeroBasedColumn: 0, lineText: void 0 }; + } + const leaf = Debug.checkDefined(this.lineNumberToInfo(lineCount, 0).leaf); + return { oneBasedLine: lineCount, zeroBasedColumn: leaf.charCount(), lineText: void 0 }; + } + /** + * Input line number is relative to the start of this node. + * Output line number is relative to the child. + * positionAccumulator will be an absolute position once relativeLineNumber reaches 0. + */ + lineNumberToInfo(relativeOneBasedLine, positionAccumulator) { + for (const child of this.children) { + const childLineCount = child.lineCount(); + if (childLineCount >= relativeOneBasedLine) { + return child.isLeaf() ? { position: positionAccumulator, leaf: child } : child.lineNumberToInfo(relativeOneBasedLine, positionAccumulator); + } else { + relativeOneBasedLine -= childLineCount; + positionAccumulator += child.charCount(); + } + } + return { position: positionAccumulator, leaf: void 0 }; + } + splitAfter(childIndex) { + let splitNode; + const clen = this.children.length; + childIndex++; + const endLength = childIndex; + if (childIndex < clen) { + splitNode = new _LineNode(); + while (childIndex < clen) { + splitNode.add(this.children[childIndex]); + childIndex++; + } + splitNode.updateCounts(); + } + this.children.length = endLength; + return splitNode; + } + remove(child) { + const childIndex = this.findChildIndex(child); + const clen = this.children.length; + if (childIndex < clen - 1) { + for (let i7 = childIndex; i7 < clen - 1; i7++) { + this.children[i7] = this.children[i7 + 1]; + } + } + this.children.pop(); + } + findChildIndex(child) { + const childIndex = this.children.indexOf(child); + Debug.assert(childIndex !== -1); + return childIndex; + } + insertAt(child, nodes) { + let childIndex = this.findChildIndex(child); + const clen = this.children.length; + const nodeCount = nodes.length; + if (clen < lineCollectionCapacity && childIndex === clen - 1 && nodeCount === 1) { + this.add(nodes[0]); + this.updateCounts(); + return []; + } else { + const shiftNode = this.splitAfter(childIndex); + let nodeIndex = 0; + childIndex++; + while (childIndex < lineCollectionCapacity && nodeIndex < nodeCount) { + this.children[childIndex] = nodes[nodeIndex]; + childIndex++; + nodeIndex++; + } + let splitNodes = []; + let splitNodeCount = 0; + if (nodeIndex < nodeCount) { + splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity); + splitNodes = new Array(splitNodeCount); + let splitNodeIndex = 0; + for (let i7 = 0; i7 < splitNodeCount; i7++) { + splitNodes[i7] = new _LineNode(); + } + let splitNode = splitNodes[0]; + while (nodeIndex < nodeCount) { + splitNode.add(nodes[nodeIndex]); + nodeIndex++; + if (splitNode.children.length === lineCollectionCapacity) { + splitNodeIndex++; + splitNode = splitNodes[splitNodeIndex]; + } + } + for (let i7 = splitNodes.length - 1; i7 >= 0; i7--) { + if (splitNodes[i7].children.length === 0) { + splitNodes.pop(); + } + } + } + if (shiftNode) { + splitNodes.push(shiftNode); + } + this.updateCounts(); + for (let i7 = 0; i7 < splitNodeCount; i7++) { + splitNodes[i7].updateCounts(); + } + return splitNodes; + } + } + // assume there is room for the item; return true if more room + add(collection) { + this.children.push(collection); + Debug.assert(this.children.length <= lineCollectionCapacity); + } + charCount() { + return this.totalChars; + } + lineCount() { + return this.totalLines; + } + }; + LineLeaf = class { + constructor(text) { + this.text = text; + } + isLeaf() { + return true; + } + walk(rangeStart, rangeLength, walkFns) { + walkFns.leaf(rangeStart, rangeLength, this); + } + charCount() { + return this.text.length; + } + lineCount() { + return 1; + } + }; + } + }); + var _TypingsInstallerAdapter, TypingsInstallerAdapter; + var init_typingInstallerAdapter = __esm2({ + "src/server/typingInstallerAdapter.ts"() { + "use strict"; + init_ts7(); + init_ts_server3(); + _TypingsInstallerAdapter = class _TypingsInstallerAdapter2 { + constructor(telemetryEnabled, logger, host, globalTypingsCacheLocation, event, maxActiveRequestCount) { + this.telemetryEnabled = telemetryEnabled; + this.logger = logger; + this.host = host; + this.globalTypingsCacheLocation = globalTypingsCacheLocation; + this.event = event; + this.maxActiveRequestCount = maxActiveRequestCount; + this.activeRequestCount = 0; + this.requestQueue = createQueue(); + this.requestMap = /* @__PURE__ */ new Map(); + this.requestedRegistry = false; + this.packageInstallId = 0; + } + isKnownTypesPackageName(name2) { + var _a2; + const validationResult = ts_JsTyping_exports.validatePackageName(name2); + if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) { + return false; + } + if (!this.requestedRegistry) { + this.requestedRegistry = true; + this.installer.send({ kind: "typesRegistry" }); + } + return !!((_a2 = this.typesRegistryCache) == null ? void 0 : _a2.has(name2)); + } + installPackage(options) { + this.packageInstallId++; + const request3 = { kind: "installPackage", ...options, id: this.packageInstallId }; + const promise = new Promise((resolve3, reject2) => { + (this.packageInstalledPromise ?? (this.packageInstalledPromise = /* @__PURE__ */ new Map())).set(this.packageInstallId, { resolve: resolve3, reject: reject2 }); + }); + this.installer.send(request3); + return promise; + } + attach(projectService) { + this.projectService = projectService; + this.installer = this.createInstallerProcess(); + } + onProjectClosed(p7) { + this.installer.send({ projectName: p7.getProjectName(), kind: "closeProject" }); + } + enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports) { + const request3 = createInstallTypingsRequest(project, typeAcquisition, unresolvedImports); + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Scheduling throttled operation:${stringifyIndented(request3)}`); + } + if (this.activeRequestCount < this.maxActiveRequestCount) { + this.scheduleRequest(request3); + } else { + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Deferring request for: ${request3.projectName}`); + } + this.requestQueue.enqueue(request3); + this.requestMap.set(request3.projectName, request3); + } + } + handleMessage(response) { + var _a2, _b; + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Received response:${stringifyIndented(response)}`); + } + switch (response.kind) { + case EventTypesRegistry: + this.typesRegistryCache = new Map(Object.entries(response.typesRegistry)); + break; + case ActionPackageInstalled: { + const promise = (_a2 = this.packageInstalledPromise) == null ? void 0 : _a2.get(response.id); + Debug.assertIsDefined(promise, "Should find the promise for package install"); + (_b = this.packageInstalledPromise) == null ? void 0 : _b.delete(response.id); + if (response.success) { + promise.resolve({ successMessage: response.message }); + } else { + promise.reject(response.message); + } + this.projectService.updateTypingsForProject(response); + this.event(response, "setTypings"); + break; + } + case EventInitializationFailed: { + const body = { + message: response.message + }; + const eventName = "typesInstallerInitializationFailed"; + this.event(body, eventName); + break; + } + case EventBeginInstallTypes: { + const body = { + eventId: response.eventId, + packages: response.packagesToInstall + }; + const eventName = "beginInstallTypes"; + this.event(body, eventName); + break; + } + case EventEndInstallTypes: { + if (this.telemetryEnabled) { + const body2 = { + telemetryEventName: "typingsInstalled", + payload: { + installedPackages: response.packagesToInstall.join(","), + installSuccess: response.installSuccess, + typingsInstallerVersion: response.typingsInstallerVersion + } + }; + const eventName2 = "telemetry"; + this.event(body2, eventName2); + } + const body = { + eventId: response.eventId, + packages: response.packagesToInstall, + success: response.installSuccess + }; + const eventName = "endInstallTypes"; + this.event(body, eventName); + break; + } + case ActionInvalidate: { + this.projectService.updateTypingsForProject(response); + break; + } + case ActionSet: { + if (this.activeRequestCount > 0) { + this.activeRequestCount--; + } else { + Debug.fail("TIAdapter:: Received too many responses"); + } + while (!this.requestQueue.isEmpty()) { + const queuedRequest = this.requestQueue.dequeue(); + if (this.requestMap.get(queuedRequest.projectName) === queuedRequest) { + this.requestMap.delete(queuedRequest.projectName); + this.scheduleRequest(queuedRequest); + break; + } + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Skipping defunct request for: ${queuedRequest.projectName}`); + } + } + this.projectService.updateTypingsForProject(response); + this.event(response, "setTypings"); + break; + } + case ActionWatchTypingLocations: + this.projectService.watchTypingLocations(response); + break; + default: + assertType(response); + } + } + scheduleRequest(request3) { + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Scheduling request for: ${request3.projectName}`); + } + this.activeRequestCount++; + this.host.setTimeout( + () => { + if (this.logger.hasLevel( + 3 + /* verbose */ + )) { + this.logger.info(`TIAdapter:: Sending request:${stringifyIndented(request3)}`); + } + this.installer.send(request3); + }, + _TypingsInstallerAdapter2.requestDelayMillis, + `${request3.projectName}::${request3.kind}` + ); + } + }; + _TypingsInstallerAdapter.requestDelayMillis = 100; + TypingsInstallerAdapter = _TypingsInstallerAdapter; + } + }); + var ts_server_exports3 = {}; + __export2(ts_server_exports3, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + ActionWatchTypingLocations: () => ActionWatchTypingLocations, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + AuxiliaryProject: () => AuxiliaryProject, + CharRangeSection: () => CharRangeSection, + CloseFileWatcherEvent: () => CloseFileWatcherEvent, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, + CreateFileWatcherEvent: () => CreateFileWatcherEvent, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + TypingsInstallerAdapter: () => TypingsInstallerAdapter, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + isBackgroundProject: () => isBackgroundProject, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + typingsInstaller: () => ts_server_typingsInstaller_exports, + updateProjectIfDirty: () => updateProjectIfDirty + }); + var init_ts_server3 = __esm2({ + "src/server/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server2(); + init_types4(); + init_utilitiesPublic3(); + init_utilities5(); + init_ts_server_protocol(); + init_scriptInfo(); + init_typingsCache(); + init_project(); + init_editorServices(); + init_moduleSpecifierCache(); + init_packageJsonCache(); + init_session(); + init_scriptVersionCache(); + init_typingInstallerAdapter(); + } + }); + var ts_exports2 = {}; + __export2(ts_exports2, { + ANONYMOUS: () => ANONYMOUS, + AccessFlags: () => AccessFlags, + AssertionLevel: () => AssertionLevel, + AssignmentDeclarationKind: () => AssignmentDeclarationKind, + AssignmentKind: () => AssignmentKind, + Associativity: () => Associativity, + BreakpointResolver: () => ts_BreakpointResolver_exports, + BuilderFileEmit: () => BuilderFileEmit, + BuilderProgramKind: () => BuilderProgramKind, + BuilderState: () => BuilderState, + BundleFileSectionKind: () => BundleFileSectionKind, + CallHierarchy: () => ts_CallHierarchy_exports, + CharacterCodes: () => CharacterCodes, + CheckFlags: () => CheckFlags, + CheckMode: () => CheckMode, + ClassificationType: () => ClassificationType, + ClassificationTypeNames: () => ClassificationTypeNames, + CommentDirectiveType: () => CommentDirectiveType, + Comparison: () => Comparison, + CompletionInfoFlags: () => CompletionInfoFlags, + CompletionTriggerKind: () => CompletionTriggerKind, + Completions: () => ts_Completions_exports, + ContainerFlags: () => ContainerFlags, + ContextFlags: () => ContextFlags, + Debug: () => Debug, + DiagnosticCategory: () => DiagnosticCategory, + Diagnostics: () => Diagnostics, + DocumentHighlights: () => DocumentHighlights, + ElementFlags: () => ElementFlags, + EmitFlags: () => EmitFlags, + EmitHint: () => EmitHint, + EmitOnly: () => EmitOnly, + EndOfLineState: () => EndOfLineState, + EnumKind: () => EnumKind, + ExitStatus: () => ExitStatus, + ExportKind: () => ExportKind, + Extension: () => Extension6, + ExternalEmitHelpers: () => ExternalEmitHelpers, + FileIncludeKind: () => FileIncludeKind, + FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, + FileSystemEntryKind: () => FileSystemEntryKind, + FileWatcherEventKind: () => FileWatcherEventKind, + FindAllReferences: () => ts_FindAllReferences_exports, + FlattenLevel: () => FlattenLevel, + FlowFlags: () => FlowFlags, + ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, + FunctionFlags: () => FunctionFlags, + GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, + GetLiteralTextFlags: () => GetLiteralTextFlags, + GoToDefinition: () => ts_GoToDefinition_exports, + HighlightSpanKind: () => HighlightSpanKind, + IdentifierNameMap: () => IdentifierNameMap, + IdentifierNameMultiMap: () => IdentifierNameMultiMap, + ImportKind: () => ImportKind, + ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, + IndentStyle: () => IndentStyle, + IndexFlags: () => IndexFlags, + IndexKind: () => IndexKind, + InferenceFlags: () => InferenceFlags, + InferencePriority: () => InferencePriority, + InlayHintKind: () => InlayHintKind, + InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, + InternalSymbolName: () => InternalSymbolName, + InvalidatedProjectKind: () => InvalidatedProjectKind, + JSDocParsingMode: () => JSDocParsingMode, + JsDoc: () => ts_JsDoc_exports, + JsTyping: () => ts_JsTyping_exports, + JsxEmit: () => JsxEmit, + JsxFlags: () => JsxFlags, + JsxReferenceKind: () => JsxReferenceKind, + LanguageServiceMode: () => LanguageServiceMode, + LanguageVariant: () => LanguageVariant, + LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, + ListFormat: () => ListFormat, + LogLevel: () => LogLevel, + MemberOverrideStatus: () => MemberOverrideStatus, + ModifierFlags: () => ModifierFlags, + ModuleDetectionKind: () => ModuleDetectionKind, + ModuleInstanceState: () => ModuleInstanceState, + ModuleKind: () => ModuleKind, + ModuleResolutionKind: () => ModuleResolutionKind, + ModuleSpecifierEnding: () => ModuleSpecifierEnding, + NavigateTo: () => ts_NavigateTo_exports, + NavigationBar: () => ts_NavigationBar_exports, + NewLineKind: () => NewLineKind, + NodeBuilderFlags: () => NodeBuilderFlags, + NodeCheckFlags: () => NodeCheckFlags, + NodeFactoryFlags: () => NodeFactoryFlags, + NodeFlags: () => NodeFlags, + NodeResolutionFeatures: () => NodeResolutionFeatures, + ObjectFlags: () => ObjectFlags, + OperationCanceledException: () => OperationCanceledException, + OperatorPrecedence: () => OperatorPrecedence, + OrganizeImports: () => ts_OrganizeImports_exports, + OrganizeImportsMode: () => OrganizeImportsMode, + OuterExpressionKinds: () => OuterExpressionKinds, + OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, + OutliningSpanKind: () => OutliningSpanKind, + OutputFileType: () => OutputFileType, + PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, + PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, + PatternMatchKind: () => PatternMatchKind, + PollingInterval: () => PollingInterval, + PollingWatchKind: () => PollingWatchKind, + PragmaKindFlags: () => PragmaKindFlags, + PrivateIdentifierKind: () => PrivateIdentifierKind, + ProcessLevel: () => ProcessLevel, + ProgramUpdateLevel: () => ProgramUpdateLevel, + QuotePreference: () => QuotePreference, + RelationComparisonResult: () => RelationComparisonResult, + Rename: () => ts_Rename_exports, + ScriptElementKind: () => ScriptElementKind, + ScriptElementKindModifier: () => ScriptElementKindModifier, + ScriptKind: () => ScriptKind, + ScriptSnapshot: () => ScriptSnapshot, + ScriptTarget: () => ScriptTarget, + SemanticClassificationFormat: () => SemanticClassificationFormat, + SemanticMeaning: () => SemanticMeaning, + SemicolonPreference: () => SemicolonPreference, + SignatureCheckMode: () => SignatureCheckMode, + SignatureFlags: () => SignatureFlags, + SignatureHelp: () => ts_SignatureHelp_exports, + SignatureKind: () => SignatureKind, + SmartSelectionRange: () => ts_SmartSelectionRange_exports, + SnippetKind: () => SnippetKind, + SortKind: () => SortKind, + StructureIsReused: () => StructureIsReused, + SymbolAccessibility: () => SymbolAccessibility, + SymbolDisplay: () => ts_SymbolDisplay_exports, + SymbolDisplayPartKind: () => SymbolDisplayPartKind, + SymbolFlags: () => SymbolFlags, + SymbolFormatFlags: () => SymbolFormatFlags, + SyntaxKind: () => SyntaxKind, + SyntheticSymbolKind: () => SyntheticSymbolKind, + Ternary: () => Ternary, + ThrottledCancellationToken: () => ThrottledCancellationToken, + TokenClass: () => TokenClass, + TokenFlags: () => TokenFlags, + TransformFlags: () => TransformFlags, + TypeFacts: () => TypeFacts, + TypeFlags: () => TypeFlags, + TypeFormatFlags: () => TypeFormatFlags, + TypeMapKind: () => TypeMapKind, + TypePredicateKind: () => TypePredicateKind, + TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, + UnionReduction: () => UnionReduction, + UpToDateStatusType: () => UpToDateStatusType, + VarianceFlags: () => VarianceFlags, + Version: () => Version, + VersionRange: () => VersionRange, + WatchDirectoryFlags: () => WatchDirectoryFlags, + WatchDirectoryKind: () => WatchDirectoryKind, + WatchFileKind: () => WatchFileKind, + WatchLogLevel: () => WatchLogLevel, + WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, + addDisposableResourceHelper: () => addDisposableResourceHelper, + addEmitFlags: () => addEmitFlags, + addEmitHelper: () => addEmitHelper, + addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, + addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, + addRange: () => addRange, + addRelatedInfo: () => addRelatedInfo, + addSyntheticLeadingComment: () => addSyntheticLeadingComment, + addSyntheticTrailingComment: () => addSyntheticTrailingComment, + addToSeen: () => addToSeen, + advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, + affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, + affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, + allKeysStartWithDot: () => allKeysStartWithDot, + altDirectorySeparator: () => altDirectorySeparator, + and: () => and, + append: () => append, + appendIfUnique: () => appendIfUnique, + arrayFrom: () => arrayFrom, + arrayIsEqualTo: () => arrayIsEqualTo, + arrayIsHomogeneous: () => arrayIsHomogeneous, + arrayIsSorted: () => arrayIsSorted, + arrayOf: () => arrayOf, + arrayReverseIterator: () => arrayReverseIterator, + arrayToMap: () => arrayToMap, + arrayToMultiMap: () => arrayToMultiMap, + arrayToNumericMap: () => arrayToNumericMap, + arraysEqual: () => arraysEqual, + assertType: () => assertType, + assign: () => assign3, + assignHelper: () => assignHelper, + asyncDelegator: () => asyncDelegator, + asyncGeneratorHelper: () => asyncGeneratorHelper, + asyncSuperHelper: () => asyncSuperHelper, + asyncValues: () => asyncValues, + attachFileToDiagnostics: () => attachFileToDiagnostics, + awaitHelper: () => awaitHelper, + awaiterHelper: () => awaiterHelper, + base64decode: () => base64decode, + base64encode: () => base64encode, + binarySearch: () => binarySearch, + binarySearchKey: () => binarySearchKey, + bindSourceFile: () => bindSourceFile, + breakIntoCharacterSpans: () => breakIntoCharacterSpans, + breakIntoWordSpans: () => breakIntoWordSpans, + buildLinkParts: () => buildLinkParts, + buildOpts: () => buildOpts, + buildOverload: () => buildOverload, + bundlerModuleNameResolver: () => bundlerModuleNameResolver, + canBeConvertedToAsync: () => canBeConvertedToAsync, + canHaveDecorators: () => canHaveDecorators, + canHaveExportModifier: () => canHaveExportModifier, + canHaveFlowNode: () => canHaveFlowNode, + canHaveIllegalDecorators: () => canHaveIllegalDecorators, + canHaveIllegalModifiers: () => canHaveIllegalModifiers, + canHaveIllegalType: () => canHaveIllegalType, + canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, + canHaveJSDoc: () => canHaveJSDoc, + canHaveLocals: () => canHaveLocals, + canHaveModifiers: () => canHaveModifiers, + canHaveSymbol: () => canHaveSymbol, + canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, + canProduceDiagnostics: () => canProduceDiagnostics, + canUsePropertyAccess: () => canUsePropertyAccess, + canWatchAffectingLocation: () => canWatchAffectingLocation, + canWatchAtTypes: () => canWatchAtTypes, + canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, + cartesianProduct: () => cartesianProduct, + cast: () => cast, + chainBundle: () => chainBundle, + chainDiagnosticMessages: () => chainDiagnosticMessages, + changeAnyExtension: () => changeAnyExtension, + changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, + changeExtension: () => changeExtension, + changeFullExtension: () => changeFullExtension, + changesAffectModuleResolution: () => changesAffectModuleResolution, + changesAffectingProgramStructure: () => changesAffectingProgramStructure, + childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, + classHasClassThisAssignment: () => classHasClassThisAssignment, + classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, + classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, + classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, + classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, + classPrivateFieldInHelper: () => classPrivateFieldInHelper, + classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, + classicNameResolver: () => classicNameResolver, + classifier: () => ts_classifier_exports, + cleanExtendedConfigCache: () => cleanExtendedConfigCache, + clear: () => clear2, + clearMap: () => clearMap, + clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, + climbPastPropertyAccess: () => climbPastPropertyAccess, + climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, + clone: () => clone2, + cloneCompilerOptions: () => cloneCompilerOptions, + closeFileWatcher: () => closeFileWatcher, + closeFileWatcherOf: () => closeFileWatcherOf, + codefix: () => ts_codefix_exports, + collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, + collectExternalModuleInfo: () => collectExternalModuleInfo, + combine: () => combine, + combinePaths: () => combinePaths, + commentPragmas: () => commentPragmas, + commonOptionsWithBuild: () => commonOptionsWithBuild, + commonPackageFolders: () => commonPackageFolders, + compact: () => compact2, + compareBooleans: () => compareBooleans, + compareDataObjects: () => compareDataObjects, + compareDiagnostics: () => compareDiagnostics, + compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, + compareEmitHelpers: () => compareEmitHelpers, + compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, + comparePaths: () => comparePaths, + comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, + comparePathsCaseSensitive: () => comparePathsCaseSensitive, + comparePatternKeys: () => comparePatternKeys, + compareProperties: () => compareProperties, + compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, + compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, + compareStringsCaseSensitive: () => compareStringsCaseSensitive, + compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, + compareTextSpans: () => compareTextSpans, + compareValues: () => compareValues, + compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, + compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, + compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, + compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, + compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, + compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, + computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, + computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, + computeLineOfPosition: () => computeLineOfPosition, + computeLineStarts: () => computeLineStarts, + computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, + computeSignature: () => computeSignature, + computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, + computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, + computedOptions: () => computedOptions, + concatenate: () => concatenate, + concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, + consumesNodeCoreModules: () => consumesNodeCoreModules, + contains: () => contains2, + containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, + containsParseError: () => containsParseError, + containsPath: () => containsPath, + convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, + convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, + convertJsonOption: () => convertJsonOption, + convertToBase64: () => convertToBase64, + convertToJson: () => convertToJson, + convertToObject: () => convertToObject, + convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, + convertToRelativePath: () => convertToRelativePath, + convertToTSConfig: () => convertToTSConfig, + convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, + copyComments: () => copyComments, + copyEntries: () => copyEntries, + copyLeadingComments: () => copyLeadingComments, + copyProperties: () => copyProperties, + copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, + copyTrailingComments: () => copyTrailingComments, + couldStartTrivia: () => couldStartTrivia, + countWhere: () => countWhere, + createAbstractBuilder: () => createAbstractBuilder, + createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, + createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, + createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, + createBaseNodeFactory: () => createBaseNodeFactory, + createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, + createBindingHelper: () => createBindingHelper, + createBuildInfo: () => createBuildInfo, + createBuilderProgram: () => createBuilderProgram, + createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, + createBuilderStatusReporter: () => createBuilderStatusReporter, + createCacheWithRedirects: () => createCacheWithRedirects, + createCacheableExportInfoMap: () => createCacheableExportInfoMap, + createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, + createClassNamedEvaluationHelperBlock: () => createClassNamedEvaluationHelperBlock, + createClassThisAssignmentBlock: () => createClassThisAssignmentBlock, + createClassifier: () => createClassifier, + createCommentDirectivesMap: () => createCommentDirectivesMap, + createCompilerDiagnostic: () => createCompilerDiagnostic, + createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, + createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, + createCompilerHost: () => createCompilerHost, + createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, + createCompilerHostWorker: () => createCompilerHostWorker, + createDetachedDiagnostic: () => createDetachedDiagnostic, + createDiagnosticCollection: () => createDiagnosticCollection, + createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, + createDiagnosticForNode: () => createDiagnosticForNode, + createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, + createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, + createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, + createDiagnosticForRange: () => createDiagnosticForRange, + createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, + createDiagnosticReporter: () => createDiagnosticReporter, + createDocumentPositionMapper: () => createDocumentPositionMapper, + createDocumentRegistry: () => createDocumentRegistry, + createDocumentRegistryInternal: () => createDocumentRegistryInternal, + createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, + createEmitHelperFactory: () => createEmitHelperFactory, + createEmptyExports: () => createEmptyExports, + createExpressionForJsxElement: () => createExpressionForJsxElement, + createExpressionForJsxFragment: () => createExpressionForJsxFragment, + createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, + createExpressionForPropertyName: () => createExpressionForPropertyName, + createExpressionFromEntityName: () => createExpressionFromEntityName, + createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, + createFileDiagnostic: () => createFileDiagnostic, + createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, + createForOfBindingStatement: () => createForOfBindingStatement, + createGetCanonicalFileName: () => createGetCanonicalFileName, + createGetSourceFile: () => createGetSourceFile, + createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, + createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, + createGetSymbolWalker: () => createGetSymbolWalker, + createIncrementalCompilerHost: () => createIncrementalCompilerHost, + createIncrementalProgram: () => createIncrementalProgram, + createInputFiles: () => createInputFiles, + createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, + createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, + createJsxFactoryExpression: () => createJsxFactoryExpression, + createLanguageService: () => createLanguageService, + createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, + createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, + createModeAwareCache: () => createModeAwareCache, + createModeAwareCacheKey: () => createModeAwareCacheKey, + createModuleNotFoundChain: () => createModuleNotFoundChain, + createModuleResolutionCache: () => createModuleResolutionCache, + createModuleResolutionLoader: () => createModuleResolutionLoader, + createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, + createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, + createMultiMap: () => createMultiMap, + createNodeConverters: () => createNodeConverters, + createNodeFactory: () => createNodeFactory, + createOptionNameMap: () => createOptionNameMap, + createOverload: () => createOverload, + createPackageJsonImportFilter: () => createPackageJsonImportFilter, + createPackageJsonInfo: () => createPackageJsonInfo, + createParenthesizerRules: () => createParenthesizerRules, + createPatternMatcher: () => createPatternMatcher, + createPrependNodes: () => createPrependNodes, + createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, + createProgram: () => createProgram, + createProgramHost: () => createProgramHost, + createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, + createQueue: () => createQueue, + createRange: () => createRange2, + createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, + createResolutionCache: () => createResolutionCache, + createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, + createScanner: () => createScanner3, + createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, + createSet: () => createSet2, + createSolutionBuilder: () => createSolutionBuilder, + createSolutionBuilderHost: () => createSolutionBuilderHost, + createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, + createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, + createSortedArray: () => createSortedArray, + createSourceFile: () => createSourceFile, + createSourceMapGenerator: () => createSourceMapGenerator, + createSourceMapSource: () => createSourceMapSource, + createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, + createSymbolTable: () => createSymbolTable, + createSymlinkCache: () => createSymlinkCache, + createSystemWatchFunctions: () => createSystemWatchFunctions, + createTextChange: () => createTextChange, + createTextChangeFromStartLength: () => createTextChangeFromStartLength, + createTextChangeRange: () => createTextChangeRange, + createTextRangeFromNode: () => createTextRangeFromNode, + createTextRangeFromSpan: () => createTextRangeFromSpan, + createTextSpan: () => createTextSpan, + createTextSpanFromBounds: () => createTextSpanFromBounds, + createTextSpanFromNode: () => createTextSpanFromNode, + createTextSpanFromRange: () => createTextSpanFromRange, + createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, + createTextWriter: () => createTextWriter, + createTokenRange: () => createTokenRange, + createTypeChecker: () => createTypeChecker, + createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, + createUnparsedSourceFile: () => createUnparsedSourceFile, + createWatchCompilerHost: () => createWatchCompilerHost2, + createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, + createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, + createWatchFactory: () => createWatchFactory, + createWatchHost: () => createWatchHost, + createWatchProgram: () => createWatchProgram, + createWatchStatusReporter: () => createWatchStatusReporter, + createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, + declarationNameToString: () => declarationNameToString, + decodeMappings: () => decodeMappings, + decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, + decorateHelper: () => decorateHelper, + deduplicate: () => deduplicate, + defaultIncludeSpec: () => defaultIncludeSpec, + defaultInitCompilerOptions: () => defaultInitCompilerOptions, + defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, + detectSortCaseSensitivity: () => detectSortCaseSensitivity, + diagnosticCategoryName: () => diagnosticCategoryName, + diagnosticToString: () => diagnosticToString, + directoryProbablyExists: () => directoryProbablyExists, + directorySeparator: () => directorySeparator, + displayPart: () => displayPart, + displayPartsToString: () => displayPartsToString, + disposeEmitNodes: () => disposeEmitNodes, + disposeResourcesHelper: () => disposeResourcesHelper, + documentSpansEqual: () => documentSpansEqual, + dumpTracingLegend: () => dumpTracingLegend, + elementAt: () => elementAt, + elideNodes: () => elideNodes, + emitComments: () => emitComments, + emitDetachedComments: () => emitDetachedComments, + emitFiles: () => emitFiles, + emitFilesAndReportErrors: () => emitFilesAndReportErrors, + emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, + emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, + emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, + emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, + emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, + emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, + emitUsingBuildInfo: () => emitUsingBuildInfo, + emptyArray: () => emptyArray, + emptyFileSystemEntries: () => emptyFileSystemEntries, + emptyMap: () => emptyMap, + emptyOptions: () => emptyOptions, + emptySet: () => emptySet, + endsWith: () => endsWith2, + ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, + ensureScriptKind: () => ensureScriptKind, + ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, + entityNameToString: () => entityNameToString, + enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, + equalOwnProperties: () => equalOwnProperties, + equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, + equateStringsCaseSensitive: () => equateStringsCaseSensitive, + equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, + escapeJsxAttributeString: () => escapeJsxAttributeString, + escapeLeadingUnderscores: () => escapeLeadingUnderscores, + escapeNonAsciiString: () => escapeNonAsciiString, + escapeSnippetText: () => escapeSnippetText, + escapeString: () => escapeString2, + escapeTemplateSubstitution: () => escapeTemplateSubstitution, + every: () => every2, + expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, + explainFiles: () => explainFiles, + explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, + exportAssignmentIsAlias: () => exportAssignmentIsAlias, + exportStarHelper: () => exportStarHelper, + expressionResultIsUnused: () => expressionResultIsUnused, + extend: () => extend3, + extendsHelper: () => extendsHelper, + extensionFromPath: () => extensionFromPath, + extensionIsTS: () => extensionIsTS, + extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution, + externalHelpersModuleNameText: () => externalHelpersModuleNameText, + factory: () => factory, + fileExtensionIs: () => fileExtensionIs, + fileExtensionIsOneOf: () => fileExtensionIsOneOf, + fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, + fileShouldUseJavaScriptRequire: () => fileShouldUseJavaScriptRequire, + filter: () => filter2, + filterMutate: () => filterMutate, + filterSemanticDiagnostics: () => filterSemanticDiagnostics, + find: () => find2, + findAncestor: () => findAncestor, + findBestPatternMatch: () => findBestPatternMatch, + findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, + findConfigFile: () => findConfigFile, + findContainingList: () => findContainingList, + findDiagnosticForNode: () => findDiagnosticForNode, + findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, + findIndex: () => findIndex2, + findLast: () => findLast2, + findLastIndex: () => findLastIndex2, + findListItemInfo: () => findListItemInfo, + findMap: () => findMap, + findModifier: () => findModifier, + findNextToken: () => findNextToken, + findPackageJson: () => findPackageJson, + findPackageJsons: () => findPackageJsons, + findPrecedingMatchingToken: () => findPrecedingMatchingToken, + findPrecedingToken: () => findPrecedingToken, + findSuperStatementIndexPath: () => findSuperStatementIndexPath, + findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, + findUseStrictPrologue: () => findUseStrictPrologue, + first: () => first, + firstDefined: () => firstDefined, + firstDefinedIterator: () => firstDefinedIterator, + firstIterator: () => firstIterator, + firstOrOnly: () => firstOrOnly, + firstOrUndefined: () => firstOrUndefined, + firstOrUndefinedIterator: () => firstOrUndefinedIterator, + fixupCompilerOptions: () => fixupCompilerOptions, + flatMap: () => flatMap2, + flatMapIterator: () => flatMapIterator, + flatMapToMutable: () => flatMapToMutable, + flatten: () => flatten2, + flattenCommaList: () => flattenCommaList, + flattenDestructuringAssignment: () => flattenDestructuringAssignment, + flattenDestructuringBinding: () => flattenDestructuringBinding, + flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, + forEach: () => forEach4, + forEachAncestor: () => forEachAncestor, + forEachAncestorDirectory: () => forEachAncestorDirectory, + forEachChild: () => forEachChild, + forEachChildRecursively: () => forEachChildRecursively, + forEachEmittedFile: () => forEachEmittedFile, + forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, + forEachEntry: () => forEachEntry, + forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, + forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, + forEachKey: () => forEachKey, + forEachLeadingCommentRange: () => forEachLeadingCommentRange, + forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, + forEachPropertyAssignment: () => forEachPropertyAssignment, + forEachResolvedProjectReference: () => forEachResolvedProjectReference, + forEachReturnStatement: () => forEachReturnStatement, + forEachRight: () => forEachRight2, + forEachTrailingCommentRange: () => forEachTrailingCommentRange, + forEachTsConfigPropArray: () => forEachTsConfigPropArray, + forEachUnique: () => forEachUnique, + forEachYieldExpression: () => forEachYieldExpression, + forSomeAncestorDirectory: () => forSomeAncestorDirectory, + formatColorAndReset: () => formatColorAndReset, + formatDiagnostic: () => formatDiagnostic, + formatDiagnostics: () => formatDiagnostics, + formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, + formatGeneratedName: () => formatGeneratedName, + formatGeneratedNamePart: () => formatGeneratedNamePart, + formatLocation: () => formatLocation, + formatMessage: () => formatMessage, + formatStringFromArgs: () => formatStringFromArgs, + formatting: () => ts_formatting_exports, + fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, + fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, + generateDjb2Hash: () => generateDjb2Hash, + generateTSConfig: () => generateTSConfig, + generatorHelper: () => generatorHelper, + getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, + getAdjustedRenameLocation: () => getAdjustedRenameLocation, + getAliasDeclarationFromName: () => getAliasDeclarationFromName, + getAllAccessorDeclarations: () => getAllAccessorDeclarations, + getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, + getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, + getAllJSDocTags: () => getAllJSDocTags, + getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, + getAllKeys: () => getAllKeys2, + getAllProjectOutputs: () => getAllProjectOutputs, + getAllSuperTypeNodes: () => getAllSuperTypeNodes, + getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, + getAllowJSCompilerOption: () => getAllowJSCompilerOption, + getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, + getAncestor: () => getAncestor, + getAnyExtensionFromPath: () => getAnyExtensionFromPath, + getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, + getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, + getAssignedName: () => getAssignedName, + getAssignedNameOfIdentifier: () => getAssignedNameOfIdentifier, + getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, + getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, + getAssignmentTargetKind: () => getAssignmentTargetKind, + getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, + getBaseFileName: () => getBaseFileName, + getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, + getBuildInfo: () => getBuildInfo, + getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, + getBuildInfoText: () => getBuildInfoText, + getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, + getBuilderCreationParameters: () => getBuilderCreationParameters, + getBuilderFileEmit: () => getBuilderFileEmit, + getCheckFlags: () => getCheckFlags, + getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, + getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, + getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, + getCombinedModifierFlags: () => getCombinedModifierFlags, + getCombinedNodeFlags: () => getCombinedNodeFlags, + getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, + getCommentRange: () => getCommentRange, + getCommonSourceDirectory: () => getCommonSourceDirectory, + getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, + getCompilerOptionValue: () => getCompilerOptionValue, + getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, + getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, + getConstantValue: () => getConstantValue, + getContainerFlags: () => getContainerFlags, + getContainerNode: () => getContainerNode, + getContainingClass: () => getContainingClass, + getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators, + getContainingClassStaticBlock: () => getContainingClassStaticBlock, + getContainingFunction: () => getContainingFunction, + getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, + getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, + getContainingNodeArray: () => getContainingNodeArray, + getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, + getContextualTypeFromParent: () => getContextualTypeFromParent, + getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, + getCurrentTime: () => getCurrentTime, + getDeclarationDiagnostics: () => getDeclarationDiagnostics, + getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, + getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, + getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, + getDeclarationFileExtension: () => getDeclarationFileExtension, + getDeclarationFromName: () => getDeclarationFromName, + getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, + getDeclarationOfKind: () => getDeclarationOfKind, + getDeclarationsOfKind: () => getDeclarationsOfKind, + getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, + getDecorators: () => getDecorators, + getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, + getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, + getDefaultLibFileName: () => getDefaultLibFileName, + getDefaultLibFilePath: () => getDefaultLibFilePath, + getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, + getDiagnosticText: () => getDiagnosticText, + getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, + getDirectoryPath: () => getDirectoryPath, + getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation, + getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot, + getDocumentPositionMapper: () => getDocumentPositionMapper, + getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer, + getESModuleInterop: () => getESModuleInterop, + getEditsForFileRename: () => getEditsForFileRename, + getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, + getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, + getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, + getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, + getEffectiveInitializer: () => getEffectiveInitializer, + getEffectiveJSDocHost: () => getEffectiveJSDocHost, + getEffectiveModifierFlags: () => getEffectiveModifierFlags, + getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, + getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, + getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, + getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, + getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, + getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, + getEffectiveTypeRoots: () => getEffectiveTypeRoots, + getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, + getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, + getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, + getEmitDeclarations: () => getEmitDeclarations, + getEmitFlags: () => getEmitFlags, + getEmitHelpers: () => getEmitHelpers, + getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, + getEmitModuleKind: () => getEmitModuleKind, + getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, + getEmitScriptTarget: () => getEmitScriptTarget, + getEmitStandardClassFields: () => getEmitStandardClassFields, + getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, + getEnclosingContainer: () => getEnclosingContainer, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, + getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, + getEndLinePosition: () => getEndLinePosition, + getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, + getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, + getErrorCountForSummary: () => getErrorCountForSummary, + getErrorSpanForNode: () => getErrorSpanForNode, + getErrorSummaryText: () => getErrorSummaryText, + getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, + getEscapedTextOfJsxAttributeName: () => getEscapedTextOfJsxAttributeName, + getEscapedTextOfJsxNamespacedName: () => getEscapedTextOfJsxNamespacedName, + getExpandoInitializer: () => getExpandoInitializer, + getExportAssignmentExpression: () => getExportAssignmentExpression, + getExportInfoMap: () => getExportInfoMap, + getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, + getExpressionAssociativity: () => getExpressionAssociativity, + getExpressionPrecedence: () => getExpressionPrecedence, + getExternalHelpersModuleName: () => getExternalHelpersModuleName, + getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, + getExternalModuleName: () => getExternalModuleName, + getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, + getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, + getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, + getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, + getFallbackOptions: () => getFallbackOptions, + getFileEmitOutput: () => getFileEmitOutput, + getFileMatcherPatterns: () => getFileMatcherPatterns, + getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, + getFileWatcherEventKind: () => getFileWatcherEventKind, + getFilesInErrorForSummary: () => getFilesInErrorForSummary, + getFirstConstructorWithBody: () => getFirstConstructorWithBody, + getFirstIdentifier: () => getFirstIdentifier, + getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, + getFirstProjectOutput: () => getFirstProjectOutput, + getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, + getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, + getFullWidth: () => getFullWidth, + getFunctionFlags: () => getFunctionFlags, + getHeritageClause: () => getHeritageClause, + getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, + getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, + getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, + getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, + getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, + getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, + getIndentSize: () => getIndentSize, + getIndentString: () => getIndentString, + getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, + getInitializedVariables: () => getInitializedVariables, + getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, + getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, + getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, + getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, + getJSDocAugmentsTag: () => getJSDocAugmentsTag, + getJSDocClassTag: () => getJSDocClassTag, + getJSDocCommentRanges: () => getJSDocCommentRanges, + getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, + getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, + getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, + getJSDocEnumTag: () => getJSDocEnumTag, + getJSDocHost: () => getJSDocHost, + getJSDocImplementsTags: () => getJSDocImplementsTags, + getJSDocOverloadTags: () => getJSDocOverloadTags, + getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, + getJSDocParameterTags: () => getJSDocParameterTags, + getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, + getJSDocPrivateTag: () => getJSDocPrivateTag, + getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, + getJSDocProtectedTag: () => getJSDocProtectedTag, + getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, + getJSDocPublicTag: () => getJSDocPublicTag, + getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, + getJSDocReadonlyTag: () => getJSDocReadonlyTag, + getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, + getJSDocReturnTag: () => getJSDocReturnTag, + getJSDocReturnType: () => getJSDocReturnType, + getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, + getJSDocTags: () => getJSDocTags, + getJSDocTagsNoCache: () => getJSDocTagsNoCache, + getJSDocTemplateTag: () => getJSDocTemplateTag, + getJSDocThisTag: () => getJSDocThisTag, + getJSDocType: () => getJSDocType, + getJSDocTypeAliasName: () => getJSDocTypeAliasName, + getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, + getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, + getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, + getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, + getJSDocTypeTag: () => getJSDocTypeTag, + getJSXImplicitImportBase: () => getJSXImplicitImportBase, + getJSXRuntimeImport: () => getJSXRuntimeImport, + getJSXTransformEnabled: () => getJSXTransformEnabled, + getKeyForCompilerOptions: () => getKeyForCompilerOptions, + getLanguageVariant: () => getLanguageVariant, + getLastChild: () => getLastChild, + getLeadingCommentRanges: () => getLeadingCommentRanges, + getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, + getLeftmostAccessExpression: () => getLeftmostAccessExpression, + getLeftmostExpression: () => getLeftmostExpression, + getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, + getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, + getLineInfo: () => getLineInfo, + getLineOfLocalPosition: () => getLineOfLocalPosition, + getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, + getLineStartPositionForPosition: () => getLineStartPositionForPosition, + getLineStarts: () => getLineStarts, + getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, + getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, + getLinesBetweenPositions: () => getLinesBetweenPositions, + getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, + getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, + getLiteralText: () => getLiteralText, + getLocalNameForExternalImport: () => getLocalNameForExternalImport, + getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, + getLocaleSpecificMessage: () => getLocaleSpecificMessage, + getLocaleTimeString: () => getLocaleTimeString, + getMappedContextSpan: () => getMappedContextSpan, + getMappedDocumentSpan: () => getMappedDocumentSpan, + getMappedLocation: () => getMappedLocation, + getMatchedFileSpec: () => getMatchedFileSpec, + getMatchedIncludeSpec: () => getMatchedIncludeSpec, + getMeaningFromDeclaration: () => getMeaningFromDeclaration, + getMeaningFromLocation: () => getMeaningFromLocation, + getMembersOfDeclaration: () => getMembersOfDeclaration, + getModeForFileReference: () => getModeForFileReference, + getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, + getModeForUsageLocation: () => getModeForUsageLocation, + getModifiedTime: () => getModifiedTime, + getModifiers: () => getModifiers, + getModuleInstanceState: () => getModuleInstanceState, + getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, + getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, + getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, + getNameForExportedSymbol: () => getNameForExportedSymbol, + getNameFromImportAttribute: () => getNameFromImportAttribute, + getNameFromIndexInfo: () => getNameFromIndexInfo, + getNameFromPropertyName: () => getNameFromPropertyName, + getNameOfAccessExpression: () => getNameOfAccessExpression, + getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, + getNameOfDeclaration: () => getNameOfDeclaration, + getNameOfExpando: () => getNameOfExpando, + getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, + getNameOrArgument: () => getNameOrArgument, + getNameTable: () => getNameTable, + getNamesForExportedSymbol: () => getNamesForExportedSymbol, + getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, + getNewLineCharacter: () => getNewLineCharacter, + getNewLineKind: () => getNewLineKind, + getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, + getNewTargetContainer: () => getNewTargetContainer, + getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, + getNodeForGeneratedName: () => getNodeForGeneratedName, + getNodeId: () => getNodeId, + getNodeKind: () => getNodeKind, + getNodeModifiers: () => getNodeModifiers, + getNodeModulePathParts: () => getNodeModulePathParts, + getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, + getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, + getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, + getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, + getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, + getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, + getNormalizedPathComponents: () => getNormalizedPathComponents, + getObjectFlags: () => getObjectFlags, + getOperator: () => getOperator, + getOperatorAssociativity: () => getOperatorAssociativity, + getOperatorPrecedence: () => getOperatorPrecedence, + getOptionFromName: () => getOptionFromName, + getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, + getOptionsNameMap: () => getOptionsNameMap, + getOrCreateEmitNode: () => getOrCreateEmitNode, + getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, + getOrUpdate: () => getOrUpdate, + getOriginalNode: () => getOriginalNode, + getOriginalNodeId: () => getOriginalNodeId, + getOriginalSourceFile: () => getOriginalSourceFile, + getOutputDeclarationFileName: () => getOutputDeclarationFileName, + getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, + getOutputExtension: () => getOutputExtension, + getOutputFileNames: () => getOutputFileNames, + getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, + getOutputPathsFor: () => getOutputPathsFor, + getOutputPathsForBundle: () => getOutputPathsForBundle, + getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, + getOwnKeys: () => getOwnKeys, + getOwnValues: () => getOwnValues, + getPackageJsonInfo: () => getPackageJsonInfo, + getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, + getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, + getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, + getPackageScopeForPath: () => getPackageScopeForPath, + getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, + getParameterTypeNode: () => getParameterTypeNode, + getParentNodeInSpan: () => getParentNodeInSpan, + getParseTreeNode: () => getParseTreeNode, + getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, + getPathComponents: () => getPathComponents, + getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, + getPathFromPathComponents: () => getPathFromPathComponents, + getPathUpdater: () => getPathUpdater, + getPathsBasePath: () => getPathsBasePath, + getPatternFromSpec: () => getPatternFromSpec, + getPendingEmitKind: () => getPendingEmitKind, + getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, + getPossibleGenericSignatures: () => getPossibleGenericSignatures, + getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, + getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, + getPreEmitDiagnostics: () => getPreEmitDiagnostics, + getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, + getProperties: () => getProperties, + getProperty: () => getProperty, + getPropertyArrayElementValue: () => getPropertyArrayElementValue, + getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, + getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, + getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, + getPropertyNameFromType: () => getPropertyNameFromType, + getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, + getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, + getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, + getQuoteFromPreference: () => getQuoteFromPreference, + getQuotePreference: () => getQuotePreference, + getRangesWhere: () => getRangesWhere, + getRefactorContextSpan: () => getRefactorContextSpan, + getReferencedFileLocation: () => getReferencedFileLocation, + getRegexFromPattern: () => getRegexFromPattern, + getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, + getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, + getRelativePathFromDirectory: () => getRelativePathFromDirectory, + getRelativePathFromFile: () => getRelativePathFromFile, + getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, + getRenameLocation: () => getRenameLocation, + getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, + getResolutionDiagnostic: () => getResolutionDiagnostic, + getResolutionModeOverride: () => getResolutionModeOverride, + getResolveJsonModule: () => getResolveJsonModule, + getResolvePackageJsonExports: () => getResolvePackageJsonExports, + getResolvePackageJsonImports: () => getResolvePackageJsonImports, + getResolvedExternalModuleName: () => getResolvedExternalModuleName, + getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, + getRestParameterElementType: () => getRestParameterElementType, + getRightMostAssignedExpression: () => getRightMostAssignedExpression, + getRootDeclaration: () => getRootDeclaration, + getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, + getRootLength: () => getRootLength, + getRootPathSplitLength: () => getRootPathSplitLength, + getScriptKind: () => getScriptKind, + getScriptKindFromFileName: () => getScriptKindFromFileName, + getScriptTargetFeatures: () => getScriptTargetFeatures, + getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, + getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, + getSemanticClassifications: () => getSemanticClassifications, + getSemanticJsxChildren: () => getSemanticJsxChildren, + getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, + getSetAccessorValueParameter: () => getSetAccessorValueParameter, + getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, + getShebang: () => getShebang, + getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, + getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, + getSnapshotText: () => getSnapshotText, + getSnippetElement: () => getSnippetElement, + getSourceFileOfModule: () => getSourceFileOfModule, + getSourceFileOfNode: () => getSourceFileOfNode, + getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, + getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, + getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, + getSourceFilesToEmit: () => getSourceFilesToEmit, + getSourceMapRange: () => getSourceMapRange, + getSourceMapper: () => getSourceMapper, + getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, + getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, + getSpellingSuggestion: () => getSpellingSuggestion, + getStartPositionOfLine: () => getStartPositionOfLine, + getStartPositionOfRange: () => getStartPositionOfRange, + getStartsOnNewLine: () => getStartsOnNewLine, + getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, + getStrictOptionValue: () => getStrictOptionValue, + getStringComparer: () => getStringComparer, + getSubPatternFromSpec: () => getSubPatternFromSpec, + getSuperCallFromStatement: () => getSuperCallFromStatement, + getSuperContainer: () => getSuperContainer, + getSupportedCodeFixes: () => getSupportedCodeFixes, + getSupportedExtensions: () => getSupportedExtensions, + getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, + getSwitchedType: () => getSwitchedType, + getSymbolId: () => getSymbolId, + getSymbolNameForPrivateIdentifier: () => getSymbolNameForPrivateIdentifier, + getSymbolTarget: () => getSymbolTarget, + getSyntacticClassifications: () => getSyntacticClassifications, + getSyntacticModifierFlags: () => getSyntacticModifierFlags, + getSyntacticModifierFlagsNoCache: () => getSyntacticModifierFlagsNoCache, + getSynthesizedDeepClone: () => getSynthesizedDeepClone, + getSynthesizedDeepCloneWithReplacements: () => getSynthesizedDeepCloneWithReplacements, + getSynthesizedDeepClones: () => getSynthesizedDeepClones, + getSynthesizedDeepClonesWithReplacements: () => getSynthesizedDeepClonesWithReplacements, + getSyntheticLeadingComments: () => getSyntheticLeadingComments, + getSyntheticTrailingComments: () => getSyntheticTrailingComments, + getTargetLabel: () => getTargetLabel, + getTargetOfBindingOrAssignmentElement: () => getTargetOfBindingOrAssignmentElement, + getTemporaryModuleResolutionState: () => getTemporaryModuleResolutionState, + getTextOfConstantValue: () => getTextOfConstantValue, + getTextOfIdentifierOrLiteral: () => getTextOfIdentifierOrLiteral, + getTextOfJSDocComment: () => getTextOfJSDocComment, + getTextOfJsxAttributeName: () => getTextOfJsxAttributeName, + getTextOfJsxNamespacedName: () => getTextOfJsxNamespacedName, + getTextOfNode: () => getTextOfNode, + getTextOfNodeFromSourceText: () => getTextOfNodeFromSourceText, + getTextOfPropertyName: () => getTextOfPropertyName, + getThisContainer: () => getThisContainer, + getThisParameter: () => getThisParameter, + getTokenAtPosition: () => getTokenAtPosition, + getTokenPosOfNode: () => getTokenPosOfNode, + getTokenSourceMapRange: () => getTokenSourceMapRange, + getTouchingPropertyName: () => getTouchingPropertyName, + getTouchingToken: () => getTouchingToken, + getTrailingCommentRanges: () => getTrailingCommentRanges, + getTrailingSemicolonDeferringWriter: () => getTrailingSemicolonDeferringWriter, + getTransformFlagsSubtreeExclusions: () => getTransformFlagsSubtreeExclusions, + getTransformers: () => getTransformers, + getTsBuildInfoEmitOutputFilePath: () => getTsBuildInfoEmitOutputFilePath, + getTsConfigObjectLiteralExpression: () => getTsConfigObjectLiteralExpression, + getTsConfigPropArrayElementValue: () => getTsConfigPropArrayElementValue, + getTypeAnnotationNode: () => getTypeAnnotationNode, + getTypeArgumentOrTypeParameterList: () => getTypeArgumentOrTypeParameterList, + getTypeKeywordOfTypeOnlyImport: () => getTypeKeywordOfTypeOnlyImport, + getTypeNode: () => getTypeNode, + getTypeNodeIfAccessible: () => getTypeNodeIfAccessible, + getTypeParameterFromJsDoc: () => getTypeParameterFromJsDoc, + getTypeParameterOwner: () => getTypeParameterOwner, + getTypesPackageName: () => getTypesPackageName, + getUILocale: () => getUILocale, + getUniqueName: () => getUniqueName, + getUniqueSymbolId: () => getUniqueSymbolId, + getUseDefineForClassFields: () => getUseDefineForClassFields, + getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, + getWatchFactory: () => getWatchFactory, + group: () => group2, + groupBy: () => groupBy2, + guessIndentation: () => guessIndentation, + handleNoEmitOptions: () => handleNoEmitOptions, + hasAbstractModifier: () => hasAbstractModifier, + hasAccessorModifier: () => hasAccessorModifier, + hasAmbientModifier: () => hasAmbientModifier, + hasChangesInResolutions: () => hasChangesInResolutions, + hasChildOfKind: () => hasChildOfKind, + hasContextSensitiveParameters: () => hasContextSensitiveParameters, + hasDecorators: () => hasDecorators, + hasDocComment: () => hasDocComment, + hasDynamicName: () => hasDynamicName, + hasEffectiveModifier: () => hasEffectiveModifier, + hasEffectiveModifiers: () => hasEffectiveModifiers, + hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, + hasExtension: () => hasExtension, + hasIndexSignature: () => hasIndexSignature, + hasInitializer: () => hasInitializer, + hasInvalidEscape: () => hasInvalidEscape, + hasJSDocNodes: () => hasJSDocNodes, + hasJSDocParameterTags: () => hasJSDocParameterTags, + hasJSFileExtension: () => hasJSFileExtension, + hasJsonModuleEmitEnabled: () => hasJsonModuleEmitEnabled, + hasOnlyExpressionInitializer: () => hasOnlyExpressionInitializer, + hasOverrideModifier: () => hasOverrideModifier, + hasPossibleExternalModuleReference: () => hasPossibleExternalModuleReference, + hasProperty: () => hasProperty, + hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, + hasQuestionToken: () => hasQuestionToken, + hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, + hasResolutionModeOverride: () => hasResolutionModeOverride, + hasRestParameter: () => hasRestParameter, + hasScopeMarker: () => hasScopeMarker, + hasStaticModifier: () => hasStaticModifier, + hasSyntacticModifier: () => hasSyntacticModifier, + hasSyntacticModifiers: () => hasSyntacticModifiers, + hasTSFileExtension: () => hasTSFileExtension, + hasTabstop: () => hasTabstop, + hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator, + hasType: () => hasType, + hasTypeArguments: () => hasTypeArguments, + hasZeroOrOneAsteriskCharacter: () => hasZeroOrOneAsteriskCharacter, + helperString: () => helperString, + hostGetCanonicalFileName: () => hostGetCanonicalFileName, + hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, + idText: () => idText, + identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, + identity: () => identity2, + identitySourceMapConsumer: () => identitySourceMapConsumer, + ignoreSourceNewlines: () => ignoreSourceNewlines, + ignoredPaths: () => ignoredPaths, + importDefaultHelper: () => importDefaultHelper, + importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, + importStarHelper: () => importStarHelper, + indexOfAnyCharCode: () => indexOfAnyCharCode, + indexOfNode: () => indexOfNode, + indicesOf: () => indicesOf, + inferredTypesContainingFile: () => inferredTypesContainingFile, + injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, + injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, + insertImports: () => insertImports, + insertLeadingStatement: () => insertLeadingStatement, + insertSorted: () => insertSorted, + insertStatementAfterCustomPrologue: () => insertStatementAfterCustomPrologue, + insertStatementAfterStandardPrologue: () => insertStatementAfterStandardPrologue, + insertStatementsAfterCustomPrologue: () => insertStatementsAfterCustomPrologue, + insertStatementsAfterStandardPrologue: () => insertStatementsAfterStandardPrologue, + intersperse: () => intersperse, + intrinsicTagNameToString: () => intrinsicTagNameToString, + introducesArgumentsExoticObject: () => introducesArgumentsExoticObject, + inverseJsxOptionMap: () => inverseJsxOptionMap, + isAbstractConstructorSymbol: () => isAbstractConstructorSymbol, + isAbstractModifier: () => isAbstractModifier, + isAccessExpression: () => isAccessExpression, + isAccessibilityModifier: () => isAccessibilityModifier, + isAccessor: () => isAccessor, + isAccessorModifier: () => isAccessorModifier, + isAliasSymbolDeclaration: () => isAliasSymbolDeclaration, + isAliasableExpression: () => isAliasableExpression, + isAmbientModule: () => isAmbientModule, + isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, + isAnyDirectorySeparator: () => isAnyDirectorySeparator, + isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, + isAnyImportOrReExport: () => isAnyImportOrReExport, + isAnyImportSyntax: () => isAnyImportSyntax, + isAnySupportedFileExtension: () => isAnySupportedFileExtension, + isApplicableVersionedTypesKey: () => isApplicableVersionedTypesKey, + isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, + isArray: () => isArray3, + isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, + isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, + isArrayBindingPattern: () => isArrayBindingPattern, + isArrayLiteralExpression: () => isArrayLiteralExpression, + isArrayLiteralOrObjectLiteralDestructuringPattern: () => isArrayLiteralOrObjectLiteralDestructuringPattern, + isArrayTypeNode: () => isArrayTypeNode, + isArrowFunction: () => isArrowFunction, + isAsExpression: () => isAsExpression, + isAssertClause: () => isAssertClause, + isAssertEntry: () => isAssertEntry, + isAssertionExpression: () => isAssertionExpression, + isAssertsKeyword: () => isAssertsKeyword, + isAssignmentDeclaration: () => isAssignmentDeclaration, + isAssignmentExpression: () => isAssignmentExpression, + isAssignmentOperator: () => isAssignmentOperator, + isAssignmentPattern: () => isAssignmentPattern, + isAssignmentTarget: () => isAssignmentTarget, + isAsteriskToken: () => isAsteriskToken, + isAsyncFunction: () => isAsyncFunction, + isAsyncModifier: () => isAsyncModifier, + isAutoAccessorPropertyDeclaration: () => isAutoAccessorPropertyDeclaration, + isAwaitExpression: () => isAwaitExpression, + isAwaitKeyword: () => isAwaitKeyword, + isBigIntLiteral: () => isBigIntLiteral, + isBinaryExpression: () => isBinaryExpression, + isBinaryOperatorToken: () => isBinaryOperatorToken, + isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, + isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, + isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, + isBindableStaticNameExpression: () => isBindableStaticNameExpression, + isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, + isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, + isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, + isBindingPattern: () => isBindingPattern, + isBlock: () => isBlock2, + isBlockOrCatchScoped: () => isBlockOrCatchScoped, + isBlockScope: () => isBlockScope, + isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, + isBooleanLiteral: () => isBooleanLiteral, + isBreakOrContinueStatement: () => isBreakOrContinueStatement, + isBreakStatement: () => isBreakStatement, + isBuildInfoFile: () => isBuildInfoFile, + isBuilderProgram: () => isBuilderProgram2, + isBundle: () => isBundle, + isBundleFileTextLike: () => isBundleFileTextLike, + isCallChain: () => isCallChain, + isCallExpression: () => isCallExpression, + isCallExpressionTarget: () => isCallExpressionTarget, + isCallLikeExpression: () => isCallLikeExpression, + isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression, + isCallOrNewExpression: () => isCallOrNewExpression, + isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, + isCallSignatureDeclaration: () => isCallSignatureDeclaration, + isCallToHelper: () => isCallToHelper, + isCaseBlock: () => isCaseBlock, + isCaseClause: () => isCaseClause, + isCaseKeyword: () => isCaseKeyword, + isCaseOrDefaultClause: () => isCaseOrDefaultClause, + isCatchClause: () => isCatchClause, + isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration, + isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement, + isCheckJsEnabledForFile: () => isCheckJsEnabledForFile, + isChildOfNodeWithKind: () => isChildOfNodeWithKind, + isCircularBuildOrder: () => isCircularBuildOrder, + isClassDeclaration: () => isClassDeclaration, + isClassElement: () => isClassElement, + isClassExpression: () => isClassExpression, + isClassInstanceProperty: () => isClassInstanceProperty, + isClassLike: () => isClassLike, + isClassMemberModifier: () => isClassMemberModifier, + isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, + isClassOrTypeElement: () => isClassOrTypeElement, + isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, + isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, + isCollapsedRange: () => isCollapsedRange, + isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, + isCommaListExpression: () => isCommaListExpression, + isCommaSequence: () => isCommaSequence, + isCommaToken: () => isCommaToken, + isComment: () => isComment, + isCommonJsExportPropertyAssignment: () => isCommonJsExportPropertyAssignment, + isCommonJsExportedExpression: () => isCommonJsExportedExpression, + isCompoundAssignment: () => isCompoundAssignment, + isComputedNonLiteralName: () => isComputedNonLiteralName, + isComputedPropertyName: () => isComputedPropertyName, + isConciseBody: () => isConciseBody, + isConditionalExpression: () => isConditionalExpression, + isConditionalTypeNode: () => isConditionalTypeNode, + isConstTypeReference: () => isConstTypeReference, + isConstructSignatureDeclaration: () => isConstructSignatureDeclaration, + isConstructorDeclaration: () => isConstructorDeclaration, + isConstructorTypeNode: () => isConstructorTypeNode, + isContextualKeyword: () => isContextualKeyword, + isContinueStatement: () => isContinueStatement, + isCustomPrologue: () => isCustomPrologue, + isDebuggerStatement: () => isDebuggerStatement, + isDeclaration: () => isDeclaration, + isDeclarationBindingElement: () => isDeclarationBindingElement, + isDeclarationFileName: () => isDeclarationFileName, + isDeclarationName: () => isDeclarationName, + isDeclarationNameOfEnumOrNamespace: () => isDeclarationNameOfEnumOrNamespace, + isDeclarationReadonly: () => isDeclarationReadonly, + isDeclarationStatement: () => isDeclarationStatement, + isDeclarationWithTypeParameterChildren: () => isDeclarationWithTypeParameterChildren, + isDeclarationWithTypeParameters: () => isDeclarationWithTypeParameters, + isDecorator: () => isDecorator, + isDecoratorTarget: () => isDecoratorTarget, + isDefaultClause: () => isDefaultClause, + isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, + isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, + isDeleteExpression: () => isDeleteExpression, + isDeleteTarget: () => isDeleteTarget, + isDeprecatedDeclaration: () => isDeprecatedDeclaration, + isDestructuringAssignment: () => isDestructuringAssignment, + isDiagnosticWithLocation: () => isDiagnosticWithLocation, + isDiskPathRoot: () => isDiskPathRoot, + isDoStatement: () => isDoStatement, + isDocumentRegistryEntry: () => isDocumentRegistryEntry, + isDotDotDotToken: () => isDotDotDotToken, + isDottedName: () => isDottedName, + isDynamicName: () => isDynamicName, + isESSymbolIdentifier: () => isESSymbolIdentifier, + isEffectiveExternalModule: () => isEffectiveExternalModule, + isEffectiveModuleDeclaration: () => isEffectiveModuleDeclaration, + isEffectiveStrictModeSourceFile: () => isEffectiveStrictModeSourceFile, + isElementAccessChain: () => isElementAccessChain, + isElementAccessExpression: () => isElementAccessExpression, + isEmittedFileOfProgram: () => isEmittedFileOfProgram, + isEmptyArrayLiteral: () => isEmptyArrayLiteral, + isEmptyBindingElement: () => isEmptyBindingElement, + isEmptyBindingPattern: () => isEmptyBindingPattern, + isEmptyObjectLiteral: () => isEmptyObjectLiteral, + isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, + isEntityName: () => isEntityName, + isEntityNameExpression: () => isEntityNameExpression, + isEnumConst: () => isEnumConst, + isEnumDeclaration: () => isEnumDeclaration, + isEnumMember: () => isEnumMember, + isEqualityOperatorKind: () => isEqualityOperatorKind, + isEqualsGreaterThanToken: () => isEqualsGreaterThanToken, + isExclamationToken: () => isExclamationToken, + isExcludedFile: () => isExcludedFile, + isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, + isExpandoPropertyDeclaration: () => isExpandoPropertyDeclaration, + isExportAssignment: () => isExportAssignment, + isExportDeclaration: () => isExportDeclaration, + isExportModifier: () => isExportModifier, + isExportName: () => isExportName, + isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, + isExportSpecifier: () => isExportSpecifier, + isExportsIdentifier: () => isExportsIdentifier, + isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, + isExpression: () => isExpression, + isExpressionNode: () => isExpressionNode, + isExpressionOfExternalModuleImportEqualsDeclaration: () => isExpressionOfExternalModuleImportEqualsDeclaration, + isExpressionOfOptionalChainRoot: () => isExpressionOfOptionalChainRoot, + isExpressionStatement: () => isExpressionStatement, + isExpressionWithTypeArguments: () => isExpressionWithTypeArguments, + isExpressionWithTypeArgumentsInClassExtendsClause: () => isExpressionWithTypeArgumentsInClassExtendsClause, + isExternalModule: () => isExternalModule, + isExternalModuleAugmentation: () => isExternalModuleAugmentation, + isExternalModuleImportEqualsDeclaration: () => isExternalModuleImportEqualsDeclaration, + isExternalModuleIndicator: () => isExternalModuleIndicator, + isExternalModuleNameRelative: () => isExternalModuleNameRelative, + isExternalModuleReference: () => isExternalModuleReference, + isExternalModuleSymbol: () => isExternalModuleSymbol, + isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, + isFileLevelReservedGeneratedIdentifier: () => isFileLevelReservedGeneratedIdentifier, + isFileLevelUniqueName: () => isFileLevelUniqueName, + isFileProbablyExternalModule: () => isFileProbablyExternalModule, + isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, + isFixablePromiseHandler: () => isFixablePromiseHandler, + isForInOrOfStatement: () => isForInOrOfStatement, + isForInStatement: () => isForInStatement, + isForInitializer: () => isForInitializer, + isForOfStatement: () => isForOfStatement, + isForStatement: () => isForStatement, + isFunctionBlock: () => isFunctionBlock, + isFunctionBody: () => isFunctionBody, + isFunctionDeclaration: () => isFunctionDeclaration, + isFunctionExpression: () => isFunctionExpression, + isFunctionExpressionOrArrowFunction: () => isFunctionExpressionOrArrowFunction, + isFunctionLike: () => isFunctionLike, + isFunctionLikeDeclaration: () => isFunctionLikeDeclaration, + isFunctionLikeKind: () => isFunctionLikeKind, + isFunctionLikeOrClassStaticBlockDeclaration: () => isFunctionLikeOrClassStaticBlockDeclaration, + isFunctionOrConstructorTypeNode: () => isFunctionOrConstructorTypeNode, + isFunctionOrModuleBlock: () => isFunctionOrModuleBlock, + isFunctionSymbol: () => isFunctionSymbol, + isFunctionTypeNode: () => isFunctionTypeNode, + isFutureReservedKeyword: () => isFutureReservedKeyword, + isGeneratedIdentifier: () => isGeneratedIdentifier, + isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, + isGetAccessor: () => isGetAccessor, + isGetAccessorDeclaration: () => isGetAccessorDeclaration, + isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, + isGlobalDeclaration: () => isGlobalDeclaration, + isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, + isHeritageClause: () => isHeritageClause, + isHoistedFunction: () => isHoistedFunction, + isHoistedVariableStatement: () => isHoistedVariableStatement, + isIdentifier: () => isIdentifier, + isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, + isIdentifierName: () => isIdentifierName, + isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, + isIdentifierPart: () => isIdentifierPart, + isIdentifierStart: () => isIdentifierStart, + isIdentifierText: () => isIdentifierText, + isIdentifierTypePredicate: () => isIdentifierTypePredicate, + isIdentifierTypeReference: () => isIdentifierTypeReference, + isIfStatement: () => isIfStatement, + isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, + isImplicitGlob: () => isImplicitGlob, + isImportAttribute: () => isImportAttribute, + isImportAttributeName: () => isImportAttributeName, + isImportAttributes: () => isImportAttributes, + isImportCall: () => isImportCall, + isImportClause: () => isImportClause, + isImportDeclaration: () => isImportDeclaration, + isImportEqualsDeclaration: () => isImportEqualsDeclaration, + isImportKeyword: () => isImportKeyword, + isImportMeta: () => isImportMeta, + isImportOrExportSpecifier: () => isImportOrExportSpecifier, + isImportOrExportSpecifierName: () => isImportOrExportSpecifierName, + isImportSpecifier: () => isImportSpecifier, + isImportTypeAssertionContainer: () => isImportTypeAssertionContainer, + isImportTypeNode: () => isImportTypeNode, + isImportableFile: () => isImportableFile, + isInComment: () => isInComment, + isInCompoundLikeAssignment: () => isInCompoundLikeAssignment, + isInExpressionContext: () => isInExpressionContext, + isInJSDoc: () => isInJSDoc, + isInJSFile: () => isInJSFile, + isInJSXText: () => isInJSXText, + isInJsonFile: () => isInJsonFile, + isInNonReferenceComment: () => isInNonReferenceComment, + isInReferenceComment: () => isInReferenceComment, + isInRightSideOfInternalImportEqualsDeclaration: () => isInRightSideOfInternalImportEqualsDeclaration, + isInString: () => isInString, + isInTemplateString: () => isInTemplateString, + isInTopLevelContext: () => isInTopLevelContext, + isInTypeQuery: () => isInTypeQuery, + isIncrementalCompilation: () => isIncrementalCompilation, + isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, + isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, + isInferTypeNode: () => isInferTypeNode, + isInfinityOrNaNString: () => isInfinityOrNaNString, + isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, + isInsideJsxElement: () => isInsideJsxElement, + isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, + isInsideNodeModules: () => isInsideNodeModules, + isInsideTemplateLiteral: () => isInsideTemplateLiteral, + isInstanceOfExpression: () => isInstanceOfExpression, + isInstantiatedModule: () => isInstantiatedModule, + isInterfaceDeclaration: () => isInterfaceDeclaration, + isInternalDeclaration: () => isInternalDeclaration, + isInternalModuleImportEqualsDeclaration: () => isInternalModuleImportEqualsDeclaration, + isInternalName: () => isInternalName, + isIntersectionTypeNode: () => isIntersectionTypeNode, + isIntrinsicJsxName: () => isIntrinsicJsxName, + isIterationStatement: () => isIterationStatement, + isJSDoc: () => isJSDoc, + isJSDocAllType: () => isJSDocAllType, + isJSDocAugmentsTag: () => isJSDocAugmentsTag, + isJSDocAuthorTag: () => isJSDocAuthorTag, + isJSDocCallbackTag: () => isJSDocCallbackTag, + isJSDocClassTag: () => isJSDocClassTag, + isJSDocCommentContainingNode: () => isJSDocCommentContainingNode, + isJSDocConstructSignature: () => isJSDocConstructSignature, + isJSDocDeprecatedTag: () => isJSDocDeprecatedTag, + isJSDocEnumTag: () => isJSDocEnumTag, + isJSDocFunctionType: () => isJSDocFunctionType, + isJSDocImplementsTag: () => isJSDocImplementsTag, + isJSDocIndexSignature: () => isJSDocIndexSignature, + isJSDocLikeText: () => isJSDocLikeText, + isJSDocLink: () => isJSDocLink, + isJSDocLinkCode: () => isJSDocLinkCode, + isJSDocLinkLike: () => isJSDocLinkLike, + isJSDocLinkPlain: () => isJSDocLinkPlain, + isJSDocMemberName: () => isJSDocMemberName, + isJSDocNameReference: () => isJSDocNameReference, + isJSDocNamepathType: () => isJSDocNamepathType, + isJSDocNamespaceBody: () => isJSDocNamespaceBody, + isJSDocNode: () => isJSDocNode, + isJSDocNonNullableType: () => isJSDocNonNullableType, + isJSDocNullableType: () => isJSDocNullableType, + isJSDocOptionalParameter: () => isJSDocOptionalParameter, + isJSDocOptionalType: () => isJSDocOptionalType, + isJSDocOverloadTag: () => isJSDocOverloadTag, + isJSDocOverrideTag: () => isJSDocOverrideTag, + isJSDocParameterTag: () => isJSDocParameterTag, + isJSDocPrivateTag: () => isJSDocPrivateTag, + isJSDocPropertyLikeTag: () => isJSDocPropertyLikeTag, + isJSDocPropertyTag: () => isJSDocPropertyTag, + isJSDocProtectedTag: () => isJSDocProtectedTag, + isJSDocPublicTag: () => isJSDocPublicTag, + isJSDocReadonlyTag: () => isJSDocReadonlyTag, + isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, + isJSDocSeeTag: () => isJSDocSeeTag, + isJSDocSignature: () => isJSDocSignature, + isJSDocTag: () => isJSDocTag, + isJSDocTemplateTag: () => isJSDocTemplateTag, + isJSDocThisTag: () => isJSDocThisTag, + isJSDocThrowsTag: () => isJSDocThrowsTag, + isJSDocTypeAlias: () => isJSDocTypeAlias, + isJSDocTypeAssertion: () => isJSDocTypeAssertion, + isJSDocTypeExpression: () => isJSDocTypeExpression, + isJSDocTypeLiteral: () => isJSDocTypeLiteral, + isJSDocTypeTag: () => isJSDocTypeTag, + isJSDocTypedefTag: () => isJSDocTypedefTag, + isJSDocUnknownTag: () => isJSDocUnknownTag, + isJSDocUnknownType: () => isJSDocUnknownType, + isJSDocVariadicType: () => isJSDocVariadicType, + isJSXTagName: () => isJSXTagName, + isJsonEqual: () => isJsonEqual, + isJsonSourceFile: () => isJsonSourceFile, + isJsxAttribute: () => isJsxAttribute, + isJsxAttributeLike: () => isJsxAttributeLike, + isJsxAttributeName: () => isJsxAttributeName, + isJsxAttributes: () => isJsxAttributes, + isJsxChild: () => isJsxChild, + isJsxClosingElement: () => isJsxClosingElement, + isJsxClosingFragment: () => isJsxClosingFragment, + isJsxElement: () => isJsxElement, + isJsxExpression: () => isJsxExpression, + isJsxFragment: () => isJsxFragment, + isJsxNamespacedName: () => isJsxNamespacedName, + isJsxOpeningElement: () => isJsxOpeningElement, + isJsxOpeningFragment: () => isJsxOpeningFragment, + isJsxOpeningLikeElement: () => isJsxOpeningLikeElement, + isJsxOpeningLikeElementTagName: () => isJsxOpeningLikeElementTagName, + isJsxSelfClosingElement: () => isJsxSelfClosingElement, + isJsxSpreadAttribute: () => isJsxSpreadAttribute, + isJsxTagNameExpression: () => isJsxTagNameExpression, + isJsxText: () => isJsxText, + isJumpStatementTarget: () => isJumpStatementTarget, + isKeyword: () => isKeyword, + isKeywordOrPunctuation: () => isKeywordOrPunctuation, + isKnownSymbol: () => isKnownSymbol, + isLabelName: () => isLabelName, + isLabelOfLabeledStatement: () => isLabelOfLabeledStatement, + isLabeledStatement: () => isLabeledStatement, + isLateVisibilityPaintedStatement: () => isLateVisibilityPaintedStatement, + isLeftHandSideExpression: () => isLeftHandSideExpression, + isLeftHandSideOfAssignment: () => isLeftHandSideOfAssignment, + isLet: () => isLet, + isLineBreak: () => isLineBreak2, + isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, + isLiteralExpression: () => isLiteralExpression, + isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, + isLiteralImportTypeNode: () => isLiteralImportTypeNode, + isLiteralKind: () => isLiteralKind, + isLiteralLikeAccess: () => isLiteralLikeAccess, + isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, + isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, + isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, + isLiteralTypeNode: () => isLiteralTypeNode, + isLocalName: () => isLocalName, + isLogicalOperator: () => isLogicalOperator, + isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, + isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, + isMappedTypeNode: () => isMappedTypeNode, + isMemberName: () => isMemberName, + isMetaProperty: () => isMetaProperty, + isMethodDeclaration: () => isMethodDeclaration, + isMethodOrAccessor: () => isMethodOrAccessor, + isMethodSignature: () => isMethodSignature, + isMinusToken: () => isMinusToken, + isMissingDeclaration: () => isMissingDeclaration, + isMissingPackageJsonInfo: () => isMissingPackageJsonInfo, + isModifier: () => isModifier, + isModifierKind: () => isModifierKind, + isModifierLike: () => isModifierLike, + isModuleAugmentationExternal: () => isModuleAugmentationExternal, + isModuleBlock: () => isModuleBlock, + isModuleBody: () => isModuleBody, + isModuleDeclaration: () => isModuleDeclaration, + isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, + isModuleIdentifier: () => isModuleIdentifier, + isModuleName: () => isModuleName, + isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, + isModuleReference: () => isModuleReference, + isModuleSpecifierLike: () => isModuleSpecifierLike, + isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, + isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, + isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, + isNamedClassElement: () => isNamedClassElement, + isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, + isNamedExportBindings: () => isNamedExportBindings, + isNamedExports: () => isNamedExports, + isNamedImportBindings: () => isNamedImportBindings, + isNamedImports: () => isNamedImports, + isNamedImportsOrExports: () => isNamedImportsOrExports, + isNamedTupleMember: () => isNamedTupleMember, + isNamespaceBody: () => isNamespaceBody, + isNamespaceExport: () => isNamespaceExport, + isNamespaceExportDeclaration: () => isNamespaceExportDeclaration, + isNamespaceImport: () => isNamespaceImport, + isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, + isNewExpression: () => isNewExpression, + isNewExpressionTarget: () => isNewExpressionTarget, + isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, + isNode: () => isNode2, + isNodeArray: () => isNodeArray, + isNodeArrayMultiLine: () => isNodeArrayMultiLine, + isNodeDescendantOf: () => isNodeDescendantOf, + isNodeKind: () => isNodeKind, + isNodeLikeSystem: () => isNodeLikeSystem, + isNodeModulesDirectory: () => isNodeModulesDirectory, + isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, + isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, + isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, + isNonGlobalDeclaration: () => isNonGlobalDeclaration, + isNonNullAccess: () => isNonNullAccess, + isNonNullChain: () => isNonNullChain, + isNonNullExpression: () => isNonNullExpression, + isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, + isNotEmittedOrPartiallyEmittedNode: () => isNotEmittedOrPartiallyEmittedNode, + isNotEmittedStatement: () => isNotEmittedStatement, + isNullishCoalesce: () => isNullishCoalesce, + isNumber: () => isNumber3, + isNumericLiteral: () => isNumericLiteral, + isNumericLiteralName: () => isNumericLiteralName, + isObjectBindingElementWithoutPropertyName: () => isObjectBindingElementWithoutPropertyName, + isObjectBindingOrAssignmentElement: () => isObjectBindingOrAssignmentElement, + isObjectBindingOrAssignmentPattern: () => isObjectBindingOrAssignmentPattern, + isObjectBindingPattern: () => isObjectBindingPattern, + isObjectLiteralElement: () => isObjectLiteralElement, + isObjectLiteralElementLike: () => isObjectLiteralElementLike, + isObjectLiteralExpression: () => isObjectLiteralExpression, + isObjectLiteralMethod: () => isObjectLiteralMethod, + isObjectLiteralOrClassExpressionMethodOrAccessor: () => isObjectLiteralOrClassExpressionMethodOrAccessor, + isObjectTypeDeclaration: () => isObjectTypeDeclaration, + isOctalDigit: () => isOctalDigit, + isOmittedExpression: () => isOmittedExpression, + isOptionalChain: () => isOptionalChain, + isOptionalChainRoot: () => isOptionalChainRoot, + isOptionalDeclaration: () => isOptionalDeclaration, + isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, + isOptionalTypeNode: () => isOptionalTypeNode, + isOuterExpression: () => isOuterExpression, + isOutermostOptionalChain: () => isOutermostOptionalChain, + isOverrideModifier: () => isOverrideModifier, + isPackageJsonInfo: () => isPackageJsonInfo, + isPackedArrayLiteral: () => isPackedArrayLiteral, + isParameter: () => isParameter, + isParameterDeclaration: () => isParameterDeclaration, + isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, + isParameterPropertyModifier: () => isParameterPropertyModifier, + isParenthesizedExpression: () => isParenthesizedExpression, + isParenthesizedTypeNode: () => isParenthesizedTypeNode, + isParseTreeNode: () => isParseTreeNode, + isPartOfTypeNode: () => isPartOfTypeNode, + isPartOfTypeQuery: () => isPartOfTypeQuery, + isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, + isPatternMatch: () => isPatternMatch, + isPinnedComment: () => isPinnedComment, + isPlainJsFile: () => isPlainJsFile, + isPlusToken: () => isPlusToken, + isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, + isPostfixUnaryExpression: () => isPostfixUnaryExpression, + isPrefixUnaryExpression: () => isPrefixUnaryExpression, + isPrivateIdentifier: () => isPrivateIdentifier, + isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, + isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, + isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, + isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo, + isProgramUptoDate: () => isProgramUptoDate, + isPrologueDirective: () => isPrologueDirective, + isPropertyAccessChain: () => isPropertyAccessChain, + isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, + isPropertyAccessExpression: () => isPropertyAccessExpression, + isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, + isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, + isPropertyAssignment: () => isPropertyAssignment, + isPropertyDeclaration: () => isPropertyDeclaration, + isPropertyName: () => isPropertyName, + isPropertyNameLiteral: () => isPropertyNameLiteral, + isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, + isPrototypeAccess: () => isPrototypeAccess, + isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, + isPunctuation: () => isPunctuation, + isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, + isQualifiedName: () => isQualifiedName, + isQuestionDotToken: () => isQuestionDotToken, + isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, + isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, + isQuestionToken: () => isQuestionToken, + isRawSourceMap: () => isRawSourceMap, + isReadonlyKeyword: () => isReadonlyKeyword, + isReadonlyKeywordOrPlusOrMinusToken: () => isReadonlyKeywordOrPlusOrMinusToken, + isRecognizedTripleSlashComment: () => isRecognizedTripleSlashComment, + isReferenceFileLocation: () => isReferenceFileLocation, + isReferencedFile: () => isReferencedFile, + isRegularExpressionLiteral: () => isRegularExpressionLiteral, + isRequireCall: () => isRequireCall, + isRequireVariableStatement: () => isRequireVariableStatement, + isRestParameter: () => isRestParameter, + isRestTypeNode: () => isRestTypeNode, + isReturnStatement: () => isReturnStatement, + isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, + isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, + isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression, + isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, + isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, + isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, + isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName, + isRootedDiskPath: () => isRootedDiskPath, + isSameEntityName: () => isSameEntityName, + isSatisfiesExpression: () => isSatisfiesExpression, + isScopeMarker: () => isScopeMarker, + isSemicolonClassElement: () => isSemicolonClassElement, + isSetAccessor: () => isSetAccessor, + isSetAccessorDeclaration: () => isSetAccessorDeclaration, + isShebangTrivia: () => isShebangTrivia, + isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, + isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, + isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, + isSignedNumericLiteral: () => isSignedNumericLiteral, + isSimpleCopiableExpression: () => isSimpleCopiableExpression, + isSimpleInlineableExpression: () => isSimpleInlineableExpression, + isSimpleParameter: () => isSimpleParameter, + isSimpleParameterList: () => isSimpleParameterList, + isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, + isSourceFile: () => isSourceFile, + isSourceFileFromLibrary: () => isSourceFileFromLibrary, + isSourceFileJS: () => isSourceFileJS, + isSourceFileNotJS: () => isSourceFileNotJS, + isSourceFileNotJson: () => isSourceFileNotJson, + isSourceMapping: () => isSourceMapping, + isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, + isSpreadAssignment: () => isSpreadAssignment, + isSpreadElement: () => isSpreadElement, + isStatement: () => isStatement, + isStatementButNotDeclaration: () => isStatementButNotDeclaration, + isStatementOrBlock: () => isStatementOrBlock, + isStatementWithLocals: () => isStatementWithLocals, + isStatic: () => isStatic, + isStaticModifier: () => isStaticModifier, + isString: () => isString4, + isStringAKeyword: () => isStringAKeyword, + isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, + isStringDoubleQuoted: () => isStringDoubleQuoted, + isStringLiteral: () => isStringLiteral, + isStringLiteralLike: () => isStringLiteralLike, + isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, + isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, + isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, + isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, + isStringTextContainingNode: () => isStringTextContainingNode, + isSuperCall: () => isSuperCall, + isSuperKeyword: () => isSuperKeyword, + isSuperOrSuperProperty: () => isSuperOrSuperProperty, + isSuperProperty: () => isSuperProperty, + isSupportedSourceFileName: () => isSupportedSourceFileName, + isSwitchStatement: () => isSwitchStatement, + isSyntaxList: () => isSyntaxList, + isSyntheticExpression: () => isSyntheticExpression, + isSyntheticReference: () => isSyntheticReference, + isTagName: () => isTagName, + isTaggedTemplateExpression: () => isTaggedTemplateExpression, + isTaggedTemplateTag: () => isTaggedTemplateTag, + isTemplateExpression: () => isTemplateExpression, + isTemplateHead: () => isTemplateHead, + isTemplateLiteral: () => isTemplateLiteral, + isTemplateLiteralKind: () => isTemplateLiteralKind, + isTemplateLiteralToken: () => isTemplateLiteralToken, + isTemplateLiteralTypeNode: () => isTemplateLiteralTypeNode, + isTemplateLiteralTypeSpan: () => isTemplateLiteralTypeSpan, + isTemplateMiddle: () => isTemplateMiddle, + isTemplateMiddleOrTemplateTail: () => isTemplateMiddleOrTemplateTail, + isTemplateSpan: () => isTemplateSpan, + isTemplateTail: () => isTemplateTail, + isTextWhiteSpaceLike: () => isTextWhiteSpaceLike, + isThis: () => isThis, + isThisContainerOrFunctionBlock: () => isThisContainerOrFunctionBlock, + isThisIdentifier: () => isThisIdentifier, + isThisInTypeQuery: () => isThisInTypeQuery, + isThisInitializedDeclaration: () => isThisInitializedDeclaration, + isThisInitializedObjectBindingExpression: () => isThisInitializedObjectBindingExpression, + isThisProperty: () => isThisProperty, + isThisTypeNode: () => isThisTypeNode, + isThisTypeParameter: () => isThisTypeParameter, + isThisTypePredicate: () => isThisTypePredicate, + isThrowStatement: () => isThrowStatement, + isToken: () => isToken, + isTokenKind: () => isTokenKind, + isTraceEnabled: () => isTraceEnabled, + isTransientSymbol: () => isTransientSymbol, + isTrivia: () => isTrivia, + isTryStatement: () => isTryStatement, + isTupleTypeNode: () => isTupleTypeNode, + isTypeAlias: () => isTypeAlias, + isTypeAliasDeclaration: () => isTypeAliasDeclaration, + isTypeAssertionExpression: () => isTypeAssertionExpression, + isTypeDeclaration: () => isTypeDeclaration, + isTypeElement: () => isTypeElement, + isTypeKeyword: () => isTypeKeyword, + isTypeKeywordToken: () => isTypeKeywordToken, + isTypeKeywordTokenOrIdentifier: () => isTypeKeywordTokenOrIdentifier, + isTypeLiteralNode: () => isTypeLiteralNode, + isTypeNode: () => isTypeNode, + isTypeNodeKind: () => isTypeNodeKind, + isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, + isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, + isTypeOperatorNode: () => isTypeOperatorNode, + isTypeParameterDeclaration: () => isTypeParameterDeclaration, + isTypePredicateNode: () => isTypePredicateNode, + isTypeQueryNode: () => isTypeQueryNode, + isTypeReferenceNode: () => isTypeReferenceNode, + isTypeReferenceType: () => isTypeReferenceType, + isTypeUsableAsPropertyName: () => isTypeUsableAsPropertyName, + isUMDExportSymbol: () => isUMDExportSymbol, + isUnaryExpression: () => isUnaryExpression, + isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, + isUnicodeIdentifierStart: () => isUnicodeIdentifierStart, + isUnionTypeNode: () => isUnionTypeNode, + isUnparsedNode: () => isUnparsedNode, + isUnparsedPrepend: () => isUnparsedPrepend, + isUnparsedSource: () => isUnparsedSource, + isUnparsedTextLike: () => isUnparsedTextLike, + isUrl: () => isUrl, + isValidBigIntString: () => isValidBigIntString, + isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, + isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, + isValueSignatureDeclaration: () => isValueSignatureDeclaration, + isVarAwaitUsing: () => isVarAwaitUsing, + isVarConst: () => isVarConst, + isVarUsing: () => isVarUsing, + isVariableDeclaration: () => isVariableDeclaration, + isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, + isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, + isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, + isVariableDeclarationList: () => isVariableDeclarationList, + isVariableLike: () => isVariableLike, + isVariableLikeOrAccessor: () => isVariableLikeOrAccessor, + isVariableStatement: () => isVariableStatement, + isVoidExpression: () => isVoidExpression, + isWatchSet: () => isWatchSet, + isWhileStatement: () => isWhileStatement, + isWhiteSpaceLike: () => isWhiteSpaceLike, + isWhiteSpaceSingleLine: () => isWhiteSpaceSingleLine, + isWithStatement: () => isWithStatement, + isWriteAccess: () => isWriteAccess, + isWriteOnlyAccess: () => isWriteOnlyAccess, + isYieldExpression: () => isYieldExpression, + jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport, + keywordPart: () => keywordPart, + last: () => last2, + lastOrUndefined: () => lastOrUndefined, + length: () => length, + libMap: () => libMap, + libs: () => libs, + lineBreakPart: () => lineBreakPart, + linkNamePart: () => linkNamePart, + linkPart: () => linkPart, + linkTextPart: () => linkTextPart, + listFiles: () => listFiles, + loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, + loadWithModeAwareCache: () => loadWithModeAwareCache, + makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, + makeImport: () => makeImport, + makeImportIfNecessary: () => makeImportIfNecessary, + makeStringLiteral: () => makeStringLiteral, + mangleScopedPackageName: () => mangleScopedPackageName, + map: () => map4, + mapAllOrFail: () => mapAllOrFail, + mapDefined: () => mapDefined, + mapDefinedEntries: () => mapDefinedEntries, + mapDefinedIterator: () => mapDefinedIterator, + mapEntries: () => mapEntries, + mapIterator: () => mapIterator, + mapOneOrMany: () => mapOneOrMany, + mapToDisplayParts: () => mapToDisplayParts, + matchFiles: () => matchFiles, + matchPatternOrExact: () => matchPatternOrExact, + matchedText: () => matchedText, + matchesExclude: () => matchesExclude, + maybeBind: () => maybeBind, + maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, + memoize: () => memoize2, + memoizeCached: () => memoizeCached, + memoizeOne: () => memoizeOne, + memoizeWeak: () => memoizeWeak, + metadataHelper: () => metadataHelper, + min: () => min2, + minAndMax: () => minAndMax, + missingFileModifiedTime: () => missingFileModifiedTime, + modifierToFlag: () => modifierToFlag, + modifiersToFlags: () => modifiersToFlags, + moduleOptionDeclaration: () => moduleOptionDeclaration, + moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, + moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, + moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, + moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, + moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, + moduleSpecifiers: () => ts_moduleSpecifiers_exports, + moveEmitHelpers: () => moveEmitHelpers, + moveRangeEnd: () => moveRangeEnd, + moveRangePastDecorators: () => moveRangePastDecorators, + moveRangePastModifiers: () => moveRangePastModifiers, + moveRangePos: () => moveRangePos, + moveSyntheticComments: () => moveSyntheticComments, + mutateMap: () => mutateMap, + mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, + needsParentheses: () => needsParentheses, + needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, + newPrivateEnvironment: () => newPrivateEnvironment, + noEmitNotification: () => noEmitNotification, + noEmitSubstitution: () => noEmitSubstitution, + noTransformers: () => noTransformers, + noTruncationMaximumTruncationLength: () => noTruncationMaximumTruncationLength, + nodeCanBeDecorated: () => nodeCanBeDecorated, + nodeHasName: () => nodeHasName, + nodeIsDecorated: () => nodeIsDecorated, + nodeIsMissing: () => nodeIsMissing, + nodeIsPresent: () => nodeIsPresent, + nodeIsSynthesized: () => nodeIsSynthesized, + nodeModuleNameResolver: () => nodeModuleNameResolver, + nodeModulesPathPart: () => nodeModulesPathPart, + nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver, + nodeOrChildIsDecorated: () => nodeOrChildIsDecorated, + nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd, + nodePosToString: () => nodePosToString, + nodeSeenTracker: () => nodeSeenTracker, + nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment, + nodeToDisplayParts: () => nodeToDisplayParts, + noop: () => noop4, + noopFileWatcher: () => noopFileWatcher, + normalizePath: () => normalizePath, + normalizeSlashes: () => normalizeSlashes, + not: () => not, + notImplemented: () => notImplemented, + notImplementedResolver: () => notImplementedResolver, + nullNodeConverters: () => nullNodeConverters, + nullParenthesizerRules: () => nullParenthesizerRules, + nullTransformationContext: () => nullTransformationContext, + objectAllocator: () => objectAllocator, + operatorPart: () => operatorPart, + optionDeclarations: () => optionDeclarations, + optionMapToObject: () => optionMapToObject, + optionsAffectingProgramStructure: () => optionsAffectingProgramStructure, + optionsForBuild: () => optionsForBuild, + optionsForWatch: () => optionsForWatch, + optionsHaveChanges: () => optionsHaveChanges, + optionsHaveModuleResolutionChanges: () => optionsHaveModuleResolutionChanges, + or: () => or, + orderedRemoveItem: () => orderedRemoveItem, + orderedRemoveItemAt: () => orderedRemoveItemAt, + outFile: () => outFile, + packageIdToPackageName: () => packageIdToPackageName, + packageIdToString: () => packageIdToString, + paramHelper: () => paramHelper, + parameterIsThisKeyword: () => parameterIsThisKeyword, + parameterNamePart: () => parameterNamePart, + parseBaseNodeFactory: () => parseBaseNodeFactory, + parseBigInt: () => parseBigInt, + parseBuildCommand: () => parseBuildCommand, + parseCommandLine: () => parseCommandLine, + parseCommandLineWorker: () => parseCommandLineWorker, + parseConfigFileTextToJson: () => parseConfigFileTextToJson, + parseConfigFileWithSystem: () => parseConfigFileWithSystem, + parseConfigHostFromCompilerHostLike: () => parseConfigHostFromCompilerHostLike, + parseCustomTypeOption: () => parseCustomTypeOption, + parseIsolatedEntityName: () => parseIsolatedEntityName, + parseIsolatedJSDocComment: () => parseIsolatedJSDocComment, + parseJSDocTypeExpressionForTests: () => parseJSDocTypeExpressionForTests, + parseJsonConfigFileContent: () => parseJsonConfigFileContent, + parseJsonSourceFileConfigFileContent: () => parseJsonSourceFileConfigFileContent, + parseJsonText: () => parseJsonText, + parseListTypeOption: () => parseListTypeOption, + parseNodeFactory: () => parseNodeFactory, + parseNodeModuleFromPath: () => parseNodeModuleFromPath, + parsePackageName: () => parsePackageName, + parsePseudoBigInt: () => parsePseudoBigInt, + parseValidBigInt: () => parseValidBigInt, + patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, + pathContainsNodeModules: () => pathContainsNodeModules, + pathIsAbsolute: () => pathIsAbsolute, + pathIsBareSpecifier: () => pathIsBareSpecifier, + pathIsRelative: () => pathIsRelative, + patternText: () => patternText, + perfLogger: () => perfLogger, + performIncrementalCompilation: () => performIncrementalCompilation, + performance: () => ts_performance_exports, + plainJSErrors: () => plainJSErrors, + positionBelongsToNode: () => positionBelongsToNode, + positionIsASICandidate: () => positionIsASICandidate, + positionIsSynthesized: () => positionIsSynthesized, + positionsAreOnSameLine: () => positionsAreOnSameLine, + preProcessFile: () => preProcessFile, + probablyUsesSemicolons: () => probablyUsesSemicolons, + processCommentPragmas: () => processCommentPragmas, + processPragmasIntoFields: () => processPragmasIntoFields, + processTaggedTemplateExpression: () => processTaggedTemplateExpression, + programContainsEsModules: () => programContainsEsModules, + programContainsModules: () => programContainsModules, + projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, + propertyNamePart: () => propertyNamePart, + pseudoBigIntToString: () => pseudoBigIntToString, + punctuationPart: () => punctuationPart, + pushIfUnique: () => pushIfUnique, + quote: () => quote, + quotePreferenceFromString: () => quotePreferenceFromString, + rangeContainsPosition: () => rangeContainsPosition, + rangeContainsPositionExclusive: () => rangeContainsPositionExclusive, + rangeContainsRange: () => rangeContainsRange, + rangeContainsRangeExclusive: () => rangeContainsRangeExclusive, + rangeContainsStartEnd: () => rangeContainsStartEnd, + rangeEndIsOnSameLineAsRangeStart: () => rangeEndIsOnSameLineAsRangeStart, + rangeEndPositionsAreOnSameLine: () => rangeEndPositionsAreOnSameLine, + rangeEquals: () => rangeEquals, + rangeIsOnSingleLine: () => rangeIsOnSingleLine, + rangeOfNode: () => rangeOfNode, + rangeOfTypeParameters: () => rangeOfTypeParameters, + rangeOverlapsWithStartEnd: () => rangeOverlapsWithStartEnd, + rangeStartIsOnSameLineAsRangeEnd: () => rangeStartIsOnSameLineAsRangeEnd, + rangeStartPositionsAreOnSameLine: () => rangeStartPositionsAreOnSameLine, + readBuilderProgram: () => readBuilderProgram, + readConfigFile: () => readConfigFile, + readHelper: () => readHelper, + readJson: () => readJson, + readJsonConfigFile: () => readJsonConfigFile, + readJsonOrUndefined: () => readJsonOrUndefined, + reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, + reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, + reduceLeft: () => reduceLeft, + reduceLeftIterator: () => reduceLeftIterator, + reducePathComponents: () => reducePathComponents, + refactor: () => ts_refactor_exports, + regExpEscape: () => regExpEscape, + relativeComplement: () => relativeComplement, + removeAllComments: () => removeAllComments, + removeEmitHelper: () => removeEmitHelper, + removeExtension: () => removeExtension, + removeFileExtension: () => removeFileExtension, + removeIgnoredPath: () => removeIgnoredPath, + removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, + removeOptionality: () => removeOptionality, + removePrefix: () => removePrefix, + removeSuffix: () => removeSuffix, + removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, + repeatString: () => repeatString, + replaceElement: () => replaceElement, + replaceFirstStar: () => replaceFirstStar, + resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, + resolveConfigFileProjectName: () => resolveConfigFileProjectName, + resolveJSModule: () => resolveJSModule, + resolveLibrary: () => resolveLibrary, + resolveModuleName: () => resolveModuleName, + resolveModuleNameFromCache: () => resolveModuleNameFromCache, + resolvePackageNameToPackageJson: () => resolvePackageNameToPackageJson, + resolvePath: () => resolvePath, + resolveProjectReferencePath: () => resolveProjectReferencePath, + resolveTripleslashReference: () => resolveTripleslashReference, + resolveTypeReferenceDirective: () => resolveTypeReferenceDirective, + resolvingEmptyArray: () => resolvingEmptyArray, + restHelper: () => restHelper, + returnFalse: () => returnFalse, + returnNoopFileWatcher: () => returnNoopFileWatcher, + returnTrue: () => returnTrue, + returnUndefined: () => returnUndefined, + returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, + sameFlatMap: () => sameFlatMap, + sameMap: () => sameMap, + sameMapping: () => sameMapping, + scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, + scanner: () => scanner, + screenStartingMessageCodes: () => screenStartingMessageCodes, + semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, + serializeCompilerOptions: () => serializeCompilerOptions, + server: () => ts_server_exports3, + servicesVersion: () => servicesVersion, + setCommentRange: () => setCommentRange, + setConfigFileInOptions: () => setConfigFileInOptions, + setConstantValue: () => setConstantValue, + setEachParent: () => setEachParent, + setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, + setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, + setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, + setModuleDefaultHelper: () => setModuleDefaultHelper, + setNodeFlags: () => setNodeFlags, + setObjectAllocator: () => setObjectAllocator, + setOriginalNode: () => setOriginalNode, + setParent: () => setParent, + setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, + setSnippetElement: () => setSnippetElement, + setSourceMapRange: () => setSourceMapRange, + setStackTraceLimit: () => setStackTraceLimit, + setStartsOnNewLine: () => setStartsOnNewLine, + setSyntheticLeadingComments: () => setSyntheticLeadingComments, + setSyntheticTrailingComments: () => setSyntheticTrailingComments, + setSys: () => setSys, + setSysLog: () => setSysLog, + setTextRange: () => setTextRange, + setTextRangeEnd: () => setTextRangeEnd, + setTextRangePos: () => setTextRangePos, + setTextRangePosEnd: () => setTextRangePosEnd, + setTextRangePosWidth: () => setTextRangePosWidth, + setTokenSourceMapRange: () => setTokenSourceMapRange, + setTypeNode: () => setTypeNode, + setUILocale: () => setUILocale, + setValueDeclaration: () => setValueDeclaration, + shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, + shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, + showModuleSpecifier: () => showModuleSpecifier, + signatureHasLiteralTypes: () => signatureHasLiteralTypes, + signatureHasRestParameter: () => signatureHasRestParameter, + signatureToDisplayParts: () => signatureToDisplayParts, + single: () => single, + singleElementArray: () => singleElementArray, + singleIterator: () => singleIterator, + singleOrMany: () => singleOrMany, + singleOrUndefined: () => singleOrUndefined, + skipAlias: () => skipAlias, + skipAssertions: () => skipAssertions, + skipConstraint: () => skipConstraint, + skipOuterExpressions: () => skipOuterExpressions, + skipParentheses: () => skipParentheses, + skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, + skipTrivia: () => skipTrivia, + skipTypeChecking: () => skipTypeChecking, + skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, + sliceAfter: () => sliceAfter, + some: () => some2, + sort: () => sort, + sortAndDeduplicate: () => sortAndDeduplicate, + sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, + sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, + sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, + sourceMapCommentRegExp: () => sourceMapCommentRegExp, + sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, + spacePart: () => spacePart, + spanMap: () => spanMap, + spreadArrayHelper: () => spreadArrayHelper, + stableSort: () => stableSort, + startEndContainsRange: () => startEndContainsRange, + startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, + startOnNewLine: () => startOnNewLine, + startTracing: () => startTracing, + startsWith: () => startsWith2, + startsWithDirectory: () => startsWithDirectory, + startsWithUnderscore: () => startsWithUnderscore, + startsWithUseStrict: () => startsWithUseStrict, + stringContainsAt: () => stringContainsAt, + stringToToken: () => stringToToken, + stripQuotes: () => stripQuotes, + supportedDeclarationExtensions: () => supportedDeclarationExtensions, + supportedJSExtensions: () => supportedJSExtensions, + supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, + supportedLocaleDirectories: () => supportedLocaleDirectories, + supportedTSExtensions: () => supportedTSExtensions, + supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, + supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, + suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, + suppressLeadingTrivia: () => suppressLeadingTrivia, + suppressTrailingTrivia: () => suppressTrailingTrivia, + symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, + symbolName: () => symbolName, + symbolNameNoDefault: () => symbolNameNoDefault, + symbolPart: () => symbolPart, + symbolToDisplayParts: () => symbolToDisplayParts, + syntaxMayBeASICandidate: () => syntaxMayBeASICandidate, + syntaxRequiresTrailingSemicolonOrASI: () => syntaxRequiresTrailingSemicolonOrASI, + sys: () => sys, + sysLog: () => sysLog, + tagNamesAreEquivalent: () => tagNamesAreEquivalent, + takeWhile: () => takeWhile2, + targetOptionDeclaration: () => targetOptionDeclaration, + templateObjectHelper: () => templateObjectHelper, + testFormatSettings: () => testFormatSettings, + textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, + textChangeRangeNewSpan: () => textChangeRangeNewSpan, + textChanges: () => ts_textChanges_exports, + textOrKeywordPart: () => textOrKeywordPart, + textPart: () => textPart, + textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, + textSpanContainsPosition: () => textSpanContainsPosition, + textSpanContainsTextSpan: () => textSpanContainsTextSpan, + textSpanEnd: () => textSpanEnd, + textSpanIntersection: () => textSpanIntersection, + textSpanIntersectsWith: () => textSpanIntersectsWith, + textSpanIntersectsWithPosition: () => textSpanIntersectsWithPosition, + textSpanIntersectsWithTextSpan: () => textSpanIntersectsWithTextSpan, + textSpanIsEmpty: () => textSpanIsEmpty, + textSpanOverlap: () => textSpanOverlap, + textSpanOverlapsWith: () => textSpanOverlapsWith, + textSpansEqual: () => textSpansEqual, + textToKeywordObj: () => textToKeywordObj, + timestamp: () => timestamp3, + toArray: () => toArray3, + toBuilderFileEmit: () => toBuilderFileEmit, + toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit, + toEditorSettings: () => toEditorSettings, + toFileNameLowerCase: () => toFileNameLowerCase, + toLowerCase: () => toLowerCase, + toPath: () => toPath2, + toProgramEmitPending: () => toProgramEmitPending, + tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, + tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, + tokenToString: () => tokenToString, + trace: () => trace2, + tracing: () => tracing, + tracingEnabled: () => tracingEnabled, + transform: () => transform2, + transformClassFields: () => transformClassFields, + transformDeclarations: () => transformDeclarations, + transformECMAScriptModule: () => transformECMAScriptModule, + transformES2015: () => transformES2015, + transformES2016: () => transformES2016, + transformES2017: () => transformES2017, + transformES2018: () => transformES2018, + transformES2019: () => transformES2019, + transformES2020: () => transformES2020, + transformES2021: () => transformES2021, + transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, + transformESNext: () => transformESNext, + transformGenerators: () => transformGenerators, + transformJsx: () => transformJsx, + transformLegacyDecorators: () => transformLegacyDecorators, + transformModule: () => transformModule, + transformNamedEvaluation: () => transformNamedEvaluation, + transformNodeModule: () => transformNodeModule, + transformNodes: () => transformNodes, + transformSystemModule: () => transformSystemModule, + transformTypeScript: () => transformTypeScript, + transpile: () => transpile, + transpileModule: () => transpileModule, + transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, + tryAddToSet: () => tryAddToSet, + tryAndIgnoreErrors: () => tryAndIgnoreErrors, + tryCast: () => tryCast, + tryDirectoryExists: () => tryDirectoryExists, + tryExtractTSExtension: () => tryExtractTSExtension, + tryFileExists: () => tryFileExists, + tryGetClassExtendingExpressionWithTypeArguments: () => tryGetClassExtendingExpressionWithTypeArguments, + tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => tryGetClassImplementingOrExtendingExpressionWithTypeArguments, + tryGetDirectories: () => tryGetDirectories, + tryGetExtensionFromPath: () => tryGetExtensionFromPath2, + tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, + tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, + tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, + tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, + tryGetPropertyAccessOrIdentifierToString: () => tryGetPropertyAccessOrIdentifierToString, + tryGetPropertyNameOfBindingOrAssignmentElement: () => tryGetPropertyNameOfBindingOrAssignmentElement, + tryGetSourceMappingURL: () => tryGetSourceMappingURL, + tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, + tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, + tryParseJson: () => tryParseJson, + tryParsePattern: () => tryParsePattern, + tryParsePatterns: () => tryParsePatterns, + tryParseRawSourceMap: () => tryParseRawSourceMap, + tryReadDirectory: () => tryReadDirectory, + tryReadFile: () => tryReadFile, + tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, + tryRemoveExtension: () => tryRemoveExtension, + tryRemovePrefix: () => tryRemovePrefix, + tryRemoveSuffix: () => tryRemoveSuffix, + typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, + typeAliasNamePart: () => typeAliasNamePart, + typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, + typeKeywords: () => typeKeywords, + typeParameterNamePart: () => typeParameterNamePart, + typeToDisplayParts: () => typeToDisplayParts, + unchangedPollThresholds: () => unchangedPollThresholds, + unchangedTextChangeRange: () => unchangedTextChangeRange, + unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, + unmangleScopedPackageName: () => unmangleScopedPackageName, + unorderedRemoveItem: () => unorderedRemoveItem, + unorderedRemoveItemAt: () => unorderedRemoveItemAt, + unreachableCodeIsError: () => unreachableCodeIsError, + unusedLabelIsError: () => unusedLabelIsError, + unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, + updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, + updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, + updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, + updateResolutionField: () => updateResolutionField, + updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, + updateSourceFile: () => updateSourceFile, + updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, + usesExtensionsOnImports: () => usesExtensionsOnImports, + usingSingleLineStringWriter: () => usingSingleLineStringWriter, + utf16EncodeAsString: () => utf16EncodeAsString, + validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, + valuesHelper: () => valuesHelper, + version: () => version5, + versionMajorMinor: () => versionMajorMinor, + visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, + visitEachChild: () => visitEachChild, + visitFunctionBody: () => visitFunctionBody, + visitIterationBody: () => visitIterationBody, + visitLexicalEnvironment: () => visitLexicalEnvironment, + visitNode: () => visitNode, + visitNodes: () => visitNodes2, + visitParameterList: () => visitParameterList, + walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, + walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, + walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, + walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, + whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, + writeCommentRange: () => writeCommentRange, + writeFile: () => writeFile2, + writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, + zipWith: () => zipWith2 + }); + var init_ts7 = __esm2({ + "src/server/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_ts4(); + init_ts5(); + init_ts_server3(); + } + }); + var ts_server_exports4 = {}; + __export2(ts_server_exports4, { + ActionInvalidate: () => ActionInvalidate, + ActionPackageInstalled: () => ActionPackageInstalled, + ActionSet: () => ActionSet, + ActionWatchTypingLocations: () => ActionWatchTypingLocations, + Arguments: () => Arguments, + AutoImportProviderProject: () => AutoImportProviderProject, + AuxiliaryProject: () => AuxiliaryProject, + CharRangeSection: () => CharRangeSection, + CloseFileWatcherEvent: () => CloseFileWatcherEvent, + CommandNames: () => CommandNames, + ConfigFileDiagEvent: () => ConfigFileDiagEvent, + ConfiguredProject: () => ConfiguredProject2, + CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent, + CreateFileWatcherEvent: () => CreateFileWatcherEvent, + Errors: () => Errors, + EventBeginInstallTypes: () => EventBeginInstallTypes, + EventEndInstallTypes: () => EventEndInstallTypes, + EventInitializationFailed: () => EventInitializationFailed, + EventTypesRegistry: () => EventTypesRegistry, + ExternalProject: () => ExternalProject2, + GcTimer: () => GcTimer, + InferredProject: () => InferredProject2, + LargeFileReferencedEvent: () => LargeFileReferencedEvent, + LineIndex: () => LineIndex, + LineLeaf: () => LineLeaf, + LineNode: () => LineNode, + LogLevel: () => LogLevel2, + Msg: () => Msg, + OpenFileInfoTelemetryEvent: () => OpenFileInfoTelemetryEvent, + Project: () => Project3, + ProjectInfoTelemetryEvent: () => ProjectInfoTelemetryEvent, + ProjectKind: () => ProjectKind, + ProjectLanguageServiceStateEvent: () => ProjectLanguageServiceStateEvent, + ProjectLoadingFinishEvent: () => ProjectLoadingFinishEvent, + ProjectLoadingStartEvent: () => ProjectLoadingStartEvent, + ProjectReferenceProjectLoadKind: () => ProjectReferenceProjectLoadKind, + ProjectService: () => ProjectService3, + ProjectsUpdatedInBackgroundEvent: () => ProjectsUpdatedInBackgroundEvent, + ScriptInfo: () => ScriptInfo, + ScriptVersionCache: () => ScriptVersionCache, + Session: () => Session3, + TextStorage: () => TextStorage, + ThrottledOperations: () => ThrottledOperations, + TypingsCache: () => TypingsCache, + TypingsInstallerAdapter: () => TypingsInstallerAdapter, + allFilesAreJsOrDts: () => allFilesAreJsOrDts, + allRootFilesAreJsOrDts: () => allRootFilesAreJsOrDts, + asNormalizedPath: () => asNormalizedPath, + convertCompilerOptions: () => convertCompilerOptions, + convertFormatOptions: () => convertFormatOptions, + convertScriptKindName: () => convertScriptKindName, + convertTypeAcquisition: () => convertTypeAcquisition, + convertUserPreferences: () => convertUserPreferences, + convertWatchOptions: () => convertWatchOptions, + countEachFileTypes: () => countEachFileTypes, + createInstallTypingsRequest: () => createInstallTypingsRequest, + createModuleSpecifierCache: () => createModuleSpecifierCache, + createNormalizedPathMap: () => createNormalizedPathMap, + createPackageJsonCache: () => createPackageJsonCache, + createSortedArray: () => createSortedArray2, + emptyArray: () => emptyArray2, + findArgument: () => findArgument, + forEachResolvedProjectReferenceProject: () => forEachResolvedProjectReferenceProject, + formatDiagnosticToProtocol: () => formatDiagnosticToProtocol, + formatMessage: () => formatMessage2, + getBaseConfigFileName: () => getBaseConfigFileName, + getLocationInNewDocument: () => getLocationInNewDocument, + hasArgument: () => hasArgument, + hasNoTypeScriptSource: () => hasNoTypeScriptSource, + indent: () => indent2, + isBackgroundProject: () => isBackgroundProject, + isConfigFile: () => isConfigFile, + isConfiguredProject: () => isConfiguredProject, + isDynamicFileName: () => isDynamicFileName, + isExternalProject: () => isExternalProject, + isInferredProject: () => isInferredProject, + isInferredProjectName: () => isInferredProjectName, + makeAutoImportProviderProjectName: () => makeAutoImportProviderProjectName, + makeAuxiliaryProjectName: () => makeAuxiliaryProjectName, + makeInferredProjectName: () => makeInferredProjectName, + maxFileSize: () => maxFileSize, + maxProgramSizeForNonTsFiles: () => maxProgramSizeForNonTsFiles, + normalizedPathToPath: () => normalizedPathToPath, + nowString: () => nowString, + nullCancellationToken: () => nullCancellationToken, + nullTypingsInstaller: () => nullTypingsInstaller, + projectContainsInfoDirectly: () => projectContainsInfoDirectly, + protocol: () => ts_server_protocol_exports, + removeSorted: () => removeSorted, + stringifyIndented: () => stringifyIndented, + toEvent: () => toEvent, + toNormalizedPath: () => toNormalizedPath, + tryConvertScriptKindName: () => tryConvertScriptKindName, + typingsInstaller: () => ts_server_typingsInstaller_exports, + updateProjectIfDirty: () => updateProjectIfDirty + }); + var init_ts_server4 = __esm2({ + "src/typescript/_namespaces/ts.server.ts"() { + "use strict"; + init_ts_server(); + init_ts_server3(); + } + }); + var ts_exports3 = {}; + __export2(ts_exports3, { + ANONYMOUS: () => ANONYMOUS, + AccessFlags: () => AccessFlags, + AssertionLevel: () => AssertionLevel, + AssignmentDeclarationKind: () => AssignmentDeclarationKind, + AssignmentKind: () => AssignmentKind, + Associativity: () => Associativity, + BreakpointResolver: () => ts_BreakpointResolver_exports, + BuilderFileEmit: () => BuilderFileEmit, + BuilderProgramKind: () => BuilderProgramKind, + BuilderState: () => BuilderState, + BundleFileSectionKind: () => BundleFileSectionKind, + CallHierarchy: () => ts_CallHierarchy_exports, + CharacterCodes: () => CharacterCodes, + CheckFlags: () => CheckFlags, + CheckMode: () => CheckMode, + ClassificationType: () => ClassificationType, + ClassificationTypeNames: () => ClassificationTypeNames, + CommentDirectiveType: () => CommentDirectiveType, + Comparison: () => Comparison, + CompletionInfoFlags: () => CompletionInfoFlags, + CompletionTriggerKind: () => CompletionTriggerKind, + Completions: () => ts_Completions_exports, + ContainerFlags: () => ContainerFlags, + ContextFlags: () => ContextFlags, + Debug: () => Debug, + DiagnosticCategory: () => DiagnosticCategory, + Diagnostics: () => Diagnostics, + DocumentHighlights: () => DocumentHighlights, + ElementFlags: () => ElementFlags, + EmitFlags: () => EmitFlags, + EmitHint: () => EmitHint, + EmitOnly: () => EmitOnly, + EndOfLineState: () => EndOfLineState, + EnumKind: () => EnumKind, + ExitStatus: () => ExitStatus, + ExportKind: () => ExportKind, + Extension: () => Extension6, + ExternalEmitHelpers: () => ExternalEmitHelpers, + FileIncludeKind: () => FileIncludeKind, + FilePreprocessingDiagnosticsKind: () => FilePreprocessingDiagnosticsKind, + FileSystemEntryKind: () => FileSystemEntryKind, + FileWatcherEventKind: () => FileWatcherEventKind, + FindAllReferences: () => ts_FindAllReferences_exports, + FlattenLevel: () => FlattenLevel, + FlowFlags: () => FlowFlags, + ForegroundColorEscapeSequences: () => ForegroundColorEscapeSequences, + FunctionFlags: () => FunctionFlags, + GeneratedIdentifierFlags: () => GeneratedIdentifierFlags, + GetLiteralTextFlags: () => GetLiteralTextFlags, + GoToDefinition: () => ts_GoToDefinition_exports, + HighlightSpanKind: () => HighlightSpanKind, + IdentifierNameMap: () => IdentifierNameMap, + IdentifierNameMultiMap: () => IdentifierNameMultiMap, + ImportKind: () => ImportKind, + ImportsNotUsedAsValues: () => ImportsNotUsedAsValues, + IndentStyle: () => IndentStyle, + IndexFlags: () => IndexFlags, + IndexKind: () => IndexKind, + InferenceFlags: () => InferenceFlags, + InferencePriority: () => InferencePriority, + InlayHintKind: () => InlayHintKind, + InlayHints: () => ts_InlayHints_exports, + InternalEmitFlags: () => InternalEmitFlags, + InternalSymbolName: () => InternalSymbolName, + InvalidatedProjectKind: () => InvalidatedProjectKind, + JSDocParsingMode: () => JSDocParsingMode, + JsDoc: () => ts_JsDoc_exports, + JsTyping: () => ts_JsTyping_exports, + JsxEmit: () => JsxEmit, + JsxFlags: () => JsxFlags, + JsxReferenceKind: () => JsxReferenceKind, + LanguageServiceMode: () => LanguageServiceMode, + LanguageVariant: () => LanguageVariant, + LexicalEnvironmentFlags: () => LexicalEnvironmentFlags, + ListFormat: () => ListFormat, + LogLevel: () => LogLevel, + MemberOverrideStatus: () => MemberOverrideStatus, + ModifierFlags: () => ModifierFlags, + ModuleDetectionKind: () => ModuleDetectionKind, + ModuleInstanceState: () => ModuleInstanceState, + ModuleKind: () => ModuleKind, + ModuleResolutionKind: () => ModuleResolutionKind, + ModuleSpecifierEnding: () => ModuleSpecifierEnding, + NavigateTo: () => ts_NavigateTo_exports, + NavigationBar: () => ts_NavigationBar_exports, + NewLineKind: () => NewLineKind, + NodeBuilderFlags: () => NodeBuilderFlags, + NodeCheckFlags: () => NodeCheckFlags, + NodeFactoryFlags: () => NodeFactoryFlags, + NodeFlags: () => NodeFlags, + NodeResolutionFeatures: () => NodeResolutionFeatures, + ObjectFlags: () => ObjectFlags, + OperationCanceledException: () => OperationCanceledException, + OperatorPrecedence: () => OperatorPrecedence, + OrganizeImports: () => ts_OrganizeImports_exports, + OrganizeImportsMode: () => OrganizeImportsMode, + OuterExpressionKinds: () => OuterExpressionKinds, + OutliningElementsCollector: () => ts_OutliningElementsCollector_exports, + OutliningSpanKind: () => OutliningSpanKind, + OutputFileType: () => OutputFileType, + PackageJsonAutoImportPreference: () => PackageJsonAutoImportPreference, + PackageJsonDependencyGroup: () => PackageJsonDependencyGroup, + PatternMatchKind: () => PatternMatchKind, + PollingInterval: () => PollingInterval, + PollingWatchKind: () => PollingWatchKind, + PragmaKindFlags: () => PragmaKindFlags, + PrivateIdentifierKind: () => PrivateIdentifierKind, + ProcessLevel: () => ProcessLevel, + ProgramUpdateLevel: () => ProgramUpdateLevel, + QuotePreference: () => QuotePreference, + RelationComparisonResult: () => RelationComparisonResult, + Rename: () => ts_Rename_exports, + ScriptElementKind: () => ScriptElementKind, + ScriptElementKindModifier: () => ScriptElementKindModifier, + ScriptKind: () => ScriptKind, + ScriptSnapshot: () => ScriptSnapshot, + ScriptTarget: () => ScriptTarget, + SemanticClassificationFormat: () => SemanticClassificationFormat, + SemanticMeaning: () => SemanticMeaning, + SemicolonPreference: () => SemicolonPreference, + SignatureCheckMode: () => SignatureCheckMode, + SignatureFlags: () => SignatureFlags, + SignatureHelp: () => ts_SignatureHelp_exports, + SignatureKind: () => SignatureKind, + SmartSelectionRange: () => ts_SmartSelectionRange_exports, + SnippetKind: () => SnippetKind, + SortKind: () => SortKind, + StructureIsReused: () => StructureIsReused, + SymbolAccessibility: () => SymbolAccessibility, + SymbolDisplay: () => ts_SymbolDisplay_exports, + SymbolDisplayPartKind: () => SymbolDisplayPartKind, + SymbolFlags: () => SymbolFlags, + SymbolFormatFlags: () => SymbolFormatFlags, + SyntaxKind: () => SyntaxKind, + SyntheticSymbolKind: () => SyntheticSymbolKind, + Ternary: () => Ternary, + ThrottledCancellationToken: () => ThrottledCancellationToken, + TokenClass: () => TokenClass, + TokenFlags: () => TokenFlags, + TransformFlags: () => TransformFlags, + TypeFacts: () => TypeFacts, + TypeFlags: () => TypeFlags, + TypeFormatFlags: () => TypeFormatFlags, + TypeMapKind: () => TypeMapKind, + TypePredicateKind: () => TypePredicateKind, + TypeReferenceSerializationKind: () => TypeReferenceSerializationKind, + UnionReduction: () => UnionReduction, + UpToDateStatusType: () => UpToDateStatusType, + VarianceFlags: () => VarianceFlags, + Version: () => Version, + VersionRange: () => VersionRange, + WatchDirectoryFlags: () => WatchDirectoryFlags, + WatchDirectoryKind: () => WatchDirectoryKind, + WatchFileKind: () => WatchFileKind, + WatchLogLevel: () => WatchLogLevel, + WatchType: () => WatchType, + accessPrivateIdentifier: () => accessPrivateIdentifier, + addDisposableResourceHelper: () => addDisposableResourceHelper, + addEmitFlags: () => addEmitFlags, + addEmitHelper: () => addEmitHelper, + addEmitHelpers: () => addEmitHelpers, + addInternalEmitFlags: () => addInternalEmitFlags, + addNodeFactoryPatcher: () => addNodeFactoryPatcher, + addObjectAllocatorPatcher: () => addObjectAllocatorPatcher, + addRange: () => addRange, + addRelatedInfo: () => addRelatedInfo, + addSyntheticLeadingComment: () => addSyntheticLeadingComment, + addSyntheticTrailingComment: () => addSyntheticTrailingComment, + addToSeen: () => addToSeen, + advancedAsyncSuperHelper: () => advancedAsyncSuperHelper, + affectsDeclarationPathOptionDeclarations: () => affectsDeclarationPathOptionDeclarations, + affectsEmitOptionDeclarations: () => affectsEmitOptionDeclarations, + allKeysStartWithDot: () => allKeysStartWithDot, + altDirectorySeparator: () => altDirectorySeparator, + and: () => and, + append: () => append, + appendIfUnique: () => appendIfUnique, + arrayFrom: () => arrayFrom, + arrayIsEqualTo: () => arrayIsEqualTo, + arrayIsHomogeneous: () => arrayIsHomogeneous, + arrayIsSorted: () => arrayIsSorted, + arrayOf: () => arrayOf, + arrayReverseIterator: () => arrayReverseIterator, + arrayToMap: () => arrayToMap, + arrayToMultiMap: () => arrayToMultiMap, + arrayToNumericMap: () => arrayToNumericMap, + arraysEqual: () => arraysEqual, + assertType: () => assertType, + assign: () => assign3, + assignHelper: () => assignHelper, + asyncDelegator: () => asyncDelegator, + asyncGeneratorHelper: () => asyncGeneratorHelper, + asyncSuperHelper: () => asyncSuperHelper, + asyncValues: () => asyncValues, + attachFileToDiagnostics: () => attachFileToDiagnostics, + awaitHelper: () => awaitHelper, + awaiterHelper: () => awaiterHelper, + base64decode: () => base64decode, + base64encode: () => base64encode, + binarySearch: () => binarySearch, + binarySearchKey: () => binarySearchKey, + bindSourceFile: () => bindSourceFile, + breakIntoCharacterSpans: () => breakIntoCharacterSpans, + breakIntoWordSpans: () => breakIntoWordSpans, + buildLinkParts: () => buildLinkParts, + buildOpts: () => buildOpts, + buildOverload: () => buildOverload, + bundlerModuleNameResolver: () => bundlerModuleNameResolver, + canBeConvertedToAsync: () => canBeConvertedToAsync, + canHaveDecorators: () => canHaveDecorators, + canHaveExportModifier: () => canHaveExportModifier, + canHaveFlowNode: () => canHaveFlowNode, + canHaveIllegalDecorators: () => canHaveIllegalDecorators, + canHaveIllegalModifiers: () => canHaveIllegalModifiers, + canHaveIllegalType: () => canHaveIllegalType, + canHaveIllegalTypeParameters: () => canHaveIllegalTypeParameters, + canHaveJSDoc: () => canHaveJSDoc, + canHaveLocals: () => canHaveLocals, + canHaveModifiers: () => canHaveModifiers, + canHaveSymbol: () => canHaveSymbol, + canJsonReportNoInputFiles: () => canJsonReportNoInputFiles, + canProduceDiagnostics: () => canProduceDiagnostics, + canUsePropertyAccess: () => canUsePropertyAccess, + canWatchAffectingLocation: () => canWatchAffectingLocation, + canWatchAtTypes: () => canWatchAtTypes, + canWatchDirectoryOrFile: () => canWatchDirectoryOrFile, + cartesianProduct: () => cartesianProduct, + cast: () => cast, + chainBundle: () => chainBundle, + chainDiagnosticMessages: () => chainDiagnosticMessages, + changeAnyExtension: () => changeAnyExtension, + changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache, + changeExtension: () => changeExtension, + changeFullExtension: () => changeFullExtension, + changesAffectModuleResolution: () => changesAffectModuleResolution, + changesAffectingProgramStructure: () => changesAffectingProgramStructure, + childIsDecorated: () => childIsDecorated, + classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated, + classHasClassThisAssignment: () => classHasClassThisAssignment, + classHasDeclaredOrExplicitlyAssignedName: () => classHasDeclaredOrExplicitlyAssignedName, + classHasExplicitlyAssignedName: () => classHasExplicitlyAssignedName, + classOrConstructorParameterIsDecorated: () => classOrConstructorParameterIsDecorated, + classPrivateFieldGetHelper: () => classPrivateFieldGetHelper, + classPrivateFieldInHelper: () => classPrivateFieldInHelper, + classPrivateFieldSetHelper: () => classPrivateFieldSetHelper, + classicNameResolver: () => classicNameResolver, + classifier: () => ts_classifier_exports, + cleanExtendedConfigCache: () => cleanExtendedConfigCache, + clear: () => clear2, + clearMap: () => clearMap, + clearSharedExtendedConfigFileWatcher: () => clearSharedExtendedConfigFileWatcher, + climbPastPropertyAccess: () => climbPastPropertyAccess, + climbPastPropertyOrElementAccess: () => climbPastPropertyOrElementAccess, + clone: () => clone2, + cloneCompilerOptions: () => cloneCompilerOptions, + closeFileWatcher: () => closeFileWatcher, + closeFileWatcherOf: () => closeFileWatcherOf, + codefix: () => ts_codefix_exports, + collapseTextChangeRangesAcrossMultipleVersions: () => collapseTextChangeRangesAcrossMultipleVersions, + collectExternalModuleInfo: () => collectExternalModuleInfo, + combine: () => combine, + combinePaths: () => combinePaths, + commentPragmas: () => commentPragmas, + commonOptionsWithBuild: () => commonOptionsWithBuild, + commonPackageFolders: () => commonPackageFolders, + compact: () => compact2, + compareBooleans: () => compareBooleans, + compareDataObjects: () => compareDataObjects, + compareDiagnostics: () => compareDiagnostics, + compareDiagnosticsSkipRelatedInformation: () => compareDiagnosticsSkipRelatedInformation, + compareEmitHelpers: () => compareEmitHelpers, + compareNumberOfDirectorySeparators: () => compareNumberOfDirectorySeparators, + comparePaths: () => comparePaths, + comparePathsCaseInsensitive: () => comparePathsCaseInsensitive, + comparePathsCaseSensitive: () => comparePathsCaseSensitive, + comparePatternKeys: () => comparePatternKeys, + compareProperties: () => compareProperties, + compareStringsCaseInsensitive: () => compareStringsCaseInsensitive, + compareStringsCaseInsensitiveEslintCompatible: () => compareStringsCaseInsensitiveEslintCompatible, + compareStringsCaseSensitive: () => compareStringsCaseSensitive, + compareStringsCaseSensitiveUI: () => compareStringsCaseSensitiveUI, + compareTextSpans: () => compareTextSpans, + compareValues: () => compareValues, + compileOnSaveCommandLineOption: () => compileOnSaveCommandLineOption, + compilerOptionsAffectDeclarationPath: () => compilerOptionsAffectDeclarationPath, + compilerOptionsAffectEmit: () => compilerOptionsAffectEmit, + compilerOptionsAffectSemanticDiagnostics: () => compilerOptionsAffectSemanticDiagnostics, + compilerOptionsDidYouMeanDiagnostics: () => compilerOptionsDidYouMeanDiagnostics, + compilerOptionsIndicateEsModules: () => compilerOptionsIndicateEsModules, + compose: () => compose, + computeCommonSourceDirectoryOfFilenames: () => computeCommonSourceDirectoryOfFilenames, + computeLineAndCharacterOfPosition: () => computeLineAndCharacterOfPosition, + computeLineOfPosition: () => computeLineOfPosition, + computeLineStarts: () => computeLineStarts, + computePositionOfLineAndCharacter: () => computePositionOfLineAndCharacter, + computeSignature: () => computeSignature, + computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics, + computeSuggestionDiagnostics: () => computeSuggestionDiagnostics, + computedOptions: () => computedOptions, + concatenate: () => concatenate, + concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains, + consumesNodeCoreModules: () => consumesNodeCoreModules, + contains: () => contains2, + containsIgnoredPath: () => containsIgnoredPath, + containsObjectRestOrSpread: () => containsObjectRestOrSpread, + containsParseError: () => containsParseError, + containsPath: () => containsPath, + convertCompilerOptionsForTelemetry: () => convertCompilerOptionsForTelemetry, + convertCompilerOptionsFromJson: () => convertCompilerOptionsFromJson, + convertJsonOption: () => convertJsonOption, + convertToBase64: () => convertToBase64, + convertToJson: () => convertToJson, + convertToObject: () => convertToObject, + convertToOptionsWithAbsolutePaths: () => convertToOptionsWithAbsolutePaths, + convertToRelativePath: () => convertToRelativePath, + convertToTSConfig: () => convertToTSConfig, + convertTypeAcquisitionFromJson: () => convertTypeAcquisitionFromJson, + copyComments: () => copyComments, + copyEntries: () => copyEntries, + copyLeadingComments: () => copyLeadingComments, + copyProperties: () => copyProperties, + copyTrailingAsLeadingComments: () => copyTrailingAsLeadingComments, + copyTrailingComments: () => copyTrailingComments, + couldStartTrivia: () => couldStartTrivia, + countWhere: () => countWhere, + createAbstractBuilder: () => createAbstractBuilder, + createAccessorPropertyBackingField: () => createAccessorPropertyBackingField, + createAccessorPropertyGetRedirector: () => createAccessorPropertyGetRedirector, + createAccessorPropertySetRedirector: () => createAccessorPropertySetRedirector, + createBaseNodeFactory: () => createBaseNodeFactory, + createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline, + createBindingHelper: () => createBindingHelper, + createBuildInfo: () => createBuildInfo, + createBuilderProgram: () => createBuilderProgram, + createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo, + createBuilderStatusReporter: () => createBuilderStatusReporter, + createCacheWithRedirects: () => createCacheWithRedirects, + createCacheableExportInfoMap: () => createCacheableExportInfoMap, + createCachedDirectoryStructureHost: () => createCachedDirectoryStructureHost, + createClassNamedEvaluationHelperBlock: () => createClassNamedEvaluationHelperBlock, + createClassThisAssignmentBlock: () => createClassThisAssignmentBlock, + createClassifier: () => createClassifier, + createCommentDirectivesMap: () => createCommentDirectivesMap, + createCompilerDiagnostic: () => createCompilerDiagnostic, + createCompilerDiagnosticForInvalidCustomType: () => createCompilerDiagnosticForInvalidCustomType, + createCompilerDiagnosticFromMessageChain: () => createCompilerDiagnosticFromMessageChain, + createCompilerHost: () => createCompilerHost, + createCompilerHostFromProgramHost: () => createCompilerHostFromProgramHost, + createCompilerHostWorker: () => createCompilerHostWorker, + createDetachedDiagnostic: () => createDetachedDiagnostic, + createDiagnosticCollection: () => createDiagnosticCollection, + createDiagnosticForFileFromMessageChain: () => createDiagnosticForFileFromMessageChain, + createDiagnosticForNode: () => createDiagnosticForNode, + createDiagnosticForNodeArray: () => createDiagnosticForNodeArray, + createDiagnosticForNodeArrayFromMessageChain: () => createDiagnosticForNodeArrayFromMessageChain, + createDiagnosticForNodeFromMessageChain: () => createDiagnosticForNodeFromMessageChain, + createDiagnosticForNodeInSourceFile: () => createDiagnosticForNodeInSourceFile, + createDiagnosticForRange: () => createDiagnosticForRange, + createDiagnosticMessageChainFromDiagnostic: () => createDiagnosticMessageChainFromDiagnostic, + createDiagnosticReporter: () => createDiagnosticReporter, + createDocumentPositionMapper: () => createDocumentPositionMapper, + createDocumentRegistry: () => createDocumentRegistry, + createDocumentRegistryInternal: () => createDocumentRegistryInternal, + createEmitAndSemanticDiagnosticsBuilderProgram: () => createEmitAndSemanticDiagnosticsBuilderProgram, + createEmitHelperFactory: () => createEmitHelperFactory, + createEmptyExports: () => createEmptyExports, + createExpressionForJsxElement: () => createExpressionForJsxElement, + createExpressionForJsxFragment: () => createExpressionForJsxFragment, + createExpressionForObjectLiteralElementLike: () => createExpressionForObjectLiteralElementLike, + createExpressionForPropertyName: () => createExpressionForPropertyName, + createExpressionFromEntityName: () => createExpressionFromEntityName, + createExternalHelpersImportDeclarationIfNeeded: () => createExternalHelpersImportDeclarationIfNeeded, + createFileDiagnostic: () => createFileDiagnostic, + createFileDiagnosticFromMessageChain: () => createFileDiagnosticFromMessageChain, + createForOfBindingStatement: () => createForOfBindingStatement, + createGetCanonicalFileName: () => createGetCanonicalFileName, + createGetSourceFile: () => createGetSourceFile, + createGetSymbolAccessibilityDiagnosticForNode: () => createGetSymbolAccessibilityDiagnosticForNode, + createGetSymbolAccessibilityDiagnosticForNodeName: () => createGetSymbolAccessibilityDiagnosticForNodeName, + createGetSymbolWalker: () => createGetSymbolWalker, + createIncrementalCompilerHost: () => createIncrementalCompilerHost, + createIncrementalProgram: () => createIncrementalProgram, + createInputFiles: () => createInputFiles, + createInputFilesWithFilePaths: () => createInputFilesWithFilePaths, + createInputFilesWithFileTexts: () => createInputFilesWithFileTexts, + createJsxFactoryExpression: () => createJsxFactoryExpression, + createLanguageService: () => createLanguageService, + createLanguageServiceSourceFile: () => createLanguageServiceSourceFile, + createMemberAccessForPropertyName: () => createMemberAccessForPropertyName, + createModeAwareCache: () => createModeAwareCache, + createModeAwareCacheKey: () => createModeAwareCacheKey, + createModuleNotFoundChain: () => createModuleNotFoundChain, + createModuleResolutionCache: () => createModuleResolutionCache, + createModuleResolutionLoader: () => createModuleResolutionLoader, + createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache, + createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost, + createMultiMap: () => createMultiMap, + createNodeConverters: () => createNodeConverters, + createNodeFactory: () => createNodeFactory, + createOptionNameMap: () => createOptionNameMap, + createOverload: () => createOverload, + createPackageJsonImportFilter: () => createPackageJsonImportFilter, + createPackageJsonInfo: () => createPackageJsonInfo, + createParenthesizerRules: () => createParenthesizerRules, + createPatternMatcher: () => createPatternMatcher, + createPrependNodes: () => createPrependNodes, + createPrinter: () => createPrinter, + createPrinterWithDefaults: () => createPrinterWithDefaults, + createPrinterWithRemoveComments: () => createPrinterWithRemoveComments, + createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape, + createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon, + createProgram: () => createProgram, + createProgramHost: () => createProgramHost, + createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral, + createQueue: () => createQueue, + createRange: () => createRange2, + createRedirectedBuilderProgram: () => createRedirectedBuilderProgram, + createResolutionCache: () => createResolutionCache, + createRuntimeTypeSerializer: () => createRuntimeTypeSerializer, + createScanner: () => createScanner3, + createSemanticDiagnosticsBuilderProgram: () => createSemanticDiagnosticsBuilderProgram, + createSet: () => createSet2, + createSolutionBuilder: () => createSolutionBuilder, + createSolutionBuilderHost: () => createSolutionBuilderHost, + createSolutionBuilderWithWatch: () => createSolutionBuilderWithWatch, + createSolutionBuilderWithWatchHost: () => createSolutionBuilderWithWatchHost, + createSortedArray: () => createSortedArray, + createSourceFile: () => createSourceFile, + createSourceMapGenerator: () => createSourceMapGenerator, + createSourceMapSource: () => createSourceMapSource, + createSuperAccessVariableStatement: () => createSuperAccessVariableStatement, + createSymbolTable: () => createSymbolTable, + createSymlinkCache: () => createSymlinkCache, + createSystemWatchFunctions: () => createSystemWatchFunctions, + createTextChange: () => createTextChange, + createTextChangeFromStartLength: () => createTextChangeFromStartLength, + createTextChangeRange: () => createTextChangeRange, + createTextRangeFromNode: () => createTextRangeFromNode, + createTextRangeFromSpan: () => createTextRangeFromSpan, + createTextSpan: () => createTextSpan, + createTextSpanFromBounds: () => createTextSpanFromBounds, + createTextSpanFromNode: () => createTextSpanFromNode, + createTextSpanFromRange: () => createTextSpanFromRange, + createTextSpanFromStringLiteralLikeContent: () => createTextSpanFromStringLiteralLikeContent, + createTextWriter: () => createTextWriter, + createTokenRange: () => createTokenRange, + createTypeChecker: () => createTypeChecker, + createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache, + createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader, + createUnparsedSourceFile: () => createUnparsedSourceFile, + createWatchCompilerHost: () => createWatchCompilerHost2, + createWatchCompilerHostOfConfigFile: () => createWatchCompilerHostOfConfigFile, + createWatchCompilerHostOfFilesAndCompilerOptions: () => createWatchCompilerHostOfFilesAndCompilerOptions, + createWatchFactory: () => createWatchFactory, + createWatchHost: () => createWatchHost, + createWatchProgram: () => createWatchProgram, + createWatchStatusReporter: () => createWatchStatusReporter, + createWriteFileMeasuringIO: () => createWriteFileMeasuringIO, + declarationNameToString: () => declarationNameToString, + decodeMappings: () => decodeMappings, + decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith, + decorateHelper: () => decorateHelper, + deduplicate: () => deduplicate, + defaultIncludeSpec: () => defaultIncludeSpec, + defaultInitCompilerOptions: () => defaultInitCompilerOptions, + defaultMaximumTruncationLength: () => defaultMaximumTruncationLength, + detectSortCaseSensitivity: () => detectSortCaseSensitivity, + diagnosticCategoryName: () => diagnosticCategoryName, + diagnosticToString: () => diagnosticToString, + directoryProbablyExists: () => directoryProbablyExists, + directorySeparator: () => directorySeparator, + displayPart: () => displayPart, + displayPartsToString: () => displayPartsToString, + disposeEmitNodes: () => disposeEmitNodes, + disposeResourcesHelper: () => disposeResourcesHelper, + documentSpansEqual: () => documentSpansEqual, + dumpTracingLegend: () => dumpTracingLegend, + elementAt: () => elementAt, + elideNodes: () => elideNodes, + emitComments: () => emitComments, + emitDetachedComments: () => emitDetachedComments, + emitFiles: () => emitFiles, + emitFilesAndReportErrors: () => emitFilesAndReportErrors, + emitFilesAndReportErrorsAndGetExitStatus: () => emitFilesAndReportErrorsAndGetExitStatus, + emitModuleKindIsNonNodeESM: () => emitModuleKindIsNonNodeESM, + emitNewLineBeforeLeadingCommentOfPosition: () => emitNewLineBeforeLeadingCommentOfPosition, + emitNewLineBeforeLeadingComments: () => emitNewLineBeforeLeadingComments, + emitNewLineBeforeLeadingCommentsOfPosition: () => emitNewLineBeforeLeadingCommentsOfPosition, + emitSkippedWithNoDiagnostics: () => emitSkippedWithNoDiagnostics, + emitUsingBuildInfo: () => emitUsingBuildInfo, + emptyArray: () => emptyArray, + emptyFileSystemEntries: () => emptyFileSystemEntries, + emptyMap: () => emptyMap, + emptyOptions: () => emptyOptions, + emptySet: () => emptySet, + endsWith: () => endsWith2, + ensurePathIsNonModuleName: () => ensurePathIsNonModuleName, + ensureScriptKind: () => ensureScriptKind, + ensureTrailingDirectorySeparator: () => ensureTrailingDirectorySeparator, + entityNameToString: () => entityNameToString, + enumerateInsertsAndDeletes: () => enumerateInsertsAndDeletes, + equalOwnProperties: () => equalOwnProperties, + equateStringsCaseInsensitive: () => equateStringsCaseInsensitive, + equateStringsCaseSensitive: () => equateStringsCaseSensitive, + equateValues: () => equateValues, + esDecorateHelper: () => esDecorateHelper, + escapeJsxAttributeString: () => escapeJsxAttributeString, + escapeLeadingUnderscores: () => escapeLeadingUnderscores, + escapeNonAsciiString: () => escapeNonAsciiString, + escapeSnippetText: () => escapeSnippetText, + escapeString: () => escapeString2, + escapeTemplateSubstitution: () => escapeTemplateSubstitution, + every: () => every2, + expandPreOrPostfixIncrementOrDecrementExpression: () => expandPreOrPostfixIncrementOrDecrementExpression, + explainFiles: () => explainFiles, + explainIfFileIsRedirectAndImpliedFormat: () => explainIfFileIsRedirectAndImpliedFormat, + exportAssignmentIsAlias: () => exportAssignmentIsAlias, + exportStarHelper: () => exportStarHelper, + expressionResultIsUnused: () => expressionResultIsUnused, + extend: () => extend3, + extendsHelper: () => extendsHelper, + extensionFromPath: () => extensionFromPath, + extensionIsTS: () => extensionIsTS, + extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution, + externalHelpersModuleNameText: () => externalHelpersModuleNameText, + factory: () => factory, + fileExtensionIs: () => fileExtensionIs, + fileExtensionIsOneOf: () => fileExtensionIsOneOf, + fileIncludeReasonToDiagnostics: () => fileIncludeReasonToDiagnostics, + fileShouldUseJavaScriptRequire: () => fileShouldUseJavaScriptRequire, + filter: () => filter2, + filterMutate: () => filterMutate, + filterSemanticDiagnostics: () => filterSemanticDiagnostics, + find: () => find2, + findAncestor: () => findAncestor, + findBestPatternMatch: () => findBestPatternMatch, + findChildOfKind: () => findChildOfKind, + findComputedPropertyNameCacheAssignment: () => findComputedPropertyNameCacheAssignment, + findConfigFile: () => findConfigFile, + findContainingList: () => findContainingList, + findDiagnosticForNode: () => findDiagnosticForNode, + findFirstNonJsxWhitespaceToken: () => findFirstNonJsxWhitespaceToken, + findIndex: () => findIndex2, + findLast: () => findLast2, + findLastIndex: () => findLastIndex2, + findListItemInfo: () => findListItemInfo, + findMap: () => findMap, + findModifier: () => findModifier, + findNextToken: () => findNextToken, + findPackageJson: () => findPackageJson, + findPackageJsons: () => findPackageJsons, + findPrecedingMatchingToken: () => findPrecedingMatchingToken, + findPrecedingToken: () => findPrecedingToken, + findSuperStatementIndexPath: () => findSuperStatementIndexPath, + findTokenOnLeftOfPosition: () => findTokenOnLeftOfPosition, + findUseStrictPrologue: () => findUseStrictPrologue, + first: () => first, + firstDefined: () => firstDefined, + firstDefinedIterator: () => firstDefinedIterator, + firstIterator: () => firstIterator, + firstOrOnly: () => firstOrOnly, + firstOrUndefined: () => firstOrUndefined, + firstOrUndefinedIterator: () => firstOrUndefinedIterator, + fixupCompilerOptions: () => fixupCompilerOptions, + flatMap: () => flatMap2, + flatMapIterator: () => flatMapIterator, + flatMapToMutable: () => flatMapToMutable, + flatten: () => flatten2, + flattenCommaList: () => flattenCommaList, + flattenDestructuringAssignment: () => flattenDestructuringAssignment, + flattenDestructuringBinding: () => flattenDestructuringBinding, + flattenDiagnosticMessageText: () => flattenDiagnosticMessageText, + forEach: () => forEach4, + forEachAncestor: () => forEachAncestor, + forEachAncestorDirectory: () => forEachAncestorDirectory, + forEachChild: () => forEachChild, + forEachChildRecursively: () => forEachChildRecursively, + forEachEmittedFile: () => forEachEmittedFile, + forEachEnclosingBlockScopeContainer: () => forEachEnclosingBlockScopeContainer, + forEachEntry: () => forEachEntry, + forEachExternalModuleToImportFrom: () => forEachExternalModuleToImportFrom, + forEachImportClauseDeclaration: () => forEachImportClauseDeclaration, + forEachKey: () => forEachKey, + forEachLeadingCommentRange: () => forEachLeadingCommentRange, + forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft, + forEachPropertyAssignment: () => forEachPropertyAssignment, + forEachResolvedProjectReference: () => forEachResolvedProjectReference, + forEachReturnStatement: () => forEachReturnStatement, + forEachRight: () => forEachRight2, + forEachTrailingCommentRange: () => forEachTrailingCommentRange, + forEachTsConfigPropArray: () => forEachTsConfigPropArray, + forEachUnique: () => forEachUnique, + forEachYieldExpression: () => forEachYieldExpression, + forSomeAncestorDirectory: () => forSomeAncestorDirectory, + formatColorAndReset: () => formatColorAndReset, + formatDiagnostic: () => formatDiagnostic, + formatDiagnostics: () => formatDiagnostics, + formatDiagnosticsWithColorAndContext: () => formatDiagnosticsWithColorAndContext, + formatGeneratedName: () => formatGeneratedName, + formatGeneratedNamePart: () => formatGeneratedNamePart, + formatLocation: () => formatLocation, + formatMessage: () => formatMessage, + formatStringFromArgs: () => formatStringFromArgs, + formatting: () => ts_formatting_exports, + fullTripleSlashAMDReferencePathRegEx: () => fullTripleSlashAMDReferencePathRegEx, + fullTripleSlashReferencePathRegEx: () => fullTripleSlashReferencePathRegEx, + generateDjb2Hash: () => generateDjb2Hash, + generateTSConfig: () => generateTSConfig, + generatorHelper: () => generatorHelper, + getAdjustedReferenceLocation: () => getAdjustedReferenceLocation, + getAdjustedRenameLocation: () => getAdjustedRenameLocation, + getAliasDeclarationFromName: () => getAliasDeclarationFromName, + getAllAccessorDeclarations: () => getAllAccessorDeclarations, + getAllDecoratorsOfClass: () => getAllDecoratorsOfClass, + getAllDecoratorsOfClassElement: () => getAllDecoratorsOfClassElement, + getAllJSDocTags: () => getAllJSDocTags, + getAllJSDocTagsOfKind: () => getAllJSDocTagsOfKind, + getAllKeys: () => getAllKeys2, + getAllProjectOutputs: () => getAllProjectOutputs, + getAllSuperTypeNodes: () => getAllSuperTypeNodes, + getAllUnscopedEmitHelpers: () => getAllUnscopedEmitHelpers, + getAllowJSCompilerOption: () => getAllowJSCompilerOption, + getAllowSyntheticDefaultImports: () => getAllowSyntheticDefaultImports, + getAncestor: () => getAncestor, + getAnyExtensionFromPath: () => getAnyExtensionFromPath, + getAreDeclarationMapsEnabled: () => getAreDeclarationMapsEnabled, + getAssignedExpandoInitializer: () => getAssignedExpandoInitializer, + getAssignedName: () => getAssignedName, + getAssignedNameOfIdentifier: () => getAssignedNameOfIdentifier, + getAssignmentDeclarationKind: () => getAssignmentDeclarationKind, + getAssignmentDeclarationPropertyAccessKind: () => getAssignmentDeclarationPropertyAccessKind, + getAssignmentTargetKind: () => getAssignmentTargetKind, + getAutomaticTypeDirectiveNames: () => getAutomaticTypeDirectiveNames, + getBaseFileName: () => getBaseFileName, + getBinaryOperatorPrecedence: () => getBinaryOperatorPrecedence, + getBuildInfo: () => getBuildInfo, + getBuildInfoFileVersionMap: () => getBuildInfoFileVersionMap, + getBuildInfoText: () => getBuildInfoText, + getBuildOrderFromAnyBuildOrder: () => getBuildOrderFromAnyBuildOrder, + getBuilderCreationParameters: () => getBuilderCreationParameters, + getBuilderFileEmit: () => getBuilderFileEmit, + getCheckFlags: () => getCheckFlags, + getClassExtendsHeritageElement: () => getClassExtendsHeritageElement, + getClassLikeDeclarationOfSymbol: () => getClassLikeDeclarationOfSymbol, + getCombinedLocalAndExportSymbolFlags: () => getCombinedLocalAndExportSymbolFlags, + getCombinedModifierFlags: () => getCombinedModifierFlags, + getCombinedNodeFlags: () => getCombinedNodeFlags, + getCombinedNodeFlagsAlwaysIncludeJSDoc: () => getCombinedNodeFlagsAlwaysIncludeJSDoc, + getCommentRange: () => getCommentRange, + getCommonSourceDirectory: () => getCommonSourceDirectory, + getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig, + getCompilerOptionValue: () => getCompilerOptionValue, + getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue, + getConditions: () => getConditions, + getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics, + getConstantValue: () => getConstantValue, + getContainerFlags: () => getContainerFlags, + getContainerNode: () => getContainerNode, + getContainingClass: () => getContainingClass, + getContainingClassExcludingClassDecorators: () => getContainingClassExcludingClassDecorators, + getContainingClassStaticBlock: () => getContainingClassStaticBlock, + getContainingFunction: () => getContainingFunction, + getContainingFunctionDeclaration: () => getContainingFunctionDeclaration, + getContainingFunctionOrClassStaticBlock: () => getContainingFunctionOrClassStaticBlock, + getContainingNodeArray: () => getContainingNodeArray, + getContainingObjectLiteralElement: () => getContainingObjectLiteralElement, + getContextualTypeFromParent: () => getContextualTypeFromParent, + getContextualTypeFromParentOrAncestorTypeNode: () => getContextualTypeFromParentOrAncestorTypeNode, + getCurrentTime: () => getCurrentTime, + getDeclarationDiagnostics: () => getDeclarationDiagnostics, + getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath, + getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath, + getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker, + getDeclarationFileExtension: () => getDeclarationFileExtension, + getDeclarationFromName: () => getDeclarationFromName, + getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol, + getDeclarationOfKind: () => getDeclarationOfKind, + getDeclarationsOfKind: () => getDeclarationsOfKind, + getDeclaredExpandoInitializer: () => getDeclaredExpandoInitializer, + getDecorators: () => getDecorators, + getDefaultCompilerOptions: () => getDefaultCompilerOptions2, + getDefaultExportInfoWorker: () => getDefaultExportInfoWorker, + getDefaultFormatCodeSettings: () => getDefaultFormatCodeSettings, + getDefaultLibFileName: () => getDefaultLibFileName, + getDefaultLibFilePath: () => getDefaultLibFilePath, + getDefaultLikeExportInfo: () => getDefaultLikeExportInfo, + getDiagnosticText: () => getDiagnosticText, + getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan, + getDirectoryPath: () => getDirectoryPath, + getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation, + getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot, + getDocumentPositionMapper: () => getDocumentPositionMapper, + getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer, + getESModuleInterop: () => getESModuleInterop, + getEditsForFileRename: () => getEditsForFileRename, + getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode, + getEffectiveConstraintOfTypeParameter: () => getEffectiveConstraintOfTypeParameter, + getEffectiveContainerForJSDocTemplateTag: () => getEffectiveContainerForJSDocTemplateTag, + getEffectiveImplementsTypeNodes: () => getEffectiveImplementsTypeNodes, + getEffectiveInitializer: () => getEffectiveInitializer, + getEffectiveJSDocHost: () => getEffectiveJSDocHost, + getEffectiveModifierFlags: () => getEffectiveModifierFlags, + getEffectiveModifierFlagsAlwaysIncludeJSDoc: () => getEffectiveModifierFlagsAlwaysIncludeJSDoc, + getEffectiveModifierFlagsNoCache: () => getEffectiveModifierFlagsNoCache, + getEffectiveReturnTypeNode: () => getEffectiveReturnTypeNode, + getEffectiveSetAccessorTypeAnnotationNode: () => getEffectiveSetAccessorTypeAnnotationNode, + getEffectiveTypeAnnotationNode: () => getEffectiveTypeAnnotationNode, + getEffectiveTypeParameterDeclarations: () => getEffectiveTypeParameterDeclarations, + getEffectiveTypeRoots: () => getEffectiveTypeRoots, + getElementOrPropertyAccessArgumentExpressionOrName: () => getElementOrPropertyAccessArgumentExpressionOrName, + getElementOrPropertyAccessName: () => getElementOrPropertyAccessName, + getElementsOfBindingOrAssignmentPattern: () => getElementsOfBindingOrAssignmentPattern, + getEmitDeclarations: () => getEmitDeclarations, + getEmitFlags: () => getEmitFlags, + getEmitHelpers: () => getEmitHelpers, + getEmitModuleDetectionKind: () => getEmitModuleDetectionKind, + getEmitModuleKind: () => getEmitModuleKind, + getEmitModuleResolutionKind: () => getEmitModuleResolutionKind, + getEmitScriptTarget: () => getEmitScriptTarget, + getEmitStandardClassFields: () => getEmitStandardClassFields, + getEnclosingBlockScopeContainer: () => getEnclosingBlockScopeContainer, + getEnclosingContainer: () => getEnclosingContainer, + getEncodedSemanticClassifications: () => getEncodedSemanticClassifications, + getEncodedSyntacticClassifications: () => getEncodedSyntacticClassifications, + getEndLinePosition: () => getEndLinePosition, + getEntityNameFromTypeNode: () => getEntityNameFromTypeNode, + getEntrypointsFromPackageJsonInfo: () => getEntrypointsFromPackageJsonInfo, + getErrorCountForSummary: () => getErrorCountForSummary, + getErrorSpanForNode: () => getErrorSpanForNode, + getErrorSummaryText: () => getErrorSummaryText, + getEscapedTextOfIdentifierOrLiteral: () => getEscapedTextOfIdentifierOrLiteral, + getEscapedTextOfJsxAttributeName: () => getEscapedTextOfJsxAttributeName, + getEscapedTextOfJsxNamespacedName: () => getEscapedTextOfJsxNamespacedName, + getExpandoInitializer: () => getExpandoInitializer, + getExportAssignmentExpression: () => getExportAssignmentExpression, + getExportInfoMap: () => getExportInfoMap, + getExportNeedsImportStarHelper: () => getExportNeedsImportStarHelper, + getExpressionAssociativity: () => getExpressionAssociativity, + getExpressionPrecedence: () => getExpressionPrecedence, + getExternalHelpersModuleName: () => getExternalHelpersModuleName, + getExternalModuleImportEqualsDeclarationExpression: () => getExternalModuleImportEqualsDeclarationExpression, + getExternalModuleName: () => getExternalModuleName, + getExternalModuleNameFromDeclaration: () => getExternalModuleNameFromDeclaration, + getExternalModuleNameFromPath: () => getExternalModuleNameFromPath, + getExternalModuleNameLiteral: () => getExternalModuleNameLiteral, + getExternalModuleRequireArgument: () => getExternalModuleRequireArgument, + getFallbackOptions: () => getFallbackOptions, + getFileEmitOutput: () => getFileEmitOutput, + getFileMatcherPatterns: () => getFileMatcherPatterns, + getFileNamesFromConfigSpecs: () => getFileNamesFromConfigSpecs, + getFileWatcherEventKind: () => getFileWatcherEventKind, + getFilesInErrorForSummary: () => getFilesInErrorForSummary, + getFirstConstructorWithBody: () => getFirstConstructorWithBody, + getFirstIdentifier: () => getFirstIdentifier, + getFirstNonSpaceCharacterPosition: () => getFirstNonSpaceCharacterPosition, + getFirstProjectOutput: () => getFirstProjectOutput, + getFixableErrorSpanExpression: () => getFixableErrorSpanExpression, + getFormatCodeSettingsForWriting: () => getFormatCodeSettingsForWriting, + getFullWidth: () => getFullWidth, + getFunctionFlags: () => getFunctionFlags, + getHeritageClause: () => getHeritageClause, + getHostSignatureFromJSDoc: () => getHostSignatureFromJSDoc, + getIdentifierAutoGenerate: () => getIdentifierAutoGenerate, + getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference, + getIdentifierTypeArguments: () => getIdentifierTypeArguments, + getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression, + getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile, + getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker, + getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper, + getImportNeedsImportStarHelper: () => getImportNeedsImportStarHelper, + getIndentSize: () => getIndentSize, + getIndentString: () => getIndentString, + getInferredLibraryNameResolveFrom: () => getInferredLibraryNameResolveFrom, + getInitializedVariables: () => getInitializedVariables, + getInitializerOfBinaryExpression: () => getInitializerOfBinaryExpression, + getInitializerOfBindingOrAssignmentElement: () => getInitializerOfBindingOrAssignmentElement, + getInterfaceBaseTypeNodes: () => getInterfaceBaseTypeNodes, + getInternalEmitFlags: () => getInternalEmitFlags, + getInvokedExpression: () => getInvokedExpression, + getIsolatedModules: () => getIsolatedModules, + getJSDocAugmentsTag: () => getJSDocAugmentsTag, + getJSDocClassTag: () => getJSDocClassTag, + getJSDocCommentRanges: () => getJSDocCommentRanges, + getJSDocCommentsAndTags: () => getJSDocCommentsAndTags, + getJSDocDeprecatedTag: () => getJSDocDeprecatedTag, + getJSDocDeprecatedTagNoCache: () => getJSDocDeprecatedTagNoCache, + getJSDocEnumTag: () => getJSDocEnumTag, + getJSDocHost: () => getJSDocHost, + getJSDocImplementsTags: () => getJSDocImplementsTags, + getJSDocOverloadTags: () => getJSDocOverloadTags, + getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache, + getJSDocParameterTags: () => getJSDocParameterTags, + getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache, + getJSDocPrivateTag: () => getJSDocPrivateTag, + getJSDocPrivateTagNoCache: () => getJSDocPrivateTagNoCache, + getJSDocProtectedTag: () => getJSDocProtectedTag, + getJSDocProtectedTagNoCache: () => getJSDocProtectedTagNoCache, + getJSDocPublicTag: () => getJSDocPublicTag, + getJSDocPublicTagNoCache: () => getJSDocPublicTagNoCache, + getJSDocReadonlyTag: () => getJSDocReadonlyTag, + getJSDocReadonlyTagNoCache: () => getJSDocReadonlyTagNoCache, + getJSDocReturnTag: () => getJSDocReturnTag, + getJSDocReturnType: () => getJSDocReturnType, + getJSDocRoot: () => getJSDocRoot, + getJSDocSatisfiesExpressionType: () => getJSDocSatisfiesExpressionType, + getJSDocSatisfiesTag: () => getJSDocSatisfiesTag, + getJSDocTags: () => getJSDocTags, + getJSDocTagsNoCache: () => getJSDocTagsNoCache, + getJSDocTemplateTag: () => getJSDocTemplateTag, + getJSDocThisTag: () => getJSDocThisTag, + getJSDocType: () => getJSDocType, + getJSDocTypeAliasName: () => getJSDocTypeAliasName, + getJSDocTypeAssertionType: () => getJSDocTypeAssertionType, + getJSDocTypeParameterDeclarations: () => getJSDocTypeParameterDeclarations, + getJSDocTypeParameterTags: () => getJSDocTypeParameterTags, + getJSDocTypeParameterTagsNoCache: () => getJSDocTypeParameterTagsNoCache, + getJSDocTypeTag: () => getJSDocTypeTag, + getJSXImplicitImportBase: () => getJSXImplicitImportBase, + getJSXRuntimeImport: () => getJSXRuntimeImport, + getJSXTransformEnabled: () => getJSXTransformEnabled, + getKeyForCompilerOptions: () => getKeyForCompilerOptions, + getLanguageVariant: () => getLanguageVariant, + getLastChild: () => getLastChild, + getLeadingCommentRanges: () => getLeadingCommentRanges, + getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode, + getLeftmostAccessExpression: () => getLeftmostAccessExpression, + getLeftmostExpression: () => getLeftmostExpression, + getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName, + getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition, + getLineInfo: () => getLineInfo, + getLineOfLocalPosition: () => getLineOfLocalPosition, + getLineOfLocalPositionFromLineMap: () => getLineOfLocalPositionFromLineMap, + getLineStartPositionForPosition: () => getLineStartPositionForPosition, + getLineStarts: () => getLineStarts, + getLinesBetweenPositionAndNextNonWhitespaceCharacter: () => getLinesBetweenPositionAndNextNonWhitespaceCharacter, + getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter: () => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter, + getLinesBetweenPositions: () => getLinesBetweenPositions, + getLinesBetweenRangeEndAndRangeStart: () => getLinesBetweenRangeEndAndRangeStart, + getLinesBetweenRangeEndPositions: () => getLinesBetweenRangeEndPositions, + getLiteralText: () => getLiteralText, + getLocalNameForExternalImport: () => getLocalNameForExternalImport, + getLocalSymbolForExportDefault: () => getLocalSymbolForExportDefault, + getLocaleSpecificMessage: () => getLocaleSpecificMessage, + getLocaleTimeString: () => getLocaleTimeString, + getMappedContextSpan: () => getMappedContextSpan, + getMappedDocumentSpan: () => getMappedDocumentSpan, + getMappedLocation: () => getMappedLocation, + getMatchedFileSpec: () => getMatchedFileSpec, + getMatchedIncludeSpec: () => getMatchedIncludeSpec, + getMeaningFromDeclaration: () => getMeaningFromDeclaration, + getMeaningFromLocation: () => getMeaningFromLocation, + getMembersOfDeclaration: () => getMembersOfDeclaration, + getModeForFileReference: () => getModeForFileReference, + getModeForResolutionAtIndex: () => getModeForResolutionAtIndex, + getModeForUsageLocation: () => getModeForUsageLocation, + getModifiedTime: () => getModifiedTime, + getModifiers: () => getModifiers, + getModuleInstanceState: () => getModuleInstanceState, + getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt, + getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference, + getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost, + getNameForExportedSymbol: () => getNameForExportedSymbol, + getNameFromImportAttribute: () => getNameFromImportAttribute, + getNameFromIndexInfo: () => getNameFromIndexInfo, + getNameFromPropertyName: () => getNameFromPropertyName, + getNameOfAccessExpression: () => getNameOfAccessExpression, + getNameOfCompilerOptionValue: () => getNameOfCompilerOptionValue, + getNameOfDeclaration: () => getNameOfDeclaration, + getNameOfExpando: () => getNameOfExpando, + getNameOfJSDocTypedef: () => getNameOfJSDocTypedef, + getNameOrArgument: () => getNameOrArgument, + getNameTable: () => getNameTable, + getNamesForExportedSymbol: () => getNamesForExportedSymbol, + getNamespaceDeclarationNode: () => getNamespaceDeclarationNode, + getNewLineCharacter: () => getNewLineCharacter, + getNewLineKind: () => getNewLineKind, + getNewLineOrDefaultFromHost: () => getNewLineOrDefaultFromHost, + getNewTargetContainer: () => getNewTargetContainer, + getNextJSDocCommentLocation: () => getNextJSDocCommentLocation, + getNodeForGeneratedName: () => getNodeForGeneratedName, + getNodeId: () => getNodeId, + getNodeKind: () => getNodeKind, + getNodeModifiers: () => getNodeModifiers, + getNodeModulePathParts: () => getNodeModulePathParts, + getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration, + getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment, + getNonAugmentationDeclaration: () => getNonAugmentationDeclaration, + getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode, + getNormalizedAbsolutePath: () => getNormalizedAbsolutePath, + getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot, + getNormalizedPathComponents: () => getNormalizedPathComponents, + getObjectFlags: () => getObjectFlags, + getOperator: () => getOperator, + getOperatorAssociativity: () => getOperatorAssociativity, + getOperatorPrecedence: () => getOperatorPrecedence, + getOptionFromName: () => getOptionFromName, + getOptionsForLibraryResolution: () => getOptionsForLibraryResolution, + getOptionsNameMap: () => getOptionsNameMap, + getOrCreateEmitNode: () => getOrCreateEmitNode, + getOrCreateExternalHelpersModuleNameIfNeeded: () => getOrCreateExternalHelpersModuleNameIfNeeded, + getOrUpdate: () => getOrUpdate, + getOriginalNode: () => getOriginalNode, + getOriginalNodeId: () => getOriginalNodeId, + getOriginalSourceFile: () => getOriginalSourceFile, + getOutputDeclarationFileName: () => getOutputDeclarationFileName, + getOutputDeclarationFileNameWorker: () => getOutputDeclarationFileNameWorker, + getOutputExtension: () => getOutputExtension, + getOutputFileNames: () => getOutputFileNames, + getOutputJSFileNameWorker: () => getOutputJSFileNameWorker, + getOutputPathsFor: () => getOutputPathsFor, + getOutputPathsForBundle: () => getOutputPathsForBundle, + getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath, + getOwnKeys: () => getOwnKeys, + getOwnValues: () => getOwnValues, + getPackageJsonInfo: () => getPackageJsonInfo, + getPackageJsonTypesVersionsPaths: () => getPackageJsonTypesVersionsPaths, + getPackageJsonsVisibleToFile: () => getPackageJsonsVisibleToFile, + getPackageNameFromTypesPackageName: () => getPackageNameFromTypesPackageName, + getPackageScopeForPath: () => getPackageScopeForPath, + getParameterSymbolFromJSDoc: () => getParameterSymbolFromJSDoc, + getParameterTypeNode: () => getParameterTypeNode, + getParentNodeInSpan: () => getParentNodeInSpan, + getParseTreeNode: () => getParseTreeNode, + getParsedCommandLineOfConfigFile: () => getParsedCommandLineOfConfigFile, + getPathComponents: () => getPathComponents, + getPathComponentsRelativeTo: () => getPathComponentsRelativeTo, + getPathFromPathComponents: () => getPathFromPathComponents, + getPathUpdater: () => getPathUpdater, + getPathsBasePath: () => getPathsBasePath, + getPatternFromSpec: () => getPatternFromSpec, + getPendingEmitKind: () => getPendingEmitKind, + getPositionOfLineAndCharacter: () => getPositionOfLineAndCharacter, + getPossibleGenericSignatures: () => getPossibleGenericSignatures, + getPossibleOriginalInputExtensionForExtension: () => getPossibleOriginalInputExtensionForExtension, + getPossibleTypeArgumentsInfo: () => getPossibleTypeArgumentsInfo, + getPreEmitDiagnostics: () => getPreEmitDiagnostics, + getPrecedingNonSpaceCharacterPosition: () => getPrecedingNonSpaceCharacterPosition, + getPrivateIdentifier: () => getPrivateIdentifier, + getProperties: () => getProperties, + getProperty: () => getProperty, + getPropertyArrayElementValue: () => getPropertyArrayElementValue, + getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression, + getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode, + getPropertyNameForUniqueESSymbol: () => getPropertyNameForUniqueESSymbol, + getPropertyNameFromType: () => getPropertyNameFromType, + getPropertyNameOfBindingOrAssignmentElement: () => getPropertyNameOfBindingOrAssignmentElement, + getPropertySymbolFromBindingElement: () => getPropertySymbolFromBindingElement, + getPropertySymbolsFromContextualType: () => getPropertySymbolsFromContextualType, + getQuoteFromPreference: () => getQuoteFromPreference, + getQuotePreference: () => getQuotePreference, + getRangesWhere: () => getRangesWhere, + getRefactorContextSpan: () => getRefactorContextSpan, + getReferencedFileLocation: () => getReferencedFileLocation, + getRegexFromPattern: () => getRegexFromPattern, + getRegularExpressionForWildcard: () => getRegularExpressionForWildcard, + getRegularExpressionsForWildcards: () => getRegularExpressionsForWildcards, + getRelativePathFromDirectory: () => getRelativePathFromDirectory, + getRelativePathFromFile: () => getRelativePathFromFile, + getRelativePathToDirectoryOrUrl: () => getRelativePathToDirectoryOrUrl, + getRenameLocation: () => getRenameLocation, + getReplacementSpanForContextToken: () => getReplacementSpanForContextToken, + getResolutionDiagnostic: () => getResolutionDiagnostic, + getResolutionModeOverride: () => getResolutionModeOverride, + getResolveJsonModule: () => getResolveJsonModule, + getResolvePackageJsonExports: () => getResolvePackageJsonExports, + getResolvePackageJsonImports: () => getResolvePackageJsonImports, + getResolvedExternalModuleName: () => getResolvedExternalModuleName, + getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement, + getRestParameterElementType: () => getRestParameterElementType, + getRightMostAssignedExpression: () => getRightMostAssignedExpression, + getRootDeclaration: () => getRootDeclaration, + getRootDirectoryOfResolutionCache: () => getRootDirectoryOfResolutionCache, + getRootLength: () => getRootLength, + getRootPathSplitLength: () => getRootPathSplitLength, + getScriptKind: () => getScriptKind, + getScriptKindFromFileName: () => getScriptKindFromFileName, + getScriptTargetFeatures: () => getScriptTargetFeatures, + getSelectedEffectiveModifierFlags: () => getSelectedEffectiveModifierFlags, + getSelectedSyntacticModifierFlags: () => getSelectedSyntacticModifierFlags, + getSemanticClassifications: () => getSemanticClassifications, + getSemanticJsxChildren: () => getSemanticJsxChildren, + getSetAccessorTypeAnnotationNode: () => getSetAccessorTypeAnnotationNode, + getSetAccessorValueParameter: () => getSetAccessorValueParameter, + getSetExternalModuleIndicator: () => getSetExternalModuleIndicator, + getShebang: () => getShebang, + getSingleInitializerOfVariableStatementOrPropertyDeclaration: () => getSingleInitializerOfVariableStatementOrPropertyDeclaration, + getSingleVariableOfVariableStatement: () => getSingleVariableOfVariableStatement, + getSnapshotText: () => getSnapshotText, + getSnippetElement: () => getSnippetElement, + getSourceFileOfModule: () => getSourceFileOfModule, + getSourceFileOfNode: () => getSourceFileOfNode, + getSourceFilePathInNewDir: () => getSourceFilePathInNewDir, + getSourceFilePathInNewDirWorker: () => getSourceFilePathInNewDirWorker, + getSourceFileVersionAsHashFromText: () => getSourceFileVersionAsHashFromText, + getSourceFilesToEmit: () => getSourceFilesToEmit, + getSourceMapRange: () => getSourceMapRange, + getSourceMapper: () => getSourceMapper, + getSourceTextOfNodeFromSourceFile: () => getSourceTextOfNodeFromSourceFile, + getSpanOfTokenAtPosition: () => getSpanOfTokenAtPosition, + getSpellingSuggestion: () => getSpellingSuggestion, + getStartPositionOfLine: () => getStartPositionOfLine, + getStartPositionOfRange: () => getStartPositionOfRange, + getStartsOnNewLine: () => getStartsOnNewLine, + getStaticPropertiesAndClassStaticBlock: () => getStaticPropertiesAndClassStaticBlock, + getStrictOptionValue: () => getStrictOptionValue, + getStringComparer: () => getStringComparer, + getSubPatternFromSpec: () => getSubPatternFromSpec, + getSuperCallFromStatement: () => getSuperCallFromStatement, + getSuperContainer: () => getSuperContainer, + getSupportedCodeFixes: () => getSupportedCodeFixes, + getSupportedExtensions: () => getSupportedExtensions, + getSupportedExtensionsWithJsonIfResolveJsonModule: () => getSupportedExtensionsWithJsonIfResolveJsonModule, + getSwitchedType: () => getSwitchedType, + getSymbolId: () => getSymbolId, + getSymbolNameForPrivateIdentifier: () => getSymbolNameForPrivateIdentifier, + getSymbolTarget: () => getSymbolTarget, + getSyntacticClassifications: () => getSyntacticClassifications, + getSyntacticModifierFlags: () => getSyntacticModifierFlags, + getSyntacticModifierFlagsNoCache: () => getSyntacticModifierFlagsNoCache, + getSynthesizedDeepClone: () => getSynthesizedDeepClone, + getSynthesizedDeepCloneWithReplacements: () => getSynthesizedDeepCloneWithReplacements, + getSynthesizedDeepClones: () => getSynthesizedDeepClones, + getSynthesizedDeepClonesWithReplacements: () => getSynthesizedDeepClonesWithReplacements, + getSyntheticLeadingComments: () => getSyntheticLeadingComments, + getSyntheticTrailingComments: () => getSyntheticTrailingComments, + getTargetLabel: () => getTargetLabel, + getTargetOfBindingOrAssignmentElement: () => getTargetOfBindingOrAssignmentElement, + getTemporaryModuleResolutionState: () => getTemporaryModuleResolutionState, + getTextOfConstantValue: () => getTextOfConstantValue, + getTextOfIdentifierOrLiteral: () => getTextOfIdentifierOrLiteral, + getTextOfJSDocComment: () => getTextOfJSDocComment, + getTextOfJsxAttributeName: () => getTextOfJsxAttributeName, + getTextOfJsxNamespacedName: () => getTextOfJsxNamespacedName, + getTextOfNode: () => getTextOfNode, + getTextOfNodeFromSourceText: () => getTextOfNodeFromSourceText, + getTextOfPropertyName: () => getTextOfPropertyName, + getThisContainer: () => getThisContainer, + getThisParameter: () => getThisParameter, + getTokenAtPosition: () => getTokenAtPosition, + getTokenPosOfNode: () => getTokenPosOfNode, + getTokenSourceMapRange: () => getTokenSourceMapRange, + getTouchingPropertyName: () => getTouchingPropertyName, + getTouchingToken: () => getTouchingToken, + getTrailingCommentRanges: () => getTrailingCommentRanges, + getTrailingSemicolonDeferringWriter: () => getTrailingSemicolonDeferringWriter, + getTransformFlagsSubtreeExclusions: () => getTransformFlagsSubtreeExclusions, + getTransformers: () => getTransformers, + getTsBuildInfoEmitOutputFilePath: () => getTsBuildInfoEmitOutputFilePath, + getTsConfigObjectLiteralExpression: () => getTsConfigObjectLiteralExpression, + getTsConfigPropArrayElementValue: () => getTsConfigPropArrayElementValue, + getTypeAnnotationNode: () => getTypeAnnotationNode, + getTypeArgumentOrTypeParameterList: () => getTypeArgumentOrTypeParameterList, + getTypeKeywordOfTypeOnlyImport: () => getTypeKeywordOfTypeOnlyImport, + getTypeNode: () => getTypeNode, + getTypeNodeIfAccessible: () => getTypeNodeIfAccessible, + getTypeParameterFromJsDoc: () => getTypeParameterFromJsDoc, + getTypeParameterOwner: () => getTypeParameterOwner, + getTypesPackageName: () => getTypesPackageName, + getUILocale: () => getUILocale, + getUniqueName: () => getUniqueName, + getUniqueSymbolId: () => getUniqueSymbolId, + getUseDefineForClassFields: () => getUseDefineForClassFields, + getWatchErrorSummaryDiagnosticMessage: () => getWatchErrorSummaryDiagnosticMessage, + getWatchFactory: () => getWatchFactory, + group: () => group2, + groupBy: () => groupBy2, + guessIndentation: () => guessIndentation, + handleNoEmitOptions: () => handleNoEmitOptions, + hasAbstractModifier: () => hasAbstractModifier, + hasAccessorModifier: () => hasAccessorModifier, + hasAmbientModifier: () => hasAmbientModifier, + hasChangesInResolutions: () => hasChangesInResolutions, + hasChildOfKind: () => hasChildOfKind, + hasContextSensitiveParameters: () => hasContextSensitiveParameters, + hasDecorators: () => hasDecorators, + hasDocComment: () => hasDocComment, + hasDynamicName: () => hasDynamicName, + hasEffectiveModifier: () => hasEffectiveModifier, + hasEffectiveModifiers: () => hasEffectiveModifiers, + hasEffectiveReadonlyModifier: () => hasEffectiveReadonlyModifier, + hasExtension: () => hasExtension, + hasIndexSignature: () => hasIndexSignature, + hasInitializer: () => hasInitializer, + hasInvalidEscape: () => hasInvalidEscape, + hasJSDocNodes: () => hasJSDocNodes, + hasJSDocParameterTags: () => hasJSDocParameterTags, + hasJSFileExtension: () => hasJSFileExtension, + hasJsonModuleEmitEnabled: () => hasJsonModuleEmitEnabled, + hasOnlyExpressionInitializer: () => hasOnlyExpressionInitializer, + hasOverrideModifier: () => hasOverrideModifier, + hasPossibleExternalModuleReference: () => hasPossibleExternalModuleReference, + hasProperty: () => hasProperty, + hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName, + hasQuestionToken: () => hasQuestionToken, + hasRecordedExternalHelpers: () => hasRecordedExternalHelpers, + hasResolutionModeOverride: () => hasResolutionModeOverride, + hasRestParameter: () => hasRestParameter, + hasScopeMarker: () => hasScopeMarker, + hasStaticModifier: () => hasStaticModifier, + hasSyntacticModifier: () => hasSyntacticModifier, + hasSyntacticModifiers: () => hasSyntacticModifiers, + hasTSFileExtension: () => hasTSFileExtension, + hasTabstop: () => hasTabstop, + hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator, + hasType: () => hasType, + hasTypeArguments: () => hasTypeArguments, + hasZeroOrOneAsteriskCharacter: () => hasZeroOrOneAsteriskCharacter, + helperString: () => helperString, + hostGetCanonicalFileName: () => hostGetCanonicalFileName, + hostUsesCaseSensitiveFileNames: () => hostUsesCaseSensitiveFileNames, + idText: () => idText, + identifierIsThisKeyword: () => identifierIsThisKeyword, + identifierToKeywordKind: () => identifierToKeywordKind, + identity: () => identity2, + identitySourceMapConsumer: () => identitySourceMapConsumer, + ignoreSourceNewlines: () => ignoreSourceNewlines, + ignoredPaths: () => ignoredPaths, + importDefaultHelper: () => importDefaultHelper, + importFromModuleSpecifier: () => importFromModuleSpecifier, + importNameElisionDisabled: () => importNameElisionDisabled, + importStarHelper: () => importStarHelper, + indexOfAnyCharCode: () => indexOfAnyCharCode, + indexOfNode: () => indexOfNode, + indicesOf: () => indicesOf, + inferredTypesContainingFile: () => inferredTypesContainingFile, + injectClassNamedEvaluationHelperBlockIfMissing: () => injectClassNamedEvaluationHelperBlockIfMissing, + injectClassThisAssignmentIfMissing: () => injectClassThisAssignmentIfMissing, + insertImports: () => insertImports, + insertLeadingStatement: () => insertLeadingStatement, + insertSorted: () => insertSorted, + insertStatementAfterCustomPrologue: () => insertStatementAfterCustomPrologue, + insertStatementAfterStandardPrologue: () => insertStatementAfterStandardPrologue, + insertStatementsAfterCustomPrologue: () => insertStatementsAfterCustomPrologue, + insertStatementsAfterStandardPrologue: () => insertStatementsAfterStandardPrologue, + intersperse: () => intersperse, + intrinsicTagNameToString: () => intrinsicTagNameToString, + introducesArgumentsExoticObject: () => introducesArgumentsExoticObject, + inverseJsxOptionMap: () => inverseJsxOptionMap, + isAbstractConstructorSymbol: () => isAbstractConstructorSymbol, + isAbstractModifier: () => isAbstractModifier, + isAccessExpression: () => isAccessExpression, + isAccessibilityModifier: () => isAccessibilityModifier, + isAccessor: () => isAccessor, + isAccessorModifier: () => isAccessorModifier, + isAliasSymbolDeclaration: () => isAliasSymbolDeclaration, + isAliasableExpression: () => isAliasableExpression, + isAmbientModule: () => isAmbientModule, + isAmbientPropertyDeclaration: () => isAmbientPropertyDeclaration, + isAnonymousFunctionDefinition: () => isAnonymousFunctionDefinition, + isAnyDirectorySeparator: () => isAnyDirectorySeparator, + isAnyImportOrBareOrAccessedRequire: () => isAnyImportOrBareOrAccessedRequire, + isAnyImportOrReExport: () => isAnyImportOrReExport, + isAnyImportSyntax: () => isAnyImportSyntax, + isAnySupportedFileExtension: () => isAnySupportedFileExtension, + isApplicableVersionedTypesKey: () => isApplicableVersionedTypesKey, + isArgumentExpressionOfElementAccess: () => isArgumentExpressionOfElementAccess, + isArray: () => isArray3, + isArrayBindingElement: () => isArrayBindingElement, + isArrayBindingOrAssignmentElement: () => isArrayBindingOrAssignmentElement, + isArrayBindingOrAssignmentPattern: () => isArrayBindingOrAssignmentPattern, + isArrayBindingPattern: () => isArrayBindingPattern, + isArrayLiteralExpression: () => isArrayLiteralExpression, + isArrayLiteralOrObjectLiteralDestructuringPattern: () => isArrayLiteralOrObjectLiteralDestructuringPattern, + isArrayTypeNode: () => isArrayTypeNode, + isArrowFunction: () => isArrowFunction, + isAsExpression: () => isAsExpression, + isAssertClause: () => isAssertClause, + isAssertEntry: () => isAssertEntry, + isAssertionExpression: () => isAssertionExpression, + isAssertsKeyword: () => isAssertsKeyword, + isAssignmentDeclaration: () => isAssignmentDeclaration, + isAssignmentExpression: () => isAssignmentExpression, + isAssignmentOperator: () => isAssignmentOperator, + isAssignmentPattern: () => isAssignmentPattern, + isAssignmentTarget: () => isAssignmentTarget, + isAsteriskToken: () => isAsteriskToken, + isAsyncFunction: () => isAsyncFunction, + isAsyncModifier: () => isAsyncModifier, + isAutoAccessorPropertyDeclaration: () => isAutoAccessorPropertyDeclaration, + isAwaitExpression: () => isAwaitExpression, + isAwaitKeyword: () => isAwaitKeyword, + isBigIntLiteral: () => isBigIntLiteral, + isBinaryExpression: () => isBinaryExpression, + isBinaryOperatorToken: () => isBinaryOperatorToken, + isBindableObjectDefinePropertyCall: () => isBindableObjectDefinePropertyCall, + isBindableStaticAccessExpression: () => isBindableStaticAccessExpression, + isBindableStaticElementAccessExpression: () => isBindableStaticElementAccessExpression, + isBindableStaticNameExpression: () => isBindableStaticNameExpression, + isBindingElement: () => isBindingElement, + isBindingElementOfBareOrAccessedRequire: () => isBindingElementOfBareOrAccessedRequire, + isBindingName: () => isBindingName, + isBindingOrAssignmentElement: () => isBindingOrAssignmentElement, + isBindingOrAssignmentPattern: () => isBindingOrAssignmentPattern, + isBindingPattern: () => isBindingPattern, + isBlock: () => isBlock2, + isBlockOrCatchScoped: () => isBlockOrCatchScoped, + isBlockScope: () => isBlockScope, + isBlockScopedContainerTopLevel: () => isBlockScopedContainerTopLevel, + isBooleanLiteral: () => isBooleanLiteral, + isBreakOrContinueStatement: () => isBreakOrContinueStatement, + isBreakStatement: () => isBreakStatement, + isBuildInfoFile: () => isBuildInfoFile, + isBuilderProgram: () => isBuilderProgram2, + isBundle: () => isBundle, + isBundleFileTextLike: () => isBundleFileTextLike, + isCallChain: () => isCallChain, + isCallExpression: () => isCallExpression, + isCallExpressionTarget: () => isCallExpressionTarget, + isCallLikeExpression: () => isCallLikeExpression, + isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression, + isCallOrNewExpression: () => isCallOrNewExpression, + isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget, + isCallSignatureDeclaration: () => isCallSignatureDeclaration, + isCallToHelper: () => isCallToHelper, + isCaseBlock: () => isCaseBlock, + isCaseClause: () => isCaseClause, + isCaseKeyword: () => isCaseKeyword, + isCaseOrDefaultClause: () => isCaseOrDefaultClause, + isCatchClause: () => isCatchClause, + isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration, + isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement, + isCheckJsEnabledForFile: () => isCheckJsEnabledForFile, + isChildOfNodeWithKind: () => isChildOfNodeWithKind, + isCircularBuildOrder: () => isCircularBuildOrder, + isClassDeclaration: () => isClassDeclaration, + isClassElement: () => isClassElement, + isClassExpression: () => isClassExpression, + isClassInstanceProperty: () => isClassInstanceProperty, + isClassLike: () => isClassLike, + isClassMemberModifier: () => isClassMemberModifier, + isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock, + isClassOrTypeElement: () => isClassOrTypeElement, + isClassStaticBlockDeclaration: () => isClassStaticBlockDeclaration, + isClassThisAssignmentBlock: () => isClassThisAssignmentBlock, + isCollapsedRange: () => isCollapsedRange, + isColonToken: () => isColonToken, + isCommaExpression: () => isCommaExpression, + isCommaListExpression: () => isCommaListExpression, + isCommaSequence: () => isCommaSequence, + isCommaToken: () => isCommaToken, + isComment: () => isComment, + isCommonJsExportPropertyAssignment: () => isCommonJsExportPropertyAssignment, + isCommonJsExportedExpression: () => isCommonJsExportedExpression, + isCompoundAssignment: () => isCompoundAssignment, + isComputedNonLiteralName: () => isComputedNonLiteralName, + isComputedPropertyName: () => isComputedPropertyName, + isConciseBody: () => isConciseBody, + isConditionalExpression: () => isConditionalExpression, + isConditionalTypeNode: () => isConditionalTypeNode, + isConstTypeReference: () => isConstTypeReference, + isConstructSignatureDeclaration: () => isConstructSignatureDeclaration, + isConstructorDeclaration: () => isConstructorDeclaration, + isConstructorTypeNode: () => isConstructorTypeNode, + isContextualKeyword: () => isContextualKeyword, + isContinueStatement: () => isContinueStatement, + isCustomPrologue: () => isCustomPrologue, + isDebuggerStatement: () => isDebuggerStatement, + isDeclaration: () => isDeclaration, + isDeclarationBindingElement: () => isDeclarationBindingElement, + isDeclarationFileName: () => isDeclarationFileName, + isDeclarationName: () => isDeclarationName, + isDeclarationNameOfEnumOrNamespace: () => isDeclarationNameOfEnumOrNamespace, + isDeclarationReadonly: () => isDeclarationReadonly, + isDeclarationStatement: () => isDeclarationStatement, + isDeclarationWithTypeParameterChildren: () => isDeclarationWithTypeParameterChildren, + isDeclarationWithTypeParameters: () => isDeclarationWithTypeParameters, + isDecorator: () => isDecorator, + isDecoratorTarget: () => isDecoratorTarget, + isDefaultClause: () => isDefaultClause, + isDefaultImport: () => isDefaultImport, + isDefaultModifier: () => isDefaultModifier, + isDefaultedExpandoInitializer: () => isDefaultedExpandoInitializer, + isDeleteExpression: () => isDeleteExpression, + isDeleteTarget: () => isDeleteTarget, + isDeprecatedDeclaration: () => isDeprecatedDeclaration, + isDestructuringAssignment: () => isDestructuringAssignment, + isDiagnosticWithLocation: () => isDiagnosticWithLocation, + isDiskPathRoot: () => isDiskPathRoot, + isDoStatement: () => isDoStatement, + isDocumentRegistryEntry: () => isDocumentRegistryEntry, + isDotDotDotToken: () => isDotDotDotToken, + isDottedName: () => isDottedName, + isDynamicName: () => isDynamicName, + isESSymbolIdentifier: () => isESSymbolIdentifier, + isEffectiveExternalModule: () => isEffectiveExternalModule, + isEffectiveModuleDeclaration: () => isEffectiveModuleDeclaration, + isEffectiveStrictModeSourceFile: () => isEffectiveStrictModeSourceFile, + isElementAccessChain: () => isElementAccessChain, + isElementAccessExpression: () => isElementAccessExpression, + isEmittedFileOfProgram: () => isEmittedFileOfProgram, + isEmptyArrayLiteral: () => isEmptyArrayLiteral, + isEmptyBindingElement: () => isEmptyBindingElement, + isEmptyBindingPattern: () => isEmptyBindingPattern, + isEmptyObjectLiteral: () => isEmptyObjectLiteral, + isEmptyStatement: () => isEmptyStatement, + isEmptyStringLiteral: () => isEmptyStringLiteral, + isEntityName: () => isEntityName, + isEntityNameExpression: () => isEntityNameExpression, + isEnumConst: () => isEnumConst, + isEnumDeclaration: () => isEnumDeclaration, + isEnumMember: () => isEnumMember, + isEqualityOperatorKind: () => isEqualityOperatorKind, + isEqualsGreaterThanToken: () => isEqualsGreaterThanToken, + isExclamationToken: () => isExclamationToken, + isExcludedFile: () => isExcludedFile, + isExclusivelyTypeOnlyImportOrExport: () => isExclusivelyTypeOnlyImportOrExport, + isExpandoPropertyDeclaration: () => isExpandoPropertyDeclaration, + isExportAssignment: () => isExportAssignment, + isExportDeclaration: () => isExportDeclaration, + isExportModifier: () => isExportModifier, + isExportName: () => isExportName, + isExportNamespaceAsDefaultDeclaration: () => isExportNamespaceAsDefaultDeclaration, + isExportOrDefaultModifier: () => isExportOrDefaultModifier, + isExportSpecifier: () => isExportSpecifier, + isExportsIdentifier: () => isExportsIdentifier, + isExportsOrModuleExportsOrAlias: () => isExportsOrModuleExportsOrAlias, + isExpression: () => isExpression, + isExpressionNode: () => isExpressionNode, + isExpressionOfExternalModuleImportEqualsDeclaration: () => isExpressionOfExternalModuleImportEqualsDeclaration, + isExpressionOfOptionalChainRoot: () => isExpressionOfOptionalChainRoot, + isExpressionStatement: () => isExpressionStatement, + isExpressionWithTypeArguments: () => isExpressionWithTypeArguments, + isExpressionWithTypeArgumentsInClassExtendsClause: () => isExpressionWithTypeArgumentsInClassExtendsClause, + isExternalModule: () => isExternalModule, + isExternalModuleAugmentation: () => isExternalModuleAugmentation, + isExternalModuleImportEqualsDeclaration: () => isExternalModuleImportEqualsDeclaration, + isExternalModuleIndicator: () => isExternalModuleIndicator, + isExternalModuleNameRelative: () => isExternalModuleNameRelative, + isExternalModuleReference: () => isExternalModuleReference, + isExternalModuleSymbol: () => isExternalModuleSymbol, + isExternalOrCommonJsModule: () => isExternalOrCommonJsModule, + isFileLevelReservedGeneratedIdentifier: () => isFileLevelReservedGeneratedIdentifier, + isFileLevelUniqueName: () => isFileLevelUniqueName, + isFileProbablyExternalModule: () => isFileProbablyExternalModule, + isFirstDeclarationOfSymbolParameter: () => isFirstDeclarationOfSymbolParameter, + isFixablePromiseHandler: () => isFixablePromiseHandler, + isForInOrOfStatement: () => isForInOrOfStatement, + isForInStatement: () => isForInStatement, + isForInitializer: () => isForInitializer, + isForOfStatement: () => isForOfStatement, + isForStatement: () => isForStatement, + isFunctionBlock: () => isFunctionBlock, + isFunctionBody: () => isFunctionBody, + isFunctionDeclaration: () => isFunctionDeclaration, + isFunctionExpression: () => isFunctionExpression, + isFunctionExpressionOrArrowFunction: () => isFunctionExpressionOrArrowFunction, + isFunctionLike: () => isFunctionLike, + isFunctionLikeDeclaration: () => isFunctionLikeDeclaration, + isFunctionLikeKind: () => isFunctionLikeKind, + isFunctionLikeOrClassStaticBlockDeclaration: () => isFunctionLikeOrClassStaticBlockDeclaration, + isFunctionOrConstructorTypeNode: () => isFunctionOrConstructorTypeNode, + isFunctionOrModuleBlock: () => isFunctionOrModuleBlock, + isFunctionSymbol: () => isFunctionSymbol, + isFunctionTypeNode: () => isFunctionTypeNode, + isFutureReservedKeyword: () => isFutureReservedKeyword, + isGeneratedIdentifier: () => isGeneratedIdentifier, + isGeneratedPrivateIdentifier: () => isGeneratedPrivateIdentifier, + isGetAccessor: () => isGetAccessor, + isGetAccessorDeclaration: () => isGetAccessorDeclaration, + isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration, + isGlobalDeclaration: () => isGlobalDeclaration, + isGlobalScopeAugmentation: () => isGlobalScopeAugmentation, + isGrammarError: () => isGrammarError, + isHeritageClause: () => isHeritageClause, + isHoistedFunction: () => isHoistedFunction, + isHoistedVariableStatement: () => isHoistedVariableStatement, + isIdentifier: () => isIdentifier, + isIdentifierANonContextualKeyword: () => isIdentifierANonContextualKeyword, + isIdentifierName: () => isIdentifierName, + isIdentifierOrThisTypeNode: () => isIdentifierOrThisTypeNode, + isIdentifierPart: () => isIdentifierPart, + isIdentifierStart: () => isIdentifierStart, + isIdentifierText: () => isIdentifierText, + isIdentifierTypePredicate: () => isIdentifierTypePredicate, + isIdentifierTypeReference: () => isIdentifierTypeReference, + isIfStatement: () => isIfStatement, + isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching, + isImplicitGlob: () => isImplicitGlob, + isImportAttribute: () => isImportAttribute, + isImportAttributeName: () => isImportAttributeName, + isImportAttributes: () => isImportAttributes, + isImportCall: () => isImportCall, + isImportClause: () => isImportClause, + isImportDeclaration: () => isImportDeclaration, + isImportEqualsDeclaration: () => isImportEqualsDeclaration, + isImportKeyword: () => isImportKeyword, + isImportMeta: () => isImportMeta, + isImportOrExportSpecifier: () => isImportOrExportSpecifier, + isImportOrExportSpecifierName: () => isImportOrExportSpecifierName, + isImportSpecifier: () => isImportSpecifier, + isImportTypeAssertionContainer: () => isImportTypeAssertionContainer, + isImportTypeNode: () => isImportTypeNode, + isImportableFile: () => isImportableFile, + isInComment: () => isInComment, + isInCompoundLikeAssignment: () => isInCompoundLikeAssignment, + isInExpressionContext: () => isInExpressionContext, + isInJSDoc: () => isInJSDoc, + isInJSFile: () => isInJSFile, + isInJSXText: () => isInJSXText, + isInJsonFile: () => isInJsonFile, + isInNonReferenceComment: () => isInNonReferenceComment, + isInReferenceComment: () => isInReferenceComment, + isInRightSideOfInternalImportEqualsDeclaration: () => isInRightSideOfInternalImportEqualsDeclaration, + isInString: () => isInString, + isInTemplateString: () => isInTemplateString, + isInTopLevelContext: () => isInTopLevelContext, + isInTypeQuery: () => isInTypeQuery, + isIncrementalCompilation: () => isIncrementalCompilation, + isIndexSignatureDeclaration: () => isIndexSignatureDeclaration, + isIndexedAccessTypeNode: () => isIndexedAccessTypeNode, + isInferTypeNode: () => isInferTypeNode, + isInfinityOrNaNString: () => isInfinityOrNaNString, + isInitializedProperty: () => isInitializedProperty, + isInitializedVariable: () => isInitializedVariable, + isInsideJsxElement: () => isInsideJsxElement, + isInsideJsxElementOrAttribute: () => isInsideJsxElementOrAttribute, + isInsideNodeModules: () => isInsideNodeModules, + isInsideTemplateLiteral: () => isInsideTemplateLiteral, + isInstanceOfExpression: () => isInstanceOfExpression, + isInstantiatedModule: () => isInstantiatedModule, + isInterfaceDeclaration: () => isInterfaceDeclaration, + isInternalDeclaration: () => isInternalDeclaration, + isInternalModuleImportEqualsDeclaration: () => isInternalModuleImportEqualsDeclaration, + isInternalName: () => isInternalName, + isIntersectionTypeNode: () => isIntersectionTypeNode, + isIntrinsicJsxName: () => isIntrinsicJsxName, + isIterationStatement: () => isIterationStatement, + isJSDoc: () => isJSDoc, + isJSDocAllType: () => isJSDocAllType, + isJSDocAugmentsTag: () => isJSDocAugmentsTag, + isJSDocAuthorTag: () => isJSDocAuthorTag, + isJSDocCallbackTag: () => isJSDocCallbackTag, + isJSDocClassTag: () => isJSDocClassTag, + isJSDocCommentContainingNode: () => isJSDocCommentContainingNode, + isJSDocConstructSignature: () => isJSDocConstructSignature, + isJSDocDeprecatedTag: () => isJSDocDeprecatedTag, + isJSDocEnumTag: () => isJSDocEnumTag, + isJSDocFunctionType: () => isJSDocFunctionType, + isJSDocImplementsTag: () => isJSDocImplementsTag, + isJSDocIndexSignature: () => isJSDocIndexSignature, + isJSDocLikeText: () => isJSDocLikeText, + isJSDocLink: () => isJSDocLink, + isJSDocLinkCode: () => isJSDocLinkCode, + isJSDocLinkLike: () => isJSDocLinkLike, + isJSDocLinkPlain: () => isJSDocLinkPlain, + isJSDocMemberName: () => isJSDocMemberName, + isJSDocNameReference: () => isJSDocNameReference, + isJSDocNamepathType: () => isJSDocNamepathType, + isJSDocNamespaceBody: () => isJSDocNamespaceBody, + isJSDocNode: () => isJSDocNode, + isJSDocNonNullableType: () => isJSDocNonNullableType, + isJSDocNullableType: () => isJSDocNullableType, + isJSDocOptionalParameter: () => isJSDocOptionalParameter, + isJSDocOptionalType: () => isJSDocOptionalType, + isJSDocOverloadTag: () => isJSDocOverloadTag, + isJSDocOverrideTag: () => isJSDocOverrideTag, + isJSDocParameterTag: () => isJSDocParameterTag, + isJSDocPrivateTag: () => isJSDocPrivateTag, + isJSDocPropertyLikeTag: () => isJSDocPropertyLikeTag, + isJSDocPropertyTag: () => isJSDocPropertyTag, + isJSDocProtectedTag: () => isJSDocProtectedTag, + isJSDocPublicTag: () => isJSDocPublicTag, + isJSDocReadonlyTag: () => isJSDocReadonlyTag, + isJSDocReturnTag: () => isJSDocReturnTag, + isJSDocSatisfiesExpression: () => isJSDocSatisfiesExpression, + isJSDocSatisfiesTag: () => isJSDocSatisfiesTag, + isJSDocSeeTag: () => isJSDocSeeTag, + isJSDocSignature: () => isJSDocSignature, + isJSDocTag: () => isJSDocTag, + isJSDocTemplateTag: () => isJSDocTemplateTag, + isJSDocThisTag: () => isJSDocThisTag, + isJSDocThrowsTag: () => isJSDocThrowsTag, + isJSDocTypeAlias: () => isJSDocTypeAlias, + isJSDocTypeAssertion: () => isJSDocTypeAssertion, + isJSDocTypeExpression: () => isJSDocTypeExpression, + isJSDocTypeLiteral: () => isJSDocTypeLiteral, + isJSDocTypeTag: () => isJSDocTypeTag, + isJSDocTypedefTag: () => isJSDocTypedefTag, + isJSDocUnknownTag: () => isJSDocUnknownTag, + isJSDocUnknownType: () => isJSDocUnknownType, + isJSDocVariadicType: () => isJSDocVariadicType, + isJSXTagName: () => isJSXTagName, + isJsonEqual: () => isJsonEqual, + isJsonSourceFile: () => isJsonSourceFile, + isJsxAttribute: () => isJsxAttribute, + isJsxAttributeLike: () => isJsxAttributeLike, + isJsxAttributeName: () => isJsxAttributeName, + isJsxAttributes: () => isJsxAttributes, + isJsxChild: () => isJsxChild, + isJsxClosingElement: () => isJsxClosingElement, + isJsxClosingFragment: () => isJsxClosingFragment, + isJsxElement: () => isJsxElement, + isJsxExpression: () => isJsxExpression, + isJsxFragment: () => isJsxFragment, + isJsxNamespacedName: () => isJsxNamespacedName, + isJsxOpeningElement: () => isJsxOpeningElement, + isJsxOpeningFragment: () => isJsxOpeningFragment, + isJsxOpeningLikeElement: () => isJsxOpeningLikeElement, + isJsxOpeningLikeElementTagName: () => isJsxOpeningLikeElementTagName, + isJsxSelfClosingElement: () => isJsxSelfClosingElement, + isJsxSpreadAttribute: () => isJsxSpreadAttribute, + isJsxTagNameExpression: () => isJsxTagNameExpression, + isJsxText: () => isJsxText, + isJumpStatementTarget: () => isJumpStatementTarget, + isKeyword: () => isKeyword, + isKeywordOrPunctuation: () => isKeywordOrPunctuation, + isKnownSymbol: () => isKnownSymbol, + isLabelName: () => isLabelName, + isLabelOfLabeledStatement: () => isLabelOfLabeledStatement, + isLabeledStatement: () => isLabeledStatement, + isLateVisibilityPaintedStatement: () => isLateVisibilityPaintedStatement, + isLeftHandSideExpression: () => isLeftHandSideExpression, + isLeftHandSideOfAssignment: () => isLeftHandSideOfAssignment, + isLet: () => isLet, + isLineBreak: () => isLineBreak2, + isLiteralComputedPropertyDeclarationName: () => isLiteralComputedPropertyDeclarationName, + isLiteralExpression: () => isLiteralExpression, + isLiteralExpressionOfObject: () => isLiteralExpressionOfObject, + isLiteralImportTypeNode: () => isLiteralImportTypeNode, + isLiteralKind: () => isLiteralKind, + isLiteralLikeAccess: () => isLiteralLikeAccess, + isLiteralLikeElementAccess: () => isLiteralLikeElementAccess, + isLiteralNameOfPropertyDeclarationOrIndexAccess: () => isLiteralNameOfPropertyDeclarationOrIndexAccess, + isLiteralTypeLikeExpression: () => isLiteralTypeLikeExpression, + isLiteralTypeLiteral: () => isLiteralTypeLiteral, + isLiteralTypeNode: () => isLiteralTypeNode, + isLocalName: () => isLocalName, + isLogicalOperator: () => isLogicalOperator, + isLogicalOrCoalescingAssignmentExpression: () => isLogicalOrCoalescingAssignmentExpression, + isLogicalOrCoalescingAssignmentOperator: () => isLogicalOrCoalescingAssignmentOperator, + isLogicalOrCoalescingBinaryExpression: () => isLogicalOrCoalescingBinaryExpression, + isLogicalOrCoalescingBinaryOperator: () => isLogicalOrCoalescingBinaryOperator, + isMappedTypeNode: () => isMappedTypeNode, + isMemberName: () => isMemberName, + isMetaProperty: () => isMetaProperty, + isMethodDeclaration: () => isMethodDeclaration, + isMethodOrAccessor: () => isMethodOrAccessor, + isMethodSignature: () => isMethodSignature, + isMinusToken: () => isMinusToken, + isMissingDeclaration: () => isMissingDeclaration, + isMissingPackageJsonInfo: () => isMissingPackageJsonInfo, + isModifier: () => isModifier, + isModifierKind: () => isModifierKind, + isModifierLike: () => isModifierLike, + isModuleAugmentationExternal: () => isModuleAugmentationExternal, + isModuleBlock: () => isModuleBlock, + isModuleBody: () => isModuleBody, + isModuleDeclaration: () => isModuleDeclaration, + isModuleExportsAccessExpression: () => isModuleExportsAccessExpression, + isModuleIdentifier: () => isModuleIdentifier, + isModuleName: () => isModuleName, + isModuleOrEnumDeclaration: () => isModuleOrEnumDeclaration, + isModuleReference: () => isModuleReference, + isModuleSpecifierLike: () => isModuleSpecifierLike, + isModuleWithStringLiteralName: () => isModuleWithStringLiteralName, + isNameOfFunctionDeclaration: () => isNameOfFunctionDeclaration, + isNameOfModuleDeclaration: () => isNameOfModuleDeclaration, + isNamedClassElement: () => isNamedClassElement, + isNamedDeclaration: () => isNamedDeclaration, + isNamedEvaluation: () => isNamedEvaluation, + isNamedEvaluationSource: () => isNamedEvaluationSource, + isNamedExportBindings: () => isNamedExportBindings, + isNamedExports: () => isNamedExports, + isNamedImportBindings: () => isNamedImportBindings, + isNamedImports: () => isNamedImports, + isNamedImportsOrExports: () => isNamedImportsOrExports, + isNamedTupleMember: () => isNamedTupleMember, + isNamespaceBody: () => isNamespaceBody, + isNamespaceExport: () => isNamespaceExport, + isNamespaceExportDeclaration: () => isNamespaceExportDeclaration, + isNamespaceImport: () => isNamespaceImport, + isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration, + isNewExpression: () => isNewExpression, + isNewExpressionTarget: () => isNewExpressionTarget, + isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral, + isNode: () => isNode2, + isNodeArray: () => isNodeArray, + isNodeArrayMultiLine: () => isNodeArrayMultiLine, + isNodeDescendantOf: () => isNodeDescendantOf, + isNodeKind: () => isNodeKind, + isNodeLikeSystem: () => isNodeLikeSystem, + isNodeModulesDirectory: () => isNodeModulesDirectory, + isNodeWithPossibleHoistedDeclaration: () => isNodeWithPossibleHoistedDeclaration, + isNonContextualKeyword: () => isNonContextualKeyword, + isNonExportDefaultModifier: () => isNonExportDefaultModifier, + isNonGlobalAmbientModule: () => isNonGlobalAmbientModule, + isNonGlobalDeclaration: () => isNonGlobalDeclaration, + isNonNullAccess: () => isNonNullAccess, + isNonNullChain: () => isNonNullChain, + isNonNullExpression: () => isNonNullExpression, + isNonStaticMethodOrAccessorWithPrivateName: () => isNonStaticMethodOrAccessorWithPrivateName, + isNotEmittedOrPartiallyEmittedNode: () => isNotEmittedOrPartiallyEmittedNode, + isNotEmittedStatement: () => isNotEmittedStatement, + isNullishCoalesce: () => isNullishCoalesce, + isNumber: () => isNumber3, + isNumericLiteral: () => isNumericLiteral, + isNumericLiteralName: () => isNumericLiteralName, + isObjectBindingElementWithoutPropertyName: () => isObjectBindingElementWithoutPropertyName, + isObjectBindingOrAssignmentElement: () => isObjectBindingOrAssignmentElement, + isObjectBindingOrAssignmentPattern: () => isObjectBindingOrAssignmentPattern, + isObjectBindingPattern: () => isObjectBindingPattern, + isObjectLiteralElement: () => isObjectLiteralElement, + isObjectLiteralElementLike: () => isObjectLiteralElementLike, + isObjectLiteralExpression: () => isObjectLiteralExpression, + isObjectLiteralMethod: () => isObjectLiteralMethod, + isObjectLiteralOrClassExpressionMethodOrAccessor: () => isObjectLiteralOrClassExpressionMethodOrAccessor, + isObjectTypeDeclaration: () => isObjectTypeDeclaration, + isOctalDigit: () => isOctalDigit, + isOmittedExpression: () => isOmittedExpression, + isOptionalChain: () => isOptionalChain, + isOptionalChainRoot: () => isOptionalChainRoot, + isOptionalDeclaration: () => isOptionalDeclaration, + isOptionalJSDocPropertyLikeTag: () => isOptionalJSDocPropertyLikeTag, + isOptionalTypeNode: () => isOptionalTypeNode, + isOuterExpression: () => isOuterExpression, + isOutermostOptionalChain: () => isOutermostOptionalChain, + isOverrideModifier: () => isOverrideModifier, + isPackageJsonInfo: () => isPackageJsonInfo, + isPackedArrayLiteral: () => isPackedArrayLiteral, + isParameter: () => isParameter, + isParameterDeclaration: () => isParameterDeclaration, + isParameterPropertyDeclaration: () => isParameterPropertyDeclaration, + isParameterPropertyModifier: () => isParameterPropertyModifier, + isParenthesizedExpression: () => isParenthesizedExpression, + isParenthesizedTypeNode: () => isParenthesizedTypeNode, + isParseTreeNode: () => isParseTreeNode, + isPartOfTypeNode: () => isPartOfTypeNode, + isPartOfTypeQuery: () => isPartOfTypeQuery, + isPartiallyEmittedExpression: () => isPartiallyEmittedExpression, + isPatternMatch: () => isPatternMatch, + isPinnedComment: () => isPinnedComment, + isPlainJsFile: () => isPlainJsFile, + isPlusToken: () => isPlusToken, + isPossiblyTypeArgumentPosition: () => isPossiblyTypeArgumentPosition, + isPostfixUnaryExpression: () => isPostfixUnaryExpression, + isPrefixUnaryExpression: () => isPrefixUnaryExpression, + isPrivateIdentifier: () => isPrivateIdentifier, + isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration, + isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression, + isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol, + isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo, + isProgramUptoDate: () => isProgramUptoDate, + isPrologueDirective: () => isPrologueDirective, + isPropertyAccessChain: () => isPropertyAccessChain, + isPropertyAccessEntityNameExpression: () => isPropertyAccessEntityNameExpression, + isPropertyAccessExpression: () => isPropertyAccessExpression, + isPropertyAccessOrQualifiedName: () => isPropertyAccessOrQualifiedName, + isPropertyAccessOrQualifiedNameOrImportTypeNode: () => isPropertyAccessOrQualifiedNameOrImportTypeNode, + isPropertyAssignment: () => isPropertyAssignment, + isPropertyDeclaration: () => isPropertyDeclaration, + isPropertyName: () => isPropertyName, + isPropertyNameLiteral: () => isPropertyNameLiteral, + isPropertySignature: () => isPropertySignature, + isProtoSetter: () => isProtoSetter, + isPrototypeAccess: () => isPrototypeAccess, + isPrototypePropertyAssignment: () => isPrototypePropertyAssignment, + isPunctuation: () => isPunctuation, + isPushOrUnshiftIdentifier: () => isPushOrUnshiftIdentifier, + isQualifiedName: () => isQualifiedName, + isQuestionDotToken: () => isQuestionDotToken, + isQuestionOrExclamationToken: () => isQuestionOrExclamationToken, + isQuestionOrPlusOrMinusToken: () => isQuestionOrPlusOrMinusToken, + isQuestionToken: () => isQuestionToken, + isRawSourceMap: () => isRawSourceMap, + isReadonlyKeyword: () => isReadonlyKeyword, + isReadonlyKeywordOrPlusOrMinusToken: () => isReadonlyKeywordOrPlusOrMinusToken, + isRecognizedTripleSlashComment: () => isRecognizedTripleSlashComment, + isReferenceFileLocation: () => isReferenceFileLocation, + isReferencedFile: () => isReferencedFile, + isRegularExpressionLiteral: () => isRegularExpressionLiteral, + isRequireCall: () => isRequireCall, + isRequireVariableStatement: () => isRequireVariableStatement, + isRestParameter: () => isRestParameter, + isRestTypeNode: () => isRestTypeNode, + isReturnStatement: () => isReturnStatement, + isReturnStatementWithFixablePromiseHandler: () => isReturnStatementWithFixablePromiseHandler, + isRightSideOfAccessExpression: () => isRightSideOfAccessExpression, + isRightSideOfInstanceofExpression: () => isRightSideOfInstanceofExpression, + isRightSideOfPropertyAccess: () => isRightSideOfPropertyAccess, + isRightSideOfQualifiedName: () => isRightSideOfQualifiedName, + isRightSideOfQualifiedNameOrPropertyAccess: () => isRightSideOfQualifiedNameOrPropertyAccess, + isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName: () => isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName, + isRootedDiskPath: () => isRootedDiskPath, + isSameEntityName: () => isSameEntityName, + isSatisfiesExpression: () => isSatisfiesExpression, + isScopeMarker: () => isScopeMarker, + isSemicolonClassElement: () => isSemicolonClassElement, + isSetAccessor: () => isSetAccessor, + isSetAccessorDeclaration: () => isSetAccessorDeclaration, + isShebangTrivia: () => isShebangTrivia, + isShiftOperatorOrHigher: () => isShiftOperatorOrHigher, + isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol, + isShorthandPropertyAssignment: () => isShorthandPropertyAssignment, + isSignedNumericLiteral: () => isSignedNumericLiteral, + isSimpleCopiableExpression: () => isSimpleCopiableExpression, + isSimpleInlineableExpression: () => isSimpleInlineableExpression, + isSimpleParameter: () => isSimpleParameter, + isSimpleParameterList: () => isSimpleParameterList, + isSingleOrDoubleQuote: () => isSingleOrDoubleQuote, + isSourceFile: () => isSourceFile, + isSourceFileFromLibrary: () => isSourceFileFromLibrary, + isSourceFileJS: () => isSourceFileJS, + isSourceFileNotJS: () => isSourceFileNotJS, + isSourceFileNotJson: () => isSourceFileNotJson, + isSourceMapping: () => isSourceMapping, + isSpecialPropertyDeclaration: () => isSpecialPropertyDeclaration, + isSpreadAssignment: () => isSpreadAssignment, + isSpreadElement: () => isSpreadElement, + isStatement: () => isStatement, + isStatementButNotDeclaration: () => isStatementButNotDeclaration, + isStatementOrBlock: () => isStatementOrBlock, + isStatementWithLocals: () => isStatementWithLocals, + isStatic: () => isStatic, + isStaticModifier: () => isStaticModifier, + isString: () => isString4, + isStringAKeyword: () => isStringAKeyword, + isStringANonContextualKeyword: () => isStringANonContextualKeyword, + isStringAndEmptyAnonymousObjectIntersection: () => isStringAndEmptyAnonymousObjectIntersection, + isStringDoubleQuoted: () => isStringDoubleQuoted, + isStringLiteral: () => isStringLiteral, + isStringLiteralLike: () => isStringLiteralLike, + isStringLiteralOrJsxExpression: () => isStringLiteralOrJsxExpression, + isStringLiteralOrTemplate: () => isStringLiteralOrTemplate, + isStringOrNumericLiteralLike: () => isStringOrNumericLiteralLike, + isStringOrRegularExpressionOrTemplateLiteral: () => isStringOrRegularExpressionOrTemplateLiteral, + isStringTextContainingNode: () => isStringTextContainingNode, + isSuperCall: () => isSuperCall, + isSuperKeyword: () => isSuperKeyword, + isSuperOrSuperProperty: () => isSuperOrSuperProperty, + isSuperProperty: () => isSuperProperty, + isSupportedSourceFileName: () => isSupportedSourceFileName, + isSwitchStatement: () => isSwitchStatement, + isSyntaxList: () => isSyntaxList, + isSyntheticExpression: () => isSyntheticExpression, + isSyntheticReference: () => isSyntheticReference, + isTagName: () => isTagName, + isTaggedTemplateExpression: () => isTaggedTemplateExpression, + isTaggedTemplateTag: () => isTaggedTemplateTag, + isTemplateExpression: () => isTemplateExpression, + isTemplateHead: () => isTemplateHead, + isTemplateLiteral: () => isTemplateLiteral, + isTemplateLiteralKind: () => isTemplateLiteralKind, + isTemplateLiteralToken: () => isTemplateLiteralToken, + isTemplateLiteralTypeNode: () => isTemplateLiteralTypeNode, + isTemplateLiteralTypeSpan: () => isTemplateLiteralTypeSpan, + isTemplateMiddle: () => isTemplateMiddle, + isTemplateMiddleOrTemplateTail: () => isTemplateMiddleOrTemplateTail, + isTemplateSpan: () => isTemplateSpan, + isTemplateTail: () => isTemplateTail, + isTextWhiteSpaceLike: () => isTextWhiteSpaceLike, + isThis: () => isThis, + isThisContainerOrFunctionBlock: () => isThisContainerOrFunctionBlock, + isThisIdentifier: () => isThisIdentifier, + isThisInTypeQuery: () => isThisInTypeQuery, + isThisInitializedDeclaration: () => isThisInitializedDeclaration, + isThisInitializedObjectBindingExpression: () => isThisInitializedObjectBindingExpression, + isThisProperty: () => isThisProperty, + isThisTypeNode: () => isThisTypeNode, + isThisTypeParameter: () => isThisTypeParameter, + isThisTypePredicate: () => isThisTypePredicate, + isThrowStatement: () => isThrowStatement, + isToken: () => isToken, + isTokenKind: () => isTokenKind, + isTraceEnabled: () => isTraceEnabled, + isTransientSymbol: () => isTransientSymbol, + isTrivia: () => isTrivia, + isTryStatement: () => isTryStatement, + isTupleTypeNode: () => isTupleTypeNode, + isTypeAlias: () => isTypeAlias, + isTypeAliasDeclaration: () => isTypeAliasDeclaration, + isTypeAssertionExpression: () => isTypeAssertionExpression, + isTypeDeclaration: () => isTypeDeclaration, + isTypeElement: () => isTypeElement, + isTypeKeyword: () => isTypeKeyword, + isTypeKeywordToken: () => isTypeKeywordToken, + isTypeKeywordTokenOrIdentifier: () => isTypeKeywordTokenOrIdentifier, + isTypeLiteralNode: () => isTypeLiteralNode, + isTypeNode: () => isTypeNode, + isTypeNodeKind: () => isTypeNodeKind, + isTypeOfExpression: () => isTypeOfExpression, + isTypeOnlyExportDeclaration: () => isTypeOnlyExportDeclaration, + isTypeOnlyImportDeclaration: () => isTypeOnlyImportDeclaration, + isTypeOnlyImportOrExportDeclaration: () => isTypeOnlyImportOrExportDeclaration, + isTypeOperatorNode: () => isTypeOperatorNode, + isTypeParameterDeclaration: () => isTypeParameterDeclaration, + isTypePredicateNode: () => isTypePredicateNode, + isTypeQueryNode: () => isTypeQueryNode, + isTypeReferenceNode: () => isTypeReferenceNode, + isTypeReferenceType: () => isTypeReferenceType, + isTypeUsableAsPropertyName: () => isTypeUsableAsPropertyName, + isUMDExportSymbol: () => isUMDExportSymbol, + isUnaryExpression: () => isUnaryExpression, + isUnaryExpressionWithWrite: () => isUnaryExpressionWithWrite, + isUnicodeIdentifierStart: () => isUnicodeIdentifierStart, + isUnionTypeNode: () => isUnionTypeNode, + isUnparsedNode: () => isUnparsedNode, + isUnparsedPrepend: () => isUnparsedPrepend, + isUnparsedSource: () => isUnparsedSource, + isUnparsedTextLike: () => isUnparsedTextLike, + isUrl: () => isUrl, + isValidBigIntString: () => isValidBigIntString, + isValidESSymbolDeclaration: () => isValidESSymbolDeclaration, + isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite, + isValueSignatureDeclaration: () => isValueSignatureDeclaration, + isVarAwaitUsing: () => isVarAwaitUsing, + isVarConst: () => isVarConst, + isVarUsing: () => isVarUsing, + isVariableDeclaration: () => isVariableDeclaration, + isVariableDeclarationInVariableStatement: () => isVariableDeclarationInVariableStatement, + isVariableDeclarationInitializedToBareOrAccessedRequire: () => isVariableDeclarationInitializedToBareOrAccessedRequire, + isVariableDeclarationInitializedToRequire: () => isVariableDeclarationInitializedToRequire, + isVariableDeclarationList: () => isVariableDeclarationList, + isVariableLike: () => isVariableLike, + isVariableLikeOrAccessor: () => isVariableLikeOrAccessor, + isVariableStatement: () => isVariableStatement, + isVoidExpression: () => isVoidExpression, + isWatchSet: () => isWatchSet, + isWhileStatement: () => isWhileStatement, + isWhiteSpaceLike: () => isWhiteSpaceLike, + isWhiteSpaceSingleLine: () => isWhiteSpaceSingleLine, + isWithStatement: () => isWithStatement, + isWriteAccess: () => isWriteAccess, + isWriteOnlyAccess: () => isWriteOnlyAccess, + isYieldExpression: () => isYieldExpression, + jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport, + keywordPart: () => keywordPart, + last: () => last2, + lastOrUndefined: () => lastOrUndefined, + length: () => length, + libMap: () => libMap, + libs: () => libs, + lineBreakPart: () => lineBreakPart, + linkNamePart: () => linkNamePart, + linkPart: () => linkPart, + linkTextPart: () => linkTextPart, + listFiles: () => listFiles, + loadModuleFromGlobalCache: () => loadModuleFromGlobalCache, + loadWithModeAwareCache: () => loadWithModeAwareCache, + makeIdentifierFromModuleName: () => makeIdentifierFromModuleName, + makeImport: () => makeImport, + makeImportIfNecessary: () => makeImportIfNecessary, + makeStringLiteral: () => makeStringLiteral, + mangleScopedPackageName: () => mangleScopedPackageName, + map: () => map4, + mapAllOrFail: () => mapAllOrFail, + mapDefined: () => mapDefined, + mapDefinedEntries: () => mapDefinedEntries, + mapDefinedIterator: () => mapDefinedIterator, + mapEntries: () => mapEntries, + mapIterator: () => mapIterator, + mapOneOrMany: () => mapOneOrMany, + mapToDisplayParts: () => mapToDisplayParts, + matchFiles: () => matchFiles, + matchPatternOrExact: () => matchPatternOrExact, + matchedText: () => matchedText, + matchesExclude: () => matchesExclude, + maybeBind: () => maybeBind, + maybeSetLocalizedDiagnosticMessages: () => maybeSetLocalizedDiagnosticMessages, + memoize: () => memoize2, + memoizeCached: () => memoizeCached, + memoizeOne: () => memoizeOne, + memoizeWeak: () => memoizeWeak, + metadataHelper: () => metadataHelper, + min: () => min2, + minAndMax: () => minAndMax, + missingFileModifiedTime: () => missingFileModifiedTime, + modifierToFlag: () => modifierToFlag, + modifiersToFlags: () => modifiersToFlags, + moduleOptionDeclaration: () => moduleOptionDeclaration, + moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo, + moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter, + moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations, + moduleResolutionSupportsPackageJsonExportsAndImports: () => moduleResolutionSupportsPackageJsonExportsAndImports, + moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules, + moduleSpecifiers: () => ts_moduleSpecifiers_exports, + moveEmitHelpers: () => moveEmitHelpers, + moveRangeEnd: () => moveRangeEnd, + moveRangePastDecorators: () => moveRangePastDecorators, + moveRangePastModifiers: () => moveRangePastModifiers, + moveRangePos: () => moveRangePos, + moveSyntheticComments: () => moveSyntheticComments, + mutateMap: () => mutateMap, + mutateMapSkippingNewValues: () => mutateMapSkippingNewValues, + needsParentheses: () => needsParentheses, + needsScopeMarker: () => needsScopeMarker, + newCaseClauseTracker: () => newCaseClauseTracker, + newPrivateEnvironment: () => newPrivateEnvironment, + noEmitNotification: () => noEmitNotification, + noEmitSubstitution: () => noEmitSubstitution, + noTransformers: () => noTransformers, + noTruncationMaximumTruncationLength: () => noTruncationMaximumTruncationLength, + nodeCanBeDecorated: () => nodeCanBeDecorated, + nodeHasName: () => nodeHasName, + nodeIsDecorated: () => nodeIsDecorated, + nodeIsMissing: () => nodeIsMissing, + nodeIsPresent: () => nodeIsPresent, + nodeIsSynthesized: () => nodeIsSynthesized, + nodeModuleNameResolver: () => nodeModuleNameResolver, + nodeModulesPathPart: () => nodeModulesPathPart, + nodeNextJsonConfigResolver: () => nodeNextJsonConfigResolver, + nodeOrChildIsDecorated: () => nodeOrChildIsDecorated, + nodeOverlapsWithStartEnd: () => nodeOverlapsWithStartEnd, + nodePosToString: () => nodePosToString, + nodeSeenTracker: () => nodeSeenTracker, + nodeStartsNewLexicalEnvironment: () => nodeStartsNewLexicalEnvironment, + nodeToDisplayParts: () => nodeToDisplayParts, + noop: () => noop4, + noopFileWatcher: () => noopFileWatcher, + normalizePath: () => normalizePath, + normalizeSlashes: () => normalizeSlashes, + not: () => not, + notImplemented: () => notImplemented, + notImplementedResolver: () => notImplementedResolver, + nullNodeConverters: () => nullNodeConverters, + nullParenthesizerRules: () => nullParenthesizerRules, + nullTransformationContext: () => nullTransformationContext, + objectAllocator: () => objectAllocator, + operatorPart: () => operatorPart, + optionDeclarations: () => optionDeclarations, + optionMapToObject: () => optionMapToObject, + optionsAffectingProgramStructure: () => optionsAffectingProgramStructure, + optionsForBuild: () => optionsForBuild, + optionsForWatch: () => optionsForWatch, + optionsHaveChanges: () => optionsHaveChanges, + optionsHaveModuleResolutionChanges: () => optionsHaveModuleResolutionChanges, + or: () => or, + orderedRemoveItem: () => orderedRemoveItem, + orderedRemoveItemAt: () => orderedRemoveItemAt, + outFile: () => outFile, + packageIdToPackageName: () => packageIdToPackageName, + packageIdToString: () => packageIdToString, + paramHelper: () => paramHelper, + parameterIsThisKeyword: () => parameterIsThisKeyword, + parameterNamePart: () => parameterNamePart, + parseBaseNodeFactory: () => parseBaseNodeFactory, + parseBigInt: () => parseBigInt, + parseBuildCommand: () => parseBuildCommand, + parseCommandLine: () => parseCommandLine, + parseCommandLineWorker: () => parseCommandLineWorker, + parseConfigFileTextToJson: () => parseConfigFileTextToJson, + parseConfigFileWithSystem: () => parseConfigFileWithSystem, + parseConfigHostFromCompilerHostLike: () => parseConfigHostFromCompilerHostLike, + parseCustomTypeOption: () => parseCustomTypeOption, + parseIsolatedEntityName: () => parseIsolatedEntityName, + parseIsolatedJSDocComment: () => parseIsolatedJSDocComment, + parseJSDocTypeExpressionForTests: () => parseJSDocTypeExpressionForTests, + parseJsonConfigFileContent: () => parseJsonConfigFileContent, + parseJsonSourceFileConfigFileContent: () => parseJsonSourceFileConfigFileContent, + parseJsonText: () => parseJsonText, + parseListTypeOption: () => parseListTypeOption, + parseNodeFactory: () => parseNodeFactory, + parseNodeModuleFromPath: () => parseNodeModuleFromPath, + parsePackageName: () => parsePackageName, + parsePseudoBigInt: () => parsePseudoBigInt, + parseValidBigInt: () => parseValidBigInt, + patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory, + pathContainsNodeModules: () => pathContainsNodeModules, + pathIsAbsolute: () => pathIsAbsolute, + pathIsBareSpecifier: () => pathIsBareSpecifier, + pathIsRelative: () => pathIsRelative, + patternText: () => patternText, + perfLogger: () => perfLogger, + performIncrementalCompilation: () => performIncrementalCompilation, + performance: () => ts_performance_exports, + plainJSErrors: () => plainJSErrors, + positionBelongsToNode: () => positionBelongsToNode, + positionIsASICandidate: () => positionIsASICandidate, + positionIsSynthesized: () => positionIsSynthesized, + positionsAreOnSameLine: () => positionsAreOnSameLine, + preProcessFile: () => preProcessFile, + probablyUsesSemicolons: () => probablyUsesSemicolons, + processCommentPragmas: () => processCommentPragmas, + processPragmasIntoFields: () => processPragmasIntoFields, + processTaggedTemplateExpression: () => processTaggedTemplateExpression, + programContainsEsModules: () => programContainsEsModules, + programContainsModules: () => programContainsModules, + projectReferenceIsEqualTo: () => projectReferenceIsEqualTo, + propKeyHelper: () => propKeyHelper, + propertyNamePart: () => propertyNamePart, + pseudoBigIntToString: () => pseudoBigIntToString, + punctuationPart: () => punctuationPart, + pushIfUnique: () => pushIfUnique, + quote: () => quote, + quotePreferenceFromString: () => quotePreferenceFromString, + rangeContainsPosition: () => rangeContainsPosition, + rangeContainsPositionExclusive: () => rangeContainsPositionExclusive, + rangeContainsRange: () => rangeContainsRange, + rangeContainsRangeExclusive: () => rangeContainsRangeExclusive, + rangeContainsStartEnd: () => rangeContainsStartEnd, + rangeEndIsOnSameLineAsRangeStart: () => rangeEndIsOnSameLineAsRangeStart, + rangeEndPositionsAreOnSameLine: () => rangeEndPositionsAreOnSameLine, + rangeEquals: () => rangeEquals, + rangeIsOnSingleLine: () => rangeIsOnSingleLine, + rangeOfNode: () => rangeOfNode, + rangeOfTypeParameters: () => rangeOfTypeParameters, + rangeOverlapsWithStartEnd: () => rangeOverlapsWithStartEnd, + rangeStartIsOnSameLineAsRangeEnd: () => rangeStartIsOnSameLineAsRangeEnd, + rangeStartPositionsAreOnSameLine: () => rangeStartPositionsAreOnSameLine, + readBuilderProgram: () => readBuilderProgram, + readConfigFile: () => readConfigFile, + readHelper: () => readHelper, + readJson: () => readJson, + readJsonConfigFile: () => readJsonConfigFile, + readJsonOrUndefined: () => readJsonOrUndefined, + reduceEachLeadingCommentRange: () => reduceEachLeadingCommentRange, + reduceEachTrailingCommentRange: () => reduceEachTrailingCommentRange, + reduceLeft: () => reduceLeft, + reduceLeftIterator: () => reduceLeftIterator, + reducePathComponents: () => reducePathComponents, + refactor: () => ts_refactor_exports, + regExpEscape: () => regExpEscape, + relativeComplement: () => relativeComplement, + removeAllComments: () => removeAllComments, + removeEmitHelper: () => removeEmitHelper, + removeExtension: () => removeExtension, + removeFileExtension: () => removeFileExtension, + removeIgnoredPath: () => removeIgnoredPath, + removeMinAndVersionNumbers: () => removeMinAndVersionNumbers, + removeOptionality: () => removeOptionality, + removePrefix: () => removePrefix, + removeSuffix: () => removeSuffix, + removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator, + repeatString: () => repeatString, + replaceElement: () => replaceElement, + replaceFirstStar: () => replaceFirstStar, + resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson, + resolveConfigFileProjectName: () => resolveConfigFileProjectName, + resolveJSModule: () => resolveJSModule, + resolveLibrary: () => resolveLibrary, + resolveModuleName: () => resolveModuleName, + resolveModuleNameFromCache: () => resolveModuleNameFromCache, + resolvePackageNameToPackageJson: () => resolvePackageNameToPackageJson, + resolvePath: () => resolvePath, + resolveProjectReferencePath: () => resolveProjectReferencePath, + resolveTripleslashReference: () => resolveTripleslashReference, + resolveTypeReferenceDirective: () => resolveTypeReferenceDirective, + resolvingEmptyArray: () => resolvingEmptyArray, + restHelper: () => restHelper, + returnFalse: () => returnFalse, + returnNoopFileWatcher: () => returnNoopFileWatcher, + returnTrue: () => returnTrue, + returnUndefined: () => returnUndefined, + returnsPromise: () => returnsPromise, + runInitializersHelper: () => runInitializersHelper, + sameFlatMap: () => sameFlatMap, + sameMap: () => sameMap, + sameMapping: () => sameMapping, + scanShebangTrivia: () => scanShebangTrivia, + scanTokenAtPosition: () => scanTokenAtPosition, + scanner: () => scanner, + screenStartingMessageCodes: () => screenStartingMessageCodes, + semanticDiagnosticsOptionDeclarations: () => semanticDiagnosticsOptionDeclarations, + serializeCompilerOptions: () => serializeCompilerOptions, + server: () => ts_server_exports4, + servicesVersion: () => servicesVersion, + setCommentRange: () => setCommentRange, + setConfigFileInOptions: () => setConfigFileInOptions, + setConstantValue: () => setConstantValue, + setEachParent: () => setEachParent, + setEmitFlags: () => setEmitFlags, + setFunctionNameHelper: () => setFunctionNameHelper, + setGetSourceFileAsHashVersioned: () => setGetSourceFileAsHashVersioned, + setIdentifierAutoGenerate: () => setIdentifierAutoGenerate, + setIdentifierGeneratedImportReference: () => setIdentifierGeneratedImportReference, + setIdentifierTypeArguments: () => setIdentifierTypeArguments, + setInternalEmitFlags: () => setInternalEmitFlags, + setLocalizedDiagnosticMessages: () => setLocalizedDiagnosticMessages, + setModuleDefaultHelper: () => setModuleDefaultHelper, + setNodeFlags: () => setNodeFlags, + setObjectAllocator: () => setObjectAllocator, + setOriginalNode: () => setOriginalNode, + setParent: () => setParent, + setParentRecursive: () => setParentRecursive, + setPrivateIdentifier: () => setPrivateIdentifier, + setSnippetElement: () => setSnippetElement, + setSourceMapRange: () => setSourceMapRange, + setStackTraceLimit: () => setStackTraceLimit, + setStartsOnNewLine: () => setStartsOnNewLine, + setSyntheticLeadingComments: () => setSyntheticLeadingComments, + setSyntheticTrailingComments: () => setSyntheticTrailingComments, + setSys: () => setSys, + setSysLog: () => setSysLog, + setTextRange: () => setTextRange, + setTextRangeEnd: () => setTextRangeEnd, + setTextRangePos: () => setTextRangePos, + setTextRangePosEnd: () => setTextRangePosEnd, + setTextRangePosWidth: () => setTextRangePosWidth, + setTokenSourceMapRange: () => setTokenSourceMapRange, + setTypeNode: () => setTypeNode, + setUILocale: () => setUILocale, + setValueDeclaration: () => setValueDeclaration, + shouldAllowImportingTsExtension: () => shouldAllowImportingTsExtension, + shouldPreserveConstEnums: () => shouldPreserveConstEnums, + shouldUseUriStyleNodeCoreModules: () => shouldUseUriStyleNodeCoreModules, + showModuleSpecifier: () => showModuleSpecifier, + signatureHasLiteralTypes: () => signatureHasLiteralTypes, + signatureHasRestParameter: () => signatureHasRestParameter, + signatureToDisplayParts: () => signatureToDisplayParts, + single: () => single, + singleElementArray: () => singleElementArray, + singleIterator: () => singleIterator, + singleOrMany: () => singleOrMany, + singleOrUndefined: () => singleOrUndefined, + skipAlias: () => skipAlias, + skipAssertions: () => skipAssertions, + skipConstraint: () => skipConstraint, + skipOuterExpressions: () => skipOuterExpressions, + skipParentheses: () => skipParentheses, + skipPartiallyEmittedExpressions: () => skipPartiallyEmittedExpressions, + skipTrivia: () => skipTrivia, + skipTypeChecking: () => skipTypeChecking, + skipTypeParentheses: () => skipTypeParentheses, + skipWhile: () => skipWhile, + sliceAfter: () => sliceAfter, + some: () => some2, + sort: () => sort, + sortAndDeduplicate: () => sortAndDeduplicate, + sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics, + sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions, + sourceFileMayBeEmitted: () => sourceFileMayBeEmitted, + sourceMapCommentRegExp: () => sourceMapCommentRegExp, + sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart, + spacePart: () => spacePart, + spanMap: () => spanMap, + spreadArrayHelper: () => spreadArrayHelper, + stableSort: () => stableSort, + startEndContainsRange: () => startEndContainsRange, + startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd, + startOnNewLine: () => startOnNewLine, + startTracing: () => startTracing, + startsWith: () => startsWith2, + startsWithDirectory: () => startsWithDirectory, + startsWithUnderscore: () => startsWithUnderscore, + startsWithUseStrict: () => startsWithUseStrict, + stringContainsAt: () => stringContainsAt, + stringToToken: () => stringToToken, + stripQuotes: () => stripQuotes, + supportedDeclarationExtensions: () => supportedDeclarationExtensions, + supportedJSExtensions: () => supportedJSExtensions, + supportedJSExtensionsFlat: () => supportedJSExtensionsFlat, + supportedLocaleDirectories: () => supportedLocaleDirectories, + supportedTSExtensions: () => supportedTSExtensions, + supportedTSExtensionsFlat: () => supportedTSExtensionsFlat, + supportedTSImplementationExtensions: () => supportedTSImplementationExtensions, + suppressLeadingAndTrailingTrivia: () => suppressLeadingAndTrailingTrivia, + suppressLeadingTrivia: () => suppressLeadingTrivia, + suppressTrailingTrivia: () => suppressTrailingTrivia, + symbolEscapedNameNoDefault: () => symbolEscapedNameNoDefault, + symbolName: () => symbolName, + symbolNameNoDefault: () => symbolNameNoDefault, + symbolPart: () => symbolPart, + symbolToDisplayParts: () => symbolToDisplayParts, + syntaxMayBeASICandidate: () => syntaxMayBeASICandidate, + syntaxRequiresTrailingSemicolonOrASI: () => syntaxRequiresTrailingSemicolonOrASI, + sys: () => sys, + sysLog: () => sysLog, + tagNamesAreEquivalent: () => tagNamesAreEquivalent, + takeWhile: () => takeWhile2, + targetOptionDeclaration: () => targetOptionDeclaration, + templateObjectHelper: () => templateObjectHelper, + testFormatSettings: () => testFormatSettings, + textChangeRangeIsUnchanged: () => textChangeRangeIsUnchanged, + textChangeRangeNewSpan: () => textChangeRangeNewSpan, + textChanges: () => ts_textChanges_exports, + textOrKeywordPart: () => textOrKeywordPart, + textPart: () => textPart, + textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive, + textSpanContainsPosition: () => textSpanContainsPosition, + textSpanContainsTextSpan: () => textSpanContainsTextSpan, + textSpanEnd: () => textSpanEnd, + textSpanIntersection: () => textSpanIntersection, + textSpanIntersectsWith: () => textSpanIntersectsWith, + textSpanIntersectsWithPosition: () => textSpanIntersectsWithPosition, + textSpanIntersectsWithTextSpan: () => textSpanIntersectsWithTextSpan, + textSpanIsEmpty: () => textSpanIsEmpty, + textSpanOverlap: () => textSpanOverlap, + textSpanOverlapsWith: () => textSpanOverlapsWith, + textSpansEqual: () => textSpansEqual, + textToKeywordObj: () => textToKeywordObj, + timestamp: () => timestamp3, + toArray: () => toArray3, + toBuilderFileEmit: () => toBuilderFileEmit, + toBuilderStateFileInfoForMultiEmit: () => toBuilderStateFileInfoForMultiEmit, + toEditorSettings: () => toEditorSettings, + toFileNameLowerCase: () => toFileNameLowerCase, + toLowerCase: () => toLowerCase, + toPath: () => toPath2, + toProgramEmitPending: () => toProgramEmitPending, + tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword, + tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan, + tokenToString: () => tokenToString, + trace: () => trace2, + tracing: () => tracing, + tracingEnabled: () => tracingEnabled, + transform: () => transform2, + transformClassFields: () => transformClassFields, + transformDeclarations: () => transformDeclarations, + transformECMAScriptModule: () => transformECMAScriptModule, + transformES2015: () => transformES2015, + transformES2016: () => transformES2016, + transformES2017: () => transformES2017, + transformES2018: () => transformES2018, + transformES2019: () => transformES2019, + transformES2020: () => transformES2020, + transformES2021: () => transformES2021, + transformES5: () => transformES5, + transformESDecorators: () => transformESDecorators, + transformESNext: () => transformESNext, + transformGenerators: () => transformGenerators, + transformJsx: () => transformJsx, + transformLegacyDecorators: () => transformLegacyDecorators, + transformModule: () => transformModule, + transformNamedEvaluation: () => transformNamedEvaluation, + transformNodeModule: () => transformNodeModule, + transformNodes: () => transformNodes, + transformSystemModule: () => transformSystemModule, + transformTypeScript: () => transformTypeScript, + transpile: () => transpile, + transpileModule: () => transpileModule, + transpileOptionValueCompilerOptions: () => transpileOptionValueCompilerOptions, + tryAddToSet: () => tryAddToSet, + tryAndIgnoreErrors: () => tryAndIgnoreErrors, + tryCast: () => tryCast, + tryDirectoryExists: () => tryDirectoryExists, + tryExtractTSExtension: () => tryExtractTSExtension, + tryFileExists: () => tryFileExists, + tryGetClassExtendingExpressionWithTypeArguments: () => tryGetClassExtendingExpressionWithTypeArguments, + tryGetClassImplementingOrExtendingExpressionWithTypeArguments: () => tryGetClassImplementingOrExtendingExpressionWithTypeArguments, + tryGetDirectories: () => tryGetDirectories, + tryGetExtensionFromPath: () => tryGetExtensionFromPath2, + tryGetImportFromModuleSpecifier: () => tryGetImportFromModuleSpecifier, + tryGetJSDocSatisfiesTypeNode: () => tryGetJSDocSatisfiesTypeNode, + tryGetModuleNameFromFile: () => tryGetModuleNameFromFile, + tryGetModuleSpecifierFromDeclaration: () => tryGetModuleSpecifierFromDeclaration, + tryGetNativePerformanceHooks: () => tryGetNativePerformanceHooks, + tryGetPropertyAccessOrIdentifierToString: () => tryGetPropertyAccessOrIdentifierToString, + tryGetPropertyNameOfBindingOrAssignmentElement: () => tryGetPropertyNameOfBindingOrAssignmentElement, + tryGetSourceMappingURL: () => tryGetSourceMappingURL, + tryGetTextOfPropertyName: () => tryGetTextOfPropertyName, + tryIOAndConsumeErrors: () => tryIOAndConsumeErrors, + tryParseJson: () => tryParseJson, + tryParsePattern: () => tryParsePattern, + tryParsePatterns: () => tryParsePatterns, + tryParseRawSourceMap: () => tryParseRawSourceMap, + tryReadDirectory: () => tryReadDirectory, + tryReadFile: () => tryReadFile, + tryRemoveDirectoryPrefix: () => tryRemoveDirectoryPrefix, + tryRemoveExtension: () => tryRemoveExtension, + tryRemovePrefix: () => tryRemovePrefix, + tryRemoveSuffix: () => tryRemoveSuffix, + typeAcquisitionDeclarations: () => typeAcquisitionDeclarations, + typeAliasNamePart: () => typeAliasNamePart, + typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo, + typeKeywords: () => typeKeywords, + typeParameterNamePart: () => typeParameterNamePart, + typeToDisplayParts: () => typeToDisplayParts, + unchangedPollThresholds: () => unchangedPollThresholds, + unchangedTextChangeRange: () => unchangedTextChangeRange, + unescapeLeadingUnderscores: () => unescapeLeadingUnderscores, + unmangleScopedPackageName: () => unmangleScopedPackageName, + unorderedRemoveItem: () => unorderedRemoveItem, + unorderedRemoveItemAt: () => unorderedRemoveItemAt, + unreachableCodeIsError: () => unreachableCodeIsError, + unusedLabelIsError: () => unusedLabelIsError, + unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel, + updateErrorForNoInputFiles: () => updateErrorForNoInputFiles, + updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile, + updateMissingFilePathsWatch: () => updateMissingFilePathsWatch, + updateResolutionField: () => updateResolutionField, + updateSharedExtendedConfigFileWatcher: () => updateSharedExtendedConfigFileWatcher, + updateSourceFile: () => updateSourceFile, + updateWatchingWildcardDirectories: () => updateWatchingWildcardDirectories, + usesExtensionsOnImports: () => usesExtensionsOnImports, + usingSingleLineStringWriter: () => usingSingleLineStringWriter, + utf16EncodeAsString: () => utf16EncodeAsString, + validateLocaleAndSetLanguage: () => validateLocaleAndSetLanguage, + valuesHelper: () => valuesHelper, + version: () => version5, + versionMajorMinor: () => versionMajorMinor, + visitArray: () => visitArray, + visitCommaListElements: () => visitCommaListElements, + visitEachChild: () => visitEachChild, + visitFunctionBody: () => visitFunctionBody, + visitIterationBody: () => visitIterationBody, + visitLexicalEnvironment: () => visitLexicalEnvironment, + visitNode: () => visitNode, + visitNodes: () => visitNodes2, + visitParameterList: () => visitParameterList, + walkUpBindingElementsAndPatterns: () => walkUpBindingElementsAndPatterns, + walkUpLexicalEnvironments: () => walkUpLexicalEnvironments, + walkUpOuterExpressions: () => walkUpOuterExpressions, + walkUpParenthesizedExpressions: () => walkUpParenthesizedExpressions, + walkUpParenthesizedTypes: () => walkUpParenthesizedTypes, + walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild, + whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp, + writeCommentRange: () => writeCommentRange, + writeFile: () => writeFile2, + writeFileEnsuringDirectories: () => writeFileEnsuringDirectories, + zipWith: () => zipWith2 + }); + var init_ts8 = __esm2({ + "src/typescript/_namespaces/ts.ts"() { + "use strict"; + init_ts2(); + init_ts3(); + init_ts4(); + init_ts7(); + init_ts_server4(); + } + }); + var require_typescript3 = __commonJS2({ + "src/typescript/typescript.ts"(exports29, module22) { + init_ts8(); + init_ts8(); + if (typeof console !== "undefined") { + Debug.loggingHost = { + log(level, s7) { + switch (level) { + case 1: + return console.error(s7); + case 2: + return console.warn(s7); + case 3: + return console.log(s7); + case 4: + return console.log(s7); + } + } + }; + } + module22.exports = ts_exports3; + } + }); + return require_typescript3(); + })(); + if (typeof module5 !== "undefined" && module5.exports) { + module5.exports = ts; + } + } +}); + +// node_modules/cosmiconfig/dist/loaders.js +var require_loaders = __commonJS({ + "node_modules/cosmiconfig/dist/loaders.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __importDefault10 = exports28 && exports28.__importDefault || function(mod2) { + return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.loadTs = exports28.loadTsSync = exports28.loadYaml = exports28.loadJson = exports28.loadJs = exports28.loadJsSync = void 0; + var fs_1 = (init_fs(), __toCommonJS(fs_exports)); + var promises_1 = (init_fs(), __toCommonJS(fs_exports)); + var path_1 = __importDefault10((init_path(), __toCommonJS(path_exports))); + var url_1 = (init_url(), __toCommonJS(url_exports)); + var importFresh; + var loadJsSync = function loadJsSync2(filepath) { + if (importFresh === void 0) { + importFresh = require_import_fresh(); + } + return importFresh(filepath); + }; + exports28.loadJsSync = loadJsSync; + var loadJs = async function loadJs2(filepath) { + try { + const { href } = (0, url_1.pathToFileURL)(filepath); + return (await import(href)).default; + } catch (error2) { + try { + return (0, exports28.loadJsSync)(filepath, ""); + } catch (requireError) { + if (requireError.code === "ERR_REQUIRE_ESM" || requireError instanceof SyntaxError && requireError.toString().includes("Cannot use import statement outside a module")) { + throw error2; + } + throw requireError; + } + } + }; + exports28.loadJs = loadJs; + var parseJson; + var loadJson = function loadJson2(filepath, content) { + if (parseJson === void 0) { + parseJson = require_parse_json(); + } + try { + return parseJson(content); + } catch (error2) { + error2.message = `JSON Error in ${filepath}: +${error2.message}`; + throw error2; + } + }; + exports28.loadJson = loadJson; + var yaml; + var loadYaml = function loadYaml2(filepath, content) { + if (yaml === void 0) { + yaml = require_js_yaml3(); + } + try { + return yaml.load(content); + } catch (error2) { + error2.message = `YAML Error in ${filepath}: +${error2.message}`; + throw error2; + } + }; + exports28.loadYaml = loadYaml; + var typescript; + var loadTsSync = function loadTsSync2(filepath, content) { + if (typescript === void 0) { + typescript = require_typescript2(); + } + const compiledFilepath = `${filepath.slice(0, -2)}cjs`; + try { + const config3 = resolveTsConfig(path_1.default.dirname(filepath)) ?? {}; + config3.compilerOptions = { + ...config3.compilerOptions, + module: typescript.ModuleKind.NodeNext, + moduleResolution: typescript.ModuleResolutionKind.NodeNext, + target: typescript.ScriptTarget.ES2022, + noEmit: false + }; + content = typescript.transpileModule(content, config3).outputText; + (0, fs_1.writeFileSync)(compiledFilepath, content); + return (0, exports28.loadJsSync)(compiledFilepath, content).default; + } catch (error2) { + error2.message = `TypeScript Error in ${filepath}: +${error2.message}`; + throw error2; + } finally { + if ((0, fs_1.existsSync)(compiledFilepath)) { + (0, fs_1.rmSync)(compiledFilepath); + } + } + }; + exports28.loadTsSync = loadTsSync; + var loadTs = async function loadTs2(filepath, content) { + if (typescript === void 0) { + typescript = (await Promise.resolve().then(() => __toESM(require_typescript2()))).default; + } + const compiledFilepath = `${filepath.slice(0, -2)}mjs`; + let transpiledContent; + try { + try { + const config3 = resolveTsConfig(path_1.default.dirname(filepath)) ?? {}; + config3.compilerOptions = { + ...config3.compilerOptions, + module: typescript.ModuleKind.ES2022, + moduleResolution: typescript.ModuleResolutionKind.Bundler, + target: typescript.ScriptTarget.ES2022, + noEmit: false + }; + transpiledContent = typescript.transpileModule(content, config3).outputText; + await (0, promises_1.writeFile)(compiledFilepath, transpiledContent); + } catch (error2) { + error2.message = `TypeScript Error in ${filepath}: +${error2.message}`; + throw error2; + } + return await (0, exports28.loadJs)(compiledFilepath, transpiledContent); + } finally { + if ((0, fs_1.existsSync)(compiledFilepath)) { + await (0, promises_1.rm)(compiledFilepath); + } + } + }; + exports28.loadTs = loadTs; + function resolveTsConfig(directory) { + const filePath = typescript.findConfigFile(directory, (fileName) => { + return typescript.sys.fileExists(fileName); + }); + if (filePath !== void 0) { + const { config: config3, error: error2 } = typescript.readConfigFile(filePath, (path2) => typescript.sys.readFile(path2)); + if (error2) { + throw new Error(`Error in ${filePath}: ${error2.messageText.toString()}`); + } + return config3; + } + return; + } + } +}); + +// node_modules/cosmiconfig/dist/defaults.js +var require_defaults2 = __commonJS({ + "node_modules/cosmiconfig/dist/defaults.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.defaultLoadersSync = exports28.defaultLoaders = exports28.metaSearchPlaces = exports28.globalConfigSearchPlacesSync = exports28.globalConfigSearchPlaces = exports28.getDefaultSearchPlacesSync = exports28.getDefaultSearchPlaces = void 0; + var loaders_1 = require_loaders(); + function getDefaultSearchPlaces(moduleName3) { + return [ + "package.json", + `.${moduleName3}rc`, + `.${moduleName3}rc.json`, + `.${moduleName3}rc.yaml`, + `.${moduleName3}rc.yml`, + `.${moduleName3}rc.js`, + `.${moduleName3}rc.ts`, + `.${moduleName3}rc.cjs`, + `.${moduleName3}rc.mjs`, + `.config/${moduleName3}rc`, + `.config/${moduleName3}rc.json`, + `.config/${moduleName3}rc.yaml`, + `.config/${moduleName3}rc.yml`, + `.config/${moduleName3}rc.js`, + `.config/${moduleName3}rc.ts`, + `.config/${moduleName3}rc.cjs`, + `.config/${moduleName3}rc.mjs`, + `${moduleName3}.config.js`, + `${moduleName3}.config.ts`, + `${moduleName3}.config.cjs`, + `${moduleName3}.config.mjs` + ]; + } + exports28.getDefaultSearchPlaces = getDefaultSearchPlaces; + function getDefaultSearchPlacesSync(moduleName3) { + return [ + "package.json", + `.${moduleName3}rc`, + `.${moduleName3}rc.json`, + `.${moduleName3}rc.yaml`, + `.${moduleName3}rc.yml`, + `.${moduleName3}rc.js`, + `.${moduleName3}rc.ts`, + `.${moduleName3}rc.cjs`, + `.config/${moduleName3}rc`, + `.config/${moduleName3}rc.json`, + `.config/${moduleName3}rc.yaml`, + `.config/${moduleName3}rc.yml`, + `.config/${moduleName3}rc.js`, + `.config/${moduleName3}rc.ts`, + `.config/${moduleName3}rc.cjs`, + `${moduleName3}.config.js`, + `${moduleName3}.config.ts`, + `${moduleName3}.config.cjs` + ]; + } + exports28.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync; + exports28.globalConfigSearchPlaces = [ + "config", + "config.json", + "config.yaml", + "config.yml", + "config.js", + "config.ts", + "config.cjs", + "config.mjs" + ]; + exports28.globalConfigSearchPlacesSync = [ + "config", + "config.json", + "config.yaml", + "config.yml", + "config.js", + "config.ts", + "config.cjs" + ]; + exports28.metaSearchPlaces = [ + "package.json", + "package.yaml", + ".config/config.json", + ".config/config.yaml", + ".config/config.yml", + ".config/config.js", + ".config/config.ts", + ".config/config.cjs", + ".config/config.mjs" + ]; + exports28.defaultLoaders = Object.freeze({ + ".mjs": loaders_1.loadJs, + ".cjs": loaders_1.loadJs, + ".js": loaders_1.loadJs, + ".ts": loaders_1.loadTs, + ".json": loaders_1.loadJson, + ".yaml": loaders_1.loadYaml, + ".yml": loaders_1.loadYaml, + noExt: loaders_1.loadYaml + }); + exports28.defaultLoadersSync = Object.freeze({ + ".cjs": loaders_1.loadJsSync, + ".js": loaders_1.loadJsSync, + ".ts": loaders_1.loadTsSync, + ".json": loaders_1.loadJson, + ".yaml": loaders_1.loadYaml, + ".yml": loaders_1.loadYaml, + noExt: loaders_1.loadYaml + }); + } +}); + +// node_modules/env-paths/index.js +var require_env_paths = __commonJS({ + "node_modules/env-paths/index.js"(exports28, module5) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var path2 = (init_path(), __toCommonJS(path_exports)); + var os = (init_os(), __toCommonJS(os_exports)); + var homedir2 = os.homedir(); + var tmpdir2 = os.tmpdir(); + var { env: env3 } = process; + var macos = (name2) => { + const library = path2.join(homedir2, "Library"); + return { + data: path2.join(library, "Application Support", name2), + config: path2.join(library, "Preferences", name2), + cache: path2.join(library, "Caches", name2), + log: path2.join(library, "Logs", name2), + temp: path2.join(tmpdir2, name2) + }; + }; + var windows = (name2) => { + const appData = env3.APPDATA || path2.join(homedir2, "AppData", "Roaming"); + const localAppData = env3.LOCALAPPDATA || path2.join(homedir2, "AppData", "Local"); + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + data: path2.join(localAppData, name2, "Data"), + config: path2.join(appData, name2, "Config"), + cache: path2.join(localAppData, name2, "Cache"), + log: path2.join(localAppData, name2, "Log"), + temp: path2.join(tmpdir2, name2) + }; + }; + var linux = (name2) => { + const username = path2.basename(homedir2); + return { + data: path2.join(env3.XDG_DATA_HOME || path2.join(homedir2, ".local", "share"), name2), + config: path2.join(env3.XDG_CONFIG_HOME || path2.join(homedir2, ".config"), name2), + cache: path2.join(env3.XDG_CACHE_HOME || path2.join(homedir2, ".cache"), name2), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path2.join(env3.XDG_STATE_HOME || path2.join(homedir2, ".local", "state"), name2), + temp: path2.join(tmpdir2, username, name2) + }; + }; + var envPaths = (name2, options) => { + if (typeof name2 !== "string") { + throw new TypeError(`Expected string, got ${typeof name2}`); + } + options = Object.assign({ suffix: "nodejs" }, options); + if (options.suffix) { + name2 += `-${options.suffix}`; + } + if (process.platform === "darwin") { + return macos(name2); + } + if (process.platform === "win32") { + return windows(name2); + } + return linux(name2); + }; + module5.exports = envPaths; + module5.exports.default = envPaths; + } +}); + +// node_modules/cosmiconfig/dist/util.js +var require_util7 = __commonJS({ + "node_modules/cosmiconfig/dist/util.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __createBinding10 = exports28 && exports28.__createBinding || (Object.create ? function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + var desc = Object.getOwnPropertyDescriptor(m7, k6); + if (!desc || ("get" in desc ? !m7.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m7[k6]; + } }; + } + Object.defineProperty(o7, k22, desc); + } : function(o7, m7, k6, k22) { + if (k22 === void 0) + k22 = k6; + o7[k22] = m7[k6]; + }); + var __setModuleDefault9 = exports28 && exports28.__setModuleDefault || (Object.create ? function(o7, v8) { + Object.defineProperty(o7, "default", { enumerable: true, value: v8 }); + } : function(o7, v8) { + o7["default"] = v8; + }); + var __importStar10 = exports28 && exports28.__importStar || function(mod2) { + if (mod2 && mod2.__esModule) + return mod2; + var result2 = {}; + if (mod2 != null) { + for (var k6 in mod2) + if (k6 !== "default" && Object.prototype.hasOwnProperty.call(mod2, k6)) + __createBinding10(result2, mod2, k6); + } + __setModuleDefault9(result2, mod2); + return result2; + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.isDirectorySync = exports28.isDirectory = exports28.removeUndefinedValuesFromObject = exports28.getPropertyByPath = exports28.emplace = void 0; + var fs_1 = __importStar10((init_fs(), __toCommonJS(fs_exports))); + function emplace(map4, key, fn) { + const cached = map4.get(key); + if (cached !== void 0) { + return cached; + } + const result2 = fn(); + map4.set(key, result2); + return result2; + } + exports28.emplace = emplace; + function getPropertyByPath(source, path2) { + if (typeof path2 === "string" && Object.prototype.hasOwnProperty.call(source, path2)) { + return source[path2]; + } + const parsedPath = typeof path2 === "string" ? path2.split(".") : path2; + return parsedPath.reduce((previous, key) => { + if (previous === void 0) { + return previous; + } + return previous[key]; + }, source); + } + exports28.getPropertyByPath = getPropertyByPath; + function removeUndefinedValuesFromObject(options) { + return Object.fromEntries(Object.entries(options).filter(([, value2]) => value2 !== void 0)); + } + exports28.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject; + async function isDirectory(path2) { + try { + const stat2 = await fs_1.promises.stat(path2); + return stat2.isDirectory(); + } catch (e10) { + if (e10.code === "ENOENT") { + return false; + } + throw e10; + } + } + exports28.isDirectory = isDirectory; + function isDirectorySync(path2) { + try { + const stat2 = fs_1.default.statSync(path2); + return stat2.isDirectory(); + } catch (e10) { + if (e10.code === "ENOENT") { + return false; + } + throw e10; + } + } + exports28.isDirectorySync = isDirectorySync; + } +}); + +// node_modules/cosmiconfig/dist/ExplorerBase.js +var require_ExplorerBase = __commonJS({ + "node_modules/cosmiconfig/dist/ExplorerBase.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __importDefault10 = exports28 && exports28.__importDefault || function(mod2) { + return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.getExtensionDescription = exports28.ExplorerBase = void 0; + var env_paths_1 = __importDefault10(require_env_paths()); + var os_1 = __importDefault10((init_os(), __toCommonJS(os_exports))); + var path_1 = __importDefault10((init_path(), __toCommonJS(path_exports))); + var util_js_1 = require_util7(); + var _loadingMetaConfig, _validateConfig, validateConfig_fn; + var ExplorerBase = class { + constructor(options) { + __privateAdd(this, _validateConfig); + __privateAdd(this, _loadingMetaConfig, false); + __publicField(this, "config"); + __publicField(this, "loadCache"); + __publicField(this, "searchCache"); + this.config = options; + if (options.cache) { + this.loadCache = /* @__PURE__ */ new Map(); + this.searchCache = /* @__PURE__ */ new Map(); + } + __privateMethod(this, _validateConfig, validateConfig_fn).call(this); + } + set loadingMetaConfig(value2) { + __privateSet(this, _loadingMetaConfig, value2); + } + clearLoadCache() { + if (this.loadCache) { + this.loadCache.clear(); + } + } + clearSearchCache() { + if (this.searchCache) { + this.searchCache.clear(); + } + } + clearCaches() { + this.clearLoadCache(); + this.clearSearchCache(); + } + toCosmiconfigResult(filepath, config3) { + if (config3 === null) { + return null; + } + if (config3 === void 0) { + return { filepath, config: void 0, isEmpty: true }; + } + if (this.config.applyPackagePropertyPathToConfiguration || __privateGet(this, _loadingMetaConfig)) { + const packageProp = this.config.packageProp ?? this.config.moduleName; + config3 = (0, util_js_1.getPropertyByPath)(config3, packageProp); + } + if (config3 === void 0) { + return { filepath, config: void 0, isEmpty: true }; + } + return { config: config3, filepath }; + } + validateImports(containingFilePath, imports, importStack) { + const fileDirectory = path_1.default.dirname(containingFilePath); + for (const importPath of imports) { + if (typeof importPath !== "string") { + throw new Error(`${containingFilePath}: Key $import must contain a string or a list of strings`); + } + const fullPath = path_1.default.resolve(fileDirectory, importPath); + if (fullPath === containingFilePath) { + throw new Error(`Self-import detected in ${containingFilePath}`); + } + const idx = importStack.indexOf(fullPath); + if (idx !== -1) { + throw new Error(`Circular import detected: +${[...importStack, fullPath].map((path2, i7) => `${i7 + 1}. ${path2}`).join("\n")} (same as ${idx + 1}.)`); + } + } + } + getSearchPlacesForDir(dir2, globalConfigPlaces) { + return (dir2.isGlobalConfig ? globalConfigPlaces : this.config.searchPlaces).map((place) => path_1.default.join(dir2.path, place)); + } + getGlobalConfigDir() { + return (0, env_paths_1.default)(this.config.moduleName, { suffix: "" }).config; + } + *getGlobalDirs(startDir) { + const stopDir = path_1.default.resolve(this.config.stopDir ?? os_1.default.homedir()); + yield { path: startDir, isGlobalConfig: false }; + let currentDir = startDir; + while (currentDir !== stopDir) { + const parentDir = path_1.default.dirname(currentDir); + if (parentDir === currentDir) { + break; + } + yield { path: parentDir, isGlobalConfig: false }; + currentDir = parentDir; + } + yield { path: this.getGlobalConfigDir(), isGlobalConfig: true }; + } + }; + _loadingMetaConfig = new WeakMap(); + _validateConfig = new WeakSet(); + validateConfig_fn = function() { + const config3 = this.config; + for (const place of config3.searchPlaces) { + const extension = path_1.default.extname(place); + const loader2 = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"]; + if (loader2 === void 0) { + throw new Error(`Missing loader for ${getExtensionDescription(place)}.`); + } + if (typeof loader2 !== "function") { + throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader2}.`); + } + } + }; + exports28.ExplorerBase = ExplorerBase; + function getExtensionDescription(extension) { + return extension ? `extension "${extension}"` : "files without extensions"; + } + exports28.getExtensionDescription = getExtensionDescription; + } +}); + +// node_modules/cosmiconfig/dist/merge.js +var require_merge4 = __commonJS({ + "node_modules/cosmiconfig/dist/merge.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.mergeAll = exports28.hasOwn = void 0; + exports28.hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + var objToString = Function.prototype.call.bind(Object.prototype.toString); + function isPlainObject3(obj) { + return objToString(obj) === "[object Object]"; + } + function merge7(target, source, options) { + for (const key of Object.keys(source)) { + const newValue = source[key]; + if ((0, exports28.hasOwn)(target, key)) { + if (Array.isArray(target[key]) && Array.isArray(newValue)) { + if (options.mergeArrays) { + target[key].push(...newValue); + continue; + } + } else if (isPlainObject3(target[key]) && isPlainObject3(newValue)) { + target[key] = merge7(target[key], newValue, options); + continue; + } + } + target[key] = newValue; + } + return target; + } + function mergeAll(objects, options) { + return objects.reduce((target, source) => merge7(target, source, options), {}); + } + exports28.mergeAll = mergeAll; + } +}); + +// node_modules/cosmiconfig/dist/Explorer.js +var require_Explorer = __commonJS({ + "node_modules/cosmiconfig/dist/Explorer.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __importDefault10 = exports28 && exports28.__importDefault || function(mod2) { + return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.Explorer = void 0; + var promises_1 = __importDefault10((init_fs(), __toCommonJS(fs_exports))); + var path_1 = __importDefault10((init_path(), __toCommonJS(path_exports))); + var defaults_1 = require_defaults2(); + var ExplorerBase_js_1 = require_ExplorerBase(); + var merge_1 = require_merge4(); + var util_js_1 = require_util7(); + var _readConfiguration, readConfiguration_fn, _loadConfigFileWithImports, loadConfigFileWithImports_fn, _loadConfiguration, loadConfiguration_fn, _fileExists, fileExists_fn, _getDirs, getDirs_fn; + var Explorer = class extends ExplorerBase_js_1.ExplorerBase { + constructor() { + super(...arguments); + __privateAdd(this, _readConfiguration); + __privateAdd(this, _loadConfigFileWithImports); + __privateAdd(this, _loadConfiguration); + __privateAdd(this, _fileExists); + __privateAdd(this, _getDirs); + } + async load(filepath) { + filepath = path_1.default.resolve(filepath); + const load2 = async () => { + return await this.config.transform(await __privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, filepath)); + }; + if (this.loadCache) { + return await (0, util_js_1.emplace)(this.loadCache, filepath, load2); + } + return await load2(); + } + async search(from = "") { + if (this.config.metaConfigFilePath) { + this.loadingMetaConfig = true; + const config3 = await this.load(this.config.metaConfigFilePath); + this.loadingMetaConfig = false; + if (config3 && !config3.isEmpty) { + return config3; + } + } + from = path_1.default.resolve(from); + const dirs = __privateMethod(this, _getDirs, getDirs_fn).call(this, from); + const firstDirIter = await dirs.next(); + if (firstDirIter.done) { + throw new Error(`Could not find any folders to iterate through (start from ${from})`); + } + let currentDir = firstDirIter.value; + const search = async () => { + if (await (0, util_js_1.isDirectory)(currentDir.path)) { + for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) { + try { + const result2 = await __privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, filepath); + if (result2 !== null && !(result2.isEmpty && this.config.ignoreEmptySearchPlaces)) { + return await this.config.transform(result2); + } + } catch (error2) { + if (error2.code === "ENOENT" || error2.code === "EISDIR" || error2.code === "ENOTDIR" || error2.code === "EACCES") { + continue; + } + throw error2; + } + } + } + const nextDirIter = await dirs.next(); + if (!nextDirIter.done) { + currentDir = nextDirIter.value; + if (this.searchCache) { + return await (0, util_js_1.emplace)(this.searchCache, currentDir.path, search); + } + return await search(); + } + return await this.config.transform(null); + }; + if (this.searchCache) { + return await (0, util_js_1.emplace)(this.searchCache, from, search); + } + return await search(); + } + }; + _readConfiguration = new WeakSet(); + readConfiguration_fn = async function(filepath, importStack = []) { + const contents = await promises_1.default.readFile(filepath, { encoding: "utf-8" }); + return this.toCosmiconfigResult(filepath, await __privateMethod(this, _loadConfigFileWithImports, loadConfigFileWithImports_fn).call(this, filepath, contents, importStack)); + }; + _loadConfigFileWithImports = new WeakSet(); + loadConfigFileWithImports_fn = async function(filepath, contents, importStack) { + const loadedContent = await __privateMethod(this, _loadConfiguration, loadConfiguration_fn).call(this, filepath, contents); + if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) { + return loadedContent; + } + const fileDirectory = path_1.default.dirname(filepath); + const { $import: imports, ...ownContent } = loadedContent; + const importPaths = Array.isArray(imports) ? imports : [imports]; + const newImportStack = [...importStack, filepath]; + this.validateImports(filepath, importPaths, newImportStack); + const importedConfigs = await Promise.all(importPaths.map(async (importPath) => { + const fullPath = path_1.default.resolve(fileDirectory, importPath); + const result2 = await __privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, fullPath, newImportStack); + return result2?.config; + })); + return (0, merge_1.mergeAll)([...importedConfigs, ownContent], { + mergeArrays: this.config.mergeImportArrays + }); + }; + _loadConfiguration = new WeakSet(); + loadConfiguration_fn = async function(filepath, contents) { + if (contents.trim() === "") { + return; + } + const extension = path_1.default.extname(filepath); + const loader2 = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"]; + if (!loader2) { + throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`); + } + try { + const loadedContents = await loader2(filepath, contents); + if (path_1.default.basename(filepath, extension) !== "package") { + return loadedContents; + } + return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null; + } catch (error2) { + error2.filepath = filepath; + throw error2; + } + }; + _fileExists = new WeakSet(); + fileExists_fn = async function(path2) { + try { + await promises_1.default.stat(path2); + return true; + } catch (e10) { + return false; + } + }; + _getDirs = new WeakSet(); + getDirs_fn = async function* (startDir) { + switch (this.config.searchStrategy) { + case "none": { + yield { path: startDir, isGlobalConfig: false }; + return; + } + case "project": { + let currentDir = startDir; + while (true) { + yield { path: currentDir, isGlobalConfig: false }; + for (const ext of ["json", "yaml"]) { + const packageFile = path_1.default.join(currentDir, `package.${ext}`); + if (await __privateMethod(this, _fileExists, fileExists_fn).call(this, packageFile)) { + break; + } + } + const parentDir = path_1.default.dirname(currentDir); + if (parentDir === currentDir) { + break; + } + currentDir = parentDir; + } + return; + } + case "global": { + yield* this.getGlobalDirs(startDir); + } + } + }; + exports28.Explorer = Explorer; + } +}); + +// node_modules/cosmiconfig/dist/ExplorerSync.js +var require_ExplorerSync = __commonJS({ + "node_modules/cosmiconfig/dist/ExplorerSync.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + var __importDefault10 = exports28 && exports28.__importDefault || function(mod2) { + return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; + }; + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.ExplorerSync = void 0; + var fs_1 = __importDefault10((init_fs(), __toCommonJS(fs_exports))); + var path_1 = __importDefault10((init_path(), __toCommonJS(path_exports))); + var defaults_1 = require_defaults2(); + var ExplorerBase_js_1 = require_ExplorerBase(); + var merge_1 = require_merge4(); + var util_js_1 = require_util7(); + var _readConfiguration, readConfiguration_fn, _loadConfigFileWithImports, loadConfigFileWithImports_fn, _loadConfiguration, loadConfiguration_fn, _fileExists, fileExists_fn, _getDirs, getDirs_fn; + var ExplorerSync = class extends ExplorerBase_js_1.ExplorerBase { + constructor() { + super(...arguments); + __privateAdd(this, _readConfiguration); + __privateAdd(this, _loadConfigFileWithImports); + __privateAdd(this, _loadConfiguration); + __privateAdd(this, _fileExists); + __privateAdd(this, _getDirs); + } + load(filepath) { + filepath = path_1.default.resolve(filepath); + const load2 = () => { + return this.config.transform(__privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, filepath)); + }; + if (this.loadCache) { + return (0, util_js_1.emplace)(this.loadCache, filepath, load2); + } + return load2(); + } + search(from = "") { + if (this.config.metaConfigFilePath) { + this.loadingMetaConfig = true; + const config3 = this.load(this.config.metaConfigFilePath); + this.loadingMetaConfig = false; + if (config3 && !config3.isEmpty) { + return config3; + } + } + from = path_1.default.resolve(from); + const dirs = __privateMethod(this, _getDirs, getDirs_fn).call(this, from); + const firstDirIter = dirs.next(); + if (firstDirIter.done) { + throw new Error(`Could not find any folders to iterate through (start from ${from})`); + } + let currentDir = firstDirIter.value; + const search = () => { + if ((0, util_js_1.isDirectorySync)(currentDir.path)) { + for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) { + try { + const result2 = __privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, filepath); + if (result2 !== null && !(result2.isEmpty && this.config.ignoreEmptySearchPlaces)) { + return this.config.transform(result2); + } + } catch (error2) { + if (error2.code === "ENOENT" || error2.code === "EISDIR" || error2.code === "ENOTDIR" || error2.code === "EACCES") { + continue; + } + throw error2; + } + } + } + const nextDirIter = dirs.next(); + if (!nextDirIter.done) { + currentDir = nextDirIter.value; + if (this.searchCache) { + return (0, util_js_1.emplace)(this.searchCache, currentDir.path, search); + } + return search(); + } + return this.config.transform(null); + }; + if (this.searchCache) { + return (0, util_js_1.emplace)(this.searchCache, from, search); + } + return search(); + } + /** + * @deprecated Use {@link ExplorerSync.prototype.load}. + */ + /* istanbul ignore next */ + loadSync(filepath) { + return this.load(filepath); + } + /** + * @deprecated Use {@link ExplorerSync.prototype.search}. + */ + /* istanbul ignore next */ + searchSync(from = "") { + return this.search(from); + } + }; + _readConfiguration = new WeakSet(); + readConfiguration_fn = function(filepath, importStack = []) { + const contents = fs_1.default.readFileSync(filepath, "utf8"); + return this.toCosmiconfigResult(filepath, __privateMethod(this, _loadConfigFileWithImports, loadConfigFileWithImports_fn).call(this, filepath, contents, importStack)); + }; + _loadConfigFileWithImports = new WeakSet(); + loadConfigFileWithImports_fn = function(filepath, contents, importStack) { + const loadedContent = __privateMethod(this, _loadConfiguration, loadConfiguration_fn).call(this, filepath, contents); + if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, "$import")) { + return loadedContent; + } + const fileDirectory = path_1.default.dirname(filepath); + const { $import: imports, ...ownContent } = loadedContent; + const importPaths = Array.isArray(imports) ? imports : [imports]; + const newImportStack = [...importStack, filepath]; + this.validateImports(filepath, importPaths, newImportStack); + const importedConfigs = importPaths.map((importPath) => { + const fullPath = path_1.default.resolve(fileDirectory, importPath); + const result2 = __privateMethod(this, _readConfiguration, readConfiguration_fn).call(this, fullPath, newImportStack); + return result2?.config; + }); + return (0, merge_1.mergeAll)([...importedConfigs, ownContent], { + mergeArrays: this.config.mergeImportArrays + }); + }; + _loadConfiguration = new WeakSet(); + loadConfiguration_fn = function(filepath, contents) { + if (contents.trim() === "") { + return; + } + const extension = path_1.default.extname(filepath); + const loader2 = this.config.loaders[extension || "noExt"] ?? this.config.loaders["default"]; + if (!loader2) { + throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`); + } + try { + const loadedContents = loader2(filepath, contents); + if (path_1.default.basename(filepath, extension) !== "package") { + return loadedContents; + } + return (0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null; + } catch (error2) { + error2.filepath = filepath; + throw error2; + } + }; + _fileExists = new WeakSet(); + fileExists_fn = function(path2) { + try { + fs_1.default.statSync(path2); + return true; + } catch (e10) { + return false; + } + }; + _getDirs = new WeakSet(); + getDirs_fn = function* (startDir) { + switch (this.config.searchStrategy) { + case "none": { + yield { path: startDir, isGlobalConfig: false }; + return; + } + case "project": { + let currentDir = startDir; + while (true) { + yield { path: currentDir, isGlobalConfig: false }; + for (const ext of ["json", "yaml"]) { + const packageFile = path_1.default.join(currentDir, `package.${ext}`); + if (__privateMethod(this, _fileExists, fileExists_fn).call(this, packageFile)) { + break; + } + } + const parentDir = path_1.default.dirname(currentDir); + if (parentDir === currentDir) { + break; + } + currentDir = parentDir; + } + return; + } + case "global": { + yield* this.getGlobalDirs(startDir); + } + } + }; + exports28.ExplorerSync = ExplorerSync; + } +}); + +// node_modules/cosmiconfig/dist/index.js +var require_dist17 = __commonJS({ + "node_modules/cosmiconfig/dist/index.js"(exports28) { + "use strict"; + init_dirname(); + init_buffer2(); + init_process2(); + Object.defineProperty(exports28, "__esModule", { value: true }); + exports28.defaultLoadersSync = exports28.defaultLoaders = exports28.globalConfigSearchPlacesSync = exports28.globalConfigSearchPlaces = exports28.getDefaultSearchPlacesSync = exports28.getDefaultSearchPlaces = exports28.cosmiconfigSync = exports28.cosmiconfig = void 0; + var defaults_1 = require_defaults2(); + Object.defineProperty(exports28, "defaultLoaders", { enumerable: true, get: function() { + return defaults_1.defaultLoaders; + } }); + Object.defineProperty(exports28, "defaultLoadersSync", { enumerable: true, get: function() { + return defaults_1.defaultLoadersSync; + } }); + Object.defineProperty(exports28, "getDefaultSearchPlaces", { enumerable: true, get: function() { + return defaults_1.getDefaultSearchPlaces; + } }); + Object.defineProperty(exports28, "getDefaultSearchPlacesSync", { enumerable: true, get: function() { + return defaults_1.getDefaultSearchPlacesSync; + } }); + Object.defineProperty(exports28, "globalConfigSearchPlaces", { enumerable: true, get: function() { + return defaults_1.globalConfigSearchPlaces; + } }); + Object.defineProperty(exports28, "globalConfigSearchPlacesSync", { enumerable: true, get: function() { + return defaults_1.globalConfigSearchPlacesSync; + } }); + var Explorer_js_1 = require_Explorer(); + var ExplorerSync_js_1 = require_ExplorerSync(); + var util_1 = require_util7(); + var identity2 = function identity3(x7) { + return x7; + }; + function getUserDefinedOptionsFromMetaConfig() { + const metaExplorer = new ExplorerSync_js_1.ExplorerSync({ + moduleName: "cosmiconfig", + stopDir: process.cwd(), + searchPlaces: defaults_1.metaSearchPlaces, + ignoreEmptySearchPlaces: false, + applyPackagePropertyPathToConfiguration: true, + loaders: defaults_1.defaultLoaders, + transform: identity2, + cache: true, + metaConfigFilePath: null, + mergeImportArrays: true, + mergeSearchPlaces: true, + searchStrategy: "none" + }); + const metaConfig = metaExplorer.search(); + if (!metaConfig) { + return null; + } + if (metaConfig.config?.loaders) { + throw new Error("Can not specify loaders in meta config file"); + } + if (metaConfig.config?.searchStrategy) { + throw new Error("Can not specify searchStrategy in meta config file"); + } + const overrideOptions = { + mergeSearchPlaces: true, + ...metaConfig.config ?? {} + }; + return { + config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions), + filepath: metaConfig.filepath + }; + } + function getResolvedSearchPlaces(moduleName3, toolDefinedSearchPlaces, userConfiguredOptions) { + const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path2) => path2.replace("{name}", moduleName3)); + if (userConfiguredOptions.mergeSearchPlaces) { + return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces]; + } + return userConfiguredSearchPlaces ?? /* istanbul ignore next */ + toolDefinedSearchPlaces; + } + function mergeOptionsBase(moduleName3, defaults2, options) { + const userDefinedConfig = getUserDefinedOptionsFromMetaConfig(); + if (!userDefinedConfig) { + return { + ...defaults2, + ...(0, util_1.removeUndefinedValuesFromObject)(options), + loaders: { + ...defaults2.loaders, + ...options.loaders + } + }; + } + const userConfiguredOptions = userDefinedConfig.config; + const toolDefinedSearchPlaces = options.searchPlaces ?? defaults2.searchPlaces; + return { + ...defaults2, + ...(0, util_1.removeUndefinedValuesFromObject)(options), + metaConfigFilePath: userDefinedConfig.filepath, + ...userConfiguredOptions, + searchPlaces: getResolvedSearchPlaces(moduleName3, toolDefinedSearchPlaces, userConfiguredOptions), + loaders: { + ...defaults2.loaders, + ...options.loaders + } + }; + } + function validateOptions(options) { + if (options.searchStrategy != null && options.searchStrategy !== "global" && options.stopDir) { + throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"'); + } + } + function mergeOptions(moduleName3, options) { + validateOptions(options); + const defaults2 = { + moduleName: moduleName3, + searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName3), + ignoreEmptySearchPlaces: true, + cache: true, + transform: identity2, + loaders: defaults_1.defaultLoaders, + metaConfigFilePath: null, + mergeImportArrays: true, + mergeSearchPlaces: true, + searchStrategy: options.stopDir ? "global" : "none" + }; + return mergeOptionsBase(moduleName3, defaults2, options); + } + function mergeOptionsSync(moduleName3, options) { + validateOptions(options); + const defaults2 = { + moduleName: moduleName3, + searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName3), + ignoreEmptySearchPlaces: true, + cache: true, + transform: identity2, + loaders: defaults_1.defaultLoadersSync, + metaConfigFilePath: null, + mergeImportArrays: true, + mergeSearchPlaces: true, + searchStrategy: options.stopDir ? "global" : "none" + }; + return mergeOptionsBase(moduleName3, defaults2, options); + } + function cosmiconfig2(moduleName3, options = {}) { + const normalizedOptions = mergeOptions(moduleName3, options); + const explorer2 = new Explorer_js_1.Explorer(normalizedOptions); + return { + search: explorer2.search.bind(explorer2), + load: explorer2.load.bind(explorer2), + clearLoadCache: explorer2.clearLoadCache.bind(explorer2), + clearSearchCache: explorer2.clearSearchCache.bind(explorer2), + clearCaches: explorer2.clearCaches.bind(explorer2) + }; + } + exports28.cosmiconfig = cosmiconfig2; + function cosmiconfigSync(moduleName3, options = {}) { + const normalizedOptions = mergeOptionsSync(moduleName3, options); + const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions); + return { + search: explorerSync.search.bind(explorerSync), + load: explorerSync.load.bind(explorerSync), + clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync), + clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync), + clearCaches: explorerSync.clearCaches.bind(explorerSync) + }; + } + exports28.cosmiconfigSync = cosmiconfigSync; + } +}); + +// node_modules/esprima/dist/esprima.js +var require_esprima = __commonJS({ + "node_modules/esprima/dist/esprima.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + (function webpackUniversalModuleDefinition(root2, factory) { + if (typeof exports28 === "object" && typeof module5 === "object") + module5.exports = factory(); + else if (typeof define === "function" && define.amd) + define([], factory); + else if (typeof exports28 === "object") + exports28["esprima"] = factory(); + else + root2["esprima"] = factory(); + })(exports28, function() { + return ( + /******/ + function(modules) { + var installedModules = {}; + function __webpack_require__(moduleId) { + if (installedModules[moduleId]) + return installedModules[moduleId].exports; + var module6 = installedModules[moduleId] = { + /******/ + exports: {}, + /******/ + id: moduleId, + /******/ + loaded: false + /******/ + }; + modules[moduleId].call(module6.exports, module6, module6.exports, __webpack_require__); + module6.loaded = true; + return module6.exports; + } + __webpack_require__.m = modules; + __webpack_require__.c = installedModules; + __webpack_require__.p = ""; + return __webpack_require__(0); + }([ + /* 0 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var comment_handler_1 = __webpack_require__(1); + var jsx_parser_1 = __webpack_require__(3); + var parser_1 = __webpack_require__(8); + var tokenizer_1 = __webpack_require__(15); + function parse17(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function(node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = typeof delegate === "function" ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = typeof options.comment === "boolean" && options.comment; + var attachComment = typeof options.attachComment === "boolean" && options.attachComment; + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === "string") { + isModule = options.sourceType === "module"; + } + var parser3; + if (options && typeof options.jsx === "boolean" && options.jsx) { + parser3 = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } else { + parser3 = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser3.parseModule() : parser3.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser3.config.tokens) { + ast.tokens = parser3.tokens; + } + if (parser3.config.tolerant) { + ast.errors = parser3.errorHandler.errors; + } + return ast; + } + exports29.parse = parse17; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = "module"; + return parse17(code, parsingOptions, delegate); + } + exports29.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = "script"; + return parse17(code, parsingOptions, delegate); + } + exports29.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } catch (e10) { + tokenizer.errorHandler.tolerate(e10); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports29.tokenize = tokenize; + var syntax_1 = __webpack_require__(2); + exports29.Syntax = syntax_1.Syntax; + exports29.version = "4.0.1"; + }, + /* 1 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var CommentHandler = function() { + function CommentHandler2() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler2.prototype.insertInnerComments = function(node, metadata) { + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i7 = this.leading.length - 1; i7 >= 0; --i7) { + var entry = this.leading[i7]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i7, 1); + this.trailing.splice(i7, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler2.prototype.findTrailingComments = function(metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i7 = this.trailing.length - 1; i7 >= 0; --i7) { + var entry_1 = this.trailing[i7]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler2.prototype.findLeadingComments = function(metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } else { + break; + } + } + if (target) { + var count2 = target.leadingComments ? target.leadingComments.length : 0; + for (var i7 = count2 - 1; i7 >= 0; --i7) { + var comment = target.leadingComments[i7]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i7, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i7 = this.leading.length - 1; i7 >= 0; --i7) { + var entry = this.leading[i7]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i7, 1); + } + } + return leadingComments; + }; + CommentHandler2.prototype.visitNode = function(node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node, + start: metadata.start.offset + }); + }; + CommentHandler2.prototype.visitComment = function(node, metadata) { + var type3 = node.type[0] === "L" ? "Line" : "Block"; + var comment = { + type: type3, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type3, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type3; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler2.prototype.visit = function(node, metadata) { + if (node.type === "LineComment") { + this.visitComment(node, metadata); + } else if (node.type === "BlockComment") { + this.visitComment(node, metadata); + } else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler2; + }(); + exports29.CommentHandler = CommentHandler; + }, + /* 2 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + exports29.Syntax = { + AssignmentExpression: "AssignmentExpression", + AssignmentPattern: "AssignmentPattern", + ArrayExpression: "ArrayExpression", + ArrayPattern: "ArrayPattern", + ArrowFunctionExpression: "ArrowFunctionExpression", + AwaitExpression: "AwaitExpression", + BlockStatement: "BlockStatement", + BinaryExpression: "BinaryExpression", + BreakStatement: "BreakStatement", + CallExpression: "CallExpression", + CatchClause: "CatchClause", + ClassBody: "ClassBody", + ClassDeclaration: "ClassDeclaration", + ClassExpression: "ClassExpression", + ConditionalExpression: "ConditionalExpression", + ContinueStatement: "ContinueStatement", + DoWhileStatement: "DoWhileStatement", + DebuggerStatement: "DebuggerStatement", + EmptyStatement: "EmptyStatement", + ExportAllDeclaration: "ExportAllDeclaration", + ExportDefaultDeclaration: "ExportDefaultDeclaration", + ExportNamedDeclaration: "ExportNamedDeclaration", + ExportSpecifier: "ExportSpecifier", + ExpressionStatement: "ExpressionStatement", + ForStatement: "ForStatement", + ForOfStatement: "ForOfStatement", + ForInStatement: "ForInStatement", + FunctionDeclaration: "FunctionDeclaration", + FunctionExpression: "FunctionExpression", + Identifier: "Identifier", + IfStatement: "IfStatement", + ImportDeclaration: "ImportDeclaration", + ImportDefaultSpecifier: "ImportDefaultSpecifier", + ImportNamespaceSpecifier: "ImportNamespaceSpecifier", + ImportSpecifier: "ImportSpecifier", + Literal: "Literal", + LabeledStatement: "LabeledStatement", + LogicalExpression: "LogicalExpression", + MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", + MethodDefinition: "MethodDefinition", + NewExpression: "NewExpression", + ObjectExpression: "ObjectExpression", + ObjectPattern: "ObjectPattern", + Program: "Program", + Property: "Property", + RestElement: "RestElement", + ReturnStatement: "ReturnStatement", + SequenceExpression: "SequenceExpression", + SpreadElement: "SpreadElement", + Super: "Super", + SwitchCase: "SwitchCase", + SwitchStatement: "SwitchStatement", + TaggedTemplateExpression: "TaggedTemplateExpression", + TemplateElement: "TemplateElement", + TemplateLiteral: "TemplateLiteral", + ThisExpression: "ThisExpression", + ThrowStatement: "ThrowStatement", + TryStatement: "TryStatement", + UnaryExpression: "UnaryExpression", + UpdateExpression: "UpdateExpression", + VariableDeclaration: "VariableDeclaration", + VariableDeclarator: "VariableDeclarator", + WhileStatement: "WhileStatement", + WithStatement: "WithStatement", + YieldExpression: "YieldExpression" + }; + }, + /* 3 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + var __extends10 = this && this.__extends || function() { + var extendStatics10 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d7, b8) { + d7.__proto__ = b8; + } || function(d7, b8) { + for (var p7 in b8) + if (b8.hasOwnProperty(p7)) + d7[p7] = b8[p7]; + }; + return function(d7, b8) { + extendStatics10(d7, b8); + function __() { + this.constructor = d7; + } + d7.prototype = b8 === null ? Object.create(b8) : (__.prototype = b8.prototype, new __()); + }; + }(); + Object.defineProperty(exports29, "__esModule", { value: true }); + var character_1 = __webpack_require__(4); + var JSXNode = __webpack_require__(5); + var jsx_syntax_1 = __webpack_require__(6); + var Node = __webpack_require__(7); + var parser_1 = __webpack_require__(8); + var token_1 = __webpack_require__(13); + var xhtml_entities_1 = __webpack_require__(14); + token_1.TokenName[ + 100 + /* Identifier */ + ] = "JSXIdentifier"; + token_1.TokenName[ + 101 + /* Text */ + ] = "JSXText"; + function getQualifiedElementName(elementName) { + var qualifiedName; + switch (elementName.type) { + case jsx_syntax_1.JSXSyntax.JSXIdentifier: + var id = elementName; + qualifiedName = id.name; + break; + case jsx_syntax_1.JSXSyntax.JSXNamespacedName: + var ns = elementName; + qualifiedName = getQualifiedElementName(ns.namespace) + ":" + getQualifiedElementName(ns.name); + break; + case jsx_syntax_1.JSXSyntax.JSXMemberExpression: + var expr = elementName; + qualifiedName = getQualifiedElementName(expr.object) + "." + getQualifiedElementName(expr.property); + break; + default: + break; + } + return qualifiedName; + } + var JSXParser = function(_super) { + __extends10(JSXParser2, _super); + function JSXParser2(code, options, delegate) { + return _super.call(this, code, options, delegate) || this; + } + JSXParser2.prototype.parsePrimaryExpression = function() { + return this.match("<") ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); + }; + JSXParser2.prototype.startJSX = function() { + this.scanner.index = this.startMarker.index; + this.scanner.lineNumber = this.startMarker.line; + this.scanner.lineStart = this.startMarker.index - this.startMarker.column; + }; + JSXParser2.prototype.finishJSX = function() { + this.nextToken(); + }; + JSXParser2.prototype.reenterJSX = function() { + this.startJSX(); + this.expectJSX("}"); + if (this.config.tokens) { + this.tokens.pop(); + } + }; + JSXParser2.prototype.createJSXNode = function() { + this.collectComments(); + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser2.prototype.createJSXChildNode = function() { + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser2.prototype.scanXHTMLEntity = function(quote) { + var result2 = "&"; + var valid = true; + var terminated = false; + var numeric = false; + var hex = false; + while (!this.scanner.eof() && valid && !terminated) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === quote) { + break; + } + terminated = ch === ";"; + result2 += ch; + ++this.scanner.index; + if (!terminated) { + switch (result2.length) { + case 2: + numeric = ch === "#"; + break; + case 3: + if (numeric) { + hex = ch === "x"; + valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); + numeric = numeric && !hex; + } + break; + default: + valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); + valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); + break; + } + } + } + if (valid && terminated && result2.length > 2) { + var str2 = result2.substr(1, result2.length - 2); + if (numeric && str2.length > 1) { + result2 = String.fromCharCode(parseInt(str2.substr(1), 10)); + } else if (hex && str2.length > 2) { + result2 = String.fromCharCode(parseInt("0" + str2.substr(1), 16)); + } else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str2]) { + result2 = xhtml_entities_1.XHTMLEntities[str2]; + } + } + return result2; + }; + JSXParser2.prototype.lexJSX = function() { + var cp = this.scanner.source.charCodeAt(this.scanner.index); + if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { + var value2 = this.scanner.source[this.scanner.index++]; + return { + type: 7, + value: value2, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index - 1, + end: this.scanner.index + }; + } + if (cp === 34 || cp === 39) { + var start = this.scanner.index; + var quote = this.scanner.source[this.scanner.index++]; + var str2 = ""; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index++]; + if (ch === quote) { + break; + } else if (ch === "&") { + str2 += this.scanXHTMLEntity(quote); + } else { + str2 += ch; + } + } + return { + type: 8, + value: str2, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start, + end: this.scanner.index + }; + } + if (cp === 46) { + var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); + var n22 = this.scanner.source.charCodeAt(this.scanner.index + 2); + var value2 = n1 === 46 && n22 === 46 ? "..." : "."; + var start = this.scanner.index; + this.scanner.index += value2.length; + return { + type: 7, + value: value2, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start, + end: this.scanner.index + }; + } + if (cp === 96) { + return { + type: 10, + value: "", + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index, + end: this.scanner.index + }; + } + if (character_1.Character.isIdentifierStart(cp) && cp !== 92) { + var start = this.scanner.index; + ++this.scanner.index; + while (!this.scanner.eof()) { + var ch = this.scanner.source.charCodeAt(this.scanner.index); + if (character_1.Character.isIdentifierPart(ch) && ch !== 92) { + ++this.scanner.index; + } else if (ch === 45) { + ++this.scanner.index; + } else { + break; + } + } + var id = this.scanner.source.slice(start, this.scanner.index); + return { + type: 100, + value: id, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start, + end: this.scanner.index + }; + } + return this.scanner.lex(); + }; + JSXParser2.prototype.nextJSXToken = function() { + this.collectComments(); + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var token = this.lexJSX(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + if (this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser2.prototype.nextJSXText = function() { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var start = this.scanner.index; + var text = ""; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === "{" || ch === "<") { + break; + } + ++this.scanner.index; + text += ch; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.scanner.lineNumber; + if (ch === "\r" && this.scanner.source[this.scanner.index] === "\n") { + ++this.scanner.index; + } + this.scanner.lineStart = this.scanner.index; + } + } + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + var token = { + type: 101, + value: text, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start, + end: this.scanner.index + }; + if (text.length > 0 && this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser2.prototype.peekJSXToken = function() { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.lexJSX(); + this.scanner.restoreState(state); + return next; + }; + JSXParser2.prototype.expectJSX = function(value2) { + var token = this.nextJSXToken(); + if (token.type !== 7 || token.value !== value2) { + this.throwUnexpectedToken(token); + } + }; + JSXParser2.prototype.matchJSX = function(value2) { + var next = this.peekJSXToken(); + return next.type === 7 && next.value === value2; + }; + JSXParser2.prototype.parseJSXIdentifier = function() { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 100) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); + }; + JSXParser2.prototype.parseJSXElementName = function() { + var node = this.createJSXNode(); + var elementName = this.parseJSXIdentifier(); + if (this.matchJSX(":")) { + var namespace = elementName; + this.expectJSX(":"); + var name_1 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); + } else if (this.matchJSX(".")) { + while (this.matchJSX(".")) { + var object = elementName; + this.expectJSX("."); + var property2 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property2)); + } + } + return elementName; + }; + JSXParser2.prototype.parseJSXAttributeName = function() { + var node = this.createJSXNode(); + var attributeName; + var identifier = this.parseJSXIdentifier(); + if (this.matchJSX(":")) { + var namespace = identifier; + this.expectJSX(":"); + var name_2 = this.parseJSXIdentifier(); + attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); + } else { + attributeName = identifier; + } + return attributeName; + }; + JSXParser2.prototype.parseJSXStringLiteralAttribute = function() { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 8) { + this.throwUnexpectedToken(token); + } + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + JSXParser2.prototype.parseJSXExpressionAttribute = function() { + var node = this.createJSXNode(); + this.expectJSX("{"); + this.finishJSX(); + if (this.match("}")) { + this.tolerateError("JSX attributes must only be assigned a non-empty expression"); + } + var expression = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser2.prototype.parseJSXAttributeValue = function() { + return this.matchJSX("{") ? this.parseJSXExpressionAttribute() : this.matchJSX("<") ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); + }; + JSXParser2.prototype.parseJSXNameValueAttribute = function() { + var node = this.createJSXNode(); + var name2 = this.parseJSXAttributeName(); + var value2 = null; + if (this.matchJSX("=")) { + this.expectJSX("="); + value2 = this.parseJSXAttributeValue(); + } + return this.finalize(node, new JSXNode.JSXAttribute(name2, value2)); + }; + JSXParser2.prototype.parseJSXSpreadAttribute = function() { + var node = this.createJSXNode(); + this.expectJSX("{"); + this.expectJSX("..."); + this.finishJSX(); + var argument = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); + }; + JSXParser2.prototype.parseJSXAttributes = function() { + var attributes = []; + while (!this.matchJSX("/") && !this.matchJSX(">")) { + var attribute = this.matchJSX("{") ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute(); + attributes.push(attribute); + } + return attributes; + }; + JSXParser2.prototype.parseJSXOpeningElement = function() { + var node = this.createJSXNode(); + this.expectJSX("<"); + var name2 = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX("/"); + if (selfClosing) { + this.expectJSX("/"); + } + this.expectJSX(">"); + return this.finalize(node, new JSXNode.JSXOpeningElement(name2, selfClosing, attributes)); + }; + JSXParser2.prototype.parseJSXBoundaryElement = function() { + var node = this.createJSXNode(); + this.expectJSX("<"); + if (this.matchJSX("/")) { + this.expectJSX("/"); + var name_3 = this.parseJSXElementName(); + this.expectJSX(">"); + return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); + } + var name2 = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX("/"); + if (selfClosing) { + this.expectJSX("/"); + } + this.expectJSX(">"); + return this.finalize(node, new JSXNode.JSXOpeningElement(name2, selfClosing, attributes)); + }; + JSXParser2.prototype.parseJSXEmptyExpression = function() { + var node = this.createJSXChildNode(); + this.collectComments(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + return this.finalize(node, new JSXNode.JSXEmptyExpression()); + }; + JSXParser2.prototype.parseJSXExpressionContainer = function() { + var node = this.createJSXNode(); + this.expectJSX("{"); + var expression; + if (this.matchJSX("}")) { + expression = this.parseJSXEmptyExpression(); + this.expectJSX("}"); + } else { + this.finishJSX(); + expression = this.parseAssignmentExpression(); + this.reenterJSX(); + } + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser2.prototype.parseJSXChildren = function() { + var children = []; + while (!this.scanner.eof()) { + var node = this.createJSXChildNode(); + var token = this.nextJSXText(); + if (token.start < token.end) { + var raw = this.getTokenRaw(token); + var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); + children.push(child); + } + if (this.scanner.source[this.scanner.index] === "{") { + var container = this.parseJSXExpressionContainer(); + children.push(container); + } else { + break; + } + } + return children; + }; + JSXParser2.prototype.parseComplexJSXElement = function(el) { + var stack = []; + while (!this.scanner.eof()) { + el.children = el.children.concat(this.parseJSXChildren()); + var node = this.createJSXChildNode(); + var element = this.parseJSXBoundaryElement(); + if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { + var opening = element; + if (opening.selfClosing) { + var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); + el.children.push(child); + } else { + stack.push(el); + el = { node, opening, closing: null, children: [] }; + } + } + if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { + el.closing = element; + var open_1 = getQualifiedElementName(el.opening.name); + var close_1 = getQualifiedElementName(el.closing.name); + if (open_1 !== close_1) { + this.tolerateError("Expected corresponding JSX closing tag for %0", open_1); + } + if (stack.length > 0) { + var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); + el = stack[stack.length - 1]; + el.children.push(child); + stack.pop(); + } else { + break; + } + } + } + return el; + }; + JSXParser2.prototype.parseJSXElement = function() { + var node = this.createJSXNode(); + var opening = this.parseJSXOpeningElement(); + var children = []; + var closing = null; + if (!opening.selfClosing) { + var el = this.parseComplexJSXElement({ node, opening, closing, children }); + children = el.children; + closing = el.closing; + } + return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); + }; + JSXParser2.prototype.parseJSXRoot = function() { + if (this.config.tokens) { + this.tokens.pop(); + } + this.startJSX(); + var element = this.parseJSXElement(); + this.finishJSX(); + return element; + }; + JSXParser2.prototype.isStartOfExpression = function() { + return _super.prototype.isStartOfExpression.call(this) || this.match("<"); + }; + return JSXParser2; + }(parser_1.Parser); + exports29.JSXParser = JSXParser; + }, + /* 4 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var Regex = { + // Unicode v8.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // Unicode v8.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + exports29.Character = { + /* tslint:disable:no-bitwise */ + fromCodePoint: function(cp) { + return cp < 65536 ? String.fromCharCode(cp) : String.fromCharCode(55296 + (cp - 65536 >> 10)) + String.fromCharCode(56320 + (cp - 65536 & 1023)); + }, + // https://tc39.github.io/ecma262/#sec-white-space + isWhiteSpace: function(cp) { + return cp === 32 || cp === 9 || cp === 11 || cp === 12 || cp === 160 || cp >= 5760 && [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(cp) >= 0; + }, + // https://tc39.github.io/ecma262/#sec-line-terminators + isLineTerminator: function(cp) { + return cp === 10 || cp === 13 || cp === 8232 || cp === 8233; + }, + // https://tc39.github.io/ecma262/#sec-names-and-keywords + isIdentifierStart: function(cp) { + return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierStart.test(exports29.Character.fromCodePoint(cp)); + }, + isIdentifierPart: function(cp) { + return cp === 36 || cp === 95 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp >= 48 && cp <= 57 || cp === 92 || cp >= 128 && Regex.NonAsciiIdentifierPart.test(exports29.Character.fromCodePoint(cp)); + }, + // https://tc39.github.io/ecma262/#sec-literals-numeric-literals + isDecimalDigit: function(cp) { + return cp >= 48 && cp <= 57; + }, + isHexDigit: function(cp) { + return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 70 || cp >= 97 && cp <= 102; + }, + isOctalDigit: function(cp) { + return cp >= 48 && cp <= 55; + } + }; + }, + /* 5 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var jsx_syntax_1 = __webpack_require__(6); + var JSXClosingElement = /* @__PURE__ */ function() { + function JSXClosingElement2(name2) { + this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; + this.name = name2; + } + return JSXClosingElement2; + }(); + exports29.JSXClosingElement = JSXClosingElement; + var JSXElement = /* @__PURE__ */ function() { + function JSXElement2(openingElement, children, closingElement) { + this.type = jsx_syntax_1.JSXSyntax.JSXElement; + this.openingElement = openingElement; + this.children = children; + this.closingElement = closingElement; + } + return JSXElement2; + }(); + exports29.JSXElement = JSXElement; + var JSXEmptyExpression = /* @__PURE__ */ function() { + function JSXEmptyExpression2() { + this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; + } + return JSXEmptyExpression2; + }(); + exports29.JSXEmptyExpression = JSXEmptyExpression; + var JSXExpressionContainer = /* @__PURE__ */ function() { + function JSXExpressionContainer2(expression) { + this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; + this.expression = expression; + } + return JSXExpressionContainer2; + }(); + exports29.JSXExpressionContainer = JSXExpressionContainer; + var JSXIdentifier = /* @__PURE__ */ function() { + function JSXIdentifier2(name2) { + this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; + this.name = name2; + } + return JSXIdentifier2; + }(); + exports29.JSXIdentifier = JSXIdentifier; + var JSXMemberExpression = /* @__PURE__ */ function() { + function JSXMemberExpression2(object, property2) { + this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; + this.object = object; + this.property = property2; + } + return JSXMemberExpression2; + }(); + exports29.JSXMemberExpression = JSXMemberExpression; + var JSXAttribute = /* @__PURE__ */ function() { + function JSXAttribute2(name2, value2) { + this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; + this.name = name2; + this.value = value2; + } + return JSXAttribute2; + }(); + exports29.JSXAttribute = JSXAttribute; + var JSXNamespacedName = /* @__PURE__ */ function() { + function JSXNamespacedName2(namespace, name2) { + this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; + this.namespace = namespace; + this.name = name2; + } + return JSXNamespacedName2; + }(); + exports29.JSXNamespacedName = JSXNamespacedName; + var JSXOpeningElement = /* @__PURE__ */ function() { + function JSXOpeningElement2(name2, selfClosing, attributes) { + this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; + this.name = name2; + this.selfClosing = selfClosing; + this.attributes = attributes; + } + return JSXOpeningElement2; + }(); + exports29.JSXOpeningElement = JSXOpeningElement; + var JSXSpreadAttribute = /* @__PURE__ */ function() { + function JSXSpreadAttribute2(argument) { + this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; + this.argument = argument; + } + return JSXSpreadAttribute2; + }(); + exports29.JSXSpreadAttribute = JSXSpreadAttribute; + var JSXText = /* @__PURE__ */ function() { + function JSXText2(value2, raw) { + this.type = jsx_syntax_1.JSXSyntax.JSXText; + this.value = value2; + this.raw = raw; + } + return JSXText2; + }(); + exports29.JSXText = JSXText; + }, + /* 6 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + exports29.JSXSyntax = { + JSXAttribute: "JSXAttribute", + JSXClosingElement: "JSXClosingElement", + JSXElement: "JSXElement", + JSXEmptyExpression: "JSXEmptyExpression", + JSXExpressionContainer: "JSXExpressionContainer", + JSXIdentifier: "JSXIdentifier", + JSXMemberExpression: "JSXMemberExpression", + JSXNamespacedName: "JSXNamespacedName", + JSXOpeningElement: "JSXOpeningElement", + JSXSpreadAttribute: "JSXSpreadAttribute", + JSXText: "JSXText" + }; + }, + /* 7 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var ArrayExpression = /* @__PURE__ */ function() { + function ArrayExpression2(elements) { + this.type = syntax_1.Syntax.ArrayExpression; + this.elements = elements; + } + return ArrayExpression2; + }(); + exports29.ArrayExpression = ArrayExpression; + var ArrayPattern = /* @__PURE__ */ function() { + function ArrayPattern2(elements) { + this.type = syntax_1.Syntax.ArrayPattern; + this.elements = elements; + } + return ArrayPattern2; + }(); + exports29.ArrayPattern = ArrayPattern; + var ArrowFunctionExpression = /* @__PURE__ */ function() { + function ArrowFunctionExpression2(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = false; + } + return ArrowFunctionExpression2; + }(); + exports29.ArrowFunctionExpression = ArrowFunctionExpression; + var AssignmentExpression = /* @__PURE__ */ function() { + function AssignmentExpression2(operator, left, right) { + this.type = syntax_1.Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return AssignmentExpression2; + }(); + exports29.AssignmentExpression = AssignmentExpression; + var AssignmentPattern = /* @__PURE__ */ function() { + function AssignmentPattern2(left, right) { + this.type = syntax_1.Syntax.AssignmentPattern; + this.left = left; + this.right = right; + } + return AssignmentPattern2; + }(); + exports29.AssignmentPattern = AssignmentPattern; + var AsyncArrowFunctionExpression = /* @__PURE__ */ function() { + function AsyncArrowFunctionExpression2(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = true; + } + return AsyncArrowFunctionExpression2; + }(); + exports29.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; + var AsyncFunctionDeclaration = /* @__PURE__ */ function() { + function AsyncFunctionDeclaration2(id, params, body) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionDeclaration2; + }(); + exports29.AsyncFunctionDeclaration = AsyncFunctionDeclaration; + var AsyncFunctionExpression = /* @__PURE__ */ function() { + function AsyncFunctionExpression2(id, params, body) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionExpression2; + }(); + exports29.AsyncFunctionExpression = AsyncFunctionExpression; + var AwaitExpression = /* @__PURE__ */ function() { + function AwaitExpression2(argument) { + this.type = syntax_1.Syntax.AwaitExpression; + this.argument = argument; + } + return AwaitExpression2; + }(); + exports29.AwaitExpression = AwaitExpression; + var BinaryExpression = /* @__PURE__ */ function() { + function BinaryExpression2(operator, left, right) { + var logical = operator === "||" || operator === "&&"; + this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return BinaryExpression2; + }(); + exports29.BinaryExpression = BinaryExpression; + var BlockStatement = /* @__PURE__ */ function() { + function BlockStatement2(body) { + this.type = syntax_1.Syntax.BlockStatement; + this.body = body; + } + return BlockStatement2; + }(); + exports29.BlockStatement = BlockStatement; + var BreakStatement = /* @__PURE__ */ function() { + function BreakStatement2(label) { + this.type = syntax_1.Syntax.BreakStatement; + this.label = label; + } + return BreakStatement2; + }(); + exports29.BreakStatement = BreakStatement; + var CallExpression = /* @__PURE__ */ function() { + function CallExpression2(callee, args) { + this.type = syntax_1.Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + } + return CallExpression2; + }(); + exports29.CallExpression = CallExpression; + var CatchClause = /* @__PURE__ */ function() { + function CatchClause2(param, body) { + this.type = syntax_1.Syntax.CatchClause; + this.param = param; + this.body = body; + } + return CatchClause2; + }(); + exports29.CatchClause = CatchClause; + var ClassBody = /* @__PURE__ */ function() { + function ClassBody2(body) { + this.type = syntax_1.Syntax.ClassBody; + this.body = body; + } + return ClassBody2; + }(); + exports29.ClassBody = ClassBody; + var ClassDeclaration = /* @__PURE__ */ function() { + function ClassDeclaration2(id, superClass, body) { + this.type = syntax_1.Syntax.ClassDeclaration; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassDeclaration2; + }(); + exports29.ClassDeclaration = ClassDeclaration; + var ClassExpression = /* @__PURE__ */ function() { + function ClassExpression2(id, superClass, body) { + this.type = syntax_1.Syntax.ClassExpression; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassExpression2; + }(); + exports29.ClassExpression = ClassExpression; + var ComputedMemberExpression = /* @__PURE__ */ function() { + function ComputedMemberExpression2(object, property2) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = true; + this.object = object; + this.property = property2; + } + return ComputedMemberExpression2; + }(); + exports29.ComputedMemberExpression = ComputedMemberExpression; + var ConditionalExpression = /* @__PURE__ */ function() { + function ConditionalExpression2(test, consequent, alternate) { + this.type = syntax_1.Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return ConditionalExpression2; + }(); + exports29.ConditionalExpression = ConditionalExpression; + var ContinueStatement = /* @__PURE__ */ function() { + function ContinueStatement2(label) { + this.type = syntax_1.Syntax.ContinueStatement; + this.label = label; + } + return ContinueStatement2; + }(); + exports29.ContinueStatement = ContinueStatement; + var DebuggerStatement = /* @__PURE__ */ function() { + function DebuggerStatement2() { + this.type = syntax_1.Syntax.DebuggerStatement; + } + return DebuggerStatement2; + }(); + exports29.DebuggerStatement = DebuggerStatement; + var Directive = /* @__PURE__ */ function() { + function Directive2(expression, directive) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + this.directive = directive; + } + return Directive2; + }(); + exports29.Directive = Directive; + var DoWhileStatement = /* @__PURE__ */ function() { + function DoWhileStatement2(body, test) { + this.type = syntax_1.Syntax.DoWhileStatement; + this.body = body; + this.test = test; + } + return DoWhileStatement2; + }(); + exports29.DoWhileStatement = DoWhileStatement; + var EmptyStatement = /* @__PURE__ */ function() { + function EmptyStatement2() { + this.type = syntax_1.Syntax.EmptyStatement; + } + return EmptyStatement2; + }(); + exports29.EmptyStatement = EmptyStatement; + var ExportAllDeclaration = /* @__PURE__ */ function() { + function ExportAllDeclaration2(source) { + this.type = syntax_1.Syntax.ExportAllDeclaration; + this.source = source; + } + return ExportAllDeclaration2; + }(); + exports29.ExportAllDeclaration = ExportAllDeclaration; + var ExportDefaultDeclaration = /* @__PURE__ */ function() { + function ExportDefaultDeclaration2(declaration) { + this.type = syntax_1.Syntax.ExportDefaultDeclaration; + this.declaration = declaration; + } + return ExportDefaultDeclaration2; + }(); + exports29.ExportDefaultDeclaration = ExportDefaultDeclaration; + var ExportNamedDeclaration = /* @__PURE__ */ function() { + function ExportNamedDeclaration2(declaration, specifiers, source) { + this.type = syntax_1.Syntax.ExportNamedDeclaration; + this.declaration = declaration; + this.specifiers = specifiers; + this.source = source; + } + return ExportNamedDeclaration2; + }(); + exports29.ExportNamedDeclaration = ExportNamedDeclaration; + var ExportSpecifier = /* @__PURE__ */ function() { + function ExportSpecifier2(local, exported) { + this.type = syntax_1.Syntax.ExportSpecifier; + this.exported = exported; + this.local = local; + } + return ExportSpecifier2; + }(); + exports29.ExportSpecifier = ExportSpecifier; + var ExpressionStatement = /* @__PURE__ */ function() { + function ExpressionStatement2(expression) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + } + return ExpressionStatement2; + }(); + exports29.ExpressionStatement = ExpressionStatement; + var ForInStatement = /* @__PURE__ */ function() { + function ForInStatement2(left, right, body) { + this.type = syntax_1.Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + } + return ForInStatement2; + }(); + exports29.ForInStatement = ForInStatement; + var ForOfStatement = /* @__PURE__ */ function() { + function ForOfStatement2(left, right, body) { + this.type = syntax_1.Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + } + return ForOfStatement2; + }(); + exports29.ForOfStatement = ForOfStatement; + var ForStatement = /* @__PURE__ */ function() { + function ForStatement2(init2, test, update2, body) { + this.type = syntax_1.Syntax.ForStatement; + this.init = init2; + this.test = test; + this.update = update2; + this.body = body; + } + return ForStatement2; + }(); + exports29.ForStatement = ForStatement; + var FunctionDeclaration = /* @__PURE__ */ function() { + function FunctionDeclaration2(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionDeclaration2; + }(); + exports29.FunctionDeclaration = FunctionDeclaration; + var FunctionExpression = /* @__PURE__ */ function() { + function FunctionExpression2(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionExpression2; + }(); + exports29.FunctionExpression = FunctionExpression; + var Identifier = /* @__PURE__ */ function() { + function Identifier2(name2) { + this.type = syntax_1.Syntax.Identifier; + this.name = name2; + } + return Identifier2; + }(); + exports29.Identifier = Identifier; + var IfStatement = /* @__PURE__ */ function() { + function IfStatement2(test, consequent, alternate) { + this.type = syntax_1.Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return IfStatement2; + }(); + exports29.IfStatement = IfStatement; + var ImportDeclaration = /* @__PURE__ */ function() { + function ImportDeclaration2(specifiers, source) { + this.type = syntax_1.Syntax.ImportDeclaration; + this.specifiers = specifiers; + this.source = source; + } + return ImportDeclaration2; + }(); + exports29.ImportDeclaration = ImportDeclaration; + var ImportDefaultSpecifier = /* @__PURE__ */ function() { + function ImportDefaultSpecifier2(local) { + this.type = syntax_1.Syntax.ImportDefaultSpecifier; + this.local = local; + } + return ImportDefaultSpecifier2; + }(); + exports29.ImportDefaultSpecifier = ImportDefaultSpecifier; + var ImportNamespaceSpecifier = /* @__PURE__ */ function() { + function ImportNamespaceSpecifier2(local) { + this.type = syntax_1.Syntax.ImportNamespaceSpecifier; + this.local = local; + } + return ImportNamespaceSpecifier2; + }(); + exports29.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + var ImportSpecifier = /* @__PURE__ */ function() { + function ImportSpecifier2(local, imported) { + this.type = syntax_1.Syntax.ImportSpecifier; + this.local = local; + this.imported = imported; + } + return ImportSpecifier2; + }(); + exports29.ImportSpecifier = ImportSpecifier; + var LabeledStatement = /* @__PURE__ */ function() { + function LabeledStatement2(label, body) { + this.type = syntax_1.Syntax.LabeledStatement; + this.label = label; + this.body = body; + } + return LabeledStatement2; + }(); + exports29.LabeledStatement = LabeledStatement; + var Literal = /* @__PURE__ */ function() { + function Literal2(value2, raw) { + this.type = syntax_1.Syntax.Literal; + this.value = value2; + this.raw = raw; + } + return Literal2; + }(); + exports29.Literal = Literal; + var MetaProperty = /* @__PURE__ */ function() { + function MetaProperty2(meta, property2) { + this.type = syntax_1.Syntax.MetaProperty; + this.meta = meta; + this.property = property2; + } + return MetaProperty2; + }(); + exports29.MetaProperty = MetaProperty; + var MethodDefinition = /* @__PURE__ */ function() { + function MethodDefinition2(key, computed, value2, kind, isStatic) { + this.type = syntax_1.Syntax.MethodDefinition; + this.key = key; + this.computed = computed; + this.value = value2; + this.kind = kind; + this.static = isStatic; + } + return MethodDefinition2; + }(); + exports29.MethodDefinition = MethodDefinition; + var Module = /* @__PURE__ */ function() { + function Module2(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = "module"; + } + return Module2; + }(); + exports29.Module = Module; + var NewExpression = /* @__PURE__ */ function() { + function NewExpression2(callee, args) { + this.type = syntax_1.Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + } + return NewExpression2; + }(); + exports29.NewExpression = NewExpression; + var ObjectExpression = /* @__PURE__ */ function() { + function ObjectExpression2(properties) { + this.type = syntax_1.Syntax.ObjectExpression; + this.properties = properties; + } + return ObjectExpression2; + }(); + exports29.ObjectExpression = ObjectExpression; + var ObjectPattern = /* @__PURE__ */ function() { + function ObjectPattern2(properties) { + this.type = syntax_1.Syntax.ObjectPattern; + this.properties = properties; + } + return ObjectPattern2; + }(); + exports29.ObjectPattern = ObjectPattern; + var Property = /* @__PURE__ */ function() { + function Property2(kind, key, computed, value2, method2, shorthand) { + this.type = syntax_1.Syntax.Property; + this.key = key; + this.computed = computed; + this.value = value2; + this.kind = kind; + this.method = method2; + this.shorthand = shorthand; + } + return Property2; + }(); + exports29.Property = Property; + var RegexLiteral = /* @__PURE__ */ function() { + function RegexLiteral2(value2, raw, pattern5, flags) { + this.type = syntax_1.Syntax.Literal; + this.value = value2; + this.raw = raw; + this.regex = { pattern: pattern5, flags }; + } + return RegexLiteral2; + }(); + exports29.RegexLiteral = RegexLiteral; + var RestElement = /* @__PURE__ */ function() { + function RestElement2(argument) { + this.type = syntax_1.Syntax.RestElement; + this.argument = argument; + } + return RestElement2; + }(); + exports29.RestElement = RestElement; + var ReturnStatement = /* @__PURE__ */ function() { + function ReturnStatement2(argument) { + this.type = syntax_1.Syntax.ReturnStatement; + this.argument = argument; + } + return ReturnStatement2; + }(); + exports29.ReturnStatement = ReturnStatement; + var Script7 = /* @__PURE__ */ function() { + function Script8(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = "script"; + } + return Script8; + }(); + exports29.Script = Script7; + var SequenceExpression = /* @__PURE__ */ function() { + function SequenceExpression2(expressions) { + this.type = syntax_1.Syntax.SequenceExpression; + this.expressions = expressions; + } + return SequenceExpression2; + }(); + exports29.SequenceExpression = SequenceExpression; + var SpreadElement = /* @__PURE__ */ function() { + function SpreadElement2(argument) { + this.type = syntax_1.Syntax.SpreadElement; + this.argument = argument; + } + return SpreadElement2; + }(); + exports29.SpreadElement = SpreadElement; + var StaticMemberExpression = /* @__PURE__ */ function() { + function StaticMemberExpression2(object, property2) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = false; + this.object = object; + this.property = property2; + } + return StaticMemberExpression2; + }(); + exports29.StaticMemberExpression = StaticMemberExpression; + var Super = /* @__PURE__ */ function() { + function Super2() { + this.type = syntax_1.Syntax.Super; + } + return Super2; + }(); + exports29.Super = Super; + var SwitchCase = /* @__PURE__ */ function() { + function SwitchCase2(test, consequent) { + this.type = syntax_1.Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + } + return SwitchCase2; + }(); + exports29.SwitchCase = SwitchCase; + var SwitchStatement = /* @__PURE__ */ function() { + function SwitchStatement2(discriminant, cases) { + this.type = syntax_1.Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + } + return SwitchStatement2; + }(); + exports29.SwitchStatement = SwitchStatement; + var TaggedTemplateExpression = /* @__PURE__ */ function() { + function TaggedTemplateExpression2(tag, quasi) { + this.type = syntax_1.Syntax.TaggedTemplateExpression; + this.tag = tag; + this.quasi = quasi; + } + return TaggedTemplateExpression2; + }(); + exports29.TaggedTemplateExpression = TaggedTemplateExpression; + var TemplateElement = /* @__PURE__ */ function() { + function TemplateElement2(value2, tail2) { + this.type = syntax_1.Syntax.TemplateElement; + this.value = value2; + this.tail = tail2; + } + return TemplateElement2; + }(); + exports29.TemplateElement = TemplateElement; + var TemplateLiteral = /* @__PURE__ */ function() { + function TemplateLiteral2(quasis, expressions) { + this.type = syntax_1.Syntax.TemplateLiteral; + this.quasis = quasis; + this.expressions = expressions; + } + return TemplateLiteral2; + }(); + exports29.TemplateLiteral = TemplateLiteral; + var ThisExpression = /* @__PURE__ */ function() { + function ThisExpression2() { + this.type = syntax_1.Syntax.ThisExpression; + } + return ThisExpression2; + }(); + exports29.ThisExpression = ThisExpression; + var ThrowStatement = /* @__PURE__ */ function() { + function ThrowStatement2(argument) { + this.type = syntax_1.Syntax.ThrowStatement; + this.argument = argument; + } + return ThrowStatement2; + }(); + exports29.ThrowStatement = ThrowStatement; + var TryStatement = /* @__PURE__ */ function() { + function TryStatement2(block, handler, finalizer) { + this.type = syntax_1.Syntax.TryStatement; + this.block = block; + this.handler = handler; + this.finalizer = finalizer; + } + return TryStatement2; + }(); + exports29.TryStatement = TryStatement; + var UnaryExpression = /* @__PURE__ */ function() { + function UnaryExpression2(operator, argument) { + this.type = syntax_1.Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + } + return UnaryExpression2; + }(); + exports29.UnaryExpression = UnaryExpression; + var UpdateExpression = /* @__PURE__ */ function() { + function UpdateExpression2(operator, argument, prefix) { + this.type = syntax_1.Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = prefix; + } + return UpdateExpression2; + }(); + exports29.UpdateExpression = UpdateExpression; + var VariableDeclaration = /* @__PURE__ */ function() { + function VariableDeclaration2(declarations, kind) { + this.type = syntax_1.Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + } + return VariableDeclaration2; + }(); + exports29.VariableDeclaration = VariableDeclaration; + var VariableDeclarator = /* @__PURE__ */ function() { + function VariableDeclarator2(id, init2) { + this.type = syntax_1.Syntax.VariableDeclarator; + this.id = id; + this.init = init2; + } + return VariableDeclarator2; + }(); + exports29.VariableDeclarator = VariableDeclarator; + var WhileStatement = /* @__PURE__ */ function() { + function WhileStatement2(test, body) { + this.type = syntax_1.Syntax.WhileStatement; + this.test = test; + this.body = body; + } + return WhileStatement2; + }(); + exports29.WhileStatement = WhileStatement; + var WithStatement = /* @__PURE__ */ function() { + function WithStatement2(object, body) { + this.type = syntax_1.Syntax.WithStatement; + this.object = object; + this.body = body; + } + return WithStatement2; + }(); + exports29.WithStatement = WithStatement; + var YieldExpression = /* @__PURE__ */ function() { + function YieldExpression2(argument, delegate) { + this.type = syntax_1.Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + } + return YieldExpression2; + }(); + exports29.YieldExpression = YieldExpression; + }, + /* 8 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var error_handler_1 = __webpack_require__(10); + var messages_1 = __webpack_require__(11); + var Node = __webpack_require__(7); + var scanner_1 = __webpack_require__(12); + var syntax_1 = __webpack_require__(2); + var token_1 = __webpack_require__(13); + var ArrowParameterPlaceHolder = "ArrowParameterPlaceHolder"; + var Parser7 = function() { + function Parser8(code, options, delegate) { + if (options === void 0) { + options = {}; + } + this.config = { + range: typeof options.range === "boolean" && options.range, + loc: typeof options.loc === "boolean" && options.loc, + source: null, + tokens: typeof options.tokens === "boolean" && options.tokens, + comment: typeof options.comment === "boolean" && options.comment, + tolerant: typeof options.tolerant === "boolean" && options.tolerant + }; + if (this.config.loc && options.source && options.source !== null) { + this.config.source = String(options.source); + } + this.delegate = delegate; + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = this.config.tolerant; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = this.config.comment; + this.operatorPrecedence = { + ")": 0, + ";": 0, + ",": 0, + "=": 0, + "]": 0, + "||": 1, + "&&": 2, + "|": 3, + "^": 4, + "&": 5, + "==": 6, + "!=": 6, + "===": 6, + "!==": 6, + "<": 7, + ">": 7, + "<=": 7, + ">=": 7, + "<<": 8, + ">>": 8, + ">>>": 8, + "+": 9, + "-": 9, + "*": 11, + "/": 11, + "%": 11 + }; + this.lookahead = { + type: 2, + value: "", + lineNumber: this.scanner.lineNumber, + lineStart: 0, + start: 0, + end: 0 + }; + this.hasLineTerminator = false; + this.context = { + isModule: false, + await: false, + allowIn: true, + allowStrictDirective: true, + allowYield: true, + firstCoverInitializedNameError: null, + isAssignmentTarget: false, + isBindingElement: false, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + labelSet: {}, + strict: false + }; + this.tokens = []; + this.startMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.lastMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.nextToken(); + this.lastMarker = { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + } + Parser8.prototype.throwError = function(messageFormat) { + var values2 = []; + for (var _i = 1; _i < arguments.length; _i++) { + values2[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { + assert_1.assert(idx < args.length, "Message reference must be in range"); + return args[idx]; + }); + var index4 = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + throw this.errorHandler.createError(index4, line, column, msg); + }; + Parser8.prototype.tolerateError = function(messageFormat) { + var values2 = []; + for (var _i = 1; _i < arguments.length; _i++) { + values2[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function(whole, idx) { + assert_1.assert(idx < args.length, "Message reference must be in range"); + return args[idx]; + }); + var index4 = this.lastMarker.index; + var line = this.scanner.lineNumber; + var column = this.lastMarker.column + 1; + this.errorHandler.tolerateError(index4, line, column, msg); + }; + Parser8.prototype.unexpectedTokenError = function(token, message) { + var msg = message || messages_1.Messages.UnexpectedToken; + var value2; + if (token) { + if (!message) { + msg = token.type === 2 ? messages_1.Messages.UnexpectedEOS : token.type === 3 ? messages_1.Messages.UnexpectedIdentifier : token.type === 6 ? messages_1.Messages.UnexpectedNumber : token.type === 8 ? messages_1.Messages.UnexpectedString : token.type === 10 ? messages_1.Messages.UnexpectedTemplate : messages_1.Messages.UnexpectedToken; + if (token.type === 4) { + if (this.scanner.isFutureReservedWord(token.value)) { + msg = messages_1.Messages.UnexpectedReserved; + } else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { + msg = messages_1.Messages.StrictReservedWord; + } + } + } + value2 = token.value; + } else { + value2 = "ILLEGAL"; + } + msg = msg.replace("%0", value2); + if (token && typeof token.lineNumber === "number") { + var index4 = token.start; + var line = token.lineNumber; + var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; + var column = token.start - lastMarkerLineStart + 1; + return this.errorHandler.createError(index4, line, column, msg); + } else { + var index4 = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + return this.errorHandler.createError(index4, line, column, msg); + } + }; + Parser8.prototype.throwUnexpectedToken = function(token, message) { + throw this.unexpectedTokenError(token, message); + }; + Parser8.prototype.tolerateUnexpectedToken = function(token, message) { + this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); + }; + Parser8.prototype.collectComments = function() { + if (!this.config.comment) { + this.scanner.scanComments(); + } else { + var comments = this.scanner.scanComments(); + if (comments.length > 0 && this.delegate) { + for (var i7 = 0; i7 < comments.length; ++i7) { + var e10 = comments[i7]; + var node = void 0; + node = { + type: e10.multiLine ? "BlockComment" : "LineComment", + value: this.scanner.source.slice(e10.slice[0], e10.slice[1]) + }; + if (this.config.range) { + node.range = e10.range; + } + if (this.config.loc) { + node.loc = e10.loc; + } + var metadata = { + start: { + line: e10.loc.start.line, + column: e10.loc.start.column, + offset: e10.range[0] + }, + end: { + line: e10.loc.end.line, + column: e10.loc.end.column, + offset: e10.range[1] + } + }; + this.delegate(node, metadata); + } + } + } + }; + Parser8.prototype.getTokenRaw = function(token) { + return this.scanner.source.slice(token.start, token.end); + }; + Parser8.prototype.convertToken = function(token) { + var t8 = { + type: token_1.TokenName[token.type], + value: this.getTokenRaw(token) + }; + if (this.config.range) { + t8.range = [token.start, token.end]; + } + if (this.config.loc) { + t8.loc = { + start: { + line: this.startMarker.line, + column: this.startMarker.column + }, + end: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + } + }; + } + if (token.type === 9) { + var pattern5 = token.pattern; + var flags = token.flags; + t8.regex = { pattern: pattern5, flags }; + } + return t8; + }; + Parser8.prototype.nextToken = function() { + var token = this.lookahead; + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + this.collectComments(); + if (this.scanner.index !== this.startMarker.index) { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + } + var next = this.scanner.lex(); + this.hasLineTerminator = token.lineNumber !== next.lineNumber; + if (next && this.context.strict && next.type === 3) { + if (this.scanner.isStrictModeReservedWord(next.value)) { + next.type = 4; + } + } + this.lookahead = next; + if (this.config.tokens && next.type !== 2) { + this.tokens.push(this.convertToken(next)); + } + return token; + }; + Parser8.prototype.nextRegexToken = function() { + this.collectComments(); + var token = this.scanner.scanRegExp(); + if (this.config.tokens) { + this.tokens.pop(); + this.tokens.push(this.convertToken(token)); + } + this.lookahead = token; + this.nextToken(); + return token; + }; + Parser8.prototype.createNode = function() { + return { + index: this.startMarker.index, + line: this.startMarker.line, + column: this.startMarker.column + }; + }; + Parser8.prototype.startNode = function(token, lastLineStart) { + if (lastLineStart === void 0) { + lastLineStart = 0; + } + var column = token.start - token.lineStart; + var line = token.lineNumber; + if (column < 0) { + column += lastLineStart; + line--; + } + return { + index: token.start, + line, + column + }; + }; + Parser8.prototype.finalize = function(marker, node) { + if (this.config.range) { + node.range = [marker.index, this.lastMarker.index]; + } + if (this.config.loc) { + node.loc = { + start: { + line: marker.line, + column: marker.column + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column + } + }; + if (this.config.source) { + node.loc.source = this.config.source; + } + } + if (this.delegate) { + var metadata = { + start: { + line: marker.line, + column: marker.column, + offset: marker.index + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column, + offset: this.lastMarker.index + } + }; + this.delegate(node, metadata); + } + return node; + }; + Parser8.prototype.expect = function(value2) { + var token = this.nextToken(); + if (token.type !== 7 || token.value !== value2) { + this.throwUnexpectedToken(token); + } + }; + Parser8.prototype.expectCommaSeparator = function() { + if (this.config.tolerant) { + var token = this.lookahead; + if (token.type === 7 && token.value === ",") { + this.nextToken(); + } else if (token.type === 7 && token.value === ";") { + this.nextToken(); + this.tolerateUnexpectedToken(token); + } else { + this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); + } + } else { + this.expect(","); + } + }; + Parser8.prototype.expectKeyword = function(keyword) { + var token = this.nextToken(); + if (token.type !== 4 || token.value !== keyword) { + this.throwUnexpectedToken(token); + } + }; + Parser8.prototype.match = function(value2) { + return this.lookahead.type === 7 && this.lookahead.value === value2; + }; + Parser8.prototype.matchKeyword = function(keyword) { + return this.lookahead.type === 4 && this.lookahead.value === keyword; + }; + Parser8.prototype.matchContextualKeyword = function(keyword) { + return this.lookahead.type === 3 && this.lookahead.value === keyword; + }; + Parser8.prototype.matchAssign = function() { + if (this.lookahead.type !== 7) { + return false; + } + var op = this.lookahead.value; + return op === "=" || op === "*=" || op === "**=" || op === "/=" || op === "%=" || op === "+=" || op === "-=" || op === "<<=" || op === ">>=" || op === ">>>=" || op === "&=" || op === "^=" || op === "|="; + }; + Parser8.prototype.isolateCoverGrammar = function(parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result2 = parseFunction.call(this); + if (this.context.firstCoverInitializedNameError !== null) { + this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); + } + this.context.isBindingElement = previousIsBindingElement; + this.context.isAssignmentTarget = previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; + return result2; + }; + Parser8.prototype.inheritCoverGrammar = function(parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result2 = parseFunction.call(this); + this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; + this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; + return result2; + }; + Parser8.prototype.consumeSemicolon = function() { + if (this.match(";")) { + this.nextToken(); + } else if (!this.hasLineTerminator) { + if (this.lookahead.type !== 2 && !this.match("}")) { + this.throwUnexpectedToken(this.lookahead); + } + this.lastMarker.index = this.startMarker.index; + this.lastMarker.line = this.startMarker.line; + this.lastMarker.column = this.startMarker.column; + } + }; + Parser8.prototype.parsePrimaryExpression = function() { + var node = this.createNode(); + var expr; + var token, raw; + switch (this.lookahead.type) { + case 3: + if ((this.context.isModule || this.context.await) && this.lookahead.value === "await") { + this.tolerateUnexpectedToken(this.lookahead); + } + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + break; + case 6: + case 8: + if (this.context.strict && this.lookahead.octal) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 1: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value === "true", raw)); + break; + case 5: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(null, raw)); + break; + case 10: + expr = this.parseTemplateLiteral(); + break; + case 7: + switch (this.lookahead.value) { + case "(": + this.context.isBindingElement = false; + expr = this.inheritCoverGrammar(this.parseGroupExpression); + break; + case "[": + expr = this.inheritCoverGrammar(this.parseArrayInitializer); + break; + case "{": + expr = this.inheritCoverGrammar(this.parseObjectInitializer); + break; + case "/": + case "/=": + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.scanner.index = this.startMarker.index; + token = this.nextRegexToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + break; + case 4: + if (!this.context.strict && this.context.allowYield && this.matchKeyword("yield")) { + expr = this.parseIdentifierName(); + } else if (!this.context.strict && this.matchKeyword("let")) { + expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + } else { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + if (this.matchKeyword("function")) { + expr = this.parseFunctionExpression(); + } else if (this.matchKeyword("this")) { + this.nextToken(); + expr = this.finalize(node, new Node.ThisExpression()); + } else if (this.matchKeyword("class")) { + expr = this.parseClassExpression(); + } else { + expr = this.throwUnexpectedToken(this.nextToken()); + } + } + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + return expr; + }; + Parser8.prototype.parseSpreadElement = function() { + var node = this.createNode(); + this.expect("..."); + var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); + return this.finalize(node, new Node.SpreadElement(arg)); + }; + Parser8.prototype.parseArrayInitializer = function() { + var node = this.createNode(); + var elements = []; + this.expect("["); + while (!this.match("]")) { + if (this.match(",")) { + this.nextToken(); + elements.push(null); + } else if (this.match("...")) { + var element = this.parseSpreadElement(); + if (!this.match("]")) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.expect(","); + } + elements.push(element); + } else { + elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + if (!this.match("]")) { + this.expect(","); + } + } + } + this.expect("]"); + return this.finalize(node, new Node.ArrayExpression(elements)); + }; + Parser8.prototype.parsePropertyMethod = function(params) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = params.simple; + var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); + if (this.context.strict && params.firstRestricted) { + this.tolerateUnexpectedToken(params.firstRestricted, params.message); + } + if (this.context.strict && params.stricted) { + this.tolerateUnexpectedToken(params.stricted, params.message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + return body; + }; + Parser8.prototype.parsePropertyMethodFunction = function() { + var isGenerator = false; + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + var method2 = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method2, isGenerator)); + }; + Parser8.prototype.parsePropertyMethodAsyncFunction = function() { + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = false; + this.context.await = true; + var params = this.parseFormalParameters(); + var method2 = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method2)); + }; + Parser8.prototype.parseObjectPropertyKey = function() { + var node = this.createNode(); + var token = this.nextToken(); + var key; + switch (token.type) { + case 8: + case 6: + if (this.context.strict && token.octal) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); + } + var raw = this.getTokenRaw(token); + key = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 3: + case 1: + case 5: + case 4: + key = this.finalize(node, new Node.Identifier(token.value)); + break; + case 7: + if (token.value === "[") { + key = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.expect("]"); + } else { + key = this.throwUnexpectedToken(token); + } + break; + default: + key = this.throwUnexpectedToken(token); + } + return key; + }; + Parser8.prototype.isPropertyKey = function(key, value2) { + return key.type === syntax_1.Syntax.Identifier && key.name === value2 || key.type === syntax_1.Syntax.Literal && key.value === value2; + }; + Parser8.prototype.parseObjectProperty = function(hasProto) { + var node = this.createNode(); + var token = this.lookahead; + var kind; + var key = null; + var value2 = null; + var computed = false; + var method2 = false; + var shorthand = false; + var isAsync2 = false; + if (token.type === 3) { + var id = token.value; + this.nextToken(); + computed = this.match("["); + isAsync2 = !this.hasLineTerminator && id === "async" && !this.match(":") && !this.match("(") && !this.match("*") && !this.match(","); + key = isAsync2 ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + } else if (this.match("*")) { + this.nextToken(); + } else { + computed = this.match("["); + key = this.parseObjectPropertyKey(); + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 && !isAsync2 && token.value === "get" && lookaheadPropertyKey) { + kind = "get"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value2 = this.parseGetterMethod(); + } else if (token.type === 3 && !isAsync2 && token.value === "set" && lookaheadPropertyKey) { + kind = "set"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + value2 = this.parseSetterMethod(); + } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) { + kind = "init"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + value2 = this.parseGeneratorMethod(); + method2 = true; + } else { + if (!key) { + this.throwUnexpectedToken(this.lookahead); + } + kind = "init"; + if (this.match(":") && !isAsync2) { + if (!computed && this.isPropertyKey(key, "__proto__")) { + if (hasProto.value) { + this.tolerateError(messages_1.Messages.DuplicateProtoProperty); + } + hasProto.value = true; + } + this.nextToken(); + value2 = this.inheritCoverGrammar(this.parseAssignmentExpression); + } else if (this.match("(")) { + value2 = isAsync2 ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method2 = true; + } else if (token.type === 3) { + var id = this.finalize(node, new Node.Identifier(token.value)); + if (this.match("=")) { + this.context.firstCoverInitializedNameError = this.lookahead; + this.nextToken(); + shorthand = true; + var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression); + value2 = this.finalize(node, new Node.AssignmentPattern(id, init2)); + } else { + shorthand = true; + value2 = id; + } + } else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.Property(kind, key, computed, value2, method2, shorthand)); + }; + Parser8.prototype.parseObjectInitializer = function() { + var node = this.createNode(); + this.expect("{"); + var properties = []; + var hasProto = { value: false }; + while (!this.match("}")) { + properties.push(this.parseObjectProperty(hasProto)); + if (!this.match("}")) { + this.expectCommaSeparator(); + } + } + this.expect("}"); + return this.finalize(node, new Node.ObjectExpression(properties)); + }; + Parser8.prototype.parseTemplateHead = function() { + assert_1.assert(this.lookahead.head, "Template literal must start with a template head"); + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + }; + Parser8.prototype.parseTemplateElement = function() { + if (this.lookahead.type !== 10) { + this.throwUnexpectedToken(); + } + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw, cooked }, token.tail)); + }; + Parser8.prototype.parseTemplateLiteral = function() { + var node = this.createNode(); + var expressions = []; + var quasis = []; + var quasi = this.parseTemplateHead(); + quasis.push(quasi); + while (!quasi.tail) { + expressions.push(this.parseExpression()); + quasi = this.parseTemplateElement(); + quasis.push(quasi); + } + return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + }; + Parser8.prototype.reinterpretExpressionAsPattern = function(expr) { + switch (expr.type) { + case syntax_1.Syntax.Identifier: + case syntax_1.Syntax.MemberExpression: + case syntax_1.Syntax.RestElement: + case syntax_1.Syntax.AssignmentPattern: + break; + case syntax_1.Syntax.SpreadElement: + expr.type = syntax_1.Syntax.RestElement; + this.reinterpretExpressionAsPattern(expr.argument); + break; + case syntax_1.Syntax.ArrayExpression: + expr.type = syntax_1.Syntax.ArrayPattern; + for (var i7 = 0; i7 < expr.elements.length; i7++) { + if (expr.elements[i7] !== null) { + this.reinterpretExpressionAsPattern(expr.elements[i7]); + } + } + break; + case syntax_1.Syntax.ObjectExpression: + expr.type = syntax_1.Syntax.ObjectPattern; + for (var i7 = 0; i7 < expr.properties.length; i7++) { + this.reinterpretExpressionAsPattern(expr.properties[i7].value); + } + break; + case syntax_1.Syntax.AssignmentExpression: + expr.type = syntax_1.Syntax.AssignmentPattern; + delete expr.operator; + this.reinterpretExpressionAsPattern(expr.left); + break; + default: + break; + } + }; + Parser8.prototype.parseGroupExpression = function() { + var expr; + this.expect("("); + if (this.match(")")) { + this.nextToken(); + if (!this.match("=>")) { + this.expect("=>"); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [], + async: false + }; + } else { + var startToken = this.lookahead; + var params = []; + if (this.match("...")) { + expr = this.parseRestElement(params); + this.expect(")"); + if (!this.match("=>")) { + this.expect("=>"); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } else { + var arrow = false; + this.context.isBindingElement = true; + expr = this.inheritCoverGrammar(this.parseAssignmentExpression); + if (this.match(",")) { + var expressions = []; + this.context.isAssignmentTarget = false; + expressions.push(expr); + while (this.lookahead.type !== 2) { + if (!this.match(",")) { + break; + } + this.nextToken(); + if (this.match(")")) { + this.nextToken(); + for (var i7 = 0; i7 < expressions.length; i7++) { + this.reinterpretExpressionAsPattern(expressions[i7]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } else if (this.match("...")) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + expressions.push(this.parseRestElement(params)); + this.expect(")"); + if (!this.match("=>")) { + this.expect("=>"); + } + this.context.isBindingElement = false; + for (var i7 = 0; i7 < expressions.length; i7++) { + this.reinterpretExpressionAsPattern(expressions[i7]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } else { + expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + } + if (arrow) { + break; + } + } + if (!arrow) { + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + } + if (!arrow) { + this.expect(")"); + if (this.match("=>")) { + if (expr.type === syntax_1.Syntax.Identifier && expr.name === "yield") { + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + if (!arrow) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + if (expr.type === syntax_1.Syntax.SequenceExpression) { + for (var i7 = 0; i7 < expr.expressions.length; i7++) { + this.reinterpretExpressionAsPattern(expr.expressions[i7]); + } + } else { + this.reinterpretExpressionAsPattern(expr); + } + var parameters = expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]; + expr = { + type: ArrowParameterPlaceHolder, + params: parameters, + async: false + }; + } + } + this.context.isBindingElement = false; + } + } + } + return expr; + }; + Parser8.prototype.parseArguments = function() { + this.expect("("); + var args = []; + if (!this.match(")")) { + while (true) { + var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression); + args.push(expr); + if (this.match(")")) { + break; + } + this.expectCommaSeparator(); + if (this.match(")")) { + break; + } + } + } + this.expect(")"); + return args; + }; + Parser8.prototype.isIdentifierName = function(token) { + return token.type === 3 || token.type === 4 || token.type === 1 || token.type === 5; + }; + Parser8.prototype.parseIdentifierName = function() { + var node = this.createNode(); + var token = this.nextToken(); + if (!this.isIdentifierName(token)) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser8.prototype.parseNewExpression = function() { + var node = this.createNode(); + var id = this.parseIdentifierName(); + assert_1.assert(id.name === "new", "New expression must start with `new`"); + var expr; + if (this.match(".")) { + this.nextToken(); + if (this.lookahead.type === 3 && this.context.inFunctionBody && this.lookahead.value === "target") { + var property2 = this.parseIdentifierName(); + expr = new Node.MetaProperty(id, property2); + } else { + this.throwUnexpectedToken(this.lookahead); + } + } else { + var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); + var args = this.match("(") ? this.parseArguments() : []; + expr = new Node.NewExpression(callee, args); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return this.finalize(node, expr); + }; + Parser8.prototype.parseAsyncArgument = function() { + var arg = this.parseAssignmentExpression(); + this.context.firstCoverInitializedNameError = null; + return arg; + }; + Parser8.prototype.parseAsyncArguments = function() { + this.expect("("); + var args = []; + if (!this.match(")")) { + while (true) { + var expr = this.match("...") ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument); + args.push(expr); + if (this.match(")")) { + break; + } + this.expectCommaSeparator(); + if (this.match(")")) { + break; + } + } + } + this.expect(")"); + return args; + }; + Parser8.prototype.parseLeftHandSideExpressionAllowCall = function() { + var startToken = this.lookahead; + var maybeAsync = this.matchContextualKeyword("async"); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var expr; + if (this.matchKeyword("super") && this.context.inFunctionBody) { + expr = this.createNode(); + this.nextToken(); + expr = this.finalize(expr, new Node.Super()); + if (!this.match("(") && !this.match(".") && !this.match("[")) { + this.throwUnexpectedToken(this.lookahead); + } + } else { + expr = this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression); + } + while (true) { + if (this.match(".")) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect("."); + var property2 = this.parseIdentifierName(); + expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property2)); + } else if (this.match("(")) { + var asyncArrow = maybeAsync && startToken.lineNumber === this.lookahead.lineNumber; + this.context.isBindingElement = false; + this.context.isAssignmentTarget = false; + var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); + expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + if (asyncArrow && this.match("=>")) { + for (var i7 = 0; i7 < args.length; ++i7) { + this.reinterpretExpressionAsPattern(args[i7]); + } + expr = { + type: ArrowParameterPlaceHolder, + params: args, + async: true + }; + } + } else if (this.match("[")) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect("["); + var property2 = this.isolateCoverGrammar(this.parseExpression); + this.expect("]"); + expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property2)); + } else if (this.lookahead.type === 10 && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + } else { + break; + } + } + this.context.allowIn = previousAllowIn; + return expr; + }; + Parser8.prototype.parseSuper = function() { + var node = this.createNode(); + this.expectKeyword("super"); + if (!this.match("[") && !this.match(".")) { + this.throwUnexpectedToken(this.lookahead); + } + return this.finalize(node, new Node.Super()); + }; + Parser8.prototype.parseLeftHandSideExpression = function() { + assert_1.assert(this.context.allowIn, "callee of new expression always allow in keyword."); + var node = this.startNode(this.lookahead); + var expr = this.matchKeyword("super") && this.context.inFunctionBody ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword("new") ? this.parseNewExpression : this.parsePrimaryExpression); + while (true) { + if (this.match("[")) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect("["); + var property2 = this.isolateCoverGrammar(this.parseExpression); + this.expect("]"); + expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property2)); + } else if (this.match(".")) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect("."); + var property2 = this.parseIdentifierName(); + expr = this.finalize(node, new Node.StaticMemberExpression(expr, property2)); + } else if (this.lookahead.type === 10 && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + } else { + break; + } + } + return expr; + }; + Parser8.prototype.parseUpdateExpression = function() { + var expr; + var startToken = this.lookahead; + if (this.match("++") || this.match("--")) { + var node = this.startNode(startToken); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPrefix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + var prefix = true; + expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } else { + expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + if (!this.hasLineTerminator && this.lookahead.type === 7) { + if (this.match("++") || this.match("--")) { + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPostfix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var operator = this.nextToken().value; + var prefix = false; + expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + } + } + } + return expr; + }; + Parser8.prototype.parseAwaitExpression = function() { + var node = this.createNode(); + this.nextToken(); + var argument = this.parseUnaryExpression(); + return this.finalize(node, new Node.AwaitExpression(argument)); + }; + Parser8.prototype.parseUnaryExpression = function() { + var expr; + if (this.match("+") || this.match("-") || this.match("~") || this.match("!") || this.matchKeyword("delete") || this.matchKeyword("void") || this.matchKeyword("typeof")) { + var node = this.startNode(this.lookahead); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + if (this.context.strict && expr.operator === "delete" && expr.argument.type === syntax_1.Syntax.Identifier) { + this.tolerateError(messages_1.Messages.StrictDelete); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } else if (this.context.await && this.matchContextualKeyword("await")) { + expr = this.parseAwaitExpression(); + } else { + expr = this.parseUpdateExpression(); + } + return expr; + }; + Parser8.prototype.parseExponentiationExpression = function() { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match("**")) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression("**", left, right)); + } + return expr; + }; + Parser8.prototype.binaryPrecedence = function(token) { + var op = token.value; + var precedence; + if (token.type === 7) { + precedence = this.operatorPrecedence[op] || 0; + } else if (token.type === 4) { + precedence = op === "instanceof" || this.context.allowIn && op === "in" ? 7 : 0; + } else { + precedence = 0; + } + return precedence; + }; + Parser8.prototype.parseBinaryExpression = function() { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); + var token = this.lookahead; + var prec = this.binaryPrecedence(token); + if (prec > 0) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var markers = [startToken, this.lookahead]; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + var stack = [left, token.value, right]; + var precedences = [prec]; + while (true) { + prec = this.binaryPrecedence(this.lookahead); + if (prec <= 0) { + break; + } + while (stack.length > 2 && prec <= precedences[precedences.length - 1]) { + right = stack.pop(); + var operator = stack.pop(); + precedences.pop(); + left = stack.pop(); + markers.pop(); + var node = this.startNode(markers[markers.length - 1]); + stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + } + stack.push(this.nextToken().value); + precedences.push(prec); + markers.push(this.lookahead); + stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); + } + var i7 = stack.length - 1; + expr = stack[i7]; + var lastMarker = markers.pop(); + while (i7 > 1) { + var marker = markers.pop(); + var lastLineStart = lastMarker && lastMarker.lineStart; + var node = this.startNode(marker, lastLineStart); + var operator = stack[i7 - 1]; + expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i7 - 2], expr)); + i7 -= 2; + lastMarker = marker; + } + } + return expr; + }; + Parser8.prototype.parseConditionalExpression = function() { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseBinaryExpression); + if (this.match("?")) { + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + this.expect(":"); + var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return expr; + }; + Parser8.prototype.checkPatternParam = function(options, param) { + switch (param.type) { + case syntax_1.Syntax.Identifier: + this.validateParam(options, param, param.name); + break; + case syntax_1.Syntax.RestElement: + this.checkPatternParam(options, param.argument); + break; + case syntax_1.Syntax.AssignmentPattern: + this.checkPatternParam(options, param.left); + break; + case syntax_1.Syntax.ArrayPattern: + for (var i7 = 0; i7 < param.elements.length; i7++) { + if (param.elements[i7] !== null) { + this.checkPatternParam(options, param.elements[i7]); + } + } + break; + case syntax_1.Syntax.ObjectPattern: + for (var i7 = 0; i7 < param.properties.length; i7++) { + this.checkPatternParam(options, param.properties[i7].value); + } + break; + default: + break; + } + options.simple = options.simple && param instanceof Node.Identifier; + }; + Parser8.prototype.reinterpretAsCoverFormalsList = function(expr) { + var params = [expr]; + var options; + var asyncArrow = false; + switch (expr.type) { + case syntax_1.Syntax.Identifier: + break; + case ArrowParameterPlaceHolder: + params = expr.params; + asyncArrow = expr.async; + break; + default: + return null; + } + options = { + simple: true, + paramSet: {} + }; + for (var i7 = 0; i7 < params.length; ++i7) { + var param = params[i7]; + if (param.type === syntax_1.Syntax.AssignmentPattern) { + if (param.right.type === syntax_1.Syntax.YieldExpression) { + if (param.right.argument) { + this.throwUnexpectedToken(this.lookahead); + } + param.right.type = syntax_1.Syntax.Identifier; + param.right.name = "yield"; + delete param.right.argument; + delete param.right.delegate; + } + } else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === "await") { + this.throwUnexpectedToken(this.lookahead); + } + this.checkPatternParam(options, param); + params[i7] = param; + } + if (this.context.strict || !this.context.allowYield) { + for (var i7 = 0; i7 < params.length; ++i7) { + var param = params[i7]; + if (param.type === syntax_1.Syntax.YieldExpression) { + this.throwUnexpectedToken(this.lookahead); + } + } + } + if (options.message === messages_1.Messages.StrictParamDupe) { + var token = this.context.strict ? options.stricted : options.firstRestricted; + this.throwUnexpectedToken(token, options.message); + } + return { + simple: options.simple, + params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser8.prototype.parseAssignmentExpression = function() { + var expr; + if (!this.context.allowYield && this.matchKeyword("yield")) { + expr = this.parseYieldExpression(); + } else { + var startToken = this.lookahead; + var token = startToken; + expr = this.parseConditionalExpression(); + if (token.type === 3 && token.lineNumber === this.lookahead.lineNumber && token.value === "async") { + if (this.lookahead.type === 3 || this.matchKeyword("yield")) { + var arg = this.parsePrimaryExpression(); + this.reinterpretExpressionAsPattern(arg); + expr = { + type: ArrowParameterPlaceHolder, + params: [arg], + async: true + }; + } + } + if (expr.type === ArrowParameterPlaceHolder || this.match("=>")) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var isAsync2 = expr.async; + var list = this.reinterpretAsCoverFormalsList(expr); + if (list) { + if (this.hasLineTerminator) { + this.tolerateUnexpectedToken(this.lookahead); + } + this.context.firstCoverInitializedNameError = null; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = list.simple; + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = true; + this.context.await = isAsync2; + var node = this.startNode(startToken); + this.expect("=>"); + var body = void 0; + if (this.match("{")) { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + body = this.parseFunctionSourceElements(); + this.context.allowIn = previousAllowIn; + } else { + body = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + var expression = body.type !== syntax_1.Syntax.BlockStatement; + if (this.context.strict && list.firstRestricted) { + this.throwUnexpectedToken(list.firstRestricted, list.message); + } + if (this.context.strict && list.stricted) { + this.tolerateUnexpectedToken(list.stricted, list.message); + } + expr = isAsync2 ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + } + } else { + if (this.matchAssign()) { + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { + var id = expr; + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); + } + if (this.scanner.isStrictModeReservedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + } + if (!this.match("=")) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } else { + this.reinterpretExpressionAsPattern(expr); + } + token = this.nextToken(); + var operator = token.value; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + this.context.firstCoverInitializedNameError = null; + } + } + } + return expr; + }; + Parser8.prototype.parseExpression = function() { + var startToken = this.lookahead; + var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); + if (this.match(",")) { + var expressions = []; + expressions.push(expr); + while (this.lookahead.type !== 2) { + if (!this.match(",")) { + break; + } + this.nextToken(); + expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + return expr; + }; + Parser8.prototype.parseStatementListItem = function() { + var statement; + this.context.isAssignmentTarget = true; + this.context.isBindingElement = true; + if (this.lookahead.type === 4) { + switch (this.lookahead.value) { + case "export": + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); + } + statement = this.parseExportDeclaration(); + break; + case "import": + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); + } + statement = this.parseImportDeclaration(); + break; + case "const": + statement = this.parseLexicalDeclaration({ inFor: false }); + break; + case "function": + statement = this.parseFunctionDeclaration(); + break; + case "class": + statement = this.parseClassDeclaration(); + break; + case "let": + statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); + break; + default: + statement = this.parseStatement(); + break; + } + } else { + statement = this.parseStatement(); + } + return statement; + }; + Parser8.prototype.parseBlock = function() { + var node = this.createNode(); + this.expect("{"); + var block = []; + while (true) { + if (this.match("}")) { + break; + } + block.push(this.parseStatementListItem()); + } + this.expect("}"); + return this.finalize(node, new Node.BlockStatement(block)); + }; + Parser8.prototype.parseLexicalBinding = function(kind, options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, kind); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init2 = null; + if (kind === "const") { + if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) { + if (this.match("=")) { + this.nextToken(); + init2 = this.isolateCoverGrammar(this.parseAssignmentExpression); + } else { + this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const"); + } + } + } else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) { + this.expect("="); + init2 = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + return this.finalize(node, new Node.VariableDeclarator(id, init2)); + }; + Parser8.prototype.parseBindingList = function(kind, options) { + var list = [this.parseLexicalBinding(kind, options)]; + while (this.match(",")) { + this.nextToken(); + list.push(this.parseLexicalBinding(kind, options)); + } + return list; + }; + Parser8.prototype.isLexicalDeclaration = function() { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + return next.type === 3 || next.type === 7 && next.value === "[" || next.type === 7 && next.value === "{" || next.type === 4 && next.value === "let" || next.type === 4 && next.value === "yield"; + }; + Parser8.prototype.parseLexicalDeclaration = function(options) { + var node = this.createNode(); + var kind = this.nextToken().value; + assert_1.assert(kind === "let" || kind === "const", "Lexical declaration must be either let or const"); + var declarations = this.parseBindingList(kind, options); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + }; + Parser8.prototype.parseBindingRestElement = function(params, kind) { + var node = this.createNode(); + this.expect("..."); + var arg = this.parsePattern(params, kind); + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser8.prototype.parseArrayPattern = function(params, kind) { + var node = this.createNode(); + this.expect("["); + var elements = []; + while (!this.match("]")) { + if (this.match(",")) { + this.nextToken(); + elements.push(null); + } else { + if (this.match("...")) { + elements.push(this.parseBindingRestElement(params, kind)); + break; + } else { + elements.push(this.parsePatternWithDefault(params, kind)); + } + if (!this.match("]")) { + this.expect(","); + } + } + } + this.expect("]"); + return this.finalize(node, new Node.ArrayPattern(elements)); + }; + Parser8.prototype.parsePropertyPattern = function(params, kind) { + var node = this.createNode(); + var computed = false; + var shorthand = false; + var method2 = false; + var key; + var value2; + if (this.lookahead.type === 3) { + var keyToken = this.lookahead; + key = this.parseVariableIdentifier(); + var init2 = this.finalize(node, new Node.Identifier(keyToken.value)); + if (this.match("=")) { + params.push(keyToken); + shorthand = true; + this.nextToken(); + var expr = this.parseAssignmentExpression(); + value2 = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr)); + } else if (!this.match(":")) { + params.push(keyToken); + shorthand = true; + value2 = init2; + } else { + this.expect(":"); + value2 = this.parsePatternWithDefault(params, kind); + } + } else { + computed = this.match("["); + key = this.parseObjectPropertyKey(); + this.expect(":"); + value2 = this.parsePatternWithDefault(params, kind); + } + return this.finalize(node, new Node.Property("init", key, computed, value2, method2, shorthand)); + }; + Parser8.prototype.parseObjectPattern = function(params, kind) { + var node = this.createNode(); + var properties = []; + this.expect("{"); + while (!this.match("}")) { + properties.push(this.parsePropertyPattern(params, kind)); + if (!this.match("}")) { + this.expect(","); + } + } + this.expect("}"); + return this.finalize(node, new Node.ObjectPattern(properties)); + }; + Parser8.prototype.parsePattern = function(params, kind) { + var pattern5; + if (this.match("[")) { + pattern5 = this.parseArrayPattern(params, kind); + } else if (this.match("{")) { + pattern5 = this.parseObjectPattern(params, kind); + } else { + if (this.matchKeyword("let") && (kind === "const" || kind === "let")) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); + } + params.push(this.lookahead); + pattern5 = this.parseVariableIdentifier(kind); + } + return pattern5; + }; + Parser8.prototype.parsePatternWithDefault = function(params, kind) { + var startToken = this.lookahead; + var pattern5 = this.parsePattern(params, kind); + if (this.match("=")) { + this.nextToken(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowYield = previousAllowYield; + pattern5 = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern5, right)); + } + return pattern5; + }; + Parser8.prototype.parseVariableIdentifier = function(kind) { + var node = this.createNode(); + var token = this.nextToken(); + if (token.type === 4 && token.value === "yield") { + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } else if (!this.context.allowYield) { + this.throwUnexpectedToken(token); + } + } else if (token.type !== 3) { + if (this.context.strict && token.type === 4 && this.scanner.isStrictModeReservedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } else { + if (this.context.strict || token.value !== "let" || kind !== "var") { + this.throwUnexpectedToken(token); + } + } + } else if ((this.context.isModule || this.context.await) && token.type === 3 && token.value === "await") { + this.tolerateUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser8.prototype.parseVariableDeclaration = function(options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, "var"); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init2 = null; + if (this.match("=")) { + this.nextToken(); + init2 = this.isolateCoverGrammar(this.parseAssignmentExpression); + } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { + this.expect("="); + } + return this.finalize(node, new Node.VariableDeclarator(id, init2)); + }; + Parser8.prototype.parseVariableDeclarationList = function(options) { + var opt = { inFor: options.inFor }; + var list = []; + list.push(this.parseVariableDeclaration(opt)); + while (this.match(",")) { + this.nextToken(); + list.push(this.parseVariableDeclaration(opt)); + } + return list; + }; + Parser8.prototype.parseVariableStatement = function() { + var node = this.createNode(); + this.expectKeyword("var"); + var declarations = this.parseVariableDeclarationList({ inFor: false }); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, "var")); + }; + Parser8.prototype.parseEmptyStatement = function() { + var node = this.createNode(); + this.expect(";"); + return this.finalize(node, new Node.EmptyStatement()); + }; + Parser8.prototype.parseExpressionStatement = function() { + var node = this.createNode(); + var expr = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ExpressionStatement(expr)); + }; + Parser8.prototype.parseIfClause = function() { + if (this.context.strict && this.matchKeyword("function")) { + this.tolerateError(messages_1.Messages.StrictFunction); + } + return this.parseStatement(); + }; + Parser8.prototype.parseIfStatement = function() { + var node = this.createNode(); + var consequent; + var alternate = null; + this.expectKeyword("if"); + this.expect("("); + var test = this.parseExpression(); + if (!this.match(")") && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + } else { + this.expect(")"); + consequent = this.parseIfClause(); + if (this.matchKeyword("else")) { + this.nextToken(); + alternate = this.parseIfClause(); + } + } + return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + }; + Parser8.prototype.parseDoWhileStatement = function() { + var node = this.createNode(); + this.expectKeyword("do"); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + var body = this.parseStatement(); + this.context.inIteration = previousInIteration; + this.expectKeyword("while"); + this.expect("("); + var test = this.parseExpression(); + if (!this.match(")") && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + } else { + this.expect(")"); + if (this.match(";")) { + this.nextToken(); + } + } + return this.finalize(node, new Node.DoWhileStatement(body, test)); + }; + Parser8.prototype.parseWhileStatement = function() { + var node = this.createNode(); + var body; + this.expectKeyword("while"); + this.expect("("); + var test = this.parseExpression(); + if (!this.match(")") && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } else { + this.expect(")"); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.parseStatement(); + this.context.inIteration = previousInIteration; + } + return this.finalize(node, new Node.WhileStatement(test, body)); + }; + Parser8.prototype.parseForStatement = function() { + var init2 = null; + var test = null; + var update2 = null; + var forIn2 = true; + var left, right; + var node = this.createNode(); + this.expectKeyword("for"); + this.expect("("); + if (this.match(";")) { + this.nextToken(); + } else { + if (this.matchKeyword("var")) { + init2 = this.createNode(); + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseVariableDeclarationList({ inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && this.matchKeyword("in")) { + var decl = declarations[0]; + if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { + this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in"); + } + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var")); + this.nextToken(); + left = init2; + right = this.parseExpression(); + init2 = null; + } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var")); + this.nextToken(); + left = init2; + right = this.parseAssignmentExpression(); + init2 = null; + forIn2 = false; + } else { + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var")); + this.expect(";"); + } + } else if (this.matchKeyword("const") || this.matchKeyword("let")) { + init2 = this.createNode(); + var kind = this.nextToken().value; + if (!this.context.strict && this.lookahead.value === "in") { + init2 = this.finalize(init2, new Node.Identifier(kind)); + this.nextToken(); + left = init2; + right = this.parseExpression(); + init2 = null; + } else { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseBindingList(kind, { inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) { + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init2; + right = this.parseExpression(); + init2 = null; + } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) { + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init2; + right = this.parseAssignmentExpression(); + init2 = null; + forIn2 = false; + } else { + this.consumeSemicolon(); + init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind)); + } + } + } else { + var initStartToken = this.lookahead; + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + init2 = this.inheritCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + if (this.matchKeyword("in")) { + if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForIn); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init2); + left = init2; + right = this.parseExpression(); + init2 = null; + } else if (this.matchContextualKeyword("of")) { + if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init2); + left = init2; + right = this.parseAssignmentExpression(); + init2 = null; + forIn2 = false; + } else { + if (this.match(",")) { + var initSeq = [init2]; + while (this.match(",")) { + this.nextToken(); + initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + } + this.expect(";"); + } + } + } + if (typeof left === "undefined") { + if (!this.match(";")) { + test = this.parseExpression(); + } + this.expect(";"); + if (!this.match(")")) { + update2 = this.parseExpression(); + } + } + var body; + if (!this.match(")") && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } else { + this.expect(")"); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.isolateCoverGrammar(this.parseStatement); + this.context.inIteration = previousInIteration; + } + return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update2, body)) : forIn2 ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body)); + }; + Parser8.prototype.parseContinueStatement = function() { + var node = this.createNode(); + this.expectKeyword("continue"); + var label = null; + if (this.lookahead.type === 3 && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + label = id; + var key = "$" + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration) { + this.throwError(messages_1.Messages.IllegalContinue); + } + return this.finalize(node, new Node.ContinueStatement(label)); + }; + Parser8.prototype.parseBreakStatement = function() { + var node = this.createNode(); + this.expectKeyword("break"); + var label = null; + if (this.lookahead.type === 3 && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + var key = "$" + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + label = id; + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration && !this.context.inSwitch) { + this.throwError(messages_1.Messages.IllegalBreak); + } + return this.finalize(node, new Node.BreakStatement(label)); + }; + Parser8.prototype.parseReturnStatement = function() { + if (!this.context.inFunctionBody) { + this.tolerateError(messages_1.Messages.IllegalReturn); + } + var node = this.createNode(); + this.expectKeyword("return"); + var hasArgument = !this.match(";") && !this.match("}") && !this.hasLineTerminator && this.lookahead.type !== 2 || this.lookahead.type === 8 || this.lookahead.type === 10; + var argument = hasArgument ? this.parseExpression() : null; + this.consumeSemicolon(); + return this.finalize(node, new Node.ReturnStatement(argument)); + }; + Parser8.prototype.parseWithStatement = function() { + if (this.context.strict) { + this.tolerateError(messages_1.Messages.StrictModeWith); + } + var node = this.createNode(); + var body; + this.expectKeyword("with"); + this.expect("("); + var object = this.parseExpression(); + if (!this.match(")") && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } else { + this.expect(")"); + body = this.parseStatement(); + } + return this.finalize(node, new Node.WithStatement(object, body)); + }; + Parser8.prototype.parseSwitchCase = function() { + var node = this.createNode(); + var test; + if (this.matchKeyword("default")) { + this.nextToken(); + test = null; + } else { + this.expectKeyword("case"); + test = this.parseExpression(); + } + this.expect(":"); + var consequent = []; + while (true) { + if (this.match("}") || this.matchKeyword("default") || this.matchKeyword("case")) { + break; + } + consequent.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.SwitchCase(test, consequent)); + }; + Parser8.prototype.parseSwitchStatement = function() { + var node = this.createNode(); + this.expectKeyword("switch"); + this.expect("("); + var discriminant = this.parseExpression(); + this.expect(")"); + var previousInSwitch = this.context.inSwitch; + this.context.inSwitch = true; + var cases = []; + var defaultFound = false; + this.expect("{"); + while (true) { + if (this.match("}")) { + break; + } + var clause = this.parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + this.expect("}"); + this.context.inSwitch = previousInSwitch; + return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + }; + Parser8.prototype.parseLabelledStatement = function() { + var node = this.createNode(); + var expr = this.parseExpression(); + var statement; + if (expr.type === syntax_1.Syntax.Identifier && this.match(":")) { + this.nextToken(); + var id = expr; + var key = "$" + id.name; + if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.Redeclaration, "Label", id.name); + } + this.context.labelSet[key] = true; + var body = void 0; + if (this.matchKeyword("class")) { + this.tolerateUnexpectedToken(this.lookahead); + body = this.parseClassDeclaration(); + } else if (this.matchKeyword("function")) { + var token = this.lookahead; + var declaration = this.parseFunctionDeclaration(); + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); + } else if (declaration.generator) { + this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); + } + body = declaration; + } else { + body = this.parseStatement(); + } + delete this.context.labelSet[key]; + statement = new Node.LabeledStatement(id, body); + } else { + this.consumeSemicolon(); + statement = new Node.ExpressionStatement(expr); + } + return this.finalize(node, statement); + }; + Parser8.prototype.parseThrowStatement = function() { + var node = this.createNode(); + this.expectKeyword("throw"); + if (this.hasLineTerminator) { + this.throwError(messages_1.Messages.NewlineAfterThrow); + } + var argument = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ThrowStatement(argument)); + }; + Parser8.prototype.parseCatchClause = function() { + var node = this.createNode(); + this.expectKeyword("catch"); + this.expect("("); + if (this.match(")")) { + this.throwUnexpectedToken(this.lookahead); + } + var params = []; + var param = this.parsePattern(params); + var paramMap = {}; + for (var i7 = 0; i7 < params.length; i7++) { + var key = "$" + params[i7].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + this.tolerateError(messages_1.Messages.DuplicateBinding, params[i7].value); + } + paramMap[key] = true; + } + if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(param.name)) { + this.tolerateError(messages_1.Messages.StrictCatchVariable); + } + } + this.expect(")"); + var body = this.parseBlock(); + return this.finalize(node, new Node.CatchClause(param, body)); + }; + Parser8.prototype.parseFinallyClause = function() { + this.expectKeyword("finally"); + return this.parseBlock(); + }; + Parser8.prototype.parseTryStatement = function() { + var node = this.createNode(); + this.expectKeyword("try"); + var block = this.parseBlock(); + var handler = this.matchKeyword("catch") ? this.parseCatchClause() : null; + var finalizer = this.matchKeyword("finally") ? this.parseFinallyClause() : null; + if (!handler && !finalizer) { + this.throwError(messages_1.Messages.NoCatchOrFinally); + } + return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + }; + Parser8.prototype.parseDebuggerStatement = function() { + var node = this.createNode(); + this.expectKeyword("debugger"); + this.consumeSemicolon(); + return this.finalize(node, new Node.DebuggerStatement()); + }; + Parser8.prototype.parseStatement = function() { + var statement; + switch (this.lookahead.type) { + case 1: + case 5: + case 6: + case 8: + case 10: + case 9: + statement = this.parseExpressionStatement(); + break; + case 7: + var value2 = this.lookahead.value; + if (value2 === "{") { + statement = this.parseBlock(); + } else if (value2 === "(") { + statement = this.parseExpressionStatement(); + } else if (value2 === ";") { + statement = this.parseEmptyStatement(); + } else { + statement = this.parseExpressionStatement(); + } + break; + case 3: + statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); + break; + case 4: + switch (this.lookahead.value) { + case "break": + statement = this.parseBreakStatement(); + break; + case "continue": + statement = this.parseContinueStatement(); + break; + case "debugger": + statement = this.parseDebuggerStatement(); + break; + case "do": + statement = this.parseDoWhileStatement(); + break; + case "for": + statement = this.parseForStatement(); + break; + case "function": + statement = this.parseFunctionDeclaration(); + break; + case "if": + statement = this.parseIfStatement(); + break; + case "return": + statement = this.parseReturnStatement(); + break; + case "switch": + statement = this.parseSwitchStatement(); + break; + case "throw": + statement = this.parseThrowStatement(); + break; + case "try": + statement = this.parseTryStatement(); + break; + case "var": + statement = this.parseVariableStatement(); + break; + case "while": + statement = this.parseWhileStatement(); + break; + case "with": + statement = this.parseWithStatement(); + break; + default: + statement = this.parseExpressionStatement(); + break; + } + break; + default: + statement = this.throwUnexpectedToken(this.lookahead); + } + return statement; + }; + Parser8.prototype.parseFunctionSourceElements = function() { + var node = this.createNode(); + this.expect("{"); + var body = this.parseDirectivePrologues(); + var previousLabelSet = this.context.labelSet; + var previousInIteration = this.context.inIteration; + var previousInSwitch = this.context.inSwitch; + var previousInFunctionBody = this.context.inFunctionBody; + this.context.labelSet = {}; + this.context.inIteration = false; + this.context.inSwitch = false; + this.context.inFunctionBody = true; + while (this.lookahead.type !== 2) { + if (this.match("}")) { + break; + } + body.push(this.parseStatementListItem()); + } + this.expect("}"); + this.context.labelSet = previousLabelSet; + this.context.inIteration = previousInIteration; + this.context.inSwitch = previousInSwitch; + this.context.inFunctionBody = previousInFunctionBody; + return this.finalize(node, new Node.BlockStatement(body)); + }; + Parser8.prototype.validateParam = function(options, param, name2) { + var key = "$" + name2; + if (this.context.strict) { + if (this.scanner.isRestrictedWord(name2)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } else if (!options.firstRestricted) { + if (this.scanner.isRestrictedWord(name2)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictParamName; + } else if (this.scanner.isStrictModeReservedWord(name2)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictReservedWord; + } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + if (typeof Object.defineProperty === "function") { + Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); + } else { + options.paramSet[key] = true; + } + }; + Parser8.prototype.parseRestElement = function(params) { + var node = this.createNode(); + this.expect("..."); + var arg = this.parsePattern(params); + if (this.match("=")) { + this.throwError(messages_1.Messages.DefaultRestParameter); + } + if (!this.match(")")) { + this.throwError(messages_1.Messages.ParameterAfterRestParameter); + } + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser8.prototype.parseFormalParameter = function(options) { + var params = []; + var param = this.match("...") ? this.parseRestElement(params) : this.parsePatternWithDefault(params); + for (var i7 = 0; i7 < params.length; i7++) { + this.validateParam(options, params[i7], params[i7].value); + } + options.simple = options.simple && param instanceof Node.Identifier; + options.params.push(param); + }; + Parser8.prototype.parseFormalParameters = function(firstRestricted) { + var options; + options = { + simple: true, + params: [], + firstRestricted + }; + this.expect("("); + if (!this.match(")")) { + options.paramSet = {}; + while (this.lookahead.type !== 2) { + this.parseFormalParameter(options); + if (this.match(")")) { + break; + } + this.expect(","); + if (this.match(")")) { + break; + } + } + } + this.expect(")"); + return { + simple: options.simple, + params: options.params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser8.prototype.matchAsyncFunction = function() { + var match = this.matchContextualKeyword("async"); + if (match) { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + match = state.lineNumber === next.lineNumber && next.type === 4 && next.value === "function"; + } + return match; + }; + Parser8.prototype.parseFunctionDeclaration = function(identifierIsOptional) { + var node = this.createNode(); + var isAsync2 = this.matchContextualKeyword("async"); + if (isAsync2) { + this.nextToken(); + } + this.expectKeyword("function"); + var isGenerator = isAsync2 ? false : this.match("*"); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted = null; + if (!identifierIsOptional || !this.match("(")) { + var token = this.lookahead; + id = this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync2; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync2 ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + }; + Parser8.prototype.parseFunctionExpression = function() { + var node = this.createNode(); + var isAsync2 = this.matchContextualKeyword("async"); + if (isAsync2) { + this.nextToken(); + } + this.expectKeyword("function"); + var isGenerator = isAsync2 ? false : this.match("*"); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted; + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync2; + this.context.allowYield = !isGenerator; + if (!this.match("(")) { + var token = this.lookahead; + id = !this.context.strict && !isGenerator && this.matchKeyword("yield") ? this.parseIdentifierName() : this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync2 ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + }; + Parser8.prototype.parseDirective = function() { + var token = this.lookahead; + var node = this.createNode(); + var expr = this.parseExpression(); + var directive = expr.type === syntax_1.Syntax.Literal ? this.getTokenRaw(token).slice(1, -1) : null; + this.consumeSemicolon(); + return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + }; + Parser8.prototype.parseDirectivePrologues = function() { + var firstRestricted = null; + var body = []; + while (true) { + var token = this.lookahead; + if (token.type !== 8) { + break; + } + var statement = this.parseDirective(); + body.push(statement); + var directive = statement.directive; + if (typeof directive !== "string") { + break; + } + if (directive === "use strict") { + this.context.strict = true; + if (firstRestricted) { + this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); + } + if (!this.context.allowStrictDirective) { + this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); + } + } else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + return body; + }; + Parser8.prototype.qualifiedPropertyName = function(token) { + switch (token.type) { + case 3: + case 8: + case 1: + case 5: + case 6: + case 4: + return true; + case 7: + return token.value === "["; + default: + break; + } + return false; + }; + Parser8.prototype.parseGetterMethod = function() { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length > 0) { + this.tolerateError(messages_1.Messages.BadGetterArity); + } + var method2 = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method2, isGenerator)); + }; + Parser8.prototype.parseSetterMethod = function() { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length !== 1) { + this.tolerateError(messages_1.Messages.BadSetterArity); + } else if (formalParameters.params[0] instanceof Node.RestElement) { + this.tolerateError(messages_1.Messages.BadSetterRestParameter); + } + var method2 = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method2, isGenerator)); + }; + Parser8.prototype.parseGeneratorMethod = function() { + var node = this.createNode(); + var isGenerator = true; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + this.context.allowYield = false; + var method2 = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method2, isGenerator)); + }; + Parser8.prototype.isStartOfExpression = function() { + var start = true; + var value2 = this.lookahead.value; + switch (this.lookahead.type) { + case 7: + start = value2 === "[" || value2 === "(" || value2 === "{" || value2 === "+" || value2 === "-" || value2 === "!" || value2 === "~" || value2 === "++" || value2 === "--" || value2 === "/" || value2 === "/="; + break; + case 4: + start = value2 === "class" || value2 === "delete" || value2 === "function" || value2 === "let" || value2 === "new" || value2 === "super" || value2 === "this" || value2 === "typeof" || value2 === "void" || value2 === "yield"; + break; + default: + break; + } + return start; + }; + Parser8.prototype.parseYieldExpression = function() { + var node = this.createNode(); + this.expectKeyword("yield"); + var argument = null; + var delegate = false; + if (!this.hasLineTerminator) { + var previousAllowYield = this.context.allowYield; + this.context.allowYield = false; + delegate = this.match("*"); + if (delegate) { + this.nextToken(); + argument = this.parseAssignmentExpression(); + } else if (this.isStartOfExpression()) { + argument = this.parseAssignmentExpression(); + } + this.context.allowYield = previousAllowYield; + } + return this.finalize(node, new Node.YieldExpression(argument, delegate)); + }; + Parser8.prototype.parseClassElement = function(hasConstructor) { + var token = this.lookahead; + var node = this.createNode(); + var kind = ""; + var key = null; + var value2 = null; + var computed = false; + var method2 = false; + var isStatic = false; + var isAsync2 = false; + if (this.match("*")) { + this.nextToken(); + } else { + computed = this.match("["); + key = this.parseObjectPropertyKey(); + var id = key; + if (id.name === "static" && (this.qualifiedPropertyName(this.lookahead) || this.match("*"))) { + token = this.lookahead; + isStatic = true; + computed = this.match("["); + if (this.match("*")) { + this.nextToken(); + } else { + key = this.parseObjectPropertyKey(); + } + } + if (token.type === 3 && !this.hasLineTerminator && token.value === "async") { + var punctuator = this.lookahead.value; + if (punctuator !== ":" && punctuator !== "(" && punctuator !== "*") { + isAsync2 = true; + token = this.lookahead; + key = this.parseObjectPropertyKey(); + if (token.type === 3 && token.value === "constructor") { + this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); + } + } + } + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3) { + if (token.value === "get" && lookaheadPropertyKey) { + kind = "get"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value2 = this.parseGetterMethod(); + } else if (token.value === "set" && lookaheadPropertyKey) { + kind = "set"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + value2 = this.parseSetterMethod(); + } + } else if (token.type === 7 && token.value === "*" && lookaheadPropertyKey) { + kind = "init"; + computed = this.match("["); + key = this.parseObjectPropertyKey(); + value2 = this.parseGeneratorMethod(); + method2 = true; + } + if (!kind && key && this.match("(")) { + kind = "init"; + value2 = isAsync2 ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method2 = true; + } + if (!kind) { + this.throwUnexpectedToken(this.lookahead); + } + if (kind === "init") { + kind = "method"; + } + if (!computed) { + if (isStatic && this.isPropertyKey(key, "prototype")) { + this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); + } + if (!isStatic && this.isPropertyKey(key, "constructor")) { + if (kind !== "method" || !method2 || value2 && value2.generator) { + this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); + } + if (hasConstructor.value) { + this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); + } else { + hasConstructor.value = true; + } + kind = "constructor"; + } + } + return this.finalize(node, new Node.MethodDefinition(key, computed, value2, kind, isStatic)); + }; + Parser8.prototype.parseClassElementList = function() { + var body = []; + var hasConstructor = { value: false }; + this.expect("{"); + while (!this.match("}")) { + if (this.match(";")) { + this.nextToken(); + } else { + body.push(this.parseClassElement(hasConstructor)); + } + } + this.expect("}"); + return body; + }; + Parser8.prototype.parseClassBody = function() { + var node = this.createNode(); + var elementList = this.parseClassElementList(); + return this.finalize(node, new Node.ClassBody(elementList)); + }; + Parser8.prototype.parseClassDeclaration = function(identifierIsOptional) { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword("class"); + var id = identifierIsOptional && this.lookahead.type !== 3 ? null : this.parseVariableIdentifier(); + var superClass = null; + if (this.matchKeyword("extends")) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + }; + Parser8.prototype.parseClassExpression = function() { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword("class"); + var id = this.lookahead.type === 3 ? this.parseVariableIdentifier() : null; + var superClass = null; + if (this.matchKeyword("extends")) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + }; + Parser8.prototype.parseModule = function() { + this.context.strict = true; + this.context.isModule = true; + this.scanner.isModule = true; + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Module(body)); + }; + Parser8.prototype.parseScript = function() { + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Script(body)); + }; + Parser8.prototype.parseModuleSpecifier = function() { + var node = this.createNode(); + if (this.lookahead.type !== 8) { + this.throwError(messages_1.Messages.InvalidModuleSpecifier); + } + var token = this.nextToken(); + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + Parser8.prototype.parseImportSpecifier = function() { + var node = this.createNode(); + var imported; + var local; + if (this.lookahead.type === 3) { + imported = this.parseVariableIdentifier(); + local = imported; + if (this.matchContextualKeyword("as")) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + } else { + imported = this.parseIdentifierName(); + local = imported; + if (this.matchContextualKeyword("as")) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.ImportSpecifier(local, imported)); + }; + Parser8.prototype.parseNamedImports = function() { + this.expect("{"); + var specifiers = []; + while (!this.match("}")) { + specifiers.push(this.parseImportSpecifier()); + if (!this.match("}")) { + this.expect(","); + } + } + this.expect("}"); + return specifiers; + }; + Parser8.prototype.parseImportDefaultSpecifier = function() { + var node = this.createNode(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + }; + Parser8.prototype.parseImportNamespaceSpecifier = function() { + var node = this.createNode(); + this.expect("*"); + if (!this.matchContextualKeyword("as")) { + this.throwError(messages_1.Messages.NoAsAfterImportNamespace); + } + this.nextToken(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + }; + Parser8.prototype.parseImportDeclaration = function() { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalImportDeclaration); + } + var node = this.createNode(); + this.expectKeyword("import"); + var src; + var specifiers = []; + if (this.lookahead.type === 8) { + src = this.parseModuleSpecifier(); + } else { + if (this.match("{")) { + specifiers = specifiers.concat(this.parseNamedImports()); + } else if (this.match("*")) { + specifiers.push(this.parseImportNamespaceSpecifier()); + } else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword("default")) { + specifiers.push(this.parseImportDefaultSpecifier()); + if (this.match(",")) { + this.nextToken(); + if (this.match("*")) { + specifiers.push(this.parseImportNamespaceSpecifier()); + } else if (this.match("{")) { + specifiers = specifiers.concat(this.parseNamedImports()); + } else { + this.throwUnexpectedToken(this.lookahead); + } + } + } else { + this.throwUnexpectedToken(this.nextToken()); + } + if (!this.matchContextualKeyword("from")) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + src = this.parseModuleSpecifier(); + } + this.consumeSemicolon(); + return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + }; + Parser8.prototype.parseExportSpecifier = function() { + var node = this.createNode(); + var local = this.parseIdentifierName(); + var exported = local; + if (this.matchContextualKeyword("as")) { + this.nextToken(); + exported = this.parseIdentifierName(); + } + return this.finalize(node, new Node.ExportSpecifier(local, exported)); + }; + Parser8.prototype.parseExportDeclaration = function() { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalExportDeclaration); + } + var node = this.createNode(); + this.expectKeyword("export"); + var exportDeclaration; + if (this.matchKeyword("default")) { + this.nextToken(); + if (this.matchKeyword("function")) { + var declaration = this.parseFunctionDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } else if (this.matchKeyword("class")) { + var declaration = this.parseClassDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } else if (this.matchContextualKeyword("async")) { + var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } else { + if (this.matchContextualKeyword("from")) { + this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); + } + var declaration = this.match("{") ? this.parseObjectInitializer() : this.match("[") ? this.parseArrayInitializer() : this.parseAssignmentExpression(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + } else if (this.match("*")) { + this.nextToken(); + if (!this.matchContextualKeyword("from")) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + var src = this.parseModuleSpecifier(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + } else if (this.lookahead.type === 4) { + var declaration = void 0; + switch (this.lookahead.value) { + case "let": + case "const": + declaration = this.parseLexicalDeclaration({ inFor: false }); + break; + case "var": + case "class": + case "function": + declaration = this.parseStatementListItem(); + break; + default: + this.throwUnexpectedToken(this.lookahead); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } else if (this.matchAsyncFunction()) { + var declaration = this.parseFunctionDeclaration(); + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } else { + var specifiers = []; + var source = null; + var isExportFromIdentifier = false; + this.expect("{"); + while (!this.match("}")) { + isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword("default"); + specifiers.push(this.parseExportSpecifier()); + if (!this.match("}")) { + this.expect(","); + } + } + this.expect("}"); + if (this.matchContextualKeyword("from")) { + this.nextToken(); + source = this.parseModuleSpecifier(); + this.consumeSemicolon(); + } else if (isExportFromIdentifier) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } else { + this.consumeSemicolon(); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + } + return exportDeclaration; + }; + return Parser8; + }(); + exports29.Parser = Parser7; + }, + /* 9 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + function assert4(condition, message) { + if (!condition) { + throw new Error("ASSERT: " + message); + } + } + exports29.assert = assert4; + }, + /* 10 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var ErrorHandler = function() { + function ErrorHandler2() { + this.errors = []; + this.tolerant = false; + } + ErrorHandler2.prototype.recordError = function(error2) { + this.errors.push(error2); + }; + ErrorHandler2.prototype.tolerate = function(error2) { + if (this.tolerant) { + this.recordError(error2); + } else { + throw error2; + } + }; + ErrorHandler2.prototype.constructError = function(msg, column) { + var error2 = new Error(msg); + try { + throw error2; + } catch (base) { + if (Object.create && Object.defineProperty) { + error2 = Object.create(base); + Object.defineProperty(error2, "column", { value: column }); + } + } + return error2; + }; + ErrorHandler2.prototype.createError = function(index4, line, col, description7) { + var msg = "Line " + line + ": " + description7; + var error2 = this.constructError(msg, col); + error2.index = index4; + error2.lineNumber = line; + error2.description = description7; + return error2; + }; + ErrorHandler2.prototype.throwError = function(index4, line, col, description7) { + throw this.createError(index4, line, col, description7); + }; + ErrorHandler2.prototype.tolerateError = function(index4, line, col, description7) { + var error2 = this.createError(index4, line, col, description7); + if (this.tolerant) { + this.recordError(error2); + } else { + throw error2; + } + }; + return ErrorHandler2; + }(); + exports29.ErrorHandler = ErrorHandler; + }, + /* 11 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + exports29.Messages = { + BadGetterArity: "Getter must not have any formal parameters", + BadSetterArity: "Setter must have exactly one formal parameter", + BadSetterRestParameter: "Setter function argument must not be a rest parameter", + ConstructorIsAsync: "Class constructor may not be an async method", + ConstructorSpecialMethod: "Class constructor may not be an accessor", + DeclarationMissingInitializer: "Missing initializer in %0 declaration", + DefaultRestParameter: "Unexpected token =", + DuplicateBinding: "Duplicate binding %0", + DuplicateConstructor: "A class may only have one constructor", + DuplicateProtoProperty: "Duplicate __proto__ fields are not allowed in object literals", + ForInOfLoopInitializer: "%0 loop variable declaration may not have an initializer", + GeneratorInLegacyContext: "Generator declarations are not allowed in legacy contexts", + IllegalBreak: "Illegal break statement", + IllegalContinue: "Illegal continue statement", + IllegalExportDeclaration: "Unexpected token", + IllegalImportDeclaration: "Unexpected token", + IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list", + IllegalReturn: "Illegal return statement", + InvalidEscapedReservedWord: "Keyword must not contain escaped characters", + InvalidHexEscapeSequence: "Invalid hexadecimal escape sequence", + InvalidLHSInAssignment: "Invalid left-hand side in assignment", + InvalidLHSInForIn: "Invalid left-hand side in for-in", + InvalidLHSInForLoop: "Invalid left-hand side in for-loop", + InvalidModuleSpecifier: "Unexpected token", + InvalidRegExp: "Invalid regular expression", + LetInLexicalBinding: "let is disallowed as a lexically bound name", + MissingFromClause: "Unexpected token", + MultipleDefaultsInSwitch: "More than one default clause in switch statement", + NewlineAfterThrow: "Illegal newline after throw", + NoAsAfterImportNamespace: "Unexpected token", + NoCatchOrFinally: "Missing catch or finally after try", + ParameterAfterRestParameter: "Rest parameter must be last formal parameter", + Redeclaration: "%0 '%1' has already been declared", + StaticPrototype: "Classes may not have static property named prototype", + StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode", + StrictDelete: "Delete of an unqualified identifier in strict mode.", + StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block", + StrictFunctionName: "Function name may not be eval or arguments in strict mode", + StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode", + StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode", + StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode", + StrictModeWith: "Strict mode code may not include a with statement", + StrictOctalLiteral: "Octal literals are not allowed in strict mode.", + StrictParamDupe: "Strict mode function may not have duplicate parameter names", + StrictParamName: "Parameter name eval or arguments is not allowed in strict mode", + StrictReservedWord: "Use of future reserved word in strict mode", + StrictVarName: "Variable name may not be eval or arguments in strict mode", + TemplateOctalLiteral: "Octal literals are not allowed in template strings.", + UnexpectedEOS: "Unexpected end of input", + UnexpectedIdentifier: "Unexpected identifier", + UnexpectedNumber: "Unexpected number", + UnexpectedReserved: "Unexpected reserved word", + UnexpectedString: "Unexpected string", + UnexpectedTemplate: "Unexpected quasi %0", + UnexpectedToken: "Unexpected token %0", + UnexpectedTokenIllegal: "Unexpected token ILLEGAL", + UnknownLabel: "Undefined label '%0'", + UnterminatedRegExp: "Invalid regular expression: missing /" + }; + }, + /* 12 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var character_1 = __webpack_require__(4); + var messages_1 = __webpack_require__(11); + function hexValue(ch) { + return "0123456789abcdef".indexOf(ch.toLowerCase()); + } + function octalValue(ch) { + return "01234567".indexOf(ch); + } + var Scanner = function() { + function Scanner2(code, handler) { + this.source = code; + this.errorHandler = handler; + this.trackComment = false; + this.isModule = false; + this.length = code.length; + this.index = 0; + this.lineNumber = code.length > 0 ? 1 : 0; + this.lineStart = 0; + this.curlyStack = []; + } + Scanner2.prototype.saveState = function() { + return { + index: this.index, + lineNumber: this.lineNumber, + lineStart: this.lineStart + }; + }; + Scanner2.prototype.restoreState = function(state) { + this.index = state.index; + this.lineNumber = state.lineNumber; + this.lineStart = state.lineStart; + }; + Scanner2.prototype.eof = function() { + return this.index >= this.length; + }; + Scanner2.prototype.throwUnexpectedToken = function(message) { + if (message === void 0) { + message = messages_1.Messages.UnexpectedTokenIllegal; + } + return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner2.prototype.tolerateUnexpectedToken = function(message) { + if (message === void 0) { + message = messages_1.Messages.UnexpectedTokenIllegal; + } + this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner2.prototype.skipSingleLineComment = function(offset) { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - offset; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - offset + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + ++this.index; + if (character_1.Character.isLineTerminator(ch)) { + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart - 1 + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index - 1], + range: [start, this.index - 1], + loc + }; + comments.push(entry); + } + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + return comments; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index], + range: [start, this.index], + loc + }; + comments.push(entry); + } + return comments; + }; + Scanner2.prototype.skipMultiLineComment = function() { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - 2; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - 2 + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isLineTerminator(ch)) { + if (ch === 13 && this.source.charCodeAt(this.index + 1) === 10) { + ++this.index; + } + ++this.lineNumber; + ++this.index; + this.lineStart = this.index; + } else if (ch === 42) { + if (this.source.charCodeAt(this.index + 1) === 47) { + this.index += 2; + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index - 2], + range: [start, this.index], + loc + }; + comments.push(entry); + } + return comments; + } + ++this.index; + } else { + ++this.index; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index], + range: [start, this.index], + loc + }; + comments.push(entry); + } + this.tolerateUnexpectedToken(); + return comments; + }; + Scanner2.prototype.scanComments = function() { + var comments; + if (this.trackComment) { + comments = []; + } + var start = this.index === 0; + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isWhiteSpace(ch)) { + ++this.index; + } else if (character_1.Character.isLineTerminator(ch)) { + ++this.index; + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + start = true; + } else if (ch === 47) { + ch = this.source.charCodeAt(this.index + 1); + if (ch === 47) { + this.index += 2; + var comment = this.skipSingleLineComment(2); + if (this.trackComment) { + comments = comments.concat(comment); + } + start = true; + } else if (ch === 42) { + this.index += 2; + var comment = this.skipMultiLineComment(); + if (this.trackComment) { + comments = comments.concat(comment); + } + } else { + break; + } + } else if (start && ch === 45) { + if (this.source.charCodeAt(this.index + 1) === 45 && this.source.charCodeAt(this.index + 2) === 62) { + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } else { + break; + } + } else if (ch === 60 && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === "!--") { + this.index += 4; + var comment = this.skipSingleLineComment(4); + if (this.trackComment) { + comments = comments.concat(comment); + } + } else { + break; + } + } else { + break; + } + } + return comments; + }; + Scanner2.prototype.isFutureReservedWord = function(id) { + switch (id) { + case "enum": + case "export": + case "import": + case "super": + return true; + default: + return false; + } + }; + Scanner2.prototype.isStrictModeReservedWord = function(id) { + switch (id) { + case "implements": + case "interface": + case "package": + case "private": + case "protected": + case "public": + case "static": + case "yield": + case "let": + return true; + default: + return false; + } + }; + Scanner2.prototype.isRestrictedWord = function(id) { + return id === "eval" || id === "arguments"; + }; + Scanner2.prototype.isKeyword = function(id) { + switch (id.length) { + case 2: + return id === "if" || id === "in" || id === "do"; + case 3: + return id === "var" || id === "for" || id === "new" || id === "try" || id === "let"; + case 4: + return id === "this" || id === "else" || id === "case" || id === "void" || id === "with" || id === "enum"; + case 5: + return id === "while" || id === "break" || id === "catch" || id === "throw" || id === "const" || id === "yield" || id === "class" || id === "super"; + case 6: + return id === "return" || id === "typeof" || id === "delete" || id === "switch" || id === "export" || id === "import"; + case 7: + return id === "default" || id === "finally" || id === "extends"; + case 8: + return id === "function" || id === "continue" || id === "debugger"; + case 10: + return id === "instanceof"; + default: + return false; + } + }; + Scanner2.prototype.codePointAt = function(i7) { + var cp = this.source.charCodeAt(i7); + if (cp >= 55296 && cp <= 56319) { + var second = this.source.charCodeAt(i7 + 1); + if (second >= 56320 && second <= 57343) { + var first = cp; + cp = (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return cp; + }; + Scanner2.prototype.scanHexEscape = function(prefix) { + var len = prefix === "u" ? 4 : 2; + var code = 0; + for (var i7 = 0; i7 < len; ++i7) { + if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) { + code = code * 16 + hexValue(this.source[this.index++]); + } else { + return null; + } + } + return String.fromCharCode(code); + }; + Scanner2.prototype.scanUnicodeCodePointEscape = function() { + var ch = this.source[this.index]; + var code = 0; + if (ch === "}") { + this.throwUnexpectedToken(); + } + while (!this.eof()) { + ch = this.source[this.index++]; + if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) { + break; + } + code = code * 16 + hexValue(ch); + } + if (code > 1114111 || ch !== "}") { + this.throwUnexpectedToken(); + } + return character_1.Character.fromCodePoint(code); + }; + Scanner2.prototype.getIdentifier = function() { + var start = this.index++; + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (ch === 92) { + this.index = start; + return this.getComplexIdentifier(); + } else if (ch >= 55296 && ch < 57343) { + this.index = start; + return this.getComplexIdentifier(); + } + if (character_1.Character.isIdentifierPart(ch)) { + ++this.index; + } else { + break; + } + } + return this.source.slice(start, this.index); + }; + Scanner2.prototype.getComplexIdentifier = function() { + var cp = this.codePointAt(this.index); + var id = character_1.Character.fromCodePoint(cp); + this.index += id.length; + var ch; + if (cp === 92) { + if (this.source.charCodeAt(this.index) !== 117) { + this.throwUnexpectedToken(); + } + ++this.index; + if (this.source[this.index] === "{") { + ++this.index; + ch = this.scanUnicodeCodePointEscape(); + } else { + ch = this.scanHexEscape("u"); + if (ch === null || ch === "\\" || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) { + this.throwUnexpectedToken(); + } + } + id = ch; + } + while (!this.eof()) { + cp = this.codePointAt(this.index); + if (!character_1.Character.isIdentifierPart(cp)) { + break; + } + ch = character_1.Character.fromCodePoint(cp); + id += ch; + this.index += ch.length; + if (cp === 92) { + id = id.substr(0, id.length - 1); + if (this.source.charCodeAt(this.index) !== 117) { + this.throwUnexpectedToken(); + } + ++this.index; + if (this.source[this.index] === "{") { + ++this.index; + ch = this.scanUnicodeCodePointEscape(); + } else { + ch = this.scanHexEscape("u"); + if (ch === null || ch === "\\" || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) { + this.throwUnexpectedToken(); + } + } + id += ch; + } + } + return id; + }; + Scanner2.prototype.octalToDecimal = function(ch) { + var octal = ch !== "0"; + var code = octalValue(ch); + if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { + octal = true; + code = code * 8 + octalValue(this.source[this.index++]); + if ("0123".indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { + code = code * 8 + octalValue(this.source[this.index++]); + } + } + return { + code, + octal + }; + }; + Scanner2.prototype.scanIdentifier = function() { + var type3; + var start = this.index; + var id = this.source.charCodeAt(start) === 92 ? this.getComplexIdentifier() : this.getIdentifier(); + if (id.length === 1) { + type3 = 3; + } else if (this.isKeyword(id)) { + type3 = 4; + } else if (id === "null") { + type3 = 5; + } else if (id === "true" || id === "false") { + type3 = 1; + } else { + type3 = 3; + } + if (type3 !== 3 && start + id.length !== this.index) { + var restore = this.index; + this.index = start; + this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord); + this.index = restore; + } + return { + type: type3, + value: id, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanPunctuator = function() { + var start = this.index; + var str2 = this.source[this.index]; + switch (str2) { + case "(": + case "{": + if (str2 === "{") { + this.curlyStack.push("{"); + } + ++this.index; + break; + case ".": + ++this.index; + if (this.source[this.index] === "." && this.source[this.index + 1] === ".") { + this.index += 2; + str2 = "..."; + } + break; + case "}": + ++this.index; + this.curlyStack.pop(); + break; + case ")": + case ";": + case ",": + case "[": + case "]": + case ":": + case "?": + case "~": + ++this.index; + break; + default: + str2 = this.source.substr(this.index, 4); + if (str2 === ">>>=") { + this.index += 4; + } else { + str2 = str2.substr(0, 3); + if (str2 === "===" || str2 === "!==" || str2 === ">>>" || str2 === "<<=" || str2 === ">>=" || str2 === "**=") { + this.index += 3; + } else { + str2 = str2.substr(0, 2); + if (str2 === "&&" || str2 === "||" || str2 === "==" || str2 === "!=" || str2 === "+=" || str2 === "-=" || str2 === "*=" || str2 === "/=" || str2 === "++" || str2 === "--" || str2 === "<<" || str2 === ">>" || str2 === "&=" || str2 === "|=" || str2 === "^=" || str2 === "%=" || str2 === "<=" || str2 === ">=" || str2 === "=>" || str2 === "**") { + this.index += 2; + } else { + str2 = this.source[this.index]; + if ("<>=!+-*%&|^/".indexOf(str2) >= 0) { + ++this.index; + } + } + } + } + } + if (this.index === start) { + this.throwUnexpectedToken(); + } + return { + type: 7, + value: str2, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanHexLiteral = function(start) { + var num = ""; + while (!this.eof()) { + if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) { + break; + } + num += this.source[this.index++]; + } + if (num.length === 0) { + this.throwUnexpectedToken(); + } + if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) { + this.throwUnexpectedToken(); + } + return { + type: 6, + value: parseInt("0x" + num, 16), + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanBinaryLiteral = function(start) { + var num = ""; + var ch; + while (!this.eof()) { + ch = this.source[this.index]; + if (ch !== "0" && ch !== "1") { + break; + } + num += this.source[this.index++]; + } + if (num.length === 0) { + this.throwUnexpectedToken(); + } + if (!this.eof()) { + ch = this.source.charCodeAt(this.index); + if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) { + this.throwUnexpectedToken(); + } + } + return { + type: 6, + value: parseInt(num, 2), + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanOctalLiteral = function(prefix, start) { + var num = ""; + var octal = false; + if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) { + octal = true; + num = "0" + this.source[this.index++]; + } else { + ++this.index; + } + while (!this.eof()) { + if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) { + break; + } + num += this.source[this.index++]; + } + if (!octal && num.length === 0) { + this.throwUnexpectedToken(); + } + if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + this.throwUnexpectedToken(); + } + return { + type: 6, + value: parseInt(num, 8), + octal, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.isImplicitOctalLiteral = function() { + for (var i7 = this.index + 1; i7 < this.length; ++i7) { + var ch = this.source[i7]; + if (ch === "8" || ch === "9") { + return false; + } + if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) { + return true; + } + } + return true; + }; + Scanner2.prototype.scanNumericLiteral = function() { + var start = this.index; + var ch = this.source[start]; + assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || ch === ".", "Numeric literal must start with a decimal digit or a decimal point"); + var num = ""; + if (ch !== ".") { + num = this.source[this.index++]; + ch = this.source[this.index]; + if (num === "0") { + if (ch === "x" || ch === "X") { + ++this.index; + return this.scanHexLiteral(start); + } + if (ch === "b" || ch === "B") { + ++this.index; + return this.scanBinaryLiteral(start); + } + if (ch === "o" || ch === "O") { + return this.scanOctalLiteral(ch, start); + } + if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) { + if (this.isImplicitOctalLiteral()) { + return this.scanOctalLiteral(ch, start); + } + } + } + while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + num += this.source[this.index++]; + } + ch = this.source[this.index]; + } + if (ch === ".") { + num += this.source[this.index++]; + while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + num += this.source[this.index++]; + } + ch = this.source[this.index]; + } + if (ch === "e" || ch === "E") { + num += this.source[this.index++]; + ch = this.source[this.index]; + if (ch === "+" || ch === "-") { + num += this.source[this.index++]; + } + if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + num += this.source[this.index++]; + } + } else { + this.throwUnexpectedToken(); + } + } + if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) { + this.throwUnexpectedToken(); + } + return { + type: 6, + value: parseFloat(num), + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanStringLiteral = function() { + var start = this.index; + var quote = this.source[start]; + assert_1.assert(quote === "'" || quote === '"', "String literal must starts with a quote"); + ++this.index; + var octal = false; + var str2 = ""; + while (!this.eof()) { + var ch = this.source[this.index++]; + if (ch === quote) { + quote = ""; + break; + } else if (ch === "\\") { + ch = this.source[this.index++]; + if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + switch (ch) { + case "u": + if (this.source[this.index] === "{") { + ++this.index; + str2 += this.scanUnicodeCodePointEscape(); + } else { + var unescaped_1 = this.scanHexEscape(ch); + if (unescaped_1 === null) { + this.throwUnexpectedToken(); + } + str2 += unescaped_1; + } + break; + case "x": + var unescaped = this.scanHexEscape(ch); + if (unescaped === null) { + this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence); + } + str2 += unescaped; + break; + case "n": + str2 += "\n"; + break; + case "r": + str2 += "\r"; + break; + case "t": + str2 += " "; + break; + case "b": + str2 += "\b"; + break; + case "f": + str2 += "\f"; + break; + case "v": + str2 += "\v"; + break; + case "8": + case "9": + str2 += ch; + this.tolerateUnexpectedToken(); + break; + default: + if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) { + var octToDec = this.octalToDecimal(ch); + octal = octToDec.octal || octal; + str2 += String.fromCharCode(octToDec.code); + } else { + str2 += ch; + } + break; + } + } else { + ++this.lineNumber; + if (ch === "\r" && this.source[this.index] === "\n") { + ++this.index; + } + this.lineStart = this.index; + } + } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + break; + } else { + str2 += ch; + } + } + if (quote !== "") { + this.index = start; + this.throwUnexpectedToken(); + } + return { + type: 8, + value: str2, + octal, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.scanTemplate = function() { + var cooked = ""; + var terminated = false; + var start = this.index; + var head2 = this.source[start] === "`"; + var tail2 = false; + var rawOffset = 2; + ++this.index; + while (!this.eof()) { + var ch = this.source[this.index++]; + if (ch === "`") { + rawOffset = 1; + tail2 = true; + terminated = true; + break; + } else if (ch === "$") { + if (this.source[this.index] === "{") { + this.curlyStack.push("${"); + ++this.index; + terminated = true; + break; + } + cooked += ch; + } else if (ch === "\\") { + ch = this.source[this.index++]; + if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + switch (ch) { + case "n": + cooked += "\n"; + break; + case "r": + cooked += "\r"; + break; + case "t": + cooked += " "; + break; + case "u": + if (this.source[this.index] === "{") { + ++this.index; + cooked += this.scanUnicodeCodePointEscape(); + } else { + var restore = this.index; + var unescaped_2 = this.scanHexEscape(ch); + if (unescaped_2 !== null) { + cooked += unescaped_2; + } else { + this.index = restore; + cooked += ch; + } + } + break; + case "x": + var unescaped = this.scanHexEscape(ch); + if (unescaped === null) { + this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence); + } + cooked += unescaped; + break; + case "b": + cooked += "\b"; + break; + case "f": + cooked += "\f"; + break; + case "v": + cooked += "\v"; + break; + default: + if (ch === "0") { + if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) { + this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral); + } + cooked += "\0"; + } else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) { + this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral); + } else { + cooked += ch; + } + break; + } + } else { + ++this.lineNumber; + if (ch === "\r" && this.source[this.index] === "\n") { + ++this.index; + } + this.lineStart = this.index; + } + } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.lineNumber; + if (ch === "\r" && this.source[this.index] === "\n") { + ++this.index; + } + this.lineStart = this.index; + cooked += "\n"; + } else { + cooked += ch; + } + } + if (!terminated) { + this.throwUnexpectedToken(); + } + if (!head2) { + this.curlyStack.pop(); + } + return { + type: 10, + value: this.source.slice(start + 1, this.index - rawOffset), + cooked, + head: head2, + tail: tail2, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.testRegExp = function(pattern5, flags) { + var astralSubstitute = "\uFFFF"; + var tmp = pattern5; + var self2 = this; + if (flags.indexOf("u") >= 0) { + tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function($0, $1, $22) { + var codePoint = parseInt($1 || $22, 16); + if (codePoint > 1114111) { + self2.throwUnexpectedToken(messages_1.Messages.InvalidRegExp); + } + if (codePoint <= 65535) { + return String.fromCharCode(codePoint); + } + return astralSubstitute; + }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute); + } + try { + RegExp(tmp); + } catch (e10) { + this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp); + } + try { + return new RegExp(pattern5, flags); + } catch (exception2) { + return null; + } + }; + Scanner2.prototype.scanRegExpBody = function() { + var ch = this.source[this.index]; + assert_1.assert(ch === "/", "Regular expression literal must start with a slash"); + var str2 = this.source[this.index++]; + var classMarker = false; + var terminated = false; + while (!this.eof()) { + ch = this.source[this.index++]; + str2 += ch; + if (ch === "\\") { + ch = this.source[this.index++]; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); + } + str2 += ch; + } else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); + } else if (classMarker) { + if (ch === "]") { + classMarker = false; + } + } else { + if (ch === "/") { + terminated = true; + break; + } else if (ch === "[") { + classMarker = true; + } + } + } + if (!terminated) { + this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp); + } + return str2.substr(1, str2.length - 2); + }; + Scanner2.prototype.scanRegExpFlags = function() { + var str2 = ""; + var flags = ""; + while (!this.eof()) { + var ch = this.source[this.index]; + if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) { + break; + } + ++this.index; + if (ch === "\\" && !this.eof()) { + ch = this.source[this.index]; + if (ch === "u") { + ++this.index; + var restore = this.index; + var char = this.scanHexEscape("u"); + if (char !== null) { + flags += char; + for (str2 += "\\u"; restore < this.index; ++restore) { + str2 += this.source[restore]; + } + } else { + this.index = restore; + flags += "u"; + str2 += "\\u"; + } + this.tolerateUnexpectedToken(); + } else { + str2 += "\\"; + this.tolerateUnexpectedToken(); + } + } else { + flags += ch; + str2 += ch; + } + } + return flags; + }; + Scanner2.prototype.scanRegExp = function() { + var start = this.index; + var pattern5 = this.scanRegExpBody(); + var flags = this.scanRegExpFlags(); + var value2 = this.testRegExp(pattern5, flags); + return { + type: 9, + value: "", + pattern: pattern5, + flags, + regex: value2, + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start, + end: this.index + }; + }; + Scanner2.prototype.lex = function() { + if (this.eof()) { + return { + type: 2, + value: "", + lineNumber: this.lineNumber, + lineStart: this.lineStart, + start: this.index, + end: this.index + }; + } + var cp = this.source.charCodeAt(this.index); + if (character_1.Character.isIdentifierStart(cp)) { + return this.scanIdentifier(); + } + if (cp === 40 || cp === 41 || cp === 59) { + return this.scanPunctuator(); + } + if (cp === 39 || cp === 34) { + return this.scanStringLiteral(); + } + if (cp === 46) { + if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) { + return this.scanNumericLiteral(); + } + return this.scanPunctuator(); + } + if (character_1.Character.isDecimalDigit(cp)) { + return this.scanNumericLiteral(); + } + if (cp === 96 || cp === 125 && this.curlyStack[this.curlyStack.length - 1] === "${") { + return this.scanTemplate(); + } + if (cp >= 55296 && cp < 57343) { + if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) { + return this.scanIdentifier(); + } + } + return this.scanPunctuator(); + }; + return Scanner2; + }(); + exports29.Scanner = Scanner; + }, + /* 13 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + exports29.TokenName = {}; + exports29.TokenName[ + 1 + /* BooleanLiteral */ + ] = "Boolean"; + exports29.TokenName[ + 2 + /* EOF */ + ] = ""; + exports29.TokenName[ + 3 + /* Identifier */ + ] = "Identifier"; + exports29.TokenName[ + 4 + /* Keyword */ + ] = "Keyword"; + exports29.TokenName[ + 5 + /* NullLiteral */ + ] = "Null"; + exports29.TokenName[ + 6 + /* NumericLiteral */ + ] = "Numeric"; + exports29.TokenName[ + 7 + /* Punctuator */ + ] = "Punctuator"; + exports29.TokenName[ + 8 + /* StringLiteral */ + ] = "String"; + exports29.TokenName[ + 9 + /* RegularExpression */ + ] = "RegularExpression"; + exports29.TokenName[ + 10 + /* Template */ + ] = "Template"; + }, + /* 14 */ + /***/ + function(module6, exports29) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + exports29.XHTMLEntities = { + quot: '"', + amp: "&", + apos: "'", + gt: ">", + nbsp: "\xA0", + iexcl: "\xA1", + cent: "\xA2", + pound: "\xA3", + curren: "\xA4", + yen: "\xA5", + brvbar: "\xA6", + sect: "\xA7", + uml: "\xA8", + copy: "\xA9", + ordf: "\xAA", + laquo: "\xAB", + not: "\xAC", + shy: "\xAD", + reg: "\xAE", + macr: "\xAF", + deg: "\xB0", + plusmn: "\xB1", + sup2: "\xB2", + sup3: "\xB3", + acute: "\xB4", + micro: "\xB5", + para: "\xB6", + middot: "\xB7", + cedil: "\xB8", + sup1: "\xB9", + ordm: "\xBA", + raquo: "\xBB", + frac14: "\xBC", + frac12: "\xBD", + frac34: "\xBE", + iquest: "\xBF", + Agrave: "\xC0", + Aacute: "\xC1", + Acirc: "\xC2", + Atilde: "\xC3", + Auml: "\xC4", + Aring: "\xC5", + AElig: "\xC6", + Ccedil: "\xC7", + Egrave: "\xC8", + Eacute: "\xC9", + Ecirc: "\xCA", + Euml: "\xCB", + Igrave: "\xCC", + Iacute: "\xCD", + Icirc: "\xCE", + Iuml: "\xCF", + ETH: "\xD0", + Ntilde: "\xD1", + Ograve: "\xD2", + Oacute: "\xD3", + Ocirc: "\xD4", + Otilde: "\xD5", + Ouml: "\xD6", + times: "\xD7", + Oslash: "\xD8", + Ugrave: "\xD9", + Uacute: "\xDA", + Ucirc: "\xDB", + Uuml: "\xDC", + Yacute: "\xDD", + THORN: "\xDE", + szlig: "\xDF", + agrave: "\xE0", + aacute: "\xE1", + acirc: "\xE2", + atilde: "\xE3", + auml: "\xE4", + aring: "\xE5", + aelig: "\xE6", + ccedil: "\xE7", + egrave: "\xE8", + eacute: "\xE9", + ecirc: "\xEA", + euml: "\xEB", + igrave: "\xEC", + iacute: "\xED", + icirc: "\xEE", + iuml: "\xEF", + eth: "\xF0", + ntilde: "\xF1", + ograve: "\xF2", + oacute: "\xF3", + ocirc: "\xF4", + otilde: "\xF5", + ouml: "\xF6", + divide: "\xF7", + oslash: "\xF8", + ugrave: "\xF9", + uacute: "\xFA", + ucirc: "\xFB", + uuml: "\xFC", + yacute: "\xFD", + thorn: "\xFE", + yuml: "\xFF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666", + lang: "\u27E8", + rang: "\u27E9" + }; + }, + /* 15 */ + /***/ + function(module6, exports29, __webpack_require__) { + "use strict"; + Object.defineProperty(exports29, "__esModule", { value: true }); + var error_handler_1 = __webpack_require__(10); + var scanner_1 = __webpack_require__(12); + var token_1 = __webpack_require__(13); + var Reader = function() { + function Reader2() { + this.values = []; + this.curly = this.paren = -1; + } + Reader2.prototype.beforeFunctionExpression = function(t8) { + return [ + "(", + "{", + "[", + "in", + "typeof", + "instanceof", + "new", + "return", + "case", + "delete", + "throw", + "void", + // assignment operators + "=", + "+=", + "-=", + "*=", + "**=", + "/=", + "%=", + "<<=", + ">>=", + ">>>=", + "&=", + "|=", + "^=", + ",", + // binary/unary operators + "+", + "-", + "*", + "**", + "/", + "%", + "++", + "--", + "<<", + ">>", + ">>>", + "&", + "|", + "^", + "!", + "~", + "&&", + "||", + "?", + ":", + "===", + "==", + ">=", + "<=", + "<", + ">", + "!=", + "!==" + ].indexOf(t8) >= 0; + }; + Reader2.prototype.isRegexStart = function() { + var previous = this.values[this.values.length - 1]; + var regex = previous !== null; + switch (previous) { + case "this": + case "]": + regex = false; + break; + case ")": + var keyword = this.values[this.paren - 1]; + regex = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with"; + break; + case "}": + regex = false; + if (this.values[this.curly - 3] === "function") { + var check = this.values[this.curly - 4]; + regex = check ? !this.beforeFunctionExpression(check) : false; + } else if (this.values[this.curly - 4] === "function") { + var check = this.values[this.curly - 5]; + regex = check ? !this.beforeFunctionExpression(check) : true; + } + break; + default: + break; + } + return regex; + }; + Reader2.prototype.push = function(token) { + if (token.type === 7 || token.type === 4) { + if (token.value === "{") { + this.curly = this.values.length; + } else if (token.value === "(") { + this.paren = this.values.length; + } + this.values.push(token.value); + } else { + this.values.push(null); + } + }; + return Reader2; + }(); + var Tokenizer = function() { + function Tokenizer2(code, config3) { + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = config3 ? typeof config3.tolerant === "boolean" && config3.tolerant : false; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = config3 ? typeof config3.comment === "boolean" && config3.comment : false; + this.trackRange = config3 ? typeof config3.range === "boolean" && config3.range : false; + this.trackLoc = config3 ? typeof config3.loc === "boolean" && config3.loc : false; + this.buffer = []; + this.reader = new Reader(); + } + Tokenizer2.prototype.errors = function() { + return this.errorHandler.errors; + }; + Tokenizer2.prototype.getNextToken = function() { + if (this.buffer.length === 0) { + var comments = this.scanner.scanComments(); + if (this.scanner.trackComment) { + for (var i7 = 0; i7 < comments.length; ++i7) { + var e10 = comments[i7]; + var value2 = this.scanner.source.slice(e10.slice[0], e10.slice[1]); + var comment = { + type: e10.multiLine ? "BlockComment" : "LineComment", + value: value2 + }; + if (this.trackRange) { + comment.range = e10.range; + } + if (this.trackLoc) { + comment.loc = e10.loc; + } + this.buffer.push(comment); + } + } + if (!this.scanner.eof()) { + var loc = void 0; + if (this.trackLoc) { + loc = { + start: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }, + end: {} + }; + } + var startRegex = this.scanner.source[this.scanner.index] === "/" && this.reader.isRegexStart(); + var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex(); + this.reader.push(token); + var entry = { + type: token_1.TokenName[token.type], + value: this.scanner.source.slice(token.start, token.end) + }; + if (this.trackRange) { + entry.range = [token.start, token.end]; + } + if (this.trackLoc) { + loc.end = { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + entry.loc = loc; + } + if (token.type === 9) { + var pattern5 = token.pattern; + var flags = token.flags; + entry.regex = { pattern: pattern5, flags }; + } + this.buffer.push(entry); + } + } + return this.buffer.shift(); + }; + return Tokenizer2; + }(); + exports29.Tokenizer = Tokenizer; + } + /******/ + ]) + ); + }); + } +}); + +// node_modules/array-timsort/src/index.js +var require_src6 = __commonJS({ + "node_modules/array-timsort/src/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var DEFAULT_MIN_MERGE = 32; + var DEFAULT_MIN_GALLOPING = 7; + var DEFAULT_TMP_STORAGE_LENGTH = 256; + var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9]; + var results; + var log10 = (x7) => x7 < 1e5 ? x7 < 100 ? x7 < 10 ? 0 : 1 : x7 < 1e4 ? x7 < 1e3 ? 2 : 3 : 4 : x7 < 1e7 ? x7 < 1e6 ? 5 : 6 : x7 < 1e9 ? x7 < 1e8 ? 7 : 8 : 9; + function alphabeticalCompare(a7, b8) { + if (a7 === b8) { + return 0; + } + if (~~a7 === a7 && ~~b8 === b8) { + if (a7 === 0 || b8 === 0) { + return a7 < b8 ? -1 : 1; + } + if (a7 < 0 || b8 < 0) { + if (b8 >= 0) { + return -1; + } + if (a7 >= 0) { + return 1; + } + a7 = -a7; + b8 = -b8; + } + const al = log10(a7); + const bl = log10(b8); + let t8 = 0; + if (al < bl) { + a7 *= POWERS_OF_TEN[bl - al - 1]; + b8 /= 10; + t8 = -1; + } else if (al > bl) { + b8 *= POWERS_OF_TEN[al - bl - 1]; + a7 /= 10; + t8 = 1; + } + if (a7 === b8) { + return t8; + } + return a7 < b8 ? -1 : 1; + } + const aStr = String(a7); + const bStr = String(b8); + if (aStr === bStr) { + return 0; + } + return aStr < bStr ? -1 : 1; + } + function minRunLength(n7) { + let r8 = 0; + while (n7 >= DEFAULT_MIN_MERGE) { + r8 |= n7 & 1; + n7 >>= 1; + } + return n7 + r8; + } + function makeAscendingRun(array, lo, hi, compare) { + let runHi = lo + 1; + if (runHi === hi) { + return 1; + } + if (compare(array[runHi++], array[lo]) < 0) { + while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) { + runHi++; + } + reverseRun(array, lo, runHi); + reverseRun(results, lo, runHi); + } else { + while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) { + runHi++; + } + } + return runHi - lo; + } + function reverseRun(array, lo, hi) { + hi--; + while (lo < hi) { + const t8 = array[lo]; + array[lo++] = array[hi]; + array[hi--] = t8; + } + } + function binaryInsertionSort(array, lo, hi, start, compare) { + if (start === lo) { + start++; + } + for (; start < hi; start++) { + const pivot = array[start]; + const pivotIndex = results[start]; + let left = lo; + let right = start; + while (left < right) { + const mid = left + right >>> 1; + if (compare(pivot, array[mid]) < 0) { + right = mid; + } else { + left = mid + 1; + } + } + let n7 = start - left; + switch (n7) { + case 3: + array[left + 3] = array[left + 2]; + results[left + 3] = results[left + 2]; + case 2: + array[left + 2] = array[left + 1]; + results[left + 2] = results[left + 1]; + case 1: + array[left + 1] = array[left]; + results[left + 1] = results[left]; + break; + default: + while (n7 > 0) { + array[left + n7] = array[left + n7 - 1]; + results[left + n7] = results[left + n7 - 1]; + n7--; + } + } + array[left] = pivot; + results[left] = pivotIndex; + } + } + function gallopLeft(value2, array, start, length, hint, compare) { + let lastOffset = 0; + let maxOffset = 0; + let offset = 1; + if (compare(value2, array[start + hint]) > 0) { + maxOffset = length - hint; + while (offset < maxOffset && compare(value2, array[start + hint + offset]) > 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + lastOffset += hint; + offset += hint; + } else { + maxOffset = hint + 1; + while (offset < maxOffset && compare(value2, array[start + hint - offset]) <= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + const tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } + lastOffset++; + while (lastOffset < offset) { + const m7 = lastOffset + (offset - lastOffset >>> 1); + if (compare(value2, array[start + m7]) > 0) { + lastOffset = m7 + 1; + } else { + offset = m7; + } + } + return offset; + } + function gallopRight(value2, array, start, length, hint, compare) { + let lastOffset = 0; + let maxOffset = 0; + let offset = 1; + if (compare(value2, array[start + hint]) < 0) { + maxOffset = hint + 1; + while (offset < maxOffset && compare(value2, array[start + hint - offset]) < 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + const tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } else { + maxOffset = length - hint; + while (offset < maxOffset && compare(value2, array[start + hint + offset]) >= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + lastOffset += hint; + offset += hint; + } + lastOffset++; + while (lastOffset < offset) { + const m7 = lastOffset + (offset - lastOffset >>> 1); + if (compare(value2, array[start + m7]) < 0) { + offset = m7; + } else { + lastOffset = m7 + 1; + } + } + return offset; + } + var TimSort = class { + constructor(array, compare) { + this.array = array; + this.compare = compare; + const { length } = array; + this.length = length; + this.minGallop = DEFAULT_MIN_GALLOPING; + this.tmpStorageLength = length < 2 * DEFAULT_TMP_STORAGE_LENGTH ? length >>> 1 : DEFAULT_TMP_STORAGE_LENGTH; + this.tmp = new Array(this.tmpStorageLength); + this.tmpIndex = new Array(this.tmpStorageLength); + this.stackLength = length < 120 ? 5 : length < 1542 ? 10 : length < 119151 ? 19 : 40; + this.runStart = new Array(this.stackLength); + this.runLength = new Array(this.stackLength); + this.stackSize = 0; + } + /** + * Push a new run on TimSort's stack. + * + * @param {number} runStart - Start index of the run in the original array. + * @param {number} runLength - Length of the run; + */ + pushRun(runStart, runLength) { + this.runStart[this.stackSize] = runStart; + this.runLength[this.stackSize] = runLength; + this.stackSize += 1; + } + /** + * Merge runs on TimSort's stack so that the following holds for all i: + * 1) runLength[i - 3] > runLength[i - 2] + runLength[i - 1] + * 2) runLength[i - 2] > runLength[i - 1] + */ + mergeRuns() { + while (this.stackSize > 1) { + let n7 = this.stackSize - 2; + if (n7 >= 1 && this.runLength[n7 - 1] <= this.runLength[n7] + this.runLength[n7 + 1] || n7 >= 2 && this.runLength[n7 - 2] <= this.runLength[n7] + this.runLength[n7 - 1]) { + if (this.runLength[n7 - 1] < this.runLength[n7 + 1]) { + n7--; + } + } else if (this.runLength[n7] > this.runLength[n7 + 1]) { + break; + } + this.mergeAt(n7); + } + } + /** + * Merge all runs on TimSort's stack until only one remains. + */ + forceMergeRuns() { + while (this.stackSize > 1) { + let n7 = this.stackSize - 2; + if (n7 > 0 && this.runLength[n7 - 1] < this.runLength[n7 + 1]) { + n7--; + } + this.mergeAt(n7); + } + } + /** + * Merge the runs on the stack at positions i and i+1. Must be always be called + * with i=stackSize-2 or i=stackSize-3 (that is, we merge on top of the stack). + * + * @param {number} i - Index of the run to merge in TimSort's stack. + */ + mergeAt(i7) { + const { compare } = this; + const { array } = this; + let start1 = this.runStart[i7]; + let length1 = this.runLength[i7]; + const start2 = this.runStart[i7 + 1]; + let length2 = this.runLength[i7 + 1]; + this.runLength[i7] = length1 + length2; + if (i7 === this.stackSize - 3) { + this.runStart[i7 + 1] = this.runStart[i7 + 2]; + this.runLength[i7 + 1] = this.runLength[i7 + 2]; + } + this.stackSize--; + const k6 = gallopRight(array[start2], array, start1, length1, 0, compare); + start1 += k6; + length1 -= k6; + if (length1 === 0) { + return; + } + length2 = gallopLeft( + array[start1 + length1 - 1], + array, + start2, + length2, + length2 - 1, + compare + ); + if (length2 === 0) { + return; + } + if (length1 <= length2) { + this.mergeLow(start1, length1, start2, length2); + } else { + this.mergeHigh(start1, length1, start2, length2); + } + } + /** + * Merge two adjacent runs in a stable way. The runs must be such that the + * first element of run1 is bigger than the first element in run2 and the + * last element of run1 is greater than all the elements in run2. + * The method should be called when run1.length <= run2.length as it uses + * TimSort temporary array to store run1. Use mergeHigh if run1.length > + * run2.length. + * + * @param {number} start1 - First element in run1. + * @param {number} length1 - Length of run1. + * @param {number} start2 - First element in run2. + * @param {number} length2 - Length of run2. + */ + mergeLow(start1, length1, start2, length2) { + const { compare } = this; + const { array } = this; + const { tmp } = this; + const { tmpIndex } = this; + let i7 = 0; + for (i7 = 0; i7 < length1; i7++) { + tmp[i7] = array[start1 + i7]; + tmpIndex[i7] = results[start1 + i7]; + } + let cursor1 = 0; + let cursor2 = start2; + let dest = start1; + array[dest] = array[cursor2]; + results[dest] = results[cursor2]; + dest++; + cursor2++; + if (--length2 === 0) { + for (i7 = 0; i7 < length1; i7++) { + array[dest + i7] = tmp[cursor1 + i7]; + results[dest + i7] = tmpIndex[cursor1 + i7]; + } + return; + } + if (length1 === 1) { + for (i7 = 0; i7 < length2; i7++) { + array[dest + i7] = array[cursor2 + i7]; + results[dest + i7] = results[cursor2 + i7]; + } + array[dest + length2] = tmp[cursor1]; + results[dest + length2] = tmpIndex[cursor1]; + return; + } + let { minGallop } = this; + while (true) { + let count1 = 0; + let count2 = 0; + let exit3 = false; + do { + if (compare(array[cursor2], tmp[cursor1]) < 0) { + array[dest] = array[cursor2]; + results[dest] = results[cursor2]; + dest++; + cursor2++; + count2++; + count1 = 0; + if (--length2 === 0) { + exit3 = true; + break; + } + } else { + array[dest] = tmp[cursor1]; + results[dest] = tmpIndex[cursor1]; + dest++; + cursor1++; + count1++; + count2 = 0; + if (--length1 === 1) { + exit3 = true; + break; + } + } + } while ((count1 | count2) < minGallop); + if (exit3) { + break; + } + do { + count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare); + if (count1 !== 0) { + for (i7 = 0; i7 < count1; i7++) { + array[dest + i7] = tmp[cursor1 + i7]; + results[dest + i7] = tmpIndex[cursor1 + i7]; + } + dest += count1; + cursor1 += count1; + length1 -= count1; + if (length1 <= 1) { + exit3 = true; + break; + } + } + array[dest] = array[cursor2]; + results[dest] = results[cursor2]; + dest++; + cursor2++; + if (--length2 === 0) { + exit3 = true; + break; + } + count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare); + if (count2 !== 0) { + for (i7 = 0; i7 < count2; i7++) { + array[dest + i7] = array[cursor2 + i7]; + results[dest + i7] = results[cursor2 + i7]; + } + dest += count2; + cursor2 += count2; + length2 -= count2; + if (length2 === 0) { + exit3 = true; + break; + } + } + array[dest] = tmp[cursor1]; + results[dest] = tmpIndex[cursor1]; + dest++; + cursor1++; + if (--length1 === 1) { + exit3 = true; + break; + } + minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + if (exit3) { + break; + } + if (minGallop < 0) { + minGallop = 0; + } + minGallop += 2; + } + this.minGallop = minGallop; + if (minGallop < 1) { + this.minGallop = 1; + } + if (length1 === 1) { + for (i7 = 0; i7 < length2; i7++) { + array[dest + i7] = array[cursor2 + i7]; + results[dest + i7] = results[cursor2 + i7]; + } + array[dest + length2] = tmp[cursor1]; + results[dest + length2] = tmpIndex[cursor1]; + } else if (length1 === 0) { + throw new Error("mergeLow preconditions were not respected"); + } else { + for (i7 = 0; i7 < length1; i7++) { + array[dest + i7] = tmp[cursor1 + i7]; + results[dest + i7] = tmpIndex[cursor1 + i7]; + } + } + } + /** + * Merge two adjacent runs in a stable way. The runs must be such that the + * first element of run1 is bigger than the first element in run2 and the + * last element of run1 is greater than all the elements in run2. + * The method should be called when run1.length > run2.length as it uses + * TimSort temporary array to store run2. Use mergeLow if run1.length <= + * run2.length. + * + * @param {number} start1 - First element in run1. + * @param {number} length1 - Length of run1. + * @param {number} start2 - First element in run2. + * @param {number} length2 - Length of run2. + */ + mergeHigh(start1, length1, start2, length2) { + const { compare } = this; + const { array } = this; + const { tmp } = this; + const { tmpIndex } = this; + let i7 = 0; + for (i7 = 0; i7 < length2; i7++) { + tmp[i7] = array[start2 + i7]; + tmpIndex[i7] = results[start2 + i7]; + } + let cursor1 = start1 + length1 - 1; + let cursor2 = length2 - 1; + let dest = start2 + length2 - 1; + let customCursor = 0; + let customDest = 0; + array[dest] = array[cursor1]; + results[dest] = results[cursor1]; + dest--; + cursor1--; + if (--length1 === 0) { + customCursor = dest - (length2 - 1); + for (i7 = 0; i7 < length2; i7++) { + array[customCursor + i7] = tmp[i7]; + results[customCursor + i7] = tmpIndex[i7]; + } + return; + } + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i7 = length1 - 1; i7 >= 0; i7--) { + array[customDest + i7] = array[customCursor + i7]; + results[customDest + i7] = results[customCursor + i7]; + } + array[dest] = tmp[cursor2]; + results[dest] = tmpIndex[cursor2]; + return; + } + let { minGallop } = this; + while (true) { + let count1 = 0; + let count2 = 0; + let exit3 = false; + do { + if (compare(tmp[cursor2], array[cursor1]) < 0) { + array[dest] = array[cursor1]; + results[dest] = results[cursor1]; + dest--; + cursor1--; + count1++; + count2 = 0; + if (--length1 === 0) { + exit3 = true; + break; + } + } else { + array[dest] = tmp[cursor2]; + results[dest] = tmpIndex[cursor2]; + dest--; + cursor2--; + count2++; + count1 = 0; + if (--length2 === 1) { + exit3 = true; + break; + } + } + } while ((count1 | count2) < minGallop); + if (exit3) { + break; + } + do { + count1 = length1 - gallopRight( + tmp[cursor2], + array, + start1, + length1, + length1 - 1, + compare + ); + if (count1 !== 0) { + dest -= count1; + cursor1 -= count1; + length1 -= count1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i7 = count1 - 1; i7 >= 0; i7--) { + array[customDest + i7] = array[customCursor + i7]; + results[customDest + i7] = results[customCursor + i7]; + } + if (length1 === 0) { + exit3 = true; + break; + } + } + array[dest] = tmp[cursor2]; + results[dest] = tmpIndex[cursor2]; + dest--; + cursor2--; + if (--length2 === 1) { + exit3 = true; + break; + } + count2 = length2 - gallopLeft( + array[cursor1], + tmp, + 0, + length2, + length2 - 1, + compare + ); + if (count2 !== 0) { + dest -= count2; + cursor2 -= count2; + length2 -= count2; + customDest = dest + 1; + customCursor = cursor2 + 1; + for (i7 = 0; i7 < count2; i7++) { + array[customDest + i7] = tmp[customCursor + i7]; + results[customDest + i7] = tmpIndex[customCursor + i7]; + } + if (length2 <= 1) { + exit3 = true; + break; + } + } + array[dest] = array[cursor1]; + results[dest] = results[cursor1]; + dest--; + cursor1--; + if (--length1 === 0) { + exit3 = true; + break; + } + minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + if (exit3) { + break; + } + if (minGallop < 0) { + minGallop = 0; + } + minGallop += 2; + } + this.minGallop = minGallop; + if (minGallop < 1) { + this.minGallop = 1; + } + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + for (i7 = length1 - 1; i7 >= 0; i7--) { + array[customDest + i7] = array[customCursor + i7]; + results[customDest + i7] = results[customCursor + i7]; + } + array[dest] = tmp[cursor2]; + results[dest] = tmpIndex[cursor2]; + } else if (length2 === 0) { + throw new Error("mergeHigh preconditions were not respected"); + } else { + customCursor = dest - (length2 - 1); + for (i7 = 0; i7 < length2; i7++) { + array[customCursor + i7] = tmp[i7]; + results[customCursor + i7] = tmpIndex[i7]; + } + } + } + }; + function sort(array, compare, lo, hi) { + if (!Array.isArray(array)) { + throw new TypeError( + `The "array" argument must be an array. Received ${array}` + ); + } + results = []; + const { length } = array; + let i7 = 0; + while (i7 < length) { + results[i7] = i7++; + } + if (!compare) { + compare = alphabeticalCompare; + } else if (typeof compare !== "function") { + hi = lo; + lo = compare; + compare = alphabeticalCompare; + } + if (!lo) { + lo = 0; + } + if (!hi) { + hi = length; + } + let remaining = hi - lo; + if (remaining < 2) { + return results; + } + let runLength = 0; + if (remaining < DEFAULT_MIN_MERGE) { + runLength = makeAscendingRun(array, lo, hi, compare); + binaryInsertionSort(array, lo, hi, lo + runLength, compare); + return results; + } + const ts = new TimSort(array, compare); + const minRun = minRunLength(remaining); + do { + runLength = makeAscendingRun(array, lo, hi, compare); + if (runLength < minRun) { + let force = remaining; + if (force > minRun) { + force = minRun; + } + binaryInsertionSort(array, lo, lo + force, lo + runLength, compare); + runLength = force; + } + ts.pushRun(lo, runLength); + ts.mergeRuns(); + remaining -= runLength; + lo += runLength; + } while (remaining !== 0); + ts.forceMergeRuns(); + return results; + } + module5.exports = { + sort + }; + } +}); + +// node_modules/comment-json/src/common.js +var require_common6 = __commonJS({ + "node_modules/comment-json/src/common.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var PREFIX_BEFORE = "before"; + var PREFIX_AFTER_PROP = "after-prop"; + var PREFIX_AFTER_COLON = "after-colon"; + var PREFIX_AFTER_VALUE = "after-value"; + var PREFIX_AFTER = "after"; + var PREFIX_BEFORE_ALL = "before-all"; + var PREFIX_AFTER_ALL = "after-all"; + var BRACKET_OPEN = "["; + var BRACKET_CLOSE = "]"; + var CURLY_BRACKET_OPEN = "{"; + var CURLY_BRACKET_CLOSE = "}"; + var COMMA = ","; + var EMPTY = ""; + var MINUS = "-"; + var PROP_SYMBOL_PREFIXES = [ + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER + ]; + var NON_PROP_SYMBOL_PREFIXES = [ + PREFIX_BEFORE, + PREFIX_AFTER, + PREFIX_BEFORE_ALL, + PREFIX_AFTER_ALL + ]; + var NON_PROP_SYMBOL_KEYS = NON_PROP_SYMBOL_PREFIXES.map(Symbol.for); + var COLON = ":"; + var UNDEFINED = void 0; + var LINE_BREAKS_BEFORE = /* @__PURE__ */ new WeakMap(); + var LINE_BREAKS_AFTER = /* @__PURE__ */ new WeakMap(); + var RAW_STRING_LITERALS = /* @__PURE__ */ new WeakMap(); + var is_string = (subject) => typeof subject === "string"; + var is_number = (subject) => typeof subject === "number"; + var is_object = (v8) => typeof v8 === "object" && v8 !== null; + var normalize_key = (key) => is_string(key) || is_number(key) ? String(key) : null; + var set_raw_string_literal = (host, key, raw) => { + if (!is_object(host) || !is_string(raw)) { + return; + } + const normalized = normalize_key(key); + if (normalized === null) { + return; + } + let map4 = RAW_STRING_LITERALS.get(host); + if (!map4) { + map4 = /* @__PURE__ */ new Map(); + RAW_STRING_LITERALS.set(host, map4); + } + map4.set(normalized, raw); + }; + var get_raw_string_literal = (host, key) => { + if (!is_object(host)) { + return; + } + const normalized = normalize_key(key); + if (normalized === null) { + return; + } + const map4 = RAW_STRING_LITERALS.get(host); + return map4 ? map4.get(normalized) : void 0; + }; + var symbol = (prefix, key) => Symbol.for(prefix + COLON + key); + var symbol_checked = (prefix, key) => { + if (key) { + if (PROP_SYMBOL_PREFIXES.includes(prefix)) { + return symbol(prefix, key); + } + throw new RangeError( + `Unsupported comment position ${prefix} with key ${key}` + ); + } + if (NON_PROP_SYMBOL_PREFIXES.includes(prefix)) { + return Symbol.for(prefix); + } + throw new RangeError(`Unsupported comment position ${prefix}`); + }; + var define2 = (target, key, value2) => Object.defineProperty(target, key, { + value: value2, + writable: true, + configurable: true + }); + var copy_comments_by_kind = (target, source, target_key, source_key, prefix, remove_source) => { + const source_prop = symbol(prefix, source_key); + if (!Object.hasOwn(source, source_prop)) { + return; + } + const target_prop = target_key === source_key ? source_prop : symbol(prefix, target_key); + define2(target, target_prop, source[source_prop]); + if (remove_source) { + delete source[source_prop]; + } + }; + var copy_comments = (target, source, target_key, source_key, remove_source) => { + PROP_SYMBOL_PREFIXES.forEach((prefix) => { + copy_comments_by_kind( + target, + source, + target_key, + source_key, + prefix, + remove_source + ); + }); + }; + var swap_comments = (array, from, to) => { + if (from === to) { + return; + } + PROP_SYMBOL_PREFIXES.forEach((prefix) => { + const target_prop = symbol(prefix, to); + if (!Object.hasOwn(array, target_prop)) { + copy_comments_by_kind(array, array, to, from, prefix, true); + return; + } + const comments = array[target_prop]; + delete array[target_prop]; + copy_comments_by_kind(array, array, to, from, prefix, true); + define2(array, symbol(prefix, from), comments); + }); + }; + var assign_non_prop_comments = (target, source) => { + NON_PROP_SYMBOL_KEYS.forEach((key) => { + const comments = source[key]; + if (comments) { + define2(target, key, comments); + } + }); + }; + var assign3 = (target, source, keys2) => { + keys2.forEach((key) => { + if (typeof key !== "string" && typeof key !== "number") { + return; + } + if (!Object.hasOwn(source, key)) { + return; + } + target[key] = source[key]; + copy_comments(target, source, key, key); + }); + return target; + }; + var is_raw_json = typeof JSON.isRawJSON === "function" ? JSON.isRawJSON : () => false; + var set_comment_line_breaks = (comment, before2, after2) => { + if (is_number(before2) && before2 >= 0) { + LINE_BREAKS_BEFORE.set(comment, before2); + } + if (is_number(after2) && after2 >= 0) { + LINE_BREAKS_AFTER.set(comment, after2); + } + }; + var get_comment_line_breaks_before = (comment) => LINE_BREAKS_BEFORE.get(comment); + var get_comment_line_breaks_after = (comment) => LINE_BREAKS_AFTER.get(comment); + module5.exports = { + PROP_SYMBOL_PREFIXES, + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER, + PREFIX_BEFORE_ALL, + PREFIX_AFTER_ALL, + BRACKET_OPEN, + BRACKET_CLOSE, + CURLY_BRACKET_OPEN, + CURLY_BRACKET_CLOSE, + COLON, + COMMA, + MINUS, + EMPTY, + UNDEFINED, + symbol, + define: define2, + copy_comments, + swap_comments, + assign_non_prop_comments, + is_string, + is_number, + is_object, + is_raw_json, + set_raw_string_literal, + get_raw_string_literal, + set_comment_line_breaks, + get_comment_line_breaks_before, + get_comment_line_breaks_after, + /** + * Assign properties and comments from source to target object. + * + * @param {Object} target The target object to assign properties and comments + * to. + * @param {Object} source The source object to copy properties and comments + * from. + * @param {Array} [keys] Optional array of keys to assign. If + * not provided, all keys and non-property comments are assigned. If empty + * array, only non-property comments are assigned. + * @returns {Object} The target object with assigned properties and comments. + * + * @throws {TypeError} If target cannot be converted to object or keys is not + * array or undefined. + * + * @example + * const source = parse('{"a": 1 // comment a, "b": 2 // comment b}') + * const target = {} + * + * // Copy all properties and comments + * assign(target, source) + * + * // Copy only specific properties and their comments + * assign(target, source, ['a']) + * + * // Copy only non-property comments + * assign(target, source, []) + */ + assign(target, source, keys2) { + if (!is_object(target)) { + throw new TypeError("Cannot convert undefined or null to object"); + } + if (!is_object(source)) { + return target; + } + if (keys2 === UNDEFINED) { + keys2 = Object.keys(source); + assign_non_prop_comments(target, source); + } else if (!Array.isArray(keys2)) { + throw new TypeError("keys must be array or undefined"); + } else if (keys2.length === 0) { + assign_non_prop_comments(target, source); + } + return assign3(target, source, keys2); + }, + /** + * Move comments from one location to another within objects. + * + * @param {Object} source The source object containing comments to move. + * @param {Object} [target] The target object to move comments to. If not + * provided, defaults to source (move within same object). + * @param {Object} from The source comment location. + * @param {string} from.where The comment position (e.g., 'before', + * 'after', 'before-all', etc.). + * @param {string} [from.key] The property key for property-specific comments. + * Omit for non-property comments. + * @param {Object} to The target comment location. + * @param {string} to.where The comment position (e.g., 'before', + * 'after', 'before-all', etc.). + * @param {string} [to.key] The property key for property-specific comments. + * Omit for non-property comments. + * @param {boolean} [override=false] Whether to override existing comments at + * the target location. If false, comments will be appended. + * + * @throws {TypeError} If source is not an object. + * @throws {RangeError} If where parameter is invalid or incompatible with key. + * + * @example + * const obj = parse('{"a": 1 // comment on a}') + * + * // Move comment from after 'a' to before 'a' + * moveComments(obj, obj, + * { where: 'after', key: 'a' }, + * { where: 'before', key: 'a' } + * ) + * + * @example + * // Move non-property comment + * moveComments(obj, obj, + * { where: 'before-all' }, + * { where: 'after-all' } + * ) + */ + moveComments(source, target, { + where: from_where, + key: from_key + }, { + where: to_where, + key: to_key + }, override = false) { + if (!is_object(source)) { + throw new TypeError("source must be an object"); + } + if (!target) { + target = source; + } + if (!is_object(target)) { + return; + } + const from_prop = symbol_checked(from_where, from_key); + const to_prop = symbol_checked(to_where, to_key); + if (!Object.hasOwn(source, from_prop)) { + return; + } + const source_comments = source[from_prop]; + delete source[from_prop]; + if (override || !Object.hasOwn(target, to_prop)) { + define2(target, to_prop, source_comments); + return; + } + const target_comments = target[to_prop]; + if (target_comments) { + target_comments.push(...source_comments); + } + }, + /** + * Remove comments from a specific location within an object. + * + * @param {Object} target The target object to remove comments from. + * @param {Object} location The comment location to remove. + * @param {string} location.where The comment position (e.g., 'before', + * 'after', 'before-all', etc.). + * @param {string} [location.key] The property key for property-specific + * comments. Omit for non-property comments. + * + * @throws {TypeError} If target is not an object. + * @throws {RangeError} If where parameter is invalid or incompatible with key. + * + * @example + * const obj = parse('{"a": 1 // comment on a}') + * + * // Remove comment after 'a' + * removeComments(obj, { where: 'after', key: 'a' }) + * + * @example + * // Remove non-property comment + * removeComments(obj, { where: 'before-all' }) + */ + removeComments(target, { + where, + key + }) { + if (!is_object(target)) { + throw new TypeError("target must be an object"); + } + const prop = symbol_checked(where, key); + if (!Object.hasOwn(target, prop)) { + return; + } + delete target[prop]; + } + }; + } +}); + +// node_modules/comment-json/src/array.js +var require_array = __commonJS({ + "node_modules/comment-json/src/array.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var { sort } = require_src6(); + var { + PROP_SYMBOL_PREFIXES, + UNDEFINED, + symbol, + copy_comments, + swap_comments + } = require_common6(); + var reverse_comments = (array) => { + const { length } = array; + let i7 = 0; + const max2 = length / 2; + for (; i7 < max2; i7++) { + swap_comments(array, i7, length - i7 - 1); + } + }; + var move_comment = (target, source, i7, offset, remove2) => { + copy_comments(target, source, i7 + offset, i7, remove2); + }; + var move_comments = (target, source, start, count2, offset, remove2) => { + if (offset > 0) { + let i8 = count2; + while (i8-- > 0) { + move_comment(target, source, start + i8, offset, remove2); + } + return; + } + let i7 = 0; + while (i7 < count2) { + const ii = i7++; + move_comment(target, source, start + ii, offset, remove2); + } + }; + var remove_comments = (array, key) => { + PROP_SYMBOL_PREFIXES.forEach((prefix) => { + const prop = symbol(prefix, key); + delete array[prop]; + }); + }; + var get_mapped = (map4, key) => { + let mapped = key; + while (mapped in map4) { + mapped = map4[mapped]; + } + return mapped; + }; + var CommentArray = class _CommentArray extends Array { + // - deleteCount + items.length + // We should avoid `splice(begin, deleteCount, ...items)`, + // because `splice(0, undefined)` is not equivalent to `splice(0)`, + // as well as: + // - slice + /** + * Changes the contents of an array by removing or replacing existing + * elements and/or adding new elements in place. + * Comments are automatically preserved and repositioned during the operation. + * + * @param {...*} args Arguments passed to Array.prototype.splice + * @returns {CommentArray} A new CommentArray containing the deleted elements. + */ + splice(...args) { + const { length } = this; + const ret = super.splice(...args); + let [begin, deleteCount, ...items] = args; + if (begin < 0) { + begin += length; + } + if (arguments.length === 1) { + deleteCount = length - begin; + } else { + deleteCount = Math.min(length - begin, deleteCount); + } + const { + length: item_length + } = items; + const offset = item_length - deleteCount; + const start = begin + deleteCount; + const count2 = length - start; + move_comments(this, this, start, count2, offset, true); + return ret; + } + /** + * Returns a shallow copy of a portion of an array into a new CommentArray object. + * Comments are copied to the appropriate positions in the new array. + * + * @param {...*} args Arguments passed to Array.prototype.slice + * @returns {CommentArray} A new CommentArray containing the extracted + * elements with their comments. + */ + slice(...args) { + const { length } = this; + const array = super.slice(...args); + if (!array.length) { + return new _CommentArray(); + } + let [begin, before2] = args; + if (before2 === UNDEFINED) { + before2 = length; + } else if (before2 < 0) { + before2 += length; + } + if (begin < 0) { + begin += length; + } else if (begin === UNDEFINED) { + begin = 0; + } + move_comments(array, this, begin, before2 - begin, -begin); + return array; + } + unshift(...items) { + const { length } = this; + const ret = super.unshift(...items); + const { + length: items_length + } = items; + if (items_length > 0) { + move_comments(this, this, 0, length, items_length, true); + } + return ret; + } + shift() { + const ret = super.shift(); + const { length } = this; + remove_comments(this, 0); + move_comments(this, this, 1, length, -1, true); + return ret; + } + reverse() { + super.reverse(); + reverse_comments(this); + return this; + } + pop() { + const ret = super.pop(); + remove_comments(this, this.length); + return ret; + } + concat(...items) { + let { length } = this; + const ret = super.concat(...items); + if (!items.length) { + return ret; + } + move_comments(ret, this, 0, this.length, 0); + items.forEach((item) => { + const prev = length; + length += Array.isArray(item) ? item.length : 1; + if (!(item instanceof _CommentArray)) { + return; + } + move_comments(ret, item, 0, item.length, prev); + }); + return ret; + } + sort(...args) { + const result2 = sort( + this, + ...args.slice(0, 1) + ); + const map4 = /* @__PURE__ */ Object.create(null); + result2.forEach((source_index, index4) => { + if (source_index === index4) { + return; + } + const real_source_index = get_mapped(map4, source_index); + if (real_source_index === index4) { + return; + } + map4[index4] = real_source_index; + swap_comments(this, index4, real_source_index); + }); + return this; + } + }; + module5.exports = { + CommentArray + }; + } +}); + +// node_modules/comment-json/src/parse.js +var require_parse3 = __commonJS({ + "node_modules/comment-json/src/parse.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var esprima = require_esprima(); + var { + CommentArray + } = require_array(); + var { + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER, + PREFIX_BEFORE_ALL, + PREFIX_AFTER_ALL, + BRACKET_OPEN, + BRACKET_CLOSE, + CURLY_BRACKET_OPEN, + CURLY_BRACKET_CLOSE, + COLON, + COMMA, + MINUS, + EMPTY, + UNDEFINED, + is_object, + define: define2, + set_raw_string_literal, + set_comment_line_breaks, + assign_non_prop_comments + } = require_common6(); + var tokenize = (code) => esprima.tokenize(code, { + comment: true, + loc: true + }); + var current_code; + var previous_hosts = []; + var comments_host = null; + var unassigned_comments = null; + var previous_props = []; + var last_prop; + var remove_comments = false; + var inline = false; + var tokens = null; + var last2 = null; + var current = null; + var index4; + var reviver = null; + var clean = () => { + current_code = UNDEFINED; + previous_props.length = previous_hosts.length = 0; + last2 = null; + last_prop = UNDEFINED; + }; + var free = () => { + clean(); + tokens.length = 0; + unassigned_comments = comments_host = tokens = last2 = current = reviver = null; + current_code = UNDEFINED; + }; + var symbolFor = (prefix) => Symbol.for( + last_prop !== UNDEFINED ? prefix + COLON + last_prop : prefix + ); + var transform2 = (k6, { value: value2, context: context2 = {} }) => reviver ? reviver(k6, value2, context2) : value2; + var unexpected = () => { + const error2 = new SyntaxError(`Unexpected token '${current.value.slice(0, 1)}', "${current_code}" is not valid JSON`); + Object.assign(error2, current.loc.start); + free(); + throw error2; + }; + var unexpected_end = () => { + const error2 = new SyntaxError("Unexpected end of JSON input"); + Object.assign(error2, last2 ? last2.loc.end : { + line: 1, + column: 0 + }); + free(); + throw error2; + }; + var next = () => { + const new_token = tokens[++index4]; + inline = current && new_token && current.loc.end.line === new_token.loc.start.line || false; + last2 = current; + current = new_token; + }; + var type3 = () => { + if (!current) { + unexpected_end(); + } + return current.type === "Punctuator" ? current.value : current.type; + }; + var is = (t8) => type3() === t8; + var expect = (a7) => { + if (!is(a7)) { + unexpected(); + } + }; + var set_comments_host = (new_host) => { + previous_hosts.push(comments_host); + comments_host = new_host; + }; + var restore_comments_host = () => { + comments_host = previous_hosts.pop(); + }; + var assign_after_comments = () => { + if (!unassigned_comments) { + return; + } + const after_comments = []; + for (const comment of unassigned_comments) { + if (comment.inline) { + after_comments.push(comment); + } else { + break; + } + } + const { length } = after_comments; + if (!length) { + return; + } + if (length === unassigned_comments.length) { + unassigned_comments = null; + } else { + unassigned_comments.splice(0, length); + } + define2(comments_host, symbolFor(PREFIX_AFTER), after_comments); + }; + var assign_comments = (prefix) => { + if (!unassigned_comments) { + return; + } + define2(comments_host, symbolFor(prefix), unassigned_comments); + unassigned_comments = null; + }; + var parse_comments = (prefix) => { + const comments = []; + while (current && (is("LineComment") || is("BlockComment"))) { + const comment = { + ...current, + inline + }; + const previous_line = last2 ? last2.loc.end.line : 1; + set_comment_line_breaks( + comment, + Math.max(0, comment.loc.start.line - previous_line) + ); + comments.push(comment); + next(); + } + const { length } = comments; + if (length) { + const comment = comments[length - 1]; + const current_line = current ? current.loc.start.line : comment.loc.end.line; + set_comment_line_breaks( + comment, + void 0, + Math.max(0, current_line - comment.loc.end.line) + ); + } + if (remove_comments) { + return; + } + if (!length) { + return; + } + if (prefix) { + define2(comments_host, symbolFor(prefix), comments); + return; + } + unassigned_comments = comments; + }; + var set_prop = (prop, push4) => { + if (push4) { + previous_props.push(last_prop); + } + last_prop = prop; + }; + var restore_prop = () => { + last_prop = previous_props.pop(); + }; + var parse_object = () => { + const obj = {}; + set_comments_host(obj); + set_prop(UNDEFINED, true); + let started = false; + let name2; + parse_comments(); + while (!is(CURLY_BRACKET_CLOSE)) { + if (started) { + assign_comments(PREFIX_AFTER_VALUE); + expect(COMMA); + next(); + parse_comments(); + assign_after_comments(); + if (is(CURLY_BRACKET_CLOSE)) { + break; + } + } + started = true; + expect("String"); + name2 = JSON.parse(current.value); + set_prop(name2); + assign_comments(PREFIX_BEFORE); + next(); + parse_comments(PREFIX_AFTER_PROP); + expect(COLON); + next(); + parse_comments(PREFIX_AFTER_COLON); + obj[name2] = transform2(name2, walk()); + parse_comments(); + } + if (started) { + assign_comments(PREFIX_AFTER); + } + next(); + last_prop = void 0; + if (!started) { + assign_comments(PREFIX_BEFORE); + } + restore_comments_host(); + restore_prop(); + return obj; + }; + var parse_array = () => { + const array = new CommentArray(); + set_comments_host(array); + set_prop(UNDEFINED, true); + let started = false; + let i7 = 0; + parse_comments(); + while (!is(BRACKET_CLOSE)) { + if (started) { + assign_comments(PREFIX_AFTER_VALUE); + expect(COMMA); + next(); + parse_comments(); + assign_after_comments(); + if (is(BRACKET_CLOSE)) { + break; + } + } + started = true; + set_prop(i7); + assign_comments(PREFIX_BEFORE); + array[i7] = transform2(i7, walk()); + i7++; + parse_comments(); + } + if (started) { + assign_comments(PREFIX_AFTER); + } + next(); + last_prop = void 0; + if (!started) { + assign_comments(PREFIX_BEFORE); + } + restore_comments_host(); + restore_prop(); + return array; + }; + function walk() { + let tt3 = type3(); + if (tt3 === CURLY_BRACKET_OPEN) { + next(); + return { + value: parse_object() + }; + } + if (tt3 === BRACKET_OPEN) { + next(); + return { + value: parse_array() + }; + } + let negative = EMPTY; + if (tt3 === MINUS) { + next(); + tt3 = type3(); + negative = MINUS; + } + let v8; + let source; + switch (tt3) { + case "String": + set_raw_string_literal(comments_host, last_prop, current.value); + case "Boolean": + case "Null": + case "Numeric": + v8 = current.value; + next(); + source = negative + v8; + return { + value: JSON.parse(source), + context: { + source + } + }; + default: + return {}; + } + } + var parse17 = (code, rev, no_comments) => { + clean(); + current_code = code; + tokens = tokenize(code); + reviver = rev; + remove_comments = no_comments; + if (!tokens.length) { + unexpected_end(); + } + index4 = -1; + next(); + set_comments_host({}); + parse_comments(PREFIX_BEFORE_ALL); + const final = walk(); + parse_comments(PREFIX_AFTER_ALL); + if (current) { + unexpected(); + } + let result2 = transform2("", final); + if (!no_comments && result2 !== null) { + if (!is_object(result2)) { + result2 = new Object(result2); + } + assign_non_prop_comments(result2, comments_host); + } + restore_comments_host(); + free(); + return result2; + }; + module5.exports = { + parse: parse17, + tokenize + }; + } +}); + +// node_modules/comment-json/src/stringify.js +var require_stringify = __commonJS({ + "node_modules/comment-json/src/stringify.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var { + PREFIX_BEFORE_ALL, + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER, + PREFIX_AFTER_ALL, + BRACKET_OPEN, + BRACKET_CLOSE, + CURLY_BRACKET_OPEN, + CURLY_BRACKET_CLOSE, + COLON, + COMMA, + EMPTY, + UNDEFINED, + is_string, + is_number, + is_object, + get_raw_string_literal, + get_comment_line_breaks_before, + get_comment_line_breaks_after, + is_raw_json + } = require_common6(); + var SPACE = " "; + var LF = "\n"; + var STR_NULL = "null"; + var BEFORE = (prop) => `${PREFIX_BEFORE}:${prop}`; + var AFTER_PROP = (prop) => `${PREFIX_AFTER_PROP}:${prop}`; + var AFTER_COLON = (prop) => `${PREFIX_AFTER_COLON}:${prop}`; + var AFTER_VALUE = (prop) => `${PREFIX_AFTER_VALUE}:${prop}`; + var AFTER = (prop) => `${PREFIX_AFTER}:${prop}`; + var quote = JSON.stringify; + var comment_stringify = (value2, line) => line ? `//${value2}` : `/*${value2}*/`; + var repeat_line_breaks = (line_breaks, gap) => (LF + gap).repeat(line_breaks); + var read_line_breaks = (line_breaks) => is_number(line_breaks) && line_breaks >= 0 ? line_breaks : null; + var read_line_breaks_from_loc = (previous_comment, comment) => { + if (!previous_comment || !previous_comment.loc || !comment.loc) { + return null; + } + const { end } = previous_comment.loc; + const { start } = comment.loc; + if (!end || !start || !is_number(end.line) || !is_number(start.line)) { + return null; + } + const line_breaks = start.line - end.line; + return line_breaks >= 0 ? line_breaks : null; + }; + var count_trailing_line_breaks = (str2, gap) => { + const unit = LF + gap; + const { length } = unit; + let i7 = str2.length; + let count2 = 0; + while (i7 >= length && str2.slice(i7 - length, i7) === unit) { + i7 -= length; + count2++; + } + return count2; + }; + var process_comments = (host, symbol_tag, deeper_gap, display_block) => { + const comments = host[Symbol.for(symbol_tag)]; + if (!comments || !comments.length) { + return EMPTY; + } + let str2 = EMPTY; + let last_comment = null; + comments.forEach((comment, i7) => { + const { + inline, + type: type3, + value: value2 + } = comment; + let line_breaks_before = read_line_breaks( + get_comment_line_breaks_before(comment) + ); + if (line_breaks_before === null) { + line_breaks_before = read_line_breaks_from_loc(last_comment, comment); + } + if (line_breaks_before === null) { + line_breaks_before = inline ? 0 : 1; + } + const delimiter2 = line_breaks_before > 0 ? repeat_line_breaks(line_breaks_before, deeper_gap) : inline ? SPACE : i7 === 0 ? EMPTY : LF + deeper_gap; + const is_line_comment = type3 === "LineComment"; + str2 += delimiter2 + comment_stringify(value2, is_line_comment); + last_comment = comment; + }); + const default_line_breaks_after = display_block || last_comment.type === "LineComment" ? 1 : 0; + const line_breaks_after = Math.max( + default_line_breaks_after, + read_line_breaks(get_comment_line_breaks_after(last_comment)) || 0 + ); + return str2 + repeat_line_breaks(line_breaks_after, deeper_gap); + }; + var replacer = null; + var indent = EMPTY; + var clean = () => { + replacer = null; + indent = EMPTY; + }; + var join3 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + repeat_line_breaks( + Math.max(1, count_trailing_line_breaks(one, gap)), + gap + ) : two ? two.trimRight() + repeat_line_breaks( + Math.max(1, count_trailing_line_breaks(two, gap)), + gap + ) : EMPTY; + var join_content = (inside, value2, gap) => { + const comment = process_comments(value2, PREFIX_BEFORE, gap + indent, true); + return join3(comment, inside, gap); + }; + var stringify_string = (holder, key, value2) => { + const raw = get_raw_string_literal(holder, key); + if (is_string(raw)) { + try { + if (JSON.parse(raw) === value2) { + return raw; + } + } catch (e10) { + } + } + return quote(value2); + }; + var array_stringify = (value2, gap) => { + const deeper_gap = gap + indent; + const { length } = value2; + let inside = EMPTY; + let after_comma = EMPTY; + for (let i7 = 0; i7 < length; i7++) { + if (i7 !== 0) { + inside += COMMA; + } + const before2 = join3( + after_comma, + process_comments(value2, BEFORE(i7), deeper_gap), + deeper_gap + ); + inside += before2 || LF + deeper_gap; + inside += stringify5(i7, value2, deeper_gap) || STR_NULL; + inside += process_comments(value2, AFTER_VALUE(i7), deeper_gap); + after_comma = process_comments(value2, AFTER(i7), deeper_gap); + } + inside += join3( + after_comma, + process_comments(value2, PREFIX_AFTER, deeper_gap), + deeper_gap + ); + return BRACKET_OPEN + join_content(inside, value2, gap) + BRACKET_CLOSE; + }; + var object_stringify = (value2, gap) => { + if (!value2) { + return "null"; + } + const deeper_gap = gap + indent; + let inside = EMPTY; + let after_comma = EMPTY; + let first = true; + const keys2 = Array.isArray(replacer) ? replacer : Object.keys(value2); + const iteratee2 = (key) => { + const sv = stringify5(key, value2, deeper_gap); + if (sv === UNDEFINED) { + return; + } + if (!first) { + inside += COMMA; + } + first = false; + const before2 = join3( + after_comma, + process_comments(value2, BEFORE(key), deeper_gap), + deeper_gap + ); + inside += before2 || LF + deeper_gap; + inside += quote(key) + process_comments(value2, AFTER_PROP(key), deeper_gap) + COLON + process_comments(value2, AFTER_COLON(key), deeper_gap) + SPACE + sv + process_comments(value2, AFTER_VALUE(key), deeper_gap); + after_comma = process_comments(value2, AFTER(key), deeper_gap); + }; + keys2.forEach(iteratee2); + inside += join3( + after_comma, + process_comments(value2, PREFIX_AFTER, deeper_gap), + deeper_gap + ); + return CURLY_BRACKET_OPEN + join_content(inside, value2, gap) + CURLY_BRACKET_CLOSE; + }; + function stringify5(key, holder, gap) { + let value2 = holder[key]; + if (is_object(value2) && typeof value2.toJSON === "function") { + value2 = value2.toJSON(key); + } + if (typeof replacer === "function") { + value2 = replacer.call(holder, key, value2); + } + switch (typeof value2) { + case "string": + return stringify_string(holder, key, value2); + case "number": + return Number.isFinite(value2) ? String(value2) : STR_NULL; + case "boolean": + case "null": + return String(value2); + case "object": + if (is_raw_json(value2)) { + return value2.rawJSON; + } + return Array.isArray(value2) ? array_stringify(value2, gap) : object_stringify(value2, gap); + default: + } + } + var get_indent = (space) => typeof space === "string" ? space : typeof space === "number" ? SPACE.repeat(space) : EMPTY; + var { toString: toString3 } = Object.prototype; + var PRIMITIVE_OBJECT_TYPES = [ + "[object Number]", + "[object String]", + "[object Boolean]" + ]; + var is_primitive_object = (subject) => { + if (typeof subject !== "object") { + return false; + } + const str2 = toString3.call(subject); + return PRIMITIVE_OBJECT_TYPES.includes(str2); + }; + module5.exports = (value2, replacer_, space) => { + const indent_ = get_indent(space); + if (!indent_) { + return JSON.stringify(value2, replacer_); + } + if (typeof replacer_ !== "function" && !Array.isArray(replacer_)) { + replacer_ = null; + } + replacer = replacer_; + indent = indent_; + const str2 = is_primitive_object(value2) ? JSON.stringify(value2) : stringify5("", { "": value2 }, EMPTY); + clean(); + return is_object(value2) ? process_comments(value2, PREFIX_BEFORE_ALL, EMPTY, true).trimLeft() + str2 + process_comments(value2, PREFIX_AFTER_ALL, EMPTY).trimRight() : str2; + }; + } +}); + +// node_modules/comment-json/src/index.js +var require_src7 = __commonJS({ + "node_modules/comment-json/src/index.js"(exports28, module5) { + init_dirname(); + init_buffer2(); + init_process2(); + var { parse: parse17, tokenize } = require_parse3(); + var stringify5 = require_stringify(); + var { CommentArray } = require_array(); + var { + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER, + PREFIX_BEFORE_ALL, + PREFIX_AFTER_ALL, + assign: assign3, + moveComments, + removeComments + } = require_common6(); + module5.exports = { + PREFIX_BEFORE, + PREFIX_AFTER_PROP, + PREFIX_AFTER_COLON, + PREFIX_AFTER_VALUE, + PREFIX_AFTER, + PREFIX_BEFORE_ALL, + PREFIX_AFTER_ALL, + parse: parse17, + stringify: stringify5, + tokenize, + CommentArray, + assign: assign3, + moveComments, + removeComments + }; + } +}); + +// src/browser/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/browser/generate.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_browser(); + +// node_modules/@readme/openapi-parser/dist/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// src/browser/shims/json-schema-ref-parser.ts +init_dirname(); +init_buffer2(); +init_process2(); +function resolvePointer(schema8, pointer) { + if (!pointer.startsWith("#/")) { + return void 0; + } + const parts = pointer.slice(2).split("/").map( + (p7) => ( + // Decode JSON pointer escape sequences + p7.replace(/~1/g, "/").replace(/~0/g, "~") + ) + ); + let current = schema8; + for (const part of parts) { + if (current === void 0 || current === null) { + return void 0; + } + current = current[part]; + } + return current; +} +function dereferenceInternalImpl(schema8, root2, visited = /* @__PURE__ */ new Set()) { + if (schema8 === null || typeof schema8 !== "object") { + return schema8; + } + if (Array.isArray(schema8)) { + return schema8.map((item) => dereferenceInternalImpl(item, root2, visited)); + } + if (schema8.$ref && typeof schema8.$ref === "string" && schema8.$ref.startsWith("#/")) { + const refPath = schema8.$ref; + if (visited.has(refPath)) { + return { ...schema8 }; + } + const resolved = resolvePointer(root2, refPath); + if (resolved !== void 0) { + visited.add(refPath); + const dereferenced = dereferenceInternalImpl(resolved, root2, visited); + visited.delete(refPath); + return dereferenced; + } + } + const result2 = {}; + for (const [key, value2] of Object.entries(schema8)) { + result2[key] = dereferenceInternalImpl(value2, root2, visited); + } + return result2; +} +async function dereference(_basePathOrSchema, schemaOrOptions, _options) { + const schema8 = typeof _basePathOrSchema === "object" ? _basePathOrSchema : schemaOrOptions ?? {}; + return dereferenceInternalImpl(schema8, schema8); +} +function $RefParser() { + this.schema = {}; + this.$refs = { + circular: false, + paths: () => [], + values: () => ({}), + get: () => void 0 + }; +} +$RefParser.prototype.parse = async function(schema8, _options) { + if (typeof schema8 === "string") { + try { + this.schema = JSON.parse(schema8); + } catch { + this.schema = {}; + } + } else { + this.schema = schema8; + } + return this.schema; +}; +$RefParser.prototype.resolve = async function(schema8, _options) { + await this.parse(schema8, _options); + return this; +}; +$RefParser.prototype.bundle = async function(schema8, _options) { + await this.parse(schema8, _options); + return this.schema; +}; +$RefParser.prototype.dereference = async function(schema8, _options) { + await this.parse(schema8, _options); + return this.schema; +}; +function getJsonSchemaRefParserDefaultOptions() { + return { + parse: { + json: { order: 100 }, + yaml: { order: 200 }, + text: { order: 300 }, + binary: { order: 400 } + }, + resolve: { + file: { order: 100 }, + http: { order: 200 }, + external: true + }, + dereference: { + circular: true, + excludedPathMatcher: () => false + }, + continueOnError: false + }; +} +function Options(options) { + const defaults2 = getJsonSchemaRefParserDefaultOptions(); + Object.assign(this, defaults2); + if (options) { + Object.assign(this, options); + } +} +Options.prototype = {}; + +// node_modules/@readme/openapi-parser/dist/index.js +var import_better_ajv_errors = __toESM(require_lib3(), 1); +var import__ = __toESM(require__(), 1); +var import_ajv_draft_04 = __toESM(require_dist(), 1); +var supportedHTTPMethods = ["get", "post", "put", "delete", "patch", "options", "head", "trace"]; +function isOpenAPI(schema8) { + return "openapi" in schema8 && schema8.openapi !== void 0; +} +function fixServers(server, path2) { + if (server && "url" in server && server.url && server.url.startsWith("/")) { + try { + const inUrl = new URL(path2); + server.url = `${inUrl.protocol}//${inUrl.hostname}${server.url}`; + } catch { + } + } +} +function fixOasRelativeServers(schema8, filePath) { + if (!schema8 || !isOpenAPI(schema8) || !filePath || !filePath.startsWith("http:") && !filePath.startsWith("https:")) { + return; + } + if (schema8.servers) { + schema8.servers.map((server) => fixServers(server, filePath)); + } + ["paths", "webhooks"].forEach((component) => { + if (component in schema8) { + const schemaElement = schema8.paths || {}; + Object.keys(schemaElement).forEach((path2) => { + const pathItem = schemaElement[path2] || {}; + Object.keys(pathItem).forEach((opItem) => { + const pathItemElement = pathItem[opItem]; + if (!pathItemElement) { + return; + } + if (opItem === "servers" && Array.isArray(pathItemElement)) { + pathItemElement.forEach((server) => { + fixServers(server, filePath); + }); + return; + } + if (supportedHTTPMethods.includes(opItem) && typeof pathItemElement === "object" && "servers" in pathItemElement && Array.isArray(pathItemElement.servers)) { + pathItemElement.servers.forEach((server) => { + fixServers(server, filePath); + }); + } + }); + }); + } + }); +} +function repairSchema(schema8, filePath) { + if (isOpenAPI(schema8)) { + fixOasRelativeServers(schema8, filePath); + } +} +function normalizeArguments(api) { + return { + path: typeof api === "string" ? api : "", + schema: typeof api === "object" ? api : void 0 + }; +} +function convertOptionsForParser(options) { + const parserOptions = getJsonSchemaRefParserDefaultOptions(); + return { + ...parserOptions, + dereference: { + ...parserOptions.dereference, + circular: options?.dereference && "circular" in options.dereference ? options.dereference.circular : parserOptions.dereference.circular, + onCircular: options?.dereference?.onCircular || parserOptions.dereference.onCircular, + onDereference: options?.dereference?.onDereference || parserOptions.dereference.onDereference, + // OpenAPI 3.1 allows for `summary` and `description` properties at the same level as a `$ref` + // pointer to be preserved when that `$ref` pointer is dereferenced. The default behavior of + // `json-schema-ref-parser` is to discard these properties but this option allows us to + // override that behavior. + preservedProperties: ["summary", "description"] + }, + resolve: { + ...parserOptions.resolve, + external: options?.resolve && "external" in options.resolve ? options.resolve.external : parserOptions.resolve.external, + file: options?.resolve && "file" in options.resolve ? options.resolve.file : parserOptions.resolve.file, + http: { + ...typeof parserOptions.resolve.http === "object" ? parserOptions.resolve.http : {}, + timeout: options?.resolve?.http && "timeout" in options.resolve.http ? options.resolve.http.timeout : 5e3 + } + }, + timeoutMs: options?.timeoutMs + }; +} +async function parse2(api, options) { + const args = normalizeArguments(api); + const parserOptions = convertOptionsForParser(options); + const parser3 = new $RefParser(); + const schema8 = await parser3.parse(args.path, args.schema, parserOptions); + repairSchema(schema8, args.path); + return schema8; +} +async function dereference2(api, options) { + const args = normalizeArguments(api); + const parserOptions = convertOptionsForParser(options); + const parser3 = new $RefParser(); + await parser3.dereference(args.path, args.schema, parserOptions); + repairSchema(parser3.schema, args.path); + return parser3.schema; +} + +// src/codegen/errors.ts +init_dirname(); +init_buffer2(); +init_process2(); +var import_picocolors = __toESM(require_picocolors_browser()); +var CodegenError = class _CodegenError extends Error { + constructor({ type: type3, message, help, details }) { + super(message); + __publicField(this, "type"); + __publicField(this, "help"); + __publicField(this, "details"); + this.name = "CodegenError"; + this.type = type3; + this.help = help; + this.details = details; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, _CodegenError); + } + } + /** + * Format the error message for display to users + * @param useColors Whether to use colored output + */ + format(useColors = true) { + const c7 = useColors ? import_picocolors.default : { + red: (s7) => s7, + yellow: (s7) => s7, + cyan: (s7) => s7, + dim: (s7) => s7, + bold: (s7) => s7 + }; + let output = ` +${c7.red(c7.bold("Error:"))} ${this.message}`; + if (this.details) { + output += ` + +${c7.yellow("Details:")} +${c7.dim(this.details)}`; + } + if (this.help) { + output += ` + +${c7.cyan("How to fix:")} +${this.help}`; + } + return output; + } +}; +function createInvalidPresetError(options) { + const { preset, language } = options; + const validPresets = [ + "payloads", + "parameters", + "headers", + "types", + "channels", + "client", + "models", + "custom" + ]; + const presetList = validPresets.map((p7) => ` - ${p7}`).join("\n"); + return new CodegenError({ + type: "INVALID_PRESET" /* INVALID_PRESET */, + message: `Invalid preset '${preset}' for language '${language}'`, + details: `Valid presets are: +${presetList}`, + help: `Update your configuration to use a valid preset. +For more information, visit: https://the-codegen-project.org/docs/generators` + }); +} +function createConfigValidationError(options) { + const { validationErrors } = options; + return new CodegenError({ + type: "CONFIG_VALIDATION_ERROR" /* CONFIG_VALIDATION_ERROR */, + message: "Configuration validation failed", + details: validationErrors.join("\n"), + help: `Review and fix the validation errors in your configuration file. +For more information, visit: https://the-codegen-project.org/docs/configurations/` + }); +} +function createInputDocumentError(options) { + const { inputPath, inputType, errorMessage } = options; + return new CodegenError({ + type: "INPUT_DOCUMENT_ERROR" /* INPUT_DOCUMENT_ERROR */, + message: `Failed to load ${inputType} document: ${inputPath}`, + details: errorMessage, + help: `Check that the input file exists and is a valid ${inputPath.endsWith(".json") ? "JSON" : "YAML"} file. +Ensure the document conforms to the ${inputType} specification.` + }); +} +function createUnsupportedLanguageError(options) { + const { preset, language } = options; + return new CodegenError({ + type: "UNSUPPORTED_LANGUAGE" /* UNSUPPORTED_LANGUAGE */, + message: `Language '${language}' is not supported for the '${preset}' preset`, + details: `Currently only 'typescript' is supported.`, + help: `Change the 'language' field in your configuration to 'typescript'. +For more information: https://the-codegen-project.org/docs/configurations` + }); +} +function createMissingInputDocumentError(options) { + const { expectedType, generatorPreset } = options; + const presetContext = generatorPreset ? ` for the '${generatorPreset}' generator` : ""; + return new CodegenError({ + type: "MISSING_INPUT_DOCUMENT" /* MISSING_INPUT_DOCUMENT */, + message: `Expected ${expectedType} document${presetContext}, but none was provided`, + help: `1. Ensure your configuration has 'inputType: "${expectedType}"' +2. Verify 'inputPath' points to a valid ${expectedType} document +3. Check the document exists and is readable + +For more information: https://the-codegen-project.org/docs/inputs/${expectedType}` + }); +} +function createMissingPayloadError(options) { + const { channelOrOperation, protocol } = options; + const protocolContext = protocol ? ` for ${protocol}` : ""; + return new CodegenError({ + type: "MISSING_PAYLOAD" /* MISSING_PAYLOAD */, + message: `Could not find payload for '${channelOrOperation}'${protocolContext}`, + help: `1. Ensure the 'payloads' generator is configured before 'channels' +2. Check that your spec defines message payloads for this channel +3. Verify the channel/operation name matches the spec + +For more information: https://the-codegen-project.org/docs/generators/channels` + }); +} +function createMissingParameterError(options) { + const { channelOrOperation, protocol } = options; + const protocolContext = protocol ? ` for ${protocol}` : ""; + return new CodegenError({ + type: "MISSING_PARAMETER" /* MISSING_PARAMETER */, + message: `Could not find parameter for '${channelOrOperation}'${protocolContext}`, + help: `1. Ensure the 'parameters' generator is configured before 'channels' +2. Check that your spec defines parameters for this channel +3. Verify the channel/operation name matches the spec + +For more information: https://the-codegen-project.org/docs/generators/channels` + }); +} +function createCircularDependencyError(options) { + const generatorIds = options?.generatorIds; + const idsContext = generatorIds?.length ? ` +Involved generators: ${generatorIds.join(", ")}` : ""; + return new CodegenError({ + type: "CIRCULAR_DEPENDENCY" /* CIRCULAR_DEPENDENCY */, + message: `Circular dependency detected in generator configuration${idsContext}`, + help: `Review the 'dependencies' field in your generators to remove circular references. +Generators are executed in dependency order - ensure there's no A->B->A cycle. + +For more information: https://the-codegen-project.org/docs/configurations` + }); +} +function createDuplicateGeneratorIdError(options) { + const { duplicateIds } = options; + return new CodegenError({ + type: "DUPLICATE_GENERATOR_ID" /* DUPLICATE_GENERATOR_ID */, + message: `Duplicate generator IDs found: ${duplicateIds.join(", ")}`, + help: `Each generator must have a unique 'id'. Either: +1. Remove duplicate generators +2. Give each generator a unique 'id' field + +For more information: https://the-codegen-project.org/docs/configurations` + }); +} +function createUnsupportedPresetForInputError(options) { + const { preset, inputType, supportedPresets } = options; + return new CodegenError({ + type: "UNSUPPORTED_PRESET_FOR_INPUT" /* UNSUPPORTED_PRESET_FOR_INPUT */, + message: `Preset '${preset}' is not supported with '${inputType}' input`, + details: `Supported presets for ${inputType}: ${supportedPresets.join(", ")}`, + help: `Change your generator to use a supported preset, or change your input type. + +For more information: https://the-codegen-project.org/docs/generators` + }); +} +function createMissingDependencyOutputError(options) { + const { generatorPreset, dependencyName } = options; + return new CodegenError({ + type: "GENERATOR_ERROR" /* GENERATOR_ERROR */, + message: `Internal error: Missing dependency output '${dependencyName}' for '${generatorPreset}' generator`, + help: `This is likely a bug. Please report it at: https://github.com/the-codegen-project/cli/issues` + }); +} +function parseZodErrors(zodError) { + const errors = []; + if (zodError.issues) { + for (const error2 of zodError.issues) { + const path2 = error2.path.join("."); + const message = error2.message; + if (error2.code === "invalid_union_discriminator") { + const expected = error2.options?.join("' | '") || ""; + errors.push(`Invalid value at "${path2}". Expected: '${expected}'`); + } else if (error2.code === "invalid_type") { + errors.push( + `Invalid type at "${path2}". Expected ${error2.expected}, got ${error2.received}` + ); + } else if (error2.code === "invalid_literal") { + errors.push( + `Invalid value at "${path2}". Expected: '${error2.expected}'` + ); + } else { + errors.push(`${message} at "${path2}"`); + } + } + } + return errors; +} + +// src/browser/parser.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/browser/shims/asyncapi-parser.ts +init_dirname(); +init_buffer2(); +init_process2(); +var isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; +var ParserClass; +if (isBrowser) { + const browserBundle = (init_browser2(), __toCommonJS(browser_exports)); + if (typeof console !== "undefined" && console.debug) { + console.debug( + "[AsyncAPI Parser Shim] Bundle keys:", + Object.keys(browserBundle) + ); + console.debug( + "[AsyncAPI Parser Shim] Parser type:", + typeof browserBundle.Parser + ); + console.debug( + "[AsyncAPI Parser Shim] default type:", + typeof browserBundle.default + ); + if (browserBundle.default) { + console.debug( + "[AsyncAPI Parser Shim] default.Parser type:", + typeof browserBundle.default?.Parser + ); + } + } + ParserClass = browserBundle.Parser || browserBundle.default?.Parser || browserBundle.default; + if (!ParserClass || typeof ParserClass !== "function") { + console.error( + "AsyncAPI Parser browser bundle structure:", + Object.keys(browserBundle) + ); + console.error("Parser value:", browserBundle.Parser); + console.error("default value:", browserBundle.default); + throw new Error( + `Could not find Parser constructor in @asyncapi/parser/browser bundle. Parser type: ${typeof ParserClass}` + ); + } +} else { + const parserModule = (init_esm(), __toCommonJS(esm_exports)); + ParserClass = parserModule.Parser; +} +var Parser4 = ParserClass; + +// src/browser/parser.ts +var parser = new Parser4({ + ruleset: { + core: false, + recommended: false + } +}); +async function loadAsyncapiFromMemoryBrowser(input) { + const result2 = await parser.parse(input); + const errors = result2.diagnostics?.filter( + (d7) => d7.severity === 0 + ); + if (errors && errors.length > 0) { + throw createInputDocumentError({ + inputPath: "memory", + inputType: "asyncapi", + errorMessage: JSON.stringify(errors, null, 2) + }); + } + if (!result2.document) { + throw createInputDocumentError({ + inputPath: "memory", + inputType: "asyncapi", + errorMessage: "Failed to parse AsyncAPI document" + }); + } + return result2.document; +} + +// src/codegen/inputs/jsonschema/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/jsonschema/parser.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/LoggingInterface.ts +init_dirname(); +init_buffer2(); +init_process2(); +var import_picocolors2 = __toESM(require_picocolors_browser()); +var LOG_LEVEL_PRIORITY = { + silent: 0, + error: 1, + warn: 2, + info: 3, + verbose: 4, + debug: 5 +}; +var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"]; +var LoggerClass = class { + constructor() { + __publicField(this, "logger"); + __publicField(this, "level", "info"); + __publicField(this, "jsonMode", false); + __publicField(this, "colorsEnabled", true); + __publicField(this, "spinner", null); + } + /** + * Check if a message at the given level should be logged + */ + shouldLog(messageLevel) { + return LOG_LEVEL_PRIORITY[messageLevel] <= LOG_LEVEL_PRIORITY[this.level] && !this.jsonMode; + } + /** + * Format a message with optional color + */ + formatMessage(message, colorFn) { + const msg = String(message); + if (this.colorsEnabled && colorFn) { + return colorFn(msg); + } + return msg; + } + /** + * Stop spinner before logging to prevent output overlap + */ + pauseSpinner() { + if (this.spinner?.interval) { + clearInterval(this.spinner.interval); + this.spinner.interval = null; + if (process.stdout.isTTY) { + process.stdout.clearLine(0); + process.stdout.cursorTo(0); + } + } + } + /** + * Resume spinner after logging + */ + resumeSpinner() { + if (this.spinner && !this.spinner.interval) { + this.renderSpinner(); + } + } + /** + * Render the spinner + */ + renderSpinner() { + if (!this.spinner || !process.stdout.isTTY) { + return; + } + this.spinner.interval = setInterval(() => { + if (!this.spinner) { + return; + } + const frame = this.colorsEnabled ? import_picocolors2.default.cyan(SPINNER_FRAMES[this.spinner.frameIndex]) : SPINNER_FRAMES[this.spinner.frameIndex]; + process.stdout.clearLine(0); + process.stdout.cursorTo(0); + process.stdout.write(`${frame} ${this.spinner.text}`); + this.spinner.frameIndex = (this.spinner.frameIndex + 1) % SPINNER_FRAMES.length; + }, 80); + } + debug(message, ...optionalParams) { + if (!this.shouldLog("debug")) { + return; + } + this.pauseSpinner(); + const prefix = this.formatMessage("[DEBUG] ", import_picocolors2.default.gray); + const formattedMessage = this.formatMessage(message, import_picocolors2.default.gray); + if (this.logger) { + this.logger.debug(prefix + formattedMessage, ...optionalParams); + } else { + console.debug(prefix + formattedMessage, ...optionalParams); + } + this.resumeSpinner(); + } + verbose(message, ...optionalParams) { + if (!this.shouldLog("verbose")) { + return; + } + this.pauseSpinner(); + const formattedMessage = this.formatMessage(message, import_picocolors2.default.dim); + if (this.logger) { + this.logger.info(formattedMessage, ...optionalParams); + } else { + console.log(formattedMessage, ...optionalParams); + } + this.resumeSpinner(); + } + info(message, ...optionalParams) { + if (!this.shouldLog("info")) { + return; + } + this.pauseSpinner(); + const msg = String(message); + if (this.logger) { + this.logger.info(msg, ...optionalParams); + } else { + const fullMsg = optionalParams.length > 0 ? `${msg} ${optionalParams.join(" ")} +` : `${msg} +`; + process.stdout.write(fullMsg); + } + this.resumeSpinner(); + } + warn(message, ...optionalParams) { + if (!this.shouldLog("warn")) { + return; + } + this.pauseSpinner(); + const formattedMessage = this.formatMessage(message, import_picocolors2.default.yellow); + if (this.logger) { + this.logger.warn(formattedMessage, ...optionalParams); + } else { + console.warn(formattedMessage, ...optionalParams); + } + this.resumeSpinner(); + } + error(message, ...optionalParams) { + if (!this.shouldLog("error")) { + return; + } + this.pauseSpinner(); + const formattedMessage = this.formatMessage(message, import_picocolors2.default.red); + if (this.logger) { + this.logger.error(formattedMessage, ...optionalParams); + } else { + console.error(formattedMessage, ...optionalParams); + } + this.resumeSpinner(); + } + /** + * Start a spinner with the given text + */ + startSpinner(text) { + if (this.jsonMode) { + return; + } + this.stopSpinner(); + this.spinner = { + text, + interval: null, + frameIndex: 0 + }; + if (process.stdout.isTTY) { + this.renderSpinner(); + } else { + console.log(text); + } + } + /** + * Update the spinner text + */ + updateSpinner(text) { + if (this.spinner) { + this.spinner.text = text; + } + } + /** + * Stop the spinner with a success message + */ + succeedSpinner(text) { + const spinnerText = this.spinner?.text; + this.stopSpinner(); + const displayText = text || spinnerText || ""; + if (displayText && this.shouldLog("info")) { + const symbol = this.colorsEnabled ? import_picocolors2.default.green("\u2713") : "[OK]"; + console.log(`${symbol} ${displayText}`); + } + } + /** + * Stop the spinner with a failure message + */ + failSpinner(text) { + const spinnerText = this.spinner?.text; + this.stopSpinner(); + const displayText = text || spinnerText || ""; + if (displayText && this.shouldLog("error")) { + const symbol = this.colorsEnabled ? import_picocolors2.default.red("\u2717") : "[FAIL]"; + console.log(`${symbol} ${displayText}`); + } + } + /** + * Stop the spinner without a message + */ + stopSpinner() { + if (this.spinner) { + if (this.spinner.interval) { + clearInterval(this.spinner.interval); + } + if (process.stdout.isTTY) { + process.stdout.clearLine(0); + process.stdout.cursorTo(0); + } + this.spinner = null; + } + } + /** + * Output structured JSON data + * Only outputs in JSON mode or when explicitly called + */ + json(data) { + this.stopSpinner(); + console.log(JSON.stringify(data, null, 2)); + } + /** + * Set the log level + */ + setLevel(level) { + this.level = level; + } + /** + * Enable or disable JSON mode + * In JSON mode, only json() output is shown + */ + setJsonMode(enabled) { + this.jsonMode = enabled; + if (enabled) { + this.stopSpinner(); + } + } + /** + * Enable or disable colored output + */ + setColors(enabled) { + this.colorsEnabled = enabled; + } + /** + * Get the current log level + */ + getLevel() { + return this.level; + } + /** + * Check if JSON mode is enabled + */ + isJsonMode() { + return this.jsonMode; + } + /** + * Sets the logger to use for the model generation library + * + * @param logger to add + */ + setLogger(logger) { + this.logger = logger; + } + /** + * Reset the logger to default state. + * Useful for testing or when re-initializing the logger. + */ + reset() { + this.stopSpinner(); + this.level = "info"; + this.jsonMode = false; + this.colorsEnabled = true; + this.logger = void 0; + } +}; +var Logger = new LoggerClass(); + +// src/codegen/inputs/jsonschema/parser.ts +init_fs(); +function loadJsonSchemaFromMemory(document2, documentPath) { + const path2 = documentPath || "memory"; + Logger.verbose(`Loading JSON Schema document from ${path2}`); + validateJsonSchemaDocument(document2, path2); + return document2; +} +function validateJsonSchemaDocument(document2, source) { + if (!document2 || typeof document2 !== "object") { + throw createInputDocumentError({ + inputPath: source, + inputType: "jsonschema", + errorMessage: "Document must be an object" + }); + } + if (document2.$schema && typeof document2.$schema !== "string") { + throw createInputDocumentError({ + inputPath: source, + inputType: "jsonschema", + errorMessage: "$schema must be a string" + }); + } + if (!document2.$schema) { + Logger.warn( + `JSON Schema document from ${source} does not specify a $schema version. Consider adding one for better validation.` + ); + } + const hasType = document2.type !== void 0; + const hasProperties = document2.properties !== void 0; + const hasDefinitions = document2.definitions !== void 0 || document2.$defs !== void 0; + if (!hasType && !hasProperties && !hasDefinitions) { + Logger.warn( + `JSON Schema document from ${source} appears to be empty or incomplete. It should have 'type', 'properties', 'definitions', or '$defs' for code generation.` + ); + } + Logger.debug(`Successfully validated JSON Schema document from ${source}`); +} + +// src/codegen/types.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/utils.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_process(); + +// src/codegen/generators/typescript/utils.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/AbstractDependencyManager.js +init_dirname(); +init_buffer2(); +init_process2(); +var AbstractDependencyManager = class { + constructor(dependencies = []) { + this.dependencies = dependencies; + } + /** + * Adds a dependency while ensuring that unique dependencies. + * + * @param dependency complete dependency string so it can be rendered as is. + */ + addDependency(dependency) { + if (!this.dependencies.includes(dependency)) { + this.dependencies.push(dependency); + } + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/AbstractGenerator.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/models/CommonModel.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/utils/guards.js +init_dirname(); +init_buffer2(); +init_process2(); +function isPresetWithOptions(preset) { + return Object.prototype.hasOwnProperty.call(preset, "preset"); +} + +// node_modules/@asyncapi/modelina/lib/esm/utils/LoggingInterface.js +init_dirname(); +init_buffer2(); +init_process2(); +var LoggerClass2 = class { + constructor() { + this.logger = void 0; + } + debug(message, ...optionalParams) { + if (this.logger) { + this.logger.debug(message, ...optionalParams); + } + } + info(message, ...optionalParams) { + if (this.logger) { + this.logger.info(message, ...optionalParams); + } + } + warn(message, ...optionalParams) { + if (this.logger) { + this.logger.warn(message, ...optionalParams); + } + } + error(message, ...optionalParams) { + if (this.logger) { + this.logger.error(message, ...optionalParams); + } + } + /** + * Sets the logger to use for the model generation library + * + * @param logger to add + */ + setLogger(logger) { + this.logger = logger; + } +}; +var Logger2 = new LoggerClass2(); + +// node_modules/@asyncapi/modelina/lib/esm/utils/Partials.js +init_dirname(); +init_buffer2(); +init_process2(); +function isClass(obj) { + const isCtorClass = obj.constructor && obj.constructor.toString().substring(0, 5) === "class"; + if (obj.prototype === void 0) { + return isCtorClass; + } + const isPrototypeCtorClass = obj.prototype.constructor && obj.prototype.constructor.toString && obj.prototype.constructor.toString().substring(0, 5) === "class"; + return isCtorClass || isPrototypeCtorClass; +} +function mergePartialAndDefault(defaultNonOptional, customOptional) { + var _a2; + if (customOptional === void 0) { + return Object.assign({}, defaultNonOptional); + } + const target = Object.assign({}, defaultNonOptional); + for (const [propName2, prop] of Object.entries(customOptional)) { + const isObjectOrClass = typeof prop === "object" && target[propName2] !== void 0; + const isRegularObject = !isClass(prop); + const isArray3 = Array.isArray(prop); + if (isArray3) { + target[propName2] = [...(_a2 = target[propName2]) !== null && _a2 !== void 0 ? _a2 : [], ...prop !== null && prop !== void 0 ? prop : []]; + } else if (isObjectOrClass && isRegularObject) { + target[propName2] = mergePartialAndDefault(target[propName2], prop); + } else if (prop) { + target[propName2] = prop; + } + } + return target; +} + +// node_modules/@asyncapi/modelina/lib/esm/models/CommonModel.js +var defaultMergingOptions = { + constrictModels: true +}; +var CommonModel = class _CommonModel { + /** + * Takes a deep copy of the input object and converts it to an instance of CommonModel. + * + * @param object to transform + * @returns CommonModel instance of the object + */ + static toCommonModel(object) { + const convertedSchema = _CommonModel.internalToSchema(object); + if (convertedSchema instanceof _CommonModel) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of CommonModel"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _CommonModel.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _CommonModel(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "originalInput" && propName2 !== "enum") { + if (propName2 === "properties" || propName2 === "patternProperties") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _CommonModel.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _CommonModel.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } + /** + * Retrieves data from originalInput by given key + * + * @param key given key + * @returns {any} + */ + getFromOriginalInput(key) { + const input = this.originalInput || {}; + if (typeof input === "boolean") { + return void 0; + } + return input[String(key)]; + } + /** + * Set the types of the model + * + * @param type + */ + setType(type3) { + if (Array.isArray(type3)) { + if (type3.length === 0) { + this.type = void 0; + return; + } else if (type3.length === 1) { + this.type = type3[0]; + return; + } + } + this.type = type3; + } + /** + * Removes type(s) from model type + * + * @param types + */ + removeType(typesToRemove) { + if (Array.isArray(typesToRemove)) { + for (const type3 of typesToRemove) { + this.removeType(type3); + } + } else if (this.type !== void 0 && this.type.includes(typesToRemove)) { + if (Array.isArray(this.type)) { + this.setType(this.type.filter((el) => { + return el !== typesToRemove; + })); + } else { + this.setType(void 0); + } + } + } + /** + * Adds types to the existing model types. + * + * Makes sure to only keep a single type incase of duplicates. + * + * @param types which types we should try and add to the existing output + */ + addTypes(types3) { + if (Array.isArray(types3)) { + for (const type3 of types3) { + this.addTypes(type3); + } + } else if (this.type === void 0) { + this.type = types3; + } else if (!Array.isArray(this.type) && this.type !== types3) { + this.type = [this.type, types3]; + } else if (Array.isArray(this.type) && !this.type.includes(types3)) { + this.type.push(types3); + } + } + /** + * Checks if given property name is required in object + * + * @param propertyName given property name + * @returns {boolean} + */ + isRequired(propertyName) { + if (this.required === void 0) { + return false; + } + return this.required.includes(propertyName); + } + /** + * Adds an item to the model. + * + * If items already exist the two are merged. + * + * @param itemModel + * @param originalInput corresponding input that got interpreted to this model + */ + addItem(itemModel, originalInput) { + if (this.items !== void 0) { + Logger2.warn(`While trying to add item to model ${this.$id}, duplicate items found. Merging models together to form a unified item model.`, itemModel, originalInput, this); + this.items = _CommonModel.mergeCommonModels(this.items, itemModel, originalInput); + } else { + this.items = itemModel; + } + } + /** + * Adds a tuple to the model. + * + * If a item already exist it will be merged. + * + * @param tupleModel + * @param originalInput corresponding input that got interpreted to this model + * @param index + */ + addItemTuple(tupleModel, originalInput, index4) { + let modelItems = this.items; + if (!Array.isArray(modelItems)) { + Logger2.warn("Trying to add item tuple to a non-tuple item, will drop existing item model", tupleModel, originalInput, index4); + modelItems = []; + } + const existingModelAtIndex = modelItems[Number(index4)]; + if (existingModelAtIndex !== void 0) { + Logger2.warn("Trying to add item tuple at index ${index} but it was already occupied, merging models", tupleModel, originalInput, index4); + modelItems[Number(index4)] = _CommonModel.mergeCommonModels(existingModelAtIndex, tupleModel, originalInput); + } else { + modelItems[Number(index4)] = tupleModel; + } + this.items = modelItems; + } + /** + * Adds a union model to the model. + * + * @param unionModel + */ + addItemUnion(unionModel) { + if (Array.isArray(this.union)) { + this.union.push(unionModel); + } else { + this.union = [unionModel]; + } + } + /** + * Add enum value to the model. + * + * Ensures no duplicates are added. + * + * @param enumValue + */ + addEnum(enumValue) { + if (this.enum === void 0) { + this.enum = []; + } + if (!this.enum.includes(enumValue)) { + this.enum.push(enumValue); + } + } + /** + * Remove enum from model. + * + * @param enumValue + */ + removeEnum(enumsToRemove) { + if (this.enum === void 0 || enumsToRemove === void 0) { + return; + } + if (Array.isArray(enumsToRemove)) { + for (const enumToRemove of enumsToRemove) { + this.removeEnum(enumToRemove); + } + return; + } + const filteredEnums = this.enum.filter((el) => { + return enumsToRemove !== el; + }); + if (filteredEnums.length === 0) { + this.enum = void 0; + } else { + this.enum = filteredEnums; + } + } + /** + * Adds a property to the model. + * If the property already exist the two are merged. + * + * @param propertyName + * @param propertyModel + * @param originalInput corresponding input that got interpreted to this model + */ + addProperty(propertyName, propertyModel, originalInput) { + if (this.properties === void 0) { + this.properties = {}; + } + if (this.properties[`${propertyName}`] !== void 0) { + Logger2.warn(`While trying to add property to model, duplicate properties found. Merging models together for property ${propertyName}`, propertyModel, originalInput, this); + this.properties[String(propertyName)] = _CommonModel.mergeCommonModels(this.properties[String(propertyName)], propertyModel, originalInput); + } else { + this.properties[String(propertyName)] = propertyModel; + } + } + /** + * Adds additionalProperty to the model. + * If another model already exist the two are merged. + * + * @param additionalPropertiesModel + * @param originalInput corresponding input that got interpreted to this model corresponding input that got interpreted to this model + */ + addAdditionalProperty(additionalPropertiesModel, originalInput) { + if (this.additionalProperties !== void 0) { + Logger2.warn("While trying to add additionalProperties to model, but it is already present, merging models together", additionalPropertiesModel, originalInput, this); + this.additionalProperties = _CommonModel.mergeCommonModels(this.additionalProperties, additionalPropertiesModel, originalInput); + } else { + this.additionalProperties = additionalPropertiesModel; + } + } + /** + * Adds a patternProperty to the model. + * If the pattern already exist the two models are merged. + * + * @param pattern + * @param patternModel + * @param originalInput corresponding input that got interpreted to this model + */ + addPatternProperty(pattern5, patternModel, originalInput) { + if (this.patternProperties === void 0) { + this.patternProperties = {}; + } + if (this.patternProperties[`${pattern5}`] !== void 0) { + Logger2.warn(`While trying to add patternProperty to model, duplicate patterns found. Merging pattern models together for pattern ${pattern5}`, patternModel, originalInput, this); + this.patternProperties[String(pattern5)] = _CommonModel.mergeCommonModels(this.patternProperties[String(pattern5)], patternModel, originalInput); + } else { + this.patternProperties[String(pattern5)] = patternModel; + } + } + /** + * Adds additionalItems to the model. + * If another model already exist the two are merged. + * + * @param additionalItemsModel + * @param originalInput corresponding input that got interpreted to this model + */ + addAdditionalItems(additionalItemsModel, originalInput) { + if (this.additionalItems !== void 0) { + Logger2.warn("While trying to add additionalItems to model, but it is already present, merging models together", additionalItemsModel, originalInput, this); + this.additionalItems = _CommonModel.mergeCommonModels(this.additionalItems, additionalItemsModel, originalInput); + } else { + this.additionalItems = additionalItemsModel; + } + } + /** + * Adds another model this model should extend. + * + * It is only allowed to extend if the other model have $id and is not already being extended. + * + * @param extendedModel + */ + addExtendedModel(extendedModel) { + var _a2, _b; + if (extendedModel.$id === void 0 || _CommonModel.idIncludesAnonymousSchema(extendedModel)) { + Logger2.error("Found no $id for allOf model and cannot extend the existing model, this should never happen.", this, extendedModel); + return; + } + if ((_a2 = this.extend) === null || _a2 === void 0 ? void 0 : _a2.find((commonModel) => commonModel.$id === extendedModel.$id)) { + Logger2.info(`${this.$id} model already extends model ${extendedModel.$id}.`, this, extendedModel); + return; + } + this.extend = (_b = this.extend) !== null && _b !== void 0 ? _b : []; + this.extend.push(extendedModel); + } + /** + * Returns true if the $id of a CommonModel includes anonymous_schema + * + * @param commonModel + */ + static idIncludesAnonymousSchema(commonModel) { + var _a2; + return (_a2 = commonModel.$id) === null || _a2 === void 0 ? void 0 : _a2.includes("anonymous_schema"); + } + /** + * Merge two common model properties together + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + static mergeProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + if (!mergeTo.properties) { + mergeTo.properties = mergeFrom.properties; + return; + } + if (!mergeFrom.properties) { + return; + } + mergeTo.properties = Object.assign({}, mergeTo.properties); + for (const [propName2, propValue] of Object.entries(mergeFrom.properties)) { + if (!mergeTo.properties[String(propName2)]) { + mergeTo.properties[String(propName2)] = propValue; + } else { + Logger2.warn(`Found duplicate properties ${propName2} for model. Model property from ${mergeFrom.$id || "unknown"} merged into ${mergeTo.$id || "unknown"}`, mergeTo, mergeFrom, originalInput); + const mergeToModel = _CommonModel.idIncludesAnonymousSchema(mergeTo.properties[String(propName2)]) ? _CommonModel.toCommonModel(mergeTo.properties[String(propName2)]) : mergeTo.properties[String(propName2)]; + const mergedModel = _CommonModel.mergeCommonModels(mergeToModel, propValue, originalInput, alreadyIteratedModels, options); + if (propValue.const) { + mergeTo.properties[String(propName2)] = _CommonModel.toCommonModel(mergedModel); + mergeTo.properties[String(propName2)].const = propValue.const; + } else { + mergeTo.properties[String(propName2)] = mergedModel; + } + } + } + } + /** + * Merge two common model additionalProperties together + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + static mergeAdditionalProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + const mergeToAdditionalProperties = mergeTo.additionalProperties; + const mergeFromAdditionalProperties = mergeFrom.additionalProperties; + if (mergeFromAdditionalProperties !== void 0) { + if (mergeToAdditionalProperties === void 0) { + mergeTo.additionalProperties = mergeFromAdditionalProperties; + } else { + Logger2.warn(`Found duplicate additionalProperties for model. additionalProperties from ${mergeFrom.$id || "unknown"} merged into ${mergeTo.$id || "unknown"}`, mergeTo, mergeFrom, originalInput); + mergeTo.additionalProperties = _CommonModel.mergeCommonModels(mergeToAdditionalProperties, mergeFromAdditionalProperties, originalInput, alreadyIteratedModels, options); + } + } + } + /** + * Merge two common model additionalItems together + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + static mergeAdditionalItems(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + const mergeToAdditionalItems = mergeTo.additionalItems; + const mergeFromAdditionalItems = mergeFrom.additionalItems; + if (mergeFromAdditionalItems !== void 0) { + if (mergeToAdditionalItems === void 0) { + mergeTo.additionalItems = mergeFromAdditionalItems; + } else { + Logger2.warn(`Found duplicate additionalItems for model. additionalItems from ${mergeFrom.$id || "unknown"} merged into ${mergeTo.$id || "unknown"}`, mergeTo, mergeFrom, originalInput); + mergeTo.additionalItems = _CommonModel.mergeCommonModels(mergeToAdditionalItems, mergeFromAdditionalItems, originalInput, alreadyIteratedModels, options); + } + } + } + /** + * Merge items together, prefer tuples over simple array since it is more strict. + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + static mergeItems(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + if (mergeFrom.items === void 0) { + return; + } + if (Array.isArray(mergeFrom.items) && mergeFrom.items.length === 0) { + return; + } + if (mergeTo.items === void 0) { + mergeTo.items = mergeFrom.items; + return; + } + const mergeToItems = mergeTo.items; + if (!Array.isArray(mergeFrom.items) && !Array.isArray(mergeToItems)) { + mergeTo.items = _CommonModel.mergeCommonModels(mergeToItems, mergeFrom.items, originalInput, alreadyIteratedModels, options); + } + if (Array.isArray(mergeFrom.items) && Array.isArray(mergeToItems)) { + for (const [index4, mergeFromTupleModel] of mergeFrom.items.entries()) { + mergeTo.items[Number(index4)] = _CommonModel.mergeCommonModels(mergeToItems[Number(index4)], mergeFromTupleModel, originalInput, alreadyIteratedModels, options); + } + } + if (Array.isArray(mergeFrom.items) && !Array.isArray(mergeToItems)) { + mergeTo.items = mergeFrom.items; + } + } + /** + * Merge two common model pattern properties together + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + static mergePatternProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + const mergeToPatternProperties = mergeTo.patternProperties; + const mergeFromPatternProperties = mergeFrom.patternProperties; + if (mergeFromPatternProperties !== void 0) { + if (mergeToPatternProperties === void 0) { + mergeTo.patternProperties = mergeFromPatternProperties; + } else { + for (const [pattern5, patternModel] of Object.entries(mergeFromPatternProperties)) { + if (mergeToPatternProperties[String(pattern5)] !== void 0) { + Logger2.warn(`Found duplicate pattern ${pattern5} for model. Model pattern for ${mergeFrom.$id || "unknown"} merged into ${mergeTo.$id || "unknown"}`, mergeTo, mergeFrom, originalInput); + mergeToPatternProperties[String(pattern5)] = _CommonModel.mergeCommonModels(mergeToPatternProperties[String(pattern5)], patternModel, originalInput, alreadyIteratedModels, options); + } else { + mergeToPatternProperties[String(pattern5)] = patternModel; + } + } + } + } + } + /** + * Merge types together + * + * @param mergeTo + * @param mergeFrom + */ + static mergeTypes(mergeTo, mergeFrom) { + const addToType = (type3) => { + if (mergeTo.type !== void 0 && !mergeTo.type.includes(type3)) { + if (Array.isArray(mergeTo.type)) { + mergeTo.type.push(type3); + } else { + mergeTo.type = [mergeTo.type, type3]; + } + } + }; + if (mergeFrom.type !== void 0) { + if (mergeTo.type === void 0) { + mergeTo.type = mergeFrom.type; + } else if (Array.isArray(mergeFrom.type)) { + for (const type3 of mergeFrom.type) { + addToType(type3); + } + } else { + addToType(mergeFrom.type); + } + } + } + /** + * Only merge if left side is undefined and right side is sat OR both sides are defined + * + * @param mergeTo + * @param mergeFrom + * @param originalInput corresponding input that got interpreted to this model + * @param alreadyIteratedModels + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + static mergeCommonModels(mergeTo, mergeFrom, originalInput, alreadyIteratedModels = /* @__PURE__ */ new Map(), options = defaultMergingOptions) { + if (mergeTo === void 0) { + return mergeFrom; + } + Logger2.debug(`Merging model ${mergeFrom.$id || "unknown"} into ${mergeTo.$id || "unknown"}`, mergeTo, mergeFrom, originalInput); + if (alreadyIteratedModels.has(mergeFrom)) { + return alreadyIteratedModels.get(mergeFrom); + } + alreadyIteratedModels.set(mergeFrom, mergeTo); + _CommonModel.mergeAdditionalProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels, options); + _CommonModel.mergePatternProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels, options); + _CommonModel.mergeAdditionalItems(mergeTo, mergeFrom, originalInput, alreadyIteratedModels, options); + _CommonModel.mergeProperties(mergeTo, mergeFrom, originalInput, alreadyIteratedModels, options); + _CommonModel.mergeItems(mergeTo, mergeFrom, originalInput, alreadyIteratedModels, options); + _CommonModel.mergeTypes(mergeTo, mergeFrom); + if (mergeFrom.enum !== void 0) { + mergeTo.enum = [.../* @__PURE__ */ new Set([...mergeTo.enum || [], ...mergeFrom.enum])]; + } + mergeTo.const = mergeTo.const || mergeFrom.const; + if (mergeFrom.required !== void 0 && options.constrictModels === true) { + mergeTo.required = [ + .../* @__PURE__ */ new Set([...mergeTo.required || [], ...mergeFrom.required]) + ]; + } + mergeTo.format = mergeTo.format || mergeFrom.format; + if (_CommonModel.idIncludesAnonymousSchema(mergeTo) && !_CommonModel.idIncludesAnonymousSchema(mergeFrom)) { + mergeTo.$id = mergeFrom.$id; + } else { + mergeTo.$id = mergeTo.$id || mergeFrom.$id; + } + mergeTo.extend = mergeTo.extend || mergeFrom.extend; + mergeTo.originalInput = originalInput; + return mergeTo; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/RenderOutput.js +init_dirname(); +init_buffer2(); +init_process2(); +var RenderOutput = class { + constructor(result2, renderedName, dependencies = []) { + this.result = result2; + this.renderedName = renderedName; + this.dependencies = dependencies; + } + static toRenderOutput(args) { + return new this(args.result, args.renderedName, args.dependencies); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/OutputModel.js +init_dirname(); +init_buffer2(); +init_process2(); +var OutputModel = class { + constructor(result2, model, modelName, inputModel, dependencies) { + this.result = result2; + this.model = model; + this.modelName = modelName; + this.inputModel = inputModel; + this.dependencies = dependencies; + } + static toOutputModel(args) { + if (Array.isArray(args)) { + return args.map((arg) => new this(arg.result, arg.model, arg.modelName, arg.inputModel, arg.dependencies)); + } + return new this(args.result, args.model, args.modelName, args.inputModel, args.dependencies); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/AsyncapiV2Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var AsyncapiV2ExternalDocumentation = class _AsyncapiV2ExternalDocumentation { + static toExternalDocumentation(object) { + const doc = new _AsyncapiV2ExternalDocumentation(); + for (const [propName2, prop] of Object.entries(object)) { + doc[String(propName2)] = prop; + } + return doc; + } +}; +var AsyncapiV2Schema = class _AsyncapiV2Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of AsyncapiV2Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _AsyncapiV2Schema.internalToSchema(object); + if (convertedSchema instanceof _AsyncapiV2Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of AsyncapiV2Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _AsyncapiV2Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _AsyncapiV2Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "examples" && propName2 !== "const" && propName2 !== "enum") { + if (propName2 === "externalDocs") { + schema8.externalDocs = AsyncapiV2ExternalDocumentation.toExternalDocumentation(prop); + continue; + } else if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _AsyncapiV2Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _AsyncapiV2Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/Draft7Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var Draft7Schema = class _Draft7Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of Draft7Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _Draft7Schema.internalToSchema(object); + if (convertedSchema instanceof _Draft7Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of Draft7Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _Draft7Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _Draft7Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "examples" && propName2 !== "const" && propName2 !== "enum") { + if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _Draft7Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _Draft7Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/Draft6Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var Draft6Schema = class _Draft6Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of Draft6Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _Draft6Schema.internalToSchema(object); + if (convertedSchema instanceof _Draft6Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of Draft6Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _Draft6Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _Draft6Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "examples" && propName2 !== "const" && propName2 !== "enum") { + if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _Draft6Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _Draft6Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/Draft4Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var Draft4Schema = class _Draft4Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of Draft4Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _Draft4Schema.internalToSchema(object); + if (convertedSchema instanceof _Draft4Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of Draft4Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _Draft4Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _Draft4Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "enum") { + if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _Draft4Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _Draft4Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/SwaggerV2Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var SwaggerV2Xml = class _SwaggerV2Xml { + static toXml(object) { + let doc = new _SwaggerV2Xml(); + doc = Object.assign(doc, object); + return doc; + } +}; +var SwaggerV2ExternalDocumentation = class _SwaggerV2ExternalDocumentation { + static toExternalDocumentation(object) { + let doc = new _SwaggerV2ExternalDocumentation(); + doc = Object.assign(doc, object); + return doc; + } +}; +var SwaggerV2Schema = class _SwaggerV2Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of SwaggerV2Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _SwaggerV2Schema.internalToSchema(object); + if (convertedSchema instanceof _SwaggerV2Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of SwaggerV2Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _SwaggerV2Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _SwaggerV2Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "enum") { + if (propName2 === "externalDocs") { + schema8.externalDocs = SwaggerV2ExternalDocumentation.toExternalDocumentation(prop); + continue; + } else if (propName2 === "xml") { + schema8.xml = SwaggerV2Xml.toXml(prop); + continue; + } else if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _SwaggerV2Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _SwaggerV2Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/OpenapiV3Schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var OpenapiV3Xml = class _OpenapiV3Xml { + static toXml(object) { + const doc = new _OpenapiV3Xml(); + for (const [propName2, prop] of Object.entries(object)) { + doc[String(propName2)] = prop; + } + return doc; + } +}; +var OpenAPIV3ExternalDocumentation = class _OpenAPIV3ExternalDocumentation { + static toExternalDocumentation(object) { + const doc = new _OpenAPIV3ExternalDocumentation(); + for (const [propName2, prop] of Object.entries(object)) { + doc[String(propName2)] = prop; + } + return doc; + } +}; +var OpenapiV3Discriminator = class _OpenapiV3Discriminator { + static toDiscriminator(object) { + const doc = new _OpenapiV3Discriminator(); + for (const [propName2, prop] of Object.entries(object)) { + doc[String(propName2)] = prop; + } + return doc; + } +}; +var OpenapiV3Schema = class _OpenapiV3Schema { + /** + * Takes a deep copy of the input object and converts it to an instance of OpenapiV3Schema. + * + * @param object + */ + static toSchema(object) { + const convertedSchema = _OpenapiV3Schema.internalToSchema(object); + if (convertedSchema instanceof _OpenapiV3Schema) { + return convertedSchema; + } + throw new Error("Could not convert input to expected copy of OpenapiV3Schema"); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static internalToSchema(object, seenSchemas = /* @__PURE__ */ new Map()) { + if (null === object || "object" !== typeof object) { + return object; + } + if (seenSchemas.has(object)) { + return seenSchemas.get(object); + } + if (object instanceof Array) { + const copy4 = []; + for (let i7 = 0, len = object.length; i7 < len; i7++) { + copy4[Number(i7)] = _OpenapiV3Schema.internalToSchema(object[Number(i7)], seenSchemas); + } + return copy4; + } + const schema8 = new _OpenapiV3Schema(); + seenSchemas.set(object, schema8); + for (const [propName2, prop] of Object.entries(object)) { + if (prop === void 0) { + continue; + } + let copyProp = prop; + if (propName2 !== "default" && propName2 !== "enum") { + if (propName2 === "externalDocs") { + schema8.externalDocs = OpenAPIV3ExternalDocumentation.toExternalDocumentation(prop); + continue; + } else if (propName2 === "xml") { + schema8.xml = OpenapiV3Xml.toXml(prop); + continue; + } else if (propName2 === "discriminator") { + schema8.discriminator = OpenapiV3Discriminator.toDiscriminator(prop); + continue; + } else if (propName2 === "properties" || propName2 === "patternProperties" || propName2 === "definitions" || propName2 === "dependencies") { + copyProp = {}; + for (const [propName22, prop2] of Object.entries(prop)) { + copyProp[String(propName22)] = _OpenapiV3Schema.internalToSchema(prop2, seenSchemas); + } + } else { + copyProp = _OpenapiV3Schema.internalToSchema(prop, seenSchemas); + } + } + schema8[String(propName2)] = copyProp; + } + return schema8; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/MetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); +var MetaModel = class { + constructor(name2, originalInput, options) { + this.name = name2; + this.originalInput = originalInput; + this.options = options; + } +}; +var ReferenceModel = class extends MetaModel { + constructor(name2, originalInput, options, ref) { + super(name2, originalInput, options); + this.ref = ref; + } +}; +var AnyModel = class extends MetaModel { +}; +var FloatModel = class extends MetaModel { +}; +var IntegerModel = class extends MetaModel { +}; +var StringModel = class extends MetaModel { +}; +var BooleanModel = class extends MetaModel { +}; +var TupleValueModel = class { + constructor(index4, value2) { + this.index = index4; + this.value = value2; + } +}; +var TupleModel = class extends MetaModel { + constructor(name2, originalInput, options, tuple) { + super(name2, originalInput, options); + this.tuple = tuple; + } +}; +var ObjectPropertyModel = class { + constructor(propertyName, required, property2) { + this.propertyName = propertyName; + this.required = required; + this.property = property2; + } +}; +var ObjectModel = class extends MetaModel { + constructor(name2, originalInput, options, properties) { + super(name2, originalInput, options); + this.properties = properties; + } +}; +var ArrayModel = class extends MetaModel { + constructor(name2, originalInput, options, valueModel) { + super(name2, originalInput, options); + this.valueModel = valueModel; + } +}; +var UnionModel = class extends MetaModel { + constructor(name2, originalInput, options, union2) { + super(name2, originalInput, options); + this.union = union2; + } +}; +var EnumValueModel = class { + constructor(key, value2) { + this.key = key; + this.value = value2; + } +}; +var EnumModel = class extends MetaModel { + constructor(name2, originalInput, options, values2) { + super(name2, originalInput, options); + this.values = values2; + } +}; +var DictionaryModel = class extends MetaModel { + constructor(name2, originalInput, options, key, value2, serializationType = "normal") { + super(name2, originalInput, options); + this.key = key; + this.value = value2; + this.serializationType = serializationType; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/ConstrainedMetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/helpers/DependencyHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); +function renderJavaScriptDependency(toImport, fromModule, moduleSystem) { + return moduleSystem === "CJS" ? `const ${toImport} = require('${fromModule}');` : `import ${toImport} from '${fromModule}';`; +} +function makeUnique(array) { + const seen = /* @__PURE__ */ new Set(); + return array.filter((item) => { + const naiveIdentifier = item.name + item.type; + return seen.has(naiveIdentifier) ? false : seen.add(naiveIdentifier); + }); +} + +// node_modules/@asyncapi/modelina/lib/esm/models/ConstrainedMetaModel.js +var defaultGetNearestDependenciesArgument = { + alreadyVisitedNodes: [] +}; +var ConstrainedMetaModel = class extends MetaModel { + constructor(name2, originalInput, options, type3) { + super(name2, originalInput, options); + this.type = type3; + this.options = Object.assign({}, options); + if (options.const) { + this.options.const = Object.assign({}, options.const); + } + if (options.discriminator) { + this.options.discriminator = Object.assign({}, options.discriminator); + } + } + /** + * Get the nearest constrained meta models for the constrained model. + * + * This is often used when you want to know which other models you are referencing. + */ + getNearestDependencies(arg) { + return []; + } +}; +var ConstrainedReferenceModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, ref) { + super(name2, originalInput, options, type3); + this.ref = ref; + } +}; +var ConstrainedAnyModel = class extends ConstrainedMetaModel { +}; +var ConstrainedFloatModel = class extends ConstrainedMetaModel { +}; +var ConstrainedIntegerModel = class extends ConstrainedMetaModel { +}; +var ConstrainedStringModel = class extends ConstrainedMetaModel { +}; +var ConstrainedBooleanModel = class extends ConstrainedMetaModel { +}; +var ConstrainedTupleValueModel = class { + constructor(index4, value2) { + this.index = index4; + this.value = value2; + } +}; +var ConstrainedTupleModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, tuple) { + super(name2, originalInput, options, type3); + this.tuple = tuple; + } + getNearestDependencies(arg) { + const argumentsToUse = mergePartialAndDefault(defaultGetNearestDependenciesArgument, arg); + argumentsToUse.alreadyVisitedNodes.push(this); + let dependencyModels = []; + for (const tupleModel of Object.values(this.tuple)) { + if (tupleModel.value instanceof ConstrainedReferenceModel) { + dependencyModels.push(tupleModel.value); + } else if (!argumentsToUse.alreadyVisitedNodes.includes(tupleModel.value)) { + dependencyModels = [ + ...dependencyModels, + ...tupleModel.value.getNearestDependencies(argumentsToUse) + ]; + } + } + dependencyModels = makeUnique(dependencyModels); + return dependencyModels; + } +}; +var ConstrainedObjectPropertyModel = class { + constructor(propertyName, unconstrainedPropertyName, required, property2) { + this.propertyName = propertyName; + this.unconstrainedPropertyName = unconstrainedPropertyName; + this.required = required; + this.property = property2; + } +}; +var ConstrainedArrayModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, valueModel) { + super(name2, originalInput, options, type3); + this.valueModel = valueModel; + } + getNearestDependencies(arg) { + const argumentsToUse = mergePartialAndDefault(defaultGetNearestDependenciesArgument, arg); + argumentsToUse.alreadyVisitedNodes.push(this); + if (this.valueModel instanceof ConstrainedReferenceModel) { + return [this.valueModel]; + } else if (!argumentsToUse.alreadyVisitedNodes.includes(this.valueModel)) { + return this.valueModel.getNearestDependencies(argumentsToUse); + } + return []; + } +}; +var ConstrainedUnionModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, union2) { + super(name2, originalInput, options, type3); + this.union = union2; + } + getNearestDependencies(arg) { + const argumentsToUse = mergePartialAndDefault(defaultGetNearestDependenciesArgument, arg); + argumentsToUse.alreadyVisitedNodes.push(this); + let dependencyModels = []; + for (const unionModel of Object.values(this.union)) { + if (unionModel instanceof ConstrainedReferenceModel) { + dependencyModels.push(unionModel); + } else if (!argumentsToUse.alreadyVisitedNodes.includes(unionModel)) { + dependencyModels = [ + ...dependencyModels, + ...unionModel.getNearestDependencies(argumentsToUse) + ]; + } + } + dependencyModels = makeUnique(dependencyModels); + return dependencyModels; + } +}; +var ConstrainedEnumValueModel = class { + constructor(key, value2, originalInput) { + this.key = key; + this.value = value2; + this.originalInput = originalInput; + } +}; +var ConstrainedEnumModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, values2) { + super(name2, originalInput, options, type3); + this.values = values2; + } +}; +var ConstrainedDictionaryModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, key, value2, serializationType = "normal") { + super(name2, originalInput, options, type3); + this.key = key; + this.value = value2; + this.serializationType = serializationType; + } + getNearestDependencies(arg) { + const argumentsToUse = mergePartialAndDefault(defaultGetNearestDependenciesArgument, arg); + argumentsToUse.alreadyVisitedNodes.push(this); + const dependencies = [this.key, this.value]; + let dependencyModels = []; + for (const model of dependencies) { + if (model instanceof ConstrainedReferenceModel) { + dependencyModels.push(model); + } else if (!argumentsToUse.alreadyVisitedNodes.includes(model)) { + dependencyModels = [ + ...dependencyModels, + ...model.getNearestDependencies(argumentsToUse) + ]; + } + } + dependencyModels = makeUnique(dependencyModels); + return dependencyModels; + } +}; +var ConstrainedObjectModel = class extends ConstrainedMetaModel { + constructor(name2, originalInput, options, type3, properties) { + super(name2, originalInput, options, type3); + this.properties = properties; + } + getNearestDependencies(arg) { + const argumentsToUse = mergePartialAndDefault(defaultGetNearestDependenciesArgument, arg); + argumentsToUse.alreadyVisitedNodes.push(this); + let dependencyModels = []; + for (const modelProperty of Object.values(this.properties)) { + if (modelProperty.property instanceof ConstrainedReferenceModel) { + dependencyModels.push(modelProperty.property); + } else if (!argumentsToUse.alreadyVisitedNodes.includes(modelProperty.property)) { + dependencyModels = [ + ...dependencyModels, + ...modelProperty.property.getNearestDependencies(argumentsToUse) + ]; + } + } + dependencyModels = dependencyModels.filter((referenceModel) => { + return referenceModel.name !== this.name; + }); + dependencyModels = makeUnique(dependencyModels); + return dependencyModels; + } + /** + * More specifics on the type setup here: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-cant-i-write-typeof-t-new-t-or-instanceof-t-in-my-generic-function + * + * @param propertyType + */ + containsPropertyType(propertyType) { + const foundPropertiesWithType = Object.values(this.properties).filter((property2) => { + return property2.property instanceof propertyType; + }); + return foundPropertiesWithType.length !== 0; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/InputMetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); +var InputMetaModel = class { + constructor() { + this.models = {}; + this.originalInput = {}; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/AvroSchema.js +init_dirname(); +init_buffer2(); +init_process2(); +var AvroSchema = class { +}; + +// node_modules/@asyncapi/modelina/lib/esm/models/XsdSchema.js +init_dirname(); +init_buffer2(); +init_process2(); +var XsdSchema = class _XsdSchema { + /** + * Convert raw parsed XSD object to XsdSchema + */ + static toSchema(object) { + const schema8 = new _XsdSchema(); + schema8.originalInput = object; + if (object["xs:schema"] || object.schema) { + const schemaNode = object["xs:schema"] || object.schema; + schema8.targetNamespace = schemaNode["@_targetNamespace"] || schemaNode.targetNamespace; + schema8.elementFormDefault = schemaNode["@_elementFormDefault"] || schemaNode.elementFormDefault; + schema8.attributeFormDefault = schemaNode["@_attributeFormDefault"] || schemaNode.attributeFormDefault; + schema8.elements = _XsdSchema.parseElements(schemaNode[_XsdSchema.XS_ELEMENT] || schemaNode.element); + schema8.complexTypes = _XsdSchema.parseComplexTypes(schemaNode[_XsdSchema.XS_COMPLEX_TYPE] || schemaNode.complexType); + schema8.simpleTypes = _XsdSchema.parseSimpleTypes(schemaNode[_XsdSchema.XS_SIMPLE_TYPE] || schemaNode.simpleType); + } + return schema8; + } + static parseElements(elementsNode) { + if (!elementsNode) { + return void 0; + } + const elements = Array.isArray(elementsNode) ? elementsNode : [elementsNode]; + return elements.map((elem) => _XsdSchema.parseElement(elem)); + } + static parseElement(elementNode) { + const element = { + name: elementNode[_XsdSchema.ATTR_NAME] || elementNode.name, + type: elementNode[_XsdSchema.ATTR_TYPE] || elementNode.type, + minOccurs: elementNode[_XsdSchema.ATTR_MIN_OCCURS] || elementNode.minOccurs, + maxOccurs: elementNode[_XsdSchema.ATTR_MAX_OCCURS] || elementNode.maxOccurs, + ref: elementNode["@_ref"] || elementNode.ref + }; + if (elementNode[_XsdSchema.XS_COMPLEX_TYPE] || elementNode.complexType) { + element.complexType = _XsdSchema.parseComplexType(elementNode[_XsdSchema.XS_COMPLEX_TYPE] || elementNode.complexType); + } + if (elementNode[_XsdSchema.XS_SIMPLE_TYPE] || elementNode.simpleType) { + element.simpleType = _XsdSchema.parseSimpleType(elementNode[_XsdSchema.XS_SIMPLE_TYPE] || elementNode.simpleType); + } + return element; + } + static parseComplexTypes(complexTypesNode) { + if (!complexTypesNode) { + return void 0; + } + const complexTypes = Array.isArray(complexTypesNode) ? complexTypesNode : [complexTypesNode]; + return complexTypes.map((ct) => _XsdSchema.parseComplexType(ct)); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static parseComplexType(complexTypeNode) { + const complexType = { + name: complexTypeNode["@_name"] || complexTypeNode.name + }; + if (complexTypeNode[_XsdSchema.XS_SEQUENCE] || complexTypeNode.sequence) { + const sequenceNode = complexTypeNode[_XsdSchema.XS_SEQUENCE] || complexTypeNode.sequence; + complexType.sequence = { + elements: _XsdSchema.parseElements(sequenceNode[_XsdSchema.XS_ELEMENT] || sequenceNode.element), + any: _XsdSchema.parseAny(sequenceNode[_XsdSchema.XS_ANY] || sequenceNode.any) + }; + } + if (complexTypeNode[_XsdSchema.XS_CHOICE] || complexTypeNode.choice) { + const choiceNode = complexTypeNode[_XsdSchema.XS_CHOICE] || complexTypeNode.choice; + complexType.choice = { + elements: _XsdSchema.parseElements(choiceNode[_XsdSchema.XS_ELEMENT] || choiceNode.element), + any: _XsdSchema.parseAny(choiceNode[_XsdSchema.XS_ANY] || choiceNode.any) + }; + } + if (complexTypeNode[_XsdSchema.XS_ATTRIBUTE] || complexTypeNode.attribute) { + complexType.attributes = _XsdSchema.parseAttributes(complexTypeNode[_XsdSchema.XS_ATTRIBUTE] || complexTypeNode.attribute); + } + if (complexTypeNode[_XsdSchema.XS_COMPLEX_CONTENT] || complexTypeNode.complexContent) { + complexType.complexContent = _XsdSchema.parseComplexContent(complexTypeNode[_XsdSchema.XS_COMPLEX_CONTENT] || complexTypeNode.complexContent); + } + if (complexTypeNode[_XsdSchema.XS_SIMPLE_CONTENT] || complexTypeNode.simpleContent) { + complexType.simpleContent = _XsdSchema.parseSimpleContent(complexTypeNode[_XsdSchema.XS_SIMPLE_CONTENT] || complexTypeNode.simpleContent); + } + return complexType; + } + static parseSimpleTypes(simpleTypesNode) { + if (!simpleTypesNode) { + return void 0; + } + const simpleTypes = Array.isArray(simpleTypesNode) ? simpleTypesNode : [simpleTypesNode]; + return simpleTypes.map((st2) => _XsdSchema.parseSimpleType(st2)); + } + // eslint-disable-next-line sonarjs/cognitive-complexity + static parseSimpleType(simpleTypeNode) { + const simpleType = { + name: simpleTypeNode["@_name"] || simpleTypeNode.name + }; + if (simpleTypeNode[_XsdSchema.XS_RESTRICTION] || simpleTypeNode.restriction) { + const restrictionNode = simpleTypeNode[_XsdSchema.XS_RESTRICTION] || simpleTypeNode.restriction; + simpleType.restriction = { + base: restrictionNode[_XsdSchema.ATTR_BASE] || restrictionNode.base + }; + if (restrictionNode[_XsdSchema.XS_ENUMERATION] || restrictionNode.enumeration) { + const enumNodes = Array.isArray(restrictionNode[_XsdSchema.XS_ENUMERATION] || restrictionNode.enumeration) ? restrictionNode[_XsdSchema.XS_ENUMERATION] || restrictionNode.enumeration : [ + restrictionNode[_XsdSchema.XS_ENUMERATION] || restrictionNode.enumeration + ]; + simpleType.restriction.enumeration = enumNodes.map((e10) => e10[_XsdSchema.ATTR_VALUE] || e10.value); + } + if (restrictionNode[_XsdSchema.XS_PATTERN] || restrictionNode.pattern) { + const patternNode = restrictionNode[_XsdSchema.XS_PATTERN] || restrictionNode.pattern; + simpleType.restriction.pattern = patternNode[_XsdSchema.ATTR_VALUE] || patternNode.value; + } + if (restrictionNode[_XsdSchema.XS_MIN_LENGTH] || restrictionNode.minLength) { + const minLengthNode = restrictionNode[_XsdSchema.XS_MIN_LENGTH] || restrictionNode.minLength; + simpleType.restriction.minLength = Number.parseInt(minLengthNode[_XsdSchema.ATTR_VALUE] || minLengthNode.value, 10); + } + if (restrictionNode[_XsdSchema.XS_MAX_LENGTH] || restrictionNode.maxLength) { + const maxLengthNode = restrictionNode[_XsdSchema.XS_MAX_LENGTH] || restrictionNode.maxLength; + simpleType.restriction.maxLength = Number.parseInt(maxLengthNode[_XsdSchema.ATTR_VALUE] || maxLengthNode.value, 10); + } + if (restrictionNode[_XsdSchema.XS_MIN_INCLUSIVE] || restrictionNode.minInclusive) { + const minInclusiveNode = restrictionNode[_XsdSchema.XS_MIN_INCLUSIVE] || restrictionNode.minInclusive; + simpleType.restriction.minInclusive = Number.parseFloat(minInclusiveNode[_XsdSchema.ATTR_VALUE] || minInclusiveNode.value); + } + if (restrictionNode[_XsdSchema.XS_MAX_INCLUSIVE] || restrictionNode.maxInclusive) { + const maxInclusiveNode = restrictionNode[_XsdSchema.XS_MAX_INCLUSIVE] || restrictionNode.maxInclusive; + simpleType.restriction.maxInclusive = Number.parseFloat(maxInclusiveNode[_XsdSchema.ATTR_VALUE] || maxInclusiveNode.value); + } + } + return simpleType; + } + static parseAttributes(attributesNode) { + if (!attributesNode) { + return void 0; + } + const attributes = Array.isArray(attributesNode) ? attributesNode : [attributesNode]; + return attributes.map((attr) => ({ + name: attr["@_name"] || attr.name, + type: attr["@_type"] || attr.type, + use: attr["@_use"] || attr.use, + default: attr["@_default"] || attr.default, + fixed: attr["@_fixed"] || attr.fixed + })); + } + static parseComplexContent(complexContentNode) { + const complexContent = {}; + if (complexContentNode[_XsdSchema.XS_EXTENSION] || complexContentNode.extension) { + const extensionNode = complexContentNode[_XsdSchema.XS_EXTENSION] || complexContentNode.extension; + complexContent.extension = { + base: extensionNode[_XsdSchema.ATTR_BASE] || extensionNode.base + }; + if (extensionNode[_XsdSchema.XS_SEQUENCE] || extensionNode.sequence) { + const sequenceNode = extensionNode[_XsdSchema.XS_SEQUENCE] || extensionNode.sequence; + complexContent.extension.sequence = { + elements: _XsdSchema.parseElements(sequenceNode[_XsdSchema.XS_ELEMENT] || sequenceNode.element) + }; + } + if (extensionNode[_XsdSchema.XS_ATTRIBUTE] || extensionNode.attribute) { + complexContent.extension.attributes = _XsdSchema.parseAttributes(extensionNode[_XsdSchema.XS_ATTRIBUTE] || extensionNode.attribute); + } + } + return complexContent; + } + static parseSimpleContent(simpleContentNode) { + const simpleContent = {}; + if (simpleContentNode[_XsdSchema.XS_EXTENSION] || simpleContentNode.extension) { + const extensionNode = simpleContentNode[_XsdSchema.XS_EXTENSION] || simpleContentNode.extension; + simpleContent.extension = { + base: extensionNode[_XsdSchema.ATTR_BASE] || extensionNode.base + }; + if (extensionNode[_XsdSchema.XS_ATTRIBUTE] || extensionNode.attribute) { + simpleContent.extension.attributes = _XsdSchema.parseAttributes(extensionNode[_XsdSchema.XS_ATTRIBUTE] || extensionNode.attribute); + } + } + return simpleContent; + } + static parseAny(anyNode) { + if (!anyNode) { + return void 0; + } + const anyNodes = Array.isArray(anyNode) ? anyNode : [anyNode]; + return anyNodes.map((node) => ({ + minOccurs: node[_XsdSchema.ATTR_MIN_OCCURS] || node.minOccurs, + maxOccurs: node[_XsdSchema.ATTR_MAX_OCCURS] || node.maxOccurs, + namespace: node["@_namespace"] || node.namespace, + processContents: node["@_processContents"] || node.processContents + })); + } +}; +XsdSchema.XS_ELEMENT = "xs:element"; +XsdSchema.XS_COMPLEX_TYPE = "xs:complexType"; +XsdSchema.XS_SIMPLE_TYPE = "xs:simpleType"; +XsdSchema.XS_SEQUENCE = "xs:sequence"; +XsdSchema.XS_CHOICE = "xs:choice"; +XsdSchema.XS_ATTRIBUTE = "xs:attribute"; +XsdSchema.XS_EXTENSION = "xs:extension"; +XsdSchema.XS_RESTRICTION = "xs:restriction"; +XsdSchema.XS_ENUMERATION = "xs:enumeration"; +XsdSchema.XS_PATTERN = "xs:pattern"; +XsdSchema.XS_MIN_LENGTH = "xs:minLength"; +XsdSchema.XS_MAX_LENGTH = "xs:maxLength"; +XsdSchema.XS_MIN_INCLUSIVE = "xs:minInclusive"; +XsdSchema.XS_MAX_INCLUSIVE = "xs:maxInclusive"; +XsdSchema.XS_ANY = "xs:any"; +XsdSchema.XS_COMPLEX_CONTENT = "xs:complexContent"; +XsdSchema.XS_SIMPLE_CONTENT = "xs:simpleContent"; +XsdSchema.ATTR_VALUE = "@_value"; +XsdSchema.ATTR_NAME = "@_name"; +XsdSchema.ATTR_TYPE = "@_type"; +XsdSchema.ATTR_MIN_OCCURS = "@_minOccurs"; +XsdSchema.ATTR_MAX_OCCURS = "@_maxOccurs"; +XsdSchema.ATTR_BASE = "@_base"; + +// node_modules/@asyncapi/modelina/lib/esm/processors/AbstractInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +var AbstractInputProcessor = class { +}; +AbstractInputProcessor.MODELINA_INFERRED_NAME = "x-modelgen-inferred-name"; + +// node_modules/@asyncapi/modelina/lib/esm/processors/InputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/processors/AsyncAPIInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +init_esm(); + +// node_modules/js-yaml/dist/js-yaml.mjs +init_dirname(); +init_buffer2(); +init_process2(); +function isNothing(subject) { + return typeof subject === "undefined" || subject === null; +} +function isObject5(subject) { + return typeof subject === "object" && subject !== null; +} +function toArray2(sequence) { + if (Array.isArray(sequence)) + return sequence; + else if (isNothing(sequence)) + return []; + return [sequence]; +} +function extend(target, source) { + var index4, length, key, sourceKeys; + if (source) { + sourceKeys = Object.keys(source); + for (index4 = 0, length = sourceKeys.length; index4 < length; index4 += 1) { + key = sourceKeys[index4]; + target[key] = source[key]; + } + } + return target; +} +function repeat2(string2, count2) { + var result2 = "", cycle; + for (cycle = 0; cycle < count2; cycle += 1) { + result2 += string2; + } + return result2; +} +function isNegativeZero(number) { + return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; +} +var isNothing_1 = isNothing; +var isObject_1 = isObject5; +var toArray_1 = toArray2; +var repeat_1 = repeat2; +var isNegativeZero_1 = isNegativeZero; +var extend_1 = extend; +var common = { + isNothing: isNothing_1, + isObject: isObject_1, + toArray: toArray_1, + repeat: repeat_1, + isNegativeZero: isNegativeZero_1, + extend: extend_1 +}; +function formatError(exception2, compact2) { + var where = "", message = exception2.reason || "(unknown reason)"; + if (!exception2.mark) + return message; + if (exception2.mark.name) { + where += 'in "' + exception2.mark.name + '" '; + } + where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")"; + if (!compact2 && exception2.mark.snippet) { + where += "\n\n" + exception2.mark.snippet; + } + return message + " " + where; +} +function YAMLException$1(reason, mark) { + Error.call(this); + this.name = "YAMLException"; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack || ""; + } +} +YAMLException$1.prototype = Object.create(Error.prototype); +YAMLException$1.prototype.constructor = YAMLException$1; +YAMLException$1.prototype.toString = function toString2(compact2) { + return this.name + ": " + formatError(this, compact2); +}; +var exception = YAMLException$1; +function getLine(buffer2, lineStart, lineEnd, position, maxLineLength) { + var head2 = ""; + var tail2 = ""; + var maxHalfLength = Math.floor(maxLineLength / 2) - 1; + if (position - lineStart > maxHalfLength) { + head2 = " ... "; + lineStart = position - maxHalfLength + head2.length; + } + if (lineEnd - position > maxHalfLength) { + tail2 = " ..."; + lineEnd = position + maxHalfLength - tail2.length; + } + return { + str: head2 + buffer2.slice(lineStart, lineEnd).replace(/\t/g, "\u2192") + tail2, + pos: position - lineStart + head2.length + // relative position + }; +} +function padStart2(string2, max2) { + return common.repeat(" ", max2 - string2.length) + string2; +} +function makeSnippet(mark, options) { + options = Object.create(options || null); + if (!mark.buffer) + return null; + if (!options.maxLength) + options.maxLength = 79; + if (typeof options.indent !== "number") + options.indent = 1; + if (typeof options.linesBefore !== "number") + options.linesBefore = 3; + if (typeof options.linesAfter !== "number") + options.linesAfter = 2; + var re4 = /\r?\n|\r|\0/g; + var lineStarts = [0]; + var lineEnds = []; + var match; + var foundLineNo = -1; + while (match = re4.exec(mark.buffer)) { + lineEnds.push(match.index); + lineStarts.push(match.index + match[0].length); + if (mark.position <= match.index && foundLineNo < 0) { + foundLineNo = lineStarts.length - 2; + } + } + if (foundLineNo < 0) + foundLineNo = lineStarts.length - 1; + var result2 = "", i7, line; + var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length; + var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3); + for (i7 = 1; i7 <= options.linesBefore; i7++) { + if (foundLineNo - i7 < 0) + break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo - i7], + lineEnds[foundLineNo - i7], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i7]), + maxLineLength + ); + result2 = common.repeat(" ", options.indent) + padStart2((mark.line - i7 + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result2; + } + line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength); + result2 += common.repeat(" ", options.indent) + padStart2((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + result2 += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n"; + for (i7 = 1; i7 <= options.linesAfter; i7++) { + if (foundLineNo + i7 >= lineEnds.length) + break; + line = getLine( + mark.buffer, + lineStarts[foundLineNo + i7], + lineEnds[foundLineNo + i7], + mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i7]), + maxLineLength + ); + result2 += common.repeat(" ", options.indent) + padStart2((mark.line + i7 + 1).toString(), lineNoLength) + " | " + line.str + "\n"; + } + return result2.replace(/\n$/, ""); +} +var snippet = makeSnippet; +var TYPE_CONSTRUCTOR_OPTIONS = [ + "kind", + "multi", + "resolve", + "construct", + "instanceOf", + "predicate", + "represent", + "representName", + "defaultStyle", + "styleAliases" +]; +var YAML_NODE_KINDS = [ + "scalar", + "sequence", + "mapping" +]; +function compileStyleAliases(map4) { + var result2 = {}; + if (map4 !== null) { + Object.keys(map4).forEach(function(style) { + map4[style].forEach(function(alias) { + result2[String(alias)] = style; + }); + }); + } + return result2; +} +function Type$1(tag, options) { + options = options || {}; + Object.keys(options).forEach(function(name2) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name2) === -1) { + throw new exception('Unknown option "' + name2 + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + this.options = options; + this.tag = tag; + this.kind = options["kind"] || null; + this.resolve = options["resolve"] || function() { + return true; + }; + this.construct = options["construct"] || function(data) { + return data; + }; + this.instanceOf = options["instanceOf"] || null; + this.predicate = options["predicate"] || null; + this.represent = options["represent"] || null; + this.representName = options["representName"] || null; + this.defaultStyle = options["defaultStyle"] || null; + this.multi = options["multi"] || false; + this.styleAliases = compileStyleAliases(options["styleAliases"] || null); + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} +var type = Type$1; +function compileList(schema8, name2) { + var result2 = []; + schema8[name2].forEach(function(currentType) { + var newIndex = result2.length; + result2.forEach(function(previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) { + newIndex = previousIndex; + } + }); + result2[newIndex] = currentType; + }); + return result2; +} +function compileMap() { + var result2 = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index4, length; + function collectType(type3) { + if (type3.multi) { + result2.multi[type3.kind].push(type3); + result2.multi["fallback"].push(type3); + } else { + result2[type3.kind][type3.tag] = result2["fallback"][type3.tag] = type3; + } + } + for (index4 = 0, length = arguments.length; index4 < length; index4 += 1) { + arguments[index4].forEach(collectType); + } + return result2; +} +function Schema$1(definition) { + return this.extend(definition); +} +Schema$1.prototype.extend = function extend2(definition) { + var implicit = []; + var explicit = []; + if (definition instanceof type) { + explicit.push(definition); + } else if (Array.isArray(definition)) { + explicit = explicit.concat(definition); + } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) { + if (definition.implicit) + implicit = implicit.concat(definition.implicit); + if (definition.explicit) + explicit = explicit.concat(definition.explicit); + } else { + throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })"); + } + implicit.forEach(function(type$1) { + if (!(type$1 instanceof type)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + if (type$1.loadKind && type$1.loadKind !== "scalar") { + throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported."); + } + if (type$1.multi) { + throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit."); + } + }); + explicit.forEach(function(type$1) { + if (!(type$1 instanceof type)) { + throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object."); + } + }); + var result2 = Object.create(Schema$1.prototype); + result2.implicit = (this.implicit || []).concat(implicit); + result2.explicit = (this.explicit || []).concat(explicit); + result2.compiledImplicit = compileList(result2, "implicit"); + result2.compiledExplicit = compileList(result2, "explicit"); + result2.compiledTypeMap = compileMap(result2.compiledImplicit, result2.compiledExplicit); + return result2; +}; +var schema5 = Schema$1; +var str = new type("tag:yaml.org,2002:str", { + kind: "scalar", + construct: function(data) { + return data !== null ? data : ""; + } +}); +var seq2 = new type("tag:yaml.org,2002:seq", { + kind: "sequence", + construct: function(data) { + return data !== null ? data : []; + } +}); +var map3 = new type("tag:yaml.org,2002:map", { + kind: "mapping", + construct: function(data) { + return data !== null ? data : {}; + } +}); +var failsafe = new schema5({ + explicit: [ + str, + seq2, + map3 + ] +}); +function resolveYamlNull(data) { + if (data === null) + return true; + var max2 = data.length; + return max2 === 1 && data === "~" || max2 === 4 && (data === "null" || data === "Null" || data === "NULL"); +} +function constructYamlNull() { + return null; +} +function isNull3(object) { + return object === null; +} +var _null = new type("tag:yaml.org,2002:null", { + kind: "scalar", + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull3, + represent: { + canonical: function() { + return "~"; + }, + lowercase: function() { + return "null"; + }, + uppercase: function() { + return "NULL"; + }, + camelcase: function() { + return "Null"; + }, + empty: function() { + return ""; + } + }, + defaultStyle: "lowercase" +}); +function resolveYamlBoolean(data) { + if (data === null) + return false; + var max2 = data.length; + return max2 === 4 && (data === "true" || data === "True" || data === "TRUE") || max2 === 5 && (data === "false" || data === "False" || data === "FALSE"); +} +function constructYamlBoolean(data) { + return data === "true" || data === "True" || data === "TRUE"; +} +function isBoolean3(object) { + return Object.prototype.toString.call(object) === "[object Boolean]"; +} +var bool = new type("tag:yaml.org,2002:bool", { + kind: "scalar", + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean3, + represent: { + lowercase: function(object) { + return object ? "true" : "false"; + }, + uppercase: function(object) { + return object ? "TRUE" : "FALSE"; + }, + camelcase: function(object) { + return object ? "True" : "False"; + } + }, + defaultStyle: "lowercase" +}); +function isHexCode(c7) { + return 48 <= c7 && c7 <= 57 || 65 <= c7 && c7 <= 70 || 97 <= c7 && c7 <= 102; +} +function isOctCode(c7) { + return 48 <= c7 && c7 <= 55; +} +function isDecCode(c7) { + return 48 <= c7 && c7 <= 57; +} +function resolveYamlInteger(data) { + if (data === null) + return false; + var max2 = data.length, index4 = 0, hasDigits = false, ch; + if (!max2) + return false; + ch = data[index4]; + if (ch === "-" || ch === "+") { + ch = data[++index4]; + } + if (ch === "0") { + if (index4 + 1 === max2) + return true; + ch = data[++index4]; + if (ch === "b") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (ch !== "0" && ch !== "1") + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "x") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isHexCode(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + if (ch === "o") { + index4++; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isOctCode(data.charCodeAt(index4))) + return false; + hasDigits = true; + } + return hasDigits && ch !== "_"; + } + } + if (ch === "_") + return false; + for (; index4 < max2; index4++) { + ch = data[index4]; + if (ch === "_") + continue; + if (!isDecCode(data.charCodeAt(index4))) { + return false; + } + hasDigits = true; + } + if (!hasDigits || ch === "_") + return false; + return true; +} +function constructYamlInteger(data) { + var value2 = data, sign = 1, ch; + if (value2.indexOf("_") !== -1) { + value2 = value2.replace(/_/g, ""); + } + ch = value2[0]; + if (ch === "-" || ch === "+") { + if (ch === "-") + sign = -1; + value2 = value2.slice(1); + ch = value2[0]; + } + if (value2 === "0") + return 0; + if (ch === "0") { + if (value2[1] === "b") + return sign * parseInt(value2.slice(2), 2); + if (value2[1] === "x") + return sign * parseInt(value2.slice(2), 16); + if (value2[1] === "o") + return sign * parseInt(value2.slice(2), 8); + } + return sign * parseInt(value2, 10); +} +function isInteger2(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object)); +} +var int3 = new type("tag:yaml.org,2002:int", { + kind: "scalar", + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger2, + represent: { + binary: function(obj) { + return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1); + }, + octal: function(obj) { + return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1); + }, + decimal: function(obj) { + return obj.toString(10); + }, + /* eslint-disable max-len */ + hexadecimal: function(obj) { + return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1); + } + }, + defaultStyle: "decimal", + styleAliases: { + binary: [2, "bin"], + octal: [8, "oct"], + decimal: [10, "dec"], + hexadecimal: [16, "hex"] + } +}); +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$" +); +function resolveYamlFloat(data) { + if (data === null) + return false; + if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === "_") { + return false; + } + return true; +} +function constructYamlFloat(data) { + var value2, sign; + value2 = data.replace(/_/g, "").toLowerCase(); + sign = value2[0] === "-" ? -1 : 1; + if ("+-".indexOf(value2[0]) >= 0) { + value2 = value2.slice(1); + } + if (value2 === ".inf") { + return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + } else if (value2 === ".nan") { + return NaN; + } + return sign * parseFloat(value2, 10); +} +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; +function representYamlFloat(object, style) { + var res; + if (isNaN(object)) { + switch (style) { + case "lowercase": + return ".nan"; + case "uppercase": + return ".NAN"; + case "camelcase": + return ".NaN"; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return ".inf"; + case "uppercase": + return ".INF"; + case "camelcase": + return ".Inf"; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case "lowercase": + return "-.inf"; + case "uppercase": + return "-.INF"; + case "camelcase": + return "-.Inf"; + } + } else if (common.isNegativeZero(object)) { + return "-0.0"; + } + res = object.toString(10); + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res; +} +function isFloat(object) { + return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object)); +} +var float3 = new type("tag:yaml.org,2002:float", { + kind: "scalar", + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: "lowercase" +}); +var json = failsafe.extend({ + implicit: [ + _null, + bool, + int3, + float3 + ] +}); +var core = json; +var YAML_DATE_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$" +); +var YAML_TIMESTAMP_REGEXP = new RegExp( + "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$" +); +function resolveYamlTimestamp(data) { + if (data === null) + return false; + if (YAML_DATE_REGEXP.exec(data) !== null) + return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) + return true; + return false; +} +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; + match = YAML_DATE_REGEXP.exec(data); + if (match === null) + match = YAML_TIMESTAMP_REGEXP.exec(data); + if (match === null) + throw new Error("Date resolve error"); + year = +match[1]; + month = +match[2] - 1; + day = +match[3]; + if (!match[4]) { + return new Date(Date.UTC(year, month, day)); + } + hour = +match[4]; + minute = +match[5]; + second = +match[6]; + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { + fraction += "0"; + } + fraction = +fraction; + } + if (match[9]) { + tz_hour = +match[10]; + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 6e4; + if (match[9] === "-") + delta = -delta; + } + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + if (delta) + date.setTime(date.getTime() - delta); + return date; +} +function representYamlTimestamp(object) { + return object.toISOString(); +} +var timestamp2 = new type("tag:yaml.org,2002:timestamp", { + kind: "scalar", + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); +function resolveYamlMerge(data) { + return data === "<<" || data === null; +} +var merge4 = new type("tag:yaml.org,2002:merge", { + kind: "scalar", + resolve: resolveYamlMerge +}); +var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r"; +function resolveYamlBinary(data) { + if (data === null) + return false; + var code, idx, bitlen = 0, max2 = data.length, map4 = BASE64_MAP; + for (idx = 0; idx < max2; idx++) { + code = map4.indexOf(data.charAt(idx)); + if (code > 64) + continue; + if (code < 0) + return false; + bitlen += 6; + } + return bitlen % 8 === 0; +} +function constructYamlBinary(data) { + var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max2 = input.length, map4 = BASE64_MAP, bits = 0, result2 = []; + for (idx = 0; idx < max2; idx++) { + if (idx % 4 === 0 && idx) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } + bits = bits << 6 | map4.indexOf(input.charAt(idx)); + } + tailbits = max2 % 4 * 6; + if (tailbits === 0) { + result2.push(bits >> 16 & 255); + result2.push(bits >> 8 & 255); + result2.push(bits & 255); + } else if (tailbits === 18) { + result2.push(bits >> 10 & 255); + result2.push(bits >> 2 & 255); + } else if (tailbits === 12) { + result2.push(bits >> 4 & 255); + } + return new Uint8Array(result2); +} +function representYamlBinary(object) { + var result2 = "", bits = 0, idx, tail2, max2 = object.length, map4 = BASE64_MAP; + for (idx = 0; idx < max2; idx++) { + if (idx % 3 === 0 && idx) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } + bits = (bits << 8) + object[idx]; + } + tail2 = max2 % 3; + if (tail2 === 0) { + result2 += map4[bits >> 18 & 63]; + result2 += map4[bits >> 12 & 63]; + result2 += map4[bits >> 6 & 63]; + result2 += map4[bits & 63]; + } else if (tail2 === 2) { + result2 += map4[bits >> 10 & 63]; + result2 += map4[bits >> 4 & 63]; + result2 += map4[bits << 2 & 63]; + result2 += map4[64]; + } else if (tail2 === 1) { + result2 += map4[bits >> 2 & 63]; + result2 += map4[bits << 4 & 63]; + result2 += map4[64]; + result2 += map4[64]; + } + return result2; +} +function isBinary(obj) { + return Object.prototype.toString.call(obj) === "[object Uint8Array]"; +} +var binary2 = new type("tag:yaml.org,2002:binary", { + kind: "scalar", + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); +var _hasOwnProperty$3 = Object.prototype.hasOwnProperty; +var _toString$2 = Object.prototype.toString; +function resolveYamlOmap(data) { + if (data === null) + return true; + var objectKeys = [], index4, length, pair, pairKey, pairHasKey, object = data; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + pairHasKey = false; + if (_toString$2.call(pair) !== "[object Object]") + return false; + for (pairKey in pair) { + if (_hasOwnProperty$3.call(pair, pairKey)) { + if (!pairHasKey) + pairHasKey = true; + else + return false; + } + } + if (!pairHasKey) + return false; + if (objectKeys.indexOf(pairKey) === -1) + objectKeys.push(pairKey); + else + return false; + } + return true; +} +function constructYamlOmap(data) { + return data !== null ? data : []; +} +var omap2 = new type("tag:yaml.org,2002:omap", { + kind: "sequence", + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); +var _toString$1 = Object.prototype.toString; +function resolveYamlPairs(data) { + if (data === null) + return true; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + if (_toString$1.call(pair) !== "[object Object]") + return false; + keys2 = Object.keys(pair); + if (keys2.length !== 1) + return false; + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return true; +} +function constructYamlPairs(data) { + if (data === null) + return []; + var index4, length, pair, keys2, result2, object = data; + result2 = new Array(object.length); + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + pair = object[index4]; + keys2 = Object.keys(pair); + result2[index4] = [keys2[0], pair[keys2[0]]]; + } + return result2; +} +var pairs2 = new type("tag:yaml.org,2002:pairs", { + kind: "sequence", + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); +var _hasOwnProperty$2 = Object.prototype.hasOwnProperty; +function resolveYamlSet(data) { + if (data === null) + return true; + var key, object = data; + for (key in object) { + if (_hasOwnProperty$2.call(object, key)) { + if (object[key] !== null) + return false; + } + } + return true; +} +function constructYamlSet(data) { + return data !== null ? data : {}; +} +var set3 = new type("tag:yaml.org,2002:set", { + kind: "mapping", + resolve: resolveYamlSet, + construct: constructYamlSet +}); +var _default = core.extend({ + implicit: [ + timestamp2, + merge4 + ], + explicit: [ + binary2, + omap2, + pairs2, + set3 + ] +}); +var _hasOwnProperty$1 = Object.prototype.hasOwnProperty; +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; +function _class(obj) { + return Object.prototype.toString.call(obj); +} +function is_EOL(c7) { + return c7 === 10 || c7 === 13; +} +function is_WHITE_SPACE(c7) { + return c7 === 9 || c7 === 32; +} +function is_WS_OR_EOL(c7) { + return c7 === 9 || c7 === 32 || c7 === 10 || c7 === 13; +} +function is_FLOW_INDICATOR(c7) { + return c7 === 44 || c7 === 91 || c7 === 93 || c7 === 123 || c7 === 125; +} +function fromHexCode(c7) { + var lc; + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + lc = c7 | 32; + if (97 <= lc && lc <= 102) { + return lc - 97 + 10; + } + return -1; +} +function escapedHexLen(c7) { + if (c7 === 120) { + return 2; + } + if (c7 === 117) { + return 4; + } + if (c7 === 85) { + return 8; + } + return 0; +} +function fromDecimalCode(c7) { + if (48 <= c7 && c7 <= 57) { + return c7 - 48; + } + return -1; +} +function simpleEscapeSequence(c7) { + return c7 === 48 ? "\0" : c7 === 97 ? "\x07" : c7 === 98 ? "\b" : c7 === 116 ? " " : c7 === 9 ? " " : c7 === 110 ? "\n" : c7 === 118 ? "\v" : c7 === 102 ? "\f" : c7 === 114 ? "\r" : c7 === 101 ? "\x1B" : c7 === 32 ? " " : c7 === 34 ? '"' : c7 === 47 ? "/" : c7 === 92 ? "\\" : c7 === 78 ? "\x85" : c7 === 95 ? "\xA0" : c7 === 76 ? "\u2028" : c7 === 80 ? "\u2029" : ""; +} +function charFromCodepoint(c7) { + if (c7 <= 65535) { + return String.fromCharCode(c7); + } + return String.fromCharCode( + (c7 - 65536 >> 10) + 55296, + (c7 - 65536 & 1023) + 56320 + ); +} +function setProperty2(object, key, value2) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value: value2 + }); + } else { + object[key] = value2; + } +} +var simpleEscapeCheck = new Array(256); +var simpleEscapeMap = new Array(256); +for (i7 = 0; i7 < 256; i7++) { + simpleEscapeCheck[i7] = simpleEscapeSequence(i7) ? 1 : 0; + simpleEscapeMap[i7] = simpleEscapeSequence(i7); +} +var i7; +function State$1(input, options) { + this.input = input; + this.filename = options["filename"] || null; + this.schema = options["schema"] || _default; + this.onWarning = options["onWarning"] || null; + this.legacy = options["legacy"] || false; + this.json = options["json"] || false; + this.listener = options["listener"] || null; + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + this.firstTabInLine = -1; + this.documents = []; +} +function generateError(state, message) { + var mark = { + name: state.filename, + buffer: state.input.slice(0, -1), + // omit trailing \0 + position: state.position, + line: state.line, + column: state.position - state.lineStart + }; + mark.snippet = snippet(mark); + return new exception(message, mark); +} +function throwError(state, message) { + throw generateError(state, message); +} +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} +var directiveHandlers = { + YAML: function handleYamlDirective(state, name2, args) { + var match, major, minor; + if (state.version !== null) { + throwError(state, "duplication of %YAML directive"); + } + if (args.length !== 1) { + throwError(state, "YAML directive accepts exactly one argument"); + } + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + if (match === null) { + throwError(state, "ill-formed argument of the YAML directive"); + } + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + if (major !== 1) { + throwError(state, "unacceptable YAML version of the document"); + } + state.version = args[0]; + state.checkLineBreaks = minor < 2; + if (minor !== 1 && minor !== 2) { + throwWarning(state, "unsupported YAML version of the document"); + } + }, + TAG: function handleTagDirective(state, name2, args) { + var handle, prefix; + if (args.length !== 2) { + throwError(state, "TAG directive accepts exactly two arguments"); + } + handle = args[0]; + prefix = args[1]; + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, "ill-formed tag handle (first argument) of the TAG directive"); + } + if (_hasOwnProperty$1.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, "ill-formed tag prefix (second argument) of the TAG directive"); + } + try { + prefix = decodeURIComponent(prefix); + } catch (err) { + throwError(state, "tag prefix is malformed: " + prefix); + } + state.tagMap[handle] = prefix; + } +}; +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + if (start < end) { + _result = state.input.slice(start, end); + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 9 || 32 <= _character && _character <= 1114111)) { + throwError(state, "expected valid JSON character"); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, "the stream contains non-printable characters"); + } + state.result += _result; + } +} +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index4, quantity; + if (!common.isObject(source)) { + throwError(state, "cannot merge mappings; the provided source object is unacceptable"); + } + sourceKeys = Object.keys(source); + for (index4 = 0, quantity = sourceKeys.length; index4 < quantity; index4 += 1) { + key = sourceKeys[index4]; + if (!_hasOwnProperty$1.call(destination, key)) { + setProperty2(destination, key, source[key]); + overridableKeys[key] = true; + } + } +} +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) { + var index4, quantity; + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + for (index4 = 0, quantity = keyNode.length; index4 < quantity; index4 += 1) { + if (Array.isArray(keyNode[index4])) { + throwError(state, "nested arrays are not supported inside keys"); + } + if (typeof keyNode === "object" && _class(keyNode[index4]) === "[object Object]") { + keyNode[index4] = "[object Object]"; + } + } + } + if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") { + keyNode = "[object Object]"; + } + keyNode = String(keyNode); + if (_result === null) { + _result = {}; + } + if (keyTag === "tag:yaml.org,2002:merge") { + if (Array.isArray(valueNode)) { + for (index4 = 0, quantity = valueNode.length; index4 < quantity; index4 += 1) { + mergeMappings(state, _result, valueNode[index4], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) { + state.line = startLine || state.line; + state.lineStart = startLineStart || state.lineStart; + state.position = startPos || state.position; + throwError(state, "duplicated mapping key"); + } + setProperty2(_result, keyNode, valueNode); + delete overridableKeys[keyNode]; + } + return _result; +} +function readLineBreak(state) { + var ch; + ch = state.input.charCodeAt(state.position); + if (ch === 10) { + state.position++; + } else if (ch === 13) { + state.position++; + if (state.input.charCodeAt(state.position) === 10) { + state.position++; + } + } else { + throwError(state, "a line break is expected"); + } + state.line += 1; + state.lineStart = state.position; + state.firstTabInLine = -1; +} +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + if (ch === 9 && state.firstTabInLine === -1) { + state.firstTabInLine = state.position; + } + ch = state.input.charCodeAt(++state.position); + } + if (allowComments && ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 10 && ch !== 13 && ch !== 0); + } + if (is_EOL(ch)) { + readLineBreak(state); + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + while (ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, "deficient indentation"); + } + return lineBreaks; +} +function testDocumentSeparator(state) { + var _position = state.position, ch; + ch = state.input.charCodeAt(_position); + if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) { + _position += 3; + ch = state.input.charCodeAt(_position); + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + return false; +} +function writeFoldedLines(state, count2) { + if (count2 === 1) { + state.result += " "; + } else if (count2 > 1) { + state.result += common.repeat("\n", count2 - 1); + } +} +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch; + ch = state.input.charCodeAt(state.position); + if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) { + return false; + } + if (ch === 63 || ch === 45) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + state.kind = "scalar"; + state.result = ""; + captureStart = captureEnd = state.position; + hasPendingContent = false; + while (ch !== 0) { + if (ch === 58) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + } else if (ch === 35) { + preceding = state.input.charCodeAt(state.position - 1); + if (is_WS_OR_EOL(preceding)) { + break; + } + } else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + ch = state.input.charCodeAt(++state.position); + } + captureSegment(state, captureStart, captureEnd, false); + if (state.result) { + return true; + } + state.kind = _kind; + state.result = _result; + return false; +} +function readSingleQuotedScalar(state, nodeIndent) { + var ch, captureStart, captureEnd; + ch = state.input.charCodeAt(state.position); + if (ch !== 39) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 39) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (ch === 39) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, "unexpected end of the document within a single quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError(state, "unexpected end of the stream within a single quoted scalar"); +} +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, captureEnd, hexLength, hexResult, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 34) { + return false; + } + state.kind = "scalar"; + state.result = ""; + state.position++; + captureStart = captureEnd = state.position; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 34) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + } else if (ch === 92) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + } else { + throwError(state, "expected hexadecimal character"); + } + } + state.result += charFromCodepoint(hexResult); + state.position++; + } else { + throwError(state, "unknown escape sequence"); + } + captureStart = captureEnd = state.position; + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, "unexpected end of the document within a double quoted scalar"); + } else { + state.position++; + captureEnd = state.position; + } + } + throwError(state, "unexpected end of the stream within a double quoted scalar"); +} +function readFlowCollection(state, nodeIndent) { + var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair2, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 91) { + terminator = 93; + isMapping = false; + _result = []; + } else if (ch === 123) { + terminator = 125; + isMapping = true; + _result = {}; + } else { + return false; + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(++state.position); + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? "mapping" : "sequence"; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, "missed comma between flow collection entries"); + } else if (ch === 44) { + throwError(state, "expected the node content, but found ','"); + } + keyTag = keyNode = valueNode = null; + isPair2 = isExplicitPair = false; + if (ch === 63) { + following = state.input.charCodeAt(state.position + 1); + if (is_WS_OR_EOL(following)) { + isPair2 = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + _line = state.line; + _lineStart = state.lineStart; + _pos = state.position; + composeNode2(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if ((isExplicitPair || state.line === _line) && ch === 58) { + isPair2 = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode2(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos); + } else if (isPair2) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos)); + } else { + _result.push(keyNode); + } + skipSeparationSpace(state, true, nodeIndent); + ch = state.input.charCodeAt(state.position); + if (ch === 44) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + throwError(state, "unexpected end of the stream within a flow collection"); +} +function readBlockScalar(state, nodeIndent) { + var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch; + ch = state.input.charCodeAt(state.position); + if (ch === 124) { + folding = false; + } else if (ch === 62) { + folding = true; + } else { + return false; + } + state.kind = "scalar"; + state.result = ""; + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + if (ch === 43 || ch === 45) { + if (CHOMPING_CLIP === chomping) { + chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, "repeat of a chomping mode identifier"); + } + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one"); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, "repeat of an indentation width identifier"); + } + } else { + break; + } + } + if (is_WHITE_SPACE(ch)) { + do { + ch = state.input.charCodeAt(++state.position); + } while (is_WHITE_SPACE(ch)); + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (!is_EOL(ch) && ch !== 0); + } + } + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + ch = state.input.charCodeAt(state.position); + while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + if (is_EOL(ch)) { + emptyLines++; + continue; + } + if (state.lineIndent < textIndent) { + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { + state.result += "\n"; + } + } + break; + } + if (folding) { + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat("\n", emptyLines + 1); + } else if (emptyLines === 0) { + if (didReadContent) { + state.result += " "; + } + } else { + state.result += common.repeat("\n", emptyLines); + } + } else { + state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines); + } + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + while (!is_EOL(ch) && ch !== 0) { + ch = state.input.charCodeAt(++state.position); + } + captureSegment(state, captureStart, state.position, false); + } + return true; +} +function readBlockSequence(state, nodeIndent) { + var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch; + if (state.firstTabInLine !== -1) + return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + if (ch !== 45) { + break; + } + following = state.input.charCodeAt(state.position + 1); + if (!is_WS_OR_EOL(following)) { + break; + } + detected = true; + state.position++; + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + _line = state.line; + composeNode2(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError(state, "bad indentation of a sequence entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "sequence"; + state.result = _result; + return true; + } + return false; +} +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch; + if (state.firstTabInLine !== -1) + return false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + ch = state.input.charCodeAt(state.position); + while (ch !== 0) { + if (!atExplicitKey && state.firstTabInLine !== -1) { + state.position = state.firstTabInLine; + throwError(state, "tab characters must not be used in indentation"); + } + following = state.input.charCodeAt(state.position + 1); + _line = state.line; + if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) { + if (ch === 63) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = true; + allowCompact = true; + } else if (atExplicitKey) { + atExplicitKey = false; + allowCompact = true; + } else { + throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"); + } + state.position += 1; + ch = following; + } else { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + if (!composeNode2(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + break; + } + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 58) { + ch = state.input.charCodeAt(++state.position); + if (!is_WS_OR_EOL(ch)) { + throwError(state, "a whitespace character is expected after the key-value separator within a block mapping"); + } + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + } else if (detected) { + throwError(state, "can not read an implicit mapping pair; a colon is missed"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } else if (detected) { + throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key"); + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; + } + } + if (state.line === _line || state.lineIndent > nodeIndent) { + if (atExplicitKey) { + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; + } + if (composeNode2(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos); + keyTag = keyNode = valueNode = null; + } + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) { + throwError(state, "bad indentation of a mapping entry"); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos); + } + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = "mapping"; + state.result = _result; + } + return detected; +} +function readTagProperty(state) { + var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 33) + return false; + if (state.tag !== null) { + throwError(state, "duplication of a tag property"); + } + ch = state.input.charCodeAt(++state.position); + if (ch === 60) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + } else if (ch === 33) { + isNamed = true; + tagHandle = "!!"; + ch = state.input.charCodeAt(++state.position); + } else { + tagHandle = "!"; + } + _position = state.position; + if (isVerbatim) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && ch !== 62); + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, "unexpected end of the stream within a verbatim tag"); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + if (ch === 33) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, "named tag handle cannot contain such characters"); + } + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, "tag suffix cannot contain exclamation marks"); + } + } + ch = state.input.charCodeAt(++state.position); + } + tagName = state.input.slice(_position, state.position); + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, "tag suffix cannot contain flow indicator characters"); + } + } + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, "tag name cannot contain such characters: " + tagName); + } + try { + tagName = decodeURIComponent(tagName); + } catch (err) { + throwError(state, "tag name is malformed: " + tagName); + } + if (isVerbatim) { + state.tag = tagName; + } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + } else if (tagHandle === "!") { + state.tag = "!" + tagName; + } else if (tagHandle === "!!") { + state.tag = "tag:yaml.org,2002:" + tagName; + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + return true; +} +function readAnchorProperty(state) { + var _position, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 38) + return false; + if (state.anchor !== null) { + throwError(state, "duplication of an anchor property"); + } + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError(state, "name of an anchor node must contain at least one character"); + } + state.anchor = state.input.slice(_position, state.position); + return true; +} +function readAlias(state) { + var _position, alias, ch; + ch = state.input.charCodeAt(state.position); + if (ch !== 42) + return false; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (state.position === _position) { + throwError(state, "name of an alias node must contain at least one character"); + } + alias = state.input.slice(_position, state.position); + if (!_hasOwnProperty$1.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} +function composeNode2(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type3, flowIndent, blockIndent; + if (state.listener !== null) { + state.listener("open", state); + } + state.tag = null; + state.anchor = null; + state.kind = null; + state.result = null; + allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext; + if (allowToSeek) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + blockIndent = state.position - state.lineStart; + if (indentStatus === 1) { + if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + } else if (readAlias(state)) { + hasContent = true; + if (state.tag !== null || state.anchor !== null) { + throwError(state, "alias node should not have any properties"); + } + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + if (state.tag === null) { + state.tag = "?"; + } + } + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + if (state.tag === null) { + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } else if (state.tag === "?") { + if (state.result !== null && state.kind !== "scalar") { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type3 = state.implicitTypes[typeIndex]; + if (type3.resolve(state.result)) { + state.result = type3.construct(state.result); + state.tag = type3.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (state.tag !== "!") { + if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) { + type3 = state.typeMap[state.kind || "fallback"][state.tag]; + } else { + type3 = null; + typeList = state.typeMap.multi[state.kind || "fallback"]; + for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) { + if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) { + type3 = typeList[typeIndex]; + break; + } + } + } + if (!type3) { + throwError(state, "unknown tag !<" + state.tag + ">"); + } + if (state.result !== null && type3.kind !== state.kind) { + throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type3.kind + '", not "' + state.kind + '"'); + } + if (!type3.resolve(state.result, state.tag)) { + throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag"); + } else { + state.result = type3.construct(state.result, state.tag); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } + if (state.listener !== null) { + state.listener("close", state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} +function readDocument(state) { + var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch; + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = /* @__PURE__ */ Object.create(null); + state.anchorMap = /* @__PURE__ */ Object.create(null); + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + if (state.lineIndent > 0 || ch !== 37) { + break; + } + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + if (directiveName.length < 1) { + throwError(state, "directive name must not be less than one character in length"); + } + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + if (ch === 35) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0 && !is_EOL(ch)); + break; + } + if (is_EOL(ch)) + break; + _position = state.position; + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + directiveArgs.push(state.input.slice(_position, state.position)); + } + if (ch !== 0) + readLineBreak(state); + if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + skipSeparationSpace(state, true, -1); + if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } else if (hasDirectives) { + throwError(state, "directives end mark is expected"); + } + composeNode2(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, "non-ASCII line breaks are interpreted as content"); + } + state.documents.push(state.result); + if (state.position === state.lineStart && testDocumentSeparator(state)) { + if (state.input.charCodeAt(state.position) === 46) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + if (state.position < state.length - 1) { + throwError(state, "end of the stream or a document separator is expected"); + } else { + return; + } +} +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + if (input.length !== 0) { + if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) { + input += "\n"; + } + if (input.charCodeAt(0) === 65279) { + input = input.slice(1); + } + } + var state = new State$1(input, options); + var nullpos = input.indexOf("\0"); + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, "null byte is not allowed in input"); + } + state.input += "\0"; + while (state.input.charCodeAt(state.position) === 32) { + state.lineIndent += 1; + state.position += 1; + } + while (state.position < state.length - 1) { + readDocument(state); + } + return state.documents; +} +function loadAll$1(input, iterator, options) { + if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") { + options = iterator; + iterator = null; + } + var documents = loadDocuments(input, options); + if (typeof iterator !== "function") { + return documents; + } + for (var index4 = 0, length = documents.length; index4 < length; index4 += 1) { + iterator(documents[index4]); + } +} +function load$1(input, options) { + var documents = loadDocuments(input, options); + if (documents.length === 0) { + return void 0; + } else if (documents.length === 1) { + return documents[0]; + } + throw new exception("expected a single document in the stream, but found more"); +} +var loadAll_1 = loadAll$1; +var load_1 = load$1; +var loader = { + loadAll: loadAll_1, + load: load_1 +}; +var _toString = Object.prototype.toString; +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var CHAR_BOM = 65279; +var CHAR_TAB = 9; +var CHAR_LINE_FEED = 10; +var CHAR_CARRIAGE_RETURN = 13; +var CHAR_SPACE = 32; +var CHAR_EXCLAMATION = 33; +var CHAR_DOUBLE_QUOTE = 34; +var CHAR_SHARP = 35; +var CHAR_PERCENT = 37; +var CHAR_AMPERSAND = 38; +var CHAR_SINGLE_QUOTE = 39; +var CHAR_ASTERISK = 42; +var CHAR_COMMA = 44; +var CHAR_MINUS = 45; +var CHAR_COLON = 58; +var CHAR_EQUALS = 61; +var CHAR_GREATER_THAN = 62; +var CHAR_QUESTION = 63; +var CHAR_COMMERCIAL_AT = 64; +var CHAR_LEFT_SQUARE_BRACKET = 91; +var CHAR_RIGHT_SQUARE_BRACKET = 93; +var CHAR_GRAVE_ACCENT = 96; +var CHAR_LEFT_CURLY_BRACKET = 123; +var CHAR_VERTICAL_LINE = 124; +var CHAR_RIGHT_CURLY_BRACKET = 125; +var ESCAPE_SEQUENCES = {}; +ESCAPE_SEQUENCES[0] = "\\0"; +ESCAPE_SEQUENCES[7] = "\\a"; +ESCAPE_SEQUENCES[8] = "\\b"; +ESCAPE_SEQUENCES[9] = "\\t"; +ESCAPE_SEQUENCES[10] = "\\n"; +ESCAPE_SEQUENCES[11] = "\\v"; +ESCAPE_SEQUENCES[12] = "\\f"; +ESCAPE_SEQUENCES[13] = "\\r"; +ESCAPE_SEQUENCES[27] = "\\e"; +ESCAPE_SEQUENCES[34] = '\\"'; +ESCAPE_SEQUENCES[92] = "\\\\"; +ESCAPE_SEQUENCES[133] = "\\N"; +ESCAPE_SEQUENCES[160] = "\\_"; +ESCAPE_SEQUENCES[8232] = "\\L"; +ESCAPE_SEQUENCES[8233] = "\\P"; +var DEPRECATED_BOOLEANS_SYNTAX = [ + "y", + "Y", + "yes", + "Yes", + "YES", + "on", + "On", + "ON", + "n", + "N", + "no", + "No", + "NO", + "off", + "Off", + "OFF" +]; +var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/; +function compileStyleMap(schema8, map4) { + var result2, keys2, index4, length, tag, style, type3; + if (map4 === null) + return {}; + result2 = {}; + keys2 = Object.keys(map4); + for (index4 = 0, length = keys2.length; index4 < length; index4 += 1) { + tag = keys2[index4]; + style = String(map4[tag]); + if (tag.slice(0, 2) === "!!") { + tag = "tag:yaml.org,2002:" + tag.slice(2); + } + type3 = schema8.compiledTypeMap["fallback"][tag]; + if (type3 && _hasOwnProperty.call(type3.styleAliases, style)) { + style = type3.styleAliases[style]; + } + result2[tag] = style; + } + return result2; +} +function encodeHex(character) { + var string2, handle, length; + string2 = character.toString(16).toUpperCase(); + if (character <= 255) { + handle = "x"; + length = 2; + } else if (character <= 65535) { + handle = "u"; + length = 4; + } else if (character <= 4294967295) { + handle = "U"; + length = 8; + } else { + throw new exception("code point within a string may not be greater than 0xFFFFFFFF"); + } + return "\\" + handle + common.repeat("0", length - string2.length) + string2; +} +var QUOTING_TYPE_SINGLE = 1; +var QUOTING_TYPE_DOUBLE = 2; +function State(options) { + this.schema = options["schema"] || _default; + this.indent = Math.max(1, options["indent"] || 2); + this.noArrayIndent = options["noArrayIndent"] || false; + this.skipInvalid = options["skipInvalid"] || false; + this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"]; + this.styleMap = compileStyleMap(this.schema, options["styles"] || null); + this.sortKeys = options["sortKeys"] || false; + this.lineWidth = options["lineWidth"] || 80; + this.noRefs = options["noRefs"] || false; + this.noCompatMode = options["noCompatMode"] || false; + this.condenseFlow = options["condenseFlow"] || false; + this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE; + this.forceQuotes = options["forceQuotes"] || false; + this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null; + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + this.tag = null; + this.result = ""; + this.duplicates = []; + this.usedDuplicates = null; +} +function indentString(string2, spaces) { + var ind = common.repeat(" ", spaces), position = 0, next = -1, result2 = "", line, length = string2.length; + while (position < length) { + next = string2.indexOf("\n", position); + if (next === -1) { + line = string2.slice(position); + position = length; + } else { + line = string2.slice(position, next + 1); + position = next + 1; + } + if (line.length && line !== "\n") + result2 += ind; + result2 += line; + } + return result2; +} +function generateNextLine(state, level) { + return "\n" + common.repeat(" ", state.indent * level); +} +function testImplicitResolving(state, str2) { + var index4, length, type3; + for (index4 = 0, length = state.implicitTypes.length; index4 < length; index4 += 1) { + type3 = state.implicitTypes[index4]; + if (type3.resolve(str2)) { + return true; + } + } + return false; +} +function isWhitespace(c7) { + return c7 === CHAR_SPACE || c7 === CHAR_TAB; +} +function isPrintable(c7) { + return 32 <= c7 && c7 <= 126 || 161 <= c7 && c7 <= 55295 && c7 !== 8232 && c7 !== 8233 || 57344 <= c7 && c7 <= 65533 && c7 !== CHAR_BOM || 65536 <= c7 && c7 <= 1114111; +} +function isNsCharOrWhitespace(c7) { + return isPrintable(c7) && c7 !== CHAR_BOM && c7 !== CHAR_CARRIAGE_RETURN && c7 !== CHAR_LINE_FEED; +} +function isPlainSafe(c7, prev, inblock) { + var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c7); + var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c7); + return ( + // ns-plain-safe + (inblock ? ( + // c = flow-in + cIsNsCharOrWhitespace + ) : cIsNsCharOrWhitespace && c7 !== CHAR_COMMA && c7 !== CHAR_LEFT_SQUARE_BRACKET && c7 !== CHAR_RIGHT_SQUARE_BRACKET && c7 !== CHAR_LEFT_CURLY_BRACKET && c7 !== CHAR_RIGHT_CURLY_BRACKET) && c7 !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c7 === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar + ); +} +function isPlainSafeFirst(c7) { + return isPrintable(c7) && c7 !== CHAR_BOM && !isWhitespace(c7) && c7 !== CHAR_MINUS && c7 !== CHAR_QUESTION && c7 !== CHAR_COLON && c7 !== CHAR_COMMA && c7 !== CHAR_LEFT_SQUARE_BRACKET && c7 !== CHAR_RIGHT_SQUARE_BRACKET && c7 !== CHAR_LEFT_CURLY_BRACKET && c7 !== CHAR_RIGHT_CURLY_BRACKET && c7 !== CHAR_SHARP && c7 !== CHAR_AMPERSAND && c7 !== CHAR_ASTERISK && c7 !== CHAR_EXCLAMATION && c7 !== CHAR_VERTICAL_LINE && c7 !== CHAR_EQUALS && c7 !== CHAR_GREATER_THAN && c7 !== CHAR_SINGLE_QUOTE && c7 !== CHAR_DOUBLE_QUOTE && c7 !== CHAR_PERCENT && c7 !== CHAR_COMMERCIAL_AT && c7 !== CHAR_GRAVE_ACCENT; +} +function isPlainSafeLast(c7) { + return !isWhitespace(c7) && c7 !== CHAR_COLON; +} +function codePointAt(string2, pos) { + var first = string2.charCodeAt(pos), second; + if (first >= 55296 && first <= 56319 && pos + 1 < string2.length) { + second = string2.charCodeAt(pos + 1); + if (second >= 56320 && second <= 57343) { + return (first - 55296) * 1024 + second - 56320 + 65536; + } + } + return first; +} +function needIndentIndicator(string2) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string2); +} +var STYLE_PLAIN = 1; +var STYLE_SINGLE = 2; +var STYLE_LITERAL = 3; +var STYLE_FOLDED = 4; +var STYLE_DOUBLE = 5; +function chooseScalarStyle(string2, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) { + var i7; + var char = 0; + var prevChar = null; + var hasLineBreak = false; + var hasFoldableLine = false; + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; + var plain = isPlainSafeFirst(codePointAt(string2, 0)) && isPlainSafeLast(codePointAt(string2, string2.length - 1)); + if (singleLineOnly || forceQuotes) { + for (i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt(string2, i7); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + } else { + for (i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt(string2, i7); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented. + i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "; + previousLineBreak = i7; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + plain = plain && isPlainSafe(char, prevChar, inblock); + prevChar = char; + } + hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i7 - previousLineBreak - 1 > lineWidth && string2[previousLineBreak + 1] !== " "); + } + if (!hasLineBreak && !hasFoldableLine) { + if (plain && !forceQuotes && !testAmbiguousType(string2)) { + return STYLE_PLAIN; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; + } + if (indentPerLevel > 9 && needIndentIndicator(string2)) { + return STYLE_DOUBLE; + } + if (!forceQuotes) { + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; + } + return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE; +} +function writeScalar(state, string2, level, iskey, inblock) { + state.dump = function() { + if (string2.length === 0) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''"; + } + if (!state.noCompatMode) { + if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string2) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string2)) { + return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string2 + '"' : "'" + string2 + "'"; + } + } + var indent = state.indent * Math.max(1, level); + var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel; + function testAmbiguity(string3) { + return testImplicitResolving(state, string3); + } + switch (chooseScalarStyle( + string2, + singleLineOnly, + state.indent, + lineWidth, + testAmbiguity, + state.quotingType, + state.forceQuotes && !iskey, + inblock + )) { + case STYLE_PLAIN: + return string2; + case STYLE_SINGLE: + return "'" + string2.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return "|" + blockHeader(string2, state.indent) + dropEndingNewline(indentString(string2, indent)); + case STYLE_FOLDED: + return ">" + blockHeader(string2, state.indent) + dropEndingNewline(indentString(foldString(string2, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string2) + '"'; + default: + throw new exception("impossible error: invalid scalar style"); + } + }(); +} +function blockHeader(string2, indentPerLevel) { + var indentIndicator = needIndentIndicator(string2) ? String(indentPerLevel) : ""; + var clip = string2[string2.length - 1] === "\n"; + var keep = clip && (string2[string2.length - 2] === "\n" || string2 === "\n"); + var chomp = keep ? "+" : clip ? "" : "-"; + return indentIndicator + chomp + "\n"; +} +function dropEndingNewline(string2) { + return string2[string2.length - 1] === "\n" ? string2.slice(0, -1) : string2; +} +function foldString(string2, width) { + var lineRe = /(\n+)([^\n]*)/g; + var result2 = function() { + var nextLF = string2.indexOf("\n"); + nextLF = nextLF !== -1 ? nextLF : string2.length; + lineRe.lastIndex = nextLF; + return foldLine(string2.slice(0, nextLF), width); + }(); + var prevMoreIndented = string2[0] === "\n" || string2[0] === " "; + var moreIndented; + var match; + while (match = lineRe.exec(string2)) { + var prefix = match[1], line = match[2]; + moreIndented = line[0] === " "; + result2 += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width); + prevMoreIndented = moreIndented; + } + return result2; +} +function foldLine(line, width) { + if (line === "" || line[0] === " ") + return line; + var breakRe = / [^ ]/g; + var match; + var start = 0, end, curr = 0, next = 0; + var result2 = ""; + while (match = breakRe.exec(line)) { + next = match.index; + if (next - start > width) { + end = curr > start ? curr : next; + result2 += "\n" + line.slice(start, end); + start = end + 1; + } + curr = next; + } + result2 += "\n"; + if (line.length - start > width && curr > start) { + result2 += line.slice(start, curr) + "\n" + line.slice(curr + 1); + } else { + result2 += line.slice(start); + } + return result2.slice(1); +} +function escapeString(string2) { + var result2 = ""; + var char = 0; + var escapeSeq; + for (var i7 = 0; i7 < string2.length; char >= 65536 ? i7 += 2 : i7++) { + char = codePointAt(string2, i7); + escapeSeq = ESCAPE_SEQUENCES[char]; + if (!escapeSeq && isPrintable(char)) { + result2 += string2[i7]; + if (char >= 65536) + result2 += string2[i7 + 1]; + } else { + result2 += escapeSeq || encodeHex(char); + } + } + return result2; +} +function writeFlowSequence(state, level, object) { + var _result = "", _tag = state.tag, index4, length, value2; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + value2 = object[index4]; + if (state.replacer) { + value2 = state.replacer.call(object, String(index4), value2); + } + if (writeNode(state, level, value2, false, false) || typeof value2 === "undefined" && writeNode(state, level, null, false, false)) { + if (_result !== "") + _result += "," + (!state.condenseFlow ? " " : ""); + _result += state.dump; + } + } + state.tag = _tag; + state.dump = "[" + _result + "]"; +} +function writeBlockSequence(state, level, object, compact2) { + var _result = "", _tag = state.tag, index4, length, value2; + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + value2 = object[index4]; + if (state.replacer) { + value2 = state.replacer.call(object, String(index4), value2); + } + if (writeNode(state, level + 1, value2, true, true, false, true) || typeof value2 === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) { + if (!compact2 || _result !== "") { + _result += generateNextLine(state, level); + } + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += "-"; + } else { + _result += "- "; + } + _result += state.dump; + } + } + state.tag = _tag; + state.dump = _result || "[]"; +} +function writeFlowMapping(state, level, object) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, pairBuffer; + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (_result !== "") + pairBuffer += ", "; + if (state.condenseFlow) + pairBuffer += '"'; + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode(state, level, objectKey, false, false)) { + continue; + } + if (state.dump.length > 1024) + pairBuffer += "? "; + pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " "); + if (!writeNode(state, level, objectValue, false, false)) { + continue; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = "{" + _result + "}"; +} +function writeBlockMapping(state, level, object, compact2) { + var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index4, length, objectKey, objectValue, explicitPair, pairBuffer; + if (state.sortKeys === true) { + objectKeyList.sort(); + } else if (typeof state.sortKeys === "function") { + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + throw new exception("sortKeys must be a boolean or a function"); + } + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + pairBuffer = ""; + if (!compact2 || _result !== "") { + pairBuffer += generateNextLine(state, level); + } + objectKey = objectKeyList[index4]; + objectValue = object[objectKey]; + if (state.replacer) { + objectValue = state.replacer.call(object, objectKey, objectValue); + } + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; + } + explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024; + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += "?"; + } else { + pairBuffer += "? "; + } + } + pairBuffer += state.dump; + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; + } + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ":"; + } else { + pairBuffer += ": "; + } + pairBuffer += state.dump; + _result += pairBuffer; + } + state.tag = _tag; + state.dump = _result || "{}"; +} +function detectType(state, object, explicit) { + var _result, typeList, index4, length, type3, style; + typeList = explicit ? state.explicitTypes : state.implicitTypes; + for (index4 = 0, length = typeList.length; index4 < length; index4 += 1) { + type3 = typeList[index4]; + if ((type3.instanceOf || type3.predicate) && (!type3.instanceOf || typeof object === "object" && object instanceof type3.instanceOf) && (!type3.predicate || type3.predicate(object))) { + if (explicit) { + if (type3.multi && type3.representName) { + state.tag = type3.representName(object); + } else { + state.tag = type3.tag; + } + } else { + state.tag = "?"; + } + if (type3.represent) { + style = state.styleMap[type3.tag] || type3.defaultStyle; + if (_toString.call(type3.represent) === "[object Function]") { + _result = type3.represent(object, style); + } else if (_hasOwnProperty.call(type3.represent, style)) { + _result = type3.represent[style](object, style); + } else { + throw new exception("!<" + type3.tag + '> tag resolver accepts not "' + style + '" style'); + } + state.dump = _result; + } + return true; + } + } + return false; +} +function writeNode(state, level, object, block, compact2, iskey, isblockseq) { + state.tag = null; + state.dump = object; + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + var type3 = _toString.call(state.dump); + var inblock = block; + var tagStr; + if (block) { + block = state.flowLevel < 0 || state.flowLevel > level; + } + var objectOrArray = type3 === "[object Object]" || type3 === "[object Array]", duplicateIndex, duplicate; + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) { + compact2 = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = "*ref_" + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type3 === "[object Object]") { + if (block && Object.keys(state.dump).length !== 0) { + writeBlockMapping(state, level, state.dump, compact2); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object Array]") { + if (block && state.dump.length !== 0) { + if (state.noArrayIndent && !isblockseq && level > 0) { + writeBlockSequence(state, level - 1, state.dump, compact2); + } else { + writeBlockSequence(state, level, state.dump, compact2); + } + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, level, state.dump); + if (duplicate) { + state.dump = "&ref_" + duplicateIndex + " " + state.dump; + } + } + } else if (type3 === "[object String]") { + if (state.tag !== "?") { + writeScalar(state, state.dump, level, iskey, inblock); + } + } else if (type3 === "[object Undefined]") { + return false; + } else { + if (state.skipInvalid) + return false; + throw new exception("unacceptable kind of an object to dump " + type3); + } + if (state.tag !== null && state.tag !== "?") { + tagStr = encodeURI( + state.tag[0] === "!" ? state.tag.slice(1) : state.tag + ).replace(/!/g, "%21"); + if (state.tag[0] === "!") { + tagStr = "!" + tagStr; + } else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") { + tagStr = "!!" + tagStr.slice(18); + } else { + tagStr = "!<" + tagStr + ">"; + } + state.dump = tagStr + " " + state.dump; + } + } + return true; +} +function getDuplicateReferences(object, state) { + var objects = [], duplicatesIndexes = [], index4, length; + inspectNode(object, objects, duplicatesIndexes); + for (index4 = 0, length = duplicatesIndexes.length; index4 < length; index4 += 1) { + state.duplicates.push(objects[duplicatesIndexes[index4]]); + } + state.usedDuplicates = new Array(length); +} +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, index4, length; + if (object !== null && typeof object === "object") { + index4 = objects.indexOf(object); + if (index4 !== -1) { + if (duplicatesIndexes.indexOf(index4) === -1) { + duplicatesIndexes.push(index4); + } + } else { + objects.push(object); + if (Array.isArray(object)) { + for (index4 = 0, length = object.length; index4 < length; index4 += 1) { + inspectNode(object[index4], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + for (index4 = 0, length = objectKeyList.length; index4 < length; index4 += 1) { + inspectNode(object[objectKeyList[index4]], objects, duplicatesIndexes); + } + } + } + } +} +function dump$1(input, options) { + options = options || {}; + var state = new State(options); + if (!state.noRefs) + getDuplicateReferences(input, state); + var value2 = input; + if (state.replacer) { + value2 = state.replacer.call({ "": value2 }, "", value2); + } + if (writeNode(state, 0, value2, true, true)) + return state.dump + "\n"; + return ""; +} +var dump_1 = dump$1; +var dumper = { + dump: dump_1 +}; +function renamed(from, to) { + return function() { + throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default."); + }; +} +var Type = type; +var Schema5 = schema5; +var FAILSAFE_SCHEMA = failsafe; +var JSON_SCHEMA = json; +var CORE_SCHEMA = core; +var DEFAULT_SCHEMA = _default; +var load = loader.load; +var loadAll = loader.loadAll; +var dump = dumper.dump; +var YAMLException = exception; +var types2 = { + binary: binary2, + float: float3, + map: map3, + null: _null, + pairs: pairs2, + set: set3, + timestamp: timestamp2, + bool, + int: int3, + merge: merge4, + omap: omap2, + seq: seq2, + str +}; +var safeLoad = renamed("safeLoad", "load"); +var safeLoadAll = renamed("safeLoadAll", "loadAll"); +var safeDump = renamed("safeDump", "dump"); +var jsYaml = { + Type, + Schema: Schema5, + FAILSAFE_SCHEMA, + JSON_SCHEMA, + CORE_SCHEMA, + DEFAULT_SCHEMA, + load, + loadAll, + dump, + YAMLException, + types: types2, + safeLoad, + safeLoadAll, + safeDump +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/JsonSchemaInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +init_path(); + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/Interpreter.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/Utils.js +init_dirname(); +init_buffer2(); +init_process2(); +function isModelObject(model) { + if (model.type !== void 0) { + if (Array.isArray(model.type) && model.type.length === 7) { + return false; + } + return model.type.includes("object"); + } + return false; +} +function inferTypeFromValue(value2) { + if (Array.isArray(value2)) { + return "array"; + } + if (value2 === null) { + return "null"; + } + const typeOfEnum = typeof value2; + if (typeOfEnum === "bigint") { + return "integer"; + } + return typeOfEnum; +} +function interpretName(schema8) { + if (schema8 && typeof schema8 === "object") { + return schema8.title || schema8.$id || schema8["x-modelgen-inferred-name"]; + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretProperties.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretProperties(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.properties === void 0 || schema8.oneOf) { + return; + } + model.addTypes("object"); + for (const [propertyName, propertySchema] of Object.entries(schema8.properties)) { + const discriminator = propertyName === interpreterOptions.discriminator ? interpreterOptions.discriminator : void 0; + if (discriminator) { + model.discriminator = discriminator; + } + const propertyModel = interpreter.interpret(propertySchema, Object.assign(Object.assign({}, interpreterOptions), { discriminator })); + if (propertyModel !== void 0) { + model.addProperty(propertyName, propertyModel, schema8); + } + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretAllOf.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretAllOf(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.allOf === void 0 || schema8.oneOf) { + return; + } + for (const subSchema of schema8.allOf) { + const discriminator = interpreter.discriminatorProperty(subSchema); + if (discriminator !== void 0) { + interpreterOptions = Object.assign(Object.assign({}, interpreterOptions), { discriminator }); + model.discriminator = discriminator; + } + } + if (interpreterOptions.allowInheritance && interpreterOptions.disableCache === true) { + throw new Error(`Inheritance is enabled in combination with allOf but cache is disabled. Inheritance will not work as expected.`); + } + for (const subSchema of schema8.allOf) { + const subModel = interpreter.interpret(subSchema, interpreterOptions); + if (!subModel) { + continue; + } + if (interpreterOptions.allowInheritance) { + const freshModel = interpreter.interpret(subSchema, Object.assign({}, interpreterOptions)); + if (freshModel && isModelObject(freshModel)) { + Logger2.info(`Processing allOf, inheritance is enabled, ${model.$id} inherits from ${freshModel.$id}`, model, subModel); + model.addExtendedModel(freshModel); + } + } + Logger2.info("Processing allOf, inheritance is not enabled. AllOf model is merged together with already interpreted model", model, subModel); + interpreter.interpretAndCombineSchema(subSchema, model, schema8, interpreterOptions); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretConst.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretConst(schema8, model, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (schema8 instanceof Draft4Schema || typeof schema8 === "boolean" || schema8.const === void 0) { + return; + } + if ((schema8 instanceof AsyncapiV2Schema || schema8 instanceof SwaggerV2Schema || schema8 instanceof OpenapiV3Schema) && interpreterOptions.discriminator) { + model.enum = [schema8.const]; + } + model.const = schema8.const; + if (schema8.type === void 0) { + const inferredType = inferTypeFromValue(schema8.const); + if (inferredType !== void 0) { + model.setType(inferredType); + } + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretEnum.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretEnum(schema8, model) { + if (typeof schema8 === "boolean" || schema8.enum === void 0) { + return; + } + for (const enumValue of schema8.enum) { + if (schema8.type === void 0) { + const inferredType = inferTypeFromValue(enumValue); + if (inferredType !== void 0) { + model.addTypes(inferredType); + } + } + model.addEnum(enumValue); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretAdditionalProperties.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretAdditionalProperties(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || isModelObject(model) === false) { + return; + } + let defaultAdditionalProperties = true; + const hasProperties = Object.keys(schema8.properties || {}).length > 0; + if (hasProperties && interpreterOptions.ignoreAdditionalProperties === true) { + defaultAdditionalProperties = false; + } + const additionalProperties = schema8.additionalProperties === void 0 ? defaultAdditionalProperties : schema8.additionalProperties; + const additionalPropertiesModel = interpreter.interpret(additionalProperties, interpreterOptions); + if (additionalPropertiesModel !== void 0) { + model.addAdditionalProperty(additionalPropertiesModel, schema8); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretItems.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretItems(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.items === void 0) { + return; + } + model.addTypes("array"); + interpretArrayItems(schema8, schema8.items, model, interpreter, interpreterOptions); +} +function interpretArrayItems(rootSchema, itemSchemas, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (Array.isArray(itemSchemas)) { + for (const [index4, itemSchema] of itemSchemas.entries()) { + const itemModel = interpreter.interpret(itemSchema, interpreterOptions); + if (itemModel !== void 0) { + model.addItemTuple(itemModel, rootSchema, index4); + } + } + } else { + const itemModel = interpreter.interpret(itemSchemas, interpreterOptions); + if (itemModel !== void 0) { + model.addItem(itemModel, rootSchema); + } + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretPatternProperties.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretPatternProperties(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean") { + return; + } + for (const [pattern5, patternSchema] of Object.entries(schema8.patternProperties || {})) { + const patternModel = interpreter.interpret(patternSchema, interpreterOptions); + if (patternModel !== void 0) { + model.addPatternProperty(pattern5, patternModel, schema8); + } + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretNot.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretNot(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean") { + return; + } + if (schema8.not === void 0) { + return; + } + if (typeof schema8.not === "object") { + const notSchema = schema8.not; + const newInterpreterOptions = Object.assign(Object.assign({}, interpreterOptions), { allowInheritance: false }); + const notModel = interpreter.interpret(notSchema, newInterpreterOptions); + if (notModel !== void 0) { + if (notModel.type !== void 0) { + model.removeType(notModel.type); + } + if (notModel.enum !== void 0) { + model.removeEnum(notModel.enum); + } + } + } else if (typeof schema8.not === "boolean") { + Logger2.warn(`Encountered boolean not schema for model ${model.$id}. This schema are not applied!`, schema8); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretDependencies.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretDependencies(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.dependencies === void 0) { + return; + } + for (const dependency of Object.values(schema8.dependencies)) { + if (!Array.isArray(dependency)) { + interpreter.interpretAndCombineSchema(dependency, model, schema8, interpreterOptions); + } + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretAdditionalItems.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretAdditionalItems(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + var _a2; + if (typeof schema8 === "boolean" || ((_a2 = model.type) === null || _a2 === void 0 ? void 0 : _a2.includes("array")) === false) { + return; + } + const hasArrayTypes = schema8.items !== void 0; + let defaultAdditionalItems = true; + if (hasArrayTypes && interpreterOptions.ignoreAdditionalItems !== void 0) { + defaultAdditionalItems = interpreterOptions.ignoreAdditionalItems ? false : true; + } + const additionalItemsModel = interpreter.interpret(schema8.additionalItems === void 0 ? defaultAdditionalItems : schema8.additionalItems, interpreterOptions); + if (additionalItemsModel !== void 0) { + model.addAdditionalItems(additionalItemsModel, schema8); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretOneOf.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretOneOf(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.oneOf === void 0 || schema8.allOf || schema8.properties) { + return; + } + const discriminator = interpreter.discriminatorProperty(schema8); + interpreterOptions = Object.assign(Object.assign({}, interpreterOptions), { discriminator }); + model.discriminator = discriminator; + for (const oneOfSchema of schema8.oneOf) { + const oneOfModel = interpreter.interpret(oneOfSchema, interpreterOptions); + if (oneOfModel === void 0) { + continue; + } + if (oneOfModel.discriminator) { + model.discriminator = oneOfModel.discriminator; + } + model.addItemUnion(oneOfModel); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretAnyOf.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretAnyOf(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8.anyOf === void 0) { + return; + } + for (const anyOfSchema of schema8.anyOf) { + const anyOfModel = interpreter.interpret(anyOfSchema, interpreterOptions); + if (anyOfModel === void 0) { + continue; + } + model.addItemUnion(anyOfModel); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretOneOfWithAllOf.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretOneOfWithAllOf(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || !schema8.oneOf || !schema8.allOf || schema8.properties || interpreterOptions.allowInheritance) { + return; + } + for (const allOfSchema of schema8.allOf) { + const discriminator = interpreter.discriminatorProperty(allOfSchema); + if (discriminator !== void 0) { + interpreterOptions = Object.assign(Object.assign({}, interpreterOptions), { discriminator }); + model.discriminator = discriminator; + } + } + for (const oneOfSchema of schema8.oneOf) { + const oneOfModel = interpreter.interpret(oneOfSchema, interpreterOptions); + if (!oneOfModel) { + continue; + } + const [firstAllOfSchema, ...allOfSchemas] = schema8.allOf; + if (typeof firstAllOfSchema === "boolean") { + continue; + } + const allOfModel = interpreter.interpret(Object.assign({}, firstAllOfSchema), interpreterOptions); + if (!allOfModel) { + continue; + } + for (const allOfSchema of allOfSchemas) { + interpreter.interpretAndCombineSchema(allOfSchema, allOfModel, firstAllOfSchema, interpreterOptions); + } + interpreter.interpretAndCombineSchema(oneOfSchema, allOfModel, firstAllOfSchema, interpreterOptions); + allOfModel.$id = oneOfModel.$id; + model.addItemUnion(allOfModel); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretOneOfWithProperties.js +init_dirname(); +init_buffer2(); +init_process2(); +function interpretOneOfWithProperties(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || !schema8.oneOf || !schema8.properties || schema8.allOf) { + return; + } + const discriminator = interpreter.discriminatorProperty(schema8); + interpreterOptions = Object.assign(Object.assign({}, interpreterOptions), { discriminator }); + model.discriminator = discriminator; + for (const oneOfSchema of schema8.oneOf) { + const oneOfModel = interpreter.interpret(oneOfSchema, interpreterOptions); + if (!oneOfModel) { + continue; + } + const schemaModel = interpreter.interpret(Object.assign(Object.assign({}, schema8), { oneOf: void 0 }), interpreterOptions); + if (!schemaModel) { + continue; + } + interpreter.interpretAndCombineSchema(oneOfSchema, schemaModel, schema8, interpreterOptions); + model.setType(void 0); + schemaModel.$id = oneOfModel.$id; + model.addItemUnion(schemaModel); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/InterpretThenElse.js +init_dirname(); +init_buffer2(); +init_process2(); +function InterpretThenElse(schema8, model, interpreter, interpreterOptions = Interpreter.defaultInterpreterOptions) { + if (typeof schema8 === "boolean" || schema8 instanceof Draft4Schema || schema8 instanceof Draft6Schema) { + return; + } + if (schema8.then) { + interpretThenElseItem(schema8.then, model, interpreter, interpreterOptions); + } + if (schema8.else) { + interpretThenElseItem(schema8.else, model, interpreter, interpreterOptions); + } +} +function interpretThenElseItem(thenOrElseSchema, model, interpreter, interpreterOptions) { + if (typeof thenOrElseSchema === "boolean" || thenOrElseSchema instanceof Draft4Schema || thenOrElseSchema instanceof Draft6Schema) { + return; + } + interpreter.interpretAndCombineSchema(thenOrElseSchema, model, thenOrElseSchema, interpreterOptions, { + constrictModels: false + }); +} + +// node_modules/@asyncapi/modelina/lib/esm/interpreter/Interpreter.js +var Interpreter = class _Interpreter { + constructor() { + this.anonymCounter = 1; + this.seenSchemas = /* @__PURE__ */ new Map(); + } + /** + * Transforms a schema into instances of CommonModel by processing all keywords from schema documents and infers the model definition. + * + * @param schema + * @param interpreterOptions to control the interpret process + */ + interpret(schema8, options = _Interpreter.defaultInterpreterOptions) { + if (!options.disableCache && this.seenSchemas.has(schema8)) { + const cachedModel = this.seenSchemas.get(schema8); + if (cachedModel !== void 0) { + return cachedModel; + } + } + if (schema8 === false) { + return void 0; + } + const model = new CommonModel(); + model.originalInput = schema8; + if (!options.disableCache) { + this.seenSchemas.set(schema8, model); + } + this.interpretSchema(model, schema8, options); + return model; + } + /** + * Function to interpret a schema into a CommonModel. + * + * @param model + * @param schema + * @param interpreterOptions to control the interpret process + */ + interpretSchema(model, schema8, interpreterOptions = _Interpreter.defaultInterpreterOptions) { + if (schema8 === true) { + model.setType([ + "object", + "string", + "number", + "array", + "boolean", + "null", + "integer" + ]); + } else if (typeof schema8 === "object") { + this.interpretSchemaObject(model, schema8, interpreterOptions); + } + } + interpretSchemaObject(model, schema8, interpreterOptions = _Interpreter.defaultInterpreterOptions) { + if (schema8.type !== void 0) { + model.addTypes(schema8.type); + } + if (schema8.required !== void 0) { + model.required = schema8.required; + } + if (schema8.format) { + model.format = schema8.format; + } + interpretPatternProperties(schema8, model, this, interpreterOptions); + interpretAdditionalItems(schema8, model, this, interpreterOptions); + interpretAdditionalProperties(schema8, model, this, interpreterOptions); + interpretItems(schema8, model, this, interpreterOptions); + interpretProperties(schema8, model, this, interpreterOptions); + interpretAllOf(schema8, model, this, interpreterOptions); + interpretOneOf(schema8, model, this, interpreterOptions); + interpretOneOfWithAllOf(schema8, model, this, interpreterOptions); + interpretOneOfWithProperties(schema8, model, this, interpreterOptions); + interpretAnyOf(schema8, model, this, interpreterOptions); + interpretDependencies(schema8, model, this, interpreterOptions); + interpretConst(schema8, model, interpreterOptions); + interpretEnum(schema8, model); + InterpretThenElse(schema8, model, this, interpreterOptions); + interpretNot(schema8, model, this, interpreterOptions); + model.$id = interpretName(schema8) || `anonymSchema${this.anonymCounter++}`; + } + /** + * Go through a schema and combine the interpreted models together. + * + * @param schema to go through + * @param currentModel the current output + * @param rootSchema the root schema to use as original schema when merged + * @param interpreterOptions to control the interpret process + */ + interpretAndCombineSchema(schema8, currentModel, rootSchema, interpreterOptions = _Interpreter.defaultInterpreterOptions, mergingOptions = defaultMergingOptions) { + if (typeof schema8 !== "object") { + return; + } + const model = this.interpret(schema8, interpreterOptions); + if (model !== void 0) { + CommonModel.mergeCommonModels(currentModel, model, rootSchema, /* @__PURE__ */ new Map(), mergingOptions); + } + } + /** + * Get the discriminator property name for the schema, if the schema has one + * + * @param schema + * @returns discriminator name property + */ + discriminatorProperty(schema8) { + if ((schema8 instanceof AsyncapiV2Schema || schema8 instanceof SwaggerV2Schema) && schema8.discriminator) { + return schema8.discriminator; + } else if (schema8 instanceof OpenapiV3Schema && schema8.discriminator && schema8.discriminator.propertyName) { + return schema8.discriminator.propertyName; + } + } +}; +Interpreter.defaultInterpreterOptions = { + allowInheritance: false, + ignoreAdditionalProperties: false, + ignoreAdditionalItems: false, + disableCache: false +}; + +// node_modules/@asyncapi/modelina/lib/esm/helpers/FormatHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/camel-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/camel-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign10 = function() { + __assign10 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign10.apply(this, arguments); +}; + +// node_modules/pascal-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/pascal-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign11 = function() { + __assign11 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign11.apply(this, arguments); +}; + +// node_modules/no-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/lower-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); +function lowerCase2(str2) { + return str2.toLowerCase(); +} + +// node_modules/no-case/dist.es2015/index.js +var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; +var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; +function noCase(input, options) { + if (options === void 0) { + options = {}; + } + var _a2 = options.splitRegexp, splitRegexp = _a2 === void 0 ? DEFAULT_SPLIT_REGEXP : _a2, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform2 = _c === void 0 ? lowerCase2 : _c, _d = options.delimiter, delimiter2 = _d === void 0 ? " " : _d; + var result2 = replace2(replace2(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); + var start = 0; + var end = result2.length; + while (result2.charAt(start) === "\0") + start++; + while (result2.charAt(end - 1) === "\0") + end--; + return result2.slice(start, end).split("\0").map(transform2).join(delimiter2); +} +function replace2(input, re4, value2) { + if (re4 instanceof RegExp) + return input.replace(re4, value2); + return re4.reduce(function(input2, re5) { + return input2.replace(re5, value2); + }, input); +} + +// node_modules/pascal-case/dist.es2015/index.js +function pascalCaseTransform(input, index4) { + var firstChar = input.charAt(0); + var lowerChars = input.substr(1).toLowerCase(); + if (index4 > 0 && firstChar >= "0" && firstChar <= "9") { + return "_" + firstChar + lowerChars; + } + return "" + firstChar.toUpperCase() + lowerChars; +} +function pascalCaseTransformMerge(input) { + return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase(); +} +function pascalCase(input, options) { + if (options === void 0) { + options = {}; + } + return noCase(input, __assign11({ delimiter: "", transform: pascalCaseTransform }, options)); +} + +// node_modules/camel-case/dist.es2015/index.js +function camelCaseTransform(input, index4) { + if (index4 === 0) + return input.toLowerCase(); + return pascalCaseTransform(input, index4); +} +function camelCase2(input, options) { + if (options === void 0) { + options = {}; + } + return pascalCase(input, __assign10({ transform: camelCaseTransform }, options)); +} + +// node_modules/constant-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/constant-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign12 = function() { + __assign12 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign12.apply(this, arguments); +}; + +// node_modules/upper-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); +function upperCase2(str2) { + return str2.toUpperCase(); +} + +// node_modules/constant-case/dist.es2015/index.js +function constantCase(input, options) { + if (options === void 0) { + options = {}; + } + return noCase(input, __assign12({ delimiter: "_", transform: upperCase2 }, options)); +} + +// node_modules/dot-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/dot-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign13 = function() { + __assign13 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign13.apply(this, arguments); +}; + +// node_modules/dot-case/dist.es2015/index.js +function dotCase(input, options) { + if (options === void 0) { + options = {}; + } + return noCase(input, __assign13({ delimiter: "." }, options)); +} + +// node_modules/param-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/param-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign14 = function() { + __assign14 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign14.apply(this, arguments); +}; + +// node_modules/param-case/dist.es2015/index.js +function paramCase(input, options) { + if (options === void 0) { + options = {}; + } + return dotCase(input, __assign14({ delimiter: "-" }, options)); +} + +// node_modules/snake-case/dist.es2015/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/snake-case/node_modules/tslib/tslib.es6.mjs +init_dirname(); +init_buffer2(); +init_process2(); +var __assign15 = function() { + __assign15 = Object.assign || function __assign16(t8) { + for (var s7, i7 = 1, n7 = arguments.length; i7 < n7; i7++) { + s7 = arguments[i7]; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7)) + t8[p7] = s7[p7]; + } + return t8; + }; + return __assign15.apply(this, arguments); +}; + +// node_modules/snake-case/dist.es2015/index.js +function snakeCase2(input, options) { + if (options === void 0) { + options = {}; + } + return dotCase(input, __assign15({ delimiter: "_" }, options)); +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/FormatHelpers.js +var IndentationTypes; +(function(IndentationTypes2) { + IndentationTypes2["TABS"] = "tabs"; + IndentationTypes2["SPACES"] = "spaces"; +})(IndentationTypes || (IndentationTypes = {})); +var specialCharacterReplacements = /* @__PURE__ */ new Map([ + [" ", "space"], + ["!", "exclamation"], + ['"', "quotation"], + ["#", "hash"], + ["$", "dollar"], + ["%", "percent"], + ["&", "ampersand"], + ["'", "apostrophe"], + ["(", "roundleft"], + [")", "roundright"], + ["*", "asterisk"], + ["+", "plus"], + [",", "comma"], + ["-", "minus"], + [".", "dot"], + ["/", "slash"], + [":", "colon"], + [";", "semicolon"], + ["<", "less"], + ["=", "equal"], + [">", "greater"], + ["?", "question"], + ["@", "at"], + ["[", "squareleft"], + ["\\", "backslash"], + ["]", "squareright"], + ["^", "circumflex"], + ["_", "underscore"], + ["`", "graveaccent"], + ["{", "curlyleft"], + ["|", "vertical"], + ["}", "curlyright"], + ["~", "tilde"] +]); +var FormatHelpers = class { + /** + * Upper first char in given string value. + * @param {string} value to change + * @returns {string} + */ + static upperFirst(value2) { + return value2.charAt(0).toUpperCase() + value2.slice(1); + } + /** + * Lower first char in given string value. + * @param {string} value to change + * @returns {string} + */ + static lowerFirst(value2) { + return value2.charAt(0).toLowerCase() + value2.slice(1); + } + /** + * Transform into a string with the separator denoted by the next word capitalized. + * @param {string} value to transform + * @returns {string} + */ + static toCamelCase(renderName) { + const splt = renderName.split(/([0-9]_)/g); + if (splt.length > 1) { + return splt.map((part) => { + if (part.match(/[0-9]_/g)) { + return part; + } + return camelCase2(part); + }).join(""); + } + return camelCase2(renderName); + } + /** + * Transform into a string of capitalized words without separators + * merging numbers. + * @param {string} value to transform + * @returns {string} + */ + static toPascalCaseMergingNumbers(value2) { + return pascalCase(value2, { transform: pascalCaseTransformMerge }); + } + /** + * Replace special characters (Not 0-9,a-z,A-Z) with character names + * @param {string} value to transform + * @param {ReplaceSpecialCharactersOptions} options + * @returns {string} + */ + static replaceSpecialCharacters(string2, options) { + var _a2; + const separator = (_a2 = options === null || options === void 0 ? void 0 : options.separator) !== null && _a2 !== void 0 ? _a2 : ""; + return [...string2].reduce((sum2, c7, i7) => { + var _a3; + if ((_a3 = options === null || options === void 0 ? void 0 : options.exclude) === null || _a3 === void 0 ? void 0 : _a3.includes(c7)) { + return sum2 + c7; + } + const replacement = specialCharacterReplacements.get(c7); + if (replacement === void 0) { + return sum2 + c7; + } + return sum2 + (sum2.endsWith(separator) || sum2.length === 0 ? "" : separator) + replacement + (i7 === string2.length - 1 ? "" : separator); + }, ""); + } + /** + * Ensures breaking text into new lines according to newline char (`\n`) in text. + * @param {(string | string[])} lines to breaks + * @returns {string[]} + */ + static breakLines(lines) { + lines = Array.isArray(lines) ? lines : [lines]; + return lines.map((line) => line.split("\n")).flatMap((line) => line); + } + /** + * Ensures indentations are prepended to content. + * @param {string} content to prepend the indentation. + * @param {number} size the number of indentations to use. 1 by default + * @param {IndentationTypes} type the type of indentations to use. SPACES by default. + * @returns {string} + */ + static indent(content = "", size2 = 1, type3 = IndentationTypes.SPACES) { + if (size2 < 1) { + return content; + } + if (content.includes("\n")) { + const newLineArray = content.split("\n"); + return newLineArray.reduce((accumulator, value2) => { + const newValue = value2.trim() === "" ? value2 : `${this.getIndentation(size2, type3)}${value2}`; + return accumulator === "" ? newValue : `${accumulator} +${newValue}`; + }, ""); + } + return `${this.getIndentation(size2, type3)}${content}`; + } + /** + * Get the indentation string based on how many and which type of indentation are requested. + * @private + * @param {number} size the number of indentations to use + * @param {IndentationTypes} type the type of indentations to use. SPACES by default. + * @returns {string} + */ + static getIndentation(size2 = 0, type3 = IndentationTypes.SPACES) { + const whitespaceChar = type3 === IndentationTypes.SPACES ? " " : " "; + return Array(size2).fill(whitespaceChar).join(""); + } + /** + * Render given JSON Schema example to string + * + * @param {Array} examples to render + * @returns {string} + */ + static renderJSONExamples(examples) { + let renderedExamples = ""; + if (Array.isArray(examples)) { + for (const example of examples) { + if (renderedExamples !== "") { + renderedExamples += ", "; + } + if (typeof example === "object") { + try { + renderedExamples += JSON.stringify(example); + } catch (ignore) { + renderedExamples += example; + } + } else { + renderedExamples += example; + } + } + } + return renderedExamples; + } + static snakeCase(renderName) { + return renderName.replace(/\W+/g, " ").split(/ |\B(?=[A-Z])/).map((word) => word.toLowerCase()).join("_"); + } +}; +FormatHelpers.toPascalCase = pascalCase; +FormatHelpers.toParamCase = paramCase; +FormatHelpers.toConstantCase = constantCase; +FormatHelpers.toSnakeCase = snakeCase2; + +// node_modules/@asyncapi/modelina/lib/esm/helpers/TypeHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); +function getTypeFromMapping(typeMapping, context2) { + if (context2.constrainedModel instanceof ConstrainedObjectModel) { + return typeMapping.Object(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedReferenceModel) { + return typeMapping.Reference(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedAnyModel) { + return typeMapping.Any(context2); + } else if (context2.constrainedModel instanceof ConstrainedFloatModel) { + return typeMapping.Float(context2); + } else if (context2.constrainedModel instanceof ConstrainedIntegerModel) { + return typeMapping.Integer(context2); + } else if (context2.constrainedModel instanceof ConstrainedStringModel) { + return typeMapping.String(context2); + } else if (context2.constrainedModel instanceof ConstrainedBooleanModel) { + return typeMapping.Boolean(context2); + } else if (context2.constrainedModel instanceof ConstrainedTupleModel) { + return typeMapping.Tuple(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedArrayModel) { + return typeMapping.Array(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedEnumModel) { + return typeMapping.Enum(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedUnionModel) { + return typeMapping.Union(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } else if (context2.constrainedModel instanceof ConstrainedDictionaryModel) { + return typeMapping.Dictionary(Object.assign(Object.assign({}, context2), { constrainedModel: context2.constrainedModel })); + } + throw new Error("Could not find type for model"); +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/FileHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); +init_fs(); +init_path(); +var __awaiter21 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function lengthInUtf8Bytes(str2) { + const m7 = encodeURIComponent(str2).match(/%[89ABab]/g); + return str2.length + (m7 ? m7.length : 0); +} +var FileHelpers = class { + /** + * Node specific file writer, which writes the content to the specified filepath. + * + * This function is invasive, as it overwrite any existing files with the same name as the model. + * + * @param content to write + * @param filePath to write to, + * @param ensureFilesWritten veryify that the files is completely written before returning, this can happen if the file system is swamped with write requests. + */ + static writerToFileSystem(content, filePath, ensureFilesWritten = false) { + return new Promise((resolve3, reject2) => __awaiter21(this, void 0, void 0, function* () { + try { + const outputFilePath = resolve(filePath); + yield promises.mkdir(dirname(outputFilePath), { recursive: true }); + yield promises.writeFile(outputFilePath, content); + if (ensureFilesWritten) { + const timerId = setInterval(() => __awaiter21(this, void 0, void 0, function* () { + try { + const isExists = yield promises.stat(outputFilePath); + if (isExists && isExists.size === lengthInUtf8Bytes(content)) { + clearInterval(timerId); + resolve3(); + } + } catch (e10) { + } + }), 10); + } else { + resolve3(); + } + } catch (e10) { + reject2(e10); + } + })); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/helpers/CommonModelToMetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); +function getMetaModelOptions(commonModel, processorOptions) { + var _a2; + const options = {}; + if (commonModel.const) { + options.const = { + originalInput: commonModel.const + }; + } else if (processorOptions.interpretSingleEnumAsConst && ((_a2 = commonModel.enum) === null || _a2 === void 0 ? void 0 : _a2.length) === 1) { + options.const = { + originalInput: commonModel.enum[0] + }; + } + if (Array.isArray(commonModel.type) && commonModel.type.includes("null")) { + options.isNullable = true; + } else { + options.isNullable = false; + } + if (commonModel.discriminator) { + options.discriminator = { + discriminator: commonModel.discriminator + }; + } + if (commonModel.format) { + options.format = commonModel.format; + } + return options; +} +function convertToMetaModel(context2) { + const { jsonSchemaModel, alreadySeenModels = /* @__PURE__ */ new Map(), options } = context2; + const hasModel = alreadySeenModels.has(jsonSchemaModel); + if (hasModel) { + return alreadySeenModels.get(jsonSchemaModel); + } + const name2 = jsonSchemaModel.$id || "undefined"; + const unionModel = convertToUnionModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (unionModel !== void 0) { + return unionModel; + } + const anyModel = convertToAnyModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (anyModel !== void 0) { + return anyModel; + } + const enumModel = convertToEnumModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (enumModel !== void 0) { + return enumModel; + } + const objectModel = convertToObjectModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (objectModel !== void 0) { + return objectModel; + } + const dictionaryModel = convertToDictionaryModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (dictionaryModel !== void 0) { + return dictionaryModel; + } + const tupleModel = convertToTupleModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (tupleModel !== void 0) { + return tupleModel; + } + const arrayModel = convertToArrayModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (arrayModel !== void 0) { + return arrayModel; + } + const stringModel = convertToStringModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (stringModel !== void 0) { + return stringModel; + } + const floatModel = convertToFloatModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (floatModel !== void 0) { + return floatModel; + } + const integerModel = convertToIntegerModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (integerModel !== void 0) { + return integerModel; + } + const booleanModel = convertToBooleanModel(Object.assign(Object.assign({}, context2), { + alreadySeenModels, + name: name2 + })); + if (booleanModel !== void 0) { + return booleanModel; + } + Logger2.warn(`Failed to convert ${name2} to MetaModel, defaulting to AnyModel`); + return new AnyModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function isEnumModel(jsonSchemaModel, interpretSingleEnumAsConst = false) { + if (!Array.isArray(jsonSchemaModel.enum) || jsonSchemaModel.enum.length <= 1 && interpretSingleEnumAsConst) { + return false; + } + return true; +} +function shouldBeAnyType(jsonSchemaModel) { + const containsAllTypesButNull = Array.isArray(jsonSchemaModel.type) && jsonSchemaModel.type.length >= 6 && !jsonSchemaModel.type.includes("null"); + const containsAllTypes = Array.isArray(jsonSchemaModel.type) && jsonSchemaModel.type.length === 7 || containsAllTypesButNull; + return containsAllTypesButNull || containsAllTypes; +} +function convertToUnionModel(context2) { + var _a2; + const { jsonSchemaModel, alreadySeenModels, options, name: name2 } = context2; + const containsUnions = Array.isArray(jsonSchemaModel.union); + const containsTypeWithNull = Array.isArray(jsonSchemaModel.type) && jsonSchemaModel.type.length === 2 && jsonSchemaModel.type.includes("null"); + const containsSimpleTypeUnion = Array.isArray(jsonSchemaModel.type) && jsonSchemaModel.type.length > 1 && !containsTypeWithNull; + const isAnyType = shouldBeAnyType(jsonSchemaModel); + if (!containsSimpleTypeUnion && !containsUnions || isEnumModel(jsonSchemaModel) || isAnyType || containsTypeWithNull) { + return void 0; + } + const unionModel = new UnionModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), []); + if (!alreadySeenModels.has(jsonSchemaModel)) { + alreadySeenModels.set(jsonSchemaModel, unionModel); + } + if (containsUnions && jsonSchemaModel.union) { + for (const unionCommonModel of jsonSchemaModel.union) { + const isSingleNullType = Array.isArray(unionCommonModel.type) && unionCommonModel.type.length === 1 && ((_a2 = unionCommonModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("null")) || unionCommonModel.type === "null"; + if (isSingleNullType) { + unionModel.options.isNullable = true; + } else { + const unionMetaModel = convertToMetaModel({ + alreadySeenModels, + jsonSchemaModel: unionCommonModel, + options + }); + unionModel.union.push(unionMetaModel); + } + } + return unionModel; + } + const enumModel = convertToEnumModel(Object.assign(Object.assign({}, context2), { alreadySeenModels, name: `${name2}_enum` })); + if (enumModel !== void 0) { + unionModel.union.push(enumModel); + } + const objectModel = convertToObjectModel(Object.assign(Object.assign({}, context2), { alreadySeenModels, name: `${name2}_object` })); + if (objectModel !== void 0) { + unionModel.union.push(objectModel); + } + const dictionaryModel = convertToDictionaryModel(Object.assign(Object.assign({}, context2), { alreadySeenModels, name: `${name2}_dictionary` })); + if (dictionaryModel !== void 0) { + unionModel.union.push(dictionaryModel); + } + const tupleModel = convertToTupleModel(Object.assign(Object.assign({}, context2), { alreadySeenModels, name: `${name2}_tuple` })); + if (tupleModel !== void 0) { + unionModel.union.push(tupleModel); + } + const arrayModel = convertToArrayModel(Object.assign(Object.assign({}, context2), { alreadySeenModels, name: `${name2}_array` })); + if (arrayModel !== void 0) { + unionModel.union.push(arrayModel); + } + const stringModel = convertToStringModel(Object.assign(Object.assign({}, context2), { name: `${name2}_string` })); + if (stringModel !== void 0) { + unionModel.union.push(stringModel); + } + const floatModel = convertToFloatModel(Object.assign(Object.assign({}, context2), { name: `${name2}_float` })); + if (floatModel !== void 0) { + unionModel.union.push(floatModel); + } + const integerModel = convertToIntegerModel(Object.assign(Object.assign({}, context2), { name: `${name2}_integer` })); + if (integerModel !== void 0) { + unionModel.union.push(integerModel); + } + const booleanModel = convertToBooleanModel(Object.assign(Object.assign({}, context2), { name: `${name2}_boolean` })); + if (booleanModel !== void 0) { + unionModel.union.push(booleanModel); + } + return unionModel; +} +function convertToStringModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("string"))) { + return void 0; + } + return new StringModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function convertToAnyModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + const isAnyType = shouldBeAnyType(jsonSchemaModel); + if (!Array.isArray(jsonSchemaModel.type) || !isAnyType) { + return void 0; + } + let originalInput = jsonSchemaModel.originalInput; + if (typeof jsonSchemaModel.originalInput !== "object") { + originalInput = Object.assign({ value: jsonSchemaModel.originalInput }, ((_a2 = jsonSchemaModel.originalInput) === null || _a2 === void 0 ? void 0 : _a2.description) !== void 0 && { + description: jsonSchemaModel.originalInput.description + }); + } + return new AnyModel(name2, originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function convertToIntegerModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("integer"))) { + return void 0; + } + return new IntegerModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function convertToFloatModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("number"))) { + return void 0; + } + return new FloatModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function convertToEnumModel(context2) { + const { jsonSchemaModel, options, name: name2 } = context2; + if (!isEnumModel(jsonSchemaModel, options.interpretSingleEnumAsConst)) { + return void 0; + } + const enumValueToEnumValueModel = (enumValue) => { + if (typeof enumValue !== "string") { + return new EnumValueModel(JSON.stringify(enumValue), enumValue); + } + return new EnumValueModel(enumValue, enumValue); + }; + const metaModel = new EnumModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), []); + if (jsonSchemaModel.enum) { + for (const enumValue of jsonSchemaModel.enum) { + metaModel.values.push(enumValueToEnumValueModel(enumValue)); + } + } + return metaModel; +} +function convertToBooleanModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("boolean"))) { + return void 0; + } + return new BooleanModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options)); +} +function isDictionary(jsonSchemaModel) { + if (Object.keys(jsonSchemaModel.properties || {}).length > 0 || jsonSchemaModel.additionalProperties === void 0) { + return false; + } + return true; +} +function getOriginalInputFromAdditionalAndPatterns(jsonSchemaModel) { + const originalInputs = []; + if (jsonSchemaModel.additionalProperties !== void 0) { + originalInputs.push(jsonSchemaModel.additionalProperties.originalInput); + } + if (jsonSchemaModel.patternProperties !== void 0) { + for (const patternModel of Object.values(jsonSchemaModel.patternProperties)) { + originalInputs.push(patternModel.originalInput); + } + } + return originalInputs; +} +function convertAdditionalAndPatterns(context2) { + const { jsonSchemaModel, options, name: name2 } = context2; + const modelsAsValue = /* @__PURE__ */ new Map(); + if (jsonSchemaModel.additionalProperties !== void 0) { + const additionalPropertyModel = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: jsonSchemaModel.additionalProperties })); + modelsAsValue.set(additionalPropertyModel.name, additionalPropertyModel); + } + if (jsonSchemaModel.patternProperties !== void 0) { + for (const patternModel of Object.values(jsonSchemaModel.patternProperties)) { + const patternPropertyModel = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: patternModel })); + modelsAsValue.set(patternPropertyModel.name, patternPropertyModel); + } + } + if (modelsAsValue.size === 1) { + return Array.from(modelsAsValue.values())[0]; + } + return new UnionModel(name2, getOriginalInputFromAdditionalAndPatterns(jsonSchemaModel), getMetaModelOptions(jsonSchemaModel, options), Array.from(modelsAsValue.values())); +} +function convertToDictionaryModel(context2) { + var _a2; + const { jsonSchemaModel, options, name: name2 } = context2; + if (!isDictionary(jsonSchemaModel)) { + return void 0; + } + const originalInput = getOriginalInputFromAdditionalAndPatterns(jsonSchemaModel); + const keyModel = new StringModel(name2, originalInput, {}); + const valueModel = convertAdditionalAndPatterns(context2); + const input = Object.assign({ originalInput }, ((_a2 = jsonSchemaModel.originalInput) === null || _a2 === void 0 ? void 0 : _a2.description) !== void 0 && { + description: jsonSchemaModel.originalInput.description + }); + return new DictionaryModel(name2, input, getMetaModelOptions(jsonSchemaModel, options), keyModel, valueModel, "normal"); +} +function convertToObjectModel(context2) { + var _a2, _b, _c; + const { jsonSchemaModel, alreadySeenModels, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("object")) || isDictionary(jsonSchemaModel)) { + return void 0; + } + const metaModel = new ObjectModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), {}); + if (!alreadySeenModels.has(jsonSchemaModel)) { + alreadySeenModels.set(jsonSchemaModel, metaModel); + } + for (const [propertyName, prop] of Object.entries(jsonSchemaModel.properties || {})) { + const isRequired = jsonSchemaModel.isRequired(propertyName); + const propertyModel = new ObjectPropertyModel(propertyName, isRequired, convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: prop }))); + metaModel.properties[String(propertyName)] = propertyModel; + } + if ((_b = jsonSchemaModel.extend) === null || _b === void 0 ? void 0 : _b.length) { + metaModel.options.extend = []; + for (const extend3 of jsonSchemaModel.extend) { + metaModel.options.extend.push(convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: extend3 }))); + } + } + if (jsonSchemaModel.additionalProperties !== void 0 || jsonSchemaModel.patternProperties !== void 0) { + let propertyName = (_c = options.propertyNameForAdditionalProperties) !== null && _c !== void 0 ? _c : "additionalProperties"; + while (metaModel.properties[String(propertyName)] !== void 0) { + propertyName = `reserved_${propertyName}`; + } + const originalInput = getOriginalInputFromAdditionalAndPatterns(jsonSchemaModel); + const keyModel = new StringModel(propertyName, originalInput, getMetaModelOptions(jsonSchemaModel, options)); + const valueModel = convertAdditionalAndPatterns(Object.assign(Object.assign({}, context2), { name: propertyName })); + const dictionaryModel = new DictionaryModel(propertyName, originalInput, getMetaModelOptions(jsonSchemaModel, options), keyModel, valueModel, "unwrap"); + const propertyModel = new ObjectPropertyModel(propertyName, false, dictionaryModel); + metaModel.properties[String(propertyName)] = propertyModel; + } + return metaModel; +} +function convertToArrayModel(context2) { + var _a2; + const { jsonSchemaModel, alreadySeenModels, options, name: name2 } = context2; + if (!((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("array"))) { + return void 0; + } + const isNormalArray = !Array.isArray(jsonSchemaModel.items); + if (isNormalArray) { + const placeholderModel = new AnyModel("", void 0, getMetaModelOptions(jsonSchemaModel, options)); + const metaModel2 = new ArrayModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), placeholderModel); + alreadySeenModels.set(jsonSchemaModel, metaModel2); + if (jsonSchemaModel.items !== void 0) { + const valueModel2 = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: jsonSchemaModel.items })); + metaModel2.valueModel = valueModel2; + } + return metaModel2; + } + const valueModel = new UnionModel("union", jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), []); + const metaModel = new ArrayModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), valueModel); + alreadySeenModels.set(jsonSchemaModel, metaModel); + if (jsonSchemaModel.items !== void 0) { + for (const itemModel of Array.isArray(jsonSchemaModel.items) ? jsonSchemaModel.items : [jsonSchemaModel.items]) { + const itemsModel = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: itemModel })); + valueModel.union.push(itemsModel); + } + } + if (jsonSchemaModel.additionalItems !== void 0) { + const itemsModel = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: jsonSchemaModel.additionalItems })); + valueModel.union.push(itemsModel); + } + return metaModel; +} +function convertToTupleModel(context2) { + var _a2; + const { jsonSchemaModel, alreadySeenModels, options, name: name2 } = context2; + const isTuple = ((_a2 = jsonSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("array")) && Array.isArray(jsonSchemaModel.items) && jsonSchemaModel.additionalItems === void 0; + if (!isTuple) { + return void 0; + } + const items = jsonSchemaModel.items; + const tupleModel = new TupleModel(name2, jsonSchemaModel.originalInput, getMetaModelOptions(jsonSchemaModel, options), []); + alreadySeenModels.set(jsonSchemaModel, tupleModel); + for (let i7 = 0; i7 < items.length; i7++) { + const item = items[Number(i7)]; + const valueModel = convertToMetaModel(Object.assign(Object.assign({}, context2), { jsonSchemaModel: item })); + const tupleValueModel = new TupleValueModel(i7, valueModel); + tupleModel.tuple[Number(i7)] = tupleValueModel; + } + return tupleModel; +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/Splitter.js +init_dirname(); +init_buffer2(); +init_process2(); +var trySplitModel = (model, options, models) => { + const shouldSplit = options.splitEnum === true && model instanceof EnumModel || options.splitUnion === true && model instanceof UnionModel || options.splitArray === true && model instanceof ArrayModel || options.splitTuple === true && model instanceof TupleModel || options.splitString === true && model instanceof StringModel || options.splitInteger === true && model instanceof IntegerModel || options.splitFloat === true && model instanceof FloatModel || options.splitBoolean === true && model instanceof BooleanModel || options.splitObject === true && model instanceof ObjectModel || options.splitDictionary === true && model instanceof DictionaryModel; + if (shouldSplit) { + let hasModel = false; + for (const m7 of models) { + if (m7 === model) { + hasModel = true; + } + if (m7.name === model.name) { + if (m7.options.isExtended && model.options.isExtended) { + continue; + } + if (m7.options.isExtended || model.options.isExtended) { + m7.options.isExtended = false; + model.options.isExtended = false; + } + } + } + if (!hasModel) { + models.push(model); + } + return new ReferenceModel(model.name, model.originalInput, model.options, model); + } + return model; +}; +var split2 = (model, options, models = [model], alreadySeenModels = []) => { + var _a2; + if (!alreadySeenModels.includes(model)) { + alreadySeenModels.push(model); + } else { + return models; + } + if (model instanceof ObjectModel) { + for (const [prop, propModel] of Object.entries(model.properties)) { + const propertyModel = propModel.property; + model.properties[String(prop)].property = trySplitModel(propModel.property, options, models); + split2(propertyModel, options, models, alreadySeenModels); + } + if ((_a2 = model.options.extend) === null || _a2 === void 0 ? void 0 : _a2.length) { + for (let index4 = 0; index4 < model.options.extend.length; index4++) { + const extendModel = model.options.extend[Number(index4)]; + extendModel.options.isExtended = true; + model.options.extend[Number(index4)] = trySplitModel(extendModel, options, models); + split2(extendModel, options, models, alreadySeenModels); + } + } + } else if (model instanceof UnionModel) { + for (let index4 = 0; index4 < model.union.length; index4++) { + const unionModel = model.union[Number(index4)]; + model.union[Number(index4)] = trySplitModel(unionModel, options, models); + split2(unionModel, options, models, alreadySeenModels); + } + } else if (model instanceof ArrayModel) { + const valueModel = model.valueModel; + model.valueModel = trySplitModel(valueModel, options, models); + split2(valueModel, options, models, alreadySeenModels); + } else if (model instanceof TupleModel) { + for (const tuple of model.tuple) { + const tupleModel = tuple.value; + tuple.value = trySplitModel(tupleModel, options, models); + split2(tupleModel, options, models, alreadySeenModels); + } + } else if (model instanceof DictionaryModel) { + const keyModel = model.key; + const valueModel = model.value; + model.key = trySplitModel(keyModel, options, models); + model.value = trySplitModel(valueModel, options, models); + split2(keyModel, options, models, alreadySeenModels); + split2(valueModel, options, models, alreadySeenModels); + } + return models; +}; + +// node_modules/@asyncapi/modelina/lib/esm/helpers/Constraints.js +init_dirname(); +init_buffer2(); +init_process2(); +function NO_NUMBER_START_CHAR(value2) { + const firstChar = value2.charAt(0); + if (firstChar !== "" && !isNaN(+firstChar)) { + return `number_${value2}`; + } + return value2; +} +function NO_DUPLICATE_PROPERTIES(constrainedObjectModel, objectModel, propertyName, namingFormatter) { + const formattedPropertyName = namingFormatter(propertyName); + let newPropertyName = propertyName; + const alreadyPartOfMetaModel = Object.keys(objectModel.properties).filter((key) => propertyName !== key).includes(formattedPropertyName); + const alreadyPartOfConstrainedModel = Object.keys(constrainedObjectModel.properties).includes(formattedPropertyName); + if (alreadyPartOfMetaModel || alreadyPartOfConstrainedModel) { + newPropertyName = `reserved_${propertyName}`; + newPropertyName = NO_DUPLICATE_PROPERTIES(constrainedObjectModel, objectModel, newPropertyName, namingFormatter); + } + return newPropertyName; +} +function NO_DUPLICATE_ENUM_KEYS(constrainedEnumModel, enumModel, enumKey, namingFormatter, enumKeyToCheck = enumKey, onNameChange = (currentEnumKey) => { + return `reserved_${currentEnumKey}`; +}, onNameChangeToCheck = onNameChange) { + const formattedEnumKey = namingFormatter(enumKeyToCheck); + let newEnumKey = enumKey; + const alreadyPartOfMetaModel = enumModel.values.map((model) => model.key).filter((key) => enumKeyToCheck !== key).includes(formattedEnumKey); + const alreadyPartOfConstrainedModel = constrainedEnumModel.values.map((model) => model.key).includes(formattedEnumKey); + if (alreadyPartOfMetaModel || alreadyPartOfConstrainedModel) { + newEnumKey = onNameChange(newEnumKey); + enumKeyToCheck = onNameChangeToCheck(enumKeyToCheck); + newEnumKey = NO_DUPLICATE_ENUM_KEYS(constrainedEnumModel, enumModel, newEnumKey, namingFormatter, enumKeyToCheck, onNameChange, onNameChangeToCheck); + } + return newEnumKey; +} +function NO_EMPTY_VALUE(value2) { + if (value2 === "") { + return "empty"; + } + return value2; +} +function NO_RESERVED_KEYWORDS(propertyName, reservedKeywordCallback) { + if (reservedKeywordCallback(propertyName)) { + return `reserved_${propertyName}`; + } + return propertyName; +} +function checkForReservedKeyword(word, wordList, forceLowerCase = true) { + let wordListToCheck = [...wordList]; + let wordToCheck = word; + if (forceLowerCase) { + wordListToCheck = wordListToCheck.map((value2) => value2.toLowerCase()); + wordToCheck = wordToCheck.toLowerCase(); + } + return wordListToCheck.includes(wordToCheck); +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/ConstrainHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/helpers/ConstrainedTypes.js +init_dirname(); +init_buffer2(); +init_process2(); +function applyTypeAndConst(context2) { + const { constrainedModel, typeMapping, partOfProperty, dependencyManager, generatorOptions, alreadySeenModels, constrainRules } = context2; + if (constrainedModel.type !== "") { + return; + } + constrainedModel.type = getTypeFromMapping(typeMapping, { + constrainedModel, + options: generatorOptions, + partOfProperty, + dependencyManager + }); + if (constrainedModel.options.const) { + const constrainedConstant = constrainRules.constant({ + constrainedMetaModel: constrainedModel, + options: generatorOptions + }); + constrainedModel.options.const.value = constrainedConstant; + } + alreadySeenModels.set(constrainedModel, constrainedModel.type); +} +function applyTypesAndConst(context2) { + const { constrainedModel, safeTypes, alreadySeenModels } = context2; + const isCyclicModel = alreadySeenModels.has(constrainedModel) && alreadySeenModels.get(constrainedModel) === void 0; + const hasBeenSolved = alreadySeenModels.has(constrainedModel); + if (isCyclicModel) { + Logger2.warn(`Cyclic models detected, we have to replace ${constrainedModel.originalInput} with AnyModel...`); + const anyModel = new ConstrainedAnyModel(constrainedModel.name, constrainedModel.originalInput, constrainedModel.options, ""); + applyTypeAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: anyModel })); + return anyModel; + } else if (hasBeenSolved) { + return void 0; + } + alreadySeenModels.set(constrainedModel, void 0); + for (const safeType of safeTypes) { + if (constrainedModel instanceof safeType) { + applyTypeAndConst(Object.assign(Object.assign({}, context2), { constrainedModel })); + break; + } + } + walkNode(context2); +} +function walkNode(context2) { + const { constrainedModel } = context2; + if (constrainedModel instanceof ConstrainedObjectModel) { + walkObjectNode(context2); + } else if (constrainedModel instanceof ConstrainedDictionaryModel) { + walkDictionaryNode(context2); + } else if (constrainedModel instanceof ConstrainedTupleModel) { + walkTupleNode(context2); + } else if (constrainedModel instanceof ConstrainedArrayModel) { + walkArrayNode(context2); + } else if (constrainedModel instanceof ConstrainedUnionModel) { + walkUnionNode(context2); + } else if (constrainedModel instanceof ConstrainedReferenceModel) { + walkReferenceNode(context2); + } + applyTypeAndConst(Object.assign(Object.assign({}, context2), { constrainedModel })); + if (constrainedModel instanceof ConstrainedUnionModel) { + addDiscriminatorTypeToUnionModel(constrainedModel); + } +} +function walkObjectNode(context2) { + const objectModel = context2.constrainedModel; + for (const [propertyKey, propertyModel] of Object.entries(Object.assign({}, objectModel.properties))) { + const overWriteModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: propertyModel.property, partOfProperty: propertyModel })); + if (overWriteModel) { + objectModel.properties[propertyKey].property = overWriteModel; + } + } +} +function walkDictionaryNode(context2) { + const dictionaryModel = context2.constrainedModel; + const overwriteKeyModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: dictionaryModel.key, partOfProperty: void 0 })); + if (overwriteKeyModel) { + dictionaryModel.key = overwriteKeyModel; + } + const overWriteValueModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: dictionaryModel.value, partOfProperty: void 0 })); + if (overWriteValueModel) { + dictionaryModel.value = overWriteValueModel; + } +} +function walkTupleNode(context2) { + const tupleModel = context2.constrainedModel; + for (const [index4, tupleMetaModel] of [...tupleModel.tuple].entries()) { + const overwriteTupleModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: tupleMetaModel.value, partOfProperty: void 0 })); + if (overwriteTupleModel) { + tupleModel.tuple[index4].value = overwriteTupleModel; + } + } +} +function walkArrayNode(context2) { + const arrayModel = context2.constrainedModel; + const overWriteArrayModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: arrayModel.valueModel, partOfProperty: void 0 })); + if (overWriteArrayModel) { + arrayModel.valueModel = overWriteArrayModel; + } +} +function walkUnionNode(context2) { + const unionModel = context2.constrainedModel; + for (const [index4, unionValueModel] of [...unionModel.union].entries()) { + const overwriteUnionModel = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: unionValueModel, partOfProperty: void 0 })); + if (overwriteUnionModel) { + unionModel.union[index4] = overwriteUnionModel; + } + } +} +function walkReferenceNode(context2) { + const referenceModel = context2.constrainedModel; + const overwriteReference = applyTypesAndConst(Object.assign(Object.assign({}, context2), { constrainedModel: referenceModel.ref, partOfProperty: void 0 })); + if (overwriteReference) { + referenceModel.ref = overwriteReference; + } +} +function addDiscriminatorTypeToUnionModel(constrainedModel) { + if (!constrainedModel.options.discriminator) { + return; + } + const propertyTypes = /* @__PURE__ */ new Set(); + for (const union2 of constrainedModel.union) { + if (union2 instanceof ConstrainedReferenceModel) { + const ref = union2.ref; + if (ref instanceof ConstrainedObjectModel) { + const discriminatorProp = Object.values(ref.properties).find((model) => { + var _a2; + return model.unconstrainedPropertyName === ((_a2 = constrainedModel.options.discriminator) === null || _a2 === void 0 ? void 0 : _a2.discriminator); + }); + if (discriminatorProp) { + propertyTypes.add(discriminatorProp.property.type); + } + } + } + } + if (propertyTypes.size === 1) { + constrainedModel.options.discriminator.type = propertyTypes.keys().next().value; + } +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/MetaModelToConstrained.js +init_dirname(); +init_buffer2(); +init_process2(); +var placeHolderConstrainedObject = new ConstrainedAnyModel("", void 0, {}, ""); +function getConstrainedMetaModelOptions(metaModel) { + const options = {}; + options.const = metaModel.options.const; + options.isNullable = metaModel.options.isNullable; + options.discriminator = metaModel.options.discriminator; + options.format = metaModel.options.format; + options.isExtended = metaModel.options.isExtended; + return options; +} +function referenceModelFactory(constrainRules, context2, alreadySeenModels) { + const constrainedModel = new ConstrainedReferenceModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", placeHolderConstrainedObject); + alreadySeenModels.set(context2.metaModel, constrainedModel); + const constrainedRefModel = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: context2.metaModel.ref, partOfProperty: void 0 }), alreadySeenModels); + constrainedModel.ref = constrainedRefModel; + return constrainedModel; +} +function anyModelFactory(context2) { + return new ConstrainedAnyModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), ""); +} +function floatModelFactory(context2) { + return new ConstrainedFloatModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), ""); +} +function integerModelFactory(context2) { + return new ConstrainedIntegerModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), ""); +} +function stringModelFactory(context2) { + return new ConstrainedStringModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), ""); +} +function booleanModelFactory(context2) { + return new ConstrainedBooleanModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), ""); +} +function tupleModelFactory(constrainRules, context2, alreadySeenModels) { + const constrainedModel = new ConstrainedTupleModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", []); + alreadySeenModels.set(context2.metaModel, constrainedModel); + const constrainedTupleModels = context2.metaModel.tuple.map((tupleValue) => { + const tupleType2 = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: tupleValue.value, partOfProperty: void 0 }), alreadySeenModels); + return new ConstrainedTupleValueModel(tupleValue.index, tupleType2); + }); + constrainedModel.tuple = constrainedTupleModels; + return constrainedModel; +} +function arrayModelFactory(constrainRules, context2, alreadySeenModels) { + const constrainedModel = new ConstrainedArrayModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", placeHolderConstrainedObject); + alreadySeenModels.set(context2.metaModel, constrainedModel); + const constrainedValueModel = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: context2.metaModel.valueModel, partOfProperty: void 0 }), alreadySeenModels); + constrainedModel.valueModel = constrainedValueModel; + return constrainedModel; +} +function unionModelFactory(constrainRules, context2, alreadySeenModels) { + const constrainedModel = new ConstrainedUnionModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", []); + alreadySeenModels.set(context2.metaModel, constrainedModel); + const constrainedUnionModels = context2.metaModel.union.map((unionValue) => { + return metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: unionValue, partOfProperty: void 0 }), alreadySeenModels); + }); + constrainedModel.union = constrainedUnionModels; + return constrainedModel; +} +function dictionaryModelFactory(constrainRules, context2, alreadySeenModels) { + const constrainedModel = new ConstrainedDictionaryModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", placeHolderConstrainedObject, placeHolderConstrainedObject, context2.metaModel.serializationType); + alreadySeenModels.set(context2.metaModel, constrainedModel); + const keyModel = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: context2.metaModel.key, partOfProperty: void 0 }), alreadySeenModels); + constrainedModel.key = keyModel; + const valueModel = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: context2.metaModel.value, partOfProperty: void 0 }), alreadySeenModels); + constrainedModel.value = valueModel; + return constrainedModel; +} +function objectModelFactory(constrainRules, context2, alreadySeenModels) { + var _a2; + const options = getConstrainedMetaModelOptions(context2.metaModel); + if ((_a2 = context2.metaModel.options.extend) === null || _a2 === void 0 ? void 0 : _a2.length) { + options.extend = []; + for (const extend3 of context2.metaModel.options.extend) { + options.extend.push(metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: extend3, partOfProperty: void 0 }), alreadySeenModels)); + } + } + const constrainedModel = new ConstrainedObjectModel(context2.constrainedName, context2.metaModel.originalInput, options, "", {}); + alreadySeenModels.set(context2.metaModel, constrainedModel); + for (const propertyMetaModel of Object.values(context2.metaModel.properties)) { + const constrainedPropertyModel = new ConstrainedObjectPropertyModel("", propertyMetaModel.propertyName, propertyMetaModel.required, constrainedModel); + const constrainedPropertyName = constrainRules.propertyKey({ + objectPropertyModel: propertyMetaModel, + constrainedObjectPropertyModel: constrainedPropertyModel, + constrainedObjectModel: constrainedModel, + objectModel: context2.metaModel, + options: context2.options + }); + constrainedPropertyModel.propertyName = constrainedPropertyName; + const constrainedProperty = metaModelFactory(constrainRules, Object.assign(Object.assign({}, context2), { metaModel: propertyMetaModel.property, partOfProperty: constrainedPropertyModel }), alreadySeenModels); + constrainedPropertyModel.property = constrainedProperty; + constrainedModel.properties[String(constrainedPropertyName)] = constrainedPropertyModel; + } + return constrainedModel; +} +function enumModelFactory(constrainRules, context2) { + const constrainedModel = new ConstrainedEnumModel(context2.constrainedName, context2.metaModel.originalInput, getConstrainedMetaModelOptions(context2.metaModel), "", []); + const enumValueToConstrainedEnumValueModel = (enumValue) => { + const constrainedEnumKey = constrainRules.enumKey({ + enumKey: String(enumValue.key), + enumModel: context2.metaModel, + constrainedEnumModel: constrainedModel, + options: context2.options + }); + const constrainedEnumValue = constrainRules.enumValue({ + enumValue: enumValue.value, + enumModel: context2.metaModel, + constrainedEnumModel: constrainedModel, + options: context2.options + }); + return new ConstrainedEnumValueModel(constrainedEnumKey, constrainedEnumValue, enumValue.value); + }; + for (const enumValue of context2.metaModel.values) { + constrainedModel.values.push(enumValueToConstrainedEnumValueModel(enumValue)); + } + return constrainedModel; +} +function metaModelFactory(constrainRules, context2, alreadySeenModels = /* @__PURE__ */ new Map()) { + if (alreadySeenModels.has(context2.metaModel)) { + return alreadySeenModels.get(context2.metaModel); + } + const constrainedName = constrainRules.modelName({ + modelName: context2.metaModel.name, + options: context2.options + }); + const newContext = Object.assign(Object.assign({}, context2), { constrainedName }); + if (newContext.metaModel instanceof ObjectModel) { + return objectModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } else if (newContext.metaModel instanceof ReferenceModel) { + return referenceModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } else if (newContext.metaModel instanceof DictionaryModel) { + return dictionaryModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } else if (newContext.metaModel instanceof TupleModel) { + return tupleModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } else if (newContext.metaModel instanceof ArrayModel) { + return arrayModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } else if (newContext.metaModel instanceof UnionModel) { + return unionModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel }), alreadySeenModels); + } + let simpleModel; + if (newContext.metaModel instanceof EnumModel) { + simpleModel = enumModelFactory(constrainRules, Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } else if (newContext.metaModel instanceof BooleanModel) { + simpleModel = booleanModelFactory(Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } else if (newContext.metaModel instanceof AnyModel) { + simpleModel = anyModelFactory(Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } else if (newContext.metaModel instanceof FloatModel) { + simpleModel = floatModelFactory(Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } else if (newContext.metaModel instanceof IntegerModel) { + simpleModel = integerModelFactory(Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } else if (newContext.metaModel instanceof StringModel) { + simpleModel = stringModelFactory(Object.assign(Object.assign({}, newContext), { metaModel: newContext.metaModel })); + } + if (simpleModel !== void 0) { + alreadySeenModels.set(context2.metaModel, simpleModel); + return simpleModel; + } + throw new Error("Could not constrain model"); +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/ConstrainHelpers.js +function constrainMetaModel(typeMapping, constrainRules, context2, safeTypes = [ + ConstrainedAnyModel, + ConstrainedBooleanModel, + ConstrainedFloatModel, + ConstrainedIntegerModel, + ConstrainedStringModel, + ConstrainedReferenceModel, + ConstrainedObjectModel, + ConstrainedEnumModel, + ConstrainedObjectModel, + ConstrainedUnionModel, + ConstrainedArrayModel, + ConstrainedDictionaryModel, + ConstrainedTupleModel +]) { + const constrainedModel = metaModelFactory(constrainRules, context2, /* @__PURE__ */ new Map()); + applyTypesAndConst({ + constrainedModel, + generatorOptions: context2.options, + typeMapping, + alreadySeenModels: /* @__PURE__ */ new Map(), + safeTypes, + dependencyManager: context2.dependencyManager, + constrainRules + }); + return constrainedModel; +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/FilterHelpers.js +init_dirname(); +init_buffer2(); +init_process2(); +function getNormalProperties(properties) { + return Object.entries(properties).filter(([, value2]) => !(value2.property instanceof ConstrainedDictionaryModel) || value2.property instanceof ConstrainedDictionaryModel && value2.property.serializationType !== "unwrap"); +} +function getDictionary(properties) { + return Object.entries(properties).filter(([, value2]) => value2.property instanceof ConstrainedDictionaryModel && value2.property.serializationType === "unwrap"); +} +function getOriginalPropertyList(properties) { + return Object.entries(properties).map(([, model]) => { + return model.unconstrainedPropertyName; + }); +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/AvroToMetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); +function getMetaModelOptions2(AvroModel) { + var _a2; + const options = {}; + if (Array.isArray(AvroModel.type) && ((_a2 = AvroModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("null"))) { + options.isNullable = true; + } else { + options.isNullable = false; + } + return options; +} +function shouldBeAnyType2(avroSchemaModel) { + const containsAllTypesButNotNull = Array.isArray(avroSchemaModel.type) && avroSchemaModel.type.length >= 8 && !avroSchemaModel.type.includes("null"); + const containsAllTypes = Array.isArray(avroSchemaModel.type) && avroSchemaModel.type.length === 10; + return containsAllTypesButNotNull || containsAllTypes; +} +function AvroToMetaModel(avroSchemaModel, alreadySeenModels = /* @__PURE__ */ new Map()) { + const hasModel = alreadySeenModels.has(avroSchemaModel); + if (hasModel) { + return alreadySeenModels.get(avroSchemaModel); + } + const modelName = (avroSchemaModel === null || avroSchemaModel === void 0 ? void 0 : avroSchemaModel.name) || "undefined"; + if (shouldBeAnyType2(avroSchemaModel)) { + return new AnyModel(modelName, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); + } + if (avroSchemaModel.type && !Array.isArray(avroSchemaModel.type) && typeof avroSchemaModel.type !== "string") { + return AvroToMetaModel(avroSchemaModel.type, alreadySeenModels); + } + const objectModel = toObjectModel(avroSchemaModel, modelName, alreadySeenModels); + if (objectModel !== void 0) { + return objectModel; + } + const arrayModel = toArrayModel(avroSchemaModel, modelName, alreadySeenModels); + if (arrayModel !== void 0) { + return arrayModel; + } + const booleanModel = toBooleanModel(avroSchemaModel, modelName); + if (booleanModel !== void 0) { + return booleanModel; + } + const stringModel = toStringModel(avroSchemaModel, modelName); + if (stringModel !== void 0) { + return stringModel; + } + const integerModel = toIntegerModel(avroSchemaModel, modelName); + if (integerModel !== void 0) { + return integerModel; + } + const floatModel = toFloatModel(avroSchemaModel, modelName); + if (floatModel !== void 0) { + return floatModel; + } + const enumModel = toEnumModel(avroSchemaModel, modelName); + if (enumModel !== void 0) { + return enumModel; + } + const unionModel = toUnionModel(avroSchemaModel, modelName, alreadySeenModels); + if (unionModel !== void 0) { + return unionModel; + } + const dictionaryModel = toDictionaryModel(avroSchemaModel, modelName, alreadySeenModels); + if (dictionaryModel !== void 0) { + return dictionaryModel; + } + Logger2.warn("Failed to convert to MetaModel, defaulting to AnyModel."); + return new AnyModel(modelName, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); +} +function toBooleanModel(avroSchemaModel, name2) { + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("boolean")) { + return new BooleanModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); + } + return void 0; +} +function toIntegerModel(avroSchemaModel, name2) { + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && (avroSchemaModel.type.includes("int") || avroSchemaModel.type.includes("long"))) { + return new IntegerModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); + } + return void 0; +} +function toFloatModel(avroSchemaModel, name2) { + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && (avroSchemaModel.type.includes("float") || avroSchemaModel.type.includes("double"))) { + return new FloatModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); + } + return void 0; +} +function toStringModel(avroSchemaModel, name2) { + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("string") || (typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("fixed") || (typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("bytes")) { + return new StringModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel)); + } + return void 0; +} +function toEnumModel(avroSchemaModel, name2) { + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("enum") || Array.isArray(avroSchemaModel.symbols)) { + const enumValueToEnumValueModel = (enumValue) => { + if (typeof enumValue !== "string") { + return new EnumValueModel(JSON.stringify(enumValue), enumValue); + } + return new EnumValueModel(enumValue, enumValue); + }; + const metaModel = new EnumModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel), []); + if (avroSchemaModel.symbols) { + for (const enumValue of avroSchemaModel.symbols) { + metaModel.values.push(enumValueToEnumValueModel(enumValue)); + } + } + return metaModel; + } + return void 0; +} +function toUnionModel(avroSchemaModel, name2, alreadySeenModels) { + if (!Array.isArray(avroSchemaModel.type)) { + return void 0; + } + const containsTypeWithNull = Array.isArray(avroSchemaModel.type) && avroSchemaModel.type.length === 2 && avroSchemaModel.type.includes("null"); + if (containsTypeWithNull) { + return void 0; + } + const unionModel = new UnionModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel), []); + if (!alreadySeenModels.has(avroSchemaModel)) { + alreadySeenModels.set(avroSchemaModel, unionModel); + } + const enumModel = toEnumModel(avroSchemaModel, `${name2}_enum`); + if (enumModel !== void 0) { + unionModel.union.push(enumModel); + } + const objectModel = toObjectModel(avroSchemaModel, `${name2}_object`, alreadySeenModels); + if (objectModel !== void 0) { + unionModel.union.push(objectModel); + } + const arrayModel = toArrayModel(avroSchemaModel, `${name2}_array`, alreadySeenModels); + if (arrayModel !== void 0) { + unionModel.union.push(arrayModel); + } + const stringModel = toStringModel(avroSchemaModel, `${name2}_string`); + if (stringModel !== void 0) { + unionModel.union.push(stringModel); + } + const floatModel = toFloatModel(avroSchemaModel, `${name2}_float`); + if (floatModel !== void 0) { + unionModel.union.push(floatModel); + } + const integerModel = toIntegerModel(avroSchemaModel, `${name2}_integer`); + if (integerModel !== void 0) { + unionModel.union.push(integerModel); + } + const booleanModel = toBooleanModel(avroSchemaModel, `${name2}_boolean`); + if (booleanModel !== void 0) { + unionModel.union.push(booleanModel); + } + return unionModel; +} +function toObjectModel(avroSchemaModel, name2, alreadySeenModels) { + var _a2; + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && avroSchemaModel.type.includes("record")) { + const metaModel = new ObjectModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel), {}); + if (!alreadySeenModels.has(avroSchemaModel)) { + alreadySeenModels.set(avroSchemaModel, metaModel); + } + for (const prop of (avroSchemaModel === null || avroSchemaModel === void 0 ? void 0 : avroSchemaModel.fields) || []) { + const propertyModel = new ObjectPropertyModel((_a2 = prop.name) !== null && _a2 !== void 0 ? _a2 : "", true, AvroToMetaModel(prop, alreadySeenModels)); + metaModel.properties[String(prop.name)] = propertyModel; + } + return metaModel; + } + return void 0; +} +function toArrayModel(avroSchemaModel, name2, alreadySeenModels) { + var _a2; + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && ((_a2 = avroSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("array"))) { + const placeholderModel = new AnyModel("", void 0, getMetaModelOptions2(avroSchemaModel)); + const metaModel = new ArrayModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel), placeholderModel); + alreadySeenModels.set(avroSchemaModel, metaModel); + if (avroSchemaModel.items !== void 0) { + const AvroModel = new AvroSchema(); + AvroModel.name = `${name2}_${avroSchemaModel.items}`; + AvroModel.type = avroSchemaModel.items; + const valueModel = AvroToMetaModel(AvroModel, alreadySeenModels); + metaModel.valueModel = valueModel; + } + return metaModel; + } + return void 0; +} +function toDictionaryModel(avroSchemaModel, name2, alreadySeenModels) { + var _a2; + if ((typeof avroSchemaModel.type === "string" || Array.isArray(avroSchemaModel.type)) && ((_a2 = avroSchemaModel.type) === null || _a2 === void 0 ? void 0 : _a2.includes("map"))) { + const keyModel = new StringModel("", void 0, getMetaModelOptions2(avroSchemaModel)); + let valueModel = new AnyModel("", void 0, getMetaModelOptions2(avroSchemaModel)); + if (avroSchemaModel.values !== void 0) { + const AvroModel = new AvroSchema(); + AvroModel.name = `${name2}_${avroSchemaModel.values}`; + AvroModel.type = avroSchemaModel.values; + valueModel = AvroToMetaModel(AvroModel, alreadySeenModels); + } + return new DictionaryModel(name2, avroSchemaModel.originalInput, getMetaModelOptions2(avroSchemaModel), keyModel, valueModel); + } + return void 0; +} + +// node_modules/@asyncapi/modelina/lib/esm/helpers/XsdToMetaModel.js +init_dirname(); +init_buffer2(); +init_process2(); +var XSD_TYPE_MAPPING = { + // String types + "xs:string": "string", + "xsd:string": "string", + "xs:token": "string", + "xsd:token": "string", + "xs:normalizedString": "string", + "xsd:normalizedString": "string", + "xs:anyURI": "string", + "xsd:anyURI": "string", + "xs:QName": "string", + "xsd:QName": "string", + // Numeric types - integers + "xs:int": "integer", + "xsd:int": "integer", + "xs:integer": "integer", + "xsd:integer": "integer", + "xs:long": "integer", + "xsd:long": "integer", + "xs:short": "integer", + "xsd:short": "integer", + "xs:byte": "integer", + "xsd:byte": "integer", + "xs:nonNegativeInteger": "integer", + "xsd:nonNegativeInteger": "integer", + "xs:positiveInteger": "integer", + "xsd:positiveInteger": "integer", + "xs:nonPositiveInteger": "integer", + "xsd:nonPositiveInteger": "integer", + "xs:negativeInteger": "integer", + "xsd:negativeInteger": "integer", + "xs:unsignedLong": "integer", + "xsd:unsignedLong": "integer", + "xs:unsignedInt": "integer", + "xsd:unsignedInt": "integer", + "xs:unsignedShort": "integer", + "xsd:unsignedShort": "integer", + "xs:unsignedByte": "integer", + "xsd:unsignedByte": "integer", + // Numeric types - floats + "xs:float": "float", + "xsd:float": "float", + "xs:double": "float", + "xsd:double": "float", + "xs:decimal": "float", + "xsd:decimal": "float", + // Boolean types + "xs:boolean": "boolean", + "xsd:boolean": "boolean", + // Date/time types (treated as strings) + "xs:date": "string", + "xsd:date": "string", + "xs:time": "string", + "xsd:time": "string", + "xs:dateTime": "string", + "xsd:dateTime": "string", + "xs:duration": "string", + "xsd:duration": "string", + "xs:gYear": "string", + "xsd:gYear": "string", + "xs:gMonth": "string", + "xsd:gMonth": "string", + "xs:gDay": "string", + "xsd:gDay": "string", + // Binary types (treated as strings for now) + "xs:base64Binary": "string", + "xsd:base64Binary": "string", + "xs:hexBinary": "string", + "xsd:hexBinary": "string" +}; +function processComplexTypes(xsdSchema, typeRegistry, metaModels) { + if (!xsdSchema.complexTypes) { + return; + } + for (const complexType of xsdSchema.complexTypes) { + if (complexType.name) { + const model = complexTypeToMetaModel(complexType, xsdSchema, typeRegistry); + typeRegistry.set(complexType.name, model); + metaModels.push(model); + } + } +} +function processSimpleTypes(xsdSchema, typeRegistry, metaModels) { + if (!xsdSchema.simpleTypes) { + return; + } + for (const simpleType of xsdSchema.simpleTypes) { + if (simpleType.name) { + const model = simpleTypeToMetaModel(simpleType, xsdSchema, typeRegistry); + typeRegistry.set(simpleType.name, model); + metaModels.push(model); + } + } +} +function processRootElements(xsdSchema, typeRegistry, metaModels) { + if (!xsdSchema.elements) { + return; + } + for (const element of xsdSchema.elements) { + if (element.name) { + const model = elementToMetaModel(element, xsdSchema, typeRegistry); + if (model) { + metaModels.push(model); + } + } + } +} +function XsdToMetaModel(xsdSchema) { + const metaModels = []; + const typeRegistry = /* @__PURE__ */ new Map(); + processComplexTypes(xsdSchema, typeRegistry, metaModels); + processSimpleTypes(xsdSchema, typeRegistry, metaModels); + processRootElements(xsdSchema, typeRegistry, metaModels); + if (metaModels.length === 0) { + Logger2.warn("No models could be generated from XSD schema, creating default model"); + metaModels.push(new AnyModel("Root", xsdSchema.originalInput, {})); + } + return metaModels; +} +function elementToMetaModel(element, xsdSchema, typeRegistry) { + const name2 = element.name || "AnonymousElement"; + const options = { + isNullable: element.minOccurs === "0" || element.minOccurs === 0 + }; + if (element.type) { + const mappedType = XSD_TYPE_MAPPING[element.type]; + if (mappedType) { + return createPrimitiveModel(name2, mappedType, options, xsdSchema.originalInput); + } + const customType = typeRegistry.get(element.type); + if (customType) { + return customType; + } + } + if (element.complexType) { + return complexTypeToMetaModel(element.complexType, xsdSchema, typeRegistry, name2); + } + if (element.simpleType) { + return simpleTypeToMetaModel(element.simpleType, xsdSchema, typeRegistry, name2); + } + return new StringModel(name2, xsdSchema.originalInput, options); +} +function processSequenceElements(complexType, xsdSchema, typeRegistry, properties) { + var _a2; + if (!((_a2 = complexType.sequence) === null || _a2 === void 0 ? void 0 : _a2.elements)) { + return; + } + for (const element of complexType.sequence.elements) { + if (element.name) { + const propertyModel = elementToPropertyModel(element, xsdSchema, typeRegistry); + if (propertyModel) { + properties[element.name] = propertyModel; + } + } + } +} +function processSequenceAny(complexType, properties) { + var _a2; + if (!((_a2 = complexType.sequence) === null || _a2 === void 0 ? void 0 : _a2.any)) { + return; + } + for (let i7 = 0; i7 < complexType.sequence.any.length; i7++) { + const anyElement = complexType.sequence.any[i7]; + const propertyModel = anyToPropertyModel(anyElement, i7); + if (propertyModel) { + properties[propertyModel.propertyName] = propertyModel; + } + } +} +function processChoiceElements(complexType, xsdSchema, typeRegistry, properties) { + var _a2; + if (!((_a2 = complexType.choice) === null || _a2 === void 0 ? void 0 : _a2.elements)) { + return; + } + for (const element of complexType.choice.elements) { + if (element.name) { + const propertyModel = elementToPropertyModel(element, xsdSchema, typeRegistry); + if (propertyModel) { + propertyModel.required = false; + properties[element.name] = propertyModel; + } + } + } +} +function processChoiceAny(complexType, properties) { + var _a2; + if (!((_a2 = complexType.choice) === null || _a2 === void 0 ? void 0 : _a2.any)) { + return; + } + for (let i7 = 0; i7 < complexType.choice.any.length; i7++) { + const anyElement = complexType.choice.any[i7]; + const propertyModel = anyToPropertyModel(anyElement, i7); + if (propertyModel) { + propertyModel.required = false; + properties[propertyModel.propertyName] = propertyModel; + } + } +} +function processAttributes(attributes, xsdSchema, properties) { + if (!attributes) { + return; + } + for (const attribute of attributes) { + if (attribute.name) { + const propertyModel = attributeToPropertyModel(attribute, xsdSchema); + if (propertyModel) { + properties[attribute.name] = propertyModel; + } + } + } +} +function processComplexContentExtension(complexType, xsdSchema, typeRegistry, properties) { + var _a2, _b; + const extension = (_a2 = complexType.complexContent) === null || _a2 === void 0 ? void 0 : _a2.extension; + if (!extension) { + return; + } + if ((_b = extension.sequence) === null || _b === void 0 ? void 0 : _b.elements) { + for (const element of extension.sequence.elements) { + if (element.name) { + const propertyModel = elementToPropertyModel(element, xsdSchema, typeRegistry); + if (propertyModel) { + properties[element.name] = propertyModel; + } + } + } + } + processAttributes(extension.attributes, xsdSchema, properties); +} +function processSimpleContentExtension(complexType, xsdSchema, properties) { + var _a2; + const extension = (_a2 = complexType.simpleContent) === null || _a2 === void 0 ? void 0 : _a2.extension; + if (!extension) { + return; + } + const baseType = extension.base || "xs:string"; + const mappedType = XSD_TYPE_MAPPING[baseType] || "string"; + const valueModel = createPrimitiveModel("value", mappedType, {}, xsdSchema.originalInput); + properties["value"] = new ObjectPropertyModel("value", true, valueModel); + processAttributes(extension.attributes, xsdSchema, properties); +} +function complexTypeToMetaModel(complexType, xsdSchema, typeRegistry, overrideName) { + const name2 = overrideName || complexType.name || "AnonymousComplexType"; + const properties = {}; + processSequenceElements(complexType, xsdSchema, typeRegistry, properties); + processSequenceAny(complexType, properties); + processChoiceElements(complexType, xsdSchema, typeRegistry, properties); + processChoiceAny(complexType, properties); + processAttributes(complexType.attributes, xsdSchema, properties); + processComplexContentExtension(complexType, xsdSchema, typeRegistry, properties); + processSimpleContentExtension(complexType, xsdSchema, properties); + return new ObjectModel(name2, xsdSchema.originalInput, {}, properties); +} +function simpleTypeToMetaModel(simpleType, xsdSchema, typeRegistry, overrideName) { + var _a2, _b, _c; + const name2 = overrideName || simpleType.name || "AnonymousSimpleType"; + if ((_a2 = simpleType.restriction) === null || _a2 === void 0 ? void 0 : _a2.enumeration) { + const enumValues = simpleType.restriction.enumeration.map((value2) => { + return new EnumValueModel(String(value2), value2); + }); + return new EnumModel(name2, xsdSchema.originalInput, {}, enumValues); + } + if (simpleType.restriction) { + const baseType = simpleType.restriction.base || "xs:string"; + const mappedType = XSD_TYPE_MAPPING[baseType] || "string"; + return createPrimitiveModel(name2, mappedType, {}, xsdSchema.originalInput); + } + if ((_b = simpleType.union) === null || _b === void 0 ? void 0 : _b.memberTypes) { + const unionModels = []; + for (const memberType of simpleType.union.memberTypes) { + const mappedType = XSD_TYPE_MAPPING[memberType]; + if (mappedType) { + unionModels.push(createPrimitiveModel(name2, mappedType, {}, xsdSchema.originalInput)); + } + } + if (unionModels.length > 0) { + return new UnionModel(name2, xsdSchema.originalInput, {}, unionModels); + } + } + if ((_c = simpleType.list) === null || _c === void 0 ? void 0 : _c.itemType) { + const itemType = simpleType.list.itemType; + const mappedType = XSD_TYPE_MAPPING[itemType] || "string"; + const itemModel = createPrimitiveModel("item", mappedType, {}, xsdSchema.originalInput); + return new ArrayModel(name2, xsdSchema.originalInput, {}, itemModel); + } + return new StringModel(name2, xsdSchema.originalInput, {}); +} +function resolveElementType(element, name2, xsdSchema, typeRegistry) { + if (element.type) { + const mappedType = XSD_TYPE_MAPPING[element.type]; + if (mappedType) { + return createPrimitiveModel(name2, mappedType, {}, xsdSchema.originalInput); + } + const customType = typeRegistry.get(element.type); + return customType || new StringModel(name2, xsdSchema.originalInput, {}); + } + if (element.complexType) { + return complexTypeToMetaModel(element.complexType, xsdSchema, typeRegistry, name2); + } + if (element.simpleType) { + return simpleTypeToMetaModel(element.simpleType, xsdSchema, typeRegistry, name2); + } + return new StringModel(name2, xsdSchema.originalInput, {}); +} +function elementToPropertyModel(element, xsdSchema, typeRegistry) { + const name2 = element.name || "anonymousProperty"; + const isRequired = element.minOccurs !== "0" && element.minOccurs !== 0; + const isArray3 = element.maxOccurs === "unbounded" || typeof element.maxOccurs === "number" && element.maxOccurs > 1; + let propertyMetaModel = resolveElementType(element, name2, xsdSchema, typeRegistry); + if (isArray3) { + propertyMetaModel = new ArrayModel(name2, xsdSchema.originalInput, {}, propertyMetaModel); + } + return new ObjectPropertyModel(name2, isRequired, propertyMetaModel); +} +function attributeToPropertyModel(attribute, xsdSchema) { + const name2 = attribute.name || "anonymousAttribute"; + const isRequired = attribute.use === "required"; + let propertyMetaModel; + if (attribute.type) { + const mappedType = XSD_TYPE_MAPPING[attribute.type] || "string"; + propertyMetaModel = createPrimitiveModel(name2, mappedType, {}, xsdSchema.originalInput); + } else { + propertyMetaModel = new StringModel(name2, xsdSchema.originalInput, {}); + } + return new ObjectPropertyModel(name2, isRequired, propertyMetaModel); +} +function anyToPropertyModel(anyElement, index4) { + const name2 = `additionalProperty${index4 > 0 ? index4 : ""}`; + const isRequired = anyElement.minOccurs !== "0" && anyElement.minOccurs !== 0; + const isArray3 = anyElement.maxOccurs === "unbounded" || typeof anyElement.maxOccurs === "number" && anyElement.maxOccurs > 1; + let propertyMetaModel = new AnyModel(name2, void 0, {}); + if (isArray3) { + propertyMetaModel = new ArrayModel(name2, void 0, {}, propertyMetaModel); + } + return new ObjectPropertyModel(name2, isRequired, propertyMetaModel); +} +function createPrimitiveModel(name2, type3, options, originalInput) { + switch (type3) { + case "string": + return new StringModel(name2, originalInput, options); + case "integer": + return new IntegerModel(name2, originalInput, options); + case "float": + return new FloatModel(name2, originalInput, options); + case "boolean": + return new BooleanModel(name2, originalInput, options); + default: + return new StringModel(name2, originalInput, options); + } +} + +// node_modules/@asyncapi/modelina/lib/esm/processors/JsonSchemaInputProcessor.js +var __awaiter22 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultJsonSchemaProcessorOptions = { + allowInheritance: false, + disableCache: false, + ignoreAdditionalItems: false, + ignoreAdditionalProperties: false, + interpretSingleEnumAsConst: false, + propertyNameForAdditionalProperties: "additionalProperties" +}; +var JsonSchemaInputProcessor = class _JsonSchemaInputProcessor extends AbstractInputProcessor { + /** + * Function for processing a JSON Schema input. + * + * @param input + */ + process(input, options) { + if (this.shouldProcess(input)) { + switch (input.$schema) { + case "http://json-schema.org/draft-04/schema": + case "http://json-schema.org/draft-04/schema#": + return this.processDraft4(input, options); + case "http://json-schema.org/draft-06/schema": + case "http://json-schema.org/draft-06/schema#": + return this.processDraft6(input, options); + case "http://json-schema.org/draft-07/schema#": + case "http://json-schema.org/draft-07/schema": + default: + return this.processDraft7(input, options); + } + } + return Promise.reject(new Error("Input is not a JSON Schema, so it cannot be processed.")); + } + /** + * Unless the schema states one that is not supported we assume its of type JSON Schema + * + * @param input + */ + shouldProcess(input) { + if (input.$schema !== void 0) { + if (input.$schema === "http://json-schema.org/draft-04/schema#" || input.$schema === "http://json-schema.org/draft-04/schema" || input.$schema === "http://json-schema.org/draft-06/schema#" || input.$schema === "http://json-schema.org/draft-06/schema" || input.$schema === "http://json-schema.org/draft-07/schema#" || input.$schema === "http://json-schema.org/draft-07/schema") { + return true; + } + return false; + } + return true; + } + /** + * Process a draft-7 schema + * + * @param input to process as draft 7 + */ + processDraft7(input, options) { + return __awaiter22(this, void 0, void 0, function* () { + Logger2.debug("Processing input as a JSON Schema Draft 7 document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + input = _JsonSchemaInputProcessor.reflectSchemaNames(input, {}, /* @__PURE__ */ new Set(), "root", true); + input = yield this.dereferenceInputs(input); + const parsedSchema = Draft7Schema.toSchema(input); + const metaModel = _JsonSchemaInputProcessor.convertSchemaToMetaModel(parsedSchema, options); + inputModel.models[metaModel.name] = metaModel; + Logger2.debug("Completed processing input as JSON Schema draft 7 document"); + return inputModel; + }); + } + /** + * Process a draft-4 schema + * + * @param input to process as draft 4 + */ + processDraft4(input, options) { + return __awaiter22(this, void 0, void 0, function* () { + Logger2.debug("Processing input as JSON Schema Draft 4 document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + input = _JsonSchemaInputProcessor.reflectSchemaNames(input, {}, /* @__PURE__ */ new Set(), "root", true); + input = yield this.dereferenceInputs(input); + const parsedSchema = Draft4Schema.toSchema(input); + const metaModel = _JsonSchemaInputProcessor.convertSchemaToMetaModel(parsedSchema, options); + inputModel.models[metaModel.name] = metaModel; + Logger2.debug("Completed processing input as JSON Schema draft 4 document"); + return inputModel; + }); + } + /** + * Process a draft-6 schema + * + * @param input to process as draft-6 + */ + processDraft6(input, options) { + return __awaiter22(this, void 0, void 0, function* () { + Logger2.debug("Processing input as a JSON Schema Draft 6 document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + input = _JsonSchemaInputProcessor.reflectSchemaNames(input, {}, /* @__PURE__ */ new Set(), "root", true); + input = yield this.dereferenceInputs(input); + const parsedSchema = Draft6Schema.toSchema(input); + const metaModel = _JsonSchemaInputProcessor.convertSchemaToMetaModel(parsedSchema, options); + inputModel.models[metaModel.name] = metaModel; + Logger2.debug("Completed processing input as JSON Schema draft 6 document"); + return inputModel; + }); + } + /** + * This is a hotfix and really only a partial solution as it does not cover all cases. + * + * But it's the best we can do until we find or build a better library to handle references. + */ + handleRootReference(input) { + const hasRootRef = input.$ref !== void 0; + if (hasRootRef) { + Logger2.warn("Found a root $ref, which is not fully supported in Modelina, trying to do what I can with it..."); + const hasDefinitionSection = input.definitions !== void 0; + if (hasDefinitionSection) { + const definitionLink = "#/definitions/"; + const referenceLink = input.$ref.slice(0, definitionLink.length); + const referenceIsLocal = referenceLink === definitionLink; + if (referenceIsLocal) { + const definitionName = input.$ref.slice(definitionLink.length); + const definition = input.definitions[String(definitionName)]; + const definitionExist = definition !== void 0; + if (definitionExist) { + delete input.$ref; + return Object.assign(Object.assign({}, definition), input); + } + } + } + throw new Error("Cannot handle input, because it has a root `$ref`, please manually resolve the first reference."); + } + return input; + } + dereferenceInputs(input) { + return __awaiter22(this, void 0, void 0, function* () { + input = this.handleRootReference(input); + Logger2.debug("Dereferencing all $ref instances"); + const localPath = `${process.cwd()}${exports5.sep}`; + const deRefOption = { + continueOnError: true, + dereference: { + circular: true, + excludedPathMatcher: (path2) => { + return path2.includes("/examples/") && !path2.includes("/properties/examples/"); + } + } + }; + Logger2.debug(`Trying to dereference all $ref instances from input, using option ${JSON.stringify(deRefOption)}.`); + try { + yield dereference(localPath, input, deRefOption); + } catch (e10) { + const errorMessage = `Could not dereference $ref in input, is all the references correct? ${e10.message}`; + Logger2.error(errorMessage, e10); + throw new Error(errorMessage); + } + Logger2.debug("Successfully dereferenced all $ref instances from input.", input); + return input; + }); + } + /** + * Each schema must have a name, so when later interpreted, the model have the most accurate model name. + * + * Reflect name from given schema and save it to `x-modelgen-inferred-name` extension. + * + * This reflects all the common keywords that are shared between draft-4, draft-7 and Swagger 2.0 Schema + * + * @param schema to process + * @param namesStack is a aggregator of previous used names + * @param seenSchemas is a set of schema already seen and named + * @param name to infer + * @param isRoot indicates if performed schema is a root schema + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + static reflectSchemaNames(schema8, namesStack, seenSchemas, name2, isRoot) { + if (typeof schema8 === "boolean") { + return schema8; + } + if (seenSchemas.has(schema8)) { + return schema8; + } + seenSchemas.add(schema8); + schema8 = Object.assign({}, schema8); + if (isRoot) { + namesStack[String(name2)] = 0; + schema8[this.MODELINA_INFERRED_NAME] = name2; + name2 = ""; + } else if (name2 && !schema8[this.MODELINA_INFERRED_NAME] && schema8.$ref === void 0) { + let occurrence = namesStack[String(name2)]; + if (occurrence === void 0) { + namesStack[String(name2)] = 0; + } else { + occurrence++; + } + const inferredName = occurrence ? `${name2}_${occurrence}` : name2; + schema8[this.MODELINA_INFERRED_NAME] = inferredName; + } + if (schema8.allOf !== void 0) { + schema8.allOf = schema8.allOf.map((item, idx) => this.reflectSchemaNames(item, namesStack, seenSchemas, this.ensureNamePattern(name2, "allOf", idx))); + } + if (schema8.oneOf !== void 0) { + schema8.oneOf = schema8.oneOf.map((item, idx) => this.reflectSchemaNames(item, namesStack, seenSchemas, this.ensureNamePattern(name2, "oneOf", idx))); + } + if (schema8.anyOf !== void 0) { + schema8.anyOf = schema8.anyOf.map((item, idx) => this.reflectSchemaNames(item, namesStack, seenSchemas, this.ensureNamePattern(name2, "anyOf", idx))); + } + if (schema8.not !== void 0) { + schema8.not = this.reflectSchemaNames(schema8.not, namesStack, seenSchemas, this.ensureNamePattern(name2, "not")); + } + if (typeof schema8.additionalItems === "object" && schema8.additionalItems !== void 0) { + schema8.additionalItems = this.reflectSchemaNames(schema8.additionalItems, namesStack, seenSchemas, this.ensureNamePattern(name2, "additionalItem")); + } + if (typeof schema8.additionalProperties === "object" && schema8.additionalProperties !== void 0) { + schema8.additionalProperties = this.reflectSchemaNames(schema8.additionalProperties, namesStack, seenSchemas, this.ensureNamePattern(name2, "additionalProperty")); + } + if (schema8.items !== void 0) { + if (Array.isArray(schema8.items)) { + schema8.items = schema8.items.map((item, idx) => this.reflectSchemaNames(item, namesStack, seenSchemas, this.ensureNamePattern(name2, "item", idx))); + } else { + schema8.items = this.reflectSchemaNames(schema8.items, namesStack, seenSchemas, this.ensureNamePattern(name2, "item")); + } + } + if (schema8.properties !== void 0) { + const properties = {}; + for (const [propertyName, propertySchema] of Object.entries(schema8.properties)) { + properties[String(propertyName)] = this.reflectSchemaNames(propertySchema, namesStack, seenSchemas, this.ensureNamePattern(name2, propertyName)); + } + schema8.properties = properties; + } + if (schema8.dependencies !== void 0) { + const dependencies = {}; + for (const [dependencyName, dependency] of Object.entries(schema8.dependencies)) { + if (typeof dependency === "object" && !Array.isArray(dependency)) { + dependencies[String(dependencyName)] = this.reflectSchemaNames(dependency, namesStack, seenSchemas, this.ensureNamePattern(name2, dependencyName)); + } else { + dependencies[String(dependencyName)] = dependency; + } + } + schema8.dependencies = dependencies; + } + if (schema8.patternProperties !== void 0) { + const patternProperties = {}; + for (const [idx, [patternPropertyName, patternProperty]] of Object.entries(Object.entries(schema8.patternProperties))) { + patternProperties[String(patternPropertyName)] = this.reflectSchemaNames(patternProperty, namesStack, seenSchemas, this.ensureNamePattern(name2, "pattern_property", idx)); + } + schema8.patternProperties = patternProperties; + } + if (schema8.definitions !== void 0) { + const definitions = {}; + for (const [definitionName, definition] of Object.entries(schema8.definitions)) { + definitions[String(definitionName)] = this.reflectSchemaNames(definition, namesStack, seenSchemas, this.ensureNamePattern(name2, definitionName)); + } + schema8.definitions = definitions; + } + if (!(schema8 instanceof Draft4Schema)) { + if (schema8.contains !== void 0) { + schema8.contains = this.reflectSchemaNames(schema8.contains, namesStack, seenSchemas, this.ensureNamePattern(name2, "contain")); + } + if (schema8.propertyNames !== void 0) { + schema8.propertyNames = this.reflectSchemaNames(schema8.propertyNames, namesStack, seenSchemas, this.ensureNamePattern(name2, "propertyName")); + } + if (!(schema8 instanceof Draft6Schema)) { + if (schema8.if !== void 0) { + schema8.if = this.reflectSchemaNames(schema8.if, namesStack, seenSchemas, this.ensureNamePattern(name2, "if")); + } + if (schema8.then !== void 0) { + schema8.then = this.reflectSchemaNames(schema8.then, namesStack, seenSchemas, this.ensureNamePattern(name2, "then")); + } + if (schema8.else !== void 0) { + schema8.else = this.reflectSchemaNames(schema8.else, namesStack, seenSchemas, this.ensureNamePattern(name2, "else")); + } + } + } + return schema8; + } + /** + * Ensure schema name using previous name and new part + * + * @param previousName to concatenate with + * @param newParts + */ + static ensureNamePattern(previousName, ...newParts) { + const pattern5 = newParts.map((part) => `${part}`).join("_"); + if (!previousName) { + return pattern5; + } + return `${previousName}_${pattern5}`; + } + /** + * Simplifies a JSON Schema into a common models + * + * @param schema to simplify to common model + */ + static convertSchemaToCommonModel(schema8, options) { + const interpreter = new Interpreter(); + const model = interpreter.interpret(schema8, options === null || options === void 0 ? void 0 : options.jsonSchema); + if (model === void 0) { + throw new Error("Could not interpret schema to internal model"); + } + return model; + } + /** + * Simplifies a JSON Schema into a common models + * + * @param schema to simplify to common model + */ + static convertSchemaToMetaModel(schema8, options) { + const commonModel = this.convertSchemaToCommonModel(schema8, options); + return convertToMetaModel({ + jsonSchemaModel: commonModel, + options: Object.assign(Object.assign({}, defaultJsonSchemaProcessorOptions), options === null || options === void 0 ? void 0 : options.jsonSchema), + alreadySeenModels: /* @__PURE__ */ new Map() + }); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/AsyncAPIInputProcessor.js +init_fs(); +init_url(); + +// node_modules/@asyncapi/multi-parser/esm/parse.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/parser.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/document.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/asyncapi.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/base.js +init_dirname(); +init_buffer2(); +init_process2(); +var BaseModel2 = class { + constructor(_json, _meta = {}) { + this._json = _json; + this._meta = _meta; + } + json(key) { + if (key === void 0) + return this._json; + if (this._json === null || this._json === void 0) + return this._json; + return this._json[key]; + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[key]; + } + jsonPath(field) { + if (typeof field !== "string") { + return this._meta.pointer; + } + return `${this._meta.pointer}/${field}`; + } + createModel(Model, value2, meta) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: this._meta.asyncapi })); + } +}; + +// node_modules/parserapiv1/esm/models/v2/info.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/contact.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/mixins.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/bindings.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/collection.js +init_dirname(); +init_buffer2(); +init_process2(); +var Collection3 = class extends Array { + constructor(collections, _meta = {}) { + super(...collections); + this.collections = collections; + this._meta = _meta; + } + has(id) { + return typeof this.get(id) !== "undefined"; + } + all() { + return this.collections; + } + isEmpty() { + return this.collections.length === 0; + } + filterBy(filter2) { + return this.collections.filter(filter2); + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[String(key)]; + } +}; + +// node_modules/parserapiv1/esm/models/v2/extensions.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extensions3 = class extends Collection3 { + get(id) { + id = id.startsWith("x-") ? id : `x-${id}`; + return this.collections.find((ext) => ext.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/extension.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extension3 = class extends BaseModel2 { + id() { + return this._meta.id; + } + value() { + return this._json; + } +}; + +// node_modules/parserapiv1/esm/models/utils.js +init_dirname(); +init_buffer2(); +init_process2(); +function createModel2(Model, value2, meta, parent2) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: meta.asyncapi || (parent2 === null || parent2 === void 0 ? void 0 : parent2.meta().asyncapi) })); +} + +// node_modules/parserapiv1/esm/constants.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs5 = __toESM(require_specs2()); +var xParserSpecParsed2 = "x-parser-spec-parsed"; +var xParserSpecStringified2 = "x-parser-spec-stringified"; +var xParserApiVersion2 = "x-parser-api-version"; +var xParserMessageName2 = "x-parser-message-name"; +var xParserSchemaId2 = "x-parser-schema-id"; +var xParserOriginalPayload2 = "x-parser-original-payload"; +var xParserCircular2 = "x-parser-circular"; +var EXTENSION_REGEX2 = /^x-[\w\d.\-_]+$/; +var specVersions2 = Object.keys(import_specs5.default.schemas); +var lastVersion2 = specVersions2[specVersions2.length - 1]; + +// node_modules/parserapiv1/esm/models/v2/bindings.js +var Bindings3 = class extends Collection3 { + get(name2) { + return this.collections.find((binding3) => binding3.protocol() === name2); + } + extensions() { + const extensions6 = []; + Object.entries(this._meta.originalData || {}).forEach(([id, value2]) => { + if (EXTENSION_REGEX2.test(id)) { + extensions6.push(createModel2(Extension3, value2, { id, pointer: `${this._meta.pointer}/${id}`, asyncapi: this._meta.asyncapi })); + } + }); + return new Extensions3(extensions6); + } +}; + +// node_modules/parserapiv1/esm/models/v2/binding.js +init_dirname(); +init_buffer2(); +init_process2(); +var Binding3 = class extends BaseModel2 { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const value2 = Object.assign({}, this._json); + delete value2.bindingVersion; + return value2; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/external-docs.js +init_dirname(); +init_buffer2(); +init_process2(); +var ExternalDocumentation3 = class extends BaseModel2 { + url() { + return this._json.url; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/tags.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tags3 = class extends Collection3 { + get(name2) { + return this.collections.find((tag) => tag.name() === name2); + } +}; + +// node_modules/parserapiv1/esm/models/v2/tag.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tag4 = class extends BaseModel2 { + name() { + return this._json.name; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + extensions() { + return extensions3(this); + } + hasExternalDocs() { + return hasExternalDocs4(this); + } + externalDocs() { + return externalDocs4(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/mixins.js +function bindings3(model) { + const bindings6 = model.json("bindings") || {}; + return new Bindings3(Object.entries(bindings6 || {}).map(([protocol, binding3]) => createModel2(Binding3, binding3, { protocol, pointer: model.jsonPath(`bindings/${protocol}`) }, model)), { originalData: bindings6, asyncapi: model.meta("asyncapi"), pointer: model.jsonPath("bindings") }); +} +function hasDescription4(model) { + return Boolean(description4(model)); +} +function description4(model) { + return model.json("description"); +} +function extensions3(model) { + const extensions6 = []; + Object.entries(model.json()).forEach(([id, value2]) => { + if (EXTENSION_REGEX2.test(id)) { + extensions6.push(createModel2(Extension3, value2, { id, pointer: model.jsonPath(id) }, model)); + } + }); + return new Extensions3(extensions6); +} +function hasExternalDocs4(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs4(model) { + if (hasExternalDocs4(model)) { + return new ExternalDocumentation3(model.json("externalDocs")); + } +} +function tags3(model) { + return new Tags3((model.json("tags") || []).map((tag, idx) => createModel2(Tag4, tag, { pointer: model.jsonPath(`tags/${idx}`) }, model))); +} + +// node_modules/parserapiv1/esm/models/v2/contact.js +var Contact4 = class extends BaseModel2 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/license.js +init_dirname(); +init_buffer2(); +init_process2(); +var License4 = class extends BaseModel2 { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/info.js +var Info4 = class extends BaseModel2 { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const contact = this._json.contact; + return contact && this.createModel(Contact4, contact, { pointer: "/info/contact" }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const license = this._json.license; + return license && this.createModel(License4, license, { pointer: "/info/license" }); + } + hasExternalDocs() { + return Object.keys(this._meta.asyncapi.parsed.externalDocs || {}).length > 0; + } + externalDocs() { + if (this.hasExternalDocs()) { + return this.createModel(ExternalDocumentation3, this._meta.asyncapi.parsed.externalDocs, { pointer: "/externalDocs" }); + } + } + tags() { + const tags6 = this._meta.asyncapi.parsed.tags || []; + return new Tags3(tags6.map((tag, idx) => this.createModel(Tag4, tag, { pointer: `/tags/${idx}` }))); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/channels.js +init_dirname(); +init_buffer2(); +init_process2(); +var Channels3 = class extends Collection3 { + get(id) { + return this.collections.find((channel) => channel.id() === id); + } + filterBySend() { + return this.filterBy((channel) => channel.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((channel) => channel.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv1/esm/models/v2/channel.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/channel-parameters.js +init_dirname(); +init_buffer2(); +init_process2(); +var ChannelParameters3 = class extends Collection3 { + get(id) { + return this.collections.find((parameter) => parameter.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/channel-parameter.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var Schema6 = class _Schema extends BaseModel2 { + id() { + return this.$id() || this._meta.id || this.json(xParserSchemaId2); + } + $comment() { + if (typeof this._json === "boolean") + return; + return this._json.$comment; + } + $id() { + if (typeof this._json === "boolean") + return; + return this._json.$id; + } + $schema() { + if (typeof this._json === "boolean") + return "http://json-schema.org/draft-07/schema#"; + return this._json.$schema || "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalItems === "boolean") + return this._json.additionalItems; + if (this._json.additionalItems === void 0) + return true; + if (this._json.additionalItems === null) + return false; + return this.createModel(_Schema, this._json.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalProperties === "boolean") + return this._json.additionalProperties; + if (this._json.additionalProperties === void 0) + return true; + if (this._json.additionalProperties === null) + return false; + return this.createModel(_Schema, this._json.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.allOf)) + return void 0; + return this._json.allOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/allOf/${index4}`, parent: this })); + } + anyOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.anyOf)) + return void 0; + return this._json.anyOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/anyOf/${index4}`, parent: this })); + } + const() { + if (typeof this._json === "boolean") + return; + return this._json.const; + } + contains() { + if (typeof this._json === "boolean" || typeof this._json.contains !== "object") + return; + return this.createModel(_Schema, this._json.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if (typeof this._json === "boolean") + return; + return this._json.contentEncoding; + } + contentMediaType() { + if (typeof this._json === "boolean") + return; + return this._json.contentMediaType; + } + default() { + if (typeof this._json === "boolean") + return; + return this._json.default; + } + definitions() { + if (typeof this._json === "boolean" || typeof this._json.definitions !== "object") + return; + return Object.entries(this._json.definitions).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/definitions/${key}`, parent: this }); + return acc; + }, {}); + } + description() { + if (typeof this._json === "boolean") + return; + return this._json.description; + } + dependencies() { + if (typeof this._json === "boolean") + return; + if (typeof this._json.dependencies !== "object") + return void 0; + return Object.entries(this._json.dependencies).reduce((acc, [key, s7]) => { + acc[key] = Array.isArray(s7) ? s7 : this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/dependencies/${key}`, parent: this }); + return acc; + }, {}); + } + deprecated() { + if (typeof this._json === "boolean") + return false; + return this._json.deprecated || false; + } + discriminator() { + if (typeof this._json === "boolean") + return; + return this._json.discriminator; + } + else() { + if (typeof this._json === "boolean" || typeof this._json.else !== "object") + return; + return this.createModel(_Schema, this._json.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if (typeof this._json === "boolean") + return; + return this._json.enum; + } + examples() { + if (typeof this._json === "boolean") + return; + return this._json.examples; + } + exclusiveMaximum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMaximum; + } + exclusiveMinimum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMinimum; + } + format() { + if (typeof this._json === "boolean") + return; + return this._json.format; + } + isBooleanSchema() { + return typeof this._json === "boolean"; + } + if() { + if (typeof this._json === "boolean" || typeof this._json.if !== "object") + return; + return this.createModel(_Schema, this._json.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._json) + return true; + parent2 = parent2._meta.parent; + } + return false; + } + items() { + if (typeof this._json === "boolean" || typeof this._json.items !== "object") + return; + if (Array.isArray(this._json.items)) { + return this._json.items.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/items/${index4}`, parent: this })); + } + return this.createModel(_Schema, this._json.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if (typeof this._json === "boolean") + return; + return this._json.maximum; + } + maxItems() { + if (typeof this._json === "boolean") + return; + return this._json.maxItems; + } + maxLength() { + if (typeof this._json === "boolean") + return; + return this._json.maxLength; + } + maxProperties() { + if (typeof this._json === "boolean") + return; + return this._json.maxProperties; + } + minimum() { + if (typeof this._json === "boolean") + return; + return this._json.minimum; + } + minItems() { + if (typeof this._json === "boolean") + return; + return this._json.minItems; + } + minLength() { + if (typeof this._json === "boolean") + return; + return this._json.minLength; + } + minProperties() { + if (typeof this._json === "boolean") + return; + return this._json.minProperties; + } + multipleOf() { + if (typeof this._json === "boolean") + return; + return this._json.multipleOf; + } + not() { + if (typeof this._json === "boolean" || typeof this._json.not !== "object") + return; + return this.createModel(_Schema, this._json.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.oneOf)) + return void 0; + return this._json.oneOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/oneOf/${index4}`, parent: this })); + } + pattern() { + if (typeof this._json === "boolean") + return; + return this._json.pattern; + } + patternProperties() { + if (typeof this._json === "boolean" || typeof this._json.patternProperties !== "object") + return; + return Object.entries(this._json.patternProperties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/patternProperties/${key}`, parent: this }); + return acc; + }, {}); + } + properties() { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object") + return; + return Object.entries(this._json.properties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/properties/${key}`, parent: this }); + return acc; + }, {}); + } + property(name2) { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object" || typeof this._json.properties[name2] !== "object") + return; + return this.createModel(_Schema, this._json.properties[name2], { pointer: `${this._meta.pointer}/properties/${name2}`, parent: this }); + } + propertyNames() { + if (typeof this._json === "boolean" || typeof this._json.propertyNames !== "object") + return; + return this.createModel(_Schema, this._json.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.readOnly || false; + } + required() { + if (typeof this._json === "boolean") + return; + return this._json.required; + } + then() { + if (typeof this._json === "boolean" || typeof this._json.then !== "object") + return; + return this.createModel(_Schema, this._json.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if (typeof this._json === "boolean") + return; + return this._json.title; + } + type() { + if (typeof this._json === "boolean") + return; + return this._json.type; + } + uniqueItems() { + if (typeof this._json === "boolean") + return false; + return this._json.uniqueItems || false; + } + writeOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.writeOnly || false; + } + hasExternalDocs() { + return hasExternalDocs4(this); + } + externalDocs() { + return externalDocs4(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/channel-parameter.js +var ChannelParameter4 = class extends BaseModel2 { + id() { + return this._meta.id; + } + hasSchema() { + return !!this._json.schema; + } + schema() { + if (!this._json.schema) + return void 0; + return this.createModel(Schema6, this._json.schema, { pointer: `${this._meta.pointer}/schema` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/messages.js +init_dirname(); +init_buffer2(); +init_process2(); +var Messages3 = class extends Collection3 { + get(name2) { + return this.collections.find((message) => message.id() === name2); + } + filterBySend() { + return this.filterBy((message) => message.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((message) => message.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv1/esm/models/v2/operations.js +init_dirname(); +init_buffer2(); +init_process2(); +var Operations3 = class extends Collection3 { + get(id) { + return this.collections.find((operation) => operation.id() === id); + } + filterBySend() { + return this.filterBy((operation) => operation.isSend()); + } + filterByReceive() { + return this.filterBy((operation) => operation.isReceive()); + } +}; + +// node_modules/parserapiv1/esm/models/v2/operation.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/message.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/message-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageTraits3 = class extends Collection3 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/message-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/correlation-id.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationId4 = class extends BaseModel2 { + location() { + return this._json.location; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/message-examples.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExamples3 = class extends Collection3 { + get(name2) { + return this.collections.find((example) => example.name() === name2); + } +}; + +// node_modules/parserapiv1/esm/models/v2/message-example.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExample3 = class extends BaseModel2 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/schema-parser/index.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter23 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function validateSchema2(parser3, input) { + return __awaiter23(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + const { path: path2, schemaFormat } = input; + path2.pop(); + return [ + { + message: `Unknown schema format: "${schemaFormat}"`, + path: [...path2, "schemaFormat"] + }, + { + message: `Cannot validate and parse given schema due to unknown schema format: "${schemaFormat}"`, + path: [...path2, "payload"] + } + ]; + } + return schemaParser.validate(input); + }); +} +function parseSchema2(parser3, input) { + return __awaiter23(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + throw new Error("Unknown schema format"); + } + return schemaParser.parse(input); + }); +} +function registerSchemaParser2(parser3, schemaParser) { + if (typeof schemaParser !== "object" || typeof schemaParser.validate !== "function" || typeof schemaParser.parse !== "function" || typeof schemaParser.getMimeTypes !== "function") { + throw new Error('Custom parser must have "parse()", "validate()" and "getMimeTypes()" functions.'); + } + schemaParser.getMimeTypes().forEach((schemaFormat) => { + parser3.parserRegistry.set(schemaFormat, schemaParser); + }); +} +function getSchemaFormat2(schematFormat, asyncapiVersion) { + if (typeof schematFormat === "string") { + return schematFormat; + } + return getDefaultSchemaFormat2(asyncapiVersion); +} +function getDefaultSchemaFormat2(asyncapiVersion) { + return `application/vnd.aai.asyncapi;version=${asyncapiVersion}`; +} + +// node_modules/parserapiv1/esm/models/v2/message-trait.js +var MessageTrait4 = class extends BaseModel2 { + id() { + return this.messageId() || this._meta.id || this.json(xParserMessageName2); + } + schemaFormat() { + return this._json.schemaFormat || getDefaultSchemaFormat2(this._meta.asyncapi.semver.version); + } + hasMessageId() { + return !!this._json.messageId; + } + messageId() { + return this._json.messageId; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (!this._json.correlationId) + return void 0; + return this.createModel(CorrelationId4, this._json.correlationId, { pointer: `${this._meta.pointer}/correlationId` }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var _a2; + return this._json.contentType || ((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (!this._json.headers) + return void 0; + return this.createModel(Schema6, this._json.headers, { pointer: `${this._meta.pointer}/headers` }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + hasExternalDocs() { + return hasExternalDocs4(this); + } + externalDocs() { + return externalDocs4(this); + } + examples() { + return new MessageExamples3((this._json.examples || []).map((example, index4) => { + return this.createModel(MessageExample3, example, { pointer: `${this._meta.pointer}/examples/${index4}` }); + })); + } + tags() { + return tags3(this); + } + bindings() { + return bindings3(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/servers.js +init_dirname(); +init_buffer2(); +init_process2(); +var Servers3 = class extends Collection3 { + get(id) { + return this.collections.find((server) => server.id() === id); + } + filterBySend() { + return this.filterBy((server) => server.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((server) => server.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv1/esm/utils.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core22 = __toESM(require_dist11()); +init_dist2(); +function createDetailedAsyncAPI2(parsed, input, source) { + return { + source, + input, + parsed, + semver: getSemver2(parsed.asyncapi) + }; +} +function getSemver2(version5) { + const [major, minor, patchWithRc] = version5.split("."); + const [patch, rc] = patchWithRc.split("-rc"); + return { + version: version5, + major: Number(major), + minor: Number(minor), + patch: Number(patch), + rc: rc && Number(rc) + }; +} +function normalizeInput2(asyncapi) { + if (typeof asyncapi === "string") { + return asyncapi; + } + return JSON.stringify(asyncapi, void 0, 2); +} +function hasErrorDiagnostic2(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Error); +} +function hasWarningDiagnostic2(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Warning); +} +function hasInfoDiagnostic2(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Information); +} +function hasHintDiagnostic2(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Hint); +} +function setExtension2(id, value2, model) { + const modelValue = model.json(); + if (typeof modelValue === "object" && modelValue) { + id = id.startsWith("x-") ? id : `x-${id}`; + modelValue[String(id)] = value2; + } +} +function mergePatch2(origin, patch) { + if (!isObject6(patch)) { + return patch; + } + const result2 = !isObject6(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = mergePatch2(result2[key], patchVal); + } + }); + return result2; +} +function isObject6(value2) { + return Boolean(value2) && typeof value2 === "object" && Array.isArray(value2) === false; +} +function toJSONPathArray2(jsonPath) { + return splitPath3(serializePath2(jsonPath)); +} +function createUncaghtDiagnostic2(err, message, document2) { + if (!(err instanceof Error)) { + return []; + } + const range2 = document2 ? document2.getRangeForJsonPath([]) : import_spectral_core22.Document.DEFAULT_RANGE; + return [ + { + code: "uncaught-error", + message: `${message}. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: [], + severity: DiagnosticSeverity.Error, + range: range2 + } + ]; +} +function tilde2(str2) { + return str2.replace(/[~/]{1}/g, (sub) => { + switch (sub) { + case "/": + return "~1"; + case "~": + return "~0"; + } + return sub; + }); +} +function untilde2(str2) { + if (!str2.includes("~")) + return str2; + return str2.replace(/~[01]/g, (sub) => { + switch (sub) { + case "~1": + return "/"; + case "~0": + return "~"; + } + return sub; + }); +} +function findSubArrayIndex2(arr, subarr, fromIndex = 0) { + let i7, found, j6; + for (i7 = fromIndex; i7 < 1 + (arr.length - subarr.length); ++i7) { + found = true; + for (j6 = 0; j6 < subarr.length; ++j6) { + if (arr[i7 + j6] !== subarr[j6]) { + found = false; + break; + } + } + if (found) { + return i7; + } + } + return -1; +} +function retrieveDeepData2(value2, path2) { + let index4 = 0; + const length = path2.length; + while (typeof value2 === "object" && value2 && index4 < length) { + value2 = value2[path2[index4++]]; + } + return index4 === length ? value2 : void 0; +} +function serializePath2(path2) { + if (path2.startsWith("#")) + return path2.substring(1); + return path2; +} +function splitPath3(path2) { + return path2.split("/").filter(Boolean).map(untilde2); +} + +// node_modules/parserapiv1/esm/models/v2/message.js +var Message4 = class extends MessageTrait4 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (!this._json.payload) + return void 0; + return this.createModel(Schema6, this._json.payload, { pointer: `${this._meta.pointer}/payload` }); + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers3(servers); + } + channels() { + const channels = []; + const channelsData = []; + this.operations().all().forEach((operation) => { + operation.channels().forEach((channel) => { + if (!channelsData.includes(channel.json())) { + channelsData.push(channel.json()); + channels.push(channel); + } + }); + }); + return new Channels3(channels); + } + operations() { + var _a2; + const operations = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + ["subscribe", "publish"].forEach((operationAction) => { + const operation = channel[operationAction]; + if (operation && (operation.message === this._json || (operation.message.oneOf || []).includes(this._json))) { + operations.push(this.createModel(Operation4, operation, { id: "", pointer: `/channels/${tilde2(channelAddress)}/${operationAction}`, action: operationAction })); + } + }); + }); + return new Operations3(operations); + } + traits() { + return new MessageTraits3((this._json.traits || []).map((trait, index4) => { + return this.createModel(MessageTrait4, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}` }); + })); + } +}; + +// node_modules/parserapiv1/esm/models/v2/operation-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationTraits3 = class extends Collection3 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/operation-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/security-scheme.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/oauth-flows.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/oauth-flow.js +init_dirname(); +init_buffer2(); +init_process2(); +var OAuthFlow4 = class extends BaseModel2 { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.scopes; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/oauth-flows.js +var OAuthFlows3 = class extends BaseModel2 { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (!this._json.authorizationCode) + return void 0; + return new OAuthFlow4(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (!this._json.clientCredentials) + return void 0; + return new OAuthFlow4(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (!this._json.implicit) + return void 0; + return new OAuthFlow4(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (!this._json.password) + return void 0; + return new OAuthFlow4(this._json.password); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/security-scheme.js +var SecurityScheme4 = class extends BaseModel2 { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (!this._json.flows) + return void 0; + return new OAuthFlows3(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/security-requirements.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirements3 = class extends Collection3 { + get(id) { + return this.collections.find((securityRequirement) => securityRequirement.meta("id") === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/security-requirement.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirement4 = class extends BaseModel2 { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } +}; + +// node_modules/parserapiv1/esm/models/v2/operation-trait.js +var OperationTrait4 = class extends BaseModel2 { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._json.operationId; + } + operationId() { + return this._json.operationId; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + hasExternalDocs() { + return hasExternalDocs4(this); + } + externalDocs() { + return externalDocs4(this); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme4, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement4, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements3(requirements); + }); + } + tags() { + return tags3(this); + } + bindings() { + return bindings3(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/operation.js +var Operation4 = class extends OperationTrait4 { + action() { + return this._meta.action; + } + isSend() { + return this.action() === "subscribe"; + } + isReceive() { + return this.action() === "publish"; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers3(servers); + } + channels() { + const channels = []; + Object.entries(this._meta.asyncapi.parsed.channels || {}).forEach(([channelAddress, channel]) => { + if (channel.subscribe === this._json || channel.publish === this._json) { + channels.push(this.createModel(Channel4, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde2(channelAddress)}` })); + } + }); + return new Channels3(channels); + } + messages() { + let isOneOf = false; + let messages = []; + if (this._json.message) { + if (Array.isArray(this._json.message.oneOf)) { + messages = this._json.message.oneOf; + isOneOf = true; + } else { + messages = [this._json.message]; + } + } + return new Messages3(messages.map((message, index4) => { + return this.createModel(Message4, message, { id: "", pointer: `${this._meta.pointer}/message${isOneOf ? `/oneOf/${index4}` : ""}` }); + })); + } + traits() { + return new OperationTraits3((this._json.traits || []).map((trait, index4) => { + return this.createModel(OperationTrait4, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}`, action: "" }); + })); + } +}; + +// node_modules/parserapiv1/esm/models/v2/server.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/server-variables.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariables3 = class extends Collection3 { + get(id) { + return this.collections.find((variable) => variable.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/server-variable.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariable4 = class extends BaseModel2 { + id() { + return this._meta.id; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/server.js +var Server4 = class extends BaseModel2 { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + protocol() { + return this._json.protocol; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + channels() { + var _a2; + const channels = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + const allowedServers = channel.servers || []; + if (allowedServers.length === 0 || allowedServers.includes(this._meta.id)) { + channels.push(this.createModel(Channel4, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde2(channelAddress)}` })); + } + }); + return new Channels3(channels); + } + operations() { + const operations = []; + this.channels().forEach((channel) => { + operations.push(...channel.operations().all()); + }); + return new Operations3(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages3(messages); + } + variables() { + return new ServerVariables3(Object.entries(this._json.variables || {}).map(([serverVariableName, serverVariable]) => { + return this.createModel(ServerVariable4, serverVariable, { + id: serverVariableName, + pointer: `${this._meta.pointer}/variables/${serverVariableName}` + }); + })); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme4, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement4, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements3(requirements); + }); + } + tags() { + return tags3(this); + } + bindings() { + return bindings3(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/channel.js +var Channel4 = class extends BaseModel2 { + id() { + return this._meta.id; + } + address() { + return this._meta.address; + } + hasDescription() { + return hasDescription4(this); + } + description() { + return description4(this); + } + servers() { + var _a2; + const servers = []; + const allowedServers = this._json.servers || []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.servers) || {}).forEach(([serverName, server]) => { + if (allowedServers.length === 0 || allowedServers.includes(serverName)) { + servers.push(this.createModel(Server4, server, { id: serverName, pointer: `/servers/${serverName}` })); + } + }); + return new Servers3(servers); + } + operations() { + const operations = []; + ["publish", "subscribe"].forEach((operationAction) => { + const operation = this._json[operationAction]; + const id = operation && operation.operationId || operationAction; + if (operation) { + operations.push(this.createModel(Operation4, operation, { id, action: operationAction, pointer: `${this._meta.pointer}/${operationAction}` })); + } + }); + return new Operations3(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages3(messages); + } + parameters() { + return new ChannelParameters3(Object.entries(this._json.parameters || {}).map(([channelParameterName, channelParameter]) => { + return this.createModel(ChannelParameter4, channelParameter, { + id: channelParameterName, + pointer: `${this._meta.pointer}/parameters/${channelParameterName}` + }); + })); + } + bindings() { + return bindings3(this); + } + extensions() { + return extensions3(this); + } +}; + +// node_modules/parserapiv1/esm/models/v2/components.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v2/schemas.js +init_dirname(); +init_buffer2(); +init_process2(); +var Schemas3 = class extends Collection3 { + get(id) { + return this.collections.find((schema8) => schema8.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/security-schemes.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecuritySchemes3 = class extends Collection3 { + get(id) { + return this.collections.find((securityScheme) => securityScheme.id() === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/correlation-ids.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationIds3 = class extends Collection3 { + get(id) { + return this.collections.find((correlationId) => correlationId.meta("id") === id); + } +}; + +// node_modules/parserapiv1/esm/models/v2/components.js +var Components4 = class extends BaseModel2 { + servers() { + return this.createCollection("servers", Servers3, Server4); + } + channels() { + return new Channels3(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel4, channel, { id: channelAddress, address: "", pointer: `/components/channels/${tilde2(channelAddress)}` }))); + } + operations() { + return new Operations3([]); + } + messages() { + return this.createCollection("messages", Messages3, Message4); + } + schemas() { + return this.createCollection("schemas", Schemas3, Schema6); + } + channelParameters() { + return this.createCollection("parameters", ChannelParameters3, ChannelParameter4); + } + serverVariables() { + return this.createCollection("serverVariables", ServerVariables3, ServerVariable4); + } + operationTraits() { + return this.createCollection("operationTraits", OperationTraits3, OperationTrait4); + } + messageTraits() { + return this.createCollection("messageTraits", MessageTraits3, MessageTrait4); + } + correlationIds() { + return this.createCollection("correlationIds", CorrelationIds3, CorrelationId4); + } + securitySchemes() { + return this.createCollection("securitySchemes", SecuritySchemes3, SecurityScheme4); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return extensions3(this); + } + isEmpty() { + return Object.keys(this._json).length === 0; + } + createCollection(itemsName, collectionModel, itemModel) { + const collectionItems = []; + Object.entries(this._json[itemsName] || {}).forEach(([id, item]) => { + collectionItems.push(this.createModel(itemModel, item, { id, pointer: `/components/${itemsName}/${id}` })); + }); + return new collectionModel(collectionItems); + } + createBindings(itemsName) { + return Object.entries(this._json[itemsName] || {}).reduce((bindings6, [name2, item]) => { + const bindingsData = item || {}; + const asyncapi = this.meta("asyncapi"); + const pointer = `components/${itemsName}/${name2}`; + bindings6[name2] = new Bindings3(Object.entries(bindingsData).map(([protocol, binding3]) => this.createModel(Binding3, binding3, { protocol, pointer: `${pointer}/${protocol}` })), { originalData: bindingsData, asyncapi, pointer }); + return bindings6; + }, {}); + } +}; + +// node_modules/parserapiv1/esm/iterator.js +init_dirname(); +init_buffer2(); +init_process2(); +var SchemaIteratorCallbackType3; +(function(SchemaIteratorCallbackType5) { + SchemaIteratorCallbackType5["NEW_SCHEMA"] = "NEW_SCHEMA"; + SchemaIteratorCallbackType5["END_SCHEMA"] = "END_SCHEMA"; +})(SchemaIteratorCallbackType3 || (SchemaIteratorCallbackType3 = {})); +var SchemaTypesToIterate3; +(function(SchemaTypesToIterate5) { + SchemaTypesToIterate5["Parameters"] = "parameters"; + SchemaTypesToIterate5["Payloads"] = "payloads"; + SchemaTypesToIterate5["Headers"] = "headers"; + SchemaTypesToIterate5["Components"] = "components"; + SchemaTypesToIterate5["Objects"] = "objects"; + SchemaTypesToIterate5["Arrays"] = "arrays"; + SchemaTypesToIterate5["OneOfs"] = "oneOfs"; + SchemaTypesToIterate5["AllOfs"] = "allOfs"; + SchemaTypesToIterate5["AnyOfs"] = "anyOfs"; + SchemaTypesToIterate5["Nots"] = "nots"; + SchemaTypesToIterate5["PropertyNames"] = "propertyNames"; + SchemaTypesToIterate5["PatternProperties"] = "patternProperties"; + SchemaTypesToIterate5["Contains"] = "contains"; + SchemaTypesToIterate5["Ifs"] = "ifs"; + SchemaTypesToIterate5["Thenes"] = "thenes"; + SchemaTypesToIterate5["Elses"] = "elses"; + SchemaTypesToIterate5["Dependencies"] = "dependencies"; + SchemaTypesToIterate5["Definitions"] = "definitions"; +})(SchemaTypesToIterate3 || (SchemaTypesToIterate3 = {})); +function traverseAsyncApiDocument3(doc, callback, schemaTypesToIterate = []) { + if (schemaTypesToIterate.length === 0) { + schemaTypesToIterate = Object.values(SchemaTypesToIterate3); + } + const options = { callback, schemaTypesToIterate, seenSchemas: /* @__PURE__ */ new Set() }; + if (!doc.channels().isEmpty()) { + doc.channels().all().forEach((channel) => { + traverseChannel3(channel, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Components) && !doc.components().isEmpty()) { + const components = doc.components(); + Object.values(components.messages().all() || {}).forEach((message) => { + traverseMessage3(message, options); + }); + Object.values(components.schemas().all() || {}).forEach((schema8) => { + traverseSchema3(schema8, null, options); + }); + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Parameters)) { + Object.values(components.channelParameters().filterBy((param) => { + return param.hasSchema(); + })).forEach((parameter) => { + traverseSchema3(parameter.schema(), null, options); + }); + } + Object.values(components.messageTraits().all() || {}).forEach((messageTrait) => { + traverseMessageTrait3(messageTrait, options); + }); + } +} +function traverseSchema3(schema8, propOrIndex, options) { + if (!schema8) + return; + const { schemaTypesToIterate, callback, seenSchemas } = options; + const jsonSchema = schema8.json(); + if (seenSchemas.has(jsonSchema)) + return; + seenSchemas.add(jsonSchema); + let types3 = schema8.type() || []; + if (!Array.isArray(types3)) { + types3 = [types3]; + } + if (!schemaTypesToIterate.includes(SchemaTypesToIterate3.Objects) && types3.includes("object")) + return; + if (!schemaTypesToIterate.includes(SchemaTypesToIterate3.Arrays) && types3.includes("array")) + return; + if (callback(schema8, propOrIndex, SchemaIteratorCallbackType3.NEW_SCHEMA) === false) + return; + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Objects) && types3.includes("object")) { + recursiveSchemaObject3(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Arrays) && types3.includes("array")) { + recursiveSchemaArray3(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.OneOfs)) { + (schema8.oneOf() || []).forEach((combineSchema, idx) => { + traverseSchema3(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.AnyOfs)) { + (schema8.anyOf() || []).forEach((combineSchema, idx) => { + traverseSchema3(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.AllOfs)) { + (schema8.allOf() || []).forEach((combineSchema, idx) => { + traverseSchema3(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Nots) && schema8.not()) { + traverseSchema3(schema8.not(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Ifs) && schema8.if()) { + traverseSchema3(schema8.if(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Thenes) && schema8.then()) { + traverseSchema3(schema8.then(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Elses) && schema8.else()) { + traverseSchema3(schema8.else(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Dependencies)) { + Object.entries(schema8.dependencies() || {}).forEach(([depName, dep]) => { + if (dep && !Array.isArray(dep)) { + traverseSchema3(dep, depName, options); + } + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Definitions)) { + Object.entries(schema8.definitions() || {}).forEach(([defName, def]) => { + traverseSchema3(def, defName, options); + }); + } + callback(schema8, propOrIndex, SchemaIteratorCallbackType3.END_SCHEMA); + seenSchemas.delete(jsonSchema); +} +function recursiveSchemaObject3(schema8, options) { + Object.entries(schema8.properties() || {}).forEach(([propertyName, property2]) => { + traverseSchema3(property2, propertyName, options); + }); + const additionalProperties = schema8.additionalProperties(); + if (typeof additionalProperties === "object") { + traverseSchema3(additionalProperties, null, options); + } + const schemaTypesToIterate = options.schemaTypesToIterate; + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.PropertyNames) && schema8.propertyNames()) { + traverseSchema3(schema8.propertyNames(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.PatternProperties)) { + Object.entries(schema8.patternProperties() || {}).forEach(([propertyName, property2]) => { + traverseSchema3(property2, propertyName, options); + }); + } +} +function recursiveSchemaArray3(schema8, options) { + const items = schema8.items(); + if (items) { + if (Array.isArray(items)) { + items.forEach((item, idx) => { + traverseSchema3(item, idx, options); + }); + } else { + traverseSchema3(items, null, options); + } + } + const additionalItems = schema8.additionalItems(); + if (typeof additionalItems === "object") { + traverseSchema3(additionalItems, null, options); + } + if (options.schemaTypesToIterate.includes("contains") && schema8.contains()) { + traverseSchema3(schema8.contains(), null, options); + } +} +function traverseChannel3(channel, options) { + if (!channel) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Parameters)) { + Object.values(channel.parameters().filterBy((param) => { + return param.hasSchema(); + }) || {}).forEach((parameter) => { + traverseSchema3(parameter.schema(), null, options); + }); + } + channel.messages().all().forEach((message) => { + traverseMessage3(message, options); + }); +} +function traverseMessage3(message, options) { + if (!message) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Headers) && message.hasHeaders()) { + traverseSchema3(message.headers(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Payloads) && message.hasPayload()) { + traverseSchema3(message.payload(), null, options); + } +} +function traverseMessageTrait3(messageTrait, options) { + if (!messageTrait) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate3.Headers) && messageTrait.hasHeaders()) { + traverseSchema3(messageTrait.headers(), null, options); + } +} + +// node_modules/parserapiv1/esm/models/v2/asyncapi.js +var AsyncAPIDocument4 = class extends BaseModel2 { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(Info4, this._json.info, { pointer: "/info" }); + } + servers() { + return new Servers3(Object.entries(this._json.servers || {}).map(([serverName, server]) => this.createModel(Server4, server, { id: serverName, pointer: `/servers/${serverName}` }))); + } + channels() { + return new Channels3(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel4, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde2(channelAddress)}` }))); + } + operations() { + const operations = []; + this.channels().forEach((channel) => operations.push(...channel.operations())); + return new Operations3(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + return new Messages3(messages); + } + schemas() { + return this.__schemas(false); + } + securitySchemes() { + var _a2; + return new SecuritySchemes3(Object.entries(((_a2 = this._json.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) || {}).map(([securitySchemeName, securityScheme]) => this.createModel(SecurityScheme4, securityScheme, { id: securitySchemeName, pointer: `/components/securitySchemes/${securitySchemeName}` }))); + } + components() { + return this.createModel(Components4, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const servers = this.servers(); + this.components().servers().forEach((server) => !servers.some((s7) => s7.json() === server.json()) && servers.push(server)); + return new Servers3(servers); + } + allChannels() { + const channels = this.channels(); + this.components().channels().forEach((channel) => !channels.some((c7) => c7.json() === channel.json()) && channels.push(channel)); + return new Channels3(channels); + } + allOperations() { + const operations = []; + this.allChannels().forEach((channel) => operations.push(...channel.operations())); + return new Operations3(operations); + } + allMessages() { + const messages = []; + this.allOperations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + this.components().messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message)); + return new Messages3(messages); + } + allSchemas() { + return this.__schemas(true); + } + extensions() { + return extensions3(this); + } + __schemas(withComponents) { + const schemas5 = /* @__PURE__ */ new Set(); + function callback(schema8) { + if (!schemas5.has(schema8.json())) { + schemas5.add(schema8); + } + } + let toIterate = Object.values(SchemaTypesToIterate3); + if (!withComponents) { + toIterate = toIterate.filter((s7) => s7 !== SchemaTypesToIterate3.Components); + } + traverseAsyncApiDocument3(this, callback, toIterate); + return new Schemas3(Array.from(schemas5)); + } +}; + +// node_modules/parserapiv1/esm/models/v3/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/models/v3/asyncapi.js +init_dirname(); +init_buffer2(); +init_process2(); +var AsyncAPIDocument5 = class extends BaseModel2 { + version() { + return this._json.asyncapi; + } +}; + +// node_modules/parserapiv1/esm/stringify.js +init_dirname(); +init_buffer2(); +init_process2(); +function unstringify2(document2) { + let parsed = document2; + if (typeof document2 === "string") { + try { + parsed = JSON.parse(document2); + } catch (_6) { + return; + } + } + if (!isStringifiedDocument2(parsed)) { + return; + } + parsed = Object.assign({}, parsed); + delete parsed[String(xParserSpecStringified2)]; + traverseStringifiedData2(document2, void 0, document2, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return createAsyncAPIDocument2(createDetailedAsyncAPI2(parsed, document2)); +} +function copy2(data) { + const stringifiedData = JSON.stringify(data, refReplacer2()); + const unstringifiedData = JSON.parse(stringifiedData); + traverseStringifiedData2(unstringifiedData, void 0, unstringifiedData, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return unstringifiedData; +} +function refReplacer2() { + const modelPaths = /* @__PURE__ */ new Map(); + const paths = /* @__PURE__ */ new Map(); + let init2 = null; + return function(field, value2) { + const pathPart = modelPaths.get(this) + (Array.isArray(this) ? `[${field}]` : `.${field}`); + const isComplex = value2 === Object(value2); + if (isComplex) { + modelPaths.set(value2, pathPart); + } + const savedPath = paths.get(value2) || ""; + if (!savedPath && isComplex) { + const valuePath = pathPart.replace(/undefined\.\.?/, ""); + paths.set(value2, valuePath); + } + const prefixPath = savedPath[0] === "[" ? "$" : "$."; + let val = savedPath ? `$ref:${prefixPath}${savedPath}` : value2; + if (init2 === null) { + init2 = value2; + } else if (val === init2) { + val = "$ref:$"; + } + return val; + }; +} +var refRoot2 = "$ref:$"; +function traverseStringifiedData2(parent2, field, root2, objToPath, pathToObj) { + let objOrPath = parent2; + let path2 = refRoot2; + if (field !== void 0) { + objOrPath = parent2[String(field)]; + const concatenatedPath = field ? `.${field}` : ""; + path2 = objToPath.get(parent2) + (Array.isArray(parent2) ? `[${field}]` : concatenatedPath); + } + objToPath.set(objOrPath, path2); + pathToObj.set(path2, objOrPath); + const ref = pathToObj.get(objOrPath); + if (ref) { + parent2[String(field)] = ref; + } + if (objOrPath === refRoot2 || ref === refRoot2) { + parent2[String(field)] = root2; + } + if (objOrPath === Object(objOrPath)) { + for (const f8 in objOrPath) { + traverseStringifiedData2(objOrPath, f8, root2, objToPath, pathToObj); + } + } +} + +// node_modules/parserapiv1/esm/document.js +function createAsyncAPIDocument2(asyncapi) { + switch (asyncapi.semver.major) { + case 2: + return new AsyncAPIDocument4(asyncapi.parsed, { asyncapi, pointer: "/" }); + default: + throw new Error(`Unsupported AsyncAPI version: ${asyncapi.semver.version}`); + } +} +function toAsyncAPIDocument2(maybeDoc) { + if (isAsyncAPIDocument3(maybeDoc)) { + return maybeDoc; + } + if (!isParsedDocument2(maybeDoc)) { + return unstringify2(maybeDoc); + } + return createAsyncAPIDocument2(createDetailedAsyncAPI2(maybeDoc, maybeDoc)); +} +function isAsyncAPIDocument3(maybeDoc) { + if (!maybeDoc) { + return false; + } + if (maybeDoc instanceof AsyncAPIDocument4 || maybeDoc instanceof AsyncAPIDocument5) { + return true; + } + if (maybeDoc && typeof maybeDoc.json === "function") { + const versionOfParserAPI = maybeDoc.json()[xParserApiVersion2]; + return versionOfParserAPI === 1; + } + return false; +} +function isParsedDocument2(maybeDoc) { + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed2]); +} +function isStringifiedDocument2(maybeDoc) { + try { + maybeDoc = typeof maybeDoc === "string" ? JSON.parse(maybeDoc) : maybeDoc; + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed2]) && Boolean(maybeDoc[xParserSpecStringified2]); + } catch (_6) { + return false; + } +} + +// node_modules/parserapiv1/esm/parse.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/custom-operations/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/custom-operations/apply-traits.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/node_modules/jsonpath-plus/dist/index-browser-esm.js +init_dirname(); +init_buffer2(); +init_process2(); +function _typeof(obj) { + "@babel/helpers - typeof"; + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof(obj); +} +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} +function _defineProperties(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) + _setPrototypeOf(subClass, superClass); +} +function _getPrototypeOf(o7) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o8) { + return o8.__proto__ || Object.getPrototypeOf(o8); + }; + return _getPrototypeOf(o7); +} +function _setPrototypeOf(o7, p7) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o8, p8) { + o8.__proto__ = p8; + return o8; + }; + return _setPrototypeOf(o7, p7); +} +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e10) { + return false; + } +} +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct3(Parent2, args2, Class2) { + var a7 = [null]; + a7.push.apply(a7, args2); + var Constructor = Function.bind.apply(Parent2, a7); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf(instance, Class2.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); +} +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} +function _wrapNativeSuper(Class) { + var _cache2 = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; + _wrapNativeSuper = function _wrapNativeSuper3(Class2) { + if (Class2 === null || !_isNativeFunction(Class2)) + return Class2; + if (typeof Class2 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache2 !== "undefined") { + if (_cache2.has(Class2)) + return _cache2.get(Class2); + _cache2.set(Class2, Wrapper); + } + function Wrapper() { + return _construct(Class2, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class2.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class2); + }; + return _wrapNativeSuper(Class); +} +function _assertThisInitialized(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; +} +function _possibleConstructorReturn(self2, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized(self2); +} +function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), result2; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result2 = Reflect.construct(Super, arguments, NewTarget); + } else { + result2 = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result2); + }; +} +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); +} +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _unsupportedIterableToArray(o7, minLen) { + if (!o7) + return; + if (typeof o7 === "string") + return _arrayLikeToArray(o7, minLen); + var n7 = Object.prototype.toString.call(o7).slice(8, -1); + if (n7 === "Object" && o7.constructor) + n7 = o7.constructor.name; + if (n7 === "Map" || n7 === "Set") + return Array.from(o7); + if (n7 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n7)) + return _arrayLikeToArray(o7, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i7 = 0, arr2 = new Array(len); i7 < len; i7++) + arr2[i7] = arr[i7]; + return arr2; +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _createForOfIteratorHelper(o7, allowArrayLike) { + var it2 = typeof Symbol !== "undefined" && o7[Symbol.iterator] || o7["@@iterator"]; + if (!it2) { + if (Array.isArray(o7) || (it2 = _unsupportedIterableToArray(o7)) || allowArrayLike && o7 && typeof o7.length === "number") { + if (it2) + o7 = it2; + var i7 = 0; + var F6 = function() { + }; + return { + s: F6, + n: function() { + if (i7 >= o7.length) + return { + done: true + }; + return { + done: false, + value: o7[i7++] + }; + }, + e: function(e10) { + throw e10; + }, + f: F6 + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, didErr = false, err; + return { + s: function() { + it2 = it2.call(o7); + }, + n: function() { + var step = it2.next(); + normalCompletion = step.done; + return step; + }, + e: function(e10) { + didErr = true; + err = e10; + }, + f: function() { + try { + if (!normalCompletion && it2.return != null) + it2.return(); + } finally { + if (didErr) + throw err; + } + } + }; +} +var hasOwnProp = Object.prototype.hasOwnProperty; +function push2(arr, item) { + arr = arr.slice(); + arr.push(item); + return arr; +} +function unshift2(item, arr) { + arr = arr.slice(); + arr.unshift(item); + return arr; +} +var NewError2 = /* @__PURE__ */ function(_Error) { + _inherits(NewError4, _Error); + var _super = _createSuper(NewError4); + function NewError4(value2) { + var _this; + _classCallCheck(this, NewError4); + _this = _super.call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'); + _this.avoidNew = true; + _this.value = value2; + _this.name = "NewError"; + return _this; + } + return _createClass(NewError4); +}(/* @__PURE__ */ _wrapNativeSuper(Error)); +function JSONPath2(opts, expr, obj, callback, otherTypeCallback) { + if (!(this instanceof JSONPath2)) { + try { + return new JSONPath2(opts, expr, obj, callback, otherTypeCallback); + } catch (e10) { + if (!e10.avoidNew) { + throw e10; + } + return e10.value; + } + } + if (typeof opts === "string") { + otherTypeCallback = callback; + callback = obj; + obj = expr; + expr = opts; + opts = null; + } + var optObj = opts && _typeof(opts) === "object"; + opts = opts || {}; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || "value"; + this.flatten = opts.flatten || false; + this.wrap = hasOwnProp.call(opts, "wrap") ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.preventEval = opts.preventEval || false; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || callback || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }; + if (opts.autostart !== false) { + var args = { + path: optObj ? opts.path : expr + }; + if (!optObj) { + args.json = obj; + } else if ("json" in opts) { + args.json = opts.json; + } + var ret = this.evaluate(args); + if (!ret || _typeof(ret) !== "object") { + throw new NewError2(ret); + } + return ret; + } +} +JSONPath2.prototype.evaluate = function(expr, json2, callback, otherTypeCallback) { + var _this2 = this; + var currParent = this.parent, currParentProperty = this.parentProperty; + var flatten2 = this.flatten, wrap2 = this.wrap; + this.currResultType = this.resultType; + this.currPreventEval = this.preventEval; + this.currSandbox = this.sandbox; + callback = callback || this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + json2 = json2 || this.json; + expr = expr || this.path; + if (expr && _typeof(expr) === "object" && !Array.isArray(expr)) { + if (!expr.path && expr.path !== "") { + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + } + if (!hasOwnProp.call(expr, "json")) { + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + } + var _expr = expr; + json2 = _expr.json; + flatten2 = hasOwnProp.call(expr, "flatten") ? expr.flatten : flatten2; + this.currResultType = hasOwnProp.call(expr, "resultType") ? expr.resultType : this.currResultType; + this.currSandbox = hasOwnProp.call(expr, "sandbox") ? expr.sandbox : this.currSandbox; + wrap2 = hasOwnProp.call(expr, "wrap") ? expr.wrap : wrap2; + this.currPreventEval = hasOwnProp.call(expr, "preventEval") ? expr.preventEval : this.currPreventEval; + callback = hasOwnProp.call(expr, "callback") ? expr.callback : callback; + this.currOtherTypeCallback = hasOwnProp.call(expr, "otherTypeCallback") ? expr.otherTypeCallback : this.currOtherTypeCallback; + currParent = hasOwnProp.call(expr, "parent") ? expr.parent : currParent; + currParentProperty = hasOwnProp.call(expr, "parentProperty") ? expr.parentProperty : currParentProperty; + expr = expr.path; + } + currParent = currParent || null; + currParentProperty = currParentProperty || null; + if (Array.isArray(expr)) { + expr = JSONPath2.toPathString(expr); + } + if (!expr && expr !== "" || !json2) { + return void 0; + } + var exprList = JSONPath2.toPathArray(expr); + if (exprList[0] === "$" && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = null; + var result2 = this._trace(exprList, json2, ["$"], currParent, currParentProperty, callback).filter(function(ea) { + return ea && !ea.isParentSelector; + }); + if (!result2.length) { + return wrap2 ? [] : void 0; + } + if (!wrap2 && result2.length === 1 && !result2[0].hasArrExpr) { + return this._getPreferredOutput(result2[0]); + } + return result2.reduce(function(rslt, ea) { + var valOrPath = _this2._getPreferredOutput(ea); + if (flatten2 && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, []); +}; +JSONPath2.prototype._getPreferredOutput = function(ea) { + var resultType = this.currResultType; + switch (resultType) { + case "all": { + var path2 = Array.isArray(ea.path) ? ea.path : JSONPath2.toPathArray(ea.path); + ea.pointer = JSONPath2.toPointer(path2); + ea.path = typeof ea.path === "string" ? ea.path : JSONPath2.toPathString(ea.path); + return ea; + } + case "value": + case "parent": + case "parentProperty": + return ea[resultType]; + case "path": + return JSONPath2.toPathString(ea[resultType]); + case "pointer": + return JSONPath2.toPointer(ea.path); + default: + throw new TypeError("Unknown result type"); + } +}; +JSONPath2.prototype._handleCallback = function(fullRetObj, callback, type3) { + if (callback) { + var preferredOutput = this._getPreferredOutput(fullRetObj); + fullRetObj.path = typeof fullRetObj.path === "string" ? fullRetObj.path : JSONPath2.toPathString(fullRetObj.path); + callback(preferredOutput, type3, fullRetObj); + } +}; +JSONPath2.prototype._trace = function(expr, val, path2, parent2, parentPropName, callback, hasArrExpr, literalPriority) { + var _this3 = this; + var retObj; + if (!expr.length) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + var loc = expr[0], x7 = expr.slice(1); + var ret = []; + function addRet(elems) { + if (Array.isArray(elems)) { + elems.forEach(function(t9) { + ret.push(t9); + }); + } else { + ret.push(elems); + } + } + if ((typeof loc !== "string" || literalPriority) && val && hasOwnProp.call(val, loc)) { + addRet(this._trace(x7, val[loc], push2(path2, loc), val, loc, callback, hasArrExpr)); + } else if (loc === "*") { + this._walk(val, function(m7) { + addRet(_this3._trace(x7, val[m7], push2(path2, m7), val, m7, callback, true, true)); + }); + } else if (loc === "..") { + addRet(this._trace(x7, val, path2, parent2, parentPropName, callback, hasArrExpr)); + this._walk(val, function(m7) { + if (_typeof(val[m7]) === "object") { + addRet(_this3._trace(expr.slice(), val[m7], push2(path2, m7), val, m7, callback, true)); + } + }); + } else if (loc === "^") { + this._hasParentSelector = true; + return { + path: path2.slice(0, -1), + expr: x7, + isParentSelector: true + }; + } else if (loc === "~") { + retObj = { + path: push2(path2, loc), + value: parentPropName, + parent: parent2, + parentProperty: null + }; + this._handleCallback(retObj, callback, "property"); + return retObj; + } else if (loc === "$") { + addRet(this._trace(x7, val, path2, null, null, callback, hasArrExpr)); + } else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(loc)) { + addRet(this._slice(loc, x7, val, path2, parent2, parentPropName, callback)); + } else if (loc.indexOf("?(") === 0) { + if (this.currPreventEval) { + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + } + var safeLoc = loc.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, "$1"); + this._walk(val, function(m7) { + if (_this3._eval(safeLoc, val[m7], m7, path2, parent2, parentPropName)) { + addRet(_this3._trace(x7, val[m7], push2(path2, m7), val, m7, callback, true)); + } + }); + } else if (loc[0] === "(") { + if (this.currPreventEval) { + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + } + addRet(this._trace(unshift2(this._eval(loc, val, path2[path2.length - 1], path2.slice(0, -1), parent2, parentPropName), x7), val, path2, parent2, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === "@") { + var addType = false; + var valueType = loc.slice(1, -2); + switch (valueType) { + case "scalar": + if (!val || !["object", "function"].includes(_typeof(val))) { + addType = true; + } + break; + case "boolean": + case "string": + case "undefined": + case "function": + if (_typeof(val) === valueType) { + addType = true; + } + break; + case "integer": + if (Number.isFinite(val) && !(val % 1)) { + addType = true; + } + break; + case "number": + if (Number.isFinite(val)) { + addType = true; + } + break; + case "nonFinite": + if (typeof val === "number" && !Number.isFinite(val)) { + addType = true; + } + break; + case "object": + if (val && _typeof(val) === valueType) { + addType = true; + } + break; + case "array": + if (Array.isArray(val)) { + addType = true; + } + break; + case "other": + addType = this.currOtherTypeCallback(val, path2, parent2, parentPropName); + break; + case "null": + if (val === null) { + addType = true; + } + break; + default: + throw new TypeError("Unknown value type " + valueType); + } + if (addType) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + } else if (loc[0] === "`" && val && hasOwnProp.call(val, loc.slice(1))) { + var locProp = loc.slice(1); + addRet(this._trace(x7, val[locProp], push2(path2, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(",")) { + var parts = loc.split(","); + var _iterator = _createForOfIteratorHelper(parts), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var part = _step.value; + addRet(this._trace(unshift2(part, x7), val, path2, parent2, parentPropName, callback, true)); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } else if (!literalPriority && val && hasOwnProp.call(val, loc)) { + addRet(this._trace(x7, val[loc], push2(path2, loc), val, loc, callback, hasArrExpr, true)); + } + if (this._hasParentSelector) { + for (var t8 = 0; t8 < ret.length; t8++) { + var rett = ret[t8]; + if (rett && rett.isParentSelector) { + var tmp = this._trace(rett.expr, val, rett.path, parent2, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t8] = tmp[0]; + var tl = tmp.length; + for (var tt3 = 1; tt3 < tl; tt3++) { + t8++; + ret.splice(t8, 0, tmp[tt3]); + } + } else { + ret[t8] = tmp; + } + } + } + } + return ret; +}; +JSONPath2.prototype._walk = function(val, f8) { + if (Array.isArray(val)) { + var n7 = val.length; + for (var i7 = 0; i7 < n7; i7++) { + f8(i7); + } + } else if (val && _typeof(val) === "object") { + Object.keys(val).forEach(function(m7) { + f8(m7); + }); + } +}; +JSONPath2.prototype._slice = function(loc, expr, val, path2, parent2, parentPropName, callback) { + if (!Array.isArray(val)) { + return void 0; + } + var len = val.length, parts = loc.split(":"), step = parts[2] && Number.parseInt(parts[2]) || 1; + var start = parts[0] && Number.parseInt(parts[0]) || 0, end = parts[1] && Number.parseInt(parts[1]) || len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + var ret = []; + for (var i7 = start; i7 < end; i7 += step) { + var tmp = this._trace(unshift2(i7, expr), val, path2, parent2, parentPropName, callback, true); + tmp.forEach(function(t8) { + ret.push(t8); + }); + } + return ret; +}; +JSONPath2.prototype._eval = function(code, _v, _vname, path2, parent2, parentPropName) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent2; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + var containsPath = code.includes("@path"); + if (containsPath) { + this.currSandbox._$_path = JSONPath2.toPathString(path2.concat([_vname])); + } + var scriptCacheKey = "script:" + code; + if (!JSONPath2.cache[scriptCacheKey]) { + var script = code.replace(/@parentProperty/g, "_$_parentProperty").replace(/@parent/g, "_$_parent").replace(/@property/g, "_$_property").replace(/@root/g, "_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, "_$_v$1"); + if (containsPath) { + script = script.replace(/@path/g, "_$_path"); + } + JSONPath2.cache[scriptCacheKey] = new this.vm.Script(script); + } + try { + return JSONPath2.cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e10) { + throw new Error("jsonPath: " + e10.message + ": " + code); + } +}; +JSONPath2.cache = {}; +JSONPath2.toPathString = function(pathArr) { + var x7 = pathArr, n7 = x7.length; + var p7 = "$"; + for (var i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x7[i7])) { + p7 += /^[\*0-9]+$/.test(x7[i7]) ? "[" + x7[i7] + "]" : "['" + x7[i7] + "']"; + } + } + return p7; +}; +JSONPath2.toPointer = function(pointer) { + var x7 = pointer, n7 = x7.length; + var p7 = ""; + for (var i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x7[i7])) { + p7 += "/" + x7[i7].toString().replace(/~/g, "~0").replace(/\//g, "~1"); + } + } + return p7; +}; +JSONPath2.toPathArray = function(expr) { + var cache = JSONPath2.cache; + if (cache[expr]) { + return cache[expr].concat(); + } + var subx = []; + var normalized = expr.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g, function($0, $1) { + return "[#" + (subx.push($1) - 1) + "]"; + }).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g, function($0, prop) { + return "['" + prop.replace(/\./g, "%@%").replace(/~/g, "%%@@%%") + "']"; + }).replace(/~/g, ";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g, ";").replace(/%@%/g, ".").replace(/%%@@%%/g, "~").replace(/(?:;)?(\^+)(?:;)?/g, function($0, ups) { + return ";" + ups.split("").join(";") + ";"; + }).replace(/;;;|;;/g, ";..;").replace(/;$|'?\]|'$/g, ""); + var exprList = normalized.split(";").map(function(exp) { + var match = exp.match(/#([0-9]+)/); + return !match || !match[1] ? exp : subx[match[1]]; + }); + cache[expr] = exprList; + return cache[expr].concat(); +}; +var moveToAnotherArray2 = function moveToAnotherArray3(source, target, conditionCb) { + var il = source.length; + for (var i7 = 0; i7 < il; i7++) { + var item = source[i7]; + if (conditionCb(item)) { + target.push(source.splice(i7--, 1)[0]); + } + } +}; +var Script3 = /* @__PURE__ */ function() { + function Script7(expr) { + _classCallCheck(this, Script7); + this.code = expr; + } + _createClass(Script7, [{ + key: "runInNewContext", + value: function runInNewContext2(context2) { + var expr = this.code; + var keys2 = Object.keys(context2); + var funcs = []; + moveToAnotherArray2(keys2, funcs, function(key) { + return typeof context2[key] === "function"; + }); + var values2 = keys2.map(function(vr, i7) { + return context2[vr]; + }); + var funcString = funcs.reduce(function(s7, func) { + var fString = context2[func].toString(); + if (!/function/.test(fString)) { + fString = "function " + fString; + } + return "var " + func + "=" + fString + ";" + s7; + }, ""); + expr = funcString + expr; + if (!/(["'])use strict\1/.test(expr) && !keys2.includes("arguments")) { + expr = "var arguments = undefined;" + expr; + } + expr = expr.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, ""); + var lastStatementEnd = expr.lastIndexOf(";"); + var code = lastStatementEnd > -1 ? expr.slice(0, lastStatementEnd + 1) + " return " + expr.slice(lastStatementEnd + 1) : " return " + expr; + return _construct(Function, keys2.concat([code])).apply(void 0, _toConsumableArray(values2)); + } + }]); + return Script7; +}(); +JSONPath2.prototype.vm = { + Script: Script3 +}; + +// node_modules/parserapiv1/esm/custom-operations/apply-traits.js +var v2TraitPaths2 = [ + // operations + "$.channels.*.[publish,subscribe]", + "$.components.channels.*.[publish,subscribe]", + // messages + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" +]; +function applyTraitsV22(asyncapi) { + applyAllTraits(asyncapi, v2TraitPaths2); +} +function applyAllTraits(asyncapi, paths) { + const visited = /* @__PURE__ */ new Set(); + paths.forEach((path2) => { + JSONPath2({ + path: path2, + json: asyncapi, + resultType: "value", + callback(value2) { + if (visited.has(value2)) { + return; + } + visited.add(value2); + applyTraits(value2); + } + }); + }); +} +function applyTraits(value2) { + if (Array.isArray(value2.traits)) { + for (const trait of value2.traits) { + for (const key in trait) { + value2[String(key)] = mergePatch2(value2[String(key)], trait[String(key)]); + } + } + } +} + +// node_modules/parserapiv1/esm/custom-operations/resolve-circular-refs.js +init_dirname(); +init_buffer2(); +init_process2(); +function resolveCircularRefs2(document2, inventory) { + const documentJson = document2.json(); + const ctx = { document: documentJson, hasCircular: false, inventory, visited: /* @__PURE__ */ new Set() }; + traverse2(documentJson, [], null, "", ctx); + if (ctx.hasCircular) { + setExtension2(xParserCircular2, true, document2); + } +} +function traverse2(data, path2, parent2, property2, ctx) { + if (typeof data !== "object" || !data || ctx.visited.has(data)) { + return; + } + ctx.visited.add(data); + if (Array.isArray(data)) { + data.forEach((item, idx) => traverse2(item, [...path2, idx], data, idx, ctx)); + } + if ("$ref" in data) { + ctx.hasCircular = true; + const resolvedRef = retrieveCircularRef2(data, path2, ctx); + if (resolvedRef) { + parent2[property2] = resolvedRef; + } + } else { + for (const p7 in data) { + traverse2(data[p7], [...path2, p7], data, p7, ctx); + } + } + ctx.visited.delete(data); +} +function retrieveCircularRef2(data, path2, ctx) { + const $refPath = toJSONPathArray2(data.$ref); + const item = ctx.inventory.findAssociatedItemForPath(path2, true); + if (item === null) { + return retrieveDeepData2(ctx.document, $refPath); + } + if (item) { + const subArrayIndex = findSubArrayIndex2(path2, $refPath); + let dataPath; + if (subArrayIndex === -1) { + dataPath = [...path2.slice(0, path2.length - item.path.length), ...$refPath]; + } else { + dataPath = path2.slice(0, subArrayIndex + $refPath.length); + } + return retrieveDeepData2(ctx.document, dataPath); + } +} + +// node_modules/parserapiv1/esm/custom-operations/parse-schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter24 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var customSchemasPathsV22 = [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" +]; +function parseSchemasV22(parser3, detailed) { + return __awaiter24(this, void 0, void 0, function* () { + const defaultSchemaFormat = getDefaultSchemaFormat2(detailed.semver.version); + const parseItems = []; + const visited = /* @__PURE__ */ new Set(); + customSchemasPathsV22.forEach((path2) => { + JSONPath2({ + path: path2, + json: detailed.parsed, + resultType: "all", + callback(result2) { + const value2 = result2.value; + if (visited.has(value2)) { + return; + } + visited.add(value2); + const payload = value2.payload; + if (!payload) { + return; + } + const schemaFormat = getSchemaFormat2(value2.schemaFormat, detailed.semver.version); + parseItems.push({ + input: { + asyncapi: detailed, + data: payload, + meta: { + message: value2 + }, + path: [...splitPath4(result2.path), "payload"], + schemaFormat, + defaultSchemaFormat + }, + value: value2 + }); + } + }); + }); + return Promise.all(parseItems.map((item) => parseSchemaV22(parser3, item))); + }); +} +function parseSchemaV22(parser3, item) { + return __awaiter24(this, void 0, void 0, function* () { + const originalData = item.input.data; + const parsedData = item.value.payload = yield parseSchema2(parser3, item.input); + if (originalData !== parsedData) { + item.value[xParserOriginalPayload2] = originalData; + } + }); +} +function splitPath4(path2) { + return path2.slice(3).slice(0, -2).split("']['"); +} + +// node_modules/parserapiv1/esm/custom-operations/anonymous-naming.js +init_dirname(); +init_buffer2(); +init_process2(); +function anonymousNaming2(document2) { + assignNameToComponentMessages2(document2); + assignNameToAnonymousMessages2(document2); + assignUidToComponentSchemas2(document2); + assignUidToComponentParameterSchemas2(document2); + assignUidToChannelParameterSchemas2(document2); + assignUidToAnonymousSchemas2(document2); +} +function assignNameToComponentMessages2(document2) { + document2.components().messages().forEach((message) => { + if (message.name() === void 0) { + setExtension2(xParserMessageName2, message.id(), message); + } + }); +} +function assignNameToAnonymousMessages2(document2) { + let anonymousMessageCounter = 0; + document2.messages().forEach((message) => { + var _a2; + if (message.name() === void 0 && ((_a2 = message.extensions().get(xParserMessageName2)) === null || _a2 === void 0 ? void 0 : _a2.value()) === void 0) { + setExtension2(xParserMessageName2, message.id() || ``, message); + } + }); +} +function assignUidToComponentParameterSchemas2(document2) { + document2.components().channelParameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension2(xParserSchemaId2, parameter.id(), schema8); + } + }); +} +function assignUidToChannelParameterSchemas2(document2) { + document2.channels().forEach((channel) => { + channel.parameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension2(xParserSchemaId2, parameter.id(), schema8); + } + }); + }); +} +function assignUidToComponentSchemas2(document2) { + document2.components().schemas().forEach((schema8) => { + setExtension2(xParserSchemaId2, schema8.id(), schema8); + }); +} +function assignUidToAnonymousSchemas2(doc) { + let anonymousSchemaCounter = 0; + function callback(schema8) { + if (!schema8.id()) { + setExtension2(xParserSchemaId2, ``, schema8); + } + } + traverseAsyncApiDocument3(doc, callback); +} + +// node_modules/parserapiv1/esm/custom-operations/index.js +var __awaiter25 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function customOperations2(parser3, document2, detailed, inventory, options) { + return __awaiter25(this, void 0, void 0, function* () { + switch (detailed.semver.major) { + case 2: + return operationsV22(parser3, document2, detailed, inventory, options); + } + }); +} +function operationsV22(parser3, document2, detailed, inventory, options) { + return __awaiter25(this, void 0, void 0, function* () { + if (options.applyTraits) { + applyTraitsV22(detailed.parsed); + } + if (options.parseSchemas) { + yield parseSchemasV22(parser3, detailed); + } + if (inventory) { + resolveCircularRefs2(document2, inventory); + } + anonymousNaming2(document2); + }); +} + +// node_modules/parserapiv1/esm/validate.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core41 = __toESM(require_dist11()); +var import_spectral_parsers2 = __toESM(require_dist4()); + +// node_modules/parserapiv1/esm/spectral.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core40 = __toESM(require_dist11()); + +// node_modules/parserapiv1/esm/ruleset/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/ruleset/ruleset.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions11 = __toESM(require_dist14()); + +// node_modules/parserapiv1/esm/ruleset/functions/documentStructure.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs7 = __toESM(require_specs2()); +var import_spectral_core23 = __toESM(require_dist11()); +var import_spectral_functions9 = __toESM(require_dist14()); + +// node_modules/parserapiv1/esm/ruleset/formats.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs6 = __toESM(require_specs2()); +var Formats2 = class _Formats extends Map { + filterByMajorVersions(majorsToInclude) { + return new _Formats([...this.entries()].filter((element) => { + return majorsToInclude.includes(element[0].split(".")[0]); + })); + } + excludeByVersions(versionsToExclude) { + return new _Formats([...this.entries()].filter((element) => { + return !versionsToExclude.includes(element[0]); + })); + } + find(version5) { + return this.get(formatVersion2(version5)); + } + formats() { + return [...this.values()]; + } +}; +var AsyncAPIFormats2 = new Formats2(Object.entries(import_specs6.schemas).reverse().map(([version5]) => [version5, createFormat2(version5)])); +function isAsyncAPIVersion2(versionToMatch, document2) { + const asyncAPIDoc = document2; + if (!asyncAPIDoc) + return false; + const documentVersion = String(asyncAPIDoc.asyncapi); + return isObject6(document2) && "asyncapi" in document2 && assertValidAsyncAPIVersion2(documentVersion) && versionToMatch === formatVersion2(documentVersion); +} +function assertValidAsyncAPIVersion2(documentVersion) { + const semver = getSemver2(documentVersion); + const regexp = new RegExp(`^(${semver.major})\\.(${semver.minor})\\.(0|[1-9][0-9]*)$`); + return regexp.test(documentVersion); +} +function createFormat2(version5) { + const format5 = (document2) => isAsyncAPIVersion2(version5, document2); + const semver = getSemver2(version5); + format5.displayName = `AsyncAPI ${semver.major}.${semver.minor}.x`; + return format5; +} +var formatVersion2 = function(version5) { + const versionSemver = getSemver2(version5); + return `${versionSemver.major}.${versionSemver.minor}.0`; +}; + +// node_modules/parserapiv1/esm/ruleset/functions/documentStructure.js +function shouldIgnoreError2(error2) { + return ( + // oneOf is a fairly error as we have 2 options to choose from for most of the time. + error2.keyword === "oneOf" || // the required $ref is entirely useless, since aas-schema rules operate on resolved content, so there won't be any $refs in the document + error2.keyword === "required" && error2.params.missingProperty === "$ref" + ); +} +function prepareResults2(errors) { + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (error2.keyword === "additionalProperties") { + error2.instancePath = `${error2.instancePath}/${String(error2.params["additionalProperty"])}`; + } else if (error2.keyword === "required" && error2.params.missingProperty === "$ref") { + errors.splice(i7, 1); + i7--; + } + } + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (i7 + 1 < errors.length && errors[i7 + 1].instancePath === error2.instancePath) { + errors.splice(i7 + 1, 1); + i7--; + } else if (i7 > 0 && shouldIgnoreError2(error2) && errors[i7 - 1].instancePath.startsWith(error2.instancePath)) { + errors.splice(i7, 1); + i7--; + } + } +} +function getCopyOfSchema2(version5) { + return JSON.parse(JSON.stringify(import_specs7.default.schemas[version5])); +} +var serializedSchemas2 = /* @__PURE__ */ new Map(); +function getSerializedSchema2(version5) { + const schema8 = serializedSchemas2.get(version5); + if (schema8) { + return schema8; + } + const copied = getCopyOfSchema2(version5); + delete copied.definitions["http://json-schema.org/draft-07/schema"]; + delete copied.definitions["http://json-schema.org/draft-04/schema"]; + serializedSchemas2.set(version5, copied); + return copied; +} +var refErrorMessage2 = 'Property "$ref" is not expected to be here'; +function filterRefErrors2(errors, resolved) { + if (resolved) { + return errors.filter((err) => err.message !== refErrorMessage2); + } + return errors.filter((err) => err.message === refErrorMessage2).map((err) => { + err.message = "Referencing in this place is not allowed"; + return err; + }); +} +function getSchema2(docFormats) { + for (const [version5, format5] of AsyncAPIFormats2) { + if (docFormats.has(format5)) { + return getSerializedSchema2(version5); + } + } +} +var documentStructure2 = (0, import_spectral_core23.createRulesetFunction)({ + input: null, + options: { + type: "object", + properties: { + resolved: { + type: "boolean" + } + }, + required: ["resolved"] + } +}, (targetVal, options, context2) => { + var _a2; + const formats = (_a2 = context2.document) === null || _a2 === void 0 ? void 0 : _a2.formats; + if (!formats) { + return; + } + const schema8 = getSchema2(formats); + if (!schema8) { + return; + } + const errors = (0, import_spectral_functions9.schema)(targetVal, { allErrors: true, schema: schema8, prepareResults: options.resolved ? prepareResults2 : void 0 }, context2); + if (!Array.isArray(errors)) { + return; + } + return filterRefErrors2(errors, options.resolved); +}); + +// node_modules/parserapiv1/esm/ruleset/functions/internal.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core24 = __toESM(require_dist11()); +var internal2 = (0, import_spectral_core24.createRulesetFunction)({ + input: null, + options: null +}, (_6, __, { document: document2, documentInventory }) => { + document2.__documentInventory = documentInventory; +}); + +// node_modules/parserapiv1/esm/ruleset/functions/isAsyncAPIDocument.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core25 = __toESM(require_dist11()); +var isAsyncAPIDocument4 = (0, import_spectral_core25.createRulesetFunction)({ + input: null, + options: null +}, (targetVal) => { + if (!isObject6(targetVal) || typeof targetVal.asyncapi !== "string") { + return [ + { + message: 'This is not an AsyncAPI document. The "asyncapi" field as string is missing.', + path: [] + } + ]; + } + if (!specVersions2.includes(targetVal.asyncapi)) { + return [ + { + message: `Version "${targetVal.asyncapi}" is not supported. Please use "${lastVersion2}" (latest) version of the specification.`, + path: [] + } + ]; + } +}); + +// node_modules/parserapiv1/esm/ruleset/functions/unusedComponent.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions10 = __toESM(require_dist14()); +var import_spectral_core26 = __toESM(require_dist11()); +var unusedComponent2 = (0, import_spectral_core26.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null +}, (targetVal, _6, context2) => { + const components = targetVal.components; + const results = []; + Object.keys(components).forEach((componentType) => { + if (componentType === "securitySchemes") { + return; + } + const value2 = components[componentType]; + if (!isObject6(value2)) { + return; + } + const resultsForType = (0, import_spectral_functions10.unreferencedReusableObject)(value2, { reusableObjectsLocation: `#/components/${componentType}` }, context2); + if (resultsForType && Array.isArray(resultsForType)) { + results.push(...resultsForType); + } + }); + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/ruleset.js +var coreRuleset2 = { + description: "Core AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-is-asyncapi": { + description: "The input must be a document with a supported version of AsyncAPI.", + formats: [() => true], + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: isAsyncAPIDocument4 + } + }, + "asyncapi-latest-version": { + description: "Checking if the AsyncAPI document is using the latest version.", + message: `The latest version of AsyncAPi is not used. It is recommended update to the "${lastVersion2}" version.`, + recommended: true, + severity: "info", + given: "$.asyncapi", + then: { + function: import_spectral_functions11.schema, + functionOptions: { + schema: { + const: lastVersion2 + } + } + } + }, + "asyncapi-document-resolved": { + description: "Checking if the AsyncAPI document has valid resolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: documentStructure2, + functionOptions: { + resolved: true + } + } + }, + "asyncapi-document-unresolved": { + description: "Checking if the AsyncAPI document has valid unresolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + resolved: false, + given: "$", + then: { + function: documentStructure2, + functionOptions: { + resolved: false + } + } + }, + "asyncapi-internal": { + description: "That rule is internal to extend Spectral functionality for Parser purposes.", + recommended: true, + given: "$", + then: { + function: internal2 + } + } + } +}; +var recommendedRuleset2 = { + description: "Recommended AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-id": { + description: 'AsyncAPI document should have "id" field.', + recommended: true, + given: "$", + then: { + field: "id", + function: import_spectral_functions11.truthy + } + }, + "asyncapi-defaultContentType": { + description: 'AsyncAPI document should have "defaultContentType" field.', + recommended: true, + given: "$", + then: { + field: "defaultContentType", + function: import_spectral_functions11.truthy + } + }, + /** + * Info Object rules + */ + "asyncapi-info-description": { + description: 'Info "description" should be present and non-empty string.', + recommended: true, + given: "$", + then: { + field: "info.description", + function: import_spectral_functions11.truthy + } + }, + "asyncapi-info-contact": { + description: 'Info object should have "contact" object.', + recommended: true, + given: "$", + then: { + field: "info.contact", + function: import_spectral_functions11.truthy + } + }, + "asyncapi-info-contact-properties": { + description: 'Contact object should have "name", "url" and "email" fields.', + recommended: true, + given: "$.info.contact", + then: [ + { + field: "name", + function: import_spectral_functions11.truthy + }, + { + field: "url", + function: import_spectral_functions11.truthy + }, + { + field: "email", + function: import_spectral_functions11.truthy + } + ] + }, + "asyncapi-info-license": { + description: 'Info object should have "license" object.', + recommended: true, + given: "$", + then: { + field: "info.license", + function: import_spectral_functions11.truthy + } + }, + "asyncapi-info-license-url": { + description: 'License object should have "url" field.', + recommended: false, + given: "$", + then: { + field: "info.license.url", + function: import_spectral_functions11.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi-servers": { + description: 'AsyncAPI document should have non-empty "servers" object.', + recommended: true, + given: "$", + then: { + field: "servers", + function: import_spectral_functions11.schema, + functionOptions: { + schema: { + type: "object", + minProperties: 1 + }, + allErrors: true + } + } + }, + /** + * Component Object rules + */ + "asyncapi-unused-component": { + description: "Potentially unused component has been detected in AsyncAPI document.", + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).formats(), + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedComponent2 + } + } + } +}; + +// node_modules/parserapiv1/esm/ruleset/v2/ruleset.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions15 = __toESM(require_dist14()); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/channelParameters.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core27 = __toESM(require_dist11()); + +// node_modules/parserapiv1/esm/ruleset/utils/getMissingProps.js +init_dirname(); +init_buffer2(); +init_process2(); +function getMissingProps2(arr = [], obj = {}) { + if (!Object.keys(obj).length) + return arr; + return arr.filter((val) => { + return !Object.prototype.hasOwnProperty.call(obj, val); + }); +} + +// node_modules/parserapiv1/esm/ruleset/utils/getRedundantProps.js +init_dirname(); +init_buffer2(); +init_process2(); +function getRedundantProps2(arr = [], obj = {}) { + if (!arr.length) + return Object.keys(obj); + return Object.keys(obj).filter((val) => { + return !arr.includes(val); + }); +} + +// node_modules/parserapiv1/esm/ruleset/utils/mergeTraits.js +init_dirname(); +init_buffer2(); +init_process2(); +init_index_es2(); +function mergeTraits2(data) { + if (Array.isArray(data.traits)) { + data = Object.assign({}, data); + for (const trait of data.traits) { + for (const key in trait) { + data[key] = merge5(data[key], trait[key]); + } + } + } + return data; +} +function merge5(origin, patch) { + if (!w(patch)) { + return patch; + } + const result2 = !w(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = merge5(result2[key], patchVal); + } + }); + return result2; +} + +// node_modules/parserapiv1/esm/ruleset/utils/parseUrlVariables.js +init_dirname(); +init_buffer2(); +init_process2(); +function parseUrlVariables2(str2) { + if (typeof str2 !== "string") + return []; + const variables = str2.match(/{(.+?)}/g); + if (!variables || variables.length === 0) + return []; + return variables.map((v8) => v8.slice(1, -1)); +} + +// node_modules/parserapiv1/esm/ruleset/v2/functions/channelParameters.js +var channelParameters2 = (0, import_spectral_core27.createRulesetFunction)({ + input: { + type: "object", + properties: { + parameters: { + type: "object" + } + }, + required: ["parameters"] + }, + options: null +}, (targetVal, _6, ctx) => { + const path2 = ctx.path[ctx.path.length - 1]; + const results = []; + const parameters = parseUrlVariables2(path2); + if (parameters.length === 0) + return; + const missingParameters = getMissingProps2(parameters, targetVal.parameters); + if (missingParameters.length) { + results.push({ + message: `Not all channel's parameters are described with "parameters" object. Missed: ${missingParameters.join(", ")}.`, + path: [...ctx.path, "parameters"] + }); + } + const redundantParameters = getRedundantProps2(parameters, targetVal.parameters); + if (redundantParameters.length) { + redundantParameters.forEach((param) => { + results.push({ + message: `Channel's "parameters" object has redundant defined "${param}" parameter.`, + path: [...ctx.path, "parameters", param] + }); + }); + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/channelServers.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core28 = __toESM(require_dist11()); +var channelServers2 = (0, import_spectral_core28.createRulesetFunction)({ + input: { + type: "object", + properties: { + servers: { + type: "object" + }, + channels: { + type: "object", + additionalProperties: { + type: "object", + properties: { + servers: { + type: "array", + items: { + type: "string" + } + } + } + } + } + } + }, + options: null +}, (targetVal) => { + var _a2, _b; + const results = []; + if (!targetVal.channels) + return results; + const serverNames = Object.keys((_a2 = targetVal.servers) !== null && _a2 !== void 0 ? _a2 : {}); + Object.entries((_b = targetVal.channels) !== null && _b !== void 0 ? _b : {}).forEach(([channelAddress, channel]) => { + if (!channel.servers) + return; + channel.servers.forEach((serverName, index4) => { + if (!serverNames.includes(serverName)) { + results.push({ + message: 'Channel contains server that are not defined on the "servers" object.', + path: ["channels", channelAddress, "servers", index4] + }); + } + }); + }); + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/checkId.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core29 = __toESM(require_dist11()); +var import_spectral_functions12 = __toESM(require_dist14()); +var checkId2 = (0, import_spectral_core29.createRulesetFunction)({ + input: { + type: "object", + properties: { + traits: { + type: "array", + items: { + type: "object" + } + } + } + }, + options: { + type: "object", + properties: { + idField: { + type: "string", + enum: ["operationId", "messageId"] + } + } + } +}, (targetVal, options, ctx) => { + const mergedValue = mergeTraits2(targetVal); + return (0, import_spectral_functions12.truthy)(mergedValue[options.idField], null, ctx); +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/messageExamples.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core30 = __toESM(require_dist11()); +var import_spectral_functions13 = __toESM(require_dist14()); +function serializeSchema2(schema8, type3) { + if (!schema8 && typeof schema8 !== "boolean") { + if (type3 === "headers") { + schema8 = { type: "object" }; + } else { + schema8 = {}; + } + } else if (typeof schema8 === "boolean") { + if (schema8 === true) { + schema8 = {}; + } else { + schema8 = { not: {} }; + } + } + return schema8; +} +function getMessageExamples2(message) { + var _a2; + if (!Array.isArray(message.examples)) { + return []; + } + return (_a2 = message.examples.map((example, index4) => { + return { + path: ["examples", index4], + value: example + }; + })) !== null && _a2 !== void 0 ? _a2 : []; +} +function validate4(value2, path2, type3, schema8, ctx) { + return (0, import_spectral_functions13.schema)(value2, { + allErrors: true, + schema: schema8 + }, Object.assign(Object.assign({}, ctx), { path: [...ctx.path, ...path2, type3] })); +} +var messageExamples2 = (0, import_spectral_core30.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null +}, (targetVal, _6, ctx) => { + if (!targetVal.examples) + return; + const results = []; + const payloadSchema = serializeSchema2(targetVal.payload, "payload"); + const headersSchema = serializeSchema2(targetVal.headers, "headers"); + for (const example of getMessageExamples2(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0) { + const errors = validate4(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + if (value2.headers !== void 0) { + const errors = validate4(value2.headers, path2, "headers", headersSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/messageExamples-spectral-rule-v2.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core31 = __toESM(require_dist11()); +var __awaiter26 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function asyncApi2MessageExamplesParserRule2(parser3) { + return { + description: "Examples of message object should validate against a payload with an explicit schemaFormat.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message[?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages[?(!@null && @.schemaFormat !== void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat !== void 0)]" + ], + then: { + function: rulesetFunction3(parser3) + } + }; +} +function rulesetFunction3(parser3) { + return (0, import_spectral_core31.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null + }, (targetVal, _6, ctx) => __awaiter26(this, void 0, void 0, function* () { + if (!targetVal.examples) + return; + if (!targetVal.payload) + return; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat2(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat2(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI2(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + rootPath: ctx.path, + schemaFormat, + defaultSchemaFormat + }; + const results = []; + const payloadSchemaResults = yield parseExampleSchema2(parser3, targetVal.payload, input); + const payloadSchema = payloadSchemaResults.schema; + results.push(...payloadSchemaResults.errors); + for (const example of getMessageExamples2(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0 && payloadSchema !== void 0) { + const errors = validate4(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; + })); +} +function parseExampleSchema2(parser3, schema8, input) { + return __awaiter26(this, void 0, void 0, function* () { + const path2 = [...input.rootPath, "payload"]; + if (schema8 === void 0) { + return { path: path2, schema: void 0, errors: [] }; + } + try { + const parseSchemaInput = { + asyncapi: input.asyncapi, + data: schema8, + meta: {}, + path: path2, + schemaFormat: input.schemaFormat, + defaultSchemaFormat: input.defaultSchemaFormat + }; + const parsedSchema = yield parseSchema2(parser3, parseSchemaInput); + return { path: path2, schema: parsedSchema, errors: [] }; + } catch (err) { + const error2 = { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + }; + return { path: path2, schema: void 0, errors: [error2] }; + } + }); +} + +// node_modules/parserapiv1/esm/ruleset/v2/functions/messageIdUniqueness.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core32 = __toESM(require_dist11()); + +// node_modules/parserapiv1/esm/ruleset/v2/utils/getAllMessages.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv1/esm/ruleset/v2/utils/getAllOperations.js +init_dirname(); +init_buffer2(); +init_process2(); +function* getAllOperations2(asyncapi) { + const channels = asyncapi === null || asyncapi === void 0 ? void 0 : asyncapi.channels; + if (!isObject6(channels)) { + return {}; + } + for (const [channelAddress, channel] of Object.entries(channels)) { + if (!isObject6(channel)) { + continue; + } + if (isObject6(channel.subscribe)) { + yield { + path: ["channels", channelAddress, "subscribe"], + kind: "subscribe", + operation: channel.subscribe + }; + } + if (isObject6(channel.publish)) { + yield { + path: ["channels", channelAddress, "publish"], + kind: "publish", + operation: channel.publish + }; + } + } +} + +// node_modules/parserapiv1/esm/ruleset/v2/utils/getAllMessages.js +function* getAllMessages2(asyncapi) { + for (const { path: path2, operation } of getAllOperations2(asyncapi)) { + if (!isObject6(operation)) { + continue; + } + const maybeMessage = operation.message; + if (!isObject6(maybeMessage)) { + continue; + } + const oneOf = maybeMessage.oneOf; + if (Array.isArray(oneOf)) { + for (const [index4, message] of oneOf.entries()) { + if (isObject6(message)) { + yield { + path: [...path2, "message", "oneOf", index4], + message + }; + } + } + } else { + yield { + path: [...path2, "message"], + message: maybeMessage + }; + } + } +} + +// node_modules/parserapiv1/esm/ruleset/v2/functions/messageIdUniqueness.js +function retrieveMessageId2(message) { + if (Array.isArray(message.traits)) { + for (let i7 = message.traits.length - 1; i7 >= 0; i7--) { + const trait = message.traits[i7]; + if (isObject6(trait) && typeof trait.messageId === "string") { + return { + messageId: trait.messageId, + path: ["traits", i7, "messageId"] + }; + } + } + } + if (typeof message.messageId === "string") { + return { + messageId: message.messageId, + path: ["messageId"] + }; + } + return void 0; +} +var messageIdUniqueness2 = (0, import_spectral_core32.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + }, + publish: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + } + } + } + } + }, + options: null +}, (targetVal) => { + const results = []; + const messages = getAllMessages2(targetVal); + const seenIds = []; + for (const { path: path2, message } of messages) { + const maybeMessageId = retrieveMessageId2(message); + if (maybeMessageId === void 0) { + continue; + } + if (seenIds.includes(maybeMessageId.messageId)) { + results.push({ + message: '"messageId" must be unique across all the messages.', + path: [...path2, ...maybeMessageId.path] + }); + } else { + seenIds.push(maybeMessageId.messageId); + } + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/operationIdUniqueness.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core33 = __toESM(require_dist11()); +function retrieveOperationId2(operation) { + if (Array.isArray(operation.traits)) { + for (let i7 = operation.traits.length - 1; i7 >= 0; i7--) { + const trait = operation.traits[i7]; + if (isObject6(trait) && typeof trait.operationId === "string") { + return { + operationId: trait.operationId, + path: ["traits", i7, "operationId"] + }; + } + } + } + if (typeof operation.operationId === "string") { + return { + operationId: operation.operationId, + path: ["operationId"] + }; + } + return void 0; +} +var operationIdUniqueness2 = (0, import_spectral_core33.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object" + }, + publish: { + type: "object" + } + } + } + } + }, + options: null +}, (targetVal) => { + const results = []; + const operations = getAllOperations2(targetVal); + const seenIds = []; + for (const { path: path2, operation } of operations) { + const maybeOperationId = retrieveOperationId2(operation); + if (maybeOperationId === void 0) { + continue; + } + if (seenIds.includes(maybeOperationId.operationId)) { + results.push({ + message: '"operationId" must be unique across all the operations.', + path: [...path2, ...maybeOperationId.path] + }); + } else { + seenIds.push(maybeOperationId.operationId); + } + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/schemaValidation.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core34 = __toESM(require_dist11()); +var import_spectral_functions14 = __toESM(require_dist14()); +function getRelevantItems2(target, type3) { + if (type3 === "default") { + return [{ path: ["default"], value: target.default }]; + } + if (!Array.isArray(target.examples)) { + return []; + } + return Array.from(target.examples.entries()).map(([key, value2]) => ({ + path: ["examples", key], + value: value2 + })); +} +var schemaValidation2 = (0, import_spectral_core34.createRulesetFunction)({ + input: { + type: "object", + properties: { + default: {}, + examples: { + type: "array" + } + }, + errorMessage: '#{{print("property")}must be an object containing "default" or an "examples" array' + }, + errorOnInvalidInput: true, + options: { + type: "object", + properties: { + type: { + enum: ["default", "examples"] + } + }, + additionalProperties: false, + required: ["type"] + } +}, (targetVal, opts, context2) => { + const schemaObject = targetVal; + const results = []; + for (const relevantItem of getRelevantItems2(targetVal, opts.type)) { + const result2 = (0, import_spectral_functions14.schema)(relevantItem.value, { + schema: schemaObject, + allErrors: true + }, Object.assign(Object.assign({}, context2), { path: [...context2.path, ...relevantItem.path] })); + if (Array.isArray(result2)) { + results.push(...result2); + } + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/security.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core35 = __toESM(require_dist11()); +var oAuth2Keys2 = ["implicit", "password", "clientCredentials", "authorizationCode"]; +function getAllScopes2(oauth2) { + const scopes = []; + oAuth2Keys2.forEach((key) => { + const flow2 = oauth2[key]; + if (isObject6(flow2)) { + scopes.push(...Object.keys(flow2.scopes)); + } + }); + return Array.from(new Set(scopes)); +} +var security2 = (0, import_spectral_core35.createRulesetFunction)({ + input: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + } + } + }, + options: { + type: "object", + properties: { + objectType: { + type: "string", + enum: ["Server", "Operation"] + } + } + } +}, (targetVal = {}, { objectType: objectType2 }, ctx) => { + var _a2, _b; + const results = []; + const spec = ctx.document.data; + const securitySchemes = (_b = (_a2 = spec === null || spec === void 0 ? void 0 : spec.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) !== null && _b !== void 0 ? _b : {}; + const securitySchemesKeys = Object.keys(securitySchemes); + Object.keys(targetVal).forEach((securityKey) => { + var _a3; + if (!securitySchemesKeys.includes(securityKey)) { + results.push({ + message: `${objectType2} must not reference an undefined security scheme.`, + path: [...ctx.path, securityKey] + }); + } + const securityScheme = securitySchemes[securityKey]; + if ((securityScheme === null || securityScheme === void 0 ? void 0 : securityScheme.type) === "oauth2") { + const availableScopes = getAllScopes2((_a3 = securityScheme.flows) !== null && _a3 !== void 0 ? _a3 : {}); + targetVal[securityKey].forEach((securityScope, index4) => { + if (!availableScopes.includes(securityScope)) { + results.push({ + message: `Non-existing security scope for the specified security scheme. Available: [${availableScopes.join(", ")}]`, + path: [...ctx.path, securityKey, index4] + }); + } + }); + } + }); + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/serverVariables.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core36 = __toESM(require_dist11()); +var serverVariables2 = (0, import_spectral_core36.createRulesetFunction)({ + input: { + type: "object", + properties: { + url: { + type: "string" + }, + variables: { + type: "object" + } + }, + required: ["url", "variables"] + }, + options: null +}, (targetVal, _6, ctx) => { + const results = []; + const variables = parseUrlVariables2(targetVal.url); + if (variables.length === 0) + return results; + const missingVariables = getMissingProps2(variables, targetVal.variables); + if (missingVariables.length) { + results.push({ + message: `Not all server's variables are described with "variables" object. Missed: ${missingVariables.join(", ")}.`, + path: [...ctx.path, "variables"] + }); + } + const redundantVariables = getRedundantProps2(variables, targetVal.variables); + if (redundantVariables.length) { + redundantVariables.forEach((variable) => { + results.push({ + message: `Server's "variables" object has redundant defined "${variable}" url variable.`, + path: [...ctx.path, "variables", variable] + }); + }); + } + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/v2/functions/unusedSecuritySchemes.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core37 = __toESM(require_dist11()); +var unusedSecuritySchemes2 = (0, import_spectral_core37.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null +}, (targetVal) => { + var _a2; + const securitySchemes = (_a2 = targetVal.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes; + if (!isObject6(securitySchemes)) { + return; + } + const usedSecuritySchemes = []; + if (isObject6(targetVal.servers)) { + Object.values(targetVal.servers).forEach((server) => { + if (Array.isArray(server.security)) { + server.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + }); + } + const operations = getAllOperations2(targetVal); + for (const { operation } of operations) { + if (Array.isArray(operation.security)) { + operation.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + } + const usedSecuritySchemesSet = new Set(usedSecuritySchemes); + const securitySchemesKinds = Object.keys(securitySchemes); + const results = []; + securitySchemesKinds.forEach((securitySchemeKind) => { + if (!usedSecuritySchemesSet.has(securitySchemeKind)) { + results.push({ + message: "Potentially unused security scheme has been detected in AsyncAPI document.", + path: ["components", "securitySchemes", securitySchemeKind] + }); + } + }); + return results; +}); + +// node_modules/parserapiv1/esm/ruleset/functions/uniquenessTags.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core38 = __toESM(require_dist11()); +function getDuplicateTagsIndexes2(tags6) { + return tags6.map((item) => item.name).reduce((acc, item, i7, arr) => { + if (arr.indexOf(item) !== i7) { + acc.push(i7); + } + return acc; + }, []); +} +var uniquenessTags2 = (0, import_spectral_core38.createRulesetFunction)({ + input: { + type: "array", + items: { + type: "object", + properties: { + name: { + type: "string" + } + }, + required: ["name"] + } + }, + options: null +}, (targetVal, _6, ctx) => { + const duplicatedTags = getDuplicateTagsIndexes2(targetVal); + if (duplicatedTags.length === 0) { + return []; + } + const results = []; + for (const duplicatedIndex of duplicatedTags) { + const duplicatedTag = targetVal[duplicatedIndex].name; + results.push({ + message: `"tags" object contains duplicate tag name "${duplicatedTag}".`, + path: [...ctx.path, duplicatedIndex, "name"] + }); + } + return results; +}); + +// node_modules/parserapiv1/esm/schema-parser/spectral-rule-v2.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core39 = __toESM(require_dist11()); +var __awaiter27 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function asyncApi2SchemaParserRule2(parser3) { + return { + description: "Custom schema must be correctly formatted from the point of view of the used format.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" + ], + then: { + function: rulesetFunction4(parser3) + } + }; +} +function rulesetFunction4(parser3) { + return (0, import_spectral_core39.createRulesetFunction)({ + input: { + type: "object", + properties: { + schemaFormat: { + type: "string" + }, + payload: true + // any value + } + }, + options: null + }, (targetVal = {}, _6, ctx) => __awaiter27(this, void 0, void 0, function* () { + if (!targetVal.payload) { + return []; + } + const path2 = [...ctx.path, "payload"]; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat2(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat2(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI2(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + data: targetVal.payload, + meta: {}, + path: path2, + schemaFormat, + defaultSchemaFormat + }; + try { + return yield validateSchema2(parser3, input); + } catch (err) { + return [ + { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + } + ]; + } + })); +} + +// node_modules/parserapiv1/esm/ruleset/v2/ruleset.js +var v2CoreRuleset2 = { + description: "Core AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Server Object rules + */ + "asyncapi2-server-security": { + description: "Server have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.servers.*.security.*", + then: { + function: security2, + functionOptions: { + objectType: "Server" + } + } + }, + "asyncapi2-server-variables": { + description: "Server variables must be defined and there must be no redundant variables.", + message: "{{error}}", + severity: "error", + recommended: true, + given: ["$.servers.*", "$.components.servers.*"], + then: { + function: serverVariables2 + } + }, + "asyncapi2-channel-no-query-nor-fragment": { + description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', + severity: "error", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions15.pattern, + functionOptions: { + notMatch: "[\\?#]" + } + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-parameters": { + description: "Channel parameters must be defined and there must be no redundant parameters.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels.*", + then: { + function: channelParameters2 + } + }, + "asyncapi2-channel-servers": { + description: 'Channel servers must be defined in the "servers" object.', + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: channelServers2 + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId-uniqueness": { + description: '"operationId" must be unique across all the operations.', + severity: "error", + recommended: true, + given: "$", + then: { + function: operationIdUniqueness2 + } + }, + "asyncapi2-operation-security": { + description: "Operation have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels[*][publish,subscribe].security.*", + then: { + function: security2, + functionOptions: { + objectType: "Operation" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-examples": { + description: 'Examples of message object should validate againt the "payload" and "headers" schemas.', + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages[?(!@null && @.schemaFormat === void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat === void 0)]" + ], + then: { + function: messageExamples2 + } + }, + "asyncapi2-message-messageId-uniqueness": { + description: '"messageId" must be unique across all the messages.', + severity: "error", + recommended: true, + given: "$", + then: { + function: messageIdUniqueness2 + } + }, + /** + * Misc rules + */ + "asyncapi2-tags-uniqueness": { + description: "Each tag must have a unique name.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // root + "$.tags", + // operations + "$.channels.*.[publish,subscribe].tags", + "$.components.channels.*.[publish,subscribe].tags", + // operation traits + "$.channels.*.[publish,subscribe].traits.*.tags", + "$.components.channels.*.[publish,subscribe].traits.*.tags", + "$.components.operationTraits.*.tags", + // messages + "$.channels.*.[publish,subscribe].message.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.channels.*.[publish,subscribe].message.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.messages.*.tags", + // message traits + "$.channels.*.[publish,subscribe].message.traits.*.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.messages.*.traits.*.tags", + "$.components.messageTraits.*.tags" + ], + then: { + function: uniquenessTags2 + } + } + } +}; +var v2SchemasRuleset2 = (parser3) => { + return { + description: "Schemas AsyncAPI 2.x.x ruleset.", + rules: { + "asyncapi2-schemas": asyncApi2SchemaParserRule2(parser3), + "asyncapi2-schema-default": { + description: "Default must be valid against its defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.channels.*.parameters.*.schema.default^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.components.channels.*.parameters.*.schema.default^", + "$.components.schemas.*.default^", + "$.components.parameters.*.schema.default^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.default^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.default^" + ], + then: { + function: schemaValidation2, + functionOptions: { + type: "default" + } + } + }, + "asyncapi2-schema-examples": { + description: "Examples must be valid against their defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.channels.*.parameters.*.schema.examples^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.components.channels.*.parameters.*.schema.examples^", + "$.components.schemas.*.examples^", + "$.components.parameters.*.schema.examples^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.examples^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.examples^" + ], + then: { + function: schemaValidation2, + functionOptions: { + type: "examples" + } + } + }, + "asyncapi2-message-examples-custom-format": asyncApi2MessageExamplesParserRule2(parser3) + } + }; +}; +var v2RecommendedRuleset2 = { + description: "Recommended AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi2-tags": { + description: 'AsyncAPI object should have non-empty "tags" array.', + recommended: true, + given: "$", + then: { + field: "tags", + function: import_spectral_functions15.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi2-server-no-empty-variable": { + description: "Server URL should not have empty variable substitution pattern.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions15.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-server-no-trailing-slash": { + description: "Server URL should not end with slash.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions15.pattern, + functionOptions: { + notMatch: "/$" + } + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-no-empty-parameter": { + description: "Channel address should not have empty parameter substitution pattern.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions15.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-channel-no-trailing-slash": { + description: "Channel address should not end with slash.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions15.pattern, + functionOptions: { + notMatch: ".+\\/$" + } + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId": { + description: 'Operation should have an "operationId" field defined.', + recommended: true, + given: ["$.channels[*][publish,subscribe]", "$.components.channels[*][publish,subscribe]"], + then: { + function: checkId2, + functionOptions: { + idField: "operationId" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-messageId": { + description: 'Message should have a "messageId" field defined.', + recommended: true, + formats: AsyncAPIFormats2.filterByMajorVersions(["2"]).excludeByVersions(["2.0.0", "2.1.0", "2.2.0", "2.3.0"]).formats(), + given: [ + '$.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.channels.*.[publish,subscribe].message.oneOf.*", + '$.components.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" + ], + then: { + function: checkId2, + functionOptions: { + idField: "messageId" + } + } + }, + /** + * Component Object rules + */ + "asyncapi2-unused-securityScheme": { + description: "Potentially unused security scheme has been detected in AsyncAPI document.", + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedSecuritySchemes2 + } + } + } +}; + +// node_modules/parserapiv1/esm/ruleset/index.js +var __rest11 = function(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +}; +function createRuleset2(parser3, options) { + var _a2; + const _b = options || {}, { core: useCore = true, recommended: useRecommended = true } = _b, rest2 = __rest11(_b, ["core", "recommended"]); + const extendedRuleset = [ + useCore && coreRuleset2, + useRecommended && recommendedRuleset2, + useCore && v2CoreRuleset2, + useCore && v2SchemasRuleset2(parser3), + useRecommended && v2RecommendedRuleset2, + ...((_a2 = options || {}) === null || _a2 === void 0 ? void 0 : _a2.extends) || [] + ].filter(Boolean); + return Object.assign(Object.assign({}, rest2 || {}), { extends: extendedRuleset }); +} + +// node_modules/parserapiv1/esm/resolver.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_ref_resolver2 = __toESM(require_dist7()); +var import_cache2 = __toESM(require_cache()); +var import_json_ref_readers2 = __toESM(require_json_ref_readers()); +var __awaiter28 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function createResolver2(options = {}) { + const availableResolvers = [ + ...createDefaultResolvers2(), + ...options.resolvers || [] + ].map((r8) => Object.assign(Object.assign({}, r8), { order: r8.order || Number.MAX_SAFE_INTEGER, canRead: typeof r8.canRead === "undefined" ? true : r8.canRead })); + const availableSchemas = [...new Set(availableResolvers.map((r8) => r8.schema))]; + const resolvers = availableSchemas.reduce((acc, schema8) => { + acc[schema8] = { resolve: createSchemaResolver2(schema8, availableResolvers) }; + return acc; + }, {}); + const cache = options.cache !== false; + return new import_spectral_ref_resolver2.Resolver({ + uriCache: cache ? void 0 : new import_cache2.Cache({ stdTTL: 1 }), + resolvers + }); +} +function createDefaultResolvers2() { + return [ + { + schema: "file", + read: import_json_ref_readers2.resolveFile + }, + { + schema: "https", + read: import_json_ref_readers2.resolveHttp + }, + { + schema: "http", + read: import_json_ref_readers2.resolveHttp + } + ]; +} +function createSchemaResolver2(schema8, allResolvers) { + const resolvers = allResolvers.filter((r8) => r8.schema === schema8).sort((a7, b8) => { + return a7.order - b8.order; + }); + return (uri, ctx) => __awaiter28(this, void 0, void 0, function* () { + let result2 = void 0; + let lastError; + for (const resolver of resolvers) { + try { + if (!canRead2(resolver, uri, ctx)) + continue; + result2 = yield resolver.read(uri, ctx); + if (typeof result2 === "string") { + break; + } + } catch (e10) { + lastError = e10; + continue; + } + } + if (typeof result2 !== "string") { + throw lastError || new Error(`None of the available resolvers for "${schema8}" can resolve the given reference.`); + } + return result2; + }); +} +function canRead2(resolver, uri, ctx) { + return typeof resolver.canRead === "function" ? resolver.canRead(uri, ctx) : resolver.canRead; +} + +// node_modules/parserapiv1/esm/spectral.js +function createSpectral2(parser3, options = {}) { + var _a2; + const resolverOptions = (_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver; + const spectral = new import_spectral_core40.Spectral({ resolver: createResolver2(resolverOptions) }); + const ruleset = createRuleset2(parser3, options.ruleset); + spectral.setRuleset(ruleset); + return spectral; +} + +// node_modules/parserapiv1/esm/validate.js +var __awaiter29 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultOptions3 = { + allowedSeverity: { + error: false, + warning: true, + info: true, + hint: true + }, + __unstable: {} +}; +function validate5(parser3, parserSpectral, asyncapi, options = {}) { + var _a2; + return __awaiter29(this, void 0, void 0, function* () { + let document2; + try { + const { allowedSeverity } = mergePatch2(defaultOptions3, options); + const stringifiedDocument = normalizeInput2(asyncapi); + document2 = new import_spectral_core41.Document(stringifiedDocument, import_spectral_parsers2.Yaml, options.source); + document2.__parserInput = asyncapi; + const spectral = ((_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver) ? createSpectral2(parser3, options) : parserSpectral; + let { resolved: validated, results } = yield spectral.runWithResolved(document2, {}); + if (!(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.error) && hasErrorDiagnostic2(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.warning) && hasWarningDiagnostic2(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.info) && hasInfoDiagnostic2(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.hint) && hasHintDiagnostic2(results)) { + validated = void 0; + } + return { validated, diagnostics: results, extras: { document: document2 } }; + } catch (err) { + return { validated: void 0, diagnostics: createUncaghtDiagnostic2(err, "Error thrown during AsyncAPI document validation", document2), extras: { document: document2 } }; + } + }); +} + +// node_modules/parserapiv1/esm/parse.js +var __awaiter30 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultOptions4 = { + applyTraits: true, + parseSchemas: true, + validateOptions: {}, + __unstable: {} +}; +function parse8(parser3, spectral, asyncapi, options = {}) { + return __awaiter30(this, void 0, void 0, function* () { + let spectralDocument; + try { + options = mergePatch2(defaultOptions4, options); + const { validated, diagnostics, extras } = yield validate5(parser3, spectral, asyncapi, Object.assign(Object.assign({}, options.validateOptions), { source: options.source, __unstable: options.__unstable })); + if (validated === void 0) { + return { + document: void 0, + diagnostics, + extras + }; + } + spectralDocument = extras.document; + const inventory = spectralDocument.__documentInventory; + const validatedDoc = copy2(validated); + const detailed = createDetailedAsyncAPI2(validatedDoc, asyncapi, options.source); + const document2 = createAsyncAPIDocument2(detailed); + setExtension2(xParserSpecParsed2, true, document2); + setExtension2(xParserApiVersion2, 1, document2); + yield customOperations2(parser3, document2, detailed, inventory, options); + return { + document: document2, + diagnostics, + extras + }; + } catch (err) { + return { document: void 0, diagnostics: createUncaghtDiagnostic2(err, "Error thrown during AsyncAPI document parsing", spectralDocument), extras: void 0 }; + } + }); +} + +// node_modules/parserapiv1/esm/schema-parser/asyncapi-schema-parser.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_ajv2 = __toESM(require_ajv()); +var import_ajv_formats2 = __toESM(require_dist9()); +var import_ajv_errors2 = __toESM(require_dist10()); +var import_specs8 = __toESM(require_specs2()); +var __awaiter31 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function AsyncAPISchemaParser2() { + return { + validate: validate6, + parse: parse9, + getMimeTypes: getMimeTypes2 + }; +} +function validate6(input) { + return __awaiter31(this, void 0, void 0, function* () { + const version5 = input.asyncapi.semver.version; + const validator = getSchemaValidator2(version5); + let result2 = []; + const valid = validator(input.data); + if (!valid && validator.errors) { + result2 = ajvToSpectralResult2(input.path, [...validator.errors]); + } + return result2; + }); +} +function parse9(input) { + return __awaiter31(this, void 0, void 0, function* () { + return input.data; + }); +} +function getMimeTypes2() { + const mimeTypes = [ + "application/schema;version=draft-07", + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ]; + specVersions2.forEach((version5) => { + mimeTypes.push(`application/vnd.aai.asyncapi;version=${version5}`, `application/vnd.aai.asyncapi+json;version=${version5}`, `application/vnd.aai.asyncapi+yaml;version=${version5}`); + }); + return mimeTypes; +} +function ajvToSpectralResult2(path2, errors) { + return errors.map((error2) => { + return { + message: error2.message, + path: [...path2, ...error2.instancePath.replace(/^\//, "").split("/")] + }; + }); +} +function getSchemaValidator2(version5) { + const ajv2 = getAjvInstance2(); + let validator = ajv2.getSchema(version5); + if (!validator) { + const schema8 = preparePayloadSchema2(import_specs8.default.schemas[version5], version5); + ajv2.addSchema(schema8, version5); + validator = ajv2.getSchema(version5); + } + return validator; +} +function preparePayloadSchema2(asyncapiSchema, version5) { + const payloadSchema = `http://asyncapi.com/definitions/${version5}/schema.json`; + const definitions = asyncapiSchema.definitions; + if (definitions === void 0) { + throw new Error("AsyncAPI schema must contain definitions"); + } + delete definitions["http://json-schema.org/draft-07/schema"]; + delete definitions["http://json-schema.org/draft-04/schema"]; + return { + $ref: payloadSchema, + definitions + }; +} +var _ajv2; +function getAjvInstance2() { + if (_ajv2) { + return _ajv2; + } + _ajv2 = new import_ajv2.default({ + allErrors: true, + meta: true, + messages: true, + strict: false, + allowUnionTypes: true, + unicodeRegExp: false + }); + (0, import_ajv_formats2.default)(_ajv2); + (0, import_ajv_errors2.default)(_ajv2); + return _ajv2; +} + +// node_modules/parserapiv1/esm/parser.js +var __awaiter32 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var Parser5 = class { + constructor(options = {}) { + var _a2; + this.options = options; + this.parserRegistry = /* @__PURE__ */ new Map(); + this.spectral = createSpectral2(this, options); + this.registerSchemaParser(AsyncAPISchemaParser2()); + (_a2 = this.options.schemaParsers) === null || _a2 === void 0 ? void 0 : _a2.forEach((parser3) => this.registerSchemaParser(parser3)); + } + parse(asyncapi, options) { + return __awaiter32(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument2(asyncapi); + if (maybeDocument) { + return { + document: maybeDocument, + diagnostics: [] + }; + } + return parse8(this, this.spectral, asyncapi, options); + }); + } + validate(asyncapi, options) { + return __awaiter32(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument2(asyncapi); + if (maybeDocument) { + return []; + } + return (yield validate5(this, this.spectral, asyncapi, options)).diagnostics; + }); + } + registerSchemaParser(parser3) { + return registerSchemaParser2(this, parser3); + } +}; + +// node_modules/parserapiv2/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/parser.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/document.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/asyncapi.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/base.js +init_dirname(); +init_buffer2(); +init_process2(); +var BaseModel3 = class { + constructor(_json, _meta = {}) { + this._json = _json; + this._meta = _meta; + } + json(key) { + if (key === void 0) + return this._json; + if (this._json === null || this._json === void 0) + return this._json; + return this._json[key]; + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[key]; + } + jsonPath(field) { + if (typeof field !== "string") { + return this._meta.pointer; + } + return `${this._meta.pointer}/${field}`; + } + createModel(Model, value2, meta) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: this._meta.asyncapi })); + } +}; + +// node_modules/parserapiv2/esm/models/v2/info.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/contact.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/mixins.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/bindings.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/collection.js +init_dirname(); +init_buffer2(); +init_process2(); +var Collection4 = class extends Array { + constructor(collections, _meta = {}) { + super(...collections); + this.collections = collections; + this._meta = _meta; + } + has(id) { + return typeof this.get(id) !== "undefined"; + } + all() { + return this.collections; + } + isEmpty() { + return this.collections.length === 0; + } + filterBy(filter2) { + return this.collections.filter(filter2); + } + meta(key) { + if (key === void 0) + return this._meta; + if (!this._meta) + return; + return this._meta[String(key)]; + } +}; + +// node_modules/parserapiv2/esm/models/v2/extensions.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extensions4 = class extends Collection4 { + get(id) { + id = id.startsWith("x-") ? id : `x-${id}`; + return this.collections.find((ext) => ext.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/extension.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extension4 = class extends BaseModel3 { + id() { + return this._meta.id; + } + value() { + return this._json; + } +}; + +// node_modules/parserapiv2/esm/models/utils.js +init_dirname(); +init_buffer2(); +init_process2(); +function createModel3(Model, value2, meta, parent2) { + return new Model(value2, Object.assign(Object.assign({}, meta), { asyncapi: meta.asyncapi || (parent2 === null || parent2 === void 0 ? void 0 : parent2.meta().asyncapi) })); +} + +// node_modules/parserapiv2/esm/constants.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs9 = __toESM(require_specs()); +var xParserSpecParsed3 = "x-parser-spec-parsed"; +var xParserSpecStringified3 = "x-parser-spec-stringified"; +var xParserApiVersion3 = "x-parser-api-version"; +var xParserMessageName3 = "x-parser-message-name"; +var xParserSchemaId3 = "x-parser-schema-id"; +var xParserOriginalPayload3 = "x-parser-original-payload"; +var xParserCircular3 = "x-parser-circular"; +var EXTENSION_REGEX3 = /^x-[\w\d.\-_]+$/; +var specVersions3 = Object.keys(import_specs9.default.schemas); +var lastVersion3 = specVersions3[specVersions3.length - 1]; + +// node_modules/parserapiv2/esm/models/v2/bindings.js +var Bindings4 = class extends Collection4 { + get(name2) { + return this.collections.find((binding3) => binding3.protocol() === name2); + } + extensions() { + const extensions6 = []; + Object.entries(this._meta.originalData || {}).forEach(([id, value2]) => { + if (EXTENSION_REGEX3.test(id)) { + extensions6.push(createModel3(Extension4, value2, { id, pointer: `${this._meta.pointer}/${id}`, asyncapi: this._meta.asyncapi })); + } + }); + return new Extensions4(extensions6); + } +}; + +// node_modules/parserapiv2/esm/models/v2/binding.js +init_dirname(); +init_buffer2(); +init_process2(); +var Binding4 = class extends BaseModel3 { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const value2 = Object.assign({}, this._json); + delete value2.bindingVersion; + return value2; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/external-docs.js +init_dirname(); +init_buffer2(); +init_process2(); +var ExternalDocumentation4 = class extends BaseModel3 { + url() { + return this._json.url; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/tags.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tags4 = class extends Collection4 { + get(name2) { + return this.collections.find((tag) => tag.name() === name2); + } +}; + +// node_modules/parserapiv2/esm/models/v2/tag.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tag5 = class extends BaseModel3 { + name() { + return this._json.name; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + extensions() { + return extensions4(this); + } + hasExternalDocs() { + return hasExternalDocs5(this); + } + externalDocs() { + return externalDocs5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/mixins.js +function bindings4(model) { + const bindings6 = model.json("bindings") || {}; + return new Bindings4(Object.entries(bindings6 || {}).map(([protocol, binding3]) => createModel3(Binding4, binding3, { protocol, pointer: model.jsonPath(`bindings/${protocol}`) }, model)), { originalData: bindings6, asyncapi: model.meta("asyncapi"), pointer: model.jsonPath("bindings") }); +} +function hasDescription5(model) { + return Boolean(description5(model)); +} +function description5(model) { + return model.json("description"); +} +function extensions4(model) { + const extensions6 = []; + Object.entries(model.json()).forEach(([id, value2]) => { + if (EXTENSION_REGEX3.test(id)) { + extensions6.push(createModel3(Extension4, value2, { id, pointer: model.jsonPath(id) }, model)); + } + }); + return new Extensions4(extensions6); +} +function hasExternalDocs5(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs5(model) { + if (hasExternalDocs5(model)) { + return new ExternalDocumentation4(model.json("externalDocs")); + } +} +function tags4(model) { + return new Tags4((model.json("tags") || []).map((tag, idx) => createModel3(Tag5, tag, { pointer: model.jsonPath(`tags/${idx}`) }, model))); +} + +// node_modules/parserapiv2/esm/models/v2/contact.js +var Contact5 = class extends BaseModel3 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/license.js +init_dirname(); +init_buffer2(); +init_process2(); +var License5 = class extends BaseModel3 { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/info.js +var Info5 = class extends BaseModel3 { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const contact = this._json.contact; + return contact && this.createModel(Contact5, contact, { pointer: "/info/contact" }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const license = this._json.license; + return license && this.createModel(License5, license, { pointer: "/info/license" }); + } + hasExternalDocs() { + const asyncapiV2 = this._meta.asyncapi.parsed; + return Object.keys(asyncapiV2.externalDocs || {}).length > 0; + } + externalDocs() { + if (this.hasExternalDocs()) { + const asyncapiV2 = this._meta.asyncapi.parsed; + return this.createModel(ExternalDocumentation4, asyncapiV2.externalDocs, { pointer: "/externalDocs" }); + } + } + tags() { + const asyncapiV2 = this._meta.asyncapi.parsed; + const tags6 = asyncapiV2.tags || []; + return new Tags4(tags6.map((tag, idx) => this.createModel(Tag5, tag, { pointer: `/tags/${idx}` }))); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/channels.js +init_dirname(); +init_buffer2(); +init_process2(); +var Channels4 = class extends Collection4 { + get(id) { + return this.collections.find((channel) => channel.id() === id); + } + filterBySend() { + return this.filterBy((channel) => channel.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((channel) => channel.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/models/v2/channel.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/channel-parameters.js +init_dirname(); +init_buffer2(); +init_process2(); +var ChannelParameters4 = class extends Collection4 { + get(id) { + return this.collections.find((parameter) => parameter.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/channel-parameter.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/schema.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/schema-parser/index.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter33 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function validateSchema3(parser3, input) { + return __awaiter33(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + const { path: path2, schemaFormat } = input; + path2.pop(); + return [ + { + message: `Unknown schema format: "${schemaFormat}"`, + path: [...path2, "schemaFormat"] + }, + { + message: `Cannot validate and parse given schema due to unknown schema format: "${schemaFormat}"`, + path: [...path2, "payload"] + } + ]; + } + return schemaParser.validate(input); + }); +} +function parseSchema3(parser3, input) { + return __awaiter33(this, void 0, void 0, function* () { + const schemaParser = parser3.parserRegistry.get(input.schemaFormat); + if (schemaParser === void 0) { + throw new Error("Unknown schema format"); + } + return schemaParser.parse(input); + }); +} +function registerSchemaParser3(parser3, schemaParser) { + if (typeof schemaParser !== "object" || typeof schemaParser.validate !== "function" || typeof schemaParser.parse !== "function" || typeof schemaParser.getMimeTypes !== "function") { + throw new Error('Custom parser must have "parse()", "validate()" and "getMimeTypes()" functions.'); + } + schemaParser.getMimeTypes().forEach((schemaFormat) => { + parser3.parserRegistry.set(schemaFormat, schemaParser); + }); +} +function getSchemaFormat3(schematFormat, asyncapiVersion) { + if (typeof schematFormat === "string") { + return schematFormat; + } + return getDefaultSchemaFormat3(asyncapiVersion); +} +function getDefaultSchemaFormat3(asyncapiVersion) { + return `application/vnd.aai.asyncapi;version=${asyncapiVersion}`; +} + +// node_modules/parserapiv2/esm/models/v2/schema.js +var Schema7 = class _Schema extends BaseModel3 { + id() { + return this.$id() || this._meta.id || this.json(xParserSchemaId3); + } + $comment() { + if (typeof this._json === "boolean") + return; + return this._json.$comment; + } + $id() { + if (typeof this._json === "boolean") + return; + return this._json.$id; + } + $schema() { + if (typeof this._json === "boolean") + return "http://json-schema.org/draft-07/schema#"; + return this._json.$schema || "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalItems === "boolean") + return this._json.additionalItems; + if (this._json.additionalItems === void 0) + return true; + if (this._json.additionalItems === null) + return false; + return this.createModel(_Schema, this._json.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + if (typeof this._json === "boolean") + return this._json; + if (typeof this._json.additionalProperties === "boolean") + return this._json.additionalProperties; + if (this._json.additionalProperties === void 0) + return true; + if (this._json.additionalProperties === null) + return false; + return this.createModel(_Schema, this._json.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.allOf)) + return void 0; + return this._json.allOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/allOf/${index4}`, parent: this })); + } + anyOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.anyOf)) + return void 0; + return this._json.anyOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/anyOf/${index4}`, parent: this })); + } + const() { + if (typeof this._json === "boolean") + return; + return this._json.const; + } + contains() { + if (typeof this._json === "boolean" || typeof this._json.contains !== "object") + return; + return this.createModel(_Schema, this._json.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if (typeof this._json === "boolean") + return; + return this._json.contentEncoding; + } + contentMediaType() { + if (typeof this._json === "boolean") + return; + return this._json.contentMediaType; + } + default() { + if (typeof this._json === "boolean") + return; + return this._json.default; + } + definitions() { + if (typeof this._json === "boolean" || typeof this._json.definitions !== "object") + return; + return Object.entries(this._json.definitions).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/definitions/${key}`, parent: this }); + return acc; + }, {}); + } + description() { + if (typeof this._json === "boolean") + return; + return this._json.description; + } + dependencies() { + if (typeof this._json === "boolean") + return; + if (typeof this._json.dependencies !== "object") + return void 0; + return Object.entries(this._json.dependencies).reduce((acc, [key, s7]) => { + acc[key] = Array.isArray(s7) ? s7 : this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/dependencies/${key}`, parent: this }); + return acc; + }, {}); + } + deprecated() { + if (typeof this._json === "boolean") + return false; + return this._json.deprecated || false; + } + discriminator() { + if (typeof this._json === "boolean") + return; + return this._json.discriminator; + } + else() { + if (typeof this._json === "boolean" || typeof this._json.else !== "object") + return; + return this.createModel(_Schema, this._json.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if (typeof this._json === "boolean") + return; + return this._json.enum; + } + examples() { + if (typeof this._json === "boolean") + return; + return this._json.examples; + } + exclusiveMaximum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMaximum; + } + exclusiveMinimum() { + if (typeof this._json === "boolean") + return; + return this._json.exclusiveMinimum; + } + format() { + if (typeof this._json === "boolean") + return; + return this._json.format; + } + isBooleanSchema() { + return typeof this._json === "boolean"; + } + if() { + if (typeof this._json === "boolean" || typeof this._json.if !== "object") + return; + return this.createModel(_Schema, this._json.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._json) + return true; + parent2 = parent2._meta.parent; + } + return false; + } + items() { + if (typeof this._json === "boolean" || typeof this._json.items !== "object") + return; + if (Array.isArray(this._json.items)) { + return this._json.items.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/items/${index4}`, parent: this })); + } + return this.createModel(_Schema, this._json.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if (typeof this._json === "boolean") + return; + return this._json.maximum; + } + maxItems() { + if (typeof this._json === "boolean") + return; + return this._json.maxItems; + } + maxLength() { + if (typeof this._json === "boolean") + return; + return this._json.maxLength; + } + maxProperties() { + if (typeof this._json === "boolean") + return; + return this._json.maxProperties; + } + minimum() { + if (typeof this._json === "boolean") + return; + return this._json.minimum; + } + minItems() { + if (typeof this._json === "boolean") + return; + return this._json.minItems; + } + minLength() { + if (typeof this._json === "boolean") + return; + return this._json.minLength; + } + minProperties() { + if (typeof this._json === "boolean") + return; + return this._json.minProperties; + } + multipleOf() { + if (typeof this._json === "boolean") + return; + return this._json.multipleOf; + } + not() { + if (typeof this._json === "boolean" || typeof this._json.not !== "object") + return; + return this.createModel(_Schema, this._json.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if (typeof this._json === "boolean") + return; + if (!Array.isArray(this._json.oneOf)) + return void 0; + return this._json.oneOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/oneOf/${index4}`, parent: this })); + } + pattern() { + if (typeof this._json === "boolean") + return; + return this._json.pattern; + } + patternProperties() { + if (typeof this._json === "boolean" || typeof this._json.patternProperties !== "object") + return; + return Object.entries(this._json.patternProperties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/patternProperties/${key}`, parent: this }); + return acc; + }, {}); + } + properties() { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object") + return; + return Object.entries(this._json.properties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/properties/${key}`, parent: this }); + return acc; + }, {}); + } + property(name2) { + if (typeof this._json === "boolean" || typeof this._json.properties !== "object" || typeof this._json.properties[name2] !== "object") + return; + return this.createModel(_Schema, this._json.properties[name2], { pointer: `${this._meta.pointer}/properties/${name2}`, parent: this }); + } + propertyNames() { + if (typeof this._json === "boolean" || typeof this._json.propertyNames !== "object") + return; + return this.createModel(_Schema, this._json.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.readOnly || false; + } + required() { + if (typeof this._json === "boolean") + return; + return this._json.required; + } + schemaFormat() { + return this._meta.schemaFormat || getDefaultSchemaFormat3(this._meta.asyncapi.semver.version); + } + then() { + if (typeof this._json === "boolean" || typeof this._json.then !== "object") + return; + return this.createModel(_Schema, this._json.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if (typeof this._json === "boolean") + return; + return this._json.title; + } + type() { + if (typeof this._json === "boolean") + return; + return this._json.type; + } + uniqueItems() { + if (typeof this._json === "boolean") + return false; + return this._json.uniqueItems || false; + } + writeOnly() { + if (typeof this._json === "boolean") + return false; + return this._json.writeOnly || false; + } + hasExternalDocs() { + return hasExternalDocs5(this); + } + externalDocs() { + return externalDocs5(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/channel-parameter.js +var ChannelParameter5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + hasSchema() { + return !!this._json.schema; + } + schema() { + if (!this._json.schema) + return void 0; + return this.createModel(Schema7, this._json.schema, { pointer: `${this._meta.pointer}/schema` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/messages.js +init_dirname(); +init_buffer2(); +init_process2(); +var Messages4 = class extends Collection4 { + get(name2) { + return this.collections.find((message) => message.id() === name2); + } + filterBySend() { + return this.filterBy((message) => message.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((message) => message.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/models/v2/operations.js +init_dirname(); +init_buffer2(); +init_process2(); +var Operations4 = class extends Collection4 { + get(id) { + return this.collections.find((operation) => operation.id() === id); + } + filterBySend() { + return this.filterBy((operation) => operation.isSend()); + } + filterByReceive() { + return this.filterBy((operation) => operation.isReceive()); + } +}; + +// node_modules/parserapiv2/esm/models/v2/operation.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/message.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/message-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageTraits4 = class extends Collection4 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/message-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/correlation-id.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationId5 = class extends BaseModel3 { + location() { + return this._json.location; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/message-examples.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExamples4 = class extends Collection4 { + get(name2) { + return this.collections.find((example) => example.name() === name2); + } +}; + +// node_modules/parserapiv2/esm/models/v2/message-example.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExample4 = class extends BaseModel3 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/message-trait.js +var MessageTrait5 = class extends BaseModel3 { + id() { + return this._json.messageId || this._meta.id || this.json(xParserMessageName3); + } + hasSchemaFormat() { + return this.schemaFormat() !== void 0; + } + schemaFormat() { + return this._json.schemaFormat || getDefaultSchemaFormat3(this._meta.asyncapi.semver.version); + } + hasMessageId() { + return !!this._json.messageId; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (!this._json.correlationId) + return void 0; + return this.createModel(CorrelationId5, this._json.correlationId, { pointer: `${this._meta.pointer}/correlationId` }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var _a2; + return this._json.contentType || ((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (!this._json.headers) + return void 0; + return this.createModel(Schema7, this._json.headers, { pointer: `${this._meta.pointer}/headers` }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + hasExternalDocs() { + return hasExternalDocs5(this); + } + externalDocs() { + return externalDocs5(this); + } + examples() { + return new MessageExamples4((this._json.examples || []).map((example, index4) => { + return this.createModel(MessageExample4, example, { pointer: `${this._meta.pointer}/examples/${index4}` }); + })); + } + tags() { + return tags4(this); + } + bindings() { + return bindings4(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/servers.js +init_dirname(); +init_buffer2(); +init_process2(); +var Servers4 = class extends Collection4 { + get(id) { + return this.collections.find((server) => server.id() === id); + } + filterBySend() { + return this.filterBy((server) => server.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((server) => server.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/utils.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core42 = __toESM(require_dist11()); +init_dist2(); +function createDetailedAsyncAPI3(parsed, input, source) { + return { + source, + input, + parsed, + semver: getSemver3(parsed.asyncapi) + }; +} +function getSemver3(version5) { + const [major, minor, patchWithRc] = version5.split("."); + const [patch, rc] = patchWithRc.split("-rc"); + return { + version: version5, + major: Number(major), + minor: Number(minor), + patch: Number(patch), + rc: rc && Number(rc) + }; +} +function normalizeInput3(asyncapi) { + if (typeof asyncapi === "string") { + return asyncapi; + } + return JSON.stringify(asyncapi, void 0, 2); +} +function hasErrorDiagnostic3(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Error); +} +function hasWarningDiagnostic3(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Warning); +} +function hasInfoDiagnostic3(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Information); +} +function hasHintDiagnostic3(diagnostics) { + return diagnostics.some((diagnostic) => diagnostic.severity === DiagnosticSeverity.Hint); +} +function setExtension3(id, value2, model) { + const modelValue = model.json(); + setExtensionOnJson2(id, value2, modelValue); +} +function setExtensionOnJson2(id, value2, model) { + if (typeof model === "object" && model) { + id = id.startsWith("x-") ? id : `x-${id}`; + model[String(id)] = value2; + } +} +function mergePatch3(origin, patch) { + if (!isObject7(patch)) { + return patch; + } + const result2 = !isObject7(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = mergePatch3(result2[key], patchVal); + } + }); + return result2; +} +function isObject7(value2) { + return Boolean(value2) && typeof value2 === "object" && Array.isArray(value2) === false; +} +function toJSONPathArray3(jsonPath) { + return splitPath5(serializePath3(jsonPath)); +} +function createUncaghtDiagnostic3(err, message, document2) { + if (!(err instanceof Error)) { + return []; + } + const range2 = document2 ? document2.getRangeForJsonPath([]) : import_spectral_core42.Document.DEFAULT_RANGE; + return [ + { + code: "uncaught-error", + message: `${message}. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: [], + severity: DiagnosticSeverity.Error, + range: range2 + } + ]; +} +function tilde3(str2) { + return str2.replace(/[~/]{1}/g, (sub) => { + switch (sub) { + case "/": + return "~1"; + case "~": + return "~0"; + } + return sub; + }); +} +function untilde3(str2) { + if (!str2.includes("~")) + return str2; + return str2.replace(/~[01]/g, (sub) => { + switch (sub) { + case "~1": + return "/"; + case "~0": + return "~"; + } + return sub; + }); +} +function findSubArrayIndex3(arr, subarr, fromIndex = 0) { + let i7, found, j6; + for (i7 = fromIndex; i7 < 1 + (arr.length - subarr.length); ++i7) { + found = true; + for (j6 = 0; j6 < subarr.length; ++j6) { + if (arr[i7 + j6] !== subarr[j6]) { + found = false; + break; + } + } + if (found) { + return i7; + } + } + return -1; +} +function retrieveDeepData3(value2, path2) { + let index4 = 0; + const length = path2.length; + while (typeof value2 === "object" && value2 && index4 < length) { + value2 = value2[path2[index4++]]; + } + return index4 === length ? value2 : void 0; +} +function serializePath3(path2) { + if (path2.startsWith("#")) + return path2.substring(1); + return path2; +} +function splitPath5(path2) { + return path2.split("/").filter(Boolean).map(untilde3); +} + +// node_modules/parserapiv2/esm/models/v2/message.js +var Message5 = class extends MessageTrait5 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (!this._json.payload) + return void 0; + return this.createModel(Schema7, this._json.payload, { pointer: `${this._meta.pointer}/payload`, schemaFormat: this._json.schemaFormat }); + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers4(servers); + } + channels() { + const channels = []; + const channelsData = []; + this.operations().all().forEach((operation) => { + operation.channels().forEach((channel) => { + if (!channelsData.includes(channel.json())) { + channelsData.push(channel.json()); + channels.push(channel); + } + }); + }); + return new Channels4(channels); + } + operations() { + var _a2; + const operations = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + ["subscribe", "publish"].forEach((operationAction) => { + const operation = channel[operationAction]; + if (operation && (operation.message === this._json || (operation.message.oneOf || []).includes(this._json))) { + operations.push(this.createModel(Operation5, operation, { id: "", pointer: `/channels/${tilde3(channelAddress)}/${operationAction}`, action: operationAction })); + } + }); + }); + return new Operations4(operations); + } + traits() { + return new MessageTraits4((this._json.traits || []).map((trait, index4) => { + return this.createModel(MessageTrait5, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}` }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v2/operation-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationTraits4 = class extends Collection4 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/operation-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/security-scheme.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/oauth-flows.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/oauth-flow.js +init_dirname(); +init_buffer2(); +init_process2(); +var OAuthFlow5 = class extends BaseModel3 { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.scopes; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/oauth-flows.js +var OAuthFlows4 = class extends BaseModel3 { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (!this._json.authorizationCode) + return void 0; + return new OAuthFlow5(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (!this._json.clientCredentials) + return void 0; + return new OAuthFlow5(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (!this._json.implicit) + return void 0; + return new OAuthFlow5(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (!this._json.password) + return void 0; + return new OAuthFlow5(this._json.password); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/security-scheme.js +var SecurityScheme5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (!this._json.flows) + return void 0; + return new OAuthFlows4(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/security-requirements.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirements4 = class extends Collection4 { + get(id) { + return this.collections.find((securityRequirement) => securityRequirement.meta("id") === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/security-requirement.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirement5 = class extends BaseModel3 { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } +}; + +// node_modules/parserapiv2/esm/models/v2/operation-trait.js +var OperationTrait5 = class extends BaseModel3 { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._json.operationId; + } + operationId() { + return this._json.operationId; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + hasExternalDocs() { + return hasExternalDocs5(this); + } + externalDocs() { + return externalDocs5(this); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme5, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement5, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements4(requirements); + }); + } + tags() { + return tags4(this); + } + bindings() { + return bindings4(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/operation.js +var Operation5 = class extends OperationTrait5 { + action() { + return this._meta.action; + } + isSend() { + return this.action() === "subscribe"; + } + isReceive() { + return this.action() === "publish"; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + if (!serversData.includes(server.json())) { + serversData.push(server.json()); + servers.push(server); + } + }); + }); + return new Servers4(servers); + } + channels() { + const channels = []; + Object.entries(this._meta.asyncapi.parsed.channels || {}).forEach(([channelAddress, channel]) => { + if (channel.subscribe === this._json || channel.publish === this._json) { + channels.push(this.createModel(Channel5, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde3(channelAddress)}` })); + } + }); + return new Channels4(channels); + } + messages() { + let isOneOf = false; + let messages = []; + if (this._json.message) { + if (Array.isArray(this._json.message.oneOf)) { + messages = this._json.message.oneOf; + isOneOf = true; + } else { + messages = [this._json.message]; + } + } + return new Messages4(messages.map((message, index4) => { + return this.createModel(Message5, message, { id: "", pointer: `${this._meta.pointer}/message${isOneOf ? `/oneOf/${index4}` : ""}` }); + })); + } + reply() { + return; + } + traits() { + return new OperationTraits4((this._json.traits || []).map((trait, index4) => { + return this.createModel(OperationTrait5, trait, { id: "", pointer: `${this._meta.pointer}/traits/${index4}`, action: "" }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v2/server.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/server-variables.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariables4 = class extends Collection4 { + get(id) { + return this.collections.find((variable) => variable.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/server-variable.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariable5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/server.js +var Server5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + host() { + const url = new URL(this.url()); + return url.host; + } + hasPathname() { + return !!this.pathname(); + } + pathname() { + const url = new URL(this.url()); + return url.pathname; + } + protocol() { + return this._json.protocol; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + channels() { + var _a2; + const channels = []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {}).forEach(([channelAddress, channel]) => { + const allowedServers = channel.servers || []; + if (allowedServers.length === 0 || allowedServers.includes(this._meta.id)) { + channels.push(this.createModel(Channel5, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde3(channelAddress)}` })); + } + }); + return new Channels4(channels); + } + operations() { + const operations = []; + this.channels().forEach((channel) => { + operations.push(...channel.operations().all()); + }); + return new Operations4(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages4(messages); + } + variables() { + return new ServerVariables4(Object.entries(this._json.variables || {}).map(([serverVariableName, serverVariable]) => { + return this.createModel(ServerVariable5, serverVariable, { + id: serverVariableName, + pointer: `${this._meta.pointer}/variables/${serverVariableName}` + }); + })); + } + security() { + var _a2, _b, _c, _d; + const securitySchemes = ((_d = (_c = (_b = (_a2 = this._meta) === null || _a2 === void 0 ? void 0 : _a2.asyncapi) === null || _b === void 0 ? void 0 : _b.parsed) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.securitySchemes) || {}; + return (this._json.security || []).map((requirement, index4) => { + const requirements = []; + Object.entries(requirement).forEach(([security4, scopes]) => { + const scheme = this.createModel(SecurityScheme5, securitySchemes[security4], { id: security4, pointer: `/components/securitySchemes/${security4}` }); + requirements.push(this.createModel(SecurityRequirement5, { scheme, scopes }, { id: security4, pointer: `${this.meta().pointer}/security/${index4}/${security4}` })); + }); + return new SecurityRequirements4(requirements); + }); + } + tags() { + return tags4(this); + } + bindings() { + return bindings4(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/channel.js +var Channel5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + address() { + return this._meta.address; + } + hasDescription() { + return hasDescription5(this); + } + description() { + return description5(this); + } + servers() { + var _a2; + const servers = []; + const allowedServers = this._json.servers || []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.servers) || {}).forEach(([serverName, server]) => { + if (allowedServers.length === 0 || allowedServers.includes(serverName)) { + servers.push(this.createModel(Server5, server, { id: serverName, pointer: `/servers/${serverName}` })); + } + }); + return new Servers4(servers); + } + operations() { + const operations = []; + ["publish", "subscribe"].forEach((operationAction) => { + const operation = this._json[operationAction]; + const id = operation && operation.operationId || operationAction; + if (operation) { + operations.push(this.createModel(Operation5, operation, { id, action: operationAction, pointer: `${this._meta.pointer}/${operationAction}` })); + } + }); + return new Operations4(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => messages.push(...operation.messages().all())); + return new Messages4(messages); + } + parameters() { + return new ChannelParameters4(Object.entries(this._json.parameters || {}).map(([channelParameterName, channelParameter]) => { + return this.createModel(ChannelParameter5, channelParameter, { + id: channelParameterName, + pointer: `${this._meta.pointer}/parameters/${channelParameterName}` + }); + })); + } + bindings() { + return bindings4(this); + } + extensions() { + return extensions4(this); + } +}; + +// node_modules/parserapiv2/esm/models/v2/components.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v2/schemas.js +init_dirname(); +init_buffer2(); +init_process2(); +var Schemas4 = class extends Collection4 { + get(id) { + return this.collections.find((schema8) => schema8.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/security-schemes.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecuritySchemes4 = class extends Collection4 { + get(id) { + return this.collections.find((securityScheme) => securityScheme.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/correlation-ids.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationIds4 = class extends Collection4 { + get(id) { + return this.collections.find((correlationId) => correlationId.meta("id") === id); + } +}; + +// node_modules/parserapiv2/esm/models/v2/components.js +var Components5 = class extends BaseModel3 { + servers() { + return this.createCollection("servers", Servers4, Server5); + } + channels() { + return new Channels4(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel5, channel, { id: channelAddress, address: "", pointer: `/components/channels/${tilde3(channelAddress)}` }))); + } + operations() { + return new Operations4([]); + } + messages() { + return this.createCollection("messages", Messages4, Message5); + } + schemas() { + return this.createCollection("schemas", Schemas4, Schema7); + } + channelParameters() { + return this.createCollection("parameters", ChannelParameters4, ChannelParameter5); + } + serverVariables() { + return this.createCollection("serverVariables", ServerVariables4, ServerVariable5); + } + operationTraits() { + return this.createCollection("operationTraits", OperationTraits4, OperationTrait5); + } + messageTraits() { + return this.createCollection("messageTraits", MessageTraits4, MessageTrait5); + } + correlationIds() { + return this.createCollection("correlationIds", CorrelationIds4, CorrelationId5); + } + securitySchemes() { + return this.createCollection("securitySchemes", SecuritySchemes4, SecurityScheme5); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return extensions4(this); + } + isEmpty() { + return Object.keys(this._json).length === 0; + } + createCollection(itemsName, collectionModel, itemModel) { + const collectionItems = []; + Object.entries(this._json[itemsName] || {}).forEach(([id, item]) => { + collectionItems.push(this.createModel(itemModel, item, { id, pointer: `/components/${itemsName}/${id}` })); + }); + return new collectionModel(collectionItems); + } + createBindings(itemsName) { + return Object.entries(this._json[itemsName] || {}).reduce((bindings6, [name2, item]) => { + const bindingsData = item || {}; + const asyncapi = this.meta("asyncapi"); + const pointer = `components/${itemsName}/${name2}`; + bindings6[name2] = new Bindings4(Object.entries(bindingsData).map(([protocol, binding3]) => this.createModel(Binding4, binding3, { protocol, pointer: `${pointer}/${protocol}` })), { originalData: bindingsData, asyncapi, pointer }); + return bindings6; + }, {}); + } +}; + +// node_modules/parserapiv2/esm/iterator.js +init_dirname(); +init_buffer2(); +init_process2(); +var SchemaIteratorCallbackType4; +(function(SchemaIteratorCallbackType5) { + SchemaIteratorCallbackType5["NEW_SCHEMA"] = "NEW_SCHEMA"; + SchemaIteratorCallbackType5["END_SCHEMA"] = "END_SCHEMA"; +})(SchemaIteratorCallbackType4 || (SchemaIteratorCallbackType4 = {})); +var SchemaTypesToIterate4; +(function(SchemaTypesToIterate5) { + SchemaTypesToIterate5["Parameters"] = "parameters"; + SchemaTypesToIterate5["Payloads"] = "payloads"; + SchemaTypesToIterate5["Headers"] = "headers"; + SchemaTypesToIterate5["Components"] = "components"; + SchemaTypesToIterate5["Objects"] = "objects"; + SchemaTypesToIterate5["Arrays"] = "arrays"; + SchemaTypesToIterate5["OneOfs"] = "oneOfs"; + SchemaTypesToIterate5["AllOfs"] = "allOfs"; + SchemaTypesToIterate5["AnyOfs"] = "anyOfs"; + SchemaTypesToIterate5["Nots"] = "nots"; + SchemaTypesToIterate5["PropertyNames"] = "propertyNames"; + SchemaTypesToIterate5["PatternProperties"] = "patternProperties"; + SchemaTypesToIterate5["Contains"] = "contains"; + SchemaTypesToIterate5["Ifs"] = "ifs"; + SchemaTypesToIterate5["Thenes"] = "thenes"; + SchemaTypesToIterate5["Elses"] = "elses"; + SchemaTypesToIterate5["Dependencies"] = "dependencies"; + SchemaTypesToIterate5["Definitions"] = "definitions"; +})(SchemaTypesToIterate4 || (SchemaTypesToIterate4 = {})); +function traverseAsyncApiDocument4(doc, callback, schemaTypesToIterate = []) { + if (schemaTypesToIterate.length === 0) { + schemaTypesToIterate = Object.values(SchemaTypesToIterate4); + } + const options = { callback, schemaTypesToIterate, seenSchemas: /* @__PURE__ */ new Set() }; + if (!doc.channels().isEmpty()) { + doc.channels().all().forEach((channel) => { + traverseChannel4(channel, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Components) && !doc.components().isEmpty()) { + const components = doc.components(); + Object.values(components.messages().all() || {}).forEach((message) => { + traverseMessage4(message, options); + }); + Object.values(components.schemas().all() || {}).forEach((schema8) => { + traverseSchema4(schema8, null, options); + }); + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Parameters)) { + Object.values(components.channelParameters().filterBy((param) => { + return param.hasSchema(); + })).forEach((parameter) => { + traverseSchema4(parameter.schema(), null, options); + }); + } + Object.values(components.messageTraits().all() || {}).forEach((messageTrait) => { + traverseMessageTrait4(messageTrait, options); + }); + } +} +function traverseSchema4(schema8, propOrIndex, options) { + if (!schema8) + return; + const { schemaTypesToIterate, callback, seenSchemas } = options; + const jsonSchema = schema8.json(); + if (seenSchemas.has(jsonSchema)) + return; + seenSchemas.add(jsonSchema); + let types3 = schema8.type() || []; + if (!Array.isArray(types3)) { + types3 = [types3]; + } + if (!schemaTypesToIterate.includes(SchemaTypesToIterate4.Objects) && types3.includes("object")) + return; + if (!schemaTypesToIterate.includes(SchemaTypesToIterate4.Arrays) && types3.includes("array")) + return; + if (callback(schema8, propOrIndex, SchemaIteratorCallbackType4.NEW_SCHEMA) === false) + return; + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Objects) && types3.includes("object")) { + recursiveSchemaObject4(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Arrays) && types3.includes("array")) { + recursiveSchemaArray4(schema8, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.OneOfs)) { + (schema8.oneOf() || []).forEach((combineSchema, idx) => { + traverseSchema4(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.AnyOfs)) { + (schema8.anyOf() || []).forEach((combineSchema, idx) => { + traverseSchema4(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.AllOfs)) { + (schema8.allOf() || []).forEach((combineSchema, idx) => { + traverseSchema4(combineSchema, idx, options); + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Nots) && schema8.not()) { + traverseSchema4(schema8.not(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Ifs) && schema8.if()) { + traverseSchema4(schema8.if(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Thenes) && schema8.then()) { + traverseSchema4(schema8.then(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Elses) && schema8.else()) { + traverseSchema4(schema8.else(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Dependencies)) { + Object.entries(schema8.dependencies() || {}).forEach(([depName, dep]) => { + if (dep && !Array.isArray(dep)) { + traverseSchema4(dep, depName, options); + } + }); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Definitions)) { + Object.entries(schema8.definitions() || {}).forEach(([defName, def]) => { + traverseSchema4(def, defName, options); + }); + } + callback(schema8, propOrIndex, SchemaIteratorCallbackType4.END_SCHEMA); + seenSchemas.delete(jsonSchema); +} +function recursiveSchemaObject4(schema8, options) { + Object.entries(schema8.properties() || {}).forEach(([propertyName, property2]) => { + traverseSchema4(property2, propertyName, options); + }); + const additionalProperties = schema8.additionalProperties(); + if (typeof additionalProperties === "object") { + traverseSchema4(additionalProperties, null, options); + } + const schemaTypesToIterate = options.schemaTypesToIterate; + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.PropertyNames) && schema8.propertyNames()) { + traverseSchema4(schema8.propertyNames(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.PatternProperties)) { + Object.entries(schema8.patternProperties() || {}).forEach(([propertyName, property2]) => { + traverseSchema4(property2, propertyName, options); + }); + } +} +function recursiveSchemaArray4(schema8, options) { + const items = schema8.items(); + if (items) { + if (Array.isArray(items)) { + items.forEach((item, idx) => { + traverseSchema4(item, idx, options); + }); + } else { + traverseSchema4(items, null, options); + } + } + const additionalItems = schema8.additionalItems(); + if (typeof additionalItems === "object") { + traverseSchema4(additionalItems, null, options); + } + if (options.schemaTypesToIterate.includes("contains") && schema8.contains()) { + traverseSchema4(schema8.contains(), null, options); + } +} +function traverseChannel4(channel, options) { + if (!channel) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Parameters)) { + Object.values(channel.parameters().filterBy((param) => { + return param.hasSchema(); + }) || {}).forEach((parameter) => { + traverseSchema4(parameter.schema(), null, options); + }); + } + channel.messages().all().forEach((message) => { + traverseMessage4(message, options); + }); +} +function traverseMessage4(message, options) { + if (!message) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Headers) && message.hasHeaders()) { + traverseSchema4(message.headers(), null, options); + } + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Payloads) && message.hasPayload()) { + traverseSchema4(message.payload(), null, options); + } +} +function traverseMessageTrait4(messageTrait, options) { + if (!messageTrait) + return; + const { schemaTypesToIterate } = options; + if (schemaTypesToIterate.includes(SchemaTypesToIterate4.Headers) && messageTrait.hasHeaders()) { + traverseSchema4(messageTrait.headers(), null, options); + } +} + +// node_modules/parserapiv2/esm/models/v2/asyncapi.js +var AsyncAPIDocument6 = class extends BaseModel3 { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(Info5, this._json.info, { pointer: "/info" }); + } + servers() { + return new Servers4(Object.entries(this._json.servers || {}).map(([serverName, server]) => this.createModel(Server5, server, { id: serverName, pointer: `/servers/${serverName}` }))); + } + channels() { + return new Channels4(Object.entries(this._json.channels || {}).map(([channelAddress, channel]) => this.createModel(Channel5, channel, { id: channelAddress, address: channelAddress, pointer: `/channels/${tilde3(channelAddress)}` }))); + } + operations() { + const operations = []; + this.channels().forEach((channel) => operations.push(...channel.operations())); + return new Operations4(operations); + } + messages() { + const messages = []; + this.operations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + return new Messages4(messages); + } + schemas() { + return this.__schemas(false); + } + securitySchemes() { + var _a2; + return new SecuritySchemes4(Object.entries(((_a2 = this._json.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) || {}).map(([securitySchemeName, securityScheme]) => this.createModel(SecurityScheme5, securityScheme, { id: securitySchemeName, pointer: `/components/securitySchemes/${securitySchemeName}` }))); + } + components() { + return this.createModel(Components5, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const servers = this.servers().all(); + this.components().servers().forEach((server) => !servers.some((s7) => s7.json() === server.json()) && servers.push(server)); + return new Servers4(servers); + } + allChannels() { + const channels = this.channels().all(); + this.components().channels().forEach((channel) => !channels.some((c7) => c7.json() === channel.json()) && channels.push(channel)); + return new Channels4(channels); + } + allOperations() { + const operations = []; + this.allChannels().forEach((channel) => operations.push(...channel.operations())); + return new Operations4(operations); + } + allMessages() { + const messages = []; + this.allOperations().forEach((operation) => operation.messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message))); + this.components().messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message)); + return new Messages4(messages); + } + allSchemas() { + return this.__schemas(true); + } + extensions() { + return extensions4(this); + } + __schemas(withComponents) { + const schemas5 = /* @__PURE__ */ new Set(); + function callback(schema8) { + if (!schemas5.has(schema8.json())) { + schemas5.add(schema8); + } + } + let toIterate = Object.values(SchemaTypesToIterate4); + if (!withComponents) { + toIterate = toIterate.filter((s7) => s7 !== SchemaTypesToIterate4.Components); + } + traverseAsyncApiDocument4(this, callback, toIterate); + return new Schemas4(Array.from(schemas5)); + } +}; + +// node_modules/parserapiv2/esm/models/v3/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/asyncapi.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/info.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/contact.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/mixins.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/bindings.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/extensions.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extensions5 = class extends Collection4 { + get(id) { + id = id.startsWith("x-") ? id : `x-${id}`; + return this.collections.find((ext) => ext.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/extension.js +init_dirname(); +init_buffer2(); +init_process2(); +var Extension5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + version() { + return "to implement"; + } + value() { + return this._json; + } +}; + +// node_modules/parserapiv2/esm/models/v3/bindings.js +var Bindings5 = class extends Collection4 { + get(name2) { + return this.collections.find((binding3) => binding3.protocol() === name2); + } + extensions() { + const extensions6 = []; + Object.entries(this._meta.originalData || {}).forEach(([id, value2]) => { + if (EXTENSION_REGEX3.test(id)) { + extensions6.push(createModel3(Extension5, value2, { id, pointer: `${this._meta.pointer}/${id}`, asyncapi: this._meta.asyncapi })); + } + }); + return new Extensions5(extensions6); + } +}; + +// node_modules/parserapiv2/esm/models/v3/binding.js +init_dirname(); +init_buffer2(); +init_process2(); +var Binding5 = class extends BaseModel3 { + protocol() { + return this._meta.protocol; + } + version() { + return this._json.bindingVersion || "latest"; + } + value() { + const value2 = Object.assign({}, this._json); + delete value2.bindingVersion; + return value2; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/external-docs.js +init_dirname(); +init_buffer2(); +init_process2(); +var ExternalDocumentation5 = class extends BaseModel3 { + id() { + return this._meta.id; + } + url() { + return this._json.url; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/tags.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tags5 = class extends Collection4 { + get(name2) { + return this.collections.find((tag) => tag.name() === name2); + } +}; + +// node_modules/parserapiv2/esm/models/v3/tag.js +init_dirname(); +init_buffer2(); +init_process2(); +var Tag6 = class extends BaseModel3 { + id() { + return this._meta.id; + } + name() { + return this._json.name; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + extensions() { + return extensions5(this); + } + hasExternalDocs() { + return hasExternalDocs6(this); + } + externalDocs() { + return externalDocs6(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/mixins.js +var CoreModel2 = class extends BaseModel3 { + hasTitle() { + return !!this._json.title; + } + title() { + return this._json.title; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + hasExternalDocs() { + return hasExternalDocs6(this); + } + externalDocs() { + return externalDocs6(this); + } + tags() { + return tags5(this); + } + bindings() { + return bindings5(this); + } + extensions() { + return extensions5(this); + } +}; +function bindings5(model) { + const bindings6 = model.json("bindings") || {}; + return new Bindings5(Object.entries(bindings6 || {}).map(([protocol, binding3]) => createModel3(Binding5, binding3, { protocol, pointer: model.jsonPath(`bindings/${protocol}`) }, model)), { originalData: bindings6, asyncapi: model.meta("asyncapi"), pointer: model.jsonPath("bindings") }); +} +function hasDescription6(model) { + return Boolean(description6(model)); +} +function description6(model) { + return model.json("description"); +} +function extensions5(model) { + const extensions6 = []; + Object.entries(model.json()).forEach(([id, value2]) => { + if (EXTENSION_REGEX3.test(id)) { + extensions6.push(createModel3(Extension5, value2, { id, pointer: model.jsonPath(id) }, model)); + } + }); + return new Extensions5(extensions6); +} +function hasExternalDocs6(model) { + return Object.keys(model.json("externalDocs") || {}).length > 0; +} +function externalDocs6(model) { + if (hasExternalDocs6(model)) { + return new ExternalDocumentation5(model.json("externalDocs")); + } +} +function tags5(model) { + return new Tags5((model.json("tags") || []).map((tag, idx) => createModel3(Tag6, tag, { pointer: model.jsonPath(`tags/${idx}`) }, model))); +} + +// node_modules/parserapiv2/esm/models/v3/contact.js +var Contact6 = class extends BaseModel3 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + hasEmail() { + return !!this._json.email; + } + email() { + return this._json.email; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/license.js +init_dirname(); +init_buffer2(); +init_process2(); +var License6 = class extends BaseModel3 { + name() { + return this._json.name; + } + hasUrl() { + return !!this._json.url; + } + url() { + return this._json.url; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/info.js +var Info6 = class extends BaseModel3 { + title() { + return this._json.title; + } + version() { + return this._json.version; + } + hasId() { + return !!this._meta.asyncapi.parsed.id; + } + id() { + return this._meta.asyncapi.parsed.id; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + hasTermsOfService() { + return !!this._json.termsOfService; + } + termsOfService() { + return this._json.termsOfService; + } + hasContact() { + return Object.keys(this._json.contact || {}).length > 0; + } + contact() { + const contact = this._json.contact; + return contact && this.createModel(Contact6, contact, { pointer: this.jsonPath("contact") }); + } + hasLicense() { + return Object.keys(this._json.license || {}).length > 0; + } + license() { + const license = this._json.license; + return license && this.createModel(License6, license, { pointer: this.jsonPath("license") }); + } + hasExternalDocs() { + return hasExternalDocs6(this); + } + externalDocs() { + return externalDocs6(this); + } + tags() { + return tags5(this); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/servers.js +init_dirname(); +init_buffer2(); +init_process2(); +var Servers5 = class extends Collection4 { + get(id) { + return this.collections.find((server) => server.id() === id); + } + filterBySend() { + return this.filterBy((server) => server.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((server) => server.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/models/v3/server.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/channels.js +init_dirname(); +init_buffer2(); +init_process2(); +var Channels5 = class extends Collection4 { + get(id) { + return this.collections.find((channel) => channel.id() === id); + } + filterBySend() { + return this.filterBy((channel) => channel.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((channel) => channel.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/models/v3/channel.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/channel-parameters.js +init_dirname(); +init_buffer2(); +init_process2(); +var ChannelParameters5 = class extends Collection4 { + get(id) { + return this.collections.find((parameter) => parameter.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/channel-parameter.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var Schema8 = class _Schema extends BaseModel3 { + // The following constructor is needed because, starting from AsyncAPI v3, schemas can be multi-format as well. + constructor(_json, _meta = {}) { + var _a2, _b; + super(_json, _meta); + this._json = _json; + this._meta = _meta; + if (typeof _json === "object" && typeof _json.schema === "object") { + this._schemaObject = _json.schema; + this._schemaFormat = _json.schemaFormat; + } else { + this._schemaObject = _json; + this._schemaFormat = getDefaultSchemaFormat3((_b = (_a2 = _meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.semver) === null || _b === void 0 ? void 0 : _b.version); + } + } + id() { + return this.$id() || this._meta.id || this._schemaObject[xParserSchemaId3]; + } + $comment() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.$comment; + } + $id() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.$id; + } + $schema() { + var _a2; + if (typeof this._schemaObject === "boolean") + return "http://json-schema.org/draft-07/schema#"; + return (_a2 = this._schemaObject.$schema) !== null && _a2 !== void 0 ? _a2 : "http://json-schema.org/draft-07/schema#"; + } + additionalItems() { + if (typeof this._schemaObject === "boolean") + return this._schemaObject; + if (this._schemaObject.additionalItems === void 0) + return true; + if (typeof this._schemaObject.additionalItems === "boolean") + return this._schemaObject.additionalItems; + return this.createModel(_Schema, this._schemaObject.additionalItems, { pointer: `${this._meta.pointer}/additionalItems`, parent: this }); + } + additionalProperties() { + if (typeof this._schemaObject === "boolean") + return this._schemaObject; + if (this._schemaObject.additionalProperties === void 0) + return true; + if (typeof this._schemaObject.additionalProperties === "boolean") + return this._schemaObject.additionalProperties; + return this.createModel(_Schema, this._schemaObject.additionalProperties, { pointer: `${this._meta.pointer}/additionalProperties`, parent: this }); + } + allOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.allOf)) + return void 0; + return this._schemaObject.allOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/allOf/${index4}`, parent: this })); + } + anyOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.anyOf)) + return void 0; + return this._schemaObject.anyOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/anyOf/${index4}`, parent: this })); + } + const() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.const; + } + contains() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.contains !== "object") + return; + return this.createModel(_Schema, this._schemaObject.contains, { pointer: `${this._meta.pointer}/contains`, parent: this }); + } + contentEncoding() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.contentEncoding; + } + contentMediaType() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.contentMediaType; + } + default() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.default; + } + definitions() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.definitions !== "object") + return; + return Object.entries(this._schemaObject.definitions).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/definitions/${key}`, parent: this }); + return acc; + }, {}); + } + description() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.description; + } + dependencies() { + if (typeof this._schemaObject === "boolean") + return; + if (typeof this._schemaObject.dependencies !== "object") + return void 0; + return Object.entries(this._schemaObject.dependencies).reduce((acc, [key, s7]) => { + acc[key] = Array.isArray(s7) ? s7 : this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/dependencies/${key}`, parent: this }); + return acc; + }, {}); + } + deprecated() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.deprecated || false; + } + discriminator() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.discriminator; + } + else() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.else !== "object") + return; + return this.createModel(_Schema, this._schemaObject.else, { pointer: `${this._meta.pointer}/else`, parent: this }); + } + enum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.enum; + } + examples() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.examples; + } + exclusiveMaximum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.exclusiveMaximum; + } + exclusiveMinimum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.exclusiveMinimum; + } + format() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.format; + } + isBooleanSchema() { + return typeof this._schemaObject === "boolean"; + } + if() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.if !== "object") + return; + return this.createModel(_Schema, this._schemaObject.if, { pointer: `${this._meta.pointer}/if`, parent: this }); + } + isCircular() { + let parent2 = this._meta.parent; + while (parent2) { + if (parent2._json === this._schemaObject) + return true; + parent2 = parent2._meta.parent; + } + return false; + } + items() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.items !== "object") + return; + if (Array.isArray(this._schemaObject.items)) { + return this._schemaObject.items.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/items/${index4}`, parent: this })); + } + return this.createModel(_Schema, this._schemaObject.items, { pointer: `${this._meta.pointer}/items`, parent: this }); + } + maximum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maximum; + } + maxItems() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxItems; + } + maxLength() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxLength; + } + maxProperties() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.maxProperties; + } + minimum() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minimum; + } + minItems() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minItems; + } + minLength() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minLength; + } + minProperties() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.minProperties; + } + multipleOf() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.multipleOf; + } + not() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.not !== "object") + return; + return this.createModel(_Schema, this._schemaObject.not, { pointer: `${this._meta.pointer}/not`, parent: this }); + } + oneOf() { + if (typeof this._schemaObject === "boolean") + return; + if (!Array.isArray(this._schemaObject.oneOf)) + return void 0; + return this._schemaObject.oneOf.map((s7, index4) => this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/oneOf/${index4}`, parent: this })); + } + pattern() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.pattern; + } + patternProperties() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.patternProperties !== "object") + return; + return Object.entries(this._schemaObject.patternProperties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/patternProperties/${key}`, parent: this }); + return acc; + }, {}); + } + properties() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.properties !== "object") + return; + return Object.entries(this._schemaObject.properties).reduce((acc, [key, s7]) => { + acc[key] = this.createModel(_Schema, s7, { pointer: `${this._meta.pointer}/properties/${key}`, parent: this }); + return acc; + }, {}); + } + property(name2) { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.properties !== "object" || typeof this._schemaObject.properties[name2] !== "object") + return; + return this.createModel(_Schema, this._schemaObject.properties[name2], { pointer: `${this._meta.pointer}/properties/${name2}`, parent: this }); + } + propertyNames() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.propertyNames !== "object") + return; + return this.createModel(_Schema, this._schemaObject.propertyNames, { pointer: `${this._meta.pointer}/propertyNames`, parent: this }); + } + readOnly() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.readOnly || false; + } + required() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.required; + } + schemaFormat() { + return this._schemaFormat; + } + then() { + if (typeof this._schemaObject === "boolean" || typeof this._schemaObject.then !== "object") + return; + return this.createModel(_Schema, this._schemaObject.then, { pointer: `${this._meta.pointer}/then`, parent: this }); + } + title() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.title; + } + type() { + if (typeof this._schemaObject === "boolean") + return; + return this._schemaObject.type; + } + uniqueItems() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.uniqueItems || false; + } + writeOnly() { + if (typeof this._schemaObject === "boolean") + return false; + return this._schemaObject.writeOnly || false; + } + hasExternalDocs() { + return hasExternalDocs6(this); + } + externalDocs() { + return externalDocs6(this); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/channel-parameter.js +var ChannelParameter6 = class extends BaseModel3 { + id() { + return this._meta.id; + } + hasSchema() { + return true; + } + schema() { + return this.createModel(Schema8, { + type: "string", + description: this._json.description, + enum: this._json.enum, + default: this._json.default, + examples: this._json.examples + }, { pointer: `${this._meta.pointer}` }); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/messages.js +init_dirname(); +init_buffer2(); +init_process2(); +var Messages5 = class extends Collection4 { + get(name2) { + return this.collections.find((message) => message.id() === name2); + } + filterBySend() { + return this.filterBy((message) => message.operations().filterBySend().length > 0); + } + filterByReceive() { + return this.filterBy((message) => message.operations().filterByReceive().length > 0); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/operations.js +init_dirname(); +init_buffer2(); +init_process2(); +var Operations5 = class extends Collection4 { + get(id) { + return this.collections.find((operation) => operation.id() === id); + } + filterBySend() { + return this.filterBy((operation) => operation.isSend()); + } + filterByReceive() { + return this.filterBy((operation) => operation.isReceive()); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/operation-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationTraits5 = class extends Collection4 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/security-scheme.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/oauth-flows.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/oauth-flow.js +init_dirname(); +init_buffer2(); +init_process2(); +var OAuthFlow6 = class extends BaseModel3 { + hasAuthorizationUrl() { + return !!this.json().authorizationUrl; + } + authorizationUrl() { + return this.json().authorizationUrl; + } + hasRefreshUrl() { + return !!this._json.refreshUrl; + } + refreshUrl() { + return this._json.refreshUrl; + } + scopes() { + return this._json.availableScopes; + } + hasTokenUrl() { + return !!this.json().tokenUrl; + } + tokenUrl() { + return this.json().tokenUrl; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/oauth-flows.js +var OAuthFlows5 = class extends BaseModel3 { + hasAuthorizationCode() { + return !!this._json.authorizationCode; + } + authorizationCode() { + if (!this._json.authorizationCode) + return void 0; + return new OAuthFlow6(this._json.authorizationCode); + } + hasClientCredentials() { + return !!this._json.clientCredentials; + } + clientCredentials() { + if (!this._json.clientCredentials) + return void 0; + return new OAuthFlow6(this._json.clientCredentials); + } + hasImplicit() { + return !!this._json.implicit; + } + implicit() { + if (!this._json.implicit) + return void 0; + return new OAuthFlow6(this._json.implicit); + } + hasPassword() { + return !!this._json.password; + } + password() { + if (!this._json.password) + return void 0; + return new OAuthFlow6(this._json.password); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/security-scheme.js +var SecurityScheme6 = class extends BaseModel3 { + id() { + return this._meta.id; + } + type() { + return this._json.type; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasIn() { + return !!this._json.in; + } + in() { + return this._json.in; + } + hasScheme() { + return !!this._json.scheme; + } + scheme() { + return this._json.scheme; + } + hasBearerFormat() { + return !!this._json.bearerFormat; + } + bearerFormat() { + return this._json.bearerFormat; + } + hasFlows() { + return !!this._json.flows; + } + flows() { + if (!this._json.flows) + return void 0; + return new OAuthFlows5(this._json.flows); + } + hasOpenIdConnectUrl() { + return !!this._json.openIdConnectUrl; + } + openIdConnectUrl() { + return this._json.openIdConnectUrl; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/security-requirements.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirements5 = class extends Collection4 { + get(id) { + return this.collections.find((securityRequirement) => securityRequirement.meta("id") === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/security-requirement.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecurityRequirement6 = class extends BaseModel3 { + scheme() { + return this._json.scheme; + } + scopes() { + return this._json.scopes || []; + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-trait.js +var OperationTrait6 = class extends CoreModel2 { + id() { + return this.operationId() || this._meta.id; + } + hasOperationId() { + return !!this._meta.id; + } + operationId() { + return this._meta.id; + } + security() { + return (this._json.security || []).map((security4, index4) => { + const scheme = this.createModel(SecurityScheme6, security4, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + const requirement = this.createModel(SecurityRequirement6, { scheme, scopes: security4.scopes }, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + return new SecurityRequirements5([requirement]); + }); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-reply.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/operation-reply-address.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationReplyAddress2 = class extends BaseModel3 { + id() { + return this._meta.id; + } + location() { + return this._json.location; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-reply.js +var OperationReply2 = class extends BaseModel3 { + id() { + return this._meta.id; + } + hasAddress() { + return !!this._json.address; + } + address() { + if (this._json.address) { + return this.createModel(OperationReplyAddress2, this._json.address, { pointer: this.jsonPath("address") }); + } + } + hasChannel() { + return !!this._json.channel; + } + channel() { + if (this._json.channel) { + return this.createModel(Channel6, this._json.channel, { id: "", pointer: this.jsonPath("channel") }); + } + return this._json.channel; + } + messages() { + return new Messages5(Object.entries(this._json.messages || {}).map(([messageName, message]) => { + return this.createModel(Message6, message, { id: messageName, pointer: this.jsonPath(`messages/${messageName}`) }); + })); + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation.js +var Operation6 = class extends OperationTrait6 { + action() { + return this._json.action; + } + isSend() { + return this.action() === "send"; + } + isReceive() { + return this.action() === "receive"; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + const serverData = server.json(); + if (!serversData.includes(serverData)) { + serversData.push(serverData); + servers.push(server); + } + }); + }); + return new Servers5(servers); + } + channels() { + var _a2; + if (this._json.channel) { + for (const [channelName, channel] of Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.channels) || {})) { + if (channel === this._json.channel) { + return new Channels5([ + this.createModel(Channel6, this._json.channel, { id: channelName, pointer: `/channels/${channelName}` }) + ]); + } + } + } + return new Channels5([]); + } + messages() { + const messages = []; + if (Array.isArray(this._json.messages)) { + this._json.messages.forEach((message, index4) => { + messages.push(this.createModel(Message6, message, { id: "", pointer: this.jsonPath(`messages/${index4}`) })); + }); + return new Messages5(messages); + } + this.channels().forEach((channel) => { + messages.push(...channel.messages()); + }); + return new Messages5(messages); + } + hasReply() { + return !!this._json.reply; + } + reply() { + if (this._json.reply) { + return this.createModel(OperationReply2, this._json.reply, { pointer: this.jsonPath("reply") }); + } + } + traits() { + return new OperationTraits5((this._json.traits || []).map((trait, index4) => { + return this.createModel(OperationTrait6, trait, { id: "", pointer: this.jsonPath(`traits/${index4}`) }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message-traits.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageTraits5 = class extends Collection4 { + get(id) { + return this.collections.find((trait) => trait.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message-trait.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/correlation-id.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationId6 = class extends BaseModel3 { + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + hasLocation() { + return !!this._json.location; + } + location() { + return this._json.location; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message-examples.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExamples5 = class extends Collection4 { + get(name2) { + return this.collections.find((example) => example.name() === name2); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message-example.js +init_dirname(); +init_buffer2(); +init_process2(); +var MessageExample5 = class extends BaseModel3 { + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + hasSummary() { + return !!this._json.summary; + } + summary() { + return this._json.summary; + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + return this._json.headers; + } + hasPayload() { + return !!this._json.payload; + } + payload() { + return this._json.payload; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message-trait.js +var MessageTrait6 = class extends CoreModel2 { + id() { + var _a2; + return this._meta.id || ((_a2 = this.extensions().get(xParserMessageName3)) === null || _a2 === void 0 ? void 0 : _a2.value()); + } + hasMessageId() { + return false; + } + hasSchemaFormat() { + return false; + } + schemaFormat() { + return void 0; + } + hasCorrelationId() { + return !!this._json.correlationId; + } + correlationId() { + if (!this._json.correlationId) + return void 0; + return this.createModel(CorrelationId6, this._json.correlationId, { pointer: this.jsonPath("correlationId") }); + } + hasContentType() { + return !!this._json.contentType; + } + contentType() { + var _a2, _b; + return this._json.contentType || ((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.defaultContentType); + } + hasHeaders() { + return !!this._json.headers; + } + headers() { + if (!this._json.headers) + return void 0; + return this.createModel(Schema8, this._json.headers, { pointer: this.jsonPath("headers") }); + } + hasName() { + return !!this._json.name; + } + name() { + return this._json.name; + } + examples() { + return new MessageExamples5((this._json.examples || []).map((example, index4) => { + return this.createModel(MessageExample5, example, { pointer: this.jsonPath(`examples/${index4}`) }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v3/message.js +var Message6 = class extends MessageTrait6 { + hasPayload() { + return !!this._json.payload; + } + payload() { + if (!this._json.payload) + return void 0; + return this.createModel(Schema8, this._json.payload, { pointer: this.jsonPath("payload") }); + } + hasSchemaFormat() { + return this.hasPayload(); + } + schemaFormat() { + var _a2; + if (this.hasSchemaFormat()) { + return (_a2 = this.payload()) === null || _a2 === void 0 ? void 0 : _a2.schemaFormat(); + } + return void 0; + } + servers() { + const servers = []; + const serversData = []; + this.channels().forEach((channel) => { + channel.servers().forEach((server) => { + const serverData = server.json(); + if (!serversData.includes(serverData)) { + serversData.push(serverData); + servers.push(server); + } + }); + }); + return new Servers5(servers); + } + channels() { + var _a2, _b; + const channels = []; + const channelsData = []; + this.operations().forEach((operation) => { + operation.channels().forEach((channel) => { + const channelData = channel.json(); + if (!channelsData.includes(channelData)) { + channelsData.push(channelData); + channels.push(channel); + } + }); + }); + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelId, channelData]) => { + const channelModel = this.createModel(Channel6, channelData, { id: channelId, pointer: `/channels/${channelId}` }); + if (!channelsData.includes(channelData) && channelModel.messages().some((m7) => m7.json() === this._json)) { + channelsData.push(channelData); + channels.push(channelModel); + } + }); + return new Channels5(channels); + } + operations() { + var _a2, _b; + const operations = []; + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.operations) || {}).forEach(([operationId, operation]) => { + const operationModel = this.createModel(Operation6, operation, { id: operationId, pointer: `/operations/${operationId}` }); + if (operationModel.messages().some((m7) => m7.json() === this._json)) { + operations.push(operationModel); + } + }); + return new Operations5(operations); + } + traits() { + return new MessageTraits5((this._json.traits || []).map((trait, index4) => { + return this.createModel(MessageTrait6, trait, { id: "", pointer: this.jsonPath(`traits/${index4}`) }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v3/channel.js +var Channel6 = class extends CoreModel2 { + id() { + return this._meta.id; + } + address() { + return this._json.address; + } + servers() { + var _a2; + const servers = []; + const allowedServers = this._json.servers || []; + Object.entries(((_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed.servers) || {}).forEach(([serverName, server]) => { + if (allowedServers.length === 0 || allowedServers.includes(server)) { + servers.push(this.createModel(Server6, server, { id: serverName, pointer: `/servers/${serverName}` })); + } + }); + return new Servers5(servers); + } + operations() { + var _a2, _b; + const operations = []; + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.operations) || {}).forEach(([operationId, operation]) => { + if (operation.channel === this._json) { + operations.push(this.createModel(Operation6, operation, { id: operationId, pointer: `/operations/${operationId}` })); + } + }); + return new Operations5(operations); + } + messages() { + return new Messages5(Object.entries(this._json.messages || {}).map(([messageName, message]) => { + return this.createModel(Message6, message, { id: messageName, pointer: this.jsonPath(`messages/${messageName}`) }); + })); + } + parameters() { + return new ChannelParameters5(Object.entries(this._json.parameters || {}).map(([channelParameterName, channelParameter]) => { + return this.createModel(ChannelParameter6, channelParameter, { + id: channelParameterName, + pointer: this.jsonPath(`parameters/${channelParameterName}`) + }); + })); + } +}; + +// node_modules/parserapiv2/esm/models/v3/server-variables.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariables5 = class extends Collection4 { + get(id) { + return this.collections.find((variable) => variable.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/server-variable.js +init_dirname(); +init_buffer2(); +init_process2(); +var ServerVariable6 = class extends BaseModel3 { + id() { + return this._meta.id; + } + hasDescription() { + return hasDescription6(this); + } + description() { + return description6(this); + } + hasDefaultValue() { + return !!this._json.default; + } + defaultValue() { + return this._json.default; + } + hasAllowedValues() { + return !!this._json.enum; + } + allowedValues() { + return this._json.enum || []; + } + examples() { + return this._json.examples || []; + } + extensions() { + return extensions5(this); + } +}; + +// node_modules/parserapiv2/esm/models/v3/server.js +var Server6 = class extends CoreModel2 { + id() { + return this._meta.id; + } + url() { + let host = this.host(); + if (!host.endsWith("/")) { + host = `${host}/`; + } + let pathname = this.pathname() || ""; + if (pathname.startsWith("/")) { + pathname = pathname.substring(1); + } + return `${this.protocol()}://${host}${pathname}`; + } + host() { + return this._json.host; + } + protocol() { + return this._json.protocol; + } + hasPathname() { + return !!this._json.pathname; + } + pathname() { + return this._json.pathname; + } + hasProtocolVersion() { + return !!this._json.protocolVersion; + } + protocolVersion() { + return this._json.protocolVersion; + } + channels() { + var _a2, _b; + const channels = []; + Object.entries(((_b = (_a2 = this._meta.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.parsed) === null || _b === void 0 ? void 0 : _b.channels) || {}).forEach(([channelName, channel]) => { + const allowedServers = channel.servers || []; + if (allowedServers.length === 0 || allowedServers.includes(this._json)) { + channels.push(this.createModel(Channel6, channel, { id: channelName, pointer: `/channels/${tilde3(channelName)}` })); + } + }); + return new Channels5(channels); + } + operations() { + const operations = []; + const operationsData = []; + this.channels().forEach((channel) => { + channel.operations().forEach((operation) => { + const operationData = operation.json(); + if (!operationsData.includes(operationData)) { + operations.push(operation); + operationsData.push(operationData); + } + }); + }); + return new Operations5(operations); + } + messages() { + const messages = []; + const messagedData = []; + this.channels().forEach((channel) => { + channel.messages().forEach((message) => { + const messageData = message.json(); + if (!messagedData.includes(messageData)) { + messages.push(message); + messagedData.push(messageData); + } + }); + }); + return new Messages5(messages); + } + variables() { + return new ServerVariables5(Object.entries(this._json.variables || {}).map(([serverVariableName, serverVariable]) => { + return this.createModel(ServerVariable6, serverVariable, { + id: serverVariableName, + pointer: this.jsonPath(`variables/${serverVariableName}`) + }); + })); + } + security() { + return (this._json.security || []).map((security4, index4) => { + const scheme = this.createModel(SecurityScheme6, security4, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + const requirement = this.createModel(SecurityRequirement6, { scheme, scopes: security4.scopes }, { id: "", pointer: this.jsonPath(`security/${index4}`) }); + return new SecurityRequirements5([requirement]); + }); + } +}; + +// node_modules/parserapiv2/esm/models/v3/security-schemes.js +init_dirname(); +init_buffer2(); +init_process2(); +var SecuritySchemes5 = class extends Collection4 { + get(id) { + return this.collections.find((securityScheme) => securityScheme.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/components.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/models/v3/schemas.js +init_dirname(); +init_buffer2(); +init_process2(); +var Schemas5 = class extends Collection4 { + get(id) { + return this.collections.find((schema8) => schema8.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-replies.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationReplies2 = class extends Collection4 { + get(id) { + return this.collections.find((reply) => reply.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/operation-reply-addresses.js +init_dirname(); +init_buffer2(); +init_process2(); +var OperationReplyAddresses2 = class extends Collection4 { + get(id) { + return this.collections.find((reply) => reply.id() === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/correlation-ids.js +init_dirname(); +init_buffer2(); +init_process2(); +var CorrelationIds5 = class extends Collection4 { + get(id) { + return this.collections.find((correlationId) => correlationId.meta("id") === id); + } +}; + +// node_modules/parserapiv2/esm/models/external-documentations.js +init_dirname(); +init_buffer2(); +init_process2(); +var ExternalDocumentations2 = class extends Collection4 { + get(id) { + return this.collections.find((externalDocs7) => externalDocs7.meta("id") === id); + } +}; + +// node_modules/parserapiv2/esm/models/v3/components.js +var Components6 = class extends BaseModel3 { + servers() { + return this.createCollection("servers", Servers5, Server6); + } + channels() { + return this.createCollection("channels", Channels5, Channel6); + } + operations() { + return this.createCollection("operations", Operations5, Operation6); + } + messages() { + return this.createCollection("messages", Messages5, Message6); + } + schemas() { + return this.createCollection("schemas", Schemas5, Schema8); + } + channelParameters() { + return this.createCollection("parameters", ChannelParameters5, ChannelParameter6); + } + serverVariables() { + return this.createCollection("serverVariables", ServerVariables5, ServerVariable6); + } + operationTraits() { + return this.createCollection("operationTraits", OperationTraits5, OperationTrait6); + } + messageTraits() { + return this.createCollection("messageTraits", MessageTraits5, MessageTrait6); + } + replies() { + return this.createCollection("replies", OperationReplies2, OperationReply2); + } + replyAddresses() { + return this.createCollection("replyAddresses", OperationReplyAddresses2, OperationReplyAddress2); + } + correlationIds() { + return this.createCollection("correlationIds", CorrelationIds5, CorrelationId6); + } + securitySchemes() { + return this.createCollection("securitySchemes", SecuritySchemes5, SecurityScheme6); + } + tags() { + return this.createCollection("tags", Tags5, Tag6); + } + externalDocs() { + return this.createCollection("externalDocs", ExternalDocumentations2, ExternalDocumentation5); + } + serverBindings() { + return this.createBindings("serverBindings"); + } + channelBindings() { + return this.createBindings("channelBindings"); + } + operationBindings() { + return this.createBindings("operationBindings"); + } + messageBindings() { + return this.createBindings("messageBindings"); + } + extensions() { + return extensions5(this); + } + isEmpty() { + return Object.keys(this._json).length === 0; + } + createCollection(itemsName, collectionModel, itemModel) { + const collectionItems = []; + Object.entries(this._json[itemsName] || {}).forEach(([id, item]) => { + collectionItems.push(this.createModel(itemModel, item, { id, pointer: `/components/${itemsName}/${tilde3(id)}` })); + }); + return new collectionModel(collectionItems); + } + createBindings(itemsName) { + return Object.entries(this._json[itemsName] || {}).reduce((bindings6, [name2, item]) => { + const bindingsData = item || {}; + const asyncapi = this.meta("asyncapi"); + const pointer = `components/${itemsName}/${name2}`; + bindings6[name2] = new Bindings5(Object.entries(bindingsData).map(([protocol, binding3]) => this.createModel(Binding5, binding3, { protocol, pointer: `${pointer}/${protocol}` })), { originalData: bindingsData, asyncapi, pointer }); + return bindings6; + }, {}); + } +}; + +// node_modules/parserapiv2/esm/models/v3/asyncapi.js +var AsyncAPIDocument7 = class extends BaseModel3 { + version() { + return this._json.asyncapi; + } + defaultContentType() { + return this._json.defaultContentType; + } + hasDefaultContentType() { + return !!this._json.defaultContentType; + } + info() { + return this.createModel(Info6, this._json.info, { pointer: "/info" }); + } + servers() { + return new Servers5(Object.entries(this._json.servers || {}).map(([serverName, server]) => this.createModel(Server6, server, { id: serverName, pointer: `/servers/${tilde3(serverName)}` }))); + } + channels() { + return new Channels5(Object.entries(this._json.channels || {}).map(([channelId, channel]) => this.createModel(Channel6, channel, { id: channelId, pointer: `/channels/${tilde3(channelId)}` }))); + } + operations() { + return new Operations5(Object.entries(this._json.operations || {}).map(([operationId, operation]) => this.createModel(Operation6, operation, { id: operationId, pointer: `/operations/${tilde3(operationId)}` }))); + } + messages() { + const messages = []; + const messagesData = []; + this.channels().forEach((channel) => { + channel.messages().forEach((message) => { + const messageData = message.json(); + if (!messagesData.includes(messageData)) { + messagesData.push(messageData); + messages.push(message); + } + }); + }); + return new Messages5(messages); + } + schemas() { + return this.__schemas(false); + } + securitySchemes() { + var _a2; + return new SecuritySchemes5(Object.entries(((_a2 = this._json.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) || {}).map(([securitySchemeName, securityScheme]) => this.createModel(SecurityScheme6, securityScheme, { id: securitySchemeName, pointer: `/components/securitySchemes/${securitySchemeName}` }))); + } + components() { + return this.createModel(Components6, this._json.components || {}, { pointer: "/components" }); + } + allServers() { + const servers = this.servers().all(); + this.components().servers().forEach((server) => !servers.some((s7) => s7.json() === server.json()) && servers.push(server)); + return new Servers5(servers); + } + allChannels() { + const channels = this.channels().all(); + this.components().channels().forEach((channel) => !channels.some((c7) => c7.json() === channel.json()) && channels.push(channel)); + return new Channels5(channels); + } + allOperations() { + const operations = this.operations().all(); + this.components().operations().forEach((operation) => !operations.some((o7) => o7.json() === operation.json()) && operations.push(operation)); + return new Operations5(operations); + } + allMessages() { + const messages = this.messages().all(); + this.components().messages().forEach((message) => !messages.some((m7) => m7.json() === message.json()) && messages.push(message)); + return new Messages5(messages); + } + allSchemas() { + return this.__schemas(true); + } + extensions() { + return extensions5(this); + } + __schemas(withComponents) { + const schemas5 = /* @__PURE__ */ new Set(); + function callback(schema8) { + if (!schemas5.has(schema8.json())) { + schemas5.add(schema8); + } + } + let toIterate = Object.values(SchemaTypesToIterate4); + if (!withComponents) { + toIterate = toIterate.filter((s7) => s7 !== SchemaTypesToIterate4.Components); + } + traverseAsyncApiDocument4(this, callback, toIterate); + return new Schemas5(Array.from(schemas5)); + } +}; + +// node_modules/parserapiv2/esm/models/asyncapi.js +init_dirname(); +init_buffer2(); +init_process2(); +var ParserAPIVersion2 = 2; + +// node_modules/parserapiv2/esm/stringify.js +init_dirname(); +init_buffer2(); +init_process2(); +function unstringify3(document2) { + let parsed = document2; + if (typeof document2 === "string") { + try { + parsed = JSON.parse(document2); + } catch (_6) { + return; + } + } + if (!isStringifiedDocument3(parsed)) { + return; + } + parsed = Object.assign({}, parsed); + delete parsed[String(xParserSpecStringified3)]; + traverseStringifiedData3(document2, void 0, document2, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return createAsyncAPIDocument3(createDetailedAsyncAPI3(parsed, document2)); +} +function copy3(data) { + const stringifiedData = JSON.stringify(data, refReplacer3()); + const unstringifiedData = JSON.parse(stringifiedData); + traverseStringifiedData3(unstringifiedData, void 0, unstringifiedData, /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()); + return unstringifiedData; +} +function refReplacer3() { + const modelPaths = /* @__PURE__ */ new Map(); + const paths = /* @__PURE__ */ new Map(); + let init2 = null; + return function(field, value2) { + const pathPart = modelPaths.get(this) + (Array.isArray(this) ? `[${field}]` : `.${field}`); + const isComplex = value2 === Object(value2); + if (isComplex) { + modelPaths.set(value2, pathPart); + } + const savedPath = paths.get(value2) || ""; + if (!savedPath && isComplex) { + const valuePath = pathPart.replace(/undefined\.\.?/, ""); + paths.set(value2, valuePath); + } + const prefixPath = savedPath[0] === "[" ? "$" : "$."; + let val = savedPath ? `$ref:${prefixPath}${savedPath}` : value2; + if (init2 === null) { + init2 = value2; + } else if (val === init2) { + val = "$ref:$"; + } + return val; + }; +} +var refRoot3 = "$ref:$"; +function traverseStringifiedData3(parent2, field, root2, objToPath, pathToObj) { + let objOrPath = parent2; + let path2 = refRoot3; + if (field !== void 0) { + objOrPath = parent2[String(field)]; + const concatenatedPath = field ? `.${field}` : ""; + path2 = objToPath.get(parent2) + (Array.isArray(parent2) ? `[${field}]` : concatenatedPath); + } + objToPath.set(objOrPath, path2); + pathToObj.set(path2, objOrPath); + const ref = pathToObj.get(objOrPath); + if (ref) { + parent2[String(field)] = ref; + } + if (objOrPath === refRoot3 || ref === refRoot3) { + parent2[String(field)] = root2; + } + if (objOrPath === Object(objOrPath)) { + for (const f8 in objOrPath) { + traverseStringifiedData3(objOrPath, f8, root2, objToPath, pathToObj); + } + } +} + +// node_modules/parserapiv2/esm/document.js +function createAsyncAPIDocument3(asyncapi) { + switch (asyncapi.semver.major) { + case 2: + return new AsyncAPIDocument6(asyncapi.parsed, { asyncapi, pointer: "/" }); + case 3: + return new AsyncAPIDocument7(asyncapi.parsed, { asyncapi, pointer: "/" }); + default: + throw new Error(`Unsupported AsyncAPI version: ${asyncapi.semver.version}`); + } +} +function toAsyncAPIDocument3(maybeDoc) { + if (isAsyncAPIDocument5(maybeDoc)) { + return maybeDoc; + } + if (!isParsedDocument3(maybeDoc)) { + return unstringify3(maybeDoc); + } + return createAsyncAPIDocument3(createDetailedAsyncAPI3(maybeDoc, maybeDoc)); +} +function isAsyncAPIDocument5(maybeDoc) { + if (!maybeDoc) { + return false; + } + if (maybeDoc instanceof AsyncAPIDocument6 || maybeDoc instanceof AsyncAPIDocument7) { + return true; + } + if (maybeDoc && typeof maybeDoc.json === "function") { + const versionOfParserAPI = maybeDoc.json()[xParserApiVersion3]; + return versionOfParserAPI === 2; + } + return false; +} +function isParsedDocument3(maybeDoc) { + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed3]); +} +function isStringifiedDocument3(maybeDoc) { + try { + maybeDoc = typeof maybeDoc === "string" ? JSON.parse(maybeDoc) : maybeDoc; + if (typeof maybeDoc !== "object" || maybeDoc === null) { + return false; + } + return Boolean(maybeDoc[xParserSpecParsed3]) && Boolean(maybeDoc[xParserSpecStringified3]); + } catch (_6) { + return false; + } +} + +// node_modules/parserapiv2/esm/parse.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/custom-operations/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/custom-operations/apply-traits.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/node_modules/jsonpath-plus/dist/index-browser-esm.js +init_dirname(); +init_buffer2(); +init_process2(); +function _typeof2(obj) { + "@babel/helpers - typeof"; + return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { + return typeof obj2; + } : function(obj2) { + return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }, _typeof2(obj); +} +function _classCallCheck2(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} +function _defineProperties2(target, props) { + for (var i7 = 0; i7 < props.length; i7++) { + var descriptor = props[i7]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) + descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } +} +function _createClass2(Constructor, protoProps, staticProps) { + if (protoProps) + _defineProperties2(Constructor.prototype, protoProps); + if (staticProps) + _defineProperties2(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _inherits2(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) + _setPrototypeOf2(subClass, superClass); +} +function _getPrototypeOf2(o7) { + _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o8) { + return o8.__proto__ || Object.getPrototypeOf(o8); + }; + return _getPrototypeOf2(o7); +} +function _setPrototypeOf2(o7, p7) { + _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o8, p8) { + o8.__proto__ = p8; + return o8; + }; + return _setPrototypeOf2(o7, p7); +} +function _isNativeReflectConstruct2() { + if (typeof Reflect === "undefined" || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if (typeof Proxy === "function") + return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })); + return true; + } catch (e10) { + return false; + } +} +function _construct2(Parent, args, Class) { + if (_isNativeReflectConstruct2()) { + _construct2 = Reflect.construct.bind(); + } else { + _construct2 = function _construct3(Parent2, args2, Class2) { + var a7 = [null]; + a7.push.apply(a7, args2); + var Constructor = Function.bind.apply(Parent2, a7); + var instance = new Constructor(); + if (Class2) + _setPrototypeOf2(instance, Class2.prototype); + return instance; + }; + } + return _construct2.apply(null, arguments); +} +function _isNativeFunction2(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} +function _wrapNativeSuper2(Class) { + var _cache2 = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0; + _wrapNativeSuper2 = function _wrapNativeSuper3(Class2) { + if (Class2 === null || !_isNativeFunction2(Class2)) + return Class2; + if (typeof Class2 !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache2 !== "undefined") { + if (_cache2.has(Class2)) + return _cache2.get(Class2); + _cache2.set(Class2, Wrapper); + } + function Wrapper() { + return _construct2(Class2, arguments, _getPrototypeOf2(this).constructor); + } + Wrapper.prototype = Object.create(Class2.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf2(Wrapper, Class2); + }; + return _wrapNativeSuper2(Class); +} +function _assertThisInitialized2(self2) { + if (self2 === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self2; +} +function _possibleConstructorReturn2(self2, call) { + if (call && (typeof call === "object" || typeof call === "function")) { + return call; + } else if (call !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return _assertThisInitialized2(self2); +} +function _createSuper2(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct2(); + return function _createSuperInternal() { + var Super = _getPrototypeOf2(Derived), result2; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf2(this).constructor; + result2 = Reflect.construct(Super, arguments, NewTarget); + } else { + result2 = Super.apply(this, arguments); + } + return _possibleConstructorReturn2(this, result2); + }; +} +function _toConsumableArray2(arr) { + return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2(); +} +function _arrayWithoutHoles2(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray2(arr); +} +function _iterableToArray2(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) + return Array.from(iter); +} +function _unsupportedIterableToArray2(o7, minLen) { + if (!o7) + return; + if (typeof o7 === "string") + return _arrayLikeToArray2(o7, minLen); + var n7 = Object.prototype.toString.call(o7).slice(8, -1); + if (n7 === "Object" && o7.constructor) + n7 = o7.constructor.name; + if (n7 === "Map" || n7 === "Set") + return Array.from(o7); + if (n7 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n7)) + return _arrayLikeToArray2(o7, minLen); +} +function _arrayLikeToArray2(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i7 = 0, arr2 = new Array(len); i7 < len; i7++) + arr2[i7] = arr[i7]; + return arr2; +} +function _nonIterableSpread2() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _createForOfIteratorHelper2(o7, allowArrayLike) { + var it2 = typeof Symbol !== "undefined" && o7[Symbol.iterator] || o7["@@iterator"]; + if (!it2) { + if (Array.isArray(o7) || (it2 = _unsupportedIterableToArray2(o7)) || allowArrayLike && o7 && typeof o7.length === "number") { + if (it2) + o7 = it2; + var i7 = 0; + var F6 = function() { + }; + return { + s: F6, + n: function() { + if (i7 >= o7.length) + return { + done: true + }; + return { + done: false, + value: o7[i7++] + }; + }, + e: function(e10) { + throw e10; + }, + f: F6 + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, didErr = false, err; + return { + s: function() { + it2 = it2.call(o7); + }, + n: function() { + var step = it2.next(); + normalCompletion = step.done; + return step; + }, + e: function(e10) { + didErr = true; + err = e10; + }, + f: function() { + try { + if (!normalCompletion && it2.return != null) + it2.return(); + } finally { + if (didErr) + throw err; + } + } + }; +} +var hasOwnProp2 = Object.prototype.hasOwnProperty; +function push3(arr, item) { + arr = arr.slice(); + arr.push(item); + return arr; +} +function unshift3(item, arr) { + arr = arr.slice(); + arr.unshift(item); + return arr; +} +var NewError3 = /* @__PURE__ */ function(_Error) { + _inherits2(NewError4, _Error); + var _super = _createSuper2(NewError4); + function NewError4(value2) { + var _this; + _classCallCheck2(this, NewError4); + _this = _super.call(this, 'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'); + _this.avoidNew = true; + _this.value = value2; + _this.name = "NewError"; + return _this; + } + return _createClass2(NewError4); +}(/* @__PURE__ */ _wrapNativeSuper2(Error)); +function JSONPath3(opts, expr, obj, callback, otherTypeCallback) { + if (!(this instanceof JSONPath3)) { + try { + return new JSONPath3(opts, expr, obj, callback, otherTypeCallback); + } catch (e10) { + if (!e10.avoidNew) { + throw e10; + } + return e10.value; + } + } + if (typeof opts === "string") { + otherTypeCallback = callback; + callback = obj; + obj = expr; + expr = opts; + opts = null; + } + var optObj = opts && _typeof2(opts) === "object"; + opts = opts || {}; + this.json = opts.json || obj; + this.path = opts.path || expr; + this.resultType = opts.resultType || "value"; + this.flatten = opts.flatten || false; + this.wrap = hasOwnProp2.call(opts, "wrap") ? opts.wrap : true; + this.sandbox = opts.sandbox || {}; + this.preventEval = opts.preventEval || false; + this.parent = opts.parent || null; + this.parentProperty = opts.parentProperty || null; + this.callback = opts.callback || callback || null; + this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function() { + throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator."); + }; + if (opts.autostart !== false) { + var args = { + path: optObj ? opts.path : expr + }; + if (!optObj) { + args.json = obj; + } else if ("json" in opts) { + args.json = opts.json; + } + var ret = this.evaluate(args); + if (!ret || _typeof2(ret) !== "object") { + throw new NewError3(ret); + } + return ret; + } +} +JSONPath3.prototype.evaluate = function(expr, json2, callback, otherTypeCallback) { + var _this2 = this; + var currParent = this.parent, currParentProperty = this.parentProperty; + var flatten2 = this.flatten, wrap2 = this.wrap; + this.currResultType = this.resultType; + this.currPreventEval = this.preventEval; + this.currSandbox = this.sandbox; + callback = callback || this.callback; + this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback; + json2 = json2 || this.json; + expr = expr || this.path; + if (expr && _typeof2(expr) === "object" && !Array.isArray(expr)) { + if (!expr.path && expr.path !== "") { + throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().'); + } + if (!hasOwnProp2.call(expr, "json")) { + throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().'); + } + var _expr = expr; + json2 = _expr.json; + flatten2 = hasOwnProp2.call(expr, "flatten") ? expr.flatten : flatten2; + this.currResultType = hasOwnProp2.call(expr, "resultType") ? expr.resultType : this.currResultType; + this.currSandbox = hasOwnProp2.call(expr, "sandbox") ? expr.sandbox : this.currSandbox; + wrap2 = hasOwnProp2.call(expr, "wrap") ? expr.wrap : wrap2; + this.currPreventEval = hasOwnProp2.call(expr, "preventEval") ? expr.preventEval : this.currPreventEval; + callback = hasOwnProp2.call(expr, "callback") ? expr.callback : callback; + this.currOtherTypeCallback = hasOwnProp2.call(expr, "otherTypeCallback") ? expr.otherTypeCallback : this.currOtherTypeCallback; + currParent = hasOwnProp2.call(expr, "parent") ? expr.parent : currParent; + currParentProperty = hasOwnProp2.call(expr, "parentProperty") ? expr.parentProperty : currParentProperty; + expr = expr.path; + } + currParent = currParent || null; + currParentProperty = currParentProperty || null; + if (Array.isArray(expr)) { + expr = JSONPath3.toPathString(expr); + } + if (!expr && expr !== "" || !json2) { + return void 0; + } + var exprList = JSONPath3.toPathArray(expr); + if (exprList[0] === "$" && exprList.length > 1) { + exprList.shift(); + } + this._hasParentSelector = null; + var result2 = this._trace(exprList, json2, ["$"], currParent, currParentProperty, callback).filter(function(ea) { + return ea && !ea.isParentSelector; + }); + if (!result2.length) { + return wrap2 ? [] : void 0; + } + if (!wrap2 && result2.length === 1 && !result2[0].hasArrExpr) { + return this._getPreferredOutput(result2[0]); + } + return result2.reduce(function(rslt, ea) { + var valOrPath = _this2._getPreferredOutput(ea); + if (flatten2 && Array.isArray(valOrPath)) { + rslt = rslt.concat(valOrPath); + } else { + rslt.push(valOrPath); + } + return rslt; + }, []); +}; +JSONPath3.prototype._getPreferredOutput = function(ea) { + var resultType = this.currResultType; + switch (resultType) { + case "all": { + var path2 = Array.isArray(ea.path) ? ea.path : JSONPath3.toPathArray(ea.path); + ea.pointer = JSONPath3.toPointer(path2); + ea.path = typeof ea.path === "string" ? ea.path : JSONPath3.toPathString(ea.path); + return ea; + } + case "value": + case "parent": + case "parentProperty": + return ea[resultType]; + case "path": + return JSONPath3.toPathString(ea[resultType]); + case "pointer": + return JSONPath3.toPointer(ea.path); + default: + throw new TypeError("Unknown result type"); + } +}; +JSONPath3.prototype._handleCallback = function(fullRetObj, callback, type3) { + if (callback) { + var preferredOutput = this._getPreferredOutput(fullRetObj); + fullRetObj.path = typeof fullRetObj.path === "string" ? fullRetObj.path : JSONPath3.toPathString(fullRetObj.path); + callback(preferredOutput, type3, fullRetObj); + } +}; +JSONPath3.prototype._trace = function(expr, val, path2, parent2, parentPropName, callback, hasArrExpr, literalPriority) { + var _this3 = this; + var retObj; + if (!expr.length) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName, + hasArrExpr + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + var loc = expr[0], x7 = expr.slice(1); + var ret = []; + function addRet(elems) { + if (Array.isArray(elems)) { + elems.forEach(function(t9) { + ret.push(t9); + }); + } else { + ret.push(elems); + } + } + if ((typeof loc !== "string" || literalPriority) && val && hasOwnProp2.call(val, loc)) { + addRet(this._trace(x7, val[loc], push3(path2, loc), val, loc, callback, hasArrExpr)); + } else if (loc === "*") { + this._walk(val, function(m7) { + addRet(_this3._trace(x7, val[m7], push3(path2, m7), val, m7, callback, true, true)); + }); + } else if (loc === "..") { + addRet(this._trace(x7, val, path2, parent2, parentPropName, callback, hasArrExpr)); + this._walk(val, function(m7) { + if (_typeof2(val[m7]) === "object") { + addRet(_this3._trace(expr.slice(), val[m7], push3(path2, m7), val, m7, callback, true)); + } + }); + } else if (loc === "^") { + this._hasParentSelector = true; + return { + path: path2.slice(0, -1), + expr: x7, + isParentSelector: true + }; + } else if (loc === "~") { + retObj = { + path: push3(path2, loc), + value: parentPropName, + parent: parent2, + parentProperty: null + }; + this._handleCallback(retObj, callback, "property"); + return retObj; + } else if (loc === "$") { + addRet(this._trace(x7, val, path2, null, null, callback, hasArrExpr)); + } else if (/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(loc)) { + addRet(this._slice(loc, x7, val, path2, parent2, parentPropName, callback)); + } else if (loc.indexOf("?(") === 0) { + if (this.currPreventEval) { + throw new Error("Eval [?(expr)] prevented in JSONPath expression."); + } + var safeLoc = loc.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/, "$1"); + this._walk(val, function(m7) { + if (_this3._eval(safeLoc, val[m7], m7, path2, parent2, parentPropName)) { + addRet(_this3._trace(x7, val[m7], push3(path2, m7), val, m7, callback, true)); + } + }); + } else if (loc[0] === "(") { + if (this.currPreventEval) { + throw new Error("Eval [(expr)] prevented in JSONPath expression."); + } + addRet(this._trace(unshift3(this._eval(loc, val, path2[path2.length - 1], path2.slice(0, -1), parent2, parentPropName), x7), val, path2, parent2, parentPropName, callback, hasArrExpr)); + } else if (loc[0] === "@") { + var addType = false; + var valueType = loc.slice(1, -2); + switch (valueType) { + case "scalar": + if (!val || !["object", "function"].includes(_typeof2(val))) { + addType = true; + } + break; + case "boolean": + case "string": + case "undefined": + case "function": + if (_typeof2(val) === valueType) { + addType = true; + } + break; + case "integer": + if (Number.isFinite(val) && !(val % 1)) { + addType = true; + } + break; + case "number": + if (Number.isFinite(val)) { + addType = true; + } + break; + case "nonFinite": + if (typeof val === "number" && !Number.isFinite(val)) { + addType = true; + } + break; + case "object": + if (val && _typeof2(val) === valueType) { + addType = true; + } + break; + case "array": + if (Array.isArray(val)) { + addType = true; + } + break; + case "other": + addType = this.currOtherTypeCallback(val, path2, parent2, parentPropName); + break; + case "null": + if (val === null) { + addType = true; + } + break; + default: + throw new TypeError("Unknown value type " + valueType); + } + if (addType) { + retObj = { + path: path2, + value: val, + parent: parent2, + parentProperty: parentPropName + }; + this._handleCallback(retObj, callback, "value"); + return retObj; + } + } else if (loc[0] === "`" && val && hasOwnProp2.call(val, loc.slice(1))) { + var locProp = loc.slice(1); + addRet(this._trace(x7, val[locProp], push3(path2, locProp), val, locProp, callback, hasArrExpr, true)); + } else if (loc.includes(",")) { + var parts = loc.split(","); + var _iterator = _createForOfIteratorHelper2(parts), _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done; ) { + var part = _step.value; + addRet(this._trace(unshift3(part, x7), val, path2, parent2, parentPropName, callback, true)); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } else if (!literalPriority && val && hasOwnProp2.call(val, loc)) { + addRet(this._trace(x7, val[loc], push3(path2, loc), val, loc, callback, hasArrExpr, true)); + } + if (this._hasParentSelector) { + for (var t8 = 0; t8 < ret.length; t8++) { + var rett = ret[t8]; + if (rett && rett.isParentSelector) { + var tmp = this._trace(rett.expr, val, rett.path, parent2, parentPropName, callback, hasArrExpr); + if (Array.isArray(tmp)) { + ret[t8] = tmp[0]; + var tl = tmp.length; + for (var tt3 = 1; tt3 < tl; tt3++) { + t8++; + ret.splice(t8, 0, tmp[tt3]); + } + } else { + ret[t8] = tmp; + } + } + } + } + return ret; +}; +JSONPath3.prototype._walk = function(val, f8) { + if (Array.isArray(val)) { + var n7 = val.length; + for (var i7 = 0; i7 < n7; i7++) { + f8(i7); + } + } else if (val && _typeof2(val) === "object") { + Object.keys(val).forEach(function(m7) { + f8(m7); + }); + } +}; +JSONPath3.prototype._slice = function(loc, expr, val, path2, parent2, parentPropName, callback) { + if (!Array.isArray(val)) { + return void 0; + } + var len = val.length, parts = loc.split(":"), step = parts[2] && Number.parseInt(parts[2]) || 1; + var start = parts[0] && Number.parseInt(parts[0]) || 0, end = parts[1] && Number.parseInt(parts[1]) || len; + start = start < 0 ? Math.max(0, start + len) : Math.min(len, start); + end = end < 0 ? Math.max(0, end + len) : Math.min(len, end); + var ret = []; + for (var i7 = start; i7 < end; i7 += step) { + var tmp = this._trace(unshift3(i7, expr), val, path2, parent2, parentPropName, callback, true); + tmp.forEach(function(t8) { + ret.push(t8); + }); + } + return ret; +}; +JSONPath3.prototype._eval = function(code, _v, _vname, path2, parent2, parentPropName) { + this.currSandbox._$_parentProperty = parentPropName; + this.currSandbox._$_parent = parent2; + this.currSandbox._$_property = _vname; + this.currSandbox._$_root = this.json; + this.currSandbox._$_v = _v; + var containsPath = code.includes("@path"); + if (containsPath) { + this.currSandbox._$_path = JSONPath3.toPathString(path2.concat([_vname])); + } + var scriptCacheKey = "script:" + code; + if (!JSONPath3.cache[scriptCacheKey]) { + var script = code.replace(/@parentProperty/g, "_$_parentProperty").replace(/@parent/g, "_$_parent").replace(/@property/g, "_$_property").replace(/@root/g, "_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g, "_$_v$1"); + if (containsPath) { + script = script.replace(/@path/g, "_$_path"); + } + JSONPath3.cache[scriptCacheKey] = new this.vm.Script(script); + } + try { + return JSONPath3.cache[scriptCacheKey].runInNewContext(this.currSandbox); + } catch (e10) { + throw new Error("jsonPath: " + e10.message + ": " + code); + } +}; +JSONPath3.cache = {}; +JSONPath3.toPathString = function(pathArr) { + var x7 = pathArr, n7 = x7.length; + var p7 = "$"; + for (var i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x7[i7])) { + p7 += /^[\*0-9]+$/.test(x7[i7]) ? "[" + x7[i7] + "]" : "['" + x7[i7] + "']"; + } + } + return p7; +}; +JSONPath3.toPointer = function(pointer) { + var x7 = pointer, n7 = x7.length; + var p7 = ""; + for (var i7 = 1; i7 < n7; i7++) { + if (!/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(x7[i7])) { + p7 += "/" + x7[i7].toString().replace(/~/g, "~0").replace(/\//g, "~1"); + } + } + return p7; +}; +JSONPath3.toPathArray = function(expr) { + var cache = JSONPath3.cache; + if (cache[expr]) { + return cache[expr].concat(); + } + var subx = []; + var normalized = expr.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g, ";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g, function($0, $1) { + return "[#" + (subx.push($1) - 1) + "]"; + }).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g, function($0, prop) { + return "['" + prop.replace(/\./g, "%@%").replace(/~/g, "%%@@%%") + "']"; + }).replace(/~/g, ";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g, ";").replace(/%@%/g, ".").replace(/%%@@%%/g, "~").replace(/(?:;)?(\^+)(?:;)?/g, function($0, ups) { + return ";" + ups.split("").join(";") + ";"; + }).replace(/;;;|;;/g, ";..;").replace(/;$|'?\]|'$/g, ""); + var exprList = normalized.split(";").map(function(exp) { + var match = exp.match(/#([0-9]+)/); + return !match || !match[1] ? exp : subx[match[1]]; + }); + cache[expr] = exprList; + return cache[expr].concat(); +}; +var moveToAnotherArray4 = function moveToAnotherArray5(source, target, conditionCb) { + var il = source.length; + for (var i7 = 0; i7 < il; i7++) { + var item = source[i7]; + if (conditionCb(item)) { + target.push(source.splice(i7--, 1)[0]); + } + } +}; +var Script4 = /* @__PURE__ */ function() { + function Script7(expr) { + _classCallCheck2(this, Script7); + this.code = expr; + } + _createClass2(Script7, [{ + key: "runInNewContext", + value: function runInNewContext2(context2) { + var expr = this.code; + var keys2 = Object.keys(context2); + var funcs = []; + moveToAnotherArray4(keys2, funcs, function(key) { + return typeof context2[key] === "function"; + }); + var values2 = keys2.map(function(vr, i7) { + return context2[vr]; + }); + var funcString = funcs.reduce(function(s7, func) { + var fString = context2[func].toString(); + if (!/function/.test(fString)) { + fString = "function " + fString; + } + return "var " + func + "=" + fString + ";" + s7; + }, ""); + expr = funcString + expr; + if (!/(["'])use strict\1/.test(expr) && !keys2.includes("arguments")) { + expr = "var arguments = undefined;" + expr; + } + expr = expr.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/, ""); + var lastStatementEnd = expr.lastIndexOf(";"); + var code = lastStatementEnd > -1 ? expr.slice(0, lastStatementEnd + 1) + " return " + expr.slice(lastStatementEnd + 1) : " return " + expr; + return _construct2(Function, keys2.concat([code])).apply(void 0, _toConsumableArray2(values2)); + } + }]); + return Script7; +}(); +JSONPath3.prototype.vm = { + Script: Script4 +}; + +// node_modules/parserapiv2/esm/custom-operations/apply-traits.js +var v2TraitPaths3 = [ + // operations + "$.channels.*.[publish,subscribe]", + "$.components.channels.*.[publish,subscribe]", + // messages + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" +]; +function applyTraitsV23(asyncapi) { + applyAllTraitsV22(asyncapi, v2TraitPaths3); +} +function applyAllTraitsV22(asyncapi, paths) { + const visited = /* @__PURE__ */ new Set(); + paths.forEach((path2) => { + JSONPath3({ + path: path2, + json: asyncapi, + resultType: "value", + callback(value2) { + if (visited.has(value2)) { + return; + } + visited.add(value2); + applyTraitsToObjectV22(value2); + } + }); + }); +} +function applyTraitsToObjectV22(value2) { + if (Array.isArray(value2.traits)) { + for (const trait of value2.traits) { + for (const key in trait) { + value2[String(key)] = mergePatch3(value2[String(key)], trait[String(key)]); + } + } + } +} +var v3TraitPaths2 = [ + // operations + "$.operations.*", + "$.components.operations.*", + // messages + "$.channels.*.messages.*", + "$.operations.*.messages.*", + "$.components.channels.*.messages.*", + "$.components.operations.*.messages.*", + "$.components.messages.*" +]; +function applyTraitsV32(asyncapi) { + applyAllTraitsV32(asyncapi, v3TraitPaths2); +} +function applyAllTraitsV32(asyncapi, paths) { + const visited = /* @__PURE__ */ new Set(); + paths.forEach((path2) => { + JSONPath3({ + path: path2, + json: asyncapi, + resultType: "value", + callback(value2) { + if (visited.has(value2)) { + return; + } + visited.add(value2); + applyTraitsToObjectV32(value2); + } + }); + }); +} +function applyTraitsToObjectV32(value2) { + if (!Array.isArray(value2.traits)) { + return; + } + const copy4 = Object.assign({}, value2); + for (const key in value2) { + delete value2[key]; + } + for (const trait of [...copy4.traits, copy4]) { + for (const key in trait) { + value2[String(key)] = mergePatch3(value2[String(key)], trait[String(key)]); + } + } +} + +// node_modules/parserapiv2/esm/custom-operations/resolve-circular-refs.js +init_dirname(); +init_buffer2(); +init_process2(); +function resolveCircularRefs3(document2, inventory) { + const documentJson = document2.json(); + const ctx = { document: documentJson, hasCircular: false, inventory, visited: /* @__PURE__ */ new Set() }; + traverse3(documentJson, [], null, "", ctx); + if (ctx.hasCircular) { + setExtension3(xParserCircular3, true, document2); + } +} +function traverse3(data, path2, parent2, property2, ctx) { + if (typeof data !== "object" || !data || ctx.visited.has(data)) { + return; + } + ctx.visited.add(data); + if (Array.isArray(data)) { + data.forEach((item, idx) => traverse3(item, [...path2, idx], data, idx, ctx)); + } + if ("$ref" in data) { + ctx.hasCircular = true; + const resolvedRef = retrieveCircularRef3(data, path2, ctx); + if (resolvedRef) { + parent2[property2] = resolvedRef; + } + } else { + for (const p7 in data) { + traverse3(data[p7], [...path2, p7], data, p7, ctx); + } + } + ctx.visited.delete(data); +} +function retrieveCircularRef3(data, path2, ctx) { + const $refPath = toJSONPathArray3(data.$ref); + const item = ctx.inventory.findAssociatedItemForPath(path2, true); + if (item === null) { + return retrieveDeepData3(ctx.document, $refPath); + } + if (item) { + const subArrayIndex = findSubArrayIndex3(path2, $refPath); + let dataPath; + if (subArrayIndex === -1) { + dataPath = [...path2.slice(0, path2.length - item.path.length), ...$refPath]; + } else { + dataPath = path2.slice(0, subArrayIndex + $refPath.length); + } + return retrieveDeepData3(ctx.document, dataPath); + } +} + +// node_modules/parserapiv2/esm/custom-operations/parse-schema.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter34 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var customSchemasPathsV23 = [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" +]; +var customSchemasPathsV32 = [ + // channels + "$.channels.*.messages.*.payload", + "$.channels.*.messages.*.headers", + "$.components.channels.*.messages.*.payload", + "$.components.channels.*.messages.*.headers", + // operations + "$.operations.*.messages.*.payload", + "$.operations.*.messages.*.headers", + "$.components.operations.*.messages.*.payload", + "$.components.operations.*.messages.*.headers", + // messages + "$.components.messages.*.payload", + "$.components.messages.*.headers.*", + // schemas + "$.components.schemas.*" +]; +function parseSchemasV23(parser3, detailed) { + return __awaiter34(this, void 0, void 0, function* () { + const defaultSchemaFormat = getDefaultSchemaFormat3(detailed.semver.version); + const parseItems = []; + const visited = /* @__PURE__ */ new Set(); + customSchemasPathsV23.forEach((path2) => { + JSONPath3({ + path: path2, + json: detailed.parsed, + resultType: "all", + callback(result2) { + const value2 = result2.value; + if (visited.has(value2)) { + return; + } + visited.add(value2); + const payload = value2.payload; + if (!payload) { + return; + } + const schemaFormat = getSchemaFormat3(value2.schemaFormat, detailed.semver.version); + parseItems.push({ + input: { + asyncapi: detailed, + data: payload, + meta: { + message: value2 + }, + path: [...splitPath6(result2.path), "payload"], + schemaFormat, + defaultSchemaFormat + }, + value: value2 + }); + } + }); + }); + return Promise.all(parseItems.map((item) => parseSchemaV23(parser3, item))); + }); +} +function parseSchemasV32(parser3, detailed) { + return __awaiter34(this, void 0, void 0, function* () { + const defaultSchemaFormat = getDefaultSchemaFormat3(detailed.semver.version); + const parseItems = []; + const visited = /* @__PURE__ */ new Set(); + customSchemasPathsV32.forEach((path2) => { + JSONPath3({ + path: path2, + json: detailed.parsed, + resultType: "all", + callback(result2) { + const value2 = result2.value; + if (visited.has(value2)) { + return; + } + visited.add(value2); + const schema8 = value2.schema; + if (!schema8) { + return; + } + let schemaFormat = value2.schemaFormat; + if (!schemaFormat) { + return; + } + schemaFormat = getSchemaFormat3(value2.schemaFormat, detailed.semver.version); + parseItems.push({ + input: { + asyncapi: detailed, + data: schema8, + meta: { + message: value2 + }, + path: [...splitPath6(result2.path), "schema"], + schemaFormat, + defaultSchemaFormat + }, + value: value2 + }); + } + }); + }); + return Promise.all(parseItems.map((item) => parseSchemaV32(parser3, item))); + }); +} +function parseSchemaV32(parser3, item) { + var _a2; + return __awaiter34(this, void 0, void 0, function* () { + const originalData = item.input.data; + const parsedData = yield parseSchema3(parser3, item.input); + if (((_a2 = item.value) === null || _a2 === void 0 ? void 0 : _a2.schema) !== void 0) { + item.value.schema = parsedData; + } else { + item.value = parsedData; + } + if (originalData !== parsedData) { + item.value[xParserOriginalPayload3] = originalData; + } + }); +} +function parseSchemaV23(parser3, item) { + return __awaiter34(this, void 0, void 0, function* () { + const originalData = item.input.data; + const parsedData = item.value.payload = yield parseSchema3(parser3, item.input); + if (originalData !== parsedData) { + item.value[xParserOriginalPayload3] = originalData; + } + }); +} +function splitPath6(path2) { + return path2.slice(3).slice(0, -2).split("']['"); +} + +// node_modules/parserapiv2/esm/custom-operations/anonymous-naming.js +init_dirname(); +init_buffer2(); +init_process2(); +function anonymousNaming3(document2) { + assignNameToComponentMessages3(document2); + assignNameToAnonymousMessages3(document2); + assignUidToComponentSchemas3(document2); + assignUidToComponentParameterSchemas3(document2); + assignUidToChannelParameterSchemas3(document2); + assignUidToAnonymousSchemas3(document2); +} +function assignNameToComponentMessages3(document2) { + document2.components().messages().forEach((message) => { + if (message.name() === void 0) { + setExtension3(xParserMessageName3, message.id(), message); + } + }); +} +function assignNameToAnonymousMessages3(document2) { + let anonymousMessageCounter = 0; + document2.messages().forEach((message) => { + var _a2; + if (message.name() === void 0 && ((_a2 = message.extensions().get(xParserMessageName3)) === null || _a2 === void 0 ? void 0 : _a2.value()) === void 0) { + setExtension3(xParserMessageName3, message.id() || ``, message); + } + }); +} +function assignUidToComponentParameterSchemas3(document2) { + document2.components().channelParameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension3(xParserSchemaId3, parameter.id(), schema8); + } + }); +} +function assignUidToChannelParameterSchemas3(document2) { + document2.channels().forEach((channel) => { + channel.parameters().forEach((parameter) => { + const schema8 = parameter.schema(); + if (schema8 && !schema8.id()) { + setExtension3(xParserSchemaId3, parameter.id(), schema8); + } + }); + }); +} +function assignUidToComponentSchemas3(document2) { + document2.components().schemas().forEach((schema8) => { + setExtension3(xParserSchemaId3, schema8.id(), schema8); + }); +} +function assignUidToAnonymousSchemas3(doc) { + let anonymousSchemaCounter = 0; + function callback(schema8) { + const json2 = schema8.json(); + const isMultiFormatSchema = json2.schema !== void 0; + const underlyingSchema = isMultiFormatSchema ? json2.schema : json2; + if (!schema8.id()) { + setExtensionOnJson2(xParserSchemaId3, ``, underlyingSchema); + } + } + traverseAsyncApiDocument4(doc, callback); +} + +// node_modules/parserapiv2/esm/custom-operations/check-circular-refs.js +init_dirname(); +init_buffer2(); +init_process2(); +function checkCircularRefs2(document2) { + if (hasInlineRef2(document2.json())) { + setExtension3(xParserCircular3, true, document2); + } +} +function hasInlineRef2(data) { + if (data && typeof data === "object" && !Array.isArray(data)) { + if (Object.prototype.hasOwnProperty.call(data, "$ref")) { + return true; + } + for (const p7 in data) { + if (hasInlineRef2(data[p7])) { + return true; + } + } + } + return false; +} + +// node_modules/parserapiv2/esm/custom-operations/index.js +var __awaiter35 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function customOperations3(parser3, document2, detailed, inventory, options) { + return __awaiter35(this, void 0, void 0, function* () { + switch (detailed.semver.major) { + case 2: + return operationsV23(parser3, document2, detailed, inventory, options); + case 3: + return operationsV32(parser3, document2, detailed, inventory, options); + } + }); +} +function operationsV23(parser3, document2, detailed, inventory, options) { + return __awaiter35(this, void 0, void 0, function* () { + checkCircularRefs2(document2); + if (options.applyTraits) { + applyTraitsV23(detailed.parsed); + } + if (options.parseSchemas) { + yield parseSchemasV23(parser3, detailed); + } + if (inventory) { + resolveCircularRefs3(document2, inventory); + } + anonymousNaming3(document2); + }); +} +function operationsV32(parser3, document2, detailed, inventory, options) { + return __awaiter35(this, void 0, void 0, function* () { + checkCircularRefs2(document2); + if (options.applyTraits) { + applyTraitsV32(detailed.parsed); + } + if (options.parseSchemas) { + yield parseSchemasV32(parser3, detailed); + } + if (inventory) { + resolveCircularRefs3(document2, inventory); + } + anonymousNaming3(document2); + }); +} + +// node_modules/parserapiv2/esm/validate.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core61 = __toESM(require_dist11()); +var import_spectral_parsers3 = __toESM(require_dist4()); + +// node_modules/parserapiv2/esm/spectral.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core60 = __toESM(require_dist11()); + +// node_modules/parserapiv2/esm/ruleset/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/ruleset/ruleset.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions18 = __toESM(require_dist14()); + +// node_modules/parserapiv2/esm/ruleset/functions/documentStructure.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs11 = __toESM(require_specs()); +var import_spectral_core43 = __toESM(require_dist11()); +var import_spectral_functions16 = __toESM(require_dist14()); + +// node_modules/parserapiv2/esm/ruleset/formats.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_specs10 = __toESM(require_specs()); +var Formats3 = class _Formats extends Map { + filterByMajorVersions(majorsToInclude) { + return new _Formats([...this.entries()].filter((element) => { + return majorsToInclude.includes(element[0].split(".")[0]); + })); + } + excludeByVersions(versionsToExclude) { + return new _Formats([...this.entries()].filter((element) => { + return !versionsToExclude.includes(element[0]); + })); + } + find(version5) { + return this.get(formatVersion3(version5)); + } + formats() { + return [...this.values()]; + } +}; +var AsyncAPIFormats3 = new Formats3(Object.entries(import_specs10.schemas).reverse().map(([version5]) => [version5, createFormat3(version5)])); +function isAsyncAPIVersion3(versionToMatch, document2) { + const asyncAPIDoc = document2; + if (!asyncAPIDoc) + return false; + const documentVersion = String(asyncAPIDoc.asyncapi); + return isObject7(document2) && "asyncapi" in document2 && assertValidAsyncAPIVersion3(documentVersion) && versionToMatch === formatVersion3(documentVersion); +} +function assertValidAsyncAPIVersion3(documentVersion) { + const semver = getSemver3(documentVersion); + const regexp = new RegExp(`^(${semver.major})\\.(${semver.minor})\\.(0|[1-9][0-9]*)$`); + return regexp.test(documentVersion); +} +function createFormat3(version5) { + const format5 = (document2) => isAsyncAPIVersion3(version5, document2); + const semver = getSemver3(version5); + format5.displayName = `AsyncAPI ${semver.major}.${semver.minor}.x`; + return format5; +} +var formatVersion3 = function(version5) { + const versionSemver = getSemver3(version5); + return `${versionSemver.major}.${versionSemver.minor}.0`; +}; + +// node_modules/parserapiv2/esm/ruleset/functions/documentStructure.js +function shouldIgnoreError3(error2) { + return ( + // oneOf is a fairly error as we have 2 options to choose from for most of the time. + error2.keyword === "oneOf" || // the required $ref is entirely useless, since aas-schema rules operate on resolved content, so there won't be any $refs in the document + error2.keyword === "required" && error2.params.missingProperty === "$ref" + ); +} +function prepareResults3(errors) { + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (error2.keyword === "additionalProperties") { + error2.instancePath = `${error2.instancePath}/${String(error2.params["additionalProperty"])}`; + } else if (error2.keyword === "required" && error2.params.missingProperty === "$ref") { + errors.splice(i7, 1); + i7--; + } + } + for (let i7 = 0; i7 < errors.length; i7++) { + const error2 = errors[i7]; + if (i7 + 1 < errors.length && errors[i7 + 1].instancePath === error2.instancePath) { + errors.splice(i7 + 1, 1); + i7--; + } else if (i7 > 0 && shouldIgnoreError3(error2) && errors[i7 - 1].instancePath.startsWith(error2.instancePath)) { + errors.splice(i7, 1); + i7--; + } + } +} +function prepareV3ResolvedSchema2(copied) { + const channelObject = copied.definitions["http://asyncapi.com/definitions/3.0.0/channel.json"]; + channelObject.properties.servers.items.$ref = "http://asyncapi.com/definitions/3.0.0/server.json"; + const operationSchema = copied.definitions["http://asyncapi.com/definitions/3.0.0/operation.json"]; + operationSchema.properties.channel.$ref = "http://asyncapi.com/definitions/3.0.0/channel.json"; + operationSchema.properties.messages.items.$ref = "http://asyncapi.com/definitions/3.0.0/messageObject.json"; + const operationReplySchema = copied.definitions["http://asyncapi.com/definitions/3.0.0/operationReply.json"]; + operationReplySchema.properties.channel.$ref = "http://asyncapi.com/definitions/3.0.0/channel.json"; + operationReplySchema.properties.messages.items.$ref = "http://asyncapi.com/definitions/3.0.0/messageObject.json"; + return copied; +} +function getCopyOfSchema3(version5) { + return JSON.parse(JSON.stringify(import_specs11.default.schemas[version5])); +} +var serializedSchemas3 = /* @__PURE__ */ new Map(); +function getSerializedSchema3(version5, resolved) { + const serializedSchemaKey = resolved ? `${version5}-resolved` : `${version5}-unresolved`; + const schema8 = serializedSchemas3.get(serializedSchemaKey); + if (schema8) { + return schema8; + } + let copied = getCopyOfSchema3(version5); + delete copied.definitions["http://json-schema.org/draft-07/schema"]; + delete copied.definitions["http://json-schema.org/draft-04/schema"]; + copied["$id"] = copied["$id"].replace("asyncapi.json", `asyncapi-${resolved ? "resolved" : "unresolved"}.json`); + const { major } = getSemver3(version5); + if (resolved && major === 3) { + copied = prepareV3ResolvedSchema2(copied); + } + serializedSchemas3.set(serializedSchemaKey, copied); + return copied; +} +var refErrorMessage3 = 'Property "$ref" is not expected to be here'; +function filterRefErrors3(errors, resolved) { + if (resolved) { + return errors.filter((err) => err.message !== refErrorMessage3); + } + return errors.filter((err) => err.message === refErrorMessage3).map((err) => { + err.message = "Referencing in this place is not allowed"; + return err; + }); +} +function getSchema3(docFormats, resolved) { + for (const [version5, format5] of AsyncAPIFormats3) { + if (docFormats.has(format5)) { + return getSerializedSchema3(version5, resolved); + } + } +} +var documentStructure3 = (0, import_spectral_core43.createRulesetFunction)({ + input: null, + options: { + type: "object", + properties: { + resolved: { + type: "boolean" + } + }, + required: ["resolved"] + } +}, (targetVal, options, context2) => { + var _a2; + const formats = (_a2 = context2.document) === null || _a2 === void 0 ? void 0 : _a2.formats; + if (!formats) { + return; + } + const resolved = options.resolved; + const schema8 = getSchema3(formats, resolved); + if (!schema8) { + return; + } + const errors = (0, import_spectral_functions16.schema)(targetVal, { allErrors: true, schema: schema8, prepareResults: resolved ? prepareResults3 : void 0 }, context2); + if (!Array.isArray(errors)) { + return; + } + return filterRefErrors3(errors, resolved); +}); + +// node_modules/parserapiv2/esm/ruleset/functions/internal.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core44 = __toESM(require_dist11()); +var internal3 = (0, import_spectral_core44.createRulesetFunction)({ + input: null, + options: null +}, (_6, __, { document: document2, documentInventory }) => { + document2.__documentInventory = documentInventory; +}); + +// node_modules/parserapiv2/esm/ruleset/functions/isAsyncAPIDocument.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core45 = __toESM(require_dist11()); +var isAsyncAPIDocument6 = (0, import_spectral_core45.createRulesetFunction)({ + input: null, + options: null +}, (targetVal) => { + if (!isObject7(targetVal) || typeof targetVal.asyncapi !== "string") { + return [ + { + message: 'This is not an AsyncAPI document. The "asyncapi" field as string is missing.', + path: [] + } + ]; + } + if (!specVersions3.includes(targetVal.asyncapi)) { + return [ + { + message: `Version "${targetVal.asyncapi}" is not supported. Please use "${lastVersion3}" (latest) version of the specification.`, + path: [] + } + ]; + } +}); + +// node_modules/parserapiv2/esm/ruleset/functions/unusedComponent.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions17 = __toESM(require_dist14()); +var import_spectral_core46 = __toESM(require_dist11()); +var unusedComponent3 = (0, import_spectral_core46.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null +}, (targetVal, _6, context2) => { + const components = targetVal.components; + const results = []; + Object.keys(components).forEach((componentType) => { + if (componentType === "securitySchemes") { + return; + } + const value2 = components[componentType]; + if (!isObject7(value2)) { + return; + } + const resultsForType = (0, import_spectral_functions17.unreferencedReusableObject)(value2, { reusableObjectsLocation: `#/components/${componentType}` }, context2); + if (resultsForType && Array.isArray(resultsForType)) { + results.push(...resultsForType); + } + }); + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/ruleset.js +var coreRuleset3 = { + description: "Core AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats3.formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-is-asyncapi": { + description: "The input must be a document with a supported version of AsyncAPI.", + formats: [() => true], + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: isAsyncAPIDocument6 + } + }, + "asyncapi-latest-version": { + description: "Checking if the AsyncAPI document is using the latest version.", + message: `The latest version of AsyncAPi is not used. It is recommended update to the "${lastVersion3}" version.`, + recommended: true, + severity: "info", + given: "$.asyncapi", + then: { + function: import_spectral_functions18.schema, + functionOptions: { + schema: { + const: lastVersion3 + } + } + } + }, + "asyncapi-document-resolved": { + description: "Checking if the AsyncAPI document has valid resolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: documentStructure3, + functionOptions: { + resolved: true + } + } + }, + "asyncapi-document-unresolved": { + description: "Checking if the AsyncAPI document has valid unresolved structure.", + message: "{{error}}", + severity: "error", + recommended: true, + resolved: false, + given: "$", + then: { + function: documentStructure3, + functionOptions: { + resolved: false + } + } + }, + "asyncapi-internal": { + description: "That rule is internal to extend Spectral functionality for Parser purposes.", + recommended: true, + given: "$", + then: { + function: internal3 + } + } + } +}; +var recommendedRuleset3 = { + description: "Recommended AsyncAPI x.x.x ruleset.", + formats: AsyncAPIFormats3.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi-id": { + description: 'AsyncAPI document should have "id" field.', + recommended: true, + given: "$", + then: { + field: "id", + function: import_spectral_functions18.truthy + } + }, + "asyncapi-defaultContentType": { + description: 'AsyncAPI document should have "defaultContentType" field.', + recommended: true, + given: "$", + then: { + field: "defaultContentType", + function: import_spectral_functions18.truthy + } + }, + /** + * Info Object rules + */ + "asyncapi-info-description": { + description: 'Info "description" should be present and non-empty string.', + recommended: true, + given: "$", + then: { + field: "info.description", + function: import_spectral_functions18.truthy + } + }, + "asyncapi-info-contact": { + description: 'Info object should have "contact" object.', + recommended: true, + given: "$", + then: { + field: "info.contact", + function: import_spectral_functions18.truthy + } + }, + "asyncapi-info-contact-properties": { + description: 'Contact object should have "name", "url" and "email" fields.', + recommended: true, + given: "$.info.contact", + then: [ + { + field: "name", + function: import_spectral_functions18.truthy + }, + { + field: "url", + function: import_spectral_functions18.truthy + }, + { + field: "email", + function: import_spectral_functions18.truthy + } + ] + }, + "asyncapi-info-license": { + description: 'Info object should have "license" object.', + recommended: true, + given: "$", + then: { + field: "info.license", + function: import_spectral_functions18.truthy + } + }, + "asyncapi-info-license-url": { + description: 'License object should have "url" field.', + recommended: false, + given: "$", + then: { + field: "info.license.url", + function: import_spectral_functions18.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi-servers": { + description: 'AsyncAPI document should have non-empty "servers" object.', + recommended: true, + given: "$", + then: { + field: "servers", + function: import_spectral_functions18.schema, + functionOptions: { + schema: { + type: "object", + minProperties: 1 + }, + allErrors: true + } + } + }, + /** + * Component Object rules + */ + "asyncapi-unused-component": { + description: "Potentially unused component has been detected in AsyncAPI document.", + formats: AsyncAPIFormats3.filterByMajorVersions(["2"]).formats(), + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedComponent3 + } + } + } +}; + +// node_modules/parserapiv2/esm/ruleset/v2/ruleset.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_functions22 = __toESM(require_dist14()); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/channelParameters.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core47 = __toESM(require_dist11()); + +// node_modules/parserapiv2/esm/ruleset/utils/getMissingProps.js +init_dirname(); +init_buffer2(); +init_process2(); +function getMissingProps3(arr = [], obj = {}) { + if (!Object.keys(obj).length) + return arr; + return arr.filter((val) => { + return !Object.prototype.hasOwnProperty.call(obj, val); + }); +} + +// node_modules/parserapiv2/esm/ruleset/utils/getRedundantProps.js +init_dirname(); +init_buffer2(); +init_process2(); +function getRedundantProps3(arr = [], obj = {}) { + if (!arr.length) + return Object.keys(obj); + return Object.keys(obj).filter((val) => { + return !arr.includes(val); + }); +} + +// node_modules/parserapiv2/esm/ruleset/utils/mergeTraits.js +init_dirname(); +init_buffer2(); +init_process2(); +init_index_es2(); +function mergeTraits3(data) { + if (Array.isArray(data.traits)) { + data = Object.assign({}, data); + for (const trait of data.traits) { + for (const key in trait) { + data[key] = merge6(data[key], trait[key]); + } + } + } + return data; +} +function merge6(origin, patch) { + if (!w(patch)) { + return patch; + } + const result2 = !w(origin) ? {} : Object.assign({}, origin); + Object.keys(patch).forEach((key) => { + const patchVal = patch[key]; + if (patchVal === null) { + delete result2[key]; + } else { + result2[key] = merge6(result2[key], patchVal); + } + }); + return result2; +} + +// node_modules/parserapiv2/esm/ruleset/utils/parseUrlVariables.js +init_dirname(); +init_buffer2(); +init_process2(); +function parseUrlVariables3(str2) { + if (typeof str2 !== "string") + return []; + const variables = str2.match(/{(.+?)}/g); + if (!variables || variables.length === 0) + return []; + return variables.map((v8) => v8.slice(1, -1)); +} + +// node_modules/parserapiv2/esm/ruleset/v2/functions/channelParameters.js +var channelParameters3 = (0, import_spectral_core47.createRulesetFunction)({ + input: { + type: "object", + properties: { + parameters: { + type: "object" + } + }, + required: ["parameters"] + }, + options: null +}, (targetVal, _6, ctx) => { + const path2 = ctx.path[ctx.path.length - 1]; + const results = []; + const parameters = parseUrlVariables3(path2); + if (parameters.length === 0) + return; + const missingParameters = getMissingProps3(parameters, targetVal.parameters); + if (missingParameters.length) { + results.push({ + message: `Not all channel's parameters are described with "parameters" object. Missed: ${missingParameters.join(", ")}.`, + path: [...ctx.path, "parameters"] + }); + } + const redundantParameters = getRedundantProps3(parameters, targetVal.parameters); + if (redundantParameters.length) { + redundantParameters.forEach((param) => { + results.push({ + message: `Channel's "parameters" object has redundant defined "${param}" parameter.`, + path: [...ctx.path, "parameters", param] + }); + }); + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/channelServers.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core48 = __toESM(require_dist11()); +var channelServers3 = (0, import_spectral_core48.createRulesetFunction)({ + input: { + type: "object", + properties: { + servers: { + type: "object" + }, + channels: { + type: "object", + additionalProperties: { + type: "object", + properties: { + servers: { + type: "array", + items: { + type: "string" + } + } + } + } + } + } + }, + options: null +}, (targetVal) => { + var _a2, _b; + const results = []; + if (!targetVal.channels) + return results; + const serverNames = Object.keys((_a2 = targetVal.servers) !== null && _a2 !== void 0 ? _a2 : {}); + Object.entries((_b = targetVal.channels) !== null && _b !== void 0 ? _b : {}).forEach(([channelAddress, channel]) => { + if (!channel.servers) + return; + channel.servers.forEach((serverName, index4) => { + if (!serverNames.includes(serverName)) { + results.push({ + message: 'Channel contains server that are not defined on the "servers" object.', + path: ["channels", channelAddress, "servers", index4] + }); + } + }); + }); + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/checkId.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core49 = __toESM(require_dist11()); +var import_spectral_functions19 = __toESM(require_dist14()); +var checkId3 = (0, import_spectral_core49.createRulesetFunction)({ + input: { + type: "object", + properties: { + traits: { + type: "array", + items: { + type: "object" + } + } + } + }, + options: { + type: "object", + properties: { + idField: { + type: "string", + enum: ["operationId", "messageId"] + } + } + } +}, (targetVal, options, ctx) => { + const mergedValue = mergeTraits3(targetVal); + return (0, import_spectral_functions19.truthy)(mergedValue[options.idField], null, ctx); +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/messageExamples.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core50 = __toESM(require_dist11()); +var import_spectral_functions20 = __toESM(require_dist14()); +function serializeSchema3(schema8, type3) { + if (!schema8 && typeof schema8 !== "boolean") { + if (type3 === "headers") { + schema8 = { type: "object" }; + } else { + schema8 = {}; + } + } else if (typeof schema8 === "boolean") { + if (schema8 === true) { + schema8 = {}; + } else { + schema8 = { not: {} }; + } + } + return schema8; +} +function getMessageExamples3(message) { + var _a2; + if (!Array.isArray(message.examples)) { + return []; + } + return (_a2 = message.examples.map((example, index4) => { + return { + path: ["examples", index4], + value: example + }; + })) !== null && _a2 !== void 0 ? _a2 : []; +} +function validate7(value2, path2, type3, schema8, ctx) { + return (0, import_spectral_functions20.schema)(value2, { + allErrors: true, + schema: schema8 + }, Object.assign(Object.assign({}, ctx), { path: [...ctx.path, ...path2, type3] })); +} +var messageExamples3 = (0, import_spectral_core50.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null +}, (targetVal, _6, ctx) => { + if (!targetVal.examples) + return; + const results = []; + const payloadSchema = serializeSchema3(targetVal.payload, "payload"); + const headersSchema = serializeSchema3(targetVal.headers, "headers"); + for (const example of getMessageExamples3(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0) { + const errors = validate7(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + if (value2.headers !== void 0) { + const errors = validate7(value2.headers, path2, "headers", headersSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/messageExamples-spectral-rule-v2.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core51 = __toESM(require_dist11()); +var __awaiter36 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function asyncApi2MessageExamplesParserRule3(parser3) { + return { + description: "Examples of message object should validate against a payload with an explicit schemaFormat.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message[?(@property === 'message' && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages[?(!@null && @.schemaFormat !== void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat !== void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat !== void 0)]" + ], + then: { + function: rulesetFunction5(parser3) + } + }; +} +function rulesetFunction5(parser3) { + return (0, import_spectral_core51.createRulesetFunction)({ + input: { + type: "object", + properties: { + name: { + type: "string" + }, + summary: { + type: "string" + } + } + }, + options: null + }, (targetVal, _6, ctx) => __awaiter36(this, void 0, void 0, function* () { + if (!targetVal.examples) + return; + if (!targetVal.payload) + return; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat3(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat3(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI3(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + rootPath: ctx.path, + schemaFormat, + defaultSchemaFormat + }; + const results = []; + const payloadSchemaResults = yield parseExampleSchema3(parser3, targetVal.payload, input); + const payloadSchema = payloadSchemaResults.schema; + results.push(...payloadSchemaResults.errors); + for (const example of getMessageExamples3(targetVal)) { + const { path: path2, value: value2 } = example; + if (value2.payload !== void 0 && payloadSchema !== void 0) { + const errors = validate7(value2.payload, path2, "payload", payloadSchema, ctx); + if (Array.isArray(errors)) { + results.push(...errors); + } + } + } + return results; + })); +} +function parseExampleSchema3(parser3, schema8, input) { + return __awaiter36(this, void 0, void 0, function* () { + const path2 = [...input.rootPath, "payload"]; + if (schema8 === void 0) { + return { path: path2, schema: void 0, errors: [] }; + } + try { + const parseSchemaInput = { + asyncapi: input.asyncapi, + data: schema8, + meta: {}, + path: path2, + schemaFormat: input.schemaFormat, + defaultSchemaFormat: input.defaultSchemaFormat + }; + const parsedSchema = yield parseSchema3(parser3, parseSchemaInput); + return { path: path2, schema: parsedSchema, errors: [] }; + } catch (err) { + const error2 = { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + }; + return { path: path2, schema: void 0, errors: [error2] }; + } + }); +} + +// node_modules/parserapiv2/esm/ruleset/v2/functions/messageIdUniqueness.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core52 = __toESM(require_dist11()); + +// node_modules/parserapiv2/esm/ruleset/v2/utils/getAllMessages.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/parserapiv2/esm/ruleset/v2/utils/getAllOperations.js +init_dirname(); +init_buffer2(); +init_process2(); +function* getAllOperations3(asyncapi) { + const channels = asyncapi === null || asyncapi === void 0 ? void 0 : asyncapi.channels; + if (!isObject7(channels)) { + return {}; + } + for (const [channelAddress, channel] of Object.entries(channels)) { + if (!isObject7(channel)) { + continue; + } + if (isObject7(channel.subscribe)) { + yield { + path: ["channels", channelAddress, "subscribe"], + kind: "subscribe", + operation: channel.subscribe + }; + } + if (isObject7(channel.publish)) { + yield { + path: ["channels", channelAddress, "publish"], + kind: "publish", + operation: channel.publish + }; + } + } +} + +// node_modules/parserapiv2/esm/ruleset/v2/utils/getAllMessages.js +function* getAllMessages3(asyncapi) { + for (const { path: path2, operation } of getAllOperations3(asyncapi)) { + if (!isObject7(operation)) { + continue; + } + const maybeMessage = operation.message; + if (!isObject7(maybeMessage)) { + continue; + } + const oneOf = maybeMessage.oneOf; + if (Array.isArray(oneOf)) { + for (const [index4, message] of oneOf.entries()) { + if (isObject7(message)) { + yield { + path: [...path2, "message", "oneOf", index4], + message + }; + } + } + } else { + yield { + path: [...path2, "message"], + message: maybeMessage + }; + } + } +} + +// node_modules/parserapiv2/esm/ruleset/v2/functions/messageIdUniqueness.js +function retrieveMessageId3(message) { + if (Array.isArray(message.traits)) { + for (let i7 = message.traits.length - 1; i7 >= 0; i7--) { + const trait = message.traits[i7]; + if (isObject7(trait) && typeof trait.messageId === "string") { + return { + messageId: trait.messageId, + path: ["traits", i7, "messageId"] + }; + } + } + } + if (typeof message.messageId === "string") { + return { + messageId: message.messageId, + path: ["messageId"] + }; + } + return void 0; +} +var messageIdUniqueness3 = (0, import_spectral_core52.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + }, + publish: { + type: "object", + properties: { + message: { + oneOf: [ + { type: "object" }, + { + type: "object", + properties: { + oneOf: { + type: "array" + } + } + } + ] + } + } + } + } + } + } + }, + options: null +}, (targetVal) => { + const results = []; + const messages = getAllMessages3(targetVal); + const seenIds = []; + for (const { path: path2, message } of messages) { + const maybeMessageId = retrieveMessageId3(message); + if (maybeMessageId === void 0) { + continue; + } + if (seenIds.includes(maybeMessageId.messageId)) { + results.push({ + message: '"messageId" must be unique across all the messages.', + path: [...path2, ...maybeMessageId.path] + }); + } else { + seenIds.push(maybeMessageId.messageId); + } + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/operationIdUniqueness.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core53 = __toESM(require_dist11()); +function retrieveOperationId3(operation) { + if (Array.isArray(operation.traits)) { + for (let i7 = operation.traits.length - 1; i7 >= 0; i7--) { + const trait = operation.traits[i7]; + if (isObject7(trait) && typeof trait.operationId === "string") { + return { + operationId: trait.operationId, + path: ["traits", i7, "operationId"] + }; + } + } + } + if (typeof operation.operationId === "string") { + return { + operationId: operation.operationId, + path: ["operationId"] + }; + } + return void 0; +} +var operationIdUniqueness3 = (0, import_spectral_core53.createRulesetFunction)({ + input: { + type: "object", + properties: { + channels: { + type: "object", + properties: { + subscribe: { + type: "object" + }, + publish: { + type: "object" + } + } + } + } + }, + options: null +}, (targetVal) => { + const results = []; + const operations = getAllOperations3(targetVal); + const seenIds = []; + for (const { path: path2, operation } of operations) { + const maybeOperationId = retrieveOperationId3(operation); + if (maybeOperationId === void 0) { + continue; + } + if (seenIds.includes(maybeOperationId.operationId)) { + results.push({ + message: '"operationId" must be unique across all the operations.', + path: [...path2, ...maybeOperationId.path] + }); + } else { + seenIds.push(maybeOperationId.operationId); + } + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/schemaValidation.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core54 = __toESM(require_dist11()); +var import_spectral_functions21 = __toESM(require_dist14()); +function getRelevantItems3(target, type3) { + if (type3 === "default") { + return [{ path: ["default"], value: target.default }]; + } + if (!Array.isArray(target.examples)) { + return []; + } + return Array.from(target.examples.entries()).map(([key, value2]) => ({ + path: ["examples", key], + value: value2 + })); +} +var schemaValidation3 = (0, import_spectral_core54.createRulesetFunction)({ + input: { + type: "object", + properties: { + default: {}, + examples: { + type: "array" + } + }, + errorMessage: '#{{print("property")}must be an object containing "default" or an "examples" array' + }, + errorOnInvalidInput: true, + options: { + type: "object", + properties: { + type: { + enum: ["default", "examples"] + } + }, + additionalProperties: false, + required: ["type"] + } +}, (targetVal, opts, context2) => { + const schemaObject = targetVal; + const results = []; + for (const relevantItem of getRelevantItems3(targetVal, opts.type)) { + const result2 = (0, import_spectral_functions21.schema)(relevantItem.value, { + schema: schemaObject, + allErrors: true + }, Object.assign(Object.assign({}, context2), { path: [...context2.path, ...relevantItem.path] })); + if (Array.isArray(result2)) { + results.push(...result2); + } + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/security.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core55 = __toESM(require_dist11()); +var oAuth2Keys3 = ["implicit", "password", "clientCredentials", "authorizationCode"]; +function getAllScopes3(oauth2) { + const scopes = []; + oAuth2Keys3.forEach((key) => { + const flow2 = oauth2[key]; + if (isObject7(flow2)) { + scopes.push(...Object.keys(flow2.scopes)); + } + }); + return Array.from(new Set(scopes)); +} +var security3 = (0, import_spectral_core55.createRulesetFunction)({ + input: { + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string" + } + } + }, + options: { + type: "object", + properties: { + objectType: { + type: "string", + enum: ["Server", "Operation"] + } + } + } +}, (targetVal = {}, { objectType: objectType2 }, ctx) => { + var _a2, _b; + const results = []; + const spec = ctx.document.data; + const securitySchemes = (_b = (_a2 = spec === null || spec === void 0 ? void 0 : spec.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes) !== null && _b !== void 0 ? _b : {}; + const securitySchemesKeys = Object.keys(securitySchemes); + Object.keys(targetVal).forEach((securityKey) => { + var _a3; + if (!securitySchemesKeys.includes(securityKey)) { + results.push({ + message: `${objectType2} must not reference an undefined security scheme.`, + path: [...ctx.path, securityKey] + }); + } + const securityScheme = securitySchemes[securityKey]; + if ((securityScheme === null || securityScheme === void 0 ? void 0 : securityScheme.type) === "oauth2") { + const availableScopes = getAllScopes3((_a3 = securityScheme.flows) !== null && _a3 !== void 0 ? _a3 : {}); + targetVal[securityKey].forEach((securityScope, index4) => { + if (!availableScopes.includes(securityScope)) { + results.push({ + message: `Non-existing security scope for the specified security scheme. Available: [${availableScopes.join(", ")}]`, + path: [...ctx.path, securityKey, index4] + }); + } + }); + } + }); + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/serverVariables.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core56 = __toESM(require_dist11()); +var serverVariables3 = (0, import_spectral_core56.createRulesetFunction)({ + input: { + type: "object", + properties: { + url: { + type: "string" + }, + variables: { + type: "object" + } + }, + required: ["url", "variables"] + }, + options: null +}, (targetVal, _6, ctx) => { + const results = []; + const variables = parseUrlVariables3(targetVal.url); + if (variables.length === 0) + return results; + const missingVariables = getMissingProps3(variables, targetVal.variables); + if (missingVariables.length) { + results.push({ + message: `Not all server's variables are described with "variables" object. Missed: ${missingVariables.join(", ")}.`, + path: [...ctx.path, "variables"] + }); + } + const redundantVariables = getRedundantProps3(variables, targetVal.variables); + if (redundantVariables.length) { + redundantVariables.forEach((variable) => { + results.push({ + message: `Server's "variables" object has redundant defined "${variable}" url variable.`, + path: [...ctx.path, "variables", variable] + }); + }); + } + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/v2/functions/unusedSecuritySchemes.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core57 = __toESM(require_dist11()); +var unusedSecuritySchemes3 = (0, import_spectral_core57.createRulesetFunction)({ + input: { + type: "object", + properties: { + components: { + type: "object" + } + }, + required: ["components"] + }, + options: null +}, (targetVal) => { + var _a2; + const securitySchemes = (_a2 = targetVal.components) === null || _a2 === void 0 ? void 0 : _a2.securitySchemes; + if (!isObject7(securitySchemes)) { + return; + } + const usedSecuritySchemes = []; + if (isObject7(targetVal.servers)) { + Object.values(targetVal.servers).forEach((server) => { + if (Array.isArray(server.security)) { + server.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + }); + } + const operations = getAllOperations3(targetVal); + for (const { operation } of operations) { + if (Array.isArray(operation.security)) { + operation.security.forEach((requirements) => { + usedSecuritySchemes.push(...Object.keys(requirements)); + }); + } + } + const usedSecuritySchemesSet = new Set(usedSecuritySchemes); + const securitySchemesKinds = Object.keys(securitySchemes); + const results = []; + securitySchemesKinds.forEach((securitySchemeKind) => { + if (!usedSecuritySchemesSet.has(securitySchemeKind)) { + results.push({ + message: "Potentially unused security scheme has been detected in AsyncAPI document.", + path: ["components", "securitySchemes", securitySchemeKind] + }); + } + }); + return results; +}); + +// node_modules/parserapiv2/esm/ruleset/functions/uniquenessTags.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core58 = __toESM(require_dist11()); +function getDuplicateTagsIndexes3(tags6) { + return tags6.map((item) => item.name).reduce((acc, item, i7, arr) => { + if (arr.indexOf(item) !== i7) { + acc.push(i7); + } + return acc; + }, []); +} +var uniquenessTags3 = (0, import_spectral_core58.createRulesetFunction)({ + input: { + type: "array", + items: { + type: "object", + properties: { + name: { + type: "string" + } + }, + required: ["name"] + } + }, + options: null +}, (targetVal, _6, ctx) => { + const duplicatedTags = getDuplicateTagsIndexes3(targetVal); + if (duplicatedTags.length === 0) { + return []; + } + const results = []; + for (const duplicatedIndex of duplicatedTags) { + const duplicatedTag = targetVal[duplicatedIndex].name; + results.push({ + message: `"tags" object contains duplicate tag name "${duplicatedTag}".`, + path: [...ctx.path, duplicatedIndex, "name"] + }); + } + return results; +}); + +// node_modules/parserapiv2/esm/schema-parser/spectral-rule-v2.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_core59 = __toESM(require_dist11()); +var __awaiter37 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function asyncApi2SchemaParserRule3(parser3) { + return { + description: "Custom schema must be correctly formatted from the point of view of the used format.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // operations + "$.channels.*.[publish,subscribe].message", + "$.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.channels.*.[publish,subscribe].message", + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + // messages + "$.components.messages.*" + ], + then: { + function: rulesetFunction6(parser3) + } + }; +} +function rulesetFunction6(parser3) { + return (0, import_spectral_core59.createRulesetFunction)({ + input: { + type: "object", + properties: { + schemaFormat: { + type: "string" + }, + payload: true + // any value + } + }, + options: null + }, (targetVal = {}, _6, ctx) => __awaiter37(this, void 0, void 0, function* () { + if (!targetVal.payload) { + return []; + } + const path2 = [...ctx.path, "payload"]; + const document2 = ctx.document; + const parsedSpec = document2.data; + const schemaFormat = getSchemaFormat3(targetVal.schemaFormat, parsedSpec.asyncapi); + const defaultSchemaFormat = getDefaultSchemaFormat3(parsedSpec.asyncapi); + const asyncapi = createDetailedAsyncAPI3(parsedSpec, document2.__parserInput, document2.source || void 0); + const input = { + asyncapi, + data: targetVal.payload, + meta: {}, + path: path2, + schemaFormat, + defaultSchemaFormat + }; + try { + return yield validateSchema3(parser3, input); + } catch (err) { + return [ + { + message: `Error thrown during schema validation. Name: ${err.name}, message: ${err.message}, stack: ${err.stack}`, + path: path2 + } + ]; + } + })); +} + +// node_modules/parserapiv2/esm/ruleset/v2/ruleset.js +var v2CoreRuleset3 = { + description: "Core AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats3.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Server Object rules + */ + "asyncapi2-server-security": { + description: "Server have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.servers.*.security.*", + then: { + function: security3, + functionOptions: { + objectType: "Server" + } + } + }, + "asyncapi2-server-variables": { + description: "Server variables must be defined and there must be no redundant variables.", + message: "{{error}}", + severity: "error", + recommended: true, + given: ["$.servers.*", "$.components.servers.*"], + then: { + function: serverVariables3 + } + }, + "asyncapi2-channel-no-query-nor-fragment": { + description: 'Channel address should not include query ("?") or fragment ("#") delimiter.', + severity: "error", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions22.pattern, + functionOptions: { + notMatch: "[\\?#]" + } + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-parameters": { + description: "Channel parameters must be defined and there must be no redundant parameters.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels.*", + then: { + function: channelParameters3 + } + }, + "asyncapi2-channel-servers": { + description: 'Channel servers must be defined in the "servers" object.', + message: "{{error}}", + severity: "error", + recommended: true, + given: "$", + then: { + function: channelServers3 + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId-uniqueness": { + description: '"operationId" must be unique across all the operations.', + severity: "error", + recommended: true, + given: "$", + then: { + function: operationIdUniqueness3 + } + }, + "asyncapi2-operation-security": { + description: "Operation have to reference a defined security schemes.", + message: "{{error}}", + severity: "error", + recommended: true, + given: "$.channels[*][publish,subscribe].security.*", + then: { + function: security3, + functionOptions: { + objectType: "Operation" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-examples": { + description: 'Examples of message object should validate againt the "payload" and "headers" schemas.', + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // messages + "$.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages[?(!@null && @.schemaFormat === void 0)]", + // message traits + "$.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messages.*.traits[?(!@null && @.schemaFormat === void 0)]", + "$.components.messageTraits[?(!@null && @.schemaFormat === void 0)]" + ], + then: { + function: messageExamples3 + } + }, + "asyncapi2-message-messageId-uniqueness": { + description: '"messageId" must be unique across all the messages.', + severity: "error", + recommended: true, + given: "$", + then: { + function: messageIdUniqueness3 + } + }, + /** + * Misc rules + */ + "asyncapi2-tags-uniqueness": { + description: "Each tag must have a unique name.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + // root + "$.tags", + // operations + "$.channels.*.[publish,subscribe].tags", + "$.components.channels.*.[publish,subscribe].tags", + // operation traits + "$.channels.*.[publish,subscribe].traits.*.tags", + "$.components.channels.*.[publish,subscribe].traits.*.tags", + "$.components.operationTraits.*.tags", + // messages + "$.channels.*.[publish,subscribe].message.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.channels.*.[publish,subscribe].message.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.tags", + "$.components.messages.*.tags", + // message traits + "$.channels.*.[publish,subscribe].message.traits.*.tags", + "$.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.traits.*.tags", + "$.components.channels.*.[publish,subscribe].message.oneOf.*.traits.*.tags", + "$.components.messages.*.traits.*.tags", + "$.components.messageTraits.*.tags" + ], + then: { + function: uniquenessTags3 + } + } + } +}; +var v2SchemasRuleset3 = (parser3) => { + return { + description: "Schemas AsyncAPI 2.x.x ruleset.", + rules: { + "asyncapi2-schemas": asyncApi2SchemaParserRule3(parser3), + "asyncapi2-schema-default": { + description: "Default must be valid against its defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.channels.*.parameters.*.schema.default^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.default^", + "$.components.channels.*.parameters.*.schema.default^", + "$.components.schemas.*.default^", + "$.components.parameters.*.schema.default^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.default^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.default^" + ], + then: { + function: schemaValidation3, + functionOptions: { + type: "default" + } + } + }, + "asyncapi2-schema-examples": { + description: "Examples must be valid against their defined schema.", + message: "{{error}}", + severity: "error", + recommended: true, + given: [ + "$.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.channels.*.parameters.*.schema.examples^", + "$.components.channels[*][publish,subscribe][?(@property === 'message' && @.schemaFormat === void 0)].payload.examples^", + "$.components.channels.*.parameters.*.schema.examples^", + "$.components.schemas.*.examples^", + "$.components.parameters.*.schema.examples^", + "$.components.messages[?(@.schemaFormat === void 0)].payload.examples^", + "$.components.messageTraits[?(@.schemaFormat === void 0)].payload.examples^" + ], + then: { + function: schemaValidation3, + functionOptions: { + type: "examples" + } + } + }, + "asyncapi2-message-examples-custom-format": asyncApi2MessageExamplesParserRule3(parser3) + } + }; +}; +var v2RecommendedRuleset3 = { + description: "Recommended AsyncAPI 2.x.x ruleset.", + formats: AsyncAPIFormats3.filterByMajorVersions(["2"]).formats(), + rules: { + /** + * Root Object rules + */ + "asyncapi2-tags": { + description: 'AsyncAPI object should have non-empty "tags" array.', + recommended: true, + given: "$", + then: { + field: "tags", + function: import_spectral_functions22.truthy + } + }, + /** + * Server Object rules + */ + "asyncapi2-server-no-empty-variable": { + description: "Server URL should not have empty variable substitution pattern.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions22.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-server-no-trailing-slash": { + description: "Server URL should not end with slash.", + recommended: true, + given: "$.servers[*].url", + then: { + function: import_spectral_functions22.pattern, + functionOptions: { + notMatch: "/$" + } + } + }, + /** + * Channel Object rules + */ + "asyncapi2-channel-no-empty-parameter": { + description: "Channel address should not have empty parameter substitution pattern.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions22.pattern, + functionOptions: { + notMatch: "{}" + } + } + }, + "asyncapi2-channel-no-trailing-slash": { + description: "Channel address should not end with slash.", + recommended: true, + given: "$.channels", + then: { + field: "@key", + function: import_spectral_functions22.pattern, + functionOptions: { + notMatch: ".+\\/$" + } + } + }, + /** + * Operation Object rules + */ + "asyncapi2-operation-operationId": { + description: 'Operation should have an "operationId" field defined.', + recommended: true, + given: ["$.channels[*][publish,subscribe]", "$.components.channels[*][publish,subscribe]"], + then: { + function: checkId3, + functionOptions: { + idField: "operationId" + } + } + }, + /** + * Message Object rules + */ + "asyncapi2-message-messageId": { + description: 'Message should have a "messageId" field defined.', + recommended: true, + formats: AsyncAPIFormats3.filterByMajorVersions(["2"]).excludeByVersions(["2.0.0", "2.1.0", "2.2.0", "2.3.0"]).formats(), + given: [ + '$.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.channels.*.[publish,subscribe].message.oneOf.*", + '$.components.channels.*.[publish,subscribe][?(@property === "message" && @.oneOf == void 0)]', + "$.components.channels.*.[publish,subscribe].message.oneOf.*", + "$.components.messages.*" + ], + then: { + function: checkId3, + functionOptions: { + idField: "messageId" + } + } + }, + /** + * Component Object rules + */ + "asyncapi2-unused-securityScheme": { + description: "Potentially unused security scheme has been detected in AsyncAPI document.", + recommended: true, + resolved: false, + severity: "info", + given: "$", + then: { + function: unusedSecuritySchemes3 + } + } + } +}; + +// node_modules/parserapiv2/esm/ruleset/index.js +var __rest12 = function(s7, e10) { + var t8 = {}; + for (var p7 in s7) + if (Object.prototype.hasOwnProperty.call(s7, p7) && e10.indexOf(p7) < 0) + t8[p7] = s7[p7]; + if (s7 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i7 = 0, p7 = Object.getOwnPropertySymbols(s7); i7 < p7.length; i7++) { + if (e10.indexOf(p7[i7]) < 0 && Object.prototype.propertyIsEnumerable.call(s7, p7[i7])) + t8[p7[i7]] = s7[p7[i7]]; + } + return t8; +}; +function createRuleset3(parser3, options) { + var _a2; + const _b = options || {}, { core: useCore = true, recommended: useRecommended = true } = _b, rest2 = __rest12(_b, ["core", "recommended"]); + const extendedRuleset = [ + useCore && coreRuleset3, + useRecommended && recommendedRuleset3, + useCore && v2CoreRuleset3, + useCore && v2SchemasRuleset3(parser3), + useRecommended && v2RecommendedRuleset3, + ...((_a2 = options || {}) === null || _a2 === void 0 ? void 0 : _a2.extends) || [] + ].filter(Boolean); + return Object.assign(Object.assign({}, rest2 || {}), { extends: extendedRuleset }); +} + +// node_modules/parserapiv2/esm/resolver.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_spectral_ref_resolver3 = __toESM(require_dist7()); +var import_cache3 = __toESM(require_cache()); +var import_json_ref_readers3 = __toESM(require_json_ref_readers()); +var __awaiter38 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function createResolver3(options = {}) { + const availableResolvers = [ + ...createDefaultResolvers3(), + ...options.resolvers || [] + ].map((r8) => Object.assign(Object.assign({}, r8), { order: r8.order || Number.MAX_SAFE_INTEGER, canRead: typeof r8.canRead === "undefined" ? true : r8.canRead })); + const availableSchemas = [...new Set(availableResolvers.map((r8) => r8.schema))]; + const resolvers = availableSchemas.reduce((acc, schema8) => { + acc[schema8] = { resolve: createSchemaResolver3(schema8, availableResolvers) }; + return acc; + }, {}); + const cache = options.cache !== false; + return new import_spectral_ref_resolver3.Resolver({ + uriCache: cache ? void 0 : new import_cache3.Cache({ stdTTL: 1 }), + resolvers + }); +} +function createDefaultResolvers3() { + return [ + { + schema: "file", + read: import_json_ref_readers3.resolveFile + }, + { + schema: "https", + read: import_json_ref_readers3.resolveHttp + }, + { + schema: "http", + read: import_json_ref_readers3.resolveHttp + } + ]; +} +function createSchemaResolver3(schema8, allResolvers) { + const resolvers = allResolvers.filter((r8) => r8.schema === schema8).sort((a7, b8) => { + return a7.order - b8.order; + }); + return (uri, ctx) => __awaiter38(this, void 0, void 0, function* () { + let result2 = void 0; + let lastError; + for (const resolver of resolvers) { + try { + if (!canRead3(resolver, uri, ctx)) + continue; + result2 = yield resolver.read(uri, ctx); + if (typeof result2 === "string") { + break; + } + } catch (e10) { + lastError = e10; + continue; + } + } + if (typeof result2 !== "string") { + throw lastError || new Error(`None of the available resolvers for "${schema8}" can resolve the given reference.`); + } + return result2; + }); +} +function canRead3(resolver, uri, ctx) { + return typeof resolver.canRead === "function" ? resolver.canRead(uri, ctx) : resolver.canRead; +} + +// node_modules/parserapiv2/esm/spectral.js +function createSpectral3(parser3, options = {}) { + var _a2; + const resolverOptions = (_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver; + const spectral = new import_spectral_core60.Spectral({ resolver: createResolver3(resolverOptions) }); + const ruleset = createRuleset3(parser3, options.ruleset); + spectral.setRuleset(ruleset); + return spectral; +} + +// node_modules/parserapiv2/esm/validate.js +var __awaiter39 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultOptions5 = { + allowedSeverity: { + error: false, + warning: true, + info: true, + hint: true + }, + __unstable: {} +}; +function validate8(parser3, parserSpectral, asyncapi, options = {}) { + var _a2; + return __awaiter39(this, void 0, void 0, function* () { + let document2; + try { + const { allowedSeverity } = mergePatch3(defaultOptions5, options); + const stringifiedDocument = normalizeInput3(asyncapi); + document2 = new import_spectral_core61.Document(stringifiedDocument, import_spectral_parsers3.Yaml, options.source); + document2.__parserInput = asyncapi; + const spectral = ((_a2 = options.__unstable) === null || _a2 === void 0 ? void 0 : _a2.resolver) ? createSpectral3(parser3, options) : parserSpectral; + let { resolved: validated, results } = yield spectral.runWithResolved(document2, {}); + if (!(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.error) && hasErrorDiagnostic3(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.warning) && hasWarningDiagnostic3(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.info) && hasInfoDiagnostic3(results) || !(allowedSeverity === null || allowedSeverity === void 0 ? void 0 : allowedSeverity.hint) && hasHintDiagnostic3(results)) { + validated = void 0; + } + return { validated, diagnostics: results, extras: { document: document2 } }; + } catch (err) { + return { validated: void 0, diagnostics: createUncaghtDiagnostic3(err, "Error thrown during AsyncAPI document validation", document2), extras: { document: document2 } }; + } + }); +} + +// node_modules/parserapiv2/esm/parse.js +var __awaiter40 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultOptions6 = { + applyTraits: true, + parseSchemas: true, + validateOptions: {}, + __unstable: {} +}; +function parse10(parser3, spectral, asyncapi, options = {}) { + return __awaiter40(this, void 0, void 0, function* () { + let spectralDocument; + try { + options = mergePatch3(defaultOptions6, options); + const { validated, diagnostics, extras } = yield validate8(parser3, spectral, asyncapi, Object.assign(Object.assign({}, options.validateOptions), { source: options.source, __unstable: options.__unstable })); + if (validated === void 0) { + return { + document: void 0, + diagnostics, + extras + }; + } + spectralDocument = extras.document; + const inventory = spectralDocument.__documentInventory; + const validatedDoc = copy3(validated); + const detailed = createDetailedAsyncAPI3(validatedDoc, asyncapi, options.source); + const document2 = createAsyncAPIDocument3(detailed); + setExtension3(xParserSpecParsed3, true, document2); + setExtension3(xParserApiVersion3, ParserAPIVersion2, document2); + yield customOperations3(parser3, document2, detailed, inventory, options); + return { + document: document2, + diagnostics, + extras + }; + } catch (err) { + return { document: void 0, diagnostics: createUncaghtDiagnostic3(err, "Error thrown during AsyncAPI document parsing", spectralDocument), extras: void 0 }; + } + }); +} + +// node_modules/parserapiv2/esm/schema-parser/asyncapi-schema-parser.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_ajv3 = __toESM(require_ajv()); +var import_ajv_formats3 = __toESM(require_dist9()); +var import_ajv_errors3 = __toESM(require_dist10()); +var import_specs12 = __toESM(require_specs()); +var __awaiter41 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function AsyncAPISchemaParser3() { + return { + validate: validate9, + parse: parse11, + getMimeTypes: getMimeTypes3 + }; +} +function validate9(input) { + return __awaiter41(this, void 0, void 0, function* () { + const version5 = input.asyncapi.semver.version; + const validator = getSchemaValidator3(version5); + let result2 = []; + const valid = validator(input.data); + if (!valid && validator.errors) { + result2 = ajvToSpectralResult3(input.path, [...validator.errors]); + } + return result2; + }); +} +function parse11(input) { + return __awaiter41(this, void 0, void 0, function* () { + return input.data; + }); +} +function getMimeTypes3() { + const mimeTypes = [ + "application/schema;version=draft-07", + "application/schema+json;version=draft-07", + "application/schema+yaml;version=draft-07" + ]; + specVersions3.forEach((version5) => { + mimeTypes.push(`application/vnd.aai.asyncapi;version=${version5}`, `application/vnd.aai.asyncapi+json;version=${version5}`, `application/vnd.aai.asyncapi+yaml;version=${version5}`); + }); + return mimeTypes; +} +function ajvToSpectralResult3(path2, errors) { + return errors.map((error2) => { + return { + message: error2.message, + path: [...path2, ...error2.instancePath.replace(/^\//, "").split("/")] + }; + }); +} +function getSchemaValidator3(version5) { + const ajv2 = getAjvInstance3(); + let validator = ajv2.getSchema(version5); + if (!validator) { + const schema8 = preparePayloadSchema3(import_specs12.default.schemas[version5], version5); + ajv2.addSchema(schema8, version5); + validator = ajv2.getSchema(version5); + } + return validator; +} +function preparePayloadSchema3(asyncapiSchema, version5) { + const payloadSchema = `http://asyncapi.com/definitions/${version5}/schema.json`; + const definitions = asyncapiSchema.definitions; + if (definitions === void 0) { + throw new Error("AsyncAPI schema must contain definitions"); + } + delete definitions["http://json-schema.org/draft-07/schema"]; + delete definitions["http://json-schema.org/draft-04/schema"]; + return { + $ref: payloadSchema, + definitions + }; +} +var _ajv3; +function getAjvInstance3() { + if (_ajv3) { + return _ajv3; + } + _ajv3 = new import_ajv3.default({ + allErrors: true, + meta: true, + messages: true, + strict: false, + allowUnionTypes: true, + unicodeRegExp: false + }); + (0, import_ajv_formats3.default)(_ajv3); + (0, import_ajv_errors3.default)(_ajv3); + return _ajv3; +} + +// node_modules/parserapiv2/esm/parser.js +var __awaiter42 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var Parser6 = class { + constructor(options = {}) { + var _a2; + this.options = options; + this.parserRegistry = /* @__PURE__ */ new Map(); + this.spectral = createSpectral3(this, options); + this.registerSchemaParser(AsyncAPISchemaParser3()); + (_a2 = this.options.schemaParsers) === null || _a2 === void 0 ? void 0 : _a2.forEach((parser3) => this.registerSchemaParser(parser3)); + } + parse(asyncapi, options) { + return __awaiter42(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument3(asyncapi); + if (maybeDocument) { + return { + document: maybeDocument, + diagnostics: [] + }; + } + return parse10(this, this.spectral, asyncapi, options); + }); + } + validate(asyncapi, options) { + return __awaiter42(this, void 0, void 0, function* () { + const maybeDocument = toAsyncAPIDocument3(asyncapi); + if (maybeDocument) { + return []; + } + return (yield validate8(this, this.spectral, asyncapi, options)).diagnostics; + }); + } + registerSchemaParser(parser3) { + return registerSchemaParser3(this, parser3); + } +}; + +// node_modules/@asyncapi/multi-parser/esm/parse.js +init_esm(); + +// node_modules/@asyncapi/avro-schema-parser/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_avsc = __toESM(require_avsc()); +var __awaiter43 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function AvroSchemaParser() { + return { + validate: validate10, + parse: parse12, + getMimeTypes: getMimeTypes4 + }; +} +function validate10(input) { + return __awaiter43(this, void 0, void 0, function* () { + const result2 = []; + try { + validateAvroSchema(input.data); + } catch (error2) { + if (error2 instanceof Error) { + result2.push({ + message: error2.message, + path: input.path + // avsc doesn't throw errors with meaningful paths + }); + } + } + return result2; + }); +} +function parse12(input) { + var _a2, _b; + return __awaiter43(this, void 0, void 0, function* () { + const asyncAPISchema = yield avroToJsonSchema(input.data); + const message = input.meta.message; + const key = (_b = (_a2 = message === null || message === void 0 ? void 0 : message.bindings) === null || _a2 === void 0 ? void 0 : _a2.kafka) === null || _b === void 0 ? void 0 : _b.key; + if (key) { + const bindingsTransformed = yield avroToJsonSchema(key); + message["x-parser-original-bindings-kafka-key"] = key; + message.bindings.kafka.key = bindingsTransformed; + } + return asyncAPISchema; + }); +} +function getMimeTypes4() { + return [ + "application/vnd.apache.avro;version=1.9.0", + "application/vnd.apache.avro+json;version=1.9.0", + "application/vnd.apache.avro+yaml;version=1.9.0", + "application/vnd.apache.avro;version=1.8.2", + "application/vnd.apache.avro+json;version=1.8.2", + "application/vnd.apache.avro+yaml;version=1.8.2" + ]; +} +var BYTES_PATTERN = "^[\0-\xFF]*$"; +var INT_MIN = Math.pow(-2, 31); +var INT_MAX = Math.pow(2, 31) - 1; +var LONG_MIN = Math.pow(-2, 63); +var LONG_MAX = Math.pow(2, 63) - 1; +var typeMappings = { + null: "null", + boolean: "boolean", + int: "integer", + long: "integer", + float: "number", + double: "number", + bytes: "string", + string: "string", + fixed: "string", + map: "object", + array: "array", + enum: "string", + record: "object", + uuid: "string" +}; +function commonAttributesMapping(avroDefinition, jsonSchema, recordCache) { + if (avroDefinition.doc) + jsonSchema.description = avroDefinition.doc; + if (avroDefinition.default !== void 0) + jsonSchema.default = avroDefinition.default; + const fullyQualifiedName = getFullyQualifiedName(avroDefinition); + if (fullyQualifiedName !== void 0 && recordCache[fullyQualifiedName]) { + jsonSchema["x-parser-schema-id"] = fullyQualifiedName; + } +} +function getFullyQualifiedName(avroDefinition) { + let name2; + if (avroDefinition.name) { + if (avroDefinition.namespace) { + name2 = `${avroDefinition.namespace}.${avroDefinition.name}`; + } else { + name2 = avroDefinition.name; + } + } + return name2; +} +function requiredAttributesMapping(fieldDefinition, parentJsonSchema, haveDefaultValue) { + const isUnionWithNull = Array.isArray(fieldDefinition.type) && fieldDefinition.type.includes("null"); + if (!isUnionWithNull && !haveDefaultValue) { + parentJsonSchema.required = parentJsonSchema.required || []; + parentJsonSchema.required.push(fieldDefinition.name); + } +} +function extractNonNullableTypeIfNeeded(typeInput, jsonSchemaInput) { + let type3 = typeInput; + let jsonSchema = jsonSchemaInput; + if (Array.isArray(typeInput) && typeInput.length > 0) { + const pickSecondType = typeInput.length > 1 && typeInput[0] === "null"; + type3 = typeInput[+pickSecondType]; + if (jsonSchema.oneOf !== void 0) { + jsonSchema = jsonSchema.oneOf[0]; + } + } + return { type: type3, jsonSchema }; +} +function exampleAttributeMapping(type3, example, jsonSchema) { + if (example === void 0 || jsonSchema.examples || Array.isArray(type3)) + return; + switch (type3) { + case "boolean": + jsonSchema.examples = [example === "true"]; + break; + case "int": + jsonSchema.examples = [parseInt(example, 10)]; + break; + default: + jsonSchema.examples = [example]; + } +} +function additionalAttributesMapping(typeInput, avroDefinition, jsonSchemaInput) { + const __ret = extractNonNullableTypeIfNeeded(typeInput, jsonSchemaInput); + const type3 = __ret.type; + const jsonSchema = __ret.jsonSchema; + exampleAttributeMapping(type3, avroDefinition.example, jsonSchema); + function setAdditionalAttribute(...names) { + names.forEach((name2) => { + let isValueCoherent = true; + if (name2 === "minLength" || name2 === "maxLength") { + isValueCoherent = avroDefinition[name2] > -1; + } else if (name2 === "multipleOf") { + isValueCoherent = avroDefinition[name2] > 0; + } + if (avroDefinition[name2] !== void 0 && isValueCoherent) + jsonSchema[name2] = avroDefinition[name2]; + }); + } + switch (type3) { + case "int": + case "long": + case "float": + case "double": + setAdditionalAttribute("minimum", "maximum", "exclusiveMinimum", "exclusiveMaximum", "multipleOf"); + break; + case "string": + if (avroDefinition.logicalType) { + jsonSchema.format = avroDefinition.logicalType; + } + setAdditionalAttribute("pattern", "minLength", "maxLength"); + break; + case "array": + setAdditionalAttribute("minItems", "maxItems", "uniqueItems"); + break; + default: + break; + } +} +function validateAvroSchema(avroDefinition) { + import_avsc.default.Type.forSchema(avroDefinition); +} +function cacheAvroRecordDef(cache, key, value2) { + if (key !== void 0) { + cache[key] = value2; + } +} +function convertAvroToJsonSchema(avroDefinition, isTopLevel, recordCache = {}) { + return __awaiter43(this, void 0, void 0, function* () { + let jsonSchema = {}; + const isUnion = Array.isArray(avroDefinition); + if (isUnion) { + return processUnionSchema(jsonSchema, avroDefinition, isTopLevel, recordCache); + } + const type3 = avroDefinition.type || avroDefinition; + jsonSchema.type = typeMappings[type3]; + switch (type3) { + case "int": { + jsonSchema.minimum = INT_MIN; + jsonSchema.maximum = INT_MAX; + break; + } + case "long": { + jsonSchema.minimum = LONG_MIN; + jsonSchema.maximum = LONG_MAX; + break; + } + case "bytes": { + jsonSchema.pattern = BYTES_PATTERN; + break; + } + case "fixed": { + jsonSchema.pattern = BYTES_PATTERN; + jsonSchema.minLength = avroDefinition.size; + jsonSchema.maxLength = avroDefinition.size; + break; + } + case "map": { + jsonSchema.additionalProperties = yield convertAvroToJsonSchema(avroDefinition.values, false); + break; + } + case "array": { + jsonSchema.items = yield convertAvroToJsonSchema(avroDefinition.items, false); + break; + } + case "enum": { + jsonSchema.enum = avroDefinition.symbols; + break; + } + case "float": + case "double": { + jsonSchema.format = type3; + break; + } + case "record": { + const propsMap = yield processRecordSchema(avroDefinition, recordCache, jsonSchema); + cacheAvroRecordDef(recordCache, getFullyQualifiedName(avroDefinition), propsMap); + jsonSchema.properties = Object.fromEntries(propsMap.entries()); + break; + } + default: { + const cachedRecord = recordCache[getFullyQualifiedName(avroDefinition)]; + if (cachedRecord) { + jsonSchema = cachedRecord; + } + break; + } + } + commonAttributesMapping(avroDefinition, jsonSchema, recordCache); + additionalAttributesMapping(type3, avroDefinition, jsonSchema); + return jsonSchema; + }); +} +function processRecordSchema(avroDefinition, recordCache, jsonSchema) { + return __awaiter43(this, void 0, void 0, function* () { + const propsMap = /* @__PURE__ */ new Map(); + for (const field of avroDefinition.fields) { + if (recordCache[field.type]) { + propsMap.set(field.name, recordCache[field.type]); + const cachedProps = propsMap.get(field.name); + const cached = Object.assign({ name: field.name }, cachedProps); + requiredAttributesMapping(cached, jsonSchema, cached.default !== void 0); + } else { + const def = yield convertAvroToJsonSchema(field.type, false, recordCache); + requiredAttributesMapping(field, jsonSchema, field.default !== void 0); + commonAttributesMapping(field, def, recordCache); + additionalAttributesMapping(field.type, field, def); + propsMap.set(field.name, def); + const qualifiedFieldName = getFullyQualifiedName(field.type); + cacheAvroRecordDef(recordCache, qualifiedFieldName, def); + } + } + return propsMap; + }); +} +function processUnionSchema(jsonSchema, avroDefinition, isTopLevel, recordCache) { + return __awaiter43(this, void 0, void 0, function* () { + jsonSchema.oneOf = []; + let nullDef = null; + for (const avroDef of avroDefinition) { + const def = yield convertAvroToJsonSchema(avroDef, isTopLevel, recordCache); + const defType = avroDef.type || avroDef; + if (defType === "null") { + nullDef = def; + } else { + jsonSchema.oneOf.push(def); + const qualifiedName = getFullyQualifiedName(avroDef); + cacheAvroRecordDef(recordCache, qualifiedName, def); + } + } + if (nullDef) + jsonSchema.oneOf.push(nullDef); + return jsonSchema; + }); +} +function avroToJsonSchema(avroDefinition) { + return __awaiter43(this, void 0, void 0, function* () { + return convertAvroToJsonSchema(avroDefinition, true); + }); +} + +// node_modules/@asyncapi/openapi-schema-parser/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); +var import_ajv4 = __toESM(require_ajv()); +var import_ajv_formats4 = __toESM(require_dist9()); +var import_ajv_errors4 = __toESM(require_dist10()); + +// node_modules/@asyncapi/openapi-schema-parser/esm/json-schema-v3.js +init_dirname(); +init_buffer2(); +init_process2(); +var jsonSchemaV3 = { + type: "object", + definitions: { + Reference: { + type: "object", + required: ["$ref"], + patternProperties: { + "^\\$ref$": { + type: "string", + format: "uri-reference" + } + } + }, + Discriminator: { + type: "object", + required: ["propertyName"], + properties: { + propertyName: { + type: "string" + }, + mapping: { + type: "object", + additionalProperties: { + type: "string" + } + } + } + }, + ExternalDocumentation: { + type: "object", + required: ["url"], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + }, + XML: { + type: "object", + properties: { + name: { + type: "string" + }, + namespace: { + type: "string", + format: "uri" + }, + prefix: { + type: "string" + }, + attribute: { + type: "boolean", + default: false + }, + wrapped: { + type: "boolean", + default: false + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false + } + }, + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + default: false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + default: false + }, + maxLength: { + type: "integer", + minimum: 0 + }, + minLength: { + type: "integer", + minimum: 0, + default: 0 + }, + pattern: { + type: "string", + format: "regex" + }, + maxItems: { + type: "integer", + minimum: 0 + }, + minItems: { + type: "integer", + minimum: 0, + default: 0 + }, + uniqueItems: { + type: "boolean", + default: false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + default: 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + enum: { + type: "array", + items: {}, + minItems: 1, + uniqueItems: false + }, + type: { + type: "string", + enum: ["array", "boolean", "integer", "number", "object", "string"] + }, + not: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + allOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + oneOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + anyOf: { + type: "array", + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + items: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + }, + properties: { + type: "object", + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + } + ] + } + }, + additionalProperties: { + oneOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/Reference" + }, + { + type: "boolean" + } + ], + default: true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + default: {}, + nullable: { + type: "boolean", + default: false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + default: false + }, + writeOnly: { + type: "boolean", + default: false + }, + example: {}, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + default: false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": {} + }, + additionalProperties: false +}; + +// node_modules/@asyncapi/openapi-schema-parser/esm/index.js +var __awaiter44 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var toJsonSchema = require_openapi_schema_to_json_schema(); +function OpenAPISchemaParser() { + return { + validate: validate11, + parse: parse13, + getMimeTypes: getMimeTypes5 + }; +} +function validate11(input) { + return __awaiter44(this, void 0, void 0, function* () { + const validator = getAjvInstance4().getSchema("openapi"); + let result2 = []; + const valid = validator(input.data); + if (!valid && validator.errors) { + result2 = ajvToSpectralResult4(input.path, [...validator.errors]); + } + return result2; + }); +} +function parse13(input) { + return __awaiter44(this, void 0, void 0, function* () { + const transformed = toJsonSchema(input.data, { + cloneSchema: true, + keepNotSupported: [ + "discriminator", + "readOnly", + "writeOnly", + "deprecated", + "xml", + "example" + ] + }); + iterateSchema(transformed); + return transformed; + }); +} +function getMimeTypes5() { + return [ + "application/vnd.oai.openapi;version=3.0.0", + "application/vnd.oai.openapi+json;version=3.0.0", + "application/vnd.oai.openapi+yaml;version=3.0.0" + ]; +} +function ajvToSpectralResult4(path2, errors) { + return errors.map((error2) => { + return { + message: error2.message, + path: [...path2, ...error2.instancePath.replace(/^\//, "").split("/")] + }; + }); +} +function iterateSchema(schema8) { + if (schema8.example !== void 0) { + const examples = schema8.examples || []; + examples.push(schema8.example); + schema8.examples = examples; + delete schema8.example; + } + if (schema8.$schema !== void 0) { + delete schema8.$schema; + } + aliasProps(schema8.properties); + aliasProps(schema8.patternProperties); + aliasProps(schema8.additionalProperties); + aliasProps(schema8.items); + aliasProps(schema8.additionalItems); + aliasProps(schema8.oneOf); + aliasProps(schema8.anyOf); + aliasProps(schema8.allOf); + aliasProps(schema8.not); +} +function aliasProps(obj) { + for (const key in obj) { + const prop = obj[key]; + if (prop.xml !== void 0) { + prop["x-xml"] = prop.xml; + delete prop.xml; + } + iterateSchema(obj[key]); + } +} +var ajv; +function getAjvInstance4() { + if (ajv) { + return ajv; + } + ajv = new import_ajv4.default({ + allErrors: true, + meta: true, + messages: true, + strict: false, + allowUnionTypes: true, + unicodeRegExp: false + }); + (0, import_ajv_formats4.default)(ajv); + (0, import_ajv_errors4.default)(ajv); + ajv.addSchema(jsonSchemaV3, "openapi"); + return ajv; +} + +// node_modules/@asyncapi/raml-dt-schema-parser/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); +var lib = __toESM(require_webapi_parser()); +var __awaiter45 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var wap = lib.WebApiParser; +var r2j = require_src4(); +function RamlDTSchemaParser() { + return { + validate: validate12, + parse: parse14, + getMimeTypes: getMimeTypes6 + }; +} +function validate12(input) { + return __awaiter45(this, void 0, void 0, function* () { + const payload = formatPayload(input.data); + const parsed = yield wap.raml10.parse(payload); + const report = yield wap.raml10.validate(parsed); + if (report.conforms) { + return []; + } + const validateResult = []; + report.results.forEach((result2) => { + validateResult.push({ + message: result2.message, + path: input.path + // RAML parser doesn't provide a path to the error. + }); + }); + return validateResult; + }); +} +function parse14(input) { + return __awaiter45(this, void 0, void 0, function* () { + const payload = formatPayload(input.data); + const jsonModel = yield r2j.dt2js(payload, "tmpType", { draft: "06" }); + return jsonModel.definitions.tmpType; + }); +} +function getMimeTypes6() { + return [ + "application/raml+yaml;version=1.0" + ]; +} +function formatPayload(payload) { + if (typeof payload === "object") { + return `#%RAML 1.0 Library +${jsYaml.dump({ types: { tmpType: payload } })}`; + } + return payload; +} + +// node_modules/@asyncapi/protobuf-schema-parser/esm/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/protobuf-schema-parser/esm/protoj2jsonSchema.js +init_dirname(); +init_buffer2(); +init_process2(); +var protobuf = __toESM(require_protobufjs()); + +// node_modules/@asyncapi/protobuf-schema-parser/esm/google-types.js +init_dirname(); +init_buffer2(); +init_process2(); +var GOOGLE_TYPE = "com.google.type"; +var googleProtoTypes = { + "google/type/calendar_period.proto": { + nested: { + google: { + nested: { + type: { + options: { + go_package: "google.golang.org/genproto/googleapis/type/calendarperiod;calendarperiod", + java_multiple_files: true, + java_outer_classname: "CalendarPeriodProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + CalendarPeriod: { + values: { + CALENDAR_PERIOD_UNSPECIFIED: 0, + DAY: 1, + WEEK: 2, + FORTNIGHT: 3, + MONTH: 4, + QUARTER: 5, + HALF: 6, + YEAR: 7 + } + } + }, + comment: 'A `CalendarPeriod` represents the abstract concept of a time period that has a canonical start. Grammatically, "the start of the current `CalendarPeriod`." All calendar times begin at midnight UTC.' + } + } + } + } + }, + "google/type/color.proto": { + nested: { + google: { + nested: { + protobufNested: { + nested: { + DoubleValue: { + fields: { + value: { + type: "double", + id: 1 + } + } + }, + FloatValue: { + fields: { + value: { + type: "float", + id: 1 + } + } + }, + Int64Value: { + fields: { + value: { + type: "int64", + id: 1 + } + } + }, + UInt64Value: { + fields: { + value: { + type: "uint64", + id: 1 + } + } + }, + Int32Value: { + fields: { + value: { + type: "int32", + id: 1 + } + } + }, + UInt32Value: { + fields: { + value: { + type: "uint32", + id: 1 + } + } + }, + BoolValue: { + fields: { + value: { + type: "bool", + id: 1 + } + } + }, + StringValue: { + fields: { + value: { + type: "string", + id: 1 + } + } + }, + BytesValue: { + fields: { + value: { + type: "bytes", + id: 1 + } + } + } + } + }, + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/color;color", + java_multiple_files: true, + java_outer_classname: "ColorProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Color: { + fields: { + red: { + type: "float", + comment: "The amount of red in the color as a value in the interval.\n@Min 0\n@Max 1", + id: 1 + }, + green: { + type: "float", + comment: "The amount of green in the color as a value in the interval.\n@Min 0\n@Max 1", + id: 2 + }, + blue: { + type: "float", + comment: "The amount of blue in the color as a value in the interval.\n@Min 0\n@Max 1", + id: 3 + }, + alpha: { + type: "google.protobufNested.FloatValue", + comment: "This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color.\n@Min 0\n@Max 1", + id: 4 + } + } + } + } + } + } + } + } + }, + "google/type/date.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/date;date", + java_multiple_files: true, + java_outer_classname: "DateProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Date: { + fields: { + year: { + type: "int32", + comment: "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year\n@Min 0\n@Max 9999", + id: 1 + }, + month: { + type: "int32", + comment: "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.\n@Min 0\n@Max 12", + id: 2 + }, + day: { + type: "int32", + comment: "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.\n@Min 0\n@Max 31", + id: 3 + } + } + } + } + } + } + } + } + }, + "google/type/datetime.proto": { + nested: { + google: { + nested: { + protobufNested: { + nested: { + Duration: { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } + } + }, + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/datetime;datetime", + java_multiple_files: true, + java_outer_classname: "DateTimeProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + DateTime: { + oneofs: { + timeOffset: { + oneof: [ + "utcOffset", + "timeZone" + ] + } + }, + fields: { + year: { + type: "int32", + comment: "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year\n@Min 0\n@Max 9999", + id: 1 + }, + month: { + type: "int32", + comment: "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.\n@Min 0\n@Max 12", + id: 2 + }, + day: { + type: "int32", + comment: "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.\n@Min 0\n@Max 31", + id: 3 + }, + hours: { + type: "int32", + comment: "Hours of day in 24 hour format.\n@Min 0\n@Max 23", + id: 4 + }, + minutes: { + type: "int32", + comment: "Minutes of hour of day.\n@Min 0\n@Max 59", + id: 5 + }, + seconds: { + type: "int32", + comment: "Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.\n@Min 0\n@Max 60", + id: 6 + }, + nanos: { + type: "int32", + comment: "Fractions of seconds in nanoseconds.\n@Min 0\n@Max 999999999", + id: 7 + }, + utcOffset: { + type: "google.protobufNested.Duration", + id: 8 + }, + timeZone: { + type: "TimeZone", + id: 9 + } + } + }, + TimeZone: { + fields: { + id: { + type: "string", + comment: "IANA Time Zone Database time zone. @Example: America/New_York", + id: 1 + }, + version: { + type: "string", + comment: "IANA Time Zone Database version number. @Example: 2019a", + id: 2 + } + } + } + } + } + } + } + } + }, + "google/type/dayofweek.proto": { + nested: { + google: { + nested: { + type: { + options: { + go_package: "google.golang.org/genproto/googleapis/type/dayofweek;dayofweek", + java_multiple_files: true, + java_outer_classname: "DayOfWeekProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + DayOfWeek: { + values: { + DAY_OF_WEEK_UNSPECIFIED: 0, + MONDAY: 1, + TUESDAY: 2, + WEDNESDAY: 3, + THURSDAY: 4, + FRIDAY: 5, + SATURDAY: 6, + SUNDAY: 7 + } + } + } + } + } + } + } + }, + "google/type/decimal.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/decimal;decimal", + java_multiple_files: true, + java_outer_classname: "DecimalProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Decimal: { + fields: { + value: { + type: "string", + comment: "A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's [BigDecimal][] or Python's [decimal.Decimal][].\n\nThe string representation consists of an optional sign, `+` (`U+002B`) or `-` (`U+002D`), followed by a sequence of zero or more decimal digits (\"the integer\"), optionally followed by a fraction, optionally followed by an exponent.\n\nThe fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The number formed by the sign, the integer and the fraction is referred to as the significand.\n\nServices **should** normalize decimal values before storing them by:\n- Removing an explicitly-provided `+` sign (`+2.5` -> `2.5`).\n- Replacing a zero-length integer value with `0` (`.5` -> `0.5`).\n- Coercing the exponent character to lower-case (`2.5E8` -> `2.5e8`).\n- Removing an explicitly-provided zero exponent (`2.5e0` -> `2.5`).\n@Example 2.5e8\n@Example -2.5e8\n@Example 2.5", + id: 1 + } + } + } + } + } + } + } + } + }, + "google/type/expr.proto": { + nested: { + google: { + nested: { + type: { + options: { + go_package: "google.golang.org/genproto/googleapis/type/expr;expr", + java_multiple_files: true, + java_outer_classname: "ExprProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Expr: { + fields: { + expression: { + type: "string", + comment: "Textual representation of an expression in Common Expression Language syntax\n@Example 'New message received at ' + string(document.create_time)\n@Example document.type != 'private' && document.type != 'internal'", + id: 1 + }, + title: { + type: "string", + comment: "Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression\n@Example Notification string\n@Example Public documents", + id: 2 + }, + description: { + type: "string", + comment: "Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.\n@Example Determine whether the document should be publicly visible\n@Example Create a notification string with a timestamp.", + id: 3 + }, + location: { + type: "string", + comment: "String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", + id: 4 + } + }, + comment: "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec." + } + } + } + } + } + } + }, + "google/type/fraction.proto": { + nested: { + google: { + nested: { + type: { + options: { + go_package: "google.golang.org/genproto/googleapis/type/fraction;fraction", + java_multiple_files: true, + java_outer_classname: "FractionProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Fraction: { + fields: { + numerator: { + type: "int64", + comment: "The numerator in the fraction, e.g. 2 in 2/3.", + id: 1 + }, + denominator: { + type: "int64", + comment: "The value by which the numerator is divided, e.g. 3 in 2/3.", + id: 2 + } + } + } + } + } + } + } + } + }, + "google/type/interval.proto": { + nested: { + google: { + nested: { + protobufNested: { + nested: { + Timestamp: { + fields: { + seconds: { + type: "int64", + id: 1 + }, + nanos: { + type: "int32", + id: 2 + } + } + } + } + }, + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/interval;interval", + java_multiple_files: true, + java_outer_classname: "IntervalProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Interval: { + fields: { + startTime: { + type: "google.protobufNested.Timestamp", + comment: "If specified, a Timestamp matching this interval will have to be the same or after the start.", + id: 1 + }, + endTime: { + type: "google.protobufNested.Timestamp", + comment: "If specified, a Timestamp matching this interval will have to be before the end.", + id: 2 + } + } + } + } + } + } + } + } + }, + "google/type/latlng.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/latlng;latlng", + java_multiple_files: true, + java_outer_classname: "LatLngProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + LatLng: { + fields: { + latitude: { + type: "double", + comment: "The latitude in degrees.\n@Min -90\n@Max +90", + id: 1 + }, + longitude: { + type: "double", + comment: "The longitude in degrees.\n@Min -180\n@Max +180", + id: 2 + } + }, + comment: 'An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges.' + } + } + } + } + } + } + }, + "google/type/localized_text.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/localized_text;localized_text", + java_multiple_files: true, + java_outer_classname: "LocalizedTextProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + LocalizedText: { + fields: { + text: { + type: "string", + comment: "Localized string in the language corresponding to 'language_code'", + id: 1 + }, + languageCode: { + type: "string", + comment: `The text's BCP-47 language code, such as "en-US" or "sr-Latn". +@Example en-US +@Example sr-Latn`, + id: 2 + } + }, + comment: "Localized variant of a text in a particular language." + } + } + } + } + } + } + }, + "google/type/money.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/money;money", + java_multiple_files: true, + java_outer_classname: "MoneyProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Money: { + fields: { + currencyCode: { + type: "string", + comment: "The three-letter currency code defined in ISO 4217.\n@Example USD\n@Example EUR", + id: 1 + }, + units: { + type: "int64", + comment: "The whole units of the amount.", + id: 2 + }, + nanos: { + type: "int32", + comment: "Number of nano (10^-9) units of the amount", + id: 3 + } + }, + comment: "Represents an amount of money with its currency type." + } + } + } + } + } + } + }, + "google/type/month.proto": { + nested: { + google: { + nested: { + type: { + options: { + go_package: "google.golang.org/genproto/googleapis/type/month;month", + java_multiple_files: true, + java_outer_classname: "MonthProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Month: { + values: { + MONTH_UNSPECIFIED: 0, + JANUARY: 1, + FEBRUARY: 2, + MARCH: 3, + APRIL: 4, + MAY: 5, + JUNE: 6, + JULY: 7, + AUGUST: 8, + SEPTEMBER: 9, + OCTOBER: 10, + NOVEMBER: 11, + DECEMBER: 12 + } + } + } + } + } + } + } + }, + "google/type/phone_number.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/phone_number;phone_number", + java_multiple_files: true, + java_outer_classname: "PhoneNumberProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + PhoneNumber: { + oneofs: { + kind: { + oneof: [ + "e164Number", + "shortCode" + ] + } + }, + fields: { + e164Number: { + type: "string", + id: 1 + }, + shortCode: { + type: "ShortCode", + id: 2 + }, + extension: { + type: "string", + id: 3 + } + }, + nested: { + ShortCode: { + fields: { + regionCode: { + type: "string", + id: 1 + }, + number: { + type: "string", + id: 2 + } + } + } + } + } + } + } + } + } + } + }, + "google/type/postal_address.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/postaladdress;postaladdress", + java_multiple_files: true, + java_outer_classname: "PostalAddressProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + PostalAddress: { + fields: { + revision: { + type: "int32", + comment: "The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision.\n@Min 0\n@Max 0\n@Default 0", + id: 1 + }, + regionCode: { + type: "string", + comment: "CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See http://cldr.unicode.org/ and http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details.\n@Example CH", + id: 2 + }, + languageCode: { + type: "string", + comment: "BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations.\n@Example zh-Hant\n@Example ja\n@Example ja-Latn\n@Example en", + id: 3 + }, + postalCode: { + type: "string", + comment: "Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.).\n@Example 3600", + id: 4 + }, + sortingCode: { + type: "string", + comment: `Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. C\xF4te d'Ivoire). +@Example CEDEX 7`, + id: 5 + }, + administrativeArea: { + type: "string", + comment: `Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated.`, + id: 6 + }, + locality: { + type: "string", + comment: "Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use address_lines.", + id: 7 + }, + sublocality: { + type: "string", + comment: "Sublocality of the address. For example, this can be neighborhoods, boroughs, districts.", + id: 8 + }, + addressLines: { + rule: "repeated", + type: "string", + comment: 'Unstructured address lines describing the lower levels of an address. Because values in address_lines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX")', + id: 9 + }, + recipients: { + rule: "repeated", + type: "string", + comment: 'The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information.', + id: 10 + }, + organization: { + type: "string", + comment: "The name of the organization at the address.", + id: 11 + } + }, + comment: "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains)." + } + } + } + } + } + } + }, + "google/type/quaternion.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/quaternion;quaternion", + java_multiple_files: true, + java_outer_classname: "QuaternionProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + Quaternion: { + fields: { + x: { + type: "double", + id: 1 + }, + y: { + type: "double", + id: 2 + }, + z: { + type: "double", + id: 3 + }, + w: { + type: "double", + id: 4 + } + } + } + }, + comment: "A quaternion is defined as the quotient of two directed lines in a three-dimensional space or equivalently as the quotient of two Euclidean vectors (https://en.wikipedia.org/wiki/Quaternion)." + } + } + } + } + }, + "google/type/timeofday.proto": { + nested: { + google: { + nested: { + type: { + options: { + cc_enable_arenas: true, + go_package: "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + java_multiple_files: true, + java_outer_classname: "TimeOfDayProto", + java_package: GOOGLE_TYPE, + objc_class_prefix: "GTP" + }, + nested: { + TimeOfDay: { + fields: { + hours: { + type: "int32", + id: 1 + }, + minutes: { + type: "int32", + id: 2 + }, + seconds: { + type: "int32", + id: 3 + }, + nanos: { + type: "int32", + id: 4 + } + } + } + } + } + } + } + } + }, + "validate/validate.proto": {}, + "buf/validate/validate.proto": {} +}; + +// node_modules/@asyncapi/protobuf-schema-parser/esm/pathUtils.js +init_dirname(); +init_buffer2(); +init_process2(); +var Path = class { + static isAbsolute(path2) { + return /^(?:\/|\w+:|\\\\\w+)/.test(path2); + } + static normalize(path2) { + const firstTwoCharacters = path2.substring(0, 2); + let uncPrefix = ""; + if (firstTwoCharacters === "\\\\") { + uncPrefix = firstTwoCharacters; + path2 = path2.substring(2); + } + path2 = path2.replace(/\\/g, "/").replace(/\/{2,}/g, "/"); + const parts = path2.split("/"); + const absolute = this.isAbsolute(path2); + let prefix = ""; + if (absolute) { + prefix = `${parts.shift()}/`; + } + for (let i7 = 0; i7 < parts.length; ) { + if (parts[i7] === "..") { + if (i7 > 0 && parts[i7 - 1] !== "..") { + parts.splice(--i7, 2); + } else if (absolute) { + parts.splice(i7, 1); + } else { + ++i7; + } + } else if (parts[i7] === ".") { + parts.splice(i7, 1); + } else { + ++i7; + } + } + return uncPrefix + prefix + parts.join("/"); + } + static resolve(originPath, includePath, alreadyNormalized = false) { + if (!alreadyNormalized) { + includePath = this.normalize(includePath); + } + if (this.isAbsolute(includePath)) { + return includePath; + } + if (!alreadyNormalized) { + originPath = this.normalize(originPath); + } + return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? this.normalize(`${originPath}/${includePath}`) : includePath; + } +}; + +// node_modules/@asyncapi/protobuf-schema-parser/esm/primitive-types.js +init_dirname(); +init_buffer2(); +init_process2(); +var _a; +var PrimitiveTypes = class { +}; +_a = PrimitiveTypes; +PrimitiveTypes.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; +PrimitiveTypes.MIN_SAFE_INTEGER = -_a.MAX_SAFE_INTEGER; +PrimitiveTypes.PRIMITIVE_TYPES_WITH_LIMITS = { + bytes: { + type: "string", + "x-primitive": "bytes" + }, + string: { + type: "string", + "x-primitive": "string" + }, + bool: { + type: "boolean", + "x-primitive": "bool" + }, + int32: { + type: "integer", + minimum: -2147483648, + maximum: 2147483647, + "x-primitive": "int32" + }, + sint32: { + type: "integer", + minimum: -2147483648, + maximum: 2147483647, + "x-primitive": "sint32" + }, + uint32: { + type: "integer", + minimum: 0, + maximum: 4294967295, + "x-primitive": "uint32" + }, + int64: { + type: "integer", + minimum: _a.MIN_SAFE_INTEGER, + maximum: _a.MAX_SAFE_INTEGER, + "x-primitive": "int64" + }, + sint64: { + type: "integer", + minimum: _a.MIN_SAFE_INTEGER, + maximum: _a.MAX_SAFE_INTEGER, + "x-primitive": "sint64" + }, + uint64: { + type: "integer", + minimum: 0, + maximum: _a.MAX_SAFE_INTEGER, + "x-primitive": "uint64" + }, + fixed32: { + type: "number", + "x-primitive": "fixed32" + }, + fixed64: { + type: "number", + "x-primitive": "fixed64" + }, + sfixed32: { + type: "number", + "x-primitive": "sfixed32" + }, + sfixed64: { + type: "number", + "x-primitive": "sfixed64" + }, + float: { + type: "number", + "x-primitive": "float" + }, + double: { + type: "number", + "x-primitive": "double" + } +}; +PrimitiveTypes.PRIMITIVE_TYPES_MINIMAL = { + bytes: { + type: "string", + "x-primitive": "bytes" + }, + string: { + type: "string", + "x-primitive": "string" + }, + bool: { + type: "boolean", + "x-primitive": "bool" + }, + int32: { + type: "integer", + "x-primitive": "int32" + }, + sint32: { + type: "integer", + "x-primitive": "sint32" + }, + uint32: { + type: "integer", + "x-primitive": "uint32" + }, + int64: { + type: "integer", + "x-primitive": "int64" + }, + sint64: { + type: "integer", + "x-primitive": "sint64" + }, + uint64: { + type: "integer", + "x-primitive": "uint64" + }, + fixed32: { + type: "number", + "x-primitive": "fixed32" + }, + fixed64: { + type: "number", + "x-primitive": "fixed64" + }, + sfixed32: { + type: "number", + "x-primitive": "sfixed32" + }, + sfixed64: { + type: "number", + "x-primitive": "sfixed64" + }, + float: { + type: "number", + "x-primitive": "float" + }, + double: { + type: "number", + "x-primitive": "double" + } +}; + +// node_modules/@asyncapi/protobuf-schema-parser/esm/protoc-gen-validate.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/protobuf-schema-parser/esm/protovalidate.js +init_dirname(); +init_buffer2(); +init_process2(); +var OPTION_PREFIX = "(buf.validate.field)"; +function visit5(obj, field) { + const parsedOption = findRootOption(field); + if (parsedOption !== null) { + protocGenValidate(parsedOption, obj); + } +} +function findRootOption(field) { + if (field.parsedOptions && field.parsedOptions[OPTION_PREFIX]) { + return field.parsedOptions[OPTION_PREFIX]; + } else if (field.parsedOptions && Array.isArray(field.parsedOptions)) { + for (const parsedOption of field.parsedOptions) { + if (parsedOption[OPTION_PREFIX]) { + return parsedOption[OPTION_PREFIX]; + } + } + } + return null; +} +function protocGenValidate(option, obj) { + for (const [optionKey, value2] of Object.entries(option)) { + switch (optionKey) { + case "float": + case "double": + case "int32": + case "int64": + case "uint32": + case "uint64": + case "sint32": + case "sint64": + case "fixed32": + case "fixed64": + case "sfixed32": + case "sfixed64": + ProtocGenNumeric.handle(obj, value2); + break; + case "bool": + ProtocGenBool.handle(obj, value2); + break; + case "string": + case "bytes": + ProtocGenString.handle(obj, value2); + break; + case "repeated": + ProtocGenRepeated.handle(obj, value2); + break; + } + } +} +var ProtocGenNumeric = class _ProtocGenNumeric { + static handle(obj, option) { + for (const [optionKey, value2] of Object.entries(option)) { + switch (optionKey) { + case "const": + ProtocGenGeneric.constValue(obj, value2); + break; + case "lt": + _ProtocGenNumeric.lessThan(obj, value2); + break; + case "lte": + _ProtocGenNumeric.lessEqualThan(obj, value2); + break; + case "gt": + _ProtocGenNumeric.greaterThan(obj, value2); + break; + case "gte": + _ProtocGenNumeric.greaterEqualThan(obj, value2); + break; + case "ignore_empty": + break; + case "in": + ProtocGenGeneric.inArray(obj, value2); + break; + case "not_in": + ProtocGenGeneric.notInArray(obj, value2); + break; + } + } + } + // x must equal `value` less than + static lessThan(obj, value2) { + delete obj.maximum; + obj.exclusiveMaximum = value2; + } + // x must be greater less or equal to `value` + static lessEqualThan(obj, value2) { + obj.maximum = value2; + } + // x must equal `value` greater than + static greaterThan(obj, value2) { + delete obj.minimum; + obj.exclusiveMinimum = value2; + } + // x must be greater than or equal to `value` + static greaterEqualThan(obj, value2) { + obj.minimum = value2; + } +}; +var ProtocGenBool = class { + static handle(obj, option) { + for (const [optionKey, value2] of Object.entries(option)) { + switch (optionKey) { + case "const": + ProtocGenGeneric.constValue(obj, value2); + break; + } + } + } +}; +var ProtocGenString = class _ProtocGenString { + static handle(obj, option) { + for (const [optionKey, value2] of Object.entries(option)) { + switch (optionKey) { + case "const": + ProtocGenGeneric.constValue(obj, value2); + break; + case "in": + ProtocGenGeneric.inArray(obj, value2); + break; + case "not_in": + ProtocGenGeneric.notInArray(obj, value2); + break; + case "len": + _ProtocGenString.len(obj, value2); + break; + case "min_len": + _ProtocGenString.minLen(obj, value2); + break; + case "max_len": + _ProtocGenString.maxLen(obj, value2); + break; + case "len_bytes": + _ProtocGenString.len(obj, value2); + break; + case "min_bytes": + _ProtocGenString.minLen(obj, value2); + break; + case "max_bytes": + _ProtocGenString.maxLen(obj, value2); + break; + case "pattern": + _ProtocGenString.pattern(obj, value2); + break; + case "prefix": + _ProtocGenString.prefix(obj, value2); + break; + case "contains": + _ProtocGenString.contains(obj, value2); + break; + case "not_contains": + _ProtocGenString.notContains(obj, value2); + break; + case "suffix": + _ProtocGenString.suffix(obj, value2); + break; + case "email": + if (value2) { + _ProtocGenString.email(obj); + } + break; + case "address": + if (value2) { + _ProtocGenString.address(obj); + } + break; + case "hostname": + if (value2) { + _ProtocGenString.hostname(obj); + } + break; + case "ip": + if (value2) { + _ProtocGenString.ip(obj); + } + break; + case "ipv4": + if (value2) { + _ProtocGenString.ipv4(obj); + } + break; + case "ipv6": + if (value2) { + _ProtocGenString.ipv6(obj); + } + break; + case "uri": + if (value2) { + _ProtocGenString.uri(obj); + } + break; + case "uri_ref": + if (value2) { + _ProtocGenString.uriRef(obj); + } + break; + case "uuid": + if (value2) { + _ProtocGenString.uuid(obj); + } + break; + case "well_known_regex": + _ProtocGenString.wellKnownRegex(obj, value2); + break; + case "ignore_empty": + break; + } + } + } + static len(obj, value2) { + obj.minLength = value2; + obj.maxLength = value2; + } + static minLen(obj, value2) { + obj.minLength = value2; + } + static maxLen(obj, value2) { + obj.maxLength = value2; + } + static pattern(obj, value2) { + obj.pattern = value2; + } + static prefix(obj, value2) { + obj.pattern = `^${escapeRegExp2(value2)}.*`; + } + static contains(obj, value2) { + obj.pattern = `.*${escapeRegExp2(value2)}.*`; + } + static notContains(obj, value2) { + obj.pattern = `^((?!${escapeRegExp2(value2)}).)*$`; + } + static suffix(obj, value2) { + obj.pattern = `.*${escapeRegExp2(value2)}$`; + } + static email(obj) { + obj.format = "email"; + } + static hostname(obj) { + obj.format = "hostname"; + } + static address(obj) { + obj.anyOf = [ + { format: "hostname" }, + { format: "ipv4" }, + { format: "ipv6" } + ]; + } + static ip(obj) { + obj.anyOf = [ + { format: "ipv4" }, + { format: "ipv6" } + ]; + } + static ipv4(obj) { + obj.format = "ipv4"; + } + static ipv6(obj) { + obj.format = "ipv6"; + } + static uri(obj) { + obj.format = "uri"; + } + static uriRef(obj) { + obj.format = "uri-reference"; + } + static uuid(obj) { + obj.format = "uuid"; + } + static wellKnownRegex(obj, value2) { + switch (value2) { + case "HTTP_HEADER_NAME": + obj.pattern = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~`]+$"; + break; + case "HTTP_HEADER_VALUE": + obj.pattern = "^[^\0-\b\n-\x7F]*$"; + break; + } + } +}; +var ProtocGenRepeated = class _ProtocGenRepeated { + static handle(obj, option) { + for (const [optionKey, value2] of Object.entries(option)) { + switch (optionKey) { + case "min_items": + _ProtocGenRepeated.minLen(obj, value2); + break; + case "max_items": + _ProtocGenRepeated.maxLen(obj, value2); + break; + case "unique": + if (value2) { + _ProtocGenRepeated.unique(obj); + } + break; + case "items": + if (obj.items) { + protocGenValidate(value2, obj.items); + } + break; + } + } + } + static minLen(obj, value2) { + obj.minItems = value2; + } + static maxLen(obj, value2) { + obj.maxItems = value2; + } + static unique(obj) { + obj.uniqueItems = true; + } +}; +var ProtocGenGeneric = class { + // x must equal `value` exactly + static constValue(obj, value2) { + obj.const = value2; + delete obj.maximum; + delete obj.minimum; + } + static inArray(obj, value2) { + if (!Array.isArray(value2)) { + throw new Error(`Expect value to be an array: ${value2}`); + } + obj.oneOf = value2.map((val) => { + const subSchema = { + const: val + }; + return subSchema; + }); + } + static notInArray(obj, value2) { + if (!Array.isArray(value2)) { + throw new Error(`Expect value to be an array: ${value2}`); + } + obj.not = { + oneOf: value2.map((val) => { + const subSchema = { + const: val + }; + return subSchema; + }) + }; + } +}; +function isOptional(field) { + const parsedOption = findRootOption(field); + if (parsedOption !== null) { + for (const [dataType, options] of Object.entries(parsedOption)) { + if (dataType === "repeated") { + if (options.items) { + for (const [key, val] of Object.entries(options.items)) { + if (key === "ignore_empty" && val) { + return true; + } + } + } + } else { + for (const [key, val] of Object.entries(options)) { + if (key === "ignore_empty" && val) { + return true; + } + } + } + } + } + return false; +} +function escapeRegExp2(str2) { + return str2.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); +} + +// node_modules/@asyncapi/protobuf-schema-parser/esm/protoc-gen-validate.js +var OPTION_PREFIX2 = "(validate.rules)"; +function visit6(obj, field) { + const parsedOption = findRootOption2(field); + if (parsedOption !== null) { + protocGenValidate(parsedOption, obj); + } +} +function findRootOption2(field) { + if (field.parsedOptions && field.parsedOptions[OPTION_PREFIX2]) { + return field.parsedOptions[OPTION_PREFIX2]; + } else if (field.parsedOptions && Array.isArray(field.parsedOptions)) { + for (const parsedOption of field.parsedOptions) { + if (parsedOption[OPTION_PREFIX2]) { + return parsedOption[OPTION_PREFIX2]; + } + } + } + return null; +} + +// node_modules/@asyncapi/protobuf-schema-parser/esm/protoj2jsonSchema.js +var ROOT_FILENAME = "root"; +var COMMENT_ROOT_NODE = "@RootNode"; +var COMMENT_OPTION = "@Option"; +var COMMENT_EXAMPLE = "@Example"; +var COMMENT_DEFAULT = "@Default"; +var Proto2JsonSchema = class { + constructor(rawSchema) { + this.root = new protobuf.Root(); + this.proto3 = false; + this.protoParseOptions = { + keepCase: true, + alternateCommentMode: true + }; + this.mapperOptions = { + primitiveTypesWithLimits: true + }; + this.parseOptionsAnnotation(rawSchema); + this.process(ROOT_FILENAME, rawSchema); + } + parseOptionsAnnotation(rawSchema) { + const regex = /\s*(\/\/|\*)\s*@Option\s+(?\w{1,50})\s+(?[^\r\n]{1,200})/g; + let m7; + while ((m7 = regex.exec(rawSchema)) !== null) { + if (m7.index === regex.lastIndex) { + regex.lastIndex++; + } + if (m7.groups === void 0) { + break; + } + if (m7.groups.value === "true") { + this.mapperOptions[m7.groups.key] = true; + } else if (m7.groups.value === "false") { + this.mapperOptions[m7.groups.key] = false; + } else { + this.mapperOptions[m7.groups.key] = m7.groups.value; + } + } + } + process(filename, source) { + if (!isString3(source)) { + const srcObject = source; + this.root.setOptions(srcObject.options); + this.root.addJSON(srcObject.nested); + } else { + const srcStr = source; + protobuf.parse.filename = filename; + const parsed = protobuf.parse(srcStr, this.root, this.protoParseOptions); + let i7 = 0; + if (parsed.imports) { + for (; i7 < parsed.imports.length; ++i7) { + this.fetch(parsed.imports[i7], filename, false); + } + } + if (parsed.weakImports) { + for (i7 = 0; i7 < parsed.weakImports.length; ++i7) { + this.fetch(parsed.weakImports[i7], filename, true); + } + } + } + } + // Bundled definition existence checking + getBundledFileName(filename) { + if (filename === "validate/validate.proto" || filename === "/validate/validate.proto") { + return "validate/validate.proto"; + } + if (filename === "buf/validate/validate.proto" || filename === "/buf/validate/validate.proto") { + return "buf/validate/validate.proto"; + } + let idx = filename.lastIndexOf("google/protobuf/"); + if (idx > -1) { + const shortName = filename.substring(idx); + if (shortName in protobuf.common) { + return shortName; + } + } + idx = filename.lastIndexOf("google/type/"); + if (idx > -1) { + const shortName = filename.substring(idx); + if (shortName in googleProtoTypes) { + return shortName; + } + } + return null; + } + fetch(filename, parentFilename, weak) { + const bundledFilename = this.getBundledFileName(filename) || filename; + if (this.root.files.indexOf(bundledFilename) > -1) { + return; + } + this.root.files.push(bundledFilename); + if (bundledFilename in protobuf.common) { + this.process(bundledFilename, protobuf.common[bundledFilename]); + return; + } + if (bundledFilename in googleProtoTypes) { + this.process(bundledFilename, googleProtoTypes[bundledFilename]); + return; + } + const resolvedFilename = Path.resolve(bundledFilename, parentFilename); + if (!weak) { + throw new Error(`Imports are currently not implemented. Can not load: ${resolvedFilename} defined in as ${filename} in ${parentFilename}`); + } + } + compile() { + this.root.resolveAll(); + const rootItemCandidates = this.resolveByFilename(ROOT_FILENAME, this.root.nested); + const rootItem = this.findRootItem(rootItemCandidates); + return this.compileMessage(rootItem, []); + } + resolveByFilename(filename, items) { + const hits = []; + for (const itemName in items) { + const item = items[itemName]; + if (item.filename === filename && item instanceof protobuf.Type) { + hits.push(item); + } + if (item.nested) { + hits.push(...this.resolveByFilename(filename, item.nested)); + } + } + return hits; + } + // eslint-disable-next-line sonarjs/cognitive-complexity + findRootItem(candidates) { + var _a2; + const usedTypes = /* @__PURE__ */ new Map(); + for (const candidate of candidates) { + for (const fieldName in candidate.fields) { + if (!usedTypes.has(candidate.fields[fieldName].type)) { + usedTypes.set(candidate.fields[fieldName].type, /* @__PURE__ */ new Set([candidate.name])); + } else { + (_a2 = usedTypes.get(candidate.fields[fieldName].type)) === null || _a2 === void 0 ? void 0 : _a2.add(candidate.name); + } + } + } + const rootTypes = []; + for (const candidate of candidates) { + const isUsedBy = usedTypes.get(candidate.name); + if (isUsedBy && ((isUsedBy === null || isUsedBy === void 0 ? void 0 : isUsedBy.size) > 1 || !isUsedBy.has(candidate.name))) { + continue; + } + rootTypes.push(candidate); + } + if (rootTypes.length < 1) { + throw new Error("Not found a root proto messages"); + } + if (rootTypes.length === 1) { + return rootTypes[0]; + } + for (const rootType of rootTypes) { + if (rootType.comment && rootType.comment.indexOf(COMMENT_ROOT_NODE) !== -1) { + return rootType; + } + } + const allRootTypes = rootTypes.map((rootType) => rootType.name).join(", "); + throw new Error(`Found more than one root proto messages: ${allRootTypes}`); + } + isProto3() { + var _a2; + return ((_a2 = this.root.options) === null || _a2 === void 0 ? void 0 : _a2.syntax) === "proto3"; + } + isProto3Required(field) { + var _a2; + if (isOptional(field)) { + return false; + } + return ((_a2 = field.options) === null || _a2 === void 0 ? void 0 : _a2.proto3_optional) !== true && this.isProto3(); + } + /** + * Compiles a protobuf message to JSON schema + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + compileMessage(item, stack) { + var _a2, _b; + const properties = {}; + const obj = { + title: item.name, + type: "object", + required: [], + properties + }; + const desc = this.extractDescription(item.comment); + if (desc !== null && desc.length > 0) { + obj.description = desc; + } + const timesSeenThisClassInStack = stack.filter((x7) => x7 === item.name).length; + if (timesSeenThisClassInStack >= 2) { + return obj; + } + stack.push(item.name); + for (const fieldName in item.fields) { + const field = item.fields[fieldName]; + if (field.partOf && field.partOf.oneof.length > 1) { + continue; + } + if (field.required || this.isProto3Required(field)) { + (_a2 = obj.required) === null || _a2 === void 0 ? void 0 : _a2.push(fieldName); + } + if (field.repeated) { + properties[field.name] = { + type: "array", + items: this.compileField(field, item, stack.slice()) + }; + const desc2 = this.extractDescription(field.comment); + if (desc2 !== null && desc2.length > 0) { + properties[field.name].description = desc2; + } + if (field.comment) { + const minItemsPattern = /@minItems\\s(\\d+?)/i; + const maxItemsPattern = /@maxItems\\s(\\d+?)/i; + let m7; + if ((m7 = minItemsPattern.exec(field.comment)) !== null) { + obj.minItems = parseFloat(m7[1]); + } + if ((m7 = maxItemsPattern.exec(field.comment)) !== null) { + obj.maxItems = parseFloat(m7[1]); + } + } + visit6(properties[field.name], field); + visit5(properties[field.name], field); + } else { + properties[field.name] = this.compileField(field, item, stack.slice()); + } + } + for (const oneOfItem of item.oneofsArray) { + if (oneOfItem.fieldsArray.length < 2) { + continue; + } + if (!properties[oneOfItem.name]) { + properties[oneOfItem.name] = { + oneOf: [] + }; + } + const oneOf = properties[oneOfItem.name]["oneOf"]; + for (const fieldName of oneOfItem.oneof) { + const field = this.compileField(item.fields[fieldName], item, stack.slice()); + field["x-oneof-item"] = fieldName; + oneOf.push(field); + } + } + if (((_b = obj.required) === null || _b === void 0 ? void 0 : _b.length) < 1) { + delete obj.required; + } + return obj; + } + /** + * Compiles a protobuf enum to JSON schema + */ + compileEnum(field) { + const enumMapping = {}; + for (const enumKey of Object.keys(field.values)) { + enumMapping[enumKey] = field.values[enumKey]; + } + const obj = { + title: field.name, + type: "string", + enum: Object.keys(field.values), + "x-enum-mapping": enumMapping + }; + this.addDefaultFromCommentAnnotations(obj, field.comment); + return obj; + } + // eslint-disable-next-line sonarjs/cognitive-complexity + compileField(field, parentItem, stack) { + let obj = {}; + if (PrimitiveTypes.PRIMITIVE_TYPES_WITH_LIMITS[field.type.toLowerCase()]) { + obj = this.mapperOptions.primitiveTypesWithLimits ? Object.assign(obj, PrimitiveTypes.PRIMITIVE_TYPES_WITH_LIMITS[field.type.toLowerCase()]) : Object.assign(obj, PrimitiveTypes.PRIMITIVE_TYPES_MINIMAL[field.type.toLowerCase()]); + obj["x-primitive"] = field.type; + } else { + const item = parentItem.lookupTypeOrEnum(field.type); + if (!item) { + throw new Error(`Unable to resolve type "${field.type}" @ ${parentItem.fullName}`); + } + if (item instanceof protobuf.Enum) { + obj = Object.assign(obj, this.compileEnum(item)); + } else { + obj = Object.assign(obj, this.compileMessage(item, stack)); + } + } + this.addValidatorFromCommentAnnotations(obj, field.comment); + this.addDefaultFromCommentAnnotations(obj, field.comment); + if (!field.repeated) { + visit6(obj, field); + visit5(obj, field); + } + const desc = this.extractDescription(field.comment); + if (desc !== null && desc.length > 0) { + if (obj.description) { + obj.description = `${desc} +${obj.description}`.trim(); + } else { + obj.description = desc; + } + } + const examples = this.extractExamples(field.comment); + if (examples !== null) { + obj.examples = examples; + } + return obj; + } + extractDescription(comment) { + if (!comment || (comment === null || comment === void 0 ? void 0 : comment.length) < 1) { + return null; + } + comment = comment.replace(new RegExp(`\\s{0,15}${COMMENT_EXAMPLE}\\s{0,15}(.+)`, "ig"), "").replace(new RegExp(`\\s{0,15}${COMMENT_DEFAULT}\\s{0,15}(.+)`, "ig"), "").replace(new RegExp(`\\s{0,15}${COMMENT_OPTION}\\s{0,15}(.+)`, "ig"), "").replace(new RegExp(`\\s{0,15}${COMMENT_ROOT_NODE}`, "ig"), "").replace(new RegExp("\\s{0,15}@(Min|Max|Pattern|Minimum|Maximum|ExclusiveMinimum|ExclusiveMaximum|MultipleOf|MaxLength|MinLength|MaxItems|MinItems)\\s{0,15}[\\d.]{1,20}", "ig"), "").trim(); + if (comment.length < 1) { + return null; + } + return comment; + } + extractExamples(comment) { + if (!comment) { + return null; + } + const examples = []; + let m7; + const examplePattern = new RegExp(`\\s*${COMMENT_EXAMPLE}\\s(.+)$`, "i"); + for (const line of comment.split("\n")) { + if ((m7 = examplePattern.exec(line)) !== null) { + examples.push(tryParseToObject(m7[1].trim())); + } + } + if (examples.length < 1) { + return null; + } + return examples; + } + /* eslint-disable security/detect-unsafe-regex */ + addValidatorFromCommentAnnotations(obj, comment) { + if (comment === null || (comment === null || comment === void 0 ? void 0 : comment.length) < 1) { + return; + } + const patternMin = /@Min\s([+-]?\d+(\.\d+)?)/i; + const patternMax = /@Max\s([+-]?\d+(\.\d+)?)/i; + const patternPattern = /@Pattern\\s([^\n]+)/i; + const patterns = /* @__PURE__ */ new Map([ + ["minimum", /@Minimum\\s([+-]?\\d+(\\.\\d+)?)/i], + ["maximum", /@Maximum\\s([+-]?\\d+(\\.\\d+)?)/i], + ["exclusiveMinimum", /@ExclusiveMinimum\\s(\\d+(\\.\\d+)?)/i], + ["exclusiveMaximum", /@ExclusiveMaximum\\s(\\d+(\\.\\d+)?)/i], + ["multipleOf", /@MultipleOf\\s(\\d+(\\.\\d+)?)/i], + ["maxLength", /@MultipleOf\\s(\\d+(\\.\\d+)?)/i], + ["minLength", /@MultipleOf\\s(\\d+(\\.\\d+)?)/i] + ]); + let m7; + if ((m7 = patternMin.exec(comment)) !== null) { + obj.minimum = parseFloat(m7[1]); + } + if ((m7 = patternMax.exec(comment)) !== null) { + obj.maximum = parseFloat(m7[1]); + } + if ((m7 = patternPattern.exec(comment)) !== null) { + obj.pattern = m7[1]; + } + for (const e10 of patterns.entries()) { + if ((m7 = e10[1].exec(comment)) !== null) { + obj[e10[0]] = parseFloat(m7[1]); + } + } + } + /* eslint-enable security/detect-unsafe-regex */ + addDefaultFromCommentAnnotations(obj, comment) { + if (comment === null || (comment === null || comment === void 0 ? void 0 : comment.length) < 1) { + return; + } + const defaultPattern = new RegExp(`\\s*${COMMENT_DEFAULT}\\s(.+)$`, "i"); + let m7; + if ((m7 = defaultPattern.exec(comment)) !== null) { + obj.default = tryParseToObject(m7[1]); + } + } +}; +function proto2jsonSchema(rawSchema) { + const compiler = new Proto2JsonSchema(rawSchema); + return compiler.compile(); +} +function isString3(value2) { + return typeof value2 === "string" || value2 instanceof String; +} +function tryParseToObject(value2) { + if (value2.charAt(0) === "{") { + try { + const json2 = JSON.parse(value2); + if (json2) { + return json2; + } + } catch (_6) { + } + } + return value2; +} + +// node_modules/@asyncapi/protobuf-schema-parser/esm/index.js +var __awaiter46 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function ProtoBuffSchemaParser() { + return { + validate: validate13, + parse: parse16, + getMimeTypes: getMimeTypes7 + }; +} +function validate13(input) { + return __awaiter46(this, void 0, void 0, function* () { + try { + proto2jsonSchema(input.data); + return []; + } catch (error2) { + let message = "Unknown Error"; + if (error2 instanceof Error) { + message = error2.message; + } + return [{ + message, + path: input.path + // protobuf parser doesn't provide a path to the error. + }]; + } + }); +} +function parse16(input) { + return proto2jsonSchema(input.data); +} +function getMimeTypes7() { + return [ + "application/vnd.google.protobuf;version=2", + "application/vnd.google.protobuf;version=3" + ]; +} + +// node_modules/@asyncapi/multi-parser/esm/parse.js +function NewParser(parserAPIMajorVersion, options) { + const parserOptions = (options === null || options === void 0 ? void 0 : options.parserOptions) || {}; + if (options === null || options === void 0 ? void 0 : options.includeSchemaParsers) { + const defaultSchemaParsers = [ + AvroSchemaParser(), + OpenAPISchemaParser(), + RamlDTSchemaParser(), + ProtoBuffSchemaParser() + ]; + if (!parserOptions.schemaParsers) { + parserOptions.schemaParsers = defaultSchemaParsers; + } else { + const givenSchemaParsersMimeTypes = parserOptions.schemaParsers.map((schemaParser) => schemaParser.getMimeTypes()).flat(); + const filteredDefaultSchemas = defaultSchemaParsers.filter((defaultSchemaParser) => !givenSchemaParsersMimeTypes.includes(defaultSchemaParser.getMimeTypes()[0])); + parserOptions.schemaParsers.push(...filteredDefaultSchemas); + } + } + switch (parserAPIMajorVersion) { + case 1: + return new Parser5(parserOptions); + case 2: + return new Parser6(parserOptions); + default: + case 3: + return new Parser3(parserOptions); + } +} + +// node_modules/@asyncapi/multi-parser/esm/convert.js +init_dirname(); +init_buffer2(); +init_process2(); +init_esm(); +function ConvertDocumentParserAPIVersion(doc, toParserAPIMajorVersion) { + var _a2; + if (!doc || !doc.json) + return doc; + const docParserAPI = (_a2 = doc.extensions().get("x-parser-api-version")) === null || _a2 === void 0 ? void 0 : _a2.value(); + const docParserAPIMajorVersion = docParserAPI || 0; + if (docParserAPIMajorVersion === toParserAPIMajorVersion) { + return doc; + } + const detailedAsyncAPI = doc.meta().asyncapi; + switch (toParserAPIMajorVersion) { + case 1: + return createAsyncAPIDocument2(detailedAsyncAPI); + case 2: + return createAsyncAPIDocument3(detailedAsyncAPI); + case 3: + return createAsyncAPIDocument(detailedAsyncAPI); + default: + return doc; + } +} + +// node_modules/@asyncapi/modelina/lib/esm/processors/AsyncAPIInputProcessor.js +var import_utils122 = __toESM(require_utils10()); + +// node_modules/@asyncapi/modelina/lib/esm/processors/utils/MetadataPreservingResolver.js +init_dirname(); +init_buffer2(); +init_process2(); +init_fs(); +init_url(); +init_path(); +var __awaiter47 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function createMetadataPreservingResolver() { + return { + schema: "file", + order: -100, + // Negative order for highest priority (lower numbers run first) + canRead: (uri) => { + const uriString = uri.toString(); + return uriString.startsWith("file://") && (uriString.endsWith(".yaml") || uriString.endsWith(".yml") || uriString.endsWith(".json")); + }, + read: (uri) => __awaiter47(this, void 0, void 0, function* () { + try { + const filePath = fileURLToPath(uri.toString()); + Logger2.debug(`Reading file with metadata preservation: ${filePath}`); + const content = yield promises.readFile(filePath, "utf8"); + const isYaml = filePath.endsWith(".yaml") || filePath.endsWith(".yml"); + let parsed; + try { + parsed = isYaml ? jsYaml.load(content) : JSON.parse(content); + } catch (parseError) { + Logger2.error(`Failed to parse file ${filePath}:`, parseError); + return void 0; + } + if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) { + const filename = exports5.basename(filePath, exports5.extname(filePath)); + parsed["x-modelgen-source-file"] = filename; + parsed["x-modelgen-source-path"] = filePath; + Logger2.debug(`Injected metadata for ${filename}: x-modelgen-source-file="${filename}"`); + if (parsed.title) { + Logger2.debug(`Preserving existing title for ${filename}: title="${parsed.title}"`); + } else { + parsed.title = filename; + Logger2.debug(`Injected title for ${filename}: title="${filename}"`); + } + } + return isYaml ? jsYaml.dump(parsed) : JSON.stringify(parsed); + } catch (error2) { + Logger2.error(`Error reading file ${uri.toString()}:`, error2); + return void 0; + } + }) + }; +} + +// node_modules/@asyncapi/modelina/lib/esm/processors/AsyncAPIInputProcessor.js +var __awaiter48 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var AsyncAPIInputProcessor = class _AsyncAPIInputProcessor extends AbstractInputProcessor { + /** + * Process the input as an AsyncAPI document + * + * @param input + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + process(input, options) { + return __awaiter48(this, void 0, void 0, function* () { + var _a2, _b, _c, _d; + const rawInput = input; + let doc; + if (!this.shouldProcess(rawInput)) { + throw new Error("Input is not an AsyncAPI document so it cannot be processed."); + } + Logger2.debug("Processing input as an AsyncAPI document"); + const inputModel = new InputMetaModel(); + if (isOldAsyncAPIDocument(rawInput)) { + const parsedJSON = rawInput.json(); + const detailed = (0, import_utils122.createDetailedAsyncAPI)(parsedJSON, parsedJSON); + doc = createAsyncAPIDocument(detailed); + } else if (_AsyncAPIInputProcessor.isFromNewParser(rawInput)) { + doc = ConvertDocumentParserAPIVersion(rawInput, 2); + } else { + const defaultResolver = createMetadataPreservingResolver(); + Logger2.debug("Created metadata-preserving resolver for AsyncAPI parsing"); + const parserOptions = (options === null || options === void 0 ? void 0 : options.asyncapi) || { + __unstable: { + resolver: { + resolvers: [defaultResolver] + } + } + }; + if ((_c = (_b = (_a2 = options === null || options === void 0 ? void 0 : options.asyncapi) === null || _a2 === void 0 ? void 0 : _a2.__unstable) === null || _b === void 0 ? void 0 : _b.resolver) === null || _c === void 0 ? void 0 : _c.resolvers) { + parserOptions.__unstable = { + resolver: { + resolvers: [ + defaultResolver, + ...options.asyncapi.__unstable.resolver.resolvers + ] + } + }; + } + const parser3 = NewParser(3, { + includeSchemaParsers: true + }); + let parserResult; + if (this.isFileInput(input)) { + const filePath = fileURLToPath(input); + if (!fs_default.existsSync(filePath)) { + throw new Error("File does not exists."); + } + const fileResult = fromFile(parser3, filePath); + parserResult = yield fileResult.parse(parserOptions); + } else { + parserResult = yield parser3.parse(rawInput, parserOptions); + } + const { document: document2, diagnostics } = parserResult; + if (document2) { + doc = document2; + } else { + const err = new Error("Input is not an correct AsyncAPI document so it cannot be processed."); + err.diagnostics = diagnostics; + throw err; + } + } + if (!doc) { + throw new Error("Could not parse input as AsyncAPI document"); + } + inputModel.originalInput = doc; + const componentSchemaKeys = /* @__PURE__ */ new Map(); + try { + const allSchemas = doc.schemas(); + for (const schema8 of allSchemas) { + const schemaId = schema8.id(); + if (schemaId === null || schemaId === void 0 ? void 0 : schemaId.includes("/components/schemas/")) { + const parts = schemaId.split("/components/schemas/"); + if (parts.length > 1) { + const componentKey = parts[1].split("/")[0]; + componentSchemaKeys.set(schemaId, componentKey); + Logger2.debug(`Mapped component schema: ${schemaId} -> ${componentKey}`); + } + } + } + } catch (error2) { + Logger2.debug("Could not extract component schema keys:", error2); + } + const globalSchemaCache = /* @__PURE__ */ new Map(); + const schemaHashToName = /* @__PURE__ */ new Map(); + const addToInputModel = (payload, context2) => { + const schemaId = payload.id(); + const componentKey = schemaId ? componentSchemaKeys.get(schemaId) : void 0; + const isComponentSchema = componentKey || schemaId && Array.from(componentSchemaKeys.values()).includes(schemaId); + const effectiveComponentKey = componentKey || (isComponentSchema ? schemaId : void 0); + let finalContext = context2; + if (effectiveComponentKey && typeof context2 !== "string") { + finalContext = Object.assign(Object.assign({}, context2), { componentKey: effectiveComponentKey }); + } + const schema8 = _AsyncAPIInputProcessor.convertToInternalSchema(payload, globalSchemaCache, finalContext); + if (typeof schema8 === "boolean") { + const newMetaModel2 = JsonSchemaInputProcessor.convertSchemaToMetaModel(schema8, options); + inputModel.models[newMetaModel2.name] = newMetaModel2; + return; + } + const payloadId = payload.id(); + const existingName = payloadId ? schemaHashToName.get(payloadId) : void 0; + if (existingName && existingName !== schema8[_AsyncAPIInputProcessor.MODELINA_INFERRED_NAME]) { + const currentName = schema8[_AsyncAPIInputProcessor.MODELINA_INFERRED_NAME]; + const syntheticPattern = /OneOfOption|AnyOfOption|AllOfOption/; + const existingIsSynthetic = syntheticPattern.test(existingName); + const currentIsSynthetic = syntheticPattern.test(currentName); + if (existingIsSynthetic && !currentIsSynthetic) { + Logger2.debug(`Replacing synthetic name ${existingName} with better name ${currentName}`); + if (payloadId) { + schemaHashToName.set(payloadId, currentName); + } + } else if (!existingIsSynthetic && currentIsSynthetic) { + Logger2.debug(`Skipping duplicate schema ${currentName}, already have better name ${existingName}`); + return; + } else if (currentName.length < existingName.length) { + Logger2.debug(`Replacing longer name ${existingName} with shorter name ${currentName}`); + if (payloadId) { + schemaHashToName.set(payloadId, currentName); + } + } else { + Logger2.debug(`Skipping duplicate schema ${currentName}, keeping ${existingName}`); + return; + } + } else if (!existingName && payloadId) { + schemaHashToName.set(payloadId, schema8[_AsyncAPIInputProcessor.MODELINA_INFERRED_NAME]); + } + const newMetaModel = JsonSchemaInputProcessor.convertSchemaToMetaModel(schema8, options); + if (inputModel.models[newMetaModel.name] !== void 0) { + Logger2.warn(`Overwriting existing model with name ${newMetaModel.name}, are there two models with the same name present? Overwriting the old model.`, newMetaModel.name); + } + inputModel.models[newMetaModel.name] = newMetaModel; + }; + const channels = doc.channels(); + if (channels.length) { + for (const channel of doc.channels()) { + const channelAddress = channel.address(); + const channelId = channel.id(); + const deriveChannelName = (address) => { + return address.split("/").filter((part) => part && !part.startsWith("{")).map((part) => _AsyncAPIInputProcessor.capitalize(part)).join(""); + }; + const channelName = channelAddress ? deriveChannelName(channelAddress) : void 0; + for (const operation of channel.operations()) { + const handleMessages2 = (messages, contextChannelName) => { + if (messages.length > 1) { + const oneOf = []; + for (const message of messages) { + const payload2 = message.payload(); + if (!payload2) { + continue; + } + const messageId = message.id(); + const contextId = messageId && !messageId.includes(_AsyncAPIInputProcessor.ANONYMOUS_MESSAGE_PREFIX) ? messageId : contextChannelName; + const messageContext = contextId ? { messageId: contextId } : {}; + addToInputModel(payload2, messageContext); + oneOf.push(payload2.json()); + } + const payload = new Schema2({ + $id: channelId, + oneOf + }, channel.meta()); + addToInputModel(payload); + } else if (messages.length === 1) { + const message = messages[0]; + const payload = message.payload(); + if (payload) { + const messageId = message.id(); + const contextId = messageId && !messageId.includes(_AsyncAPIInputProcessor.ANONYMOUS_MESSAGE_PREFIX) ? messageId : contextChannelName; + const messageContext = contextId ? { messageId: contextId } : {}; + addToInputModel(payload, messageContext); + } + } + }; + const replyOperation = operation.reply(); + if (replyOperation !== void 0) { + const replyMessages = replyOperation.messages(); + if (replyMessages.length > 0) { + handleMessages2(replyMessages, channelName); + } else { + const replyChannelMessages = (_d = replyOperation.channel()) === null || _d === void 0 ? void 0 : _d.messages(); + if (replyChannelMessages) { + handleMessages2(replyChannelMessages, channelName); + } + } + } + handleMessages2(operation.messages(), channelName); + } + } + } else { + for (const message of doc.allMessages()) { + const payload = message.payload(); + if (payload) { + const messageName = message.id() ? `${message.id()}Payload` : void 0; + addToInputModel(payload, messageName); + } + } + } + return inputModel; + }); + } + /** + * Helper method to capitalize first letter of a string + */ + static capitalize(str2) { + if (!str2) { + return str2; + } + return str2.charAt(0).toUpperCase() + str2.slice(1); + } + /** + * Generate a hash of a schema's JSON representation for duplicate detection + */ + static hashSchema(schemaJson) { + var _a2; + if (!schemaJson || typeof schemaJson !== "object") { + return ""; + } + const sortedJson = JSON.stringify(schemaJson, Object.keys(schemaJson).sort()); + let hash = 5381; + for (let i7 = 0; i7 < sortedJson.length; i7++) { + hash = (hash << 5) + hash + ((_a2 = sortedJson.codePointAt(i7)) !== null && _a2 !== void 0 ? _a2 : Number.NaN); + } + return hash.toString(36); + } + /** + * Determine the best name for a schema based on available metadata and context. + * + * Priority order: + * 0. User-provided x-modelgen-inferred-name extension (highest priority) + * 1. Component schema key (from components/schemas) + * 2. Schema ID (if looks like component name) + * 3. Schema title field + * 4. Source file name (from custom resolver metadata) + * 5. Message ID (for payloads) + * 6. Context-based inference (property name, array item, enum) + * 7. Inferred name parameter + * 8. Fallback to sanitized anonymous ID + * + * @param schemaId The schema ID from AsyncAPI parser + * @param schemaJson The JSON representation of the schema + * @param context Additional context for name inference + * @param inferredName Legacy inferred name parameter + * @returns The determined schema name + */ + // eslint-disable-next-line sonarjs/cognitive-complexity + static determineSchemaName(schemaId, schemaJson, context2, inferredName) { + const existingInferredName = schemaJson === null || schemaJson === void 0 ? void 0 : schemaJson[this.MODELINA_INFERRED_NAME]; + if (existingInferredName && typeof existingInferredName === "string") { + Logger2.debug(`Using user-provided x-modelgen-inferred-name: ${existingInferredName}`); + return existingInferredName; + } + if (context2 === null || context2 === void 0 ? void 0 : context2.componentKey) { + Logger2.debug(`Using component key from context: ${context2.componentKey}`); + return context2.componentKey; + } + if (schemaId && !schemaId.includes(_AsyncAPIInputProcessor.ANONYMOUS_PREFIX) && !schemaId.includes("/") && schemaId.length > 0 && schemaId.startsWith(schemaId[0].toUpperCase())) { + Logger2.debug(`Using schema ID as component name: ${schemaId}`); + return schemaId; + } + if ((schemaJson === null || schemaJson === void 0 ? void 0 : schemaJson.title) && typeof schemaJson.title === "string" && !schemaJson.title.includes("anonymous")) { + Logger2.debug(`Using schema title: ${schemaJson.title}`); + return schemaJson.title; + } + const sourceFile = schemaJson === null || schemaJson === void 0 ? void 0 : schemaJson["x-modelgen-source-file"]; + if (sourceFile && typeof sourceFile === "string") { + Logger2.debug(`Using source file name: ${sourceFile}`); + return sourceFile; + } + if ((context2 === null || context2 === void 0 ? void 0 : context2.messageId) && schemaId && schemaId.includes(_AsyncAPIInputProcessor.ANONYMOUS_PREFIX) && !context2.propertyName && !context2.parentName && !context2.isArrayItem && !context2.messageId.includes(_AsyncAPIInputProcessor.ANONYMOUS_MESSAGE_PREFIX)) { + const name2 = `${context2.messageId}Payload`; + Logger2.debug(`Using message ID for inline payload: ${name2}`); + return name2; + } + if (context2) { + if ((schemaJson === null || schemaJson === void 0 ? void 0 : schemaJson.enum) && context2.propertyName) { + const propName2 = this.capitalize(context2.propertyName); + const name2 = context2.parentName ? `${context2.parentName}${propName2}Enum` : `${propName2}Enum`; + Logger2.debug(`Using enum name: ${name2}`); + return name2; + } + if (context2.isArrayItem && context2.parentName) { + const name2 = `${context2.parentName}Item`; + Logger2.debug(`Using array item name: ${name2}`); + return name2; + } + if (context2.isPatternProperty && context2.parentName) { + const name2 = `${context2.parentName}PatternProperty`; + Logger2.debug(`Using pattern property name: ${name2}`); + return name2; + } + if (context2.isAdditionalProperty && context2.parentName) { + const name2 = `${context2.parentName}AdditionalProperty`; + Logger2.debug(`Using additional property name: ${name2}`); + return name2; + } + if (context2.propertyName && context2.parentName) { + const propName2 = this.capitalize(context2.propertyName); + const name2 = `${context2.parentName}${propName2}`; + Logger2.debug(`Using property-based name: ${name2}`); + return name2; + } + if (context2.propertyName) { + const name2 = this.capitalize(context2.propertyName); + Logger2.debug(`Using property name: ${name2}`); + return name2; + } + } + if (inferredName && !inferredName.includes(_AsyncAPIInputProcessor.ANONYMOUS_MESSAGE_PREFIX)) { + Logger2.debug(`Using inferred name parameter: ${inferredName}`); + return inferredName; + } + if (schemaId === null || schemaId === void 0 ? void 0 : schemaId.includes(_AsyncAPIInputProcessor.ANONYMOUS_PREFIX)) { + const sanitized = schemaId.replace("<", "").replace(/-/g, "_").replace(">", ""); + Logger2.debug(`Using sanitized anonymous ID: ${sanitized}`); + return sanitized; + } + return schemaId || "UnknownSchema"; + } + /** + * + * Reflect the name of the schema and save it to `x-modelgen-inferred-name` extension. + * + * This keeps the the id of the model deterministic if used in conjunction with other AsyncAPI tools such as the generator. + * + * @param schema to reflect name for + * @param alreadyIteratedSchemas map of already processed schemas + * @param context context information for name inference + * @param inferredName optional name to use instead of the schema id (legacy parameter) + */ + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + // eslint-disable-next-line sonarjs/cognitive-complexity + static convertToInternalSchema(schema8, alreadyIteratedSchemas = /* @__PURE__ */ new Map(), context2) { + if (typeof schema8 === "boolean") { + return schema8; + } + const schemaContext = typeof context2 === "string" ? void 0 : context2; + const inferredName = typeof context2 === "string" ? context2 : void 0; + const schemaId = schema8.id(); + const schemaJson = schema8.json(); + const schemaUid = this.determineSchemaName(schemaId, schemaJson, schemaContext, inferredName); + const cacheKey = schemaId || schemaUid; + if (alreadyIteratedSchemas.has(cacheKey)) { + return alreadyIteratedSchemas.get(cacheKey); + } + const convertedSchema = AsyncapiV2Schema.toSchema(schemaJson); + convertedSchema[this.MODELINA_INFERRED_NAME] = schemaUid; + alreadyIteratedSchemas.set(cacheKey, convertedSchema); + if (schema8.allOf()) { + convertedSchema.allOf = schema8.allOf().map((item, index4) => { + const allOfContext = { + parentName: schemaUid, + propertyName: `AllOfOption${index4}` + }; + return this.convertToInternalSchema(item, alreadyIteratedSchemas, allOfContext); + }); + } + if (schema8.oneOf()) { + convertedSchema.oneOf = schema8.oneOf().map((item, index4) => { + const oneOfContext = { + parentName: schemaUid, + propertyName: `OneOfOption${index4}` + }; + return this.convertToInternalSchema(item, alreadyIteratedSchemas, oneOfContext); + }); + } + if (schema8.anyOf()) { + convertedSchema.anyOf = schema8.anyOf().map((item, index4) => { + const anyOfContext = { + parentName: schemaUid, + propertyName: `AnyOfOption${index4}` + }; + return this.convertToInternalSchema(item, alreadyIteratedSchemas, anyOfContext); + }); + } + if (schema8.not()) { + convertedSchema.not = this.convertToInternalSchema(schema8.not(), alreadyIteratedSchemas); + } + if (typeof schema8.additionalItems() === "object" && schema8.additionalItems() !== null) { + convertedSchema.additionalItems = this.convertToInternalSchema(schema8.additionalItems(), alreadyIteratedSchemas); + } + if (schema8.contains()) { + convertedSchema.contains = this.convertToInternalSchema(schema8.contains(), alreadyIteratedSchemas); + } + if (schema8.propertyNames()) { + convertedSchema.propertyNames = this.convertToInternalSchema(schema8.propertyNames(), alreadyIteratedSchemas); + } + if (schema8.if()) { + convertedSchema.if = this.convertToInternalSchema(schema8.if(), alreadyIteratedSchemas); + } + if (schema8.then()) { + convertedSchema.then = this.convertToInternalSchema(schema8.then(), alreadyIteratedSchemas); + } + if (schema8.else()) { + convertedSchema.else = this.convertToInternalSchema(schema8.else(), alreadyIteratedSchemas); + } + if (typeof schema8.additionalProperties() === "object" && schema8.additionalProperties() !== null) { + const additionalPropContext = { + isAdditionalProperty: true, + parentName: schemaUid + }; + convertedSchema.additionalProperties = this.convertToInternalSchema(schema8.additionalProperties(), alreadyIteratedSchemas, additionalPropContext); + } + if (schema8.items()) { + if (Array.isArray(schema8.items())) { + convertedSchema.items = schema8.items().map((item) => { + const itemContext = { + isArrayItem: true, + parentName: schemaUid + }; + return this.convertToInternalSchema(item, alreadyIteratedSchemas, itemContext); + }); + } else { + const itemContext = { + isArrayItem: true, + parentName: schemaUid + }; + convertedSchema.items = this.convertToInternalSchema(schema8.items(), alreadyIteratedSchemas, itemContext); + } + } + const schemaProperties = schema8.properties(); + if (schemaProperties && Object.keys(schemaProperties).length) { + const properties = {}; + for (const [propertyName, propertySchema] of Object.entries(schemaProperties)) { + const propertyContext = { + propertyName: String(propertyName), + parentName: schemaUid + }; + properties[String(propertyName)] = this.convertToInternalSchema(propertySchema, alreadyIteratedSchemas, propertyContext); + } + convertedSchema.properties = properties; + } + const schemaDependencies = schema8.dependencies(); + if (schemaDependencies && Object.keys(schemaDependencies).length) { + const dependencies = {}; + for (const [dependencyName, dependency] of Object.entries(schemaDependencies)) { + if (typeof dependency === "object" && !Array.isArray(dependency)) { + const depContext = Object.assign(Object.assign({}, schemaContext), { propertyName: _AsyncAPIInputProcessor.capitalize(String(dependencyName)), parentName: schemaUid }); + dependencies[String(dependencyName)] = this.convertToInternalSchema(dependency, alreadyIteratedSchemas, depContext); + } else { + dependencies[String(dependencyName)] = dependency; + } + } + convertedSchema.dependencies = dependencies; + } + const schemaPatternProperties = schema8.patternProperties(); + if (schemaPatternProperties && Object.keys(schemaPatternProperties).length) { + const patternProperties = {}; + for (const [patternPropertyName, patternProperty] of Object.entries(schemaPatternProperties)) { + const patternContext = { + isPatternProperty: true, + parentName: schemaUid, + propertyName: String(patternPropertyName) + }; + patternProperties[String(patternPropertyName)] = this.convertToInternalSchema(patternProperty, alreadyIteratedSchemas, patternContext); + } + convertedSchema.patternProperties = patternProperties; + } + const schemaDefinitions = schema8.definitions(); + if (schemaDefinitions && Object.keys(schemaDefinitions).length) { + const definitions = {}; + for (const [definitionName, definition] of Object.entries(schemaDefinitions)) { + const defContext = Object.assign(Object.assign({}, schemaContext), { propertyName: _AsyncAPIInputProcessor.capitalize(String(definitionName)), parentName: schemaUid }); + definitions[String(definitionName)] = this.convertToInternalSchema(definition, alreadyIteratedSchemas, defContext); + } + convertedSchema.definitions = definitions; + } + return convertedSchema; + } + /** + * Figures out if an object is of type AsyncAPI document + * + * @param input + */ + shouldProcess(input) { + if (!input) { + return false; + } + if (this.isFileInput(input)) { + return true; + } + const version5 = this.tryGetVersionOfDocument(input); + if (!version5) { + return false; + } + return _AsyncAPIInputProcessor.supportedVersions.includes(version5); + } + /** + * Try to find the AsyncAPI version from the input. If it cannot undefined are returned, if it can, the version is returned. + * + * @param input + */ + tryGetVersionOfDocument(input) { + if (!input) { + return; + } + if (typeof input === "string") { + let loadedObj; + try { + loadedObj = jsYaml.load(input); + } catch (e10) { + try { + loadedObj = JSON.parse(input); + } catch (e11) { + return void 0; + } + } + return loadedObj === null || loadedObj === void 0 ? void 0 : loadedObj.asyncapi; + } + if (_AsyncAPIInputProcessor.isFromParser(input)) { + return input.version(); + } + return input === null || input === void 0 ? void 0 : input.asyncapi; + } + /** + * Figure out if input is from the AsyncAPI parser. + * + * @param input + */ + static isFromParser(input) { + return isOldAsyncAPIDocument(input) || this.isFromNewParser(input); + } + /** + * Figure out if input is from the new AsyncAPI parser. + * + * @param input + */ + static isFromNewParser(input) { + return isAsyncAPIDocument(input); + } + isFileInput(input) { + return typeof input === "string" && /^file:\/\//g.test(input); + } +}; +AsyncAPIInputProcessor.supportedVersions = [ + "2.0.0", + "2.1.0", + "2.2.0", + "2.3.0", + "2.4.0", + "2.5.0", + "2.6.0", + "3.0.0" +]; +AsyncAPIInputProcessor.ANONYMOUS_PREFIX = " [], + values: () => ({}), + get: () => void 0 + }, + parse: async (schema8) => schema8, + async resolve() { + return this; + }, + bundle: async (schema8) => schema8, + dereference: async (schema8) => schema8, + validate: async (schema8) => schema8 +}; +SwaggerParser.parse = async (schema8) => schema8; +SwaggerParser.resolve = async (schema8) => ({ schema: schema8, $refs: {} }); +SwaggerParser.bundle = async (schema8) => schema8; +SwaggerParser.dereference = async (schema8) => schema8; +SwaggerParser.validate = async (schema8) => schema8; +var swagger_parser_default = SwaggerParser; + +// node_modules/@asyncapi/modelina/lib/esm/processors/SwaggerInputProcessor.js +var __awaiter49 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var SwaggerInputProcessor = class _SwaggerInputProcessor extends AbstractInputProcessor { + /** + * Process the input as a Swagger document + * + * @param input + */ + process(input, options) { + return __awaiter49(this, void 0, void 0, function* () { + if (!this.shouldProcess(input)) { + throw new Error("Input is not a Swagger document so it cannot be processed."); + } + Logger2.debug("Processing input as a Swagger document"); + const common3 = new InputMetaModel(); + common3.originalInput = input; + const api = yield swagger_parser_default.dereference(input); + for (const [path2, pathObject] of Object.entries(api.paths)) { + let formattedPathName = path2.replace(/[^\w\s*]+/g, ""); + formattedPathName = formattedPathName.replace(/\//, ""); + formattedPathName = formattedPathName.replace(/\//gm, "_"); + this.processOperation(pathObject.get, `${formattedPathName}_get`, common3, options); + this.processOperation(pathObject.put, `${formattedPathName}_put`, common3, options); + this.processOperation(pathObject.post, `${formattedPathName}_post`, common3, options); + this.processOperation(pathObject.options, `${formattedPathName}_options`, common3, options); + this.processOperation(pathObject.head, `${formattedPathName}_head`, common3, options); + this.processOperation(pathObject.patch, `${formattedPathName}_patch`, common3, options); + } + return common3; + }); + } + processOperation(operation, path2, inputModel, options) { + if (operation) { + this.includeResponses(operation.responses, path2, inputModel, options); + this.includeParameters(operation.parameters, path2, inputModel, options); + } + } + includeResponses(responses, path2, inputModel, options) { + for (const [responseName, response] of Object.entries(responses)) { + if (response !== void 0) { + const getOperationResponseSchema = response.schema; + if (getOperationResponseSchema !== void 0) { + this.includeSchema(getOperationResponseSchema, `${path2}_${responseName}`, inputModel, options); + } + } + } + } + includeParameters(parameters, path2, inputModel, options) { + for (const parameterObject of parameters || []) { + const parameter = parameterObject; + if (parameter.in === "body") { + const bodyParameterSchema = parameter.schema; + this.includeSchema(bodyParameterSchema, `${path2}_body`, inputModel, options); + } + } + } + includeSchema(schema8, name2, inputModel, options) { + const internalSchema = _SwaggerInputProcessor.convertToInternalSchema(schema8, name2); + const newMetaModel = JsonSchemaInputProcessor.convertSchemaToMetaModel(internalSchema, options); + if (inputModel.models[newMetaModel.name] !== void 0) { + Logger2.warn(`Overwriting existing model with name ${newMetaModel.name}, are there two models with the same name present? Overwriting the old model.`, newMetaModel.name); + } + inputModel.models[newMetaModel.name] = newMetaModel; + } + /** + * Converts a Swagger 2.0 Schema to the internal schema format. + * + * @param schema to convert + * @param name of the schema + */ + static convertToInternalSchema(schema8, name2) { + schema8 = JsonSchemaInputProcessor.reflectSchemaNames(schema8, {}, /* @__PURE__ */ new Set(), name2, true); + return SwaggerV2Schema.toSchema(schema8); + } + /** + * Figures out if an object is of type Swagger document and supported + * + * @param input + */ + shouldProcess(input) { + const version5 = this.tryGetVersionOfDocument(input); + if (!version5) { + return false; + } + return _SwaggerInputProcessor.supportedVersions.includes(version5); + } + /** + * Try to find the swagger version from the input. If it cannot, undefined are returned, if it can, the version is returned. + * + * @param input + */ + tryGetVersionOfDocument(input) { + return input && input.swagger; + } +}; +SwaggerInputProcessor.supportedVersions = ["2.0"]; + +// node_modules/@asyncapi/modelina/lib/esm/processors/OpenAPIInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter50 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var OpenAPIInputProcessor = class _OpenAPIInputProcessor extends AbstractInputProcessor { + /** + * Process the input as a OpenAPI document + * + * @param input + */ + process(input, options) { + return __awaiter50(this, void 0, void 0, function* () { + var _a2, _b, _c; + if (!this.shouldProcess(input)) { + throw new Error("Input is not a OpenAPI document so it cannot be processed."); + } + Logger2.debug("Processing input as an OpenAPI document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + const api = yield swagger_parser_default.dereference(input); + if (api && api.paths) { + for (const [path2, pathObject] of Object.entries(api.paths)) { + this.processPath(pathObject, path2, inputModel, options); + } + } + if ((_a2 = options === null || options === void 0 ? void 0 : options.openapi) === null || _a2 === void 0 ? void 0 : _a2.includeComponentSchemas) { + for (const [schemaName, schemaObject] of Object.entries((_c = (_b = api.components) === null || _b === void 0 ? void 0 : _b.schemas) !== null && _c !== void 0 ? _c : {})) { + if (schemaObject["$ref"] === void 0) { + this.includeSchema(schemaObject, schemaName, inputModel, options); + } + } + } + return inputModel; + }); + } + processPath(pathObject, path2, inputModel, options) { + if (pathObject) { + let formattedPathName = path2.replace(/[^\w\s*]+/g, ""); + formattedPathName = formattedPathName.replace(/\//, ""); + formattedPathName = formattedPathName.replace(/\//gm, "_"); + this.processOperation(pathObject.get, `${formattedPathName}_get`, inputModel, options); + this.processOperation(pathObject.put, `${formattedPathName}_put`, inputModel, options); + this.processOperation(pathObject.post, `${formattedPathName}_post`, inputModel, options); + this.processOperation(pathObject.delete, `${formattedPathName}_delete`, inputModel, options); + this.processOperation(pathObject.options, `${formattedPathName}_options`, inputModel, options); + this.processOperation(pathObject.head, `${formattedPathName}_head`, inputModel, options); + this.processOperation(pathObject.patch, `${formattedPathName}_patch`, inputModel, options); + this.processOperation(pathObject.trace, `${formattedPathName}_trace`, inputModel, options); + this.iterateParameters(pathObject.parameters, `${formattedPathName}_parameters`, inputModel, options); + } + } + processOperation(operation, path2, inputModel, options) { + if (operation && operation.responses) { + this.iterateResponses(operation.responses, path2, inputModel, options); + this.iterateParameters(operation.parameters, `${path2}_parameters`, inputModel, options); + if (operation.requestBody) { + this.iterateMediaType(operation.requestBody.content || {}, path2, inputModel, options); + } + if (operation.callbacks) { + for (const [callbackName, callback] of Object.entries(operation.callbacks)) { + const callbackObject = callback; + for (const [callbackPath, callbackPathObject] of Object.entries(callbackObject)) { + this.processPath(callbackPathObject, `${path2}_callback_${callbackName}_${callbackPath}`, inputModel, options); + } + } + } + } + } + iterateResponses(responses, path2, inputModel, options) { + for (const [responseName, response] of Object.entries(responses)) { + const formattedResponseName = responseName.replace(/\//, "_"); + this.iterateMediaType(response.content || {}, `${path2}_${formattedResponseName}`, inputModel, options); + } + } + iterateParameters(parameters, path2, inputModel, options) { + for (const parameterObject of parameters || []) { + const parameter = parameterObject; + if (parameter.schema) { + this.includeSchema(parameter.schema, `${path2}_${parameter.in}_${parameter.name}`, inputModel, options); + } + } + } + iterateMediaType(mediaTypes, path2, inputModel, options) { + for (const [mediaContent, mediaTypeObject] of Object.entries(mediaTypes)) { + const mediaType = mediaTypeObject; + if (mediaType.schema === void 0) { + continue; + } + const mediaTypeSchema = mediaType.schema; + const formattedMediaContent = mediaContent.replace(/\//, "_"); + this.includeSchema(mediaTypeSchema, `${path2}_${formattedMediaContent}`, inputModel, options); + } + } + includeSchema(schema8, name2, inputModel, options) { + const internalSchema = _OpenAPIInputProcessor.convertToInternalSchema(schema8, name2); + const newMetaModel = JsonSchemaInputProcessor.convertSchemaToMetaModel(internalSchema, options); + if (inputModel.models[newMetaModel.name] !== void 0) { + Logger2.warn(`Overwriting existing model with name ${newMetaModel.name}, are there two models with the same name present? Overwriting the old model.`, newMetaModel.name); + } + inputModel.models[newMetaModel.name] = newMetaModel; + } + /** + * Converts a schema to the internal schema format. + * + * @param schema to convert + * @param name of the schema + */ + static convertToInternalSchema(schema8, name2) { + const namedSchema = JsonSchemaInputProcessor.reflectSchemaNames(schema8, {}, /* @__PURE__ */ new Set(), name2, true); + return OpenapiV3Schema.toSchema(namedSchema); + } + /** + * Figures out if an object is of type OpenAPI V3.0.x document and supported + * + * @param input + */ + shouldProcess(input) { + const version5 = this.tryGetVersionOfDocument(input); + if (!version5) { + return false; + } + return _OpenAPIInputProcessor.supportedVersions.includes(version5); + } + /** + * Try to find the AsyncAPI version from the input. If it cannot undefined are returned, if it can, the version is returned. + * + * @param input + */ + tryGetVersionOfDocument(input) { + return input && input.openapi; + } +}; +OpenAPIInputProcessor.supportedVersions = ["3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.1.0"]; + +// node_modules/@asyncapi/modelina/lib/esm/processors/TypeScriptInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +init_path(); +var TJS = __toESM(require_typescript_json_schema()); +var TypeScriptInputProcessor = class _TypeScriptInputProcessor extends AbstractInputProcessor { + generateProgram(file) { + return TJS.getProgramFromFiles([resolve(file)], _TypeScriptInputProcessor.settings.compilerOptions); + } + generateJSONSchema(file, typeRequired, options) { + const mergedOptions = Object.assign(Object.assign({}, _TypeScriptInputProcessor.settings), options); + const program = this.generateProgram(file); + const tjsProgram = program; + if (typeRequired === "*") { + const generator = TJS.buildGenerator(tjsProgram, mergedOptions); + if (!generator) { + throw new Error("Cound not generate all types automatically"); + } + const symbols = generator.getMainFileSymbols(tjsProgram); + return symbols.map((symbol) => { + const schemaFromGenerator = generator.getSchemaForSymbol(symbol); + schemaFromGenerator.$id = symbol; + return schemaFromGenerator; + }); + } + const schema8 = TJS.generateSchema(tjsProgram, typeRequired, mergedOptions); + if (!schema8) { + return null; + } + schema8.$id = typeRequired; + return [schema8]; + } + shouldProcess(input) { + if (input === null || void 0 || input.baseFile === null || void 0) { + return false; + } + if (Object.keys(input).length === 0 && input.constructor === Object) { + return false; + } + if (typeof input !== "object" || typeof input.baseFile !== "string") { + return false; + } + return true; + } + process(input, options) { + const inputModel = new InputMetaModel(); + if (!this.shouldProcess(input)) { + return Promise.reject(new Error("Input is not of the valid file format")); + } + const { fileContents, baseFile } = input; + inputModel.originalInput = fileContents; + const generatedSchemas = this.generateJSONSchema(baseFile, "*", options === null || options === void 0 ? void 0 : options.typescript); + if (generatedSchemas) { + for (const schema8 of generatedSchemas) { + const newMetaModel = JsonSchemaInputProcessor.convertSchemaToMetaModel(schema8, options); + if (inputModel.models[newMetaModel.name] !== void 0) { + Logger2.warn(`Overwriting existing model with name ${newMetaModel.name}, are there two models with the same name present? Overwriting the old model.`, newMetaModel.name); + } + inputModel.models[newMetaModel.name] = newMetaModel; + } + } + return Promise.resolve(inputModel); + } +}; +TypeScriptInputProcessor.settings = { + uniqueNames: false, + required: true, + compilerOptions: { + strictNullChecks: false + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/AvroSchemaInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); +var avroType = [ + "null", + "boolean", + "int", + "long", + "double", + "float", + "string", + "record", + "enum", + "array", + "map" +]; +var AvroSchemaInputProcessor = class extends AbstractInputProcessor { + /** + * Function processing an Avro Schema input + * + * @param input + */ + shouldProcess(input) { + if (input === "" || JSON.stringify(input) === "{}" || JSON.stringify(input) === "[]") { + return false; + } + if (!avroType.includes(input.type) || !input.name) { + return false; + } + return true; + } + process(input) { + if (!this.shouldProcess(input)) { + return Promise.reject(new Error("Input is not an Avro Schema, so it cannot be processed.")); + } + Logger2.debug("Processing input as Avro Schema document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + const metaModel = AvroToMetaModel(input); + inputModel.models[metaModel.name] = metaModel; + Logger2.debug("Completed processing input as Avro Schema document"); + return Promise.resolve(inputModel); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/XsdInputProcessor.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/fxp.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/validator.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/util.js +init_dirname(); +init_buffer2(); +init_process2(); +var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; +var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; +var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; +var regexName = new RegExp("^" + nameRegexp + "$"); +function getAllMatches(string2, regex) { + const matches2 = []; + let match = regex.exec(string2); + while (match) { + const allmatches = []; + allmatches.startIndex = regex.lastIndex - match[0].length; + const len = match.length; + for (let index4 = 0; index4 < len; index4++) { + allmatches.push(match[index4]); + } + matches2.push(allmatches); + match = regex.exec(string2); + } + return matches2; +} +var isName = function(string2) { + const match = regexName.exec(string2); + return !(match === null || typeof match === "undefined"); +}; +function isExist(v8) { + return typeof v8 !== "undefined"; +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/validator.js +var defaultOptions7 = { + allowBooleanAttributes: false, + //A tag can have attributes without any value + unpairedTags: [] +}; +function validate14(xmlData, options) { + options = Object.assign({}, defaultOptions7, options); + const tags6 = []; + let tagFound = false; + let reachedRoot = false; + if (xmlData[0] === "\uFEFF") { + xmlData = xmlData.substr(1); + } + for (let i7 = 0; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "<" && xmlData[i7 + 1] === "?") { + i7 += 2; + i7 = readPI(xmlData, i7); + if (i7.err) + return i7; + } else if (xmlData[i7] === "<") { + let tagStartPos = i7; + i7++; + if (xmlData[i7] === "!") { + i7 = readCommentAndCDATA(xmlData, i7); + continue; + } else { + let closingTag = false; + if (xmlData[i7] === "/") { + closingTag = true; + i7++; + } + let tagName = ""; + for (; i7 < xmlData.length && xmlData[i7] !== ">" && xmlData[i7] !== " " && xmlData[i7] !== " " && xmlData[i7] !== "\n" && xmlData[i7] !== "\r"; i7++) { + tagName += xmlData[i7]; + } + tagName = tagName.trim(); + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substring(0, tagName.length - 1); + i7--; + } + if (!validateTagName(tagName)) { + let msg; + if (tagName.trim().length === 0) { + msg = "Invalid space after '<'."; + } else { + msg = "Tag '" + tagName + "' is an invalid name."; + } + return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i7)); + } + const result2 = readAttributeStr(xmlData, i7); + if (result2 === false) { + return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i7)); + } + let attrStr = result2.value; + i7 = result2.index; + if (attrStr[attrStr.length - 1] === "/") { + const attrStrStart = i7 - attrStr.length; + attrStr = attrStr.substring(0, attrStr.length - 1); + const isValid2 = validateAttributeString(attrStr, options); + if (isValid2 === true) { + tagFound = true; + } else { + return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid2.err.line)); + } + } else if (closingTag) { + if (!result2.tagClosed) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i7)); + } else if (attrStr.trim().length > 0) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); + } else if (tags6.length === 0) { + return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); + } else { + const otg = tags6.pop(); + if (tagName !== otg.tagName) { + let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); + return getErrorObject( + "InvalidTag", + "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", + getLineNumberForPosition(xmlData, tagStartPos) + ); + } + if (tags6.length == 0) { + reachedRoot = true; + } + } + } else { + const isValid2 = validateAttributeString(attrStr, options); + if (isValid2 !== true) { + return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, i7 - attrStr.length + isValid2.err.line)); + } + if (reachedRoot === true) { + return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i7)); + } else if (options.unpairedTags.indexOf(tagName) !== -1) { + } else { + tags6.push({ tagName, tagStartPos }); + } + tagFound = true; + } + for (i7++; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "<") { + if (xmlData[i7 + 1] === "!") { + i7++; + i7 = readCommentAndCDATA(xmlData, i7); + continue; + } else if (xmlData[i7 + 1] === "?") { + i7 = readPI(xmlData, ++i7); + if (i7.err) + return i7; + } else { + break; + } + } else if (xmlData[i7] === "&") { + const afterAmp = validateAmpersand(xmlData, i7); + if (afterAmp == -1) + return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i7)); + i7 = afterAmp; + } else { + if (reachedRoot === true && !isWhiteSpace2(xmlData[i7])) { + return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i7)); + } + } + } + if (xmlData[i7] === "<") { + i7--; + } + } + } else { + if (isWhiteSpace2(xmlData[i7])) { + continue; + } + return getErrorObject("InvalidChar", "char '" + xmlData[i7] + "' is not expected.", getLineNumberForPosition(xmlData, i7)); + } + } + if (!tagFound) { + return getErrorObject("InvalidXml", "Start tag expected.", 1); + } else if (tags6.length == 1) { + return getErrorObject("InvalidTag", "Unclosed tag '" + tags6[0].tagName + "'.", getLineNumberForPosition(xmlData, tags6[0].tagStartPos)); + } else if (tags6.length > 0) { + return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags6.map((t8) => t8.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); + } + return true; +} +function isWhiteSpace2(char) { + return char === " " || char === " " || char === "\n" || char === "\r"; +} +function readPI(xmlData, i7) { + const start = i7; + for (; i7 < xmlData.length; i7++) { + if (xmlData[i7] == "?" || xmlData[i7] == " ") { + const tagname = xmlData.substr(start, i7 - start); + if (i7 > 5 && tagname === "xml") { + return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i7)); + } else if (xmlData[i7] == "?" && xmlData[i7 + 1] == ">") { + i7++; + break; + } else { + continue; + } + } + } + return i7; +} +function readCommentAndCDATA(xmlData, i7) { + if (xmlData.length > i7 + 5 && xmlData[i7 + 1] === "-" && xmlData[i7 + 2] === "-") { + for (i7 += 3; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "-" && xmlData[i7 + 1] === "-" && xmlData[i7 + 2] === ">") { + i7 += 2; + break; + } + } + } else if (xmlData.length > i7 + 8 && xmlData[i7 + 1] === "D" && xmlData[i7 + 2] === "O" && xmlData[i7 + 3] === "C" && xmlData[i7 + 4] === "T" && xmlData[i7 + 5] === "Y" && xmlData[i7 + 6] === "P" && xmlData[i7 + 7] === "E") { + let angleBracketsCount = 1; + for (i7 += 8; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "<") { + angleBracketsCount++; + } else if (xmlData[i7] === ">") { + angleBracketsCount--; + if (angleBracketsCount === 0) { + break; + } + } + } + } else if (xmlData.length > i7 + 9 && xmlData[i7 + 1] === "[" && xmlData[i7 + 2] === "C" && xmlData[i7 + 3] === "D" && xmlData[i7 + 4] === "A" && xmlData[i7 + 5] === "T" && xmlData[i7 + 6] === "A" && xmlData[i7 + 7] === "[") { + for (i7 += 8; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "]" && xmlData[i7 + 1] === "]" && xmlData[i7 + 2] === ">") { + i7 += 2; + break; + } + } + } + return i7; +} +var doubleQuote = '"'; +var singleQuote = "'"; +function readAttributeStr(xmlData, i7) { + let attrStr = ""; + let startChar = ""; + let tagClosed = false; + for (; i7 < xmlData.length; i7++) { + if (xmlData[i7] === doubleQuote || xmlData[i7] === singleQuote) { + if (startChar === "") { + startChar = xmlData[i7]; + } else if (startChar !== xmlData[i7]) { + } else { + startChar = ""; + } + } else if (xmlData[i7] === ">") { + if (startChar === "") { + tagClosed = true; + break; + } + } + attrStr += xmlData[i7]; + } + if (startChar !== "") { + return false; + } + return { + value: attrStr, + index: i7, + tagClosed + }; +} +var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); +function validateAttributeString(attrStr, options) { + const matches2 = getAllMatches(attrStr, validAttrStrRegxp); + const attrNames = {}; + for (let i7 = 0; i7 < matches2.length; i7++) { + if (matches2[i7][1].length === 0) { + return getErrorObject("InvalidAttr", "Attribute '" + matches2[i7][2] + "' has no space in starting.", getPositionFromMatch(matches2[i7])); + } else if (matches2[i7][3] !== void 0 && matches2[i7][4] === void 0) { + return getErrorObject("InvalidAttr", "Attribute '" + matches2[i7][2] + "' is without value.", getPositionFromMatch(matches2[i7])); + } else if (matches2[i7][3] === void 0 && !options.allowBooleanAttributes) { + return getErrorObject("InvalidAttr", "boolean attribute '" + matches2[i7][2] + "' is not allowed.", getPositionFromMatch(matches2[i7])); + } + const attrName = matches2[i7][2]; + if (!validateAttrName(attrName)) { + return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches2[i7])); + } + if (!attrNames.hasOwnProperty(attrName)) { + attrNames[attrName] = 1; + } else { + return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches2[i7])); + } + } + return true; +} +function validateNumberAmpersand(xmlData, i7) { + let re4 = /\d/; + if (xmlData[i7] === "x") { + i7++; + re4 = /[\da-fA-F]/; + } + for (; i7 < xmlData.length; i7++) { + if (xmlData[i7] === ";") + return i7; + if (!xmlData[i7].match(re4)) + break; + } + return -1; +} +function validateAmpersand(xmlData, i7) { + i7++; + if (xmlData[i7] === ";") + return -1; + if (xmlData[i7] === "#") { + i7++; + return validateNumberAmpersand(xmlData, i7); + } + let count2 = 0; + for (; i7 < xmlData.length; i7++, count2++) { + if (xmlData[i7].match(/\w/) && count2 < 20) + continue; + if (xmlData[i7] === ";") + break; + return -1; + } + return i7; +} +function getErrorObject(code, message, lineNumber) { + return { + err: { + code, + msg: message, + line: lineNumber.line || lineNumber, + col: lineNumber.col + } + }; +} +function validateAttrName(attrName) { + return isName(attrName); +} +function validateTagName(tagname) { + return isName(tagname); +} +function getLineNumberForPosition(xmlData, index4) { + const lines = xmlData.substring(0, index4).split(/\r?\n/); + return { + line: lines.length, + // column number is last line's length + 1, because column numbering starts at 1: + col: lines[lines.length - 1].length + 1 + }; +} +function getPositionFromMatch(match) { + return match.startIndex + match[1].length; +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +init_dirname(); +init_buffer2(); +init_process2(); +var defaultOptions8 = { + preserveOrder: false, + attributeNamePrefix: "@_", + attributesGroupName: false, + textNodeName: "#text", + ignoreAttributes: true, + removeNSPrefix: false, + // remove NS from tag name or attribute name if true + allowBooleanAttributes: false, + //a tag can have attributes without any value + //ignoreRootElement : false, + parseTagValue: true, + parseAttributeValue: false, + trimValues: true, + //Trim string values of tag and attributes + cdataPropName: false, + numberParseOptions: { + hex: true, + leadingZeros: true, + eNotation: true + }, + tagValueProcessor: function(tagName, val) { + return val; + }, + attributeValueProcessor: function(attrName, val) { + return val; + }, + stopNodes: [], + //nested tags will not be parsed even for errors + alwaysCreateTextNode: false, + isArray: () => false, + commentPropName: false, + unpairedTags: [], + processEntities: true, + htmlEntities: false, + ignoreDeclaration: false, + ignorePiTags: false, + transformTagName: false, + transformAttributeName: false, + updateTag: function(tagName, jPath, attrs) { + return tagName; + }, + // skipEmptyListItem: false + captureMetaData: false +}; +var buildOptions = function(options) { + return Object.assign({}, defaultOptions8, options); +}; + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +init_dirname(); +init_buffer2(); +init_process2(); +var METADATA_SYMBOL; +if (typeof Symbol !== "function") { + METADATA_SYMBOL = "@@xmlMetadata"; +} else { + METADATA_SYMBOL = Symbol("XML Node Metadata"); +} +var XmlNode = class { + constructor(tagname) { + this.tagname = tagname; + this.child = []; + this[":@"] = {}; + } + add(key, val) { + if (key === "__proto__") + key = "#__proto__"; + this.child.push({ [key]: val }); + } + addChild(node, startIndex) { + if (node.tagname === "__proto__") + node.tagname = "#__proto__"; + if (node[":@"] && Object.keys(node[":@"]).length > 0) { + this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); + } else { + this.child.push({ [node.tagname]: node.child }); + } + if (startIndex !== void 0) { + this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex }; + } + } + /** symbol used for metadata */ + static getMetaDataSymbol() { + return METADATA_SYMBOL; + } +}; + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +init_dirname(); +init_buffer2(); +init_process2(); +var DocTypeReader = class { + constructor(processEntities) { + this.suppressValidationErr = !processEntities; + } + readDocType(xmlData, i7) { + const entities = {}; + if (xmlData[i7 + 3] === "O" && xmlData[i7 + 4] === "C" && xmlData[i7 + 5] === "T" && xmlData[i7 + 6] === "Y" && xmlData[i7 + 7] === "P" && xmlData[i7 + 8] === "E") { + i7 = i7 + 9; + let angleBracketsCount = 1; + let hasBody = false, comment = false; + let exp = ""; + for (; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "<" && !comment) { + if (hasBody && hasSeq(xmlData, "!ENTITY", i7)) { + i7 += 7; + let entityName, val; + [entityName, val, i7] = this.readEntityExp(xmlData, i7 + 1, this.suppressValidationErr); + if (val.indexOf("&") === -1) + entities[entityName] = { + regx: RegExp(`&${entityName};`, "g"), + val + }; + } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i7)) { + i7 += 8; + const { index: index4 } = this.readElementExp(xmlData, i7 + 1); + i7 = index4; + } else if (hasBody && hasSeq(xmlData, "!ATTLIST", i7)) { + i7 += 8; + } else if (hasBody && hasSeq(xmlData, "!NOTATION", i7)) { + i7 += 9; + const { index: index4 } = this.readNotationExp(xmlData, i7 + 1, this.suppressValidationErr); + i7 = index4; + } else if (hasSeq(xmlData, "!--", i7)) + comment = true; + else + throw new Error(`Invalid DOCTYPE`); + angleBracketsCount++; + exp = ""; + } else if (xmlData[i7] === ">") { + if (comment) { + if (xmlData[i7 - 1] === "-" && xmlData[i7 - 2] === "-") { + comment = false; + angleBracketsCount--; + } + } else { + angleBracketsCount--; + } + if (angleBracketsCount === 0) { + break; + } + } else if (xmlData[i7] === "[") { + hasBody = true; + } else { + exp += xmlData[i7]; + } + } + if (angleBracketsCount !== 0) { + throw new Error(`Unclosed DOCTYPE`); + } + } else { + throw new Error(`Invalid Tag instead of DOCTYPE`); + } + return { entities, i: i7 }; + } + readEntityExp(xmlData, i7) { + i7 = skipWhitespace(xmlData, i7); + let entityName = ""; + while (i7 < xmlData.length && !/\s/.test(xmlData[i7]) && xmlData[i7] !== '"' && xmlData[i7] !== "'") { + entityName += xmlData[i7]; + i7++; + } + validateEntityName(entityName); + i7 = skipWhitespace(xmlData, i7); + if (!this.suppressValidationErr) { + if (xmlData.substring(i7, i7 + 6).toUpperCase() === "SYSTEM") { + throw new Error("External entities are not supported"); + } else if (xmlData[i7] === "%") { + throw new Error("Parameter entities are not supported"); + } + } + let entityValue = ""; + [i7, entityValue] = this.readIdentifierVal(xmlData, i7, "entity"); + i7--; + return [entityName, entityValue, i7]; + } + readNotationExp(xmlData, i7) { + i7 = skipWhitespace(xmlData, i7); + let notationName = ""; + while (i7 < xmlData.length && !/\s/.test(xmlData[i7])) { + notationName += xmlData[i7]; + i7++; + } + !this.suppressValidationErr && validateEntityName(notationName); + i7 = skipWhitespace(xmlData, i7); + const identifierType = xmlData.substring(i7, i7 + 6).toUpperCase(); + if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") { + throw new Error(`Expected SYSTEM or PUBLIC, found "${identifierType}"`); + } + i7 += identifierType.length; + i7 = skipWhitespace(xmlData, i7); + let publicIdentifier = null; + let systemIdentifier = null; + if (identifierType === "PUBLIC") { + [i7, publicIdentifier] = this.readIdentifierVal(xmlData, i7, "publicIdentifier"); + i7 = skipWhitespace(xmlData, i7); + if (xmlData[i7] === '"' || xmlData[i7] === "'") { + [i7, systemIdentifier] = this.readIdentifierVal(xmlData, i7, "systemIdentifier"); + } + } else if (identifierType === "SYSTEM") { + [i7, systemIdentifier] = this.readIdentifierVal(xmlData, i7, "systemIdentifier"); + if (!this.suppressValidationErr && !systemIdentifier) { + throw new Error("Missing mandatory system identifier for SYSTEM notation"); + } + } + return { notationName, publicIdentifier, systemIdentifier, index: --i7 }; + } + readIdentifierVal(xmlData, i7, type3) { + let identifierVal = ""; + const startChar = xmlData[i7]; + if (startChar !== '"' && startChar !== "'") { + throw new Error(`Expected quoted string, found "${startChar}"`); + } + i7++; + while (i7 < xmlData.length && xmlData[i7] !== startChar) { + identifierVal += xmlData[i7]; + i7++; + } + if (xmlData[i7] !== startChar) { + throw new Error(`Unterminated ${type3} value`); + } + i7++; + return [i7, identifierVal]; + } + readElementExp(xmlData, i7) { + i7 = skipWhitespace(xmlData, i7); + let elementName = ""; + while (i7 < xmlData.length && !/\s/.test(xmlData[i7])) { + elementName += xmlData[i7]; + i7++; + } + if (!this.suppressValidationErr && !isName(elementName)) { + throw new Error(`Invalid element name: "${elementName}"`); + } + i7 = skipWhitespace(xmlData, i7); + let contentModel = ""; + if (xmlData[i7] === "E" && hasSeq(xmlData, "MPTY", i7)) + i7 += 4; + else if (xmlData[i7] === "A" && hasSeq(xmlData, "NY", i7)) + i7 += 2; + else if (xmlData[i7] === "(") { + i7++; + while (i7 < xmlData.length && xmlData[i7] !== ")") { + contentModel += xmlData[i7]; + i7++; + } + if (xmlData[i7] !== ")") { + throw new Error("Unterminated content model"); + } + } else if (!this.suppressValidationErr) { + throw new Error(`Invalid Element Expression, found "${xmlData[i7]}"`); + } + return { + elementName, + contentModel: contentModel.trim(), + index: i7 + }; + } + readAttlistExp(xmlData, i7) { + i7 = skipWhitespace(xmlData, i7); + let elementName = ""; + while (i7 < xmlData.length && !/\s/.test(xmlData[i7])) { + elementName += xmlData[i7]; + i7++; + } + validateEntityName(elementName); + i7 = skipWhitespace(xmlData, i7); + let attributeName = ""; + while (i7 < xmlData.length && !/\s/.test(xmlData[i7])) { + attributeName += xmlData[i7]; + i7++; + } + if (!validateEntityName(attributeName)) { + throw new Error(`Invalid attribute name: "${attributeName}"`); + } + i7 = skipWhitespace(xmlData, i7); + let attributeType = ""; + if (xmlData.substring(i7, i7 + 8).toUpperCase() === "NOTATION") { + attributeType = "NOTATION"; + i7 += 8; + i7 = skipWhitespace(xmlData, i7); + if (xmlData[i7] !== "(") { + throw new Error(`Expected '(', found "${xmlData[i7]}"`); + } + i7++; + let allowedNotations = []; + while (i7 < xmlData.length && xmlData[i7] !== ")") { + let notation = ""; + while (i7 < xmlData.length && xmlData[i7] !== "|" && xmlData[i7] !== ")") { + notation += xmlData[i7]; + i7++; + } + notation = notation.trim(); + if (!validateEntityName(notation)) { + throw new Error(`Invalid notation name: "${notation}"`); + } + allowedNotations.push(notation); + if (xmlData[i7] === "|") { + i7++; + i7 = skipWhitespace(xmlData, i7); + } + } + if (xmlData[i7] !== ")") { + throw new Error("Unterminated list of notations"); + } + i7++; + attributeType += " (" + allowedNotations.join("|") + ")"; + } else { + while (i7 < xmlData.length && !/\s/.test(xmlData[i7])) { + attributeType += xmlData[i7]; + i7++; + } + const validTypes = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !validTypes.includes(attributeType.toUpperCase())) { + throw new Error(`Invalid attribute type: "${attributeType}"`); + } + } + i7 = skipWhitespace(xmlData, i7); + let defaultValue = ""; + if (xmlData.substring(i7, i7 + 8).toUpperCase() === "#REQUIRED") { + defaultValue = "#REQUIRED"; + i7 += 8; + } else if (xmlData.substring(i7, i7 + 7).toUpperCase() === "#IMPLIED") { + defaultValue = "#IMPLIED"; + i7 += 7; + } else { + [i7, defaultValue] = this.readIdentifierVal(xmlData, i7, "ATTLIST"); + } + return { + elementName, + attributeName, + attributeType, + defaultValue, + index: i7 + }; + } +}; +var skipWhitespace = (data, index4) => { + while (index4 < data.length && /\s/.test(data[index4])) { + index4++; + } + return index4; +}; +function hasSeq(data, seq3, i7) { + for (let j6 = 0; j6 < seq3.length; j6++) { + if (seq3[j6] !== data[i7 + j6 + 1]) + return false; + } + return true; +} +function validateEntityName(name2) { + if (isName(name2)) + return name2; + else + throw new Error(`Invalid entity name ${name2}`); +} + +// node_modules/@asyncapi/modelina/node_modules/strnum/strnum.js +init_dirname(); +init_buffer2(); +init_process2(); +var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; +var numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/; +var consider = { + hex: true, + // oct: false, + leadingZeros: true, + decimalPoint: ".", + eNotation: true + //skipLike: /regex/ +}; +function toNumber2(str2, options = {}) { + options = Object.assign({}, consider, options); + if (!str2 || typeof str2 !== "string") + return str2; + let trimmedStr = str2.trim(); + if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) + return str2; + else if (str2 === "0") + return 0; + else if (options.hex && hexRegex.test(trimmedStr)) { + return parse_int(trimmedStr, 16); + } else if (trimmedStr.search(/.+[eE].+/) !== -1) { + return resolveEnotation(str2, trimmedStr, options); + } else { + const match = numRegex.exec(trimmedStr); + if (match) { + const sign = match[1] || ""; + const leadingZeros = match[2]; + let numTrimmedByZeros = trimZeros(match[3]); + const decimalAdjacentToLeadingZeros = sign ? ( + // 0., -00., 000. + str2[leadingZeros.length + 1] === "." + ) : str2[leadingZeros.length] === "."; + if (!options.leadingZeros && (leadingZeros.length > 1 || leadingZeros.length === 1 && !decimalAdjacentToLeadingZeros)) { + return str2; + } else { + const num = Number(trimmedStr); + const parsedStr = String(num); + if (num === 0) + return num; + if (parsedStr.search(/[eE]/) !== -1) { + if (options.eNotation) + return num; + else + return str2; + } else if (trimmedStr.indexOf(".") !== -1) { + if (parsedStr === "0") + return num; + else if (parsedStr === numTrimmedByZeros) + return num; + else if (parsedStr === `${sign}${numTrimmedByZeros}`) + return num; + else + return str2; + } + let n7 = leadingZeros ? numTrimmedByZeros : trimmedStr; + if (leadingZeros) { + return n7 === parsedStr || sign + n7 === parsedStr ? num : str2; + } else { + return n7 === parsedStr || n7 === sign + parsedStr ? num : str2; + } + } + } else { + return str2; + } + } +} +var eNotationRegx = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; +function resolveEnotation(str2, trimmedStr, options) { + if (!options.eNotation) + return str2; + const notation = trimmedStr.match(eNotationRegx); + if (notation) { + let sign = notation[1] || ""; + const eChar = notation[3].indexOf("e") === -1 ? "E" : "e"; + const leadingZeros = notation[2]; + const eAdjacentToLeadingZeros = sign ? ( + // 0E. + str2[leadingZeros.length + 1] === eChar + ) : str2[leadingZeros.length] === eChar; + if (leadingZeros.length > 1 && eAdjacentToLeadingZeros) + return str2; + else if (leadingZeros.length === 1 && (notation[3].startsWith(`.${eChar}`) || notation[3][0] === eChar)) { + return Number(trimmedStr); + } else if (options.leadingZeros && !eAdjacentToLeadingZeros) { + trimmedStr = (notation[1] || "") + notation[3]; + return Number(trimmedStr); + } else + return str2; + } else { + return str2; + } +} +function trimZeros(numStr) { + if (numStr && numStr.indexOf(".") !== -1) { + numStr = numStr.replace(/0+$/, ""); + if (numStr === ".") + numStr = "0"; + else if (numStr[0] === ".") + numStr = "0" + numStr; + else if (numStr[numStr.length - 1] === ".") + numStr = numStr.substring(0, numStr.length - 1); + return numStr; + } + return numStr; +} +function parse_int(numStr, base) { + if (parseInt) + return parseInt(numStr, base); + else if (Number.parseInt) + return Number.parseInt(numStr, base); + else if (window && window.parseInt) + return window.parseInt(numStr, base); + else + throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/ignoreAttributes.js +init_dirname(); +init_buffer2(); +init_process2(); +function getIgnoreAttributesFn(ignoreAttributes) { + if (typeof ignoreAttributes === "function") { + return ignoreAttributes; + } + if (Array.isArray(ignoreAttributes)) { + return (attrName) => { + for (const pattern5 of ignoreAttributes) { + if (typeof pattern5 === "string" && attrName === pattern5) { + return true; + } + if (pattern5 instanceof RegExp && pattern5.test(attrName)) { + return true; + } + } + }; + } + return () => false; +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +var OrderedObjParser = class { + constructor(options) { + this.options = options; + this.currentNode = null; + this.tagsNodeStack = []; + this.docTypeEntities = {}; + this.lastEntities = { + "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, + "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, + "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, + "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } + }; + this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; + this.htmlEntities = { + "space": { regex: /&(nbsp|#160);/g, val: " " }, + // "lt" : { regex: /&(lt|#60);/g, val: "<" }, + // "gt" : { regex: /&(gt|#62);/g, val: ">" }, + // "amp" : { regex: /&(amp|#38);/g, val: "&" }, + // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, + // "apos" : { regex: /&(apos|#39);/g, val: "'" }, + "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, + "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, + "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, + "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, + "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, + "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, + "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, + "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_6, str2) => String.fromCodePoint(Number.parseInt(str2, 10)) }, + "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_6, str2) => String.fromCodePoint(Number.parseInt(str2, 16)) } + }; + this.addExternalEntities = addExternalEntities; + this.parseXml = parseXml; + this.parseTextData = parseTextData; + this.resolveNameSpace = resolveNameSpace; + this.buildAttributesMap = buildAttributesMap; + this.isItStopNode = isItStopNode; + this.replaceEntitiesValue = replaceEntitiesValue; + this.readStopNodeData = readStopNodeData; + this.saveTextToParentTag = saveTextToParentTag; + this.addChild = addChild; + this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); + if (this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(); + this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let i7 = 0; i7 < this.options.stopNodes.length; i7++) { + const stopNodeExp = this.options.stopNodes[i7]; + if (typeof stopNodeExp !== "string") + continue; + if (stopNodeExp.startsWith("*.")) { + this.stopNodesWildcard.add(stopNodeExp.substring(2)); + } else { + this.stopNodesExact.add(stopNodeExp); + } + } + } + } +}; +function addExternalEntities(externalEntities) { + const entKeys = Object.keys(externalEntities); + for (let i7 = 0; i7 < entKeys.length; i7++) { + const ent = entKeys[i7]; + this.lastEntities[ent] = { + regex: new RegExp("&" + ent + ";", "g"), + val: externalEntities[ent] + }; + } +} +function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { + if (val !== void 0) { + if (this.options.trimValues && !dontTrim) { + val = val.trim(); + } + if (val.length > 0) { + if (!escapeEntities) + val = this.replaceEntitiesValue(val); + const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode); + if (newval === null || newval === void 0) { + return val; + } else if (typeof newval !== typeof val || newval !== val) { + return newval; + } else if (this.options.trimValues) { + return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); + } else { + const trimmedVal = val.trim(); + if (trimmedVal === val) { + return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions); + } else { + return val; + } + } + } + } +} +function resolveNameSpace(tagname) { + if (this.options.removeNSPrefix) { + const tags6 = tagname.split(":"); + const prefix = tagname.charAt(0) === "/" ? "/" : ""; + if (tags6[0] === "xmlns") { + return ""; + } + if (tags6.length === 2) { + tagname = prefix + tags6[1]; + } + } + return tagname; +} +var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); +function buildAttributesMap(attrStr, jPath, tagName) { + if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { + const matches2 = getAllMatches(attrStr, attrsRegx); + const len = matches2.length; + const attrs = {}; + for (let i7 = 0; i7 < len; i7++) { + const attrName = this.resolveNameSpace(matches2[i7][1]); + if (this.ignoreAttributesFn(attrName, jPath)) { + continue; + } + let oldVal = matches2[i7][4]; + let aName = this.options.attributeNamePrefix + attrName; + if (attrName.length) { + if (this.options.transformAttributeName) { + aName = this.options.transformAttributeName(aName); + } + if (aName === "__proto__") + aName = "#__proto__"; + if (oldVal !== void 0) { + if (this.options.trimValues) { + oldVal = oldVal.trim(); + } + oldVal = this.replaceEntitiesValue(oldVal); + const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); + if (newVal === null || newVal === void 0) { + attrs[aName] = oldVal; + } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { + attrs[aName] = newVal; + } else { + attrs[aName] = parseValue( + oldVal, + this.options.parseAttributeValue, + this.options.numberParseOptions + ); + } + } else if (this.options.allowBooleanAttributes) { + attrs[aName] = true; + } + } + } + if (!Object.keys(attrs).length) { + return; + } + if (this.options.attributesGroupName) { + const attrCollection = {}; + attrCollection[this.options.attributesGroupName] = attrs; + return attrCollection; + } + return attrs; + } +} +var parseXml = function(xmlData) { + xmlData = xmlData.replace(/\r\n?/g, "\n"); + const xmlObj = new XmlNode("!xml"); + let currentNode = xmlObj; + let textData = ""; + let jPath = ""; + const docTypeReader = new DocTypeReader(this.options.processEntities); + for (let i7 = 0; i7 < xmlData.length; i7++) { + const ch = xmlData[i7]; + if (ch === "<") { + if (xmlData[i7 + 1] === "/") { + const closeIndex = findClosingIndex(xmlData, ">", i7, "Closing Tag is not closed."); + let tagName = xmlData.substring(i7 + 2, closeIndex).trim(); + if (this.options.removeNSPrefix) { + const colonIndex = tagName.indexOf(":"); + if (colonIndex !== -1) { + tagName = tagName.substr(colonIndex + 1); + } + } + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + if (currentNode) { + textData = this.saveTextToParentTag(textData, currentNode, jPath); + } + const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); + if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { + throw new Error(`Unpaired tag can not be used as closing tag: `); + } + let propIndex = 0; + if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { + propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); + this.tagsNodeStack.pop(); + } else { + propIndex = jPath.lastIndexOf("."); + } + jPath = jPath.substring(0, propIndex); + currentNode = this.tagsNodeStack.pop(); + textData = ""; + i7 = closeIndex; + } else if (xmlData[i7 + 1] === "?") { + let tagData = readTagExp(xmlData, i7, false, "?>"); + if (!tagData) + throw new Error("Pi Tag is not closed."); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { + } else { + const childNode = new XmlNode(tagData.tagName); + childNode.add(this.options.textNodeName, ""); + if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); + } + this.addChild(currentNode, childNode, jPath, i7); + } + i7 = tagData.closeIndex + 1; + } else if (xmlData.substr(i7 + 1, 3) === "!--") { + const endIndex = findClosingIndex(xmlData, "-->", i7 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const comment = xmlData.substring(i7 + 4, endIndex - 2); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); + } + i7 = endIndex; + } else if (xmlData.substr(i7 + 1, 2) === "!D") { + const result2 = docTypeReader.readDocType(xmlData, i7); + this.docTypeEntities = result2.entities; + i7 = result2.i; + } else if (xmlData.substr(i7 + 1, 2) === "![") { + const closeIndex = findClosingIndex(xmlData, "]]>", i7, "CDATA is not closed.") - 2; + const tagExp = xmlData.substring(i7 + 9, closeIndex); + textData = this.saveTextToParentTag(textData, currentNode, jPath); + let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); + if (val == void 0) + val = ""; + if (this.options.cdataPropName) { + currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); + } else { + currentNode.add(this.options.textNodeName, val); + } + i7 = closeIndex + 2; + } else { + let result2 = readTagExp(xmlData, i7, this.options.removeNSPrefix); + let tagName = result2.tagName; + const rawTagName = result2.rawTagName; + let tagExp = result2.tagExp; + let attrExpPresent = result2.attrExpPresent; + let closeIndex = result2.closeIndex; + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + if (currentNode && textData) { + if (currentNode.tagname !== "!xml") { + textData = this.saveTextToParentTag(textData, currentNode, jPath, false); + } + } + const lastTag = currentNode; + if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { + currentNode = this.tagsNodeStack.pop(); + jPath = jPath.substring(0, jPath.lastIndexOf(".")); + } + if (tagName !== xmlObj.tagname) { + jPath += jPath ? "." + tagName : tagName; + } + const startIndex = i7; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, jPath, tagName)) { + let tagContent = ""; + if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substr(0, tagName.length - 1); + jPath = jPath.substr(0, jPath.length - 1); + tagExp = tagName; + } else { + tagExp = tagExp.substr(0, tagExp.length - 1); + } + i7 = result2.closeIndex; + } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { + i7 = result2.closeIndex; + } else { + const result3 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); + if (!result3) + throw new Error(`Unexpected end of ${rawTagName}`); + i7 = result3.i; + tagContent = result3.tagContent; + } + const childNode = new XmlNode(tagName); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + if (tagContent) { + tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); + } + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + childNode.add(this.options.textNodeName, tagContent); + this.addChild(currentNode, childNode, jPath, startIndex); + } else { + if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { + if (tagName[tagName.length - 1] === "/") { + tagName = tagName.substr(0, tagName.length - 1); + jPath = jPath.substr(0, jPath.length - 1); + tagExp = tagName; + } else { + tagExp = tagExp.substr(0, tagExp.length - 1); + } + if (this.options.transformTagName) { + tagName = this.options.transformTagName(tagName); + } + const childNode = new XmlNode(tagName); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath, startIndex); + jPath = jPath.substr(0, jPath.lastIndexOf(".")); + } else { + const childNode = new XmlNode(tagName); + this.tagsNodeStack.push(currentNode); + if (tagName !== tagExp && attrExpPresent) { + childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); + } + this.addChild(currentNode, childNode, jPath, startIndex); + currentNode = childNode; + } + textData = ""; + i7 = closeIndex; + } + } + } else { + textData += xmlData[i7]; + } + } + return xmlObj.child; +}; +function addChild(currentNode, childNode, jPath, startIndex) { + if (!this.options.captureMetaData) + startIndex = void 0; + const result2 = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); + if (result2 === false) { + } else if (typeof result2 === "string") { + childNode.tagname = result2; + currentNode.addChild(childNode, startIndex); + } else { + currentNode.addChild(childNode, startIndex); + } +} +var replaceEntitiesValue = function(val) { + if (this.options.processEntities) { + for (let entityName in this.docTypeEntities) { + const entity = this.docTypeEntities[entityName]; + val = val.replace(entity.regx, entity.val); + } + for (let entityName in this.lastEntities) { + const entity = this.lastEntities[entityName]; + val = val.replace(entity.regex, entity.val); + } + if (this.options.htmlEntities) { + for (let entityName in this.htmlEntities) { + const entity = this.htmlEntities[entityName]; + val = val.replace(entity.regex, entity.val); + } + } + val = val.replace(this.ampEntity.regex, this.ampEntity.val); + } + return val; +}; +function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { + if (textData) { + if (isLeafNode === void 0) + isLeafNode = currentNode.child.length === 0; + textData = this.parseTextData( + textData, + currentNode.tagname, + jPath, + false, + currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, + isLeafNode + ); + if (textData !== void 0 && textData !== "") + currentNode.add(this.options.textNodeName, textData); + textData = ""; + } + return textData; +} +function isItStopNode(stopNodesExact, stopNodesWildcard, jPath, currentTagName) { + if (stopNodesWildcard && stopNodesWildcard.has(currentTagName)) + return true; + if (stopNodesExact && stopNodesExact.has(jPath)) + return true; + return false; +} +function tagExpWithClosingIndex(xmlData, i7, closingChar = ">") { + let attrBoundary; + let tagExp = ""; + for (let index4 = i7; index4 < xmlData.length; index4++) { + let ch = xmlData[index4]; + if (attrBoundary) { + if (ch === attrBoundary) + attrBoundary = ""; + } else if (ch === '"' || ch === "'") { + attrBoundary = ch; + } else if (ch === closingChar[0]) { + if (closingChar[1]) { + if (xmlData[index4 + 1] === closingChar[1]) { + return { + data: tagExp, + index: index4 + }; + } + } else { + return { + data: tagExp, + index: index4 + }; + } + } else if (ch === " ") { + ch = " "; + } + tagExp += ch; + } +} +function findClosingIndex(xmlData, str2, i7, errMsg) { + const closingIndex = xmlData.indexOf(str2, i7); + if (closingIndex === -1) { + throw new Error(errMsg); + } else { + return closingIndex + str2.length - 1; + } +} +function readTagExp(xmlData, i7, removeNSPrefix, closingChar = ">") { + const result2 = tagExpWithClosingIndex(xmlData, i7 + 1, closingChar); + if (!result2) + return; + let tagExp = result2.data; + const closeIndex = result2.index; + const separatorIndex = tagExp.search(/\s/); + let tagName = tagExp; + let attrExpPresent = true; + if (separatorIndex !== -1) { + tagName = tagExp.substring(0, separatorIndex); + tagExp = tagExp.substring(separatorIndex + 1).trimStart(); + } + const rawTagName = tagName; + if (removeNSPrefix) { + const colonIndex = tagName.indexOf(":"); + if (colonIndex !== -1) { + tagName = tagName.substr(colonIndex + 1); + attrExpPresent = tagName !== result2.data.substr(colonIndex + 1); + } + } + return { + tagName, + tagExp, + closeIndex, + attrExpPresent, + rawTagName + }; +} +function readStopNodeData(xmlData, tagName, i7) { + const startIndex = i7; + let openTagCount = 1; + for (; i7 < xmlData.length; i7++) { + if (xmlData[i7] === "<") { + if (xmlData[i7 + 1] === "/") { + const closeIndex = findClosingIndex(xmlData, ">", i7, `${tagName} is not closed`); + let closeTagName = xmlData.substring(i7 + 2, closeIndex).trim(); + if (closeTagName === tagName) { + openTagCount--; + if (openTagCount === 0) { + return { + tagContent: xmlData.substring(startIndex, i7), + i: closeIndex + }; + } + } + i7 = closeIndex; + } else if (xmlData[i7 + 1] === "?") { + const closeIndex = findClosingIndex(xmlData, "?>", i7 + 1, "StopNode is not closed."); + i7 = closeIndex; + } else if (xmlData.substr(i7 + 1, 3) === "!--") { + const closeIndex = findClosingIndex(xmlData, "-->", i7 + 3, "StopNode is not closed."); + i7 = closeIndex; + } else if (xmlData.substr(i7 + 1, 2) === "![") { + const closeIndex = findClosingIndex(xmlData, "]]>", i7, "StopNode is not closed.") - 2; + i7 = closeIndex; + } else { + const tagData = readTagExp(xmlData, i7, ">"); + if (tagData) { + const openTagName = tagData && tagData.tagName; + if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { + openTagCount++; + } + i7 = tagData.closeIndex; + } + } + } + } +} +function parseValue(val, shouldParse, options) { + if (shouldParse && typeof val === "string") { + const newval = val.trim(); + if (newval === "true") + return true; + else if (newval === "false") + return false; + else + return toNumber2(val, options); + } else { + if (isExist(val)) { + return val; + } else { + return ""; + } + } +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/node2json.js +init_dirname(); +init_buffer2(); +init_process2(); +var METADATA_SYMBOL2 = XmlNode.getMetaDataSymbol(); +function prettify(node, options) { + return compress(node, options); +} +function compress(arr, options, jPath) { + let text; + const compressedObj = {}; + for (let i7 = 0; i7 < arr.length; i7++) { + const tagObj = arr[i7]; + const property2 = propName(tagObj); + let newJpath = ""; + if (jPath === void 0) + newJpath = property2; + else + newJpath = jPath + "." + property2; + if (property2 === options.textNodeName) { + if (text === void 0) + text = tagObj[property2]; + else + text += "" + tagObj[property2]; + } else if (property2 === void 0) { + continue; + } else if (tagObj[property2]) { + let val = compress(tagObj[property2], options, newJpath); + const isLeaf = isLeafTag(val, options); + if (tagObj[METADATA_SYMBOL2] !== void 0) { + val[METADATA_SYMBOL2] = tagObj[METADATA_SYMBOL2]; + } + if (tagObj[":@"]) { + assignAttributes(val, tagObj[":@"], newJpath, options); + } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { + val = val[options.textNodeName]; + } else if (Object.keys(val).length === 0) { + if (options.alwaysCreateTextNode) + val[options.textNodeName] = ""; + else + val = ""; + } + if (compressedObj[property2] !== void 0 && compressedObj.hasOwnProperty(property2)) { + if (!Array.isArray(compressedObj[property2])) { + compressedObj[property2] = [compressedObj[property2]]; + } + compressedObj[property2].push(val); + } else { + if (options.isArray(property2, newJpath, isLeaf)) { + compressedObj[property2] = [val]; + } else { + compressedObj[property2] = val; + } + } + } + } + if (typeof text === "string") { + if (text.length > 0) + compressedObj[options.textNodeName] = text; + } else if (text !== void 0) + compressedObj[options.textNodeName] = text; + return compressedObj; +} +function propName(obj) { + const keys2 = Object.keys(obj); + for (let i7 = 0; i7 < keys2.length; i7++) { + const key = keys2[i7]; + if (key !== ":@") + return key; + } +} +function assignAttributes(obj, attrMap, jpath, options) { + if (attrMap) { + const keys2 = Object.keys(attrMap); + const len = keys2.length; + for (let i7 = 0; i7 < len; i7++) { + const atrrName = keys2[i7]; + if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { + obj[atrrName] = [attrMap[atrrName]]; + } else { + obj[atrrName] = attrMap[atrrName]; + } + } + } +} +function isLeafTag(obj, options) { + const { textNodeName } = options; + const propCount = Object.keys(obj).length; + if (propCount === 0) { + return true; + } + if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { + return true; + } + return false; +} + +// node_modules/@asyncapi/modelina/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +var XMLParser = class { + constructor(options) { + this.externalEntities = {}; + this.options = buildOptions(options); + } + /** + * Parse XML dats to JS object + * @param {string|Uint8Array} xmlData + * @param {boolean|Object} validationOption + */ + parse(xmlData, validationOption) { + if (typeof xmlData !== "string" && xmlData.toString) { + xmlData = xmlData.toString(); + } else if (typeof xmlData !== "string") { + throw new Error("XML data is accepted in String or Bytes[] form."); + } + if (validationOption) { + if (validationOption === true) + validationOption = {}; + const result2 = validate14(xmlData, validationOption); + if (result2 !== true) { + throw Error(`${result2.err.msg}:${result2.err.line}:${result2.err.col}`); + } + } + const orderedObjParser = new OrderedObjParser(this.options); + orderedObjParser.addExternalEntities(this.externalEntities); + const orderedResult = orderedObjParser.parseXml(xmlData); + if (this.options.preserveOrder || orderedResult === void 0) + return orderedResult; + else + return prettify(orderedResult, this.options); + } + /** + * Add Entity which is not by default supported by this library + * @param {string} key + * @param {string} value + */ + addEntity(key, value2) { + if (value2.indexOf("&") !== -1) { + throw new Error("Entity value can't have '&'"); + } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { + throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); + } else if (value2 === "&") { + throw new Error("An entity with value '&' is not permitted"); + } else { + this.externalEntities[key] = value2; + } + } + /** + * Returns a Symbol that can be used to access the metadata + * property on a node. + * + * If Symbol is not available in the environment, an ordinary property is used + * and the name of the property is here returned. + * + * The XMLMetaData property is only present when `captureMetaData` + * is true in the options. + */ + static getMetaDataSymbol() { + return XmlNode.getMetaDataSymbol(); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/XsdInputProcessor.js +var __awaiter51 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var XsdInputProcessor = class extends AbstractInputProcessor { + /** + * Determines if the input should be processed as XSD + * + * @param input + */ + shouldProcess(input) { + if (!input || typeof input !== "string") { + return false; + } + const xsdIndicators = [ + "xs:schema", + "xsd:schema", + 'xmlns:xs="http://www.w3.org/2001/XMLSchema"', + 'xmlns:xsd="http://www.w3.org/2001/XMLSchema"' + ]; + return xsdIndicators.some((indicator) => input.includes(indicator)); + } + /** + * Process XSD input and convert to InputMetaModel + * + * @param input XSD as string + */ + // eslint-disable-next-line require-await + process(input) { + return __awaiter51(this, void 0, void 0, function* () { + if (!this.shouldProcess(input)) { + throw new Error("Input is not an XSD Schema, so it cannot be processed."); + } + Logger2.debug("Processing input as XSD Schema document"); + const inputModel = new InputMetaModel(); + inputModel.originalInput = input; + try { + const parser3 = new XMLParser({ + ignoreAttributes: false, + attributeNamePrefix: "@_", + parseAttributeValue: true, + trimValues: true + }); + const parsedXsd = parser3.parse(input); + const xsdSchema = XsdSchema.toSchema(parsedXsd); + const metaModels = XsdToMetaModel(xsdSchema); + for (const metaModel of metaModels) { + inputModel.models[metaModel.name] = metaModel; + } + Logger2.debug("Completed processing input as XSD Schema document"); + return inputModel; + } catch (error2) { + const errorMessage = `Failed to process XSD input: ${error2.message}`; + Logger2.error(errorMessage, error2); + throw new Error(errorMessage); + } + }); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/processors/InputProcessor.js +var InputProcessor = class { + constructor() { + this.processors = /* @__PURE__ */ new Map(); + this.setProcessor("asyncapi", new AsyncAPIInputProcessor()); + this.setProcessor("swagger", new SwaggerInputProcessor()); + this.setProcessor("openapi", new OpenAPIInputProcessor()); + this.setProcessor("default", new JsonSchemaInputProcessor()); + this.setProcessor("typescript", new TypeScriptInputProcessor()); + this.setProcessor("avro", new AvroSchemaInputProcessor()); + this.setProcessor("xsd", new XsdInputProcessor()); + } + /** + * Set a processor. + * + * @param type of processor + * @param processor + */ + setProcessor(type3, processor) { + this.processors.set(type3, processor); + } + /** + * + * @returns all processors + */ + getProcessors() { + return this.processors; + } + /** + * The processor code which delegates the processing to the correct implementation. + * + * @param input to process + * @param options passed to the processors + */ + process(input, options) { + for (const [type3, processor] of this.processors) { + if (type3 === "default") { + continue; + } + if (processor.shouldProcess(input)) { + return processor.process(input, options); + } + } + const defaultProcessor = this.processors.get("default"); + if (defaultProcessor !== void 0) { + return defaultProcessor.process(input, options); + } + return Promise.reject(new Error("No default processor found")); + } +}; +InputProcessor.processor = new InputProcessor(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/AbstractGenerator.js +var __awaiter52 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var defaultGeneratorOptions = { + indentation: { + type: IndentationTypes.SPACES, + size: 2 + } +}; +var AbstractGenerator = class { + constructor(languageName, options) { + this.languageName = languageName; + this.options = options; + } + process(input) { + return InputProcessor.processor.process(input, this.options.processorOptions); + } + /** + * This function returns an instance of the dependency manager which is either a factory or an instance. + */ + getDependencyManagerInstance(options) { + if (options.dependencyManager === void 0) { + throw new Error("Internal error, could not find dependency manager instance"); + } + if (typeof options.dependencyManager === "function") { + return options.dependencyManager(); + } + return options.dependencyManager; + } + setImplementedByForModels(constrainedModels, constrainedModel) { + if (!constrainedModel.options.extend) { + return; + } + for (const extend3 of constrainedModel.options.extend) { + const extendModel = constrainedModels.find((m7) => m7.constrainedModel.name === extend3.name); + if (!extendModel) { + throw new Error(`Could not find the model ${extend3.name} to extend in the constrained models`); + } + if (!extendModel.constrainedModel.options.implementedBy) { + extendModel.constrainedModel.options.implementedBy = []; + } + extendModel.constrainedModel.options.implementedBy.push(constrainedModel); + } + } + setParentsForModels(unionConstrainedModelsWithDepManager, constrainedModel) { + for (const unionConstrainedModel of unionConstrainedModelsWithDepManager) { + if (unionConstrainedModel.constrainedModel instanceof ConstrainedUnionModel && unionConstrainedModel.constrainedModel.union.some((m7) => m7.name === constrainedModel.name && m7.type === constrainedModel.type)) { + if (!constrainedModel.options.parents) { + constrainedModel.options.parents = []; + } + constrainedModel.options.parents.push(unionConstrainedModel.constrainedModel); + } + } + } + /** + * Generates an array of ConstrainedMetaModel with its dependency manager from an InputMetaModel. + * It also adds parents to the ConstrainedMetaModel's which can be used in renderers which needs to know what parents they belong to. + */ + getConstrainedModels(inputModel) { + const getConstrainedMetaModelWithDepManager = (model) => { + const dependencyManager = this.getDependencyManager(this.options); + const constrainedModel = this.constrainToMetaModel(model, { + dependencyManager + }); + return { + constrainedModel, + dependencyManager + }; + }; + const unionConstrainedModelsWithDepManager = []; + const constrainedModelsWithDepManager = []; + for (const model of Object.values(inputModel.models)) { + if (model instanceof UnionModel) { + unionConstrainedModelsWithDepManager.push(getConstrainedMetaModelWithDepManager(model)); + continue; + } + constrainedModelsWithDepManager.push(getConstrainedMetaModelWithDepManager(model)); + } + const constrainedModels = [ + ...unionConstrainedModelsWithDepManager, + ...constrainedModelsWithDepManager + ]; + for (const { constrainedModel } of constrainedModels) { + this.setImplementedByForModels(constrainedModels, constrainedModel); + this.setParentsForModels(unionConstrainedModelsWithDepManager, constrainedModel); + } + return constrainedModels; + } + /** + * Generates the full output of a model, instead of a scattered model. + * + * OutputModels result is no longer the model itself, but including package, package dependencies and model dependencies. + * + */ + generateCompleteModels(input, completeOptions) { + return __awaiter52(this, void 0, void 0, function* () { + const inputModel = yield this.processInput(input); + return Promise.all(this.getConstrainedModels(inputModel).map((_a2) => __awaiter52(this, [_a2], void 0, function* ({ constrainedModel, dependencyManager }) { + const renderedOutput = yield this.renderCompleteModel({ + constrainedModel, + inputModel, + completeOptions, + options: { dependencyManager } + }); + return OutputModel.toOutputModel({ + result: renderedOutput.result, + modelName: renderedOutput.renderedName, + dependencies: renderedOutput.dependencies, + model: constrainedModel, + inputModel + }); + }))); + }); + } + /** + * Generates a scattered model where dependencies and rendered results are separated. + */ + generate(input) { + return __awaiter52(this, void 0, void 0, function* () { + const inputModel = yield this.processInput(input); + return Promise.all(this.getConstrainedModels(inputModel).map((_a2) => __awaiter52(this, [_a2], void 0, function* ({ constrainedModel, dependencyManager }) { + const renderedOutput = yield this.render({ + constrainedModel, + inputModel, + options: { + dependencyManager + } + }); + return OutputModel.toOutputModel({ + result: renderedOutput.result, + modelName: renderedOutput.renderedName, + dependencies: renderedOutput.dependencies, + model: constrainedModel, + inputModel + }); + }))); + }); + } + /** + * Process any of the input formats to the appropriate InputMetaModel type and split out the meta models + * based on the requirements of the generators + * + * @param input + */ + processInput(input) { + return __awaiter52(this, void 0, void 0, function* () { + const rawInputModel = input instanceof InputMetaModel ? input : yield this.process(input); + const splitOutModels = {}; + for (const model of Object.values(rawInputModel.models)) { + const splitModels = this.splitMetaModel(model); + for (const splitModel of splitModels) { + splitOutModels[splitModel.name] = splitModel; + } + } + rawInputModel.models = splitOutModels; + return rawInputModel; + }); + } + /** + * Get all presets (default and custom ones from options) for a given preset type (class, enum, etc). + */ + getPresets(presetType) { + const filteredPresets = []; + const defaultPreset = this.options.defaultPreset; + if (defaultPreset !== void 0) { + filteredPresets.push([defaultPreset[String(presetType)], this.options]); + } + const presets = this.options.presets || []; + for (const p7 of presets) { + if (isPresetWithOptions(p7)) { + const preset = p7.preset[String(presetType)]; + if (preset) { + filteredPresets.push([preset, p7.options]); + } + } else { + const preset = p7[String(presetType)]; + if (preset) { + filteredPresets.push([preset, void 0]); + } + } + } + return filteredPresets; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/AbstractRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter53 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var AbstractRenderer = class { + constructor(options, generator, presets, model, inputModel) { + this.options = options; + this.generator = generator; + this.presets = presets; + this.model = model; + this.inputModel = inputModel; + } + renderLine(line) { + return `${line} +`; + } + renderBlock(lines, newLines = 1) { + const n7 = Array(newLines).fill("\n").join(""); + return lines.filter(Boolean).join(n7); + } + indent(content, size2, type3) { + var _a2, _b; + size2 = size2 || ((_a2 = this.options.indentation) === null || _a2 === void 0 ? void 0 : _a2.size); + type3 = type3 || ((_b = this.options.indentation) === null || _b === void 0 ? void 0 : _b.type); + return FormatHelpers.indent(content, size2, type3); + } + runSelfPreset() { + return this.runPreset("self"); + } + runAdditionalContentPreset() { + return this.runPreset("additionalContent"); + } + runPreset(functionName_1) { + return __awaiter53(this, arguments, void 0, function* (functionName, params = {}) { + let content = ""; + for (const [preset, options] of this.presets) { + if (typeof preset[String(functionName)] === "function") { + const presetRenderedContent = yield preset[String(functionName)](Object.assign(Object.assign({}, params), { + renderer: this, + content, + options, + model: this.model, + inputModel: this.inputModel + })); + if (typeof presetRenderedContent === "string") { + content = presetRenderedContent; + } else { + content = ""; + } + } + } + return content; + }); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/javascript/Constants.js +init_dirname(); +init_buffer2(); +init_process2(); +var RESERVED_JAVASCRIPT_KEYWORDS = [ + //Standard reserved keywords + "abstract", + "arguments", + "await", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "eval", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "let", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with", + "yield", + // Reserved for > ECMAScript 5/6 + "abstract", + "boolean", + "byte", + "char", + "double", + "final", + "float", + "goto", + "int", + "long", + "native", + "short", + "synchronized", + "throws", + "transient", + "volatile", + //Reserved built-in objects, properties and methods + "hasOwnProperty", + "Infinity", + "isFinite", + "isNaN", + "isPrototypeOf", + "length", + "Math", + "NaN", + "name", + "Number", + "Object", + "prototype", + "String", + "toString", + "undefined", + "valueOf", + //Java reserved words + "getClass", + "java", + "JavaArray", + "javaClass", + "JavaObject", + "JavaPackage", + //Other reserved words + "alert", + "all", + "anchor", + "anchors", + "area", + "assign", + "blur", + "button", + "checkbox", + "clearInterval", + "clearTimeout", + "clientInformation", + "close", + "closed", + "confirm", + "constructor", + "crypto", + "decodeURI", + "decodeURIComponent", + "defaultStatus", + "document", + "element", + "elements", + "embed", + "embeds", + "encodeURI", + "encodeURIComponent", + "escape", + "event", + "fileUpload", + "focus", + "form", + "forms", + "frame", + "innerHeight", + "innerWidth", + "layer", + "layers", + "link", + "location", + "mimeTypes", + "navigate", + "navigator", + "frames", + "frameRate", + "hidden", + "history", + "image", + "images", + "offscreenBuffering", + "open", + "opener", + "option", + "outerHeight", + "outerWidth", + "packages", + "pageXOffset", + "pageYOffset", + "parent", + "parseFloat", + "parseInt", + "password", + "pkcs11", + "plugin", + "prompt", + "propertyIsEnum", + "radio", + "reset", + "screenX", + "screenY", + "scroll", + "secure", + "select", + "self", + "setInterval", + "setTimeout", + "status", + "submit", + "taint", + "text", + "textarea", + "top", + "unescape", + "untaint", + "window" +]; +function isReservedJavaScriptKeyword(word, forceLowerCase = true) { + return checkForReservedKeyword(word, RESERVED_JAVASCRIPT_KEYWORDS, forceLowerCase); +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptGenerator.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptPreset.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/renderers/ClassRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptObjectRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); +var TypeScriptRenderer = class extends AbstractRenderer { + constructor(options, generator, presets, model, inputModel, dependencyManager) { + super(options, generator, presets, model, inputModel); + this.dependencyManager = dependencyManager; + } + renderComments(lines) { + lines = FormatHelpers.breakLines(lines); + const renderedLines = lines.map((line) => ` * ${line}`).join("\n"); + return `/** +${renderedLines} + */`; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptObjectRenderer.js +var __awaiter54 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var TypeScriptObjectRenderer = class extends TypeScriptRenderer { + /** + * Render all the properties for the model by calling the property preset per property. + */ + renderProperties() { + return __awaiter54(this, void 0, void 0, function* () { + const properties = this.model.properties || {}; + const content = []; + for (const property2 of Object.values(properties)) { + const rendererProperty = yield this.runPropertyPreset(property2); + content.push(rendererProperty); + } + return this.renderBlock(content); + }); + } + renderProperty(property2) { + var _a2; + const requiredProperty = property2.required === false ? "?" : ""; + let preRenderedProperty; + if (this.options.rawPropertyNames && this.options.modelType === "interface") { + preRenderedProperty = `'${property2.unconstrainedPropertyName}'`; + } else { + preRenderedProperty = property2.propertyName; + } + const renderedProperty = `${preRenderedProperty}${requiredProperty}`; + if ((_a2 = property2.property.options.const) === null || _a2 === void 0 ? void 0 : _a2.value) { + return `${renderedProperty}: ${property2.property.options.const.value}${this.options.modelType === "class" ? ` = ${property2.property.options.const.value}` : ""};`; + } + return `${renderedProperty}: ${property2.property.type};`; + } + runPropertyPreset(property2) { + return this.runPreset("property", { property: property2 }); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/renderers/ClassRenderer.js +var __awaiter55 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var ClassRenderer = class extends TypeScriptObjectRenderer { + defaultSelf() { + return __awaiter55(this, void 0, void 0, function* () { + const content = [ + yield this.renderProperties(), + yield this.runCtorPreset(), + yield this.renderAccessors(), + yield this.runAdditionalContentPreset() + ]; + return `class ${this.model.name} { +${this.indent(this.renderBlock(content, 2))} +}`; + }); + } + runCtorPreset() { + return this.runPreset("ctor"); + } + renderAccessors() { + return __awaiter55(this, void 0, void 0, function* () { + const properties = this.model.properties; + const content = []; + for (const property2 of Object.values(properties)) { + const getter = yield this.runGetterPreset(property2); + const setter = yield this.runSetterPreset(property2); + content.push(this.renderBlock([getter, setter])); + } + return this.renderBlock(content, 2); + }); + } + runGetterPreset(property2) { + return this.runPreset("getter", { property: property2 }); + } + runSetterPreset(property2) { + return this.runPreset("setter", { property: property2 }); + } +}; +var TS_DEFAULT_CLASS_PRESET = { + self({ renderer }) { + return renderer.defaultSelf(); + }, + ctor({ renderer, model }) { + const properties = model.properties || {}; + const assignments = []; + const ctorProperties = []; + for (const [propertyName, property2] of Object.entries(properties)) { + if (property2.property.options.const) { + continue; + } + assignments.push(`this._${propertyName} = input.${propertyName};`); + ctorProperties.push(renderer.renderProperty(property2).replace(";", ",")); + } + return `constructor(input: { +${renderer.indent(renderer.renderBlock(ctorProperties))} +}) { +${renderer.indent(renderer.renderBlock(assignments))} +}`; + }, + property({ renderer, property: property2 }) { + return `private _${renderer.renderProperty(property2)}`; + }, + getter({ property: property2 }) { + var _a2; + return `get ${property2.propertyName}(): ${((_a2 = property2.property.options.const) === null || _a2 === void 0 ? void 0 : _a2.value) ? property2.property.options.const.value : property2.property.type}${property2.required === false ? " | undefined" : ""} { return this._${property2.propertyName}; }`; + }, + setter({ property: property2 }) { + var _a2; + if ((_a2 = property2.property.options.const) === null || _a2 === void 0 ? void 0 : _a2.value) { + return ""; + } + return `set ${property2.propertyName}(${property2.propertyName}: ${property2.property.type}${property2.required === false ? " | undefined" : ""}) { this._${property2.propertyName} = ${property2.propertyName}; }`; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/renderers/InterfaceRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter56 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var InterfaceRenderer = class extends TypeScriptObjectRenderer { + defaultSelf() { + return __awaiter56(this, void 0, void 0, function* () { + const content = [ + yield this.renderProperties(), + yield this.runAdditionalContentPreset() + ]; + return `interface ${this.model.name} { +${this.indent(this.renderBlock(content, 2))} +}`; + }); + } +}; +var TS_DEFAULT_INTERFACE_PRESET = { + self({ renderer }) { + return renderer.defaultSelf(); + }, + property({ renderer, property: property2 }) { + return renderer.renderProperty(property2); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/renderers/EnumRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); +var __awaiter57 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var EnumRenderer = class extends TypeScriptRenderer { + defaultSelf() { + return __awaiter57(this, void 0, void 0, function* () { + const content = [ + yield this.renderItems(), + yield this.runAdditionalContentPreset() + ]; + return `enum ${this.model.name} { +${this.indent(this.renderBlock(content, 2))} +}`; + }); + } + renderUnionEnum(model) { + const enums = model.values || []; + const enumTypes = enums.map((t8) => t8.value).join(" | "); + return `type ${model.name} = ${enumTypes};`; + } + renderItems() { + return __awaiter57(this, void 0, void 0, function* () { + const enums = this.model.values || []; + const items = []; + for (const item of enums) { + const renderedItem = yield this.runItemPreset(item); + items.push(renderedItem); + } + return this.renderBlock(items); + }); + } + runItemPreset(item) { + return this.runPreset("item", { item }); + } +}; +var TS_DEFAULT_ENUM_PRESET = { + self({ renderer, options, model }) { + if (options.enumType === "union" && model instanceof ConstrainedEnumModel) { + return renderer.renderUnionEnum(model); + } + return renderer.defaultSelf(); + }, + item({ item }) { + return `${item.key} = ${item.value},`; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/renderers/TypeRenderer.js +init_dirname(); +init_buffer2(); +init_process2(); +var TypeRenderer = class extends TypeScriptRenderer { + defaultSelf() { + return `type ${this.model.name} = ${this.model.type};`; + } +}; +var TS_DEFAULT_TYPE_PRESET = { + self({ renderer }) { + return renderer.defaultSelf(); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptPreset.js +var TS_DEFAULT_PRESET = { + class: TS_DEFAULT_CLASS_PRESET, + interface: TS_DEFAULT_INTERFACE_PRESET, + enum: TS_DEFAULT_ENUM_PRESET, + type: TS_DEFAULT_TYPE_PRESET +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptConstrainer.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/constrainer/EnumConstrainer.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/Constants.js +init_dirname(); +init_buffer2(); +init_process2(); +var RESERVED_TYPESCRIPT_KEYWORDS = [ + "break", + "case", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "enum", + "export", + "extends", + "false", + "finally", + "for", + "function", + "if", + "import", + "in", + "instanceof", + "new", + "null", + "return", + "super", + "switch", + "this", + "throw", + "true", + "try", + "typeof", + "var", + "void", + "while", + "with", + "any", + "boolean", + "constructor", + "declare", + "get", + "module", + "require", + "number", + "set", + "string", + "symbol", + "type", + "from", + "of", + // Strict mode reserved words + "arguments", + "as", + "implements", + "interface", + "let", + "package", + "private", + "protected", + "public", + "static", + "yield" +]; +function isReservedTypeScriptKeyword(word, forceLowerCase = true, options) { + const isTsReserved = checkForReservedKeyword(word, RESERVED_TYPESCRIPT_KEYWORDS, forceLowerCase); + const isJsReserved = (options === null || options === void 0 ? void 0 : options.useJavascriptReservedKeywords) ? isReservedJavaScriptKeyword(word) : false; + return isTsReserved || isJsReserved; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/constrainer/EnumConstrainer.js +var DefaultEnumKeyConstraints = { + NO_SPECIAL_CHAR: (value2) => { + return FormatHelpers.replaceSpecialCharacters(value2, { + exclude: ["_", "$"], + separator: "_" + }); + }, + NO_NUMBER_START_CHAR, + NO_DUPLICATE_KEYS: NO_DUPLICATE_ENUM_KEYS, + NO_EMPTY_VALUE, + NAMING_FORMATTER: FormatHelpers.toConstantCase, + NO_RESERVED_KEYWORDS: (value2, options) => { + return NO_RESERVED_KEYWORDS(value2, (word) => isReservedTypeScriptKeyword(word, true, options)); + } +}; +function defaultEnumKeyConstraints(customConstraints) { + const constraints = Object.assign(Object.assign({}, DefaultEnumKeyConstraints), customConstraints); + return ({ enumKey, enumModel, constrainedEnumModel, options }) => { + let constrainedEnumKey = enumKey; + constrainedEnumKey = constraints.NO_SPECIAL_CHAR(constrainedEnumKey); + constrainedEnumKey = constraints.NO_NUMBER_START_CHAR(constrainedEnumKey); + constrainedEnumKey = constraints.NO_EMPTY_VALUE(constrainedEnumKey); + constrainedEnumKey = constraints.NO_RESERVED_KEYWORDS(constrainedEnumKey, options); + if (constrainedEnumKey !== enumKey) { + constrainedEnumKey = constraints.NO_DUPLICATE_KEYS(constrainedEnumModel, enumModel, constrainedEnumKey, constraints.NAMING_FORMATTER); + } + constrainedEnumKey = constraints.NAMING_FORMATTER(constrainedEnumKey); + return constrainedEnumKey; + }; +} +function defaultEnumValueConstraints() { + return ({ enumValue }) => { + let normalizedEnumValue; + switch (typeof enumValue) { + case "string": + case "boolean": + normalizedEnumValue = `"${enumValue}"`; + break; + case "bigint": + case "number": { + normalizedEnumValue = `${enumValue}`; + break; + } + case "object": { + normalizedEnumValue = `'${JSON.stringify(enumValue)}'`; + break; + } + default: { + normalizedEnumValue = String(enumValue); + } + } + return normalizedEnumValue; + }; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/constrainer/ModelNameConstrainer.js +init_dirname(); +init_buffer2(); +init_process2(); +var DefaultModelNameConstraints = { + NO_SPECIAL_CHAR: (value2) => { + return FormatHelpers.replaceSpecialCharacters(value2, { + exclude: [" ", "_", "$"], + separator: "_" + }); + }, + NO_NUMBER_START_CHAR, + NO_EMPTY_VALUE, + NAMING_FORMATTER: (value2) => { + return FormatHelpers.toPascalCase(value2); + }, + NO_RESERVED_KEYWORDS: (value2, options) => { + return NO_RESERVED_KEYWORDS(value2, (word) => isReservedTypeScriptKeyword(word, true, options)); + } +}; +function defaultModelNameConstraints(customConstraints) { + const constraints = Object.assign(Object.assign({}, DefaultModelNameConstraints), customConstraints); + return ({ modelName, options }) => { + let constrainedValue = modelName; + constrainedValue = constraints.NO_SPECIAL_CHAR(constrainedValue); + constrainedValue = constraints.NO_NUMBER_START_CHAR(constrainedValue); + constrainedValue = constraints.NO_EMPTY_VALUE(constrainedValue); + constrainedValue = constraints.NO_RESERVED_KEYWORDS(constrainedValue, options); + constrainedValue = constraints.NAMING_FORMATTER(constrainedValue); + return constrainedValue; + }; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/constrainer/PropertyKeyConstrainer.js +init_dirname(); +init_buffer2(); +init_process2(); +var DefaultPropertyKeyConstraints = { + NO_SPECIAL_CHAR: (value2) => { + return FormatHelpers.replaceSpecialCharacters(value2, { + exclude: [" ", "_", "$"], + separator: "_" + }); + }, + NO_NUMBER_START_CHAR, + NO_DUPLICATE_PROPERTIES, + NO_EMPTY_VALUE, + NAMING_FORMATTER: FormatHelpers.toCamelCase, + NO_RESERVED_KEYWORDS: (value2, options) => { + return NO_RESERVED_KEYWORDS(value2, (word) => isReservedTypeScriptKeyword(word, true, options)); + } +}; +function defaultPropertyKeyConstraints(customConstraints) { + const constraints = Object.assign(Object.assign({}, DefaultPropertyKeyConstraints), customConstraints); + return ({ objectPropertyModel, constrainedObjectModel, objectModel, options }) => { + let constrainedPropertyKey = objectPropertyModel.propertyName; + constrainedPropertyKey = constraints.NO_SPECIAL_CHAR(constrainedPropertyKey); + constrainedPropertyKey = constraints.NO_NUMBER_START_CHAR(constrainedPropertyKey); + constrainedPropertyKey = constraints.NO_EMPTY_VALUE(constrainedPropertyKey); + constrainedPropertyKey = constraints.NO_RESERVED_KEYWORDS(constrainedPropertyKey, options); + if (constrainedPropertyKey !== objectPropertyModel.propertyName) { + constrainedPropertyKey = constraints.NO_DUPLICATE_PROPERTIES(constrainedObjectModel, objectModel, constrainedPropertyKey, constraints.NAMING_FORMATTER); + } + constrainedPropertyKey = constraints.NAMING_FORMATTER(constrainedPropertyKey); + return constrainedPropertyKey; + }; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/constrainer/ConstantConstrainer.js +init_dirname(); +init_buffer2(); +init_process2(); +var getConstrainedEnumModelConstant = (args) => { + const constrainedEnumValueModel = args.constrainedEnumModel.values.find((value2) => value2.originalInput === args.constOptions.originalInput); + if (constrainedEnumValueModel) { + return `${args.constrainedMetaModel.type}.${constrainedEnumValueModel.key}`; + } +}; +function defaultConstantConstraints() { + return ({ constrainedMetaModel }) => { + const constOptions = constrainedMetaModel.options.const; + if (!constOptions) { + return void 0; + } + if (constrainedMetaModel instanceof ConstrainedReferenceModel && constrainedMetaModel.ref instanceof ConstrainedEnumModel) { + return getConstrainedEnumModelConstant({ + constrainedMetaModel, + constrainedEnumModel: constrainedMetaModel.ref, + constOptions + }); + } else if (constrainedMetaModel instanceof ConstrainedEnumModel) { + return getConstrainedEnumModelConstant({ + constrainedMetaModel, + constrainedEnumModel: constrainedMetaModel, + constOptions + }); + } else if (constrainedMetaModel instanceof ConstrainedStringModel) { + return `'${constOptions.originalInput}'`; + } + return void 0; + }; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptConstrainer.js +function applyNullable(model, type3) { + if (model.options.isNullable) { + return `${type3} | null`; + } + return type3; +} +var TypeScriptDefaultTypeMapping = { + Object({ constrainedModel }) { + return constrainedModel.name; + }, + Reference({ constrainedModel }) { + return constrainedModel.name; + }, + Any() { + return "any"; + }, + Float({ constrainedModel }) { + return applyNullable(constrainedModel, "number"); + }, + Integer({ constrainedModel }) { + return applyNullable(constrainedModel, "number"); + }, + String({ constrainedModel }) { + var _a2; + const format5 = (_a2 = constrainedModel === null || constrainedModel === void 0 ? void 0 : constrainedModel.options) === null || _a2 === void 0 ? void 0 : _a2.format; + if (format5 === "date-time" || format5 === "date") { + return applyNullable(constrainedModel, "Date"); + } + return applyNullable(constrainedModel, "string"); + }, + Boolean({ constrainedModel }) { + return applyNullable(constrainedModel, "boolean"); + }, + Tuple({ constrainedModel }) { + const tupleTypes = constrainedModel.tuple.map((constrainedType) => { + return constrainedType.value.type; + }); + const tupleType2 = `[${tupleTypes.join(", ")}]`; + return applyNullable(constrainedModel, tupleType2); + }, + Array({ constrainedModel }) { + let arrayType2 = constrainedModel.valueModel.type; + if (constrainedModel.valueModel instanceof ConstrainedUnionModel) { + arrayType2 = `(${arrayType2})`; + } + arrayType2 = `${arrayType2}[]`; + return applyNullable(constrainedModel, arrayType2); + }, + Enum({ constrainedModel }) { + return constrainedModel.name; + }, + Union(args) { + const unionTypes = args.constrainedModel.union.map((unionModel) => { + var _a2; + if ((_a2 = unionModel.options.const) === null || _a2 === void 0 ? void 0 : _a2.value) { + return `${unionModel.options.const.value}`; + } + return unionModel.type; + }); + return applyNullable(args.constrainedModel, unionTypes.join(" | ")); + }, + Dictionary({ constrainedModel, options }) { + let keyType; + if (constrainedModel.key instanceof ConstrainedUnionModel) { + Logger2.error("Key for dictionary is not allowed to be union type, falling back to any model."); + keyType = "any"; + } else { + keyType = constrainedModel.key.type; + } + let dictionaryType; + switch (options.mapType) { + case "indexedObject": + dictionaryType = `{ [name: ${keyType}]: ${constrainedModel.value.type} }`; + break; + case "record": + dictionaryType = `Record<${keyType}, ${constrainedModel.value.type}>`; + break; + case "map": + dictionaryType = `Map<${keyType}, ${constrainedModel.value.type}>`; + break; + } + return applyNullable(constrainedModel, dictionaryType); + } +}; +var TypeScriptDefaultConstraints = { + enumKey: defaultEnumKeyConstraints(), + enumValue: defaultEnumValueConstraints(), + modelName: defaultModelNameConstraints(), + propertyKey: defaultPropertyKeyConstraints(), + constant: defaultConstantConstraints() +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptDependencyManager.js +init_dirname(); +init_buffer2(); +init_process2(); +var TypeScriptDependencyManager = class extends AbstractDependencyManager { + constructor(options, dependencies = []) { + super(dependencies); + this.options = options; + } + /** + * Simple helper function to add a dependency correct based on the module system that the user defines. + */ + addTypeScriptDependency(toImport, fromModule) { + const dependencyImport = this.renderDependency(toImport, fromModule); + this.addDependency(dependencyImport); + } + /** + * Simple helper function to render a dependency based on the module system that the user defines. + */ + renderDependency(toImport, fromModule) { + return renderJavaScriptDependency(toImport, fromModule, this.options.moduleSystem); + } + /** + * Render the model dependencies based on the option + */ + renderCompleteModelDependencies(model, exportType) { + const dependencyObject = exportType === "named" ? `{${model.name}}` : model.name; + return this.renderDependency(dependencyObject, `./${model.name}`); + } + /** + * Render the exported statement for the model based on the options + */ + renderExport(model, exportType) { + const cjsExport = exportType === "default" ? `module.exports = ${model.name};` : `exports.${model.name} = ${model.name};`; + const esmExport = exportType === "default" ? `export default ${model.name}; +` : `export { ${model.name} };`; + return this.options.moduleSystem === "CJS" ? cjsExport : esmExport; + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptGenerator.js +var __awaiter58 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var SAFE_MODEL_TYPES = [ + ConstrainedAnyModel, + ConstrainedBooleanModel, + ConstrainedFloatModel, + ConstrainedIntegerModel, + ConstrainedStringModel, + ConstrainedReferenceModel, + ConstrainedObjectModel, + ConstrainedEnumModel +]; +var TypeScriptGenerator = class _TypeScriptGenerator extends AbstractGenerator { + constructor(options) { + const realizedOptions = _TypeScriptGenerator.getOptions(options); + super("TypeScript", realizedOptions); + } + /** + * Returns the TypeScript options by merging custom options with default ones. + */ + static getOptions(options) { + const optionsToUse = mergePartialAndDefault(_TypeScriptGenerator.defaultOptions, options); + const dependencyManagerOverwritten = optionsToUse.dependencyManager !== _TypeScriptGenerator.defaultOptions.dependencyManager; + if (!dependencyManagerOverwritten) { + optionsToUse.dependencyManager = () => { + return new TypeScriptDependencyManager(optionsToUse); + }; + } + return optionsToUse; + } + /** + * Wrapper to get an instance of the dependency manager + */ + getDependencyManager(options) { + return this.getDependencyManagerInstance(options); + } + splitMetaModel(model) { + const metaModelsToSplit = { + splitEnum: true, + splitObject: true + }; + return split2(model, metaModelsToSplit); + } + constrainToMetaModel(model, options) { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + return constrainMetaModel(this.options.typeMapping, this.options.constraints, { + metaModel: model, + dependencyManager: dependencyManagerToUse, + options: Object.assign({}, this.options), + constrainedName: "" + //This is just a placeholder, it will be constrained within the function + }, SAFE_MODEL_TYPES); + } + /** + * Render a complete model result where the model code, library and model dependencies are all bundled appropriately. + * + * @param model + * @param inputModel + * @param options + */ + renderCompleteModel(args) { + return __awaiter58(this, void 0, void 0, function* () { + const completeModelOptionsToUse = mergePartialAndDefault(_TypeScriptGenerator.defaultCompleteModelOptions, args.completeOptions); + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), args.options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + const outputModel = yield this.render(Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, optionsToUse), { dependencyManager: dependencyManagerToUse }) })); + const modelDependencies = args.constrainedModel.getNearestDependencies(); + const modelDependencyImports = modelDependencies.map((model) => { + return dependencyManagerToUse.renderCompleteModelDependencies(model, completeModelOptionsToUse.exportType); + }); + const modelExport = dependencyManagerToUse.renderExport(args.constrainedModel, completeModelOptionsToUse.exportType); + const modelCode = `${outputModel.result} +${modelExport}`; + const outputContent = `${[ + ...modelDependencyImports, + ...outputModel.dependencies + ].join("\n")} +${modelCode}`; + return RenderOutput.toRenderOutput({ + result: outputContent, + renderedName: outputModel.renderedName, + dependencies: outputModel.dependencies + }); + }); + } + /** + * Render any ConstrainedMetaModel to code based on the type + */ + render(args) { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), args.options)); + if (args.constrainedModel instanceof ConstrainedObjectModel) { + if (this.options.modelType === "interface") { + return this.renderInterface(args.constrainedModel, args.inputModel, optionsToUse); + } + return this.renderClass(args.constrainedModel, args.inputModel, optionsToUse); + } else if (args.constrainedModel instanceof ConstrainedEnumModel) { + return this.renderEnum(args.constrainedModel, args.inputModel, optionsToUse); + } + return this.renderType(args.constrainedModel, args.inputModel, optionsToUse); + } + renderClass(model, inputModel, options) { + return __awaiter58(this, void 0, void 0, function* () { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + const presets = this.getPresets("class"); + const renderer = new ClassRenderer(optionsToUse, this, presets, model, inputModel, dependencyManagerToUse); + const result2 = yield renderer.runSelfPreset(); + return RenderOutput.toRenderOutput({ + result: result2, + renderedName: model.name, + dependencies: dependencyManagerToUse.dependencies + }); + }); + } + renderInterface(model, inputModel, options) { + return __awaiter58(this, void 0, void 0, function* () { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + const presets = this.getPresets("interface"); + const renderer = new InterfaceRenderer(optionsToUse, this, presets, model, inputModel, dependencyManagerToUse); + const result2 = yield renderer.runSelfPreset(); + return RenderOutput.toRenderOutput({ + result: result2, + renderedName: model.name, + dependencies: dependencyManagerToUse.dependencies + }); + }); + } + renderEnum(model, inputModel, options) { + return __awaiter58(this, void 0, void 0, function* () { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + const presets = this.getPresets("enum"); + const renderer = new EnumRenderer(optionsToUse, this, presets, model, inputModel, dependencyManagerToUse); + const result2 = yield renderer.runSelfPreset(); + return RenderOutput.toRenderOutput({ + result: result2, + renderedName: model.name, + dependencies: dependencyManagerToUse.dependencies + }); + }); + } + renderType(model, inputModel, options) { + return __awaiter58(this, void 0, void 0, function* () { + const optionsToUse = _TypeScriptGenerator.getOptions(Object.assign(Object.assign({}, this.options), options)); + const dependencyManagerToUse = this.getDependencyManager(optionsToUse); + const presets = this.getPresets("type"); + const renderer = new TypeRenderer(optionsToUse, this, presets, model, inputModel, dependencyManagerToUse); + const result2 = yield renderer.runSelfPreset(); + return RenderOutput.toRenderOutput({ + result: result2, + renderedName: model.name, + dependencies: dependencyManagerToUse.dependencies + }); + }); + } +}; +TypeScriptGenerator.defaultOptions = Object.assign(Object.assign({}, defaultGeneratorOptions), { + renderTypes: true, + modelType: "class", + enumType: "enum", + mapType: "map", + defaultPreset: TS_DEFAULT_PRESET, + typeMapping: TypeScriptDefaultTypeMapping, + constraints: TypeScriptDefaultConstraints, + moduleSystem: "ESM", + rawPropertyNames: false, + useJavascriptReservedKeywords: true, + // Temporarily set + dependencyManager: () => { + return {}; + } +}); +TypeScriptGenerator.defaultCompleteModelOptions = { + exportType: "default" +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/TypeScriptFileGenerator.js +init_dirname(); +init_buffer2(); +init_process2(); +init_path(); +var __awaiter59 = function(thisArg, _arguments, P6, generator) { + function adopt(value2) { + return value2 instanceof P6 ? value2 : new P6(function(resolve3) { + resolve3(value2); + }); + } + return new (P6 || (P6 = Promise))(function(resolve3, reject2) { + function fulfilled(value2) { + try { + step(generator.next(value2)); + } catch (e10) { + reject2(e10); + } + } + function rejected(value2) { + try { + step(generator["throw"](value2)); + } catch (e10) { + reject2(e10); + } + } + function step(result2) { + result2.done ? resolve3(result2.value) : adopt(result2.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var TypeScriptFileGenerator = class extends TypeScriptGenerator { + /** + * Generates all the models to an output directory each model with their own separate files. + * + * @param input + * @param outputDirectory where you want the models generated to + * @param options + * @param ensureFilesWritten verify that the files is completely written before returning, this can happen if the file system is swamped with write requests. + */ + generateToFiles(input_1, outputDirectory_1, options_1) { + return __awaiter59(this, arguments, void 0, function* (input, outputDirectory, options, ensureFilesWritten = false) { + let generatedModels = yield this.generateCompleteModels(input, options || {}); + generatedModels = generatedModels.filter((outputModel) => { + return outputModel.modelName !== ""; + }); + for (const outputModel of generatedModels) { + const filePath = resolve(outputDirectory, `${outputModel.modelName}.ts`); + yield FileHelpers.writerToFileSystem(outputModel.result, filePath, ensureFilesWritten); + } + return generatedModels; + }); + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/CommonPreset.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/utils/ExampleFunction.js +init_dirname(); +init_buffer2(); +init_process2(); +function renderValueFromModel(model) { + if (model instanceof ConstrainedEnumModel && model.values.length > 0) { + return model.values[0].value; + } else if (model instanceof ConstrainedReferenceModel) { + return `${model.name}.example()`; + } else if (model instanceof ConstrainedUnionModel && model.union.length > 0) { + return renderValueFromModel(model.union[0]); + } else if (model instanceof ConstrainedArrayModel) { + const arrayType2 = renderValueFromModel(model.valueModel); + return `[${arrayType2}]`; + } else if (model instanceof ConstrainedTupleModel && model.tuple.length > 0) { + const values2 = model.tuple.map((tupleModel) => { + return renderValueFromModel(tupleModel.value); + }); + return `[${values2.join(",")}]`; + } else if (model instanceof ConstrainedStringModel) { + return '"string"'; + } else if (model instanceof ConstrainedIntegerModel) { + return "0"; + } else if (model instanceof ConstrainedFloatModel) { + return "0.0"; + } else if (model instanceof ConstrainedBooleanModel) { + return "true"; + } + return void 0; +} +function renderExampleFunction({ model }) { + const properties = model.properties || {}; + const setProperties = []; + for (const [propertyName, property2] of Object.entries(properties)) { + const potentialRenderedValue = renderValueFromModel(property2.property); + if (potentialRenderedValue === void 0) { + continue; + } + setProperties.push(` instance.${propertyName} = ${potentialRenderedValue};`); + } + return `public static example(): ${model.type} { + const instance = new ${model.type}({} as any); +${setProperties.join("\n")} + return instance; +}`; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/utils/UnmarshalFunction.js +init_dirname(); +init_buffer2(); +init_process2(); +function renderUnmarshalProperty(modelInstanceVariable, model, isOptional2 = false) { + var _a2, _b; + const nullValue = isOptional2 ? "undefined" : "null"; + if (model instanceof ConstrainedReferenceModel && !(model.ref instanceof ConstrainedEnumModel)) { + return `${model.type}.unmarshal(${modelInstanceVariable})`; + } + if (model instanceof ConstrainedArrayModel && model.valueModel instanceof ConstrainedReferenceModel && !(model.valueModel.ref instanceof ConstrainedEnumModel) && !(model.valueModel instanceof ConstrainedUnionModel)) { + return `${modelInstanceVariable} == null + ? ${nullValue} + : ${modelInstanceVariable}.map((item: any) => ${model.valueModel.type}.unmarshal(item))`; + } + if (model instanceof ConstrainedStringModel && ["date", "date-time"].includes((_b = (_a2 = model.options) === null || _a2 === void 0 ? void 0 : _a2.format) !== null && _b !== void 0 ? _b : "")) { + return `${modelInstanceVariable} == null ? ${nullValue} : new Date(${modelInstanceVariable})`; + } + return `${modelInstanceVariable}`; +} +function unmarshalRegularProperty(propModel) { + if (propModel.property.options.const) { + return void 0; + } + const modelInstanceVariable = `obj["${propModel.unconstrainedPropertyName}"]`; + const isOptional2 = propModel.required === false; + const unmarshalCode = renderUnmarshalProperty(modelInstanceVariable, propModel.property, isOptional2); + return `if (${modelInstanceVariable} !== undefined) { + instance.${propModel.propertyName} = ${unmarshalCode}; +}`; +} +function unmarshalDictionary(model) { + const setDictionaryProperties = []; + const unmarshalDictionaryProperties = []; + const properties = model.properties || {}; + const propertyKeys = [...Object.entries(properties)]; + const originalPropertyNames = propertyKeys.map(([, model2]) => { + return model2.unconstrainedPropertyName; + }); + const unwrapDictionaryProperties = getDictionary(properties); + for (const [prop, propModel] of unwrapDictionaryProperties) { + const modelInstanceVariable = "value as any"; + const unmarshalCode = renderUnmarshalProperty(modelInstanceVariable, propModel.property.value); + setDictionaryProperties.push(`instance.${prop} = new Map();`); + unmarshalDictionaryProperties.push(`instance.${prop}.set(key, ${unmarshalCode});`); + } + const corePropertyKeys = originalPropertyNames.map((propertyKey) => `"${propertyKey}"`).join(","); + if (setDictionaryProperties.length > 0) { + return `${setDictionaryProperties.join("\n")} +const propsToCheck = Object.entries(obj).filter((([key,]) => {return ![${corePropertyKeys}].includes(key);})); +for (const [key, value] of propsToCheck) { + ${unmarshalDictionaryProperties.join("\n")} +}`; + } + return ""; +} +function renderUnmarshal({ renderer, model }) { + const properties = model.properties || {}; + const normalProperties = getNormalProperties(properties); + const unmarshalNormalProperties = normalProperties.map(([, propModel]) => unmarshalRegularProperty(propModel)); + const unwrappedDictionaryCode = unmarshalDictionary(model); + return `public static unmarshal(json: string | object): ${model.type} { + const obj = typeof json === "object" ? json : JSON.parse(json); + const instance = new ${model.type}({} as any); + +${renderer.indent(unmarshalNormalProperties.join("\n"))} + +${renderer.indent(unwrappedDictionaryCode)} + return instance; +}`; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/utils/MarshalFunction.js +init_dirname(); +init_buffer2(); +init_process2(); +function realizePropertyFactory(prop) { + return `\${typeof ${prop} === 'number' || typeof ${prop} === 'boolean' ? ${prop} : JSON.stringify(${prop})}`; +} +function renderMarshalProperty(modelInstanceVariable, model) { + if (model instanceof ConstrainedReferenceModel && !(model.ref instanceof ConstrainedEnumModel)) { + return `\${${modelInstanceVariable} && typeof ${modelInstanceVariable} === 'object' && 'marshal' in ${modelInstanceVariable} && typeof ${modelInstanceVariable}.marshal === 'function' ? ${modelInstanceVariable}.marshal() : JSON.stringify(${modelInstanceVariable})}`; + } + return realizePropertyFactory(modelInstanceVariable); +} +function renderTupleSerialization(modelInstanceVariable, unconstrainedProperty, tuple) { + const t8 = tuple.tuple.map((tupleEntry) => { + const temp = renderMarshalProperty(`${modelInstanceVariable}[${tupleEntry.index}]`, tupleEntry.value); + return `if(${modelInstanceVariable}[${tupleEntry.index}]) { + serializedTuple[${tupleEntry.index}] = \`${temp}\` +} else { + serializedTuple[${tupleEntry.index}] = null; +}`; + }); + return `const serializedTuple: any[] = []; +${t8.join("\n")} +json += \`"${unconstrainedProperty}": [\${serializedTuple.join(',')}],\`;`; +} +function renderUnionSerializationArray(modelInstanceVariable, prop, unconstrainedProperty, unionModel) { + const propName2 = `${prop}JsonValues`; + const allUnionReferences = unionModel.union.filter((model) => { + return model instanceof ConstrainedReferenceModel && !(model.ref instanceof ConstrainedEnumModel); + }).map((model) => { + return `unionItem instanceof ${model.type}`; + }); + const hasUnionReference = allUnionReferences.length > 0; + let unionSerialization = `${propName2}.push(typeof unionItem === 'number' || typeof unionItem === 'boolean' ? unionItem : JSON.stringify(unionItem))`; + if (hasUnionReference) { + unionSerialization = `if(unionItem && typeof unionItem === 'object' && 'marshal' in unionItem && typeof unionItem.marshal === 'function') { + ${propName2}.push(unionItem.marshal()); + } else { + ${propName2}.push(typeof unionItem === 'number' || typeof unionItem === 'boolean' ? unionItem : JSON.stringify(unionItem)) + }`; + } + return `const ${propName2}: any[] = []; + for (const unionItem of ${modelInstanceVariable}) { + ${unionSerialization} + } + json += \`"${unconstrainedProperty}": [\${${propName2}.join(',')}],\`;`; +} +function renderArraySerialization(modelInstanceVariable, prop, unconstrainedProperty, arrayModel) { + const propName2 = `${prop}JsonValues`; + return `let ${propName2}: any[] = []; + for (const unionItem of ${modelInstanceVariable}) { + ${propName2}.push(\`${renderMarshalProperty("unionItem", arrayModel.valueModel)}\`); + } + json += \`"${unconstrainedProperty}": [\${${propName2}.join(',')}],\`;`; +} +function renderUnionSerialization(modelInstanceVariable, unconstrainedProperty, unionModel) { + const allUnionReferences = unionModel.union.filter((model) => { + return model instanceof ConstrainedReferenceModel && !(model.ref instanceof ConstrainedEnumModel); + }).map((model) => { + return `${modelInstanceVariable} instanceof ${model.type}`; + }); + const hasUnionReference = allUnionReferences.length > 0; + if (hasUnionReference) { + return `if(${modelInstanceVariable} && typeof ${modelInstanceVariable} === 'object' && 'marshal' in ${modelInstanceVariable} && typeof ${modelInstanceVariable}.marshal === 'function') { + json += \`"${unconstrainedProperty}": \${${modelInstanceVariable}.marshal()},\`; + } else { + json += \`"${unconstrainedProperty}": ${realizePropertyFactory(modelInstanceVariable)},\`; + }`; + } + return `json += \`"${unconstrainedProperty}": ${realizePropertyFactory(modelInstanceVariable)},\`;`; +} +function renderDictionarySerialization(properties) { + const unwrapDictionaryProperties = getDictionary(properties); + const originalPropertyNames = getOriginalPropertyList(properties); + return unwrapDictionaryProperties.map(([prop, propModel]) => { + let dictionaryValueType; + if (propModel.property.value instanceof ConstrainedUnionModel) { + dictionaryValueType = renderUnionSerialization("value", "${key}", propModel.property.value); + } else { + const type3 = renderMarshalProperty("value", propModel.property); + dictionaryValueType = `json += \`"\${key}": ${type3},\`;`; + } + return `if(this.${prop} !== undefined) { + for (const [key, value] of this.${prop}.entries()) { + //Only unwrap those that are not already a property in the JSON object + if([${originalPropertyNames.map((value2) => `"${value2}"`).join(",")}].includes(String(key))) continue; + ${dictionaryValueType} + } +}`; + }); +} +function renderNormalProperties(properties) { + const normalProperties = getNormalProperties(properties); + return normalProperties.map(([prop, propModel]) => { + const modelInstanceVariable = `this.${prop}`; + let marshalCode; + if (propModel.property instanceof ConstrainedArrayModel && propModel.property.valueModel instanceof ConstrainedUnionModel) { + marshalCode = renderUnionSerializationArray(modelInstanceVariable, prop, propModel.unconstrainedPropertyName, propModel.property.valueModel); + } else if (propModel.property instanceof ConstrainedUnionModel) { + marshalCode = renderUnionSerialization(modelInstanceVariable, propModel.unconstrainedPropertyName, propModel.property); + } else if (propModel.property instanceof ConstrainedArrayModel) { + marshalCode = renderArraySerialization(modelInstanceVariable, prop, propModel.unconstrainedPropertyName, propModel.property); + } else if (propModel.property instanceof ConstrainedTupleModel) { + marshalCode = renderTupleSerialization(modelInstanceVariable, propModel.unconstrainedPropertyName, propModel.property); + } else { + const propMarshalCode = renderMarshalProperty(modelInstanceVariable, propModel.property); + marshalCode = `json += \`"${propModel.unconstrainedPropertyName}": ${propMarshalCode},\`;`; + } + return `if(${modelInstanceVariable} !== undefined) { + ${marshalCode} +}`; + }); +} +function renderMarshal({ renderer, model }) { + const properties = model.properties || {}; + const marshalNormalProperties = renderNormalProperties(properties); + const marshalUnwrapDictionaryProperties = renderDictionarySerialization(properties); + return `public marshal() : string { + let json = '{' +${renderer.indent(marshalNormalProperties.join("\n"))} +${renderer.indent(marshalUnwrapDictionaryProperties.join("\n"))} + //Remove potential last comma + return \`\${json.charAt(json.length-1) === ',' ? json.slice(0, json.length-1) : json}}\`; +}`; +} + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/CommonPreset.js +var TS_COMMON_PRESET = { + class: { + additionalContent({ renderer, model, content, options }) { + options = options || {}; + const blocks = []; + if (options.marshalling === true) { + blocks.push(renderMarshal({ renderer, model })); + blocks.push(renderUnmarshal({ renderer, model })); + } + if (options.example === true) { + blocks.push(renderExampleFunction({ model })); + } + return renderer.renderBlock([content, ...blocks], 2); + } + } +}; + +// node_modules/@asyncapi/modelina/lib/esm/generators/typescript/presets/DescriptionPreset.js +init_dirname(); +init_buffer2(); +init_process2(); +var renderDescription = ({ renderer, content, item }) => { + var _a2; + const desc = (_a2 = item.originalInput.description) === null || _a2 === void 0 ? void 0 : _a2.trim(); + const examples = item.originalInput.examples; + const formattedExamples = `@example ${(examples === null || examples === void 0 ? void 0 : examples.join) ? examples.join(", ") : examples}`; + if (desc || examples) { + const doc = renderer.renderComments(`${desc || ""} +${examples ? formattedExamples : ""}`.trim()); + return `${doc} +${content}`; + } + return content; +}; +var TS_DESCRIPTION_PRESET = { + class: { + self({ renderer, model, content }) { + return renderDescription({ renderer, content, item: model }); + }, + getter({ renderer, property: property2, content }) { + return renderDescription({ renderer, content, item: property2.property }); + } + }, + interface: { + self({ renderer, model, content }) { + return renderDescription({ renderer, content, item: model }); + }, + property({ renderer, property: property2, content }) { + return renderDescription({ renderer, content, item: property2.property }); + } + }, + type: { + self({ renderer, model, content }) { + return renderDescription({ renderer, content, item: model }); + } + }, + enum: { + self({ renderer, model, content }) { + return renderDescription({ renderer, content, item: model }); + } + } +}; + +// src/codegen/generators/typescript/utils.ts +function pascalCase2(value2) { + return FormatHelpers.toPascalCase(value2); +} +function findRegexFromChannel(channel) { + let topicWithWildcardGroup = channel.replaceAll(/\//g, "\\/"); + topicWithWildcardGroup = topicWithWildcardGroup.replaceAll( + /{[^}]+}/g, + "([^.]*)" + ); + return `/^${topicWithWildcardGroup}$/`; +} +var RESERVED_TYPESCRIPT_KEYWORDS2 = [ + "break", + "case", + "catch", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "else", + "enum", + "export", + "extends", + "false", + "finally", + "for", + "function", + "if", + "import", + "in", + "instanceof", + "new", + "null", + "return", + "super", + "switch", + "this", + "throw", + "true", + "try", + "typeof", + "var", + "void", + "while", + "with", + "any", + "boolean", + "constructor", + "declare", + "get", + "module", + "require", + "number", + "set", + "string", + "symbol", + "type", + "from", + "of", + // Strict mode reserved words + "arguments", + "as", + "implements", + "interface", + "let", + "package", + "private", + "protected", + "public", + "static", + "yield" +]; +var defaultCodegenTypescriptModelinaOptions = { + constraints: { + modelName: defaultModelNameConstraints({ + NO_RESERVED_KEYWORDS: (name2) => { + return name2; + }, + NO_SPECIAL_CHAR: (name2) => { + return name2.replace(/\W/g, " "); + } + }), + propertyKey: defaultPropertyKeyConstraints({ + NO_RESERVED_KEYWORDS: (value2) => { + return NO_RESERVED_KEYWORDS( + value2, + (word) => ( + // Filter out all the keywords that does not ruin the code + checkForReservedKeyword( + word, + RESERVED_TYPESCRIPT_KEYWORDS2.filter((filteredValue) => { + return filteredValue !== "type"; + }), + true + ) + ) + ); + } + }) + } +}; + +// node_modules/zod/index.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/external.js +var external_exports = {}; +__export(external_exports, { + BRAND: () => BRAND, + DIRTY: () => DIRTY, + EMPTY_PATH: () => EMPTY_PATH, + INVALID: () => INVALID, + NEVER: () => NEVER, + OK: () => OK, + ParseStatus: () => ParseStatus, + Schema: () => ZodType, + ZodAny: () => ZodAny, + ZodArray: () => ZodArray, + ZodBigInt: () => ZodBigInt, + ZodBoolean: () => ZodBoolean, + ZodBranded: () => ZodBranded, + ZodCatch: () => ZodCatch, + ZodDate: () => ZodDate, + ZodDefault: () => ZodDefault, + ZodDiscriminatedUnion: () => ZodDiscriminatedUnion, + ZodEffects: () => ZodEffects, + ZodEnum: () => ZodEnum, + ZodError: () => ZodError, + ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind, + ZodFunction: () => ZodFunction, + ZodIntersection: () => ZodIntersection, + ZodIssueCode: () => ZodIssueCode, + ZodLazy: () => ZodLazy, + ZodLiteral: () => ZodLiteral, + ZodMap: () => ZodMap, + ZodNaN: () => ZodNaN, + ZodNativeEnum: () => ZodNativeEnum, + ZodNever: () => ZodNever, + ZodNull: () => ZodNull, + ZodNullable: () => ZodNullable, + ZodNumber: () => ZodNumber, + ZodObject: () => ZodObject, + ZodOptional: () => ZodOptional, + ZodParsedType: () => ZodParsedType, + ZodPipeline: () => ZodPipeline, + ZodPromise: () => ZodPromise, + ZodReadonly: () => ZodReadonly, + ZodRecord: () => ZodRecord, + ZodSchema: () => ZodType, + ZodSet: () => ZodSet, + ZodString: () => ZodString, + ZodSymbol: () => ZodSymbol, + ZodTransformer: () => ZodEffects, + ZodTuple: () => ZodTuple, + ZodType: () => ZodType, + ZodUndefined: () => ZodUndefined, + ZodUnion: () => ZodUnion, + ZodUnknown: () => ZodUnknown, + ZodVoid: () => ZodVoid, + addIssueToContext: () => addIssueToContext, + any: () => anyType, + array: () => arrayType, + bigint: () => bigIntType, + boolean: () => booleanType, + coerce: () => coerce, + custom: () => custom, + date: () => dateType, + datetimeRegex: () => datetimeRegex, + defaultErrorMap: () => en_default, + discriminatedUnion: () => discriminatedUnionType, + effect: () => effectsType, + enum: () => enumType, + function: () => functionType, + getErrorMap: () => getErrorMap, + getParsedType: () => getParsedType, + instanceof: () => instanceOfType, + intersection: () => intersectionType, + isAborted: () => isAborted, + isAsync: () => isAsync, + isDirty: () => isDirty, + isValid: () => isValid, + late: () => late, + lazy: () => lazyType, + literal: () => literalType, + makeIssue: () => makeIssue, + map: () => mapType, + nan: () => nanType, + nativeEnum: () => nativeEnumType, + never: () => neverType, + null: () => nullType, + nullable: () => nullableType, + number: () => numberType, + object: () => objectType, + objectUtil: () => objectUtil, + oboolean: () => oboolean, + onumber: () => onumber, + optional: () => optionalType, + ostring: () => ostring, + pipeline: () => pipelineType, + preprocess: () => preprocessType, + promise: () => promiseType, + quotelessJson: () => quotelessJson, + record: () => recordType, + set: () => setType, + setErrorMap: () => setErrorMap, + strictObject: () => strictObjectType, + string: () => stringType, + symbol: () => symbolType, + transformer: () => effectsType, + tuple: () => tupleType, + undefined: () => undefinedType, + union: () => unionType, + unknown: () => unknownType, + util: () => util, + void: () => voidType +}); +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/errors.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/locales/en.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/ZodError.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/helpers/util.js +init_dirname(); +init_buffer2(); +init_process2(); +var util; +(function(util2) { + util2.assertEqual = (_6) => { + }; + function assertIs(_arg) { + } + util2.assertIs = assertIs; + function assertNever(_x) { + throw new Error(); + } + util2.assertNever = assertNever; + util2.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util2.getValidEnumValues = (obj) => { + const validKeys = util2.objectKeys(obj).filter((k6) => typeof obj[obj[k6]] !== "number"); + const filtered = {}; + for (const k6 of validKeys) { + filtered[k6] = obj[k6]; + } + return util2.objectValues(filtered); + }; + util2.objectValues = (obj) => { + return util2.objectKeys(obj).map(function(e10) { + return obj[e10]; + }); + }; + util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { + const keys2 = []; + for (const key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + keys2.push(key); + } + } + return keys2; + }; + util2.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return void 0; + }; + util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; + function joinValues(array, separator = " | ") { + return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); + } + util2.joinValues = joinValues; + util2.jsonStringifyReplacer = (_6, value2) => { + if (typeof value2 === "bigint") { + return value2.toString(); + } + return value2; + }; +})(util || (util = {})); +var objectUtil; +(function(objectUtil2) { + objectUtil2.mergeShapes = (first, second) => { + return { + ...first, + ...second + // second overwrites first + }; + }; +})(objectUtil || (objectUtil = {})); +var ZodParsedType = util.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set" +]); +var getParsedType = (data) => { + const t8 = typeof data; + switch (t8) { + case "undefined": + return ZodParsedType.undefined; + case "string": + return ZodParsedType.string; + case "number": + return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + case "boolean": + return ZodParsedType.boolean; + case "function": + return ZodParsedType.function; + case "bigint": + return ZodParsedType.bigint; + case "symbol": + return ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return ZodParsedType.array; + } + if (data === null) { + return ZodParsedType.null; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return ZodParsedType.date; + } + return ZodParsedType.object; + default: + return ZodParsedType.unknown; + } +}; + +// node_modules/zod/v3/ZodError.js +var ZodIssueCode = util.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" +]); +var quotelessJson = (obj) => { + const json2 = JSON.stringify(obj, null, 2); + return json2.replace(/"([^"]+)":/g, "$1:"); +}; +var ZodError = class _ZodError 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(issue) { + return issue.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error2) => { + for (const issue of error2.issues) { + if (issue.code === "invalid_union") { + issue.unionErrors.map(processError); + } else if (issue.code === "invalid_return_type") { + processError(issue.returnTypeError); + } else if (issue.code === "invalid_arguments") { + processError(issue.argumentsError); + } else if (issue.path.length === 0) { + fieldErrors._errors.push(mapper(issue)); + } else { + let curr = fieldErrors; + let i7 = 0; + while (i7 < issue.path.length) { + const el = issue.path[i7]; + const terminal = i7 === issue.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue)); + } + curr = curr[el]; + i7++; + } + } + } + }; + processError(this); + return fieldErrors; + } + static assert(value2) { + if (!(value2 instanceof _ZodError)) { + throw new Error(`Not a ZodError: ${value2}`); + } + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue) => issue.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(); + } +}; +ZodError.create = (issues) => { + const error2 = new ZodError(issues); + return error2; +}; + +// node_modules/zod/v3/locales/en.js +var errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodIssueCode.invalid_type: + if (issue.received === ZodParsedType.undefined) { + message = "Required"; + } else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; + break; + case ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; + break; + case ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; + break; + case ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } else { + util.assertNever(issue.validation); + } + } else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } else { + message = "Invalid"; + } + break; + case ZodIssueCode.too_small: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; + else if (issue.type === "bigint") + message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.too_big: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; + else if (issue.type === "bigint") + message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util.assertNever(issue); + } + return { message }; +}; +var en_default = errorMap; + +// node_modules/zod/v3/errors.js +var overrideErrorMap = en_default; +function setErrorMap(map4) { + overrideErrorMap = map4; +} +function getErrorMap() { + return overrideErrorMap; +} + +// node_modules/zod/v3/helpers/parseUtil.js +init_dirname(); +init_buffer2(); +init_process2(); +var makeIssue = (params) => { + const { data, path: path2, errorMaps, issueData } = params; + const fullPath = [...path2, ...issueData.path || []]; + const fullIssue = { + ...issueData, + path: fullPath + }; + if (issueData.message !== void 0) { + return { + ...issueData, + path: fullPath, + message: issueData.message + }; + } + let errorMessage = ""; + const maps = errorMaps.filter((m7) => !!m7).slice().reverse(); + for (const map4 of maps) { + errorMessage = map4(fullIssue, { data, defaultError: errorMessage }).message; + } + return { + ...issueData, + path: fullPath, + message: errorMessage + }; +}; +var EMPTY_PATH = []; +function addIssueToContext(ctx, issueData) { + const overrideMap = getErrorMap(); + const issue = makeIssue({ + issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + // contextual error map is first priority + ctx.schemaErrorMap, + // then schema-bound map if available + overrideMap, + // then global override map + overrideMap === en_default ? void 0 : en_default + // then global default map + ].filter((x7) => !!x7) + }); + ctx.common.issues.push(issue); +} +var ParseStatus = class _ParseStatus { + 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 s7 of results) { + if (s7.status === "aborted") + return INVALID; + if (s7.status === "dirty") + status.dirty(); + arrayValue.push(s7.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs3) { + const syncPairs = []; + for (const pair of pairs3) { + const key = await pair.key; + const value2 = await pair.value; + syncPairs.push({ + key, + value: value2 + }); + } + return _ParseStatus.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs3) { + const finalObject = {}; + for (const pair of pairs3) { + const { key, value: value2 } = pair; + if (key.status === "aborted") + return INVALID; + if (value2.status === "aborted") + return INVALID; + if (key.status === "dirty") + status.dirty(); + if (value2.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && (typeof value2.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value2.value; + } + } + return { status: status.value, value: finalObject }; + } +}; +var INVALID = Object.freeze({ + status: "aborted" +}); +var DIRTY = (value2) => ({ status: "dirty", value: value2 }); +var OK = (value2) => ({ status: "valid", value: value2 }); +var isAborted = (x7) => x7.status === "aborted"; +var isDirty = (x7) => x7.status === "dirty"; +var isValid = (x7) => x7.status === "valid"; +var isAsync = (x7) => typeof Promise !== "undefined" && x7 instanceof Promise; + +// node_modules/zod/v3/types.js +init_dirname(); +init_buffer2(); +init_process2(); + +// node_modules/zod/v3/helpers/errorUtil.js +init_dirname(); +init_buffer2(); +init_process2(); +var errorUtil; +(function(errorUtil2) { + errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message; +})(errorUtil || (errorUtil = {})); + +// node_modules/zod/v3/types.js +var ParseInputLazyPath = class { + constructor(parent2, value2, path2, key) { + this._cachedPath = []; + this.parent = parent2; + this.data = value2; + this._path = path2; + 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; + } +}; +var handleResult = (ctx, result2) => { + if (isValid(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 error2 = new ZodError(ctx.common.issues); + this._error = error2; + return this._error; + } + }; + } +}; +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap: errorMap2, invalid_type_error, required_error, description: description7 } = params; + if (errorMap2 && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap2) + return { errorMap: errorMap2, description: description7 }; + 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: description7 }; +} +var ZodType = class { + get description() { + return this._def.description; + } + _getType(input) { + return getParsedType(input.data); + } + _getOrReturnCtx(input, ctx) { + return ctx || { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + }; + } + _processInputParams(input) { + return { + status: new ParseStatus(), + ctx: { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + } + }; + } + _parseSync(input) { + const result2 = this._parse(input); + if (isAsync(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: getParsedType(data) + }; + const result2 = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult(ctx, result2); + } + "~validate"(data) { + const ctx = { + common: { + issues: [], + async: !!this["~standard"].async + }, + path: [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data) + }; + if (!this["~standard"].async) { + try { + const result2 = this._parseSync({ data, path: [], parent: ctx }); + return isValid(result2) ? { + value: result2.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((result2) => isValid(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: getParsedType(data) + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result2 = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); + return handleResult(ctx, result2); + } + refine(check, 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 = check(val); + const setError = () => ctx.addIssue({ + code: ZodIssueCode.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(check, refinementData) { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); + return false; + } else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects({ + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "refinement", refinement } + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + constructor(def) { + this.spa = this.safeParseAsync; + this._def = def; + 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 ZodOptional.create(this, this._def); + } + nullable() { + return ZodNullable.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray.create(this); + } + promise() { + return ZodPromise.create(this, this._def); + } + or(option) { + return ZodUnion.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection.create(this, incoming, this._def); + } + transform(transform2) { + return new ZodEffects({ + ...processCreateParams(this._def), + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "transform", transform: transform2 } + }); + } + default(def) { + const defaultValueFunc = typeof def === "function" ? def : () => def; + return new ZodDefault({ + ...processCreateParams(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: ZodFirstPartyTypeKind.ZodDefault + }); + } + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def) + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch + }); + } + describe(description7) { + const This = this.constructor; + return new This({ + ...this._def, + description: description7 + }); + } + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } + isOptional() { + return this.safeParse(void 0).success; + } + isNullable() { + return this.safeParse(null).success; + } +}; +var cuidRegex = /^c[^\s-]{8,}$/i; +var cuid2Regex = /^[0-9a-z]+$/; +var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i; +var uuidRegex = /^[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; +var nanoidRegex = /^[a-z0-9_-]{21}$/i; +var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; +var durationRegex = /^[-+]?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)?)??$/; +var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +var emojiRegex; +var ipv4Regex = /^(?:(?: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])$/; +var ipv4CidrRegex = /^(?:(?: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])$/; +var ipv6Regex = /^(([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]))$/; +var ipv6CidrRegex = /^(([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])$/; +var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; +var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; +var dateRegexSource = `((\\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])))`; +var dateRegex = new RegExp(`^${dateRegexSource}$`); +function timeRegexSource(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 timeRegex(args) { + return new RegExp(`^${timeRegexSource(args)}$`); +} +function datetimeRegex(args) { + let regex = `${dateRegexSource}T${timeRegexSource(args)}`; + const opts = []; + opts.push(args.local ? `Z?` : `Z`); + if (args.offset) + opts.push(`([+-]\\d{2}:?\\d{2})`); + regex = `${regex}(${opts.join("|")})`; + return new RegExp(`^${regex}$`); +} +function isValidIP(ip, version5) { + if ((version5 === "v4" || !version5) && ipv4Regex.test(ip)) { + return true; + } + if ((version5 === "v6" || !version5) && ipv6Regex.test(ip)) { + return true; + } + return false; +} +function isValidJWT(jwt, alg) { + if (!jwtRegex.test(jwt)) + return false; + try { + const [header] = jwt.split("."); + if (!header) + return false; + const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); + const decoded = JSON.parse(atob(base64)); + 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 isValidCidr(ip, version5) { + if ((version5 === "v4" || !version5) && ipv4CidrRegex.test(ip)) { + return true; + } + if ((version5 === "v6" || !version5) && ipv6CidrRegex.test(ip)) { + return true; + } + return false; +} +var ZodString = class _ZodString extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.string) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.string, + received: ctx2.parsedType + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = void 0; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.length < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.length > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } else if (tooSmall) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } + status.dirty(); + } + } else if (check.kind === "email") { + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "email", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "emoji", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "uuid") { + if (!uuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "uuid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "nanoid") { + if (!nanoidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "nanoid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "cuid") { + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid2", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ulid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "url") { + try { + new URL(input.data); + } catch { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "url", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "regex") { + check.regex.lastIndex = 0; + const testResult = check.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "regex", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "trim") { + input.data = input.data.trim(); + } else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { includes: check.value, position: check.position }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { startsWith: check.value }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { endsWith: check.value }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "date") { + const regex = dateRegex; + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "date", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "time") { + const regex = timeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "time", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "duration") { + if (!durationRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "duration", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ip", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "jwt") { + if (!isValidJWT(input.data, check.alg)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "jwt", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "cidr") { + if (!isValidCidr(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cidr", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "base64") { + if (!base64Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "base64", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "base64url") { + if (!base64urlRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "base64url", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message) + }); + } + _addCheck(check) { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); + } + nanoid(message) { + return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); + } + base64(message) { + return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) }); + } + base64url(message) { + return this._addCheck({ + kind: "base64url", + ...errorUtil.errToObj(message) + }); + } + jwt(options) { + return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) }); + } + ip(options) { + return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); + } + cidr(options) { + return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) }); + } + datetime(options) { + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + local: false, + message: options + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof options?.precision === "undefined" ? null : options?.precision, + offset: options?.offset ?? false, + local: options?.local ?? false, + ...errorUtil.errToObj(options?.message) + }); + } + date(message) { + return this._addCheck({ kind: "date", message }); + } + time(options) { + if (typeof options === "string") { + return this._addCheck({ + kind: "time", + precision: null, + message: options + }); + } + return this._addCheck({ + kind: "time", + precision: typeof options?.precision === "undefined" ? null : options?.precision, + ...errorUtil.errToObj(options?.message) + }); + } + duration(message) { + return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) }); + } + regex(regex, message) { + return this._addCheck({ + kind: "regex", + regex, + ...errorUtil.errToObj(message) + }); + } + includes(value2, options) { + return this._addCheck({ + kind: "includes", + value: value2, + position: options?.position, + ...errorUtil.errToObj(options?.message) + }); + } + startsWith(value2, message) { + return this._addCheck({ + kind: "startsWith", + value: value2, + ...errorUtil.errToObj(message) + }); + } + endsWith(value2, message) { + return this._addCheck({ + kind: "endsWith", + value: value2, + ...errorUtil.errToObj(message) + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil.errToObj(message) + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil.errToObj(message) + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil.errToObj(message) + }); + } + /** + * Equivalent to `.min(1)` + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }] + }); + } + toLowerCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }] + }); + } + toUpperCase() { + return new _ZodString({ + ...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 min2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min2 === null || ch.value > min2) + min2 = ch.value; + } + } + return min2; + } + get maxLength() { + let max2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max2 === null || ch.value < max2) + max2 = ch.value; + } + } + return max2; + } +}; +ZodString.create = (params) => { + return new ZodString({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodString, + coerce: params?.coerce ?? false, + ...processCreateParams(params) + }); +}; +function floatSafeRemainder(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; +} +var ZodNumber = class _ZodNumber extends ZodType { + 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 parsedType = this._getType(input); + if (parsedType !== ZodParsedType.number) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: ctx2.parsedType + }); + return INVALID; + } + let ctx = void 0; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "int") { + if (!util.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: "integer", + received: "float", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_finite, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value2, message) { + return this.setLimit("min", value2, true, errorUtil.toString(message)); + } + gt(value2, message) { + return this.setLimit("min", value2, false, errorUtil.toString(message)); + } + lte(value2, message) { + return this.setLimit("max", value2, true, errorUtil.toString(message)); + } + lt(value2, message) { + return this.setLimit("max", value2, false, errorUtil.toString(message)); + } + setLimit(kind, value2, inclusive, message) { + return new _ZodNumber({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value: value2, + inclusive, + message: errorUtil.toString(message) + } + ] + }); + } + _addCheck(check) { + return new _ZodNumber({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil.toString(message) + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil.toString(message) + }); + } + multipleOf(value2, message) { + return this._addCheck({ + kind: "multipleOf", + value: value2, + message: errorUtil.toString(message) + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil.toString(message) + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil.toString(message) + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil.toString(message) + }); + } + get minValue() { + let min2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min2 === null || ch.value > min2) + min2 = ch.value; + } + } + return min2; + } + get maxValue() { + let max2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max2 === null || ch.value < max2) + max2 = ch.value; + } + } + return max2; + } + get isInt() { + return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); + } + get isFinite() { + let max2 = null; + let min2 = 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 (min2 === null || ch.value > min2) + min2 = ch.value; + } else if (ch.kind === "max") { + if (max2 === null || ch.value < max2) + max2 = ch.value; + } + } + return Number.isFinite(min2) && Number.isFinite(max2); + } +}; +ZodNumber.create = (params) => { + return new ZodNumber({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: params?.coerce || false, + ...processCreateParams(params) + }); +}; +var ZodBigInt = class _ZodBigInt extends ZodType { + 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 parsedType = this._getType(input); + if (parsedType !== ZodParsedType.bigint) { + return this._getInvalidInput(input); + } + let ctx = void 0; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _getInvalidInput(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.bigint, + received: ctx.parsedType + }); + return INVALID; + } + gte(value2, message) { + return this.setLimit("min", value2, true, errorUtil.toString(message)); + } + gt(value2, message) { + return this.setLimit("min", value2, false, errorUtil.toString(message)); + } + lte(value2, message) { + return this.setLimit("max", value2, true, errorUtil.toString(message)); + } + lt(value2, message) { + return this.setLimit("max", value2, false, errorUtil.toString(message)); + } + setLimit(kind, value2, inclusive, message) { + return new _ZodBigInt({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value: value2, + inclusive, + message: errorUtil.toString(message) + } + ] + }); + } + _addCheck(check) { + return new _ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message) + }); + } + multipleOf(value2, message) { + return this._addCheck({ + kind: "multipleOf", + value: value2, + message: errorUtil.toString(message) + }); + } + get minValue() { + let min2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min2 === null || ch.value > min2) + min2 = ch.value; + } + } + return min2; + } + get maxValue() { + let max2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max2 === null || ch.value < max2) + max2 = ch.value; + } + } + return max2; + } +}; +ZodBigInt.create = (params) => { + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: params?.coerce ?? false, + ...processCreateParams(params) + }); +}; +var ZodBoolean = class extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.boolean, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodBoolean.create = (params) => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: params?.coerce || false, + ...processCreateParams(params) + }); +}; +var ZodDate = class _ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.date) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.date, + received: ctx2.parsedType + }); + return INVALID; + } + if (Number.isNaN(input.data.getTime())) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_date + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = void 0; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date" + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date" + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()) + }; + } + _addCheck(check) { + return new _ZodDate({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil.toString(message) + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil.toString(message) + }); + } + get minDate() { + let min2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min2 === null || ch.value > min2) + min2 = ch.value; + } + } + return min2 != null ? new Date(min2) : null; + } + get maxDate() { + let max2 = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max2 === null || ch.value < max2) + max2 = ch.value; + } + } + return max2 != null ? new Date(max2) : null; + } +}; +ZodDate.create = (params) => { + return new ZodDate({ + checks: [], + coerce: params?.coerce || false, + typeName: ZodFirstPartyTypeKind.ZodDate, + ...processCreateParams(params) + }); +}; +var ZodSymbol = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.symbol, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodSymbol.create = (params) => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params) + }); +}; +var ZodUndefined = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.undefined, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodUndefined.create = (params) => { + return new ZodUndefined({ + typeName: ZodFirstPartyTypeKind.ZodUndefined, + ...processCreateParams(params) + }); +}; +var ZodNull = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.null) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.null, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodNull.create = (params) => { + return new ZodNull({ + typeName: ZodFirstPartyTypeKind.ZodNull, + ...processCreateParams(params) + }); +}; +var ZodAny = class extends ZodType { + constructor() { + super(...arguments); + this._any = true; + } + _parse(input) { + return OK(input.data); + } +}; +ZodAny.create = (params) => { + return new ZodAny({ + typeName: ZodFirstPartyTypeKind.ZodAny, + ...processCreateParams(params) + }); +}; +var ZodUnknown = class extends ZodType { + constructor() { + super(...arguments); + this._unknown = true; + } + _parse(input) { + return OK(input.data); + } +}; +ZodUnknown.create = (params) => { + return new ZodUnknown({ + typeName: ZodFirstPartyTypeKind.ZodUnknown, + ...processCreateParams(params) + }); +}; +var ZodNever = class extends ZodType { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.never, + received: ctx.parsedType + }); + return INVALID; + } +}; +ZodNever.create = (params) => { + return new ZodNever({ + typeName: ZodFirstPartyTypeKind.ZodNever, + ...processCreateParams(params) + }); +}; +var ZodVoid = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.void, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodVoid.create = (params) => { + return new ZodVoid({ + typeName: ZodFirstPartyTypeKind.ZodVoid, + ...processCreateParams(params) + }); +}; +var ZodArray = class _ZodArray extends ZodType { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def = this._def; + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType + }); + return INVALID; + } + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + addIssueToContext(ctx, { + code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, + minimum: tooSmall ? def.exactLength.value : void 0, + maximum: tooBig ? def.exactLength.value : void 0, + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message + }); + status.dirty(); + } + } + if (def.minLength !== null) { + if (ctx.data.length < def.minLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.minLength.message + }); + status.dirty(); + } + } + if (def.maxLength !== null) { + if (ctx.data.length > def.maxLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.maxLength.message + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i7) => { + return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i7)); + })).then((result3) => { + return ParseStatus.mergeArray(status, result3); + }); + } + const result2 = [...ctx.data].map((item, i7) => { + return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i7)); + }); + return ParseStatus.mergeArray(status, result2); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new _ZodArray({ + ...this._def, + minLength: { value: minLength, message: errorUtil.toString(message) } + }); + } + max(maxLength, message) { + return new _ZodArray({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil.toString(message) } + }); + } + length(len, message) { + return new _ZodArray({ + ...this._def, + exactLength: { value: len, message: errorUtil.toString(message) } + }); + } + nonempty(message) { + return this.min(1, message); + } +}; +ZodArray.create = (schema8, params) => { + return new ZodArray({ + type: schema8, + minLength: null, + maxLength: null, + exactLength: null, + typeName: ZodFirstPartyTypeKind.ZodArray, + ...processCreateParams(params) + }); +}; +function deepPartialify(schema8) { + if (schema8 instanceof ZodObject) { + const newShape = {}; + for (const key in schema8.shape) { + const fieldSchema = schema8.shape[key]; + newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); + } + return new ZodObject({ + ...schema8._def, + shape: () => newShape + }); + } else if (schema8 instanceof ZodArray) { + return new ZodArray({ + ...schema8._def, + type: deepPartialify(schema8.element) + }); + } else if (schema8 instanceof ZodOptional) { + return ZodOptional.create(deepPartialify(schema8.unwrap())); + } else if (schema8 instanceof ZodNullable) { + return ZodNullable.create(deepPartialify(schema8.unwrap())); + } else if (schema8 instanceof ZodTuple) { + return ZodTuple.create(schema8.items.map((item) => deepPartialify(item))); + } else { + return schema8; + } +} +var ZodObject = class _ZodObject extends ZodType { + 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 = util.objectKeys(shape); + this._cached = { shape, keys: keys2 }; + return this._cached; + } + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.object) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx2.parsedType + }); + return INVALID; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs3 = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value2 = ctx.data[key]; + pairs3.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath(ctx, value2, ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + if (this._def.catchall instanceof ZodNever) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs3.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] } + }); + } + } else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + addIssueToContext(ctx, { + code: ZodIssueCode.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 value2 = ctx.data[key]; + pairs3.push({ + key: { status: "valid", value: key }, + value: catchall._parse( + new ParseInputLazyPath(ctx, value2, ctx.path, key) + //, ctx.child(key), value, getParsedType(value) + ), + alwaysSet: key in ctx.data + }); + } + } + if (ctx.common.async) { + return Promise.resolve().then(async () => { + const syncPairs = []; + for (const pair of pairs3) { + const key = await pair.key; + const value2 = await pair.value; + syncPairs.push({ + key, + value: value2, + alwaysSet: pair.alwaysSet + }); + } + return syncPairs; + }).then((syncPairs) => { + return ParseStatus.mergeObjectSync(status, syncPairs); + }); + } else { + return ParseStatus.mergeObjectSync(status, pairs3); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil.errToObj; + return new _ZodObject({ + ...this._def, + unknownKeys: "strict", + ...message !== void 0 ? { + errorMap: (issue, ctx) => { + const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError; + if (issue.code === "unrecognized_keys") + return { + message: errorUtil.errToObj(message).message ?? defaultError + }; + return { + message: defaultError + }; + } + } : {} + }); + } + strip() { + return new _ZodObject({ + ...this._def, + unknownKeys: "strip" + }); + } + passthrough() { + return new _ZodObject({ + ...this._def, + unknownKeys: "passthrough" + }); + } + // const AugmentFactory = + // (def: Def) => + // ( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, Augmentation>, + // Def["unknownKeys"], + // Def["catchall"] + // > => { + // return new ZodObject({ + // ...def, + // shape: () => ({ + // ...def.shape(), + // ...augmentation, + // }), + // }) as any; + // }; + extend(augmentation) { + return new _ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation + }) + }); + } + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging) { + const merged = new _ZodObject({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape() + }), + typeName: ZodFirstPartyTypeKind.ZodObject + }); + return merged; + } + // merge< + // Incoming extends AnyZodObject, + // Augmentation extends Incoming["shape"], + // NewOutput extends { + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }, + // NewInput extends { + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // } + // >( + // merging: Incoming + // ): ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"], + // NewOutput, + // NewInput + // > { + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + setKey(key, schema8) { + return this.augment({ [key]: schema8 }); + } + // merge( + // merging: Incoming + // ): //ZodObject = (merging) => { + // ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"] + // > { + // // const mergedShape = objectUtil.mergeShapes( + // // this._def.shape(), + // // merging._def.shape() + // // ); + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + catchall(index4) { + return new _ZodObject({ + ...this._def, + catchall: index4 + }); + } + pick(mask) { + const shape = {}; + for (const key of util.objectKeys(mask)) { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + } + return new _ZodObject({ + ...this._def, + shape: () => shape + }); + } + omit(mask) { + const shape = {}; + for (const key of util.objectKeys(this.shape)) { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + } + return new _ZodObject({ + ...this._def, + shape: () => shape + }); + } + /** + * @deprecated + */ + deepPartial() { + return deepPartialify(this); + } + partial(mask) { + const newShape = {}; + for (const key of util.objectKeys(this.shape)) { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } else { + newShape[key] = fieldSchema.optional(); + } + } + return new _ZodObject({ + ...this._def, + shape: () => newShape + }); + } + required(mask) { + const newShape = {}; + for (const key of util.objectKeys(this.shape)) { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + } + return new _ZodObject({ + ...this._def, + shape: () => newShape + }); + } + keyof() { + return createZodEnum(util.objectKeys(this.shape)); + } +}; +ZodObject.create = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +ZodObject.strictCreate = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +ZodObject.lazycreate = (shape, params) => { + return new ZodObject({ + shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +var ZodUnion = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options = 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 ZodError(result2.ctx.common.issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors + }); + return INVALID; + } + if (ctx.common.async) { + return Promise.all(options.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 = void 0; + const issues = []; + for (const option of options) { + 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 ZodError(issues2)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors + }); + return INVALID; + } + } + get options() { + return this._def.options; + } +}; +ZodUnion.create = (types3, params) => { + return new ZodUnion({ + options: types3, + typeName: ZodFirstPartyTypeKind.ZodUnion, + ...processCreateParams(params) + }); +}; +var getDiscriminator = (type3) => { + if (type3 instanceof ZodLazy) { + return getDiscriminator(type3.schema); + } else if (type3 instanceof ZodEffects) { + return getDiscriminator(type3.innerType()); + } else if (type3 instanceof ZodLiteral) { + return [type3.value]; + } else if (type3 instanceof ZodEnum) { + return type3.options; + } else if (type3 instanceof ZodNativeEnum) { + return util.objectValues(type3.enum); + } else if (type3 instanceof ZodDefault) { + return getDiscriminator(type3._def.innerType); + } else if (type3 instanceof ZodUndefined) { + return [void 0]; + } else if (type3 instanceof ZodNull) { + return [null]; + } else if (type3 instanceof ZodOptional) { + return [void 0, ...getDiscriminator(type3.unwrap())]; + } else if (type3 instanceof ZodNullable) { + return [null, ...getDiscriminator(type3.unwrap())]; + } else if (type3 instanceof ZodBranded) { + return getDiscriminator(type3.unwrap()); + } else if (type3 instanceof ZodReadonly) { + return getDiscriminator(type3.unwrap()); + } else if (type3 instanceof ZodCatch) { + return getDiscriminator(type3._def.innerType); + } else { + return []; + } +}; +var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType + }); + return INVALID; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator] + }); + return INVALID; + } + 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; + } + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create(discriminator, options, params) { + const optionsMap = /* @__PURE__ */ new Map(); + for (const type3 of options) { + const discriminatorValues = getDiscriminator(type3.shape[discriminator]); + if (!discriminatorValues.length) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value2 of discriminatorValues) { + if (optionsMap.has(value2)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value2)}`); + } + optionsMap.set(value2, type3); + } + } + return new _ZodDiscriminatedUnion({ + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, + discriminator, + options, + optionsMap, + ...processCreateParams(params) + }); + } +}; +function mergeValues(a7, b8) { + const aType = getParsedType(a7); + const bType = getParsedType(b8); + if (a7 === b8) { + return { valid: true, data: a7 }; + } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { + const bKeys = util.objectKeys(b8); + const sharedKeys = util.objectKeys(a7).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a7, ...b8 }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a7[key], b8[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { + if (a7.length !== b8.length) { + return { valid: false }; + } + const newArray = []; + for (let index4 = 0; index4 < a7.length; index4++) { + const itemA = a7[index4]; + const itemB = b8[index4]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a7 === +b8) { + return { valid: true, data: a7 }; + } else { + return { valid: false }; + } +} +var ZodIntersection = class extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if (isAborted(parsedLeft) || isAborted(parsedRight)) { + return INVALID; + } + const merged = mergeValues(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_intersection_types + }); + return INVALID; + } + if (isDirty(parsedLeft) || isDirty(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 + })); + } + } +}; +ZodIntersection.create = (left, right, params) => { + return new ZodIntersection({ + left, + right, + typeName: ZodFirstPartyTypeKind.ZodIntersection, + ...processCreateParams(params) + }); +}; +var ZodTuple = class _ZodTuple extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType + }); + return INVALID; + } + if (ctx.data.length < this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + return INVALID; + } + const rest2 = this._def.rest; + if (!rest2 && ctx.data.length > this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + status.dirty(); + } + const items = [...ctx.data].map((item, itemIndex) => { + const schema8 = this._def.items[itemIndex] || this._def.rest; + if (!schema8) + return null; + return schema8._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); + }).filter((x7) => !!x7); + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return ParseStatus.mergeArray(status, results); + }); + } else { + return ParseStatus.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest2) { + return new _ZodTuple({ + ...this._def, + rest: rest2 + }); + } +}; +ZodTuple.create = (schemas5, params) => { + if (!Array.isArray(schemas5)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple({ + items: schemas5, + typeName: ZodFirstPartyTypeKind.ZodTuple, + rest: null, + ...processCreateParams(params) + }); +}; +var ZodRecord = class _ZodRecord extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType + }); + return INVALID; + } + const pairs3 = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs3.push({ + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + if (ctx.common.async) { + return ParseStatus.mergeObjectAsync(status, pairs3); + } else { + return ParseStatus.mergeObjectSync(status, pairs3); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType) { + return new _ZodRecord({ + keyType: first, + valueType: second, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(third) + }); + } + return new _ZodRecord({ + keyType: ZodString.create(), + valueType: first, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(second) + }); + } +}; +var ZodMap = class extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.map) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.map, + received: ctx.parsedType + }); + return INVALID; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs3 = [...ctx.data.entries()].map(([key, value2], index4) => { + return { + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index4, "key"])), + value: valueType._parse(new ParseInputLazyPath(ctx, value2, ctx.path, [index4, "value"])) + }; + }); + if (ctx.common.async) { + const finalMap = /* @__PURE__ */ new Map(); + return Promise.resolve().then(async () => { + for (const pair of pairs3) { + const key = await pair.key; + const value2 = await pair.value; + if (key.status === "aborted" || value2.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value2.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value2.value); + } + return { status: status.value, value: finalMap }; + }); + } else { + const finalMap = /* @__PURE__ */ new Map(); + for (const pair of pairs3) { + const key = pair.key; + const value2 = pair.value; + if (key.status === "aborted" || value2.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value2.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value2.value); + } + return { status: status.value, value: finalMap }; + } + } +}; +ZodMap.create = (keyType, valueType, params) => { + return new ZodMap({ + valueType, + keyType, + typeName: ZodFirstPartyTypeKind.ZodMap, + ...processCreateParams(params) + }); +}; +var ZodSet = class _ZodSet extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.set) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.set, + received: ctx.parsedType + }); + return INVALID; + } + const def = this._def; + if (def.minSize !== null) { + if (ctx.data.size < def.minSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.minSize.message + }); + status.dirty(); + } + } + if (def.maxSize !== null) { + if (ctx.data.size > def.maxSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.maxSize.message + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements2) { + const parsedSet = /* @__PURE__ */ new Set(); + for (const element of elements2) { + if (element.status === "aborted") + return INVALID; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i7) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i7))); + if (ctx.common.async) { + return Promise.all(elements).then((elements2) => finalizeSet(elements2)); + } else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new _ZodSet({ + ...this._def, + minSize: { value: minSize, message: errorUtil.toString(message) } + }); + } + max(maxSize, message) { + return new _ZodSet({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil.toString(message) } + }); + } + size(size2, message) { + return this.min(size2, message).max(size2, message); + } + nonempty(message) { + return this.min(1, message); + } +}; +ZodSet.create = (valueType, params) => { + return new ZodSet({ + valueType, + minSize: null, + maxSize: null, + typeName: ZodFirstPartyTypeKind.ZodSet, + ...processCreateParams(params) + }); +}; +var ZodFunction = class _ZodFunction extends ZodType { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.function) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.function, + received: ctx.parsedType + }); + return INVALID; + } + function makeArgsIssue(args, error2) { + return makeIssue({ + data: args, + path: ctx.path, + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x7) => !!x7), + issueData: { + code: ZodIssueCode.invalid_arguments, + argumentsError: error2 + } + }); + } + function makeReturnsIssue(returns, error2) { + return makeIssue({ + data: returns, + path: ctx.path, + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x7) => !!x7), + issueData: { + code: ZodIssueCode.invalid_return_type, + returnTypeError: error2 + } + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise) { + const me4 = this; + return OK(async function(...args) { + const error2 = new ZodError([]); + const parsedArgs = await me4._def.args.parseAsync(args, params).catch((e10) => { + error2.addIssue(makeArgsIssue(args, e10)); + throw error2; + }); + const result2 = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me4._def.returns._def.type.parseAsync(result2, params).catch((e10) => { + error2.addIssue(makeReturnsIssue(result2, e10)); + throw error2; + }); + return parsedReturns; + }); + } else { + const me4 = this; + return OK(function(...args) { + const parsedArgs = me4._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); + } + const result2 = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me4._def.returns.safeParse(result2, params); + if (!parsedReturns.success) { + throw new ZodError([makeReturnsIssue(result2, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new _ZodFunction({ + ...this._def, + args: ZodTuple.create(items).rest(ZodUnknown.create()) + }); + } + returns(returnType) { + return new _ZodFunction({ + ...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 _ZodFunction({ + args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params) + }); + } +}; +var ZodLazy = class extends ZodType { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema = this._def.getter(); + return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } +}; +ZodLazy.create = (getter, params) => { + return new ZodLazy({ + getter, + typeName: ZodFirstPartyTypeKind.ZodLazy, + ...processCreateParams(params) + }); +}; +var ZodLiteral = class extends ZodType { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_literal, + expected: this._def.value + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } +}; +ZodLiteral.create = (value2, params) => { + return new ZodLiteral({ + value: value2, + typeName: ZodFirstPartyTypeKind.ZodLiteral, + ...processCreateParams(params) + }); +}; +function createZodEnum(values2, params) { + return new ZodEnum({ + values: values2, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params) + }); +} +var ZodEnum = class _ZodEnum extends ZodType { + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type + }); + return INVALID; + } + 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; + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues + }); + return INVALID; + } + return OK(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 _ZodEnum.create(values2, { + ...this._def, + ...newDef + }); + } + exclude(values2, newDef = this._def) { + return _ZodEnum.create(this.options.filter((opt) => !values2.includes(opt)), { + ...this._def, + ...newDef + }); + } +}; +ZodEnum.create = createZodEnum; +var ZodNativeEnum = class extends ZodType { + _parse(input) { + const nativeEnumValues = util.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type + }); + return INVALID; + } + if (!this._cache) { + this._cache = new Set(util.getValidEnumValues(this._def.values)); + } + if (!this._cache.has(input.data)) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues + }); + return INVALID; + } + return OK(input.data); + } + get enum() { + return this._def.values; + } +}; +ZodNativeEnum.create = (values2, params) => { + return new ZodNativeEnum({ + values: values2, + typeName: ZodFirstPartyTypeKind.ZodNativeEnum, + ...processCreateParams(params) + }); +}; +var ZodPromise = class extends ZodType { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.promise, + received: ctx.parsedType + }); + return INVALID; + } + const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); + return OK(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap + }); + })); + } +}; +ZodPromise.create = (schema8, params) => { + return new ZodPromise({ + type: schema8, + typeName: ZodFirstPartyTypeKind.ZodPromise, + ...processCreateParams(params) + }); +}; +var ZodEffects = class extends ZodType { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.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) => { + addIssueToContext(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 INVALID; + const result2 = await this._def.schema._parseAsync({ + data: processed2, + path: ctx.path, + parent: ctx + }); + if (result2.status === "aborted") + return INVALID; + if (result2.status === "dirty") + return DIRTY(result2.value); + if (status.value === "dirty") + return DIRTY(result2.value); + return result2; + }); + } else { + if (status.value === "aborted") + return INVALID; + const result2 = this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx + }); + if (result2.status === "aborted") + return INVALID; + if (result2.status === "dirty") + return DIRTY(result2.value); + if (status.value === "dirty") + return DIRTY(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 INVALID; + 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 INVALID; + 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 base = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (!isValid(base)) + return INVALID; + const result2 = effect.transform(base.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((base) => { + if (!isValid(base)) + return INVALID; + return Promise.resolve(effect.transform(base.value, checkCtx)).then((result2) => ({ + status: status.value, + value: result2 + })); + }); + } + } + util.assertNever(effect); + } +}; +ZodEffects.create = (schema8, effect, params) => { + return new ZodEffects({ + schema: schema8, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect, + ...processCreateParams(params) + }); +}; +ZodEffects.createWithPreprocess = (preprocess, schema8, params) => { + return new ZodEffects({ + schema: schema8, + effect: { type: "preprocess", transform: preprocess }, + typeName: ZodFirstPartyTypeKind.ZodEffects, + ...processCreateParams(params) + }); +}; +var ZodOptional = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.undefined) { + return OK(void 0); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +}; +ZodOptional.create = (type3, params) => { + return new ZodOptional({ + innerType: type3, + typeName: ZodFirstPartyTypeKind.ZodOptional, + ...processCreateParams(params) + }); +}; +var ZodNullable = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.null) { + return OK(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +}; +ZodNullable.create = (type3, params) => { + return new ZodNullable({ + innerType: type3, + typeName: ZodFirstPartyTypeKind.ZodNullable, + ...processCreateParams(params) + }); +}; +var ZodDefault = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === ZodParsedType.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + removeDefault() { + return this._def.innerType; + } +}; +ZodDefault.create = (type3, params) => { + return new ZodDefault({ + innerType: type3, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" ? params.default : () => params.default, + ...processCreateParams(params) + }); +}; +var ZodCatch = class extends ZodType { + _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 (isAsync(result2)) { + return result2.then((result3) => { + return { + status: "valid", + value: result3.status === "valid" ? result3.value : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + }); + } else { + return { + status: "valid", + value: result2.status === "valid" ? result2.value : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + } + } + removeCatch() { + return this._def.innerType; + } +}; +ZodCatch.create = (type3, params) => { + return new ZodCatch({ + innerType: type3, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams(params) + }); +}; +var ZodNaN = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.nan) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.nan, + received: ctx.parsedType + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } +}; +ZodNaN.create = (params) => { + return new ZodNaN({ + typeName: ZodFirstPartyTypeKind.ZodNaN, + ...processCreateParams(params) + }); +}; +var BRAND = Symbol("zod_brand"); +var ZodBranded = class extends ZodType { + _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; + } +}; +var ZodPipeline = class _ZodPipeline extends ZodType { + _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 INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return DIRTY(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 INVALID; + 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(a7, b8) { + return new _ZodPipeline({ + in: a7, + out: b8, + typeName: ZodFirstPartyTypeKind.ZodPipeline + }); + } +}; +var ZodReadonly = class extends ZodType { + _parse(input) { + const result2 = this._def.innerType._parse(input); + const freeze = (data) => { + if (isValid(data)) { + data.value = Object.freeze(data.value); + } + return data; + }; + return isAsync(result2) ? result2.then((data) => freeze(data)) : freeze(result2); + } + unwrap() { + return this._def.innerType; + } +}; +ZodReadonly.create = (type3, params) => { + return new ZodReadonly({ + innerType: type3, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params) + }); +}; +function cleanParams(params, data) { + const p7 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params; + const p22 = typeof p7 === "string" ? { message: p7 } : p7; + return p22; +} +function custom(check, _params = {}, fatal) { + if (check) + return ZodAny.create().superRefine((data, ctx) => { + const r8 = check(data); + if (r8 instanceof Promise) { + return r8.then((r9) => { + if (!r9) { + const params = cleanParams(_params, data); + const _fatal = params.fatal ?? fatal ?? true; + ctx.addIssue({ code: "custom", ...params, fatal: _fatal }); + } + }); + } + if (!r8) { + const params = cleanParams(_params, data); + const _fatal = params.fatal ?? fatal ?? true; + ctx.addIssue({ code: "custom", ...params, fatal: _fatal }); + } + return; + }); + return ZodAny.create(); +} +var late = { + object: ZodObject.lazycreate +}; +var ZodFirstPartyTypeKind; +(function(ZodFirstPartyTypeKind2) { + ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; +})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); +var instanceOfType = (cls, params = { + message: `Input not instance of ${cls.name}` +}) => custom((data) => data instanceof cls, params); +var stringType = ZodString.create; +var numberType = ZodNumber.create; +var nanType = ZodNaN.create; +var bigIntType = ZodBigInt.create; +var booleanType = ZodBoolean.create; +var dateType = ZodDate.create; +var symbolType = ZodSymbol.create; +var undefinedType = ZodUndefined.create; +var nullType = ZodNull.create; +var anyType = ZodAny.create; +var unknownType = ZodUnknown.create; +var neverType = ZodNever.create; +var voidType = ZodVoid.create; +var arrayType = ZodArray.create; +var objectType = ZodObject.create; +var strictObjectType = ZodObject.strictCreate; +var unionType = ZodUnion.create; +var discriminatedUnionType = ZodDiscriminatedUnion.create; +var intersectionType = ZodIntersection.create; +var tupleType = ZodTuple.create; +var recordType = ZodRecord.create; +var mapType = ZodMap.create; +var setType = ZodSet.create; +var functionType = ZodFunction.create; +var lazyType = ZodLazy.create; +var literalType = ZodLiteral.create; +var enumType = ZodEnum.create; +var nativeEnumType = ZodNativeEnum.create; +var promiseType = ZodPromise.create; +var effectsType = ZodEffects.create; +var optionalType = ZodOptional.create; +var nullableType = ZodNullable.create; +var preprocessType = ZodEffects.createWithPreprocess; +var pipelineType = ZodPipeline.create; +var ostring = () => stringType().optional(); +var onumber = () => numberType().optional(); +var oboolean = () => booleanType().optional(); +var coerce = { + string: (arg) => ZodString.create({ ...arg, coerce: true }), + number: (arg) => ZodNumber.create({ ...arg, coerce: true }), + boolean: (arg) => ZodBoolean.create({ + ...arg, + coerce: true + }), + bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }), + date: (arg) => ZodDate.create({ ...arg, coerce: true }) +}; +var NEVER = INVALID; + +// src/codegen/utils.ts +function isClass2(obj) { + const isCtorClass = obj.constructor && obj.constructor.toString().substring(0, 5) === "class"; + if (obj.prototype === void 0) { + return isCtorClass; + } + const isPrototypeCtorClass = obj.prototype.constructor && obj.prototype.constructor.toString && obj.prototype.constructor.toString().substring(0, 5) === "class"; + return isCtorClass || isPrototypeCtorClass; +} +function mergePartialAndDefault2(defaultNonOptional, customOptional) { + if (customOptional === void 0) { + return Object.assign({}, defaultNonOptional); + } + const target = Object.assign({}, defaultNonOptional); + for (const [propName2, prop] of Object.entries(customOptional)) { + const isObjectOrClass = typeof prop === "object" && target[propName2] !== void 0; + const isRegularObject = !isClass2(prop); + const isArray3 = Array.isArray(prop); + if (isArray3) { + target[propName2] = ensureUniqueValuesInArray([ + ...target[propName2] ?? [], + ...prop ?? [] + ]); + } else if (isObjectOrClass && isRegularObject) { + target[propName2] = mergePartialAndDefault2(target[propName2], prop); + } else if (prop) { + target[propName2] = prop; + } + } + return target; +} +function findDuplicatesInArray(array, property2) { + const foundValues = array.map((generator) => { + return generator[property2]; + }); + const duplicates = foundValues.filter( + (item, index4) => foundValues.indexOf(item) !== index4 + ); + return Array.from(new Set(duplicates)); +} +function getOSType() { + if (platform === "win32") { + return "windows"; + } + if (platform === "darwin") { + return "macos"; + } + return "unix"; +} +function ensureRelativePath(pathToCheck) { + if (getOSType() === "windows") { + return pathToCheck.replaceAll("\\", "/"); + } + return pathToCheck; +} +function ensureUniqueValuesInArray(array) { + return array.filter((value2, index4, filteredArray) => { + return filteredArray.indexOf(value2) === index4; + }); +} +function findExtensionObject(parsedObj) { + return parsedObj?.extensions()?.get("x-the-codegen-project")?.value(); +} +function findNameFromChannel(channel) { + const channelId = channel.id(); + const userSpecificName = findExtensionObject(channel) ? findExtensionObject(channel)["channelName"] : void 0; + if (userSpecificName) { + return userSpecificName; + } + return pascalCase2(channelId.replace(/\W/g, " ")); +} +function findOperationId(operation, channel) { + const userSpecificName = findExtensionObject(operation) ? findExtensionObject(operation)["channelName"] : void 0; + if (userSpecificName) { + return userSpecificName; + } + let operationId = operation.id(); + operationId = operation.hasOperationId() ? operation.operationId() : operationId; + return operationId ?? channel.id(); +} +function findNameFromOperation(operation, channel) { + const operationId = findOperationId(operation, channel); + return pascalCase2(operationId.replace(/\W/g, " ")); +} +function findReplyId(operation, reply, channel) { + return `${findOperationId(operation, reply.channel() ?? channel)}_reply`; +} +function getOperationMetadata(operation) { + let description7; + if (operation.hasDescription()) { + description7 = operation.description(); + } else if (operation.hasSummary()) { + description7 = operation.summary(); + } + const rawJson = operation.json?.() ?? operation._json; + const deprecated = rawJson?.deprecated === true; + return { description: description7, deprecated }; +} +function onlyUnique(array) { + const onlyUnique2 = (value2, index4, array2) => { + return array2.indexOf(value2) === index4; + }; + return array.filter(onlyUnique2); +} +var zodImportExtension = external_exports.enum([".ts", ".js", "none"]).optional().describe( + 'File extension for relative imports. ".ts" for node16/nodenext, ".js" for compiled ESM, "none" for bundlers.' +); +function appendImportExtension(importPath, extension) { + if (extension === "none") { + return importPath; + } + return `${importPath}${extension}`; +} +function resolveImportExtension(generator, config3) { + return generator.importExtension ?? config3?.importExtension ?? "none"; +} +function joinPath(...segments) { + const filtered = segments.filter((s7) => s7 !== ""); + if (filtered.length === 0) { + return ""; + } + const preserveLeadingDot = filtered[0].startsWith("./"); + const preserveLeadingSlash = filtered[0].startsWith("/"); + const joined = filtered.map((segment, index4) => { + if (index4 > 0 && segment.startsWith("/")) { + segment = segment.slice(1); + } + if (index4 > 0 && segment.startsWith("./")) { + segment = segment.slice(2); + } + if (index4 < filtered.length - 1 && segment.endsWith("/")) { + segment = segment.slice(0, -1); + } + return segment; + }).join("/"); + let result2 = joined.replace(/\/+/g, "/"); + if (preserveLeadingDot && !result2.startsWith("./")) { + result2 = `./${result2}`; + } else if (preserveLeadingSlash && !result2.startsWith("/")) { + result2 = `/${result2}`; + } + return result2; +} +function isAbsolutePath(p7) { + return /^[a-zA-Z]:[\\/]/.test(p7) || p7.startsWith("/"); +} +function relativePath(from, to) { + const normalizedFrom = from.replace(/\\/g, "/"); + const normalizedTo = to.replace(/\\/g, "/"); + const fromIsAbsolute = isAbsolutePath(normalizedFrom); + const toIsAbsolute = isAbsolutePath(normalizedTo); + if (fromIsAbsolute && !toIsAbsolute) { + const fromWithoutRoot = normalizedFrom.replace(/^[a-zA-Z]:\//, "").replace(/^\//, ""); + return relativePath(fromWithoutRoot, normalizedTo); + } + if (!fromIsAbsolute && toIsAbsolute) { + const toWithoutRoot = normalizedTo.replace(/^[a-zA-Z]:\//, "").replace(/^\//, ""); + return relativePath(normalizedFrom, toWithoutRoot); + } + const normFrom = normalizedFrom.replace(/^\.\//, "").replace(/\/$/, ""); + const normTo = normalizedTo.replace(/^\.\//, "").replace(/\/$/, ""); + const fromParts = normFrom.split("/").filter((p7) => p7 !== ""); + const toParts = normTo.split("/").filter((p7) => p7 !== ""); + let commonLength = 0; + const minLength = Math.min(fromParts.length, toParts.length); + for (let i7 = 0; i7 < minLength; i7++) { + if (fromParts[i7] === toParts[i7]) { + commonLength++; + } else { + break; + } + } + const upCount = fromParts.length - commonLength; + const remainingTo = toParts.slice(commonLength); + const upParts = Array(upCount).fill(".."); + const relativeParts = [...upParts, ...remainingTo]; + if (relativeParts.length === 0) { + return "."; + } + return relativeParts.join("/"); +} + +// src/codegen/generators/typescript/parameters.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/asyncapi/generators/parameters.ts +init_dirname(); +init_buffer2(); +init_process2(); +async function processAsyncAPIParameters(asyncapiDocument) { + const channelParameters4 = {}; + for (const channel of asyncapiDocument.allChannels().all()) { + const parameters = channel.parameters().all(); + if (parameters.length > 0) { + const channelName = findNameFromChannel(channel); + const schemaId = pascalCase2(`${channelName}_parameters`); + const schemaObj = { + type: "object", + $id: schemaId, + $schema: "http://json-schema.org/draft-07/schema", + required: [], + properties: {}, + additionalProperties: false, + "x-channel-address": channel.address() + }; + for (const parameter of parameters) { + schemaObj.properties[parameter.id()] = parameter.schema()?.json(); + schemaObj.required.push(parameter.id()); + } + channelParameters4[channel.id()] = { + schema: schemaObj, + schemaId + }; + } + } + return { + channelParameters: channelParameters4 + }; +} +function unwrap(channelParameters4) { + if (Object.keys(channelParameters4.properties).length === 0) { + return ""; + } + const parameterReplacement = Object.values(channelParameters4.properties).map( + (parameter) => { + const variableName = `${parameter.propertyName}Match`; + return `const ${variableName} = match[sequentialParameters.indexOf('{${parameter.unconstrainedPropertyName}}')+1]; + if(${variableName} && ${variableName} !== '') { + parameters.${parameter.propertyName} = ${variableName} as any + } else { + throw new Error(\`Parameter: '${parameter.propertyName}' is not valid in ${channelParameters4.name}. Aborting parameter extracting! \`) + }`; + } + ); + const parameterInitializer = Object.values(channelParameters4.properties).filter( + (parameter) => parameter.property.options.const?.value === void 0 + ).map((parameter) => { + if (parameter.property.options.isNullable) { + return `${parameter.propertyName}: null`; + } + const property2 = parameter.property; + if (property2 instanceof ConstrainedReferenceModel && property2.ref instanceof ConstrainedEnumModel) { + return `${parameter.propertyName}: ${property2.ref.values[0].value}`; + } + return `${parameter.propertyName}: ''`; + }); + return `const parameters = new ${channelParameters4.name}({${parameterInitializer.join(", ")}}); +const match = msgSubject.match(regex); +const sequentialParameters: string[] = channel.match(/\\{(\\w+)\\}/g) || []; + +if (match) { + ${parameterReplacement.join("\n")} +} else { + throw new Error(\`Unable to find parameters in channel/topic, topic was \${channel}\`) +} +return parameters;`; +} +function generateAsyncAPIParameterMethods(model) { + const parameters = Object.entries(model.properties).map(([, parameter]) => { + return `channel = channel.replace(/\\{${parameter.unconstrainedPropertyName}\\}/g, this.${parameter.propertyName})`; + }); + return `/** + * Realize the channel/topic with the parameters added to this class. + */ +public getChannelWithParameters(channel: string) { + ${parameters.length > 0 ? parameters.join(";\n ") : "// No parameters to replace"}; + return channel; +} + +public static createFromChannel(msgSubject: string, channel: string, regex: RegExp): ${model.type} { + ${unwrap(model)} +}`; +} +function createAsyncAPIGenerator() { + return new TypeScriptFileGenerator({ + ...defaultCodegenTypescriptModelinaOptions, + enumType: "union", + useJavascriptReservedKeywords: false, + presets: [ + TS_DESCRIPTION_PRESET, + { + class: { + additionalContent: ({ content, model }) => { + const additionalMethods = generateAsyncAPIParameterMethods(model); + return `${content} +${additionalMethods}`; + } + } + } + ] + }); +} + +// src/codegen/inputs/openapi/generators/parameters.ts +init_dirname(); +init_buffer2(); +init_process2(); +var X_PARAMETER_LOCATION = "x-parameter-location"; +var X_PARAMETER_STYLE = "x-parameter-style"; +var X_PARAMETER_EXPLODE = "x-parameter-explode"; +var X_PARAMETER_ALLOW_RESERVED = "x-parameter-allowReserved"; +var X_PARAMETER_COLLECTION_FORMAT = "x-parameter-collectionFormat"; +function processOpenAPIParameters(openapiDocument) { + const channelParameters4 = {}; + for (const [pathKey, pathItem] of Object.entries( + openapiDocument.paths ?? {} + )) { + for (const [method2, operation] of Object.entries(pathItem)) { + const operationObj = operation; + const allParameters = operationObj.parameters ?? []; + const filteredParams = allParameters.filter((param) => { + return ["path", "query"].includes(param.in); + }); + if (filteredParams.length > 0) { + const operationId = operationObj.operationId ?? `${method2}${pathKey.replace(/[^a-zA-Z0-9]/g, "")}`; + const parameterSchema = createParameterSchema( + operationId, + filteredParams, + "Parameters", + pathKey + ); + channelParameters4[operationId] = { + schema: parameterSchema.schema, + schemaId: parameterSchema.schemaId + }; + } + } + } + return { + channelParameters: channelParameters4 + }; +} +function convertParameterSchemaToJsonSchema(parameter) { + let schema8; + if (parameter.schema) { + schema8 = { ...parameter.schema }; + } else if (parameter.type) { + schema8 = { + type: parameter.type, + ...parameter.format && { format: parameter.format }, + ...parameter.enum && { enum: parameter.enum }, + ...parameter.minimum !== void 0 && { minimum: parameter.minimum }, + ...parameter.maximum !== void 0 && { maximum: parameter.maximum }, + ...parameter.minLength !== void 0 && { + minLength: parameter.minLength + }, + ...parameter.maxLength !== void 0 && { + maxLength: parameter.maxLength + }, + ...parameter.pattern && { pattern: parameter.pattern } + }; + } else { + schema8 = { type: "string" }; + } + return schema8; +} +function createParameterSchema(operationId, parameters, schemaIdSuffix, path2) { + const properties = {}; + const required = []; + for (const param of parameters) { + const paramName = param.name; + const paramSchema = convertParameterSchemaToJsonSchema(param); + if (param.description) { + paramSchema.description = param.description; + } + if (param.in) { + paramSchema[X_PARAMETER_LOCATION] = param.in; + } + if (param.style) { + paramSchema[X_PARAMETER_STYLE] = param.style; + } + if (param.explode !== void 0) { + paramSchema[X_PARAMETER_EXPLODE] = param.explode; + } + if (param.allowReserved) { + paramSchema[X_PARAMETER_ALLOW_RESERVED] = param.allowReserved; + } + if (param.collectionFormat) { + paramSchema[X_PARAMETER_COLLECTION_FORMAT] = param.collectionFormat; + } + properties[paramName] = paramSchema; + if (param.required === true) { + required.push(paramName); + } + } + const schemaId = pascalCase2(`${operationId}_${schemaIdSuffix.toLowerCase()}`); + const schemaObj = { + type: "object", + additionalProperties: false, + properties, + $id: schemaId, + $schema: "http://json-schema.org/draft-07/schema", + "x-channel-address": path2 + }; + if (required.length > 0) { + schemaObj.required = required; + } + return { + schema: schemaObj, + schemaId + }; +} +function generateOpenAPIParameterMethods(model) { + const properties = model.originalInput?.properties ?? {}; + const pathParams = []; + const queryParams = []; + for (const [propName2, propSchema] of Object.entries(properties)) { + const paramConfig = processParameterSchema(propName2, propSchema); + if (paramConfig) { + if (paramConfig.location === "path") { + pathParams.push(paramConfig); + } else if (paramConfig.location === "query") { + queryParams.push(paramConfig); + } + } + } + if (pathParams.length === 0 && queryParams.length === 0) { + return ""; + } + const serializationMethods = generateSerializationMethods( + pathParams, + queryParams + ); + const deserializationMethods = generateDeserializationMethods( + pathParams, + queryParams, + model + ); + const extractPathParametersMethod = pathParams.length > 0 ? generateExtractPathParametersMethod(pathParams, model) : ""; + return `${serializationMethods}${deserializationMethods}${extractPathParametersMethod}`; +} +function processParameterSchema(propName2, propSchema) { + const schema8 = propSchema; + const location2 = schema8[X_PARAMETER_LOCATION]; + if (!location2 || !["path", "query"].includes(location2)) { + return null; + } + let style = schema8[X_PARAMETER_STYLE]; + let explode = schema8[X_PARAMETER_EXPLODE]; + if (schema8[X_PARAMETER_COLLECTION_FORMAT]) { + const converted = convertCollectionFormatToStyleAndExplode( + schema8[X_PARAMETER_COLLECTION_FORMAT], + location2 + ); + style = style ?? converted.style; + explode = explode !== void 0 ? explode : converted.explode; + } else { + style = style ?? (location2 === "path" ? "simple" : "form"); + explode = explode !== void 0 ? explode : location2 === "query"; + } + const allowReserved = schema8[X_PARAMETER_ALLOW_RESERVED] ?? false; + return { + name: propName2, + location: location2, + style, + explode, + allowReserved + }; +} +function generateSerializationMethods(pathParams, queryParams) { + let methods = ""; + if (pathParams.length > 0) { + methods += generatePathSerializationMethod(pathParams); + } + if (queryParams.length > 0) { + methods += generateQuerySerializationMethod(queryParams); + } + methods += generateUrlSerializationMethod( + pathParams.length > 0, + queryParams.length > 0 + ); + return methods; +} +function generatePathSerializationMethod(pathParams) { + const paramSerializations = pathParams.map((param) => generatePathParameterSerialization(param)).join("\n"); + return ` +/** + * Serialize path parameters according to OpenAPI 2.0/3.x specification + * @returns Record of parameter names to their serialized values for path substitution + */ +serializePathParameters(): Record { + const result: Record = {}; + +${paramSerializations} + + return result; +}`; +} +function generateQuerySerializationMethod(queryParams) { + const paramSerializations = queryParams.map((param) => generateQueryParameterSerialization(param)).join("\n"); + return ` +/** + * Serialize query parameters according to OpenAPI 2.0/3.x specification + * @returns URLSearchParams object with serialized query parameters + */ +serializeQueryParameters(): URLSearchParams { + const params = new URLSearchParams(); + +${paramSerializations} + + return params; +}`; +} +function generateUrlSerializationMethod(hasPathParams, hasQueryParams) { + const pathLogic = hasPathParams ? ` + const pathParams = this.serializePathParameters(); + for (const [name, value] of Object.entries(pathParams)) { + url = url.replace(new RegExp(\`{\${name}}\`, 'g'), value); + }` : ""; + const queryLogic = hasQueryParams ? ` + const queryParams = this.serializeQueryParameters(); + const queryString = queryParams.toString(); + if (queryString) { + url += (url.includes('?') ? '&' : '?') + queryString; + }` : ""; + return ` +/** + * Get the complete serialized URL with path and query parameters + * @param basePath The base path template (e.g., '/users/{id}') + * @returns The complete URL with serialized parameters + */ +serializeUrl(basePath: string): string { + let url = basePath; + + // Replace path parameters + ${pathLogic} + + // Add query parameters + ${queryLogic} + + return url; +} + +/** + * Get the channel path with parameters substituted (compatible with AsyncAPI channel interface) + * @param basePath The base path template (e.g., '/pet/findByStatus/{status}/{categoryId}') + * @returns The path with parameters replaced + */ +getChannelWithParameters(basePath: string): string { + return this.serializeUrl(basePath); +}`; +} +function generatePathParameterSerialization(param) { + const { name: name2, style, explode, allowReserved } = param; + const encoding = allowReserved ? "" : "encodeURIComponent"; + return ` // Serialize path parameter: ${name2} (style: ${style}, explode: ${explode}) + if (this.${name2} !== undefined && this.${name2} !== null) { + const value = this.${name2}; + ${generatePathSerializationLogic(name2, style, explode, encoding)} + }`; +} +function generateQueryParameterSerialization(param) { + const { name: name2, style, explode, allowReserved } = param; + const encoding = allowReserved ? "" : "encodeURIComponent"; + return ` // Serialize query parameter: ${name2} (style: ${style}, explode: ${explode}) + if (this.${name2} !== undefined && this.${name2} !== null) { + const value = this.${name2}; + ${generateQuerySerializationLogic(name2, style, explode, encoding)} + }`; +} +var RESULT_ASSIGNMENT = "result['"; +var COMMA_SEPARATOR = ".join(',')"; +var DOT_SEPARATOR = ".join('.')"; +function generatePathSerializationLogic(name2, style, explode, encoding) { + const encodeValue = encoding ? `${encoding}(String(val))` : "String(val)"; + const encodeScalarValue = encoding ? `${encoding}(String(value))` : "String(value)"; + const encodeKey = encoding ? `${encoding}(key)` : "key"; + switch (style) { + case "simple": + return generateSimpleStyleLogic( + name2, + explode, + encodeValue, + encodeScalarValue, + encodeKey + ); + case "label": + return generateLabelStyleLogic( + name2, + explode, + encodeValue, + encodeScalarValue, + encodeKey + ); + case "matrix": + return generateMatrixStyleLogic( + name2, + explode, + encodeValue, + encodeScalarValue, + encodeKey + ); + default: + return `${RESULT_ASSIGNMENT}${name2}'] = ${encodeScalarValue};`; + } +} +function generateQuerySerializationLogic(name2, style, explode, encoding) { + const encodeValue = encoding ? `${encoding}(String(val))` : "String(val)"; + const encodeScalarValue = encoding ? `${encoding}(String(value))` : "String(value)"; + const encodeKey = encoding ? `${encoding}(key)` : "key"; + switch (style) { + case "form": + return generateFormStyleLogic( + name2, + explode, + encodeValue, + encodeScalarValue, + encodeKey + ); + case "spaceDelimited": + return generateSpaceDelimitedLogic( + name2, + explode, + encodeValue, + encodeScalarValue + ); + case "pipeDelimited": + return generatePipeDelimitedLogic( + name2, + explode, + encodeValue, + encodeScalarValue + ); + case "deepObject": + return generateDeepObjectLogic(name2, encodeValue, encodeKey); + default: + return `params.append('${name2}', ${encodeScalarValue});`; + } +} +function generateSimpleStyleLogic(name2, explode, encodeValue, encodeScalarValue, encodeKey) { + return `if (Array.isArray(value)) { + ${RESULT_ASSIGNMENT}${name2}'] = value.map(val => ${encodeValue})${COMMA_SEPARATOR}; + } else if (typeof value === 'object' && value !== null) { + ${explode ? `${RESULT_ASSIGNMENT}${name2}'] = Object.entries(value).map(([key, val]) => \`\${${encodeKey}}=\${${encodeValue}}\`)${COMMA_SEPARATOR};` : `${RESULT_ASSIGNMENT}${name2}'] = Object.entries(value).map(([key, val]) => \`\${${encodeKey}},\${${encodeValue}}\`)${COMMA_SEPARATOR};`} + } else { + ${RESULT_ASSIGNMENT}${name2}'] = ${encodeScalarValue}; + }`; +} +function generateLabelStyleLogic(name2, explode, encodeValue, encodeScalarValue, encodeKey) { + return `if (Array.isArray(value)) { + ${explode ? `${RESULT_ASSIGNMENT}${name2}'] = '.' + value.map(val => ${encodeValue})${DOT_SEPARATOR};` : `${RESULT_ASSIGNMENT}${name2}'] = '.' + value.map(val => ${encodeValue})${COMMA_SEPARATOR};`} + } else if (typeof value === 'object' && value !== null) { + ${explode ? `${RESULT_ASSIGNMENT}${name2}'] = '.' + Object.entries(value).map(([key, val]) => \`\${${encodeKey}}=\${${encodeValue}}\`)${DOT_SEPARATOR};` : `${RESULT_ASSIGNMENT}${name2}'] = '.' + Object.entries(value).map(([key, val]) => \`\${${encodeKey}},\${${encodeValue}}\`)${COMMA_SEPARATOR};`} + } else { + ${RESULT_ASSIGNMENT}${name2}'] = '.' + ${encodeScalarValue}; + }`; +} +function generateMatrixStyleLogic(name2, explode, encodeValue, encodeScalarValue, encodeKey) { + return `if (Array.isArray(value)) { + ${explode ? `${RESULT_ASSIGNMENT}${name2}'] = value.map(val => \`;${name2}=\${${encodeValue}}\`).join('');` : `${RESULT_ASSIGNMENT}${name2}'] = \`;${name2}=\` + value.map(val => ${encodeValue})${COMMA_SEPARATOR};`} + } else if (typeof value === 'object' && value !== null) { + ${explode ? `${RESULT_ASSIGNMENT}${name2}'] = Object.entries(value).map(([key, val]) => \`;\${${encodeKey}}=\${${encodeValue}}\`).join('');` : `${RESULT_ASSIGNMENT}${name2}'] = \`;${name2}=\` + Object.entries(value).map(([key, val]) => \`\${${encodeKey}},\${${encodeValue}}\`)${COMMA_SEPARATOR};`} + } else { + ${RESULT_ASSIGNMENT}${name2}'] = \`;${name2}=\` + ${encodeScalarValue}; + }`; +} +function generateFormStyleLogic(name2, explode, encodeValue, encodeScalarValue, encodeKey) { + return `if (Array.isArray(value)) { + ${explode ? `value.forEach(val => params.append('${name2}', ${encodeValue}));` : `params.append('${name2}', value.map(val => ${encodeValue}).join(','));`} + } else if (typeof value === 'object' && value !== null) { + ${explode ? `Object.entries(value).forEach(([key, val]) => params.append(${encodeKey}, ${encodeValue}));` : `params.append('${name2}', Object.entries(value).map(([key, val]) => \`\${${encodeKey}},\${${encodeValue}}\`).join(','));`} + } else { + params.append('${name2}', ${encodeScalarValue}); + }`; +} +function generateSpaceDelimitedLogic(name2, explode, encodeValue, encodeScalarValue) { + return `if (Array.isArray(value)) { + ${explode ? `value.forEach(val => params.append('${name2}', ${encodeValue}));` : `params.append('${name2}', value.map(val => ${encodeValue}).join(' '));`} + } else { + params.append('${name2}', ${encodeScalarValue}); + }`; +} +function generatePipeDelimitedLogic(name2, explode, encodeValue, encodeScalarValue) { + return `if (Array.isArray(value)) { + ${explode ? `value.forEach(val => params.append('${name2}', ${encodeValue}));` : `params.append('${name2}', value.map(val => ${encodeValue}).join('|'));`} + } else { + params.append('${name2}', ${encodeScalarValue}); + }`; +} +function generateDeepObjectLogic(name2, encodeValue, encodeKey) { + return `if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + Object.entries(value).forEach(([key, val]) => { + params.append(\`${name2}[\${key}]\`, ${encodeValue}); + }); + } else { + params.append('${name2}', String(value)); + }`; +} +function convertCollectionFormatToStyleAndExplode(collectionFormat, location2) { + switch (collectionFormat) { + case "csv": + return { style: location2 === "query" ? "form" : "simple", explode: false }; + case "ssv": + return { style: "spaceDelimited", explode: false }; + case "tsv": + return { style: location2 === "query" ? "form" : "simple", explode: false }; + case "pipes": + return { style: "pipeDelimited", explode: false }; + case "multi": + return { style: "form", explode: true }; + default: + return { style: location2 === "query" ? "form" : "simple", explode: false }; + } +} +function generateDeserializationMethods(pathParams, queryParams, model) { + let methods = ""; + if (queryParams.length > 0) { + methods += generateUrlDeserializationMethod(queryParams, model); + } + methods += generateFromUrlStaticMethod(pathParams, model); + return methods; +} +function generateUrlDeserializationMethod(queryParams, model) { + const paramDeserializations = queryParams.map((param) => generateQueryParameterDeserialization(param, model)).join("\n"); + return ` +/** + * Deserialize URL and populate instance properties from query parameters + * @param url The URL to parse (can be full URL or just query string) + */ +deserializeUrl(url: string): void { + // Extract query string from URL + let queryString = ''; + if (url.includes('?')) { + queryString = url.split('?')[1]; + } else if (url.includes('=')) { + // Assume it's already a query string + queryString = url; + } + + if (!queryString) { + return; + } + + const params = new URLSearchParams(queryString); + +${paramDeserializations} +}`; +} +function generateFromUrlStaticMethod(pathParams, model) { + const properties = model.originalInput?.properties ?? {}; + const requiredParams = []; + for (const [propName2, propSchema] of Object.entries(properties)) { + const paramConfig = processParameterSchema(propName2, propSchema); + if (paramConfig && model.originalInput?.required?.includes(propName2)) { + requiredParams.push(propName2); + } + } + const pathParamExtraction = pathParams.length > 0 ? generatePathParameterExtraction(pathParams) : ""; + const pathParamArgs = pathParams.map((param) => `${param.name}: pathParams.${param.name}`).join(", "); + const requiredNonPathParams = requiredParams.filter( + (param) => !pathParams.some((pathParam) => pathParam.name === param) + ); + const requiredParamArgs = requiredNonPathParams.map((param) => `${param}: default${pascalCase2(param)}`).join(", "); + let constructorArgs = ""; + if (pathParamArgs && requiredParamArgs) { + constructorArgs = `${pathParamArgs}, ${requiredParamArgs}`; + } else if (pathParamArgs) { + constructorArgs = pathParamArgs; + } else if (requiredParamArgs) { + constructorArgs = requiredParamArgs; + } + const paramDocs = requiredNonPathParams.length > 0 ? requiredNonPathParams.map( + (param) => ` * @param default${pascalCase2(param)} Default ${param} values (required parameter)` + ).join("\n") : ""; + const functionParams = requiredNonPathParams.length > 0 ? requiredNonPathParams.map( + (param) => `, default${pascalCase2(param)}: ${getParameterType(properties[param])} = ${generateDefaultValue(properties[param], param)}` + ).join("") : ""; + return ` + +/** + * Static method to create a new instance from a URL + * @param url The URL to parse + * @param basePath The base path template (e.g., '/pet/findByStatus/{status}/{categoryId}') +${paramDocs} + * @returns A new ${model.type} instance + */ +static fromUrl(url: string, basePath: string${functionParams}): ${model.type} { + ${pathParamExtraction} + const instance = new ${model.type}({ ${constructorArgs} }); + instance.deserializeUrl(url); + return instance; +}`; +} +function generatePathParameterExtraction(pathParams) { + if (pathParams.length === 0) { + return ""; + } + return `// Extract path parameters from URL + const pathParams = this.extractPathParameters(url, basePath);`; +} +function generateQueryParameterDeserialization(param, model) { + const { name: name2, style, explode } = param; + const properties = model.originalInput?.properties ?? {}; + const propSchema = properties[name2]; + const logicCode = generateQueryDeserializationLogic( + name2, + style, + explode, + propSchema + ); + return ` // Deserialize query parameter: ${name2} (style: ${style}, explode: ${explode}) + if (params.has('${name2}')) { + const value = params.get('${name2}'); + ${logicCode} + }`; +} +function generateQueryDeserializationLogic(name2, style, explode, propSchema) { + const isArray3 = propSchema?.type === "array" || propSchema?.items; + const isBoolean4 = propSchema?.type === "boolean"; + const isNumber3 = propSchema?.type === "integer" || propSchema?.type === "number"; + const paramType = getParameterType(propSchema); + switch (style) { + case "form": + return generateFormStyleDeserializationLogic( + name2, + explode, + isArray3, + isBoolean4, + isNumber3, + paramType + ); + case "spaceDelimited": + return generateSpaceDelimitedDeserializationLogic( + name2, + explode, + isArray3, + isBoolean4, + isNumber3, + paramType + ); + case "pipeDelimited": + return generatePipeDelimitedDeserializationLogic( + name2, + explode, + isArray3, + isBoolean4, + isNumber3, + paramType + ); + case "deepObject": + return generateDeepObjectDeserializationLogic( + name2, + isBoolean4, + isNumber3, + paramType + ); + default: + throw new Error(`Unsupported style: ${style}`); + } +} +function generateFormStyleDeserializationLogic(name2, explode, isArray3, isBoolean4, isNumber3, paramType) { + if (isArray3 && !explode) { + const typecast2 = paramType.includes("[]") ? ` as ${paramType}` : ""; + return `if (value === '') { + this.${name2} = []; + } else if (value) { + // Split by comma and decode + const decodedValues = value.split(',').map(val => decodeURIComponent(val.trim())); + this.${name2} = decodedValues${typecast2}; + }`; + } else if (isArray3 && explode) { + const typecast2 = paramType.includes("[]") ? ` as ${paramType}` : ""; + return `const allValues = params.getAll('${name2}'); + if (allValues.length > 0) { + const decodedValues = allValues.map(val => decodeURIComponent(val)); + this.${name2} = decodedValues${typecast2}; + }`; + } else if (isBoolean4) { + return `if (value) { + const decodedValue = decodeURIComponent(value); + this.${name2} = decodedValue.toLowerCase() === 'true'; + }`; + } else if (isNumber3) { + return `if (value) { + const decodedValue = decodeURIComponent(value); + const numValue = Number(decodedValue); + if (!isNaN(numValue)) { + this.${name2} = numValue; + } + }`; + } + const typecast = paramType !== "string" && paramType !== "string | undefined" ? ` as ${paramType.replace(" | undefined", "")}` : ""; + return `if (value) { + const decodedValue = decodeURIComponent(value); + this.${name2} = decodedValue${typecast}; + }`; +} +function generateSpaceDelimitedDeserializationLogic(name2, explode, isArray3, isBoolean4, isNumber3, paramType) { + if (isArray3 && !explode) { + const typecast = paramType.includes("[]") ? ` as ${paramType}` : ""; + return `if (value === '') { + this.${name2} = []; + } else if (value) { + // Split by space and decode + const decodedValues = value.split(' ').map(val => decodeURIComponent(val.trim())); + this.${name2} = decodedValues${typecast}; + }`; + } + return generateFormStyleDeserializationLogic( + name2, + explode, + isArray3, + isBoolean4, + isNumber3, + paramType + ); +} +function generatePipeDelimitedDeserializationLogic(name2, explode, isArray3, isBoolean4, isNumber3, paramType) { + if (isArray3 && !explode) { + const typecast = paramType.includes("[]") ? ` as ${paramType}` : ""; + return `if (value === '') { + this.${name2} = []; + } else if (value) { + // Split by pipe and decode + const decodedValues = value.split('|').map(val => decodeURIComponent(val.trim())); + this.${name2} = decodedValues${typecast}; + }`; + } + return generateFormStyleDeserializationLogic( + name2, + explode, + isArray3, + isBoolean4, + isNumber3, + paramType + ); +} +function generateDeepObjectDeserializationLogic(name2, isBoolean4, isNumber3, paramType) { + const nameLength = name2.length + 1; + const typecast = paramType !== "any" && paramType !== "any | undefined" ? ` as ${paramType.replace(" | undefined", "")}` : ""; + return `// Deep object style deserialization + const deepObjectParams: {[key: string]: any} = {}; + for (const [paramName, paramValue] of params.entries()) { + if (paramName.startsWith('${name2}[') && paramName.endsWith(']')) { + const key = paramName.slice(${nameLength}, -1); + deepObjectParams[key] = decodeURIComponent(paramValue); + } + } + if (Object.keys(deepObjectParams).length > 0) { + this.${name2} = deepObjectParams${typecast}; + }`; +} +function getParameterType(propSchema) { + if (!propSchema) { + return "any"; + } + if (propSchema.type === "array") { + const itemType = propSchema.items?.type || "string"; + const enumValues = propSchema.items?.enum; + if (enumValues) { + const enumTypes = enumValues.map((v8) => `"${v8}"`).join(" | "); + return `(${enumTypes})[]`; + } + return `${itemType}[]`; + } else if (propSchema.enum) { + return propSchema.enum.map((v8) => `"${v8}"`).join(" | "); + } else if (propSchema.type === "integer" || propSchema.type === "number") { + return "number"; + } else if (propSchema.type === "boolean") { + return "boolean"; + } + return "string"; +} +function generateDefaultValue(propSchema, paramName) { + if (!propSchema) { + return "[]"; + } + if (propSchema.type === "array") { + return "[]"; + } else if (propSchema.type === "boolean") { + return "false"; + } else if (propSchema.type === "integer" || propSchema.type === "number") { + return propSchema.default?.toString() || "0"; + } else if (propSchema.enum && propSchema.default) { + return `"${propSchema.default}"`; + } else if (propSchema.enum) { + return `"${propSchema.enum[0]}"`; + } + return propSchema.default ? `"${propSchema.default}"` : '""'; +} +function generateExtractPathParametersMethod(pathParams, model) { + const properties = model.originalInput?.properties ?? {}; + const paramExtractions = pathParams.map((param) => { + const propSchema = properties[param.name]; + const isNumber3 = propSchema?.type === "integer" || propSchema?.type === "number"; + const conversion = isNumber3 ? "Number(decodeValue)" : "decodeValue"; + const paramType = getParameterType(propSchema); + const typecast = paramType !== "string" ? ` as ${paramType}` : ""; + return ` case '${param.name}': + result.${param.name} = ${conversion}${typecast}; + break;`; + }).join("\n"); + return ` + +/** + * Extract path parameters from a URL using a base path template + * @param url The URL to extract parameters from + * @param basePath The base path template (e.g., '/pet/findByStatus/{status}/{categoryId}') + * @returns Object containing extracted path parameter values + */ +private static extractPathParameters(url: string, basePath: string): { ${pathParams.map((p7) => `${p7.name}: ${getParameterType(properties[p7.name])}`).join(", ")} } { + // Remove query string from URL for path matching + const urlPath = url.split('?')[0]; + + // Create regex pattern from base path template + const regexPattern = basePath.replace(/\\{([^}]+)\\}/g, '([^/]+)'); + const regex = new RegExp('^' + regexPattern + '$'); + + const match = urlPath.match(regex); + if (!match) { + throw new Error(\`URL path '\${urlPath}' does not match base path template '\${basePath}'\`); + } + + // Extract parameter names from base path template + const paramNames = basePath.match(/\\{([^}]+)\\}/g)?.map(p => p.slice(1, -1)) || []; + + // Map matched values to parameter names + const result: any = {}; + paramNames.forEach((paramName, index) => { + const rawValue = match[index + 1]; + const decodeValue = decodeURIComponent(rawValue); + switch (paramName) { +${paramExtractions} + default: + result[paramName] = decodeValue; + } + }); + + return result; +}`; +} +function createOpenAPIGenerator() { + return new TypeScriptFileGenerator({ + ...defaultCodegenTypescriptModelinaOptions, + enumType: "union", + useJavascriptReservedKeywords: false, + presets: [ + TS_DESCRIPTION_PRESET, + { + class: { + additionalContent: ({ content, model }) => { + const additionalMethods = generateOpenAPIParameterMethods(model); + return `${content} +${additionalMethods}`; + } + } + } + ] + }); +} + +// src/codegen/output/index.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_path(); + +// src/codegen/output/filesystem.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_fs(); +init_process(); +init_path(); + +// src/codegen/output/types.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/output/memory.ts +init_dirname(); +init_buffer2(); +init_process2(); +var MemoryAdapter = class { + constructor(options) { + __publicField(this, "files", /* @__PURE__ */ new Map()); + __publicField(this, "basePath"); + this.basePath = (options?.basePath ?? "").replace(/\/+$/, ""); + } + /** + * Write content to memory. + */ + async write(filePath, content) { + const resolvedPath = this.resolvePath(filePath); + this.files.set(resolvedPath, content); + } + /** + * No-op for memory adapter - directories are virtual. + */ + async mkdir(_dirPath, _options) { + } + /** + * Get all file paths that were written. + */ + getWrittenFiles() { + return [...this.files.keys()]; + } + /** + * Get all files with their content. + */ + getAllFiles() { + const result2 = {}; + for (const [filePath, content] of this.files) { + result2[filePath] = content; + } + return result2; + } + /** + * Read a file from memory. + * @param filePath - The file path + * @returns The file content, or undefined if not found + */ + read(filePath) { + return this.files.get(this.resolvePath(filePath)); + } + /** + * Clear all files from memory. + */ + clear() { + this.files.clear(); + } + /** + * Check if a file exists. + */ + has(filePath) { + return this.files.has(this.resolvePath(filePath)); + } + /** + * Get the number of files. + */ + get size() { + return this.files.size; + } + /** + * Resolve a file path with the base path. + */ + resolvePath(filePath) { + if (!this.basePath) { + return filePath; + } + return `${this.basePath}/${filePath}`.replace(/\/+/g, "/"); + } +}; + +// src/codegen/output/modelina.ts +init_dirname(); +init_buffer2(); +init_process2(); +async function generateModels({ + generator, + input, + outputPath, + options = {} +}) { + const files = []; + const models = await generator.generateCompleteModels(input, { + exportType: options.exportType ?? "named" + }); + const validModels = models.filter((model) => model.modelName !== ""); + for (const model of validModels) { + const fileName = `${model.modelName}.ts`; + const filePath = `${outputPath}/${fileName}`; + files.push({ path: filePath, content: model.result }); + } + return { + models: validModels, + files + }; +} + +// src/codegen/generators/typescript/parameters.ts +var zodTypescriptParametersGenerator = external_exports.object({ + id: external_exports.string().optional().default("parameters-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("parameters").default("parameters"), + outputPath: external_exports.string().default("src/__gen__/parameters"), + serializationType: external_exports.literal("json").optional().default("json"), + language: external_exports.literal("typescript").optional().default("typescript") +}); +var defaultTypeScriptParametersOptions = zodTypescriptParametersGenerator.parse({}); +async function generateTypescriptParameters(context2) { + const { asyncapiDocument, openapiDocument, inputType, generator } = context2; + const channelModels = {}; + const files = []; + let processedSchemaData; + let parameterGenerator; + switch (inputType) { + case "asyncapi": { + if (!asyncapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "parameters" + }); + } + processedSchemaData = await processAsyncAPIParameters(asyncapiDocument); + parameterGenerator = createAsyncAPIGenerator(); + break; + } + case "openapi": { + if (!openapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "parameters" + }); + } + processedSchemaData = processOpenAPIParameters(openapiDocument); + parameterGenerator = createOpenAPIGenerator(); + break; + } + default: + throw new Error(`Unsupported input type: ${inputType}`); + } + for (const [channelId, schemaData] of Object.entries( + processedSchemaData.channelParameters + )) { + if (schemaData) { + const result2 = await generateModels({ + generator: parameterGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + channelModels[channelId] = result2.models.length > 0 ? result2.models[0] : void 0; + files.push(...result2.files); + } else { + channelModels[channelId] = void 0; + } + } + const uniqueFiles = []; + const seenPaths = /* @__PURE__ */ new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); + } + } + return { + channelModels, + generator, + files: uniqueFiles + }; +} + +// src/codegen/generators/typescript/payloads.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/asyncapi/generators/payloads.ts +init_dirname(); +init_buffer2(); +init_process2(); +async function processAsyncAPIPayloads(asyncapiDocument) { + const channelPayloads = {}; + const operationPayloads = {}; + const otherPayloads = []; + const allChannels = asyncapiDocument.allChannels().all(); + const processMessages = (messagesToProcess, preId) => { + let schemaObj = { + type: "object", + $schema: "http://json-schema.org/draft-07/schema" + }; + let id = preId; + const messages = messagesToProcess; + if (messages.length > 1) { + schemaObj.oneOf = []; + schemaObj["$id"] = pascalCase2(`${preId}_Payload`); + for (const message of messages) { + if (!message.hasPayload()) { + break; + } + const schema8 = AsyncAPIInputProcessor.convertToInternalSchema( + message.payload() + ); + const payloadId = message.id() ?? message.name(); + if (typeof schema8 === "boolean") { + schemaObj.oneOf.push(schema8); + } else { + const bindings6 = message.bindings(); + const statusCodesBindings = bindings6?.get("http"); + const statusCodes = statusCodesBindings?.json()["statusCode"]; + if (statusCodesBindings && statusCodes) { + schemaObj["x-modelina-has-status-codes"] = true; + schema8["x-modelina-status-codes"] = statusCodes; + } + schemaObj.oneOf.push({ + ...schema8, + $id: payloadId + }); + } + } + } else if (messages.length === 1) { + const message = messages[0]; + if (message.hasPayload()) { + const schema8 = AsyncAPIInputProcessor.convertToInternalSchema( + message.payload() + ); + if (typeof schema8 === "boolean") { + schemaObj = schema8; + } else { + id = message.id() ?? message.name() ?? schema8["x-modelgen-inferred-name"]; + if (id.includes("AnonymousSchema_")) { + id = pascalCase2(`${preId}_Payload`); + } + schemaObj = { + ...schemaObj, + ...schema8, + $id: id + }; + } + } else { + return; + } + } else { + return; + } + return { + schema: schemaObj, + schemaId: id ?? schemaObj.$id ?? pascalCase2(`${preId}_Payload`) + }; + }; + if (asyncapiDocument.allChannels().all().length > 0) { + for (const channel of asyncapiDocument.allChannels().all()) { + for (const operation of channel.operations().all()) { + const operationMessages = operation.messages().all(); + const operationReply = operation.reply(); + if (operationReply) { + const operationReplyId = findReplyId( + operation, + operationReply, + channel + ); + const operationReplySchema = processMessages( + operationReply.messages().all(), + operationReplyId + ); + if (operationReplySchema) { + operationPayloads[operationReplyId] = operationReplySchema; + } + } + const operationId = findOperationId(operation, channel); + const operationSchema = processMessages(operationMessages, operationId); + if (operationSchema) { + operationPayloads[operationId] = operationSchema; + } + } + const channelSchema = processMessages( + channel.messages().all(), + findNameFromChannel(channel) + ); + if (channelSchema) { + channelPayloads[channel.id()] = channelSchema; + } + } + } else { + for (const message of asyncapiDocument.allMessages()) { + const schemaId = message.id() ?? message.name(); + const schemaObj = processMessages([message], schemaId); + if (schemaObj) { + otherPayloads.push(schemaObj); + } + } + } + return { + channelPayloads, + operationPayloads, + otherPayloads: onlyUnique(otherPayloads) + }; +} + +// src/codegen/inputs/openapi/generators/payloads.ts +init_dirname(); +init_buffer2(); +init_process2(); +var JSON_SCHEMA_DRAFT_07 = "http://json-schema.org/draft-07/schema"; +function extractOpenAPI2ResponseSchema(response) { + if (response.schema) { + return response.schema; + } + return null; +} +function extractOpenAPI3ResponseSchema(response) { + if (!response.content) { + return null; + } + const jsonContentTypes = [ + "application/json", + "application/vnd.api+json", + "text/json" + ]; + for (const [contentType, mediaType] of Object.entries(response.content)) { + if (!jsonContentTypes.includes(contentType)) { + continue; + } + if (mediaType.schema) { + return mediaType.schema; + } + } + return null; +} +function extractOpenAPI2RequestSchema(parameters) { + const bodyParam = parameters.find((param) => param.in === "body"); + return bodyParam?.schema ?? null; +} +function extractOpenAPI3RequestSchema(requestBody) { + if (!requestBody?.content) { + return null; + } + const jsonContentTypes = [ + "application/json", + "application/vnd.api+json", + "text/json" + ]; + for (const [contentType, mediaType] of Object.entries(requestBody.content)) { + if (!jsonContentTypes.includes(contentType)) { + continue; + } + if (mediaType.schema) { + return mediaType.schema; + } + } + return null; +} +function createUnionSchema(schemas5, baseId, hasStatusCodes = false) { + if (schemas5.length === 0) { + return null; + } + if (schemas5.length === 1) { + const schema8 = schemas5[0]; + return { + ...schema8, + $id: schema8.$id ?? baseId, + $schema: JSON_SCHEMA_DRAFT_07 + }; + } + const unionSchema = { + type: "object", + oneOf: schemas5, + $id: baseId, + $schema: JSON_SCHEMA_DRAFT_07 + }; + if (hasStatusCodes) { + unionSchema["x-modelina-has-status-codes"] = true; + } + return unionSchema; +} +function extractPayloadsFromOperations(paths) { + const requestPayloads = {}; + const responsePayloads = {}; + for (const [pathKey, pathItem] of Object.entries(paths)) { + if (!pathItem) { + continue; + } + for (const [method2, operation] of Object.entries(pathItem)) { + if (!operation || typeof operation !== "object") { + continue; + } + const operationObj = operation; + const operationId = operationObj.operationId ?? `${method2}${pathKey.replace(/[^a-zA-Z0-9]/g, "")}`; + let requestSchema = null; + if ("parameters" in operationObj && operationObj.parameters) { + requestSchema = extractOpenAPI2RequestSchema( + operationObj.parameters + ); + } else if ("requestBody" in operationObj && operationObj.requestBody) { + requestSchema = extractOpenAPI3RequestSchema( + operationObj.requestBody + ); + } + if (requestSchema) { + const requestSchemaId = pascalCase2(`${operationId}_Request`); + requestPayloads[operationId] = { + schema: { + ...requestSchema, + $id: requestSchemaId, + $schema: JSON_SCHEMA_DRAFT_07 + }, + schemaId: requestSchemaId + }; + } + if (operationObj.responses) { + const responseSchemas = []; + let hasStatusCodes = false; + for (const [statusCode, response] of Object.entries( + operationObj.responses + )) { + if (!response || typeof response !== "object") { + continue; + } + let responseSchema = null; + if ("schema" in response) { + responseSchema = extractOpenAPI2ResponseSchema( + response + ); + } else { + responseSchema = extractOpenAPI3ResponseSchema( + response + ); + } + if (responseSchema) { + if (statusCode !== "default" && !isNaN(Number(statusCode))) { + hasStatusCodes = true; + responseSchema["x-modelina-status-codes"] = { + code: Number(statusCode) + }; + } + responseSchemas.push({ + ...responseSchema, + $id: `${operationId}_Response_${statusCode}` + }); + } + } + if (responseSchemas.length > 0) { + const responseSchemaId = pascalCase2(`${operationId}_Response`); + const unionSchema = createUnionSchema( + responseSchemas, + responseSchemaId, + hasStatusCodes + ); + if (unionSchema) { + responsePayloads[`${operationId}_Response`] = { + schema: unionSchema, + schemaId: responseSchemaId + }; + } + } + } + } + } + return { requestPayloads, responsePayloads }; +} +function extractComponentSchemas(openapiDocument) { + const componentSchemas = []; + if ("components" in openapiDocument && openapiDocument.components?.schemas) { + for (const [schemaName, schema8] of Object.entries( + openapiDocument.components.schemas + )) { + if (schema8 && typeof schema8 === "object") { + componentSchemas.push({ + schema: { + ...schema8, + $id: schemaName, + $schema: JSON_SCHEMA_DRAFT_07 + }, + schemaId: schemaName + }); + } + } + } + if ("definitions" in openapiDocument && openapiDocument.definitions) { + for (const [schemaName, schema8] of Object.entries( + openapiDocument.definitions + )) { + if (schema8 && typeof schema8 === "object") { + componentSchemas.push({ + schema: { + ...schema8, + $id: schemaName, + $schema: JSON_SCHEMA_DRAFT_07 + }, + schemaId: schemaName + }); + } + } + } + return componentSchemas; +} +function processOpenAPIPayloads(openapiDocument) { + const channelPayloads = {}; + const operationPayloads = {}; + const otherPayloads = []; + const { requestPayloads, responsePayloads } = extractPayloadsFromOperations( + openapiDocument.paths ?? {} + ); + for (const [operationId, payload] of Object.entries(requestPayloads)) { + operationPayloads[operationId] = payload; + } + for (const [responseId, payload] of Object.entries(responsePayloads)) { + operationPayloads[responseId] = payload; + } + const componentSchemas = extractComponentSchemas(openapiDocument); + otherPayloads.push(...componentSchemas); + return { + channelPayloads, + operationPayloads, + otherPayloads: onlyUnique(otherPayloads) + }; +} + +// src/codegen/modelina/presets/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/modelina/presets/validation.ts +init_dirname(); +init_buffer2(); +init_process2(); +function safeStringify(value2) { + let depth = 0; + const maxDepth = 255; + const maxRepetitions = 5; + let isRoot = true; + function stringify5(val, currentPath = []) { + if (depth > maxDepth) { + return true; + } + switch (typeof val) { + case "function": + return true; + case "boolean": + case "number": + case "string": + return val; + case "object": { + if (val === null) { + return null; + } + if (currentPath.length > 0 && currentPath[currentPath.length - 1] === val) { + return true; + } + const repetitionCount = currentPath.filter((obj) => obj === val).length; + if (repetitionCount >= maxRepetitions) { + return true; + } + depth++; + const newPath = [...currentPath, val]; + const atRoot = isRoot; + isRoot = false; + let result2; + if (Array.isArray(val)) { + result2 = val.map((item) => stringify5(item, newPath)); + } else { + result2 = {}; + const hasCompositionKeyword = val.oneOf !== void 0 || val.anyOf !== void 0; + const hasConflictingObjectType = val.type === "object" && hasCompositionKeyword; + for (const [key, value3] of Object.entries(val)) { + if (key.startsWith("x-modelina") || key.startsWith("x-the-codegen-project") || key.startsWith("x-parser-") || key.startsWith("x-modelgen-") || key.startsWith("discriminator")) { + continue; + } + if (atRoot && key === "type" && hasConflictingObjectType) { + continue; + } + result2[key] = stringify5(value3, newPath); + } + } + depth--; + return result2; + } + case "undefined": + return void 0; + default: + return true; + } + } + return JSON.stringify(stringify5(value2)); +} +function generateTypescriptValidationCode({ + model, + renderer, + asClassMethods = true, + context: context2 +}) { + renderer.dependencyManager.addTypeScriptDependency( + "{Ajv, Options as AjvOptions, ErrorObject, ValidateFunction}", + "ajv" + ); + renderer.dependencyManager.addTypeScriptDependency( + "{default as addFormats}", + "ajv-formats" + ); + const schemaProperty = asClassMethods ? "public static theCodeGenSchema" : "export const theCodeGenSchema"; + const methodPrefix = asClassMethods ? "public static " : "export function "; + const createValidatorCall = asClassMethods ? "this.createValidator(context)" : "createValidator(context)"; + const compileCall = asClassMethods ? "this.theCodeGenSchema" : "theCodeGenSchema"; + const vocabularies = context2.inputType === "openapi" ? 'ajvInstance.addVocabulary(["xml", "example"])' : ""; + return `${schemaProperty} = ${safeStringify(model.originalInput)}; +${methodPrefix}validate(context?: {data: any, ajvValidatorFunction?: ValidateFunction, ajvInstance?: Ajv, ajvOptions?: AjvOptions}): { valid: boolean; errors?: ErrorObject[]; } { + const {data, ajvValidatorFunction} = context ?? {}; + // Intentionally parse JSON strings to support validation of marshalled output. + // Example: validate({data: marshal(obj)}) works because marshal returns JSON string. + // Note: String 'true' will be coerced to boolean true due to JSON.parse. + const parsedData = typeof data === 'string' ? JSON.parse(data) : data; + const validate = ajvValidatorFunction ?? ${createValidatorCall} + return { + valid: validate(parsedData), + errors: validate.errors ?? undefined, + }; +} +${methodPrefix}createValidator(context?: {ajvInstance?: Ajv, ajvOptions?: AjvOptions}): ValidateFunction { + const {ajvInstance} = {...context ?? {}, ajvInstance: new Ajv(context?.ajvOptions ?? {})}; + addFormats(ajvInstance); + ${vocabularies} + const validate = ajvInstance.compile(${compileCall}); + return validate; +} +`; +} +function createValidationPreset(options, context2) { + return { + class: { + additionalContent: ({ + content, + model, + renderer + }) => { + if (!options.includeValidation) { + return content; + } + return `${content} +${generateTypescriptValidationCode({ + model, + renderer, + asClassMethods: options.asClassMethods ?? true, + context: context2 + })}`; + } + } + }; +} + +// src/codegen/modelina/presets/union.ts +init_dirname(); +init_buffer2(); +init_process2(); +function findBestDiscriminatorOption(model, renderer) { + const firstFound = Object.values(model.properties).map((property2) => { + const enumModel = property2.property instanceof ConstrainedReferenceModel && property2.property.ref instanceof ConstrainedEnumModel ? property2.property.ref : void 0; + const constValue = property2.property.options.const ? property2.property.options.const.value : void 0; + return { + isEnumModel: enumModel !== void 0, + isConst: constValue !== void 0, + constValue, + enumModel, + property: property2 + }; + }).filter(({ isConst, isEnumModel: isEnumModel2 }) => { + return isConst || isEnumModel2; + }); + if (firstFound.length > 1) { + const potentialProperties = firstFound.map(({ property: property2 }) => { + return property2.propertyName; + }).join(", "); + Logger.warn( + `More then one property could be discriminator for union model ${model.name}, found property ${potentialProperties}` + ); + } + if (firstFound.length >= 1) { + const firstIsBest = firstFound[0]; + const discriminatorValue = firstIsBest.property.unconstrainedPropertyName; + if (firstIsBest.isEnumModel) { + const enumModel = firstIsBest.enumModel; + renderer.dependencyManager.addTypeScriptDependency( + `{${enumModel.type}}`, + `./${enumModel.type}` + ); + return { + objCheck: `if(json.${discriminatorValue} === ${enumModel.type}.${enumModel.values[0].key}) { + return ${model.name}.unmarshal(json); + }` + }; + } else if (firstIsBest.isConst) { + return { + objCheck: `if(json.${discriminatorValue} === ${firstIsBest.constValue}) { + return ${model.name}.unmarshal(json); + }` + }; + } + Logger.warn( + `Could not determine discriminator for ${model.name}, as part of ${model.name}, will not be able to serialize or deserialize messages with this payload` + ); + return {}; + } +} +function findDiscriminatorChecks(model, renderer) { + if (model instanceof ConstrainedReferenceModel && model.ref instanceof ConstrainedObjectModel) { + const discriminatorValue = model.options.discriminator?.type; + if (!discriminatorValue) { + return findBestDiscriminatorOption(model.ref, renderer); + } + return { + objCheck: `if(json.${model.options.discriminator?.discriminator} === ${discriminatorValue}}) { +return ${model.type}.unmarshal(json); +}` + }; + } + return {}; +} +function renderUnionMarshal(model) { + const unmarshalChecks = model.union.map((unionModel) => { + if (unionModel instanceof ConstrainedReferenceModel && unionModel.ref instanceof ConstrainedObjectModel) { + return `if(payload instanceof ${unionModel.type}) { +return payload.marshal(); +}`; + } + }); + return `export function marshal(payload: ${model.name}) { + ${unmarshalChecks.join("\n")} + return JSON.stringify(payload); +}`; +} +function renderUnionUnmarshal(model, renderer) { + const discriminatorChecks = model.union.map((model2) => { + return findDiscriminatorChecks(model2, renderer); + }); + const hasObjValues = discriminatorChecks.filter((value2) => value2?.objCheck).length >= 1; + return `export function unmarshal(json: any): ${model.name} { + ${hasObjValues ? `if(typeof json === 'object') { + ${discriminatorChecks.filter((value2) => value2?.objCheck).map((value2) => value2?.objCheck).join("\n ")} + }` : ""} + return JSON.parse(json); +}`; +} +function extractStatusCodeValue(unionMember) { + if (!(unionMember instanceof ConstrainedReferenceModel && unionMember.ref instanceof ConstrainedObjectModel)) { + return null; + } + const memberOriginalInput = unionMember.ref.originalInput; + const statusCode = memberOriginalInput?.["x-modelina-status-codes"]; + if (!statusCode) { + return null; + } + if (typeof statusCode === "object" && statusCode.code !== void 0) { + return statusCode.code; + } + if (typeof statusCode === "number") { + return statusCode; + } + return null; +} +function generateStatusCodeCheck(unionMember, codeValue) { + return ` if (statusCode === ${codeValue}) { + return ${unionMember.type}.unmarshal(json); + }`; +} +function renderUnionUnmarshalByStatusCode(model) { + if (!model.originalInput?.["x-modelina-has-status-codes"]) { + return ""; + } + const statusCodeChecks = model.union.map((unionMember) => { + const codeValue = extractStatusCodeValue(unionMember); + return codeValue !== null ? generateStatusCodeCheck(unionMember, codeValue) : null; + }).filter((check) => check !== null); + if (statusCodeChecks.length === 0) { + return ""; + } + return ` +export function unmarshalByStatusCode(json: any, statusCode: number): ${model.name} { +${statusCodeChecks.join("\n")} + throw new Error(\`No matching type found for status code: \${statusCode}\`); +}`; +} +function createUnionPreset(options, context2) { + return { + type: { + self({ + model, + content, + renderer + }) { + if (model instanceof ConstrainedUnionModel) { + return `${content} + +${renderUnionUnmarshal(model, renderer)} +${renderUnionMarshal(model)} +${renderUnionUnmarshalByStatusCode(model)} +${options.includeValidation ? generateTypescriptValidationCode({ model, renderer, asClassMethods: false, context: context2 }) : ""} +`; + } + return content; + } + } + }; +} + +// src/codegen/modelina/presets/primitives.ts +init_dirname(); +init_buffer2(); +init_process2(); +function isPrimitiveModel(model) { + return model instanceof ConstrainedStringModel || model instanceof ConstrainedIntegerModel || model instanceof ConstrainedFloatModel || model instanceof ConstrainedBooleanModel; +} +function isNullModel(model) { + if (!(model instanceof ConstrainedAnyModel)) { + return false; + } + const originalInput = model.originalInput; + return originalInput && originalInput.type === "null"; +} +function isDateFormatModel(model) { + if (!(model instanceof ConstrainedStringModel)) { + return false; + } + const format5 = model.originalInput?.format; + return format5 === "date" || format5 === "date-time"; +} +function renderNullMarshal(model) { + return `export function marshal(payload: null): string { + return JSON.stringify(payload); +}`; +} +function renderNullUnmarshal(model) { + return `export function unmarshal(json: string): null { + const parsed = JSON.parse(json); + if (parsed !== null) { + throw new Error('Expected null value'); + } + return null; +}`; +} +function renderPrimitiveMarshal(model) { + return `export function marshal(payload: ${model.name}): string { + return JSON.stringify(payload); +}`; +} +function renderPrimitiveUnmarshal(model) { + return `export function unmarshal(json: string): ${model.name} { + return JSON.parse(json) as ${model.name}; +}`; +} +function renderDateUnmarshal(model) { + return `export function unmarshal(json: string): ${model.name} { + const parsed = JSON.parse(json); + return new Date(parsed); +}`; +} +function renderDateMarshal(model) { + return `export function marshal(payload: ${model.name}): string { + return JSON.stringify(payload); +}`; +} +function renderArrayMarshal(model) { + const valueModel = model.valueModel; + const hasItemMarshal = valueModel.type !== "string" && valueModel.type !== "number" && valueModel.type !== "boolean"; + if (hasItemMarshal) { + return `export function marshal(payload: ${model.name}): string { + return JSON.stringify(payload.map((item) => { + if (item && typeof item === 'object' && 'marshal' in item && typeof item.marshal === 'function') { + return JSON.parse(item.marshal()); + } + return item; + })); +}`; + } + return `export function marshal(payload: ${model.name}): string { + return JSON.stringify(payload); +}`; +} +function renderArrayUnmarshal(model) { + const valueModel = model.valueModel; + const hasItemUnmarshal = valueModel.type !== "string" && valueModel.type !== "number" && valueModel.type !== "boolean" && !(valueModel instanceof ConstrainedArrayModel) && !(valueModel instanceof ConstrainedUnionModel); + if (hasItemUnmarshal) { + const itemTypeName = valueModel.name; + return `export function unmarshal(json: string | any[]): ${model.name} { + const arr = typeof json === 'string' ? JSON.parse(json) : json; + return arr.map((item: any) => { + if (item && typeof item === 'object') { + return ${itemTypeName}.unmarshal(item); + } + return item; + }) as ${model.name}; +}`; + } + return `export function unmarshal(json: string | any[]): ${model.name} { + if (typeof json === 'string') { + return JSON.parse(json) as ${model.name}; + } + return json as ${model.name}; +}`; +} +function createPrimitivesPreset(options, context2) { + return { + type: { + self({ + model, + content, + renderer + }) { + if (isPrimitiveModel(model)) { + const isDate3 = isDateFormatModel(model); + const unmarshalFunc = isDate3 ? renderDateUnmarshal(model) : renderPrimitiveUnmarshal(model); + const marshalFunc = isDate3 ? renderDateMarshal(model) : renderPrimitiveMarshal(model); + return `${content} + +${unmarshalFunc} +${marshalFunc} +${options.includeValidation ? generateTypescriptValidationCode({ model, renderer, asClassMethods: false, context: context2 }) : ""} +`; + } + if (model instanceof ConstrainedArrayModel) { + return `${content} + +${renderArrayUnmarshal(model)} +${renderArrayMarshal(model)} +${options.includeValidation ? generateTypescriptValidationCode({ model, renderer, asClassMethods: false, context: context2 }) : ""} +`; + } + if (isNullModel(model)) { + return `${content} + +${renderNullUnmarshal(model)} +${renderNullMarshal(model)} +${options.includeValidation ? generateTypescriptValidationCode({ model, renderer, asClassMethods: false, context: context2 }) : ""} +`; + } + return content; + } + } + }; +} + +// src/codegen/generators/typescript/payloads.ts +var zodTypeScriptPayloadGenerator = external_exports.object({ + id: external_exports.string().optional().default("payloads-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("payloads").default("payloads"), + outputPath: external_exports.string().optional().default("src/__gen__/payloads"), + serializationType: external_exports.literal("json").optional().default("json"), + language: external_exports.literal("typescript").optional().default("typescript"), + enum: external_exports.enum(["enum", "union"]).optional().default("enum").describe( + "By default all payloads enum types are generated as separate enum types, but in some cases a simple union type might be more prudent." + ), + map: external_exports.enum(["indexedObject", "map", "record"]).optional().default("record").describe("Which map type to use when a dictionary type is needed"), + useForJavaScript: external_exports.boolean().optional().default(true).describe( + "By default we assume that the models might be transpiled to JS, therefore JS restrictions will be applied by default." + ), + includeValidation: external_exports.boolean().optional().default(true).describe( + "By default we assume that the models will be used to also validate incoming data." + ), + rawPropertyNames: external_exports.boolean().optional().default(false).describe( + 'Use raw property names instead of constrained ones, where you most likely need to access them with obj["propertyName"] instead of obj.propertyName' + ) +}); +var defaultTypeScriptPayloadGenerator = zodTypeScriptPayloadGenerator.parse({}); +async function generateTypescriptPayloadsCoreFromSchemas({ + context: context2, + processedSchemaData +}) { + const generator = context2.generator; + const modelinaGenerator = new TypeScriptFileGenerator({ + ...defaultCodegenTypescriptModelinaOptions, + presets: [ + TS_DESCRIPTION_PRESET, + { + preset: TS_COMMON_PRESET, + options: { + marshalling: true + } + }, + createValidationPreset( + { + includeValidation: generator.includeValidation + }, + context2 + ), + createUnionPreset( + { + includeValidation: generator.includeValidation + }, + context2 + ), + createPrimitivesPreset( + { + includeValidation: generator.includeValidation + }, + context2 + ) + ], + enumType: generator.enum, + mapType: generator.map, + rawPropertyNames: generator.rawPropertyNames, + useJavascriptReservedKeywords: generator.useForJavaScript + }); + const channelModels = {}; + const operationModels = {}; + const otherModels = []; + const files = []; + for (const [channelId, schemaData] of Object.entries( + processedSchemaData.channelPayloads + )) { + if (schemaData) { + const result2 = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + const models = result2.models; + files.push(...result2.files); + if (models.length > 0) { + const messageModel = models[0].model; + let messageType = messageModel.type; + if (!(messageModel instanceof ConstrainedObjectModel)) { + messageType = messageModel.name; + } + channelModels[channelId] = { + messageModel: models[0], + messageType + }; + for (let i7 = 1; i7 < models.length; i7++) { + const additionalModel = models[i7].model; + otherModels.push({ + messageModel: models[i7], + messageType: additionalModel.type + }); + } + } + } + } + for (const [operationId, schemaData] of Object.entries( + processedSchemaData.operationPayloads + )) { + if (schemaData) { + const result2 = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + const models = result2.models; + files.push(...result2.files); + if (models.length > 0) { + const messageModel = models[0].model; + let messageType = messageModel.type; + if (!(messageModel instanceof ConstrainedObjectModel)) { + messageType = messageModel.name; + } + operationModels[operationId] = { + messageModel: models[0], + messageType + }; + for (let i7 = 1; i7 < models.length; i7++) { + const additionalModel = models[i7].model; + otherModels.push({ + messageModel: models[i7], + messageType: additionalModel.type + }); + } + } + } + } + for (const schemaData of processedSchemaData.otherPayloads) { + const result2 = await generateModels({ + generator: modelinaGenerator, + input: schemaData.schema, + outputPath: generator.outputPath + }); + files.push(...result2.files); + for (const model of result2.models) { + const messageModel = model.model; + let messageType = messageModel.type; + if (!(messageModel instanceof ConstrainedObjectModel)) { + messageType = messageModel.name; + } + otherModels.push({ + messageModel: model, + messageType + }); + } + } + const uniqueFiles = []; + const seenPaths = /* @__PURE__ */ new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); + } + } + return { + channelModels, + operationModels, + otherModels, + generator, + files: uniqueFiles + }; +} +async function generateTypescriptPayload(context2) { + const { asyncapiDocument, openapiDocument, inputType } = context2; + let processedSchemaData; + switch (inputType) { + case "asyncapi": { + if (!asyncapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "payloads" + }); + } + processedSchemaData = await processAsyncAPIPayloads(asyncapiDocument); + break; + } + case "openapi": { + if (!openapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "payloads" + }); + } + processedSchemaData = processOpenAPIPayloads(openapiDocument); + break; + } + default: + throw new Error(`Unsupported input type: ${inputType}`); + } + return generateTypescriptPayloadsCoreFromSchemas({ + processedSchemaData, + context: context2 + }); +} + +// src/codegen/generators/typescript/headers.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/asyncapi/generators/headers.ts +init_dirname(); +init_buffer2(); +init_process2(); +function processAsyncAPIHeaders(asyncapiDocument) { + const channelHeaders = {}; + for (const channel of asyncapiDocument.allChannels().all()) { + const messages = channel.messages().all(); + let hasHeadersInChannel = false; + for (const message of messages) { + if (message.hasHeaders()) { + let schemaObj; + const schema8 = AsyncAPIInputProcessor.convertToInternalSchema( + message.headers() + ); + if (typeof schema8 === "boolean") { + schemaObj = schema8; + } else { + schemaObj = { + type: "object", + ...schema8, + $id: pascalCase2(`${message.id()}_headers`), + $schema: "http://json-schema.org/draft-07/schema" + }; + } + channelHeaders[channel.id()] = { + schema: schemaObj, + schemaId: pascalCase2(`${message.id()}_headers`) + }; + hasHeadersInChannel = true; + break; + } + } + if (!hasHeadersInChannel) { + channelHeaders[channel.id()] = void 0; + } + } + return { channelHeaders }; +} + +// src/codegen/inputs/openapi/generators/headers.ts +init_dirname(); +init_buffer2(); +init_process2(); +function convertHeaderSchemaToJsonSchema(header) { + let schema8; + if (header.schema) { + schema8 = { ...header.schema }; + } else if (header.type) { + schema8 = { + type: header.type, + ...header.format && { format: header.format }, + ...header.enum && { enum: header.enum }, + ...header.minimum !== void 0 && { minimum: header.minimum }, + ...header.maximum !== void 0 && { maximum: header.maximum }, + ...header.minLength !== void 0 && { + minLength: header.minLength + }, + ...header.maxLength !== void 0 && { + maxLength: header.maxLength + }, + ...header.pattern && { pattern: header.pattern } + }; + } else { + schema8 = { type: "string" }; + } + return schema8; +} +function extractHeadersFromOperations(paths) { + const operationHeaders = {}; + for (const [pathKey, pathItem] of Object.entries(paths)) { + for (const [method2, operation] of Object.entries(pathItem)) { + const operationObj = operation; + const allParameters = operationObj.parameters ?? []; + const headerParams = allParameters.filter((param) => { + return param.in === "header"; + }); + if (allParameters.length > 0) { + const operationId = operationObj.operationId ?? `${method2}${pathKey.replace(/[^a-zA-Z0-9]/g, "")}`; + operationHeaders[operationId] = headerParams; + } + } + } + return operationHeaders; +} +function processOpenAPIHeaders(openapiDocument) { + const channelHeaders = {}; + const operationHeaders = extractHeadersFromOperations( + openapiDocument.paths ?? {} + ); + for (const [operationId, headerParams] of Object.entries(operationHeaders)) { + if (headerParams.length === 0) { + channelHeaders[operationId] = void 0; + continue; + } + const properties = {}; + const required = []; + for (const param of headerParams) { + const paramName = param.name; + const paramSchema = convertHeaderSchemaToJsonSchema(param); + if (param.description) { + paramSchema.description = param.description; + } + properties[paramName] = paramSchema; + if (param.required === true) { + required.push(paramName); + } + } + const schemaObj = { + type: "object", + additionalProperties: false, + properties, + $id: pascalCase2(`${operationId}_headers`), + $schema: "http://json-schema.org/draft-07/schema" + }; + if (required.length > 0) { + schemaObj.required = required; + } + channelHeaders[operationId] = { + schema: schemaObj, + schemaId: pascalCase2(`${operationId}_headers`) + }; + } + return { channelHeaders }; +} + +// src/codegen/generators/typescript/headers.ts +var zodTypescriptHeadersGenerator = external_exports.object({ + id: external_exports.string().optional().default("headers-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("headers").default("headers"), + outputPath: external_exports.string().default("src/__gen__/headers"), + serializationType: external_exports.literal("json").optional().default("json"), + language: external_exports.literal("typescript").optional().default("typescript"), + includeValidation: external_exports.boolean().optional().default(true).describe( + "By default we assume that the models will be used to also validate headers" + ) +}); +var defaultTypeScriptHeadersOptions = zodTypescriptHeadersGenerator.parse({}); +async function generateTypescriptHeadersCore({ + processedData, + context: context2 +}) { + const { generator } = context2; + const modelinaGenerator = new TypeScriptFileGenerator({ + ...defaultCodegenTypescriptModelinaOptions, + constraints: { + propertyKey: defaultPropertyKeyConstraints({ + NO_SPECIAL_CHAR: (value2) => value2.replace(/[^a-zA-Z0-9]/g, "_") + }) + }, + enumType: "union", + useJavascriptReservedKeywords: false, + presets: [ + TS_DESCRIPTION_PRESET, + { + preset: TS_COMMON_PRESET, + options: { + marshalling: true + } + }, + createValidationPreset( + { + includeValidation: generator.includeValidation + }, + context2 + ) + ] + }); + const channelModels = {}; + const files = []; + for (const [channelId, headerData] of Object.entries( + processedData.channelHeaders + )) { + if (headerData) { + const result2 = await generateModels({ + generator: modelinaGenerator, + input: headerData.schema, + outputPath: generator.outputPath + }); + channelModels[channelId] = result2.models.length > 0 ? result2.models[0] : void 0; + files.push(...result2.files); + } else { + channelModels[channelId] = void 0; + } + } + const uniqueFiles = []; + const seenPaths = /* @__PURE__ */ new Set(); + for (const file of files) { + if (!seenPaths.has(file.path)) { + seenPaths.add(file.path); + uniqueFiles.push(file); + } + } + return { channelModels, files: uniqueFiles }; +} +async function generateTypescriptHeaders(context2) { + const { asyncapiDocument, openapiDocument, inputType, generator } = context2; + let processedData; + switch (inputType) { + case "asyncapi": + if (!asyncapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "headers" + }); + } + processedData = processAsyncAPIHeaders(asyncapiDocument); + break; + case "openapi": + if (!openapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "headers" + }); + } + processedData = processOpenAPIHeaders(openapiDocument); + break; + default: + throw new Error(`Unsupported input type: ${inputType}`); + } + const { channelModels, files } = await generateTypescriptHeadersCore({ + processedData, + context: context2 + }); + return { + channelModels, + generator, + files + }; +} + +// src/codegen/generators/typescript/channels/types.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/openapi/security.ts +init_dirname(); +init_buffer2(); +init_process2(); +function extractSecuritySchemes(document2) { + if ("openapi" in document2) { + return extractOpenAPI3SecuritySchemes( + document2 + ); + } + if ("swagger" in document2) { + return extractSwagger2SecuritySchemes(document2); + } + return []; +} +function extractOpenAPI3SecuritySchemes(document2) { + const securitySchemes = document2.components?.securitySchemes; + if (!securitySchemes) { + return []; + } + const schemes = []; + for (const [name2, scheme] of Object.entries(securitySchemes)) { + if ("$ref" in scheme) { + continue; + } + const securityScheme = scheme; + const extracted = extractOpenAPI3Scheme(name2, securityScheme); + if (extracted) { + schemes.push(extracted); + } + } + return schemes; +} +function extractOpenAPI3Scheme(name2, scheme) { + switch (scheme.type) { + case "apiKey": + return { + name: name2, + type: "apiKey", + apiKeyName: scheme.name, + apiKeyIn: scheme.in + }; + case "http": + return { + name: name2, + type: "http", + httpScheme: scheme.scheme, + bearerFormat: scheme.bearerFormat + }; + case "oauth2": + return { + name: name2, + type: "oauth2", + oauth2Flows: extractOAuth2Flows(scheme.flows) + }; + case "openIdConnect": + return { + name: name2, + type: "openIdConnect", + openIdConnectUrl: scheme.openIdConnectUrl + }; + default: + return void 0; + } +} +function extractOAuth2Flows(flows) { + const result2 = {}; + if (flows.implicit) { + result2.implicit = { + authorizationUrl: flows.implicit.authorizationUrl, + scopes: flows.implicit.scopes || {} + }; + } + if (flows.password) { + result2.password = { + tokenUrl: flows.password.tokenUrl, + scopes: flows.password.scopes || {} + }; + } + if (flows.clientCredentials) { + result2.clientCredentials = { + tokenUrl: flows.clientCredentials.tokenUrl, + scopes: flows.clientCredentials.scopes || {} + }; + } + if (flows.authorizationCode) { + result2.authorizationCode = { + authorizationUrl: flows.authorizationCode.authorizationUrl, + tokenUrl: flows.authorizationCode.tokenUrl, + scopes: flows.authorizationCode.scopes || {} + }; + } + return result2; +} +function extractSwagger2SecuritySchemes(document2) { + const securityDefinitions = document2.securityDefinitions; + if (!securityDefinitions) { + return []; + } + const schemes = []; + for (const [name2, definition] of Object.entries(securityDefinitions)) { + const extracted = extractSwagger2Scheme(name2, definition); + if (extracted) { + schemes.push(extracted); + } + } + return schemes; +} +function extractSwagger2Scheme(name2, definition) { + switch (definition.type) { + case "apiKey": + return { + name: name2, + type: "apiKey", + apiKeyName: definition.name, + apiKeyIn: definition.in + }; + case "basic": + return { + name: name2, + type: "http", + httpScheme: "basic" + }; + case "oauth2": + return { + name: name2, + type: "oauth2", + oauth2Flows: extractSwagger2OAuth2Flow(definition) + }; + default: + return void 0; + } +} +function extractSwagger2OAuth2Flow(definition) { + const result2 = {}; + const scopes = definition.scopes || {}; + switch (definition.flow) { + case "implicit": + result2.implicit = { + authorizationUrl: definition.authorizationUrl || "", + scopes + }; + break; + case "password": + result2.password = { + tokenUrl: definition.tokenUrl || "", + scopes + }; + break; + case "application": + result2.clientCredentials = { + tokenUrl: definition.tokenUrl || "", + scopes + }; + break; + case "accessCode": + result2.authorizationCode = { + authorizationUrl: definition.authorizationUrl || "", + tokenUrl: definition.tokenUrl || "", + scopes + }; + break; + } + return result2; +} + +// src/codegen/generators/typescript/channels/types.ts +var ChannelFunctionTypes = /* @__PURE__ */ ((ChannelFunctionTypes4) => { + ChannelFunctionTypes4["NATS_JETSTREAM_PUBLISH"] = "nats_jetstream_publish"; + ChannelFunctionTypes4["NATS_JETSTREAM_PULL_SUBSCRIBE"] = "nats_jetstream_pull_subscribe"; + ChannelFunctionTypes4["NATS_JETSTREAM_PUSH_SUBSCRIBE"] = "nats_jetstream_push_subscribe"; + ChannelFunctionTypes4["NATS_SUBSCRIBE"] = "nats_subscribe"; + ChannelFunctionTypes4["NATS_PUBLISH"] = "nats_publish"; + ChannelFunctionTypes4["NATS_REQUEST"] = "nats_request"; + ChannelFunctionTypes4["NATS_REPLY"] = "nats_reply"; + ChannelFunctionTypes4["MQTT_PUBLISH"] = "mqtt_publish"; + ChannelFunctionTypes4["MQTT_SUBSCRIBE"] = "mqtt_subscribe"; + ChannelFunctionTypes4["KAFKA_PUBLISH"] = "kafka_publish"; + ChannelFunctionTypes4["KAFKA_SUBSCRIBE"] = "kafka_subscribe"; + ChannelFunctionTypes4["AMQP_QUEUE_PUBLISH"] = "amqp_queue_publish"; + ChannelFunctionTypes4["AMQP_QUEUE_SUBSCRIBE"] = "amqp_queue_subscribe"; + ChannelFunctionTypes4["AMQP_EXCHANGE_PUBLISH"] = "amqp_exchange_publish"; + ChannelFunctionTypes4["HTTP_CLIENT"] = "http_client"; + ChannelFunctionTypes4["EVENT_SOURCE_FETCH"] = "event_source_fetch"; + ChannelFunctionTypes4["EVENT_SOURCE_EXPRESS"] = "event_source_express"; + ChannelFunctionTypes4["WEBSOCKET_PUBLISH"] = "websocket_publish"; + ChannelFunctionTypes4["WEBSOCKET_SUBSCRIBE"] = "websocket_subscribe"; + ChannelFunctionTypes4["WEBSOCKET_REGISTER"] = "websocket_register"; + return ChannelFunctionTypes4; +})(ChannelFunctionTypes || {}); +var sendingFunctionTypes = [ + "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */, + "nats_publish" /* NATS_PUBLISH */, + "nats_request" /* NATS_REQUEST */, + "mqtt_publish" /* MQTT_PUBLISH */, + "kafka_publish" /* KAFKA_PUBLISH */, + "amqp_exchange_publish" /* AMQP_EXCHANGE_PUBLISH */, + "amqp_queue_publish" /* AMQP_QUEUE_PUBLISH */, + "event_source_express" /* EVENT_SOURCE_EXPRESS */, + "http_client" /* HTTP_CLIENT */, + "websocket_publish" /* WEBSOCKET_PUBLISH */, + "websocket_register" /* WEBSOCKET_REGISTER */ +]; +var receivingFunctionTypes = [ + "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */, + "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */, + "nats_reply" /* NATS_REPLY */, + "nats_subscribe" /* NATS_SUBSCRIBE */, + "mqtt_subscribe" /* MQTT_SUBSCRIBE */, + "kafka_subscribe" /* KAFKA_SUBSCRIBE */, + "event_source_fetch" /* EVENT_SOURCE_FETCH */, + "amqp_queue_subscribe" /* AMQP_QUEUE_SUBSCRIBE */, + "websocket_subscribe" /* WEBSOCKET_SUBSCRIBE */ +]; +var zodTypescriptChannelsGenerator = external_exports.object({ + id: external_exports.string().optional().default("channels-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([ + "parameters-typescript", + "payloads-typescript", + "headers-typescript" + ]).describe("The list of other generator IDs that this generator depends on"), + preset: external_exports.literal("channels").default("channels"), + outputPath: external_exports.string().default("src/__gen__/channels").describe("The path for which the generated channels will be saved"), + protocols: external_exports.array( + external_exports.enum([ + "nats", + "kafka", + "mqtt", + "amqp", + "event_source", + "http_client", + "websocket" + ]) + ).default([]).describe("Select which protocol to generate the channel code for"), + parameterGeneratorId: external_exports.string().optional().describe( + "In case you have multiple TypeScript parameter generators, you can specify which one to use as the dependency for this channels generator." + ).default("parameters-typescript"), + payloadGeneratorId: external_exports.string().optional().describe( + "In case you have multiple TypeScript payload generators, you can specify which one to use as the dependency for this channels generator." + ).default("payloads-typescript"), + headerGeneratorId: external_exports.string().optional().describe( + "In case you have multiple TypeScript header generators, you can specify which one to use as the dependency for this channels generator." + ).default("headers-typescript"), + asyncapiReverseOperations: external_exports.boolean().optional().default(false).describe( + 'Setting this to true generate operations with reversed meaning. So for AsyncAPI this means if an operation is defined as action: "send", it gets the opposite view of "receive".' + ), + asyncapiGenerateForOperations: external_exports.boolean().optional().default(true).describe( + "Setting this to false means we dont enforce the operations defined in the AsyncAPI document and generate more generic channels." + ), + functionTypeMapping: external_exports.record(external_exports.array(external_exports.nativeEnum(ChannelFunctionTypes)).optional()).optional().default({}).describe( + "Used in conjunction with AsyncAPI input, can define channel ID along side the type of functions that should be rendered." + ), + kafkaTopicSeparator: external_exports.string().optional().default(".").describe( + "Used with AsyncAPI to ensure the right character separate topics, example if address is my/resource/path it will be converted to my.resource.path" + ), + eventSourceDependency: external_exports.string().optional().default("@microsoft/fetch-event-source").describe( + "Change the fork/dependency instead of @microsoft/fetch-event-source as it is out of date in some areas" + ), + language: external_exports.literal("typescript").optional().default("typescript"), + importExtension: zodImportExtension.describe( + 'File extension for relative imports. Use ".ts" for moduleResolution: "node16"/"nodenext", ".js" for compiled ESM output.' + ) +}); +var defaultTypeScriptChannelsGenerator = zodTypescriptChannelsGenerator.parse({}); + +// src/codegen/generators/typescript/channels/asyncapi.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/utils.ts +init_dirname(); +init_buffer2(); +init_process2(); +function addPayloadsToDependencies(models, payloadGenerator, currentGenerator, dependencies, importExtension = "none") { + models.filter((payload) => payload).forEach((payload) => { + const payloadImportPath = relativePath( + currentGenerator.outputPath, + joinPath(payloadGenerator.outputPath, payload.messageModel.modelName) + ); + const importPath = appendImportExtension( + `./${ensureRelativePath(payloadImportPath)}`, + importExtension + ); + if (payload.messageModel.model instanceof ConstrainedObjectModel || payload.messageModel.model instanceof ConstrainedEnumModel) { + dependencies.push( + `import {${payload.messageModel.modelName}} from '${importPath}';` + ); + } else { + dependencies.push( + `import * as ${payload.messageModel.modelName}Module from '${importPath}';` + ); + } + }); +} +function addPayloadsToExports(models, dependencies) { + models.filter((payload) => payload).forEach((payload) => { + if (payload.messageModel.model instanceof ConstrainedObjectModel || payload.messageModel.model instanceof ConstrainedEnumModel) { + dependencies.push(`export {${payload.messageModel.modelName}};`); + } else { + dependencies.push(`export {${payload.messageModel.modelName}Module};`); + } + }); +} +function addParametersToDependencies(parameters, parameterGenerator, currentGenerator, dependencies, importExtension = "none") { + Object.values(parameters).filter((model) => model !== void 0).forEach((parameter) => { + if (parameter === void 0) { + return; + } + const parameterImportPath = relativePath( + currentGenerator.outputPath, + joinPath(parameterGenerator.outputPath, parameter.modelName) + ); + const importPath = appendImportExtension( + `./${ensureRelativePath(parameterImportPath)}`, + importExtension + ); + dependencies.push( + `import {${parameter.modelName}} from '${importPath}';` + ); + }); +} +function addParametersToExports(parameters, dependencies) { + Object.values(parameters).filter((model) => model !== void 0).forEach((parameter) => { + if (parameter === void 0) { + return; + } + dependencies.push(`export {${parameter.modelName}};`); + }); +} +function addHeadersToDependencies(headers, headerGenerator, currentGenerator, dependencies, importExtension = "none") { + Object.values(headers).filter((model) => model !== void 0).forEach((header) => { + if (header === void 0) { + return; + } + const headerImportPath = relativePath( + currentGenerator.outputPath, + joinPath(headerGenerator.outputPath, header.modelName) + ); + const importPath = appendImportExtension( + `./${ensureRelativePath(headerImportPath)}`, + importExtension + ); + dependencies.push(`import {${header.modelName}} from '${importPath}';`); + }); +} +function getMessageTypeAndModule(payload) { + if (payload === void 0) { + return { + messageType: void 0, + messageModule: void 0, + includesStatusCodes: false + }; + } + let messageModule; + if (!(payload.messageModel.model instanceof ConstrainedObjectModel)) { + messageModule = `${payload.messageModel.modelName}Module`; + } + const includesStatusCodes = payload.includesStatusCodes ?? payload.messageModel.model.originalInput?.["x-modelina-has-status-codes"] === true; + return { messageType: payload.messageType, messageModule, includesStatusCodes }; +} +function getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail +}) { + let validatorCreation = ""; + let validationFunction = ""; + if (includeValidation) { + validatorCreation = `const validator = ${messageModule ?? messageType}.createValidator();`; + validationFunction = `if(!skipMessageValidation) { + const {valid, errors} = ${messageModule ?? messageType}.validate({data: receivedData, ajvValidatorFunction: validator}); + if(!valid) { + ${onValidationFail} + } + }`; + } + return { + potentialValidatorCreation: validatorCreation, + potentialValidationFunction: validationFunction + }; +} +function collectProtocolDependencies(payloads, parameters, headers, context2, protocolDeps, importExtension = "none") { + addPayloadsToDependencies( + Object.values(payloads.operationModels), + payloads.generator, + context2.generator, + protocolDeps, + importExtension + ); + addPayloadsToDependencies( + Object.values(payloads.channelModels), + payloads.generator, + context2.generator, + protocolDeps, + importExtension + ); + addPayloadsToDependencies( + Object.values(payloads.otherModels), + payloads.generator, + context2.generator, + protocolDeps, + importExtension + ); + addParametersToDependencies( + parameters.channelModels, + parameters.generator, + context2.generator, + protocolDeps, + importExtension + ); + if (headers) { + addHeadersToDependencies( + headers.channelModels, + headers.generator, + context2.generator, + protocolDeps, + importExtension + ); + } +} +function escapeJSDocDescription(description7) { + if (!description7) { + return ""; + } + return description7.replace(/\*\//g, "*\u2215").replace(/\n/g, "\n * "); +} +function renderChannelJSDoc(params) { + const { + description: description7, + deprecated, + fallbackDescription, + parameters = [] + } = params; + const desc = description7 ? escapeJSDocDescription(description7) : escapeJSDocDescription(fallbackDescription); + const parts = ["/**", ` * ${desc}`]; + if (deprecated) { + parts.push(" *"); + parts.push(" * @deprecated"); + } + if (parameters.length > 0) { + parts.push(" *"); + parameters.forEach((p7) => parts.push(p7.jsDoc)); + } + parts.push(" */"); + return parts.join("\n"); +} + +// src/codegen/generators/typescript/channels/protocols/nats/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/nats/coreRequest.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderCoreRequest({ + requestTopic, + requestMessageType, + requestMessageModule, + replyMessageType, + replyMessageModule, + channelParameters: channelParameters4, + subName = pascalCase2(requestTopic), + payloadGenerator, + functionName = `requestTo${subName}`, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${requestTopic}')` : `'${requestTopic}'`; + const requestType = requestMessageModule ? `${requestMessageModule}.${requestMessageType}` : requestMessageType; + const replyType = replyMessageModule ? `${replyMessageModule}.${replyMessageType}` : replyMessageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule: replyMessageModule, + messageType: replyMessageType, + onValidationFail: `return reject(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`));` + }); + const functionParameters = [ + { + parameter: `requestMessage`, + parameterType: `requestMessage: ${requestType}`, + jsDoc: ` * @param requestMessage the message to send` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "nc", + parameterType: "nc: Nats.NatsConnection", + jsDoc: " * @param nc the nats client to setup the request for" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use when transmitting request and receiving reply" + }, + { + parameter: "options", + parameterType: "options?: Nats.RequestOptions", + jsDoc: " * @param options when sending the request" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `NATS request operation for \`${requestTopic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise<${replyType}> { + return new Promise(async (resolve, reject) => { + try { + ${potentialValidatorCreation} + let dataToSend: any = requestMessage.marshal(); + dataToSend = codec.encode(dataToSend); + + const msg = await nc.request(${addressToUse}, dataToSend, options); + const receivedData: any = codec.decode(msg.data); + ${potentialValidationFunction} + resolve(${replyMessageModule ? `${replyMessageModule}.unmarshal(receivedData)` : `${replyMessageType}.unmarshal(receivedData)`}); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType: requestType, + replyType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_request" /* NATS_REQUEST */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/coreReply.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderCoreReply({ + requestTopic, + requestMessageType, + requestMessageModule, + replyMessageType, + replyMessageModule, + channelParameters: channelParameters4, + subName = pascalCase2(requestTopic), + payloadGenerator, + functionName = `replyTo${subName}`, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${requestTopic}')` : `'${requestTopic}'`; + const messageType = requestMessageModule ? `${requestMessageModule}.${requestMessageType}` : requestMessageType; + const replyType = replyMessageModule ?? replyMessageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule: requestMessageModule, + messageType: requestMessageType, + onValidationFail: channelParameters4 ? `onDataCallback(new Error('Invalid request payload received', JSON.stringify({cause: errors})), undefined, parameters); continue;` : `onDataCallback(new Error('Invalid request payload received', JSON.stringify({cause: errors})), undefined); continue;` + }); + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `requestMessage?: ${messageType}`, + jsDoc: " * @param requestMessage that was received from the request" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [] + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => ${replyType} | Promise<${replyType}>`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when the request is received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "nc", + parameterType: "nc: Nats.NatsConnection", + jsDoc: " * @param nc the nats client to setup the reply for" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use when receiving request and transmitting reply" + }, + { + parameter: "options", + parameterType: "options?: Nats.SubscriptionOptions", + jsDoc: " * @param options when setting up the reply" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const receivingOperation = `let receivedData : any = codec.decode(msg.data); +${potentialValidationFunction} +const replyMessage = await onDataCallback(undefined, ${requestMessageModule ?? requestMessageType}.unmarshal(receivedData) ${channelParameters4 ? ", parameters ?? undefined" : ""});`; + const replyOperation = `let dataToSend : any = replyMessage.marshal(); +dataToSend = codec.encode(dataToSend); +msg.respond(dataToSend);`; + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `NATS reply operation for \`${requestTopic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving the request + * + * @callback ${functionName}Callback + ${callbackJsDocParameters} + */ + +${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + let subscription = nc.subscribe(${addressToUse}, options); + ${potentialValidatorCreation} + (async () => { + for await (const msg of subscription) { + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(msg.subject, '${requestTopic}', ${findRegexFromChannel(requestTopic)})` : ""} + + ${receivingOperation} + + if (msg.reply) { + ${replyOperation} + } else { + onDataCallback(new Error('Expected request to need a reply, did not..')) + } + } + })(); + resolve(subscription); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + replyType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_reply" /* NATS_REPLY */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/corePublish.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/nats/utils.ts +init_dirname(); +init_buffer2(); +init_process2(); +function generateHeaderSetupCode(channelHeaders) { + if (!channelHeaders) { + return ""; + } + return `// Set up headers if provided + if (headers) { + const natsHeaders = Nats.headers(); + const headerData = headers.marshal(); + const parsedHeaders = typeof headerData === 'string' ? JSON.parse(headerData) : headerData; + for (const [key, value] of Object.entries(parsedHeaders)) { + if (value !== undefined) { + natsHeaders.append(key, String(value)); + } + } + options = { ...options, headers: natsHeaders }; + }`; +} +function generateHeaderExtractionCode(channelHeaders) { + if (!channelHeaders) { + return ""; + } + return `// Extract headers if present + let extractedHeaders: ${channelHeaders.type} | undefined = undefined; + if (msg.headers) { + const headerObj: Record = {}; + // NATS headers support both iteration and get() method + if (typeof msg.headers.keys === 'function') { + // Use keys() method if available (NATS MsgHdrs) + for (const key of msg.headers.keys()) { + headerObj[key] = msg.headers.get(key); + } + } else { + // Fallback to Object.entries for plain objects + for (const [key, value] of Object.entries(msg.headers)) { + headerObj[key] = value; + } + } + extractedHeaders = ${channelHeaders.type}.unmarshal(headerObj); + }`; +} +function generateHeaderParameter(channelHeaders) { + if (!channelHeaders) { + return null; + } + return { + parameter: "headers", + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the message" + }; +} +function generateHeaderCallbackParameter(channelHeaders) { + if (!channelHeaders) { + return null; + } + return { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that were received with the message" + }; +} +function generateMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + headerExtraction, + potentialValidationFunction +}) { + const hasParameters = !!channelParameters4; + const hasHeaders = !!channelHeaders; + const isNullMessage = messageType === "null"; + const callbackParams = ["undefined"]; + if (isNullMessage) { + callbackParams.push("null"); + } else { + callbackParams.push(messageUnmarshalling); + } + if (hasParameters) { + callbackParams.push("parameters"); + } + if (hasHeaders) { + callbackParams.push("extractedHeaders"); + } + callbackParams.push("msg"); + const callbackInvocation = `onDataCallback(${callbackParams.join(", ")});`; + if (isNullMessage) { + return hasHeaders ? `${headerExtraction} + ${callbackInvocation}` : callbackInvocation; + } + const messageDecoding = "let receivedData: any = codec.decode(msg.data);"; + const parts = [messageDecoding]; + if (hasHeaders) { + parts.push(headerExtraction); + } + if (potentialValidationFunction) { + parts.push(potentialValidationFunction); + } + parts.push(callbackInvocation); + return parts.join("\n"); +} + +// src/codegen/generators/typescript/channels/protocols/nats/corePublish.ts +function renderCorePublish({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `publishTo${subName}`, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headerSetup = generateHeaderSetupCode(channelHeaders); + const publishOperation = messageType === "null" ? `${headerSetup} + await nc.publish(${addressToUse}, Nats.Empty, options);` : `let dataToSend: any = ${messageMarshalling}; + ${headerSetup} +dataToSend = codec.encode(dataToSend); +nc.publish(${addressToUse}, dataToSend, options);`; + const headerParam = generateHeaderParameter(channelHeaders); + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...headerParam ? [headerParam] : [], + { + parameter: "nc", + parameterType: "nc: Nats.NatsConnection", + jsDoc: " * @param nc the NATS client to publish from" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use while transmitting the message" + }, + { + parameter: "options", + parameterType: "options?: Nats.PublishOptions", + jsDoc: " * @param options to use while publishing the message" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `NATS publish operation for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${publishOperation} + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_publish" /* NATS_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/coreSubscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderCoreSubscribe({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + payloadGenerator, + functionName = `subscribeTo${subName}`, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: `onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined,${channelParameters4 ? "parameters, " : ""}${channelHeaders ? "extractedHeaders, " : ""} msg); continue;` + }); + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headerCallbackParam = generateHeaderCallbackParameter(channelHeaders); + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + ...headerCallbackParam ? [headerCallbackParam] : [], + { + parameter: `natsMsg?: Nats.Msg`, + jsDoc: " * @param natsMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "nc", + parameterType: "nc: Nats.NatsConnection", + jsDoc: " * @param nc the nats client to setup the subscribe for" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use while receiving the message" + }, + { + parameter: "options", + parameterType: "options?: Nats.SubscriptionOptions", + jsDoc: " * @param options when setting up the subscription" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const headerExtraction = generateHeaderExtractionCode(channelHeaders); + const whenReceivingMessage = generateMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + headerExtraction, + potentialValidationFunction + }); + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const mainJsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `Core subscription for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving messages + * + * @callback ${functionName}Callback +${callbackJsDocParameters} + */ + +${mainJsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + const subscription = nc.subscribe(${addressToUse}, options); + ${potentialValidatorCreation} + (async () => { + for await (const msg of subscription) { + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(msg.subject, '${topic}', ${findRegexFromChannel(topic)})` : ""} + ${whenReceivingMessage} + } + })(); + resolve(subscription); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_subscribe" /* NATS_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/jetstreamPullSubscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetstreamPullSubscribe({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + payloadGenerator, + functionName = `jetStreamPullSubscribeTo${subName}`, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: `onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined,${channelParameters4 ? "parameters, " : ""}${channelHeaders ? "extractedHeaders, " : ""} msg); continue;` + }); + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that was received with the message" + } + ] : [], + { parameter: "jetstreamMsg?: Nats.JsMsg", jsDoc: " * @param jetstreamMsg" } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "js", + parameterType: "js: Nats.JetStreamClient", + jsDoc: " * @param js the JetStream client to pull subscribe through" + }, + { + parameter: "options", + parameterType: "options: Nats.ConsumerOptsBuilder | Partial", + jsDoc: " * @param options when setting up the subscription" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use while transmitting the message" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const headerExtraction = generateHeaderExtractionCode(channelHeaders); + const whenReceivingMessage = generateMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + headerExtraction, + potentialValidationFunction + }); + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `JetStream pull subscription for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving messages + * + * @callback ${functionName}Callback + ${callbackJsDocParameters} + */ + +${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + const subscription = await js.pullSubscribe(${addressToUse}, options); + ${potentialValidatorCreation} + (async () => { + for await (const msg of subscription) { + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(msg.subject, '${topic}', ${findRegexFromChannel(topic)})` : ""} + ${whenReceivingMessage} + } + })(); + resolve(subscription); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/jetstreamPushSubscription.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetstreamPushSubscription({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + payloadGenerator, + functionName = `jetStreamPushSubscriptionFrom${subName}`, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: `onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined,${channelParameters4 ? "parameters, " : ""}${channelHeaders ? "extractedHeaders, " : ""} msg); continue;` + }); + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that was received with the message" + } + ] : [], + { + parameter: "jetstreamMsg?: Nats.JsMsg", + jsDoc: " * @param jetstreamMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "js", + parameterType: "js: Nats.JetStreamClient", + jsDoc: " * @param js the JetStream client to pull subscribe through" + }, + { + parameter: "options", + parameterType: "options: Nats.ConsumerOptsBuilder | Partial", + jsDoc: " * @param options when setting up the subscription" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use while transmitting the message" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const headerExtraction = generateHeaderExtractionCode(channelHeaders); + const whenReceivingMessage = generateMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + headerExtraction, + potentialValidationFunction + }); + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `JetStream push subscription for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving messages + * + * @callback ${functionName}Callback + ${callbackJsDocParameters} + */ + +${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + const subscription = await js.subscribe(${addressToUse}, options); + ${potentialValidatorCreation} + (async () => { + for await (const msg of subscription) { + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(msg.subject, '${topic}', ${findRegexFromChannel(topic)})` : ""} + ${whenReceivingMessage} + } + })(); + resolve(subscription); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/jetstreamPublish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetstreamPublish({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `jetStreamPublishTo${subName}`, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headerSetup = generateHeaderSetupCode(channelHeaders); + const publishOperation = messageType === "null" ? `${headerSetup} + await js.publish(${addressToUse}, Nats.Empty, options);` : `let dataToSend: any = ${messageMarshalling}; + ${headerSetup} +dataToSend = codec.encode(dataToSend); +await js.publish(${addressToUse}, dataToSend, options);`; + const headerParam = generateHeaderParameter(channelHeaders); + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish over jetstream" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...headerParam ? [headerParam] : [], + { + parameter: "js", + parameterType: "js: Nats.JetStreamClient", + jsDoc: " * @param js the JetStream client to publish from" + }, + { + parameter: "codec = Nats.JSONCodec()", + parameterType: "codec?: Nats.Codec", + jsDoc: " * @param codec the serialization codec to use while transmitting the message" + }, + { + parameter: "options = {}", + parameterType: "options?: Partial", + jsDoc: " * @param options to use while publishing the message" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `JetStream publish operation for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${publishOperation} + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Nats from 'nats';`], + functionType: "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/nats/index.ts +async function generateNatsChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { parameter, headers, topic, payloads } = context2; + const ignoreOperation = !context2.generator.asyncapiGenerateForOperations; + let natsTopic = topic.startsWith("/") ? topic.slice(1) : topic; + natsTopic = natsTopic.replace(/\//g, "."); + const natsContext = { + channelParameters: parameter, + channelHeaders: headers, + topic: natsTopic, + messageType: "", + subName: context2.subName, + payloadGenerator: payloads + }; + const operations = channel.operations().all(); + const renders = operations.length > 0 && !ignoreOperation ? await generateForOperations(context2, channel, natsContext) : await generateForChannels(context2, channel, natsContext); + addRendersToExternal( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["nats"].push(...renders.map((value2) => value2.code)); + externalProtocolFunctionInformation["nats"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +async function generateForOperations(context2, channel, natsContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + if (updatedFunctionTypeMapping !== void 0 && !updatedFunctionTypeMapping?.some( + (f8) => [ + "nats_request" /* NATS_REQUEST */, + "nats_reply" /* NATS_REPLY */, + "nats_publish" /* NATS_PUBLISH */, + "nats_subscribe" /* NATS_SUBSCRIBE */, + "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */, + "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */, + "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */ + ].includes(f8) + )) { + continue; + } + const payload = payloads.operationModels[findOperationId(operation, channel)]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: findOperationId(operation, channel), + protocol: "NATS" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for NATS` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...natsContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + renders.push( + ...await generateOperationRenders( + operation, + updatedContext, + updatedFunctionTypeMapping, + generator, + payloads, + channel + ) + ); + } + return renders; +} +async function generateOperationRenders(operation, natsContext, functionTypeMapping, generator, payloads, channel) { + const renders = []; + const reply = operation.reply(); + if (reply) { + renders.push( + ...await handleReplyOperation( + operation, + reply, + channel, + natsContext, + functionTypeMapping, + generator, + payloads + ) + ); + } else { + renders.push( + ...await handleNonReplyOperation( + operation, + natsContext, + functionTypeMapping, + generator + ) + ); + } + return renders; +} +async function handleReplyOperation(operation, reply, channel, natsContext, functionTypeMapping, generator, payloads) { + const renders = []; + const replyId = findReplyId(operation, reply, channel); + const replyMessageModel = payloads.operationModels[replyId]; + if (!replyMessageModel) { + return renders; + } + const { messageModule: replyMessageModule, messageType: replyMessageType } = getMessageTypeAndModule(replyMessageModel); + if (replyMessageType === void 0) { + throw new Error( + `Could not find reply message type for channel typescript generator for NATS` + ); + } + if (shouldRenderFunctionType( + functionTypeMapping, + "nats_request" /* NATS_REQUEST */, + operation.action(), + generator.asyncapiReverseOperations + )) { + renders.push( + renderCoreRequest({ + ...natsContext, + requestMessageModule: natsContext.messageModule, + requestMessageType: natsContext.messageType, + replyMessageModule, + replyMessageType, + requestTopic: natsContext.topic, + payloadGenerator: payloads + }) + ); + } else if (shouldRenderFunctionType( + functionTypeMapping, + "nats_reply" /* NATS_REPLY */, + operation.action(), + generator.asyncapiReverseOperations + )) { + renders.push( + renderCoreReply({ + ...natsContext, + requestMessageModule: replyMessageModule, + requestMessageType: replyMessageType, + replyMessageModule: natsContext.messageModule, + replyMessageType: natsContext.messageType, + requestTopic: natsContext.topic, + payloadGenerator: payloads + }) + ); + } + return renders; +} +async function handleNonReplyOperation(operation, natsContext, functionTypeMapping, generator) { + const renders = []; + const action = operation.action(); + const renderChecks = [ + { check: "nats_publish" /* NATS_PUBLISH */, render: renderCorePublish }, + { check: "nats_subscribe" /* NATS_SUBSCRIBE */, render: renderCoreSubscribe }, + { + check: "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */, + render: renderJetstreamPullSubscribe + }, + { + check: "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */, + render: renderJetstreamPushSubscription + }, + { + check: "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */, + render: renderJetstreamPublish + } + ]; + for (const { check, render } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render(natsContext)); + } + } + return renders; +} +async function generateForChannels(context2, channel, natsContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? generator.functionTypeMapping?.[channel.id()]; + const payload = payloads.channelModels[channel.id()]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "NATS" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for NATS` + ); + } + const updatedContext = { ...natsContext, messageType, messageModule }; + const renderChecks = [ + { + check: "nats_publish" /* NATS_PUBLISH */, + render: renderCorePublish, + action: "send" + }, + { + check: "nats_subscribe" /* NATS_SUBSCRIBE */, + render: renderCoreSubscribe, + action: "receive" + }, + { + check: "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */, + render: renderJetstreamPullSubscribe, + action: "receive" + }, + { + check: "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */, + render: renderJetstreamPushSubscription, + action: "receive" + }, + { + check: "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */, + render: renderJetstreamPublish, + action: "send" + } + ]; + for (const { check, render, action } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render(updatedContext)); + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/kafka/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/kafka/publish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderPublish({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `produceTo${subName}`, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const publishOperation = messageType === "null" ? `let dataToSend: any = null;` : `let dataToSend: any = ${messageMarshalling};`; + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers`, + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the message" + } + ] : [], + { + parameter: "kafka", + parameterType: "kafka: Kafka.Kafka", + jsDoc: " * @param kafka the KafkaJS client to publish from" + } + ]; + const headersHandling = channelHeaders ? `// Set up headers if provided + let messageHeaders: Record | undefined = undefined; + if (headers) { + const headerData = headers.marshal(); + const parsedHeaders = typeof headerData === 'string' ? JSON.parse(headerData) : headerData; + messageHeaders = {}; + for (const [key, value] of Object.entries(parsedHeaders)) { + if (value !== undefined) { + messageHeaders[key] = String(value); + } + } + }` : ""; + const headersInMessage = channelHeaders ? "headers: messageHeaders" : ""; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `Kafka publish operation for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${publishOperation} + const producer = kafka.producer(); + await producer.connect(); + ${headersHandling} + + await producer.send({ + topic: ${addressToUse}, + messages: [ + { + value: dataToSend${channelHeaders ? `, + ${headersInMessage}` : ""} + }, + ], + }); + resolve(producer); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Kafka from 'kafkajs';`], + functionType: "kafka_publish" /* KAFKA_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/kafka/subscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/kafka/utils.ts +init_dirname(); +init_buffer2(); +init_process2(); +function generateKafkaMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + potentialValidationFunction +}) { + const headerExtraction = channelHeaders ? ` + // Extract headers if present + let extractedHeaders: ${channelHeaders.type} | undefined = undefined; + if (message.headers) { + const headerObj: Record = {}; + for (const [key, value] of Object.entries(message.headers)) { + if (value !== undefined) { + headerObj[key] = value.toString(); + } + } + extractedHeaders = ${channelHeaders.type}.unmarshal(headerObj); + }` : ""; + if (channelParameters4 && channelHeaders) { + if (messageType === "null") { + return `${headerExtraction} + onDataCallback(undefined, null, parameters, extractedHeaders, kafkaMessage);`; + } + return `${headerExtraction} +${potentialValidationFunction} +const callbackData = ${messageUnmarshalling}; +onDataCallback(undefined, callbackData, parameters, extractedHeaders, kafkaMessage);`; + } else if (channelParameters4) { + if (messageType === "null") { + return `onDataCallback(undefined, null, parameters, kafkaMessage);`; + } + return `${potentialValidationFunction} +const callbackData = ${messageUnmarshalling}; +onDataCallback(undefined, callbackData, parameters, kafkaMessage);`; + } else if (channelHeaders) { + if (messageType === "null") { + return `${headerExtraction} + onDataCallback(undefined, null, extractedHeaders, kafkaMessage);`; + } + return `${headerExtraction} +${potentialValidationFunction} +const callbackData = ${messageUnmarshalling}; +onDataCallback(undefined, callbackData, extractedHeaders, kafkaMessage);`; + } else if (messageType === "null") { + return `onDataCallback(undefined, null, kafkaMessage);`; + } + return `${potentialValidationFunction} +const callbackData = ${messageUnmarshalling}; +onDataCallback(undefined, callbackData, kafkaMessage);`; +} + +// src/codegen/generators/typescript/channels/protocols/kafka/subscribe.ts +function renderSubscribe({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `consumeFrom${subName}`, + payloadGenerator, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + const messageUnmarshalling = `${messageModule ?? messageType}.unmarshal(receivedData)`; + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: channelParameters4 && channelHeaders ? `return onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined, parameters, extractedHeaders, kafkaMessage);` : channelParameters4 ? `return onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined, parameters, kafkaMessage);` : channelHeaders ? `return onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined, extractedHeaders, kafkaMessage);` : `return onDataCallback(new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), undefined, kafkaMessage);` + }); + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that was received with the message" + } + ] : [], + { + parameter: `kafkaMsg?: Kafka.EachMessagePayload`, + jsDoc: " * @param kafkaMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "kafka", + parameterType: "kafka: Kafka.Kafka", + jsDoc: " * @param kafka the KafkaJS client to subscribe through" + }, + { + parameter: `options = {fromBeginning: true, groupId: ''}`, + parameterType: `options: {fromBeginning: boolean, groupId: string}`, + jsDoc: " * @param options when setting up the subscription" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const whenReceivingMessage = generateKafkaMessageReceivingCode({ + channelParameters: channelParameters4, + channelHeaders, + messageType, + messageUnmarshalling, + potentialValidationFunction + }); + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const mainJsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `Kafka subscription for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving messages + * + * @callback ${functionName}Callback +${callbackJsDocParameters} + */ + +${mainJsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + if(!options.groupId) { + return reject('No group ID provided'); + } + const consumer = kafka.consumer({ groupId: options.groupId }); + + ${potentialValidatorCreation} + await consumer.connect(); + await consumer.subscribe({ topic: ${addressToUse}, fromBeginning: options.fromBeginning }); + await consumer.run({ + eachMessage: async (kafkaMessage: Kafka.EachMessagePayload) => { + const { topic, message } = kafkaMessage; + const receivedData = message.value?.toString()!; + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(topic, '${topic}', ${findRegexFromChannel(topic)});` : ""} + ${whenReceivingMessage} + } + }); + resolve(consumer); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Kafka from 'kafkajs';`], + functionType: "kafka_subscribe" /* KAFKA_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/kafka/index.ts +async function generateKafkaChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { parameter, topic } = context2; + const ignoreOperation = !context2.generator.asyncapiGenerateForOperations; + let kafkaTopic = topic.startsWith("/") ? topic.slice(1) : topic; + kafkaTopic = kafkaTopic.replace(/\//g, context2.generator.kafkaTopicSeparator); + const kafkaContext = { + channelParameters: parameter, + channelHeaders: context2.headers, + // Kafka supports headers + topic: kafkaTopic, + messageType: "", + subName: context2.subName, + payloadGenerator: context2.payloads + }; + const operations = channel.operations().all(); + const renders = operations.length > 0 && !ignoreOperation ? await generateForOperations2(context2, channel, kafkaContext) : await generateForChannels2(context2, channel, kafkaContext); + addRendersToExternal2( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal2(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["kafka"].push(...renders.map((value2) => value2.code)); + externalProtocolFunctionInformation["kafka"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +async function generateForOperations2(context2, channel, kafkaContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + const payloadId = findOperationId(operation, channel); + const payload = payloads.operationModels[payloadId]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: payloadId, + protocol: "Kafka" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for Kafka` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...kafkaContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + renders.push( + ...generateOperationRenders2( + operation, + updatedContext, + updatedFunctionTypeMapping, + generator + ) + ); + } + return renders; +} +function generateOperationRenders2(operation, kafkaContext, functionTypeMapping, generator) { + const renders = []; + const action = operation.action(); + if (shouldRenderFunctionType( + functionTypeMapping, + "kafka_publish" /* KAFKA_PUBLISH */, + action, + generator.asyncapiReverseOperations + )) { + renders.push(renderPublish(kafkaContext)); + } + if (shouldRenderFunctionType( + functionTypeMapping, + "kafka_subscribe" /* KAFKA_SUBSCRIBE */, + action, + generator.asyncapiReverseOperations + )) { + renders.push(renderSubscribe(kafkaContext)); + } + return renders; +} +async function generateForChannels2(context2, channel, kafkaContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? generator.functionTypeMapping?.[channel.id()]; + const payload = payloads.channelModels[channel.id()]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "Kafka" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for Kafka` + ); + } + const updatedContext = { ...kafkaContext, messageType, messageModule }; + const renderChecks = [ + { + check: "kafka_publish" /* KAFKA_PUBLISH */, + render: renderPublish, + action: "send" + }, + { + check: "kafka_subscribe" /* KAFKA_SUBSCRIBE */, + render: renderSubscribe, + action: "receive" + } + ]; + for (const { check, render, action } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render(updatedContext)); + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/mqtt/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/mqtt/publish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderPublish2({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `publishTo${subName}`, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headersHandling = channelHeaders ? `// Set up user properties (headers) if provided + let publishOptions: Mqtt.IClientPublishOptions = {}; + if (headers) { + const headerData = headers.marshal(); + const parsedHeaders = typeof headerData === 'string' ? JSON.parse(headerData) : headerData; + const userProperties: Record = {}; + for (const [key, value] of Object.entries(parsedHeaders)) { + if (value !== undefined) { + userProperties[key] = String(value); + } + } + publishOptions.properties = { userProperties }; + }` : `let publishOptions: Mqtt.IClientPublishOptions = {};`; + const publishOperation = messageType === "null" ? `${headersHandling} + mqtt.publish(${addressToUse}, '', publishOptions);` : `let dataToSend: any = ${messageMarshalling}; + ${headersHandling} + mqtt.publish(${addressToUse}, dataToSend, publishOptions);`; + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers`, + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the message as MQTT user properties" + } + ] : [], + { + parameter: "mqtt", + parameterType: "mqtt: Mqtt.MqttClient", + jsDoc: " * @param mqtt the MQTT client to publish from" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `MQTT publish operation for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${publishOperation} + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Mqtt from 'mqtt';`], + functionType: "mqtt_publish" /* MQTT_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/mqtt/subscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderSubscribe2({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `subscribeTo${subName}`, + payloadGenerator, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + const PARSE_MESSAGE_ERROR = "Failed to parse message: ${err.message}"; + const PARSE_HEADERS_ERROR = "Failed to parse headers: ${headerError}"; + const PARAMETERS_PARAM = ", parameters"; + const HEADERS_UNDEFINED_PARAM = ", headers: undefined"; + const HEADERS_EXTRACTED_PARAM = ", headers: extractedHeaders"; + const getValidationFailCallback = () => { + const baseError = `new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`)`; + const baseParams = `err: ${baseError}, msg: undefined`; + if (channelParameters4 && channelHeaders) { + return `onDataCallback({${baseParams}${PARAMETERS_PARAM}${HEADERS_EXTRACTED_PARAM}, mqttMsg: packet}); return;`; + } + if (channelParameters4) { + return `onDataCallback({${baseParams}${PARAMETERS_PARAM}, mqttMsg: packet}); return;`; + } + if (channelHeaders) { + return `onDataCallback({${baseParams}${HEADERS_EXTRACTED_PARAM}, mqttMsg: packet}); return;`; + } + return `onDataCallback({${baseParams}, mqttMsg: packet}); return;`; + }; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: getValidationFailCallback() + }); + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be set" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters?: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that was received with the message as MQTT user properties" + } + ] : [], + { + parameter: `mqttMsg?: Mqtt.IPublishPacket`, + jsDoc: " * @param mqttMsg the raw MQTT message packet" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (params: {${callbackFunctionParameters.map((param) => param.parameter).join(", ")}}) => void`, + jsDoc: ` * @param onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "mqtt", + parameterType: "mqtt: Mqtt.MqttClient", + jsDoc: " * @param mqtt the MQTT client to subscribe with" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const topicRegex = findRegexFromChannel(topic); + const whenReceivingMessage = ` + // Check if the received topic matches this subscription's pattern + const topicPattern = ${topicRegex}; + if (!topicPattern.test(topic)) { + return; // Ignore messages not matching this subscription's topic pattern + } + + const receivedData = message.toString(); + ${channelParameters4 ? `const parameters = ${channelParameters4.type}.createFromChannel(topic, '${topic}', ${topicRegex});` : ""} + ${channelHeaders ? ` + // Extract headers from MQTT v5 user properties + let extractedHeaders: ${channelHeaders.type} | undefined; + if (packet.properties && packet.properties.userProperties) { + try { + extractedHeaders = ${channelHeaders.type}.unmarshal(packet.properties.userProperties); + } catch (headerError) { + onDataCallback({err: new Error(\`${PARSE_HEADERS_ERROR}\`), msg: undefined${channelParameters4 ? PARAMETERS_PARAM : ""}${channelHeaders ? HEADERS_UNDEFINED_PARAM : ""}, mqttMsg: packet}); + return; + } + }` : ""} + + try { + const parsedMessage = ${messageUnmarshalling}; + ${potentialValidationFunction} + onDataCallback({err: undefined, msg: parsedMessage${channelParameters4 ? PARAMETERS_PARAM : ""}${channelHeaders ? HEADERS_EXTRACTED_PARAM : ""}, mqttMsg: packet}); + } catch (err: any) { + onDataCallback({err: new Error(\`${PARSE_MESSAGE_ERROR}\`), msg: undefined${channelParameters4 ? PARAMETERS_PARAM : ""}${channelHeaders ? HEADERS_EXTRACTED_PARAM : ""}, mqttMsg: packet}); + }`; + const callbackJsDocParameters = callbackFunctionParameters.map((param) => param.jsDoc).join("\n"); + const mainJsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `MQTT subscription for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `/** + * Callback for when receiving messages + * + * @callback ${functionName}Callback +${callbackJsDocParameters} + */ + +${mainJsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${potentialValidatorCreation} + + // Set up message listener + const messageHandler = (topic: string, message: Buffer, packet: Mqtt.IPublishPacket) => { + ${whenReceivingMessage} + }; + + mqtt.on('message', messageHandler); + + // Subscribe to the topic + await mqtt.subscribeAsync(${addressToUse}); + + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Mqtt from 'mqtt';`], + functionType: "mqtt_subscribe" /* MQTT_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/mqtt/index.ts +async function generateMqttChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { generator, parameter, topic } = context2; + const ignoreOperation = !generator.asyncapiGenerateForOperations; + const mqttContext = { + channelParameters: parameter, + channelHeaders: context2.headers, + // MQTT v5 supports user properties as headers + topic, + subName: context2.subName, + messageType: "", + payloadGenerator: context2.payloads + }; + let renders = []; + const operations = channel.operations().all(); + if (operations.length > 0 && !ignoreOperation) { + renders = generateForOperations3(context2, channel, mqttContext); + } else { + renders = generateForChannels3(context2, channel, mqttContext); + } + addRendersToExternal3( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal3(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["mqtt"].push(...renders.map((value2) => value2.code)); + externalProtocolFunctionInformation["mqtt"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +function generateForOperations3(context2, channel, mqttContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + const payloadId = findOperationId(operation, channel); + const payload = payloads.operationModels[payloadId]; + if (payload === void 0) { + throw createMissingPayloadError({ + channelOrOperation: payloadId, + protocol: "MQTT" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for ${payloadId} for mqtt channel typescript generator` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...mqttContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + const action = operation.action(); + if (shouldRenderFunctionType( + updatedFunctionTypeMapping, + "mqtt_publish" /* MQTT_PUBLISH */, + action, + generator.asyncapiReverseOperations + )) { + renders.push(renderPublish2(updatedContext)); + } + if (shouldRenderFunctionType( + updatedFunctionTypeMapping, + "mqtt_subscribe" /* MQTT_SUBSCRIBE */, + action, + generator.asyncapiReverseOperations + )) { + renders.push(renderSubscribe2(updatedContext)); + } + } + return renders; +} +function generateForChannels3(context2, channel, mqttContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? functionTypeMapping; + const payload = payloads.channelModels[channel.id()]; + if (payload === void 0) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "MQTT" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for ${channel.id()} for mqtt channel typescript generator` + ); + } + const updatedContext = { ...mqttContext, messageType, messageModule }; + if (shouldRenderFunctionType( + updatedFunctionTypeMapping, + "mqtt_publish" /* MQTT_PUBLISH */, + "send", + generator.asyncapiReverseOperations + )) { + renders.push(renderPublish2(updatedContext)); + } + if (shouldRenderFunctionType( + updatedFunctionTypeMapping, + "mqtt_subscribe" /* MQTT_SUBSCRIBE */, + "receive", + generator.asyncapiReverseOperations + )) { + renders.push(renderSubscribe2(updatedContext)); + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/amqp/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/amqp/publishExchange.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderPublishExchange({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `publishTo${subName}Exchange`, + additionalProperties, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headersHandling = channelHeaders ? `// Set up message properties (headers) if provided +let publishOptions = { ...options }; +if (headers) { + const headerData = headers.marshal(); + const parsedHeaders = typeof headerData === 'string' ? JSON.parse(headerData) : headerData; + publishOptions.headers = {}; + for (const [key, value] of Object.entries(parsedHeaders)) { + if (value !== undefined) { + publishOptions.headers[key] = value; + } + } +}` : `let publishOptions = { ...options };`; + const publishOperation = `let dataToSend: any = ${messageType === "null" ? "null" : messageMarshalling}; +const channel = await amqp.createChannel(); +const routingKey = ${addressToUse}; +${headersHandling} +channel.publish(exchange, routingKey, Buffer.from(dataToSend), publishOptions);`; + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers`, + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the message" + } + ] : [], + { + parameter: "amqp", + parameterType: "amqp: Amqp.Connection", + jsDoc: " * @param amqp the AMQP connection to send over" + }, + { + parameter: `options`, + parameterType: `options?: {exchange: string | undefined} & Amqp.Options.Publish`, + jsDoc: " * @param options for the AMQP publish exchange operation" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `AMQP publish operation for exchange \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + const exchange = options?.exchange ?? '${additionalProperties?.exchange}'; + if(!exchange) { + return reject('No exchange value found, please provide one') + } + try { + ${publishOperation} + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Amqp from 'amqplib';`], + functionType: "amqp_exchange_publish" /* AMQP_EXCHANGE_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/amqp/publishQueue.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderPublishQueue({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `publishTo${subName}Queue`, + description: description7, + deprecated +}) { + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const headersHandling = channelHeaders ? `// Set up message properties (headers) if provided +let publishOptions = { ...options }; +if (headers) { + const headerData = headers.marshal(); + const parsedHeaders = typeof headerData === 'string' ? JSON.parse(headerData) : headerData; + publishOptions.headers = {}; + for (const [key, value] of Object.entries(parsedHeaders)) { + if (value !== undefined) { + publishOptions.headers[key] = value; + } + } +}` : `let publishOptions = { ...options };`; + const publishOperation = `let dataToSend: any = ${messageType === "null" ? "null" : messageMarshalling}; +const channel = await amqp.createChannel(); +const queue = ${addressToUse}; +${headersHandling} +channel.sendToQueue(queue, Buffer.from(dataToSend), publishOptions);`; + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers`, + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the message" + } + ] : [], + { + parameter: "amqp", + parameterType: "amqp: Amqp.Connection", + jsDoc: " * @param amqp the AMQP connection to send over" + }, + { + parameter: `options`, + parameterType: `options?: Amqp.Options.Publish`, + jsDoc: " * @param options for the AMQP publish queue operation" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `AMQP publish operation for queue \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${publishOperation} + resolve(); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Amqp from 'amqplib';`], + functionType: "amqp_queue_publish" /* AMQP_QUEUE_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/amqp/subscribeQueue.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderSubscribeQueue({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `subscribeTo${subName}Queue`, + payloadGenerator, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + const messageUnmarshalling = `${messageModule ?? messageType}.unmarshal(receivedData)`; + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: `onDataCallback({err: new Error(\`Invalid message payload received \${JSON.stringify({cause: errors})}\`), msg: undefined${channelHeaders ? ", headers: extractedHeaders" : ""}, amqpMsg: msg}); return;` + }); + const subscribeOperation = `const channel = await amqp.createChannel(); +const queue = ${addressToUse}; +await channel.assertQueue(queue, { durable: true }); +${potentialValidatorCreation} +channel.consume(queue, (msg) => { + if (msg !== null) { + const receivedData = msg.content.toString() + ${channelHeaders ? `// Extract headers if present + let extractedHeaders: ${channelHeaders.type} | undefined = undefined; + if (msg.properties && msg.properties.headers) { + const headerObj: Record = {}; + for (const [key, value] of Object.entries(msg.properties.headers)) { + if (value !== undefined) { + headerObj[key] = value; + } + } + extractedHeaders = ${channelHeaders.type}.unmarshal(headerObj); + }` : ""} + ${potentialValidationFunction} + const message = ${messageUnmarshalling}; + onDataCallback({err: undefined, msg: message${channelHeaders ? ", headers: extractedHeaders" : ""}, amqpMsg: msg}); + } +}, options);`; + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelHeaders ? [ + { + parameter: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers that was received with the message" + } + ] : [], + { + parameter: `amqpMsg?: Amqp.ConsumeMessage`, + jsDoc: " * @param amqpMsg" + } + ]; + const callbackObjectType = `{${callbackFunctionParameters.map((param) => param.parameter).join(", ")}}`; + const callbackParameterNames = callbackFunctionParameters.map((param) => param.parameter.split("?")[0]).join(", "); + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (params: ${callbackObjectType}) => void`, + jsDoc: ` * @param {${functionName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "amqp", + parameterType: "amqp: Amqp.Connection", + jsDoc: " * @param amqp the AMQP connection to receive from" + }, + { + parameter: `options`, + parameterType: `options?: Amqp.Options.Consume`, + jsDoc: " * @param options for the AMQP subscribe queue operation" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `AMQP subscribe operation for queue \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): Promise { + return new Promise(async (resolve, reject) => { + try { + ${subscribeOperation} + resolve(channel); + } catch (e: any) { + reject(e); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as Amqp from 'amqplib';`], + functionType: "amqp_queue_subscribe" /* AMQP_QUEUE_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/amqp/index.ts +async function generateAmqpChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { parameter, topic } = context2; + const ignoreOperation = !context2.generator.asyncapiGenerateForOperations; + const amqpContext = { + channelParameters: parameter, + channelHeaders: context2.headers, + // AMQP supports message properties as headers + topic, + messageType: "", + subName: context2.subName, + payloadGenerator: context2.payloads + }; + const operations = channel.operations().all(); + const renders = operations.length > 0 && !ignoreOperation ? await generateForOperations4(context2, channel, amqpContext) : await generateForChannels4(context2, channel, amqpContext); + addRendersToExternal4( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal4(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["amqp"].push(...renders.map((value2) => value2.code)); + externalProtocolFunctionInformation["amqp"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +async function generateForOperations4(context2, channel, amqpContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + const exchangeName = channel.bindings().get("amqp")?.value()?.exchange?.name; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + const payloadId = findOperationId(operation, channel); + const payload = payloads.operationModels[payloadId]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: payloadId, + protocol: "AMQP" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for AMQP` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...amqpContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + renders.push( + ...generateOperationRenders3( + operation, + updatedContext, + updatedFunctionTypeMapping, + generator, + exchangeName + ) + ); + } + return renders; +} +function generateOperationRenders3(operation, amqpContext, functionTypeMapping, generator, exchangeName) { + const renders = []; + const action = operation.action(); + const renderChecks = [ + { + check: "amqp_exchange_publish" /* AMQP_EXCHANGE_PUBLISH */, + render: renderPublishExchange, + additionalProperties: { exchange: exchangeName } + }, + { + check: "amqp_queue_publish" /* AMQP_QUEUE_PUBLISH */, + render: renderPublishQueue + }, + { + check: "amqp_queue_subscribe" /* AMQP_QUEUE_SUBSCRIBE */, + render: renderSubscribeQueue + } + ]; + for (const { check, render, additionalProperties } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render({ ...amqpContext, additionalProperties })); + } + } + return renders; +} +async function generateForChannels4(context2, channel, amqpContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? generator.functionTypeMapping?.[channel.id()]; + const exchangeName = channel.bindings().get("amqp")?.value()?.exchange?.name; + const payload = payloads.channelModels[channel.id()]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "AMQP" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for AMQP` + ); + } + const updatedContext = { ...amqpContext, messageType, messageModule }; + const renderChecks = [ + { + check: "amqp_exchange_publish" /* AMQP_EXCHANGE_PUBLISH */, + render: renderPublishExchange, + action: "send", + additionalProperties: { exchange: exchangeName } + }, + { + check: "amqp_queue_publish" /* AMQP_QUEUE_PUBLISH */, + render: renderPublishQueue, + action: "send" + }, + { + check: "amqp_queue_subscribe" /* AMQP_QUEUE_SUBSCRIBE */, + render: renderSubscribeQueue, + action: "receive" + } + ]; + for (const { check, render, action, additionalProperties } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render({ ...updatedContext, additionalProperties })); + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/eventsource/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/eventsource/express.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderExpress({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `register${subName}`, + description: description7, + deprecated +}) { + let addressToUse = topic.replace(/{([^}]+)}/g, ":$1"); + addressToUse = addressToUse.startsWith("/") ? addressToUse : `/${addressToUse}`; + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const callbackFunctionParameters = [ + { + parameter: "req: Request", + jsDoc: " * @param req from the request" + }, + { + parameter: "res: Response", + jsDoc: " * @param res from the request" + }, + { + parameter: "next: NextFunction", + jsDoc: " * @param next attached to the request" + }, + ...channelParameters4 ? [ + { + parameter: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters that was received when client made the connection" + } + ] : [], + { + parameter: `sendEvent: (message: ${messageType}) => void`, + jsDoc: " * @param sendEvent callback you can use to send message to the client" + } + ]; + const functionParameters = [ + { + parameter: "router", + parameterType: "router: Router", + jsDoc: " * @param router to attach the event source to" + }, + { + parameter: `callback`, + parameterType: `callback: ((${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void) | ((${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => Promise)`, + jsDoc: " * @param callback to call when receiving events" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `Register EventSource endpoint for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): void { + const event = '${addressToUse}'; + router.get(event, async (req, res, next) => { + ${channelParameters4 ? `const listenParameters = ${channelParameters4.type}.createFromChannel(req.originalUrl.startsWith('/') ? req.originalUrl.slice(1) : req.originalUrl, '${topic}', ${findRegexFromChannel(topic)});` : ""} + res.writeHead(200, { + 'Cache-Control': 'no-cache, no-transform', + 'Content-Type': 'text/event-stream', + Connection: 'keep-alive', + 'Access-Control-Allow-Origin': '*', + }) + const sendEventCallback = (message: ${messageType}) => { + if (res.closed) { + return + } + res.write(\`event: \${event}\\n\`) + res.write(\`data: \${${messageMarshalling}}\\n\\n\`) + } + await callback(req, res, next, ${channelParameters4 ? "listenParameters, " : " "}sendEventCallback) + }) +} +`; + return { + messageType, + code, + functionName, + dependencies: [ + `import { NextFunction, Request, Response, Router } from 'express';` + ], + functionType: "event_source_express" /* EVENT_SOURCE_EXPRESS */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/eventsource/fetch.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderFetch({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + channelHeaders, + subName = pascalCase2(topic), + functionName = `listenFor${subName}`, + additionalProperties = { + fetchDependency: defaultTypeScriptChannelsGenerator.eventSourceDependency + }, + payloadGenerator, + description: description7, + deprecated +}) { + const includeValidation = payloadGenerator.generator.includeValidation; + const addressToUse = channelParameters4 ? `parameters.getChannelWithParameters('${topic}')` : `'${topic}'`; + const messageUnmarshalling = `${messageModule ?? messageType}.unmarshal(receivedData)`; + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const { potentialValidatorCreation, potentialValidationFunction } = getValidationFunctions({ + includeValidation, + messageModule, + messageType, + onValidationFail: `return callback({error: new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), messageEvent: undefined});` + }); + const functionParameters = [ + { + parameter: `callback`, + parameterType: `callback: (params: {error?: Error, messageEvent?: ${messageType}}) => void`, + jsDoc: " * @param callback to call when receiving events" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for listening" + } + ] : [], + ...channelHeaders ? [ + { + parameter: `headers`, + parameterType: `headers?: ${channelHeaders.type}`, + jsDoc: " * @param headers optional headers to include with the EventSource connection" + } + ] : [], + { + parameter: "options", + parameterType: `options: {authorization?: string, onClose?: (err?: string) => void, baseUrl: string, headers?: Record}`, + jsDoc: " * @param options additionally used to handle the event source" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `Event source fetch for \`${topic}\``, + parameters: [ + ...functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })), + { + jsDoc: " * @returns A cleanup function to abort the connection" + } + ] + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} +}): (() => void) { + const controller = new AbortController(); + let eventsUrl: string = ${addressToUse}; + const url = \`\${options.baseUrl}/\${eventsUrl}\` + const requestHeaders: Record = { + ...options.headers ?? {}, + Accept: 'text/event-stream' + } + if(options.authorization) { + requestHeaders['authorization'] = \`Bearer \${options?.authorization}\`; + } + ${channelHeaders ? `// Add headers from AsyncAPI specification if provided + if (headers) { + const asyncApiHeaderData = headers.marshal(); + const parsedAsyncApiHeaders = typeof asyncApiHeaderData === 'string' ? JSON.parse(asyncApiHeaderData) : asyncApiHeaderData; + for (const [key, value] of Object.entries(parsedAsyncApiHeaders)) { + if (value !== undefined) { + requestHeaders[key] = String(value); + } + } + }` : ""} + ${potentialValidatorCreation} + fetchEventSource(\`\${url}\`, { + method: 'GET', + headers: requestHeaders, + signal: controller.signal, + onmessage: (ev: EventSourceMessage) => { + const receivedData = ev.data; + ${potentialValidationFunction} + const callbackData = ${messageUnmarshalling}; + callback({error: undefined, messageEvent: callbackData}); + }, + onerror: (err) => { + options.onClose?.(err); + }, + onclose: () => { + options.onClose?.(); + }, + async onopen(response: { ok: any; headers: any; status: number }) { + if (response.ok && response.headers.get('content-type') === EventStreamContentType) { + return // everything's good + } else if (response.status >= 400 && response.status < 500 && response.status !== 429) { + // client-side errors are usually non-retriable: + callback({error: new Error('Client side error, could not open event connection'), messageEvent: undefined}) + } else { + callback({error: new Error('Unknown error, could not open event connection'), messageEvent: undefined}); + } + }, + }); + + return () => { + controller.abort(); + }; +} +`; + return { + messageType, + code, + functionName, + dependencies: [ + `import { fetchEventSource, EventStreamContentType, EventSourceMessage } from '${additionalProperties.fetchDependency}';` + ], + functionType: "event_source_fetch" /* EVENT_SOURCE_FETCH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/eventsource/index.ts +async function generateEventSourceChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { parameter, topic } = context2; + const ignoreOperation = !context2.generator.asyncapiGenerateForOperations; + const eventSourceContext = { + channelParameters: parameter, + channelHeaders: context2.headers, + // EventSource supports custom headers + topic, + messageType: "", + subName: context2.subName, + payloadGenerator: context2.payloads + }; + const operations = channel.operations().all(); + const renders = operations.length > 0 && !ignoreOperation ? await generateForOperations5(context2, channel, eventSourceContext) : await generateForChannels5(context2, channel, eventSourceContext); + addRendersToExternal5( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal5(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["event_source"].push( + ...renders.map((value2) => value2.code) + ); + externalProtocolFunctionInformation["event_source"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +async function generateForOperations5(context2, channel, eventSourceContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + const payloadId = findOperationId(operation, channel); + const payload = payloads.operationModels[payloadId]; + if (!payload) { + throw new Error( + `Could not find payload for operation in channel typescript generator for EventSource` + ); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for EventSource` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...eventSourceContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + renders.push( + ...generateOperationRenders4( + operation, + updatedContext, + updatedFunctionTypeMapping, + generator + ) + ); + } + return renders; +} +function generateOperationRenders4(operation, eventSourceContext, functionTypeMapping, generator) { + const renders = []; + const action = operation.action(); + if (shouldRenderFunctionType( + functionTypeMapping, + "event_source_fetch" /* EVENT_SOURCE_FETCH */, + action, + generator.asyncapiReverseOperations + )) { + renders.push( + renderFetch({ + ...eventSourceContext, + additionalProperties: { + fetchDependency: generator.eventSourceDependency + } + }) + ); + } + if (shouldRenderFunctionType( + functionTypeMapping, + "event_source_express" /* EVENT_SOURCE_EXPRESS */, + action, + generator.asyncapiReverseOperations + )) { + renders.push(renderExpress(eventSourceContext)); + } + return renders; +} +async function generateForChannels5(context2, channel, eventSourceContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? generator.functionTypeMapping?.[channel.id()]; + const payload = payloads.channelModels[channel.id()]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "EventSource" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for EventSource` + ); + } + const updatedContext = { ...eventSourceContext, messageType, messageModule }; + const renderChecks = [ + { + check: "event_source_fetch" /* EVENT_SOURCE_FETCH */, + render: renderFetch, + action: "receive" + }, + { + check: "event_source_express" /* EVENT_SOURCE_EXPRESS */, + render: renderExpress, + action: "send" + } + ]; + for (const { check, render, action } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push( + render({ + ...updatedContext, + additionalProperties: check === "event_source_fetch" /* EVENT_SOURCE_FETCH */ ? { fetchDependency: generator.eventSourceDependency } : void 0 + }) + ); + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/http/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/http/common-types.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/http/security.ts +init_dirname(); +init_buffer2(); +init_process2(); +function escapeStringForCodeGen(value2) { + if (!value2) { + return ""; + } + return value2.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/'/g, "\\'").replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/\*\//g, "*\\/"); +} +function analyzeSecuritySchemes(schemes) { + if (!schemes || schemes.length === 0) { + return { + bearer: true, + basic: true, + apiKey: true, + oauth2: true, + apiKeySchemes: [], + oauth2Schemes: [] + }; + } + const requirements = { + bearer: false, + basic: false, + apiKey: false, + oauth2: false, + apiKeySchemes: [], + oauth2Schemes: [] + }; + for (const scheme of schemes) { + switch (scheme.type) { + case "apiKey": + requirements.apiKey = true; + requirements.apiKeySchemes.push(scheme); + break; + case "http": + if (scheme.httpScheme === "bearer") { + requirements.bearer = true; + } else if (scheme.httpScheme === "basic") { + requirements.basic = true; + } + break; + case "oauth2": + case "openIdConnect": + requirements.oauth2 = true; + requirements.oauth2Schemes.push(scheme); + break; + } + } + return requirements; +} +function renderBearerAuthInterface() { + return `/** + * Bearer token authentication configuration + */ +export interface BearerAuth { + type: 'bearer'; + token: string; +}`; +} +function renderBasicAuthInterface() { + return `/** + * Basic authentication configuration (username/password) + */ +export interface BasicAuth { + type: 'basic'; + username: string; + password: string; +}`; +} +function getApiKeyDefaults(apiKeySchemes) { + if (apiKeySchemes.length === 1) { + return { + name: apiKeySchemes[0].apiKeyName || "X-API-Key", + in: apiKeySchemes[0].apiKeyIn || "header" + }; + } + return { + name: "X-API-Key", + in: "header" + }; +} +function renderApiKeyAuthInterface(apiKeySchemes) { + const defaults2 = getApiKeyDefaults(apiKeySchemes); + const inType = apiKeySchemes.some((s7) => s7.apiKeyIn === "cookie") ? "'header' | 'query' | 'cookie'" : "'header' | 'query'"; + const escapedDefaultName = escapeStringForCodeGen(defaults2.name); + const escapedDefaultIn = escapeStringForCodeGen(defaults2.in); + return `/** + * API key authentication configuration + */ +export interface ApiKeyAuth { + type: 'apiKey'; + key: string; + name?: string; // Name of the API key parameter (default: '${escapedDefaultName}') + in?: ${inType}; // Where to place the API key (default: '${escapedDefaultIn}') +}`; +} +function extractTokenUrl(flows) { + return flows.clientCredentials?.tokenUrl || flows.password?.tokenUrl || flows.authorizationCode?.tokenUrl; +} +function extractAuthorizationUrl(flows) { + return flows.implicit?.authorizationUrl || flows.authorizationCode?.authorizationUrl; +} +function collectScopes(flows) { + const allScopes = /* @__PURE__ */ new Set(); + const flowTypes = [ + flows.implicit, + flows.password, + flows.clientCredentials, + flows.authorizationCode + ]; + for (const flow2 of flowTypes) { + if (flow2?.scopes) { + Object.keys(flow2.scopes).forEach((s7) => allScopes.add(s7)); + } + } + return allScopes; +} +function formatScopesComment(scopes) { + if (scopes.size === 0) { + return ""; + } + const scopeList = Array.from(scopes).slice(0, 3).map((scope) => escapeStringForCodeGen(scope)).join(", "); + const suffix = scopes.size > 3 ? "..." : ""; + return ` Available: ${scopeList}${suffix}`; +} +function extractSchemeComments(scheme, existing) { + if (scheme.openIdConnectUrl) { + return { + ...existing, + tokenUrlComment: `OpenID Connect URL: '${escapeStringForCodeGen(scheme.openIdConnectUrl)}'` + }; + } + if (!scheme.oauth2Flows) { + return existing; + } + const tokenUrl = extractTokenUrl(scheme.oauth2Flows); + const authUrl = extractAuthorizationUrl(scheme.oauth2Flows); + const allScopes = collectScopes(scheme.oauth2Flows); + return { + tokenUrlComment: tokenUrl ? `default: '${escapeStringForCodeGen(tokenUrl)}'` : existing.tokenUrlComment, + authorizationUrlComment: authUrl ? ` Authorization URL: '${escapeStringForCodeGen(authUrl)}'` : existing.authorizationUrlComment, + scopesComment: formatScopesComment(allScopes) || existing.scopesComment + }; +} +function extractOAuth2DocComments(oauth2Schemes) { + const initial2 = { + tokenUrlComment: "required for client_credentials/password flows and token refresh", + authorizationUrlComment: "", + scopesComment: "" + }; + return oauth2Schemes.reduce( + (acc, scheme) => extractSchemeComments(scheme, acc), + initial2 + ); +} +function renderOAuth2AuthInterface(oauth2Schemes) { + const { tokenUrlComment, authorizationUrlComment, scopesComment } = extractOAuth2DocComments(oauth2Schemes); + const flowsInfo = authorizationUrlComment ? ` + *${authorizationUrlComment}` : ""; + return `/** + * OAuth2 authentication configuration + * + * Supports server-side flows only: + * - client_credentials: Server-to-server authentication + * - password: Resource owner password credentials (legacy, not recommended) + * - Pre-obtained accessToken: For tokens obtained via browser-based flows + * + * For browser-based flows (implicit, authorization_code), obtain the token + * separately and pass it as accessToken.${flowsInfo} + */ +export interface OAuth2Auth { + type: 'oauth2'; + /** Pre-obtained access token (required if not using a server-side flow) */ + accessToken?: string; + /** Refresh token for automatic token renewal on 401 */ + refreshToken?: string; + /** Token endpoint URL (${tokenUrlComment}) */ + tokenUrl?: string; + /** Client ID (required for flows and token refresh) */ + clientId?: string; + /** Client secret (optional, depends on OAuth provider) */ + clientSecret?: string; + /** Requested scopes${scopesComment} */ + scopes?: string[]; + /** Server-side flow type */ + flow?: 'password' | 'client_credentials'; + /** Username for password flow */ + username?: string; + /** Password for password flow */ + password?: string; + /** Callback when tokens are refreshed (for caching/persistence) */ + onTokenRefresh?: (newTokens: TokenResponse) => void; +}`; +} +function renderAuthConfigType(requirements) { + const types3 = []; + if (requirements.bearer) { + types3.push("BearerAuth"); + } + if (requirements.basic) { + types3.push("BasicAuth"); + } + if (requirements.apiKey) { + types3.push("ApiKeyAuth"); + } + if (requirements.oauth2) { + types3.push("OAuth2Auth"); + } + if (types3.length === 0) { + return "// No authentication types needed for this API\nexport type AuthConfig = never;"; + } + return `/** + * Union type for all authentication methods - provides autocomplete support + */ +export type AuthConfig = ${types3.join(" | ")};`; +} +function renderSecurityTypes(schemes, requirements) { + const authRequirements = requirements ?? analyzeSecuritySchemes(schemes); + const bearerSection = authRequirements.bearer ? `${renderBearerAuthInterface()} + +` : ""; + const basicSection = authRequirements.basic ? `${renderBasicAuthInterface()} + +` : ""; + const apiKeySection = authRequirements.apiKey ? `${renderApiKeyAuthInterface(authRequirements.apiKeySchemes)} + +` : ""; + const oauth2Section = authRequirements.oauth2 ? `${renderOAuth2AuthInterface(authRequirements.oauth2Schemes)} + +` : ""; + return `// ============================================================================ +// Security Configuration Types - Grouped for better autocomplete +// ============================================================================ + +${bearerSection}${basicSection}${apiKeySection}${oauth2Section}${renderAuthConfigType(authRequirements)}`; +} +function renderOAuth2Stubs() { + return ` +// OAuth2 helpers not needed for this API - provide type-safe stubs +// These are never called due to AUTH_FEATURES.oauth2 runtime guards +type OAuth2Auth = never; +function validateOAuth2Config(_auth: OAuth2Auth): void {} +async function handleOAuth2TokenFlow( + _auth: OAuth2Auth, + _originalParams: HttpRequestParams, + _makeRequest: (params: HttpRequestParams) => Promise, + _retryConfig?: RetryConfig +): Promise { return null; } +async function handleTokenRefresh( + _auth: OAuth2Auth, + _originalParams: HttpRequestParams, + _makeRequest: (params: HttpRequestParams) => Promise, + _retryConfig?: RetryConfig +): Promise { return null; }`; +} +function renderOAuth2Helpers() { + return ` +/** + * Validate OAuth2 configuration based on flow type + */ +function validateOAuth2Config(auth: OAuth2Auth): void { + // If using a flow, validate required fields + switch (auth.flow) { + case 'client_credentials': + if (!auth.tokenUrl) throw new Error('OAuth2 Client Credentials flow requires tokenUrl'); + if (!auth.clientId) throw new Error('OAuth2 Client Credentials flow requires clientId'); + break; + + case 'password': + if (!auth.tokenUrl) throw new Error('OAuth2 Password flow requires tokenUrl'); + if (!auth.clientId) throw new Error('OAuth2 Password flow requires clientId'); + if (!auth.username) throw new Error('OAuth2 Password flow requires username'); + if (!auth.password) throw new Error('OAuth2 Password flow requires password'); + break; + + default: + // No flow specified - must have accessToken for OAuth2 to work + if (!auth.accessToken && !auth.flow) { + // This is fine - token refresh can still work if refreshToken is provided + // Or the request will just be made without auth + } + break; + } +} + +/** + * Handle OAuth2 token flows (client_credentials, password) + */ +async function handleOAuth2TokenFlow( + auth: OAuth2Auth, + originalParams: HttpRequestParams, + makeRequest: (params: HttpRequestParams) => Promise, + retryConfig?: RetryConfig +): Promise { + if (!auth.flow || !auth.tokenUrl) return null; + + const params = new URLSearchParams(); + + if (auth.flow === 'client_credentials') { + params.append('grant_type', 'client_credentials'); + params.append('client_id', auth.clientId!); + } else if (auth.flow === 'password') { + params.append('grant_type', 'password'); + params.append('username', auth.username || ''); + params.append('password', auth.password || ''); + params.append('client_id', auth.clientId!); + } else { + return null; + } + + if (auth.clientSecret) { + params.append('client_secret', auth.clientSecret); + } + if (auth.scopes && auth.scopes.length > 0) { + params.append('scope', auth.scopes.join(' ')); + } + + const authHeaders: Record = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + // Use basic auth for client credentials if both client ID and secret are provided + if (auth.flow === 'client_credentials' && auth.clientId && auth.clientSecret) { + const credentials = Buffer.from(\`\${auth.clientId}:\${auth.clientSecret}\`).toString('base64'); + authHeaders['Authorization'] = \`Basic \${credentials}\`; + params.delete('client_id'); + params.delete('client_secret'); + } + + const tokenResponse = await NodeFetch.default(auth.tokenUrl, { + method: 'POST', + headers: authHeaders, + body: params.toString() + }); + + if (!tokenResponse.ok) { + throw new Error(\`OAuth2 token request failed: \${tokenResponse.statusText}\`); + } + + const tokenData = await tokenResponse.json(); + const tokens: TokenResponse = { + accessToken: tokenData.access_token, + refreshToken: tokenData.refresh_token, + expiresIn: tokenData.expires_in + }; + + // Notify the client about the tokens + if (auth.onTokenRefresh) { + auth.onTokenRefresh(tokens); + } + + // Retry the original request with the new token + const updatedHeaders = { ...originalParams.headers }; + updatedHeaders['Authorization'] = \`Bearer \${tokens.accessToken}\`; + + return executeWithRetry({ ...originalParams, headers: updatedHeaders }, makeRequest, retryConfig); +} + +/** + * Handle OAuth2 token refresh on 401 response + */ +async function handleTokenRefresh( + auth: OAuth2Auth, + originalParams: HttpRequestParams, + makeRequest: (params: HttpRequestParams) => Promise, + retryConfig?: RetryConfig +): Promise { + if (!auth.refreshToken || !auth.tokenUrl || !auth.clientId) return null; + + const refreshResponse = await NodeFetch.default(auth.tokenUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: new URLSearchParams({ + grant_type: 'refresh_token', + refresh_token: auth.refreshToken, + client_id: auth.clientId, + ...(auth.clientSecret ? { client_secret: auth.clientSecret } : {}) + }).toString() + }); + + if (!refreshResponse.ok) { + throw new Error('Unauthorized'); + } + + const tokenData = await refreshResponse.json(); + const newTokens: TokenResponse = { + accessToken: tokenData.access_token, + refreshToken: tokenData.refresh_token || auth.refreshToken, + expiresIn: tokenData.expires_in + }; + + // Notify the client about the refreshed tokens + if (auth.onTokenRefresh) { + auth.onTokenRefresh(newTokens); + } + + // Retry the original request with the new token + const updatedHeaders = { ...originalParams.headers }; + updatedHeaders['Authorization'] = \`Bearer \${newTokens.accessToken}\`; + + return executeWithRetry({ ...originalParams, headers: updatedHeaders }, makeRequest, retryConfig); +}`; +} + +// src/codegen/generators/typescript/channels/protocols/http/common-types.ts +function renderHttpCommonTypes(securitySchemes) { + const requirements = analyzeSecuritySchemes(securitySchemes); + const securityTypes = renderSecurityTypes(securitySchemes, requirements); + return `// ============================================================================ +// Common Types - Shared across all HTTP client functions +// ============================================================================ + +/** + * Standard HTTP response interface that wraps fetch-like responses + */ +export interface HttpResponse { + ok: boolean; + status: number; + statusText: string; + headers?: Headers | Record; + json: () => Record | Promise>; +} + +/** + * Pagination info extracted from response + */ +export interface PaginationInfo { + /** Total number of items (if available from headers like X-Total-Count) */ + totalCount?: number; + /** Total number of pages (if available) */ + totalPages?: number; + /** Current page/offset */ + currentOffset?: number; + /** Items per page */ + limit?: number; + /** Next cursor (for cursor-based pagination) */ + nextCursor?: string; + /** Previous cursor */ + prevCursor?: string; + /** Whether there are more items */ + hasMore?: boolean; +} + +/** + * Rich response wrapper returned by HTTP client functions + */ +export interface HttpClientResponse { + /** The deserialized response payload */ + data: T; + /** HTTP status code */ + status: number; + /** HTTP status text */ + statusText: string; + /** Response headers */ + headers: Record; + /** Raw JSON response before deserialization */ + rawData: Record; + /** Pagination info extracted from response (if applicable) */ + pagination?: PaginationInfo; + /** Fetch the next page (if pagination is configured and more data exists) */ + getNextPage?: () => Promise>; + /** Fetch the previous page (if pagination is configured) */ + getPrevPage?: () => Promise>; + /** Check if there's a next page */ + hasNextPage?: () => boolean; + /** Check if there's a previous page */ + hasPrevPage?: () => boolean; +} + +/** + * HTTP request parameters passed to the request hook + */ +export interface HttpRequestParams { + url: string; + headers?: Record; + method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; + credentials?: RequestCredentials; + body?: any; +} + +/** + * Token response structure for OAuth2 flows + */ +export interface TokenResponse { + accessToken: string; + refreshToken?: string; + expiresIn?: number; +} + +${securityTypes} + +/** + * Feature flags indicating which auth types are available. + * Used internally to conditionally call auth-specific helpers. + */ +const AUTH_FEATURES = { + oauth2: ${requirements.oauth2} +} as const; + +/** + * Default values for API key authentication derived from the spec. + * These match the defaults documented in the ApiKeyAuth interface. + */ +const API_KEY_DEFAULTS = { + name: '${escapeStringForCodeGen(getApiKeyDefaults(requirements.apiKeySchemes).name)}', + in: '${escapeStringForCodeGen(getApiKeyDefaults(requirements.apiKeySchemes).in)}' as 'header' | 'query' | 'cookie' +} as const; + +// ============================================================================ +// Pagination Types +// ============================================================================ + +/** + * Where to place pagination parameters + */ +export type PaginationLocation = 'query' | 'header'; + +/** + * Offset-based pagination configuration + */ +export interface OffsetPagination { + type: 'offset'; + in?: PaginationLocation; // Where to place params (default: 'query') + offset: number; + limit: number; + offsetParam?: string; // Param name for offset (default: 'offset' for query, 'X-Offset' for header) + limitParam?: string; // Param name for limit (default: 'limit' for query, 'X-Limit' for header) +} + +/** + * Cursor-based pagination configuration + */ +export interface CursorPagination { + type: 'cursor'; + in?: PaginationLocation; // Where to place params (default: 'query') + cursor?: string; + limit?: number; + cursorParam?: string; // Param name for cursor (default: 'cursor' for query, 'X-Cursor' for header) + limitParam?: string; // Param name for limit (default: 'limit' for query, 'X-Limit' for header) +} + +/** + * Page-based pagination configuration + */ +export interface PagePagination { + type: 'page'; + in?: PaginationLocation; // Where to place params (default: 'query') + page: number; + pageSize: number; + pageParam?: string; // Param name for page (default: 'page' for query, 'X-Page' for header) + pageSizeParam?: string; // Param name for page size (default: 'pageSize' for query, 'X-Page-Size' for header) +} + +/** + * Range-based pagination (typically used with headers) + * Follows RFC 7233 style: Range: items=0-24 + */ +export interface RangePagination { + type: 'range'; + in?: 'header'; // Range pagination is typically header-only + start: number; + end: number; + unit?: string; // Range unit (default: 'items') + rangeHeader?: string; // Header name (default: 'Range') +} + +/** + * Union type for all pagination methods + */ +export type PaginationConfig = OffsetPagination | CursorPagination | PagePagination | RangePagination; + +// ============================================================================ +// Retry Configuration +// ============================================================================ + +/** + * Retry policy configuration for failed requests + */ +export interface RetryConfig { + maxRetries?: number; // Maximum number of retry attempts (default: 3) + initialDelayMs?: number; // Initial delay before first retry (default: 1000) + maxDelayMs?: number; // Maximum delay between retries (default: 30000) + backoffMultiplier?: number; // Multiplier for exponential backoff (default: 2) + retryableStatusCodes?: number[]; // Status codes to retry (default: [408, 429, 500, 502, 503, 504]) + retryOnNetworkError?: boolean; // Retry on network errors (default: true) + onRetry?: (attempt: number, delay: number, error: Error) => void; // Callback on each retry +} + +// ============================================================================ +// Hooks Configuration - Extensible callback system +// ============================================================================ + +/** + * Hooks for customizing HTTP client behavior + */ +export interface HttpHooks { + /** + * Called before each request to transform/modify the request parameters + * Return modified params or undefined to use original + */ + beforeRequest?: (params: HttpRequestParams) => HttpRequestParams | Promise; + + /** + * The actual request implementation - allows swapping fetch for axios, etc. + * Default: uses node-fetch + */ + makeRequest?: (params: HttpRequestParams) => Promise; + + /** + * Called after each response for logging, metrics, etc. + * Can transform the response before it's processed + */ + afterResponse?: (response: HttpResponse, params: HttpRequestParams) => HttpResponse | Promise; + + /** + * Called on request error for logging, error transformation, etc. + */ + onError?: (error: Error, params: HttpRequestParams) => Error | Promise; +} + +// ============================================================================ +// Common Request Context +// ============================================================================ + +/** + * Base context shared by all HTTP client functions + */ +export interface HttpClientContext { + server?: string; + path?: string; + + // Authentication - grouped for better autocomplete + auth?: AuthConfig; + + // Pagination configuration + pagination?: PaginationConfig; + + // Retry configuration + retry?: RetryConfig; + + // Hooks for extensibility + hooks?: HttpHooks; + + // Additional options + additionalHeaders?: Record; + + // Query parameters + queryParams?: Record; +} + +// ============================================================================ +// Helper Functions - Shared logic extracted for reuse +// ============================================================================ + +/** + * Default retry configuration + */ +const DEFAULT_RETRY_CONFIG: Required = { + maxRetries: 3, + initialDelayMs: 1000, + maxDelayMs: 30000, + backoffMultiplier: 2, + retryableStatusCodes: [408, 429, 500, 502, 503, 504], + retryOnNetworkError: true, + onRetry: () => {}, +}; + +/** + * Default request hook implementation using node-fetch + */ +const defaultMakeRequest = async (params: HttpRequestParams): Promise => { + return NodeFetch.default(params.url, { + body: params.body, + method: params.method, + headers: params.headers + }) as unknown as HttpResponse; +}; + +/** + * Apply authentication to headers and URL based on auth config + */ +function applyAuth( + auth: AuthConfig | undefined, + headers: Record, + url: string +): { headers: Record; url: string } { + if (!auth) return { headers, url }; + + switch (auth.type) { + case 'bearer': + headers['Authorization'] = \`Bearer \${auth.token}\`; + break; + + case 'basic': { + const credentials = Buffer.from(\`\${auth.username}:\${auth.password}\`).toString('base64'); + headers['Authorization'] = \`Basic \${credentials}\`; + break; + } + + case 'apiKey': { + const keyName = auth.name ?? API_KEY_DEFAULTS.name; + const keyIn = auth.in ?? API_KEY_DEFAULTS.in; + + if (keyIn === 'header') { + headers[keyName] = auth.key; + } else if (keyIn === 'query') { + const separator = url.includes('?') ? '&' : '?'; + url = \`\${url}\${separator}\${keyName}=\${encodeURIComponent(auth.key)}\`; + } else if (keyIn === 'cookie') { + headers['Cookie'] = \`\${keyName}=\${auth.key}\`; + } + break; + } + + case 'oauth2': { + // If we have an access token, use it directly + // Token flows (client_credentials, password) are handled separately + if (auth.accessToken) { + headers['Authorization'] = \`Bearer \${auth.accessToken}\`; + } + break; + } + } + + return { headers, url }; +} + +/** + * Apply pagination parameters to URL and/or headers based on configuration + */ +function applyPagination( + pagination: PaginationConfig | undefined, + url: string, + headers: Record +): { url: string; headers: Record } { + if (!pagination) return { url, headers }; + + const location = pagination.in ?? 'query'; + const isHeader = location === 'header'; + + // Helper to get default param names based on location + const getDefaultName = (queryName: string, headerName: string) => + isHeader ? headerName : queryName; + + const queryParams = new URLSearchParams(); + const headerParams: Record = {}; + + const addParam = (name: string, value: string) => { + if (isHeader) { + headerParams[name] = value; + } else { + queryParams.append(name, value); + } + }; + + switch (pagination.type) { + case 'offset': + addParam( + pagination.offsetParam ?? getDefaultName('offset', 'X-Offset'), + String(pagination.offset) + ); + addParam( + pagination.limitParam ?? getDefaultName('limit', 'X-Limit'), + String(pagination.limit) + ); + break; + + case 'cursor': + if (pagination.cursor) { + addParam( + pagination.cursorParam ?? getDefaultName('cursor', 'X-Cursor'), + pagination.cursor + ); + } + if (pagination.limit !== undefined) { + addParam( + pagination.limitParam ?? getDefaultName('limit', 'X-Limit'), + String(pagination.limit) + ); + } + break; + + case 'page': + addParam( + pagination.pageParam ?? getDefaultName('page', 'X-Page'), + String(pagination.page) + ); + addParam( + pagination.pageSizeParam ?? getDefaultName('pageSize', 'X-Page-Size'), + String(pagination.pageSize) + ); + break; + + case 'range': { + // Range pagination is always header-based (RFC 7233 style) + const unit = pagination.unit ?? 'items'; + const headerName = pagination.rangeHeader ?? 'Range'; + headerParams[headerName] = \`\${unit}=\${pagination.start}-\${pagination.end}\`; + break; + } + } + + // Apply query params to URL + const queryString = queryParams.toString(); + if (queryString) { + const separator = url.includes('?') ? '&' : '?'; + url = \`\${url}\${separator}\${queryString}\`; + } + + // Merge header params + const updatedHeaders = { ...headers, ...headerParams }; + + return { url, headers: updatedHeaders }; +} + +/** + * Apply query parameters to URL + */ +function applyQueryParams(queryParams: Record | undefined, url: string): string { + if (!queryParams) return url; + + const params = new URLSearchParams(); + for (const [key, value] of Object.entries(queryParams)) { + if (value !== undefined) { + params.append(key, String(value)); + } + } + + const paramString = params.toString(); + if (!paramString) return url; + + const separator = url.includes('?') ? '&' : '?'; + return \`\${url}\${separator}\${paramString}\`; +} + +/** + * Sleep for a specified number of milliseconds + */ +function sleep(ms: number): Promise { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +/** + * Calculate delay for exponential backoff + */ +function calculateBackoffDelay( + attempt: number, + config: Required +): number { + const delay = config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt - 1); + return Math.min(delay, config.maxDelayMs); +} + +/** + * Determine if a request should be retried based on error/response + */ +function shouldRetry( + error: Error | null, + response: HttpResponse | null, + config: Required, + attempt: number +): boolean { + if (attempt >= config.maxRetries) return false; + + if (error && config.retryOnNetworkError) return true; + + if (response && config.retryableStatusCodes.includes(response.status)) return true; + + return false; +} + +/** + * Execute request with retry logic + */ +async function executeWithRetry( + params: HttpRequestParams, + makeRequest: (params: HttpRequestParams) => Promise, + retryConfig?: RetryConfig +): Promise { + const config = { ...DEFAULT_RETRY_CONFIG, ...retryConfig }; + let lastError: Error | null = null; + let lastResponse: HttpResponse | null = null; + + for (let attempt = 0; attempt <= config.maxRetries; attempt++) { + try { + if (attempt > 0) { + const delay = calculateBackoffDelay(attempt, config); + config.onRetry(attempt, delay, lastError ?? new Error('Retry attempt')); + await sleep(delay); + } + + const response = await makeRequest(params); + + // Check if we should retry this response + if (!shouldRetry(null, response, config, attempt + 1)) { + return response; + } + + lastResponse = response; + lastError = new Error(\`HTTP Error: \${response.status} \${response.statusText}\`); + } catch (error) { + lastError = error instanceof Error ? error : new Error(String(error)); + + if (!shouldRetry(lastError, null, config, attempt + 1)) { + throw lastError; + } + } + } + + // All retries exhausted + if (lastResponse) { + return lastResponse; + } + throw lastError ?? new Error('Request failed after retries'); +} + +/** + * Handle HTTP error status codes with standardized messages + */ +function handleHttpError(status: number, statusText: string): never { + switch (status) { + case 401: + throw new Error('Unauthorized'); + case 403: + throw new Error('Forbidden'); + case 404: + throw new Error('Not Found'); + case 500: + throw new Error('Internal Server Error'); + default: + throw new Error(\`HTTP Error: \${status} \${statusText}\`); + } +} + +/** + * Extract headers from response into a plain object + */ +function extractHeaders(response: HttpResponse): Record { + const headers: Record = {}; + + if (response.headers) { + if (typeof (response.headers as any).forEach === 'function') { + // Headers object (fetch API) + (response.headers as Headers).forEach((value, key) => { + headers[key.toLowerCase()] = value; + }); + } else { + // Plain object + for (const [key, value] of Object.entries(response.headers)) { + headers[key.toLowerCase()] = value; + } + } + } + + return headers; +} + +/** + * Extract pagination info from response headers + */ +function extractPaginationInfo( + headers: Record, + currentPagination?: PaginationConfig +): PaginationInfo | undefined { + const info: PaginationInfo = {}; + let hasPaginationInfo = false; + + // Common total count headers + const totalCount = headers['x-total-count'] || headers['x-total'] || headers['total-count']; + if (totalCount) { + info.totalCount = parseInt(totalCount, 10); + hasPaginationInfo = true; + } + + // Total pages + const totalPages = headers['x-total-pages'] || headers['x-page-count']; + if (totalPages) { + info.totalPages = parseInt(totalPages, 10); + hasPaginationInfo = true; + } + + // Next cursor + const nextCursor = headers['x-next-cursor'] || headers['x-cursor-next']; + if (nextCursor) { + info.nextCursor = nextCursor; + info.hasMore = true; + hasPaginationInfo = true; + } + + // Previous cursor + const prevCursor = headers['x-prev-cursor'] || headers['x-cursor-prev']; + if (prevCursor) { + info.prevCursor = prevCursor; + hasPaginationInfo = true; + } + + // Has more indicator + const hasMore = headers['x-has-more'] || headers['x-has-next']; + if (hasMore) { + info.hasMore = hasMore.toLowerCase() === 'true' || hasMore === '1'; + hasPaginationInfo = true; + } + + // Parse Link header (RFC 5988) + const linkHeader = headers['link']; + if (linkHeader) { + const links = parseLinkHeader(linkHeader); + if (links.next) { + info.hasMore = true; + hasPaginationInfo = true; + } + } + + // Include current pagination state + if (currentPagination) { + switch (currentPagination.type) { + case 'offset': + info.currentOffset = currentPagination.offset; + info.limit = currentPagination.limit; + break; + case 'cursor': + info.limit = currentPagination.limit; + break; + case 'page': + info.currentOffset = (currentPagination.page - 1) * currentPagination.pageSize; + info.limit = currentPagination.pageSize; + break; + case 'range': + info.currentOffset = currentPagination.start; + info.limit = currentPagination.end - currentPagination.start + 1; + break; + } + hasPaginationInfo = true; + } + + // Calculate hasMore based on total count + if (info.hasMore === undefined && info.totalCount !== undefined && + info.currentOffset !== undefined && info.limit !== undefined) { + info.hasMore = info.currentOffset + info.limit < info.totalCount; + } + + return hasPaginationInfo ? info : undefined; +} + +/** + * Parse RFC 5988 Link header + */ +function parseLinkHeader(header: string): Record { + const links: Record = {}; + const parts = header.split(','); + + for (const part of parts) { + const match = part.match(/<([^>]+)>;\\s*rel="?([^";\\s]+)"?/); + if (match) { + links[match[2]] = match[1]; + } + } + + return links; +} + +/** + * Create pagination helper functions for the response + */ +function createPaginationHelpers( + currentConfig: TContext, + paginationInfo: PaginationInfo | undefined, + requestFn: (config: TContext) => Promise> +): Pick, 'getNextPage' | 'getPrevPage' | 'hasNextPage' | 'hasPrevPage'> { + const helpers: Pick, 'getNextPage' | 'getPrevPage' | 'hasNextPage' | 'hasPrevPage'> = {}; + + if (!currentConfig.pagination) { + return helpers; + } + + const pagination = currentConfig.pagination; + + helpers.hasNextPage = () => { + if (paginationInfo?.hasMore !== undefined) return paginationInfo.hasMore; + if (paginationInfo?.nextCursor) return true; + if (paginationInfo?.totalCount !== undefined && + paginationInfo.currentOffset !== undefined && + paginationInfo.limit !== undefined) { + return paginationInfo.currentOffset + paginationInfo.limit < paginationInfo.totalCount; + } + return false; + }; + + helpers.hasPrevPage = () => { + if (paginationInfo?.prevCursor) return true; + if (paginationInfo?.currentOffset !== undefined) { + return paginationInfo.currentOffset > 0; + } + return false; + }; + + helpers.getNextPage = async () => { + let nextPagination: PaginationConfig; + + switch (pagination.type) { + case 'offset': + nextPagination = { ...pagination, offset: pagination.offset + pagination.limit }; + break; + case 'cursor': + if (!paginationInfo?.nextCursor) throw new Error('No next cursor available'); + nextPagination = { ...pagination, cursor: paginationInfo.nextCursor }; + break; + case 'page': + nextPagination = { ...pagination, page: pagination.page + 1 }; + break; + case 'range': + const rangeSize = pagination.end - pagination.start + 1; + nextPagination = { ...pagination, start: pagination.end + 1, end: pagination.end + rangeSize }; + break; + default: + throw new Error('Unsupported pagination type'); + } + + return requestFn({ ...currentConfig, pagination: nextPagination }); + }; + + helpers.getPrevPage = async () => { + let prevPagination: PaginationConfig; + + switch (pagination.type) { + case 'offset': + prevPagination = { ...pagination, offset: Math.max(0, pagination.offset - pagination.limit) }; + break; + case 'cursor': + if (!paginationInfo?.prevCursor) throw new Error('No previous cursor available'); + prevPagination = { ...pagination, cursor: paginationInfo.prevCursor }; + break; + case 'page': + prevPagination = { ...pagination, page: Math.max(1, pagination.page - 1) }; + break; + case 'range': + const size = pagination.end - pagination.start + 1; + const newStart = Math.max(0, pagination.start - size); + prevPagination = { ...pagination, start: newStart, end: newStart + size - 1 }; + break; + default: + throw new Error('Unsupported pagination type'); + } + + return requestFn({ ...currentConfig, pagination: prevPagination }); + }; + + return helpers; +} + +/** + * Builds a URL with path parameters replaced + * @param server - Base server URL + * @param pathTemplate - Path template with {param} placeholders + * @param parameters - Parameter object with getChannelWithParameters method + */ +function buildUrlWithParameters string }>( + server: string, + pathTemplate: string, + parameters: T +): string { + const path = parameters.getChannelWithParameters(pathTemplate); + return \`\${server}\${path}\`; +} + +/** + * Extracts headers from a typed headers object and merges with additional headers + */ +function applyTypedHeaders( + typedHeaders: { marshal: () => string } | undefined, + additionalHeaders: Record | undefined +): Record { + const headers: Record = { + 'Content-Type': 'application/json', + ...additionalHeaders + }; + + if (typedHeaders) { + // Parse the marshalled headers and merge them + const marshalledHeaders = JSON.parse(typedHeaders.marshal()); + for (const [key, value] of Object.entries(marshalledHeaders)) { + headers[key] = value as string; + } + } + + return headers; +} +${requirements.oauth2 ? renderOAuth2Helpers() : renderOAuth2Stubs()} +// ============================================================================ +// Generated HTTP Client Functions +// ============================================================================`; +} + +// src/codegen/generators/typescript/channels/protocols/http/client.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderHttpFetchClient({ + requestTopic, + requestMessageType, + requestMessageModule, + replyMessageType, + replyMessageModule, + channelParameters: channelParameters4, + method: method2, + servers = [], + subName = pascalCase2(requestTopic), + functionName = `${method2.toLowerCase()}${subName}`, + includesStatusCodes = false, + description: description7, + deprecated +}) { + const messageType = requestMessageModule ? `${requestMessageModule}.${requestMessageType}` : requestMessageType; + const replyType = replyMessageModule ? `${replyMessageModule}.${replyMessageType}` : replyMessageType; + const contextInterfaceName = `${pascalCase2(functionName)}Context`; + const hasParameters = channelParameters4 !== void 0; + const contextInterface = generateContextInterface( + contextInterfaceName, + messageType, + hasParameters, + method2 + ); + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `HTTP ${method2} request to ${requestTopic}` + }); + const functionCode = generateFunctionImplementation({ + functionName, + contextInterfaceName, + replyType, + replyMessageModule, + replyMessageType, + messageType, + requestTopic, + hasParameters, + method: method2, + servers, + includesStatusCodes, + jsDoc + }); + const code = `${contextInterface} + +${functionCode}`; + return { + messageType, + replyType, + code, + functionName, + dependencies: [ + `import { URLSearchParams, URL } from 'url';`, + `import * as NodeFetch from 'node-fetch';` + ], + functionType: "http_client" /* HTTP_CLIENT */ + }; +} +function generateContextInterface(interfaceName, messageType, hasParameters, method2) { + const fields = []; + if (messageType && ["POST", "PUT", "PATCH"].includes(method2.toUpperCase())) { + fields.push(` payload: ${messageType};`); + } + if (hasParameters) { + fields.push( + ` parameters: { getChannelWithParameters: (path: string) => string };` + ); + } + fields.push(` requestHeaders?: { marshal: () => string };`); + const fieldsStr = fields.length > 0 ? ` +${fields.join("\n")} +` : ""; + return `export interface ${interfaceName} extends HttpClientContext {${fieldsStr}}`; +} +function generateFunctionImplementation(params) { + const { + functionName, + contextInterfaceName, + replyType, + replyMessageModule, + replyMessageType, + messageType, + requestTopic, + hasParameters, + method: method2, + servers, + includesStatusCodes, + jsDoc + } = params; + const defaultServer = servers[0] ?? "'localhost:3000'"; + const hasBody = messageType && ["POST", "PUT", "PATCH"].includes(method2.toUpperCase()); + const urlBuildCode = hasParameters ? `let url = buildUrlWithParameters(config.server, '${requestTopic}', context.parameters);` : "let url = `${config.server}${config.path}`;"; + const headersInit = `let headers = context.requestHeaders + ? applyTypedHeaders(context.requestHeaders, config.additionalHeaders) + : { 'Content-Type': 'application/json', ...config.additionalHeaders } as Record;`; + const bodyPrep = hasBody ? `const body = context.payload?.marshal();` : `const body = undefined;`; + let responseParseCode; + if (replyMessageModule) { + responseParseCode = includesStatusCodes ? `const responseData = ${replyMessageModule}.unmarshalByStatusCode(rawData, response.status);` : `const responseData = ${replyMessageModule}.unmarshal(rawData);`; + } else { + responseParseCode = `const responseData = ${replyMessageType}.unmarshal(rawData);`; + } + const contextDefault = !hasBody && !hasParameters ? " = {}" : ""; + return `${jsDoc} +async function ${functionName}(context: ${contextInterfaceName}${contextDefault}): Promise> { + // Apply defaults + const config = { + path: '${requestTopic}', + server: ${defaultServer}, + ...context, + }; + + // Validate OAuth2 config if present + if (config.auth?.type === 'oauth2' && AUTH_FEATURES.oauth2) { + validateOAuth2Config(config.auth); + } + + // Build headers + ${headersInit} + + // Build URL + ${urlBuildCode} + url = applyQueryParams(config.queryParams, url); + + // Apply pagination (can affect URL and/or headers) + const paginationResult = applyPagination(config.pagination, url, headers); + url = paginationResult.url; + headers = paginationResult.headers; + + // Apply authentication + const authResult = applyAuth(config.auth, headers, url); + headers = authResult.headers; + url = authResult.url; + + // Prepare body + ${bodyPrep} + + // Determine request function + const makeRequest = config.hooks?.makeRequest ?? defaultMakeRequest; + + // Build request params + let requestParams: HttpRequestParams = { + url, + method: '${method2}', + headers, + body + }; + + // Apply beforeRequest hook + if (config.hooks?.beforeRequest) { + requestParams = await config.hooks.beforeRequest(requestParams); + } + + try { + // Execute request with retry logic + let response = await executeWithRetry(requestParams, makeRequest, config.retry); + + // Apply afterResponse hook + if (config.hooks?.afterResponse) { + response = await config.hooks.afterResponse(response, requestParams); + } + + // Handle OAuth2 token flows that require getting a token first + if (config.auth?.type === 'oauth2' && !config.auth.accessToken && AUTH_FEATURES.oauth2) { + const tokenFlowResponse = await handleOAuth2TokenFlow(config.auth, requestParams, makeRequest, config.retry); + if (tokenFlowResponse) { + response = tokenFlowResponse; + } + } + + // Handle 401 with token refresh + if (response.status === 401 && config.auth?.type === 'oauth2' && AUTH_FEATURES.oauth2) { + try { + const refreshResponse = await handleTokenRefresh(config.auth, requestParams, makeRequest, config.retry); + if (refreshResponse) { + response = refreshResponse; + } + } catch { + throw new Error('Unauthorized'); + } + } + + // Handle error responses + if (!response.ok) { + handleHttpError(response.status, response.statusText); + } + + // Parse response + const rawData = await response.json(); + ${responseParseCode} + + // Extract response metadata + const responseHeaders = extractHeaders(response); + const paginationInfo = extractPaginationInfo(responseHeaders, config.pagination); + + // Build response wrapper with pagination helpers + const result: HttpClientResponse<${replyType}> = { + data: responseData, + status: response.status, + statusText: response.statusText, + headers: responseHeaders, + rawData, + pagination: paginationInfo, + ...createPaginationHelpers(config, paginationInfo, ${functionName}), + }; + + return result; + + } catch (error) { + // Apply onError hook if present + if (config.hooks?.onError && error instanceof Error) { + throw await config.hooks.onError(error, requestParams); + } + throw error; + } +}`; +} + +// src/codegen/generators/typescript/channels/protocols/http/index.ts +async function generatehttpChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { generator, parameter, topic } = context2; + const ignoreOperation = !generator.asyncapiGenerateForOperations; + let renders = []; + const operations = channel.operations().all(); + if (operations.length > 0 && !ignoreOperation) { + renders = generateForOperations6(context2, channel, topic, parameter); + } + if (protocolCodeFunctions["http_client"].length === 0 && renders.length > 0) { + const commonTypesCode = renderHttpCommonTypes(); + protocolCodeFunctions["http_client"].unshift(commonTypesCode); + } + addRendersToExternal6( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal6(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["http_client"].push( + ...renders.map((value2) => value2.code) + ); + externalProtocolFunctionInformation["http_client"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +function generateForOperations6(context2, channel, topic, parameters) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + const action = operation.action(); + if (shouldRenderFunctionType( + updatedFunctionTypeMapping, + "http_client" /* HTTP_CLIENT */, + action, + generator.asyncapiReverseOperations + )) { + const httpMethod = operation.bindings().get("http")?.json()["method"] ?? "GET"; + const payloadId = findOperationId(operation, channel); + const payload = payloads.operationModels[payloadId]; + const methodsWithBody = ["POST", "PUT", "PATCH"]; + const hasBody = methodsWithBody.includes(httpMethod.toUpperCase()); + const { messageModule, messageType } = getMessageTypeAndModule(payload); + const reply = operation.reply(); + if (reply) { + const replyId = findReplyId(operation, reply, channel); + const replyMessageModel = payloads.operationModels[replyId]; + if (!replyMessageModel) { + throw new Error( + `Could not find payload for reply ${replyId} for channel typescript generator for HTTP` + ); + } + const { + messageModule: replyMessageModule, + messageType: replyMessageType, + includesStatusCodes: replyIncludesStatusCodes + } = getMessageTypeAndModule(replyMessageModel); + if (replyMessageType === void 0) { + throw new Error( + `Could not find reply message type for channel typescript generator for HTTP` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + renders.push( + renderHttpFetchClient({ + subName: findNameFromOperation(operation, channel), + requestMessageModule: hasBody ? messageModule : void 0, + requestMessageType: hasBody ? messageType : void 0, + replyMessageModule, + replyMessageType, + requestTopic: topic, + method: httpMethod.toUpperCase(), + channelParameters: parameters !== void 0 ? parameters : void 0, + includesStatusCodes: replyIncludesStatusCodes, + description: description7, + deprecated + }) + ); + } + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/protocols/websocket/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/channels/protocols/websocket/publish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderWebSocketPublish({ + topic, + messageType, + messageModule, + subName = pascalCase2(topic), + functionName = `publishTo${subName}`, + description: description7, + deprecated +}) { + let messageMarshalling = "message.marshal()"; + if (messageModule) { + messageMarshalling = `${messageModule}.marshal(message)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + { + parameter: "ws", + parameterType: "ws: WebSocket.WebSocket", + jsDoc: " * @param ws the WebSocket connection (assumed to be already connected)" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `WebSocket client-side function to publish messages to \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(",\n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(",\n ")} +}): Promise { + return new Promise((resolve, reject) => { + // Check if WebSocket is open + if (ws.readyState !== WebSocket.WebSocket.OPEN) { + reject(new Error('WebSocket is not open')); + return; + } + + // Send message directly + ws.send(${messageMarshalling}, (err) => { + if (err) { + reject(new Error(\`Failed to send message: \${err.message}\`)); + } + resolve(); + }); + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as WebSocket from 'ws';`], + functionType: "websocket_publish" /* WEBSOCKET_PUBLISH */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/websocket/subscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderWebSocketSubscribe({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + subName = pascalCase2(topic), + functionName = `subscribeTo${subName}`, + description: description7, + deprecated +}) { + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const callbackParameters = [ + "err?: Error", + `msg?: ${messageType}`, + ...channelParameters4 ? [`parameters?: ${channelParameters4.type}`] : [], + "ws?: WebSocket.WebSocket" + ]; + const callbackArguments = [ + "err: undefined", + "msg: parsedMessage", + ...channelParameters4 ? ["parameters"] : [], + "ws" + ]; + const errorCallbackArguments = [ + "err: new Error(`Failed to parse message: ${error.message}`)", + "msg: undefined", + ...channelParameters4 ? ["parameters"] : [], + "ws" + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (params: {${callbackParameters.join(", ")}}) => void`, + jsDoc: " * @param onDataCallback callback when messages are received" + }, + ...channelParameters4 ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameters4.type}`, + jsDoc: " * @param parameters for URL path substitution" + } + ] : [], + { + parameter: "ws", + parameterType: "ws: WebSocket.WebSocket", + jsDoc: " * @param ws the WebSocket connection (assumed to be already connected)" + }, + { + parameter: "skipMessageValidation = false", + parameterType: "skipMessageValidation?: boolean", + jsDoc: " * @param skipMessageValidation turn off runtime validation of incoming messages" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `WebSocket client-side function to subscribe to messages from \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(",\n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(",\n ")} +}): void { + try { + // Check if WebSocket is open + if (ws.readyState !== WebSocket.WebSocket.OPEN) { + onDataCallback({ + err: new Error('WebSocket is not open'), + msg: undefined,${channelParameters4 ? "\n parameters," : ""} + ws + }); + return; + } + + const validator = ${messageModule ? `${messageModule}.createValidator()` : `${messageType}.createValidator()`}; + + ws.on('message', (data: WebSocket.RawData) => { + try { + const receivedData = data.toString(); + const parsedMessage = ${messageUnmarshalling}; + + // Validate message if validation is enabled + if (!skipMessageValidation) { + const messageToValidate = ${messageModule ? `${messageModule}.marshal(parsedMessage)` : `parsedMessage.marshal()`}; + const {valid, errors} = ${messageModule ? `${messageModule}.validate({data: messageToValidate, ajvValidatorFunction: validator})` : `${messageType}.validate({data: messageToValidate, ajvValidatorFunction: validator})`}; + if (!valid) { + onDataCallback({ + err: new Error(\`Invalid message payload received; \${JSON.stringify({cause: errors})}\`), + msg: undefined,${channelParameters4 ? "\n parameters," : ""} + ws + }); + return; + } + } + + onDataCallback({ + ${callbackArguments.join(",\n ")} + }); + + } catch (error: any) { + onDataCallback({ + ${errorCallbackArguments.join(",\n ")} + }); + } + }); + + ws.on('error', (error: Error) => { + onDataCallback({ + err: new Error(\`WebSocket error: \${error.message}\`), + msg: undefined,${channelParameters4 ? "\n parameters," : ""} + ws + }); + }); + + ws.on('close', (code: number, reason: Buffer) => { + // Only report as error if it's not a normal closure (1000) or going away (1001) + if (code !== 1000 && code !== 1001 && code !== 1005) { // 1005 is no status received + onDataCallback({ + err: new Error(\`WebSocket closed unexpectedly: \${code} \${reason.toString()}\`), + msg: undefined,${channelParameters4 ? "\n parameters," : ""} + ws + }); + } + }); + + } catch (error: any) { + onDataCallback({ + err: new Error(\`Failed to set up WebSocket subscription: \${error.message}\`), + msg: undefined,${channelParameters4 ? "\n parameters," : ""} + ws + }); + } +}`; + return { + messageType, + code, + functionName, + dependencies: [`import * as WebSocket from 'ws';`], + functionType: "websocket_subscribe" /* WEBSOCKET_SUBSCRIBE */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/websocket/register.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderWebSocketRegister({ + topic, + messageType, + messageModule, + channelParameters: channelParameters4, + subName = pascalCase2(topic), + functionName = `register${subName}`, + description: description7, + deprecated +}) { + let messageUnmarshalling = `${messageType}.unmarshal(receivedData)`; + if (messageModule) { + messageUnmarshalling = `${messageModule}.unmarshal(receivedData)`; + } + messageType = messageModule ? `${messageModule}.${messageType}` : messageType; + const channelPattern = topic.replace(/\{[^}]+\}/g, "([^\\/]*)"); + const escapedChannelPattern = channelPattern.replace(/\//g, "\\/"); + const regexPattern = `/^${escapedChannelPattern}(?:\\?.*)?$/`; + const topicWithoutLeadingSlash = topic.startsWith("/") ? topic.slice(1) : topic; + const channelPatternWithoutLeadingSlash = topicWithoutLeadingSlash.replace( + /\{[^}]+\}/g, + "([^\\/]*)" + ); + const parameterExtraction = channelParameters4 ? `const channelPath = url.startsWith('/') ? url.slice(1) : url; + const parameters = ${channelParameters4.type}.createFromChannel(channelPath, '${topicWithoutLeadingSlash}', /^${channelPatternWithoutLeadingSlash.replace(/\//g, "\\/")}$/);` : ""; + const onConnectionParameters = [ + ...channelParameters4 ? [`parameters: ${channelParameters4.type}`] : [], + "ws: WebSocket.WebSocket", + "request: IncomingMessage" + ]; + const onMessageParameters = [ + `message: ${messageType}`, + "ws: WebSocket.WebSocket" + ]; + const functionParameters = [ + { + parameter: `wss`, + parameterType: `wss: WebSocket.WebSocketServer`, + jsDoc: " * @param wss the WebSocket server instance" + }, + { + parameter: `onConnection`, + parameterType: `onConnection: (params: {${onConnectionParameters.join(", ")}}) => void`, + jsDoc: " * @param onConnection callback when a client connects to this channel" + }, + { + parameter: `onMessage`, + parameterType: `onMessage: (params: {${onMessageParameters.join(", ")}}) => void`, + jsDoc: " * @param onMessage callback when a message is received on this channel" + } + ]; + const jsDoc = renderChannelJSDoc({ + description: description7, + deprecated, + fallbackDescription: `WebSocket server-side function to handle messages for \`${topic}\``, + parameters: functionParameters.map((param) => ({ + jsDoc: param.jsDoc + })) + }); + const code = `${jsDoc} +function ${functionName}({ + ${functionParameters.map((param) => param.parameter).join(",\n ")} +}: { + ${functionParameters.map((param) => param.parameterType).join(",\n ")} +}): void { + const channelPattern = ${regexPattern}; + + wss.on('connection', (ws: WebSocket.WebSocket, request: IncomingMessage) => { + try { + const url = request.url || ''; + const match = url.match(channelPattern); + if (match) { + try { + ${parameterExtraction} + onConnection({${channelParameters4 ? "\n parameters," : ""} + ws, + request + }); + } catch (connectionError) { + console.error('Error in onConnection callback:', connectionError); + ws.close(1011, 'Connection error'); + return; + } + + ws.on('message', (data: WebSocket.RawData) => { + try { + const receivedData = data.toString(); + const parsedMessage = ${messageUnmarshalling}; + onMessage({ + message: parsedMessage, + ws + }); + } catch (error: any) { + // Ignore parsing errors + } + }); + } + } catch (error: any) { + ws.close(1011, 'Server error'); + } + }); +}`; + return { + messageType, + code, + functionName, + dependencies: [ + `import * as WebSocket from 'ws';`, + `import { IncomingMessage } from 'http';` + ], + functionType: "websocket_register" /* WEBSOCKET_REGISTER */ + }; +} + +// src/codegen/generators/typescript/channels/protocols/websocket/index.ts +async function generateWebSocketChannels(context2, channel, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies) { + const { parameter, topic, payloads } = context2; + const ignoreOperation = !context2.generator.asyncapiGenerateForOperations; + const websocketTopic = topic.startsWith("/") ? topic : `/${topic}`; + const websocketContext = { + channelParameters: parameter, + channelHeaders: void 0, + // WebSocket doesn't use headers in the same way + topic: websocketTopic, + messageType: "", + subName: context2.subName, + payloadGenerator: payloads + }; + const operations = channel.operations().all(); + const renders = operations.length > 0 && !ignoreOperation ? await generateForOperations7(context2, channel, websocketContext) : await generateForChannels6(context2, channel, websocketContext); + addRendersToExternal7( + renders, + protocolCodeFunctions, + externalProtocolFunctionInformation, + dependencies, + parameter + ); +} +function addRendersToExternal7(renders, protocolCodeFunctions, externalProtocolFunctionInformation, dependencies, parameter) { + protocolCodeFunctions["websocket"].push( + ...renders.map((value2) => value2.code) + ); + externalProtocolFunctionInformation["websocket"].push( + ...renders.map((value2) => ({ + functionType: value2.functionType, + functionName: value2.functionName, + messageType: value2.messageType, + replyType: value2.replyType, + parameterType: parameter?.type + })) + ); + const renderedDependencies = renders.map((value2) => value2.dependencies).flat(Infinity); + dependencies.push(...new Set(renderedDependencies)); +} +async function generateForOperations7(context2, channel, websocketContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = generator.functionTypeMapping?.[channel.id()]; + for (const operation of channel.operations().all()) { + const updatedFunctionTypeMapping = getFunctionTypeMappingFromAsyncAPI(operation) ?? functionTypeMapping; + if (updatedFunctionTypeMapping !== void 0 && !updatedFunctionTypeMapping?.some( + (f8) => [ + "websocket_publish" /* WEBSOCKET_PUBLISH */, + "websocket_subscribe" /* WEBSOCKET_SUBSCRIBE */, + "websocket_register" /* WEBSOCKET_REGISTER */ + ].includes(f8) + )) { + continue; + } + const payload = payloads.operationModels[findOperationId(operation, channel)]; + if (!payload) { + throw new Error( + `Could not find payload for operation in channel typescript generator for WebSocket` + ); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for WebSocket` + ); + } + const { description: description7, deprecated } = getOperationMetadata(operation); + const updatedContext = { + ...websocketContext, + messageType, + messageModule, + subName: findNameFromOperation(operation, channel), + description: description7, + deprecated + }; + renders.push( + ...await generateOperationRenders5( + operation, + updatedContext, + updatedFunctionTypeMapping, + generator + ) + ); + } + return renders; +} +async function generateOperationRenders5(operation, websocketContext, functionTypeMapping, generator) { + const renders = []; + const action = operation.action(); + const renderChecks = [ + { + check: "websocket_publish" /* WEBSOCKET_PUBLISH */, + render: renderWebSocketPublish + }, + { + check: "websocket_subscribe" /* WEBSOCKET_SUBSCRIBE */, + render: renderWebSocketSubscribe + }, + { + check: "websocket_register" /* WEBSOCKET_REGISTER */, + render: renderWebSocketRegister + } + ]; + for (const { check, render } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render(websocketContext)); + } + } + return renders; +} +async function generateForChannels6(context2, channel, websocketContext) { + const renders = []; + const { generator, payloads } = context2; + const functionTypeMapping = getFunctionTypeMappingFromAsyncAPI(channel) ?? generator.functionTypeMapping?.[channel.id()]; + const payload = payloads.channelModels[channel.id()]; + if (!payload) { + throw createMissingPayloadError({ + channelOrOperation: channel.id(), + protocol: "WebSocket" + }); + } + const { messageModule, messageType } = getMessageTypeAndModule(payload); + if (messageType === void 0) { + throw new Error( + `Could not find message type for channel typescript generator for WebSocket` + ); + } + const updatedContext = { ...websocketContext, messageType, messageModule }; + const renderChecks = [ + { + check: "websocket_publish" /* WEBSOCKET_PUBLISH */, + render: renderWebSocketPublish, + action: "send" + }, + { + check: "websocket_subscribe" /* WEBSOCKET_SUBSCRIBE */, + render: renderWebSocketSubscribe, + action: "receive" + }, + { + check: "websocket_register" /* WEBSOCKET_REGISTER */, + render: renderWebSocketRegister, + action: "send" + } + ]; + for (const { check, render, action } of renderChecks) { + if (shouldRenderFunctionType( + functionTypeMapping, + check, + action, + generator.asyncapiReverseOperations + )) { + renders.push(render(updatedContext)); + } + } + return renders; +} + +// src/codegen/generators/typescript/channels/asyncapi.ts +function shouldRenderFunctionType(givenFunctionTypes, functionTypesToCheckFor, action, reverseOperation) { + const listToCheck = [ + ...Array.isArray(functionTypesToCheckFor) ? functionTypesToCheckFor : [functionTypesToCheckFor] + ]; + const hasSendingOperation = action === "send" || action === "subscribe"; + const hasReceivingOperation = action === "receive" || action === "publish"; + const hasFunctionMappingConfig = givenFunctionTypes !== void 0; + const checkForSending = listToCheck.some( + (item) => sendingFunctionTypes.includes(item) + ); + const checkForReceiving = listToCheck.some( + (item) => receivingFunctionTypes.includes(item) + ); + const hasFunctionType = (givenFunctionTypes ?? []).some( + (item) => listToCheck.includes(item) + ); + if (hasFunctionMappingConfig) { + if (hasFunctionType) { + const renderForSending2 = checkForSending && hasSendingOperation; + const renderForReceiving2 = checkForReceiving && hasReceivingOperation; + return renderForSending2 || renderForReceiving2; + } + return false; + } + if (reverseOperation) { + const renderForSending2 = hasSendingOperation && checkForReceiving; + const renderForReceiving2 = hasReceivingOperation && checkForSending; + return renderForSending2 || renderForReceiving2; + } + const renderForSending = checkForSending && hasSendingOperation; + const renderForReceiving = checkForReceiving && hasReceivingOperation; + return renderForSending || renderForReceiving; +} +async function generateTypeScriptChannelsForAsyncAPI(context2, parameters, payloads, headers, protocolsToUse, protocolCodeFunctions, externalProtocolFunctionInformation, protocolDependencies) { + const { asyncapiDocument } = validateAsyncapiContext(context2); + const channels = asyncapiDocument.allChannels().all().filter((channel) => channel.address() && channel.messages().length > 0); + const importExtension = resolveImportExtension( + context2.generator, + context2.config + ); + for (const protocol of protocolsToUse) { + const deps = protocolDependencies[protocol]; + collectProtocolDependencies( + payloads, + parameters, + headers, + context2, + deps, + importExtension + ); + } + for (const channel of channels) { + const subName = findNameFromChannel(channel); + let parameter = void 0; + if (channel.parameters().length > 0) { + parameter = parameters.channelModels[channel.id()]; + if (parameter === void 0) { + throw createMissingParameterError({ + channelOrOperation: channel.id(), + protocol: "channels" + }); + } + } + const headerModel = headers.channelModels[channel.id()]; + for (const protocol of protocolsToUse) { + const protocolContext = { + ...context2, + subName, + topic: channel.address(), + parameter: parameter?.model, + headers: headerModel?.model, + payloads + }; + switch (protocol) { + case "nats": + await generateNatsChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["nats"] + ); + break; + case "kafka": + await generateKafkaChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["kafka"] + ); + break; + case "mqtt": + await generateMqttChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["mqtt"] + ); + break; + case "amqp": + await generateAmqpChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["amqp"] + ); + break; + case "http_client": + await generatehttpChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["http_client"] + ); + break; + case "event_source": + await generateEventSourceChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["event_source"] + ); + break; + case "websocket": + await generateWebSocketChannels( + protocolContext, + channel, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies["websocket"] + ); + break; + default: + break; + } + } + } +} +function validateAsyncapiContext(context2) { + const { asyncapiDocument, inputType } = context2; + if (inputType !== "asyncapi") { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "channels" + }); + } + if (asyncapiDocument === void 0) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "channels" + }); + } + return { asyncapiDocument }; +} +function getFunctionTypeMappingFromAsyncAPI(object) { + return object.extensions().get("x-the-codegen-project")?.value()?.functionTypeMapping ?? void 0; +} + +// src/codegen/generators/typescript/channels/openapi.ts +init_dirname(); +init_buffer2(); +init_process2(); +var HTTP_METHODS = [ + "get", + "post", + "put", + "patch", + "delete", + "options", + "head" +]; +var METHODS_WITH_BODY = ["post", "put", "patch"]; +async function generateTypeScriptChannelsForOpenAPI(context2, parameters, payloads, headers, protocolsToUse, protocolCodeFunctions, externalProtocolFunctionInformation, protocolDependencies) { + if (!protocolsToUse.includes("http_client")) { + return; + } + const { openapiDocument } = validateOpenAPIContext(context2); + const securitySchemes = extractSecuritySchemes(openapiDocument); + const deps = protocolDependencies["http_client"]; + const importExtension = resolveImportExtension( + context2.generator, + context2.config + ); + collectProtocolDependencies( + payloads, + parameters, + headers, + context2, + deps, + importExtension + ); + const renders = processOpenAPIOperations( + openapiDocument, + payloads, + parameters + ); + if (protocolCodeFunctions["http_client"].length === 0 && renders.length > 0) { + const commonTypesCode = renderHttpCommonTypes(securitySchemes); + protocolCodeFunctions["http_client"].unshift(commonTypesCode); + } + protocolCodeFunctions["http_client"].push(...renders.map((r8) => r8.code)); + externalProtocolFunctionInformation["http_client"].push( + ...renders.map((r8) => ({ + functionType: r8.functionType, + functionName: r8.functionName, + messageType: r8.messageType ?? "", + replyType: r8.replyType, + parameterType: void 0 + })) + ); + const renderedDeps = renders.flatMap((r8) => r8.dependencies); + deps.push(...new Set(renderedDeps)); +} +function processOpenAPIOperations(openapiDocument, payloads, parameters) { + const renders = []; + for (const [path2, pathItem] of Object.entries(openapiDocument.paths ?? {})) { + if (!pathItem) { + continue; + } + for (const method2 of HTTP_METHODS) { + const render = processOperation( + pathItem, + method2, + path2, + payloads, + parameters + ); + if (render) { + renders.push(render); + } + } + } + return renders; +} +function processOperation(pathItem, method2, path2, payloads, parameters) { + const operation = pathItem[method2]; + if (!operation) { + return void 0; + } + const operationId = getOperationId(operation, method2, path2); + const hasBody = METHODS_WITH_BODY.includes(method2); + const requestPayload = hasBody ? ( + // eslint-disable-next-line security/detect-object-injection + payloads.operationModels[operationId] + ) : void 0; + const responsePayloadKey = `${operationId}_Response`; + const responsePayload = payloads.operationModels[responsePayloadKey]; + const parameterModel = parameters.channelModels[operationId]; + const requestMessageInfo = requestPayload ? getMessageTypeAndModule(requestPayload) : { + messageModule: void 0, + messageType: void 0, + includesStatusCodes: false + }; + const responseMessageInfo = responsePayload ? getMessageTypeAndModule(responsePayload) : { + messageModule: void 0, + messageType: void 0, + includesStatusCodes: false + }; + const { messageModule: requestMessageModule, messageType: requestMessageType } = requestMessageInfo; + const { + messageModule: replyMessageModule, + messageType: replyMessageType, + includesStatusCodes: replyIncludesStatusCodes + } = responseMessageInfo; + if (!replyMessageType) { + return void 0; + } + const description7 = operation.description ?? operation.summary; + const deprecated = operation.deprecated === true; + return renderHttpFetchClient({ + subName: pascalCase2(operationId), + requestMessageModule: hasBody ? requestMessageModule : void 0, + requestMessageType: hasBody ? requestMessageType : void 0, + replyMessageModule, + replyMessageType, + requestTopic: path2, + method: method2.toUpperCase(), + channelParameters: parameterModel?.model, + includesStatusCodes: replyIncludesStatusCodes, + description: description7, + deprecated + }); +} +function validateOpenAPIContext(context2) { + const { openapiDocument, inputType } = context2; + if (inputType !== "openapi") { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "channels" + }); + } + if (!openapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "channels" + }); + } + return { openapiDocument }; +} +function getOperationId(operation, method2, path2) { + if (operation.operationId) { + return operation.operationId; + } + const sanitizedPath = path2.replace(/[^a-zA-Z0-9]/g, ""); + return `${method2}${sanitizedPath}`; +} + +// src/codegen/generators/typescript/channels/index.ts +async function generateTypeScriptChannels(context2) { + const protocolCodeFunctions = {}; + const externalProtocolFunctionInformation = {}; + const { parameters, payloads, headers } = validateContext(context2); + const generator = context2.generator; + const protocolsToUse = generator.protocols; + const protocolDependencies = {}; + for (const protocol of protocolsToUse) { + protocolCodeFunctions[protocol] = []; + externalProtocolFunctionInformation[protocol] = []; + protocolDependencies[protocol] = []; + } + if (context2.inputType === "asyncapi") { + await generateTypeScriptChannelsForAsyncAPI( + context2, + parameters, + payloads, + headers, + protocolsToUse, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies + ); + } else if (context2.inputType === "openapi") { + await generateTypeScriptChannelsForOpenAPI( + context2, + parameters, + payloads, + headers, + protocolsToUse, + protocolCodeFunctions, + externalProtocolFunctionInformation, + protocolDependencies + ); + } + return await finalizeGeneration( + context2, + protocolDependencies, + protocolCodeFunctions, + externalProtocolFunctionInformation, + parameters, + payloads + ); +} +async function finalizeGeneration(context2, protocolDependencies, protocolCodeFunctions, externalProtocolFunctionInformation, parameters, payloads) { + const files = []; + const generatedProtocols = []; + const protocolFiles = {}; + for (const [protocol, functions2] of Object.entries(protocolCodeFunctions)) { + if (functions2.length === 0) { + continue; + } + const deps = [...new Set(protocolDependencies[protocol] || [])]; + const functionNames = (externalProtocolFunctionInformation[protocol] || []).map((fn) => fn.functionName); + const depsSection = deps.join("\n"); + const depsNewline = deps.length > 0 ? "\n\n" : ""; + const functionsSection = functions2.join("\n\n"); + const exportSection = functionNames.length > 0 ? ` + +export { ${functionNames.join(", ")} };` : ""; + const fileContent = `${depsSection}${depsNewline}${functionsSection}${exportSection} +`; + const protocolFilePath = joinPath( + context2.generator.outputPath, + `${protocol}.ts` + ); + files.push({ path: protocolFilePath, content: fileContent }); + generatedProtocols.push(protocol); + protocolFiles[protocol] = fileContent; + } + let indexContent; + if (generatedProtocols.length > 0) { + const ext = resolveImportExtension(context2.generator, context2.config); + const imports = generatedProtocols.map((p7) => { + const importPath = appendImportExtension(`./${p7}`, ext); + return `import * as ${p7} from '${importPath}';`; + }).join("\n"); + const exports28 = generatedProtocols.join(", "); + indexContent = `${imports} + +export {${exports28}}; +`; + } else { + indexContent = "// No protocols generated\n"; + } + const indexFilePath = joinPath(context2.generator.outputPath, "index.ts"); + files.push({ path: indexFilePath, content: indexContent }); + return { + parameterRender: parameters, + payloadRender: payloads, + generator: context2.generator, + renderedFunctions: externalProtocolFunctionInformation, + result: indexContent, + protocolFiles, + files + }; +} +function validateContext(context2) { + const { generator } = context2; + if (!context2.dependencyOutputs) { + throw new Error( + "Internal error, could not determine previous rendered outputs that is required for channel typescript generator" + ); + } + const payloads = context2.dependencyOutputs[generator.payloadGeneratorId]; + const parameters = context2.dependencyOutputs[generator.parameterGeneratorId]; + const headers = context2.dependencyOutputs[generator.headerGeneratorId]; + if (!payloads) { + throw new Error( + "Internal error, could not determine previous rendered payloads generator that is required for channel TypeScript generator" + ); + } + if (!parameters) { + throw new Error( + "Internal error, could not determine previous rendered parameters generator that is required for channel TypeScript generator" + ); + } + if (!headers) { + throw new Error( + "Internal error, could not determine previous rendered headers generator that is required for channel TypeScript generator" + ); + } + return { payloads, parameters, headers }; +} +function includeTypeScriptChannelDependencies(config3, generator) { + const newGenerators = []; + const parameterGeneratorId = generator.parameterGeneratorId; + const payloadGeneratorId = generator.payloadGeneratorId; + const headerGeneratorId = generator.headerGeneratorId; + const hasParameterGenerator = config3.generators.find( + (generatorSearch) => generatorSearch.id === parameterGeneratorId + ) !== void 0; + const hasPayloadGenerator = config3.generators.find( + (generatorSearch) => generatorSearch.id === payloadGeneratorId + ) !== void 0; + const hasHeaderGenerator = config3.generators.find( + (generatorSearch) => generatorSearch.id === headerGeneratorId + ) !== void 0; + if (!hasParameterGenerator) { + const defaultChannelParameterGenerator = { + ...defaultTypeScriptParametersOptions, + outputPath: joinPath(generator.outputPath ?? "", "./parameter") + }; + newGenerators.push(defaultChannelParameterGenerator); + } + if (!hasPayloadGenerator) { + const defaultChannelPayloadGenerator = { + ...defaultTypeScriptPayloadGenerator, + outputPath: joinPath(generator.outputPath ?? "", "./payload") + }; + newGenerators.push(defaultChannelPayloadGenerator); + } + if (!hasHeaderGenerator) { + const defaultChannelHeaderGenerator = { + ...defaultTypeScriptHeadersOptions, + outputPath: joinPath(generator.outputPath ?? "", "./headers") + }; + newGenerators.push(defaultChannelHeaderGenerator); + } + return newGenerators; +} + +// src/codegen/generators/generic/custom.ts +init_dirname(); +init_buffer2(); +init_process2(); +var zodCustomGenerator = external_exports.object({ + id: external_exports.string().optional().default("custom"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("custom").default("custom"), + options: external_exports.any().optional().default({}), + outputPath: external_exports.string().optional().default("custom"), + language: external_exports.literal("typescript").optional().default("typescript"), + renderFunction: external_exports.function().args( + external_exports.object({ + inputType: external_exports.enum(["asyncapi", "openapi", "jsonschema"]).default("asyncapi"), + asyncapiDocument: external_exports.any().describe( + `Type is AsyncAPIDocumentInterface from @asyncapi/parser` + ), + openapiDocument: external_exports.any().describe( + `Type is { OpenAPIV3, OpenAPIV2, OpenAPIV3_1 } from 'openapi-types` + ), + jsonSchemaDocument: external_exports.any().describe(`Type is JsonSchemaDocument - a JSON Schema object`), + generator: external_exports.any(), + dependencyOutputs: external_exports.record(external_exports.any()).default({}) + }).default({}), + external_exports.any().optional().describe("The provided options by the user").default({}) + ).returns(external_exports.any()).optional().default(() => { + }) +}); +var defaultCustomGenerator = zodCustomGenerator.parse({}); + +// src/codegen/generators/typescript/client/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/client/protocols/nats.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/client/protocols/nats/coreSubscribe.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderCoreSubscribe2({ + description: description7, + messageType, + channelParameterType, + channelName +}) { + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameterType ? [ + { + parameter: `parameters?: ${channelParameterType}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + { + parameter: `natsMsg?: Nats.Msg`, + jsDoc: " * @param natsMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${channelName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameterType ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameterType}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "options", + parameterType: "options?: Nats.SubscriptionOptions", + jsDoc: " * @param options when setting up the subscription" + }, + { + parameter: "flush", + parameterType: "flush?: boolean", + jsDoc: " * @param options when setting up the subscription" + } + ]; + const functionCallParameters = [ + "onDataCallback", + ...channelParameterType ? ["parameters"] : [], + "nc: this.nc", + "codec: this.codec", + "options" + ]; + return ` + /** + * ${description7} + * + ${functionParameters.map((param) => param.jsDoc).join("\n ")} + */ + public ${channelName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} + }: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} + }): Promise { + return new Promise(async (resolve, reject) => { + if(!this.isClosed() && this.nc !== undefined && this.codec !== undefined){ + try { + const sub = await nats.${channelName}({ + ${functionCallParameters.join(", \n ")} + }); + if(flush){ + await this.nc.flush(); + } + resolve(sub); + }catch(e: any){ + reject(e); + } + } else { + Promise.reject('Nats client not available yet, please connect or set the client'); + } + }); +}`; +} + +// src/codegen/generators/typescript/client/protocols/nats/corePublish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderCorePublish2({ + description: description7, + messageType, + channelParameterType, + channelName +}) { + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameterType ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameterType}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "options", + parameterType: "options?: Nats.PublishOptions", + jsDoc: " * @param options to use while publishing the message" + } + ]; + const functionCallParameters = [ + "message", + ...channelParameterType ? ["parameters"] : [], + "nc: this.nc", + "codec: this.codec", + "options" + ]; + return ` + /** + * ${description7} + * + ${functionParameters.map((param) => param.jsDoc).join("\n ")} + */ + public async ${channelName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} + }: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} + }): Promise { + if (!this.isClosed() && this.nc !== undefined && this.codec !== undefined) { + await nats.${channelName}({ + ${functionCallParameters.join(", \n ")} + }); + } else { + Promise.reject('Nats client not available yet, please connect or set the client'); + } + }`; +} + +// src/codegen/generators/typescript/client/protocols/nats/jetstreamPublish.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetStreamPublish({ + description: description7, + messageType, + channelParameterType, + channelName +}) { + const functionParameters = [ + { + parameter: `message`, + parameterType: `message: ${messageType}`, + jsDoc: " * @param message to publish" + }, + ...channelParameterType ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameterType}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "options = {}", + parameterType: "options?: Partial", + jsDoc: " * @param options to use while publishing the message" + } + ]; + const functionCallParameters = [ + "message", + ...channelParameterType ? ["parameters"] : [], + "js: this.js", + "codec: this.codec", + "options" + ]; + return ` + /** + * ${description7} + * + ${functionParameters.map((param) => param.jsDoc).join("\n")} + */ + public async ${channelName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} + }: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} + }): Promise { + if (!this.isClosed() && this.nc !== undefined && this.codec !== undefined && this.js !== undefined) { + return nats.${channelName}({ + ${functionCallParameters.join(", \n ")} + }); + } else { + Promise.reject('Nats client not available yet, please connect or set the client'); + } + } + `; +} + +// src/codegen/generators/typescript/client/protocols/nats/jetStreamPullSubscription.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetStreamPullSubscription({ + description: description7, + messageType, + channelParameterType, + channelName +}) { + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameterType ? [ + { + parameter: `parameters?: ${channelParameterType}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + { + parameter: `jetstreamMsg?: Nats.JsMsg`, + jsDoc: " * @param jetstreamMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${channelName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameterType ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameterType}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "options = {}", + parameterType: "options: Nats.ConsumerOptsBuilder | Partial", + jsDoc: " * @param options when setting up the subscription" + } + ]; + const functionCallParameters = [ + "onDataCallback", + ...channelParameterType ? ["parameters"] : [], + "js: this.js", + "codec: this.codec", + "options" + ]; + return ` + /** + * ${description7} + * + ${functionParameters.map((param) => param.jsDoc).join("\n ")} + */ + public ${channelName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} + }: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} + }): Promise { + return new Promise(async (resolve, reject) => { + if (!this.isClosed() && this.nc !== undefined && this.codec !== undefined && this.js !== undefined) { + try { + const sub = await nats.${channelName}({ + ${functionCallParameters.join(", \n ")} + }); + resolve(sub); + } catch (e: any) { + reject(e); + } + } else { + Promise.reject('Nats client not available yet, please connect or set the client'); + } + }); + } + `; +} + +// src/codegen/generators/typescript/client/protocols/nats/jetstreamPushSubscription.ts +init_dirname(); +init_buffer2(); +init_process2(); +function renderJetStreamPushSubscription({ + description: description7, + messageType, + channelParameterType, + channelName +}) { + const callbackFunctionParameters = [ + { + parameter: "err?: Error", + jsDoc: " * @param err if any error occurred this will be sat" + }, + { + parameter: `msg?: ${messageType}`, + jsDoc: " * @param msg that was received" + }, + ...channelParameterType ? [ + { + parameter: `parameters?: ${channelParameterType}`, + jsDoc: " * @param parameters that was received in the topic" + } + ] : [], + { + parameter: `jetstreamMsg?: Nats.JsMsg`, + jsDoc: " * @param jetstreamMsg" + } + ]; + const functionParameters = [ + { + parameter: `onDataCallback`, + parameterType: `onDataCallback: (${callbackFunctionParameters.map((param) => param.parameter).join(", ")}) => void`, + jsDoc: ` * @param {${channelName}Callback} onDataCallback to call when messages are received` + }, + ...channelParameterType ? [ + { + parameter: `parameters`, + parameterType: `parameters: ${channelParameterType}`, + jsDoc: " * @param parameters for topic substitution" + } + ] : [], + { + parameter: "options = {}", + parameterType: "options: Nats.ConsumerOptsBuilder | Partial", + jsDoc: " * @param options when setting up the subscription" + } + ]; + const functionCallParameters = [ + "onDataCallback", + ...channelParameterType ? ["parameters"] : [], + "js: this.js", + "codec: this.codec", + "options" + ]; + return ` + /** + * ${description7} + * + ${functionParameters.map((param) => param.jsDoc).join("\n ")} + */ + public ${channelName}({ + ${functionParameters.map((param) => param.parameter).join(", \n ")} + }: { + ${functionParameters.map((param) => param.parameterType).join(", \n ")} + }): Promise { + return new Promise(async (resolve, reject) => { + if (!this.isClosed() && this.nc !== undefined && this.codec !== undefined && this.js !== undefined) { + try { + const sub = await nats.${channelName}({ + ${functionCallParameters.join(", \n ")} + }); + resolve(sub); + } catch (e: any) { + reject(e); + } + } else { + Promise.reject('Nats client not available yet, please connect or set the client'); + } + }); + }`; +} + +// src/codegen/generators/typescript/client/protocols/nats.ts +async function generateNatsClient(context2) { + const { asyncapiDocument, generator, inputType } = context2; + if (inputType === "asyncapi" && asyncapiDocument === void 0) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "client" + }); + } + if (!context2.dependencyOutputs) { + throw createMissingDependencyOutputError({ + generatorPreset: "client", + dependencyName: "dependencyOutputs" + }); + } + const channels = context2.dependencyOutputs[generator.channelsGeneratorId]; + if (!channels) { + throw createMissingDependencyOutputError({ + generatorPreset: "client", + dependencyName: "channels" + }); + } + const renderedFunctions = channels.renderedFunctions; + const renderedNatsFunctions = renderedFunctions["nats"] ?? []; + const payloads = channels.payloadRender; + const parameters = channels.parameterRender; + const dependencies = []; + const importExtension = resolveImportExtension( + context2.generator, + context2.config + ); + const modelPayloads = [ + ...Object.values(payloads.operationModels), + ...Object.values(payloads.channelModels), + ...Object.values(payloads.otherModels) + ]; + addPayloadsToDependencies( + modelPayloads, + payloads.generator, + context2.generator, + dependencies, + importExtension + ); + addPayloadsToExports(modelPayloads, dependencies); + addParametersToDependencies( + parameters.channelModels, + parameters.generator, + context2.generator, + dependencies, + importExtension + ); + addParametersToExports(parameters.channelModels, dependencies); + const natsFunctions = []; + for (const func of renderedNatsFunctions) { + const context3 = { + channelName: func.functionName, + channelParameterType: func.parameterType, + description: "", + messageType: func.messageType + }; + switch (func.functionType) { + case "nats_subscribe" /* NATS_SUBSCRIBE */: + natsFunctions.push(renderCoreSubscribe2(context3)); + break; + case "nats_publish" /* NATS_PUBLISH */: + natsFunctions.push(renderCorePublish2(context3)); + break; + case "nats_jetstream_publish" /* NATS_JETSTREAM_PUBLISH */: + natsFunctions.push(renderJetStreamPublish(context3)); + break; + case "nats_jetstream_pull_subscribe" /* NATS_JETSTREAM_PULL_SUBSCRIBE */: + natsFunctions.push(renderJetStreamPullSubscription(context3)); + break; + case "nats_jetstream_push_subscribe" /* NATS_JETSTREAM_PUSH_SUBSCRIBE */: + natsFunctions.push(renderJetStreamPushSubscription(context3)); + break; + default: + break; + } + } + const natsChannelsImportPath = relativePath( + context2.generator.outputPath, + joinPath(channels.generator.outputPath, "nats") + ); + const channelImportPath = appendImportExtension( + `./${ensureRelativePath(natsChannelsImportPath)}`, + importExtension + ); + return `${[...new Set(dependencies)].join("\n")} + +//Import channel functions +import * as nats from '${channelImportPath}'; + +import * as Nats from 'nats'; + +/** + * @class NatsClient + */ +export class NatsClient { + public nc?: Nats.NatsConnection; + public js?: Nats.JetStreamClient; + public codec?: Nats.Codec; + public options?: Nats.ConnectionOptions; + + /** + * Disconnect all clients from the server and drain subscriptions. + * + * This is a gentle disconnect and make take a little. + */ + async disconnect() { + if (!this.isClosed() && this.nc !== undefined) { + await this.nc.drain(); + } + } + /** + * Returns whether or not any of the clients are closed + */ + isClosed() { + if (!this.nc || this.nc.isClosed()) { + return true; + } + return false; + } + /** + * Try to connect to the NATS server with user credentials + * + * @param userCreds to use + * @param options to connect with + */ + async connectWithUserCreds(userCreds: string, options?: Nats.ConnectionOptions, codec?: Nats.Codec ) { + return await this.connect({ + user: userCreds, + ...options + }, codec); + } + /** + * Try to connect to the NATS server with user and password + * + * @param user username to use + * @param pass password to use + * @param options to connect with + */ + async connectWithUserPass(user: string, pass: string, options?: Nats.ConnectionOptions, codec?: Nats.Codec ) { + return await this.connect({ + user: user, + pass: pass, + ...options + }, codec); + } + /** + * Try to connect to the NATS server which has no authentication + + * @param host to connect to + * @param options to connect with + */ + async connectToHost(host: string, options?: Nats.ConnectionOptions, codec?: Nats.Codec ) { + return await this.connect({ + servers: [host], + ...options + }, codec); + } + + /** + * Try to connect to the NATS server with the different payloads. + * @param options to use, payload is omitted if sat in the AsyncAPI document. + */ + connect(options: Nats.ConnectionOptions, codec?: Nats.Codec): Promise<{nc: Nats.NatsConnection, js: Nats.JetStreamClient}> { + return new Promise(async (resolve, reject: (error: any) => void) => { + if (!this.isClosed()) { + return reject('Client is still connected, please close it first.'); + } + this.options = options; + if (codec) { + this.codec = codec; + } else { + this.codec = Nats.JSONCodec(); + } + try { + this.nc = await Nats.connect(this.options); + this.js = this.nc.jetstream(); + resolve({nc: this.nc, js: this.js}); + } catch (e: any) { + reject('Could not connect to NATS server'); + } + }) + } + ${natsFunctions.join("\n")} +}`; +} + +// src/codegen/generators/typescript/client/types.ts +init_dirname(); +init_buffer2(); +init_process2(); +var zodTypescriptClientGenerator = external_exports.object({ + id: external_exports.string().optional().default("client-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default(["channels-typescript"]), + preset: external_exports.literal("client").default("client"), + outputPath: external_exports.string().default("src/__gen__/clients"), + protocols: external_exports.array(external_exports.enum(["nats"])).default(["nats"]), + language: external_exports.literal("typescript").optional().default("typescript"), + channelsGeneratorId: external_exports.string().optional().describe( + "In case you have multiple TypeScript channels generators, you can specify which one to use as the dependency for this channels generator." + ).default("channels-typescript"), + importExtension: zodImportExtension.describe( + 'File extension for relative imports. Use ".ts" for moduleResolution: "node16"/"nodenext", ".js" for compiled ESM output.' + ) +}); +var defaultTypeScriptClientGenerator = zodTypescriptClientGenerator.parse({}); + +// src/codegen/generators/typescript/client/index.ts +async function generateTypeScriptClient(context2) { + const { asyncapiDocument, generator, inputType } = context2; + if (inputType === "asyncapi" && asyncapiDocument === void 0) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "client" + }); + } + const renderedProtocols = { + nats: "" + }; + const files = []; + for (const protocol of generator.protocols) { + switch (protocol) { + case "nats": { + const renderedResult = await generateNatsClient(context2); + const filePath = joinPath( + context2.generator.outputPath, + "NatsClient.ts" + ); + files.push({ path: filePath, content: renderedResult }); + renderedProtocols[protocol] = renderedResult; + break; + } + default: + break; + } + } + return { + protocolResult: renderedProtocols, + files + }; +} +function includeTypeScriptClientDependencies(config3, generator) { + const newGenerators = []; + const channelsGeneratorId = generator.channelsGeneratorId; + const hasChannelsGenerator = config3.generators.find( + (generatorSearch) => generatorSearch.id === channelsGeneratorId + ) !== void 0; + if (!hasChannelsGenerator) { + const defaultChannelPayloadGenerator = { + ...defaultTypeScriptChannelsGenerator, + protocols: generator.protocols, + outputPath: joinPath(generator.outputPath ?? "", "./channels") + }; + newGenerators.push(defaultChannelPayloadGenerator); + } + return newGenerators; +} + +// src/codegen/generators/typescript/types.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/asyncapi/generators/types.ts +init_dirname(); +init_buffer2(); +init_process2(); +async function generateAsyncAPITypes(asyncapiDocument, generator) { + const allChannels = asyncapiDocument.allChannels().all(); + const channelAddressUnion = allChannels.map((channel) => { + return `'${channel.address()}'`; + }).join(" | "); + let result2 = `export type Topics = ${channelAddressUnion}; +`; + if (!asyncapiDocument.version().startsWith("2.")) { + const channelIdUnion = allChannels.map((channel) => { + return `'${channel.id()}'`; + }).join(" | "); + const channelIdSwitch = allChannels.map((channel) => { + return `case '${channel.id()}': + return '${channel.address()}';`; + }).join("\n "); + const channelAddressSwitch = allChannels.map((channel) => { + return `case '${channel.address()}': + return '${channel.id()}';`; + }).join("\n "); + const topicIdsPart = `export type TopicIds = ${channelIdUnion}; +`; + const toTopicIdsPart = `export function ToTopicIds(topic: Topics): TopicIds { + switch (topic) { + ${channelAddressSwitch} + default: + throw new Error('Unknown topic: ' + topic); + } +} +`; + const toTopicsPart = `export function ToTopics(topicId: TopicIds): Topics { + switch (topicId) { + ${channelIdSwitch} + default: + throw new Error('Unknown topic ID: ' + topicId); + } +} +`; + const topicsMap = `export const TopicsMap: Record = { +${allChannels.map((channel) => { + return ` '${channel.id()}': '${channel.address()}'`; + }).join(", \n")} +}; +`; + result2 += topicIdsPart + toTopicIdsPart + toTopicsPart + topicsMap; + } + const filePath = `${generator.outputPath}/Types.ts`; + return { + result: result2, + files: [{ path: filePath, content: result2 }] + }; +} + +// src/codegen/inputs/openapi/generators/types.ts +init_dirname(); +init_buffer2(); +init_process2(); +async function generateOpenAPITypes(openapiDocument, generator) { + const paths = openapiDocument.paths ?? {}; + const allPaths = Object.keys(paths); + const pathsUnion = allPaths.map((pathStr) => { + return `'${pathStr}'`; + }).join(" | "); + let result2 = `export type Paths = ${pathsUnion}; +`; + const operationIds = []; + const operationIdToPathMap = {}; + const pathToOperationIdMap = {}; + for (const [pathStr, pathItem] of Object.entries(paths)) { + const pathOperationIds = []; + for (const [method2, operation] of Object.entries(pathItem)) { + const operationObj = operation; + if (operationObj && typeof operationObj === "object" && method2 !== "parameters") { + const operationId = operationObj.operationId ?? `${method2}${pathStr.replace(/[^a-zA-Z0-9]/g, "")}`; + operationIds.push(operationId); + operationIdToPathMap[operationId] = pathStr; + pathOperationIds.push(operationId); + } + } + if (pathOperationIds.length > 0) { + pathToOperationIdMap[pathStr] = pathOperationIds; + } + } + if (operationIds.length > 0) { + const operationIdsUnion = operationIds.map((id) => `'${id}'`).join(" | "); + result2 += `export type OperationIds = ${operationIdsUnion}; +`; + const operationIdToPathSwitch = Object.entries(operationIdToPathMap).map(([operationId, pathStr]) => { + return `case '${operationId}': + return '${pathStr}';`; + }).join("\n "); + const toPathPart = `export function ToPath(operationId: OperationIds): Paths { + switch (operationId) { + ${operationIdToPathSwitch} + default: + throw new Error('Unknown operation ID: ' + operationId); + } +} +`; + const pathToOperationIdSwitch = Object.entries(pathToOperationIdMap).map(([pathStr, operationIds2]) => { + const operationIdsArray = operationIds2.map((id) => `'${id}'`).join(", "); + return `case '${pathStr}': + return [${operationIdsArray}];`; + }).join("\n "); + const toOperationIdsPart = `export function ToOperationIds(path: Paths): OperationIds[] { + switch (path) { + ${pathToOperationIdSwitch} + default: + throw new Error('Unknown path: ' + path); + } +} +`; + const pathsMap = `export const PathsMap: Record = { +${Object.entries(operationIdToPathMap).map(([operationId, pathStr]) => { + return ` '${operationId}': '${pathStr}'`; + }).join(",\n")} +}; +`; + result2 += toPathPart + toOperationIdsPart + pathsMap; + } + const filePath = `${generator.outputPath}/Types.ts`; + return { + result: result2, + files: [{ path: filePath, content: result2 }] + }; +} + +// src/codegen/generators/typescript/types.ts +var zodTypescriptTypesGenerator = external_exports.object({ + id: external_exports.string().optional().default("types-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("types").default("types"), + outputPath: external_exports.string().default("src/__gen__"), + language: external_exports.literal("typescript").optional().default("typescript") +}); +var defaultTypeScriptTypesOptions = zodTypescriptTypesGenerator.parse({}); +async function generateTypescriptTypes(context2) { + const { asyncapiDocument, openapiDocument, inputType, generator } = context2; + let result2; + let files = []; + switch (inputType) { + case "asyncapi": + if (!asyncapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "asyncapi", + generatorPreset: "types" + }); + } + { + const asyncAPIResult = await generateAsyncAPITypes( + asyncapiDocument, + generator + ); + result2 = asyncAPIResult.result; + files = asyncAPIResult.files; + } + break; + case "openapi": + if (!openapiDocument) { + throw createMissingInputDocumentError({ + expectedType: "openapi", + generatorPreset: "types" + }); + } + { + const openAPIResult = await generateOpenAPITypes( + openapiDocument, + generator + ); + result2 = openAPIResult.result; + files = openAPIResult.files; + } + break; + default: + throw new Error(`Unsupported input type: ${inputType}`); + } + return { + result: result2, + generator, + files + }; +} + +// src/codegen/generators/typescript/models.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/modelina/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/modelina/types.ts +init_dirname(); +init_buffer2(); +init_process2(); +var zodTypeScriptModuleSystemType = external_exports.enum(["ESM", "CJS"]).describe( + "TypeScript module system type - ESM for ES modules or CJS for CommonJS modules" +); +var zodTypeScriptExportType = external_exports.enum(["named", "default"]).describe("TypeScript export type - named exports or default export"); +var zodIndentationConfig = external_exports.object({ + type: external_exports.enum(["spaces", "tabs"]).describe("Indentation type - spaces or tabs"), + size: external_exports.number().min(1).max(8).default(2).describe("Indentation size (1-8 characters)") +}).describe( + "Indentation configuration for generated code - type (spaces/tabs) and size (1-8)" +); +var zodTypeScriptDependencyManager = external_exports.object({ + dependencies: external_exports.array(external_exports.string()).optional().describe("Array of dependency names") +}).partial().describe( + "Modelina TypeScriptDependencyManager properties - manages imports and dependencies in generated TypeScript code. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/TypeScriptDependencyManager.ts" +); +var zodTypeScriptOptions = external_exports.object({ + // From CommonGeneratorOptions + indentation: zodIndentationConfig.optional().describe("Code indentation configuration"), + dependencyManager: zodTypeScriptDependencyManager.optional().describe("Dependency management configuration"), + // TypeScript-specific options + renderTypes: external_exports.boolean().optional().default(true).describe("Whether to render type definitions"), + modelType: external_exports.enum(["class", "interface"]).optional().default("class").describe("Generate classes or interfaces"), + enumType: external_exports.enum(["enum", "union"]).optional().default("enum").describe("Generate TypeScript enums or union types"), + mapType: external_exports.enum(["indexedObject", "map", "record"]).optional().default("record").describe("How to represent map/dictionary types"), + moduleSystem: zodTypeScriptModuleSystemType.optional().default("ESM").describe("Module system to use"), + useJavascriptReservedKeywords: external_exports.boolean().optional().default(false).describe("Allow JavaScript reserved keywords"), + rawPropertyNames: external_exports.boolean().optional().default(false).describe("Use raw property names without constraints"), + // Complex options - using any for practical reasons + typeMapping: external_exports.any().optional().describe("Custom type mappings (complex Modelina type)"), + constraints: external_exports.any().optional().describe("Naming and validation constraints (complex Modelina type)"), + presets: external_exports.any().optional().default([]), + defaultPreset: external_exports.any().optional().describe("Default preset configuration"), + processorOptions: external_exports.any().optional().describe("Schema processing options (complex Modelina type)") +}).partial().describe( + "Modelina TypeScriptOptions interface - configures TypeScript code generation including model types, enums, modules, and constraints. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/TypeScriptGenerator.ts" +); +var zodTypeScriptRenderer = external_exports.object({ + // Essential renderer properties + dependencyManager: zodTypeScriptDependencyManager.optional().describe("Manages imports and dependencies"), + // Common renderer methods + renderComments: external_exports.function().optional().describe("Render JSDoc-style comments"), + renderLine: external_exports.function().optional().describe("Render a single line with indentation"), + renderBlock: external_exports.function().optional().describe("Render multiple lines as a block"), + indent: external_exports.function().optional().describe("Add indentation to content"), + runSelfPreset: external_exports.function().optional().describe("Execute preset functions for current model"), + runAdditionalContentPreset: external_exports.function().optional().describe("Execute additional content presets"), + runPreset: external_exports.function().optional().describe("Execute specific preset function"), + // Complex internal properties + options: zodTypeScriptOptions.optional().describe("Generator options configuration"), + generator: external_exports.any().optional().describe("TypeScriptGenerator instance (complex Modelina type)"), + presets: external_exports.any().optional().describe("Array of active presets"), + model: external_exports.any().optional().describe("Current ConstrainedMetaModel being rendered"), + inputModel: external_exports.any().optional().describe("Original InputMetaModel (complex Modelina type)") +}).partial().describe( + "Modelina TypeScriptRenderer properties - provides rendering methods for TypeScript code generation within preset functions. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/TypeScriptRenderer.ts" +); +var zodConstrainedMetaModel = external_exports.object({ + // Common properties + originalInput: external_exports.any().optional().describe("Original input that created this model"), + type: external_exports.string().optional().describe("Model type (object, string, enum, etc.)"), + name: external_exports.string().optional().describe("Constrained name of the model"), + // For object models + properties: external_exports.record(external_exports.any()).optional().describe("Object model properties"), + // For enum models + values: external_exports.array(external_exports.any()).optional().describe("Enum values"), + // Complex properties + options: external_exports.any().optional().describe("Model-specific options"), + constraints: external_exports.any().optional().describe("Applied constraints and transformations") +}).partial().describe( + "Modelina ConstrainedMetaModel properties - represents a processed schema model with applied constraints and transformations. See: https://github.com/asyncapi/modelina/blob/master/src/models/ConstrainedMetaModel.ts and https://github.com/asyncapi/modelina/blob/master/docs/internal-model.md" +); +var zodPresetFunctionArgs = external_exports.object({ + content: external_exports.string().describe("Current generated content"), + model: zodConstrainedMetaModel.describe( + "ConstrainedMetaModel being processed" + ), + renderer: zodTypeScriptRenderer.describe( + "TypeScriptRenderer instance with helper methods" + ), + options: zodTypeScriptOptions.optional().describe("TypeScriptOptions configuration object") +}).describe( + "Standard parameters passed to Modelina preset functions - content (current code), model (schema model), renderer (helper methods), and options (generator config). See: https://github.com/asyncapi/modelina/blob/master/docs/presets.md" +); +var zodClassPreset = external_exports.object({ + self: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional().describe("Customize entire class rendering"), + ctor: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional().describe("Customize class constructor"), + property: external_exports.function().args( + zodPresetFunctionArgs.extend({ + property: external_exports.any().describe("ConstrainedObjectPropertyModel being rendered") + }) + ).returns(external_exports.string()).optional().describe("Customize individual property rendering"), + getter: external_exports.function().args( + zodPresetFunctionArgs.extend({ + property: external_exports.any().describe("ConstrainedObjectPropertyModel for getter") + }) + ).returns(external_exports.string()).optional().describe("Customize property getter methods"), + setter: external_exports.function().args( + zodPresetFunctionArgs.extend({ + property: external_exports.any().describe("ConstrainedObjectPropertyModel for setter") + }) + ).returns(external_exports.string()).optional().describe("Customize property setter methods"), + additionalContent: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional().describe("Add custom methods or content to class") +}).partial().describe( + "Modelina TypeScript class preset methods - customize class generation including self, constructor, properties, getters, setters, and additional content. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/renderers/ClassRenderer.ts" +); +var zodInterfacePreset = external_exports.object({ + self: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional(), + property: external_exports.function().args( + zodPresetFunctionArgs.extend({ + property: external_exports.any() + // ConstrainedObjectPropertyModel + }) + ).returns(external_exports.string()).optional(), + additionalContent: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional() +}).partial().describe( + "Modelina TypeScript interface preset methods - customize interface generation including self, properties, and additional content. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/renderers/InterfaceRenderer.ts" +); +var zodEnumPreset = external_exports.object({ + self: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional(), + item: external_exports.function().args( + zodPresetFunctionArgs.extend({ + item: external_exports.any() + // ConstrainedEnumValueModel + }) + ).returns(external_exports.string()).optional() +}).partial().describe( + "Modelina TypeScript enum preset methods - customize enum generation including self and individual enum items. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/renderers/EnumRenderer.ts" +); +var zodTypePreset = external_exports.object({ + self: external_exports.function().args(zodPresetFunctionArgs).returns(external_exports.string()).optional() +}).partial().describe( + "Modelina TypeScript type preset methods - customize type alias generation. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/renderers/TypeRenderer.ts" +); +var zodTypeScriptPreset = external_exports.object({ + class: zodClassPreset.optional(), + interface: zodInterfacePreset.optional(), + enum: zodEnumPreset.optional(), + type: zodTypePreset.optional() +}).partial().describe( + "Complete Modelina TypeScript preset object containing class, interface, enum, and type preset methods. See: https://github.com/asyncapi/modelina/blob/master/src/generators/typescript/TypeScriptPreset.ts" +); +var zodPresetWithOptions = external_exports.object({ + preset: zodTypeScriptPreset, + options: external_exports.record(external_exports.any()).optional() +}).describe( + "Modelina preset with options pattern - combines a preset object with custom options for reusable presets like TS_COMMON_PRESET" +); +var zodPresetItem = external_exports.union([zodTypeScriptPreset, zodPresetWithOptions]).describe( + "Modelina preset array item - can be either a direct preset object or a preset with options" +); +var zodTypeScriptPresets = external_exports.array(zodPresetItem).describe( + "Array of Modelina TypeScript presets passed to TypeScriptFileGenerator - middleware for customizing code generation" +).default([]); + +// src/codegen/generators/typescript/models.ts +var zodTypescriptModelsGenerator = external_exports.object({ + id: external_exports.string().optional().default("models-typescript"), + dependencies: external_exports.array(external_exports.string()).optional().default([]), + preset: external_exports.literal("models").default("models"), + renderers: zodTypeScriptPresets, + options: zodTypeScriptOptions.optional(), + outputPath: external_exports.string().optional().default("src/__gen__/models"), + language: external_exports.literal("typescript").optional().default("typescript") +}); +var defaultTypeScriptModelsOptions = zodTypescriptModelsGenerator.parse({}); +async function generateTypescriptModels(context2) { + const { generator, asyncapiDocument, openapiDocument, jsonSchemaDocument } = context2; + const modelGenerator = new TypeScriptFileGenerator({ + ...generator.options, + presets: generator.renderers + }); + const inputDocument = asyncapiDocument ?? openapiDocument ?? jsonSchemaDocument; + if (!inputDocument) { + throw new CodegenError({ + type: "MISSING_INPUT_DOCUMENT" /* MISSING_INPUT_DOCUMENT */, + message: "No input document provided for models generation", + help: `Ensure your configuration specifies 'inputPath' pointing to a valid AsyncAPI, OpenAPI, or JSON Schema document. + +For more information: https://the-codegen-project.org/docs/configurations` + }); + } + const result2 = await generateModels({ + generator: modelGenerator, + input: inputDocument, + outputPath: generator.outputPath + }); + return { + generator, + files: result2.files + }; +} + +// src/codegen/types.ts +var zodAsyncAPITypeScriptGenerators = external_exports.discriminatedUnion("preset", [ + zodTypeScriptPayloadGenerator, + zodTypescriptParametersGenerator, + zodTypescriptChannelsGenerator, + zodTypescriptClientGenerator, + zodTypescriptHeadersGenerator, + zodTypescriptTypesGenerator, + zodTypescriptModelsGenerator, + zodCustomGenerator +]); +var zodAsyncAPIGenerators = external_exports.union([ + ...zodAsyncAPITypeScriptGenerators.options +]); +var zodOpenAPITypeScriptGenerators = external_exports.discriminatedUnion("preset", [ + zodTypeScriptPayloadGenerator, + zodTypescriptParametersGenerator, + zodTypescriptHeadersGenerator, + zodTypescriptTypesGenerator, + zodTypescriptChannelsGenerator, + zodTypescriptModelsGenerator, + zodCustomGenerator +]); +var zodOpenAPIGenerators = external_exports.union([ + ...zodOpenAPITypeScriptGenerators.options +]); +var zodJsonSchemaTypeScriptGenerators = external_exports.discriminatedUnion( + "preset", + [zodTypescriptModelsGenerator, zodCustomGenerator] +); +var zodJsonSchemaGenerators = external_exports.union([ + ...zodJsonSchemaTypeScriptGenerators.options +]); +var SCHEMA_DESCRIPTION = "For JSON and YAML configuration files this is used to force the IDE to enable auto completion and validation features"; +var LANGUAGE_DESCRIPTION = "Set the global language for all generators, either one needs to be set"; +var DOCUMENT_TYPE_DESCRIPTION = "The type of document"; +var zodProjectTelemetryConfig = external_exports.object({ + enabled: external_exports.boolean().optional().describe( + "Enable or disable telemetry for this project (overrides global setting)" + ), + endpoint: external_exports.string().optional().describe("Custom telemetry endpoint (overrides global setting)"), + trackingId: external_exports.string().optional().describe("Custom tracking ID (overrides global setting)") +}).optional().describe( + "Project-level telemetry configuration (overrides global settings in ~/.the-codegen-project/config.json)" +); +var zodTypeScriptConfigOptions = { + language: external_exports.literal("typescript").optional().describe(LANGUAGE_DESCRIPTION), + importExtension: zodImportExtension +}; +var zodAsyncAPITypescriptConfig = external_exports.object({ + $schema: external_exports.string().optional().describe(SCHEMA_DESCRIPTION), + inputType: external_exports.literal("asyncapi").describe(DOCUMENT_TYPE_DESCRIPTION), + inputPath: external_exports.string().describe("The path to the input document"), + ...zodTypeScriptConfigOptions, + generators: external_exports.array(zodAsyncAPITypeScriptGenerators), + telemetry: zodProjectTelemetryConfig +}); +var zodAsyncAPICodegenConfiguration = zodAsyncAPITypescriptConfig; +var zodOpenAPITypescriptConfig = external_exports.object({ + $schema: external_exports.string().optional().describe(SCHEMA_DESCRIPTION), + inputType: external_exports.literal("openapi").describe(DOCUMENT_TYPE_DESCRIPTION), + inputPath: external_exports.string().describe("The path to the input document "), + ...zodTypeScriptConfigOptions, + generators: external_exports.array(zodOpenAPITypeScriptGenerators), + telemetry: zodProjectTelemetryConfig +}); +var zodOpenAPICodegenConfiguration = zodOpenAPITypescriptConfig; +var zodJsonSchemaTypescriptConfig = external_exports.object({ + $schema: external_exports.string().optional().describe(SCHEMA_DESCRIPTION), + inputType: external_exports.literal("jsonschema").describe(DOCUMENT_TYPE_DESCRIPTION), + inputPath: external_exports.string().describe("The path to the JSON Schema document"), + ...zodTypeScriptConfigOptions, + generators: external_exports.array(zodJsonSchemaTypeScriptGenerators), + telemetry: zodProjectTelemetryConfig +}); +var zodJsonSchemaCodegenConfiguration = zodJsonSchemaTypescriptConfig; +var zodTheCodegenConfiguration = external_exports.discriminatedUnion("inputType", [ + zodAsyncAPICodegenConfiguration, + zodOpenAPICodegenConfiguration, + zodJsonSchemaCodegenConfiguration +]); + +// src/codegen/configurations.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/generators/typescript/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/renderer.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_path(); + +// node_modules/graphology/dist/graphology.mjs +init_dirname(); +init_buffer2(); +init_process2(); +init_events(); +function assignPolyfill() { + const target = arguments[0]; + for (let i7 = 1, l7 = arguments.length; i7 < l7; i7++) { + if (!arguments[i7]) + continue; + for (const k6 in arguments[i7]) + target[k6] = arguments[i7][k6]; + } + return target; +} +var assign2 = assignPolyfill; +if (typeof Object.assign === "function") + assign2 = Object.assign; +function getMatchingEdge(graph, source, target, type3) { + const sourceData = graph._nodes.get(source); + let edge = null; + if (!sourceData) + return edge; + if (type3 === "mixed") { + edge = sourceData.out && sourceData.out[target] || sourceData.undirected && sourceData.undirected[target]; + } else if (type3 === "directed") { + edge = sourceData.out && sourceData.out[target]; + } else { + edge = sourceData.undirected && sourceData.undirected[target]; + } + return edge; +} +function isPlainObject2(value2) { + return typeof value2 === "object" && value2 !== null; +} +function isEmpty3(o7) { + let k6; + for (k6 in o7) + return false; + return true; +} +function privateProperty(target, name2, value2) { + Object.defineProperty(target, name2, { + enumerable: false, + configurable: false, + writable: true, + value: value2 + }); +} +function readOnlyProperty(target, name2, value2) { + const descriptor = { + enumerable: true, + configurable: true + }; + if (typeof value2 === "function") { + descriptor.get = value2; + } else { + descriptor.value = value2; + descriptor.writable = false; + } + Object.defineProperty(target, name2, descriptor); +} +function validateHints(hints) { + if (!isPlainObject2(hints)) + return false; + if (hints.attributes && !Array.isArray(hints.attributes)) + return false; + return true; +} +function incrementalIdStartingFromRandomByte() { + let i7 = Math.floor(Math.random() * 256) & 255; + return () => { + return i7++; + }; +} +function chain2() { + const iterables = arguments; + let current = null; + let i7 = -1; + return { + [Symbol.iterator]() { + return this; + }, + next() { + let step = null; + do { + if (current === null) { + i7++; + if (i7 >= iterables.length) + return { done: true }; + current = iterables[i7][Symbol.iterator](); + } + step = current.next(); + if (step.done) { + current = null; + continue; + } + break; + } while (true); + return step; + } + }; +} +function emptyIterator() { + return { + [Symbol.iterator]() { + return this; + }, + next() { + return { done: true }; + } + }; +} +var GraphError = class extends Error { + constructor(message) { + super(); + this.name = "GraphError"; + this.message = message; + } +}; +var InvalidArgumentsGraphError = class _InvalidArgumentsGraphError extends GraphError { + constructor(message) { + super(message); + this.name = "InvalidArgumentsGraphError"; + if (typeof Error.captureStackTrace === "function") + Error.captureStackTrace( + this, + _InvalidArgumentsGraphError.prototype.constructor + ); + } +}; +var NotFoundGraphError = class _NotFoundGraphError extends GraphError { + constructor(message) { + super(message); + this.name = "NotFoundGraphError"; + if (typeof Error.captureStackTrace === "function") + Error.captureStackTrace(this, _NotFoundGraphError.prototype.constructor); + } +}; +var UsageGraphError = class _UsageGraphError extends GraphError { + constructor(message) { + super(message); + this.name = "UsageGraphError"; + if (typeof Error.captureStackTrace === "function") + Error.captureStackTrace(this, _UsageGraphError.prototype.constructor); + } +}; +function MixedNodeData(key, attributes) { + this.key = key; + this.attributes = attributes; + this.clear(); +} +MixedNodeData.prototype.clear = function() { + this.inDegree = 0; + this.outDegree = 0; + this.undirectedDegree = 0; + this.undirectedLoops = 0; + this.directedLoops = 0; + this.in = {}; + this.out = {}; + this.undirected = {}; +}; +function DirectedNodeData(key, attributes) { + this.key = key; + this.attributes = attributes; + this.clear(); +} +DirectedNodeData.prototype.clear = function() { + this.inDegree = 0; + this.outDegree = 0; + this.directedLoops = 0; + this.in = {}; + this.out = {}; +}; +function UndirectedNodeData(key, attributes) { + this.key = key; + this.attributes = attributes; + this.clear(); +} +UndirectedNodeData.prototype.clear = function() { + this.undirectedDegree = 0; + this.undirectedLoops = 0; + this.undirected = {}; +}; +function EdgeData(undirected, key, source, target, attributes) { + this.key = key; + this.attributes = attributes; + this.undirected = undirected; + this.source = source; + this.target = target; +} +EdgeData.prototype.attach = function() { + let outKey = "out"; + let inKey = "in"; + if (this.undirected) + outKey = inKey = "undirected"; + const source = this.source.key; + const target = this.target.key; + this.source[outKey][target] = this; + if (this.undirected && source === target) + return; + this.target[inKey][source] = this; +}; +EdgeData.prototype.attachMulti = function() { + let outKey = "out"; + let inKey = "in"; + const source = this.source.key; + const target = this.target.key; + if (this.undirected) + outKey = inKey = "undirected"; + const adj = this.source[outKey]; + const head2 = adj[target]; + if (typeof head2 === "undefined") { + adj[target] = this; + if (!(this.undirected && source === target)) { + this.target[inKey][source] = this; + } + return; + } + head2.previous = this; + this.next = head2; + adj[target] = this; + this.target[inKey][source] = this; +}; +EdgeData.prototype.detach = function() { + const source = this.source.key; + const target = this.target.key; + let outKey = "out"; + let inKey = "in"; + if (this.undirected) + outKey = inKey = "undirected"; + delete this.source[outKey][target]; + delete this.target[inKey][source]; +}; +EdgeData.prototype.detachMulti = function() { + const source = this.source.key; + const target = this.target.key; + let outKey = "out"; + let inKey = "in"; + if (this.undirected) + outKey = inKey = "undirected"; + if (this.previous === void 0) { + if (this.next === void 0) { + delete this.source[outKey][target]; + delete this.target[inKey][source]; + } else { + this.next.previous = void 0; + this.source[outKey][target] = this.next; + this.target[inKey][source] = this.next; + } + } else { + this.previous.next = this.next; + if (this.next !== void 0) { + this.next.previous = this.previous; + } + } +}; +var NODE = 0; +var SOURCE = 1; +var TARGET = 2; +var OPPOSITE = 3; +function findRelevantNodeData(graph, method2, mode, nodeOrEdge, nameOrEdge, add1, add2) { + let nodeData, edgeData, arg1, arg2; + nodeOrEdge = "" + nodeOrEdge; + if (mode === NODE) { + nodeData = graph._nodes.get(nodeOrEdge); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${nodeOrEdge}" node in the graph.` + ); + arg1 = nameOrEdge; + arg2 = add1; + } else if (mode === OPPOSITE) { + nameOrEdge = "" + nameOrEdge; + edgeData = graph._edges.get(nameOrEdge); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${nameOrEdge}" edge in the graph.` + ); + const source = edgeData.source.key; + const target = edgeData.target.key; + if (nodeOrEdge === source) { + nodeData = edgeData.target; + } else if (nodeOrEdge === target) { + nodeData = edgeData.source; + } else { + throw new NotFoundGraphError( + `Graph.${method2}: the "${nodeOrEdge}" node is not attached to the "${nameOrEdge}" edge (${source}, ${target}).` + ); + } + arg1 = add1; + arg2 = add2; + } else { + edgeData = graph._edges.get(nodeOrEdge); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${nodeOrEdge}" edge in the graph.` + ); + if (mode === SOURCE) { + nodeData = edgeData.source; + } else { + nodeData = edgeData.target; + } + arg1 = nameOrEdge; + arg2 = add1; + } + return [nodeData, arg1, arg2]; +} +function attachNodeAttributeGetter(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, name2] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + return data.attributes[name2]; + }; +} +function attachNodeAttributesGetter(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge) { + const [data] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge + ); + return data.attributes; + }; +} +function attachNodeAttributeChecker(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, name2] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + return data.attributes.hasOwnProperty(name2); + }; +} +function attachNodeAttributeSetter(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1, add2) { + const [data, name2, value2] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1, + add2 + ); + data.attributes[name2] = value2; + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "set", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachNodeAttributeUpdater(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1, add2) { + const [data, name2, updater] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1, + add2 + ); + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + `Graph.${method2}: updater should be a function.` + ); + const attributes = data.attributes; + const value2 = updater(attributes[name2]); + attributes[name2] = value2; + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "set", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachNodeAttributeRemover(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, name2] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + delete data.attributes[name2]; + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "remove", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachNodeAttributesReplacer(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, attributes] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided attributes are not a plain object.` + ); + data.attributes = attributes; + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "replace", + attributes: data.attributes + }); + return this; + }; +} +function attachNodeAttributesMerger(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, attributes] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided attributes are not a plain object.` + ); + assign2(data.attributes, attributes); + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "merge", + attributes: data.attributes, + data: attributes + }); + return this; + }; +} +function attachNodeAttributesUpdater(Class, method2, mode) { + Class.prototype[method2] = function(nodeOrEdge, nameOrEdge, add1) { + const [data, updater] = findRelevantNodeData( + this, + method2, + mode, + nodeOrEdge, + nameOrEdge, + add1 + ); + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided updater is not a function.` + ); + data.attributes = updater(data.attributes); + this.emit("nodeAttributesUpdated", { + key: data.key, + type: "update", + attributes: data.attributes + }); + return this; + }; +} +var NODE_ATTRIBUTES_METHODS = [ + { + name: (element) => `get${element}Attribute`, + attacher: attachNodeAttributeGetter + }, + { + name: (element) => `get${element}Attributes`, + attacher: attachNodeAttributesGetter + }, + { + name: (element) => `has${element}Attribute`, + attacher: attachNodeAttributeChecker + }, + { + name: (element) => `set${element}Attribute`, + attacher: attachNodeAttributeSetter + }, + { + name: (element) => `update${element}Attribute`, + attacher: attachNodeAttributeUpdater + }, + { + name: (element) => `remove${element}Attribute`, + attacher: attachNodeAttributeRemover + }, + { + name: (element) => `replace${element}Attributes`, + attacher: attachNodeAttributesReplacer + }, + { + name: (element) => `merge${element}Attributes`, + attacher: attachNodeAttributesMerger + }, + { + name: (element) => `update${element}Attributes`, + attacher: attachNodeAttributesUpdater + } +]; +function attachNodeAttributesMethods(Graph2) { + NODE_ATTRIBUTES_METHODS.forEach(function({ name: name2, attacher }) { + attacher(Graph2, name2("Node"), NODE); + attacher(Graph2, name2("Source"), SOURCE); + attacher(Graph2, name2("Target"), TARGET); + attacher(Graph2, name2("Opposite"), OPPOSITE); + }); +} +function attachEdgeAttributeGetter(Class, method2, type3) { + Class.prototype[method2] = function(element, name2) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element; + const target = "" + name2; + name2 = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + return data.attributes[name2]; + }; +} +function attachEdgeAttributesGetter(Class, method2, type3) { + Class.prototype[method2] = function(element) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 1) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element, target = "" + arguments[1]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + return data.attributes; + }; +} +function attachEdgeAttributeChecker(Class, method2, type3) { + Class.prototype[method2] = function(element, name2) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element; + const target = "" + name2; + name2 = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + return data.attributes.hasOwnProperty(name2); + }; +} +function attachEdgeAttributeSetter(Class, method2, type3) { + Class.prototype[method2] = function(element, name2, value2) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 3) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element; + const target = "" + name2; + name2 = arguments[2]; + value2 = arguments[3]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + data.attributes[name2] = value2; + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "set", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachEdgeAttributeUpdater(Class, method2, type3) { + Class.prototype[method2] = function(element, name2, updater) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 3) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element; + const target = "" + name2; + name2 = arguments[2]; + updater = arguments[3]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + `Graph.${method2}: updater should be a function.` + ); + data.attributes[name2] = updater(data.attributes[name2]); + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "set", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachEdgeAttributeRemover(Class, method2, type3) { + Class.prototype[method2] = function(element, name2) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element; + const target = "" + name2; + name2 = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + delete data.attributes[name2]; + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "remove", + attributes: data.attributes, + name: name2 + }); + return this; + }; +} +function attachEdgeAttributesReplacer(Class, method2, type3) { + Class.prototype[method2] = function(element, attributes) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element, target = "" + attributes; + attributes = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided attributes are not a plain object.` + ); + data.attributes = attributes; + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "replace", + attributes: data.attributes + }); + return this; + }; +} +function attachEdgeAttributesMerger(Class, method2, type3) { + Class.prototype[method2] = function(element, attributes) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element, target = "" + attributes; + attributes = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided attributes are not a plain object.` + ); + assign2(data.attributes, attributes); + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "merge", + attributes: data.attributes, + data: attributes + }); + return this; + }; +} +function attachEdgeAttributesUpdater(Class, method2, type3) { + Class.prototype[method2] = function(element, updater) { + let data; + if (this.type !== "mixed" && type3 !== "mixed" && type3 !== this.type) + throw new UsageGraphError( + `Graph.${method2}: cannot find this type of edges in your ${this.type} graph.` + ); + if (arguments.length > 2) { + if (this.multi) + throw new UsageGraphError( + `Graph.${method2}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.` + ); + const source = "" + element, target = "" + updater; + updater = arguments[2]; + data = getMatchingEdge(this, source, target, type3); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find an edge for the given path ("${source}" - "${target}").` + ); + } else { + if (type3 !== "mixed") + throw new UsageGraphError( + `Graph.${method2}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.` + ); + element = "" + element; + data = this._edges.get(element); + if (!data) + throw new NotFoundGraphError( + `Graph.${method2}: could not find the "${element}" edge in the graph.` + ); + } + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + `Graph.${method2}: provided updater is not a function.` + ); + data.attributes = updater(data.attributes); + this.emit("edgeAttributesUpdated", { + key: data.key, + type: "update", + attributes: data.attributes + }); + return this; + }; +} +var EDGE_ATTRIBUTES_METHODS = [ + { + name: (element) => `get${element}Attribute`, + attacher: attachEdgeAttributeGetter + }, + { + name: (element) => `get${element}Attributes`, + attacher: attachEdgeAttributesGetter + }, + { + name: (element) => `has${element}Attribute`, + attacher: attachEdgeAttributeChecker + }, + { + name: (element) => `set${element}Attribute`, + attacher: attachEdgeAttributeSetter + }, + { + name: (element) => `update${element}Attribute`, + attacher: attachEdgeAttributeUpdater + }, + { + name: (element) => `remove${element}Attribute`, + attacher: attachEdgeAttributeRemover + }, + { + name: (element) => `replace${element}Attributes`, + attacher: attachEdgeAttributesReplacer + }, + { + name: (element) => `merge${element}Attributes`, + attacher: attachEdgeAttributesMerger + }, + { + name: (element) => `update${element}Attributes`, + attacher: attachEdgeAttributesUpdater + } +]; +function attachEdgeAttributesMethods(Graph2) { + EDGE_ATTRIBUTES_METHODS.forEach(function({ name: name2, attacher }) { + attacher(Graph2, name2("Edge"), "mixed"); + attacher(Graph2, name2("DirectedEdge"), "directed"); + attacher(Graph2, name2("UndirectedEdge"), "undirected"); + }); +} +var EDGES_ITERATION = [ + { + name: "edges", + type: "mixed" + }, + { + name: "inEdges", + type: "directed", + direction: "in" + }, + { + name: "outEdges", + type: "directed", + direction: "out" + }, + { + name: "inboundEdges", + type: "mixed", + direction: "in" + }, + { + name: "outboundEdges", + type: "mixed", + direction: "out" + }, + { + name: "directedEdges", + type: "directed" + }, + { + name: "undirectedEdges", + type: "undirected" + } +]; +function forEachSimple(breakable, object, callback, avoid) { + let shouldBreak = false; + for (const k6 in object) { + if (k6 === avoid) + continue; + const edgeData = object[k6]; + shouldBreak = callback( + edgeData.key, + edgeData.attributes, + edgeData.source.key, + edgeData.target.key, + edgeData.source.attributes, + edgeData.target.attributes, + edgeData.undirected + ); + if (breakable && shouldBreak) + return edgeData.key; + } + return; +} +function forEachMulti(breakable, object, callback, avoid) { + let edgeData, source, target; + let shouldBreak = false; + for (const k6 in object) { + if (k6 === avoid) + continue; + edgeData = object[k6]; + do { + source = edgeData.source; + target = edgeData.target; + shouldBreak = callback( + edgeData.key, + edgeData.attributes, + source.key, + target.key, + source.attributes, + target.attributes, + edgeData.undirected + ); + if (breakable && shouldBreak) + return edgeData.key; + edgeData = edgeData.next; + } while (edgeData !== void 0); + } + return; +} +function createIterator(object, avoid) { + const keys2 = Object.keys(object); + const l7 = keys2.length; + let edgeData; + let i7 = 0; + return { + [Symbol.iterator]() { + return this; + }, + next() { + do { + if (!edgeData) { + if (i7 >= l7) + return { done: true }; + const k6 = keys2[i7++]; + if (k6 === avoid) { + edgeData = void 0; + continue; + } + edgeData = object[k6]; + } else { + edgeData = edgeData.next; + } + } while (!edgeData); + return { + done: false, + value: { + edge: edgeData.key, + attributes: edgeData.attributes, + source: edgeData.source.key, + target: edgeData.target.key, + sourceAttributes: edgeData.source.attributes, + targetAttributes: edgeData.target.attributes, + undirected: edgeData.undirected + } + }; + } + }; +} +function forEachForKeySimple(breakable, object, k6, callback) { + const edgeData = object[k6]; + if (!edgeData) + return; + const sourceData = edgeData.source; + const targetData = edgeData.target; + if (callback( + edgeData.key, + edgeData.attributes, + sourceData.key, + targetData.key, + sourceData.attributes, + targetData.attributes, + edgeData.undirected + ) && breakable) + return edgeData.key; +} +function forEachForKeyMulti(breakable, object, k6, callback) { + let edgeData = object[k6]; + if (!edgeData) + return; + let shouldBreak = false; + do { + shouldBreak = callback( + edgeData.key, + edgeData.attributes, + edgeData.source.key, + edgeData.target.key, + edgeData.source.attributes, + edgeData.target.attributes, + edgeData.undirected + ); + if (breakable && shouldBreak) + return edgeData.key; + edgeData = edgeData.next; + } while (edgeData !== void 0); + return; +} +function createIteratorForKey(object, k6) { + let edgeData = object[k6]; + if (edgeData.next !== void 0) { + return { + [Symbol.iterator]() { + return this; + }, + next() { + if (!edgeData) + return { done: true }; + const value2 = { + edge: edgeData.key, + attributes: edgeData.attributes, + source: edgeData.source.key, + target: edgeData.target.key, + sourceAttributes: edgeData.source.attributes, + targetAttributes: edgeData.target.attributes, + undirected: edgeData.undirected + }; + edgeData = edgeData.next; + return { + done: false, + value: value2 + }; + } + }; + } + let done = false; + return { + [Symbol.iterator]() { + return this; + }, + next() { + if (done === true) + return { done: true }; + done = true; + return { + done: false, + value: { + edge: edgeData.key, + attributes: edgeData.attributes, + source: edgeData.source.key, + target: edgeData.target.key, + sourceAttributes: edgeData.source.attributes, + targetAttributes: edgeData.target.attributes, + undirected: edgeData.undirected + } + }; + } + }; +} +function createEdgeArray(graph, type3) { + if (graph.size === 0) + return []; + if (type3 === "mixed" || type3 === graph.type) { + return Array.from(graph._edges.keys()); + } + const size2 = type3 === "undirected" ? graph.undirectedSize : graph.directedSize; + const list = new Array(size2), mask = type3 === "undirected"; + const iterator = graph._edges.values(); + let i7 = 0; + let step, data; + while (step = iterator.next(), step.done !== true) { + data = step.value; + if (data.undirected === mask) + list[i7++] = data.key; + } + return list; +} +function forEachEdge(breakable, graph, type3, callback) { + if (graph.size === 0) + return; + const shouldFilter = type3 !== "mixed" && type3 !== graph.type; + const mask = type3 === "undirected"; + let step, data; + let shouldBreak = false; + const iterator = graph._edges.values(); + while (step = iterator.next(), step.done !== true) { + data = step.value; + if (shouldFilter && data.undirected !== mask) + continue; + const { key, attributes, source, target } = data; + shouldBreak = callback( + key, + attributes, + source.key, + target.key, + source.attributes, + target.attributes, + data.undirected + ); + if (breakable && shouldBreak) + return key; + } + return; +} +function createEdgeIterator(graph, type3) { + if (graph.size === 0) + return emptyIterator(); + const shouldFilter = type3 !== "mixed" && type3 !== graph.type; + const mask = type3 === "undirected"; + const iterator = graph._edges.values(); + return { + [Symbol.iterator]() { + return this; + }, + next() { + let step, data; + while (true) { + step = iterator.next(); + if (step.done) + return step; + data = step.value; + if (shouldFilter && data.undirected !== mask) + continue; + break; + } + const value2 = { + edge: data.key, + attributes: data.attributes, + source: data.source.key, + target: data.target.key, + sourceAttributes: data.source.attributes, + targetAttributes: data.target.attributes, + undirected: data.undirected + }; + return { value: value2, done: false }; + } + }; +} +function forEachEdgeForNode(breakable, multi, type3, direction, nodeData, callback) { + const fn = multi ? forEachMulti : forEachSimple; + let found; + if (type3 !== "undirected") { + if (direction !== "out") { + found = fn(breakable, nodeData.in, callback); + if (breakable && found) + return found; + } + if (direction !== "in") { + found = fn( + breakable, + nodeData.out, + callback, + !direction ? nodeData.key : void 0 + ); + if (breakable && found) + return found; + } + } + if (type3 !== "directed") { + found = fn(breakable, nodeData.undirected, callback); + if (breakable && found) + return found; + } + return; +} +function createEdgeArrayForNode(multi, type3, direction, nodeData) { + const edges = []; + forEachEdgeForNode(false, multi, type3, direction, nodeData, function(key) { + edges.push(key); + }); + return edges; +} +function createEdgeIteratorForNode(type3, direction, nodeData) { + let iterator = emptyIterator(); + if (type3 !== "undirected") { + if (direction !== "out" && typeof nodeData.in !== "undefined") + iterator = chain2(iterator, createIterator(nodeData.in)); + if (direction !== "in" && typeof nodeData.out !== "undefined") + iterator = chain2( + iterator, + createIterator(nodeData.out, !direction ? nodeData.key : void 0) + ); + } + if (type3 !== "directed" && typeof nodeData.undirected !== "undefined") { + iterator = chain2(iterator, createIterator(nodeData.undirected)); + } + return iterator; +} +function forEachEdgeForPath(breakable, type3, multi, direction, sourceData, target, callback) { + const fn = multi ? forEachForKeyMulti : forEachForKeySimple; + let found; + if (type3 !== "undirected") { + if (typeof sourceData.in !== "undefined" && direction !== "out") { + found = fn(breakable, sourceData.in, target, callback); + if (breakable && found) + return found; + } + if (typeof sourceData.out !== "undefined" && direction !== "in" && (direction || sourceData.key !== target)) { + found = fn(breakable, sourceData.out, target, callback); + if (breakable && found) + return found; + } + } + if (type3 !== "directed") { + if (typeof sourceData.undirected !== "undefined") { + found = fn(breakable, sourceData.undirected, target, callback); + if (breakable && found) + return found; + } + } + return; +} +function createEdgeArrayForPath(type3, multi, direction, sourceData, target) { + const edges = []; + forEachEdgeForPath( + false, + type3, + multi, + direction, + sourceData, + target, + function(key) { + edges.push(key); + } + ); + return edges; +} +function createEdgeIteratorForPath(type3, direction, sourceData, target) { + let iterator = emptyIterator(); + if (type3 !== "undirected") { + if (typeof sourceData.in !== "undefined" && direction !== "out" && target in sourceData.in) + iterator = chain2(iterator, createIteratorForKey(sourceData.in, target)); + if (typeof sourceData.out !== "undefined" && direction !== "in" && target in sourceData.out && (direction || sourceData.key !== target)) + iterator = chain2(iterator, createIteratorForKey(sourceData.out, target)); + } + if (type3 !== "directed") { + if (typeof sourceData.undirected !== "undefined" && target in sourceData.undirected) + iterator = chain2( + iterator, + createIteratorForKey(sourceData.undirected, target) + ); + } + return iterator; +} +function attachEdgeArrayCreator(Class, description7) { + const { name: name2, type: type3, direction } = description7; + Class.prototype[name2] = function(source, target) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return []; + if (!arguments.length) + return createEdgeArray(this, type3); + if (arguments.length === 1) { + source = "" + source; + const nodeData = this._nodes.get(source); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${source}" node in the graph.` + ); + return createEdgeArrayForNode( + this.multi, + type3 === "mixed" ? this.type : type3, + direction, + nodeData + ); + } + if (arguments.length === 2) { + source = "" + source; + target = "" + target; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${target}" target node in the graph.` + ); + return createEdgeArrayForPath( + type3, + this.multi, + direction, + sourceData, + target + ); + } + throw new InvalidArgumentsGraphError( + `Graph.${name2}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).` + ); + }; +} +function attachForEachEdge(Class, description7) { + const { name: name2, type: type3, direction } = description7; + const forEachName = "forEach" + name2[0].toUpperCase() + name2.slice(1, -1); + Class.prototype[forEachName] = function(source, target, callback) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return; + if (arguments.length === 1) { + callback = source; + return forEachEdge(false, this, type3, callback); + } + if (arguments.length === 2) { + source = "" + source; + callback = target; + const nodeData = this._nodes.get(source); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${forEachName}: could not find the "${source}" node in the graph.` + ); + return forEachEdgeForNode( + false, + this.multi, + type3 === "mixed" ? this.type : type3, + direction, + nodeData, + callback + ); + } + if (arguments.length === 3) { + source = "" + source; + target = "" + target; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${forEachName}: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.${forEachName}: could not find the "${target}" target node in the graph.` + ); + return forEachEdgeForPath( + false, + type3, + this.multi, + direction, + sourceData, + target, + callback + ); + } + throw new InvalidArgumentsGraphError( + `Graph.${forEachName}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).` + ); + }; + const mapName = "map" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[mapName] = function() { + const args = Array.prototype.slice.call(arguments); + const callback = args.pop(); + let result2; + if (args.length === 0) { + let length = 0; + if (type3 !== "directed") + length += this.undirectedSize; + if (type3 !== "undirected") + length += this.directedSize; + result2 = new Array(length); + let i7 = 0; + args.push((e10, ea, s7, t8, sa, ta, u7) => { + result2[i7++] = callback(e10, ea, s7, t8, sa, ta, u7); + }); + } else { + result2 = []; + args.push((e10, ea, s7, t8, sa, ta, u7) => { + result2.push(callback(e10, ea, s7, t8, sa, ta, u7)); + }); + } + this[forEachName].apply(this, args); + return result2; + }; + const filterName = "filter" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[filterName] = function() { + const args = Array.prototype.slice.call(arguments); + const callback = args.pop(); + const result2 = []; + args.push((e10, ea, s7, t8, sa, ta, u7) => { + if (callback(e10, ea, s7, t8, sa, ta, u7)) + result2.push(e10); + }); + this[forEachName].apply(this, args); + return result2; + }; + const reduceName = "reduce" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[reduceName] = function() { + let args = Array.prototype.slice.call(arguments); + if (args.length < 2 || args.length > 4) { + throw new InvalidArgumentsGraphError( + `Graph.${reduceName}: invalid number of arguments (expecting 2, 3 or 4 and got ${args.length}).` + ); + } + if (typeof args[args.length - 1] === "function" && typeof args[args.length - 2] !== "function") { + throw new InvalidArgumentsGraphError( + `Graph.${reduceName}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.` + ); + } + let callback; + let initialValue; + if (args.length === 2) { + callback = args[0]; + initialValue = args[1]; + args = []; + } else if (args.length === 3) { + callback = args[1]; + initialValue = args[2]; + args = [args[0]]; + } else if (args.length === 4) { + callback = args[2]; + initialValue = args[3]; + args = [args[0], args[1]]; + } + let accumulator = initialValue; + args.push((e10, ea, s7, t8, sa, ta, u7) => { + accumulator = callback(accumulator, e10, ea, s7, t8, sa, ta, u7); + }); + this[forEachName].apply(this, args); + return accumulator; + }; +} +function attachFindEdge(Class, description7) { + const { name: name2, type: type3, direction } = description7; + const findEdgeName = "find" + name2[0].toUpperCase() + name2.slice(1, -1); + Class.prototype[findEdgeName] = function(source, target, callback) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return false; + if (arguments.length === 1) { + callback = source; + return forEachEdge(true, this, type3, callback); + } + if (arguments.length === 2) { + source = "" + source; + callback = target; + const nodeData = this._nodes.get(source); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${findEdgeName}: could not find the "${source}" node in the graph.` + ); + return forEachEdgeForNode( + true, + this.multi, + type3 === "mixed" ? this.type : type3, + direction, + nodeData, + callback + ); + } + if (arguments.length === 3) { + source = "" + source; + target = "" + target; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${findEdgeName}: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.${findEdgeName}: could not find the "${target}" target node in the graph.` + ); + return forEachEdgeForPath( + true, + type3, + this.multi, + direction, + sourceData, + target, + callback + ); + } + throw new InvalidArgumentsGraphError( + `Graph.${findEdgeName}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).` + ); + }; + const someName = "some" + name2[0].toUpperCase() + name2.slice(1, -1); + Class.prototype[someName] = function() { + const args = Array.prototype.slice.call(arguments); + const callback = args.pop(); + args.push((e10, ea, s7, t8, sa, ta, u7) => { + return callback(e10, ea, s7, t8, sa, ta, u7); + }); + const found = this[findEdgeName].apply(this, args); + if (found) + return true; + return false; + }; + const everyName = "every" + name2[0].toUpperCase() + name2.slice(1, -1); + Class.prototype[everyName] = function() { + const args = Array.prototype.slice.call(arguments); + const callback = args.pop(); + args.push((e10, ea, s7, t8, sa, ta, u7) => { + return !callback(e10, ea, s7, t8, sa, ta, u7); + }); + const found = this[findEdgeName].apply(this, args); + if (found) + return false; + return true; + }; +} +function attachEdgeIteratorCreator(Class, description7) { + const { name: originalName, type: type3, direction } = description7; + const name2 = originalName.slice(0, -1) + "Entries"; + Class.prototype[name2] = function(source, target) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return emptyIterator(); + if (!arguments.length) + return createEdgeIterator(this, type3); + if (arguments.length === 1) { + source = "" + source; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${source}" node in the graph.` + ); + return createEdgeIteratorForNode(type3, direction, sourceData); + } + if (arguments.length === 2) { + source = "" + source; + target = "" + target; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${target}" target node in the graph.` + ); + return createEdgeIteratorForPath(type3, direction, sourceData, target); + } + throw new InvalidArgumentsGraphError( + `Graph.${name2}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).` + ); + }; +} +function attachEdgeIterationMethods(Graph2) { + EDGES_ITERATION.forEach((description7) => { + attachEdgeArrayCreator(Graph2, description7); + attachForEachEdge(Graph2, description7); + attachFindEdge(Graph2, description7); + attachEdgeIteratorCreator(Graph2, description7); + }); +} +var NEIGHBORS_ITERATION = [ + { + name: "neighbors", + type: "mixed" + }, + { + name: "inNeighbors", + type: "directed", + direction: "in" + }, + { + name: "outNeighbors", + type: "directed", + direction: "out" + }, + { + name: "inboundNeighbors", + type: "mixed", + direction: "in" + }, + { + name: "outboundNeighbors", + type: "mixed", + direction: "out" + }, + { + name: "directedNeighbors", + type: "directed" + }, + { + name: "undirectedNeighbors", + type: "undirected" + } +]; +function CompositeSetWrapper() { + this.A = null; + this.B = null; +} +CompositeSetWrapper.prototype.wrap = function(set4) { + if (this.A === null) + this.A = set4; + else if (this.B === null) + this.B = set4; +}; +CompositeSetWrapper.prototype.has = function(key) { + if (this.A !== null && key in this.A) + return true; + if (this.B !== null && key in this.B) + return true; + return false; +}; +function forEachInObjectOnce(breakable, visited, nodeData, object, callback) { + for (const k6 in object) { + const edgeData = object[k6]; + const sourceData = edgeData.source; + const targetData = edgeData.target; + const neighborData = sourceData === nodeData ? targetData : sourceData; + if (visited && visited.has(neighborData.key)) + continue; + const shouldBreak = callback(neighborData.key, neighborData.attributes); + if (breakable && shouldBreak) + return neighborData.key; + } + return; +} +function forEachNeighbor(breakable, type3, direction, nodeData, callback) { + if (type3 !== "mixed") { + if (type3 === "undirected") + return forEachInObjectOnce( + breakable, + null, + nodeData, + nodeData.undirected, + callback + ); + if (typeof direction === "string") + return forEachInObjectOnce( + breakable, + null, + nodeData, + nodeData[direction], + callback + ); + } + const visited = new CompositeSetWrapper(); + let found; + if (type3 !== "undirected") { + if (direction !== "out") { + found = forEachInObjectOnce( + breakable, + null, + nodeData, + nodeData.in, + callback + ); + if (breakable && found) + return found; + visited.wrap(nodeData.in); + } + if (direction !== "in") { + found = forEachInObjectOnce( + breakable, + visited, + nodeData, + nodeData.out, + callback + ); + if (breakable && found) + return found; + visited.wrap(nodeData.out); + } + } + if (type3 !== "directed") { + found = forEachInObjectOnce( + breakable, + visited, + nodeData, + nodeData.undirected, + callback + ); + if (breakable && found) + return found; + } + return; +} +function createNeighborArrayForNode(type3, direction, nodeData) { + if (type3 !== "mixed") { + if (type3 === "undirected") + return Object.keys(nodeData.undirected); + if (typeof direction === "string") + return Object.keys(nodeData[direction]); + } + const neighbors = []; + forEachNeighbor(false, type3, direction, nodeData, function(key) { + neighbors.push(key); + }); + return neighbors; +} +function createDedupedObjectIterator(visited, nodeData, object) { + const keys2 = Object.keys(object); + const l7 = keys2.length; + let i7 = 0; + return { + [Symbol.iterator]() { + return this; + }, + next() { + let neighborData = null; + do { + if (i7 >= l7) { + if (visited) + visited.wrap(object); + return { done: true }; + } + const edgeData = object[keys2[i7++]]; + const sourceData = edgeData.source; + const targetData = edgeData.target; + neighborData = sourceData === nodeData ? targetData : sourceData; + if (visited && visited.has(neighborData.key)) { + neighborData = null; + continue; + } + } while (neighborData === null); + return { + done: false, + value: { neighbor: neighborData.key, attributes: neighborData.attributes } + }; + } + }; +} +function createNeighborIterator(type3, direction, nodeData) { + if (type3 !== "mixed") { + if (type3 === "undirected") + return createDedupedObjectIterator(null, nodeData, nodeData.undirected); + if (typeof direction === "string") + return createDedupedObjectIterator(null, nodeData, nodeData[direction]); + } + let iterator = emptyIterator(); + const visited = new CompositeSetWrapper(); + if (type3 !== "undirected") { + if (direction !== "out") { + iterator = chain2( + iterator, + createDedupedObjectIterator(visited, nodeData, nodeData.in) + ); + } + if (direction !== "in") { + iterator = chain2( + iterator, + createDedupedObjectIterator(visited, nodeData, nodeData.out) + ); + } + } + if (type3 !== "directed") { + iterator = chain2( + iterator, + createDedupedObjectIterator(visited, nodeData, nodeData.undirected) + ); + } + return iterator; +} +function attachNeighborArrayCreator(Class, description7) { + const { name: name2, type: type3, direction } = description7; + Class.prototype[name2] = function(node) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return []; + node = "" + node; + const nodeData = this._nodes.get(node); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${name2}: could not find the "${node}" node in the graph.` + ); + return createNeighborArrayForNode( + type3 === "mixed" ? this.type : type3, + direction, + nodeData + ); + }; +} +function attachForEachNeighbor(Class, description7) { + const { name: name2, type: type3, direction } = description7; + const forEachName = "forEach" + name2[0].toUpperCase() + name2.slice(1, -1); + Class.prototype[forEachName] = function(node, callback) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return; + node = "" + node; + const nodeData = this._nodes.get(node); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${forEachName}: could not find the "${node}" node in the graph.` + ); + forEachNeighbor( + false, + type3 === "mixed" ? this.type : type3, + direction, + nodeData, + callback + ); + }; + const mapName = "map" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[mapName] = function(node, callback) { + const result2 = []; + this[forEachName](node, (n7, a7) => { + result2.push(callback(n7, a7)); + }); + return result2; + }; + const filterName = "filter" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[filterName] = function(node, callback) { + const result2 = []; + this[forEachName](node, (n7, a7) => { + if (callback(n7, a7)) + result2.push(n7); + }); + return result2; + }; + const reduceName = "reduce" + name2[0].toUpperCase() + name2.slice(1); + Class.prototype[reduceName] = function(node, callback, initialValue) { + if (arguments.length < 3) + throw new InvalidArgumentsGraphError( + `Graph.${reduceName}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.` + ); + let accumulator = initialValue; + this[forEachName](node, (n7, a7) => { + accumulator = callback(accumulator, n7, a7); + }); + return accumulator; + }; +} +function attachFindNeighbor(Class, description7) { + const { name: name2, type: type3, direction } = description7; + const capitalizedSingular = name2[0].toUpperCase() + name2.slice(1, -1); + const findName = "find" + capitalizedSingular; + Class.prototype[findName] = function(node, callback) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return; + node = "" + node; + const nodeData = this._nodes.get(node); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${findName}: could not find the "${node}" node in the graph.` + ); + return forEachNeighbor( + true, + type3 === "mixed" ? this.type : type3, + direction, + nodeData, + callback + ); + }; + const someName = "some" + capitalizedSingular; + Class.prototype[someName] = function(node, callback) { + const found = this[findName](node, callback); + if (found) + return true; + return false; + }; + const everyName = "every" + capitalizedSingular; + Class.prototype[everyName] = function(node, callback) { + const found = this[findName](node, (n7, a7) => { + return !callback(n7, a7); + }); + if (found) + return false; + return true; + }; +} +function attachNeighborIteratorCreator(Class, description7) { + const { name: name2, type: type3, direction } = description7; + const iteratorName = name2.slice(0, -1) + "Entries"; + Class.prototype[iteratorName] = function(node) { + if (type3 !== "mixed" && this.type !== "mixed" && type3 !== this.type) + return emptyIterator(); + node = "" + node; + const nodeData = this._nodes.get(node); + if (typeof nodeData === "undefined") + throw new NotFoundGraphError( + `Graph.${iteratorName}: could not find the "${node}" node in the graph.` + ); + return createNeighborIterator( + type3 === "mixed" ? this.type : type3, + direction, + nodeData + ); + }; +} +function attachNeighborIterationMethods(Graph2) { + NEIGHBORS_ITERATION.forEach((description7) => { + attachNeighborArrayCreator(Graph2, description7); + attachForEachNeighbor(Graph2, description7); + attachFindNeighbor(Graph2, description7); + attachNeighborIteratorCreator(Graph2, description7); + }); +} +function forEachAdjacency(breakable, assymetric, disconnectedNodes, graph, callback) { + const iterator = graph._nodes.values(); + const type3 = graph.type; + let step, sourceData, neighbor, adj, edgeData, targetData, shouldBreak; + while (step = iterator.next(), step.done !== true) { + let hasEdges = false; + sourceData = step.value; + if (type3 !== "undirected") { + adj = sourceData.out; + for (neighbor in adj) { + edgeData = adj[neighbor]; + do { + targetData = edgeData.target; + hasEdges = true; + shouldBreak = callback( + sourceData.key, + targetData.key, + sourceData.attributes, + targetData.attributes, + edgeData.key, + edgeData.attributes, + edgeData.undirected + ); + if (breakable && shouldBreak) + return edgeData; + edgeData = edgeData.next; + } while (edgeData); + } + } + if (type3 !== "directed") { + adj = sourceData.undirected; + for (neighbor in adj) { + if (assymetric && sourceData.key > neighbor) + continue; + edgeData = adj[neighbor]; + do { + targetData = edgeData.target; + if (targetData.key !== neighbor) + targetData = edgeData.source; + hasEdges = true; + shouldBreak = callback( + sourceData.key, + targetData.key, + sourceData.attributes, + targetData.attributes, + edgeData.key, + edgeData.attributes, + edgeData.undirected + ); + if (breakable && shouldBreak) + return edgeData; + edgeData = edgeData.next; + } while (edgeData); + } + } + if (disconnectedNodes && !hasEdges) { + shouldBreak = callback( + sourceData.key, + null, + sourceData.attributes, + null, + null, + null, + null + ); + if (breakable && shouldBreak) + return null; + } + } + return; +} +function serializeNode(key, data) { + const serialized = { key }; + if (!isEmpty3(data.attributes)) + serialized.attributes = assign2({}, data.attributes); + return serialized; +} +function serializeEdge(type3, key, data) { + const serialized = { + key, + source: data.source.key, + target: data.target.key + }; + if (!isEmpty3(data.attributes)) + serialized.attributes = assign2({}, data.attributes); + if (type3 === "mixed" && data.undirected) + serialized.undirected = true; + return serialized; +} +function validateSerializedNode(value2) { + if (!isPlainObject2(value2)) + throw new InvalidArgumentsGraphError( + 'Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.' + ); + if (!("key" in value2)) + throw new InvalidArgumentsGraphError( + "Graph.import: serialized node is missing its key." + ); + if ("attributes" in value2 && (!isPlainObject2(value2.attributes) || value2.attributes === null)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid attributes. Attributes should be a plain object, null or omitted." + ); +} +function validateSerializedEdge(value2) { + if (!isPlainObject2(value2)) + throw new InvalidArgumentsGraphError( + 'Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.' + ); + if (!("source" in value2)) + throw new InvalidArgumentsGraphError( + "Graph.import: serialized edge is missing its source." + ); + if (!("target" in value2)) + throw new InvalidArgumentsGraphError( + "Graph.import: serialized edge is missing its target." + ); + if ("attributes" in value2 && (!isPlainObject2(value2.attributes) || value2.attributes === null)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid attributes. Attributes should be a plain object, null or omitted." + ); + if ("undirected" in value2 && typeof value2.undirected !== "boolean") + throw new InvalidArgumentsGraphError( + "Graph.import: invalid undirectedness information. Undirected should be boolean or omitted." + ); +} +var INSTANCE_ID = incrementalIdStartingFromRandomByte(); +var TYPES = /* @__PURE__ */ new Set(["directed", "undirected", "mixed"]); +var EMITTER_PROPS = /* @__PURE__ */ new Set([ + "domain", + "_events", + "_eventsCount", + "_maxListeners" +]); +var EDGE_ADD_METHODS = [ + { + name: (verb) => `${verb}Edge`, + generateKey: true + }, + { + name: (verb) => `${verb}DirectedEdge`, + generateKey: true, + type: "directed" + }, + { + name: (verb) => `${verb}UndirectedEdge`, + generateKey: true, + type: "undirected" + }, + { + name: (verb) => `${verb}EdgeWithKey` + }, + { + name: (verb) => `${verb}DirectedEdgeWithKey`, + type: "directed" + }, + { + name: (verb) => `${verb}UndirectedEdgeWithKey`, + type: "undirected" + } +]; +var DEFAULTS = { + allowSelfLoops: true, + multi: false, + type: "mixed" +}; +function addNode(graph, node, attributes) { + if (attributes && !isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.addNode: invalid attributes. Expecting an object but got "${attributes}"` + ); + node = "" + node; + attributes = attributes || {}; + if (graph._nodes.has(node)) + throw new UsageGraphError( + `Graph.addNode: the "${node}" node already exist in the graph.` + ); + const data = new graph.NodeDataClass(node, attributes); + graph._nodes.set(node, data); + graph.emit("nodeAdded", { + key: node, + attributes + }); + return data; +} +function unsafeAddNode(graph, node, attributes) { + const data = new graph.NodeDataClass(node, attributes); + graph._nodes.set(node, data); + graph.emit("nodeAdded", { + key: node, + attributes + }); + return data; +} +function addEdge(graph, name2, mustGenerateKey, undirected, edge, source, target, attributes) { + if (!undirected && graph.type === "undirected") + throw new UsageGraphError( + `Graph.${name2}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.` + ); + if (undirected && graph.type === "directed") + throw new UsageGraphError( + `Graph.${name2}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.` + ); + if (attributes && !isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${name2}: invalid attributes. Expecting an object but got "${attributes}"` + ); + source = "" + source; + target = "" + target; + attributes = attributes || {}; + if (!graph.allowSelfLoops && source === target) + throw new UsageGraphError( + `Graph.${name2}: source & target are the same ("${source}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.` + ); + const sourceData = graph._nodes.get(source), targetData = graph._nodes.get(target); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.${name2}: source node "${source}" not found.` + ); + if (!targetData) + throw new NotFoundGraphError( + `Graph.${name2}: target node "${target}" not found.` + ); + const eventData = { + key: null, + undirected, + source, + target, + attributes + }; + if (mustGenerateKey) { + edge = graph._edgeKeyGenerator(); + } else { + edge = "" + edge; + if (graph._edges.has(edge)) + throw new UsageGraphError( + `Graph.${name2}: the "${edge}" edge already exists in the graph.` + ); + } + if (!graph.multi && (undirected ? typeof sourceData.undirected[target] !== "undefined" : typeof sourceData.out[target] !== "undefined")) { + throw new UsageGraphError( + `Graph.${name2}: an edge linking "${source}" to "${target}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.` + ); + } + const edgeData = new EdgeData( + undirected, + edge, + sourceData, + targetData, + attributes + ); + graph._edges.set(edge, edgeData); + const isSelfLoop = source === target; + if (undirected) { + sourceData.undirectedDegree++; + targetData.undirectedDegree++; + if (isSelfLoop) { + sourceData.undirectedLoops++; + graph._undirectedSelfLoopCount++; + } + } else { + sourceData.outDegree++; + targetData.inDegree++; + if (isSelfLoop) { + sourceData.directedLoops++; + graph._directedSelfLoopCount++; + } + } + if (graph.multi) + edgeData.attachMulti(); + else + edgeData.attach(); + if (undirected) + graph._undirectedSize++; + else + graph._directedSize++; + eventData.key = edge; + graph.emit("edgeAdded", eventData); + return edge; +} +function mergeEdge(graph, name2, mustGenerateKey, undirected, edge, source, target, attributes, asUpdater) { + if (!undirected && graph.type === "undirected") + throw new UsageGraphError( + `Graph.${name2}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.` + ); + if (undirected && graph.type === "directed") + throw new UsageGraphError( + `Graph.${name2}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.` + ); + if (attributes) { + if (asUpdater) { + if (typeof attributes !== "function") + throw new InvalidArgumentsGraphError( + `Graph.${name2}: invalid updater function. Expecting a function but got "${attributes}"` + ); + } else { + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.${name2}: invalid attributes. Expecting an object but got "${attributes}"` + ); + } + } + source = "" + source; + target = "" + target; + let updater; + if (asUpdater) { + updater = attributes; + attributes = void 0; + } + if (!graph.allowSelfLoops && source === target) + throw new UsageGraphError( + `Graph.${name2}: source & target are the same ("${source}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.` + ); + let sourceData = graph._nodes.get(source); + let targetData = graph._nodes.get(target); + let edgeData; + let alreadyExistingEdgeData; + if (!mustGenerateKey) { + edgeData = graph._edges.get(edge); + if (edgeData) { + if (edgeData.source.key !== source || edgeData.target.key !== target) { + if (!undirected || edgeData.source.key !== target || edgeData.target.key !== source) { + throw new UsageGraphError( + `Graph.${name2}: inconsistency detected when attempting to merge the "${edge}" edge with "${source}" source & "${target}" target vs. ("${edgeData.source.key}", "${edgeData.target.key}").` + ); + } + } + alreadyExistingEdgeData = edgeData; + } + } + if (!alreadyExistingEdgeData && !graph.multi && sourceData) { + alreadyExistingEdgeData = undirected ? sourceData.undirected[target] : sourceData.out[target]; + } + if (alreadyExistingEdgeData) { + const info2 = [alreadyExistingEdgeData.key, false, false, false]; + if (asUpdater ? !updater : !attributes) + return info2; + if (asUpdater) { + const oldAttributes = alreadyExistingEdgeData.attributes; + alreadyExistingEdgeData.attributes = updater(oldAttributes); + graph.emit("edgeAttributesUpdated", { + type: "replace", + key: alreadyExistingEdgeData.key, + attributes: alreadyExistingEdgeData.attributes + }); + } else { + assign2(alreadyExistingEdgeData.attributes, attributes); + graph.emit("edgeAttributesUpdated", { + type: "merge", + key: alreadyExistingEdgeData.key, + attributes: alreadyExistingEdgeData.attributes, + data: attributes + }); + } + return info2; + } + attributes = attributes || {}; + if (asUpdater && updater) + attributes = updater(attributes); + const eventData = { + key: null, + undirected, + source, + target, + attributes + }; + if (mustGenerateKey) { + edge = graph._edgeKeyGenerator(); + } else { + edge = "" + edge; + if (graph._edges.has(edge)) + throw new UsageGraphError( + `Graph.${name2}: the "${edge}" edge already exists in the graph.` + ); + } + let sourceWasAdded = false; + let targetWasAdded = false; + if (!sourceData) { + sourceData = unsafeAddNode(graph, source, {}); + sourceWasAdded = true; + if (source === target) { + targetData = sourceData; + targetWasAdded = true; + } + } + if (!targetData) { + targetData = unsafeAddNode(graph, target, {}); + targetWasAdded = true; + } + edgeData = new EdgeData(undirected, edge, sourceData, targetData, attributes); + graph._edges.set(edge, edgeData); + const isSelfLoop = source === target; + if (undirected) { + sourceData.undirectedDegree++; + targetData.undirectedDegree++; + if (isSelfLoop) { + sourceData.undirectedLoops++; + graph._undirectedSelfLoopCount++; + } + } else { + sourceData.outDegree++; + targetData.inDegree++; + if (isSelfLoop) { + sourceData.directedLoops++; + graph._directedSelfLoopCount++; + } + } + if (graph.multi) + edgeData.attachMulti(); + else + edgeData.attach(); + if (undirected) + graph._undirectedSize++; + else + graph._directedSize++; + eventData.key = edge; + graph.emit("edgeAdded", eventData); + return [edge, true, sourceWasAdded, targetWasAdded]; +} +function dropEdgeFromData(graph, edgeData) { + graph._edges.delete(edgeData.key); + const { source: sourceData, target: targetData, attributes } = edgeData; + const undirected = edgeData.undirected; + const isSelfLoop = sourceData === targetData; + if (undirected) { + sourceData.undirectedDegree--; + targetData.undirectedDegree--; + if (isSelfLoop) { + sourceData.undirectedLoops--; + graph._undirectedSelfLoopCount--; + } + } else { + sourceData.outDegree--; + targetData.inDegree--; + if (isSelfLoop) { + sourceData.directedLoops--; + graph._directedSelfLoopCount--; + } + } + if (graph.multi) + edgeData.detachMulti(); + else + edgeData.detach(); + if (undirected) + graph._undirectedSize--; + else + graph._directedSize--; + graph.emit("edgeDropped", { + key: edgeData.key, + attributes, + source: sourceData.key, + target: targetData.key, + undirected + }); +} +var Graph = class _Graph extends EventEmitter { + constructor(options) { + super(); + options = assign2({}, DEFAULTS, options); + if (typeof options.multi !== "boolean") + throw new InvalidArgumentsGraphError( + `Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${options.multi}".` + ); + if (!TYPES.has(options.type)) + throw new InvalidArgumentsGraphError( + `Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${options.type}".` + ); + if (typeof options.allowSelfLoops !== "boolean") + throw new InvalidArgumentsGraphError( + `Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${options.allowSelfLoops}".` + ); + const NodeDataClass = options.type === "mixed" ? MixedNodeData : options.type === "directed" ? DirectedNodeData : UndirectedNodeData; + privateProperty(this, "NodeDataClass", NodeDataClass); + const instancePrefix = "geid_" + INSTANCE_ID() + "_"; + let edgeId = 0; + const edgeKeyGenerator = () => { + let availableEdgeKey; + do { + availableEdgeKey = instancePrefix + edgeId++; + } while (this._edges.has(availableEdgeKey)); + return availableEdgeKey; + }; + privateProperty(this, "_attributes", {}); + privateProperty(this, "_nodes", /* @__PURE__ */ new Map()); + privateProperty(this, "_edges", /* @__PURE__ */ new Map()); + privateProperty(this, "_directedSize", 0); + privateProperty(this, "_undirectedSize", 0); + privateProperty(this, "_directedSelfLoopCount", 0); + privateProperty(this, "_undirectedSelfLoopCount", 0); + privateProperty(this, "_edgeKeyGenerator", edgeKeyGenerator); + privateProperty(this, "_options", options); + EMITTER_PROPS.forEach((prop) => privateProperty(this, prop, this[prop])); + readOnlyProperty(this, "order", () => this._nodes.size); + readOnlyProperty(this, "size", () => this._edges.size); + readOnlyProperty(this, "directedSize", () => this._directedSize); + readOnlyProperty(this, "undirectedSize", () => this._undirectedSize); + readOnlyProperty( + this, + "selfLoopCount", + () => this._directedSelfLoopCount + this._undirectedSelfLoopCount + ); + readOnlyProperty( + this, + "directedSelfLoopCount", + () => this._directedSelfLoopCount + ); + readOnlyProperty( + this, + "undirectedSelfLoopCount", + () => this._undirectedSelfLoopCount + ); + readOnlyProperty(this, "multi", this._options.multi); + readOnlyProperty(this, "type", this._options.type); + readOnlyProperty(this, "allowSelfLoops", this._options.allowSelfLoops); + readOnlyProperty(this, "implementation", () => "graphology"); + } + _resetInstanceCounters() { + this._directedSize = 0; + this._undirectedSize = 0; + this._directedSelfLoopCount = 0; + this._undirectedSelfLoopCount = 0; + } + /**--------------------------------------------------------------------------- + * Read + **--------------------------------------------------------------------------- + */ + /** + * Method returning whether the given node is found in the graph. + * + * @param {any} node - The node. + * @return {boolean} + */ + hasNode(node) { + return this._nodes.has("" + node); + } + /** + * Method returning whether the given directed edge is found in the graph. + * + * Arity 1: + * @param {any} edge - The edge's key. + * + * Arity 2: + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {boolean} + * + * @throws {Error} - Will throw if the arguments are invalid. + */ + hasDirectedEdge(source, target) { + if (this.type === "undirected") + return false; + if (arguments.length === 1) { + const edge = "" + source; + const edgeData = this._edges.get(edge); + return !!edgeData && !edgeData.undirected; + } else if (arguments.length === 2) { + source = "" + source; + target = "" + target; + const nodeData = this._nodes.get(source); + if (!nodeData) + return false; + return nodeData.out.hasOwnProperty(target); + } + throw new InvalidArgumentsGraphError( + `Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.` + ); + } + /** + * Method returning whether the given undirected edge is found in the graph. + * + * Arity 1: + * @param {any} edge - The edge's key. + * + * Arity 2: + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {boolean} + * + * @throws {Error} - Will throw if the arguments are invalid. + */ + hasUndirectedEdge(source, target) { + if (this.type === "directed") + return false; + if (arguments.length === 1) { + const edge = "" + source; + const edgeData = this._edges.get(edge); + return !!edgeData && edgeData.undirected; + } else if (arguments.length === 2) { + source = "" + source; + target = "" + target; + const nodeData = this._nodes.get(source); + if (!nodeData) + return false; + return nodeData.undirected.hasOwnProperty(target); + } + throw new InvalidArgumentsGraphError( + `Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.` + ); + } + /** + * Method returning whether the given edge is found in the graph. + * + * Arity 1: + * @param {any} edge - The edge's key. + * + * Arity 2: + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {boolean} + * + * @throws {Error} - Will throw if the arguments are invalid. + */ + hasEdge(source, target) { + if (arguments.length === 1) { + const edge = "" + source; + return this._edges.has(edge); + } else if (arguments.length === 2) { + source = "" + source; + target = "" + target; + const nodeData = this._nodes.get(source); + if (!nodeData) + return false; + return typeof nodeData.out !== "undefined" && nodeData.out.hasOwnProperty(target) || typeof nodeData.undirected !== "undefined" && nodeData.undirected.hasOwnProperty(target); + } + throw new InvalidArgumentsGraphError( + `Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.` + ); + } + /** + * Method returning the edge matching source & target in a directed fashion. + * + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {any|undefined} + * + * @throws {Error} - Will throw if the graph is multi. + * @throws {Error} - Will throw if source or target doesn't exist. + */ + directedEdge(source, target) { + if (this.type === "undirected") + return; + source = "" + source; + target = "" + target; + if (this.multi) + throw new UsageGraphError( + "Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead." + ); + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.directedEdge: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.directedEdge: could not find the "${target}" target node in the graph.` + ); + const edgeData = sourceData.out && sourceData.out[target] || void 0; + if (edgeData) + return edgeData.key; + } + /** + * Method returning the edge matching source & target in a undirected fashion. + * + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {any|undefined} + * + * @throws {Error} - Will throw if the graph is multi. + * @throws {Error} - Will throw if source or target doesn't exist. + */ + undirectedEdge(source, target) { + if (this.type === "directed") + return; + source = "" + source; + target = "" + target; + if (this.multi) + throw new UsageGraphError( + "Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead." + ); + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.undirectedEdge: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.undirectedEdge: could not find the "${target}" target node in the graph.` + ); + const edgeData = sourceData.undirected && sourceData.undirected[target] || void 0; + if (edgeData) + return edgeData.key; + } + /** + * Method returning the edge matching source & target in a mixed fashion. + * + * @param {any} source - The edge's source. + * @param {any} target - The edge's target. + * + * @return {any|undefined} + * + * @throws {Error} - Will throw if the graph is multi. + * @throws {Error} - Will throw if source or target doesn't exist. + */ + edge(source, target) { + if (this.multi) + throw new UsageGraphError( + "Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead." + ); + source = "" + source; + target = "" + target; + const sourceData = this._nodes.get(source); + if (!sourceData) + throw new NotFoundGraphError( + `Graph.edge: could not find the "${source}" source node in the graph.` + ); + if (!this._nodes.has(target)) + throw new NotFoundGraphError( + `Graph.edge: could not find the "${target}" target node in the graph.` + ); + const edgeData = sourceData.out && sourceData.out[target] || sourceData.undirected && sourceData.undirected[target] || void 0; + if (edgeData) + return edgeData.key; + } + /** + * Method returning whether two nodes are directed neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areDirectedNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areDirectedNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return false; + return neighbor in nodeData.in || neighbor in nodeData.out; + } + /** + * Method returning whether two nodes are out neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areOutNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areOutNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return false; + return neighbor in nodeData.out; + } + /** + * Method returning whether two nodes are in neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areInNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areInNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return false; + return neighbor in nodeData.in; + } + /** + * Method returning whether two nodes are undirected neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areUndirectedNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areUndirectedNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type === "directed") + return false; + return neighbor in nodeData.undirected; + } + /** + * Method returning whether two nodes are neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type !== "undirected") { + if (neighbor in nodeData.in || neighbor in nodeData.out) + return true; + } + if (this.type !== "directed") { + if (neighbor in nodeData.undirected) + return true; + } + return false; + } + /** + * Method returning whether two nodes are inbound neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areInboundNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areInboundNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type !== "undirected") { + if (neighbor in nodeData.in) + return true; + } + if (this.type !== "directed") { + if (neighbor in nodeData.undirected) + return true; + } + return false; + } + /** + * Method returning whether two nodes are outbound neighbors. + * + * @param {any} node - The node's key. + * @param {any} neighbor - The neighbor's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + areOutboundNeighbors(node, neighbor) { + node = "" + node; + neighbor = "" + neighbor; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.areOutboundNeighbors: could not find the "${node}" node in the graph.` + ); + if (this.type !== "undirected") { + if (neighbor in nodeData.out) + return true; + } + if (this.type !== "directed") { + if (neighbor in nodeData.undirected) + return true; + } + return false; + } + /** + * Method returning the given node's in degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + inDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.inDegree: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.inDegree; + } + /** + * Method returning the given node's out degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + outDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.outDegree: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.outDegree; + } + /** + * Method returning the given node's directed degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + directedDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.directedDegree: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.inDegree + nodeData.outDegree; + } + /** + * Method returning the given node's undirected degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + undirectedDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.undirectedDegree: could not find the "${node}" node in the graph.` + ); + if (this.type === "directed") + return 0; + return nodeData.undirectedDegree; + } + /** + * Method returning the given node's inbound degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's inbound degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + inboundDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.inboundDegree: could not find the "${node}" node in the graph.` + ); + let degree = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + } + if (this.type !== "undirected") { + degree += nodeData.inDegree; + } + return degree; + } + /** + * Method returning the given node's outbound degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's outbound degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + outboundDegree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.outboundDegree: could not find the "${node}" node in the graph.` + ); + let degree = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + } + if (this.type !== "undirected") { + degree += nodeData.outDegree; + } + return degree; + } + /** + * Method returning the given node's directed degree. + * + * @param {any} node - The node's key. + * @return {number} - The node's degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + degree(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.degree: could not find the "${node}" node in the graph.` + ); + let degree = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + } + if (this.type !== "undirected") { + degree += nodeData.inDegree + nodeData.outDegree; + } + return degree; + } + /** + * Method returning the given node's in degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + inDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.inDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.inDegree - nodeData.directedLoops; + } + /** + * Method returning the given node's out degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + outDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.outDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.outDegree - nodeData.directedLoops; + } + /** + * Method returning the given node's directed degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + directedDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.directedDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + if (this.type === "undirected") + return 0; + return nodeData.inDegree + nodeData.outDegree - nodeData.directedLoops * 2; + } + /** + * Method returning the given node's undirected degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's in degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + undirectedDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.undirectedDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + if (this.type === "directed") + return 0; + return nodeData.undirectedDegree - nodeData.undirectedLoops * 2; + } + /** + * Method returning the given node's inbound degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's inbound degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + inboundDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.inboundDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + let degree = 0; + let loops = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + loops += nodeData.undirectedLoops * 2; + } + if (this.type !== "undirected") { + degree += nodeData.inDegree; + loops += nodeData.directedLoops; + } + return degree - loops; + } + /** + * Method returning the given node's outbound degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's outbound degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + outboundDegreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.outboundDegreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + let degree = 0; + let loops = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + loops += nodeData.undirectedLoops * 2; + } + if (this.type !== "undirected") { + degree += nodeData.outDegree; + loops += nodeData.directedLoops; + } + return degree - loops; + } + /** + * Method returning the given node's directed degree without considering self loops. + * + * @param {any} node - The node's key. + * @return {number} - The node's degree. + * + * @throws {Error} - Will throw if the node isn't in the graph. + */ + degreeWithoutSelfLoops(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.degreeWithoutSelfLoops: could not find the "${node}" node in the graph.` + ); + let degree = 0; + let loops = 0; + if (this.type !== "directed") { + degree += nodeData.undirectedDegree; + loops += nodeData.undirectedLoops * 2; + } + if (this.type !== "undirected") { + degree += nodeData.inDegree + nodeData.outDegree; + loops += nodeData.directedLoops * 2; + } + return degree - loops; + } + /** + * Method returning the given edge's source. + * + * @param {any} edge - The edge's key. + * @return {any} - The edge's source. + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + source(edge) { + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.source: could not find the "${edge}" edge in the graph.` + ); + return data.source.key; + } + /** + * Method returning the given edge's target. + * + * @param {any} edge - The edge's key. + * @return {any} - The edge's target. + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + target(edge) { + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.target: could not find the "${edge}" edge in the graph.` + ); + return data.target.key; + } + /** + * Method returning the given edge's extremities. + * + * @param {any} edge - The edge's key. + * @return {array} - The edge's extremities. + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + extremities(edge) { + edge = "" + edge; + const edgeData = this._edges.get(edge); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.extremities: could not find the "${edge}" edge in the graph.` + ); + return [edgeData.source.key, edgeData.target.key]; + } + /** + * Given a node & an edge, returns the other extremity of the edge. + * + * @param {any} node - The node's key. + * @param {any} edge - The edge's key. + * @return {any} - The related node. + * + * @throws {Error} - Will throw if the edge isn't in the graph or if the + * edge & node are not related. + */ + opposite(node, edge) { + node = "" + node; + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.opposite: could not find the "${edge}" edge in the graph.` + ); + const source = data.source.key; + const target = data.target.key; + if (node === source) + return target; + if (node === target) + return source; + throw new NotFoundGraphError( + `Graph.opposite: the "${node}" node is not attached to the "${edge}" edge (${source}, ${target}).` + ); + } + /** + * Returns whether the given edge has the given node as extremity. + * + * @param {any} edge - The edge's key. + * @param {any} node - The node's key. + * @return {boolean} - The related node. + * + * @throws {Error} - Will throw if either the node or the edge isn't in the graph. + */ + hasExtremity(edge, node) { + edge = "" + edge; + node = "" + node; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.hasExtremity: could not find the "${edge}" edge in the graph.` + ); + return data.source.key === node || data.target.key === node; + } + /** + * Method returning whether the given edge is undirected. + * + * @param {any} edge - The edge's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + isUndirected(edge) { + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.isUndirected: could not find the "${edge}" edge in the graph.` + ); + return data.undirected; + } + /** + * Method returning whether the given edge is directed. + * + * @param {any} edge - The edge's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + isDirected(edge) { + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.isDirected: could not find the "${edge}" edge in the graph.` + ); + return !data.undirected; + } + /** + * Method returning whether the given edge is a self loop. + * + * @param {any} edge - The edge's key. + * @return {boolean} + * + * @throws {Error} - Will throw if the edge isn't in the graph. + */ + isSelfLoop(edge) { + edge = "" + edge; + const data = this._edges.get(edge); + if (!data) + throw new NotFoundGraphError( + `Graph.isSelfLoop: could not find the "${edge}" edge in the graph.` + ); + return data.source === data.target; + } + /**--------------------------------------------------------------------------- + * Mutation + **--------------------------------------------------------------------------- + */ + /** + * Method used to add a node to the graph. + * + * @param {any} node - The node. + * @param {object} [attributes] - Optional attributes. + * @return {any} - The node. + * + * @throws {Error} - Will throw if the given node already exist. + * @throws {Error} - Will throw if the given attributes are not an object. + */ + addNode(node, attributes) { + const nodeData = addNode(this, node, attributes); + return nodeData.key; + } + /** + * Method used to merge a node into the graph. + * + * @param {any} node - The node. + * @param {object} [attributes] - Optional attributes. + * @return {any} - The node. + */ + mergeNode(node, attributes) { + if (attributes && !isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + `Graph.mergeNode: invalid attributes. Expecting an object but got "${attributes}"` + ); + node = "" + node; + attributes = attributes || {}; + let data = this._nodes.get(node); + if (data) { + if (attributes) { + assign2(data.attributes, attributes); + this.emit("nodeAttributesUpdated", { + type: "merge", + key: node, + attributes: data.attributes, + data: attributes + }); + } + return [node, false]; + } + data = new this.NodeDataClass(node, attributes); + this._nodes.set(node, data); + this.emit("nodeAdded", { + key: node, + attributes + }); + return [node, true]; + } + /** + * Method used to add a node if it does not exist in the graph or else to + * update its attributes using a function. + * + * @param {any} node - The node. + * @param {function} [updater] - Optional updater function. + * @return {any} - The node. + */ + updateNode(node, updater) { + if (updater && typeof updater !== "function") + throw new InvalidArgumentsGraphError( + `Graph.updateNode: invalid updater function. Expecting a function but got "${updater}"` + ); + node = "" + node; + let data = this._nodes.get(node); + if (data) { + if (updater) { + const oldAttributes = data.attributes; + data.attributes = updater(oldAttributes); + this.emit("nodeAttributesUpdated", { + type: "replace", + key: node, + attributes: data.attributes + }); + } + return [node, false]; + } + const attributes = updater ? updater({}) : {}; + data = new this.NodeDataClass(node, attributes); + this._nodes.set(node, data); + this.emit("nodeAdded", { + key: node, + attributes + }); + return [node, true]; + } + /** + * Method used to drop a single node & all its attached edges from the graph. + * + * @param {any} node - The node. + * @return {Graph} + * + * @throws {Error} - Will throw if the node doesn't exist. + */ + dropNode(node) { + node = "" + node; + const nodeData = this._nodes.get(node); + if (!nodeData) + throw new NotFoundGraphError( + `Graph.dropNode: could not find the "${node}" node in the graph.` + ); + let edgeData; + if (this.type !== "undirected") { + for (const neighbor in nodeData.out) { + edgeData = nodeData.out[neighbor]; + do { + dropEdgeFromData(this, edgeData); + edgeData = edgeData.next; + } while (edgeData); + } + for (const neighbor in nodeData.in) { + edgeData = nodeData.in[neighbor]; + do { + dropEdgeFromData(this, edgeData); + edgeData = edgeData.next; + } while (edgeData); + } + } + if (this.type !== "directed") { + for (const neighbor in nodeData.undirected) { + edgeData = nodeData.undirected[neighbor]; + do { + dropEdgeFromData(this, edgeData); + edgeData = edgeData.next; + } while (edgeData); + } + } + this._nodes.delete(node); + this.emit("nodeDropped", { + key: node, + attributes: nodeData.attributes + }); + } + /** + * Method used to drop a single edge from the graph. + * + * Arity 1: + * @param {any} edge - The edge. + * + * Arity 2: + * @param {any} source - Source node. + * @param {any} target - Target node. + * + * @return {Graph} + * + * @throws {Error} - Will throw if the edge doesn't exist. + */ + dropEdge(edge) { + let edgeData; + if (arguments.length > 1) { + const source = "" + arguments[0]; + const target = "" + arguments[1]; + edgeData = getMatchingEdge(this, source, target, this.type); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.dropEdge: could not find the "${source}" -> "${target}" edge in the graph.` + ); + } else { + edge = "" + edge; + edgeData = this._edges.get(edge); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.dropEdge: could not find the "${edge}" edge in the graph.` + ); + } + dropEdgeFromData(this, edgeData); + return this; + } + /** + * Method used to drop a single directed edge from the graph. + * + * @param {any} source - Source node. + * @param {any} target - Target node. + * + * @return {Graph} + * + * @throws {Error} - Will throw if the edge doesn't exist. + */ + dropDirectedEdge(source, target) { + if (arguments.length < 2) + throw new UsageGraphError( + "Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead." + ); + if (this.multi) + throw new UsageGraphError( + "Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones." + ); + source = "" + source; + target = "" + target; + const edgeData = getMatchingEdge(this, source, target, "directed"); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.dropDirectedEdge: could not find a "${source}" -> "${target}" edge in the graph.` + ); + dropEdgeFromData(this, edgeData); + return this; + } + /** + * Method used to drop a single undirected edge from the graph. + * + * @param {any} source - Source node. + * @param {any} target - Target node. + * + * @return {Graph} + * + * @throws {Error} - Will throw if the edge doesn't exist. + */ + dropUndirectedEdge(source, target) { + if (arguments.length < 2) + throw new UsageGraphError( + "Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead." + ); + if (this.multi) + throw new UsageGraphError( + "Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones." + ); + const edgeData = getMatchingEdge(this, source, target, "undirected"); + if (!edgeData) + throw new NotFoundGraphError( + `Graph.dropUndirectedEdge: could not find a "${source}" -> "${target}" edge in the graph.` + ); + dropEdgeFromData(this, edgeData); + return this; + } + /** + * Method used to remove every edge & every node from the graph. + * + * @return {Graph} + */ + clear() { + this._edges.clear(); + this._nodes.clear(); + this._resetInstanceCounters(); + this.emit("cleared"); + } + /** + * Method used to remove every edge from the graph. + * + * @return {Graph} + */ + clearEdges() { + const iterator = this._nodes.values(); + let step; + while (step = iterator.next(), step.done !== true) { + step.value.clear(); + } + this._edges.clear(); + this._resetInstanceCounters(); + this.emit("edgesCleared"); + } + /**--------------------------------------------------------------------------- + * Attributes-related methods + **--------------------------------------------------------------------------- + */ + /** + * Method returning the desired graph's attribute. + * + * @param {string} name - Name of the attribute. + * @return {any} + */ + getAttribute(name2) { + return this._attributes[name2]; + } + /** + * Method returning the graph's attributes. + * + * @return {object} + */ + getAttributes() { + return this._attributes; + } + /** + * Method returning whether the graph has the desired attribute. + * + * @param {string} name - Name of the attribute. + * @return {boolean} + */ + hasAttribute(name2) { + return this._attributes.hasOwnProperty(name2); + } + /** + * Method setting a value for the desired graph's attribute. + * + * @param {string} name - Name of the attribute. + * @param {any} value - Value for the attribute. + * @return {Graph} + */ + setAttribute(name2, value2) { + this._attributes[name2] = value2; + this.emit("attributesUpdated", { + type: "set", + attributes: this._attributes, + name: name2 + }); + return this; + } + /** + * Method using a function to update the desired graph's attribute's value. + * + * @param {string} name - Name of the attribute. + * @param {function} updater - Function use to update the attribute's value. + * @return {Graph} + */ + updateAttribute(name2, updater) { + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + "Graph.updateAttribute: updater should be a function." + ); + const value2 = this._attributes[name2]; + this._attributes[name2] = updater(value2); + this.emit("attributesUpdated", { + type: "set", + attributes: this._attributes, + name: name2 + }); + return this; + } + /** + * Method removing the desired graph's attribute. + * + * @param {string} name - Name of the attribute. + * @return {Graph} + */ + removeAttribute(name2) { + delete this._attributes[name2]; + this.emit("attributesUpdated", { + type: "remove", + attributes: this._attributes, + name: name2 + }); + return this; + } + /** + * Method replacing the graph's attributes. + * + * @param {object} attributes - New attributes. + * @return {Graph} + * + * @throws {Error} - Will throw if given attributes are not a plain object. + */ + replaceAttributes(attributes) { + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + "Graph.replaceAttributes: provided attributes are not a plain object." + ); + this._attributes = attributes; + this.emit("attributesUpdated", { + type: "replace", + attributes: this._attributes + }); + return this; + } + /** + * Method merging the graph's attributes. + * + * @param {object} attributes - Attributes to merge. + * @return {Graph} + * + * @throws {Error} - Will throw if given attributes are not a plain object. + */ + mergeAttributes(attributes) { + if (!isPlainObject2(attributes)) + throw new InvalidArgumentsGraphError( + "Graph.mergeAttributes: provided attributes are not a plain object." + ); + assign2(this._attributes, attributes); + this.emit("attributesUpdated", { + type: "merge", + attributes: this._attributes, + data: attributes + }); + return this; + } + /** + * Method updating the graph's attributes. + * + * @param {function} updater - Function used to update the attributes. + * @return {Graph} + * + * @throws {Error} - Will throw if given updater is not a function. + */ + updateAttributes(updater) { + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + "Graph.updateAttributes: provided updater is not a function." + ); + this._attributes = updater(this._attributes); + this.emit("attributesUpdated", { + type: "update", + attributes: this._attributes + }); + return this; + } + /** + * Method used to update each node's attributes using the given function. + * + * @param {function} updater - Updater function to use. + * @param {object} [hints] - Optional hints. + */ + updateEachNodeAttributes(updater, hints) { + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + "Graph.updateEachNodeAttributes: expecting an updater function." + ); + if (hints && !validateHints(hints)) + throw new InvalidArgumentsGraphError( + "Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}" + ); + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + nodeData.attributes = updater(nodeData.key, nodeData.attributes); + } + this.emit("eachNodeAttributesUpdated", { + hints: hints ? hints : null + }); + } + /** + * Method used to update each edge's attributes using the given function. + * + * @param {function} updater - Updater function to use. + * @param {object} [hints] - Optional hints. + */ + updateEachEdgeAttributes(updater, hints) { + if (typeof updater !== "function") + throw new InvalidArgumentsGraphError( + "Graph.updateEachEdgeAttributes: expecting an updater function." + ); + if (hints && !validateHints(hints)) + throw new InvalidArgumentsGraphError( + "Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}" + ); + const iterator = this._edges.values(); + let step, edgeData, sourceData, targetData; + while (step = iterator.next(), step.done !== true) { + edgeData = step.value; + sourceData = edgeData.source; + targetData = edgeData.target; + edgeData.attributes = updater( + edgeData.key, + edgeData.attributes, + sourceData.key, + targetData.key, + sourceData.attributes, + targetData.attributes, + edgeData.undirected + ); + } + this.emit("eachEdgeAttributesUpdated", { + hints: hints ? hints : null + }); + } + /**--------------------------------------------------------------------------- + * Iteration-related methods + **--------------------------------------------------------------------------- + */ + /** + * Method iterating over the graph's adjacency using the given callback. + * + * @param {function} callback - Callback to use. + */ + forEachAdjacencyEntry(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.forEachAdjacencyEntry: expecting a callback." + ); + forEachAdjacency(false, false, false, this, callback); + } + forEachAdjacencyEntryWithOrphans(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.forEachAdjacencyEntryWithOrphans: expecting a callback." + ); + forEachAdjacency(false, false, true, this, callback); + } + /** + * Method iterating over the graph's assymetric adjacency using the given callback. + * + * @param {function} callback - Callback to use. + */ + forEachAssymetricAdjacencyEntry(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.forEachAssymetricAdjacencyEntry: expecting a callback." + ); + forEachAdjacency(false, true, false, this, callback); + } + forEachAssymetricAdjacencyEntryWithOrphans(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback." + ); + forEachAdjacency(false, true, true, this, callback); + } + /** + * Method returning the list of the graph's nodes. + * + * @return {array} - The nodes. + */ + nodes() { + return Array.from(this._nodes.keys()); + } + /** + * Method iterating over the graph's nodes using the given callback. + * + * @param {function} callback - Callback (key, attributes, index). + */ + forEachNode(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.forEachNode: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + callback(nodeData.key, nodeData.attributes); + } + } + /** + * Method iterating attempting to find a node matching the given predicate + * function. + * + * @param {function} callback - Callback (key, attributes). + */ + findNode(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.findNode: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + if (callback(nodeData.key, nodeData.attributes)) + return nodeData.key; + } + return; + } + /** + * Method mapping nodes. + * + * @param {function} callback - Callback (key, attributes). + */ + mapNodes(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.mapNode: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + const result2 = new Array(this.order); + let i7 = 0; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + result2[i7++] = callback(nodeData.key, nodeData.attributes); + } + return result2; + } + /** + * Method returning whether some node verify the given predicate. + * + * @param {function} callback - Callback (key, attributes). + */ + someNode(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.someNode: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + if (callback(nodeData.key, nodeData.attributes)) + return true; + } + return false; + } + /** + * Method returning whether all node verify the given predicate. + * + * @param {function} callback - Callback (key, attributes). + */ + everyNode(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.everyNode: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + if (!callback(nodeData.key, nodeData.attributes)) + return false; + } + return true; + } + /** + * Method filtering nodes. + * + * @param {function} callback - Callback (key, attributes). + */ + filterNodes(callback) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.filterNodes: expecting a callback." + ); + const iterator = this._nodes.values(); + let step, nodeData; + const result2 = []; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + if (callback(nodeData.key, nodeData.attributes)) + result2.push(nodeData.key); + } + return result2; + } + /** + * Method reducing nodes. + * + * @param {function} callback - Callback (accumulator, key, attributes). + */ + reduceNodes(callback, initialValue) { + if (typeof callback !== "function") + throw new InvalidArgumentsGraphError( + "Graph.reduceNodes: expecting a callback." + ); + if (arguments.length < 2) + throw new InvalidArgumentsGraphError( + "Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array." + ); + let accumulator = initialValue; + const iterator = this._nodes.values(); + let step, nodeData; + while (step = iterator.next(), step.done !== true) { + nodeData = step.value; + accumulator = callback(accumulator, nodeData.key, nodeData.attributes); + } + return accumulator; + } + /** + * Method returning an iterator over the graph's node entries. + * + * @return {Iterator} + */ + nodeEntries() { + const iterator = this._nodes.values(); + return { + [Symbol.iterator]() { + return this; + }, + next() { + const step = iterator.next(); + if (step.done) + return step; + const data = step.value; + return { + value: { node: data.key, attributes: data.attributes }, + done: false + }; + } + }; + } + /**--------------------------------------------------------------------------- + * Serialization + **--------------------------------------------------------------------------- + */ + /** + * Method used to export the whole graph. + * + * @return {object} - The serialized graph. + */ + export() { + const nodes = new Array(this._nodes.size); + let i7 = 0; + this._nodes.forEach((data, key) => { + nodes[i7++] = serializeNode(key, data); + }); + const edges = new Array(this._edges.size); + i7 = 0; + this._edges.forEach((data, key) => { + edges[i7++] = serializeEdge(this.type, key, data); + }); + return { + options: { + type: this.type, + multi: this.multi, + allowSelfLoops: this.allowSelfLoops + }, + attributes: this.getAttributes(), + nodes, + edges + }; + } + /** + * Method used to import a serialized graph. + * + * @param {object|Graph} data - The serialized graph. + * @param {boolean} merge - Whether to merge data. + * @return {Graph} - Returns itself for chaining. + */ + import(data, merge7 = false) { + if (data instanceof _Graph) { + data.forEachNode((n7, a7) => { + if (merge7) + this.mergeNode(n7, a7); + else + this.addNode(n7, a7); + }); + data.forEachEdge((e10, a7, s7, t8, _sa, _ta, u7) => { + if (merge7) { + if (u7) + this.mergeUndirectedEdgeWithKey(e10, s7, t8, a7); + else + this.mergeDirectedEdgeWithKey(e10, s7, t8, a7); + } else { + if (u7) + this.addUndirectedEdgeWithKey(e10, s7, t8, a7); + else + this.addDirectedEdgeWithKey(e10, s7, t8, a7); + } + }); + return this; + } + if (!isPlainObject2(data)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance." + ); + if (data.attributes) { + if (!isPlainObject2(data.attributes)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid attributes. Expecting a plain object." + ); + if (merge7) + this.mergeAttributes(data.attributes); + else + this.replaceAttributes(data.attributes); + } + let i7, l7, list, node, edge; + if (data.nodes) { + list = data.nodes; + if (!Array.isArray(list)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid nodes. Expecting an array." + ); + for (i7 = 0, l7 = list.length; i7 < l7; i7++) { + node = list[i7]; + validateSerializedNode(node); + const { key, attributes } = node; + if (merge7) + this.mergeNode(key, attributes); + else + this.addNode(key, attributes); + } + } + if (data.edges) { + let undirectedByDefault = false; + if (this.type === "undirected") { + undirectedByDefault = true; + } + list = data.edges; + if (!Array.isArray(list)) + throw new InvalidArgumentsGraphError( + "Graph.import: invalid edges. Expecting an array." + ); + for (i7 = 0, l7 = list.length; i7 < l7; i7++) { + edge = list[i7]; + validateSerializedEdge(edge); + const { + source, + target, + attributes, + undirected = undirectedByDefault + } = edge; + let method2; + if ("key" in edge) { + method2 = merge7 ? undirected ? this.mergeUndirectedEdgeWithKey : this.mergeDirectedEdgeWithKey : undirected ? this.addUndirectedEdgeWithKey : this.addDirectedEdgeWithKey; + method2.call(this, edge.key, source, target, attributes); + } else { + method2 = merge7 ? undirected ? this.mergeUndirectedEdge : this.mergeDirectedEdge : undirected ? this.addUndirectedEdge : this.addDirectedEdge; + method2.call(this, source, target, attributes); + } + } + } + return this; + } + /**--------------------------------------------------------------------------- + * Utils + **--------------------------------------------------------------------------- + */ + /** + * Method returning a null copy of the graph, i.e. a graph without nodes + * & edges but with the exact same options. + * + * @param {object} options - Options to merge with the current ones. + * @return {Graph} - The null copy. + */ + nullCopy(options) { + const graph = new _Graph(assign2({}, this._options, options)); + graph.replaceAttributes(assign2({}, this.getAttributes())); + return graph; + } + /** + * Method returning an empty copy of the graph, i.e. a graph without edges but + * with the exact same options. + * + * @param {object} options - Options to merge with the current ones. + * @return {Graph} - The empty copy. + */ + emptyCopy(options) { + const graph = this.nullCopy(options); + this._nodes.forEach((nodeData, key) => { + const attributes = assign2({}, nodeData.attributes); + nodeData = new graph.NodeDataClass(key, attributes); + graph._nodes.set(key, nodeData); + }); + return graph; + } + /** + * Method returning an exact copy of the graph. + * + * @param {object} options - Upgrade options. + * @return {Graph} - The copy. + */ + copy(options) { + options = options || {}; + if (typeof options.type === "string" && options.type !== this.type && options.type !== "mixed") + throw new UsageGraphError( + `Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${options.type}" because this would mean losing information about the current graph.` + ); + if (typeof options.multi === "boolean" && options.multi !== this.multi && options.multi !== true) + throw new UsageGraphError( + "Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph." + ); + if (typeof options.allowSelfLoops === "boolean" && options.allowSelfLoops !== this.allowSelfLoops && options.allowSelfLoops !== true) + throw new UsageGraphError( + "Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph." + ); + const graph = this.emptyCopy(options); + const iterator = this._edges.values(); + let step, edgeData; + while (step = iterator.next(), step.done !== true) { + edgeData = step.value; + addEdge( + graph, + "copy", + false, + edgeData.undirected, + edgeData.key, + edgeData.source.key, + edgeData.target.key, + assign2({}, edgeData.attributes) + ); + } + return graph; + } + /**--------------------------------------------------------------------------- + * Known methods + **--------------------------------------------------------------------------- + */ + /** + * Method used by JavaScript to perform JSON serialization. + * + * @return {object} - The serialized graph. + */ + toJSON() { + return this.export(); + } + /** + * Method returning [object Graph]. + */ + toString() { + return "[object Graph]"; + } + /** + * Method used internally by node's console to display a custom object. + * + * @return {object} - Formatted object representation of the graph. + */ + inspect() { + const nodes = {}; + this._nodes.forEach((data, key) => { + nodes[key] = data.attributes; + }); + const edges = {}, multiIndex = {}; + this._edges.forEach((data, key) => { + const direction = data.undirected ? "--" : "->"; + let label = ""; + let source = data.source.key; + let target = data.target.key; + let tmp; + if (data.undirected && source > target) { + tmp = source; + source = target; + target = tmp; + } + const desc = `(${source})${direction}(${target})`; + if (!key.startsWith("geid_")) { + label += `[${key}]: `; + } else if (this.multi) { + if (typeof multiIndex[desc] === "undefined") { + multiIndex[desc] = 0; + } else { + multiIndex[desc]++; + } + label += `${multiIndex[desc]}. `; + } + label += desc; + edges[label] = data.attributes; + }); + const dummy = {}; + for (const k6 in this) { + if (this.hasOwnProperty(k6) && !EMITTER_PROPS.has(k6) && typeof this[k6] !== "function" && typeof k6 !== "symbol") + dummy[k6] = this[k6]; + } + dummy.attributes = this._attributes; + dummy.nodes = nodes; + dummy.edges = edges; + privateProperty(dummy, "constructor", this.constructor); + return dummy; + } +}; +if (typeof Symbol !== "undefined") + Graph.prototype[Symbol.for("nodejs.util.inspect.custom")] = Graph.prototype.inspect; +EDGE_ADD_METHODS.forEach((method2) => { + ["add", "merge", "update"].forEach((verb) => { + const name2 = method2.name(verb); + const fn = verb === "add" ? addEdge : mergeEdge; + if (method2.generateKey) { + Graph.prototype[name2] = function(source, target, attributes) { + return fn( + this, + name2, + true, + (method2.type || this.type) === "undirected", + null, + source, + target, + attributes, + verb === "update" + ); + }; + } else { + Graph.prototype[name2] = function(edge, source, target, attributes) { + return fn( + this, + name2, + false, + (method2.type || this.type) === "undirected", + edge, + source, + target, + attributes, + verb === "update" + ); + }; + } + }); +}); +attachNodeAttributesMethods(Graph); +attachEdgeAttributesMethods(Graph); +attachEdgeIterationMethods(Graph); +attachNeighborIterationMethods(Graph); +var DirectedGraph = class extends Graph { + constructor(options) { + const finalOptions = assign2({ type: "directed" }, options); + if ("multi" in finalOptions && finalOptions.multi !== false) + throw new InvalidArgumentsGraphError( + "DirectedGraph.from: inconsistent indication that the graph should be multi in given options!" + ); + if (finalOptions.type !== "directed") + throw new InvalidArgumentsGraphError( + 'DirectedGraph.from: inconsistent "' + finalOptions.type + '" type in given options!' + ); + super(finalOptions); + } +}; +var UndirectedGraph = class extends Graph { + constructor(options) { + const finalOptions = assign2({ type: "undirected" }, options); + if ("multi" in finalOptions && finalOptions.multi !== false) + throw new InvalidArgumentsGraphError( + "UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!" + ); + if (finalOptions.type !== "undirected") + throw new InvalidArgumentsGraphError( + 'UndirectedGraph.from: inconsistent "' + finalOptions.type + '" type in given options!' + ); + super(finalOptions); + } +}; +var MultiGraph = class extends Graph { + constructor(options) { + const finalOptions = assign2({ multi: true }, options); + if ("multi" in finalOptions && finalOptions.multi !== true) + throw new InvalidArgumentsGraphError( + "MultiGraph.from: inconsistent indication that the graph should be simple in given options!" + ); + super(finalOptions); + } +}; +var MultiDirectedGraph = class extends Graph { + constructor(options) { + const finalOptions = assign2({ type: "directed", multi: true }, options); + if ("multi" in finalOptions && finalOptions.multi !== true) + throw new InvalidArgumentsGraphError( + "MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!" + ); + if (finalOptions.type !== "directed") + throw new InvalidArgumentsGraphError( + 'MultiDirectedGraph.from: inconsistent "' + finalOptions.type + '" type in given options!' + ); + super(finalOptions); + } +}; +var MultiUndirectedGraph = class extends Graph { + constructor(options) { + const finalOptions = assign2({ type: "undirected", multi: true }, options); + if ("multi" in finalOptions && finalOptions.multi !== true) + throw new InvalidArgumentsGraphError( + "MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!" + ); + if (finalOptions.type !== "undirected") + throw new InvalidArgumentsGraphError( + 'MultiUndirectedGraph.from: inconsistent "' + finalOptions.type + '" type in given options!' + ); + super(finalOptions); + } +}; +function attachStaticFromMethod(Class) { + Class.from = function(data, options) { + const finalOptions = assign2({}, data.options, options); + const instance = new Class(finalOptions); + instance.import(data); + return instance; + }; +} +attachStaticFromMethod(Graph); +attachStaticFromMethod(DirectedGraph); +attachStaticFromMethod(UndirectedGraph); +attachStaticFromMethod(MultiGraph); +attachStaticFromMethod(MultiDirectedGraph); +attachStaticFromMethod(MultiUndirectedGraph); +Graph.Graph = Graph; +Graph.DirectedGraph = DirectedGraph; +Graph.UndirectedGraph = UndirectedGraph; +Graph.MultiGraph = MultiGraph; +Graph.MultiDirectedGraph = MultiDirectedGraph; +Graph.MultiUndirectedGraph = MultiUndirectedGraph; +Graph.InvalidArgumentsGraphError = InvalidArgumentsGraphError; +Graph.NotFoundGraphError = NotFoundGraphError; +Graph.UsageGraphError = UsageGraphError; + +// src/codegen/renderer.ts +async function renderGenerator(generator, context2, renderedContext) { + const { + configuration, + asyncapiDocument, + openapiDocument, + jsonSchemaDocument, + configFilePath + } = context2; + const outputPath = exports5.resolve( + exports5.dirname(configFilePath), + generator.outputPath ?? "" + ); + const language = generator.language ? generator.language : configuration.language; + Logger.debug( + `Generator ${generator.id}: outputPath=${outputPath}, language=${language}, preset=${generator.preset}` + ); + if (configuration.inputType === "jsonschema" && generator.preset !== "models" && generator.preset !== "custom") { + throw createUnsupportedPresetForInputError({ + preset: generator.preset, + inputType: "jsonschema", + supportedPresets: ["models", "custom"] + }); + } + switch (generator.preset) { + case "payloads": { + switch (language) { + case "typescript": { + return generateTypescriptPayload({ + asyncapiDocument, + openapiDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "payloads", + language: language ?? "unknown" + }); + } + } + } + case "parameters": { + switch (language) { + case "typescript": { + return generateTypescriptParameters({ + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + asyncapiDocument, + openapiDocument, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "parameters", + language: language ?? "unknown" + }); + } + } + } + case "headers": { + switch (language) { + case "typescript": { + return generateTypescriptHeaders({ + asyncapiDocument, + openapiDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "headers", + language: language ?? "unknown" + }); + } + } + } + case "types": { + switch (language) { + case "typescript": { + return generateTypescriptTypes({ + asyncapiDocument, + openapiDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "types", + language: language ?? "unknown" + }); + } + } + } + case "channels": { + switch (language) { + case "typescript": { + return generateTypeScriptChannels({ + asyncapiDocument, + openapiDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "channels", + language: language ?? "unknown" + }); + } + } + } + case "client": { + switch (language) { + case "typescript": { + return generateTypeScriptClient({ + asyncapiDocument, + openapiDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "client", + language: language ?? "unknown" + }); + } + } + } + case "models": { + switch (language) { + case "typescript": { + return generateTypescriptModels({ + asyncapiDocument, + openapiDocument, + jsonSchemaDocument, + generator: { + ...generator, + outputPath + }, + config: configuration, + inputType: configuration.inputType, + dependencyOutputs: renderedContext + }); + } + default: { + throw createUnsupportedLanguageError({ + preset: "models", + language: language ?? "unknown" + }); + } + } + } + case "custom": { + return generator.renderFunction( + { + asyncapiDocument, + openapiDocument, + jsonSchemaDocument, + inputType: configuration.inputType, + dependencyOutputs: renderedContext, + generator + }, + generator.options + ); + } + } +} +function determineRenderGraph(context2) { + const { configuration } = context2; + const duplicateGenerators = findDuplicatesInArray( + context2.configuration.generators, + "id" + ); + if (duplicateGenerators.length > 0) { + throw createDuplicateGeneratorIdError({ duplicateIds: duplicateGenerators }); + } + const graph = new Graph({ allowSelfLoops: true, type: "directed" }); + for (const generator of configuration.generators) { + graph.addNode(generator.id, { generator }); + } + for (const generator of configuration.generators) { + for (const dependency of generator.dependencies ?? []) { + graph.addDirectedEdge(dependency, generator.id); + } + } + if (graph.selfLoopCount !== 0) { + throw createCircularDependencyError(); + } + return graph; +} +function extractFilesFromResult(result2) { + if (result2 && typeof result2 === "object" && "files" in result2 && Array.isArray(result2.files)) { + return result2.files; + } + return []; +} +async function renderGraph(context2, graph) { + const startTime = Date.now(); + const renderedContext = {}; + const generatorResults = []; + const recursivelyRenderGenerators = async (nodesToRender, previousCount) => { + const count2 = nodesToRender.length; + if (previousCount === count2) { + throw createCircularDependencyError(); + } + const nodesToRenderNext = []; + const alreadyRenderedNodes = Object.keys(renderedContext); + for (const nodeEntry of nodesToRender) { + const dependencies = graph.inEdgeEntries(nodeEntry.node); + let allRendered = true; + for (const dependency of dependencies) { + if (!alreadyRenderedNodes.includes(dependency.source)) { + allRendered = false; + break; + } + } + if (allRendered) { + const generatorStartTime = Date.now(); + const generator = nodeEntry.attributes.generator; + Logger.updateSpinner(`Generating ${generator.preset}...`); + const result2 = await renderGenerator( + generator, + context2, + renderedContext + ); + renderedContext[nodeEntry.node] = result2; + const files = extractFilesFromResult(result2); + generatorResults.push({ + id: generator.id, + preset: generator.preset, + files, + duration: Date.now() - generatorStartTime + }); + } else { + nodesToRenderNext.push(nodeEntry); + } + } + if (nodesToRenderNext.length > 0) { + await recursivelyRenderGenerators(nodesToRenderNext, count2); + } + }; + await recursivelyRenderGenerators([...graph.nodeEntries()]); + const allFilesMap = /* @__PURE__ */ new Map(); + for (const result2 of generatorResults) { + for (const file of result2.files) { + allFilesMap.set(file.path, file); + } + } + const allFiles = Array.from(allFilesMap.values()); + return { + generators: generatorResults, + files: allFiles, + totalDuration: Date.now() - startTime + }; +} + +// src/codegen/configurations.ts +var import_cosmiconfig = __toESM(require_dist17()); +init_path(); + +// src/codegen/inputs/asyncapi/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/asyncapi/parser.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_esm(); +var parser2 = new Parser3({ + ruleset: { + core: false, + recommended: false + }, + schemaParsers: [ + AvroSchemaParser(), + OpenAPISchemaParser(), + RamlDTSchemaParser(), + ProtoBuffSchemaParser() + ] +}); + +// src/codegen/inputs/openapi/index.ts +init_dirname(); +init_buffer2(); +init_process2(); + +// src/codegen/inputs/openapi/parser.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_fs(); +init_browser(); + +// src/codegen/detection.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_fs(); +init_path(); +var import_comment_json = __toESM(require_src7()); + +// src/codegen/configurations.ts +var moduleName2 = "codegen"; +var explorer = (0, import_cosmiconfig.cosmiconfig)(moduleName2, { + searchPlaces: [ + `${moduleName2}.json`, + `${moduleName2}.yaml`, + `${moduleName2}.yml`, + `${moduleName2}.js`, + `${moduleName2}.ts`, + `${moduleName2}.mjs`, + `${moduleName2}.cjs` + ], + mergeSearchPlaces: true +}); +function realizeConfiguration(config3) { + config3.generators = config3.generators ?? []; + const generatorIds = []; + for (const [index4, generator] of config3.generators.entries()) { + const language = generator.language ?? config3.language ?? "typescript"; + if (!generator?.preset) { + continue; + } + const defaultGenerator = getDefaultConfiguration( + generator.preset, + language + ); + if (!defaultGenerator) { + throw createInvalidPresetError({ preset: generator.preset, language }); + } + const generatorToUse = mergePartialAndDefault2( + defaultGenerator, + generator + ); + const oldId = generatorToUse.id; + if (generatorToUse.id === defaultGenerator.id) { + const duplicateGenerators = generatorIds.filter( + (generatorId) => generatorId === generatorToUse.id + ); + if (duplicateGenerators.length > 0) { + generatorToUse.id = `${generatorToUse.id}-${duplicateGenerators.length}`; + } + } + generatorIds.push(oldId); + config3.generators[index4] = generatorToUse; + } + try { + zodTheCodegenConfiguration.parse(config3); + } catch (e10) { + const errors = parseZodErrors(e10); + errors.forEach((error2) => Logger.error(error2)); + throw createConfigValidationError({ validationErrors: errors }); + } + const newGenerators = ensureProperGenerators(config3); + config3.generators.push(...newGenerators); + return config3; +} +function ensureProperGenerators(config3) { + const iterateGenerators = (generators) => { + const newGenerators = []; + for (const generator of generators) { + const language = generator.language ?? config3.language; + if (generator.preset === "channels" && language === "typescript") { + newGenerators.push( + ...includeTypeScriptChannelDependencies( + config3, + generator + ) + ); + } + if (generator.preset === "client" && language === "typescript") { + newGenerators.push( + ...includeTypeScriptClientDependencies( + config3, + generator + ) + ); + } + } + if (newGenerators.length > 0) { + newGenerators.push(...iterateGenerators(newGenerators)); + } + return newGenerators; + }; + return iterateGenerators(Array.from(config3.generators.values())); +} +function getDefaultConfiguration(preset, language) { + switch (preset) { + case "payloads": + switch (language) { + case "typescript": + return defaultTypeScriptPayloadGenerator; + } + break; + case "headers": + switch (language) { + case "typescript": + return defaultTypeScriptHeadersOptions; + } + break; + case "types": + switch (language) { + case "typescript": + return defaultTypeScriptTypesOptions; + } + break; + case "models": + switch (language) { + case "typescript": + return defaultTypeScriptModelsOptions; + } + break; + case "channels": + switch (language) { + case "typescript": + return defaultTypeScriptChannelsGenerator; + } + break; + case "client": + switch (language) { + case "typescript": + return defaultTypeScriptClientGenerator; + } + break; + case "custom": + return defaultCustomGenerator; + case "parameters": + switch (language) { + case "typescript": + return defaultTypeScriptParametersOptions; + } + break; + } + return void 0; +} + +// src/browser/generate.ts +async function generate(input) { + const errors = []; + const files = {}; + try { + const configResult = zodTheCodegenConfiguration.safeParse(input.config); + if (!configResult.success) { + errors.push( + `Invalid configuration: ${configResult.error.issues.map((i7) => i7.message).join(", ")}` + ); + return { files, errors }; + } + const config3 = realizeConfiguration( + configResult.data + ); + let asyncapiDocument; + let openapiDocument; + let jsonSchemaDocument; + if (!input.spec || input.spec.trim() === "") { + errors.push("Empty specification provided"); + return { files, errors }; + } + switch (input.specFormat) { + case "asyncapi": + try { + asyncapiDocument = await loadAsyncapiFromMemoryBrowser(input.spec); + } catch (error2) { + let errorMsg = error2 instanceof Error ? error2.message : String(error2); + if (error2 instanceof CodegenError && error2.details) { + errorMsg += ` +${error2.details}`; + } + errors.push(`Failed to parse AsyncAPI spec: ${errorMsg}`); + return { files, errors }; + } + break; + case "openapi": + try { + openapiDocument = await parseOpenAPIFromMemory(input.spec); + } catch (error2) { + errors.push( + `Failed to parse OpenAPI spec: ${error2 instanceof Error ? error2.message : String(error2)}` + ); + return { files, errors }; + } + break; + case "jsonschema": + try { + const parsed = parseSpecString(input.spec); + jsonSchemaDocument = loadJsonSchemaFromMemory( + parsed + ); + } catch (error2) { + errors.push( + `Failed to parse JSON Schema: ${error2 instanceof Error ? error2.message : String(error2)}` + ); + return { files, errors }; + } + break; + default: + errors.push(`Unknown spec format: ${input.specFormat}`); + return { files, errors }; + } + const nodeAsyncapiDocument = asyncapiDocument; + const context2 = { + configuration: config3, + configFilePath: "/virtual-config.mjs", + // Virtual path for browser (root level) + documentPath: "/virtual-spec", + asyncapiDocument: nodeAsyncapiDocument, + openapiDocument, + jsonSchemaDocument + }; + const graph = determineRenderGraph(context2); + const result2 = await renderGraph(context2, graph); + for (const file of result2.files) { + files[file.path] = file.content; + } + } catch (error2) { + errors.push( + `Generation failed: ${error2 instanceof Error ? error2.message : String(error2)}` + ); + } + return { files, errors }; +} +async function parseOpenAPIFromMemory(specString) { + const document2 = parseSpecString(specString); + const parsedDocument = await parse2(document2); + return await dereference2(parsedDocument); +} +function parseSpecString(specString) { + try { + return JSON.parse(specString); + } catch { + return parse(specString); + } +} + +// src/browser/config.ts +init_dirname(); +init_buffer2(); +init_process2(); +init_browser(); +function parseConfig(configString, format5) { + let rawConfig; + try { + if (format5 === "json") { + rawConfig = JSON.parse(configString); + } else { + rawConfig = parse(configString); + } + } catch (error2) { + const message = error2 instanceof Error ? error2.message : "Unknown parse error"; + throw new Error(`Failed to parse ${format5} configuration: ${message}`); + } + const result2 = zodTheCodegenConfiguration.safeParse(rawConfig); + if (!result2.success) { + const errors = result2.error.issues.map((issue) => ` - ${issue.path.join(".")}: ${issue.message}`).join("\n"); + throw new Error(`Invalid configuration: +${errors}`); + } + return result2.data; +} +function serializeConfig(config3, format5) { + if (format5 === "json") { + return JSON.stringify(config3, null, 2); + } + return JSON.stringify(config3, null, 2); +} + +// src/browser/adapters/output.ts +init_dirname(); +init_buffer2(); +init_process2(); +var BrowserOutput = class { + constructor() { + __publicField(this, "files", /* @__PURE__ */ new Map()); + } + /** + * Write a file to memory. + * @param path - The file path (e.g., 'src/models/User.ts') + * @param content - The file content + */ + async write(path2, content) { + this.files.set(path2, content); + } + /** + * No-op for browser - directories are virtual. + */ + async mkdir(_dirPath, _options) { + } + /** + * Get all file paths that were written. + * Implements OutputAdapter interface. + */ + getWrittenFiles() { + return Array.from(this.files.keys()); + } + /** + * Get all files with their content. + * Implements OutputAdapter interface. + */ + getAllFiles() { + const result2 = {}; + for (const [path2, content] of this.files) { + result2[path2] = content; + } + return result2; + } + /** + * Read a file from memory. + * @param path - The file path + * @returns The file content, or undefined if not found + */ + read(path2) { + return this.files.get(path2); + } + /** + * Get all files as a Record. + * @deprecated Use getAllFiles() instead for OutputAdapter compatibility + * @returns A copy of all files as Record + */ + getAll() { + return this.getAllFiles(); + } + /** + * Clear all files from memory. + */ + clear() { + this.files.clear(); + } + /** + * Check if a file exists. + * @param path - The file path + * @returns True if the file exists + */ + has(path2) { + return this.files.has(path2); + } + /** + * Delete a specific file. + * @param path - The file path + * @returns True if the file was deleted, false if it didn't exist + */ + delete(path2) { + return this.files.delete(path2); + } + /** + * Get all file paths. + * @deprecated Use getWrittenFiles() instead for OutputAdapter compatibility + * @returns Array of file paths + */ + getPaths() { + return this.getWrittenFiles(); + } + /** + * Get the number of files. + */ + get size() { + return this.files.size; + } +}; +export { + BrowserOutput, + MemoryAdapter, + generate, + parseConfig, + serializeConfig +}; +/*! Bundled license information: + +@jspm/core/nodelibs/browser/chunk-DtuTasat.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +@asyncapi/parser/browser/index.js: + (*! For license information please see index.js.LICENSE.txt *) + +lodash-es/lodash.default.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** *) + +urijs/src/punycode.js: + (*! https://mths.be/punycode v1.4.0 by @mathias *) + +urijs/src/IPv6.js: + (*! + * URI.js - Mutating URLs + * IPv6 Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + *) + +urijs/src/SecondLevelDomains.js: + (*! + * URI.js - Mutating URLs + * Second Level Domain (SLD) Support + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + *) + +urijs/src/URI.js: + (*! + * URI.js - Mutating URLs + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + *) + +@jspm/core/nodelibs/browser/chunk-CcCWfKp1.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +@jspm/core/nodelibs/browser/chunk-B738Er4n.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +@jspm/core/nodelibs/browser/crypto.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +@jspm/core/nodelibs/browser/chunk-CjPlbOtt.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +uri-js/dist/es5/uri.all.js: + (** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js *) + +@jspm/core/nodelibs/browser/assert.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +typescript/lib/typescript.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** *) + +diff/dist/diff.js: + (*! + + diff v4.0.1 + + Software License Agreement (BSD License) + + Copyright (c) 2009-2015, Kevin Decker + + All rights reserved. + + Redistribution and use of this software in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + + * Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + @license + *) + +typescript/lib/typescript.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** *) + +cosmiconfig/dist/loaders.js: + (* istanbul ignore next -- @preserve *) + +cosmiconfig/dist/util.js: + (* istanbul ignore next -- @preserve *) + +cosmiconfig/dist/ExplorerBase.js: + (* istanbul ignore if -- @preserve *) + (* istanbul ignore next -- @preserve *) + +cosmiconfig/dist/Explorer.js: + (* istanbul ignore if -- @preserve *) + +cosmiconfig/dist/ExplorerSync.js: + (* istanbul ignore if -- @preserve *) + +js-yaml/dist/js-yaml.mjs: + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) +*/ +//# sourceMappingURL=codegen.browser.mjs.map